diff --git a/vega/static/extension.js b/vega/static/extension.js index 3db06871..8a061c62 100644 --- a/vega/static/extension.js +++ b/vega/static/extension.js @@ -1,2 +1,2 @@ -define((()=>(()=>{"use strict";var e,n={};return e=n,Object.defineProperty(e,"__esModule",{value:!0}),e.load_ipython_extension=void 0,void 0!==window.require&&window.require.config({map:{"*":{"jupyter-vega":"nbextensions/jupyter-vega/index"}}}),e.load_ipython_extension=function(){},n})())); +define((()=>(()=>{"use strict";var e,n={};return e=n,Object.defineProperty(e,"__esModule",{value:!0}),e.load_ipython_extension=function(){},void 0!==window.require&&window.require.config({map:{"*":{"jupyter-vega":"nbextensions/jupyter-vega/index"}}}),n})())); //# sourceMappingURL=extension.js.map \ No newline at end of file diff --git a/vega/static/extension.js.map b/vega/static/extension.js.map index 79bae897..8d33b17f 100644 --- a/vega/static/extension.js.map +++ b/vega/static/extension.js.map @@ -1 +1 @@ -{"version":3,"file":"extension.js","mappings":"2IAAgCA,IAA3BC,OAAeC,SACjBD,OAAeC,QAAQC,OAAO,CAC7BC,IAAK,CACH,IAAK,CACH,eAAgB,sCAKxB,oCAA0C,E","sources":["webpack://jupyter-vega/./src/extension.ts"],"sourcesContent":["if ((window as any).require !== undefined) {\n (window as any).require.config({\n map: {\n \"*\": {\n \"jupyter-vega\": \"nbextensions/jupyter-vega/index\",\n },\n },\n });\n}\nexport function load_ipython_extension() {}\n"],"names":["undefined","window","require","config","map"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"extension.js","mappings":"sGASA,oCAA0C,OATVA,IAA3BC,OAAeC,SACjBD,OAAeC,QAAQC,OAAO,CAC7BC,IAAK,CACH,IAAK,CACH,eAAgB,sC","sources":["webpack://jupyter-vega/./src/extension.ts"],"sourcesContent":["if ((window as any).require !== undefined) {\n (window as any).require.config({\n map: {\n \"*\": {\n \"jupyter-vega\": \"nbextensions/jupyter-vega/index\",\n },\n },\n });\n}\nexport function load_ipython_extension() {}\n"],"names":["undefined","window","require","config","map"],"sourceRoot":""} \ No newline at end of file diff --git a/vega/static/index.js b/vega/static/index.js index c094634c..61eb65fc 100644 --- a/vega/static/index.js +++ b/vega/static/index.js @@ -1,3 +1,3 @@ /*! For license information please see index.js.LICENSE.txt */ -define(["@jupyter-widgets/base"],(e=>(()=>{var t={313:e=>{var t=function(){"use strict";function e(e,t){return null!=t&&e instanceof t}var t,n,r;try{t=Map}catch(e){t=function(){}}try{n=Set}catch(e){n=function(){}}try{r=Promise}catch(e){r=function(){}}function i(o,s,u,l,c){"object"==typeof s&&(u=s.depth,l=s.prototype,c=s.includeNonEnumerable,s=s.circular);var f=[],d=[],h="undefined"!=typeof Buffer;return void 0===s&&(s=!0),void 0===u&&(u=1/0),function o(u,p){if(null===u)return null;if(0===p)return u;var g,m;if("object"!=typeof u)return u;if(e(u,t))g=new t;else if(e(u,n))g=new n;else if(e(u,r))g=new r((function(e,t){u.then((function(t){e(o(t,p-1))}),(function(e){t(o(e,p-1))}))}));else if(i.__isArray(u))g=[];else if(i.__isRegExp(u))g=new RegExp(u.source,a(u)),u.lastIndex&&(g.lastIndex=u.lastIndex);else if(i.__isDate(u))g=new Date(u.getTime());else{if(h&&Buffer.isBuffer(u))return g=Buffer.allocUnsafe?Buffer.allocUnsafe(u.length):new Buffer(u.length),u.copy(g),g;e(u,Error)?g=Object.create(u):void 0===l?(m=Object.getPrototypeOf(u),g=Object.create(m)):(g=Object.create(l),m=l)}if(s){var y=f.indexOf(u);if(-1!=y)return d[y];f.push(u),d.push(g)}for(var v in e(u,t)&&u.forEach((function(e,t){var n=o(t,p-1),r=o(e,p-1);g.set(n,r)})),e(u,n)&&u.forEach((function(e){var t=o(e,p-1);g.add(t)})),u){var b;m&&(b=Object.getOwnPropertyDescriptor(m,v)),b&&null==b.set||(g[v]=o(u[v],p-1))}if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(u);for(v=0;v{"use strict";var r=n(81);function i(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}e.exports=function(e){var t=new i;t.pre=e.pre,t.body=e.body,t.post=e.post;var n=e.args.slice(0);t.argTypes=n;for(var o=0;o0)throw new Error("cwise: pre() block may not reference array args");if(o0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===a)t.scalarArgs.push(o),t.shimArgs.push("scalar"+o);else if("index"===a){if(t.indexArgs.push(o),o0)throw new Error("cwise: pre() block may not reference array index");if(o0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===a){if(t.shapeArgs.push(o),on.length)throw new Error("cwise: Too many arguments in pre() block");if(t.body.args.length>n.length)throw new Error("cwise: Too many arguments in body() block");if(t.post.args.length>n.length)throw new Error("cwise: Too many arguments in post() block");return t.debug=!!e.printCode||!!e.debug,t.funcName=e.funcName||"cwise",t.blockSize=e.blockSize||64,r(t)}},984:(e,t,n)=>{"use strict";var r=n(706);function i(e,t,n){var r,i,o=e.length,a=t.arrayArgs.length,s=t.indexArgs.length>0,u=[],l=[],c=0,f=0;for(r=0;r0&&u.push("var "+l.join(",")),r=o-1;r>=0;--r)c=e[r],u.push(["for(i",r,"=0;i",r,"0&&u.push(["index[",f,"]-=s",f].join("")),u.push(["++index[",c,"]"].join(""))),u.push("}")}return u.join("\n")}function o(e,t,n){for(var r=e.body,i=[],o=[],a=0;a0&&(n=n&&t[r]===t[r-1])}return n?t[0]:t.join("")}e.exports=function(e,t){for(var n=t[1].length-Math.abs(e.arrayBlockIndices[0])|0,s=new Array(e.arrayArgs.length),u=new Array(e.arrayArgs.length),l=0;l0&&b.push("shape=SS.slice(0)"),e.indexArgs.length>0){var x=new Array(n);for(l=0;l0&&v.push("var "+b.join(",")),l=0;l3&&v.push(o(e.pre,e,u));var A=o(e.body,e,u),E=function(e){for(var t=0,n=e[0].length;t0,l=[],c=0;c0;){"].join("")),l.push(["if(j",c,"<",s,"){"].join("")),l.push(["s",t[c],"=j",c].join("")),l.push(["j",c,"=0"].join("")),l.push(["}else{s",t[c],"=",s].join("")),l.push(["j",c,"-=",s,"}"].join("")),u&&l.push(["index[",t[c],"]=j",c].join(""));for(c=0;c3&&v.push(o(e.post,e,u)),e.debug&&console.log("-----Generated cwise routine for ",t,":\n"+v.join("\n")+"\n----------");var O=[e.funcName||"unnamed","_cwise_loop_",s[0].join("s"),"m",E,a(u)].join("");return new Function(["function ",O,"(",y.join(","),"){",v.join("\n"),"} return ",O].join(""))()}},81:(e,t,n)=>{"use strict";var r=n(984);e.exports=function(e){var t=["'use strict'","var CACHED={}"],n=[],i=e.funcName+"_cwise_thunk";t.push(["return function ",i,"(",e.shimArgs.join(","),"){"].join(""));for(var o=[],a=[],s=[["array",e.arrayArgs[0],".shape.slice(",Math.max(0,e.arrayBlockIndices[0]),e.arrayBlockIndices[0]<0?","+e.arrayBlockIndices[0]+")":")"].join("")],u=[],l=[],c=0;c0&&(u.push("array"+e.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(e.arrayBlockIndices[0])-Math.abs(e.arrayBlockIndices[c]))),l.push("array"+e.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[c])+"]"))}for(e.arrayArgs.length>1&&(t.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),t.push("for(var shapeIndex=array"+e.arrayArgs[0]+".shape.length-"+Math.abs(e.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),t.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),t.push("}")),c=0;c{"use strict";var r=n(987),i=n(706),o=0;function a(e,t,n){this.name=e,this.lvalue=t,this.rvalue=n,this.count=0}function s(e,t,n,r){this.body=e,this.args=t,this.thisVars=n,this.localVars=r}e.exports=function(e){for(var t=["(",e,")()"].join(""),u=r.parse(t,{range:!0}),l="_inline_"+o+++"_",c=function(e){for(var t=e.body[0].expression.callee.params,n=new Array(t.length),r=0;r=0){var a=f[o],s=function(e){return"AssignmentExpression"===e.parent.type&&e.parent.left===e?"="===e.parent.operator?1:3:"UpdateExpression"===e.parent.type?3:2}(t);1&s&&(a.lvalue=!0),2&s&&(a.rvalue=!0),++a.count,y(t,a.name)}else(function(e){if("eval"===e)throw new Error("cwise-parser: eval() not allowed");return"undefined"!=typeof window?e in window:void 0!==n.g?e in n.g:"undefined"!=typeof self&&e in self})(i)||y(t,function(e){var t=l+e.replace(/\_/g,"__");return g.push(t),t}(i))}else if("Literal"===t.type)"string"==typeof t.value&&y(t,"'"+t.value.replace(/\_/g,"\\_").replace(/\'/g,"'")+"'");else{if("WithStatement"===t.type)throw new Error("cwise-parser: with() statements not allowed");for(var u=Object.keys(t),d=0,h=u.length;d{"use strict";var r=n(615),i=n(239),o=["args","body"],a=["pre","post","printCode","funcName","blockSize"];e.exports=function(e){for(var t in e)o.indexOf(t)<0&&a.indexOf(t)<0&&console.warn("cwise: Unknown argument '"+t+"' passed to expression compiler");for(var n=0;n{"use strict";function t(e,n,r){var i=0|e[r];if(i<=0)return[];var o,a=new Array(i);if(r===e.length-1)for(o=0;o0)return function(e,t){var n,r;for(n=new Array(e),r=0;r=48&&e<=57}function _(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function w(e){return"01234567".indexOf(e)>=0}function k(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function A(e){return 10===e||13===e||8232===e||8233===e}function E(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&s.NonAsciiIdentifierStart.test(String.fromCharCode(e))}function O(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&s.NonAsciiIdentifierPart.test(String.fromCharCode(e))}function D(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function S(e){return"eval"===e||"arguments"===e}function C(e){if(c&&D(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function F(e,t,n,r,i){var o;b("number"==typeof n,"Comment must have valid position"),y.lastCommentStart>=n||(y.lastCommentStart=n,o={type:e,value:t},v.range&&(o.range=[n,r]),v.loc&&(o.loc=i),v.comments.push(o),v.attachComment&&(v.leadingComments.push(o),v.trailingComments.push(o)))}function j(e){var t,n,r,i;for(t=f-e,n={start:{line:d,column:f-h-e}};f=p&&Y({},a.UnexpectedToken,"ILLEGAL");else if(42===n){if(47===l.charCodeAt(f+1))return++f,++f,void(v.comments&&(r=l.slice(e+2,f-2),t.end={line:d,column:f-h},F("Block",r,e,f,t)));++f}else++f;Y({},a.UnexpectedToken,"ILLEGAL")}function $(){var e,t;for(t=0===f;f>>="===(i=l.substr(f,4))?(f+=4,{type:t.Punctuator,value:i,lineNumber:d,lineStart:h,start:o,end:f}):">>>"===(r=i.substr(0,3))||"<<="===r||">>="===r?(f+=3,{type:t.Punctuator,value:r,lineNumber:d,lineStart:h,start:o,end:f}):u===(n=r.substr(0,2))[1]&&"+-<>&|".indexOf(u)>=0||"=>"===n?(f+=2,{type:t.Punctuator,value:n,lineNumber:d,lineStart:h,start:o,end:f}):"<>=!+-*%&|^/".indexOf(u)>=0?(++f,{type:t.Punctuator,value:u,lineNumber:d,lineStart:h,start:o,end:f}):void Y({},a.UnexpectedToken,"ILLEGAL")}function R(){var e,n,r;if(b(x((r=l[f]).charCodeAt(0))||"."===r,"Numeric literal must start with a decimal digit or a decimal point"),n=f,e="","."!==r){if(e=l[f++],r=l[f],"0"===e){if("x"===r||"X"===r)return++f,function(e){for(var n="";f0&&(r=v.tokens[v.tokens.length-1]).range[0]===e&&"Punctuator"===r.type&&("/"!==r.value&&"/="!==r.value||v.tokens.pop()),v.tokens.push({type:"RegularExpression",value:n.literal,range:[e,f],loc:t})),n}function I(){var e,n,i;return $(),f>=p?{type:t.EOF,lineNumber:d,lineStart:h,start:f,end:f}:E(e=l.charCodeAt(f))?(n=f,{type:1===(i=92===l.charCodeAt(f)?B():T()).length?t.Identifier:C(i)?t.Keyword:"null"===i?t.NullLiteral:"true"===i||"false"===i?t.BooleanLiteral:t.Identifier,value:i,lineNumber:d,lineStart:h,start:n,end:f}):40===e||41===e||59===e?z():39===e||34===e?function(){var e,n,r,i,o,s,u,c,g="",m=!1;for(u=d,c=h,b("'"===(e=l[f])||'"'===e,"String literal must starts with a quote"),n=f,++f;f=0&&f=0?z():L()}return L()}return"Keyword"===e.type&&"this"!==e.value?L():z()}():z()}function U(){var e,r,i;return $(),e={start:{line:d,column:f-h}},r=I(),e.end={line:d,column:f-h},r.type!==t.EOF&&(i=l.slice(r.start,r.end),v.tokens.push({type:n[r.type],value:i,range:[r.start,r.end],loc:e})),r}function q(){var e;return f=(e=m).end,d=e.lineNumber,h=e.lineStart,m=void 0!==v.tokens?U():I(),f=e.end,d=e.lineNumber,h=e.lineStart,e}function W(){var e,t,n;e=f,t=d,n=h,m=void 0!==v.tokens?U():I(),f=e,d=t,h=n}function H(e,t){this.line=e,this.column=t}function G(e,t,n,r){this.start=new H(e,t),this.end=new H(n,r)}function V(){var e,t,n,r;return e=f,t=d,n=h,$(),r=d!==t,f=e,d=t,h=n,r}function Y(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(function(e,t){return b(t":case"<=":case">=":case"instanceof":r=7;break;case"in":r=n?7:0;break;case"<<":case">>":case">>>":r=8;break;case"+":case"-":r=9;break;case"*":case"/":case"%":r=11}return r}function ge(){var e,t,n,r,i;return i=m,e=function(){var e,t,n,r,i,o,a,s,u,l;if(e=m,u=he(),0===(i=pe(r=m,y.allowIn)))return u;for(r.prec=i,q(),t=[e,m],o=[u,r,a=he()];(i=pe(m,y.allowIn))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),n=g.createBinaryExpression(s,u,a),t.pop(),e=t[t.length-1],g.markEnd(n,e),o.push(n);(r=q()).prec=i,o.push(r),t.push(m),n=he(),o.push(n)}for(n=o[l=o.length-1],t.pop();l>1;)n=g.createBinaryExpression(o[l-1].value,o[l-2],n),l-=2,e=t.pop(),g.markEnd(n,e);return n}(),Q("?")&&(q(),t=y.allowIn,y.allowIn=!0,n=me(),y.allowIn=t,J(":"),r=me(),e=g.createConditionalExpression(e,n,r),g.markEnd(e,i)),e}function me(){var e,n,r,o,s,u;return e=m,s=m,o=n=ge(),m.type===t.Punctuator&&("="===(u=m.value)||"*="===u||"/="===u||"%="===u||"+="===u||"-="===u||"<<="===u||">>="===u||">>>="===u||"&="===u||"^="===u||"|="===u)&&(ne(n)||X({},a.InvalidLHSInAssignment),c&&n.type===i.Identifier&&S(n.name)&&X(e,a.StrictLHSAssignment),e=q(),r=me(),o=g.markEnd(g.createAssignmentExpression(e.value,n,r),s)),o}function ye(){var e,t=m;if(e=me(),Q(",")){for(e=g.createSequenceExpression([e]);f",n[t.Identifier]="Identifier",n[t.Keyword]="Keyword",n[t.NullLiteral]="Null",n[t.NumericLiteral]="Numeric",n[t.Punctuator]="Punctuator",n[t.StringLiteral]="String",n[t.RegularExpression]="RegularExpression",r=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],i={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},o={Data:1,Get:2,Set:4},a={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},s={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},u={name:"SyntaxTree",processComment:function(e){var t,n;if(!(e.type===i.Program&&e.body.length>0)){for(v.trailingComments.length>0?v.trailingComments[0].range[0]>=e.range[1]?(n=v.trailingComments,v.trailingComments=[]):v.trailingComments.length=0:v.bottomRightStack.length>0&&v.bottomRightStack[v.bottomRightStack.length-1].trailingComments&&v.bottomRightStack[v.bottomRightStack.length-1].trailingComments[0].range[0]>=e.range[1]&&(n=v.bottomRightStack[v.bottomRightStack.length-1].trailingComments,delete v.bottomRightStack[v.bottomRightStack.length-1].trailingComments);v.bottomRightStack.length>0&&v.bottomRightStack[v.bottomRightStack.length-1].range[0]>=e.range[0];)t=v.bottomRightStack.pop();t?t.leadingComments&&t.leadingComments[t.leadingComments.length-1].range[1]<=e.range[0]&&(e.leadingComments=t.leadingComments,delete t.leadingComments):v.leadingComments.length>0&&v.leadingComments[v.leadingComments.length-1].range[1]<=e.range[0]&&(e.leadingComments=v.leadingComments,v.leadingComments=[]),n&&(e.trailingComments=n),v.bottomRightStack.push(e)}},markEnd:function(e,t){return v.range&&(e.range=[t.start,f]),v.loc&&(e.loc=new G(void 0===t.startLineNumber?t.lineNumber:t.startLineNumber,t.start-(void 0===t.startLineStart?t.lineStart:t.startLineStart),d,f-h),this.postProcess(e)),v.attachComment&&this.processComment(e),e},postProcess:function(e){return v.source&&(e.loc.source=v.source),e},createArrayExpression:function(e){return{type:i.ArrayExpression,elements:e}},createAssignmentExpression:function(e,t,n){return{type:i.AssignmentExpression,operator:e,left:t,right:n}},createBinaryExpression:function(e,t,n){return{type:"||"===e||"&&"===e?i.LogicalExpression:i.BinaryExpression,operator:e,left:t,right:n}},createBlockStatement:function(e){return{type:i.BlockStatement,body:e}},createBreakStatement:function(e){return{type:i.BreakStatement,label:e}},createCallExpression:function(e,t){return{type:i.CallExpression,callee:e,arguments:t}},createCatchClause:function(e,t){return{type:i.CatchClause,param:e,body:t}},createConditionalExpression:function(e,t,n){return{type:i.ConditionalExpression,test:e,consequent:t,alternate:n}},createContinueStatement:function(e){return{type:i.ContinueStatement,label:e}},createDebuggerStatement:function(){return{type:i.DebuggerStatement}},createDoWhileStatement:function(e,t){return{type:i.DoWhileStatement,body:e,test:t}},createEmptyStatement:function(){return{type:i.EmptyStatement}},createExpressionStatement:function(e){return{type:i.ExpressionStatement,expression:e}},createForStatement:function(e,t,n,r){return{type:i.ForStatement,init:e,test:t,update:n,body:r}},createForInStatement:function(e,t,n){return{type:i.ForInStatement,left:e,right:t,body:n,each:!1}},createFunctionDeclaration:function(e,t,n,r){return{type:i.FunctionDeclaration,id:e,params:t,defaults:n,body:r,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(e,t,n,r){return{type:i.FunctionExpression,id:e,params:t,defaults:n,body:r,rest:null,generator:!1,expression:!1}},createIdentifier:function(e){return{type:i.Identifier,name:e}},createIfStatement:function(e,t,n){return{type:i.IfStatement,test:e,consequent:t,alternate:n}},createLabeledStatement:function(e,t){return{type:i.LabeledStatement,label:e,body:t}},createLiteral:function(e){return{type:i.Literal,value:e.value,raw:l.slice(e.start,e.end)}},createMemberExpression:function(e,t,n){return{type:i.MemberExpression,computed:"["===e,object:t,property:n}},createNewExpression:function(e,t){return{type:i.NewExpression,callee:e,arguments:t}},createObjectExpression:function(e){return{type:i.ObjectExpression,properties:e}},createPostfixExpression:function(e,t){return{type:i.UpdateExpression,operator:e,argument:t,prefix:!1}},createProgram:function(e){return{type:i.Program,body:e}},createProperty:function(e,t,n){return{type:i.Property,key:t,value:n,kind:e}},createReturnStatement:function(e){return{type:i.ReturnStatement,argument:e}},createSequenceExpression:function(e){return{type:i.SequenceExpression,expressions:e}},createSwitchCase:function(e,t){return{type:i.SwitchCase,test:e,consequent:t}},createSwitchStatement:function(e,t){return{type:i.SwitchStatement,discriminant:e,cases:t}},createThisExpression:function(){return{type:i.ThisExpression}},createThrowStatement:function(e){return{type:i.ThrowStatement,argument:e}},createTryStatement:function(e,t,n,r){return{type:i.TryStatement,block:e,guardedHandlers:t,handlers:n,finalizer:r}},createUnaryExpression:function(e,t){return"++"===e||"--"===e?{type:i.UpdateExpression,operator:e,argument:t,prefix:!0}:{type:i.UnaryExpression,operator:e,argument:t,prefix:!0}},createVariableDeclaration:function(e,t){return{type:i.VariableDeclaration,declarations:e,kind:t}},createVariableDeclarator:function(e,t){return{type:i.VariableDeclarator,id:e,init:t}},createWhileStatement:function(e,t){return{type:i.WhileStatement,test:e,body:t}},createWithStatement:function(e,t){return{type:i.WithStatement,object:e,body:t}}},e.version="1.2.5",e.tokenize=function(e,n){var r;"string"==typeof e||e instanceof String||(e=String(e)),g=u,f=0,d=(l=e).length>0?1:0,h=0,p=l.length,m=null,y={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},v={},(n=n||{}).tokens=!0,v.tokens=[],v.tokenize=!0,v.openParenToken=-1,v.openCurlyToken=-1,v.range="boolean"==typeof n.range&&n.range,v.loc="boolean"==typeof n.loc&&n.loc,"boolean"==typeof n.comment&&n.comment&&(v.comments=[]),"boolean"==typeof n.tolerant&&n.tolerant&&(v.errors=[]);try{if(W(),m.type===t.EOF)return v.tokens;for(q();m.type!==t.EOF;)try{q()}catch(e){if(v.errors){v.errors.push(e);break}throw e}je(),r=v.tokens,void 0!==v.comments&&(r.comments=v.comments),void 0!==v.errors&&(r.errors=v.errors)}catch(e){throw e}finally{v={}}return r},e.parse=function(e,t){var n,r;r=String,"string"==typeof e||e instanceof String||(e=r(e)),g=u,f=0,d=(l=e).length>0?1:0,h=0,p=l.length,m=null,y={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},v={},void 0!==t&&(v.range="boolean"==typeof t.range&&t.range,v.loc="boolean"==typeof t.loc&&t.loc,v.attachComment="boolean"==typeof t.attachComment&&t.attachComment,v.loc&&null!==t.source&&void 0!==t.source&&(v.source=r(t.source)),"boolean"==typeof t.tokens&&t.tokens&&(v.tokens=[]),"boolean"==typeof t.comment&&t.comment&&(v.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(v.errors=[]),v.attachComment&&(v.range=!0,v.comments=[],v.bottomRightStack=[],v.trailingComments=[],v.leadingComments=[]));try{n=Fe(),void 0!==v.comments&&(n.comments=v.comments),void 0!==v.tokens&&(je(),n.tokens=v.tokens),void 0!==v.errors&&(n.errors=v.errors)}catch(e){throw e}finally{v={}}return n},e.Syntax=function(){var e,t={};for(e in"function"==typeof Object.create&&(t=Object.create(null)),i)i.hasOwnProperty(e)&&(t[e]=i[e]);return"function"==typeof Object.freeze&&Object.freeze(t),t}()},void 0===(r=n.apply(t,[t]))||(e.exports=r)}()},63:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){var a=o[i];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}},35:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n,r="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(n=t.cmp,function(e){return function(t,r){var i={key:t,value:e[t]},o={key:r,value:e[r]};return n(i,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var n,a;if(Array.isArray(t)){for(a="[",n=0;n{"use strict";e.exports=function(e){for(var t=new Array(e),n=0;n{function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decompress=void 0;const r=n(591),i=n(51);t.decompress={zlib:e=>r.inflate(new Uint8Array(e)).buffer,lz4:e=>i.decompress(new Uint8Array(e)).buffer}},200:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=t.decompress=t.rowProxy=t.table_serialization=t.EchoTableWidgetView=t.EchoTableWidgetModel=t.TableWidgetModel=void 0;var r=n(811);Object.defineProperty(t,"TableWidgetModel",{enumerable:!0,get:function(){return r.TableWidgetModel}}),Object.defineProperty(t,"EchoTableWidgetModel",{enumerable:!0,get:function(){return r.EchoTableWidgetModel}}),Object.defineProperty(t,"EchoTableWidgetView",{enumerable:!0,get:function(){return r.EchoTableWidgetView}});var i=n(944);Object.defineProperty(t,"table_serialization",{enumerable:!0,get:function(){return i.table_serialization}}),Object.defineProperty(t,"rowProxy",{enumerable:!0,get:function(){return i.rowProxy}});var o=n(474);Object.defineProperty(t,"decompress",{enumerable:!0,get:function(){return o.decompress}}),t.version=n(485).version},944:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.table_serialization=t.tableToJSON=t.rowProxy=t.JSONToTable=void 0;const r=n(861),i=n(474),o={bool:Uint8Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,float32:Float32Array,float64:Float64Array,str:Array},a=Symbol("rowIndex");function s(e,t){if(null===e)return null;var n={},a=1/0;let s,u=new TextDecoder("utf-8");for(const[t,l]of Object.entries(e.data))if(void 0!==l.compression){let e=l.buffer;if(s=i.decompress[l.compression](e.buffer),"str"===l.dtype){let e=s,r=u.decode(e),i=JSON.parse(r);n[t]=i}else n[t]=r(new o[l.dtype](s),l.shape),a=Math.min(a,l.shape[0])}else if("str"===l.dtype){let e=l.buffer;n[t]=e,a=Math.min(a,e.length)}else{let e=l.buffer;n[t]=r(new o[l.dtype](e.buffer),l.shape),a=Math.min(a,l.shape[0])}return{columns:e.columns,data:n,size:a}}function u(e,t){return null}t.JSONToTable=s,t.rowProxy=function(e){if(null===e)return null;var t=e.columns,n={};return t.forEach((t=>{const r=e.data[t],i=r,o=r;n.hasOwnProperty(t)||(void 0===i.shape?Object.defineProperty(n,t,{get:function(){const e=this[a];return o[e]},set:function(){throw Error("Arrow field values can not be overwritten.")},enumerable:!0}):Object.defineProperty(n,t,{get:function(){const e=this[a],t=i.get(e);return isNaN(t)?null:t},set:function(){throw Error("Arrow field values can not be overwritten.")},enumerable:!0}))})),e=>{var t=Object.create(n);return t[a]=e,t}},t.tableToJSON=u,t.table_serialization={deserialize:s,serialize:u}},811:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.EchoTableWidgetView=t.EchoTableWidgetModel=t.TableWidgetModel=void 0;const i=n(146),o=n(861),a=n(149),s=n(944);let u=n(485).version;class l extends i.DOMWidgetModel{defaults(){return Object.assign(Object.assign({},i.DOMWidgetModel.prototype.defaults()),{_model_name:"TableWidgetModel",_view_name:null,_model_module:"jupyter-tablewidgets",_view_module:null,_model_module_version:u,_view_module_version:"",_table:o([]),_columns:[]})}}t.TableWidgetModel=l,l.serializers=Object.assign(Object.assign({},i.DOMWidgetModel.serializers),{_table:s.table_serialization});class c extends i.DOMWidgetModel{defaults(){return Object.assign(Object.assign({},i.DOMWidgetModel.prototype.defaults()),{_model_name:"EchoTableWidgetModel",_view_name:"EchoTableWidgetView",_model_module:"jupyter-tablewidgets",_view_module:"jupyter-tablewidgets",_model_module_version:u,_view_module_version:u,data:[],echo:[]})}}t.EchoTableWidgetModel=c,c.serializers=Object.assign(Object.assign({},i.DOMWidgetModel.serializers),{data:{deserialize:i.unpack_models}});class f extends i.DOMWidgetView{render(){return r(this,void 0,void 0,(function*(){let e=this.model,t=e.get("data").get("_table"),n={columns:t.columns,data:{}};for(const[e,r]of Object.entries(t.data)){let t=r;void 0!==t.dtype?n.data[e]=a(t):n.data[e]=t}e.set("echo",n),this.touch()}))}}t.EchoTableWidgetView=f},51:(e,t,n)=>{var r=n(887),i=n(325),o=65536,a=f(5<<20),s=function(){try{return new Uint32Array(o)}catch(n){for(var e=new Array(o),t=0;t>4&7;if(void 0===c[a])throw new Error("invalid block size "+a);var s=c[a];if(o)return i.readU64(e,t);t++;for(var f=0;;){var d=i.readU32(e,t);if(t+=4,f+=d&l?d&=2147483647:s,0===d)return f;r&&(t+=4),t+=d}},t.makeBuffer=f,t.decompressBlock=function(e,t,n,r,i){var o,a,s,u,l;for(s=n+r;n>4;if(f>0){if(15===f)for(;f+=e[n],255===e[n++];);for(u=n+f;n=s)break;if(o=15&c,a=e[n++]|e[n++]<<8,15===o)for(;o+=e[n],255===e[n++];);for(u=(l=i-a)+(o+=4);l=13)for(var p=67;n+4>>0;if(a=o[m=(m>>16^m)>>>0&65535]-1,o[m]=n+1,a<0||n-a>>>16>0||i.readU32(e,a)!==g)n+=p++>>6;else{for(p=67,c=n-s,l=n-a,a+=4,u=n+=4;n=15){for(t[f++]=240+y,h=c-15;h>=255;h-=255)t[f++]=255;t[f++]=h}else t[f++]=(c<<4)+y;for(var v=0;v>8,u>=15){for(h=u-15;h>=255;h-=255)t[f++]=255;t[f++]=h}s=n}}if(0===s)return 0;if((c=d-s)>=15){for(t[f++]=240,h=c-15;h>=255;h-=255)t[f++]=255;t[f++]=h}else t[f++]=c<<4;for(n=s;n>4&7;if(void 0===c[h])throw new Error("invalid block size");for(a&&(f+=8),f++;;){var p;if(p=i.readU32(e,f),f+=4,0===p)break;if(r&&(f+=4),0!=(p&l)){p&=2147483647;for(var g=0;g>8,l++;var f=c[7],d=e.length,h=0;for(function(e){for(var t=0;t0;){var p,g=d>f?f:d;if((p=t.compressBlock(e,a,h,g,s))>g||0===p){i.writeU32(n,l,2147483648|g),l+=4;for(var m=h+g;h{t.hashU32=function(e){return-1252372727^(e=(e=(e=374761393+(e=-949894596^(e=2127912214+(e|=0)+(e<<12)|0)^e>>>19)+(e<<5)|0)-744332180^e<<9)-42973499+(e<<3)|0)^e>>>16|0},t.readU64=function(e,t){var n=0;return n|=e[t++]<<0,n|=e[t++]<<8,n|=e[t++]<<16,n|=e[t++]<<24,n|=e[t++]<<32,n|=e[t++]<<40,(n|=e[t++]<<48)|e[t++]<<56},t.readU32=function(e,t){var n=0;return n|=e[t++]<<0,n|=e[t++]<<8,(n|=e[t++]<<16)|e[t++]<<24},t.writeU32=function(e,t,n){e[t++]=n>>0&255,e[t++]=n>>8&255,e[t++]=n>>16&255,e[t++]=n>>24&255},t.imul=function(e,t){var n=65535&e,r=65535&t;return n*r+((e>>>16)*r+n*(t>>>16)<<16)|0}},887:(e,t,n)=>{var r=n(325),i=2654435761,o=2246822519,a=3266489917,s=374761393;function u(e,t){return(e|=0)>>>(32-(t|=0)|0)|e<>>(32-t|0)|e<>>(t|=0)^e|0}function f(e,t,n,i,o){return l(r.imul(t,n)+e,i,o)}function d(e,t,n){return l(e+r.imul(t[n],s),11,i)}function h(e,t,n){return f(e,r.readU32(t,n),a,17,668265263)}function p(e,t,n){return[f(e[0],r.readU32(t,n+0),o,13,i),f(e[1],r.readU32(t,n+4),o,13,i),f(e[2],r.readU32(t,n+8),o,13,i),f(e[3],r.readU32(t,n+12),o,13,i)]}t.hash=function(e,t,n,l){var f,g;if(g=l,l>=16){for(f=[e+i+o,e+o,e,e-i];l>=16;)f=p(f,t,n),n+=16,l-=16;f=u(f[0],1)+u(f[1],7)+u(f[2],12)+u(f[3],18)+g}else f=e+s+l>>>0;for(;l>=4;)f=h(f,t,n),n+=4,l-=4;for(;l>0;)f=d(f,t,n),n++,l--;return(f=c(r.imul(c(r.imul(c(f,15),o),13),a),16))>>>0}},149:(e,t,n)=>{"use strict";var r=n(841),i=n(780)({args:["array","scalar","index"],body:function(e,t,n){var r,i=t;for(r=0;r{var r=n(907),i=n(738),o="undefined"!=typeof Float64Array;function a(e,t){return e[0]-t[0]}function s(){var e,t=this.stride,n=new Array(t.length);for(e=0;eMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===t&&o.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push("proto.set=function "+n+"_set("+u.join(",")+",v){"),i?o.push("return this.data.set("+c+",v)}"):o.push("return this.data["+c+"]=v}"),o.push("proto.get=function "+n+"_get("+u.join(",")+"){"),i?o.push("return this.data.get("+c+")}"):o.push("return this.data["+c+"]}"),o.push("proto.index=function "+n+"_index(",u.join(),"){return "+c+"}"),o.push("proto.hi=function "+n+"_hi("+u.join(",")+"){return new "+n+"(this.data,"+a.map((function(e){return["(typeof i",e,"!=='number'||i",e,"<0)?this.shape[",e,"]:i",e,"|0"].join("")})).join(",")+","+a.map((function(e){return"this.stride["+e+"]"})).join(",")+",this.offset)}");var h=a.map((function(e){return"a"+e+"=this.shape["+e+"]"})),p=a.map((function(e){return"c"+e+"=this.stride["+e+"]"}));o.push("proto.lo=function "+n+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+h.join(",")+","+p.join(","));for(var g=0;g=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");for(o.push("return new "+n+"(this.data,"+a.map((function(e){return"a"+e})).join(",")+","+a.map((function(e){return"c"+e})).join(",")+",b)}"),o.push("proto.step=function "+n+"_step("+u.join(",")+"){var "+a.map((function(e){return"a"+e+"=this.shape["+e+"]"})).join(",")+","+a.map((function(e){return"b"+e+"=this.stride["+e+"]"})).join(",")+",c=this.offset,d=0,ceil=Math.ceil"),g=0;g=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");return o.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),o.push("return function construct_"+n+"(data,shape,stride,offset){return new "+n+"(data,"+a.map((function(e){return"shape["+e+"]"})).join(",")+","+a.map((function(e){return"stride["+e+"]"})).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",o.join("\n"))(l[e],s)}var l={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};e.exports=function(e,t,n,r){if(void 0===e)return(0,l.array[0])([]);"number"==typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var a=t.length;if(void 0===n){n=new Array(a);for(var s=a-1,c=1;s>=0;--s)n[s]=c,c*=t[s]}if(void 0===r)for(r=0,s=0;s{"use strict";const{Deflate:r,deflate:i,deflateRaw:o,gzip:a}=n(555),{Inflate:s,inflate:u,inflateRaw:l,ungzip:c}=n(843),f=n(619);e.exports.Deflate=r,e.exports.deflate=i,e.exports.deflateRaw=o,e.exports.gzip=a,e.exports.Inflate=s,e.exports.inflate=u,e.exports.inflateRaw=l,e.exports.ungzip=c,e.exports.constants=f},555:(e,t,n)=>{"use strict";const r=n(405),i=n(236),o=n(373),a=n(898),s=n(292),u=Object.prototype.toString,{Z_NO_FLUSH:l,Z_SYNC_FLUSH:c,Z_FULL_FLUSH:f,Z_FINISH:d,Z_OK:h,Z_STREAM_END:p,Z_DEFAULT_COMPRESSION:g,Z_DEFAULT_STRATEGY:m,Z_DEFLATED:y}=n(619);function v(e){this.options=i.assign({level:g,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:m},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;let n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==h)throw new Error(a[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,n=r.deflateSetDictionary(this.strm,e),n!==h)throw new Error(a[n]);this._dict_set=!0}}function b(e,t){const n=new v(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}v.prototype.push=function(e,t){const n=this.strm,i=this.options.chunkSize;let a,s;if(this.ended)return!1;for(s=t===~~t?t:!0===t?d:l,"string"==typeof e?n.input=o.string2buf(e):"[object ArrayBuffer]"===u.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),(s===c||s===f)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(a=r.deflate(n,s),a===p)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),a=r.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===h;if(0!==n.avail_out){if(s>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},v.prototype.onData=function(e){this.chunks.push(e)},v.prototype.onEnd=function(e){e===h&&(this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},e.exports.Deflate=v,e.exports.deflate=b,e.exports.deflateRaw=function(e,t){return(t=t||{}).raw=!0,b(e,t)},e.exports.gzip=function(e,t){return(t=t||{}).gzip=!0,b(e,t)},e.exports.constants=n(619)},843:(e,t,n)=>{"use strict";const r=n(948),i=n(236),o=n(373),a=n(898),s=n(292),u=n(401),l=Object.prototype.toString,{Z_NO_FLUSH:c,Z_FINISH:f,Z_OK:d,Z_STREAM_END:h,Z_NEED_DICT:p,Z_STREAM_ERROR:g,Z_DATA_ERROR:m,Z_MEM_ERROR:y}=n(619);function v(e){this.options=i.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;let n=r.inflateInit2(this.strm,t.windowBits);if(n!==d)throw new Error(a[n]);if(this.header=new u,r.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=r.inflateSetDictionary(this.strm,t.dictionary),n!==d)))throw new Error(a[n])}function b(e,t){const n=new v(t);if(n.push(e),n.err)throw n.msg||a[n.err];return n.result}v.prototype.push=function(e,t){const n=this.strm,i=this.options.chunkSize,a=this.options.dictionary;let s,u,v;if(this.ended)return!1;for(u=t===~~t?t:!0===t?f:c,"[object ArrayBuffer]"===l.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),s=r.inflate(n,u),s===p&&a&&(s=r.inflateSetDictionary(n,a),s===d?s=r.inflate(n,u):s===m&&(s=p));n.avail_in>0&&s===h&&n.state.wrap>0&&0!==e[n.next_in];)r.inflateReset(n),s=r.inflate(n,u);switch(s){case g:case m:case p:case y:return this.onEnd(s),this.ended=!0,!1}if(v=n.avail_out,n.next_out&&(0===n.avail_out||s===h))if("string"===this.options.to){let e=o.utf8border(n.output,n.next_out),t=n.next_out-e,r=o.buf2string(n.output,e);n.next_out=t,n.avail_out=i-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(r)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(s!==d||0!==v){if(s===h)return s=r.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},v.prototype.onData=function(e){this.chunks.push(e)},v.prototype.onEnd=function(e){e===d&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},e.exports.Inflate=v,e.exports.inflate=b,e.exports.inflateRaw=function(e,t){return(t=t||{}).raw=!0,b(e,t)},e.exports.ungzip=b,e.exports.constants=n(619)},236:e=>{"use strict";const t=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);e.exports.assign=function(e){const n=Array.prototype.slice.call(arguments,1);for(;n.length;){const r=n.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const n in r)t(r,n)&&(e[n]=r[n])}}return e},e.exports.flattenChunks=e=>{let t=0;for(let n=0,r=e.length;n{"use strict";let t=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){t=!1}const n=new Uint8Array(256);for(let e=0;e<256;e++)n[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;n[254]=n[254]=1,e.exports.string2buf=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,r,i,o,a=e.length,s=0;for(i=0;i>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},e.exports.buf2string=(e,r)=>{const i=r||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,r));let o,a;const s=new Array(2*i);for(a=0,o=0;o4)s[a++]=65533,o+=r-1;else{for(t&=2===r?31:3===r?15:7;r>1&&o1?s[a++]=65533:t<65536?s[a++]=t:(t-=65536,s[a++]=55296|t>>10&1023,s[a++]=56320|1023&t)}}return((e,n)=>{if(n<65534&&e.subarray&&t)return String.fromCharCode.apply(null,e.length===n?e:e.subarray(0,n));let r="";for(let t=0;t{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+n[e[r]]>t?r:t}},69:e=>{"use strict";e.exports=(e,t,n,r)=>{let i=65535&e|0,o=e>>>16&65535|0,a=0;for(;0!==n;){a=n>2e3?2e3:n,n-=a;do{i=i+t[r++]|0,o=o+i|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},619:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},869:e=>{"use strict";const t=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());e.exports=(e,n,r,i)=>{const o=t,a=i+r;e^=-1;for(let t=i;t>>8^o[255&(e^n[t])];return-1^e}},405:(e,t,n)=>{"use strict";const{_tr_init:r,_tr_stored_block:i,_tr_flush_block:o,_tr_tally:a,_tr_align:s}=n(342),u=n(69),l=n(869),c=n(898),{Z_NO_FLUSH:f,Z_PARTIAL_FLUSH:d,Z_FULL_FLUSH:h,Z_FINISH:p,Z_BLOCK:g,Z_OK:m,Z_STREAM_END:y,Z_STREAM_ERROR:v,Z_DATA_ERROR:b,Z_BUF_ERROR:x,Z_DEFAULT_COMPRESSION:_,Z_FILTERED:w,Z_HUFFMAN_ONLY:k,Z_RLE:A,Z_FIXED:E,Z_DEFAULT_STRATEGY:O,Z_UNKNOWN:D,Z_DEFLATED:S}=n(619),C=258,F=262,j=42,M=113,$=666,N=(e,t)=>(e.msg=c[t],t),B=e=>2*e-(e>4?9:0),T=e=>{let t=e.length;for(;--t>=0;)e[t]=0},z=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do{n=e.head[--r],e.head[r]=n>=i?n-i:0}while(--t);t=i,r=t;do{n=e.prev[--r],e.prev[r]=n>=i?n-i:0}while(--t)};let R=(e,t,n)=>(t<{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))},L=(e,t)=>{o(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,P(e.strm)},I=(e,t)=>{e.pending_buf[e.pending++]=t},U=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},q=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),1===e.state.wrap?e.adler=u(e.adler,t,i,n):2===e.state.wrap&&(e.adler=l(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},W=(e,t)=>{let n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match;const u=e.strstart>e.w_size-F?e.strstart-(e.w_size-F):0,l=e.window,c=e.w_mask,f=e.prev,d=e.strstart+C;let h=l[o+a-1],p=l[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(n=t,l[n+a]===p&&l[n+a-1]===h&&l[n]===l[o]&&l[++n]===l[o+1]){o+=2,n++;do{}while(l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&oa){if(e.match_start=t,a=r,r>=s)break;h=l[o+a-1],p=l[o+a]}}}while((t=f[t&c])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead},H=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-F)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),z(e),r+=t),0===e.strm.avail_in)break;if(n=q(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=R(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=R(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead{let n,r,o,a=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,u=e.strm.avail_in;do{if(n=65535,o=e.bi_valid+42>>3,e.strm.avail_outr+e.strm.avail_in&&(n=r+e.strm.avail_in),n>o&&(n=o),n>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,P(e.strm),r&&(r>n&&(r=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,n-=r),n&&(q(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(0===s);return u-=e.strm.avail_in,u&&(u>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=u&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-u,e.strm.next_in),e.strstart),e.strstart+=u,e.insert+=u>e.w_size-e.insert?e.w_size-e.insert:u),e.block_start=e.strstart),e.high_watero&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(q(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,a=o>e.w_size?e.w_size:o,r=e.strstart-e.block_start,(r>=a||(r||t===p)&&t!==f&&0===e.strm.avail_in&&r<=o)&&(n=r>o?o:r,s=t===p&&0===e.strm.avail_in&&n===r?1:0,i(e,e.block_start,n,s),e.block_start+=n,P(e.strm)),s?3:1)},V=(e,t)=>{let n,r;for(;;){if(e.lookahead=3&&(e.ins_h=R(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-F&&(e.match_length=W(e,n)),e.match_length>=3)if(r=a(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=R(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=R(e,e.ins_h,e.window[e.strstart+1]);else r=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(L(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===p?(L(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(L(e,!1),0===e.strm.avail_out)?1:2},Y=(e,t)=>{let n,r,i;for(;;){if(e.lookahead=3&&(e.ins_h=R(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,r=a(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=R(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(L(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=a(e,0,e.window[e.strstart-1]),r&&L(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=a(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===p?(L(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(L(e,!1),0===e.strm.avail_out)?1:2};function X(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const Z=[new X(0,0,0,0,G),new X(4,4,8,4,V),new X(4,5,16,8,V),new X(4,6,32,32,V),new X(4,4,16,16,Y),new X(8,16,32,32,Y),new X(8,16,128,128,Y),new X(8,32,128,256,Y),new X(32,128,258,1024,Y),new X(32,258,258,4096,Y)];function J(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=S,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),T(this.dyn_ltree),T(this.dyn_dtree),T(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),T(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),T(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const K=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==j&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==M&&t.status!==$?1:0},Q=e=>{if(K(e))return N(e,v);e.total_in=e.total_out=0,e.data_type=D;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?j:M,e.adler=2===t.wrap?0:1,t.last_flush=-2,r(t),m},ee=e=>{const t=Q(e);var n;return t===m&&((n=e.state).window_size=2*n.w_size,T(n.head),n.max_lazy_match=Z[n.level].max_lazy,n.good_match=Z[n.level].good_length,n.nice_match=Z[n.level].nice_length,n.max_chain_length=Z[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),t},te=(e,t,n,r,i,o)=>{if(!e)return v;let a=1;if(t===_&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>9||n!==S||r<8||r>15||t<0||t>9||o<0||o>E||8===r&&1!==a)return N(e,v);8===r&&(r=9);const s=new J;return e.state=s,s.strm=e,s.status=j,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<te(e,t,S,15,8,O),e.exports.deflateInit2=te,e.exports.deflateReset=ee,e.exports.deflateResetKeep=Q,e.exports.deflateSetHeader=(e,t)=>K(e)||2!==e.state.wrap?v:(e.state.gzhead=t,m),e.exports.deflate=(e,t)=>{if(K(e)||t>g||t<0)return e?N(e,v):v;const n=e.state;if(!e.output||0!==e.avail_in&&!e.input||n.status===$&&t!==p)return N(e,0===e.avail_out?x:v);const r=n.last_flush;if(n.last_flush=t,0!==n.pending){if(P(e),0===e.avail_out)return n.last_flush=-1,m}else if(0===e.avail_in&&B(t)<=B(r)&&t!==p)return N(e,x);if(n.status===$&&0!==e.avail_in)return N(e,x);if(n.status===j&&0===n.wrap&&(n.status=M),n.status===j){let t=S+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=k||n.level<2?0:n.level<6?1:6===n.level?2:3,t|=r<<6,0!==n.strstart&&(t|=32),t+=31-t%31,U(n,t),0!==n.strstart&&(U(n,e.adler>>>16),U(n,65535&e.adler)),e.adler=1,n.status=M,P(e),0!==n.pending)return n.last_flush=-1,m}if(57===n.status)if(e.adler=0,I(n,31),I(n,139),I(n,8),n.gzhead)I(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),I(n,255&n.gzhead.time),I(n,n.gzhead.time>>8&255),I(n,n.gzhead.time>>16&255),I(n,n.gzhead.time>>24&255),I(n,9===n.level?2:n.strategy>=k||n.level<2?4:0),I(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(I(n,255&n.gzhead.extra.length),I(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=l(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(I(n,0),I(n,0),I(n,0),I(n,0),I(n,0),I(n,9===n.level?2:n.strategy>=k||n.level<2?4:0),I(n,3),n.status=M,P(e),0!==n.pending)return n.last_flush=-1,m;if(69===n.status){if(n.gzhead.extra){let t=n.pending,r=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=l(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,P(e),0!==n.pending)return n.last_flush=-1,m;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=l(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=l(e.adler,n.pending_buf,n.pending-r,r)),P(e),0!==n.pending)return n.last_flush=-1,m;r=0}t=n.gzindexr&&(e.adler=l(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=l(e.adler,n.pending_buf,n.pending-r,r)),P(e),0!==n.pending)return n.last_flush=-1,m;r=0}t=n.gzindexr&&(e.adler=l(e.adler,n.pending_buf,n.pending-r,r))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(P(e),0!==n.pending))return n.last_flush=-1,m;I(n,255&e.adler),I(n,e.adler>>8&255),e.adler=0}if(n.status=M,P(e),0!==n.pending)return n.last_flush=-1,m}if(0!==e.avail_in||0!==n.lookahead||t!==f&&n.status!==$){let r=0===n.level?G(n,t):n.strategy===k?((e,t)=>{let n;for(;;){if(0===e.lookahead&&(H(e),0===e.lookahead)){if(t===f)return 1;break}if(e.match_length=0,n=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(L(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===p?(L(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(L(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===A?((e,t)=>{let n,r,i,o;const s=e.window;for(;;){if(e.lookahead<=C){if(H(e),e.lookahead<=C&&t===f)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,r=s[i],r===s[++i]&&r===s[++i]&&r===s[++i])){o=e.strstart+C;do{}while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=a(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(L(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===p?(L(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(L(e,!1),0===e.strm.avail_out)?1:2})(n,t):Z[n.level].func(n,t);if(3!==r&&4!==r||(n.status=$),1===r||3===r)return 0===e.avail_out&&(n.last_flush=-1),m;if(2===r&&(t===d?s(n):t!==g&&(i(n,0,0,!1),t===h&&(T(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),P(e),0===e.avail_out))return n.last_flush=-1,m}return t!==p?m:n.wrap<=0?y:(2===n.wrap?(I(n,255&e.adler),I(n,e.adler>>8&255),I(n,e.adler>>16&255),I(n,e.adler>>24&255),I(n,255&e.total_in),I(n,e.total_in>>8&255),I(n,e.total_in>>16&255),I(n,e.total_in>>24&255)):(U(n,e.adler>>>16),U(n,65535&e.adler)),P(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?m:y)},e.exports.deflateEnd=e=>{if(K(e))return v;const t=e.state.status;return e.state=null,t===M?N(e,b):m},e.exports.deflateSetDictionary=(e,t)=>{let n=t.length;if(K(e))return v;const r=e.state,i=r.wrap;if(2===i||1===i&&r.status!==j||r.lookahead)return v;if(1===i&&(e.adler=u(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){0===i&&(T(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,H(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=R(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,H(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,r.wrap=i,m},e.exports.deflateInfo="pako deflate (from Nodeca project)"},401:e=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},264:e=>{"use strict";const t=16209;e.exports=function(e,n){let r,i,o,a,s,u,l,c,f,d,h,p,g,m,y,v,b,x,_,w,k,A,E,O;const D=e.state;r=e.next_in,E=e.input,i=r+(e.avail_in-5),o=e.next_out,O=e.output,a=o-(n-e.avail_out),s=o+(e.avail_out-257),u=D.dmax,l=D.wsize,c=D.whave,f=D.wnext,d=D.window,h=D.hold,p=D.bits,g=D.lencode,m=D.distcode,y=(1<>>24,h>>>=x,p-=x,x=b>>>16&255,0===x)O[o++]=65535&b;else{if(!(16&x)){if(0==(64&x)){b=g[(65535&b)+(h&(1<>>=x,p-=x),p<15&&(h+=E[r++]<>>24,h>>>=x,p-=x,x=b>>>16&255,!(16&x)){if(0==(64&x)){b=m[(65535&b)+(h&(1<u){e.msg="invalid distance too far back",D.mode=t;break e}if(h>>>=x,p-=x,x=o-a,w>x){if(x=w-x,x>c&&D.sane){e.msg="invalid distance too far back",D.mode=t;break e}if(k=0,A=d,0===f){if(k+=l-x,x<_){_-=x;do{O[o++]=d[k++]}while(--x);k=o-w,A=O}}else if(f2;)O[o++]=A[k++],O[o++]=A[k++],O[o++]=A[k++],_-=3;_&&(O[o++]=A[k++],_>1&&(O[o++]=A[k++]))}else{k=o-w;do{O[o++]=O[k++],O[o++]=O[k++],O[o++]=O[k++],_-=3}while(_>2);_&&(O[o++]=O[k++],_>1&&(O[o++]=O[k++]))}break}}break}}while(r>3,r-=_,p-=_<<3,h&=(1<{"use strict";const r=n(69),i=n(869),o=n(264),a=n(241),{Z_FINISH:s,Z_BLOCK:u,Z_TREES:l,Z_OK:c,Z_STREAM_END:f,Z_NEED_DICT:d,Z_STREAM_ERROR:h,Z_DATA_ERROR:p,Z_MEM_ERROR:g,Z_BUF_ERROR:m,Z_DEFLATED:y}=n(619),v=16180,b=16190,x=16191,_=16192,w=16194,k=16199,A=16200,E=16206,O=16209,D=16210,S=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function C(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const F=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode16211?1:0},j=e=>{if(F(e))return h;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=v,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,c},M=e=>{if(F(e))return h;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,j(e)},$=(e,t)=>{let n;if(F(e))return h;const r=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?h:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,M(e))},N=(e,t)=>{if(!e)return h;const n=new C;e.state=n,n.strm=e,n.window=null,n.mode=v;const r=$(e,t);return r!==c&&(e.state=null),r};let B,T,z=!0;const R=e=>{if(z){B=new Int32Array(512),T=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(1,e.lens,0,288,B,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(2,e.lens,0,32,T,0,e.work,{bits:5}),z=!1}e.lencode=B,e.lenbits=9,e.distcode=T,e.distbits=5},P=(e,t,n,r)=>{let i;const o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),o.window.set(t.subarray(n-r,n-r+i),o.wnext),(r-=i)?(o.window.set(t.subarray(n-r,n),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whaveN(e,15),e.exports.inflateInit2=N,e.exports.inflate=(e,t)=>{let n,C,j,M,$,N,B,T,z,L,I,U,q,W,H,G,V,Y,X,Z,J,K,Q=0;const ee=new Uint8Array(4);let te,ne;const re=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(F(e)||!e.output||!e.input&&0!==e.avail_in)return h;n=e.state,n.mode===x&&(n.mode=_),$=e.next_out,j=e.output,B=e.avail_out,M=e.next_in,C=e.input,N=e.avail_in,T=n.hold,z=n.bits,L=N,I=B,K=c;e:for(;;)switch(n.mode){case v:if(0===n.wrap){n.mode=_;break}for(;z<16;){if(0===N)break e;N--,T+=C[M++]<>>8&255,n.check=i(n.check,ee,2,0),T=0,z=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&T)<<8)+(T>>8))%31){e.msg="incorrect header check",n.mode=O;break}if((15&T)!==y){e.msg="unknown compression method",n.mode=O;break}if(T>>>=4,z-=4,J=8+(15&T),0===n.wbits&&(n.wbits=J),J>15||J>n.wbits){e.msg="invalid window size",n.mode=O;break}n.dmax=1<>8&1),512&n.flags&&4&n.wrap&&(ee[0]=255&T,ee[1]=T>>>8&255,n.check=i(n.check,ee,2,0)),T=0,z=0,n.mode=16182;case 16182:for(;z<32;){if(0===N)break e;N--,T+=C[M++]<>>8&255,ee[2]=T>>>16&255,ee[3]=T>>>24&255,n.check=i(n.check,ee,4,0)),T=0,z=0,n.mode=16183;case 16183:for(;z<16;){if(0===N)break e;N--,T+=C[M++]<>8),512&n.flags&&4&n.wrap&&(ee[0]=255&T,ee[1]=T>>>8&255,n.check=i(n.check,ee,2,0)),T=0,z=0,n.mode=16184;case 16184:if(1024&n.flags){for(;z<16;){if(0===N)break e;N--,T+=C[M++]<>>8&255,n.check=i(n.check,ee,2,0)),T=0,z=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(U=n.length,U>N&&(U=N),U&&(n.head&&(J=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(C.subarray(M,M+U),J)),512&n.flags&&4&n.wrap&&(n.check=i(n.check,C,U,M)),N-=U,M+=U,n.length-=U),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===N)break e;U=0;do{J=C[M+U++],n.head&&J&&n.length<65536&&(n.head.name+=String.fromCharCode(J))}while(J&&U>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=x;break;case 16189:for(;z<32;){if(0===N)break e;N--,T+=C[M++]<>>=7&z,z-=7&z,n.mode=E;break}for(;z<3;){if(0===N)break e;N--,T+=C[M++]<>>=1,z-=1,3&T){case 0:n.mode=16193;break;case 1:if(R(n),n.mode=k,t===l){T>>>=2,z-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=O}T>>>=2,z-=2;break;case 16193:for(T>>>=7&z,z-=7&z;z<32;){if(0===N)break e;N--,T+=C[M++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=O;break}if(n.length=65535&T,T=0,z=0,n.mode=w,t===l)break e;case w:n.mode=16195;case 16195:if(U=n.length,U){if(U>N&&(U=N),U>B&&(U=B),0===U)break e;j.set(C.subarray(M,M+U),$),N-=U,M+=U,B-=U,$+=U,n.length-=U;break}n.mode=x;break;case 16196:for(;z<14;){if(0===N)break e;N--,T+=C[M++]<>>=5,z-=5,n.ndist=1+(31&T),T>>>=5,z-=5,n.ncode=4+(15&T),T>>>=4,z-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=O;break}n.have=0,n.mode=16197;case 16197:for(;n.have>>=3,z-=3}for(;n.have<19;)n.lens[re[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,te={bits:n.lenbits},K=a(0,n.lens,0,19,n.lencode,0,n.work,te),n.lenbits=te.bits,K){e.msg="invalid code lengths set",n.mode=O;break}n.have=0,n.mode=16198;case 16198:for(;n.have>>24,G=Q>>>16&255,V=65535&Q,!(H<=z);){if(0===N)break e;N--,T+=C[M++]<>>=H,z-=H,n.lens[n.have++]=V;else{if(16===V){for(ne=H+2;z>>=H,z-=H,0===n.have){e.msg="invalid bit length repeat",n.mode=O;break}J=n.lens[n.have-1],U=3+(3&T),T>>>=2,z-=2}else if(17===V){for(ne=H+3;z>>=H,z-=H,J=0,U=3+(7&T),T>>>=3,z-=3}else{for(ne=H+7;z>>=H,z-=H,J=0,U=11+(127&T),T>>>=7,z-=7}if(n.have+U>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=O;break}for(;U--;)n.lens[n.have++]=J}}if(n.mode===O)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=O;break}if(n.lenbits=9,te={bits:n.lenbits},K=a(1,n.lens,0,n.nlen,n.lencode,0,n.work,te),n.lenbits=te.bits,K){e.msg="invalid literal/lengths set",n.mode=O;break}if(n.distbits=6,n.distcode=n.distdyn,te={bits:n.distbits},K=a(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,te),n.distbits=te.bits,K){e.msg="invalid distances set",n.mode=O;break}if(n.mode=k,t===l)break e;case k:n.mode=A;case A:if(N>=6&&B>=258){e.next_out=$,e.avail_out=B,e.next_in=M,e.avail_in=N,n.hold=T,n.bits=z,o(e,I),$=e.next_out,j=e.output,B=e.avail_out,M=e.next_in,C=e.input,N=e.avail_in,T=n.hold,z=n.bits,n.mode===x&&(n.back=-1);break}for(n.back=0;Q=n.lencode[T&(1<>>24,G=Q>>>16&255,V=65535&Q,!(H<=z);){if(0===N)break e;N--,T+=C[M++]<>Y)],H=Q>>>24,G=Q>>>16&255,V=65535&Q,!(Y+H<=z);){if(0===N)break e;N--,T+=C[M++]<>>=Y,z-=Y,n.back+=Y}if(T>>>=H,z-=H,n.back+=H,n.length=V,0===G){n.mode=16205;break}if(32&G){n.back=-1,n.mode=x;break}if(64&G){e.msg="invalid literal/length code",n.mode=O;break}n.extra=15&G,n.mode=16201;case 16201:if(n.extra){for(ne=n.extra;z>>=n.extra,z-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;Q=n.distcode[T&(1<>>24,G=Q>>>16&255,V=65535&Q,!(H<=z);){if(0===N)break e;N--,T+=C[M++]<>Y)],H=Q>>>24,G=Q>>>16&255,V=65535&Q,!(Y+H<=z);){if(0===N)break e;N--,T+=C[M++]<>>=Y,z-=Y,n.back+=Y}if(T>>>=H,z-=H,n.back+=H,64&G){e.msg="invalid distance code",n.mode=O;break}n.offset=V,n.extra=15&G,n.mode=16203;case 16203:if(n.extra){for(ne=n.extra;z>>=n.extra,z-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=O;break}n.mode=16204;case 16204:if(0===B)break e;if(U=I-B,n.offset>U){if(U=n.offset-U,U>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=O;break}U>n.wnext?(U-=n.wnext,q=n.wsize-U):q=n.wnext-U,U>n.length&&(U=n.length),W=n.window}else W=j,q=$-n.offset,U=n.length;U>B&&(U=B),B-=U,n.length-=U;do{j[$++]=W[q++]}while(--U);0===n.length&&(n.mode=A);break;case 16205:if(0===B)break e;j[$++]=n.length,B--,n.mode=A;break;case E:if(n.wrap){for(;z<32;){if(0===N)break e;N--,T|=C[M++]<{if(F(e))return h;let t=e.state;return t.window&&(t.window=null),e.state=null,c},e.exports.inflateGetHeader=(e,t)=>{if(F(e))return h;const n=e.state;return 0==(2&n.wrap)?h:(n.head=t,t.done=!1,c)},e.exports.inflateSetDictionary=(e,t)=>{const n=t.length;let i,o,a;return F(e)?h:(i=e.state,0!==i.wrap&&i.mode!==b?h:i.mode===b&&(o=1,o=r(o,t,n,0),o!==i.check)?p:(a=P(e,t,n,n),a?(i.mode=D,g):(i.havedict=1,c)))},e.exports.inflateInfo="pako inflate (from Nodeca project)"},241:e=>{"use strict";const t=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),n=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),r=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),i=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);e.exports=(e,o,a,s,u,l,c,f)=>{const d=f.bits;let h,p,g,m,y,v,b=0,x=0,_=0,w=0,k=0,A=0,E=0,O=0,D=0,S=0,C=null;const F=new Uint16Array(16),j=new Uint16Array(16);let M,$,N,B=null;for(b=0;b<=15;b++)F[b]=0;for(x=0;x=1&&0===F[w];w--);if(k>w&&(k=w),0===w)return u[l++]=20971520,u[l++]=20971520,f.bits=1,0;for(_=1;_0&&(0===e||1!==w))return-1;for(j[1]=0,b=1;b<15;b++)j[b+1]=j[b]+F[b];for(x=0;x852||2===e&&D>592)return 1;for(;;){M=b-E,c[x]+1=v?($=B[c[x]-v],N=C[c[x]-v]):($=96,N=0),h=1<>E)+p]=M<<24|$<<16|N|0}while(0!==p);for(h=1<>=1;if(0!==h?(S&=h-1,S+=h):S=0,x++,0==--F[b]){if(b===w)break;b=o[a+c[x]]}if(b>k&&(S&m)!==g){for(0===E&&(E=k),y+=_,A=b-E,O=1<852||2===e&&D>592)return 1;g=S&m,u[g]=k<<24|A<<16|y-l|0}}return 0!==S&&(u[y+S]=b-E<<24|64<<16|0),f.bits=k,0}},898:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},342:e=>{"use strict";function t(e){let t=e.length;for(;--t>=0;)e[t]=0}const n=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),r=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),o=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=new Array(576);t(a);const s=new Array(60);t(s);const u=new Array(512);t(u);const l=new Array(256);t(l);const c=new Array(29);t(c);const f=new Array(30);function d(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let h,p,g;function m(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}t(f);const y=e=>e<256?u[e]:u[256+(e>>>7)],v=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},b=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<{b(e,n[2*t],n[2*t+1])},_=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},w=(e,t,n)=>{const r=new Array(16);let i,o,a=0;for(i=1;i<=15;i++)a=a+n[i-1]<<1,r[i]=a;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=_(r[t]++,t))}},k=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},A=e=>{e.bi_valid>8?v(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},E=(e,t,n,r)=>{const i=2*t,o=2*n;return e[i]{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i{let o,a,s,u,d=0;if(0!==e.sym_next)do{o=255&e.pending_buf[e.sym_buf+d++],o+=(255&e.pending_buf[e.sym_buf+d++])<<8,a=e.pending_buf[e.sym_buf+d++],0===o?x(e,a,t):(s=l[a],x(e,s+256+1,t),u=n[s],0!==u&&(a-=c[s],b(e,a,u)),o--,s=y(o),x(e,s,i),u=r[s],0!==u&&(o-=f[s],b(e,o,u)))}while(d{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,s,u,l=-1;for(e.heap_len=0,e.heap_max=573,a=0;a>1;a>=1;a--)O(e,n,a);u=o;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],O(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,n[2*u]=n[2*a]+n[2*s],e.depth[u]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,n[2*a+1]=n[2*s+1]=u,e.heap[1]=u++,O(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length;let l,c,f,d,h,p,g=0;for(d=0;d<=15;d++)e.bl_count[d]=0;for(n[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],d=n[2*n[2*c+1]+1]+1,d>u&&(d=u,g++),n[2*c+1]=d,c>r||(e.bl_count[d]++,h=0,c>=s&&(h=a[c-s]),p=n[2*c],e.opt_len+=p*(d+h),o&&(e.static_len+=p*(i[2*c+1]+h)));if(0!==g){do{for(d=u-1;0===e.bl_count[d];)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(d=u;0!==d;d--)for(c=e.bl_count[d];0!==c;)f=e.heap[--l],f>r||(n[2*f+1]!==d&&(e.opt_len+=(d-n[2*f+1])*n[2*f],n[2*f+1]=d),c--)}})(e,t),w(n,l,e.bl_count)},C=(e,t,n)=>{let r,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s{let r,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s{b(e,0+(r?1:0),3),A(e),v(e,n),v(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n};e.exports._tr_init=e=>{j||((()=>{let e,t,o,m,y;const v=new Array(16);for(o=0,m=0;m<28;m++)for(c[m]=o,e=0;e<1<>=7;m<30;m++)for(f[m]=y<<7,e=0;e<1<{let i,u,l=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),S(e,e.l_desc),S(e,e.d_desc),l=(e=>{let t;for(C(e,e.dyn_ltree,e.l_desc.max_code),C(e,e.dyn_dtree,e.d_desc.max_code),S(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*o[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,u=e.static_len+3+7>>>3,u<=i&&(i=u)):i=u=n+5,n+4<=i&&-1!==t?M(e,t,n,r):4===e.strategy||u===i?(b(e,2+(r?1:0),3),D(e,a,s)):(b(e,4+(r?1:0),3),((e,t,n,r)=>{let i;for(b(e,t-257,5),b(e,n-1,5),b(e,r-4,4),i=0;i(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(l[n]+256+1)]++,e.dyn_dtree[2*y(t)]++),e.sym_next===e.sym_end),e.exports._tr_align=e=>{b(e,2,3),x(e,256,a),(e=>{16===e.bi_valid?(v(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}},292:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},607:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.render=t.version=t.VegaWidget=t.VegaWidgetModel=t.vegaEmbed=void 0;const o=n(225);var a=n(225);Object.defineProperty(t,"vegaEmbed",{enumerable:!0,get:function(){return a.default}});var s=n(891);function u(e,t){throw e.innerHTML=`
\n

Javascript Error: ${t.message}

\n

This usually means there's a typo in your chart specification.\n See the JavaScript console for the full traceback.

\n
`,t}Object.defineProperty(t,"VegaWidgetModel",{enumerable:!0,get:function(){return s.VegaWidgetModel}}),Object.defineProperty(t,"VegaWidget",{enumerable:!0,get:function(){return s.VegaWidget}}),t.version=n(147).version,t.render=function(e,t,n,r,i){const a=function(e,t){for(let n=0;n-1&&s>-1)return;const l=document.getElementById(e.substring(1));(0,o.default)(l,t,Object.assign(Object.assign({loader:{http:{credentials:"same-origin"}}},r),{mode:n})).then((t=>{t.view.toImageURL("png").then((t=>{if(void 0!==i){const n={data:{"image/png":t.split(",")[1]},metadata:{"jupyter-vega":e},output_type:"display_data"};i.outputs.push(n)}})).catch((e=>u(l,e)))})).catch((e=>u(l,e)))},i(n(891),t)},412:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MODULE_NAME=t.MODULE_VERSION=void 0;const r=n(147);t.MODULE_VERSION=r.version,t.MODULE_NAME=r.name},891:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.VegaWidget=t.VegaWidgetModel=void 0;const i=n(146),o=n(412),a=n(607),s=n(861),u=n(200);class l extends i.DOMWidgetModel{constructor(){super(...arguments),this.viewInstance=null}defaults(){return Object.assign(Object.assign({},i.DOMWidgetModel.prototype.defaults()),{_model_name:"VegaWidgetModel",_view_name:"VegaWidget",_spec_source:"",_opt_source:"",_df:s([]),_img_url:"",_columns:[]})}}l.serializers=Object.assign(Object.assign({},i.DOMWidgetModel.serializers),{_img_url:{serialize:function(e,t){if(null===t.viewInstance||void 0===t.viewInstance.viewElement||!1===t.viewInstance.hasBeenUpdated)return e;let n=t.viewInstance.viewElement.id;""!==n&&void 0!==n||(n="VEGA_ID_"+crypto.randomUUID(),t.viewInstance.viewElement.id=n);let r=document.querySelector(`#${n} canvas`);return null===r?e:JSON.stringify({width:r.style.width||r.width,height:r.style.height||r.height,url:r.toDataURL()})}},_df:u.table_serialization}),l.model_name="VegaWidgetModel",l.model_module=o.MODULE_NAME,l.model_module_version=o.MODULE_VERSION,l.view_name="VegaWidget",l.view_module=o.MODULE_NAME,l.view_module_version=o.MODULE_VERSION,t.VegaWidgetModel=l;class c extends i.DOMWidgetView{constructor(){super(...arguments),this.hasBeenUpdated=!1,this.viewElement=document.createElement("div"),this.errorElement=document.createElement("div")}render(){return r(this,void 0,void 0,(function*(){this.el.appendChild(this.viewElement),this.errorElement.style.color="red",this.el.appendChild(this.errorElement),this.model.viewInstance=this;const e=()=>r(this,void 0,void 0,(function*(){const e=JSON.parse(this.model.get("_spec_source")),t=JSON.parse(this.model.get("_opt_source")||"{}"),n=this.model.get("_img_url");if(""!==n&&"null"!==n){let e=JSON.parse(n),t=document.createElement("img");t.src=e.url;let r=parseInt(e.height);r>0&&(t.height=r);let i=parseInt(e.width);return i>0&&(t.width=i),this.viewElement.appendChild(t),void this.model.set("_img_url","null")}if(null!=e)try{const n=yield(0,a.vegaEmbed)(this.viewElement,e,Object.assign({loader:{http:{credentials:"same-origin"}}},t));this.result&&this.result.finalize(),this.result=n,this.send({type:"display"})}catch(e){this.result&&this.result.finalize(),console.error(e)}})),t=(e,t)=>r(this,void 0,void 0,(function*(){const n=this.result;if(null==n)throw new Error("Internal error: no view attached to widget");const r=new Function("datum",`return (${e.remove||"false"})`);let i=e.insert||[];switch(i){case"@dataframe":i=this.updateDataFrame();break;case"@array2d":i=this.updateArray2D()}const o=n.view.changeset().remove(r).insert(i),a=n.view.change(e.key,o);t&&a.resize(),yield a.runAsync()})),n=e=>r(this,void 0,void 0,(function*(){this.hasBeenUpdated=!0;for(const n of e.updates)yield t(n,e.resize)}));this.model.on("change:_spec_source",e),this.model.on("change:_opt_source",e),this.model.on("msg:custom",(e=>{const t=function(e){return"update"!=e.type?null:e}(e);null!=t&&n(t).catch((e=>{this.errorElement.textContent=String(e),console.error(e)}))})),yield e()}))}updateDataFrame(){const e=this.model.get("_df"),t=(0,u.rowProxy)(e),n=Array(e.size);for(let e=0;e{"use strict";e.exports=function(e,t,n){return 0===e.length?e:t?(n||e.sort(t),function(e,t){for(var n=1,r=e.length,i=e[0],o=e[0],a=1;a{"use strict";n.r(t),n.d(t,{DEFAULT_ACTIONS:()=>J5,default:()=>u6,guessMode:()=>o6,vega:()=>Y5,vegaLite:()=>X5,version:()=>V5});var r={};n.r(r),n.d(r,{JsonPatchError:()=>M,_areEquals:()=>U,applyOperation:()=>z,applyPatch:()=>R,applyReducer:()=>P,deepClone:()=>$,getValueByPointer:()=>T,validate:()=>I,validator:()=>L});var i={};n.r(i),n.d(i,{compare:()=>Z,generate:()=>Y,observe:()=>V,unobserve:()=>G});var o={};n.r(o),n.d(o,{aggregate:()=>Lu,bin:()=>Iu,collect:()=>qu,compare:()=>Wu,countpattern:()=>Gu,cross:()=>Vu,density:()=>Ju,dotbin:()=>nl,expression:()=>rl,extent:()=>ol,facet:()=>sl,field:()=>ul,filter:()=>cl,flatten:()=>fl,fold:()=>dl,formula:()=>hl,generate:()=>pl,impute:()=>yl,joinaggregate:()=>vl,kde:()=>bl,key:()=>xl,load:()=>wl,lookup:()=>Al,multiextent:()=>El,multivalues:()=>Dl,params:()=>Cl,pivot:()=>Fl,prefacet:()=>jl,project:()=>Ml,proxy:()=>$l,quantile:()=>Nl,relay:()=>Bl,sample:()=>Tl,sequence:()=>zl,sieve:()=>Rl,subflow:()=>al,timeunit:()=>Pl,tupleindex:()=>Il,values:()=>Ul,window:()=>Vl});var a={};n.r(a),n.d(a,{interpolate:()=>xd,interpolateArray:()=>dd,interpolateBasis:()=>ed,interpolateBasisClosed:()=>td,interpolateCubehelix:()=>pp,interpolateCubehelixLong:()=>gp,interpolateDate:()=>pd,interpolateDiscrete:()=>xh,interpolateHcl:()=>tp,interpolateHclLong:()=>np,interpolateHsl:()=>Mh,interpolateHslLong:()=>$h,interpolateHue:()=>_h,interpolateLab:()=>Qh,interpolateNumber:()=>gd,interpolateNumberArray:()=>cd,interpolateObject:()=>md,interpolateRgb:()=>ad,interpolateRgbBasis:()=>ud,interpolateRgbBasisClosed:()=>ld,interpolateRound:()=>_d,interpolateString:()=>bd,interpolateTransformCss:()=>Dh,interpolateTransformSvg:()=>Sh,interpolateZoom:()=>Fh,piecewise:()=>lh,quantize:()=>mp});var s={};n.r(s),n.d(s,{bound:()=>Gx,identifier:()=>Xx,mark:()=>Zx,overlap:()=>Jx,render:()=>i_,viewlayout:()=>E_});var u={};n.r(u),n.d(u,{axisticks:()=>D_,datajoin:()=>S_,encode:()=>F_,legendentries:()=>j_,linkpath:()=>T_,pie:()=>I_,scale:()=>W_,sortitems:()=>Y_,stack:()=>Q_});var l={};n.r(l),n.d(l,{contour:()=>BE,geojson:()=>RE,geopath:()=>PE,geopoint:()=>LE,geoshape:()=>IE,graticule:()=>UE,heatmap:()=>qE,isocontour:()=>EE,kde2d:()=>ME,projection:()=>HE});var c={};n.r(c),n.d(c,{force:()=>LO});var f={};n.r(f),n.d(f,{nest:()=>WD,pack:()=>ZD,partition:()=>KD,stratify:()=>QD,tree:()=>nS,treelinks:()=>rS,treemap:()=>aS});var d={};n.r(d),n.d(d,{label:()=>SS});var h={};n.r(h),n.d(h,{loess:()=>FS,regression:()=>MS});var p={};n.r(p),n.d(p,{voronoi:()=>uC});var g={};n.r(g),n.d(g,{wordcloud:()=>kC});var m={};n.r(m),n.d(m,{crossfilter:()=>FC,resolvefilter:()=>jC});var y={};n.r(y),n.d(y,{Bounds:()=>$m,CanvasHandler:()=>cb,CanvasRenderer:()=>gb,DATE:()=>mr,DAY:()=>yr,DAYOFYEAR:()=>vr,Dataflow:()=>hs,Debug:()=>be,Error:()=>me,EventStream:()=>Qa,Gradient:()=>zg,GroupItem:()=>Bm,HOURS:()=>br,Handler:()=>Gv,Info:()=>ve,Item:()=>Nm,MILLISECONDS:()=>wr,MINUTES:()=>xr,MONTH:()=>pr,Marks:()=>Fv,MultiPulse:()=>ls,None:()=>ge,Operator:()=>Za,Parameters:()=>Va,Pulse:()=>os,QUARTER:()=>hr,RenderType:()=>ax,Renderer:()=>Yv,ResourceLoader:()=>Tm,SECONDS:()=>_r,SVGHandler:()=>yb,SVGRenderer:()=>qb,SVGStringRenderer:()=>rx,Scenegraph:()=>Rv,TIME_UNITS:()=>kr,Transform:()=>gs,View:()=>yN,WEEK:()=>gr,Warn:()=>ye,YEAR:()=>dr,accessor:()=>Q,accessorFields:()=>te,accessorName:()=>ee,array:()=>Ge,ascending:()=>Je,bandwidthNRD:()=>js,bin:()=>Ms,bootstrapCI:()=>Bs,boundClip:()=>px,boundContext:()=>ry,boundItem:()=>jv,boundMark:()=>$v,boundStroke:()=>Pm,changeset:()=>Ha,clampRange:()=>Ve,codegenExpression:()=>lj,compare:()=>Ze,constant:()=>tt,cumulativeLogNormal:()=>Zs,cumulativeNormal:()=>Ws,cumulativeUniform:()=>nu,dayofyear:()=>Fr,debounce:()=>nt,defaultLocale:()=>ra,definition:()=>ys,densityLogNormal:()=>Xs,densityNormal:()=>qs,densityUniform:()=>tu,domChild:()=>Uv,domClear:()=>qv,domCreate:()=>Lv,domFind:()=>Iv,dotbin:()=>Ts,error:()=>oe,expressionFunction:()=>m$,extend:()=>rt,extent:()=>it,extentIndex:()=>ot,falsy:()=>he,fastmap:()=>lt,field:()=>se,flush:()=>ct,font:()=>wv,fontFamily:()=>_v,fontSize:()=>mv,format:()=>Da,formatLocale:()=>Xo,formats:()=>Sa,hasOwnProperty:()=>st,id:()=>ue,identity:()=>le,inferType:()=>xa,inferTypes:()=>_a,ingest:()=>Pa,inherits:()=>ft,inrange:()=>dt,interpolate:()=>ag,interpolateColors:()=>rg,interpolateRange:()=>ng,intersect:()=>lx,intersectBoxLine:()=>py,intersectPath:()=>cy,intersectPoint:()=>fy,intersectRule:()=>hy,isArray:()=>_e,isBoolean:()=>ht,isDate:()=>pt,isFunction:()=>Ye,isIterable:()=>gt,isNumber:()=>mt,isObject:()=>we,isRegExp:()=>yt,isString:()=>vt,isTuple:()=>Ta,key:()=>bt,lerp:()=>xt,lineHeight:()=>yv,loader:()=>ja,locale:()=>na,logger:()=>xe,lruCache:()=>wt,markup:()=>Bb,merge:()=>kt,mergeConfig:()=>Ae,multiLineOffset:()=>bv,one:()=>fe,pad:()=>Et,panLinear:()=>Be,panLog:()=>Te,panPow:()=>ze,panSymlog:()=>Re,parse:()=>GR,parseExpression:()=>aj,parseSelector:()=>BN,path:()=>Zc,pathCurves:()=>Pg,pathEqual:()=>yx,pathParse:()=>Hg,pathRectangle:()=>gm,pathRender:()=>nm,pathSymbols:()=>am,pathTrail:()=>mm,peek:()=>De,point:()=>Hv,projection:()=>hE,quantileLogNormal:()=>Js,quantileNormal:()=>Hs,quantileUniform:()=>ru,quantiles:()=>Cs,quantizeInterpolator:()=>ig,quarter:()=>We,quartiles:()=>Fs,random:()=>$s,randomInteger:()=>Rs,randomKDE:()=>Vs,randomLCG:()=>zs,randomLogNormal:()=>Ks,randomMixture:()=>Qs,randomNormal:()=>Gs,randomUniform:()=>iu,read:()=>Fa,regressionExp:()=>fu,regressionLinear:()=>lu,regressionLoess:()=>vu,regressionLog:()=>cu,regressionPoly:()=>pu,regressionPow:()=>du,regressionQuad:()=>hu,renderModule:()=>ux,repeat:()=>At,resetDefaultLocale:()=>ia,resetSVGClipId:()=>jm,resetSVGDefIds:()=>vx,responseType:()=>Ca,runtimeContext:()=>O$,sampleCurve:()=>wu,sampleLogNormal:()=>Ys,sampleNormal:()=>Us,sampleUniform:()=>eu,scale:()=>Gp,sceneEqual:()=>mx,sceneFromJSON:()=>Tv,scenePickVisit:()=>Ey,sceneToJSON:()=>Bv,sceneVisit:()=>Ay,sceneZOrder:()=>ky,scheme:()=>cg,serializeXML:()=>Tb,setRandom:()=>Ns,span:()=>Ot,splitAccessPath:()=>ae,stringValue:()=>Dt,textMetrics:()=>cv,timeBin:()=>gi,timeFloor:()=>Gr,timeFormatLocale:()=>ea,timeInterval:()=>Kr,timeOffset:()=>ti,timeSequence:()=>ii,timeUnitSpecifier:()=>Dr,timeUnits:()=>Er,toBoolean:()=>St,toDate:()=>Ft,toNumber:()=>Se,toSet:()=>Mt,toString:()=>jt,transform:()=>vs,transforms:()=>ms,truncate:()=>$t,truthy:()=>de,tupleid:()=>za,typeParsers:()=>ya,utcFloor:()=>Xr,utcInterval:()=>Qr,utcOffset:()=>ni,utcSequence:()=>oi,utcdayofyear:()=>Tr,utcquarter:()=>He,utcweek:()=>zr,version:()=>VR,visitArray:()=>Nt,week:()=>jr,writeConfig:()=>Ee,zero:()=>ce,zoomLinear:()=>Le,zoomLog:()=>Ie,zoomPow:()=>Ue,zoomSymlog:()=>qe});var v={};n.r(v),n.d(v,{accessPathDepth:()=>vL,accessPathWithDatum:()=>dL,compile:()=>V1,contains:()=>GP,deepEqual:()=>PP,deleteNestedProperty:()=>cL,duplicate:()=>LP,entries:()=>aL,every:()=>YP,fieldIntersection:()=>nL,flatAccessWithDatum:()=>hL,getFirstDefined:()=>bL,hasIntersection:()=>eL,hash:()=>WP,internalField:()=>kL,isBoolean:()=>sL,isEmpty:()=>rL,isEqual:()=>KP,isInternalField:()=>AL,isNullOrFalse:()=>HP,isNumeric:()=>OL,keys:()=>iL,logicalExpr:()=>lL,mergeDeep:()=>XP,normalize:()=>EY,normalizeAngle:()=>EL,omit:()=>UP,pick:()=>IP,prefixGenerator:()=>tL,removePathFromField:()=>yL,replaceAll:()=>mL,replacePathInField:()=>gL,resetIdCounter:()=>wL,setEqual:()=>QP,some:()=>VP,stringify:()=>qP,titleCase:()=>fL,unique:()=>JP,uniqueId:()=>_L,vals:()=>oL,varName:()=>uL,version:()=>oP.i8});var b={};n.r(b),n.d(b,{dark:()=>J1,excel:()=>Q1,fivethirtyeight:()=>i2,ggplot2:()=>a2,googlecharts:()=>D2,latimes:()=>d2,powerbi:()=>L2,quartz:()=>g2,urbaninstitute:()=>k2,version:()=>I2,vox:()=>y2});var x,_=(x=function(e,t){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},x(e,t)},function(e,t){function n(){this.constructor=e}x(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),w=Object.prototype.hasOwnProperty;function k(e,t){return w.call(e,t)}function A(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n=48&&t<=57))return!1;n++}return!0}function D(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function S(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function C(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,n=e.length;t0&&"constructor"==s[l-1]))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&void 0===f&&(void 0===u[d]?f=s.slice(0,l).join("/"):l==c-1&&(f=t.path),void 0!==f&&h(t,0,e,f)),l++,Array.isArray(u)){if("-"===d)d=u.length;else{if(n&&!O(d))throw new M("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);O(d)&&(d=~~d)}if(l>=c){if(n&&"add"===t.op&&d>u.length)throw new M("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);if(!1===(a=B[t.op].call(t,u,d,e)).test)throw new M("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(l>=c){if(!1===(a=N[t.op].call(t,u,d,e)).test)throw new M("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}if(u=u[d],n&&l0)throw new M('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new M("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new M("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&C(e.value))throw new M("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n)if("add"==e.op){var i=e.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new M("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==r)throw new M("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if("move"===e.op||"copy"===e.op){var a=I([{op:"_get",path:e.from,value:void 0}],n);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new M("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}function I(e,t,n){try{if(!Array.isArray(e))throw new M("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)R(E(t),E(e),n||!0);else{n=n||L;for(var r=0;r0&&(e.patches=[],e.callback&&e.callback(r)),r}function X(e,t,n,r,i){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var o=A(t),a=A(e),s=!1,u=a.length-1;u>=0;u--){var l=e[f=a[u]];if(!k(t,f)||void 0===t[f]&&void 0!==l&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:"test",path:r+"/"+D(f),value:E(l)}),n.push({op:"remove",path:r+"/"+D(f)}),s=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}));else{var c=t[f];"object"==typeof l&&null!=l&&"object"==typeof c&&null!=c&&Array.isArray(l)===Array.isArray(c)?X(l,c,n,r+"/"+D(f),i):l!==c&&(i&&n.push({op:"test",path:r+"/"+D(f),value:E(l)}),n.push({op:"replace",path:r+"/"+D(f),value:E(c)}))}}if(s||o.length!=a.length)for(u=0;ufunction(t){return t[e]},ie=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),s=r=i+1):"]"===o&&(s||oe("Access path missing open bracket: "+e),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&oe("Access path missing closing bracket: "+e),a&&oe("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function se(e,t,n){const r=ae(e);return e=1===r.length?r[0]:e,Q((n&&n.get||ne)(r),[e],t||e)}const ue=se("id"),le=Q((e=>e),[],"identity"),ce=Q((()=>0),[],"zero"),fe=Q((()=>1),[],"one"),de=Q((()=>!0),[],"true"),he=Q((()=>!1),[],"false");function pe(e,t,n){const r=[t].concat([].slice.call(n));console[e].apply(console,r)}const ge=0,me=1,ye=2,ve=3,be=4;function xe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pe,r=e||ge;return{level(e){return arguments.length?(r=+e,this):r},error(){return r>=me&&n(t||"error","ERROR",arguments),this},warn(){return r>=ye&&n(t||"warn","WARN",arguments),this},info(){return r>=ve&&n(t||"log","INFO",arguments),this},debug(){return r>=be&&n(t||"log","DEBUG",arguments),this}}}var _e=Array.isArray;function we(e){return e===Object(e)}const ke=e=>"__proto__"!==e;function Ae(){for(var e=arguments.length,t=new Array(e),n=0;n{for(const n in t)if("signals"===n)e.signals=Oe(e.signals,t.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;Ee(e,n,t[n],r)}return e}),{})}function Ee(e,t,n,r){if(!ke(t))return;let i,o;if(we(n)&&!_e(n))for(i in o=we(e[t])?e[t]:e[t]={},n)r&&(!0===r||r[i])?Ee(o,i,n[i]):ke(i)&&(o[i]=n[i]);else e[t]=n}function Oe(e,t){if(null==e)return t;const n={},r=[];function i(e){n[e.name]||(n[e.name]=1,r.push(e))}return t.forEach(i),e.forEach(i),r}function De(e){return e[e.length-1]}function Se(e){return null==e||""===e?null:+e}const Ce=e=>t=>e*Math.exp(t),Fe=e=>t=>Math.log(e*t),je=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),Me=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,$e=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function Ne(e,t,n,r){const i=n(e[0]),o=n(De(e)),a=(o-i)*t;return[r(i-a),r(o-a)]}function Be(e,t){return Ne(e,t,Se,le)}function Te(e,t){var n=Math.sign(e[0]);return Ne(e,t,Fe(n),Ce(n))}function ze(e,t,n){return Ne(e,t,$e(n),$e(1/n))}function Re(e,t,n){return Ne(e,t,je(n),Me(n))}function Pe(e,t,n,r,i){const o=r(e[0]),a=r(De(e)),s=null!=t?r(t):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function Le(e,t,n){return Pe(e,t,n,Se,le)}function Ie(e,t,n){const r=Math.sign(e[0]);return Pe(e,t,n,Fe(r),Ce(r))}function Ue(e,t,n,r){return Pe(e,t,n,$e(r),$e(1/r))}function qe(e,t,n,r){return Pe(e,t,n,je(r),Me(r))}function We(e){return 1+~~(new Date(e).getMonth()/3)}function He(e){return 1+~~(new Date(e).getUTCMonth()/3)}function Ge(e){return null!=e?_e(e)?e:[e]:[]}function Ve(e,t,n){let r,i=e[0],o=e[1];return o=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-r),i+r]}function Ye(e){return"function"==typeof e}const Xe="descending";function Ze(e,t,n){n=n||{},t=Ge(t)||[];const r=[],i=[],o={},a=n.comparator||Ke;return Ge(e).forEach(((e,a)=>{null!=e&&(r.push(t[a]===Xe?-1:1),i.push(e=Ye(e)?e:se(e,null,n)),(te(e)||[]).forEach((e=>o[e]=1)))})),0===i.length?null:Q(a(i,r),Object.keys(o))}const Je=(e,t)=>(et||null==t)&&null!=e?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t==t?-1:t!=t&&e==e?1:0),Ke=(e,t)=>1===e.length?Qe(e[0],t[0]):et(e,t,e.length),Qe=(e,t)=>function(n,r){return Je(e(n),e(r))*t},et=(e,t,n)=>(t.push(0),function(r,i){let o,a=0,s=-1;for(;0===a&&++se}function nt(e,t){let n;return r=>{n&&clearTimeout(n),n=setTimeout((()=>(t(r),n=null)),e)}}function rt(e){for(let t,n,r=1,i=arguments.length;ro&&(o=r))}else{for(r=t(e[a]);ao&&(o=r))}return[i,o]}function ot(e,t){const n=e.length;let r,i,o,a,s,u=-1;if(null==t){for(;++u=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++ui&&(r=i,a=u),o=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++ui&&(r=i,a=u),or(e)?n[e]:void 0,set(e,t){return r(e)||(++i.size,n[e]===ut&&--i.empty),n[e]=t,this},delete(e){return r(e)&&(--i.size,++i.empty,n[e]=ut),this},clear(){i.size=i.empty=0,i.object=n={}},test(e){return arguments.length?(t=e,i):t},clean(){const e={};let r=0;for(const i in n){const o=n[i];o===ut||t&&t(o)||(e[i]=o,++r)}i.size=r,i.empty=0,i.object=n=e}};return e&&Object.keys(e).forEach((t=>{i.set(t,e[t])})),i}function ct(e,t,n,r,i,o){if(!n&&0!==n)return o;const a=+n;let s,u=e[0],l=De(e);la&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=e:oe.replace(/\\(.)/g,"$1"))):Ge(e));const r=e&&e.length,i=n&&n.get||ne,o=e=>i(t?[e]:ae(e));let a;if(r)if(1===r){const t=o(e[0]);a=function(e){return""+t(e)}}else{const t=e.map(o);a=function(e){let n=""+t[0](e),i=0;for(;++i{t={},n={},r=0},o=(i,o)=>(++r>e&&(n=t,t={},r=1),t[i]=o);return i(),{clear:i,has:e=>st(t,e)||st(n,e),get:e=>st(t,e)?t[e]:st(n,e)?o(e,n[e]):void 0,set:(e,n)=>st(t,e)?t[e]=n:o(e,n)}}function kt(e,t,n,r){const i=t.length,o=n.length;if(!o)return t;if(!i)return n;const a=r||new t.constructor(i+o);let s=0,u=0,l=0;for(;s0?n[u++]:t[s++];for(;s=0;)n+=e;return n}function Et(e,t,n,r){const i=n||" ",o=e+"",a=t-o.length;return a<=0?o:"left"===r?At(i,a)+o:"center"===r?At(i,~~(a/2))+o+At(i,Math.ceil(a/2)):o+At(i,a)}function Ot(e){return e&&De(e)-e[0]||0}function Dt(e){return _e(e)?"["+e.map(Dt)+"]":we(e)||vt(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function St(e){return null==e||""===e?null:!(!e||"false"===e||"0"===e||!e)}const Ct=e=>mt(e)||pt(e)?e:Date.parse(e);function Ft(e,t){return t=t||Ct,null==e||""===e?null:t(e)}function jt(e){return null==e||""===e?null:e+""}function Mt(e){const t={},n=e.length;for(let r=0;r=o?u=!0:(r=e.charCodeAt(a++))===Rt?l=!0:r===Pt&&(l=!0,e.charCodeAt(a)===Rt&&++a),e.slice(i+1,t-1).replace(/""/g,'"')}for(;a9999?"+"+Ut(t,6):Ut(t,4))+"-"+Ut(e.getUTCMonth()+1,2)+"-"+Ut(e.getUTCDate(),2)+(o?"T"+Ut(n,2)+":"+Ut(r,2)+":"+Ut(i,2)+"."+Ut(o,3)+"Z":i?"T"+Ut(n,2)+":"+Ut(r,2)+":"+Ut(i,2)+"Z":r||n?"T"+Ut(n,2)+":"+Ut(r,2)+"Z":"")}(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function(e,t){var n,i,o=r(e,(function(e,r){if(n)return n(e,r-1);i=e,n=t?function(e,t){var n=Lt(e);return function(r,i){return t(n(r),i,e)}}(e,t):Lt(e)}));return o.columns=i||[],o},parseRows:r,format:function(t,n){return null==n&&(n=It(t)),[n.map(a).join(e)].concat(i(t,n)).join("\n")},formatBody:function(e,t){return null==t&&(t=It(e)),i(e,t).join("\n")},formatRows:function(e){return e.map(o).join("\n")},formatRow:o,formatValue:a}}function Wt(e){return e}function Ht(e,t){return"string"==typeof t&&(t=e.objects[t]),"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map((function(t){return Gt(e,t)}))}:Gt(e,t)}function Gt(e,t){var n=t.id,r=t.bbox,i=null==t.properties?{}:t.properties,o=Vt(e,t);return null==n&&null==r?{type:"Feature",properties:i,geometry:o}:null==r?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}function Vt(e,t){var n=function(e){if(null==e)return Wt;var t,n,r=e.scale[0],i=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=n=0);var u=2,l=e.length,c=new Array(l);for(c[0]=(t+=e[0])*r+o,c[1]=(n+=e[1])*i+a;u1)r=function(e,t,n){var r,i=[],o=[];function a(e){var t=e<0?~e:e;(o[t]||(o[t]=[])).push({i:e,g:r})}function s(e){e.forEach(a)}function u(e){e.forEach(s)}return function e(t){switch(r=t,t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"LineString":s(t.arcs);break;case"MultiLineString":case"Polygon":u(t.arcs);break;case"MultiPolygon":!function(e){e.forEach(u)}(t.arcs)}}(t),o.forEach(null==n?function(e){i.push(e[0].i)}:function(e){n(e[0].g,e[e.length-1].g)&&i.push(e[0].i)}),i}(0,t,n);else for(i=0,r=new Array(o=e.arcs.length);i=Jt?10:o>=Kt?5:o>=Qt?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(e*l),u=Math.round(t*l),s/lt&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(e/l),u=Math.round(t/l),s*lt&&--u),u0))return[];if((e=+e)==(t=+t))return[e];const r=t=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let e=0;e=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function sn(e){if(!(t=an.exec(e)))throw new Error("invalid format: "+e);var t;return new un({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function un(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function ln(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function cn(e){return(e=ln(Math.abs(e)))?e[1]:NaN}function fn(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(cn(t)/3)))-cn(Math.abs(e)))}function dn(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,cn(t)-cn(e))+1}function hn(e){return Math.max(0,-cn(Math.abs(e)))}function pn(e,t){var n=ln(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}sn.prototype=un.prototype,un.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const gn={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>pn(100*e,t),r:pn,s:function(e,t){var n=ln(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(on=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ln(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function mn(e){return e}var yn,vn,bn,xn=Array.prototype.map,_n=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function wn(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?mn:(t=xn.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(e.substring(i-=s,i+s)),!((u+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?mn:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(xn.call(e.numerals,String)),u=void 0===e.percent?"%":e.percent+"",l=void 0===e.minus?"−":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function f(e){var t=(e=sn(e)).fill,n=e.align,f=e.sign,d=e.symbol,h=e.zero,p=e.width,g=e.comma,m=e.precision,y=e.trim,v=e.type;"n"===v?(g=!0,v="g"):gn[v]||(void 0===m&&(m=12),y=!0,v="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var b="$"===d?i:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===d?o:/[%p]/.test(v)?u:"",_=gn[v],w=/[defgprs%]/.test(v);function k(e){var i,o,u,d=b,k=x;if("c"===v)k=_(e)+k,e="";else{var A=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:_(Math.abs(e),m),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),A&&0==+e&&"+"!==f&&(A=!1),d=(A?"("===f?f:l:"-"===f||"("===f?"":f)+d,k=("s"===v?_n[8+on/3]:"")+k+(A&&"("===f?")":""),w)for(i=-1,o=e.length;++i(u=e.charCodeAt(i))||u>57){k=(46===u?a+e.slice(i+1):e.slice(i))+k,e=e.slice(0,i);break}}g&&!h&&(e=r(e,1/0));var E=d.length+e.length+k.length,O=E>1)+d+e+k+O.slice(E);break;default:e=O+d+e+k}return s(e)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),k.toString=function(){return e+""},k}return{format:f,formatPrefix:function(e,t){var n=f(((e=sn(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(cn(t)/3))),i=Math.pow(10,-r),o=_n[8+r/3];return function(e){return n(i*e)+o}}}}yn=wn({thousands:",",grouping:[3],currency:["$",""]}),vn=yn.format,bn=yn.formatPrefix;const kn=new Date,An=new Date;function En(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(sEn((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})),n&&(i.count=(t,r)=>(kn.setTime(+t),An.setTime(+r),e(kn),e(An),Math.floor(n(kn,An))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e==0:t=>i.count(0,t)%e==0):i:null)),i}const On=1e3,Dn=6e4,Sn=60*Dn,Cn=24*Sn,Fn=7*Cn,jn=30*Cn,Mn=365*Cn,$n=En((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Dn)/Cn),(e=>e.getDate()-1)),Nn=($n.range,En((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/Cn),(e=>e.getUTCDate()-1))),Bn=(Nn.range,En((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/Cn),(e=>Math.floor(e/Cn))));function Tn(e){return En((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Dn)/Fn))}Bn.range;const zn=Tn(0),Rn=Tn(1),Pn=Tn(2),Ln=Tn(3),In=Tn(4),Un=Tn(5),qn=Tn(6);function Wn(e){return En((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/Fn))}zn.range,Rn.range,Pn.range,Ln.range,In.range,Un.range,qn.range;const Hn=Wn(0),Gn=Wn(1),Vn=Wn(2),Yn=Wn(3),Xn=Wn(4),Zn=Wn(5),Jn=Wn(6),Kn=(Hn.range,Gn.range,Vn.range,Yn.range,Xn.range,Zn.range,Jn.range,En((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear())));Kn.every=e=>isFinite(e=Math.floor(e))&&e>0?En((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,Kn.range;const Qn=En((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));Qn.every=e=>isFinite(e=Math.floor(e))&&e>0?En((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,Qn.range;const er=En((e=>{e.setDate(1),e.setHours(0,0,0,0)}),((e,t)=>{e.setMonth(e.getMonth()+t)}),((e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())),(e=>e.getMonth())),tr=(er.range,En((e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)}),((e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())),(e=>e.getUTCMonth()))),nr=(tr.range,En((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*On-e.getMinutes()*Dn)}),((e,t)=>{e.setTime(+e+t*Sn)}),((e,t)=>(t-e)/Sn),(e=>e.getHours()))),rr=(nr.range,En((e=>{e.setUTCMinutes(0,0,0)}),((e,t)=>{e.setTime(+e+t*Sn)}),((e,t)=>(t-e)/Sn),(e=>e.getUTCHours()))),ir=(rr.range,En((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*On)}),((e,t)=>{e.setTime(+e+t*Dn)}),((e,t)=>(t-e)/Dn),(e=>e.getMinutes()))),or=(ir.range,En((e=>{e.setUTCSeconds(0,0)}),((e,t)=>{e.setTime(+e+t*Dn)}),((e,t)=>(t-e)/Dn),(e=>e.getUTCMinutes()))),ar=(or.range,En((e=>{e.setTime(e-e.getMilliseconds())}),((e,t)=>{e.setTime(+e+t*On)}),((e,t)=>(t-e)/On),(e=>e.getUTCSeconds()))),sr=(ar.range,En((()=>{}),((e,t)=>{e.setTime(+e+t)}),((e,t)=>t-e)));function ur(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function lr(e,t){return null==e||null==t?NaN:te?1:t>=e?0:NaN}function cr(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i>>1;n(e[t],r)<0?i=t+1:o=t}while(iur(e(t),n),r=(t,n)=>e(t)-n):(t=e===ur||e===lr?e:fr,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i>>1;n(e[t],r)<=0?i=t+1:o=t}while(i(e=Math.floor(e),isFinite(e)&&e>0?e>1?En((t=>{t.setTime(Math.floor(t/e)*e)}),((t,n)=>{t.setTime(+t+n*e)}),((t,n)=>(n-t)/e)):sr:null),sr.range;const dr="year",hr="quarter",pr="month",gr="week",mr="date",yr="day",vr="dayofyear",br="hours",xr="minutes",_r="seconds",wr="milliseconds",kr=[dr,hr,pr,gr,mr,yr,vr,br,xr,_r,wr],Ar=kr.reduce(((e,t,n)=>(e[t]=1+n,e)),{});function Er(e){const t=Ge(e).slice(),n={};return t.length||oe("Missing time unit."),t.forEach((e=>{st(Ar,e)?n[e]=1:oe(`Invalid time unit: ${e}.`)})),(n[gr]||n[yr]?1:0)+(n[hr]||n[pr]||n[mr]?1:0)+(n[vr]?1:0)>1&&oe(`Incompatible time units: ${e}`),t.sort(((e,t)=>Ar[e]-Ar[t])),t}const Or={[dr]:"%Y ",[hr]:"Q%q ",[pr]:"%b ",[mr]:"%d ",[gr]:"W%U ",[yr]:"%a ",[vr]:"%j ",[br]:"%H:00",[xr]:"00:%M",[_r]:":%S",[wr]:".%L",[`${dr}-${pr}`]:"%Y-%m ",[`${dr}-${pr}-${mr}`]:"%Y-%m-%d ",[`${br}-${xr}`]:"%H:%M"};function Dr(e,t){const n=rt({},Or,t),r=Er(e),i=r.length;let o,a,s="",u=0;for(u=0;uu;--o)if(a=r.slice(u,o).join("-"),null!=n[a]){s+=n[a],u=o;break}return s.trim()}const Sr=new Date;function Cr(e){return Sr.setFullYear(e),Sr.setMonth(0),Sr.setDate(1),Sr.setHours(0,0,0,0),Sr}function Fr(e){return Mr(new Date(e))}function jr(e){return $r(new Date(e))}function Mr(e){return $n.count(Cr(e.getFullYear())-1,e)}function $r(e){return zn.count(Cr(e.getFullYear())-1,e)}function Nr(e){return Cr(e).getDay()}function Br(e,t,n,r,i,o,a){if(0<=e&&e<100){const s=new Date(-1,t,n,r,i,o,a);return s.setFullYear(e),s}return new Date(e,t,n,r,i,o,a)}function Tr(e){return Rr(new Date(e))}function zr(e){return Pr(new Date(e))}function Rr(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Nn.count(t-1,e)}function Pr(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Hn.count(t-1,e)}function Lr(e){return Sr.setTime(Date.UTC(e,0,1)),Sr.getUTCDay()}function Ir(e,t,n,r,i,o,a){if(0<=e&&e<100){const e=new Date(Date.UTC(-1,t,n,r,i,o,a));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(e,t,n,r,i,o,a))}function Ur(e,t,n,r,i){const o=t||1,a=De(e),s=(e,t,i)=>function(e,t,n,r){const i=n<=1?e:r?(t,i)=>r+n*Math.floor((e(t,i)-r)/n):(t,r)=>n*Math.floor(e(t,r)/n);return t?(e,n)=>t(i(e,n),n):i}(n[i=i||e],r[i],e===a&&o,t),u=new Date,l=Mt(e),c=l[dr]?s(dr):tt(2012),f=l[pr]?s(pr):l[hr]?s(hr):ce,d=l[gr]&&l[yr]?s(yr,1,gr+yr):l[gr]?s(gr,1):l[yr]?s(yr,1):l[mr]?s(mr,1):l[vr]?s(vr,1):fe,h=l[br]?s(br):ce,p=l[xr]?s(xr):ce,g=l[_r]?s(_r):ce,m=l[wr]?s(wr):ce;return function(e){u.setTime(+e);const t=c(u);return i(t,f(u),d(u,t),h(u),p(u),g(u),m(u))}}function qr(e,t,n){return t+7*e-(n+6)%7}const Wr={[dr]:e=>e.getFullYear(),[hr]:e=>Math.floor(e.getMonth()/3),[pr]:e=>e.getMonth(),[mr]:e=>e.getDate(),[br]:e=>e.getHours(),[xr]:e=>e.getMinutes(),[_r]:e=>e.getSeconds(),[wr]:e=>e.getMilliseconds(),[vr]:e=>Mr(e),[gr]:e=>$r(e),[gr+yr]:(e,t)=>qr($r(e),e.getDay(),Nr(t)),[yr]:(e,t)=>qr(1,e.getDay(),Nr(t))},Hr={[hr]:e=>3*e,[gr]:(e,t)=>qr(e,0,Nr(t))};function Gr(e,t){return Ur(e,t||1,Wr,Hr,Br)}const Vr={[dr]:e=>e.getUTCFullYear(),[hr]:e=>Math.floor(e.getUTCMonth()/3),[pr]:e=>e.getUTCMonth(),[mr]:e=>e.getUTCDate(),[br]:e=>e.getUTCHours(),[xr]:e=>e.getUTCMinutes(),[_r]:e=>e.getUTCSeconds(),[wr]:e=>e.getUTCMilliseconds(),[vr]:e=>Rr(e),[gr]:e=>Pr(e),[yr]:(e,t)=>qr(1,e.getUTCDay(),Lr(t)),[gr+yr]:(e,t)=>qr(Pr(e),e.getUTCDay(),Lr(t))},Yr={[hr]:e=>3*e,[gr]:(e,t)=>qr(e,0,Lr(t))};function Xr(e,t){return Ur(e,t||1,Vr,Yr,Ir)}const Zr={[dr]:Kn,[hr]:er.every(3),[pr]:er,[gr]:zn,[mr]:$n,[yr]:$n,[vr]:$n,[br]:nr,[xr]:ir,[_r]:ar,[wr]:sr},Jr={[dr]:Qn,[hr]:tr.every(3),[pr]:tr,[gr]:Hn,[mr]:Nn,[yr]:Nn,[vr]:Nn,[br]:rr,[xr]:or,[_r]:ar,[wr]:sr};function Kr(e){return Zr[e]}function Qr(e){return Jr[e]}function ei(e,t,n){return e?e.offset(t,n):void 0}function ti(e,t,n){return ei(Kr(e),t,n)}function ni(e,t,n){return ei(Qr(e),t,n)}function ri(e,t,n,r){return e?e.range(t,n,r):void 0}function ii(e,t,n,r){return ri(Kr(e),t,n,r)}function oi(e,t,n,r){return ri(Qr(e),t,n,r)}const ai=31536e6,si=[dr,pr,mr,br,xr,_r,wr],ui=si.slice(0,-1),li=ui.slice(0,-1),ci=li.slice(0,-1),fi=ci.slice(0,-1),di=[dr,pr],hi=[dr],pi=[[ui,1,1e3],[ui,5,5e3],[ui,15,15e3],[ui,30,3e4],[li,1,6e4],[li,5,3e5],[li,15,9e5],[li,30,18e5],[ci,1,36e5],[ci,3,108e5],[ci,6,216e5],[ci,12,432e5],[fi,1,864e5],[[dr,gr],1,6048e5],[di,1,2592e6],[di,3,7776e6],[hi,1,ai]];function gi(e){const t=e.extent,n=e.maxbins||40,r=Math.abs(Ot(t))/n;let i,o,a=cr((e=>e[2])).right(pi,r);return a===pi.length?(i=hi,o=rn(t[0]/ai,t[1]/ai,n)):a?(a=pi[r/pi[a-1][2]=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Io,s:Uo,S:so,u:uo,U:lo,V:fo,w:ho,W:po,x:null,X:null,y:go,Y:yo,Z:bo,"%":Lo},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return u[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:xo,e:xo,f:Eo,g:To,G:Ro,H:_o,I:wo,j:ko,L:Ao,m:Oo,M:Do,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Io,s:Uo,S:So,u:Co,U:Fo,V:Mo,w:$o,W:No,x:null,X:null,y:Bo,Y:zo,Z:Po,"%":Lo},_={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=g.exec(t.slice(n));return r?(e.m=m.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return A(e,t,n,r)},d:qi,e:qi,f:Xi,g:Pi,G:Ri,H:Hi,I:Hi,j:Wi,L:Yi,m:Ui,M:Gi,p:function(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=c.get(r[0].toLowerCase()),n+r[0].length):-1},q:Ii,Q:Ji,s:Ki,S:Vi,u:Ni,U:Bi,V:Ti,w:$i,W:zi,x:function(e,t,r){return A(e,n,t,r)},X:function(e,t,n){return A(e,r,t,n)},y:Pi,Y:Ri,Z:Li,"%":Zi};function w(e,t){return function(n){var r,i,o,a=[],s=-1,u=0,l=e.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=yi(vi(o.y,0,1))).getUTCDay(),r=i>4||0===i?Gn.ceil(r):Gn(r),r=Nn.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=mi(vi(o.y,0,1))).getDay(),r=i>4||0===i?Rn.ceil(r):Rn(r),r=$n.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?yi(vi(o.y,0,1)).getUTCDay():mi(vi(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,yi(o)):mi(o)}}function A(e,t,n,r){for(var i,o,a=0,s=t.length,u=n.length;a=u)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=_[i in Ei?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=w(n,b),b.X=w(r,b),b.c=w(t,b),x.x=w(n,x),x.X=w(r,x),x.c=w(t,x),{format:function(e){var t=w(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=k(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=w(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=k(e+="",!0);return t.toString=function(){return e},t}}}var xi,_i,wi,ki,Ai,Ei={"-":"",_:" ",0:"0"},Oi=/^\s*\d+/,Di=/^%/,Si=/[\\^$*+?|[\]().{}]/g;function Ci(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o[e.toLowerCase(),t])))}function $i(e,t,n){var r=Oi.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ni(e,t,n){var r=Oi.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Bi(e,t,n){var r=Oi.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Ti(e,t,n){var r=Oi.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function zi(e,t,n){var r=Oi.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Ri(e,t,n){var r=Oi.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Pi(e,t,n){var r=Oi.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Li(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Ii(e,t,n){var r=Oi.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function Ui(e,t,n){var r=Oi.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function qi(e,t,n){var r=Oi.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Wi(e,t,n){var r=Oi.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Hi(e,t,n){var r=Oi.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Gi(e,t,n){var r=Oi.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Vi(e,t,n){var r=Oi.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Yi(e,t,n){var r=Oi.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Xi(e,t,n){var r=Oi.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Zi(e,t,n){var r=Di.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Ji(e,t,n){var r=Oi.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Ki(e,t,n){var r=Oi.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Qi(e,t){return Ci(e.getDate(),t,2)}function eo(e,t){return Ci(e.getHours(),t,2)}function to(e,t){return Ci(e.getHours()%12||12,t,2)}function no(e,t){return Ci(1+$n.count(Kn(e),e),t,3)}function ro(e,t){return Ci(e.getMilliseconds(),t,3)}function io(e,t){return ro(e,t)+"000"}function oo(e,t){return Ci(e.getMonth()+1,t,2)}function ao(e,t){return Ci(e.getMinutes(),t,2)}function so(e,t){return Ci(e.getSeconds(),t,2)}function uo(e){var t=e.getDay();return 0===t?7:t}function lo(e,t){return Ci(zn.count(Kn(e)-1,e),t,2)}function co(e){var t=e.getDay();return t>=4||0===t?In(e):In.ceil(e)}function fo(e,t){return e=co(e),Ci(In.count(Kn(e),e)+(4===Kn(e).getDay()),t,2)}function ho(e){return e.getDay()}function po(e,t){return Ci(Rn.count(Kn(e)-1,e),t,2)}function go(e,t){return Ci(e.getFullYear()%100,t,2)}function mo(e,t){return Ci((e=co(e)).getFullYear()%100,t,2)}function yo(e,t){return Ci(e.getFullYear()%1e4,t,4)}function vo(e,t){var n=e.getDay();return Ci((e=n>=4||0===n?In(e):In.ceil(e)).getFullYear()%1e4,t,4)}function bo(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ci(t/60|0,"0",2)+Ci(t%60,"0",2)}function xo(e,t){return Ci(e.getUTCDate(),t,2)}function _o(e,t){return Ci(e.getUTCHours(),t,2)}function wo(e,t){return Ci(e.getUTCHours()%12||12,t,2)}function ko(e,t){return Ci(1+Nn.count(Qn(e),e),t,3)}function Ao(e,t){return Ci(e.getUTCMilliseconds(),t,3)}function Eo(e,t){return Ao(e,t)+"000"}function Oo(e,t){return Ci(e.getUTCMonth()+1,t,2)}function Do(e,t){return Ci(e.getUTCMinutes(),t,2)}function So(e,t){return Ci(e.getUTCSeconds(),t,2)}function Co(e){var t=e.getUTCDay();return 0===t?7:t}function Fo(e,t){return Ci(Hn.count(Qn(e)-1,e),t,2)}function jo(e){var t=e.getUTCDay();return t>=4||0===t?Xn(e):Xn.ceil(e)}function Mo(e,t){return e=jo(e),Ci(Xn.count(Qn(e),e)+(4===Qn(e).getUTCDay()),t,2)}function $o(e){return e.getUTCDay()}function No(e,t){return Ci(Gn.count(Qn(e)-1,e),t,2)}function Bo(e,t){return Ci(e.getUTCFullYear()%100,t,2)}function To(e,t){return Ci((e=jo(e)).getUTCFullYear()%100,t,2)}function zo(e,t){return Ci(e.getUTCFullYear()%1e4,t,4)}function Ro(e,t){var n=e.getUTCDay();return Ci((e=n>=4||0===n?Xn(e):Xn.ceil(e)).getUTCFullYear()%1e4,t,4)}function Po(){return"+0000"}function Lo(){return"%"}function Io(e){return+e}function Uo(e){return Math.floor(+e/1e3)}function qo(e){const t={};return n=>t[n]||(t[n]=e(n))}function Wo(e){const t=qo(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(e){const n=sn(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return function(e,t){return n=>{const r=e(n),i=r.indexOf(t);if(i<0)return r;let o=function(e,t){let n,r=e.lastIndexOf("e");if(r>0)return r;for(r=e.length;--r>t;)if(n=e.charCodeAt(r),n>=48&&n<=57)return r+1}(r,i);const a=oi;)if("0"!==r[o]){++o;break}return r.slice(0,o)+a}}(t(n),t(".1f")(1)[1])}return t(n)},formatSpan(e,r,i,o){o=sn(null==o?",f":o);const a=rn(e,r,i),s=Math.max(Math.abs(e),Math.abs(r));let u;if(null==o.precision)switch(o.type){case"s":return isNaN(u=fn(a,s))||(o.precision=u),n(o,s);case"":case"e":case"g":case"p":case"r":isNaN(u=dn(a,s))||(o.precision=u-("e"===o.type));break;case"f":case"%":isNaN(u=hn(a))||(o.precision=u-2*("%"===o.type))}return t(o)}}}let Ho,Go;function Vo(){return Ho=Wo({format:vn,formatPrefix:bn})}function Yo(e){return Wo(wn(e))}function Xo(e){return arguments.length?Ho=Yo(e):Ho}function Zo(e,t,n){we(n=n||{})||oe(`Invalid time multi-format specifier: ${n}`);const r=t(_r),i=t(xr),o=t(br),a=t(mr),s=t(gr),u=t(pr),l=t(hr),c=t(dr),f=e(n[wr]||".%L"),d=e(n[_r]||":%S"),h=e(n[xr]||"%I:%M"),p=e(n[br]||"%I %p"),g=e(n[mr]||n[yr]||"%a %d"),m=e(n[gr]||"%b %d"),y=e(n[pr]||"%B"),v=e(n[hr]||"%B"),b=e(n[dr]||"%Y");return e=>(r(e)vt(e)?t(e):Zo(t,Kr,e),utcFormat:e=>vt(e)?n(e):Zo(n,Qr,e),timeParse:qo(e.parse),utcParse:qo(e.utcParse)}}function Ko(){return Go=Jo({format:_i,parse:wi,utcFormat:ki,utcParse:Ai})}function Qo(e){return Jo(bi(e))}function ea(e){return arguments.length?Go=Qo(e):Go}xi=bi({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"]}),_i=xi.format,wi=xi.parse,ki=xi.utcFormat,Ai=xi.utcParse,Vo(),Ko();const ta=(e,t)=>rt({},e,t);function na(e,t){const n=e?Yo(e):Xo(),r=t?Qo(t):ea();return ta(n,r)}function ra(e,t){const n=arguments.length;return n&&2!==n&&oe("defaultLocale expects either zero or two arguments."),n?ta(Xo(e),ea(t)):ta(Xo(),ea())}function ia(){return Vo(),Ko(),ra()}const oa=/^(data:|([A-Za-z]+:)?\/\/)/,aa=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,sa=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,ua="file://";async function la(e,t){const n=await this.sanitize(e,t),r=n.href;return n.localFile?this.file(r):this.http(r,t)}async function ca(e,t){t=rt({},this.options,t);const n=this.fileAccess,r={href:null};let i,o,a;const s=aa.test(e.replace(sa,""));null!=e&&"string"==typeof e&&s||oe("Sanitize failure, invalid URI: "+Dt(e));const u=oa.test(e);return(a=t.baseURL)&&!u&&(e.startsWith("/")||a.endsWith("/")||(e="/"+e),e=a+e),o=(i=e.startsWith(ua))||"file"===t.mode||"http"!==t.mode&&!u&&n,i?e=e.slice(ua.length):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(r,"localFile",{value:!!o}),r.href=e,t.target&&(r.target=t.target+""),t.rel&&(r.rel=t.rel+""),"image"===t.context&&t.crossOrigin&&(r.crossOrigin=t.crossOrigin+""),r}function fa(e){return e?t=>new Promise(((n,r)=>{e.readFile(t,((e,t)=>{e?r(e):n(t)}))})):da}async function da(){oe("No file system access.")}function ha(e){return e?async function(t,n){const r=rt({},this.options.http,n),i=n&&n.response,o=await e(t,r);return o.ok?Ye(o[i])?o[i]():o.text():oe(o.status+""+o.statusText)}:pa}async function pa(){oe("No HTTP fetch method available.")}const ga=e=>null!=e&&e==e,ma=e=>!(Number.isNaN(+e)||e instanceof Date),ya={boolean:St,integer:Se,number:Se,date:Ft,string:jt,unknown:le},va=[e=>"true"===e||"false"===e||!0===e||!1===e,e=>ma(e)&&Number.isInteger(+e),ma,e=>!Number.isNaN(Date.parse(e))],ba=["boolean","integer","number","date"];function xa(e,t){if(!e||!e.length)return"unknown";const n=e.length,r=va.length,i=va.map(((e,t)=>t+1));for(let o,a,s=0,u=0;s0===e?t:e),0)-1]}function _a(e,t){return t.reduce(((t,n)=>(t[n]=xa(e,n),t)),{})}function wa(e){const t=function(t,n){const r={delimiter:e};return ka(t,n?rt(n,r):r)};return t.responseType="text",t}function ka(e,t){return t.header&&(e=t.header.map(Dt).join(t.delimiter)+"\n"+e),qt(t.delimiter).parse(e+"")}function Aa(e,t){const n=t&&t.property?se(t.property):le;return!we(e)||(r=e,"function"==typeof Buffer&&Ye(Buffer.isBuffer)&&Buffer.isBuffer(r))?n(JSON.parse(e)):function(e,t){return!_e(e)&>(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}(n(e),t);var r}ka.responseType="text",Aa.responseType="json";const Ea={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function Oa(e,t){let n,r,i,o;return e=Aa(e,t),t&&t.feature?(n=Ht,i=t.feature):t&&t.mesh?(n=Xt,i=t.mesh,o=Ea[t.filter]):oe("Missing TopoJSON feature or mesh parameter."),r=(r=e.objects[i])?n(e,r,o):oe("Invalid TopoJSON object: "+i),r&&r.features||[r]}Oa.responseType="json";const Da={dsv:ka,csv:wa(","),tsv:wa("\t"),json:Aa,topojson:Oa};function Sa(e,t){return arguments.length>1?(Da[e]=t,this):st(Da,e)?Da[e]:null}function Ca(e){const t=Sa(e);return t&&t.responseType||"text"}function Fa(e,t,n,r){const i=Sa((t=t||{}).type||"json");return i||oe("Unknown data format type: "+t.type),e=i(e,t),t.parse&&function(e,t,n,r){if(!e.length)return;const i=ea();n=n||i.timeParse,r=r||i.utcParse;let o,a,s,u,l,c,f=e.columns||Object.keys(e[0]);"auto"===t&&(t=_a(e,f)),f=Object.keys(t);const d=f.map((e=>{const i=t[e];let o,a;if(i&&(i.startsWith("date:")||i.startsWith("utc:")))return o=i.split(/:(.+)?/,2),a=o[1],("'"===a[0]&&"'"===a[a.length-1]||'"'===a[0]&&'"'===a[a.length-1])&&(a=a.slice(1,-1)),("utc"===o[0]?r:n)(a);if(!ya[i])throw Error("Illegal format pattern: "+e+":"+i);return ya[i]}));for(s=0,l=e.length,c=f.length;s({options:t||{},sanitize:ca,load:la,fileAccess:!1,file:fa(null),http:ha(e)})}("undefined"!=typeof fetch&&fetch);function Ma(e){const t=e||le,n=[],r={};return n.add=e=>{const i=t(e);return r[i]||(r[i]=1,n.push(e)),n},n.remove=e=>{const i=t(e);if(r[i]){r[i]=0;const t=n.indexOf(e);t>=0&&n.splice(t,1)}return n},n}async function $a(e,t){try{await t(e)}catch(t){e.error(t)}}const Na=Symbol("vega_id");let Ba=1;function Ta(e){return!(!e||!za(e))}function za(e){return e[Na]}function Ra(e,t){return e[Na]=t,e}function Pa(e){const t=e===Object(e)?e:{data:e};return za(t)?t:Ra(t,Ba++)}function La(e){return Ia(e,Pa({}))}function Ia(e,t){for(const n in e)t[n]=e[n];return t}function Ua(e,t){return Ra(t,za(e))}function qa(e,t){return e?t?(n,r)=>e(n,r)||za(t(n))-za(t(r)):(t,n)=>e(t,n)||za(t)-za(n):null}function Wa(e){return e&&e.constructor===Ha}function Ha(){const e=[],t=[],n=[],r=[],i=[];let o=null,a=!1;return{constructor:Ha,insert(t){const n=Ge(t),r=n.length;for(let t=0;t{p(e)&&(l[za(e)]=-1)}));for(f=0,d=e.length;f0&&(y(g,p,h.value),s.modifies(p));for(f=0,d=i.length;f{p(e)&&l[za(e)]>0&&y(e,h.field,h.value)})),s.modifies(h.field);if(a)s.mod=t.length||r.length?u.filter((e=>l[za(e)]>0)):u.slice();else for(m in c)s.mod.push(c[m]);return(o||null==o&&(t.length||r.length))&&s.clean(!0),s}}}const Ga="_:mod:_";function Va(){Object.defineProperty(this,Ga,{writable:!0,value:{}})}Va.prototype={set(e,t,n,r){const i=this,o=i[e],a=i[Ga];return null!=t&&t>=0?(o[t]!==n||r)&&(o[t]=n,a[t+":"+e]=-1,a[e]=-1):(o!==n||r)&&(i[e]=n,a[e]=_e(n)?1+n.length:-1),i},modified(e,t){const n=this[Ga];if(!arguments.length){for(const e in n)if(n[e])return!0;return!1}if(_e(e)){for(let t=0;t=0?t+1{a instanceof Za?(a!==this&&(t&&a.targets().add(this),o.push(a)),i.push({op:a,name:e,index:n})):r.set(e,n,a)};for(a in e)if(s=e[a],"pulse"===a)Ge(s).forEach((e=>{e instanceof Za?e!==this&&(e.targets().add(this),o.push(e)):oe("Pulse parameters must be operator instances.")})),this.source=s;else if(_e(s))for(r.set(a,-1,Array(u=s.length)),l=0;l{const n=Date.now();return n-t>e?(t=n,1):0}))},debounce(e){const t=es();return this.targets().add(es(null,null,nt(e,(e=>{const n=e.dataflow;t.receive(e),n&&n.run&&n.run()})))),t},between(e,t){let n=!1;return e.targets().add(es(null,null,(()=>n=!0))),t.targets().add(es(null,null,(()=>n=!1))),this.filter((()=>n))},detach(){this._filter=de,this._targets=null}};const ts={skip:!0};function ns(e,t,n,r,i,o){const a=rt({},o,ts);let s,u;Ye(n)||(n=tt(n)),void 0===r?s=t=>e.touch(n(t)):Ye(r)?(u=new Za(null,r,i,!1),s=t=>{u.evaluate(t);const r=n(t),i=u.value;Wa(i)?e.pulse(r,i,o):e.update(r,i,a)}):s=t=>e.update(n(t),r,a),t.apply(s)}function rs(e,t,n,r,i,o){if(void 0===r)t.targets().add(n);else{const a=o||{},s=new Za(null,function(e,t){return t=Ye(t)?t:tt(t),e?function(n,r){const i=t(n,r);return e.skip()||(e.skip(i!==this.value).value=i),i}:t}(n,r),i,!1);s.modified(a.force),s.rank=t.rank,t.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),e.connect(n,[s]))}}const is={};function os(e,t,n){this.dataflow=e,this.stamp=null==t?-1:t,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function as(e,t){const n=[];return Nt(e,t,(e=>n.push(e))),n}function ss(e,t){const n={};return e.visit(t,(e=>{n[za(e)]=1})),e=>n[za(e)]?null:e}function us(e,t){return e?(n,r)=>e(n,r)&&t(n,r):t}function ls(e,t,n,r){const i=this;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=r||null,this.pulses=n;for(const e of n)if(e.stamp===t){if(e.fields){const t=i.fields||(i.fields={});for(const n in e.fields)t[n]=1}e.changed(i.ADD)&&(o|=i.ADD),e.changed(i.REM)&&(o|=i.REM),e.changed(i.MOD)&&(o|=i.MOD)}this.changes=o}function cs(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}os.prototype={StopPropagation:is,ADD:1,REM:2,MOD:4,ADD_REM:3,ADD_MOD:5,ALL:7,REFLOW:8,SOURCE:16,NO_SOURCE:32,NO_FIELDS:64,fork(e){return new os(this.dataflow).init(this,e)},clone(){const e=this.fork(7);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(23)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new os(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,!e.fields||64&t||(n.fields=e.fields),1&t?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),2&t?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),4&t?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),32&t?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||7;return 1&t&&this.add.length||2&t&&this.rem.length||4&t&&this.mod.length},reflow(e){if(e)return this.fork(7).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(4,ss(this,1))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return _e(e)?e.forEach((e=>t[e]=!0)):t[e]=!0,this},modified(e,t){const n=this.fields;return!(!t&&!this.mod.length||!n)&&(arguments.length?_e(e)?e.some((e=>n[e])):n[e]:!!n)},filter(e,t){const n=this;return 1&e&&(n.addF=us(n.addF,t)),2&e&&(n.remF=us(n.remF,t)),4&e&&(n.modF=us(n.modF,t)),16&e&&(n.srcF=us(n.srcF,t)),n},materialize(e){const t=this;return 1&(e=e||7)&&t.addF&&(t.add=as(t.add,t.addF),t.addF=null),2&e&&t.remF&&(t.rem=as(t.rem,t.remF),t.remF=null),4&e&&t.modF&&(t.mod=as(t.mod,t.modF),t.modF=null),16&e&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,r=t;if(16&e)return Nt(n.source,n.srcF,r),n;1&e&&Nt(n.add,n.addF,r),2&e&&Nt(n.rem,n.remF,r),4&e&&Nt(n.mod,n.modF,r);const i=n.source;if(8&e&&i){const e=n.add.length+n.mod.length;e===i.length||Nt(i,e?ss(n,5):n.srcF,r)}return n}},ft(ls,os,{fork(e){const t=new os(this.dataflow).init(this,e&this.NO_FIELDS);return void 0!==e&&(e&t.ADD&&this.visit(t.ADD,(e=>t.add.push(e))),e&t.REM&&this.visit(t.REM,(e=>t.rem.push(e))),e&t.MOD&&this.visit(t.MOD,(e=>t.mod.push(e)))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?_e(e)?e.some((e=>n[e])):n[e]:0},filter(){oe("MultiPulse does not support filtering.")},materialize(){oe("MultiPulse does not support materialization.")},visit(e,t){const n=this,r=n.pulses,i=r.length;let o=0;if(e&n.SOURCE)for(;ot&&(o=n-1>>1,i=e[o],r(a,i)<0);)e[n]=i,n=o;return e[n]=a}function hs(){this.logger(xe()),this.logLevel(me),this._clock=0,this._rank=0,this._locale=ra();try{this._loader=ja()}catch(e){}this._touched=Ma(ue),this._input={},this._pulse=null,this._heap=function(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),ds(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let r;return t.length?(r=t[0],t[0]=n,function(e,t,n){const r=t,i=e.length,o=e[t];let a,s=1+(t<<1);for(;s=0&&(s=a),e[t]=e[s],s=1+((t=s)<<1);e[t]=o,ds(e,r,t,n)}(t,0,e)):r=n,r}}}(((e,t)=>e.qrank-t.qrank)),this._postrun=[]}function ps(e){return function(){return this._log[e].apply(this,arguments)}}function gs(e,t){Za.call(this,e,null,t)}hs.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:ps("error"),warn:ps("warn"),info:ps("info"),debug:ps("debug"),logLevel:ps("level"),cleanThreshold:1e4,add:function(e,t,n,r){let i,o=1;return e instanceof Za?i=e:e&&e.prototype instanceof Za?i=new e:Ye(e)?i=new Za(null,e):(o=0,i=new Za(e,t)),this.rank(i),o&&(r=n,n=t),n&&this.connect(i,i.parameters(n,r)),this.touch(i),i},connect:function(e,t){const n=e.rank,r=t.length;for(let i=0;i=0;)t.push(n=r[i]),n===e&&oe("Cycle detected in dataflow graph.")},pulse:function(e,t,n){this.touch(e,n||fs);const r=new os(this,this._clock+(this._pulse?0:1)),i=e.pulse&&e.pulse.source||[];return r.target=e,this._input[e.id]=t.pulse(r,i),this},touch:function(e,t){const n=t||fs;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this},update:function(e,t,n){const r=n||fs;return(e.set(t)||r.force)&&this.touch(e,r),this},changeset:Ha,ingest:function(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))},parse:function(e,t){const n=this.locale();return Fa(e,t,n.timeParse,n.utcParse)},preload:async function(e,t,n){const r=this,i=r._pending||function(e){let t;const n=new Promise((e=>t=e));return n.requests=0,n.done=()=>{0==--n.requests&&(e._pending=null,t(e))},e._pending=n}(r);i.requests+=1;const o=await r.request(t,n);return r.pulse(e,r.changeset().remove(de).insert(o.data||[])),i.done(),o},request:async function(e,t){const n=this;let r,i=0;try{r=await n.loader().load(e,{context:"dataflow",response:Ca(t&&t.type)});try{r=n.parse(r,t)}catch(t){i=-2,n.warn("Data ingestion failed",e,t)}}catch(t){i=-1,n.warn("Loading failed",e,t)}return{data:r,status:i}},events:function(e,t,n,r){const i=this,o=es(n,r),a=function(e){e.dataflow=i;try{o.receive(e)}catch(e){i.error(e)}finally{i.run()}};let s;s="string"==typeof e&&"undefined"!=typeof document?document.querySelectorAll(e):Ge(e);const u=s.length;for(let e=0;er._enqueue(e,!0))),r._touched=Ma(ue);let a,s,u,l=0;try{for(;r._heap.size()>0;)a=r._heap.pop(),a.rank===a.qrank?(s=a.run(r._getPulse(a,e)),s.then?s=await s:s.async&&(i.push(s.async),s=is),s!==is&&a._targets&&a._targets.forEach((e=>r._enqueue(e))),++l):r._enqueue(a,!0)}catch(e){r._heap.clear(),u=e}if(r._input={},r._pulse=null,r.debug(`Pulse ${o}: ${l} operators`),u&&(r._postrun=[],r.error(u)),r._postrun.length){const e=r._postrun.sort(((e,t)=>t.priority-e.priority));r._postrun=[];for(let t=0;tr.runAsync(null,(()=>{e.forEach((e=>{try{e(r)}catch(e){r.error(e)}}))})))),r},run:function(e,t,n){return this._pulse?cs(this):(this.evaluate(e,t,n),this)},runAsync:async function(e,t,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(r,r),this._running},runAfter:function(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(e){this.error(e)}},_enqueue:function(e,t){const n=e.stampe.pulse)),t):this._input[e.id]||function(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==is&&(e.source=t.source),e)}(this._pulse,n&&n.pulse)}},ft(gs,Za,{run(e){if(e.stampthis.pulse=e)):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const ms={};function ys(e){const t=vs(e);return t&&t.Definition||null}function vs(e){return e=e&&e.toLowerCase(),st(ms,e)?ms[e]:null}function bs(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n=i)&&(n=i)}return n}function xs(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function _s(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(et?1:0)}function ws(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=void 0===i?_s:function(e=ur){if(e===ur)return _s;if("function"!=typeof e)throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||0===r?r:(0===e(n,n))-(0===e(t,t))}}(i);r>n;){if(r-n>600){const o=r-n+1,a=t-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*u*(o-u)/o)*(a-o/2<0?-1:1);ws(e,t,Math.max(n,Math.floor(t-a*u/o+l)),Math.min(r,Math.floor(t+(o-a)*u/o+l)),i)}const o=e[t];let a=n,s=r;for(ks(e,n,t),i(e[r],o)>0&&ks(e,n,r);a0;)--s}0===i(e[n],o)?ks(e,n,s):(++s,ks(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function ks(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function As(e){return null===e?NaN:+e}function Es(e,t,n){if(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r=+r)>=r&&(yield r)}}(e,n)),(r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return xs(e);if(t>=1)return bs(e);var r,i=(r-1)*t,o=Math.floor(i),a=bs(ws(e,o).subarray(0,o+1));return a+(xs(e.subarray(o+1))-a)*(i-o)}}function Os(e,t,n=As){if((r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),a=+n(e[o],o,e);return a+(+n(e[o+1],o+1,e)-a)*(i-o)}}function Ds(e,t){return Es(e,.5,t)}function*Ss(e,t){if(null==t)for(let t of e)null!=t&&""!==t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)r=t(r,++n,e),null!=r&&""!==r&&(r=+r)>=r&&(yield r)}}function Cs(e,t,n){const r=Float64Array.from(Ss(e,n));return r.sort(ur),t.map((e=>Os(r,e)))}function Fs(e,t){return Cs(e,[.25,.5,.75],t)}function js(e,t){const n=e.length,r=function(e,t){const n=function(e,t){let n,r=0,i=0,o=0;if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(n=t-i,i+=n/++r,o+=n*(t-i));else{let a=-1;for(let s of e)null!=(s=t(s,++a,e))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(e,t);return n?Math.sqrt(n):n}(e,t),i=Fs(e,t),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function Ms(e){const t=e.maxbins||20,n=e.base||10,r=Math.log(n),i=e.divide||[5,2];let o,a,s,u,l,c,f=e.extent[0],d=e.extent[1];const h=e.span||d-f||Math.abs(f)||1;if(e.step)o=e.step;else if(e.steps){for(u=h/t,l=0,c=e.steps.length;lt;)o*=n;for(l=0,c=i.length;l=s&&h/u<=t&&(o=u)}u=Math.log(o);const p=u>=0?0:1+~~(-u/r),g=Math.pow(n,-p-1);return(e.nice||void 0===e.nice)&&(u=Math.floor(f/o+g)*o,f=fe);const i=e.length,o=new Float64Array(i);let a,s=0,u=1,l=r(e[0]),c=l,f=l+t;for(;u=f){for(c=(l+c)/2;s>1);ia;)e[i--]=e[o]}o=a,a=r}return e}(o,t+t/4):o}function zs(e){return function(){return(e=(1103515245*e+12345)%2147483647)/2147483647}}function Rs(e,t){let n,r,i;null==t&&(t=e,e=0);const o={min(e){return arguments.length?(n=e||0,i=r-n,o):n},max(e){return arguments.length?(r=e||0,i=r-n,o):r},sample:()=>n+Math.floor(i*$s()),pdf:e=>e===Math.floor(e)&&e>=n&&e=r?1:(t-n+1)/i},icdf:e=>e>=0&&e<=1?n-1+Math.floor(e*i):NaN};return o.min(e).max(t)}const Ps=Math.sqrt(2*Math.PI),Ls=Math.SQRT2;let Is=NaN;function Us(e,t){e=e||0,t=null==t?1:t;let n,r,i=0,o=0;if(Is==Is)i=Is,Is=NaN;else{do{i=2*$s()-1,o=2*$s()-1,n=i*i+o*o}while(0===n||n>1);r=Math.sqrt(-2*Math.log(n)/n),i*=r,Is=o*r}return e+i*t}function qs(e,t,n){const r=(e-(t||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*Ps)}function Ws(e,t,n){const r=(e-(t=t||0))/(n=null==n?1:n),i=Math.abs(r);let o;if(i>37)o=0;else{const e=Math.exp(-i*i/2);let t;i<7.07106781186547?(t=.0352624965998911*i+.700383064443688,t=t*i+6.37396220353165,t=t*i+33.912866078383,t=t*i+112.079291497871,t=t*i+221.213596169931,t=t*i+220.206867912376,o=e*t,t=.0883883476483184*i+1.75566716318264,t=t*i+16.064177579207,t=t*i+86.7807322029461,t=t*i+296.564248779674,t=t*i+637.333633378831,t=t*i+793.826512519948,t=t*i+440.413735824752,o/=t):(t=i+.65,t=i+4/t,t=i+3/t,t=i+2/t,t=i+1/t,o=e/t/2.506628274631)}return r>0?1-o:o}function Hs(e,t,n){return e<0||e>1?NaN:(t||0)+(null==n?1:n)*Ls*function(e){let t,n=-Math.log((1-e)*(1+e));return n<6.25?(n-=3.125,t=-364441206401782e-35,t=t*n-16850591381820166e-35,t=128584807152564e-32+t*n,t=11157877678025181e-33+t*n,t=t*n-1333171662854621e-31,t=20972767875968562e-33+t*n,t=6637638134358324e-30+t*n,t=t*n-4054566272975207e-29,t=t*n-8151934197605472e-29,t=26335093153082323e-28+t*n,t=t*n-12975133253453532e-27,t=t*n-5415412054294628e-26,t=1.0512122733215323e-9+t*n,t=t*n-4.112633980346984e-9,t=t*n-2.9070369957882005e-8,t=4.2347877827932404e-7+t*n,t=t*n-13654692000834679e-22,t=t*n-13882523362786469e-21,t=.00018673420803405714+t*n,t=t*n-.000740702534166267,t=t*n-.006033670871430149,t=.24015818242558962+t*n,t=1.6536545626831027+t*n):n<16?(n=Math.sqrt(n)-3.25,t=2.2137376921775787e-9,t=9.075656193888539e-8+t*n,t=t*n-2.7517406297064545e-7,t=1.8239629214389228e-8+t*n,t=15027403968909828e-22+t*n,t=t*n-4013867526981546e-21,t=29234449089955446e-22+t*n,t=12475304481671779e-21+t*n,t=t*n-47318229009055734e-21,t=6828485145957318e-20+t*n,t=24031110387097894e-21+t*n,t=t*n-.0003550375203628475,t=.0009532893797373805+t*n,t=t*n-.0016882755560235047,t=.002491442096107851+t*n,t=t*n-.003751208507569241,t=.005370914553590064+t*n,t=1.0052589676941592+t*n,t=3.0838856104922208+t*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,t=-27109920616438573e-27,t=t*n-2.555641816996525e-10,t=1.5076572693500548e-9+t*n,t=t*n-3.789465440126737e-9,t=7.61570120807834e-9+t*n,t=t*n-1.496002662714924e-8,t=2.914795345090108e-8+t*n,t=t*n-6.771199775845234e-8,t=2.2900482228026655e-7+t*n,t=t*n-9.9298272942317e-7,t=4526062597223154e-21+t*n,t=t*n-1968177810553167e-20,t=7599527703001776e-20+t*n,t=t*n-.00021503011930044477,t=t*n-.00013871931833623122,t=1.0103004648645344+t*n,t=4.849906401408584+t*n):t=1/0,t*e}(2*e-1)}function Gs(e,t){let n,r;const i={mean(e){return arguments.length?(n=e||0,i):n},stdev(e){return arguments.length?(r=null==e?1:e,i):r},sample:()=>Us(n,r),pdf:e=>qs(e,n,r),cdf:e=>Ws(e,n,r),icdf:e=>Hs(e,n,r)};return i.mean(e).stdev(t)}function Vs(e,t){const n=Gs();let r=0;const i={data(n){return arguments.length?(e=n,r=n?n.length:0,i.bandwidth(t)):e},bandwidth(n){return arguments.length?(!(t=n)&&e&&(t=js(e)),i):t},sample:()=>e[~~($s()*r)]+t*n.sample(),pdf(i){let o=0,a=0;for(;aYs(n,r),pdf:e=>Xs(e,n,r),cdf:e=>Zs(e,n,r),icdf:e=>Js(e,n,r)};return i.mean(e).stdev(t)}function Qs(e,t){let n,r=0;const i={weights(e){return arguments.length?(n=function(e){const t=[];let n,i=0;for(n=0;n=t&&e<=n?1/(n-t):0}function nu(e,t,n){return null==n&&(n=null==t?1:t,t=0),en?1:(e-t)/(n-t)}function ru(e,t,n){return null==n&&(n=null==t?1:t,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function iu(e,t){let n,r;const i={min(e){return arguments.length?(n=e||0,i):n},max(e){return arguments.length?(r=null==e?1:e,i):r},sample:()=>eu(n,r),pdf:e=>tu(e,n,r),cdf:e=>nu(e,n,r),icdf:e=>ru(e,n,r)};return null==t&&(t=null==e?1:e,e=0),i.min(e).max(t)}function ou(e,t,n,r){const i=r-e*e,o=Math.abs(i)<1e-24?0:(n-e*t)/i;return[t-o*e,o]}function au(e,t,n,r){e=e.filter((e=>{let r=t(e),i=n(e);return null!=r&&(r=+r)>=r&&null!=i&&(i=+i)>=i})),r&&e.sort(((e,n)=>t(e)-t(n)));const i=e.length,o=new Float64Array(i),a=new Float64Array(i);let s,u,l,c=0,f=0,d=0;for(l of e)o[c]=s=+t(l),a[c]=u=+n(l),++c,f+=(s-f)/c,d+=(u-d)/c;for(c=0;c=i&&null!=o&&(o=+o)>=o&&r(i,o,++a)}function uu(e,t,n,r,i){let o=0,a=0;return su(e,t,n,((e,t)=>{const n=t-i(e),s=t-r;o+=n*n,a+=s*s})),1-o/a}function lu(e,t,n){let r=0,i=0,o=0,a=0,s=0;su(e,t,n,((e,t)=>{++s,r+=(e-r)/s,i+=(t-i)/s,o+=(e*t-o)/s,a+=(e*e-a)/s}));const u=ou(r,i,o,a),l=e=>u[0]+u[1]*e;return{coef:u,predict:l,rSquared:uu(e,t,n,i,l)}}function cu(e,t,n){let r=0,i=0,o=0,a=0,s=0;su(e,t,n,((e,t)=>{++s,e=Math.log(e),r+=(e-r)/s,i+=(t-i)/s,o+=(e*t-o)/s,a+=(e*e-a)/s}));const u=ou(r,i,o,a),l=e=>u[0]+u[1]*Math.log(e);return{coef:u,predict:l,rSquared:uu(e,t,n,i,l)}}function fu(e,t,n){const[r,i,o,a]=au(e,t,n);let s,u,l,c=0,f=0,d=0,h=0,p=0;su(e,t,n,((e,t)=>{s=r[p++],u=Math.log(t),l=s*t,c+=(t*u-c)/p,f+=(l-f)/p,d+=(l*u-d)/p,h+=(s*l-h)/p}));const[g,m]=ou(f/a,c/a,d/a,h/a),y=e=>Math.exp(g+m*(e-o));return{coef:[Math.exp(g-m*o),m],predict:y,rSquared:uu(e,t,n,a,y)}}function du(e,t,n){let r=0,i=0,o=0,a=0,s=0,u=0;su(e,t,n,((e,t)=>{const n=Math.log(e),l=Math.log(t);++u,r+=(n-r)/u,i+=(l-i)/u,o+=(n*l-o)/u,a+=(n*n-a)/u,s+=(t-s)/u}));const l=ou(r,i,o,a),c=e=>l[0]*Math.pow(e,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:uu(e,t,n,s,c)}}function hu(e,t,n){const[r,i,o,a]=au(e,t,n),s=r.length;let u,l,c,f,d=0,h=0,p=0,g=0,m=0;for(u=0;ub*(e-=o)*e+x*e+_+a;return{coef:[_-x*o+b*o*o+a,x-2*b*o,b],predict:w,rSquared:uu(e,t,n,a,w)}}function pu(e,t,n,r){if(1===r)return lu(e,t,n);if(2===r)return hu(e,t,n);const[i,o,a,s]=au(e,t,n),u=i.length,l=[],c=[],f=r+1;let d,h,p,g,m;for(d=0;dMath.abs(e[r][a])&&(a=i);for(o=r;o=r;o--)e[o][i]-=e[o][r]*e[r][i]/e[r][r]}for(i=t-1;i>=0;--i){for(s=0,o=i+1;o{e-=a;let t=s+y[0]+y[1]*e+y[2]*e*e;for(d=3;d=0;--o)for(s=t[o],u=1,i[o]+=s,a=1;a<=o;++a)u*=(o+1-a)/a,i[o-a]+=s*Math.pow(n,a)*u;return i[0]+=r,i}const mu=2,yu=1e-12;function vu(e,t,n,r){const[i,o,a,s]=au(e,t,n,!0),u=i.length,l=Math.max(2,~~(r*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let e=-1;++e<=mu;){const t=[0,l-1];for(let e=0;ei[a]-n?r:a;let u=0,l=0,h=0,p=0,g=0;const m=1/Math.abs(i[s]-n||1);for(let e=r;e<=a;++e){const t=i[e],r=o[e],a=bu(Math.abs(n-t)*m)*d[e],s=t*a;u+=a,l+=s,h+=r*a,p+=r*s,g+=t*s}const[y,v]=ou(l/u,h/u,p/u,g/u);c[e]=y+v*n,f[e]=Math.abs(o[e]-c[e]),xu(i,e+1,t)}if(e===mu)break;const n=Ds(f);if(Math.abs(n)=1?yu:(t=1-e*e)*t}return function(e,t,n,r){const i=e.length,o=[];let a,s=0,u=0,l=[];for(;s=e.length))for(;t>i&&e[o]-r<=r-e[i];)n[0]=++i,n[1]=o,++o}const _u=.5*Math.PI/180;function wu(e,t,n,r){n=n||25,r=Math.max(n,r||200);const i=t=>[t,e(t)],o=t[0],a=t[1],s=a-o,u=s/r,l=[i(o)],c=[];if(n===r){for(let e=1;e0;)c.push(i(o+e/n*s));let f=l[0],d=c[c.length-1];const h=1/s,p=function(e,t){let n=e,r=e;const i=t.length;for(let e=0;er&&(r=i)}return 1/(r-n)}(f[1],c);for(;d;){const e=i((f[0]+d[0])/2);e[0]-f[0]>=u&&ku(f,e,d,h,p)>_u?c.push(e):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function ku(e,t,n,r,i){const o=Math.atan2(i*(n[1]-e[1]),r*(n[0]-e[0])),a=Math.atan2(i*(t[1]-e[1]),r*(t[0]-e[0]));return Math.abs(o-a)}function Au(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r{const n=t.length;let r=1,i=String(t[0](e));for(;r{},Su={init:Du,add:Du,rem:Du,idx:0},Cu={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.sum,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||void 0===e.max)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3}},Fu=Object.keys(Cu).filter((e=>"__count__"!==e));function ju(e,t){return Cu[e](t)}function Mu(e,t){return e.idx-t.idx}function $u(){this.valid=0,this.missing=0,this._ops.forEach((e=>e.init(this)))}function Nu(e,t){null!=e&&""!==e?e==e&&(++this.valid,this._ops.forEach((n=>n.add(this,e,t)))):++this.missing}function Bu(e,t){null!=e&&""!==e?e==e&&(--this.valid,this._ops.forEach((n=>n.rem(this,e,t)))):--this.missing}function Tu(e){return this._out.forEach((t=>e[t.out]=t.value(this))),e}function zu(e,t){const n=t||le,r=function(e){const t={};e.forEach((e=>t[e.name]=e));const n=e=>{e.req&&e.req.forEach((e=>{t[e]||n(t[e]=Cu[e]())}))};return e.forEach(n),Object.values(t).sort(Mu)}(e),i=e.slice().sort(Mu);function o(e){this._ops=r,this._out=i,this.cell=e,this.init()}return o.prototype.init=$u,o.prototype.add=Nu,o.prototype.rem=Bu,o.prototype.set=Tu,o.prototype.get=n,o.fields=e.map((e=>e.out)),o}function Ru(e){this._key=e?se(e):za,this.reset()}[...Fu,"__count__"].forEach((e=>{Cu[e]=function(e,t){return n=>rt({name:e,out:n||e},Su,t)}(e,Cu[e])}));const Pu=Ru.prototype;function Lu(e){gs.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}function Iu(e){gs.call(this,null,e)}function Uu(e,t,n){const r=e;let i=t||[],o=n||[],a={},s=0;return{add:e=>o.push(e),remove:e=>a[r(e)]=++s,size:()=>i.length,data:(e,t)=>(s&&(i=i.filter((e=>!a[r(e)])),a={},s=0),t&&e&&i.sort(e),o.length&&(i=e?kt(e,i,o.sort(e)):i.concat(o),o=[]),i)}}function qu(e){gs.call(this,[],e)}function Wu(e){Za.call(this,null,Hu,e)}function Hu(e){return this.value&&!e.modified()?this.value:Ze(e.fields,e.orders)}function Gu(e){gs.call(this,null,e)}function Vu(e){gs.call(this,null,e)}Pu.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},Pu.add=function(e){this._add.push(e)},Pu.rem=function(e){this._rem.push(e)},Pu.values=function(){if(this._get=null,0===this._rem.length)return this._add;const e=this._add,t=this._rem,n=this._key,r=e.length,i=t.length,o=Array(r-i),a={};let s,u,l;for(s=0;s=0;)r=e(t[i])+"",st(n,r)||(n[r]=1,++o);return o},Pu.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=ot(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},Pu.argmin=function(e){return this.extent(e)[0]||{}},Pu.argmax=function(e){return this.extent(e)[1]||{}},Pu.min=function(e){const t=this.extent(e)[0];return null!=t?e(t):void 0},Pu.max=function(e){const t=this.extent(e)[1];return null!=t?e(t):void 0},Pu.quartile=function(e){return this._get===e&&this._q||(this._q=Fs(this.values(),e),this._get=e),this._q},Pu.q1=function(e){return this.quartile(e)[0]},Pu.q2=function(e){return this.quartile(e)[1]},Pu.q3=function(e){return this.quartile(e)[2]},Pu.ci=function(e){return this._get===e&&this._ci||(this._ci=Bs(this.values(),1e3,.05,e),this._get=e),this._ci},Pu.ci0=function(e){return this.ci(e)[0]},Pu.ci1=function(e){return this.ci(e)[1]},Lu.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Fu},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},ft(Lu,gs,{transform(e,t){const n=this,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.modified();return n.stamp=r.stamp,n.value&&(i||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(e):{},t.visit(t.SOURCE,(e=>n.add(e)))):(n.value=n.value||n.init(e),t.visit(t.REM,(e=>n.rem(e))),t.visit(t.ADD,(e=>n.add(e)))),r.modifies(n._outputs),n._drop=!1!==e.drop,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&r.clean(!0).runAfter((()=>this.clean())),n.changes(r)},cross(){const e=this,t=e.value,n=e._dnames,r=n.map((()=>({}))),i=n.length;function o(e){let t,o,a,s;for(t in e)for(a=e[t].tuple,o=0;o{const t=ee(e);return i(e),n.push(t),t})),this.cellkey=e.key?e.key:Eu(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],a=e.ops||["count"],s=e.as||[],u=o.length,l={};let c,f,d,h,p,g;for(u!==a.length&&oe("Unmatched number of fields and aggregate ops."),g=0;gzu(e,e.field))),{}},cellkey:Eu(),cell(e,t){let n=this.value[e];return n?0===n.num&&this._drop&&n.stamp{const t=r(e);e[s]=t,e[u]=null==t?null:i+o*(1+(t-i)/o)}:e=>e[s]=r(e)),t.modifies(n?a:s)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=Ms(e),r=n.step;let i,o,a=n.start,s=a+Math.ceil((n.stop-a)/r)*r;null!=(i=e.anchor)&&(o=i-(a+r*Math.floor((i-a)/r)),a+=o,s+=o);const u=function(e){let n=Se(t(e));return null==n?null:ns?1/0:(n=Math.max(a,Math.min(n,s-r)),a+r*Math.floor(1e-14+(n-a)/r))};return u.start=a,u.stop=n.stop,u.step=r,this.value=Q(u,te(t),e.name||"bin_"+ee(t))}}),qu.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},ft(qu,gs,{transform(e,t){const n=t.fork(t.ALL),r=Uu(za,this.value,n.materialize(n.ADD).add),i=e.sort,o=t.changed()||i&&(e.modified("sort")||t.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(qa(i),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}}),ft(Wu,Za),Gu.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]},ft(Gu,gs,{transform(e,t){const n=t=>n=>{for(var r,i=function(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase()}return e.match(n)}(s(n),e.case,o)||[],u=0,l=i.length;ui[e]=1+(i[e]||0))),c=n((e=>i[e]-=1));return r?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return!e.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),!e.modified("pattern")&&this._match||(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,r=this._tuples||(this._tuples={}),i=t[0],o=t[1],a=e.fork(e.NO_SOURCE|e.NO_FIELDS);let s,u,l;for(s in n)u=r[s],l=n[s]||0,!u&&l?(r[s]=u=Pa({}),u[i]=s,u[o]=l,a.add.push(u)):0===l?(u&&a.rem.push(u),n[s]=null,r[s]=null):u[o]!==l&&(u[o]=l,a.mod.push(u));return a.modifies(t)}}),Vu.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},ft(Vu,gs,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.as||["a","b"],i=r[0],o=r[1],a=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let s=this.value;return a?(s&&(n.rem=s),s=t.materialize(t.SOURCE).source,n.add=this.value=function(e,t,n,r){for(var i,o,a=[],s={},u=e.length,l=0;lZu(e,t)))):typeof r[n]===Xu&&r[n](e[n]);return r}function Ju(e){gs.call(this,null,e)}const Ku=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],Qu={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:Ku},{name:"weights",type:"number",array:!0}]};function el(e,t){return e?e.map(((e,n)=>t[n]||ee(e))):null}function tl(e,t,n){const r=[],i=e=>e(u);let o,a,s,u,l,c;if(null==t)r.push(e.map(n));else for(o={},a=0,s=e.length;at(n,e)),te(t),ee(t))}function ol(e){gs.call(this,[void 0,void 0],e)}function al(e,t){Za.call(this,e),this.parent=t,this.count=0}function sl(e){gs.call(this,{},e),this._keys=lt();const t=this._targets=[];t.active=0,t.forEach=e=>{for(let n=0,r=t.active;nse(e))):se(e.name,e.as)}function cl(e){gs.call(this,lt(),e)}function fl(e){gs.call(this,[],e)}function dl(e){gs.call(this,[],e)}function hl(e){gs.call(this,null,e)}function pl(e){gs.call(this,[],e)}Ju.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:Ku.concat(Qu)},{name:"as",type:"string",array:!0,default:["value","density"]}]},ft(Ju,gs,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=Zu(e.distribution,function(e){return()=>e.materialize(e.SOURCE).source}(t)),i=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let a=e.method||"pdf";"pdf"!==a&&"cdf"!==a&&oe("Invalid density method: "+a),e.extent||r.data||oe("Missing density extent parameter."),a=r[a];const s=e.as||["value","density"],u=wu(a,e.extent||it(r.data()),i,o).map((e=>{const t={};return t[s[0]]=e[0],t[s[1]]=e[1],Pa(t)}));this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}}),nl.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]},ft(nl,gs,{transform(e,t){if(this.value&&!e.modified()&&!t.changed())return t;const n=t.materialize(t.SOURCE).source,r=tl(t.source,e.groupby,le),i=e.smooth||!1,o=e.field,a=e.step||((e,t)=>Ot(it(e,t))/30)(n,o),s=qa(((e,t)=>o(e)-o(t))),u=e.as||"bin",l=r.length;let c,f=1/0,d=-1/0,h=0;for(;hd&&(d=t),e[++c][u]=t}return this.value={start:f,stop:d,step:a},t.reflow(!0).modifies(u)}}),ft(rl,Za),ol.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},ft(ol,gs,{transform(e,t){const n=this.value,r=e.field,i=t.changed()||t.modified(r.fields)||e.modified("field");let o=n[0],a=n[1];if((i||null==o)&&(o=1/0,a=-1/0),t.visit(i?t.SOURCE:t.ADD,(e=>{const t=Se(r(e));null!=t&&(ta&&(a=t))})),!Number.isFinite(o)||!Number.isFinite(a)){let e=ee(r);e&&(e=` for field "${e}"`),t.dataflow.warn(`Infinite extent${e}: [${o}, ${a}]`),o=a=void 0}this.value=[o,a]}}),ft(al,Za,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}}),ft(sl,gs,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,r){const i=this.value;let o,a,s=st(i,e)&&i[e];return s?s.value.stampe&&e.count>0));this.initTargets(e)}},initTargets(e){const t=this._targets,n=t.length,r=e?e.length:0;let i=0;for(;ithis.subflow(e,i,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,(e=>{const t=za(e),n=o.get(t);void 0!==n&&(o.delete(t),s(n).rem(e))})),t.visit(t.ADD,(e=>{const t=r(e);o.set(za(e),t),s(t).add(e)})),a||t.modified(r.fields)?t.visit(t.MOD,(e=>{const t=za(e),n=o.get(t),i=r(e);n===i?s(i).mod(e):(o.set(t,i),s(n).rem(e),s(i).add(e))})):t.changed(t.MOD)&&t.visit(t.MOD,(e=>{s(o.get(za(e))).mod(e)})),a&&t.visit(t.REFLOW,(e=>{const t=za(e),n=o.get(t),i=r(e);n!==i&&(o.set(t,i),s(n).rem(e),s(i).add(e))})),t.clean()?n.runAfter((()=>{this.clean(),o.clean()})):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}}),ft(ul,Za),cl.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},ft(cl,gs,{transform(e,t){const n=t.dataflow,r=this.value,i=t.fork(),o=i.add,a=i.rem,s=i.mod,u=e.expr;let l=!0;function c(t){const n=za(t),i=u(t,e),c=r.get(n);i&&c?(r.delete(n),o.push(t)):i||c?l&&i&&!c&&s.push(t):(r.set(n,1),a.push(t))}return t.visit(t.REM,(e=>{const t=za(e);r.has(t)?r.delete(t):a.push(e)})),t.visit(t.ADD,(t=>{u(t,e)?o.push(t):r.set(za(t),1)})),t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}}),fl.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},ft(fl,gs,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=el(r,e.as||[]),o=e.index||null,a=i.length;return n.rem=this.value,t.visit(t.SOURCE,(e=>{const t=r.map((t=>t(e))),s=t.reduce(((e,t)=>Math.max(e,t.length)),0);let u,l,c,f=0;for(;f{for(let t,o=0;ot[r]=n(t,e)))}}),ft(pl,gs,{transform(e,t){const n=t.fork(t.ALL),r=e.generator;let i,o,a,s=this.value,u=e.size-s.length;if(u>0){for(i=[];--u>=0;)i.push(a=Pa(r(e))),s.push(a);n.add=n.add.length?n.materialize(n.ADD).add.concat(i):i}else o=s.slice(0,-u),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,s=s.slice(-u);return n.source=this.value=s,n}});const gl={value:"value",median:Ds,mean:function(e,t){let n=0,r=0;if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(++n,r+=t);else{let i=-1;for(let o of e)null!=(o=t(o,++i,e))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n},min:xs,max:bs},ml=[];function yl(e){gs.call(this,[],e)}function vl(e){Lu.call(this,e)}function bl(e){gs.call(this,null,e)}function xl(e){Za.call(this,null,_l,e)}function _l(e){return this.value&&!e.modified()?this.value:bt(e.fields,e.flat)}function wl(e){gs.call(this,[],e),this._pending=null}function kl(e,t,n){n.forEach(Pa);const r=t.fork(t.NO_FIELDS&t.NO_SOURCE);return r.rem=e.value,e.value=r.source=r.add=n,e._pending=null,r.rem.length&&r.clean(!0),r}function Al(e){gs.call(this,{},e)}function El(e){Za.call(this,null,Ol,e)}function Ol(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let r,i,o=1/0,a=-1/0;for(r=0;ra&&(a=i[1]);return[o,a]}function Dl(e){Za.call(this,null,Sl,e)}function Sl(e){return this.value&&!e.modified()?this.value:e.values.reduce(((e,t)=>e.concat(t)),[])}function Cl(e){gs.call(this,null,e)}function Fl(e){Lu.call(this,e)}function jl(e){sl.call(this,e)}function Ml(e){gs.call(this,null,e)}function $l(e){gs.call(this,null,e)}function Nl(e){gs.call(this,null,e)}function Bl(e){gs.call(this,null,e)}function Tl(e){gs.call(this,[],e),this.count=0}function zl(e){gs.call(this,null,e)}function Rl(e){gs.call(this,null,e),this.modified(!0)}function Pl(e){gs.call(this,null,e)}yl.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},ft(yl,gs,{transform(e,t){var n,r,i,o,a,s,u,l,c,f,d=t.fork(t.ALL),h=function(e){var t,n=e.method||gl.value;if(null!=gl[n])return n===gl.value?(t=void 0!==e.value?e.value:0,()=>t):gl[n];oe("Unrecognized imputation method: "+n)}(e),p=function(e){const t=e.field;return e=>e?t(e):NaN}(e),g=ee(e.field),m=ee(e.key),y=(e.groupby||[]).map(ee),v=function(e,t,n,r){var i,o,a,s,u,l,c,f,d=e=>e(f),h=[],p=r?r.slice():[],g={},m={};for(p.forEach(((e,t)=>g[e]=t+1)),s=0,c=e.length;sn.add(e)))):(i=n.value=n.value||this.init(e),t.visit(t.REM,(e=>n.rem(e))),t.visit(t.ADD,(e=>n.add(e)))),n.changes(),t.visit(t.SOURCE,(e=>{rt(e,i[n.cellkey(e)].tuple)})),t.reflow(r).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,r;for(n=0,r=this._alen;n{const n=Vs(t,a)[s],r=e.counts?t.length:1;wu(n,c||it(t),f,d).forEach((e=>{const n={};for(let e=0;e(this._pending=Ge(e.data),e=>e.touch(this))));return{async:t}}return n.request(e.url,e.format).then((e=>kl(this,t,Ge(e.data))))}}),Al.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},ft(Al,gs,{transform(e,t){const n=e.fields,r=e.index,i=e.values,o=null==e.default?null:e.default,a=e.modified(),s=n.length;let u,l,c,f=a?t.SOURCE:t.ADD,d=t,h=e.as;return i?(l=i.length,s>1&&!h&&oe('Multi-field lookup requires explicit "as" parameter.'),h&&h.length!==s*l&&oe('The "as" parameter has too few output field names.'),h=h||i.map(ee),u=function(e){for(var t,a,u=0,c=0;ut.modified(e.fields))),f|=c?t.MOD:0),t.visit(f,u),d.modifies(h)}}),ft(El,Za),ft(Dl,Za),ft(Cl,gs,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),Fl.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Fu,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},ft(Fl,Lu,{_transform:Lu.prototype.transform,transform(e,t){return this._transform(function(e,t){const n=e.field,r=e.value,i=("count"===e.op?"__count__":e.op)||"sum",o=te(n).concat(te(r)),a=function(e,t,n){const r={},i=[];return n.visit(n.SOURCE,(t=>{const n=e(t);r[n]||(r[n]=1,i.push(n))})),i.sort(Je),t?i.slice(0,t):i}(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:a.map((()=>i)),fields:a.map((e=>function(e,t,n,r){return Q((r=>t(r)===e?n(r):NaN),r,e+"")}(e,n,r,o))),as:a.map((e=>e+"")),modified:e.modified.bind(e)}}(e,t),t)}}),ft(jl,sl,{transform(e,t){const n=e.subflow,r=e.field,i=e=>this.subflow(za(e),n,t,e);return(e.modified("field")||r&&t.modified(te(r)))&&oe("PreFacet does not support field modification."),this.initTargets(),r?(t.visit(t.MOD,(e=>{const t=i(e);r(e).forEach((e=>t.mod(e)))})),t.visit(t.ADD,(e=>{const t=i(e);r(e).forEach((e=>t.add(Pa(e))))})),t.visit(t.REM,(e=>{const t=i(e);r(e).forEach((e=>t.rem(e)))}))):(t.visit(t.MOD,(e=>i(e).mod(e))),t.visit(t.ADD,(e=>i(e).add(e))),t.visit(t.REM,(e=>i(e).rem(e)))),t.clean()&&t.runAfter((()=>this.clean())),t}}),Ml.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},ft(Ml,gs,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=el(e.fields,e.as||[]),o=r?(e,t)=>function(e,t,n,r){for(let i=0,o=n.length;i{const t=za(e);n.rem.push(a[t]),a[t]=null})),t.visit(t.ADD,(e=>{const t=o(e,Pa({}));a[za(e)]=t,n.add.push(t)})),t.visit(t.MOD,(e=>{n.mod.push(o(e,a[za(e)]))})),n}}),ft($l,gs,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}}),Nl.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]},ft(Nl,gs,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const i=tl(t.materialize(t.SOURCE).source,e.groupby,e.field),o=(e.groupby||[]).map(ee),a=[],s=e.step||.01,u=e.probs||Au(s/2,1-1e-14,s),l=u.length;return i.forEach((e=>{const t=Cs(e,u);for(let n=0;n{const t=za(e);n.rem.push(r[t]),r[t]=null})),t.visit(t.ADD,(e=>{const t=La(e);r[za(e)]=t,n.add.push(t)})),t.visit(t.MOD,(e=>{const t=r[za(e)];for(const r in e)t[r]=e[r],n.modifies(r);n.mod.push(t)}))),n}}),Tl.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},ft(Tl,gs,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.modified("size"),i=e.size,o=this.value.reduce(((e,t)=>(e[za(t)]=1,e)),{});let a=this.value,s=this.count,u=0;function l(e){let t,r;a.length=u&&(t=a[r],o[za(t)]&&n.rem.push(t),a[r]=e)),++s}if(t.rem.length&&(t.visit(t.REM,(e=>{const t=za(e);o[t]&&(o[t]=-1,n.rem.push(e)),--s})),a=a.filter((e=>-1!==o[za(e)]))),(t.rem.length||r)&&a.length{o[za(e)]||l(e)})),u=-1),r&&a.length>i){const e=a.length-i;for(let t=0;t{o[za(e)]&&n.mod.push(e)})),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=a.filter((e=>!o[za(e)]))),this.count=s,this.value=n.source=a,n}}),zl.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},ft(zl,gs,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),r=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Au(e.start,e.stop,e.step||1).map((e=>{const t={};return t[r]=e,Pa(t)})),n.add=t.add.concat(this.value),n}}),ft(Rl,gs,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});const Ll=["unit0","unit1"];function Il(e){gs.call(this,lt(),e)}function Ul(e){gs.call(this,null,e)}Pl.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:kr,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:Ll}]},ft(Pl,gs,{transform(e,t){const n=e.field,r=!1!==e.interval,i="utc"===e.timezone,o=this._floor(e,t),a=(i?Qr:Kr)(o.unit).offset,s=e.as||Ll,u=s[0],l=s[1],c=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(te(n)))&&(h=(t=t.reflow(!0)).SOURCE,f=1/0,d=-1/0),t.visit(h,(e=>{const t=n(e);let i,s;null==t?(e[u]=null,r&&(e[l]=null)):(e[u]=i=s=o(t),r&&(e[l]=s=a(i,c)),id&&(d=s))})),o.start=f,o.stop=d,t.modifies(r?s:u)},_floor(e,t){const n="utc"===e.timezone,{units:r,step:i}=e.units?{units:e.units,step:e.step||1}:gi({extent:e.extent||it(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=Er(r),a=this.value||{},s=(n?Xr:Gr)(o,i);return s.unit=De(o),s.units=o,s.step=i,s.start=a.start,s.stop=a.stop,this.value=s}}),ft(Il,gs,{transform(e,t){const n=t.dataflow,r=e.field,i=this.value,o=e=>i.set(r(e),e);let a=!0;return e.modified("field")||t.modified(r.fields)?(i.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,(e=>i.delete(r(e)))),t.visit(t.ADD,o)):a=!1,this.modified(a),i.empty>n.cleanThreshold&&n.runAfter(i.clean),t.fork()}}),ft(Ul,gs,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(qa(e.sort)):t.source).map(e.field))}});const ql={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?++e:e}}},percent_rank:function(){const e=ql.rank(),t=e.next;return{init:e.init,next:e=>(t(e)-1)/(e.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,r=t.compare;let i=t.index;if(e0||oe("ntile num must be greater than zero.");const n=ql.cume_dist(),r=n.next;return{init:n.init,next:e=>Math.ceil(t*r(e))}},lag:function(e,t){return t=+t||1,{next:n=>{const r=n.index-t;return r>=0?e(n.data[r]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const r=n.index+t,i=n.data;return re(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return(t=+t)>0||oe("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(t-1);return rt=null,next:n=>{const r=e(n.data[n.index]);return null!=r?t=r:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:r=>{const i=r.data;return r.index<=n?t:(n=function(e,t,n){for(let r=t.length;ns[e]=1))}d(e.sort),t.forEach(((e,t)=>{const s=n[t],h=ee(s),p=Ou(e,h,i[t]);if(d(s),o.push(p),st(ql,e))a.push(function(e,t,n,r){const i=ql[e](t,n);return{init:i.init||ce,update:function(e,t){t[r]=i.next(e)}}}(e,n[t],r[t],p));else{if(null==s&&"count"!==e&&oe("Null aggregate field specified."),"count"===e)return void l.push(p);f=!1;let t=u[h];t||(t=u[h]=[],t.field=s,c.push(t)),t.push(ju(e,p))}})),(l.length||c.length)&&(this.cell=function(e,t,n){e=e.map((e=>zu(e,e.field)));const r={num:0,agg:null,store:!1,count:t};if(!n)for(var i=e.length,o=r.agg=Array(i),a=0;a0&&!i(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),re.init())),this.cell&&this.cell.init()},Gl.update=function(e,t){const n=this.cell,r=this.windows,i=e.data,o=r&&r.length;let a;if(n){for(a=e.p0;athis.group(i(e));let a=this.state;a&&!n||(a=this.state=new Hl(e)),n||t.modified(a.inputs)?(this.value={},t.visit(t.SOURCE,(e=>o(e).add(e)))):(t.visit(t.REM,(e=>o(e).remove(e))),t.visit(t.ADD,(e=>o(e).add(e))));for(let t=0,n=this._mlen;t0)for(var r,i=e[0],o=t[0],a=e[n]-i,s=t[n]-o,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*e[u]+(1-this._beta)*(i+r*a),this._beta*t[u]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const rc=function e(t){function n(e){return 1===t?new Kl(e):new nc(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function ic(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function oc(e,t){this._context=e,this._k=(1-t)/6}oc.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:ic(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:ic(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const ac=function e(t){function n(e){return new oc(e,t)}return n.tension=function(t){return e(+t)},n}(0);function sc(e,t){this._context=e,this._k=(1-t)/6}sc.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(e,t){switch(e=+e,t=+t,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:ic(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const uc=function e(t){function n(e){return new sc(e,t)}return n.tension=function(t){return e(+t)},n}(0);function lc(e,t){this._context=e,this._k=(1-t)/6}lc.prototype={areaStart:Ql,areaEnd:Ql,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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:ic(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const cc=function e(t){function n(e){return new lc(e,t)}return n.tension=function(t){return e(+t)},n}(0),fc=Math.abs,dc=Math.atan2,hc=Math.cos,pc=Math.max,gc=Math.min,mc=Math.sin,yc=Math.sqrt,vc=1e-12,bc=Math.PI,xc=bc/2,_c=2*bc;function wc(e){return e>=1?xc:e<=-1?-xc:Math.asin(e)}function kc(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>vc){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>vc){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*l+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}function Ac(e,t){this._context=e,this._alpha=t}Ac.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:kc(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Ec=function e(t){function n(e){return t?new Ac(e,t):new oc(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Oc(e,t){this._context=e,this._alpha=t}Oc.prototype={areaStart:Ql,areaEnd:Ql,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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:kc(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Dc=function e(t){function n(e){return t?new Oc(e,t):new lc(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Sc(e,t){this._context=e,this._alpha=t}Sc.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:kc(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Cc=function e(t){function n(e){return t?new Sc(e,t):new sc(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Fc(e){this._context=e}function jc(e){return new Fc(e)}function Mc(e){this._context=e}function $c(e){return e<0?-1:1}function Nc(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return($c(o)+$c(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Bc(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Tc(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function zc(e){this._context=e}function Rc(e){this._context=new Pc(e)}function Pc(e){this._context=e}function Lc(e){this._context=e}function Ic(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};const Wc=Math.PI,Hc=2*Wc,Gc=1e-6,Vc=Hc-Gc;function Yc(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Yc;const n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;tGc)if(Math.abs(c*s-u*l)>Gc&&i){let d=n-o,h=r-a,p=s*s+u*u,g=d*d+h*h,m=Math.sqrt(p),y=Math.sqrt(f),v=i*Math.tan((Wc-Math.acos((p+f-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>Gc&&this._append`L${e+b*l},${t+b*c}`,this._append`A${i},${i},0,0,${+(c*d>l*h)},${this._x1=e+x*s},${this._y1=t+x*u}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,n,r,i,o){if(e=+e,t=+t,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),u=e+a,l=t+s,c=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${u},${l}`:(Math.abs(this._x1-u)>Gc||Math.abs(this._y1-l)>Gc)&&this._append`L${u},${l}`,n&&(f<0&&(f=f%Hc+Hc),f>Vc?this._append`A${n},${n},0,1,${c},${e-a},${t-s}A${n},${n},0,1,${c},${this._x1=u},${this._y1=l}`:f>Gc&&this._append`A${n},${n},0,${+(f>=Wc)},${c},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function Zc(){return new Xc}function Jc(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Xc(t)}function Kc(e){return e.innerRadius}function Qc(e){return e.outerRadius}function ef(e){return e.startAngle}function tf(e){return e.endAngle}function nf(e){return e&&e.padAngle}function rf(e,t,n,r,i,o,a){var s=e-n,u=t-r,l=(a?o:-o)/yc(s*s+u*u),c=l*u,f=-l*s,d=e+c,h=t+f,p=n+c,g=r+f,m=(d+p)/2,y=(h+g)/2,v=p-d,b=g-h,x=v*v+b*b,_=i-o,w=d*g-p*h,k=(b<0?-1:1)*yc(pc(0,_*_*x-w*w)),A=(w*b-v*k)/x,E=(-w*v-b*k)/x,O=(w*b+v*k)/x,D=(-w*v+b*k)/x,S=A-m,C=E-y,F=O-m,j=D-y;return S*S+C*C>F*F+j*j&&(A=O,E=D),{cx:A,cy:E,x01:-c,y01:-f,x11:A*(i/_-1),y11:E*(i/_-1)}}function of(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function af(e){return e[0]}function sf(e){return e[1]}function uf(e,t){var n=qc(!0),r=null,i=jc,o=null,a=Jc(s);function s(s){var u,l,c,f=(s=of(s)).length,d=!1;for(null==r&&(o=i(c=a())),u=0;u<=f;++u)!(u=f;--d)s.point(y[d],v[d]);s.lineEnd(),s.areaEnd()}m&&(y[c]=+e(h,c,l),v[c]=+t(h,c,l),s.point(r?+r(h,c,l):y[c],n?+n(h,c,l):v[c]))}if(p)return s=null,p+""||null}function c(){return uf().defined(i).curve(a).context(o)}return e="function"==typeof e?e:void 0===e?af:qc(+e),t="function"==typeof t?t:qc(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?sf:qc(+n),l.x=function(t){return arguments.length?(e="function"==typeof t?t:qc(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:qc(+t),l):e},l.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:qc(+e),l):r},l.y=function(e){return arguments.length?(t="function"==typeof e?e:qc(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t="function"==typeof e?e:qc(+e),l):t},l.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:qc(+e),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(r).y(t)},l.defined=function(e){return arguments.length?(i="function"==typeof e?e:qc(!!e),l):i},l.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),l):a},l.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),l):o},l}Zc.prototype=Xc.prototype,Array.prototype.slice,yc(3);const cf={draw(e,t){const n=yc(t/bc);e.moveTo(n,0),e.arc(0,0,n,0,_c)}};yc(1/3),mc(bc/10),mc(7*bc/10);function ff(e,t){if("undefined"!=typeof document&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}mc(_c/10),hc(_c/10),yc(3),yc(3),yc(3),yc(12);const df=()=>"undefined"!=typeof Image?Image:null,hf=cr(ur),pf=hf.right,gf=hf.left,mf=(cr(As).center,pf);function yf(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function vf(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function bf(){}var xf=.7,_f=1/xf,wf="\\s*([+-]?\\d+)\\s*",kf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Af="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ef=/^#([0-9a-f]{3,8})$/,Of=new RegExp(`^rgb\\(${wf},${wf},${wf}\\)$`),Df=new RegExp(`^rgb\\(${Af},${Af},${Af}\\)$`),Sf=new RegExp(`^rgba\\(${wf},${wf},${wf},${kf}\\)$`),Cf=new RegExp(`^rgba\\(${Af},${Af},${Af},${kf}\\)$`),Ff=new RegExp(`^hsl\\(${kf},${Af},${Af}\\)$`),jf=new RegExp(`^hsla\\(${kf},${Af},${Af},${kf}\\)$`),Mf={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};function $f(){return this.rgb().formatHex()}function Nf(){return this.rgb().formatRgb()}function Bf(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ef.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Tf(t):3===n?new Lf(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?zf(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?zf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Of.exec(e))?new Lf(t[1],t[2],t[3],1):(t=Df.exec(e))?new Lf(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Sf.exec(e))?zf(t[1],t[2],t[3],t[4]):(t=Cf.exec(e))?zf(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Ff.exec(e))?Gf(t[1],t[2]/100,t[3]/100,1):(t=jf.exec(e))?Gf(t[1],t[2]/100,t[3]/100,t[4]):Mf.hasOwnProperty(e)?Tf(Mf[e]):"transparent"===e?new Lf(NaN,NaN,NaN,0):null}function Tf(e){return new Lf(e>>16&255,e>>8&255,255&e,1)}function zf(e,t,n,r){return r<=0&&(e=t=n=NaN),new Lf(e,t,n,r)}function Rf(e){return e instanceof bf||(e=Bf(e)),e?new Lf((e=e.rgb()).r,e.g,e.b,e.opacity):new Lf}function Pf(e,t,n,r){return 1===arguments.length?Rf(e):new Lf(e,t,n,null==r?1:r)}function Lf(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function If(){return`#${Hf(this.r)}${Hf(this.g)}${Hf(this.b)}`}function Uf(){const e=qf(this.opacity);return`${1===e?"rgb(":"rgba("}${Wf(this.r)}, ${Wf(this.g)}, ${Wf(this.b)}${1===e?")":`, ${e})`}`}function qf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Wf(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Hf(e){return((e=Wf(e))<16?"0":"")+e.toString(16)}function Gf(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Xf(e,t,n,r)}function Vf(e){if(e instanceof Xf)return new Xf(e.h,e.s,e.l,e.opacity);if(e instanceof bf||(e=Bf(e)),!e)return new Xf;if(e instanceof Xf)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n0&&u<1?0:a,new Xf(a,s,u,e.opacity)}function Yf(e,t,n,r){return 1===arguments.length?Vf(e):new Xf(e,t,n,null==r?1:r)}function Xf(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Zf(e){return(e=(e||0)%360)<0?e+360:e}function Jf(e){return Math.max(0,Math.min(1,e||0))}function Kf(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function Qf(e,t,n,r,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*n+(1+3*e+3*o-3*a)*r+a*i)/6}function ed(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],a=r>0?e[r-1]:2*i-o,s=r=240?e-240:e+120,i,r),Kf(e,i,r),Kf(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Xf(Zf(this.h),Jf(this.s),Jf(this.l),qf(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=qf(this.opacity);return`${1===e?"hsl(":"hsla("}${Zf(this.h)}, ${100*Jf(this.s)}%, ${100*Jf(this.l)}%${1===e?")":`, ${e})`}`}}));const nd=e=>()=>e;function rd(e,t){return function(n){return e+n*t}}function id(e,t){var n=t-e;return n?rd(e,n>180||n<-180?n-360*Math.round(n/360):n):nd(isNaN(e)?t:e)}function od(e,t){var n=t-e;return n?rd(e,n):nd(isNaN(e)?t:e)}const ad=function e(t){var n=function(e){return 1==(e=+e)?od:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):nd(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Pf(e)).r,(t=Pf(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=od(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function sd(e){return function(t){var n,r,i=t.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;no&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:gd(n,r)})),o=vd.lastIndex;return ot&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?Dd:Od,i=o=null,f}function f(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),s,u)))(e(l(t)))}return f.invert=function(n){return l(t((o||(o=r(s,a.map(e),gd)))(n)))},f.domain=function(e){return arguments.length?(a=Array.from(e,wd),c()):a.slice()},f.range=function(e){return arguments.length?(s=Array.from(e),c()):s.slice()},f.rangeRound=function(e){return s=Array.from(e),u=_d,c()},f.clamp=function(e){return arguments.length?(l=!!e||Ad,c()):l!==Ad},f.interpolate=function(e){return arguments.length?(u=e,c()):u},f.unknown=function(e){return arguments.length?(n=e,f):n},function(n,r){return e=n,t=r,c()}}function Fd(){return Cd()(Ad,Ad)}function jd(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Md(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}function $d(e,t,n,r){var i,o=rn(e,t,n);switch((r=sn(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=fn(o,a))||(r.precision=i),bn(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=dn(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=hn(o))||(r.precision=i-2*("%"===r.type))}return vn(r)}function Nd(e){var t=e.domain;return e.ticks=function(e){var n=t();return tn(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return $d(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,s=o.length-1,u=o[a],l=o[s],c=10;for(l0;){if((i=nn(u,l,n))===r)return o[a]=u,o[s]=l,t(o);if(i>0)u=Math.floor(u/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;u=Math.ceil(u*i)/i,l=Math.floor(l*i)/i}r=i}return e},e}function Bd(e,t){var n,r=0,i=(e=e.slice()).length-1,o=e[r],a=e[i];return a-e(-t,n)}function Ud(e){const t=e(Td,zd),n=t.domain;let r,i,o=10;function a(){return r=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(o),i=function(e){return 10===e?Ld:e===Math.E?Math.exp:t=>Math.pow(e,t)}(o),n()[0]<0?(r=Id(r),i=Id(i),e(Rd,Pd)):e(Td,zd),t}return t.base=function(e){return arguments.length?(o=+e,a()):o},t.domain=function(e){return arguments.length?(n(e),a()):n()},t.ticks=e=>{const t=n();let a=t[0],s=t[t.length-1];const u=s0){for(;f<=d;++f)for(l=1;ls)break;p.push(c)}}else for(;f<=d;++f)for(l=o-1;l>=1;--l)if(c=f>0?l/i(-f):l*i(f),!(cs)break;p.push(c)}2*p.length{if(null==e&&(e=10),null==n&&(n=10===o?"s":","),"function"!=typeof n&&(o%1||null!=(n=sn(n)).precision||(n.trim=!0),n=vn(n)),e===1/0)return n;const a=Math.max(1,o*e/t.ticks().length);return e=>{let t=e/i(Math.round(r(e)));return t*on(Bd(n(),{floor:e=>i(Math.floor(r(e))),ceil:e=>i(Math.ceil(r(e)))})),t}function qd(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Wd(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Hd(e){return e<0?-e*e:e*e}function Gd(e){var t=e(Ad,Ad),n=1;return t.exponent=function(t){return arguments.length?1==(n=+t)?e(Ad,Ad):.5===n?e(Wd,Hd):e(qd(n),qd(1/n)):n},Nd(t)}function Vd(){var e=Gd(Cd());return e.copy=function(){return Sd(e,Vd()).exponent(e.exponent())},jd.apply(e,arguments),e}function Yd(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Xd(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Zd(e){var t=1,n=e(Yd(t),Xd(t));return n.constant=function(n){return arguments.length?e(Yd(t=+n),Xd(t)):t},Nd(n)}function Jd(e,t,n,r,i,o){const a=[[ar,1,On],[ar,5,5e3],[ar,15,15e3],[ar,30,3e4],[o,1,Dn],[o,5,5*Dn],[o,15,15*Dn],[o,30,30*Dn],[i,1,Sn],[i,3,3*Sn],[i,6,6*Sn],[i,12,12*Sn],[r,1,Cn],[r,2,2*Cn],[n,1,Fn],[t,1,jn],[t,3,3*jn],[e,1,Mn]];function s(t,n,r){const i=Math.abs(n-t)/r,o=cr((([,,e])=>e)).right(a,i);if(o===a.length)return e.every(rn(t/Mn,n/Mn,r));if(0===o)return sr.every(Math.max(rn(t,n,r),1));const[s,u]=a[i/a[o-1][2]180?t+=360:t-e>180&&(e+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:gd(e,t)})):t&&n.push(i(n)+"rotate("+t+r)}(o.rotate,a.rotate,s,u),function(e,t,n,o){e!==t?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:gd(e,t)}):t&&n.push(i(n)+"skewX("+t+r)}(o.skewX,a.skewX,s,u),function(e,t,n,r,o,a){if(e!==n||t!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:gd(e,n)},{i:s-2,x:gd(t,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(e){for(var t,n=-1,r=u.length;++nUh?Math.pow(e,1/3):e/Ih+Ph}function Vh(e){return e>Lh?e*e*e:Ih*(e-Ph)}function Yh(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Xh(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Zh(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Jh)return new Jh(e.h,e.c,e.l,e.opacity);if(e instanceof Hh||(e=qh(e)),0===e.a&&0===e.b)return new Jh(NaN,00?r:1:0}const vp="linear",bp="log",xp="pow",_p="sqrt",wp="symlog",kp="time",Ap="utc",Ep="sequential",Op="diverging",Dp="quantile",Sp="quantize",Cp="threshold",Fp="ordinal",jp="point",Mp="band",$p="bin-ordinal",Np="continuous",Bp="discrete",Tp="discretizing",zp="interpolating",Rp="temporal";function Pp(){const e=bh().unknown(void 0),t=e.domain,n=e.range;let r,i,o=[0,1],a=!1,s=0,u=0,l=.5;function c(){const e=t().length,c=o[1]h+r*e));return n(c?p.reverse():p)}return delete e.unknown,e.domain=function(e){return arguments.length?(t(e),c()):t()},e.range=function(e){return arguments.length?(o=[+e[0],+e[1]],c()):o.slice()},e.rangeRound=function(e){return o=[+e[0],+e[1]],a=!0,c()},e.bandwidth=function(){return i},e.step=function(){return r},e.round=function(e){return arguments.length?(a=!!e,c()):a},e.padding=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),s=u,c()):s},e.paddingInner=function(e){return arguments.length?(s=Math.max(0,Math.min(1,e)),c()):s},e.paddingOuter=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),c()):u},e.align=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),c()):l},e.invertRange=function(e){if(null==e[0]||null==e[1])return;const r=o[1]o[1-r])?void 0:(u=Math.max(0,pf(a,f)-1),l=f===d?u:pf(a,d)-1,f-a[u]>i+1e-10&&++u,r&&(c=u,u=s-l,l=s-c),u>l?void 0:t().slice(u,l+1))},e.invert=function(t){const n=e.invertRange([t,t]);return n?n[0]:n},e.copy=function(){return Pp().domain(t()).range(o).round(a).paddingInner(s).paddingOuter(u).align(l)},c()}function Lp(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return Lp(t())},e}var Ip=Array.prototype.map;const Up=Array.prototype.slice,qp=new Map,Wp=Symbol("vega_scale");function Hp(e){return e[Wp]=!0,e}function Gp(e,t,n){return arguments.length>1?(qp.set(e,function(e,t,n){const r=function(){const n=t();return n.invertRange||(n.invertRange=n.invert?function(e){return function(t){let n,r=t[0],i=t[1];return i=s&&n[o]<=u&&(l<0&&(l=o),r=o);if(!(l<0))return s=e.invertExtent(n[l]),u=e.invertExtent(n[r]),[void 0===s[0]?s[1]:s[0],void 0===u[1]?u[0]:u[1]]}}(n):void 0),n.type=e,Hp(n)};return r.metadata=Mt(Ge(n)),r}(e,t,n)),this):Vp(e)?qp.get(e):void 0}function Vp(e){return qp.has(e)}function Yp(e,t){const n=qp.get(e);return n&&n.metadata[t]}function Xp(e){return Yp(e,Np)}function Zp(e){return Yp(e,Bp)}function Jp(e){return Yp(e,Tp)}function Kp(e){return Yp(e,bp)}function Qp(e){return Yp(e,zp)}function eg(e){return Yp(e,Dp)}Gp("identity",(function e(t){var n;function r(e){return null==e||isNaN(e=+e)?n:e}return r.invert=r,r.domain=r.range=function(e){return arguments.length?(t=Array.from(e,wd),r):t.slice()},r.unknown=function(e){return arguments.length?(n=e,r):n},r.copy=function(){return e(t).unknown(n)},t=arguments.length?Array.from(t,wd):[0,1],Nd(r)})),Gp(vp,(function e(){var t=Fd();return t.copy=function(){return Sd(t,e())},jd.apply(t,arguments),Nd(t)}),Np),Gp(bp,(function e(){const t=Ud(Cd()).domain([1,10]);return t.copy=()=>Sd(t,e()).base(t.base()),jd.apply(t,arguments),t}),[Np,bp]),Gp(xp,Vd,Np),Gp(_p,(function(){return Vd.apply(null,arguments).exponent(.5)}),Np),Gp(wp,(function e(){var t=Zd(Cd());return t.copy=function(){return Sd(t,e()).constant(t.constant())},jd.apply(t,arguments)}),Np),Gp(kp,(function(){return jd.apply(ih(eh,th,Kn,er,zn,$n,nr,ir,ar,_i).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[Np,Rp]),Gp(Ap,(function(){return jd.apply(ih(Kd,Qd,Qn,tr,Hn,Nn,rr,or,ar,ki).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[Np,Rp]),Gp(Ep,sh,[Np,zp]),Gp(`${Ep}-${vp}`,sh,[Np,zp]),Gp(`${Ep}-${bp}`,(function e(){var t=Ud(oh()).domain([1,10]);return t.copy=function(){return ah(t,e()).base(t.base())},Md.apply(t,arguments)}),[Np,zp,bp]),Gp(`${Ep}-${xp}`,uh,[Np,zp]),Gp(`${Ep}-${_p}`,(function(){return uh.apply(null,arguments).exponent(.5)}),[Np,zp]),Gp(`${Ep}-${wp}`,(function e(){var t=Zd(oh());return t.copy=function(){return ah(t,e()).constant(t.constant())},Md.apply(t,arguments)}),[Np,zp]),Gp(`${Op}-${vp}`,(function e(){var t=Nd(ch()(Ad));return t.copy=function(){return ah(t,e())},Md.apply(t,arguments)}),[Np,zp]),Gp(`${Op}-${bp}`,(function e(){var t=Ud(ch()).domain([.1,1,10]);return t.copy=function(){return ah(t,e()).base(t.base())},Md.apply(t,arguments)}),[Np,zp,bp]),Gp(`${Op}-${xp}`,fh,[Np,zp]),Gp(`${Op}-${_p}`,(function(){return fh.apply(null,arguments).exponent(.5)}),[Np,zp]),Gp(`${Op}-${wp}`,(function e(){var t=Zd(ch());return t.copy=function(){return ah(t,e()).constant(t.constant())},Md.apply(t,arguments)}),[Np,zp]),Gp(Dp,(function e(){var t,n=[],r=[],i=[];function o(){var e=0,t=Math.max(1,r.length);for(i=new Array(t-1);++e0?i[t-1]:n[0],t=i?[o[i-1],r]:[o[t-1],o[t]]},s.unknown=function(e){return arguments.length?(t=e,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return e().domain([n,r]).range(a).unknown(t)},jd.apply(Nd(s),arguments)}),Tp),Gp(Cp,(function e(){var t,n=[.5],r=[0,1],i=1;function o(e){return null!=e&&e<=e?r[mf(n,e,0,i)]:t}return o.domain=function(e){return arguments.length?(n=Array.from(e),i=Math.min(n.length,r.length-1),o):n.slice()},o.range=function(e){return arguments.length?(r=Array.from(e),i=Math.min(n.length,r.length-1),o):r.slice()},o.invertExtent=function(e){var t=r.indexOf(e);return[n[t-1],n[t]]},o.unknown=function(e){return arguments.length?(t=e,o):t},o.copy=function(){return e().domain(n).range(r).unknown(t)},jd.apply(o,arguments)}),Tp),Gp($p,(function e(){let t=[],n=[];function r(e){return null==e||e!=e?void 0:n[(mf(t,e)-1)%n.length]}return r.domain=function(e){return arguments.length?(t=function(e){return Ip.call(e,Se)}(e),r):t.slice()},r.range=function(e){return arguments.length?(n=Up.call(e),r):n.slice()},r.tickFormat=function(e,n){return $d(t[0],De(t),null==e?10:e,n)},r.copy=function(){return e().domain(r.domain()).range(r.range())},r}),[Bp,Tp]),Gp(Fp,bh,Bp),Gp(Mp,Pp,Bp),Gp(jp,(function(){return Lp(Pp().paddingInner(1))}),Bp);const tg=["clamp","base","constant","exponent"];function ng(e,t){const n=t[0],r=De(t)-n;return function(t){return e(n+t*r)}}function rg(e,t,n){return lh(ag(t||"rgb",n),e)}function ig(e,t){const n=new Array(t),r=t+1;for(let i=0;ie[t]?a[t](e[t]()):0)),a):tt(.5)}function ag(e,t){const n=a[function(e){return"interpolate"+e.toLowerCase().split("-").map((e=>e[0].toUpperCase()+e.slice(1))).join("")}(e)];return null!=t&&n&&n.gamma?n.gamma(t):n}function sg(e){const t=e.length/6|0,n=new Array(t);for(let r=0;r1?(lg[e]=t,this):lg[e]}ug({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},sg),ug({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},(e=>rg(sg(e))));const fg="symbol",dg="discrete",hg=e=>_e(e)?e.map((e=>String(e))):String(e),pg=(e,t)=>e[1]-t[1],gg=(e,t)=>t[1]-e[1];function mg(e,t,n){let r;return mt(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),null!=n&&(t=Math.min(t,Math.floor(Ot(e.domain())/n||1)))),we(t)&&(r=t.step,t=t.interval),vt(t)&&(t=e.type===kp?Kr(t):e.type==Ap?Qr(t):oe("Only time and utc scales accept interval strings."),r&&(t=t.every(r))),t}function yg(e,t,n){let r=e.range(),i=r[0],o=De(r),a=pg;if(i>o&&(r=o,o=i,i=r,a=gg),i=Math.floor(i),o=Math.ceil(o),t=t.map((t=>[t,e(t)])).filter((e=>i<=e[1]&&e[1]<=o)).sort(a).map((e=>e[0])),n>0&&t.length>1){const e=[t[0],De(t)];for(;t.length>n&&t.length>=3;)t=t.filter(((e,t)=>!(t%2)));t.length<3&&(t=e)}return t}function vg(e,t){return e.bins?yg(e,e.bins):e.ticks?e.ticks(t):e.domain()}function bg(e,t,n,r,i,o){const a=t.type;let s=hg;if(a===kp||i===kp)s=e.timeFormat(r);else if(a===Ap||i===Ap)s=e.utcFormat(r);else if(Kp(a)){const i=e.formatFloat(r);if(o||t.bins)s=i;else{const e=xg(t,n,!1);s=t=>e(t)?i(t):""}}else if(t.tickFormat){const i=t.domain();s=e.formatSpan(i[0],i[i.length-1],n,r)}else r&&(s=e.format(r));return s}function xg(e,t,n){const r=vg(e,t),i=e.base(),o=Math.log(i),a=Math.max(1,i*t/r.length),s=e=>{let t=e/Math.pow(i,Math.round(Math.log(e)/o));return t*i_g[e.type]||e.bins;function Eg(e,t,n,r,i,o,a){const s=wg[t.type]&&o!==kp&&o!==Ap?function(e,t,n){const r=t[wg[t.type]](),i=r.length;let o,a=i>1?r[1]-r[0]:r[0];for(o=1;o(t,n,r)=>{const i=Dg(r[n+1],Dg(r.max,1/0)),o=Fg(t,e),a=Fg(i,e);return o&&a?o+" – "+a:a?"< "+a:"≥ "+o},Dg=(e,t)=>null!=e?e:t,Sg=e=>(t,n)=>n?e(t):null,Cg=e=>t=>e(t),Fg=(e,t)=>Number.isFinite(e)?t(e):null;function jg(e,t,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=function(e,t,n,r){const i=r||t.type;return vt(n)&&function(e){return Yp(e,Rp)}(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||i!==kp?n||i!==Ap?Eg(e,t,5,null,n,r,!0):e.utcFormat("%A, %d %B %Y, %X UTC"):e.timeFormat("%A, %d %B %Y, %X")}(e,t,n.format,n.formatType);if(Jp(t.type)){const e=kg(t).slice(1).map(i),n=e.length;return`${n} boundar${1===n?"y":"ies"}: ${e.join(", ")}`}if(Zp(t.type)){const e=t.domain(),n=e.length;return`${n} value${1===n?"":"s"}: ${n>r?e.slice(0,r-2).map(i).join(", ")+", ending with "+e.slice(-1).map(i):e.map(i).join(", ")}`}{const e=t.domain();return`values from ${i(e[0])} to ${i(De(e))}`}}let Mg=0;const $g="p_";function Ng(e){return e&&e.gradient}function Bg(e,t,n){const r=e.gradient;let i=e.id,o="radial"===r?$g:"";return i||(i=e.id="gradient_"+Mg++,"radial"===r?(e.x1=Tg(e.x1,.5),e.y1=Tg(e.y1,.5),e.r1=Tg(e.r1,0),e.x2=Tg(e.x2,.5),e.y2=Tg(e.y2,.5),e.r2=Tg(e.r2,.5),o=$g):(e.x1=Tg(e.x1,0),e.y1=Tg(e.y1,0),e.x2=Tg(e.x2,1),e.y2=Tg(e.y2,0))),t[i]=e,"url("+(n||"")+"#"+o+i+")"}function Tg(e,t){return null!=e?e:t}function zg(e,t){var n,r=[];return n={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:r,stop:function(e,t){return r.push({offset:e,color:t}),n}}}const Rg={basis:{curve:function(e){return new Kl(e)}},"basis-closed":{curve:function(e){return new ec(e)}},"basis-open":{curve:function(e){return new tc(e)}},bundle:{curve:rc,tension:"beta",value:.85},cardinal:{curve:ac,tension:"tension",value:0},"cardinal-open":{curve:uc,tension:"tension",value:0},"cardinal-closed":{curve:cc,tension:"tension",value:0},"catmull-rom":{curve:Ec,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Dc,tension:"alpha",value:.5},"catmull-rom-open":{curve:Cc,tension:"alpha",value:.5},linear:{curve:jc},"linear-closed":{curve:function(e){return new Mc(e)}},monotone:{horizontal:function(e){return new Rc(e)},vertical:function(e){return new zc(e)}},natural:{curve:function(e){return new Lc(e)}},step:{curve:function(e){return new Uc(e,.5)}},"step-after":{curve:function(e){return new Uc(e,1)}},"step-before":{curve:function(e){return new Uc(e,0)}}};function Pg(e,t,n){var r=st(Rg,e)&&Rg[e],i=null;return r&&(i=r.curve||r[t||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}const Lg={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},Ig=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,Ug=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,qg=/^((\s+,?\s*)|(,\s*))/,Wg=/^[01]/;function Hg(e){const t=[];return(e.match(Ig)||[]).forEach((e=>{let n=e[0];const r=n.toLowerCase(),i=Lg[r],o=function(e,t,n){const r=[];for(let i=0;t&&i1&&(g=Math.sqrt(g),n*=g,r*=g);const m=d/n,y=f/n,v=-f/r,b=d/r,x=m*s+y*u,_=v*s+b*u,w=m*e+y*t,k=v*e+b*t;let A=1/((w-x)*(w-x)+(k-_)*(k-_))-.25;A<0&&(A=0);let E=Math.sqrt(A);o==i&&(E=-E);const O=.5*(x+w)-E*(k-_),D=.5*(_+k)+E*(w-x),S=Math.atan2(_-D,x-O);let C=Math.atan2(k-D,w-O)-S;C<0&&1===o?C+=Yg:C>0&&0===o&&(C-=Yg);const F=Math.ceil(Math.abs(C/(Vg+.001))),j=[];for(let e=0;e+e}function pm(e,t,n){return Math.max(t,Math.min(e,n))}function gm(){var e=lm,t=cm,n=fm,r=dm,i=hm(0),o=i,a=i,s=i,u=null;function l(l,c,f){var d,h=null!=c?c:+e.call(this,l),p=null!=f?f:+t.call(this,l),g=+n.call(this,l),m=+r.call(this,l),y=Math.min(g,m)/2,v=pm(+i.call(this,l),0,y),b=pm(+o.call(this,l),0,y),x=pm(+a.call(this,l),0,y),_=pm(+s.call(this,l),0,y);if(u||(u=d=Zc()),v<=0&&b<=0&&x<=0&&_<=0)u.rect(h,p,g,m);else{var w=h+g,k=p+m;u.moveTo(h+v,p),u.lineTo(w-b,p),u.bezierCurveTo(w-um*b,p,w,p+um*b,w,p+b),u.lineTo(w,k-_),u.bezierCurveTo(w,k-um*_,w-um*_,k,w-_,k),u.lineTo(h+x,k),u.bezierCurveTo(h+um*x,k,h,k-um*x,h,k-x),u.lineTo(h,p+v),u.bezierCurveTo(h,p+um*v,h+um*v,p,h+v,p),u.closePath()}if(d)return u=null,d+""||null}return l.x=function(t){return arguments.length?(e=hm(t),l):e},l.y=function(e){return arguments.length?(t=hm(e),l):t},l.width=function(e){return arguments.length?(n=hm(e),l):n},l.height=function(e){return arguments.length?(r=hm(e),l):r},l.cornerRadius=function(e,t,n,r){return arguments.length?(i=hm(e),o=null!=t?hm(t):i,s=null!=n?hm(n):i,a=null!=r?hm(r):o,l):i},l.context=function(e){return arguments.length?(u=null==e?null:e,l):u},l}function mm(){var e,t,n,r,i,o,a,s,u=null;function l(e,t,n){const r=n/2;if(i){var l=a-t,c=e-o;if(l||c){var f=Math.sqrt(l*l+c*c),d=(l/=f)*s,h=(c/=f)*s,p=Math.atan2(c,l);u.moveTo(o-d,a-h),u.lineTo(e-l*r,t-c*r),u.arc(e,t,r,p-Math.PI,p),u.lineTo(o+d,a+h),u.arc(o,a,s,p,p+Math.PI)}else u.arc(e,t,r,0,Yg);u.closePath()}else i=1;o=e,a=t,s=r}function c(o){var a,s,c,f=o.length,d=!1;for(null==u&&(u=c=Zc()),a=0;a<=f;++a)!(ae.x||0,bm=e=>e.y||0,xm=e=>!(!1===e.defined),_m=function(){var e=Kc,t=Qc,n=qc(0),r=null,i=ef,o=tf,a=nf,s=null,u=Jc(l);function l(){var l,c,f=+e.apply(this,arguments),d=+t.apply(this,arguments),h=i.apply(this,arguments)-xc,p=o.apply(this,arguments)-xc,g=fc(p-h),m=p>h;if(s||(s=l=u()),dvc)if(g>_c-vc)s.moveTo(d*hc(h),d*mc(h)),s.arc(0,0,d,h,p,!m),f>vc&&(s.moveTo(f*hc(p),f*mc(p)),s.arc(0,0,f,p,h,m));else{var y,v,b=h,x=p,_=h,w=p,k=g,A=g,E=a.apply(this,arguments)/2,O=E>vc&&(r?+r.apply(this,arguments):yc(f*f+d*d)),D=gc(fc(d-f)/2,+n.apply(this,arguments)),S=D,C=D;if(O>vc){var F=wc(O/f*mc(E)),j=wc(O/d*mc(E));(k-=2*F)>vc?(_+=F*=m?1:-1,w-=F):(k=0,_=w=(h+p)/2),(A-=2*j)>vc?(b+=j*=m?1:-1,x-=j):(A=0,b=x=(h+p)/2)}var M=d*hc(b),$=d*mc(b),N=f*hc(w),B=f*mc(w);if(D>vc){var T,z=d*hc(x),R=d*mc(x),P=f*hc(_),L=f*mc(_);if(g1?0:e<-1?bc:Math.acos(e)}((I*q+U*W)/(yc(I*I+U*U)*yc(q*q+W*W)))/2),G=yc(T[0]*T[0]+T[1]*T[1]);S=gc(D,(f-G)/(H-1)),C=gc(D,(d-G)/(H+1))}else S=C=0}A>vc?C>vc?(y=rf(P,L,M,$,d,C,m),v=rf(z,R,N,B,d,C,m),s.moveTo(y.cx+y.x01,y.cy+y.y01),Cvc&&k>vc?S>vc?(y=rf(N,B,z,R,f,-S,m),v=rf(M,$,P,L,f,-S,m),s.lineTo(y.cx+y.x01,y.cy+y.y01),Se.startAngle||0)).endAngle((e=>e.endAngle||0)).padAngle((e=>e.padAngle||0)).innerRadius((e=>e.innerRadius||0)).outerRadius((e=>e.outerRadius||0)).cornerRadius((e=>e.cornerRadius||0)),wm=lf().x(vm).y1(bm).y0((e=>(e.y||0)+(e.height||0))).defined(xm),km=lf().y(bm).x1(vm).x0((e=>(e.x||0)+(e.width||0))).defined(xm),Am=uf().x(vm).y(bm).defined(xm),Em=gm().x(vm).y(bm).width((e=>e.width||0)).height((e=>e.height||0)).cornerRadius((e=>ym(e.cornerRadiusTopLeft,e.cornerRadius)||0),(e=>ym(e.cornerRadiusTopRight,e.cornerRadius)||0),(e=>ym(e.cornerRadiusBottomRight,e.cornerRadius)||0),(e=>ym(e.cornerRadiusBottomLeft,e.cornerRadius)||0)),Om=function(e,t){let n=null,r=Jc(i);function i(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return e="function"==typeof e?e:qc(e||cf),t="function"==typeof t?t:qc(void 0===t?64:+t),i.type=function(t){return arguments.length?(e="function"==typeof t?t:qc(t),i):e},i.size=function(e){return arguments.length?(t="function"==typeof e?e:qc(+e),i):t},i.context=function(e){return arguments.length?(n=null==e?null:e,i):n},i}().type((e=>am(e.shape||"circle"))).size((e=>ym(e.size,64))),Dm=mm().x(vm).y(bm).defined(xm).size((e=>e.size||1));function Sm(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function Cm(e,t,n,r){return Em.context(e)(t,n,r)}var Fm=1;function jm(){Fm=1}function Mm(e,t,n){var r=t.clip,i=e._defs,o=t.clip_id||(t.clip_id="clip"+Fm++),a=i.clipping[o]||(i.clipping[o]={id:o});return Ye(r)?a.path=r(null):Sm(n)?a.path=Cm(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function $m(e){this.clear(),e&&this.union(e)}function Nm(e){this.mark=e,this.bounds=this.bounds||new $m}function Bm(e){Nm.call(this,e),this.items=this.items||[]}function Tm(e){this._pending=0,this._loader=e||ja()}function zm(e){e._pending+=1}function Rm(e){e._pending-=1}function Pm(e,t,n){if(t.stroke&&0!==t.opacity&&0!==t.strokeOpacity){const r=null!=t.strokeWidth?+t.strokeWidth:1;e.expand(r+(n?function(e,t){return e.strokeJoin&&"miter"!==e.strokeJoin?0:t}(t,r):0))}return e}$m.prototype={clone(){return new $m(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,r){return nthis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const r=this.rotatedPoints(e,t,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(e,t,n){var{x1:r,y1:i,x2:o,y2:a}=this,s=Math.cos(e),u=Math.sin(e),l=t-t*s+n*u,c=n-t*u-n*s;return[s*r-u*i+l,u*r+s*i+c,s*r-u*a+l,u*r+s*a+c,s*o-u*i+l,u*o+s*i+c,s*o-u*a+l,u*o+s*a+c]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},ft(Bm,Nm),Tm.prototype={pending(){return this._pending},sanitizeURL(e){const t=this;return zm(t),t._loader.sanitize(e,{context:"href"}).then((e=>(Rm(t),e))).catch((()=>(Rm(t),null)))},loadImage(e){const t=this,n=df();return zm(t),t._loader.sanitize(e,{context:"image"}).then((e=>{const r=e.href;if(!r||!n)throw{url:r};const i=new n,o=st(e,"crossOrigin")?e.crossOrigin:"anonymous";return null!=o&&(i.crossOrigin=o),i.onload=()=>Rm(t),i.onerror=()=>Rm(t),i.src=r,i})).catch((e=>(Rm(t),{complete:!1,width:0,height:0,src:e&&e.url||""})))},ready(){const e=this;return new Promise((t=>{!function n(r){e.pending()?setTimeout((()=>{n(!0)}),10):t(r)}(!1)}))}};const Lm=Yg-1e-8;let Im,Um,qm,Wm,Hm,Gm,Vm,Ym;const Xm=(e,t)=>Im.add(e,t),Zm=(e,t)=>Xm(Um=e,qm=t),Jm=e=>Xm(e,Im.y1),Km=e=>Xm(Im.x1,e),Qm=(e,t)=>Hm*e+Vm*t,ey=(e,t)=>Gm*e+Ym*t,ty=(e,t)=>Xm(Qm(e,t),ey(e,t)),ny=(e,t)=>Zm(Qm(e,t),ey(e,t));function ry(e,t){return Im=e,t?(Wm=t*Gg,Hm=Ym=Math.cos(Wm),Gm=Math.sin(Wm),Vm=-Gm):(Hm=Ym=1,Wm=Gm=Vm=0),iy}const iy={beginPath(){},closePath(){},moveTo:ny,lineTo:ny,rect(e,t,n,r){Wm?(ty(e+n,t),ty(e+n,t+r),ty(e,t+r),ny(e,t)):(Xm(e+n,t+r),Zm(e,t))},quadraticCurveTo(e,t,n,r){const i=Qm(e,t),o=ey(e,t),a=Qm(n,r),s=ey(n,r);oy(Um,i,a,Jm),oy(qm,o,s,Km),Zm(a,s)},bezierCurveTo(e,t,n,r,i,o){const a=Qm(e,t),s=ey(e,t),u=Qm(n,r),l=ey(n,r),c=Qm(i,o),f=ey(i,o);ay(Um,a,u,c,Jm),ay(qm,s,l,f,Km),Zm(c,f)},arc(e,t,n,r,i,o){if(r+=Wm,i+=Wm,Um=n*Math.cos(i)+e,qm=n*Math.sin(i)+t,Math.abs(i-r)>Lm)Xm(e-n,t-n),Xm(e+n,t+n);else{const a=r=>Xm(n*Math.cos(r)+e,n*Math.sin(r)+t);let s,u;if(a(r),a(i),i!==r)if((r%=Yg)<0&&(r+=Yg),(i%=Yg)<0&&(i+=Yg),ii;++u,s-=Vg)a(s);else for(s=r-r%Vg+Vg,u=0;u<4&&s1e-14?(u=a*a+s*o,u>=0&&(u=Math.sqrt(u),l=(-a+u)/o,c=(-a-u)/o)):l=.5*s/a,0m)return!1;h>g&&(g=h)}else if(f>0){if(h0&&(e.globalAlpha=n,e.fillStyle=vy(e,t,t.fill),!0)}var xy=[];function _y(e,t,n){var r=null!=(r=t.strokeWidth)?r:1;return!(r<=0)&&(n*=null==t.strokeOpacity?1:t.strokeOpacity)>0&&(e.globalAlpha=n,e.strokeStyle=vy(e,t,t.stroke),e.lineWidth=r,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||xy),e.lineDashOffset=t.strokeDashOffset||0),!0)}function wy(e,t){return e.zindex-t.zindex||e.index-t.index}function ky(e){if(!e.zdirty)return e.zitems;var t,n,r,i=e.items,o=[];for(n=0,r=i.length;n=0;)if(n=t(i[r]))return n;if(i===o)for(r=(i=e.items).length;--r>=0;)if(!i[r].zindex&&(n=t(i[r])))return n;return null}function Oy(e){return function(t,n,r){Ay(n,(n=>{r&&!r.intersects(n.bounds)||Sy(e,t,n,n)}))}}function Dy(e){return function(t,n,r){!n.items.length||r&&!r.intersects(n.bounds)||Sy(e,t,n.items[0],n.items)}}function Sy(e,t,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(e(t,r)||(gy(t,n),n.fill&&by(t,n,i)&&t.fill(),n.stroke&&_y(t,n,i)&&t.stroke()))}function Cy(e){return e=e||de,function(t,n,r,i,o,a){return r*=t.pixelRatio,i*=t.pixelRatio,Ey(n,(n=>{const s=n.bounds;if((!s||s.contains(o,a))&&s)return e(t,n,r,i,o,a)?n:void 0}))}}function Fy(e,t){return function(n,r,i,o){var a,s,u=Array.isArray(r)?r[0]:r,l=null==t?u.fill:t,c=u.stroke&&n.isPointInStroke;return c&&(a=u.strokeWidth,s=u.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=s?s:"butt"),!e(n,r)&&(l&&n.isPointInPath(i,o)||c&&n.isPointInStroke(i,o))}}function jy(e){return Cy(Fy(e))}function My(e,t){return"translate("+e+","+t+")"}function $y(e){return"rotate("+e+")"}function Ny(e){return My(e.x||0,e.y||0)}function By(e,t,n){function r(e,n){var r=n.x||0,i=n.y||0,o=n.angle||0;e.translate(r,i),o&&e.rotate(o*=Gg),e.beginPath(),t(e,n),o&&e.rotate(-o),e.translate(-r,-i)}return{type:e,tag:"path",nested:!1,attr:function(e,n){e("transform",function(e){return My(e.x||0,e.y||0)+(e.angle?" "+$y(e.angle):"")}(n)),e("d",t(null,n))},bound:function(e,n){return t(ry(e,n.angle),n),Pm(e,n).translate(n.x||0,n.y||0)},draw:Oy(r),pick:jy(r),isect:n||cy(r)}}var Ty=By("arc",(function(e,t){return _m.context(e)(t)}));function zy(e,t,n){function r(e,n){e.beginPath(),t(e,n)}const i=Fy(r);return{type:e,tag:"path",nested:!0,attr:function(e,n){var r=n.mark.items;r.length&&e("d",t(null,r))},bound:function(e,n){var r=n.items;return 0===r.length?e:(t(ry(e),r),Pm(e,r[0]))},draw:Dy(r),pick:function(e,t,n,r,o,a){var s=t.items,u=t.bounds;return!s||!s.length||u&&!u.contains(o,a)?null:(n*=e.pixelRatio,r*=e.pixelRatio,i(e,s,n,r)?s[0]:null)},isect:fy,tip:n}}var Ry=zy("area",(function(e,t){const n=t[0],r=n.interpolate||"linear";return("horizontal"===n.orient?km:wm).curve(Pg(r,n.orient,n.tension)).context(e)(t)}),(function(e,t){for(var n,r,i="horizontal"===e[0].orient?t[1]:t[0],o="horizontal"===e[0].orient?"y":"x",a=e.length,s=1/0;--a>=0;)!1!==e[a].defined&&(r=Math.abs(e[a][o]-i)).5&&t<1.5?.5-Math.abs(t-1):0}function Iy(e,t){const n=Ly(t);e("d",Cm(null,t,n,n))}function Uy(e,t,n,r){const i=Ly(t);e.beginPath(),Cm(e,t,(n||0)+i,(r||0)+i)}const qy=Fy(Uy),Wy=Fy(Uy,!1),Hy=Fy(Uy,!0);var Gy={type:"group",tag:"g",nested:!1,attr:function(e,t){e("transform",Ny(t))},bound:function(e,t){if(!t.clip&&t.items){const n=t.items,r=n.length;for(let t=0;t{const r=t.x||0,i=t.y||0,o=t.strokeForeground,a=null==t.opacity?1:t.opacity;(t.stroke||t.fill)&&a&&(Uy(e,t,r,i),gy(e,t),t.fill&&by(e,t,a)&&e.fill(),t.stroke&&!o&&_y(e,t,a)&&e.stroke()),e.save(),e.translate(r,i),t.clip&&Py(e,t),n&&n.translate(-r,-i),Ay(t,(t=>{this.draw(e,t,n)})),n&&n.translate(r,i),e.restore(),o&&t.stroke&&a&&(Uy(e,t,r,i),gy(e,t),_y(e,t,a)&&e.stroke())}))},pick:function(e,t,n,r,i,o){if(t.bounds&&!t.bounds.contains(i,o)||!t.items)return null;const a=n*e.pixelRatio,s=r*e.pixelRatio;return Ey(t,(u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(i,o))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(ih||op))return;if(e.save(),e.translate(c,f),c=i-c,f=o-f,g&&Sm(u)&&!Hy(e,u,a,s))return e.restore(),null;const m=u.strokeForeground,y=!1!==t.interactive;return y&&m&&u.stroke&&Wy(e,u,a,s)?(e.restore(),u):(l=Ey(u,(e=>function(e,t,n){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,n)}(e,c,f)?this.pick(e,n,r,c,f):null)),!l&&y&&(u.fill||!m&&u.stroke)&&qy(e,u,a,s)&&(l=u),e.restore(),l||null)}))},isect:dy,content:function(e,t,n){e("clip-path",t.clip?Mm(n,t,t):null)},background:function(e,t){e("class","background"),e("aria-hidden",!0),Iy(e,t)},foreground:function(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?Iy(e,t):e("d","")}},Vy={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Yy(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then((t=>{e.image=t,e.image.url=e.url}))),n}function Xy(e,t){return null!=e.width?e.width:t&&t.width?!1!==e.aspect&&e.height?e.height*t.width/t.height:t.width:0}function Zy(e,t){return null!=e.height?e.height:t&&t.height?!1!==e.aspect&&e.width?e.width*t.height/t.width:t.height:0}function Jy(e,t){return"center"===e?t/2:"right"===e?t:0}function Ky(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var Qy={type:"image",tag:"image",nested:!1,attr:function(e,t,n){const r=Yy(t,n),i=Xy(t,r),o=Zy(t,r),a=(t.x||0)-Jy(t.align,i),s=(t.y||0)-Ky(t.baseline,o);e("href",!r.src&&r.toDataURL?r.toDataURL():r.src||"",Vy["xmlns:xlink"],"xlink:href"),e("transform",My(a,s)),e("width",i),e("height",o),e("preserveAspectRatio",!1===t.aspect?"none":"xMidYMid")},bound:function(e,t){const n=t.image,r=Xy(t,n),i=Zy(t,n),o=(t.x||0)-Jy(t.align,r),a=(t.y||0)-Ky(t.baseline,i);return e.set(o,a,o+r,a+i)},draw:function(e,t,n){Ay(t,(t=>{if(n&&!n.intersects(t.bounds))return;const r=Yy(t,this);let i=Xy(t,r),o=Zy(t,r);if(0===i||0===o)return;let a,s,u,l,c=(t.x||0)-Jy(t.align,i),f=(t.y||0)-Ky(t.baseline,o);!1!==t.aspect&&(s=r.width/r.height,u=t.width/t.height,s==s&&u==u&&s!==u&&(u=0;)if(!1!==e[o].defined&&(n=e[o].x-t[0])*n+(r=e[o].y-t[1])*r{if(!n||n.intersects(t.bounds)){var r=null==t.opacity?1:t.opacity;r&&ov(e,t,r)&&(gy(e,t),e.stroke())}}))},pick:Cy((function(e,t,n,r){return!!e.isPointInStroke&&ov(e,t,1)&&e.isPointInStroke(n,r)})),isect:hy},sv=By("shape",(function(e,t){return(t.mark.shape||t.shape).context(e)(t)})),uv=By("symbol",(function(e,t){return Om.context(e)(t)}),fy);const lv=wt();var cv={height:mv,measureWidth:pv,estimateWidth:dv,width:dv,canvas:fv};function fv(e){cv.width=e&&uy?pv:dv}function dv(e,t){return hv(xv(e,t),mv(e))}function hv(e,t){return~~(.8*e.length*t)}function pv(e,t){return mv(e)<=0||!(t=xv(e,t))?0:gv(t,wv(e))}function gv(e,t){const n=`(${t}) ${e}`;let r=lv.get(n);return void 0===r&&(uy.font=t,r=uy.measureText(e).width,lv.set(n,r)),r}function mv(e){return null!=e.fontSize?+e.fontSize||0:11}function yv(e){return null!=e.lineHeight?e.lineHeight:mv(e)+2}function vv(e){return t=e.lineBreak&&e.text&&!_e(e.text)?e.text.split(e.lineBreak):e.text,_e(t)?t.length>1?t:t[0]:t;var t}function bv(e){const t=vv(e);return(_e(t)?t.length-1:0)*yv(e)}function xv(e,t){const n=null==t?"":(t+"").trim();return e.limit>0&&n.length?function(e,t){var n=+e.limit,r=function(e){if(cv.width===pv){const t=wv(e);return e=>gv(e,t)}{const t=mv(e);return e=>hv(e,t)}}(e);if(r(t)>>1,r(t.slice(i))>n?s=i+1:u=i;return o+t.slice(s)}for(;s>>1),r(t.slice(0,i))Math.max(e,cv.width(t,n))),0)):r=cv.width(t,f),"center"===o?l-=r/2:"right"===o&&(l-=r),e.set(l+=s,c+=u,l+r,c+i),t.angle&&!n)e.rotate(t.angle*Gg,s,u);else if(2===n)return e.rotatedPoints(t.angle*Gg,s,u);return e}var Sv={type:"text",tag:"text",nested:!1,attr:function(e,t){var n,r=t.dx||0,i=(t.dy||0)+kv(t),o=Ov(t),a=o.x1,s=o.y1,u=t.angle||0;e("text-anchor",Av[t.align]||"start"),u?(n=My(a,s)+" "+$y(u),(r||i)&&(n+=" "+My(r,i))):n=My(a+r,s+i),e("transform",n)},bound:Dv,draw:function(e,t,n){Ay(t,(t=>{var r,i,o,a,s,u,l,c=null==t.opacity?1:t.opacity;if(!(n&&!n.intersects(t.bounds)||0===c||t.fontSize<=0||null==t.text||0===t.text.length)){if(e.font=wv(t),e.textAlign=t.align||"left",i=(r=Ov(t)).x1,o=r.y1,t.angle&&(e.save(),e.translate(i,o),e.rotate(t.angle*Gg),i=o=0),i+=t.dx||0,o+=(t.dy||0)+kv(t),u=vv(t),gy(e,t),_e(u))for(s=yv(t),a=0;a=0;)if(!1!==e[i].defined&&(n=e[i].x-t[0])*n+(r=e[i].y-t[1])*r<(n=e[i].size||1)*n)return e[i];return null})),Fv={arc:Ty,area:Ry,group:Gy,image:Qy,line:ev,path:nv,rect:iv,rule:av,shape:sv,symbol:uv,text:Sv,trail:Cv};function jv(e,t,n){var r=Fv[e.mark.marktype],i=t||r.bound;return r.nested&&(e=e.mark),i(e.bounds||(e.bounds=new $m),e,n)}var Mv={mark:null};function $v(e,t,n){var r,i,o,a,s=Fv[e.marktype],u=s.bound,l=e.items,c=l&&l.length;if(s.nested)return c?o=l[0]:(Mv.mark=e,o=Mv),a=jv(o,u,n),t&&t.union(a)||a;if(t=t||e.bounds&&e.bounds.clear()||new $m,c)for(r=0,i=l.length;rt;)e.removeChild(n[--r]);return e}function Wv(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function Hv(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function Gv(e,t){this._active=null,this._handlers={},this._loader=e||ja(),this._tooltip=t||Vv}function Vv(e,t,n,r){e.element().setAttribute("title",r||"")}function Yv(e){this._el=null,this._bgcolor=null,this._loader=new Tm(e)}Rv.prototype={toJSON(e){return Bv(this.root,e||0)},mark(e,t,n){const r=Pv(e,t=t||this.root.items[0]);return t.items[n]=r,r.zindex&&(r.group.zdirty=!0),r}},Gv.prototype={initialize(e,t,n){return this._el=e,this._obj=n||null,this.origin(t)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()},scene(e){return arguments.length?(this._scene=e,this):this._scene},on(){},off(){},_handlerIndex(e,t,n){for(let r=e?e.length:0;--r>=0;)if(e[r].type===t&&(!n||e[r].handler===n))return r;return-1},handlers(e){const t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(const e in t)n.push(...t[e]);return n},eventName(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)},handleHref(e,t,n){this._loader.sanitize(n,{context:"href"}).then((t=>{const n=new MouseEvent(e.type,e),r=Lv(null,"a");for(const e in t)r.setAttribute(e,t[e]);r.dispatchEvent(n)})).catch((()=>{}))},handleTooltip(e,t,n){if(t&&null!=t.tooltip){t=function(e,t,n,r){var i,o,a=e&&e.mark;if(a&&(i=Fv[a.marktype]).tip){for((o=Hv(t,n))[0]-=r[0],o[1]-=r[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=i.tip(a.items,o)}return e}(t,e,this.canvas(),this._origin);const r=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,r)}},getItemBoundingClientRect(e){const t=this.canvas();if(!t)return;const n=t.getBoundingClientRect(),r=this._origin,i=e.bounds,o=i.width(),a=i.height();let s=i.x1+r[0]+n.left,u=i.y1+r[1]+n.top;for(;e.mark&&(e=e.mark.group);)s+=e.x||0,u+=e.y||0;return{x:s,y:u,width:o,height:a,left:s,top:u,right:s+o,bottom:u+a}}},Yv.prototype={initialize(e,t,n,r,i){return this._el=e,this.resize(t,n,r,i)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(e){return 0===arguments.length?this._bgcolor:(this._bgcolor=e,this)},resize(e,t,n,r){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=r||1,this},dirty(){},render(e){const t=this;return t._call=function(){t._render(e)},t._call(),t._call=null,t},_render(){},renderAsync(e){const t=this.render(e);return this._ready?this._ready.then((()=>t)):Promise.resolve(t)},_load(e,t){var n=this,r=n._loader[e](t);if(!n._ready){const e=n._call;n._ready=n._loader.ready().then((t=>{t&&e(),n._ready=null}))}return r},sanitizeURL(e){return this._load("sanitizeURL",e)},loadImage(e){return this._load("loadImage",e)}};const Xv="dragenter",Zv="dragleave",Jv="dragover",Kv="mousedown",Qv="mousemove",eb="mouseout",tb="mouseover",nb="click",rb="mousewheel",ib="touchstart",ob="touchmove",ab="touchend",sb=Qv,ub=eb,lb=nb;function cb(e,t){Gv.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}function fb(e,t){(e=>e===ib||e===ob||e===ab?[ib,ob,ab]:[e])(t).forEach((t=>function(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?n=>e[t](n):n=>e.fire(t,n)))}(e,t)))}function db(e,t,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i||(i&&i.exit||this.fire(n,r),this._active=o,this.fire(t,r)),this.fire(e,r)}}function hb(e){return function(t){this.fire(e,t),this._active=null}}ft(cb,Gv,{initialize(e,t,n){return this._canvas=e&&Iv(e,"canvas"),[nb,Kv,Qv,eb,Zv].forEach((e=>fb(this,e))),Gv.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:["keydown","keypress","keyup",Xv,Zv,Jv,Kv,"mouseup",Qv,eb,tb,nb,"dblclick","wheel",rb,ib,ob,ab],DOMMouseScroll(e){this.fire(rb,e)},mousemove:db(Qv,tb,eb),dragover:db(Jv,Xv,Zv),mouseout:hb(eb),dragleave:hb(Zv),mousedown(e){this._down=this._active,this.fire(Kv,e)},click(e){this._down===this._active&&(this.fire(nb,e),this._down=null)},touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(ib,e,!0)},touchmove(e){this.fire(ob,e,!0)},touchend(e){this.fire(ab,e,!0),this._touch=null},fire(e,t,n){const r=n?this._touch:this._active,i=this._handlers[e];if(t.vegaType=e,e===lb&&r&&r.href?this.handleHref(t,r,r.href):e!==sb&&e!==ub||this.handleTooltip(t,r,e!==ub),i)for(let e=0,n=i.length;e=0&&r.splice(i,1),this},pickEvent(e){const t=Hv(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])},pick(e,t,n,r,i){const o=this.context();return Fv[e.marktype].pick.call(this,o,e,t,n,r,i)}});var pb="undefined"!=typeof window&&window.devicePixelRatio||1;function gb(e){Yv.call(this,e),this._options={},this._redraw=!1,this._dirty=new $m,this._tempb=new $m}const mb=Yv.prototype;function yb(e,t){Gv.call(this,e,t);const n=this;n._hrefHandler=vb(n,((e,t)=>{t&&t.href&&n.handleHref(e,t,t.href)})),n._tooltipHandler=vb(n,((e,t)=>{n.handleTooltip(e,t,e.type!==ub)}))}ft(gb,Yv,{initialize(e,t,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:ff(1,1,this._options.type),e&&this._canvas&&(qv(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),mb.initialize.call(this,e,t,n,r,i)},resize(e,t,n,r){if(mb.resize.call(this,e,t,n,r),this._canvas)!function(e,t,n,r,i,o){const a="undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,s=e.getContext("2d"),u=a?pb:i;e.width=t*u,e.height=n*u;for(const e in o)s[e]=o[e];a&&1!==u&&(e.style.width=t+"px",e.style.height=n+"px"),s.pixelRatio=u,s.setTransform(u,0,0,u,u*r[0],u*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const e=this._options.externalContext;e||oe("CanvasRenderer is missing a valid canvas or context"),e.scale(this._scale,this._scale),e.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)},_render(e){const t=this.context(),n=this._origin,r=this._width,i=this._height,o=this._dirty,a=((e,t,n)=>(new $m).set(0,0,t,n).translate(-e[0],-e[1]))(n,r,i);t.save();const s=this._redraw||o.empty()?(this._redraw=!1,a.expand(1)):function(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-n[0]%1,-n[1]%1),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}(t,a.intersect(o),n);return this.clear(-n[0],-n[1],r,i),this.draw(t,e,s),t.restore(),o.clear(),this},draw(e,t,n){const r=Fv[t.marktype];t.clip&&function(e,t){var n=t.clip;e.save(),Ye(n)?(e.beginPath(),n(e),e.clip()):Py(e,t.group)}(e,t),r.draw.call(this,e,t,n),t.clip&&e.restore()},clear(e,t,n,r){const i=this._options,o=this.context();"pdf"===i.type||i.externalContext||o.clearRect(e,t,n,r),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(e,t,n,r))}});const vb=(e,t)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,t.call(e._obj,n,r)};ft(yb,Gv,{initialize(e,t,n){let r=this._svg;return r&&(r.removeEventListener(lb,this._hrefHandler),r.removeEventListener(sb,this._tooltipHandler),r.removeEventListener(ub,this._tooltipHandler)),this._svg=r=e&&Iv(e,"svg"),r&&(r.addEventListener(lb,this._hrefHandler),r.addEventListener(sb,this._tooltipHandler),r.addEventListener(ub,this._tooltipHandler)),Gv.prototype.initialize.call(this,e,t,n)},canvas(){return this._svg},on(e,t){const n=this.eventName(e),r=this._handlers;if(this._handlerIndex(r[n],e,t)<0){const i={type:e,handler:t,listener:vb(this,t)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this},off(e,t){const n=this.eventName(e),r=this._handlers[n],i=this._handlerIndex(r,e,t);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}});const bb="aria-hidden",xb="aria-label",_b="role",wb="aria-roledescription",kb="graphics-object",Ab="graphics-symbol",Eb=(e,t,n)=>({[_b]:e,[wb]:t,[xb]:n||void 0}),Ob=Mt(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),Db={axis:{desc:"axis",caption:function(e){const t=e.datum,n=e.orient,r=t.title?Mb(e):null,i=e.context,o=i.scales[t.scale].value,a=i.dataflow.locale(),s=o.type;return`${"left"===n||"right"===n?"Y":"X"}-axis`+(r?` titled '${r}'`:"")+` for a ${Zp(s)?"discrete":s} scale`+` with ${jg(a,o,e)}`}},legend:{desc:"legend",caption:function(e){const t=e.datum,n=t.title?Mb(e):null,r=`${t.type||""} legend`.trim(),i=t.scales,o=Object.keys(i),a=e.context,s=a.scales[i[o[0]]].value,u=a.dataflow.locale();return((l=r).length?l[0].toUpperCase()+l.slice(1):l)+(n?` titled '${n}'`:"")+` for ${function(e){return(e=e.map((e=>e+("fill"===e||"stroke"===e?" color":"")))).length<2?e[0]:e.slice(0,-1).join(", ")+" and "+De(e)}(o)}`+` with ${jg(u,s,e)}`;var l}},"title-text":{desc:"title",caption:e=>`Title text '${jb(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${jb(e)}'`}},Sb={ariaRole:_b,ariaRoleDescription:wb,description:xb};function Cb(e,t){const n=!1===t.aria;if(e(bb,n||void 0),n||null==t.description)for(const t in Sb)e(Sb[t],void 0);else{const n=t.mark.marktype;e(xb,t.description),e(_b,t.ariaRole||("group"===n?kb:Ab)),e(wb,t.ariaRoleDescription||`${n} mark`)}}function Fb(e){return!1===e.aria?{[bb]:!0}:Ob[e.role]?null:Db[e.role]?function(e,t){try{const n=e.items[0],r=t.caption||(()=>"");return Eb(t.role||Ab,t.desc,n.description||r(n))}catch(e){return null}}(e,Db[e.role]):function(e){const t=e.marktype,n="group"===t||"text"===t||e.items.some((e=>null!=e.description&&!1!==e.aria));return Eb(n?kb:Ab,`${t} mark container`,e.description)}(e)}function jb(e){return Ge(e.text).join(" ")}function Mb(e){try{return Ge(De(e.items).items[0].text).join(" ")}catch(e){return null}}const $b=e=>(e+"").replace(/&/g,"&").replace(//g,">"),Nb=e=>$b(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function Bb(){let e="",t="",n="";const r=[],i=()=>t=n="",o=(e,n)=>(null!=n&&(t+=` ${e}="${Nb(n)}"`),a),a={open(s){(o=>{t&&(e+=`${t}>${n}`,i()),r.push(o)})(s),t="<"+s;for(var u=arguments.length,l=new Array(u>1?u-1:0),c=1;c${n}`:"/>"):``,i(),a},attr:o,text:e=>(n+=$b(e),a),toString:()=>e};return a}const Tb=e=>zb(Bb(),e)+"";function zb(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,r=n.length;for(let t=0;t1&&e.previousSibling!=t}(a,n))&&t.insertBefore(a,n?n.nextSibling:t.firstChild),a}ft(qb,Yv,{initialize(e,t,n,r,i){return this._defs={},this._clearDefs(),e&&(this._svg=Uv(e,0,"svg",Ub),this._svg.setAttributeNS(Ib,"xmlns",Ub),this._svg.setAttributeNS(Ib,"xmlns:xlink",Vy["xmlns:xlink"]),this._svg.setAttribute("version",Vy.version),this._svg.setAttribute("class","marks"),qv(e,1),this._root=Uv(this._svg,0,"g",Ub),ex(this._root,Lb),qv(this._svg,1)),this.background(this._bgcolor),Wb.initialize.call(this,e,t,n,r,i)},background(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),Wb.background.apply(this,arguments)},resize(e,t,n,r){return Wb.resize.call(this,e,t,n,r),this._svg&&(ex(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this},canvas(){return this._svg},svg(){const e=this._svg,t=this._bgcolor;if(!e)return null;let n;t&&(e.removeAttribute("style"),n=Uv(e,0,"rect",Ub),ex(n,{width:this._width,height:this._height,fill:t}));const r=Tb(e);return t&&(e.removeChild(n),this._svg.style.setProperty("background-color",t)),r},_render(e){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,e),qv(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty(e){e.dirty!==this._dirtyID&&(e.dirty=this._dirtyID,this._dirty.push(e))},isDirty(e){return this._dirtyAll||!e._svg||!e._svg.ownerSVGElement||e.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const e=this._dirty;if(!e.length||!this._dirtyID)return!0;const t=++this._dirtyID;let n,r,i,o,a,s,u;for(a=0,s=e.length;a{e.dirty=t}))),r.zdirty||(n.exit?(o.nested&&r.items.length?(u=r.items[0],u._svg&&this._update(o,u._svg,u)):n._svg&&(u=n._svg.parentNode,u&&u.removeChild(n._svg)),n._svg=null):(n=o.nested?r.items[0]:n,n._update!==t&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,Hb(n,t)),n._update=t)));return!this._dirtyAll},mark(e,t,n){if(!this.isDirty(t))return t._svg;const r=this._svg,i=Fv[t.marktype],o=!1===t.interactive?"none":null,a="g"===i.tag,s=Yb(t,e,n,"g",r);s.setAttribute("class",Wv(t));const u=Fb(t);for(const e in u)tx(s,e,u[e]);a||tx(s,"pointer-events",o),tx(s,"clip-path",t.clip?Mm(this,t,t.group):null);let l=null,c=0;const f=e=>{const t=this.isDirty(e),n=Yb(e,s,l,i.tag,r);t&&(this._update(i,n,e),a&&function(e,t,n){t=t.lastChild.previousSibling;let r,i=0;Ay(n,(n=>{r=e.mark(t,n,r),++i})),qv(t,1+i)}(this,n,e)),l=n,++c};return i.nested?t.items.length&&f(t.items[0]):Ay(t,f),qv(s,c),s},_update(e,t,n){Xb=t,Zb=t.__values__,Cb(Kb,n),e.attr(Kb,n,this);const r=Jb[e.type];r&&r.call(this,e,t,n),Xb&&this.style(Xb,n)},style(e,t){if(null!=t){for(const n in Rb){let r="font"===n?_v(t):t[n];if(r===Zb[n])continue;const i=Rb[n];null==r?e.removeAttribute(i):(Ng(r)&&(r=Bg(r,this._defs.gradient,nx())),e.setAttribute(i,r+"")),Zb[n]=r}for(const n in Pb)Qb(e,Pb[n],t[n])}},defs(){const e=this._svg,t=this._defs;let n=t.el,r=0;for(const i in t.gradient)n||(t.el=n=Uv(e,1,"defs",Ub)),r=Gb(n,t.gradient[i],r);for(const i in t.clipping)n||(t.el=n=Uv(e,1,"defs",Ub)),r=Vb(n,t.clipping[i],r);n&&(0===r?(e.removeChild(n),t.el=null):qv(n,r))},_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}});let Xb=null,Zb=null;const Jb={group(e,t,n){const r=Xb=t.childNodes[2];Zb=r.__values__,e.foreground(Kb,n,this),Zb=t.__values__,Xb=t.childNodes[1],e.content(Kb,n,this);const i=Xb=t.childNodes[0];e.background(Kb,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==Zb.events&&(tx(r,"pointer-events",o),tx(i,"pointer-events",o),Zb.events=o),n.strokeForeground&&n.stroke){const e=n.fill;tx(r,"display",null),this.style(i,n),tx(i,"stroke",null),e&&(n.fill=null),Zb=r.__values__,this.style(r,n),e&&(n.fill=e),Xb=null}else tx(r,"display","none")},image(e,t,n){!1===n.smooth?(Qb(t,"image-rendering","optimizeSpeed"),Qb(t,"image-rendering","pixelated")):Qb(t,"image-rendering",null)},text(e,t,n){const r=vv(n);let i,o,a,s;_e(r)?(o=r.map((e=>xv(n,e))),i=o.join("\n"),i!==Zb.text&&(qv(t,0),a=t.ownerDocument,s=yv(n),o.forEach(((e,r)=>{const i=Lv(a,"tspan",Ub);i.__data__=n,i.textContent=e,r&&(i.setAttribute("x",0),i.setAttribute("dy",s)),t.appendChild(i)})),Zb.text=i)):(o=xv(n,r),o!==Zb.text&&(t.textContent=o,Zb.text=o)),tx(t,"font-family",_v(n)),tx(t,"font-size",mv(n)+"px"),tx(t,"font-style",n.fontStyle),tx(t,"font-variant",n.fontVariant),tx(t,"font-weight",n.fontWeight)}};function Kb(e,t,n){t!==Zb[e]&&(n?function(e,t,n,r){null!=n?e.setAttributeNS(r,t,n):e.removeAttributeNS(r,t)}(Xb,e,t,n):tx(Xb,e,t),Zb[e]=t)}function Qb(e,t,n){n!==Zb[t]&&(null==n?e.style.removeProperty(t):e.style.setProperty(t,n+""),Zb[t]=n)}function ex(e,t){for(const n in t)tx(e,n,t[n])}function tx(e,t,n){null!=n?e.setAttribute(t,n):e.removeAttribute(t)}function nx(){let e;return"undefined"==typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function rx(e){Yv.call(this,e),this._text=null,this._defs={gradient:{},clipping:{}}}ft(rx,Yv,{svg(){return this._text},_render(e){const t=Bb();t.open("svg",rt({},Vy,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",Lb,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this},mark(e,t){const n=Fv[t.marktype],r=n.tag,i=[Cb,n.attr];e.open("g",{class:Wv(t),"clip-path":t.clip?Mm(this,t,t.group):null},Fb(t),{"pointer-events":"g"!==r&&!1===t.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&e.open("a",a),e.open(r,this.attr(t,o,i,"g"!==r?r:null)),"text"===r){const t=vv(o);if(_e(t)){const n={x:0,dy:yv(o)};for(let r=0;rthis.mark(e,t))),e.close(),r&&a?(i&&(o.fill=null),o.stroke=a,e.open("path",this.attr(t,o,n.foreground,"bgrect")).close(),i&&(o.fill=i)):e.open("path",this.attr(t,o,n.foreground,"bgfore")).close()}e.close(),a&&e.close()};return n.nested?t.items&&t.items.length&&o(t.items[0]):Ay(t,o),e.close()},href(e){const t=e.href;let n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then((e=>{e["xlink:href"]=e.href,e.href=null,(this._hrefs||(this._hrefs={}))[t]=e}))}return null},attr(e,t,n,r){const i={},o=(e,t,n,r)=>{i[r||e]=t};return Array.isArray(n)?n.forEach((e=>e(o,t,this))):n(o,t,this),r&&function(e,t,n,r,i){let o;if(null==t)return e;if("bgrect"===r&&!1===n.interactive&&(e["pointer-events"]="none"),"bgfore"===r&&(!1===n.interactive&&(e["pointer-events"]="none"),e.display="none",null!==t.fill))return e;"image"===r&&!1===t.smooth&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),"text"===r&&(e["font-family"]=_v(t),e["font-size"]=mv(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const n in Rb){let r=t[n];const o=Rb[n];("transparent"!==r||"fill"!==o&&"stroke"!==o)&&null!=r&&(Ng(r)&&(r=Bg(r,i.gradient,"")),e[o]=r)}for(const e in Pb){const n=t[e];null!=n&&(o=o||[],o.push(`${Pb[e]}: ${n};`))}o&&(e.style=o.join(" "))}(i,t,e,r,this._defs),i},defs(e){const t=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(t).length+Object.keys(n).length){e.open("defs");for(const n in t){const r=t[n],i=r.stops;"radial"===r.gradient?(e.open("pattern",{id:$g+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),e.close(),e.open("radialGradient",{id:n,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):e.open("linearGradient",{id:n,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2});for(let t=0;t1?(sx[e]=t,this):sx[e]}function lx(e,t,n){const r=[],i=(new $m).union(t),o=e.marktype;return o?cx(e,i,n,r):"group"===o?fx(e,i,n,r):oe("Intersect scene must be mark node or group item.")}function cx(e,t,n,r){if(function(e,t,n){return e.bounds&&t.intersects(e.bounds)&&("group"===e.marktype||!1!==e.interactive&&(!n||n(e)))}(e,t,n)){const i=e.items,o=e.marktype,a=i.length;let s=0;if("group"===o)for(;s=0;r--)if(i[r]!=o[r])return!1;for(r=i.length-1;r>=0;r--)if(!mx(e[n=i[r]],t[n],n))return!1;return typeof e==typeof t}(e,t):e==t)}function yx(e,t){return mx(Hg(e),Hg(t))}function vx(){jm(),Mg=0}const bx="top",xx="left",_x="right",wx="bottom",kx="start",Ax="middle",Ex="end",Ox="x",Dx="y",Sx="group",Cx="axis",Fx="title",jx="legend",Mx="row-header",$x="row-footer",Nx="row-title",Bx="column-header",Tx="column-footer",zx="column-title",Rx="fit-x",Px="fit-y",Lx="none",Ix="all",Ux="each",qx="flush",Wx="column",Hx="row";function Gx(e){gs.call(this,null,e)}function Vx(e,t,n){return t(e.bounds.clear(),e,n)}ft(Gx,gs,{transform(e,t){const n=t.dataflow,r=e.mark,i=r.marktype,o=Fv[i],a=o.bound;let s,u=r.bounds;if(o.nested)r.items.length&&n.dirty(r.items[0]),u=Vx(r,a),r.items.forEach((e=>{e.bounds.clear().union(u)}));else if(i===Sx||e.modified())switch(t.visit(t.MOD,(e=>n.dirty(e))),u.clear(),r.items.forEach((e=>u.union(Vx(e,a)))),r.role){case Cx:case jx:case Fx:t.reflow()}else s=t.changed(t.REM),t.visit(t.ADD,(e=>{u.union(Vx(e,a))})),t.visit(t.MOD,(e=>{s=s||u.alignsWith(e.bounds),n.dirty(e),u.union(Vx(e,a))})),s&&(u.clear(),r.items.forEach((e=>u.union(e.bounds))));return px(r),t.modifies("bounds")}});const Yx=":vega_identifier:";function Xx(e){gs.call(this,0,e)}function Zx(e){gs.call(this,null,e)}function Jx(e){gs.call(this,null,e)}Xx.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},ft(Xx,gs,{transform(e,t){const n=(i=t.dataflow)._signals[Yx]||(i._signals[Yx]=i.add(0)),r=e.as;var i;let o=n.value;return t.visit(t.ADD,(e=>e[r]=e[r]||++o)),n.set(this.value=o),t}}),ft(Zx,gs,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,function(e){const t=e.groups,n=e.parent;return t&&1===t.size?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const r=n.marktype===Sx?Bm:Nm;return t.visit(t.ADD,(e=>r.call(e,n))),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});const Kx={parity:e=>e.filter(((e,t)=>t%2?e.opacity=0:1)),greedy:(e,t)=>{let n;return e.filter(((e,r)=>r&&Qx(n.bounds,e.bounds,t)?e.opacity=0:(n=e,1)))}},Qx=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),e_=(e,t)=>{for(var n,r=1,i=e.length,o=e[0].bounds;r{const t=e.bounds;return t.width()>1&&t.height()>1},n_=e=>(e.forEach((e=>e.opacity=1)),e),r_=(e,t)=>e.reflow(t.modified()).modifies("opacity");function i_(e){gs.call(this,null,e)}ft(Jx,gs,{transform(e,t){const n=Kx[e.method]||Kx.parity,r=e.separation||0;let i,o,a=t.materialize(t.SOURCE).source;if(!a||!a.length)return;if(!e.method)return e.modified("method")&&(n_(a),t=r_(t,e)),t;if(a=a.filter(t_),!a.length)return;if(e.sort&&(a=a.slice().sort(e.sort)),i=n_(a),t=r_(t,e),i.length>=3&&e_(i,r)){do{i=n(i,r)}while(i.length>=3&&e_(i,r));i.length<3&&!De(a).opacity&&(i.length>1&&(De(i).opacity=0),De(a).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=((e,t,n)=>{var r=e.range(),i=new $m;return t===bx||t===wx?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),e=>i.encloses(e.bounds)})(e.boundScale,e.boundOrient,+e.boundTolerance),a.forEach((e=>{o(e)||(e.opacity=0)})));const s=i[0].mark.bounds.clear();return a.forEach((e=>{e.opacity&&s.union(e.bounds)})),t}}),ft(i_,gs,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,(e=>n.dirty(e))),t.fields&&t.fields.zindex){const e=t.source&&t.source[0];e&&(e.mark.zdirty=!0)}}});const o_=new $m;function a_(e,t,n){return e[t]===n?0:(e[t]=n,1)}function s_(e){var t=e.items[0].orient;return t===xx||t===_x}function u_(e,t,n,r){var i,o,a=t.items[0],s=a.datum,u=null!=a.translate?a.translate:.5,l=a.orient,c=function(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}(s),f=a.range,d=a.offset,h=a.position,p=a.minExtent,g=a.maxExtent,m=s.title&&a.items[c[2]].items[0],y=a.titlePadding,v=a.bounds,b=m&&bv(m),x=0,_=0;switch(o_.clear().union(v),v.clear(),(i=c[0])>-1&&v.union(a.items[i].bounds),(i=c[1])>-1&&v.union(a.items[i].bounds),l){case bx:x=h||0,_=-d,o=Math.max(p,Math.min(g,-v.y1)),v.add(0,-o).add(f,0),m&&l_(e,m,o,y,b,0,-1,v);break;case xx:x=-d,_=h||0,o=Math.max(p,Math.min(g,-v.x1)),v.add(-o,0).add(0,f),m&&l_(e,m,o,y,b,1,-1,v);break;case _x:x=n+d,_=h||0,o=Math.max(p,Math.min(g,v.x2)),v.add(0,0).add(o,f),m&&l_(e,m,o,y,b,1,1,v);break;case wx:x=h||0,_=r+d,o=Math.max(p,Math.min(g,v.y2)),v.add(0,0).add(f,o),m&&l_(e,m,o,y,0,0,1,v);break;default:x=a.x,_=a.y}return Pm(v.translate(x,_),a),a_(a,"x",x+u)|a_(a,"y",_+u)&&(a.bounds=o_,e.dirty(a),a.bounds=v,e.dirty(a)),a.mark.bounds.clear().union(v)}function l_(e,t,n,r,i,o,a,s){const u=t.bounds;if(t.auto){const s=a*(n+i+r);let l=0,c=0;e.dirty(t),o?l=(t.x||0)-(t.x=s):c=(t.y||0)-(t.y=s),t.mark.bounds.clear().union(u.translate(-l,-c)),e.dirty(t)}s.union(u)}const c_=(e,t)=>Math.floor(Math.min(e,t)),f_=(e,t)=>Math.ceil(Math.max(e,t));function d_(e){return(new $m).set(0,0,e.width||0,e.height||0)}function h_(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function p_(e,t,n){const r=we(e)?e[t]:e;return null!=r?r:void 0!==n?n:0}function g_(e){return e<0?Math.ceil(-e):0}function m_(e,t,n){var r,i,o,a,s,u,l,c,f,d,h,p=!n.nodirty,g=n.bounds===qx?d_:h_,m=o_.set(0,0,0,0),y=p_(n.align,Wx),v=p_(n.align,Hx),b=p_(n.padding,Wx),x=p_(n.padding,Hx),_=n.columns||t.length,w=_<=0?1:Math.ceil(t.length/_),k=t.length,A=Array(k),E=Array(_),O=0,D=Array(k),S=Array(w),C=0,F=Array(k),j=Array(k),M=Array(k);for(i=0;i<_;++i)E[i]=0;for(i=0;i1)for(i=0;i0&&(F[i]+=f/2);if(v&&p_(n.center,Hx)&&1!==_)for(i=0;i0&&(j[i]+=d/2);for(i=0;ii&&(e.warn("Grid headers exceed limit: "+i),t=t.slice(0,i)),A+=o,g=0,y=t.length;g=0&&null==(x=n[m]);m-=d);s?(_=null==h?x.x:Math.round(x.bounds.x1+h*x.bounds.width()),w=A):(_=A,w=null==h?x.y:Math.round(x.bounds.y1+h*x.bounds.height())),v.union(b.bounds.translate(_-(b.x||0),w-(b.y||0))),b.x=_,b.y=w,e.dirty(b),E=a(E,v[l])}return E}function x_(e,t,n,r,i,o){if(t){e.dirty(t);var a=n,s=n;r?a=Math.round(i.x1+o*i.width()):s=Math.round(i.y1+o*i.height()),t.bounds.translate(a-(t.x||0),s-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=a,t.y=s,e.dirty(t)}}function __(e,t,n,r,i,o,a){const s=function(e,t){const n=e[t]||{};return(t,r)=>null!=n[t]?n[t]:null!=e[t]?e[t]:r}(n,t),u=function(e,t){let n=-1/0;return e.forEach((e=>{null!=e.offset&&(n=Math.max(n,e.offset))})),n>-1/0?n:t}(e,s("offset",0)),l=s("anchor",kx),c=l===Ex?1:l===Ax?.5:0,f={align:Ux,bounds:s("bounds",qx),columns:"vertical"===s("direction")?1:e.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(t){case xx:f.anchor={x:Math.floor(r.x1)-u,column:Ex,y:c*(a||r.height()+2*r.y1),row:l};break;case _x:f.anchor={x:Math.ceil(r.x2)+u,y:c*(a||r.height()+2*r.y1),row:l};break;case bx:f.anchor={y:Math.floor(i.y1)-u,row:Ex,x:c*(o||i.width()+2*i.x1),column:l};break;case wx:f.anchor={y:Math.ceil(i.y2)+u,x:c*(o||i.width()+2*i.x1),column:l};break;case"top-left":f.anchor={x:u,y:u};break;case"top-right":f.anchor={x:o-u,y:u,column:Ex};break;case"bottom-left":f.anchor={x:u,y:a-u,row:Ex};break;case"bottom-right":f.anchor={x:o-u,y:a-u,column:Ex,row:Ex}}return f}function w_(e,t){var n,r,i=t.items[0],o=i.datum,a=i.orient,s=i.bounds,u=i.x,l=i.y;return i._bounds?i._bounds.clear().union(s):i._bounds=s.clone(),s.clear(),function(e,t,n){var r=t.padding,i=r-n.x,o=r-n.y;if(t.datum.title){var a=t.items[1].items[0],s=a.anchor,u=t.titlePadding||0,l=r-a.x,c=r-a.y;switch(a.orient){case xx:i+=Math.ceil(a.bounds.width())+u;break;case _x:case wx:break;default:o+=a.bounds.height()+u}switch((i||o)&&A_(e,n,i,o),a.orient){case xx:c+=k_(t,n,a,s,1,1);break;case _x:l+=k_(t,n,a,Ex,0,0)+u,c+=k_(t,n,a,s,1,1);break;case wx:l+=k_(t,n,a,s,0,0),c+=k_(t,n,a,Ex,-1,0,1)+u;break;default:l+=k_(t,n,a,s,0,0)}(l||c)&&A_(e,a,l,c),(l=Math.round(a.bounds.x1-r))<0&&(A_(e,n,-l,0),A_(e,a,-l,0))}else(i||o)&&A_(e,n,i,o)}(e,i,i.items[0].items[0]),s=function(e,t){return e.items.forEach((e=>t.union(e.bounds))),t.x1=e.padding,t.y1=e.padding,t}(i,s),n=2*i.padding,r=2*i.padding,s.empty()||(n=Math.ceil(s.width()+n),r=Math.ceil(s.height()+r)),"symbol"===o.type&&function(e){const t=e.reduce(((e,t)=>(e[t.column]=Math.max(t.bounds.x2-t.x,e[t.column]||0),e)),{});e.forEach((e=>{e.width=t[e.column],e.height=e.bounds.y2-e.y}))}(i.items[0].items[0].items[0].items),a!==Lx&&(i.x=u=0,i.y=l=0),i.width=n,i.height=r,Pm(s.set(u,l,u+n,l+r),i),i.mark.bounds.clear().union(s),i}function k_(e,t,n,r,i,o,a){const s="symbol"!==e.datum.type,u=n.datum.vgrad,l=(!s||!o&&u||a?t:t.items[0]).bounds[i?"y2":"x2"]-e.padding,c=u&&o?l:0,f=u&&o?0:l,d=i<=0?0:bv(n);return Math.round(r===kx?c:r===Ex?f-d:.5*(l-d))}function A_(e,t,n,r){t.x+=n,t.y+=r,t.bounds.translate(n,r),t.mark.bounds.translate(n,r),e.dirty(t)}function E_(e){gs.call(this,null,e)}function O_(e,t){let n=0;if(void 0===t)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function D_(e){gs.call(this,null,e)}function S_(e){gs.call(this,null,e)}function C_(){return Pa({})}function F_(e){gs.call(this,null,e)}function j_(e){gs.call(this,[],e)}ft(E_,gs,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach((t=>{e.layout&&function(e,t,n){var r,i,o,a,s,u,l,c=function(e){var t,n,r=e.items,i=r.length,o=0;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;o{(o=e.orient||_x)!==Lx&&(t[o]||(t[o]=[])).push(e)}));for(const r in t){const i=t[r];m_(e,i,__(i,r,n.legends,d,h,l,c))}p.forEach((t=>{const r=t.bounds;if(r.equals(t._bounds)||(t.bounds=t._bounds,e.dirty(t),t.bounds=r,e.dirty(t)),!n.autosize||"fit"!==n.autosize.type&&n.autosize.type!==Rx&&n.autosize.type!==Px)f.union(r);else switch(t.orient){case xx:case _x:f.add(r.x1,0).add(r.x2,0);break;case bx:case wx:f.add(0,r.y1).add(0,r.y2)}}))}f.union(d).union(h),r&&f.union(function(e,t,n,r,i){var o,a=t.items[0],s=a.frame,u=a.orient,l=a.anchor,c=a.offset,f=a.padding,d=a.items[0].items[0],h=a.items[1]&&a.items[1].items[0],p=u===xx||u===_x?r:n,g=0,m=0,y=0,v=0,b=0;if(s!==Sx?u===xx?(g=i.y2,p=i.y1):u===_x?(g=i.y1,p=i.y2):(g=i.x1,p=i.x2):u===xx&&(g=r,p=0),o=l===kx?g:l===Ex?p:(g+p)/2,h&&h.text){switch(u){case bx:case wx:b=d.bounds.height()+f;break;case xx:v=d.bounds.width()+f;break;case _x:v=-d.bounds.width()-f}o_.clear().union(h.bounds),o_.translate(v-(h.x||0),b-(h.y||0)),a_(h,"x",v)|a_(h,"y",b)&&(e.dirty(h),h.bounds.clear().union(o_),h.mark.bounds.clear().union(o_),e.dirty(h)),o_.clear().union(h.bounds)}else o_.clear();switch(o_.union(d.bounds),u){case bx:m=o,y=i.y1-o_.height()-c;break;case xx:m=i.x1-o_.width()-c,y=o;break;case _x:m=i.x2+o_.width()+c,y=o;break;case wx:m=o,y=i.y2+c;break;default:m=a.x,y=a.y}return a_(a,"x",m)|a_(a,"y",y)&&(o_.translate(m,y),e.dirty(a),a.bounds.clear().union(o_),t.bounds.clear().union(o_),e.dirty(a)),a.bounds}(e,r,l,c,f)),t.clip&&f.set(0,0,t.width||0,t.height||0),function(e,t,n,r){const i=r.autosize||{},o=i.type;if(e._autosize<1||!o)return;let a=e._width,s=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if("padding"===i.contains){const t=e.padding();a-=t.left+t.right,s-=t.top+t.bottom}o===Lx?(l=0,f=0,u=a,c=s):"fit"===o?(u=Math.max(0,a-l-d),c=Math.max(0,s-f-h)):o===Rx?(u=Math.max(0,a-l-d),s=c+f+h):o===Px?(a=u+l+d,c=Math.max(0,s-f-h)):"pad"===o&&(a=u+l+d,s=c+f+h),e._resizeView(a,s,u,c,[l,f],i.resize)}(e,t,f,n)}(n,t,e)})),function(e){return e&&"legend-entry"!==e.mark.role}(e.mark.group)?t.reflow():t}}),ft(D_,gs,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,o=e.scale,a=mg(o,null==e.count?e.values?e.values.length:10:e.count,e.minstep),s=e.format||bg(n,o,a,e.formatSpecifier,e.formatType,!!e.values),u=e.values?yg(o,e.values,a):vg(o,a);return i&&(r.rem=i),i=u.map(((e,t)=>Pa({index:t/(u.length-1||1),value:e,label:s(e)}))),e.extra&&i.length&&i.push(Pa({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}}),ft(S_,gs,{transform(e,t){var n=t.dataflow,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||C_,o=e.key||za,a=this.value;return _e(r.encode)&&(r.encode=null),a&&(e.modified("key")||t.modified(o))&&oe("DataJoin does not support modified key function or fields."),a||(t=t.addAll(),this.value=a=function(e){const t=lt().test((e=>e.exit));return t.lookup=n=>t.get(e(n)),t}(o)),t.visit(t.ADD,(e=>{const t=o(e);let n=a.get(t);n?n.exit?(a.empty--,r.add.push(n)):r.mod.push(n):(n=i(e),a.set(t,n),r.add.push(n)),n.datum=e,n.exit=!1})),t.visit(t.MOD,(e=>{const t=o(e),n=a.get(t);n&&(n.datum=e,r.mod.push(n))})),t.visit(t.REM,(e=>{const t=o(e),n=a.get(t);e!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++a.empty)})),t.changed(t.ADD_MOD)&&r.modifies("datum"),(t.clean()||e.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),r}}),ft(F_,gs,{transform(e,t){var n=t.fork(t.ADD_REM),r=e.mod||!1,i=e.encoders,o=t.encode;if(_e(o)){if(!n.changed()&&!o.every((e=>i[e])))return t.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,s=i.update||he,u=i.enter||he,l=i.exit||he,c=(o&&!a?i[o]:s)||he;if(t.changed(t.ADD)&&(t.visit(t.ADD,(t=>{u(t,e),s(t,e)})),n.modifies(u.output),n.modifies(s.output),c!==he&&c!==s&&(t.visit(t.ADD,(t=>{c(t,e)})),n.modifies(c.output))),t.changed(t.REM)&&l!==he&&(t.visit(t.REM,(t=>{l(t,e)})),n.modifies(l.output)),a||c!==he){const i=t.MOD|(e.modified()?t.REFLOW:0);a?(t.visit(i,(t=>{const i=u(t,e)||r;(c(t,e)||i)&&n.mod.push(t)})),n.mod.length&&n.modifies(u.output)):t.visit(i,(t=>{(c(t,e)||r)&&n.mod.push(t)})),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}}),ft(j_,gs,{transform(e,t){if(null!=this.value&&!e.modified())return t.StopPropagation;var n,r,i,o,a,s=t.dataflow.locale(),u=t.fork(t.NO_SOURCE|t.NO_FIELDS),l=this.value,c=e.type||fg,f=e.scale,d=+e.limit,h=mg(f,null==e.count?5:e.count,e.minstep),p=!!e.values||c===fg,g=e.format||Eg(s,f,h,c,e.formatSpecifier,e.formatType,p),m=e.values||kg(f,h);return l&&(u.rem=l),c===fg?(d&&m.length>d?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),l=m.slice(0,d-1),a=!0):l=m,Ye(i=e.size)?(e.values||0!==f(l[0])||(l=l.slice(1)),o=l.reduce(((t,n)=>Math.max(t,i(n,e))),0)):i=tt(o=i||8),l=l.map(((t,n)=>Pa({index:n,label:g(t,n,l),value:t,offset:o,size:i(t,e)}))),a&&(a=m[l.length],l.push(Pa({index:l.length,label:`…${m.length-l.length} entries`,value:a,offset:o,size:i(a,e)})))):"gradient"===c?(n=f.domain(),r=og(f,n[0],De(n)),m.length<3&&!e.values&&n[0]!==De(n)&&(m=[n[0],De(n)]),l=m.map(((e,t)=>Pa({index:t,label:g(e,t,m),value:e,perc:r(e)})))):(i=m.length-1,r=function(e){const t=e.domain(),n=t.length-1;let r=+t[0],i=+De(t),o=i-r;if(e.type===Cp){const e=n?o/n:.1;r-=e,i+=e,o=i-r}return e=>(e-r)/o}(f),l=m.map(((e,t)=>Pa({index:t,label:g(e,t,m),value:e,perc:t?r(e):0,perc2:t===i?1:r(m[t+1])})))),u.source=l,u.add=l,this.value=l,u}});const M_=e=>e.source.x,$_=e=>e.source.y,N_=e=>e.target.x,B_=e=>e.target.y;function T_(e){gs.call(this,{},e)}T_.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},ft(T_,gs,{transform(e,t){var n=e.sourceX||M_,r=e.sourceY||$_,i=e.targetX||N_,o=e.targetY||B_,a=e.as||"path",s=e.orient||"vertical",u=e.shape||"line",l=L_.get(u+"-"+s)||L_.get(u);return l||oe("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,(e=>{e[a]=l(n(e),r(e),i(e),o(e))})),t.reflow(e.modified()).modifies(a)}});const z_=(e,t,n,r)=>"M"+e+","+t+"L"+n+","+r,R_=(e,t,n,r)=>{var i=n-e,o=r-t,a=Math.sqrt(i*i+o*o)/2;return"M"+e+","+t+"A"+a+","+a+" "+180*Math.atan2(o,i)/Math.PI+" 0 1 "+n+","+r},P_=(e,t,n,r)=>{const i=n-e,o=r-t,a=.2*(i+o),s=.2*(o-i);return"M"+e+","+t+"C"+(e+a)+","+(t+s)+" "+(n+s)+","+(r-a)+" "+n+","+r},L_=lt({line:z_,"line-radial":(e,t,n,r)=>z_(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),arc:R_,"arc-radial":(e,t,n,r)=>R_(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),curve:P_,"curve-radial":(e,t,n,r)=>P_(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),"orthogonal-horizontal":(e,t,n,r)=>"M"+e+","+t+"V"+r+"H"+n,"orthogonal-vertical":(e,t,n,r)=>"M"+e+","+t+"H"+n+"V"+r,"orthogonal-radial":(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n);return"M"+t*i+","+t*o+"A"+t+","+t+" 0 0,"+((Math.abs(n-e)>Math.PI?n<=e:n>e)?1:0)+" "+t*a+","+t*s+"L"+r*a+","+r*s},"diagonal-horizontal":(e,t,n,r)=>{const i=(e+n)/2;return"M"+e+","+t+"C"+i+","+t+" "+i+","+r+" "+n+","+r},"diagonal-vertical":(e,t,n,r)=>{const i=(t+r)/2;return"M"+e+","+t+"C"+e+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n),u=(t+r)/2;return"M"+t*i+","+t*o+"C"+u*i+","+u*o+" "+u*a+","+u*s+" "+r*a+","+r*s}});function I_(e){gs.call(this,null,e)}I_.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},ft(I_,gs,{transform(e,t){var n,r,i,o=e.as||["startAngle","endAngle"],a=o[0],s=o[1],u=e.field||fe,l=e.startAngle||0,c=null!=e.endAngle?e.endAngle:2*Math.PI,f=t.source,d=f.map(u),h=d.length,p=l,g=(c-l)/O_(d),m=Au(h);for(e.sort&&m.sort(((e,t)=>d[e]-d[t])),n=0;ne+(t<0?-1:t>0?1:0)),0))!==t.length&&n.warn("Log scale domain includes zero: "+Dt(t)));return t}function G_(e,t,n){return Ye(e)&&(t||n)?ng(e,V_(t||[0,1],n)):e}function V_(e,t){return t?e.slice().reverse():e}function Y_(e){gs.call(this,null,e)}ft(W_,gs,{transform(e,t){var n=t.dataflow,r=this.value,i=function(e){var t,n=e.type,r="";return n===Ep?Ep+"-"+vp:(function(e){const t=e.type;return Xp(t)&&t!==kp&&t!==Ap&&(e.scheme||e.range&&e.range.length&&e.range.every(vt))}(e)&&(r=2===(t=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(null!=e.domainMid):0)?Ep+"-":3===t?Op+"-":""),(r+n||vp).toLowerCase())}(e);for(i in r&&i===r.type||(this.value=r=Gp(i)()),e)if(!q_[i]){if("padding"===i&&U_(r.type))continue;Ye(r[i])?r[i](e[i]):n.warn("Unsupported scale property: "+i)}return function(e,t,n){var r=e.type,i=t.round||!1,o=t.range;if(null!=t.rangeStep)o=function(e,t,n){e!==Mp&&e!==jp&&oe("Only band and point scales support rangeStep.");var r=(null!=t.paddingOuter?t.paddingOuter:t.padding)||0,i=e===jp?1:(null!=t.paddingInner?t.paddingInner:t.padding)||0;return[0,t.rangeStep*yp(n,i,r)]}(r,t,n);else if(t.scheme&&(o=function(e,t,n){var r,i=t.schemeExtent;return _e(t.scheme)?r=rg(t.scheme,t.interpolate,t.interpolateGamma):(r=cg(t.scheme.toLowerCase()))||oe(`Unrecognized scheme name: ${t.scheme}`),n=e===Cp?n+1:e===$p?n-1:e===Dp||e===Sp?+t.schemeCount||5:n,Qp(e)?G_(r,i,t.reverse):Ye(r)?ig(G_(r,i),n):e===Fp?r:r.slice(0,n)}(r,t,n),Ye(o))){if(e.interpolator)return e.interpolator(o);oe(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&Qp(r))return e.interpolator(rg(V_(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(ag(t.interpolate,t.interpolateGamma)):Ye(e.round)?e.round(i):Ye(e.rangeRound)&&e.interpolate(i?_d:xd),o&&e.range(V_(o,t.reverse))}(r,e,function(e,t,n){let r=t.bins;if(r&&!_e(r)){const t=e.domain(),n=t[0],i=De(t),o=r.step;let a=null==r.start?n:r.start,s=null==r.stop?i:r.stop;o||oe("Scale bins parameter missing step property."),ai&&(s=o*Math.floor(i/o)),r=Au(a,s+o/2,o)}return r?e.bins=r:e.bins&&delete e.bins,e.type===$p&&(r?t.domain||t.domainRaw||(e.domain(r),n=r.length):e.bins=e.domain()),n}(r,e,function(e,t,n){const r=function(e,t,n){return t?(e.domain(H_(e.type,t,n)),t.length):-1}(e,t.domainRaw,n);if(r>-1)return r;var i,o,a=t.domain,s=e.type,u=t.zero||void 0===t.zero&&function(e){const t=e.type;return!e.bins&&(t===vp||t===xp||t===_p)}(e);if(!a)return 0;if(U_(s)&&t.padding&&a[0]!==De(a)&&(a=function(e,t,n,r,i,o){var a=Math.abs(De(n)-n[0]),s=a/(a-2*r),u=e===bp?Ie(t,null,s):e===_p?Ue(t,null,s,.5):e===xp?Ue(t,null,s,i||1):e===wp?qe(t,null,s,o||1):Le(t,null,s);return(t=t.slice())[0]=u[0],t[t.length-1]=u[1],t}(s,a,t.range,t.padding,t.exponent,t.constant)),(u||null!=t.domainMin||null!=t.domainMax||null!=t.domainMid)&&(i=(a=a.slice()).length-1||1,u&&(a[0]>0&&(a[0]=0),a[i]<0&&(a[i]=0)),null!=t.domainMin&&(a[0]=t.domainMin),null!=t.domainMax&&(a[i]=t.domainMax),null!=t.domainMid)){const e=(o=t.domainMid)>a[i]?i+1:oe(u);if(null==t)h.push(e.slice());else for(i={},o=0,a=e.length;od&&(d=f),n&&c.sort(n)}return h.max=d,h}(t.source,e.groupby,l,c),r=0,i=n.length,o=n.max;re;function iw(e,t){e&&aw.hasOwnProperty(e.type)&&aw[e.type](e,t)}var ow={Feature:function(e,t){iw(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r0){for(o=e[--i];i>0&&(t=o,n=e[--i],o=t+n,r=n-(o-t),!r););i>0&&(r<0&&e[i-1]<0||r>0&&e[i-1]>0)&&(n=2*r,t=o+n,n==t-o&&(o=t))}return o}}var fw=1e-6,dw=1e-12,hw=Math.PI,pw=hw/2,gw=hw/4,mw=2*hw,yw=180/hw,vw=hw/180,bw=Math.abs,xw=Math.atan,_w=Math.atan2,ww=Math.cos,kw=Math.ceil,Aw=Math.exp,Ew=(Math.floor,Math.hypot),Ow=Math.log,Dw=Math.pow,Sw=Math.sin,Cw=Math.sign||function(e){return e>0?1:e<0?-1:0},Fw=Math.sqrt,jw=Math.tan;function Mw(e){return e>1?0:e<-1?hw:Math.acos(e)}function $w(e){return e>1?pw:e<-1?-pw:Math.asin(e)}function Nw(){}var Bw,Tw,zw,Rw,Pw=new cw,Lw=new cw,Iw={point:Nw,lineStart:Nw,lineEnd:Nw,polygonStart:function(){Iw.lineStart=Uw,Iw.lineEnd=Hw},polygonEnd:function(){Iw.lineStart=Iw.lineEnd=Iw.point=Nw,Pw.add(bw(Lw)),Lw=new cw},result:function(){var e=Pw/2;return Pw=new cw,e}};function Uw(){Iw.point=qw}function qw(e,t){Iw.point=Ww,Bw=zw=e,Tw=Rw=t}function Ww(e,t){Lw.add(Rw*e-zw*t),zw=e,Rw=t}function Hw(){Ww(Bw,Tw)}const Gw=Iw;var Vw=1/0,Yw=Vw,Xw=-Vw,Zw=Xw,Jw={point:function(e,t){eXw&&(Xw=e),tZw&&(Zw=t)},lineStart:Nw,lineEnd:Nw,polygonStart:Nw,polygonEnd:Nw,result:function(){var e=[[Vw,Yw],[Xw,Zw]];return Xw=Zw=-(Yw=Vw=1/0),e}};const Kw=Jw;var Qw,ek,tk,nk,rk=0,ik=0,ok=0,ak=0,sk=0,uk=0,lk=0,ck=0,fk=0,dk={point:hk,lineStart:pk,lineEnd:yk,polygonStart:function(){dk.lineStart=vk,dk.lineEnd=bk},polygonEnd:function(){dk.point=hk,dk.lineStart=pk,dk.lineEnd=yk},result:function(){var e=fk?[lk/fk,ck/fk]:uk?[ak/uk,sk/uk]:ok?[rk/ok,ik/ok]:[NaN,NaN];return rk=ik=ok=ak=sk=uk=lk=ck=fk=0,e}};function hk(e,t){rk+=e,ik+=t,++ok}function pk(){dk.point=gk}function gk(e,t){dk.point=mk,hk(tk=e,nk=t)}function mk(e,t){var n=e-tk,r=t-nk,i=Fw(n*n+r*r);ak+=i*(tk+e)/2,sk+=i*(nk+t)/2,uk+=i,hk(tk=e,nk=t)}function yk(){dk.point=hk}function vk(){dk.point=xk}function bk(){_k(Qw,ek)}function xk(e,t){dk.point=_k,hk(Qw=tk=e,ek=nk=t)}function _k(e,t){var n=e-tk,r=t-nk,i=Fw(n*n+r*r);ak+=i*(tk+e)/2,sk+=i*(nk+t)/2,uk+=i,lk+=(i=nk*e-tk*t)*(tk+e),ck+=i*(nk+t),fk+=3*i,hk(tk=e,nk=t)}const wk=dk;function kk(e){this._context=e}kk.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,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(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,mw)}},result:Nw};var Ak,Ek,Ok,Dk,Sk,Ck=new cw,Fk={point:Nw,lineStart:function(){Fk.point=jk},lineEnd:function(){Ak&&Mk(Ek,Ok),Fk.point=Nw},polygonStart:function(){Ak=!0},polygonEnd:function(){Ak=null},result:function(){var e=+Ck;return Ck=new cw,e}};function jk(e,t){Fk.point=Mk,Ek=Dk=e,Ok=Sk=t}function Mk(e,t){Dk-=e,Sk-=t,Ck.add(Fw(Dk*Dk+Sk*Sk)),Dk=e,Sk=t}const $k=Fk;let Nk,Bk,Tk,zk;class Rk{constructor(e){this._append=null==e?Pk:function(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Pk;if(t!==Nk){const e=10**t;Nk=t,Bk=function(t){let n=1;this._+=t[0];for(const r=t.length;n=0))throw new RangeError(`invalid digits: ${e}`);i=t}return null===t&&(r=new Rk(i)),a},a.projection(e).digits(i).context(t)}function Ik(){var e,t=[];return{point:function(t,n,r){e.push([t,n,r])},lineStart:function(){t.push(e=[])},lineEnd:Nw,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function Uk(e,t){return bw(e[0]-t[0])=0;--o)i.point((c=l[o])[0],c[1]);else r(d.x,d.p.x,-1,i);d=d.p}l=(d=d.o).z,h=!h}while(!d.v);i.lineEnd()}}}function Hk(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r=0?1:-1,O=E*A,D=O>hw,S=m*w;if(u.add(_w(S*E*Sw(O),y*k+S*ww(O))),a+=D?A+E*mw:A,D^p>=n^x>=n){var C=Xk(Vk(h),Vk(b));Kk(C);var F=Xk(o,C);Kk(F);var j=(D^A>=0?-1:1)*$w(F[2]);(r>j||r===j&&(C[0]||C[1]))&&(s+=D^A>=0?1:-1)}}return(a<-fw||a0){for(f||(i.polygonStart(),f=!0),i.lineStart(),e=0;e1&&2&u&&d.push(d.pop().concat(d.shift())),a.push(d.filter(nA))}return d}}function nA(e){return e.length>1}function rA(e,t){return((e=e.x)[0]<0?e[1]-pw-fw:pw-e[1])-((t=t.x)[0]<0?t[1]-pw-fw:pw-t[1])}const iA=tA((function(){return!0}),(function(e){var t,n=NaN,r=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,a){var s=o>0?hw:-hw,u=bw(o-n);bw(u-hw)0?pw:-pw),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(o,r),t=0):i!==s&&u>=hw&&(bw(n-i)fw?xw((Sw(t)*(o=ww(r))*Sw(n)-Sw(r)*(i=ww(t))*Sw(e))/(i*o*a)):(t+r)/2}(n,r,o,a),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),t=0),e.point(n=o,r=a),i=s},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}}),(function(e,t,n,r){var i;if(null==e)i=n*pw,r.point(-hw,i),r.point(0,i),r.point(hw,i),r.point(hw,0),r.point(hw,-i),r.point(0,-i),r.point(-hw,-i),r.point(-hw,0),r.point(-hw,i);else if(bw(e[0]-t[0])>fw){var o=e[0]0)do{l.point(0===c||3===c?e:n,c>1?r:t)}while((c=(c+s+4)%4)!==f);else l.point(o[0],o[1])}function a(r,i){return bw(r[0]-e)0?0:3:bw(r[0]-n)0?2:1:bw(r[1]-t)0?1:0:i>0?3:2}function s(e,t){return u(e.x,t.x)}function u(e,t){var n=a(e,1),r=a(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(a){var u,l,c,f,d,h,p,g,m,y,v,b=a,x=Ik(),_={point:w,lineStart:function(){_.point=k,l&&l.push(c=[]),y=!0,m=!1,p=g=NaN},lineEnd:function(){u&&(k(f,d),h&&m&&x.rejoin(),u.push(x.result())),_.point=w,m&&b.lineEnd()},polygonStart:function(){b=x,u=[],l=[],v=!0},polygonEnd:function(){var t=function(){for(var t=0,n=0,i=l.length;nr&&(d-o)*(r-a)>(h-a)*(e-o)&&++t:h<=r&&(d-o)*(r-a)<(h-a)*(e-o)&&--t;return t}(),n=v&&t,i=(u=eA(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Wk(u,s,t,o,a),a.polygonEnd()),b=a,u=l=c=null}};function w(e,t){i(e,t)&&b.point(e,t)}function k(o,a){var s=i(o,a);if(l&&c.push([o,a]),y)f=o,d=a,h=s,y=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&m)b.point(o,a);else{var u=[p=Math.max(sA,Math.min(aA,p)),g=Math.max(sA,Math.min(aA,g))],x=[o=Math.max(sA,Math.min(aA,o)),a=Math.max(sA,Math.min(aA,a))];!function(e,t,n,r,i,o){var a,s=e[0],u=e[1],l=0,c=1,f=t[0]-s,d=t[1]-u;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>c)return;a>l&&(l=a)}else if(f>0){if(a0)){if(a/=d,d<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=o-u,d||!(a<0)){if(a/=d,d<0){if(a>c)return;a>l&&(l=a)}else if(d>0){if(a0&&(e[0]=s+l*f,e[1]=u+l*d),c<1&&(t[0]=s+c*f,t[1]=u+c*d),!0}}}}}(u,x,e,t,n,r)?s&&(b.lineStart(),b.point(o,a),v=!1):(m||(b.lineStart(),b.point(u[0],u[1])),b.point(x[0],x[1]),s||b.lineEnd(),v=!1)}p=o,g=a,m=s}return _}}function lA(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return(n=t.invert(n,r))&&e.invert(n[0],n[1])}),n}function cA(e,t){return bw(e)>hw&&(e-=Math.round(e/mw)*mw),[e,t]}function fA(e,t,n){return(e%=mw)?t||n?lA(hA(e),pA(t,n)):hA(e):t||n?pA(t,n):cA}function dA(e){return function(t,n){return bw(t+=e)>hw&&(t-=Math.round(t/mw)*mw),[t,n]}}function hA(e){var t=dA(e);return t.invert=dA(-e),t}function pA(e,t){var n=ww(e),r=Sw(e),i=ww(t),o=Sw(t);function a(e,t){var a=ww(t),s=ww(e)*a,u=Sw(e)*a,l=Sw(t),c=l*n+s*r;return[_w(u*i-c*o,s*n-l*r),$w(c*i+u*o)]}return a.invert=function(e,t){var a=ww(t),s=ww(e)*a,u=Sw(e)*a,l=Sw(t),c=l*i-u*o;return[_w(u*i+l*o,s*n+c*r),$w(c*n-s*r)]},a}function gA(e){return function(t){var n=new mA;for(var r in e)n[r]=e[r];return n.stream=t,n}}function mA(){}function yA(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),lw(n,e.stream(Kw)),t(Kw.result()),null!=r&&e.clipExtent(r),e}function vA(e,t,n){return yA(e,(function(n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+t[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+t[0][1]+(i-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([a,s])}),n)}function bA(e,t,n){return vA(e,[[0,0],t],n)}function xA(e,t,n){return yA(e,(function(n){var r=+t,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];e.scale(150*i).translate([o,a])}),n)}function _A(e,t,n){return yA(e,(function(n){var r=+t,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;e.scale(150*i).translate([o,a])}),n)}cA.invert=cA,mA.prototype={constructor:mA,point:function(e,t){this.stream.point(e,t)},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 wA=16,kA=ww(30*vw);function AA(e,t){return+t?function(e,t){function n(r,i,o,a,s,u,l,c,f,d,h,p,g,m){var y=l-r,v=c-i,b=y*y+v*v;if(b>4*t&&g--){var x=a+d,_=s+h,w=u+p,k=Fw(x*x+_*_+w*w),A=$w(w/=k),E=bw(bw(w)-1)t||bw((y*C+v*F)/b-.5)>.3||a*d+s*h+u*p0,i=bw(t)>fw;function o(e,n){return ww(e)*ww(n)>t}function a(e,n,r){var i=[1,0,0],o=Xk(Vk(e),Vk(n)),a=Yk(o,o),s=o[0],u=a-s*s;if(!u)return!r&&e;var l=t*a/u,c=-t*s/u,f=Xk(i,o),d=Jk(i,l);Zk(d,Jk(o,c));var h=f,p=Yk(d,h),g=Yk(h,h),m=p*p-g*(Yk(d,d)-1);if(!(m<0)){var y=Fw(m),v=Jk(h,(-p-y)/g);if(Zk(v,d),v=Gk(v),!r)return v;var b,x=e[0],_=n[0],w=e[1],k=n[1];_0^v[1]<(bw(v[0]-x)hw^(x<=v[0]&&v[0]<=_)){var O=Jk(h,(-p+y)/g);return Zk(O,d),[v,Gk(O)]}}}function s(t,n){var i=r?e:hw-e,o=0;return t<-i?o|=1:t>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return tA(o,(function(e){var t,n,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(f,d){var h,p=[f,d],g=o(f,d),m=r?g?0:s(f,d):g?s(f+(f<0?hw:-hw),d):0;if(!t&&(l=u=g)&&e.lineStart(),g!==u&&(!(h=a(t,p))||Uk(t,h)||Uk(p,h))&&(p[2]=1),g!==u)c=0,g?(e.lineStart(),h=a(p,t),e.point(h[0],h[1])):(h=a(t,p),e.point(h[0],h[1],2),e.lineEnd()),t=h;else if(i&&t&&r^g){var y;m&n||!(y=a(p,t,!0))||(c=0,r?(e.lineStart(),e.point(y[0][0],y[0][1]),e.point(y[1][0],y[1][1]),e.lineEnd()):(e.point(y[1][0],y[1][1]),e.lineEnd(),e.lineStart(),e.point(y[0][0],y[0][1],3)))}!g||t&&Uk(t,p)||e.point(p[0],p[1]),t=p,u=g,n=m},lineEnd:function(){u&&e.lineEnd(),t=null},clean:function(){return c|(l&&u)<<1}}}),(function(t,r,i,o){!function(e,t,n,r,i,o){if(n){var a=ww(t),s=Sw(t),u=r*n;null==i?(i=t+r*mw,o=t-u/2):(i=oA(a,i),o=oA(a,o),(r>0?io)&&(i+=r*mw));for(var l,c=i;r>0?c>o:c2?e[2]%360*vw:0,C()):[m*yw,y*yw,v*yw]},D.angle=function(e){return arguments.length?(b=e%360*vw,C()):b*yw},D.reflectX=function(e){return arguments.length?(x=e?-1:1,C()):x<0},D.reflectY=function(e){return arguments.length?(_=e?-1:1,C()):_<0},D.precision=function(e){return arguments.length?(a=AA(s,O=e*e),F()):Fw(O)},D.fitExtent=function(e,t){return vA(D,e,t)},D.fitSize=function(e,t){return bA(D,e,t)},D.fitWidth=function(e,t){return xA(D,e,t)},D.fitHeight=function(e,t){return _A(D,e,t)},function(){return t=e.apply(this,arguments),D.invert=t.invert&&S,C()}}function CA(e){var t=0,n=hw/3,r=SA(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*vw,n=e[1]*vw):[t*yw,n*yw]},i}function FA(e,t){var n=Sw(e),r=(n+Sw(t))/2;if(bw(r)2?e[2]*vw:0),t.invert=function(t){return(t=e.invert(t[0]*vw,t[1]*vw))[0]*=yw,t[1]*=yw,t},t}(i.rotate()).invert([0,0]));return u(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:e===zA?[[Math.max(s[0]-o,l),t],[Math.min(s[0]+o,n),r]]:[[l,Math.max(s[1]-o,t)],[n,Math.min(s[1]+o,r)]])}return i.scale=function(e){return arguments.length?(a(e),c()):a()},i.translate=function(e){return arguments.length?(s(e),c()):s()},i.center=function(e){return arguments.length?(o(e),c()):o()},i.clipExtent=function(e){return arguments.length?(null==e?l=t=n=r=null:(l=+e[0][0],t=+e[0][1],n=+e[1][0],r=+e[1][1]),c()):null==l?null:[[l,t],[n,r]]},c()}function PA(e){return jw((pw+e)/2)}function LA(e,t){var n=ww(e),r=e===t?Sw(e):Ow(n/ww(t))/Ow(PA(t)/PA(e)),i=n*Dw(PA(e),r)/r;if(!r)return zA;function o(e,t){i>0?t<-pw+fw&&(t=-pw+fw):t>pw-fw&&(t=pw-fw);var n=i/Dw(PA(t),r);return[n*Sw(r*e),i-n*ww(r*e)]}return o.invert=function(e,t){var n=i-t,o=Cw(r)*Fw(e*e+n*n),a=_w(e,bw(n))*Cw(n);return n*r<0&&(a-=hw*Cw(e)*Cw(n)),[a/r,2*xw(Dw(i/o,1/r))-pw]},o}function IA(e,t){return[e,t]}function UA(e,t){var n=ww(e),r=e===t?Sw(e):(n-ww(t))/(t-e),i=n/r+e;if(bw(r)fw&&--i>0);return[e/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},JA.invert=NA($w),KA.invert=NA((function(e){return 2*xw(e)})),QA.invert=function(e,t){return[-t,2*xw(Aw(e))-pw]};var eE=Math.abs,tE=(Math.atan,Math.atan2,Math.ceil,Math.cos),nE=(Math.exp,Math.floor,Math.log,Math.max,Math.min,Math.pow,Math.round,Math.sign,Math.sin),rE=(Math.tan,1e-6),iE=Math.PI,oE=iE/2,aE=(Math.SQRT1_2,uE(2));function sE(e){return e>1?oE:e<-1?-oE:Math.asin(e)}function uE(e){return e>0?Math.sqrt(e):0}function lE(e,t){var n,r=e*nE(t),i=30;do{t-=n=(t+nE(t)-r)/(1+tE(t))}while(eE(n)>rE&&--i>0);return t/2}uE(iE);var cE=function(e,t,n){function r(r,i){return[e*r*tE(i=lE(n,i)),t*nE(i)]}return r.invert=function(r,i){return i=sE(i/t),[r/(e*tE(i)),sE((2*i+nE(2*i))/n)]},r}(aE/oE,aE,iE);const fE=Lk(),dE=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function hE(e,t){if(!e||"string"!=typeof e)throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(gE[e]=function(e,t){return function n(){const r=t();return r.type=e,r.path=Lk().projection(r),r.copy=r.copy||function(){const e=n();return dE.forEach((t=>{r[t]&&e[t](r[t]())})),e.path.pointRadius(r.path.pointRadius()),e},Hp(r)}}(e,t),this):gE[e]||null}function pE(e){return e&&e.path||fE}const gE={albers:MA,albersusa:function(){var e,t,n,r,i,o,a=MA(),s=jA().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=jA().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(e,t){o=[e,t]}};function c(e){var t=e[0],a=e[1];return o=null,n.point(t,a),o||(r.point(t,a),o)||(i.point(t,a),o)}function f(){return e=t=null,c}return c.invert=function(e){var t=a.scale(),n=a.translate(),r=(e[0]-n[0])/t,i=(e[1]-n[1])/t;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:a).invert(e)},c.stream=function(n){return e&&t===n?e:(r=[a.stream(t=n),s.stream(n),u.stream(n)],i=r.length,e={point:function(e,t){for(var n=-1;++n2?e[2]+90:90]):[(e=n())[0],e[1],e[2]-90]},n([0,0,90]).scale(159.155)}};for(const e in gE)hE(e,gE[e]);function mE(e,t,n){var r=Au(e,t-fw,n).concat(t);return function(e){return r.map((function(t){return[e,t]}))}}function yE(e,t,n){var r=Au(e,t-fw,n).concat(t);return function(e){return r.map((function(t){return[t,e]}))}}function vE(){}const bE=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function xE(){var e=1,t=1,n=a;function r(e,t){return t.map((t=>i(e,t)))}function i(r,i){var a=[],s=[];return function(n,r,i){var a,s,u,l,c,f,d=new Array,h=new Array;for(a=s=-1,l=n[0]>=r,bE[l<<1].forEach(p);++a=r,bE[u|l<<1].forEach(p);for(bE[l<<0].forEach(p);++s=r,c=n[s*e]>=r,bE[l<<1|c<<2].forEach(p);++a=r,f=c,c=n[s*e+a+1]>=r,bE[u|l<<1|c<<2|f<<3].forEach(p);bE[l|c<<3].forEach(p)}for(a=-1,c=n[s*e]>=r,bE[c<<2].forEach(p);++a=r,bE[c<<2|f<<3].forEach(p);function p(e){var t,n,r=[e[0][0]+a,e[0][1]+s],u=[e[1][0]+a,e[1][1]+s],l=o(r),c=o(u);(t=h[l])?(n=d[c])?(delete h[t.end],delete d[n.start],t===n?(t.ring.push(u),i(t.ring)):d[t.start]=h[n.end]={start:t.start,end:n.end,ring:t.ring.concat(n.ring)}):(delete h[t.end],t.ring.push(u),h[t.end=c]=t):(t=d[c])?(n=h[l])?(delete d[t.start],delete h[n.end],t===n?(t.ring.push(u),i(t.ring)):d[n.start]=h[t.end]={start:n.start,end:t.end,ring:n.ring.concat(t.ring)}):(delete d[t.start],t.ring.unshift(r),d[t.start=l]=t):d[l]=h[c]={start:l,end:c,ring:[r,u]}}bE[c<<3].forEach(p)}(r,i,(e=>{n(e,r,i),function(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t0?a.push([e]):s.push(e)})),s.forEach((e=>{for(var t,n=0,r=a.length;n{var o,a=n[0],s=n[1],u=0|a,l=0|s,c=r[l*e+u];a>0&&a0&&s=0&&o>=0||oe("invalid size"),e=i,t=o,r},r.smooth=function(e){return arguments.length?(n=e?a:vE,r):n===a},r}function _E(e,t){for(var n,r=-1,i=t.length;++rr!=h>r&&n<(d-l)*(r-c)/(h-c)+l&&(i=-i)}return i}function kE(e,t,n){var r,i,o,a;return function(e,t,n){return(t[0]-e[0])*(n[1]-e[1])==(n[0]-e[0])*(t[1]-e[1])}(e,t,n)&&(i=e[r=+(e[0]===t[0])],o=n[r],a=t[r],i<=o&&o<=a||a<=o&&o<=i)}function AE(e,t,n){return function(r){var i=it(r),o=n?Math.min(i[0],0):i[0],a=i[1],s=a-o,u=t?rn(o,a,e):s/(e+1);return Au(o+u,a,u)}}function EE(e){gs.call(this,null,e)}function OE(e,t,n,r,i){const o=e.x1||0,a=e.y1||0,s=t*n<0;function u(e){e.forEach(l)}function l(e){s&&e.reverse(),e.forEach(c)}function c(e){e[0]=(e[0]-o)*t+r,e[1]=(e[1]-a)*n+i}return function(e){return e.coordinates.forEach(u),e}}function DE(e,t,n){const r=e>=0?e:js(t,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function SE(e){return Ye(e)?e:tt(+e)}function CE(){var e=e=>e[0],t=e=>e[1],n=fe,r=[-1,-1],i=960,o=500,a=2;function s(s,u){const l=DE(r[0],s,e)>>a,c=DE(r[1],s,t)>>a,f=l?l+2:0,d=c?c+2:0,h=2*f+(i>>a),p=2*d+(o>>a),g=new Float32Array(h*p),m=new Float32Array(h*p);let y=g;s.forEach((r=>{const i=f+(+e(r)>>a),o=d+(+t(r)>>a);i>=0&&i=0&&o0&&c>0?(FE(h,p,g,m,l),jE(h,p,m,g,c),FE(h,p,g,m,l),jE(h,p,m,g,c),FE(h,p,g,m,l),jE(h,p,m,g,c)):l>0?(FE(h,p,g,m,l),FE(h,p,m,g,l),FE(h,p,g,m,l),y=m):c>0&&(jE(h,p,g,m,c),jE(h,p,m,g,c),jE(h,p,g,m,c),y=m);const v=u?Math.pow(2,-2*a):1/O_(y);for(let e=0,t=h*p;e>a),y2:d+(o>>a)}}return s.x=function(t){return arguments.length?(e=SE(t),s):e},s.y=function(e){return arguments.length?(t=SE(e),s):t},s.weight=function(e){return arguments.length?(n=SE(e),s):n},s.size=function(e){if(!arguments.length)return[i,o];var t=+e[0],n=+e[1];return t>=0&&n>=0||oe("invalid size"),i=t,o=n,s},s.cellSize=function(e){return arguments.length?((e=+e)>=1||oe("invalid cell size"),a=Math.floor(Math.log(e)/Math.LN2),s):1<=i&&(t>=o&&(s-=n[t-o+a*e]),r[t-i+a*e]=s/Math.min(t+1,e-1+o-t,o))}function jE(e,t,n,r,i){const o=1+(i<<1);for(let a=0;a=i&&(s>=o&&(u-=n[a+(s-o)*e]),r[a+(s-i)*e]=u/Math.min(s+1,t-1+o-s,o))}function ME(e){gs.call(this,null,e)}EE.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},ft(EE,gs,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=e.field||le,o=xE().smooth(!1!==e.smooth),a=e.thresholds||function(e,t,n){const r=AE(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(e.map((e=>bs(t(e).values))))}(r,i,e),s=null===e.as?null:e.as||"contour",u=[];return r.forEach((t=>{const n=i(t),r=o.size([n.width,n.height])(n.values,_e(a)?a:a(n.values));!function(e,t,n,r){let i=r.scale||t.scale,o=r.translate||t.translate;if(Ye(i)&&(i=i(n,r)),Ye(o)&&(o=o(n,r)),(1===i||null==i)&&!o)return;const a=(mt(i)?i:i[0])||1,s=(mt(i)?i:i[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;e.forEach(OE(t,a,s,u,l))}(r,n,t,e),r.forEach((e=>{u.push(Ia(t,Pa(null!=s?{[s]:e}:e)))}))})),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}}),ME.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const $E=["x","y","weight","size","cellSize","bandwidth"];function NE(e,t){return $E.forEach((n=>null!=t[n]?e[n](t[n]):0)),e}function BE(e){gs.call(this,null,e)}ft(ME,gs,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=function(e,t){var n,r,i,o,a,s,u=[],l=e=>e(o);if(null==t)u.push(e);else for(n={},r=0,i=e.length;rPa(function(e,t){for(let n=0;nfw})).map(u)).concat(Au(kw(o/h)*h,i,h).filter((function(e){return bw(e%g)>fw})).map(l))}return y.lines=function(){return v().map((function(e){return{type:"LineString",coordinates:e}}))},y.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(f(a).slice(1),c(n).reverse().slice(1),f(s).reverse().slice(1))]}},y.extent=function(e){return arguments.length?y.extentMajor(e).extentMinor(e):y.extentMinor()},y.extentMajor=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],s=+e[0][1],a=+e[1][1],r>n&&(e=r,r=n,n=e),s>a&&(e=s,s=a,a=e),y.precision(m)):[[r,s],[n,a]]},y.extentMinor=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],o=+n[0][1],i=+n[1][1],t>e&&(n=t,t=e,e=n),o>i&&(n=o,o=i,i=n),y.precision(m)):[[t,o],[e,i]]},y.step=function(e){return arguments.length?y.stepMajor(e).stepMinor(e):y.stepMinor()},y.stepMajor=function(e){return arguments.length?(p=+e[0],g=+e[1],y):[p,g]},y.stepMinor=function(e){return arguments.length?(d=+e[0],h=+e[1],y):[d,h]},y.precision=function(d){return arguments.length?(m=+d,u=mE(o,i,90),l=yE(t,e,m),c=mE(s,a,90),f=yE(r,n,m),y):m},y.extentMajor([[-180,-90+fw],[180,90-fw]]).extentMinor([[-180,-80-fw],[180,80+fw]])}()}function qE(e){gs.call(this,null,e)}function WE(e){if(!Ye(e))return!1;const t=Mt(te(e));return t.$x||t.$y||t.$value||t.$max}function HE(e){gs.call(this,null,e),this.modified(!0)}function GE(e,t,n){Ye(e[t])&&e[t](n)}function VE(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,o,a,s,u,l,c,f,d,h=e._root,p={data:r},g=e._x0,m=e._y0,y=e._x1,v=e._y1;if(!h)return e._root=p,e;for(;h.length;)if((l=t>=(o=(g+y)/2))?g=o:y=o,(c=n>=(a=(m+v)/2))?m=a:v=a,i=h,!(h=h[f=c<<1|l]))return i[f]=p,e;if(s=+e._x.call(null,h.data),u=+e._y.call(null,h.data),t===s&&n===u)return p.next=h,i?i[f]=p:e._root=p,e;do{i=i?i[f]=new Array(4):e._root=new Array(4),(l=t>=(o=(g+y)/2))?g=o:y=o,(c=n>=(a=(m+v)/2))?m=a:v=a}while((f=c<<1|l)==(d=(u>=a)<<1|s>=o));return i[d]=h,i[f]=p,e}function YE(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function XE(e){return e[0]}function ZE(e){return e[1]}function JE(e,t,n){var r=new KE(null==t?XE:t,null==n?ZE:n,NaN,NaN,NaN,NaN);return null==e?r:r.addAll(e)}function KE(e,t,n,r,i,o){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function QE(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}RE.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},ft(RE,gs,{transform(e,t){var n,r=this._features,i=this._points,o=e.fields,a=o&&o[0],s=o&&o[1],u=e.geojson||!o&&le,l=t.ADD;n=e.modified()||t.changed(t.REM)||t.modified(te(u))||a&&t.modified(te(a))||s&&t.modified(te(s)),this.value&&!n||(l=t.SOURCE,this._features=r=[],this._points=i=[]),u&&t.visit(l,(e=>r.push(u(e)))),a&&s&&(t.visit(l,(e=>{var t=a(e),n=s(e);null!=t&&null!=n&&(t=+t)===t&&(n=+n)===n&&i.push([t,n])})),r=r.concat({type:TE,geometry:{type:"MultiPoint",coordinates:i}})),this.value={type:zE,features:r}}}),PE.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},ft(PE,gs,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.field||le,o=e.as||"path",a=n.SOURCE;!r||e.modified()?(this.value=r=pE(e.projection),n.materialize().reflow()):a=i===le||t.modified(i.fields)?n.ADD_MOD:n.ADD;const s=function(e,t){const n=e.pointRadius();return e.context(null),null!=t&&e.pointRadius(t),n}(r,e.pointRadius);return n.visit(a,(e=>e[o]=r(i(e)))),r.pointRadius(s),n.modifies(o)}}),LE.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},ft(LE,gs,{transform(e,t){var n,r=e.projection,i=e.fields[0],o=e.fields[1],a=e.as||["x","y"],s=a[0],u=a[1];function l(e){const t=r([i(e),o(e)]);t?(e[s]=t[0],e[u]=t[1]):(e[s]=void 0,e[u]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(n=t.modified(i.fields)||t.modified(o.fields),t.visit(n?t.ADD_MOD:t.ADD,l)),t.modifies(a)}}),IE.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},ft(IE,gs,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.as||"shape",o=n.ADD;return r&&!e.modified()||(this.value=r=function(e,t,n){const r=null==n?n=>e(t(n)):r=>{var i=e.pointRadius(),o=e.pointRadius(n)(t(r));return e.pointRadius(i),o};return r.context=t=>(e.context(t),r),r}(pE(e.projection),e.field||se("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,(e=>e[i]=r)),n.modifies(i)}}),UE.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},ft(UE,gs,{transform(e,t){var n,r=this.value,i=this.generator;if(!r.length||e.modified())for(const t in e)Ye(i[t])&&i[t](e[t]);return n=i(),r.length?t.mod.push(Ua(r[0],n)):t.add.push(Pa(n)),r[0]=n,t}}),qE.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},ft(qE,gs,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,r="shared"===e.resolve,i=e.field||le,o=function(e,t){let n;return Ye(e)?(n=n=>e(n,t),n.dep=WE(e)):e?n=tt(e):(n=e=>e.$value/e.$max||0,n.dep=!0),n}(e.opacity,e),a=function(e,t){let n;return Ye(e)?(n=n=>Pf(e(n,t)),n.dep=WE(e)):n=tt(Pf(e||"#888")),n}(e.color,e),s=e.as||"image",u={$x:0,$y:0,$value:0,$max:r?bs(n.map((e=>bs(i(e).values)))):0};return n.forEach((e=>{const t=i(e),n=rt({},e,u);r||(n.$max=bs(t.values||[])),e[s]=function(e,t,n,r){const i=e.width,o=e.height,a=e.x1||0,s=e.y1||0,u=e.x2||i,l=e.y2||o,c=e.values,f=c?e=>c[e]:ce,d=ff(u-a,l-s),h=d.getContext("2d"),p=h.getImageData(0,0,u-a,l-s),g=p.data;for(let e=s,o=0;e{null!=e[t]&&GE(n,t,e[t])}))):dE.forEach((t=>{e.modified(t)&&GE(n,t,e[t])})),null!=e.pointRadius&&n.path.pointRadius(e.pointRadius),e.fit&&function(e,t){const n=function(e){return 1===(e=Ge(e)).length?e[0]:{type:zE,features:e.reduce(((e,t)=>e.concat(function(e){return e.type===zE?e.features:Ge(e).filter((e=>null!=e)).map((e=>e.type===TE?e:{type:TE,geometry:e}))}(t))),[])}}(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});var eO=JE.prototype=KE.prototype;function tO(e){return function(){return e}}function nO(e){return 1e-6*(e()-.5)}function rO(e){return e.x+e.vx}function iO(e){return e.y+e.vy}eO.copy=function(){var e,t,n=new KE(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=QE(r),n;for(e=[{source:r,target:n._root=new Array(4)}];r=e.pop();)for(var i=0;i<4;++i)(t=r.source[i])&&(t.length?e.push({source:t,target:r.target[i]=new Array(4)}):r.target[i]=QE(t));return n},eO.add=function(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return VE(this.cover(t,n),t,n,e)},eO.addAll=function(e){var t,n,r,i,o=e.length,a=new Array(o),s=new Array(o),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=r),if&&(f=i));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;ne||e>=i||r>t||t>=o;)switch(s=(td||(o=u.y0)>h||(a=u.x1)=y)<<1|e>=m)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=u)}else{var v=e-+this._x.call(null,g.data),b=t-+this._y.call(null,g.data),x=v*v+b*b;if(x=(s=(p+m)/2))?p=s:m=s,(c=a>=(u=(g+y)/2))?g=u:y=u,t=h,!(h=h[f=c<<1|l]))return this;if(!h.length)break;(t[f+1&3]||t[f+2&3]||t[f+3&3])&&(n=t,d=f)}for(;h.data!==e;)if(r=h,!(h=h.next))return this;return(i=h.next)&&delete h.next,r?(i?r.next=i:delete r.next,this):t?(i?t[f]=i:delete t[f],(h=t[0]||t[1]||t[2]||t[3])&&h===(t[3]||t[2]||t[1]||t[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=i,this)},eO.removeAll=function(e){for(var t=0,n=e.length;t{}};function aO(){for(var e,t=0,n=arguments.length,r={};t=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++a0)for(var n,r,i=new Array(n),o=0;o=0&&t._call.call(void 0,e),t=t._next;--hO}()}finally{hO=0,function(){for(var e,t,n=fO,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:fO=t);dO=e,SO(r)}(),vO=0}}function DO(){var e=xO.now(),t=e-yO;t>mO&&(bO-=t,yO=e)}function SO(e){hO||(pO&&(pO=clearTimeout(pO)),e-vO>24?(e<1/0&&(pO=setTimeout(OO,e-xO.now()-bO)),gO&&(gO=clearInterval(gO))):(gO||(yO=xO.now(),gO=setInterval(DO,mO)),hO=1,_O(OO)))}AO.prototype=EO.prototype={constructor:AO,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?wO():+n)+(null==t?0:+t),this._next||dO===this||(dO?dO._next=this:fO=this,dO=this),this._call=e,this._time=n,SO()},stop:function(){this._call&&(this._call=null,this._time=1/0,SO())}};const CO=4294967296;function FO(e){return e.x}function jO(e){return e.y}var MO=Math.PI*(3-Math.sqrt(5));function $O(e){return e.index}function NO(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}const BO={center:function(e,t){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;il+p||oc+p||au.index){var g=l-s.x-s.vx,m=c-s.y-s.vy,y=g*g+m*m;ye.r&&(e.r=e[t].r)}function u(){if(t){var r,i,o=t.length;for(n=new Array(o),r=0;r=s)){(e.data!==t||e.next)&&(0===f&&(p+=(f=nO(n))*f),0===d&&(p+=(d=nO(n))*d),p[s(e,t,r),e])));for(a=0,i=new Array(l);at(e,n):t)}function HO(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function GO(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=YO)):void 0===t&&(t=VO);for(var n,r,i,o,a,s=new JO(e),u=[s];n=u.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)u.push(r=i[o]=new JO(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(ZO)}function VO(e){return e.children}function YO(e){return Array.isArray(e)?e[1]:null}function XO(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function ZO(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function JO(e){this.data=e,this.depth=this.height=0,this.parent=null}function KO(e){return null==e?null:QO(e)}function QO(e){if("function"!=typeof e)throw new Error;return e}function eD(){return 0}function tD(e){return function(){return e}}LO.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:PO}]},ft(LO,gs,{transform(e,t){var n,r,i=this.value,o=t.changed(t.ADD_REM),a=e.modified(zO),s=e.iterations||300;if(i?(o&&(t.modifies("index"),i.nodes(t.source)),(a||t.changed(t.MOD))&&IO(i,e,0,t)):(this.value=i=function(e,t){const n=function(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=EO(f),l=cO("tick","end"),c=function(){let e=1;return()=>(e=(1664525*e+1013904223)%CO)/CO}();function f(){d(),l.call("tick",t),n1?(null==n?s.delete(e):s.set(e,p(n)),t):s.get(e)},find:function(t,n,r){var i,o,a,s,u,l=0,c=e.length;for(null==r?r=1/0:r*=r,l=0;l1?(l.on(e,n),t):l.on(e)}}}(e),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),IO(n,t,!0).on("end",(()=>o=!0))}(t.source,e),i.on("tick",(n=t.dataflow,r=this,()=>n.touch(r).run())),e.static||(o=!0,i.tick()),t.modifies("index")),a||o||e.modified(RO)||t.changed()&&e.restart)if(i.alpha(Math.max(i.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(i.alphaMin(),1/s)),e.static)for(i.stop();--s>=0;)i.tick();else if(i.stopped()&&i.restart(),!o)return t.StopPropagation;return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let e,t=this._argops,s=0,u=t.length;s=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return GO(this).eachBefore(XO)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n0&&n*n>r*r+i*i}function aD(e,t){for(var n=0;n1e-6?(D+Math.sqrt(D*D-4*O*S))/(2*O):S/D);return{x:r+w+k*C,y:i+A+E*C,r:C}}function cD(e,t,n){var r,i,o,a,s=e.x-t.x,u=e.y-t.y,l=s*s+u*u;l?(i=t.r+n.r,i*=i,a=e.r+n.r,i>(a*=a)?(r=(l+a-i)/(2*l),o=Math.sqrt(Math.max(0,a/l-r*r)),n.x=e.x-r*s-o*u,n.y=e.y-r*u+o*s):(r=(l+i-a)/(2*l),o=Math.sqrt(Math.max(0,i/l-r*r)),n.x=t.x+r*s-o*u,n.y=t.y+r*u+o*s)):(n.x=t.x+n.r,n.y=t.y)}function fD(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function dD(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,o=(t.y*n.r+n.y*t.r)/r;return i*i+o*o}function hD(e){this._=e,this.next=null,this.previous=null}function pD(e,t){if(!(o=(e=function(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}(e)).length))return 0;var n,r,i,o,a,s,u,l,c,f,d;if((n=e[0]).x=0,n.y=0,!(o>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;cD(r,n,i=e[2]),n=new hD(n),r=new hD(r),i=new hD(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(u=3;ufunction(e){let t=(e=`${e}`).length;return SD(e,t-1)&&!SD(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r)))),n=t.map(DD),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(DD(e)),d.push(kD));h=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,i=d.length;a=0&&(l=d[e]).data===kD;--e)l.data=null}if(s.parent=_D,s.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(ZO),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=KO(e),r):t},r.parentId=function(e){return arguments.length?(n=KO(e),r):n},r.path=function(t){return arguments.length?(e=KO(t),r):e},r}function DD(e){let t=e.length;if(t<2)return"";for(;--t>1&&!SD(e,t););return e.slice(0,t)}function SD(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0==(1&n))return!0}return!1}function CD(e,t){return e.parent===t.parent?1:2}function FD(e){var t=e.children;return t?t[0]:e.t}function jD(e){var t=e.children;return t?t[t.length-1]:e.t}function MD(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function $D(e,t,n){return e.a.parent===t.parent?e.a:n}function ND(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}function BD(e,t){return e.parent===t.parent?1:2}function TD(e,t){return e+t.x}function zD(e,t){return Math.max(e,t.y)}function RD(e,t,n,r,i){for(var o,a=e.children,s=-1,u=a.length,l=e.value&&(i-n)/e.value;++sd&&(d=s),m=c*c*g,(h=Math.max(d/m,m/f))>p){c-=s;break}p=h}y.push(a={value:c,dice:u1?t:1)},n}(PD),UD=function e(t){function n(e,n,r,i,o){if((a=e._squarify)&&a.ratio===t)for(var a,s,u,l,c,f=-1,d=a.length,h=e.value;++f1?t:1)},n}(PD);function qD(e,t,n){const r={};return e.each((e=>{const i=e.data;n(i)&&(r[t(i)]=e)})),e.lookup=r,e}function WD(e){gs.call(this,null,e)}WD.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const HD=e=>e.values;function GD(){const e=[],t={entries:e=>r(n(e,0),0),key:n=>(e.push(n),t)};function n(t,r){if(r>=e.length)return t;const i=t.length,o=e[r++],a={},s={};let u,l,c,f=-1;for(;++fe.length)return t;const i=[];for(const e in t)i.push({key:e,values:r(t[e],n)});return i}return t}function VD(e){gs.call(this,null,e)}ft(WD,gs,{transform(e,t){t.source||oe("Nest transform requires an upstream data source.");var n=e.generate,r=e.modified(),i=t.clone(),o=this.value;return(!o||r||t.changed())&&(o&&o.each((e=>{e.children&&Ta(e.data)&&i.rem.push(e.data)})),this.value=o=GO({values:Ge(e.keys).reduce(((e,t)=>(e.key(t),e)),GD()).entries(i.source)},HD),n&&o.each((e=>{e.children&&(e=Pa(e.data),i.add.push(e),i.source.push(e))})),qD(o,za,za)),i.source.root=o,i}});const YD=(e,t)=>e.parent===t.parent?1:2;ft(VD,gs,{transform(e,t){t.source&&t.source.root||oe(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),r=this.fields,i=t.source.root,o=e.as||r;e.field?i.sum(e.field):i.count(),e.sort&&i.sort(qa(e.sort,(e=>e.data))),function(e,t,n){for(let r,i=0,o=t.length;ifunction(e,t,n){const r=e.data,i=t.length-1;for(let o=0;o(e=(1664525*e+1013904223)%nD)/nD}();return i.x=t/2,i.y=n/2,e?i.eachBefore(mD(e)).eachAfter(yD(r,.5,o)).eachBefore(vD(1)):i.eachBefore(mD(gD)).eachAfter(yD(eD,1,o)).eachAfter(yD(r,i.r/Math.min(t,n),o)).eachBefore(vD(Math.min(t,n)/(2*i.r))),i}return i.radius=function(t){return arguments.length?(e=KO(t),i):e},i.size=function(e){return arguments.length?(t=+e[0],n=+e[1],i):[t,n]},i.padding=function(e){return arguments.length?(r="function"==typeof e?e:tD(+e),i):r},i},params:["radius","size","padding"],fields:XD});const JD=["x0","y0","x1","y1","depth","children"];function KD(e){VD.call(this,e)}function QD(e){gs.call(this,null,e)}KD.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:JD.length,default:JD}]},ft(KD,VD,{layout:function(){var e=1,t=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=e,i.y1=t/o,i.eachBefore(function(e,t){return function(r){r.children&&xD(r,r.x0,e*(r.depth+1)/t,r.x1,e*(r.depth+2)/t);var i=r.x0,o=r.y0,a=r.x1-n,s=r.y1-n;a=0;--i)s.push(n=t.children[i]=new ND(r[i],i)),n.parent=t;return(a.parent=new ND(null,0)).children=[a],a}(i);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(a),r)i.eachBefore(s);else{var l=i,c=i,f=i;i.eachBefore((function(e){e.xc.x&&(c=e),e.depth>f.depth&&(f=e)}));var d=l===c?1:e(l,c)/2,h=d-l.x,p=t/(c.x+d+h),g=n/(f.depth||1);i.eachBefore((function(e){e.x=(e.x+h)*p,e.y=e.depth*g}))}return i}function o(t){var n=t.children,r=t.parent.children,i=t.i?r[t.i-1]:null;if(n){!function(e){for(var t,n=0,r=0,i=e.children,o=i.length;--o>=0;)(t=i[o]).z+=n,t.m+=n,n+=t.s+(r+=t.c)}(t);var o=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-o):t.z=o}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function(t,n,r){if(n){for(var i,o=t,a=t,s=n,u=o.parent.children[0],l=o.m,c=a.m,f=s.m,d=u.m;s=jD(s),o=FD(o),s&&o;)u=FD(u),(a=jD(a)).a=t,(i=s.z+f-o.z-l+e(s._,o._))>0&&(MD($D(s,t,r),t,i),l+=i,c+=i),f+=s.m,l+=o.m,d+=u.m,c+=a.m;s&&!jD(a)&&(a.t=s,a.m+=f-c),o&&!FD(u)&&(u.t=o,u.m+=l-d,r=t)}return r}(t,i,t.parent.A||r[0])}function a(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*n}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i},cluster:function(){var e=BD,t=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(t){var n=t.children;n?(t.x=function(e){return e.reduce(TD,0)/e.length}(n),t.y=function(e){return 1+e.reduce(zD,0)}(n)):(t.x=o?a+=e(t,o):0,t.y=0,o=t)}));var s=function(e){for(var t;t=e.children;)e=t[0];return e}(i),u=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(i),l=s.x-e(s,u)/2,c=u.x+e(u,s)/2;return i.eachAfter(r?function(e){e.x=(e.x-i.x)*t,e.y=(i.y-e.y)*n}:function(e){e.x=(e.x-l)/(c-l)*t,e.y=(1-(i.y?e.y/i.y:1))*n})}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i}},tS=["x","y","depth","children"];function nS(e){VD.call(this,e)}function rS(e){gs.call(this,[],e)}nS.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:tS.length,default:tS}]},ft(nS,VD,{layout(e){const t=e||"tidy";if(st(eS,t))return eS[t]();oe("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:tS}),rS.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},ft(rS,gs,{transform(e,t){const n=this.value,r=t.source&&t.source.root,i=t.fork(t.NO_SOURCE),o={};return r||oe("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(i.rem=n,t.visit(t.SOURCE,(e=>o[za(e)]=1)),r.each((e=>{const t=e.data,n=e.parent&&e.parent.data;n&&o[za(t)]&&o[za(n)]&&i.add.push(Pa({source:n,target:t}))})),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,(e=>o[za(e)]=1)),n.forEach((e=>{(o[za(e.source)]||o[za(e.target)])&&i.mod.push(e)}))),i}});const iS={binary:function(e,t,n,r,i){var o,a,s=e.children,u=s.length,l=new Array(u+1);for(l[0]=a=o=0;o=n-1){var c=s[t];return c.x0=i,c.y0=o,c.x1=a,void(c.y1=u)}for(var f=l[t],d=r/2+f,h=t+1,p=n-1;h>>1;l[g]u-o){var v=r?(i*y+a*m)/r:a;e(t,h,m,i,o,v,u),e(h,n,y,v,o,a,u)}else{var b=r?(o*y+u*m)/r:u;e(t,h,m,i,o,a,b),e(h,n,y,i,b,a,u)}}(0,u,e.value,t,n,r,i)},dice:xD,slice:RD,slicedice:function(e,t,n,r,i){(1&e.depth?RD:xD)(e,t,n,r,i)},squarify:ID,resquarify:UD},oS=["x0","y0","x1","y1","depth","children"];function aS(e){VD.call(this,e)}aS.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:oS.length,default:oS}]},ft(aS,VD,{layout(){const e=function(){var e=ID,t=!1,n=1,r=1,i=[0],o=eD,a=eD,s=eD,u=eD,l=eD;function c(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(f),i=[0],t&&e.eachBefore(bD),e}function f(t){var n=i[t.depth],r=t.x0+n,c=t.y0+n,f=t.x1-n,d=t.y1-n;f{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{st(iS,t)?e.tile(iS[t]):oe("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:oS});const sS=4278190080;function uS(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function lS(e,t,n){if(!t.length)return;const r=t[0].mark.marktype;"group"===r?t.forEach((t=>{t.items.forEach((t=>lS(e,t.items,n)))})):Fv[r].draw(e,{items:n?t.map(cS):t})}function cS(e){const t=Ia(e,{});return t.stroke&&0!==t.strokeOpacity||t.fill&&0!==t.fillOpacity?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const fS=5,dS=31,hS=32,pS=new Uint32Array(hS+1),gS=new Uint32Array(hS+1);gS[0]=0,pS[0]=~gS[0];for(let e=1;e<=hS;++e)gS[e]=gS[e-1]<<1|1,pS[e]=~gS[e];function mS(e,t,n,r,i,o){let a=n/2;return e-a<0||e+a>i||t-(a=r/2)<0||t+a>o}function yS(e,t,n,r,i,o,a,s){const u=i*o/(2*r),l=e(t-u),c=e(t+u),f=e(n-(o/=2)),d=e(n+o);return a.outOfBounds(l,f,c,d)||a.getRange(l,f,c,d)||s&&s.getRange(l,f,c,d)}const vS=[-1,-1,1,1],bS=[-1,1,-1,1],xS=["right","center","left"],_S=["bottom","middle","top"];function wS(e,t,n,r,i,o,a,s,u,l,c,f){return!(i.outOfBounds(e,n,t,r)||(f&&o||i).getRange(e,n,t,r))}const kS={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},AS={naive:function(e,t,n,r){const i=e.width,o=e.height;return function(e){const t=e.datum.datum.items[r].items,n=t.length,a=e.datum.fontSize,s=cv.width(e.datum,e.datum.text);let u,l,c,f,d,h,p,g=0;for(let r=0;r=g&&(g=p,e.x=d,e.y=h);return d=s/2,h=a/2,u=e.x-d,l=e.x+d,c=e.y-h,f=e.y+h,e.align="center",u<0&&l<=i?e.align="left":0<=u&&i=1;)d=(h+p)/2,yS(e,c,f,l,u,d,a,s)?p=d:h=d;if(h>r)return[c,f,h,!0]}}return function(t){const s=t.datum.datum.items[r].items,l=s.length,c=t.datum.fontSize,f=cv.width(t.datum,t.datum.text);let d,h,p,g,m,y,v,b,x,_,w,k,A,E,O,D,S,C=n?c:0,F=!1,j=!1,M=0;for(let r=0;rh&&(S=d,d=h,h=S),p>g&&(S=p,p=g,g=S),x=e(d),w=e(h),_=~~((x+w)/2),k=e(p),E=e(g),A=~~((k+E)/2),v=_;v>=x;--v)for(b=A;b>=k;--b)D=u(v,b,C,f,c),D&&([t.x,t.y,C,F]=D);for(v=_;v<=w;++v)for(b=A;b<=E;++b)D=u(v,b,C,f,c),D&&([t.x,t.y,C,F]=D);F||n||(O=Math.abs(h-d+g-p),m=(d+h)/2,y=(p+g)/2,O>=M&&!mS(m,y,f,c,i,o)&&!yS(e,m,y,c,f,c,a,null)&&(M=O,t.x=m,t.y=y,j=!0))}return!(!F&&!j||(m=f/2,y=c/2,a.setRange(e(t.x-m),e(t.y-y),e(t.x+m),e(t.y+y)),t.align="center",t.baseline="middle",0))}},floodfill:function(e,t,n,r){const i=e.width,o=e.height,a=t[0],s=t[1],u=e.bitmap();return function(t){const l=t.datum.datum.items[r].items,c=l.length,f=t.datum.fontSize,d=cv.width(t.datum,t.datum.text),h=[];let p,g,m,y,v,b,x,_,w,k,A,E,O=n?f:0,D=!1,S=!1,C=0;for(let r=0;r=1;)A=(w+k)/2,yS(e,v,b,f,d,A,a,s)?k=A:w=A;w>O&&(t.x=v,t.y=b,O=w,D=!0)}}D||n||(E=Math.abs(g-p+y-m),v=(p+g)/2,b=(m+y)/2,E>=C&&!mS(v,b,d,f,i,o)&&!yS(e,v,b,f,d,f,a,null)&&(C=E,t.x=v,t.y=b,S=!0))}return!(!D&&!S||(v=d/2,b=f/2,a.setRange(e(t.x-v),e(t.y-b),e(t.x+v),e(t.y+b)),t.align="center",t.baseline="middle",0))}}};function ES(e,t,n,r,i,o,a,s,u,l,c){if(!e.length)return e;const f=Math.max(r.length,i.length),d=function(e,t){const n=new Float64Array(t),r=e.length;for(let t=0;t[e.x,e.x,e.x,e.y,e.y,e.y];return e?"line"===e||"area"===e?e=>i(e.datum):"line"===t?e=>{const t=e.datum.items[r].items;return i(t.length?t["start"===n?0:t.length-1]:{x:NaN,y:NaN})}:e=>{const t=e.datum.bounds;return[t.x1,(t.x1+t.x2)/2,t.x2,t.y1,(t.y1+t.y2)/2,t.y2]}:i}(p,g,s,u),v=null===l||l===1/0,b=m&&"naive"===c;var x;let _=-1,w=-1;const k=e.map((e=>{const t=v?cv.width(e,e.text):void 0;return _=Math.max(_,t),w=Math.max(w,e.fontSize),{datum:e,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(e),textWidth:t}}));l=null===l||l===1/0?Math.max(_,w)+Math.max(...r):l;const A=function(e,t,n){const r=Math.max(1,Math.sqrt(e*t/1e6)),i=~~((e+2*n+r)/r),o=~~((t+2*n+r)/r),a=e=>~~((e+n)/r);return a.invert=e=>e*r-n,a.bitmap=()=>function(e,t){const n=new Uint32Array(~~((e*t+hS)/hS));function r(e,t){n[e]|=t}function i(e,t){n[e]&=t}return{array:n,get:(t,r)=>{const i=r*e+t;return n[i>>>fS]&1<<(i&dS)},set:(t,n)=>{const i=n*e+t;r(i>>>fS,1<<(i&dS))},clear:(t,n)=>{const r=n*e+t;i(r>>>fS,~(1<<(r&dS)))},getRange:(t,r,i,o)=>{let a,s,u,l,c=o;for(;c>=r;--c)if(a=c*e+t,s=c*e+i,u=a>>>fS,l=s>>>fS,u===l){if(n[u]&pS[a&dS]&gS[1+(s&dS)])return!0}else{if(n[u]&pS[a&dS])return!0;if(n[l]&gS[1+(s&dS)])return!0;for(let e=u+1;e{let a,s,u,l,c;for(;n<=o;++n)if(a=n*e+t,s=n*e+i,u=a>>>fS,l=s>>>fS,u===l)r(u,pS[a&dS]&gS[1+(s&dS)]);else for(r(u,pS[a&dS]),r(l,gS[1+(s&dS)]),c=u+1;c{let a,s,u,l,c;for(;n<=o;++n)if(a=n*e+t,s=n*e+r,u=a>>>fS,l=s>>>fS,u===l)i(u,gS[a&dS]|pS[1+(s&dS)]);else for(i(u,gS[a&dS]),i(l,pS[1+(s&dS)]),c=u+1;cn<0||r<0||o>=t||i>=e}}(i,o),a.ratio=r,a.padding=n,a.width=e,a.height=t,a}(t[0],t[1],l);let E;if(!b){n&&k.sort(((e,t)=>n(e.datum,t.datum)));let t=!1;for(let e=0;ee.datum));E=o.length||r?function(e,t,n,r,i){const o=e.width,a=e.height,s=r||i,u=ff(o,a).getContext("2d"),l=ff(o,a).getContext("2d"),c=s&&ff(o,a).getContext("2d");n.forEach((e=>lS(u,e,!1))),lS(l,t,!1),s&&lS(c,t,!0);const f=uS(u,o,a),d=uS(l,o,a),h=s&&uS(c,o,a),p=e.bitmap(),g=s&&e.bitmap();let m,y,v,b,x,_,w,k;for(y=0;yn.set(e(t.boundary[0]),e(t.boundary[3])))),[n,void 0]}(A,a&&k)}const O=m?AS[c](A,E,a,u):function(e,t,n,r){const i=e.width,o=e.height,a=t[0],s=t[1],u=r.length;return function(t){const l=t.boundary,c=t.datum.fontSize;if(l[2]<0||l[5]<0||l[0]>i||l[3]>o)return!1;let f,d,h,p,g,m,y,v,b,x,_,w,k,A,E,O=t.textWidth??0;for(let i=0;i>>2&3)-1,h=0===f&&0===d||r[i]<0,p=f&&d?Math.SQRT1_2:1,g=r[i]<0?-1:1,m=l[1+f]+r[i]*f*p,_=l[4+d]+g*c*d/2+r[i]*d*p,v=_-c/2,b=_+c/2,w=e(m),A=e(v),E=e(b),!O){if(!wS(w,w,A,E,a,s,0,0,0,0,0,h))continue;O=cv.width(t.datum,t.datum.text)}if(x=m+g*O*f/2,m=x-O/2,y=x+O/2,w=e(m),k=e(y),wS(w,k,A,E,a,s,0,0,0,0,0,h))return t.x=f?f*g<0?y:m:x,t.y=d?d*g<0?b:v:_,t.align=xS[f*g+1],t.baseline=_S[d*g+1],a.setRange(w,A,k,E),!0}return!1}}(A,E,h,d);return k.forEach((e=>e.opacity=+O(e))),k}const OS=["x","y","opacity","align","baseline"],DS=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function SS(e){gs.call(this,null,e)}function CS(e,t){var n,r,i,o,a,s,u=[],l=function(e){return e(o)};if(null==t)u.push(e);else for(n={},r=0,i=e.length;r{const t=e.datum;t[r[0]]=e.x,t[r[1]]=e.y,t[r[2]]=e.opacity,t[r[3]]=e.align,t[r[4]]=e.baseline})),t.reflow(n).modifies(r)}}),FS.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},ft(FS,gs,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=CS(t.materialize(t.SOURCE).source,e.groupby),i=(e.groupby||[]).map(ee),o=i.length,a=e.as||[ee(e.x),ee(e.y)],s=[];r.forEach((t=>{vu(t,e.x,e.y,e.bandwidth||.3).forEach((e=>{const n={};for(let e=0;e"poly"===e?t:"quad"===e?2:1)(o,a),u=e.as||[ee(e.x),ee(e.y)],l=jS[o],c=[];let f=e.extent;st(jS,o)||oe("Invalid regression method: "+o),null!=f&&"log"===o&&f[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),f=null),r.forEach((n=>{if(n.length<=s)return void t.dataflow.warn("Skipping regression with more parameters than data points.");const r=l(n,e.x,e.y,a);if(e.params)return void c.push(Pa({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));const d=f||it(n,e.x),h=e=>{const t={};for(let e=0;eh([e,r.predict(e)]))):wu(r.predict,d,25,200).forEach(h)})),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});const $S=134217729;function NS(e,t,n,r,i){let o,a,s,u,l=t[0],c=r[0],f=0,d=0;c>l==c>-l?(o=l,l=t[++f]):(o=c,c=r[++d]);let h=0;if(fl==c>-l?(a=l+o,s=o-(a-l),l=t[++f]):(a=c+o,s=o-(a-c),c=r[++d]),o=a,0!==s&&(i[h++]=s);fl==c>-l?(a=o+l,u=a-o,s=o-(a-u)+(l-u),l=t[++f]):(a=o+c,u=a-o,s=o-(a-u)+(c-u),c=r[++d]),o=a,0!==s&&(i[h++]=s);for(;f0!=s>0)return u;const l=Math.abs(a+s);return Math.abs(u)>=33306690738754716e-32*l?u:-function(e,t,n,r,i,o,a){let s,u,l,c,f,d,h,p,g,m,y,v,b,x,_,w,k,A;const E=e-i,O=n-i,D=t-o,S=r-o;x=E*S,d=$S*E,h=d-(d-E),p=E-h,d=$S*S,g=d-(d-S),m=S-g,_=p*m-(x-h*g-p*g-h*m),w=D*O,d=$S*D,h=d-(d-D),p=D-h,d=$S*O,g=d-(d-O),m=O-g,k=p*m-(w-h*g-p*g-h*m),y=_-k,f=_-y,TS[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,TS[1]=b-(y+f)+(f-w),A=v+y,f=A-v,TS[2]=v-(A-f)+(y-f),TS[3]=A;let C=function(e,t){let n=t[0];for(let e=1;e<4;e++)n+=t[e];return n}(0,TS),F=22204460492503146e-32*a;if(C>=F||-C>=F)return C;if(f=e-E,s=e-(E+f)+(f-i),f=n-O,l=n-(O+f)+(f-i),f=t-D,u=t-(D+f)+(f-o),f=r-S,c=r-(S+f)+(f-o),0===s&&0===u&&0===l&&0===c)return C;if(F=11093356479670487e-47*a+33306690738754706e-32*Math.abs(C),C+=E*c+S*s-(D*l+O*u),C>=F||-C>=F)return C;x=s*S,d=$S*s,h=d-(d-s),p=s-h,d=$S*S,g=d-(d-S),m=S-g,_=p*m-(x-h*g-p*g-h*m),w=u*O,d=$S*u,h=d-(d-u),p=u-h,d=$S*O,g=d-(d-O),m=O-g,k=p*m-(w-h*g-p*g-h*m),y=_-k,f=_-y,LS[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,LS[1]=b-(y+f)+(f-w),A=v+y,f=A-v,LS[2]=v-(A-f)+(y-f),LS[3]=A;const j=NS(4,TS,4,LS,zS);x=E*c,d=$S*E,h=d-(d-E),p=E-h,d=$S*c,g=d-(d-c),m=c-g,_=p*m-(x-h*g-p*g-h*m),w=D*l,d=$S*D,h=d-(d-D),p=D-h,d=$S*l,g=d-(d-l),m=l-g,k=p*m-(w-h*g-p*g-h*m),y=_-k,f=_-y,LS[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,LS[1]=b-(y+f)+(f-w),A=v+y,f=A-v,LS[2]=v-(A-f)+(y-f),LS[3]=A;const M=NS(j,zS,4,LS,RS);x=s*c,d=$S*s,h=d-(d-s),p=s-h,d=$S*c,g=d-(d-c),m=c-g,_=p*m-(x-h*g-p*g-h*m),w=u*l,d=$S*u,h=d-(d-u),p=u-h,d=$S*l,g=d-(d-l),m=l-g,k=p*m-(w-h*g-p*g-h*m),y=_-k,f=_-y,LS[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,LS[1]=b-(y+f)+(f-w),A=v+y,f=A-v,LS[2]=v-(A-f)+(y-f),LS[3]=A;const $=NS(M,RS,4,LS,PS);return PS[$-1]}(e,t,n,r,i,o,l)}BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(8),BS(8),BS(8),BS(4),BS(8),BS(8),BS(8),BS(12),BS(192),BS(192),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(8),BS(8),BS(8),BS(8),BS(8),BS(8),BS(8),BS(8),BS(8),BS(4),BS(4),BS(4),BS(8),BS(16),BS(16),BS(16),BS(32),BS(32),BS(48),BS(64),BS(1152),BS(1152),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(24),BS(24),BS(24),BS(24),BS(24),BS(24),BS(24),BS(24),BS(24),BS(24),BS(1152),BS(1152),BS(1152),BS(1152),BS(1152),BS(2304),BS(2304),BS(3456),BS(5760),BS(8),BS(8),BS(8),BS(16),BS(24),BS(48),BS(48),BS(96),BS(192),BS(384),BS(384),BS(384),BS(768),BS(96),BS(96),BS(96),BS(1152);const US=Math.pow(2,-52),qS=new Uint32Array(512);class WS{static from(e,t=ZS,n=JS){const r=e.length,i=new Float64Array(2*r);for(let o=0;o>1;if(t>0&&"number"!=typeof e[0])throw new Error("Expected coords to contain numbers.");this.coords=e;const n=Math.max(2*t-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=e.length>>1;let a=1/0,s=1/0,u=-1/0,l=-1/0;for(let t=0;tu&&(u=n),r>l&&(l=r),this._ids[t]=t}const c=(a+u)/2,f=(s+l)/2;let d,h,p,g=1/0;for(let t=0;t0&&(h=t,g=n)}let v=e[2*h],b=e[2*h+1],x=1/0;for(let t=0;tr&&(t[n++]=i,r=this._dists[i])}return this.hull=t.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(IS(m,y,v,b,_,w)<0){const e=h,t=v,n=b;h=p,v=_,b=w,p=e,_=t,w=n}const k=function(e,t,n,r,i,o){const a=n-e,s=r-t,u=i-e,l=o-t,c=a*a+s*s,f=u*u+l*l,d=.5/(a*l-s*u);return{x:e+(l*c-s*f)*d,y:t+(a*f-u*c)*d}}(m,y,v,b,_,w);this._cx=k.x,this._cy=k.y;for(let t=0;t0&&Math.abs(l-o)<=US&&Math.abs(c-a)<=US)continue;if(o=l,a=c,u===d||u===h||u===p)continue;let f=0;for(let e=0,t=this._hashKey(l,c);e=0;)if(m=g,m===f){m=-1;break}if(-1===m)continue;let y=this._addTriangle(m,u,n[m],-1,-1,r[m]);r[u]=this._legalize(y+2),r[m]=y,A++;let v=n[m];for(;g=n[v],IS(l,c,e[2*v],e[2*v+1],e[2*g],e[2*g+1])<0;)y=this._addTriangle(v,u,g,r[u],-1,r[v]),r[u]=this._legalize(y+2),n[v]=v,A--,v=g;if(m===f)for(;g=t[m],IS(l,c,e[2*g],e[2*g+1],e[2*m],e[2*m+1])<0;)y=this._addTriangle(g,u,m,-1,r[m],r[g]),this._legalize(y+2),r[g]=y,n[m]=m,A--,m=g;this._hullStart=t[u]=m,n[m]=t[v]=u,n[u]=v,i[this._hashKey(l,c)]=u,i[this._hashKey(e[2*m],e[2*m+1])]=m}this.hull=new Uint32Array(A);for(let e=0,t=this._hullStart;e0?3-n:1+n)/4}(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:t,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[e],s=e-e%3;if(o=s+(e+2)%3,-1===a){if(0===i)break;e=qS[--i];continue}const u=a-a%3,l=s+(e+1)%3,c=u+(a+2)%3,f=t[o],d=t[e],h=t[l],p=t[c];if(GS(r[2*f],r[2*f+1],r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1])){t[e]=p,t[a]=f;const r=n[c];if(-1===r){let t=this._hullStart;do{if(this._hullTri[t]===c){this._hullTri[t]=e;break}t=this._hullPrev[t]}while(t!==this._hullStart)}this._link(e,r),this._link(a,n[o]),this._link(o,c);const s=u+(a+1)%3;i=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=r}else{let i=n+1,o=r;XS(e,n+r>>1,i),t[e[n]]>t[e[r]]&&XS(e,n,r),t[e[i]]>t[e[r]]&&XS(e,i,r),t[e[n]]>t[e[i]]&&XS(e,n,i);const a=e[i],s=t[a];for(;;){do{i++}while(t[e[i]]s);if(o=o-n?(YS(e,t,i,r),YS(e,t,n,o-1)):(YS(e,t,n,o-1),YS(e,t,i,r))}}function XS(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function ZS(e){return e[0]}function JS(e){return e[1]}const KS=1e-6;class QS{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,t){this._+=`L${this._x1=+e},${this._y1=+t}`}arc(e,t,n){const r=(e=+e)+(n=+n),i=t=+t;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>KS||Math.abs(this._y1-i)>KS)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${e-n},${t}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(e,t,n,r){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class eC{constructor(){this._=[]}moveTo(e,t){this._.push([e,t])}closePath(){this._.push(this._[0].slice())}lineTo(e,t){this._.push([e,t])}value(){return this._.length?this._:null}}class tC{constructor(e,[t,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(t=+t)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=r,this.xmin=t,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:t,triangles:n},vectors:r}=this;let i,o;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let r,s,u=0,l=0,c=n.length;u1;)i-=2;for(let e=2;e0){if(t>=this.ymax)return null;(i=(this.ymax-t)/r)0){if(e>=this.xmax)return null;(i=(this.xmax-e)/n)this.xmax?2:0)|(tthis.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let t=0;t2&&function(e){const{triangles:t,coords:n}=e;for(let e=0;e1e-10)return!1}return!0}(e)){this.collinear=Int32Array.from({length:t.length/2},((e,t)=>t)).sort(((e,n)=>t[2*e]-t[2*n]||t[2*e+1]-t[2*n+1]));const e=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[t[2*e],t[2*e+1],t[2*n],t[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let e=0,n=t.length/2;e0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,2===r.length&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(e){return new tC(this,e)}*neighbors(e){const{inedges:t,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const t=a.indexOf(e);return t>0&&(yield a[t-1]),void(t=0&&i!==n&&i!==r;)n=i;return i}_step(e,t,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:u}=this;if(-1===r[e]||!u.length)return(e+1)%(u.length>>1);let l=e,c=rC(t-u[2*e],2)+rC(n-u[2*e+1],2);const f=r[e];let d=f;do{let r=s[d];const f=rC(t-u[2*r],2)+rC(n-u[2*r+1],2);if(f>5<<5,u=~~Math.max(Math.abs(v+b),Math.abs(v-b))}else a=a+31>>5<<5;if(u>h&&(h=u),f+a>=dC<<5&&(f=0,d+=h,h=0),d+u>=hC)break;i.translate((f+(a>>1))/o,(d+(u>>1))/o),t.rotate&&i.rotate(t.rotate*fC),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=a,t.height=u,t.xoff=f,t.yoff=d,t.x1=a>>1,t.y1=u>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,f+=a}for(var _=i.getImageData(0,0,(dC<<5)/o,hC/o).data,w=[];--r>=0;)if((t=n[r]).hasText){for(s=(a=t.width)>>5,u=t.y1-t.y0,l=0;l>5),O=_[(d+c)*(dC<<5)+(f+l)<<2]?1<<31-l%32:0;w[E]|=O,k|=O}k?A=c:(t.y0++,u--,c--,d++)}t.y1=t.y0+A,t.sprite=w.slice(0,(t.y1-t.y0)*s)}}}function gC(e,t,n){n>>=5;for(var r,i=e.sprite,o=e.width>>5,a=e.x-(o<<4),s=127&a,u=32-s,l=e.y1-e.y0,c=(e.y+e.y0)*n+(a>>5),f=0;f>>s:0))&t[c+d])return!0;c+=n}return!1}function mC(e,t){var n=e[0],r=e[1];t.x+t.x0r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function yC(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0=f));)if(t.x=a+i,t.y=l+o,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>s[0]||t.y+t.y1>s[1])&&(!n||!gC(t,e,s[0]))&&(!n||yC(t,n))){for(var g,m=t.sprite,y=t.width>>5,v=s[0]>>5,b=t.x-(y<<4),x=127&b,_=32-x,w=t.y1-t.y0,k=(t.y+t.y0)*v+(b>>5),A=0;A>>x:0);k+=v}return t.sprite=null,!0}return!1}return f.layout=function(){for(var u=function(e){e.width=e.height=1;var t=Math.sqrt(e.getContext("2d").getImageData(0,0,1,1).data.length>>2);e.width=(dC<<5)/t,e.height=hC/t;var n=e.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:t}}(ff()),f=function(e){for(var t=[],n=-1;++n>5)*s[1]),h=null,p=l.length,g=-1,m=[],y=l.map((s=>({text:e(s),font:t(s),style:r(s),weight:i(s),rotate:o(s),size:~~(n(s)+1e-14),padding:a(s),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:s}))).sort(((e,t)=>t.size-e.size));++g>1,v.y=s[1]*(c()+.5)>>1,pC(u,v,y,g),v.hasText&&d(f,v,h)&&(m.push(v),h?mC(h,v):h=[{x:v.x+v.x0,y:v.y+v.y0},{x:v.x+v.x1,y:v.y+v.y1}],v.x-=s[0]>>1,v.y-=s[1]>>1)}return m},f.words=function(e){return arguments.length?(l=e,f):l},f.size=function(e){return arguments.length?(s=[+e[0],+e[1]],f):s},f.font=function(e){return arguments.length?(t=bC(e),f):t},f.fontStyle=function(e){return arguments.length?(r=bC(e),f):r},f.fontWeight=function(e){return arguments.length?(i=bC(e),f):i},f.rotate=function(e){return arguments.length?(o=bC(e),f):o},f.text=function(t){return arguments.length?(e=bC(t),f):e},f.spiral=function(e){return arguments.length?(u=xC[e]||e,f):u},f.fontSize=function(e){return arguments.length?(n=bC(e),f):n},f.padding=function(e){return arguments.length?(a=bC(e),f):a},f.random=function(e){return arguments.length?(c=e,f):c},f}(),e)}kC.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:_C}]},ft(kC,gs,{transform(e,t){!e.size||e.size[0]&&e.size[1]||oe("Wordcloud size dimensions must be non-zero.");const n=e.modified();if(!(n||t.changed(t.ADD_REM)||wC.some((function(n){const r=e[n];return Ye(r)&&t.modified(r.fields)}))))return;const r=t.materialize(t.SOURCE).source,i=this.value,o=e.as||_C;let a,s=e.fontSize||14;if(Ye(s)?a=e.fontSizeRange:s=tt(s),a){const e=s,t=Gp("sqrt")().domain(it(r,e)).range(a);s=n=>t(e(n))}r.forEach((e=>{e[o[0]]=NaN,e[o[1]]=NaN,e[o[3]]=0}));const u=i.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(s).random($s).layout(),l=i.size(),c=l[0]>>1,f=l[1]>>1,d=u.length;for(let e,t,n=0;nnew Uint8Array(e),EC=e=>new Uint16Array(e),OC=e=>new Uint32Array(e);function DC(e,t,n){const r=(t<257?AC:t<65537?EC:OC)(e);return n&&r.set(n),r}function SC(e,t,n){const r=1<{const r=e[t],i=e[n];return ri?1:0})),function(e,t){return Array.from(t,(t=>e[t]))}(e,t)}(d,u),a)l=t,c=e,t=Array(a+s),e=OC(a+s),function(e,t,n,r,i,o,a,s,u){let l,c=0,f=0;for(l=0;c0)for(f=0;fe,size:()=>n}}function FC(e){gs.call(this,function(){let e=8,t=[],n=OC(0),r=DC(0,e),i=DC(0,e);return{data:()=>t,seen:()=>n=function(e,t,n){return e.length>=t?e:((n=n||new e.constructor(t)).set(e),n)}(n,t.length),add(e){for(let n,r=0,i=t.length,o=e.length;rt.length,curr:()=>r,prev:()=>i,reset:e=>i[e]=r[e],all:()=>e<257?255:e<65537?65535:4294967295,set(e,t){r[e]|=t},clear(e,t){r[e]&=~t},resize(t,n){(t>r.length||n>e)&&(e=Math.max(n,e),r=DC(t,e,r),i=DC(t,e))}}}(),e),this._indices=null,this._dims=null}function jC(e){gs.call(this,null,e)}FC.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]},ft(FC,gs,{transform(e,t){return this._dims?e.modified("fields")||e.fields.some((e=>t.modified(e.fields)))?this.reinit(e,t):this.eval(e,t):this.init(e,t)},init(e,t){const n=e.fields,r=e.query,i=this._indices={},o=this._dims=[],a=r.length;let s,u,l=0;for(;l{const e=i.remove(t,n);for(const t in r)r[t].reindex(e)}))},update(e,t,n){const r=this._dims,i=e.query,o=t.stamp,a=r.length;let s,u,l=0;for(n.filters=0,u=0;uh)for(m=h,y=Math.min(f,p);mp)for(m=Math.max(f,p),y=d;mc)for(h=c,p=Math.min(u,f);hf)for(h=Math.max(u,f),p=l;hs[e]&n?null:a[e];return o.filter(o.MOD,l),i&i-1?(o.filter(o.ADD,(e=>{const t=s[e]&n;return!t&&t^u[e]&n?a[e]:null})),o.filter(o.REM,(e=>{const t=s[e]&n;return!t||t^t^u[e]&n?null:a[e]}))):(o.filter(o.ADD,l),o.filter(o.REM,(e=>(s[e]&n)===i?a[e]:null))),o.filter(o.SOURCE,(e=>l(e._index)))}});const MC="Literal",$C="CallExpression";function NC(e){this.type=e}var BC,TC,zC,RC,PC;NC.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=function(e){switch(e.type){case"ArrayExpression":return e.elements;case"BinaryExpression":case"LogicalExpression":return[e.left,e.right];case $C:return[e.callee].concat(e.arguments);case"ConditionalExpression":return[e.test,e.consequent,e.alternate];case"MemberExpression":return[e.object,e.property];case"ObjectExpression":return e.properties;case"Property":return[e.key,e.value];case"UnaryExpression":return[e.argument];default:return[]}}(this),n=0,r=t.length;n",BC[UC]="Identifier",BC[qC]="Keyword",BC[WC]="Null",BC[HC]="Numeric",BC[GC]="Punctuator",BC[VC]="String",BC[9]="RegularExpression";var YC="ArrayExpression",XC="BinaryExpression",ZC="CallExpression",JC="ConditionalExpression",KC="Identifier",QC="Literal",eF="LogicalExpression",tF="MemberExpression",nF="ObjectExpression",rF="Property",iF="UnaryExpression",oF="Unexpected token %0",aF="Unexpected number",sF="Unexpected string",uF="Unexpected identifier",lF="Unexpected reserved word",cF="Unexpected end of input",fF="Invalid regular expression",dF="Invalid regular expression: missing /",hF="Octal literals are not allowed in strict mode.",pF="Duplicate data property in object literal not allowed in strict mode",gF="ILLEGAL",mF="Disabled.",yF=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\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E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),vF=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u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EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function bF(e,t){if(!e)throw new Error("ASSERT: "+t)}function xF(e){return e>=48&&e<=57}function _F(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function wF(e){return"01234567".indexOf(e)>=0}function kF(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function AF(e){return 10===e||13===e||8232===e||8233===e}function EF(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&yF.test(String.fromCharCode(e))}function OF(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&vF.test(String.fromCharCode(e))}const DF={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function SF(){for(;zC1114111||"}"!==e)&&qF({},oF,gF),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),r=56320+(t-65536&1023),String.fromCharCode(n,r))}function jF(){var e,t;for(e=TC.charCodeAt(zC++),t=String.fromCharCode(e),92===e&&(117!==TC.charCodeAt(zC)&&qF({},oF,gF),++zC,(e=CF("u"))&&"\\"!==e&&EF(e.charCodeAt(0))||qF({},oF,gF),t=e);zC>>="===(r=TC.substr(zC,4))?{type:GC,value:r,start:i,end:zC+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:GC,value:n,start:i,end:zC+=3}:a===(t=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t?{type:GC,value:t,start:i,end:zC+=2}:("//"===t&&qF({},oF,gF),"<>=!+-*%&|^/".indexOf(a)>=0?(++zC,{type:GC,value:a,start:i,end:zC}):void qF({},oF,gF))}function $F(){var e,t,n;if(bF(xF((n=TC[zC]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=zC,e="","."!==n){if(e=TC[zC++],n=TC[zC],"0"===e){if("x"===n||"X"===n)return++zC,function(e){let t="";for(;zC=RC)return{type:IC,start:zC,end:zC};const e=TC.charCodeAt(zC);return EF(e)?function(){var e,t;return e=zC,t=92===TC.charCodeAt(zC)?jF():function(){var e,t;for(e=zC++;zC=0&&zC(bF(t=0&&qF({},fF,n),{value:n,literal:t}}(),r=function(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((e,t)=>{if(parseInt(t,16)<=1114111)return"x";qF({},fF)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){qF({},fF)}try{return new RegExp(e,t)}catch(e){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:zC}}()),TF()):WF(BF())}return n}function KF(){const e=[];if(HF("("),!GF(")"))for(;zC":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function ij(){var e,t;return e=function(){var e,t,n,r,i,o,a,s,u,l;if(e=PC,u=nj(),0===(i=rj(r=PC)))return u;for(r.prec=i,BF(),t=[e,PC],o=[u,r,a=nj()];(i=rj(PC))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),t.pop(),n=zF(s,u,a),o.push(n);(r=BF()).prec=i,o.push(r),t.push(PC),n=nj(),o.push(n)}for(n=o[l=o.length-1],t.pop();l>1;)t.pop(),n=zF(o[l-1].value,o[l-2],n),l-=2;return n}(),GF("?")&&(BF(),t=ij(),HF(":"),e=function(e,t,n){const r=new NC(JC);return r.test=e,r.consequent=t,r.alternate=n,r}(e,t,ij())),e}function oj(){const e=ij();if(GF(","))throw new Error(mF);return e}function aj(e){zC=0,RC=(TC=e).length,PC=null,TF();const t=oj();if(PC.type!==IC)throw new Error("Unexpect token after expression.");return t}var sj={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function uj(e){function t(t,n,r){return i=>function(t,n,r,i){let o=e(n[0]);return r&&(o=r+"("+o+")",0===r.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+t+(i<0?"":0===i?"()":"("+n.slice(1).map(e).join(",")+")")}(t,i,n,r)}const n="new Date",r="String",i="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(t){t.length<3&&oe("Missing arguments to clamp function."),t.length>3&&oe("Too many arguments to clamp function.");const n=t.map(e);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:t("getDate",n,0),day:t("getDay",n,0),year:t("getFullYear",n,0),month:t("getMonth",n,0),hours:t("getHours",n,0),minutes:t("getMinutes",n,0),seconds:t("getSeconds",n,0),milliseconds:t("getMilliseconds",n,0),time:t("getTime",n,0),timezoneoffset:t("getTimezoneOffset",n,0),utcdate:t("getUTCDate",n,0),utcday:t("getUTCDay",n,0),utcyear:t("getUTCFullYear",n,0),utcmonth:t("getUTCMonth",n,0),utchours:t("getUTCHours",n,0),utcminutes:t("getUTCMinutes",n,0),utcseconds:t("getUTCSeconds",n,0),utcmilliseconds:t("getUTCMilliseconds",n,0),length:t("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase",r,0),lower:t("toLowerCase",r,0),substring:t("substring",r),split:t("split",r),trim:t("trim",r,0),regexp:i,test:t("test",i),if:function(t){t.length<3&&oe("Missing arguments to if function."),t.length>3&&oe("Too many arguments to if function.");const n=t.map(e);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function lj(e){const t=(e=e||{}).allowed?Mt(e.allowed):{},n=e.forbidden?Mt(e.forbidden):{},r=e.constants||sj,i=(e.functions||uj)(f),o=e.globalvar,a=e.fieldvar,s=Ye(o)?o:e=>`${o}["${e}"]`;let u={},l={},c=0;function f(e){if(vt(e))return e;const t=d[e.type];return null==t&&oe("Unsupported type: "+e.type),t(e)}const d={Literal:e=>e.raw,Identifier:e=>{const i=e.name;return c>0?i:st(n,i)?oe("Illegal identifier: "+i):st(r,i)?r[i]:st(t,i)?i:(u[i]=1,s(i))},MemberExpression:e=>{const t=!e.computed,n=f(e.object);t&&(c+=1);const r=f(e.property);return n===a&&(l[function(e){const t=e&&e.length-1;return t&&('"'===e[0]&&'"'===e[t]||"'"===e[0]&&"'"===e[t])?e.slice(1,-1):e}(r)]=1),t&&(c-=1),n+(t?"."+r:"["+r+"]")},CallExpression:e=>{"Identifier"!==e.callee.type&&oe("Illegal callee type: "+e.callee.type);const t=e.callee.name,n=e.arguments,r=st(i,t)&&i[t];return r||oe("Unrecognized function: "+t),Ye(r)?r(n):r+"("+n.map(f).join(",")+")"},ArrayExpression:e=>"["+e.elements.map(f).join(",")+"]",BinaryExpression:e=>"("+f(e.left)+" "+e.operator+" "+f(e.right)+")",UnaryExpression:e=>"("+e.operator+f(e.argument)+")",ConditionalExpression:e=>"("+f(e.test)+"?"+f(e.consequent)+":"+f(e.alternate)+")",LogicalExpression:e=>"("+f(e.left)+e.operator+f(e.right)+")",ObjectExpression:e=>"{"+e.properties.map(f).join(",")+"}",Property:e=>{c+=1;const t=f(e.key);return c-=1,t+":"+f(e.value)}};function h(e){const t={code:f(e),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},t}return h.functions=i,h.constants=r,h}var cj,fj,dj,hj,pj,gj,mj,yj,vj,bj,xj,_j,wj,kj,Aj,Ej,Oj=new cw,Dj=new cw,Sj={point:Nw,lineStart:Nw,lineEnd:Nw,polygonStart:function(){Oj=new cw,Sj.lineStart=Cj,Sj.lineEnd=Fj},polygonEnd:function(){var e=+Oj;Dj.add(e<0?mw+e:e),this.lineStart=this.lineEnd=this.point=Nw},sphere:function(){Dj.add(mw)}};function Cj(){Sj.point=jj}function Fj(){Mj(cj,fj)}function jj(e,t){Sj.point=Mj,cj=e,fj=t,dj=e*=vw,hj=ww(t=(t*=vw)/2+gw),pj=Sw(t)}function Mj(e,t){var n=(e*=vw)-dj,r=n>=0?1:-1,i=r*n,o=ww(t=(t*=vw)/2+gw),a=Sw(t),s=pj*a,u=hj*o+s*ww(i),l=s*r*Sw(i);Oj.add(_w(l,u)),dj=e,hj=o,pj=a}var $j,Nj,Bj,Tj,zj,Rj,Pj,Lj,Ij,Uj,qj,Wj,Hj,Gj,Vj,Yj,Xj={point:Zj,lineStart:Kj,lineEnd:Qj,polygonStart:function(){Xj.point=eM,Xj.lineStart=tM,Xj.lineEnd=nM,kj=new cw,Sj.polygonStart()},polygonEnd:function(){Sj.polygonEnd(),Xj.point=Zj,Xj.lineStart=Kj,Xj.lineEnd=Qj,Oj<0?(gj=-(yj=180),mj=-(vj=90)):kj>fw?vj=90:kj<-fw&&(mj=-90),Ej[0]=gj,Ej[1]=yj},sphere:function(){gj=-(yj=180),mj=-(vj=90)}};function Zj(e,t){Aj.push(Ej=[gj=e,yj=e]),tvj&&(vj=t)}function Jj(e,t){var n=Vk([e*vw,t*vw]);if(wj){var r=Xk(wj,n),i=Xk([r[1],-r[0],0],r);Kk(i),i=Gk(i);var o,a=e-bj,s=a>0?1:-1,u=i[0]*yw*s,l=bw(a)>180;l^(s*bjvj&&(vj=o):l^(s*bj<(u=(u+360)%360-180)&&uvj&&(vj=t)),l?erM(gj,yj)&&(yj=e):rM(e,yj)>rM(gj,yj)&&(gj=e):yj>=gj?(eyj&&(yj=e)):e>bj?rM(gj,e)>rM(gj,yj)&&(yj=e):rM(e,yj)>rM(gj,yj)&&(gj=e)}else Aj.push(Ej=[gj=e,yj=e]);tvj&&(vj=t),wj=n,bj=e}function Kj(){Xj.point=Jj}function Qj(){Ej[0]=gj,Ej[1]=yj,Xj.point=Zj,wj=null}function eM(e,t){if(wj){var n=e-bj;kj.add(bw(n)>180?n+(n>0?360:-360):n)}else xj=e,_j=t;Sj.point(e,t),Jj(e,t)}function tM(){Sj.lineStart()}function nM(){eM(xj,_j),Sj.lineEnd(),bw(kj)>fw&&(gj=-(yj=180)),Ej[0]=gj,Ej[1]=yj,wj=null}function rM(e,t){return(t-=e)<0?t+360:t}function iM(e,t){return e[0]-t[0]}function oM(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tt?1:e>=t?0:NaN}function vM(e,t){return null==e||null==t?NaN:te?1:t>=e?0:NaN}function bM(){return 0}function xM(e){return e instanceof hh?e:new hh(e)}const _M="intersect",wM="union",kM="_vgsid_",AM=se(kM),EM="index:unit";function OM(e,t){for(var n,r,i=t.fields,o=t.values,a=i.length,s=0;s>>1;n(e[t],r)<0?i=t+1:o=t}while(iyM(e(t),n),r=(t,n)=>e(t)-n):(t=e===yM||e===vM?e:bM,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i>>1;n(e[t],r)<=0?i=t+1:o=t}while(it.indexOf(e)>=0)):t},R_union:function(e,t){var n=Se(t[0]),r=Se(t[1]);return n>r&&(n=t[1],r=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]r&&(n=t[1],r=t[0]),e.length?rr&&(e[1]=r),e):[n,r]}};function jM(e,t,n,r){t[0].type!==MC&&oe("First argument to selection functions must be a string literal.");const i=t[0].value,o="unit",a="@"+o,s=":"+i;(t.length>=2&&De(t).value)!==_M||st(r,a)||(r[a]=n.getData(i).indataRef(n,o)),st(r,s)||(r[s]=n.getData(i).tuplesRef())}function MM(e){const t=this.context.data[e];return t?t.values.value:[]}const $M=e=>function(t,n){return this.context.dataflow.locale()[e](n)(t)},NM=$M("format"),BM=$M("timeFormat"),TM=$M("utcFormat"),zM=$M("timeParse"),RM=$M("utcParse"),PM=new Date(2e3,0,1);function LM(e,t,n){return Number.isInteger(e)&&Number.isInteger(t)?(PM.setYear(2e3),PM.setMonth(e),PM.setDate(t),BM.call(this,PM,n)):""}const IM="%",UM="$";function qM(e,t,n,r){t[0].type!==MC&&oe("First argument to data functions must be a string literal.");const i=t[0].value,o=":"+i;if(!st(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(e){}}function WM(e,t,n,r){if(t[0].type===MC)HM(n,r,t[0].value);else for(e in n.scales)HM(n,r,e)}function HM(e,t,n){const r=IM+n;if(!st(t,r))try{t[r]=e.scaleRef(n)}catch(e){}}function GM(e,t){if(Ye(e))return e;if(vt(e)){const r=t.scales[e];return r&&((n=r.value)&&!0===n[Wp])?r.value:void 0}var n}function VM(e,t){return function(n,r,i){if(n){const t=GM(n,(i||this).context);return t&&t.path[e](r)}return t(r)}}const YM=VM("area",(function(e){return Dj=new cw,lw(e,Sj),2*Dj})),XM=VM("bounds",(function(e){var t,n,r,i,o,a,s;if(vj=yj=-(gj=mj=1/0),Aj=[],lw(e,Xj),n=Aj.length){for(Aj.sort(iM),t=1,o=[r=Aj[0]];trM(r[0],r[1])&&(r[1]=i[1]),rM(i[0],r[1])>rM(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,t=0,r=o[n=o.length-1];t<=n;r=i,++t)i=o[t],(s=rM(r[1],i[0]))>a&&(a=s,gj=i[0],yj=r[1])}return Aj=Ej=null,gj===1/0||mj===1/0?[[NaN,NaN],[NaN,NaN]]:[[gj,mj],[yj,vj]]})),ZM=VM("centroid",(function(e){$j=Nj=Bj=Tj=zj=Rj=Pj=Lj=0,Ij=new cw,Uj=new cw,qj=new cw,lw(e,aM);var t=+Ij,n=+Uj,r=+qj,i=Ew(t,n,r);return it$(e,t)}const r$={};function i$(e){return _e(e)||ArrayBuffer.isView(e)?e:null}function o$(e){return i$(e)||(vt(e)?e:null)}const a$=e=>e.data;function s$(e,t){const n=MM.call(t,e);return n.root&&n.root.lookup||{}}const u$=()=>"undefined"!=typeof window&&window||null;function l$(e,t,n){if(!e)return[];const[r,i]=e,o=(new $m).set(r[0],r[1],i[0],i[1]);return lx(n||this.context.dataflow.scenegraph().root,o,function(e){let t=null;if(e){const n=Ge(e.marktype),r=Ge(e.markname);t=e=>(!n.length||n.some((t=>e.marktype===t)))&&(!r.length||r.some((t=>e.name===t)))}return t}(t))}const c$={random:()=>$s(),cumulativeNormal:Ws,cumulativeLogNormal:Zs,cumulativeUniform:nu,densityNormal:qs,densityLogNormal:Xs,densityUniform:tu,quantileNormal:Hs,quantileLogNormal:Js,quantileUniform:ru,sampleNormal:Us,sampleLogNormal:Ys,sampleUniform:eu,isArray:_e,isBoolean:ht,isDate:pt,isDefined:e=>void 0!==e,isNumber:mt,isObject:we,isRegExp:yt,isString:vt,isTuple:Ta,isValid:e=>null!=e&&e==e,toBoolean:St,toDate:e=>Ft(e),toNumber:Se,toString:jt,indexof:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;rit(e),inScope:function(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n},intersect:l$,clampRange:Ve,pinchDistance:function(e){const t=e.touches,n=t[0].clientX-t[1].clientX,r=t[0].clientY-t[1].clientY;return Math.sqrt(n*n+r*r)},pinchAngle:function(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)},screen:function(){const e=u$();return e?e.screen:{}},containerSize:function(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]},windowSize:function(){const e=u$();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]},bandspace:function(e,t,n){return yp(e||0,t||0,n||0)},setdata:function(e,t){const n=this.context.dataflow,r=this.context.data[e].input;return n.pulse(r,n.changeset().remove(de).insert(t)),1},pathShape:function(e){let t=null;return function(n){return n?nm(n,t=t||Hg(e)):e}},panLinear:Be,panLog:Te,panPow:ze,panSymlog:Re,zoomLinear:Le,zoomLog:Ie,zoomPow:Ue,zoomSymlog:qe,encode:function(e,t,n){if(e){const n=this.context.dataflow,r=e.mark.source;n.pulse(r,n.changeset().encode(e,t))}return void 0!==n?n:e},modify:function(e,t,n,r,i,o){const a=this.context.dataflow,s=this.context.data[e],u=s.input,l=a.stamp();let c,f,d=s.changes;if(!1===a._trigger||!(u.value.length||t||r))return 0;if((!d||d.stamp{s.modified=!0,a.pulse(u,d).run()}),!0,1)),n&&(c=!0===n?de:_e(n)||Ta(n)?n:n$(n),d.remove(c)),t&&d.insert(t),r&&(c=n$(r),u.value.some(c)?d.remove(c):d.insert(r)),i)for(f in o)d.modify(i,f,o[f]);return 1},lassoAppend:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;const i=(e=Ge(e))[e.length-1];return void 0===i||Math.sqrt((i[0]-t)**2+(i[1]-n)**2)>r?[...e,[t,n]]:e},lassoPath:function(e){return Ge(e).reduce(((t,n,r)=>{let[i,o]=n;return t+(0==r?`M ${i},${o} `:r===e.length-1?" Z":`L ${i},${o} `)}),"")},intersectLasso:function(e,t,n){const{x:r,y:i,mark:o}=n,a=(new $m).set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[e,n]of t)ea.x2&&(a.x2=e),na.y2&&(a.y2=n);return a.translate(r,i),l$([[a.x1,a.y1],[a.x2,a.y2]],e,o).filter((e=>function(e,t,n){let r=0;for(let i=0,o=n.length-1;it!=s>t&&e<(a-u)*(t-l)/(s-l)+u&&r++}return 1&r}(e.x,e.y,t)))}},f$=["view","item","group","xy","x","y"],d$="this.",h$={},p$={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${Dt(UM+e)}]`,functions:function(e){const t=uj(e);f$.forEach((e=>t[e]="event.vega."+e));for(const e in c$)t[e]=d$+e;return rt(t,function(e,t,n){t.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0,n._bandwidth=WM,n._range=WM,n._scale=WM;const r=t=>"_["+(t.type===MC?Dt(IM+t.value):Dt(IM)+"+"+e(t))+"]";return{_bandwidth:e=>`this.__bandwidth(${r(e[0])})`,_range:e=>`${r(e[0])}.range()`,_scale:t=>`${r(t[0])}(${e(t[1])})`}}(e,c$,h$)),t},constants:sj,visitors:h$},g$=lj(p$);function m$(e,t,n){return 1===arguments.length?c$[e]:(c$[e]=t,n&&(h$[e]=n),g$&&(g$.functions[e]=d$+e),this)}function y$(e,t){const n={};let r;try{r=aj(e=vt(e)?e:Dt(e)+"")}catch(t){oe("Expression parse error: "+e)}r.visit((e=>{if(e.type!==$C)return;const r=e.callee.name,i=p$.visitors[r];i&&i(r,e.arguments,t,n)}));const i=g$(r);return i.globals.forEach((e=>{const r=UM+e;!st(n,r)&&t.getSignal(e)&&(n[r]=t.signalRef(e))})),{$expr:rt({code:i.code},t.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}m$("bandwidth",(function(e,t){const n=GM(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}),WM),m$("copy",(function(e,t){const n=GM(e,(t||this).context);return n?n.copy():void 0}),WM),m$("domain",(function(e,t){const n=GM(e,(t||this).context);return n?n.domain():[]}),WM),m$("range",(function(e,t){const n=GM(e,(t||this).context);return n&&n.range?n.range():[]}),WM),m$("invert",(function(e,t,n){const r=GM(e,(n||this).context);return r?_e(t)?(r.invertRange||r.invert)(t):(r.invert||r.invertExtent)(t):void 0}),WM),m$("scale",(function(e,t,n){const r=GM(e,(n||this).context);return r?r(t):void 0}),WM),m$("gradient",(function(e,t,n,r,i){e=GM(e,(i||this).context);const o=zg(t,n);let a=e.domain(),s=a[0],u=De(a),l=le;return u-s?l=og(e,s,u):e=(e.interpolator?Gp("sequential")().interpolator(e.interpolator()):Gp("linear")().interpolate(e.interpolate()).range(e.range())).domain([s=0,u=1]),e.ticks&&(a=e.ticks(+r||15),s!==a[0]&&a.unshift(s),u!==De(a)&&a.push(u)),a.forEach((t=>o.stop(l(t),e(t)))),o}),WM),m$("geoArea",YM,WM),m$("geoBounds",XM,WM),m$("geoCentroid",ZM,WM),m$("geoShape",(function(e,t,n){const r=GM(e,(n||this).context);return function(e){return r?r.path.context(e)(t):""}}),WM),m$("indata",(function(e,t,n){const r=this.context.data[e]["index:"+t],i=r?r.value.get(n):void 0;return i?i.count:i}),(function(e,t,n,r){t[0].type!==MC&&oe("First argument to indata must be a string literal."),t[1].type!==MC&&oe("Second argument to indata must be a string literal.");const i=t[0].value,o=t[1].value,a="@"+o;st(a,r)||(r[a]=n.getData(i).indataRef(n,o))})),m$("data",MM,qM),m$("treePath",(function(e,t,n){const r=s$(e,this),i=r[t],o=r[n];return i&&o?i.path(o).map(a$):void 0}),qM),m$("treeAncestors",(function(e,t){const n=s$(e,this)[t];return n?n.ancestors().map(a$):void 0}),qM),m$("vlSelectionTest",(function(e,t,n){for(var r,i,o,a,s,u=this.context.data[e],l=u?u.values.value:[],c=u?u[EM]&&u[EM].value:void 0,f=n===_M,d=l.length,h=0;h(e[o[n].field]=t,e)),{}))}else u=kM,l=AM(i),(f=(c=v[u]||(v[u]={}))[s]||(c[s]=[])).push(l),n&&(f=b[s]||(b[s]=[])).push({[kM]:l});return t=t||wM,v[kM]?v[kM]=FM[`${kM}_${t}`](...Object.values(v[kM])):Object.keys(v).forEach((e=>{v[e]=Object.keys(v[e]).map((t=>v[e][t])).reduce(((n,r)=>void 0===n?r:FM[`${x[e]}_${t}`](n,r)))})),y=Object.keys(b),n&&y.length&&(v[r?"vlPoint":"vlMulti"]=t===wM?{or:y.reduce(((e,t)=>(e.push(...b[t]),e)),[])}:{and:y.map((e=>({or:b[e]})))}),v}),jM),m$("vlSelectionTuples",(function(e,t){return e.map((e=>rt(t.fields?{values:t.fields.map((t=>(t.getter||(t.getter=se(t.field)))(e.datum)))}:{[kM]:AM(e.datum)},t)))}));const v$=Mt(["rule"]),b$=Mt(["group","image","rect"]);function x$(e){return(e+"").toLowerCase()}function _$(e,t,n){n.endsWith(";")||(n="return("+n+");");const r=Function(...t.concat(n));return e&&e.functions?r.bind(e.functions):r}var w$={operator:(e,t)=>_$(e,["_"],t.code),parameter:(e,t)=>_$(e,["datum","_"],t.code),event:(e,t)=>_$(e,["event"],t.code),handler:(e,t)=>_$(e,["_","event"],`var datum=event.item&&event.item.datum;return ${t.code};`),encode:(e,t)=>{const{marktype:n,channels:r}=t;let i="var o=item,datum=o.datum,m=0,$;";for(const e in r){const t="o["+Dt(e)+"]";i+=`$=${r[e].code};if(${t}!==$)${t}=$,m=1;`}return i+=function(e,t){let n="";return v$[t]||(e.x2&&(e.x?(b$[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(b$[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(r,n),i+="return m;",_$(e,["item","_"],i)},codegen:{get(e){const t=`[${e.map(Dt).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const r=Function("a","b","var u, v; return "+e.map(((e,r)=>{const i=t[r];let o,a;return e.path?(o=`a${e.path}`,a=`b${e.path}`):((n=n||{})["f"+r]=e,o=`this.f${r}(a)`,a=`this.f${r}(b)`),function(e,t,n,r){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}\n : (u > v || v == null) && u != null ? ${r}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}\n : v !== v && u === u ? ${r} : `}(o,a,-i,i)})).join("")+"0;");return n?r.bind(n):r}}};function k$(e,t,n){if(!e||!we(e))return e;for(let r,i=0,o=A$.length;ie&&e.$tupleid?za:e));return t.fn[n]||(t.fn[n]=Ze(r,e.$order,t.expr.codegen))}},{key:"$context",parse:function(e,t){return t}},{key:"$subflow",parse:function(e,t){const n=e.$subflow;return function(e,r,i){const o=t.fork().parse(n),a=o.get(n.operators[0].id),s=o.signals.parent;return s&&s.set(i),a.detachSubflow=()=>t.detach(o),a}}},{key:"$tupleid",parse:function(){return za}}];const E$={skip:!0};function O$(e,t,n,r){return new D$(e,t,n,r)}function D$(e,t,n,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=r||w$,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function S$(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}function C$(e,t){e&&(null==t?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}D$.prototype=S$.prototype={fork(){const e=new S$(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter((t=>t!==e));const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,r=n.dataflow,i=e.value;if(n.set(e.id,t),"collect"===x$(e.type)&&i&&(i.$ingest?r.ingest(t,i.$ingest,i.$format):i.$request?r.preload(t,i.$request,i.$format):r.pulse(t,r.changeset().insert(i))),e.root&&(n.root=t),e.parent){let i=n.get(e.parent.$ref);i?(r.connect(i,[t]),t.targets().add(i)):(n.unresolved=n.unresolved||[]).push((()=>{i=n.get(e.parent.$ref),r.connect(i,[t]),t.targets().add(i)}))}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const r in e.data){const i=n.data[r]||(n.data[r]={});e.data[r].forEach((e=>i[e]=t))}},resolve(){return(this.unresolved||[]).forEach((e=>e())),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[x$(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,r,i){this.dataflow.on(t,n,r,i,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:function(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach((e=>t.parseOperator(e))),n.forEach((e=>t.parseOperatorParameters(e))),(e.streams||[]).forEach((e=>t.parseStream(e))),(e.updates||[]).forEach((e=>t.parseUpdate(e))),t.resolve()},parseOperator:function(e){const t=this;"operator"!==x$(e.type)&&e.type?t.transform(e,e.type):t.operator(e,e.update?t.operatorExpression(e.update):null)},parseOperatorParameters:function(e){const t=this;if(e.params){const n=t.get(e.id);n||oe("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}},parseParameters:function(e,t){t=t||{};const n=this;for(const r in e){const i=e[r];t[r]=_e(i)?i.map((e=>k$(e,n,t))):k$(i,n,t)}return t},parseStream:function(e){var t,n=this,r=null!=e.filter?n.eventExpression(e.filter):void 0,i=null!=e.stream?n.get(e.stream):void 0;e.source?i=n.events(e.source,e.type,r):e.merge&&(i=(t=e.merge.map((e=>n.get(e))))[0].merge.apply(t[0],t.slice(1))),e.between&&(t=e.between.map((e=>n.get(e))),i=i.between(t[0],t[1])),e.filter&&(i=i.filter(r)),null!=e.throttle&&(i=i.throttle(+e.throttle)),null!=e.debounce&&(i=i.debounce(+e.debounce)),null==i&&oe("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),n.stream(e,i)},parseUpdate:function(e){var t,n=this,r=we(r=e.source)?r.$ref:r,i=n.get(r),o=e.update,a=void 0;i||oe("Source not defined: "+e.source),t=e.target&&e.target.$expr?n.eventExpression(e.target.$expr):n.get(e.target),o&&o.$expr&&(o.$params&&(a=n.parseParameters(o.$params)),o=n.handlerExpression(o.$expr)),n.update(e,i,t,o,a)},getState:function(e){var t=this,n={};if(e.signals){var r=n.signals={};Object.keys(t.signals).forEach((n=>{const i=t.signals[n];e.signals(n,i)&&(r[n]=i.value)}))}if(e.data){var i=n.data={};Object.keys(t.data).forEach((n=>{const r=t.data[n];e.data(n,r)&&(i[n]=r.input.value)}))}return t.subcontext&&!1!==e.recurse&&(n.subcontext=t.subcontext.map((t=>t.getState(e)))),n},setState:function(e){var t=this,n=t.dataflow,r=e.data,i=e.signals;Object.keys(i||{}).forEach((e=>{n.update(t.signals[e],i[e],E$)})),Object.keys(r||{}).forEach((e=>{n.pulse(t.data[e].input,n.changeset().remove(de).insert(r[e]))})),(e.subcontext||[]).forEach(((e,n)=>{const r=t.subcontext[n];r&&r.setState(e)}))}};const F$="default";function j$(e,t){const n=e.globalCursor()?"undefined"!=typeof document&&document.body:e.container();if(n)return null==t?n.style.removeProperty("cursor"):n.style.cursor=t}function M$(e,t){var n=e._runtime.data;return st(n,t)||oe("Unrecognized data set: "+t),n[t]}function $$(e,t){Wa(t)||oe("Second argument to changes must be a changeset.");const n=M$(this,e);return n.modified=!0,this.pulse(n.input,t)}function N$(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function B$(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function T$(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}const z$="view",R$={trap:!1};function P$(e,t,n,r){e._eventListeners.push({type:n,sources:Ge(t),handler:r})}function L$(e,t,n){const r=e._eventConfig&&e._eventConfig[t];return!(!1===r||we(r)&&!r[n])||(e.warn(`Blocked ${t} ${n} event listener.`),!1)}function I$(e){return e.item}function U$(e){return e.item.mark.source}function q$(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function W$(e,t,n){const r=document.createElement(e);for(const e in t)r.setAttribute(e,t[e]);return null!=n&&(r.textContent=n),r}const H$="vega-bind-radio";function G$(e,t,n,r){const i=n.event||"input",o=()=>e.update(t.value);r.signal(n.signal,t.value),t.addEventListener(i,o),P$(r,t,i,o),e.set=e=>{t.value=e,t.dispatchEvent(function(e){return"undefined"!=typeof Event?new Event(e):{type:e}}(i))}}function V$(e,t,n,r){const i=r.signal(n.signal),o=W$("div",{class:"vega-bind"}),a="radio"===n.input?o:o.appendChild(W$("label"));a.appendChild(W$("span",{class:"vega-bind-name"},n.name||n.signal)),t.appendChild(o);let s=Y$;switch(n.input){case"checkbox":s=X$;break;case"select":s=Z$;break;case"radio":s=J$;break;case"range":s=K$}s(e,a,n,i)}function Y$(e,t,n,r){const i=W$("input");for(const e in n)"signal"!==e&&"element"!==e&&i.setAttribute("input"===e?"type":e,n[e]);i.setAttribute("name",n.signal),i.value=r,t.appendChild(i),i.addEventListener("input",(()=>e.update(i.value))),e.elements=[i],e.set=e=>i.value=e}function X$(e,t,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=W$("input",i);t.appendChild(o),o.addEventListener("change",(()=>e.update(o.checked))),e.elements=[o],e.set=e=>o.checked=!!e||null}function Z$(e,t,n,r){const i=W$("select",{name:n.signal}),o=n.labels||[];n.options.forEach(((e,t)=>{const n={value:e};Q$(e,r)&&(n.selected=!0),i.appendChild(W$("option",n,(o[t]||e)+""))})),t.appendChild(i),i.addEventListener("change",(()=>{e.update(n.options[i.selectedIndex])})),e.elements=[i],e.set=e=>{for(let t=0,r=n.options.length;t{const s={type:"radio",name:n.signal,value:t};Q$(t,r)&&(s.checked=!0);const u=W$("input",s);u.addEventListener("change",(()=>e.update(t)));const l=W$("label",{},(o[a]||t)+"");return l.prepend(u),i.appendChild(l),u})),e.set=t=>{const n=e.elements,r=n.length;for(let e=0;e{u.textContent=s.value,e.update(+s.value)};s.addEventListener("input",l),s.addEventListener("change",l),e.elements=[s],e.set=e=>{s.value=e,u.textContent=e}}function Q$(e,t){return e===t||e+""==t+""}function eN(e,t,n,r,i,o){return(t=t||new r(e.loader())).initialize(n,N$(e),B$(e),T$(e),i,o).background(e.background())}function tN(e,t){return t?function(){try{t.apply(this,arguments)}catch(t){e.error(t)}}:null}function nN(e,t,n){if("string"==typeof t){if("undefined"==typeof document)return e.error("DOM document instance not found."),null;if(!(t=document.querySelector(t)))return e.error("Signal bind element not found: "+t),null}if(t&&n)try{t.textContent=""}catch(n){t=null,e.error(n)}return t}const rN=e=>+e||0;function iN(e){return we(e)?{top:rN(e.top),bottom:rN(e.bottom),left:rN(e.left),right:rN(e.right)}:(e=>({top:e,bottom:e,left:e,right:e}))(rN(e))}async function oN(e,t,n,r){const i=ux(t),o=i&&i.headless;return o||oe("Unrecognized renderer type: "+t),await e.runAsync(),eN(e,null,null,o,n,r).renderAsync(e._scenegraph.root)}var aN="width",sN="height",uN="padding",lN={skip:!0};function cN(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===uN?r.left+r.right:0)}function fN(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===uN?r.top+r.bottom:0)}function dN(e,t){return t.modified&&_e(t.input.value)&&e.indexOf("_:vega:_")}function hN(e,t){return!("parent"===e||t instanceof ms.proxy)}function pN(e,t,n,r){const i=e.element();i&&i.setAttribute("title",function(e){return null==e?"":_e(e)?gN(e):we(e)&&!pt(e)?(t=e,Object.keys(t).map((e=>{const n=t[e];return e+": "+(_e(n)?gN(n):mN(n))})).join("\n")):e+"";var t}(r))}function gN(e){return"["+e.map(mN).join(", ")+"]"}function mN(e){return _e(e)?"[…]":we(e)&&!pt(e)?"{…}":e}function yN(e,t){const n=this;if(t=t||{},hs.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),null!=t.logLevel&&n.logLevel(t.logLevel),t.locale||e.locale){const r=rt({},e.locale,t.locale);n.locale(na(r.number,r.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||ax.Canvas,n._scenegraph=new Rv;const r=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||pN,n._redraw=!0,n._handler=(new cb).scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(e){const t=rt({defaults:{}},e),n=(e,t)=>{t.forEach((t=>{_e(e[t])&&(e[t]=Mt(e[t]))}))};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=function(e,t,n){return O$(e,ms,c$,n).parse(t)}(n,e,t.expr);n._runtime=i,n._signals=i.signals,n._bind=(e.bindings||[]).map((e=>({state:null,param:rt({},e)}))),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=cN(n,n._width),n._viewHeight=fN(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(e){var t=e._signals,n=t[aN],r=t[sN],i=t[uN];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,(t=>{e._width=t.size,e._viewWidth=cN(e,t.size),o()}),{size:n}),e._resizeHeight=e.add(null,(t=>{e._height=t.size,e._viewHeight=fN(e,t.size),o()}),{size:r});const a=e.add(null,o,{pad:i});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=r.rank+1,a.rank=i.rank+1}(n),function(e){e.add(null,(t=>(e._background=t.bg,e._resize=1,t.bg)),{bg:e._signals.background})}(n),function(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:F$,item:null}));e.on(e.events("view","mousemove"),t,((e,n)=>{const r=t.value,i=r?vt(r)?r:r.user:F$,o=n.item&&n.item.cursor||null;return r&&i===r.user&&o==r.item?r:{user:i,item:o}})),e.add(null,(function(t){let n=t.cursor,r=this.value;return vt(n)||(r=n.item,n=n.user),j$(e,n&&n!==F$?n:r||n),r}),{cursor:t})}(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind)}function vN(e,t){return st(e._signals,t)?e._signals[t]:oe("Unrecognized signal name: "+Dt(t))}function bN(e,t){const n=(e._targets||[]).filter((e=>e._update&&e._update.handler===t));return n.length?n[0]:null}function xN(e,t,n,r){let i=bN(n,r);return i||(i=tN(e,(()=>r(t,n.value))),i.handler=r,e.on(n,null,i)),e}function _N(e,t,n){const r=bN(t,n);return r&&t._targets.remove(r),e}ft(yN,hs,{async evaluate(e,t,n){if(await hs.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,i=T$(r=this),o=N$(r),a=B$(r),r._renderer.background(r.background()),r._renderer.resize(o,a,i),r._handler.origin(i),r._resizeListeners.forEach((e=>{try{e(o,a)}catch(e){r.error(e)}}))),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(e){this.error(e)}var r,i,o,a;return n&&$a(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=null!=e?e+"":null;return t!==this._desc&&C$(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const r=vN(this,e);return 1===arguments.length?r.value:this.update(r,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",iN(e)):iN(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(ux(e)||oe("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(hs.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(vN(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function(e,t,n,r,i,o){this.runAfter((a=>{let s=0;a._autosize=0,a.width()!==n&&(s=1,a.signal(aN,n,lN),a._resizeWidth.skip(!0)),a.height()!==r&&(s=1,a.signal(sN,r,lN),a._resizeHeight.skip(!0)),a._viewWidth!==e&&(a._resize=1,a._viewWidth=e),a._viewHeight!==t&&(a._resize=1,a._viewHeight=t),a._origin[0]===i[0]&&a._origin[1]===i[1]||(a._resize=1,a._origin=i),s&&a.run("enter"),o&&a.runAfter((e=>e.resize()))}),!1,1)},addEventListener(e,t,n){let r=t;return n&&!1===n.trap||(r=tN(this,t),r.raw=t),this._handler.on(e,r),this},removeEventListener(e,t){for(var n,r,i=this._handler.handlers(e),o=i.length;--o>=0;)if(r=i[o].type,n=i[o].handler,e===r&&(t===n||t===n.raw)){this._handler.off(r,n);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.indexOf(e)<0&&t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return xN(this,e,vN(this,e),t)},removeSignalListener(e,t){return _N(this,vN(this,e),t)},addDataListener(e,t){return xN(this,e,M$(this,e).values,t)},removeDataListener(e,t){return _N(this,M$(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=j$(this,null);this._globalCursor=!!e,t&&j$(this,t)}return this}return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:function(e,t){this._timers.push(function(e,t,n){var r=new AO,i=t;return null==t?(r.restart(e,t,n),r):(r._restart=r.restart,r.restart=function(e,t,n){t=+t,n=null==n?wO():+n,r._restart((function o(a){a+=i,r._restart(o,i+=t,n),e(a)}),t,n)},r.restart(e,t,n),r)}((function(t){e({timestamp:Date.now(),elapsed:t})}),t))},events:function(e,t,n){var r,i=this,o=new Qa(n),a=function(n,r){i.runAsync(null,(()=>{e===z$&&function(e,t){var n=e._eventConfig.defaults,r=n.prevent,i=n.allow;return!1!==r&&!0!==i&&(!0===r||!1===i||(r?r[t]:i?!i[t]:e.preventDefault()))}(i,t)&&n.preventDefault(),o.receive(function(e,t,n){var r,i,o=e._renderer,a=o&&o.canvas();return a&&(i=T$(e),(r=Hv(t.changedTouches?t.changedTouches[0]:t,a))[0]-=i[0],r[1]-=i[1]),t.dataflow=e,t.item=n,t.vega=function(e,t,n){const r=t?"group"===t.mark.marktype?t:t.mark.group:null;function i(e){var n,i=r;if(e)for(n=t;n;n=n.mark.group)if(n.mark.name===e){i=n;break}return i&&i.mark&&i.mark.interactive?i:{}}function o(e){if(!e)return n;vt(e)&&(e=i(e));const t=n.slice();for(;e;)t[0]-=e.x||0,t[1]-=e.y||0,e=e.mark&&e.mark.group;return t}return{view:tt(e),item:tt(t||{}),group:i,xy:o,x:e=>o(e)[0],y:e=>o(e)[1]}}(e,n,r),t}(i,n,r))}))};if("timer"===e)L$(i,"timer",t)&&i.timer(a,t);else if(e===z$)L$(i,"view",t)&&i.addEventListener(t,a,R$);else if("window"===e?L$(i,"window",t)&&"undefined"!=typeof window&&(r=[window]):"undefined"!=typeof document&&L$(i,"selector",t)&&(r=Array.from(document.querySelectorAll(e))),r){for(var s=0,u=r.length;s=0;)i[e].stop();for(e=o.length;--e>=0;)for(t=(n=o[e]).sources.length;--t>=0;)n.sources[t].removeEventListener(n.type,n.handler);return r&&r.call(this,this._handler,null,null,null),this},hover:function(e,t){return t=[t||"update",(e=[e||"hover"])[0]],this.on(this.events("view","mouseover",I$),U$,q$(e)),this.on(this.events("view","mouseout",I$),U$,q$(t)),this},data:function(e,t){return arguments.length<2?M$(this,e).values.value:$$.call(this,e,Ha().remove(de).insert(t))},change:$$,insert:function(e,t){return $$.call(this,e,Ha().insert(t))},remove:function(e,t){return $$.call(this,e,Ha().remove(t))},scale:function(e){var t=this._runtime.scales;return st(t,e)||oe("Unrecognized scale or projection: "+e),t[e].value},initialize:function(e,t){const n=this,r=n._renderType,i=n._eventConfig.bind,o=ux(r);e=n._el=e?nN(n,e,!0):null,function(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),C$(t,e.description()))}(n),o||n.error("Unrecognized renderer type: "+r);const a=o.handler||cb,s=e?o.renderer:o.headless;return n._renderer=s?eN(n,n._renderer,e,s):null,n._handler=function(e,t,n,r){const i=new r(e.loader(),tN(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,T$(e),e);return t&&t.handlers().forEach((e=>{i.on(e.type,e.handler)})),i}(n,n._handler,e,a),n._redraw=!0,e&&"none"!==i&&(t=t?n._elBind=nN(n,t,!0):e.appendChild(W$("form",{class:"vega-bindings"})),n._bind.forEach((e=>{e.param.element&&"container"!==i&&(e.element=nN(n,e.param.element,!!e.param.input))})),n._bind.forEach((e=>{!function(e,t,n){if(!t)return;const r=n.param;let i=n.state;i||(i=n.state={elements:null,active:!1,set:null,update:t=>{t!=e.signal(r.signal)&&e.runAsync(null,(()=>{i.source=!0,e.signal(r.signal,t)}))}},r.debounce&&(i.update=nt(r.debounce,i.update))),(null==r.input&&r.element?G$:V$)(i,t,r,e),i.active||(e.on(e._signals[r.signal],null,(()=>{i.source?i.source=!1:i.set(e.signal(r.signal))})),i.active=!0)}(n,e.element||t,e)}))),n},toImageURL:async function(e,t){e!==ax.Canvas&&e!==ax.SVG&&e!==ax.PNG&&oe("Unrecognized image type: "+e);const n=await oN(this,e,t);return e===ax.SVG?function(e,t){const n=new Blob([e],{type:"image/svg+xml"});return window.URL.createObjectURL(n)}(n.svg()):n.canvas().toDataURL("image/png")},toCanvas:async function(e,t){return(await oN(this,ax.Canvas,e,t)).canvas()},toSVG:async function(e){return(await oN(this,ax.SVG,e)).svg()},getState:function(e){return this._runtime.getState(e||{data:dN,signals:hN,recurse:!0})},setState:function(e){return this.runAsync(null,(t=>{t._trigger=!1,t._runtime.setState(e)}),(e=>{e._trigger=!0})),this}});const wN="view",kN="[",AN="]",EN="{",ON="}",DN=":",SN=",",CN="@",FN=">",jN=/[[\]{}]/,MN={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let $N,NN;function BN(e,t,n){return $N=t||wN,NN=n||MN,zN(e.trim()).map(RN)}function TN(e,t,n,r,i){const o=e.length;let a,s=0;for(;t=0?--s:r&&r.indexOf(a)>=0&&++s}return t}function zN(e){const t=[],n=e.length;let r=0,i=0;for(;i' after between selector: "+e;n=n.map(RN);const i=RN(e.slice(1).trim());return i.between?{between:n,stream:i}:(i.between=n,i)}(e):function(e){const t={source:$N},n=[];let r,i,o=[0,0],a=0,s=0,u=e.length,l=0;if(e[u-1]===ON){if(l=e.lastIndexOf(EN),!(l>=0))throw"Unmatched right brace: "+e;try{o=function(e){const t=e.split(SN);if(!e.length||t.length>2)throw e;return t.map((t=>{const n=+t;if(n!=n)throw e;return n}))}(e.substring(l+1,u-1))}catch(t){throw"Invalid throttle specification: "+e}u=(e=e.slice(0,l).trim()).length,l=0}if(!u)throw e;if(e[0]===CN&&(a=++l),r=TN(e,l,DN),r1?(t.type=n[1],a?t.markname=n[0].slice(1):(c=n[0],NN[c]?t.marktype=n[0]:t.source=n[0])):t.type=n[0],"!"===t.type.slice(-1)&&(t.consume=!0,t.type=t.type.slice(0,-1)),null!=i&&(t.filter=i),o[0]&&(t.throttle=o[0]),o[1]&&(t.debounce=o[1]),t}(e)}function PN(e){return we(e)?e:{type:e||"pad"}}const LN=e=>+e||0,IN=e=>({top:e,bottom:e,left:e,right:e});function UN(e){return we(e)?e.signal?e:{top:LN(e.top),bottom:LN(e.bottom),left:LN(e.left),right:LN(e.right)}:IN(LN(e))}const qN=e=>we(e)&&!_e(e)?rt({},e):{value:e};function WN(e,t,n,r){return null!=n?(we(n)&&!_e(n)||_e(n)&&n.length&&we(n[0])?e.update[t]=n:e[r||"enter"][t]={value:n},1):0}function HN(e,t,n){for(const n in t)WN(e,n,t[n]);for(const t in n)WN(e,t,n[t],"update")}function GN(e,t,n){for(const r in t)n&&st(n,r)||(e[r]=rt(e[r]||{},t[r]));return e}function VN(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const YN="mark",XN="frame",ZN="scope",JN="axis",KN="axis-domain",QN="axis-grid",eB="axis-label",tB="axis-tick",nB="axis-title",rB="legend",iB="legend-band",oB="legend-entry",aB="legend-gradient",sB="legend-label",uB="legend-symbol",lB="legend-title",cB="title",fB="title-text",dB="title-subtitle";function hB(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const pB=e=>vt(e)?Dt(e):e.signal?`(${e.signal})`:vB(e);function gB(e){if(null!=e.gradient)return function(e){const t=[e.start,e.stop,e.count].map((e=>null==e?null:Dt(e)));for(;t.length&&null==De(t);)t.pop();return t.unshift(pB(e.gradient)),`gradient(${t.join(",")})`}(e);let t=e.signal?`(${e.signal})`:e.color?function(e){return e.c?mB("hcl",e.h,e.c,e.l):e.h||e.s?mB("hsl",e.h,e.s,e.l):e.l||e.a?mB("lab",e.l,e.a,e.b):e.r||e.g||e.b?mB("rgb",e.r,e.g,e.b):null}(e.color):null!=e.field?vB(e.field):void 0!==e.value?Dt(e.value):void 0;return null!=e.scale&&(t=function(e,t){const n=pB(e.scale);return null!=e.range?t=`lerp(_range(${n}), ${+e.range})`:(void 0!==t&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(1==+e.band?"":"*"+yB(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),null==t&&(t="0")),t}(e,t)),void 0===t&&(t=null),null!=e.exponent&&(t=`pow(${t},${yB(e.exponent)})`),null!=e.mult&&(t+=`*${yB(e.mult)}`),null!=e.offset&&(t+=`+${yB(e.offset)}`),e.round&&(t=`round(${t})`),t}const mB=(e,t,n,r)=>`(${e}(${[t,n,r].map(gB).join(",")})+'')`;function yB(e){return we(e)?"("+gB(e)+")":e}function vB(e){return bB(we(e)?e:{datum:e})}function bB(e){let t,n,r;if(e.signal)t="datum",r=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(r=e.parent,t+=".datum"):r=e.group}else e.datum?(t="datum",r=e.datum):oe("Invalid field reference: "+Dt(e));return e.signal||(r=vt(r)?ae(r).map(Dt).join("]["):bB(r)),t+"["+r+"]"}function xB(e,t,n,r,i,o){const a={};(o=o||{}).encoders={$encode:a},e=function(e,t,n,r,i){const o={},a={};let s,u,l,c;for(u in u="lineBreak","text"!==t||null==i[u]||VN(u,e)||hB(o,u,i[u]),("legend"==n||String(n).startsWith("axis"))&&(n=null),c=n===XN?i.group:n===YN?rt({},i.mark,i[t]):null,c)l=VN(u,e)||("fill"===u||"stroke"===u)&&(VN("fill",e)||VN("stroke",e)),l||hB(o,u,c[u]);for(u in Ge(r).forEach((t=>{const n=i.style&&i.style[t];for(const t in n)VN(t,e)||hB(o,t,n[t])})),e=rt({},e),o)c=o[u],c.signal?(s=s||{})[u]=c:a[u]=c;return e.enter=rt(a,e.enter),s&&(e.update=rt(s,e.update)),e}(e,t,n,r,i.config);for(const n in e)a[n]=_B(e[n],t,o,i);return o}function _B(e,t,n,r){const i={},o={};for(const t in e)null!=e[t]&&(i[t]=wB((a=e[t],_e(a)?function(e){let t="";return e.forEach((e=>{const n=gB(e);t+=e.test?`(${e.test})?${n}:`:n})),":"===De(t)&&(t+="null"),t}(a):gB(a)),r,n,o));var a;return{$expr:{marktype:t,channels:i},$fields:Object.keys(o),$output:Object.keys(e)}}function wB(e,t,n,r){const i=y$(e,t);return i.$fields.forEach((e=>r[e]=1)),rt(n,i.$params),i.$expr}const kB="outer",AB=["value","update","init","react","bind"];function EB(e,t){oe(e+' for "outer" push: '+Dt(t))}function OB(e,t){const n=e.name;if(e.push===kB)t.signals[n]||EB("No prior signal definition",n),AB.forEach((t=>{void 0!==e[t]&&EB("Invalid property ",t)}));else{const r=t.addSignal(n,e.value);!1===e.react&&(r.react=!1),e.bind&&t.addBinding(n,e.bind)}}function DB(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function SB(e,t,n,r){return new DB(e,t,n,r)}function CB(e,t){return SB("operator",e,t)}function FB(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function jB(e,t){return t?{$field:e,$name:t}:{$field:e}}const MB=jB("key");function $B(e,t){return{$compare:e,$order:t}}function NB(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const BB="scope",TB="view";function zB(e){return e&&e.signal}function RB(e){if(zB(e))return!0;if(we(e))for(const t in e)if(RB(e[t]))return!0;return!1}function PB(e,t){return null!=e?e:t}function LB(e){return e&&e.signal||e}const IB="timer";function UB(e,t){return(e.merge?qB:e.stream?WB:e.type?HB:oe("Invalid stream specification: "+Dt(e)))(e,t)}function qB(e,t){const n=GB({merge:e.merge.map((e=>UB(e,t)))},e,t);return t.addStream(n).id}function WB(e,t){const n=GB({stream:UB(e.stream,t)},e,t);return t.addStream(n).id}function HB(e,t){let n;var r;e.type===IB?(n=t.event(IB,e.throttle),e={between:e.between,filter:e.filter}):n=t.event((r=e.source)===BB?TB:r||TB,e.type);const i=GB({stream:n},e,t);return 1===Object.keys(i).length?n:t.addStream(i).id}function GB(e,t,n){let r=t.between;return r&&(2!==r.length&&oe('Stream "between" parameter must have 2 entries: '+Dt(t)),e.between=[UB(r[0],n),UB(r[1],n)]),r=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&r.push(function(e,t,n){const r="event.item";return r+(e&&"*"!==e?"&&"+r+".mark.marktype==='"+e+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(t?"&&"+r+".mark.name==='"+t+"'":"")}(t.marktype,t.markname,t.markrole)),t.source===BB&&r.push("inScope(event.item)"),r.length&&(e.filter=y$("("+r.join(")&&(")+")",n).$expr),null!=(r=t.throttle)&&(e.throttle=+r),null!=(r=t.debounce)&&(e.debounce=+r),t.consume&&(e.consume=!0),e}const VB={code:"_.$value",ast:{type:"Identifier",value:"value"}};function YB(e){return{signal:"["+e.map((e=>e.scale?'scale("'+e.scale+'")':e.signal))+"]"}}const XB=e=>(t,n,r)=>SB(e,n,t||void 0,r),ZB=XB("aggregate"),JB=XB("axisticks"),KB=XB("bound"),QB=XB("collect"),eT=XB("compare"),tT=XB("datajoin"),nT=XB("encode"),rT=XB("expression"),iT=XB("facet"),oT=XB("field"),aT=XB("key"),sT=XB("legendentries"),uT=XB("load"),lT=XB("mark"),cT=XB("multiextent"),fT=XB("multivalues"),dT=XB("overlap"),hT=XB("params"),pT=XB("prefacet"),gT=XB("projection"),mT=XB("proxy"),yT=XB("relay"),vT=XB("render"),bT=XB("scale"),xT=XB("sieve"),_T=XB("sortitems"),wT=XB("viewlayout"),kT=XB("values");let AT=0;const ET={min:"min",max:"max",count:"sum"};function OT(e,t){const n=t.getScale(e.name).params;let r;for(r in n.domain=FT(e.domain,e,t),null!=e.range&&(n.range=RT(e,t,n)),null!=e.interpolate&&function(e,t){t.interpolate=DT(e.type||e),null!=e.gamma&&(t.interpolateGamma=DT(e.gamma))}(e.interpolate,n),null!=e.nice&&(n.nice=function(e){return we(e)?{interval:DT(e.interval),step:DT(e.step)}:DT(e)}(e.nice)),null!=e.bins&&(n.bins=function(e,t){return e.signal||_e(e)?ST(e,t):t.objectProperty(e)}(e.bins,t)),e)st(n,r)||"name"===r||(n[r]=DT(e[r],t))}function DT(e,t){return we(e)?e.signal?t.signalRef(e.signal):oe("Unsupported object: "+Dt(e)):e}function ST(e,t){return e.signal?t.signalRef(e.signal):e.map((e=>DT(e,t)))}function CT(e){oe("Can not find data set: "+Dt(e))}function FT(e,t,n){if(e)return e.signal?n.signalRef(e.signal):(_e(e)?jT:e.fields?$T:MT)(e,t,n);null==t.domainMin&&null==t.domainMax||oe("No scale domain defined for domainMin/domainMax to override.")}function jT(e,t,n){return e.map((e=>DT(e,n)))}function MT(e,t,n){const r=n.getData(e.data);return r||CT(e.data),Zp(t.type)?r.valuesRef(n,e.field,BT(e.sort,!1)):eg(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function $T(e,t,n){const r=e.data,i=e.fields.reduce(((e,t)=>(t=vt(t)?{data:r,field:t}:_e(t)||t.signal?function(e,t){const n="_:vega:_"+AT++,r=QB({});if(_e(e))r.value={$ingest:e};else if(e.signal){const i="setdata("+Dt(n)+","+e.signal+")";r.params.input=t.signalRef(i)}return t.addDataPipeline(n,[r,xT({})]),{data:n,field:"data"}}(t,n):t,e.push(t),e)),[]);return(Zp(t.type)?NT:eg(t.type)?TT:zT)(e,n,i)}function NT(e,t,n){const r=BT(e.sort,!0);let i,o;const a=n.map((e=>{const n=t.getData(e.data);return n||CT(e.data),n.countsRef(t,e.field,r)})),s={groupby:MB,pulse:a};r&&(i=r.op||"count",o=r.field?NB(i,r.field):"count",s.ops=[ET[i]],s.fields=[t.fieldRef(o)],s.as=[o]),i=t.add(ZB(s));const u=t.add(QB({pulse:FB(i)}));return o=t.add(kT({field:MB,sort:t.sortRef(r),pulse:FB(u)})),FB(o)}function BT(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field&&e.op&&!ET[e.op]&&oe("Multiple domain scales can not be sorted using "+e.op):oe("No field provided for sort aggregate op: "+e.op):we(e)?e.field="key":e={field:"key"}),e}function TT(e,t,n){const r=n.map((e=>{const n=t.getData(e.data);return n||CT(e.data),n.domainRef(t,e.field)}));return FB(t.add(fT({values:r})))}function zT(e,t,n){const r=n.map((e=>{const n=t.getData(e.data);return n||CT(e.data),n.extentRef(t,e.field)}));return FB(t.add(cT({extents:r})))}function RT(e,t,n){const r=t.config.range;let i=e.range;if(i.signal)return t.signalRef(i.signal);if(vt(i)){if(r&&st(r,i))return RT(e=rt({},e,{range:r[i]}),t,n);"width"===i?i=[0,{signal:"width"}]:"height"===i?i=Zp(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:oe("Unrecognized scale range value: "+Dt(i))}else{if(i.scheme)return n.scheme=_e(i.scheme)?ST(i.scheme,t):DT(i.scheme,t),i.extent&&(n.schemeExtent=ST(i.extent,t)),void(i.count&&(n.schemeCount=DT(i.count,t)));if(i.step)return void(n.rangeStep=DT(i.step,t));if(Zp(e.type)&&!_e(i))return FT(i,e,t);_e(i)||oe("Unsupported range type: "+Dt(i))}return i.map((e=>(_e(e)?ST:DT)(e,t)))}function PT(e,t,n){return _e(e)?e.map((e=>PT(e,t,n))):we(e)?e.signal?n.signalRef(e.signal):"fit"===t?e:oe("Unsupported parameter object: "+Dt(e)):e}const LT="top",IT="left",UT="right",qT="bottom",WT="center",HT="vertical",GT="start",VT="end",YT="index",XT="label",ZT="offset",JT="perc",KT="perc2",QT="value",ez="guide-label",tz="guide-title",nz="group-title",rz="group-subtitle",iz="symbol",oz="gradient",az="discrete",sz="size",uz=[sz,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],lz={name:1,style:1,interactive:1},cz={value:0},fz={value:1},dz="group",hz="rect",pz="rule",gz="symbol",mz="text";function yz(e){return e.type=dz,e.interactive=e.interactive||!1,e}function vz(e,t){const n=(n,r)=>PB(e[n],PB(t[n],r));return n.isVertical=n=>HT===PB(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>PB(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>PB(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>PB(e.columns,PB(t.columns,+n.isVertical(!0))),n}function bz(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function xz(e,t,n){return`item.anchor === '${GT}' ? ${e} : item.anchor === '${VT}' ? ${t} : ${n}`}const _z=xz(Dt(IT),Dt(UT),Dt(WT));function wz(e,t){return t?e?we(e)?Object.assign({},e,{offset:wz(e.offset,t)}):{value:e,offset:t}:t:e}function kz(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=GN(e.encode,t,lz)):e.interactive=!1,e}function Az(e,t,n,r){const i=vz(e,n),o=i.isVertical(),a=i.gradientThickness(),s=i.gradientLength();let u,l,c,f,d;o?(l=[0,1],c=[0,0],f=a,d=s):(l=[0,0],c=[1,0],f=s,d=a);const h={enter:u={opacity:cz,x:cz,y:cz,width:qN(f),height:qN(d)},update:rt({},u,{opacity:fz,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:cz}};return HN(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),kz({type:hz,role:aB,encode:h},r)}function Ez(e,t,n,r,i){const o=vz(e,n),a=o.isVertical(),s=o.gradientThickness(),u=o.gradientLength();let l,c,f,d,h="";a?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const p={opacity:cz,fill:{scale:t,field:QT}};p[l]={signal:h+"datum."+JT,mult:u},p[c]=cz,p[f]={signal:h+"datum."+KT,mult:u},p[d]=qN(s);const g={enter:p,update:rt({},p,{opacity:fz}),exit:{opacity:cz}};return HN(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),kz({type:hz,role:iB,key:QT,from:i,encode:g},r)}const Oz=`datum.${JT}<=0?"${IT}":datum.${JT}>=1?"${UT}":"${WT}"`,Dz=`datum.${JT}<=0?"${qT}":datum.${JT}>=1?"${LT}":"middle"`;function Sz(e,t,n,r){const i=vz(e,t),o=i.isVertical(),a=qN(i.gradientThickness()),s=i.gradientLength();let u,l,c,f,d=i("labelOverlap"),h="";const p={enter:u={opacity:cz},update:l={opacity:fz,text:{field:XT}},exit:{opacity:cz}};return HN(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:PB(e.labelLimit,t.gradientLabelLimit)}),o?(u.align={value:"left"},u.baseline=l.baseline={signal:Dz},c="y",f="x",h="1-"):(u.align=l.align={signal:Oz},u.baseline={value:"top"},c="x",f="y"),u[c]=l[c]={signal:h+"datum."+JT,mult:s},u[f]=l[f]=a,a.offset=PB(e.labelOffset,t.gradientLabelOffset)||0,d=d?{separation:i("labelSeparation"),method:d,order:"datum."+YT}:void 0,kz({type:mz,role:sB,style:ez,key:QT,from:r,encode:p,overlap:d},n)}function Cz(e,t,n,r,i){const o=vz(e,t),a=n.entries,s=!(!a||!a.interactive),u=a?a.name:void 0,l=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},d=`(${i}) ? datum.${ZT} : datum.${sz}`,h=l?qN(l):{field:sz},p=`datum.${YT}`,g=`max(1, ${i})`;let m,y,v,b,x;h.mult=.5,m={enter:y={opacity:cz,x:{signal:d,mult:.5,offset:c},y:h},update:v={opacity:fz,x:y.x,y:y.y},exit:{opacity:cz}};let _=null,w=null;e.fill||(_=t.symbolBaseFillColor,w=t.symbolBaseStrokeColor),HN(m,{fill:o("symbolFillColor",_),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",w),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),uz.forEach((t=>{e[t]&&(v[t]=y[t]={scale:e[t],field:QT})}));const k=kz({type:gz,role:uB,key:QT,from:f,clip:!!l||void 0,encode:m},n.symbols),A=qN(c);A.offset=o("labelOffset"),m={enter:y={opacity:cz,x:{signal:d,offset:A},y:h},update:v={opacity:fz,text:{field:XT},x:y.x,y:y.y},exit:{opacity:cz}},HN(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const E=kz({type:mz,role:sB,style:ez,key:QT,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:cz,height:l?qN(l):cz,opacity:cz},exit:{opacity:cz},update:v={opacity:fz,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(b=`ceil(item.mark.items.length / ${g})`,v.row.signal=`${p}%${b}`,v.column.signal=`floor(${p} / ${b})`,x={field:["row",p]}):(v.row.signal=`floor(${p} / ${g})`,v.column.signal=`${p} % ${g}`,x={field:p}),v.column.signal=`(${i})?${v.column.signal}:${p}`,yz({role:ZN,from:r={facet:{data:r,name:"value",groupby:YT}},encode:GN(m,a,lz),marks:[k,E],name:u,interactive:s,sort:x})}const Fz='item.orient === "left"',jz='item.orient === "right"',Mz=`(${Fz} || ${jz})`,$z=`datum.vgrad && ${Mz}`,Nz=xz('"top"','"bottom"','"middle"'),Bz=`datum.vgrad && ${jz} ? (${xz('"right"','"left"','"center"')}) : (${Mz} && !(datum.vgrad && ${Fz})) ? "left" : ${_z}`,Tz=`item._anchor || (${Mz} ? "middle" : "start")`,zz=`${$z} ? (${Fz} ? -90 : 90) : 0`,Rz=`${Mz} ? (datum.vgrad ? (${jz} ? "bottom" : "top") : ${Nz}) : "top"`;function Pz(e,t){let n;return we(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+Lz(e.path)+")":e.sphere&&(n="geoShape("+Lz(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function Lz(e){return we(e)&&e.signal?e.signal:Dt(e)}function Iz(e){const t=e.role||"";return t.indexOf("axis")&&t.indexOf("legend")&&t.indexOf("title")?e.type===dz?ZN:t||YN:t}function Uz(e){return{marktype:e.type,name:e.name||void 0,role:e.role||Iz(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function qz(e,t){return e&&e.signal?t.signalRef(e.signal):!1!==e}function Wz(e,t){const n=ys(e.type);n||oe("Unrecognized transform type: "+Dt(e.type));const r=SB(n.type.toLowerCase(),null,Hz(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(r)),r.metadata=n.metadata||{},r}function Hz(e,t,n){const r={},i=e.params.length;for(let o=0;oYz(e,t,n)))):Yz(e,r,n)}(e,t,n):"projection"===r?n.projectionRef(t[e.name]):e.array&&!zB(i)?i.map((t=>Vz(e,t,n))):Vz(e,i,n):void(e.required&&oe("Missing required "+Dt(t.type)+" parameter: "+Dt(e.name)))}function Vz(e,t,n){const r=e.type;if(zB(t))return Kz(r)?oe("Expression references can not be signals."):Qz(r)?n.fieldRef(t):eR(r)?n.compareRef(t):n.signalRef(t.signal);{const i=e.expr||Qz(r);return i&&Xz(t)?n.exprRef(t.expr,t.as):i&&Zz(t)?jB(t.field,t.as):Kz(r)?y$(t,n):Jz(r)?FB(n.getData(t).values):Qz(r)?jB(t):eR(r)?n.compareRef(t):t}}function Yz(e,t,n){const r=e.params.length;let i;for(let n=0;ne&&e.expr,Zz=e=>e&&e.field,Jz=e=>"data"===e,Kz=e=>"expr"===e,Qz=e=>"field"===e,eR=e=>"compare"===e;function tR(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:FB(t.getData(e.data).output)}function nR(e,t,n,r,i){this.scope=e,this.input=t,this.output=n,this.values=r,this.aggregate=i,this.index={}}function rR(e){return vt(e)?e:null}function iR(e,t,n){const r=NB(n.op,n.field);let i;if(t.ops){for(let e=0,n=t.as.length;enull==e?"null":e)).join(",")+"),0)",t);u.update=l.$expr,u.params=l.$params}function sR(e,t){const n=Iz(e),r=e.type===dz,i=e.from&&e.from.facet,o=e.overlap;let a,s,u,l,c,f,d,h=e.layout||n===ZN||n===XN;const p=n===YN||h||i,g=function(e,t,n){let r,i,o,a,s;return e?(r=e.facet)&&(t||oe("Only group marks can be faceted."),null!=r.field?a=s=tR(r,n):(e.data?s=FB(n.getData(e.data).aggregate):(o=Wz(rt({type:"aggregate",groupby:Ge(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=tR(r,n),a=s=FB(n.add(o))),i=n.keyRef(r.groupby,!0))):a=FB(n.add(QB(null,[{}]))),a||(a=tR(e,n)),{key:i,pulse:a,parent:s}}(e.from,r,t);s=t.add(tT({key:g.key||(e.key?jB(e.key):void 0),pulse:g.pulse,clean:!r}));const m=FB(s);s=u=t.add(QB({pulse:m})),s=t.add(lT({markdef:Uz(e),interactive:qz(e.interactive,t),clip:Pz(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:FB(s)}));const y=FB(s);s=l=t.add(nT(xB(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),s.params.parent=t.encode(),e.transform&&e.transform.forEach((e=>{const n=Wz(e,t),r=n.metadata;(r.generates||r.changes)&&oe("Mark transforms should not generate new data."),r.nomod||(l.params.mod=!0),n.params.pulse=FB(s),t.add(s=n)})),e.sort&&(s=t.add(_T({sort:t.compareRef(e.sort),pulse:FB(s)})));const v=FB(s);(i||h)&&(h=t.add(wT({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:v})),f=FB(h));const b=t.add(KB({mark:y,pulse:f||v}));d=FB(b),r&&(p&&(a=t.operators,a.pop(),h&&a.pop()),t.pushState(v,f||d,m),i?function(e,t,n){const r=e.from.facet,i=r.name,o=tR(r,t);let a;r.name||oe("Facet must have a name: "+Dt(r)),r.data||oe("Facet must reference a data set: "+Dt(r)),r.field?a=t.add(pT({field:t.fieldRef(r.field),pulse:o})):r.groupby?a=t.add(iT({key:t.keyRef(r.groupby),group:FB(t.proxy(n.parent)),pulse:o})):oe("Facet must specify groupby or field: "+Dt(r));const s=t.fork(),u=s.add(QB()),l=s.add(xT({pulse:FB(u)}));s.addData(i,new nR(s,u,u,l)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(e).toRuntime()}}(e,t,g):p?function(e,t,n){const r=t.add(pT({pulse:n.pulse})),i=t.fork();i.add(xT()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(e).toRuntime()}}(e,t,g):t.parse(e),t.popState(),p&&(h&&a.push(h),a.push(b))),o&&(d=function(e,t,n){const r=e.method,i=e.bound,o=e.separation,a={separation:zB(o)?n.signalRef(o.signal):o,method:zB(r)?n.signalRef(r.signal):r,pulse:t};if(e.order&&(a.sort=n.compareRef({field:e.order})),i){const e=i.tolerance;a.boundTolerance=zB(e)?n.signalRef(e.signal):+e,a.boundScale=n.scaleRef(i.scale),a.boundOrient=i.orient}return FB(n.add(dT(a)))}(o,d,t));const x=t.add(vT({pulse:d})),_=t.add(xT({pulse:FB(x)},void 0,t.parent()));null!=e.name&&(c=e.name,t.addData(c,new nR(t,u,x,_)),e.on&&e.on.forEach((e=>{(e.insert||e.remove||e.toggle)&&oe("Marks only support modify triggers."),aR(e,t,c)})))}function uR(e,t,n){const r={enter:{},update:{}};return HN(r,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),r}function lR(e,t,n){return t[e]?`scale("${t[e]}",datum)`:bz(e,n[0].encode)}nR.fromEntries=function(e,t){const n=t.length,r=t[n-1],i=t[n-2];let o=t[0],a=null,s=1;for(o&&"load"===o.type&&(o=t[1]),e.add(t[0]);se===qT||e===LT,gR=(e,t,n)=>zB(e)?wR(e.signal,t,n):e===IT||e===LT?t:n,mR=(e,t,n)=>zB(e)?xR(e.signal,t,n):pR(e)?t:n,yR=(e,t,n)=>zB(e)?_R(e.signal,t,n):pR(e)?n:t,vR=(e,t,n)=>zB(e)?kR(e.signal,t,n):e===LT?{value:t}:{value:n},bR=(e,t,n)=>zB(e)?AR(e.signal,t,n):e===UT?{value:t}:{value:n},xR=(e,t,n)=>ER(`${e} === '${LT}' || ${e} === '${qT}'`,t,n),_R=(e,t,n)=>ER(`${e} !== '${LT}' && ${e} !== '${qT}'`,t,n),wR=(e,t,n)=>DR(`${e} === '${IT}' || ${e} === '${LT}'`,t,n),kR=(e,t,n)=>DR(`${e} === '${LT}'`,t,n),AR=(e,t,n)=>DR(`${e} === '${UT}'`,t,n),ER=(e,t,n)=>(t=null!=t?qN(t):t,n=null!=n?qN(n):n,OR(t)&&OR(n)?{signal:`${e} ? (${t=t?t.signal||Dt(t.value):null}) : (${n=n?n.signal||Dt(n.value):null})`}:[rt({test:e},t)].concat(n||[])),OR=e=>null==e||1===Object.keys(e).length,DR=(e,t,n)=>({signal:`${e} ? (${CR(t)}) : (${CR(n)})`}),SR=(e,t,n,r,i)=>({signal:(null!=r?`${e} === '${IT}' ? (${CR(r)}) : `:"")+(null!=n?`${e} === '${qT}' ? (${CR(n)}) : `:"")+(null!=i?`${e} === '${UT}' ? (${CR(i)}) : `:"")+(null!=t?`${e} === '${LT}' ? (${CR(t)}) : `:"")+"(null)"}),CR=e=>zB(e)?e.signal:null==e?null:Dt(e),FR=(e,t)=>0===t?0:zB(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},jR=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function MR(e,t,n,r){let i;if(t&&st(t,e))return t[e];if(st(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=e[5].toLowerCase()+e.slice(6)}return r[tz][i]}if(e.startsWith("label")){switch(e){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=e[5].toLowerCase()+e.slice(6)}return r[ez][i]}return null}function $R(e){const t={};for(const n of e)if(n)for(const e in n)t[e]=1;return Object.keys(t)}function NR(e,t){return{scale:e.scale,range:t}}function BR(e,t,n,r,i){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+r+","+i+")"}}function TR(e,t){const n=function(e,t){var n,r,i,o=t.config,a=o.style,s=o.axis,u="band"===t.scaleType(e.scale)&&o.axisBand,l=e.orient;if(zB(l)){const e=$R([o.axisX,o.axisY]),t=$R([o.axisTop,o.axisBottom,o.axisLeft,o.axisRight]);for(i of(n={},e))n[i]=mR(l,MR(i,o.axisX,s,a),MR(i,o.axisY,s,a));for(i of(r={},t))r[i]=SR(l.signal,MR(i,o.axisTop,s,a),MR(i,o.axisBottom,s,a),MR(i,o.axisLeft,s,a),MR(i,o.axisRight,s,a))}else n=l===LT||l===qT?o.axisX:o.axisY,r=o["axis"+l[0].toUpperCase()+l.slice(1)];return n||r||u?rt({},s,n,r,u):s}(e,t),r=e.encode||{},i=r.axis||{},o=i.name||void 0,a=i.interactive,s=i.style,u=vz(e,n),l=function(e){const t=e("tickBand");let n,r,i=e("tickOffset");return t?t.signal?(n={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},we(i)||(i={signal:`(${t.signal}) === 'extent' ? 0 : ${i}`})):"extent"===t?(n=1,r=!0,i=0):(n=.5,r=!1):(n=e("bandPosition"),r=e("tickExtra")),{extra:r,band:n,offset:i}}(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:null!=e.title},f=FB(t.add(QB({},[c]))),d=FB(t.add(JB({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(function(e,t,n,r,i){const o=vz(e,t),a=e.orient,s=e.gridScale,u=gR(a,1,-1),l=function(e,t){if(1===t);else if(we(e)){let n=e=rt({},e);for(;null!=n.mult;){if(!we(n.mult))return n.mult=zB(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n=n.mult=rt({},n.mult)}n.mult=t}else e=zB(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);return e}(e.offset,u);let c,f,d;const h={enter:c={opacity:cz},update:d={opacity:fz},exit:f={opacity:cz}};HN(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:e.scale,field:QT,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=mR(a,{signal:"height"},{signal:"width"}),m=s?{scale:s,range:0,mult:u,offset:l}:{value:0,offset:l},y=s?{scale:s,range:1,mult:u,offset:l}:rt(g,{mult:u,offset:l});return c.x=d.x=mR(a,p,m),c.y=d.y=yR(a,p,m),c.x2=d.x2=yR(a,y),c.y2=d.y2=mR(a,y),f.x=mR(a,p),f.y=yR(a,p),kz({type:pz,role:QN,key:QT,from:r,encode:h},n)}(e,n,r.grid,d,l)),c.ticks&&(p=u("tickSize"),h.push(function(e,t,n,r,i,o){const a=vz(e,t),s=e.orient,u=gR(s,-1,1);let l,c,f;const d={enter:l={opacity:cz},update:f={opacity:fz},exit:c={opacity:cz}};HN(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=qN(i);h.mult=u;const p={scale:e.scale,field:QT,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=l.y=mR(s,cz,p),f.y2=l.y2=mR(s,h),c.x=mR(s,p),f.x=l.x=yR(s,cz,p),f.x2=l.x2=yR(s,h),c.y=yR(s,p),kz({type:pz,role:tB,key:QT,from:r,encode:d},n)}(e,n,r.ticks,d,p,l))),c.labels&&(p=c.ticks?p:0,h.push(function(e,t,n,r,i,o){const a=vz(e,t),s=e.orient,u=e.scale,l=gR(s,-1,1),c=LB(a("labelFlush")),f=LB(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let p,g=0===c||!!c;const m=qN(i);m.mult=l,m.offset=qN(a("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:QT,band:.5,offset:wz(o.offset,a("labelOffset"))},v=mR(s,g?BR(u,c,'"left"','"right"','"center"'):{value:"center"},bR(s,"left","right")),b=mR(s,vR(s,"bottom","top"),g?BR(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=BR(u,c,`-(${f})`,f,0);g=g&&f;const _={opacity:cz,x:mR(s,y,m),y:yR(s,y,m)},w={enter:_,update:p={opacity:fz,text:{field:XT},x:_.x,y:_.y,align:v,baseline:b},exit:{opacity:cz,x:_.x,y:_.y}};HN(w,{dx:!d&&g?mR(s,x):null,dy:!h&&g?yR(s,x):null}),HN(w,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:d,baseline:h});const k=a("labelBound");let A=a("labelOverlap");return A=A||k?{separation:a("labelSeparation"),method:A,order:"datum.index",bound:k?{scale:u,orient:s,tolerance:k}:null}:void 0,p.align!==v&&(p.align=jR(p.align,v)),p.baseline!==b&&(p.baseline=jR(p.baseline,b)),kz({type:mz,role:eB,style:ez,key:QT,from:r,encode:w,overlap:A},n)}(e,n,r.labels,d,p,l))),c.domain&&h.push(function(e,t,n,r){const i=vz(e,t),o=e.orient;let a,s;const u={enter:a={opacity:cz},update:s={opacity:fz},exit:{opacity:cz}};HN(u,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const l=NR(e,0),c=NR(e,1);return a.x=s.x=mR(o,l,cz),a.x2=s.x2=mR(o,c),a.y=s.y=yR(o,l,cz),a.y2=s.y2=yR(o,c),kz({type:pz,role:KN,from:r,encode:u},n)}(e,n,r.domain,f)),c.title&&h.push(function(e,t,n,r){const i=vz(e,t),o=e.orient,a=gR(o,-1,1);let s,u;const l={enter:s={opacity:cz,anchor:qN(i("titleAnchor",null)),align:{signal:_z}},update:u=rt({},s,{opacity:fz,text:qN(e.title)}),exit:{opacity:cz}},c={signal:`lerp(range("${e.scale}"), ${xz(0,1,.5)})`};return u.x=mR(o,c),u.y=yR(o,c),s.angle=mR(o,cz,FR(a,90)),s.baseline=mR(o,vR(o,qT,LT),{value:qT}),u.angle=s.angle,u.baseline=s.baseline,HN(l,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),function(e,t,n,r){const i=(e,t)=>null!=e?(n.update[t]=jR(qN(e),n.update[t]),!1):!VN(t,r),o=i(e("titleX"),"x"),a=i(e("titleY"),"y");n.enter.auto=a===o?qN(a):mR(t,qN(a),qN(o))}(i,o,l,n),l.update.align=jR(l.update.align,s.align),l.update.angle=jR(l.update.angle,s.angle),l.update.baseline=jR(l.update.baseline,s.baseline),kz({type:mz,role:nB,style:tz,from:r,encode:l},n)}(e,n,r.title,f)),sR(yz({role:JN,from:f,encode:GN(zR(u,e),i,lz),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:a,style:s}),t)}function zR(e,t){const n={enter:{},update:{}};return HN(n,{orient:e("orient"),offset:e("offset")||0,position:PB(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function RR(e,t,n){const r=Ge(e.signals),i=Ge(e.scales);return n||r.forEach((e=>OB(e,t))),Ge(e.projections).forEach((e=>function(e,t){const n=t.config.projection||{},r={};for(const n in e)"name"!==n&&(r[n]=PT(e[n],n,t));for(const e in n)null==r[e]&&(r[e]=PT(n[e],e,t));t.addProjection(e.name,r)}(e,t))),i.forEach((e=>function(e,t){const n=e.type||"linear";Vp(n)||oe("Unrecognized scale type: "+Dt(n)),t.addScale(e.name,{type:n,domain:void 0})}(e,t))),Ge(e.data).forEach((e=>function(e,t){const n=[];e.transform&&e.transform.forEach((e=>{n.push(Wz(e,t))})),e.on&&e.on.forEach((n=>{aR(n,t,e.name)})),t.addDataPipeline(e.name,function(e,t,n){const r=[];let i,o,a,s,u,l=null,c=!1,f=!1;for(e.values?zB(e.values)||RB(e.format)?(r.push(hR(t,e)),r.push(l=dR())):r.push(l=dR({$ingest:e.values,$format:e.format})):e.url?RB(e.url)||RB(e.format)?(r.push(hR(t,e)),r.push(l=dR())):r.push(l=dR({$request:e.url,$format:e.format})):e.source&&(l=i=Ge(e.source).map((e=>FB(t.getData(e).output))),r.push(null)),o=0,a=n.length;oOT(e,t))),(n||r).forEach((e=>function(e,t){const n=t.getSignal(e.name);let r=e.update;e.init&&(r?oe("Signals can not include both init and update expressions."):(r=e.init,n.initonly=!0)),r&&(r=y$(r,t),n.update=r.$expr,n.params=r.$params),e.on&&e.on.forEach((e=>function(e,t,n){const r=e.encode,i={target:n};let o=e.events,a=e.update,s=[];o||oe("Signal update missing events specification."),vt(o)&&(o=BN(o,t.isSubscope()?BB:TB)),o=Ge(o).filter((e=>e.signal||e.scale?(s.push(e),0):1)),s.length>1&&(s=[YB(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),null!=r&&(a&&oe("Signal encode and update are mutually exclusive."),a="encode(item(),"+Dt(r)+")"),i.update=vt(a)?y$(a,t):null!=a.expr?y$(a.expr,t):null!=a.value?a.value:null!=a.signal?{$expr:VB,$params:{$value:t.signalRef(a.signal)}}:oe("Invalid signal update specification."),e.force&&(i.options={force:!0}),s.forEach((e=>t.addUpdate(rt(function(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):UB(e,t)}}(e,t),i))))}(e,t,n.id)))}(e,t))),Ge(e.axes).forEach((e=>TR(e,t))),Ge(e.marks).forEach((e=>sR(e,t))),Ge(e.legends).forEach((e=>function(e,t){const n=t.config.legend,r=e.encode||{},i=vz(e,n),o=r.legend||{},a=o.name||void 0,s=o.interactive,u=o.style,l={};let c,f,d,h=0;uz.forEach((t=>e[t]?(l[t]=e[t],h=h||e[t]):0)),h||oe("Missing valid scale for legend.");const p=function(e,t){let n=e.type||iz;return e.type||1!==function(e){return uz.reduce(((t,n)=>t+(e[n]?1:0)),0)}(e)||!e.fill&&!e.stroke||(n=Xp(t)?oz:Jp(t)?az:iz),n!==oz?n:Jp(t)?az:oz}(e,t.scaleType(h)),g={title:null!=e.title,scales:l,type:p,vgrad:"symbol"!==p&&i.isVertical()},m=FB(t.add(QB(null,[g]))),y=FB(t.add(sT(f={type:p,scale:t.scaleRef(h),count:t.objectProperty(i("tickCount")),limit:t.property(i("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===oz?(d=[Az(e,h,n,r.gradient),Sz(e,n,r.labels,y)],f.count=f.count||t.signalRef(`max(2,2*floor((${LB(i.gradientLength())})/100))`)):p===az?d=[Ez(e,h,n,r.gradient,y),Sz(e,n,r.labels,y)]:(c=function(e,t){const n=vz(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(e,n),d=[Cz(e,n,r,y,LB(c.columns))],f.size=function(e,t,n){const r=LB(lR("size",e,n)),i=LB(lR("strokeWidth",e,n)),o=LB(function(e,t,n){return bz("fontSize",e)||function(e,t,n){const r=t.config.style[n];return r&&r.fontSize}(0,t,n)}(n[1].encode,t,ez));return y$(`max(ceil(sqrt(${r})+${i}),${o})`,t)}(e,t,d[0].marks)),d=[yz({role:oB,from:m,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:c,interactive:s})],g.title&&d.push(function(e,t,n,r){const i=vz(e,t),o={enter:{opacity:cz},update:{opacity:fz,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:cz}};return HN(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:Tz},angle:{signal:zz},align:{signal:Bz},baseline:{signal:Rz},text:e.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),kz({type:mz,role:lB,style:tz,from:r,encode:o},n)}(e,n,r.title,m)),sR(yz({role:rB,from:m,encode:GN(uR(i,e,n),o,lz),marks:d,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:a,interactive:s,style:u}),t)}(e,t))),e.title&&function(e,t){const n=vz(e=vt(e)?{text:e}:e,t.config.title),r=e.encode||{},i=r.group||{},o=i.name||void 0,a=i.interactive,s=i.style,u=[],l=FB(t.add(QB(null,[{}])));u.push(function(e,t,n,r){const i={value:0},o={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return HN(o,{text:e.text,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),kz({type:mz,role:fB,style:nz,from:r,encode:o},n)}(e,n,function(e){const t=e.encode;return t&&t.title||rt({name:e.name,interactive:e.interactive,style:e.style},t)}(e),l)),e.subtitle&&u.push(function(e,t,n,r){const i={value:0},o={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return HN(o,{text:e.subtitle,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),kz({type:mz,role:dB,style:rz,from:r,encode:o},n)}(e,n,r.subtitle,l)),sR(yz({role:cB,from:l,encode:fR(n,i),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:a,style:s}),t)}(e.title,t),t.parseLambdas(),t}const PR=e=>GN({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function LR(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function IR(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function UR(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}function qR(e){return(_e(e)?WR:HR)(e)}function WR(e){const t=e.length;let n="[";for(let r=0;r0?",":"")+(we(t)?t.signal||qR(t):Dt(t))}return n+"]"}function HR(e){let t,n,r="{",i=0;for(t in e)n=e[t],r+=(++i>1?",":"")+Dt(t)+":"+(we(n)?n.signal||qR(n):Dt(n));return r+"}"}function GR(e,t,n){return we(e)||oe("Input Vega specification must be an object."),t=Ae(function(){const e="sans-serif",t="#4c78a8",n="#000",r="#888",i="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:t},area:{fill:t},image:null,line:{stroke:t,strokeWidth:2},path:{stroke:t},rect:{fill:t},rule:{stroke:n},shape:{stroke:t},symbol:{fill:t,size:64},text:{fill:n,font:e,fontSize:11},trail:{fill:t,size:2},style:{"guide-label":{fill:n,font:e,fontSize:10},"guide-title":{fill:n,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:n,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:n,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:i},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:r,grid:!1,gridWidth:1,gridColor:i,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:r,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:i,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:r,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}(),t,e.config),function(e,t){const n=t.config,r=FB(t.root=t.add(CB())),i=function(e,t){const n=n=>PB(e[n],t[n]),r=[LR("background",n("background")),LR("autosize",PN(n("autosize"))),LR("padding",UN(n("padding"))),LR("width",n("width")||0),LR("height",n("height")||0)],i=r.reduce(((e,t)=>(e[t.name]=t,e)),{}),o={};return Ge(e.signals).forEach((e=>{st(i,e.name)?e=rt(i[e.name],e):r.push(e),o[e.name]=e})),Ge(t.signals).forEach((e=>{st(o,e.name)||st(i,e.name)||r.push(e)})),r}(e,n);i.forEach((e=>OB(e,t))),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const o=t.add(QB()),a=t.add(nT(xB(PR(e.encode),dz,XN,e.style,t,{pulse:FB(o)}))),s=t.add(wT({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:r,pulse:FB(a)}));t.operators.pop(),t.pushState(FB(a),FB(s),null),RR(e,t,i),t.operators.push(s);let u=t.add(KB({mark:r,pulse:FB(s)}));return u=t.add(vT({pulse:FB(u)})),u=t.add(xT({pulse:FB(u)})),t.addData("root",new nR(t,o,o,u)),t}(e,new IR(t,n)).toRuntime()}IR.prototype=UR.prototype={parse(e){return RR(e,this)},fork(){return new UR(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach((t=>{t.$ref=e.id})),e.refs=null),e},proxy(e){const t=e instanceof DB?FB(e):e;return this.add(mT({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;for(e in this.root&&(this.root.root=!0),this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(e,t,n){let r,i;e&&(r=e.data||(e.data={}),i=r[t]||(r[t]=[]),i.push(n))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const r in t.index)n(t.index[r],e,"index:"+r)}return this},pushState(e,t,n){this._encode.push(FB(this.add(xT({pulse:e})))),this._parent.push(t),this._lookup.push(n?FB(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return De(this._parent)},encode(){return De(this._encode)},lookup(){return De(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(vt(e))return jB(e,t);e.signal||oe("Unsupported field reference: "+Dt(e));const n=e.signal;let r=this.field[n];if(!r){const e={name:this.signalRef(n)};t&&(e.as=t),this.field[n]=r=FB(this.add(oT(e)))}return r},compareRef(e){let t=!1;const n=e=>zB(e)?(t=!0,this.signalRef(e.signal)):function(e){return e&&e.expr}(e)?(t=!0,this.exprRef(e.expr)):e,r=Ge(e.field).map(n),i=Ge(e.order).map(n);return t?FB(this.add(eT({fields:r,orders:i}))):$B(r,i)},keyRef(e,t){let n=!1;const r=this.signals;return e=Ge(e).map((e=>zB(e)?(n=!0,FB(r[e.signal])):e)),n?FB(this.add(aT({fields:e,flat:t}))):function(e,t){const n={$key:e};return t&&(n.$flat=!0),n}(e,t)},sortRef(e){if(!e)return e;const t=NB(e.op,e.field),n=e.order||"ascending";return n.signal?FB(this.add(eT({fields:t,orders:this.signalRef(n.signal)}))):$B(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:e,type:t}),this.events[n]=r}return this.events[n]},hasOwnSignal(e){return st(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&oe("Duplicate signal name: "+Dt(e));const n=t instanceof DB?t:this.add(CB(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||oe("Unrecognized signal name: "+Dt(e)),this.signals[e]},signalRef(e){return this.signals[e]?FB(this.signals[e]):(st(this.lambdas,e)||(this.lambdas[e]=this.add(CB(null))),FB(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;te*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>ee<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},ZR={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const JR=Array.prototype.slice,KR=(e,t,n)=>{const r=n?n(t[0]):t[0];return r[e].apply(r,JR.call(t,1))};var QR={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:(e,t,n,r,i,o,a)=>new Date(e,t||0,null!=n?n:1,r||0,i||0,o||0,a||0),date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return KR("join",arguments)},indexof:function(){return KR("indexOf",arguments)},lastindexof:function(){return KR("lastIndexOf",arguments)},slice:function(){return KR("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return KR("substring",arguments,String)},split:function(){return KR("split",arguments,String)},replace:function(){return KR("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const eP=["view","item","group","xy","x","y"],tP=new Set([Function,eval,setTimeout,setInterval]);"function"==typeof setImmediate&&tP.add(setImmediate);const nP={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:"datum"===n?e.datum:"event"===n?e.event:"item"===n?e.item:YR[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,r=e(t.object);n&&(e.memberDepth+=1);const i=e(t.property);if(n&&(e.memberDepth-=1),!tP.has(r[i]))return r[i];console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`)},CallExpression:(e,t)=>{const n=t.arguments;let r=t.callee.name;return r.startsWith("_")&&(r=r.slice(1)),"if"===r?e(n[0])?e(n[1]):e(n[2]):(e.fn[r]||QR[r]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>XR[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>ZR[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>"&&"===t.operator?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce(((t,n)=>{e.memberDepth+=1;const r=e(n.key);return e.memberDepth-=1,tP.has(e(n.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):t[r]=e(n.value),t}),{})};function rP(e,t,n,r,i,o){const a=e=>nP[e.type](a,e);return a.memberDepth=0,a.fn=Object.create(t),a.params=n,a.datum=r,a.event=i,a.item=o,eP.forEach((e=>a.fn[e]=function(){return i.vega[e](...arguments)})),a(e)}var iP={operator(e,t){const n=t.ast,r=e.functions;return e=>rP(n,r,e)},parameter(e,t){const n=t.ast,r=e.functions;return(e,t)=>rP(n,r,t,e)},event(e,t){const n=t.ast,r=e.functions;return e=>rP(n,r,void 0,void 0,e)},handler(e,t){const n=t.ast,r=e.functions;return(e,t)=>{const i=t.item&&t.item.datum;return rP(n,r,e,i,t)}},encode(e,t){const{marktype:n,channels:r}=t,i=e.functions,o="group"===n||"image"===n||"rect"===n;return(e,t)=>{const a=e.datum;let s,u=0;for(const n in r)s=rP(r[n].ast,i,t,a,void 0,e),e[n]!==s&&(e[n]=s,u=1);return"rule"!==n&&function(e,t,n){let r;t.x2&&(t.x?(n&&e.x>e.x2&&(r=e.x,e.x=e.x2,e.x2=r),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(r=e.y,e.y=e.y2,e.y2=r),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}(e,r,o),u}}};const oP={i8:"4.17.0"};function aP(e,t,n){return e.fields=t||[],e.fname=n,e}function sP(e){return 1===e.length?uP(e[0]):lP(e)}const uP=e=>function(t){return t[e]},lP=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),s=r=i+1):"]"===o&&(s||cP("Access path missing open bracket: "+e),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&cP("Access path missing closing bracket: "+e),a&&cP("Access path missing closing quote: "+e),i>r&&(i++,l()),t}!function(e,t,n){const r=fP(e);e=1===r.length?r[0]:e,aP((n&&n.get||sP)(r),[e],t||e)}("id");const dP=aP((e=>e),[],"identity");function hP(e,t,n){const r=[t].concat([].slice.call(n));console[e].apply(console,r)}aP((()=>0),[],"zero"),aP((()=>1),[],"one"),aP((()=>!0),[],"true"),aP((()=>!1),[],"false");var pP=Array.isArray;function gP(e){return e===Object(e)}const mP=e=>"__proto__"!==e;function yP(...e){return e.reduce(((e,t)=>{for(const n in t)if("signals"===n)e.signals=bP(e.signals,t.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;vP(e,n,t[n],r)}return e}),{})}function vP(e,t,n,r){if(!mP(t))return;let i,o;if(gP(n)&&!pP(n))for(i in o=gP(e[t])?e[t]:e[t]={},n)r&&(!0===r||r[i])?vP(o,i,n[i]):mP(i)&&(o[i]=n[i]);else e[t]=n}function bP(e,t){if(null==e)return t;const n={},r=[];function i(e){n[e.name]||(n[e.name]=1,r.push(e))}return t.forEach(i),e.forEach(i),r}function xP(e){return null!=e?pP(e)?e:[e]:[]}const _P=Object.prototype.hasOwnProperty;function wP(e,t){return _P.call(e,t)}function kP(e){return"boolean"==typeof e}function AP(e){return"number"==typeof e}function EP(e){return"string"==typeof e}function OP(e){return pP(e)?"["+e.map(OP)+"]":gP(e)||EP(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function DP(e){const t={},n=e.length;for(let r=0;rRP(e,t)))}:NP(e)?{or:e.or.map((e=>RP(e,t)))}:t(e)}const PP=jP(),LP=CP();function IP(e,t){const n={};for(const r of t)wP(e,r)&&(n[r]=e[r]);return n}function UP(e,t){const n=Object.assign({},e);for(const e of t)delete n[e];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map((e=>$P()(e))).join(",")})`};const qP=$P();function WP(e){if(AP(e))return e;const t=EP(e)?e:$P()(e);if(t.length<250)return t;let n=0;for(let e=0;e-1}function VP(e,t){let n=0;for(const[r,i]of e.entries())if(t(i,r,n++))return!0;return!1}function YP(e,t){let n=0;for(const[r,i]of e.entries())if(!t(i,r,n++))return!1;return!0}function XP(e,...t){for(const n of t)ZP(e,null!=n?n:{});return e}function ZP(e,t){for(const n of iL(t))vP(e,n,t[n],!0)}function JP(e,t){const n=[],r={};let i;for(const o of e)i=t(o),i in r||(r[i]=1,n.push(o));return n}function KP(e,t){const n=iL(e),r=iL(t);if(n.length!==r.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function QP(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function eL(e,t){for(const n of e)if(t.has(n))return!0;return!1}function tL(e){const t=new Set;for(const n of e){const e=fP(n).map(((e,t)=>0===t?e:`[${e}]`)),r=e.map(((t,n)=>e.slice(0,n+1).join("")));for(const e of r)t.add(e)}return t}function nL(e,t){return void 0===e||void 0===t||eL(tL(e),tL(t))}function rL(e){return 0===iL(e).length}const iL=Object.keys,oL=Object.values,aL=Object.entries;function sL(e){return!0===e||!1===e}function uL(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function lL(e,t){return TP(e)?"!("+lL(e.not,t)+")":BP(e)?"("+e.and.map((e=>lL(e,t))).join(") && (")+")":NP(e)?"("+e.or.map((e=>lL(e,t))).join(") || (")+")":t(e)}function cL(e,t){if(0===t.length)return!0;const n=t.shift();return n in e&&cL(e[n],t)&&delete e[n],rL(e)}function fL(e){return e.charAt(0).toUpperCase()+e.substr(1)}function dL(e,t="datum"){const n=fP(e),r=[];for(let e=1;e<=n.length;e++){const i=`[${n.slice(0,e).map(OP).join("][")}]`;r.push(`${t}${i}`)}return r.join(" && ")}function hL(e,t="datum"){return`${t}[${OP(fP(e).join("."))}]`}function pL(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function gL(e){return`${fP(e).map(pL).join("\\.")}`}function mL(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function yL(e){return`${fP(e).join(".")}`}function vL(e){return e?fP(e).length:0}function bL(...e){for(const t of e)if(void 0!==t)return t}let xL=42;function _L(e){const t=++xL;return e?String(e)+t:t}function wL(){xL=42}function kL(e){return AL(e)?e:`__${e}`}function AL(e){return 0===e.indexOf("__")}function EL(e){if(void 0!==e)return(e%360+360)%360}function OL(e){return!!AP(e)||!isNaN(e)&&!isNaN(parseFloat(e))}const DL={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function SL(e){return e&&e.condition}const CL=["domain","grid","labels","ticks","title"],FL={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"main",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},jL={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},ML=Object.assign(Object.assign({},jL),{style:1,labelExpr:1,encoding:1});function $L(e){return!!ML[e]}iL(ML);const NL=iL({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1}),BL={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},TL={count:1,min:1,max:1};function zL(e){return!!e&&!!e.argmin}function RL(e){return!!e&&!!e.argmax}function PL(e){return EP(e)&&!!BL[e]}iL(BL);const LL=["count","valid","missing","distinct"];function IL(e){return EP(e)&&GP(LL,e)}const UL=["count","sum","distinct","valid","missing"],qL=DP(["mean","average","median","q1","q3","min","max"]);var WL=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);izU(e[t])?uL(`_${t}_${aL(e[t])}`):uL(`_${t}_${e[t]}`))).join("")}function NU(e){return!0===e||TU(e)&&!e.binned}function BU(e){return"binned"===e||TU(e)&&!0===e.binned}function TU(e){return gP(e)}function zU(e){return null==e?void 0:e.selection}function RU(e){switch(e){case HL:case GL:case cI:case aI:case sI:case uI:case gI:case dI:case hI:case pI:case lI:return 6;case mI:return 4;default:return 10}}function PU(e){return`Invalid specification ${JSON.stringify(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const LU='Autosize "fit" only works for single views and layered views.';function IU(e){return("width"==e?"Width":"Height")+' "container" only works for single views and layered views.'}function UU(e){return`${"width"==e?"Width":"Height"} "container" only works well with autosize "fit" or "fit-${"width"==e?"x":"y"}".`}function qU(e){return e?`Dropping "fit-${e}" because spec has discrete ${XI(e)}.`:'Dropping "fit" because spec has discrete size.'}function WU(e){return`Unknown field for ${e}. Cannot calculate view size.`}function HU(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function GU(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function VU(e){return`Selection not supported for ${e} yet.`}function YU(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}function XU(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}function ZU(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function JU(e){return`Invalid field type "${e}".`}function KU(e,t){const{fill:n,stroke:r}=t;return`Dropping color ${e} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function QU(e,t){return`Dropping ${qP(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}function eq(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function tq(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function nq(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${"ordinal"===t?"order":"magnitude"}.`}function rq(e){return`Using unaggregated domain with raw field has no effect (${qP(e)}).`}function iq(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function oq(e){return`Unaggregated domain is currently unsupported for log scale (${qP(e)}).`}function aq(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function sq(e){return`The step for "${e}" is dropped because the ${"width"===e?"x":"y"} is continuous.`}const uq="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";function lq(e,t){return`Invalid ${e}: ${qP(t)}.`}function cq(e){return`1D error band does not support ${e}.`}function fq(e){return`Channel ${e} is required for "binned" bin.`}const dq=function(e,t){let n=2;return{level(e){return arguments.length?(n=+e,this):n},error(){return n>=1&&hP("error","ERROR",arguments),this},warn(){return n>=2&&hP("warn","WARN",arguments),this},info(){return n>=3&&hP("log","INFO",arguments),this},debug(){return n>=4&&hP("log","DEBUG",arguments),this}}}();let hq=dq;function pq(...e){hq.warn(...e)}function gq(e){if(e&&gP(e))for(const t of Aq)if(t in e)return!0;return!1}new WeakMap;const mq=["january","february","march","april","may","june","july","august","september","october","november","december"],yq=mq.map((e=>e.substr(0,3))),vq=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],bq=vq.map((e=>e.substr(0,3)));function xq(e,t){const n=[];if(t&&void 0!==e.day&&iL(e).length>1&&(pq(function(e){return`Dropping day from datetime ${qP(e)} as day cannot be combined with other units.`}(e)),delete(e=LP(e)).day),void 0!==e.year?n.push(e.year):n.push(2012),void 0!==e.month){const r=t?function(e){if(OL(e)&&(e=+e),AP(e))return e-1;{const t=e.toLowerCase(),n=mq.indexOf(t);if(-1!==n)return n;const r=t.substr(0,3),i=yq.indexOf(r);if(-1!==i)return i;throw new Error(lq("month",e))}}(e.month):e.month;n.push(r)}else if(void 0!==e.quarter){const r=t?function(e){if(OL(e)&&(e=+e),AP(e))return e>4&&pq(lq("quarter",e)),e-1;throw new Error(lq("quarter",e))}(e.quarter):e.quarter;n.push(AP(r)?3*r:r+"*3")}else n.push(0);if(void 0!==e.date)n.push(e.date);else if(void 0!==e.day){const r=t?function(e){if(OL(e)&&(e=+e),AP(e))return e%7;{const t=e.toLowerCase(),n=vq.indexOf(t);if(-1!==n)return n;const r=t.substr(0,3),i=bq.indexOf(r);if(-1!==i)return i;throw new Error(lq("day",e))}}(e.day):e.day;n.push(AP(r)?r+1:r+"+1")}else n.push(1);for(const t of["hours","minutes","seconds","milliseconds"]){const r=e[t];n.push(void 0===r?0:r)}return n}function _q(e){const t=xq(e,!0).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}var wq=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0&&"seconds"===t&&"i"===e.charAt(n-1)||e.length>n+3&&"day"===t&&"o"===e.charAt(n+3)||n>0&&"year"===t&&"f"===e.charAt(n-1))}function Cq(e){if(!e)return;const t=Dq(e);return`timeUnitSpecifier(${$P()(t)}, ${$P()(Oq)})`}function Fq(e){if(!e)return;let t;return EP(e)?t={unit:e}:gP(e)&&(t=Object.assign(Object.assign({},e),e.unit?{unit:e.unit}:{})),Eq(t.unit)&&(t.utc=!0,t.unit=function(e){return e.substr(3)}(t.unit)),t}function jq(e){return e&&!!e.signal}function Mq(e){return!!e.step}function $q(e){return!pP(e)&&"field"in e&&"data"in e}const Nq=iL({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),Bq={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},Tq=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function zq(e){return e&&!!e.field&&void 0!==e.equal}function Rq(e){return e&&!!e.field&&void 0!==e.lt}function Pq(e){return e&&!!e.field&&void 0!==e.lte}function Lq(e){return e&&!!e.field&&void 0!==e.gt}function Iq(e){return e&&!!e.field&&void 0!==e.gte}function Uq(e){if(e&&e.field){if(pP(e.range)&&2===e.range.length)return!0;if(jq(e.range))return!0}return!1}function qq(e){return e&&!!e.field&&(pP(e.oneOf)||pP(e.in))}function Wq(e){return qq(e)||zq(e)||Uq(e)||Rq(e)||Lq(e)||Pq(e)||Iq(e)}function Hq(e,t){return hG(e,{timeUnit:t,wrapTime:!0})}function Gq(e,t=!0){var n;const{field:r}=e,i=null===(n=Fq(e.timeUnit))||void 0===n?void 0:n.unit,o=i?"time("+function(e,t,{end:n}={end:!1}){const r=dL(t),i=Eq(e)?"utc":"";let o;const a={};for(const t of Aq)Sq(e,t)&&(a[t]="quarter"===(s=t)?`(${i}quarter(${r})-1)`:`${i}${s}(${r})`,o=t);var s;return n&&(a[o]+="+1"),function(e){const t=xq(e,!1).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}(a)}(i,r)+")":XH(e,{expr:"datum"});if(zq(e))return o+"==="+Hq(e.equal,i);if(Rq(e))return`${o}<${Hq(e.lt,i)}`;if(Lq(e))return`${o}>${Hq(e.gt,i)}`;if(Pq(e))return`${o}<=${Hq(e.lte,i)}`;if(Iq(e))return`${o}>=${Hq(e.gte,i)}`;if(qq(e))return`indexof([${function(e,t){return e.map((e=>Hq(e,t)))}(e.oneOf,i).join(",")}], ${o}) !== -1`;if(function(e){return e&&!!e.field&&void 0!==e.valid}(e))return Vq(o,e.valid);if(Uq(e)){const{range:n}=e,r=jq(n)?{signal:`${n.signal}[0]`}:n[0],a=jq(n)?{signal:`${n.signal}[1]`}:n[1];if(null!==r&&null!==a&&t)return"inrange("+o+", ["+Hq(r,i)+", "+Hq(a,i)+"])";const s=[];return null!==r&&s.push(`${o} >= ${Hq(r,i)}`),null!==a&&s.push(`${o} <= ${Hq(a,i)}`),s.length>0?s.join(" && "):"true"}throw new Error(`Invalid field predicate: ${JSON.stringify(e)}`)}function Vq(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Yq(e){var t;return Wq(e)&&e.timeUnit?Object.assign(Object.assign({},e),{timeUnit:null===(t=Fq(e.timeUnit))||void 0===t?void 0:t.unit}):e}const Xq={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"},Zq=Xq.quantitative,Jq=Xq.ordinal,Kq=Xq.temporal,Qq=Xq.nominal,eW=Xq.geojson;iL(Xq);const tW={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},nW={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function rW(e,t){const n=nW[e],r=nW[t];return n===r||"ordinal-position"===n&&"time"===r||"ordinal-position"===r&&"time"===n}iL(nW);const iW={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function oW(e){return iW[e]}const aW=["linear","log","pow","sqrt","symlog","time","utc"],sW=DP(aW),uW=DP(["linear","log","pow","sqrt","symlog"]),lW=DP(["quantile","quantize","threshold"]),cW=DP(aW.concat(["quantile","quantize","threshold","sequential","identity"])),fW=DP(["ordinal","bin-ordinal","point","band"]);function dW(e){return e in fW}function hW(e){return e in cW}function pW(e){return e in sW}function gW(e){return e in lW}function mW(e){return null==e?void 0:e.selection}const yW={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:vW,domain:bW,range:xW,rangeMax:_W,rangeMin:wW,scheme:kW}=(iL(yW),yW),AW=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);iuL(`${"unit"===e?"":`_${e}_`}${r[e]}`))).join(""):(n?"utc":"")+"timeunit"+iL(r).map((e=>uL(`_${e}_${r[e]}`))).join("")}(f),s=(!GP(["range","mid"],t.binSuffix)&&t.binSuffix||"")+(null!==(i=t.suffix)&&void 0!==i?i:""))}a&&(o=o?`${a}_${o}`:a)}return s&&(o=`${o}_${s}`),a&&(o=`${a}_${o}`),t.forAs?yL(o):t.expr?hL(o,t.expr)+u:gL(o)+u}function ZH(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return TH(e)&&!!e.bin;case"temporal":return!1}throw new Error(JU(e.type))}function JH(e){return!ZH(e)}const KH=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return function(e){const{aggregate:t,bin:n,timeUnit:r,field:i}=e;if(RL(t))return`${i} for argmax(${t.argmax})`;if(zL(t))return`${i} for argmin(${t.argmin})`;const o=Fq(r),a=t||(null==o?void 0:o.unit)||(null==o?void 0:o.maxbins)&&"timeunit"||NU(n)&&"bin";return a?a.toUpperCase()+"("+i+")":i}(e);default:return function(e,t){var n;const{field:r,bin:i,timeUnit:o,aggregate:a}=e;if("count"===a)return t.countTitle;if(NU(i))return`${r} (binned)`;if(o){const e=null===(n=Fq(o))||void 0===n?void 0:n.unit;if(e)return`${r} (${Dq(e).join("-")})`}else if(a)return RL(a)?`${r} for max ${a.argmax}`:zL(a)?`${r} for min ${a.argmin}`:`${fL(a)} of ${r}`;return r}(e,t)}};let QH=KH;function eG(e){QH=e}function tG(e,t,{allowDisabling:n,includeDefault:r=!0}){var i,o;const a=null===(i=nG(e))||void 0===i?void 0:i.title;if(!TH(e))return a;const s=e,u=r?rG(s,t):void 0;return n?bL(a,s.title,u):null!==(o=null!=a?a:s.title)&&void 0!==o?o:u}function nG(e){return HH(e)&&e.axis?e.axis:GH(e)&&e.legend?e.legend:OH(e)&&e.header?e.header:void 0}function rG(e,t){return QH(e,t)}function iG(e){var t;if(VH(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}{const n=null!==(t=nG(e))&&void 0!==t?t:{},{format:r,formatType:i}=n;return{format:r,formatType:i}}}function oG(e){return TH(e)?e:NH(e)?e.condition:void 0}function aG(e){return IH(e)?e:BH(e)?e.condition:void 0}function sG(e,t,n,r={}){return EP(e)||AP(e)||kP(e)?(pq(function(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${qP(n)}}.`}(t,EP(e)?"string":AP(e)?"number":"boolean",e)),{value:e}):IH(e)?uG(e,t,n,r):BH(e)?Object.assign(Object.assign({},e),{condition:uG(e.condition,t,n,r)}):e}function uG(e,t,n,r){if(VH(e)){const{format:i,formatType:o}=e,a=SH(e,["format","formatType"]);if(sH(o)&&!n.customFormatTypes)return pq(ZU(t)),uG(a,t,n,r)}else{const i=HH(e)?"axis":GH(e)?"legend":OH(e)?"header":null;if(i&&e[i]){const o=e[i],{format:a,formatType:s}=o,u=SH(o,["format","formatType"]);if(sH(s)&&!n.customFormatTypes)return pq(ZU(t)),uG(Object.assign(Object.assign({},e),{[i]:u}),t,n,r)}}return TH(e)?lG(e,t,r):function(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=AP(n)?"quantitative":EP(n)?"nominal":gq(n)?"temporal":void 0,Object.assign(Object.assign({},e),{type:t})}(e)}function lG(e,t,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:a}=e,s=Object.assign({},e);if(n||!r||PL(r)||RL(r)||zL(r)||(pq(function(e){return`Invalid aggregation operator "${e}".`}(r)),delete s.aggregate),i&&(s.timeUnit=Fq(i)),a&&(s.field=`${a}`),NU(o)&&(s.bin=cG(o,t)),BU(o)&&!dU(t)&&pq(function(e){return`Channel ${e} should not be used with "binned" bin.`}(t)),UH(s)){const{type:e}=s,t=function(e){if(e)switch(e=e.toLowerCase()){case"q":case Zq:return"quantitative";case"t":case Kq:return"temporal";case"o":case Jq:return"ordinal";case"n":case Qq:return"nominal";case eW:return"geojson"}}(e);e!==t&&(s.type=t),"quantitative"!==e&&IL(r)&&(pq(function(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}(e,r)),s.type="quantitative")}else if(!HI(t)){const e=function(e,t){var n;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(FH(e)&&pP(e.sort))return"ordinal";const{aggregate:r,bin:i,timeUnit:o}=e;if(o)return"temporal";if(i||r&&!RL(r)&&!zL(r))return"quantitative";if(WH(e)&&(null===(n=e.scale)||void 0===n?void 0:n.type))switch(nW[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(s,t);s.type=e}if(UH(s)){const{compatible:e,warning:n}=function(e,t){const n=e.type;if("geojson"===n&&"shape"!==t)return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case HL:case GL:case VL:return JH(e)?{compatible:!1,warning:tq(t)}:fG;case YL:case XL:case aI:case sI:case uI:case yI:case bI:case xI:case _I:case wI:case kI:case fI:case eI:case KL:case AI:return fG;case rI:case oI:case nI:case iI:return n!==Zq?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:fG;case dI:case hI:case pI:case gI:case cI:case tI:case QL:case ZL:case JL:return"nominal"!==n||e.sort?fG:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case mI:return GP(["ordinal","nominal"],e.type)?fG:{compatible:!1,warning:"StrokeDash channel should be used with only discrete data."};case lI:return GP(["ordinal","nominal","geojson"],e.type)?fG:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case vI:return"nominal"!==e.type||"sort"in e?fG:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(s,t)||{};!1===e&&pq(n)}if(FH(s)&&EP(s.sort)){const{sort:e}=s;if(_H(e))return Object.assign(Object.assign({},s),{sort:{encoding:e}});const t=e.substr(1);if("-"===e.charAt(0)&&_H(t))return Object.assign(Object.assign({},s),{sort:{encoding:t,order:"descending"}})}if(OH(s)){const{header:e}=s,{orient:t}=e,n=SH(e,["orient"]);if(t)return Object.assign(Object.assign({},s),{header:Object.assign(Object.assign({},n),{labelOrient:e.labelOrient||t,titleOrient:e.titleOrient||t})})}return s}function cG(e,t){return kP(e)?{maxbins:RU(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:Object.assign(Object.assign({},e),{maxbins:RU(t)})}const fG={compatible:!0};function dG(e){const{formatType:t}=iG(e);return"time"===t||!t&&function(e){return e&&("temporal"===e.type||TH(e)&&!!e.timeUnit)}(e)}function hG(e,{timeUnit:t,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){var o;const a=t&&(null===(o=Fq(t))||void 0===o?void 0:o.unit);let s,u=a||"temporal"===n;return SW(e)?s=e.expr:jq(e)?s=e.signal:gq(e)?(u=!0,s=_q(e)):(EP(e)||AP(e))&&u&&(s=`datetime(${JSON.stringify(e)})`,function(e){return!!kq[e]}(a)&&(AP(e)&&e<1e4||EP(e)&&isNaN(Date.parse(e)))&&(s=_q({[a]:e}))),s?r&&u?`time(${s})`:s:i?void 0:JSON.stringify(e)}function pG(e,t){const{type:n}=e;return t.map((t=>{const r=hG(t,{timeUnit:TH(e)?e.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==r?{signal:r}:t}))}function gG(e,t){return NU(e.bin)?SU(t)&&GP(["ordinal","nominal"],e.type):(console.warn("Only call this method for binned field defs."),!1)}var mG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var r;return e.field.push(XH(n,t)),e.order.push(null!==(r=n.sort)&&void 0!==r?r:"ascending"),e}),{field:[],order:[]})}function MG(e,t){const n=[...e];return t.forEach((e=>{for(const t of n)if(PP(t,e))return;n.push(e)})),n}function $G(e,t){return PP(e,t)||!t?e:e?[...xP(e),...xP(t)].join(", "):t}function NG(e,t){const n=e.value,r=t.value;if(null==n||null===r)return{explicit:e.explicit,value:null};if((vG(n)||jq(n))&&(vG(r)||jq(r)))return{explicit:e.explicit,value:$G(n,r)};if(vG(n)||jq(n))return{explicit:e.explicit,value:n};if(vG(r)||jq(r))return{explicit:e.explicit,value:r};if(!(vG(n)||jq(n)||vG(r)||jq(r)))return{explicit:e.explicit,value:MG(n,r)};throw new Error("It should never reach here")}function BG(e){return"mark"in e}class TG{constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return!!BG(e)&&function(e){return YW(e)?e.type:e}(e.mark)===this.name}}var zG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i!!e.field)):TH(n)||NH(n))}function PG(e){return VP(NI,(t=>{if(RG(e,t)){const n=e[t];if(pP(n))return VP(n,(e=>!!e.aggregate));{const e=oG(n);return e&&!!e.aggregate}}return!1}))}function LG(e,t){const n=[],r=[],i=[],o=[],a={};return qG(e,((s,u)=>{if(TH(s)){const{field:l,aggregate:c,bin:f,timeUnit:d}=s,h=zG(s,["field","aggregate","bin","timeUnit"]);if(c||d||f){const e=nG(s),p=e&&e.title;let g=XH(s,{forAs:!0});const m=Object.assign(Object.assign(Object.assign({},p?[]:{title:tG(s,t,{allowDisabling:!0})}),h),{field:g});if(c){let e;if(RL(c)?(e="argmax",g=XH({op:"argmax",field:c.argmax},{forAs:!0}),m.field=`${g}.${l}`):zL(c)?(e="argmin",g=XH({op:"argmin",field:c.argmin},{forAs:!0}),m.field=`${g}.${l}`):"boxplot"!==c&&"errorbar"!==c&&"errorband"!==c&&(e=c),e){const t={op:e,as:g};l&&(t.field=l),o.push(t)}}else if(n.push(g),UH(s)&&NU(f)){if(r.push({bin:f,field:l,as:g}),n.push(XH(s,{binSuffix:"end"})),gG(s,u)&&n.push(XH(s,{binSuffix:"range"})),dU(u)){const e={field:g+"_end"};a[u+"2"]=e}m.bin="binned",HI(u)||(m.type=Zq)}else if(d){i.push({timeUnit:d,field:l,as:g});const e=UH(s)&&s.type!==Kq&&"time";e&&(u===yI||u===_I?m.formatType=e:function(e){return!!uU[e]}(u)?m.legend=Object.assign({formatType:e},m.legend):dU(u)&&(m.axis=Object.assign({formatType:e},m.axis)))}a[u]=m}else n.push(l),a[u]=e[u]}else a[u]=e[u]})),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:a}}function IG(e,t,n,r){return iL(e).reduce(((i,o)=>{if(!qI(o))return pq(function(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}(o)),i;const a=e[o];if("angle"!==o||"arc"!==t||e.theta||(pq("Arc marks uses theta channel rather than angle, replacing angle with theta."),o=eI),!function(e,t,n){const r=function(e,t){return function(e){switch(e){case aI:case sI:case uI:case AI:case bI:case xI:case _I:case wI:case vI:case dI:case hI:case pI:case gI:case VL:case HL:case GL:return CU;case YL:case XL:case nI:case rI:return jU;case ZL:case JL:case iI:case oI:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case cI:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case mI:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case lI:return{point:"always",geoshape:"always"};case yI:return{text:"always"};case fI:return{point:"always",square:"always",text:"always"};case kI:return{image:"always"};case eI:case KL:return{text:"always",arc:"always"};case tI:case QL:return{arc:"always"}}}(e)[t]}(t,n);if(!r)return!1;if("binned"===r){const n=e[t===ZL?YL:XL];return!!(TH(n)&&TH(e[t])&&BU(n.bin))}return!0}(e,o,t))return pq(eq(o,t)),i;if(o===cI&&"line"===t){const t=oG(e[o]);if(null==t?void 0:t.aggregate)return pq("Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead."),i}if(o===aI&&(n?"fill"in e:"stroke"in e))return pq(KU("encoding",{fill:"fill"in e,stroke:"stroke"in e})),i;if(o===bI||o===vI&&!pP(a)&&!qH(a)||o===_I&&pP(a))a&&(i[o]=xP(a).reduce(((e,t)=>(TH(t)?e.push(lG(t,o)):pq(QU(t,o)),e)),[]));else{if(o===_I&&null===a)i[o]=null;else if(!(TH(a)||RH(a)||qH(a)||$H(a)||jq(a)))return pq(QU(a,o)),i;i[o]=sG(a,o,r)}return i}),{})}function UG(e,t){const n={};for(const r of iL(e)){const i=sG(e[r],r,t,{compositeMark:!0});n[r]=i}return n}function qG(e,t,n){if(e)for(const r of iL(e)){const i=e[r];if(pP(i))for(const e of i)t.call(n,e,r);else t.call(n,i,r)}}function WG(e,t){return iL(t).reduce(((n,r)=>{switch(r){case YL:case XL:case wI:case AI:case kI:case ZL:case JL:case eI:case tI:case KL:case QL:case nI:case rI:case iI:case oI:case yI:case lI:case fI:case _I:return n;case vI:if("line"===e||"trail"===e)return n;case bI:case xI:{const e=t[r];if(pP(e)||TH(e))for(const t of xP(e))t.aggregate||n.push(XH(t,{}));return n}case cI:if("trail"===e)return n;case aI:case sI:case uI:case dI:case hI:case pI:case mI:case gI:{const e=oG(t[r]);return e&&!e.aggregate&&n.push(XH(e,{})),n}}}),[])}var HG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const i=r?` of ${VG(t)}`:"";return{field:e+t.field,type:t.type,title:jq(n)?{signal:n+`"${escape(i)}"`}:n+i}})),o=function(e){const t=[];for(const n of iL(e))if(RG(e,n)){const r=xP(e[n]);for(const e of r)TH(e)?t.push(e):NH(e)&&t.push(e.condition)}return t}(n).map(YH);return{tooltip:[...i,...JP(o,WP)]}}function VG(e){const{title:t,field:n}=e;return bL(t,n)}function YG(e,t,n,r,i){const{scale:o,axis:a}=n;return({partName:s,mark:u,positionPrefix:l,endPositionPrefix:c,extraEncoding:f={}})=>{const d=VG(n);return XG(e,s,i,{mark:u,encoding:Object.assign(Object.assign(Object.assign({[t]:Object.assign(Object.assign(Object.assign({field:l+"_"+n.field,type:n.type},void 0!==d?{title:d}:{}),void 0!==o?{scale:o}:{}),void 0!==a?{axis:a}:{})},EP(c)?{[t+"2"]:{field:c+"_"+n.field}}:{}),r),f)})}}function XG(e,t,n,r){const{clip:i,color:o,opacity:a}=e,s=e.type;return e[t]||void 0===e[t]&&n[t]?[Object.assign(Object.assign({},r),{mark:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n[t]),i?{clip:i}:{}),o?{color:o}:{}),a?{opacity:a}:{}),YW(r.mark)?r.mark:{type:r.mark}),{style:`${s}-${t}`}),kP(e[t])?{}:e[t])})]:[]}function ZG(e,t,n){const{encoding:r}=e,i="vertical"===t?"y":"x",o=r[i],a=r[i+"2"],s=r[i+"Error"],u=r[i+"Error2"];return{continuousAxisChannelDef:JG(o,n),continuousAxisChannelDef2:JG(a,n),continuousAxisChannelDefError:JG(s,n),continuousAxisChannelDefError2:JG(u,n),continuousAxis:i}}function JG(e,t){if(e&&e.aggregate){const{aggregate:n}=e,r=HG(e,["aggregate"]);return n!==t&&pq(function(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}(n,t)),r}return e}function KG(e,t){const{mark:n,encoding:r}=e,{x:i,y:o}=r;if(YW(n)&&n.orient)return n.orient;if(PH(i)){if(PH(o)){const e=TH(i)&&i.aggregate,n=TH(o)&&o.aggregate;if(e||n!==t){if(n||e!==t){if(e===t&&n===t)throw new Error("Both x and y cannot have aggregate");return dG(o)&&!dG(i)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(PH(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}var QG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);iYG(l,y,m,e,t.boxplot),S=D(O),C=D(x),F=D(Object.assign(Object.assign({},O),E?{size:E}:{})),j=GG([{fieldPrefix:"min-max"===d?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===d?"lower_whisker_":"min_",titlePrefix:"Min"}],m,x),M={type:"tick",color:"black",opacity:1,orient:_,invalid:null,aria:!1},$="min-max"===d?j:GG([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],m,x),N=[...S({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:$}),...S({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:$}),...S({partName:"ticks",mark:M,positionPrefix:"lower_whisker",extraEncoding:$}),...S({partName:"ticks",mark:M,positionPrefix:"upper_whisker",extraEncoding:$})],B=[..."tukey"!==d?N:[],...C({partName:"box",mark:Object.assign(Object.assign({type:"bar"},f?{size:f}:{}),{orient:w,invalid:null,ariaRoleDescription:"box"}),positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:j}),...F({partName:"median",mark:Object.assign(Object.assign(Object.assign({type:"tick",invalid:null},gP(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{}),f?{size:f}:{}),{orient:_,aria:!1}),positionPrefix:"mid_box",extraEncoding:j})];if("min-max"===d)return Object.assign(Object.assign({},u),{transform:(null!==(r=u.transform)&&void 0!==r?r:[]).concat(g),layer:B});const T=`datum["lower_box_${m.field}"]`,z=`datum["upper_box_${m.field}"]`,R=`(${z} - ${T})`,P=`${T} - ${c} * ${R}`,L=`${z} + ${c} * ${R}`,I=`datum["${m.field}"]`,U={joinaggregate:iV(m.field),groupby:v},q={transform:[{filter:`(${P} <= ${I}) && (${I} <= ${L})`},{aggregate:[{op:"min",field:m.field,as:"lower_whisker_"+m.field},{op:"max",field:m.field,as:"upper_whisker_"+m.field},{op:"min",field:"lower_box_"+m.field,as:"lower_box_"+m.field},{op:"max",field:"upper_box_"+m.field,as:"upper_box_"+m.field},...b],groupby:v}],layer:N},{tooltip:W}=O,H=QG(O,["tooltip"]),{scale:G,axis:V}=m,Y=VG(m),X=UP(V,["title"]),Z=XG(l,"outliers",t.boxplot,{transform:[{filter:`(${I} < ${P}) || (${I} > ${L})`}],mark:"point",encoding:Object.assign(Object.assign(Object.assign({[y]:Object.assign(Object.assign(Object.assign({field:m.field,type:m.type},void 0!==Y?{title:Y}:{}),void 0!==G?{scale:G}:{}),rL(X)?{}:{axis:X})},H),A?{color:A}:{}),k?{tooltip:k}:{})})[0];let J;const K=[...h,...p,U];return Z?J={transform:K,layer:[Z,q]}:(J=q,J.transform.unshift(...K)),Object.assign(Object.assign({},u),{layer:[J,{transform:g,layer:B}]})}function iV(e){return[{op:"q1",field:e,as:"lower_box_"+e},{op:"q3",field:e,as:"upper_box_"+e}]}var oV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i1?{layer:p}:Object.assign({},p[0]))}function lV(e,t,n){var r;const{mark:i,encoding:o,selection:a,projection:s}=e,u=oV(e,["mark","encoding","selection","projection"]),l=YW(i)?i:{type:i};a&&pq(VU(t));const{orient:c,inputType:f}=function(e,t){const{encoding:n}=e;if(function(e){return(IH(e.x)||IH(e.y))&&!IH(e.x2)&&!IH(e.y2)&&!IH(e.xError)&&!IH(e.xError2)&&!IH(e.yError)&&!IH(e.yError2)}(n))return{orient:KG(e,t),inputType:"raw"};const r=function(e){return IH(e.x2)||IH(e.y2)}(n),i=function(e){return IH(e.xError)||IH(e.xError2)||IH(e.yError)||IH(e.yError2)}(n),o=n.x,a=n.y;if(r){if(i)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const e=n.x2,r=n.y2;if(IH(e)&&IH(r))throw new Error(`${t} cannot have both x2 and y2`);if(IH(e)){if(PH(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}if(IH(r)){if(PH(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}{const e=n.xError,r=n.xError2,i=n.yError,s=n.yError2;if(IH(r)&&!IH(e))throw new Error(`${t} cannot have xError2 without xError`);if(IH(s)&&!IH(i))throw new Error(`${t} cannot have yError2 without yError`);if(IH(e)&&IH(i))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(IH(e)){if(PH(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(IH(i)){if(PH(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}(e,t),{continuousAxisChannelDef:d,continuousAxisChannelDef2:h,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:g,continuousAxis:m}=ZG(e,c,t),{errorBarSpecificAggregate:y,postAggregateCalculates:v,tooltipSummary:b,tooltipTitleWithFieldName:x}=function(e,t,n,r,i,o,a,s){let u=[],l=[];const c=t.field;let f,d=!1;if("raw"===o){const t=e.center?e.center:e.extent?"iqr"===e.extent?"median":"mean":s.errorbar.center,n=e.extent?e.extent:"mean"===t?"stderr":"iqr";if("median"===t!=("iqr"===n)&&pq(function(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}(t,n,a)),"stderr"===n||"stdev"===n)u=[{op:n,field:c,as:"extent_"+c},{op:t,field:c,as:"center_"+c}],l=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:"upper_"+c},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:"lower_"+c}],f=[{fieldPrefix:"center_",titlePrefix:fL(t)},{fieldPrefix:"upper_",titlePrefix:cV(t,n,"+")},{fieldPrefix:"lower_",titlePrefix:cV(t,n,"-")}],d=!0;else{let e,t,r;"ci"===n?(e="mean",t="ci0",r="ci1"):(e="median",t="q1",r="q3"),u=[{op:t,field:c,as:"lower_"+c},{op:r,field:c,as:"upper_"+c},{op:e,field:c,as:"center_"+c}],f=[{fieldPrefix:"upper_",titlePrefix:tG({field:c,aggregate:r,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:tG({field:c,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:tG({field:c,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&pq(function(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}(e.center,e.extent)),"aggregated-upper-lower"===o?(f=[],l=[{calculate:`datum["${n.field}"]`,as:"upper_"+c},{calculate:`datum["${c}"]`,as:"lower_"+c}]):"aggregated-error"===o&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`datum["${c}"] + datum["${r.field}"]`,as:"upper_"+c}],i?l.push({calculate:`datum["${c}"] + datum["${i.field}"]`,as:"lower_"+c}):l.push({calculate:`datum["${c}"] - datum["${r.field}"]`,as:"lower_"+c}));for(const e of l)f.push({fieldPrefix:e.as.substring(0,6),titlePrefix:mL(mL(e.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}(l,d,h,p,g,f,t,n),_=o,w=m,k=(_[w],"x"===m?"x2":"y2"),A=(_[k],"x"===m?"xError":"yError"),E=(_[A],"x"===m?"xError2":"yError2"),O=(_[E],oV(_,["symbol"==typeof w?w:w+"","symbol"==typeof k?k:k+"","symbol"==typeof A?A:A+"","symbol"==typeof E?E:E+""])),{bins:D,timeUnits:S,aggregate:C,groupby:F,encoding:j}=LG(O,n),M=[...C,...y],$="raw"!==f?[]:F,N=GG(b,d,j,x);return{transform:[...null!==(r=u.transform)&&void 0!==r?r:[],...D,...S,...0===M.length?[]:[{aggregate:M,groupby:$}],...v],groupby:$,continuousAxisChannelDef:d,continuousAxis:m,encodingWithoutContinuousAxis:j,ticksOrient:"vertical"===c?"horizontal":"vertical",markDef:l,outerSpec:u,tooltipEncoding:N}}function cV(e,t,n){return fL(e)+" "+n+" "+t}const fV="errorband",dV=new TG(fV,hV);function hV(e,{config:t}){e=Object.assign(Object.assign({},e),{encoding:UG(e.encoding,t)});const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:a,outerSpec:s,tooltipEncoding:u}=lV(e,fV,t),l=a,c=YG(l,i,r,o,t.errorband),f=void 0!==e.encoding.x&&void 0!==e.encoding.y;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p=Object.assign(Object.assign({},l.interpolate?{interpolate:l.interpolate}:{}),l.tension&&l.interpolate?{tension:l.tension}:{});return f?(d=Object.assign(Object.assign(Object.assign({},d),p),{ariaRoleDescription:"errorband"}),h=Object.assign(Object.assign(Object.assign({},h),p),{aria:!1})):l.interpolate?pq(cq("interpolate")):l.tension&&pq(cq("tension")),Object.assign(Object.assign({},s),{transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]})}const pV={};function gV(e,t,n){const r=new TG(e,t);pV[e]={normalizer:r,parts:n}}gV(eV,rV,["box","median","outliers","rule","ticks"]),gV(aV,uV,["ticks","rule"]),gV(fV,hV,["band","borders"]);const mV=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],yV={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},vV={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},bV=iL(yV),xV=iL(vV),_V=iL({header:1,headerRow:1,headerColumn:1,headerFacet:1}),wV=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],kV={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1};iL(kV);var AV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function SV(e){return!(!e||"legend"!==e&&!e.legend)}function CV(e){return SV(e)&&gP(e)}function FV(e){return"concat"in e}function jV(e){return"vconcat"in e}function MV(e){return"hconcat"in e}function $V(e){return gP(e)&&void 0!==e.step}function NV(e){return e.view||e.width||e.height}const BV=iL({align:1,bounds:1,center:1,columns:1,spacing:1});var TV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ithis.mapLayerOrUnit(e,t)))})}mapHConcat(e,t){return Object.assign(Object.assign({},e),{hconcat:e.hconcat.map((e=>this.map(e,t)))})}mapVConcat(e,t){return Object.assign(Object.assign({},e),{vconcat:e.vconcat.map((e=>this.map(e,t)))})}mapConcat(e,t){const{concat:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ithis.map(e,t)))})}mapFacet(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}mapRepeat(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}}const eY={zero:1,center:1,normalize:1},tY=new Set([jW,$W,MW,RW,TW,UW,qW,BW,PW,LW]),nY=new Set([$W,MW,jW]);function rY(e,t){var n,r;const i="x"===t?"y":"radius",o=e[t],a=e[i];if(TH(o)&&TH(a))if("quantitative"===zH(o)&&"quantitative"===zH(a)){if(o.stack)return t;if(a.stack)return i;const e=TH(o)&&!!o.aggregate;if(e!==(TH(a)&&!!a.aggregate))return e?t:i;{const e=null===(n=o.scale)||void 0===n?void 0:n.type,s=null===(r=a.scale)||void 0===r?void 0:r.type;if(e&&"linear"!==e)return i;if(s&&"linear"!==s)return t}}else{if("quantitative"===zH(o))return t;if("quantitative"===zH(a))return i}else{if("quantitative"===zH(o))return t;if("quantitative"===zH(a))return i}}function iY(e,t,n={}){const r=YW(e)?e.type:e;if(!tY.has(r))return null;const i=rY(t,"x")||rY(t,"theta");if(!i)return null;const o=t[i],a=TH(o)?XH(o,{}):void 0;let s=function(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(i),u=t[s],l=TH(u)?XH(u,{}):void 0;l===a&&(l=void 0,u=void 0,s=void 0);const c=lU.reduce(((e,n)=>{if("tooltip"!==n&&RG(t,n)){const r=t[n];for(const t of xP(r)){const r=oG(t);if(r.aggregate)continue;const i=XH(r,{});i&&i===l||e.push({channel:n,fieldDef:r})}}return e}),[]);let f;if(void 0!==o.stack?f=kP(o.stack)?o.stack?"zero":null:o.stack:c.length>0&&nY.has(r)&&(f="zero"),!f||!(f in eY))return null;var d;if(PG(t)&&0===c.length)return null;if(o.scale&&o.scale.type&&o.scale.type!==tW.LINEAR){if(n.disallowNonLinearStack)return null;pq(function(e){return`Cannot stack non-linear scale (${e}).`}(o.scale.type))}return IH(t[YI(i)])?(void 0!==o.stack&&pq(`Cannot stack "${d=i}" if there is already "${d}2".`),null):(TH(o)&&o.aggregate&&!GP(UL,o.aggregate)&&pq(`Stacking is applied even though the aggregate function is non-summative ("${o.aggregate}").`),{groupbyChannel:u?s:void 0,groupbyField:l,fieldChannel:i,impute:null!==o.impute&&HW(r),stackBy:c,offset:f})}var oY=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i1?r:r.type}function sY(e){for(const t of["line","area","rule","trail"])e[t]&&(e=Object.assign(Object.assign({},e),{[t]:UP(e[t],["point","line"])}));return e}function uY(e,t={},n){return"transparent"===e.point?{opacity:0}:e.point?gP(e.point)?e.point:{}:void 0!==e.point?null:t.point||n.shape?gP(t.point)?t.point:{}:void 0}function lY(e,t={}){return e.line?!0===e.line?{}:e.line:void 0!==e.line?null:t.line?!0===t.line?{}:t.line:void 0}class cY{constructor(){this.name="path-overlay"}hasMatchingType(e,t){if(BG(e)){const{mark:n,encoding:r}=e,i=YW(n)?n:{type:n};switch(i.type){case"line":case"rule":case"trail":return!!uY(i,t[i.type],r);case"area":return!!uY(i,t[i.type],r)||!!lY(i,t[i.type])}}return!1}run(e,t,n){const{config:r}=t,{selection:i,projection:o,mark:a,encoding:s}=e,u=oY(e,["selection","projection","mark","encoding"]),l=UG(s,r),c=YW(a)?a:{type:a},f=uY(c,r[c.type],l),d="area"===c.type&&lY(c,r[c.type]),h=[Object.assign(Object.assign({},i?{selection:i}:{}),{mark:aY(Object.assign(Object.assign({},"area"===c.type&&void 0===c.opacity&&void 0===c.fillOpacity?{opacity:.7}:{}),c)),encoding:UP(l,["shape"])})],p=iY(c,l);let g=l;if(p){const{fieldChannel:e,offset:t}=p;g=Object.assign(Object.assign({},l),{[e]:Object.assign(Object.assign({},l[e]),t?{stack:t}:{})})}return d&&h.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"line"},IP(c,["clip","interpolate","tension","tooltip"])),d),encoding:g})),f&&h.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"point",opacity:1,filled:!0},IP(c,["clip","tooltip"])),f),encoding:g})),n(Object.assign(Object.assign({},u),{layer:h}),Object.assign(Object.assign({},t),{config:sY(r)}))}}var fY=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ibY(e,t))).filter((e=>e));else{const e=bY(i,t);void 0!==e&&(n[r]=e)}}return n}class _Y{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if(BG(e)){const{encoding:t,mark:n}=e;if("line"===n)for(const e of WI){const n=t[GI(e)];if(t[e]&&(TH(n)&&!BU(n.bin)||RH(n)))return!0}}return!1}run(e,t,n){const{encoding:r}=e;var i,o;return pq((i=!!r.x2,o=!!r.y2,`Line mark is for continuous lines and thus cannot be used with ${i&&o?"x2 and y2":i?"x2":"y2"}. We will use the rule mark (line segments) instead.`)),n(Object.assign(Object.assign({},e),{mark:"rule"}),t)}}var wY=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const n=Object.assign(Object.assign({},u),{layer:e}),i=(r.name||"")+l+`child__layer_${uL(e)}`,o=this.mapLayerOrUnit(r,Object.assign(Object.assign({},t),{repeater:n,repeaterPrefix:i}));return o.name=i,o}))})}mapNonLayerRepeat(e,t){var n;const{repeat:r,spec:i,data:o}=e,a=wY(e,["repeat","spec","data"]);!pP(r)&&e.columns&&(e=UP(e,["columns"]),pq(YU("repeat")));const s=[],{repeater:u={},repeaterPrefix:l=""}=t,c=!pP(r)&&r.row||[u?u.row:null],f=!pP(r)&&r.column||[u?u.column:null],d=pP(r)&&r||[u?u.repeat:null];for(const e of d)for(const n of c)for(const o of f){const a={repeat:e,row:n,column:o,layer:u.layer},c=(i.name||"")+l+"child__"+(pP(r)?`${uL(e)}`:(r.row?`row_${uL(n)}`:"")+(r.column?`column_${uL(o)}`:"")),f=this.map(i,Object.assign(Object.assign({},t),{repeater:a,repeaterPrefix:c}));f.name=c,s.push(UP(f,["data"]))}const h=pP(r)?e.columns:r.column?r.column.length:1;return Object.assign(Object.assign({data:null!==(n=i.data)&&void 0!==n?n:o,align:"all"},a),{columns:h,concat:s})}mapFacet(e,t){const{facet:n}=e;return EH(n)&&e.columns&&(e=UP(e,["columns"]),pq(YU("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){const{encoding:n,projection:r}=e,{parentEncoding:i,parentProjection:o,config:a}=t,s=AY({parentProjection:o,projection:r}),u=kY({parentEncoding:i,encoding:gY(n,t.repeater)});return this.mapUnit(Object.assign(Object.assign(Object.assign({},e),s?{projection:s}:{}),u?{encoding:u}:{}),{config:a})}mapFacetedUnit(e,t){const n=e.encoding,{row:r,column:i,facet:o}=n,a=wY(n,["row","column","facet"]),{mark:s,width:u,projection:l,height:c,view:f,selection:d,encoding:h}=e,p=wY(e,["mark","width","projection","height","view","selection","encoding"]),{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},t),y=gY(a,t.repeater);return this.mapFacet(Object.assign(Object.assign(Object.assign({},p),m),{facet:g,spec:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},u?{width:u}:{}),c?{height:c}:{}),f?{view:f}:{}),l?{projection:l}:{}),{mark:s,encoding:y}),d?{selection:d}:{})}),t)}getFacetMappingAndLayout(e,t){var n;const{row:r,column:i,facet:o}=e;if(r||i){o&&pq(`Facet encoding dropped as ${(a=[...r?[HL]:[],...i?[GL]:[]]).join(" and ")} ${a.length>1?"are":"is"} also specified.`);const t={},s={};for(const r of[HL,GL]){const i=e[r];if(i){const{align:e,center:o,spacing:a,columns:u}=i,l=wY(i,["align","center","spacing","columns"]);t[r]=l;for(const e of["align","center","spacing"])void 0!==i[e]&&(s[e]=null!==(n=s[e])&&void 0!==n?n:{},s[e][r]=i[e])}}return{facetMapping:t,layout:s}}{const{align:e,center:n,spacing:r,columns:i}=o;return{facetMapping:pY(wY(o,["align","center","spacing","columns"]),t.repeater),layout:Object.assign(Object.assign(Object.assign(Object.assign({},e?{align:e}:{}),n?{center:n}:{}),r?{spacing:r}:{}),i?{columns:i}:{})}}var a}mapLayer(e,t){var{parentEncoding:n,parentProjection:r}=t,i=wY(t,["parentEncoding","parentProjection"]);const{encoding:o,projection:a}=e,s=wY(e,["encoding","projection"]),u=Object.assign(Object.assign({},i),{parentEncoding:kY({parentEncoding:n,encoding:o,layer:!0}),parentProjection:AY({parentProjection:r,projection:a})});return super.mapLayer(s,u)}};function DY(e){return EP(e)?{type:e}:null!=e?e:{}}const SY=["background","padding"];function CY(e,t){const n={};for(const t of SY)e&&void 0!==e[t]&&(n[t]=_G(e[t]));return t&&(n.params=e.params),n}class FY{constructor(e={},t={}){this.explicit=e,this.implicit=t}clone(){return new FY(LP(this.explicit),LP(this.implicit))}combine(){return Object.assign(Object.assign({},this.explicit),this.implicit)}get(e){return bL(this.explicit[e],this.implicit[e])}getWithExplicit(e){return void 0!==this.explicit[e]?{explicit:!0,value:this.explicit[e]}:void 0!==this.implicit[e]?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,t){void 0!==t.value&&this.set(e,t.value,t.explicit)}set(e,t,n){return delete this[n?"implicit":"explicit"][e],this[n?"explicit":"implicit"][e]=t,this}copyKeyFromSplit(e,t){void 0!==t.explicit[e]?this.set(e,t.explicit[e],!0):void 0!==t.implicit[e]&&this.set(e,t.implicit[e],!1)}copyKeyFromObject(e,t){void 0!==t[e]&&this.set(e,t[e],!0)}copyAll(e){for(const t of iL(e.combine())){const n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}}function jY(e){return{explicit:!0,value:e}}function MY(e){return{explicit:!1,value:e}}function $Y(e){return(t,n,r,i)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:NY(t,n,r,i)}}function NY(e,t,n,r){return e.explicit&&t.explicit&&pq(function(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${qP(n)} and ${qP(r)}). Using ${qP(n)}.`}(n,r,e.value,t.value)),e}function BY(e,t,n,r,i=NY){return void 0===e||void 0===e.value?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:PP(e.value,t.value)?e:i(e,t,n,r)}class TY extends FY{constructor(e={},t={},n=!1){super(e,t),this.explicit=e,this.implicit=t,this.parseNothing=n}clone(){const e=super.clone();return e.parseNothing=this.parseNothing,e}}function zY(e){return"url"in e}function RY(e){return"values"in e}function PY(e){return"name"in e&&!zY(e)&&!RY(e)&&!LY(e)}function LY(e){return e&&(IY(e)||UY(e)||qY(e))}function IY(e){return"sequence"in e}function UY(e){return"sphere"in e}function qY(e){return"graticule"in e}var WY;function HY(e){return"filter"in e}function GY(e){return void 0!==(null==e?void 0:e.stop)}function VY(e){return"lookup"in e}function YY(e){return"pivot"in e}function XY(e){return"density"in e}function ZY(e){return"quantile"in e}function JY(e){return"regression"in e}function KY(e){return"loess"in e}function QY(e){return"sample"in e}function eX(e){return"window"in e}function tX(e){return"joinaggregate"in e}function nX(e){return"flatten"in e}function rX(e){return"calculate"in e}function iX(e){return"bin"in e}function oX(e){return"impute"in e}function aX(e){return"timeUnit"in e}function sX(e){return"aggregate"in e}function uX(e){return"stack"in e}function lX(e){return"fold"in e}!function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup"}(WY||(WY={}));const cX="[",fX="]",dX="{",hX="}",pX=":",gX=",",mX="@",yX=">",vX=/[[\]{}]/,bX={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let xX,_X;function wX(e,t,n){return xX=t||"view",_X=n||bX,AX(e.trim()).map(EX)}function kX(e,t,n,r,i){const o=e.length;let a,s=0;for(;t=0?--s:r&&r.indexOf(a)>=0&&++s}return t}function AX(e){const t=[],n=e.length;let r=0,i=0;for(;i' after between selector: "+e;n=n.map(EX);const i=EX(e.slice(1).trim());return i.between?{between:n,stream:i}:(i.between=n,i)}(e):function(e){const t={source:xX},n=[];let r,i,o=[0,0],a=0,s=0,u=e.length,l=0;if(e[u-1]===hX){if(l=e.lastIndexOf(dX),!(l>=0))throw"Unmatched right brace: "+e;try{o=function(e){const t=e.split(gX);if(!e.length||t.length>2)throw e;return t.map((t=>{const n=+t;if(n!=n)throw e;return n}))}(e.substring(l+1,u-1))}catch(t){throw"Invalid throttle specification: "+e}u=(e=e.slice(0,l).trim()).length,l=0}if(!u)throw e;if(e[0]===mX&&(a=++l),r=kX(e,l,pX),r1?(t.type=n[1],a?t.markname=n[0].slice(1):(c=n[0],_X[c]?t.marktype=n[0]:t.source=n[0])):t.type=n[0],"!"===t.type.slice(-1)&&(t.consume=!0,t.type=t.type.slice(0,-1)),null!=i&&(t.filter=i),o[0]&&(t.throttle=o[0]),o[1]&&(t.debounce=o[1]),t}(e)}function OX(e,t,n,r){const i=$H(t)&&t.condition,o=r(t);if(i){const t=xP(i).map((t=>{const n=r(t),i=function(e){return e.selection}(t)?DK(e,t.selection):CK(e,t.test);return Object.assign({test:i},n)}));return{[n]:[...t,...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function DX(e,t="text"){const n=e.encoding[t];return OX(e,n,t,(t=>SX(t,e.config)))}function SX(e,t,n="datum"){if(e){if(qH(e))return kG(e.value);if(IH(e)){const{format:r,formatType:i}=iG(e);return cH({fieldOrDatumDef:e,format:r,formatType:i,expr:n,config:t})}}}function CX(e,t={}){const{encoding:n,markDef:r,config:i,stack:o}=e,a=n.tooltip;if(pP(a))return{tooltip:jX({tooltip:a},o,i,t)};{const s=t.reactiveGeom?"datum.datum":"datum";return OX(e,a,"tooltip",(e=>{const a=SX(e,i,s);if(a)return a;if(null===e)return;let u=DG("tooltip",r,i);return!0===u&&(u={content:"encoding"}),EP(u)?{value:u}:gP(u)?jq(u)?u:"encoding"===u.content?jX(n,o,i,t):{signal:s}:void 0}))}}function FX(e,t,n,{reactiveGeom:r}={}){const i={},o=r?"datum.datum":"datum",a=[];function s(r,s){const u=GI(s),l=UH(r)?r:Object.assign(Object.assign({},r),{type:e[u].type}),c=xP(l.title||rG(l,n)).join(", ");let f;if(dU(s)){const r="x"===s?"x2":"y2",a=oG(e[r]);if(BU(l.bin)&&a){const e=XH(l,{expr:o}),t=XH(a,{expr:o}),{format:s,formatType:u}=iG(l);f=vH(e,t,s,u,n),i[r]=!0}else if(t&&t.fieldChannel===s&&"normalize"===t.offset){const{format:e,formatType:t}=iG(l);f=cH({fieldOrDatumDef:l,format:e,formatType:t,expr:o,config:n,normalizeStack:!0}).signal}}f=null!=f?f:SX(l,n,o).signal,a.push({channel:s,key:c,value:f})}qG(e,((e,t)=>{TH(e)?s(e,t):NH(e)&&s(e.condition,t)}));const u={};for(const{channel:e,key:t,value:n}of a)i[e]||u[t]||(u[t]=n);return u}function jX(e,t,n,{reactiveGeom:r}={}){const i=FX(e,t,n,{reactiveGeom:r}),o=aL(i).map((([e,t])=>`"${e}": ${t}`));return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function MX(e,t,n={}){const{markDef:r,encoding:i,config:o}=t,{vgChannel:a}=n;let{defaultRef:s,defaultValue:u}=n;void 0===s&&(u=null!=u?u:DG(e,r,o,{vgChannel:a,ignoreVgConfig:!0}),void 0!==u&&(s=kG(u)));const l=i[e];return OX(t,l,null!=a?a:e,(n=>oH({channel:e,channelDef:n,markDef:r,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:s})))}function $X(e,t={filled:void 0}){var n,r,i,o;const{markDef:a,encoding:s,config:u}=e,{type:l}=a,c=null!==(n=t.filled)&&void 0!==n?n:DG("filled",a,u),f=GP(["bar","point","circle","square","geoshape"],l)?"transparent":void 0,d=null!==(i=null!==(r=DG(!0===c?"color":void 0,a,u,{vgChannel:"fill"}))&&void 0!==r?r:u.mark[!0===c&&"color"])&&void 0!==i?i:f,h=null!==(o=DG(!1===c?"color":void 0,a,u,{vgChannel:"stroke"}))&&void 0!==o?o:u.mark[!1===c&&"color"],p=c?"fill":"stroke",g=Object.assign(Object.assign({},d?{fill:kG(d)}:{}),h?{stroke:kG(h)}:{});return a.color&&(c?a.fill:a.stroke)&&pq(KU("property",{fill:"fill"in a,stroke:"stroke"in a})),Object.assign(Object.assign(Object.assign(Object.assign({},g),MX("color",e,{vgChannel:p,defaultValue:c?d:h})),MX("fill",e,{defaultValue:s.fill?d:void 0})),MX("stroke",e,{defaultValue:s.stroke?h:void 0}))}function NX(e,t){const n=function(e){switch(e){case YL:return"xOffset";case XL:return"yOffset";case ZL:return"x2Offset";case JL:return"y2Offset";case eI:return"thetaOffset";case KL:return"radiusOffset";case tI:return"theta2Offset";case QL:return"radius2Offset"}}(e),r=t[n];if(r)return r}function BX(e,t,{defaultPos:n,vgChannel:r,isMidPoint:i}){const{encoding:o,markDef:a,config:s,stack:u}=t,l=o[e],c=o[YI(e)],f=t.scaleName(e),d=t.getScaleComponent(e),h=NX(e,a),p=TX({model:t,defaultPos:n,channel:e,scaleName:f,scale:d}),g=!l&&dU(e)&&(o.latitude||o.longitude)?{field:t.getName(e)}:function(e){const{channel:t,channelDef:n,isMidPoint:r,scaleName:i,stack:o,offset:a,markDef:s,config:u}=e;if(IH(n)&&o&&t===o.fieldChannel){if(TH(n)){const e=jH({channel:t,fieldDef:n,isMidPoint:r,markDef:s,stack:o,config:u});if(void 0!==e)return iH({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",band:e,offset:a})}return rH(n,i,{suffix:"end"},{offset:a})}return QW(e)}({channel:e,channelDef:l,channel2Def:c,markDef:a,config:s,isMidPoint:i,scaleName:f,scale:d,stack:u,offset:h,defaultRef:p});return g?{[r||e]:g}:void 0}function TX({model:e,defaultPos:t,channel:n,scaleName:r,scale:i}){const{markDef:o,config:a}=e;return()=>{const s=GI(n),u=VI(n),l=DG(n,o,a,{vgChannel:u});if(void 0!==l)return aH(n,l);switch(t){case"zeroOrMin":case"zeroOrMax":if(r){const e=i.get("type");if(GP([tW.LOG,tW.TIME,tW.UTC],e));else if(i.domainDefinitelyIncludesZero())return{scale:r,value:0}}if("zeroOrMin"===t)return"y"===s?{field:{group:"height"}}:{value:0};switch(s){case"radius":return{signal:`min(${e.width.signal},${e.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":{const t=e[XI(n)];return Object.assign(Object.assign({},t),{mult:.5})}}}}const zX={left:"x",center:"xc",right:"x2"},RX={top:"y",middle:"yc",bottom:"y2"};function PX(e,t,n,r="middle"){if("radius"===e||"theta"===e)return VI(e);const i="x"===e?"align":"baseline",o=DG(i,t,n);let a;return jq(o)?(pq(function(e){return`The ${e} for range marks cannot be an expression`}(i)),a=void 0):a=o,"x"===e?zX[a||("top"===r?"left":"center")]:RX[a||r]}function LX(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?IX(e,t,{defaultPos:n,defaultPos2:r}):BX(e,t,{defaultPos:n})}function IX(e,t,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=t,a=YI(e),s=XI(e),u=function(e,t,n){const{encoding:r,mark:i,markDef:o,stack:a,config:s}=e,u=GI(n),l=XI(n),c=VI(n),f=r[u],d=e.scaleName(u),h=e.getScaleComponent(u),p=NX(n in r||n in o?n:u,e.markDef);if(!f&&("x2"===n||"y2"===n)&&(r.latitude||r.longitude))return{[c]:{field:e.getName(n)}};const g=function({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:o,scale:a,stack:s,offset:u,defaultRef:l}){return IH(t)&&s&&e.charAt(0)===s.fieldChannel.charAt(0)?rH(t,o,{suffix:"start"},{offset:u}):QW({channel:e,channelDef:n,scaleName:o,scale:a,stack:s,markDef:r,config:i,offset:u,defaultRef:l})}({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:s,scaleName:d,scale:h,stack:a,offset:p,defaultRef:void 0});return void 0!==g?{[c]:g}:UX(n,o)||UX(n,{[n]:CG(n,o,s.style),[l]:CG(l,o,s.style)})||UX(n,s[i])||UX(n,s.mark)||{[c]:TX({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}(t,r,a),l=u[s]?PX(e,i,o):VI(e);return Object.assign(Object.assign({},BX(e,t,{defaultPos:n,vgChannel:l})),u)}function UX(e,t){const n=XI(e),r=VI(e);return void 0!==t[r]?{[r]:aH(e,t[r])}:void 0!==t[e]?{[r]:aH(e,t[e])}:t[n]?{[n]:aH(e,t[n])}:void 0}function qX(e,t,n){var r,i,o,a;const{config:s,encoding:u,markDef:l,stack:c}=e,f=YI(t),d=XI(t),h=u[t],p=u[f],g=e.getScaleComponent(t),m=g?g.get("type"):void 0,y=e.scaleName(t),v=l.orient,b=null!==(i=null!==(r=u[d])&&void 0!==r?r:u.size)&&void 0!==i?i:DG("size",l,s,{vgChannel:d}),x="bar"===n&&("x"===t?"vertical"===v:"horizontal"===v);if(TH(h)&&(NU(h.bin)||BU(h.bin)||h.timeUnit&&!p)&&!b&&!dW(m)){const n=jH({channel:t,fieldDef:h,stack:c,markDef:l,config:s}),r=null===(o=e.component.axes[t])||void 0===o?void 0:o[0];return function({fieldDef:e,fieldDef2:t,channel:n,band:r,scaleName:i,markDef:o,spacing:a=0,axisTranslate:s,reverse:u,config:l}){const c=YI(n),f=VI(n),d=VI(c),h=NX(n,o);if(NU(e.bin)||e.timeUnit)return{[d]:GX({channel:n,fieldDef:e,scaleName:i,markDef:o,band:(1-r)/2,offset:HX(c,a,u,s,h),config:l}),[f]:GX({channel:n,fieldDef:e,scaleName:i,markDef:o,band:1-(1-r)/2,offset:HX(n,a,u,s,h),config:l})};if(BU(e.bin)){const r=rH(e,i,{},{offset:HX(c,a,u,s,h)});if(TH(t))return{[d]:r,[f]:rH(t,i,{},{offset:HX(n,a,u,s,h)})};if(TU(e.bin)&&e.bin.step)return{[d]:r,[f]:{signal:`scale("${i}", ${XH(e,{expr:"datum"})} + ${e.bin.step})`,offset:HX(n,a,u,s,h)}}}pq(fq(c))}({fieldDef:h,fieldDef2:p,channel:t,markDef:l,scaleName:y,band:n,axisTranslate:null!==(a=null==r?void 0:r.get("translate"))&&void 0!==a?a:.5,spacing:dU(t)?DG("binSpacing",l,s):void 0,reverse:g.get("reverse"),config:s})}return(IH(h)&&dW(m)||x)&&!p?function(e,t,n,r){var i;const{markDef:o,encoding:a,config:s,stack:u}=r,l=o.orient,c=r.scaleName(n),f=r.getScaleComponent(n),d=XI(n),h=YI(n),p="horizontal"===l&&"y"===n||"vertical"===l&&"x"===n,g=DG(p?"size":d,o,s,{vgChannel:d});let m;(a.size||void 0!==g)&&(p?m=MX("size",r,{vgChannel:d,defaultValue:g}):pq(function(e){return`Cannot apply size to non-oriented mark "${e}".`}(o.type)));const y=null!==(i=IH(t)?jH({channel:n,fieldDef:t,markDef:o,stack:u,config:s}):void 0)&&void 0!==i?i:1;m=m||{[d]:WX(e,d,c,f,s,y)};const v="band"!==(null==f?void 0:f.get("type"))||!("band"in m[d]),b=PX(n,o,s,v?"middle":"top"),x=NX(n,o),_=QW({channel:n,channelDef:t,markDef:o,config:s,scaleName:c,scale:f,stack:u,offset:x,defaultRef:TX({model:r,defaultPos:"mid",channel:n,scaleName:c,scale:f}),band:v?.5:(1-y)/2});if(d)return Object.assign({[b]:_},m);{const e=VI(h),t=m[d],n=x?Object.assign(Object.assign({},t),{offset:x}):t;return{[b]:_,[e]:pP(_)?[_[0],Object.assign(Object.assign({},_[1]),{offset:n})]:Object.assign(Object.assign({},_),{offset:n})}}}(n,h,t,e):IX(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function WX(e,t,n,r,i,o){if(r){const t=r.get("type");if("point"===t||"band"===t){if(void 0!==i[e].discreteBandSize)return{value:i[e].discreteBandSize};if(t===tW.POINT){const e=r.get("range");return Mq(e)&&AP(e.step)?{value:e.step-2}:{value:LV-2}}return{scale:n,band:o}}return{value:i[e].continuousBandSize}}const a=RV(i.view,t),s=bL(i[e].discreteBandSize,a-2);return void 0!==s?{value:s}:void 0}function HX(e,t,n,r,i){if(OI(e))return 0;const o="x"===e||"y2"===e?-t/2:t/2;if(jq(n)||jq(i)||jq(r)){const e=EG(n),t=EG(i),a=EG(r);return{signal:(a?`${a} + `:"")+(e?`(${e} ? -1 : 1) * `:"")+(t?`(${t} + ${o})`:o)}}return i=i||0,r+(n?-i-o:+i+o)}function GX({channel:e,fieldDef:t,scaleName:n,markDef:r,band:i,offset:o,config:a}){return eH({fieldDef:t,channel:e,markDef:r,ref:iH({scaleName:n,fieldOrDatumDef:t,band:i,offset:o}),config:a})}const VX=new Set(["aria"]);function YX(e,t){const{fill:n,stroke:r}="include"===t.color?$X(e):{};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},function(e,t){return Nq.reduce(((n,r)=>(VX.has(r)||void 0===e[r]||"ignore"===t[r]||(n[r]=kG(e[r])),n)),{})}(e.markDef,t)),XX(e,"fill",n)),XX(e,"stroke",r)),MX("opacity",e)),MX("fillOpacity",e)),MX("strokeOpacity",e)),MX("strokeWidth",e)),MX("strokeDash",e)),function(e){const{encoding:t,mark:n}=e,r=t.order;return!HW(n)&&qH(r)?OX(e,r,"zindex",(e=>kG(e.value))):{}}(e)),CX(e)),DX(e,"href")),function(e){const{markDef:t,config:n}=e,r=DG("aria",t,n);return!1===r?{}:Object.assign(Object.assign(Object.assign({},r?{aria:r}:{}),function(e){const{mark:t,markDef:n,config:r}=e;if(!1===r.aria)return{};const i=DG("ariaRoleDescription",n,r);return null!=i?{ariaRoleDescription:{value:i}}:t in Bq?{}:{ariaRoleDescription:{value:t}}}(e)),function(e){const{encoding:t,markDef:n,config:r,stack:i}=e,o=t.description;if(o)return OX(e,o,"description",(t=>SX(t,e.config)));const a=DG("description",n,r);if(null!=a)return{description:kG(a)};if(!1===r.aria)return{};const s=FX(t,i,r);return rL(s)?void 0:{description:{signal:aL(s).map((([e,t],n)=>`"${n>0?"; ":""}${e}: " + (${t})`)).join(" + ")}}}(e))}(e))}function XX(e,t,n){const{config:r,mark:i,markDef:o}=e;if("hide"===DG("invalid",o,r)&&n&&!HW(i)){const r=function(e,{invalid:t=!1,channels:n}){const r=n.reduce(((t,n)=>{const r=e.getScaleComponent(n);if(r){const i=r.get("type"),o=e.vgField(n,{expr:"datum"});o&&hW(i)&&(t[o]=!0)}return t}),{}),i=iL(r);if(i.length>0){const e=t?"||":"&&";return i.map((e=>nH(e,t))).join(` ${e} `)}}(e,{invalid:!0,channels:DU});if(r)return{[t]:[{test:r,value:null},...xP(n)]}}return n?{[t]:n}:{}}function ZX(e){const{config:t,markDef:n}=e;if(DG("invalid",n,t)){const t=function(e,{invalid:t=!1,channels:n}){const r=n.reduce(((t,n)=>{const r=e.getScaleComponent(n);if(r){const i=r.get("type"),o=e.vgField(n,{expr:"datum"});o&&hW(i)&&(t[o]=!0)}return t}),{}),i=iL(r);if(i.length>0){const e=t?"||":"&&";return i.map((e=>nH(e,t))).join(` ${e} `)}}(e,{channels:fU});if(t)return{defined:{signal:t}}}return{}}function JX(e,t){if(void 0!==t)return{[e]:kG(t)}}const KX="voronoi",QX={has:e=>"interval"!==e.type&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(KX)},marks:(e,t,n)=>{const{x:r,y:i}=t.project.hasChannel,o=e.mark;if(HW(o))return pq(`The "nearest" transform is not supported for ${o} marks.`),n;const a={name:e.getName(KX),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:Object.assign({fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0}},CX(e,{reactiveGeom:!0}))},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let s=0,u=!1;return n.forEach(((t,n)=>{var r;const i=null!==(r=t.name)&&void 0!==r?r:"";i===e.component.mark[0].name?s=n:i.indexOf(KX)>=0&&(u=!0)})),u||n.splice(s+1,0,a),n}},eZ=QX;class tZ{constructor(e,t){this.debugName=t,this._children=[],this._parent=null,e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e,e&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,t){this._children.indexOf(e)>-1?pq("Attempt to add the same child twice."):void 0!==t?this._children.splice(t,0,e):this._children.push(e)}removeChild(e){const t=this._children.indexOf(e);return this._children.splice(t,1),t}remove(){let e=this._parent.removeChild(this);for(const t of this._children)t._parent=this._parent,this._parent.addChild(t,e++)}insertAsParentOf(e){const t=e.parent;t.removeChild(this),this.parent=t,e.parent=this}swapWithParent(){const e=this._parent,t=e.parent;for(const t of this._children)t.parent=e;this._children=[],e.removeChild(this),e.parent.removeChild(e),this.parent=t,e.parent=this}}class nZ extends tZ{constructor(e,t,n,r){super(e,t),this.type=n,this.refCounts=r,this._source=this._name=t,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}clone(){const e=new this.constructor;return e.debugName="clone_"+this.debugName,e._source=this._source,e._name="clone_"+this._name,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}dependentFields(){return new Set}producedFields(){return new Set}hash(){return void 0===this._hash&&(this._hash=`Output ${_L()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}var rZ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{field:i,timeUnit:o}=n,a=J0(t)?t.encoding[YI(r)]:void 0,s=J0(t)&&MH(r,n,a,t.stack,t.markDef,t.config);if(o){const t=XH(n,{forAs:!0});e[WP({as:t,field:i,timeUnit:o})]=Object.assign({as:t,field:i,timeUnit:o},s?{band:!0}:{})}return e}),{});return rL(n)?null:new iZ(e,n)}static makeFromTransform(e,t){const n=Object.assign({},t),{timeUnit:r}=n,i=rZ(n,["timeUnit"]),o=Fq(r),a=Object.assign(Object.assign({},i),{timeUnit:o});return new iZ(e,{[WP(a)]:a})}merge(e){this.formula=Object.assign({},this.formula);for(const t in e.formula)this.formula[t]&&!e.formula[t].band||(this.formula[t]=e.formula[t]);for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}removeFormulas(e){const t={};for(const[n,r]of aL(this.formula))e.has(r.as)||(t[n]=r);this.formula=t}producedFields(){return new Set(oL(this.formula).map((e=>e.as)))}dependentFields(){return new Set(oL(this.formula).map((e=>e.field)))}hash(){return`TimeUnit ${WP(this.formula)}`}assemble(){const e=[];for(const t of oL(this.formula)){const{field:n,as:r,timeUnit:i}=t,o=Fq(i),{unit:a,utc:s}=o,u=rZ(o,["unit","utc"]);e.push(Object.assign(Object.assign(Object.assign(Object.assign({field:gL(n),type:"timeunit"},a?{units:Dq(a)}:{}),s?{timezone:"utc"}:{}),u),{as:[r,`${r}_end`]}))}return e}}const oZ="_tuple_fields";class aZ{constructor(...e){this.items=e,this.hasChannel={},this.hasField={}}}const sZ={has:()=>!0,parse:(e,t,n)=>{var r,i,o;const a=t.name,s=null!==(r=t.project)&&void 0!==r?r:t.project=new aZ,u={},l={},c=new Set,f=(e,t)=>{const n="visual"===t?e.channel:e.field;let r=uL(`${a}_${n}`);for(let e=1;c.has(r);e++)r=uL(`${a}_${n}_${e}`);return c.add(r),{[t]:r}};if(!n.fields&&!n.encodings){const t=e.config.selection[n.type];if(n.init)for(const e of xP(n.init))for(const r of iL(e))UI[r]?(n.encodings||(n.encodings=[])).push(r):"interval"===n.type?(pq('Interval selections should be initialized using "x" and/or "y" keys.'),n.encodings=t.encodings):(n.fields||(n.fields=[])).push(r);else n.encodings=t.encodings,n.fields=t.fields}for(const e of null!==(i=n.fields)&&void 0!==i?i:[]){const t={type:"E",field:e};t.signals=Object.assign({},f(t,"data")),s.items.push(t),s.hasField[e]=t}for(const r of null!==(o=n.encodings)&&void 0!==o?o:[]){const n=e.fieldDef(r);if(n){let i=n.field;if(n.aggregate){pq(GU(r,n.aggregate));continue}if(!i){pq(HU(r));continue}if(n.timeUnit){i=e.vgField(r);const t={timeUnit:n.timeUnit,as:i,field:n.field};l[WP(t)]=t}if(!u[i]){let o="E";"interval"===t.type?hW(e.getScaleComponent(r).get("type"))&&(o="R"):n.bin&&(o="R-RE");const a={field:i,channel:r,type:o};a.signals=Object.assign(Object.assign({},f(a,"data")),f(a,"visual")),s.items.push(u[i]=a),s.hasField[i]=s.hasChannel[r]=u[i]}}else pq(HU(r))}if(n.init){const e=e=>s.items.map((t=>void 0!==e[t.channel]?e[t.channel]:e[t.field]));if("interval"===n.type)t.init=e(n.init);else{const r=xP(n.init);t.init=r.map(e)}}rL(l)||(s.timeUnit=new iZ(null,l))},signals:(e,t,n)=>{const r=t.name+oZ;return n.filter((e=>e.name===r)).length>0?n:n.concat({name:r,value:t.project.items.map((e=>{const{signals:t,hasLegend:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i"single"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind&&!SV(e.bind),parse:(e,t,n,r)=>{r.on||delete t.events,r.clear||delete t.clear},topLevelSignals:(e,t,n)=>{const r=t.name,i=t.project,o=t.bind,a=t.init&&t.init[0],s=eZ.has(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach(((e,i)=>{var u,l;const c=uL(`${r}_${e.field}`);n.filter((e=>e.name===c)).length||n.unshift(Object.assign(Object.assign({name:c},a?{init:SZ(a[i])}:{value:null}),{on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${s}[${OP(e.field)}] : null`}]:[],bind:null!==(l=null!==(u=o[e.field])&&void 0!==u?u:o[e.channel])&&void 0!==l?l:o}))})),n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.filter((e=>e.name===r+PZ))[0],a=r+oZ,s=i.items.map((e=>uL(`${r}_${e.field}`))),u=s.map((e=>`${e} !== null`)).join(" && ");return s.length&&(o.update=`${u} ? {fields: ${a}, values: [${s.join(", ")}]} : null`),delete o.value,delete o.on,n}},lZ=uZ,cZ="_toggle",fZ={has:e=>"multi"===e.type&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+cZ,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+PZ,r=t.name+cZ;return`${r} ? null : ${n}, `+("global"===t.resolve?`${r} ? null : true, `:`${r} ? null : {unit: ${qZ(e)}}, `)+`${r} ? ${n} : null`}},dZ={has:e=>void 0!==e.clear&&!1!==e.clear,parse:(e,t,n)=>{n.clear&&(t.clear=EP(n.clear)?wX(n.clear,"scope"):n.clear)},topLevelSignals:(e,t,n)=>{if(lZ.has(t))for(const e of t.project.items){const r=n.findIndex((n=>n.name===uL(`${t.name}_${e.field}`)));-1!==r&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function r(e,r){-1!==e&&n[e].on&&n[e].on.push({events:t.clear,update:r})}if("interval"===t.type)for(const e of t.project.items){const t=n.findIndex((t=>t.name===e.signals.visual));r(t,"[0, 0]"),-1===t&&r(n.findIndex((t=>t.name===e.signals.data)),"null")}else{let e=n.findIndex((e=>e.name===t.name+PZ));r(e,"null"),fZ.has(t)&&(e=n.findIndex((e=>e.name===t.name+cZ)),r(e,"false"))}return n}},hZ={has:e=>"interval"===e.type&&"global"===e.resolve&&e.bind&&"scales"===e.bind,parse:(e,t)=>{const n=t.scales=[];for(const r of t.project.items){const i=r.channel;if(!SU(i))continue;const o=e.getScaleComponent(i),a=o?o.get("type"):void 0;if(!o||!hW(a)){pq("Scale bindings are currently only supported for scales with unbinned, continuous domains.");continue}const s={selection:t.name,field:r.field};o.set("selectionExtent",s,!0),n.push(r)}},topLevelSignals:(e,t,n)=>{const r=t.scales.filter((e=>0===n.filter((t=>t.name===e.signals.data)).length));if(!e.parent||mZ(e)||0===r.length)return n;const i=n.filter((e=>e.name===t.name))[0];let o=i.update;if(o.indexOf(LZ)>=0)i.update=`{${r.map((e=>`${OP(e.field)}: ${e.signals.data}`)).join(", ")}}`;else{for(const e of r){const t=`${OP(e.field)}: ${e.signals.data}`;o.indexOf(t)<0&&(o=`${o.substring(0,o.length-1)}, ${t}}`)}i.update=o}return n.concat(r.map((e=>({name:e.signals.data}))))},signals:(e,t,n)=>{if(e.parent&&!mZ(e))for(const e of t.scales){const t=n.filter((t=>t.name===e.signals.data))[0];t.push="outer",delete t.value,delete t.update}return n}},pZ=hZ;function gZ(e,t){return`domain(${OP(e.scaleName(t))})`}function mZ(e){var t;return e.parent&&e1(e.parent)&&(null!==(t=!e.parent.parent)&&void 0!==t?t:mZ(e.parent.parent))}const yZ={has:e=>{const t="global"===e.resolve&&e.bind&&SV(e.bind),n=1===e.project.items.length&&e.project.items[0].field!==OV;return t&&!n&&pq("Legend bindings are only supported for selections over an individual field or encoding channel."),t&&n},parse:(e,t,n,r)=>{var i;if(r.on||delete t.events,r.clear||delete t.clear,r.on||r.clear){const e='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of t.events)n.filter=xP(null!==(i=n.filter)&&void 0!==i?i:[]),n.filter.indexOf(e)<0&&n.filter.push(e)}const o=CV(t.bind)?t.bind.legend:"click",a=EP(o)?wX(o,"view"):xP(o);t.bind={legend:{merge:a}}},topLevelSignals:(e,t,n)=>{const r=t.name,i=CV(t.bind)&&t.bind.legend,o=e=>t=>{const n=LP(t);return n.markname=e,n};for(const e of t.project.items){if(!e.hasLegend)continue;const a=`${uL(e.field)}_legend`,s=`${r}_${a}`;if(0===n.filter((e=>e.name===s)).length){const e=i.merge.map(o(`${a}_symbols`)).concat(i.merge.map(o(`${a}_labels`))).concat(i.merge.map(o(`${a}_entries`)));n.unshift(Object.assign(Object.assign({name:s},t.init?{}:{value:null}),{on:[{events:e,update:"datum.value || item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${s}`,force:!0}]}))}}return n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.find((e=>e.name===r+PZ)),a=r+oZ,s=i.items.filter((e=>e.hasLegend)).map((e=>uL(`${r}_${uL(e.field)}_legend`))),u=`${s.map((e=>`${e} !== null`)).join(" && ")} ? {fields: ${a}, values: [${s.join(", ")}]} : null`;t.events&&s.length>0?o.on.push({events:s.map((e=>({signal:e}))),update:u}):s.length>0&&(o.update=u,delete o.value,delete o.on);const l=n.find((e=>e.name===r+cZ)),c=CV(t.bind)&&t.bind.legend;return l&&(t.events?l.on.push(Object.assign(Object.assign({},l.on[0]),{events:c})):l.on[0].events=c),n}},vZ="_translate_anchor",bZ="_translate_delta",xZ={has:e=>"interval"===e.type&&e.translate,signals:(e,t,n)=>{const r=t.name,i=pZ.has(t),o=r+vZ,{x:a,y:s}=t.project.hasChannel;let u=wX(t.translate,"scope");return i||(u=u.map((e=>(e.between[0].markname=r+jZ,e)))),n.push({name:o,value:{},on:[{events:u.map((e=>e.between[0])),update:"{x: x(unit), y: y(unit)"+(void 0!==a?", extent_x: "+(i?gZ(e,YL):`slice(${a.signals.visual})`):"")+(void 0!==s?", extent_y: "+(i?gZ(e,XL):`slice(${s.signals.visual})`):"")+"}"}]},{name:r+bZ,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==a&&_Z(e,t,a,"width",n),void 0!==s&&_Z(e,t,s,"height",n),n}};function _Z(e,t,n,r,i){var o;const a=t.name,s=a+vZ,u=a+bZ,l=n.channel,c=pZ.has(t),f=i.filter((e=>e.name===n.signals[c?"data":"visual"]))[0],d=e.getSizeSignalRef(r).signal,h=e.getScaleComponent(l),p=h.get("type"),g=`${s}.extent_${l}`,m=`${c?"log"===p?"panLog":"pow"===p?"panPow":"panLinear":"panLinear"}(${g}, ${`${c&&l===YL?"-":""}${u}.${l} / `+(c?`${d}`:`span(${g})`)}`+(c&&"pow"===p?`, ${null!==(o=h.get("exponent"))&&void 0!==o?o:1}`:"")+")";f.on.push({events:{signal:u},update:c?m:`clampRange(${m}, 0, ${d})`})}const wZ="_zoom_anchor",kZ="_zoom_delta",AZ={has:e=>"interval"===e.type&&e.zoom,signals:(e,t,n)=>{const r=t.name,i=pZ.has(t),o=r+kZ,{x:a,y:s}=t.project.hasChannel,u=OP(e.scaleName(YL)),l=OP(e.scaleName(XL));let c=wX(t.zoom,"scope");return i||(c=c.map((e=>(e.markname=r+jZ,e)))),n.push({name:r+wZ,on:[{events:c,update:i?"{"+[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter((e=>!!e)).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==a&&EZ(e,t,a,"width",n),void 0!==s&&EZ(e,t,s,"height",n),n}};function EZ(e,t,n,r,i){var o;const a=t.name,s=n.channel,u=pZ.has(t),l=i.filter((e=>e.name===n.signals[u?"data":"visual"]))[0],c=e.getSizeSignalRef(r).signal,f=e.getScaleComponent(s),d=f.get("type"),h=u?gZ(e,s):l.name,p=a+kZ,g=`${u?"log"===d?"zoomLog":"pow"===d?"zoomPow":"zoomLinear":"zoomLinear"}(${h}, ${a}${wZ}.${s}, ${p}`+(u&&"pow"===d?`, ${null!==(o=f.get("exponent"))&&void 0!==o?o:1}`:"")+")";l.on.push({events:{signal:p},update:u?g:`clampRange(${g}, 0, ${c})`})}const OZ=[sZ,fZ,pZ,yZ,xZ,AZ,lZ,eZ,dZ];function DZ(e,t){for(const n of OZ)n.has(e)&&t(n)}function SZ(e,t=!0,n=dP){if(pP(e)){const r=e.map((e=>SZ(e,t,n)));return t?`[${r.join(", ")}]`:r}return gq(e)?n(t?_q(e):function(e){const t=xq(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}(e)):t?n(JSON.stringify(e)):e}function CZ(e,t){return UZ(e,((n,r)=>{t=r.marks?r.marks(e,n,t):t,DZ(n,(r=>{r.marks&&(t=r.marks(e,n,t))}))})),t}function FZ(e){return e.map((e=>(e.on&&!e.on.length&&delete e.on,e)))}const jZ="_brush",MZ="_scale_trigger",$Z={signals:(e,t)=>{const n=t.name,r=n+oZ,i=pZ.has(t),o=[],a=[],s=[];if(t.translate&&!i){const e=`!event.item || event.item.mark.name !== ${OP(n+jZ)}`;NZ(t,((t,n)=>{var r;const i=xP(null!==(r=n.between[0].filter)&&void 0!==r?r:n.between[0].filter=[]);return i.indexOf(e)<0&&i.push(e),t}))}t.project.items.forEach(((n,r)=>{const i=n.channel;if(i!==YL&&i!==XL)return void pq("Interval selections only support x and y encoding channels.");const u=t.init?t.init[r]:null,l=function(e,t,n,r){const i=n.channel,o=n.signals.visual,a=n.signals.data,s=pZ.has(t),u=OP(e.scaleName(i)),l=e.getScaleComponent(i),c=l?l.get("type"):void 0,f=e=>`scale(${u}, ${e})`,d=e.getSizeSignalRef(i===YL?"width":"height").signal,h=`${i}(unit)`,p=NZ(t,((e,t)=>[...e,{events:t.between[0],update:`[${h}, ${h}]`},{events:t,update:`[${o}[0], clamp(${h}, 0, ${d})]`}]));return p.push({events:{signal:t.name+MZ},update:hW(c)?`[${f(`${a}[0]`)}, ${f(`${a}[1]`)}]`:"[0, 0]"}),s?[{name:a,on:[]}]:[Object.assign(Object.assign({name:o},r?{init:SZ(r,!0,f)}:{value:[]}),{on:p}),Object.assign(Object.assign({name:a},r?{init:SZ(r)}:{}),{on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${u}, ${o})`}]})]}(e,t,n,u),c=n.signals.data,f=n.signals.visual,d=OP(e.scaleName(i)),h=hW(e.getScaleComponent(i).get("type"))?"+":"";o.push(...l),a.push(c),s.push({scaleName:e.scaleName(i),expr:`(!isArray(${c}) || (${h}invert(${d}, ${f})[0] === ${h}${c}[0] && ${h}invert(${d}, ${f})[1] === ${h}${c}[1]))`})})),i||o.push({name:n+MZ,value:{},on:[{events:s.map((e=>({scale:e.scaleName}))),update:s.map((e=>e.expr)).join(" && ")+` ? ${n+MZ} : {}`}]});const u=t.init,l=`unit: ${qZ(e)}, fields: ${r}, values`;return o.concat(Object.assign(Object.assign({name:n+PZ},u?{init:`{${l}: ${SZ(u)}}`}:{}),{on:[{events:[{signal:a.join(" || ")}],update:a.join(" && ")+` ? {${l}: [${a}]} : null`}]}))},modifyExpr:(e,t)=>t.name+PZ+", "+("global"===t.resolve?"true":`{unit: ${qZ(e)}}`),marks:(e,t,n)=>{const r=t.name,{x:i,y:o}=t.project.hasChannel,a=i&&i.signals.visual,s=o&&o.signals.visual,u=`data(${OP(t.name+RZ)})`;if(pZ.has(t))return n;const l={x:void 0!==i?{signal:`${a}[0]`}:{value:0},y:void 0!==o?{signal:`${s}[0]`}:{value:0},x2:void 0!==i?{signal:`${a}[1]`}:{field:{group:"width"}},y2:void 0!==o?{signal:`${s}[1]`}:{field:{group:"height"}}};if("global"===t.resolve)for(const t of iL(l))l[t]=[Object.assign({test:`${u}.length && ${u}[0].unit === ${qZ(e)}`},l[t]),{value:0}];const c=t.mark,{fill:f,fillOpacity:d,cursor:h}=c,p=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i(e[t]=[{test:[void 0!==i&&`${a}[0] !== ${a}[1]`,void 0!==o&&`${s}[0] !== ${s}[1]`].filter((e=>e)).join(" && "),value:p[t]},{value:null}],e)),{});return[{name:r+jZ+"_bg",type:"rect",clip:!0,encode:{enter:{fill:{value:f},fillOpacity:{value:d}},update:l}},...n,{name:r+jZ,type:"rect",clip:!0,encode:{enter:Object.assign(Object.assign({},h?{cursor:{value:h}}:{}),{fill:{value:"transparent"}}),update:Object.assign(Object.assign({},l),g)}}]}};function NZ(e,t){return e.events.reduce(((e,n)=>n.between?t(e,n):(pq(`${n} is not an ordered event stream for interval selections.`),e)),[])}function BZ(e,t){const n=t.name,r=n+oZ,i=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=i.items.map((t=>{const n=e.fieldDef(t.channel);return n&&n.bin?`[${o}[${OP(e.vgField(t.channel,{}))}], ${o}[${OP(e.vgField(t.channel,{binSuffix:"end"}))}]]`:`${o}[${OP(t.field)}]`})).join(", "),s=`unit: ${qZ(e)}, fields: ${r}, values`,u=t.events;return[{name:n+PZ,on:u?[{events:u,update:`datum && item().mark.marktype !== 'group' ? {${s}: [${a}]} : null`,force:!0}]:[]}]}const TZ={signals:BZ,modifyExpr:(e,t)=>t.name+PZ+", "+("global"===t.resolve?"null":`{unit: ${qZ(e)}}`)},zZ={signals:BZ,modifyExpr:(e,t)=>t.name+PZ+", "+("global"===t.resolve?"true":`{unit: ${qZ(e)}}`)},RZ="_store",PZ="_tuple",LZ="vlSelectionResolve",IZ={single:zZ,multi:TZ,interval:$Z};function UZ(e,t){const n=e.component.selection;if(n)for(const e of oL(n))if(!0===t(e,IZ[e.type]))break}function qZ(e,{escape:t}={escape:!0}){let n=t?OP(e.name):e.name;const r=function(e){let t=e.parent;for(;t&&!K0(t);)t=t.parent;return t}(e);if(r){const{facet:e}=r;for(const t of MI)e[t]&&(n+=` + '__facet_${t}_' + (facet[${OP(r.vgField(t))}])`)}return n}function WZ(e){let t=!1;return UZ(e,(e=>{t=t||e.project.items.some((e=>e.field===OV))})),t}function HZ(e,t,n){return e.fields=t||[],e.fname=n,e}function GZ(e){return 1===e.length?VZ(e[0]):YZ(e)}const VZ=e=>function(t){return t[e]},YZ=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),s=r=i+1):"]"===o&&(s||XZ("Access path missing open bracket: "+e),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&XZ("Access path missing closing bracket: "+e),a&&XZ("Access path missing closing quote: "+e),i>r&&(i++,l()),t}(e);e=1===r.length?r[0]:e,HZ((n&&n.get||GZ)(r),[e],t||e)})("id"),HZ((e=>e),[],"identity"),HZ((()=>0),[],"zero"),HZ((()=>1),[],"one"),HZ((()=>!0),[],"true"),HZ((()=>!1),[],"false"),Array.isArray,Object.prototype.hasOwnProperty;function ZZ(e){this.type=e}var JZ,KZ,QZ,eJ,tJ;ZZ.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=function(e){switch(e.type){case"ArrayExpression":return e.elements;case"BinaryExpression":case"LogicalExpression":return[e.left,e.right];case"CallExpression":return[e.callee].concat(e.arguments);case"ConditionalExpression":return[e.test,e.consequent,e.alternate];case"MemberExpression":return[e.object,e.property];case"ObjectExpression":return e.properties;case"Property":return[e.key,e.value];case"UnaryExpression":return[e.argument];default:return[]}}(this),n=0,r=t.length;n",JZ[iJ]="Identifier",JZ[oJ]="Keyword",JZ[aJ]="Null",JZ[sJ]="Numeric",JZ[uJ]="Punctuator",JZ[lJ]="String",JZ[9]="RegularExpression";var cJ="ArrayExpression",fJ="BinaryExpression",dJ="CallExpression",hJ="ConditionalExpression",pJ="Identifier",gJ="Literal",mJ="LogicalExpression",yJ="MemberExpression",vJ="ObjectExpression",bJ="Property",xJ="UnaryExpression",_J="Unexpected token %0",wJ="Unexpected number",kJ="Unexpected string",AJ="Unexpected identifier",EJ="Unexpected reserved word",OJ="Unexpected end of input",DJ="Invalid regular expression",SJ="Invalid regular expression: missing /",CJ="Octal literals are not allowed in strict mode.",FJ="Duplicate data property in object literal not allowed in strict mode",jJ="ILLEGAL",MJ="Disabled.",$J=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),NJ=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\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A\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function BJ(e,t){if(!e)throw new Error("ASSERT: "+t)}function TJ(e){return e>=48&&e<=57}function zJ(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function RJ(e){return"01234567".indexOf(e)>=0}function PJ(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function LJ(e){return 10===e||13===e||8232===e||8233===e}function IJ(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&$J.test(String.fromCharCode(e))}function UJ(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&NJ.test(String.fromCharCode(e))}const qJ={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function WJ(){for(;QZ1114111||"}"!==e)&&oK({},_J,jJ),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),r=56320+(t-65536&1023),String.fromCharCode(n,r))}function VJ(){var e,t;for(e=KZ.charCodeAt(QZ++),t=String.fromCharCode(e),92===e&&(117!==KZ.charCodeAt(QZ)&&oK({},_J,jJ),++QZ,(e=HJ("u"))&&"\\"!==e&&IJ(e.charCodeAt(0))||oK({},_J,jJ),t=e);QZ>>="===(r=KZ.substr(QZ,4))?{type:uJ,value:r,start:i,end:QZ+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:uJ,value:n,start:i,end:QZ+=3}:a===(t=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t?{type:uJ,value:t,start:i,end:QZ+=2}:("//"===t&&oK({},_J,jJ),"<>=!+-*%&|^/".indexOf(a)>=0?(++QZ,{type:uJ,value:a,start:i,end:QZ}):void oK({},_J,jJ))}function XJ(){var e,t,n;if(BJ(TJ((n=KZ[QZ]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=QZ,e="","."!==n){if(e=KZ[QZ++],n=KZ[QZ],"0"===e){if("x"===n||"X"===n)return++QZ,function(e){let t="";for(;QZ=eJ)return{type:rJ,start:QZ,end:QZ};const e=KZ.charCodeAt(QZ);return IJ(e)?function(){var e,t;return e=QZ,t=92===KZ.charCodeAt(QZ)?VJ():function(){var e,t;for(e=QZ++;QZ=0&&QZ(BJ(t=0&&oK({},DJ,n),{value:n,literal:t}}(),r=function(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((e,t)=>{if(parseInt(t,16)<=1114111)return"x";oK({},DJ)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){oK({},DJ)}try{return new RegExp(e,t)}catch(e){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:QZ}}()),KJ()):aK(JJ())}return n}function pK(){const e=[];if(sK("("),!uK(")"))for(;QZ":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function xK(){var e,t;return e=function(){var e,t,n,r,i,o,a,s,u,l;if(e=tJ,u=vK(),0===(i=bK(r=tJ)))return u;for(r.prec=i,JJ(),t=[e,tJ],o=[u,r,a=vK()];(i=bK(tJ))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),t.pop(),n=QJ(s,u,a),o.push(n);(r=JJ()).prec=i,o.push(r),t.push(tJ),n=vK(),o.push(n)}for(n=o[l=o.length-1],t.pop();l>1;)t.pop(),n=QJ(o[l-1].value,o[l-2],n),l-=2;return n}(),uK("?")&&(JJ(),t=xK(),sK(":"),e=function(e,t,n){const r=new ZZ(hJ);return r.test=e,r.consequent=t,r.alternate=n,r}(e,t,xK())),e}function _K(){const e=xK();if(uK(","))throw new Error(MJ);return e}function wK(e){const t=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(t.push(...wK(e.object)),t.push(...wK(e.property))),t)}function kK(e){return"MemberExpression"===e.object.type?kK(e.object):"datum"===e.object.name}function AK(e){const t=function(e){QZ=0,eJ=(KZ=e).length,tJ=null,KJ();const t=_K();if(tJ.type!==rJ)throw new Error("Unexpect token after expression.");return t}(e),n=new Set;return t.visit((e=>{"MemberExpression"===e.type&&kK(e)&&n.add(wK(e).slice(1).join("."))})),n}class EK extends tZ{constructor(e,t,n){super(e),this.model=t,this.filter=n,this.expr=CK(this.model,this.filter,this),this._dependentFields=AK(this.expr)}clone(){return new EK(null,this.model,LP(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}var OK=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i`length(data(${e}))`)).join(" || ")+") || ":"")+`(${o})`}function SK(e,t){const n=t.encoding;let r=t.field;if(n||r){if(n&&!r){const i=e.project.items.filter((e=>e.channel===n));!i.length||i.length>1?(r=e.project.items[0].field,pq((i.length?"Multiple ":"No ")+`matching ${OP(n)} encoding found for selection ${OP(t.selection)}. `+`Using "field": ${OP(r)}.`)):r=i[0].field}}else r=e.project.items[0].field,e.project.items.length>1&&pq(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${OP(r)}.`);return`${e.name}[${OP(r)}]`}function CK(e,t,n){return lL(t,(t=>EP(t)?t:function(e){return null==e?void 0:e.selection}(t)?DK(e,t.selection,n):Gq(t)))}var FK=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{test:t}=e,n=FK(e,["test"]);return Object.assign({test:CK(null,t)},n)})),n];jK(h,r,t,a),delete h[e]}else if(null===o){const t={signal:i.map((e=>{const{test:t}=e,n=FK(e,["test"]);return`${CK(null,t)} ? ${AG(n)} : `})).join("")+AG(n)};h[e]=t}}else if(jq(r)){const t=DL[e];if(t){const{vgProp:n,part:i}=t;jK(h,i,n,r),delete h[e]}}}if("grid"===t){if(!h.grid)return;if(h.encode){const{grid:e}=h.encode;h.encode=Object.assign({},e?{grid:e}:{}),rL(h.encode)&&delete h.encode}return Object.assign(Object.assign({scale:l,orient:u},h),{domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:bL(d,0)})}{if(!r.header&&e.mainExtracted)return;if(void 0!==c){let e=c;(null===(o=null===(i=h.encode)||void 0===i?void 0:i.labels)||void 0===o?void 0:o.update)&&jq(h.encode.labels.update.text)&&(e=mL(c,"datum.label",h.encode.labels.update.text.signal)),jK(h,"labels","text",{signal:e})}if(null===h.labelAlign&&delete h.labelAlign,h.encode){for(const t of CL)e.hasAxisPart(t)||delete h.encode[t];rL(h.encode)&&delete h.encode}const t=function(e,t){if(e)return pP(e)&&!vG(e)?e.map((e=>rG(e,t))).join(", "):e}(f,n);return Object.assign(Object.assign(Object.assign(Object.assign({scale:l,orient:u,grid:!1},t?{title:t}:{}),h),!1===n.aria?{aria:!1}:{}),{zindex:bL(d,0)})}}}function $K(e){const{axes:t}=e.component,n=[];for(const r of fU)if(t[r])for(const i of t[r])if(!i.get("disable")&&!i.get("gridScale")){const t="x"===r?"height":"width",i=e.getSizeSignalRef(t).signal;t!==i&&n.push({name:t,update:i})}return n}function NK(e,t,n,r){return Object.assign.apply(null,[{},...e.map((e=>{if("axisOrient"===e){const e="x"===n?"bottom":"left",i=t["x"===n?"axisBottom":"axisLeft"]||{},o=t["x"===n?"axisTop":"axisRight"]||{},a=new Set([...iL(i),...iL(o)]),s={};for(const t of a.values())s[t]={signal:`${r.signal} === "${e}" ? ${EG(i[t])} : ${EG(o[t])}`};return s}return t[e]}))])}function BK(e,t){var n;const r=[{}];for(const i of e){let e=null===(n=t[i])||void 0===n?void 0:n.style;if(e){e=xP(e);for(const n of e)r.push(t.style[n])}}return Object.assign.apply(null,r)}function TK(e,t,n,r={}){var i;const o=FG(e,n,t);if(void 0!==o)return{configFrom:"style",configValue:o};for(const t of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(void 0!==(null===(i=r[t])||void 0===i?void 0:i[e]))return{configFrom:t,configValue:r[t][e]};return{}}const zK={scale:({model:e,channel:t})=>e.scaleName(t),format:({fieldOrDatumDef:e,config:t,axis:n})=>{const{format:r,formatType:i}=n;return hH(e,e.type,r,i,t,!0)},formatType:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return pH(r,t,n)},grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>{var r;return(!TH(e)||!BU(e.bin))&&(null!==(r=t.grid)&&void 0!==r?r:function(e,t){return!dW(e)&&TH(t)&&!NU(null==t?void 0:t.bin)}(n,e))},gridScale:({model:e,channel:t})=>function(e,t){const n="x"===t?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelAlign||LK(t,n,r),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelBaseline||PK(t,n,r),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>{var r;return null!==(r=e.labelFlush)&&void 0!==r?r:function(e,t){if("x"===t&&GP(["quantitative","temporal"],e))return!0}(t.type,n)},labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{var r;return null!==(r=e.labelOverlap)&&void 0!==r?r:function(e,t,n,r){if(n&&!gP(r)||"nominal"!==e&&"ordinal"!==e)return"log"!==t&&"symlog"!==t||"greedy"}(t.type,n,TH(t)&&!!t.timeUnit,TH(t)?t.sort:void 0)},orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:r,scaleType:i})=>{var o;const a="x"===e?"width":"y"===e?"height":void 0,s=a?t.getSizeSignalRef(a):void 0;return null!==(o=n.tickCount)&&void 0!==o?o:function({fieldOrDatumDef:e,scaleType:t,size:n,values:r}){var i;if(!r&&!dW(t)&&"log"!==t){if(TH(e)){if(NU(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&GP(["month","hours","day","quarter"],null===(i=Fq(e.timeUnit))||void 0===i?void 0:i.unit))return}return{signal:`ceil(${n.signal}/40)`}}}({fieldOrDatumDef:r,scaleType:i,size:s,values:n.values})},title:({axis:e,model:t,channel:n})=>{if(void 0!==e.title)return e.title;const r=IK(t,n);if(void 0!==r)return r;const i=t.typedFieldDef(n),o="x"===n?"x2":"y2",a=t.fieldDef(o);return MG(i?[CH(i)]:[],TH(a)?[CH(a)]:[])},values:({axis:e,fieldOrDatumDef:t})=>function(e,t){const n=e.values;return pP(n)?pG(t,n):jq(n)?n:void 0}(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>{var r;return null!==(r=e.zindex)&&void 0!==r?r:function(e,t){return"rect"===e&&ZH(t)?1:0}(n,t)}};function RK(e){return`(((${e.signal} % 360) + 360) % 360)`}function PK(e,t,n,r){if(void 0!==e){if("x"===n){if(jq(e)){const n=RK(e);return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${jq(t)?`(${t.signal} === "top")`:"top"===t} ? "bottom" : "top"`}}if(45{if(WH(t)&&AH(t.sort)){const{field:r,timeUnit:i}=t,o=t.sort,a=o.map(((e,t)=>`${Gq({field:r,timeUnit:i,equal:e})} ? ${t} : `)).join("")+o.length;e=new UK(e,{calculate:a,as:qK(t,n,{forAs:!0})})}})),e}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${WP(this.transform)}`}}function qK(e,t,n){return XH(e,Object.assign({prefix:t,suffix:"sort_index"},null!=n?n:{}))}function WK(e,t){return GP(["top","bottom"],t)?"column":GP(["left","right"],t)||"row"===e?"row":"column"}function HK(e,t,n,r){const i="row"===r?n.headerRow:"column"===r?n.headerColumn:n.headerFacet;return bL((t||{})[e],i[e],n.header[e])}function GK(e,t,n,r){const i={};for(const o of e){const e=HK(o,t||{},n,r);void 0!==e&&(i[o]=e)}return i}const VK=["row","column"],YK=["header","footer"];function XK(e,t){const n=e.component.layoutHeaders[t].title,r=e.config?e.config:void 0,i=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:a,titleOrient:s}=GK(["titleAnchor","titleAngle","titleOrient"],i.header,r,t),u=WK(t,s),l=EL(a);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:n},"row"===t?{orient:"left"}:{}),{style:"guide-title"}),JK(l,u)),ZK(u,l,o)),iQ(r,i,t,bV,yV))}}function ZK(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=LK(t,"row"===e?"left":"top","row"===e?"y":"x");return r?{align:r}:{}}function JK(e,t){const n=PK(e,"row"===t?"left":"top","row"===t?"y":"x",!0);return n?{baseline:n}:{}}function KK(e,t){const n=e.component.layoutHeaders[t],r=[];for(const i of YK)if(n[i])for(const o of n[i]){const a=tQ(e,t,i,n,o);null!=a&&r.push(a)}return r}function QK(e,t){var n;const{sort:r}=e;return kH(r)?{field:XH(r,{expr:"datum"}),order:null!==(n=r.order)&&void 0!==n?n:"ascending"}:pP(r)?{field:qK(e,t,{expr:"datum"}),order:"ascending"}:{field:XH(e,{expr:"datum"}),order:null!=r?r:"ascending"}}function eQ(e,t,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:u}=GK(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=cH({fieldOrDatumDef:e,format:r,formatType:i,expr:"parent",config:n}).signal,c=WK(t,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:{signal:u?mL(mL(u,"datum.label",l),"datum.value",XH(e,{expr:"parent"})):l}},"row"===t?{orient:"left"}:{}),{style:"guide-label",frame:"group"}),JK(o,c)),ZK(c,o,a)),iQ(n,e,t,xV,vV))}function tQ(e,t,n,r,i){if(i){let o=null;const{facetFieldDef:a}=r,s=e.config?e.config:void 0;if(a&&i.labels){const{labelOrient:e}=GK(["labelOrient"],a.header,s,t);("row"===t&&!GP(["top","bottom"],e)||"column"===t&&!GP(["left","right"],e))&&(o=eQ(a,t,s))}const u=K0(e)&&!EH(e.facet),l=i.axes,c=(null==l?void 0:l.length)>0;if(o||c){const s="row"===t?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`},r.facetFieldDef?{from:{data:e.getName(t+"_domain")},sort:QK(a,t)}:{}),c&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{}),o?{title:o}:{}),i.sizeSignal?{encode:{update:{[s]:i.sizeSignal}}}:{}),c?{axes:l}:{})}}return null}const nQ={column:{start:0,end:1},row:{start:1,end:0}};function rQ(e,t){return nQ[t][e]}function iQ(e,t,n,r,i){const o={};for(const a of r){if(!i[a])continue;const r=HK(a,null==t?void 0:t.header,e,n);void 0!==r&&(o[i[a]]=r)}return o}function oQ(e){return[...aQ(e,"width"),...aQ(e,"height"),...aQ(e,"childWidth"),...aQ(e,"childHeight")]}function aQ(e,t){const n="width"===t?"x":"y",r=e.component.layoutSize.get(t);if(!r||"merged"===r)return[];const i=e.getSizeSignalRef(t).signal;if("step"===r){const t=e.getScaleComponent(n);if(t){const r=t.get("type"),o=t.get("range");if(dW(r)&&Mq(o)){const r=e.scaleName(n);return K0(e.parent)&&"independent"===e.parent.component.resolve.scale[n]?[sQ(r,o)]:[sQ(r,o),{name:i,update:uQ(r,t,`domain('${r}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==r){const t=i.endsWith("width"),n=t?"containerSize()[0]":"containerSize()[1]",r=`isFinite(${n}) ? ${n} : ${zV(e.config.view,t?"width":"height")}`;return[{name:i,init:r,on:[{update:r,events:"window:resize"}]}]}return[{name:i,value:r}]}function sQ(e,t){return{name:e+"_step",value:t.step}}function uQ(e,t,n){const r=t.get("type"),i=t.get("padding"),o=bL(t.get("paddingOuter"),i);let a=t.get("paddingInner");return a="band"===r?void 0!==a?a:i:1,`bandspace(${n}, ${EG(a)}, ${EG(o)}) * ${e}_step`}function lQ(e){return"childWidth"===e?"width":"childHeight"===e?"height":e}function cQ(e,t){return iL(e).reduce(((n,r)=>{const i=e[r];return Object.assign(Object.assign({},n),OX(t,i,r,(e=>kG(e.value))))}),{})}function fQ(e,t){if(e1(t)||K0(t))return"shared";if(Q0(t))return dU(e)?"independent":"shared";throw new Error("invalid model type for resolve")}function dQ(e,t){const n=e.scale[t],r=dU(t)?"axis":"legend";return"independent"===n?("shared"===e[r][t]&&pq(function(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}(t)),"independent"):e[r][t]||"shared"}const hQ=Object.assign(Object.assign({},kV),{disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1}),pQ=iL(hQ);class gQ extends FY{}const mQ={symbols:function(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i,legendType:o}){var a,s,u,l,c,f,d,h;if("symbol"!==o)return;const{markDef:p,encoding:g,config:m,mark:y}=n,v=p.filled&&"trail"!==y;let b=Object.assign(Object.assign({},function(e,t,n){for(const r of n){const n=SG(r,t.markDef,t.config);void 0!==n&&(e[r]=kG(n))}return e}({},n,XW)),$X(n,{filled:v}));const x=null!==(a=i.get("symbolOpacity"))&&void 0!==a?a:m.legend.symbolOpacity,_=null!==(s=i.get("symbolFillColor"))&&void 0!==s?s:m.legend.symbolFillColor,w=null!==(u=i.get("symbolStrokeColor"))&&void 0!==u?u:m.legend.symbolStrokeColor,k=void 0===x?null!==(l=yQ(g.opacity))&&void 0!==l?l:p.opacity:void 0;if(b.fill)if("fill"===r||v&&r===aI)delete b.fill;else if(b.fill.field)_?delete b.fill:(b.fill=kG(null!==(c=m.legend.symbolBaseFillColor)&&void 0!==c?c:"black"),b.fillOpacity=kG(null!=k?k:1));else if(pP(b.fill)){const e=null!==(h=null!==(d=vQ(null!==(f=g.fill)&&void 0!==f?f:g.color))&&void 0!==d?d:p.fill)&&void 0!==h?h:v&&p.color;e&&(b.fill=kG(e))}if(b.stroke)if("stroke"===r||!v&&r===aI)delete b.stroke;else if(b.stroke.field||w)delete b.stroke;else if(pP(b.stroke)){const e=bL(vQ(g.stroke||g.color),p.stroke,v?p.color:void 0);e&&(b.stroke={value:e})}if(r!==dI){const e=TH(t)&&xQ(0,i,t);e?b.opacity=[Object.assign({test:e},kG(null!=k?k:1)),kG(m.legend.unselectedOpacity)]:k&&(b.opacity=kG(k))}return b=Object.assign(Object.assign({},b),e),rL(b)?void 0:b},gradient:function(e,{model:t,legendType:n,legendCmpt:r}){var i;if("gradient"!==n)return;const{config:o,markDef:a,encoding:s}=t;let u={};const l=void 0===(null!==(i=r.get("gradientOpacity"))&&void 0!==i?i:o.legend.gradientOpacity)?yQ(s.opacity)||a.opacity:void 0;return l&&(u.opacity=kG(l)),u=Object.assign(Object.assign({},u),e),rL(u)?void 0:u},labels:function(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},a=n.config,s=TH(t)?xQ(0,i,t):void 0,u=s?[{test:s,value:1},{value:a.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=o,f=sH(c)?dH({fieldOrDatumDef:t,field:"datum.value",format:l,formatType:c,config:a}):void 0,d=Object.assign(Object.assign(Object.assign({},u?{opacity:u}:{}),f?{text:f}:{}),e);return rL(d)?void 0:d},entries:function(e,{legendCmpt:t}){const n=t.get("selections");return(null==n?void 0:n.length)?Object.assign(Object.assign({},e),{fill:{value:"transparent"}}):e}};function yQ(e){return bQ(e,((e,t)=>Math.max(e,t.value)))}function vQ(e){return bQ(e,((e,t)=>bL(e,t.value)))}function bQ(e,t){return function(e){const t=e&&e.condition;return!!t&&(pP(t)||qH(t))}(e)?xP(e.condition).reduce(t,e.value):qH(e)?e.value:void 0}function xQ(e,t,n){const r=t.get("selections");if(!(null==r?void 0:r.length))return;const i=OP(n.field);return r.map((e=>`(!length(data(${OP(uL(e)+RZ)})) || (${e}[${i}] && indexof(${e}[${i}], datum.value) >= 0))`)).join(" || ")}const _Q={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:r,formatType:i}=t;return hH(e,e.type,r,i,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return pH(r,t,n)},gradientLength:e=>{var t,n;const{legend:r,legendConfig:i}=e;return null!==(n=null!==(t=r.gradientLength)&&void 0!==t?t:i.gradientLength)&&void 0!==n?n:function({legendConfig:e,model:t,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:a,gradientVerticalMaxLength:s,gradientVerticalMinLength:u}=e;if(pW(i))return"horizontal"===n?"top"===r||"bottom"===r?kQ(t,"width",a,o):a:kQ(t,"height",u,s)}(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>{var r,i;return null!==(i=null!==(r=e.labelOverlap)&&void 0!==r?r:t.labelOverlap)&&void 0!==i?i:function(e){if(GP(["quantile","threshold","log","symlog"],e))return"greedy"}(n)},symbolType:({legend:e,markDef:t,channel:n,encoding:r})=>{var i;return null!==(i=e.symbolType)&&void 0!==i?i:function(e,t,n,r){var i;if("shape"!==t){const e=null!==(i=vQ(n))&&void 0!==i?i:r;if(e)return e}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(t.type,n,r.shape,t.shape)},title:({fieldOrDatumDef:e,config:t})=>tG(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(FI(n)&&pW(t)){if("gradient"===e)return}else if("symbol"===e)return;return e},values:({fieldOrDatumDef:e,legend:t})=>function(e,t){const n=e.values;return pP(n)?pG(t,n):jq(n)?n:void 0}(t,e)};function wQ({legendConfig:e,legendType:t,orient:n,legend:r}){var i,o;return null!==(o=null!==(i=r.direction)&&void 0!==i?i:e[t?"gradientDirection":"symbolDirection"])&&void 0!==o?o:function(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===t?"horizontal":void 0}}(n,t)}function kQ(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function AQ(e){const t=J0(e)?function(e){const{encoding:t}=e,n={};for(const r of[aI,...wV]){const i=aG(t[r]);i&&e.getScaleComponent(r)&&(r===lI&&TH(i)&&i.type===eW||(n[r]=OQ(e,r)))}return n}(e):function(e){const{legends:t,resolve:n}=e.component;for(const r of e.children){AQ(r);for(const i of iL(r.component.legends))n.legend[i]=dQ(e.component.resolve,i),"shared"===n.legend[i]&&(t[i]=DQ(t[i],r.component.legends[i]),t[i]||(n.legend[i]="independent",delete t[i]))}for(const r of iL(t))for(const t of e.children)t.component.legends[r]&&"shared"===n.legend[r]&&delete t.component.legends[r];return t}(e);return e.component.legends=t,t}function EQ(e,t,n,r){switch(t){case"disable":return void 0!==n;case"values":return!!(null==n?void 0:n.values);case"title":if("title"===t&&e===(null==r?void 0:r.title))return!0}return e===(n||{})[t]}function OQ(e,t){var n,r,i;let o=e.legend(t);const{markDef:a,encoding:s,config:u}=e,l=u.legend,c=new gQ({},function(e,t){const n=e.scaleName(t);if("trail"===e.mark){if("color"===t)return{stroke:n};if("size"===t)return{strokeWidth:n}}return"color"===t?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}(e,t));!function(e,t,n){var r;const i=null===(r=e.fieldDef(t))||void 0===r?void 0:r.field;UZ(e,(e=>{var r,o;const a=null!==(r=e.project.hasField[i])&&void 0!==r?r:e.project.hasChannel[t];if(a&&yZ.has(e)){const t=null!==(o=n.get("selections"))&&void 0!==o?o:[];t.push(e.name),n.set("selections",t,!1),a.hasLegend=!0}}))}(e,t,c);const f=void 0!==o?!o:l.disable;if(c.set("disable",f,void 0!==o),f)return c;o=o||{};const d=e.getScaleComponent(t).get("type"),h=aG(s[t]),p=TH(h)?null===(n=Fq(h.timeUnit))||void 0===n?void 0:n.unit:void 0,g=o.orient||u.legend.orient||"right",m=function(e){const{legend:t}=e;return bL(t.type,function({channel:e,timeUnit:t,scaleType:n}){if(FI(e)){if(GP(["quarter","month","day"],t))return"symbol";if(pW(n))return"gradient"}return"symbol"}(e))}({legend:o,channel:t,timeUnit:p,scaleType:d}),y={legend:o,channel:t,model:e,markDef:a,encoding:s,fieldOrDatumDef:h,legendConfig:l,config:u,scaleType:d,orient:g,legendType:m,direction:wQ({legend:o,legendType:m,orient:g,legendConfig:l})};for(const n of pQ){if("gradient"===m&&n.startsWith("symbol")||"symbol"===m&&n.startsWith("gradient"))continue;const r=n in _Q?_Q[n](y):o[n];if(void 0!==r){const i=EQ(r,n,o,e.fieldDef(t));(i||void 0===u.legend[n])&&c.set(n,r,i)}}const v=null!==(r=null==o?void 0:o.encoding)&&void 0!==r?r:{},b=c.get("selections"),x={},_={fieldOrDatumDef:h,model:e,channel:t,legendCmpt:c,legendType:m};for(const t of["labels","legend","title","symbols","gradient","entries"]){const n=cQ(null!==(i=v[t])&&void 0!==i?i:{},e),r=t in mQ?mQ[t](n,_):n;void 0===r||rL(r)||(x[t]=Object.assign(Object.assign(Object.assign({},(null==b?void 0:b.length)&&TH(h)?{name:`${uL(h.field)}_legend_${t}`}:{}),(null==b?void 0:b.length)?{interactive:!!b}:{}),{update:r}))}return rL(x)||c.set("encode",x,!!(null==o?void 0:o.encoding)),c}function DQ(e,t){var n,r,i,o;if(!e)return t.clone();const a=e.getWithExplicit("orient"),s=t.getWithExplicit("orient");if(a.explicit&&s.explicit&&a.value!==s.value)return;let u=!1;for(const n of pQ){const r=BY(e.getWithExplicit(n),t.getWithExplicit(n),n,"legend",((e,t)=>{switch(n){case"symbolType":return r=e,"circle"===(i=t).value?i:r;case"title":return NG(e,t);case"type":return u=!0,MY("symbol")}var r,i;return NY(e,t,n,"legend")}));e.setWithExplicit(n,r)}return u&&((null===(r=null===(n=e.implicit)||void 0===n?void 0:n.encode)||void 0===r?void 0:r.gradient)&&cL(e.implicit,["encode","gradient"]),(null===(o=null===(i=e.explicit)||void 0===i?void 0:i.encode)||void 0===o?void 0:o.gradient)&&cL(e.explicit,["encode","gradient"])),e}function SQ(e){const t=e.component.legends,n={};for(const r of iL(t)){const i=e.getScaleComponent(r),o=qP(i.get("domains"));if(n[o])for(const e of n[o])DQ(e,t[r])||n[o].push(t[r]);else n[o]=[t[r].clone()]}const r=oL(n).flat().map((t=>function(e,t){var n,r,i;const o=e.combine(),{disable:a,labelExpr:s,selections:u}=o,l=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ivoid 0!==e));return r}function CQ(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:r}=n;if(t.data){const i={signal:`[${t.size.map((e=>e.signal)).join(", ")}]`},o=t.data.reduce(((t,n)=>{const r=jq(n)?n.signal:`data('${e.lookupDataSource(n)}')`;return GP(t,r)||t.push(r),t}),[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[Object.assign({name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]}},n)]}return[Object.assign(Object.assign({name:r},{translate:{signal:"[width / 2, height / 2]"}}),n)]}const FQ=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class jQ extends FY{constructor(e,t,n,r){super(Object.assign({},t),{name:e}),this.specifiedProjection=t,this.size=n,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function MQ(e){e.component.projection=J0(e)?function(e){var t;if(e.hasProjection){const n=e.specifiedProjection,r=!(n&&(null!=n.scale||null!=n.translate)),i=r?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,o=r?function(e){const t=[],{encoding:n}=e;for(const r of[[rI,nI],[oI,iI]])(aG(n[r[0]])||aG(n[r[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(lI)&&e.typedFieldDef(lI).type===eW&&t.push({signal:e.getName(`geojson_${t.length}`)}),0===t.length&&t.push(e.requestDataName(WY.Main)),t}(e):void 0;return new jQ(e.projectionName(!0),Object.assign(Object.assign({},null!==(t=e.config.projection)&&void 0!==t?t:{}),null!=n?n:{}),i,o)}}(e):function(e){if(0===e.children.length)return;let t;for(const t of e.children)MQ(t);const n=YP(e.children,(e=>{const n=e.component.projection;if(n){if(t){const e=function(e,t){const n=YP(FQ,(n=>!wP(e.explicit,n)&&!wP(t.explicit,n)||!(!wP(e.explicit,n)||!wP(t.explicit,n)||qP(e.get(n))!==qP(t.get(n)))));if(qP(e.size)===qP(t.size)){if(n)return e;if(qP(e.explicit)===qP({}))return t;if(qP(t.explicit)===qP({}))return e}return null}(t,n);return e&&(t=e),!!e}return t=n,!0}return!0}));if(t&&n){const n=e.projectionName(!0),r=new jQ(n,t.specifiedProjection,t.size,LP(t.data));for(const t of e.children){const e=t.component.projection;e&&(e.isFit&&r.data.push(...t.component.projection.data),t.renameProjection(e.get("name"),n),e.merged=!0)}return r}}(e)}function $Q(e,t){return`${$U(e)}_${t}`}function NQ(e,t,n){var r;const i=$Q(null!==(r=cG(n,void 0))&&void 0!==r?r:{},t);return e.getName(`${i}_bins`)}function BQ(e,t,n){let r,i;r=function(e){return"as"in e}(e)?EP(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:[XH(e,{forAs:!0}),XH(e,{binSuffix:"end",forAs:!0})];const o=Object.assign({},cG(t,void 0)),a=$Q(o,e.field),{signal:s,extentSignal:u}=function(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}(n,a);if(zU(o.extent)){const e=o.extent,t=e.selection;i=SK(n.getSelectionComponent(uL(t),t),e),delete o.extent}return{key:a,binComponent:Object.assign(Object.assign(Object.assign({bin:o,field:e.field,as:[r]},s?{signal:s}:{}),u?{extentSignal:u}:{}),i?{span:i}:{})}}class TQ extends tZ{constructor(e,t){super(e),this.bins=t}clone(){return new TQ(null,LP(this.bins))}static makeFromEncoding(e,t){const n=t.reduceFieldDef(((e,n,r)=>{if(UH(n)&&NU(n.bin)){const{key:i,binComponent:o}=BQ(n,n.bin,t);e[i]=Object.assign(Object.assign(Object.assign({},o),e[i]),function(e,t,n,r){var i,o;if(gG(t,n)){const a=J0(e)&&null!==(o=null!==(i=e.axis(n))&&void 0!==i?i:e.legend(n))&&void 0!==o?o:{},s=XH(t,{expr:"datum"}),u=XH(t,{expr:"datum",binSuffix:"end"});return{formulaAs:XH(t,{binSuffix:"range",forAs:!0}),formula:vH(s,u,a.format,a.formatType,r)}}return{}}(t,n,r,t.config))}return e}),{});return rL(n)?null:new TQ(e,n)}static makeFromTransform(e,t,n){const{key:r,binComponent:i}=BQ(t,t.bin,n);return new TQ(e,{[r]:i})}merge(e,t){for(const n of iL(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=JP([...this.bins[n].as,...e.bins[n].as],WP)):this.bins[n]=e.bins[n];for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}producedFields(){return new Set(oL(this.bins).map((e=>e.as)).flat(2))}dependentFields(){return new Set(oL(this.bins).map((e=>e.field)))}hash(){return`Bin ${WP(this.bins)}`}assemble(){return oL(this.bins).flatMap((e=>{const t=[],[n,...r]=e.as,i=e.bin,{extent:o}=i,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{e.aggregate&&(n=!0)}));const r={},i=new Set;return n?(t.forEachFieldDef(((e,n)=>{var o,a,s,u;const{aggregate:l,field:c}=e;if(l)if("count"===l)r["*"]=null!==(o=r["*"])&&void 0!==o?o:{},r["*"].count=new Set([XH(e,{forAs:!0})]);else{if(zL(l)||RL(l)){const e=zL(l)?"argmin":"argmax",t=l[e];r[t]=null!==(a=r[t])&&void 0!==a?a:{},r[t][e]=new Set([XH({op:e,field:t},{forAs:!0})])}else r[c]=null!==(s=r[c])&&void 0!==s?s:{},r[c][l]=new Set([XH(e,{forAs:!0})]);SU(n)&&"unaggregated"===t.scaleDomain(n)&&(r[c]=null!==(u=r[c])&&void 0!==u?u:{},r[c].min=new Set([XH({field:c,aggregate:"min"},{forAs:!0})]),r[c].max=new Set([XH({field:c,aggregate:"max"},{forAs:!0})]))}else!function(e,t,n,r){const i=J0(r)?r.encoding[YI(t)]:void 0;if(UH(n)&&J0(r)&&MH(t,n,i,r.stack,r.markDef,r.config))e.add(XH(n,{})),e.add(XH(n,{suffix:"end"})),n.bin&&gG(n,t)&&e.add(XH(n,{binSuffix:"range"}));else if(t in DI){const n=function(e){switch(e){case nI:return"y";case iI:return"y2";case rI:return"x";case oI:return"x2"}}(t);e.add(r.getName(n))}else e.add(XH(n))}(i,n,e,t)})),i.size+iL(r).length===0?null:new zQ(e,i,r)):null}static makeFromTransform(e,t){var n,r,i;const o=new Set,a={};for(const e of t.aggregate){const{op:t,field:i,as:o}=e;t&&("count"===t?(a["*"]=null!==(n=a["*"])&&void 0!==n?n:{},a["*"].count=new Set([o||XH(e,{forAs:!0})])):(a[i]=null!==(r=a[i])&&void 0!==r?r:{},a[i][t]=new Set([o||XH(e,{forAs:!0})])))}for(const e of null!==(i=t.groupby)&&void 0!==i?i:[])o.add(e);return o.size+iL(a).length===0?null:new zQ(e,o,a)}merge(e){return QP(this.dimensions,e.dimensions)?(function(e,t){var n;for(const r of iL(t)){const i=t[r];for(const t of iL(i))r in e?e[r][t]=new Set([...null!==(n=e[r][t])&&void 0!==n?n:[],...i[t]]):e[r]={[t]:i[t]}}}(this.measures,e.measures),!0):(function(...e){hq.debug(...e)}("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...iL(this.measures)])}producedFields(){const e=new Set;for(const t of iL(this.measures))for(const n of iL(this.measures[t])){const r=this.measures[t][n];0===r.size?e.add(`${n}_${t}`):r.forEach(e.add,e)}return e}hash(){return`Aggregate ${WP({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const e=[],t=[],n=[];for(const r of iL(this.measures))for(const i of iL(this.measures[r]))for(const o of this.measures[r][i])n.push(o),e.push(i),t.push("*"===r?null:gL(r));return{type:"aggregate",groupby:[...this.dimensions].map(gL),ops:e,fields:t,as:n}}}class RQ extends tZ{constructor(e,t,n,r){super(e),this.model=t,this.name=n,this.data=r;for(const e of MI){const n=t.facet[e];if(n){const{bin:r,sort:i}=n;this[e]=Object.assign({name:t.getName(`${e}_domain`),fields:[XH(n),...NU(r)?[XH(n,{binSuffix:"end"})]:[]]},kH(i)?{sortField:i}:pP(i)?{sortIndexField:qK(n,e)}:{})}}this.childModel=t.child}hash(){let e="Facet";for(const t of MI)this[t]&&(e+=` ${t.charAt(0)}:${WP(this[t])}`);return e}get fields(){var e;const t=[];for(const n of MI)(null===(e=this[n])||void 0===e?void 0:e.fields)&&t.push(...this[n].fields);return t}dependentFields(){const e=new Set(this.fields);for(const t of MI)this[t]&&(this[t].sortField&&e.add(this[t].sortField.field),this[t].sortIndexField&&e.add(this[t].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const t of fU){const n=this.childModel.component.scales[t];if(n&&!n.merged){const r=n.get("type"),i=n.get("range");if(dW(r)&&Mq(i)){const n=C0(F0(this.childModel,t));n?e[t]=n:pq(WU(t))}}}return e}assembleRowColumnHeaderData(e,t,n){const r={row:"y",column:"x"}[e],i=[],o=[],a=[];n&&n[r]&&(t?(i.push(`distinct_${n[r]}`),o.push("max")):(i.push(n[r]),o.push("distinct")),a.push(`distinct_${n[r]}`));const{sortField:s,sortIndexField:u}=this[e];if(s){const{op:e=bH,field:t}=s;i.push(t),o.push(e),a.push(XH(s,{forAs:!0}))}else u&&(i.push(u),o.push("max"),a.push(u));return{name:this[e].name,source:null!=t?t:this.data,transform:[Object.assign({type:"aggregate",groupby:this[e].fields},i.length?{fields:i,ops:o,as:a}:{})]}}assembleFacetHeaderData(e){var t,n;const{columns:r}=this.model.layout,{layoutHeaders:i}=this.model.component,o=[],a={};for(const e of VK){for(const r of YK){const o=null!==(t=i[e]&&i[e][r])&&void 0!==t?t:[];for(const t of o)if((null===(n=t.axes)||void 0===n?void 0:n.length)>0){a[e]=!0;break}}if(a[e]){const t=`length(data("${this.facet.name}"))`,n="row"===e?r?{signal:`ceil(${t} / ${r})`}:1:r?{signal:`min(${t}, ${r})`}:{signal:t};o.push({name:`${this.facet.name}_${e}`,transform:[{type:"sequence",start:0,stop:n}]})}}const{row:s,column:u}=a;return(s||u)&&o.unshift(this.assembleRowColumnHeaderData("facet",null,e)),o}assemble(){var e,t;const n=[];let r=null;const i=this.getChildIndependentFieldsWithStep(),{column:o,row:a,facet:s}=this;if(o&&a&&(i.x||i.y)){r=`cross_${this.column.name}_${this.row.name}`;const o=[].concat(null!==(e=i.x)&&void 0!==e?e:[],null!==(t=i.y)&&void 0!==t?t:[]),a=o.map((()=>"distinct"));n.push({name:r,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:o,ops:a}]})}for(const e of[GL,HL])this[e]&&n.push(this.assembleRowColumnHeaderData(e,r,i));if(s){const e=this.assembleFacetHeaderData(i);e&&n.push(...e)}return n}}function PQ(e){return"'"===e[0]&&"'"===e[e.length-1]||'"'===e[0]&&'"'===e[e.length-1]?e.slice(1,-1):e}function LQ(e){const t={};return zP(e.filter,(e=>{var n;if(Wq(e)){let r=null;zq(e)?r=_G(e.equal):Pq(e)?r=_G(e.lte):Rq(e)?r=_G(e.lt):Lq(e)?r=_G(e.gt):Iq(e)?r=_G(e.gte):Uq(e)?r=e.range[0]:qq(e)&&(r=(null!==(n=e.oneOf)&&void 0!==n?n:e.in)[0]),r&&(gq(r)?t[e.field]="date":AP(r)?t[e.field]="number":EP(r)&&(t[e.field]="string")),e.timeUnit&&(t[e.field]="date")}})),t}class IQ extends tZ{constructor(e,t){super(e),this._parse=t}clone(){return new IQ(null,LP(this._parse))}hash(){return`Parse ${WP(this._parse)}`}static makeExplicit(e,t,n){let r={};const i=t.data;return!LY(i)&&i&&i.format&&i.format.parse&&(r=i.format.parse),this.makeWithAncestors(e,r,{},n)}static makeWithAncestors(e,t,n,r){for(const e of iL(n)){const t=r.getWithExplicit(e);void 0!==t.value&&(t.explicit||t.value===n[e]||"derived"===t.value||"flatten"===n[e]?delete n[e]:pq(XU(e,n[e],t.value)))}for(const e of iL(t)){const n=r.get(e);void 0!==n&&(n===t[e]?delete t[e]:pq(XU(e,t[e],n)))}const i=new FY(t,n);r.copyAll(i);const o={};for(const e of iL(i.combine())){const t=i.get(e);null!==t&&(o[e]=t)}return 0===iL(o).length||r.parseNothing?null:new IQ(e,o)}get parse(){return this._parse}merge(e){this._parse=Object.assign(Object.assign({},this._parse),e.parse),e.remove()}assembleFormatParse(){const e={};for(const t of iL(this._parse)){const n=this._parse[t];1===vL(t)&&(e[t]=n)}return e}producedFields(){return new Set(iL(this._parse))}dependentFields(){return new Set(iL(this._parse))}assembleTransforms(e=!1){return iL(this._parse).filter((t=>!e||vL(t)>1)).map((e=>{const t=function(e,t){const n=dL(e);return"number"===t?`toNumber(${n})`:"boolean"===t?`toBoolean(${n})`:"string"===t?`toString(${n})`:"date"===t?`toDate(${n})`:"flatten"===t?n:0===t.indexOf("date:")?`timeParse(${n},'${PQ(t.slice(5,t.length))}')`:0===t.indexOf("utc:")?`utcParse(${n},'${PQ(t.slice(4,t.length))}')`:(pq(`Unrecognized parse "${t}".`),null)}(e,this._parse[e]);return t?{type:"formula",expr:t,as:yL(e)}:null})).filter((e=>null!==e))}}class UQ extends tZ{clone(){return new UQ(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([OV])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:OV}}}class qQ extends tZ{constructor(e,t){super(e),this.params=t}clone(){return new qQ(null,this.params)}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${WP(this.params)}`}assemble(){return Object.assign({type:"graticule"},!0===this.params?{}:this.params)}}class WQ extends tZ{constructor(e,t){super(e),this.params=t}clone(){return new WQ(null,this.params)}dependentFields(){return new Set}producedFields(){var e;return new Set([null!==(e=this.params.as)&&void 0!==e?e:"data"])}hash(){return`Hash ${WP(this.params)}`}assemble(){return Object.assign({type:"sequence"},this.params)}}class HQ extends tZ{constructor(e){let t;if(super(null),LY(e=null!=e?e:{name:"source"})||(t=e.format?Object.assign({},UP(e.format,["parse"])):{}),RY(e))this._data={values:e.values};else if(zY(e)){if(this._data={url:e.url},!t.type){let n=/(?:\.([^.]+))?$/.exec(e.url)[1];GP(["json","csv","tsv","dsv","topojson"],n)||(n="json"),t.type=n}}else UY(e)?this._data={values:[{type:"Sphere"}]}:(PY(e)||LY(e))&&(this._data={});this._generator=LY(e),e.name&&(this._name=e.name),t&&!rL(t)&&(this._data.format=t)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return Object.assign(Object.assign({name:this._name},this._data),{transform:[]})}}var GQ,VQ=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n};function YQ(e){return e instanceof HQ||e instanceof qQ||e instanceof WQ}class XQ{constructor(){GQ.set(this,void 0),VQ(this,GQ,!1)}setModified(){VQ(this,GQ,!0)}get modifiedFlag(){return function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}(this,GQ)}}GQ=new WeakMap;class ZQ extends XQ{getNodeDepths(e,t,n){n.set(e,t);for(const r of e.children)this.getNodeDepths(r,t+1,n);return n}optimize(e){const t=[...this.getNodeDepths(e,0,new Map).entries()].sort(((e,t)=>t[1]-e[1]));for(const e of t)this.run(e[0]);return this.modifiedFlag}}class JQ extends XQ{optimize(e){this.run(e);for(const t of e.children)this.optimize(t);return this.modifiedFlag}}class KQ extends JQ{mergeNodes(e,t){const n=t.shift();for(const r of t)e.removeChild(r),r.parent=n,r.remove()}run(e){const t=e.children.map((e=>e.hash())),n={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(e,n[t]))}}class QQ extends JQ{constructor(e){super(),this.requiresSelectionId=e&&WZ(e)}run(e){e instanceof UQ&&(this.requiresSelectionId&&(YQ(e.parent)||e.parent instanceof zQ||e.parent instanceof IQ)||(this.setModified(),e.remove()))}}class e0 extends XQ{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,t){let n=new Set;e instanceof iZ&&(n=e.producedFields(),eL(n,t)&&(this.setModified(),e.removeFormulas(t),0===e.producedFields.length&&e.remove()));for(const r of e.children)this.run(r,new Set([...t,...n]))}}class t0 extends JQ{constructor(){super()}run(e){e instanceof nZ&&!e.isRequired()&&(this.setModified(),e.remove())}}class n0 extends ZQ{run(e){if(!(YQ(e)||e.numChildren()>1))for(const t of e.children)if(t instanceof IQ)if(e instanceof IQ)this.setModified(),e.merge(t);else{if(nL(e.producedFields(),t.dependentFields()))continue;this.setModified(),t.swapWithParent()}}}class r0 extends ZQ{run(e){const t=[...e.children],n=e.children.filter((e=>e instanceof IQ));if(e.numChildren()>1&&n.length>=1){const r={},i=new Set;for(const e of n){const t=e.parse;for(const e of iL(t))e in r?r[e]!==t[e]&&i.add(e):r[e]=t[e]}for(const e of i)delete r[e];if(!rL(r)){this.setModified();const n=new IQ(e,r);for(const i of t){if(i instanceof IQ)for(const e of iL(r))delete i.parse[e];e.removeChild(i),i.parent=n,i instanceof IQ&&0===iL(i.parse).length&&i.remove()}}}}}class i0 extends ZQ{run(e){e instanceof nZ||e.numChildren()>0||e instanceof RQ||e instanceof HQ||(this.setModified(),e.remove())}}class o0 extends ZQ{run(e){const t=e.children.filter((e=>e instanceof iZ)),n=t.pop();for(const e of t)this.setModified(),n.merge(e)}}class a0 extends ZQ{run(e){const t=e.children.filter((e=>e instanceof zQ)),n={};for(const e of t){const t=WP(e.groupBy);t in n||(n[t]=[]),n[t].push(e)}for(const t of iL(n)){const r=n[t];if(r.length>1){const t=r.pop();for(const n of r)t.merge(n)&&(e.removeChild(n),n.parent=t,n.remove(),this.setModified())}}}}class s0 extends ZQ{constructor(e){super(),this.model=e}run(e){const t=!(YQ(e)||e instanceof EK||e instanceof IQ||e instanceof UQ),n=[],r=[];for(const i of e.children)i instanceof TQ&&(t&&!nL(e.producedFields(),i.dependentFields())?n.push(i):r.push(i));if(n.length>0){const t=n.pop();for(const e of n)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified(),e instanceof TQ?e.merge(t,this.model.renameSignal.bind(this.model)):t.swapWithParent()}if(r.length>1){const e=r.pop();for(const t of r)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified()}}}class u0 extends ZQ{run(e){const t=[...e.children];if(!VP(t,(e=>e instanceof nZ))||e.numChildren()<=1)return;const n=[];let r;for(const i of t)if(i instanceof nZ){let t=i;for(;1===t.numChildren();){const[e]=t.children;if(!(e instanceof nZ))break;t=e}n.push(...t.children),r?(e.removeChild(i),i.parent=r.parent,r.parent.removeChild(r),r.parent=t,this.setModified()):r=t}else n.push(i);if(n.length){this.setModified();for(const e of n)e.parent.removeChild(e),e.parent=r}}}class l0 extends tZ{constructor(e,t){super(e),this.transform=t}clone(){return new l0(null,LP(this.transform))}addDimensions(e){this.transform.groupby=JP(this.transform.groupby.concat(e),(e=>e))}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map((e=>e.field)).filter((e=>void 0!==e)).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){var t;return null!==(t=e.as)&&void 0!==t?t:XH(e)}hash(){return`JoinAggregateTransform ${WP(this.transform)}`}assemble(){const e=[],t=[],n=[];for(const r of this.transform.joinaggregate)t.push(r.op),n.push(this.getDefaultName(r)),e.push(void 0===r.field?null:r.field);const r=this.transform.groupby;return Object.assign({type:"joinaggregate",as:n,ops:t,fields:e},void 0!==r?{groupby:r}:{})}}class c0 extends tZ{constructor(e,t){super(e),this._stack=t}clone(){return new c0(null,LP(this._stack))}static makeFromTransform(e,t){const{stack:n,groupby:r,as:i,offset:o="zero"}=t,a=[],s=[];if(void 0!==t.sort)for(const e of t.sort)a.push(e.field),s.push(bL(e.order,"ascending"));const u={field:a,order:s};let l;return l=function(e){return pP(e)&&e.every((e=>EP(e)))&&e.length>1}(i)?i:EP(i)?[i,i+"_end"]:[t.stack+"_start",t.stack+"_end"],new c0(e,{stackField:n,groupby:r,offset:o,sort:u,facetby:[],as:l})}static makeFromEncoding(e,t){const n=t.stack,{encoding:r}=t;if(!n)return null;const{groupbyChannel:i,fieldChannel:o,offset:a,impute:s}=n;let u;i&&(u=oG(r[i]));const l=function(e){return e.stack.stackBy.reduce(((e,t)=>{const n=XH(t.fieldDef);return n&&e.push(n),e}),[])}(t),c=t.encoding.order;let f;return f=pP(c)||TH(c)?jG(c):l.reduce(((e,t)=>(e.field.push(t),e.order.push("y"===o?"descending":"ascending"),e)),{field:[],order:[]}),new c0(e,{dimensionFieldDef:u,stackField:t.vgField(o),facetby:[],stackby:l,sort:f,offset:a,impute:s,as:[t.vgField(o,{suffix:"start",forAs:!0}),t.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${WP(this._stack)}`}getGroupbyFields(){const{dimensionFieldDef:e,impute:t,groupby:n}=this._stack;return e?e.bin?t?[XH(e,{binSuffix:"mid"})]:[XH(e,{}),XH(e,{binSuffix:"end"})]:[XH(e)]:null!=n?n:[]}assemble(){const e=[],{facetby:t,dimensionFieldDef:n,stackField:r,stackby:i,sort:o,offset:a,impute:s,as:u}=this._stack;if(s&&n){const{band:o=.5,bin:a}=n;a&&e.push({type:"formula",expr:`${o}*`+XH(n,{expr:"datum"})+`+${1-o}*`+XH(n,{expr:"datum",binSuffix:"end"}),as:XH(n,{binSuffix:"mid",forAs:!0})}),e.push({type:"impute",field:r,groupby:[...i,...t],key:XH(n,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...t],field:r,sort:o,as:u,offset:a}),e}}class f0 extends tZ{constructor(e,t){super(e),this.transform=t}clone(){return new f0(null,LP(this.transform))}addDimensions(e){this.transform.groupby=JP(this.transform.groupby.concat(e),(e=>e))}dependentFields(){var e,t;const n=new Set;return(null!==(e=this.transform.groupby)&&void 0!==e?e:[]).forEach(n.add,n),(null!==(t=this.transform.sort)&&void 0!==t?t:[]).forEach((e=>n.add(e.field))),this.transform.window.map((e=>e.field)).filter((e=>void 0!==e)).forEach(n.add,n),n}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){var t;return null!==(t=e.as)&&void 0!==t?t:XH(e)}hash(){return`WindowTransform ${WP(this.transform)}`}assemble(){var e;const t=[],n=[],r=[],i=[];for(const e of this.transform.window)n.push(e.op),r.push(this.getDefaultName(e)),i.push(void 0===e.param?null:e.param),t.push(void 0===e.field?null:e.field);const o=this.transform.frame,a=this.transform.groupby;if(o&&null===o[0]&&null===o[1]&&n.every((e=>PL(e))))return Object.assign({type:"joinaggregate",as:r,ops:n,fields:t},void 0!==a?{groupby:a}:{});const s=[],u=[];if(void 0!==this.transform.sort)for(const t of this.transform.sort)s.push(t.field),u.push(null!==(e=t.order)&&void 0!==e?e:"ascending");const l={field:s,order:u},c=this.transform.ignorePeers;return Object.assign(Object.assign(Object.assign({type:"window",params:i,as:r,ops:n,fields:t,sort:l},void 0!==c?{ignorePeers:c}:{}),void 0!==a?{groupby:a}:{}),void 0!==o?{frame:o}:{})}}function d0(e){if(e instanceof RQ)if(1!==e.numChildren()||e.children[0]instanceof nZ){const n=e.model.component.data.main;h0(n);const r=(t=e,function e(n){if(!(n instanceof RQ)){const r=n.clone();if(r instanceof nZ){const e=p0+r.getSource();r.setSource(e),t.model.component.data.outputNodes[e]=r}else(r instanceof zQ||r instanceof c0||r instanceof f0||r instanceof l0)&&r.addDimensions(t.fields);for(const t of n.children.flatMap(e))t.parent=r;return[r]}return n.children.flatMap(e)}),i=e.children.map(r).flat();for(const e of i)e.parent=n}else{const t=e.children[0];(t instanceof zQ||t instanceof c0||t instanceof f0||t instanceof l0)&&t.addDimensions(e.fields),t.swapWithParent(),d0(e)}else e.children.map(d0);var t}function h0(e){if(e instanceof nZ&&e.type===WY.Main&&1===e.numChildren()){const t=e.children[0];t instanceof RQ||(t.swapWithParent(),h0(e))}}const p0="scale_",g0=5;function m0(e){for(const t of e){for(const e of t.children)if(e.parent!==t)return!1;if(!m0(t.children))return!1}return!0}function y0(e,t){let n=!1;for(const r of t)n=e.optimize(r)||n;return n}function v0(e,t,n){let r=e.sources,i=!1;return i=y0(new t0,r)||i,i=y0(new QQ(t),r)||i,r=r.filter((e=>e.numChildren()>0)),i=y0(new i0,r)||i,r=r.filter((e=>e.numChildren()>0)),n||(i=y0(new n0,r)||i,i=y0(new s0(t),r)||i,i=y0(new e0,r)||i,i=y0(new r0,r)||i,i=y0(new a0,r)||i,i=y0(new o0,r)||i,i=y0(new KQ,r)||i,i=y0(new u0,r)||i),e.sources=r,i}class b0{constructor(e){Object.defineProperty(this,"signal",{enumerable:!0,get:e})}static fromName(e,t){return new b0((()=>e(t)))}}var x0=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i({signal:`{data: ${hG(e,{timeUnit:n,type:t})}}`})))}(e,t,i):[e]}function A0(e,t,n,r){const{encoding:i}=n,o=aG(i[r]),{type:a}=o,s=o.timeUnit;if(function(e){return e&&e.unionWith}(t)){const i=A0(e,void 0,n,r),o=k0(t.unionWith,a,s);return jY([...i.value,...o])}if(jq(t))return jY([t]);if(t&&"unaggregated"!==t&&!mW(t))return jY(k0(t,a,s));const u=n.stack;if(u&&r===u.fieldChannel){if("normalize"===u.offset)return MY([[0,1]]);const e=n.requestDataName(WY.Main);return MY([{data:e,field:n.vgField(r,{suffix:"start"})},{data:e,field:n.vgField(r,{suffix:"end"})}])}const l=SU(r)&&TH(o)?function(e,t,n){if(!dW(n))return;const r=e.fieldDef(t),i=r.sort;if(AH(i))return{op:"min",field:qK(r,t),order:"ascending"};const{stack:o}=e,a=o?[...o.groupbyField?[o.groupbyField]:[],...o.stackBy.map((e=>e.fieldDef.field))]:void 0;if(kH(i))return E0(i,o&&!GP(a,i.field));if(wH(i)){const{encoding:t,order:n}=i,r=e.fieldDef(t),{aggregate:s,field:u}=r,l=o&&!GP(a,u);if(zL(s)||RL(s))return E0({field:XH(r),order:n},l);if(PL(s)||!s)return E0({op:s,field:u,order:n},l)}else{if("descending"===i)return{op:"min",field:e.vgField(t),order:"descending"};if(GP(["ascending",void 0],i))return!0}}(n,r,e):void 0;if(RH(o))return MY(k0([o.datum],a,s));const c=o;if("unaggregated"===t){const e=n.requestDataName(WY.Main),{field:t}=o;return MY([{data:e,field:XH({field:t,aggregate:"min"})},{data:e,field:XH({field:t,aggregate:"max"})}])}if(NU(c.bin)){if(dW(e))return MY("bin-ordinal"===e?[]:[{data:sL(l)?n.requestDataName(WY.Main):n.requestDataName(WY.Raw),field:n.vgField(r,gG(c,r)?{binSuffix:"range"}:{}),sort:!0!==l&&gP(l)?l:{field:n.vgField(r,{}),op:"min"}}]);{const{bin:e}=c;if(NU(e)){const t=NQ(n,c.field,e);return MY([new b0((()=>{const e=n.getSignalName(t);return`[${e}.start, ${e}.stop]`}))])}return MY([{data:n.requestDataName(WY.Main),field:n.vgField(r,{})}])}}if(c.timeUnit&&GP(["time","utc"],e)&&MH(r,c,J0(n)?n.encoding[YI(r)]:void 0,n.stack,n.markDef,n.config)){const e=n.requestDataName(WY.Main);return MY([{data:e,field:n.vgField(r)},{data:e,field:n.vgField(r,{suffix:"end"})}])}return MY(l?[{data:sL(l)?n.requestDataName(WY.Main):n.requestDataName(WY.Raw),field:n.vgField(r),sort:l}]:[{data:n.requestDataName(WY.Main),field:n.vgField(r)}])}function E0(e,t){const{op:n,field:r,order:i}=e;return Object.assign(Object.assign({op:null!=n?n:t?"sum":bH},r?{field:gL(r)}:{}),i?{order:i}:{})}function O0(e,t){var n;const r=e.component.scales[t],i=e.specifiedScales[t].domain,o=null===(n=e.fieldDef(t))||void 0===n?void 0:n.bin,a=mW(i)&&i,s=TU(o)&&zU(o.extent)&&o.extent;(a||s)&&r.set("selectionExtent",null!=a?a:s,!0)}function D0(e,t){const{aggregate:n,type:r}=e;return n?EP(n)&&!qL[n]?{valid:!1,reason:iq(n)}:"quantitative"===r&&"log"===t?{valid:!1,reason:oq(e)}:{valid:!0}:{valid:!1,reason:rq(e)}}function S0(e,t,n,r){return e.explicit&&t.explicit&&pq(function(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${qP(n)} and ${qP(r)}). Using the union of the two domains.`}(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function C0(e){if($q(e)&&EP(e.field))return e.field;if(function(e){return!pP(e)&&"fields"in e&&!("data"in e)}(e)){let t;for(const n of e.fields)if($q(n)&&EP(n.field))if(t){if(t!==n.field)return pq("Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect."),t}else t=n.field;return pq("Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect."),t}if(function(e){return!pP(e)&&"fields"in e&&"data"in e}(e)){pq("Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.");const t=e.fields[0];return EP(t)?t:void 0}}function F0(e,t){return function(e){const t=JP(e.map((e=>{if($q(e)){const{sort:t}=e;return x0(e,["sort"])}return e})),WP),n=JP(e.map((e=>{if($q(e)){const t=e.sort;return void 0===t||sL(t)||("op"in t&&"count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}})).filter((e=>void 0!==e)),WP);if(0===t.length)return;if(1===t.length){const t=e[0];if($q(t)&&n.length>0){let e=n[0];if(n.length>1)pq(uq),e=!0;else if(gP(e)&&"field"in e){const n=e.field;t.field===n&&(e=!e.order||{order:e.order})}return Object.assign(Object.assign({},t),{sort:e})}return t}const r=JP(n.map((e=>sL(e)||!("op"in e)||EP(e.op)&&e.op in TL?e:(pq(function(e){return`Dropping sort property ${qP(e)} as unioned domains only support boolean or op "count", "min", and "max".`}(e)),!0))),WP);let i;1===r.length?i=r[0]:r.length>1&&(pq(uq),i=!0);const o=JP(e.map((e=>$q(e)?e.data:null)),(e=>e));return 1===o.length&&null!==o[0]?Object.assign({data:o[0],fields:t.map((e=>e.field))},i?{sort:i}:{}):Object.assign({fields:t},i?{sort:i}:{})}(e.component.scales[t].get("domains").map((t=>($q(t)&&(t.data=e.lookupDataSource(t.data)),t))))}var j0=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ie.concat(M0(t))),$0(e)):$0(e)}function $0(e){return iL(e.component.scales).reduce(((t,n)=>{const r=e.component.scales[n];if(r.merged)return t;const i=r.combine(),{name:o,type:a,selectionExtent:s,domains:u,range:l,reverse:c}=i,f=j0(i,["name","type","selectionExtent","domains","range","reverse"]),d=function(e,t,n,r){if(dU(n)){if(Mq(e))return{step:{signal:t+"_step"}}}else if(gP(e)&&$q(e))return Object.assign(Object.assign({},e),{data:r.lookupDataSource(e.data)});return e}(i.range,o,n,e);let h;s&&(h=function(e,t){const n=t.selection;return{signal:SK(e.getSelectionComponent(n,uL(n)),t)}}(e,s));const p=F0(e,n);return t.push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:o,type:a},p?{domain:p}:{}),h?{domainRaw:h}:{}),{range:d}),void 0!==c?{reverse:c}:{}),f)),t}),[])}class N0 extends FY{constructor(e,t){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",t)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||VP(this.get("domains"),(e=>pP(e)&&2===e.length&&e[0]<=0&&e[1]>=0))}}const B0=["range","scheme"];function T0(e){return"x"===e?"width":"y"===e?"height":void 0}function z0(e,t){const n=e.fieldDef(t);if(n&&n.bin&&NU(n.bin)){const r=NQ(e,n.field,n.bin),i=T0(t),o=e.getName(i);return new b0((()=>{const t=e.getSignalName(r),n=`(${t}.stop - ${t}.start) / ${t}.step`;return`${e.getSignalName(o)} / (${n})`}))}}function R0(e,t){const n=t.specifiedScales[e],{size:r}=t,i=t.getScaleComponent(e).get("type");for(const r of B0)if(void 0!==n[r]){const o=OW(i,r),a=DW(e,r);if(o)if(a)pq(a);else switch(r){case"range":{const r=n.range;if(pP(r)){if(dU(e))return jY(r.map((e=>{if("width"===e||"height"===e){const n=t.getName(e),r=t.getSignalName.bind(t);return b0.fromName(r,n)}return e})))}else if(gP(r))return jY({data:t.requestDataName(WY.Main),field:r.field,sort:{op:"min",field:t.vgField(e)}});return jY(r)}case"scheme":return jY(P0(n[r]))}else pq(aq(i,r,e))}if(e===YL||e===XL){const t=e===YL?"width":"height",n=r[t];if($V(n)){if(dW(i))return jY({step:n.step});pq(sq(t))}}const{rangeMin:o,rangeMax:a}=n,s=function(e,t){const{size:n,config:r,mark:i,encoding:o}=t,a=t.getSignalName.bind(t),{type:s}=aG(o[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case YL:case XL:{if(GP(["point","band"],u))if(e!==YL||n.width){if(e===XL&&!n.height){const e=PV(r.view,"height");if($V(e))return e}}else{const e=PV(r.view,"width");if($V(e))return e}const i=T0(e),o=t.getName(i);return e===XL&&hW(u)?[b0.fromName(a,o),0]:[0,b0.fromName(a,o)]}case cI:{const o=L0(i,t.component.scales[e].get("zero"),r),a=function(e,t,n,r){const i={x:z0(n,"x"),y:z0(n,"y")};switch(e){case"bar":case"tick":{if(void 0!==r.scale.maxBandSize)return r.scale.maxBandSize;const e=U0(t,i,r.view);return AP(e)?e-1:new b0((()=>`${e.signal} - 1`))}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const e=U0(t,i,r.view);return AP(e)?Math.pow(I0*e,2):new b0((()=>`pow(${I0} * ${e.signal}, 2)`))}}throw new Error(eq("size",e))}(i,n,t,r);return gW(u)?function(e,t,n){const r=()=>{const r=EG(t),i=EG(e),o=`(${r} - ${i}) / (${n} - 1)`;return`sequence(${i}, ${r} + ${o}, ${o})`};return jq(t)?new b0(r):{signal:r()}}(o,a,function(e,t,n,r){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return void 0!==n&&pP(n)?n.length+1:(pq(function(e){return`Domain for ${e} is required for threshold scale.`}(r)),3)}}(u,r,l,e)):[o,a]}case eI:return[0,2*Math.PI];case fI:return[0,360];case KL:return[0,new b0((()=>`min(${t.getSignalName("width")},${t.getSignalName("height")})/2`))];case gI:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case mI:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case lI:return"symbol";case aI:case sI:case uI:return"ordinal"===u?"nominal"===s?"category":"ordinal":void 0!==c?"diverging":"rect"===i||"geoshape"===i?"heatmap":"ramp";case dI:case hI:case pI:return[r.scale.minOpacity,r.scale.maxOpacity]}throw new Error(`Scale range undefined for channel ${e}`)}(e,t);return(void 0!==o||void 0!==a)&&OW(i,"rangeMin")&&pP(s)&&2===s.length?jY([null!=o?o:s[0],null!=a?a:s[1]]):MY(s)}function P0(e){return function(e){return!EP(e)&&!!e.name}(e)?Object.assign({scheme:e.name},UP(e,["name"])):{scheme:e}}function L0(e,t,n){if(t)return jq(t)?{signal:`${t.signal} ? 0 : ${L0(e,!1,n)}`}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(eq("size",e))}const I0=.95;function U0(e,t,n){const r=$V(e.width)?e.width.step:RV(n,"width"),i=$V(e.height)?e.height.step:RV(n,"height");return t.x||t.y?new b0((()=>`min(${[t.x?t.x.signal:r,t.y?t.y.signal:i].join(", ")})`)):Math.min(r,i)}function q0(e,t){J0(e)?function(e,t){const n=e.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:a}=e;for(const s of iL(n)){const u=a[s],l=n[s],c=e.getScaleComponent(s),f=aG(i[s]),d=u[t],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=OW(h,t),y=DW(s,t);if(void 0!==d&&(m?y&&pq(y):pq(aq(h,t,s))),m&&void 0===y)if(void 0!==d){const e=f.timeUnit,n=f.type;switch(t){case"domainMax":case"domainMin":gq(u[t])||"temporal"===n||e?l.set(t,{signal:hG(u[t],{type:n,timeUnit:e})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const n=t in W0?W0[t]({model:e,channel:s,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:u.domain,markDef:o,config:r}):r.scale[t];void 0!==n&&l.set(t,n,!1)}}}(e,t):G0(e,t)}const W0={bins:({model:e,fieldOrDatumDef:t})=>TH(t)?function(e,t){const n=t.bin;if(NU(n)){const r=NQ(e,t.field,n);return new b0((()=>e.getSignalName(r)))}if(BU(n)&&TU(n)&&void 0!==n.step)return{step:n.step}}(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>function(e,t){if(GP([aI,sI,uI],e)&&"nominal"!==t)return"hcl"}(e,t.type),nice:({scaleType:e,channel:t,fieldOrDatumDef:n})=>function(e,t,n){var r;if(!(null===(r=oG(n))||void 0===r?void 0:r.bin)&&!GP([tW.TIME,tW.UTC],e))return t in cU||void 0}(e,t,n),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:r,config:i})=>function(e,t,n,r,i,o){if(e in cU){if(pW(t)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:t,orient:a}=i;if("bar"===t&&(!TH(r)||!r.bin&&!r.timeUnit)&&("vertical"===a&&"x"===e||"horizontal"===a&&"y"===e))return o.continuousBandSize}if(t===tW.POINT)return n.pointPadding}}(e,t,i.scale,n,r,i.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,config:r})=>function(e,t,n,r){if(void 0===e&&t in cU){const{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:i}=r;return bL(e,"bar"===n?t:i)}}(e,t,n.type,r.scale),paddingOuter:({scalePadding:e,channel:t,scaleType:n,markDef:r,scalePaddingInner:i,config:o})=>function(e,t,n,r,i,o){if(void 0===e&&t in cU&&n===tW.BAND){const{bandPaddingOuter:e}=o;return bL(e,jq(i)?{signal:`${i.signal}/2`}:i/2)}}(e,t,n,r.type,i,o.scale),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:r})=>function(e,t,n,r){return"x"===n&&void 0!==r.xReverse?hW(e)&&"descending"===t?jq(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse:!(!hW(e)||"descending"!==t)||void 0}(t,TH(e)?e.sort:void 0,n,r.scale),zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:r,scaleType:i})=>function(e,t,n,r,i){if(n&&"unaggregated"!==n&&hW(i)){if(pP(n)){const e=n[0],t=n[n.length-1];if(e<=0&&t>=0)return!0}return!1}if("size"===e&&"quantitative"===t.type&&!gW(i))return!0;if((!TH(t)||!t.bin)&&GP([...fU,...pU],e)){const{orient:t,type:n}=r;return!GP(["bar","area","line","trail"],n)||!("horizontal"===t&&"y"===e||"vertical"===t&&"x"===e)}return!1}(e,t,n,r,i)};function H0(e){J0(e)?function(e){const t=e.component.scales;for(const n of DU){const r=t[n];if(!r)continue;const i=R0(n,e);r.setWithExplicit("range",i)}}(e):G0(e,"range")}function G0(e,t){const n=e.component.scales;for(const n of e.children)"range"===t?H0(n):q0(n,t);for(const r of iL(n)){let i;for(const n of e.children){const e=n.component.scales[r];e&&(i=BY(i,e.getWithExplicit(t),t,"scale",$Y(((e,n)=>"range"===t&&e.step&&n.step?e.step-n.step:0))))}n[r].setWithExplicit(t,i)}}function V0(e){J0(e)?e.component.scales=function(e){const{encoding:t,mark:n}=e;return DU.reduce(((r,i)=>{const o=aG(t[i]);if(o&&n===WW&&i===lI&&o.type===eW)return r;let a=o&&o.scale;if(o&&null!==a&&!1!==a){a=null!=a?a:{};const t=function(e,t,n,r){const i=function(e,t,n){var r;switch(t.type){case"nominal":case"ordinal":if(FI(e)||"discrete"===MU(e))return"shape"===e&&"ordinal"===t.type&&pq(nq(e,"ordinal")),"ordinal";if(e in cU){if(GP(["rect","bar","image","rule"],n))return"band"}else if("arc"===n&&e in hU)return"band";return void 0!==t.band||HH(t)&&(null===(r=t.axis)||void 0===r?void 0:r.tickBand)?"band":"point";case"temporal":return FI(e)?"time":"discrete"===MU(e)?(pq(nq(e,"temporal")),"ordinal"):TH(t)&&t.timeUnit&&Fq(t.timeUnit).utc?"utc":"time";case"quantitative":return FI(e)?TH(t)&&NU(t.bin)?"bin-ordinal":"linear":"discrete"===MU(e)?(pq(nq(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(JU(t.type))}(t,n,r),{type:o}=e;return SU(t)?void 0!==o?function(e,t){if(!SU(e))return!1;switch(e){case YL:case XL:case eI:case KL:return pW(t)||GP(["band","point"],t);case cI:case gI:case dI:case hI:case pI:case fI:return pW(t)||gW(t)||GP(["band","point","ordinal"],t);case aI:case sI:case uI:return"band"!==t;case mI:return"ordinal"===t||gW(t);case lI:return"ordinal"===t}}(t,o)?TH(n)&&(a=o,s=n.type,!(GP([Jq,Qq],s)?void 0===a||dW(a):s===Kq?GP([tW.TIME,tW.UTC,void 0],a):s!==Zq||GP([tW.LOG,tW.POW,tW.SQRT,tW.SYMLOG,tW.QUANTILE,tW.QUANTIZE,tW.THRESHOLD,tW.LINEAR,void 0],a)))?(pq(function(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}(o,i)),i):o:(pq(function(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}(t,o,i)),i):i:null;var a,s}(a,i,o,n);r[i]=new N0(e.scaleName(i+"",!0),{value:t,explicit:a.type===t})}return r}),{})}(e):e.component.scales=function(e){var t;const n=e.component.scales={},r={},i=e.component.resolve;for(const n of e.children){V0(n);for(const o of iL(n.component.scales))if(i.scale[o]=null!==(t=i.scale[o])&&void 0!==t?t:fQ(o,e),"shared"===i.scale[o]){const e=r[o],t=n.component.scales[o].getWithExplicit("type");e?rW(e.value,t.value)?r[o]=BY(e,t,"type","scale",Y0):(i.scale[o]="independent",delete r[o]):r[o]=t}}for(const t of iL(r)){const i=e.scaleName(t,!0),o=r[t];n[t]=new N0(i,o);for(const n of e.children){const e=n.component.scales[t];e&&(n.renameScale(e.get("name"),i),e.merged=!0)}}return n}(e)}const Y0=$Y(((e,t)=>oW(e)-oW(t)));var X0=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i(e.from&&e.from.data&&(e.from.data=this.lookupDataSource(e.from.data)),e.from&&e.from.facet&&e.from.facet.data&&(e.from.facet.data=this.lookupDataSource(e.from.facet.data)),e),this.parent=n,this.config=i,this.view=CW(a),this.name=null!==(s=e.name)&&void 0!==s?s:r,this.title=vG(e.title)?{text:e.title}:e.title?this.initTitle(e.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new Z0,this.projectionNameMap=n?n.projectionNameMap:new Z0,this.signalNameMap=n?n.signalNameMap:new Z0,this.data=e.data,this.description=e.description,this.transforms=(null!==(u=e.transform)&&void 0!==u?u:[]).map((e=>HY(e)?{filter:RP(e.filter,Yq)}:e)),this.layout="layer"===t||"unit"===t?{}:function(e,t,n){var r,i;const o=n[t],a={},{spacing:s,columns:u}=o;void 0!==s&&(a.spacing=s),void 0!==u&&(DH(e)&&!EH(e.facet)||FV(e))&&(a.columns=u),jV(e)&&(a.columns=1);for(const t of BV)if(void 0!==e[t])if("spacing"===t){const n=e[t];a[t]=AP(n)?n:{row:null!==(r=n.row)&&void 0!==r?r:s,column:null!==(i=n.column)&&void 0!==i?i:s}}else a[t]=e[t];return a}(e,t,i),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:DH(e)||n&&n.component.data.isFaceted&&void 0===e.data},layoutSize:new FY,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:Object.assign({scale:{},axis:{},legend:{}},o?LP(o):{}),selection:null,scales:null,projection:null,axes:{},legends:{}}}initTitle(e){const t=iL(e),n={text:_G(e.text)};for(const r of t)n[r]=_G(e[r]);return n}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){!function(e,{ignoreRange:t}={}){V0(e),_0(e);for(const t of EW)q0(e,t);t||H0(e)}(this)}parseProjection(){MQ(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){AQ(this)}assembleGroupStyle(){var e,t;if("unit"===this.type||"layer"===this.type)return null!==(t=null===(e=this.view)||void 0===e?void 0:e.style)&&void 0!==t?t:"cell"}assembleEncodeFromView(e){const{style:t}=e,n=X0(e,["style"]),r={};for(const e of iL(n)){const t=n[e];void 0!==t&&(r[e]=kG(t))}return r}assembleGroupEncodeEntry(e){let t={};return this.view&&(t=this.assembleEncodeFromView(this.view)),e||(this.description&&(t.description=kG(this.description)),"unit"!==this.type&&"layer"!==this.type)?rL(t)?void 0:t:Object.assign({width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height")},null!=t?t:{})}assembleLayout(){if(!this.layout)return;const e=this.layout,{spacing:t}=e,n=X0(e,["spacing"]),{component:r,config:i}=this,o=function(e,t){const n={};for(const r of MI){const i=e[r];if(null==i?void 0:i.facetFieldDef){const{titleAnchor:e,titleOrient:o}=GK(["titleAnchor","titleOrient"],i.facetFieldDef.header,t,r),a=WK(r,o),s=rQ(e,a);void 0!==s&&(n[a]=s)}}return rL(n)?void 0:n}(r.layoutHeaders,i);return Object.assign(Object.assign(Object.assign({padding:t},this.assembleDefaultLayout()),n),o?{titleBand:o}:{})}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let t=[];for(const n of MI)e[n].title&&t.push(XK(this,n));for(const e of VK)t=t.concat(KK(this,e));return t}assembleAxes(){return function(e,t){const{x:n=[],y:r=[]}=e;return[...n.map((e=>MK(e,"grid",t))),...r.map((e=>MK(e,"grid",t))),...n.map((e=>MK(e,"main",t))),...r.map((e=>MK(e,"main",t)))].filter((e=>e))}(this.component.axes,this.config)}assembleLegends(){return SQ(this)}assembleProjections(){return e1(e=this)||Q0(e)?function(e){return e.children.reduce(((e,t)=>e.concat(t.assembleProjections())),CQ(e))}(e):CQ(e);var e}assembleTitle(){var e,t,n;const r=null!==(e=this.title)&&void 0!==e?e:{},{encoding:i}=r,o=X0(r,["encoding"]),a=Object.assign(Object.assign(Object.assign({},yG(this.config.title).nonMark),o),i?{encode:{update:i}}:{});if(a.text)return GP(["unit","layer"],this.type)?GP(["middle",void 0],a.anchor)&&(a.frame=null!==(t=a.frame)&&void 0!==t?t:"group"):a.anchor=null!==(n=a.anchor)&&void 0!==n?n:"start",rL(a)?void 0:a}assembleGroup(e=[]){const t={};(e=e.concat(this.assembleSignals())).length>0&&(t.signals=e);const n=this.assembleLayout();n&&(t.layout=n),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||K0(this.parent)?M0(this):[];r.length>0&&(t.scales=r);const i=this.assembleAxes();i.length>0&&(t.axes=i);const o=this.assembleLegends();return o.length>0&&(t.legends=o),t}getName(e){return uL((this.name?this.name+"_":"")+e)}getDataName(e){return this.getName(WY[e].toLowerCase())}requestDataName(e){const t=this.getDataName(e),n=this.component.data.outputNodeRefCounts;return n[t]=(n[t]||0)+1,t}getSizeSignalRef(e){if(K0(this.parent)){const t=gU(lQ(e)),n=this.component.scales[t];if(n&&!n.merged){const e=n.get("type"),r=n.get("range");if(dW(e)&&Mq(r)){const e=n.get("name"),r=C0(F0(this,t));return r?{signal:uQ(e,n,XH({aggregate:"distinct",field:r},{expr:"datum"}))}:(pq(WU(t)),null)}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const t=this.component.data.outputNodes[e];return t?t.getSource():e}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,t){this.signalNameMap.rename(e,t)}renameScale(e,t){this.scaleNameMap.rename(e,t)}renameProjection(e,t){this.projectionNameMap.rename(e,t)}scaleName(e,t){return t?this.getName(e):qI(e)&&SU(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e))?this.scaleNameMap.get(this.getName(e)):void 0}projectionName(e){return e?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const t=this.component.scales[e];return t&&!t.merged?t:this.parent?this.parent.getScaleComponent(e):void 0}getSelectionComponent(e,t){let n=this.component.selection[e];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(e,t)),!n)throw new Error(`Cannot find a selection named "${t}".`);return n}hasAxisOrientSignalRef(){var e,t;return(null===(e=this.component.axes.x)||void 0===e?void 0:e.some((e=>e.hasOrientSignalRef())))||(null===(t=this.component.axes.y)||void 0===t?void 0:t.some((e=>e.hasOrientSignalRef())))}}class n1 extends t1{vgField(e,t={}){const n=this.fieldDef(e);if(n)return XH(n,t)}reduceFieldDef(e,t){return function(e,t,n,r){return e?iL(e).reduce(((n,i)=>{const o=e[i];return pP(o)?o.reduce(((e,n)=>t.call(r,e,n,i)),n):t.call(r,n,o,i)}),n):n}(this.getMapping(),((t,n,r)=>{const i=oG(n);return i?e(t,i,r):t}),t)}forEachFieldDef(e,t){qG(this.getMapping(),((t,n)=>{const r=oG(t);r&&e(r,n)}),t)}}class r1 extends tZ{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=LP(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:"value",null!==(i=o[1])&&void 0!==i?i:"density"]}clone(){return new r1(null,LP(this.transform))}dependentFields(){var e;return new Set([this.transform.density,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${WP(this.transform)}`}assemble(){const e=this.transform,{density:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const o=SU(i)&&t.getScaleComponent(i);return o&&hW(o.get("type"))&&"count"!==n.aggregate&&!HW(r)&&(e[n.field]=n),e}),{});return iL(o).length?new i1(e,o):null}dependentFields(){return new Set(iL(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${WP(this.filter)}`}assemble(){const e=iL(this.filter).reduce(((e,t)=>{const n=this.filter[t],r=XH(n,{expr:"datum"});return null!==n&&("temporal"===n.type?e.push(`(isDate(${r}) || (isValid(${r}) && isFinite(+${r})))`):"quantitative"===n.type&&(e.push(`isValid(${r})`),e.push(`isFinite(+${r})`))),e}),[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}class o1 extends tZ{constructor(e,t){super(e),this.transform=t,this.transform=LP(t);const{flatten:n,as:r=[]}=this.transform;this.transform.as=n.map(((e,t)=>{var n;return null!==(n=r[t])&&void 0!==n?n:e}))}clone(){return new o1(this.parent,LP(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${WP(this.transform)}`}assemble(){const{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}class a1 extends tZ{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=LP(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:"key",null!==(i=o[1])&&void 0!==i?i:"value"]}clone(){return new a1(null,LP(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${WP(this.transform)}`}assemble(){const{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}class s1 extends tZ{constructor(e,t,n,r){super(e),this.fields=t,this.geojson=n,this.signal=r}clone(){return new s1(null,LP(this.fields),this.geojson,this.signal)}static parseAll(e,t){if(t.component.projection&&!t.component.projection.isFit)return e;let n=0;for(const r of[[rI,nI],[oI,iI]]){const i=r.map((e=>{const n=aG(t.encoding[e]);return TH(n)?n.field:RH(n)?{expr:`${n.datum}`}:qH(n)?{expr:`${n.value}`}:void 0}));(i[0]||i[1])&&(e=new s1(e,i,null,t.getName("geojson_"+n++)))}if(t.channelHasField(lI)){const r=t.typedFieldDef(lI);r.type===eW&&(e=new s1(e,null,r.field,t.getName("geojson_"+n++)))}return e}dependentFields(){var e;const t=(null!==(e=this.fields)&&void 0!==e?e:[]).filter(EP);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${WP(this.fields)}`}assemble(){return Object.assign(Object.assign(Object.assign({type:"geojson"},this.fields?{fields:this.fields}:{}),this.geojson?{geojson:this.geojson}:{}),{signal:this.signal})}}class u1 extends tZ{constructor(e,t,n,r){super(e),this.projection=t,this.fields=n,this.as=r}clone(){return new u1(null,this.projection,LP(this.fields),LP(this.as))}static parseAll(e,t){if(!t.projectionName())return e;for(const n of[[rI,nI],[oI,iI]]){const r=n.map((e=>{const n=aG(t.encoding[e]);return TH(n)?n.field:RH(n)?{expr:`${n.datum}`}:qH(n)?{expr:`${n.value}`}:void 0})),i=n[0]===oI?"2":"";(r[0]||r[1])&&(e=new u1(e,t.projectionName(),r,[t.getName("x"+i),t.getName("y"+i)]))}return e}dependentFields(){return new Set(this.fields.filter(EP))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${WP(this.fields)} ${WP(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class l1 extends tZ{constructor(e,t){super(e),this.transform=t}clone(){return new l1(null,LP(this.transform))}dependentFields(){var e;return new Set([this.transform.impute,this.transform.key,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:t=0,stop:n,step:r}=e;return{signal:`sequence(${[t,n,...r?[r]:[]].join(",")})`}}static makeFromTransform(e,t){return new l1(e,t)}static makeFromEncoding(e,t){const n=t.encoding,r=n.x,i=n.y;if(TH(r)&&TH(i)){const o=r.impute?r:i.impute?i:void 0;if(void 0===o)return;const a=r.impute?i:i.impute?r:void 0,{method:s,value:u,frame:l,keyvals:c}=o.impute,f=WG(t.mark,n);return new l1(e,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({impute:o.field,key:a.field},s?{method:s}:{}),void 0!==u?{value:u}:{}),l?{frame:l}:{}),void 0!==c?{keyvals:c}:{}),f.length?{groupby:f}:{}))}return null}hash(){return`Impute ${WP(this.transform)}`}assemble(){const{impute:e,key:t,keyvals:n,method:r,groupby:i,value:o,frame:a=[null,null]}=this.transform,s=Object.assign(Object.assign(Object.assign(Object.assign({type:"impute",field:e,key:t},n?{keyvals:GY(n)?this.processSequence(n):n}:{}),{method:"value"}),i?{groupby:i}:{}),{value:r&&"value"!==r?null:o});return r&&"value"!==r?[s,Object.assign({type:"window",as:[`imputed_${e}_value`],ops:[r],fields:[e],frame:a,ignorePeers:!1},i?{groupby:i}:{}),{type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e}]:[s]}}class c1 extends tZ{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=LP(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:t.on,null!==(i=o[1])&&void 0!==i?i:t.loess]}clone(){return new c1(null,LP(this.transform))}dependentFields(){var e;return new Set([this.transform.loess,this.transform.on,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${WP(this.transform)}`}assemble(){const e=this.transform,{loess:t,on:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ie))}producedFields(){}dependentFields(){var e;return new Set([this.transform.pivot,this.transform.value,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}hash(){return`PivotTransform ${WP(this.transform)}`}assemble(){const{pivot:e,value:t,groupby:n,limit:r,op:i}=this.transform;return Object.assign(Object.assign(Object.assign({type:"pivot",field:e,value:t},void 0!==r?{limit:r}:{}),void 0!==i?{op:i}:{}),void 0!==n?{groupby:n}:{})}}class g1 extends tZ{constructor(e,t){super(e),this.transform=t}clone(){return new g1(null,LP(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${WP(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function m1(e){let t=0;return function n(r,i){var o;if(r instanceof HQ&&!r.isGenerator&&!zY(r.data)&&(e.push(i),i={name:null,source:i.name,transform:[]}),r instanceof IQ&&(r.parent instanceof HQ&&!i.source?(i.format=Object.assign(Object.assign({},null!==(o=i.format)&&void 0!==o?o:{}),{parse:r.assembleFormatParse()}),i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof RQ){i.name||(i.name="data_"+t++),!i.source||i.transform.length>0?(e.push(i),r.data=i.name):r.data=i.source;for(const t of r.assemble())e.push(t)}else switch((r instanceof qQ||r instanceof WQ||r instanceof i1||r instanceof EK||r instanceof UK||r instanceof u1||r instanceof s1||r instanceof zQ||r instanceof f1||r instanceof f0||r instanceof l0||r instanceof a1||r instanceof o1||r instanceof r1||r instanceof c1||r instanceof d1||r instanceof h1||r instanceof UQ||r instanceof g1||r instanceof p1)&&i.transform.push(r.assemble()),(r instanceof TQ||r instanceof iZ||r instanceof l1||r instanceof c0)&&i.transform.push(...r.assemble()),r instanceof nZ&&(i.source&&0===i.transform.length?r.setSource(i.source):r.parent instanceof nZ?r.setSource(i.name):(i.name||(i.name="data_"+t++),r.setSource(i.name),1===r.numChildren()&&(e.push(i),i={name:null,source:i.name,transform:[]}))),r.numChildren()){case 0:r instanceof nZ&&(!i.source||i.transform.length>0)&&e.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name="data_"+t++);let o=i.name;!i.source||i.transform.length>0?e.push(i):o=i.source;for(const e of r.children)n(e,{name:null,source:o,transform:[]});break}}}}function y1(e,t){var n;const{facet:r,config:i,child:o,component:a}=e;if(e.channelHasField(t)){const s=r[t],u=HK("title",null,i,t);let l=tG(s,i,{allowDisabling:!0,includeDefault:void 0===u||!!u});o.component.layoutHeaders[t].title&&(l=pP(l)?l.join(", "):l,l+=" / "+o.component.layoutHeaders[t].title,o.component.layoutHeaders[t].title=null);const c=HK("labelOrient",s,i,t),f=bL((null!==(n=s.header)&&void 0!==n?n:{}).labels,i.header.labels,!0),d=GP(["bottom","right"],c)?"footer":"header";a.layoutHeaders[t]={title:l,facetFieldDef:s,[d]:"facet"===t?[]:[v1(e,t,f)]}}}function v1(e,t,n){const r="row"===t?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(r)?e.child.getSizeSignalRef(r):void 0,axes:[]}}function b1(e,t){var n;const{child:r}=e;if(r.component.axes[t]){const{layoutHeaders:o,resolve:a}=e.component;if(a.axis[t]=dQ(a,t),"shared"===a.axis[t]){const a="x"===t?"column":"row",s=o[a];for(const o of r.component.axes[t]){const t="top"===(i=o.get("orient"))||"left"===i||jq(i)?"header":"footer";s[t]=null!==(n=s[t])&&void 0!==n?n:[v1(e,a,!1)];const r=MK(o,"main",e.config,{header:!0});r&&s[t][0].axes.push(r),o.mainExtracted=!0}}}var i}function x1(e){for(const t of e.children)t.parseLayoutSize()}function _1(e,t){const n=lQ(t),r=gU(n),i=e.component.resolve,o=e.component.layoutSize;let a;for(const t of e.children){const e=t.component.layoutSize.getWithExplicit(n),o=i.scale[r];if("independent"===o&&"step"===e.value){a=void 0;break}if(a){if("independent"===o&&a.value!==e.value){a=void 0;break}a=BY(a,e,n,"")}else a=e}if(a){for(const r of e.children)e.renameSignal(r.getName(n),e.getName(t)),r.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,a)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function w1(e,t){const n="width"===t?"x":"y",r=e.config,i=e.getScaleComponent(n);if(i){const e=i.get("type"),n=i.get("range");if(dW(e)){const e=PV(r.view,t);return Mq(n)||$V(e)?"step":e}return zV(r.view,t)}if(e.hasProjection||"arc"===e.mark)return zV(r.view,t);{const e=PV(r.view,t);return $V(e)?e.step:e}}function k1(e,t,n){return XH(t,Object.assign({suffix:`by_${XH(e)}`},null!=n?n:{}))}class A1 extends n1{constructor(e,t,n,r){super(e,"facet",t,n,r,e.resolve),this.child=H1(e.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!EH(e))return{facet:this.initFacetFieldDef(e,"facet")};const t=iL(e),n={};for(const r of t){if(!GP([HL,GL],r)){pq(eq(r,"facet"));break}const t=e[r];if(void 0===t.field){pq(QU(t,r));break}n[r]=this.initFacetFieldDef(t,r)}return n}initFacetFieldDef(e,t){const{header:n}=e,r=lG(function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0?{aggregate:Object.assign(Object.assign({},u?{cross:u}:{}),i.length?{fields:i,ops:o,as:a}:{})}:{})}facetSortFields(e){const{facet:t}=this,n=t[e];return n?kH(n.sort)?[k1(n,n.sort,{expr:"datum"})]:pP(n.sort)?[qK(n,e,{expr:"datum"})]:[XH(n,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:t}=this,n=t[e];if(n){const{sort:e}=n;return[(kH(e)?e.order:!pP(e)&&e)||"ascending"]}return[]}assembleLabelTitle(){var e;const{facet:t,config:n}=this;if(t.facet)return eQ(t.facet,"facet",n);const r={row:["top","bottom"],column:["left","right"]};for(const i of VK)if(t[i]){const o=HK("labelOrient",null===(e=t[i])||void 0===e?void 0:e.header,n,i);if(GP(r[i],o))return eQ(t[i],i,n)}}assembleMarks(){const{child:e}=this,t=function(e){const t=[],n=m1(t);for(const t of e.children)n(t,{source:e.name,name:null,transform:[]});return t}(this.component.data.facetRoot),n=e.assembleGroupEncodeEntry(!1),r=this.assembleLabelTitle()||e.assembleTitle(),i=e.assembleGroupStyle();return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:this.getName("cell"),type:"group"},r?{title:r}:{}),i?{style:i}:{}),{from:{facet:this.assembleFacet()},sort:{field:MI.map((e=>this.facetSortFields(e))).flat(),order:MI.map((e=>this.facetSortOrder(e))).flat()}}),t.length>0?{data:t}:{}),n?{encode:{update:n}}:{}),e.assembleGroup(function(e,t){if(e.component.selection&&iL(e.component.selection).length){const n=OP(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:wX("mousemove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return FZ(t)}(this,[])))]}getMapping(){return this.facet}}function E1(e,t){var n,r,i,o;for(const a of t){const t=a.data;if(e.name&&a.hasName()&&e.name!==a.dataName)continue;const s=null===(n=e.format)||void 0===n?void 0:n.mesh,u=null===(r=t.format)||void 0===r?void 0:r.feature;if(s&&u)continue;const l=null===(i=e.format)||void 0===i?void 0:i.feature;if((l||u)&&l!==u)continue;const c=null===(o=t.format)||void 0===o?void 0:o.mesh;if(!s&&!c||s===c)if(RY(e)&&RY(t)){if(PP(e.values,t.values))return a}else if(zY(e)&&zY(t)){if(e.url===t.url)return a}else if(PY(e)&&e.name===a.dataName)return a}return null}function O1(e){var t,n,r,i,o,a,s,u,l,c;let f=function(e,t){if(e.data||!e.parent){if(null===e.data){const e=new HQ({values:[]});return t.push(e),e}const n=E1(e.data,t);if(n)return LY(e.data)||(n.data.format=XP({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const n=new HQ(e.data);return t.push(n),n}}return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}(e,e.component.data.sources);const{outputNodes:d,outputNodeRefCounts:h}=e.component.data,p=e.parent?e.parent.component.data.ancestorParse.clone():new TY,g=e.data;LY(g)?(IY(g)?f=new WQ(f,g.sequence):qY(g)&&(f=new qQ(f,g.graticule)),p.parseNothing=!0):null===(null===(t=null==g?void 0:g.format)||void 0===t?void 0:t.parse)&&(p.parseNothing=!0),f=null!==(n=IQ.makeExplicit(f,e,p))&&void 0!==n?n:f,f=new UQ(f);const m=e.parent&&e1(e.parent);(J0(e)||K0(e))&&m&&(f=null!==(r=TQ.makeFromEncoding(f,e))&&void 0!==r?r:f),e.transforms.length>0&&(f=function(e,t,n){var r,i;let o=0;for(const a of t.transforms){let s,u;if(rX(a))u=e=new UK(e,a),s="derived";else if(HY(a)){const i=LQ(a);u=e=null!==(r=IQ.makeWithAncestors(e,{},i,n))&&void 0!==r?r:e,e=new EK(e,t,a.filter)}else if(iX(a))u=e=TQ.makeFromTransform(e,a,t),s="number";else if(aX(a))s="date",void 0===n.getWithExplicit(a.field).value&&(e=new IQ(e,{[a.field]:s}),n.set(a.field,s,!1)),u=e=iZ.makeFromTransform(e,a);else if(sX(a))u=e=zQ.makeFromTransform(e,a),s="number",WZ(t)&&(e=new UQ(e));else if(VY(a))u=e=f1.make(e,t,a,o++),s="derived";else if(eX(a))u=e=new f0(e,a),s="number";else if(tX(a))u=e=new l0(e,a),s="number";else if(uX(a))u=e=c0.makeFromTransform(e,a),s="derived";else if(lX(a))u=e=new a1(e,a),s="derived";else if(nX(a))u=e=new o1(e,a),s="derived";else if(YY(a))u=e=new p1(e,a),s="derived";else if(QY(a))e=new g1(e,a);else if(oX(a))u=e=l1.makeFromTransform(e,a),s="derived";else if(XY(a))u=e=new r1(e,a),s="derived";else if(ZY(a))u=e=new d1(e,a),s="derived";else if(JY(a))u=e=new h1(e,a),s="derived";else{if(!KY(a)){pq(`Ignoring an invalid transform: ${qP(a)}.`);continue}u=e=new c1(e,a),s="derived"}if(u&&void 0!==s)for(const e of null!==(i=u.producedFields())&&void 0!==i?i:[])n.set(e,s,!1)}return e}(f,e,p));const y=function(e){const t={};if(J0(e)&&e.component.selection)for(const n of iL(e.component.selection)){const r=e.component.selection[n];for(const e of r.project.items)!e.channel&&vL(e.field)>1&&(t[e.field]="flatten")}return t}(e),v=function(e){const t={};function n(e){var n;dG(e)?t[e.field]="date":"quantitative"===e.type&&EP(n=e.aggregate)&&GP(["min","max"],n)?t[e.field]="number":vL(e.field)>1?e.field in t||(t[e.field]="flatten"):WH(e)&&kH(e.sort)&&vL(e.sort.field)>1&&(e.sort.field in t||(t[e.sort.field]="flatten"))}if((J0(e)||K0(e))&&e.forEachFieldDef(((t,r)=>{if(UH(t))n(t);else{const i=GI(r),o=e.fieldDef(i);n(Object.assign(Object.assign({},t),{type:o.type}))}})),J0(e)){const{mark:n,markDef:r,encoding:i}=e;if(HW(n)&&!e.encoding.order){const e=i["horizontal"===r.orient?"y":"x"];TH(e)&&"quantitative"===e.type&&!(e.field in t)&&(t[e.field]="number")}}return t}(e);f=null!==(i=IQ.makeWithAncestors(f,{},Object.assign(Object.assign({},y),v),p))&&void 0!==i?i:f,J0(e)&&(f=s1.parseAll(f,e),f=u1.parseAll(f,e)),(J0(e)||K0(e))&&(m||(f=null!==(o=TQ.makeFromEncoding(f,e))&&void 0!==o?o:f),f=null!==(a=iZ.makeFromEncoding(f,e))&&void 0!==a?a:f,f=UK.parseAllForSortIndex(f,e));const b=e.getDataName(WY.Raw),x=new nZ(f,b,WY.Raw,h);if(d[b]=x,f=x,J0(e)){const t=zQ.makeFromEncoding(f,e);t&&(f=t,WZ(e)&&(f=new UQ(f))),f=null!==(s=l1.makeFromEncoding(f,e))&&void 0!==s?s:f,f=null!==(u=c0.makeFromEncoding(f,e))&&void 0!==u?u:f}J0(e)&&(f=null!==(l=i1.make(f,e))&&void 0!==l?l:f);const _=e.getDataName(WY.Main),w=new nZ(f,_,WY.Main,h);d[_]=w,f=w,J0(e)&&function(e,t){UZ(e,(n=>{const r=n.name,i=e.getName(`lookup_${r}`);e.component.data.outputNodes[i]=n.materialized=new nZ(new EK(t,e,{selection:r}),i,WY.Lookup,e.component.data.outputNodeRefCounts)}))}(e,w);let k=null;if(K0(e)){const t=e.getName("facet");f=null!==(c=function(e,t){const{row:n,column:r}=t;if(n&&r){let t=null;for(const i of[n,r])if(kH(i.sort)){const{field:n,op:r=bH}=i.sort;e=t=new l0(e,{joinaggregate:[{op:r,field:n,as:k1(i,i.sort,{forAs:!0})}],groupby:[XH(i)]})}return t}return null}(f,e.facet))&&void 0!==c?c:f,k=new RQ(f,e,t,w.getSource()),d[t]=k}return Object.assign(Object.assign({},e.component.data),{outputNodes:d,outputNodeRefCounts:h,raw:x,main:w,facetRoot:k,ancestorParse:p})}class D1 extends t1{constructor(e,t,n,r){var i,o,a,s;super(e,"concat",t,n,r,e.resolve),"shared"!==(null===(o=null===(i=e.resolve)||void 0===i?void 0:i.axis)||void 0===o?void 0:o.x)&&"shared"!==(null===(s=null===(a=e.resolve)||void 0===a?void 0:a.axis)||void 0===s?void 0:s.y)||pq("Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415)."),this.children=this.getChildren(e).map(((e,t)=>H1(e,this,this.getName("concat_"+t),void 0,r)))}parseData(){this.component.data=O1(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of iL(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return jV(e)?e.vconcat:MV(e)?e.hconcat:e.concat}parseLayoutSize(){!function(e){x1(e);const t=1===e.layout.columns?"width":"childWidth",n=void 0===e.layout.columns?"height":"childHeight";_1(e,t),_1(e,n)}(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.forEach((e=>e.assembleSignals())),[]}assembleLayoutSignals(){const e=oQ(this);for(const t of this.children)e.push(...t.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleMarks(){return this.children.map((e=>{const t=e.assembleTitle(),n=e.assembleGroupStyle(),r=e.assembleGroupEncodeEntry(!1);return Object.assign(Object.assign(Object.assign(Object.assign({type:"group",name:e.getName("group")},t?{title:t}:{}),n?{style:n}:{}),r?{encode:{update:r}}:{}),e.assembleGroup())}))}assembleDefaultLayout(){const e=this.layout.columns;return Object.assign(Object.assign({},null!=e?{columns:e}:{}),{bounds:"full",align:"each"})}}const S1=Object.assign(Object.assign({disable:1,gridScale:1,scale:1},jL),{labelExpr:1,encode:1}),C1=iL(S1);class F1 extends FY{constructor(e={},t={},n=!1){super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new F1(LP(this.explicit),LP(this.implicit),this.mainExtracted)}hasAxisPart(e){return!("axis"!==e&&("grid"===e||"title"===e?!this.get(e):(t=this.get(e),!1===t||null===t)));var t}hasOrientSignalRef(){return jq(this.explicit.orient)}}const j1={bottom:"top",top:"bottom",left:"right",right:"left"};function M1(e,t){if(!e)return t.map((e=>e.clone()));{if(e.length!==t.length)return;const n=e.length;for(let r=0;r{switch(n){case"title":return NG(e,t);case"gridScale":return{explicit:e.explicit,value:bL(e.value,t.value)}}return NY(e,t,n,"axis")}));e.setWithExplicit(n,r)}return e}function N1(e,t,n,r,i){if("disable"===t)return void 0!==n;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(jq(n.labelAngle)?n.labelAngle:EL(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===IK(r,i))return!0}return e===n[t]}const B1=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function T1(e,t){var n,r,i;let o=t.axis(e);const a=new F1,s=aG(t.encoding[e]),{mark:u,config:l}=t,c=(null==o?void 0:o.orient)||(null===(n=l["x"===e?"axisX":"axisY"])||void 0===n?void 0:n.orient)||(null===(r=l.axis)||void 0===r?void 0:r.orient)||function(e){return"x"===e?"bottom":"left"}(e),f=t.getScaleComponent(e).get("type"),d=function(e,t,n,r){const i="band"===t?["axisDiscrete","axisBand"]:"point"===t?["axisDiscrete","axisPoint"]:t in uW?["axisQuantitative"]:"time"===t||"utc"===t?["axisTemporal"]:[],o="x"===e?"axisX":"axisY",a=jq(n)?"axisOrient":"axis"+fL(n),s=[...i,...i.map((e=>o+e.substr(4)))],u=["axis",a,o];return{vlOnlyAxisConfig:NK(s,r,e,n),vgAxisConfig:NK(u,r,e,n),axisConfigStyle:BK([...u,...s],r)}}(e,f,c,t.config),h=void 0!==o?!o:TK("disable",l.style,null==o?void 0:o.style,d).configValue;if(a.set("disable",h,void 0!==o),h)return a;o=o||{};const p=function(e,t,n,r,i){const o=null==t?void 0:t.labelAngle;if(void 0!==o)return jq(o)?o:EL(o);{const{configValue:o}=TK("labelAngle",r,null==t?void 0:t.style,i);return void 0!==o?EL(o):n!==YL||!GP([Qq,Jq],e.type)||TH(e)&&e.timeUnit?void 0:270}}(s,o,e,l.style,d),g={fieldOrDatumDef:s,axis:o,channel:e,model:t,scaleType:f,orient:c,labelAngle:p,mark:u,config:l};for(const n of C1){const r=n in zK?zK[n](g):$L(n)?o[n]:void 0,i=void 0!==r,s=N1(r,n,o,t,e);if(i&&s)a.set(n,r,s);else{const{configValue:e,configFrom:t}=$L(n)&&"values"!==n?TK(n,l.style,o.style,d):{},u=void 0!==e;i&&!u?a.set(n,r,s):("vgAxisConfig"!==t||B1.has(n)&&u||SL(e)||jq(e))&&a.set(n,e,!1)}}const m=null!==(i=o.encoding)&&void 0!==i?i:{},y=CL.reduce(((n,r)=>{var i;if(!a.hasAxisPart(r))return n;const o=cQ(null!==(i=m[r])&&void 0!==i?i:{},t),s="labels"===r?function(e,t,n){var r;const{encoding:i,config:o}=e,a=null!==(r=aG(i[t]))&&void 0!==r?r:aG(i[YI(t)]),s=e.axis(t)||{},{format:u,formatType:l}=s;return sH(l)?Object.assign({text:dH({fieldOrDatumDef:a,field:"datum.value",format:u,formatType:l,config:o})},n):n}(t,e,o):o;return void 0===s||rL(s)||(n[r]={update:s}),n}),{});return rL(y)||a.set("encode",y,!!o.encoding||void 0!==o.labelAngle),a}function z1(e,t){const{config:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),BX("x",e,{defaultPos:"mid"})),BX("y",e,{defaultPos:"mid"})),MX("size",e)),MX("angle",e)),function(e,t,n){return n?{shape:{value:n}}:MX("shape",e)}(e,0,t))}function R1(e){var t;const{config:n,markDef:r}=e,{orient:i}=r,o="horizontal"===i?"width":"height",a=e.getScaleComponent("horizontal"===i?"x":"y"),s=null!==(t=DG("size",r,n,{vgChannel:o}))&&void 0!==t?t:n.tick.bandSize;if(void 0!==s)return s;{const e=a?a.get("range"):void 0;return e&&Mq(e)&&AP(e.step)?3*e.step/4:3*RV(n.view,o)/4}}const P1={arc:{vgMark:"arc",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),BX("x",e,{defaultPos:"mid"})),BX("y",e,{defaultPos:"mid"})),qX(e,"radius","arc")),qX(e,"theta","arc"))},area:{vgMark:"area",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"})),LX("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===e.markDef.orient})),LX("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===e.markDef.orient})),ZX(e))},bar:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),qX(e,"x","bar")),qX(e,"y","bar"))},circle:{vgMark:"symbol",encodeEntry:e=>z1(e,"circle")},geoshape:{vgMark:"shape",encodeEntry:e=>Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[Object.assign({type:"geoshape",projection:e.projectionName()},n&&TH(n)&&n.type===eW?{field:XH(n,{expr:"datum"})}:{})]}},image:{vgMark:"image",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"})),qX(e,"x","image")),qX(e,"y","image")),DX(e,"url"))},line:{vgMark:"line",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),BX("x",e,{defaultPos:"mid"})),BX("y",e,{defaultPos:"mid"})),MX("size",e,{vgChannel:"strokeWidth"})),ZX(e))},point:{vgMark:"symbol",encodeEntry:e=>z1(e)},rect:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),qX(e,"x","rect")),qX(e,"y","rect"))},rule:{vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return e.encoding.x||e.encoding.y||e.encoding.latitude||e.encoding.longitude?Object.assign(Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),LX("x",e,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n})),LX("y",e,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n})),MX("size",e,{vgChannel:"strokeWidth"})):{}}},square:{vgMark:"symbol",encodeEntry:e=>z1(e,"square")},text:{vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},YX(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"})),BX("x",e,{defaultPos:"mid"})),BX("y",e,{defaultPos:"mid"})),DX(e)),MX("size",e,{vgChannel:"fontSize"})),MX("angle",e)),JX("align",function(e,t,n){if(void 0===DG("align",e,n))return"center"}(e.markDef,0,t))),JX("baseline",function(e,t,n){if(void 0===DG("baseline",e,n))return"middle"}(e.markDef,0,t))),BX("radius",e,{defaultPos:null,isMidPoint:!0})),BX("theta",e,{defaultPos:null,isMidPoint:!0}))}},tick:{vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,r=n.orient,i="horizontal"===r?"width":"height",o="horizontal"===r?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),BX("x",e,{defaultPos:"mid",vgChannel:"xc"})),BX("y",e,{defaultPos:"mid",vgChannel:"yc"})),MX("size",e,{defaultValue:R1(e),vgChannel:i})),{[o]:kG(DG("thickness",n,t))})}},trail:{vgMark:"trail",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),BX("x",e,{defaultPos:"mid"})),BX("y",e,{defaultPos:"mid"})),MX("size",e)),ZX(e))}};const L1="faceted_path_",I1="stack_group_";function U1(e,t={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=e,a=bL(r.clip,function(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return!!(t&&t.get("selectionExtent")||n&&n.get("selectionExtent"))||void 0}(e),function(e){const t=e.component.projection;return!(!t||t.isFit)||void 0}(e)),s=OG(r),u=i.key,l=function(e){const{encoding:t,stack:n,mark:r,markDef:i,config:o}=e,a=t.order;if(!(!pP(a)&&qH(a)&&HP(a.value)||!a&&HP(DG("order",i,o)))){if((pP(a)||TH(a))&&!n)return jG(a,{expr:"datum"});if(HW(r)){const n="horizontal"===i.orient?"y":"x",r=t[n];if(TH(r)){const t=r.sort;return pP(t)?{field:XH(r,{prefix:n,suffix:"sort_index",expr:"datum"})}:kH(t)?{field:XH({aggregate:PG(e.encoding)?t.op:void 0,field:t.field},{expr:"datum"})}:wH(t)?{field:XH(e.fieldDef(t.encoding),{expr:"datum"}),order:t.order}:null===t?void 0:{field:XH(r,{binSuffix:e.stack&&e.stack.impute?"mid":void 0,expr:"datum"})}}}}}(e),c=function(e){if(!e.component.selection)return null;const t=iL(e.component.selection).length;let n=t,r=e.parent;for(;r&&0===n;)n=iL(r.component.selection).length,r=r.parent;return n?{interactive:t>0||!!e.encoding.tooltip}:null}(e),f=DG("aria",r,o),d=P1[n].postEncodingTransform?P1[n].postEncodingTransform(e):null;return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:e.getName("marks"),type:P1[n].vgMark},a?{clip:!0}:{}),s?{style:s}:{}),u?{key:u.field}:{}),l?{sort:l}:{}),c||{}),!1===f?{aria:f}:{}),{from:{data:t.fromPrefix+e.requestDataName(WY.Main)},encode:{update:P1[n].encodeEntry(e)}}),d?{transform:d}:{})]}class q1 extends n1{constructor(e,t,n,r={},i){super(e,"unit",t,n,i,void 0,NV(e)?e.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection={},this.children=[];const o=YW(e.mark)?Object.assign({},e.mark):{type:e.mark},a=o.type;void 0===o.filled&&(o.filled=function(e,t,{graticule:n}){if(n)return!1;const r=SG("filled",e,t),i=e.type;return bL(r,i!==TW&&i!==BW&&i!==RW)}(o,i,{graticule:e.data&&qY(e.data)}));const s=this.encoding=IG(e.encoding||{},a,o.filled,i);this.markDef=function(e,t,n){const r=CW(e),i=DG("orient",r,n);if(r.orient=function(e,t,n){switch(e){case TW:case UW:case qW:case PW:case zW:case NW:return}const{x:r,y:i,x2:o,y2:a}=t;switch(e){case $W:if(TH(r)&&(BU(r.bin)||TH(i)&&i.aggregate&&!r.aggregate))return"vertical";if(TH(i)&&(BU(i.bin)||TH(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o&&(TH(r)&&r.type===Zq&&!NU(r.bin)||LH(r)))return"horizontal";if(!a&&(TH(i)&&i.type===Zq&&!NU(i.bin)||LH(i)))return"vertical"}case RW:if(o&&(!TH(r)||!BU(r.bin))&&a&&(!TH(i)||!BU(i.bin)))return;case MW:if(a)return TH(i)&&BU(i.bin)?"horizontal":"vertical";if(o)return TH(r)&&BU(r.bin)?"vertical":"horizontal";if(e===RW){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case BW:case LW:{const t=PH(r),o=PH(i);if(t&&!o)return"tick"!==e?"horizontal":"vertical";if(!t&&o)return"tick"!==e?"vertical":"horizontal";if(t&&o){const t=r,o=i,a=t.type===Kq,s=o.type===Kq;return a&&!s?"tick"!==e?"vertical":"horizontal":!a&&s?"tick"!==e?"horizontal":"vertical":!t.aggregate&&o.aggregate?"tick"!==e?"vertical":"horizontal":t.aggregate&&!o.aggregate?"tick"!==e?"horizontal":"vertical":n||"vertical"}return n||void 0}}return"vertical"}(r.type,t,i),void 0!==i&&i!==r.orient&&pq(`Specified orient "${r.orient}" overridden with "${i}".`),"bar"===r.type&&r.orient){const e=DG("cornerRadiusEnd",r,n);if(void 0!==e){const n="horizontal"===r.orient&&t.x2||"vertical"===r.orient&&t.y2?["cornerRadius"]:KW[r.orient];for(const t of n)r[t]=e;void 0!==r.cornerRadiusEnd&&delete r.cornerRadiusEnd}}return void 0===DG("opacity",r,n)&&(r.opacity=function(e,t){if(GP([TW,LW,UW,qW],e)&&!PG(t))return.7}(r.type,t)),void 0===DG("cursor",r,n)&&(r.cursor=function(e,t,n){return t.href||e.href||DG("href",e,n)?"pointer":e.cursor}(r,t,n)),r}(o,s,i),this.size=function({encoding:e,size:t}){for(const n of fU){const r=XI(n);$V(t[r])&&PH(e[n])&&(delete t[r],pq(sq(r)))}return t}({encoding:s,size:NV(e)?Object.assign(Object.assign(Object.assign({},r),e.width?{width:e.width}:{}),e.height?{height:e.height}:{}):r}),this.stack=iY(a,s),this.specifiedScales=this.initScales(a,s),this.specifiedAxes=this.initAxes(s),this.specifiedLegends=this.initLegends(s),this.specifiedProjection=e.projection,this.selection=e.selection}get hasProjection(){const{encoding:e}=this,t=this.mark===WW,n=e&&SI.some((t=>IH(e[t])));return t||n}scaleDomain(e){const t=this.specifiedScales[e];return t?t.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,t){return DU.reduce(((e,n)=>{var r;const i=aG(t[n]);return i&&(e[n]=this.initScale(null!==(r=i.scale)&&void 0!==r?r:{})),e}),{})}initScale(e){const{domain:t,range:n}=e,r=CW(e);return pP(t)&&(r.domain=t.map(_G)),pP(n)&&(r.range=n.map(_G)),r}initAxes(e){return fU.reduce(((t,n)=>{const r=e[n];if(IH(r)||n===YL&&IH(e.x2)||n===XL&&IH(e.y2)){const e=IH(r)?r.axis:void 0;t[n]=e?this.initAxis(Object.assign({},e)):e}return t}),{})}initAxis(e){const t=iL(e),n={};for(const r of t){const t=e[r];n[r]=SL(t)?xG(t):_G(t)}return n}initLegends(e){return EU.reduce(((t,n)=>{const r=aG(e[n]);if(r&&function(e){switch(e){case aI:case sI:case uI:case cI:case lI:case dI:case gI:case mI:return!0;case hI:case pI:case fI:return!1}}(n)){const e=r.legend;t[n]=e?CW(e):e}return t}),{})}parseData(){this.component.data=O1(this)}parseLayoutSize(){!function(e){const{size:t,component:n}=e;for(const r of fU){const i=XI(r);if(t[i]){const e=t[i];n.layoutSize.set(i,$V(e)?"step":e,!0)}else{const t=w1(e,i);n.layoutSize.set(i,t,!1)}}}(this)}parseSelections(){this.component.selection=function(e,t){var n;const r={},i=e.config.selection;for(const o of iL(null!=t?t:{})){const a=LP(t[o]),s=i[a.type],{fields:u,encodings:l}=s,c=OK(s,["fields","encodings"]);for(const e in c)"encodings"===e&&a.fields||"fields"===e&&a.encodings||("mark"===e&&(a[e]=Object.assign(Object.assign({},c[e]),a[e])),void 0!==a[e]&&!0!==a[e]||(a[e]=null!==(n=c[e])&&void 0!==n?n:a[e]));const f=uL(o),d=r[f]=Object.assign(Object.assign({},a),{name:f,events:EP(a.on)?wX(a.on,"scope"):LP(a.on)});DZ(d,(n=>{n.has(d)&&n.parse&&n.parse(e,d,a,t[o])}))}return r}(this,this.selection)}parseMarkGroup(){this.component.mark=function(e){if(GP([BW,MW,IW],e.mark)){const t=WG(e.mark,e.encoding);if(t.length>0)return function(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:L1+e.requestDataName(WY.Main),data:e.requestDataName(WY.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:U1(e,{fromPrefix:L1})}]}(e,t)}else if(GP([$W],e.mark)){const t=Tq.some((t=>DG(t,e.markDef,e.config)));if(e.stack&&!e.fieldDef("size")&&t)return function(e){const[t]=U1(e,{fromPrefix:I1}),n=e.scaleName(e.stack.fieldChannel),r=(t={})=>e.vgField(e.stack.fieldChannel,t),i=(e,t)=>`${e}(${[r({prefix:"min",suffix:"start",expr:t}),r({prefix:"max",suffix:"start",expr:t}),r({prefix:"min",suffix:"end",expr:t}),r({prefix:"max",suffix:"end",expr:t})].map((e=>`scale('${n}',${e})`)).join(",")})`;let o,a;"x"===e.stack.fieldChannel?(o=Object.assign(Object.assign({},IP(t.encode.update,["y","yc","y2","height",...Tq])),{x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}}),a={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update=Object.assign(Object.assign({},UP(t.encode.update,["y","yc","y2"])),{height:{field:{group:"height"}}})):(o=Object.assign(Object.assign({},IP(t.encode.update,["x","xc","x2","width"])),{y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}}),a={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update=Object.assign(Object.assign({},UP(t.encode.update,["x","xc","x2"])),{width:{field:{group:"width"}}}));for(const n of Tq){const r=SG(n,e.markDef,e.config);t.encode.update[n]?(o[n]=t.encode.update[n],delete t.encode.update[n]):r&&(o[n]=kG(r)),r&&(t.encode.update[n]={value:0})}const s=e.fieldDef(e.stack.groupbyChannel),u=XH(s)?[XH(s)]:[];return((null==s?void 0:s.bin)||(null==s?void 0:s.timeUnit))&&u.push(XH(s,{binSuffix:"end"})),o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce(((n,r)=>{if(t.encode.update[r])return Object.assign(Object.assign({},n),{[r]:t.encode.update[r]});{const t=SG(r,e.markDef,e.config);return void 0!==t?Object.assign(Object.assign({},n),{[r]:kG(t)}):n}}),o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(WY.Main),name:I1+e.requestDataName(WY.Main),groupby:u,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:a},marks:[t]}]}]}(e)}return U1(e)}(this)}parseAxesAndHeaders(){var e;this.component.axes=(e=this,fU.reduce(((t,n)=>(e.component.scales[n]&&(t[n]=[T1(n,e)]),t)),{}))}assembleSelectionTopLevelSignals(e){return function(e,t){let n=!1;if(UZ(e,((r,i)=>{const o=r.name,a=OP(o+RZ);if(0===t.filter((e=>e.name===o)).length){const e="global"===r.resolve?"union":r.resolve,n="multi"===r.type?", true)":")";t.push({name:r.name,update:`${LZ}(${a}, ${OP(e)}${n}`})}n=!0,i.topLevelSignals&&(t=i.topLevelSignals(e,r,t)),DZ(r,(n=>{n.topLevelSignals&&(t=n.topLevelSignals(e,r,t))}))})),n){0===t.filter((e=>"unit"===e.name)).length&&t.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]})}return FZ(t)}(this,e)}assembleSignals(){return[...$K(this),...(e=this,t=[],UZ(e,((n,r)=>{const i=n.name;let o=r.modifyExpr(e,n);t.push(...r.signals(e,n)),DZ(n,(r=>{r.signals&&(t=r.signals(e,n,t)),r.modifyExpr&&(o=r.modifyExpr(e,n,o))})),t.push({name:i+"_modify",on:[{events:{signal:n.name+PZ},update:`modify(${OP(n.name+RZ)}, ${o})`}]})})),FZ(t))];var e,t}assembleSelectionData(e){return function(e,t){const n=[...t];return UZ(e,(t=>{const r={name:t.name+RZ};if(t.init){const n=t.project.items.map((e=>{const{signals:t}=e;return function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);iSZ(e,!1)));r.values="interval"===t.type?[{unit:qZ(e,{escape:!1}),fields:n,values:i}]:i.map((t=>({unit:qZ(e,{escape:!1}),fields:n,values:t})))}n.filter((e=>e.name===t.name+RZ)).length||n.push(r)})),n}(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return oQ(this)}assembleMarks(){var e;let t=null!==(e=this.component.mark)&&void 0!==e?e:[];return this.parent&&e1(this.parent)||(t=CZ(this,t)),t.map(this.correctDataNames)}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return RG(this.encoding,e)}fieldDef(e){return oG(this.encoding[e])}typedFieldDef(e){const t=this.fieldDef(e);return UH(t)?t:null}}class W1 extends t1{constructor(e,t,n,r,i){super(e,"layer",t,n,i,e.resolve,e.view);const o=Object.assign(Object.assign(Object.assign({},r),e.width?{width:e.width}:{}),e.height?{height:e.height}:{});this.children=e.layer.map(((e,t)=>{if(KV(e))return new W1(e,this,this.getName("layer_"+t),o,i);if(BG(e))return new q1(e,this,this.getName("layer_"+t),o,i);throw new Error(PU(e))}))}parseData(){this.component.data=O1(this);for(const e of this.children)e.parseData()}parseLayoutSize(){x1(this),_1(this,"width"),_1(this,"height")}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of iL(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){!function(e){var t;const{axes:n,resolve:r}=e.component,i={top:0,bottom:0,right:0,left:0};for(const t of e.children){t.parseAxesAndHeaders();for(const i of iL(t.component.axes))r.axis[i]=dQ(e.component.resolve,i),"shared"===r.axis[i]&&(n[i]=M1(n[i],t.component.axes[i]),n[i]||(r.axis[i]="independent",delete n[i]))}for(const o of fU){for(const a of e.children)if(a.component.axes[o]){if("independent"===r.axis[o]){n[o]=(null!==(t=n[o])&&void 0!==t?t:[]).concat(a.component.axes[o]);for(const e of a.component.axes[o]){const{value:t,explicit:n}=e.getWithExplicit("orient");if(!jq(t)){if(i[t]>0&&!n){const n=j1[t];i[t]>i[n]&&e.set("orient",n,!1)}i[t]++}}}delete a.component.axes[o]}if("independent"===r.axis[o]&&n[o]&&n[o].length>1)for(const e of n[o])e.get("grid")&&!e.explicit.grid&&(e.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleSignals())),$K(this))}assembleLayoutSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleLayoutSignals())),oQ(this))}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const t of this.children)if(e=t.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return function(e,t){for(const n of e.children)J0(n)&&(t=CZ(n,t));return t}(this,this.children.flatMap((e=>e.assembleMarks())))}assembleLegends(){return this.children.reduce(((e,t)=>e.concat(t.assembleLegends())),SQ(this))}}function H1(e,t,n,r,i){if(DH(e))return new A1(e,t,n,i);if(KV(e))return new W1(e,t,n,r,i);if(BG(e))return new q1(e,t,n,r,i);if(function(e){return jV(e)||MV(e)||FV(e)}(e))return new D1(e,t,n,i);throw new Error(PU(e))}var G1=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1)));const{params:f}=t,d=G1(t,["params"]);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({$schema:"https://vega.github.io/schema/vega/v5.json"},e.description?{description:e.description}:{}),d),s?{title:s}:{}),u?{style:u}:{}),l?{encode:{update:l}}:{}),{data:o}),a.length>0?{projections:a}:{}),e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([]),...EV(f)])),i?{config:i}:{}),r?{usermeta:r}:{})}(i,function(e,t,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");if(void 0===t?(t={type:"pad"},r.hasAxisOrientSignalRef()&&(t.resize=!0)):EP(t)&&(t={type:t}),i&&o&&("fit"===(a=t.type)||"fit-x"===a||"fit-y"===a))if("step"===i&&"step"===o)pq(qU()),t.type="pad";else if("step"===i||"step"===o){const e="step"===i?"width":"height";pq(qU(gU(e)));const n="width"===e?"height":"width";t.type=function(e){return e?`fit-${gU(e)}`:"fit"}(n)}var a;return Object.assign(Object.assign(Object.assign({},1===iL(t).length&&t.type?"pad"===t.type?{}:{autosize:t.type}:{autosize:t}),CY(n,!1)),CY(e,!0))}(e,r.autosize,n,i),e.datasets,e.usermeta);return{spec:o,normalized:r}}finally{t.logger&&(hq=dq),t.fieldTitle&&eG(KH)}}const Y1=function(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}};const X1="#fff",Z1="#888",J1={background:"#333",view:{stroke:Z1},title:{color:X1,subtitleColor:X1},style:{"guide-label":{fill:X1},"guide-title":{fill:X1}},axis:{domainColor:X1,gridColor:Z1,tickColor:X1}},K1="#4572a7",Q1={background:"#fff",arc:{fill:K1},area:{fill:K1},line:{stroke:K1,strokeWidth:2},path:{stroke:K1},rect:{fill:K1},shape:{stroke:K1},symbol:{fill:K1,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},e2="#30a2da",t2="#cbcbcb",n2="#f0f0f0",r2="#333",i2={arc:{fill:e2},area:{fill:e2},axis:{domainColor:t2,grid:!0,gridColor:t2,gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:t2,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:n2,group:{fill:n2},legend:{labelColor:r2,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:r2,titleFontSize:14,titlePadding:10},line:{stroke:e2,strokeWidth:2},path:{stroke:e2,strokeWidth:.5},rect:{fill:e2},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:e2},bar:{binSpacing:2,fill:e2,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},o2="#000",a2={group:{fill:"#e5e5e5"},arc:{fill:o2},area:{fill:o2},line:{stroke:o2},path:{stroke:o2},rect:{fill:o2},shape:{stroke:o2},symbol:{fill:o2,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},s2="Benton Gothic, sans-serif",u2="#82c6df",l2="Benton Gothic Bold, sans-serif",c2="normal",f2={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},d2={background:"#ffffff",title:{anchor:"start",color:"#000000",font:l2,fontSize:22,fontWeight:"normal"},arc:{fill:u2},area:{fill:u2},line:{stroke:u2,strokeWidth:2},path:{stroke:u2},rect:{fill:u2},shape:{stroke:u2},symbol:{fill:u2,size:30},axis:{labelFont:s2,labelFontSize:11.5,labelFontWeight:"normal",titleFont:l2,titleFontSize:13,titleFontWeight:c2},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:s2,labelFontSize:11.5,symbolType:"square",titleFont:l2,titleFontSize:13,titleFontWeight:c2},range:{category:f2["category-6"],diverging:f2["fireandice-6"],heatmap:f2["fire-7"],ordinal:f2["fire-7"],ramp:f2["fire-7"]}},h2="#ab5787",p2="#979797",g2={background:"#f9f9f9",arc:{fill:h2},area:{fill:h2},line:{stroke:h2},path:{stroke:h2},rect:{fill:h2},shape:{stroke:h2},symbol:{fill:h2,size:30},axis:{domainColor:p2,domainWidth:.5,gridWidth:.2,labelColor:p2,tickColor:p2,tickWidth:.2,titleColor:p2},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},m2="#3e5c69",y2={background:"#fff",arc:{fill:m2},area:{fill:m2},line:{stroke:m2},path:{stroke:m2},rect:{fill:m2},shape:{stroke:m2},symbol:{fill:m2},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},v2="#1696d2",b2="#000000",x2="Lato",_2="Lato",w2={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},k2={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:x2},axisX:{domain:!0,domainColor:b2,domainWidth:1,grid:!1,labelFontSize:12,labelFont:_2,labelAngle:0,tickColor:b2,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:x2},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:_2,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:x2,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:_2,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:x2,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:w2["six-groups-cat-1"],diverging:w2["diverging-colors"],heatmap:w2["diverging-colors"],ordinal:w2["six-groups-seq"],ramp:w2["shades-blue"]},area:{fill:v2},rect:{fill:v2},line:{color:v2,stroke:v2,strokeWidth:5},trail:{color:v2,stroke:v2,strokeWidth:0,size:1},path:{stroke:v2,strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:v2,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:v2,stroke:null}},arc:{fill:v2},shape:{stroke:v2},symbol:{fill:v2,size:30}},A2="#3366CC",E2="#ccc",O2="Arial, sans-serif",D2={arc:{fill:A2},area:{fill:A2},path:{stroke:A2},rect:{fill:A2},shape:{stroke:A2},symbol:{stroke:A2},circle:{fill:A2},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:O2,fontSize:12},"guide-title":{font:O2,fontSize:12},"group-title":{font:O2,fontSize:12}},title:{font:O2,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:E2,tickColor:E2,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},S2=e=>e*(1/3+1),C2=S2(9),F2=S2(10),j2=S2(12),M2="Segoe UI",$2="wf_standard-font, helvetica, arial, sans-serif",N2="#252423",B2="#605E5C",T2="transparent",z2="#118DFF",R2="#DEEFFF",P2=[R2,z2],L2={view:{stroke:T2},background:T2,font:M2,header:{titleFont:$2,titleFontSize:j2,titleColor:N2,labelFont:M2,labelFontSize:F2,labelColor:B2},axis:{ticks:!1,grid:!1,domain:!1,labelColor:B2,labelFontSize:C2,titleFont:$2,titleColor:N2,titleFontSize:j2,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:"#C8C6C4",gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:z2},line:{stroke:z2,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:M2,fontSize:C2,fill:B2},arc:{fill:z2},area:{fill:z2,line:!0,opacity:.6},path:{stroke:z2},rect:{fill:z2},point:{fill:z2,filled:!0,size:75},shape:{stroke:z2},symbol:{fill:z2,strokeWidth:1.5,size:50},legend:{titleFont:M2,titleFontWeight:"bold",titleColor:B2,labelFont:M2,labelFontSize:F2,labelColor:B2,symbolType:"circle",symbolSize:75},range:{category:[z2,"#12239E","#E66C37","#6B007B","#E044A7","#744EC2","#D9B300","#D64550"],diverging:P2,heatmap:P2,ordinal:[R2,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",z2]}},I2="2.12.1";function U2(e,t){return JSON.stringify(e,function(e){const t=[];return function(n,r){if("object"!=typeof r||null===r)return r;const i=t.indexOf(this)+1;return t.length=i,t.length>e?"[Object]":t.indexOf(r)>=0?"[Circular]":(t.push(r),r)}}(t))}const q2="vg-tooltip-element",W2={offsetX:10,offsetY:10,id:q2,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(e){return String(e).replace(/&/g,"&").replace(/t(vt(e)?e:U2(e,n)))).join(", ")}]`;if(we(e)){let r="";const i=e,{title:o,image:a}=i,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i${t(o)}`),a&&(r+=``);const u=Object.keys(s);if(u.length>0){r+="";for(const e of u){let i=s[e];void 0!==i&&(we(i)&&(i=U2(i,n)),r+=``)}r+="
${t(e)}:${t(i)}
"}return r||"{}"}return t(e)}};class H2{constructor(e){this.options=Object.assign(Object.assign({},W2),e);const t=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const e=document.createElement("style");e.setAttribute("id",this.options.styleId),e.innerHTML=function(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return"#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black;\n}\n#vg-tooltip-element.visible {\n visibility: visible;\n}\n#vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px;\n}\n#vg-tooltip-element img {\n max-width: 200px;\n max-height: 200px;\n}\n#vg-tooltip-element table {\n border-spacing: 0;\n}\n#vg-tooltip-element table tr {\n border: none;\n}\n#vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px;\n}\n#vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px;\n}\n#vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left;\n}\n#vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white;\n}\n#vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf;\n}\n".toString().replace(q2,e)}(t);const n=document.head;n.childNodes.length>0?n.insertBefore(e,n.childNodes[0]):n.appendChild(e)}}tooltipHandler(e,t,n,r){var i;if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(null!==(i=document.fullscreenElement)&&void 0!==i?i:document.body).appendChild(this.el)),null==r||""===r)return void this.el.classList.remove("visible",`${this.options.theme}-theme`);this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:o,y:a}=function(e,t,n,r){let i=e.clientX+n;i+t.width>window.innerWidth&&(i=+e.clientX-n-t.width);let o=e.clientY+r;return o+t.height>window.innerHeight&&(o=+e.clientY-r-t.height),{x:i,y:o}}(t,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${a}px`,this.el.style.left=`${o}px`}}function G2(e){return G2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},G2(e)}function V2(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==G2(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==G2(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===G2(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y2(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function X2(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Y2(o,r,i,a,s,"next",e)}function s(e){Y2(o,r,i,a,s,"throw",e)}a(void 0)}))}}var Z2,J2=Object.prototype,K2=J2.hasOwnProperty,Q2="function"==typeof Symbol?Symbol:{},e3=Q2.iterator||"@@iterator",t3=Q2.asyncIterator||"@@asyncIterator",n3=Q2.toStringTag||"@@toStringTag";function r3(e,t,n,r){var i=t&&t.prototype instanceof c3?t:c3,o=Object.create(i.prototype),a=new k3(r||[]);return o._invoke=function(e,t,n){var r=o3;return function(i,o){if(r===s3)throw new Error("Generator is already running");if(r===u3){if("throw"===i)throw o;return E3()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=x3(a,n);if(s){if(s===l3)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===o3)throw r=u3,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=s3;var u=i3(e,t,n);if("normal"===u.type){if(r=n.done?u3:a3,u.arg===l3)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=u3,n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function i3(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}var o3="suspendedStart",a3="suspendedYield",s3="executing",u3="completed",l3={};function c3(){}function f3(){}function d3(){}var h3={};h3[e3]=function(){return this};var p3=Object.getPrototypeOf,g3=p3&&p3(p3(A3([])));g3&&g3!==J2&&K2.call(g3,e3)&&(h3=g3);var m3=d3.prototype=c3.prototype=Object.create(h3);function y3(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function v3(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f3||"GeneratorFunction"===(t.displayName||t.name))}function b3(e,t){function n(r,i,o,a){var s=i3(e[r],e,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&K2.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,o,a)}),(function(e){n("throw",e,o,a)})):t.resolve(l).then((function(e){u.value=e,o(u)}),(function(e){return n("throw",e,o,a)}))}a(s.arg)}var r;this._invoke=function(e,i){function o(){return new t((function(t,r){n(e,i,t,r)}))}return r=r?r.then(o,o):o()}}function x3(e,t){var n=e.iterator[t.method];if(n===Z2){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=Z2,x3(e,t),"throw"===t.method))return l3;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l3}var r=i3(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l3;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=Z2),t.delegate=null,l3):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l3)}function _3(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w3(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k3(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_3,this),this.reset(!0)}function A3(e){if(e){var t=e[e3];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=K2.call(i,"catchLoc"),s=K2.call(i,"finallyLoc");if(a&&s){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&K2.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w3(n),l3}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;w3(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:A3(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=Z2),l3}};var O3,D3,S3={wrap:r3,isGeneratorFunction:v3,AsyncIterator:b3,mark:function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d3):(e.__proto__=d3,n3 in e||(e[n3]="GeneratorFunction")),e.prototype=Object.create(m3),e},awrap:function(e){return{__await:e}},async:function(e,t,n,r,i){void 0===i&&(i=Promise);var o=new b3(r3(e,t,n,r),i);return v3(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},keys:function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},values:A3},C3=F3;function F3(e){var t=this;if(t instanceof F3||(t=new F3),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},F3.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},F3.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},F3.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},F3.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new F3;if(tthis.length&&(t=this.length);for(var r=0,i=this.head;null!==i&&rthis.length&&(t=this.length);for(var r=this.length,i=this.tail;null!==i&&r>t;r--)i=i.prev;for(;null!==i&&r>e;r--,i=i.prev)n.push(i.value);return n},F3.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,r=this.head;null!==r&&n1,V3=(e,t,n)=>{var r=e[W3].get(t);if(r){var i=r.value;if(Y3(e,i)){if(Z3(e,r),!e[P3])return}else n&&(e[H3]&&(r.value.now=Date.now()),e[q3].unshiftNode(r));return i.value}},Y3=(e,t)=>{if(!t||!t.maxAge&&!e[L3])return!1;var n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[L3]&&n>e[L3]},X3=e=>{if(e[z3]>e[T3])for(var t=e[q3].tail;e[z3]>e[T3]&&null!==t;){var n=t.prev;Z3(e,t),t=n}},Z3=(e,t)=>{if(t){var n=t.value;e[I3]&&e[I3](n.key,n.value),e[z3]-=n.length,e[W3].delete(n.key),e[q3].removeNode(t)}};class J3{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}var K3=(e,t,n,r)=>{var i=n.value;Y3(e,i)&&(Z3(e,n),e[P3]||(i=void 0)),i&&t.call(r,i.value,i.key,e)},Q3=["includePrerelease","loose","rtl"],e5=e=>e?"object"!=typeof e?{loose:!0}:Q3.filter((t=>e[t])).reduce(((e,t)=>(e[t]=!0,e)),{}):{},t5={},n5={get exports(){return t5},set exports(e){t5=e}},r5={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16},i5="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){for(var e=arguments.length,t=new Array(e),n=0;n{};!function(e,t){var n=r5.MAX_SAFE_COMPONENT_LENGTH,r=i5,i=(t=e.exports={}).re=[],o=t.src=[],a=t.t={},s=0,u=(e,t,n)=>{var u=s++;r(e,u,t),a[e]=u,o[u]=t,i[u]=new RegExp(t,n?"g":void 0)};u("NUMERICIDENTIFIER","0|[1-9]\\d*"),u("NUMERICIDENTIFIERLOOSE","[0-9]+"),u("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),u("MAINVERSION","(".concat(o[a.NUMERICIDENTIFIER],")\\.")+"(".concat(o[a.NUMERICIDENTIFIER],")\\.")+"(".concat(o[a.NUMERICIDENTIFIER],")")),u("MAINVERSIONLOOSE","(".concat(o[a.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(o[a.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(o[a.NUMERICIDENTIFIERLOOSE],")")),u("PRERELEASEIDENTIFIER","(?:".concat(o[a.NUMERICIDENTIFIER],"|").concat(o[a.NONNUMERICIDENTIFIER],")")),u("PRERELEASEIDENTIFIERLOOSE","(?:".concat(o[a.NUMERICIDENTIFIERLOOSE],"|").concat(o[a.NONNUMERICIDENTIFIER],")")),u("PRERELEASE","(?:-(".concat(o[a.PRERELEASEIDENTIFIER],"(?:\\.").concat(o[a.PRERELEASEIDENTIFIER],")*))")),u("PRERELEASELOOSE","(?:-?(".concat(o[a.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(o[a.PRERELEASEIDENTIFIERLOOSE],")*))")),u("BUILDIDENTIFIER","[0-9A-Za-z-]+"),u("BUILD","(?:\\+(".concat(o[a.BUILDIDENTIFIER],"(?:\\.").concat(o[a.BUILDIDENTIFIER],")*))")),u("FULLPLAIN","v?".concat(o[a.MAINVERSION]).concat(o[a.PRERELEASE],"?").concat(o[a.BUILD],"?")),u("FULL","^".concat(o[a.FULLPLAIN],"$")),u("LOOSEPLAIN","[v=\\s]*".concat(o[a.MAINVERSIONLOOSE]).concat(o[a.PRERELEASELOOSE],"?").concat(o[a.BUILD],"?")),u("LOOSE","^".concat(o[a.LOOSEPLAIN],"$")),u("GTLT","((?:<|>)?=?)"),u("XRANGEIDENTIFIERLOOSE","".concat(o[a.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),u("XRANGEIDENTIFIER","".concat(o[a.NUMERICIDENTIFIER],"|x|X|\\*")),u("XRANGEPLAIN","[v=\\s]*(".concat(o[a.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(o[a.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(o[a.XRANGEIDENTIFIER],")")+"(?:".concat(o[a.PRERELEASE],")?").concat(o[a.BUILD],"?")+")?)?"),u("XRANGEPLAINLOOSE","[v=\\s]*(".concat(o[a.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(o[a.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(o[a.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(o[a.PRERELEASELOOSE],")?").concat(o[a.BUILD],"?")+")?)?"),u("XRANGE","^".concat(o[a.GTLT],"\\s*").concat(o[a.XRANGEPLAIN],"$")),u("XRANGELOOSE","^".concat(o[a.GTLT],"\\s*").concat(o[a.XRANGEPLAINLOOSE],"$")),u("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:$|[^\\d])"),u("COERCERTL",o[a.COERCE],!0),u("LONETILDE","(?:~>?)"),u("TILDETRIM","(\\s*)".concat(o[a.LONETILDE],"\\s+"),!0),t.tildeTrimReplace="$1~",u("TILDE","^".concat(o[a.LONETILDE]).concat(o[a.XRANGEPLAIN],"$")),u("TILDELOOSE","^".concat(o[a.LONETILDE]).concat(o[a.XRANGEPLAINLOOSE],"$")),u("LONECARET","(?:\\^)"),u("CARETTRIM","(\\s*)".concat(o[a.LONECARET],"\\s+"),!0),t.caretTrimReplace="$1^",u("CARET","^".concat(o[a.LONECARET]).concat(o[a.XRANGEPLAIN],"$")),u("CARETLOOSE","^".concat(o[a.LONECARET]).concat(o[a.XRANGEPLAINLOOSE],"$")),u("COMPARATORLOOSE","^".concat(o[a.GTLT],"\\s*(").concat(o[a.LOOSEPLAIN],")$|^$")),u("COMPARATOR","^".concat(o[a.GTLT],"\\s*(").concat(o[a.FULLPLAIN],")$|^$")),u("COMPARATORTRIM","(\\s*)".concat(o[a.GTLT],"\\s*(").concat(o[a.LOOSEPLAIN],"|").concat(o[a.XRANGEPLAIN],")"),!0),t.comparatorTrimReplace="$1$2$3",u("HYPHENRANGE","^\\s*(".concat(o[a.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(o[a.XRANGEPLAIN],")")+"\\s*$"),u("HYPHENRANGELOOSE","^\\s*(".concat(o[a.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(o[a.XRANGEPLAINLOOSE],")")+"\\s*$"),u("STAR","(<|>)?=?\\s*\\*"),u("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),u("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(n5,t5);var o5,a5,s5,u5,l5=/^[0-9]+$/,c5=(e,t)=>{var n=l5.test(e),r=l5.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:ed5)throw new TypeError("version is longer than ".concat(d5," characters"));f5("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var r=t.trim().match(n.loose?p5[g5.LOOSE]:p5[g5.FULL]);if(!r)throw new TypeError("Invalid Version: ".concat(t));if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>h5||this.major<0)throw new TypeError("Invalid major version");if(this.minor>h5||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>h5||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(0===y5(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: ".concat(e))}return this.format(),this.raw=this.version,this}},b5=v5,x5=(e,t,n)=>new b5(e,n).compare(new b5(t,n)),_5=x5,w5=x5,k5=x5,A5=x5,E5=x5,O5=x5,D5=(e,t,n)=>0===_5(e,t,n),S5=(e,t,n)=>0!==w5(e,t,n),C5=(e,t,n)=>k5(e,t,n)>0,F5=(e,t,n)=>A5(e,t,n)>=0,j5=(e,t,n)=>E5(e,t,n)<0,M5=(e,t,n)=>O5(e,t,n)<=0,$5=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return D5(e,n,r);case"!=":return S5(e,n,r);case">":return C5(e,n,r);case">=":return F5(e,n,r);case"<":return j5(e,n,r);case"<=":return M5(e,n,r);default:throw new TypeError("Invalid operator: ".concat(t))}};function N5(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return B5(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?B5(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function B5(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nthis.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(e));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((e=>!d(e[0]))),0===this.set.length)this.set=[o];else if(this.set.length>1){var a,s=N5(this.set);try{for(s.s();!(a=s.n()).done;){var u=a.value;if(1===u.length&&h(u[0])){this.set=[u];break}}}catch(e){s.e(e)}finally{s.f()}}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();var t=Object.keys(this.options).join(","),r="parseRange:".concat(t,":").concat(e),a=n.get(r);if(a)return a;var h=this.options.loose,p=h?s[u.HYPHENRANGELOOSE]:s[u.HYPHENRANGE];e=e.replace(p,E(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(s[u.COMPARATORTRIM],l),o("comparator trim",e);var m=(e=(e=(e=e.replace(s[u.TILDETRIM],c)).replace(s[u.CARETTRIM],f)).split(/\s+/).join(" ")).split(" ").map((e=>g(e,this.options))).join(" ").split(/\s+/).map((e=>A(e,this.options)));h&&(m=m.filter((e=>(o("loose invalid filter",e,this.options),!!e.match(s[u.COMPARATORLOOSE]))))),o("range list",m);var y,v=new Map,b=m.map((e=>new i(e,this.options))),x=N5(b);try{for(x.s();!(y=x.n()).done;){var _=y.value;if(d(_))return[_];v.set(_.value,_)}}catch(e){x.e(e)}finally{x.f()}v.size>1&&v.has("")&&v.delete("");var w=[...v.values()];return n.set(r,w),w}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((t=>p(t,n)&&e.set.some((e=>p(e,n)&&t.every((t=>e.every((e=>t.intersects(e,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new a(e,this.options)}catch(e){return!1}for(var t=0;t{e.length=this[R3](e.value,e.key),this[z3]+=e.length}))),X3(this)}get lengthCalculator(){return this[R3]}get length(){return this[z3]}get itemCount(){return this[q3].length}rforEach(e,t){t=t||this;for(var n=this[q3].tail;null!==n;){var r=n.prev;K3(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(var n=this[q3].head;null!==n;){var r=n.next;K3(this,e,n,t),n=r}}keys(){return this[q3].toArray().map((e=>e.key))}values(){return this[q3].toArray().map((e=>e.value))}reset(){this[I3]&&this[q3]&&this[q3].length&&this[q3].forEach((e=>this[I3](e.key,e.value))),this[W3]=new Map,this[q3]=new B3,this[z3]=0}dump(){return this[q3].map((e=>!Y3(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[q3]}set(e,t,n){if((n=n||this[L3])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");var r=n?Date.now():0,i=this[R3](t,e);if(this[W3].has(e)){if(i>this[T3])return Z3(this,this[W3].get(e)),!1;var o=this[W3].get(e).value;return this[I3]&&(this[U3]||this[I3](e,o.value)),o.now=r,o.maxAge=n,o.value=t,this[z3]+=i-o.length,o.length=i,this.get(e),X3(this),!0}var a=new J3(e,t,i,r,n);return a.length>this[T3]?(this[I3]&&this[I3](e,t),!1):(this[z3]+=a.length,this[q3].unshift(a),this[W3].set(e,this[q3].head),X3(this),!0)}has(e){if(!this[W3].has(e))return!1;var t=this[W3].get(e).value;return!Y3(this,t)}get(e){return V3(this,e,!0)}peek(e){return V3(this,e,!1)}pop(){var e=this[q3].tail;return e?(Z3(this,e),e.value):null}del(e){Z3(this,this[W3].get(e))}load(e){this.reset();for(var t=Date.now(),n=e.length-1;n>=0;n--){var r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var o=i-t;o>0&&this.set(r.k,r.v,o)}}}prune(){this[W3].forEach(((e,t)=>V3(this,t,!1)))}}({max:1e3}),r=e5,i=function(){if(a5)return o5;a5=1;var t=Symbol("SemVer ANY");class n{static get ANY(){return t}constructor(e,i){if(i=r(i),e instanceof n){if(e.loose===!!i.loose)return e;e=e.value}s("comparator",e,i),this.options=i,this.loose=!!i.loose,this.parse(e),this.semver===t?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(e){var n=this.options.loose?i[o.COMPARATORLOOSE]:i[o.COMPARATOR],r=e.match(n);if(!r)throw new TypeError("Invalid comparator: ".concat(e));this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=t}toString(){return this.value}test(e){if(s("Comparator.test",e,this.options.loose),this.semver===t||e===t)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return a(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new l(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new l(this.value,t).test(e.semver);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),u=a(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=a(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||i||o&&s||u||c}}o5=n;var r=e5,i=t5.re,o=t5.t,a=$5,s=i5,u=v5,l=e();return o5}(),o=i5,a=v5,s=t5.re,u=t5.t,l=t5.comparatorTrimReplace,c=t5.tildeTrimReplace,f=t5.caretTrimReplace,d=e=>"<0.0.0-0"===e.value,h=e=>""===e.value,p=(e,t)=>{for(var n=!0,r=e.slice(),i=r.pop();n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},g=(e,t)=>(o("comp",e,t),e=b(e,t),o("caret",e),e=y(e,t),o("tildes",e),e=_(e,t),o("xrange",e),e=k(e,t),o("stars",e),e),m=e=>!e||"x"===e.toLowerCase()||"*"===e,y=(e,t)=>e.trim().split(/\s+/).map((e=>v(e,t))).join(" "),v=(e,t)=>{var n=t.loose?s[u.TILDELOOSE]:s[u.TILDE];return e.replace(n,((t,n,r,i,a)=>{var s;return o("tilde",e,t,n,r,i,a),m(n)?s="":m(r)?s=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):m(i)?s=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):a?(o("replaceTilde pr",a),s=">=".concat(n,".").concat(r,".").concat(i,"-").concat(a," <").concat(n,".").concat(+r+1,".0-0")):s=">=".concat(n,".").concat(r,".").concat(i," <").concat(n,".").concat(+r+1,".0-0"),o("tilde return",s),s}))},b=(e,t)=>e.trim().split(/\s+/).map((e=>x(e,t))).join(" "),x=(e,t)=>{o("caret",e,t);var n=t.loose?s[u.CARETLOOSE]:s[u.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,a,s)=>{var u;return o("caret",e,t,n,i,a,s),m(n)?u="":m(i)?u=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):m(a)?u="0"===n?">=".concat(n,".").concat(i,".0").concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".0").concat(r," <").concat(+n+1,".0.0-0"):s?(o("replaceCaret pr",s),u="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(a,"-").concat(s," <").concat(n,".").concat(i,".").concat(+a+1,"-0"):">=".concat(n,".").concat(i,".").concat(a,"-").concat(s," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(a,"-").concat(s," <").concat(+n+1,".0.0-0")):(o("no pr"),u="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(a).concat(r," <").concat(n,".").concat(i,".").concat(+a+1,"-0"):">=".concat(n,".").concat(i,".").concat(a).concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(a," <").concat(+n+1,".0.0-0")),o("caret return",u),u}))},_=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>w(e,t))).join(" ")),w=(e,t)=>{e=e.trim();var n=t.loose?s[u.XRANGELOOSE]:s[u.XRANGE];return e.replace(n,((n,r,i,a,s,u)=>{o("xRange",e,n,r,i,a,s,u);var l=m(i),c=l||m(a),f=c||m(s),d=f;return"="===r&&d&&(r=""),u=t.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(c&&(a=0),s=0,">"===r?(r=">=",c?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):"<="===r&&(r="<",c?i=+i+1:a=+a+1),"<"===r&&(u="-0"),n="".concat(r+i,".").concat(a,".").concat(s).concat(u)):c?n=">=".concat(i,".0.0").concat(u," <").concat(+i+1,".0.0-0"):f&&(n=">=".concat(i,".").concat(a,".0").concat(u," <").concat(i,".").concat(+a+1,".0-0")),o("xRange return",n),n}))},k=(e,t)=>(o("replaceStars",e,t),e.trim().replace(s[u.STAR],"")),A=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(s[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),E=e=>(t,n,r,i,o,a,s,u,l,c,f,d,h)=>(n=m(r)?"":m(i)?">=".concat(r,".0.0").concat(e?"-0":""):m(o)?">=".concat(r,".").concat(i,".0").concat(e?"-0":""):a?">=".concat(n):">=".concat(n).concat(e?"-0":""),u=m(l)?"":m(c)?"<".concat(+l+1,".0.0-0"):m(f)?"<".concat(l,".").concat(+c+1,".0-0"):d?"<=".concat(l,".").concat(c,".").concat(f,"-").concat(d):e?"<".concat(l,".").concat(c,".").concat(+f+1,"-0"):"<=".concat(u),"".concat(n," ").concat(u).trim()),O=(e,t,n)=>{for(var r=0;r0){var s=e[a].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0};return s5}(),z5=(e,t,n)=>{try{t=new T5(t,n)}catch(e){return!1}return t.test(e)};function R5(e,t,n){var r=e.open(t),i=new URL(t).origin,o=40;e.addEventListener("message",(function t(n){n.source===r&&(o=0,e.removeEventListener("message",t,!1))}),!1),setTimeout((function e(){o<=0||(r.postMessage(n,i),setTimeout(e,250),o-=1)}),250)}var P5,L5='.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box;\n}\n.vega-embed.has-actions {\n padding-right: 38px;\n}\n.vega-embed details:not([open]) > :not(summary) {\n display: none !important;\n}\n.vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n cursor: pointer;\n line-height: 0px;\n}\n.vega-embed summary::-webkit-details-marker {\n display: none;\n}\n.vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset;\n}\n.vega-embed summary svg {\n width: 14px;\n height: 14px;\n}\n.vega-embed details[open] summary {\n opacity: 0.7;\n}\n.vega-embed:hover summary, .vega-embed:focus-within summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease;\n}\n.vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left;\n}\n.vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none;\n}\n.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {\n background-color: #f7f7f9;\n color: black;\n}\n.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute;\n}\n.vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid rgba(0, 0, 0, 0);\n border-bottom-color: #d9d9d9;\n}\n.vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid rgba(0, 0, 0, 0);\n border-bottom-color: #fff;\n}\n.vega-embed .chart-wrapper.fit-x {\n width: 100%;\n}\n.vega-embed .chart-wrapper.fit-y {\n height: 100%;\n}\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: auto;\n padding-right: 14px;\n}\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n';function I5(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function W5(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne,"vega-lite":(e,t)=>X5.compile(e,{config:t}).spec},n6='\n\n \n \n \n',r6="chart-wrapper";function i6(e,t,n,r){var i="".concat(t,'
'),o="
".concat(n,""),a=window.open("");a.document.write(i+e+o),a.document.title="".concat(Q5[r]," JSON Source")}function o6(e,t){if(e.$schema){var n,r=Y1(e.$schema);t&&t!==r.library&&console.warn("The given visualization spec is written in ".concat(Q5[r.library],", but mode argument sets ").concat(null!==(n=Q5[t])&&void 0!==n?n:t,"."));var i=r.library;return z5(e6[i],"^".concat(r.version.slice(1)))||console.warn("The input spec uses ".concat(Q5[i]," ").concat(r.version,", but the current version of ").concat(Q5[i]," is v").concat(e6[i],".")),i}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":null!=t?t:"vega"}function a6(e){return(t=e)&&"load"in t?e:Y5.loader(e);var t}function s6(e){var t,n,r=null!==(t=null===(n=e.usermeta)||void 0===n?void 0:n.embedOptions)&&void 0!==t?t:{};return vt(r.defaultStyle)&&(r.defaultStyle=!1),r}function u6(e,t){return l6.apply(this,arguments)}function l6(){return l6=X2(S3.mark((function e(t,n){var r,i,o,a,s,u,l,c,f,d,h,p=arguments;return S3.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=p.length>2&&void 0!==p[2]?p[2]:{},!vt(n)){e.next=10;break}return s=a6(o.loader),e.t0=JSON,e.next=6,s.load(n);case 6:e.t1=e.sent,a=e.t0.parse.call(e.t0,e.t1),e.next=11;break;case 10:a=n;case 11:return u=s6(a),l=u.loader,s&&!l||(s=a6(null!==(c=o.loader)&&void 0!==c?c:l)),e.next=16,c6(u,s);case 16:return f=e.sent,e.next=19,c6(o,s);case 19:return d=e.sent,h=G5(G5({},I5(d,f)),{},{config:Ae(null!==(r=d.config)&&void 0!==r?r:{},null!==(i=f.config)&&void 0!==i?i:{})}),e.next=23,h6(t,a,h,s);case 23:return e.abrupt("return",e.sent);case 24:case"end":return e.stop()}}),e)}))),l6.apply(this,arguments)}function c6(e,t){return f6.apply(this,arguments)}function f6(){return f6=X2(S3.mark((function e(t,n){var r,i,o;return S3.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!vt(t.config)){e.next=8;break}return e.t1=JSON,e.next=4,n.load(t.config);case 4:e.t2=e.sent,e.t0=e.t1.parse.call(e.t1,e.t2),e.next=9;break;case 8:e.t0=null!==(r=t.config)&&void 0!==r?r:{};case 9:if(i=e.t0,!vt(t.patch)){e.next=18;break}return e.t4=JSON,e.next=14,n.load(t.patch);case 14:e.t5=e.sent,e.t3=e.t4.parse.call(e.t4,e.t5),e.next=19;break;case 18:e.t3=t.patch;case 19:return o=e.t3,e.abrupt("return",G5(G5(G5({},t),o?{patch:o}:{}),i?{config:i}:{}));case 21:case"end":return e.stop()}}),e)}))),f6.apply(this,arguments)}function d6(e){var t,n=e.getRootNode?e.getRootNode():document;return n instanceof ShadowRoot?{root:n,rootContainer:n}:{root:document,rootContainer:null!==(t=document.head)&&void 0!==t?t:document.body}}function h6(e,t){return p6.apply(this,arguments)}function p6(){return p6=X2(S3.mark((function e(t,n){var r,i,o,a,s,u,l,c,f,d,h,p,g,m,y,v,x,_,w,k,A,E,O,D,S,C,F,j,M,$,N,B,T,z,P,L,I,U,q,W,H,G,V,Y,X,Z,J,Q,ee,te,ne,re=arguments;return S3.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ne=function(){U&&document.removeEventListener("click",U),B.finalize()},f=re.length>3?re[3]:void 0,d=(c=re.length>2&&void 0!==re[2]?re[2]:{}).theme?Ae(b[c.theme],null!==(r=c.config)&&void 0!==r?r:{}):c.config,h=ht(c.actions)?c.actions:I5({},J5,null!==(i=c.actions)&&void 0!==i?i:{}),p=G5(G5({},K5),c.i18n),g=null!==(o=c.renderer)&&void 0!==o?o:"canvas",m=null!==(a=c.logLevel)&&void 0!==a?a:Y5.Warn,y=null!==(s=c.downloadFileName)&&void 0!==s?s:"visualization",v="string"==typeof t?document.querySelector(t):t){e.next=12;break}throw new Error("".concat(t," does not exist"));case 12:if(!1!==c.defaultStyle&&(x="vega-embed-style",_=d6(v),w=_.root,k=_.rootContainer,w.getElementById(x)||((A=document.createElement("style")).id=x,A.innerHTML=void 0===c.defaultStyle||!0===c.defaultStyle?L5.toString():c.defaultStyle,k.appendChild(A))),E=o6(n,c.mode),O=t6[E](n,d),"vega-lite"===E&&O.$schema&&(D=Y1(O.$schema),z5(e6.vega,"^".concat(D.version.slice(1)))||console.warn("The compiled spec uses Vega ".concat(D.version,", but current version is v").concat(e6.vega,"."))),v.classList.add("vega-embed"),h&&v.classList.add("has-actions"),v.innerHTML="",S=v,h&&((C=document.createElement("div")).classList.add(r6),v.appendChild(C),S=C),(F=c.patch)&&(O=F instanceof Function?F(O):R(O,F,!0,!1).newDocument),c.formatLocale&&Y5.formatLocale(c.formatLocale),c.timeFormatLocale&&Y5.timeFormatLocale(c.timeFormatLocale),c.expressionFunctions)for(j in c.expressionFunctions)"fn"in(M=c.expressionFunctions[j])?Y5.expressionFunction(j,M.fn,M.visitor):M instanceof Function&&Y5.expressionFunction(j,M);return $=c.ast,N=Y5.parse(O,"vega-lite"===E?{}:d,{ast:$}),(B=new(c.viewClass||Y5.View)(N,G5({loader:f,logLevel:m,renderer:g},$?{expr:null!==(u=null!==(l=Y5.expressionInterpreter)&&void 0!==l?l:c.expr)&&void 0!==u?u:iP}:{}))).addSignalListener("autosize",((e,t)=>{var n=t.type;"fit-x"==n?(S.classList.add("fit-x"),S.classList.remove("fit-y")):"fit-y"==n?(S.classList.remove("fit-x"),S.classList.add("fit-y")):"fit"==n?S.classList.add("fit-x","fit-y"):S.classList.remove("fit-x","fit-y")})),!1!==c.tooltip&&(ie=c.tooltip,T="function"==typeof ie?c.tooltip:new H2(!0===c.tooltip?{}:c.tooltip).call,B.tooltip(T)),void 0===(z=c.hover)&&(z="vega"===E),z&&(L=(P="boolean"==typeof z?{}:z).hoverSet,I=P.updateSet,B.hover(L,I)),c&&(null!=c.width&&B.width(c.width),null!=c.height&&B.height(c.height),null!=c.padding&&B.padding(c.padding)),e.next=37,B.initialize(S,c.bind).runAsync();case 37:if(!1===h){e.next=63;break}if(q=v,!1!==c.defaultStyle&&((W=document.createElement("details")).title=p.CLICK_TO_VIEW_ACTIONS,v.append(W),q=W,(H=document.createElement("summary")).innerHTML=n6,W.append(H),U=e=>{W.contains(e.target)||W.removeAttribute("open")},document.addEventListener("click",U)),G=document.createElement("div"),q.append(G),G.classList.add("vega-actions"),!0!==h&&!1===h.export){e.next=60;break}V=q5(["svg","png"]),e.prev=45,X=S3.mark((function e(){var t,n,r,i;return S3.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=Y.value,(!0===h||!0===h.export||h.export[t])&&(n=p["".concat(t.toUpperCase(),"_ACTION")],r=document.createElement("a"),i=we(c.scaleFactor)?c.scaleFactor[t]:c.scaleFactor,r.text=n,r.href="#",r.target="_blank",r.download="".concat(y,".").concat(t),r.addEventListener("mousedown",function(){var e=X2(S3.mark((function e(n){var r;return S3.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.preventDefault(),e.next=3,B.toImageURL(t,i);case 3:r=e.sent,this.href=r;case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()),G.append(r));case 2:case"end":return e.stop()}}),e)})),V.s();case 48:if((Y=V.n()).done){e.next=52;break}return e.delegateYield(X(),"t0",50);case 50:e.next=48;break;case 52:e.next=57;break;case 54:e.prev=54,e.t1=e.catch(45),V.e(e.t1);case 57:return e.prev=57,V.f(),e.finish(57);case 60:!0!==h&&!1===h.source||((Z=document.createElement("a")).text=p.SOURCE_ACTION,Z.href="#",Z.addEventListener("click",(function(e){var t,r;i6(K()(n),null!==(t=c.sourceHeader)&&void 0!==t?t:"",null!==(r=c.sourceFooter)&&void 0!==r?r:"",E),e.preventDefault()})),G.append(Z)),"vega-lite"!==E||!0!==h&&!1===h.compiled||((J=document.createElement("a")).text=p.COMPILED_ACTION,J.href="#",J.addEventListener("click",(function(e){var t,n;i6(K()(O),null!==(t=c.sourceHeader)&&void 0!==t?t:"",null!==(n=c.sourceFooter)&&void 0!==n?n:"","vega"),e.preventDefault()})),G.append(J)),!0!==h&&!1===h.editor||(ee=null!==(Q=c.editorUrl)&&void 0!==Q?Q:"https://vega.github.io/editor/",(te=document.createElement("a")).text=p.EDITOR_ACTION,te.href="#",te.addEventListener("click",(function(e){R5(window,ee,{config:d,mode:E,renderer:g,spec:K()(n)}),e.preventDefault()})),G.append(te));case 63:return e.abrupt("return",{view:B,spec:n,vgSpec:O,finalize:ne,embedOptions:c});case 64:case"end":return e.stop()}var ie}),e,null,[[45,54,57,60]])}))),p6.apply(this,arguments)}},146:t=>{"use strict";t.exports=e},801:e=>{"use strict";var t=/("(?:[^\\"]|\\.)*")|[:,]/g;e.exports=function(e,n){var r,i,o;return n=n||{},r=JSON.stringify([1],void 0,void 0===n.indent?2:n.indent).slice(2,-3),i=""===r?1/0:void 0===n.maxLength?80:n.maxLength,o=n.replacer,function e(n,a,s){var u,l,c,f,d,h,p,g,m,y,v,b;if(n&&"function"==typeof n.toJSON&&(n=n.toJSON()),void 0===(v=JSON.stringify(n,o)))return v;if(p=i-a.length-s,v.length<=p&&(m=v.replace(t,(function(e,t){return t||e+" "}))).length<=p)return m;if(null!=o&&(n=JSON.parse(v),o=void 0),"object"==typeof n&&null!==n){if(g=a+r,c=[],l=0,Array.isArray(n))for(y="[",u="]",p=n.length;l0)return[y,r+c.join(",\n"+g),u].join("\n"+a)}return v}(e,"",0)}},485:e=>{"use strict";e.exports={version:"0.3.0"}},147:e=>{"use strict";e.exports=JSON.parse('{"name":"jupyter-vega","version":"4.0.0","description":"IPython/Jupyter notebook module for [Vega](https://vega.github.io/vega), and [Vega-Lite](https://vega.github.io/vega-lite).","repository":{"type":"git","url":"git+https://github.com/vega/ipyvega.git"},"author":"","license":"BSD-3-Clause","bugs":{"url":"https://github.com/vega/ipyvega/issues"},"homepage":"https://github.com/vega/ipyvega#readme","scripts":{"format":"prettier --write \'src/*.ts\'","lint":"prettier --check \'src/*.ts\'","build":"webpack --mode production","watch":"webpack --mode development --watch"},"dependencies":{"jupyter-tablewidgets":"^0.3.0","vega":"5.24.0","vega-lite":"4.17.0","vega-embed":"^6.21.3","@jupyter-widgets/base":"6.0.4","@types/webpack-env":"*"},"devDependencies":{"@types/webpack-env":"*","@types/ndarray":"^1.0.11","filemanager-webpack-plugin":"^8.0.0","prettier":"^2.8.7","ts-loader":"^9.4.2","typescript":"^5.0.4","webpack":"^5.78.0","webpack-cli":"^5.0.1"},"files":["dist","src","package.json","tsconfig.json","webpack.config.js","yarn.lock","vega/static/"],"jupyterlab":{"extension":"vega/static/labplugin","sharedPackages":{"@jupyter-widgets/base":{"bundled":false,"singleton":true}}}}')}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var o=n[e]={exports:{}};return t[e].call(o.exports,o,o.exports,r),o.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(607)})())); +define(["@jupyter-widgets/base"],(e=>(()=>{var t={779:e=>{var t=function(){"use strict";function e(e,t){return null!=t&&e instanceof t}var t,n,r;try{t=Map}catch(e){t=function(){}}try{n=Set}catch(e){n=function(){}}try{r=Promise}catch(e){r=function(){}}function i(o,s,u,l,c){"object"==typeof s&&(u=s.depth,l=s.prototype,c=s.includeNonEnumerable,s=s.circular);var f=[],d=[],h="undefined"!=typeof Buffer;return void 0===s&&(s=!0),void 0===u&&(u=1/0),function o(u,p){if(null===u)return null;if(0===p)return u;var g,m;if("object"!=typeof u)return u;if(e(u,t))g=new t;else if(e(u,n))g=new n;else if(e(u,r))g=new r((function(e,t){u.then((function(t){e(o(t,p-1))}),(function(e){t(o(e,p-1))}))}));else if(i.__isArray(u))g=[];else if(i.__isRegExp(u))g=new RegExp(u.source,a(u)),u.lastIndex&&(g.lastIndex=u.lastIndex);else if(i.__isDate(u))g=new Date(u.getTime());else{if(h&&Buffer.isBuffer(u))return g=Buffer.allocUnsafe?Buffer.allocUnsafe(u.length):new Buffer(u.length),u.copy(g),g;e(u,Error)?g=Object.create(u):void 0===l?(m=Object.getPrototypeOf(u),g=Object.create(m)):(g=Object.create(l),m=l)}if(s){var y=f.indexOf(u);if(-1!=y)return d[y];f.push(u),d.push(g)}for(var v in e(u,t)&&u.forEach((function(e,t){var n=o(t,p-1),r=o(e,p-1);g.set(n,r)})),e(u,n)&&u.forEach((function(e){var t=o(e,p-1);g.add(t)})),u){var b;m&&(b=Object.getOwnPropertyDescriptor(m,v)),b&&null==b.set||(g[v]=o(u[v],p-1))}if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(u);for(v=0;v{"use strict";var r=n(644);function i(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}e.exports=function(e){var t=new i;t.pre=e.pre,t.body=e.body,t.post=e.post;var n=e.args.slice(0);t.argTypes=n;for(var o=0;o0)throw new Error("cwise: pre() block may not reference array args");if(o0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===a)t.scalarArgs.push(o),t.shimArgs.push("scalar"+o);else if("index"===a){if(t.indexArgs.push(o),o0)throw new Error("cwise: pre() block may not reference array index");if(o0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===a){if(t.shapeArgs.push(o),on.length)throw new Error("cwise: Too many arguments in pre() block");if(t.body.args.length>n.length)throw new Error("cwise: Too many arguments in body() block");if(t.post.args.length>n.length)throw new Error("cwise: Too many arguments in post() block");return t.debug=!!e.printCode||!!e.debug,t.funcName=e.funcName||"cwise",t.blockSize=e.blockSize||64,r(t)}},121:(e,t,n)=>{"use strict";var r=n(887);function i(e,t,n){var r,i,o=e.length,a=t.arrayArgs.length,s=t.indexArgs.length>0,u=[],l=[],c=0,f=0;for(r=0;r0&&u.push("var "+l.join(",")),r=o-1;r>=0;--r)c=e[r],u.push(["for(i",r,"=0;i",r,"0&&u.push(["index[",f,"]-=s",f].join("")),u.push(["++index[",c,"]"].join(""))),u.push("}")}return u.join("\n")}function o(e,t,n){for(var r=e.body,i=[],o=[],a=0;a0&&(n=n&&t[r]===t[r-1])}return n?t[0]:t.join("")}e.exports=function(e,t){for(var n=t[1].length-Math.abs(e.arrayBlockIndices[0])|0,s=new Array(e.arrayArgs.length),u=new Array(e.arrayArgs.length),l=0;l0&&b.push("shape=SS.slice(0)"),e.indexArgs.length>0){var x=new Array(n);for(l=0;l0&&v.push("var "+b.join(",")),l=0;l3&&v.push(o(e.pre,e,u));var A=o(e.body,e,u),E=function(e){for(var t=0,n=e[0].length;t0,l=[],c=0;c0;){"].join("")),l.push(["if(j",c,"<",s,"){"].join("")),l.push(["s",t[c],"=j",c].join("")),l.push(["j",c,"=0"].join("")),l.push(["}else{s",t[c],"=",s].join("")),l.push(["j",c,"-=",s,"}"].join("")),u&&l.push(["index[",t[c],"]=j",c].join(""));for(c=0;c3&&v.push(o(e.post,e,u)),e.debug&&console.log("-----Generated cwise routine for ",t,":\n"+v.join("\n")+"\n----------");var O=[e.funcName||"unnamed","_cwise_loop_",s[0].join("s"),"m",E,a(u)].join("");return new Function(["function ",O,"(",y.join(","),"){",v.join("\n"),"} return ",O].join(""))()}},644:(e,t,n)=>{"use strict";var r=n(121);e.exports=function(e){var t=["'use strict'","var CACHED={}"],n=[],i=e.funcName+"_cwise_thunk";t.push(["return function ",i,"(",e.shimArgs.join(","),"){"].join(""));for(var o=[],a=[],s=[["array",e.arrayArgs[0],".shape.slice(",Math.max(0,e.arrayBlockIndices[0]),e.arrayBlockIndices[0]<0?","+e.arrayBlockIndices[0]+")":")"].join("")],u=[],l=[],c=0;c0&&(u.push("array"+e.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(e.arrayBlockIndices[0])-Math.abs(e.arrayBlockIndices[c]))),l.push("array"+e.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[c])+"]"))}for(e.arrayArgs.length>1&&(t.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),t.push("for(var shapeIndex=array"+e.arrayArgs[0]+".shape.length-"+Math.abs(e.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),t.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),t.push("}")),c=0;c{"use strict";var r=n(263),i=n(887),o=0;function a(e,t,n){this.name=e,this.lvalue=t,this.rvalue=n,this.count=0}function s(e,t,n,r){this.body=e,this.args=t,this.thisVars=n,this.localVars=r}e.exports=function(e){for(var t=["(",e,")()"].join(""),u=r.parse(t,{range:!0}),l="_inline_"+o+++"_",c=function(e){for(var t=e.body[0].expression.callee.params,n=new Array(t.length),r=0;r=0){var a=f[o],s=function(e){return"AssignmentExpression"===e.parent.type&&e.parent.left===e?"="===e.parent.operator?1:3:"UpdateExpression"===e.parent.type?3:2}(t);1&s&&(a.lvalue=!0),2&s&&(a.rvalue=!0),++a.count,v(t,a.name)}else(function(e){if("eval"===e)throw new Error("cwise-parser: eval() not allowed");return"undefined"!=typeof window?e in window:void 0!==n.g?e in n.g:"undefined"!=typeof self&&e in self})(i)||v(t,function(e){var t=l+e.replace(/\_/g,"__");return m.push(t),t}(i))}else if("Literal"===t.type)"string"==typeof t.value&&v(t,"'"+t.value.replace(/\_/g,"\\_").replace(/\'/g,"'")+"'");else{if("WithStatement"===t.type)throw new Error("cwise-parser: with() statements not allowed");for(var u=Object.keys(t),d=0,h=u.length;d{"use strict";var r=n(86),i=n(543),o=["args","body"],a=["pre","post","printCode","funcName","blockSize"];e.exports=function(e){for(var t in e)o.indexOf(t)<0&&a.indexOf(t)<0&&console.warn("cwise: Unknown argument '"+t+"' passed to expression compiler");for(var n=0;n{"use strict";function t(e,n,r){var i=0|e[r];if(i<=0)return[];var o,a=new Array(i);if(r===e.length-1)for(o=0;o0)return function(e,t){var n,r;for(n=new Array(e),r=0;r=48&&e<=57}function _(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function w(e){return"01234567".indexOf(e)>=0}function k(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function A(e){return 10===e||13===e||8232===e||8233===e}function E(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&s.NonAsciiIdentifierStart.test(String.fromCharCode(e))}function O(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&s.NonAsciiIdentifierPart.test(String.fromCharCode(e))}function D(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function C(e){return"eval"===e||"arguments"===e}function S(e){if(c&&D(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function F(e,t,n,r,i){var o;b("number"==typeof n,"Comment must have valid position"),y.lastCommentStart>=n||(y.lastCommentStart=n,o={type:e,value:t},v.range&&(o.range=[n,r]),v.loc&&(o.loc=i),v.comments.push(o),v.attachComment&&(v.leadingComments.push(o),v.trailingComments.push(o)))}function M(e){var t,n,r,i;for(t=f-e,n={start:{line:d,column:f-h-e}};f=p&&Y({},a.UnexpectedToken,"ILLEGAL");else if(42===n){if(47===l.charCodeAt(f+1))return++f,++f,void(v.comments&&(r=l.slice(e+2,f-2),t.end={line:d,column:f-h},F("Block",r,e,f,t)));++f}else++f;Y({},a.UnexpectedToken,"ILLEGAL")}function $(){var e,t;for(t=0===f;f>>="===(i=l.substr(f,4))?(f+=4,{type:t.Punctuator,value:i,lineNumber:d,lineStart:h,start:o,end:f}):">>>"===(r=i.substr(0,3))||"<<="===r||">>="===r?(f+=3,{type:t.Punctuator,value:r,lineNumber:d,lineStart:h,start:o,end:f}):u===(n=r.substr(0,2))[1]&&"+-<>&|".indexOf(u)>=0||"=>"===n?(f+=2,{type:t.Punctuator,value:n,lineNumber:d,lineStart:h,start:o,end:f}):"<>=!+-*%&|^/".indexOf(u)>=0?(++f,{type:t.Punctuator,value:u,lineNumber:d,lineStart:h,start:o,end:f}):void Y({},a.UnexpectedToken,"ILLEGAL")}function R(){var e,n,r;if(b(x((r=l[f]).charCodeAt(0))||"."===r,"Numeric literal must start with a decimal digit or a decimal point"),n=f,e="","."!==r){if(e=l[f++],r=l[f],"0"===e){if("x"===r||"X"===r)return++f,function(e){for(var n="";f0&&(r=v.tokens[v.tokens.length-1]).range[0]===e&&"Punctuator"===r.type&&("/"!==r.value&&"/="!==r.value||v.tokens.pop()),v.tokens.push({type:"RegularExpression",value:n.literal,range:[e,f],loc:t})),n}function I(){var e,n,i;return $(),f>=p?{type:t.EOF,lineNumber:d,lineStart:h,start:f,end:f}:E(e=l.charCodeAt(f))?(n=f,{type:1===(i=92===l.charCodeAt(f)?B():T()).length?t.Identifier:S(i)?t.Keyword:"null"===i?t.NullLiteral:"true"===i||"false"===i?t.BooleanLiteral:t.Identifier,value:i,lineNumber:d,lineStart:h,start:n,end:f}):40===e||41===e||59===e?z():39===e||34===e?function(){var e,n,r,i,o,s,u,c,g="",m=!1;for(u=d,c=h,b("'"===(e=l[f])||'"'===e,"String literal must starts with a quote"),n=f,++f;f=0&&f=0?z():L()}return L()}return"Keyword"===e.type&&"this"!==e.value?L():z()}():z()}function U(){var e,r,i;return $(),e={start:{line:d,column:f-h}},r=I(),e.end={line:d,column:f-h},r.type!==t.EOF&&(i=l.slice(r.start,r.end),v.tokens.push({type:n[r.type],value:i,range:[r.start,r.end],loc:e})),r}function q(){var e;return f=(e=m).end,d=e.lineNumber,h=e.lineStart,m=void 0!==v.tokens?U():I(),f=e.end,d=e.lineNumber,h=e.lineStart,e}function W(){var e,t,n;e=f,t=d,n=h,m=void 0!==v.tokens?U():I(),f=e,d=t,h=n}function H(e,t){this.line=e,this.column=t}function G(e,t,n,r){this.start=new H(e,t),this.end=new H(n,r)}function V(){var e,t,n,r;return e=f,t=d,n=h,$(),r=d!==t,f=e,d=t,h=n,r}function Y(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(function(e,t){return b(t":case"<=":case">=":case"instanceof":r=7;break;case"in":r=n?7:0;break;case"<<":case">>":case">>>":r=8;break;case"+":case"-":r=9;break;case"*":case"/":case"%":r=11}return r}function ge(){var e,t,n,r,i;return i=m,e=function(){var e,t,n,r,i,o,a,s,u,l;if(e=m,u=he(),0===(i=pe(r=m,y.allowIn)))return u;for(r.prec=i,q(),t=[e,m],o=[u,r,a=he()];(i=pe(m,y.allowIn))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),n=g.createBinaryExpression(s,u,a),t.pop(),e=t[t.length-1],g.markEnd(n,e),o.push(n);(r=q()).prec=i,o.push(r),t.push(m),n=he(),o.push(n)}for(n=o[l=o.length-1],t.pop();l>1;)n=g.createBinaryExpression(o[l-1].value,o[l-2],n),l-=2,e=t.pop(),g.markEnd(n,e);return n}(),Q("?")&&(q(),t=y.allowIn,y.allowIn=!0,n=me(),y.allowIn=t,J(":"),r=me(),e=g.createConditionalExpression(e,n,r),g.markEnd(e,i)),e}function me(){var e,n,r,o,s,u;return e=m,s=m,o=n=ge(),m.type===t.Punctuator&&("="===(u=m.value)||"*="===u||"/="===u||"%="===u||"+="===u||"-="===u||"<<="===u||">>="===u||">>>="===u||"&="===u||"^="===u||"|="===u)&&(ne(n)||X({},a.InvalidLHSInAssignment),c&&n.type===i.Identifier&&C(n.name)&&X(e,a.StrictLHSAssignment),e=q(),r=me(),o=g.markEnd(g.createAssignmentExpression(e.value,n,r),s)),o}function ye(){var e,t=m;if(e=me(),Q(",")){for(e=g.createSequenceExpression([e]);f",n[t.Identifier]="Identifier",n[t.Keyword]="Keyword",n[t.NullLiteral]="Null",n[t.NumericLiteral]="Numeric",n[t.Punctuator]="Punctuator",n[t.StringLiteral]="String",n[t.RegularExpression]="RegularExpression",r=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],i={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},o={Data:1,Get:2,Set:4},a={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},s={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},u={name:"SyntaxTree",processComment:function(e){var t,n;if(!(e.type===i.Program&&e.body.length>0)){for(v.trailingComments.length>0?v.trailingComments[0].range[0]>=e.range[1]?(n=v.trailingComments,v.trailingComments=[]):v.trailingComments.length=0:v.bottomRightStack.length>0&&v.bottomRightStack[v.bottomRightStack.length-1].trailingComments&&v.bottomRightStack[v.bottomRightStack.length-1].trailingComments[0].range[0]>=e.range[1]&&(n=v.bottomRightStack[v.bottomRightStack.length-1].trailingComments,delete v.bottomRightStack[v.bottomRightStack.length-1].trailingComments);v.bottomRightStack.length>0&&v.bottomRightStack[v.bottomRightStack.length-1].range[0]>=e.range[0];)t=v.bottomRightStack.pop();t?t.leadingComments&&t.leadingComments[t.leadingComments.length-1].range[1]<=e.range[0]&&(e.leadingComments=t.leadingComments,delete t.leadingComments):v.leadingComments.length>0&&v.leadingComments[v.leadingComments.length-1].range[1]<=e.range[0]&&(e.leadingComments=v.leadingComments,v.leadingComments=[]),n&&(e.trailingComments=n),v.bottomRightStack.push(e)}},markEnd:function(e,t){return v.range&&(e.range=[t.start,f]),v.loc&&(e.loc=new G(void 0===t.startLineNumber?t.lineNumber:t.startLineNumber,t.start-(void 0===t.startLineStart?t.lineStart:t.startLineStart),d,f-h),this.postProcess(e)),v.attachComment&&this.processComment(e),e},postProcess:function(e){return v.source&&(e.loc.source=v.source),e},createArrayExpression:function(e){return{type:i.ArrayExpression,elements:e}},createAssignmentExpression:function(e,t,n){return{type:i.AssignmentExpression,operator:e,left:t,right:n}},createBinaryExpression:function(e,t,n){return{type:"||"===e||"&&"===e?i.LogicalExpression:i.BinaryExpression,operator:e,left:t,right:n}},createBlockStatement:function(e){return{type:i.BlockStatement,body:e}},createBreakStatement:function(e){return{type:i.BreakStatement,label:e}},createCallExpression:function(e,t){return{type:i.CallExpression,callee:e,arguments:t}},createCatchClause:function(e,t){return{type:i.CatchClause,param:e,body:t}},createConditionalExpression:function(e,t,n){return{type:i.ConditionalExpression,test:e,consequent:t,alternate:n}},createContinueStatement:function(e){return{type:i.ContinueStatement,label:e}},createDebuggerStatement:function(){return{type:i.DebuggerStatement}},createDoWhileStatement:function(e,t){return{type:i.DoWhileStatement,body:e,test:t}},createEmptyStatement:function(){return{type:i.EmptyStatement}},createExpressionStatement:function(e){return{type:i.ExpressionStatement,expression:e}},createForStatement:function(e,t,n,r){return{type:i.ForStatement,init:e,test:t,update:n,body:r}},createForInStatement:function(e,t,n){return{type:i.ForInStatement,left:e,right:t,body:n,each:!1}},createFunctionDeclaration:function(e,t,n,r){return{type:i.FunctionDeclaration,id:e,params:t,defaults:n,body:r,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(e,t,n,r){return{type:i.FunctionExpression,id:e,params:t,defaults:n,body:r,rest:null,generator:!1,expression:!1}},createIdentifier:function(e){return{type:i.Identifier,name:e}},createIfStatement:function(e,t,n){return{type:i.IfStatement,test:e,consequent:t,alternate:n}},createLabeledStatement:function(e,t){return{type:i.LabeledStatement,label:e,body:t}},createLiteral:function(e){return{type:i.Literal,value:e.value,raw:l.slice(e.start,e.end)}},createMemberExpression:function(e,t,n){return{type:i.MemberExpression,computed:"["===e,object:t,property:n}},createNewExpression:function(e,t){return{type:i.NewExpression,callee:e,arguments:t}},createObjectExpression:function(e){return{type:i.ObjectExpression,properties:e}},createPostfixExpression:function(e,t){return{type:i.UpdateExpression,operator:e,argument:t,prefix:!1}},createProgram:function(e){return{type:i.Program,body:e}},createProperty:function(e,t,n){return{type:i.Property,key:t,value:n,kind:e}},createReturnStatement:function(e){return{type:i.ReturnStatement,argument:e}},createSequenceExpression:function(e){return{type:i.SequenceExpression,expressions:e}},createSwitchCase:function(e,t){return{type:i.SwitchCase,test:e,consequent:t}},createSwitchStatement:function(e,t){return{type:i.SwitchStatement,discriminant:e,cases:t}},createThisExpression:function(){return{type:i.ThisExpression}},createThrowStatement:function(e){return{type:i.ThrowStatement,argument:e}},createTryStatement:function(e,t,n,r){return{type:i.TryStatement,block:e,guardedHandlers:t,handlers:n,finalizer:r}},createUnaryExpression:function(e,t){return"++"===e||"--"===e?{type:i.UpdateExpression,operator:e,argument:t,prefix:!0}:{type:i.UnaryExpression,operator:e,argument:t,prefix:!0}},createVariableDeclaration:function(e,t){return{type:i.VariableDeclaration,declarations:e,kind:t}},createVariableDeclarator:function(e,t){return{type:i.VariableDeclarator,id:e,init:t}},createWhileStatement:function(e,t){return{type:i.WhileStatement,test:e,body:t}},createWithStatement:function(e,t){return{type:i.WithStatement,object:e,body:t}}},e.version="1.2.5",e.tokenize=function(e,n){var r;"string"==typeof e||e instanceof String||(e=String(e)),g=u,f=0,d=(l=e).length>0?1:0,h=0,p=l.length,m=null,y={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},v={},(n=n||{}).tokens=!0,v.tokens=[],v.tokenize=!0,v.openParenToken=-1,v.openCurlyToken=-1,v.range="boolean"==typeof n.range&&n.range,v.loc="boolean"==typeof n.loc&&n.loc,"boolean"==typeof n.comment&&n.comment&&(v.comments=[]),"boolean"==typeof n.tolerant&&n.tolerant&&(v.errors=[]);try{if(W(),m.type===t.EOF)return v.tokens;for(q();m.type!==t.EOF;)try{q()}catch(e){if(v.errors){v.errors.push(e);break}throw e}Me(),r=v.tokens,void 0!==v.comments&&(r.comments=v.comments),void 0!==v.errors&&(r.errors=v.errors)}catch(e){throw e}finally{v={}}return r},e.parse=function(e,t){var n,r;r=String,"string"==typeof e||e instanceof String||(e=r(e)),g=u,f=0,d=(l=e).length>0?1:0,h=0,p=l.length,m=null,y={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},v={},void 0!==t&&(v.range="boolean"==typeof t.range&&t.range,v.loc="boolean"==typeof t.loc&&t.loc,v.attachComment="boolean"==typeof t.attachComment&&t.attachComment,v.loc&&null!==t.source&&void 0!==t.source&&(v.source=r(t.source)),"boolean"==typeof t.tokens&&t.tokens&&(v.tokens=[]),"boolean"==typeof t.comment&&t.comment&&(v.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(v.errors=[]),v.attachComment&&(v.range=!0,v.comments=[],v.bottomRightStack=[],v.trailingComments=[],v.leadingComments=[]));try{n=Fe(),void 0!==v.comments&&(n.comments=v.comments),void 0!==v.tokens&&(Me(),n.tokens=v.tokens),void 0!==v.errors&&(n.errors=v.errors)}catch(e){throw e}finally{v={}}return n},e.Syntax=function(){var e,t={};for(e in"function"==typeof Object.create&&(t=Object.create(null)),i)i.hasOwnProperty(e)&&(t[e]=i[e]);return"function"==typeof Object.freeze&&Object.freeze(t),t}()},void 0===(r=n.apply(t,[t]))||(e.exports=r)}()},17:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){var a=o[i];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}},492:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n,r="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(n=t.cmp,function(e){return function(t,r){var i={key:t,value:e[t]},o={key:r,value:e[r]};return n(i,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var n,a;if(Array.isArray(t)){for(a="[",n=0;n{"use strict";e.exports=function(e){for(var t=new Array(e),n=0;n{function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},402:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decompress=void 0;const r=n(668),i=n(404);t.decompress={zlib:e=>r.inflate(new Uint8Array(e)).buffer,lz4:e=>i.decompress(new Uint8Array(e)).buffer}},452:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=t.decompress=t.rowProxy=t.table_serialization=t.EchoTableWidgetView=t.EchoTableWidgetModel=t.TableWidgetModel=void 0;var r=n(873);Object.defineProperty(t,"TableWidgetModel",{enumerable:!0,get:function(){return r.TableWidgetModel}}),Object.defineProperty(t,"EchoTableWidgetModel",{enumerable:!0,get:function(){return r.EchoTableWidgetModel}}),Object.defineProperty(t,"EchoTableWidgetView",{enumerable:!0,get:function(){return r.EchoTableWidgetView}});var i=n(773);Object.defineProperty(t,"table_serialization",{enumerable:!0,get:function(){return i.table_serialization}}),Object.defineProperty(t,"rowProxy",{enumerable:!0,get:function(){return i.rowProxy}});var o=n(402);Object.defineProperty(t,"decompress",{enumerable:!0,get:function(){return o.decompress}}),t.version=n(51).version},773:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.table_serialization=t.tableToJSON=t.rowProxy=t.JSONToTable=void 0;const r=n(655),i=n(402),o={bool:Uint8Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,float32:Float32Array,float64:Float64Array,str:Array},a=Symbol("rowIndex");function s(e,t){if(null===e)return null;var n={},a=1/0;let s,u=new TextDecoder("utf-8");for(const[t,l]of Object.entries(e.data))if(void 0!==l.compression){let e=l.buffer;if(s=i.decompress[l.compression](e.buffer),"str"===l.dtype){let e=s,r=u.decode(e),i=JSON.parse(r);n[t]=i}else n[t]=r(new o[l.dtype](s),l.shape),a=Math.min(a,l.shape[0])}else if("str"===l.dtype){let e=l.buffer;n[t]=e,a=Math.min(a,e.length)}else{let e=l.buffer;n[t]=r(new o[l.dtype](e.buffer),l.shape),a=Math.min(a,l.shape[0])}return{columns:e.columns,data:n,size:a}}function u(e,t){return null}t.JSONToTable=s,t.rowProxy=function(e){if(null===e)return null;var t=e.columns,n={};return t.forEach((t=>{const r=e.data[t],i=r,o=r;n.hasOwnProperty(t)||(void 0===i.shape?Object.defineProperty(n,t,{get:function(){const e=this[a];return o[e]},set:function(){throw Error("Arrow field values can not be overwritten.")},enumerable:!0}):Object.defineProperty(n,t,{get:function(){const e=this[a],t=i.get(e);return isNaN(t)?null:t},set:function(){throw Error("Arrow field values can not be overwritten.")},enumerable:!0}))})),e=>{var t=Object.create(n);return t[a]=e,t}},t.tableToJSON=u,t.table_serialization={deserialize:s,serialize:u}},873:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.EchoTableWidgetView=t.EchoTableWidgetModel=t.TableWidgetModel=void 0;const i=n(55),o=n(655),a=n(799),s=n(773);let u=n(51).version;class l extends i.DOMWidgetModel{defaults(){return Object.assign(Object.assign({},i.DOMWidgetModel.prototype.defaults()),{_model_name:"TableWidgetModel",_view_name:null,_model_module:"jupyter-tablewidgets",_view_module:null,_model_module_version:u,_view_module_version:"",_table:o([]),_columns:[]})}}t.TableWidgetModel=l,l.serializers=Object.assign(Object.assign({},i.DOMWidgetModel.serializers),{_table:s.table_serialization});class c extends i.DOMWidgetModel{defaults(){return Object.assign(Object.assign({},i.DOMWidgetModel.prototype.defaults()),{_model_name:"EchoTableWidgetModel",_view_name:"EchoTableWidgetView",_model_module:"jupyter-tablewidgets",_view_module:"jupyter-tablewidgets",_model_module_version:u,_view_module_version:u,data:[],echo:[]})}}t.EchoTableWidgetModel=c,c.serializers=Object.assign(Object.assign({},i.DOMWidgetModel.serializers),{data:{deserialize:i.unpack_models}});class f extends i.DOMWidgetView{render(){return r(this,void 0,void 0,(function*(){let e=this.model,t=e.get("data").get("_table"),n={columns:t.columns,data:{}};for(const[e,r]of Object.entries(t.data)){let t=r;void 0!==t.dtype?n.data[e]=a(t):n.data[e]=t}e.set("echo",n),this.touch()}))}}t.EchoTableWidgetView=f},404:(e,t,n)=>{var r=n(255),i=n(144),o=65536,a=f(5<<20),s=function(){try{return new Uint32Array(o)}catch(n){for(var e=new Array(o),t=0;t>4&7;if(void 0===c[a])throw new Error("invalid block size "+a);var s=c[a];if(o)return i.readU64(e,t);t++;for(var f=0;;){var d=i.readU32(e,t);if(t+=4,f+=d&l?d&=2147483647:s,0===d)return f;r&&(t+=4),t+=d}},t.makeBuffer=f,t.decompressBlock=function(e,t,n,r,i){var o,a,s,u,l;for(s=n+r;n>4;if(f>0){if(15===f)for(;f+=e[n],255===e[n++];);for(u=n+f;n=s)break;if(o=15&c,a=e[n++]|e[n++]<<8,15===o)for(;o+=e[n],255===e[n++];);for(u=(l=i-a)+(o+=4);l=13)for(var p=67;n+4>>0;if(a=o[m=(m>>16^m)>>>0&65535]-1,o[m]=n+1,a<0||n-a>>>16>0||i.readU32(e,a)!==g)n+=p++>>6;else{for(p=67,c=n-s,l=n-a,a+=4,u=n+=4;n=15){for(t[f++]=240+y,h=c-15;h>=255;h-=255)t[f++]=255;t[f++]=h}else t[f++]=(c<<4)+y;for(var v=0;v>8,u>=15){for(h=u-15;h>=255;h-=255)t[f++]=255;t[f++]=h}s=n}}if(0===s)return 0;if((c=d-s)>=15){for(t[f++]=240,h=c-15;h>=255;h-=255)t[f++]=255;t[f++]=h}else t[f++]=c<<4;for(n=s;n>4&7;if(void 0===c[h])throw new Error("invalid block size");for(a&&(f+=8),f++;;){var p;if(p=i.readU32(e,f),f+=4,0===p)break;if(r&&(f+=4),p&l){p&=2147483647;for(var g=0;g>8,l++;var f=c[7],d=e.length,h=0;for(function(){for(var e=0;e0;){var p,g=d>f?f:d;if((p=t.compressBlock(e,a,h,g,s))>g||0===p){i.writeU32(n,l,2147483648|g),l+=4;for(var m=h+g;h{t.hashU32=function(e){return-1252372727^(e=(e=(e=374761393+(e=-949894596^(e=2127912214+(e|=0)+(e<<12)|0)^e>>>19)+(e<<5)|0)-744332180^e<<9)-42973499+(e<<3)|0)^e>>>16},t.readU64=function(e,t){var n=0;return n|=0|e[t++],n|=e[t++]<<8,n|=e[t++]<<16,n|=e[t++]<<24,n|=e[t++]<<32,n|=e[t++]<<40,(n|=e[t++]<<48)|e[t++]<<56},t.readU32=function(e,t){var n=0;return n|=0|e[t++],n|=e[t++]<<8,(n|=e[t++]<<16)|e[t++]<<24},t.writeU32=function(e,t,n){e[t++]=255&n,e[t++]=n>>8&255,e[t++]=n>>16&255,e[t++]=n>>24&255},t.imul=function(e,t){var n=65535&e,r=65535&t;return n*r+((e>>>16)*r+n*(t>>>16)<<16)|0}},255:(e,t,n)=>{var r=n(144),i=2654435761,o=2246822519,a=3266489917,s=374761393;function u(e,t){return(e|=0)>>>(32-(t|=0)|0)|e<>>(32-t|0)|e<>>(t|=0)^e}function f(e,t,n,i,o){return l(r.imul(t,n)+e,i,o)}function d(e,t,n){return l(e+r.imul(t[n],s),11,i)}function h(e,t,n){return f(e,r.readU32(t,n),a,17,668265263)}function p(e,t,n){return[f(e[0],r.readU32(t,n+0),o,13,i),f(e[1],r.readU32(t,n+4),o,13,i),f(e[2],r.readU32(t,n+8),o,13,i),f(e[3],r.readU32(t,n+12),o,13,i)]}t.hash=function(e,t,n,l){var f,g;if(g=l,l>=16){for(f=[e+i+o,e+o,e,e-i];l>=16;)f=p(f,t,n),n+=16,l-=16;f=u(f[0],1)+u(f[1],7)+u(f[2],12)+u(f[3],18)+g}else f=e+s+l>>>0;for(;l>=4;)f=h(f,t,n),n+=4,l-=4;for(;l>0;)f=d(f,t,n),n++,l--;return(f=c(r.imul(c(r.imul(c(f,15),o),13),a),16))>>>0}},799:(e,t,n)=>{"use strict";var r=n(343),i=n(713)({args:["array","scalar","index"],body:function(e,t,n){var r,i=t;for(r=0;r{var r=n(219),i=n(206),o="undefined"!=typeof Float64Array;function a(e,t){return e[0]-t[0]}function s(){var e,t=this.stride,n=new Array(t.length);for(e=0;eMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===t&&o.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push("proto.set=function "+n+"_set("+u.join(",")+",v){"),i?o.push("return this.data.set("+c+",v)}"):o.push("return this.data["+c+"]=v}"),o.push("proto.get=function "+n+"_get("+u.join(",")+"){"),i?o.push("return this.data.get("+c+")}"):o.push("return this.data["+c+"]}"),o.push("proto.index=function "+n+"_index(",u.join(),"){return "+c+"}"),o.push("proto.hi=function "+n+"_hi("+u.join(",")+"){return new "+n+"(this.data,"+a.map((function(e){return["(typeof i",e,"!=='number'||i",e,"<0)?this.shape[",e,"]:i",e,"|0"].join("")})).join(",")+","+a.map((function(e){return"this.stride["+e+"]"})).join(",")+",this.offset)}");var h=a.map((function(e){return"a"+e+"=this.shape["+e+"]"})),p=a.map((function(e){return"c"+e+"=this.stride["+e+"]"}));o.push("proto.lo=function "+n+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+h.join(",")+","+p.join(","));for(var g=0;g=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");for(o.push("return new "+n+"(this.data,"+a.map((function(e){return"a"+e})).join(",")+","+a.map((function(e){return"c"+e})).join(",")+",b)}"),o.push("proto.step=function "+n+"_step("+u.join(",")+"){var "+a.map((function(e){return"a"+e+"=this.shape["+e+"]"})).join(",")+","+a.map((function(e){return"b"+e+"=this.stride["+e+"]"})).join(",")+",c=this.offset,d=0,ceil=Math.ceil"),g=0;g=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");return o.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),o.push("return function construct_"+n+"(data,shape,stride,offset){return new "+n+"(data,"+a.map((function(e){return"shape["+e+"]"})).join(",")+","+a.map((function(e){return"stride["+e+"]"})).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",o.join("\n"))(l[e],s)}var l={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};e.exports=function(e,t,n,r){if(void 0===e)return(0,l.array[0])([]);"number"==typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var a=t.length;if(void 0===n){n=new Array(a);for(var s=a-1,c=1;s>=0;--s)n[s]=c,c*=t[s]}if(void 0===r)for(r=0,s=0;s{"use strict";const{Deflate:r,deflate:i,deflateRaw:o,gzip:a}=n(303),{Inflate:s,inflate:u,inflateRaw:l,ungzip:c}=n(83),f=n(681);e.exports.Deflate=r,e.exports.deflate=i,e.exports.deflateRaw=o,e.exports.gzip=a,e.exports.Inflate=s,e.exports.inflate=u,e.exports.inflateRaw=l,e.exports.ungzip=c,e.exports.constants=f},303:(e,t,n)=>{"use strict";const r=n(411),i=n(805),o=n(996),a=n(674),s=n(442),u=Object.prototype.toString,{Z_NO_FLUSH:l,Z_SYNC_FLUSH:c,Z_FULL_FLUSH:f,Z_FINISH:d,Z_OK:h,Z_STREAM_END:p,Z_DEFAULT_COMPRESSION:g,Z_DEFAULT_STRATEGY:m,Z_DEFLATED:y}=n(681);function v(e){this.options=i.assign({level:g,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:m},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;let n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==h)throw new Error(a[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,n=r.deflateSetDictionary(this.strm,e),n!==h)throw new Error(a[n]);this._dict_set=!0}}function b(e,t){const n=new v(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}v.prototype.push=function(e,t){const n=this.strm,i=this.options.chunkSize;let a,s;if(this.ended)return!1;for(s=t===~~t?t:!0===t?d:l,"string"==typeof e?n.input=o.string2buf(e):"[object ArrayBuffer]"===u.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),(s===c||s===f)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(a=r.deflate(n,s),a===p)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),a=r.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===h;if(0!==n.avail_out){if(s>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},v.prototype.onData=function(e){this.chunks.push(e)},v.prototype.onEnd=function(e){e===h&&(this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},e.exports.Deflate=v,e.exports.deflate=b,e.exports.deflateRaw=function(e,t){return(t=t||{}).raw=!0,b(e,t)},e.exports.gzip=function(e,t){return(t=t||{}).gzip=!0,b(e,t)},e.exports.constants=n(681)},83:(e,t,n)=>{"use strict";const r=n(447),i=n(805),o=n(996),a=n(674),s=n(442),u=n(414),l=Object.prototype.toString,{Z_NO_FLUSH:c,Z_FINISH:f,Z_OK:d,Z_STREAM_END:h,Z_NEED_DICT:p,Z_STREAM_ERROR:g,Z_DATA_ERROR:m,Z_MEM_ERROR:y}=n(681);function v(e){this.options=i.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;let n=r.inflateInit2(this.strm,t.windowBits);if(n!==d)throw new Error(a[n]);if(this.header=new u,r.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=r.inflateSetDictionary(this.strm,t.dictionary),n!==d)))throw new Error(a[n])}function b(e,t){const n=new v(t);if(n.push(e),n.err)throw n.msg||a[n.err];return n.result}v.prototype.push=function(e,t){const n=this.strm,i=this.options.chunkSize,a=this.options.dictionary;let s,u,v;if(this.ended)return!1;for(u=t===~~t?t:!0===t?f:c,"[object ArrayBuffer]"===l.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),s=r.inflate(n,u),s===p&&a&&(s=r.inflateSetDictionary(n,a),s===d?s=r.inflate(n,u):s===m&&(s=p));n.avail_in>0&&s===h&&n.state.wrap>0&&0!==e[n.next_in];)r.inflateReset(n),s=r.inflate(n,u);switch(s){case g:case m:case p:case y:return this.onEnd(s),this.ended=!0,!1}if(v=n.avail_out,n.next_out&&(0===n.avail_out||s===h))if("string"===this.options.to){let e=o.utf8border(n.output,n.next_out),t=n.next_out-e,r=o.buf2string(n.output,e);n.next_out=t,n.avail_out=i-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(r)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(s!==d||0!==v){if(s===h)return s=r.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},v.prototype.onData=function(e){this.chunks.push(e)},v.prototype.onEnd=function(e){e===d&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},e.exports.Inflate=v,e.exports.inflate=b,e.exports.inflateRaw=function(e,t){return(t=t||{}).raw=!0,b(e,t)},e.exports.ungzip=b,e.exports.constants=n(681)},805:e=>{"use strict";const t=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);e.exports.assign=function(e){const n=Array.prototype.slice.call(arguments,1);for(;n.length;){const r=n.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const n in r)t(r,n)&&(e[n]=r[n])}}return e},e.exports.flattenChunks=e=>{let t=0;for(let n=0,r=e.length;n{"use strict";let t=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){t=!1}const n=new Uint8Array(256);for(let e=0;e<256;e++)n[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;n[254]=n[254]=1,e.exports.string2buf=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,r,i,o,a=e.length,s=0;for(i=0;i>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},e.exports.buf2string=(e,r)=>{const i=r||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,r));let o,a;const s=new Array(2*i);for(a=0,o=0;o4)s[a++]=65533,o+=r-1;else{for(t&=2===r?31:3===r?15:7;r>1&&o1?s[a++]=65533:t<65536?s[a++]=t:(t-=65536,s[a++]=55296|t>>10&1023,s[a++]=56320|1023&t)}}return((e,n)=>{if(n<65534&&e.subarray&&t)return String.fromCharCode.apply(null,e.length===n?e:e.subarray(0,n));let r="";for(let t=0;t{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+n[e[r]]>t?r:t}},269:e=>{"use strict";e.exports=(e,t,n,r)=>{let i=65535&e,o=e>>>16&65535,a=0;for(;0!==n;){a=n>2e3?2e3:n,n-=a;do{i=i+t[r++]|0,o=o+i|0}while(--a);i%=65521,o%=65521}return i|o<<16}},681:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},823:e=>{"use strict";const t=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());e.exports=(e,n,r,i)=>{const o=t,a=i+r;e^=-1;for(let t=i;t>>8^o[255&(e^n[t])];return~e}},411:(e,t,n)=>{"use strict";const{_tr_init:r,_tr_stored_block:i,_tr_flush_block:o,_tr_tally:a,_tr_align:s}=n(665),u=n(269),l=n(823),c=n(674),{Z_NO_FLUSH:f,Z_PARTIAL_FLUSH:d,Z_FULL_FLUSH:h,Z_FINISH:p,Z_BLOCK:g,Z_OK:m,Z_STREAM_END:y,Z_STREAM_ERROR:v,Z_DATA_ERROR:b,Z_BUF_ERROR:x,Z_DEFAULT_COMPRESSION:_,Z_FILTERED:w,Z_HUFFMAN_ONLY:k,Z_RLE:A,Z_FIXED:E,Z_DEFAULT_STRATEGY:O,Z_UNKNOWN:D,Z_DEFLATED:C}=n(681),S=258,F=262,M=42,j=113,$=666,N=(e,t)=>(e.msg=c[t],t),B=e=>2*e-(e>4?9:0),T=e=>{let t=e.length;for(;--t>=0;)e[t]=0},z=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do{n=e.head[--r],e.head[r]=n>=i?n-i:0}while(--t);t=i,r=t;do{n=e.prev[--r],e.prev[r]=n>=i?n-i:0}while(--t)};let R=(e,t,n)=>(t<{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))},L=(e,t)=>{o(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,P(e.strm)},I=(e,t)=>{e.pending_buf[e.pending++]=t},U=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},q=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),1===e.state.wrap?e.adler=u(e.adler,t,i,n):2===e.state.wrap&&(e.adler=l(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},W=(e,t)=>{let n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match;const u=e.strstart>e.w_size-F?e.strstart-(e.w_size-F):0,l=e.window,c=e.w_mask,f=e.prev,d=e.strstart+S;let h=l[o+a-1],p=l[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(n=t,l[n+a]===p&&l[n+a-1]===h&&l[n]===l[o]&&l[++n]===l[o+1]){o+=2,n++;do{}while(l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&oa){if(e.match_start=t,a=r,r>=s)break;h=l[o+a-1],p=l[o+a]}}}while((t=f[t&c])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead},H=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-F)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),z(e),r+=t),0===e.strm.avail_in)break;if(n=q(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=R(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=R(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead{let n,r,o,a=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,u=e.strm.avail_in;do{if(n=65535,o=e.bi_valid+42>>3,e.strm.avail_outr+e.strm.avail_in&&(n=r+e.strm.avail_in),n>o&&(n=o),n>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,P(e.strm),r&&(r>n&&(r=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,n-=r),n&&(q(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(0===s);return u-=e.strm.avail_in,u&&(u>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=u&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-u,e.strm.next_in),e.strstart),e.strstart+=u,e.insert+=u>e.w_size-e.insert?e.w_size-e.insert:u),e.block_start=e.strstart),e.high_watero&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(q(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,a=o>e.w_size?e.w_size:o,r=e.strstart-e.block_start,(r>=a||(r||t===p)&&t!==f&&0===e.strm.avail_in&&r<=o)&&(n=r>o?o:r,s=t===p&&0===e.strm.avail_in&&n===r?1:0,i(e,e.block_start,n,s),e.block_start+=n,P(e.strm)),s?3:1)},V=(e,t)=>{let n,r;for(;;){if(e.lookahead=3&&(e.ins_h=R(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-F&&(e.match_length=W(e,n)),e.match_length>=3)if(r=a(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=R(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=R(e,e.ins_h,e.window[e.strstart+1]);else r=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(L(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===p?(L(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(L(e,!1),0===e.strm.avail_out)?1:2},Y=(e,t)=>{let n,r,i;for(;;){if(e.lookahead=3&&(e.ins_h=R(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,r=a(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=R(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(L(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=a(e,0,e.window[e.strstart-1]),r&&L(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=a(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===p?(L(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(L(e,!1),0===e.strm.avail_out)?1:2};function X(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const Z=[new X(0,0,0,0,G),new X(4,4,8,4,V),new X(4,5,16,8,V),new X(4,6,32,32,V),new X(4,4,16,16,Y),new X(8,16,32,32,Y),new X(8,16,128,128,Y),new X(8,32,128,256,Y),new X(32,128,258,1024,Y),new X(32,258,258,4096,Y)];function J(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=C,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),T(this.dyn_ltree),T(this.dyn_dtree),T(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),T(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),T(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const K=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==M&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==j&&t.status!==$?1:0},Q=e=>{if(K(e))return N(e,v);e.total_in=e.total_out=0,e.data_type=D;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?M:j,e.adler=2===t.wrap?0:1,t.last_flush=-2,r(t),m},ee=e=>{const t=Q(e);var n;return t===m&&((n=e.state).window_size=2*n.w_size,T(n.head),n.max_lazy_match=Z[n.level].max_lazy,n.good_match=Z[n.level].good_length,n.nice_match=Z[n.level].nice_length,n.max_chain_length=Z[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),t},te=(e,t,n,r,i,o)=>{if(!e)return v;let a=1;if(t===_&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>9||n!==C||r<8||r>15||t<0||t>9||o<0||o>E||8===r&&1!==a)return N(e,v);8===r&&(r=9);const s=new J;return e.state=s,s.strm=e,s.status=M,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<te(e,t,C,15,8,O),e.exports.deflateInit2=te,e.exports.deflateReset=ee,e.exports.deflateResetKeep=Q,e.exports.deflateSetHeader=(e,t)=>K(e)||2!==e.state.wrap?v:(e.state.gzhead=t,m),e.exports.deflate=(e,t)=>{if(K(e)||t>g||t<0)return e?N(e,v):v;const n=e.state;if(!e.output||0!==e.avail_in&&!e.input||n.status===$&&t!==p)return N(e,0===e.avail_out?x:v);const r=n.last_flush;if(n.last_flush=t,0!==n.pending){if(P(e),0===e.avail_out)return n.last_flush=-1,m}else if(0===e.avail_in&&B(t)<=B(r)&&t!==p)return N(e,x);if(n.status===$&&0!==e.avail_in)return N(e,x);if(n.status===M&&0===n.wrap&&(n.status=j),n.status===M){let t=C+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=k||n.level<2?0:n.level<6?1:6===n.level?2:3,t|=r<<6,0!==n.strstart&&(t|=32),t+=31-t%31,U(n,t),0!==n.strstart&&(U(n,e.adler>>>16),U(n,65535&e.adler)),e.adler=1,n.status=j,P(e),0!==n.pending)return n.last_flush=-1,m}if(57===n.status)if(e.adler=0,I(n,31),I(n,139),I(n,8),n.gzhead)I(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),I(n,255&n.gzhead.time),I(n,n.gzhead.time>>8&255),I(n,n.gzhead.time>>16&255),I(n,n.gzhead.time>>24&255),I(n,9===n.level?2:n.strategy>=k||n.level<2?4:0),I(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(I(n,255&n.gzhead.extra.length),I(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=l(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(I(n,0),I(n,0),I(n,0),I(n,0),I(n,0),I(n,9===n.level?2:n.strategy>=k||n.level<2?4:0),I(n,3),n.status=j,P(e),0!==n.pending)return n.last_flush=-1,m;if(69===n.status){if(n.gzhead.extra){let t=n.pending,r=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=l(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,P(e),0!==n.pending)return n.last_flush=-1,m;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=l(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=l(e.adler,n.pending_buf,n.pending-r,r)),P(e),0!==n.pending)return n.last_flush=-1,m;r=0}t=n.gzindexr&&(e.adler=l(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=l(e.adler,n.pending_buf,n.pending-r,r)),P(e),0!==n.pending)return n.last_flush=-1,m;r=0}t=n.gzindexr&&(e.adler=l(e.adler,n.pending_buf,n.pending-r,r))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(P(e),0!==n.pending))return n.last_flush=-1,m;I(n,255&e.adler),I(n,e.adler>>8&255),e.adler=0}if(n.status=j,P(e),0!==n.pending)return n.last_flush=-1,m}if(0!==e.avail_in||0!==n.lookahead||t!==f&&n.status!==$){let r=0===n.level?G(n,t):n.strategy===k?((e,t)=>{let n;for(;;){if(0===e.lookahead&&(H(e),0===e.lookahead)){if(t===f)return 1;break}if(e.match_length=0,n=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(L(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===p?(L(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(L(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===A?((e,t)=>{let n,r,i,o;const s=e.window;for(;;){if(e.lookahead<=S){if(H(e),e.lookahead<=S&&t===f)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,r=s[i],r===s[++i]&&r===s[++i]&&r===s[++i])){o=e.strstart+S;do{}while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=a(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(L(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===p?(L(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(L(e,!1),0===e.strm.avail_out)?1:2})(n,t):Z[n.level].func(n,t);if(3!==r&&4!==r||(n.status=$),1===r||3===r)return 0===e.avail_out&&(n.last_flush=-1),m;if(2===r&&(t===d?s(n):t!==g&&(i(n,0,0,!1),t===h&&(T(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),P(e),0===e.avail_out))return n.last_flush=-1,m}return t!==p?m:n.wrap<=0?y:(2===n.wrap?(I(n,255&e.adler),I(n,e.adler>>8&255),I(n,e.adler>>16&255),I(n,e.adler>>24&255),I(n,255&e.total_in),I(n,e.total_in>>8&255),I(n,e.total_in>>16&255),I(n,e.total_in>>24&255)):(U(n,e.adler>>>16),U(n,65535&e.adler)),P(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?m:y)},e.exports.deflateEnd=e=>{if(K(e))return v;const t=e.state.status;return e.state=null,t===j?N(e,b):m},e.exports.deflateSetDictionary=(e,t)=>{let n=t.length;if(K(e))return v;const r=e.state,i=r.wrap;if(2===i||1===i&&r.status!==M||r.lookahead)return v;if(1===i&&(e.adler=u(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){0===i&&(T(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,H(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=R(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,H(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,r.wrap=i,m},e.exports.deflateInfo="pako deflate (from Nodeca project)"},414:e=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},293:e=>{"use strict";const t=16209;e.exports=function(e,n){let r,i,o,a,s,u,l,c,f,d,h,p,g,m,y,v,b,x,_,w,k,A,E,O;const D=e.state;r=e.next_in,E=e.input,i=r+(e.avail_in-5),o=e.next_out,O=e.output,a=o-(n-e.avail_out),s=o+(e.avail_out-257),u=D.dmax,l=D.wsize,c=D.whave,f=D.wnext,d=D.window,h=D.hold,p=D.bits,g=D.lencode,m=D.distcode,y=(1<>>24,h>>>=x,p-=x,x=b>>>16&255,0===x)O[o++]=65535&b;else{if(!(16&x)){if(64&x){if(32&x){D.mode=16191;break e}e.msg="invalid literal/length code",D.mode=t;break e}b=g[(65535&b)+(h&(1<>>=x,p-=x),p<15&&(h+=E[r++]<>>24,h>>>=x,p-=x,x=b>>>16&255,16&x){if(w=65535&b,x&=15,pu){e.msg="invalid distance too far back",D.mode=t;break e}if(h>>>=x,p-=x,x=o-a,w>x){if(x=w-x,x>c&&D.sane){e.msg="invalid distance too far back",D.mode=t;break e}if(k=0,A=d,0===f){if(k+=l-x,x<_){_-=x;do{O[o++]=d[k++]}while(--x);k=o-w,A=O}}else if(f2;)O[o++]=A[k++],O[o++]=A[k++],O[o++]=A[k++],_-=3;_&&(O[o++]=A[k++],_>1&&(O[o++]=A[k++]))}else{k=o-w;do{O[o++]=O[k++],O[o++]=O[k++],O[o++]=O[k++],_-=3}while(_>2);_&&(O[o++]=O[k++],_>1&&(O[o++]=O[k++]))}break}if(64&x){e.msg="invalid distance code",D.mode=t;break e}b=m[(65535&b)+(h&(1<>3,r-=_,p-=_<<3,h&=(1<{"use strict";const r=n(269),i=n(823),o=n(293),a=n(998),{Z_FINISH:s,Z_BLOCK:u,Z_TREES:l,Z_OK:c,Z_STREAM_END:f,Z_NEED_DICT:d,Z_STREAM_ERROR:h,Z_DATA_ERROR:p,Z_MEM_ERROR:g,Z_BUF_ERROR:m,Z_DEFLATED:y}=n(681),v=16180,b=16190,x=16191,_=16192,w=16194,k=16199,A=16200,E=16206,O=16209,D=16210,C=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function S(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const F=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode16211?1:0},M=e=>{if(F(e))return h;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=v,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,c},j=e=>{if(F(e))return h;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,M(e)},$=(e,t)=>{let n;if(F(e))return h;const r=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?h:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,j(e))},N=(e,t)=>{if(!e)return h;const n=new S;e.state=n,n.strm=e,n.window=null,n.mode=v;const r=$(e,t);return r!==c&&(e.state=null),r};let B,T,z=!0;const R=e=>{if(z){B=new Int32Array(512),T=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(1,e.lens,0,288,B,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(2,e.lens,0,32,T,0,e.work,{bits:5}),z=!1}e.lencode=B,e.lenbits=9,e.distcode=T,e.distbits=5},P=(e,t,n,r)=>{let i;const o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),o.window.set(t.subarray(n-r,n-r+i),o.wnext),(r-=i)?(o.window.set(t.subarray(n-r,n),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whaveN(e,15),e.exports.inflateInit2=N,e.exports.inflate=(e,t)=>{let n,S,M,j,$,N,B,T,z,L,I,U,q,W,H,G,V,Y,X,Z,J,K,Q=0;const ee=new Uint8Array(4);let te,ne;const re=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(F(e)||!e.output||!e.input&&0!==e.avail_in)return h;n=e.state,n.mode===x&&(n.mode=_),$=e.next_out,M=e.output,B=e.avail_out,j=e.next_in,S=e.input,N=e.avail_in,T=n.hold,z=n.bits,L=N,I=B,K=c;e:for(;;)switch(n.mode){case v:if(0===n.wrap){n.mode=_;break}for(;z<16;){if(0===N)break e;N--,T+=S[j++]<>>8&255,n.check=i(n.check,ee,2,0),T=0,z=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&T)<<8)+(T>>8))%31){e.msg="incorrect header check",n.mode=O;break}if((15&T)!==y){e.msg="unknown compression method",n.mode=O;break}if(T>>>=4,z-=4,J=8+(15&T),0===n.wbits&&(n.wbits=J),J>15||J>n.wbits){e.msg="invalid window size",n.mode=O;break}n.dmax=1<>8&1),512&n.flags&&4&n.wrap&&(ee[0]=255&T,ee[1]=T>>>8&255,n.check=i(n.check,ee,2,0)),T=0,z=0,n.mode=16182;case 16182:for(;z<32;){if(0===N)break e;N--,T+=S[j++]<>>8&255,ee[2]=T>>>16&255,ee[3]=T>>>24&255,n.check=i(n.check,ee,4,0)),T=0,z=0,n.mode=16183;case 16183:for(;z<16;){if(0===N)break e;N--,T+=S[j++]<>8),512&n.flags&&4&n.wrap&&(ee[0]=255&T,ee[1]=T>>>8&255,n.check=i(n.check,ee,2,0)),T=0,z=0,n.mode=16184;case 16184:if(1024&n.flags){for(;z<16;){if(0===N)break e;N--,T+=S[j++]<>>8&255,n.check=i(n.check,ee,2,0)),T=0,z=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(U=n.length,U>N&&(U=N),U&&(n.head&&(J=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(S.subarray(j,j+U),J)),512&n.flags&&4&n.wrap&&(n.check=i(n.check,S,U,j)),N-=U,j+=U,n.length-=U),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===N)break e;U=0;do{J=S[j+U++],n.head&&J&&n.length<65536&&(n.head.name+=String.fromCharCode(J))}while(J&&U>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=x;break;case 16189:for(;z<32;){if(0===N)break e;N--,T+=S[j++]<>>=7&z,z-=7&z,n.mode=E;break}for(;z<3;){if(0===N)break e;N--,T+=S[j++]<>>=1,z-=1,3&T){case 0:n.mode=16193;break;case 1:if(R(n),n.mode=k,t===l){T>>>=2,z-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=O}T>>>=2,z-=2;break;case 16193:for(T>>>=7&z,z-=7&z;z<32;){if(0===N)break e;N--,T+=S[j++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=O;break}if(n.length=65535&T,T=0,z=0,n.mode=w,t===l)break e;case w:n.mode=16195;case 16195:if(U=n.length,U){if(U>N&&(U=N),U>B&&(U=B),0===U)break e;M.set(S.subarray(j,j+U),$),N-=U,j+=U,B-=U,$+=U,n.length-=U;break}n.mode=x;break;case 16196:for(;z<14;){if(0===N)break e;N--,T+=S[j++]<>>=5,z-=5,n.ndist=1+(31&T),T>>>=5,z-=5,n.ncode=4+(15&T),T>>>=4,z-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=O;break}n.have=0,n.mode=16197;case 16197:for(;n.have>>=3,z-=3}for(;n.have<19;)n.lens[re[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,te={bits:n.lenbits},K=a(0,n.lens,0,19,n.lencode,0,n.work,te),n.lenbits=te.bits,K){e.msg="invalid code lengths set",n.mode=O;break}n.have=0,n.mode=16198;case 16198:for(;n.have>>24,G=Q>>>16&255,V=65535&Q,!(H<=z);){if(0===N)break e;N--,T+=S[j++]<>>=H,z-=H,n.lens[n.have++]=V;else{if(16===V){for(ne=H+2;z>>=H,z-=H,0===n.have){e.msg="invalid bit length repeat",n.mode=O;break}J=n.lens[n.have-1],U=3+(3&T),T>>>=2,z-=2}else if(17===V){for(ne=H+3;z>>=H,z-=H,J=0,U=3+(7&T),T>>>=3,z-=3}else{for(ne=H+7;z>>=H,z-=H,J=0,U=11+(127&T),T>>>=7,z-=7}if(n.have+U>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=O;break}for(;U--;)n.lens[n.have++]=J}}if(n.mode===O)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=O;break}if(n.lenbits=9,te={bits:n.lenbits},K=a(1,n.lens,0,n.nlen,n.lencode,0,n.work,te),n.lenbits=te.bits,K){e.msg="invalid literal/lengths set",n.mode=O;break}if(n.distbits=6,n.distcode=n.distdyn,te={bits:n.distbits},K=a(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,te),n.distbits=te.bits,K){e.msg="invalid distances set",n.mode=O;break}if(n.mode=k,t===l)break e;case k:n.mode=A;case A:if(N>=6&&B>=258){e.next_out=$,e.avail_out=B,e.next_in=j,e.avail_in=N,n.hold=T,n.bits=z,o(e,I),$=e.next_out,M=e.output,B=e.avail_out,j=e.next_in,S=e.input,N=e.avail_in,T=n.hold,z=n.bits,n.mode===x&&(n.back=-1);break}for(n.back=0;Q=n.lencode[T&(1<>>24,G=Q>>>16&255,V=65535&Q,!(H<=z);){if(0===N)break e;N--,T+=S[j++]<>Y)],H=Q>>>24,G=Q>>>16&255,V=65535&Q,!(Y+H<=z);){if(0===N)break e;N--,T+=S[j++]<>>=Y,z-=Y,n.back+=Y}if(T>>>=H,z-=H,n.back+=H,n.length=V,0===G){n.mode=16205;break}if(32&G){n.back=-1,n.mode=x;break}if(64&G){e.msg="invalid literal/length code",n.mode=O;break}n.extra=15&G,n.mode=16201;case 16201:if(n.extra){for(ne=n.extra;z>>=n.extra,z-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;Q=n.distcode[T&(1<>>24,G=Q>>>16&255,V=65535&Q,!(H<=z);){if(0===N)break e;N--,T+=S[j++]<>Y)],H=Q>>>24,G=Q>>>16&255,V=65535&Q,!(Y+H<=z);){if(0===N)break e;N--,T+=S[j++]<>>=Y,z-=Y,n.back+=Y}if(T>>>=H,z-=H,n.back+=H,64&G){e.msg="invalid distance code",n.mode=O;break}n.offset=V,n.extra=15&G,n.mode=16203;case 16203:if(n.extra){for(ne=n.extra;z>>=n.extra,z-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=O;break}n.mode=16204;case 16204:if(0===B)break e;if(U=I-B,n.offset>U){if(U=n.offset-U,U>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=O;break}U>n.wnext?(U-=n.wnext,q=n.wsize-U):q=n.wnext-U,U>n.length&&(U=n.length),W=n.window}else W=M,q=$-n.offset,U=n.length;U>B&&(U=B),B-=U,n.length-=U;do{M[$++]=W[q++]}while(--U);0===n.length&&(n.mode=A);break;case 16205:if(0===B)break e;M[$++]=n.length,B--,n.mode=A;break;case E:if(n.wrap){for(;z<32;){if(0===N)break e;N--,T|=S[j++]<{if(F(e))return h;let t=e.state;return t.window&&(t.window=null),e.state=null,c},e.exports.inflateGetHeader=(e,t)=>{if(F(e))return h;const n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,c):h},e.exports.inflateSetDictionary=(e,t)=>{const n=t.length;let i,o,a;return F(e)?h:(i=e.state,0!==i.wrap&&i.mode!==b?h:i.mode===b&&(o=1,o=r(o,t,n,0),o!==i.check)?p:(a=P(e,t,n,n),a?(i.mode=D,g):(i.havedict=1,c)))},e.exports.inflateInfo="pako inflate (from Nodeca project)"},998:e=>{"use strict";const t=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),n=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),r=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),i=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);e.exports=(e,o,a,s,u,l,c,f)=>{const d=f.bits;let h,p,g,m,y,v,b=0,x=0,_=0,w=0,k=0,A=0,E=0,O=0,D=0,C=0,S=null;const F=new Uint16Array(16),M=new Uint16Array(16);let j,$,N,B=null;for(b=0;b<=15;b++)F[b]=0;for(x=0;x=1&&0===F[w];w--);if(k>w&&(k=w),0===w)return u[l++]=20971520,u[l++]=20971520,f.bits=1,0;for(_=1;_0&&(0===e||1!==w))return-1;for(M[1]=0,b=1;b<15;b++)M[b+1]=M[b]+F[b];for(x=0;x852||2===e&&D>592)return 1;for(;;){j=b-E,c[x]+1=v?($=B[c[x]-v],N=S[c[x]-v]):($=96,N=0),h=1<>E)+p]=j<<24|$<<16|N}while(0!==p);for(h=1<>=1;if(0!==h?(C&=h-1,C+=h):C=0,x++,0==--F[b]){if(b===w)break;b=o[a+c[x]]}if(b>k&&(C&m)!==g){for(0===E&&(E=k),y+=_,A=b-E,O=1<852||2===e&&D>592)return 1;g=C&m,u[g]=k<<24|A<<16|y-l}}return 0!==C&&(u[y+C]=b-E<<24|64<<16),f.bits=k,0}},674:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},665:e=>{"use strict";function t(e){let t=e.length;for(;--t>=0;)e[t]=0}const n=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),r=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),o=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=new Array(576);t(a);const s=new Array(60);t(s);const u=new Array(512);t(u);const l=new Array(256);t(l);const c=new Array(29);t(c);const f=new Array(30);function d(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let h,p,g;function m(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}t(f);const y=e=>e<256?u[e]:u[256+(e>>>7)],v=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},b=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<{b(e,n[2*t],n[2*t+1])},_=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},w=(e,t,n)=>{const r=new Array(16);let i,o,a=0;for(i=1;i<=15;i++)a=a+n[i-1]<<1,r[i]=a;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=_(r[t]++,t))}},k=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},A=e=>{e.bi_valid>8?v(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},E=(e,t,n,r)=>{const i=2*t,o=2*n;return e[i]{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i{let o,a,s,u,d=0;if(0!==e.sym_next)do{o=255&e.pending_buf[e.sym_buf+d++],o+=(255&e.pending_buf[e.sym_buf+d++])<<8,a=e.pending_buf[e.sym_buf+d++],0===o?x(e,a,t):(s=l[a],x(e,s+256+1,t),u=n[s],0!==u&&(a-=c[s],b(e,a,u)),o--,s=y(o),x(e,s,i),u=r[s],0!==u&&(o-=f[s],b(e,o,u)))}while(d{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,s,u,l=-1;for(e.heap_len=0,e.heap_max=573,a=0;a>1;a>=1;a--)O(e,n,a);u=o;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],O(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,n[2*u]=n[2*a]+n[2*s],e.depth[u]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,n[2*a+1]=n[2*s+1]=u,e.heap[1]=u++,O(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length;let l,c,f,d,h,p,g=0;for(d=0;d<=15;d++)e.bl_count[d]=0;for(n[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],d=n[2*n[2*c+1]+1]+1,d>u&&(d=u,g++),n[2*c+1]=d,c>r||(e.bl_count[d]++,h=0,c>=s&&(h=a[c-s]),p=n[2*c],e.opt_len+=p*(d+h),o&&(e.static_len+=p*(i[2*c+1]+h)));if(0!==g){do{for(d=u-1;0===e.bl_count[d];)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(d=u;0!==d;d--)for(c=e.bl_count[d];0!==c;)f=e.heap[--l],f>r||(n[2*f+1]!==d&&(e.opt_len+=(d-n[2*f+1])*n[2*f],n[2*f+1]=d),c--)}})(e,t),w(n,l,e.bl_count)},S=(e,t,n)=>{let r,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s{let r,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s{b(e,0+(r?1:0),3),A(e),v(e,n),v(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n};e.exports._tr_init=e=>{M||((()=>{let e,t,o,m,y;const v=new Array(16);for(o=0,m=0;m<28;m++)for(c[m]=o,e=0;e<1<>=7;m<30;m++)for(f[m]=y<<7,e=0;e<1<{let i,u,l=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),C(e,e.l_desc),C(e,e.d_desc),l=(e=>{let t;for(S(e,e.dyn_ltree,e.l_desc.max_code),S(e,e.dyn_dtree,e.d_desc.max_code),C(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*o[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,u=e.static_len+3+7>>>3,u<=i&&(i=u)):i=u=n+5,n+4<=i&&-1!==t?j(e,t,n,r):4===e.strategy||u===i?(b(e,2+(r?1:0),3),D(e,a,s)):(b(e,4+(r?1:0),3),((e,t,n,r)=>{let i;for(b(e,t-257,5),b(e,n-1,5),b(e,r-4,4),i=0;i(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(l[n]+256+1)]++,e.dyn_dtree[2*y(t)]++),e.sym_next===e.sym_end),e.exports._tr_align=e=>{b(e,2,3),x(e,256,a),(e=>{16===e.bi_valid?(v(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}},442:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},156:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.version=t.VegaWidget=t.VegaWidgetModel=t.vegaEmbed=void 0,t.render=function(e,t,n,r,i){const a=function(e,t){for(let n=0;n-1&&s>-1)return;const l=document.getElementById(e.substring(1));(0,o.default)(l,t,Object.assign(Object.assign({loader:{http:{credentials:"same-origin"}}},r),{mode:n})).then((t=>{t.view.toImageURL("png").then((t=>{if(void 0!==i){const n={data:{"image/png":t.split(",")[1]},metadata:{"jupyter-vega":e},output_type:"display_data"};i.outputs.push(n)}})).catch((e=>u(l,e)))})).catch((e=>u(l,e)))};const o=n(690);var a=n(690);Object.defineProperty(t,"vegaEmbed",{enumerable:!0,get:function(){return a.default}});var s=n(110);function u(e,t){throw e.innerHTML=`
\n

Javascript Error: ${t.message}

\n

This usually means there's a typo in your chart specification.\n See the JavaScript console for the full traceback.

\n
`,t}Object.defineProperty(t,"VegaWidgetModel",{enumerable:!0,get:function(){return s.VegaWidgetModel}}),Object.defineProperty(t,"VegaWidget",{enumerable:!0,get:function(){return s.VegaWidget}}),t.version=n(330).version,i(n(110),t)},672:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MODULE_NAME=t.MODULE_VERSION=void 0;const r=n(330);t.MODULE_VERSION=r.version,t.MODULE_NAME=r.name},110:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.VegaWidget=t.VegaWidgetModel=void 0;const i=n(55),o=n(672),a=n(156),s=n(655),u=n(452);class l extends i.DOMWidgetModel{constructor(){super(...arguments),this.viewInstance=null}defaults(){return Object.assign(Object.assign({},i.DOMWidgetModel.prototype.defaults()),{_model_name:"VegaWidgetModel",_view_name:"VegaWidget",_spec_source:"",_opt_source:"",_df:s([]),_img_url:"",_columns:[]})}}t.VegaWidgetModel=l,l.serializers=Object.assign(Object.assign({},i.DOMWidgetModel.serializers),{_img_url:{serialize:function(e,t){if(null===t.viewInstance||void 0===t.viewInstance.viewElement||!1===t.viewInstance.hasBeenUpdated)return e;let n=t.viewInstance.viewElement.id;""!==n&&void 0!==n||(n="VEGA_ID_"+crypto.randomUUID(),t.viewInstance.viewElement.id=n);let r=document.querySelector(`#${n} canvas`);return null===r?e:JSON.stringify({width:r.style.width||r.width,height:r.style.height||r.height,url:r.toDataURL()})}},_df:u.table_serialization}),l.model_name="VegaWidgetModel",l.model_module=o.MODULE_NAME,l.model_module_version=o.MODULE_VERSION,l.view_name="VegaWidget",l.view_module=o.MODULE_NAME,l.view_module_version=o.MODULE_VERSION;class c extends i.DOMWidgetView{constructor(){super(...arguments),this.hasBeenUpdated=!1,this.viewElement=document.createElement("div"),this.errorElement=document.createElement("div")}render(){return r(this,void 0,void 0,(function*(){this.el.appendChild(this.viewElement),this.errorElement.style.color="red",this.el.appendChild(this.errorElement),this.model.viewInstance=this;const e=()=>r(this,void 0,void 0,(function*(){const e=JSON.parse(this.model.get("_spec_source")),t=JSON.parse(this.model.get("_opt_source")||"{}"),n=this.model.get("_img_url");if(""!==n&&"null"!==n){let e=JSON.parse(n),t=document.createElement("img");t.src=e.url;let r=parseInt(e.height);r>0&&(t.height=r);let i=parseInt(e.width);return i>0&&(t.width=i),this.viewElement.appendChild(t),void this.model.set("_img_url","null")}if(null!=e)try{const n=yield(0,a.vegaEmbed)(this.viewElement,e,Object.assign({loader:{http:{credentials:"same-origin"}}},t));this.result&&this.result.finalize(),this.result=n,this.send({type:"display"})}catch(e){this.result&&this.result.finalize(),console.error(e)}})),t=(e,t)=>r(this,void 0,void 0,(function*(){const n=this.result;if(null==n)throw new Error("Internal error: no view attached to widget");const r=new Function("datum",`return (${e.remove||"false"})`);let i=e.insert||[];switch(i){case"@dataframe":i=this.updateDataFrame();break;case"@array2d":i=this.updateArray2D()}const o=n.view.changeset().remove(r).insert(i),a=n.view.change(e.key,o);t&&a.resize(),yield a.runAsync()})),n=e=>r(this,void 0,void 0,(function*(){this.hasBeenUpdated=!0;for(const n of e.updates)yield t(n,e.resize)}));this.model.on("change:_spec_source",e),this.model.on("change:_opt_source",e),this.model.on("msg:custom",(e=>{const t=function(e){return"update"!=e.type?null:e}(e);null!=t&&n(t).catch((e=>{this.errorElement.textContent=String(e),console.error(e)}))})),yield e()}))}updateDataFrame(){const e=this.model.get("_df"),t=(0,u.rowProxy)(e),n=Array(e.size);for(let e=0;e{"use strict";e.exports=function(e,t,n){return 0===e.length?e:t?(n||e.sort(t),function(e,t){for(var n=1,r=e.length,i=e[0],o=e[0],a=1;a=48&&t<=57))return!1;n++}return!0}function d(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function h(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function p(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,n=e.length;t0&&"constructor"==s[l-1]))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&void 0===p&&(void 0===u[g]?p=s.slice(0,l).join("/"):l==d-1&&(p=t.path),void 0!==p&&m(t,0,e,p)),l++,Array.isArray(u)){if("-"===g)g=u.length;else{if(n&&!f(g))throw new y("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);f(g)&&(g=~~g)}if(l>=d){if(n&&"add"===t.op&&g>u.length)throw new y("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);if(!1===(a=x[t.op].call(t,u,g,e)).test)throw new y("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(l>=d){if(!1===(a=b[t.op].call(t,u,g,e)).test)throw new y("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}if(u=u[g],n&&l0)throw new y('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new y("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new y("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&p(e.value))throw new y("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n)if("add"==e.op){var i=e.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new y("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==r)throw new y("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if("move"===e.op||"copy"===e.op){var a=E([{op:"_get",path:e.from,value:void 0}],n);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new y("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}function E(e,t,n){try{if(!Array.isArray(e))throw new y("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)k(c(t),c(e),n||!0);else{n=n||A;for(var r=0;r0&&(e.patches=[],e.callback&&e.callback(r)),r}function j(e,t,n,r,i){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var o=l(t),a=l(e),s=!1,f=a.length-1;f>=0;f--){var h=e[g=a[f]];if(!u(t,g)||void 0===t[g]&&void 0!==h&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:"test",path:r+"/"+d(g),value:c(h)}),n.push({op:"remove",path:r+"/"+d(g)}),s=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}));else{var p=t[g];"object"==typeof h&&null!=h&&"object"==typeof p&&null!=p&&Array.isArray(h)===Array.isArray(p)?j(h,p,n,r+"/"+d(g),i):h!==p&&(i&&n.push({op:"test",path:r+"/"+d(g),value:c(h)}),n.push({op:"replace",path:r+"/"+d(g),value:c(p)}))}}if(s||o.length!=a.length)for(f=0;f0)return[m,n+l.join(",\n"+p),s].join("\n"+o)}return y}(e,"",0)}));var z=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}};const R=Object.freeze({loose:!0}),P=Object.freeze({});var L=e=>e?"object"!=typeof e?R:e:P,I={exports:{}};var U={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},q="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=U,o=q,a=(t=e.exports={}).re=[],s=t.safeRe=[],u=t.src=[],l=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",i],[f,r]],h=(e,t,n)=>{const r=(e=>{for(const[t,n]of d)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),i=c++;o(e,i,t),l[e]=i,u[i]=t,a[i]=new RegExp(t,n?"g":void 0),s[i]=new RegExp(r,n?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),h("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${f}+`),h("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),h("FULL",`^${u[l.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),h("LOOSE",`^${u[l.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),h("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?`+`(?:${u[l.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",u[l.COERCE],!0),h("COERCERTLFULL",u[l.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",h("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",h("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(I,I.exports);var W=I.exports;const H=/^[0-9]+$/,G=(e,t)=>{const n=H.test(e),r=H.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:eG(t,e)};const Y=q,{MAX_LENGTH:X,MAX_SAFE_INTEGER:Z}=U,{safeRe:J,t:K}=W,Q=L,{compareIdentifiers:ee}=V;var te=class e{constructor(t,n){if(n=Q(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>X)throw new TypeError(`version is longer than ${X} characters`);Y("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=t.trim().match(n.loose?J[K.LOOSE]:J[K.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Z||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Z||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Z||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===ee(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const ne=te,re=(e,t,n)=>new ne(e,n).compare(new ne(t,n)),ie=re,oe=re,ae=re,se=re,ue=re,le=re;var ce,fe,de,he,pe=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return((e,t,n)=>0===ie(e,t,n))(e,n,r);case"!=":return((e,t,n)=>0!==oe(e,t,n))(e,n,r);case">":return((e,t,n)=>ae(e,t,n)>0)(e,n,r);case">=":return((e,t,n)=>se(e,t,n)>=0)(e,n,r);case"<":return((e,t,n)=>ue(e,t,n)<0)(e,n,r);case"<=":return((e,t,n)=>le(e,t,n)<=0)(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};function ge(){if(he)return de;he=1;class e{constructor(t,i){if(i=n(i),t instanceof e)return t.loose===!!i.loose&&t.includePrerelease===!!i.includePrerelease?t:new e(t.raw,i);if(t instanceof r)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!h(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&p(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const n=((this.options.includePrerelease&&f)|(this.options.loose&&d))+":"+e,o=t.get(n);if(o)return o;const p=this.options.loose,g=p?a[s.HYPHENRANGELOOSE]:a[s.HYPHENRANGE];e=e.replace(g,O(this.options.includePrerelease)),i("hyphen replace",e),e=e.replace(a[s.COMPARATORTRIM],u),i("comparator trim",e),e=e.replace(a[s.TILDETRIM],l),i("tilde trim",e),e=e.replace(a[s.CARETTRIM],c),i("caret trim",e);let y=e.split(" ").map((e=>m(e,this.options))).join(" ").split(/\s+/).map((e=>E(e,this.options)));p&&(y=y.filter((e=>(i("loose invalid filter",e,this.options),!!e.match(a[s.COMPARATORLOOSE]))))),i("range list",y);const v=new Map,b=y.map((e=>new r(e,this.options)));for(const e of b){if(h(e))return[e];v.set(e.value,e)}v.size>1&&v.has("")&&v.delete("");const x=[...v.values()];return t.set(n,x),x}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>g(e,n)&&t.set.some((t=>g(t,n)&&e.every((e=>t.every((t=>e.intersects(t,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new o(e,this.options)}catch(e){return!1}for(let t=0;t")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(o(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(o(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}ce=t;const n=L,{safeRe:r,t:i}=W,o=pe,a=q,s=te,u=ge();return ce}(),i=q,o=te,{safeRe:a,t:s,comparatorTrimReplace:u,tildeTrimReplace:l,caretTrimReplace:c}=W,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:d}=U,h=e=>"<0.0.0-0"===e.value,p=e=>""===e.value,g=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},m=(e,t)=>(i("comp",e,t),e=x(e,t),i("caret",e),e=v(e,t),i("tildes",e),e=w(e,t),i("xrange",e),e=A(e,t),i("stars",e),e),y=e=>!e||"x"===e.toLowerCase()||"*"===e,v=(e,t)=>e.trim().split(/\s+/).map((e=>b(e,t))).join(" "),b=(e,t)=>{const n=t.loose?a[s.TILDELOOSE]:a[s.TILDE];return e.replace(n,((t,n,r,o,a)=>{let s;return i("tilde",e,t,n,r,o,a),y(n)?s="":y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(o)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(i("replaceTilde pr",a),s=`>=${n}.${r}.${o}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${o} <${n}.${+r+1}.0-0`,i("tilde return",s),s}))},x=(e,t)=>e.trim().split(/\s+/).map((e=>_(e,t))).join(" "),_=(e,t)=>{i("caret",e,t);const n=t.loose?a[s.CARETLOOSE]:a[s.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,o,a,s)=>{let u;return i("caret",e,t,n,o,a,s),y(n)?u="":y(o)?u=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(a)?u="0"===n?`>=${n}.${o}.0${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.0${r} <${+n+1}.0.0-0`:s?(i("replaceCaret pr",s),u="0"===n?"0"===o?`>=${n}.${o}.${a}-${s} <${n}.${o}.${+a+1}-0`:`>=${n}.${o}.${a}-${s} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${a}-${s} <${+n+1}.0.0-0`):(i("no pr"),u="0"===n?"0"===o?`>=${n}.${o}.${a}${r} <${n}.${o}.${+a+1}-0`:`>=${n}.${o}.${a}${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${a} <${+n+1}.0.0-0`),i("caret return",u),u}))},w=(e,t)=>(i("replaceXRanges",e,t),e.split(/\s+/).map((e=>k(e,t))).join(" ")),k=(e,t)=>{e=e.trim();const n=t.loose?a[s.XRANGELOOSE]:a[s.XRANGE];return e.replace(n,((n,r,o,a,s,u)=>{i("xRange",e,n,r,o,a,s,u);const l=y(o),c=l||y(a),f=c||y(s),d=f;return"="===r&&d&&(r=""),u=t.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(c&&(a=0),s=0,">"===r?(r=">=",c?(o=+o+1,a=0,s=0):(a=+a+1,s=0)):"<="===r&&(r="<",c?o=+o+1:a=+a+1),"<"===r&&(u="-0"),n=`${r+o}.${a}.${s}${u}`):c?n=`>=${o}.0.0${u} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${a}.0${u} <${o}.${+a+1}.0-0`),i("xRange return",n),n}))},A=(e,t)=>(i("replaceStars",e,t),e.trim().replace(a[s.STAR],"")),E=(e,t)=>(i("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?s.GTE0PRE:s.GTE0],"")),O=e=>(t,n,r,i,o,a,s,u,l,c,f,d)=>`${n=y(r)?"":y(i)?`>=${r}.0.0${e?"-0":""}`:y(o)?`>=${r}.${i}.0${e?"-0":""}`:a?`>=${n}`:`>=${n}${e?"-0":""}`} ${u=y(l)?"":y(c)?`<${+l+1}.0.0-0`:y(f)?`<${l}.${+c+1}.0-0`:d?`<=${l}.${c}.${f}-${d}`:e?`<${l}.${c}.${+f+1}-0`:`<=${u}`}`.trim(),D=(e,t,n)=>{for(let n=0;n0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return de}const me=ge();var ye=N(((e,t,n)=>{try{t=new me(t,n)}catch(e){return!1}return t.test(e)}));var ve={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},be={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>ee<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},xe={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const _e=Array.prototype.slice,we=(e,t,n)=>{const r=n?n(t[0]):t[0];return r[e].apply(r,_e.call(t,1))};var ke={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:(e,t,n,r,i,o,a)=>new Date(e,t||0,null!=n?n:1,r||0,i||0,o||0,a||0),date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return we("join",arguments)},indexof:function(){return we("indexOf",arguments)},lastindexof:function(){return we("lastIndexOf",arguments)},slice:function(){return we("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return we("substring",arguments,String)},split:function(){return we("split",arguments,String)},replace:function(){return we("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const Ae=["view","item","group","xy","x","y"],Ee=new Set([Function,eval,setTimeout,setInterval]);"function"==typeof setImmediate&&Ee.add(setImmediate);const Oe={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:"datum"===n?e.datum:"event"===n?e.event:"item"===n?e.item:ve[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,r=e(t.object);n&&(e.memberDepth+=1);const i=e(t.property);if(n&&(e.memberDepth-=1),!Ee.has(r[i]))return r[i];console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`)},CallExpression:(e,t)=>{const n=t.arguments;let r=t.callee.name;return r.startsWith("_")&&(r=r.slice(1)),"if"===r?e(n[0])?e(n[1]):e(n[2]):(e.fn[r]||ke[r]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>be[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>xe[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>"&&"===t.operator?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce(((t,n)=>{e.memberDepth+=1;const r=e(n.key);return e.memberDepth-=1,Ee.has(e(n.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):t[r]=e(n.value),t}),{})};function De(e,t,n,r,i,o){const a=e=>Oe[e.type](a,e);return a.memberDepth=0,a.fn=Object.create(t),a.params=n,a.datum=r,a.event=i,a.item=o,Ae.forEach((e=>a.fn[e]=function(){return i.vega[e](...arguments)})),a(e)}var Ce={operator(e,t){const n=t.ast,r=e.functions;return e=>De(n,r,e)},parameter(e,t){const n=t.ast,r=e.functions;return(e,t)=>De(n,r,t,e)},event(e,t){const n=t.ast,r=e.functions;return e=>De(n,r,void 0,void 0,e)},handler(e,t){const n=t.ast,r=e.functions;return(e,t)=>{const i=t.item&&t.item.datum;return De(n,r,e,i,t)}},encode(e,t){const{marktype:n,channels:r}=t,i=e.functions,o="group"===n||"image"===n||"rect"===n;return(e,t)=>{const a=e.datum;let s,u=0;for(const n in r)s=De(r[n].ast,i,t,a,void 0,e),e[n]!==s&&(e[n]=s,u=1);return"rule"!==n&&function(e,t,n){let r;t.x2&&(t.x?(n&&e.x>e.x2&&(r=e.x,e.x=e.x2,e.x2=r),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(r=e.y,e.y=e.y2,e.y2=r),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}(e,r,o),u}}};function Se(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}const Fe="#fff",Me="#888",je={background:"#333",view:{stroke:Me},title:{color:Fe,subtitleColor:Fe},style:{"guide-label":{fill:Fe},"guide-title":{fill:Fe}},axis:{domainColor:Fe,gridColor:Me,tickColor:Fe}},$e="#4572a7",Ne={background:"#fff",arc:{fill:$e},area:{fill:$e},line:{stroke:$e,strokeWidth:2},path:{stroke:$e},rect:{fill:$e},shape:{stroke:$e},symbol:{fill:$e,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},Be="#30a2da",Te="#cbcbcb",ze="#f0f0f0",Re="#333",Pe={arc:{fill:Be},area:{fill:Be},axis:{domainColor:Te,grid:!0,gridColor:Te,gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:Te,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:ze,group:{fill:ze},legend:{labelColor:Re,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:Re,titleFontSize:14,titlePadding:10},line:{stroke:Be,strokeWidth:2},path:{stroke:Be,strokeWidth:.5},rect:{fill:Be},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:Be},bar:{binSpacing:2,fill:Be,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Le="#000",Ie={group:{fill:"#e5e5e5"},arc:{fill:Le},area:{fill:Le},line:{stroke:Le},path:{stroke:Le},rect:{fill:Le},shape:{stroke:Le},symbol:{fill:Le,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},Ue="Benton Gothic, sans-serif",qe="#82c6df",We="Benton Gothic Bold, sans-serif",He="normal",Ge={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},Ve={background:"#ffffff",title:{anchor:"start",color:"#000000",font:We,fontSize:22,fontWeight:"normal"},arc:{fill:qe},area:{fill:qe},line:{stroke:qe,strokeWidth:2},path:{stroke:qe},rect:{fill:qe},shape:{stroke:qe},symbol:{fill:qe,size:30},axis:{labelFont:Ue,labelFontSize:11.5,labelFontWeight:"normal",titleFont:We,titleFontSize:13,titleFontWeight:He},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:Ue,labelFontSize:11.5,symbolType:"square",titleFont:We,titleFontSize:13,titleFontWeight:He},range:{category:Ge["category-6"],diverging:Ge["fireandice-6"],heatmap:Ge["fire-7"],ordinal:Ge["fire-7"],ramp:Ge["fire-7"]}},Ye="#ab5787",Xe="#979797",Ze={background:"#f9f9f9",arc:{fill:Ye},area:{fill:Ye},line:{stroke:Ye},path:{stroke:Ye},rect:{fill:Ye},shape:{stroke:Ye},symbol:{fill:Ye,size:30},axis:{domainColor:Xe,domainWidth:.5,gridWidth:.2,labelColor:Xe,tickColor:Xe,tickWidth:.2,titleColor:Xe},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},Je="#3e5c69",Ke={background:"#fff",arc:{fill:Je},area:{fill:Je},line:{stroke:Je},path:{stroke:Je},rect:{fill:Je},shape:{stroke:Je},symbol:{fill:Je},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},Qe="#1696d2",et="#000000",tt="Lato",nt="Lato",rt={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},it={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:tt},axisX:{domain:!0,domainColor:et,domainWidth:1,grid:!1,labelFontSize:12,labelFont:nt,labelAngle:0,tickColor:et,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:tt},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:nt,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:tt,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:nt,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:tt,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:rt["six-groups-cat-1"],diverging:rt["diverging-colors"],heatmap:rt["diverging-colors"],ordinal:rt["six-groups-seq"],ramp:rt["shades-blue"]},area:{fill:Qe},rect:{fill:Qe},line:{color:Qe,stroke:Qe,strokeWidth:5},trail:{color:Qe,stroke:Qe,strokeWidth:0,size:1},path:{stroke:Qe,strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:Qe,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:Qe,stroke:null}},arc:{fill:Qe},shape:{stroke:Qe},symbol:{fill:Qe,size:30}},ot="#3366CC",at="#ccc",st="Arial, sans-serif",ut={arc:{fill:ot},area:{fill:ot},path:{stroke:ot},rect:{fill:ot},shape:{stroke:ot},symbol:{stroke:ot},circle:{fill:ot},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:st,fontSize:12},"guide-title":{font:st,fontSize:12},"group-title":{font:st,fontSize:12}},title:{font:st,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:at,tickColor:at,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},lt=e=>e*(1/3+1),ct=lt(9),ft=lt(10),dt=lt(12),ht="Segoe UI",pt="wf_standard-font, helvetica, arial, sans-serif",gt="#252423",mt="#605E5C",yt="transparent",vt="#118DFF",bt="#DEEFFF",xt=[bt,vt],_t={view:{stroke:yt},background:yt,font:ht,header:{titleFont:pt,titleFontSize:dt,titleColor:gt,labelFont:ht,labelFontSize:ft,labelColor:mt},axis:{ticks:!1,grid:!1,domain:!1,labelColor:mt,labelFontSize:ct,titleFont:pt,titleColor:gt,titleFontSize:dt,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:"#C8C6C4",gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:vt},line:{stroke:vt,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:ht,fontSize:ct,fill:mt},arc:{fill:vt},area:{fill:vt,line:!0,opacity:.6},path:{stroke:vt},rect:{fill:vt},point:{fill:vt,filled:!0,size:75},shape:{stroke:vt},symbol:{fill:vt,strokeWidth:1.5,size:50},legend:{titleFont:ht,titleFontWeight:"bold",titleColor:mt,labelFont:ht,labelFontSize:ft,labelColor:mt,symbolType:"circle",symbolSize:75},range:{category:[vt,"#12239E","#E66C37","#6B007B","#E044A7","#744EC2","#D9B300","#D64550"],diverging:xt,heatmap:xt,ordinal:[bt,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",vt]}},wt='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',kt={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},At=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],Et=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function Ot({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",r=kt.gridBg[e],i=kt.textPrimary[e],o=kt.textSecondary[e],a="dark"===n?At:Et,s="dark"===n?"#d4bbff":"#6929c4";return{background:t,arc:{fill:s},area:{fill:s},path:{stroke:s},rect:{fill:s},shape:{stroke:s},symbol:{stroke:s},circle:{fill:s},view:{fill:r,stroke:r},group:{fill:r},title:{color:i,anchor:"start",dy:-15,fontSize:16,font:wt,fontWeight:600},axis:{labelColor:o,labelFontSize:12,labelFont:'IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',labelFontWeight:400,titleColor:i,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:kt.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:wt,fill:o,fontWeight:400},"guide-title":{font:wt,fill:o,fontWeight:400}},range:{category:a,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const Dt=Ot({theme:"white",background:"#ffffff"}),Ct=Ot({theme:"g10",background:"#f4f4f4"}),St=Ot({theme:"g90",background:"#262626"}),Ft=Ot({theme:"g100",background:"#161616"});var Mt=Object.freeze({__proto__:null,carbong10:Ct,carbong100:Ft,carbong90:St,carbonwhite:Dt,dark:je,excel:Ne,fivethirtyeight:Pe,ggplot2:Ie,googlecharts:ut,latimes:Ve,powerbi:_t,quartz:Ze,urbaninstitute:it,version:"2.15.0",vox:Ke});function jt(e,t,n){return e.fields=t||[],e.fname=n,e}const $t=e=>function(t){return t[e]},Nt=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),s=r=i+1):"]"===o&&(s||Bt("Access path missing open bracket: "+e),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&Bt("Access path missing closing bracket: "+e),a&&Bt("Access path missing closing quote: "+e),i>r&&(i++,l()),t}(e);e=1===t.length?t[0]:e,jt(function(e){return 1===e.length?$t(e[0]):Nt(e)}(t),[e],e)})("id"),jt((e=>e),[],"identity"),jt((()=>0),[],"zero"),jt((()=>1),[],"one"),jt((()=>!0),[],"true"),jt((()=>!1),[],"false");var Tt=Array.isArray;function zt(e){return e===Object(e)}function Rt(e,t){return JSON.stringify(e,function(e){const t=[];return function(n,r){if("object"!=typeof r||null===r)return r;const i=t.indexOf(this)+1;return t.length=i,t.length>e?"[Object]":t.indexOf(r)>=0?"[Circular]":(t.push(r),r)}}(t))}const Pt="vg-tooltip-element",Lt={offsetX:10,offsetY:10,id:Pt,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(e){return String(e).replace(/&/g,"&").replace(/t("string"==typeof e?e:Rt(e,n)))).join(", ")}]`;if(zt(e)){let i="";const{title:o,image:a,...s}=e;o&&(i+=`

${t(o)}

`),a&&(i+=``);const u=Object.keys(s);if(u.length>0){i+="";for(const e of u){let r=s[e];void 0!==r&&(zt(r)&&(r=Rt(r,n)),i+=``)}i+="
${t(e)}${t(r)}
"}return i||"{}"}return t(e)},baseURL:""};class It{constructor(e){this.options={...Lt,...e};const t=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const e=document.createElement("style");e.setAttribute("id",this.options.styleId),e.innerHTML=function(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return"#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black;\n}\n#vg-tooltip-element.visible {\n visibility: visible;\n}\n#vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px;\n}\n#vg-tooltip-element table {\n border-spacing: 0;\n}\n#vg-tooltip-element table tr {\n border: none;\n}\n#vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px;\n}\n#vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px;\n}\n#vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left;\n}\n#vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white;\n}\n#vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf;\n}\n".toString().replace(Pt,e)}(t);const n=document.head;n.childNodes.length>0?n.insertBefore(e,n.childNodes[0]):n.appendChild(e)}}tooltipHandler(e,t,n,r){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),null==r||""===r)return void this.el.classList.remove("visible",`${this.options.theme}-theme`);this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:i,y:o}=function(e,t,n,r){let i=e.clientX+n;i+t.width>window.innerWidth&&(i=+e.clientX-n-t.width);let o=e.clientY+r;return o+t.height>window.innerHeight&&(o=+e.clientY-r-t.height),{x:i,y:o}}(t,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${o}px`,this.el.style.left=`${i}px`}}var Ut='.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box;\n}\n.vega-embed.has-actions {\n padding-right: 38px;\n}\n.vega-embed details:not([open]) > :not(summary) {\n display: none !important;\n}\n.vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n cursor: pointer;\n line-height: 0px;\n}\n.vega-embed summary::-webkit-details-marker {\n display: none;\n}\n.vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset;\n}\n.vega-embed summary svg {\n width: 14px;\n height: 14px;\n}\n.vega-embed details[open] summary {\n opacity: 0.7;\n}\n.vega-embed:hover summary, .vega-embed:focus-within summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease;\n}\n.vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left;\n}\n.vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none;\n}\n.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {\n background-color: #f7f7f9;\n color: black;\n}\n.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute;\n}\n.vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid rgba(0, 0, 0, 0);\n border-bottom-color: #d9d9d9;\n}\n.vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid rgba(0, 0, 0, 0);\n border-bottom-color: #fff;\n}\n.vega-embed .chart-wrapper.fit-x {\n width: 100%;\n}\n.vega-embed .chart-wrapper.fit-y {\n height: 100%;\n}\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: auto;\n padding-right: 14px;\n}\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n';function qt(e,...t){for(const n of t)Wt(e,n);return e}function Wt(t,n){for(const r of Object.keys(n))e.writeConfig(t,r,n[r],!0)}const Ht="6.26.0",Gt=i;let Vt=o;const Yt="undefined"!=typeof window?window:void 0;void 0===Vt&&Yt?.vl?.compile&&(Vt=Yt.vl);const Xt={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},Zt={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},Jt={vega:"Vega","vega-lite":"Vega-Lite"},Kt={vega:Gt.version,"vega-lite":Vt?Vt.version:"not available"},Qt={vega:e=>e,"vega-lite":(e,t)=>Vt.compile(e,{config:t}).spec},en='\n\n \n \n \n',tn="chart-wrapper";function nn(e,t,n,r){const i=`${t}
`,o=`
${n}`,a=window.open("");a.document.write(i+e+o),a.document.title=`${Jt[r]} JSON Source`}function rn(e){return!(!e||!("load"in e))}function on(e){return rn(e)?e:Gt.loader(e)}async function an(t,n,r={}){let i,o;e.isString(n)?(o=on(r.loader),i=JSON.parse(await o.load(n))):i=n;const a=function(t){const n=t.usermeta?.embedOptions??{};return e.isString(n.defaultStyle)&&(n.defaultStyle=!1),n}(i),s=a.loader;o&&!s||(o=on(r.loader??s));const u=await sn(a,o),l=await sn(r,o),c={...qt(l,u),config:e.mergeConfig(l.config??{},u.config??{})};return await async function(t,n,r={},i){const o=r.theme?e.mergeConfig(Mt[r.theme],r.config??{}):r.config,a=e.isBoolean(r.actions)?r.actions:qt({},Xt,r.actions??{}),s={...Zt,...r.i18n},u=r.renderer??"canvas",l=r.logLevel??Gt.Warn,c=r.downloadFileName??"visualization",f="string"==typeof t?document.querySelector(t):t;if(!f)throw new Error(`${t} does not exist`);if(!1!==r.defaultStyle){const e="vega-embed-style",{root:t,rootContainer:n}=function(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}(f);if(!t.getElementById(e)){const t=document.createElement("style");t.id=e,t.innerHTML=void 0===r.defaultStyle||!0===r.defaultStyle?Ut.toString():r.defaultStyle,n.appendChild(t)}}const d=function(e,t){if(e.$schema){const n=Se(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${Jt[n.library]}, but mode argument sets ${Jt[t]??t}.`);const r=n.library;return ye(Kt[r],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${Jt[r]} ${n.version}, but the current version of ${Jt[r]} is v${Kt[r]}.`),r}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t??"vega"}(n,r.mode);let h=Qt[d](n,o);if("vega-lite"===d&&h.$schema){const e=Se(h.$schema);ye(Kt.vega,`^${e.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${e.version}, but current version is v${Kt.vega}.`)}f.classList.add("vega-embed"),a&&f.classList.add("has-actions"),f.innerHTML="";let p=f;if(a){const e=document.createElement("div");e.classList.add(tn),f.appendChild(e),p=e}const g=r.patch;if(g&&(h=g instanceof Function?g(h):k(h,g,!0,!1).newDocument),r.formatLocale&&Gt.formatLocale(r.formatLocale),r.timeFormatLocale&&Gt.timeFormatLocale(r.timeFormatLocale),r.expressionFunctions)for(const e in r.expressionFunctions){const t=r.expressionFunctions[e];"fn"in t?Gt.expressionFunction(e,t.fn,t.visitor):t instanceof Function&&Gt.expressionFunction(e,t)}const{ast:m}=r,y=Gt.parse(h,"vega-lite"===d?{}:o,{ast:m}),v=new(r.viewClass||Gt.View)(y,{loader:i,logLevel:l,renderer:u,...m?{expr:Gt.expressionInterpreter??r.expr??Ce}:{}});if(v.addSignalListener("autosize",((e,t)=>{const{type:n}=t;"fit-x"==n?(p.classList.add("fit-x"),p.classList.remove("fit-y")):"fit-y"==n?(p.classList.remove("fit-x"),p.classList.add("fit-y")):"fit"==n?p.classList.add("fit-x","fit-y"):p.classList.remove("fit-x","fit-y")})),!1!==r.tooltip){const{loader:e,tooltip:t}=r,n=e&&!rn(e)?e?.baseURL:void 0,i="function"==typeof t?t:new It({baseURL:n,...!0===t?{}:t}).call;v.tooltip(i)}let b,{hover:x}=r;if(void 0===x&&(x="vega"===d),x){const{hoverSet:e,updateSet:t}="boolean"==typeof x?{}:x;v.hover(e,t)}if(r&&(null!=r.width&&v.width(r.width),null!=r.height&&v.height(r.height),null!=r.padding&&v.padding(r.padding)),await v.initialize(p,r.bind).runAsync(),!1!==a){let t=f;if(!1!==r.defaultStyle||r.forceActionsMenu){const e=document.createElement("details");e.title=s.CLICK_TO_VIEW_ACTIONS,f.append(e),t=e;const n=document.createElement("summary");n.innerHTML=en,e.append(n),b=t=>{e.contains(t.target)||e.removeAttribute("open")},document.addEventListener("click",b)}const i=document.createElement("div");if(t.append(i),i.classList.add("vega-actions"),!0===a||!1!==a.export)for(const t of["svg","png"])if(!0===a||!0===a.export||a.export[t]){const n=s[`${t.toUpperCase()}_ACTION`],o=document.createElement("a"),a=e.isObject(r.scaleFactor)?r.scaleFactor[t]:r.scaleFactor;o.text=n,o.href="#",o.target="_blank",o.download=`${c}.${t}`,o.addEventListener("mousedown",(async function(e){e.preventDefault();const n=await v.toImageURL(t,a);this.href=n})),i.append(o)}if(!0===a||!1!==a.source){const e=document.createElement("a");e.text=s.SOURCE_ACTION,e.href="#",e.addEventListener("click",(function(e){nn(T(n),r.sourceHeader??"",r.sourceFooter??"",d),e.preventDefault()})),i.append(e)}if("vega-lite"===d&&(!0===a||!1!==a.compiled)){const e=document.createElement("a");e.text=s.COMPILED_ACTION,e.href="#",e.addEventListener("click",(function(e){nn(T(h),r.sourceHeader??"",r.sourceFooter??"","vega"),e.preventDefault()})),i.append(e)}if(!0===a||!1!==a.editor){const e=r.editorUrl??"https://vega.github.io/editor/",t=document.createElement("a");t.text=s.EDITOR_ACTION,t.href="#",t.addEventListener("click",(function(t){(function(e,t,n){const r=e.open(t),{origin:i}=new URL(t);let o=40;e.addEventListener("message",(function t(n){n.source===r&&(o=0,e.removeEventListener("message",t,!1))}),!1),setTimeout((function e(){o<=0||(r.postMessage(n,i),setTimeout(e,250),o-=1)}),250)})(window,e,{config:o,mode:g?"vega":d,renderer:u,spec:T(g?h:n)}),t.preventDefault()})),i.append(t)}}function _(){b&&document.removeEventListener("click",b),v.finalize()}return{view:v,spec:n,vgSpec:h,finalize:_,embedOptions:r}}(t,i,c,o)}async function sn(t,n){const r=e.isString(t.config)?JSON.parse(await n.load(t.config)):t.config??{},i=e.isString(t.patch)?JSON.parse(await n.load(t.patch)):t.patch;return{...t,...i?{patch:i}:{},...r?{config:r}:{}}}async function un(e,t={}){const n=document.createElement("div");n.classList.add("vega-embed-wrapper");const r=document.createElement("div");n.appendChild(r);const i=!0===t.actions||!1===t.actions?t.actions:{export:!0,source:!1,compiled:!0,editor:!0,...t.actions},o=await an(r,e,{actions:i,...t});return n.value=o.view,n}const ln=(...t)=>{return t.length>1&&(e.isString(t[0])&&!((n=t[0]).startsWith("http://")||n.startsWith("https://")||n.startsWith("//"))||t[0]instanceof HTMLElement||3===t.length)?an(t[0],t[1],t[2]):un(t[0],t[1]);var n};return ln.vegaLite=Vt,ln.vl=Vt,ln.container=un,ln.embed=an,ln.vega=Gt,ln.default=an,ln.version=Ht,ln}(n(190),n(208))},208:(e,t,n)=>{"use strict";n.r(t),n.d(t,{accessPathDepth:()=>me,accessPathWithDatum:()=>ce,compile:()=>Gg,contains:()=>W,deepEqual:()=>z,deleteNestedProperty:()=>ue,duplicate:()=>R,entries:()=>ie,every:()=>G,fieldIntersection:()=>ee,flatAccessWithDatum:()=>fe,getFirstDefined:()=>ye,hasIntersection:()=>K,hash:()=>U,internalField:()=>_e,isBoolean:()=>oe,isEmpty:()=>te,isEqual:()=>Z,isInternalField:()=>we,isNullOrFalse:()=>q,isNumeric:()=>Ae,keys:()=>ne,logicalExpr:()=>se,mergeDeep:()=>V,normalize:()=>Eu,normalizeAngle:()=>ke,omit:()=>L,pick:()=>P,prefixGenerator:()=>Q,removePathFromField:()=>ge,replaceAll:()=>pe,replacePathInField:()=>he,resetIdCounter:()=>xe,setEqual:()=>J,some:()=>H,stringify:()=>I,titleCase:()=>le,unique:()=>X,uniqueId:()=>be,vals:()=>re,varName:()=>ae,version:()=>r.rE});const r={rE:"4.17.0"};function i(e,t,n){return e.fields=t||[],e.fname=n,e}function o(e){return 1===e.length?a(e[0]):s(e)}const a=e=>function(t){return t[e]},s=e=>{const t=e.length;return function(n){for(let r=0;rr&&c(),s=r=i+1):"]"===o&&(s||u("Access path missing open bracket: "+e),s>0&&c(),s=0,r=i+1):i>r?c():r=i+1}return s&&u("Access path missing closing bracket: "+e),a&&u("Access path missing closing quote: "+e),i>r&&(i++,c()),t}!function(e,t,n){const r=l(e);e=1===r.length?r[0]:e,i((n&&n.get||o)(r),[e],t||e)}("id");const c=i((e=>e),[],"identity");function f(e,t,n){const r=[t].concat([].slice.call(n));console[e].apply(console,r)}i((()=>0),[],"zero"),i((()=>1),[],"one"),i((()=>!0),[],"true"),i((()=>!1),[],"false");var d=Array.isArray;function h(e){return e===Object(e)}const p=e=>"__proto__"!==e;function g(...e){return e.reduce(((e,t)=>{for(const n in t)if("signals"===n)e.signals=y(e.signals,t.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;m(e,n,t[n],r)}return e}),{})}function m(e,t,n,r){if(!p(t))return;let i,o;if(h(n)&&!d(n))for(i in o=h(e[t])?e[t]:e[t]={},n)r&&(!0===r||r[i])?m(o,i,n[i]):p(i)&&(o[i]=n[i]);else e[t]=n}function y(e,t){if(null==e)return t;const n={},r=[];function i(e){n[e.name]||(n[e.name]=1,r.push(e))}return t.forEach(i),e.forEach(i),r}function v(e){return null!=e?d(e)?e:[e]:[]}const b=Object.prototype.hasOwnProperty;function x(e,t){return b.call(e,t)}function _(e){return"boolean"==typeof e}function w(e){return"number"==typeof e}function k(e){return"string"==typeof e}function A(e){return d(e)?"["+e.map(A)+"]":h(e)||k(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function E(e){const t={},n=e.length;for(let r=0;rT(e,t)))}:j(e)?{or:e.or.map((e=>T(e,t)))}:t(e)}const z=S(),R=D();function P(e,t){const n={};for(const r of t)x(e,r)&&(n[r]=e[r]);return n}function L(e,t){const n=Object.assign({},e);for(const e of t)delete n[e];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map((e=>M()(e))).join(",")})`};const I=M();function U(e){if(w(e))return e;const t=k(e)?e:M()(e);if(t.length<250)return t;let n=0;for(let e=0;e-1}function H(e,t){let n=0;for(const[r,i]of e.entries())if(t(i,r,n++))return!0;return!1}function G(e,t){let n=0;for(const[r,i]of e.entries())if(!t(i,r,n++))return!1;return!0}function V(e,...t){for(const n of t)Y(e,null!=n?n:{});return e}function Y(e,t){for(const n of ne(t))m(e,n,t[n],!0)}function X(e,t){const n=[],r={};let i;for(const o of e)i=t(o),i in r||(r[i]=1,n.push(o));return n}function Z(e,t){const n=ne(e),r=ne(t);if(n.length!==r.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function J(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function K(e,t){for(const n of e)if(t.has(n))return!0;return!1}function Q(e){const t=new Set;for(const n of e){const e=l(n).map(((e,t)=>0===t?e:`[${e}]`)),r=e.map(((t,n)=>e.slice(0,n+1).join("")));for(const e of r)t.add(e)}return t}function ee(e,t){return void 0===e||void 0===t||K(Q(e),Q(t))}function te(e){return 0===ne(e).length}const ne=Object.keys,re=Object.values,ie=Object.entries;function oe(e){return!0===e||!1===e}function ae(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function se(e,t){return N(e)?"!("+se(e.not,t)+")":$(e)?"("+e.and.map((e=>se(e,t))).join(") && (")+")":j(e)?"("+e.or.map((e=>se(e,t))).join(") || (")+")":t(e)}function ue(e,t){if(0===t.length)return!0;const n=t.shift();return n in e&&ue(e[n],t)&&delete e[n],te(e)}function le(e){return e.charAt(0).toUpperCase()+e.substr(1)}function ce(e,t="datum"){const n=l(e),r=[];for(let e=1;e<=n.length;e++){const i=`[${n.slice(0,e).map(A).join("][")}]`;r.push(`${t}${i}`)}return r.join(" && ")}function fe(e,t="datum"){return`${t}[${A(l(e).join("."))}]`}function de(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function he(e){return`${l(e).map(de).join("\\.")}`}function pe(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function ge(e){return`${l(e).join(".")}`}function me(e){return e?l(e).length:0}function ye(...e){for(const t of e)if(void 0!==t)return t}let ve=42;function be(e){const t=++ve;return e?String(e)+t:t}function xe(){ve=42}function _e(e){return we(e)?e:`__${e}`}function we(e){return 0===e.indexOf("__")}function ke(e){if(void 0!==e)return(e%360+360)%360}function Ae(e){return!!w(e)||!isNaN(e)&&!isNaN(parseFloat(e))}const Ee={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function Oe(e){return e&&e.condition}const De=["domain","grid","labels","ticks","title"],Ce={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"main",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},Se={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},Fe=Object.assign(Object.assign({},Se),{style:1,labelExpr:1,encoding:1});function Me(e){return!!Fe[e]}ne(Fe);const je=ne({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1}),$e={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},Ne={count:1,min:1,max:1};function Be(e){return!!e&&!!e.argmin}function Te(e){return!!e&&!!e.argmax}function ze(e){return k(e)&&!!$e[e]}ne($e);const Re=["count","valid","missing","distinct"];function Pe(e){return k(e)&&W(Re,e)}const Le=["count","sum","distinct","valid","missing"],Ie=E(["mean","average","median","q1","q3","min","max"]);var Ue=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);iTn(e[t])?ae(`_${t}_${ie(e[t])}`):ae(`_${t}_${e[t]}`))).join("")}function $n(e){return!0===e||Bn(e)&&!e.binned}function Nn(e){return"binned"===e||Bn(e)&&!0===e.binned}function Bn(e){return h(e)}function Tn(e){return null==e?void 0:e.selection}function zn(e){switch(e){case qe:case We:case ut:case it:case ot:case at:case ht:case ct:case ft:case dt:case st:return 6;case pt:return 4;default:return 10}}function Rn(e){return`Invalid specification ${JSON.stringify(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Pn='Autosize "fit" only works for single views and layered views.';function Ln(e){return("width"==e?"Width":"Height")+' "container" only works for single views and layered views.'}function In(e){return`${"width"==e?"Width":"Height"} "container" only works well with autosize "fit" or "fit-${"width"==e?"x":"y"}".`}function Un(e){return e?`Dropping "fit-${e}" because spec has discrete ${Vt(e)}.`:'Dropping "fit" because spec has discrete size.'}function qn(e){return`Unknown field for ${e}. Cannot calculate view size.`}function Wn(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function Hn(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Gn(e){return`Selection not supported for ${e} yet.`}function Vn(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}function Yn(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}function Xn(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Zn(e){return`Invalid field type "${e}".`}function Jn(e,t){const{fill:n,stroke:r}=t;return`Dropping color ${e} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function Kn(e,t){return`Dropping ${I(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}function Qn(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function er(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function tr(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${"ordinal"===t?"order":"magnitude"}.`}function nr(e){return`Using unaggregated domain with raw field has no effect (${I(e)}).`}function rr(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function ir(e){return`Unaggregated domain is currently unsupported for log scale (${I(e)}).`}function or(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function ar(e){return`The step for "${e}" is dropped because the ${"width"===e?"x":"y"} is continuous.`}const sr="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";function ur(e,t){return`Invalid ${e}: ${I(t)}.`}function lr(e){return`1D error band does not support ${e}.`}function cr(e){return`Channel ${e} is required for "binned" bin.`}const fr=function(){let e=2;return{level(t){return arguments.length?(e=+t,this):e},error(){return e>=1&&f("error","ERROR",arguments),this},warn(){return e>=2&&f("warn","WARN",arguments),this},info(){return e>=3&&f("log","INFO",arguments),this},debug(){return e>=4&&f("log","DEBUG",arguments),this}}}();let dr=fr;function hr(...e){dr.warn(...e)}function pr(e){if(e&&h(e))for(const t of kr)if(t in e)return!0;return!1}new WeakMap;const gr=["january","february","march","april","may","june","july","august","september","october","november","december"],mr=gr.map((e=>e.substr(0,3))),yr=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],vr=yr.map((e=>e.substr(0,3)));function br(e,t){const n=[];if(t&&void 0!==e.day&&ne(e).length>1&&(hr(function(e){return`Dropping day from datetime ${I(e)} as day cannot be combined with other units.`}(e)),delete(e=R(e)).day),void 0!==e.year?n.push(e.year):n.push(2012),void 0!==e.month){const r=t?function(e){if(Ae(e)&&(e=+e),w(e))return e-1;{const t=e.toLowerCase(),n=gr.indexOf(t);if(-1!==n)return n;const r=t.substr(0,3),i=mr.indexOf(r);if(-1!==i)return i;throw new Error(ur("month",e))}}(e.month):e.month;n.push(r)}else if(void 0!==e.quarter){const r=t?function(e){if(Ae(e)&&(e=+e),w(e))return e>4&&hr(ur("quarter",e)),e-1;throw new Error(ur("quarter",e))}(e.quarter):e.quarter;n.push(w(r)?3*r:r+"*3")}else n.push(0);if(void 0!==e.date)n.push(e.date);else if(void 0!==e.day){const r=t?function(e){if(Ae(e)&&(e=+e),w(e))return e%7;{const t=e.toLowerCase(),n=yr.indexOf(t);if(-1!==n)return n;const r=t.substr(0,3),i=vr.indexOf(r);if(-1!==i)return i;throw new Error(ur("day",e))}}(e.day):e.day;n.push(w(r)?r+1:r+"+1")}else n.push(1);for(const t of["hours","minutes","seconds","milliseconds"]){const r=e[t];n.push(void 0===r?0:r)}return n}function xr(e){const t=br(e,!0).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}var _r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0&&"seconds"===t&&"i"===e.charAt(n-1)||e.length>n+3&&"day"===t&&"o"===e.charAt(n+3)||n>0&&"year"===t&&"f"===e.charAt(n-1))}function Cr(e){if(!e)return;const t=Or(e);return`timeUnitSpecifier(${M()(t)}, ${M()(Er)})`}function Sr(e){if(!e)return;let t;return k(e)?t={unit:e}:h(e)&&(t=Object.assign(Object.assign({},e),e.unit?{unit:e.unit}:{})),Ar(t.unit)&&(t.utc=!0,t.unit=t.unit.substr(3)),t}function Fr(e){return e&&!!e.signal}function Mr(e){return!!e.step}function jr(e){return!d(e)&&"field"in e&&"data"in e}const $r=ne({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),Nr={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},Br=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function Tr(e){return e&&!!e.field&&void 0!==e.equal}function zr(e){return e&&!!e.field&&void 0!==e.lt}function Rr(e){return e&&!!e.field&&void 0!==e.lte}function Pr(e){return e&&!!e.field&&void 0!==e.gt}function Lr(e){return e&&!!e.field&&void 0!==e.gte}function Ir(e){if(e&&e.field){if(d(e.range)&&2===e.range.length)return!0;if(Fr(e.range))return!0}return!1}function Ur(e){return e&&!!e.field&&(d(e.oneOf)||d(e.in))}function qr(e){return Ur(e)||Tr(e)||Ir(e)||zr(e)||Pr(e)||Rr(e)||Lr(e)}function Wr(e,t){return ha(e,{timeUnit:t,wrapTime:!0})}function Hr(e,t=!0){var n;const{field:r}=e,i=null===(n=Sr(e.timeUnit))||void 0===n?void 0:n.unit,o=i?"time("+function(e,t,{end:n}={end:!1}){const r=ce(t),i=Ar(e)?"utc":"";let o;const a={};for(const t of kr)Dr(e,t)&&(a[t]="quarter"===(s=t)?`(${i}quarter(${r})-1)`:`${i}${s}(${r})`,o=t);var s;return n&&(a[o]+="+1"),function(e){const t=br(e,!1).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}(a)}(i,r)+")":Xo(e,{expr:"datum"});if(Tr(e))return o+"==="+Wr(e.equal,i);if(zr(e))return`${o}<${Wr(e.lt,i)}`;if(Pr(e))return`${o}>${Wr(e.gt,i)}`;if(Rr(e))return`${o}<=${Wr(e.lte,i)}`;if(Lr(e))return`${o}>=${Wr(e.gte,i)}`;if(Ur(e))return`indexof([${function(e,t){return e.map((e=>Wr(e,t)))}(e.oneOf,i).join(",")}], ${o}) !== -1`;if(function(e){return e&&!!e.field&&void 0!==e.valid}(e))return Gr(o,e.valid);if(Ir(e)){const{range:n}=e,r=Fr(n)?{signal:`${n.signal}[0]`}:n[0],a=Fr(n)?{signal:`${n.signal}[1]`}:n[1];if(null!==r&&null!==a&&t)return"inrange("+o+", ["+Wr(r,i)+", "+Wr(a,i)+"])";const s=[];return null!==r&&s.push(`${o} >= ${Wr(r,i)}`),null!==a&&s.push(`${o} <= ${Wr(a,i)}`),s.length>0?s.join(" && "):"true"}throw new Error(`Invalid field predicate: ${JSON.stringify(e)}`)}function Gr(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Vr(e){var t;return qr(e)&&e.timeUnit?Object.assign(Object.assign({},e),{timeUnit:null===(t=Sr(e.timeUnit))||void 0===t?void 0:t.unit}):e}const Yr={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"},Xr=Yr.quantitative,Zr=Yr.ordinal,Jr=Yr.temporal,Kr=Yr.nominal,Qr=Yr.geojson;ne(Yr);const ei={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},ti={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function ni(e,t){const n=ti[e],r=ti[t];return n===r||"ordinal-position"===n&&"time"===r||"ordinal-position"===r&&"time"===n}ne(ti);const ri={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function ii(e){return ri[e]}const oi=["linear","log","pow","sqrt","symlog","time","utc"],ai=E(oi),si=E(["linear","log","pow","sqrt","symlog"]),ui=E(["quantile","quantize","threshold"]),li=E(oi.concat(["quantile","quantize","threshold","sequential","identity"])),ci=E(["ordinal","bin-ordinal","point","band"]);function fi(e){return e in ci}function di(e){return e in li}function hi(e){return e in ai}function pi(e){return e in ui}function gi(e){return null==e?void 0:e.selection}const mi={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:yi,domain:vi,range:bi,rangeMax:xi,rangeMin:_i,scheme:wi}=(ne(mi),mi),ki=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);iae(`${"unit"===e?"":`_${e}_`}${r[e]}`))).join(""):(n?"utc":"")+"timeunit"+ne(r).map((e=>ae(`_${e}_${r[e]}`))).join("")}(f),s=(!W(["range","mid"],t.binSuffix)&&t.binSuffix||"")+(null!==(i=t.suffix)&&void 0!==i?i:""))}a&&(o=o?`${a}_${o}`:a)}return s&&(o=`${o}_${s}`),a&&(o=`${a}_${o}`),t.forAs?ge(o):t.expr?fe(o,t.expr)+u:he(o)+u}function Zo(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return To(e)&&!!e.bin;case"temporal":return!1}throw new Error(Zn(e.type))}function Jo(e){return!Zo(e)}const Ko=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return function(e){const{aggregate:t,bin:n,timeUnit:r,field:i}=e;if(Te(t))return`${i} for argmax(${t.argmax})`;if(Be(t))return`${i} for argmin(${t.argmin})`;const o=Sr(r),a=t||(null==o?void 0:o.unit)||(null==o?void 0:o.maxbins)&&"timeunit"||$n(n)&&"bin";return a?a.toUpperCase()+"("+i+")":i}(e);default:return function(e,t){var n;const{field:r,bin:i,timeUnit:o,aggregate:a}=e;if("count"===a)return t.countTitle;if($n(i))return`${r} (binned)`;if(o){const e=null===(n=Sr(o))||void 0===n?void 0:n.unit;if(e)return`${r} (${Or(e).join("-")})`}else if(a)return Te(a)?`${r} for max ${a.argmax}`:Be(a)?`${r} for min ${a.argmin}`:`${le(a)} of ${r}`;return r}(e,t)}};let Qo=Ko;function ea(e){Qo=e}function ta(e,t,{allowDisabling:n,includeDefault:r=!0}){var i,o;const a=null===(i=na(e))||void 0===i?void 0:i.title;if(!To(e))return a;const s=e,u=r?ra(s,t):void 0;return n?ye(a,s.title,u):null!==(o=null!=a?a:s.title)&&void 0!==o?o:u}function na(e){return Ho(e)&&e.axis?e.axis:Go(e)&&e.legend?e.legend:Oo(e)&&e.header?e.header:void 0}function ra(e,t){return Qo(e,t)}function ia(e){var t;if(Vo(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}{const n=null!==(t=na(e))&&void 0!==t?t:{},{format:r,formatType:i}=n;return{format:r,formatType:i}}}function oa(e){return To(e)?e:No(e)?e.condition:void 0}function aa(e){return Io(e)?e:Bo(e)?e.condition:void 0}function sa(e,t,n,r={}){return k(e)||w(e)||_(e)?(hr(function(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${I(n)}}.`}(t,k(e)?"string":w(e)?"number":"boolean",e)),{value:e}):Io(e)?ua(e,t,n,r):Bo(e)?Object.assign(Object.assign({},e),{condition:ua(e.condition,t,n,r)}):e}function ua(e,t,n,r){if(Vo(e)){const{format:i,formatType:o}=e,a=Co(e,["format","formatType"]);if(ao(o)&&!n.customFormatTypes)return hr(Xn(t)),ua(a,t,n,r)}else{const i=Ho(e)?"axis":Go(e)?"legend":Oo(e)?"header":null;if(i&&e[i]){const o=e[i],{format:a,formatType:s}=o,u=Co(o,["format","formatType"]);if(ao(s)&&!n.customFormatTypes)return hr(Xn(t)),ua(Object.assign(Object.assign({},e),{[i]:u}),t,n,r)}}return To(e)?la(e,t,r):function(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=w(n)?"quantitative":k(n)?"nominal":pr(n)?"temporal":void 0,Object.assign(Object.assign({},e),{type:t})}(e)}function la(e,t,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:a}=e,s=Object.assign({},e);if(n||!r||ze(r)||Te(r)||Be(r)||(hr(function(e){return`Invalid aggregation operator "${e}".`}(r)),delete s.aggregate),i&&(s.timeUnit=Sr(i)),a&&(s.field=`${a}`),$n(o)&&(s.bin=ca(o,t)),Nn(o)&&!fn(t)&&hr(function(e){return`Channel ${e} should not be used with "binned" bin.`}(t)),Uo(s)){const{type:e}=s,t=function(e){if(e)switch(e=e.toLowerCase()){case"q":case Xr:return"quantitative";case"t":case Jr:return"temporal";case"o":case Zr:return"ordinal";case"n":case Kr:return"nominal";case Qr:return"geojson"}}(e);e!==t&&(s.type=t),"quantitative"!==e&&Pe(r)&&(hr(function(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}(e,r)),s.type="quantitative")}else if(!qt(t)){const e=function(e,t){var n;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Fo(e)&&d(e.sort))return"ordinal";const{aggregate:r,bin:i,timeUnit:o}=e;if(o)return"temporal";if(i||r&&!Te(r)&&!Be(r))return"quantitative";if(Wo(e)&&(null===(n=e.scale)||void 0===n?void 0:n.type))switch(ti[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(s,t);s.type=e}if(Uo(s)){const{compatible:e,warning:n}=function(e,t){const n=e.type;if("geojson"===n&&"shape"!==t)return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case qe:case We:case He:return Jo(e)?{compatible:!1,warning:er(t)}:fa;case Ge:case Ve:case it:case ot:case at:case gt:case yt:case vt:case bt:case xt:case _t:case lt:case Ke:case Ze:case wt:return fa;case tt:case rt:case et:case nt:return n!==Xr?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:fa;case ct:case ft:case dt:case ht:case ut:case Qe:case Je:case Ye:case Xe:return"nominal"!==n||e.sort?fa:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case pt:return W(["ordinal","nominal"],e.type)?fa:{compatible:!1,warning:"StrokeDash channel should be used with only discrete data."};case st:return W(["ordinal","nominal","geojson"],e.type)?fa:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case mt:return"nominal"!==e.type||"sort"in e?fa:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(s,t)||{};!1===e&&hr(n)}if(Fo(s)&&k(s.sort)){const{sort:e}=s;if(_o(e))return Object.assign(Object.assign({},s),{sort:{encoding:e}});const t=e.substr(1);if("-"===e.charAt(0)&&_o(t))return Object.assign(Object.assign({},s),{sort:{encoding:t,order:"descending"}})}if(Oo(s)){const{header:e}=s,{orient:t}=e,n=Co(e,["orient"]);if(t)return Object.assign(Object.assign({},s),{header:Object.assign(Object.assign({},n),{labelOrient:e.labelOrient||t,titleOrient:e.titleOrient||t})})}return s}function ca(e,t){return _(e)?{maxbins:zn(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:Object.assign(Object.assign({},e),{maxbins:zn(t)})}const fa={compatible:!0};function da(e){const{formatType:t}=ia(e);return"time"===t||!t&&(n=e)&&("temporal"===n.type||To(n)&&!!n.timeUnit);var n}function ha(e,{timeUnit:t,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){var o;const a=t&&(null===(o=Sr(t))||void 0===o?void 0:o.unit);let s,u=a||"temporal"===n;return Di(e)?s=e.expr:Fr(e)?s=e.signal:pr(e)?(u=!0,s=xr(e)):(k(e)||w(e))&&u&&(s=`datetime(${JSON.stringify(e)})`,function(e){return!!wr[e]}(a)&&(w(e)&&e<1e4||k(e)&&isNaN(Date.parse(e)))&&(s=xr({[a]:e}))),s?r&&u?`time(${s})`:s:i?void 0:JSON.stringify(e)}function pa(e,t){const{type:n}=e;return t.map((t=>{const r=ha(t,{timeUnit:To(e)?e.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==r?{signal:r}:t}))}function ga(e,t){return $n(e.bin)?Dn(t)&&W(["ordinal","nominal"],e.type):(console.warn("Only call this method for binned field defs."),!1)}var ma=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var r;return e.field.push(Xo(n,t)),e.order.push(null!==(r=n.sort)&&void 0!==r?r:"ascending"),e}),{field:[],order:[]})}function ja(e,t){const n=[...e];return t.forEach((e=>{for(const t of n)if(z(t,e))return;n.push(e)})),n}function $a(e,t){return z(e,t)||!t?e:e?[...v(e),...v(t)].join(", "):t}function Na(e,t){const n=e.value,r=t.value;if(null==n||null===r)return{explicit:e.explicit,value:null};if((va(n)||Fr(n))&&(va(r)||Fr(r)))return{explicit:e.explicit,value:$a(n,r)};if(va(n)||Fr(n))return{explicit:e.explicit,value:n};if(va(r)||Fr(r))return{explicit:e.explicit,value:r};if(!(va(n)||Fr(n)||va(r)||Fr(r)))return{explicit:e.explicit,value:ja(n,r)};throw new Error("It should never reach here")}function Ba(e){return"mark"in e}class Ta{constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return!!Ba(e)&&(Vi(t=e.mark)?t.type:t)===this.name;var t}}var za=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i!!e.field)):To(n)||No(n))}function Pa(e){return H(jt,(t=>{if(Ra(e,t)){const n=e[t];if(d(n))return H(n,(e=>!!e.aggregate));{const e=oa(n);return e&&!!e.aggregate}}return!1}))}function La(e,t){const n=[],r=[],i=[],o=[],a={};return qa(e,((s,u)=>{if(To(s)){const{field:l,aggregate:c,bin:f,timeUnit:d}=s,h=za(s,["field","aggregate","bin","timeUnit"]);if(c||d||f){const e=na(s),p=e&&e.title;let g=Xo(s,{forAs:!0});const m=Object.assign(Object.assign(Object.assign({},p?[]:{title:ta(s,t,{allowDisabling:!0})}),h),{field:g});if(c){let e;if(Te(c)?(e="argmax",g=Xo({op:"argmax",field:c.argmax},{forAs:!0}),m.field=`${g}.${l}`):Be(c)?(e="argmin",g=Xo({op:"argmin",field:c.argmin},{forAs:!0}),m.field=`${g}.${l}`):"boxplot"!==c&&"errorbar"!==c&&"errorband"!==c&&(e=c),e){const t={op:e,as:g};l&&(t.field=l),o.push(t)}}else if(n.push(g),Uo(s)&&$n(f)){if(r.push({bin:f,field:l,as:g}),n.push(Xo(s,{binSuffix:"end"})),ga(s,u)&&n.push(Xo(s,{binSuffix:"range"})),fn(u)){const e={field:g+"_end"};a[u+"2"]=e}m.bin="binned",qt(u)||(m.type=Xr)}else if(d){i.push({timeUnit:d,field:l,as:g});const e=Uo(s)&&s.type!==Jr&&"time";e&&(u===gt||u===bt?m.formatType=e:function(e){return!!sn[e]}(u)?m.legend=Object.assign({formatType:e},m.legend):fn(u)&&(m.axis=Object.assign({formatType:e},m.axis)))}a[u]=m}else n.push(l),a[u]=e[u]}else a[u]=e[u]})),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:a}}function Ia(e,t,n,r){return ne(e).reduce(((i,o)=>{if(!It(o))return hr(function(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}(o)),i;const a=e[o];if("angle"!==o||"arc"!==t||e.theta||(hr("Arc marks uses theta channel rather than angle, replacing angle with theta."),o=Ke),!function(e,t,n){const r=function(e,t){return function(e){switch(e){case it:case ot:case at:case wt:case yt:case vt:case bt:case xt:case mt:case ct:case ft:case dt:case ht:case He:case qe:case We:return Cn;case Ge:case Ve:case et:case tt:return Fn;case Ye:case Xe:case nt:case rt:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case ut:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case pt:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case st:return{point:"always",geoshape:"always"};case gt:return{text:"always"};case lt:return{point:"always",square:"always",text:"always"};case _t:return{image:"always"};case Ke:case Ze:return{text:"always",arc:"always"};case Qe:case Je:return{arc:"always"}}}(e)[t]}(t,n);if(!r)return!1;if("binned"===r){const n=e[t===Ye?Ge:Ve];return!!(To(n)&&To(e[t])&&Nn(n.bin))}return!0}(e,o,t))return hr(Qn(o,t)),i;if(o===ut&&"line"===t){const t=oa(e[o]);if(null==t?void 0:t.aggregate)return hr("Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead."),i}if(o===it&&(n?"fill"in e:"stroke"in e))return hr(Jn("encoding",{fill:"fill"in e,stroke:"stroke"in e})),i;if(o===yt||o===mt&&!d(a)&&!qo(a)||o===bt&&d(a))a&&(i[o]=v(a).reduce(((e,t)=>(To(t)?e.push(la(t,o)):hr(Kn(t,o)),e)),[]));else{if(o===bt&&null===a)i[o]=null;else if(!(To(a)||Ro(a)||qo(a)||$o(a)||Fr(a)))return hr(Kn(a,o)),i;i[o]=sa(a,o,r)}return i}),{})}function Ua(e,t){const n={};for(const r of ne(e)){const i=sa(e[r],r,t,{compositeMark:!0});n[r]=i}return n}function qa(e,t,n){if(e)for(const r of ne(e)){const i=e[r];if(d(i))for(const e of i)t.call(n,e,r);else t.call(n,i,r)}}function Wa(e,t){return ne(t).reduce(((n,r)=>{switch(r){case Ge:case Ve:case xt:case wt:case _t:case Ye:case Xe:case Ke:case Qe:case Ze:case Je:case et:case tt:case nt:case rt:case gt:case st:case lt:case bt:return n;case mt:if("line"===e||"trail"===e)return n;case yt:case vt:{const e=t[r];if(d(e)||To(e))for(const t of v(e))t.aggregate||n.push(Xo(t,{}));return n}case ut:if("trail"===e)return n;case it:case ot:case at:case ct:case ft:case dt:case pt:case ht:{const e=oa(t[r]);return e&&!e.aggregate&&n.push(Xo(e,{})),n}}}),[])}var Ha=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const i=r?` of ${Va(t)}`:"";return{field:e+t.field,type:t.type,title:Fr(n)?{signal:n+`"${escape(i)}"`}:n+i}})),...X(function(e){const t=[];for(const n of ne(e))if(Ra(e,n)){const r=v(e[n]);for(const e of r)To(e)?t.push(e):No(e)&&t.push(e.condition)}return t}(n).map(Yo),U)]}}function Va(e){const{title:t,field:n}=e;return ye(t,n)}function Ya(e,t,n,r,i){const{scale:o,axis:a}=n;return({partName:s,mark:u,positionPrefix:l,endPositionPrefix:c,extraEncoding:f={}})=>{const d=Va(n);return Xa(e,s,i,{mark:u,encoding:Object.assign(Object.assign(Object.assign({[t]:Object.assign(Object.assign(Object.assign({field:l+"_"+n.field,type:n.type},void 0!==d?{title:d}:{}),void 0!==o?{scale:o}:{}),void 0!==a?{axis:a}:{})},k(c)?{[t+"2"]:{field:c+"_"+n.field}}:{}),r),f)})}}function Xa(e,t,n,r){const{clip:i,color:o,opacity:a}=e,s=e.type;return e[t]||void 0===e[t]&&n[t]?[Object.assign(Object.assign({},r),{mark:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n[t]),i?{clip:i}:{}),o?{color:o}:{}),a?{opacity:a}:{}),Vi(r.mark)?r.mark:{type:r.mark}),{style:`${s}-${t}`}),_(e[t])?{}:e[t])})]:[]}function Za(e,t,n){const{encoding:r}=e,i="vertical"===t?"y":"x",o=r[i],a=r[i+"2"],s=r[i+"Error"],u=r[i+"Error2"];return{continuousAxisChannelDef:Ja(o,n),continuousAxisChannelDef2:Ja(a,n),continuousAxisChannelDefError:Ja(s,n),continuousAxisChannelDefError2:Ja(u,n),continuousAxis:i}}function Ja(e,t){if(e&&e.aggregate){const{aggregate:n}=e,r=Ha(e,["aggregate"]);return n!==t&&hr(function(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}(n,t)),r}return e}function Ka(e,t){const{mark:n,encoding:r}=e,{x:i,y:o}=r;if(Vi(n)&&n.orient)return n.orient;if(Po(i)){if(Po(o)){const e=To(i)&&i.aggregate,n=To(o)&&o.aggregate;if(e||n!==t){if(n||e!==t){if(e===t&&n===t)throw new Error("Both x and y cannot have aggregate");return da(o)&&!da(i)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(Po(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}var Qa=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);iYa(l,b,v,e,t.boxplot),F=S(C),M=S(w),j=S(Object.assign(Object.assign({},C),D?{size:D}:{})),$=Ga([{fieldPrefix:"min-max"===p?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===p?"lower_whisker_":"min_",titlePrefix:"Min"}],v,w),N={type:"tick",color:"black",opacity:1,orient:k,invalid:null,aria:!1},B="min-max"===p?$:Ga([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],v,w),T=[...F({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:B}),...F({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:B}),...F({partName:"ticks",mark:N,positionPrefix:"lower_whisker",extraEncoding:B}),...F({partName:"ticks",mark:N,positionPrefix:"upper_whisker",extraEncoding:B})],z=[..."tukey"!==p?T:[],...M({partName:"box",mark:Object.assign(Object.assign({type:"bar"},f?{size:f}:{}),{orient:A,invalid:null,ariaRoleDescription:"box"}),positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:$}),...j({partName:"median",mark:Object.assign(Object.assign(Object.assign({type:"tick",invalid:null},h(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{}),f?{size:f}:{}),{orient:k,aria:!1}),positionPrefix:"mid_box",extraEncoding:$})];if("min-max"===p)return Object.assign(Object.assign({},u),{transform:(null!==(r=u.transform)&&void 0!==r?r:[]).concat(y),layer:z});const R=`datum["lower_box_${v.field}"]`,P=`datum["upper_box_${v.field}"]`,I=`(${P} - ${R})`,U=`${R} - ${c} * ${I}`,q=`${P} + ${c} * ${I}`,W=`datum["${v.field}"]`,H={joinaggregate:is(v.field),groupby:x},G={transform:[{filter:`(${U} <= ${W}) && (${W} <= ${q})`},{aggregate:[{op:"min",field:v.field,as:"lower_whisker_"+v.field},{op:"max",field:v.field,as:"upper_whisker_"+v.field},{op:"min",field:"lower_box_"+v.field,as:"lower_box_"+v.field},{op:"max",field:"upper_box_"+v.field,as:"upper_box_"+v.field},..._],groupby:x}],layer:T},{tooltip:V}=C,Y=Qa(C,["tooltip"]),{scale:X,axis:Z}=v,J=Va(v),K=L(Z,["title"]),Q=Xa(l,"outliers",t.boxplot,{transform:[{filter:`(${W} < ${U}) || (${W} > ${q})`}],mark:"point",encoding:Object.assign(Object.assign(Object.assign({[b]:Object.assign(Object.assign(Object.assign({field:v.field,type:v.type},void 0!==J?{title:J}:{}),void 0!==X?{scale:X}:{}),te(K)?{}:{axis:K})},Y),O?{color:O}:{}),E?{tooltip:E}:{})})[0];let ee;const ne=[...g,...m,H];return Q?ee={transform:ne,layer:[Q,G]}:(ee=G,ee.transform.unshift(...ne)),Object.assign(Object.assign({},u),{layer:[ee,{transform:y,layer:z}]})}function is(e){return[{op:"q1",field:e,as:"lower_box_"+e},{op:"q3",field:e,as:"upper_box_"+e}]}var os=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i1?{layer:p}:Object.assign({},p[0]))}function ls(e,t,n){var r;const{mark:i,encoding:o,selection:a,projection:s}=e,u=os(e,["mark","encoding","selection","projection"]),l=Vi(i)?i:{type:i};a&&hr(Gn(t));const{orient:c,inputType:f}=function(e,t){const{encoding:n}=e;if(function(e){return(Io(e.x)||Io(e.y))&&!Io(e.x2)&&!Io(e.y2)&&!Io(e.xError)&&!Io(e.xError2)&&!Io(e.yError)&&!Io(e.yError2)}(n))return{orient:Ka(e,t),inputType:"raw"};const r=function(e){return Io(e.x2)||Io(e.y2)}(n),i=function(e){return Io(e.xError)||Io(e.xError2)||Io(e.yError)||Io(e.yError2)}(n),o=n.x,a=n.y;if(r){if(i)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const e=n.x2,r=n.y2;if(Io(e)&&Io(r))throw new Error(`${t} cannot have both x2 and y2`);if(Io(e)){if(Po(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}if(Io(r)){if(Po(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}{const e=n.xError,r=n.xError2,i=n.yError,s=n.yError2;if(Io(r)&&!Io(e))throw new Error(`${t} cannot have xError2 without xError`);if(Io(s)&&!Io(i))throw new Error(`${t} cannot have yError2 without yError`);if(Io(e)&&Io(i))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(Io(e)){if(Po(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(Io(i)){if(Po(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}(e,t),{continuousAxisChannelDef:d,continuousAxisChannelDef2:h,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:g,continuousAxis:m}=Za(e,c,t),{errorBarSpecificAggregate:y,postAggregateCalculates:v,tooltipSummary:b,tooltipTitleWithFieldName:x}=function(e,t,n,r,i,o,a,s){let u=[],l=[];const c=t.field;let f,d=!1;if("raw"===o){const t=e.center?e.center:e.extent?"iqr"===e.extent?"median":"mean":s.errorbar.center,n=e.extent?e.extent:"mean"===t?"stderr":"iqr";if("median"===t!=("iqr"===n)&&hr(function(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}(t,n,a)),"stderr"===n||"stdev"===n)u=[{op:n,field:c,as:"extent_"+c},{op:t,field:c,as:"center_"+c}],l=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:"upper_"+c},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:"lower_"+c}],f=[{fieldPrefix:"center_",titlePrefix:le(t)},{fieldPrefix:"upper_",titlePrefix:cs(t,n,"+")},{fieldPrefix:"lower_",titlePrefix:cs(t,n,"-")}],d=!0;else{let e,t,r;"ci"===n?(e="mean",t="ci0",r="ci1"):(e="median",t="q1",r="q3"),u=[{op:t,field:c,as:"lower_"+c},{op:r,field:c,as:"upper_"+c},{op:e,field:c,as:"center_"+c}],f=[{fieldPrefix:"upper_",titlePrefix:ta({field:c,aggregate:r,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:ta({field:c,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:ta({field:c,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&hr((h=e.center,`${(p=e.extent)?"extent ":""}${p&&h?"and ":""}${h?"center ":""}${p&&h?"are ":"is "}not needed when data are aggregated.`)),"aggregated-upper-lower"===o?(f=[],l=[{calculate:`datum["${n.field}"]`,as:"upper_"+c},{calculate:`datum["${c}"]`,as:"lower_"+c}]):"aggregated-error"===o&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`datum["${c}"] + datum["${r.field}"]`,as:"upper_"+c}],i?l.push({calculate:`datum["${c}"] + datum["${i.field}"]`,as:"lower_"+c}):l.push({calculate:`datum["${c}"] - datum["${r.field}"]`,as:"lower_"+c}));for(const e of l)f.push({fieldPrefix:e.as.substring(0,6),titlePrefix:pe(pe(e.calculate,'datum["',""),'"]',"")})}var h,p;return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}(l,d,h,p,g,f,t,n),_=o,w=m,k=(_[w],"x"===m?"x2":"y2"),A=(_[k],"x"===m?"xError":"yError"),E=(_[A],"x"===m?"xError2":"yError2"),O=(_[E],os(_,["symbol"==typeof w?w:w+"","symbol"==typeof k?k:k+"","symbol"==typeof A?A:A+"","symbol"==typeof E?E:E+""])),{bins:D,timeUnits:C,aggregate:S,groupby:F,encoding:M}=La(O,n),j=[...S,...y],$="raw"!==f?[]:F,N=Ga(b,d,M,x);return{transform:[...null!==(r=u.transform)&&void 0!==r?r:[],...D,...C,...0===j.length?[]:[{aggregate:j,groupby:$}],...v],groupby:$,continuousAxisChannelDef:d,continuousAxis:m,encodingWithoutContinuousAxis:M,ticksOrient:"vertical"===c?"horizontal":"vertical",markDef:l,outerSpec:u,tooltipEncoding:N}}function cs(e,t,n){return le(e)+" "+n+" "+t}const fs="errorband",ds=new Ta(fs,hs);function hs(e,{config:t}){e=Object.assign(Object.assign({},e),{encoding:Ua(e.encoding,t)});const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:a,outerSpec:s,tooltipEncoding:u}=ls(e,fs,t),l=a,c=Ya(l,i,r,o,t.errorband),f=void 0!==e.encoding.x&&void 0!==e.encoding.y;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p=Object.assign(Object.assign({},l.interpolate?{interpolate:l.interpolate}:{}),l.tension&&l.interpolate?{tension:l.tension}:{});return f?(d=Object.assign(Object.assign(Object.assign({},d),p),{ariaRoleDescription:"errorband"}),h=Object.assign(Object.assign(Object.assign({},h),p),{aria:!1})):l.interpolate?hr(lr("interpolate")):l.tension&&hr(lr("tension")),Object.assign(Object.assign({},s),{transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]})}const ps={};function gs(e,t,n){const r=new Ta(e,t);ps[e]={normalizer:r,parts:n}}gs(es,rs,["box","median","outliers","rule","ticks"]),gs(as,us,["ticks","rule"]),gs(fs,hs,["band","borders"]);const ms=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],ys={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},vs={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},bs=ne(ys),xs=ne(vs),_s=ne({header:1,headerRow:1,headerColumn:1,headerFacet:1}),ws=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],ks={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1};ne(ks);var As=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function Cs(e){return!(!e||"legend"!==e&&!e.legend)}function Ss(e){return Cs(e)&&h(e)}function Fs(e){return"concat"in e}function Ms(e){return"vconcat"in e}function js(e){return"hconcat"in e}function $s(e){return h(e)&&void 0!==e.step}function Ns(e){return e.view||e.width||e.height}const Bs=ne({align:1,bounds:1,center:1,columns:1,spacing:1});var Ts=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ithis.mapLayerOrUnit(e,t)))})}mapHConcat(e,t){return Object.assign(Object.assign({},e),{hconcat:e.hconcat.map((e=>this.map(e,t)))})}mapVConcat(e,t){return Object.assign(Object.assign({},e),{vconcat:e.vconcat.map((e=>this.map(e,t)))})}mapConcat(e,t){const{concat:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ithis.map(e,t)))})}mapFacet(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}mapRepeat(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}}const eu={zero:1,center:1,normalize:1},tu=new Set([Fi,ji,Mi,zi,Bi,Ii,Ui,Ni,Ri,Pi]),nu=new Set([ji,Mi,Fi]);function ru(e,t){var n,r;const i="x"===t?"y":"radius",o=e[t],a=e[i];if(To(o)&&To(a))if("quantitative"===zo(o)&&"quantitative"===zo(a)){if(o.stack)return t;if(a.stack)return i;const e=To(o)&&!!o.aggregate;if(e!==(To(a)&&!!a.aggregate))return e?t:i;{const e=null===(n=o.scale)||void 0===n?void 0:n.type,s=null===(r=a.scale)||void 0===r?void 0:r.type;if(e&&"linear"!==e)return i;if(s&&"linear"!==s)return t}}else{if("quantitative"===zo(o))return t;if("quantitative"===zo(a))return i}else{if("quantitative"===zo(o))return t;if("quantitative"===zo(a))return i}}function iu(e,t,n={}){const r=Vi(e)?e.type:e;if(!tu.has(r))return null;const i=ru(t,"x")||ru(t,"theta");if(!i)return null;const o=t[i],a=To(o)?Xo(o,{}):void 0;let s=function(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(i),u=t[s],l=To(u)?Xo(u,{}):void 0;l===a&&(l=void 0,u=void 0,s=void 0);const c=un.reduce(((e,n)=>{if("tooltip"!==n&&Ra(t,n)){const r=t[n];for(const t of v(r)){const r=oa(t);if(r.aggregate)continue;const i=Xo(r,{});i&&i===l||e.push({channel:n,fieldDef:r})}}return e}),[]);let f;if(void 0!==o.stack?f=_(o.stack)?o.stack?"zero":null:o.stack:c.length>0&&nu.has(r)&&(f="zero"),!f||!(f in eu))return null;var d;if(Pa(t)&&0===c.length)return null;if(o.scale&&o.scale.type&&o.scale.type!==ei.LINEAR){if(n.disallowNonLinearStack)return null;hr(function(e){return`Cannot stack non-linear scale (${e}).`}(o.scale.type))}return Io(t[Gt(i)])?(void 0!==o.stack&&hr(`Cannot stack "${d=i}" if there is already "${d}2".`),null):(To(o)&&o.aggregate&&!W(Le,o.aggregate)&&hr(`Stacking is applied even though the aggregate function is non-summative ("${o.aggregate}").`),{groupbyChannel:u?s:void 0,groupbyField:l,fieldChannel:i,impute:null!==o.impute&&Wi(r),stackBy:c,offset:f})}var ou=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i1?r:r.type}function su(e){for(const t of["line","area","rule","trail"])e[t]&&(e=Object.assign(Object.assign({},e),{[t]:L(e[t],["point","line"])}));return e}function uu(e,t={},n){return"transparent"===e.point?{opacity:0}:e.point?h(e.point)?e.point:{}:void 0!==e.point?null:t.point||n.shape?h(t.point)?t.point:{}:void 0}function lu(e,t={}){return e.line?!0===e.line?{}:e.line:void 0!==e.line?null:t.line?!0===t.line?{}:t.line:void 0}class cu{constructor(){this.name="path-overlay"}hasMatchingType(e,t){if(Ba(e)){const{mark:n,encoding:r}=e,i=Vi(n)?n:{type:n};switch(i.type){case"line":case"rule":case"trail":return!!uu(i,t[i.type],r);case"area":return!!uu(i,t[i.type],r)||!!lu(i,t[i.type])}}return!1}run(e,t,n){const{config:r}=t,{selection:i,projection:o,mark:a,encoding:s}=e,u=ou(e,["selection","projection","mark","encoding"]),l=Ua(s,r),c=Vi(a)?a:{type:a},f=uu(c,r[c.type],l),d="area"===c.type&&lu(c,r[c.type]),h=[Object.assign(Object.assign({},i?{selection:i}:{}),{mark:au(Object.assign(Object.assign({},"area"===c.type&&void 0===c.opacity&&void 0===c.fillOpacity?{opacity:.7}:{}),c)),encoding:L(l,["shape"])})],p=iu(c,l);let g=l;if(p){const{fieldChannel:e,offset:t}=p;g=Object.assign(Object.assign({},l),{[e]:Object.assign(Object.assign({},l[e]),t?{stack:t}:{})})}return d&&h.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"line"},P(c,["clip","interpolate","tension","tooltip"])),d),encoding:g})),f&&h.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"point",opacity:1,filled:!0},P(c,["clip","tooltip"])),f),encoding:g})),n(Object.assign(Object.assign({},u),{layer:h}),Object.assign(Object.assign({},t),{config:su(r)}))}}var fu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ibu(e,t))).filter((e=>e));else{const e=bu(i,t);void 0!==e&&(n[r]=e)}}return n}class _u{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if(Ba(e)){const{encoding:t,mark:n}=e;if("line"===n)for(const e of Ut){const n=t[Wt(e)];if(t[e]&&(To(n)&&!Nn(n.bin)||Ro(n)))return!0}}return!1}run(e,t,n){const{encoding:r}=e;var i,o;return hr((i=!!r.x2,o=!!r.y2,`Line mark is for continuous lines and thus cannot be used with ${i&&o?"x2 and y2":i?"x2":"y2"}. We will use the rule mark (line segments) instead.`)),n(Object.assign(Object.assign({},e),{mark:"rule"}),t)}}var wu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const n=Object.assign(Object.assign({},u),{layer:e}),i=(r.name||"")+l+`child__layer_${ae(e)}`,o=this.mapLayerOrUnit(r,Object.assign(Object.assign({},t),{repeater:n,repeaterPrefix:i}));return o.name=i,o}))})}mapNonLayerRepeat(e,t){var n;const{repeat:r,spec:i,data:o}=e,a=wu(e,["repeat","spec","data"]);!d(r)&&e.columns&&(e=L(e,["columns"]),hr(Vn("repeat")));const s=[],{repeater:u={},repeaterPrefix:l=""}=t,c=!d(r)&&r.row||[u?u.row:null],f=!d(r)&&r.column||[u?u.column:null],h=d(r)&&r||[u?u.repeat:null];for(const e of h)for(const n of c)for(const o of f){const a={repeat:e,row:n,column:o,layer:u.layer},c=(i.name||"")+l+"child__"+(d(r)?`${ae(e)}`:(r.row?`row_${ae(n)}`:"")+(r.column?`column_${ae(o)}`:"")),f=this.map(i,Object.assign(Object.assign({},t),{repeater:a,repeaterPrefix:c}));f.name=c,s.push(L(f,["data"]))}const p=d(r)?e.columns:r.column?r.column.length:1;return Object.assign(Object.assign({data:null!==(n=i.data)&&void 0!==n?n:o,align:"all"},a),{columns:p,concat:s})}mapFacet(e,t){const{facet:n}=e;return Eo(n)&&e.columns&&(e=L(e,["columns"]),hr(Vn("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){const{encoding:n,projection:r}=e,{parentEncoding:i,parentProjection:o,config:a}=t,s=Au({parentProjection:o,projection:r}),u=ku({parentEncoding:i,encoding:gu(n,t.repeater)});return this.mapUnit(Object.assign(Object.assign(Object.assign({},e),s?{projection:s}:{}),u?{encoding:u}:{}),{config:a})}mapFacetedUnit(e,t){const n=e.encoding,{row:r,column:i,facet:o}=n,a=wu(n,["row","column","facet"]),{mark:s,width:u,projection:l,height:c,view:f,selection:d,encoding:h}=e,p=wu(e,["mark","width","projection","height","view","selection","encoding"]),{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},t),y=gu(a,t.repeater);return this.mapFacet(Object.assign(Object.assign(Object.assign({},p),m),{facet:g,spec:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},u?{width:u}:{}),c?{height:c}:{}),f?{view:f}:{}),l?{projection:l}:{}),{mark:s,encoding:y}),d?{selection:d}:{})}),t)}getFacetMappingAndLayout(e,t){var n;const{row:r,column:i,facet:o}=e;if(r||i){o&&hr(`Facet encoding dropped as ${(a=[...r?[qe]:[],...i?[We]:[]]).join(" and ")} ${a.length>1?"are":"is"} also specified.`);const t={},s={};for(const r of[qe,We]){const i=e[r];if(i){const{align:e,center:o,spacing:a,columns:u}=i,l=wu(i,["align","center","spacing","columns"]);t[r]=l;for(const e of["align","center","spacing"])void 0!==i[e]&&(s[e]=null!==(n=s[e])&&void 0!==n?n:{},s[e][r]=i[e])}}return{facetMapping:t,layout:s}}{const{align:e,center:n,spacing:r,columns:i}=o;return{facetMapping:pu(wu(o,["align","center","spacing","columns"]),t.repeater),layout:Object.assign(Object.assign(Object.assign(Object.assign({},e?{align:e}:{}),n?{center:n}:{}),r?{spacing:r}:{}),i?{columns:i}:{})}}var a}mapLayer(e,t){var{parentEncoding:n,parentProjection:r}=t,i=wu(t,["parentEncoding","parentProjection"]);const{encoding:o,projection:a}=e,s=wu(e,["encoding","projection"]),u=Object.assign(Object.assign({},i),{parentEncoding:ku({parentEncoding:n,encoding:o,layer:!0}),parentProjection:Au({parentProjection:r,projection:a})});return super.mapLayer(s,u)}};function Du(e){return k(e)?{type:e}:null!=e?e:{}}const Cu=["background","padding"];function Su(e,t){const n={};for(const t of Cu)e&&void 0!==e[t]&&(n[t]=_a(e[t]));return t&&(n.params=e.params),n}class Fu{constructor(e={},t={}){this.explicit=e,this.implicit=t}clone(){return new Fu(R(this.explicit),R(this.implicit))}combine(){return Object.assign(Object.assign({},this.explicit),this.implicit)}get(e){return ye(this.explicit[e],this.implicit[e])}getWithExplicit(e){return void 0!==this.explicit[e]?{explicit:!0,value:this.explicit[e]}:void 0!==this.implicit[e]?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,t){void 0!==t.value&&this.set(e,t.value,t.explicit)}set(e,t,n){return delete this[n?"implicit":"explicit"][e],this[n?"explicit":"implicit"][e]=t,this}copyKeyFromSplit(e,t){void 0!==t.explicit[e]?this.set(e,t.explicit[e],!0):void 0!==t.implicit[e]&&this.set(e,t.implicit[e],!1)}copyKeyFromObject(e,t){void 0!==t[e]&&this.set(e,t[e],!0)}copyAll(e){for(const t of ne(e.combine())){const n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}}function Mu(e){return{explicit:!0,value:e}}function ju(e){return{explicit:!1,value:e}}function $u(e){return(t,n,r,i)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:Nu(t,n,r,i)}}function Nu(e,t,n,r){return e.explicit&&t.explicit&&hr(function(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${I(n)} and ${I(r)}). Using ${I(n)}.`}(n,r,e.value,t.value)),e}function Bu(e,t,n,r,i=Nu){return void 0===e||void 0===e.value?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:z(e.value,t.value)?e:i(e,t,n,r)}class Tu extends Fu{constructor(e={},t={},n=!1){super(e,t),this.explicit=e,this.implicit=t,this.parseNothing=n}clone(){const e=super.clone();return e.parseNothing=this.parseNothing,e}}function zu(e){return"url"in e}function Ru(e){return"values"in e}function Pu(e){return"name"in e&&!zu(e)&&!Ru(e)&&!Lu(e)}function Lu(e){return e&&(Iu(e)||Uu(e)||qu(e))}function Iu(e){return"sequence"in e}function Uu(e){return"sphere"in e}function qu(e){return"graticule"in e}var Wu;function Hu(e){return"filter"in e}function Gu(e){return"lookup"in e}function Vu(e){return"pivot"in e}function Yu(e){return"density"in e}function Xu(e){return"quantile"in e}function Zu(e){return"regression"in e}function Ju(e){return"loess"in e}function Ku(e){return"sample"in e}function Qu(e){return"window"in e}function el(e){return"joinaggregate"in e}function tl(e){return"flatten"in e}function nl(e){return"calculate"in e}function rl(e){return"bin"in e}function il(e){return"impute"in e}function ol(e){return"timeUnit"in e}function al(e){return"aggregate"in e}function sl(e){return"stack"in e}function ul(e){return"fold"in e}!function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup"}(Wu||(Wu={}));const ll="[",cl="]",fl="{",dl="}",hl=":",pl=",",gl="@",ml=">",yl=/[[\]{}]/,vl={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let bl,xl;function _l(e,t,n){return bl=t||"view",xl=n||vl,kl(e.trim()).map(Al)}function wl(e,t,n,r,i){const o=e.length;let a,s=0;for(;t=0?--s:r&&r.indexOf(a)>=0&&++s}return t}function kl(e){const t=[],n=e.length;let r=0,i=0;for(;i' after between selector: "+e;n=n.map(Al);const i=Al(e.slice(1).trim());return i.between?{between:n,stream:i}:(i.between=n,i)}(e):function(e){const t={source:bl},n=[];let r,i,o=[0,0],a=0,s=0,u=e.length,l=0;if(e[u-1]===dl){if(l=e.lastIndexOf(fl),!(l>=0))throw"Unmatched right brace: "+e;try{o=function(e){const t=e.split(pl);if(!e.length||t.length>2)throw e;return t.map((t=>{const n=+t;if(n!=n)throw e;return n}))}(e.substring(l+1,u-1))}catch(t){throw"Invalid throttle specification: "+e}u=(e=e.slice(0,l).trim()).length,l=0}if(!u)throw e;if(e[0]===gl&&(a=++l),r=wl(e,l,hl),r1?(t.type=n[1],a?t.markname=n[0].slice(1):function(e){return xl[e]}(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],"!"===t.type.slice(-1)&&(t.consume=!0,t.type=t.type.slice(0,-1)),null!=i&&(t.filter=i),o[0]&&(t.throttle=o[0]),o[1]&&(t.debounce=o[1]),t}(e)}function El(e,t,n,r){const i=$o(t)&&t.condition,o=r(t);if(i){const t=v(i).map((t=>{const n=r(t),i=function(e){return e.selection}(t)?Od(e,t.selection):Cd(e,t.test);return Object.assign({test:i},n)}));return{[n]:[...t,...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function Ol(e,t="text"){const n=e.encoding[t];return El(e,n,t,(t=>Dl(t,e.config)))}function Dl(e,t,n="datum"){if(e){if(qo(e))return ka(e.value);if(Io(e)){const{format:r,formatType:i}=ia(e);return lo({fieldOrDatumDef:e,format:r,formatType:i,expr:n,config:t})}}}function Cl(e,t={}){const{encoding:n,markDef:r,config:i,stack:o}=e,a=n.tooltip;if(d(a))return{tooltip:Fl({tooltip:a},o,i,t)};{const s=t.reactiveGeom?"datum.datum":"datum";return El(e,a,"tooltip",(e=>{const a=Dl(e,i,s);if(a)return a;if(null===e)return;let u=Da("tooltip",r,i);return!0===u&&(u={content:"encoding"}),k(u)?{value:u}:h(u)?Fr(u)?u:"encoding"===u.content?Fl(n,o,i,t):{signal:s}:void 0}))}}function Sl(e,t,n,{reactiveGeom:r}={}){const i={},o=r?"datum.datum":"datum",a=[];function s(r,s){const u=Wt(s),l=Uo(r)?r:Object.assign(Object.assign({},r),{type:e[u].type}),c=v(l.title||ra(l,n)).join(", ");let f;if(fn(s)){const r="x"===s?"x2":"y2",a=oa(e[r]);if(Nn(l.bin)&&a){const e=Xo(l,{expr:o}),t=Xo(a,{expr:o}),{format:s,formatType:u}=ia(l);f=vo(e,t,s,u,n),i[r]=!0}else if(t&&t.fieldChannel===s&&"normalize"===t.offset){const{format:e,formatType:t}=ia(l);f=lo({fieldOrDatumDef:l,format:e,formatType:t,expr:o,config:n,normalizeStack:!0}).signal}}f=null!=f?f:Dl(l,n,o).signal,a.push({channel:s,key:c,value:f})}qa(e,((e,t)=>{To(e)?s(e,t):No(e)&&s(e.condition,t)}));const u={};for(const{channel:e,key:t,value:n}of a)i[e]||u[t]||(u[t]=n);return u}function Fl(e,t,n,{reactiveGeom:r}={}){const i=Sl(e,t,n,{reactiveGeom:r}),o=ie(i).map((([e,t])=>`"${e}": ${t}`));return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function Ml(e,t,n={}){const{markDef:r,encoding:i,config:o}=t,{vgChannel:a}=n;let{defaultRef:s,defaultValue:u}=n;void 0===s&&(u=null!=u?u:Da(e,r,o,{vgChannel:a,ignoreVgConfig:!0}),void 0!==u&&(s=ka(u)));const l=i[e];return El(t,l,null!=a?a:e,(n=>io({channel:e,channelDef:n,markDef:r,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:s})))}function jl(e,t={filled:void 0}){var n,r,i,o;const{markDef:a,encoding:s,config:u}=e,{type:l}=a,c=null!==(n=t.filled)&&void 0!==n?n:Da("filled",a,u),f=W(["bar","point","circle","square","geoshape"],l)?"transparent":void 0,d=null!==(i=null!==(r=Da(!0===c?"color":void 0,a,u,{vgChannel:"fill"}))&&void 0!==r?r:u.mark[!0===c&&"color"])&&void 0!==i?i:f,h=null!==(o=Da(!1===c?"color":void 0,a,u,{vgChannel:"stroke"}))&&void 0!==o?o:u.mark[!1===c&&"color"],p=c?"fill":"stroke",g=Object.assign(Object.assign({},d?{fill:ka(d)}:{}),h?{stroke:ka(h)}:{});return a.color&&(c?a.fill:a.stroke)&&hr(Jn("property",{fill:"fill"in a,stroke:"stroke"in a})),Object.assign(Object.assign(Object.assign(Object.assign({},g),Ml("color",e,{vgChannel:p,defaultValue:c?d:h})),Ml("fill",e,{defaultValue:s.fill?d:void 0})),Ml("stroke",e,{defaultValue:s.stroke?h:void 0}))}function $l(e,t){const n=function(e){switch(e){case Ge:return"xOffset";case Ve:return"yOffset";case Ye:return"x2Offset";case Xe:return"y2Offset";case Ke:return"thetaOffset";case Ze:return"radiusOffset";case Qe:return"theta2Offset";case Je:return"radius2Offset"}}(e),r=t[n];if(r)return r}function Nl(e,t,{defaultPos:n,vgChannel:r,isMidPoint:i}){const{encoding:o,markDef:a,config:s,stack:u}=t,l=o[e],c=o[Gt(e)],f=t.scaleName(e),d=t.getScaleComponent(e),h=$l(e,a),p=Bl({model:t,defaultPos:n,channel:e,scaleName:f,scale:d}),g=!l&&fn(e)&&(o.latitude||o.longitude)?{field:t.getName(e)}:function(e){const{channel:t,channelDef:n,isMidPoint:r,scaleName:i,stack:o,offset:a,markDef:s,config:u}=e;if(Io(n)&&o&&t===o.fieldChannel){if(To(n)){const e=Mo({channel:t,fieldDef:n,isMidPoint:r,markDef:s,stack:o,config:u});if(void 0!==e)return ro({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",band:e,offset:a})}return no(n,i,{suffix:"end"},{offset:a})}return Ki(e)}({channel:e,channelDef:l,channel2Def:c,markDef:a,config:s,isMidPoint:i,scaleName:f,scale:d,stack:u,offset:h,defaultRef:p});return g?{[r||e]:g}:void 0}function Bl({model:e,defaultPos:t,channel:n,scaleName:r,scale:i}){const{markDef:o,config:a}=e;return()=>{const s=Wt(n),u=Ht(n),l=Da(n,o,a,{vgChannel:u});if(void 0!==l)return oo(n,l);switch(t){case"zeroOrMin":case"zeroOrMax":if(r){const e=i.get("type");if(W([ei.LOG,ei.TIME,ei.UTC],e));else if(i.domainDefinitelyIncludesZero())return{scale:r,value:0}}if("zeroOrMin"===t)return"y"===s?{field:{group:"height"}}:{value:0};switch(s){case"radius":return{signal:`min(${e.width.signal},${e.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":{const t=e[Vt(n)];return Object.assign(Object.assign({},t),{mult:.5})}}}}const Tl={left:"x",center:"xc",right:"x2"},zl={top:"y",middle:"yc",bottom:"y2"};function Rl(e,t,n,r="middle"){if("radius"===e||"theta"===e)return Ht(e);const i="x"===e?"align":"baseline",o=Da(i,t,n);let a;return Fr(o)?(hr(function(e){return`The ${e} for range marks cannot be an expression`}(i)),a=void 0):a=o,"x"===e?Tl[a||("top"===r?"left":"center")]:zl[a||r]}function Pl(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?Ll(e,t,{defaultPos:n,defaultPos2:r}):Nl(e,t,{defaultPos:n})}function Ll(e,t,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=t,a=Gt(e),s=Vt(e),u=function(e,t,n){const{encoding:r,mark:i,markDef:o,stack:a,config:s}=e,u=Wt(n),l=Vt(n),c=Ht(n),f=r[u],d=e.scaleName(u),h=e.getScaleComponent(u),p=$l(n in r||n in o?n:u,e.markDef);if(!f&&("x2"===n||"y2"===n)&&(r.latitude||r.longitude))return{[c]:{field:e.getName(n)}};const g=function({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:o,scale:a,stack:s,offset:u,defaultRef:l}){return Io(t)&&s&&e.charAt(0)===s.fieldChannel.charAt(0)?no(t,o,{suffix:"start"},{offset:u}):Ki({channel:e,channelDef:n,scaleName:o,scale:a,stack:s,markDef:r,config:i,offset:u,defaultRef:l})}({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:s,scaleName:d,scale:h,stack:a,offset:p,defaultRef:void 0});return void 0!==g?{[c]:g}:Il(n,o)||Il(n,{[n]:Sa(n,o,s.style),[l]:Sa(l,o,s.style)})||Il(n,s[i])||Il(n,s.mark)||{[c]:Bl({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}(t,r,a),l=u[s]?Rl(e,i,o):Ht(e);return Object.assign(Object.assign({},Nl(e,t,{defaultPos:n,vgChannel:l})),u)}function Il(e,t){const n=Vt(e),r=Ht(e);return void 0!==t[r]?{[r]:oo(e,t[r])}:void 0!==t[e]?{[r]:oo(e,t[e])}:t[n]?{[n]:oo(e,t[n])}:void 0}function Ul(e,t,n){var r,i,o,a;const{config:s,encoding:u,markDef:l,stack:c}=e,f=Gt(t),h=Vt(t),p=u[t],g=u[f],m=e.getScaleComponent(t),y=m?m.get("type"):void 0,v=e.scaleName(t),b=l.orient,x=null!==(i=null!==(r=u[h])&&void 0!==r?r:u.size)&&void 0!==i?i:Da("size",l,s,{vgChannel:h}),_="bar"===n&&("x"===t?"vertical"===b:"horizontal"===b);if(To(p)&&($n(p.bin)||Nn(p.bin)||p.timeUnit&&!g)&&!x&&!fi(y)){const n=Mo({channel:t,fieldDef:p,stack:c,markDef:l,config:s}),r=null===(o=e.component.axes[t])||void 0===o?void 0:o[0];return function({fieldDef:e,fieldDef2:t,channel:n,band:r,scaleName:i,markDef:o,spacing:a=0,axisTranslate:s,reverse:u,config:l}){const c=Gt(n),f=Ht(n),d=Ht(c),h=$l(n,o);if($n(e.bin)||e.timeUnit)return{[d]:Hl({channel:n,fieldDef:e,scaleName:i,markDef:o,band:(1-r)/2,offset:Wl(c,a,u,s,h),config:l}),[f]:Hl({channel:n,fieldDef:e,scaleName:i,markDef:o,band:1-(1-r)/2,offset:Wl(n,a,u,s,h),config:l})};if(Nn(e.bin)){const r=no(e,i,{},{offset:Wl(c,a,u,s,h)});if(To(t))return{[d]:r,[f]:no(t,i,{},{offset:Wl(n,a,u,s,h)})};if(Bn(e.bin)&&e.bin.step)return{[d]:r,[f]:{signal:`scale("${i}", ${Xo(e,{expr:"datum"})} + ${e.bin.step})`,offset:Wl(n,a,u,s,h)}}}hr(cr(c))}({fieldDef:p,fieldDef2:g,channel:t,markDef:l,scaleName:v,band:n,axisTranslate:null!==(a=null==r?void 0:r.get("translate"))&&void 0!==a?a:.5,spacing:fn(t)?Da("binSpacing",l,s):void 0,reverse:m.get("reverse"),config:s})}return(Io(p)&&fi(y)||_)&&!g?function(e,t,n,r){var i;const{markDef:o,encoding:a,config:s,stack:u}=r,l=o.orient,c=r.scaleName(n),f=r.getScaleComponent(n),h=Vt(n),p=Gt(n),g="horizontal"===l&&"y"===n||"vertical"===l&&"x"===n,m=Da(g?"size":h,o,s,{vgChannel:h});let y;(a.size||void 0!==m)&&(g?y=Ml("size",r,{vgChannel:h,defaultValue:m}):hr(function(e){return`Cannot apply size to non-oriented mark "${e}".`}(o.type)));const v=null!==(i=Io(t)?Mo({channel:n,fieldDef:t,markDef:o,stack:u,config:s}):void 0)&&void 0!==i?i:1;y=y||{[h]:ql(e,h,c,f,s,v)};const b="band"!==(null==f?void 0:f.get("type"))||!("band"in y[h]),x=Rl(n,o,s,b?"middle":"top"),_=$l(n,o),w=Ki({channel:n,channelDef:t,markDef:o,config:s,scaleName:c,scale:f,stack:u,offset:_,defaultRef:Bl({model:r,defaultPos:"mid",channel:n,scaleName:c,scale:f}),band:b?.5:(1-v)/2});if(h)return Object.assign({[x]:w},y);{const e=Ht(p),t=y[h],n=_?Object.assign(Object.assign({},t),{offset:_}):t;return{[x]:w,[e]:d(w)?[w[0],Object.assign(Object.assign({},w[1]),{offset:n})]:Object.assign(Object.assign({},w),{offset:n})}}}(n,p,t,e):Ll(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function ql(e,t,n,r,i,o){if(r){const t=r.get("type");if("point"===t||"band"===t){if(void 0!==i[e].discreteBandSize)return{value:i[e].discreteBandSize};if(t===ei.POINT){const e=r.get("range");return Mr(e)&&w(e.step)?{value:e.step-2}:{value:Ls-2}}return{scale:n,band:o}}return{value:i[e].continuousBandSize}}const a=Rs(i.view,t),s=ye(i[e].discreteBandSize,a-2);return void 0!==s?{value:s}:void 0}function Wl(e,t,n,r,i){if(At(e))return 0;const o="x"===e||"y2"===e?-t/2:t/2;if(Fr(n)||Fr(i)||Fr(r)){const e=Ea(n),t=Ea(i),a=Ea(r);return{signal:(a?`${a} + `:"")+(e?`(${e} ? -1 : 1) * `:"")+(t?`(${t} + ${o})`:o)}}return i=i||0,r+(n?-i-o:+i+o)}function Hl({channel:e,fieldDef:t,scaleName:n,markDef:r,band:i,offset:o,config:a}){return Qi({fieldDef:t,channel:e,markDef:r,ref:ro({scaleName:n,fieldOrDatumDef:t,band:i,offset:o}),config:a})}const Gl=new Set(["aria"]);function Vl(e,t){const{fill:n,stroke:r}="include"===t.color?jl(e):{};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},function(e,t){return $r.reduce(((n,r)=>(Gl.has(r)||void 0===e[r]||"ignore"===t[r]||(n[r]=ka(e[r])),n)),{})}(e.markDef,t)),Yl(e,"fill",n)),Yl(e,"stroke",r)),Ml("opacity",e)),Ml("fillOpacity",e)),Ml("strokeOpacity",e)),Ml("strokeWidth",e)),Ml("strokeDash",e)),function(e){const{encoding:t,mark:n}=e,r=t.order;return!Wi(n)&&qo(r)?El(e,r,"zindex",(e=>ka(e.value))):{}}(e)),Cl(e)),Ol(e,"href")),function(e){const{markDef:t,config:n}=e,r=Da("aria",t,n);return!1===r?{}:Object.assign(Object.assign(Object.assign({},r?{aria:r}:{}),function(e){const{mark:t,markDef:n,config:r}=e;if(!1===r.aria)return{};const i=Da("ariaRoleDescription",n,r);return null!=i?{ariaRoleDescription:{value:i}}:t in Nr?{}:{ariaRoleDescription:{value:t}}}(e)),function(e){const{encoding:t,markDef:n,config:r,stack:i}=e,o=t.description;if(o)return El(e,o,"description",(t=>Dl(t,e.config)));const a=Da("description",n,r);if(null!=a)return{description:ka(a)};if(!1===r.aria)return{};const s=Sl(t,i,r);return te(s)?void 0:{description:{signal:ie(s).map((([e,t],n)=>`"${n>0?"; ":""}${e}: " + (${t})`)).join(" + ")}}}(e))}(e))}function Yl(e,t,n){const{config:r,mark:i,markDef:o}=e;if("hide"===Da("invalid",o,r)&&n&&!Wi(i)){const r=function(e,{invalid:t=!1,channels:n}){const r=n.reduce(((t,n)=>{const r=e.getScaleComponent(n);if(r){const i=r.get("type"),o=e.vgField(n,{expr:"datum"});o&&di(i)&&(t[o]=!0)}return t}),{}),i=ne(r);if(i.length>0){const e=t?"||":"&&";return i.map((e=>to(e,t))).join(` ${e} `)}}(e,{invalid:!0,channels:On});if(r)return{[t]:[{test:r,value:null},...v(n)]}}return n?{[t]:n}:{}}function Xl(e){const{config:t,markDef:n}=e;if(Da("invalid",n,t)){const t=function(e,{invalid:t=!1,channels:n}){const r=n.reduce(((t,n)=>{const r=e.getScaleComponent(n);if(r){const i=r.get("type"),o=e.vgField(n,{expr:"datum"});o&&di(i)&&(t[o]=!0)}return t}),{}),i=ne(r);if(i.length>0){const e=t?"||":"&&";return i.map((e=>to(e,t))).join(` ${e} `)}}(e,{channels:cn});if(t)return{defined:{signal:t}}}return{}}function Zl(e,t){if(void 0!==t)return{[e]:ka(t)}}const Jl="voronoi",Kl={has:e=>"interval"!==e.type&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(Jl)},marks:(e,t,n)=>{const{x:r,y:i}=t.project.hasChannel,o=e.mark;if(Wi(o))return hr(`The "nearest" transform is not supported for ${o} marks.`),n;const a={name:e.getName(Jl),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:Object.assign({fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0}},Cl(e,{reactiveGeom:!0}))},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let s=0,u=!1;return n.forEach(((t,n)=>{var r;const i=null!==(r=t.name)&&void 0!==r?r:"";i===e.component.mark[0].name?s=n:i.indexOf(Jl)>=0&&(u=!0)})),u||n.splice(s+1,0,a),n}},Ql=Kl;class ec{constructor(e,t){this.debugName=t,this._children=[],this._parent=null,e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e,e&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,t){this._children.indexOf(e)>-1?hr("Attempt to add the same child twice."):void 0!==t?this._children.splice(t,0,e):this._children.push(e)}removeChild(e){const t=this._children.indexOf(e);return this._children.splice(t,1),t}remove(){let e=this._parent.removeChild(this);for(const t of this._children)t._parent=this._parent,this._parent.addChild(t,e++)}insertAsParentOf(e){const t=e.parent;t.removeChild(this),this.parent=t,e.parent=this}swapWithParent(){const e=this._parent,t=e.parent;for(const t of this._children)t.parent=e;this._children=[],e.removeChild(this),e.parent.removeChild(e),this.parent=t,e.parent=this}}class tc extends ec{constructor(e,t,n,r){super(e,t),this.type=n,this.refCounts=r,this._source=this._name=t,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}clone(){const e=new this.constructor;return e.debugName="clone_"+this.debugName,e._source=this._source,e._name="clone_"+this._name,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}dependentFields(){return new Set}producedFields(){return new Set}hash(){return void 0===this._hash&&(this._hash=`Output ${be()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}var nc=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{field:i,timeUnit:o}=n,a=Zp(t)?t.encoding[Gt(r)]:void 0,s=Zp(t)&&jo(r,n,a,t.stack,t.markDef,t.config);if(o){const t=Xo(n,{forAs:!0});e[U({as:t,field:i,timeUnit:o})]=Object.assign({as:t,field:i,timeUnit:o},s?{band:!0}:{})}return e}),{});return te(n)?null:new rc(e,n)}static makeFromTransform(e,t){const n=Object.assign({},t),{timeUnit:r}=n,i=nc(n,["timeUnit"]),o=Sr(r),a=Object.assign(Object.assign({},i),{timeUnit:o});return new rc(e,{[U(a)]:a})}merge(e){this.formula=Object.assign({},this.formula);for(const t in e.formula)this.formula[t]&&!e.formula[t].band||(this.formula[t]=e.formula[t]);for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}removeFormulas(e){const t={};for(const[n,r]of ie(this.formula))e.has(r.as)||(t[n]=r);this.formula=t}producedFields(){return new Set(re(this.formula).map((e=>e.as)))}dependentFields(){return new Set(re(this.formula).map((e=>e.field)))}hash(){return`TimeUnit ${U(this.formula)}`}assemble(){const e=[];for(const t of re(this.formula)){const{field:n,as:r,timeUnit:i}=t,o=Sr(i),{unit:a,utc:s}=o,u=nc(o,["unit","utc"]);e.push(Object.assign(Object.assign(Object.assign(Object.assign({field:he(n),type:"timeunit"},a?{units:Or(a)}:{}),s?{timezone:"utc"}:{}),u),{as:[r,`${r}_end`]}))}return e}}const ic="_tuple_fields";class oc{constructor(...e){this.items=e,this.hasChannel={},this.hasField={}}}const ac={has:()=>!0,parse:(e,t,n)=>{var r,i,o;const a=t.name,s=null!==(r=t.project)&&void 0!==r?r:t.project=new oc,u={},l={},c=new Set,f=(e,t)=>{const n="visual"===t?e.channel:e.field;let r=ae(`${a}_${n}`);for(let e=1;c.has(r);e++)r=ae(`${a}_${n}_${e}`);return c.add(r),{[t]:r}};if(!n.fields&&!n.encodings){const t=e.config.selection[n.type];if(n.init)for(const e of v(n.init))for(const r of ne(e))Lt[r]?(n.encodings||(n.encodings=[])).push(r):"interval"===n.type?(hr('Interval selections should be initialized using "x" and/or "y" keys.'),n.encodings=t.encodings):(n.fields||(n.fields=[])).push(r);else n.encodings=t.encodings,n.fields=t.fields}for(const e of null!==(i=n.fields)&&void 0!==i?i:[]){const t={type:"E",field:e};t.signals=Object.assign({},f(t,"data")),s.items.push(t),s.hasField[e]=t}for(const r of null!==(o=n.encodings)&&void 0!==o?o:[]){const n=e.fieldDef(r);if(n){let i=n.field;if(n.aggregate){hr(Hn(r,n.aggregate));continue}if(!i){hr(Wn(r));continue}if(n.timeUnit){i=e.vgField(r);const t={timeUnit:n.timeUnit,as:i,field:n.field};l[U(t)]=t}if(!u[i]){let o="E";"interval"===t.type?di(e.getScaleComponent(r).get("type"))&&(o="R"):n.bin&&(o="R-RE");const a={field:i,channel:r,type:o};a.signals=Object.assign(Object.assign({},f(a,"data")),f(a,"visual")),s.items.push(u[i]=a),s.hasField[i]=s.hasChannel[r]=u[i]}}else hr(Wn(r))}if(n.init){const e=e=>s.items.map((t=>void 0!==e[t.channel]?e[t.channel]:e[t.field]));if("interval"===n.type)t.init=e(n.init);else{const r=v(n.init);t.init=r.map(e)}}te(l)||(s.timeUnit=new rc(null,l))},signals:(e,t,n)=>{const r=t.name+ic;return n.filter((e=>e.name===r)).length>0?n:n.concat({name:r,value:t.project.items.map((e=>{const{signals:t,hasLegend:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i"single"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind&&!Cs(e.bind),parse:(e,t,n,r)=>{r.on||delete t.events,r.clear||delete t.clear},topLevelSignals:(e,t,n)=>{const r=t.name,i=t.project,o=t.bind,a=t.init&&t.init[0],s=Ql.has(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach(((e,i)=>{var u,l;const c=ae(`${r}_${e.field}`);n.filter((e=>e.name===c)).length||n.unshift(Object.assign(Object.assign({name:c},a?{init:Oc(a[i])}:{value:null}),{on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${s}[${A(e.field)}] : null`}]:[],bind:null!==(l=null!==(u=o[e.field])&&void 0!==u?u:o[e.channel])&&void 0!==l?l:o}))})),n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.filter((e=>e.name===r+zc))[0],a=r+ic,s=i.items.map((e=>ae(`${r}_${e.field}`))),u=s.map((e=>`${e} !== null`)).join(" && ");return s.length&&(o.update=`${u} ? {fields: ${a}, values: [${s.join(", ")}]} : null`),delete o.value,delete o.on,n}},uc="_toggle",lc={has:e=>"multi"===e.type&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+uc,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+zc,r=t.name+uc;return`${r} ? null : ${n}, `+("global"===t.resolve?`${r} ? null : true, `:`${r} ? null : {unit: ${Ic(e)}}, `)+`${r} ? ${n} : null`}},cc={has:e=>void 0!==e.clear&&!1!==e.clear,parse:(e,t,n)=>{n.clear&&(t.clear=k(n.clear)?_l(n.clear,"scope"):n.clear)},topLevelSignals:(e,t,n)=>{if(sc.has(t))for(const e of t.project.items){const r=n.findIndex((n=>n.name===ae(`${t.name}_${e.field}`)));-1!==r&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function r(e,r){-1!==e&&n[e].on&&n[e].on.push({events:t.clear,update:r})}if("interval"===t.type)for(const e of t.project.items){const t=n.findIndex((t=>t.name===e.signals.visual));r(t,"[0, 0]"),-1===t&&r(n.findIndex((t=>t.name===e.signals.data)),"null")}else{let e=n.findIndex((e=>e.name===t.name+zc));r(e,"null"),lc.has(t)&&(e=n.findIndex((e=>e.name===t.name+uc)),r(e,"false"))}return n}},fc={has:e=>"interval"===e.type&&"global"===e.resolve&&e.bind&&"scales"===e.bind,parse:(e,t)=>{const n=t.scales=[];for(const r of t.project.items){const i=r.channel;if(!Dn(i))continue;const o=e.getScaleComponent(i),a=o?o.get("type"):void 0;if(!o||!di(a)){hr("Scale bindings are currently only supported for scales with unbinned, continuous domains.");continue}const s={selection:t.name,field:r.field};o.set("selectionExtent",s,!0),n.push(r)}},topLevelSignals:(e,t,n)=>{const r=t.scales.filter((e=>0===n.filter((t=>t.name===e.signals.data)).length));if(!e.parent||pc(e)||0===r.length)return n;const i=n.filter((e=>e.name===t.name))[0];let o=i.update;if(o.indexOf(Rc)>=0)i.update=`{${r.map((e=>`${A(e.field)}: ${e.signals.data}`)).join(", ")}}`;else{for(const e of r){const t=`${A(e.field)}: ${e.signals.data}`;o.indexOf(t)<0&&(o=`${o.substring(0,o.length-1)}, ${t}}`)}i.update=o}return n.concat(r.map((e=>({name:e.signals.data}))))},signals:(e,t,n)=>{if(e.parent&&!pc(e))for(const e of t.scales){const t=n.filter((t=>t.name===e.signals.data))[0];t.push="outer",delete t.value,delete t.update}return n}},dc=fc;function hc(e,t){return`domain(${A(e.scaleName(t))})`}function pc(e){var t;return e.parent&&Qp(e.parent)&&(null!==(t=!e.parent.parent)&&void 0!==t?t:pc(e.parent.parent))}const gc={has:e=>{const t="global"===e.resolve&&e.bind&&Cs(e.bind),n=1===e.project.items.length&&e.project.items[0].field!==Os;return t&&!n&&hr("Legend bindings are only supported for selections over an individual field or encoding channel."),t&&n},parse:(e,t,n,r)=>{var i;if(r.on||delete t.events,r.clear||delete t.clear,r.on||r.clear){const e='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of t.events)n.filter=v(null!==(i=n.filter)&&void 0!==i?i:[]),n.filter.indexOf(e)<0&&n.filter.push(e)}const o=Ss(t.bind)?t.bind.legend:"click",a=k(o)?_l(o,"view"):v(o);t.bind={legend:{merge:a}}},topLevelSignals:(e,t,n)=>{const r=t.name,i=Ss(t.bind)&&t.bind.legend,o=e=>t=>{const n=R(t);return n.markname=e,n};for(const e of t.project.items){if(!e.hasLegend)continue;const a=`${ae(e.field)}_legend`,s=`${r}_${a}`;if(0===n.filter((e=>e.name===s)).length){const e=i.merge.map(o(`${a}_symbols`)).concat(i.merge.map(o(`${a}_labels`))).concat(i.merge.map(o(`${a}_entries`)));n.unshift(Object.assign(Object.assign({name:s},t.init?{}:{value:null}),{on:[{events:e,update:"datum.value || item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${s}`,force:!0}]}))}}return n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.find((e=>e.name===r+zc)),a=r+ic,s=i.items.filter((e=>e.hasLegend)).map((e=>ae(`${r}_${ae(e.field)}_legend`))),u=`${s.map((e=>`${e} !== null`)).join(" && ")} ? {fields: ${a}, values: [${s.join(", ")}]} : null`;t.events&&s.length>0?o.on.push({events:s.map((e=>({signal:e}))),update:u}):s.length>0&&(o.update=u,delete o.value,delete o.on);const l=n.find((e=>e.name===r+uc)),c=Ss(t.bind)&&t.bind.legend;return l&&(t.events?l.on.push(Object.assign(Object.assign({},l.on[0]),{events:c})):l.on[0].events=c),n}},mc="_translate_anchor",yc="_translate_delta",vc={has:e=>"interval"===e.type&&e.translate,signals:(e,t,n)=>{const r=t.name,i=dc.has(t),o=r+mc,{x:a,y:s}=t.project.hasChannel;let u=_l(t.translate,"scope");return i||(u=u.map((e=>(e.between[0].markname=r+Sc,e)))),n.push({name:o,value:{},on:[{events:u.map((e=>e.between[0])),update:"{x: x(unit), y: y(unit)"+(void 0!==a?", extent_x: "+(i?hc(e,Ge):`slice(${a.signals.visual})`):"")+(void 0!==s?", extent_y: "+(i?hc(e,Ve):`slice(${s.signals.visual})`):"")+"}"}]},{name:r+yc,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==a&&bc(e,t,a,"width",n),void 0!==s&&bc(e,t,s,"height",n),n}};function bc(e,t,n,r,i){var o;const a=t.name,s=a+mc,u=a+yc,l=n.channel,c=dc.has(t),f=i.filter((e=>e.name===n.signals[c?"data":"visual"]))[0],d=e.getSizeSignalRef(r).signal,h=e.getScaleComponent(l),p=h.get("type"),g=`${s}.extent_${l}`,m=`${c?"log"===p?"panLog":"pow"===p?"panPow":"panLinear":"panLinear"}(${g}, ${`${c&&l===Ge?"-":""}${u}.${l} / `+(c?`${d}`:`span(${g})`)}`+(c&&"pow"===p?`, ${null!==(o=h.get("exponent"))&&void 0!==o?o:1}`:"")+")";f.on.push({events:{signal:u},update:c?m:`clampRange(${m}, 0, ${d})`})}const xc="_zoom_anchor",_c="_zoom_delta",wc={has:e=>"interval"===e.type&&e.zoom,signals:(e,t,n)=>{const r=t.name,i=dc.has(t),o=r+_c,{x:a,y:s}=t.project.hasChannel,u=A(e.scaleName(Ge)),l=A(e.scaleName(Ve));let c=_l(t.zoom,"scope");return i||(c=c.map((e=>(e.markname=r+Sc,e)))),n.push({name:r+xc,on:[{events:c,update:i?"{"+[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter((e=>!!e)).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==a&&kc(e,t,a,"width",n),void 0!==s&&kc(e,t,s,"height",n),n}};function kc(e,t,n,r,i){var o;const a=t.name,s=n.channel,u=dc.has(t),l=i.filter((e=>e.name===n.signals[u?"data":"visual"]))[0],c=e.getSizeSignalRef(r).signal,f=e.getScaleComponent(s),d=f.get("type"),h=u?hc(e,s):l.name,p=a+_c,g=`${u?"log"===d?"zoomLog":"pow"===d?"zoomPow":"zoomLinear":"zoomLinear"}(${h}, ${a}${xc}.${s}, ${p}`+(u&&"pow"===d?`, ${null!==(o=f.get("exponent"))&&void 0!==o?o:1}`:"")+")";l.on.push({events:{signal:p},update:u?g:`clampRange(${g}, 0, ${c})`})}const Ac=[ac,lc,dc,gc,vc,wc,sc,Ql,cc];function Ec(e,t){for(const n of Ac)n.has(e)&&t(n)}function Oc(e,t=!0,n=c){if(d(e)){const r=e.map((e=>Oc(e,t,n)));return t?`[${r.join(", ")}]`:r}return pr(e)?n(t?xr(e):function(e){const t=br(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}(e)):t?n(JSON.stringify(e)):e}function Dc(e,t){return Lc(e,((n,r)=>{t=r.marks?r.marks(e,n,t):t,Ec(n,(r=>{r.marks&&(t=r.marks(e,n,t))}))})),t}function Cc(e){return e.map((e=>(e.on&&!e.on.length&&delete e.on,e)))}const Sc="_brush",Fc="_scale_trigger",Mc={signals:(e,t)=>{const n=t.name,r=n+ic,i=dc.has(t),o=[],a=[],s=[];if(t.translate&&!i){const e=`!event.item || event.item.mark.name !== ${A(n+Sc)}`;jc(t,((t,n)=>{var r;const i=v(null!==(r=n.between[0].filter)&&void 0!==r?r:n.between[0].filter=[]);return i.indexOf(e)<0&&i.push(e),t}))}t.project.items.forEach(((n,r)=>{const i=n.channel;if(i!==Ge&&i!==Ve)return void hr("Interval selections only support x and y encoding channels.");const u=t.init?t.init[r]:null,l=function(e,t,n,r){const i=n.channel,o=n.signals.visual,a=n.signals.data,s=dc.has(t),u=A(e.scaleName(i)),l=e.getScaleComponent(i),c=l?l.get("type"):void 0,f=e=>`scale(${u}, ${e})`,d=e.getSizeSignalRef(i===Ge?"width":"height").signal,h=`${i}(unit)`,p=jc(t,((e,t)=>[...e,{events:t.between[0],update:`[${h}, ${h}]`},{events:t,update:`[${o}[0], clamp(${h}, 0, ${d})]`}]));return p.push({events:{signal:t.name+Fc},update:di(c)?`[${f(`${a}[0]`)}, ${f(`${a}[1]`)}]`:"[0, 0]"}),s?[{name:a,on:[]}]:[Object.assign(Object.assign({name:o},r?{init:Oc(r,!0,f)}:{value:[]}),{on:p}),Object.assign(Object.assign({name:a},r?{init:Oc(r)}:{}),{on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${u}, ${o})`}]})]}(e,t,n,u),c=n.signals.data,f=n.signals.visual,d=A(e.scaleName(i)),h=di(e.getScaleComponent(i).get("type"))?"+":"";o.push(...l),a.push(c),s.push({scaleName:e.scaleName(i),expr:`(!isArray(${c}) || (${h}invert(${d}, ${f})[0] === ${h}${c}[0] && ${h}invert(${d}, ${f})[1] === ${h}${c}[1]))`})})),i||o.push({name:n+Fc,value:{},on:[{events:s.map((e=>({scale:e.scaleName}))),update:s.map((e=>e.expr)).join(" && ")+` ? ${n+Fc} : {}`}]});const u=t.init,l=`unit: ${Ic(e)}, fields: ${r}, values`;return o.concat(Object.assign(Object.assign({name:n+zc},u?{init:`{${l}: ${Oc(u)}}`}:{}),{on:[{events:[{signal:a.join(" || ")}],update:a.join(" && ")+` ? {${l}: [${a}]} : null`}]}))},modifyExpr:(e,t)=>t.name+zc+", "+("global"===t.resolve?"true":`{unit: ${Ic(e)}}`),marks:(e,t,n)=>{const r=t.name,{x:i,y:o}=t.project.hasChannel,a=i&&i.signals.visual,s=o&&o.signals.visual,u=`data(${A(t.name+Tc)})`;if(dc.has(t))return n;const l={x:void 0!==i?{signal:`${a}[0]`}:{value:0},y:void 0!==o?{signal:`${s}[0]`}:{value:0},x2:void 0!==i?{signal:`${a}[1]`}:{field:{group:"width"}},y2:void 0!==o?{signal:`${s}[1]`}:{field:{group:"height"}}};if("global"===t.resolve)for(const t of ne(l))l[t]=[Object.assign({test:`${u}.length && ${u}[0].unit === ${Ic(e)}`},l[t]),{value:0}];const c=t.mark,{fill:f,fillOpacity:d,cursor:h}=c,p=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i(e[t]=[{test:[void 0!==i&&`${a}[0] !== ${a}[1]`,void 0!==o&&`${s}[0] !== ${s}[1]`].filter((e=>e)).join(" && "),value:p[t]},{value:null}],e)),{});return[{name:r+Sc+"_bg",type:"rect",clip:!0,encode:{enter:{fill:{value:f},fillOpacity:{value:d}},update:l}},...n,{name:r+Sc,type:"rect",clip:!0,encode:{enter:Object.assign(Object.assign({},h?{cursor:{value:h}}:{}),{fill:{value:"transparent"}}),update:Object.assign(Object.assign({},l),g)}}]}};function jc(e,t){return e.events.reduce(((e,n)=>n.between?t(e,n):(hr(`${n} is not an ordered event stream for interval selections.`),e)),[])}function $c(e,t){const n=t.name,r=n+ic,i=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=i.items.map((t=>{const n=e.fieldDef(t.channel);return n&&n.bin?`[${o}[${A(e.vgField(t.channel,{}))}], ${o}[${A(e.vgField(t.channel,{binSuffix:"end"}))}]]`:`${o}[${A(t.field)}]`})).join(", "),s=`unit: ${Ic(e)}, fields: ${r}, values`,u=t.events;return[{name:n+zc,on:u?[{events:u,update:`datum && item().mark.marktype !== 'group' ? {${s}: [${a}]} : null`,force:!0}]:[]}]}const Nc={signals:$c,modifyExpr:(e,t)=>t.name+zc+", "+("global"===t.resolve?"null":`{unit: ${Ic(e)}}`)},Bc={signals:$c,modifyExpr:(e,t)=>t.name+zc+", "+("global"===t.resolve?"true":`{unit: ${Ic(e)}}`)},Tc="_store",zc="_tuple",Rc="vlSelectionResolve",Pc={single:Bc,multi:Nc,interval:Mc};function Lc(e,t){const n=e.component.selection;if(n)for(const e of re(n))if(!0===t(e,Pc[e.type]))break}function Ic(e,{escape:t}={escape:!0}){let n=t?A(e.name):e.name;const r=function(e){let t=e.parent;for(;t&&!Jp(t);)t=t.parent;return t}(e);if(r){const{facet:e}=r;for(const t of Ft)e[t]&&(n+=` + '__facet_${t}_' + (facet[${A(r.vgField(t))}])`)}return n}function Uc(e){let t=!1;return Lc(e,(e=>{t=t||e.project.items.some((e=>e.field===Os))})),t}function qc(e,t,n){return e.fields=t||[],e.fname=n,e}function Wc(e){return 1===e.length?Hc(e[0]):Gc(e)}const Hc=e=>function(t){return t[e]},Gc=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),s=r=i+1):"]"===o&&(s||Vc("Access path missing open bracket: "+e),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&Vc("Access path missing closing bracket: "+e),a&&Vc("Access path missing closing quote: "+e),i>r&&(i++,l()),t}(e);e=1===r.length?r[0]:e,qc((n&&n.get||Wc)(r),[e],t||e)})("id"),qc((e=>e),[],"identity"),qc((()=>0),[],"zero"),qc((()=>1),[],"one"),qc((()=>!0),[],"true"),qc((()=>!1),[],"false"),Array.isArray,Object.prototype.hasOwnProperty;function Yc(e){this.type=e}var Xc,Zc,Jc,Kc,Qc;Yc.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=function(e){switch(e.type){case"ArrayExpression":return e.elements;case"BinaryExpression":case"LogicalExpression":return[e.left,e.right];case"CallExpression":return[e.callee].concat(e.arguments);case"ConditionalExpression":return[e.test,e.consequent,e.alternate];case"MemberExpression":return[e.object,e.property];case"ObjectExpression":return e.properties;case"Property":return[e.key,e.value];case"UnaryExpression":return[e.argument];default:return[]}}(this),n=0,r=t.length;n",Xc[nf]="Identifier",Xc[rf]="Keyword",Xc[of]="Null",Xc[af]="Numeric",Xc[sf]="Punctuator",Xc[uf]="String",Xc[9]="RegularExpression";var lf="ArrayExpression",cf="BinaryExpression",ff="CallExpression",df="ConditionalExpression",hf="Identifier",pf="Literal",gf="LogicalExpression",mf="MemberExpression",yf="ObjectExpression",vf="Property",bf="UnaryExpression",xf="Unexpected token %0",_f="Unexpected number",wf="Unexpected string",kf="Unexpected identifier",Af="Unexpected reserved word",Ef="Unexpected end of input",Of="Invalid regular expression",Df="Invalid regular expression: missing /",Cf="Octal literals are not allowed in strict mode.",Sf="Duplicate data property in object literal not allowed in strict mode",Ff="ILLEGAL",Mf="Disabled.",jf=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),$f=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05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CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function Nf(e,t){if(!e)throw new Error("ASSERT: "+t)}function Bf(e){return e>=48&&e<=57}function Tf(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function zf(e){return"01234567".indexOf(e)>=0}function Rf(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function Pf(e){return 10===e||13===e||8232===e||8233===e}function Lf(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&jf.test(String.fromCharCode(e))}function If(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&$f.test(String.fromCharCode(e))}const Uf={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function qf(){for(;Jc1114111||"}"!==e)&&id({},xf,Ff),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),r=56320+(t-65536&1023),String.fromCharCode(n,r))}function Gf(){var e,t;for(e=Zc.charCodeAt(Jc++),t=String.fromCharCode(e),92===e&&(117!==Zc.charCodeAt(Jc)&&id({},xf,Ff),++Jc,(e=Wf("u"))&&"\\"!==e&&Lf(e.charCodeAt(0))||id({},xf,Ff),t=e);Jc>>="===(r=Zc.substr(Jc,4))?{type:sf,value:r,start:i,end:Jc+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:sf,value:n,start:i,end:Jc+=3}:a===(t=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t?{type:sf,value:t,start:i,end:Jc+=2}:("//"===t&&id({},xf,Ff),"<>=!+-*%&|^/".indexOf(a)>=0?(++Jc,{type:sf,value:a,start:i,end:Jc}):void id({},xf,Ff))}function Yf(){var e,t,n;if(Nf(Bf((n=Zc[Jc]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=Jc,e="","."!==n){if(e=Zc[Jc++],n=Zc[Jc],"0"===e){if("x"===n||"X"===n)return++Jc,function(e){let t="";for(;Jc=Kc)return{type:tf,start:Jc,end:Jc};const e=Zc.charCodeAt(Jc);return Lf(e)?(t=Jc,n=92===Zc.charCodeAt(Jc)?Gf():function(){var e,t;for(e=Jc++;Jc=0&&Jc(Nf(t=0&&id({},Of,n),{value:n,literal:t}}(),a=function(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((e,t)=>{if(parseInt(t,16)<=1114111)return"x";id({},Of)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){id({},Of)}try{return new RegExp(e,t)}catch(e){return null}}(i.value,o.value),{literal:i.literal+o.literal,value:a,regex:{pattern:i.value,flags:o.value},start:r,end:Jc})),Jf()):od(Zf())}return n}function hd(){const e=[];if(ad("("),!sd(")"))for(;Jc":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function bd(){var e,t;return e=function(){var e,t,n,r,i,o,a,s,u,l;if(e=Qc,u=yd(),0===(i=vd(r=Qc)))return u;for(r.prec=i,Zf(),t=[e,Qc],o=[u,r,a=yd()];(i=vd(Qc))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),t.pop(),n=Kf(s,u,a),o.push(n);(r=Zf()).prec=i,o.push(r),t.push(Qc),n=yd(),o.push(n)}for(n=o[l=o.length-1],t.pop();l>1;)t.pop(),n=Kf(o[l-1].value,o[l-2],n),l-=2;return n}(),sd("?")&&(Zf(),t=bd(),ad(":"),e=function(e,t,n){const r=new Yc(df);return r.test=e,r.consequent=t,r.alternate=n,r}(e,t,bd())),e}function xd(){const e=bd();if(sd(","))throw new Error(Mf);return e}function _d(e){const t=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(t.push(..._d(e.object)),t.push(..._d(e.property))),t)}function wd(e){return"MemberExpression"===e.object.type?wd(e.object):"datum"===e.object.name}function kd(e){const t=function(e){Jc=0,Kc=(Zc=e).length,Qc=null,Jf();const t=xd();if(Qc.type!==tf)throw new Error("Unexpect token after expression.");return t}(e),n=new Set;return t.visit((e=>{"MemberExpression"===e.type&&wd(e)&&n.add(_d(e).slice(1).join("."))})),n}class Ad extends ec{constructor(e,t,n){super(e),this.model=t,this.filter=n,this.expr=Cd(this.model,this.filter,this),this._dependentFields=kd(this.expr)}clone(){return new Ad(null,this.model,R(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}var Ed=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i`length(data(${e}))`)).join(" || ")+") || ":"")+`(${o})`}function Dd(e,t){const n=t.encoding;let r=t.field;if(n||r){if(n&&!r){const i=e.project.items.filter((e=>e.channel===n));!i.length||i.length>1?(r=e.project.items[0].field,hr((i.length?"Multiple ":"No ")+`matching ${A(n)} encoding found for selection ${A(t.selection)}. `+`Using "field": ${A(r)}.`)):r=i[0].field}}else r=e.project.items[0].field,e.project.items.length>1&&hr(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${A(r)}.`);return`${e.name}[${A(r)}]`}function Cd(e,t,n){return se(t,(t=>k(t)?t:function(e){return null==e?void 0:e.selection}(t)?Od(e,t.selection,n):Hr(t)))}var Sd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{test:t}=e,n=Sd(e,["test"]);return Object.assign({test:Cd(null,t)},n)})),n]),delete p[e]}else if(null===o){const t={signal:i.map((e=>{const{test:t}=e,n=Sd(e,["test"]);return`${Cd(null,t)} ? ${Aa(n)} : `})).join("")+Aa(n)};p[e]=t}}else if(Fr(r)){const t=Ee[e];if(t){const{vgProp:n,part:i}=t;Fd(p,i,n,r),delete p[e]}}}if("grid"===t){if(!p.grid)return;if(p.encode){const{grid:e}=p.encode;p.encode=Object.assign({},e?{grid:e}:{}),te(p.encode)&&delete p.encode}return Object.assign(Object.assign({scale:l,orient:u},p),{domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:ye(h,0)})}{if(!r.header&&e.mainExtracted)return;if(void 0!==c){let e=c;(null===(o=null===(i=p.encode)||void 0===i?void 0:i.labels)||void 0===o?void 0:o.update)&&Fr(p.encode.labels.update.text)&&(e=pe(c,"datum.label",p.encode.labels.update.text.signal)),Fd(p,"labels","text",{signal:e})}if(null===p.labelAlign&&delete p.labelAlign,p.encode){for(const t of De)e.hasAxisPart(t)||delete p.encode[t];te(p.encode)&&delete p.encode}const t=function(e,t){if(e)return d(e)&&!va(e)?e.map((e=>ra(e,t))).join(", "):e}(f,n);return Object.assign(Object.assign(Object.assign(Object.assign({scale:l,orient:u,grid:!1},t?{title:t}:{}),p),!1===n.aria?{aria:!1}:{}),{zindex:ye(h,0)})}}}function jd(e){const{axes:t}=e.component,n=[];for(const r of cn)if(t[r])for(const i of t[r])if(!i.get("disable")&&!i.get("gridScale")){const t="x"===r?"height":"width",i=e.getSizeSignalRef(t).signal;t!==i&&n.push({name:t,update:i})}return n}function $d(e,t,n,r){return Object.assign.apply(null,[{},...e.map((e=>{if("axisOrient"===e){const e="x"===n?"bottom":"left",i=t["x"===n?"axisBottom":"axisLeft"]||{},o=t["x"===n?"axisTop":"axisRight"]||{},a=new Set([...ne(i),...ne(o)]),s={};for(const t of a.values())s[t]={signal:`${r.signal} === "${e}" ? ${Ea(i[t])} : ${Ea(o[t])}`};return s}return t[e]}))])}function Nd(e,t){var n;const r=[{}];for(const i of e){let e=null===(n=t[i])||void 0===n?void 0:n.style;if(e){e=v(e);for(const n of e)r.push(t.style[n])}}return Object.assign.apply(null,r)}function Bd(e,t,n,r={}){var i;const o=Fa(e,n,t);if(void 0!==o)return{configFrom:"style",configValue:o};for(const t of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(void 0!==(null===(i=r[t])||void 0===i?void 0:i[e]))return{configFrom:t,configValue:r[t][e]};return{}}const Td={scale:({model:e,channel:t})=>e.scaleName(t),format:({fieldOrDatumDef:e,config:t,axis:n})=>{const{format:r,formatType:i}=n;return ho(e,e.type,r,i,t,!0)},formatType:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return po(r,t,n)},grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>{var r;return(!To(e)||!Nn(e.bin))&&(null!==(r=t.grid)&&void 0!==r?r:function(e,t){return!fi(e)&&To(t)&&!$n(null==t?void 0:t.bin)}(n,e))},gridScale:({model:e,channel:t})=>function(e,t){const n="x"===t?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelAlign||Pd(t,n,r),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelBaseline||Rd(t,n,r),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>{var r;return null!==(r=e.labelFlush)&&void 0!==r?r:function(e,t){if("x"===t&&W(["quantitative","temporal"],e))return!0}(t.type,n)},labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{var r;return null!==(r=e.labelOverlap)&&void 0!==r?r:function(e,t,n,r){if(n&&!h(r)||"nominal"!==e&&"ordinal"!==e)return"log"!==t&&"symlog"!==t||"greedy"}(t.type,n,To(t)&&!!t.timeUnit,To(t)?t.sort:void 0)},orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:r,scaleType:i})=>{var o;const a="x"===e?"width":"y"===e?"height":void 0,s=a?t.getSizeSignalRef(a):void 0;return null!==(o=n.tickCount)&&void 0!==o?o:function({fieldOrDatumDef:e,scaleType:t,size:n,values:r}){var i;if(!r&&!fi(t)&&"log"!==t){if(To(e)){if($n(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&W(["month","hours","day","quarter"],null===(i=Sr(e.timeUnit))||void 0===i?void 0:i.unit))return}return{signal:`ceil(${n.signal}/40)`}}}({fieldOrDatumDef:r,scaleType:i,size:s,values:n.values})},title:({axis:e,model:t,channel:n})=>{if(void 0!==e.title)return e.title;const r=Ld(t,n);if(void 0!==r)return r;const i=t.typedFieldDef(n),o="x"===n?"x2":"y2",a=t.fieldDef(o);return ja(i?[So(i)]:[],To(a)?[So(a)]:[])},values:({axis:e,fieldOrDatumDef:t})=>function(e,t){const n=e.values;return d(n)?pa(t,n):Fr(n)?n:void 0}(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>{var r;return null!==(r=e.zindex)&&void 0!==r?r:function(e,t){return"rect"===e&&Zo(t)?1:0}(n,t)}};function zd(e){return`(((${e.signal} % 360) + 360) % 360)`}function Rd(e,t,n,r){if(void 0!==e){if("x"===n){if(Fr(e)){const n=zd(e);return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${Fr(t)?`(${t.signal} === "top")`:"top"===t} ? "bottom" : "top"`}}if(45{if(Wo(t)&&Ao(t.sort)){const{field:r,timeUnit:i}=t,o=t.sort,a=o.map(((e,t)=>`${Hr({field:r,timeUnit:i,equal:e})} ? ${t} : `)).join("")+o.length;e=new Id(e,{calculate:a,as:Ud(t,n,{forAs:!0})})}})),e}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${U(this.transform)}`}}function Ud(e,t,n){return Xo(e,Object.assign({prefix:t,suffix:"sort_index"},null!=n?n:{}))}function qd(e,t){return W(["top","bottom"],t)?"column":W(["left","right"],t)||"row"===e?"row":"column"}function Wd(e,t,n,r){const i="row"===r?n.headerRow:"column"===r?n.headerColumn:n.headerFacet;return ye((t||{})[e],i[e],n.header[e])}function Hd(e,t,n,r){const i={};for(const o of e){const e=Wd(o,t||{},n,r);void 0!==e&&(i[o]=e)}return i}const Gd=["row","column"],Vd=["header","footer"];function Yd(e,t){const n=e.component.layoutHeaders[t].title,r=e.config?e.config:void 0,i=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:a,titleOrient:s}=Hd(["titleAnchor","titleAngle","titleOrient"],i.header,r,t),u=qd(t,s),l=ke(a);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:n},"row"===t?{orient:"left"}:{}),{style:"guide-title"}),Zd(l,u)),Xd(u,l,o)),rh(r,i,t,bs,ys))}}function Xd(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=Pd(t,"row"===e?"left":"top","row"===e?"y":"x");return r?{align:r}:{}}function Zd(e,t){const n=Rd(e,"row"===t?"left":"top","row"===t?"y":"x",!0);return n?{baseline:n}:{}}function Jd(e,t){const n=e.component.layoutHeaders[t],r=[];for(const i of Vd)if(n[i])for(const o of n[i]){const a=eh(e,t,i,n,o);null!=a&&r.push(a)}return r}function Kd(e,t){var n;const{sort:r}=e;return ko(r)?{field:Xo(r,{expr:"datum"}),order:null!==(n=r.order)&&void 0!==n?n:"ascending"}:d(r)?{field:Ud(e,t,{expr:"datum"}),order:"ascending"}:{field:Xo(e,{expr:"datum"}),order:null!=r?r:"ascending"}}function Qd(e,t,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:u}=Hd(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=lo({fieldOrDatumDef:e,format:r,formatType:i,expr:"parent",config:n}).signal,c=qd(t,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:{signal:u?pe(pe(u,"datum.label",l),"datum.value",Xo(e,{expr:"parent"})):l}},"row"===t?{orient:"left"}:{}),{style:"guide-label",frame:"group"}),Zd(o,c)),Xd(c,o,a)),rh(n,e,t,xs,vs))}function eh(e,t,n,r,i){if(i){let o=null;const{facetFieldDef:a}=r,s=e.config?e.config:void 0;if(a&&i.labels){const{labelOrient:e}=Hd(["labelOrient"],a.header,s,t);("row"===t&&!W(["top","bottom"],e)||"column"===t&&!W(["left","right"],e))&&(o=Qd(a,t,s))}const u=Jp(e)&&!Eo(e.facet),l=i.axes,c=(null==l?void 0:l.length)>0;if(o||c){const s="row"===t?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`},r.facetFieldDef?{from:{data:e.getName(t+"_domain")},sort:Kd(a,t)}:{}),c&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{}),o?{title:o}:{}),i.sizeSignal?{encode:{update:{[s]:i.sizeSignal}}}:{}),c?{axes:l}:{})}}return null}const th={column:{start:0,end:1},row:{start:1,end:0}};function nh(e,t){return th[t][e]}function rh(e,t,n,r,i){const o={};for(const a of r){if(!i[a])continue;const r=Wd(a,null==t?void 0:t.header,e,n);void 0!==r&&(o[i[a]]=r)}return o}function ih(e){return[...oh(e,"width"),...oh(e,"height"),...oh(e,"childWidth"),...oh(e,"childHeight")]}function oh(e,t){const n="width"===t?"x":"y",r=e.component.layoutSize.get(t);if(!r||"merged"===r)return[];const i=e.getSizeSignalRef(t).signal;if("step"===r){const t=e.getScaleComponent(n);if(t){const r=t.get("type"),o=t.get("range");if(fi(r)&&Mr(o)){const r=e.scaleName(n);return Jp(e.parent)&&"independent"===e.parent.component.resolve.scale[n]?[ah(r,o)]:[ah(r,o),{name:i,update:sh(r,t,`domain('${r}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==r){const t=i.endsWith("width"),n=t?"containerSize()[0]":"containerSize()[1]",r=`isFinite(${n}) ? ${n} : ${zs(e.config.view,t?"width":"height")}`;return[{name:i,init:r,on:[{update:r,events:"window:resize"}]}]}return[{name:i,value:r}]}function ah(e,t){return{name:e+"_step",value:t.step}}function sh(e,t,n){const r=t.get("type"),i=t.get("padding"),o=ye(t.get("paddingOuter"),i);let a=t.get("paddingInner");return a="band"===r?void 0!==a?a:i:1,`bandspace(${n}, ${Ea(a)}, ${Ea(o)}) * ${e}_step`}function uh(e){return"childWidth"===e?"width":"childHeight"===e?"height":e}function lh(e,t){return ne(e).reduce(((n,r)=>{const i=e[r];return Object.assign(Object.assign({},n),El(t,i,r,(e=>ka(e.value))))}),{})}function ch(e,t){if(Qp(t)||Jp(t))return"shared";if(Kp(t))return fn(e)?"independent":"shared";throw new Error("invalid model type for resolve")}function fh(e,t){const n=e.scale[t],r=fn(t)?"axis":"legend";return"independent"===n?("shared"===e[r][t]&&hr(function(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}(t)),"independent"):e[r][t]||"shared"}const dh=Object.assign(Object.assign({},ks),{disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1}),hh=ne(dh);class ph extends Fu{}const gh={symbols:function(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i,legendType:o}){var a,s,u,l,c,f,h,p;if("symbol"!==o)return;const{markDef:g,encoding:m,config:y,mark:v}=n,b=g.filled&&"trail"!==v;let x=Object.assign(Object.assign({},function(e,t,n){for(const r of n){const n=Ca(r,t.markDef,t.config);void 0!==n&&(e[r]=ka(n))}return e}({},n,Yi)),jl(n,{filled:b}));const _=null!==(a=i.get("symbolOpacity"))&&void 0!==a?a:y.legend.symbolOpacity,w=null!==(s=i.get("symbolFillColor"))&&void 0!==s?s:y.legend.symbolFillColor,k=null!==(u=i.get("symbolStrokeColor"))&&void 0!==u?u:y.legend.symbolStrokeColor,A=void 0===_?null!==(l=mh(m.opacity))&&void 0!==l?l:g.opacity:void 0;if(x.fill)if("fill"===r||b&&r===it)delete x.fill;else if(x.fill.field)w?delete x.fill:(x.fill=ka(null!==(c=y.legend.symbolBaseFillColor)&&void 0!==c?c:"black"),x.fillOpacity=ka(null!=A?A:1));else if(d(x.fill)){const e=null!==(p=null!==(h=yh(null!==(f=m.fill)&&void 0!==f?f:m.color))&&void 0!==h?h:g.fill)&&void 0!==p?p:b&&g.color;e&&(x.fill=ka(e))}if(x.stroke)if("stroke"===r||!b&&r===it)delete x.stroke;else if(x.stroke.field||k)delete x.stroke;else if(d(x.stroke)){const e=ye(yh(m.stroke||m.color),g.stroke,b?g.color:void 0);e&&(x.stroke={value:e})}if(r!==ct){const e=To(t)&&bh(0,i,t);e?x.opacity=[Object.assign({test:e},ka(null!=A?A:1)),ka(y.legend.unselectedOpacity)]:A&&(x.opacity=ka(A))}return x=Object.assign(Object.assign({},x),e),te(x)?void 0:x},gradient:function(e,{model:t,legendType:n,legendCmpt:r}){var i;if("gradient"!==n)return;const{config:o,markDef:a,encoding:s}=t;let u={};const l=void 0===(null!==(i=r.get("gradientOpacity"))&&void 0!==i?i:o.legend.gradientOpacity)?mh(s.opacity)||a.opacity:void 0;return l&&(u.opacity=ka(l)),u=Object.assign(Object.assign({},u),e),te(u)?void 0:u},labels:function(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},a=n.config,s=To(t)?bh(0,i,t):void 0,u=s?[{test:s,value:1},{value:a.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=o,f=ao(c)?fo({fieldOrDatumDef:t,field:"datum.value",format:l,formatType:c,config:a}):void 0,d=Object.assign(Object.assign(Object.assign({},u?{opacity:u}:{}),f?{text:f}:{}),e);return te(d)?void 0:d},entries:function(e,{legendCmpt:t}){const n=t.get("selections");return(null==n?void 0:n.length)?Object.assign(Object.assign({},e),{fill:{value:"transparent"}}):e}};function mh(e){return vh(e,((e,t)=>Math.max(e,t.value)))}function yh(e){return vh(e,((e,t)=>ye(e,t.value)))}function vh(e,t){return function(e){const t=e&&e.condition;return!!t&&(d(t)||qo(t))}(e)?v(e.condition).reduce(t,e.value):qo(e)?e.value:void 0}function bh(e,t,n){const r=t.get("selections");if(!(null==r?void 0:r.length))return;const i=A(n.field);return r.map((e=>`(!length(data(${A(ae(e)+Tc)})) || (${e}[${i}] && indexof(${e}[${i}], datum.value) >= 0))`)).join(" || ")}const xh={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:r,formatType:i}=t;return ho(e,e.type,r,i,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return po(r,t,n)},gradientLength:e=>{var t,n;const{legend:r,legendConfig:i}=e;return null!==(n=null!==(t=r.gradientLength)&&void 0!==t?t:i.gradientLength)&&void 0!==n?n:function({legendConfig:e,model:t,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:a,gradientVerticalMaxLength:s,gradientVerticalMinLength:u}=e;if(hi(i))return"horizontal"===n?"top"===r||"bottom"===r?wh(t,"width",a,o):a:wh(t,"height",u,s)}(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>{var r,i;return null!==(i=null!==(r=e.labelOverlap)&&void 0!==r?r:t.labelOverlap)&&void 0!==i?i:function(e){if(W(["quantile","threshold","log","symlog"],e))return"greedy"}(n)},symbolType:({legend:e,markDef:t,channel:n,encoding:r})=>{var i;return null!==(i=e.symbolType)&&void 0!==i?i:function(e,t,n,r){var i;if("shape"!==t){const e=null!==(i=yh(n))&&void 0!==i?i:r;if(e)return e}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(t.type,n,r.shape,t.shape)},title:({fieldOrDatumDef:e,config:t})=>ta(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(Ct(n)&&hi(t)){if("gradient"===e)return}else if("symbol"===e)return;return e},values:({fieldOrDatumDef:e,legend:t})=>function(e,t){const n=e.values;return d(n)?pa(t,n):Fr(n)?n:void 0}(t,e)};function _h({legendConfig:e,legendType:t,orient:n,legend:r}){var i,o;return null!==(o=null!==(i=r.direction)&&void 0!==i?i:e[t?"gradientDirection":"symbolDirection"])&&void 0!==o?o:function(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===t?"horizontal":void 0}}(n,t)}function wh(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function kh(e){const t=Zp(e)?function(e){const{encoding:t}=e,n={};for(const r of[it,...ws]){const i=aa(t[r]);i&&e.getScaleComponent(r)&&(r===st&&To(i)&&i.type===Qr||(n[r]=Eh(e,r)))}return n}(e):function(e){const{legends:t,resolve:n}=e.component;for(const r of e.children){kh(r);for(const i of ne(r.component.legends))n.legend[i]=fh(e.component.resolve,i),"shared"===n.legend[i]&&(t[i]=Oh(t[i],r.component.legends[i]),t[i]||(n.legend[i]="independent",delete t[i]))}for(const r of ne(t))for(const t of e.children)t.component.legends[r]&&"shared"===n.legend[r]&&delete t.component.legends[r];return t}(e);return e.component.legends=t,t}function Ah(e,t,n,r){switch(t){case"disable":return void 0!==n;case"values":return!!(null==n?void 0:n.values);case"title":if("title"===t&&e===(null==r?void 0:r.title))return!0}return e===(n||{})[t]}function Eh(e,t){var n,r,i;let o=e.legend(t);const{markDef:a,encoding:s,config:u}=e,l=u.legend,c=new ph({},function(e,t){const n=e.scaleName(t);if("trail"===e.mark){if("color"===t)return{stroke:n};if("size"===t)return{strokeWidth:n}}return"color"===t?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}(e,t));!function(e,t,n){var r;const i=null===(r=e.fieldDef(t))||void 0===r?void 0:r.field;Lc(e,(e=>{var r,o;const a=null!==(r=e.project.hasField[i])&&void 0!==r?r:e.project.hasChannel[t];if(a&&gc.has(e)){const t=null!==(o=n.get("selections"))&&void 0!==o?o:[];t.push(e.name),n.set("selections",t,!1),a.hasLegend=!0}}))}(e,t,c);const f=void 0!==o?!o:l.disable;if(c.set("disable",f,void 0!==o),f)return c;o=o||{};const d=e.getScaleComponent(t).get("type"),h=aa(s[t]),p=To(h)?null===(n=Sr(h.timeUnit))||void 0===n?void 0:n.unit:void 0,g=o.orient||u.legend.orient||"right",m=function(e){const{legend:t}=e;return ye(t.type,function({channel:e,timeUnit:t,scaleType:n}){if(Ct(e)){if(W(["quarter","month","day"],t))return"symbol";if(hi(n))return"gradient"}return"symbol"}(e))}({legend:o,channel:t,timeUnit:p,scaleType:d}),y={legend:o,channel:t,model:e,markDef:a,encoding:s,fieldOrDatumDef:h,legendConfig:l,config:u,scaleType:d,orient:g,legendType:m,direction:_h({legend:o,legendType:m,orient:g,legendConfig:l})};for(const n of hh){if("gradient"===m&&n.startsWith("symbol")||"symbol"===m&&n.startsWith("gradient"))continue;const r=n in xh?xh[n](y):o[n];if(void 0!==r){const i=Ah(r,n,o,e.fieldDef(t));(i||void 0===u.legend[n])&&c.set(n,r,i)}}const v=null!==(r=null==o?void 0:o.encoding)&&void 0!==r?r:{},b=c.get("selections"),x={},_={fieldOrDatumDef:h,model:e,channel:t,legendCmpt:c,legendType:m};for(const t of["labels","legend","title","symbols","gradient","entries"]){const n=lh(null!==(i=v[t])&&void 0!==i?i:{},e),r=t in gh?gh[t](n,_):n;void 0===r||te(r)||(x[t]=Object.assign(Object.assign(Object.assign({},(null==b?void 0:b.length)&&To(h)?{name:`${ae(h.field)}_legend_${t}`}:{}),(null==b?void 0:b.length)?{interactive:!!b}:{}),{update:r}))}return te(x)||c.set("encode",x,!!(null==o?void 0:o.encoding)),c}function Oh(e,t){var n,r,i,o;if(!e)return t.clone();const a=e.getWithExplicit("orient"),s=t.getWithExplicit("orient");if(a.explicit&&s.explicit&&a.value!==s.value)return;let u=!1;for(const n of hh){const r=Bu(e.getWithExplicit(n),t.getWithExplicit(n),n,"legend",((e,t)=>{switch(n){case"symbolType":return r=e,"circle"===(i=t).value?i:r;case"title":return Na(e,t);case"type":return u=!0,ju("symbol")}var r,i;return Nu(e,t,n,"legend")}));e.setWithExplicit(n,r)}return u&&((null===(r=null===(n=e.implicit)||void 0===n?void 0:n.encode)||void 0===r?void 0:r.gradient)&&ue(e.implicit,["encode","gradient"]),(null===(o=null===(i=e.explicit)||void 0===i?void 0:i.encode)||void 0===o?void 0:o.gradient)&&ue(e.explicit,["encode","gradient"])),e}function Dh(e){const t=e.component.legends,n={};for(const r of ne(t)){const i=e.getScaleComponent(r),o=I(i.get("domains"));if(n[o])for(const e of n[o])Oh(e,t[r])||n[o].push(t[r]);else n[o]=[t[r].clone()]}const r=re(n).flat().map((t=>function(e,t){var n,r,i;const o=e.combine(),{disable:a,labelExpr:s,selections:u}=o,l=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ivoid 0!==e));return r}function Ch(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:r}=n;if(t.data){const i={signal:`[${t.size.map((e=>e.signal)).join(", ")}]`},o=t.data.reduce(((t,n)=>{const r=Fr(n)?n.signal:`data('${e.lookupDataSource(n)}')`;return W(t,r)||t.push(r),t}),[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[Object.assign({name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]}},n)]}return[Object.assign(Object.assign({name:r},{translate:{signal:"[width / 2, height / 2]"}}),n)]}const Sh=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class Fh extends Fu{constructor(e,t,n,r){super(Object.assign({},t),{name:e}),this.specifiedProjection=t,this.size=n,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function Mh(e){e.component.projection=Zp(e)?function(e){var t;if(e.hasProjection){const n=e.specifiedProjection,r=!(n&&(null!=n.scale||null!=n.translate)),i=r?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,o=r?function(e){const t=[],{encoding:n}=e;for(const r of[[tt,et],[rt,nt]])(aa(n[r[0]])||aa(n[r[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(st)&&e.typedFieldDef(st).type===Qr&&t.push({signal:e.getName(`geojson_${t.length}`)}),0===t.length&&t.push(e.requestDataName(Wu.Main)),t}(e):void 0;return new Fh(e.projectionName(!0),Object.assign(Object.assign({},null!==(t=e.config.projection)&&void 0!==t?t:{}),null!=n?n:{}),i,o)}}(e):function(e){if(0===e.children.length)return;let t;for(const t of e.children)Mh(t);const n=G(e.children,(e=>{const n=e.component.projection;if(n){if(t){const e=function(e,t){const n=G(Sh,(n=>!x(e.explicit,n)&&!x(t.explicit,n)||!(!x(e.explicit,n)||!x(t.explicit,n)||I(e.get(n))!==I(t.get(n)))));if(I(e.size)===I(t.size)){if(n)return e;if(I(e.explicit)===I({}))return t;if(I(t.explicit)===I({}))return e}return null}(t,n);return e&&(t=e),!!e}return t=n,!0}return!0}));if(t&&n){const n=e.projectionName(!0),r=new Fh(n,t.specifiedProjection,t.size,R(t.data));for(const t of e.children){const e=t.component.projection;e&&(e.isFit&&r.data.push(...t.component.projection.data),t.renameProjection(e.get("name"),n),e.merged=!0)}return r}}(e)}function jh(e,t){return`${jn(e)}_${t}`}function $h(e,t,n){var r;const i=jh(null!==(r=ca(n,void 0))&&void 0!==r?r:{},t);return e.getName(`${i}_bins`)}function Nh(e,t,n){let r,i;r=function(e){return"as"in e}(e)?k(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:[Xo(e,{forAs:!0}),Xo(e,{binSuffix:"end",forAs:!0})];const o=Object.assign({},ca(t,void 0)),a=jh(o,e.field),{signal:s,extentSignal:u}=function(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}(n,a);if(Tn(o.extent)){const e=o.extent,t=e.selection;i=Dd(n.getSelectionComponent(ae(t),t),e),delete o.extent}return{key:a,binComponent:Object.assign(Object.assign(Object.assign({bin:o,field:e.field,as:[r]},s?{signal:s}:{}),u?{extentSignal:u}:{}),i?{span:i}:{})}}class Bh extends ec{constructor(e,t){super(e),this.bins=t}clone(){return new Bh(null,R(this.bins))}static makeFromEncoding(e,t){const n=t.reduceFieldDef(((e,n,r)=>{if(Uo(n)&&$n(n.bin)){const{key:i,binComponent:o}=Nh(n,n.bin,t);e[i]=Object.assign(Object.assign(Object.assign({},o),e[i]),function(e,t,n,r){var i,o;if(ga(t,n)){const a=Zp(e)&&null!==(o=null!==(i=e.axis(n))&&void 0!==i?i:e.legend(n))&&void 0!==o?o:{},s=Xo(t,{expr:"datum"}),u=Xo(t,{expr:"datum",binSuffix:"end"});return{formulaAs:Xo(t,{binSuffix:"range",forAs:!0}),formula:vo(s,u,a.format,a.formatType,r)}}return{}}(t,n,r,t.config))}return e}),{});return te(n)?null:new Bh(e,n)}static makeFromTransform(e,t,n){const{key:r,binComponent:i}=Nh(t,t.bin,n);return new Bh(e,{[r]:i})}merge(e,t){for(const n of ne(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=X([...this.bins[n].as,...e.bins[n].as],U)):this.bins[n]=e.bins[n];for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}producedFields(){return new Set(re(this.bins).map((e=>e.as)).flat(2))}dependentFields(){return new Set(re(this.bins).map((e=>e.field)))}hash(){return`Bin ${U(this.bins)}`}assemble(){return re(this.bins).flatMap((e=>{const t=[],[n,...r]=e.as,i=e.bin,{extent:o}=i,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{e.aggregate&&(n=!0)}));const r={},i=new Set;return n?(t.forEachFieldDef(((e,n)=>{var o,a,s,u;const{aggregate:l,field:c}=e;if(l)if("count"===l)r["*"]=null!==(o=r["*"])&&void 0!==o?o:{},r["*"].count=new Set([Xo(e,{forAs:!0})]);else{if(Be(l)||Te(l)){const e=Be(l)?"argmin":"argmax",t=l[e];r[t]=null!==(a=r[t])&&void 0!==a?a:{},r[t][e]=new Set([Xo({op:e,field:t},{forAs:!0})])}else r[c]=null!==(s=r[c])&&void 0!==s?s:{},r[c][l]=new Set([Xo(e,{forAs:!0})]);Dn(n)&&"unaggregated"===t.scaleDomain(n)&&(r[c]=null!==(u=r[c])&&void 0!==u?u:{},r[c].min=new Set([Xo({field:c,aggregate:"min"},{forAs:!0})]),r[c].max=new Set([Xo({field:c,aggregate:"max"},{forAs:!0})]))}else!function(e,t,n,r){const i=Zp(r)?r.encoding[Gt(t)]:void 0;if(Uo(n)&&Zp(r)&&jo(t,n,i,r.stack,r.markDef,r.config))e.add(Xo(n,{})),e.add(Xo(n,{suffix:"end"})),n.bin&&ga(n,t)&&e.add(Xo(n,{binSuffix:"range"}));else if(t in Et){const n=function(e){switch(e){case et:return"y";case nt:return"y2";case tt:return"x";case rt:return"x2"}}(t);e.add(r.getName(n))}else e.add(Xo(n))}(i,n,e,t)})),i.size+ne(r).length===0?null:new Th(e,i,r)):null}static makeFromTransform(e,t){var n,r,i;const o=new Set,a={};for(const e of t.aggregate){const{op:t,field:i,as:o}=e;t&&("count"===t?(a["*"]=null!==(n=a["*"])&&void 0!==n?n:{},a["*"].count=new Set([o||Xo(e,{forAs:!0})])):(a[i]=null!==(r=a[i])&&void 0!==r?r:{},a[i][t]=new Set([o||Xo(e,{forAs:!0})])))}for(const e of null!==(i=t.groupby)&&void 0!==i?i:[])o.add(e);return o.size+ne(a).length===0?null:new Th(e,o,a)}merge(e){return J(this.dimensions,e.dimensions)?(function(e,t){var n;for(const r of ne(t)){const i=t[r];for(const t of ne(i))r in e?e[r][t]=new Set([...null!==(n=e[r][t])&&void 0!==n?n:[],...i[t]]):e[r]={[t]:i[t]}}}(this.measures,e.measures),!0):(function(...e){dr.debug(...e)}("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...ne(this.measures)])}producedFields(){const e=new Set;for(const t of ne(this.measures))for(const n of ne(this.measures[t])){const r=this.measures[t][n];0===r.size?e.add(`${n}_${t}`):r.forEach(e.add,e)}return e}hash(){return`Aggregate ${U({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const e=[],t=[],n=[];for(const r of ne(this.measures))for(const i of ne(this.measures[r]))for(const o of this.measures[r][i])n.push(o),e.push(i),t.push("*"===r?null:he(r));return{type:"aggregate",groupby:[...this.dimensions].map(he),ops:e,fields:t,as:n}}}class zh extends ec{constructor(e,t,n,r){super(e),this.model=t,this.name=n,this.data=r;for(const e of Ft){const n=t.facet[e];if(n){const{bin:r,sort:i}=n;this[e]=Object.assign({name:t.getName(`${e}_domain`),fields:[Xo(n),...$n(r)?[Xo(n,{binSuffix:"end"})]:[]]},ko(i)?{sortField:i}:d(i)?{sortIndexField:Ud(n,e)}:{})}}this.childModel=t.child}hash(){let e="Facet";for(const t of Ft)this[t]&&(e+=` ${t.charAt(0)}:${U(this[t])}`);return e}get fields(){var e;const t=[];for(const n of Ft)(null===(e=this[n])||void 0===e?void 0:e.fields)&&t.push(...this[n].fields);return t}dependentFields(){const e=new Set(this.fields);for(const t of Ft)this[t]&&(this[t].sortField&&e.add(this[t].sortField.field),this[t].sortIndexField&&e.add(this[t].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const t of cn){const n=this.childModel.component.scales[t];if(n&&!n.merged){const r=n.get("type"),i=n.get("range");if(fi(r)&&Mr(i)){const n=Cp(Sp(this.childModel,t));n?e[t]=n:hr(qn(t))}}}return e}assembleRowColumnHeaderData(e,t,n){const r={row:"y",column:"x"}[e],i=[],o=[],a=[];n&&n[r]&&(t?(i.push(`distinct_${n[r]}`),o.push("max")):(i.push(n[r]),o.push("distinct")),a.push(`distinct_${n[r]}`));const{sortField:s,sortIndexField:u}=this[e];if(s){const{op:e=bo,field:t}=s;i.push(t),o.push(e),a.push(Xo(s,{forAs:!0}))}else u&&(i.push(u),o.push("max"),a.push(u));return{name:this[e].name,source:null!=t?t:this.data,transform:[Object.assign({type:"aggregate",groupby:this[e].fields},i.length?{fields:i,ops:o,as:a}:{})]}}assembleFacetHeaderData(e){var t,n;const{columns:r}=this.model.layout,{layoutHeaders:i}=this.model.component,o=[],a={};for(const e of Gd){for(const r of Vd){const o=null!==(t=i[e]&&i[e][r])&&void 0!==t?t:[];for(const t of o)if((null===(n=t.axes)||void 0===n?void 0:n.length)>0){a[e]=!0;break}}if(a[e]){const t=`length(data("${this.facet.name}"))`,n="row"===e?r?{signal:`ceil(${t} / ${r})`}:1:r?{signal:`min(${t}, ${r})`}:{signal:t};o.push({name:`${this.facet.name}_${e}`,transform:[{type:"sequence",start:0,stop:n}]})}}const{row:s,column:u}=a;return(s||u)&&o.unshift(this.assembleRowColumnHeaderData("facet",null,e)),o}assemble(){var e,t;const n=[];let r=null;const i=this.getChildIndependentFieldsWithStep(),{column:o,row:a,facet:s}=this;if(o&&a&&(i.x||i.y)){r=`cross_${this.column.name}_${this.row.name}`;const o=[].concat(null!==(e=i.x)&&void 0!==e?e:[],null!==(t=i.y)&&void 0!==t?t:[]),a=o.map((()=>"distinct"));n.push({name:r,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:o,ops:a}]})}for(const e of[We,qe])this[e]&&n.push(this.assembleRowColumnHeaderData(e,r,i));if(s){const e=this.assembleFacetHeaderData(i);e&&n.push(...e)}return n}}function Rh(e){return"'"===e[0]&&"'"===e[e.length-1]||'"'===e[0]&&'"'===e[e.length-1]?e.slice(1,-1):e}function Ph(e){const t={};return B(e.filter,(e=>{var n;if(qr(e)){let r=null;Tr(e)?r=_a(e.equal):Rr(e)?r=_a(e.lte):zr(e)?r=_a(e.lt):Pr(e)?r=_a(e.gt):Lr(e)?r=_a(e.gte):Ir(e)?r=e.range[0]:Ur(e)&&(r=(null!==(n=e.oneOf)&&void 0!==n?n:e.in)[0]),r&&(pr(r)?t[e.field]="date":w(r)?t[e.field]="number":k(r)&&(t[e.field]="string")),e.timeUnit&&(t[e.field]="date")}})),t}class Lh extends ec{constructor(e,t){super(e),this._parse=t}clone(){return new Lh(null,R(this._parse))}hash(){return`Parse ${U(this._parse)}`}static makeExplicit(e,t,n){let r={};const i=t.data;return!Lu(i)&&i&&i.format&&i.format.parse&&(r=i.format.parse),this.makeWithAncestors(e,r,{},n)}static makeWithAncestors(e,t,n,r){for(const e of ne(n)){const t=r.getWithExplicit(e);void 0!==t.value&&(t.explicit||t.value===n[e]||"derived"===t.value||"flatten"===n[e]?delete n[e]:hr(Yn(e,n[e],t.value)))}for(const e of ne(t)){const n=r.get(e);void 0!==n&&(n===t[e]?delete t[e]:hr(Yn(e,t[e],n)))}const i=new Fu(t,n);r.copyAll(i);const o={};for(const e of ne(i.combine())){const t=i.get(e);null!==t&&(o[e]=t)}return 0===ne(o).length||r.parseNothing?null:new Lh(e,o)}get parse(){return this._parse}merge(e){this._parse=Object.assign(Object.assign({},this._parse),e.parse),e.remove()}assembleFormatParse(){const e={};for(const t of ne(this._parse)){const n=this._parse[t];1===me(t)&&(e[t]=n)}return e}producedFields(){return new Set(ne(this._parse))}dependentFields(){return new Set(ne(this._parse))}assembleTransforms(e=!1){return ne(this._parse).filter((t=>!e||me(t)>1)).map((e=>{const t=function(e,t){const n=ce(e);return"number"===t?`toNumber(${n})`:"boolean"===t?`toBoolean(${n})`:"string"===t?`toString(${n})`:"date"===t?`toDate(${n})`:"flatten"===t?n:0===t.indexOf("date:")?`timeParse(${n},'${Rh(t.slice(5,t.length))}')`:0===t.indexOf("utc:")?`utcParse(${n},'${Rh(t.slice(4,t.length))}')`:(hr(`Unrecognized parse "${t}".`),null)}(e,this._parse[e]);return t?{type:"formula",expr:t,as:ge(e)}:null})).filter((e=>null!==e))}}class Ih extends ec{clone(){return new Ih(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([Os])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Os}}}class Uh extends ec{constructor(e,t){super(e),this.params=t}clone(){return new Uh(null,this.params)}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${U(this.params)}`}assemble(){return Object.assign({type:"graticule"},!0===this.params?{}:this.params)}}class qh extends ec{constructor(e,t){super(e),this.params=t}clone(){return new qh(null,this.params)}dependentFields(){return new Set}producedFields(){var e;return new Set([null!==(e=this.params.as)&&void 0!==e?e:"data"])}hash(){return`Hash ${U(this.params)}`}assemble(){return Object.assign({type:"sequence"},this.params)}}class Wh extends ec{constructor(e){let t;if(super(null),Lu(e=null!=e?e:{name:"source"})||(t=e.format?Object.assign({},L(e.format,["parse"])):{}),Ru(e))this._data={values:e.values};else if(zu(e)){if(this._data={url:e.url},!t.type){let n=/(?:\.([^.]+))?$/.exec(e.url)[1];W(["json","csv","tsv","dsv","topojson"],n)||(n="json"),t.type=n}}else Uu(e)?this._data={values:[{type:"Sphere"}]}:(Pu(e)||Lu(e))&&(this._data={});this._generator=Lu(e),e.name&&(this._name=e.name),t&&!te(t)&&(this._data.format=t)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return Object.assign(Object.assign({name:this._name},this._data),{transform:[]})}}var Hh,Gh=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n};function Vh(e){return e instanceof Wh||e instanceof Uh||e instanceof qh}class Yh{constructor(){Hh.set(this,void 0),Gh(this,Hh,!1)}setModified(){Gh(this,Hh,!0)}get modifiedFlag(){return function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}(this,Hh)}}Hh=new WeakMap;class Xh extends Yh{getNodeDepths(e,t,n){n.set(e,t);for(const r of e.children)this.getNodeDepths(r,t+1,n);return n}optimize(e){const t=[...this.getNodeDepths(e,0,new Map).entries()].sort(((e,t)=>t[1]-e[1]));for(const e of t)this.run(e[0]);return this.modifiedFlag}}class Zh extends Yh{optimize(e){this.run(e);for(const t of e.children)this.optimize(t);return this.modifiedFlag}}class Jh extends Zh{mergeNodes(e,t){const n=t.shift();for(const r of t)e.removeChild(r),r.parent=n,r.remove()}run(e){const t=e.children.map((e=>e.hash())),n={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(e,n[t]))}}class Kh extends Zh{constructor(e){super(),this.requiresSelectionId=e&&Uc(e)}run(e){e instanceof Ih&&(this.requiresSelectionId&&(Vh(e.parent)||e.parent instanceof Th||e.parent instanceof Lh)||(this.setModified(),e.remove()))}}class Qh extends Yh{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,t){let n=new Set;e instanceof rc&&(n=e.producedFields(),K(n,t)&&(this.setModified(),e.removeFormulas(t),0===e.producedFields.length&&e.remove()));for(const r of e.children)this.run(r,new Set([...t,...n]))}}class ep extends Zh{constructor(){super()}run(e){e instanceof tc&&!e.isRequired()&&(this.setModified(),e.remove())}}class tp extends Xh{run(e){if(!(Vh(e)||e.numChildren()>1))for(const t of e.children)if(t instanceof Lh)if(e instanceof Lh)this.setModified(),e.merge(t);else{if(ee(e.producedFields(),t.dependentFields()))continue;this.setModified(),t.swapWithParent()}}}class np extends Xh{run(e){const t=[...e.children],n=e.children.filter((e=>e instanceof Lh));if(e.numChildren()>1&&n.length>=1){const r={},i=new Set;for(const e of n){const t=e.parse;for(const e of ne(t))e in r?r[e]!==t[e]&&i.add(e):r[e]=t[e]}for(const e of i)delete r[e];if(!te(r)){this.setModified();const n=new Lh(e,r);for(const i of t){if(i instanceof Lh)for(const e of ne(r))delete i.parse[e];e.removeChild(i),i.parent=n,i instanceof Lh&&0===ne(i.parse).length&&i.remove()}}}}}class rp extends Xh{run(e){e instanceof tc||e.numChildren()>0||e instanceof zh||e instanceof Wh||(this.setModified(),e.remove())}}class ip extends Xh{run(e){const t=e.children.filter((e=>e instanceof rc)),n=t.pop();for(const e of t)this.setModified(),n.merge(e)}}class op extends Xh{run(e){const t=e.children.filter((e=>e instanceof Th)),n={};for(const e of t){const t=U(e.groupBy);t in n||(n[t]=[]),n[t].push(e)}for(const t of ne(n)){const r=n[t];if(r.length>1){const t=r.pop();for(const n of r)t.merge(n)&&(e.removeChild(n),n.parent=t,n.remove(),this.setModified())}}}}class ap extends Xh{constructor(e){super(),this.model=e}run(e){const t=!(Vh(e)||e instanceof Ad||e instanceof Lh||e instanceof Ih),n=[],r=[];for(const i of e.children)i instanceof Bh&&(t&&!ee(e.producedFields(),i.dependentFields())?n.push(i):r.push(i));if(n.length>0){const t=n.pop();for(const e of n)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified(),e instanceof Bh?e.merge(t,this.model.renameSignal.bind(this.model)):t.swapWithParent()}if(r.length>1){const e=r.pop();for(const t of r)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified()}}}class sp extends Xh{run(e){const t=[...e.children];if(!H(t,(e=>e instanceof tc))||e.numChildren()<=1)return;const n=[];let r;for(const i of t)if(i instanceof tc){let t=i;for(;1===t.numChildren();){const[e]=t.children;if(!(e instanceof tc))break;t=e}n.push(...t.children),r?(e.removeChild(i),i.parent=r.parent,r.parent.removeChild(r),r.parent=t,this.setModified()):r=t}else n.push(i);if(n.length){this.setModified();for(const e of n)e.parent.removeChild(e),e.parent=r}}}class up extends ec{constructor(e,t){super(e),this.transform=t}clone(){return new up(null,R(this.transform))}addDimensions(e){this.transform.groupby=X(this.transform.groupby.concat(e),(e=>e))}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map((e=>e.field)).filter((e=>void 0!==e)).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){var t;return null!==(t=e.as)&&void 0!==t?t:Xo(e)}hash(){return`JoinAggregateTransform ${U(this.transform)}`}assemble(){const e=[],t=[],n=[];for(const r of this.transform.joinaggregate)t.push(r.op),n.push(this.getDefaultName(r)),e.push(void 0===r.field?null:r.field);const r=this.transform.groupby;return Object.assign({type:"joinaggregate",as:n,ops:t,fields:e},void 0!==r?{groupby:r}:{})}}class lp extends ec{constructor(e,t){super(e),this._stack=t}clone(){return new lp(null,R(this._stack))}static makeFromTransform(e,t){const{stack:n,groupby:r,as:i,offset:o="zero"}=t,a=[],s=[];if(void 0!==t.sort)for(const e of t.sort)a.push(e.field),s.push(ye(e.order,"ascending"));const u={field:a,order:s};let l;return l=function(e){return d(e)&&e.every((e=>k(e)))&&e.length>1}(i)?i:k(i)?[i,i+"_end"]:[t.stack+"_start",t.stack+"_end"],new lp(e,{stackField:n,groupby:r,offset:o,sort:u,facetby:[],as:l})}static makeFromEncoding(e,t){const n=t.stack,{encoding:r}=t;if(!n)return null;const{groupbyChannel:i,fieldChannel:o,offset:a,impute:s}=n;let u;i&&(u=oa(r[i]));const l=function(e){return e.stack.stackBy.reduce(((e,t)=>{const n=Xo(t.fieldDef);return n&&e.push(n),e}),[])}(t),c=t.encoding.order;let f;return f=d(c)||To(c)?Ma(c):l.reduce(((e,t)=>(e.field.push(t),e.order.push("y"===o?"descending":"ascending"),e)),{field:[],order:[]}),new lp(e,{dimensionFieldDef:u,stackField:t.vgField(o),facetby:[],stackby:l,sort:f,offset:a,impute:s,as:[t.vgField(o,{suffix:"start",forAs:!0}),t.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${U(this._stack)}`}getGroupbyFields(){const{dimensionFieldDef:e,impute:t,groupby:n}=this._stack;return e?e.bin?t?[Xo(e,{binSuffix:"mid"})]:[Xo(e,{}),Xo(e,{binSuffix:"end"})]:[Xo(e)]:null!=n?n:[]}assemble(){const e=[],{facetby:t,dimensionFieldDef:n,stackField:r,stackby:i,sort:o,offset:a,impute:s,as:u}=this._stack;if(s&&n){const{band:o=.5,bin:a}=n;a&&e.push({type:"formula",expr:`${o}*`+Xo(n,{expr:"datum"})+`+${1-o}*`+Xo(n,{expr:"datum",binSuffix:"end"}),as:Xo(n,{binSuffix:"mid",forAs:!0})}),e.push({type:"impute",field:r,groupby:[...i,...t],key:Xo(n,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...t],field:r,sort:o,as:u,offset:a}),e}}class cp extends ec{constructor(e,t){super(e),this.transform=t}clone(){return new cp(null,R(this.transform))}addDimensions(e){this.transform.groupby=X(this.transform.groupby.concat(e),(e=>e))}dependentFields(){var e,t;const n=new Set;return(null!==(e=this.transform.groupby)&&void 0!==e?e:[]).forEach(n.add,n),(null!==(t=this.transform.sort)&&void 0!==t?t:[]).forEach((e=>n.add(e.field))),this.transform.window.map((e=>e.field)).filter((e=>void 0!==e)).forEach(n.add,n),n}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){var t;return null!==(t=e.as)&&void 0!==t?t:Xo(e)}hash(){return`WindowTransform ${U(this.transform)}`}assemble(){var e;const t=[],n=[],r=[],i=[];for(const e of this.transform.window)n.push(e.op),r.push(this.getDefaultName(e)),i.push(void 0===e.param?null:e.param),t.push(void 0===e.field?null:e.field);const o=this.transform.frame,a=this.transform.groupby;if(o&&null===o[0]&&null===o[1]&&n.every((e=>ze(e))))return Object.assign({type:"joinaggregate",as:r,ops:n,fields:t},void 0!==a?{groupby:a}:{});const s=[],u=[];if(void 0!==this.transform.sort)for(const t of this.transform.sort)s.push(t.field),u.push(null!==(e=t.order)&&void 0!==e?e:"ascending");const l={field:s,order:u},c=this.transform.ignorePeers;return Object.assign(Object.assign(Object.assign({type:"window",params:i,as:r,ops:n,fields:t,sort:l},void 0!==c?{ignorePeers:c}:{}),void 0!==a?{groupby:a}:{}),void 0!==o?{frame:o}:{})}}function fp(e){if(e instanceof zh)if(1!==e.numChildren()||e.children[0]instanceof tc){const n=e.model.component.data.main;dp(n);const r=(t=e,function e(n){if(!(n instanceof zh)){const r=n.clone();if(r instanceof tc){const e=hp+r.getSource();r.setSource(e),t.model.component.data.outputNodes[e]=r}else(r instanceof Th||r instanceof lp||r instanceof cp||r instanceof up)&&r.addDimensions(t.fields);for(const t of n.children.flatMap(e))t.parent=r;return[r]}return n.children.flatMap(e)}),i=e.children.map(r).flat();for(const e of i)e.parent=n}else{const t=e.children[0];(t instanceof Th||t instanceof lp||t instanceof cp||t instanceof up)&&t.addDimensions(e.fields),t.swapWithParent(),fp(e)}else e.children.map(fp);var t}function dp(e){if(e instanceof tc&&e.type===Wu.Main&&1===e.numChildren()){const t=e.children[0];t instanceof zh||(t.swapWithParent(),dp(e))}}const hp="scale_",pp=5;function gp(e){for(const t of e){for(const e of t.children)if(e.parent!==t)return!1;if(!gp(t.children))return!1}return!0}function mp(e,t){let n=!1;for(const r of t)n=e.optimize(r)||n;return n}function yp(e,t,n){let r=e.sources,i=!1;return i=mp(new ep,r)||i,i=mp(new Kh(t),r)||i,r=r.filter((e=>e.numChildren()>0)),i=mp(new rp,r)||i,r=r.filter((e=>e.numChildren()>0)),n||(i=mp(new tp,r)||i,i=mp(new ap(t),r)||i,i=mp(new Qh,r)||i,i=mp(new np,r)||i,i=mp(new op,r)||i,i=mp(new ip,r)||i,i=mp(new Jh,r)||i,i=mp(new sp,r)||i),e.sources=r,i}class vp{constructor(e){Object.defineProperty(this,"signal",{enumerable:!0,get:e})}static fromName(e,t){return new vp((()=>e(t)))}}var bp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i({signal:`{data: ${ha(e,{timeUnit:n,type:t})}}`})))}(e,t,i):[e]}function kp(e,t,n,r){const{encoding:i}=n,o=aa(i[r]),{type:a}=o,s=o.timeUnit;if(function(e){return e&&e.unionWith}(t)){const i=kp(e,void 0,n,r),o=wp(t.unionWith,a,s);return Mu([...i.value,...o])}if(Fr(t))return Mu([t]);if(t&&"unaggregated"!==t&&!gi(t))return Mu(wp(t,a,s));const u=n.stack;if(u&&r===u.fieldChannel){if("normalize"===u.offset)return ju([[0,1]]);const e=n.requestDataName(Wu.Main);return ju([{data:e,field:n.vgField(r,{suffix:"start"})},{data:e,field:n.vgField(r,{suffix:"end"})}])}const l=Dn(r)&&To(o)?function(e,t,n){if(!fi(n))return;const r=e.fieldDef(t),i=r.sort;if(Ao(i))return{op:"min",field:Ud(r,t),order:"ascending"};const{stack:o}=e,a=o?[...o.groupbyField?[o.groupbyField]:[],...o.stackBy.map((e=>e.fieldDef.field))]:void 0;if(ko(i))return Ap(i,o&&!W(a,i.field));if(wo(i)){const{encoding:t,order:n}=i,r=e.fieldDef(t),{aggregate:s,field:u}=r,l=o&&!W(a,u);if(Be(s)||Te(s))return Ap({field:Xo(r),order:n},l);if(ze(s)||!s)return Ap({op:s,field:u,order:n},l)}else{if("descending"===i)return{op:"min",field:e.vgField(t),order:"descending"};if(W(["ascending",void 0],i))return!0}}(n,r,e):void 0;if(Ro(o))return ju(wp([o.datum],a,s));const c=o;if("unaggregated"===t){const e=n.requestDataName(Wu.Main),{field:t}=o;return ju([{data:e,field:Xo({field:t,aggregate:"min"})},{data:e,field:Xo({field:t,aggregate:"max"})}])}if($n(c.bin)){if(fi(e))return ju("bin-ordinal"===e?[]:[{data:oe(l)?n.requestDataName(Wu.Main):n.requestDataName(Wu.Raw),field:n.vgField(r,ga(c,r)?{binSuffix:"range"}:{}),sort:!0!==l&&h(l)?l:{field:n.vgField(r,{}),op:"min"}}]);{const{bin:e}=c;if($n(e)){const t=$h(n,c.field,e);return ju([new vp((()=>{const e=n.getSignalName(t);return`[${e}.start, ${e}.stop]`}))])}return ju([{data:n.requestDataName(Wu.Main),field:n.vgField(r,{})}])}}if(c.timeUnit&&W(["time","utc"],e)&&jo(r,c,Zp(n)?n.encoding[Gt(r)]:void 0,n.stack,n.markDef,n.config)){const e=n.requestDataName(Wu.Main);return ju([{data:e,field:n.vgField(r)},{data:e,field:n.vgField(r,{suffix:"end"})}])}return ju(l?[{data:oe(l)?n.requestDataName(Wu.Main):n.requestDataName(Wu.Raw),field:n.vgField(r),sort:l}]:[{data:n.requestDataName(Wu.Main),field:n.vgField(r)}])}function Ap(e,t){const{op:n,field:r,order:i}=e;return Object.assign(Object.assign({op:null!=n?n:t?"sum":bo},r?{field:he(r)}:{}),i?{order:i}:{})}function Ep(e,t){var n;const r=e.component.scales[t],i=e.specifiedScales[t].domain,o=null===(n=e.fieldDef(t))||void 0===n?void 0:n.bin,a=gi(i)&&i,s=Bn(o)&&Tn(o.extent)&&o.extent;(a||s)&&r.set("selectionExtent",null!=a?a:s,!0)}function Op(e,t){const{aggregate:n,type:r}=e;return n?k(n)&&!Ie[n]?{valid:!1,reason:rr(n)}:"quantitative"===r&&"log"===t?{valid:!1,reason:ir(e)}:{valid:!0}:{valid:!1,reason:nr(e)}}function Dp(e,t,n,r){return e.explicit&&t.explicit&&hr(function(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${I(n)} and ${I(r)}). Using the union of the two domains.`}(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function Cp(e){if(jr(e)&&k(e.field))return e.field;if(function(e){return!d(e)&&"fields"in e&&!("data"in e)}(e)){let t;for(const n of e.fields)if(jr(n)&&k(n.field))if(t){if(t!==n.field)return hr("Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect."),t}else t=n.field;return hr("Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect."),t}if(function(e){return!d(e)&&"fields"in e&&"data"in e}(e)){hr("Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.");const t=e.fields[0];return k(t)?t:void 0}}function Sp(e,t){const n=e.component.scales[t].get("domains").map((t=>(jr(t)&&(t.data=e.lookupDataSource(t.data)),t)));return function(e){const t=X(e.map((e=>{if(jr(e)){const{sort:t}=e;return bp(e,["sort"])}return e})),U),n=X(e.map((e=>{if(jr(e)){const t=e.sort;return void 0===t||oe(t)||("op"in t&&"count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}})).filter((e=>void 0!==e)),U);if(0===t.length)return;if(1===t.length){const t=e[0];if(jr(t)&&n.length>0){let e=n[0];if(n.length>1)hr(sr),e=!0;else if(h(e)&&"field"in e){const n=e.field;t.field===n&&(e=!e.order||{order:e.order})}return Object.assign(Object.assign({},t),{sort:e})}return t}const r=X(n.map((e=>oe(e)||!("op"in e)||k(e.op)&&e.op in Ne?e:(hr(function(e){return`Dropping sort property ${I(e)} as unioned domains only support boolean or op "count", "min", and "max".`}(e)),!0))),U);let i;1===r.length?i=r[0]:r.length>1&&(hr(sr),i=!0);const o=X(e.map((e=>jr(e)?e.data:null)),(e=>e));return 1===o.length&&null!==o[0]?Object.assign({data:o[0],fields:t.map((e=>e.field))},i?{sort:i}:{}):Object.assign({fields:t},i?{sort:i}:{})}(n)}var Fp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ie.concat(Mp(t))),jp(e)):jp(e)}function jp(e){return ne(e.component.scales).reduce(((t,n)=>{const r=e.component.scales[n];if(r.merged)return t;const i=r.combine(),{name:o,type:a,selectionExtent:s,domains:u,range:l,reverse:c}=i,f=Fp(i,["name","type","selectionExtent","domains","range","reverse"]),d=function(e,t,n,r){if(fn(n)){if(Mr(e))return{step:{signal:t+"_step"}}}else if(h(e)&&jr(e))return Object.assign(Object.assign({},e),{data:r.lookupDataSource(e.data)});return e}(i.range,o,n,e);let p;s&&(p=function(e,t){const n=t.selection;return{signal:Dd(e.getSelectionComponent(n,ae(n)),t)}}(e,s));const g=Sp(e,n);return t.push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:o,type:a},g?{domain:g}:{}),p?{domainRaw:p}:{}),{range:d}),void 0!==c?{reverse:c}:{}),f)),t}),[])}class $p extends Fu{constructor(e,t){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",t)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||H(this.get("domains"),(e=>d(e)&&2===e.length&&e[0]<=0&&e[1]>=0))}}const Np=["range","scheme"];function Bp(e){return"x"===e?"width":"y"===e?"height":void 0}function Tp(e,t){const n=e.fieldDef(t);if(n&&n.bin&&$n(n.bin)){const r=$h(e,n.field,n.bin),i=Bp(t),o=e.getName(i);return new vp((()=>{const t=e.getSignalName(r),n=`(${t}.stop - ${t}.start) / ${t}.step`;return`${e.getSignalName(o)} / (${n})`}))}}function zp(e,t){const n=t.specifiedScales[e],{size:r}=t,i=t.getScaleComponent(e).get("type");for(const r of Np)if(void 0!==n[r]){const o=Ei(i,r),a=Oi(e,r);if(o)if(a)hr(a);else switch(r){case"range":{const r=n.range;if(d(r)){if(fn(e))return Mu(r.map((e=>{if("width"===e||"height"===e){const n=t.getName(e),r=t.getSignalName.bind(t);return vp.fromName(r,n)}return e})))}else if(h(r))return Mu({data:t.requestDataName(Wu.Main),field:r.field,sort:{op:"min",field:t.vgField(e)}});return Mu(r)}case"scheme":return Mu(Rp(n[r]))}else hr(or(i,r,e))}if(e===Ge||e===Ve){const t=e===Ge?"width":"height",n=r[t];if($s(n)){if(fi(i))return Mu({step:n.step});hr(ar(t))}}const{rangeMin:o,rangeMax:a}=n,s=function(e,t){const{size:n,config:r,mark:i,encoding:o}=t,a=t.getSignalName.bind(t),{type:s}=aa(o[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case Ge:case Ve:{if(W(["point","band"],u))if(e!==Ge||n.width){if(e===Ve&&!n.height){const e=Ps(r.view,"height");if($s(e))return e}}else{const e=Ps(r.view,"width");if($s(e))return e}const i=Bp(e),o=t.getName(i);return e===Ve&&di(u)?[vp.fromName(a,o),0]:[0,vp.fromName(a,o)]}case ut:{const o=Pp(i,t.component.scales[e].get("zero"),r),a=function(e,t,n,r){const i={x:Tp(n,"x"),y:Tp(n,"y")};switch(e){case"bar":case"tick":{if(void 0!==r.scale.maxBandSize)return r.scale.maxBandSize;const e=Ip(t,i,r.view);return w(e)?e-1:new vp((()=>`${e.signal} - 1`))}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const e=Ip(t,i,r.view);return w(e)?Math.pow(Lp*e,2):new vp((()=>`pow(${Lp} * ${e.signal}, 2)`))}}throw new Error(Qn("size",e))}(i,n,t,r);return pi(u)?function(e,t,n){const r=()=>{const r=Ea(t),i=Ea(e),o=`(${r} - ${i}) / (${n} - 1)`;return`sequence(${i}, ${r} + ${o}, ${o})`};return Fr(t)?new vp(r):{signal:r()}}(o,a,function(e,t,n,r){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return void 0!==n&&d(n)?n.length+1:(hr(function(e){return`Domain for ${e} is required for threshold scale.`}(r)),3)}}(u,r,l,e)):[o,a]}case Ke:return[0,2*Math.PI];case lt:return[0,360];case Ze:return[0,new vp((()=>`min(${t.getSignalName("width")},${t.getSignalName("height")})/2`))];case ht:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case pt:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case st:return"symbol";case it:case ot:case at:return"ordinal"===u?"nominal"===s?"category":"ordinal":void 0!==c?"diverging":"rect"===i||"geoshape"===i?"heatmap":"ramp";case ct:case ft:case dt:return[r.scale.minOpacity,r.scale.maxOpacity]}throw new Error(`Scale range undefined for channel ${e}`)}(e,t);return(void 0!==o||void 0!==a)&&Ei(i,"rangeMin")&&d(s)&&2===s.length?Mu([null!=o?o:s[0],null!=a?a:s[1]]):ju(s)}function Rp(e){return function(e){return!k(e)&&!!e.name}(e)?Object.assign({scheme:e.name},L(e,["name"])):{scheme:e}}function Pp(e,t,n){if(t)return Fr(t)?{signal:`${t.signal} ? 0 : ${Pp(e,!1,n)}`}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(Qn("size",e))}const Lp=.95;function Ip(e,t,n){const r=$s(e.width)?e.width.step:Rs(n,"width"),i=$s(e.height)?e.height.step:Rs(n,"height");return t.x||t.y?new vp((()=>`min(${[t.x?t.x.signal:r,t.y?t.y.signal:i].join(", ")})`)):Math.min(r,i)}function Up(e,t){Zp(e)?function(e,t){const n=e.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:a}=e;for(const s of ne(n)){const u=a[s],l=n[s],c=e.getScaleComponent(s),f=aa(i[s]),d=u[t],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=Ei(h,t),y=Oi(s,t);if(void 0!==d&&(m?y&&hr(y):hr(or(h,t,s))),m&&void 0===y)if(void 0!==d){const e=f.timeUnit,n=f.type;switch(t){case"domainMax":case"domainMin":pr(u[t])||"temporal"===n||e?l.set(t,{signal:ha(u[t],{type:n,timeUnit:e})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const n=t in qp?qp[t]({model:e,channel:s,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:u.domain,markDef:o,config:r}):r.scale[t];void 0!==n&&l.set(t,n,!1)}}}(e,t):Hp(e,t)}const qp={bins:({model:e,fieldOrDatumDef:t})=>To(t)?function(e,t){const n=t.bin;if($n(n)){const r=$h(e,t.field,n);return new vp((()=>e.getSignalName(r)))}if(Nn(n)&&Bn(n)&&void 0!==n.step)return{step:n.step}}(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>function(e,t){if(W([it,ot,at],e)&&"nominal"!==t)return"hcl"}(e,t.type),nice:({scaleType:e,channel:t,fieldOrDatumDef:n})=>function(e,t,n){var r;if(!(null===(r=oa(n))||void 0===r?void 0:r.bin)&&!W([ei.TIME,ei.UTC],e))return t in ln||void 0}(e,t,n),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:r,config:i})=>function(e,t,n,r,i,o){if(e in ln){if(hi(t)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:t,orient:a}=i;if("bar"===t&&(!To(r)||!r.bin&&!r.timeUnit)&&("vertical"===a&&"x"===e||"horizontal"===a&&"y"===e))return o.continuousBandSize}if(t===ei.POINT)return n.pointPadding}}(e,t,i.scale,n,r,i.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,config:r})=>function(e,t,n,r){if(void 0===e&&t in ln){const{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:i}=r;return ye(e,"bar"===n?t:i)}}(e,t,n.type,r.scale),paddingOuter:({scalePadding:e,channel:t,scaleType:n,markDef:r,scalePaddingInner:i,config:o})=>function(e,t,n,r,i,o){if(void 0===e&&t in ln&&n===ei.BAND){const{bandPaddingOuter:e}=o;return ye(e,Fr(i)?{signal:`${i.signal}/2`}:i/2)}}(e,t,n,r.type,i,o.scale),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:r})=>function(e,t,n,r){return"x"===n&&void 0!==r.xReverse?di(e)&&"descending"===t?Fr(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse:!(!di(e)||"descending"!==t)||void 0}(t,To(e)?e.sort:void 0,n,r.scale),zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:r,scaleType:i})=>function(e,t,n,r,i){if(n&&"unaggregated"!==n&&di(i)){if(d(n)){const e=n[0],t=n[n.length-1];if(e<=0&&t>=0)return!0}return!1}if("size"===e&&"quantitative"===t.type&&!pi(i))return!0;if((!To(t)||!t.bin)&&W([...cn,...hn],e)){const{orient:t,type:n}=r;return!W(["bar","area","line","trail"],n)||!("horizontal"===t&&"y"===e||"vertical"===t&&"x"===e)}return!1}(e,t,n,r,i)};function Wp(e){Zp(e)?function(e){const t=e.component.scales;for(const n of On){const r=t[n];if(!r)continue;const i=zp(n,e);r.setWithExplicit("range",i)}}(e):Hp(e,"range")}function Hp(e,t){const n=e.component.scales;for(const n of e.children)"range"===t?Wp(n):Up(n,t);for(const r of ne(n)){let i;for(const n of e.children){const e=n.component.scales[r];e&&(i=Bu(i,e.getWithExplicit(t),t,"scale",$u(((e,n)=>"range"===t&&e.step&&n.step?e.step-n.step:0))))}n[r].setWithExplicit(t,i)}}function Gp(e){Zp(e)?e.component.scales=function(e){const{encoding:t,mark:n}=e;return On.reduce(((r,i)=>{const o=aa(t[i]);if(o&&n===qi&&i===st&&o.type===Qr)return r;let a=o&&o.scale;if(o&&null!==a&&!1!==a){a=null!=a?a:{};const t=function(e,t,n,r){const i=function(e,t,n){var r;switch(t.type){case"nominal":case"ordinal":if(Ct(e)||"discrete"===Mn(e))return"shape"===e&&"ordinal"===t.type&&hr(tr(e,"ordinal")),"ordinal";if(e in ln){if(W(["rect","bar","image","rule"],n))return"band"}else if("arc"===n&&e in dn)return"band";return void 0!==t.band||Ho(t)&&(null===(r=t.axis)||void 0===r?void 0:r.tickBand)?"band":"point";case"temporal":return Ct(e)?"time":"discrete"===Mn(e)?(hr(tr(e,"temporal")),"ordinal"):To(t)&&t.timeUnit&&Sr(t.timeUnit).utc?"utc":"time";case"quantitative":return Ct(e)?To(t)&&$n(t.bin)?"bin-ordinal":"linear":"discrete"===Mn(e)?(hr(tr(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(Zn(t.type))}(t,n,r),{type:o}=e;return Dn(t)?void 0!==o?function(e,t){if(!Dn(e))return!1;switch(e){case Ge:case Ve:case Ke:case Ze:return hi(t)||W(["band","point"],t);case ut:case ht:case ct:case ft:case dt:case lt:return hi(t)||pi(t)||W(["band","point","ordinal"],t);case it:case ot:case at:return"band"!==t;case pt:return"ordinal"===t||pi(t);case st:return"ordinal"===t}}(t,o)?To(n)&&(a=o,s=n.type,!(W([Zr,Kr],s)?void 0===a||fi(a):s===Jr?W([ei.TIME,ei.UTC,void 0],a):s!==Xr||W([ei.LOG,ei.POW,ei.SQRT,ei.SYMLOG,ei.QUANTILE,ei.QUANTIZE,ei.THRESHOLD,ei.LINEAR,void 0],a)))?(hr(function(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}(o,i)),i):o:(hr(function(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}(t,o,i)),i):i:null;var a,s}(a,i,o,n);r[i]=new $p(e.scaleName(i+"",!0),{value:t,explicit:a.type===t})}return r}),{})}(e):e.component.scales=function(e){var t;const n=e.component.scales={},r={},i=e.component.resolve;for(const n of e.children){Gp(n);for(const o of ne(n.component.scales))if(i.scale[o]=null!==(t=i.scale[o])&&void 0!==t?t:ch(o,e),"shared"===i.scale[o]){const e=r[o],t=n.component.scales[o].getWithExplicit("type");e?ni(e.value,t.value)?r[o]=Bu(e,t,"type","scale",Vp):(i.scale[o]="independent",delete r[o]):r[o]=t}}for(const t of ne(r)){const i=e.scaleName(t,!0),o=r[t];n[t]=new $p(i,o);for(const n of e.children){const e=n.component.scales[t];e&&(n.renameScale(e.get("name"),i),e.merged=!0)}}return n}(e)}const Vp=$u(((e,t)=>ii(e)-ii(t)));var Yp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i(e.from&&e.from.data&&(e.from.data=this.lookupDataSource(e.from.data)),e.from&&e.from.facet&&e.from.facet.data&&(e.from.facet.data=this.lookupDataSource(e.from.facet.data)),e),this.parent=n,this.config=i,this.view=Ci(a),this.name=null!==(s=e.name)&&void 0!==s?s:r,this.title=va(e.title)?{text:e.title}:e.title?this.initTitle(e.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new Xp,this.projectionNameMap=n?n.projectionNameMap:new Xp,this.signalNameMap=n?n.signalNameMap:new Xp,this.data=e.data,this.description=e.description,this.transforms=(null!==(u=e.transform)&&void 0!==u?u:[]).map((e=>Hu(e)?{filter:T(e.filter,Vr)}:e)),this.layout="layer"===t||"unit"===t?{}:function(e,t,n){var r,i;const o=n[t],a={},{spacing:s,columns:u}=o;void 0!==s&&(a.spacing=s),void 0!==u&&(Do(e)&&!Eo(e.facet)||Fs(e))&&(a.columns=u),Ms(e)&&(a.columns=1);for(const t of Bs)if(void 0!==e[t])if("spacing"===t){const n=e[t];a[t]=w(n)?n:{row:null!==(r=n.row)&&void 0!==r?r:s,column:null!==(i=n.column)&&void 0!==i?i:s}}else a[t]=e[t];return a}(e,t,i),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:Do(e)||n&&n.component.data.isFaceted&&void 0===e.data},layoutSize:new Fu,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:Object.assign({scale:{},axis:{},legend:{}},o?R(o):{}),selection:null,scales:null,projection:null,axes:{},legends:{}}}initTitle(e){const t=ne(e),n={text:_a(e.text)};for(const r of t)n[r]=_a(e[r]);return n}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){!function(e,{ignoreRange:t}={}){Gp(e),xp(e);for(const t of Ai)Up(e,t);t||Wp(e)}(this)}parseProjection(){Mh(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){kh(this)}assembleGroupStyle(){var e,t;if("unit"===this.type||"layer"===this.type)return null!==(t=null===(e=this.view)||void 0===e?void 0:e.style)&&void 0!==t?t:"cell"}assembleEncodeFromView(e){const{style:t}=e,n=Yp(e,["style"]),r={};for(const e of ne(n)){const t=n[e];void 0!==t&&(r[e]=ka(t))}return r}assembleGroupEncodeEntry(e){let t={};return this.view&&(t=this.assembleEncodeFromView(this.view)),e||(this.description&&(t.description=ka(this.description)),"unit"!==this.type&&"layer"!==this.type)?te(t)?void 0:t:Object.assign({width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height")},null!=t?t:{})}assembleLayout(){if(!this.layout)return;const e=this.layout,{spacing:t}=e,n=Yp(e,["spacing"]),{component:r,config:i}=this,o=function(e,t){const n={};for(const r of Ft){const i=e[r];if(null==i?void 0:i.facetFieldDef){const{titleAnchor:e,titleOrient:o}=Hd(["titleAnchor","titleOrient"],i.facetFieldDef.header,t,r),a=qd(r,o),s=nh(e,a);void 0!==s&&(n[a]=s)}}return te(n)?void 0:n}(r.layoutHeaders,i);return Object.assign(Object.assign(Object.assign({padding:t},this.assembleDefaultLayout()),n),o?{titleBand:o}:{})}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let t=[];for(const n of Ft)e[n].title&&t.push(Yd(this,n));for(const e of Gd)t=t.concat(Jd(this,e));return t}assembleAxes(){return function(e,t){const{x:n=[],y:r=[]}=e;return[...n.map((e=>Md(e,"grid",t))),...r.map((e=>Md(e,"grid",t))),...n.map((e=>Md(e,"main",t))),...r.map((e=>Md(e,"main",t)))].filter((e=>e))}(this.component.axes,this.config)}assembleLegends(){return Dh(this)}assembleProjections(){return Qp(e=this)||Kp(e)?function(e){return e.children.reduce(((e,t)=>e.concat(t.assembleProjections())),Ch(e))}(e):Ch(e);var e}assembleTitle(){var e,t,n;const r=null!==(e=this.title)&&void 0!==e?e:{},{encoding:i}=r,o=Yp(r,["encoding"]),a=Object.assign(Object.assign(Object.assign({},ya(this.config.title).nonMark),o),i?{encode:{update:i}}:{});if(a.text)return W(["unit","layer"],this.type)?W(["middle",void 0],a.anchor)&&(a.frame=null!==(t=a.frame)&&void 0!==t?t:"group"):a.anchor=null!==(n=a.anchor)&&void 0!==n?n:"start",te(a)?void 0:a}assembleGroup(e=[]){const t={};(e=e.concat(this.assembleSignals())).length>0&&(t.signals=e);const n=this.assembleLayout();n&&(t.layout=n),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||Jp(this.parent)?Mp(this):[];r.length>0&&(t.scales=r);const i=this.assembleAxes();i.length>0&&(t.axes=i);const o=this.assembleLegends();return o.length>0&&(t.legends=o),t}getName(e){return ae((this.name?this.name+"_":"")+e)}getDataName(e){return this.getName(Wu[e].toLowerCase())}requestDataName(e){const t=this.getDataName(e),n=this.component.data.outputNodeRefCounts;return n[t]=(n[t]||0)+1,t}getSizeSignalRef(e){if(Jp(this.parent)){const t=pn(uh(e)),n=this.component.scales[t];if(n&&!n.merged){const e=n.get("type"),r=n.get("range");if(fi(e)&&Mr(r)){const e=n.get("name"),r=Cp(Sp(this,t));return r?{signal:sh(e,n,Xo({aggregate:"distinct",field:r},{expr:"datum"}))}:(hr(qn(t)),null)}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const t=this.component.data.outputNodes[e];return t?t.getSource():e}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,t){this.signalNameMap.rename(e,t)}renameScale(e,t){this.scaleNameMap.rename(e,t)}renameProjection(e,t){this.projectionNameMap.rename(e,t)}scaleName(e,t){return t?this.getName(e):It(e)&&Dn(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e))?this.scaleNameMap.get(this.getName(e)):void 0}projectionName(e){return e?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const t=this.component.scales[e];return t&&!t.merged?t:this.parent?this.parent.getScaleComponent(e):void 0}getSelectionComponent(e,t){let n=this.component.selection[e];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(e,t)),!n)throw new Error(`Cannot find a selection named "${t}".`);return n}hasAxisOrientSignalRef(){var e,t;return(null===(e=this.component.axes.x)||void 0===e?void 0:e.some((e=>e.hasOrientSignalRef())))||(null===(t=this.component.axes.y)||void 0===t?void 0:t.some((e=>e.hasOrientSignalRef())))}}class tg extends eg{vgField(e,t={}){const n=this.fieldDef(e);if(n)return Xo(n,t)}reduceFieldDef(e,t){return function(e,t,n,r){return e?ne(e).reduce(((n,i)=>{const o=e[i];return d(o)?o.reduce(((e,n)=>t.call(r,e,n,i)),n):t.call(r,n,o,i)}),n):n}(this.getMapping(),((t,n,r)=>{const i=oa(n);return i?e(t,i,r):t}),t)}forEachFieldDef(e,t){qa(this.getMapping(),((t,n)=>{const r=oa(t);r&&e(r,n)}),t)}}class ng extends ec{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=R(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:"value",null!==(i=o[1])&&void 0!==i?i:"density"]}clone(){return new ng(null,R(this.transform))}dependentFields(){var e;return new Set([this.transform.density,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${U(this.transform)}`}assemble(){const e=this.transform,{density:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const o=Dn(i)&&t.getScaleComponent(i);return o&&di(o.get("type"))&&"count"!==n.aggregate&&!Wi(r)&&(e[n.field]=n),e}),{});return ne(o).length?new rg(e,o):null}dependentFields(){return new Set(ne(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${U(this.filter)}`}assemble(){const e=ne(this.filter).reduce(((e,t)=>{const n=this.filter[t],r=Xo(n,{expr:"datum"});return null!==n&&("temporal"===n.type?e.push(`(isDate(${r}) || (isValid(${r}) && isFinite(+${r})))`):"quantitative"===n.type&&(e.push(`isValid(${r})`),e.push(`isFinite(+${r})`))),e}),[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}class ig extends ec{constructor(e,t){super(e),this.transform=t,this.transform=R(t);const{flatten:n,as:r=[]}=this.transform;this.transform.as=n.map(((e,t)=>{var n;return null!==(n=r[t])&&void 0!==n?n:e}))}clone(){return new ig(this.parent,R(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${U(this.transform)}`}assemble(){const{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}class og extends ec{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=R(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:"key",null!==(i=o[1])&&void 0!==i?i:"value"]}clone(){return new og(null,R(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${U(this.transform)}`}assemble(){const{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}class ag extends ec{constructor(e,t,n,r){super(e),this.fields=t,this.geojson=n,this.signal=r}clone(){return new ag(null,R(this.fields),this.geojson,this.signal)}static parseAll(e,t){if(t.component.projection&&!t.component.projection.isFit)return e;let n=0;for(const r of[[tt,et],[rt,nt]]){const i=r.map((e=>{const n=aa(t.encoding[e]);return To(n)?n.field:Ro(n)?{expr:`${n.datum}`}:qo(n)?{expr:`${n.value}`}:void 0}));(i[0]||i[1])&&(e=new ag(e,i,null,t.getName("geojson_"+n++)))}if(t.channelHasField(st)){const r=t.typedFieldDef(st);r.type===Qr&&(e=new ag(e,null,r.field,t.getName("geojson_"+n++)))}return e}dependentFields(){var e;const t=(null!==(e=this.fields)&&void 0!==e?e:[]).filter(k);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${U(this.fields)}`}assemble(){return Object.assign(Object.assign(Object.assign({type:"geojson"},this.fields?{fields:this.fields}:{}),this.geojson?{geojson:this.geojson}:{}),{signal:this.signal})}}class sg extends ec{constructor(e,t,n,r){super(e),this.projection=t,this.fields=n,this.as=r}clone(){return new sg(null,this.projection,R(this.fields),R(this.as))}static parseAll(e,t){if(!t.projectionName())return e;for(const n of[[tt,et],[rt,nt]]){const r=n.map((e=>{const n=aa(t.encoding[e]);return To(n)?n.field:Ro(n)?{expr:`${n.datum}`}:qo(n)?{expr:`${n.value}`}:void 0})),i=n[0]===rt?"2":"";(r[0]||r[1])&&(e=new sg(e,t.projectionName(),r,[t.getName("x"+i),t.getName("y"+i)]))}return e}dependentFields(){return new Set(this.fields.filter(k))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${U(this.fields)} ${U(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class ug extends ec{constructor(e,t){super(e),this.transform=t}clone(){return new ug(null,R(this.transform))}dependentFields(){var e;return new Set([this.transform.impute,this.transform.key,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:t=0,stop:n,step:r}=e;return{signal:`sequence(${[t,n,...r?[r]:[]].join(",")})`}}static makeFromTransform(e,t){return new ug(e,t)}static makeFromEncoding(e,t){const n=t.encoding,r=n.x,i=n.y;if(To(r)&&To(i)){const o=r.impute?r:i.impute?i:void 0;if(void 0===o)return;const a=r.impute?i:i.impute?r:void 0,{method:s,value:u,frame:l,keyvals:c}=o.impute,f=Wa(t.mark,n);return new ug(e,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({impute:o.field,key:a.field},s?{method:s}:{}),void 0!==u?{value:u}:{}),l?{frame:l}:{}),void 0!==c?{keyvals:c}:{}),f.length?{groupby:f}:{}))}return null}hash(){return`Impute ${U(this.transform)}`}assemble(){const{impute:e,key:t,keyvals:n,method:r,groupby:i,value:o,frame:a=[null,null]}=this.transform,s=Object.assign(Object.assign(Object.assign(Object.assign({type:"impute",field:e,key:t},n?{keyvals:(u=n,void 0!==(null==u?void 0:u.stop)?this.processSequence(n):n)}:{}),{method:"value"}),i?{groupby:i}:{}),{value:r&&"value"!==r?null:o});var u;return r&&"value"!==r?[s,Object.assign({type:"window",as:[`imputed_${e}_value`],ops:[r],fields:[e],frame:a,ignorePeers:!1},i?{groupby:i}:{}),{type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e}]:[s]}}class lg extends ec{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=R(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:t.on,null!==(i=o[1])&&void 0!==i?i:t.loess]}clone(){return new lg(null,R(this.transform))}dependentFields(){var e;return new Set([this.transform.loess,this.transform.on,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${U(this.transform)}`}assemble(){const e=this.transform,{loess:t,on:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ie))}producedFields(){}dependentFields(){var e;return new Set([this.transform.pivot,this.transform.value,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}hash(){return`PivotTransform ${U(this.transform)}`}assemble(){const{pivot:e,value:t,groupby:n,limit:r,op:i}=this.transform;return Object.assign(Object.assign(Object.assign({type:"pivot",field:e,value:t},void 0!==r?{limit:r}:{}),void 0!==i?{op:i}:{}),void 0!==n?{groupby:n}:{})}}class pg extends ec{constructor(e,t){super(e),this.transform=t}clone(){return new pg(null,R(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${U(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function gg(e){let t=0;return function n(r,i){var o;if(r instanceof Wh&&!r.isGenerator&&!zu(r.data)&&(e.push(i),i={name:null,source:i.name,transform:[]}),r instanceof Lh&&(r.parent instanceof Wh&&!i.source?(i.format=Object.assign(Object.assign({},null!==(o=i.format)&&void 0!==o?o:{}),{parse:r.assembleFormatParse()}),i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof zh){i.name||(i.name="data_"+t++),!i.source||i.transform.length>0?(e.push(i),r.data=i.name):r.data=i.source;for(const t of r.assemble())e.push(t)}else switch((r instanceof Uh||r instanceof qh||r instanceof rg||r instanceof Ad||r instanceof Id||r instanceof sg||r instanceof ag||r instanceof Th||r instanceof cg||r instanceof cp||r instanceof up||r instanceof og||r instanceof ig||r instanceof ng||r instanceof lg||r instanceof fg||r instanceof dg||r instanceof Ih||r instanceof pg||r instanceof hg)&&i.transform.push(r.assemble()),(r instanceof Bh||r instanceof rc||r instanceof ug||r instanceof lp)&&i.transform.push(...r.assemble()),r instanceof tc&&(i.source&&0===i.transform.length?r.setSource(i.source):r.parent instanceof tc?r.setSource(i.name):(i.name||(i.name="data_"+t++),r.setSource(i.name),1===r.numChildren()&&(e.push(i),i={name:null,source:i.name,transform:[]}))),r.numChildren()){case 0:r instanceof tc&&(!i.source||i.transform.length>0)&&e.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name="data_"+t++);let o=i.name;!i.source||i.transform.length>0?e.push(i):o=i.source;for(const e of r.children)n(e,{name:null,source:o,transform:[]});break}}}}function mg(e,t){var n;const{facet:r,config:i,child:o,component:a}=e;if(e.channelHasField(t)){const s=r[t],u=Wd("title",null,i,t);let l=ta(s,i,{allowDisabling:!0,includeDefault:void 0===u||!!u});o.component.layoutHeaders[t].title&&(l=d(l)?l.join(", "):l,l+=" / "+o.component.layoutHeaders[t].title,o.component.layoutHeaders[t].title=null);const c=Wd("labelOrient",s,i,t),f=ye((null!==(n=s.header)&&void 0!==n?n:{}).labels,i.header.labels,!0),h=W(["bottom","right"],c)?"footer":"header";a.layoutHeaders[t]={title:l,facetFieldDef:s,[h]:"facet"===t?[]:[yg(e,t,f)]}}}function yg(e,t,n){const r="row"===t?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(r)?e.child.getSizeSignalRef(r):void 0,axes:[]}}function vg(e,t){var n;const{child:r}=e;if(r.component.axes[t]){const{layoutHeaders:o,resolve:a}=e.component;if(a.axis[t]=fh(a,t),"shared"===a.axis[t]){const a="x"===t?"column":"row",s=o[a];for(const o of r.component.axes[t]){const t="top"===(i=o.get("orient"))||"left"===i||Fr(i)?"header":"footer";s[t]=null!==(n=s[t])&&void 0!==n?n:[yg(e,a,!1)];const r=Md(o,"main",e.config,{header:!0});r&&s[t][0].axes.push(r),o.mainExtracted=!0}}}var i}function bg(e){for(const t of e.children)t.parseLayoutSize()}function xg(e,t){const n=uh(t),r=pn(n),i=e.component.resolve,o=e.component.layoutSize;let a;for(const t of e.children){const e=t.component.layoutSize.getWithExplicit(n),o=i.scale[r];if("independent"===o&&"step"===e.value){a=void 0;break}if(a){if("independent"===o&&a.value!==e.value){a=void 0;break}a=Bu(a,e,n,"")}else a=e}if(a){for(const r of e.children)e.renameSignal(r.getName(n),e.getName(t)),r.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,a)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function _g(e,t){const n="width"===t?"x":"y",r=e.config,i=e.getScaleComponent(n);if(i){const e=i.get("type"),n=i.get("range");if(fi(e)){const e=Ps(r.view,t);return Mr(n)||$s(e)?"step":e}return zs(r.view,t)}if(e.hasProjection||"arc"===e.mark)return zs(r.view,t);{const e=Ps(r.view,t);return $s(e)?e.step:e}}function wg(e,t,n){return Xo(t,Object.assign({suffix:`by_${Xo(e)}`},null!=n?n:{}))}class kg extends tg{constructor(e,t,n,r){super(e,"facet",t,n,r,e.resolve),this.child=Wg(e.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!Eo(e))return{facet:this.initFacetFieldDef(e,"facet")};const t=ne(e),n={};for(const r of t){if(!W([qe,We],r)){hr(Qn(r,"facet"));break}const t=e[r];if(void 0===t.field){hr(Kn(t,r));break}n[r]=this.initFacetFieldDef(t,r)}return n}initFacetFieldDef(e,t){const{header:n}=e,r=la(function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0?{aggregate:Object.assign(Object.assign({},u?{cross:u}:{}),i.length?{fields:i,ops:o,as:a}:{})}:{})}facetSortFields(e){const{facet:t}=this,n=t[e];return n?ko(n.sort)?[wg(n,n.sort,{expr:"datum"})]:d(n.sort)?[Ud(n,e,{expr:"datum"})]:[Xo(n,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:t}=this,n=t[e];if(n){const{sort:e}=n;return[(ko(e)?e.order:!d(e)&&e)||"ascending"]}return[]}assembleLabelTitle(){var e;const{facet:t,config:n}=this;if(t.facet)return Qd(t.facet,"facet",n);const r={row:["top","bottom"],column:["left","right"]};for(const i of Gd)if(t[i]){const o=Wd("labelOrient",null===(e=t[i])||void 0===e?void 0:e.header,n,i);if(W(r[i],o))return Qd(t[i],i,n)}}assembleMarks(){const{child:e}=this,t=function(e){const t=[],n=gg(t);for(const t of e.children)n(t,{source:e.name,name:null,transform:[]});return t}(this.component.data.facetRoot),n=e.assembleGroupEncodeEntry(!1),r=this.assembleLabelTitle()||e.assembleTitle(),i=e.assembleGroupStyle();return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:this.getName("cell"),type:"group"},r?{title:r}:{}),i?{style:i}:{}),{from:{facet:this.assembleFacet()},sort:{field:Ft.map((e=>this.facetSortFields(e))).flat(),order:Ft.map((e=>this.facetSortOrder(e))).flat()}}),t.length>0?{data:t}:{}),n?{encode:{update:n}}:{}),e.assembleGroup(function(e,t){if(e.component.selection&&ne(e.component.selection).length){const n=A(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:_l("mousemove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return Cc(t)}(this,[])))]}getMapping(){return this.facet}}function Ag(e,t){var n,r,i,o;for(const a of t){const t=a.data;if(e.name&&a.hasName()&&e.name!==a.dataName)continue;const s=null===(n=e.format)||void 0===n?void 0:n.mesh,u=null===(r=t.format)||void 0===r?void 0:r.feature;if(s&&u)continue;const l=null===(i=e.format)||void 0===i?void 0:i.feature;if((l||u)&&l!==u)continue;const c=null===(o=t.format)||void 0===o?void 0:o.mesh;if(!s&&!c||s===c)if(Ru(e)&&Ru(t)){if(z(e.values,t.values))return a}else if(zu(e)&&zu(t)){if(e.url===t.url)return a}else if(Pu(e)&&e.name===a.dataName)return a}return null}function Eg(e){var t,n,r,i,o,a,s,u,l,c;let f=function(e,t){if(e.data||!e.parent){if(null===e.data){const e=new Wh({values:[]});return t.push(e),e}const n=Ag(e.data,t);if(n)return Lu(e.data)||(n.data.format=V({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const n=new Wh(e.data);return t.push(n),n}}return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}(e,e.component.data.sources);const{outputNodes:d,outputNodeRefCounts:h}=e.component.data,p=e.parent?e.parent.component.data.ancestorParse.clone():new Tu,g=e.data;Lu(g)?(Iu(g)?f=new qh(f,g.sequence):qu(g)&&(f=new Uh(f,g.graticule)),p.parseNothing=!0):null===(null===(t=null==g?void 0:g.format)||void 0===t?void 0:t.parse)&&(p.parseNothing=!0),f=null!==(n=Lh.makeExplicit(f,e,p))&&void 0!==n?n:f,f=new Ih(f);const m=e.parent&&Qp(e.parent);(Zp(e)||Jp(e))&&m&&(f=null!==(r=Bh.makeFromEncoding(f,e))&&void 0!==r?r:f),e.transforms.length>0&&(f=function(e,t,n){var r,i;let o=0;for(const a of t.transforms){let s,u;if(nl(a))u=e=new Id(e,a),s="derived";else if(Hu(a)){const i=Ph(a);u=e=null!==(r=Lh.makeWithAncestors(e,{},i,n))&&void 0!==r?r:e,e=new Ad(e,t,a.filter)}else if(rl(a))u=e=Bh.makeFromTransform(e,a,t),s="number";else if(ol(a))s="date",void 0===n.getWithExplicit(a.field).value&&(e=new Lh(e,{[a.field]:s}),n.set(a.field,s,!1)),u=e=rc.makeFromTransform(e,a);else if(al(a))u=e=Th.makeFromTransform(e,a),s="number",Uc(t)&&(e=new Ih(e));else if(Gu(a))u=e=cg.make(e,t,a,o++),s="derived";else if(Qu(a))u=e=new cp(e,a),s="number";else if(el(a))u=e=new up(e,a),s="number";else if(sl(a))u=e=lp.makeFromTransform(e,a),s="derived";else if(ul(a))u=e=new og(e,a),s="derived";else if(tl(a))u=e=new ig(e,a),s="derived";else if(Vu(a))u=e=new hg(e,a),s="derived";else if(Ku(a))e=new pg(e,a);else if(il(a))u=e=ug.makeFromTransform(e,a),s="derived";else if(Yu(a))u=e=new ng(e,a),s="derived";else if(Xu(a))u=e=new fg(e,a),s="derived";else if(Zu(a))u=e=new dg(e,a),s="derived";else{if(!Ju(a)){hr(`Ignoring an invalid transform: ${I(a)}.`);continue}u=e=new lg(e,a),s="derived"}if(u&&void 0!==s)for(const e of null!==(i=u.producedFields())&&void 0!==i?i:[])n.set(e,s,!1)}return e}(f,e,p));const y=function(e){const t={};if(Zp(e)&&e.component.selection)for(const n of ne(e.component.selection)){const r=e.component.selection[n];for(const e of r.project.items)!e.channel&&me(e.field)>1&&(t[e.field]="flatten")}return t}(e),v=function(e){const t={};function n(e){var n;da(e)?t[e.field]="date":"quantitative"===e.type&&k(n=e.aggregate)&&W(["min","max"],n)?t[e.field]="number":me(e.field)>1?e.field in t||(t[e.field]="flatten"):Wo(e)&&ko(e.sort)&&me(e.sort.field)>1&&(e.sort.field in t||(t[e.sort.field]="flatten"))}if((Zp(e)||Jp(e))&&e.forEachFieldDef(((t,r)=>{if(Uo(t))n(t);else{const i=Wt(r),o=e.fieldDef(i);n(Object.assign(Object.assign({},t),{type:o.type}))}})),Zp(e)){const{mark:n,markDef:r,encoding:i}=e;if(Wi(n)&&!e.encoding.order){const e=i["horizontal"===r.orient?"y":"x"];To(e)&&"quantitative"===e.type&&!(e.field in t)&&(t[e.field]="number")}}return t}(e);f=null!==(i=Lh.makeWithAncestors(f,{},Object.assign(Object.assign({},y),v),p))&&void 0!==i?i:f,Zp(e)&&(f=ag.parseAll(f,e),f=sg.parseAll(f,e)),(Zp(e)||Jp(e))&&(m||(f=null!==(o=Bh.makeFromEncoding(f,e))&&void 0!==o?o:f),f=null!==(a=rc.makeFromEncoding(f,e))&&void 0!==a?a:f,f=Id.parseAllForSortIndex(f,e));const b=e.getDataName(Wu.Raw),x=new tc(f,b,Wu.Raw,h);if(d[b]=x,f=x,Zp(e)){const t=Th.makeFromEncoding(f,e);t&&(f=t,Uc(e)&&(f=new Ih(f))),f=null!==(s=ug.makeFromEncoding(f,e))&&void 0!==s?s:f,f=null!==(u=lp.makeFromEncoding(f,e))&&void 0!==u?u:f}Zp(e)&&(f=null!==(l=rg.make(f,e))&&void 0!==l?l:f);const _=e.getDataName(Wu.Main),w=new tc(f,_,Wu.Main,h);d[_]=w,f=w,Zp(e)&&function(e,t){Lc(e,(n=>{const r=n.name,i=e.getName(`lookup_${r}`);e.component.data.outputNodes[i]=n.materialized=new tc(new Ad(t,e,{selection:r}),i,Wu.Lookup,e.component.data.outputNodeRefCounts)}))}(e,w);let A=null;if(Jp(e)){const t=e.getName("facet");f=null!==(c=function(e,t){const{row:n,column:r}=t;if(n&&r){let t=null;for(const i of[n,r])if(ko(i.sort)){const{field:n,op:r=bo}=i.sort;e=t=new up(e,{joinaggregate:[{op:r,field:n,as:wg(i,i.sort,{forAs:!0})}],groupby:[Xo(i)]})}return t}return null}(f,e.facet))&&void 0!==c?c:f,A=new zh(f,e,t,w.getSource()),d[t]=A}return Object.assign(Object.assign({},e.component.data),{outputNodes:d,outputNodeRefCounts:h,raw:x,main:w,facetRoot:A,ancestorParse:p})}class Og extends eg{constructor(e,t,n,r){var i,o,a,s;super(e,"concat",t,n,r,e.resolve),"shared"!==(null===(o=null===(i=e.resolve)||void 0===i?void 0:i.axis)||void 0===o?void 0:o.x)&&"shared"!==(null===(s=null===(a=e.resolve)||void 0===a?void 0:a.axis)||void 0===s?void 0:s.y)||hr("Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415)."),this.children=this.getChildren(e).map(((e,t)=>Wg(e,this,this.getName("concat_"+t),void 0,r)))}parseData(){this.component.data=Eg(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of ne(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return Ms(e)?e.vconcat:js(e)?e.hconcat:e.concat}parseLayoutSize(){!function(e){bg(e);const t=1===e.layout.columns?"width":"childWidth",n=void 0===e.layout.columns?"height":"childHeight";xg(e,t),xg(e,n)}(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.forEach((e=>e.assembleSignals())),[]}assembleLayoutSignals(){const e=ih(this);for(const t of this.children)e.push(...t.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleMarks(){return this.children.map((e=>{const t=e.assembleTitle(),n=e.assembleGroupStyle(),r=e.assembleGroupEncodeEntry(!1);return Object.assign(Object.assign(Object.assign(Object.assign({type:"group",name:e.getName("group")},t?{title:t}:{}),n?{style:n}:{}),r?{encode:{update:r}}:{}),e.assembleGroup())}))}assembleDefaultLayout(){const e=this.layout.columns;return Object.assign(Object.assign({},null!=e?{columns:e}:{}),{bounds:"full",align:"each"})}}const Dg=Object.assign(Object.assign({disable:1,gridScale:1,scale:1},Se),{labelExpr:1,encode:1}),Cg=ne(Dg);class Sg extends Fu{constructor(e={},t={},n=!1){super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new Sg(R(this.explicit),R(this.implicit),this.mainExtracted)}hasAxisPart(e){return!("axis"!==e&&("grid"===e||"title"===e?!this.get(e):!1===(t=this.get(e))||null===t));var t}hasOrientSignalRef(){return Fr(this.explicit.orient)}}const Fg={bottom:"top",top:"bottom",left:"right",right:"left"};function Mg(e,t){if(!e)return t.map((e=>e.clone()));{if(e.length!==t.length)return;const n=e.length;for(let r=0;r{switch(n){case"title":return Na(e,t);case"gridScale":return{explicit:e.explicit,value:ye(e.value,t.value)}}return Nu(e,t,n,"axis")}));e.setWithExplicit(n,r)}return e}function $g(e,t,n,r,i){if("disable"===t)return void 0!==n;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(Fr(n.labelAngle)?n.labelAngle:ke(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===Ld(r,i))return!0}return e===n[t]}const Ng=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function Bg(e,t){var n,r,i;let o=t.axis(e);const a=new Sg,s=aa(t.encoding[e]),{mark:u,config:l}=t,c=(null==o?void 0:o.orient)||(null===(n=l["x"===e?"axisX":"axisY"])||void 0===n?void 0:n.orient)||(null===(r=l.axis)||void 0===r?void 0:r.orient)||function(e){return"x"===e?"bottom":"left"}(e),f=t.getScaleComponent(e).get("type"),d=function(e,t,n,r){const i="band"===t?["axisDiscrete","axisBand"]:"point"===t?["axisDiscrete","axisPoint"]:function(e){return e in si}(t)?["axisQuantitative"]:"time"===t||"utc"===t?["axisTemporal"]:[],o="x"===e?"axisX":"axisY",a=Fr(n)?"axisOrient":"axis"+le(n),s=[...i,...i.map((e=>o+e.substr(4)))],u=["axis",a,o];return{vlOnlyAxisConfig:$d(s,r,e,n),vgAxisConfig:$d(u,r,e,n),axisConfigStyle:Nd([...u,...s],r)}}(e,f,c,t.config),h=void 0!==o?!o:Bd("disable",l.style,null==o?void 0:o.style,d).configValue;if(a.set("disable",h,void 0!==o),h)return a;o=o||{};const p=function(e,t,n,r,i){const o=null==t?void 0:t.labelAngle;if(void 0!==o)return Fr(o)?o:ke(o);{const{configValue:o}=Bd("labelAngle",r,null==t?void 0:t.style,i);return void 0!==o?ke(o):n!==Ge||!W([Kr,Zr],e.type)||To(e)&&e.timeUnit?void 0:270}}(s,o,e,l.style,d),g={fieldOrDatumDef:s,axis:o,channel:e,model:t,scaleType:f,orient:c,labelAngle:p,mark:u,config:l};for(const n of Cg){const r=n in Td?Td[n](g):Me(n)?o[n]:void 0,i=void 0!==r,s=$g(r,n,o,t,e);if(i&&s)a.set(n,r,s);else{const{configValue:e,configFrom:t}=Me(n)&&"values"!==n?Bd(n,l.style,o.style,d):{},u=void 0!==e;i&&!u?a.set(n,r,s):("vgAxisConfig"!==t||Ng.has(n)&&u||Oe(e)||Fr(e))&&a.set(n,e,!1)}}const m=null!==(i=o.encoding)&&void 0!==i?i:{},y=De.reduce(((n,r)=>{var i;if(!a.hasAxisPart(r))return n;const o=lh(null!==(i=m[r])&&void 0!==i?i:{},t),s="labels"===r?function(e,t,n){var r;const{encoding:i,config:o}=e,a=null!==(r=aa(i[t]))&&void 0!==r?r:aa(i[Gt(t)]),s=e.axis(t)||{},{format:u,formatType:l}=s;return ao(l)?Object.assign({text:fo({fieldOrDatumDef:a,field:"datum.value",format:u,formatType:l,config:o})},n):n}(t,e,o):o;return void 0===s||te(s)||(n[r]={update:s}),n}),{});return te(y)||a.set("encode",y,!!o.encoding||void 0!==o.labelAngle),a}function Tg(e,t){const{config:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),Nl("x",e,{defaultPos:"mid"})),Nl("y",e,{defaultPos:"mid"})),Ml("size",e)),Ml("angle",e)),function(e,t,n){return n?{shape:{value:n}}:Ml("shape",e)}(e,0,t))}function zg(e){var t;const{config:n,markDef:r}=e,{orient:i}=r,o="horizontal"===i?"width":"height",a=e.getScaleComponent("horizontal"===i?"x":"y"),s=null!==(t=Da("size",r,n,{vgChannel:o}))&&void 0!==t?t:n.tick.bandSize;if(void 0!==s)return s;{const e=a?a.get("range"):void 0;return e&&Mr(e)&&w(e.step)?3*e.step/4:3*Rs(n.view,o)/4}}const Rg={arc:{vgMark:"arc",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),Nl("x",e,{defaultPos:"mid"})),Nl("y",e,{defaultPos:"mid"})),Ul(e,"radius","arc")),Ul(e,"theta","arc"))},area:{vgMark:"area",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"})),Pl("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===e.markDef.orient})),Pl("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===e.markDef.orient})),Xl(e))},bar:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),Ul(e,"x","bar")),Ul(e,"y","bar"))},circle:{vgMark:"symbol",encodeEntry:e=>Tg(e,"circle")},geoshape:{vgMark:"shape",encodeEntry:e=>Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[Object.assign({type:"geoshape",projection:e.projectionName()},n&&To(n)&&n.type===Qr?{field:Xo(n,{expr:"datum"})}:{})]}},image:{vgMark:"image",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"})),Ul(e,"x","image")),Ul(e,"y","image")),Ol(e,"url"))},line:{vgMark:"line",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),Nl("x",e,{defaultPos:"mid"})),Nl("y",e,{defaultPos:"mid"})),Ml("size",e,{vgChannel:"strokeWidth"})),Xl(e))},point:{vgMark:"symbol",encodeEntry:e=>Tg(e)},rect:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),Ul(e,"x","rect")),Ul(e,"y","rect"))},rule:{vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return e.encoding.x||e.encoding.y||e.encoding.latitude||e.encoding.longitude?Object.assign(Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),Pl("x",e,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n})),Pl("y",e,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n})),Ml("size",e,{vgChannel:"strokeWidth"})):{}}},square:{vgMark:"symbol",encodeEntry:e=>Tg(e,"square")},text:{vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vl(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"})),Nl("x",e,{defaultPos:"mid"})),Nl("y",e,{defaultPos:"mid"})),Ol(e)),Ml("size",e,{vgChannel:"fontSize"})),Ml("angle",e)),Zl("align",function(e,t,n){if(void 0===Da("align",e,n))return"center"}(e.markDef,0,t))),Zl("baseline",function(e,t,n){if(void 0===Da("baseline",e,n))return"middle"}(e.markDef,0,t))),Nl("radius",e,{defaultPos:null,isMidPoint:!0})),Nl("theta",e,{defaultPos:null,isMidPoint:!0}))}},tick:{vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,r=n.orient,i="horizontal"===r?"width":"height",o="horizontal"===r?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),Nl("x",e,{defaultPos:"mid",vgChannel:"xc"})),Nl("y",e,{defaultPos:"mid",vgChannel:"yc"})),Ml("size",e,{defaultValue:zg(e),vgChannel:i})),{[o]:ka(Da("thickness",n,t))})}},trail:{vgMark:"trail",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),Nl("x",e,{defaultPos:"mid"})),Nl("y",e,{defaultPos:"mid"})),Ml("size",e)),Xl(e))}};const Pg="faceted_path_",Lg="stack_group_";function Ig(e,t={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=e,a=ye(r.clip,function(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return!!(t&&t.get("selectionExtent")||n&&n.get("selectionExtent"))||void 0}(e),function(e){const t=e.component.projection;return!(!t||t.isFit)||void 0}(e)),s=Oa(r),u=i.key,l=function(e){const{encoding:t,stack:n,mark:r,markDef:i,config:o}=e,a=t.order;if(!(!d(a)&&qo(a)&&q(a.value)||!a&&q(Da("order",i,o)))){if((d(a)||To(a))&&!n)return Ma(a,{expr:"datum"});if(Wi(r)){const n="horizontal"===i.orient?"y":"x",r=t[n];if(To(r)){const t=r.sort;return d(t)?{field:Xo(r,{prefix:n,suffix:"sort_index",expr:"datum"})}:ko(t)?{field:Xo({aggregate:Pa(e.encoding)?t.op:void 0,field:t.field},{expr:"datum"})}:wo(t)?{field:Xo(e.fieldDef(t.encoding),{expr:"datum"}),order:t.order}:null===t?void 0:{field:Xo(r,{binSuffix:e.stack&&e.stack.impute?"mid":void 0,expr:"datum"})}}}}}(e),c=function(e){if(!e.component.selection)return null;const t=ne(e.component.selection).length;let n=t,r=e.parent;for(;r&&0===n;)n=ne(r.component.selection).length,r=r.parent;return n?{interactive:t>0||!!e.encoding.tooltip}:null}(e),f=Da("aria",r,o),h=Rg[n].postEncodingTransform?Rg[n].postEncodingTransform(e):null;return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:e.getName("marks"),type:Rg[n].vgMark},a?{clip:!0}:{}),s?{style:s}:{}),u?{key:u.field}:{}),l?{sort:l}:{}),c||{}),!1===f?{aria:f}:{}),{from:{data:t.fromPrefix+e.requestDataName(Wu.Main)},encode:{update:Rg[n].encodeEntry(e)}}),h?{transform:h}:{})]}class Ug extends tg{constructor(e,t,n,r={},i){super(e,"unit",t,n,i,void 0,Ns(e)?e.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection={},this.children=[];const o=Vi(e.mark)?Object.assign({},e.mark):{type:e.mark},a=o.type;void 0===o.filled&&(o.filled=function(e,t,{graticule:n}){if(n)return!1;const r=Ca("filled",e,t),i=e.type;return ye(r,i!==Bi&&i!==Ni&&i!==zi)}(o,i,{graticule:e.data&&qu(e.data)}));const s=this.encoding=Ia(e.encoding||{},a,o.filled,i);this.markDef=function(e,t,n){const r=Ci(e),i=Da("orient",r,n);if(r.orient=function(e,t,n){switch(e){case Bi:case Ii:case Ui:case Ri:case Ti:case $i:return}const{x:r,y:i,x2:o,y2:a}=t;switch(e){case ji:if(To(r)&&(Nn(r.bin)||To(i)&&i.aggregate&&!r.aggregate))return"vertical";if(To(i)&&(Nn(i.bin)||To(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o&&(To(r)&&r.type===Xr&&!$n(r.bin)||Lo(r)))return"horizontal";if(!a&&(To(i)&&i.type===Xr&&!$n(i.bin)||Lo(i)))return"vertical"}case zi:if(o&&(!To(r)||!Nn(r.bin))&&a&&(!To(i)||!Nn(i.bin)))return;case Mi:if(a)return To(i)&&Nn(i.bin)?"horizontal":"vertical";if(o)return To(r)&&Nn(r.bin)?"vertical":"horizontal";if(e===zi){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case Ni:case Pi:{const t=Po(r),o=Po(i);if(t&&!o)return"tick"!==e?"horizontal":"vertical";if(!t&&o)return"tick"!==e?"vertical":"horizontal";if(t&&o){const t=r,o=i,a=t.type===Jr,s=o.type===Jr;return a&&!s?"tick"!==e?"vertical":"horizontal":!a&&s?"tick"!==e?"horizontal":"vertical":!t.aggregate&&o.aggregate?"tick"!==e?"vertical":"horizontal":t.aggregate&&!o.aggregate?"tick"!==e?"horizontal":"vertical":n||"vertical"}return n||void 0}}return"vertical"}(r.type,t,i),void 0!==i&&i!==r.orient&&hr(`Specified orient "${r.orient}" overridden with "${i}".`),"bar"===r.type&&r.orient){const e=Da("cornerRadiusEnd",r,n);if(void 0!==e){const n="horizontal"===r.orient&&t.x2||"vertical"===r.orient&&t.y2?["cornerRadius"]:Ji[r.orient];for(const t of n)r[t]=e;void 0!==r.cornerRadiusEnd&&delete r.cornerRadiusEnd}}return void 0===Da("opacity",r,n)&&(r.opacity=function(e,t){if(W([Bi,Pi,Ii,Ui],e)&&!Pa(t))return.7}(r.type,t)),void 0===Da("cursor",r,n)&&(r.cursor=function(e,t,n){return t.href||e.href||Da("href",e,n)?"pointer":e.cursor}(r,t,n)),r}(o,s,i),this.size=function({encoding:e,size:t}){for(const n of cn){const r=Vt(n);$s(t[r])&&Po(e[n])&&(delete t[r],hr(ar(r)))}return t}({encoding:s,size:Ns(e)?Object.assign(Object.assign(Object.assign({},r),e.width?{width:e.width}:{}),e.height?{height:e.height}:{}):r}),this.stack=iu(a,s),this.specifiedScales=this.initScales(a,s),this.specifiedAxes=this.initAxes(s),this.specifiedLegends=this.initLegends(s),this.specifiedProjection=e.projection,this.selection=e.selection}get hasProjection(){const{encoding:e}=this,t=this.mark===qi,n=e&&Ot.some((t=>Io(e[t])));return t||n}scaleDomain(e){const t=this.specifiedScales[e];return t?t.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,t){return On.reduce(((e,n)=>{var r;const i=aa(t[n]);return i&&(e[n]=this.initScale(null!==(r=i.scale)&&void 0!==r?r:{})),e}),{})}initScale(e){const{domain:t,range:n}=e,r=Ci(e);return d(t)&&(r.domain=t.map(_a)),d(n)&&(r.range=n.map(_a)),r}initAxes(e){return cn.reduce(((t,n)=>{const r=e[n];if(Io(r)||n===Ge&&Io(e.x2)||n===Ve&&Io(e.y2)){const e=Io(r)?r.axis:void 0;t[n]=e?this.initAxis(Object.assign({},e)):e}return t}),{})}initAxis(e){const t=ne(e),n={};for(const r of t){const t=e[r];n[r]=Oe(t)?xa(t):_a(t)}return n}initLegends(e){return An.reduce(((t,n)=>{const r=aa(e[n]);if(r&&function(e){switch(e){case it:case ot:case at:case ut:case st:case ct:case ht:case pt:return!0;case ft:case dt:case lt:return!1}}(n)){const e=r.legend;t[n]=e?Ci(e):e}return t}),{})}parseData(){this.component.data=Eg(this)}parseLayoutSize(){!function(e){const{size:t,component:n}=e;for(const r of cn){const i=Vt(r);if(t[i]){const e=t[i];n.layoutSize.set(i,$s(e)?"step":e,!0)}else{const t=_g(e,i);n.layoutSize.set(i,t,!1)}}}(this)}parseSelections(){this.component.selection=function(e,t){var n;const r={},i=e.config.selection;for(const o of ne(null!=t?t:{})){const a=R(t[o]),s=i[a.type],{fields:u,encodings:l}=s,c=Ed(s,["fields","encodings"]);for(const e in c)"encodings"===e&&a.fields||"fields"===e&&a.encodings||("mark"===e&&(a[e]=Object.assign(Object.assign({},c[e]),a[e])),void 0!==a[e]&&!0!==a[e]||(a[e]=null!==(n=c[e])&&void 0!==n?n:a[e]));const f=ae(o),d=r[f]=Object.assign(Object.assign({},a),{name:f,events:k(a.on)?_l(a.on,"scope"):R(a.on)});Ec(d,(n=>{n.has(d)&&n.parse&&n.parse(e,d,a,t[o])}))}return r}(this,this.selection)}parseMarkGroup(){this.component.mark=function(e){if(W([Ni,Mi,Li],e.mark)){const t=Wa(e.mark,e.encoding);if(t.length>0)return function(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:Pg+e.requestDataName(Wu.Main),data:e.requestDataName(Wu.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:Ig(e,{fromPrefix:Pg})}]}(e,t)}else if(W([ji],e.mark)){const t=Br.some((t=>Da(t,e.markDef,e.config)));if(e.stack&&!e.fieldDef("size")&&t)return function(e){const[t]=Ig(e,{fromPrefix:Lg}),n=e.scaleName(e.stack.fieldChannel),r=(t={})=>e.vgField(e.stack.fieldChannel,t),i=(e,t)=>`${e}(${[r({prefix:"min",suffix:"start",expr:t}),r({prefix:"max",suffix:"start",expr:t}),r({prefix:"min",suffix:"end",expr:t}),r({prefix:"max",suffix:"end",expr:t})].map((e=>`scale('${n}',${e})`)).join(",")})`;let o,a;"x"===e.stack.fieldChannel?(o=Object.assign(Object.assign({},P(t.encode.update,["y","yc","y2","height",...Br])),{x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}}),a={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update=Object.assign(Object.assign({},L(t.encode.update,["y","yc","y2"])),{height:{field:{group:"height"}}})):(o=Object.assign(Object.assign({},P(t.encode.update,["x","xc","x2","width"])),{y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}}),a={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update=Object.assign(Object.assign({},L(t.encode.update,["x","xc","x2"])),{width:{field:{group:"width"}}}));for(const n of Br){const r=Ca(n,e.markDef,e.config);t.encode.update[n]?(o[n]=t.encode.update[n],delete t.encode.update[n]):r&&(o[n]=ka(r)),r&&(t.encode.update[n]={value:0})}const s=e.fieldDef(e.stack.groupbyChannel),u=Xo(s)?[Xo(s)]:[];return((null==s?void 0:s.bin)||(null==s?void 0:s.timeUnit))&&u.push(Xo(s,{binSuffix:"end"})),o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce(((n,r)=>{if(t.encode.update[r])return Object.assign(Object.assign({},n),{[r]:t.encode.update[r]});{const t=Ca(r,e.markDef,e.config);return void 0!==t?Object.assign(Object.assign({},n),{[r]:ka(t)}):n}}),o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Wu.Main),name:Lg+e.requestDataName(Wu.Main),groupby:u,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:a},marks:[t]}]}]}(e)}return Ig(e)}(this)}parseAxesAndHeaders(){var e;this.component.axes=(e=this,cn.reduce(((t,n)=>(e.component.scales[n]&&(t[n]=[Bg(n,e)]),t)),{}))}assembleSelectionTopLevelSignals(e){return function(e,t){let n=!1;return Lc(e,((r,i)=>{const o=r.name,a=A(o+Tc);if(0===t.filter((e=>e.name===o)).length){const e="global"===r.resolve?"union":r.resolve,n="multi"===r.type?", true)":")";t.push({name:r.name,update:`${Rc}(${a}, ${A(e)}${n}`})}n=!0,i.topLevelSignals&&(t=i.topLevelSignals(e,r,t)),Ec(r,(n=>{n.topLevelSignals&&(t=n.topLevelSignals(e,r,t))}))})),n&&0===t.filter((e=>"unit"===e.name)).length&&t.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]}),Cc(t)}(this,e)}assembleSignals(){return[...jd(this),...(e=this,t=[],Lc(e,((n,r)=>{const i=n.name;let o=r.modifyExpr(e,n);t.push(...r.signals(e,n)),Ec(n,(r=>{r.signals&&(t=r.signals(e,n,t)),r.modifyExpr&&(o=r.modifyExpr(e,n,o))})),t.push({name:i+"_modify",on:[{events:{signal:n.name+zc},update:`modify(${A(n.name+Tc)}, ${o})`}]})})),Cc(t))];var e,t}assembleSelectionData(e){return function(e,t){const n=[...t];return Lc(e,(t=>{const r={name:t.name+Tc};if(t.init){const n=t.project.items.map((e=>{const{signals:t}=e;return function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);iOc(e,!1)));r.values="interval"===t.type?[{unit:Ic(e,{escape:!1}),fields:n,values:i}]:i.map((t=>({unit:Ic(e,{escape:!1}),fields:n,values:t})))}n.filter((e=>e.name===t.name+Tc)).length||n.push(r)})),n}(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return ih(this)}assembleMarks(){var e;let t=null!==(e=this.component.mark)&&void 0!==e?e:[];return this.parent&&Qp(this.parent)||(t=Dc(this,t)),t.map(this.correctDataNames)}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return Ra(this.encoding,e)}fieldDef(e){return oa(this.encoding[e])}typedFieldDef(e){const t=this.fieldDef(e);return Uo(t)?t:null}}class qg extends eg{constructor(e,t,n,r,i){super(e,"layer",t,n,i,e.resolve,e.view);const o=Object.assign(Object.assign(Object.assign({},r),e.width?{width:e.width}:{}),e.height?{height:e.height}:{});this.children=e.layer.map(((e,t)=>{if(Ks(e))return new qg(e,this,this.getName("layer_"+t),o,i);if(Ba(e))return new Ug(e,this,this.getName("layer_"+t),o,i);throw new Error(Rn(e))}))}parseData(){this.component.data=Eg(this);for(const e of this.children)e.parseData()}parseLayoutSize(){bg(this),xg(this,"width"),xg(this,"height")}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of ne(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){!function(e){var t;const{axes:n,resolve:r}=e.component,i={top:0,bottom:0,right:0,left:0};for(const t of e.children){t.parseAxesAndHeaders();for(const i of ne(t.component.axes))r.axis[i]=fh(e.component.resolve,i),"shared"===r.axis[i]&&(n[i]=Mg(n[i],t.component.axes[i]),n[i]||(r.axis[i]="independent",delete n[i]))}for(const o of cn){for(const a of e.children)if(a.component.axes[o]){if("independent"===r.axis[o]){n[o]=(null!==(t=n[o])&&void 0!==t?t:[]).concat(a.component.axes[o]);for(const e of a.component.axes[o]){const{value:t,explicit:n}=e.getWithExplicit("orient");if(!Fr(t)){if(i[t]>0&&!n){const n=Fg[t];i[t]>i[n]&&e.set("orient",n,!1)}i[t]++}}}delete a.component.axes[o]}if("independent"===r.axis[o]&&n[o]&&n[o].length>1)for(const e of n[o])e.get("grid")&&!e.explicit.grid&&(e.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleSignals())),jd(this))}assembleLayoutSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleLayoutSignals())),ih(this))}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const t of this.children)if(e=t.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return function(e,t){for(const n of e.children)Zp(n)&&(t=Dc(n,t));return t}(this,this.children.flatMap((e=>e.assembleMarks())))}assembleLegends(){return this.children.reduce(((e,t)=>e.concat(t.assembleLegends())),Dh(this))}}function Wg(e,t,n,r,i){if(Do(e))return new kg(e,t,n,i);if(Ks(e))return new qg(e,t,n,r,i);if(Ba(e))return new Ug(e,t,n,r,i);if(function(e){return Ms(e)||js(e)||Fs(e)}(e))return new Og(e,t,n,i);throw new Error(Rn(e))}var Hg=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1)));const{params:f}=t,d=Hg(t,["params"]);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({$schema:"https://vega.github.io/schema/vega/v5.json"},e.description?{description:e.description}:{}),d),s?{title:s}:{}),u?{style:u}:{}),l?{encode:{update:l}}:{}),{data:o}),a.length>0?{projections:a}:{}),e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([]),...Es(f)])),i?{config:i}:{}),r?{usermeta:r}:{})}(i,function(e,t,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");if(void 0===t?(t={type:"pad"},r.hasAxisOrientSignalRef()&&(t.resize=!0)):k(t)&&(t={type:t}),i&&o&&("fit"===(a=t.type)||"fit-x"===a||"fit-y"===a))if("step"===i&&"step"===o)hr(Un()),t.type="pad";else if("step"===i||"step"===o){const e="step"===i?"width":"height";hr(Un(pn(e)));const n="width"===e?"height":"width";t.type=function(e){return e?`fit-${pn(e)}`:"fit"}(n)}var a;return Object.assign(Object.assign(Object.assign({},1===ne(t).length&&t.type?"pad"===t.type?{}:{autosize:t.type}:{autosize:t}),Su(n,!1)),Su(e,!0))}(e,r.autosize,n,i),e.datasets,e.usermeta);return{spec:o,normalized:r}}finally{t.logger&&(dr=fr),t.fieldTitle&&ea(Ko)}}},190:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Bounds:()=>am,CanvasHandler:()=>Uv,CanvasRenderer:()=>Yv,DATE:()=>Mn,DAY:()=>jn,DAYOFYEAR:()=>$n,Dataflow:()=>Ca,Debug:()=>B,Error:()=>j,EventStream:()=>pa,Gradient:()=>cg,GroupItem:()=>um,HOURS:()=>Nn,Handler:()=>bv,HybridHandler:()=>Pb,HybridRenderer:()=>Rb,Info:()=>N,Item:()=>sm,MILLISECONDS:()=>zn,MINUTES:()=>Bn,MONTH:()=>Sn,Marks:()=>rv,MultiPulse:()=>Aa,None:()=>M,Operator:()=>fa,Parameters:()=>ua,Pulse:()=>xa,QUARTER:()=>Cn,RenderType:()=>qb,Renderer:()=>_v,ResourceLoader:()=>lm,SECONDS:()=>Tn,SVGHandler:()=>Zv,SVGRenderer:()=>wb,SVGStringRenderer:()=>Bb,Scenegraph:()=>fv,TIME_UNITS:()=>Rn,Transform:()=>Fa,View:()=>iN,WEEK:()=>Fn,Warn:()=>$,YEAR:()=>Dn,accessor:()=>g,accessorFields:()=>y,accessorName:()=>m,array:()=>ue,ascending:()=>he,bandwidthNRD:()=>Ga,bin:()=>Va,bootstrapCI:()=>Za,boundClip:()=>Jb,boundContext:()=>Fm,boundItem:()=>iv,boundMark:()=>av,boundStroke:()=>dm,changeset:()=>aa,clampRange:()=>le,codegenExpression:()=>GF,compare:()=>de,constant:()=>ye,cumulativeLogNormal:()=>fs,cumulativeNormal:()=>os,cumulativeUniform:()=>ys,dayofyear:()=>Hn,debounce:()=>ve,defaultLocale:()=>vo,definition:()=>ja,densityLogNormal:()=>cs,densityNormal:()=>is,densityUniform:()=>ms,domChild:()=>gv,domClear:()=>mv,domCreate:()=>hv,domFind:()=>pv,dotbin:()=>Ja,error:()=>_,expressionFunction:()=>r$,extend:()=>be,extent:()=>xe,extentIndex:()=>_e,falsy:()=>S,fastmap:()=>Ee,field:()=>k,flush:()=>Oe,font:()=>Xy,fontFamily:()=>Yy,fontSize:()=>qy,format:()=>Uo,formatLocale:()=>lo,formats:()=>qo,hasOwnProperty:()=>ke,id:()=>A,identity:()=>E,inferType:()=>Bo,inferTypes:()=>To,ingest:()=>ea,inherits:()=>De,inrange:()=>Ce,interpolate:()=>$p,interpolateColors:()=>Fp,interpolateRange:()=>Sp,intersect:()=>Gb,intersectBoxLine:()=>Im,intersectPath:()=>zm,intersectPoint:()=>Rm,intersectRule:()=>Lm,isArray:()=>z,isBoolean:()=>Se,isDate:()=>Fe,isFunction:()=>ce,isIterable:()=>Me,isNumber:()=>je,isObject:()=>R,isRegExp:()=>$e,isString:()=>Ne,isTuple:()=>Jo,key:()=>Be,lerp:()=>Te,lineHeight:()=>Wy,loader:()=>Go,locale:()=>yo,logger:()=>T,lruCache:()=>Re,markup:()=>pb,merge:()=>Pe,mergeConfig:()=>L,multiLineOffset:()=>Gy,one:()=>D,pad:()=>Ie,panLinear:()=>J,panLog:()=>K,panPow:()=>Q,panSymlog:()=>ee,parse:()=>$R,parseExpression:()=>qF,parseSelector:()=>wN,path:()=>dc,pathCurves:()=>dg,pathEqual:()=>ex,pathParse:()=>vg,pathRectangle:()=>Ug,pathRender:()=>Sg,pathSymbols:()=>$g,pathTrail:()=>qg,peek:()=>q,point:()=>vv,projection:()=>ZA,quantileLogNormal:()=>ds,quantileNormal:()=>as,quantileUniform:()=>vs,quantiles:()=>Wa,quantizeInterpolator:()=>Mp,quarter:()=>ae,quartiles:()=>Ha,random:()=>Ya,randomInteger:()=>Qa,randomKDE:()=>us,randomLCG:()=>Ka,randomLogNormal:()=>hs,randomMixture:()=>ps,randomNormal:()=>ss,randomUniform:()=>bs,read:()=>Ho,regressionConstant:()=>xs,regressionExp:()=>Ds,regressionLinear:()=>Es,regressionLoess:()=>Ns,regressionLog:()=>Os,regressionPoly:()=>Fs,regressionPow:()=>Cs,regressionQuad:()=>Ss,renderModule:()=>Hb,repeat:()=>Le,resetDefaultLocale:()=>bo,resetSVGClipId:()=>im,resetSVGDefIds:()=>tx,responseType:()=>Wo,runtimeContext:()=>h$,sampleCurve:()=>Rs,sampleLogNormal:()=>ls,sampleNormal:()=>rs,sampleUniform:()=>gs,scale:()=>bp,sceneEqual:()=>Qb,sceneFromJSON:()=>lv,scenePickVisit:()=>Km,sceneToJSON:()=>uv,sceneVisit:()=>Jm,sceneZOrder:()=>Zm,scheme:()=>zp,serializeXML:()=>gb,setHybridRendererOptions:()=>zb,setRandom:()=>Xa,span:()=>Ue,splitAccessPath:()=>w,stringValue:()=>qe,textMetrics:()=>zy,timeBin:()=>Fr,timeFloor:()=>sr,timeFormatLocale:()=>go,timeInterval:()=>hr,timeOffset:()=>mr,timeSequence:()=>br,timeUnitSpecifier:()=>Un,timeUnits:()=>Ln,toBoolean:()=>We,toDate:()=>Ge,toNumber:()=>W,toSet:()=>Ye,toString:()=>Ve,transform:()=>$a,transforms:()=>Ma,truncate:()=>Xe,truthy:()=>C,tupleid:()=>Ko,typeParsers:()=>jo,utcFloor:()=>cr,utcInterval:()=>pr,utcOffset:()=>yr,utcSequence:()=>xr,utcdayofyear:()=>Jn,utcquarter:()=>se,utcweek:()=>Kn,version:()=>NR,visitArray:()=>Ze,week:()=>Gn,writeConfig:()=>I,zero:()=>O,zoomLinear:()=>ne,zoomLog:()=>re,zoomPow:()=>ie,zoomSymlog:()=>oe});var r={};n.r(r),n.d(r,{aggregate:()=>nu,bin:()=>ru,collect:()=>ou,compare:()=>au,countpattern:()=>uu,cross:()=>lu,density:()=>hu,dotbin:()=>vu,expression:()=>bu,extent:()=>_u,facet:()=>ku,field:()=>Au,filter:()=>Ou,flatten:()=>Du,fold:()=>Cu,formula:()=>Su,generate:()=>Fu,impute:()=>$u,joinaggregate:()=>Nu,kde:()=>Bu,key:()=>Tu,load:()=>Ru,lookup:()=>Lu,multiextent:()=>Iu,multivalues:()=>qu,params:()=>Hu,pivot:()=>Gu,prefacet:()=>Vu,project:()=>Yu,proxy:()=>Xu,quantile:()=>Zu,relay:()=>Ju,sample:()=>Ku,sequence:()=>Qu,sieve:()=>el,subflow:()=>wu,timeunit:()=>tl,tupleindex:()=>rl,values:()=>il,window:()=>ll});var i={};n.r(i),n.d(i,{interpolate:()=>Tf,interpolateArray:()=>Cf,interpolateBasis:()=>mf,interpolateBasisClosed:()=>yf,interpolateCubehelix:()=>Fh,interpolateCubehelixLong:()=>Mh,interpolateDate:()=>Ff,interpolateDiscrete:()=>Td,interpolateHcl:()=>yh,interpolateHclLong:()=>vh,interpolateHsl:()=>Yd,interpolateHslLong:()=>Xd,interpolateHue:()=>zd,interpolateLab:()=>gh,interpolateNumber:()=>Mf,interpolateNumberArray:()=>Of,interpolateObject:()=>jf,interpolateRgb:()=>wf,interpolateRgbBasis:()=>Af,interpolateRgbBasisClosed:()=>Ef,interpolateRound:()=>zf,interpolateString:()=>Bf,interpolateTransformCss:()=>qd,interpolateTransformSvg:()=>Wd,interpolateZoom:()=>Gd,piecewise:()=>Ed,quantize:()=>jh});var o={};n.r(o),n.d(o,{bound:()=>Sx,identifier:()=>jx,mark:()=>$x,overlap:()=>Nx,render:()=>Ix,viewlayout:()=>u_});var a={};n.r(a),n.d(a,{axisticks:()=>c_,datajoin:()=>f_,encode:()=>h_,legendentries:()=>p_,linkpath:()=>b_,pie:()=>A_,scale:()=>D_,sortitems:()=>M_,stack:()=>T_});var s={};n.r(s),n.d(s,{contour:()=>vE,geojson:()=>_E,geopath:()=>wE,geopoint:()=>kE,geoshape:()=>AE,graticule:()=>EE,heatmap:()=>OE,isocontour:()=>uE,kde2d:()=>gE,projection:()=>CE});var u={};n.r(u),n.d(u,{force:()=>kO});var l={};n.r(l),n.d(l,{nest:()=>DD,pack:()=>$D,partition:()=>BD,stratify:()=>TD,tree:()=>PD,treelinks:()=>LD,treemap:()=>qD});var c={};n.r(c),n.d(c,{label:()=>fC});var f={};n.r(f),n.d(f,{loess:()=>hC,regression:()=>gC});var d={};n.r(d),n.d(d,{voronoi:()=>HC});var h={};n.r(h),n.d(h,{wordcloud:()=>aS});var p={};function g(e,t,n){return e.fields=t||[],e.fname=n,e}function m(e){return null==e?null:e.fname}function y(e){return null==e?null:e.fields}function v(e){return 1===e.length?b(e[0]):x(e)}n.r(p),n.d(p,{crossfilter:()=>hS,resolvefilter:()=>pS});const b=e=>function(t){return t[e]},x=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),s=r=i+1):"]"===o&&(s||_("Access path missing open bracket: "+e),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&_("Access path missing closing bracket: "+e),a&&_("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function k(e,t,n){const r=w(e);return e=1===r.length?r[0]:e,g((n&&n.get||v)(r),[e],t||e)}const A=k("id"),E=g((e=>e),[],"identity"),O=g((()=>0),[],"zero"),D=g((()=>1),[],"one"),C=g((()=>!0),[],"true"),S=g((()=>!1),[],"false");function F(e,t,n){const r=[t].concat([].slice.call(n));console[e].apply(console,r)}const M=0,j=1,$=2,N=3,B=4;function T(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:F,r=e||M;return{level(e){return arguments.length?(r=+e,this):r},error(){return r>=j&&n(t||"error","ERROR",arguments),this},warn(){return r>=$&&n(t||"warn","WARN",arguments),this},info(){return r>=N&&n(t||"log","INFO",arguments),this},debug(){return r>=B&&n(t||"log","DEBUG",arguments),this}}}var z=Array.isArray;function R(e){return e===Object(e)}const P=e=>"__proto__"!==e;function L(){for(var e=arguments.length,t=new Array(e),n=0;n{for(const n in t)if("signals"===n)e.signals=U(e.signals,t.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;I(e,n,t[n],r)}return e}),{})}function I(e,t,n,r){if(!P(t))return;let i,o;if(R(n)&&!z(n))for(i in o=R(e[t])?e[t]:e[t]={},n)r&&(!0===r||r[i])?I(o,i,n[i]):P(i)&&(o[i]=n[i]);else e[t]=n}function U(e,t){if(null==e)return t;const n={},r=[];function i(e){n[e.name]||(n[e.name]=1,r.push(e))}return t.forEach(i),e.forEach(i),r}function q(e){return e[e.length-1]}function W(e){return null==e||""===e?null:+e}const H=e=>t=>e*Math.exp(t),G=e=>t=>Math.log(e*t),V=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),Y=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,X=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function Z(e,t,n,r){const i=n(e[0]),o=n(q(e)),a=(o-i)*t;return[r(i-a),r(o-a)]}function J(e,t){return Z(e,t,W,E)}function K(e,t){var n=Math.sign(e[0]);return Z(e,t,G(n),H(n))}function Q(e,t,n){return Z(e,t,X(n),X(1/n))}function ee(e,t,n){return Z(e,t,V(n),Y(n))}function te(e,t,n,r,i){const o=r(e[0]),a=r(q(e)),s=null!=t?r(t):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function ne(e,t,n){return te(e,t,n,W,E)}function re(e,t,n){const r=Math.sign(e[0]);return te(e,t,n,G(r),H(r))}function ie(e,t,n,r){return te(e,t,n,X(r),X(1/r))}function oe(e,t,n,r){return te(e,t,n,V(r),Y(r))}function ae(e){return 1+~~(new Date(e).getMonth()/3)}function se(e){return 1+~~(new Date(e).getUTCMonth()/3)}function ue(e){return null!=e?z(e)?e:[e]:[]}function le(e,t,n){let r,i=e[0],o=e[1];return o=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-r),i+r]}function ce(e){return"function"==typeof e}const fe="descending";function de(e,t,n){n=n||{},t=ue(t)||[];const r=[],i=[],o={},a=n.comparator||pe;return ue(e).forEach(((e,a)=>{null!=e&&(r.push(t[a]===fe?-1:1),i.push(e=ce(e)?e:k(e,null,n)),(y(e)||[]).forEach((e=>o[e]=1)))})),0===i.length?null:g(a(i,r),Object.keys(o))}const he=(e,t)=>(et||null==t)&&null!=e?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t==t?-1:t!=t&&e==e?1:0),pe=(e,t)=>1===e.length?ge(e[0],t[0]):me(e,t,e.length),ge=(e,t)=>function(n,r){return he(e(n),e(r))*t},me=(e,t,n)=>(t.push(0),function(r,i){let o,a=0,s=-1;for(;0===a&&++se}function ve(e,t){let n;return r=>{n&&clearTimeout(n),n=setTimeout((()=>(t(r),n=null)),e)}}function be(e){for(let t,n,r=1,i=arguments.length;ro&&(o=r))}else{for(r=t(e[a]);ao&&(o=r))}return[i,o]}function _e(e,t){const n=e.length;let r,i,o,a,s,u=-1;if(null==t){for(;++u=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++ui&&(r=i,a=u),o=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++ui&&(r=i,a=u),or(e)?n[e]:void 0,set(e,t){return r(e)||(++i.size,n[e]===Ae&&--i.empty),n[e]=t,this},delete(e){return r(e)&&(--i.size,++i.empty,n[e]=Ae),this},clear(){i.size=i.empty=0,i.object=n={}},test(e){return arguments.length?(t=e,i):t},clean(){const e={};let r=0;for(const i in n){const o=n[i];o===Ae||t&&t(o)||(e[i]=o,++r)}i.size=r,i.empty=0,i.object=n=e}};return e&&Object.keys(e).forEach((t=>{i.set(t,e[t])})),i}function Oe(e,t,n,r,i,o){if(!n&&0!==n)return o;const a=+n;let s,u=e[0],l=q(e);la&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=e:oe.replace(/\\(.)/g,"$1"))):ue(e));const r=e&&e.length,i=n&&n.get||v,o=e=>i(t?[e]:w(e));let a;if(r)if(1===r){const t=o(e[0]);a=function(e){return""+t(e)}}else{const t=e.map(o);a=function(e){let n=""+t[0](e),i=0;for(;++i{t={},n={},r=0},o=(i,o)=>(++r>e&&(n=t,t={},r=1),t[i]=o);return i(),{clear:i,has:e=>ke(t,e)||ke(n,e),get:e=>ke(t,e)?t[e]:ke(n,e)?o(e,n[e]):void 0,set:(e,n)=>ke(t,e)?t[e]=n:o(e,n)}}function Pe(e,t,n,r){const i=t.length,o=n.length;if(!o)return t;if(!i)return n;const a=r||new t.constructor(i+o);let s=0,u=0,l=0;for(;s0?n[u++]:t[s++];for(;s=0;)n+=e;return n}function Ie(e,t,n,r){const i=n||" ",o=e+"",a=t-o.length;return a<=0?o:"left"===r?Le(i,a)+o:"center"===r?Le(i,~~(a/2))+o+Le(i,Math.ceil(a/2)):o+Le(i,a)}function Ue(e){return e&&q(e)-e[0]||0}function qe(e){return z(e)?"["+e.map(qe)+"]":R(e)||Ne(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function We(e){return null==e||""===e?null:!(!e||"false"===e||"0"===e||!e)}const He=e=>je(e)||Fe(e)?e:Date.parse(e);function Ge(e,t){return t=t||He,null==e||""===e?null:t(e)}function Ve(e){return null==e||""===e?null:e+""}function Ye(e){const t={},n=e.length;for(let r=0;r=o?u=!0:(r=e.charCodeAt(a++))===et?l=!0:r===tt&&(l=!0,e.charCodeAt(a)===et&&++a),e.slice(i+1,t-1).replace(/""/g,'"')}for(;a9999?"+"+it(t,6):it(t,4))+"-"+it(e.getUTCMonth()+1,2)+"-"+it(e.getUTCDate(),2)+(o?"T"+it(n,2)+":"+it(r,2)+":"+it(i,2)+"."+it(o,3)+"Z":i?"T"+it(n,2)+":"+it(r,2)+":"+it(i,2)+"Z":r||n?"T"+it(n,2)+":"+it(r,2)+"Z":"")}(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function(e,t){var n,i,o=r(e,(function(e,r){if(n)return n(e,r-1);i=e,n=t?function(e,t){var n=nt(e);return function(r,i){return t(n(r),i,e)}}(e,t):nt(e)}));return o.columns=i||[],o},parseRows:r,format:function(t,n){return null==n&&(n=rt(t)),[n.map(a).join(e)].concat(i(t,n)).join("\n")},formatBody:function(e,t){return null==t&&(t=rt(e)),i(e,t).join("\n")},formatRows:function(e){return e.map(o).join("\n")},formatRow:o,formatValue:a}}function at(e){return e}function st(e,t){return"string"==typeof t&&(t=e.objects[t]),"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map((function(t){return ut(e,t)}))}:ut(e,t)}function ut(e,t){var n=t.id,r=t.bbox,i=null==t.properties?{}:t.properties,o=lt(e,t);return null==n&&null==r?{type:"Feature",properties:i,geometry:o}:null==r?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}function lt(e,t){var n=function(e){if(null==e)return at;var t,n,r=e.scale[0],i=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=n=0);var u=2,l=e.length,c=new Array(l);for(c[0]=(t+=e[0])*r+o,c[1]=(n+=e[1])*i+a;u1)r=function(e,t,n){var r,i=[],o=[];function a(e){var t=e<0?~e:e;(o[t]||(o[t]=[])).push({i:e,g:r})}function s(e){e.forEach(a)}function u(e){e.forEach(s)}return function e(t){switch(r=t,t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"LineString":s(t.arcs);break;case"MultiLineString":case"Polygon":u(t.arcs);break;case"MultiPolygon":!function(e){e.forEach(u)}(t.arcs)}}(t),o.forEach(null==n?function(e){i.push(e[0].i)}:function(e){n(e[0].g,e[e.length-1].g)&&i.push(e[0].i)}),i}(0,t,n);else for(i=0,r=new Array(o=e.arcs.length);i=ht?10:o>=pt?5:o>=gt?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(e*l),u=Math.round(t*l),s/lt&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(e/l),u=Math.round(t/l),s*lt&&--u),u0))return[];if((e=+e)==(t=+t))return[e];const r=t=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let e=0;e=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function wt(e){if(!(t=_t.exec(e)))throw new Error("invalid format: "+e);var t;return new kt({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function kt(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function At(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Et(e){return(e=At(Math.abs(e)))?e[1]:NaN}function Ot(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Et(t)/3)))-Et(Math.abs(e)))}function Dt(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Et(t)-Et(e))+1}function Ct(e){return Math.max(0,-Et(Math.abs(e)))}function St(e,t){var n=At(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}wt.prototype=kt.prototype,kt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Ft={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>St(100*e,t),r:St,s:function(e,t){var n=At(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(xt=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+At(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Mt(e){return e}var jt,$t,Nt,Bt=Array.prototype.map,Tt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function zt(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?Mt:(t=Bt.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(e.substring(i-=s,i+s)),!((u+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?Mt:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(Bt.call(e.numerals,String)),u=void 0===e.percent?"%":e.percent+"",l=void 0===e.minus?"−":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function f(e){var t=(e=wt(e)).fill,n=e.align,f=e.sign,d=e.symbol,h=e.zero,p=e.width,g=e.comma,m=e.precision,y=e.trim,v=e.type;"n"===v?(g=!0,v="g"):Ft[v]||(void 0===m&&(m=12),y=!0,v="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var b="$"===d?i:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===d?o:/[%p]/.test(v)?u:"",_=Ft[v],w=/[defgprs%]/.test(v);function k(e){var i,o,u,d=b,k=x;if("c"===v)k=_(e)+k,e="";else{var A=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:_(Math.abs(e),m),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),A&&0==+e&&"+"!==f&&(A=!1),d=(A?"("===f?f:l:"-"===f||"("===f?"":f)+d,k=("s"===v?Tt[8+xt/3]:"")+k+(A&&"("===f?")":""),w)for(i=-1,o=e.length;++i(u=e.charCodeAt(i))||u>57){k=(46===u?a+e.slice(i+1):e.slice(i))+k,e=e.slice(0,i);break}}g&&!h&&(e=r(e,1/0));var E=d.length+e.length+k.length,O=E>1)+d+e+k+O.slice(E);break;default:e=O+d+e+k}return s(e)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),k.toString=function(){return e+""},k}return{format:f,formatPrefix:function(e,t){var n=f(((e=wt(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(Et(t)/3))),i=Math.pow(10,-r),o=Tt[8+r/3];return function(e){return n(i*e)+o}}}}jt=zt({thousands:",",grouping:[3],currency:["$",""]}),$t=jt.format,Nt=jt.formatPrefix;const Rt=new Date,Pt=new Date;function Lt(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(sLt((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})),n&&(i.count=(t,r)=>(Rt.setTime(+t),Pt.setTime(+r),e(Rt),e(Pt),Math.floor(n(Rt,Pt))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e==0:t=>i.count(0,t)%e==0):i:null)),i}const It=1e3,Ut=6e4,qt=36e5,Wt=864e5,Ht=6048e5,Gt=31536e6,Vt=Lt((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ut)/Wt),(e=>e.getDate()-1)),Yt=(Vt.range,Lt((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/Wt),(e=>e.getUTCDate()-1))),Xt=(Yt.range,Lt((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/Wt),(e=>Math.floor(e/Wt))));function Zt(e){return Lt((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ut)/Ht))}Xt.range;const Jt=Zt(0),Kt=Zt(1),Qt=Zt(2),en=Zt(3),tn=Zt(4),nn=Zt(5),rn=Zt(6);function on(e){return Lt((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/Ht))}Jt.range,Kt.range,Qt.range,en.range,tn.range,nn.range,rn.range;const an=on(0),sn=on(1),un=on(2),ln=on(3),cn=on(4),fn=on(5),dn=on(6),hn=(an.range,sn.range,un.range,ln.range,cn.range,fn.range,dn.range,Lt((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear())));hn.every=e=>isFinite(e=Math.floor(e))&&e>0?Lt((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,hn.range;const pn=Lt((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));pn.every=e=>isFinite(e=Math.floor(e))&&e>0?Lt((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,pn.range;const gn=Lt((e=>{e.setDate(1),e.setHours(0,0,0,0)}),((e,t)=>{e.setMonth(e.getMonth()+t)}),((e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())),(e=>e.getMonth())),mn=(gn.range,Lt((e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)}),((e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())),(e=>e.getUTCMonth()))),yn=(mn.range,Lt((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*It-e.getMinutes()*Ut)}),((e,t)=>{e.setTime(+e+t*qt)}),((e,t)=>(t-e)/qt),(e=>e.getHours()))),vn=(yn.range,Lt((e=>{e.setUTCMinutes(0,0,0)}),((e,t)=>{e.setTime(+e+t*qt)}),((e,t)=>(t-e)/qt),(e=>e.getUTCHours()))),bn=(vn.range,Lt((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*It)}),((e,t)=>{e.setTime(+e+t*Ut)}),((e,t)=>(t-e)/Ut),(e=>e.getMinutes()))),xn=(bn.range,Lt((e=>{e.setUTCSeconds(0,0)}),((e,t)=>{e.setTime(+e+t*Ut)}),((e,t)=>(t-e)/Ut),(e=>e.getUTCMinutes()))),_n=(xn.range,Lt((e=>{e.setTime(e-e.getMilliseconds())}),((e,t)=>{e.setTime(+e+t*It)}),((e,t)=>(t-e)/It),(e=>e.getUTCSeconds()))),wn=(_n.range,Lt((()=>{}),((e,t)=>{e.setTime(+e+t)}),((e,t)=>t-e)));function kn(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function An(e,t){return null==e||null==t?NaN:te?1:t>=e?0:NaN}function En(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i>>1;n(e[t],r)<0?i=t+1:o=t}while(ikn(e(t),n),r=(t,n)=>e(t)-n):(t=e===kn||e===An?e:On,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i>>1;n(e[t],r)<=0?i=t+1:o=t}while(i(e=Math.floor(e),isFinite(e)&&e>0?e>1?Lt((t=>{t.setTime(Math.floor(t/e)*e)}),((t,n)=>{t.setTime(+t+n*e)}),((t,n)=>(n-t)/e)):wn:null),wn.range;const Dn="year",Cn="quarter",Sn="month",Fn="week",Mn="date",jn="day",$n="dayofyear",Nn="hours",Bn="minutes",Tn="seconds",zn="milliseconds",Rn=[Dn,Cn,Sn,Fn,Mn,jn,$n,Nn,Bn,Tn,zn],Pn=Rn.reduce(((e,t,n)=>(e[t]=1+n,e)),{});function Ln(e){const t=ue(e).slice(),n={};return t.length||_("Missing time unit."),t.forEach((e=>{ke(Pn,e)?n[e]=1:_(`Invalid time unit: ${e}.`)})),(n[Fn]||n[jn]?1:0)+(n[Cn]||n[Sn]||n[Mn]?1:0)+(n[$n]?1:0)>1&&_(`Incompatible time units: ${e}`),t.sort(((e,t)=>Pn[e]-Pn[t])),t}const In={[Dn]:"%Y ",[Cn]:"Q%q ",[Sn]:"%b ",[Mn]:"%d ",[Fn]:"W%U ",[jn]:"%a ",[$n]:"%j ",[Nn]:"%H:00",[Bn]:"00:%M",[Tn]:":%S",[zn]:".%L",[`${Dn}-${Sn}`]:"%Y-%m ",[`${Dn}-${Sn}-${Mn}`]:"%Y-%m-%d ",[`${Nn}-${Bn}`]:"%H:%M"};function Un(e,t){const n=be({},In,t),r=Ln(e),i=r.length;let o,a,s="",u=0;for(u=0;uu;--o)if(a=r.slice(u,o).join("-"),null!=n[a]){s+=n[a],u=o;break}return s.trim()}const qn=new Date;function Wn(e){return qn.setFullYear(e),qn.setMonth(0),qn.setDate(1),qn.setHours(0,0,0,0),qn}function Hn(e){return Vn(new Date(e))}function Gn(e){return Yn(new Date(e))}function Vn(e){return Vt.count(Wn(e.getFullYear())-1,e)}function Yn(e){return Jt.count(Wn(e.getFullYear())-1,e)}function Xn(e){return Wn(e).getDay()}function Zn(e,t,n,r,i,o,a){if(0<=e&&e<100){const s=new Date(-1,t,n,r,i,o,a);return s.setFullYear(e),s}return new Date(e,t,n,r,i,o,a)}function Jn(e){return Qn(new Date(e))}function Kn(e){return er(new Date(e))}function Qn(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Yt.count(t-1,e)}function er(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return an.count(t-1,e)}function tr(e){return qn.setTime(Date.UTC(e,0,1)),qn.getUTCDay()}function nr(e,t,n,r,i,o,a){if(0<=e&&e<100){const e=new Date(Date.UTC(-1,t,n,r,i,o,a));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(e,t,n,r,i,o,a))}function rr(e,t,n,r,i){const o=t||1,a=q(e),s=(e,t,i)=>function(e,t,n,r){const i=n<=1?e:r?(t,i)=>r+n*Math.floor((e(t,i)-r)/n):(t,r)=>n*Math.floor(e(t,r)/n);return t?(e,n)=>t(i(e,n),n):i}(n[i=i||e],r[i],e===a&&o,t),u=new Date,l=Ye(e),c=l[Dn]?s(Dn):ye(2012),f=l[Sn]?s(Sn):l[Cn]?s(Cn):O,d=l[Fn]&&l[jn]?s(jn,1,Fn+jn):l[Fn]?s(Fn,1):l[jn]?s(jn,1):l[Mn]?s(Mn,1):l[$n]?s($n,1):D,h=l[Nn]?s(Nn):O,p=l[Bn]?s(Bn):O,g=l[Tn]?s(Tn):O,m=l[zn]?s(zn):O;return function(e){u.setTime(+e);const t=c(u);return i(t,f(u),d(u,t),h(u),p(u),g(u),m(u))}}function ir(e,t,n){return t+7*e-(n+6)%7}const or={[Dn]:e=>e.getFullYear(),[Cn]:e=>Math.floor(e.getMonth()/3),[Sn]:e=>e.getMonth(),[Mn]:e=>e.getDate(),[Nn]:e=>e.getHours(),[Bn]:e=>e.getMinutes(),[Tn]:e=>e.getSeconds(),[zn]:e=>e.getMilliseconds(),[$n]:e=>Vn(e),[Fn]:e=>Yn(e),[Fn+jn]:(e,t)=>ir(Yn(e),e.getDay(),Xn(t)),[jn]:(e,t)=>ir(1,e.getDay(),Xn(t))},ar={[Cn]:e=>3*e,[Fn]:(e,t)=>ir(e,0,Xn(t))};function sr(e,t){return rr(e,t||1,or,ar,Zn)}const ur={[Dn]:e=>e.getUTCFullYear(),[Cn]:e=>Math.floor(e.getUTCMonth()/3),[Sn]:e=>e.getUTCMonth(),[Mn]:e=>e.getUTCDate(),[Nn]:e=>e.getUTCHours(),[Bn]:e=>e.getUTCMinutes(),[Tn]:e=>e.getUTCSeconds(),[zn]:e=>e.getUTCMilliseconds(),[$n]:e=>Qn(e),[Fn]:e=>er(e),[jn]:(e,t)=>ir(1,e.getUTCDay(),tr(t)),[Fn+jn]:(e,t)=>ir(er(e),e.getUTCDay(),tr(t))},lr={[Cn]:e=>3*e,[Fn]:(e,t)=>ir(e,0,tr(t))};function cr(e,t){return rr(e,t||1,ur,lr,nr)}const fr={[Dn]:hn,[Cn]:gn.every(3),[Sn]:gn,[Fn]:Jt,[Mn]:Vt,[jn]:Vt,[$n]:Vt,[Nn]:yn,[Bn]:bn,[Tn]:_n,[zn]:wn},dr={[Dn]:pn,[Cn]:mn.every(3),[Sn]:mn,[Fn]:an,[Mn]:Yt,[jn]:Yt,[$n]:Yt,[Nn]:vn,[Bn]:xn,[Tn]:_n,[zn]:wn};function hr(e){return fr[e]}function pr(e){return dr[e]}function gr(e,t,n){return e?e.offset(t,n):void 0}function mr(e,t,n){return gr(hr(e),t,n)}function yr(e,t,n){return gr(pr(e),t,n)}function vr(e,t,n,r){return e?e.range(t,n,r):void 0}function br(e,t,n,r){return vr(hr(e),t,n,r)}function xr(e,t,n,r){return vr(pr(e),t,n,r)}const _r=31536e6,wr=[Dn,Sn,Mn,Nn,Bn,Tn,zn],kr=wr.slice(0,-1),Ar=kr.slice(0,-1),Er=Ar.slice(0,-1),Or=Er.slice(0,-1),Dr=[Dn,Sn],Cr=[Dn],Sr=[[kr,1,1e3],[kr,5,5e3],[kr,15,15e3],[kr,30,3e4],[Ar,1,6e4],[Ar,5,3e5],[Ar,15,9e5],[Ar,30,18e5],[Er,1,36e5],[Er,3,108e5],[Er,6,216e5],[Er,12,432e5],[Or,1,864e5],[[Dn,Fn],1,6048e5],[Dr,1,2592e6],[Dr,3,7776e6],[Cr,1,_r]];function Fr(e){const t=e.extent,n=e.maxbins||40,r=Math.abs(Ue(t))/n;let i,o,a=En((e=>e[2])).right(Sr,r);return a===Sr.length?(i=Cr,o=bt(t[0]/_r,t[1]/_r,n)):a?(a=Sr[r/Sr[a-1][2]=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:to,s:no,S:wi,u:ki,U:Ai,V:Oi,w:Di,W:Ci,x:null,X:null,y:Si,Y:Mi,Z:$i,"%":eo},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return u[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:Ni,e:Ni,f:Pi,g:Zi,G:Ki,H:Bi,I:Ti,j:zi,L:Ri,m:Li,M:Ii,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:to,s:no,S:Ui,u:qi,U:Wi,V:Gi,w:Vi,W:Yi,x:null,X:null,y:Xi,Y:Ji,Z:Qi,"%":eo},_={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=g.exec(t.slice(n));return r?(e.m=m.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return A(e,t,n,r)},d:ii,e:ii,f:ci,g:ei,G:Qr,H:ai,I:ai,j:oi,L:li,m:ri,M:si,p:function(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=c.get(r[0].toLowerCase()),n+r[0].length):-1},q:ni,Q:di,s:hi,S:ui,u:Xr,U:Zr,V:Jr,w:Yr,W:Kr,x:function(e,t,r){return A(e,n,t,r)},X:function(e,t,n){return A(e,r,t,n)},y:ei,Y:Qr,Z:ti,"%":fi};function w(e,t){return function(n){var r,i,o,a=[],s=-1,u=0,l=e.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=jr($r(o.y,0,1))).getUTCDay(),r=i>4||0===i?sn.ceil(r):sn(r),r=Yt.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=Mr($r(o.y,0,1))).getDay(),r=i>4||0===i?Kt.ceil(r):Kt(r),r=Vt.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?jr($r(o.y,0,1)).getUTCDay():Mr($r(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,jr(o)):Mr(o)}}function A(e,t,n,r){for(var i,o,a=0,s=t.length,u=n.length;a=u)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=_[i in Lr?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=w(n,b),b.X=w(r,b),b.c=w(t,b),x.x=w(n,x),x.X=w(r,x),x.c=w(t,x),{format:function(e){var t=w(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=k(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=w(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=k(e+="",!0);return t.toString=function(){return e},t}}}var Br,Tr,zr,Rr,Pr,Lr={"-":"",_:" ",0:"0"},Ir=/^\s*\d+/,Ur=/^%/,qr=/[\\^$*+?|[\]().{}]/g;function Wr(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o[e.toLowerCase(),t])))}function Yr(e,t,n){var r=Ir.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Xr(e,t,n){var r=Ir.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Zr(e,t,n){var r=Ir.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Jr(e,t,n){var r=Ir.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Kr(e,t,n){var r=Ir.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Qr(e,t,n){var r=Ir.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function ei(e,t,n){var r=Ir.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ti(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function ni(e,t,n){var r=Ir.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function ri(e,t,n){var r=Ir.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function ii(e,t,n){var r=Ir.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function oi(e,t,n){var r=Ir.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ai(e,t,n){var r=Ir.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function si(e,t,n){var r=Ir.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function ui(e,t,n){var r=Ir.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function li(e,t,n){var r=Ir.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function ci(e,t,n){var r=Ir.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function fi(e,t,n){var r=Ur.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function di(e,t,n){var r=Ir.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function hi(e,t,n){var r=Ir.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function pi(e,t){return Wr(e.getDate(),t,2)}function gi(e,t){return Wr(e.getHours(),t,2)}function mi(e,t){return Wr(e.getHours()%12||12,t,2)}function yi(e,t){return Wr(1+Vt.count(hn(e),e),t,3)}function vi(e,t){return Wr(e.getMilliseconds(),t,3)}function bi(e,t){return vi(e,t)+"000"}function xi(e,t){return Wr(e.getMonth()+1,t,2)}function _i(e,t){return Wr(e.getMinutes(),t,2)}function wi(e,t){return Wr(e.getSeconds(),t,2)}function ki(e){var t=e.getDay();return 0===t?7:t}function Ai(e,t){return Wr(Jt.count(hn(e)-1,e),t,2)}function Ei(e){var t=e.getDay();return t>=4||0===t?tn(e):tn.ceil(e)}function Oi(e,t){return e=Ei(e),Wr(tn.count(hn(e),e)+(4===hn(e).getDay()),t,2)}function Di(e){return e.getDay()}function Ci(e,t){return Wr(Kt.count(hn(e)-1,e),t,2)}function Si(e,t){return Wr(e.getFullYear()%100,t,2)}function Fi(e,t){return Wr((e=Ei(e)).getFullYear()%100,t,2)}function Mi(e,t){return Wr(e.getFullYear()%1e4,t,4)}function ji(e,t){var n=e.getDay();return Wr((e=n>=4||0===n?tn(e):tn.ceil(e)).getFullYear()%1e4,t,4)}function $i(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Wr(t/60|0,"0",2)+Wr(t%60,"0",2)}function Ni(e,t){return Wr(e.getUTCDate(),t,2)}function Bi(e,t){return Wr(e.getUTCHours(),t,2)}function Ti(e,t){return Wr(e.getUTCHours()%12||12,t,2)}function zi(e,t){return Wr(1+Yt.count(pn(e),e),t,3)}function Ri(e,t){return Wr(e.getUTCMilliseconds(),t,3)}function Pi(e,t){return Ri(e,t)+"000"}function Li(e,t){return Wr(e.getUTCMonth()+1,t,2)}function Ii(e,t){return Wr(e.getUTCMinutes(),t,2)}function Ui(e,t){return Wr(e.getUTCSeconds(),t,2)}function qi(e){var t=e.getUTCDay();return 0===t?7:t}function Wi(e,t){return Wr(an.count(pn(e)-1,e),t,2)}function Hi(e){var t=e.getUTCDay();return t>=4||0===t?cn(e):cn.ceil(e)}function Gi(e,t){return e=Hi(e),Wr(cn.count(pn(e),e)+(4===pn(e).getUTCDay()),t,2)}function Vi(e){return e.getUTCDay()}function Yi(e,t){return Wr(sn.count(pn(e)-1,e),t,2)}function Xi(e,t){return Wr(e.getUTCFullYear()%100,t,2)}function Zi(e,t){return Wr((e=Hi(e)).getUTCFullYear()%100,t,2)}function Ji(e,t){return Wr(e.getUTCFullYear()%1e4,t,4)}function Ki(e,t){var n=e.getUTCDay();return Wr((e=n>=4||0===n?cn(e):cn.ceil(e)).getUTCFullYear()%1e4,t,4)}function Qi(){return"+0000"}function eo(){return"%"}function to(e){return+e}function no(e){return Math.floor(+e/1e3)}function ro(e){const t={};return n=>t[n]||(t[n]=e(n))}function io(e){const t=ro(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(e){const n=wt(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return r=t(n),i=t(".1f")(1)[1],e=>{const t=r(e),n=t.indexOf(i);if(n<0)return t;let o=function(e,t){let n,r=e.lastIndexOf("e");if(r>0)return r;for(r=e.length;--r>t;)if(n=e.charCodeAt(r),n>=48&&n<=57)return r+1}(t,n);const a=on;)if("0"!==t[o]){++o;break}return t.slice(0,o)+a}}return t(n);var r,i},formatSpan(e,r,i,o){o=wt(null==o?",f":o);const a=bt(e,r,i),s=Math.max(Math.abs(e),Math.abs(r));let u;if(null==o.precision)switch(o.type){case"s":return isNaN(u=Ot(a,s))||(o.precision=u),n(o,s);case"":case"e":case"g":case"p":case"r":isNaN(u=Dt(a,s))||(o.precision=u-("e"===o.type));break;case"f":case"%":isNaN(u=Ct(a))||(o.precision=u-2*("%"===o.type))}return t(o)}}}let oo,ao;function so(){return oo=io({format:$t,formatPrefix:Nt})}function uo(e){return io(zt(e))}function lo(e){return arguments.length?oo=uo(e):oo}function co(e,t,n){R(n=n||{})||_(`Invalid time multi-format specifier: ${n}`);const r=t(Tn),i=t(Bn),o=t(Nn),a=t(Mn),s=t(Fn),u=t(Sn),l=t(Cn),c=t(Dn),f=e(n[zn]||".%L"),d=e(n[Tn]||":%S"),h=e(n[Bn]||"%I:%M"),p=e(n[Nn]||"%I %p"),g=e(n[Mn]||n[jn]||"%a %d"),m=e(n[Fn]||"%b %d"),y=e(n[Sn]||"%B"),v=e(n[Cn]||"%B"),b=e(n[Dn]||"%Y");return e=>(r(e)Ne(e)?t(e):co(t,hr,e),utcFormat:e=>Ne(e)?n(e):co(n,pr,e),timeParse:ro(e.parse),utcParse:ro(e.utcParse)}}function ho(){return ao=fo({format:Tr,parse:zr,utcFormat:Rr,utcParse:Pr})}function po(e){return fo(Nr(e))}function go(e){return arguments.length?ao=po(e):ao}Br=Nr({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"]}),Tr=Br.format,zr=Br.parse,Rr=Br.utcFormat,Pr=Br.utcParse,so(),ho();const mo=(e,t)=>be({},e,t);function yo(e,t){const n=e?uo(e):lo(),r=t?po(t):go();return mo(n,r)}function vo(e,t){const n=arguments.length;return n&&2!==n&&_("defaultLocale expects either zero or two arguments."),n?mo(lo(e),go(t)):mo(lo(),go())}function bo(){return so(),ho(),vo()}const xo=/^(data:|([A-Za-z]+:)?\/\/)/,_o=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,wo=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,ko="file://";async function Ao(e,t){const n=await this.sanitize(e,t),r=n.href;return n.localFile?this.file(r):this.http(r,t)}async function Eo(e,t){t=be({},this.options,t);const n=this.fileAccess,r={href:null};let i,o,a;const s=_o.test(e.replace(wo,""));null!=e&&"string"==typeof e&&s||_("Sanitize failure, invalid URI: "+qe(e));const u=xo.test(e);return(a=t.baseURL)&&!u&&(e.startsWith("/")||a.endsWith("/")||(e="/"+e),e=a+e),o=(i=e.startsWith(ko))||"file"===t.mode||"http"!==t.mode&&!u&&n,i?e=e.slice(7):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(r,"localFile",{value:!!o}),r.href=e,t.target&&(r.target=t.target+""),t.rel&&(r.rel=t.rel+""),"image"===t.context&&t.crossOrigin&&(r.crossOrigin=t.crossOrigin+""),r}function Oo(e){return e?t=>new Promise(((n,r)=>{e.readFile(t,((e,t)=>{e?r(e):n(t)}))})):Do}async function Do(){_("No file system access.")}function Co(e){return e?async function(t,n){const r=be({},this.options.http,n),i=n&&n.response,o=await e(t,r);return o.ok?ce(o[i])?o[i]():o.text():_(o.status+""+o.statusText)}:So}async function So(){_("No HTTP fetch method available.")}const Fo=e=>null!=e&&e==e,Mo=e=>!(Number.isNaN(+e)||e instanceof Date),jo={boolean:We,integer:W,number:W,date:Ge,string:Ve,unknown:E},$o=[e=>"true"===e||"false"===e||!0===e||!1===e,e=>Mo(e)&&Number.isInteger(+e),Mo,e=>!Number.isNaN(Date.parse(e))],No=["boolean","integer","number","date"];function Bo(e,t){if(!e||!e.length)return"unknown";const n=e.length,r=$o.length,i=$o.map(((e,t)=>t+1));for(let o,a,s=0,u=0;s0===e?t:e),0)-1]}function To(e,t){return t.reduce(((t,n)=>(t[n]=Bo(e,n),t)),{})}function zo(e){const t=function(t,n){const r={delimiter:e};return Ro(t,n?be(n,r):r)};return t.responseType="text",t}function Ro(e,t){return t.header&&(e=t.header.map(qe).join(t.delimiter)+"\n"+e),ot(t.delimiter).parse(e+"")}function Po(e,t){const n=t&&t.property?k(t.property):E;return!R(e)||(r=e,"function"==typeof Buffer&&ce(Buffer.isBuffer)&&Buffer.isBuffer(r))?n(JSON.parse(e)):function(e,t){return!z(e)&&Me(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}(n(e),t);var r}Ro.responseType="text",Po.responseType="json";const Lo={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function Io(e,t){let n,r,i,o;return e=Po(e,t),t&&t.feature?(n=st,i=t.feature):t&&t.mesh?(n=ft,i=t.mesh,o=Lo[t.filter]):_("Missing TopoJSON feature or mesh parameter."),r=(r=e.objects[i])?n(e,r,o):_("Invalid TopoJSON object: "+i),r&&r.features||[r]}Io.responseType="json";const Uo={dsv:Ro,csv:zo(","),tsv:zo("\t"),json:Po,topojson:Io};function qo(e,t){return arguments.length>1?(Uo[e]=t,this):ke(Uo,e)?Uo[e]:null}function Wo(e){const t=qo(e);return t&&t.responseType||"text"}function Ho(e,t,n,r){const i=qo((t=t||{}).type||"json");return i||_("Unknown data format type: "+t.type),e=i(e,t),t.parse&&function(e,t,n,r){if(!e.length)return;const i=go();n=n||i.timeParse,r=r||i.utcParse;let o,a,s,u,l,c,f=e.columns||Object.keys(e[0]);"auto"===t&&(t=To(e,f)),f=Object.keys(t);const d=f.map((e=>{const i=t[e];let o,a;if(i&&(i.startsWith("date:")||i.startsWith("utc:")))return o=i.split(/:(.+)?/,2),a=o[1],("'"===a[0]&&"'"===a[a.length-1]||'"'===a[0]&&'"'===a[a.length-1])&&(a=a.slice(1,-1)),("utc"===o[0]?r:n)(a);if(!jo[i])throw Error("Illegal format pattern: "+e+":"+i);return jo[i]}));for(s=0,l=e.length,c=f.length;s({options:t||{},sanitize:Eo,load:Ao,fileAccess:!1,file:Oo(null),http:Co(e)})}("undefined"!=typeof fetch&&fetch);function Vo(e){const t=e||E,n=[],r={};return n.add=e=>{const i=t(e);return r[i]||(r[i]=1,n.push(e)),n},n.remove=e=>{const i=t(e);if(r[i]){r[i]=0;const t=n.indexOf(e);t>=0&&n.splice(t,1)}return n},n}async function Yo(e,t){try{await t(e)}catch(t){e.error(t)}}const Xo=Symbol("vega_id");let Zo=1;function Jo(e){return!(!e||!Ko(e))}function Ko(e){return e[Xo]}function Qo(e,t){return e[Xo]=t,e}function ea(e){const t=e===Object(e)?e:{data:e};return Ko(t)?t:Qo(t,Zo++)}function ta(e){return na(e,ea({}))}function na(e,t){for(const n in e)t[n]=e[n];return t}function ra(e,t){return Qo(t,Ko(e))}function ia(e,t){return e?t?(n,r)=>e(n,r)||Ko(t(n))-Ko(t(r)):(t,n)=>e(t,n)||Ko(t)-Ko(n):null}function oa(e){return e&&e.constructor===aa}function aa(){const e=[],t=[],n=[],r=[],i=[];let o=null,a=!1;return{constructor:aa,insert(t){const n=ue(t),r=n.length;for(let t=0;t{p(e)&&(l[Ko(e)]=-1)}));for(f=0,d=e.length;f0&&(y(g,p,h.value),s.modifies(p));for(f=0,d=i.length;f{p(e)&&l[Ko(e)]>0&&y(e,h.field,h.value)})),s.modifies(h.field);if(a)s.mod=t.length||r.length?u.filter((e=>l[Ko(e)]>0)):u.slice();else for(m in c)s.mod.push(c[m]);return(o||null==o&&(t.length||r.length))&&s.clean(!0),s}}}const sa="_:mod:_";function ua(){Object.defineProperty(this,sa,{writable:!0,value:{}})}ua.prototype={set(e,t,n,r){const i=this,o=i[e],a=i[sa];return null!=t&&t>=0?(o[t]!==n||r)&&(o[t]=n,a[t+":"+e]=-1,a[e]=-1):(o!==n||r)&&(i[e]=n,a[e]=z(n)?1+n.length:-1),i},modified(e,t){const n=this[sa];if(!arguments.length){for(const e in n)if(n[e])return!0;return!1}if(z(e)){for(let t=0;t=0?t+1{a instanceof fa?(a!==this&&(t&&a.targets().add(this),o.push(a)),i.push({op:a,name:e,index:n})):r.set(e,n,a)};for(a in e)if(s=e[a],"pulse"===a)ue(s).forEach((e=>{e instanceof fa?e!==this&&(e.targets().add(this),o.push(e)):_("Pulse parameters must be operator instances.")})),this.source=s;else if(z(s))for(r.set(a,-1,Array(u=s.length)),l=0;l{const n=Date.now();return n-t>e?(t=n,1):0}))},debounce(e){const t=ga();return this.targets().add(ga(null,null,ve(e,(e=>{const n=e.dataflow;t.receive(e),n&&n.run&&n.run()})))),t},between(e,t){let n=!1;return e.targets().add(ga(null,null,(()=>n=!0))),t.targets().add(ga(null,null,(()=>n=!1))),this.filter((()=>n))},detach(){this._filter=C,this._targets=null}};const ma={skip:!0};function ya(e,t,n,r,i,o){const a=be({},o,ma);let s,u;ce(n)||(n=ye(n)),void 0===r?s=t=>e.touch(n(t)):ce(r)?(u=new fa(null,r,i,!1),s=t=>{u.evaluate(t);const r=n(t),i=u.value;oa(i)?e.pulse(r,i,o):e.update(r,i,a)}):s=t=>e.update(n(t),r,a),t.apply(s)}function va(e,t,n,r,i,o){if(void 0===r)t.targets().add(n);else{const a=o||{},s=new fa(null,function(e,t){return t=ce(t)?t:ye(t),e?function(n,r){const i=t(n,r);return e.skip()||(e.skip(i!==this.value).value=i),i}:t}(n,r),i,!1);s.modified(a.force),s.rank=t.rank,t.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),e.connect(n,[s]))}}const ba={};function xa(e,t,n){this.dataflow=e,this.stamp=null==t?-1:t,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function _a(e,t){const n=[];return Ze(e,t,(e=>n.push(e))),n}function wa(e,t){const n={};return e.visit(t,(e=>{n[Ko(e)]=1})),e=>n[Ko(e)]?null:e}function ka(e,t){return e?(n,r)=>e(n,r)&&t(n,r):t}function Aa(e,t,n,r){const i=this;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=r||null,this.pulses=n;for(const e of n)if(e.stamp===t){if(e.fields){const t=i.fields||(i.fields={});for(const n in e.fields)t[n]=1}e.changed(i.ADD)&&(o|=i.ADD),e.changed(i.REM)&&(o|=i.REM),e.changed(i.MOD)&&(o|=i.MOD)}this.changes=o}function Ea(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}xa.prototype={StopPropagation:ba,ADD:1,REM:2,MOD:4,ADD_REM:3,ADD_MOD:5,ALL:7,REFLOW:8,SOURCE:16,NO_SOURCE:32,NO_FIELDS:64,fork(e){return new xa(this.dataflow).init(this,e)},clone(){const e=this.fork(7);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(23)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new xa(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,!e.fields||64&t||(n.fields=e.fields),1&t?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),2&t?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),4&t?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),32&t?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||7;return 1&t&&this.add.length||2&t&&this.rem.length||4&t&&this.mod.length},reflow(e){if(e)return this.fork(7).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(4,wa(this,1))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return z(e)?e.forEach((e=>t[e]=!0)):t[e]=!0,this},modified(e,t){const n=this.fields;return!(!t&&!this.mod.length||!n)&&(arguments.length?z(e)?e.some((e=>n[e])):n[e]:!!n)},filter(e,t){const n=this;return 1&e&&(n.addF=ka(n.addF,t)),2&e&&(n.remF=ka(n.remF,t)),4&e&&(n.modF=ka(n.modF,t)),16&e&&(n.srcF=ka(n.srcF,t)),n},materialize(e){const t=this;return 1&(e=e||7)&&t.addF&&(t.add=_a(t.add,t.addF),t.addF=null),2&e&&t.remF&&(t.rem=_a(t.rem,t.remF),t.remF=null),4&e&&t.modF&&(t.mod=_a(t.mod,t.modF),t.modF=null),16&e&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,r=t;if(16&e)return Ze(n.source,n.srcF,r),n;1&e&&Ze(n.add,n.addF,r),2&e&&Ze(n.rem,n.remF,r),4&e&&Ze(n.mod,n.modF,r);const i=n.source;if(8&e&&i){const e=n.add.length+n.mod.length;e===i.length||Ze(i,e?wa(n,5):n.srcF,r)}return n}},De(Aa,xa,{fork(e){const t=new xa(this.dataflow).init(this,e&this.NO_FIELDS);return void 0!==e&&(e&t.ADD&&this.visit(t.ADD,(e=>t.add.push(e))),e&t.REM&&this.visit(t.REM,(e=>t.rem.push(e))),e&t.MOD&&this.visit(t.MOD,(e=>t.mod.push(e)))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?z(e)?e.some((e=>n[e])):n[e]:0},filter(){_("MultiPulse does not support filtering.")},materialize(){_("MultiPulse does not support materialization.")},visit(e,t){const n=this,r=n.pulses,i=r.length;let o=0;if(e&n.SOURCE)for(;ot&&(o=n-1>>1,i=e[o],r(a,i)<0);)e[n]=i,n=o;return e[n]=a}function Ca(){this.logger(T()),this.logLevel(j),this._clock=0,this._rank=0,this._locale=vo();try{this._loader=Go()}catch(e){}this._touched=Vo(A),this._input={},this._pulse=null,this._heap=function(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),Da(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let r;return t.length?(r=t[0],t[0]=n,function(e,t,n){const r=t,i=e.length,o=e[t];let a,s=1+(t<<1);for(;s=0&&(s=a),e[t]=e[s],s=1+((t=s)<<1);e[t]=o,Da(e,r,t,n)}(t,0,e)):r=n,r}}}(((e,t)=>e.qrank-t.qrank)),this._postrun=[]}function Sa(e){return function(){return this._log[e].apply(this,arguments)}}function Fa(e,t){fa.call(this,e,null,t)}Ca.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:Sa("error"),warn:Sa("warn"),info:Sa("info"),debug:Sa("debug"),logLevel:Sa("level"),cleanThreshold:1e4,add:function(e,t,n,r){let i,o=1;return e instanceof fa?i=e:e&&e.prototype instanceof fa?i=new e:ce(e)?i=new fa(null,e):(o=0,i=new fa(e,t)),this.rank(i),o&&(r=n,n=t),n&&this.connect(i,i.parameters(n,r)),this.touch(i),i},connect:function(e,t){const n=e.rank,r=t.length;for(let i=0;i=0;)t.push(n=r[i]),n===e&&_("Cycle detected in dataflow graph.")},pulse:function(e,t,n){this.touch(e,n||Oa);const r=new xa(this,this._clock+(this._pulse?0:1)),i=e.pulse&&e.pulse.source||[];return r.target=e,this._input[e.id]=t.pulse(r,i),this},touch:function(e,t){const n=t||Oa;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this},update:function(e,t,n){const r=n||Oa;return(e.set(t)||r.force)&&this.touch(e,r),this},changeset:aa,ingest:function(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))},parse:function(e,t){const n=this.locale();return Ho(e,t,n.timeParse,n.utcParse)},preload:async function(e,t,n){const r=this,i=r._pending||function(e){let t;const n=new Promise((e=>t=e));return n.requests=0,n.done=()=>{0==--n.requests&&(e._pending=null,t(e))},e._pending=n}(r);i.requests+=1;const o=await r.request(t,n);return r.pulse(e,r.changeset().remove(C).insert(o.data||[])),i.done(),o},request:async function(e,t){const n=this;let r,i=0;try{r=await n.loader().load(e,{context:"dataflow",response:Wo(t&&t.type)});try{r=n.parse(r,t)}catch(t){i=-2,n.warn("Data ingestion failed",e,t)}}catch(t){i=-1,n.warn("Loading failed",e,t)}return{data:r,status:i}},events:function(e,t,n,r){const i=this,o=ga(n,r),a=function(e){e.dataflow=i;try{o.receive(e)}catch(e){i.error(e)}finally{i.run()}};let s;s="string"==typeof e&&"undefined"!=typeof document?document.querySelectorAll(e):ue(e);const u=s.length;for(let e=0;er._enqueue(e,!0))),r._touched=Vo(A);let a,s,u,l=0;try{for(;r._heap.size()>0;)a=r._heap.pop(),a.rank===a.qrank?(s=a.run(r._getPulse(a,e)),s.then?s=await s:s.async&&(i.push(s.async),s=ba),s!==ba&&a._targets&&a._targets.forEach((e=>r._enqueue(e))),++l):r._enqueue(a,!0)}catch(e){r._heap.clear(),u=e}if(r._input={},r._pulse=null,r.debug(`Pulse ${o}: ${l} operators`),u&&(r._postrun=[],r.error(u)),r._postrun.length){const e=r._postrun.sort(((e,t)=>t.priority-e.priority));r._postrun=[];for(let t=0;tr.runAsync(null,(()=>{e.forEach((e=>{try{e(r)}catch(e){r.error(e)}}))})))),r},run:function(e,t,n){return this._pulse?Ea(this):(this.evaluate(e,t,n),this)},runAsync:async function(e,t,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(r,r),this._running},runAfter:function(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(e){this.error(e)}},_enqueue:function(e,t){const n=e.stampe.pulse)),t):this._input[e.id]||function(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==ba&&(e.source=t.source),e)}(this._pulse,n&&n.pulse)}},De(Fa,fa,{run(e){if(e.stampthis.pulse=e)):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const Ma={};function ja(e){const t=$a(e);return t&&t.Definition||null}function $a(e){return e=e&&e.toLowerCase(),ke(Ma,e)?Ma[e]:null}function Na(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n=i)&&(n=i)}return n}function Ba(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function Ta(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(et?1:0)}function za(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=void 0===i?Ta:function(e=kn){if(e===kn)return Ta;if("function"!=typeof e)throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||0===r?r:(0===e(n,n))-(0===e(t,t))}}(i);r>n;){if(r-n>600){const o=r-n+1,a=t-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*u*(o-u)/o)*(a-o/2<0?-1:1);za(e,t,Math.max(n,Math.floor(t-a*u/o+l)),Math.min(r,Math.floor(t+(o-a)*u/o+l)),i)}const o=e[t];let a=n,s=r;for(Ra(e,n,t),i(e[r],o)>0&&Ra(e,n,r);a0;)--s}0===i(e[n],o)?Ra(e,n,s):(++s,Ra(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function Ra(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Pa(e){return null===e?NaN:+e}function La(e,t,n){if(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r=+r)>=r&&(yield r)}}(e,n)),(r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return Ba(e);if(t>=1)return Na(e);var r,i=(r-1)*t,o=Math.floor(i),a=Na(za(e,o).subarray(0,o+1));return a+(Ba(e.subarray(o+1))-a)*(i-o)}}function Ia(e,t,n=Pa){if((r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),a=+n(e[o],o,e);return a+(+n(e[o+1],o+1,e)-a)*(i-o)}}function Ua(e,t){return La(e,.5,t)}function*qa(e,t){if(null==t)for(let t of e)null!=t&&""!==t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)r=t(r,++n,e),null!=r&&""!==r&&(r=+r)>=r&&(yield r)}}function Wa(e,t,n){const r=Float64Array.from(qa(e,n));return r.sort(kn),t.map((e=>Ia(r,e)))}function Ha(e,t){return Wa(e,[.25,.5,.75],t)}function Ga(e,t){const n=e.length,r=function(e,t){const n=function(e,t){let n,r=0,i=0,o=0;if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(n=t-i,i+=n/++r,o+=n*(t-i));else{let a=-1;for(let s of e)null!=(s=t(s,++a,e))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(e,t);return n?Math.sqrt(n):n}(e,t),i=Ha(e,t),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function Va(e){const t=e.maxbins||20,n=e.base||10,r=Math.log(n),i=e.divide||[5,2];let o,a,s,u,l,c,f=e.extent[0],d=e.extent[1];const h=e.span||d-f||Math.abs(f)||1;if(e.step)o=e.step;else if(e.steps){for(u=h/t,l=0,c=e.steps.length;lt;)o*=n;for(l=0,c=i.length;l=s&&h/u<=t&&(o=u)}u=Math.log(o);const p=u>=0?0:1+~~(-u/r),g=Math.pow(n,-p-1);return(e.nice||void 0===e.nice)&&(u=Math.floor(f/o+g)*o,f=fe);const i=e.length,o=new Float64Array(i);let a,s=0,u=1,l=r(e[0]),c=l,f=l+t;for(;u=f){for(c=(l+c)/2;s>1);ia;)e[i--]=e[o]}o=a,a=r}return e}(o,t+t/4):o}function Ka(e){return function(){return(e=(1103515245*e+12345)%2147483647)/2147483647}}function Qa(e,t){let n,r,i;null==t&&(t=e,e=0);const o={min(e){return arguments.length?(n=e||0,i=r-n,o):n},max(e){return arguments.length?(r=e||0,i=r-n,o):r},sample:()=>n+Math.floor(i*Ya()),pdf:e=>e===Math.floor(e)&&e>=n&&e=r?1:(t-n+1)/i},icdf:e=>e>=0&&e<=1?n-1+Math.floor(e*i):NaN};return o.min(e).max(t)}const es=Math.sqrt(2*Math.PI),ts=Math.SQRT2;let ns=NaN;function rs(e,t){e=e||0,t=null==t?1:t;let n,r,i=0,o=0;if(ns==ns)i=ns,ns=NaN;else{do{i=2*Ya()-1,o=2*Ya()-1,n=i*i+o*o}while(0===n||n>1);r=Math.sqrt(-2*Math.log(n)/n),i*=r,ns=o*r}return e+i*t}function is(e,t,n){const r=(e-(t||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*es)}function os(e,t,n){const r=(e-(t=t||0))/(n=null==n?1:n),i=Math.abs(r);let o;if(i>37)o=0;else{const e=Math.exp(-i*i/2);let t;i<7.07106781186547?(t=.0352624965998911*i+.700383064443688,t=t*i+6.37396220353165,t=t*i+33.912866078383,t=t*i+112.079291497871,t=t*i+221.213596169931,t=t*i+220.206867912376,o=e*t,t=.0883883476483184*i+1.75566716318264,t=t*i+16.064177579207,t=t*i+86.7807322029461,t=t*i+296.564248779674,t=t*i+637.333633378831,t=t*i+793.826512519948,t=t*i+440.413735824752,o/=t):(t=i+.65,t=i+4/t,t=i+3/t,t=i+2/t,t=i+1/t,o=e/t/2.506628274631)}return r>0?1-o:o}function as(e,t,n){return e<0||e>1?NaN:(t||0)+(null==n?1:n)*ts*function(e){let t,n=-Math.log((1-e)*(1+e));return n<6.25?(n-=3.125,t=-364441206401782e-35,t=t*n-16850591381820166e-35,t=128584807152564e-32+t*n,t=11157877678025181e-33+t*n,t=t*n-1333171662854621e-31,t=20972767875968562e-33+t*n,t=6637638134358324e-30+t*n,t=t*n-4054566272975207e-29,t=t*n-8151934197605472e-29,t=26335093153082323e-28+t*n,t=t*n-12975133253453532e-27,t=t*n-5415412054294628e-26,t=1.0512122733215323e-9+t*n,t=t*n-4.112633980346984e-9,t=t*n-2.9070369957882005e-8,t=4.2347877827932404e-7+t*n,t=t*n-13654692000834679e-22,t=t*n-13882523362786469e-21,t=.00018673420803405714+t*n,t=t*n-.000740702534166267,t=t*n-.006033670871430149,t=.24015818242558962+t*n,t=1.6536545626831027+t*n):n<16?(n=Math.sqrt(n)-3.25,t=2.2137376921775787e-9,t=9.075656193888539e-8+t*n,t=t*n-2.7517406297064545e-7,t=1.8239629214389228e-8+t*n,t=15027403968909828e-22+t*n,t=t*n-4013867526981546e-21,t=29234449089955446e-22+t*n,t=12475304481671779e-21+t*n,t=t*n-47318229009055734e-21,t=6828485145957318e-20+t*n,t=24031110387097894e-21+t*n,t=t*n-.0003550375203628475,t=.0009532893797373805+t*n,t=t*n-.0016882755560235047,t=.002491442096107851+t*n,t=t*n-.003751208507569241,t=.005370914553590064+t*n,t=1.0052589676941592+t*n,t=3.0838856104922208+t*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,t=-27109920616438573e-27,t=t*n-2.555641816996525e-10,t=1.5076572693500548e-9+t*n,t=t*n-3.789465440126737e-9,t=7.61570120807834e-9+t*n,t=t*n-1.496002662714924e-8,t=2.914795345090108e-8+t*n,t=t*n-6.771199775845234e-8,t=2.2900482228026655e-7+t*n,t=t*n-9.9298272942317e-7,t=4526062597223154e-21+t*n,t=t*n-1968177810553167e-20,t=7599527703001776e-20+t*n,t=t*n-.00021503011930044477,t=t*n-.00013871931833623122,t=1.0103004648645344+t*n,t=4.849906401408584+t*n):t=1/0,t*e}(2*e-1)}function ss(e,t){let n,r;const i={mean(e){return arguments.length?(n=e||0,i):n},stdev(e){return arguments.length?(r=null==e?1:e,i):r},sample:()=>rs(n,r),pdf:e=>is(e,n,r),cdf:e=>os(e,n,r),icdf:e=>as(e,n,r)};return i.mean(e).stdev(t)}function us(e,t){const n=ss();let r=0;const i={data(n){return arguments.length?(e=n,r=n?n.length:0,i.bandwidth(t)):e},bandwidth(n){return arguments.length?(!(t=n)&&e&&(t=Ga(e)),i):t},sample:()=>e[~~(Ya()*r)]+t*n.sample(),pdf(i){let o=0,a=0;for(;als(n,r),pdf:e=>cs(e,n,r),cdf:e=>fs(e,n,r),icdf:e=>ds(e,n,r)};return i.mean(e).stdev(t)}function ps(e,t){let n,r=0;const i={weights(e){return arguments.length?(n=function(e){const t=[];let n,i=0;for(n=0;n=t&&e<=n?1/(n-t):0}function ys(e,t,n){return null==n&&(n=null==t?1:t,t=0),en?1:(e-t)/(n-t)}function vs(e,t,n){return null==n&&(n=null==t?1:t,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function bs(e,t){let n,r;const i={min(e){return arguments.length?(n=e||0,i):n},max(e){return arguments.length?(r=null==e?1:e,i):r},sample:()=>gs(n,r),pdf:e=>ms(e,n,r),cdf:e=>ys(e,n,r),icdf:e=>vs(e,n,r)};return null==t&&(t=null==e?1:e,e=0),i.min(e).max(t)}function xs(e,t,n){let r=0,i=0;for(const o of e){const e=n(o);null==t(o)||null==e||isNaN(e)||(r+=(e-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function _s(e,t,n,r){const i=r-e*e,o=Math.abs(i)<1e-24?0:(n-e*t)/i;return[t-o*e,o]}function ws(e,t,n,r){e=e.filter((e=>{let r=t(e),i=n(e);return null!=r&&(r=+r)>=r&&null!=i&&(i=+i)>=i})),r&&e.sort(((e,n)=>t(e)-t(n)));const i=e.length,o=new Float64Array(i),a=new Float64Array(i);let s,u,l,c=0,f=0,d=0;for(l of e)o[c]=s=+t(l),a[c]=u=+n(l),++c,f+=(s-f)/c,d+=(u-d)/c;for(c=0;c=i&&null!=o&&(o=+o)>=o&&r(i,o,++a)}function As(e,t,n,r,i){let o=0,a=0;return ks(e,t,n,((e,t)=>{const n=t-i(e),s=t-r;o+=n*n,a+=s*s})),1-o/a}function Es(e,t,n){let r=0,i=0,o=0,a=0,s=0;ks(e,t,n,((e,t)=>{++s,r+=(e-r)/s,i+=(t-i)/s,o+=(e*t-o)/s,a+=(e*e-a)/s}));const u=_s(r,i,o,a),l=e=>u[0]+u[1]*e;return{coef:u,predict:l,rSquared:As(e,t,n,i,l)}}function Os(e,t,n){let r=0,i=0,o=0,a=0,s=0;ks(e,t,n,((e,t)=>{++s,e=Math.log(e),r+=(e-r)/s,i+=(t-i)/s,o+=(e*t-o)/s,a+=(e*e-a)/s}));const u=_s(r,i,o,a),l=e=>u[0]+u[1]*Math.log(e);return{coef:u,predict:l,rSquared:As(e,t,n,i,l)}}function Ds(e,t,n){const[r,i,o,a]=ws(e,t,n);let s,u,l,c=0,f=0,d=0,h=0,p=0;ks(e,t,n,((e,t)=>{s=r[p++],u=Math.log(t),l=s*t,c+=(t*u-c)/p,f+=(l-f)/p,d+=(l*u-d)/p,h+=(s*l-h)/p}));const[g,m]=_s(f/a,c/a,d/a,h/a),y=e=>Math.exp(g+m*(e-o));return{coef:[Math.exp(g-m*o),m],predict:y,rSquared:As(e,t,n,a,y)}}function Cs(e,t,n){let r=0,i=0,o=0,a=0,s=0,u=0;ks(e,t,n,((e,t)=>{const n=Math.log(e),l=Math.log(t);++u,r+=(n-r)/u,i+=(l-i)/u,o+=(n*l-o)/u,a+=(n*n-a)/u,s+=(t-s)/u}));const l=_s(r,i,o,a),c=e=>l[0]*Math.pow(e,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:As(e,t,n,s,c)}}function Ss(e,t,n){const[r,i,o,a]=ws(e,t,n),s=r.length;let u,l,c,f,d=0,h=0,p=0,g=0,m=0;for(u=0;ub*(e-=o)*e+x*e+_+a;return{coef:[_-x*o+b*o*o+a,x-2*b*o,b],predict:w,rSquared:As(e,t,n,a,w)}}function Fs(e,t,n,r){if(0===r)return xs(e,t,n);if(1===r)return Es(e,t,n);if(2===r)return Ss(e,t,n);const[i,o,a,s]=ws(e,t,n),u=i.length,l=[],c=[],f=r+1;let d,h,p,g,m;for(d=0;dMath.abs(e[r][a])&&(a=i);for(o=r;o=r;o--)e[o][i]-=e[o][r]*e[r][i]/e[r][r]}for(i=t-1;i>=0;--i){for(s=0,o=i+1;o{e-=a;let t=s+y[0]+y[1]*e+y[2]*e*e;for(d=3;d=0;--o)for(s=t[o],u=1,i[o]+=s,a=1;a<=o;++a)u*=(o+1-a)/a,i[o-a]+=s*Math.pow(n,a)*u;return i[0]+=r,i}const js=2,$s=1e-12;function Ns(e,t,n,r){const[i,o,a,s]=ws(e,t,n,!0),u=i.length,l=Math.max(2,~~(r*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let e=-1;++e<=js;){const t=[0,l-1];for(let e=0;ei[a]-n?r:a;let u=0,l=0,h=0,p=0,g=0;const m=1/Math.abs(i[s]-n||1);for(let e=r;e<=a;++e){const t=i[e],r=o[e],a=Bs(Math.abs(n-t)*m)*d[e],s=t*a;u+=a,l+=s,h+=r*a,p+=r*s,g+=t*s}const[y,v]=_s(l/u,h/u,p/u,g/u);c[e]=y+v*n,f[e]=Math.abs(o[e]-c[e]),Ts(i,e+1,t)}if(e===js)break;const n=Ua(f);if(Math.abs(n)<$s)break;for(let e,t,r=0;r=1?$s:(t=1-e*e)*t}return function(e,t,n,r){const i=e.length,o=[];let a,s=0,u=0,l=[];for(;s=e.length))for(;t>i&&e[o]-r<=r-e[i];)n[0]=++i,n[1]=o,++o}const zs=.5*Math.PI/180;function Rs(e,t,n,r){n=n||25,r=Math.max(n,r||200);const i=t=>[t,e(t)],o=t[0],a=t[1],s=a-o,u=s/r,l=[i(o)],c=[];if(n===r){for(let e=1;e0;)c.push(i(o+e/n*s));let f=l[0],d=c[c.length-1];const h=1/s,p=function(e,t){let n=e,r=e;const i=t.length;for(let e=0;er&&(r=i)}return 1/(r-n)}(f[1],c);for(;d;){const e=i((f[0]+d[0])/2);e[0]-f[0]>=u&&Ps(f,e,d,h,p)>zs?c.push(e):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function Ps(e,t,n,r,i){const o=Math.atan2(i*(n[1]-e[1]),r*(n[0]-e[0])),a=Math.atan2(i*(t[1]-e[1]),r*(t[0]-e[0]));return Math.abs(o-a)}function Ls(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r{const n=t.length;let r=1,i=String(t[0](e));for(;r{},Ws={init:qs,add:qs,rem:qs,idx:0},Hs={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||void 0===e.max)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},Gs=Object.keys(Hs).filter((e=>"__count__"!==e));function Vs(e,t,n){return Hs[e](n,t)}function Ys(e,t){return e.idx-t.idx}function Xs(){this.valid=0,this.missing=0,this._ops.forEach((e=>null==e.aggregate_param?e.init(this):e.init(this,e.aggregate_param)))}function Zs(e,t){null!=e&&""!==e?e==e&&(++this.valid,this._ops.forEach((n=>n.add(this,e,t)))):++this.missing}function Js(e,t){null!=e&&""!==e?e==e&&(--this.valid,this._ops.forEach((n=>n.rem(this,e,t)))):--this.missing}function Ks(e){return this._out.forEach((t=>e[t.out]=t.value(this))),e}function Qs(e,t){const n=t||E,r=function(e){const t={};e.forEach((e=>t[e.name]=e));const n=e=>{e.req&&e.req.forEach((e=>{t[e]||n(t[e]=Hs[e]())}))};return e.forEach(n),Object.values(t).sort(Ys)}(e),i=e.slice().sort(Ys);function o(e){this._ops=r,this._out=i,this.cell=e,this.init()}return o.prototype.init=Xs,o.prototype.add=Zs,o.prototype.rem=Js,o.prototype.set=Ks,o.prototype.get=n,o.fields=e.map((e=>e.out)),o}function eu(e){this._key=e?k(e):Ko,this.reset()}[...Gs,"__count__"].forEach((e=>{Hs[e]=function(e,t){return(n,r)=>be({name:e,aggregate_param:r,out:n||e},Ws,t)}(e,Hs[e])}));const tu=eu.prototype;function nu(e){Fa.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}function ru(e){Fa.call(this,null,e)}function iu(e,t,n){const r=e;let i=t||[],o=n||[],a={},s=0;return{add:e=>o.push(e),remove:e=>a[r(e)]=++s,size:()=>i.length,data:(e,t)=>(s&&(i=i.filter((e=>!a[r(e)])),a={},s=0),t&&e&&i.sort(e),o.length&&(i=e?Pe(e,i,o.sort(e)):i.concat(o),o=[]),i)}}function ou(e){Fa.call(this,[],e)}function au(e){fa.call(this,null,su,e)}function su(e){return this.value&&!e.modified()?this.value:de(e.fields,e.orders)}function uu(e){Fa.call(this,null,e)}function lu(e){Fa.call(this,null,e)}tu.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},tu.add=function(e){this._add.push(e)},tu.rem=function(e){this._rem.push(e)},tu.values=function(){if(this._get=null,0===this._rem.length)return this._add;const e=this._add,t=this._rem,n=this._key,r=e.length,i=t.length,o=Array(r-i),a={};let s,u,l;for(s=0;s=0;)r=e(t[i])+"",ke(n,r)||(n[r]=1,++o);return o},tu.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=_e(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},tu.argmin=function(e){return this.extent(e)[0]||{}},tu.argmax=function(e){return this.extent(e)[1]||{}},tu.min=function(e){const t=this.extent(e)[0];return null!=t?e(t):void 0},tu.max=function(e){const t=this.extent(e)[1];return null!=t?e(t):void 0},tu.quartile=function(e){return this._get===e&&this._q||(this._q=Ha(this.values(),e),this._get=e),this._q},tu.q1=function(e){return this.quartile(e)[0]},tu.q2=function(e){return this.quartile(e)[1]},tu.q3=function(e){return this.quartile(e)[2]},tu.ci=function(e){return this._get===e&&this._ci||(this._ci=Za(this.values(),1e3,.05,e),this._get=e),this._ci},tu.ci0=function(e){return this.ci(e)[0]},tu.ci1=function(e){return this.ci(e)[1]},nu.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Gs},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},De(nu,Fa,{transform(e,t){const n=this,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.modified();return n.stamp=r.stamp,n.value&&(i||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(e):Object.create(null),t.visit(t.SOURCE,(e=>n.add(e)))):(n.value=n.value||n.init(e),t.visit(t.REM,(e=>n.rem(e))),t.visit(t.ADD,(e=>n.add(e)))),r.modifies(n._outputs),n._drop=!1!==e.drop,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&r.clean(!0).runAfter((()=>this.clean())),n.changes(r)},cross(){const e=this,t=e.value,n=e._dnames,r=n.map((()=>({}))),i=n.length;function o(e){let t,o,a,s;for(t in e)for(a=e[t].tuple,o=0;o{const t=m(e);return i(e),n.push(t),t})),this.cellkey=e.key?e.key:Is(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],a=e.ops||["count"],s=e.aggregate_params||[null],u=e.as||[],l=o.length,c={};let f,d,h,p,g,v,b;for(l!==a.length&&_("Unmatched number of fields and aggregate ops."),b=0;bQs(e,e.field))),Object.create(null)},cellkey:Is(),cell(e,t){let n=this.value[e];return n?0===n.num&&this._drop&&n.stamp{const t=r(e);e[s]=t,e[u]=null==t?null:i+o*(1+(t-i)/o)}:e=>e[s]=r(e)),t.modifies(n?a:s)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=Va(e),r=n.step;let i,o,a=n.start,s=a+Math.ceil((n.stop-a)/r)*r;null!=(i=e.anchor)&&(o=i-(a+r*Math.floor((i-a)/r)),a+=o,s+=o);const u=function(e){let n=W(t(e));return null==n?null:ns?1/0:(n=Math.max(a,Math.min(n,s-r)),a+r*Math.floor(1e-14+(n-a)/r))};return u.start=a,u.stop=n.stop,u.step=r,this.value=g(u,y(t),e.name||"bin_"+m(t))}}),ou.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},De(ou,Fa,{transform(e,t){const n=t.fork(t.ALL),r=iu(Ko,this.value,n.materialize(n.ADD).add),i=e.sort,o=t.changed()||i&&(e.modified("sort")||t.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(ia(i),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}}),De(au,fa),uu.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]},De(uu,Fa,{transform(e,t){const n=t=>n=>{for(var r,i=function(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase()}return e.match(n)}(s(n),e.case,o)||[],u=0,l=i.length;ui[e]=1+(i[e]||0))),c=n((e=>i[e]-=1));return r?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return!e.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),!e.modified("pattern")&&this._match||(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,r=this._tuples||(this._tuples={}),i=t[0],o=t[1],a=e.fork(e.NO_SOURCE|e.NO_FIELDS);let s,u,l;for(s in n)u=r[s],l=n[s]||0,!u&&l?(r[s]=u=ea({}),u[i]=s,u[o]=l,a.add.push(u)):0===l?(u&&a.rem.push(u),n[s]=null,r[s]=null):u[o]!==l&&(u[o]=l,a.mod.push(u));return a.modifies(t)}}),lu.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},De(lu,Fa,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.as||["a","b"],i=r[0],o=r[1],a=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let s=this.value;return a?(s&&(n.rem=s),s=t.materialize(t.SOURCE).source,n.add=this.value=function(e,t,n,r){for(var i,o,a=[],s={},u=e.length,l=0;ldu(e,t)))):typeof r[n]===fu&&r[n](e[n]);return r}function hu(e){Fa.call(this,null,e)}const pu=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],gu={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:pu},{name:"weights",type:"number",array:!0}]};function mu(e,t){return e?e.map(((e,n)=>t[n]||m(e))):null}function yu(e,t,n){const r=[],i=e=>e(u);let o,a,s,u,l,c;if(null==t)r.push(e.map(n));else for(o={},a=0,s=e.length;at(n,e)),y(t),m(t))}function _u(e){Fa.call(this,[void 0,void 0],e)}function wu(e,t){fa.call(this,e),this.parent=t,this.count=0}function ku(e){Fa.call(this,{},e),this._keys=Ee();const t=this._targets=[];t.active=0,t.forEach=e=>{for(let n=0,r=t.active;nk(e))):k(e.name,e.as)}function Ou(e){Fa.call(this,Ee(),e)}function Du(e){Fa.call(this,[],e)}function Cu(e){Fa.call(this,[],e)}function Su(e){Fa.call(this,null,e)}function Fu(e){Fa.call(this,[],e)}hu.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:pu.concat(gu)},{name:"as",type:"string",array:!0,default:["value","density"]}]},De(hu,Fa,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=du(e.distribution,function(e){return()=>e.materialize(e.SOURCE).source}(t)),i=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let a=e.method||"pdf";"pdf"!==a&&"cdf"!==a&&_("Invalid density method: "+a),e.extent||r.data||_("Missing density extent parameter."),a=r[a];const s=e.as||["value","density"],u=Rs(a,e.extent||xe(r.data()),i,o).map((e=>{const t={};return t[s[0]]=e[0],t[s[1]]=e[1],ea(t)}));this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}}),vu.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]},De(vu,Fa,{transform(e,t){if(this.value&&!e.modified()&&!t.changed())return t;const n=t.materialize(t.SOURCE).source,r=yu(t.source,e.groupby,E),i=e.smooth||!1,o=e.field,a=e.step||((e,t)=>Ue(xe(e,t))/30)(n,o),s=ia(((e,t)=>o(e)-o(t))),u=e.as||"bin",l=r.length;let c,f=1/0,d=-1/0,h=0;for(;hd&&(d=t),e[++c][u]=t}return this.value={start:f,stop:d,step:a},t.reflow(!0).modifies(u)}}),De(bu,fa),_u.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},De(_u,Fa,{transform(e,t){const n=this.value,r=e.field,i=t.changed()||t.modified(r.fields)||e.modified("field");let o=n[0],a=n[1];if((i||null==o)&&(o=1/0,a=-1/0),t.visit(i?t.SOURCE:t.ADD,(e=>{const t=W(r(e));null!=t&&(ta&&(a=t))})),!Number.isFinite(o)||!Number.isFinite(a)){let e=m(r);e&&(e=` for field "${e}"`),t.dataflow.warn(`Infinite extent${e}: [${o}, ${a}]`),o=a=void 0}this.value=[o,a]}}),De(wu,fa,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}}),De(ku,Fa,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,r){const i=this.value;let o,a,s=ke(i,e)&&i[e];return s?s.value.stampe&&e.count>0));this.initTargets(e)}},initTargets(e){const t=this._targets,n=t.length,r=e?e.length:0;let i=0;for(;ithis.subflow(e,i,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,(e=>{const t=Ko(e),n=o.get(t);void 0!==n&&(o.delete(t),s(n).rem(e))})),t.visit(t.ADD,(e=>{const t=r(e);o.set(Ko(e),t),s(t).add(e)})),a||t.modified(r.fields)?t.visit(t.MOD,(e=>{const t=Ko(e),n=o.get(t),i=r(e);n===i?s(i).mod(e):(o.set(t,i),s(n).rem(e),s(i).add(e))})):t.changed(t.MOD)&&t.visit(t.MOD,(e=>{s(o.get(Ko(e))).mod(e)})),a&&t.visit(t.REFLOW,(e=>{const t=Ko(e),n=o.get(t),i=r(e);n!==i&&(o.set(t,i),s(n).rem(e),s(i).add(e))})),t.clean()?n.runAfter((()=>{this.clean(),o.clean()})):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}}),De(Au,fa),Ou.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},De(Ou,Fa,{transform(e,t){const n=t.dataflow,r=this.value,i=t.fork(),o=i.add,a=i.rem,s=i.mod,u=e.expr;let l=!0;function c(t){const n=Ko(t),i=u(t,e),c=r.get(n);i&&c?(r.delete(n),o.push(t)):i||c?l&&i&&!c&&s.push(t):(r.set(n,1),a.push(t))}return t.visit(t.REM,(e=>{const t=Ko(e);r.has(t)?r.delete(t):a.push(e)})),t.visit(t.ADD,(t=>{u(t,e)?o.push(t):r.set(Ko(t),1)})),t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}}),Du.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},De(Du,Fa,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=mu(r,e.as||[]),o=e.index||null,a=i.length;return n.rem=this.value,t.visit(t.SOURCE,(e=>{const t=r.map((t=>t(e))),s=t.reduce(((e,t)=>Math.max(e,t.length)),0);let u,l,c,f=0;for(;f{for(let t,o=0;ot[r]=n(t,e)))}}),De(Fu,Fa,{transform(e,t){const n=t.fork(t.ALL),r=e.generator;let i,o,a,s=this.value,u=e.size-s.length;if(u>0){for(i=[];--u>=0;)i.push(a=ea(r(e))),s.push(a);n.add=n.add.length?n.materialize(n.ADD).add.concat(i):i}else o=s.slice(0,-u),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,s=s.slice(-u);return n.source=this.value=s,n}});const Mu={value:"value",median:Ua,mean:function(e,t){let n=0,r=0;if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(++n,r+=t);else{let i=-1;for(let o of e)null!=(o=t(o,++i,e))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n},min:Ba,max:Na},ju=[];function $u(e){Fa.call(this,[],e)}function Nu(e){nu.call(this,e)}function Bu(e){Fa.call(this,null,e)}function Tu(e){fa.call(this,null,zu,e)}function zu(e){return this.value&&!e.modified()?this.value:Be(e.fields,e.flat)}function Ru(e){Fa.call(this,[],e),this._pending=null}function Pu(e,t,n){n.forEach(ea);const r=t.fork(t.NO_FIELDS&t.NO_SOURCE);return r.rem=e.value,e.value=r.source=r.add=n,e._pending=null,r.rem.length&&r.clean(!0),r}function Lu(e){Fa.call(this,{},e)}function Iu(e){fa.call(this,null,Uu,e)}function Uu(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let r,i,o=1/0,a=-1/0;for(r=0;ra&&(a=i[1]);return[o,a]}function qu(e){fa.call(this,null,Wu,e)}function Wu(e){return this.value&&!e.modified()?this.value:e.values.reduce(((e,t)=>e.concat(t)),[])}function Hu(e){Fa.call(this,null,e)}function Gu(e){nu.call(this,e)}function Vu(e){ku.call(this,e)}function Yu(e){Fa.call(this,null,e)}function Xu(e){Fa.call(this,null,e)}function Zu(e){Fa.call(this,null,e)}function Ju(e){Fa.call(this,null,e)}function Ku(e){Fa.call(this,[],e),this.count=0}function Qu(e){Fa.call(this,null,e)}function el(e){Fa.call(this,null,e),this.modified(!0)}function tl(e){Fa.call(this,null,e)}$u.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},De($u,Fa,{transform(e,t){var n,r,i,o,a,s,u,l,c,f,d=t.fork(t.ALL),h=function(e){var t,n=e.method||Mu.value;if(null!=Mu[n])return n===Mu.value?(t=void 0!==e.value?e.value:0,()=>t):Mu[n];_("Unrecognized imputation method: "+n)}(e),p=function(e){const t=e.field;return e=>e?t(e):NaN}(e),g=m(e.field),y=m(e.key),v=(e.groupby||[]).map(m),b=function(e,t,n,r){var i,o,a,s,u,l,c,f,d=e=>e(f),h=[],p=r?r.slice():[],g={},m={};for(p.forEach(((e,t)=>g[e]=t+1)),s=0,c=e.length;sn.add(e)))):(i=n.value=n.value||this.init(e),t.visit(t.REM,(e=>n.rem(e))),t.visit(t.ADD,(e=>n.add(e)))),n.changes(),t.visit(t.SOURCE,(e=>{be(e,i[n.cellkey(e)].tuple)})),t.reflow(r).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,r;for(n=0,r=this._alen;n{const n=us(t,a)[s],r=e.counts?t.length:1;Rs(n,c||xe(t),f,d).forEach((e=>{const n={};for(let e=0;e(this._pending=ue(e.data),e=>e.touch(this))));return{async:t}}return n.request(e.url,e.format).then((e=>Pu(this,t,ue(e.data))))}}),Lu.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},De(Lu,Fa,{transform(e,t){const n=e.fields,r=e.index,i=e.values,o=null==e.default?null:e.default,a=e.modified(),s=n.length;let u,l,c,f=a?t.SOURCE:t.ADD,d=t,h=e.as;return i?(l=i.length,s>1&&!h&&_('Multi-field lookup requires explicit "as" parameter.'),h&&h.length!==s*l&&_('The "as" parameter has too few output field names.'),h=h||i.map(m),u=function(e){for(var t,a,u=0,c=0;ut.modified(e.fields))),f|=c?t.MOD:0),t.visit(f,u),d.modifies(h)}}),De(Iu,fa),De(qu,fa),De(Hu,Fa,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),Gu.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Gs,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},De(Gu,nu,{_transform:nu.prototype.transform,transform(e,t){return this._transform(function(e,t){const n=e.field,r=e.value,i=("count"===e.op?"__count__":e.op)||"sum",o=y(n).concat(y(r)),a=function(e,t,n){const r={},i=[];return n.visit(n.SOURCE,(t=>{const n=e(t);r[n]||(r[n]=1,i.push(n))})),i.sort(he),t?i.slice(0,t):i}(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:a.map((()=>i)),fields:a.map((e=>function(e,t,n,r){return g((r=>t(r)===e?n(r):NaN),r,e+"")}(e,n,r,o))),as:a.map((e=>e+"")),modified:e.modified.bind(e)}}(e,t),t)}}),De(Vu,ku,{transform(e,t){const n=e.subflow,r=e.field,i=e=>this.subflow(Ko(e),n,t,e);return(e.modified("field")||r&&t.modified(y(r)))&&_("PreFacet does not support field modification."),this.initTargets(),r?(t.visit(t.MOD,(e=>{const t=i(e);r(e).forEach((e=>t.mod(e)))})),t.visit(t.ADD,(e=>{const t=i(e);r(e).forEach((e=>t.add(ea(e))))})),t.visit(t.REM,(e=>{const t=i(e);r(e).forEach((e=>t.rem(e)))}))):(t.visit(t.MOD,(e=>i(e).mod(e))),t.visit(t.ADD,(e=>i(e).add(e))),t.visit(t.REM,(e=>i(e).rem(e)))),t.clean()&&t.runAfter((()=>this.clean())),t}}),Yu.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},De(Yu,Fa,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=mu(e.fields,e.as||[]),o=r?(e,t)=>function(e,t,n,r){for(let i=0,o=n.length;i{const t=Ko(e);n.rem.push(a[t]),a[t]=null})),t.visit(t.ADD,(e=>{const t=o(e,ea({}));a[Ko(e)]=t,n.add.push(t)})),t.visit(t.MOD,(e=>{n.mod.push(o(e,a[Ko(e)]))})),n}}),De(Xu,Fa,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}}),Zu.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]},De(Zu,Fa,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const i=yu(t.materialize(t.SOURCE).source,e.groupby,e.field),o=(e.groupby||[]).map(m),a=[],s=e.step||.01,u=e.probs||Ls(s/2,1-1e-14,s),l=u.length;return i.forEach((e=>{const t=Wa(e,u);for(let n=0;n{const t=Ko(e);n.rem.push(r[t]),r[t]=null})),t.visit(t.ADD,(e=>{const t=ta(e);r[Ko(e)]=t,n.add.push(t)})),t.visit(t.MOD,(e=>{const t=r[Ko(e)];for(const r in e)t[r]=e[r],n.modifies(r);n.mod.push(t)}))),n}}),Ku.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},De(Ku,Fa,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.modified("size"),i=e.size,o=this.value.reduce(((e,t)=>(e[Ko(t)]=1,e)),{});let a=this.value,s=this.count,u=0;function l(e){let t,r;a.length=u&&(t=a[r],o[Ko(t)]&&n.rem.push(t),a[r]=e)),++s}if(t.rem.length&&(t.visit(t.REM,(e=>{const t=Ko(e);o[t]&&(o[t]=-1,n.rem.push(e)),--s})),a=a.filter((e=>-1!==o[Ko(e)]))),(t.rem.length||r)&&a.length{o[Ko(e)]||l(e)})),u=-1),r&&a.length>i){const e=a.length-i;for(let t=0;t{o[Ko(e)]&&n.mod.push(e)})),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=a.filter((e=>!o[Ko(e)]))),this.count=s,this.value=n.source=a,n}}),Qu.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},De(Qu,Fa,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),r=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Ls(e.start,e.stop,e.step||1).map((e=>{const t={};return t[r]=e,ea(t)})),n.add=t.add.concat(this.value),n}}),De(el,Fa,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});const nl=["unit0","unit1"];function rl(e){Fa.call(this,Ee(),e)}function il(e){Fa.call(this,null,e)}tl.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:Rn,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:nl}]},De(tl,Fa,{transform(e,t){const n=e.field,r=!1!==e.interval,i="utc"===e.timezone,o=this._floor(e,t),a=(i?pr:hr)(o.unit).offset,s=e.as||nl,u=s[0],l=s[1],c=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(y(n)))&&(h=(t=t.reflow(!0)).SOURCE,f=1/0,d=-1/0),t.visit(h,(e=>{const t=n(e);let i,s;null==t?(e[u]=null,r&&(e[l]=null)):(e[u]=i=s=o(t),r&&(e[l]=s=a(i,c)),id&&(d=s))})),o.start=f,o.stop=d,t.modifies(r?s:u)},_floor(e,t){const n="utc"===e.timezone,{units:r,step:i}=e.units?{units:e.units,step:e.step||1}:Fr({extent:e.extent||xe(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=Ln(r),a=this.value||{},s=(n?cr:sr)(o,i);return s.unit=q(o),s.units=o,s.step=i,s.start=a.start,s.stop=a.stop,this.value=s}}),De(rl,Fa,{transform(e,t){const n=t.dataflow,r=e.field,i=this.value,o=e=>i.set(r(e),e);let a=!0;return e.modified("field")||t.modified(r.fields)?(i.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,(e=>i.delete(r(e)))),t.visit(t.ADD,o)):a=!1,this.modified(a),i.empty>n.cleanThreshold&&n.runAfter(i.clean),t.fork()}}),De(il,Fa,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(ia(e.sort)):t.source).map(e.field))}});const ol={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?++e:e}}},percent_rank:function(){const e=ol.rank(),t=e.next;return{init:e.init,next:e=>(t(e)-1)/(e.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,r=t.compare;let i=t.index;if(e0||_("ntile num must be greater than zero.");const n=ol.cume_dist(),r=n.next;return{init:n.init,next:e=>Math.ceil(t*r(e))}},lag:function(e,t){return t=+t||1,{next:n=>{const r=n.index-t;return r>=0?e(n.data[r]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const r=n.index+t,i=n.data;return re(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return(t=+t)>0||_("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(t-1);return rt=null,next:n=>{const r=e(n.data[n.index]);return null!=r?t=r:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:r=>{const i=r.data;return r.index<=n?t:(n=function(e,t,n){for(let r=t.length;nu[e]=1))}h(e.sort),t.forEach(((e,t)=>{const u=n[t],p=r[t],g=i[t]||null,y=m(u),v=Us(e,y,o[t]);if(h(u),a.push(v),ke(ol,e))s.push(function(e,t,n,r){const i=ol[e](t,n);return{init:i.init||O,update:function(e,t){t[r]=i.next(e)}}}(e,u,p,v));else{if(null==u&&"count"!==e&&_("Null aggregate field specified."),"count"===e)return void c.push(v);d=!1;let t=l[y];t||(t=l[y]=[],t.field=u,f.push(t)),t.push(Vs(e,g,v))}})),(c.length||f.length)&&(this.cell=function(e,t,n){e=e.map((e=>Qs(e,e.field)));const r={num:0,agg:null,store:!1,count:t};if(!n)for(var i=e.length,o=r.agg=Array(i),a=0;a0&&!i(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),re.init())),this.cell&&this.cell.init()},ul.update=function(e,t){const n=this.cell,r=this.windows,i=e.data,o=r&&r.length;let a;if(n){for(a=e.p0;athis.group(i(e));let a=this.state;a&&!n||(a=this.state=new sl(e)),n||t.modified(a.inputs)?(this.value={},t.visit(t.SOURCE,(e=>o(e).add(e)))):(t.visit(t.REM,(e=>o(e).remove(e))),t.visit(t.ADD,(e=>o(e).add(e))));for(let t=0,n=this._mlen;t0)for(var r,i=e[0],o=t[0],a=e[n]-i,s=t[n]-o,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*e[u]+(1-this._beta)*(i+r*a),this._beta*t[u]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const bl=function e(t){function n(e){return 1===t?new pl(e):new vl(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function xl(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function _l(e,t){this._context=e,this._k=(1-t)/6}_l.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:xl(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:xl(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const wl=function e(t){function n(e){return new _l(e,t)}return n.tension=function(t){return e(+t)},n}(0);function kl(e,t){this._context=e,this._k=(1-t)/6}kl.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(e,t){switch(e=+e,t=+t,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:xl(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Al=function e(t){function n(e){return new kl(e,t)}return n.tension=function(t){return e(+t)},n}(0);function El(e,t){this._context=e,this._k=(1-t)/6}El.prototype={areaStart:gl,areaEnd:gl,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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:xl(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Ol=function e(t){function n(e){return new El(e,t)}return n.tension=function(t){return e(+t)},n}(0),Dl=Math.abs,Cl=Math.atan2,Sl=Math.cos,Fl=Math.max,Ml=Math.min,jl=Math.sin,$l=Math.sqrt,Nl=1e-12,Bl=Math.PI,Tl=Bl/2,zl=2*Bl;function Rl(e){return e>=1?Tl:e<=-1?-Tl:Math.asin(e)}function Pl(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>Nl){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>Nl){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*l+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}function Ll(e,t){this._context=e,this._alpha=t}Ll.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Pl(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Il=function e(t){function n(e){return t?new Ll(e,t):new _l(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Ul(e,t){this._context=e,this._alpha=t}Ul.prototype={areaStart:gl,areaEnd:gl,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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Pl(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const ql=function e(t){function n(e){return t?new Ul(e,t):new El(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Wl(e,t){this._context=e,this._alpha=t}Wl.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Pl(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Hl=function e(t){function n(e){return t?new Wl(e,t):new kl(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Gl(e){this._context=e}function Vl(e){return new Gl(e)}function Yl(e){this._context=e}function Xl(e){return e<0?-1:1}function Zl(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Xl(o)+Xl(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Jl(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Kl(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function Ql(e){this._context=e}function ec(e){this._context=new tc(e)}function tc(e){this._context=e}function nc(e){this._context=e}function rc(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};const ac=Math.PI,sc=2*ac,uc=1e-6,lc=sc-uc;function cc(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return cc;const n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;tuc)if(Math.abs(c*s-u*l)>uc&&i){let d=n-o,h=r-a,p=s*s+u*u,g=d*d+h*h,m=Math.sqrt(p),y=Math.sqrt(f),v=i*Math.tan((ac-Math.acos((p+f-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>uc&&this._append`L${e+b*l},${t+b*c}`,this._append`A${i},${i},0,0,${+(c*d>l*h)},${this._x1=e+x*s},${this._y1=t+x*u}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,n,r,i,o){if(e=+e,t=+t,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),u=e+a,l=t+s,c=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${u},${l}`:(Math.abs(this._x1-u)>uc||Math.abs(this._y1-l)>uc)&&this._append`L${u},${l}`,n&&(f<0&&(f=f%sc+sc),f>lc?this._append`A${n},${n},0,1,${c},${e-a},${t-s}A${n},${n},0,1,${c},${this._x1=u},${this._y1=l}`:f>uc&&this._append`A${n},${n},0,${+(f>=ac)},${c},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function dc(){return new fc}function hc(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new fc(t)}function pc(e){return e.innerRadius}function gc(e){return e.outerRadius}function mc(e){return e.startAngle}function yc(e){return e.endAngle}function vc(e){return e&&e.padAngle}function bc(e,t,n,r,i,o,a){var s=e-n,u=t-r,l=(a?o:-o)/$l(s*s+u*u),c=l*u,f=-l*s,d=e+c,h=t+f,p=n+c,g=r+f,m=(d+p)/2,y=(h+g)/2,v=p-d,b=g-h,x=v*v+b*b,_=i-o,w=d*g-p*h,k=(b<0?-1:1)*$l(Fl(0,_*_*x-w*w)),A=(w*b-v*k)/x,E=(-w*v-b*k)/x,O=(w*b+v*k)/x,D=(-w*v+b*k)/x,C=A-m,S=E-y,F=O-m,M=D-y;return C*C+S*S>F*F+M*M&&(A=O,E=D),{cx:A,cy:E,x01:-c,y01:-f,x11:A*(i/_-1),y11:E*(i/_-1)}}function xc(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function _c(e){return e[0]}function wc(e){return e[1]}function kc(e,t){var n=oc(!0),r=null,i=Vl,o=null,a=hc(s);function s(s){var u,l,c,f=(s=xc(s)).length,d=!1;for(null==r&&(o=i(c=a())),u=0;u<=f;++u)!(u=f;--d)s.point(y[d],v[d]);s.lineEnd(),s.areaEnd()}m&&(y[c]=+e(h,c,l),v[c]=+t(h,c,l),s.point(r?+r(h,c,l):y[c],n?+n(h,c,l):v[c]))}if(p)return s=null,p+""||null}function c(){return kc().defined(i).curve(a).context(o)}return e="function"==typeof e?e:void 0===e?_c:oc(+e),t="function"==typeof t?t:oc(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?wc:oc(+n),l.x=function(t){return arguments.length?(e="function"==typeof t?t:oc(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:oc(+t),l):e},l.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:oc(+e),l):r},l.y=function(e){return arguments.length?(t="function"==typeof e?e:oc(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t="function"==typeof e?e:oc(+e),l):t},l.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:oc(+e),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(r).y(t)},l.defined=function(e){return arguments.length?(i="function"==typeof e?e:oc(!!e),l):i},l.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),l):a},l.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),l):o},l}dc.prototype=fc.prototype,Array.prototype.slice,$l(3);const Ec={draw(e,t){const n=$l(t/Bl);e.moveTo(n,0),e.arc(0,0,n,0,zl)}};$l(1/3),jl(Bl/10),jl(7*Bl/10);function Oc(e,t){if("undefined"!=typeof document&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}jl(zl/10),Sl(zl/10),$l(3),$l(3),$l(3),$l(12);const Dc=()=>"undefined"!=typeof Image?Image:null,Cc=En(kn),Sc=Cc.right,Fc=Cc.left,Mc=(En(Pa).center,Sc);function jc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function $c(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Nc(){}var Bc=.7,Tc=1/Bc,zc="\\s*([+-]?\\d+)\\s*",Rc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Pc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Lc=/^#([0-9a-f]{3,8})$/,Ic=new RegExp(`^rgb\\(${zc},${zc},${zc}\\)$`),Uc=new RegExp(`^rgb\\(${Pc},${Pc},${Pc}\\)$`),qc=new RegExp(`^rgba\\(${zc},${zc},${zc},${Rc}\\)$`),Wc=new RegExp(`^rgba\\(${Pc},${Pc},${Pc},${Rc}\\)$`),Hc=new RegExp(`^hsl\\(${Rc},${Pc},${Pc}\\)$`),Gc=new RegExp(`^hsla\\(${Rc},${Pc},${Pc},${Rc}\\)$`),Vc={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};function Yc(){return this.rgb().formatHex()}function Xc(){return this.rgb().formatRgb()}function Zc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Lc.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Jc(t):3===n?new tf(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Kc(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Kc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Ic.exec(e))?new tf(t[1],t[2],t[3],1):(t=Uc.exec(e))?new tf(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=qc.exec(e))?Kc(t[1],t[2],t[3],t[4]):(t=Wc.exec(e))?Kc(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Hc.exec(e))?uf(t[1],t[2]/100,t[3]/100,1):(t=Gc.exec(e))?uf(t[1],t[2]/100,t[3]/100,t[4]):Vc.hasOwnProperty(e)?Jc(Vc[e]):"transparent"===e?new tf(NaN,NaN,NaN,0):null}function Jc(e){return new tf(e>>16&255,e>>8&255,255&e,1)}function Kc(e,t,n,r){return r<=0&&(e=t=n=NaN),new tf(e,t,n,r)}function Qc(e){return e instanceof Nc||(e=Zc(e)),e?new tf((e=e.rgb()).r,e.g,e.b,e.opacity):new tf}function ef(e,t,n,r){return 1===arguments.length?Qc(e):new tf(e,t,n,null==r?1:r)}function tf(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function nf(){return`#${sf(this.r)}${sf(this.g)}${sf(this.b)}`}function rf(){const e=of(this.opacity);return`${1===e?"rgb(":"rgba("}${af(this.r)}, ${af(this.g)}, ${af(this.b)}${1===e?")":`, ${e})`}`}function of(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function af(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function sf(e){return((e=af(e))<16?"0":"")+e.toString(16)}function uf(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ff(e,t,n,r)}function lf(e){if(e instanceof ff)return new ff(e.h,e.s,e.l,e.opacity);if(e instanceof Nc||(e=Zc(e)),!e)return new ff;if(e instanceof ff)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n0&&u<1?0:a,new ff(a,s,u,e.opacity)}function cf(e,t,n,r){return 1===arguments.length?lf(e):new ff(e,t,n,null==r?1:r)}function ff(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function df(e){return(e=(e||0)%360)<0?e+360:e}function hf(e){return Math.max(0,Math.min(1,e||0))}function pf(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function gf(e,t,n,r,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*n+(1+3*e+3*o-3*a)*r+a*i)/6}function mf(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],a=r>0?e[r-1]:2*i-o,s=r=240?e-240:e+120,i,r),pf(e,i,r),pf(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ff(df(this.h),hf(this.s),hf(this.l),of(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=of(this.opacity);return`${1===e?"hsl(":"hsla("}${df(this.h)}, ${100*hf(this.s)}%, ${100*hf(this.l)}%${1===e?")":`, ${e})`}`}}));const vf=e=>()=>e;function bf(e,t){return function(n){return e+n*t}}function xf(e,t){var n=t-e;return n?bf(e,n>180||n<-180?n-360*Math.round(n/360):n):vf(isNaN(e)?t:e)}function _f(e,t){var n=t-e;return n?bf(e,n):vf(isNaN(e)?t:e)}const wf=function e(t){var n=function(e){return 1==(e=+e)?_f:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):vf(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=ef(e)).r,(t=ef(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=_f(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function kf(e){return function(t){var n,r,i=t.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;no&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Mf(n,r)})),o=Nf.lastIndex;return ot&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?qf:Uf,i=o=null,f}function f(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),s,u)))(e(l(t)))}return f.invert=function(n){return l(t((o||(o=r(s,a.map(e),Mf)))(n)))},f.domain=function(e){return arguments.length?(a=Array.from(e,Rf),c()):a.slice()},f.range=function(e){return arguments.length?(s=Array.from(e),c()):s.slice()},f.rangeRound=function(e){return s=Array.from(e),u=zf,c()},f.clamp=function(e){return arguments.length?(l=!!e||Lf,c()):l!==Lf},f.interpolate=function(e){return arguments.length?(u=e,c()):u},f.unknown=function(e){return arguments.length?(n=e,f):n},function(n,r){return e=n,t=r,c()}}function Gf(){return Hf()(Lf,Lf)}function Vf(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Yf(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}function Xf(e,t,n,r){var i,o=bt(e,t,n);switch((r=wt(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=Ot(o,a))||(r.precision=i),Nt(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=Dt(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=Ct(o))||(r.precision=i-2*("%"===r.type))}return $t(r)}function Zf(e){var t=e.domain;return e.ticks=function(e){var n=t();return yt(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return Xf(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,s=o.length-1,u=o[a],l=o[s],c=10;for(l0;){if((i=vt(u,l,n))===r)return o[a]=u,o[s]=l,t(o);if(i>0)u=Math.floor(u/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;u=Math.ceil(u*i)/i,l=Math.floor(l*i)/i}r=i}return e},e}function Jf(e,t){var n,r=0,i=(e=e.slice()).length-1,o=e[r],a=e[i];return a-e(-t,n)}function id(e){const t=e(Kf,Qf),n=t.domain;let r,i,o=10;function a(){return r=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(o),i=function(e){return 10===e?nd:e===Math.E?Math.exp:t=>Math.pow(e,t)}(o),n()[0]<0?(r=rd(r),i=rd(i),e(ed,td)):e(Kf,Qf),t}return t.base=function(e){return arguments.length?(o=+e,a()):o},t.domain=function(e){return arguments.length?(n(e),a()):n()},t.ticks=e=>{const t=n();let a=t[0],s=t[t.length-1];const u=s0){for(;f<=d;++f)for(l=1;ls)break;p.push(c)}}else for(;f<=d;++f)for(l=o-1;l>=1;--l)if(c=f>0?l/i(-f):l*i(f),!(cs)break;p.push(c)}2*p.length{if(null==e&&(e=10),null==n&&(n=10===o?"s":","),"function"!=typeof n&&(o%1||null!=(n=wt(n)).precision||(n.trim=!0),n=$t(n)),e===1/0)return n;const a=Math.max(1,o*e/t.ticks().length);return e=>{let t=e/i(Math.round(r(e)));return t*on(Jf(n(),{floor:e=>i(Math.floor(r(e))),ceil:e=>i(Math.ceil(r(e)))})),t}function od(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function ad(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function sd(e){return e<0?-e*e:e*e}function ud(e){var t=e(Lf,Lf),n=1;return t.exponent=function(t){return arguments.length?1==(n=+t)?e(Lf,Lf):.5===n?e(ad,sd):e(od(n),od(1/n)):n},Zf(t)}function ld(){var e=ud(Hf());return e.copy=function(){return Wf(e,ld()).exponent(e.exponent())},Vf.apply(e,arguments),e}function cd(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function fd(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function dd(e){var t=1,n=e(cd(t),fd(t));return n.constant=function(n){return arguments.length?e(cd(t=+n),fd(t)):t},Zf(n)}function hd(e,t,n,r,i,o){const a=[[_n,1,It],[_n,5,5e3],[_n,15,15e3],[_n,30,3e4],[o,1,Ut],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,qt],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,Wt],[r,2,1728e5],[n,1,Ht],[t,1,2592e6],[t,3,7776e6],[e,1,Gt]];function s(t,n,r){const i=Math.abs(n-t)/r,o=En((([,,e])=>e)).right(a,i);if(o===a.length)return e.every(bt(t/Gt,n/Gt,r));if(0===o)return wn.every(Math.max(bt(t,n,r),1));const[s,u]=a[i/a[o-1][2]180?t+=360:t-e>180&&(e+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Mf(e,t)})):t&&n.push(i(n)+"rotate("+t+r)}(o.rotate,a.rotate,s,u),function(e,t,n,o){e!==t?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Mf(e,t)}):t&&n.push(i(n)+"skewX("+t+r)}(o.skewX,a.skewX,s,u),function(e,t,n,r,o,a){if(e!==n||t!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:Mf(e,n)},{i:s-2,x:Mf(t,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(e){for(var t,n=-1,r=u.length;++nih?Math.pow(e,1/3):e/rh+th}function lh(e){return e>nh?e*e*e:rh*(e-th)}function ch(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function fh(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function dh(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof hh)return new hh(e.h,e.c,e.l,e.opacity);if(e instanceof sh||(e=oh(e)),0===e.a&&0===e.b)return new hh(NaN,00?r:1:0}const Hh="linear",Gh="log",Vh="pow",Yh="sqrt",Xh="symlog",Zh="time",Jh="utc",Kh="sequential",Qh="diverging",ep="quantile",tp="quantize",np="threshold",rp="ordinal",ip="point",op="band",ap="bin-ordinal",sp="continuous",up="discrete",lp="discretizing",cp="interpolating",fp="temporal";function dp(){const e=Bd().unknown(void 0),t=e.domain,n=e.range;let r,i,o=[0,1],a=!1,s=0,u=0,l=.5;function c(){const e=t().length,c=o[1]h+r*e));return n(c?p.reverse():p)}return delete e.unknown,e.domain=function(e){return arguments.length?(t(e),c()):t()},e.range=function(e){return arguments.length?(o=[+e[0],+e[1]],c()):o.slice()},e.rangeRound=function(e){return o=[+e[0],+e[1]],a=!0,c()},e.bandwidth=function(){return i},e.step=function(){return r},e.round=function(e){return arguments.length?(a=!!e,c()):a},e.padding=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),s=u,c()):s},e.paddingInner=function(e){return arguments.length?(s=Math.max(0,Math.min(1,e)),c()):s},e.paddingOuter=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),c()):u},e.align=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),c()):l},e.invertRange=function(e){if(null==e[0]||null==e[1])return;const r=o[1]o[1-r])?void 0:(u=Math.max(0,Sc(a,f)-1),l=f===d?u:Sc(a,d)-1,f-a[u]>i+1e-10&&++u,r&&(c=u,u=s-l,l=s-c),u>l?void 0:t().slice(u,l+1))},e.invert=function(t){const n=e.invertRange([t,t]);return n?n[0]:n},e.copy=function(){return dp().domain(t()).range(o).round(a).paddingInner(s).paddingOuter(u).align(l)},c()}function hp(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return hp(t())},e}var pp=Array.prototype.map;const gp=Array.prototype.slice,mp=new Map,yp=Symbol("vega_scale");function vp(e){return e[yp]=!0,e}function bp(e,t,n){return arguments.length>1?(mp.set(e,function(e,t,n){const r=function(){const n=t();return n.invertRange||(n.invertRange=n.invert?function(e){return function(t){let n,r=t[0],i=t[1];return i=s&&n[o]<=u&&(l<0&&(l=o),r=o);if(!(l<0))return s=e.invertExtent(n[l]),u=e.invertExtent(n[r]),[void 0===s[0]?s[1]:s[0],void 0===u[1]?u[0]:u[1]]}}(n):void 0),n.type=e,vp(n)};return r.metadata=Ye(ue(n)),r}(e,t,n)),this):xp(e)?mp.get(e):void 0}function xp(e){return mp.has(e)}function _p(e,t){const n=mp.get(e);return n&&n.metadata[t]}function wp(e){return _p(e,sp)}function kp(e){return _p(e,up)}function Ap(e){return _p(e,lp)}function Ep(e){return _p(e,Gh)}function Op(e){return _p(e,cp)}function Dp(e){return _p(e,ep)}bp("identity",(function e(t){var n;function r(e){return null==e||isNaN(e=+e)?n:e}return r.invert=r,r.domain=r.range=function(e){return arguments.length?(t=Array.from(e,Rf),r):t.slice()},r.unknown=function(e){return arguments.length?(n=e,r):n},r.copy=function(){return e(t).unknown(n)},t=arguments.length?Array.from(t,Rf):[0,1],Zf(r)})),bp(Hh,(function e(){var t=Gf();return t.copy=function(){return Wf(t,e())},Vf.apply(t,arguments),Zf(t)}),sp),bp(Gh,(function e(){const t=id(Hf()).domain([1,10]);return t.copy=()=>Wf(t,e()).base(t.base()),Vf.apply(t,arguments),t}),[sp,Gh]),bp(Vh,ld,sp),bp(Yh,(function(){return ld.apply(null,arguments).exponent(.5)}),sp),bp(Xh,(function e(){var t=dd(Hf());return t.copy=function(){return Wf(t,e()).constant(t.constant())},Vf.apply(t,arguments)}),sp),bp(Zh,(function(){return Vf.apply(xd(md,yd,hn,gn,Jt,Vt,yn,bn,_n,Tr).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[sp,fp]),bp(Jh,(function(){return Vf.apply(xd(pd,gd,pn,mn,an,Yt,vn,xn,_n,Rr).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[sp,fp]),bp(Kh,kd,[sp,cp]),bp(`${Kh}-${Hh}`,kd,[sp,cp]),bp(`${Kh}-${Gh}`,(function e(){var t=id(_d()).domain([1,10]);return t.copy=function(){return wd(t,e()).base(t.base())},Yf.apply(t,arguments)}),[sp,cp,Gh]),bp(`${Kh}-${Vh}`,Ad,[sp,cp]),bp(`${Kh}-${Yh}`,(function(){return Ad.apply(null,arguments).exponent(.5)}),[sp,cp]),bp(`${Kh}-${Xh}`,(function e(){var t=dd(_d());return t.copy=function(){return wd(t,e()).constant(t.constant())},Yf.apply(t,arguments)}),[sp,cp]),bp(`${Qh}-${Hh}`,(function e(){var t=Zf(Od()(Lf));return t.copy=function(){return wd(t,e())},Yf.apply(t,arguments)}),[sp,cp]),bp(`${Qh}-${Gh}`,(function e(){var t=id(Od()).domain([.1,1,10]);return t.copy=function(){return wd(t,e()).base(t.base())},Yf.apply(t,arguments)}),[sp,cp,Gh]),bp(`${Qh}-${Vh}`,Dd,[sp,cp]),bp(`${Qh}-${Yh}`,(function(){return Dd.apply(null,arguments).exponent(.5)}),[sp,cp]),bp(`${Qh}-${Xh}`,(function e(){var t=dd(Od());return t.copy=function(){return wd(t,e()).constant(t.constant())},Yf.apply(t,arguments)}),[sp,cp]),bp(ep,(function e(){var t,n=[],r=[],i=[];function o(){var e=0,t=Math.max(1,r.length);for(i=new Array(t-1);++e0?i[t-1]:n[0],t=i?[o[i-1],r]:[o[t-1],o[t]]},s.unknown=function(e){return arguments.length?(t=e,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return e().domain([n,r]).range(a).unknown(t)},Vf.apply(Zf(s),arguments)}),lp),bp(np,(function e(){var t,n=[.5],r=[0,1],i=1;function o(e){return null!=e&&e<=e?r[Mc(n,e,0,i)]:t}return o.domain=function(e){return arguments.length?(n=Array.from(e),i=Math.min(n.length,r.length-1),o):n.slice()},o.range=function(e){return arguments.length?(r=Array.from(e),i=Math.min(n.length,r.length-1),o):r.slice()},o.invertExtent=function(e){var t=r.indexOf(e);return[n[t-1],n[t]]},o.unknown=function(e){return arguments.length?(t=e,o):t},o.copy=function(){return e().domain(n).range(r).unknown(t)},Vf.apply(o,arguments)}),lp),bp(ap,(function e(){let t=[],n=[];function r(e){return null==e||e!=e?void 0:n[(Mc(t,e)-1)%n.length]}return r.domain=function(e){return arguments.length?(t=function(e){return pp.call(e,W)}(e),r):t.slice()},r.range=function(e){return arguments.length?(n=gp.call(e),r):n.slice()},r.tickFormat=function(e,n){return Xf(t[0],q(t),null==e?10:e,n)},r.copy=function(){return e().domain(r.domain()).range(r.range())},r}),[up,lp]),bp(rp,Bd,up),bp(op,dp,up),bp(ip,(function(){return hp(dp().paddingInner(1))}),up);const Cp=["clamp","base","constant","exponent"];function Sp(e,t){const n=t[0],r=q(t)-n;return function(t){return e(n+t*r)}}function Fp(e,t,n){return Ed($p(t||"rgb",n),e)}function Mp(e,t){const n=new Array(t),r=t+1;for(let i=0;ie[t]?a[t](e[t]()):0)),a):ye(.5)}function $p(e,t){const n=i[function(e){return"interpolate"+e.toLowerCase().split("-").map((e=>e[0].toUpperCase()+e.slice(1))).join("")}(e)];return null!=t&&n&&n.gamma?n.gamma(t):n}function Np(e){if(z(e))return e;const t=e.length/6|0,n=new Array(t);for(let r=0;r1?(Tp[e]=t,this):Tp[e]}Bp({accent:Nh,category10:Bh,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:Th,observable10:zh,paired:Rh,pastel1:Ph,pastel2:Lh,set1:Ih,set2:Uh,set3:qh,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"},Np),Bp({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},(e=>Fp(Np(e))));const Rp="symbol",Pp="discrete",Lp=e=>z(e)?e.map((e=>String(e))):String(e),Ip=(e,t)=>e[1]-t[1],Up=(e,t)=>t[1]-e[1];function qp(e,t,n){let r;return je(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),null!=n&&(t=Math.min(t,Math.floor(Ue(e.domain())/n||1)+1))),R(t)&&(r=t.step,t=t.interval),Ne(t)&&(t=e.type===Zh?hr(t):e.type==Jh?pr(t):_("Only time and utc scales accept interval strings."),r&&(t=t.every(r))),t}function Wp(e,t,n){let r=e.range(),i=r[0],o=q(r),a=Ip;if(i>o&&(r=o,o=i,i=r,a=Up),i=Math.floor(i),o=Math.ceil(o),t=t.map((t=>[t,e(t)])).filter((e=>i<=e[1]&&e[1]<=o)).sort(a).map((e=>e[0])),n>0&&t.length>1){const e=[t[0],q(t)];for(;t.length>n&&t.length>=3;)t=t.filter(((e,t)=>!(t%2)));t.length<3&&(t=e)}return t}function Hp(e,t){return e.bins?Wp(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function Gp(e,t,n,r,i,o){const a=t.type;let s=Lp;if(a===Zh||i===Zh)s=e.timeFormat(r);else if(a===Jh||i===Jh)s=e.utcFormat(r);else if(Ep(a)){const i=e.formatFloat(r);if(o||t.bins)s=i;else{const e=Vp(t,n,!1);s=t=>e(t)?i(t):""}}else if(t.tickFormat){const i=t.domain();s=e.formatSpan(i[0],i[i.length-1],n,r)}else r&&(s=e.format(r));return s}function Vp(e,t,n){const r=Hp(e,t),i=e.base(),o=Math.log(i),a=Math.max(1,i*t/r.length),s=e=>{let t=e/Math.pow(i,Math.round(Math.log(e)/o));return t*iYp[e.type]||e.bins;function Kp(e,t,n,r,i,o,a){const s=Xp[t.type]&&o!==Zh&&o!==Jh?function(e,t,n){const r=t[Xp[t.type]](),i=r.length;let o,a=i>1?r[1]-r[0]:r[0];for(o=1;o(t,n,r)=>{const i=eg(r[n+1],eg(r.max,1/0)),o=rg(t,e),a=rg(i,e);return o&&a?o+" – "+a:a?"< "+a:"≥ "+o},eg=(e,t)=>null!=e?e:t,tg=e=>(t,n)=>n?e(t):null,ng=e=>t=>e(t),rg=(e,t)=>Number.isFinite(e)?t(e):null;function ig(e,t,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=function(e,t,n,r){const i=r||t.type;return Ne(n)&&function(e){return _p(e,fp)}(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||i!==Zh?n||i!==Jh?Kp(e,t,5,null,n,r,!0):e.utcFormat("%A, %d %B %Y, %X UTC"):e.timeFormat("%A, %d %B %Y, %X")}(e,t,n.format,n.formatType);if(Ap(t.type)){const e=Zp(t).slice(1).map(i),n=e.length;return`${n} boundar${1===n?"y":"ies"}: ${e.join(", ")}`}if(kp(t.type)){const e=t.domain(),n=e.length;return`${n} value${1===n?"":"s"}: ${n>r?e.slice(0,r-2).map(i).join(", ")+", ending with "+e.slice(-1).map(i):e.map(i).join(", ")}`}{const e=t.domain();return`values from ${i(e[0])} to ${i(q(e))}`}}let og=0;const ag="p_";function sg(e){return e&&e.gradient}function ug(e,t,n){const r=e.gradient;let i=e.id,o="radial"===r?ag:"";return i||(i=e.id="gradient_"+og++,"radial"===r?(e.x1=lg(e.x1,.5),e.y1=lg(e.y1,.5),e.r1=lg(e.r1,0),e.x2=lg(e.x2,.5),e.y2=lg(e.y2,.5),e.r2=lg(e.r2,.5),o=ag):(e.x1=lg(e.x1,0),e.y1=lg(e.y1,0),e.x2=lg(e.x2,1),e.y2=lg(e.y2,0))),t[i]=e,"url("+(n||"")+"#"+o+i+")"}function lg(e,t){return null!=e?e:t}function cg(e,t){var n,r=[];return n={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:r,stop:function(e,t){return r.push({offset:e,color:t}),n}}}const fg={basis:{curve:function(e){return new pl(e)}},"basis-closed":{curve:function(e){return new ml(e)}},"basis-open":{curve:function(e){return new yl(e)}},bundle:{curve:bl,tension:"beta",value:.85},cardinal:{curve:wl,tension:"tension",value:0},"cardinal-open":{curve:Al,tension:"tension",value:0},"cardinal-closed":{curve:Ol,tension:"tension",value:0},"catmull-rom":{curve:Il,tension:"alpha",value:.5},"catmull-rom-closed":{curve:ql,tension:"alpha",value:.5},"catmull-rom-open":{curve:Hl,tension:"alpha",value:.5},linear:{curve:Vl},"linear-closed":{curve:function(e){return new Yl(e)}},monotone:{horizontal:function(e){return new ec(e)},vertical:function(e){return new Ql(e)}},natural:{curve:function(e){return new nc(e)}},step:{curve:function(e){return new ic(e,.5)}},"step-after":{curve:function(e){return new ic(e,1)}},"step-before":{curve:function(e){return new ic(e,0)}}};function dg(e,t,n){var r=ke(fg,e)&&fg[e],i=null;return r&&(i=r.curve||r[t||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}const hg={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},pg=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,gg=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,mg=/^((\s+,?\s*)|(,\s*))/,yg=/^[01]/;function vg(e){const t=[];return(e.match(pg)||[]).forEach((e=>{let n=e[0];const r=n.toLowerCase(),i=hg[r],o=function(e,t,n){const r=[];for(let i=0;t&&i1&&(g=Math.sqrt(g),n*=g,r*=g);const m=d/n,y=f/n,v=-f/r,b=d/r,x=m*s+y*u,_=v*s+b*u,w=m*e+y*t,k=v*e+b*t;let A=1/((w-x)*(w-x)+(k-_)*(k-_))-.25;A<0&&(A=0);let E=Math.sqrt(A);o==i&&(E=-E);const O=.5*(x+w)-E*(k-_),D=.5*(_+k)+E*(w-x),C=Math.atan2(_-D,x-O);let S=Math.atan2(k-D,w-O)-C;S<0&&1===o?S+=_g:S>0&&0===o&&(S-=_g);const F=Math.ceil(Math.abs(S/(xg+.001))),M=[];for(let e=0;e+e}function Ig(e,t,n){return Math.max(t,Math.min(e,n))}function Ug(){var e=Tg,t=zg,n=Rg,r=Pg,i=Lg(0),o=i,a=i,s=i,u=null;function l(l,c,f){var d,h=null!=c?c:+e.call(this,l),p=null!=f?f:+t.call(this,l),g=+n.call(this,l),m=+r.call(this,l),y=Math.min(g,m)/2,v=Ig(+i.call(this,l),0,y),b=Ig(+o.call(this,l),0,y),x=Ig(+a.call(this,l),0,y),_=Ig(+s.call(this,l),0,y);if(u||(u=d=dc()),v<=0&&b<=0&&x<=0&&_<=0)u.rect(h,p,g,m);else{var w=h+g,k=p+m;u.moveTo(h+v,p),u.lineTo(w-b,p),u.bezierCurveTo(w-Bg*b,p,w,p+Bg*b,w,p+b),u.lineTo(w,k-_),u.bezierCurveTo(w,k-Bg*_,w-Bg*_,k,w-_,k),u.lineTo(h+x,k),u.bezierCurveTo(h+Bg*x,k,h,k-Bg*x,h,k-x),u.lineTo(h,p+v),u.bezierCurveTo(h,p+Bg*v,h+Bg*v,p,h+v,p),u.closePath()}if(d)return u=null,d+""||null}return l.x=function(t){return arguments.length?(e=Lg(t),l):e},l.y=function(e){return arguments.length?(t=Lg(e),l):t},l.width=function(e){return arguments.length?(n=Lg(e),l):n},l.height=function(e){return arguments.length?(r=Lg(e),l):r},l.cornerRadius=function(e,t,n,r){return arguments.length?(i=Lg(e),o=null!=t?Lg(t):i,s=null!=n?Lg(n):i,a=null!=r?Lg(r):o,l):i},l.context=function(e){return arguments.length?(u=null==e?null:e,l):u},l}function qg(){var e,t,n,r,i,o,a,s,u=null;function l(e,t,n){const r=n/2;if(i){var l=a-t,c=e-o;if(l||c){var f=Math.hypot(l,c),d=(l/=f)*s,h=(c/=f)*s,p=Math.atan2(c,l);u.moveTo(o-d,a-h),u.lineTo(e-l*r,t-c*r),u.arc(e,t,r,p-Math.PI,p),u.lineTo(o+d,a+h),u.arc(o,a,s,p,p+Math.PI)}else u.arc(e,t,r,0,_g);u.closePath()}else i=1;o=e,a=t,s=r}function c(o){var a,s,c,f=o.length,d=!1;for(null==u&&(u=c=dc()),a=0;a<=f;++a)!(ae.x||0,Gg=e=>e.y||0,Vg=e=>!(!1===e.defined),Yg=function(){var e=pc,t=gc,n=oc(0),r=null,i=mc,o=yc,a=vc,s=null,u=hc(l);function l(){var l,c,f=+e.apply(this,arguments),d=+t.apply(this,arguments),h=i.apply(this,arguments)-Tl,p=o.apply(this,arguments)-Tl,g=Dl(p-h),m=p>h;if(s||(s=l=u()),dNl)if(g>zl-Nl)s.moveTo(d*Sl(h),d*jl(h)),s.arc(0,0,d,h,p,!m),f>Nl&&(s.moveTo(f*Sl(p),f*jl(p)),s.arc(0,0,f,p,h,m));else{var y,v,b=h,x=p,_=h,w=p,k=g,A=g,E=a.apply(this,arguments)/2,O=E>Nl&&(r?+r.apply(this,arguments):$l(f*f+d*d)),D=Ml(Dl(d-f)/2,+n.apply(this,arguments)),C=D,S=D;if(O>Nl){var F=Rl(O/f*jl(E)),M=Rl(O/d*jl(E));(k-=2*F)>Nl?(_+=F*=m?1:-1,w-=F):(k=0,_=w=(h+p)/2),(A-=2*M)>Nl?(b+=M*=m?1:-1,x-=M):(A=0,b=x=(h+p)/2)}var j=d*Sl(b),$=d*jl(b),N=f*Sl(w),B=f*jl(w);if(D>Nl){var T,z=d*Sl(x),R=d*jl(x),P=f*Sl(_),L=f*jl(_);if(g1?0:e<-1?Bl:Math.acos(e)}((I*q+U*W)/($l(I*I+U*U)*$l(q*q+W*W)))/2),G=$l(T[0]*T[0]+T[1]*T[1]);C=Ml(D,(f-G)/(H-1)),S=Ml(D,(d-G)/(H+1))}else C=S=0}A>Nl?S>Nl?(y=bc(P,L,j,$,d,S,m),v=bc(z,R,N,B,d,S,m),s.moveTo(y.cx+y.x01,y.cy+y.y01),SNl&&k>Nl?C>Nl?(y=bc(N,B,z,R,f,-C,m),v=bc(j,$,P,L,f,-C,m),s.lineTo(y.cx+y.x01,y.cy+y.y01),Ce.startAngle||0)).endAngle((e=>e.endAngle||0)).padAngle((e=>e.padAngle||0)).innerRadius((e=>e.innerRadius||0)).outerRadius((e=>e.outerRadius||0)).cornerRadius((e=>e.cornerRadius||0)),Xg=Ac().x(Hg).y1(Gg).y0((e=>(e.y||0)+(e.height||0))).defined(Vg),Zg=Ac().y(Gg).x1(Hg).x0((e=>(e.x||0)+(e.width||0))).defined(Vg),Jg=kc().x(Hg).y(Gg).defined(Vg),Kg=Ug().x(Hg).y(Gg).width((e=>e.width||0)).height((e=>e.height||0)).cornerRadius((e=>Wg(e.cornerRadiusTopLeft,e.cornerRadius)||0),(e=>Wg(e.cornerRadiusTopRight,e.cornerRadius)||0),(e=>Wg(e.cornerRadiusBottomRight,e.cornerRadius)||0),(e=>Wg(e.cornerRadiusBottomLeft,e.cornerRadius)||0)),Qg=function(e,t){let n=null,r=hc(i);function i(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return e="function"==typeof e?e:oc(e||Ec),t="function"==typeof t?t:oc(void 0===t?64:+t),i.type=function(t){return arguments.length?(e="function"==typeof t?t:oc(t),i):e},i.size=function(e){return arguments.length?(t="function"==typeof e?e:oc(+e),i):t},i.context=function(e){return arguments.length?(n=null==e?null:e,i):n},i}().type((e=>$g(e.shape||"circle"))).size((e=>Wg(e.size,64))),em=qg().x(Hg).y(Gg).defined(Vg).size((e=>e.size||1));function tm(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function nm(e,t,n,r){return Kg.context(e)(t,n,r)}var rm=1;function im(){rm=1}function om(e,t,n){var r=t.clip,i=e._defs,o=t.clip_id||(t.clip_id="clip"+rm++),a=i.clipping[o]||(i.clipping[o]={id:o});return ce(r)?a.path=r(null):tm(n)?a.path=nm(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function am(e){this.clear(),e&&this.union(e)}function sm(e){this.mark=e,this.bounds=this.bounds||new am}function um(e){sm.call(this,e),this.items=this.items||[]}am.prototype={clone(){return new am(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,r){return nthis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const r=this.rotatedPoints(e,t,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(e,t,n){var{x1:r,y1:i,x2:o,y2:a}=this,s=Math.cos(e),u=Math.sin(e),l=t-t*s+n*u,c=n-t*u-n*s;return[s*r-u*i+l,u*r+s*i+c,s*r-u*a+l,u*r+s*a+c,s*o-u*i+l,u*o+s*i+c,s*o-u*a+l,u*o+s*a+c]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},De(um,sm);class lm{constructor(e){this._pending=0,this._loader=e||Go()}pending(){return this._pending}sanitizeURL(e){const t=this;return cm(t),t._loader.sanitize(e,{context:"href"}).then((e=>(fm(t),e))).catch((()=>(fm(t),null)))}loadImage(e){const t=this,n=Dc();return cm(t),t._loader.sanitize(e,{context:"image"}).then((e=>{const r=e.href;if(!r||!n)throw{url:r};const i=new n,o=ke(e,"crossOrigin")?e.crossOrigin:"anonymous";return null!=o&&(i.crossOrigin=o),i.onload=()=>fm(t),i.onerror=()=>fm(t),i.src=r,i})).catch((e=>(fm(t),{complete:!1,width:0,height:0,src:e&&e.url||""})))}ready(){const e=this;return new Promise((t=>{!function n(r){e.pending()?setTimeout((()=>{n(!0)}),10):t(r)}(!1)}))}}function cm(e){e._pending+=1}function fm(e){e._pending-=1}function dm(e,t,n){if(t.stroke&&0!==t.opacity&&0!==t.strokeOpacity){const r=null!=t.strokeWidth?+t.strokeWidth:1;e.expand(r+(n?function(e,t){return e.strokeJoin&&"miter"!==e.strokeJoin?0:t}(t,r):0))}return e}const hm=_g-1e-8;let pm,gm,mm,ym,vm,bm,xm,_m;const wm=(e,t)=>pm.add(e,t),km=(e,t)=>wm(gm=e,mm=t),Am=e=>wm(e,pm.y1),Em=e=>wm(pm.x1,e),Om=(e,t)=>vm*e+xm*t,Dm=(e,t)=>bm*e+_m*t,Cm=(e,t)=>wm(Om(e,t),Dm(e,t)),Sm=(e,t)=>km(Om(e,t),Dm(e,t));function Fm(e,t){return pm=e,t?(ym=t*bg,vm=_m=Math.cos(ym),bm=Math.sin(ym),xm=-bm):(vm=_m=1,ym=bm=xm=0),Mm}const Mm={beginPath(){},closePath(){},moveTo:Sm,lineTo:Sm,rect(e,t,n,r){ym?(Cm(e+n,t),Cm(e+n,t+r),Cm(e,t+r),Sm(e,t)):(wm(e+n,t+r),km(e,t))},quadraticCurveTo(e,t,n,r){const i=Om(e,t),o=Dm(e,t),a=Om(n,r),s=Dm(n,r);jm(gm,i,a,Am),jm(mm,o,s,Em),km(a,s)},bezierCurveTo(e,t,n,r,i,o){const a=Om(e,t),s=Dm(e,t),u=Om(n,r),l=Dm(n,r),c=Om(i,o),f=Dm(i,o);$m(gm,a,u,c,Am),$m(mm,s,l,f,Em),km(c,f)},arc(e,t,n,r,i,o){if(r+=ym,i+=ym,gm=n*Math.cos(i)+e,mm=n*Math.sin(i)+t,Math.abs(i-r)>hm)wm(e-n,t-n),wm(e+n,t+n);else{const a=r=>wm(n*Math.cos(r)+e,n*Math.sin(r)+t);let s,u;if(a(r),a(i),i!==r)if((r%=_g)<0&&(r+=_g),(i%=_g)<0&&(i+=_g),ii;++u,s-=xg)a(s);else for(s=r-r%xg+xg,u=0;u<4&&s1e-14?(u=a*a+s*o,u>=0&&(u=Math.sqrt(u),l=(-a+u)/o,c=(-a-u)/o)):l=.5*s/a,0m)return!1;h>g&&(g=h)}else if(f>0){if(h0&&(e.globalAlpha=n,e.fillStyle=Hm(e,t,t.fill),!0)}var Vm=[];function Ym(e,t,n){var r=null!=(r=t.strokeWidth)?r:1;return!(r<=0)&&(n*=null==t.strokeOpacity?1:t.strokeOpacity)>0&&(e.globalAlpha=n,e.strokeStyle=Hm(e,t,t.stroke),e.lineWidth=r,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||Vm),e.lineDashOffset=t.strokeDashOffset||0),!0)}function Xm(e,t){return e.zindex-t.zindex||e.index-t.index}function Zm(e){if(!e.zdirty)return e.zitems;var t,n,r,i=e.items,o=[];for(n=0,r=i.length;n=0;)if(n=t(i[r]))return n;if(i===o)for(r=(i=e.items).length;--r>=0;)if(!i[r].zindex&&(n=t(i[r])))return n;return null}function Qm(e){return function(t,n,r){Jm(n,(n=>{r&&!r.intersects(n.bounds)||ty(e,t,n,n)}))}}function ey(e){return function(t,n,r){!n.items.length||r&&!r.intersects(n.bounds)||ty(e,t,n.items[0],n.items)}}function ty(e,t,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(e(t,r)||(Um(t,n),n.fill&&Gm(t,n,i)&&t.fill(),n.stroke&&Ym(t,n,i)&&t.stroke()))}function ny(e){return e=e||C,function(t,n,r,i,o,a){return r*=t.pixelRatio,i*=t.pixelRatio,Km(n,(n=>{const s=n.bounds;if((!s||s.contains(o,a))&&s)return e(t,n,r,i,o,a)?n:void 0}))}}function ry(e,t){return function(n,r,i,o){var a,s,u=Array.isArray(r)?r[0]:r,l=null==t?u.fill:t,c=u.stroke&&n.isPointInStroke;return c&&(a=u.strokeWidth,s=u.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=s?s:"butt"),!e(n,r)&&(l&&n.isPointInPath(i,o)||c&&n.isPointInStroke(i,o))}}function iy(e){return ny(ry(e))}function oy(e,t){return"translate("+e+","+t+")"}function ay(e){return"rotate("+e+")"}function sy(e){return oy(e.x||0,e.y||0)}function uy(e,t,n){function r(e,n){var r=n.x||0,i=n.y||0,o=n.angle||0;e.translate(r,i),o&&e.rotate(o*=bg),e.beginPath(),t(e,n),o&&e.rotate(-o),e.translate(-r,-i)}return{type:e,tag:"path",nested:!1,attr:function(e,n){e("transform",function(e){return oy(e.x||0,e.y||0)+(e.angle?" "+ay(e.angle):"")}(n)),e("d",t(null,n))},bound:function(e,n){return t(Fm(e,n.angle),n),dm(e,n).translate(n.x||0,n.y||0)},draw:Qm(r),pick:iy(r),isect:n||zm(r)}}var ly=uy("arc",(function(e,t){return Yg.context(e)(t)}));function cy(e,t,n){function r(e,n){e.beginPath(),t(e,n)}const i=ry(r);return{type:e,tag:"path",nested:!0,attr:function(e,n){var r=n.mark.items;r.length&&e("d",t(null,r))},bound:function(e,n){var r=n.items;return 0===r.length?e:(t(Fm(e),r),dm(e,r[0]))},draw:ey(r),pick:function(e,t,n,r,o,a){var s=t.items,u=t.bounds;return!s||!s.length||u&&!u.contains(o,a)?null:(n*=e.pixelRatio,r*=e.pixelRatio,i(e,s,n,r)?s[0]:null)},isect:Rm,tip:n}}var fy=cy("area",(function(e,t){const n=t[0],r=n.interpolate||"linear";return("horizontal"===n.orient?Zg:Xg).curve(dg(r,n.orient,n.tension)).context(e)(t)}),(function(e,t){for(var n,r,i="horizontal"===e[0].orient?t[1]:t[0],o="horizontal"===e[0].orient?"y":"x",a=e.length,s=1/0;--a>=0;)!1!==e[a].defined&&(r=Math.abs(e[a][o]-i)).5&&t<1.5?.5-Math.abs(t-1):0}function py(e,t){const n=hy(t);e("d",nm(null,t,n,n))}function gy(e,t,n,r){const i=hy(t);e.beginPath(),nm(e,t,(n||0)+i,(r||0)+i)}const my=ry(gy),yy=ry(gy,!1),vy=ry(gy,!0);var by={type:"group",tag:"g",nested:!1,attr:function(e,t){e("transform",sy(t))},bound:function(e,t){if(!t.clip&&t.items){const n=t.items,r=n.length;for(let t=0;t{const i=t.x||0,o=t.y||0,a=t.strokeForeground,s=null==t.opacity?1:t.opacity;(t.stroke||t.fill)&&s&&(gy(e,t,i,o),Um(e,t),t.fill&&Gm(e,t,s)&&e.fill(),t.stroke&&!a&&Ym(e,t,s)&&e.stroke()),e.save(),e.translate(i,o),t.clip&&dy(e,t),n&&n.translate(-i,-o),Jm(t,(t=>{("group"===t.marktype||null==r||r.includes(t.marktype))&&this.draw(e,t,n,r)})),n&&n.translate(i,o),e.restore(),a&&t.stroke&&s&&(gy(e,t,i,o),Um(e,t),Ym(e,t,s)&&e.stroke())}))},pick:function(e,t,n,r,i,o){if(t.bounds&&!t.bounds.contains(i,o)||!t.items)return null;const a=n*e.pixelRatio,s=r*e.pixelRatio;return Km(t,(u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(i,o))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(ih||op))return;if(e.save(),e.translate(c,f),c=i-c,f=o-f,g&&tm(u)&&!vy(e,u,a,s))return e.restore(),null;const m=u.strokeForeground,y=!1!==t.interactive;return y&&m&&u.stroke&&yy(e,u,a,s)?(e.restore(),u):(l=Km(u,(e=>function(e,t,n){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,n)}(e,c,f)?this.pick(e,n,r,c,f):null)),!l&&y&&(u.fill||!m&&u.stroke)&&my(e,u,a,s)&&(l=u),e.restore(),l||null)}))},isect:Pm,content:function(e,t,n){e("clip-path",t.clip?om(n,t,t):null)},background:function(e,t){e("class","background"),e("aria-hidden",!0),py(e,t)},foreground:function(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?py(e,t):e("d","")}},xy={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function _y(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then((t=>{e.image=t,e.image.url=e.url}))),n}function wy(e,t){return null!=e.width?e.width:t&&t.width?!1!==e.aspect&&e.height?e.height*t.width/t.height:t.width:0}function ky(e,t){return null!=e.height?e.height:t&&t.height?!1!==e.aspect&&e.width?e.width*t.height/t.width:t.height:0}function Ay(e,t){return"center"===e?t/2:"right"===e?t:0}function Ey(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var Oy={type:"image",tag:"image",nested:!1,attr:function(e,t,n){const r=_y(t,n),i=wy(t,r),o=ky(t,r),a=(t.x||0)-Ay(t.align,i),s=(t.y||0)-Ey(t.baseline,o);e("href",!r.src&&r.toDataURL?r.toDataURL():r.src||"",xy["xmlns:xlink"],"xlink:href"),e("transform",oy(a,s)),e("width",i),e("height",o),e("preserveAspectRatio",!1===t.aspect?"none":"xMidYMid")},bound:function(e,t){const n=t.image,r=wy(t,n),i=ky(t,n),o=(t.x||0)-Ay(t.align,r),a=(t.y||0)-Ey(t.baseline,i);return e.set(o,a,o+r,a+i)},draw:function(e,t,n){Jm(t,(t=>{if(n&&!n.intersects(t.bounds))return;const r=_y(t,this);let i=wy(t,r),o=ky(t,r);if(0===i||0===o)return;let a,s,u,l,c=(t.x||0)-Ay(t.align,i),f=(t.y||0)-Ey(t.baseline,o);!1!==t.aspect&&(s=r.width/r.height,u=t.width/t.height,s==s&&u==u&&s!==u&&(u=0;)if(!1!==e[o].defined&&(n=e[o].x-t[0])*n+(r=e[o].y-t[1])*r{if(!n||n.intersects(t.bounds)){var r=null==t.opacity?1:t.opacity;r&&jy(e,t,r)&&(Um(e,t),e.stroke())}}))},pick:ny((function(e,t,n,r){return!!e.isPointInStroke&&jy(e,t,1)&&e.isPointInStroke(n,r)})),isect:Lm},Ny=uy("shape",(function(e,t){return(t.mark.shape||t.shape).context(e)(t)})),By=uy("symbol",(function(e,t){return Qg.context(e)(t)}),Rm);const Ty=Re();var zy={height:qy,measureWidth:Iy,estimateWidth:Py,width:Py,canvas:Ry};function Ry(e){zy.width=e&&Bm?Iy:Py}function Py(e,t){return Ly(Vy(e,t),qy(e))}function Ly(e,t){return~~(.8*e.length*t)}function Iy(e,t){return qy(e)<=0||!(t=Vy(e,t))?0:Uy(t,Xy(e))}function Uy(e,t){const n=`(${t}) ${e}`;let r=Ty.get(n);return void 0===r&&(Bm.font=t,r=Bm.measureText(e).width,Ty.set(n,r)),r}function qy(e){return null!=e.fontSize?+e.fontSize||0:11}function Wy(e){return null!=e.lineHeight?e.lineHeight:qy(e)+2}function Hy(e){return t=e.lineBreak&&e.text&&!z(e.text)?e.text.split(e.lineBreak):e.text,z(t)?t.length>1?t:t[0]:t;var t}function Gy(e){const t=Hy(e);return(z(t)?t.length-1:0)*Wy(e)}function Vy(e,t){const n=null==t?"":(t+"").trim();return e.limit>0&&n.length?function(e,t){var n=+e.limit,r=function(e){if(zy.width===Iy){const t=Xy(e);return e=>Uy(e,t)}if(zy.width===Py){const t=qy(e);return e=>Ly(e,t)}return t=>zy.width(e,t)}(e);if(r(t)>>1,r(t.slice(i))>n?s=i+1:u=i;return o+t.slice(s)}for(;s>>1),r(t.slice(0,i))Math.max(e,zy.width(t,n))),0)):r=zy.width(t,f),"center"===o?l-=r/2:"right"===o&&(l-=r),e.set(l+=s,c+=u,l+r,c+i),t.angle&&!n)e.rotate(t.angle*bg,s,u);else if(2===n)return e.rotatedPoints(t.angle*bg,s,u);return e}var tv={type:"text",tag:"text",nested:!1,attr:function(e,t){var n,r=t.dx||0,i=(t.dy||0)+Zy(t),o=Qy(t),a=o.x1,s=o.y1,u=t.angle||0;e("text-anchor",Jy[t.align]||"start"),u?(n=oy(a,s)+" "+ay(u),(r||i)&&(n+=" "+oy(r,i))):n=oy(a+r,s+i),e("transform",n)},bound:ev,draw:function(e,t,n){Jm(t,(t=>{var r,i,o,a,s,u,l,c=null==t.opacity?1:t.opacity;if(!(n&&!n.intersects(t.bounds)||0===c||t.fontSize<=0||null==t.text||0===t.text.length)){if(e.font=Xy(t),e.textAlign=t.align||"left",i=(r=Qy(t)).x1,o=r.y1,t.angle&&(e.save(),e.translate(i,o),e.rotate(t.angle*bg),i=o=0),i+=t.dx||0,o+=(t.dy||0)+Zy(t),u=Hy(t),Um(e,t),z(u))for(s=Wy(t),a=0;a=0;)if(!1!==e[i].defined&&(n=e[i].x-t[0])*n+(r=e[i].y-t[1])*r<(n=e[i].size||1)*n)return e[i];return null})),rv={arc:ly,area:fy,group:by,image:Oy,line:Dy,path:Sy,rect:My,rule:$y,shape:Ny,symbol:By,text:tv,trail:nv};function iv(e,t,n){var r=rv[e.mark.marktype],i=t||r.bound;return r.nested&&(e=e.mark),i(e.bounds||(e.bounds=new am),e,n)}var ov={mark:null};function av(e,t,n){var r,i,o,a,s=rv[e.marktype],u=s.bound,l=e.items,c=l&&l.length;if(s.nested)return c?o=l[0]:(ov.mark=e,o=ov),a=iv(o,u,n),t&&t.union(a)||a;if(t=t||e.bounds&&e.bounds.clear()||new am,c)for(r=0,i=l.length;rt;)e.removeChild(n[--r]);return e}function yv(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function vv(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}class bv{constructor(e,t){this._active=null,this._handlers={},this._loader=e||Go(),this._tooltip=t||xv}initialize(e,t,n){return this._el=e,this._obj=n||null,this.origin(t)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()}scene(e){return arguments.length?(this._scene=e,this):this._scene}on(){}off(){}_handlerIndex(e,t,n){for(let r=e?e.length:0;--r>=0;)if(e[r].type===t&&(!n||e[r].handler===n))return r;return-1}handlers(e){const t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(const e in t)n.push(...t[e]);return n}eventName(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)}handleHref(e,t,n){this._loader.sanitize(n,{context:"href"}).then((t=>{const n=new MouseEvent(e.type,e),r=hv(null,"a");for(const e in t)r.setAttribute(e,t[e]);r.dispatchEvent(n)})).catch((()=>{}))}handleTooltip(e,t,n){if(t&&null!=t.tooltip){t=function(e,t,n,r){var i,o,a=e&&e.mark;if(a&&(i=rv[a.marktype]).tip){for((o=vv(t,n))[0]-=r[0],o[1]-=r[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=i.tip(a.items,o)}return e}(t,e,this.canvas(),this._origin);const r=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,r)}}getItemBoundingClientRect(e){const t=this.canvas();if(!t)return;const n=t.getBoundingClientRect(),r=this._origin,i=e.bounds,o=i.width(),a=i.height();let s=i.x1+r[0]+n.left,u=i.y1+r[1]+n.top;for(;e.mark&&(e=e.mark.group);)s+=e.x||0,u+=e.y||0;return{x:s,y:u,width:o,height:a,left:s,top:u,right:s+o,bottom:u+a}}}function xv(e,t,n,r){e.element().setAttribute("title",r||"")}class _v{constructor(e){this._el=null,this._bgcolor=null,this._loader=new lm(e)}initialize(e,t,n,r,i){return this._el=e,this.resize(t,n,r,i)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(e){return 0===arguments.length?this._bgcolor:(this._bgcolor=e,this)}resize(e,t,n,r){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=r||1,this}dirty(){}render(e,t){const n=this;return n._call=function(){n._render(e,t)},n._call(),n._call=null,n}_render(){}renderAsync(e,t){const n=this.render(e,t);return this._ready?this._ready.then((()=>n)):Promise.resolve(n)}_load(e,t){var n=this,r=n._loader[e](t);if(!n._ready){const e=n._call;n._ready=n._loader.ready().then((t=>{t&&e(),n._ready=null}))}return r}sanitizeURL(e){return this._load("sanitizeURL",e)}loadImage(e){return this._load("loadImage",e)}}const wv="dragenter",kv="dragleave",Av="dragover",Ev="pointerdown",Ov="pointermove",Dv="pointerout",Cv="pointerover",Sv="mousedown",Fv="mousemove",Mv="mouseout",jv="mouseover",$v="click",Nv="mousewheel",Bv="touchstart",Tv="touchmove",zv="touchend",Rv=["keydown","keypress","keyup",wv,kv,Av,Ev,"pointerup",Ov,Dv,Cv,Sv,"mouseup",Fv,Mv,jv,$v,"dblclick","wheel",Nv,Bv,Tv,zv],Pv=Ov,Lv=Mv,Iv=$v;class Uv extends bv{constructor(e,t){super(e,t),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=Rv,this.pointermove=Gv([Ov,Fv],[Cv,jv],[Dv,Mv]),this.dragover=Gv([Av],[wv],[kv]),this.pointerout=Vv([Dv,Mv]),this.dragleave=Vv([kv])}initialize(e,t,n){return this._canvas=e&&pv(e,"canvas"),[$v,Sv,Ev,Ov,Dv,kv].forEach((e=>Wv(this,e))),super.initialize(e,t,n)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(e){this.fire(Nv,e)}pointerdown(e){this._down=this._active,this.fire(Ev,e)}mousedown(e){this._down=this._active,this.fire(Sv,e)}click(e){this._down===this._active&&(this.fire($v,e),this._down=null)}touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Bv,e,!0)}touchmove(e){this.fire(Tv,e,!0)}touchend(e){this.fire(zv,e,!0),this._touch=null}fire(e,t,n){const r=n?this._touch:this._active,i=this._handlers[e];if(t.vegaType=e,e===Iv&&r&&r.href?this.handleHref(t,r,r.href):e!==Pv&&e!==Lv||this.handleTooltip(t,r,e!==Lv),i)for(let e=0,n=i.length;e=0&&r.splice(i,1),this}pickEvent(e){const t=vv(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])}pick(e,t,n,r,i){const o=this.context();return rv[e.marktype].pick.call(this,o,e,t,n,r,i)}}const qv=e=>e===Bv||e===Tv||e===zv?[Bv,Tv,zv]:[e];function Wv(e,t){qv(t).forEach((t=>function(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?n=>e[t](n):n=>e.fire(t,n)))}(e,t)))}function Hv(e,t,n){t.forEach((t=>e.fire(t,n)))}function Gv(e,t,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i||(i&&i.exit||Hv(this,n,r),this._active=o,Hv(this,t,r)),Hv(this,e,r)}}function Vv(e){return function(t){Hv(this,e,t),this._active=null}}class Yv extends _v{constructor(e){super(e),this._options={},this._redraw=!1,this._dirty=new am,this._tempb=new am}initialize(e,t,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:Oc(1,1,this._options.type),e&&this._canvas&&(mv(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(e,t,n,r,i)}resize(e,t,n,r){if(super.resize(e,t,n,r),this._canvas)!function(e,t,n,r,i,o){const a="undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,s=e.getContext("2d"),u=a?"undefined"!=typeof window&&window.devicePixelRatio||1:i;e.width=t*u,e.height=n*u;for(const e in o)s[e]=o[e];a&&1!==u&&(e.style.width=t+"px",e.style.height=n+"px"),s.pixelRatio=u,s.setTransform(u,0,0,u,u*r[0],u*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const e=this._options.externalContext;e||_("CanvasRenderer is missing a valid canvas or context"),e.scale(this._scale,this._scale),e.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)}_render(e,t){const n=this.context(),r=this._origin,i=this._width,o=this._height,a=this._dirty,s=Xv(r,i,o);n.save();const u=this._redraw||a.empty()?(this._redraw=!1,s.expand(1)):function(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-n[0]%1,-n[1]%1),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}(n,s.intersect(a),r);return this.clear(-r[0],-r[1],i,o),this.draw(n,e,u,t),n.restore(),a.clear(),this}draw(e,t,n,r){if("group"!==t.marktype&&null!=r&&!r.includes(t.marktype))return;const i=rv[t.marktype];t.clip&&function(e,t){var n=t.clip;e.save(),ce(n)?(e.beginPath(),n(e),e.clip()):dy(e,t.group)}(e,t),i.draw.call(this,e,t,n,r),t.clip&&e.restore()}clear(e,t,n,r){const i=this._options,o=this.context();"pdf"===i.type||i.externalContext||o.clearRect(e,t,n,r),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(e,t,n,r))}}const Xv=(e,t,n)=>(new am).set(0,0,t,n).translate(-e[0],-e[1]);class Zv extends bv{constructor(e,t){super(e,t);const n=this;n._hrefHandler=Jv(n,((e,t)=>{t&&t.href&&n.handleHref(e,t,t.href)})),n._tooltipHandler=Jv(n,((e,t)=>{n.handleTooltip(e,t,e.type!==Lv)}))}initialize(e,t,n){let r=this._svg;return r&&(r.removeEventListener(Iv,this._hrefHandler),r.removeEventListener(Pv,this._tooltipHandler),r.removeEventListener(Lv,this._tooltipHandler)),this._svg=r=e&&pv(e,"svg"),r&&(r.addEventListener(Iv,this._hrefHandler),r.addEventListener(Pv,this._tooltipHandler),r.addEventListener(Lv,this._tooltipHandler)),super.initialize(e,t,n)}canvas(){return this._svg}on(e,t){const n=this.eventName(e),r=this._handlers;if(this._handlerIndex(r[n],e,t)<0){const i={type:e,handler:t,listener:Jv(this,t)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this}off(e,t){const n=this.eventName(e),r=this._handlers[n],i=this._handlerIndex(r,e,t);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}}const Jv=(e,t)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,t.call(e._obj,n,r)},Kv="aria-hidden",Qv="aria-label",eb="role",tb="aria-roledescription",nb="graphics-object",rb="graphics-symbol",ib=(e,t,n)=>({[eb]:e,[tb]:t,[Qv]:n||void 0}),ob=Ye(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),ab={axis:{desc:"axis",caption:function(e){const t=e.datum,n=e.orient,r=t.title?fb(e):null,i=e.context,o=i.scales[t.scale].value,a=i.dataflow.locale(),s=o.type;return("left"===n||"right"===n?"Y":"X")+"-axis"+(r?` titled '${r}'`:"")+` for a ${kp(s)?"discrete":s} scale`+` with ${ig(a,o,e)}`}},legend:{desc:"legend",caption:function(e){const t=e.datum,n=t.title?fb(e):null,r=`${t.type||""} legend`.trim(),i=t.scales,o=Object.keys(i),a=e.context,s=a.scales[i[o[0]]].value,u=a.dataflow.locale();return((l=r).length?l[0].toUpperCase()+l.slice(1):l)+(n?` titled '${n}'`:"")+` for ${function(e){return(e=e.map((e=>e+("fill"===e||"stroke"===e?" color":"")))).length<2?e[0]:e.slice(0,-1).join(", ")+" and "+q(e)}(o)}`+` with ${ig(u,s,e)}`;var l}},"title-text":{desc:"title",caption:e=>`Title text '${cb(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${cb(e)}'`}},sb={ariaRole:eb,ariaRoleDescription:tb,description:Qv};function ub(e,t){const n=!1===t.aria;if(e(Kv,n||void 0),n||null==t.description)for(const t in sb)e(sb[t],void 0);else{const n=t.mark.marktype;e(Qv,t.description),e(eb,t.ariaRole||("group"===n?nb:rb)),e(tb,t.ariaRoleDescription||`${n} mark`)}}function lb(e){return!1===e.aria?{[Kv]:!0}:ob[e.role]?null:ab[e.role]?function(e,t){try{const n=e.items[0],r=t.caption||(()=>"");return ib(t.role||rb,t.desc,n.description||r(n))}catch(e){return null}}(e,ab[e.role]):function(e){const t=e.marktype,n="group"===t||"text"===t||e.items.some((e=>null!=e.description&&!1!==e.aria));return ib(n?nb:rb,`${t} mark container`,e.description)}(e)}function cb(e){return ue(e.text).join(" ")}function fb(e){try{return ue(q(e.items).items[0].text).join(" ")}catch(e){return null}}const db=e=>(e+"").replace(/&/g,"&").replace(//g,">"),hb=e=>db(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function pb(){let e="",t="",n="";const r=[],i=()=>t=n="",o=(e,n)=>(null!=n&&(t+=` ${e}="${hb(n)}"`),a),a={open(s){(o=>{t&&(e+=`${t}>${n}`,i()),r.push(o)})(s),t="<"+s;for(var u=arguments.length,l=new Array(u>1?u-1:0),c=1;c${n}`:"/>"):``,i(),a},attr:o,text:e=>(n+=db(e),a),toString:()=>e};return a}const gb=e=>mb(pb(),e)+"";function mb(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,r=n.length;for(let t=0;t{e.dirty=t}))),r.zdirty||(n.exit?(o.nested&&r.items.length?(u=r.items[0],u._svg&&this._update(o,u._svg,u)):n._svg&&(u=n._svg.parentNode,u&&u.removeChild(n._svg)),n._svg=null):(n=o.nested?r.items[0]:n,n._update!==t&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,kb(n,t)),n._update=t)));return!this._dirtyAll}mark(e,t,n,r){if(!this.isDirty(t))return t._svg;const i=this._svg,o=t.marktype,a=rv[o],s=!1===t.interactive?"none":null,u="g"===a.tag,l=Ob(t,e,n,"g",i);if("group"!==o&&null!=r&&!r.includes(o))return mv(l,0),t._svg;l.setAttribute("class",yv(t));const c=lb(t);for(const e in c)$b(l,e,c[e]);u||$b(l,"pointer-events",s),$b(l,"clip-path",t.clip?om(this,t,t.group):null);let f=null,d=0;const h=e=>{const t=this.isDirty(e),n=Ob(e,l,f,a.tag,i);t&&(this._update(a,n,e),u&&function(e,t,n,r){t=t.lastChild.previousSibling;let i,o=0;Jm(n,(n=>{i=e.mark(t,n,i,r),++o})),mv(t,1+o)}(this,n,e,r)),f=n,++d};return a.nested?t.items.length&&h(t.items[0]):Jm(t,h),mv(l,d),l}_update(e,t,n){Db=t,Cb=t.__values__,ub(Fb,n),e.attr(Fb,n,this);const r=Sb[e.type];r&&r.call(this,e,t,n),Db&&this.style(Db,n)}style(e,t){if(null!=t){for(const n in yb){let r="font"===n?Yy(t):t[n];if(r===Cb[n])continue;const i=yb[n];null==r?e.removeAttribute(i):(sg(r)&&(r=ug(r,this._defs.gradient,Nb())),e.setAttribute(i,r+"")),Cb[n]=r}for(const n in vb)Mb(e,vb[n],t[n])}}defs(){const e=this._svg,t=this._defs;let n=t.el,r=0;for(const i in t.gradient)n||(t.el=n=gv(e,1,"defs",_b)),r=Ab(n,t.gradient[i],r);for(const i in t.clipping)n||(t.el=n=gv(e,1,"defs",_b)),r=Eb(n,t.clipping[i],r);n&&(0===r?(e.removeChild(n),t.el=null):mv(n,r))}_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}}function kb(e,t){for(;e&&e.dirty!==t;e=e.mark.group){if(e.dirty=t,!e.mark||e.mark.dirty===t)return;e.mark.dirty=t}}function Ab(e,t,n){let r,i,o;if("radial"===t.gradient){let r=gv(e,n++,"pattern",_b);jb(r,{id:ag+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),r=gv(r,0,"rect",_b),jb(r,{width:1,height:1,fill:`url(${Nb()}#${t.id})`}),jb(e=gv(e,n++,"radialGradient",_b),{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else jb(e=gv(e,n++,"linearGradient",_b),{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(r=0,i=t.stops.length;r1&&e.previousSibling!=t}(a,n))&&t.insertBefore(a,n?n.nextSibling:t.firstChild),a}let Db=null,Cb=null;const Sb={group(e,t,n){const r=Db=t.childNodes[2];Cb=r.__values__,e.foreground(Fb,n,this),Cb=t.__values__,Db=t.childNodes[1],e.content(Fb,n,this);const i=Db=t.childNodes[0];e.background(Fb,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==Cb.events&&($b(r,"pointer-events",o),$b(i,"pointer-events",o),Cb.events=o),n.strokeForeground&&n.stroke){const e=n.fill;$b(r,"display",null),this.style(i,n),$b(i,"stroke",null),e&&(n.fill=null),Cb=r.__values__,this.style(r,n),e&&(n.fill=e),Db=null}else $b(r,"display","none")},image(e,t,n){!1===n.smooth?(Mb(t,"image-rendering","optimizeSpeed"),Mb(t,"image-rendering","pixelated")):Mb(t,"image-rendering",null)},text(e,t,n){const r=Hy(n);let i,o,a,s;z(r)?(o=r.map((e=>Vy(n,e))),i=o.join("\n"),i!==Cb.text&&(mv(t,0),a=t.ownerDocument,s=Wy(n),o.forEach(((e,r)=>{const i=hv(a,"tspan",_b);i.__data__=n,i.textContent=e,r&&(i.setAttribute("x",0),i.setAttribute("dy",s)),t.appendChild(i)})),Cb.text=i)):(o=Vy(n,r),o!==Cb.text&&(t.textContent=o,Cb.text=o)),$b(t,"font-family",Yy(n)),$b(t,"font-size",qy(n)+"px"),$b(t,"font-style",n.fontStyle),$b(t,"font-variant",n.fontVariant),$b(t,"font-weight",n.fontWeight)}};function Fb(e,t,n){t!==Cb[e]&&(n?function(e,t,n,r){null!=n?e.setAttributeNS(r,t,n):e.removeAttributeNS(r,t)}(Db,e,t,n):$b(Db,e,t),Cb[e]=t)}function Mb(e,t,n){n!==Cb[t]&&(null==n?e.style.removeProperty(t):e.style.setProperty(t,n+""),Cb[t]=n)}function jb(e,t){for(const n in t)$b(e,n,t[n])}function $b(e,t,n){null!=n?e.setAttribute(t,n):e.removeAttribute(t)}function Nb(){let e;return"undefined"==typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class Bb extends _v{constructor(e){super(e),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(e){const t=pb();t.open("svg",be({},xy,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",bb,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this}mark(e,t){const n=rv[t.marktype],r=n.tag,i=[ub,n.attr];e.open("g",{class:yv(t),"clip-path":t.clip?om(this,t,t.group):null},lb(t),{"pointer-events":"g"!==r&&!1===t.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&e.open("a",a),e.open(r,this.attr(t,o,i,"g"!==r?r:null)),"text"===r){const t=Hy(o);if(z(t)){const n={x:0,dy:Wy(o)};for(let r=0;rthis.mark(e,t))),e.close(),r&&a?(i&&(o.fill=null),o.stroke=a,e.open("path",this.attr(t,o,n.foreground,"bgrect")).close(),i&&(o.fill=i)):e.open("path",this.attr(t,o,n.foreground,"bgfore")).close()}e.close(),a&&e.close()};return n.nested?t.items&&t.items.length&&o(t.items[0]):Jm(t,o),e.close()}href(e){const t=e.href;let n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then((e=>{e["xlink:href"]=e.href,e.href=null,(this._hrefs||(this._hrefs={}))[t]=e}))}return null}attr(e,t,n,r){const i={},o=(e,t,n,r)=>{i[r||e]=t};return Array.isArray(n)?n.forEach((e=>e(o,t,this))):n(o,t,this),r&&function(e,t,n,r,i){let o;if(null==t)return e;if("bgrect"===r&&!1===n.interactive&&(e["pointer-events"]="none"),"bgfore"===r&&(!1===n.interactive&&(e["pointer-events"]="none"),e.display="none",null!==t.fill))return e;"image"===r&&!1===t.smooth&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),"text"===r&&(e["font-family"]=Yy(t),e["font-size"]=qy(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const n in yb){let r=t[n];const o=yb[n];("transparent"!==r||"fill"!==o&&"stroke"!==o)&&null!=r&&(sg(r)&&(r=ug(r,i.gradient,"")),e[o]=r)}for(const e in vb){const n=t[e];null!=n&&(o=o||[],o.push(`${vb[e]}: ${n};`))}o&&(e.style=o.join(" "))}(i,t,e,r,this._defs),i}defs(e){const t=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(t).length+Object.keys(n).length){e.open("defs");for(const n in t){const r=t[n],i=r.stops;"radial"===r.gradient?(e.open("pattern",{id:ag+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),e.close(),e.open("radialGradient",{id:n,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):e.open("linearGradient",{id:n,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2});for(let t=0;t!Tb.svgMarkTypes.includes(e)));this._svgRenderer.render(e,Tb.svgMarkTypes),this._canvasRenderer.render(e,n)}resize(e,t,n,r){return super.resize(e,t,n,r),this._svgRenderer.resize(e,t,n,r),this._canvasRenderer.resize(e,t,n,r),this}background(e){return Tb.svgOnTop?this._canvasRenderer.background(e):this._svgRenderer.background(e),this}}class Pb extends Uv{constructor(e,t){super(e,t)}initialize(e,t,n){const r=gv(gv(e,0,"div"),Tb.svgOnTop?0:1,"div");return super.initialize(r,t,n)}}const Lb="canvas",Ib="hybrid",Ub="none",qb={Canvas:Lb,PNG:"png",SVG:"svg",Hybrid:Ib,None:Ub},Wb={};function Hb(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Wb[e]=t,this):Wb[e]}function Gb(e,t,n){const r=[],i=(new am).union(t),o=e.marktype;return o?Vb(e,i,n,r):"group"===o?Yb(e,i,n,r):_("Intersect scene must be mark node or group item.")}function Vb(e,t,n,r){if(function(e,t,n){return e.bounds&&t.intersects(e.bounds)&&("group"===e.marktype||!1!==e.interactive&&(!n||n(e)))}(e,t,n)){const i=e.items,o=e.marktype,a=i.length;let s=0;if("group"===o)for(;s=0;r--)if(i[r]!=o[r])return!1;for(r=i.length-1;r>=0;r--)if(!Qb(e[n=i[r]],t[n],n))return!1;return typeof e==typeof t}(e,t):e==t)}function ex(e,t){return Qb(vg(e),vg(t))}function tx(){im(),og=0}const nx="top",rx="left",ix="right",ox="bottom",ax="start",sx="middle",ux="end",lx="x",cx="y",fx="group",dx="axis",hx="title",px="legend",gx="row-header",mx="row-footer",yx="row-title",vx="column-header",bx="column-footer",xx="column-title",_x="fit-x",wx="fit-y",kx="none",Ax="all",Ex="each",Ox="flush",Dx="column",Cx="row";function Sx(e){Fa.call(this,null,e)}function Fx(e,t,n){return t(e.bounds.clear(),e,n)}De(Sx,Fa,{transform(e,t){const n=t.dataflow,r=e.mark,i=r.marktype,o=rv[i],a=o.bound;let s,u=r.bounds;if(o.nested)r.items.length&&n.dirty(r.items[0]),u=Fx(r,a),r.items.forEach((e=>{e.bounds.clear().union(u)}));else if(i===fx||e.modified())switch(t.visit(t.MOD,(e=>n.dirty(e))),u.clear(),r.items.forEach((e=>u.union(Fx(e,a)))),r.role){case dx:case px:case hx:t.reflow()}else s=t.changed(t.REM),t.visit(t.ADD,(e=>{u.union(Fx(e,a))})),t.visit(t.MOD,(e=>{s=s||u.alignsWith(e.bounds),n.dirty(e),u.union(Fx(e,a))})),s&&(u.clear(),r.items.forEach((e=>u.union(e.bounds))));return Jb(r),t.modifies("bounds")}});const Mx=":vega_identifier:";function jx(e){Fa.call(this,0,e)}function $x(e){Fa.call(this,null,e)}function Nx(e){Fa.call(this,null,e)}jx.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},De(jx,Fa,{transform(e,t){const n=(i=t.dataflow)._signals[Mx]||(i._signals[Mx]=i.add(0)),r=e.as;var i;let o=n.value;return t.visit(t.ADD,(e=>e[r]=e[r]||++o)),n.set(this.value=o),t}}),De($x,Fa,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,function(e){const t=e.groups,n=e.parent;return t&&1===t.size?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const r=n.marktype===fx?um:sm;return t.visit(t.ADD,(e=>r.call(e,n))),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});const Bx={parity:e=>e.filter(((e,t)=>t%2?e.opacity=0:1)),greedy:(e,t)=>{let n;return e.filter(((e,r)=>r&&Tx(n.bounds,e.bounds,t)?e.opacity=0:(n=e,1)))}},Tx=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),zx=(e,t)=>{for(var n,r=1,i=e.length,o=e[0].bounds;r{const t=e.bounds;return t.width()>1&&t.height()>1},Px=e=>(e.forEach((e=>e.opacity=1)),e),Lx=(e,t)=>e.reflow(t.modified()).modifies("opacity");function Ix(e){Fa.call(this,null,e)}De(Nx,Fa,{transform(e,t){const n=Bx[e.method]||Bx.parity,r=e.separation||0;let i,o,a=t.materialize(t.SOURCE).source;if(!a||!a.length)return;if(!e.method)return e.modified("method")&&(Px(a),t=Lx(t,e)),t;if(a=a.filter(Rx),!a.length)return;if(e.sort&&(a=a.slice().sort(e.sort)),i=Px(a),t=Lx(t,e),i.length>=3&&zx(i,r)){do{i=n(i,r)}while(i.length>=3&&zx(i,r));i.length<3&&!q(a).opacity&&(i.length>1&&(q(i).opacity=0),q(a).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=((e,t,n)=>{var r=e.range(),i=new am;return t===nx||t===ox?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),e=>i.encloses(e.bounds)})(e.boundScale,e.boundOrient,+e.boundTolerance),a.forEach((e=>{o(e)||(e.opacity=0)})));const s=i[0].mark.bounds.clear();return a.forEach((e=>{e.opacity&&s.union(e.bounds)})),t}}),De(Ix,Fa,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,(e=>n.dirty(e))),t.fields&&t.fields.zindex){const e=t.source&&t.source[0];e&&(e.mark.zdirty=!0)}}});const Ux=new am;function qx(e,t,n){return e[t]===n?0:(e[t]=n,1)}function Wx(e){var t=e.items[0].orient;return t===rx||t===ix}function Hx(e,t,n,r){var i,o,a=t.items[0],s=a.datum,u=null!=a.translate?a.translate:.5,l=a.orient,c=function(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}(s),f=a.range,d=a.offset,h=a.position,p=a.minExtent,g=a.maxExtent,m=s.title&&a.items[c[2]].items[0],y=a.titlePadding,v=a.bounds,b=m&&Gy(m),x=0,_=0;switch(Ux.clear().union(v),v.clear(),(i=c[0])>-1&&v.union(a.items[i].bounds),(i=c[1])>-1&&v.union(a.items[i].bounds),l){case nx:x=h||0,_=-d,o=Math.max(p,Math.min(g,-v.y1)),v.add(0,-o).add(f,0),m&&Gx(e,m,o,y,b,0,-1,v);break;case rx:x=-d,_=h||0,o=Math.max(p,Math.min(g,-v.x1)),v.add(-o,0).add(0,f),m&&Gx(e,m,o,y,b,1,-1,v);break;case ix:x=n+d,_=h||0,o=Math.max(p,Math.min(g,v.x2)),v.add(0,0).add(o,f),m&&Gx(e,m,o,y,b,1,1,v);break;case ox:x=h||0,_=r+d,o=Math.max(p,Math.min(g,v.y2)),v.add(0,0).add(f,o),m&&Gx(e,m,o,y,0,0,1,v);break;default:x=a.x,_=a.y}return dm(v.translate(x,_),a),qx(a,"x",x+u)|qx(a,"y",_+u)&&(a.bounds=Ux,e.dirty(a),a.bounds=v,e.dirty(a)),a.mark.bounds.clear().union(v)}function Gx(e,t,n,r,i,o,a,s){const u=t.bounds;if(t.auto){const s=a*(n+i+r);let l=0,c=0;e.dirty(t),o?l=(t.x||0)-(t.x=s):c=(t.y||0)-(t.y=s),t.mark.bounds.clear().union(u.translate(-l,-c)),e.dirty(t)}s.union(u)}const Vx=(e,t)=>Math.floor(Math.min(e,t)),Yx=(e,t)=>Math.ceil(Math.max(e,t));function Xx(e){return(new am).set(0,0,e.width||0,e.height||0)}function Zx(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function Jx(e,t,n){const r=R(e)?e[t]:e;return null!=r?r:void 0!==n?n:0}function Kx(e){return e<0?Math.ceil(-e):0}function Qx(e,t,n){var r,i,o,a,s,u,l,c,f,d,h,p=!n.nodirty,g=n.bounds===Ox?Xx:Zx,m=Ux.set(0,0,0,0),y=Jx(n.align,Dx),v=Jx(n.align,Cx),b=Jx(n.padding,Dx),x=Jx(n.padding,Cx),_=n.columns||t.length,w=_<=0?1:Math.ceil(t.length/_),k=t.length,A=Array(k),E=Array(_),O=0,D=Array(k),C=Array(w),S=0,F=Array(k),M=Array(k),j=Array(k);for(i=0;i<_;++i)E[i]=0;for(i=0;i1)for(i=0;i0&&(F[i]+=f/2);if(v&&Jx(n.center,Cx)&&1!==_)for(i=0;i0&&(M[i]+=d/2);for(i=0;ii&&(e.warn("Grid headers exceed limit: "+i),t=t.slice(0,i)),A+=o,g=0,y=t.length;g=0&&null==(x=n[m]);m-=d);s?(_=null==h?x.x:Math.round(x.bounds.x1+h*x.bounds.width()),w=A):(_=A,w=null==h?x.y:Math.round(x.bounds.y1+h*x.bounds.height())),v.union(b.bounds.translate(_-(b.x||0),w-(b.y||0))),b.x=_,b.y=w,e.dirty(b),E=a(E,v[l])}return E}function r_(e,t,n,r,i,o){if(t){e.dirty(t);var a=n,s=n;r?a=Math.round(i.x1+o*i.width()):s=Math.round(i.y1+o*i.height()),t.bounds.translate(a-(t.x||0),s-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=a,t.y=s,e.dirty(t)}}function i_(e,t,n,r,i,o,a){const s=function(e,t){const n=e[t]||{};return(t,r)=>null!=n[t]?n[t]:null!=e[t]?e[t]:r}(n,t),u=function(e,t){let n=-1/0;return e.forEach((e=>{null!=e.offset&&(n=Math.max(n,e.offset))})),n>-1/0?n:t}(e,s("offset",0)),l=s("anchor",ax),c=l===ux?1:l===sx?.5:0,f={align:Ex,bounds:s("bounds",Ox),columns:"vertical"===s("direction")?1:e.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(t){case rx:f.anchor={x:Math.floor(r.x1)-u,column:ux,y:c*(a||r.height()+2*r.y1),row:l};break;case ix:f.anchor={x:Math.ceil(r.x2)+u,y:c*(a||r.height()+2*r.y1),row:l};break;case nx:f.anchor={y:Math.floor(i.y1)-u,row:ux,x:c*(o||i.width()+2*i.x1),column:l};break;case ox:f.anchor={y:Math.ceil(i.y2)+u,x:c*(o||i.width()+2*i.x1),column:l};break;case"top-left":f.anchor={x:u,y:u};break;case"top-right":f.anchor={x:o-u,y:u,column:ux};break;case"bottom-left":f.anchor={x:u,y:a-u,row:ux};break;case"bottom-right":f.anchor={x:o-u,y:a-u,column:ux,row:ux}}return f}function o_(e,t){var n,r,i=t.items[0],o=i.datum,a=i.orient,s=i.bounds,u=i.x,l=i.y;return i._bounds?i._bounds.clear().union(s):i._bounds=s.clone(),s.clear(),function(e,t,n){var r=t.padding,i=r-n.x,o=r-n.y;if(t.datum.title){var a=t.items[1].items[0],s=a.anchor,u=t.titlePadding||0,l=r-a.x,c=r-a.y;switch(a.orient){case rx:i+=Math.ceil(a.bounds.width())+u;break;case ix:case ox:break;default:o+=a.bounds.height()+u}switch((i||o)&&s_(e,n,i,o),a.orient){case rx:c+=a_(t,n,a,s,1,1);break;case ix:l+=a_(t,n,a,ux,0,0)+u,c+=a_(t,n,a,s,1,1);break;case ox:l+=a_(t,n,a,s,0,0),c+=a_(t,n,a,ux,-1,0,1)+u;break;default:l+=a_(t,n,a,s,0,0)}(l||c)&&s_(e,a,l,c),(l=Math.round(a.bounds.x1-r))<0&&(s_(e,n,-l,0),s_(e,a,-l,0))}else(i||o)&&s_(e,n,i,o)}(e,i,i.items[0].items[0]),s=function(e,t){return e.items.forEach((e=>t.union(e.bounds))),t.x1=e.padding,t.y1=e.padding,t}(i,s),n=2*i.padding,r=2*i.padding,s.empty()||(n=Math.ceil(s.width()+n),r=Math.ceil(s.height()+r)),"symbol"===o.type&&function(e){const t=e.reduce(((e,t)=>(e[t.column]=Math.max(t.bounds.x2-t.x,e[t.column]||0),e)),{});e.forEach((e=>{e.width=t[e.column],e.height=e.bounds.y2-e.y}))}(i.items[0].items[0].items[0].items),a!==kx&&(i.x=u=0,i.y=l=0),i.width=n,i.height=r,dm(s.set(u,l,u+n,l+r),i),i.mark.bounds.clear().union(s),i}function a_(e,t,n,r,i,o,a){const s="symbol"!==e.datum.type,u=n.datum.vgrad,l=(!s||!o&&u||a?t:t.items[0]).bounds[i?"y2":"x2"]-e.padding,c=u&&o?l:0,f=u&&o?0:l,d=i<=0?0:Gy(n);return Math.round(r===ax?c:r===ux?f-d:.5*(l-d))}function s_(e,t,n,r){t.x+=n,t.y+=r,t.bounds.translate(n,r),t.mark.bounds.translate(n,r),e.dirty(t)}function u_(e){Fa.call(this,null,e)}function l_(e,t){let n=0;if(void 0===t)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function c_(e){Fa.call(this,null,e)}function f_(e){Fa.call(this,null,e)}function d_(){return ea({})}function h_(e){Fa.call(this,null,e)}function p_(e){Fa.call(this,[],e)}De(u_,Fa,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach((t=>{e.layout&&function(e,t,n){var r,i,o,a,s,u,l,c=function(e){var t,n,r=e.items,i=r.length,o=0;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;o{(o=e.orient||ix)!==kx&&(t[o]||(t[o]=[])).push(e)}));for(const r in t){const i=t[r];Qx(e,i,i_(i,r,n.legends,d,h,l,c))}p.forEach((t=>{const r=t.bounds;if(r.equals(t._bounds)||(t.bounds=t._bounds,e.dirty(t),t.bounds=r,e.dirty(t)),!n.autosize||"fit"!==n.autosize.type&&n.autosize.type!==_x&&n.autosize.type!==wx)f.union(r);else switch(t.orient){case rx:case ix:f.add(r.x1,0).add(r.x2,0);break;case nx:case ox:f.add(0,r.y1).add(0,r.y2)}}))}f.union(d).union(h),r&&f.union(function(e,t,n,r,i){var o,a=t.items[0],s=a.frame,u=a.orient,l=a.anchor,c=a.offset,f=a.padding,d=a.items[0].items[0],h=a.items[1]&&a.items[1].items[0],p=u===rx||u===ix?r:n,g=0,m=0,y=0,v=0,b=0;if(s!==fx?u===rx?(g=i.y2,p=i.y1):u===ix?(g=i.y1,p=i.y2):(g=i.x1,p=i.x2):u===rx&&(g=r,p=0),o=l===ax?g:l===ux?p:(g+p)/2,h&&h.text){switch(u){case nx:case ox:b=d.bounds.height()+f;break;case rx:v=d.bounds.width()+f;break;case ix:v=-d.bounds.width()-f}Ux.clear().union(h.bounds),Ux.translate(v-(h.x||0),b-(h.y||0)),qx(h,"x",v)|qx(h,"y",b)&&(e.dirty(h),h.bounds.clear().union(Ux),h.mark.bounds.clear().union(Ux),e.dirty(h)),Ux.clear().union(h.bounds)}else Ux.clear();switch(Ux.union(d.bounds),u){case nx:m=o,y=i.y1-Ux.height()-c;break;case rx:m=i.x1-Ux.width()-c,y=o;break;case ix:m=i.x2+Ux.width()+c,y=o;break;case ox:m=o,y=i.y2+c;break;default:m=a.x,y=a.y}return qx(a,"x",m)|qx(a,"y",y)&&(Ux.translate(m,y),e.dirty(a),a.bounds.clear().union(Ux),t.bounds.clear().union(Ux),e.dirty(a)),a.bounds}(e,r,l,c,f)),t.clip&&f.set(0,0,t.width||0,t.height||0),function(e,t,n,r){const i=r.autosize||{},o=i.type;if(e._autosize<1||!o)return;let a=e._width,s=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if("padding"===i.contains){const t=e.padding();a-=t.left+t.right,s-=t.top+t.bottom}o===kx?(l=0,f=0,u=a,c=s):"fit"===o?(u=Math.max(0,a-l-d),c=Math.max(0,s-f-h)):o===_x?(u=Math.max(0,a-l-d),s=c+f+h):o===wx?(a=u+l+d,c=Math.max(0,s-f-h)):"pad"===o&&(a=u+l+d,s=c+f+h),e._resizeView(a,s,u,c,[l,f],i.resize)}(e,t,f,n)}(n,t,e)})),function(e){return e&&"legend-entry"!==e.mark.role}(e.mark.group)?t.reflow():t}}),De(c_,Fa,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,o=e.scale,a=qp(o,null==e.count?e.values?e.values.length:10:e.count,e.minstep),s=e.format||Gp(n,o,a,e.formatSpecifier,e.formatType,!!e.values),u=e.values?Wp(o,e.values,a):Hp(o,a);return i&&(r.rem=i),i=u.map(((e,t)=>ea({index:t/(u.length-1||1),value:e,label:s(e)}))),e.extra&&i.length&&i.push(ea({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}}),De(f_,Fa,{transform(e,t){var n=t.dataflow,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||d_,o=e.key||Ko,a=this.value;return z(r.encode)&&(r.encode=null),a&&(e.modified("key")||t.modified(o))&&_("DataJoin does not support modified key function or fields."),a||(t=t.addAll(),this.value=a=function(e){const t=Ee().test((e=>e.exit));return t.lookup=n=>t.get(e(n)),t}(o)),t.visit(t.ADD,(e=>{const t=o(e);let n=a.get(t);n?n.exit?(a.empty--,r.add.push(n)):r.mod.push(n):(n=i(e),a.set(t,n),r.add.push(n)),n.datum=e,n.exit=!1})),t.visit(t.MOD,(e=>{const t=o(e),n=a.get(t);n&&(n.datum=e,r.mod.push(n))})),t.visit(t.REM,(e=>{const t=o(e),n=a.get(t);e!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++a.empty)})),t.changed(t.ADD_MOD)&&r.modifies("datum"),(t.clean()||e.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),r}}),De(h_,Fa,{transform(e,t){var n=t.fork(t.ADD_REM),r=e.mod||!1,i=e.encoders,o=t.encode;if(z(o)){if(!n.changed()&&!o.every((e=>i[e])))return t.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,s=i.update||S,u=i.enter||S,l=i.exit||S,c=(o&&!a?i[o]:s)||S;if(t.changed(t.ADD)&&(t.visit(t.ADD,(t=>{u(t,e),s(t,e)})),n.modifies(u.output),n.modifies(s.output),c!==S&&c!==s&&(t.visit(t.ADD,(t=>{c(t,e)})),n.modifies(c.output))),t.changed(t.REM)&&l!==S&&(t.visit(t.REM,(t=>{l(t,e)})),n.modifies(l.output)),a||c!==S){const i=t.MOD|(e.modified()?t.REFLOW:0);a?(t.visit(i,(t=>{const i=u(t,e)||r;(c(t,e)||i)&&n.mod.push(t)})),n.mod.length&&n.modifies(u.output)):t.visit(i,(t=>{(c(t,e)||r)&&n.mod.push(t)})),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}}),De(p_,Fa,{transform(e,t){if(null!=this.value&&!e.modified())return t.StopPropagation;var n,r,i,o,a,s=t.dataflow.locale(),u=t.fork(t.NO_SOURCE|t.NO_FIELDS),l=this.value,c=e.type||Rp,f=e.scale,d=+e.limit,h=qp(f,null==e.count?5:e.count,e.minstep),p=!!e.values||c===Rp,g=e.format||Kp(s,f,h,c,e.formatSpecifier,e.formatType,p),m=e.values||Zp(f,h);return l&&(u.rem=l),c===Rp?(d&&m.length>d?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),l=m.slice(0,d-1),a=!0):l=m,ce(i=e.size)?(e.values||0!==f(l[0])||(l=l.slice(1)),o=l.reduce(((t,n)=>Math.max(t,i(n,e))),0)):i=ye(o=i||8),l=l.map(((t,n)=>ea({index:n,label:g(t,n,l),value:t,offset:o,size:i(t,e)}))),a&&(a=m[l.length],l.push(ea({index:l.length,label:`…${m.length-l.length} entries`,value:a,offset:o,size:i(a,e)})))):"gradient"===c?(n=f.domain(),r=jp(f,n[0],q(n)),m.length<3&&!e.values&&n[0]!==q(n)&&(m=[n[0],q(n)]),l=m.map(((e,t)=>ea({index:t,label:g(e,t,m),value:e,perc:r(e)})))):(i=m.length-1,r=function(e){const t=e.domain(),n=t.length-1;let r=+t[0],i=+q(t),o=i-r;if(e.type===np){const e=n?o/n:.1;r-=e,i+=e,o=i-r}return e=>(e-r)/o}(f),l=m.map(((e,t)=>ea({index:t,label:g(e,t,m),value:e,perc:t?r(e):0,perc2:t===i?1:r(m[t+1])})))),u.source=l,u.add=l,this.value=l,u}});const g_=e=>e.source.x,m_=e=>e.source.y,y_=e=>e.target.x,v_=e=>e.target.y;function b_(e){Fa.call(this,{},e)}b_.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},De(b_,Fa,{transform(e,t){var n=e.sourceX||g_,r=e.sourceY||m_,i=e.targetX||y_,o=e.targetY||v_,a=e.as||"path",s=e.orient||"vertical",u=e.shape||"line",l=k_.get(u+"-"+s)||k_.get(u);return l||_("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,(e=>{e[a]=l(n(e),r(e),i(e),o(e))})),t.reflow(e.modified()).modifies(a)}});const x_=(e,t,n,r)=>"M"+e+","+t+"L"+n+","+r,__=(e,t,n,r)=>{var i=n-e,o=r-t,a=Math.hypot(i,o)/2;return"M"+e+","+t+"A"+a+","+a+" "+180*Math.atan2(o,i)/Math.PI+" 0 1 "+n+","+r},w_=(e,t,n,r)=>{const i=n-e,o=r-t,a=.2*(i+o),s=.2*(o-i);return"M"+e+","+t+"C"+(e+a)+","+(t+s)+" "+(n+s)+","+(r-a)+" "+n+","+r},k_=Ee({line:x_,"line-radial":(e,t,n,r)=>x_(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),arc:__,"arc-radial":(e,t,n,r)=>__(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),curve:w_,"curve-radial":(e,t,n,r)=>w_(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),"orthogonal-horizontal":(e,t,n,r)=>"M"+e+","+t+"V"+r+"H"+n,"orthogonal-vertical":(e,t,n,r)=>"M"+e+","+t+"H"+n+"V"+r,"orthogonal-radial":(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n);return"M"+t*i+","+t*o+"A"+t+","+t+" 0 0,"+((Math.abs(n-e)>Math.PI?n<=e:n>e)?1:0)+" "+t*a+","+t*s+"L"+r*a+","+r*s},"diagonal-horizontal":(e,t,n,r)=>{const i=(e+n)/2;return"M"+e+","+t+"C"+i+","+t+" "+i+","+r+" "+n+","+r},"diagonal-vertical":(e,t,n,r)=>{const i=(t+r)/2;return"M"+e+","+t+"C"+e+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n),u=(t+r)/2;return"M"+t*i+","+t*o+"C"+u*i+","+u*o+" "+u*a+","+u*s+" "+r*a+","+r*s}});function A_(e){Fa.call(this,null,e)}A_.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},De(A_,Fa,{transform(e,t){var n,r,i,o=e.as||["startAngle","endAngle"],a=o[0],s=o[1],u=e.field||D,l=e.startAngle||0,c=null!=e.endAngle?e.endAngle:2*Math.PI,f=t.source,d=f.map(u),h=d.length,p=l,g=(c-l)/l_(d),m=Ls(h);for(e.sort&&m.sort(((e,t)=>d[e]-d[t])),n=0;ne+(t<0?-1:t>0?1:0)),0))!==t.length&&n.warn("Log scale domain includes zero: "+qe(t)));return t}function S_(e,t,n){return ce(e)&&(t||n)?Sp(e,F_(t||[0,1],n)):e}function F_(e,t){return t?e.slice().reverse():e}function M_(e){Fa.call(this,null,e)}De(D_,Fa,{transform(e,t){var n=t.dataflow,r=this.value,i=function(e){var t,n=e.type,r="";return n===Kh?Kh+"-"+Hh:(function(e){const t=e.type;return wp(t)&&t!==Zh&&t!==Jh&&(e.scheme||e.range&&e.range.length&&e.range.every(Ne))}(e)&&(r=2===(t=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(null!=e.domainMid):0)?Kh+"-":3===t?Qh+"-":""),(r+n||Hh).toLowerCase())}(e);for(i in r&&i===r.type||(this.value=r=bp(i)()),e)if(!O_[i]){if("padding"===i&&E_(r.type))continue;ce(r[i])?r[i](e[i]):n.warn("Unsupported scale property: "+i)}return function(e,t,n){var r=e.type,i=t.round||!1,o=t.range;if(null!=t.rangeStep)o=function(e,t,n){e!==op&&e!==ip&&_("Only band and point scales support rangeStep.");var r=(null!=t.paddingOuter?t.paddingOuter:t.padding)||0,i=e===ip?1:(null!=t.paddingInner?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Wh(n,i,r)]}(r,t,n);else if(t.scheme&&(o=function(e,t,n){var r,i=t.schemeExtent;return z(t.scheme)?r=Fp(t.scheme,t.interpolate,t.interpolateGamma):(r=zp(t.scheme.toLowerCase()))||_(`Unrecognized scheme name: ${t.scheme}`),n=e===np?n+1:e===ap?n-1:e===ep||e===tp?+t.schemeCount||5:n,Op(e)?S_(r,i,t.reverse):ce(r)?Mp(S_(r,i),n):e===rp?r:r.slice(0,n)}(r,t,n),ce(o))){if(e.interpolator)return e.interpolator(o);_(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&Op(r))return e.interpolator(Fp(F_(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate($p(t.interpolate,t.interpolateGamma)):ce(e.round)?e.round(i):ce(e.rangeRound)&&e.interpolate(i?zf:Tf),o&&e.range(F_(o,t.reverse))}(r,e,function(e,t,n){let r=t.bins;if(r&&!z(r)){const t=e.domain(),n=t[0],i=q(t),o=r.step;let a=null==r.start?n:r.start,s=null==r.stop?i:r.stop;o||_("Scale bins parameter missing step property."),ai&&(s=o*Math.floor(i/o)),r=Ls(a,s+o/2,o)}return r?e.bins=r:e.bins&&delete e.bins,e.type===ap&&(r?t.domain||t.domainRaw||(e.domain(r),n=r.length):e.bins=e.domain()),n}(r,e,function(e,t,n){const r=function(e,t,n){return t?(e.domain(C_(e.type,t,n)),t.length):-1}(e,t.domainRaw,n);if(r>-1)return r;var i,o,a=t.domain,s=e.type,u=t.zero||void 0===t.zero&&function(e){const t=e.type;return!e.bins&&(t===Hh||t===Vh||t===Yh)}(e);if(!a)return 0;if((u||null!=t.domainMin||null!=t.domainMax||null!=t.domainMid)&&(i=(a=a.slice()).length-1||1,u&&(a[0]>0&&(a[0]=0),a[i]<0&&(a[i]=0)),null!=t.domainMin&&(a[0]=t.domainMin),null!=t.domainMax&&(a[i]=t.domainMax),null!=t.domainMid)){const e=(o=t.domainMid)>a[i]?i+1:oe(u);if(null==t)h.push(e.slice());else for(i={},o=0,a=e.length;od&&(d=f),n&&c.sort(n)}return h.max=d,h}(t.source,e.groupby,l,c),r=0,i=n.length,o=n.max;re;function I_(e,t){e&&q_.hasOwnProperty(e.type)&&q_[e.type](e,t)}var U_={Feature:function(e,t){I_(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r0){for(o=e[--i];i>0&&(t=o,n=e[--i],o=t+n,r=n-(o-t),!r););i>0&&(r<0&&e[i-1]<0||r>0&&e[i-1]>0)&&(n=2*r,t=o+n,n==t-o&&(o=t))}return o}}var Y_=1e-6,X_=1e-12,Z_=Math.PI,J_=Z_/2,K_=Z_/4,Q_=2*Z_,ew=180/Z_,tw=Z_/180,nw=Math.abs,rw=Math.atan,iw=Math.atan2,ow=Math.cos,aw=Math.ceil,sw=Math.exp,uw=(Math.floor,Math.hypot),lw=Math.log,cw=Math.pow,fw=Math.sin,dw=Math.sign||function(e){return e>0?1:e<0?-1:0},hw=Math.sqrt,pw=Math.tan;function gw(e){return e>1?0:e<-1?Z_:Math.acos(e)}function mw(e){return e>1?J_:e<-1?-J_:Math.asin(e)}function yw(){}var vw,bw,xw,_w,ww=new V_,kw=new V_,Aw={point:yw,lineStart:yw,lineEnd:yw,polygonStart:function(){Aw.lineStart=Ew,Aw.lineEnd=Cw},polygonEnd:function(){Aw.lineStart=Aw.lineEnd=Aw.point=yw,ww.add(nw(kw)),kw=new V_},result:function(){var e=ww/2;return ww=new V_,e}};function Ew(){Aw.point=Ow}function Ow(e,t){Aw.point=Dw,vw=xw=e,bw=_w=t}function Dw(e,t){kw.add(_w*e-xw*t),xw=e,_w=t}function Cw(){Dw(vw,bw)}const Sw=Aw;var Fw=1/0,Mw=Fw,jw=-Fw,$w=jw,Nw={point:function(e,t){ejw&&(jw=e),t$w&&($w=t)},lineStart:yw,lineEnd:yw,polygonStart:yw,polygonEnd:yw,result:function(){var e=[[Fw,Mw],[jw,$w]];return jw=$w=-(Mw=Fw=1/0),e}};const Bw=Nw;var Tw,zw,Rw,Pw,Lw=0,Iw=0,Uw=0,qw=0,Ww=0,Hw=0,Gw=0,Vw=0,Yw=0,Xw={point:Zw,lineStart:Jw,lineEnd:ek,polygonStart:function(){Xw.lineStart=tk,Xw.lineEnd=nk},polygonEnd:function(){Xw.point=Zw,Xw.lineStart=Jw,Xw.lineEnd=ek},result:function(){var e=Yw?[Gw/Yw,Vw/Yw]:Hw?[qw/Hw,Ww/Hw]:Uw?[Lw/Uw,Iw/Uw]:[NaN,NaN];return Lw=Iw=Uw=qw=Ww=Hw=Gw=Vw=Yw=0,e}};function Zw(e,t){Lw+=e,Iw+=t,++Uw}function Jw(){Xw.point=Kw}function Kw(e,t){Xw.point=Qw,Zw(Rw=e,Pw=t)}function Qw(e,t){var n=e-Rw,r=t-Pw,i=hw(n*n+r*r);qw+=i*(Rw+e)/2,Ww+=i*(Pw+t)/2,Hw+=i,Zw(Rw=e,Pw=t)}function ek(){Xw.point=Zw}function tk(){Xw.point=rk}function nk(){ik(Tw,zw)}function rk(e,t){Xw.point=ik,Zw(Tw=Rw=e,zw=Pw=t)}function ik(e,t){var n=e-Rw,r=t-Pw,i=hw(n*n+r*r);qw+=i*(Rw+e)/2,Ww+=i*(Pw+t)/2,Hw+=i,Gw+=(i=Pw*e-Rw*t)*(Rw+e),Vw+=i*(Pw+t),Yw+=3*i,Zw(Rw=e,Pw=t)}const ok=Xw;function ak(e){this._context=e}ak.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,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(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Q_)}},result:yw};var sk,uk,lk,ck,fk,dk=new V_,hk={point:yw,lineStart:function(){hk.point=pk},lineEnd:function(){sk&&gk(uk,lk),hk.point=yw},polygonStart:function(){sk=!0},polygonEnd:function(){sk=null},result:function(){var e=+dk;return dk=new V_,e}};function pk(e,t){hk.point=gk,uk=ck=e,lk=fk=t}function gk(e,t){ck-=e,fk-=t,dk.add(hw(ck*ck+fk*fk)),ck=e,fk=t}const mk=hk;let yk,vk,bk,xk;class _k{constructor(e){this._append=null==e?wk:function(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return wk;if(t!==yk){const e=10**t;yk=t,vk=function(t){let n=1;this._+=t[0];for(const r=t.length;n=0))throw new RangeError(`invalid digits: ${e}`);i=t}return null===t&&(r=new _k(i)),a},a.projection(e).digits(i).context(t)}function Ak(){var e,t=[];return{point:function(t,n,r){e.push([t,n,r])},lineStart:function(){t.push(e=[])},lineEnd:yw,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function Ek(e,t){return nw(e[0]-t[0])=0;--o)i.point((c=l[o])[0],c[1]);else r(d.x,d.p.x,-1,i);d=d.p}l=(d=d.o).z,h=!h}while(!d.v);i.lineEnd()}}}function Ck(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r=0?1:-1,O=E*A,D=O>Z_,C=m*w;if(u.add(iw(C*E*fw(O),y*k+C*ow(O))),a+=D?A+E*Q_:A,D^p>=n^x>=n){var S=jk(Fk(h),Fk(b));Bk(S);var F=jk(o,S);Bk(F);var M=(D^A>=0?-1:1)*mw(F[2]);(r>M||r===M&&(S[0]||S[1]))&&(s+=D^A>=0?1:-1)}}return(a<-Y_||a0){for(f||(i.polygonStart(),f=!0),i.lineStart(),e=0;e1&&2&u&&d.push(d.pop().concat(d.shift())),a.push(d.filter(Pk))}return d}}function Pk(e){return e.length>1}function Lk(e,t){return((e=e.x)[0]<0?e[1]-J_-Y_:J_-e[1])-((t=t.x)[0]<0?t[1]-J_-Y_:J_-t[1])}const Ik=Rk((function(){return!0}),(function(e){var t,n=NaN,r=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,a){var s=o>0?Z_:-Z_,u=nw(o-n);nw(u-Z_)0?J_:-J_),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(o,r),t=0):i!==s&&u>=Z_&&(nw(n-i)Y_?rw((fw(t)*(o=ow(r))*fw(n)-fw(r)*(i=ow(t))*fw(e))/(i*o*a)):(t+r)/2}(n,r,o,a),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),t=0),e.point(n=o,r=a),i=s},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}}),(function(e,t,n,r){var i;if(null==e)i=n*J_,r.point(-Z_,i),r.point(0,i),r.point(Z_,i),r.point(Z_,0),r.point(Z_,-i),r.point(0,-i),r.point(-Z_,-i),r.point(-Z_,0),r.point(-Z_,i);else if(nw(e[0]-t[0])>Y_){var o=e[0]0)do{l.point(0===c||3===c?e:n,c>1?r:t)}while((c=(c+s+4)%4)!==f);else l.point(o[0],o[1])}function a(r,i){return nw(r[0]-e)0?0:3:nw(r[0]-n)0?2:1:nw(r[1]-t)0?1:0:i>0?3:2}function s(e,t){return u(e.x,t.x)}function u(e,t){var n=a(e,1),r=a(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(a){var u,l,c,f,d,h,p,g,m,y,v,b=a,x=Ak(),_={point:w,lineStart:function(){_.point=k,l&&l.push(c=[]),y=!0,m=!1,p=g=NaN},lineEnd:function(){u&&(k(f,d),h&&m&&x.rejoin(),u.push(x.result())),_.point=w,m&&b.lineEnd()},polygonStart:function(){b=x,u=[],l=[],v=!0},polygonEnd:function(){var t=function(){for(var t=0,n=0,i=l.length;nr&&(d-o)*(r-a)>(h-a)*(e-o)&&++t:h<=r&&(d-o)*(r-a)<(h-a)*(e-o)&&--t;return t}(),n=v&&t,i=(u=zk(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Dk(u,s,t,o,a),a.polygonEnd()),b=a,u=l=c=null}};function w(e,t){i(e,t)&&b.point(e,t)}function k(o,a){var s=i(o,a);if(l&&c.push([o,a]),y)f=o,d=a,h=s,y=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&m)b.point(o,a);else{var u=[p=Math.max(Wk,Math.min(qk,p)),g=Math.max(Wk,Math.min(qk,g))],x=[o=Math.max(Wk,Math.min(qk,o)),a=Math.max(Wk,Math.min(qk,a))];!function(e,t,n,r,i,o){var a,s=e[0],u=e[1],l=0,c=1,f=t[0]-s,d=t[1]-u;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>c)return;a>l&&(l=a)}else if(f>0){if(a0)){if(a/=d,d<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=o-u,d||!(a<0)){if(a/=d,d<0){if(a>c)return;a>l&&(l=a)}else if(d>0){if(a0&&(e[0]=s+l*f,e[1]=u+l*d),c<1&&(t[0]=s+c*f,t[1]=u+c*d),!0}}}}}(u,x,e,t,n,r)?s&&(b.lineStart(),b.point(o,a),v=!1):(m||(b.lineStart(),b.point(u[0],u[1])),b.point(x[0],x[1]),s||b.lineEnd(),v=!1)}p=o,g=a,m=s}return _}}function Gk(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return(n=t.invert(n,r))&&e.invert(n[0],n[1])}),n}function Vk(e,t){return nw(e)>Z_&&(e-=Math.round(e/Q_)*Q_),[e,t]}function Yk(e,t,n){return(e%=Q_)?t||n?Gk(Zk(e),Jk(t,n)):Zk(e):t||n?Jk(t,n):Vk}function Xk(e){return function(t,n){return nw(t+=e)>Z_&&(t-=Math.round(t/Q_)*Q_),[t,n]}}function Zk(e){var t=Xk(e);return t.invert=Xk(-e),t}function Jk(e,t){var n=ow(e),r=fw(e),i=ow(t),o=fw(t);function a(e,t){var a=ow(t),s=ow(e)*a,u=fw(e)*a,l=fw(t),c=l*n+s*r;return[iw(u*i-c*o,s*n-l*r),mw(c*i+u*o)]}return a.invert=function(e,t){var a=ow(t),s=ow(e)*a,u=fw(e)*a,l=fw(t),c=l*i-u*o;return[iw(u*i+l*o,s*n+c*r),mw(c*n-s*r)]},a}function Kk(e){return function(t){var n=new Qk;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Qk(){}function eA(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),G_(n,e.stream(Bw)),t(Bw.result()),null!=r&&e.clipExtent(r),e}function tA(e,t,n){return eA(e,(function(n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+t[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+t[0][1]+(i-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([a,s])}),n)}function nA(e,t,n){return tA(e,[[0,0],t],n)}function rA(e,t,n){return eA(e,(function(n){var r=+t,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];e.scale(150*i).translate([o,a])}),n)}function iA(e,t,n){return eA(e,(function(n){var r=+t,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;e.scale(150*i).translate([o,a])}),n)}Vk.invert=Vk,Qk.prototype={constructor:Qk,point:function(e,t){this.stream.point(e,t)},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 oA=16,aA=ow(30*tw);function sA(e,t){return+t?function(e,t){function n(r,i,o,a,s,u,l,c,f,d,h,p,g,m){var y=l-r,v=c-i,b=y*y+v*v;if(b>4*t&&g--){var x=a+d,_=s+h,w=u+p,k=hw(x*x+_*_+w*w),A=mw(w/=k),E=nw(nw(w)-1)t||nw((y*S+v*F)/b-.5)>.3||a*d+s*h+u*p0,i=nw(t)>Y_;function o(e,n){return ow(e)*ow(n)>t}function a(e,n,r){var i=[1,0,0],o=jk(Fk(e),Fk(n)),a=Mk(o,o),s=o[0],u=a-s*s;if(!u)return!r&&e;var l=t*a/u,c=-t*s/u,f=jk(i,o),d=Nk(i,l);$k(d,Nk(o,c));var h=f,p=Mk(d,h),g=Mk(h,h),m=p*p-g*(Mk(d,d)-1);if(!(m<0)){var y=hw(m),v=Nk(h,(-p-y)/g);if($k(v,d),v=Sk(v),!r)return v;var b,x=e[0],_=n[0],w=e[1],k=n[1];_0^v[1]<(nw(v[0]-x)Z_^(x<=v[0]&&v[0]<=_)){var O=Nk(h,(-p+y)/g);return $k(O,d),[v,Sk(O)]}}}function s(t,n){var i=r?e:Z_-e,o=0;return t<-i?o|=1:t>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Rk(o,(function(e){var t,n,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(f,d){var h,p=[f,d],g=o(f,d),m=r?g?0:s(f,d):g?s(f+(f<0?Z_:-Z_),d):0;if(!t&&(l=u=g)&&e.lineStart(),g!==u&&(!(h=a(t,p))||Ek(t,h)||Ek(p,h))&&(p[2]=1),g!==u)c=0,g?(e.lineStart(),h=a(p,t),e.point(h[0],h[1])):(h=a(t,p),e.point(h[0],h[1],2),e.lineEnd()),t=h;else if(i&&t&&r^g){var y;m&n||!(y=a(p,t,!0))||(c=0,r?(e.lineStart(),e.point(y[0][0],y[0][1]),e.point(y[1][0],y[1][1]),e.lineEnd()):(e.point(y[1][0],y[1][1]),e.lineEnd(),e.lineStart(),e.point(y[0][0],y[0][1],3)))}!g||t&&Ek(t,p)||e.point(p[0],p[1]),t=p,u=g,n=m},lineEnd:function(){u&&e.lineEnd(),t=null},clean:function(){return c|(l&&u)<<1}}}),(function(t,r,i,o){!function(e,t,n,r,i,o){if(n){var a=ow(t),s=fw(t),u=r*n;null==i?(i=t+r*Q_,o=t-u/2):(i=Uk(a,i),o=Uk(a,o),(r>0?io)&&(i+=r*Q_));for(var l,c=i;r>0?c>o:c2?e[2]%360*tw:0,S()):[m*ew,y*ew,v*ew]},D.angle=function(e){return arguments.length?(b=e%360*tw,S()):b*ew},D.reflectX=function(e){return arguments.length?(x=e?-1:1,S()):x<0},D.reflectY=function(e){return arguments.length?(_=e?-1:1,S()):_<0},D.precision=function(e){return arguments.length?(a=sA(s,O=e*e),F()):hw(O)},D.fitExtent=function(e,t){return tA(D,e,t)},D.fitSize=function(e,t){return nA(D,e,t)},D.fitWidth=function(e,t){return rA(D,e,t)},D.fitHeight=function(e,t){return iA(D,e,t)},function(){return t=e.apply(this,arguments),D.invert=t.invert&&C,S()}}function dA(e){var t=0,n=Z_/3,r=fA(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*tw,n=e[1]*tw):[t*ew,n*ew]},i}function hA(e,t){var n=fw(e),r=(n+fw(t))/2;if(nw(r)2?e[2]*tw:0),t.invert=function(t){return(t=e.invert(t[0]*tw,t[1]*tw))[0]*=ew,t[1]*=ew,t},t}(i.rotate()).invert([0,0]));return u(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:e===xA?[[Math.max(s[0]-o,l),t],[Math.min(s[0]+o,n),r]]:[[l,Math.max(s[1]-o,t)],[n,Math.min(s[1]+o,r)]])}return i.scale=function(e){return arguments.length?(a(e),c()):a()},i.translate=function(e){return arguments.length?(s(e),c()):s()},i.center=function(e){return arguments.length?(o(e),c()):o()},i.clipExtent=function(e){return arguments.length?(null==e?l=t=n=r=null:(l=+e[0][0],t=+e[0][1],n=+e[1][0],r=+e[1][1]),c()):null==l?null:[[l,t],[n,r]]},c()}function wA(e){return pw((J_+e)/2)}function kA(e,t){var n=ow(e),r=e===t?fw(e):lw(n/ow(t))/lw(wA(t)/wA(e)),i=n*cw(wA(e),r)/r;if(!r)return xA;function o(e,t){i>0?t<-J_+Y_&&(t=-J_+Y_):t>J_-Y_&&(t=J_-Y_);var n=i/cw(wA(t),r);return[n*fw(r*e),i-n*ow(r*e)]}return o.invert=function(e,t){var n=i-t,o=dw(r)*hw(e*e+n*n),a=iw(e,nw(n))*dw(n);return n*r<0&&(a-=Z_*dw(e)*dw(n)),[a/r,2*rw(cw(i/o,1/r))-J_]},o}function AA(e,t){return[e,t]}function EA(e,t){var n=ow(e),r=e===t?fw(e):(n-ow(t))/(t-e),i=n/r+e;if(nw(r)Y_&&--i>0);return[e/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},NA.invert=yA(mw),BA.invert=yA((function(e){return 2*rw(e)})),TA.invert=function(e,t){return[-t,2*rw(sw(e))-J_]};var zA=Math.abs,RA=(Math.atan,Math.atan2,Math.ceil,Math.cos),PA=(Math.exp,Math.floor,Math.log,Math.max,Math.min,Math.pow,Math.round,Math.sign,Math.sin),LA=(Math.tan,1e-6),IA=Math.PI,UA=IA/2,qA=(Math.SQRT1_2,HA(2));function WA(e){return e>1?UA:e<-1?-UA:Math.asin(e)}function HA(e){return e>0?Math.sqrt(e):0}function GA(e,t){var n,r=e*PA(t),i=30;do{t-=n=(t+PA(t)-r)/(1+RA(t))}while(zA(n)>LA&&--i>0);return t/2}HA(IA);var VA=function(e,t,n){function r(r,i){return[e*r*RA(i=GA(n,i)),t*PA(i)]}return r.invert=function(r,i){return i=WA(i/t),[r/(e*RA(i)),WA((2*i+PA(2*i))/n)]},r}(qA/UA,qA,IA);const YA=kk(),XA=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function ZA(e,t){if(!e||"string"!=typeof e)throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(KA[e]=function(e,t){return function n(){const r=t();return r.type=e,r.path=kk().projection(r),r.copy=r.copy||function(){const e=n();return XA.forEach((t=>{r[t]&&e[t](r[t]())})),e.path.pointRadius(r.path.pointRadius()),e},vp(r)}}(e,t),this):KA[e]||null}function JA(e){return e&&e.path||YA}const KA={albers:gA,albersusa:function(){var e,t,n,r,i,o,a=gA(),s=pA().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=pA().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(e,t){o=[e,t]}};function c(e){var t=e[0],a=e[1];return o=null,n.point(t,a),o||(r.point(t,a),o)||(i.point(t,a),o)}function f(){return e=t=null,c}return c.invert=function(e){var t=a.scale(),n=a.translate(),r=(e[0]-n[0])/t,i=(e[1]-n[1])/t;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:a).invert(e)},c.stream=function(n){return e&&t===n?e:(r=[a.stream(t=n),s.stream(n),u.stream(n)],i=r.length,e={point:function(e,t){for(var n=-1;++n2?e[2]+90:90]):[(e=n())[0],e[1],e[2]-90]},n([0,0,90]).scale(159.155)}};for(const e in KA)ZA(e,KA[e]);function QA(e,t,n){var r=Ls(e,t-Y_,n).concat(t);return function(e){return r.map((function(t){return[e,t]}))}}function eE(e,t,n){var r=Ls(e,t-Y_,n).concat(t);return function(e){return r.map((function(t){return[t,e]}))}}function tE(){}const nE=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function rE(){var e=1,t=1,n=a;function r(e,t){return t.map((t=>i(e,t)))}function i(r,i){var a=[],s=[];return function(n,r,i){var a,s,u,l,c,f,d=[],h=[];for(a=s=-1,l=n[0]>=r,nE[l<<1].forEach(p);++a=r,nE[u|l<<1].forEach(p);for(nE[0|l].forEach(p);++s=r,c=n[s*e]>=r,nE[l<<1|c<<2].forEach(p);++a=r,f=c,c=n[s*e+a+1]>=r,nE[u|l<<1|c<<2|f<<3].forEach(p);nE[l|c<<3].forEach(p)}for(a=-1,c=n[s*e]>=r,nE[c<<2].forEach(p);++a=r,nE[c<<2|f<<3].forEach(p);function p(e){var t,n,r=[e[0][0]+a,e[0][1]+s],u=[e[1][0]+a,e[1][1]+s],l=o(r),c=o(u);(t=h[l])?(n=d[c])?(delete h[t.end],delete d[n.start],t===n?(t.ring.push(u),i(t.ring)):d[t.start]=h[n.end]={start:t.start,end:n.end,ring:t.ring.concat(n.ring)}):(delete h[t.end],t.ring.push(u),h[t.end=c]=t):(t=d[c])?(n=h[l])?(delete d[t.start],delete h[n.end],t===n?(t.ring.push(u),i(t.ring)):d[n.start]=h[t.end]={start:n.start,end:t.end,ring:n.ring.concat(t.ring)}):(delete d[t.start],t.ring.unshift(r),d[t.start=l]=t):d[l]=h[c]={start:l,end:c,ring:[r,u]}}nE[c<<3].forEach(p)}(r,i,(e=>{n(e,r,i),function(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t0?a.push([e]):s.push(e)})),s.forEach((e=>{for(var t,n=0,r=a.length;n{var o,a=n[0],s=n[1],u=0|a,l=0|s,c=r[l*e+u];a>0&&a0&&s=0&&o>=0||_("invalid size"),e=i,t=o,r},r.smooth=function(e){return arguments.length?(n=e?a:tE,r):n===a},r}function iE(e,t){for(var n,r=-1,i=t.length;++rr!=h>r&&n<(d-l)*(r-c)/(h-c)+l&&(i=-i)}return i}function aE(e,t,n){var r,i,o,a;return function(e,t,n){return(t[0]-e[0])*(n[1]-e[1])==(n[0]-e[0])*(t[1]-e[1])}(e,t,n)&&(i=e[r=+(e[0]===t[0])],o=n[r],a=t[r],i<=o&&o<=a||a<=o&&o<=i)}function sE(e,t,n){return function(r){var i=xe(r),o=n?Math.min(i[0],0):i[0],a=i[1],s=a-o,u=t?bt(o,a,e):s/(e+1);return Ls(o+u,a,u)}}function uE(e){Fa.call(this,null,e)}function lE(e,t,n,r,i){const o=e.x1||0,a=e.y1||0,s=t*n<0;function u(e){e.forEach(l)}function l(e){s&&e.reverse(),e.forEach(c)}function c(e){e[0]=(e[0]-o)*t+r,e[1]=(e[1]-a)*n+i}return function(e){return e.coordinates.forEach(u),e}}function cE(e,t,n){const r=e>=0?e:Ga(t,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function fE(e){return ce(e)?e:ye(+e)}function dE(){var e=e=>e[0],t=e=>e[1],n=D,r=[-1,-1],i=960,o=500,a=2;function s(s,u){const l=cE(r[0],s,e)>>a,c=cE(r[1],s,t)>>a,f=l?l+2:0,d=c?c+2:0,h=2*f+(i>>a),p=2*d+(o>>a),g=new Float32Array(h*p),m=new Float32Array(h*p);let y=g;s.forEach((r=>{const i=f+(+e(r)>>a),o=d+(+t(r)>>a);i>=0&&i=0&&o0&&c>0?(hE(h,p,g,m,l),pE(h,p,m,g,c),hE(h,p,g,m,l),pE(h,p,m,g,c),hE(h,p,g,m,l),pE(h,p,m,g,c)):l>0?(hE(h,p,g,m,l),hE(h,p,m,g,l),hE(h,p,g,m,l),y=m):c>0&&(pE(h,p,g,m,c),pE(h,p,m,g,c),pE(h,p,g,m,c),y=m);const v=u?Math.pow(2,-2*a):1/l_(y);for(let e=0,t=h*p;e>a),y2:d+(o>>a)}}return s.x=function(t){return arguments.length?(e=fE(t),s):e},s.y=function(e){return arguments.length?(t=fE(e),s):t},s.weight=function(e){return arguments.length?(n=fE(e),s):n},s.size=function(e){if(!arguments.length)return[i,o];var t=+e[0],n=+e[1];return t>=0&&n>=0||_("invalid size"),i=t,o=n,s},s.cellSize=function(e){return arguments.length?((e=+e)>=1||_("invalid cell size"),a=Math.floor(Math.log(e)/Math.LN2),s):1<=i&&(t>=o&&(s-=n[t-o+a*e]),r[t-i+a*e]=s/Math.min(t+1,e-1+o-t,o))}function pE(e,t,n,r,i){const o=1+(i<<1);for(let a=0;a=i&&(s>=o&&(u-=n[a+(s-o)*e]),r[a+(s-i)*e]=u/Math.min(s+1,t-1+o-s,o))}function gE(e){Fa.call(this,null,e)}uE.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},De(uE,Fa,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=e.field||E,o=rE().smooth(!1!==e.smooth),a=e.thresholds||function(e,t,n){const r=sE(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(e.map((e=>Na(t(e).values))))}(r,i,e),s=null===e.as?null:e.as||"contour",u=[];return r.forEach((t=>{const n=i(t),r=o.size([n.width,n.height])(n.values,z(a)?a:a(n.values));!function(e,t,n,r){let i=r.scale||t.scale,o=r.translate||t.translate;if(ce(i)&&(i=i(n,r)),ce(o)&&(o=o(n,r)),(1===i||null==i)&&!o)return;const a=(je(i)?i:i[0])||1,s=(je(i)?i:i[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;e.forEach(lE(t,a,s,u,l))}(r,n,t,e),r.forEach((e=>{u.push(na(t,ea(null!=s?{[s]:e}:e)))}))})),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}}),gE.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const mE=["x","y","weight","size","cellSize","bandwidth"];function yE(e,t){return mE.forEach((n=>null!=t[n]?e[n](t[n]):0)),e}function vE(e){Fa.call(this,null,e)}De(gE,Fa,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=function(e,t){var n,r,i,o,a,s,u=[],l=e=>e(o);if(null==t)u.push(e);else for(n={},r=0,i=e.length;rea(function(e,t){for(let n=0;nY_})).map(u)).concat(Ls(aw(o/h)*h,i,h).filter((function(e){return nw(e%g)>Y_})).map(l))}return y.lines=function(){return v().map((function(e){return{type:"LineString",coordinates:e}}))},y.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(f(a).slice(1),c(n).reverse().slice(1),f(s).reverse().slice(1))]}},y.extent=function(e){return arguments.length?y.extentMajor(e).extentMinor(e):y.extentMinor()},y.extentMajor=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],s=+e[0][1],a=+e[1][1],r>n&&(e=r,r=n,n=e),s>a&&(e=s,s=a,a=e),y.precision(m)):[[r,s],[n,a]]},y.extentMinor=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],o=+n[0][1],i=+n[1][1],t>e&&(n=t,t=e,e=n),o>i&&(n=o,o=i,i=n),y.precision(m)):[[t,o],[e,i]]},y.step=function(e){return arguments.length?y.stepMajor(e).stepMinor(e):y.stepMinor()},y.stepMajor=function(e){return arguments.length?(p=+e[0],g=+e[1],y):[p,g]},y.stepMinor=function(e){return arguments.length?(d=+e[0],h=+e[1],y):[d,h]},y.precision=function(d){return arguments.length?(m=+d,u=QA(o,i,90),l=eE(t,e,m),c=QA(s,a,90),f=eE(r,n,m),y):m},y.extentMajor([[-180,-90+Y_],[180,90-Y_]]).extentMinor([[-180,-80-Y_],[180,80+Y_]])}()}function OE(e){Fa.call(this,null,e)}function DE(e){if(!ce(e))return!1;const t=Ye(y(e));return t.$x||t.$y||t.$value||t.$max}function CE(e){Fa.call(this,null,e),this.modified(!0)}function SE(e,t,n){ce(e[t])&&e[t](n)}function FE(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,o,a,s,u,l,c,f,d,h=e._root,p={data:r},g=e._x0,m=e._y0,y=e._x1,v=e._y1;if(!h)return e._root=p,e;for(;h.length;)if((l=t>=(o=(g+y)/2))?g=o:y=o,(c=n>=(a=(m+v)/2))?m=a:v=a,i=h,!(h=h[f=c<<1|l]))return i[f]=p,e;if(s=+e._x.call(null,h.data),u=+e._y.call(null,h.data),t===s&&n===u)return p.next=h,i?i[f]=p:e._root=p,e;do{i=i?i[f]=new Array(4):e._root=new Array(4),(l=t>=(o=(g+y)/2))?g=o:y=o,(c=n>=(a=(m+v)/2))?m=a:v=a}while((f=c<<1|l)==(d=(u>=a)<<1|s>=o));return i[d]=h,i[f]=p,e}function ME(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function jE(e){return e[0]}function $E(e){return e[1]}function NE(e,t,n){var r=new BE(null==t?jE:t,null==n?$E:n,NaN,NaN,NaN,NaN);return null==e?r:r.addAll(e)}function BE(e,t,n,r,i,o){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function TE(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}_E.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},De(_E,Fa,{transform(e,t){var n,r=this._features,i=this._points,o=e.fields,a=o&&o[0],s=o&&o[1],u=e.geojson||!o&&E,l=t.ADD;n=e.modified()||t.changed(t.REM)||t.modified(y(u))||a&&t.modified(y(a))||s&&t.modified(y(s)),this.value&&!n||(l=t.SOURCE,this._features=r=[],this._points=i=[]),u&&t.visit(l,(e=>r.push(u(e)))),a&&s&&(t.visit(l,(e=>{var t=a(e),n=s(e);null!=t&&null!=n&&(t=+t)===t&&(n=+n)===n&&i.push([t,n])})),r=r.concat({type:bE,geometry:{type:"MultiPoint",coordinates:i}})),this.value={type:xE,features:r}}}),wE.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},De(wE,Fa,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.field||E,o=e.as||"path",a=n.SOURCE;!r||e.modified()?(this.value=r=JA(e.projection),n.materialize().reflow()):a=i===E||t.modified(i.fields)?n.ADD_MOD:n.ADD;const s=function(e,t){const n=e.pointRadius();return e.context(null),null!=t&&e.pointRadius(t),n}(r,e.pointRadius);return n.visit(a,(e=>e[o]=r(i(e)))),r.pointRadius(s),n.modifies(o)}}),kE.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},De(kE,Fa,{transform(e,t){var n,r=e.projection,i=e.fields[0],o=e.fields[1],a=e.as||["x","y"],s=a[0],u=a[1];function l(e){const t=r([i(e),o(e)]);t?(e[s]=t[0],e[u]=t[1]):(e[s]=void 0,e[u]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(n=t.modified(i.fields)||t.modified(o.fields),t.visit(n?t.ADD_MOD:t.ADD,l)),t.modifies(a)}}),AE.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},De(AE,Fa,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.as||"shape",o=n.ADD;return r&&!e.modified()||(this.value=r=function(e,t,n){const r=null==n?n=>e(t(n)):r=>{var i=e.pointRadius(),o=e.pointRadius(n)(t(r));return e.pointRadius(i),o};return r.context=t=>(e.context(t),r),r}(JA(e.projection),e.field||k("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,(e=>e[i]=r)),n.modifies(i)}}),EE.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},De(EE,Fa,{transform(e,t){var n,r=this.value,i=this.generator;if(!r.length||e.modified())for(const t in e)ce(i[t])&&i[t](e[t]);return n=i(),r.length?t.mod.push(ra(r[0],n)):t.add.push(ea(n)),r[0]=n,t}}),OE.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},De(OE,Fa,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,r="shared"===e.resolve,i=e.field||E,o=function(e,t){let n;return ce(e)?(n=n=>e(n,t),n.dep=DE(e)):e?n=ye(e):(n=e=>e.$value/e.$max||0,n.dep=!0),n}(e.opacity,e),a=function(e,t){let n;return ce(e)?(n=n=>ef(e(n,t)),n.dep=DE(e)):n=ye(ef(e||"#888")),n}(e.color,e),s=e.as||"image",u={$x:0,$y:0,$value:0,$max:r?Na(n.map((e=>Na(i(e).values)))):0};return n.forEach((e=>{const t=i(e),n=be({},e,u);r||(n.$max=Na(t.values||[])),e[s]=function(e,t,n,r){const i=e.width,o=e.height,a=e.x1||0,s=e.y1||0,u=e.x2||i,l=e.y2||o,c=e.values,f=c?e=>c[e]:O,d=Oc(u-a,l-s),h=d.getContext("2d"),p=h.getImageData(0,0,u-a,l-s),g=p.data;for(let e=s,o=0;e{null!=e[t]&&SE(n,t,e[t])}))):XA.forEach((t=>{e.modified(t)&&SE(n,t,e[t])})),null!=e.pointRadius&&n.path.pointRadius(e.pointRadius),e.fit&&function(e,t){const n=function(e){return 1===(e=ue(e)).length?e[0]:{type:xE,features:e.reduce(((e,t)=>e.concat(function(e){return e.type===xE?e.features:ue(e).filter((e=>null!=e)).map((e=>e.type===bE?e:{type:bE,geometry:e}))}(t))),[])}}(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});var zE=NE.prototype=BE.prototype;function RE(e){return function(){return e}}function PE(e){return 1e-6*(e()-.5)}function LE(e){return e.x+e.vx}function IE(e){return e.y+e.vy}zE.copy=function(){var e,t,n=new BE(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=TE(r),n;for(e=[{source:r,target:n._root=new Array(4)}];r=e.pop();)for(var i=0;i<4;++i)(t=r.source[i])&&(t.length?e.push({source:t,target:r.target[i]=new Array(4)}):r.target[i]=TE(t));return n},zE.add=function(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return FE(this.cover(t,n),t,n,e)},zE.addAll=function(e){var t,n,r,i,o=e.length,a=new Array(o),s=new Array(o),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=r),if&&(f=i));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;ne||e>=i||r>t||t>=o;)switch(s=(td||(o=u.y0)>h||(a=u.x1)=y)<<1|e>=m)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=u)}else{var v=e-+this._x.call(null,g.data),b=t-+this._y.call(null,g.data),x=v*v+b*b;if(x=(s=(p+m)/2))?p=s:m=s,(c=a>=(u=(g+y)/2))?g=u:y=u,t=h,!(h=h[f=c<<1|l]))return this;if(!h.length)break;(t[f+1&3]||t[f+2&3]||t[f+3&3])&&(n=t,d=f)}for(;h.data!==e;)if(r=h,!(h=h.next))return this;return(i=h.next)&&delete h.next,r?(i?r.next=i:delete r.next,this):t?(i?t[f]=i:delete t[f],(h=t[0]||t[1]||t[2]||t[3])&&h===(t[3]||t[2]||t[1]||t[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=i,this)},zE.removeAll=function(e){for(var t=0,n=e.length;t{}};function qE(){for(var e,t=0,n=arguments.length,r={};t=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++a0)for(var n,r,i=new Array(n),o=0;o=0&&t._call.call(void 0,e),t=t._next;--ZE}()}finally{ZE=0,function(){for(var e,t,n=YE,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:YE=t);XE=e,fO(r)}(),tO=0}}function cO(){var e=rO.now(),t=e-eO;t>QE&&(nO-=t,eO=e)}function fO(e){ZE||(JE&&(JE=clearTimeout(JE)),e-tO>24?(e<1/0&&(JE=setTimeout(lO,e-rO.now()-nO)),KE&&(KE=clearInterval(KE))):(KE||(eO=rO.now(),KE=setInterval(cO,QE)),ZE=1,iO(lO)))}sO.prototype=uO.prototype={constructor:sO,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?oO():+n)+(null==t?0:+t),this._next||XE===this||(XE?XE._next=this:YE=this,XE=this),this._call=e,this._time=n,fO()},stop:function(){this._call&&(this._call=null,this._time=1/0,fO())}};const dO=4294967296;function hO(e){return e.x}function pO(e){return e.y}var gO=Math.PI*(3-Math.sqrt(5));function mO(e){return e.index}function yO(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}const vO={center:function(e,t){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;il+p||oc+p||au.index){var g=l-s.x-s.vx,m=c-s.y-s.vy,y=g*g+m*m;ye.r&&(e.r=e[t].r)}function u(){if(t){var r,i,o=t.length;for(n=new Array(o),r=0;r=s)){(e.data!==t||e.next)&&(0===f&&(p+=(f=PE(n))*f),0===d&&(p+=(d=PE(n))*d),p[s(e,t,r),e])));for(a=0,i=new Array(l);at(e,n):t)}function CO(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function SO(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=MO)):void 0===t&&(t=FO);for(var n,r,i,o,a,s=new NO(e),u=[s];n=u.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)u.push(r=i[o]=new NO(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore($O)}function FO(e){return e.children}function MO(e){return Array.isArray(e)?e[1]:null}function jO(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function $O(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function NO(e){this.data=e,this.depth=this.height=0,this.parent=null}function BO(e){return null==e?null:TO(e)}function TO(e){if("function"!=typeof e)throw new Error;return e}function zO(){return 0}function RO(e){return function(){return e}}kO.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:wO}]},De(kO,Fa,{transform(e,t){var n,r,i=this.value,o=t.changed(t.ADD_REM),a=e.modified(xO),s=e.iterations||300;if(i?(o&&(t.modifies("index"),i.nodes(t.source)),(a||t.changed(t.MOD))&&AO(i,e,0,t)):(this.value=i=function(e,t){const n=function(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=uO(f),l=VE("tick","end"),c=function(){let e=1;return()=>(e=(1664525*e+1013904223)%dO)/dO}();function f(){d(),l.call("tick",t),n1?(null==n?s.delete(e):s.set(e,p(n)),t):s.get(e)},find:function(t,n,r){var i,o,a,s,u,l=0,c=e.length;for(null==r?r=1/0:r*=r,l=0;l1?(l.on(e,n),t):l.on(e)}}}(e),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),AO(n,t,!0).on("end",(()=>o=!0))}(t.source,e),i.on("tick",(n=t.dataflow,r=this,()=>n.touch(r).run())),e.static||(o=!0,i.tick()),t.modifies("index")),a||o||e.modified(_O)||t.changed()&&e.restart)if(i.alpha(Math.max(i.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(i.alphaMin(),1/s)),e.static)for(i.stop();--s>=0;)i.tick();else if(i.stopped()&&i.restart(),!o)return t.StopPropagation;return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let e,t=this._argops,s=0,u=t.length;s=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return SO(this).eachBefore(jO)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n0&&n*n>r*r+i*i}function qO(e,t){for(var n=0;n1e-6?(D+Math.sqrt(D*D-4*O*C))/(2*O):C/D);return{x:r+w+k*S,y:i+A+E*S,r:S}}function VO(e,t,n){var r,i,o,a,s=e.x-t.x,u=e.y-t.y,l=s*s+u*u;l?(i=t.r+n.r,i*=i,a=e.r+n.r,i>(a*=a)?(r=(l+a-i)/(2*l),o=Math.sqrt(Math.max(0,a/l-r*r)),n.x=e.x-r*s-o*u,n.y=e.y-r*u+o*s):(r=(l+i-a)/(2*l),o=Math.sqrt(Math.max(0,i/l-r*r)),n.x=t.x+r*s-o*u,n.y=t.y+r*u+o*s)):(n.x=t.x+n.r,n.y=t.y)}function YO(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function XO(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,o=(t.y*n.r+n.y*t.r)/r;return i*i+o*o}function ZO(e){this._=e,this.next=null,this.previous=null}function JO(e,t){if(!(o=(e=function(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}(e)).length))return 0;var n,r,i,o,a,s,u,l,c,f,d;if((n=e[0]).x=0,n.y=0,!(o>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;VO(r,n,i=e[2]),n=new ZO(n),r=new ZO(r),i=new ZO(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(u=3;ufunction(e){let t=(e=`${e}`).length;return fD(e,t-1)&&!fD(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r)))),n=t.map(cD),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(cD(e)),d.push(aD));h=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,i=d.length;a=0&&(l=d[e]).data===aD;--e)l.data=null}if(s.parent=iD,s.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore($O),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=BO(e),r):t},r.parentId=function(e){return arguments.length?(n=BO(e),r):n},r.path=function(t){return arguments.length?(e=BO(t),r):e},r}function cD(e){let t=e.length;if(t<2)return"";for(;--t>1&&!fD(e,t););return e.slice(0,t)}function fD(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function dD(e,t){return e.parent===t.parent?1:2}function hD(e){var t=e.children;return t?t[0]:e.t}function pD(e){var t=e.children;return t?t[t.length-1]:e.t}function gD(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function mD(e,t,n){return e.a.parent===t.parent?e.a:n}function yD(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}function vD(e,t){return e.parent===t.parent?1:2}function bD(e,t){return e+t.x}function xD(e,t){return Math.max(e,t.y)}function _D(e,t,n,r,i){for(var o,a=e.children,s=-1,u=a.length,l=e.value&&(i-n)/e.value;++sd&&(d=s),m=c*c*g,(h=Math.max(d/m,m/f))>p){c-=s;break}p=h}y.push(a={value:c,dice:u1?t:1)},n}(wD),ED=function e(t){function n(e,n,r,i,o){if((a=e._squarify)&&a.ratio===t)for(var a,s,u,l,c,f=-1,d=a.length,h=e.value;++f1?t:1)},n}(wD);function OD(e,t,n){const r={};return e.each((e=>{const i=e.data;n(i)&&(r[t(i)]=e)})),e.lookup=r,e}function DD(e){Fa.call(this,null,e)}DD.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const CD=e=>e.values;function SD(){const e=[],t={entries:e=>r(n(e,0),0),key:n=>(e.push(n),t)};function n(t,r){if(r>=e.length)return t;const i=t.length,o=e[r++],a={},s={};let u,l,c,f=-1;for(;++fe.length)return t;const i=[];for(const e in t)i.push({key:e,values:r(t[e],n)});return i}return t}function FD(e){Fa.call(this,null,e)}De(DD,Fa,{transform(e,t){t.source||_("Nest transform requires an upstream data source.");var n=e.generate,r=e.modified(),i=t.clone(),o=this.value;return(!o||r||t.changed())&&(o&&o.each((e=>{e.children&&Jo(e.data)&&i.rem.push(e.data)})),this.value=o=SO({values:ue(e.keys).reduce(((e,t)=>(e.key(t),e)),SD()).entries(i.source)},CD),n&&o.each((e=>{e.children&&(e=ea(e.data),i.add.push(e),i.source.push(e))})),OD(o,Ko,Ko)),i.source.root=o,i}});const MD=(e,t)=>e.parent===t.parent?1:2;De(FD,Fa,{transform(e,t){t.source&&t.source.root||_(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),r=this.fields,i=t.source.root,o=e.as||r;e.field?i.sum(e.field):i.count(),e.sort&&i.sort(ia(e.sort,(e=>e.data))),function(e,t,n){for(let r,i=0,o=t.length;ifunction(e,t,n){const r=e.data,i=t.length-1;for(let o=0;o(e=(1664525*e+1013904223)%PO)/PO}();return i.x=t/2,i.y=n/2,e?i.eachBefore(QO(e)).eachAfter(eD(r,.5,o)).eachBefore(tD(1)):i.eachBefore(QO(KO)).eachAfter(eD(zO,1,o)).eachAfter(eD(r,i.r/Math.min(t,n),o)).eachBefore(tD(Math.min(t,n)/(2*i.r))),i}return i.radius=function(t){return arguments.length?(e=BO(t),i):e},i.size=function(e){return arguments.length?(t=+e[0],n=+e[1],i):[t,n]},i.padding=function(e){return arguments.length?(r="function"==typeof e?e:RO(+e),i):r},i},params:["radius","size","padding"],fields:jD});const ND=["x0","y0","x1","y1","depth","children"];function BD(e){FD.call(this,e)}function TD(e){Fa.call(this,null,e)}BD.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ND.length,default:ND}]},De(BD,FD,{layout:function(){var e=1,t=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=e,i.y1=t/o,i.eachBefore(function(e,t){return function(r){r.children&&rD(r,r.x0,e*(r.depth+1)/t,r.x1,e*(r.depth+2)/t);var i=r.x0,o=r.y0,a=r.x1-n,s=r.y1-n;a=0;--i)s.push(n=t.children[i]=new yD(r[i],i)),n.parent=t;return(a.parent=new yD(null,0)).children=[a],a}(i);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(a),r)i.eachBefore(s);else{var l=i,c=i,f=i;i.eachBefore((function(e){e.xc.x&&(c=e),e.depth>f.depth&&(f=e)}));var d=l===c?1:e(l,c)/2,h=d-l.x,p=t/(c.x+d+h),g=n/(f.depth||1);i.eachBefore((function(e){e.x=(e.x+h)*p,e.y=e.depth*g}))}return i}function o(t){var n=t.children,r=t.parent.children,i=t.i?r[t.i-1]:null;if(n){!function(e){for(var t,n=0,r=0,i=e.children,o=i.length;--o>=0;)(t=i[o]).z+=n,t.m+=n,n+=t.s+(r+=t.c)}(t);var o=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-o):t.z=o}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function(t,n,r){if(n){for(var i,o=t,a=t,s=n,u=o.parent.children[0],l=o.m,c=a.m,f=s.m,d=u.m;s=pD(s),o=hD(o),s&&o;)u=hD(u),(a=pD(a)).a=t,(i=s.z+f-o.z-l+e(s._,o._))>0&&(gD(mD(s,t,r),t,i),l+=i,c+=i),f+=s.m,l+=o.m,d+=u.m,c+=a.m;s&&!pD(a)&&(a.t=s,a.m+=f-c),o&&!hD(u)&&(u.t=o,u.m+=l-d,r=t)}return r}(t,i,t.parent.A||r[0])}function a(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*n}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i},cluster:function(){var e=vD,t=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(t){var n=t.children;n?(t.x=function(e){return e.reduce(bD,0)/e.length}(n),t.y=function(e){return 1+e.reduce(xD,0)}(n)):(t.x=o?a+=e(t,o):0,t.y=0,o=t)}));var s=function(e){for(var t;t=e.children;)e=t[0];return e}(i),u=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(i),l=s.x-e(s,u)/2,c=u.x+e(u,s)/2;return i.eachAfter(r?function(e){e.x=(e.x-i.x)*t,e.y=(i.y-e.y)*n}:function(e){e.x=(e.x-l)/(c-l)*t,e.y=(1-(i.y?e.y/i.y:1))*n})}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i}},RD=["x","y","depth","children"];function PD(e){FD.call(this,e)}function LD(e){Fa.call(this,[],e)}PD.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:RD.length,default:RD}]},De(PD,FD,{layout(e){const t=e||"tidy";if(ke(zD,t))return zD[t]();_("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:RD}),LD.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},De(LD,Fa,{transform(e,t){const n=this.value,r=t.source&&t.source.root,i=t.fork(t.NO_SOURCE),o={};return r||_("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(i.rem=n,t.visit(t.SOURCE,(e=>o[Ko(e)]=1)),r.each((e=>{const t=e.data,n=e.parent&&e.parent.data;n&&o[Ko(t)]&&o[Ko(n)]&&i.add.push(ea({source:n,target:t}))})),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,(e=>o[Ko(e)]=1)),n.forEach((e=>{(o[Ko(e.source)]||o[Ko(e.target)])&&i.mod.push(e)}))),i}});const ID={binary:function(e,t,n,r,i){var o,a,s=e.children,u=s.length,l=new Array(u+1);for(l[0]=a=o=0;o=n-1){var c=s[t];return c.x0=i,c.y0=o,c.x1=a,void(c.y1=u)}for(var f=l[t],d=r/2+f,h=t+1,p=n-1;h>>1;l[g]u-o){var v=r?(i*y+a*m)/r:a;e(t,h,m,i,o,v,u),e(h,n,y,v,o,a,u)}else{var b=r?(o*y+u*m)/r:u;e(t,h,m,i,o,a,b),e(h,n,y,i,b,a,u)}}(0,u,e.value,t,n,r,i)},dice:rD,slice:_D,slicedice:function(e,t,n,r,i){(1&e.depth?_D:rD)(e,t,n,r,i)},squarify:AD,resquarify:ED},UD=["x0","y0","x1","y1","depth","children"];function qD(e){FD.call(this,e)}qD.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:UD.length,default:UD}]},De(qD,FD,{layout(){const e=function(){var e=AD,t=!1,n=1,r=1,i=[0],o=zO,a=zO,s=zO,u=zO,l=zO;function c(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(f),i=[0],t&&e.eachBefore(nD),e}function f(t){var n=i[t.depth],r=t.x0+n,c=t.y0+n,f=t.x1-n,d=t.y1-n;f{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{ke(ID,t)?e.tile(ID[t]):_("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:UD});const WD=4278190080;function HD(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function GD(e,t,n){if(!t.length)return;const r=t[0].mark.marktype;"group"===r?t.forEach((t=>{t.items.forEach((t=>GD(e,t.items,n)))})):rv[r].draw(e,{items:n?t.map(VD):t})}function VD(e){const t=na(e,{});return t.stroke&&0!==t.strokeOpacity||t.fill&&0!==t.fillOpacity?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const YD=5,XD=31,ZD=32,JD=new Uint32Array(ZD+1),KD=new Uint32Array(ZD+1);KD[0]=0,JD[0]=~KD[0];for(let e=1;e<=ZD;++e)KD[e]=KD[e-1]<<1|1,JD[e]=~KD[e];function QD(e,t,n,r,i,o){let a=n/2;return e-a<0||e+a>i||t-(a=r/2)<0||t+a>o}function eC(e,t,n,r,i,o,a,s){const u=i*o/(2*r),l=e(t-u),c=e(t+u),f=e(n-(o/=2)),d=e(n+o);return a.outOfBounds(l,f,c,d)||a.getRange(l,f,c,d)||s&&s.getRange(l,f,c,d)}const tC=[-1,-1,1,1],nC=[-1,1,-1,1],rC=["right","center","left"],iC=["bottom","middle","top"];function oC(e,t,n,r,i,o,a,s,u,l,c,f){return!(i.outOfBounds(e,n,t,r)||(f&&o||i).getRange(e,n,t,r))}const aC={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},sC={naive:function(e,t,n,r){const i=e.width,o=e.height;return function(e){const t=e.datum.datum.items[r].items,n=t.length,a=e.datum.fontSize,s=zy.width(e.datum,e.datum.text);let u,l,c,f,d,h,p,g=0;for(let r=0;r=g&&(g=p,e.x=d,e.y=h);return d=s/2,h=a/2,u=e.x-d,l=e.x+d,c=e.y-h,f=e.y+h,e.align="center",u<0&&l<=i?e.align="left":0<=u&&i=1;)d=(h+p)/2,eC(e,c,f,l,u,d,a,s)?p=d:h=d;if(h>r)return[c,f,h,!0]}}return function(t){const s=t.datum.datum.items[r].items,l=s.length,c=t.datum.fontSize,f=zy.width(t.datum,t.datum.text);let d,h,p,g,m,y,v,b,x,_,w,k,A,E,O,D,C,S=n?c:0,F=!1,M=!1,j=0;for(let r=0;rh&&(C=d,d=h,h=C),p>g&&(C=p,p=g,g=C),x=e(d),w=e(h),_=~~((x+w)/2),k=e(p),E=e(g),A=~~((k+E)/2),v=_;v>=x;--v)for(b=A;b>=k;--b)D=u(v,b,S,f,c),D&&([t.x,t.y,S,F]=D);for(v=_;v<=w;++v)for(b=A;b<=E;++b)D=u(v,b,S,f,c),D&&([t.x,t.y,S,F]=D);F||n||(O=Math.abs(h-d+g-p),m=(d+h)/2,y=(p+g)/2,O>=j&&!QD(m,y,f,c,i,o)&&!eC(e,m,y,c,f,c,a,null)&&(j=O,t.x=m,t.y=y,M=!0))}return!(!F&&!M||(m=f/2,y=c/2,a.setRange(e(t.x-m),e(t.y-y),e(t.x+m),e(t.y+y)),t.align="center",t.baseline="middle",0))}},floodfill:function(e,t,n,r){const i=e.width,o=e.height,a=t[0],s=t[1],u=e.bitmap();return function(t){const l=t.datum.datum.items[r].items,c=l.length,f=t.datum.fontSize,d=zy.width(t.datum,t.datum.text),h=[];let p,g,m,y,v,b,x,_,w,k,A,E,O=n?f:0,D=!1,C=!1,S=0;for(let r=0;r=1;)A=(w+k)/2,eC(e,v,b,f,d,A,a,s)?k=A:w=A;w>O&&(t.x=v,t.y=b,O=w,D=!0)}}D||n||(E=Math.abs(g-p+y-m),v=(p+g)/2,b=(m+y)/2,E>=S&&!QD(v,b,d,f,i,o)&&!eC(e,v,b,f,d,f,a,null)&&(S=E,t.x=v,t.y=b,C=!0))}return!(!D&&!C||(v=d/2,b=f/2,a.setRange(e(t.x-v),e(t.y-b),e(t.x+v),e(t.y+b)),t.align="center",t.baseline="middle",0))}}};function uC(e,t,n,r,i,o,a,s,u,l,c){if(!e.length)return e;const f=Math.max(r.length,i.length),d=function(e,t){const n=new Float64Array(t),r=e.length;for(let t=0;t[e.x,e.x,e.x,e.y,e.y,e.y];return e?"line"===e||"area"===e?e=>i(e.datum):"line"===t?e=>{const t=e.datum.items[r].items;return i(t.length?t["start"===n?0:t.length-1]:{x:NaN,y:NaN})}:e=>{const t=e.datum.bounds;return[t.x1,(t.x1+t.x2)/2,t.x2,t.y1,(t.y1+t.y2)/2,t.y2]}:i}(p,g,s,u),v=null===l||l===1/0,b=m&&"naive"===c;var x;let _=-1,w=-1;const k=e.map((e=>{const t=v?zy.width(e,e.text):void 0;return _=Math.max(_,t),w=Math.max(w,e.fontSize),{datum:e,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(e),textWidth:t}}));l=null===l||l===1/0?Math.max(_,w)+Math.max(...r):l;const A=function(e,t,n){const r=Math.max(1,Math.sqrt(e*t/1e6)),i=~~((e+2*n+r)/r),o=~~((t+2*n+r)/r),a=e=>~~((e+n)/r);return a.invert=e=>e*r-n,a.bitmap=()=>function(e,t){const n=new Uint32Array(~~((e*t+ZD)/ZD));function r(e,t){n[e]|=t}function i(e,t){n[e]&=t}return{array:n,get:(t,r)=>{const i=r*e+t;return n[i>>>YD]&1<<(i&XD)},set:(t,n)=>{const i=n*e+t;r(i>>>YD,1<<(i&XD))},clear:(t,n)=>{const r=n*e+t;i(r>>>YD,~(1<<(r&XD)))},getRange:(t,r,i,o)=>{let a,s,u,l,c=o;for(;c>=r;--c)if(a=c*e+t,s=c*e+i,u=a>>>YD,l=s>>>YD,u===l){if(n[u]&JD[a&XD]&KD[1+(s&XD)])return!0}else{if(n[u]&JD[a&XD])return!0;if(n[l]&KD[1+(s&XD)])return!0;for(let e=u+1;e{let a,s,u,l,c;for(;n<=o;++n)if(a=n*e+t,s=n*e+i,u=a>>>YD,l=s>>>YD,u===l)r(u,JD[a&XD]&KD[1+(s&XD)]);else for(r(u,JD[a&XD]),r(l,KD[1+(s&XD)]),c=u+1;c{let a,s,u,l,c;for(;n<=o;++n)if(a=n*e+t,s=n*e+r,u=a>>>YD,l=s>>>YD,u===l)i(u,KD[a&XD]|JD[1+(s&XD)]);else for(i(u,KD[a&XD]),i(l,JD[1+(s&XD)]),c=u+1;cn<0||r<0||o>=t||i>=e}}(i,o),a.ratio=r,a.padding=n,a.width=e,a.height=t,a}(t[0],t[1],l);let E;if(!b){n&&k.sort(((e,t)=>n(e.datum,t.datum)));let t=!1;for(let e=0;ee.datum));E=o.length||r?function(e,t,n,r,i){const o=e.width,a=e.height,s=r||i,u=Oc(o,a).getContext("2d"),l=Oc(o,a).getContext("2d"),c=s&&Oc(o,a).getContext("2d");n.forEach((e=>GD(u,e,!1))),GD(l,t,!1),s&&GD(c,t,!0);const f=HD(u,o,a),d=HD(l,o,a),h=s&&HD(c,o,a),p=e.bitmap(),g=s&&e.bitmap();let m,y,v,b,x,_,w,k;for(y=0;yn.set(e(t.boundary[0]),e(t.boundary[3])))),[n,void 0]}(A,a&&k)}const O=m?sC[c](A,E,a,u):function(e,t,n,r){const i=e.width,o=e.height,a=t[0],s=t[1],u=r.length;return function(t){const l=t.boundary,c=t.datum.fontSize;if(l[2]<0||l[5]<0||l[0]>i||l[3]>o)return!1;let f,d,h,p,g,m,y,v,b,x,_,w,k,A,E,O=t.textWidth??0;for(let i=0;i>>2&3)-1,h=0===f&&0===d||r[i]<0,p=f&&d?Math.SQRT1_2:1,g=r[i]<0?-1:1,m=l[1+f]+r[i]*f*p,_=l[4+d]+g*c*d/2+r[i]*d*p,v=_-c/2,b=_+c/2,w=e(m),A=e(v),E=e(b),!O){if(!oC(w,w,A,E,a,s,0,0,0,0,0,h))continue;O=zy.width(t.datum,t.datum.text)}if(x=m+g*O*f/2,m=x-O/2,y=x+O/2,w=e(m),k=e(y),oC(w,k,A,E,a,s,0,0,0,0,0,h))return t.x=f?f*g<0?y:m:x,t.y=d?d*g<0?b:v:_,t.align=rC[f*g+1],t.baseline=iC[d*g+1],a.setRange(w,A,k,E),!0}return!1}}(A,E,h,d);return k.forEach((e=>e.opacity=+O(e))),k}const lC=["x","y","opacity","align","baseline"],cC=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function fC(e){Fa.call(this,null,e)}function dC(e,t){var n,r,i,o,a,s,u=[],l=function(e){return e(o)};if(null==t)u.push(e);else for(n={},r=0,i=e.length;r{const t=e.datum;t[r[0]]=e.x,t[r[1]]=e.y,t[r[2]]=e.opacity,t[r[3]]=e.align,t[r[4]]=e.baseline})),t.reflow(n).modifies(r)}}),hC.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},De(hC,Fa,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=dC(t.materialize(t.SOURCE).source,e.groupby),i=(e.groupby||[]).map(m),o=i.length,a=e.as||[m(e.x),m(e.y)],s=[];r.forEach((t=>{Ns(t,e.x,e.y,e.bandwidth||.3).forEach((e=>{const n={};for(let e=0;e"poly"===e?t:"quad"===e?2:1)(o,a),u=e.as||[m(e.x),m(e.y)],l=pC[o],c=[];let f=e.extent;ke(pC,o)||_("Invalid regression method: "+o),null!=f&&"log"===o&&f[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),f=null),r.forEach((n=>{if(n.length<=s)return void t.dataflow.warn("Skipping regression with more parameters than data points.");const r=l(n,e.x,e.y,a);if(e.params)return void c.push(ea({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));const d=f||xe(n,e.x),h=e=>{const t={};for(let e=0;eh([e,r.predict(e)]))):Rs(r.predict,d,25,200).forEach(h)})),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});const mC=134217729;function yC(e,t,n,r,i){let o,a,s,u,l=t[0],c=r[0],f=0,d=0;c>l==c>-l?(o=l,l=t[++f]):(o=c,c=r[++d]);let h=0;if(fl==c>-l?(a=l+o,s=o-(a-l),l=t[++f]):(a=c+o,s=o-(a-c),c=r[++d]),o=a,0!==s&&(i[h++]=s);fl==c>-l?(a=o+l,u=a-o,s=o-(a-u)+(l-u),l=t[++f]):(a=o+c,u=a-o,s=o-(a-u)+(c-u),c=r[++d]),o=a,0!==s&&(i[h++]=s);for(;f0!=s>0)return u;const l=Math.abs(a+s);return Math.abs(u)>=33306690738754716e-32*l?u:-function(e,t,n,r,i,o,a){let s,u,l,c,f,d,h,p,g,m,y,v,b,x,_,w,k,A;const E=e-i,O=n-i,D=t-o,C=r-o;x=E*C,d=mC*E,h=d-(d-E),p=E-h,d=mC*C,g=d-(d-C),m=C-g,_=p*m-(x-h*g-p*g-h*m),w=D*O,d=mC*D,h=d-(d-D),p=D-h,d=mC*O,g=d-(d-O),m=O-g,k=p*m-(w-h*g-p*g-h*m),y=_-k,f=_-y,bC[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,bC[1]=b-(y+f)+(f-w),A=v+y,f=A-v,bC[2]=v-(A-f)+(y-f),bC[3]=A;let S=function(e,t){let n=t[0];for(let e=1;e<4;e++)n+=t[e];return n}(0,bC),F=22204460492503146e-32*a;if(S>=F||-S>=F)return S;if(f=e-E,s=e-(E+f)+(f-i),f=n-O,l=n-(O+f)+(f-i),f=t-D,u=t-(D+f)+(f-o),f=r-C,c=r-(C+f)+(f-o),0===s&&0===u&&0===l&&0===c)return S;if(F=11093356479670487e-47*a+33306690738754706e-32*Math.abs(S),S+=E*c+C*s-(D*l+O*u),S>=F||-S>=F)return S;x=s*C,d=mC*s,h=d-(d-s),p=s-h,d=mC*C,g=d-(d-C),m=C-g,_=p*m-(x-h*g-p*g-h*m),w=u*O,d=mC*u,h=d-(d-u),p=u-h,d=mC*O,g=d-(d-O),m=O-g,k=p*m-(w-h*g-p*g-h*m),y=_-k,f=_-y,kC[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,kC[1]=b-(y+f)+(f-w),A=v+y,f=A-v,kC[2]=v-(A-f)+(y-f),kC[3]=A;const M=yC(4,bC,4,kC,xC);x=E*c,d=mC*E,h=d-(d-E),p=E-h,d=mC*c,g=d-(d-c),m=c-g,_=p*m-(x-h*g-p*g-h*m),w=D*l,d=mC*D,h=d-(d-D),p=D-h,d=mC*l,g=d-(d-l),m=l-g,k=p*m-(w-h*g-p*g-h*m),y=_-k,f=_-y,kC[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,kC[1]=b-(y+f)+(f-w),A=v+y,f=A-v,kC[2]=v-(A-f)+(y-f),kC[3]=A;const j=yC(M,xC,4,kC,_C);x=s*c,d=mC*s,h=d-(d-s),p=s-h,d=mC*c,g=d-(d-c),m=c-g,_=p*m-(x-h*g-p*g-h*m),w=u*l,d=mC*u,h=d-(d-u),p=u-h,d=mC*l,g=d-(d-l),m=l-g,k=p*m-(w-h*g-p*g-h*m),y=_-k,f=_-y,kC[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,kC[1]=b-(y+f)+(f-w),A=v+y,f=A-v,kC[2]=v-(A-f)+(y-f),kC[3]=A;const $=yC(j,_C,4,kC,wC);return wC[$-1]}(e,t,n,r,i,o,l)}vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(8),vC(8),vC(8),vC(4),vC(8),vC(8),vC(8),vC(12),vC(192),vC(192),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(8),vC(8),vC(8),vC(8),vC(8),vC(8),vC(8),vC(8),vC(8),vC(4),vC(4),vC(4),vC(8),vC(16),vC(16),vC(16),vC(32),vC(32),vC(48),vC(64),vC(1152),vC(1152),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(24),vC(24),vC(24),vC(24),vC(24),vC(24),vC(24),vC(24),vC(24),vC(24),vC(1152),vC(1152),vC(1152),vC(1152),vC(1152),vC(2304),vC(2304),vC(3456),vC(5760),vC(8),vC(8),vC(8),vC(16),vC(24),vC(48),vC(48),vC(96),vC(192),vC(384),vC(384),vC(384),vC(768),vC(96),vC(96),vC(96),vC(1152);const EC=Math.pow(2,-52),OC=new Uint32Array(512);class DC{static from(e,t=$C,n=NC){const r=e.length,i=new Float64Array(2*r);for(let o=0;o>1;if(t>0&&"number"!=typeof e[0])throw new Error("Expected coords to contain numbers.");this.coords=e;const n=Math.max(2*t-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=e.length>>1;let a=1/0,s=1/0,u=-1/0,l=-1/0;for(let t=0;tu&&(u=n),r>l&&(l=r),this._ids[t]=t}const c=(a+u)/2,f=(s+l)/2;let d,h,p,g=1/0;for(let t=0;t0&&(h=t,g=n)}let v=e[2*h],b=e[2*h+1],x=1/0;for(let t=0;tr&&(t[n++]=i,r=this._dists[i])}return this.hull=t.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(AC(m,y,v,b,_,w)<0){const e=h,t=v,n=b;h=p,v=_,b=w,p=e,_=t,w=n}const k=function(e,t,n,r,i,o){const a=n-e,s=r-t,u=i-e,l=o-t,c=a*a+s*s,f=u*u+l*l,d=.5/(a*l-s*u);return{x:e+(l*c-s*f)*d,y:t+(a*f-u*c)*d}}(m,y,v,b,_,w);this._cx=k.x,this._cy=k.y;for(let t=0;t0&&Math.abs(l-o)<=EC&&Math.abs(c-a)<=EC)continue;if(o=l,a=c,u===d||u===h||u===p)continue;let f=0;for(let e=0,t=this._hashKey(l,c);e=0;)if(m=g,m===f){m=-1;break}if(-1===m)continue;let y=this._addTriangle(m,u,n[m],-1,-1,r[m]);r[u]=this._legalize(y+2),r[m]=y,A++;let v=n[m];for(;g=n[v],AC(l,c,e[2*v],e[2*v+1],e[2*g],e[2*g+1])<0;)y=this._addTriangle(v,u,g,r[u],-1,r[v]),r[u]=this._legalize(y+2),n[v]=v,A--,v=g;if(m===f)for(;g=t[m],AC(l,c,e[2*g],e[2*g+1],e[2*m],e[2*m+1])<0;)y=this._addTriangle(g,u,m,-1,r[m],r[g]),this._legalize(y+2),r[g]=y,n[m]=m,A--,m=g;this._hullStart=t[u]=m,n[m]=t[v]=u,n[u]=v,i[this._hashKey(l,c)]=u,i[this._hashKey(e[2*m],e[2*m+1])]=m}this.hull=new Uint32Array(A);for(let e=0,t=this._hullStart;e0?3-n:1+n)/4}(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:t,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[e],s=e-e%3;if(o=s+(e+2)%3,-1===a){if(0===i)break;e=OC[--i];continue}const u=a-a%3,l=s+(e+1)%3,c=u+(a+2)%3,f=t[o],d=t[e],h=t[l],p=t[c];if(SC(r[2*f],r[2*f+1],r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1])){t[e]=p,t[a]=f;const r=n[c];if(-1===r){let t=this._hullStart;do{if(this._hullTri[t]===c){this._hullTri[t]=e;break}t=this._hullPrev[t]}while(t!==this._hullStart)}this._link(e,r),this._link(a,n[o]),this._link(o,c);const s=u+(a+1)%3;i=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=r}else{let i=n+1,o=r;jC(e,n+r>>1,i),t[e[n]]>t[e[r]]&&jC(e,n,r),t[e[i]]>t[e[r]]&&jC(e,i,r),t[e[n]]>t[e[i]]&&jC(e,n,i);const a=e[i],s=t[a];for(;;){do{i++}while(t[e[i]]s);if(o=o-n?(MC(e,t,i,r),MC(e,t,n,o-1)):(MC(e,t,n,o-1),MC(e,t,i,r))}}function jC(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function $C(e){return e[0]}function NC(e){return e[1]}const BC=1e-6;class TC{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,t){this._+=`L${this._x1=+e},${this._y1=+t}`}arc(e,t,n){const r=(e=+e)+(n=+n),i=t=+t;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>BC||Math.abs(this._y1-i)>BC)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${e-n},${t}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(e,t,n,r){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class zC{constructor(){this._=[]}moveTo(e,t){this._.push([e,t])}closePath(){this._.push(this._[0].slice())}lineTo(e,t){this._.push([e,t])}value(){return this._.length?this._:null}}class RC{constructor(e,[t,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(t=+t)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=r,this.xmin=t,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:t,triangles:n},vectors:r}=this;let i,o;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let r,s,u=0,l=0,c=n.length;u1;)i-=2;for(let e=2;e0){if(t>=this.ymax)return null;(i=(this.ymax-t)/r)0){if(e>=this.xmax)return null;(i=(this.xmax-e)/n)this.xmax?2:0)|(tthis.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let t=0;t2&&function(e){const{triangles:t,coords:n}=e;for(let e=0;e1e-10)return!1}return!0}(e)){this.collinear=Int32Array.from({length:t.length/2},((e,t)=>t)).sort(((e,n)=>t[2*e]-t[2*n]||t[2*e+1]-t[2*n+1]));const e=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[t[2*e],t[2*e+1],t[2*n],t[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let e=0,n=t.length/2;e0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,2===r.length&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(e){return new RC(this,e)}*neighbors(e){const{inedges:t,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const t=a.indexOf(e);return t>0&&(yield a[t-1]),void(t=0&&i!==n&&i!==r;)n=i;return i}_step(e,t,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:u}=this;if(-1===r[e]||!u.length)return(e+1)%(u.length>>1);let l=e,c=LC(t-u[2*e],2)+LC(n-u[2*e+1],2);const f=r[e];let d=f;do{let r=s[d];const f=LC(t-u[2*r],2)+LC(n-u[2*r+1],2);if(f>5<<5,u=~~Math.max(Math.abs(v+b),Math.abs(v-b))}else a=a+31>>5<<5;if(u>h&&(h=u),f+a>=XC<<5&&(f=0,d+=h,h=0),d+u>=ZC)break;i.translate((f+(a>>1))/o,(d+(u>>1))/o),t.rotate&&i.rotate(t.rotate*YC),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=a,t.height=u,t.xoff=f,t.yoff=d,t.x1=a>>1,t.y1=u>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,f+=a}for(var _=i.getImageData(0,0,(XC<<5)/o,ZC/o).data,w=[];--r>=0;)if((t=n[r]).hasText){for(s=(a=t.width)>>5,u=t.y1-t.y0,l=0;l>5),O=_[(d+c)*(XC<<5)+(f+l)<<2]?1<<31-l%32:0;w[E]|=O,k|=O}k?A=c:(t.y0++,u--,c--,d++)}t.y1=t.y0+A,t.sprite=w.slice(0,(t.y1-t.y0)*s)}}}function KC(e,t,n){n>>=5;for(var r,i=e.sprite,o=e.width>>5,a=e.x-(o<<4),s=127&a,u=32-s,l=e.y1-e.y0,c=(e.y+e.y0)*n+(a>>5),f=0;f>>s:0))&t[c+d])return!0;c+=n}return!1}function QC(e,t){var n=e[0],r=e[1];t.x+t.x0r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function eS(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0=f));)if(t.x=a+i,t.y=l+o,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>s[0]||t.y+t.y1>s[1])&&(!n||!KC(t,e,s[0]))&&(!n||eS(t,n))){for(var g,m=t.sprite,y=t.width>>5,v=s[0]>>5,b=t.x-(y<<4),x=127&b,_=32-x,w=t.y1-t.y0,k=(t.y+t.y0)*v+(b>>5),A=0;A>>x:0);k+=v}return t.sprite=null,!0}return!1}return f.layout=function(){for(var u=function(e){e.width=e.height=1;var t=Math.sqrt(e.getContext("2d").getImageData(0,0,1,1).data.length>>2);e.width=(XC<<5)/t,e.height=ZC/t;var n=e.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:t}}(Oc()),f=function(e){for(var t=[],n=-1;++n>5)*s[1]),h=null,p=l.length,g=-1,m=[],y=l.map((s=>({text:e(s),font:t(s),style:r(s),weight:i(s),rotate:o(s),size:~~(n(s)+1e-14),padding:a(s),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:s}))).sort(((e,t)=>t.size-e.size));++g>1,v.y=s[1]*(c()+.5)>>1,JC(u,v,y,g),v.hasText&&d(f,v,h)&&(m.push(v),h?QC(h,v):h=[{x:v.x+v.x0,y:v.y+v.y0},{x:v.x+v.x1,y:v.y+v.y1}],v.x-=s[0]>>1,v.y-=s[1]>>1)}return m},f.words=function(e){return arguments.length?(l=e,f):l},f.size=function(e){return arguments.length?(s=[+e[0],+e[1]],f):s},f.font=function(e){return arguments.length?(t=nS(e),f):t},f.fontStyle=function(e){return arguments.length?(r=nS(e),f):r},f.fontWeight=function(e){return arguments.length?(i=nS(e),f):i},f.rotate=function(e){return arguments.length?(o=nS(e),f):o},f.text=function(t){return arguments.length?(e=nS(t),f):e},f.spiral=function(e){return arguments.length?(u=rS[e]||e,f):u},f.fontSize=function(e){return arguments.length?(n=nS(e),f):n},f.padding=function(e){return arguments.length?(a=nS(e),f):a},f.random=function(e){return arguments.length?(c=e,f):c},f}(),e)}aS.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:iS}]},De(aS,Fa,{transform(e,t){!e.size||e.size[0]&&e.size[1]||_("Wordcloud size dimensions must be non-zero.");const n=e.modified();if(!(n||t.changed(t.ADD_REM)||oS.some((function(n){const r=e[n];return ce(r)&&t.modified(r.fields)}))))return;const r=t.materialize(t.SOURCE).source,i=this.value,o=e.as||iS;let a,s=e.fontSize||14;if(ce(s)?a=e.fontSizeRange:s=ye(s),a){const e=s,t=bp("sqrt")().domain(xe(r,e)).range(a);s=n=>t(e(n))}r.forEach((e=>{e[o[0]]=NaN,e[o[1]]=NaN,e[o[3]]=0}));const u=i.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(s).random(Ya).layout(),l=i.size(),c=l[0]>>1,f=l[1]>>1,d=u.length;for(let e,t,n=0;nnew Uint8Array(e),uS=e=>new Uint16Array(e),lS=e=>new Uint32Array(e);function cS(e,t,n){const r=(t<257?sS:t<65537?uS:lS)(e);return n&&r.set(n),r}function fS(e,t,n){const r=1<{const r=e[t],i=e[n];return ri?1:0})),function(e,t){return Array.from(t,(t=>e[t]))}(e,t)}(d,u),a)l=t,c=e,t=Array(a+s),e=lS(a+s),function(e,t,n,r,i,o,a,s,u){let l,c=0,f=0;for(l=0;c0)for(f=0;fe,size:()=>n}}function hS(e){Fa.call(this,function(){let e=8,t=[],n=lS(0),r=cS(0,e),i=cS(0,e);return{data:()=>t,seen:()=>n=function(e,t,n){return e.length>=t?e:((n=n||new e.constructor(t)).set(e),n)}(n,t.length),add(e){for(let n,r=0,i=t.length,o=e.length;rt.length,curr:()=>r,prev:()=>i,reset:e=>i[e]=r[e],all:()=>e<257?255:e<65537?65535:4294967295,set(e,t){r[e]|=t},clear(e,t){r[e]&=~t},resize(t,n){(t>r.length||n>e)&&(e=Math.max(n,e),r=cS(t,e,r),i=cS(t,e))}}}(),e),this._indices=null,this._dims=null}function pS(e){Fa.call(this,null,e)}hS.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]},De(hS,Fa,{transform(e,t){return this._dims?e.modified("fields")||e.fields.some((e=>t.modified(e.fields)))?this.reinit(e,t):this.eval(e,t):this.init(e,t)},init(e,t){const n=e.fields,r=e.query,i=this._indices={},o=this._dims=[],a=r.length;let s,u,l=0;for(;l{const e=i.remove(t,n);for(const t in r)r[t].reindex(e)}))},update(e,t,n){const r=this._dims,i=e.query,o=t.stamp,a=r.length;let s,u,l=0;for(n.filters=0,u=0;uh)for(m=h,y=Math.min(f,p);mp)for(m=Math.max(f,p),y=d;mc)for(h=c,p=Math.min(u,f);hf)for(h=Math.max(u,f),p=l;hs[e]&n?null:a[e];return o.filter(o.MOD,l),i&i-1?(o.filter(o.ADD,(e=>{const t=s[e]&n;return!t&&t^u[e]&n?a[e]:null})),o.filter(o.REM,(e=>!(s[e]&n)||u[e]&n?null:a[e]))):(o.filter(o.ADD,l),o.filter(o.REM,(e=>(s[e]&n)===i?a[e]:null))),o.filter(o.SOURCE,(e=>l(e._index)))}});const gS="Literal",mS="CallExpression";function yS(e){this.type=e}var vS,bS,xS,_S,wS;yS.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=function(e){switch(e.type){case"ArrayExpression":return e.elements;case"BinaryExpression":case"LogicalExpression":return[e.left,e.right];case mS:return[e.callee].concat(e.arguments);case"ConditionalExpression":return[e.test,e.consequent,e.alternate];case"MemberExpression":return[e.object,e.property];case"ObjectExpression":return e.properties;case"Property":return[e.key,e.value];case"UnaryExpression":return[e.argument];default:return[]}}(this),n=0,r=t.length;n",vS[ES]="Identifier",vS[OS]="Keyword",vS[DS]="Null",vS[CS]="Numeric",vS[SS]="Punctuator",vS[FS]="String",vS[9]="RegularExpression";var MS="ArrayExpression",jS="BinaryExpression",$S="CallExpression",NS="ConditionalExpression",BS="Identifier",TS="Literal",zS="LogicalExpression",RS="MemberExpression",PS="ObjectExpression",LS="Property",IS="UnaryExpression",US="Unexpected token %0",qS="Unexpected number",WS="Unexpected string",HS="Unexpected identifier",GS="Unexpected reserved word",VS="Unexpected end of input",YS="Invalid regular expression",XS="Invalid regular expression: missing /",ZS="Octal literals are not allowed in strict mode.",JS="Duplicate data property in object literal not allowed in strict mode",KS="ILLEGAL",QS="Disabled.",eF=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),tF=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0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\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function nF(e,t){if(!e)throw new Error("ASSERT: "+t)}function rF(e){return e>=48&&e<=57}function iF(e){return"0123456789abcdefABCDEF".includes(e)}function oF(e){return"01234567".includes(e)}function aF(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function sF(e){return 10===e||13===e||8232===e||8233===e}function uF(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&eF.test(String.fromCharCode(e))}function lF(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&tF.test(String.fromCharCode(e))}const cF={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function fF(){for(;xS<_S;){const e=bS.charCodeAt(xS);if(!aF(e)&&!sF(e))break;++xS}}function dF(e){var t,n,r,i=0;for(n="u"===e?4:2,t=0;t1114111||"}"!==e)&&OF({},US,KS),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),r=56320+(t-65536&1023),String.fromCharCode(n,r))}function pF(){var e,t;for(e=bS.charCodeAt(xS++),t=String.fromCharCode(e),92===e&&(117!==bS.charCodeAt(xS)&&OF({},US,KS),++xS,(e=dF("u"))&&"\\"!==e&&uF(e.charCodeAt(0))||OF({},US,KS),t=e);xS<_S&&lF(e=bS.charCodeAt(xS));)++xS,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==bS.charCodeAt(xS)&&OF({},US,KS),++xS,(e=dF("u"))&&"\\"!==e&&lF(e.charCodeAt(0))||OF({},US,KS),t+=e);return t}function gF(){var e,t,n,r,i=xS,o=bS.charCodeAt(xS),a=bS[xS];switch(o){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++xS,{type:SS,value:String.fromCharCode(o),start:i,end:xS};default:if(61===(e=bS.charCodeAt(xS+1)))switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return xS+=2,{type:SS,value:String.fromCharCode(o)+String.fromCharCode(e),start:i,end:xS};case 33:case 61:return xS+=2,61===bS.charCodeAt(xS)&&++xS,{type:SS,value:bS.slice(i,xS),start:i,end:xS}}}return">>>="===(r=bS.substr(xS,4))?{type:SS,value:r,start:i,end:xS+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:SS,value:n,start:i,end:xS+=3}:a===(t=n.substr(0,2))[1]&&"+-<>&|".includes(a)||"=>"===t?{type:SS,value:t,start:i,end:xS+=2}:("//"===t&&OF({},US,KS),"<>=!+-*%&|^/".includes(a)?(++xS,{type:SS,value:a,start:i,end:xS}):void OF({},US,KS))}function mF(){var e,t,n;if(nF(rF((n=bS[xS]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=xS,e="","."!==n){if(e=bS[xS++],n=bS[xS],"0"===e){if("x"===n||"X"===n)return++xS,function(e){let t="";for(;xS<_S&&iF(bS[xS]);)t+=bS[xS++];return 0===t.length&&OF({},US,KS),uF(bS.charCodeAt(xS))&&OF({},US,KS),{type:CS,value:parseInt("0x"+t,16),start:e,end:xS}}(t);if(oF(n))return function(e){let t="0"+bS[xS++];for(;xS<_S&&oF(bS[xS]);)t+=bS[xS++];return(uF(bS.charCodeAt(xS))||rF(bS.charCodeAt(xS)))&&OF({},US,KS),{type:CS,value:parseInt(t,8),octal:!0,start:e,end:xS}}(t);n&&rF(n.charCodeAt(0))&&OF({},US,KS)}for(;rF(bS.charCodeAt(xS));)e+=bS[xS++];n=bS[xS]}if("."===n){for(e+=bS[xS++];rF(bS.charCodeAt(xS));)e+=bS[xS++];n=bS[xS]}if("e"===n||"E"===n)if(e+=bS[xS++],"+"!==(n=bS[xS])&&"-"!==n||(e+=bS[xS++]),rF(bS.charCodeAt(xS)))for(;rF(bS.charCodeAt(xS));)e+=bS[xS++];else OF({},US,KS);return uF(bS.charCodeAt(xS))&&OF({},US,KS),{type:CS,value:parseFloat(e),start:t,end:xS}}function yF(){if(fF(),xS>=_S)return{type:AS,start:xS,end:xS};const e=bS.charCodeAt(xS);return uF(e)?function(){var e,t;return e=xS,t=92===bS.charCodeAt(xS)?pF():function(){var e,t;for(e=xS++;xS<_S;){if(92===(t=bS.charCodeAt(xS)))return xS=e,pF();if(!lF(t))break;++xS}return bS.slice(e,xS)}(),{type:1===t.length?ES:cF.hasOwnProperty(t)?OS:"null"===t?DS:"true"===t||"false"===t?kS:ES,value:t,start:e,end:xS}}():40===e||41===e||59===e?gF():39===e||34===e?function(){var e,t,n,r,i="",o=!1;for(nF("'"===(e=bS[xS])||'"'===e,"String literal must starts with a quote"),t=xS,++xS;xS<_S;){if((n=bS[xS++])===e){e="";break}if("\\"===n)if((n=bS[xS++])&&sF(n.charCodeAt(0)))"\r"===n&&"\n"===bS[xS]&&++xS;else switch(n){case"u":case"x":"{"===bS[xS]?(++xS,i+=hF()):i+=dF(n);break;case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;default:oF(n)?(0!==(r="01234567".indexOf(n))&&(o=!0),xS<_S&&oF(bS[xS])&&(o=!0,r=8*r+"01234567".indexOf(bS[xS++]),"0123".includes(n)&&xS<_S&&oF(bS[xS])&&(r=8*r+"01234567".indexOf(bS[xS++]))),i+=String.fromCharCode(r)):i+=n}else{if(sF(n.charCodeAt(0)))break;i+=n}}return""!==e&&OF({},US,KS),{type:FS,value:i,octal:o,start:t,end:xS}}():46===e?rF(bS.charCodeAt(xS+1))?mF():gF():rF(e)?mF():gF()}function vF(){const e=wS;return xS=e.end,wS=yF(),xS=e.end,e}function bF(){const e=xS;wS=yF(),xS=e}function xF(e,t,n){const r=new yS("||"===e||"&&"===e?zS:jS);return r.operator=e,r.left=t,r.right=n,r}function _F(e,t){const n=new yS($S);return n.callee=e,n.arguments=t,n}function wF(e){const t=new yS(BS);return t.name=e,t}function kF(e){const t=new yS(TS);return t.value=e.value,t.raw=bS.slice(e.start,e.end),e.regex&&("//"===t.raw&&(t.raw="/(?:)/"),t.regex=e.regex),t}function AF(e,t,n){const r=new yS(RS);return r.computed="["===e,r.object=t,r.property=n,r.computed||(n.member=!0),r}function EF(e,t,n){const r=new yS(LS);return r.key=t,r.value=n,r.kind=e,r}function OF(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,((e,t)=>(nF(t=0&&OF({},YS,n),{value:n,literal:t}}(),r=function(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((e,t)=>{if(parseInt(t,16)<=1114111)return"x";OF({},YS)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){OF({},YS)}try{return new RegExp(e,t)}catch(e){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:xS}}()),bF()):DF(vF())}return n}function BF(){const e=[];if(CF("("),!SF(")"))for(;xS<_S&&(e.push(IF()),!SF(")"));)CF(",");return CF(")"),e}function TF(){xS=wS.start;const e=vF();return function(e){return e.type===ES||e.type===OS||e.type===kS||e.type===DS}(e)||DF(e),wF(e.value)}function zF(){CF("[");const e=UF();return CF("]"),e}function RF(){const e=function(){var e;for(e=NF();;)if(SF("."))CF("."),e=AF(".",e,TF());else if(SF("("))e=_F(e,BF());else{if(!SF("["))break;e=AF("[",e,zF())}return e}();if(wS.type===SS&&(SF("++")||SF("--")))throw new Error(QS);return e}function PF(){var e,t;if(wS.type!==SS&&wS.type!==OS)t=RF();else{if(SF("++")||SF("--"))throw new Error(QS);if(SF("+")||SF("-")||SF("~")||SF("!"))e=vF(),t=PF(),t=function(e,t){const n=new yS(IS);return n.operator=e,n.argument=t,n.prefix=!0,n}(e.value,t);else{if(FF("delete")||FF("void")||FF("typeof"))throw new Error(QS);t=RF()}}return t}function LF(e){let t=0;if(e.type!==SS&&e.type!==OS)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function IF(){var e,t;return e=function(){var e,t,n,r,i,o,a,s,u,l;if(e=wS,u=PF(),0===(i=LF(r=wS)))return u;for(r.prec=i,vF(),t=[e,wS],o=[u,r,a=PF()];(i=LF(wS))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),t.pop(),n=xF(s,u,a),o.push(n);(r=vF()).prec=i,o.push(r),t.push(wS),n=PF(),o.push(n)}for(n=o[l=o.length-1],t.pop();l>1;)t.pop(),n=xF(o[l-1].value,o[l-2],n),l-=2;return n}(),SF("?")&&(vF(),t=IF(),CF(":"),e=function(e,t,n){const r=new yS(NS);return r.test=e,r.consequent=t,r.alternate=n,r}(e,t,IF())),e}function UF(){const e=IF();if(SF(","))throw new Error(QS);return e}function qF(e){xS=0,_S=(bS=e).length,wS=null,bF();const t=UF();if(wS.type!==AS)throw new Error("Unexpect token after expression.");return t}var WF={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function HF(e){function t(t,n,r){return i=>function(t,n,r,i){let o=e(n[0]);return r&&(o=r+"("+o+")",0===r.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+t+(i<0?"":0===i?"()":"("+n.slice(1).map(e).join(",")+")")}(t,i,n,r)}const n="new Date",r="String",i="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(t){t.length<3&&_("Missing arguments to clamp function."),t.length>3&&_("Too many arguments to clamp function.");const n=t.map(e);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:t("getDate",n,0),day:t("getDay",n,0),year:t("getFullYear",n,0),month:t("getMonth",n,0),hours:t("getHours",n,0),minutes:t("getMinutes",n,0),seconds:t("getSeconds",n,0),milliseconds:t("getMilliseconds",n,0),time:t("getTime",n,0),timezoneoffset:t("getTimezoneOffset",n,0),utcdate:t("getUTCDate",n,0),utcday:t("getUTCDay",n,0),utcyear:t("getUTCFullYear",n,0),utcmonth:t("getUTCMonth",n,0),utchours:t("getUTCHours",n,0),utcminutes:t("getUTCMinutes",n,0),utcseconds:t("getUTCSeconds",n,0),utcmilliseconds:t("getUTCMilliseconds",n,0),length:t("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase",r,0),lower:t("toLowerCase",r,0),substring:t("substring",r),split:t("split",r),trim:t("trim",r,0),regexp:i,test:t("test",i),if:function(t){t.length<3&&_("Missing arguments to if function."),t.length>3&&_("Too many arguments to if function.");const n=t.map(e);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function GF(e){const t=(e=e||{}).allowed?Ye(e.allowed):{},n=e.forbidden?Ye(e.forbidden):{},r=e.constants||WF,i=(e.functions||HF)(f),o=e.globalvar,a=e.fieldvar,s=ce(o)?o:e=>`${o}["${e}"]`;let u={},l={},c=0;function f(e){if(Ne(e))return e;const t=d[e.type];return null==t&&_("Unsupported type: "+e.type),t(e)}const d={Literal:e=>e.raw,Identifier:e=>{const i=e.name;return c>0?i:ke(n,i)?_("Illegal identifier: "+i):ke(r,i)?r[i]:ke(t,i)?i:(u[i]=1,s(i))},MemberExpression:e=>{const t=!e.computed,n=f(e.object);t&&(c+=1);const r=f(e.property);return n===a&&(l[function(e){const t=e&&e.length-1;return t&&('"'===e[0]&&'"'===e[t]||"'"===e[0]&&"'"===e[t])?e.slice(1,-1):e}(r)]=1),t&&(c-=1),n+(t?"."+r:"["+r+"]")},CallExpression:e=>{"Identifier"!==e.callee.type&&_("Illegal callee type: "+e.callee.type);const t=e.callee.name,n=e.arguments,r=ke(i,t)&&i[t];return r||_("Unrecognized function: "+t),ce(r)?r(n):r+"("+n.map(f).join(",")+")"},ArrayExpression:e=>"["+e.elements.map(f).join(",")+"]",BinaryExpression:e=>"("+f(e.left)+" "+e.operator+" "+f(e.right)+")",UnaryExpression:e=>"("+e.operator+f(e.argument)+")",ConditionalExpression:e=>"("+f(e.test)+"?"+f(e.consequent)+":"+f(e.alternate)+")",LogicalExpression:e=>"("+f(e.left)+e.operator+f(e.right)+")",ObjectExpression:e=>"{"+e.properties.map(f).join(",")+"}",Property:e=>{c+=1;const t=f(e.key);return c-=1,t+":"+f(e.value)}};function h(e){const t={code:f(e),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},t}return h.functions=i,h.constants=r,h}var VF,YF,XF,ZF,JF,KF,QF,eM,tM,nM,rM,iM,oM,aM,sM,uM,lM=new V_,cM=new V_,fM={point:yw,lineStart:yw,lineEnd:yw,polygonStart:function(){lM=new V_,fM.lineStart=dM,fM.lineEnd=hM},polygonEnd:function(){var e=+lM;cM.add(e<0?Q_+e:e),this.lineStart=this.lineEnd=this.point=yw},sphere:function(){cM.add(Q_)}};function dM(){fM.point=pM}function hM(){gM(VF,YF)}function pM(e,t){fM.point=gM,VF=e,YF=t,XF=e*=tw,ZF=ow(t=(t*=tw)/2+K_),JF=fw(t)}function gM(e,t){var n=(e*=tw)-XF,r=n>=0?1:-1,i=r*n,o=ow(t=(t*=tw)/2+K_),a=fw(t),s=JF*a,u=ZF*o+s*ow(i),l=s*r*fw(i);lM.add(iw(l,u)),XF=e,ZF=o,JF=a}var mM,yM,vM,bM,xM,_M,wM,kM,AM,EM,OM,DM,CM,SM,FM,MM,jM={point:$M,lineStart:BM,lineEnd:TM,polygonStart:function(){jM.point=zM,jM.lineStart=RM,jM.lineEnd=PM,aM=new V_,fM.polygonStart()},polygonEnd:function(){fM.polygonEnd(),jM.point=$M,jM.lineStart=BM,jM.lineEnd=TM,lM<0?(KF=-(eM=180),QF=-(tM=90)):aM>Y_?tM=90:aM<-Y_&&(QF=-90),uM[0]=KF,uM[1]=eM},sphere:function(){KF=-(eM=180),QF=-(tM=90)}};function $M(e,t){sM.push(uM=[KF=e,eM=e]),ttM&&(tM=t)}function NM(e,t){var n=Fk([e*tw,t*tw]);if(oM){var r=jk(oM,n),i=jk([r[1],-r[0],0],r);Bk(i),i=Sk(i);var o,a=e-nM,s=a>0?1:-1,u=i[0]*ew*s,l=nw(a)>180;l^(s*nMtM&&(tM=o):l^(s*nM<(u=(u+360)%360-180)&&utM&&(tM=t)),l?eLM(KF,eM)&&(eM=e):LM(e,eM)>LM(KF,eM)&&(KF=e):eM>=KF?(eeM&&(eM=e)):e>nM?LM(KF,e)>LM(KF,eM)&&(eM=e):LM(e,eM)>LM(KF,eM)&&(KF=e)}else sM.push(uM=[KF=e,eM=e]);ttM&&(tM=t),oM=n,nM=e}function BM(){jM.point=NM}function TM(){uM[0]=KF,uM[1]=eM,jM.point=$M,oM=null}function zM(e,t){if(oM){var n=e-nM;aM.add(nw(n)>180?n+(n>0?360:-360):n)}else rM=e,iM=t;fM.point(e,t),NM(e,t)}function RM(){fM.lineStart()}function PM(){zM(rM,iM),fM.lineEnd(),nw(aM)>Y_&&(KF=-(eM=180)),uM[0]=KF,uM[1]=eM,oM=null}function LM(e,t){return(t-=e)<0?t+360:t}function IM(e,t){return e[0]-t[0]}function UM(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tt?1:e>=t?0:NaN}function tj(e,t){return null==e||null==t?NaN:te?1:t>=e?0:NaN}function nj(){return 0}function rj(e){return e instanceof Sd?e:new Sd(e)}const ij=Symbol("vega_selection_getter");function oj(e){return e.getter&&e.getter[ij]||(e.getter=k(e.field),e.getter[ij]=!0),e.getter}const aj="intersect",sj="union",uj="or",lj="and",cj="_vgsid_",fj=k(cj),dj="index:unit";function hj(e,t){for(var n,r,i=t.fields,o=t.values,a=i.length,s=0;s>>1;n(e[t],r)<0?i=t+1:o=t}while(iej(e(t),n),r=(t,n)=>e(t)-n):(t=e===ej||e===tj?e:nj,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i>>1;n(e[t],r)<=0?i=t+1:o=t}while(it.indexOf(e)>=0)):t},R_union:function(e,t){var n=W(t[0]),r=W(t[1]);return n>r&&(n=t[1],r=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]r&&(n=t[1],r=t[0]),e.length?rr&&(e[1]=r),e):[n,r]}};function vj(e,t,n,r){t[0].type!==gS&&_("First argument to selection functions must be a string literal.");const i=t[0].value,o="unit",a="@"+o,s=":"+i;(t.length>=2&&q(t).value)!==aj||ke(r,a)||(r[a]=n.getData(i).indataRef(n,o)),ke(r,s)||(r[s]=n.getData(i).tuplesRef())}function bj(e){const t=this.context.data[e];return t?t.values.value:[]}const xj=e=>function(t,n){const r=this.context.dataflow.locale();return null===t?"null":r[e](n)(t)},_j=xj("format"),wj=xj("timeFormat"),kj=xj("utcFormat"),Aj=xj("timeParse"),Ej=xj("utcParse"),Oj=new Date(2e3,0,1);function Dj(e,t,n){return Number.isInteger(e)&&Number.isInteger(t)?(Oj.setYear(2e3),Oj.setMonth(e),Oj.setDate(t),wj.call(this,Oj,n)):""}const Cj="%",Sj="$";function Fj(e,t,n,r){t[0].type!==gS&&_("First argument to data functions must be a string literal.");const i=t[0].value,o=":"+i;if(!ke(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(e){}}function Mj(e,t,n,r){if(t[0].type===gS)jj(n,r,t[0].value);else for(e in n.scales)jj(n,r,e)}function jj(e,t,n){const r=Cj+n;if(!ke(t,r))try{t[r]=e.scaleRef(n)}catch(e){}}function $j(e,t){if(ce(e))return e;if(Ne(e)){const r=t.scales[e];return r&&((n=r.value)&&!0===n[yp])?r.value:void 0}var n}function Nj(e,t){return function(n,r,i){if(n){const t=$j(n,(i||this).context);return t&&t.path[e](r)}return t(r)}}const Bj=Nj("area",(function(e){return cM=new V_,G_(e,fM),2*cM})),Tj=Nj("bounds",(function(e){var t,n,r,i,o,a,s;if(tM=eM=-(KF=QF=1/0),sM=[],G_(e,jM),n=sM.length){for(sM.sort(IM),t=1,o=[r=sM[0]];tLM(r[0],r[1])&&(r[1]=i[1]),LM(i[0],r[1])>LM(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,t=0,r=o[n=o.length-1];t<=n;r=i,++t)i=o[t],(s=LM(r[1],i[0]))>a&&(a=s,KF=i[0],eM=r[1])}return sM=uM=null,KF===1/0||QF===1/0?[[NaN,NaN],[NaN,NaN]]:[[KF,QF],[eM,tM]]})),zj=Nj("centroid",(function(e){mM=yM=vM=bM=xM=_M=wM=kM=0,AM=new V_,EM=new V_,OM=new V_,G_(e,qM);var t=+AM,n=+EM,r=+OM,i=uw(t,n,r);return iUj(e,t)}const Wj={};function Hj(e){return z(e)||ArrayBuffer.isView(e)?e:null}function Gj(e){return Hj(e)||(Ne(e)?e:null)}const Vj=e=>e.data;function Yj(e,t){const n=bj.call(t,e);return n.root&&n.root.lookup||{}}const Xj=()=>"undefined"!=typeof window&&window||null;function Zj(e,t,n){if(!e)return[];const[r,i]=e,o=(new am).set(r[0],r[1],i[0],i[1]);return Gb(n||this.context.dataflow.scenegraph().root,o,function(e){let t=null;if(e){const n=ue(e.marktype),r=ue(e.markname);t=e=>(!n.length||n.some((t=>e.marktype===t)))&&(!r.length||r.some((t=>e.name===t)))}return t}(t))}const Jj={random:()=>Ya(),cumulativeNormal:os,cumulativeLogNormal:fs,cumulativeUniform:ys,densityNormal:is,densityLogNormal:cs,densityUniform:ms,quantileNormal:as,quantileLogNormal:ds,quantileUniform:vs,sampleNormal:rs,sampleLogNormal:ls,sampleUniform:gs,isArray:z,isBoolean:Se,isDate:Fe,isDefined:e=>void 0!==e,isNumber:je,isObject:R,isRegExp:$e,isString:Ne,isTuple:Jo,isValid:e=>null!=e&&e==e,toBoolean:We,toDate:e=>Ge(e),toNumber:W,toString:Ve,indexof:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;rxe(e),inScope:function(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n},intersect:Zj,clampRange:le,pinchDistance:function(e){const t=e.touches,n=t[0].clientX-t[1].clientX,r=t[0].clientY-t[1].clientY;return Math.hypot(n,r)},pinchAngle:function(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)},screen:function(){const e=Xj();return e?e.screen:{}},containerSize:function(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]},windowSize:function(){const e=Xj();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]},bandspace:function(e,t,n){return Wh(e||0,t||0,n||0)},setdata:function(e,t){const n=this.context.dataflow,r=this.context.data[e].input;return n.pulse(r,n.changeset().remove(C).insert(t)),1},pathShape:function(e){let t=null;return function(n){return n?Sg(n,t=t||vg(e)):e}},panLinear:J,panLog:K,panPow:Q,panSymlog:ee,zoomLinear:ne,zoomLog:re,zoomPow:ie,zoomSymlog:oe,encode:function(e,t,n){if(e){const n=this.context.dataflow,r=e.mark.source;n.pulse(r,n.changeset().encode(e,t))}return void 0!==n?n:e},modify:function(e,t,n,r,i,o){const a=this.context.dataflow,s=this.context.data[e],u=s.input,l=a.stamp();let c,f,d=s.changes;if(!1===a._trigger||!(u.value.length||t||r))return 0;if((!d||d.stamp{s.modified=!0,a.pulse(u,d).run()}),!0,1)),n&&(c=!0===n?C:z(n)||Jo(n)?n:qj(n),d.remove(c)),t&&d.insert(t),r&&(c=qj(r),u.value.some(c)?d.remove(c):d.insert(r)),i)for(f in o)d.modify(i,f,o[f]);return 1},lassoAppend:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;const i=(e=ue(e))[e.length-1];return void 0===i||Math.hypot(i[0]-t,i[1]-n)>r?[...e,[t,n]]:e},lassoPath:function(e){return ue(e).reduce(((t,n,r)=>{let[i,o]=n;return t+(0==r?`M ${i},${o} `:r===e.length-1?" Z":`L ${i},${o} `)}),"")},intersectLasso:function(e,t,n){const{x:r,y:i,mark:o}=n,a=(new am).set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[e,n]of t)ea.x2&&(a.x2=e),na.y2&&(a.y2=n);return a.translate(r,i),Zj([[a.x1,a.y1],[a.x2,a.y2]],e,o).filter((e=>function(e,t,n){let r=0;for(let i=0,o=n.length-1;it!=s>t&&e<(a-u)*(t-l)/(s-l)+u&&r++}return 1&r}(e.x,e.y,t)))}},Kj=["view","item","group","xy","x","y"],Qj="this.",e$={},t$={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${qe(Sj+e)}]`,functions:function(e){const t=HF(e);Kj.forEach((e=>t[e]="event.vega."+e));for(const e in Jj)t[e]=Qj+e;return be(t,function(e,t,n){t.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0,n._bandwidth=Mj,n._range=Mj,n._scale=Mj;const r=t=>"_["+(t.type===gS?qe(Cj+t.value):qe(Cj)+"+"+e(t))+"]";return{_bandwidth:e=>`this.__bandwidth(${r(e[0])})`,_range:e=>`${r(e[0])}.range()`,_scale:t=>`${r(t[0])}(${e(t[1])})`}}(e,Jj,e$)),t},constants:WF,visitors:e$},n$=GF(t$);function r$(e,t,n){return 1===arguments.length?Jj[e]:(Jj[e]=t,n&&(e$[e]=n),n$&&(n$.functions[e]=Qj+e),this)}function i$(e,t){const n={};let r;try{r=qF(e=Ne(e)?e:qe(e)+"")}catch(t){_("Expression parse error: "+e)}r.visit((e=>{if(e.type!==mS)return;const r=e.callee.name,i=t$.visitors[r];i&&i(r,e.arguments,t,n)}));const i=n$(r);return i.globals.forEach((e=>{const r=Sj+e;!ke(n,r)&&t.getSignal(e)&&(n[r]=t.signalRef(e))})),{$expr:be({code:i.code},t.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}r$("bandwidth",(function(e,t){const n=$j(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}),Mj),r$("copy",(function(e,t){const n=$j(e,(t||this).context);return n?n.copy():void 0}),Mj),r$("domain",(function(e,t){const n=$j(e,(t||this).context);return n?n.domain():[]}),Mj),r$("range",(function(e,t){const n=$j(e,(t||this).context);return n&&n.range?n.range():[]}),Mj),r$("invert",(function(e,t,n){const r=$j(e,(n||this).context);return r?z(t)?(r.invertRange||r.invert)(t):(r.invert||r.invertExtent)(t):void 0}),Mj),r$("scale",(function(e,t,n){const r=$j(e,(n||this).context);return r?r(t):void 0}),Mj),r$("gradient",(function(e,t,n,r,i){e=$j(e,(i||this).context);const o=cg(t,n);let a=e.domain(),s=a[0],u=q(a),l=E;return u-s?l=jp(e,s,u):e=(e.interpolator?bp("sequential")().interpolator(e.interpolator()):bp("linear")().interpolate(e.interpolate()).range(e.range())).domain([s=0,u=1]),e.ticks&&(a=e.ticks(+r||15),s!==a[0]&&a.unshift(s),u!==q(a)&&a.push(u)),a.forEach((t=>o.stop(l(t),e(t)))),o}),Mj),r$("geoArea",Bj,Mj),r$("geoBounds",Tj,Mj),r$("geoCentroid",zj,Mj),r$("geoShape",(function(e,t,n){const r=$j(e,(n||this).context);return function(e){return r?r.path.context(e)(t):""}}),Mj),r$("geoScale",(function(e,t){const n=$j(e,(t||this).context);return n&&n.scale()}),Mj),r$("indata",(function(e,t,n){const r=this.context.data[e]["index:"+t],i=r?r.value.get(n):void 0;return i?i.count:i}),(function(e,t,n,r){t[0].type!==gS&&_("First argument to indata must be a string literal."),t[1].type!==gS&&_("Second argument to indata must be a string literal.");const i=t[0].value,o=t[1].value,a="@"+o;ke(a,r)||(r[a]=n.getData(i).indataRef(n,o))})),r$("data",bj,Fj),r$("treePath",(function(e,t,n){const r=Yj(e,this),i=r[t],o=r[n];return i&&o?i.path(o).map(Vj):void 0}),Fj),r$("treeAncestors",(function(e,t){const n=Yj(e,this)[t];return n?n.ancestors().map(Vj):void 0}),Fj),r$("vlSelectionTest",(function(e,t,n){for(var r,i,o,a,s,u=this.context.data[e],l=u?u.values.value:[],c=u?u[dj]&&u[dj].value:void 0,f=n===aj,d=l.length,h=0;h(e[o[n].field]=t,e)),{}))}else u=cj,l=fj(i),(f=(c=v[u]||(v[u]={}))[s]||(c[s]=[])).push(l),n&&(f=b[s]||(b[s]=[])).push({[cj]:l});return t=t||sj,v[cj]?v[cj]=yj[`${cj}_${t}`](...Object.values(v[cj])):Object.keys(v).forEach((e=>{v[e]=Object.keys(v[e]).map((t=>v[e][t])).reduce(((n,r)=>void 0===n?r:yj[`${x[e]}_${t}`](n,r)))})),y=Object.keys(b),n&&y.length&&(v[r?"vlPoint":"vlMulti"]=t===sj?{[uj]:y.reduce(((e,t)=>(e.push(...b[t]),e)),[])}:{[lj]:y.map((e=>({[uj]:b[e]})))}),v}),vj),r$("vlSelectionTuples",(function(e,t){return e.map((e=>be(t.fields?{values:t.fields.map((t=>oj(t)(e.datum)))}:{[cj]:fj(e.datum)},t)))}));const o$=Ye(["rule"]),a$=Ye(["group","image","rect"]);function s$(e){return(e+"").toLowerCase()}function u$(e,t,n){n.endsWith(";")||(n="return("+n+");");const r=Function(...t.concat(n));return e&&e.functions?r.bind(e.functions):r}var l$={operator:(e,t)=>u$(e,["_"],t.code),parameter:(e,t)=>u$(e,["datum","_"],t.code),event:(e,t)=>u$(e,["event"],t.code),handler:(e,t)=>u$(e,["_","event"],`var datum=event.item&&event.item.datum;return ${t.code};`),encode:(e,t)=>{const{marktype:n,channels:r}=t;let i="var o=item,datum=o.datum,m=0,$;";for(const e in r){const t="o["+qe(e)+"]";i+=`$=${r[e].code};if(${t}!==$)${t}=$,m=1;`}return i+=function(e,t){let n="";return o$[t]||(e.x2&&(e.x?(a$[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(a$[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(r,n),i+="return m;",u$(e,["item","_"],i)},codegen:{get(e){const t=`[${e.map(qe).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const r=Function("a","b","var u, v; return "+e.map(((e,r)=>{const i=t[r];let o,a;return e.path?(o=`a${e.path}`,a=`b${e.path}`):((n=n||{})["f"+r]=e,o=`this.f${r}(a)`,a=`this.f${r}(b)`),function(e,t,n,r){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}\n : (u > v || v == null) && u != null ? ${r}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}\n : v !== v && u === u ? ${r} : `}(o,a,-i,i)})).join("")+"0;");return n?r.bind(n):r}}};function c$(e,t,n){if(!e||!R(e))return e;for(let r,i=0,o=f$.length;ie&&e.$tupleid?Ko:e));return t.fn[n]||(t.fn[n]=de(r,e.$order,t.expr.codegen))}},{key:"$context",parse:function(e,t){return t}},{key:"$subflow",parse:function(e,t){const n=e.$subflow;return function(e,r,i){const o=t.fork().parse(n),a=o.get(n.operators[0].id),s=o.signals.parent;return s&&s.set(i),a.detachSubflow=()=>t.detach(o),a}}},{key:"$tupleid",parse:function(){return Ko}}];const d$={skip:!0};function h$(e,t,n,r){return new p$(e,t,n,r)}function p$(e,t,n,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=r||l$,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function g$(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}function m$(e,t){e&&(null==t?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}p$.prototype=g$.prototype={fork(){const e=new g$(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter((t=>t!==e));const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,r=n.dataflow,i=e.value;if(n.set(e.id,t),"collect"===s$(e.type)&&i&&(i.$ingest?r.ingest(t,i.$ingest,i.$format):i.$request?r.preload(t,i.$request,i.$format):r.pulse(t,r.changeset().insert(i))),e.root&&(n.root=t),e.parent){let i=n.get(e.parent.$ref);i?(r.connect(i,[t]),t.targets().add(i)):(n.unresolved=n.unresolved||[]).push((()=>{i=n.get(e.parent.$ref),r.connect(i,[t]),t.targets().add(i)}))}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const r in e.data){const i=n.data[r]||(n.data[r]={});e.data[r].forEach((e=>i[e]=t))}},resolve(){return(this.unresolved||[]).forEach((e=>e())),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[s$(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,r,i){this.dataflow.on(t,n,r,i,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:function(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach((e=>t.parseOperator(e))),n.forEach((e=>t.parseOperatorParameters(e))),(e.streams||[]).forEach((e=>t.parseStream(e))),(e.updates||[]).forEach((e=>t.parseUpdate(e))),t.resolve()},parseOperator:function(e){const t=this;"operator"!==s$(e.type)&&e.type?t.transform(e,e.type):t.operator(e,e.update?t.operatorExpression(e.update):null)},parseOperatorParameters:function(e){const t=this;if(e.params){const n=t.get(e.id);n||_("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}},parseParameters:function(e,t){t=t||{};const n=this;for(const r in e){const i=e[r];t[r]=z(i)?i.map((e=>c$(e,n,t))):c$(i,n,t)}return t},parseStream:function(e){var t,n=this,r=null!=e.filter?n.eventExpression(e.filter):void 0,i=null!=e.stream?n.get(e.stream):void 0;e.source?i=n.events(e.source,e.type,r):e.merge&&(i=(t=e.merge.map((e=>n.get(e))))[0].merge.apply(t[0],t.slice(1))),e.between&&(t=e.between.map((e=>n.get(e))),i=i.between(t[0],t[1])),e.filter&&(i=i.filter(r)),null!=e.throttle&&(i=i.throttle(+e.throttle)),null!=e.debounce&&(i=i.debounce(+e.debounce)),null==i&&_("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),n.stream(e,i)},parseUpdate:function(e){var t,n=this,r=R(r=e.source)?r.$ref:r,i=n.get(r),o=e.update,a=void 0;i||_("Source not defined: "+e.source),t=e.target&&e.target.$expr?n.eventExpression(e.target.$expr):n.get(e.target),o&&o.$expr&&(o.$params&&(a=n.parseParameters(o.$params)),o=n.handlerExpression(o.$expr)),n.update(e,i,t,o,a)},getState:function(e){var t=this,n={};if(e.signals){var r=n.signals={};Object.keys(t.signals).forEach((n=>{const i=t.signals[n];e.signals(n,i)&&(r[n]=i.value)}))}if(e.data){var i=n.data={};Object.keys(t.data).forEach((n=>{const r=t.data[n];e.data(n,r)&&(i[n]=r.input.value)}))}return t.subcontext&&!1!==e.recurse&&(n.subcontext=t.subcontext.map((t=>t.getState(e)))),n},setState:function(e){var t=this,n=t.dataflow,r=e.data,i=e.signals;Object.keys(i||{}).forEach((e=>{n.update(t.signals[e],i[e],d$)})),Object.keys(r||{}).forEach((e=>{n.pulse(t.data[e].input,n.changeset().remove(C).insert(r[e]))})),(e.subcontext||[]).forEach(((e,n)=>{const r=t.subcontext[n];r&&r.setState(e)}))}};const y$="default";function v$(e,t){const n=e.globalCursor()?"undefined"!=typeof document&&document.body:e.container();if(n)return null==t?n.style.removeProperty("cursor"):n.style.cursor=t}function b$(e,t){var n=e._runtime.data;return ke(n,t)||_("Unrecognized data set: "+t),n[t]}function x$(e,t){oa(t)||_("Second argument to changes must be a changeset.");const n=b$(this,e);return n.modified=!0,this.pulse(n.input,t)}function _$(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function w$(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function k$(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}const A$="view",E$={trap:!1};function O$(e,t,n,r){e._eventListeners.push({type:n,sources:ue(t),handler:r})}function D$(e,t,n){const r=e._eventConfig&&e._eventConfig[t];return!(!1===r||R(r)&&!r[n])||(e.warn(`Blocked ${t} ${n} event listener.`),!1)}function C$(e){return e.item}function S$(e){return e.item.mark.source}function F$(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function M$(e,t,n){const r=document.createElement(e);for(const e in t)r.setAttribute(e,t[e]);return null!=n&&(r.textContent=n),r}const j$="vega-bind-radio";function $$(e,t,n,r){const i=n.event||"input",o=()=>e.update(t.value);r.signal(n.signal,t.value),t.addEventListener(i,o),O$(r,t,i,o),e.set=e=>{t.value=e,t.dispatchEvent(function(e){return"undefined"!=typeof Event?new Event(e):{type:e}}(i))}}function N$(e,t,n,r){const i=r.signal(n.signal),o=M$("div",{class:"vega-bind"}),a="radio"===n.input?o:o.appendChild(M$("label"));a.appendChild(M$("span",{class:"vega-bind-name"},n.name||n.signal)),t.appendChild(o);let s=B$;switch(n.input){case"checkbox":s=T$;break;case"select":s=z$;break;case"radio":s=R$;break;case"range":s=P$}s(e,a,n,i)}function B$(e,t,n,r){const i=M$("input");for(const e in n)"signal"!==e&&"element"!==e&&i.setAttribute("input"===e?"type":e,n[e]);i.setAttribute("name",n.signal),i.value=r,t.appendChild(i),i.addEventListener("input",(()=>e.update(i.value))),e.elements=[i],e.set=e=>i.value=e}function T$(e,t,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=M$("input",i);t.appendChild(o),o.addEventListener("change",(()=>e.update(o.checked))),e.elements=[o],e.set=e=>o.checked=!!e||null}function z$(e,t,n,r){const i=M$("select",{name:n.signal}),o=n.labels||[];n.options.forEach(((e,t)=>{const n={value:e};L$(e,r)&&(n.selected=!0),i.appendChild(M$("option",n,(o[t]||e)+""))})),t.appendChild(i),i.addEventListener("change",(()=>{e.update(n.options[i.selectedIndex])})),e.elements=[i],e.set=e=>{for(let t=0,r=n.options.length;t{const s={type:"radio",name:n.signal,value:t};L$(t,r)&&(s.checked=!0);const u=M$("input",s);u.addEventListener("change",(()=>e.update(t)));const l=M$("label",{},(o[a]||t)+"");return l.prepend(u),i.appendChild(l),u})),e.set=t=>{const n=e.elements,r=n.length;for(let e=0;e{u.textContent=s.value,e.update(+s.value)};s.addEventListener("input",l),s.addEventListener("change",l),e.elements=[s],e.set=e=>{s.value=e,u.textContent=e}}function L$(e,t){return e===t||e+""==t+""}function I$(e,t,n,r,i,o){return(t=t||new r(e.loader())).initialize(n,_$(e),w$(e),k$(e),i,o).background(e.background())}function U$(e,t){return t?function(){try{t.apply(this,arguments)}catch(t){e.error(t)}}:null}function q$(e,t,n){if("string"==typeof t){if("undefined"==typeof document)return e.error("DOM document instance not found."),null;if(!(t=document.querySelector(t)))return e.error("Signal bind element not found: "+t),null}if(t&&n)try{t.textContent=""}catch(n){t=null,e.error(n)}return t}const W$=e=>+e||0;function H$(e){return R(e)?{top:W$(e.top),bottom:W$(e.bottom),left:W$(e.left),right:W$(e.right)}:(e=>({top:e,bottom:e,left:e,right:e}))(W$(e))}async function G$(e,t,n,r){const i=Hb(t),o=i&&i.headless;return o||_("Unrecognized renderer type: "+t),await e.runAsync(),I$(e,null,null,o,n,r).renderAsync(e._scenegraph.root)}var V$="width",Y$="height",X$="padding",Z$={skip:!0};function J$(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===X$?r.left+r.right:0)}function K$(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===X$?r.top+r.bottom:0)}function Q$(e,t){return t.modified&&z(t.input.value)&&!e.startsWith("_:vega:_")}function eN(e,t){return!("parent"===e||t instanceof Ma.proxy)}function tN(e,t,n,r){const i=e.element();i&&i.setAttribute("title",function(e){return null==e?"":z(e)?nN(e):R(e)&&!Fe(e)?(t=e,Object.keys(t).map((e=>{const n=t[e];return e+": "+(z(n)?nN(n):rN(n))})).join("\n")):e+"";var t}(r))}function nN(e){return"["+e.map(rN).join(", ")+"]"}function rN(e){return z(e)?"[…]":R(e)&&!Fe(e)?"{…}":e}function iN(e,t){const n=this;if(t=t||{},Ca.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),null!=t.logLevel&&n.logLevel(t.logLevel),t.locale||e.locale){const r=be({},e.locale,t.locale);n.locale(yo(r.number,r.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||qb.Canvas,n._scenegraph=new fv;const r=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||tN,n._redraw=!0,n._handler=(new Uv).scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(e){const t=be({defaults:{}},e),n=(e,t)=>{t.forEach((t=>{z(e[t])&&(e[t]=Ye(e[t]))}))};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=function(e,t,n){return h$(e,Ma,Jj,n).parse(t)}(n,e,t.expr);n._runtime=i,n._signals=i.signals,n._bind=(e.bindings||[]).map((e=>({state:null,param:be({},e)}))),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=J$(n,n._width),n._viewHeight=K$(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(e){var t=e._signals,n=t[V$],r=t[Y$],i=t[X$];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,(t=>{e._width=t.size,e._viewWidth=J$(e,t.size),o()}),{size:n}),e._resizeHeight=e.add(null,(t=>{e._height=t.size,e._viewHeight=K$(e,t.size),o()}),{size:r});const a=e.add(null,o,{pad:i});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=r.rank+1,a.rank=i.rank+1}(n),function(e){e.add(null,(t=>(e._background=t.bg,e._resize=1,t.bg)),{bg:e._signals.background})}(n),function(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:y$,item:null}));e.on(e.events("view","pointermove"),t,((e,n)=>{const r=t.value,i=r?Ne(r)?r:r.user:y$,o=n.item&&n.item.cursor||null;return r&&i===r.user&&o==r.item?r:{user:i,item:o}})),e.add(null,(function(t){let n=t.cursor,r=this.value;return Ne(n)||(r=n.item,n=n.user),v$(e,n&&n!==y$?n:r||n),r}),{cursor:t})}(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function oN(e,t){return ke(e._signals,t)?e._signals[t]:_("Unrecognized signal name: "+qe(t))}function aN(e,t){const n=(e._targets||[]).filter((e=>e._update&&e._update.handler===t));return n.length?n[0]:null}function sN(e,t,n,r){let i=aN(n,r);return i||(i=U$(e,(()=>r(t,n.value))),i.handler=r,e.on(n,null,i)),e}function uN(e,t,n){const r=aN(t,n);return r&&t._targets.remove(r),e}De(iN,Ca,{async evaluate(e,t,n){if(await Ca.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,i=k$(r=this),o=_$(r),a=w$(r),r._renderer.background(r.background()),r._renderer.resize(o,a,i),r._handler.origin(i),r._resizeListeners.forEach((e=>{try{e(o,a)}catch(e){r.error(e)}}))),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(e){this.error(e)}var r,i,o,a;return n&&Yo(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=null!=e?e+"":null;return t!==this._desc&&m$(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const r=oN(this,e);return 1===arguments.length?r.value:this.update(r,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",H$(e)):H$(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(Hb(e)||_("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(Ca.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(oN(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function(e,t,n,r,i,o){this.runAfter((a=>{let s=0;a._autosize=0,a.width()!==n&&(s=1,a.signal(V$,n,Z$),a._resizeWidth.skip(!0)),a.height()!==r&&(s=1,a.signal(Y$,r,Z$),a._resizeHeight.skip(!0)),a._viewWidth!==e&&(a._resize=1,a._viewWidth=e),a._viewHeight!==t&&(a._resize=1,a._viewHeight=t),a._origin[0]===i[0]&&a._origin[1]===i[1]||(a._resize=1,a._origin=i),s&&a.run("enter"),o&&a.runAfter((e=>e.resize()))}),!1,1)},addEventListener(e,t,n){let r=t;return n&&!1===n.trap||(r=U$(this,t),r.raw=t),this._handler.on(e,r),this},removeEventListener(e,t){for(var n,r,i=this._handler.handlers(e),o=i.length;--o>=0;)if(r=i[o].type,n=i[o].handler,e===r&&(t===n||t===n.raw)){this._handler.off(r,n);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.includes(e)||t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return sN(this,e,oN(this,e),t)},removeSignalListener(e,t){return uN(this,oN(this,e),t)},addDataListener(e,t){return sN(this,e,b$(this,e).values,t)},removeDataListener(e,t){return uN(this,b$(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=v$(this,null);this._globalCursor=!!e,t&&v$(this,t)}return this}return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:function(e,t){this._timers.push(function(e,t,n){var r=new sO,i=t;return null==t?(r.restart(e,t,n),r):(r._restart=r.restart,r.restart=function(e,t,n){t=+t,n=null==n?oO():+n,r._restart((function o(a){a+=i,r._restart(o,i+=t,n),e(a)}),t,n)},r.restart(e,t,n),r)}((function(t){e({timestamp:Date.now(),elapsed:t})}),t))},events:function(e,t,n){var r,i=this,o=new pa(n),a=function(n,r){i.runAsync(null,(()=>{e===A$&&function(e,t){var n=e._eventConfig.defaults,r=n.prevent,i=n.allow;return!1!==r&&!0!==i&&(!0===r||!1===i||(r?r[t]:i?!i[t]:e.preventDefault()))}(i,t)&&n.preventDefault(),o.receive(function(e,t,n){var r,i,o=e._renderer,a=o&&o.canvas();return a&&(i=k$(e),(r=vv(t.changedTouches?t.changedTouches[0]:t,a))[0]-=i[0],r[1]-=i[1]),t.dataflow=e,t.item=n,t.vega=function(e,t,n){const r=t?"group"===t.mark.marktype?t:t.mark.group:null;function i(e){var n,i=r;if(e)for(n=t;n;n=n.mark.group)if(n.mark.name===e){i=n;break}return i&&i.mark&&i.mark.interactive?i:{}}function o(e){if(!e)return n;Ne(e)&&(e=i(e));const t=n.slice();for(;e;)t[0]-=e.x||0,t[1]-=e.y||0,e=e.mark&&e.mark.group;return t}return{view:ye(e),item:ye(t||{}),group:i,xy:o,x:e=>o(e)[0],y:e=>o(e)[1]}}(e,n,r),t}(i,n,r))}))};if("timer"===e)D$(i,"timer",t)&&i.timer(a,t);else if(e===A$)D$(i,"view",t)&&i.addEventListener(t,a,E$);else if("window"===e?D$(i,"window",t)&&"undefined"!=typeof window&&(r=[window]):"undefined"!=typeof document&&D$(i,"selector",t)&&(r=Array.from(document.querySelectorAll(e))),r){for(var s=0,u=r.length;s=0;)a[e].stop();for(e=u.length;--e>=0;)for(t=(n=u[e]).sources.length;--t>=0;)n.sources[t].removeEventListener(n.type,n.handler);for(o&&o.call(this,this._handler,null,null,null),e=s.length;--e>=0;)i=s[e].type,r=s[e].handler,this._handler.off(i,r);return this},hover:function(e,t){return t=[t||"update",(e=[e||"hover"])[0]],this.on(this.events("view","pointerover",C$),S$,F$(e)),this.on(this.events("view","pointerout",C$),S$,F$(t)),this},data:function(e,t){return arguments.length<2?b$(this,e).values.value:x$.call(this,e,aa().remove(C).insert(t))},change:x$,insert:function(e,t){return x$.call(this,e,aa().insert(t))},remove:function(e,t){return x$.call(this,e,aa().remove(t))},scale:function(e){var t=this._runtime.scales;return ke(t,e)||_("Unrecognized scale or projection: "+e),t[e].value},initialize:function(e,t){const n=this,r=n._renderType,i=n._eventConfig.bind,o=Hb(r);e=n._el=e?q$(n,e,!0):null,function(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),m$(t,e.description()))}(n),o||n.error("Unrecognized renderer type: "+r);const a=o.handler||Uv,s=e?o.renderer:o.headless;return n._renderer=s?I$(n,n._renderer,e,s):null,n._handler=function(e,t,n,r){const i=new r(e.loader(),U$(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,k$(e),e);return t&&t.handlers().forEach((e=>{i.on(e.type,e.handler)})),i}(n,n._handler,e,a),n._redraw=!0,e&&"none"!==i&&(t=t?n._elBind=q$(n,t,!0):e.appendChild(M$("form",{class:"vega-bindings"})),n._bind.forEach((e=>{e.param.element&&"container"!==i&&(e.element=q$(n,e.param.element,!!e.param.input))})),n._bind.forEach((e=>{!function(e,t,n){if(!t)return;const r=n.param;let i=n.state;i||(i=n.state={elements:null,active:!1,set:null,update:t=>{t!=e.signal(r.signal)&&e.runAsync(null,(()=>{i.source=!0,e.signal(r.signal,t)}))}},r.debounce&&(i.update=ve(r.debounce,i.update))),(null==r.input&&r.element?$$:N$)(i,t,r,e),i.active||(e.on(e._signals[r.signal],null,(()=>{i.source?i.source=!1:i.set(e.signal(r.signal))})),i.active=!0)}(n,e.element||t,e)}))),n},toImageURL:async function(e,t){e!==qb.Canvas&&e!==qb.SVG&&e!==qb.PNG&&_("Unrecognized image type: "+e);const n=await G$(this,e,t);return e===qb.SVG?function(e){const t=new Blob([e],{type:"image/svg+xml"});return window.URL.createObjectURL(t)}(n.svg()):n.canvas().toDataURL("image/png")},toCanvas:async function(e,t){return(await G$(this,qb.Canvas,e,t)).canvas()},toSVG:async function(e){return(await G$(this,qb.SVG,e)).svg()},getState:function(e){return this._runtime.getState(e||{data:Q$,signals:eN,recurse:!0})},setState:function(e){return this.runAsync(null,(t=>{t._trigger=!1,t._runtime.setState(e)}),(e=>{e._trigger=!0})),this},_watchPixelRatio:function(){if("canvas"===this.renderer()&&this._renderer._canvas){let e=null;const t=()=>{null!=e&&e();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}});const lN="view",cN="[",fN="]",dN="{",hN="}",pN=":",gN=",",mN="@",yN=">",vN=/[[\]{}]/,bN={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let xN,_N;function wN(e,t,n){return xN=t||lN,_N=n||bN,AN(e.trim()).map(EN)}function kN(e,t,n,r,i){const o=e.length;let a,s=0;for(;t=0?--s:r&&r.indexOf(a)>=0&&++s}return t}function AN(e){const t=[],n=e.length;let r=0,i=0;for(;i' after between selector: "+e;n=n.map(EN);const i=EN(e.slice(1).trim());return i.between?{between:n,stream:i}:(i.between=n,i)}(e):function(e){const t={source:xN},n=[];let r,i,o=[0,0],a=0,s=0,u=e.length,l=0;if(e[u-1]===hN){if(l=e.lastIndexOf(dN),!(l>=0))throw"Unmatched right brace: "+e;try{o=function(e){const t=e.split(gN);if(!e.length||t.length>2)throw e;return t.map((t=>{const n=+t;if(n!=n)throw e;return n}))}(e.substring(l+1,u-1))}catch(t){throw"Invalid throttle specification: "+e}u=(e=e.slice(0,l).trim()).length,l=0}if(!u)throw e;if(e[0]===mN&&(a=++l),r=kN(e,l,pN),r1?(t.type=n[1],a?t.markname=n[0].slice(1):(c=n[0],_N[c]?t.marktype=n[0]:t.source=n[0])):t.type=n[0],"!"===t.type.slice(-1)&&(t.consume=!0,t.type=t.type.slice(0,-1)),null!=i&&(t.filter=i),o[0]&&(t.throttle=o[0]),o[1]&&(t.debounce=o[1]),t}(e)}function ON(e){return R(e)?e:{type:e||"pad"}}const DN=e=>+e||0,CN=e=>({top:e,bottom:e,left:e,right:e});function SN(e){return R(e)?e.signal?e:{top:DN(e.top),bottom:DN(e.bottom),left:DN(e.left),right:DN(e.right)}:CN(DN(e))}const FN=e=>R(e)&&!z(e)?be({},e):{value:e};function MN(e,t,n,r){return null!=n?(R(n)&&!z(n)||z(n)&&n.length&&R(n[0])?e.update[t]=n:e[r||"enter"][t]={value:n},1):0}function jN(e,t,n){for(const n in t)MN(e,n,t[n]);for(const t in n)MN(e,t,n[t],"update")}function $N(e,t,n){for(const r in t)n&&ke(n,r)||(e[r]=be(e[r]||{},t[r]));return e}function NN(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const BN="mark",TN="frame",zN="scope",RN="axis",PN="axis-domain",LN="axis-grid",IN="axis-label",UN="axis-tick",qN="axis-title",WN="legend",HN="legend-band",GN="legend-entry",VN="legend-gradient",YN="legend-label",XN="legend-symbol",ZN="legend-title",JN="title",KN="title-text",QN="title-subtitle";function eB(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const tB=e=>Ne(e)?qe(e):e.signal?`(${e.signal})`:oB(e);function nB(e){if(null!=e.gradient)return function(e){const t=[e.start,e.stop,e.count].map((e=>null==e?null:qe(e)));for(;t.length&&null==q(t);)t.pop();return t.unshift(tB(e.gradient)),`gradient(${t.join(",")})`}(e);let t=e.signal?`(${e.signal})`:e.color?function(e){return e.c?rB("hcl",e.h,e.c,e.l):e.h||e.s?rB("hsl",e.h,e.s,e.l):e.l||e.a?rB("lab",e.l,e.a,e.b):e.r||e.g||e.b?rB("rgb",e.r,e.g,e.b):null}(e.color):null!=e.field?oB(e.field):void 0!==e.value?qe(e.value):void 0;return null!=e.scale&&(t=function(e,t){const n=tB(e.scale);return null!=e.range?t=`lerp(_range(${n}), ${+e.range})`:(void 0!==t&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(1==+e.band?"":"*"+iB(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),null==t&&(t="0")),t}(e,t)),void 0===t&&(t=null),null!=e.exponent&&(t=`pow(${t},${iB(e.exponent)})`),null!=e.mult&&(t+=`*${iB(e.mult)}`),null!=e.offset&&(t+=`+${iB(e.offset)}`),e.round&&(t=`round(${t})`),t}const rB=(e,t,n,r)=>`(${e}(${[t,n,r].map(nB).join(",")})+'')`;function iB(e){return R(e)?"("+nB(e)+")":e}function oB(e){return aB(R(e)?e:{datum:e})}function aB(e){let t,n,r;if(e.signal)t="datum",r=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(r=e.parent,t+=".datum"):r=e.group}else e.datum?(t="datum",r=e.datum):_("Invalid field reference: "+qe(e));return e.signal||(r=Ne(r)?w(r).map(qe).join("]["):aB(r)),t+"["+r+"]"}function sB(e,t,n,r,i,o){const a={};(o=o||{}).encoders={$encode:a},e=function(e,t,n,r,i){const o={},a={};let s,u,l,c;for(u in u="lineBreak","text"!==t||null==i[u]||NN(u,e)||eB(o,u,i[u]),("legend"==n||String(n).startsWith("axis"))&&(n=null),c=n===TN?i.group:n===BN?be({},i.mark,i[t]):null,c)l=NN(u,e)||("fill"===u||"stroke"===u)&&(NN("fill",e)||NN("stroke",e)),l||eB(o,u,c[u]);for(u in ue(r).forEach((t=>{const n=i.style&&i.style[t];for(const t in n)NN(t,e)||eB(o,t,n[t])})),e=be({},e),o)c=o[u],c.signal?(s=s||{})[u]=c:a[u]=c;return e.enter=be(a,e.enter),s&&(e.update=be(s,e.update)),e}(e,t,n,r,i.config);for(const n in e)a[n]=uB(e[n],t,o,i);return o}function uB(e,t,n,r){const i={},o={};for(const t in e)null!=e[t]&&(i[t]=lB((a=e[t],z(a)?function(e){let t="";return e.forEach((e=>{const n=nB(e);t+=e.test?`(${e.test})?${n}:`:n})),":"===q(t)&&(t+="null"),t}(a):nB(a)),r,n,o));var a;return{$expr:{marktype:t,channels:i},$fields:Object.keys(o),$output:Object.keys(e)}}function lB(e,t,n,r){const i=i$(e,t);return i.$fields.forEach((e=>r[e]=1)),be(n,i.$params),i.$expr}const cB="outer",fB=["value","update","init","react","bind"];function dB(e,t){_(e+' for "outer" push: '+qe(t))}function hB(e,t){const n=e.name;if(e.push===cB)t.signals[n]||dB("No prior signal definition",n),fB.forEach((t=>{void 0!==e[t]&&dB("Invalid property ",t)}));else{const r=t.addSignal(n,e.value);!1===e.react&&(r.react=!1),e.bind&&t.addBinding(n,e.bind)}}function pB(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function gB(e,t,n,r){return new pB(e,t,n,r)}function mB(e,t){return gB("operator",e,t)}function yB(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function vB(e,t){return t?{$field:e,$name:t}:{$field:e}}const bB=vB("key");function xB(e,t){return{$compare:e,$order:t}}function _B(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const wB="scope",kB="view";function AB(e){return e&&e.signal}function EB(e){if(AB(e))return!0;if(R(e))for(const t in e)if(EB(e[t]))return!0;return!1}function OB(e,t){return null!=e?e:t}function DB(e){return e&&e.signal||e}const CB="timer";function SB(e,t){return(e.merge?FB:e.stream?MB:e.type?jB:_("Invalid stream specification: "+qe(e)))(e,t)}function FB(e,t){const n=$B({merge:e.merge.map((e=>SB(e,t)))},e,t);return t.addStream(n).id}function MB(e,t){const n=$B({stream:SB(e.stream,t)},e,t);return t.addStream(n).id}function jB(e,t){let n;var r;e.type===CB?(n=t.event(CB,e.throttle),e={between:e.between,filter:e.filter}):n=t.event((r=e.source)===wB?kB:r||kB,e.type);const i=$B({stream:n},e,t);return 1===Object.keys(i).length?n:t.addStream(i).id}function $B(e,t,n){let r=t.between;return r&&(2!==r.length&&_('Stream "between" parameter must have 2 entries: '+qe(t)),e.between=[SB(r[0],n),SB(r[1],n)]),r=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&r.push(function(e,t,n){const r="event.item";return r+(e&&"*"!==e?"&&"+r+".mark.marktype==='"+e+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(t?"&&"+r+".mark.name==='"+t+"'":"")}(t.marktype,t.markname,t.markrole)),t.source===wB&&r.push("inScope(event.item)"),r.length&&(e.filter=i$("("+r.join(")&&(")+")",n).$expr),null!=(r=t.throttle)&&(e.throttle=+r),null!=(r=t.debounce)&&(e.debounce=+r),t.consume&&(e.consume=!0),e}const NB={code:"_.$value",ast:{type:"Identifier",value:"value"}};function BB(e){return{signal:"["+e.map((e=>e.scale?'scale("'+e.scale+'")':e.signal))+"]"}}const TB=e=>(t,n,r)=>gB(e,n,t||void 0,r),zB=TB("aggregate"),RB=TB("axisticks"),PB=TB("bound"),LB=TB("collect"),IB=TB("compare"),UB=TB("datajoin"),qB=TB("encode"),WB=TB("expression"),HB=TB("facet"),GB=TB("field"),VB=TB("key"),YB=TB("legendentries"),XB=TB("load"),ZB=TB("mark"),JB=TB("multiextent"),KB=TB("multivalues"),QB=TB("overlap"),eT=TB("params"),tT=TB("prefacet"),nT=TB("projection"),rT=TB("proxy"),iT=TB("relay"),oT=TB("render"),aT=TB("scale"),sT=TB("sieve"),uT=TB("sortitems"),lT=TB("viewlayout"),cT=TB("values");let fT=0;const dT={min:"min",max:"max",count:"sum"};function hT(e,t){const n=t.getScale(e.name).params;let r;for(r in n.domain=yT(e.domain,e,t),null!=e.range&&(n.range=ET(e,t,n)),null!=e.interpolate&&function(e,t){t.interpolate=pT(e.type||e),null!=e.gamma&&(t.interpolateGamma=pT(e.gamma))}(e.interpolate,n),null!=e.nice&&(n.nice=function(e,t){return e.signal?t.signalRef(e.signal):R(e)?{interval:pT(e.interval),step:pT(e.step)}:pT(e)}(e.nice,t)),null!=e.bins&&(n.bins=function(e,t){return e.signal||z(e)?gT(e,t):t.objectProperty(e)}(e.bins,t)),e)ke(n,r)||"name"===r||(n[r]=pT(e[r],t))}function pT(e,t){return R(e)?e.signal?t.signalRef(e.signal):_("Unsupported object: "+qe(e)):e}function gT(e,t){return e.signal?t.signalRef(e.signal):e.map((e=>pT(e,t)))}function mT(e){_("Can not find data set: "+qe(e))}function yT(e,t,n){if(e)return e.signal?n.signalRef(e.signal):(z(e)?vT:e.fields?xT:bT)(e,t,n);null==t.domainMin&&null==t.domainMax||_("No scale domain defined for domainMin/domainMax to override.")}function vT(e,t,n){return e.map((e=>pT(e,n)))}function bT(e,t,n){const r=n.getData(e.data);return r||mT(e.data),kp(t.type)?r.valuesRef(n,e.field,wT(e.sort,!1)):Dp(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function xT(e,t,n){const r=e.data,i=e.fields.reduce(((e,t)=>(t=Ne(t)?{data:r,field:t}:z(t)||t.signal?function(e,t){const n="_:vega:_"+fT++,r=LB({});if(z(e))r.value={$ingest:e};else if(e.signal){const i="setdata("+qe(n)+","+e.signal+")";r.params.input=t.signalRef(i)}return t.addDataPipeline(n,[r,sT({})]),{data:n,field:"data"}}(t,n):t,e.push(t),e)),[]);return(kp(t.type)?_T:Dp(t.type)?kT:AT)(e,n,i)}function _T(e,t,n){const r=wT(e.sort,!0);let i,o;const a=n.map((e=>{const n=t.getData(e.data);return n||mT(e.data),n.countsRef(t,e.field,r)})),s={groupby:bB,pulse:a};r&&(i=r.op||"count",o=r.field?_B(i,r.field):"count",s.ops=[dT[i]],s.fields=[t.fieldRef(o)],s.as=[o]),i=t.add(zB(s));const u=t.add(LB({pulse:yB(i)}));return o=t.add(cT({field:bB,sort:t.sortRef(r),pulse:yB(u)})),yB(o)}function wT(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field&&e.op&&!dT[e.op]&&_("Multiple domain scales can not be sorted using "+e.op):_("No field provided for sort aggregate op: "+e.op):R(e)?e.field="key":e={field:"key"}),e}function kT(e,t,n){const r=n.map((e=>{const n=t.getData(e.data);return n||mT(e.data),n.domainRef(t,e.field)}));return yB(t.add(KB({values:r})))}function AT(e,t,n){const r=n.map((e=>{const n=t.getData(e.data);return n||mT(e.data),n.extentRef(t,e.field)}));return yB(t.add(JB({extents:r})))}function ET(e,t,n){const r=t.config.range;let i=e.range;if(i.signal)return t.signalRef(i.signal);if(Ne(i)){if(r&&ke(r,i))return ET(e=be({},e,{range:r[i]}),t,n);"width"===i?i=[0,{signal:"width"}]:"height"===i?i=kp(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:_("Unrecognized scale range value: "+qe(i))}else{if(i.scheme)return n.scheme=z(i.scheme)?gT(i.scheme,t):pT(i.scheme,t),i.extent&&(n.schemeExtent=gT(i.extent,t)),void(i.count&&(n.schemeCount=pT(i.count,t)));if(i.step)return void(n.rangeStep=pT(i.step,t));if(kp(e.type)&&!z(i))return yT(i,e,t);z(i)||_("Unsupported range type: "+qe(i))}return i.map((e=>(z(e)?gT:pT)(e,t)))}function OT(e,t,n){return z(e)?e.map((e=>OT(e,t,n))):R(e)?e.signal?n.signalRef(e.signal):"fit"===t?e:_("Unsupported parameter object: "+qe(e)):e}const DT="top",CT="left",ST="right",FT="bottom",MT="center",jT="vertical",$T="start",NT="end",BT="index",TT="label",zT="offset",RT="perc",PT="perc2",LT="value",IT="guide-label",UT="guide-title",qT="group-title",WT="group-subtitle",HT="symbol",GT="gradient",VT="discrete",YT="size",XT=[YT,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],ZT={name:1,style:1,interactive:1},JT={value:0},KT={value:1},QT="group",ez="rect",tz="rule",nz="symbol",rz="text";function iz(e){return e.type=QT,e.interactive=e.interactive||!1,e}function oz(e,t){const n=(n,r)=>OB(e[n],OB(t[n],r));return n.isVertical=n=>jT===OB(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>OB(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>OB(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>OB(e.columns,OB(t.columns,+n.isVertical(!0))),n}function az(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function sz(e,t,n){return`item.anchor === '${$T}' ? ${e} : item.anchor === '${NT}' ? ${t} : ${n}`}const uz=sz(qe(CT),qe(ST),qe(MT));function lz(e,t){return t?e?R(e)?Object.assign({},e,{offset:lz(e.offset,t)}):{value:e,offset:t}:t:e}function cz(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=$N(e.encode,t,ZT)):e.interactive=!1,e}function fz(e,t,n,r){const i=oz(e,n),o=i.isVertical(),a=i.gradientThickness(),s=i.gradientLength();let u,l,c,f,d;o?(l=[0,1],c=[0,0],f=a,d=s):(l=[0,0],c=[1,0],f=s,d=a);const h={enter:u={opacity:JT,x:JT,y:JT,width:FN(f),height:FN(d)},update:be({},u,{opacity:KT,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:JT}};return jN(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),cz({type:ez,role:VN,encode:h},r)}function dz(e,t,n,r,i){const o=oz(e,n),a=o.isVertical(),s=o.gradientThickness(),u=o.gradientLength();let l,c,f,d,h="";a?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const p={opacity:JT,fill:{scale:t,field:LT}};p[l]={signal:h+"datum."+RT,mult:u},p[c]=JT,p[f]={signal:h+"datum."+PT,mult:u},p[d]=FN(s);const g={enter:p,update:be({},p,{opacity:KT}),exit:{opacity:JT}};return jN(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),cz({type:ez,role:HN,key:LT,from:i,encode:g},r)}const hz=`datum.${RT}<=0?"${CT}":datum.${RT}>=1?"${ST}":"${MT}"`,pz=`datum.${RT}<=0?"${FT}":datum.${RT}>=1?"${DT}":"middle"`;function gz(e,t,n,r){const i=oz(e,t),o=i.isVertical(),a=FN(i.gradientThickness()),s=i.gradientLength();let u,l,c,f,d=i("labelOverlap"),h="";const p={enter:u={opacity:JT},update:l={opacity:KT,text:{field:TT}},exit:{opacity:JT}};return jN(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:OB(e.labelLimit,t.gradientLabelLimit)}),o?(u.align={value:"left"},u.baseline=l.baseline={signal:pz},c="y",f="x",h="1-"):(u.align=l.align={signal:hz},u.baseline={value:"top"},c="x",f="y"),u[c]=l[c]={signal:h+"datum."+RT,mult:s},u[f]=l[f]=a,a.offset=OB(e.labelOffset,t.gradientLabelOffset)||0,d=d?{separation:i("labelSeparation"),method:d,order:"datum."+BT}:void 0,cz({type:rz,role:YN,style:IT,key:LT,from:r,encode:p,overlap:d},n)}function mz(e,t,n,r,i){const o=oz(e,t),a=n.entries,s=!(!a||!a.interactive),u=a?a.name:void 0,l=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},d=`(${i}) ? datum.${zT} : datum.${YT}`,h=l?FN(l):{field:YT},p=`datum.${BT}`,g=`max(1, ${i})`;let m,y,v,b,x;h.mult=.5,m={enter:y={opacity:JT,x:{signal:d,mult:.5,offset:c},y:h},update:v={opacity:KT,x:y.x,y:y.y},exit:{opacity:JT}};let _=null,w=null;e.fill||(_=t.symbolBaseFillColor,w=t.symbolBaseStrokeColor),jN(m,{fill:o("symbolFillColor",_),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",w),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),XT.forEach((t=>{e[t]&&(v[t]=y[t]={scale:e[t],field:LT})}));const k=cz({type:nz,role:XN,key:LT,from:f,clip:!!l||void 0,encode:m},n.symbols),A=FN(c);A.offset=o("labelOffset"),m={enter:y={opacity:JT,x:{signal:d,offset:A},y:h},update:v={opacity:KT,text:{field:TT},x:y.x,y:y.y},exit:{opacity:JT}},jN(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const E=cz({type:rz,role:YN,style:IT,key:LT,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:JT,height:l?FN(l):JT,opacity:JT},exit:{opacity:JT},update:v={opacity:KT,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(b=`ceil(item.mark.items.length / ${g})`,v.row.signal=`${p}%${b}`,v.column.signal=`floor(${p} / ${b})`,x={field:["row",p]}):(v.row.signal=`floor(${p} / ${g})`,v.column.signal=`${p} % ${g}`,x={field:p}),v.column.signal=`(${i})?${v.column.signal}:${p}`,iz({role:zN,from:r={facet:{data:r,name:"value",groupby:BT}},encode:$N(m,a,ZT),marks:[k,E],name:u,interactive:s,sort:x})}const yz='item.orient === "left"',vz='item.orient === "right"',bz=`(${yz} || ${vz})`,xz=`datum.vgrad && ${bz}`,_z=sz('"top"','"bottom"','"middle"'),wz=`datum.vgrad && ${vz} ? (${sz('"right"','"left"','"center"')}) : (${bz} && !(datum.vgrad && ${yz})) ? "left" : ${uz}`,kz=`item._anchor || (${bz} ? "middle" : "start")`,Az=`${xz} ? (${yz} ? -90 : 90) : 0`,Ez=`${bz} ? (datum.vgrad ? (${vz} ? "bottom" : "top") : ${_z}) : "top"`;function Oz(e,t){let n;return R(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+Dz(e.path)+")":e.sphere&&(n="geoShape("+Dz(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function Dz(e){return R(e)&&e.signal?e.signal:qe(e)}function Cz(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===QT?zN:t||BN}function Sz(e){return{marktype:e.type,name:e.name||void 0,role:e.role||Cz(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function Fz(e,t){return e&&e.signal?t.signalRef(e.signal):!1!==e}function Mz(e,t){const n=ja(e.type);n||_("Unrecognized transform type: "+qe(e.type));const r=gB(n.type.toLowerCase(),null,jz(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(r)),r.metadata=n.metadata||{},r}function jz(e,t,n){const r={},i=e.params.length;for(let o=0;oBz(e,t,n)))):Bz(e,r,n)}(e,t,n):"projection"===r?n.projectionRef(t[e.name]):e.array&&!AB(i)?i.map((t=>Nz(e,t,n))):Nz(e,i,n):void(e.required&&_("Missing required "+qe(t.type)+" parameter: "+qe(e.name)))}function Nz(e,t,n){const r=e.type;if(AB(t))return Pz(r)?_("Expression references can not be signals."):Lz(r)?n.fieldRef(t):Iz(r)?n.compareRef(t):n.signalRef(t.signal);{const i=e.expr||Lz(r);return i&&Tz(t)?n.exprRef(t.expr,t.as):i&&zz(t)?vB(t.field,t.as):Pz(r)?i$(t,n):Rz(r)?yB(n.getData(t).values):Lz(r)?vB(t):Iz(r)?n.compareRef(t):t}}function Bz(e,t,n){const r=e.params.length;let i;for(let n=0;ne&&e.expr,zz=e=>e&&e.field,Rz=e=>"data"===e,Pz=e=>"expr"===e,Lz=e=>"field"===e,Iz=e=>"compare"===e;function Uz(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:yB(t.getData(e.data).output)}function qz(e,t,n,r,i){this.scope=e,this.input=t,this.output=n,this.values=r,this.aggregate=i,this.index={}}function Wz(e){return Ne(e)?e:null}function Hz(e,t,n){const r=_B(n.op,n.field);let i;if(t.ops){for(let e=0,n=t.as.length;enull==e?"null":e)).join(",")+"),0)",t);u.update=l.$expr,u.params=l.$params}function Yz(e,t){const n=Cz(e),r=e.type===QT,i=e.from&&e.from.facet,o=e.overlap;let a,s,u,l,c,f,d,h=e.layout||n===zN||n===TN;const p=n===BN||h||i,g=function(e,t,n){let r,i,o,a,s;return e?(r=e.facet)&&(t||_("Only group marks can be faceted."),null!=r.field?a=s=Uz(r,n):(e.data?s=yB(n.getData(e.data).aggregate):(o=Mz(be({type:"aggregate",groupby:ue(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=Uz(r,n),a=s=yB(n.add(o))),i=n.keyRef(r.groupby,!0))):a=yB(n.add(LB(null,[{}]))),a||(a=Uz(e,n)),{key:i,pulse:a,parent:s}}(e.from,r,t);s=t.add(UB({key:g.key||(e.key?vB(e.key):void 0),pulse:g.pulse,clean:!r}));const m=yB(s);s=u=t.add(LB({pulse:m})),s=t.add(ZB({markdef:Sz(e),interactive:Fz(e.interactive,t),clip:Oz(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:yB(s)}));const y=yB(s);s=l=t.add(qB(sB(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),s.params.parent=t.encode(),e.transform&&e.transform.forEach((e=>{const n=Mz(e,t),r=n.metadata;(r.generates||r.changes)&&_("Mark transforms should not generate new data."),r.nomod||(l.params.mod=!0),n.params.pulse=yB(s),t.add(s=n)})),e.sort&&(s=t.add(uT({sort:t.compareRef(e.sort),pulse:yB(s)})));const v=yB(s);(i||h)&&(h=t.add(lT({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:v})),f=yB(h));const b=t.add(PB({mark:y,pulse:f||v}));d=yB(b),r&&(p&&(a=t.operators,a.pop(),h&&a.pop()),t.pushState(v,f||d,m),i?function(e,t,n){const r=e.from.facet,i=r.name,o=Uz(r,t);let a;r.name||_("Facet must have a name: "+qe(r)),r.data||_("Facet must reference a data set: "+qe(r)),r.field?a=t.add(tT({field:t.fieldRef(r.field),pulse:o})):r.groupby?a=t.add(HB({key:t.keyRef(r.groupby),group:yB(t.proxy(n.parent)),pulse:o})):_("Facet must specify groupby or field: "+qe(r));const s=t.fork(),u=s.add(LB()),l=s.add(sT({pulse:yB(u)}));s.addData(i,new qz(s,u,u,l)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(e).toRuntime()}}(e,t,g):p?function(e,t,n){const r=t.add(tT({pulse:n.pulse})),i=t.fork();i.add(sT()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(e).toRuntime()}}(e,t,g):t.parse(e),t.popState(),p&&(h&&a.push(h),a.push(b))),o&&(d=function(e,t,n){const r=e.method,i=e.bound,o=e.separation,a={separation:AB(o)?n.signalRef(o.signal):o,method:AB(r)?n.signalRef(r.signal):r,pulse:t};if(e.order&&(a.sort=n.compareRef({field:e.order})),i){const e=i.tolerance;a.boundTolerance=AB(e)?n.signalRef(e.signal):+e,a.boundScale=n.scaleRef(i.scale),a.boundOrient=i.orient}return yB(n.add(QB(a)))}(o,d,t));const x=t.add(oT({pulse:d})),w=t.add(sT({pulse:yB(x)},void 0,t.parent()));null!=e.name&&(c=e.name,t.addData(c,new qz(t,u,x,w)),e.on&&e.on.forEach((e=>{(e.insert||e.remove||e.toggle)&&_("Marks only support modify triggers."),Vz(e,t,c)})))}function Xz(e,t,n){const r={enter:{},update:{}};return jN(r,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),r}function Zz(e,t,n){return t[e]?`scale("${t[e]}",datum)`:az(e,n[0].encode)}qz.fromEntries=function(e,t){const n=t.length,r=t[n-1],i=t[n-2];let o=t[0],a=null,s=1;for(o&&"load"===o.type&&(o=t[1]),e.add(t[0]);se===FT||e===DT,nR=(e,t,n)=>AB(e)?lR(e.signal,t,n):e===CT||e===DT?t:n,rR=(e,t,n)=>AB(e)?sR(e.signal,t,n):tR(e)?t:n,iR=(e,t,n)=>AB(e)?uR(e.signal,t,n):tR(e)?n:t,oR=(e,t,n)=>AB(e)?cR(e.signal,t,n):e===DT?{value:t}:{value:n},aR=(e,t,n)=>AB(e)?fR(e.signal,t,n):e===ST?{value:t}:{value:n},sR=(e,t,n)=>dR(`${e} === '${DT}' || ${e} === '${FT}'`,t,n),uR=(e,t,n)=>dR(`${e} !== '${DT}' && ${e} !== '${FT}'`,t,n),lR=(e,t,n)=>pR(`${e} === '${CT}' || ${e} === '${DT}'`,t,n),cR=(e,t,n)=>pR(`${e} === '${DT}'`,t,n),fR=(e,t,n)=>pR(`${e} === '${ST}'`,t,n),dR=(e,t,n)=>(t=null!=t?FN(t):t,n=null!=n?FN(n):n,hR(t)&&hR(n)?{signal:`${e} ? (${t=t?t.signal||qe(t.value):null}) : (${n=n?n.signal||qe(n.value):null})`}:[be({test:e},t)].concat(n||[])),hR=e=>null==e||1===Object.keys(e).length,pR=(e,t,n)=>({signal:`${e} ? (${mR(t)}) : (${mR(n)})`}),gR=(e,t,n,r,i)=>({signal:(null!=r?`${e} === '${CT}' ? (${mR(r)}) : `:"")+(null!=n?`${e} === '${FT}' ? (${mR(n)}) : `:"")+(null!=i?`${e} === '${ST}' ? (${mR(i)}) : `:"")+(null!=t?`${e} === '${DT}' ? (${mR(t)}) : `:"")+"(null)"}),mR=e=>AB(e)?e.signal:null==e?null:qe(e),yR=(e,t)=>0===t?0:AB(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},vR=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function bR(e,t,n,r){let i;if(t&&ke(t,e))return t[e];if(ke(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=e[5].toLowerCase()+e.slice(6)}return r[UT][i]}if(e.startsWith("label")){switch(e){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=e[5].toLowerCase()+e.slice(6)}return r[IT][i]}return null}function xR(e){const t={};for(const n of e)if(n)for(const e in n)t[e]=1;return Object.keys(t)}function _R(e,t){return{scale:e.scale,range:t}}function wR(e,t,n,r,i){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+r+","+i+")"}}function kR(e,t){const n=function(e,t){var n,r,i,o=t.config,a=o.style,s=o.axis,u="band"===t.scaleType(e.scale)&&o.axisBand,l=e.orient;if(AB(l)){const e=xR([o.axisX,o.axisY]),t=xR([o.axisTop,o.axisBottom,o.axisLeft,o.axisRight]);for(i of(n={},e))n[i]=rR(l,bR(i,o.axisX,s,a),bR(i,o.axisY,s,a));for(i of(r={},t))r[i]=gR(l.signal,bR(i,o.axisTop,s,a),bR(i,o.axisBottom,s,a),bR(i,o.axisLeft,s,a),bR(i,o.axisRight,s,a))}else n=l===DT||l===FT?o.axisX:o.axisY,r=o["axis"+l[0].toUpperCase()+l.slice(1)];return n||r||u?be({},s,n,r,u):s}(e,t),r=e.encode||{},i=r.axis||{},o=i.name||void 0,a=i.interactive,s=i.style,u=oz(e,n),l=function(e){const t=e("tickBand");let n,r,i=e("tickOffset");return t?t.signal?(n={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},R(i)||(i={signal:`(${t.signal}) === 'extent' ? 0 : ${i}`})):"extent"===t?(n=1,r=!0,i=0):(n=.5,r=!1):(n=e("bandPosition"),r=e("tickExtra")),{extra:r,band:n,offset:i}}(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:null!=e.title},f=yB(t.add(LB({},[c]))),d=yB(t.add(RB({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(function(e,t,n,r,i){const o=oz(e,t),a=e.orient,s=e.gridScale,u=nR(a,1,-1),l=function(e,t){if(1===t);else if(R(e)){let n=e=be({},e);for(;null!=n.mult;){if(!R(n.mult))return n.mult=AB(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n=n.mult=be({},n.mult)}n.mult=t}else e=AB(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);return e}(e.offset,u);let c,f,d;const h={enter:c={opacity:JT},update:d={opacity:KT},exit:f={opacity:JT}};jN(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:e.scale,field:LT,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=rR(a,{signal:"height"},{signal:"width"}),m=s?{scale:s,range:0,mult:u,offset:l}:{value:0,offset:l},y=s?{scale:s,range:1,mult:u,offset:l}:be(g,{mult:u,offset:l});return c.x=d.x=rR(a,p,m),c.y=d.y=iR(a,p,m),c.x2=d.x2=iR(a,y),c.y2=d.y2=rR(a,y),f.x=rR(a,p),f.y=iR(a,p),cz({type:tz,role:LN,key:LT,from:r,encode:h},n)}(e,n,r.grid,d,l)),c.ticks&&(p=u("tickSize"),h.push(function(e,t,n,r,i,o){const a=oz(e,t),s=e.orient,u=nR(s,-1,1);let l,c,f;const d={enter:l={opacity:JT},update:f={opacity:KT},exit:c={opacity:JT}};jN(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=FN(i);h.mult=u;const p={scale:e.scale,field:LT,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=l.y=rR(s,JT,p),f.y2=l.y2=rR(s,h),c.x=rR(s,p),f.x=l.x=iR(s,JT,p),f.x2=l.x2=iR(s,h),c.y=iR(s,p),cz({type:tz,role:UN,key:LT,from:r,encode:d},n)}(e,n,r.ticks,d,p,l))),c.labels&&(p=c.ticks?p:0,h.push(function(e,t,n,r,i,o){const a=oz(e,t),s=e.orient,u=e.scale,l=nR(s,-1,1),c=DB(a("labelFlush")),f=DB(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let p,g=0===c||!!c;const m=FN(i);m.mult=l,m.offset=FN(a("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:LT,band:.5,offset:lz(o.offset,a("labelOffset"))},v=rR(s,g?wR(u,c,'"left"','"right"','"center"'):{value:"center"},aR(s,"left","right")),b=rR(s,oR(s,"bottom","top"),g?wR(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=wR(u,c,`-(${f})`,f,0);g=g&&f;const _={opacity:JT,x:rR(s,y,m),y:iR(s,y,m)},w={enter:_,update:p={opacity:KT,text:{field:TT},x:_.x,y:_.y,align:v,baseline:b},exit:{opacity:JT,x:_.x,y:_.y}};jN(w,{dx:!d&&g?rR(s,x):null,dy:!h&&g?iR(s,x):null}),jN(w,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:d,baseline:h});const k=a("labelBound");let A=a("labelOverlap");return A=A||k?{separation:a("labelSeparation"),method:A,order:"datum.index",bound:k?{scale:u,orient:s,tolerance:k}:null}:void 0,p.align!==v&&(p.align=vR(p.align,v)),p.baseline!==b&&(p.baseline=vR(p.baseline,b)),cz({type:rz,role:IN,style:IT,key:LT,from:r,encode:w,overlap:A},n)}(e,n,r.labels,d,p,l))),c.domain&&h.push(function(e,t,n,r){const i=oz(e,t),o=e.orient;let a,s;const u={enter:a={opacity:JT},update:s={opacity:KT},exit:{opacity:JT}};jN(u,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const l=_R(e,0),c=_R(e,1);return a.x=s.x=rR(o,l,JT),a.x2=s.x2=rR(o,c),a.y=s.y=iR(o,l,JT),a.y2=s.y2=iR(o,c),cz({type:tz,role:PN,from:r,encode:u},n)}(e,n,r.domain,f)),c.title&&h.push(function(e,t,n,r){const i=oz(e,t),o=e.orient,a=nR(o,-1,1);let s,u;const l={enter:s={opacity:JT,anchor:FN(i("titleAnchor",null)),align:{signal:uz}},update:u=be({},s,{opacity:KT,text:FN(e.title)}),exit:{opacity:JT}},c={signal:`lerp(range("${e.scale}"), ${sz(0,1,.5)})`};return u.x=rR(o,c),u.y=iR(o,c),s.angle=rR(o,JT,yR(a,90)),s.baseline=rR(o,oR(o,FT,DT),{value:FT}),u.angle=s.angle,u.baseline=s.baseline,jN(l,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),function(e,t,n,r){const i=(e,t)=>null!=e?(n.update[t]=vR(FN(e),n.update[t]),!1):!NN(t,r),o=i(e("titleX"),"x"),a=i(e("titleY"),"y");n.enter.auto=a===o?FN(a):rR(t,FN(a),FN(o))}(i,o,l,n),l.update.align=vR(l.update.align,s.align),l.update.angle=vR(l.update.angle,s.angle),l.update.baseline=vR(l.update.baseline,s.baseline),cz({type:rz,role:qN,style:UT,from:r,encode:l},n)}(e,n,r.title,f)),Yz(iz({role:RN,from:f,encode:$N(AR(u,e),i,ZT),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:a,style:s}),t)}function AR(e,t){const n={enter:{},update:{}};return jN(n,{orient:e("orient"),offset:e("offset")||0,position:OB(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function ER(e,t,n){const r=ue(e.signals),i=ue(e.scales);return n||r.forEach((e=>hB(e,t))),ue(e.projections).forEach((e=>function(e,t){const n=t.config.projection||{},r={};for(const n in e)"name"!==n&&(r[n]=OT(e[n],n,t));for(const e in n)null==r[e]&&(r[e]=OT(n[e],e,t));t.addProjection(e.name,r)}(e,t))),i.forEach((e=>function(e,t){const n=e.type||"linear";xp(n)||_("Unrecognized scale type: "+qe(n)),t.addScale(e.name,{type:n,domain:void 0})}(e,t))),ue(e.data).forEach((e=>function(e,t){const n=[];e.transform&&e.transform.forEach((e=>{n.push(Mz(e,t))})),e.on&&e.on.forEach((n=>{Vz(n,t,e.name)})),t.addDataPipeline(e.name,function(e,t,n){const r=[];let i,o,a,s,u,l=null,c=!1,f=!1;for(e.values?AB(e.values)||EB(e.format)?(r.push(eR(t,e)),r.push(l=Qz())):r.push(l=Qz({$ingest:e.values,$format:e.format})):e.url?EB(e.url)||EB(e.format)?(r.push(eR(t,e)),r.push(l=Qz())):r.push(l=Qz({$request:e.url,$format:e.format})):e.source&&(l=i=ue(e.source).map((e=>yB(t.getData(e).output))),r.push(null)),o=0,a=n.length;ohT(e,t))),(n||r).forEach((e=>function(e,t){const n=t.getSignal(e.name);let r=e.update;e.init&&(r?_("Signals can not include both init and update expressions."):(r=e.init,n.initonly=!0)),r&&(r=i$(r,t),n.update=r.$expr,n.params=r.$params),e.on&&e.on.forEach((e=>function(e,t,n){const r=e.encode,i={target:n};let o=e.events,a=e.update,s=[];o||_("Signal update missing events specification."),Ne(o)&&(o=wN(o,t.isSubscope()?wB:kB)),o=ue(o).filter((e=>e.signal||e.scale?(s.push(e),0):1)),s.length>1&&(s=[BB(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),null!=r&&(a&&_("Signal encode and update are mutually exclusive."),a="encode(item(),"+qe(r)+")"),i.update=Ne(a)?i$(a,t):null!=a.expr?i$(a.expr,t):null!=a.value?a.value:null!=a.signal?{$expr:NB,$params:{$value:t.signalRef(a.signal)}}:_("Invalid signal update specification."),e.force&&(i.options={force:!0}),s.forEach((e=>t.addUpdate(be(function(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):SB(e,t)}}(e,t),i))))}(e,t,n.id)))}(e,t))),ue(e.axes).forEach((e=>kR(e,t))),ue(e.marks).forEach((e=>Yz(e,t))),ue(e.legends).forEach((e=>function(e,t){const n=t.config.legend,r=e.encode||{},i=oz(e,n),o=r.legend||{},a=o.name||void 0,s=o.interactive,u=o.style,l={};let c,f,d,h=0;XT.forEach((t=>e[t]?(l[t]=e[t],h=h||e[t]):0)),h||_("Missing valid scale for legend.");const p=function(e,t){let n=e.type||HT;return e.type||1!==function(e){return XT.reduce(((t,n)=>t+(e[n]?1:0)),0)}(e)||!e.fill&&!e.stroke||(n=wp(t)?GT:Ap(t)?VT:HT),n!==GT?n:Ap(t)?VT:GT}(e,t.scaleType(h)),g={title:null!=e.title,scales:l,type:p,vgrad:"symbol"!==p&&i.isVertical()},m=yB(t.add(LB(null,[g]))),y=yB(t.add(YB(f={type:p,scale:t.scaleRef(h),count:t.objectProperty(i("tickCount")),limit:t.property(i("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===GT?(d=[fz(e,h,n,r.gradient),gz(e,n,r.labels,y)],f.count=f.count||t.signalRef(`max(2,2*floor((${DB(i.gradientLength())})/100))`)):p===VT?d=[dz(e,h,n,r.gradient,y),gz(e,n,r.labels,y)]:(c=function(e,t){const n=oz(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(e,n),d=[mz(e,n,r,y,DB(c.columns))],f.size=function(e,t,n){const r=DB(Zz("size",e,n)),i=DB(Zz("strokeWidth",e,n)),o=DB(function(e,t,n){return az("fontSize",e)||function(e,t,n){const r=t.config.style[n];return r&&r.fontSize}(0,t,n)}(n[1].encode,t,IT));return i$(`max(ceil(sqrt(${r})+${i}),${o})`,t)}(e,t,d[0].marks)),d=[iz({role:GN,from:m,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:c,interactive:s})],g.title&&d.push(function(e,t,n,r){const i=oz(e,t),o={enter:{opacity:JT},update:{opacity:KT,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:JT}};return jN(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:kz},angle:{signal:Az},align:{signal:wz},baseline:{signal:Ez},text:e.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),cz({type:rz,role:ZN,style:UT,from:r,encode:o},n)}(e,n,r.title,m)),Yz(iz({role:WN,from:m,encode:$N(Xz(i,e,n),o,ZT),marks:d,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:a,interactive:s,style:u}),t)}(e,t))),e.title&&function(e,t){const n=oz(e=Ne(e)?{text:e}:e,t.config.title),r=e.encode||{},i=r.group||{},o=i.name||void 0,a=i.interactive,s=i.style,u=[],l=yB(t.add(LB(null,[{}])));u.push(function(e,t,n,r){const i={value:0},o={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return jN(o,{text:e.text,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),cz({type:rz,role:KN,style:qT,from:r,encode:o},n)}(e,n,function(e){const t=e.encode;return t&&t.title||be({name:e.name,interactive:e.interactive,style:e.style},t)}(e),l)),e.subtitle&&u.push(function(e,t,n,r){const i={value:0},o={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return jN(o,{text:e.subtitle,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),cz({type:rz,role:QN,style:WT,from:r,encode:o},n)}(e,n,r.subtitle,l)),Yz(iz({role:JN,from:l,encode:Kz(n,i),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:a,style:s}),t)}(e.title,t),t.parseLambdas(),t}const OR=e=>$N({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function DR(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function CR(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function SR(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}function FR(e){return(z(e)?MR:jR)(e)}function MR(e){const t=e.length;let n="[";for(let r=0;r0?",":"")+(R(t)?t.signal||FR(t):qe(t))}return n+"]"}function jR(e){let t,n,r="{",i=0;for(t in e)n=e[t],r+=(++i>1?",":"")+qe(t)+":"+(R(n)?n.signal||FR(n):qe(n));return r+"}"}function $R(e,t,n){return R(e)||_("Input Vega specification must be an object."),function(e,t){const n=t.config,r=yB(t.root=t.add(mB())),i=function(e,t){const n=n=>OB(e[n],t[n]),r=[DR("background",n("background")),DR("autosize",ON(n("autosize"))),DR("padding",SN(n("padding"))),DR("width",n("width")||0),DR("height",n("height")||0)],i=r.reduce(((e,t)=>(e[t.name]=t,e)),{}),o={};return ue(e.signals).forEach((e=>{ke(i,e.name)?e=be(i[e.name],e):r.push(e),o[e.name]=e})),ue(t.signals).forEach((e=>{ke(o,e.name)||ke(i,e.name)||r.push(e)})),r}(e,n);i.forEach((e=>hB(e,t))),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const o=t.add(LB()),a=t.add(qB(sB(OR(e.encode),QT,TN,e.style,t,{pulse:yB(o)}))),s=t.add(lT({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:r,pulse:yB(a)}));t.operators.pop(),t.pushState(yB(a),yB(s),null),ER(e,t,i),t.operators.push(s);let u=t.add(PB({mark:r,pulse:yB(s)}));return u=t.add(oT({pulse:yB(u)})),u=t.add(sT({pulse:yB(u)})),t.addData("root",new qz(t,o,o,u)),t}(e,new CR(t=L(function(){const e="sans-serif",t="#4c78a8",n="#000",r="#888",i="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:t},area:{fill:t},image:null,line:{stroke:t,strokeWidth:2},path:{stroke:t},rect:{fill:t},rule:{stroke:n},shape:{stroke:t},symbol:{fill:t,size:64},text:{fill:n,font:e,fontSize:11},trail:{fill:t,size:2},style:{"guide-label":{fill:n,font:e,fontSize:10},"guide-title":{fill:n,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:n,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:n,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:i},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:r,grid:!1,gridWidth:1,gridColor:i,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:r,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:i,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:r,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}(),t,e.config),n)).toRuntime()}CR.prototype=SR.prototype={parse(e){return ER(e,this)},fork(){return new SR(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach((t=>{t.$ref=e.id})),e.refs=null),e},proxy(e){const t=e instanceof pB?yB(e):e;return this.add(rT({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;for(e in this.root&&(this.root.root=!0),this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(e,t,n){let r,i;e&&(r=e.data||(e.data={}),i=r[t]||(r[t]=[]),i.push(n))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const r in t.index)n(t.index[r],e,"index:"+r)}return this},pushState(e,t,n){this._encode.push(yB(this.add(sT({pulse:e})))),this._parent.push(t),this._lookup.push(n?yB(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return q(this._parent)},encode(){return q(this._encode)},lookup(){return q(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(Ne(e))return vB(e,t);e.signal||_("Unsupported field reference: "+qe(e));const n=e.signal;let r=this.field[n];if(!r){const e={name:this.signalRef(n)};t&&(e.as=t),this.field[n]=r=yB(this.add(GB(e)))}return r},compareRef(e){let t=!1;const n=e=>AB(e)?(t=!0,this.signalRef(e.signal)):function(e){return e&&e.expr}(e)?(t=!0,this.exprRef(e.expr)):e,r=ue(e.field).map(n),i=ue(e.order).map(n);return t?yB(this.add(IB({fields:r,orders:i}))):xB(r,i)},keyRef(e,t){let n=!1;const r=this.signals;return e=ue(e).map((e=>AB(e)?(n=!0,yB(r[e.signal])):e)),n?yB(this.add(VB({fields:e,flat:t}))):function(e,t){const n={$key:e};return t&&(n.$flat=!0),n}(e,t)},sortRef(e){if(!e)return e;const t=_B(e.op,e.field),n=e.order||"ascending";return n.signal?yB(this.add(IB({fields:t,orders:this.signalRef(n.signal)}))):xB(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:e,type:t}),this.events[n]=r}return this.events[n]},hasOwnSignal(e){return ke(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&_("Duplicate signal name: "+qe(e));const n=t instanceof pB?t:this.add(mB(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||_("Unrecognized signal name: "+qe(e)),this.signals[e]},signalRef(e){return this.signals[e]?yB(this.signals[e]):(ke(this.lambdas,e)||(this.lambdas[e]=this.add(mB(null))),yB(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t{"use strict";t.exports=e},51:e=>{"use strict";e.exports={version:"0.3.1"}},330:e=>{"use strict";e.exports=JSON.parse('{"name":"jupyter-vega","version":"4.1.0","description":"IPython/Jupyter notebook module for [Vega](https://vega.github.io/vega), and [Vega-Lite](https://vega.github.io/vega-lite).","repository":{"type":"git","url":"git+https://github.com/vega/ipyvega.git"},"author":"","license":"BSD-3-Clause","bugs":{"url":"https://github.com/vega/ipyvega/issues"},"homepage":"https://github.com/vega/ipyvega#readme","scripts":{"format":"prettier --write \'src/*.ts\'","lint":"prettier --check \'src/*.ts\'","build":"webpack --mode production","watch":"webpack --mode development --watch"},"dependencies":{"jupyter-tablewidgets":"^0.3.0","vega":"5.30.0","vega-lite":"4.17.0","vega-embed":"^6.26.0","@jupyter-widgets/base":"6.0.10","@types/webpack-env":"*"},"devDependencies":{"@types/webpack-env":"*","@types/ndarray":"^1.0.14","filemanager-webpack-plugin":"^8.0.0","prettier":"^3.3.3","ts-loader":"^9.5.1","typescript":"^5.0.4","webpack":"^5.94.0","webpack-cli":"^5.1.4"},"files":["dist","src","package.json","tsconfig.json","webpack.config.js","yarn.lock","vega/static/"],"jupyterlab":{"extension":"vega/static/labplugin","sharedPackages":{"@jupyter-widgets/base":{"bundled":false,"singleton":true}}}}')}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var o=n[e]={exports:{}};return t[e].call(o.exports,o,o.exports,r),o.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(156)})())); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/vega/static/index.js.LICENSE.txt b/vega/static/index.js.LICENSE.txt index a24b9663..324568c0 100644 --- a/vega/static/index.js.LICENSE.txt +++ b/vega/static/index.js.LICENSE.txt @@ -1,18 +1,12 @@ +/*! + * https://github.com/Starcounter-Jack/JSON-Patch + * (c) 2017-2021 Joachim Wester + * MIT license + */ + /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ - -/*! - * https://github.com/Starcounter-Jack/JSON-Patch - * (c) 2017-2021 Joachim Wester - * MIT license - */ - -/*! - * https://github.com/Starcounter-Jack/JSON-Patch - * (c) 2017-2022 Joachim Wester - * MIT licensed - */ diff --git a/vega/static/index.js.map b/vega/static/index.js.map index 29a21681..8562d843 100644 --- a/vega/static/index.js.map +++ b/vega/static/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";0DAAA,IAAIA,EAAQ,WACZ,aAEA,SAASC,EAAYC,EAAKC,GACxB,OAAe,MAARA,GAAgBD,aAAeC,CACxC,CAEA,IAAIC,EASAC,EAOAC,EAfJ,IACEF,EAAYG,GACd,CAAE,MAAMC,GAGNJ,EAAY,WAAY,CAC1B,CAGA,IACEC,EAAYI,GACd,CAAE,MAAMD,GACNH,EAAY,WAAY,CAC1B,CAGA,IACEC,EAAgBI,OAClB,CAAE,MAAMF,GACNF,EAAgB,WAAY,CAC9B,CAuBA,SAASN,EAAMW,EAAQC,EAAUC,EAAOC,EAAWC,GACzB,iBAAbH,IACTC,EAAQD,EAASC,MACjBC,EAAYF,EAASE,UACrBC,EAAuBH,EAASG,qBAChCH,EAAWA,EAASA,UAItB,IAAII,EAAa,GACbC,EA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MAAO,WAE7DgB,OAAOqB,eAAegB,EAAS,aAAc,CAAErD,OAAO,GAAO,ECFpC83P,EAAoB","sources":["webpack://jupyter-vega/./node_modules/clone/clone.js","webpack://jupyter-vega/./node_modules/cwise-compiler/compiler.js","webpack://jupyter-vega/./node_modules/cwise-compiler/lib/compile.js","webpack://jupyter-vega/./node_modules/cwise-compiler/lib/thunk.js","webpack://jupyter-vega/./node_modules/cwise-parser/index.js","webpack://jupyter-vega/./node_modules/cwise/lib/cwise-esprima.js","webpack://jupyter-vega/./node_modules/dup/dup.js","webpack://jupyter-vega/./node_modules/esprima/esprima.js","webpack://jupyter-vega/./node_modules/fast-deep-equal/index.js","webpack://jupyter-vega/./node_modules/fast-json-stable-stringify/index.js","webpack://jupyter-vega/./node_modules/iota-array/iota.js","webpack://jupyter-vega/./node_modules/is-buffer/index.js","webpack://jupyter-vega/./node_modules/jupyter-tablewidgets/lib/compression.js","webpack://jupyter-vega/./node_modules/jupyter-tablewidgets/lib/index.js","webpack://jupyter-vega/./node_modules/jupyter-tablewidgets/lib/serializers.js","webpack://jupyter-vega/./node_modules/jupyter-tablewidgets/lib/widgets.js","webpack://jupyter-vega/./node_modules/lz4js/lz4.js","webpack://jupyter-vega/./node_modules/lz4js/util.js","webpack://jupyter-vega/./node_modules/lz4js/xxh32.js","webpack://jupyter-vega/./node_modules/ndarray-unpack/unpack.js","webpack://jupyter-vega/./node_modules/ndarray/ndarray.js","webpack://jupyter-vega/./node_modules/pako/index.js","webpack://jupyter-vega/./node_modules/pako/lib/deflate.js","webpack://jupyter-vega/./node_modules/pako/lib/inflate.js","webpack://jupyter-vega/./node_modules/pako/lib/utils/common.js","webpack://jupyter-vega/./node_modules/pako/lib/utils/strings.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/adler32.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/constants.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/crc32.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/deflate.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/gzheader.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/inffast.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/inflate.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/inftrees.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/messages.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/trees.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/zstream.js","webpack://jupyter-vega/./src/index.ts","webpack://jupyter-vega/./src/version.ts","webpack://jupyter-vega/./src/widget.ts","webpack://jupyter-vega/./node_modules/uniq/uniq.js","webpack://jupyter-vega/./node_modules/fast-json-patch/module/helpers.mjs","webpack://jupyter-vega/./node_modules/fast-json-patch/module/core.mjs","webpack://jupyter-vega/./node_modules/fast-json-patch/module/duplex.mjs","webpack://jupyter-vega/./node_modules/fast-json-patch/index.mjs","webpack://jupyter-vega/./node_modules/vega-util/build/vega-util.module.js","webpack://jupyter-vega/./node_modules/d3-dsv/src/dsv.js","webpack://jupyter-vega/./node_modules/topojson-client/src/identity.js","webpack://jupyter-vega/./node_modules/topojson-client/src/feature.js","webpack://jupyter-vega/./node_modules/topojson-client/src/transform.js","webpack://jupyter-vega/./node_modules/topojson-client/src/reverse.js","webpack://jupyter-vega/./node_modules/topojson-client/src/stitch.js","webpack://jupyter-vega/./node_modules/topojson-client/src/mesh.js","webpack://jupyter-vega/./node_modules/d3-array/src/ticks.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatSpecifier.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatPrefixAuto.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatDecimal.js","webpack://jupyter-vega/./node_modules/d3-format/src/exponent.js","webpack://jupyter-vega/./node_modules/d3-format/src/precisionPrefix.js","webpack://jupyter-vega/./node_modules/d3-format/src/precisionRound.js","webpack://jupyter-vega/./node_modules/d3-format/src/precisionFixed.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatRounded.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatTypes.js","webpack://jupyter-vega/./node_modules/d3-format/src/identity.js","webpack://jupyter-vega/./node_modules/d3-format/src/locale.js","webpack://jupyter-vega/./node_modules/d3-format/src/defaultLocale.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatGroup.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatNumerals.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatTrim.js","webpack://jupyter-vega/./node_modules/d3-time/src/interval.js","webpack://jupyter-vega/./node_modules/d3-time/src/duration.js","webpack://jupyter-vega/./node_modules/d3-time/src/day.js","webpack://jupyter-vega/./node_modules/d3-time/src/week.js","webpack://jupyter-vega/./node_modules/d3-time/src/year.js","webpack://jupyter-vega/./node_modules/d3-time/src/month.js","webpack://jupyter-vega/./node_modules/d3-time/src/hour.js","webpack://jupyter-vega/./node_modules/d3-time/src/minute.js","webpack://jupyter-vega/./node_modules/d3-time/src/second.js","webpack://jupyter-vega/./node_modules/d3-time/src/millisecond.js","webpack://jupyter-vega/./node_modules/d3-array/src/ascending.js","webpack://jupyter-vega/./node_modules/d3-array/src/descending.js","webpack://jupyter-vega/./node_modules/d3-array/src/bisector.js","webpack://jupyter-vega/./node_modules/vega-time/build/vega-time.module.js","webpack://jupyter-vega/./node_modules/d3-time-format/src/locale.js","webpack://jupyter-vega/./node_modules/d3-time-format/src/defaultLocale.js","webpack://jupyter-vega/./node_modules/vega-format/build/vega-format.module.js","webpack://jupyter-vega/./node_modules/vega-loader/build/vega-loader.browser.module.js","webpack://jupyter-vega/./node_modules/vega-dataflow/build/vega-dataflow.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/max.js","webpack://jupyter-vega/./node_modules/d3-array/src/min.js","webpack://jupyter-vega/./node_modules/d3-array/src/sort.js","webpack://jupyter-vega/./node_modules/d3-array/src/quickselect.js","webpack://jupyter-vega/./node_modules/d3-array/src/number.js","webpack://jupyter-vega/./node_modules/d3-array/src/quantile.js","webpack://jupyter-vega/./node_modules/d3-array/src/median.js","webpack://jupyter-vega/./node_modules/vega-statistics/build/vega-statistics.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/deviation.js","webpack://jupyter-vega/./node_modules/d3-array/src/variance.js","webpack://jupyter-vega/./node_modules/d3-array/src/range.js","webpack://jupyter-vega/./node_modules/vega-transforms/build/vega-transforms.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/mean.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/basis.js","webpack://jupyter-vega/./node_modules/d3-shape/src/noop.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/basisClosed.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/basisOpen.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/bundle.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/cardinal.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/cardinalOpen.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/cardinalClosed.js","webpack://jupyter-vega/./node_modules/d3-shape/src/math.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/catmullRom.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/catmullRomClosed.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/catmullRomOpen.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/linear.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/linearClosed.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/monotone.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/natural.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/step.js","webpack://jupyter-vega/./node_modules/d3-shape/src/constant.js","webpack://jupyter-vega/./node_modules/d3-path/src/path.js","webpack://jupyter-vega/./node_modules/d3-shape/src/path.js","webpack://jupyter-vega/./node_modules/d3-shape/src/arc.js","webpack://jupyter-vega/./node_modules/d3-shape/src/array.js","webpack://jupyter-vega/./node_modules/d3-shape/src/point.js","webpack://jupyter-vega/./node_modules/d3-shape/src/line.js","webpack://jupyter-vega/./node_modules/d3-shape/src/area.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/asterisk.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/circle.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/diamond.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/star.js","webpack://jupyter-vega/./node_modules/vega-canvas/build/vega-canvas.browser.module.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/triangle.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/triangle2.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/wye.js","webpack://jupyter-vega/./node_modules/d3-array/src/bisect.js","webpack://jupyter-vega/./node_modules/d3-color/src/define.js","webpack://jupyter-vega/./node_modules/d3-color/src/color.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/basis.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/basisClosed.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/constant.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/color.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/rgb.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/numberArray.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/array.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/date.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/number.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/object.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/string.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/value.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/round.js","webpack://jupyter-vega/./node_modules/d3-scale/src/number.js","webpack://jupyter-vega/./node_modules/d3-scale/src/continuous.js","webpack://jupyter-vega/./node_modules/d3-scale/src/constant.js","webpack://jupyter-vega/./node_modules/d3-scale/src/init.js","webpack://jupyter-vega/./node_modules/d3-scale/src/tickFormat.js","webpack://jupyter-vega/./node_modules/d3-scale/src/linear.js","webpack://jupyter-vega/./node_modules/d3-scale/src/nice.js","webpack://jupyter-vega/./node_modules/d3-scale/src/log.js","webpack://jupyter-vega/./node_modules/d3-scale/src/pow.js","webpack://jupyter-vega/./node_modules/d3-scale/src/symlog.js","webpack://jupyter-vega/./node_modules/d3-time/src/ticks.js","webpack://jupyter-vega/./node_modules/d3-scale/src/time.js","webpack://jupyter-vega/./node_modules/d3-scale/src/sequential.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/piecewise.js","webpack://jupyter-vega/./node_modules/d3-scale/src/diverging.js","webpack://jupyter-vega/./node_modules/internmap/src/index.js","webpack://jupyter-vega/./node_modules/d3-scale/src/ordinal.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/discrete.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/hue.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/transform/decompose.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/transform/parse.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/transform/index.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/zoom.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/hsl.js","webpack://jupyter-vega/./node_modules/d3-color/src/math.js","webpack://jupyter-vega/./node_modules/d3-color/src/lab.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/lab.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/hcl.js","webpack://jupyter-vega/./node_modules/d3-color/src/cubehelix.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/cubehelix.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/quantize.js","webpack://jupyter-vega/./node_modules/vega-scale/build/vega-scale.module.js","webpack://jupyter-vega/./node_modules/d3-scale/src/identity.js","webpack://jupyter-vega/./node_modules/d3-scale/src/utcTime.js","webpack://jupyter-vega/./node_modules/d3-scale/src/quantile.js","webpack://jupyter-vega/./node_modules/d3-scale/src/quantize.js","webpack://jupyter-vega/./node_modules/d3-scale/src/threshold.js","webpack://jupyter-vega/./node_modules/vega-scenegraph/build/vega-scenegraph.module.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol.js","webpack://jupyter-vega/./node_modules/vega-view-transforms/build/vega-view-transforms.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/sum.js","webpack://jupyter-vega/./node_modules/vega-encode/build/vega-encode.module.js","webpack://jupyter-vega/./node_modules/d3-geo/src/identity.js","webpack://jupyter-vega/./node_modules/d3-geo/src/stream.js","webpack://jupyter-vega/./node_modules/d3-array/src/fsum.js","webpack://jupyter-vega/./node_modules/d3-geo/src/math.js","webpack://jupyter-vega/./node_modules/d3-geo/src/noop.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/area.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/bounds.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/centroid.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/context.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/measure.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/string.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/index.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/buffer.js","webpack://jupyter-vega/./node_modules/d3-geo/src/pointEqual.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/rejoin.js","webpack://jupyter-vega/./node_modules/d3-geo/src/cartesian.js","webpack://jupyter-vega/./node_modules/d3-geo/src/polygonContains.js","webpack://jupyter-vega/./node_modules/d3-array/src/merge.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/index.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/antimeridian.js","webpack://jupyter-vega/./node_modules/d3-geo/src/circle.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/rectangle.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/line.js","webpack://jupyter-vega/./node_modules/d3-geo/src/compose.js","webpack://jupyter-vega/./node_modules/d3-geo/src/rotation.js","webpack://jupyter-vega/./node_modules/d3-geo/src/transform.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/fit.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/resample.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/index.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/circle.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/conic.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/conicEqualArea.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/cylindricalEqualArea.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/albers.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/azimuthal.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/azimuthalEqualArea.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/azimuthalEquidistant.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/mercator.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/conicConformal.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/equirectangular.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/conicEquidistant.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/equalEarth.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/gnomonic.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/naturalEarth1.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/orthographic.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/stereographic.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/transverseMercator.js","webpack://jupyter-vega/./node_modules/d3-geo-projection/src/math.js","webpack://jupyter-vega/./node_modules/d3-geo-projection/src/mollweide.js","webpack://jupyter-vega/./node_modules/vega-projection/build/vega-projection.module.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/albersUsa.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/identity.js","webpack://jupyter-vega/./node_modules/d3-geo/src/graticule.js","webpack://jupyter-vega/./node_modules/vega-geo/build/vega-geo.module.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/add.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/quad.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/x.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/y.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/quadtree.js","webpack://jupyter-vega/./node_modules/d3-force/src/constant.js","webpack://jupyter-vega/./node_modules/d3-force/src/jiggle.js","webpack://jupyter-vega/./node_modules/d3-force/src/collide.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/cover.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/data.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/extent.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/find.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/remove.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/root.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/size.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/visit.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/visitAfter.js","webpack://jupyter-vega/./node_modules/d3-dispatch/src/dispatch.js","webpack://jupyter-vega/./node_modules/d3-timer/src/timer.js","webpack://jupyter-vega/./node_modules/d3-force/src/lcg.js","webpack://jupyter-vega/./node_modules/d3-force/src/simulation.js","webpack://jupyter-vega/./node_modules/d3-force/src/link.js","webpack://jupyter-vega/./node_modules/vega-force/build/vega-force.module.js","webpack://jupyter-vega/./node_modules/d3-force/src/center.js","webpack://jupyter-vega/./node_modules/d3-force/src/manyBody.js","webpack://jupyter-vega/./node_modules/d3-force/src/x.js","webpack://jupyter-vega/./node_modules/d3-force/src/y.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/count.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/index.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/accessors.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/constant.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/each.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/eachAfter.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/eachBefore.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/find.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/sum.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/sort.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/path.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/ancestors.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/descendants.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/leaves.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/links.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/iterator.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/lcg.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/pack/enclose.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/pack/siblings.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/array.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/pack/index.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/round.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/dice.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/stratify.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/tree.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/cluster.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/slice.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/squarify.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/resquarify.js","webpack://jupyter-vega/./node_modules/vega-hierarchy/build/vega-hierarchy.module.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/partition.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/binary.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/sliceDice.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/index.js","webpack://jupyter-vega/./node_modules/vega-label/build/vega-label.module.js","webpack://jupyter-vega/./node_modules/vega-regression/build/vega-regression.module.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/util.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/orient2d.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/orient3d.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/incircle.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/insphere.js","webpack://jupyter-vega/./node_modules/delaunator/index.js","webpack://jupyter-vega/./node_modules/d3-delaunay/src/path.js","webpack://jupyter-vega/./node_modules/d3-delaunay/src/polygon.js","webpack://jupyter-vega/./node_modules/d3-delaunay/src/voronoi.js","webpack://jupyter-vega/./node_modules/d3-delaunay/src/delaunay.js","webpack://jupyter-vega/./node_modules/vega-voronoi/build/vega-voronoi.module.js","webpack://jupyter-vega/./node_modules/vega-wordcloud/build/vega-wordcloud.module.js","webpack://jupyter-vega/./node_modules/vega-crossfilter/build/vega-crossfilter.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/permute.js","webpack://jupyter-vega/./node_modules/vega-expression/build/vega-expression.module.js","webpack://jupyter-vega/./node_modules/d3-geo/src/area.js","webpack://jupyter-vega/./node_modules/d3-geo/src/bounds.js","webpack://jupyter-vega/./node_modules/d3-geo/src/centroid.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/ascending.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/descending.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/bisector.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/intersection.js","webpack://jupyter-vega/./node_modules/vega-selections/build/vega-selection.module.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/union.js","webpack://jupyter-vega/./node_modules/vega-functions/build/vega-functions.module.js","webpack://jupyter-vega/./node_modules/vega-runtime/build/vega-runtime.module.js","webpack://jupyter-vega/./node_modules/vega-view/build/vega-view.module.js","webpack://jupyter-vega/./node_modules/d3-timer/src/interval.js","webpack://jupyter-vega/./node_modules/vega-event-selector/build/vega-event-selector.module.js","webpack://jupyter-vega/./node_modules/vega-parser/build/vega-parser.module.js","webpack://jupyter-vega/./node_modules/vega/build/vega.module.js","webpack://jupyter-vega/./node_modules/vega-interpreter/build/vega-interpreter.module.js","webpack://jupyter-vega/./node_modules/vega-lite/node_modules/vega-util/build/vega-util.module.js","webpack://jupyter-vega/./node_modules/array-flat-polyfill/index.mjs","webpack://jupyter-vega/./node_modules/vega-lite/build/src/logical.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/util.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/axis.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/aggregate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/channel.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/bin.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/log/message.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/log/index.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/datetime.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/timeunit.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/vega.schema.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/predicate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/type.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/scale.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/expr.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/mark.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/valueref.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/format.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/sort.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/facet.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/channeldef.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/title.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/common.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/unit.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/base.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/encoding.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/common.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/boxplot.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/errorbar.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/errorband.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/index.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/guide.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/header.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/legend.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/parameter.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/selection.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/concat.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/base.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/config.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/layer.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/map.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/repeat.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/stack.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/pathoverlay.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/rangestep.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/repeater.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/ruleforrangedline.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/core.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/index.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/toplevel.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/split.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/index.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/data.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/transform.js","webpack://jupyter-vega/./node_modules/vega-lite/node_modules/vega-event-selector/build/vega-event-selector.module.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/conditional.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/text.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/tooltip.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/nonposition.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/color.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/offset.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/position-point.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/position-align.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/position-range.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/position-rect.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/base.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/zindex.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/aria.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/defined.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/nearest.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/dataflow.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/timeunit.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/project.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/inputs.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/toggle.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/clear.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/scales.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/legends.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/translate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/zoom.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/transforms.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/interval.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/multi.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/single.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/index.js","webpack://jupyter-vega/./node_modules/vega-lite/node_modules/vega-expression/node_modules/vega-util/build/vega-util.module.js","webpack://jupyter-vega/./node_modules/vega-lite/node_modules/vega-expression/build/vega-expression.module.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/expressions.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/filter.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/predicate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/config.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/properties.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/calculate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/header/common.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/header/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/header/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layoutsize/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layoutsize/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/guide.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/resolve.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/encode.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/properties.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/projection/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/projection.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/projection/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/projection/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/bin.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/aggregate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/facet.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/formatparse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/identifier.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/graticule.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/sequence.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/source.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/optimizer.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/optimizers.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/joinaggregate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/stack.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/window.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/subtree.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/optimize.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/signal.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/domain.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/range.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/properties.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/type.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/model.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/density.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/filterinvalid.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/flatten.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/fold.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/geojson.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/geopoint.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/impute.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/loess.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/lookup.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/quantile.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/regression.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/pivot.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/sample.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/header/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layoutsize/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/facet.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/joinaggregatefacet.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/concat.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/encode.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/point.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/tick.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/mark.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/arc.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/area.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/bar.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/geoshape.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/image.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/line.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/rect.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/rule.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/text.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/unit.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/init.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layoutsize/init.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layer.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/buildmodel.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/compile.js","webpack://jupyter-vega/./node_modules/vega-schema-url-parser/dist/parser.module.js","webpack://jupyter-vega/./node_modules/vega-themes/build/vega-themes.module.js","webpack://jupyter-vega/./node_modules/vega-tooltip/build/vega-tooltip.module.js","webpack://jupyter-vega/./node_modules/vega-embed/build/vega-embed.module.js","webpack://jupyter-vega/external amd \"@jupyter-widgets/base\"","webpack://jupyter-vega/./node_modules/json-stringify-pretty-compact/index.js","webpack://jupyter-vega/webpack/bootstrap","webpack://jupyter-vega/webpack/runtime/compat get default export","webpack://jupyter-vega/webpack/runtime/define property getters","webpack://jupyter-vega/webpack/runtime/global","webpack://jupyter-vega/webpack/runtime/hasOwnProperty shorthand","webpack://jupyter-vega/webpack/runtime/make namespace object","webpack://jupyter-vega/webpack/startup"],"sourcesContent":["var clone = (function() {\n'use strict';\n\nfunction _instanceof(obj, type) {\n return type != null && obj instanceof type;\n}\n\nvar nativeMap;\ntry {\n nativeMap = Map;\n} catch(_) {\n // maybe a reference error because no `Map`. Give it a dummy value that no\n // value will ever be an instanceof.\n nativeMap = function() {};\n}\n\nvar nativeSet;\ntry {\n nativeSet = Set;\n} catch(_) {\n nativeSet = function() {};\n}\n\nvar nativePromise;\ntry {\n nativePromise = Promise;\n} catch(_) {\n nativePromise = function() {};\n}\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n * @param `includeNonEnumerable` - set to true if the non-enumerable properties\n * should be cloned as well. Non-enumerable properties on the prototype\n * chain will be ignored. (optional - false by default)\n*/\nfunction clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n}\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n}\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n}\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n}\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n}\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif (typeof module === 'object' && module.exports) {\n module.exports = clone;\n}\n","\"use strict\"\n\nvar createThunk = require(\"./lib/thunk.js\")\n\nfunction Procedure() {\n this.argTypes = []\n this.shimArgs = []\n this.arrayArgs = []\n this.arrayBlockIndices = []\n this.scalarArgs = []\n this.offsetArgs = []\n this.offsetArgIndex = []\n this.indexArgs = []\n this.shapeArgs = []\n this.funcName = \"\"\n this.pre = null\n this.body = null\n this.post = null\n this.debug = false\n}\n\nfunction compileCwise(user_args) {\n //Create procedure\n var proc = new Procedure()\n \n //Parse blocks\n proc.pre = user_args.pre\n proc.body = user_args.body\n proc.post = user_args.post\n\n //Parse arguments\n var proc_args = user_args.args.slice(0)\n proc.argTypes = proc_args\n for(var i=0; i0) {\n throw new Error(\"cwise: pre() block may not reference array args\")\n }\n if(i < proc.post.args.length && proc.post.args[i].count>0) {\n throw new Error(\"cwise: post() block may not reference array args\")\n }\n } else if(arg_type === \"scalar\") {\n proc.scalarArgs.push(i)\n proc.shimArgs.push(\"scalar\" + i)\n } else if(arg_type === \"index\") {\n proc.indexArgs.push(i)\n if(i < proc.pre.args.length && proc.pre.args[i].count > 0) {\n throw new Error(\"cwise: pre() block may not reference array index\")\n }\n if(i < proc.body.args.length && proc.body.args[i].lvalue) {\n throw new Error(\"cwise: body() block may not write to array index\")\n }\n if(i < proc.post.args.length && proc.post.args[i].count > 0) {\n throw new Error(\"cwise: post() block may not reference array index\")\n }\n } else if(arg_type === \"shape\") {\n proc.shapeArgs.push(i)\n if(i < proc.pre.args.length && proc.pre.args[i].lvalue) {\n throw new Error(\"cwise: pre() block may not write to array shape\")\n }\n if(i < proc.body.args.length && proc.body.args[i].lvalue) {\n throw new Error(\"cwise: body() block may not write to array shape\")\n }\n if(i < proc.post.args.length && proc.post.args[i].lvalue) {\n throw new Error(\"cwise: post() block may not write to array shape\")\n }\n } else if(typeof arg_type === \"object\" && arg_type.offset) {\n proc.argTypes[i] = \"offset\"\n proc.offsetArgs.push({ array: arg_type.array, offset:arg_type.offset })\n proc.offsetArgIndex.push(i)\n } else {\n throw new Error(\"cwise: Unknown argument type \" + proc_args[i])\n }\n }\n \n //Make sure at least one array argument was specified\n if(proc.arrayArgs.length <= 0) {\n throw new Error(\"cwise: No array arguments specified\")\n }\n \n //Make sure arguments are correct\n if(proc.pre.args.length > proc_args.length) {\n throw new Error(\"cwise: Too many arguments in pre() block\")\n }\n if(proc.body.args.length > proc_args.length) {\n throw new Error(\"cwise: Too many arguments in body() block\")\n }\n if(proc.post.args.length > proc_args.length) {\n throw new Error(\"cwise: Too many arguments in post() block\")\n }\n\n //Check debug flag\n proc.debug = !!user_args.printCode || !!user_args.debug\n \n //Retrieve name\n proc.funcName = user_args.funcName || \"cwise\"\n \n //Read in block size\n proc.blockSize = user_args.blockSize || 64\n\n return createThunk(proc)\n}\n\nmodule.exports = compileCwise\n","\"use strict\"\n\nvar uniq = require(\"uniq\")\n\n// This function generates very simple loops analogous to how you typically traverse arrays (the outermost loop corresponds to the slowest changing index, the innermost loop to the fastest changing index)\n// TODO: If two arrays have the same strides (and offsets) there is potential for decreasing the number of \"pointers\" and related variables. The drawback is that the type signature would become more specific and that there would thus be less potential for caching, but it might still be worth it, especially when dealing with large numbers of arguments.\nfunction innerFill(order, proc, body) {\n var dimension = order.length\n , nargs = proc.arrayArgs.length\n , has_index = proc.indexArgs.length>0\n , code = []\n , vars = []\n , idx=0, pidx=0, i, j\n for(i=0; i 0) {\n code.push(\"var \" + vars.join(\",\"))\n } \n //Scan loop\n for(i=dimension-1; i>=0; --i) { // Start at largest stride and work your way inwards\n idx = order[i]\n code.push([\"for(i\",i,\"=0;i\",i,\" 0) {\n code.push([\"index[\",pidx,\"]-=s\",pidx].join(\"\"))\n }\n code.push([\"++index[\",idx,\"]\"].join(\"\"))\n }\n code.push(\"}\")\n }\n return code.join(\"\\n\")\n}\n\n// Generate \"outer\" loops that loop over blocks of data, applying \"inner\" loops to the blocks by manipulating the local variables in such a way that the inner loop only \"sees\" the current block.\n// TODO: If this is used, then the previous declaration (done by generateCwiseOp) of s* is essentially unnecessary.\n// I believe the s* are not used elsewhere (in particular, I don't think they're used in the pre/post parts and \"shape\" is defined independently), so it would be possible to make defining the s* dependent on what loop method is being used.\nfunction outerFill(matched, order, proc, body) {\n var dimension = order.length\n , nargs = proc.arrayArgs.length\n , blockSize = proc.blockSize\n , has_index = proc.indexArgs.length > 0\n , code = []\n for(var i=0; i0;){\"].join(\"\")) // Iterate back to front\n code.push([\"if(j\",i,\"<\",blockSize,\"){\"].join(\"\")) // Either decrease j by blockSize (s = blockSize), or set it to zero (after setting s = j).\n code.push([\"s\",order[i],\"=j\",i].join(\"\"))\n code.push([\"j\",i,\"=0\"].join(\"\"))\n code.push([\"}else{s\",order[i],\"=\",blockSize].join(\"\"))\n code.push([\"j\",i,\"-=\",blockSize,\"}\"].join(\"\"))\n if(has_index) {\n code.push([\"index[\",order[i],\"]=j\",i].join(\"\"))\n }\n }\n for(var i=0; i 0) {\n allEqual = allEqual && summary[i] === summary[i-1]\n }\n }\n if(allEqual) {\n return summary[0]\n }\n return summary.join(\"\")\n}\n\n//Generates a cwise operator\nfunction generateCWiseOp(proc, typesig) {\n\n //Compute dimension\n // Arrays get put first in typesig, and there are two entries per array (dtype and order), so this gets the number of dimensions in the first array arg.\n var dimension = (typesig[1].length - Math.abs(proc.arrayBlockIndices[0]))|0\n var orders = new Array(proc.arrayArgs.length)\n var dtypes = new Array(proc.arrayArgs.length)\n for(var i=0; i 0) {\n vars.push(\"shape=SS.slice(0)\") // Makes the shape over which we iterate available to the user defined functions (so you can use width/height for example)\n }\n if(proc.indexArgs.length > 0) {\n // Prepare an array to keep track of the (logical) indices, initialized to dimension zeroes.\n var zeros = new Array(dimension)\n for(var i=0; i 0) {\n code.push(\"var \" + vars.join(\",\"))\n }\n for(var i=0; i 3) {\n code.push(processBlock(proc.pre, proc, dtypes))\n }\n\n //Process body\n var body = processBlock(proc.body, proc, dtypes)\n var matched = countMatches(loopOrders)\n if(matched < dimension) {\n code.push(outerFill(matched, loopOrders[0], proc, body)) // TODO: Rather than passing loopOrders[0], it might be interesting to look at passing an order that represents the majority of the arguments for example.\n } else {\n code.push(innerFill(loopOrders[0], proc, body))\n }\n\n //Inline epilog\n if(proc.post.body.length > 3) {\n code.push(processBlock(proc.post, proc, dtypes))\n }\n \n if(proc.debug) {\n console.log(\"-----Generated cwise routine for \", typesig, \":\\n\" + code.join(\"\\n\") + \"\\n----------\")\n }\n \n var loopName = [(proc.funcName||\"unnamed\"), \"_cwise_loop_\", orders[0].join(\"s\"),\"m\",matched,typeSummary(dtypes)].join(\"\")\n var f = new Function([\"function \",loopName,\"(\", arglist.join(\",\"),\"){\", code.join(\"\\n\"),\"} return \", loopName].join(\"\"))\n return f()\n}\nmodule.exports = generateCWiseOp\n","\"use strict\"\n\n// The function below is called when constructing a cwise function object, and does the following:\n// A function object is constructed which accepts as argument a compilation function and returns another function.\n// It is this other function that is eventually returned by createThunk, and this function is the one that actually\n// checks whether a certain pattern of arguments has already been used before and compiles new loops as needed.\n// The compilation passed to the first function object is used for compiling new functions.\n// Once this function object is created, it is called with compile as argument, where the first argument of compile\n// is bound to \"proc\" (essentially containing a preprocessed version of the user arguments to cwise).\n// So createThunk roughly works like this:\n// function createThunk(proc) {\n// var thunk = function(compileBound) {\n// var CACHED = {}\n// return function(arrays and scalars) {\n// if (dtype and order of arrays in CACHED) {\n// var func = CACHED[dtype and order of arrays]\n// } else {\n// var func = CACHED[dtype and order of arrays] = compileBound(dtype and order of arrays)\n// }\n// return func(arrays and scalars)\n// }\n// }\n// return thunk(compile.bind1(proc))\n// }\n\nvar compile = require(\"./compile.js\")\n\nfunction createThunk(proc) {\n var code = [\"'use strict'\", \"var CACHED={}\"]\n var vars = []\n var thunkName = proc.funcName + \"_cwise_thunk\"\n \n //Build thunk\n code.push([\"return function \", thunkName, \"(\", proc.shimArgs.join(\",\"), \"){\"].join(\"\"))\n var typesig = []\n var string_typesig = []\n var proc_args = [[\"array\",proc.arrayArgs[0],\".shape.slice(\", // Slice shape so that we only retain the shape over which we iterate (which gets passed to the cwise operator as SS).\n Math.max(0,proc.arrayBlockIndices[0]),proc.arrayBlockIndices[0]<0?(\",\"+proc.arrayBlockIndices[0]+\")\"):\")\"].join(\"\")]\n var shapeLengthConditions = [], shapeConditions = []\n // Process array arguments\n for(var i=0; i0) { // Gather conditions to check for shape equality (ignoring block indices)\n shapeLengthConditions.push(\"array\" + proc.arrayArgs[0] + \".shape.length===array\" + j + \".shape.length+\" + (Math.abs(proc.arrayBlockIndices[0])-Math.abs(proc.arrayBlockIndices[i])))\n shapeConditions.push(\"array\" + proc.arrayArgs[0] + \".shape[shapeIndex+\" + Math.max(0,proc.arrayBlockIndices[0]) + \"]===array\" + j + \".shape[shapeIndex+\" + Math.max(0,proc.arrayBlockIndices[i]) + \"]\")\n }\n }\n // Check for shape equality\n if (proc.arrayArgs.length > 1) {\n code.push(\"if (!(\" + shapeLengthConditions.join(\" && \") + \")) throw new Error('cwise: Arrays do not all have the same dimensionality!')\")\n code.push(\"for(var shapeIndex=array\" + proc.arrayArgs[0] + \".shape.length-\" + Math.abs(proc.arrayBlockIndices[0]) + \"; shapeIndex-->0;) {\")\n code.push(\"if (!(\" + shapeConditions.join(\" && \") + \")) throw new Error('cwise: Arrays do not all have the same shape!')\")\n code.push(\"}\")\n }\n // Process scalar arguments\n for(var i=0; i= 0) {\n var carg = compiledArgs[argNo]\n var usage = getUsage(node)\n if(usage & LVALUE) {\n carg.lvalue = true\n }\n if(usage & RVALUE) {\n carg.rvalue = true\n }\n ++carg.count\n rewrite(node, carg.name)\n } else if(isGlobal(name)) {\n //Don't rewrite globals\n } else {\n rewrite(node, createLocal(name))\n }\n } else if(node.type === \"Literal\") {\n if(typeof node.value === \"string\") {\n rewrite(node, escapeString(node.value))\n }\n } else if(node.type === \"WithStatement\") {\n throw new Error(\"cwise-parser: with() statements not allowed\")\n } else {\n //Visit all children\n var keys = Object.keys(node)\n for(var i=0, n=keys.length; i 0) {\n return dupe_number(count|0, value)\n }\n break\n case \"object\":\n if(typeof (count.length) === \"number\") {\n return dupe_array(count, value, 0)\n }\n break\n }\n return []\n}\n\nmodule.exports = dupe","/*\n Copyright (C) 2013 Ariya Hidayat \n Copyright (C) 2013 Thaddee Tyl \n Copyright (C) 2013 Mathias Bynens \n Copyright (C) 2012 Ariya Hidayat \n Copyright (C) 2012 Mathias Bynens \n Copyright (C) 2012 Joost-Wim Boekesteijn \n Copyright (C) 2012 Kris Kowal \n Copyright (C) 2012 Yusuke Suzuki \n Copyright (C) 2012 Arpad Borsos \n Copyright (C) 2011 Ariya Hidayat \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n/*jslint bitwise:true plusplus:true */\n/*global esprima:true, define:true, exports:true, window: true,\nthrowErrorTolerant: true,\nthrowError: true, generateStatement: true, peek: true,\nparseAssignmentExpression: true, parseBlock: true, parseExpression: true,\nparseFunctionDeclaration: true, parseFunctionExpression: true,\nparseFunctionSourceElements: true, parseVariableIdentifier: true,\nparseLeftHandSideExpression: true,\nparseUnaryExpression: true,\nparseStatement: true, parseSourceElement: true */\n\n(function (root, factory) {\n 'use strict';\n\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js,\n // Rhino, and plain browser loading.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define(['exports'], factory);\n } else if (typeof exports !== 'undefined') {\n factory(exports);\n } else {\n factory((root.esprima = {}));\n }\n}(this, function (exports) {\n 'use strict';\n\n var Token,\n TokenName,\n FnExprTokens,\n Syntax,\n PropertyKind,\n Messages,\n Regex,\n SyntaxTreeDelegate,\n source,\n strict,\n index,\n lineNumber,\n lineStart,\n length,\n delegate,\n lookahead,\n state,\n extra;\n\n Token = {\n BooleanLiteral: 1,\n EOF: 2,\n Identifier: 3,\n Keyword: 4,\n NullLiteral: 5,\n NumericLiteral: 6,\n Punctuator: 7,\n StringLiteral: 8,\n RegularExpression: 9\n };\n\n TokenName = {};\n TokenName[Token.BooleanLiteral] = 'Boolean';\n TokenName[Token.EOF] = '';\n TokenName[Token.Identifier] = 'Identifier';\n TokenName[Token.Keyword] = 'Keyword';\n TokenName[Token.NullLiteral] = 'Null';\n TokenName[Token.NumericLiteral] = 'Numeric';\n TokenName[Token.Punctuator] = 'Punctuator';\n TokenName[Token.StringLiteral] = 'String';\n TokenName[Token.RegularExpression] = 'RegularExpression';\n\n // A function following one of those tokens is an expression.\n FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new',\n 'return', 'case', 'delete', 'throw', 'void',\n // assignment operators\n '=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=',\n '&=', '|=', '^=', ',',\n // binary/unary operators\n '+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&',\n '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=',\n '<=', '<', '>', '!=', '!=='];\n\n Syntax = {\n AssignmentExpression: 'AssignmentExpression',\n ArrayExpression: 'ArrayExpression',\n BlockStatement: 'BlockStatement',\n BinaryExpression: 'BinaryExpression',\n BreakStatement: 'BreakStatement',\n CallExpression: 'CallExpression',\n CatchClause: 'CatchClause',\n ConditionalExpression: 'ConditionalExpression',\n ContinueStatement: 'ContinueStatement',\n DoWhileStatement: 'DoWhileStatement',\n DebuggerStatement: 'DebuggerStatement',\n EmptyStatement: 'EmptyStatement',\n ExpressionStatement: 'ExpressionStatement',\n ForStatement: 'ForStatement',\n ForInStatement: 'ForInStatement',\n FunctionDeclaration: 'FunctionDeclaration',\n FunctionExpression: 'FunctionExpression',\n Identifier: 'Identifier',\n IfStatement: 'IfStatement',\n Literal: 'Literal',\n LabeledStatement: 'LabeledStatement',\n LogicalExpression: 'LogicalExpression',\n MemberExpression: 'MemberExpression',\n NewExpression: 'NewExpression',\n ObjectExpression: 'ObjectExpression',\n Program: 'Program',\n Property: 'Property',\n ReturnStatement: 'ReturnStatement',\n SequenceExpression: 'SequenceExpression',\n SwitchStatement: 'SwitchStatement',\n SwitchCase: 'SwitchCase',\n ThisExpression: 'ThisExpression',\n ThrowStatement: 'ThrowStatement',\n TryStatement: 'TryStatement',\n UnaryExpression: 'UnaryExpression',\n UpdateExpression: 'UpdateExpression',\n VariableDeclaration: 'VariableDeclaration',\n VariableDeclarator: 'VariableDeclarator',\n WhileStatement: 'WhileStatement',\n WithStatement: 'WithStatement'\n };\n\n PropertyKind = {\n Data: 1,\n Get: 2,\n Set: 4\n };\n\n // Error messages should be identical to V8.\n Messages = {\n UnexpectedToken: 'Unexpected token %0',\n UnexpectedNumber: 'Unexpected number',\n UnexpectedString: 'Unexpected string',\n UnexpectedIdentifier: 'Unexpected identifier',\n UnexpectedReserved: 'Unexpected reserved word',\n UnexpectedEOS: 'Unexpected end of input',\n NewlineAfterThrow: 'Illegal newline after throw',\n InvalidRegExp: 'Invalid regular expression',\n UnterminatedRegExp: 'Invalid regular expression: missing /',\n InvalidLHSInAssignment: 'Invalid left-hand side in assignment',\n InvalidLHSInForIn: 'Invalid left-hand side in for-in',\n MultipleDefaultsInSwitch: 'More than one default clause in switch statement',\n NoCatchOrFinally: 'Missing catch or finally after try',\n UnknownLabel: 'Undefined label \\'%0\\'',\n Redeclaration: '%0 \\'%1\\' has already been declared',\n IllegalContinue: 'Illegal continue statement',\n IllegalBreak: 'Illegal break statement',\n IllegalReturn: 'Illegal return statement',\n StrictModeWith: 'Strict mode code may not include a with statement',\n StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',\n StrictVarName: 'Variable name may not be eval or arguments in strict mode',\n StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',\n StrictParamDupe: 'Strict mode function may not have duplicate parameter names',\n StrictFunctionName: 'Function name may not be eval or arguments in strict mode',\n StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',\n StrictDelete: 'Delete of an unqualified identifier in strict mode.',\n StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode',\n AccessorDataProperty: 'Object literal may not have data and accessor property with the same name',\n AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name',\n StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',\n StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',\n StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',\n StrictReservedWord: 'Use of future reserved word in strict mode'\n };\n\n // See also tools/generate-unicode-regex.py.\n Regex = {\n NonAsciiIdentifierStart: new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]'),\n NonAsciiIdentifierPart: new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0\\u08A2-\\u08AC\\u08E4-\\u08FE\\u0900-\\u0963\\u0966-\\u096F\\u0971-\\u0977\\u0979-\\u097F\\u0981-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0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u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D02\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1D00-\\u1DE6\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA697\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A\\uAA7B\\uAA80-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE26\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]')\n };\n\n // Ensure the condition is true, otherwise throw an error.\n // This is only to have a better contract semantic, i.e. another safety net\n // to catch a logic error. The condition shall be fulfilled in normal case.\n // Do NOT use this to enforce a certain condition on any user input.\n\n function assert(condition, message) {\n /* istanbul ignore if */\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }\n\n function isDecimalDigit(ch) {\n return (ch >= 48 && ch <= 57); // 0..9\n }\n\n function isHexDigit(ch) {\n return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;\n }\n\n function isOctalDigit(ch) {\n return '01234567'.indexOf(ch) >= 0;\n }\n\n\n // 7.2 White Space\n\n function isWhiteSpace(ch) {\n return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||\n (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);\n }\n\n // 7.3 Line Terminators\n\n function isLineTerminator(ch) {\n return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029);\n }\n\n // 7.6 Identifier Names and Identifiers\n\n function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }\n\n function isIdentifierPart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch >= 0x30 && ch <= 0x39) || // 0..9\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch)));\n }\n\n // 7.6.1.2 Future Reserved Words\n\n function isFutureReservedWord(id) {\n switch (id) {\n case 'class':\n case 'enum':\n case 'export':\n case 'extends':\n case 'import':\n case 'super':\n return true;\n default:\n return false;\n }\n }\n\n function isStrictModeReservedWord(id) {\n switch (id) {\n case 'implements':\n case 'interface':\n case 'package':\n case 'private':\n case 'protected':\n case 'public':\n case 'static':\n case 'yield':\n case 'let':\n return true;\n default:\n return false;\n }\n }\n\n function isRestrictedWord(id) {\n return id === 'eval' || id === 'arguments';\n }\n\n // 7.6.1.1 Keywords\n\n function isKeyword(id) {\n if (strict && isStrictModeReservedWord(id)) {\n return true;\n }\n\n // 'const' is specialized as Keyword in V8.\n // 'yield' and 'let' are for compatiblity with SpiderMonkey and ES.next.\n // Some others are from future reserved words.\n\n switch (id.length) {\n case 2:\n return (id === 'if') || (id === 'in') || (id === 'do');\n case 3:\n return (id === 'var') || (id === 'for') || (id === 'new') ||\n (id === 'try') || (id === 'let');\n case 4:\n return (id === 'this') || (id === 'else') || (id === 'case') ||\n (id === 'void') || (id === 'with') || (id === 'enum');\n case 5:\n return (id === 'while') || (id === 'break') || (id === 'catch') ||\n (id === 'throw') || (id === 'const') || (id === 'yield') ||\n (id === 'class') || (id === 'super');\n case 6:\n return (id === 'return') || (id === 'typeof') || (id === 'delete') ||\n (id === 'switch') || (id === 'export') || (id === 'import');\n case 7:\n return (id === 'default') || (id === 'finally') || (id === 'extends');\n case 8:\n return (id === 'function') || (id === 'continue') || (id === 'debugger');\n case 10:\n return (id === 'instanceof');\n default:\n return false;\n }\n }\n\n // 7.4 Comments\n\n function addComment(type, value, start, end, loc) {\n var comment, attacher;\n\n assert(typeof start === 'number', 'Comment must have valid position');\n\n // Because the way the actual token is scanned, often the comments\n // (if any) are skipped twice during the lexical analysis.\n // Thus, we need to skip adding a comment if the comment array already\n // handled it.\n if (state.lastCommentStart >= start) {\n return;\n }\n state.lastCommentStart = start;\n\n comment = {\n type: type,\n value: value\n };\n if (extra.range) {\n comment.range = [start, end];\n }\n if (extra.loc) {\n comment.loc = loc;\n }\n extra.comments.push(comment);\n if (extra.attachComment) {\n extra.leadingComments.push(comment);\n extra.trailingComments.push(comment);\n }\n }\n\n function skipSingleLineComment(offset) {\n var start, loc, ch, comment;\n\n start = index - offset;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart - offset\n }\n };\n\n while (index < length) {\n ch = source.charCodeAt(index);\n ++index;\n if (isLineTerminator(ch)) {\n if (extra.comments) {\n comment = source.slice(start + offset, index - 1);\n loc.end = {\n line: lineNumber,\n column: index - lineStart - 1\n };\n addComment('Line', comment, start, index - 1, loc);\n }\n if (ch === 13 && source.charCodeAt(index) === 10) {\n ++index;\n }\n ++lineNumber;\n lineStart = index;\n return;\n }\n }\n\n if (extra.comments) {\n comment = source.slice(start + offset, index);\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n addComment('Line', comment, start, index, loc);\n }\n }\n\n function skipMultiLineComment() {\n var start, loc, ch, comment;\n\n if (extra.comments) {\n start = index - 2;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart - 2\n }\n };\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n if (isLineTerminator(ch)) {\n if (ch === 0x0D && source.charCodeAt(index + 1) === 0x0A) {\n ++index;\n }\n ++lineNumber;\n ++index;\n lineStart = index;\n if (index >= length) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n } else if (ch === 0x2A) {\n // Block comment ends with '*/'.\n if (source.charCodeAt(index + 1) === 0x2F) {\n ++index;\n ++index;\n if (extra.comments) {\n comment = source.slice(start + 2, index - 2);\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n addComment('Block', comment, start, index, loc);\n }\n return;\n }\n ++index;\n } else {\n ++index;\n }\n }\n\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n function skipComment() {\n var ch, start;\n\n start = (index === 0);\n while (index < length) {\n ch = source.charCodeAt(index);\n\n if (isWhiteSpace(ch)) {\n ++index;\n } else if (isLineTerminator(ch)) {\n ++index;\n if (ch === 0x0D && source.charCodeAt(index) === 0x0A) {\n ++index;\n }\n ++lineNumber;\n lineStart = index;\n start = true;\n } else if (ch === 0x2F) { // U+002F is '/'\n ch = source.charCodeAt(index + 1);\n if (ch === 0x2F) {\n ++index;\n ++index;\n skipSingleLineComment(2);\n start = true;\n } else if (ch === 0x2A) { // U+002A is '*'\n ++index;\n ++index;\n skipMultiLineComment();\n } else {\n break;\n }\n } else if (start && ch === 0x2D) { // U+002D is '-'\n // U+003E is '>'\n if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) {\n // '-->' is a single-line comment\n index += 3;\n skipSingleLineComment(3);\n } else {\n break;\n }\n } else if (ch === 0x3C) { // U+003C is '<'\n if (source.slice(index + 1, index + 4) === '!--') {\n ++index; // `<`\n ++index; // `!`\n ++index; // `-`\n ++index; // `-`\n skipSingleLineComment(4);\n } else {\n break;\n }\n } else {\n break;\n }\n }\n }\n\n function scanHexEscape(prefix) {\n var i, len, ch, code = 0;\n\n len = (prefix === 'u') ? 4 : 2;\n for (i = 0; i < len; ++i) {\n if (index < length && isHexDigit(source[index])) {\n ch = source[index++];\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n } else {\n return '';\n }\n }\n return String.fromCharCode(code);\n }\n\n function getEscapedIdentifier() {\n var ch, id;\n\n ch = source.charCodeAt(index++);\n id = String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierStart(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n id = ch;\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n if (!isIdentifierPart(ch)) {\n break;\n }\n ++index;\n id += String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n id = id.substr(0, id.length - 1);\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierPart(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n id += ch;\n }\n }\n\n return id;\n }\n\n function getIdentifier() {\n var start, ch;\n\n start = index++;\n while (index < length) {\n ch = source.charCodeAt(index);\n if (ch === 0x5C) {\n // Blackslash (U+005C) marks Unicode escape sequence.\n index = start;\n return getEscapedIdentifier();\n }\n if (isIdentifierPart(ch)) {\n ++index;\n } else {\n break;\n }\n }\n\n return source.slice(start, index);\n }\n\n function scanIdentifier() {\n var start, id, type;\n\n start = index;\n\n // Backslash (U+005C) starts an escaped character.\n id = (source.charCodeAt(index) === 0x5C) ? getEscapedIdentifier() : getIdentifier();\n\n // There is no keyword or literal with only one character.\n // Thus, it must be an identifier.\n if (id.length === 1) {\n type = Token.Identifier;\n } else if (isKeyword(id)) {\n type = Token.Keyword;\n } else if (id === 'null') {\n type = Token.NullLiteral;\n } else if (id === 'true' || id === 'false') {\n type = Token.BooleanLiteral;\n } else {\n type = Token.Identifier;\n }\n\n return {\n type: type,\n value: id,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n\n // 7.7 Punctuators\n\n function scanPunctuator() {\n var start = index,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2,\n ch3,\n ch4;\n\n switch (code) {\n\n // Check for most common single-character punctuators.\n case 0x2E: // . dot\n case 0x28: // ( open bracket\n case 0x29: // ) close bracket\n case 0x3B: // ; semicolon\n case 0x2C: // , comma\n case 0x7B: // { open curly brace\n case 0x7D: // } close curly brace\n case 0x5B: // [\n case 0x5D: // ]\n case 0x3A: // :\n case 0x3F: // ?\n case 0x7E: // ~\n ++index;\n if (extra.tokenize) {\n if (code === 0x28) {\n extra.openParenToken = extra.tokens.length;\n } else if (code === 0x7B) {\n extra.openCurlyToken = extra.tokens.length;\n }\n }\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n\n default:\n code2 = source.charCodeAt(index + 1);\n\n // '=' (U+003D) marks an assignment or comparison operator.\n if (code2 === 0x3D) {\n switch (code) {\n case 0x2B: // +\n case 0x2D: // -\n case 0x2F: // /\n case 0x3C: // <\n case 0x3E: // >\n case 0x5E: // ^\n case 0x7C: // |\n case 0x25: // %\n case 0x26: // &\n case 0x2A: // *\n index += 2;\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code) + String.fromCharCode(code2),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n\n case 0x21: // !\n case 0x3D: // =\n index += 2;\n\n // !== and ===\n if (source.charCodeAt(index) === 0x3D) {\n ++index;\n }\n return {\n type: Token.Punctuator,\n value: source.slice(start, index),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n }\n }\n\n // 4-character punctuator: >>>=\n\n ch4 = source.substr(index, 4);\n\n if (ch4 === '>>>=') {\n index += 4;\n return {\n type: Token.Punctuator,\n value: ch4,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 3-character punctuators: === !== >>> <<= >>=\n\n ch3 = ch4.substr(0, 3);\n\n if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {\n index += 3;\n return {\n type: Token.Punctuator,\n value: ch3,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // Other 2-character punctuators: ++ -- << >> && ||\n ch2 = ch3.substr(0, 2);\n\n if ((ch1 === ch2[1] && ('+-<>&|'.indexOf(ch1) >= 0)) || ch2 === '=>') {\n index += 2;\n return {\n type: Token.Punctuator,\n value: ch2,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 1-character punctuators: < > = ! + - * % & | ^ /\n if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n ++index;\n return {\n type: Token.Punctuator,\n value: ch1,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n // 7.8.3 Numeric Literals\n\n function scanHexLiteral(start) {\n var number = '';\n\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (number.length === 0) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt('0x' + number, 16),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function scanOctalLiteral(start) {\n var number = '0' + source[index++];\n while (index < length) {\n if (!isOctalDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt(number, 8),\n octal: true,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function isImplicitOctalLiteral() {\n var i, ch;\n\n // Implicit octal, unless there is a non-octal digit.\n // (Annex B.1.1 on Numeric Literals)\n for (i = index + 1; i < length; ++i) {\n ch = source[i];\n if (ch === '8' || ch === '9') {\n return false;\n }\n if (!isOctalDigit(ch)) {\n return true;\n }\n }\n\n return true;\n }\n\n function scanNumericLiteral() {\n var number, start, ch;\n\n ch = source[index];\n assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),\n 'Numeric literal must start with a decimal digit or a decimal point');\n\n start = index;\n number = '';\n if (ch !== '.') {\n number = source[index++];\n ch = source[index];\n\n // Hex number starts with '0x'.\n // Octal number starts with '0'.\n if (number === '0') {\n if (ch === 'x' || ch === 'X') {\n ++index;\n return scanHexLiteral(start);\n }\n if (isOctalDigit(ch)) {\n if (isImplicitOctalLiteral()) {\n return scanOctalLiteral(start);\n }\n }\n }\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === '.') {\n number += source[index++];\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === 'e' || ch === 'E') {\n number += source[index++];\n\n ch = source[index];\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n if (isDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseFloat(number),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 7.8.4 String Literals\n\n function scanStringLiteral() {\n var str = '', quote, start, ch, code, unescaped, restore, octal = false, startLineNumber, startLineStart;\n startLineNumber = lineNumber;\n startLineStart = lineStart;\n\n quote = source[index];\n assert((quote === '\\'' || quote === '\"'),\n 'String literal must starts with a quote');\n\n start = index;\n ++index;\n\n while (index < length) {\n ch = source[index++];\n\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'u':\n case 'x':\n restore = index;\n unescaped = scanHexEscape(ch);\n if (unescaped) {\n str += unescaped;\n } else {\n index = restore;\n str += ch;\n }\n break;\n case 'n':\n str += '\\n';\n break;\n case 'r':\n str += '\\r';\n break;\n case 't':\n str += '\\t';\n break;\n case 'b':\n str += '\\b';\n break;\n case 'f':\n str += '\\f';\n break;\n case 'v':\n str += '\\x0B';\n break;\n\n default:\n if (isOctalDigit(ch)) {\n code = '01234567'.indexOf(ch);\n\n // \\0 is not octal escape sequence\n if (code !== 0) {\n octal = true;\n }\n\n if (index < length && isOctalDigit(source[index])) {\n octal = true;\n code = code * 8 + '01234567'.indexOf(source[index++]);\n\n // 3 digits are only allowed when string starts\n // with 0, 1, 2, 3\n if ('0123'.indexOf(ch) >= 0 &&\n index < length &&\n isOctalDigit(source[index])) {\n code = code * 8 + '01234567'.indexOf(source[index++]);\n }\n }\n str += String.fromCharCode(code);\n } else {\n str += ch;\n }\n break;\n }\n } else {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n\n if (quote !== '') {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.StringLiteral,\n value: str,\n octal: octal,\n startLineNumber: startLineNumber,\n startLineStart: startLineStart,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function testRegExp(pattern, flags) {\n var value;\n try {\n value = new RegExp(pattern, flags);\n } catch (e) {\n throwError({}, Messages.InvalidRegExp);\n }\n return value;\n }\n\n function scanRegExpBody() {\n var ch, str, classMarker, terminated, body;\n\n ch = source[index];\n assert(ch === '/', 'Regular expression literal must start with a slash');\n str = source[index++];\n\n classMarker = false;\n terminated = false;\n while (index < length) {\n ch = source[index++];\n str += ch;\n if (ch === '\\\\') {\n ch = source[index++];\n // ECMA-262 7.8.5\n if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, Messages.UnterminatedRegExp);\n }\n str += ch;\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, Messages.UnterminatedRegExp);\n } else if (classMarker) {\n if (ch === ']') {\n classMarker = false;\n }\n } else {\n if (ch === '/') {\n terminated = true;\n break;\n } else if (ch === '[') {\n classMarker = true;\n }\n }\n }\n\n if (!terminated) {\n throwError({}, Messages.UnterminatedRegExp);\n }\n\n // Exclude leading and trailing slash.\n body = str.substr(1, str.length - 2);\n return {\n value: body,\n literal: str\n };\n }\n\n function scanRegExpFlags() {\n var ch, str, flags, restore;\n\n str = '';\n flags = '';\n while (index < length) {\n ch = source[index];\n if (!isIdentifierPart(ch.charCodeAt(0))) {\n break;\n }\n\n ++index;\n if (ch === '\\\\' && index < length) {\n ch = source[index];\n if (ch === 'u') {\n ++index;\n restore = index;\n ch = scanHexEscape('u');\n if (ch) {\n flags += ch;\n for (str += '\\\\u'; restore < index; ++restore) {\n str += source[restore];\n }\n } else {\n index = restore;\n flags += 'u';\n str += '\\\\u';\n }\n throwErrorTolerant({}, Messages.UnexpectedToken, 'ILLEGAL');\n } else {\n str += '\\\\';\n throwErrorTolerant({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n } else {\n flags += ch;\n str += ch;\n }\n }\n\n return {\n value: flags,\n literal: str\n };\n }\n\n function scanRegExp() {\n var start, body, flags, pattern, value;\n\n lookahead = null;\n skipComment();\n start = index;\n\n body = scanRegExpBody();\n flags = scanRegExpFlags();\n value = testRegExp(body.value, flags.value);\n\n if (extra.tokenize) {\n return {\n type: Token.RegularExpression,\n value: value,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n return {\n literal: body.literal + flags.literal,\n value: value,\n start: start,\n end: index\n };\n }\n\n function collectRegex() {\n var pos, loc, regex, token;\n\n skipComment();\n\n pos = index;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart\n }\n };\n\n regex = scanRegExp();\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n\n /* istanbul ignore next */\n if (!extra.tokenize) {\n // Pop the previous token, which is likely '/' or '/='\n if (extra.tokens.length > 0) {\n token = extra.tokens[extra.tokens.length - 1];\n if (token.range[0] === pos && token.type === 'Punctuator') {\n if (token.value === '/' || token.value === '/=') {\n extra.tokens.pop();\n }\n }\n }\n\n extra.tokens.push({\n type: 'RegularExpression',\n value: regex.literal,\n range: [pos, index],\n loc: loc\n });\n }\n\n return regex;\n }\n\n function isIdentifierName(token) {\n return token.type === Token.Identifier ||\n token.type === Token.Keyword ||\n token.type === Token.BooleanLiteral ||\n token.type === Token.NullLiteral;\n }\n\n function advanceSlash() {\n var prevToken,\n checkToken;\n // Using the following algorithm:\n // https://github.com/mozilla/sweet.js/wiki/design\n prevToken = extra.tokens[extra.tokens.length - 1];\n if (!prevToken) {\n // Nothing before that: it cannot be a division.\n return collectRegex();\n }\n if (prevToken.type === 'Punctuator') {\n if (prevToken.value === ']') {\n return scanPunctuator();\n }\n if (prevToken.value === ')') {\n checkToken = extra.tokens[extra.openParenToken - 1];\n if (checkToken &&\n checkToken.type === 'Keyword' &&\n (checkToken.value === 'if' ||\n checkToken.value === 'while' ||\n checkToken.value === 'for' ||\n checkToken.value === 'with')) {\n return collectRegex();\n }\n return scanPunctuator();\n }\n if (prevToken.value === '}') {\n // Dividing a function by anything makes little sense,\n // but we have to check for that.\n if (extra.tokens[extra.openCurlyToken - 3] &&\n extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') {\n // Anonymous function.\n checkToken = extra.tokens[extra.openCurlyToken - 4];\n if (!checkToken) {\n return scanPunctuator();\n }\n } else if (extra.tokens[extra.openCurlyToken - 4] &&\n extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') {\n // Named function.\n checkToken = extra.tokens[extra.openCurlyToken - 5];\n if (!checkToken) {\n return collectRegex();\n }\n } else {\n return scanPunctuator();\n }\n // checkToken determines whether the function is\n // a declaration or an expression.\n if (FnExprTokens.indexOf(checkToken.value) >= 0) {\n // It is an expression.\n return scanPunctuator();\n }\n // It is a declaration.\n return collectRegex();\n }\n return collectRegex();\n }\n if (prevToken.type === 'Keyword' && prevToken.value !== 'this') {\n return collectRegex();\n }\n return scanPunctuator();\n }\n\n function advance() {\n var ch;\n\n skipComment();\n\n if (index >= length) {\n return {\n type: Token.EOF,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: index,\n end: index\n };\n }\n\n ch = source.charCodeAt(index);\n\n if (isIdentifierStart(ch)) {\n return scanIdentifier();\n }\n\n // Very common: ( and ) and ;\n if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {\n return scanPunctuator();\n }\n\n // String literal starts with single quote (U+0027) or double quote (U+0022).\n if (ch === 0x27 || ch === 0x22) {\n return scanStringLiteral();\n }\n\n\n // Dot (.) U+002E can also start a floating-point number, hence the need\n // to check the next character.\n if (ch === 0x2E) {\n if (isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNumericLiteral();\n }\n return scanPunctuator();\n }\n\n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n\n // Slash (/) U+002F can also start a regex.\n if (extra.tokenize && ch === 0x2F) {\n return advanceSlash();\n }\n\n return scanPunctuator();\n }\n\n function collectToken() {\n var loc, token, range, value;\n\n skipComment();\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart\n }\n };\n\n token = advance();\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n\n if (token.type !== Token.EOF) {\n value = source.slice(token.start, token.end);\n extra.tokens.push({\n type: TokenName[token.type],\n value: value,\n range: [token.start, token.end],\n loc: loc\n });\n }\n\n return token;\n }\n\n function lex() {\n var token;\n\n token = lookahead;\n index = token.end;\n lineNumber = token.lineNumber;\n lineStart = token.lineStart;\n\n lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();\n\n index = token.end;\n lineNumber = token.lineNumber;\n lineStart = token.lineStart;\n\n return token;\n }\n\n function peek() {\n var pos, line, start;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();\n index = pos;\n lineNumber = line;\n lineStart = start;\n }\n\n function Position(line, column) {\n this.line = line;\n this.column = column;\n }\n\n function SourceLocation(startLine, startColumn, line, column) {\n this.start = new Position(startLine, startColumn);\n this.end = new Position(line, column);\n }\n\n SyntaxTreeDelegate = {\n\n name: 'SyntaxTree',\n\n processComment: function (node) {\n var lastChild, trailingComments;\n\n if (node.type === Syntax.Program) {\n if (node.body.length > 0) {\n return;\n }\n }\n\n if (extra.trailingComments.length > 0) {\n if (extra.trailingComments[0].range[0] >= node.range[1]) {\n trailingComments = extra.trailingComments;\n extra.trailingComments = [];\n } else {\n extra.trailingComments.length = 0;\n }\n } else {\n if (extra.bottomRightStack.length > 0 &&\n extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments &&\n extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments[0].range[0] >= node.range[1]) {\n trailingComments = extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments;\n delete extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments;\n }\n }\n\n // Eating the stack.\n while (extra.bottomRightStack.length > 0 && extra.bottomRightStack[extra.bottomRightStack.length - 1].range[0] >= node.range[0]) {\n lastChild = extra.bottomRightStack.pop();\n }\n\n if (lastChild) {\n if (lastChild.leadingComments && lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= node.range[0]) {\n node.leadingComments = lastChild.leadingComments;\n delete lastChild.leadingComments;\n }\n } else if (extra.leadingComments.length > 0 && extra.leadingComments[extra.leadingComments.length - 1].range[1] <= node.range[0]) {\n node.leadingComments = extra.leadingComments;\n extra.leadingComments = [];\n }\n\n\n if (trailingComments) {\n node.trailingComments = trailingComments;\n }\n\n extra.bottomRightStack.push(node);\n },\n\n markEnd: function (node, startToken) {\n if (extra.range) {\n node.range = [startToken.start, index];\n }\n if (extra.loc) {\n node.loc = new SourceLocation(\n startToken.startLineNumber === undefined ? startToken.lineNumber : startToken.startLineNumber,\n startToken.start - (startToken.startLineStart === undefined ? startToken.lineStart : startToken.startLineStart),\n lineNumber,\n index - lineStart\n );\n this.postProcess(node);\n }\n\n if (extra.attachComment) {\n this.processComment(node);\n }\n return node;\n },\n\n postProcess: function (node) {\n if (extra.source) {\n node.loc.source = extra.source;\n }\n return node;\n },\n\n createArrayExpression: function (elements) {\n return {\n type: Syntax.ArrayExpression,\n elements: elements\n };\n },\n\n createAssignmentExpression: function (operator, left, right) {\n return {\n type: Syntax.AssignmentExpression,\n operator: operator,\n left: left,\n right: right\n };\n },\n\n createBinaryExpression: function (operator, left, right) {\n var type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression :\n Syntax.BinaryExpression;\n return {\n type: type,\n operator: operator,\n left: left,\n right: right\n };\n },\n\n createBlockStatement: function (body) {\n return {\n type: Syntax.BlockStatement,\n body: body\n };\n },\n\n createBreakStatement: function (label) {\n return {\n type: Syntax.BreakStatement,\n label: label\n };\n },\n\n createCallExpression: function (callee, args) {\n return {\n type: Syntax.CallExpression,\n callee: callee,\n 'arguments': args\n };\n },\n\n createCatchClause: function (param, body) {\n return {\n type: Syntax.CatchClause,\n param: param,\n body: body\n };\n },\n\n createConditionalExpression: function (test, consequent, alternate) {\n return {\n type: Syntax.ConditionalExpression,\n test: test,\n consequent: consequent,\n alternate: alternate\n };\n },\n\n createContinueStatement: function (label) {\n return {\n type: Syntax.ContinueStatement,\n label: label\n };\n },\n\n createDebuggerStatement: function () {\n return {\n type: Syntax.DebuggerStatement\n };\n },\n\n createDoWhileStatement: function (body, test) {\n return {\n type: Syntax.DoWhileStatement,\n body: body,\n test: test\n };\n },\n\n createEmptyStatement: function () {\n return {\n type: Syntax.EmptyStatement\n };\n },\n\n createExpressionStatement: function (expression) {\n return {\n type: Syntax.ExpressionStatement,\n expression: expression\n };\n },\n\n createForStatement: function (init, test, update, body) {\n return {\n type: Syntax.ForStatement,\n init: init,\n test: test,\n update: update,\n body: body\n };\n },\n\n createForInStatement: function (left, right, body) {\n return {\n type: Syntax.ForInStatement,\n left: left,\n right: right,\n body: body,\n each: false\n };\n },\n\n createFunctionDeclaration: function (id, params, defaults, body) {\n return {\n type: Syntax.FunctionDeclaration,\n id: id,\n params: params,\n defaults: defaults,\n body: body,\n rest: null,\n generator: false,\n expression: false\n };\n },\n\n createFunctionExpression: function (id, params, defaults, body) {\n return {\n type: Syntax.FunctionExpression,\n id: id,\n params: params,\n defaults: defaults,\n body: body,\n rest: null,\n generator: false,\n expression: false\n };\n },\n\n createIdentifier: function (name) {\n return {\n type: Syntax.Identifier,\n name: name\n };\n },\n\n createIfStatement: function (test, consequent, alternate) {\n return {\n type: Syntax.IfStatement,\n test: test,\n consequent: consequent,\n alternate: alternate\n };\n },\n\n createLabeledStatement: function (label, body) {\n return {\n type: Syntax.LabeledStatement,\n label: label,\n body: body\n };\n },\n\n createLiteral: function (token) {\n return {\n type: Syntax.Literal,\n value: token.value,\n raw: source.slice(token.start, token.end)\n };\n },\n\n createMemberExpression: function (accessor, object, property) {\n return {\n type: Syntax.MemberExpression,\n computed: accessor === '[',\n object: object,\n property: property\n };\n },\n\n createNewExpression: function (callee, args) {\n return {\n type: Syntax.NewExpression,\n callee: callee,\n 'arguments': args\n };\n },\n\n createObjectExpression: function (properties) {\n return {\n type: Syntax.ObjectExpression,\n properties: properties\n };\n },\n\n createPostfixExpression: function (operator, argument) {\n return {\n type: Syntax.UpdateExpression,\n operator: operator,\n argument: argument,\n prefix: false\n };\n },\n\n createProgram: function (body) {\n return {\n type: Syntax.Program,\n body: body\n };\n },\n\n createProperty: function (kind, key, value) {\n return {\n type: Syntax.Property,\n key: key,\n value: value,\n kind: kind\n };\n },\n\n createReturnStatement: function (argument) {\n return {\n type: Syntax.ReturnStatement,\n argument: argument\n };\n },\n\n createSequenceExpression: function (expressions) {\n return {\n type: Syntax.SequenceExpression,\n expressions: expressions\n };\n },\n\n createSwitchCase: function (test, consequent) {\n return {\n type: Syntax.SwitchCase,\n test: test,\n consequent: consequent\n };\n },\n\n createSwitchStatement: function (discriminant, cases) {\n return {\n type: Syntax.SwitchStatement,\n discriminant: discriminant,\n cases: cases\n };\n },\n\n createThisExpression: function () {\n return {\n type: Syntax.ThisExpression\n };\n },\n\n createThrowStatement: function (argument) {\n return {\n type: Syntax.ThrowStatement,\n argument: argument\n };\n },\n\n createTryStatement: function (block, guardedHandlers, handlers, finalizer) {\n return {\n type: Syntax.TryStatement,\n block: block,\n guardedHandlers: guardedHandlers,\n handlers: handlers,\n finalizer: finalizer\n };\n },\n\n createUnaryExpression: function (operator, argument) {\n if (operator === '++' || operator === '--') {\n return {\n type: Syntax.UpdateExpression,\n operator: operator,\n argument: argument,\n prefix: true\n };\n }\n return {\n type: Syntax.UnaryExpression,\n operator: operator,\n argument: argument,\n prefix: true\n };\n },\n\n createVariableDeclaration: function (declarations, kind) {\n return {\n type: Syntax.VariableDeclaration,\n declarations: declarations,\n kind: kind\n };\n },\n\n createVariableDeclarator: function (id, init) {\n return {\n type: Syntax.VariableDeclarator,\n id: id,\n init: init\n };\n },\n\n createWhileStatement: function (test, body) {\n return {\n type: Syntax.WhileStatement,\n test: test,\n body: body\n };\n },\n\n createWithStatement: function (object, body) {\n return {\n type: Syntax.WithStatement,\n object: object,\n body: body\n };\n }\n };\n\n // Return true if there is a line terminator before the next token.\n\n function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }\n\n // Throw an exception\n\n function throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(\n /%(\\d)/g,\n function (whole, index) {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n }\n );\n\n if (typeof token.lineNumber === 'number') {\n error = new Error('Line ' + token.lineNumber + ': ' + msg);\n error.index = token.start;\n error.lineNumber = token.lineNumber;\n error.column = token.start - lineStart + 1;\n } else {\n error = new Error('Line ' + lineNumber + ': ' + msg);\n error.index = index;\n error.lineNumber = lineNumber;\n error.column = index - lineStart + 1;\n }\n\n error.description = msg;\n throw error;\n }\n\n function throwErrorTolerant() {\n try {\n throwError.apply(null, arguments);\n } catch (e) {\n if (extra.errors) {\n extra.errors.push(e);\n } else {\n throw e;\n }\n }\n }\n\n\n // Throw an exception because of the token.\n\n function throwUnexpected(token) {\n if (token.type === Token.EOF) {\n throwError(token, Messages.UnexpectedEOS);\n }\n\n if (token.type === Token.NumericLiteral) {\n throwError(token, Messages.UnexpectedNumber);\n }\n\n if (token.type === Token.StringLiteral) {\n throwError(token, Messages.UnexpectedString);\n }\n\n if (token.type === Token.Identifier) {\n throwError(token, Messages.UnexpectedIdentifier);\n }\n\n if (token.type === Token.Keyword) {\n if (isFutureReservedWord(token.value)) {\n throwError(token, Messages.UnexpectedReserved);\n } else if (strict && isStrictModeReservedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictReservedWord);\n return;\n }\n throwError(token, Messages.UnexpectedToken, token.value);\n }\n\n // BooleanLiteral, NullLiteral, or Punctuator.\n throwError(token, Messages.UnexpectedToken, token.value);\n }\n\n // Expect the next token to match the specified punctuator.\n // If not, an exception will be thrown.\n\n function expect(value) {\n var token = lex();\n if (token.type !== Token.Punctuator || token.value !== value) {\n throwUnexpected(token);\n }\n }\n\n // Expect the next token to match the specified keyword.\n // If not, an exception will be thrown.\n\n function expectKeyword(keyword) {\n var token = lex();\n if (token.type !== Token.Keyword || token.value !== keyword) {\n throwUnexpected(token);\n }\n }\n\n // Return true if the next token matches the specified punctuator.\n\n function match(value) {\n return lookahead.type === Token.Punctuator && lookahead.value === value;\n }\n\n // Return true if the next token matches the specified keyword\n\n function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }\n\n // Return true if the next token is an assignment operator\n\n function matchAssign() {\n var op;\n\n if (lookahead.type !== Token.Punctuator) {\n return false;\n }\n op = lookahead.value;\n return op === '=' ||\n op === '*=' ||\n op === '/=' ||\n op === '%=' ||\n op === '+=' ||\n op === '-=' ||\n op === '<<=' ||\n op === '>>=' ||\n op === '>>>=' ||\n op === '&=' ||\n op === '^=' ||\n op === '|=';\n }\n\n function consumeSemicolon() {\n var line, oldIndex = index, oldLineNumber = lineNumber,\n oldLineStart = lineStart, oldLookahead = lookahead;\n\n // Catch the very common case first: immediately a semicolon (U+003B).\n if (source.charCodeAt(index) === 0x3B || match(';')) {\n lex();\n return;\n }\n\n line = lineNumber;\n skipComment();\n if (lineNumber !== line) {\n index = oldIndex;\n lineNumber = oldLineNumber;\n lineStart = oldLineStart;\n lookahead = oldLookahead;\n return;\n }\n\n if (lookahead.type !== Token.EOF && !match('}')) {\n throwUnexpected(lookahead);\n }\n }\n\n // Return true if provided expression is LeftHandSideExpression\n\n function isLeftHandSide(expr) {\n return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression;\n }\n\n // 11.1.4 Array Initialiser\n\n function parseArrayInitialiser() {\n var elements = [], startToken;\n\n startToken = lookahead;\n expect('[');\n\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elements.push(parseAssignmentExpression());\n\n if (!match(']')) {\n expect(',');\n }\n }\n }\n\n lex();\n\n return delegate.markEnd(delegate.createArrayExpression(elements), startToken);\n }\n\n // 11.1.5 Object Initialiser\n\n function parsePropertyFunction(param, first) {\n var previousStrict, body, startToken;\n\n previousStrict = strict;\n startToken = lookahead;\n body = parseFunctionSourceElements();\n if (first && strict && isRestrictedWord(param[0].name)) {\n throwErrorTolerant(first, Messages.StrictParamName);\n }\n strict = previousStrict;\n return delegate.markEnd(delegate.createFunctionExpression(null, param, [], body), startToken);\n }\n\n function parseObjectPropertyKey() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n\n if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) {\n if (strict && token.octal) {\n throwErrorTolerant(token, Messages.StrictOctalLiteral);\n }\n return delegate.markEnd(delegate.createLiteral(token), startToken);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseObjectProperty() {\n var token, key, id, value, param, startToken;\n\n token = lookahead;\n startToken = lookahead;\n\n if (token.type === Token.Identifier) {\n\n id = parseObjectPropertyKey();\n\n // Property Assignment: Getter and Setter.\n\n if (token.value === 'get' && !match(':')) {\n key = parseObjectPropertyKey();\n expect('(');\n expect(')');\n value = parsePropertyFunction([]);\n return delegate.markEnd(delegate.createProperty('get', key, value), startToken);\n }\n if (token.value === 'set' && !match(':')) {\n key = parseObjectPropertyKey();\n expect('(');\n token = lookahead;\n if (token.type !== Token.Identifier) {\n expect(')');\n throwErrorTolerant(token, Messages.UnexpectedToken, token.value);\n value = parsePropertyFunction([]);\n } else {\n param = [ parseVariableIdentifier() ];\n expect(')');\n value = parsePropertyFunction(param, token);\n }\n return delegate.markEnd(delegate.createProperty('set', key, value), startToken);\n }\n expect(':');\n value = parseAssignmentExpression();\n return delegate.markEnd(delegate.createProperty('init', id, value), startToken);\n }\n if (token.type === Token.EOF || token.type === Token.Punctuator) {\n throwUnexpected(token);\n } else {\n key = parseObjectPropertyKey();\n expect(':');\n value = parseAssignmentExpression();\n return delegate.markEnd(delegate.createProperty('init', key, value), startToken);\n }\n }\n\n function parseObjectInitialiser() {\n var properties = [], property, name, key, kind, map = {}, toString = String, startToken;\n\n startToken = lookahead;\n\n expect('{');\n\n while (!match('}')) {\n property = parseObjectProperty();\n\n if (property.key.type === Syntax.Identifier) {\n name = property.key.name;\n } else {\n name = toString(property.key.value);\n }\n kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set;\n\n key = '$' + name;\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n if (map[key] === PropertyKind.Data) {\n if (strict && kind === PropertyKind.Data) {\n throwErrorTolerant({}, Messages.StrictDuplicateProperty);\n } else if (kind !== PropertyKind.Data) {\n throwErrorTolerant({}, Messages.AccessorDataProperty);\n }\n } else {\n if (kind === PropertyKind.Data) {\n throwErrorTolerant({}, Messages.AccessorDataProperty);\n } else if (map[key] & kind) {\n throwErrorTolerant({}, Messages.AccessorGetSet);\n }\n }\n map[key] |= kind;\n } else {\n map[key] = kind;\n }\n\n properties.push(property);\n\n if (!match('}')) {\n expect(',');\n }\n }\n\n expect('}');\n\n return delegate.markEnd(delegate.createObjectExpression(properties), startToken);\n }\n\n // 11.1.6 The Grouping Operator\n\n function parseGroupExpression() {\n var expr;\n\n expect('(');\n\n expr = parseExpression();\n\n expect(')');\n\n return expr;\n }\n\n\n // 11.1 Primary Expressions\n\n function parsePrimaryExpression() {\n var type, token, expr, startToken;\n\n if (match('(')) {\n return parseGroupExpression();\n }\n\n if (match('[')) {\n return parseArrayInitialiser();\n }\n\n if (match('{')) {\n return parseObjectInitialiser();\n }\n\n type = lookahead.type;\n startToken = lookahead;\n\n if (type === Token.Identifier) {\n expr = delegate.createIdentifier(lex().value);\n } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {\n if (strict && lookahead.octal) {\n throwErrorTolerant(lookahead, Messages.StrictOctalLiteral);\n }\n expr = delegate.createLiteral(lex());\n } else if (type === Token.Keyword) {\n if (matchKeyword('function')) {\n return parseFunctionExpression();\n }\n if (matchKeyword('this')) {\n lex();\n expr = delegate.createThisExpression();\n } else {\n throwUnexpected(lex());\n }\n } else if (type === Token.BooleanLiteral) {\n token = lex();\n token.value = (token.value === 'true');\n expr = delegate.createLiteral(token);\n } else if (type === Token.NullLiteral) {\n token = lex();\n token.value = null;\n expr = delegate.createLiteral(token);\n } else if (match('/') || match('/=')) {\n if (typeof extra.tokens !== 'undefined') {\n expr = delegate.createLiteral(collectRegex());\n } else {\n expr = delegate.createLiteral(scanRegExp());\n }\n peek();\n } else {\n throwUnexpected(lex());\n }\n\n return delegate.markEnd(expr, startToken);\n }\n\n // 11.2 Left-Hand-Side Expressions\n\n function parseArguments() {\n var args = [];\n\n expect('(');\n\n if (!match(')')) {\n while (index < length) {\n args.push(parseAssignmentExpression());\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return args;\n }\n\n function parseNonComputedProperty() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n if (!isIdentifierName(token)) {\n throwUnexpected(token);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseNonComputedMember() {\n expect('.');\n\n return parseNonComputedProperty();\n }\n\n function parseComputedMember() {\n var expr;\n\n expect('[');\n\n expr = parseExpression();\n\n expect(']');\n\n return expr;\n }\n\n function parseNewExpression() {\n var callee, args, startToken;\n\n startToken = lookahead;\n expectKeyword('new');\n callee = parseLeftHandSideExpression();\n args = match('(') ? parseArguments() : [];\n\n return delegate.markEnd(delegate.createNewExpression(callee, args), startToken);\n }\n\n function parseLeftHandSideExpressionAllowCall() {\n var expr, args, property, startToken, previousAllowIn = state.allowIn;\n\n startToken = lookahead;\n state.allowIn = true;\n expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n\n for (;;) {\n if (match('.')) {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n } else if (match('(')) {\n args = parseArguments();\n expr = delegate.createCallExpression(expr, args);\n } else if (match('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else {\n break;\n }\n delegate.markEnd(expr, startToken);\n }\n state.allowIn = previousAllowIn;\n\n return expr;\n }\n\n function parseLeftHandSideExpression() {\n var expr, property, startToken;\n assert(state.allowIn, 'callee of new expression always allow in keyword.');\n\n startToken = lookahead;\n\n expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n\n while (match('.') || match('[')) {\n if (match('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n }\n delegate.markEnd(expr, startToken);\n }\n return expr;\n }\n\n // 11.3 Postfix Expressions\n\n function parsePostfixExpression() {\n var expr, token, startToken = lookahead;\n\n expr = parseLeftHandSideExpressionAllowCall();\n\n if (lookahead.type === Token.Punctuator) {\n if ((match('++') || match('--')) && !peekLineTerminator()) {\n // 11.3.1, 11.3.2\n if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n throwErrorTolerant({}, Messages.StrictLHSPostfix);\n }\n\n if (!isLeftHandSide(expr)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n token = lex();\n expr = delegate.markEnd(delegate.createPostfixExpression(token.value, expr), startToken);\n }\n }\n\n return expr;\n }\n\n // 11.4 Unary Operators\n\n function parseUnaryExpression() {\n var token, expr, startToken;\n\n if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {\n expr = parsePostfixExpression();\n } else if (match('++') || match('--')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n // 11.4.4, 11.4.5\n if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n throwErrorTolerant({}, Messages.StrictLHSPrefix);\n }\n\n if (!isLeftHandSide(expr)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n } else if (match('+') || match('-') || match('~') || match('!')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) {\n throwErrorTolerant({}, Messages.StrictDelete);\n }\n } else {\n expr = parsePostfixExpression();\n }\n\n return expr;\n }\n\n function binaryPrecedence(token, allowIn) {\n var prec = 0;\n\n if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {\n return 0;\n }\n\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n\n case '&&':\n prec = 2;\n break;\n\n case '|':\n prec = 3;\n break;\n\n case '^':\n prec = 4;\n break;\n\n case '&':\n prec = 5;\n break;\n\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n prec = 7;\n break;\n\n case 'in':\n prec = allowIn ? 7 : 0;\n break;\n\n case '<<':\n case '>>':\n case '>>>':\n prec = 8;\n break;\n\n case '+':\n case '-':\n prec = 9;\n break;\n\n case '*':\n case '/':\n case '%':\n prec = 11;\n break;\n\n default:\n break;\n }\n\n return prec;\n }\n\n // 11.5 Multiplicative Operators\n // 11.6 Additive Operators\n // 11.7 Bitwise Shift Operators\n // 11.8 Relational Operators\n // 11.9 Equality Operators\n // 11.10 Binary Bitwise Operators\n // 11.11 Binary Logical Operators\n\n function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers[markers.length - 1];\n delegate.markEnd(expr, marker);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n delegate.markEnd(expr, marker);\n }\n\n return expr;\n }\n\n\n // 11.12 Conditional Operator\n\n function parseConditionalExpression() {\n var expr, previousAllowIn, consequent, alternate, startToken;\n\n startToken = lookahead;\n\n expr = parseBinaryExpression();\n\n if (match('?')) {\n lex();\n previousAllowIn = state.allowIn;\n state.allowIn = true;\n consequent = parseAssignmentExpression();\n state.allowIn = previousAllowIn;\n expect(':');\n alternate = parseAssignmentExpression();\n\n expr = delegate.createConditionalExpression(expr, consequent, alternate);\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 11.13 Assignment Operators\n\n function parseAssignmentExpression() {\n var token, left, right, node, startToken;\n\n token = lookahead;\n startToken = lookahead;\n\n node = left = parseConditionalExpression();\n\n if (matchAssign()) {\n // LeftHandSideExpression\n if (!isLeftHandSide(left)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n // 11.13.1\n if (strict && left.type === Syntax.Identifier && isRestrictedWord(left.name)) {\n throwErrorTolerant(token, Messages.StrictLHSAssignment);\n }\n\n token = lex();\n right = parseAssignmentExpression();\n node = delegate.markEnd(delegate.createAssignmentExpression(token.value, left, right), startToken);\n }\n\n return node;\n }\n\n // 11.14 Comma Operator\n\n function parseExpression() {\n var expr, startToken = lookahead;\n\n expr = parseAssignmentExpression();\n\n if (match(',')) {\n expr = delegate.createSequenceExpression([ expr ]);\n\n while (index < length) {\n if (!match(',')) {\n break;\n }\n lex();\n expr.expressions.push(parseAssignmentExpression());\n }\n\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 12.1 Block\n\n function parseStatementList() {\n var list = [],\n statement;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n statement = parseSourceElement();\n if (typeof statement === 'undefined') {\n break;\n }\n list.push(statement);\n }\n\n return list;\n }\n\n function parseBlock() {\n var block, startToken;\n\n startToken = lookahead;\n expect('{');\n\n block = parseStatementList();\n\n expect('}');\n\n return delegate.markEnd(delegate.createBlockStatement(block), startToken);\n }\n\n // 12.2 Variable Statement\n\n function parseVariableIdentifier() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n if (token.type !== Token.Identifier) {\n throwUnexpected(token);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseVariableDeclaration(kind) {\n var init = null, id, startToken;\n\n startToken = lookahead;\n id = parseVariableIdentifier();\n\n // 12.2.1\n if (strict && isRestrictedWord(id.name)) {\n throwErrorTolerant({}, Messages.StrictVarName);\n }\n\n if (kind === 'const') {\n expect('=');\n init = parseAssignmentExpression();\n } else if (match('=')) {\n lex();\n init = parseAssignmentExpression();\n }\n\n return delegate.markEnd(delegate.createVariableDeclarator(id, init), startToken);\n }\n\n function parseVariableDeclarationList(kind) {\n var list = [];\n\n do {\n list.push(parseVariableDeclaration(kind));\n if (!match(',')) {\n break;\n }\n lex();\n } while (index < length);\n\n return list;\n }\n\n function parseVariableStatement() {\n var declarations;\n\n expectKeyword('var');\n\n declarations = parseVariableDeclarationList();\n\n consumeSemicolon();\n\n return delegate.createVariableDeclaration(declarations, 'var');\n }\n\n // kind may be `const` or `let`\n // Both are experimental and not in the specification yet.\n // see http://wiki.ecmascript.org/doku.php?id=harmony:const\n // and http://wiki.ecmascript.org/doku.php?id=harmony:let\n function parseConstLetDeclaration(kind) {\n var declarations, startToken;\n\n startToken = lookahead;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken);\n }\n\n // 12.3 Empty Statement\n\n function parseEmptyStatement() {\n expect(';');\n return delegate.createEmptyStatement();\n }\n\n // 12.4 Expression Statement\n\n function parseExpressionStatement() {\n var expr = parseExpression();\n consumeSemicolon();\n return delegate.createExpressionStatement(expr);\n }\n\n // 12.5 If statement\n\n function parseIfStatement() {\n var test, consequent, alternate;\n\n expectKeyword('if');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n consequent = parseStatement();\n\n if (matchKeyword('else')) {\n lex();\n alternate = parseStatement();\n } else {\n alternate = null;\n }\n\n return delegate.createIfStatement(test, consequent, alternate);\n }\n\n // 12.6 Iteration Statements\n\n function parseDoWhileStatement() {\n var body, test, oldInIteration;\n\n expectKeyword('do');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n expectKeyword('while');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n if (match(';')) {\n lex();\n }\n\n return delegate.createDoWhileStatement(body, test);\n }\n\n function parseWhileStatement() {\n var test, body, oldInIteration;\n\n expectKeyword('while');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n return delegate.createWhileStatement(test, body);\n }\n\n function parseForVariableDeclaration() {\n var token, declarations, startToken;\n\n startToken = lookahead;\n token = lex();\n declarations = parseVariableDeclarationList();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, token.value), startToken);\n }\n\n function parseForStatement() {\n var init, test, update, left, right, body, oldInIteration, previousAllowIn = state.allowIn;\n\n init = test = update = null;\n\n expectKeyword('for');\n\n expect('(');\n\n if (match(';')) {\n lex();\n } else {\n if (matchKeyword('var') || matchKeyword('let')) {\n state.allowIn = false;\n init = parseForVariableDeclaration();\n state.allowIn = previousAllowIn;\n\n if (init.declarations.length === 1 && matchKeyword('in')) {\n lex();\n left = init;\n right = parseExpression();\n init = null;\n }\n } else {\n state.allowIn = false;\n init = parseExpression();\n state.allowIn = previousAllowIn;\n\n if (matchKeyword('in')) {\n // LeftHandSideExpression\n if (!isLeftHandSide(init)) {\n throwErrorTolerant({}, Messages.InvalidLHSInForIn);\n }\n\n lex();\n left = init;\n right = parseExpression();\n init = null;\n }\n }\n\n if (typeof left === 'undefined') {\n expect(';');\n }\n }\n\n if (typeof left === 'undefined') {\n\n if (!match(';')) {\n test = parseExpression();\n }\n expect(';');\n\n if (!match(')')) {\n update = parseExpression();\n }\n }\n\n expect(')');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n return (typeof left === 'undefined') ?\n delegate.createForStatement(init, test, update, body) :\n delegate.createForInStatement(left, right, body);\n }\n\n // 12.7 The continue statement\n\n function parseContinueStatement() {\n var label = null, key;\n\n expectKeyword('continue');\n\n // Optimize the most common form: 'continue;'.\n if (source.charCodeAt(index) === 0x3B) {\n lex();\n\n if (!state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(null);\n }\n\n if (peekLineTerminator()) {\n if (!state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(null);\n }\n\n if (lookahead.type === Token.Identifier) {\n label = parseVariableIdentifier();\n\n key = '$' + label.name;\n if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.UnknownLabel, label.name);\n }\n }\n\n consumeSemicolon();\n\n if (label === null && !state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(label);\n }\n\n // 12.8 The break statement\n\n function parseBreakStatement() {\n var label = null, key;\n\n expectKeyword('break');\n\n // Catch the very common case first: immediately a semicolon (U+003B).\n if (source.charCodeAt(index) === 0x3B) {\n lex();\n\n if (!(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(null);\n }\n\n if (peekLineTerminator()) {\n if (!(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(null);\n }\n\n if (lookahead.type === Token.Identifier) {\n label = parseVariableIdentifier();\n\n key = '$' + label.name;\n if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.UnknownLabel, label.name);\n }\n }\n\n consumeSemicolon();\n\n if (label === null && !(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(label);\n }\n\n // 12.9 The return statement\n\n function parseReturnStatement() {\n var argument = null;\n\n expectKeyword('return');\n\n if (!state.inFunctionBody) {\n throwErrorTolerant({}, Messages.IllegalReturn);\n }\n\n // 'return' followed by a space and an identifier is very common.\n if (source.charCodeAt(index) === 0x20) {\n if (isIdentifierStart(source.charCodeAt(index + 1))) {\n argument = parseExpression();\n consumeSemicolon();\n return delegate.createReturnStatement(argument);\n }\n }\n\n if (peekLineTerminator()) {\n return delegate.createReturnStatement(null);\n }\n\n if (!match(';')) {\n if (!match('}') && lookahead.type !== Token.EOF) {\n argument = parseExpression();\n }\n }\n\n consumeSemicolon();\n\n return delegate.createReturnStatement(argument);\n }\n\n // 12.10 The with statement\n\n function parseWithStatement() {\n var object, body;\n\n if (strict) {\n // TODO(ikarienator): Should we update the test cases instead?\n skipComment();\n throwErrorTolerant({}, Messages.StrictModeWith);\n }\n\n expectKeyword('with');\n\n expect('(');\n\n object = parseExpression();\n\n expect(')');\n\n body = parseStatement();\n\n return delegate.createWithStatement(object, body);\n }\n\n // 12.10 The swith statement\n\n function parseSwitchCase() {\n var test, consequent = [], statement, startToken;\n\n startToken = lookahead;\n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n\n while (index < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n statement = parseStatement();\n consequent.push(statement);\n }\n\n return delegate.markEnd(delegate.createSwitchCase(test, consequent), startToken);\n }\n\n function parseSwitchStatement() {\n var discriminant, cases, clause, oldInSwitch, defaultFound;\n\n expectKeyword('switch');\n\n expect('(');\n\n discriminant = parseExpression();\n\n expect(')');\n\n expect('{');\n\n cases = [];\n\n if (match('}')) {\n lex();\n return delegate.createSwitchStatement(discriminant, cases);\n }\n\n oldInSwitch = state.inSwitch;\n state.inSwitch = true;\n defaultFound = false;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n clause = parseSwitchCase();\n if (clause.test === null) {\n if (defaultFound) {\n throwError({}, Messages.MultipleDefaultsInSwitch);\n }\n defaultFound = true;\n }\n cases.push(clause);\n }\n\n state.inSwitch = oldInSwitch;\n\n expect('}');\n\n return delegate.createSwitchStatement(discriminant, cases);\n }\n\n // 12.13 The throw statement\n\n function parseThrowStatement() {\n var argument;\n\n expectKeyword('throw');\n\n if (peekLineTerminator()) {\n throwError({}, Messages.NewlineAfterThrow);\n }\n\n argument = parseExpression();\n\n consumeSemicolon();\n\n return delegate.createThrowStatement(argument);\n }\n\n // 12.14 The try statement\n\n function parseCatchClause() {\n var param, body, startToken;\n\n startToken = lookahead;\n expectKeyword('catch');\n\n expect('(');\n if (match(')')) {\n throwUnexpected(lookahead);\n }\n\n param = parseVariableIdentifier();\n // 12.14.1\n if (strict && isRestrictedWord(param.name)) {\n throwErrorTolerant({}, Messages.StrictCatchVariable);\n }\n\n expect(')');\n body = parseBlock();\n return delegate.markEnd(delegate.createCatchClause(param, body), startToken);\n }\n\n function parseTryStatement() {\n var block, handlers = [], finalizer = null;\n\n expectKeyword('try');\n\n block = parseBlock();\n\n if (matchKeyword('catch')) {\n handlers.push(parseCatchClause());\n }\n\n if (matchKeyword('finally')) {\n lex();\n finalizer = parseBlock();\n }\n\n if (handlers.length === 0 && !finalizer) {\n throwError({}, Messages.NoCatchOrFinally);\n }\n\n return delegate.createTryStatement(block, [], handlers, finalizer);\n }\n\n // 12.15 The debugger statement\n\n function parseDebuggerStatement() {\n expectKeyword('debugger');\n\n consumeSemicolon();\n\n return delegate.createDebuggerStatement();\n }\n\n // 12 Statements\n\n function parseStatement() {\n var type = lookahead.type,\n expr,\n labeledBody,\n key,\n startToken;\n\n if (type === Token.EOF) {\n throwUnexpected(lookahead);\n }\n\n if (type === Token.Punctuator && lookahead.value === '{') {\n return parseBlock();\n }\n\n startToken = lookahead;\n\n if (type === Token.Punctuator) {\n switch (lookahead.value) {\n case ';':\n return delegate.markEnd(parseEmptyStatement(), startToken);\n case '(':\n return delegate.markEnd(parseExpressionStatement(), startToken);\n default:\n break;\n }\n }\n\n if (type === Token.Keyword) {\n switch (lookahead.value) {\n case 'break':\n return delegate.markEnd(parseBreakStatement(), startToken);\n case 'continue':\n return delegate.markEnd(parseContinueStatement(), startToken);\n case 'debugger':\n return delegate.markEnd(parseDebuggerStatement(), startToken);\n case 'do':\n return delegate.markEnd(parseDoWhileStatement(), startToken);\n case 'for':\n return delegate.markEnd(parseForStatement(), startToken);\n case 'function':\n return delegate.markEnd(parseFunctionDeclaration(), startToken);\n case 'if':\n return delegate.markEnd(parseIfStatement(), startToken);\n case 'return':\n return delegate.markEnd(parseReturnStatement(), startToken);\n case 'switch':\n return delegate.markEnd(parseSwitchStatement(), startToken);\n case 'throw':\n return delegate.markEnd(parseThrowStatement(), startToken);\n case 'try':\n return delegate.markEnd(parseTryStatement(), startToken);\n case 'var':\n return delegate.markEnd(parseVariableStatement(), startToken);\n case 'while':\n return delegate.markEnd(parseWhileStatement(), startToken);\n case 'with':\n return delegate.markEnd(parseWithStatement(), startToken);\n default:\n break;\n }\n }\n\n expr = parseExpression();\n\n // 12.12 Labelled Statements\n if ((expr.type === Syntax.Identifier) && match(':')) {\n lex();\n\n key = '$' + expr.name;\n if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.Redeclaration, 'Label', expr.name);\n }\n\n state.labelSet[key] = true;\n labeledBody = parseStatement();\n delete state.labelSet[key];\n return delegate.markEnd(delegate.createLabeledStatement(expr, labeledBody), startToken);\n }\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createExpressionStatement(expr), startToken);\n }\n\n // 13 Function Definition\n\n function parseFunctionSourceElements() {\n var sourceElement, sourceElements = [], token, directive, firstRestricted,\n oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, startToken;\n\n startToken = lookahead;\n expect('{');\n\n while (index < length) {\n if (lookahead.type !== Token.StringLiteral) {\n break;\n }\n token = lookahead;\n\n sourceElement = parseSourceElement();\n sourceElements.push(sourceElement);\n if (sourceElement.expression.type !== Syntax.Literal) {\n // this is not directive\n break;\n }\n directive = source.slice(token.start + 1, token.end - 1);\n if (directive === 'use strict') {\n strict = true;\n if (firstRestricted) {\n throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);\n }\n } else {\n if (!firstRestricted && token.octal) {\n firstRestricted = token;\n }\n }\n }\n\n oldLabelSet = state.labelSet;\n oldInIteration = state.inIteration;\n oldInSwitch = state.inSwitch;\n oldInFunctionBody = state.inFunctionBody;\n\n state.labelSet = {};\n state.inIteration = false;\n state.inSwitch = false;\n state.inFunctionBody = true;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n sourceElement = parseSourceElement();\n if (typeof sourceElement === 'undefined') {\n break;\n }\n sourceElements.push(sourceElement);\n }\n\n expect('}');\n\n state.labelSet = oldLabelSet;\n state.inIteration = oldInIteration;\n state.inSwitch = oldInSwitch;\n state.inFunctionBody = oldInFunctionBody;\n\n return delegate.markEnd(delegate.createBlockStatement(sourceElements), startToken);\n }\n\n function parseParams(firstRestricted) {\n var param, params = [], token, stricted, paramSet, key, message;\n expect('(');\n\n if (!match(')')) {\n paramSet = {};\n while (index < length) {\n token = lookahead;\n param = parseVariableIdentifier();\n key = '$' + token.value;\n if (strict) {\n if (isRestrictedWord(token.value)) {\n stricted = token;\n message = Messages.StrictParamName;\n }\n if (Object.prototype.hasOwnProperty.call(paramSet, key)) {\n stricted = token;\n message = Messages.StrictParamDupe;\n }\n } else if (!firstRestricted) {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictParamName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n } else if (Object.prototype.hasOwnProperty.call(paramSet, key)) {\n firstRestricted = token;\n message = Messages.StrictParamDupe;\n }\n }\n params.push(param);\n paramSet[key] = true;\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return {\n params: params,\n stricted: stricted,\n firstRestricted: firstRestricted,\n message: message\n };\n }\n\n function parseFunctionDeclaration() {\n var id, params = [], body, token, stricted, tmp, firstRestricted, message, previousStrict, startToken;\n\n startToken = lookahead;\n\n expectKeyword('function');\n token = lookahead;\n id = parseVariableIdentifier();\n if (strict) {\n if (isRestrictedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictFunctionName);\n }\n } else {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictFunctionName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n }\n }\n\n tmp = parseParams(firstRestricted);\n params = tmp.params;\n stricted = tmp.stricted;\n firstRestricted = tmp.firstRestricted;\n if (tmp.message) {\n message = tmp.message;\n }\n\n previousStrict = strict;\n body = parseFunctionSourceElements();\n if (strict && firstRestricted) {\n throwError(firstRestricted, message);\n }\n if (strict && stricted) {\n throwErrorTolerant(stricted, message);\n }\n strict = previousStrict;\n\n return delegate.markEnd(delegate.createFunctionDeclaration(id, params, [], body), startToken);\n }\n\n function parseFunctionExpression() {\n var token, id = null, stricted, firstRestricted, message, tmp, params = [], body, previousStrict, startToken;\n\n startToken = lookahead;\n expectKeyword('function');\n\n if (!match('(')) {\n token = lookahead;\n id = parseVariableIdentifier();\n if (strict) {\n if (isRestrictedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictFunctionName);\n }\n } else {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictFunctionName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n }\n }\n }\n\n tmp = parseParams(firstRestricted);\n params = tmp.params;\n stricted = tmp.stricted;\n firstRestricted = tmp.firstRestricted;\n if (tmp.message) {\n message = tmp.message;\n }\n\n previousStrict = strict;\n body = parseFunctionSourceElements();\n if (strict && firstRestricted) {\n throwError(firstRestricted, message);\n }\n if (strict && stricted) {\n throwErrorTolerant(stricted, message);\n }\n strict = previousStrict;\n\n return delegate.markEnd(delegate.createFunctionExpression(id, params, [], body), startToken);\n }\n\n // 14 Program\n\n function parseSourceElement() {\n if (lookahead.type === Token.Keyword) {\n switch (lookahead.value) {\n case 'const':\n case 'let':\n return parseConstLetDeclaration(lookahead.value);\n case 'function':\n return parseFunctionDeclaration();\n default:\n return parseStatement();\n }\n }\n\n if (lookahead.type !== Token.EOF) {\n return parseStatement();\n }\n }\n\n function parseSourceElements() {\n var sourceElement, sourceElements = [], token, directive, firstRestricted;\n\n while (index < length) {\n token = lookahead;\n if (token.type !== Token.StringLiteral) {\n break;\n }\n\n sourceElement = parseSourceElement();\n sourceElements.push(sourceElement);\n if (sourceElement.expression.type !== Syntax.Literal) {\n // this is not directive\n break;\n }\n directive = source.slice(token.start + 1, token.end - 1);\n if (directive === 'use strict') {\n strict = true;\n if (firstRestricted) {\n throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);\n }\n } else {\n if (!firstRestricted && token.octal) {\n firstRestricted = token;\n }\n }\n }\n\n while (index < length) {\n sourceElement = parseSourceElement();\n /* istanbul ignore if */\n if (typeof sourceElement === 'undefined') {\n break;\n }\n sourceElements.push(sourceElement);\n }\n return sourceElements;\n }\n\n function parseProgram() {\n var body, startToken;\n\n skipComment();\n peek();\n startToken = lookahead;\n strict = false;\n\n body = parseSourceElements();\n return delegate.markEnd(delegate.createProgram(body), startToken);\n }\n\n function filterTokenLocation() {\n var i, entry, token, tokens = [];\n\n for (i = 0; i < extra.tokens.length; ++i) {\n entry = extra.tokens[i];\n token = {\n type: entry.type,\n value: entry.value\n };\n if (extra.range) {\n token.range = entry.range;\n }\n if (extra.loc) {\n token.loc = entry.loc;\n }\n tokens.push(token);\n }\n\n extra.tokens = tokens;\n }\n\n function tokenize(code, options) {\n var toString,\n token,\n tokens;\n\n toString = String;\n if (typeof code !== 'string' && !(code instanceof String)) {\n code = toString(code);\n }\n\n delegate = SyntaxTreeDelegate;\n source = code;\n index = 0;\n lineNumber = (source.length > 0) ? 1 : 0;\n lineStart = 0;\n length = source.length;\n lookahead = null;\n state = {\n allowIn: true,\n labelSet: {},\n inFunctionBody: false,\n inIteration: false,\n inSwitch: false,\n lastCommentStart: -1\n };\n\n extra = {};\n\n // Options matching.\n options = options || {};\n\n // Of course we collect tokens here.\n options.tokens = true;\n extra.tokens = [];\n extra.tokenize = true;\n // The following two fields are necessary to compute the Regex tokens.\n extra.openParenToken = -1;\n extra.openCurlyToken = -1;\n\n extra.range = (typeof options.range === 'boolean') && options.range;\n extra.loc = (typeof options.loc === 'boolean') && options.loc;\n\n if (typeof options.comment === 'boolean' && options.comment) {\n extra.comments = [];\n }\n if (typeof options.tolerant === 'boolean' && options.tolerant) {\n extra.errors = [];\n }\n\n try {\n peek();\n if (lookahead.type === Token.EOF) {\n return extra.tokens;\n }\n\n token = lex();\n while (lookahead.type !== Token.EOF) {\n try {\n token = lex();\n } catch (lexError) {\n token = lookahead;\n if (extra.errors) {\n extra.errors.push(lexError);\n // We have to break on the first error\n // to avoid infinite loops.\n break;\n } else {\n throw lexError;\n }\n }\n }\n\n filterTokenLocation();\n tokens = extra.tokens;\n if (typeof extra.comments !== 'undefined') {\n tokens.comments = extra.comments;\n }\n if (typeof extra.errors !== 'undefined') {\n tokens.errors = extra.errors;\n }\n } catch (e) {\n throw e;\n } finally {\n extra = {};\n }\n return tokens;\n }\n\n function parse(code, options) {\n var program, toString;\n\n toString = String;\n if (typeof code !== 'string' && !(code instanceof String)) {\n code = toString(code);\n }\n\n delegate = SyntaxTreeDelegate;\n source = code;\n index = 0;\n lineNumber = (source.length > 0) ? 1 : 0;\n lineStart = 0;\n length = source.length;\n lookahead = null;\n state = {\n allowIn: true,\n labelSet: {},\n inFunctionBody: false,\n inIteration: false,\n inSwitch: false,\n lastCommentStart: -1\n };\n\n extra = {};\n if (typeof options !== 'undefined') {\n extra.range = (typeof options.range === 'boolean') && options.range;\n extra.loc = (typeof options.loc === 'boolean') && options.loc;\n extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment;\n\n if (extra.loc && options.source !== null && options.source !== undefined) {\n extra.source = toString(options.source);\n }\n\n if (typeof options.tokens === 'boolean' && options.tokens) {\n extra.tokens = [];\n }\n if (typeof options.comment === 'boolean' && options.comment) {\n extra.comments = [];\n }\n if (typeof options.tolerant === 'boolean' && options.tolerant) {\n extra.errors = [];\n }\n if (extra.attachComment) {\n extra.range = true;\n extra.comments = [];\n extra.bottomRightStack = [];\n extra.trailingComments = [];\n extra.leadingComments = [];\n }\n }\n\n try {\n program = parseProgram();\n if (typeof extra.comments !== 'undefined') {\n program.comments = extra.comments;\n }\n if (typeof extra.tokens !== 'undefined') {\n filterTokenLocation();\n program.tokens = extra.tokens;\n }\n if (typeof extra.errors !== 'undefined') {\n program.errors = extra.errors;\n }\n } catch (e) {\n throw e;\n } finally {\n extra = {};\n }\n\n return program;\n }\n\n // Sync with *.json manifests.\n exports.version = '1.2.5';\n\n exports.tokenize = tokenize;\n\n exports.parse = parse;\n\n // Deep copy.\n /* istanbul ignore next */\n exports.Syntax = (function () {\n var name, types = {};\n\n if (typeof Object.create === 'function') {\n types = Object.create(null);\n }\n\n for (name in Syntax) {\n if (Syntax.hasOwnProperty(name)) {\n types[name] = Syntax[name];\n }\n }\n\n if (typeof Object.freeze === 'function') {\n Object.freeze(types);\n }\n\n return types;\n }());\n\n}));\n/* vim: set sw=4 ts=4 et tw=80 : */\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","'use strict';\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n","\"use strict\"\n\nfunction iota(n) {\n var result = new Array(n)\n for(var i=0; i\n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","\"use strict\";\n// Initial software, Jean-Daniel Fekete, Christian Poli, Copyright (c) Inria, BSD 3-Clause License, 2021\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.decompress = void 0;\nconst pako = require(\"pako\");\nconst lz4 = require(\"lz4js\");\nexports.decompress = {\n zlib: (input) => {\n return pako.inflate(new Uint8Array(input)).buffer;\n },\n lz4: (input) => {\n return lz4.decompress(new Uint8Array(input)).buffer;\n },\n};\n//# sourceMappingURL=compression.js.map","\"use strict\";\n// Initial software, Jean-Daniel Fekete, Christian Poli, Copyright (c) Inria, BSD 3-Clause License, 2021\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = exports.decompress = exports.rowProxy = exports.table_serialization = exports.EchoTableWidgetView = exports.EchoTableWidgetModel = exports.TableWidgetModel = void 0;\nvar widgets_1 = require(\"./widgets\");\nObject.defineProperty(exports, \"TableWidgetModel\", { enumerable: true, get: function () { return widgets_1.TableWidgetModel; } });\nObject.defineProperty(exports, \"EchoTableWidgetModel\", { enumerable: true, get: function () { return widgets_1.EchoTableWidgetModel; } });\nObject.defineProperty(exports, \"EchoTableWidgetView\", { enumerable: true, get: function () { return widgets_1.EchoTableWidgetView; } });\nvar serializers_1 = require(\"./serializers\");\nObject.defineProperty(exports, \"table_serialization\", { enumerable: true, get: function () { return serializers_1.table_serialization; } });\nObject.defineProperty(exports, \"rowProxy\", { enumerable: true, get: function () { return serializers_1.rowProxy; } });\nvar compression_1 = require(\"./compression\");\nObject.defineProperty(exports, \"decompress\", { enumerable: true, get: function () { return compression_1.decompress; } });\nexports.version = require('../package.json').version;\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Initial software, Jean-Daniel Fekete, Christian Poli, Copyright (c) Inria, BSD 3-Clause License, 2021\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.table_serialization = exports.tableToJSON = exports.rowProxy = exports.JSONToTable = void 0;\nconst ndarray = require(\"ndarray\");\nconst compression_1 = require(\"./compression\");\nconst dtypeToArray = {\n \"bool\": Uint8Array,\n int8: Int8Array,\n int16: Int16Array,\n int32: Int32Array,\n uint8: Uint8Array,\n uint16: Uint16Array,\n uint32: Uint32Array,\n float32: Float32Array,\n float64: Float64Array,\n str: Array\n};\nconst RowIndex = Symbol('rowIndex');\nfunction JSONToTable(obj, manager) {\n if (obj === null) {\n return null;\n }\n var data = {};\n var size = Infinity;\n let decoder = new TextDecoder(\"utf-8\");\n let buffer;\n for (const [col, val] of Object.entries(obj.data)) {\n // console.log(col, val);\n if (val.compression !== undefined) {\n let valBuffer = val.buffer;\n buffer = compression_1.decompress[val.compression](valBuffer.buffer);\n if (val.dtype === \"str\") {\n let u8buf = buffer;\n let strcol = decoder.decode(u8buf);\n let lstr = JSON.parse(strcol);\n data[col] = lstr;\n }\n else { //numeric\n data[col] = ndarray(new dtypeToArray[val.dtype](buffer), val.shape);\n size = Math.min(size, val.shape[0]);\n }\n }\n else { // no compression\n if (val.dtype === \"str\") {\n let lstr = val.buffer;\n data[col] = lstr;\n size = Math.min(size, lstr.length);\n }\n else { //numeric\n let valBuffer = val.buffer;\n data[col] = ndarray(new dtypeToArray[val.dtype](valBuffer.buffer), val.shape);\n size = Math.min(size, val.shape[0]);\n }\n }\n }\n var result = { columns: obj.columns, data: data, size: size };\n // console.log(\"result\", result);\n //let objFoo = obj.data.foo;\n return result;\n}\nexports.JSONToTable = JSONToTable;\nfunction rowProxy(table) {\n if (table === null) {\n return null;\n }\n var fields = table.columns;\n var proto = {};\n fields.forEach((name) => {\n const column = table.data[name];\n const arraycolumn = column;\n const stringcolumn = column;\n // skip columns with duplicate names\n if (proto.hasOwnProperty(name))\n return;\n if (arraycolumn.shape === undefined) {\n Object.defineProperty(proto, name, {\n get: function () {\n const i = this[RowIndex];\n return stringcolumn[i];\n },\n set: function () {\n throw Error('Arrow field values can not be overwritten.');\n },\n enumerable: true\n });\n }\n else {\n Object.defineProperty(proto, name, {\n get: function () {\n const i = this[RowIndex];\n const v = arraycolumn.get(i);\n return isNaN(v) ? null : v;\n },\n set: function () {\n throw Error('Arrow field values can not be overwritten.');\n },\n enumerable: true\n });\n }\n });\n return (i) => {\n var r = Object.create(proto);\n r[RowIndex] = i;\n return r;\n };\n}\nexports.rowProxy = rowProxy;\nfunction tableToJSON(obj, widget) {\n return null; // TODO: implement or remove ...\n}\nexports.tableToJSON = tableToJSON;\n/**\n * Serializers for to/from tables/dataframes\n */\nexports.table_serialization = { deserialize: JSONToTable, serialize: tableToJSON };\n//# sourceMappingURL=serializers.js.map","\"use strict\";\n// Initial software, Jean-Daniel Fekete, Christian Poli, Copyright (c) Inria, BSD 3-Clause License, 2021\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EchoTableWidgetView = exports.EchoTableWidgetModel = exports.TableWidgetModel = void 0;\nconst base_1 = require(\"@jupyter-widgets/base\");\nconst ndarray = require(\"ndarray\");\nconst ndarray_unpack = require(\"ndarray-unpack\");\nconst serializers_1 = require(\"./serializers\");\nlet version = require('../package.json').version;\nclass TableWidgetModel extends base_1.DOMWidgetModel {\n defaults() {\n return Object.assign(Object.assign({}, base_1.DOMWidgetModel.prototype.defaults()), { _model_name: \"TableWidgetModel\", _view_name: null, _model_module: 'jupyter-tablewidgets', _view_module: null, _model_module_version: version, _view_module_version: '', _table: ndarray([]), _columns: [] });\n }\n ;\n}\nexports.TableWidgetModel = TableWidgetModel;\nTableWidgetModel.serializers = Object.assign(Object.assign({}, base_1.DOMWidgetModel.serializers), { _table: serializers_1.table_serialization });\n// https://gist.github.com/pbugnion/63cf43b41ec0eed2d0b7e7426d1c67d2\nclass EchoTableWidgetModel extends base_1.DOMWidgetModel {\n defaults() {\n return Object.assign(Object.assign({}, base_1.DOMWidgetModel.prototype.defaults()), { _model_name: \"EchoTableWidgetModel\", _view_name: \"EchoTableWidgetView\", _model_module: 'jupyter-tablewidgets', _view_module: 'jupyter-tablewidgets', _model_module_version: version, _view_module_version: version, data: [], echo: [] });\n }\n ;\n}\nexports.EchoTableWidgetModel = EchoTableWidgetModel;\nEchoTableWidgetModel.serializers = Object.assign(Object.assign({}, base_1.DOMWidgetModel.serializers), { data: { deserialize: base_1.unpack_models } });\nclass EchoTableWidgetView extends base_1.DOMWidgetView {\n render() {\n return __awaiter(this, void 0, void 0, function* () {\n let that = this.model;\n let subwg = that.get(\"data\");\n let table = subwg.get(\"_table\");\n let res = { 'columns': table.columns, 'data': {} };\n for (const [col, v] of Object.entries(table.data)) {\n let val = v;\n if (val.dtype !== undefined) {\n res.data[col] = ndarray_unpack(val);\n }\n else {\n res.data[col] = val;\n }\n }\n that.set(\"echo\", res);\n this.touch();\n });\n }\n ;\n}\nexports.EchoTableWidgetView = EchoTableWidgetView;\n//# sourceMappingURL=widgets.js.map","// lz4.js - An implementation of Lz4 in plain JavaScript.\n//\n// TODO:\n// - Unify header parsing/writing.\n// - Support options (block size, checksums)\n// - Support streams\n// - Better error handling (handle bad offset, etc.)\n// - HC support (better search algorithm)\n// - Tests/benchmarking\n\nvar xxhash = require('./xxh32.js');\nvar util = require('./util.js');\n\n// Constants\n// --\n\n// Compression format parameters/constants.\nvar minMatch = 4;\nvar minLength = 13;\nvar searchLimit = 5;\nvar skipTrigger = 6;\nvar hashSize = 1 << 16;\n\n// Token constants.\nvar mlBits = 4;\nvar mlMask = (1 << mlBits) - 1;\nvar runBits = 4;\nvar runMask = (1 << runBits) - 1;\n\n// Shared buffers\nvar blockBuf = makeBuffer(5 << 20);\nvar hashTable = makeHashTable();\n\n// Frame constants.\nvar magicNum = 0x184D2204;\n\n// Frame descriptor flags.\nvar fdContentChksum = 0x4;\nvar fdContentSize = 0x8;\nvar fdBlockChksum = 0x10;\n// var fdBlockIndep = 0x20;\nvar fdVersion = 0x40;\nvar fdVersionMask = 0xC0;\n\n// Block sizes.\nvar bsUncompressed = 0x80000000;\nvar bsDefault = 7;\nvar bsShift = 4;\nvar bsMask = 7;\nvar bsMap = {\n 4: 0x10000,\n 5: 0x40000,\n 6: 0x100000,\n 7: 0x400000\n};\n\n// Utility functions/primitives\n// --\n\n// Makes our hashtable. On older browsers, may return a plain array.\nfunction makeHashTable () {\n try {\n return new Uint32Array(hashSize);\n } catch (error) {\n var hashTable = new Array(hashSize);\n\n for (var i = 0; i < hashSize; i++) {\n hashTable[i] = 0;\n }\n\n return hashTable;\n }\n}\n\n// Clear hashtable.\nfunction clearHashTable (table) {\n for (var i = 0; i < hashSize; i++) {\n hashTable[i] = 0;\n }\n}\n\n// Makes a byte buffer. On older browsers, may return a plain array.\nfunction makeBuffer (size) {\n try {\n return new Uint8Array(size);\n } catch (error) {\n var buf = new Array(size);\n\n for (var i = 0; i < size; i++) {\n buf[i] = 0;\n }\n\n return buf;\n }\n}\n\nfunction sliceArray (array, start, end) {\n if (typeof array.buffer !== undefined) {\n if (Uint8Array.prototype.slice) {\n return array.slice(start, end);\n } else {\n // Uint8Array#slice polyfill.\n var len = array.length;\n\n // Calculate start.\n start = start | 0;\n start = (start < 0) ? Math.max(len + start, 0) : Math.min(start, len);\n\n // Calculate end.\n end = (end === undefined) ? len : end | 0;\n end = (end < 0) ? Math.max(len + end, 0) : Math.min(end, len);\n\n // Copy into new array.\n var arraySlice = new Uint8Array(end - start);\n for (var i = start, n = 0; i < end;) {\n arraySlice[n++] = array[i++];\n }\n\n return arraySlice;\n }\n } else {\n // Assume normal array.\n return array.slice(start, end);\n }\n}\n\n// Implementation\n// --\n\n// Calculates an upper bound for lz4 compression.\nexports.compressBound = function compressBound (n) {\n return (n + (n / 255) + 16) | 0;\n};\n\n// Calculates an upper bound for lz4 decompression, by reading the data.\nexports.decompressBound = function decompressBound (src) {\n var sIndex = 0;\n\n // Read magic number\n if (util.readU32(src, sIndex) !== magicNum) {\n throw new Error('invalid magic number');\n }\n\n sIndex += 4;\n\n // Read descriptor\n var descriptor = src[sIndex++];\n\n // Check version\n if ((descriptor & fdVersionMask) !== fdVersion) {\n throw new Error('incompatible descriptor version ' + (descriptor & fdVersionMask));\n }\n\n // Read flags\n var useBlockSum = (descriptor & fdBlockChksum) !== 0;\n var useContentSize = (descriptor & fdContentSize) !== 0;\n\n // Read block size\n var bsIdx = (src[sIndex++] >> bsShift) & bsMask;\n\n if (bsMap[bsIdx] === undefined) {\n throw new Error('invalid block size ' + bsIdx);\n }\n\n var maxBlockSize = bsMap[bsIdx];\n\n // Get content size\n if (useContentSize) {\n return util.readU64(src, sIndex);\n }\n\n // Checksum\n sIndex++;\n\n // Read blocks.\n var maxSize = 0;\n while (true) {\n var blockSize = util.readU32(src, sIndex);\n sIndex += 4;\n\n if (blockSize & bsUncompressed) {\n blockSize &= ~bsUncompressed;\n maxSize += blockSize;\n } else {\n maxSize += maxBlockSize;\n }\n\n if (blockSize === 0) {\n return maxSize;\n }\n\n if (useBlockSum) {\n sIndex += 4;\n }\n\n sIndex += blockSize;\n }\n};\n\n// Creates a buffer of a given byte-size, falling back to plain arrays.\nexports.makeBuffer = makeBuffer;\n\n// Decompresses a block of Lz4.\nexports.decompressBlock = function decompressBlock (src, dst, sIndex, sLength, dIndex) {\n var mLength, mOffset, sEnd, n, i;\n\n // Setup initial state.\n sEnd = sIndex + sLength;\n\n // Consume entire input block.\n while (sIndex < sEnd) {\n var token = src[sIndex++];\n\n // Copy literals.\n var literalCount = (token >> 4);\n if (literalCount > 0) {\n // Parse length.\n if (literalCount === 0xf) {\n while (true) {\n literalCount += src[sIndex];\n if (src[sIndex++] !== 0xff) {\n break;\n }\n }\n }\n\n // Copy literals\n for (n = sIndex + literalCount; sIndex < n;) {\n dst[dIndex++] = src[sIndex++];\n }\n }\n\n if (sIndex >= sEnd) {\n break;\n }\n\n // Copy match.\n mLength = (token & 0xf);\n\n // Parse offset.\n mOffset = src[sIndex++] | (src[sIndex++] << 8);\n\n // Parse length.\n if (mLength === 0xf) {\n while (true) {\n mLength += src[sIndex];\n if (src[sIndex++] !== 0xff) {\n break;\n }\n }\n }\n\n mLength += minMatch;\n\n // Copy match.\n for (i = dIndex - mOffset, n = i + mLength; i < n;) {\n dst[dIndex++] = dst[i++] | 0;\n }\n }\n\n return dIndex;\n};\n\n// Compresses a block with Lz4.\nexports.compressBlock = function compressBlock (src, dst, sIndex, sLength, hashTable) {\n var mIndex, mAnchor, mLength, mOffset, mStep;\n var literalCount, dIndex, sEnd, n;\n\n // Setup initial state.\n dIndex = 0;\n sEnd = sLength + sIndex;\n mAnchor = sIndex;\n\n // Process only if block is large enough.\n if (sLength >= minLength) {\n var searchMatchCount = (1 << skipTrigger) + 3;\n\n // Consume until last n literals (Lz4 spec limitation.)\n while (sIndex + minMatch < sEnd - searchLimit) {\n var seq = util.readU32(src, sIndex);\n var hash = util.hashU32(seq) >>> 0;\n\n // Crush hash to 16 bits.\n hash = ((hash >> 16) ^ hash) >>> 0 & 0xffff;\n\n // Look for a match in the hashtable. NOTE: remove one; see below.\n mIndex = hashTable[hash] - 1;\n\n // Put pos in hash table. NOTE: add one so that zero = invalid.\n hashTable[hash] = sIndex + 1;\n\n // Determine if there is a match (within range.)\n if (mIndex < 0 || ((sIndex - mIndex) >>> 16) > 0 || util.readU32(src, mIndex) !== seq) {\n mStep = searchMatchCount++ >> skipTrigger;\n sIndex += mStep;\n continue;\n }\n\n searchMatchCount = (1 << skipTrigger) + 3;\n\n // Calculate literal count and offset.\n literalCount = sIndex - mAnchor;\n mOffset = sIndex - mIndex;\n\n // We've already matched one word, so get that out of the way.\n sIndex += minMatch;\n mIndex += minMatch;\n\n // Determine match length.\n // N.B.: mLength does not include minMatch, Lz4 adds it back\n // in decoding.\n mLength = sIndex;\n while (sIndex < sEnd - searchLimit && src[sIndex] === src[mIndex]) {\n sIndex++;\n mIndex++;\n }\n mLength = sIndex - mLength;\n\n // Write token + literal count.\n var token = mLength < mlMask ? mLength : mlMask;\n if (literalCount >= runMask) {\n dst[dIndex++] = (runMask << mlBits) + token;\n for (n = literalCount - runMask; n >= 0xff; n -= 0xff) {\n dst[dIndex++] = 0xff;\n }\n dst[dIndex++] = n;\n } else {\n dst[dIndex++] = (literalCount << mlBits) + token;\n }\n\n // Write literals.\n for (var i = 0; i < literalCount; i++) {\n dst[dIndex++] = src[mAnchor + i];\n }\n\n // Write offset.\n dst[dIndex++] = mOffset;\n dst[dIndex++] = (mOffset >> 8);\n\n // Write match length.\n if (mLength >= mlMask) {\n for (n = mLength - mlMask; n >= 0xff; n -= 0xff) {\n dst[dIndex++] = 0xff;\n }\n dst[dIndex++] = n;\n }\n\n // Move the anchor.\n mAnchor = sIndex;\n }\n }\n\n // Nothing was encoded.\n if (mAnchor === 0) {\n return 0;\n }\n\n // Write remaining literals.\n // Write literal token+count.\n literalCount = sEnd - mAnchor;\n if (literalCount >= runMask) {\n dst[dIndex++] = (runMask << mlBits);\n for (n = literalCount - runMask; n >= 0xff; n -= 0xff) {\n dst[dIndex++] = 0xff;\n }\n dst[dIndex++] = n;\n } else {\n dst[dIndex++] = (literalCount << mlBits);\n }\n\n // Write literals.\n sIndex = mAnchor;\n while (sIndex < sEnd) {\n dst[dIndex++] = src[sIndex++];\n }\n\n return dIndex;\n};\n\n// Decompresses a frame of Lz4 data.\nexports.decompressFrame = function decompressFrame (src, dst) {\n var useBlockSum, useContentSum, useContentSize, descriptor;\n var sIndex = 0;\n var dIndex = 0;\n\n // Read magic number\n if (util.readU32(src, sIndex) !== magicNum) {\n throw new Error('invalid magic number');\n }\n\n sIndex += 4;\n\n // Read descriptor\n descriptor = src[sIndex++];\n\n // Check version\n if ((descriptor & fdVersionMask) !== fdVersion) {\n throw new Error('incompatible descriptor version');\n }\n\n // Read flags\n useBlockSum = (descriptor & fdBlockChksum) !== 0;\n useContentSum = (descriptor & fdContentChksum) !== 0;\n useContentSize = (descriptor & fdContentSize) !== 0;\n\n // Read block size\n var bsIdx = (src[sIndex++] >> bsShift) & bsMask;\n\n if (bsMap[bsIdx] === undefined) {\n throw new Error('invalid block size');\n }\n\n if (useContentSize) {\n // TODO: read content size\n sIndex += 8;\n }\n\n sIndex++;\n\n // Read blocks.\n while (true) {\n var compSize;\n\n compSize = util.readU32(src, sIndex);\n sIndex += 4;\n\n if (compSize === 0) {\n break;\n }\n\n if (useBlockSum) {\n // TODO: read block checksum\n sIndex += 4;\n }\n\n // Check if block is compressed\n if ((compSize & bsUncompressed) !== 0) {\n // Mask off the 'uncompressed' bit\n compSize &= ~bsUncompressed;\n\n // Copy uncompressed data into destination buffer.\n for (var j = 0; j < compSize; j++) {\n dst[dIndex++] = src[sIndex++];\n }\n } else {\n // Decompress into blockBuf\n dIndex = exports.decompressBlock(src, dst, sIndex, compSize, dIndex);\n sIndex += compSize;\n }\n }\n\n if (useContentSum) {\n // TODO: read content checksum\n sIndex += 4;\n }\n\n return dIndex;\n};\n\n// Compresses data to an Lz4 frame.\nexports.compressFrame = function compressFrame (src, dst) {\n var dIndex = 0;\n\n // Write magic number.\n util.writeU32(dst, dIndex, magicNum);\n dIndex += 4;\n\n // Descriptor flags.\n dst[dIndex++] = fdVersion;\n dst[dIndex++] = bsDefault << bsShift;\n\n // Descriptor checksum.\n dst[dIndex] = xxhash.hash(0, dst, 4, dIndex - 4) >> 8;\n dIndex++;\n\n // Write blocks.\n var maxBlockSize = bsMap[bsDefault];\n var remaining = src.length;\n var sIndex = 0;\n\n // Clear the hashtable.\n clearHashTable(hashTable);\n\n // Split input into blocks and write.\n while (remaining > 0) {\n var compSize = 0;\n var blockSize = remaining > maxBlockSize ? maxBlockSize : remaining;\n\n compSize = exports.compressBlock(src, blockBuf, sIndex, blockSize, hashTable);\n\n if (compSize > blockSize || compSize === 0) {\n // Output uncompressed.\n util.writeU32(dst, dIndex, 0x80000000 | blockSize);\n dIndex += 4;\n\n for (var z = sIndex + blockSize; sIndex < z;) {\n dst[dIndex++] = src[sIndex++];\n }\n\n remaining -= blockSize;\n } else {\n // Output compressed.\n util.writeU32(dst, dIndex, compSize);\n dIndex += 4;\n\n for (var j = 0; j < compSize;) {\n dst[dIndex++] = blockBuf[j++];\n }\n\n sIndex += blockSize;\n remaining -= blockSize;\n }\n }\n\n // Write blank end block.\n util.writeU32(dst, dIndex, 0);\n dIndex += 4;\n\n return dIndex;\n};\n\n// Decompresses a buffer containing an Lz4 frame. maxSize is optional; if not\n// provided, a maximum size will be determined by examining the data. The\n// buffer returned will always be perfectly-sized.\nexports.decompress = function decompress (src, maxSize) {\n var dst, size;\n\n if (maxSize === undefined) {\n maxSize = exports.decompressBound(src);\n }\n\n dst = exports.makeBuffer(maxSize);\n size = exports.decompressFrame(src, dst);\n\n if (size !== maxSize) {\n dst = sliceArray(dst, 0, size);\n }\n\n return dst;\n};\n\n// Compresses a buffer to an Lz4 frame. maxSize is optional; if not provided,\n// a buffer will be created based on the theoretical worst output size for a\n// given input size. The buffer returned will always be perfectly-sized.\nexports.compress = function compress (src, maxSize) {\n var dst, size;\n\n if (maxSize === undefined) {\n maxSize = exports.compressBound(src.length);\n }\n\n dst = exports.makeBuffer(maxSize);\n size = exports.compressFrame(src, dst);\n\n if (size !== maxSize) {\n dst = sliceArray(dst, 0, size);\n }\n\n return dst;\n};\n","// Simple hash function, from: http://burtleburtle.net/bob/hash/integer.html.\n// Chosen because it doesn't use multiply and achieves full avalanche.\nexports.hashU32 = function hashU32 (a) {\n a = a | 0;\n a = a + 2127912214 + (a << 12) | 0;\n a = a ^ -949894596 ^ a >>> 19;\n a = a + 374761393 + (a << 5) | 0;\n a = a + -744332180 ^ a << 9;\n a = a + -42973499 + (a << 3) | 0;\n return a ^ -1252372727 ^ a >>> 16 | 0;\n};\n\n// Reads a 64-bit little-endian integer from an array.\nexports.readU64 = function readU64 (b, n) {\n var x = 0;\n x |= b[n++] << 0;\n x |= b[n++] << 8;\n x |= b[n++] << 16;\n x |= b[n++] << 24;\n x |= b[n++] << 32;\n x |= b[n++] << 40;\n x |= b[n++] << 48;\n x |= b[n++] << 56;\n return x;\n};\n\n// Reads a 32-bit little-endian integer from an array.\nexports.readU32 = function readU32 (b, n) {\n var x = 0;\n x |= b[n++] << 0;\n x |= b[n++] << 8;\n x |= b[n++] << 16;\n x |= b[n++] << 24;\n return x;\n};\n\n// Writes a 32-bit little-endian integer from an array.\nexports.writeU32 = function writeU32 (b, n, x) {\n b[n++] = (x >> 0) & 0xff;\n b[n++] = (x >> 8) & 0xff;\n b[n++] = (x >> 16) & 0xff;\n b[n++] = (x >> 24) & 0xff;\n};\n\n// Multiplies two numbers using 32-bit integer multiplication.\n// Algorithm from Emscripten.\nexports.imul = function imul (a, b) {\n var ah = a >>> 16;\n var al = a & 65535;\n var bh = b >>> 16;\n var bl = b & 65535;\n\n return al * bl + (ah * bl + al * bh << 16) | 0;\n};\n","// xxh32.js - implementation of xxhash32 in plain JavaScript\nvar util = require('./util.js');\n\n// xxhash32 primes\nvar prime1 = 0x9e3779b1;\nvar prime2 = 0x85ebca77;\nvar prime3 = 0xc2b2ae3d;\nvar prime4 = 0x27d4eb2f;\nvar prime5 = 0x165667b1;\n\n// Utility functions/primitives\n// --\n\nfunction rotl32 (x, r) {\n x = x | 0;\n r = r | 0;\n\n return x >>> (32 - r | 0) | x << r | 0;\n}\n\nfunction rotmul32 (h, r, m) {\n h = h | 0;\n r = r | 0;\n m = m | 0;\n\n return util.imul(h >>> (32 - r | 0) | h << r, m) | 0;\n}\n\nfunction shiftxor32 (h, s) {\n h = h | 0;\n s = s | 0;\n\n return h >>> s ^ h | 0;\n}\n\n// Implementation\n// --\n\nfunction xxhapply (h, src, m0, s, m1) {\n return rotmul32(util.imul(src, m0) + h, s, m1);\n}\n\nfunction xxh1 (h, src, index) {\n return rotmul32((h + util.imul(src[index], prime5)), 11, prime1);\n}\n\nfunction xxh4 (h, src, index) {\n return xxhapply(h, util.readU32(src, index), prime3, 17, prime4);\n}\n\nfunction xxh16 (h, src, index) {\n return [\n xxhapply(h[0], util.readU32(src, index + 0), prime2, 13, prime1),\n xxhapply(h[1], util.readU32(src, index + 4), prime2, 13, prime1),\n xxhapply(h[2], util.readU32(src, index + 8), prime2, 13, prime1),\n xxhapply(h[3], util.readU32(src, index + 12), prime2, 13, prime1)\n ];\n}\n\nfunction xxh32 (seed, src, index, len) {\n var h, l;\n l = len;\n if (len >= 16) {\n h = [\n seed + prime1 + prime2,\n seed + prime2,\n seed,\n seed - prime1\n ];\n\n while (len >= 16) {\n h = xxh16(h, src, index);\n\n index += 16;\n len -= 16;\n }\n\n h = rotl32(h[0], 1) + rotl32(h[1], 7) + rotl32(h[2], 12) + rotl32(h[3], 18) + l;\n } else {\n h = (seed + prime5 + len) >>> 0;\n }\n\n while (len >= 4) {\n h = xxh4(h, src, index);\n\n index += 4;\n len -= 4;\n }\n\n while (len > 0) {\n h = xxh1(h, src, index);\n\n index++;\n len--;\n }\n\n h = shiftxor32(util.imul(shiftxor32(util.imul(shiftxor32(h, 15), prime2), 13), prime3), 16);\n\n return h >>> 0;\n}\n\nexports.hash = xxh32;\n","\"use strict\"\n\nvar dup = require(\"dup\")\nvar cwise = require(\"cwise\")\n\nvar do_unpack = cwise({ \n args: [\"array\", \"scalar\", \"index\"],\n body: function unpackCwise(arr, a, idx) {\n var v = a, i\n for(i=0;iMath.abs(this.stride[1]))?[1,0]:[0,1]}})\")\n } else if(dimension === 3) {\n code.push(\n\"var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);\\\nif(s0>s1){\\\nif(s1>s2){\\\nreturn [2,1,0];\\\n}else if(s0>s2){\\\nreturn [1,2,0];\\\n}else{\\\nreturn [1,0,2];\\\n}\\\n}else if(s0>s2){\\\nreturn [2,0,1];\\\n}else if(s2>s1){\\\nreturn [0,1,2];\\\n}else{\\\nreturn [0,2,1];\\\n}}})\")\n }\n } else {\n code.push(\"ORDER})\")\n }\n }\n\n //view.set(i0, ..., v):\n code.push(\n\"proto.set=function \"+className+\"_set(\"+args.join(\",\")+\",v){\")\n if(useGetters) {\n code.push(\"return this.data.set(\"+index_str+\",v)}\")\n } else {\n code.push(\"return this.data[\"+index_str+\"]=v}\")\n }\n\n //view.get(i0, ...):\n code.push(\"proto.get=function \"+className+\"_get(\"+args.join(\",\")+\"){\")\n if(useGetters) {\n code.push(\"return this.data.get(\"+index_str+\")}\")\n } else {\n code.push(\"return this.data[\"+index_str+\"]}\")\n }\n\n //view.index:\n code.push(\n \"proto.index=function \"+className+\"_index(\", args.join(), \"){return \"+index_str+\"}\")\n\n //view.hi():\n code.push(\"proto.hi=function \"+className+\"_hi(\"+args.join(\",\")+\"){return new \"+className+\"(this.data,\"+\n indices.map(function(i) {\n return [\"(typeof i\",i,\"!=='number'||i\",i,\"<0)?this.shape[\", i, \"]:i\", i,\"|0\"].join(\"\")\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"this.stride[\"+i + \"]\"\n }).join(\",\")+\",this.offset)}\")\n\n //view.lo():\n var a_vars = indices.map(function(i) { return \"a\"+i+\"=this.shape[\"+i+\"]\" })\n var c_vars = indices.map(function(i) { return \"c\"+i+\"=this.stride[\"+i+\"]\" })\n code.push(\"proto.lo=function \"+className+\"_lo(\"+args.join(\",\")+\"){var b=this.offset,d=0,\"+a_vars.join(\",\")+\",\"+c_vars.join(\",\"))\n for(var i=0; i=0){\\\nd=i\"+i+\"|0;\\\nb+=c\"+i+\"*d;\\\na\"+i+\"-=d}\")\n }\n code.push(\"return new \"+className+\"(this.data,\"+\n indices.map(function(i) {\n return \"a\"+i\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"c\"+i\n }).join(\",\")+\",b)}\")\n\n //view.step():\n code.push(\"proto.step=function \"+className+\"_step(\"+args.join(\",\")+\"){var \"+\n indices.map(function(i) {\n return \"a\"+i+\"=this.shape[\"+i+\"]\"\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"b\"+i+\"=this.stride[\"+i+\"]\"\n }).join(\",\")+\",c=this.offset,d=0,ceil=Math.ceil\")\n for(var i=0; i=0){c=(c+this.stride[\"+i+\"]*i\"+i+\")|0}else{a.push(this.shape[\"+i+\"]);b.push(this.stride[\"+i+\"])}\")\n }\n code.push(\"var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}\")\n\n //Add return statement\n code.push(\"return function construct_\"+className+\"(data,shape,stride,offset){return new \"+className+\"(data,\"+\n indices.map(function(i) {\n return \"shape[\"+i+\"]\"\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"stride[\"+i+\"]\"\n }).join(\",\")+\",offset)}\")\n\n //Compile procedure\n var procedure = new Function(\"CTOR_LIST\", \"ORDER\", code.join(\"\\n\"))\n return procedure(CACHED_CONSTRUCTORS[dtype], order)\n}\n\nfunction arrayDType(data) {\n if(isBuffer(data)) {\n return \"buffer\"\n }\n if(hasTypedArrays) {\n switch(Object.prototype.toString.call(data)) {\n case \"[object Float64Array]\":\n return \"float64\"\n case \"[object Float32Array]\":\n return \"float32\"\n case \"[object Int8Array]\":\n return \"int8\"\n case \"[object Int16Array]\":\n return \"int16\"\n case \"[object Int32Array]\":\n return \"int32\"\n case \"[object Uint8Array]\":\n return \"uint8\"\n case \"[object Uint16Array]\":\n return \"uint16\"\n case \"[object Uint32Array]\":\n return \"uint32\"\n case \"[object Uint8ClampedArray]\":\n return \"uint8_clamped\"\n case \"[object BigInt64Array]\":\n return \"bigint64\"\n case \"[object BigUint64Array]\":\n return \"biguint64\"\n }\n }\n if(Array.isArray(data)) {\n return \"array\"\n }\n return \"generic\"\n}\n\nvar CACHED_CONSTRUCTORS = {\n \"float32\":[],\n \"float64\":[],\n \"int8\":[],\n \"int16\":[],\n \"int32\":[],\n \"uint8\":[],\n \"uint16\":[],\n \"uint32\":[],\n \"array\":[],\n \"uint8_clamped\":[],\n \"bigint64\": [],\n \"biguint64\": [],\n \"buffer\":[],\n \"generic\":[]\n}\n\n;(function() {\n for(var id in CACHED_CONSTRUCTORS) {\n CACHED_CONSTRUCTORS[id].push(compileConstructor(id, -1))\n }\n});\n\nfunction wrappedNDArrayCtor(data, shape, stride, offset) {\n if(data === undefined) {\n var ctor = CACHED_CONSTRUCTORS.array[0]\n return ctor([])\n } else if(typeof data === \"number\") {\n data = [data]\n }\n if(shape === undefined) {\n shape = [ data.length ]\n }\n var d = shape.length\n if(stride === undefined) {\n stride = new Array(d)\n for(var i=d-1, sz=1; i>=0; --i) {\n stride[i] = sz\n sz *= shape[i]\n }\n }\n if(offset === undefined) {\n offset = 0\n for(var i=0; i Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param).\n **/\n\n/**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n **/\n\n/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\n\n/**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw deflate\n * - `gzip` (Boolean) - create gzip wrapper\n * - `header` (Object) - custom header for gzip\n * - `text` (Boolean) - true if compressed data believed to be text\n * - `time` (Number) - modification time, unix timestamp\n * - `os` (Number) - operation system code\n * - `extra` (Array) - array of bytes with extra data (max 65536)\n * - `name` (String) - file name (binary string)\n * - `comment` (String) - comment (binary string)\n * - `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * , chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true); // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n **/\nfunction Deflate(options) {\n this.options = utils.assign({\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY\n }, options || {});\n\n let opt = this.options;\n\n if (opt.raw && (opt.windowBits > 0)) {\n opt.windowBits = -opt.windowBits;\n }\n\n else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n opt.windowBits += 16;\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n let status = zlib_deflate.deflateInit2(\n this.strm,\n opt.level,\n opt.method,\n opt.windowBits,\n opt.memLevel,\n opt.strategy\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n if (opt.header) {\n zlib_deflate.deflateSetHeader(this.strm, opt.header);\n }\n\n if (opt.dictionary) {\n let dict;\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n // If we need to compress text, change encoding to utf8.\n dict = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(opt.dictionary);\n } else {\n dict = opt.dictionary;\n }\n\n status = zlib_deflate.deflateSetDictionary(this.strm, dict);\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this._dict_set = true;\n }\n}\n\n/**\n * Deflate#push(data[, flush_mode]) -> Boolean\n * - data (Uint8Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with\n * new compressed chunks. Returns `true` on success. The last data block must\n * have `flush_mode` Z_FINISH (or `true`). That will flush internal pending\n * buffers and call [[Deflate#onEnd]].\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nDeflate.prototype.push = function (data, flush_mode) {\n const strm = this.strm;\n const chunkSize = this.options.chunkSize;\n let status, _flush_mode;\n\n if (this.ended) { return false; }\n\n if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;\n else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH;\n\n // Convert data if needed\n if (typeof data === 'string') {\n // If we need to compress text, change encoding to utf8.\n strm.input = strings.string2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n for (;;) {\n if (strm.avail_out === 0) {\n strm.output = new Uint8Array(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n // Make sure avail_out > 6 to avoid repeating markers\n if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH) && strm.avail_out <= 6) {\n this.onData(strm.output.subarray(0, strm.next_out));\n strm.avail_out = 0;\n continue;\n }\n\n status = zlib_deflate.deflate(strm, _flush_mode);\n\n // Ended => flush and finish\n if (status === Z_STREAM_END) {\n if (strm.next_out > 0) {\n this.onData(strm.output.subarray(0, strm.next_out));\n }\n status = zlib_deflate.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK;\n }\n\n // Flush if out buffer full\n if (strm.avail_out === 0) {\n this.onData(strm.output);\n continue;\n }\n\n // Flush if requested and has data\n if (_flush_mode > 0 && strm.next_out > 0) {\n this.onData(strm.output.subarray(0, strm.next_out));\n strm.avail_out = 0;\n continue;\n }\n\n if (strm.avail_in === 0) break;\n }\n\n return true;\n};\n\n\n/**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array): output data.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nDeflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Deflate#onEnd(status) -> Void\n * - status (Number): deflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called once after you tell deflate that the input stream is\n * complete (Z_FINISH). By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nDeflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n this.result = utils.flattenChunks(this.chunks);\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * deflate(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\n *\n * - level\n * - windowBits\n * - memLevel\n * - strategy\n * - dictionary\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * const data = new Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate(input, options) {\n const deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}\n\n\nmodule.exports.Deflate = Deflate;\nmodule.exports.deflate = deflate;\nmodule.exports.deflateRaw = deflateRaw;\nmodule.exports.gzip = gzip;\nmodule.exports.constants = require('./zlib/constants');\n","'use strict';\n\n\nconst zlib_inflate = require('./zlib/inflate');\nconst utils = require('./utils/common');\nconst strings = require('./utils/strings');\nconst msg = require('./zlib/messages');\nconst ZStream = require('./zlib/zstream');\nconst GZheader = require('./zlib/gzheader');\n\nconst toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH, Z_FINISH,\n Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR\n} = require('./zlib/constants');\n\n/* ===========================================================================*/\n\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * const chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * const chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate(options) {\n this.options = utils.assign({\n chunkSize: 1024 * 64,\n windowBits: 15,\n to: ''\n }, options || {});\n\n const opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n let status = zlib_inflate.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this.header = new GZheader();\n\n zlib_inflate.inflateGetHeader(this.strm, this.header);\n\n // Setup dictionary\n if (opt.dictionary) {\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n opt.dictionary = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n opt.dictionary = new Uint8Array(opt.dictionary);\n }\n if (opt.raw) { //In raw mode we need to set the dictionary early\n status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n }\n }\n}\n\n/**\n * Inflate#push(data[, flush_mode]) -> Boolean\n * - data (Uint8Array|ArrayBuffer): input data\n * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE\n * flush modes. See constants. Skipped or `false` means Z_NO_FLUSH,\n * `true` means Z_FINISH.\n *\n * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. If end of stream detected,\n * [[Inflate#onEnd]] will be called.\n *\n * `flush_mode` is not needed for normal operation, because end of stream\n * detected automatically. You may try to use it for advanced things, but\n * this functionality was not tested.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nInflate.prototype.push = function (data, flush_mode) {\n const strm = this.strm;\n const chunkSize = this.options.chunkSize;\n const dictionary = this.options.dictionary;\n let status, _flush_mode, last_avail_out;\n\n if (this.ended) return false;\n\n if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;\n else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH;\n\n // Convert data if needed\n if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n for (;;) {\n if (strm.avail_out === 0) {\n strm.output = new Uint8Array(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = zlib_inflate.inflate(strm, _flush_mode);\n\n if (status === Z_NEED_DICT && dictionary) {\n status = zlib_inflate.inflateSetDictionary(strm, dictionary);\n\n if (status === Z_OK) {\n status = zlib_inflate.inflate(strm, _flush_mode);\n } else if (status === Z_DATA_ERROR) {\n // Replace code with more verbose\n status = Z_NEED_DICT;\n }\n }\n\n // Skip snyc markers if more data follows and not raw mode\n while (strm.avail_in > 0 &&\n status === Z_STREAM_END &&\n strm.state.wrap > 0 &&\n data[strm.next_in] !== 0)\n {\n zlib_inflate.inflateReset(strm);\n status = zlib_inflate.inflate(strm, _flush_mode);\n }\n\n switch (status) {\n case Z_STREAM_ERROR:\n case Z_DATA_ERROR:\n case Z_NEED_DICT:\n case Z_MEM_ERROR:\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n // Remember real `avail_out` value, because we may patch out buffer content\n // to align utf8 strings boundaries.\n last_avail_out = strm.avail_out;\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === Z_STREAM_END) {\n\n if (this.options.to === 'string') {\n\n let next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n let tail = strm.next_out - next_out_utf8;\n let utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail & realign counters\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) strm.output.set(strm.output.subarray(next_out_utf8, next_out_utf8 + tail), 0);\n\n this.onData(utf8str);\n\n } else {\n this.onData(strm.output.length === strm.next_out ? strm.output : strm.output.subarray(0, strm.next_out));\n }\n }\n }\n\n // Must repeat iteration if out buffer is full\n if (status === Z_OK && last_avail_out === 0) continue;\n\n // Finalize if end of stream reached.\n if (status === Z_STREAM_END) {\n status = zlib_inflate.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return true;\n }\n\n if (strm.avail_in === 0) break;\n }\n\n return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|String): output data. When string output requested,\n * each chunk will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nInflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH). By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako');\n * const input = pako.deflate(new Uint8Array([1,2,3,4,5,6,7,8,9]));\n * let output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err) {\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate(input, options) {\n const inflator = new Inflate(options);\n\n inflator.push(input);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) throw inflator.msg || msg[inflator.err];\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nmodule.exports.Inflate = Inflate;\nmodule.exports.inflate = inflate;\nmodule.exports.inflateRaw = inflateRaw;\nmodule.exports.ungzip = inflate;\nmodule.exports.constants = require('./zlib/constants');\n","'use strict';\n\n\nconst _has = (obj, key) => {\n return Object.prototype.hasOwnProperty.call(obj, key);\n};\n\nmodule.exports.assign = function (obj /*from1, from2, from3, ...*/) {\n const sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n const source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (const p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// Join array of chunks to single array.\nmodule.exports.flattenChunks = (chunks) => {\n // calculate data length\n let len = 0;\n\n for (let i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n const result = new Uint8Array(len);\n\n for (let i = 0, pos = 0, l = chunks.length; i < l; i++) {\n let chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n};\n","// String encode/decode helpers\n'use strict';\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nlet STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nconst _utf8len = new Uint8Array(256);\nfor (let q = 0; q < 256; q++) {\n _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nmodule.exports.string2buf = (str) => {\n if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) {\n return new TextEncoder().encode(str);\n }\n\n let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n buf = new Uint8Array(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n};\n\n// Helper\nconst buf2binstring = (buf, len) => {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if (buf.subarray && STR_APPLY_UIA_OK) {\n return String.fromCharCode.apply(null, buf.length === len ? buf : buf.subarray(0, len));\n }\n }\n\n let result = '';\n for (let i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n};\n\n\n// convert array to string\nmodule.exports.buf2string = (buf, max) => {\n const len = max || buf.length;\n\n if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) {\n return new TextDecoder().decode(buf.subarray(0, max));\n }\n\n let i, out;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n const utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n let c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n let c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nmodule.exports.utf8border = (buf, max) => {\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n let pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n","'use strict';\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst adler32 = (adler, buf, len, pos) => {\n let s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n};\n\n\nmodule.exports = adler32;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n","'use strict';\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nconst makeTable = () => {\n let c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n};\n\n// Create table on load. Just 255 signed longs. Not a problem.\nconst crcTable = new Uint32Array(makeTable());\n\n\nconst crc32 = (crc, buf, len, pos) => {\n const t = crcTable;\n const end = pos + len;\n\n crc ^= -1;\n\n for (let i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n};\n\n\nmodule.exports = crc32;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst { _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align } = require('./trees');\nconst adler32 = require('./adler32');\nconst crc32 = require('./crc32');\nconst msg = require('./messages');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH, Z_PARTIAL_FLUSH, Z_FULL_FLUSH, Z_FINISH, Z_BLOCK,\n Z_OK, Z_STREAM_END, Z_STREAM_ERROR, Z_DATA_ERROR, Z_BUF_ERROR,\n Z_DEFAULT_COMPRESSION,\n Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED, Z_DEFAULT_STRATEGY,\n Z_UNKNOWN,\n Z_DEFLATED\n} = require('./constants');\n\n/*============================================================================*/\n\n\nconst MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nconst MAX_WBITS = 15;\n/* 32K LZ77 window */\nconst DEF_MEM_LEVEL = 8;\n\n\nconst LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nconst LITERALS = 256;\n/* number of literal bytes 0..255 */\nconst L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nconst D_CODES = 30;\n/* number of distance codes */\nconst BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nconst HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nconst MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\nconst MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nconst PRESET_DICT = 0x20;\n\nconst INIT_STATE = 42; /* zlib header -> BUSY_STATE */\n//#ifdef GZIP\nconst GZIP_STATE = 57; /* gzip header -> BUSY_STATE | EXTRA_STATE */\n//#endif\nconst EXTRA_STATE = 69; /* gzip extra block -> NAME_STATE */\nconst NAME_STATE = 73; /* gzip file name -> COMMENT_STATE */\nconst COMMENT_STATE = 91; /* gzip comment -> HCRC_STATE */\nconst HCRC_STATE = 103; /* gzip header CRC -> BUSY_STATE */\nconst BUSY_STATE = 113; /* deflate -> FINISH_STATE */\nconst FINISH_STATE = 666; /* stream complete */\n\nconst BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nconst BS_BLOCK_DONE = 2; /* block flush performed */\nconst BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nconst BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nconst OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nconst err = (strm, errorCode) => {\n strm.msg = msg[errorCode];\n return errorCode;\n};\n\nconst rank = (f) => {\n return ((f) * 2) - ((f) > 4 ? 9 : 0);\n};\n\nconst zero = (buf) => {\n let len = buf.length; while (--len >= 0) { buf[len] = 0; }\n};\n\n/* ===========================================================================\n * Slide the hash table when sliding the window down (could be avoided with 32\n * bit values at the expense of memory usage). We slide even when level == 0 to\n * keep the hash table consistent if we switch back to level > 0 later.\n */\nconst slide_hash = (s) => {\n let n, m;\n let p;\n let wsize = s.w_size;\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= wsize ? m - wsize : 0);\n } while (--n);\n n = wsize;\n//#ifndef FASTEST\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= wsize ? m - wsize : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n//#endif\n};\n\n/* eslint-disable new-cap */\nlet HASH_ZLIB = (s, prev, data) => ((prev << s.hash_shift) ^ data) & s.hash_mask;\n// This hash causes less collisions, https://github.com/nodeca/pako/issues/135\n// But breaks binary compatibility\n//let HASH_FAST = (s, prev, data) => ((prev << 8) + (prev >> 8) + (data << 4)) & s.hash_mask;\nlet HASH = HASH_ZLIB;\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output, except for\n * some deflate_stored() output, goes through this function so some\n * applications may wish to modify it to avoid allocating a large\n * strm->next_out buffer and copying into it. (See also read_buf()).\n */\nconst flush_pending = (strm) => {\n const s = strm.state;\n\n //_tr_flush_bits(s);\n let len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n strm.output.set(s.pending_buf.subarray(s.pending_out, s.pending_out + len), strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n};\n\n\nconst flush_block_only = (s, last) => {\n _tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n};\n\n\nconst put_byte = (s, b) => {\n s.pending_buf[s.pending++] = b;\n};\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nconst putShortMSB = (s, b) => {\n\n // put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n};\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nconst read_buf = (strm, buf, start, size) => {\n\n let len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n buf.set(strm.input.subarray(strm.next_in, strm.next_in + len), start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n};\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nconst longest_match = (s, cur_match) => {\n\n let chain_length = s.max_chain_length; /* max hash chain length */\n let scan = s.strstart; /* current string */\n let match; /* matched string */\n let len; /* length of current match */\n let best_len = s.prev_length; /* best match length so far */\n let nice_match = s.nice_match; /* stop if match long enough */\n const limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n const _win = s.window; // shortcut\n\n const wmask = s.w_mask;\n const prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n const strend = s.strstart + MAX_MATCH;\n let scan_end1 = _win[scan + best_len - 1];\n let scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n};\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nconst fill_window = (s) => {\n\n const _w_size = s.w_size;\n let n, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n s.window.set(s.window.subarray(_w_size, _w_size + _w_size - more), 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n slide_hash(s);\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + 1]);\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]);\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// const curr = s.strstart + s.lookahead;\n// let init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n};\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n *\n * In case deflateParams() is used to later switch to a non-zero compression\n * level, s->matches (otherwise unused when storing) keeps track of the number\n * of hash table slides to perform. If s->matches is 1, then one hash table\n * slide will be done when switching. If s->matches is 2, the maximum value\n * allowed here, then the hash table will be cleared, since two or more slides\n * is the same as a clear.\n *\n * deflate_stored() is written to minimize the number of times an input byte is\n * copied. It is most efficient with large input and output buffers, which\n * maximizes the opportunites to have a single copy from next_in to next_out.\n */\nconst deflate_stored = (s, flush) => {\n\n /* Smallest worthy block size when not flushing or finishing. By default\n * this is 32K. This can be as small as 507 bytes for memLevel == 1. For\n * large input and output buffers, the stored block size will be larger.\n */\n let min_block = s.pending_buf_size - 5 > s.w_size ? s.w_size : s.pending_buf_size - 5;\n\n /* Copy as many min_block or larger stored blocks directly to next_out as\n * possible. If flushing, copy the remaining available input to next_out as\n * stored blocks, if there is enough space.\n */\n let len, left, have, last = 0;\n let used = s.strm.avail_in;\n do {\n /* Set len to the maximum size block that we can copy directly with the\n * available input data and output space. Set left to how much of that\n * would be copied from what's left in the window.\n */\n len = 65535/* MAX_STORED */; /* maximum deflate stored block length */\n have = (s.bi_valid + 42) >> 3; /* number of header bytes */\n if (s.strm.avail_out < have) { /* need room for header */\n break;\n }\n /* maximum stored block length that will fit in avail_out: */\n have = s.strm.avail_out - have;\n left = s.strstart - s.block_start; /* bytes left in window */\n if (len > left + s.strm.avail_in) {\n len = left + s.strm.avail_in; /* limit len to the input */\n }\n if (len > have) {\n len = have; /* limit len to the output */\n }\n\n /* If the stored block would be less than min_block in length, or if\n * unable to copy all of the available input when flushing, then try\n * copying to the window and the pending buffer instead. Also don't\n * write an empty block when flushing -- deflate() does that.\n */\n if (len < min_block && ((len === 0 && flush !== Z_FINISH) ||\n flush === Z_NO_FLUSH ||\n len !== left + s.strm.avail_in)) {\n break;\n }\n\n /* Make a dummy stored block in pending to get the header bytes,\n * including any pending bits. This also updates the debugging counts.\n */\n last = flush === Z_FINISH && len === left + s.strm.avail_in ? 1 : 0;\n _tr_stored_block(s, 0, 0, last);\n\n /* Replace the lengths in the dummy stored block with len. */\n s.pending_buf[s.pending - 4] = len;\n s.pending_buf[s.pending - 3] = len >> 8;\n s.pending_buf[s.pending - 2] = ~len;\n s.pending_buf[s.pending - 1] = ~len >> 8;\n\n /* Write the stored block header bytes. */\n flush_pending(s.strm);\n\n//#ifdef ZLIB_DEBUG\n// /* Update debugging counts for the data about to be copied. */\n// s->compressed_len += len << 3;\n// s->bits_sent += len << 3;\n//#endif\n\n /* Copy uncompressed bytes from the window to next_out. */\n if (left) {\n if (left > len) {\n left = len;\n }\n //zmemcpy(s->strm->next_out, s->window + s->block_start, left);\n s.strm.output.set(s.window.subarray(s.block_start, s.block_start + left), s.strm.next_out);\n s.strm.next_out += left;\n s.strm.avail_out -= left;\n s.strm.total_out += left;\n s.block_start += left;\n len -= left;\n }\n\n /* Copy uncompressed bytes directly from next_in to next_out, updating\n * the check value.\n */\n if (len) {\n read_buf(s.strm, s.strm.output, s.strm.next_out, len);\n s.strm.next_out += len;\n s.strm.avail_out -= len;\n s.strm.total_out += len;\n }\n } while (last === 0);\n\n /* Update the sliding window with the last s->w_size bytes of the copied\n * data, or append all of the copied data to the existing window if less\n * than s->w_size bytes were copied. Also update the number of bytes to\n * insert in the hash tables, in the event that deflateParams() switches to\n * a non-zero compression level.\n */\n used -= s.strm.avail_in; /* number of input bytes directly copied */\n if (used) {\n /* If any input was used, then no unused input remains in the window,\n * therefore s->block_start == s->strstart.\n */\n if (used >= s.w_size) { /* supplant the previous history */\n s.matches = 2; /* clear hash */\n //zmemcpy(s->window, s->strm->next_in - s->w_size, s->w_size);\n s.window.set(s.strm.input.subarray(s.strm.next_in - s.w_size, s.strm.next_in), 0);\n s.strstart = s.w_size;\n s.insert = s.strstart;\n }\n else {\n if (s.window_size - s.strstart <= used) {\n /* Slide the window down. */\n s.strstart -= s.w_size;\n //zmemcpy(s->window, s->window + s->w_size, s->strstart);\n s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0);\n if (s.matches < 2) {\n s.matches++; /* add a pending slide_hash() */\n }\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n }\n //zmemcpy(s->window + s->strstart, s->strm->next_in - used, used);\n s.window.set(s.strm.input.subarray(s.strm.next_in - used, s.strm.next_in), s.strstart);\n s.strstart += used;\n s.insert += used > s.w_size - s.insert ? s.w_size - s.insert : used;\n }\n s.block_start = s.strstart;\n }\n if (s.high_water < s.strstart) {\n s.high_water = s.strstart;\n }\n\n /* If the last block was written to next_out, then done. */\n if (last) {\n return BS_FINISH_DONE;\n }\n\n /* If flushing and all input has been consumed, then done. */\n if (flush !== Z_NO_FLUSH && flush !== Z_FINISH &&\n s.strm.avail_in === 0 && s.strstart === s.block_start) {\n return BS_BLOCK_DONE;\n }\n\n /* Fill the window with any remaining input. */\n have = s.window_size - s.strstart;\n if (s.strm.avail_in > have && s.block_start >= s.w_size) {\n /* Slide the window down. */\n s.block_start -= s.w_size;\n s.strstart -= s.w_size;\n //zmemcpy(s->window, s->window + s->w_size, s->strstart);\n s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0);\n if (s.matches < 2) {\n s.matches++; /* add a pending slide_hash() */\n }\n have += s.w_size; /* more space now */\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n }\n if (have > s.strm.avail_in) {\n have = s.strm.avail_in;\n }\n if (have) {\n read_buf(s.strm, s.window, s.strstart, have);\n s.strstart += have;\n s.insert += have > s.w_size - s.insert ? s.w_size - s.insert : have;\n }\n if (s.high_water < s.strstart) {\n s.high_water = s.strstart;\n }\n\n /* There was not enough avail_out to write a complete worthy or flushed\n * stored block to next_out. Write a stored block to pending instead, if we\n * have enough input for a worthy block, or if flushing and there is enough\n * room for the remaining input as a stored block in the pending buffer.\n */\n have = (s.bi_valid + 42) >> 3; /* number of header bytes */\n /* maximum stored block length that will fit in pending: */\n have = s.pending_buf_size - have > 65535/* MAX_STORED */ ? 65535/* MAX_STORED */ : s.pending_buf_size - have;\n min_block = have > s.w_size ? s.w_size : have;\n left = s.strstart - s.block_start;\n if (left >= min_block ||\n ((left || flush === Z_FINISH) && flush !== Z_NO_FLUSH &&\n s.strm.avail_in === 0 && left <= have)) {\n len = left > have ? have : left;\n last = flush === Z_FINISH && s.strm.avail_in === 0 &&\n len === left ? 1 : 0;\n _tr_stored_block(s, s.block_start, len, last);\n s.block_start += len;\n flush_pending(s.strm);\n }\n\n /* We've done all we can with the available input and output. */\n return last ? BS_FINISH_STARTED : BS_NEED_MORE;\n};\n\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nconst deflate_fast = (s, flush) => {\n\n let hash_head; /* head of the hash chain */\n let bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + 1]);\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nconst deflate_slow = (s, flush) => {\n\n let hash_head; /* head of hash chain */\n let bflush; /* set if current block must be flushed */\n\n let max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n};\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nconst deflate_rle = (s, flush) => {\n\n let bflush; /* set if current block must be flushed */\n let prev; /* byte at distance one to match */\n let scan, strend; /* scan goes up to strend for length of run */\n\n const _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nconst deflate_huff = (s, flush) => {\n\n let bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n break; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}\n\nconst configuration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nconst lm_init = (s) => {\n\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n};\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new Uint16Array(HEAP_SIZE * 2);\n this.dyn_dtree = new Uint16Array((2 * D_CODES + 1) * 2);\n this.bl_tree = new Uint16Array((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new Uint16Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new Uint16Array(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new Uint16Array(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.sym_buf = 0; /* buffer for distances and literals/lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.sym_next = 0; /* running index in sym_buf */\n this.sym_end = 0; /* symbol table full when sym_next reaches this */\n\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n}\n\n\n/* =========================================================================\n * Check for a valid deflate stream state. Return 0 if ok, 1 if not.\n */\nconst deflateStateCheck = (strm) => {\n\n if (!strm) {\n return 1;\n }\n const s = strm.state;\n if (!s || s.strm !== strm || (s.status !== INIT_STATE &&\n//#ifdef GZIP\n s.status !== GZIP_STATE &&\n//#endif\n s.status !== EXTRA_STATE &&\n s.status !== NAME_STATE &&\n s.status !== COMMENT_STATE &&\n s.status !== HCRC_STATE &&\n s.status !== BUSY_STATE &&\n s.status !== FINISH_STATE)) {\n return 1;\n }\n return 0;\n};\n\n\nconst deflateResetKeep = (strm) => {\n\n if (deflateStateCheck(strm)) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n const s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status =\n//#ifdef GZIP\n s.wrap === 2 ? GZIP_STATE :\n//#endif\n s.wrap ? INIT_STATE : BUSY_STATE;\n strm.adler = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = -2;\n _tr_init(s);\n return Z_OK;\n};\n\n\nconst deflateReset = (strm) => {\n\n const ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n};\n\n\nconst deflateSetHeader = (strm, head) => {\n\n if (deflateStateCheck(strm) || strm.state.wrap !== 2) {\n return Z_STREAM_ERROR;\n }\n strm.state.gzhead = head;\n return Z_OK;\n};\n\n\nconst deflateInit2 = (strm, level, method, windowBits, memLevel, strategy) => {\n\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR;\n }\n let wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED || (windowBits === 8 && wrap !== 1)) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n const s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n s.status = INIT_STATE; /* to pass state test in deflateReset() */\n\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n s.window = new Uint8Array(s.w_size * 2);\n s.head = new Uint16Array(s.hash_size);\n s.prev = new Uint16Array(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n /* We overlay pending_buf and sym_buf. This works since the average size\n * for length/distance pairs over any compressed block is assured to be 31\n * bits or less.\n *\n * Analysis: The longest fixed codes are a length code of 8 bits plus 5\n * extra bits, for lengths 131 to 257. The longest fixed distance codes are\n * 5 bits plus 13 extra bits, for distances 16385 to 32768. The longest\n * possible fixed-codes length/distance pair is then 31 bits total.\n *\n * sym_buf starts one-fourth of the way into pending_buf. So there are\n * three bytes in sym_buf for every four bytes in pending_buf. Each symbol\n * in sym_buf is three bytes -- two for the distance and one for the\n * literal/length. As each symbol is consumed, the pointer to the next\n * sym_buf value to read moves forward three bytes. From that symbol, up to\n * 31 bits are written to pending_buf. The closest the written pending_buf\n * bits gets to the next sym_buf symbol to read is just before the last\n * code is written. At that time, 31*(n-2) bits have been written, just\n * after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at\n * 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1\n * symbols are written.) The closest the writing gets to what is unread is\n * then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and\n * can range from 128 to 32768.\n *\n * Therefore, at a minimum, there are 142 bits of space between what is\n * written and what is read in the overlain buffers, so the symbols cannot\n * be overwritten by the compressed data. That space is actually 139 bits,\n * due to the three-bit fixed-code block header.\n *\n * That covers the case where either Z_FIXED is specified, forcing fixed\n * codes, or when the use of fixed codes is chosen, because that choice\n * results in a smaller compressed block than dynamic codes. That latter\n * condition then assures that the above analysis also covers all dynamic\n * blocks. A dynamic-code block will only be chosen to be emitted if it has\n * fewer bits than a fixed-code block would for the same set of symbols.\n * Therefore its average symbol length is assured to be less than 31. So\n * the compressed data for a dynamic block also cannot overwrite the\n * symbols from which it is being constructed.\n */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n s.pending_buf = new Uint8Array(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->sym_buf = s->pending_buf + s->lit_bufsize;\n s.sym_buf = s.lit_bufsize;\n\n //s->sym_end = (s->lit_bufsize - 1) * 3;\n s.sym_end = (s.lit_bufsize - 1) * 3;\n /* We avoid equality with lit_bufsize*3 because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n};\n\nconst deflateInit = (strm, level) => {\n\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n};\n\n\n/* ========================================================================= */\nconst deflate = (strm, flush) => {\n\n if (deflateStateCheck(strm) || flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n\n const s = strm.state;\n\n if (!strm.output ||\n (strm.avail_in !== 0 && !strm.input) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n\n const old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK;\n }\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* Write the header */\n if (s.status === INIT_STATE && s.wrap === 0) {\n s.status = BUSY_STATE;\n }\n if (s.status === INIT_STATE) {\n /* zlib header */\n let header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n let level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n putShortMSB(s, header);\n\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n }\n//#ifdef GZIP\n if (s.status === GZIP_STATE) {\n /* gzip header */\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) { // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n }\n else {\n put_byte(s, (s.gzhead.text ? 1 : 0) +\n (s.gzhead.hcrc ? 2 : 0) +\n (!s.gzhead.extra ? 0 : 4) +\n (!s.gzhead.name ? 0 : 8) +\n (!s.gzhead.comment ? 0 : 16)\n );\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, (s.gzhead.time >> 8) & 0xff);\n put_byte(s, (s.gzhead.time >> 16) & 0xff);\n put_byte(s, (s.gzhead.time >> 24) & 0xff);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let left = (s.gzhead.extra.length & 0xffff) - s.gzindex;\n while (s.pending + left > s.pending_buf_size) {\n let copy = s.pending_buf_size - s.pending;\n // zmemcpy(s.pending_buf + s.pending,\n // s.gzhead.extra + s.gzindex, copy);\n s.pending_buf.set(s.gzhead.extra.subarray(s.gzindex, s.gzindex + copy), s.pending);\n s.pending = s.pending_buf_size;\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex += copy;\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n beg = 0;\n left -= copy;\n }\n // JS specific: s.gzhead.extra may be TypedArray or Array for backward compatibility\n // TypedArray.slice and TypedArray.from don't exist in IE10-IE11\n let gzhead_extra = new Uint8Array(s.gzhead.extra);\n // zmemcpy(s->pending_buf + s->pending,\n // s->gzhead->extra + s->gzindex, left);\n s.pending_buf.set(gzhead_extra.subarray(s.gzindex, s.gzindex + left), s.pending);\n s.pending += left;\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex = 0;\n }\n s.status = NAME_STATE;\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let val;\n do {\n if (s.pending === s.pending_buf_size) {\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n beg = 0;\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex = 0;\n }\n s.status = COMMENT_STATE;\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let val;\n do {\n if (s.pending === s.pending_buf_size) {\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n beg = 0;\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n }\n s.status = HCRC_STATE;\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n }\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n }\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n }\n//#endif\n\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n let bstate = s.level === 0 ? deflate_stored(s, flush) :\n s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :\n s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush);\n\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n _tr_align(s);\n }\n else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n _tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH) {\n /*** CLEAR_HASH(s); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n }\n\n if (flush !== Z_FINISH) { return Z_OK; }\n if (s.wrap <= 0) { return Z_STREAM_END; }\n\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n put_byte(s, (strm.adler >> 16) & 0xff);\n put_byte(s, (strm.adler >> 24) & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, (strm.total_in >> 8) & 0xff);\n put_byte(s, (strm.total_in >> 16) & 0xff);\n put_byte(s, (strm.total_in >> 24) & 0xff);\n }\n else\n {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n};\n\n\nconst deflateEnd = (strm) => {\n\n if (deflateStateCheck(strm)) {\n return Z_STREAM_ERROR;\n }\n\n const status = strm.state.status;\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n};\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nconst deflateSetDictionary = (strm, dictionary) => {\n\n let dictLength = dictionary.length;\n\n if (deflateStateCheck(strm)) {\n return Z_STREAM_ERROR;\n }\n\n const s = strm.state;\n const wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR;\n }\n\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n let tmpDict = new Uint8Array(s.w_size);\n tmpDict.set(dictionary.subarray(dictLength - s.w_size, dictLength), 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n const avail = strm.avail_in;\n const next = strm.next_in;\n const input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n let str = s.strstart;\n let n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]);\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK;\n};\n\n\nmodule.exports.deflateInit = deflateInit;\nmodule.exports.deflateInit2 = deflateInit2;\nmodule.exports.deflateReset = deflateReset;\nmodule.exports.deflateResetKeep = deflateResetKeep;\nmodule.exports.deflateSetHeader = deflateSetHeader;\nmodule.exports.deflate = deflate;\nmodule.exports.deflateEnd = deflateEnd;\nmodule.exports.deflateSetDictionary = deflateSetDictionary;\nmodule.exports.deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nmodule.exports.deflateBound = deflateBound;\nmodule.exports.deflateCopy = deflateCopy;\nmodule.exports.deflateGetDictionary = deflateGetDictionary;\nmodule.exports.deflateParams = deflateParams;\nmodule.exports.deflatePending = deflatePending;\nmodule.exports.deflatePrime = deflatePrime;\nmodule.exports.deflateTune = deflateTune;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nmodule.exports = GZheader;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nconst BAD = 16209; /* got a data error -- remain here until reset */\nconst TYPE = 16191; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n let _in; /* local strm.input */\n let last; /* have enough input while in < last */\n let _out; /* local strm.output */\n let beg; /* inflate()'s initial strm.output */\n let end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n let dmax; /* maximum distance from zlib header */\n//#endif\n let wsize; /* window size or zero if not using window */\n let whave; /* valid bytes in the window */\n let wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n let s_window; /* allocated sliding window, if wsize != 0 */\n let hold; /* local strm.hold */\n let bits; /* local strm.bits */\n let lcode; /* local strm.lencode */\n let dcode; /* local strm.distcode */\n let lmask; /* mask for first level of length codes */\n let dmask; /* mask for first level of distance codes */\n let here; /* retrieved table entry */\n let op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n let len; /* match length, unused bytes */\n let dist; /* match distance */\n let from; /* where to copy match from */\n let from_source;\n\n\n let input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n const state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst adler32 = require('./adler32');\nconst crc32 = require('./crc32');\nconst inflate_fast = require('./inffast');\nconst inflate_table = require('./inftrees');\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_FINISH, Z_BLOCK, Z_TREES,\n Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR, Z_BUF_ERROR,\n Z_DEFLATED\n} = require('./constants');\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nconst HEAD = 16180; /* i: waiting for magic header */\nconst FLAGS = 16181; /* i: waiting for method and flags (gzip) */\nconst TIME = 16182; /* i: waiting for modification time (gzip) */\nconst OS = 16183; /* i: waiting for extra flags and operating system (gzip) */\nconst EXLEN = 16184; /* i: waiting for extra length (gzip) */\nconst EXTRA = 16185; /* i: waiting for extra bytes (gzip) */\nconst NAME = 16186; /* i: waiting for end of file name (gzip) */\nconst COMMENT = 16187; /* i: waiting for end of comment (gzip) */\nconst HCRC = 16188; /* i: waiting for header crc (gzip) */\nconst DICTID = 16189; /* i: waiting for dictionary check value */\nconst DICT = 16190; /* waiting for inflateSetDictionary() call */\nconst TYPE = 16191; /* i: waiting for type bits, including last-flag bit */\nconst TYPEDO = 16192; /* i: same, but skip check to exit inflate on new block */\nconst STORED = 16193; /* i: waiting for stored size (length and complement) */\nconst COPY_ = 16194; /* i/o: same as COPY below, but only first time in */\nconst COPY = 16195; /* i/o: waiting for input or output to copy stored block */\nconst TABLE = 16196; /* i: waiting for dynamic block table lengths */\nconst LENLENS = 16197; /* i: waiting for code length code lengths */\nconst CODELENS = 16198; /* i: waiting for length/lit and distance code lengths */\nconst LEN_ = 16199; /* i: same as LEN below, but only first time in */\nconst LEN = 16200; /* i: waiting for length/lit/eob code */\nconst LENEXT = 16201; /* i: waiting for length extra bits */\nconst DIST = 16202; /* i: waiting for distance code */\nconst DISTEXT = 16203; /* i: waiting for distance extra bits */\nconst MATCH = 16204; /* o: waiting for output space to copy string */\nconst LIT = 16205; /* o: waiting for output space to write literal */\nconst CHECK = 16206; /* i: waiting for 32-bit check value */\nconst LENGTH = 16207; /* i: waiting for 32-bit length (gzip) */\nconst DONE = 16208; /* finished check, done -- remain here until reset */\nconst BAD = 16209; /* got a data error -- remain here until reset */\nconst MEM = 16210; /* got an inflate() memory error -- remain here until reset */\nconst SYNC = 16211; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nconst ENOUGH_LENS = 852;\nconst ENOUGH_DISTS = 592;\n//const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst MAX_WBITS = 15;\n/* 32K LZ77 window */\nconst DEF_WBITS = MAX_WBITS;\n\n\nconst zswap32 = (q) => {\n\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n};\n\n\nfunction InflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip,\n bit 2 true to validate check value */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib), or\n -1 if raw or no header yet */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new Uint16Array(320); /* temporary storage for code lengths */\n this.work = new Uint16Array(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new Int32Array(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\n\nconst inflateStateCheck = (strm) => {\n\n if (!strm) {\n return 1;\n }\n const state = strm.state;\n if (!state || state.strm !== strm ||\n state.mode < HEAD || state.mode > SYNC) {\n return 1;\n }\n return 0;\n};\n\n\nconst inflateResetKeep = (strm) => {\n\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.flags = -1;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS);\n state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n};\n\n\nconst inflateReset = (strm) => {\n\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n};\n\n\nconst inflateReset2 = (strm, windowBits) => {\n let wrap;\n\n /* get the state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 5;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n};\n\n\nconst inflateInit2 = (strm, windowBits) => {\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n const state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.strm = strm;\n state.window = null/*Z_NULL*/;\n state.mode = HEAD; /* to pass state test in inflateReset2() */\n const ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n};\n\n\nconst inflateInit = (strm) => {\n\n return inflateInit2(strm, DEF_WBITS);\n};\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nlet virgin = true;\n\nlet lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\n\nconst fixedtables = (state) => {\n\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n lenfix = new Int32Array(512);\n distfix = new Int32Array(32);\n\n /* literal/length table */\n let sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n};\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nconst updatewindow = (strm, src, end, copy) => {\n\n let dist;\n const state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new Uint8Array(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n state.window.set(src.subarray(end - state.wsize, end), 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n state.window.set(src.subarray(end - copy, end - copy + dist), state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n state.window.set(src.subarray(end - copy, end), 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n};\n\n\nconst inflate = (strm, flush) => {\n\n let state;\n let input, output; // input/output buffers\n let next; /* next input INDEX */\n let put; /* next output INDEX */\n let have, left; /* available input and output */\n let hold; /* bit buffer */\n let bits; /* bits in bit buffer */\n let _in, _out; /* save starting available input and output */\n let copy; /* number of stored or match bytes to copy */\n let from; /* where to copy match bytes from */\n let from_source;\n let here = 0; /* current decoding table entry */\n let here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //let last; /* parent table entry */\n let last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n let len; /* length to copy for repeats, bits to drop */\n let ret; /* return code */\n const hbuf = new Uint8Array(4); /* buffer for gzip header crc calculation */\n let opts;\n\n let n; // temporary variable for NEED_BITS\n\n const order = /* permutation of code lengths */\n new Uint8Array([ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]);\n\n\n if (inflateStateCheck(strm) || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n if (state.wbits === 0) {\n state.wbits = 15;\n }\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n if (len > 15 || len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n\n // !!! pako patch. Force use `options.windowBits` if passed.\n // Required to always use max window size by default.\n state.dmax = 1 << state.wbits;\n //state.dmax = 1 << len;\n\n state.flags = 0; /* indicate zlib header */\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Uint8Array(state.head.extra_len);\n }\n state.head.extra.set(\n input.subarray(\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n next + copy\n ),\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 4) && hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n output.set(input.subarray(next, next + copy), put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if ((state.wrap & 4) && _out) {\n strm.adler = state.check =\n /*UPDATE_CHECK(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.wrap & 4) && (state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 4) && hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if ((state.wrap & 4) && _out) {\n strm.adler = state.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n};\n\n\nconst inflateEnd = (strm) => {\n\n if (inflateStateCheck(strm)) {\n return Z_STREAM_ERROR;\n }\n\n let state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n};\n\n\nconst inflateGetHeader = (strm, head) => {\n\n /* check state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n};\n\n\nconst inflateSetDictionary = (strm, dictionary) => {\n const dictLength = dictionary.length;\n\n let state;\n let dictid;\n let ret;\n\n /* check state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n};\n\n\nmodule.exports.inflateReset = inflateReset;\nmodule.exports.inflateReset2 = inflateReset2;\nmodule.exports.inflateResetKeep = inflateResetKeep;\nmodule.exports.inflateInit = inflateInit;\nmodule.exports.inflateInit2 = inflateInit2;\nmodule.exports.inflate = inflate;\nmodule.exports.inflateEnd = inflateEnd;\nmodule.exports.inflateGetHeader = inflateGetHeader;\nmodule.exports.inflateSetDictionary = inflateSetDictionary;\nmodule.exports.inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nmodule.exports.inflateCodesUsed = inflateCodesUsed;\nmodule.exports.inflateCopy = inflateCopy;\nmodule.exports.inflateGetDictionary = inflateGetDictionary;\nmodule.exports.inflateMark = inflateMark;\nmodule.exports.inflatePrime = inflatePrime;\nmodule.exports.inflateSync = inflateSync;\nmodule.exports.inflateSyncPoint = inflateSyncPoint;\nmodule.exports.inflateUndermine = inflateUndermine;\nmodule.exports.inflateValidate = inflateValidate;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst MAXBITS = 15;\nconst ENOUGH_LENS = 852;\nconst ENOUGH_DISTS = 592;\n//const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\nconst lbase = new Uint16Array([ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n]);\n\nconst lext = new Uint8Array([ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n]);\n\nconst dbase = new Uint16Array([ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n]);\n\nconst dext = new Uint8Array([ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n]);\n\nconst inflate_table = (type, lens, lens_index, codes, table, table_index, work, opts) =>\n{\n const bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n let len = 0; /* a code's length in bits */\n let sym = 0; /* index of code symbols */\n let min = 0, max = 0; /* minimum and maximum code lengths */\n let root = 0; /* number of index bits for root table */\n let curr = 0; /* number of index bits for current table */\n let drop = 0; /* code bits to drop for sub-table */\n let left = 0; /* number of prefix codes available */\n let used = 0; /* code entries in table used */\n let huff = 0; /* Huffman code */\n let incr; /* for incrementing code, index */\n let fill; /* index for replicating entries */\n let low; /* low bits for current root entry */\n let mask; /* mask for low root bits */\n let next; /* next available space in table */\n let base = null; /* base value table to use */\n// let shoextra; /* extra bits table to use */\n let match; /* use base and extra for symbol >= match */\n const count = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n const offs = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n let extra = null;\n\n let here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n match = 20;\n\n } else if (type === LENS) {\n base = lbase;\n extra = lext;\n match = 257;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n match = 0;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] + 1 < match) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] >= match) {\n here_op = extra[work[sym] - match];\n here_val = base[work[sym] - match];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n\n\nmodule.exports = inflate_table;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* eslint-disable space-unary-ops */\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//const Z_FILTERED = 1;\n//const Z_HUFFMAN_ONLY = 2;\n//const Z_RLE = 3;\nconst Z_FIXED = 4;\n//const Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nconst Z_BINARY = 0;\nconst Z_TEXT = 1;\n//const Z_ASCII = 1; // = Z_TEXT\nconst Z_UNKNOWN = 2;\n\n/*============================================================================*/\n\n\nfunction zero(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nconst STORED_BLOCK = 0;\nconst STATIC_TREES = 1;\nconst DYN_TREES = 2;\n/* The three kinds of block type */\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nconst LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nconst LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nconst L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nconst D_CODES = 30;\n/* number of distance codes */\n\nconst BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nconst HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nconst MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nconst MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nconst END_BLOCK = 256;\n/* end of block literal code */\n\nconst REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nconst REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nconst REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nconst extra_lbits = /* extra bits for each length code */\n new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]);\n\nconst extra_dbits = /* extra bits for each distance code */\n new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]);\n\nconst extra_blbits = /* extra bits for each bit length code */\n new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]);\n\nconst bl_order =\n new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nconst DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nconst static_ltree = new Array((L_CODES + 2) * 2);\nzero(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nconst static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nconst _dist_code = new Array(DIST_CODE_LEN);\nzero(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nconst _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nconst base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nconst base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nlet static_l_desc;\nlet static_d_desc;\nlet static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nconst d_code = (dist) => {\n\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n};\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nconst put_short = (s, w) => {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n};\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nconst send_bits = (s, value, length) => {\n\n if (s.bi_valid > (Buf_size - length)) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n};\n\n\nconst send_code = (s, c, tree) => {\n\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n};\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nconst bi_reverse = (code, len) => {\n\n let res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n};\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nconst bi_flush = (s) => {\n\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n};\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nconst gen_bitlen = (s, desc) => {\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n\n const tree = desc.dyn_tree;\n const max_code = desc.max_code;\n const stree = desc.stat_desc.static_tree;\n const has_stree = desc.stat_desc.has_stree;\n const extra = desc.stat_desc.extra_bits;\n const base = desc.stat_desc.extra_base;\n const max_length = desc.stat_desc.max_length;\n let h; /* heap index */\n let n, m; /* iterate over the tree elements */\n let bits; /* bit length */\n let xbits; /* extra bits */\n let f; /* frequency */\n let overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Tracev((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Tracev((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n};\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nconst gen_codes = (tree, max_code, bl_count) => {\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n\n const next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n let code = 0; /* running code value */\n let bits; /* bit index */\n let n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n code = (code + bl_count[bits - 1]) << 1;\n next_code[bits] = code;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1< {\n\n let n; /* iterates over tree elements */\n let bits; /* bit counter */\n let length; /* length value */\n let code; /* code value */\n let dist; /* distance index */\n const bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n};\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nconst init_block = (s) => {\n\n let n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.sym_next = s.matches = 0;\n};\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nconst bi_windup = (s) =>\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n};\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nconst smaller = (tree, n, m, depth) => {\n\n const _n2 = n * 2;\n const _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n};\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nconst pqdownheap = (s, tree, k) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n\n const v = s.heap[k];\n let j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n};\n\n\n// inlined manually\n// const SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nconst compress_block = (s, ltree, dtree) => {\n// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n\n let dist; /* distance of matched string */\n let lc; /* match length or unmatched char (if dist == 0) */\n let sx = 0; /* running index in sym_buf */\n let code; /* the code to send */\n let extra; /* number of extra bits to send */\n\n if (s.sym_next !== 0) {\n do {\n dist = s.pending_buf[s.sym_buf + sx++] & 0xff;\n dist += (s.pending_buf[s.sym_buf + sx++] & 0xff) << 8;\n lc = s.pending_buf[s.sym_buf + sx++];\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and sym_buf is ok: */\n //Assert(s->pending < s->lit_bufsize + sx, \"pendingBuf overflow\");\n\n } while (sx < s.sym_next);\n }\n\n send_code(s, END_BLOCK, ltree);\n};\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nconst build_tree = (s, desc) => {\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n\n const tree = desc.dyn_tree;\n const stree = desc.stat_desc.static_tree;\n const has_stree = desc.stat_desc.has_stree;\n const elems = desc.stat_desc.elems;\n let n, m; /* iterate over heap elements */\n let max_code = -1; /* largest code with non zero frequency */\n let node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE;\n\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);\n tree[node * 2]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n /*** pqremove ***/\n n = s.heap[1/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n};\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nconst scan_tree = (s, tree, max_code) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n};\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nconst send_tree = (s, tree, max_code) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n};\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nconst build_bl_tree = (s) => {\n\n let max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n};\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nconst send_all_trees = (s, lcodes, dcodes, blcodes) => {\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n\n let rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n};\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"block list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"allow list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nconst detect_data_type = (s) => {\n /* block_mask is the bit mask of block-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n let block_mask = 0xf3ffc07f;\n let n;\n\n /* Check for non-textual (\"block-listed\") bytes. */\n for (n = 0; n <= 31; n++, block_mask >>>= 1) {\n if ((block_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"allow-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n }\n\n /* There are no \"block-listed\" or \"allow-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n};\n\n\nlet static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nconst _tr_init = (s) =>\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n};\n\n\n/* ===========================================================================\n * Send a stored block\n */\nconst _tr_stored_block = (s, buf, stored_len, last) => {\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n bi_windup(s); /* align on byte boundary */\n put_short(s, stored_len);\n put_short(s, ~stored_len);\n if (stored_len) {\n s.pending_buf.set(s.window.subarray(buf, buf + stored_len), s.pending);\n }\n s.pending += stored_len;\n};\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nconst _tr_align = (s) => {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n};\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and write out the encoded block.\n */\nconst _tr_flush_block = (s, buf, stored_len, last) => {\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n\n let opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n let max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->sym_next / 3));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n};\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nconst _tr_tally = (s, dist, lc) => {\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n\n s.pending_buf[s.sym_buf + s.sym_next++] = dist;\n s.pending_buf[s.sym_buf + s.sym_next++] = dist >> 8;\n s.pending_buf[s.sym_buf + s.sym_next++] = lc;\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n return (s.sym_next === s.sym_end);\n};\n\nmodule.exports._tr_init = _tr_init;\nmodule.exports._tr_stored_block = _tr_stored_block;\nmodule.exports._tr_flush_block = _tr_flush_block;\nmodule.exports._tr_tally = _tr_tally;\nmodule.exports._tr_align = _tr_align;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nmodule.exports = ZStream;\n","import { Spec } from \"vega\";\nimport vegaEmbed, { EmbedOptions, Mode } from \"vega-embed\";\nimport { TopLevelSpec } from \"vega-lite\";\n\nexport { default as vegaEmbed } from \"vega-embed\";\nexport { VegaWidgetModel, VegaWidget } from \"./widget\";\nexport const version = require(\"../package.json\").version;\n\nfunction javascriptIndex(selector: string, outputs: any) {\n // Return the index in the output array of the JS repr of this viz\n for (let i = 0; i < outputs.length; i++) {\n const item = outputs[i];\n if (\n item.metadata &&\n item.metadata[\"jupyter-vega\"] === selector &&\n item.data[\"application/javascript\"] !== undefined\n ) {\n return i;\n }\n }\n return -1;\n}\n\nfunction imageIndex(selector: string, outputs: any) {\n // Return the index in the output array of the PNG repr of this viz\n for (let i = 0; i < outputs.length; i++) {\n const item = outputs[i];\n if (\n item.metadata &&\n item.metadata[\"jupyter-vega\"] === selector &&\n item.data[\"image/png\"] !== undefined\n ) {\n return i;\n }\n }\n return -1;\n}\n\nfunction showError(el: HTMLElement, error: Error) {\n el.innerHTML = `
\n

Javascript Error: ${error.message}

\n

This usually means there's a typo in your chart specification.\n See the JavaScript console for the full traceback.

\n
`;\n\n throw error;\n}\n\nexport function render(\n selector: string,\n spec: Spec | TopLevelSpec,\n type: Mode,\n opt: EmbedOptions,\n output_area: any\n) {\n // Find the indices of this visualizations JS and PNG\n // representation.\n const imgIndex = imageIndex(selector, output_area.outputs);\n const jsIndex = javascriptIndex(selector, output_area.outputs);\n\n // If we have already rendered a static image, don't render\n // the JS version or append a new PNG version\n if (imgIndex > -1 && jsIndex > -1) {\n return;\n }\n\n // Never been rendered, so render JS and append the PNG to the\n // outputs for the cell\n const el = document.getElementById(selector.substring(1))!;\n vegaEmbed(el, spec, {\n loader: { http: { credentials: \"same-origin\" } },\n ...opt,\n mode: type,\n })\n .then((result) => {\n result.view\n .toImageURL(\"png\")\n .then((imageData) => {\n if (output_area !== undefined) {\n const output = {\n data: {\n \"image/png\": imageData.split(\",\")[1],\n },\n metadata: { \"jupyter-vega\": selector },\n output_type: \"display_data\",\n };\n // This appends the PNG output, but doesn't render it this time\n // as the JS version will be rendered already.\n output_area.outputs.push(output);\n }\n })\n .catch((error) => showError(el, error));\n })\n .catch((error) => showError(el, error));\n}\n\nexport * from \"./widget\";\n","const pkg = require(\"../package.json\");\nexport const MODULE_VERSION = pkg.version;\nexport const MODULE_NAME = pkg.name;\n","import { DOMWidgetView, DOMWidgetModel } from \"@jupyter-widgets/base\";\nimport { MODULE_NAME, MODULE_VERSION } from \"./version\";\nimport { vegaEmbed } from \"./index\";\nimport { Result } from \"vega-embed\";\nimport * as ndarray from \"ndarray\";\nimport { table_serialization, rowProxy, IDict } from \"jupyter-tablewidgets\";\n\ninterface WidgetUpdate {\n key: string;\n remove?: string;\n insert?: any[] | \"@dataframe\" | \"@array2d\";\n}\n\ninterface WidgetUpdateMessage {\n type: \"update\";\n updates: WidgetUpdate[];\n resize: boolean;\n}\n\nfunction serializeImgURL(imgURL: string, mgr: VegaWidgetModel): string {\n if (\n mgr.viewInstance === null ||\n mgr.viewInstance.viewElement === undefined ||\n mgr.viewInstance.hasBeenUpdated === false\n ) {\n return imgURL;\n }\n let id_ = mgr.viewInstance.viewElement.id;\n if (id_ === \"\" || id_ === undefined) {\n id_ = \"VEGA_ID_\" + crypto.randomUUID();\n mgr.viewInstance.viewElement.id = id_;\n }\n let canvas = document.querySelector(`#${id_} canvas`);\n if (canvas === null) {\n return imgURL;\n }\n return JSON.stringify({\n // @ts-ignore\n width: canvas.style.width || canvas.width,\n // @ts-ignore\n height: canvas.style.height || canvas.height,\n // @ts-ignore\n url: canvas.toDataURL(),\n });\n}\n\n// validate the ev object and cast it to the correct type\nfunction checkWidgetUpdate(ev: any): WidgetUpdateMessage | null {\n if (ev.type != \"update\") {\n return null;\n }\n\n // TODO: Fully validate ev and give a easy to understand error message if it is ill-formed\n return ev as WidgetUpdateMessage;\n}\n\nexport class VegaWidgetModel extends DOMWidgetModel {\n defaults() {\n return {\n ...DOMWidgetModel.prototype.defaults(),\n _model_name: \"VegaWidgetModel\",\n _view_name: \"VegaWidget\",\n _spec_source: \"\",\n _opt_source: \"\",\n _df: ndarray([]),\n _img_url: \"\",\n _columns: [],\n };\n }\n viewInstance: VegaWidget | null = null;\n static serializers = {\n ...DOMWidgetModel.serializers,\n _img_url: { serialize: serializeImgURL } as any,\n _df: table_serialization as any,\n };\n\n static model_name = \"VegaWidgetModel\";\n static model_module = MODULE_NAME;\n static model_module_version = MODULE_VERSION;\n static view_name = \"VegaWidget\";\n static view_module = MODULE_NAME;\n static view_module_version = MODULE_VERSION;\n}\n\nexport class VegaWidget extends DOMWidgetView {\n result?: Result;\n hasBeenUpdated: boolean = false; // when it is \"true\" it means that the view has been updated at least once\n viewElement = document.createElement(\"div\");\n errorElement = document.createElement(\"div\");\n\n async render() {\n this.el.appendChild(this.viewElement);\n this.errorElement.style.color = \"red\";\n this.el.appendChild(this.errorElement);\n let model = this.model as VegaWidgetModel;\n model.viewInstance = this;\n const reembed = async () => {\n const spec = JSON.parse(this.model.get(\"_spec_source\"));\n const opt = JSON.parse(this.model.get(\"_opt_source\") || \"{}\");\n const imgURL = this.model.get(\"_img_url\");\n if (imgURL !== \"\" && imgURL !== \"null\") {\n let imgJson = JSON.parse(imgURL);\n let imgElement = document.createElement(\"img\");\n imgElement.src = imgJson.url;\n let h = parseInt(imgJson.height);\n if (h > 0) {\n imgElement.height = h;\n }\n let w = parseInt(imgJson.width);\n if (w > 0) {\n imgElement.width = w;\n }\n this.viewElement.appendChild(imgElement);\n this.model.set(\"_img_url\", \"null\");\n return;\n }\n if (spec == null) {\n return;\n }\n try {\n const result = await vegaEmbed(this.viewElement, spec, {\n loader: { http: { credentials: \"same-origin\" } },\n ...opt,\n });\n if (this.result) {\n this.result.finalize();\n }\n this.result = result;\n this.send({ type: \"display\" });\n } catch (err) {\n if (this.result) {\n this.result.finalize();\n }\n console.error(err);\n }\n };\n\n const applyUpdate = async (update: WidgetUpdate, resize: boolean) => {\n const result = this.result;\n if (result == null) {\n throw new Error(\"Internal error: no view attached to widget\");\n }\n const filter = new Function(\n \"datum\",\n `return (${update.remove || \"false\"})`\n );\n let newValues = update.insert || [];\n switch (newValues) {\n case \"@dataframe\": {\n newValues = this.updateDataFrame();\n break;\n }\n case \"@array2d\": {\n newValues = this.updateArray2D();\n }\n }\n const changeSet = result.view\n .changeset()\n .remove(filter)\n .insert(newValues);\n const view = result.view.change(update.key, changeSet);\n if (resize) view.resize();\n await view.runAsync();\n };\n\n const applyUpdates = async (message: WidgetUpdateMessage) => {\n this.hasBeenUpdated = true;\n for (const update of message.updates) {\n await applyUpdate(update, message.resize);\n }\n };\n\n this.model.on(\"change:_spec_source\", reembed);\n this.model.on(\"change:_opt_source\", reembed);\n this.model.on(\"msg:custom\", (ev: any) => {\n const message = checkWidgetUpdate(ev);\n if (message == null) {\n return;\n }\n\n applyUpdates(message).catch((err: Error) => {\n this.errorElement.textContent = String(err);\n console.error(err);\n });\n });\n\n // initial rendering\n await reembed();\n }\n\n updateDataFrame(): any[] {\n const table = this.model.get(\"_df\");\n const proxy = rowProxy(table);\n const rows = Array(table.size);\n for (let i = 0; i < rows.length; ++i) {\n rows[i] = proxy(i);\n }\n return rows;\n }\n\n updateArray2D(): any[] {\n /* A 2D array is encoded for transfer like a dataframe\n having an unique, (2D) column.\n The column name is \"special\", i.e. it is a string containing\n three comma separated keys, e.g. \"x,y,z\"\n this format is useful for encoding, for example, a heatmap */\n const table = this.model.get(\"_df\");\n const res = Array(table.size * table.size);\n const fancyCol = table.columns[0];\n const arr: ndarray.NdArray = table.data[fancyCol];\n const cols: string[] = fancyCol.split(\",\");\n let k = 0;\n for (let i = 0; i < arr.shape[0]; i++) {\n for (let j = 0; j < arr.shape[1]; j++) {\n let row: IDict = {};\n row[cols[0]] = i;\n row[cols[1]] = j;\n row[cols[2]] = arr.get(i, j);\n res[k++] = row;\n }\n }\n return res;\n }\n}\n","\"use strict\"\n\nfunction unique_pred(list, compare) {\n var ptr = 1\n , len = list.length\n , a=list[0], b=list[0]\n for(var i=1; i= 48 && charCode <= 57) {\n i++;\n continue;\n }\n return false;\n }\n return true;\n}\n/**\n* Escapes a json pointer path\n* @param path The raw pointer\n* @return the Escaped path\n*/\nexport function escapePathComponent(path) {\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\n return path;\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\n}\n/**\n * Unescapes a json pointer path\n * @param path The escaped pointer\n * @return The unescaped path\n */\nexport function unescapePathComponent(path) {\n return path.replace(/~1/g, '/').replace(/~0/g, '~');\n}\nexport function _getPathRecursive(root, obj) {\n var found;\n for (var key in root) {\n if (hasOwnProperty(root, key)) {\n if (root[key] === obj) {\n return escapePathComponent(key) + '/';\n }\n else if (typeof root[key] === 'object') {\n found = _getPathRecursive(root[key], obj);\n if (found != '') {\n return escapePathComponent(key) + '/' + found;\n }\n }\n }\n }\n return '';\n}\nexport function getPath(root, obj) {\n if (root === obj) {\n return '/';\n }\n var path = _getPathRecursive(root, obj);\n if (path === '') {\n throw new Error(\"Object not found in root\");\n }\n return \"/\" + path;\n}\n/**\n* Recursively checks whether an object has any undefined values inside.\n*/\nexport function hasUndefined(obj) {\n if (obj === undefined) {\n return true;\n }\n if (obj) {\n if (Array.isArray(obj)) {\n for (var i_1 = 0, len = obj.length; i_1 < len; i_1++) {\n if (hasUndefined(obj[i_1])) {\n return true;\n }\n }\n }\n else if (typeof obj === \"object\") {\n var objKeys = _objectKeys(obj);\n var objKeysLength = objKeys.length;\n for (var i = 0; i < objKeysLength; i++) {\n if (hasUndefined(obj[objKeys[i]])) {\n return true;\n }\n }\n }\n }\n return false;\n}\nfunction patchErrorMessageFormatter(message, args) {\n var messageParts = [message];\n for (var key in args) {\n var value = typeof args[key] === 'object' ? JSON.stringify(args[key], null, 2) : args[key]; // pretty print\n if (typeof value !== 'undefined') {\n messageParts.push(key + \": \" + value);\n }\n }\n return messageParts.join('\\n');\n}\nvar PatchError = /** @class */ (function (_super) {\n __extends(PatchError, _super);\n function PatchError(message, name, index, operation, tree) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, patchErrorMessageFormatter(message, { name: name, index: index, operation: operation, tree: tree })) || this;\n _this.name = name;\n _this.index = index;\n _this.operation = operation;\n _this.tree = tree;\n Object.setPrototypeOf(_this, _newTarget.prototype); // restore prototype chain, see https://stackoverflow.com/a/48342359\n _this.message = patchErrorMessageFormatter(message, { name: name, index: index, operation: operation, tree: tree });\n return _this;\n }\n return PatchError;\n}(Error));\nexport { PatchError };\n","import { PatchError, _deepClone, isInteger, unescapePathComponent, hasUndefined } from './helpers.mjs';\nexport var JsonPatchError = PatchError;\nexport var deepClone = _deepClone;\n/* We use a Javascript hash to store each\n function. Each hash entry (property) uses\n the operation identifiers specified in rfc6902.\n In this way, we can map each patch operation\n to its dedicated function in efficient way.\n */\n/* The operations applicable to an object */\nvar objOps = {\n add: function (obj, key, document) {\n obj[key] = this.value;\n return { newDocument: document };\n },\n remove: function (obj, key, document) {\n var removed = obj[key];\n delete obj[key];\n return { newDocument: document, removed: removed };\n },\n replace: function (obj, key, document) {\n var removed = obj[key];\n obj[key] = this.value;\n return { newDocument: document, removed: removed };\n },\n move: function (obj, key, document) {\n /* in case move target overwrites an existing value,\n return the removed value, this can be taxing performance-wise,\n and is potentially unneeded */\n var removed = getValueByPointer(document, this.path);\n if (removed) {\n removed = _deepClone(removed);\n }\n var originalValue = applyOperation(document, { op: \"remove\", path: this.from }).removed;\n applyOperation(document, { op: \"add\", path: this.path, value: originalValue });\n return { newDocument: document, removed: removed };\n },\n copy: function (obj, key, document) {\n var valueToCopy = getValueByPointer(document, this.from);\n // enforce copy by value so further operations don't affect source (see issue #177)\n applyOperation(document, { op: \"add\", path: this.path, value: _deepClone(valueToCopy) });\n return { newDocument: document };\n },\n test: function (obj, key, document) {\n return { newDocument: document, test: _areEquals(obj[key], this.value) };\n },\n _get: function (obj, key, document) {\n this.value = obj[key];\n return { newDocument: document };\n }\n};\n/* The operations applicable to an array. Many are the same as for the object */\nvar arrOps = {\n add: function (arr, i, document) {\n if (isInteger(i)) {\n arr.splice(i, 0, this.value);\n }\n else { // array props\n arr[i] = this.value;\n }\n // this may be needed when using '-' in an array\n return { newDocument: document, index: i };\n },\n remove: function (arr, i, document) {\n var removedList = arr.splice(i, 1);\n return { newDocument: document, removed: removedList[0] };\n },\n replace: function (arr, i, document) {\n var removed = arr[i];\n arr[i] = this.value;\n return { newDocument: document, removed: removed };\n },\n move: objOps.move,\n copy: objOps.copy,\n test: objOps.test,\n _get: objOps._get\n};\n/**\n * Retrieves a value from a JSON document by a JSON pointer.\n * Returns the value.\n *\n * @param document The document to get the value from\n * @param pointer an escaped JSON pointer\n * @return The retrieved value\n */\nexport function getValueByPointer(document, pointer) {\n if (pointer == '') {\n return document;\n }\n var getOriginalDestination = { op: \"_get\", path: pointer };\n applyOperation(document, getOriginalDestination);\n return getOriginalDestination.value;\n}\n/**\n * Apply a single JSON Patch Operation on a JSON document.\n * Returns the {newDocument, result} of the operation.\n * It modifies the `document` and `operation` objects - it gets the values by reference.\n * If you would like to avoid touching your values, clone them:\n * `jsonpatch.applyOperation(document, jsonpatch._deepClone(operation))`.\n *\n * @param document The document to patch\n * @param operation The operation to apply\n * @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.\n * @param mutateDocument Whether to mutate the original document or clone it before applying\n * @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.\n * @return `{newDocument, result}` after the operation\n */\nexport function applyOperation(document, operation, validateOperation, mutateDocument, banPrototypeModifications, index) {\n if (validateOperation === void 0) { validateOperation = false; }\n if (mutateDocument === void 0) { mutateDocument = true; }\n if (banPrototypeModifications === void 0) { banPrototypeModifications = true; }\n if (index === void 0) { index = 0; }\n if (validateOperation) {\n if (typeof validateOperation == 'function') {\n validateOperation(operation, 0, document, operation.path);\n }\n else {\n validator(operation, 0);\n }\n }\n /* ROOT OPERATIONS */\n if (operation.path === \"\") {\n var returnValue = { newDocument: document };\n if (operation.op === 'add') {\n returnValue.newDocument = operation.value;\n return returnValue;\n }\n else if (operation.op === 'replace') {\n returnValue.newDocument = operation.value;\n returnValue.removed = document; //document we removed\n return returnValue;\n }\n else if (operation.op === 'move' || operation.op === 'copy') { // it's a move or copy to root\n returnValue.newDocument = getValueByPointer(document, operation.from); // get the value by json-pointer in `from` field\n if (operation.op === 'move') { // report removed item\n returnValue.removed = document;\n }\n return returnValue;\n }\n else if (operation.op === 'test') {\n returnValue.test = _areEquals(document, operation.value);\n if (returnValue.test === false) {\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n returnValue.newDocument = document;\n return returnValue;\n }\n else if (operation.op === 'remove') { // a remove on root\n returnValue.removed = document;\n returnValue.newDocument = null;\n return returnValue;\n }\n else if (operation.op === '_get') {\n operation.value = document;\n return returnValue;\n }\n else { /* bad operation */\n if (validateOperation) {\n throw new JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document);\n }\n else {\n return returnValue;\n }\n }\n } /* END ROOT OPERATIONS */\n else {\n if (!mutateDocument) {\n document = _deepClone(document);\n }\n var path = operation.path || \"\";\n var keys = path.split('/');\n var obj = document;\n var t = 1; //skip empty element - http://jsperf.com/to-shift-or-not-to-shift\n var len = keys.length;\n var existingPathFragment = undefined;\n var key = void 0;\n var validateFunction = void 0;\n if (typeof validateOperation == 'function') {\n validateFunction = validateOperation;\n }\n else {\n validateFunction = validator;\n }\n while (true) {\n key = keys[t];\n if (key && key.indexOf('~') != -1) {\n key = unescapePathComponent(key);\n }\n if (banPrototypeModifications &&\n (key == '__proto__' ||\n (key == 'prototype' && t > 0 && keys[t - 1] == 'constructor'))) {\n throw new TypeError('JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README');\n }\n if (validateOperation) {\n if (existingPathFragment === undefined) {\n if (obj[key] === undefined) {\n existingPathFragment = keys.slice(0, t).join('/');\n }\n else if (t == len - 1) {\n existingPathFragment = operation.path;\n }\n if (existingPathFragment !== undefined) {\n validateFunction(operation, 0, document, existingPathFragment);\n }\n }\n }\n t++;\n if (Array.isArray(obj)) {\n if (key === '-') {\n key = obj.length;\n }\n else {\n if (validateOperation && !isInteger(key)) {\n throw new JsonPatchError(\"Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index\", \"OPERATION_PATH_ILLEGAL_ARRAY_INDEX\", index, operation, document);\n } // only parse key when it's an integer for `arr.prop` to work\n else if (isInteger(key)) {\n key = ~~key;\n }\n }\n if (t >= len) {\n if (validateOperation && operation.op === \"add\" && key > obj.length) {\n throw new JsonPatchError(\"The specified index MUST NOT be greater than the number of elements in the array\", \"OPERATION_VALUE_OUT_OF_BOUNDS\", index, operation, document);\n }\n var returnValue = arrOps[operation.op].call(operation, obj, key, document); // Apply patch\n if (returnValue.test === false) {\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n return returnValue;\n }\n }\n else {\n if (t >= len) {\n var returnValue = objOps[operation.op].call(operation, obj, key, document); // Apply patch\n if (returnValue.test === false) {\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n return returnValue;\n }\n }\n obj = obj[key];\n // If we have more keys in the path, but the next value isn't a non-null object,\n // throw an OPERATION_PATH_UNRESOLVABLE error instead of iterating again.\n if (validateOperation && t < len && (!obj || typeof obj !== \"object\")) {\n throw new JsonPatchError('Cannot perform operation at the desired path', 'OPERATION_PATH_UNRESOLVABLE', index, operation, document);\n }\n }\n }\n}\n/**\n * Apply a full JSON Patch array on a JSON document.\n * Returns the {newDocument, result} of the patch.\n * It modifies the `document` object and `patch` - it gets the values by reference.\n * If you would like to avoid touching your values, clone them:\n * `jsonpatch.applyPatch(document, jsonpatch._deepClone(patch))`.\n *\n * @param document The document to patch\n * @param patch The patch to apply\n * @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.\n * @param mutateDocument Whether to mutate the original document or clone it before applying\n * @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.\n * @return An array of `{newDocument, result}` after the patch\n */\nexport function applyPatch(document, patch, validateOperation, mutateDocument, banPrototypeModifications) {\n if (mutateDocument === void 0) { mutateDocument = true; }\n if (banPrototypeModifications === void 0) { banPrototypeModifications = true; }\n if (validateOperation) {\n if (!Array.isArray(patch)) {\n throw new JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');\n }\n }\n if (!mutateDocument) {\n document = _deepClone(document);\n }\n var results = new Array(patch.length);\n for (var i = 0, length_1 = patch.length; i < length_1; i++) {\n // we don't need to pass mutateDocument argument because if it was true, we already deep cloned the object, we'll just pass `true`\n results[i] = applyOperation(document, patch[i], validateOperation, true, banPrototypeModifications, i);\n document = results[i].newDocument; // in case root was replaced\n }\n results.newDocument = document;\n return results;\n}\n/**\n * Apply a single JSON Patch Operation on a JSON document.\n * Returns the updated document.\n * Suitable as a reducer.\n *\n * @param document The document to patch\n * @param operation The operation to apply\n * @return The updated document\n */\nexport function applyReducer(document, operation, index) {\n var operationResult = applyOperation(document, operation);\n if (operationResult.test === false) { // failed test\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n return operationResult.newDocument;\n}\n/**\n * Validates a single operation. Called from `jsonpatch.validate`. Throws `JsonPatchError` in case of an error.\n * @param {object} operation - operation object (patch)\n * @param {number} index - index of operation in the sequence\n * @param {object} [document] - object where the operation is supposed to be applied\n * @param {string} [existingPathFragment] - comes along with `document`\n */\nexport function validator(operation, index, document, existingPathFragment) {\n if (typeof operation !== 'object' || operation === null || Array.isArray(operation)) {\n throw new JsonPatchError('Operation is not an object', 'OPERATION_NOT_AN_OBJECT', index, operation, document);\n }\n else if (!objOps[operation.op]) {\n throw new JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document);\n }\n else if (typeof operation.path !== 'string') {\n throw new JsonPatchError('Operation `path` property is not a string', 'OPERATION_PATH_INVALID', index, operation, document);\n }\n else if (operation.path.indexOf('/') !== 0 && operation.path.length > 0) {\n // paths that aren't empty string should start with \"/\"\n throw new JsonPatchError('Operation `path` property must start with \"/\"', 'OPERATION_PATH_INVALID', index, operation, document);\n }\n else if ((operation.op === 'move' || operation.op === 'copy') && typeof operation.from !== 'string') {\n throw new JsonPatchError('Operation `from` property is not present (applicable in `move` and `copy` operations)', 'OPERATION_FROM_REQUIRED', index, operation, document);\n }\n else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && operation.value === undefined) {\n throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_REQUIRED', index, operation, document);\n }\n else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && hasUndefined(operation.value)) {\n throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED', index, operation, document);\n }\n else if (document) {\n if (operation.op == \"add\") {\n var pathLen = operation.path.split(\"/\").length;\n var existingPathLen = existingPathFragment.split(\"/\").length;\n if (pathLen !== existingPathLen + 1 && pathLen !== existingPathLen) {\n throw new JsonPatchError('Cannot perform an `add` operation at the desired path', 'OPERATION_PATH_CANNOT_ADD', index, operation, document);\n }\n }\n else if (operation.op === 'replace' || operation.op === 'remove' || operation.op === '_get') {\n if (operation.path !== existingPathFragment) {\n throw new JsonPatchError('Cannot perform the operation at a path that does not exist', 'OPERATION_PATH_UNRESOLVABLE', index, operation, document);\n }\n }\n else if (operation.op === 'move' || operation.op === 'copy') {\n var existingValue = { op: \"_get\", path: operation.from, value: undefined };\n var error = validate([existingValue], document);\n if (error && error.name === 'OPERATION_PATH_UNRESOLVABLE') {\n throw new JsonPatchError('Cannot perform the operation from a path that does not exist', 'OPERATION_FROM_UNRESOLVABLE', index, operation, document);\n }\n }\n }\n}\n/**\n * Validates a sequence of operations. If `document` parameter is provided, the sequence is additionally validated against the object document.\n * If error is encountered, returns a JsonPatchError object\n * @param sequence\n * @param document\n * @returns {JsonPatchError|undefined}\n */\nexport function validate(sequence, document, externalValidator) {\n try {\n if (!Array.isArray(sequence)) {\n throw new JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');\n }\n if (document) {\n //clone document and sequence so that we can safely try applying operations\n applyPatch(_deepClone(document), _deepClone(sequence), externalValidator || true);\n }\n else {\n externalValidator = externalValidator || validator;\n for (var i = 0; i < sequence.length; i++) {\n externalValidator(sequence[i], i, document, undefined);\n }\n }\n }\n catch (e) {\n if (e instanceof JsonPatchError) {\n return e;\n }\n else {\n throw e;\n }\n }\n}\n// based on https://github.com/epoberezkin/fast-deep-equal\n// MIT License\n// Copyright (c) 2017 Evgeny Poberezkin\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\nexport function _areEquals(a, b) {\n if (a === b)\n return true;\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = Array.isArray(a), arrB = Array.isArray(b), i, length, key;\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length)\n return false;\n for (i = length; i-- !== 0;)\n if (!_areEquals(a[i], b[i]))\n return false;\n return true;\n }\n if (arrA != arrB)\n return false;\n var keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length)\n return false;\n for (i = length; i-- !== 0;)\n if (!b.hasOwnProperty(keys[i]))\n return false;\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (!_areEquals(a[key], b[key]))\n return false;\n }\n return true;\n }\n return a !== a && b !== b;\n}\n;\n","/*!\n * https://github.com/Starcounter-Jack/JSON-Patch\n * (c) 2017-2021 Joachim Wester\n * MIT license\n */\nimport { _deepClone, _objectKeys, escapePathComponent, hasOwnProperty } from './helpers.mjs';\nimport { applyPatch } from './core.mjs';\nvar beforeDict = new WeakMap();\nvar Mirror = /** @class */ (function () {\n function Mirror(obj) {\n this.observers = new Map();\n this.obj = obj;\n }\n return Mirror;\n}());\nvar ObserverInfo = /** @class */ (function () {\n function ObserverInfo(callback, observer) {\n this.callback = callback;\n this.observer = observer;\n }\n return ObserverInfo;\n}());\nfunction getMirror(obj) {\n return beforeDict.get(obj);\n}\nfunction getObserverFromMirror(mirror, callback) {\n return mirror.observers.get(callback);\n}\nfunction removeObserverFromMirror(mirror, observer) {\n mirror.observers.delete(observer.callback);\n}\n/**\n * Detach an observer from an object\n */\nexport function unobserve(root, observer) {\n observer.unobserve();\n}\n/**\n * Observes changes made to an object, which can then be retrieved using generate\n */\nexport function observe(obj, callback) {\n var patches = [];\n var observer;\n var mirror = getMirror(obj);\n if (!mirror) {\n mirror = new Mirror(obj);\n beforeDict.set(obj, mirror);\n }\n else {\n var observerInfo = getObserverFromMirror(mirror, callback);\n observer = observerInfo && observerInfo.observer;\n }\n if (observer) {\n return observer;\n }\n observer = {};\n mirror.value = _deepClone(obj);\n if (callback) {\n observer.callback = callback;\n observer.next = null;\n var dirtyCheck = function () {\n generate(observer);\n };\n var fastCheck = function () {\n clearTimeout(observer.next);\n observer.next = setTimeout(dirtyCheck);\n };\n if (typeof window !== 'undefined') { //not Node\n window.addEventListener('mouseup', fastCheck);\n window.addEventListener('keyup', fastCheck);\n window.addEventListener('mousedown', fastCheck);\n window.addEventListener('keydown', fastCheck);\n window.addEventListener('change', fastCheck);\n }\n }\n observer.patches = patches;\n observer.object = obj;\n observer.unobserve = function () {\n generate(observer);\n clearTimeout(observer.next);\n removeObserverFromMirror(mirror, observer);\n if (typeof window !== 'undefined') {\n window.removeEventListener('mouseup', fastCheck);\n window.removeEventListener('keyup', fastCheck);\n window.removeEventListener('mousedown', fastCheck);\n window.removeEventListener('keydown', fastCheck);\n window.removeEventListener('change', fastCheck);\n }\n };\n mirror.observers.set(callback, new ObserverInfo(callback, observer));\n return observer;\n}\n/**\n * Generate an array of patches from an observer\n */\nexport function generate(observer, invertible) {\n if (invertible === void 0) { invertible = false; }\n var mirror = beforeDict.get(observer.object);\n _generate(mirror.value, observer.object, observer.patches, \"\", invertible);\n if (observer.patches.length) {\n applyPatch(mirror.value, observer.patches);\n }\n var temp = observer.patches;\n if (temp.length > 0) {\n observer.patches = [];\n if (observer.callback) {\n observer.callback(temp);\n }\n }\n return temp;\n}\n// Dirty check if obj is different from mirror, generate patches and update mirror\nfunction _generate(mirror, obj, patches, path, invertible) {\n if (obj === mirror) {\n return;\n }\n if (typeof obj.toJSON === \"function\") {\n obj = obj.toJSON();\n }\n var newKeys = _objectKeys(obj);\n var oldKeys = _objectKeys(mirror);\n var changed = false;\n var deleted = false;\n //if ever \"move\" operation is implemented here, make sure this test runs OK: \"should not generate the same patch twice (move)\"\n for (var t = oldKeys.length - 1; t >= 0; t--) {\n var key = oldKeys[t];\n var oldVal = mirror[key];\n if (hasOwnProperty(obj, key) && !(obj[key] === undefined && oldVal !== undefined && Array.isArray(obj) === false)) {\n var newVal = obj[key];\n if (typeof oldVal == \"object\" && oldVal != null && typeof newVal == \"object\" && newVal != null && Array.isArray(oldVal) === Array.isArray(newVal)) {\n _generate(oldVal, newVal, patches, path + \"/\" + escapePathComponent(key), invertible);\n }\n else {\n if (oldVal !== newVal) {\n changed = true;\n if (invertible) {\n patches.push({ op: \"test\", path: path + \"/\" + escapePathComponent(key), value: _deepClone(oldVal) });\n }\n patches.push({ op: \"replace\", path: path + \"/\" + escapePathComponent(key), value: _deepClone(newVal) });\n }\n }\n }\n else if (Array.isArray(mirror) === Array.isArray(obj)) {\n if (invertible) {\n patches.push({ op: \"test\", path: path + \"/\" + escapePathComponent(key), value: _deepClone(oldVal) });\n }\n patches.push({ op: \"remove\", path: path + \"/\" + escapePathComponent(key) });\n deleted = true; // property has been deleted\n }\n else {\n if (invertible) {\n patches.push({ op: \"test\", path: path, value: mirror });\n }\n patches.push({ op: \"replace\", path: path, value: obj });\n changed = true;\n }\n }\n if (!deleted && newKeys.length == oldKeys.length) {\n return;\n }\n for (var t = 0; t < newKeys.length; t++) {\n var key = newKeys[t];\n if (!hasOwnProperty(mirror, key) && obj[key] !== undefined) {\n patches.push({ op: \"add\", path: path + \"/\" + escapePathComponent(key), value: _deepClone(obj[key]) });\n }\n }\n}\n/**\n * Create an array of patches from the differences in two objects\n */\nexport function compare(tree1, tree2, invertible) {\n if (invertible === void 0) { invertible = false; }\n var patches = [];\n _generate(tree1, tree2, patches, '', invertible);\n return patches;\n}\n","export * from './module/core.mjs';\nexport * from './module/duplex.mjs';\nexport {\n PatchError as JsonPatchError,\n _deepClone as deepClone,\n escapePathComponent,\n unescapePathComponent\n} from './module/helpers.mjs';\n\n\n/**\n * Default export for backwards compat\n */\n\nimport * as core from './module/core.mjs';\nimport * as duplex from './module/duplex.mjs';\nimport {\n PatchError as JsonPatchError,\n _deepClone as deepClone,\n escapePathComponent,\n unescapePathComponent\n} from './module/helpers.mjs';\n\nexport default Object.assign({}, core, duplex, {\n JsonPatchError,\n deepClone,\n escapePathComponent,\n unescapePathComponent\n});","function accessor (fn, fields, name) {\n fn.fields = fields || [];\n fn.fname = name;\n return fn;\n}\nfunction accessorName(fn) {\n return fn == null ? null : fn.fname;\n}\nfunction accessorFields(fn) {\n return fn == null ? null : fn.fields;\n}\n\nfunction getter (path) {\n return path.length === 1 ? get1(path[0]) : getN(path);\n}\nconst get1 = field => function (obj) {\n return obj[field];\n};\nconst getN = path => {\n const len = path.length;\n return function (obj) {\n for (let i = 0; i < len; ++i) {\n obj = obj[path[i]];\n }\n return obj;\n };\n};\n\nfunction error (message) {\n throw Error(message);\n}\n\nfunction splitAccessPath (p) {\n const path = [],\n n = p.length;\n let q = null,\n b = 0,\n s = '',\n i,\n j,\n c;\n p = p + '';\n function push() {\n path.push(s + p.substring(i, j));\n s = '';\n i = j + 1;\n }\n for (i = j = 0; j < n; ++j) {\n c = p[j];\n if (c === '\\\\') {\n s += p.substring(i, j);\n s += p.substring(++j, ++j);\n i = j;\n } else if (c === q) {\n push();\n q = null;\n b = -1;\n } else if (q) {\n continue;\n } else if (i === b && c === '\"') {\n i = j + 1;\n q = c;\n } else if (i === b && c === \"'\") {\n i = j + 1;\n q = c;\n } else if (c === '.' && !b) {\n if (j > i) {\n push();\n } else {\n i = j + 1;\n }\n } else if (c === '[') {\n if (j > i) push();\n b = i = j + 1;\n } else if (c === ']') {\n if (!b) error('Access path missing open bracket: ' + p);\n if (b > 0) push();\n b = 0;\n i = j + 1;\n }\n }\n if (b) error('Access path missing closing bracket: ' + p);\n if (q) error('Access path missing closing quote: ' + p);\n if (j > i) {\n j++;\n push();\n }\n return path;\n}\n\nfunction field (field, name, opt) {\n const path = splitAccessPath(field);\n field = path.length === 1 ? path[0] : field;\n return accessor((opt && opt.get || getter)(path), [field], name || field);\n}\n\nconst id = field('id');\nconst identity = accessor(_ => _, [], 'identity');\nconst zero = accessor(() => 0, [], 'zero');\nconst one = accessor(() => 1, [], 'one');\nconst truthy = accessor(() => true, [], 'true');\nconst falsy = accessor(() => false, [], 'false');\n\nfunction log$1(method, level, input) {\n const args = [level].concat([].slice.call(input));\n console[method].apply(console, args); // eslint-disable-line no-console\n}\n\nconst None = 0;\nconst Error$1 = 1;\nconst Warn = 2;\nconst Info = 3;\nconst Debug = 4;\nfunction logger (_, method) {\n let handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : log$1;\n let level = _ || None;\n return {\n level(_) {\n if (arguments.length) {\n level = +_;\n return this;\n } else {\n return level;\n }\n },\n error() {\n if (level >= Error$1) handler(method || 'error', 'ERROR', arguments);\n return this;\n },\n warn() {\n if (level >= Warn) handler(method || 'warn', 'WARN', arguments);\n return this;\n },\n info() {\n if (level >= Info) handler(method || 'log', 'INFO', arguments);\n return this;\n },\n debug() {\n if (level >= Debug) handler(method || 'log', 'DEBUG', arguments);\n return this;\n }\n };\n}\n\nvar isArray = Array.isArray;\n\nfunction isObject (_) {\n return _ === Object(_);\n}\n\nconst isLegalKey = key => key !== '__proto__';\nfunction mergeConfig() {\n for (var _len = arguments.length, configs = new Array(_len), _key = 0; _key < _len; _key++) {\n configs[_key] = arguments[_key];\n }\n return configs.reduce((out, source) => {\n for (const key in source) {\n if (key === 'signals') {\n // for signals, we merge the signals arrays\n // source signals take precedence over\n // existing signals with the same name\n out.signals = mergeNamed(out.signals, source.signals);\n } else {\n // otherwise, merge objects subject to recursion constraints\n // for legend block, recurse for the layout entry only\n // for style block, recurse for all properties\n // otherwise, no recursion: objects overwrite, no merging\n const r = key === 'legend' ? {\n layout: 1\n } : key === 'style' ? true : null;\n writeConfig(out, key, source[key], r);\n }\n }\n return out;\n }, {});\n}\nfunction writeConfig(output, key, value, recurse) {\n if (!isLegalKey(key)) return;\n let k, o;\n if (isObject(value) && !isArray(value)) {\n o = isObject(output[key]) ? output[key] : output[key] = {};\n for (k in value) {\n if (recurse && (recurse === true || recurse[k])) {\n writeConfig(o, k, value[k]);\n } else if (isLegalKey(k)) {\n o[k] = value[k];\n }\n }\n } else {\n output[key] = value;\n }\n}\nfunction mergeNamed(a, b) {\n if (a == null) return b;\n const map = {},\n out = [];\n function add(_) {\n if (!map[_.name]) {\n map[_.name] = 1;\n out.push(_);\n }\n }\n b.forEach(add);\n a.forEach(add);\n return out;\n}\n\nfunction peek (array) {\n return array[array.length - 1];\n}\n\nfunction toNumber (_) {\n return _ == null || _ === '' ? null : +_;\n}\n\nconst exp = sign => x => sign * Math.exp(x);\nconst log = sign => x => Math.log(sign * x);\nconst symlog = c => x => Math.sign(x) * Math.log1p(Math.abs(x / c));\nconst symexp = c => x => Math.sign(x) * Math.expm1(Math.abs(x)) * c;\nconst pow = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\nfunction pan(domain, delta, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n dd = (d1 - d0) * delta;\n return [ground(d0 - dd), ground(d1 - dd)];\n}\nfunction panLinear(domain, delta) {\n return pan(domain, delta, toNumber, identity);\n}\nfunction panLog(domain, delta) {\n var sign = Math.sign(domain[0]);\n return pan(domain, delta, log(sign), exp(sign));\n}\nfunction panPow(domain, delta, exponent) {\n return pan(domain, delta, pow(exponent), pow(1 / exponent));\n}\nfunction panSymlog(domain, delta, constant) {\n return pan(domain, delta, symlog(constant), symexp(constant));\n}\nfunction zoom(domain, anchor, scale, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n da = anchor != null ? lift(anchor) : (d0 + d1) / 2;\n return [ground(da + (d0 - da) * scale), ground(da + (d1 - da) * scale)];\n}\nfunction zoomLinear(domain, anchor, scale) {\n return zoom(domain, anchor, scale, toNumber, identity);\n}\nfunction zoomLog(domain, anchor, scale) {\n const sign = Math.sign(domain[0]);\n return zoom(domain, anchor, scale, log(sign), exp(sign));\n}\nfunction zoomPow(domain, anchor, scale, exponent) {\n return zoom(domain, anchor, scale, pow(exponent), pow(1 / exponent));\n}\nfunction zoomSymlog(domain, anchor, scale, constant) {\n return zoom(domain, anchor, scale, symlog(constant), symexp(constant));\n}\n\nfunction quarter(date) {\n return 1 + ~~(new Date(date).getMonth() / 3);\n}\nfunction utcquarter(date) {\n return 1 + ~~(new Date(date).getUTCMonth() / 3);\n}\n\nfunction array (_) {\n return _ != null ? isArray(_) ? _ : [_] : [];\n}\n\n/**\n * Span-preserving range clamp. If the span of the input range is less\n * than (max - min) and an endpoint exceeds either the min or max value,\n * the range is translated such that the span is preserved and one\n * endpoint touches the boundary of the min/max range.\n * If the span exceeds (max - min), the range [min, max] is returned.\n */\nfunction clampRange (range, min, max) {\n let lo = range[0],\n hi = range[1],\n span;\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n span = hi - lo;\n return span >= max - min ? [min, max] : [lo = Math.min(Math.max(lo, min), max - span), lo + span];\n}\n\nfunction isFunction (_) {\n return typeof _ === 'function';\n}\n\nconst DESCENDING = 'descending';\nfunction compare (fields, orders, opt) {\n opt = opt || {};\n orders = array(orders) || [];\n const ord = [],\n get = [],\n fmap = {},\n gen = opt.comparator || comparator;\n array(fields).forEach((f, i) => {\n if (f == null) return;\n ord.push(orders[i] === DESCENDING ? -1 : 1);\n get.push(f = isFunction(f) ? f : field(f, null, opt));\n (accessorFields(f) || []).forEach(_ => fmap[_] = 1);\n });\n return get.length === 0 ? null : accessor(gen(get, ord), Object.keys(fmap));\n}\nconst ascending = (u, v) => (u < v || u == null) && v != null ? -1 : (u > v || v == null) && u != null ? 1 : (v = v instanceof Date ? +v : v, u = u instanceof Date ? +u : u) !== u && v === v ? -1 : v !== v && u === u ? 1 : 0;\nconst comparator = (fields, orders) => fields.length === 1 ? compare1(fields[0], orders[0]) : compareN(fields, orders, fields.length);\nconst compare1 = (field, order) => function (a, b) {\n return ascending(field(a), field(b)) * order;\n};\nconst compareN = (fields, orders, n) => {\n orders.push(0); // pad zero for convenient lookup\n return function (a, b) {\n let f,\n c = 0,\n i = -1;\n while (c === 0 && ++i < n) {\n f = fields[i];\n c = ascending(f(a), f(b));\n }\n return c * orders[i];\n };\n};\n\nfunction constant (_) {\n return isFunction(_) ? _ : () => _;\n}\n\nfunction debounce (delay, handler) {\n let tid;\n return e => {\n if (tid) clearTimeout(tid);\n tid = setTimeout(() => (handler(e), tid = null), delay);\n };\n}\n\nfunction extend (_) {\n for (let x, k, i = 1, len = arguments.length; i < len; ++i) {\n x = arguments[i];\n for (k in x) {\n _[k] = x[k];\n }\n }\n return _;\n}\n\n/**\n * Return an array with minimum and maximum values, in the\n * form [min, max]. Ignores null, undefined, and NaN values.\n */\nfunction extent (array, f) {\n let i = 0,\n n,\n v,\n min,\n max;\n if (array && (n = array.length)) {\n if (f == null) {\n // find first valid value\n for (v = array[i]; i < n && (v == null || v !== v); v = array[++i]);\n min = max = v;\n\n // visit all other values\n for (; i < n; ++i) {\n v = array[i];\n // skip null/undefined; NaN will fail all comparisons\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n } else {\n // find first valid value\n for (v = f(array[i]); i < n && (v == null || v !== v); v = f(array[++i]));\n min = max = v;\n\n // visit all other values\n for (; i < n; ++i) {\n v = f(array[i]);\n // skip null/undefined; NaN will fail all comparisons\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n }\n }\n return [min, max];\n}\n\nfunction extentIndex (array, f) {\n const n = array.length;\n let i = -1,\n a,\n b,\n c,\n u,\n v;\n if (f == null) {\n while (++i < n) {\n b = array[i];\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n if (i === n) return [-1, -1];\n u = v = i;\n while (++i < n) {\n b = array[i];\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n } else {\n while (++i < n) {\n b = f(array[i], i, array);\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n if (i === n) return [-1, -1];\n u = v = i;\n while (++i < n) {\n b = f(array[i], i, array);\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n }\n return [u, v];\n}\n\nconst hop = Object.prototype.hasOwnProperty;\nfunction has (object, property) {\n return hop.call(object, property);\n}\n\nconst NULL = {};\nfunction fastmap (input) {\n let obj = {},\n test;\n function has$1(key) {\n return has(obj, key) && obj[key] !== NULL;\n }\n const map = {\n size: 0,\n empty: 0,\n object: obj,\n has: has$1,\n get(key) {\n return has$1(key) ? obj[key] : undefined;\n },\n set(key, value) {\n if (!has$1(key)) {\n ++map.size;\n if (obj[key] === NULL) --map.empty;\n }\n obj[key] = value;\n return this;\n },\n delete(key) {\n if (has$1(key)) {\n --map.size;\n ++map.empty;\n obj[key] = NULL;\n }\n return this;\n },\n clear() {\n map.size = map.empty = 0;\n map.object = obj = {};\n },\n test(_) {\n if (arguments.length) {\n test = _;\n return map;\n } else {\n return test;\n }\n },\n clean() {\n const next = {};\n let size = 0;\n for (const key in obj) {\n const value = obj[key];\n if (value !== NULL && (!test || !test(value))) {\n next[key] = value;\n ++size;\n }\n }\n map.size = size;\n map.empty = 0;\n map.object = obj = next;\n }\n };\n if (input) Object.keys(input).forEach(key => {\n map.set(key, input[key]);\n });\n return map;\n}\n\nfunction flush (range, value, threshold, left, right, center) {\n if (!threshold && threshold !== 0) return center;\n const t = +threshold;\n let a = range[0],\n b = peek(range),\n l;\n\n // swap endpoints if range is reversed\n if (b < a) {\n l = a;\n a = b;\n b = l;\n }\n\n // compare value to endpoints\n l = Math.abs(value - a);\n const r = Math.abs(b - value);\n\n // adjust if value is within threshold distance of endpoint\n return l < r && l <= t ? left : r <= t ? right : center;\n}\n\nfunction inherits (child, parent, members) {\n const proto = child.prototype = Object.create(parent.prototype);\n Object.defineProperty(proto, 'constructor', {\n value: child,\n writable: true,\n enumerable: true,\n configurable: true\n });\n return extend(proto, members);\n}\n\n/**\n * Predicate that returns true if the value lies within the span\n * of the given range. The left and right flags control the use\n * of inclusive (true) or exclusive (false) comparisons.\n */\nfunction inrange (value, range, left, right) {\n let r0 = range[0],\n r1 = range[range.length - 1],\n t;\n if (r0 > r1) {\n t = r0;\n r0 = r1;\n r1 = t;\n }\n left = left === undefined || left;\n right = right === undefined || right;\n return (left ? r0 <= value : r0 < value) && (right ? value <= r1 : value < r1);\n}\n\nfunction isBoolean (_) {\n return typeof _ === 'boolean';\n}\n\nfunction isDate (_) {\n return Object.prototype.toString.call(_) === '[object Date]';\n}\n\nfunction isIterable (_) {\n return _ && isFunction(_[Symbol.iterator]);\n}\n\nfunction isNumber (_) {\n return typeof _ === 'number';\n}\n\nfunction isRegExp (_) {\n return Object.prototype.toString.call(_) === '[object RegExp]';\n}\n\nfunction isString (_) {\n return typeof _ === 'string';\n}\n\nfunction key (fields, flat, opt) {\n if (fields) {\n fields = flat ? array(fields).map(f => f.replace(/\\\\(.)/g, '$1')) : array(fields);\n }\n const len = fields && fields.length,\n gen = opt && opt.get || getter,\n map = f => gen(flat ? [f] : splitAccessPath(f));\n let fn;\n if (!len) {\n fn = function () {\n return '';\n };\n } else if (len === 1) {\n const get = map(fields[0]);\n fn = function (_) {\n return '' + get(_);\n };\n } else {\n const get = fields.map(map);\n fn = function (_) {\n let s = '' + get[0](_),\n i = 0;\n while (++i < len) s += '|' + get[i](_);\n return s;\n };\n }\n return accessor(fn, fields, 'key');\n}\n\nfunction lerp (array, frac) {\n const lo = array[0],\n hi = peek(array),\n f = +frac;\n return !f ? lo : f === 1 ? hi : lo + f * (hi - lo);\n}\n\nconst DEFAULT_MAX_SIZE = 10000;\n\n// adapted from https://github.com/dominictarr/hashlru/ (MIT License)\nfunction lruCache (maxsize) {\n maxsize = +maxsize || DEFAULT_MAX_SIZE;\n let curr, prev, size;\n const clear = () => {\n curr = {};\n prev = {};\n size = 0;\n };\n const update = (key, value) => {\n if (++size > maxsize) {\n prev = curr;\n curr = {};\n size = 1;\n }\n return curr[key] = value;\n };\n clear();\n return {\n clear,\n has: key => has(curr, key) || has(prev, key),\n get: key => has(curr, key) ? curr[key] : has(prev, key) ? update(key, prev[key]) : undefined,\n set: (key, value) => has(curr, key) ? curr[key] = value : update(key, value)\n };\n}\n\nfunction merge (compare, array0, array1, output) {\n const n0 = array0.length,\n n1 = array1.length;\n if (!n1) return array0;\n if (!n0) return array1;\n const merged = output || new array0.constructor(n0 + n1);\n let i0 = 0,\n i1 = 0,\n i = 0;\n for (; i0 < n0 && i1 < n1; ++i) {\n merged[i] = compare(array0[i0], array1[i1]) > 0 ? array1[i1++] : array0[i0++];\n }\n for (; i0 < n0; ++i0, ++i) {\n merged[i] = array0[i0];\n }\n for (; i1 < n1; ++i1, ++i) {\n merged[i] = array1[i1];\n }\n return merged;\n}\n\nfunction repeat (str, reps) {\n let s = '';\n while (--reps >= 0) s += str;\n return s;\n}\n\nfunction pad (str, length, padchar, align) {\n const c = padchar || ' ',\n s = str + '',\n n = length - s.length;\n return n <= 0 ? s : align === 'left' ? repeat(c, n) + s : align === 'center' ? repeat(c, ~~(n / 2)) + s + repeat(c, Math.ceil(n / 2)) : s + repeat(c, n);\n}\n\n/**\n * Return the numerical span of an array: the difference between\n * the last and first values.\n */\nfunction span (array) {\n return array && peek(array) - array[0] || 0;\n}\n\nfunction $(x) {\n return isArray(x) ? '[' + x.map($) + ']' : isObject(x) || isString(x) ?\n // Output valid JSON and JS source strings.\n // See http://timelessrepo.com/json-isnt-a-javascript-subset\n JSON.stringify(x).replace('\\u2028', '\\\\u2028').replace('\\u2029', '\\\\u2029') : x;\n}\n\nfunction toBoolean (_) {\n return _ == null || _ === '' ? null : !_ || _ === 'false' || _ === '0' ? false : !!_;\n}\n\nconst defaultParser = _ => isNumber(_) ? _ : isDate(_) ? _ : Date.parse(_);\nfunction toDate (_, parser) {\n parser = parser || defaultParser;\n return _ == null || _ === '' ? null : parser(_);\n}\n\nfunction toString (_) {\n return _ == null || _ === '' ? null : _ + '';\n}\n\nfunction toSet (_) {\n const s = {},\n n = _.length;\n for (let i = 0; i < n; ++i) s[_[i]] = true;\n return s;\n}\n\nfunction truncate (str, length, align, ellipsis) {\n const e = ellipsis != null ? ellipsis : '\\u2026',\n s = str + '',\n n = s.length,\n l = Math.max(0, length - e.length);\n return n <= length ? s : align === 'left' ? e + s.slice(n - l) : align === 'center' ? s.slice(0, Math.ceil(l / 2)) + e + s.slice(n - ~~(l / 2)) : s.slice(0, l) + e;\n}\n\nfunction visitArray (array, filter, visitor) {\n if (array) {\n if (filter) {\n const n = array.length;\n for (let i = 0; i < n; ++i) {\n const t = filter(array[i]);\n if (t) visitor(t, i, array);\n }\n } else {\n array.forEach(visitor);\n }\n }\n}\n\nexport { Debug, Error$1 as Error, Info, None, Warn, accessor, accessorFields, accessorName, array, ascending, clampRange, compare, constant, debounce, error, extend, extent, extentIndex, falsy, fastmap, field, flush, has as hasOwnProperty, id, identity, inherits, inrange, isArray, isBoolean, isDate, isFunction, isIterable, isNumber, isObject, isRegExp, isString, key, lerp, logger, lruCache, merge, mergeConfig, one, pad, panLinear, panLog, panPow, panSymlog, peek, quarter, repeat, span, splitAccessPath, $ as stringValue, toBoolean, toDate, toNumber, toSet, toString, truncate, truthy, utcquarter, visitArray, writeConfig, zero, zoomLinear, zoomLog, zoomPow, zoomSymlog };\n","var EOL = {},\n EOF = {},\n QUOTE = 34,\n NEWLINE = 10,\n RETURN = 13;\n\nfunction objectConverter(columns) {\n return new Function(\"d\", \"return {\" + columns.map(function(name, i) {\n return JSON.stringify(name) + \": d[\" + i + \"] || \\\"\\\"\";\n }).join(\",\") + \"}\");\n}\n\nfunction customConverter(columns, f) {\n var object = objectConverter(columns);\n return function(row, i) {\n return f(object(row), i, columns);\n };\n}\n\n// Compute unique columns in order of discovery.\nfunction inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}\n\nfunction pad(value, width) {\n var s = value + \"\", length = s.length;\n return length < width ? new Array(width - length + 1).join(0) + s : s;\n}\n\nfunction formatYear(year) {\n return year < 0 ? \"-\" + pad(-year, 6)\n : year > 9999 ? \"+\" + pad(year, 6)\n : pad(year, 4);\n}\n\nfunction formatDate(date) {\n var hours = date.getUTCHours(),\n minutes = date.getUTCMinutes(),\n seconds = date.getUTCSeconds(),\n milliseconds = date.getUTCMilliseconds();\n return isNaN(date) ? \"Invalid Date\"\n : formatYear(date.getUTCFullYear(), 4) + \"-\" + pad(date.getUTCMonth() + 1, 2) + \"-\" + pad(date.getUTCDate(), 2)\n + (milliseconds ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \":\" + pad(seconds, 2) + \".\" + pad(milliseconds, 3) + \"Z\"\n : seconds ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \":\" + pad(seconds, 2) + \"Z\"\n : minutes || hours ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \"Z\"\n : \"\");\n}\n\nexport default function(delimiter) {\n var reFormat = new RegExp(\"[\\\"\" + delimiter + \"\\n\\r]\"),\n DELIMITER = delimiter.charCodeAt(0);\n\n function parse(text, f) {\n var convert, columns, rows = parseRows(text, function(row, i) {\n if (convert) return convert(row, i - 1);\n columns = row, convert = f ? customConverter(row, f) : objectConverter(row);\n });\n rows.columns = columns || [];\n return rows;\n }\n\n function parseRows(text, f) {\n var rows = [], // output rows\n N = text.length,\n I = 0, // current character index\n n = 0, // current line number\n t, // current token\n eof = N <= 0, // current token followed by EOF?\n eol = false; // current token followed by EOL?\n\n // Strip the trailing newline.\n if (text.charCodeAt(N - 1) === NEWLINE) --N;\n if (text.charCodeAt(N - 1) === RETURN) --N;\n\n function token() {\n if (eof) return EOF;\n if (eol) return eol = false, EOL;\n\n // Unescape quotes.\n var i, j = I, c;\n if (text.charCodeAt(j) === QUOTE) {\n while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE);\n if ((i = I) >= N) eof = true;\n else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true;\n else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }\n return text.slice(j + 1, i - 1).replace(/\"\"/g, \"\\\"\");\n }\n\n // Find next delimiter or newline.\n while (I < N) {\n if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true;\n else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }\n else if (c !== DELIMITER) continue;\n return text.slice(j, i);\n }\n\n // Return last token before EOF.\n return eof = true, text.slice(j, N);\n }\n\n while ((t = token()) !== EOF) {\n var row = [];\n while (t !== EOL && t !== EOF) row.push(t), t = token();\n if (f && (row = f(row, n++)) == null) continue;\n rows.push(row);\n }\n\n return rows;\n }\n\n function preformatBody(rows, columns) {\n return rows.map(function(row) {\n return columns.map(function(column) {\n return formatValue(row[column]);\n }).join(delimiter);\n });\n }\n\n function format(rows, columns) {\n if (columns == null) columns = inferColumns(rows);\n return [columns.map(formatValue).join(delimiter)].concat(preformatBody(rows, columns)).join(\"\\n\");\n }\n\n function formatBody(rows, columns) {\n if (columns == null) columns = inferColumns(rows);\n return preformatBody(rows, columns).join(\"\\n\");\n }\n\n function formatRows(rows) {\n return rows.map(formatRow).join(\"\\n\");\n }\n\n function formatRow(row) {\n return row.map(formatValue).join(delimiter);\n }\n\n function formatValue(value) {\n return value == null ? \"\"\n : value instanceof Date ? formatDate(value)\n : reFormat.test(value += \"\") ? \"\\\"\" + value.replace(/\"/g, \"\\\"\\\"\") + \"\\\"\"\n : value;\n }\n\n return {\n parse: parse,\n parseRows: parseRows,\n format: format,\n formatBody: formatBody,\n formatRows: formatRows,\n formatRow: formatRow,\n formatValue: formatValue\n };\n}\n","export default function(x) {\n return x;\n}\n","import reverse from \"./reverse.js\";\nimport transform from \"./transform.js\";\n\nexport default function(topology, o) {\n if (typeof o === \"string\") o = topology.objects[o];\n return o.type === \"GeometryCollection\"\n ? {type: \"FeatureCollection\", features: o.geometries.map(function(o) { return feature(topology, o); })}\n : feature(topology, o);\n}\n\nfunction feature(topology, o) {\n var id = o.id,\n bbox = o.bbox,\n properties = o.properties == null ? {} : o.properties,\n geometry = object(topology, o);\n return id == null && bbox == null ? {type: \"Feature\", properties: properties, geometry: geometry}\n : bbox == null ? {type: \"Feature\", id: id, properties: properties, geometry: geometry}\n : {type: \"Feature\", id: id, bbox: bbox, properties: properties, geometry: geometry};\n}\n\nexport function object(topology, o) {\n var transformPoint = transform(topology.transform),\n arcs = topology.arcs;\n\n function arc(i, points) {\n if (points.length) points.pop();\n for (var a = arcs[i < 0 ? ~i : i], k = 0, n = a.length; k < n; ++k) {\n points.push(transformPoint(a[k], k));\n }\n if (i < 0) reverse(points, n);\n }\n\n function point(p) {\n return transformPoint(p);\n }\n\n function line(arcs) {\n var points = [];\n for (var i = 0, n = arcs.length; i < n; ++i) arc(arcs[i], points);\n if (points.length < 2) points.push(points[0]); // This should never happen per the specification.\n return points;\n }\n\n function ring(arcs) {\n var points = line(arcs);\n while (points.length < 4) points.push(points[0]); // This may happen if an arc has only two points.\n return points;\n }\n\n function polygon(arcs) {\n return arcs.map(ring);\n }\n\n function geometry(o) {\n var type = o.type, coordinates;\n switch (type) {\n case \"GeometryCollection\": return {type: type, geometries: o.geometries.map(geometry)};\n case \"Point\": coordinates = point(o.coordinates); break;\n case \"MultiPoint\": coordinates = o.coordinates.map(point); break;\n case \"LineString\": coordinates = line(o.arcs); break;\n case \"MultiLineString\": coordinates = o.arcs.map(line); break;\n case \"Polygon\": coordinates = polygon(o.arcs); break;\n case \"MultiPolygon\": coordinates = o.arcs.map(polygon); break;\n default: return null;\n }\n return {type: type, coordinates: coordinates};\n }\n\n return geometry(o);\n}\n","import identity from \"./identity.js\";\n\nexport default function(transform) {\n if (transform == null) return identity;\n var x0,\n y0,\n kx = transform.scale[0],\n ky = transform.scale[1],\n dx = transform.translate[0],\n dy = transform.translate[1];\n return function(input, i) {\n if (!i) x0 = y0 = 0;\n var j = 2, n = input.length, output = new Array(n);\n output[0] = (x0 += input[0]) * kx + dx;\n output[1] = (y0 += input[1]) * ky + dy;\n while (j < n) output[j] = input[j], ++j;\n return output;\n };\n}\n","export default function(array, n) {\n var t, j = array.length, i = j - n;\n while (i < --j) t = array[i], array[i++] = array[j], array[j] = t;\n}\n","export default function(topology, arcs) {\n var stitchedArcs = {},\n fragmentByStart = {},\n fragmentByEnd = {},\n fragments = [],\n emptyIndex = -1;\n\n // Stitch empty arcs first, since they may be subsumed by other arcs.\n arcs.forEach(function(i, j) {\n var arc = topology.arcs[i < 0 ? ~i : i], t;\n if (arc.length < 3 && !arc[1][0] && !arc[1][1]) {\n t = arcs[++emptyIndex], arcs[emptyIndex] = i, arcs[j] = t;\n }\n });\n\n arcs.forEach(function(i) {\n var e = ends(i),\n start = e[0],\n end = e[1],\n f, g;\n\n if (f = fragmentByEnd[start]) {\n delete fragmentByEnd[f.end];\n f.push(i);\n f.end = end;\n if (g = fragmentByStart[end]) {\n delete fragmentByStart[g.start];\n var fg = g === f ? f : f.concat(g);\n fragmentByStart[fg.start = f.start] = fragmentByEnd[fg.end = g.end] = fg;\n } else {\n fragmentByStart[f.start] = fragmentByEnd[f.end] = f;\n }\n } else if (f = fragmentByStart[end]) {\n delete fragmentByStart[f.start];\n f.unshift(i);\n f.start = start;\n if (g = fragmentByEnd[start]) {\n delete fragmentByEnd[g.end];\n var gf = g === f ? f : g.concat(f);\n fragmentByStart[gf.start = g.start] = fragmentByEnd[gf.end = f.end] = gf;\n } else {\n fragmentByStart[f.start] = fragmentByEnd[f.end] = f;\n }\n } else {\n f = [i];\n fragmentByStart[f.start = start] = fragmentByEnd[f.end = end] = f;\n }\n });\n\n function ends(i) {\n var arc = topology.arcs[i < 0 ? ~i : i], p0 = arc[0], p1;\n if (topology.transform) p1 = [0, 0], arc.forEach(function(dp) { p1[0] += dp[0], p1[1] += dp[1]; });\n else p1 = arc[arc.length - 1];\n return i < 0 ? [p1, p0] : [p0, p1];\n }\n\n function flush(fragmentByEnd, fragmentByStart) {\n for (var k in fragmentByEnd) {\n var f = fragmentByEnd[k];\n delete fragmentByStart[f.start];\n delete f.start;\n delete f.end;\n f.forEach(function(i) { stitchedArcs[i < 0 ? ~i : i] = 1; });\n fragments.push(f);\n }\n }\n\n flush(fragmentByEnd, fragmentByStart);\n flush(fragmentByStart, fragmentByEnd);\n arcs.forEach(function(i) { if (!stitchedArcs[i < 0 ? ~i : i]) fragments.push([i]); });\n\n return fragments;\n}\n","import {object} from \"./feature.js\";\nimport stitch from \"./stitch.js\";\n\nexport default function(topology) {\n return object(topology, meshArcs.apply(this, arguments));\n}\n\nexport function meshArcs(topology, object, filter) {\n var arcs, i, n;\n if (arguments.length > 1) arcs = extractArcs(topology, object, filter);\n else for (i = 0, arcs = new Array(n = topology.arcs.length); i < n; ++i) arcs[i] = i;\n return {type: \"MultiLineString\", arcs: stitch(topology, arcs)};\n}\n\nfunction extractArcs(topology, object, filter) {\n var arcs = [],\n geomsByArc = [],\n geom;\n\n function extract0(i) {\n var j = i < 0 ? ~i : i;\n (geomsByArc[j] || (geomsByArc[j] = [])).push({i: i, g: geom});\n }\n\n function extract1(arcs) {\n arcs.forEach(extract0);\n }\n\n function extract2(arcs) {\n arcs.forEach(extract1);\n }\n\n function extract3(arcs) {\n arcs.forEach(extract2);\n }\n\n function geometry(o) {\n switch (geom = o, o.type) {\n case \"GeometryCollection\": o.geometries.forEach(geometry); break;\n case \"LineString\": extract1(o.arcs); break;\n case \"MultiLineString\": case \"Polygon\": extract2(o.arcs); break;\n case \"MultiPolygon\": extract3(o.arcs); break;\n }\n }\n\n geometry(object);\n\n geomsByArc.forEach(filter == null\n ? function(geoms) { arcs.push(geoms[0].i); }\n : function(geoms) { if (filter(geoms[0].g, geoms[geoms.length - 1].g)) arcs.push(geoms[0].i); });\n\n return arcs;\n}\n","const e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n const step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log10(step)),\n error = step / Math.pow(10, power),\n factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n let i1, i2, inc;\n if (power < 0) {\n inc = Math.pow(10, -power) / factor;\n i1 = Math.round(start * inc);\n i2 = Math.round(stop * inc);\n if (i1 / inc < start) ++i1;\n if (i2 / inc > stop) --i2;\n inc = -inc;\n } else {\n inc = Math.pow(10, power) * factor;\n i1 = Math.round(start / inc);\n i2 = Math.round(stop / inc);\n if (i1 * inc < start) ++i1;\n if (i2 * inc > stop) --i2;\n }\n if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n if (!(count > 0)) return [];\n if (start === stop) return [start];\n const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n if (!(i2 >= i1)) return [];\n const n = i2 - i1 + 1, ticks = new Array(n);\n if (reverse) {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n } else {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n }\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n","// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n","export default function(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n","import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": (x, p) => (x * 100).toFixed(p),\n \"b\": (x) => Math.round(x).toString(2),\n \"c\": (x) => x + \"\",\n \"d\": formatDecimal,\n \"e\": (x, p) => x.toExponential(p),\n \"f\": (x, p) => x.toFixed(p),\n \"g\": (x, p) => x.toPrecision(p),\n \"o\": (x) => Math.round(x).toString(8),\n \"p\": (x, p) => formatRounded(x * 100, p),\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n \"x\": (x) => Math.round(x).toString(16)\n};\n","export default function(x) {\n return x;\n}\n","import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"−\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n","export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n","export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n","// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n","const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = (date) => {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = (date) => {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = (date) => {\n const d0 = interval(date), d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = (date, step) => {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = (start, stop, step) => {\n const range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n let previous;\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = (test) => {\n return timeInterval((date) => {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, (date, step) => {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = (start, end) => {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = (step) => {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? (d) => field(d) % step === 0\n : (d) => interval.count(0, d) % step === 0);\n };\n }\n\n return interval;\n}\n","export const durationSecond = 1000;\nexport const durationMinute = durationSecond * 60;\nexport const durationHour = durationMinute * 60;\nexport const durationDay = durationHour * 24;\nexport const durationWeek = durationDay * 7;\nexport const durationMonth = durationDay * 30;\nexport const durationYear = durationDay * 365;\n","import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n return timeInterval((date) => {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setDate(date.getDate() + step * 7);\n }, (start, end) => {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n return timeInterval((date) => {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, (start, end) => {\n return (end - start) / durationWeek;\n });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n return end.getFullYear() - start.getFullYear();\n}, (date) => {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport const utcYears = utcYear.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n return (end - start) / durationSecond;\n}, (date) => {\n return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const millisecond = timeInterval(() => {\n // noop\n}, (date, step) => {\n date.setTime(+date + step);\n}, (start, end) => {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = (k) => {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return timeInterval((date) => {\n date.setTime(Math.floor(date / k) * k);\n }, (date, step) => {\n date.setTime(+date + step * k);\n }, (start, end) => {\n return (end - start) / k;\n });\n};\n\nexport const milliseconds = millisecond.range;\n","export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n","import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can’t do this\n // for a comparator (except for specific, known comparators) because we can’t\n // tell if the comparator is symmetric, and an asymmetric comparator can’t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n","import { array, error, hasOwnProperty, extend, peek, toSet, constant, zero, one, span } from 'vega-util';\nimport { timeDay, timeWeek, utcDay, utcWeek, timeYear, timeMonth, timeHour, timeMinute, timeSecond, timeMillisecond, utcYear, utcMonth, utcHour, utcMinute, utcSecond, utcMillisecond } from 'd3-time';\nimport { bisector, tickStep } from 'd3-array';\n\nconst YEAR = 'year';\nconst QUARTER = 'quarter';\nconst MONTH = 'month';\nconst WEEK = 'week';\nconst DATE = 'date';\nconst DAY = 'day';\nconst DAYOFYEAR = 'dayofyear';\nconst HOURS = 'hours';\nconst MINUTES = 'minutes';\nconst SECONDS = 'seconds';\nconst MILLISECONDS = 'milliseconds';\nconst TIME_UNITS = [YEAR, QUARTER, MONTH, WEEK, DATE, DAY, DAYOFYEAR, HOURS, MINUTES, SECONDS, MILLISECONDS];\nconst UNITS = TIME_UNITS.reduce((o, u, i) => (o[u] = 1 + i, o), {});\nfunction timeUnits(units) {\n const u = array(units).slice(),\n m = {};\n\n // check validity\n if (!u.length) error('Missing time unit.');\n u.forEach(unit => {\n if (hasOwnProperty(UNITS, unit)) {\n m[unit] = 1;\n } else {\n error(`Invalid time unit: ${unit}.`);\n }\n });\n const numTypes = (m[WEEK] || m[DAY] ? 1 : 0) + (m[QUARTER] || m[MONTH] || m[DATE] ? 1 : 0) + (m[DAYOFYEAR] ? 1 : 0);\n if (numTypes > 1) {\n error(`Incompatible time units: ${units}`);\n }\n\n // ensure proper sort order\n u.sort((a, b) => UNITS[a] - UNITS[b]);\n return u;\n}\nconst defaultSpecifiers = {\n [YEAR]: '%Y ',\n [QUARTER]: 'Q%q ',\n [MONTH]: '%b ',\n [DATE]: '%d ',\n [WEEK]: 'W%U ',\n [DAY]: '%a ',\n [DAYOFYEAR]: '%j ',\n [HOURS]: '%H:00',\n [MINUTES]: '00:%M',\n [SECONDS]: ':%S',\n [MILLISECONDS]: '.%L',\n [`${YEAR}-${MONTH}`]: '%Y-%m ',\n [`${YEAR}-${MONTH}-${DATE}`]: '%Y-%m-%d ',\n [`${HOURS}-${MINUTES}`]: '%H:%M'\n};\nfunction timeUnitSpecifier(units, specifiers) {\n const s = extend({}, defaultSpecifiers, specifiers),\n u = timeUnits(units),\n n = u.length;\n let fmt = '',\n start = 0,\n end,\n key;\n for (start = 0; start < n;) {\n for (end = u.length; end > start; --end) {\n key = u.slice(start, end).join('-');\n if (s[key] != null) {\n fmt += s[key];\n start = end;\n break;\n }\n }\n }\n return fmt.trim();\n}\n\nconst t0 = new Date();\nfunction localYear(y) {\n t0.setFullYear(y);\n t0.setMonth(0);\n t0.setDate(1);\n t0.setHours(0, 0, 0, 0);\n return t0;\n}\nfunction dayofyear(d) {\n return localDayOfYear(new Date(d));\n}\nfunction week(d) {\n return localWeekNum(new Date(d));\n}\nfunction localDayOfYear(d) {\n return timeDay.count(localYear(d.getFullYear()) - 1, d);\n}\nfunction localWeekNum(d) {\n return timeWeek.count(localYear(d.getFullYear()) - 1, d);\n}\nfunction localFirst(y) {\n return localYear(y).getDay();\n}\nfunction localDate(y, m, d, H, M, S, L) {\n if (0 <= y && y < 100) {\n const date = new Date(-1, m, d, H, M, S, L);\n date.setFullYear(y);\n return date;\n }\n return new Date(y, m, d, H, M, S, L);\n}\nfunction utcdayofyear(d) {\n return utcDayOfYear(new Date(d));\n}\nfunction utcweek(d) {\n return utcWeekNum(new Date(d));\n}\nfunction utcDayOfYear(d) {\n const y = Date.UTC(d.getUTCFullYear(), 0, 1);\n return utcDay.count(y - 1, d);\n}\nfunction utcWeekNum(d) {\n const y = Date.UTC(d.getUTCFullYear(), 0, 1);\n return utcWeek.count(y - 1, d);\n}\nfunction utcFirst(y) {\n t0.setTime(Date.UTC(y, 0, 1));\n return t0.getUTCDay();\n}\nfunction utcDate(y, m, d, H, M, S, L) {\n if (0 <= y && y < 100) {\n const date = new Date(Date.UTC(-1, m, d, H, M, S, L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(y, m, d, H, M, S, L));\n}\n\nfunction floor(units, step, get, inv, newDate) {\n const s = step || 1,\n b = peek(units),\n _ = (unit, p, key) => {\n key = key || unit;\n return getUnit(get[key], inv[key], unit === b && s, p);\n };\n const t = new Date(),\n u = toSet(units),\n y = u[YEAR] ? _(YEAR) : constant(2012),\n m = u[MONTH] ? _(MONTH) : u[QUARTER] ? _(QUARTER) : zero,\n d = u[WEEK] && u[DAY] ? _(DAY, 1, WEEK + DAY) : u[WEEK] ? _(WEEK, 1) : u[DAY] ? _(DAY, 1) : u[DATE] ? _(DATE, 1) : u[DAYOFYEAR] ? _(DAYOFYEAR, 1) : one,\n H = u[HOURS] ? _(HOURS) : zero,\n M = u[MINUTES] ? _(MINUTES) : zero,\n S = u[SECONDS] ? _(SECONDS) : zero,\n L = u[MILLISECONDS] ? _(MILLISECONDS) : zero;\n return function (v) {\n t.setTime(+v);\n const year = y(t);\n return newDate(year, m(t), d(t, year), H(t), M(t), S(t), L(t));\n };\n}\nfunction getUnit(f, inv, step, phase) {\n const u = step <= 1 ? f : phase ? (d, y) => phase + step * Math.floor((f(d, y) - phase) / step) : (d, y) => step * Math.floor(f(d, y) / step);\n return inv ? (d, y) => inv(u(d, y), y) : u;\n}\n\n// returns the day of the year based on week number, day of week,\n// and the day of the week for the first day of the year\nfunction weekday(week, day, firstDay) {\n return day + week * 7 - (firstDay + 6) % 7;\n}\n\n// -- LOCAL TIME --\n\nconst localGet = {\n [YEAR]: d => d.getFullYear(),\n [QUARTER]: d => Math.floor(d.getMonth() / 3),\n [MONTH]: d => d.getMonth(),\n [DATE]: d => d.getDate(),\n [HOURS]: d => d.getHours(),\n [MINUTES]: d => d.getMinutes(),\n [SECONDS]: d => d.getSeconds(),\n [MILLISECONDS]: d => d.getMilliseconds(),\n [DAYOFYEAR]: d => localDayOfYear(d),\n [WEEK]: d => localWeekNum(d),\n [WEEK + DAY]: (d, y) => weekday(localWeekNum(d), d.getDay(), localFirst(y)),\n [DAY]: (d, y) => weekday(1, d.getDay(), localFirst(y))\n};\nconst localInv = {\n [QUARTER]: q => 3 * q,\n [WEEK]: (w, y) => weekday(w, 0, localFirst(y))\n};\nfunction timeFloor(units, step) {\n return floor(units, step || 1, localGet, localInv, localDate);\n}\n\n// -- UTC TIME --\n\nconst utcGet = {\n [YEAR]: d => d.getUTCFullYear(),\n [QUARTER]: d => Math.floor(d.getUTCMonth() / 3),\n [MONTH]: d => d.getUTCMonth(),\n [DATE]: d => d.getUTCDate(),\n [HOURS]: d => d.getUTCHours(),\n [MINUTES]: d => d.getUTCMinutes(),\n [SECONDS]: d => d.getUTCSeconds(),\n [MILLISECONDS]: d => d.getUTCMilliseconds(),\n [DAYOFYEAR]: d => utcDayOfYear(d),\n [WEEK]: d => utcWeekNum(d),\n [DAY]: (d, y) => weekday(1, d.getUTCDay(), utcFirst(y)),\n [WEEK + DAY]: (d, y) => weekday(utcWeekNum(d), d.getUTCDay(), utcFirst(y))\n};\nconst utcInv = {\n [QUARTER]: q => 3 * q,\n [WEEK]: (w, y) => weekday(w, 0, utcFirst(y))\n};\nfunction utcFloor(units, step) {\n return floor(units, step || 1, utcGet, utcInv, utcDate);\n}\n\nconst timeIntervals = {\n [YEAR]: timeYear,\n [QUARTER]: timeMonth.every(3),\n [MONTH]: timeMonth,\n [WEEK]: timeWeek,\n [DATE]: timeDay,\n [DAY]: timeDay,\n [DAYOFYEAR]: timeDay,\n [HOURS]: timeHour,\n [MINUTES]: timeMinute,\n [SECONDS]: timeSecond,\n [MILLISECONDS]: timeMillisecond\n};\nconst utcIntervals = {\n [YEAR]: utcYear,\n [QUARTER]: utcMonth.every(3),\n [MONTH]: utcMonth,\n [WEEK]: utcWeek,\n [DATE]: utcDay,\n [DAY]: utcDay,\n [DAYOFYEAR]: utcDay,\n [HOURS]: utcHour,\n [MINUTES]: utcMinute,\n [SECONDS]: utcSecond,\n [MILLISECONDS]: utcMillisecond\n};\nfunction timeInterval(unit) {\n return timeIntervals[unit];\n}\nfunction utcInterval(unit) {\n return utcIntervals[unit];\n}\nfunction offset(ival, date, step) {\n return ival ? ival.offset(date, step) : undefined;\n}\nfunction timeOffset(unit, date, step) {\n return offset(timeInterval(unit), date, step);\n}\nfunction utcOffset(unit, date, step) {\n return offset(utcInterval(unit), date, step);\n}\nfunction sequence(ival, start, stop, step) {\n return ival ? ival.range(start, stop, step) : undefined;\n}\nfunction timeSequence(unit, start, stop, step) {\n return sequence(timeInterval(unit), start, stop, step);\n}\nfunction utcSequence(unit, start, stop, step) {\n return sequence(utcInterval(unit), start, stop, step);\n}\n\nconst durationSecond = 1000,\n durationMinute = durationSecond * 60,\n durationHour = durationMinute * 60,\n durationDay = durationHour * 24,\n durationWeek = durationDay * 7,\n durationMonth = durationDay * 30,\n durationYear = durationDay * 365;\nconst Milli = [YEAR, MONTH, DATE, HOURS, MINUTES, SECONDS, MILLISECONDS],\n Seconds = Milli.slice(0, -1),\n Minutes = Seconds.slice(0, -1),\n Hours = Minutes.slice(0, -1),\n Day = Hours.slice(0, -1),\n Week = [YEAR, WEEK],\n Month = [YEAR, MONTH],\n Year = [YEAR];\nconst intervals = [[Seconds, 1, durationSecond], [Seconds, 5, 5 * durationSecond], [Seconds, 15, 15 * durationSecond], [Seconds, 30, 30 * durationSecond], [Minutes, 1, durationMinute], [Minutes, 5, 5 * durationMinute], [Minutes, 15, 15 * durationMinute], [Minutes, 30, 30 * durationMinute], [Hours, 1, durationHour], [Hours, 3, 3 * durationHour], [Hours, 6, 6 * durationHour], [Hours, 12, 12 * durationHour], [Day, 1, durationDay], [Week, 1, durationWeek], [Month, 1, durationMonth], [Month, 3, 3 * durationMonth], [Year, 1, durationYear]];\nfunction bin (opt) {\n const ext = opt.extent,\n max = opt.maxbins || 40,\n target = Math.abs(span(ext)) / max;\n let i = bisector(i => i[2]).right(intervals, target),\n units,\n step;\n if (i === intervals.length) {\n units = Year, step = tickStep(ext[0] / durationYear, ext[1] / durationYear, max);\n } else if (i) {\n i = intervals[target / intervals[i - 1][2] < intervals[i][2] / target ? i - 1 : i];\n units = i[0];\n step = i[1];\n } else {\n units = Milli;\n step = Math.max(tickStep(ext[0], ext[1], max), 1);\n }\n return {\n units,\n step\n };\n}\n\nexport { DATE, DAY, DAYOFYEAR, HOURS, MILLISECONDS, MINUTES, MONTH, QUARTER, SECONDS, TIME_UNITS, WEEK, YEAR, dayofyear, bin as timeBin, timeFloor, timeInterval, timeOffset, timeSequence, timeUnitSpecifier, timeUnits, utcFloor, utcInterval, utcOffset, utcSequence, utcdayofyear, utcweek, week };\n","import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n return new Map(names.map((name, i) => [name.toLowerCase(), i]));\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n","import { tickStep } from 'd3-array';\nimport { formatSpecifier, precisionFixed, precisionRound, precisionPrefix, format, formatPrefix, formatLocale } from 'd3-format';\nimport { SECONDS, MINUTES, HOURS, DATE, WEEK, MONTH, QUARTER, YEAR, MILLISECONDS, DAY, timeInterval, utcInterval } from 'vega-time';\nimport { isString, isObject, error, extend } from 'vega-util';\nimport { timeFormat, timeParse, utcFormat, utcParse, timeFormatLocale as timeFormatLocale$1 } from 'd3-time-format';\n\nfunction memoize (method) {\n const cache = {};\n return spec => cache[spec] || (cache[spec] = method(spec));\n}\n\nfunction trimZeroes(numberFormat, decimalChar) {\n return x => {\n const str = numberFormat(x),\n dec = str.indexOf(decimalChar);\n if (dec < 0) return str;\n let idx = rightmostDigit(str, dec);\n const end = idx < str.length ? str.slice(idx) : '';\n while (--idx > dec) if (str[idx] !== '0') {\n ++idx;\n break;\n }\n return str.slice(0, idx) + end;\n };\n}\nfunction rightmostDigit(str, dec) {\n let i = str.lastIndexOf('e'),\n c;\n if (i > 0) return i;\n for (i = str.length; --i > dec;) {\n c = str.charCodeAt(i);\n if (c >= 48 && c <= 57) return i + 1; // is digit\n }\n}\n\nfunction numberLocale(locale) {\n const format = memoize(locale.format),\n formatPrefix = locale.formatPrefix;\n return {\n format,\n formatPrefix,\n formatFloat(spec) {\n const s = formatSpecifier(spec || ',');\n if (s.precision == null) {\n s.precision = 12;\n switch (s.type) {\n case '%':\n s.precision -= 2;\n break;\n case 'e':\n s.precision -= 1;\n break;\n }\n return trimZeroes(format(s),\n // number format\n format('.1f')(1)[1] // decimal point character\n );\n } else {\n return format(s);\n }\n },\n formatSpan(start, stop, count, specifier) {\n specifier = formatSpecifier(specifier == null ? ',f' : specifier);\n const step = tickStep(start, stop, count),\n value = Math.max(Math.abs(start), Math.abs(stop));\n let precision;\n if (specifier.precision == null) {\n switch (specifier.type) {\n case 's':\n {\n if (!isNaN(precision = precisionPrefix(step, value))) {\n specifier.precision = precision;\n }\n return formatPrefix(specifier, value);\n }\n case '':\n case 'e':\n case 'g':\n case 'p':\n case 'r':\n {\n if (!isNaN(precision = precisionRound(step, value))) {\n specifier.precision = precision - (specifier.type === 'e');\n }\n break;\n }\n case 'f':\n case '%':\n {\n if (!isNaN(precision = precisionFixed(step))) {\n specifier.precision = precision - (specifier.type === '%') * 2;\n }\n break;\n }\n }\n }\n return format(specifier);\n }\n };\n}\nlet defaultNumberLocale;\nresetNumberFormatDefaultLocale();\nfunction resetNumberFormatDefaultLocale() {\n return defaultNumberLocale = numberLocale({\n format: format,\n formatPrefix: formatPrefix\n });\n}\nfunction numberFormatLocale(definition) {\n return numberLocale(formatLocale(definition));\n}\nfunction numberFormatDefaultLocale(definition) {\n return arguments.length ? defaultNumberLocale = numberFormatLocale(definition) : defaultNumberLocale;\n}\n\nfunction timeMultiFormat(format, interval, spec) {\n spec = spec || {};\n if (!isObject(spec)) {\n error(`Invalid time multi-format specifier: ${spec}`);\n }\n const second = interval(SECONDS),\n minute = interval(MINUTES),\n hour = interval(HOURS),\n day = interval(DATE),\n week = interval(WEEK),\n month = interval(MONTH),\n quarter = interval(QUARTER),\n year = interval(YEAR),\n L = format(spec[MILLISECONDS] || '.%L'),\n S = format(spec[SECONDS] || ':%S'),\n M = format(spec[MINUTES] || '%I:%M'),\n H = format(spec[HOURS] || '%I %p'),\n d = format(spec[DATE] || spec[DAY] || '%a %d'),\n w = format(spec[WEEK] || '%b %d'),\n m = format(spec[MONTH] || '%B'),\n q = format(spec[QUARTER] || '%B'),\n y = format(spec[YEAR] || '%Y');\n return date => (second(date) < date ? L : minute(date) < date ? S : hour(date) < date ? M : day(date) < date ? H : month(date) < date ? week(date) < date ? d : w : year(date) < date ? quarter(date) < date ? m : q : y)(date);\n}\nfunction timeLocale(locale) {\n const timeFormat = memoize(locale.format),\n utcFormat = memoize(locale.utcFormat);\n return {\n timeFormat: spec => isString(spec) ? timeFormat(spec) : timeMultiFormat(timeFormat, timeInterval, spec),\n utcFormat: spec => isString(spec) ? utcFormat(spec) : timeMultiFormat(utcFormat, utcInterval, spec),\n timeParse: memoize(locale.parse),\n utcParse: memoize(locale.utcParse)\n };\n}\nlet defaultTimeLocale;\nresetTimeFormatDefaultLocale();\nfunction resetTimeFormatDefaultLocale() {\n return defaultTimeLocale = timeLocale({\n format: timeFormat,\n parse: timeParse,\n utcFormat: utcFormat,\n utcParse: utcParse\n });\n}\nfunction timeFormatLocale(definition) {\n return timeLocale(timeFormatLocale$1(definition));\n}\nfunction timeFormatDefaultLocale(definition) {\n return arguments.length ? defaultTimeLocale = timeFormatLocale(definition) : defaultTimeLocale;\n}\n\nconst createLocale = (number, time) => extend({}, number, time);\nfunction locale(numberSpec, timeSpec) {\n const number = numberSpec ? numberFormatLocale(numberSpec) : numberFormatDefaultLocale();\n const time = timeSpec ? timeFormatLocale(timeSpec) : timeFormatDefaultLocale();\n return createLocale(number, time);\n}\nfunction defaultLocale(numberSpec, timeSpec) {\n const args = arguments.length;\n if (args && args !== 2) {\n error('defaultLocale expects either zero or two arguments.');\n }\n return args ? createLocale(numberFormatDefaultLocale(numberSpec), timeFormatDefaultLocale(timeSpec)) : createLocale(numberFormatDefaultLocale(), timeFormatDefaultLocale());\n}\nfunction resetDefaultLocale() {\n resetNumberFormatDefaultLocale();\n resetTimeFormatDefaultLocale();\n return defaultLocale();\n}\n\nexport { defaultLocale, locale, numberFormatDefaultLocale, numberFormatLocale, resetDefaultLocale, resetNumberFormatDefaultLocale, resetTimeFormatDefaultLocale, timeFormatDefaultLocale, timeFormatLocale };\n","import { extend, error, stringValue, isFunction, toBoolean, toNumber, toDate, toString, identity, field, isObject, isArray, isIterable, hasOwnProperty } from 'vega-util';\nimport { dsvFormat } from 'd3-dsv';\nimport { feature, mesh } from 'topojson-client';\nimport { timeFormatDefaultLocale } from 'vega-format';\n\n// Matches absolute URLs with optional protocol\n// https://... file://... //...\nconst protocol_re = /^(data:|([A-Za-z]+:)?\\/\\/)/;\n\n// Matches allowed URIs. From https://github.com/cure53/DOMPurify/blob/master/src/regexp.js with added file://\nconst allowed_re = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i; // eslint-disable-line no-useless-escape\nconst whitespace_re = /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205f\\u3000]/g; // eslint-disable-line no-control-regex\n\n// Special treatment in node.js for the file: protocol\nconst fileProtocol = 'file://';\n\n/**\n * Factory for a loader constructor that provides methods for requesting\n * files from either the network or disk, and for sanitizing request URIs.\n * @param {function} fetch - The Fetch API for HTTP network requests.\n * If null or undefined, HTTP loading will be disabled.\n * @param {object} fs - The file system interface for file loading.\n * If null or undefined, local file loading will be disabled.\n * @return {function} A loader constructor with the following signature:\n * param {object} [options] - Optional default loading options to use.\n * return {object} - A new loader instance.\n */\nfunction loaderFactory (fetch, fs) {\n return options => ({\n options: options || {},\n sanitize: sanitize,\n load: load,\n fileAccess: !!fs,\n file: fileLoader(fs),\n http: httpLoader(fetch)\n });\n}\n\n/**\n * Load an external resource, typically either from the web or from the local\n * filesystem. This function uses {@link sanitize} to first sanitize the uri,\n * then calls either {@link http} (for web requests) or {@link file} (for\n * filesystem loading).\n * @param {string} uri - The resource indicator (e.g., URL or filename).\n * @param {object} [options] - Optional loading options. These options will\n * override any existing default options.\n * @return {Promise} - A promise that resolves to the loaded content.\n */\nasync function load(uri, options) {\n const opt = await this.sanitize(uri, options),\n url = opt.href;\n return opt.localFile ? this.file(url) : this.http(url, options);\n}\n\n/**\n * URI sanitizer function.\n * @param {string} uri - The uri (url or filename) to check.\n * @param {object} options - An options hash.\n * @return {Promise} - A promise that resolves to an object containing\n * sanitized uri data, or rejects it the input uri is deemed invalid.\n * The properties of the resolved object are assumed to be\n * valid attributes for an HTML 'a' tag. The sanitized uri *must* be\n * provided by the 'href' property of the returned object.\n */\nasync function sanitize(uri, options) {\n options = extend({}, this.options, options);\n const fileAccess = this.fileAccess,\n result = {\n href: null\n };\n let isFile, loadFile, base;\n const isAllowed = allowed_re.test(uri.replace(whitespace_re, ''));\n if (uri == null || typeof uri !== 'string' || !isAllowed) {\n error('Sanitize failure, invalid URI: ' + stringValue(uri));\n }\n const hasProtocol = protocol_re.test(uri);\n\n // if relative url (no protocol/host), prepend baseURL\n if ((base = options.baseURL) && !hasProtocol) {\n // Ensure that there is a slash between the baseURL (e.g. hostname) and url\n if (!uri.startsWith('/') && !base.endsWith('/')) {\n uri = '/' + uri;\n }\n uri = base + uri;\n }\n\n // should we load from file system?\n loadFile = (isFile = uri.startsWith(fileProtocol)) || options.mode === 'file' || options.mode !== 'http' && !hasProtocol && fileAccess;\n if (isFile) {\n // strip file protocol\n uri = uri.slice(fileProtocol.length);\n } else if (uri.startsWith('//')) {\n if (options.defaultProtocol === 'file') {\n // if is file, strip protocol and set loadFile flag\n uri = uri.slice(2);\n loadFile = true;\n } else {\n // if relative protocol (starts with '//'), prepend default protocol\n uri = (options.defaultProtocol || 'http') + ':' + uri;\n }\n }\n\n // set non-enumerable mode flag to indicate local file load\n Object.defineProperty(result, 'localFile', {\n value: !!loadFile\n });\n\n // set uri\n result.href = uri;\n\n // set default result target, if specified\n if (options.target) {\n result.target = options.target + '';\n }\n\n // set default result rel, if specified (#1542)\n if (options.rel) {\n result.rel = options.rel + '';\n }\n\n // provide control over cross-origin image handling (#2238)\n // https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image\n if (options.context === 'image' && options.crossOrigin) {\n result.crossOrigin = options.crossOrigin + '';\n }\n\n // return\n return result;\n}\n\n/**\n * File system loader factory.\n * @param {object} fs - The file system interface.\n * @return {function} - A file loader with the following signature:\n * param {string} filename - The file system path to load.\n * param {string} filename - The file system path to load.\n * return {Promise} A promise that resolves to the file contents.\n */\nfunction fileLoader(fs) {\n return fs ? filename => new Promise((accept, reject) => {\n fs.readFile(filename, (error, data) => {\n if (error) reject(error);else accept(data);\n });\n }) : fileReject;\n}\n\n/**\n * Default file system loader that simply rejects.\n */\nasync function fileReject() {\n error('No file system access.');\n}\n\n/**\n * HTTP request handler factory.\n * @param {function} fetch - The Fetch API method.\n * @return {function} - An http loader with the following signature:\n * param {string} url - The url to request.\n * param {object} options - An options hash.\n * return {Promise} - A promise that resolves to the file contents.\n */\nfunction httpLoader(fetch) {\n return fetch ? async function (url, options) {\n const opt = extend({}, this.options.http, options),\n type = options && options.response,\n response = await fetch(url, opt);\n return !response.ok ? error(response.status + '' + response.statusText) : isFunction(response[type]) ? response[type]() : response.text();\n } : httpReject;\n}\n\n/**\n * Default http request handler that simply rejects.\n */\nasync function httpReject() {\n error('No HTTP fetch method available.');\n}\n\nconst isValid = _ => _ != null && _ === _;\nconst isBoolean = _ => _ === 'true' || _ === 'false' || _ === true || _ === false;\nconst isDate = _ => !Number.isNaN(Date.parse(_));\nconst isNumber = _ => !Number.isNaN(+_) && !(_ instanceof Date);\nconst isInteger = _ => isNumber(_) && Number.isInteger(+_);\nconst typeParsers = {\n boolean: toBoolean,\n integer: toNumber,\n number: toNumber,\n date: toDate,\n string: toString,\n unknown: identity\n};\nconst typeTests = [isBoolean, isInteger, isNumber, isDate];\nconst typeList = ['boolean', 'integer', 'number', 'date'];\nfunction inferType(values, field) {\n if (!values || !values.length) return 'unknown';\n const n = values.length,\n m = typeTests.length,\n a = typeTests.map((_, i) => i + 1);\n for (let i = 0, t = 0, j, value; i < n; ++i) {\n value = field ? values[i][field] : values[i];\n for (j = 0; j < m; ++j) {\n if (a[j] && isValid(value) && !typeTests[j](value)) {\n a[j] = 0;\n ++t;\n if (t === typeTests.length) return 'string';\n }\n }\n }\n return typeList[a.reduce((u, v) => u === 0 ? v : u, 0) - 1];\n}\nfunction inferTypes(data, fields) {\n return fields.reduce((types, field) => {\n types[field] = inferType(data, field);\n return types;\n }, {});\n}\n\nfunction delimitedFormat(delimiter) {\n const parse = function (data, format) {\n const delim = {\n delimiter: delimiter\n };\n return dsv(data, format ? extend(format, delim) : delim);\n };\n parse.responseType = 'text';\n return parse;\n}\nfunction dsv(data, format) {\n if (format.header) {\n data = format.header.map(stringValue).join(format.delimiter) + '\\n' + data;\n }\n return dsvFormat(format.delimiter).parse(data + '');\n}\ndsv.responseType = 'text';\n\nfunction isBuffer(_) {\n return typeof Buffer === 'function' && isFunction(Buffer.isBuffer) ? Buffer.isBuffer(_) : false;\n}\nfunction json(data, format) {\n const prop = format && format.property ? field(format.property) : identity;\n return isObject(data) && !isBuffer(data) ? parseJSON(prop(data), format) : prop(JSON.parse(data));\n}\njson.responseType = 'json';\nfunction parseJSON(data, format) {\n if (!isArray(data) && isIterable(data)) {\n data = [...data];\n }\n return format && format.copy ? JSON.parse(JSON.stringify(data)) : data;\n}\n\nconst filters = {\n interior: (a, b) => a !== b,\n exterior: (a, b) => a === b\n};\nfunction topojson(data, format) {\n let method, object, property, filter;\n data = json(data, format);\n if (format && format.feature) {\n method = feature;\n property = format.feature;\n } else if (format && format.mesh) {\n method = mesh;\n property = format.mesh;\n filter = filters[format.filter];\n } else {\n error('Missing TopoJSON feature or mesh parameter.');\n }\n object = (object = data.objects[property]) ? method(data, object, filter) : error('Invalid TopoJSON object: ' + property);\n return object && object.features || [object];\n}\ntopojson.responseType = 'json';\n\nconst format = {\n dsv: dsv,\n csv: delimitedFormat(','),\n tsv: delimitedFormat('\\t'),\n json: json,\n topojson: topojson\n};\nfunction formats(name, reader) {\n if (arguments.length > 1) {\n format[name] = reader;\n return this;\n } else {\n return hasOwnProperty(format, name) ? format[name] : null;\n }\n}\nfunction responseType(type) {\n const f = formats(type);\n return f && f.responseType || 'text';\n}\n\nfunction read (data, schema, timeParser, utcParser) {\n schema = schema || {};\n const reader = formats(schema.type || 'json');\n if (!reader) error('Unknown data format type: ' + schema.type);\n data = reader(data, schema);\n if (schema.parse) parse(data, schema.parse, timeParser, utcParser);\n if (hasOwnProperty(data, 'columns')) delete data.columns;\n return data;\n}\nfunction parse(data, types, timeParser, utcParser) {\n if (!data.length) return; // early exit for empty data\n\n const locale = timeFormatDefaultLocale();\n timeParser = timeParser || locale.timeParse;\n utcParser = utcParser || locale.utcParse;\n let fields = data.columns || Object.keys(data[0]),\n datum,\n field,\n i,\n j,\n n,\n m;\n if (types === 'auto') types = inferTypes(data, fields);\n fields = Object.keys(types);\n const parsers = fields.map(field => {\n const type = types[field];\n let parts, pattern;\n if (type && (type.startsWith('date:') || type.startsWith('utc:'))) {\n parts = type.split(/:(.+)?/, 2); // split on first :\n pattern = parts[1];\n if (pattern[0] === '\\'' && pattern[pattern.length - 1] === '\\'' || pattern[0] === '\"' && pattern[pattern.length - 1] === '\"') {\n pattern = pattern.slice(1, -1);\n }\n const parse = parts[0] === 'utc' ? utcParser : timeParser;\n return parse(pattern);\n }\n if (!typeParsers[type]) {\n throw Error('Illegal format pattern: ' + field + ':' + type);\n }\n return typeParsers[type];\n });\n for (i = 0, n = data.length, m = fields.length; i < n; ++i) {\n datum = data[i];\n for (j = 0; j < m; ++j) {\n field = fields[j];\n datum[field] = parsers[j](datum[field]);\n }\n }\n}\n\nconst loader = loaderFactory(typeof fetch !== 'undefined' && fetch,\n// use built-in fetch API\nnull // no file system access\n);\n\nexport { format, formats, inferType, inferTypes, loader, read, responseType, typeParsers };\n","import { identity, array, isFunction, constant, isArray, id, error, truthy, debounce, extend, visitArray, inherits, logger, Error, hasOwnProperty } from 'vega-util';\nimport { read, responseType, loader } from 'vega-loader';\nimport { defaultLocale } from 'vega-format';\n\nfunction UniqueList(idFunc) {\n const $ = idFunc || identity,\n list = [],\n ids = {};\n list.add = _ => {\n const id = $(_);\n if (!ids[id]) {\n ids[id] = 1;\n list.push(_);\n }\n return list;\n };\n list.remove = _ => {\n const id = $(_);\n if (ids[id]) {\n ids[id] = 0;\n const idx = list.indexOf(_);\n if (idx >= 0) list.splice(idx, 1);\n }\n return list;\n };\n return list;\n}\n\n/**\n * Invoke and await a potentially async callback function. If\n * an error occurs, trap it and route to Dataflow.error.\n * @param {Dataflow} df - The dataflow instance\n * @param {function} callback - A callback function to invoke\n * and then await. The dataflow will be passed as the single\n * argument to the function.\n */\nasync function asyncCallback (df, callback) {\n try {\n await callback(df);\n } catch (err) {\n df.error(err);\n }\n}\n\nconst TUPLE_ID_KEY = Symbol('vega_id');\nlet TUPLE_ID = 1;\n\n/**\n * Checks if an input value is a registered tuple.\n * @param {*} t - The value to check.\n * @return {boolean} True if the input is a tuple, false otherwise.\n */\nfunction isTuple(t) {\n return !!(t && tupleid(t));\n}\n\n/**\n * Returns the id of a tuple.\n * @param {object} t - The input tuple.\n * @return {*} the tuple id.\n */\nfunction tupleid(t) {\n return t[TUPLE_ID_KEY];\n}\n\n/**\n * Sets the id of a tuple.\n * @param {object} t - The input tuple.\n * @param {*} id - The id value to set.\n * @return {object} the input tuple.\n */\nfunction setid(t, id) {\n t[TUPLE_ID_KEY] = id;\n return t;\n}\n\n/**\n * Ingest an object or value as a data tuple.\n * If the input value is an object, an id field will be added to it. For\n * efficiency, the input object is modified directly. A copy is not made.\n * If the input value is a literal, it will be wrapped in a new object\n * instance, with the value accessible as the 'data' property.\n * @param datum - The value to ingest.\n * @return {object} The ingested data tuple.\n */\nfunction ingest$1(datum) {\n const t = datum === Object(datum) ? datum : {\n data: datum\n };\n return tupleid(t) ? t : setid(t, TUPLE_ID++);\n}\n\n/**\n * Given a source tuple, return a derived copy.\n * @param {object} t - The source tuple.\n * @return {object} The derived tuple.\n */\nfunction derive(t) {\n return rederive(t, ingest$1({}));\n}\n\n/**\n * Rederive a derived tuple by copying values from the source tuple.\n * @param {object} t - The source tuple.\n * @param {object} d - The derived tuple.\n * @return {object} The derived tuple.\n */\nfunction rederive(t, d) {\n for (const k in t) d[k] = t[k];\n return d;\n}\n\n/**\n * Replace an existing tuple with a new tuple.\n * @param {object} t - The existing data tuple.\n * @param {object} d - The new tuple that replaces the old.\n * @return {object} The new tuple.\n */\nfunction replace(t, d) {\n return setid(d, tupleid(t));\n}\n\n/**\n * Generate an augmented comparator function that provides stable\n * sorting by tuple id when the given comparator produces ties.\n * @param {function} cmp - The comparator to augment.\n * @param {function} [f] - Optional tuple accessor function.\n * @return {function} An augmented comparator function.\n */\nfunction stableCompare(cmp, f) {\n return !cmp ? null : f ? (a, b) => cmp(a, b) || tupleid(f(a)) - tupleid(f(b)) : (a, b) => cmp(a, b) || tupleid(a) - tupleid(b);\n}\n\nfunction isChangeSet(v) {\n return v && v.constructor === changeset;\n}\nfunction changeset() {\n const add = [],\n // insert tuples\n rem = [],\n // remove tuples\n mod = [],\n // modify tuples\n remp = [],\n // remove by predicate\n modp = []; // modify by predicate\n let clean = null,\n reflow = false;\n return {\n constructor: changeset,\n insert(t) {\n const d = array(t),\n n = d.length;\n for (let i = 0; i < n; ++i) add.push(d[i]);\n return this;\n },\n remove(t) {\n const a = isFunction(t) ? remp : rem,\n d = array(t),\n n = d.length;\n for (let i = 0; i < n; ++i) a.push(d[i]);\n return this;\n },\n modify(t, field, value) {\n const m = {\n field: field,\n value: constant(value)\n };\n if (isFunction(t)) {\n m.filter = t;\n modp.push(m);\n } else {\n m.tuple = t;\n mod.push(m);\n }\n return this;\n },\n encode(t, set) {\n if (isFunction(t)) modp.push({\n filter: t,\n field: set\n });else mod.push({\n tuple: t,\n field: set\n });\n return this;\n },\n clean(value) {\n clean = value;\n return this;\n },\n reflow() {\n reflow = true;\n return this;\n },\n pulse(pulse, tuples) {\n const cur = {},\n out = {};\n let i, n, m, f, t, id;\n\n // build lookup table of current tuples\n for (i = 0, n = tuples.length; i < n; ++i) {\n cur[tupleid(tuples[i])] = 1;\n }\n\n // process individual tuples to remove\n for (i = 0, n = rem.length; i < n; ++i) {\n t = rem[i];\n cur[tupleid(t)] = -1;\n }\n\n // process predicate-based removals\n for (i = 0, n = remp.length; i < n; ++i) {\n f = remp[i];\n tuples.forEach(t => {\n if (f(t)) cur[tupleid(t)] = -1;\n });\n }\n\n // process all add tuples\n for (i = 0, n = add.length; i < n; ++i) {\n t = add[i];\n id = tupleid(t);\n if (cur[id]) {\n // tuple already resides in dataset\n // if flagged for both add and remove, cancel\n cur[id] = 1;\n } else {\n // tuple does not reside in dataset, add\n pulse.add.push(ingest$1(add[i]));\n }\n }\n\n // populate pulse rem list\n for (i = 0, n = tuples.length; i < n; ++i) {\n t = tuples[i];\n if (cur[tupleid(t)] < 0) pulse.rem.push(t);\n }\n\n // modify helper method\n function modify(t, f, v) {\n if (v) {\n t[f] = v(t);\n } else {\n pulse.encode = f;\n }\n if (!reflow) out[tupleid(t)] = t;\n }\n\n // process individual tuples to modify\n for (i = 0, n = mod.length; i < n; ++i) {\n m = mod[i];\n t = m.tuple;\n f = m.field;\n id = cur[tupleid(t)];\n if (id > 0) {\n modify(t, f, m.value);\n pulse.modifies(f);\n }\n }\n\n // process predicate-based modifications\n for (i = 0, n = modp.length; i < n; ++i) {\n m = modp[i];\n f = m.filter;\n tuples.forEach(t => {\n if (f(t) && cur[tupleid(t)] > 0) {\n modify(t, m.field, m.value);\n }\n });\n pulse.modifies(m.field);\n }\n\n // upon reflow request, populate mod with all non-removed tuples\n // otherwise, populate mod with modified tuples only\n if (reflow) {\n pulse.mod = rem.length || remp.length ? tuples.filter(t => cur[tupleid(t)] > 0) : tuples.slice();\n } else {\n for (id in out) pulse.mod.push(out[id]);\n }\n\n // set pulse garbage collection request\n if (clean || clean == null && (rem.length || remp.length)) {\n pulse.clean(true);\n }\n return pulse;\n }\n };\n}\n\nconst CACHE = '_:mod:_';\n\n/**\n * Hash that tracks modifications to assigned values.\n * Callers *must* use the set method to update values.\n */\nfunction Parameters() {\n Object.defineProperty(this, CACHE, {\n writable: true,\n value: {}\n });\n}\nParameters.prototype = {\n /**\n * Set a parameter value. If the parameter value changes, the parameter\n * will be recorded as modified.\n * @param {string} name - The parameter name.\n * @param {number} index - The index into an array-value parameter. Ignored if\n * the argument is undefined, null or less than zero.\n * @param {*} value - The parameter value to set.\n * @param {boolean} [force=false] - If true, records the parameter as modified\n * even if the value is unchanged.\n * @return {Parameters} - This parameter object.\n */\n set(name, index, value, force) {\n const o = this,\n v = o[name],\n mod = o[CACHE];\n if (index != null && index >= 0) {\n if (v[index] !== value || force) {\n v[index] = value;\n mod[index + ':' + name] = -1;\n mod[name] = -1;\n }\n } else if (v !== value || force) {\n o[name] = value;\n mod[name] = isArray(value) ? 1 + value.length : -1;\n }\n return o;\n },\n /**\n * Tests if one or more parameters has been modified. If invoked with no\n * arguments, returns true if any parameter value has changed. If the first\n * argument is array, returns trues if any parameter name in the array has\n * changed. Otherwise, tests if the given name and optional array index has\n * changed.\n * @param {string} name - The parameter name to test.\n * @param {number} [index=undefined] - The parameter array index to test.\n * @return {boolean} - Returns true if a queried parameter was modified.\n */\n modified(name, index) {\n const mod = this[CACHE];\n if (!arguments.length) {\n for (const k in mod) {\n if (mod[k]) return true;\n }\n return false;\n } else if (isArray(name)) {\n for (let k = 0; k < name.length; ++k) {\n if (mod[name[k]]) return true;\n }\n return false;\n }\n return index != null && index >= 0 ? index + 1 < mod[name] || !!mod[index + ':' + name] : !!mod[name];\n },\n /**\n * Clears the modification records. After calling this method,\n * all parameters are considered unmodified.\n */\n clear() {\n this[CACHE] = {};\n return this;\n }\n};\n\nlet OP_ID = 0;\nconst PULSE = 'pulse',\n NO_PARAMS = new Parameters();\n\n// Boolean Flags\nconst SKIP$1 = 1,\n MODIFIED = 2;\n\n/**\n * An Operator is a processing node in a dataflow graph.\n * Each operator stores a value and an optional value update function.\n * Operators can accept a hash of named parameters. Parameter values can\n * either be direct (JavaScript literals, arrays, objects) or indirect\n * (other operators whose values will be pulled dynamically). Operators\n * included as parameters will have this operator added as a dependency.\n * @constructor\n * @param {*} [init] - The initial value for this operator.\n * @param {function(object, Pulse)} [update] - An update function. Upon\n * evaluation of this operator, the update function will be invoked and the\n * return value will be used as the new value of this operator.\n * @param {object} [params] - The parameters for this operator.\n * @param {boolean} [react=true] - Flag indicating if this operator should\n * listen for changes to upstream operators included as parameters.\n * @see parameters\n */\nfunction Operator(init, update, params, react) {\n this.id = ++OP_ID;\n this.value = init;\n this.stamp = -1;\n this.rank = -1;\n this.qrank = -1;\n this.flags = 0;\n if (update) {\n this._update = update;\n }\n if (params) this.parameters(params, react);\n}\nfunction flag(bit) {\n return function (state) {\n const f = this.flags;\n if (arguments.length === 0) return !!(f & bit);\n this.flags = state ? f | bit : f & ~bit;\n return this;\n };\n}\nOperator.prototype = {\n /**\n * Returns a list of target operators dependent on this operator.\n * If this list does not exist, it is created and then returned.\n * @return {UniqueList}\n */\n targets() {\n return this._targets || (this._targets = UniqueList(id));\n },\n /**\n * Sets the value of this operator.\n * @param {*} value - the value to set.\n * @return {Number} Returns 1 if the operator value has changed\n * according to strict equality, returns 0 otherwise.\n */\n set(value) {\n if (this.value !== value) {\n this.value = value;\n return 1;\n } else {\n return 0;\n }\n },\n /**\n * Indicates that operator evaluation should be skipped on the next pulse.\n * This operator will still propagate incoming pulses, but its update function\n * will not be invoked. The skip flag is reset after every pulse, so calling\n * this method will affect processing of the next pulse only.\n */\n skip: flag(SKIP$1),\n /**\n * Indicates that this operator's value has been modified on its most recent\n * pulse. Normally modification is checked via strict equality; however, in\n * some cases it is more efficient to update the internal state of an object.\n * In those cases, the modified flag can be used to trigger propagation. Once\n * set, the modification flag persists across pulses until unset. The flag can\n * be used with the last timestamp to test if a modification is recent.\n */\n modified: flag(MODIFIED),\n /**\n * Sets the parameters for this operator. The parameter values are analyzed for\n * operator instances. If found, this operator will be added as a dependency\n * of the parameterizing operator. Operator values are dynamically marshalled\n * from each operator parameter prior to evaluation. If a parameter value is\n * an array, the array will also be searched for Operator instances. However,\n * the search does not recurse into sub-arrays or object properties.\n * @param {object} params - A hash of operator parameters.\n * @param {boolean} [react=true] - A flag indicating if this operator should\n * automatically update (react) when parameter values change. In other words,\n * this flag determines if the operator registers itself as a listener on\n * any upstream operators included in the parameters.\n * @param {boolean} [initonly=false] - A flag indicating if this operator\n * should calculate an update only upon its initial evaluation, then\n * deregister dependencies and suppress all future update invocations.\n * @return {Operator[]} - An array of upstream dependencies.\n */\n parameters(params, react, initonly) {\n react = react !== false;\n const argval = this._argval = this._argval || new Parameters(),\n argops = this._argops = this._argops || [],\n deps = [];\n let name, value, n, i;\n const add = (name, index, value) => {\n if (value instanceof Operator) {\n if (value !== this) {\n if (react) value.targets().add(this);\n deps.push(value);\n }\n argops.push({\n op: value,\n name: name,\n index: index\n });\n } else {\n argval.set(name, index, value);\n }\n };\n for (name in params) {\n value = params[name];\n if (name === PULSE) {\n array(value).forEach(op => {\n if (!(op instanceof Operator)) {\n error('Pulse parameters must be operator instances.');\n } else if (op !== this) {\n op.targets().add(this);\n deps.push(op);\n }\n });\n this.source = value;\n } else if (isArray(value)) {\n argval.set(name, -1, Array(n = value.length));\n for (i = 0; i < n; ++i) add(name, i, value[i]);\n } else {\n add(name, -1, value);\n }\n }\n this.marshall().clear(); // initialize values\n if (initonly) argops.initonly = true;\n return deps;\n },\n /**\n * Internal method for marshalling parameter values.\n * Visits each operator dependency to pull the latest value.\n * @return {Parameters} A Parameters object to pass to the update function.\n */\n marshall(stamp) {\n const argval = this._argval || NO_PARAMS,\n argops = this._argops;\n let item, i, op, mod;\n if (argops) {\n const n = argops.length;\n for (i = 0; i < n; ++i) {\n item = argops[i];\n op = item.op;\n mod = op.modified() && op.stamp === stamp;\n argval.set(item.name, item.index, op.value, mod);\n }\n if (argops.initonly) {\n for (i = 0; i < n; ++i) {\n item = argops[i];\n item.op.targets().remove(this);\n }\n this._argops = null;\n this._update = null;\n }\n }\n return argval;\n },\n /**\n * Detach this operator from the dataflow.\n * Unregisters listeners on upstream dependencies.\n */\n detach() {\n const argops = this._argops;\n let i, n, item, op;\n if (argops) {\n for (i = 0, n = argops.length; i < n; ++i) {\n item = argops[i];\n op = item.op;\n if (op._targets) {\n op._targets.remove(this);\n }\n }\n }\n\n // remove references to the source and pulse object,\n // if present, to prevent memory leaks of old data.\n this.pulse = null;\n this.source = null;\n },\n /**\n * Delegate method to perform operator processing.\n * Subclasses can override this method to perform custom processing.\n * By default, it marshalls parameters and calls the update function\n * if that function is defined. If the update function does not\n * change the operator value then StopPropagation is returned.\n * If no update function is defined, this method does nothing.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return The output pulse or StopPropagation. A falsy return value\n * (including undefined) will let the input pulse pass through.\n */\n evaluate(pulse) {\n const update = this._update;\n if (update) {\n const params = this.marshall(pulse.stamp),\n v = update.call(this, params, pulse);\n params.clear();\n if (v !== this.value) {\n this.value = v;\n } else if (!this.modified()) {\n return pulse.StopPropagation;\n }\n }\n },\n /**\n * Run this operator for the current pulse. If this operator has already\n * been run at (or after) the pulse timestamp, returns StopPropagation.\n * Internally, this method calls {@link evaluate} to perform processing.\n * If {@link evaluate} returns a falsy value, the input pulse is returned.\n * This method should NOT be overridden, instead overrride {@link evaluate}.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return the output pulse for this operator (or StopPropagation)\n */\n run(pulse) {\n if (pulse.stamp < this.stamp) return pulse.StopPropagation;\n let rv;\n if (this.skip()) {\n this.skip(false);\n rv = 0;\n } else {\n rv = this.evaluate(pulse);\n }\n return this.pulse = rv || pulse;\n }\n};\n\n/**\n * Add an operator to the dataflow graph. This function accepts a\n * variety of input argument types. The basic signature supports an\n * initial value, update function and parameters. If the first parameter\n * is an Operator instance, it will be added directly. If it is a\n * constructor for an Operator subclass, a new instance will be instantiated.\n * Otherwise, if the first parameter is a function instance, it will be used\n * as the update function and a null initial value is assumed.\n * @param {*} init - One of: the operator to add, the initial value of\n * the operator, an operator class to instantiate, or an update function.\n * @param {function} [update] - The operator update function.\n * @param {object} [params] - The operator parameters.\n * @param {boolean} [react=true] - Flag indicating if this operator should\n * listen for changes to upstream operators included as parameters.\n * @return {Operator} - The added operator.\n */\nfunction add (init, update, params, react) {\n let shift = 1,\n op;\n if (init instanceof Operator) {\n op = init;\n } else if (init && init.prototype instanceof Operator) {\n op = new init();\n } else if (isFunction(init)) {\n op = new Operator(null, init);\n } else {\n shift = 0;\n op = new Operator(init, update);\n }\n this.rank(op);\n if (shift) {\n react = params;\n params = update;\n }\n if (params) this.connect(op, op.parameters(params, react));\n this.touch(op);\n return op;\n}\n\n/**\n * Connect a target operator as a dependent of source operators.\n * If necessary, this method will rerank the target operator and its\n * dependents to ensure propagation proceeds in a topologically sorted order.\n * @param {Operator} target - The target operator.\n * @param {Array} - The source operators that should propagate\n * to the target operator.\n */\nfunction connect (target, sources) {\n const targetRank = target.rank,\n n = sources.length;\n for (let i = 0; i < n; ++i) {\n if (targetRank < sources[i].rank) {\n this.rerank(target);\n return;\n }\n }\n}\n\nlet STREAM_ID = 0;\n\n/**\n * Models an event stream.\n * @constructor\n * @param {function(Object, number): boolean} [filter] - Filter predicate.\n * Events pass through when truthy, events are suppressed when falsy.\n * @param {function(Object): *} [apply] - Applied to input events to produce\n * new event values.\n * @param {function(Object)} [receive] - Event callback function to invoke\n * upon receipt of a new event. Use to override standard event processing.\n */\nfunction EventStream(filter, apply, receive) {\n this.id = ++STREAM_ID;\n this.value = null;\n if (receive) this.receive = receive;\n if (filter) this._filter = filter;\n if (apply) this._apply = apply;\n}\n\n/**\n * Creates a new event stream instance with the provided\n * (optional) filter, apply and receive functions.\n * @param {function(Object, number): boolean} [filter] - Filter predicate.\n * Events pass through when truthy, events are suppressed when falsy.\n * @param {function(Object): *} [apply] - Applied to input events to produce\n * new event values.\n * @see EventStream\n */\nfunction stream(filter, apply, receive) {\n return new EventStream(filter, apply, receive);\n}\nEventStream.prototype = {\n _filter: truthy,\n _apply: identity,\n targets() {\n return this._targets || (this._targets = UniqueList(id));\n },\n consume(_) {\n if (!arguments.length) return !!this._consume;\n this._consume = !!_;\n return this;\n },\n receive(evt) {\n if (this._filter(evt)) {\n const val = this.value = this._apply(evt),\n trg = this._targets,\n n = trg ? trg.length : 0;\n for (let i = 0; i < n; ++i) trg[i].receive(val);\n if (this._consume) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n }\n },\n filter(filter) {\n const s = stream(filter);\n this.targets().add(s);\n return s;\n },\n apply(apply) {\n const s = stream(null, apply);\n this.targets().add(s);\n return s;\n },\n merge() {\n const s = stream();\n this.targets().add(s);\n for (let i = 0, n = arguments.length; i < n; ++i) {\n arguments[i].targets().add(s);\n }\n return s;\n },\n throttle(pause) {\n let t = -1;\n return this.filter(() => {\n const now = Date.now();\n if (now - t > pause) {\n t = now;\n return 1;\n } else {\n return 0;\n }\n });\n },\n debounce(delay) {\n const s = stream();\n this.targets().add(stream(null, null, debounce(delay, e => {\n const df = e.dataflow;\n s.receive(e);\n if (df && df.run) df.run();\n })));\n return s;\n },\n between(a, b) {\n let active = false;\n a.targets().add(stream(null, null, () => active = true));\n b.targets().add(stream(null, null, () => active = false));\n return this.filter(() => active);\n },\n detach() {\n // ensures compatibility with operators (#2753)\n // remove references to other streams and filter functions that may\n // be bound to subcontexts that need to be garbage collected.\n this._filter = truthy;\n this._targets = null;\n }\n};\n\n/**\n * Create a new event stream from an event source.\n * @param {object} source - The event source to monitor. The input must\n * support the addEventListener method.\n * @param {string} type - The event type.\n * @param {function(object): boolean} [filter] - Event filter function.\n * @param {function(object): *} [apply] - Event application function.\n * If provided, this function will be invoked and the result will be\n * used as the downstream event value.\n * @return {EventStream}\n */\nfunction events (source, type, filter, apply) {\n const df = this,\n s = stream(filter, apply),\n send = function (e) {\n e.dataflow = df;\n try {\n s.receive(e);\n } catch (error) {\n df.error(error);\n } finally {\n df.run();\n }\n };\n let sources;\n if (typeof source === 'string' && typeof document !== 'undefined') {\n sources = document.querySelectorAll(source);\n } else {\n sources = array(source);\n }\n const n = sources.length;\n for (let i = 0; i < n; ++i) {\n sources[i].addEventListener(type, send);\n }\n return s;\n}\n\nfunction parse(data, format) {\n const locale = this.locale();\n return read(data, format, locale.timeParse, locale.utcParse);\n}\n\n/**\n * Ingests new data into the dataflow. First parses the data using the\n * vega-loader read method, then pulses a changeset to the target operator.\n * @param {Operator} target - The Operator to target with ingested data,\n * typically a Collect transform instance.\n * @param {*} data - The input data, prior to parsing. For JSON this may\n * be a string or an object. For CSV, TSV, etc should be a string.\n * @param {object} format - The data format description for parsing\n * loaded data. This object is passed to the vega-loader read method.\n * @returns {Dataflow}\n */\nfunction ingest(target, data, format) {\n data = this.parse(data, format);\n return this.pulse(target, this.changeset().insert(data));\n}\n\n/**\n * Request data from an external source, parse it, and return a Promise.\n * @param {string} url - The URL from which to load the data. This string\n * is passed to the vega-loader load method.\n * @param {object} [format] - The data format description for parsing\n * loaded data. This object is passed to the vega-loader read method.\n * @return {Promise} A Promise that resolves upon completion of the request.\n * The resolved object contains the following properties:\n * - data: an array of parsed data (or null upon error)\n * - status: a code for success (0), load fail (-1), or parse fail (-2)\n */\nasync function request(url, format) {\n const df = this;\n let status = 0,\n data;\n try {\n data = await df.loader().load(url, {\n context: 'dataflow',\n response: responseType(format && format.type)\n });\n try {\n data = df.parse(data, format);\n } catch (err) {\n status = -2;\n df.warn('Data ingestion failed', url, err);\n }\n } catch (err) {\n status = -1;\n df.warn('Loading failed', url, err);\n }\n return {\n data,\n status\n };\n}\nasync function preload(target, url, format) {\n const df = this,\n pending = df._pending || loadPending(df);\n pending.requests += 1;\n const res = await df.request(url, format);\n df.pulse(target, df.changeset().remove(truthy).insert(res.data || []));\n pending.done();\n return res;\n}\nfunction loadPending(df) {\n let accept;\n const pending = new Promise(a => accept = a);\n pending.requests = 0;\n pending.done = () => {\n if (--pending.requests === 0) {\n df._pending = null;\n accept(df);\n }\n };\n return df._pending = pending;\n}\n\nconst SKIP = {\n skip: true\n};\n\n/**\n * Perform operator updates in response to events. Applies an\n * update function to compute a new operator value. If the update function\n * returns a {@link ChangeSet}, the operator will be pulsed with those tuple\n * changes. Otherwise, the operator value will be updated to the return value.\n * @param {EventStream|Operator} source - The event source to react to.\n * This argument can be either an EventStream or an Operator.\n * @param {Operator|function(object):Operator} target - The operator to update.\n * This argument can either be an Operator instance or (if the source\n * argument is an EventStream), a function that accepts an event object as\n * input and returns an Operator to target.\n * @param {function(Parameters,Event): *} [update] - Optional update function\n * to compute the new operator value, or a literal value to set. Update\n * functions expect to receive a parameter object and event as arguments.\n * This function can either return a new operator value or (if the source\n * argument is an EventStream) a {@link ChangeSet} instance to pulse\n * the target operator with tuple changes.\n * @param {object} [params] - The update function parameters.\n * @param {object} [options] - Additional options hash. If not overridden,\n * updated operators will be skipped by default.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @param {boolean} [options.force] - If true, the operator will\n * be re-evaluated even if its value has not changed.\n * @return {Dataflow}\n */\nfunction on (source, target, update, params, options) {\n const fn = source instanceof Operator ? onOperator : onStream;\n fn(this, source, target, update, params, options);\n return this;\n}\nfunction onStream(df, stream, target, update, params, options) {\n const opt = extend({}, options, SKIP);\n let func, op;\n if (!isFunction(target)) target = constant(target);\n if (update === undefined) {\n func = e => df.touch(target(e));\n } else if (isFunction(update)) {\n op = new Operator(null, update, params, false);\n func = e => {\n op.evaluate(e);\n const t = target(e),\n v = op.value;\n isChangeSet(v) ? df.pulse(t, v, options) : df.update(t, v, opt);\n };\n } else {\n func = e => df.update(target(e), update, opt);\n }\n stream.apply(func);\n}\nfunction onOperator(df, source, target, update, params, options) {\n if (update === undefined) {\n source.targets().add(target);\n } else {\n const opt = options || {},\n op = new Operator(null, updater(target, update), params, false);\n op.modified(opt.force);\n op.rank = source.rank; // immediately follow source\n source.targets().add(op); // add dependency\n\n if (target) {\n op.skip(true); // skip first invocation\n op.value = target.value; // initialize value\n op.targets().add(target); // chain dependencies\n df.connect(target, [op]); // rerank as needed, #1672\n }\n }\n}\n\nfunction updater(target, update) {\n update = isFunction(update) ? update : constant(update);\n return target ? function (_, pulse) {\n const value = update(_, pulse);\n if (!target.skip()) {\n target.skip(value !== this.value).value = value;\n }\n return value;\n } : update;\n}\n\n/**\n * Assigns a rank to an operator. Ranks are assigned in increasing order\n * by incrementing an internal rank counter.\n * @param {Operator} op - The operator to assign a rank.\n */\nfunction rank(op) {\n op.rank = ++this._rank;\n}\n\n/**\n * Re-ranks an operator and all downstream target dependencies. This\n * is necessary when upstream dependencies of higher rank are added to\n * a target operator.\n * @param {Operator} op - The operator to re-rank.\n */\nfunction rerank(op) {\n const queue = [op];\n let cur, list, i;\n while (queue.length) {\n this.rank(cur = queue.pop());\n if (list = cur._targets) {\n for (i = list.length; --i >= 0;) {\n queue.push(cur = list[i]);\n if (cur === op) error('Cycle detected in dataflow graph.');\n }\n }\n }\n}\n\n/**\n * Sentinel value indicating pulse propagation should stop.\n */\nconst StopPropagation = {};\n\n// Pulse visit type flags\nconst ADD = 1 << 0,\n REM = 1 << 1,\n MOD = 1 << 2,\n ADD_REM = ADD | REM,\n ADD_MOD = ADD | MOD,\n ALL = ADD | REM | MOD,\n REFLOW = 1 << 3,\n SOURCE = 1 << 4,\n NO_SOURCE = 1 << 5,\n NO_FIELDS = 1 << 6;\n\n/**\n * A Pulse enables inter-operator communication during a run of the\n * dataflow graph. In addition to the current timestamp, a pulse may also\n * contain a change-set of added, removed or modified data tuples, as well as\n * a pointer to a full backing data source. Tuple change sets may not\n * be fully materialized; for example, to prevent needless array creation\n * a change set may include larger arrays and corresponding filter functions.\n * The pulse provides a {@link visit} method to enable proper and efficient\n * iteration over requested data tuples.\n *\n * In addition, each pulse can track modification flags for data tuple fields.\n * Responsible transform operators should call the {@link modifies} method to\n * indicate changes to data fields. The {@link modified} method enables\n * querying of this modification state.\n *\n * @constructor\n * @param {Dataflow} dataflow - The backing dataflow instance.\n * @param {number} stamp - The current propagation timestamp.\n * @param {string} [encode] - An optional encoding set name, which is then\n * accessible as Pulse.encode. Operators can respond to (or ignore) this\n * setting as appropriate. This parameter can be used in conjunction with\n * the Encode transform in the vega-encode module.\n */\nfunction Pulse(dataflow, stamp, encode) {\n this.dataflow = dataflow;\n this.stamp = stamp == null ? -1 : stamp;\n this.add = [];\n this.rem = [];\n this.mod = [];\n this.fields = null;\n this.encode = encode || null;\n}\nfunction materialize(data, filter) {\n const out = [];\n visitArray(data, filter, _ => out.push(_));\n return out;\n}\nfunction filter(pulse, flags) {\n const map = {};\n pulse.visit(flags, t => {\n map[tupleid(t)] = 1;\n });\n return t => map[tupleid(t)] ? null : t;\n}\nfunction addFilter(a, b) {\n return a ? (t, i) => a(t, i) && b(t, i) : b;\n}\nPulse.prototype = {\n /**\n * Sentinel value indicating pulse propagation should stop.\n */\n StopPropagation,\n /**\n * Boolean flag indicating ADD (added) tuples.\n */\n ADD,\n /**\n * Boolean flag indicating REM (removed) tuples.\n */\n REM,\n /**\n * Boolean flag indicating MOD (modified) tuples.\n */\n MOD,\n /**\n * Boolean flag indicating ADD (added) and REM (removed) tuples.\n */\n ADD_REM,\n /**\n * Boolean flag indicating ADD (added) and MOD (modified) tuples.\n */\n ADD_MOD,\n /**\n * Boolean flag indicating ADD, REM and MOD tuples.\n */\n ALL,\n /**\n * Boolean flag indicating all tuples in a data source\n * except for the ADD, REM and MOD tuples.\n */\n REFLOW,\n /**\n * Boolean flag indicating a 'pass-through' to a\n * backing data source, ignoring ADD, REM and MOD tuples.\n */\n SOURCE,\n /**\n * Boolean flag indicating that source data should be\n * suppressed when creating a forked pulse.\n */\n NO_SOURCE,\n /**\n * Boolean flag indicating that field modifications should be\n * suppressed when creating a forked pulse.\n */\n NO_FIELDS,\n /**\n * Creates a new pulse based on the values of this pulse.\n * The dataflow, time stamp and field modification values are copied over.\n * By default, new empty ADD, REM and MOD arrays are created.\n * @param {number} flags - Integer of boolean flags indicating which (if any)\n * tuple arrays should be copied to the new pulse. The supported flag values\n * are ADD, REM and MOD. Array references are copied directly: new array\n * instances are not created.\n * @return {Pulse} - The forked pulse instance.\n * @see init\n */\n fork(flags) {\n return new Pulse(this.dataflow).init(this, flags);\n },\n /**\n * Creates a copy of this pulse with new materialized array\n * instances for the ADD, REM, MOD, and SOURCE arrays.\n * The dataflow, time stamp and field modification values are copied over.\n * @return {Pulse} - The cloned pulse instance.\n * @see init\n */\n clone() {\n const p = this.fork(ALL);\n p.add = p.add.slice();\n p.rem = p.rem.slice();\n p.mod = p.mod.slice();\n if (p.source) p.source = p.source.slice();\n return p.materialize(ALL | SOURCE);\n },\n /**\n * Returns a pulse that adds all tuples from a backing source. This is\n * useful for cases where operators are added to a dataflow after an\n * upstream data pipeline has already been processed, ensuring that\n * new operators can observe all tuples within a stream.\n * @return {Pulse} - A pulse instance with all source tuples included\n * in the add array. If the current pulse already has all source\n * tuples in its add array, it is returned directly. If the current\n * pulse does not have a backing source, it is returned directly.\n */\n addAll() {\n let p = this;\n const reuse = !p.source || p.add === p.rem // special case for indexed set (e.g., crossfilter)\n || !p.rem.length && p.source.length === p.add.length;\n if (reuse) {\n return p;\n } else {\n p = new Pulse(this.dataflow).init(this);\n p.add = p.source;\n p.rem = []; // new operators can ignore rem #2769\n return p;\n }\n },\n /**\n * Initialize this pulse based on the values of another pulse. This method\n * is used internally by {@link fork} to initialize a new forked tuple.\n * The dataflow, time stamp and field modification values are copied over.\n * By default, new empty ADD, REM and MOD arrays are created.\n * @param {Pulse} src - The source pulse to copy from.\n * @param {number} flags - Integer of boolean flags indicating which (if any)\n * tuple arrays should be copied to the new pulse. The supported flag values\n * are ADD, REM and MOD. Array references are copied directly: new array\n * instances are not created. By default, source data arrays are copied\n * to the new pulse. Use the NO_SOURCE flag to enforce a null source.\n * @return {Pulse} - Returns this Pulse instance.\n */\n init(src, flags) {\n const p = this;\n p.stamp = src.stamp;\n p.encode = src.encode;\n if (src.fields && !(flags & NO_FIELDS)) {\n p.fields = src.fields;\n }\n if (flags & ADD) {\n p.addF = src.addF;\n p.add = src.add;\n } else {\n p.addF = null;\n p.add = [];\n }\n if (flags & REM) {\n p.remF = src.remF;\n p.rem = src.rem;\n } else {\n p.remF = null;\n p.rem = [];\n }\n if (flags & MOD) {\n p.modF = src.modF;\n p.mod = src.mod;\n } else {\n p.modF = null;\n p.mod = [];\n }\n if (flags & NO_SOURCE) {\n p.srcF = null;\n p.source = null;\n } else {\n p.srcF = src.srcF;\n p.source = src.source;\n if (src.cleans) p.cleans = src.cleans;\n }\n return p;\n },\n /**\n * Schedules a function to run after pulse propagation completes.\n * @param {function} func - The function to run.\n */\n runAfter(func) {\n this.dataflow.runAfter(func);\n },\n /**\n * Indicates if tuples have been added, removed or modified.\n * @param {number} [flags] - The tuple types (ADD, REM or MOD) to query.\n * Defaults to ALL, returning true if any tuple type has changed.\n * @return {boolean} - Returns true if one or more queried tuple types have\n * changed, false otherwise.\n */\n changed(flags) {\n const f = flags || ALL;\n return f & ADD && this.add.length || f & REM && this.rem.length || f & MOD && this.mod.length;\n },\n /**\n * Forces a \"reflow\" of tuple values, such that all tuples in the backing\n * source are added to the MOD set, unless already present in the ADD set.\n * @param {boolean} [fork=false] - If true, returns a forked copy of this\n * pulse, and invokes reflow on that derived pulse.\n * @return {Pulse} - The reflowed pulse instance.\n */\n reflow(fork) {\n if (fork) return this.fork(ALL).reflow();\n const len = this.add.length,\n src = this.source && this.source.length;\n if (src && src !== len) {\n this.mod = this.source;\n if (len) this.filter(MOD, filter(this, ADD));\n }\n return this;\n },\n /**\n * Get/set metadata to pulse requesting garbage collection\n * to reclaim currently unused resources.\n */\n clean(value) {\n if (arguments.length) {\n this.cleans = !!value;\n return this;\n } else {\n return this.cleans;\n }\n },\n /**\n * Marks one or more data field names as modified to assist dependency\n * tracking and incremental processing by transform operators.\n * @param {string|Array} _ - The field(s) to mark as modified.\n * @return {Pulse} - This pulse instance.\n */\n modifies(_) {\n const hash = this.fields || (this.fields = {});\n if (isArray(_)) {\n _.forEach(f => hash[f] = true);\n } else {\n hash[_] = true;\n }\n return this;\n },\n /**\n * Checks if one or more data fields have been modified during this pulse\n * propagation timestamp.\n * @param {string|Array} _ - The field(s) to check for modified.\n * @param {boolean} nomod - If true, will check the modified flag even if\n * no mod tuples exist. If false (default), mod tuples must be present.\n * @return {boolean} - Returns true if any of the provided fields has been\n * marked as modified, false otherwise.\n */\n modified(_, nomod) {\n const fields = this.fields;\n return !((nomod || this.mod.length) && fields) ? false : !arguments.length ? !!fields : isArray(_) ? _.some(f => fields[f]) : fields[_];\n },\n /**\n * Adds a filter function to one more tuple sets. Filters are applied to\n * backing tuple arrays, to determine the actual set of tuples considered\n * added, removed or modified. They can be used to delay materialization of\n * a tuple set in order to avoid expensive array copies. In addition, the\n * filter functions can serve as value transformers: unlike standard predicate\n * function (which return boolean values), Pulse filters should return the\n * actual tuple value to process. If a tuple set is already filtered, the\n * new filter function will be appended into a conjuntive ('and') query.\n * @param {number} flags - Flags indicating the tuple set(s) to filter.\n * @param {function(*):object} filter - Filter function that will be applied\n * to the tuple set array, and should return a data tuple if the value\n * should be included in the tuple set, and falsy (or null) otherwise.\n * @return {Pulse} - Returns this pulse instance.\n */\n filter(flags, filter) {\n const p = this;\n if (flags & ADD) p.addF = addFilter(p.addF, filter);\n if (flags & REM) p.remF = addFilter(p.remF, filter);\n if (flags & MOD) p.modF = addFilter(p.modF, filter);\n if (flags & SOURCE) p.srcF = addFilter(p.srcF, filter);\n return p;\n },\n /**\n * Materialize one or more tuple sets in this pulse. If the tuple set(s) have\n * a registered filter function, it will be applied and the tuple set(s) will\n * be replaced with materialized tuple arrays.\n * @param {number} flags - Flags indicating the tuple set(s) to materialize.\n * @return {Pulse} - Returns this pulse instance.\n */\n materialize(flags) {\n flags = flags || ALL;\n const p = this;\n if (flags & ADD && p.addF) {\n p.add = materialize(p.add, p.addF);\n p.addF = null;\n }\n if (flags & REM && p.remF) {\n p.rem = materialize(p.rem, p.remF);\n p.remF = null;\n }\n if (flags & MOD && p.modF) {\n p.mod = materialize(p.mod, p.modF);\n p.modF = null;\n }\n if (flags & SOURCE && p.srcF) {\n p.source = p.source.filter(p.srcF);\n p.srcF = null;\n }\n return p;\n },\n /**\n * Visit one or more tuple sets in this pulse.\n * @param {number} flags - Flags indicating the tuple set(s) to visit.\n * Legal values are ADD, REM, MOD and SOURCE (if a backing data source\n * has been set).\n * @param {function(object):*} - Visitor function invoked per-tuple.\n * @return {Pulse} - Returns this pulse instance.\n */\n visit(flags, visitor) {\n const p = this,\n v = visitor;\n if (flags & SOURCE) {\n visitArray(p.source, p.srcF, v);\n return p;\n }\n if (flags & ADD) visitArray(p.add, p.addF, v);\n if (flags & REM) visitArray(p.rem, p.remF, v);\n if (flags & MOD) visitArray(p.mod, p.modF, v);\n const src = p.source;\n if (flags & REFLOW && src) {\n const sum = p.add.length + p.mod.length;\n if (sum === src.length) ; else if (sum) {\n visitArray(src, filter(p, ADD_MOD), v);\n } else {\n // if no add/rem/mod tuples, visit source\n visitArray(src, p.srcF, v);\n }\n }\n return p;\n }\n};\n\n/**\n * Represents a set of multiple pulses. Used as input for operators\n * that accept multiple pulses at a time. Contained pulses are\n * accessible via the public \"pulses\" array property. This pulse doe\n * not carry added, removed or modified tuples directly. However,\n * the visit method can be used to traverse all such tuples contained\n * in sub-pulses with a timestamp matching this parent multi-pulse.\n * @constructor\n * @param {Dataflow} dataflow - The backing dataflow instance.\n * @param {number} stamp - The timestamp.\n * @param {Array} pulses - The sub-pulses for this multi-pulse.\n */\nfunction MultiPulse(dataflow, stamp, pulses, encode) {\n const p = this;\n let c = 0;\n this.dataflow = dataflow;\n this.stamp = stamp;\n this.fields = null;\n this.encode = encode || null;\n this.pulses = pulses;\n for (const pulse of pulses) {\n if (pulse.stamp !== stamp) continue;\n if (pulse.fields) {\n const hash = p.fields || (p.fields = {});\n for (const f in pulse.fields) {\n hash[f] = 1;\n }\n }\n if (pulse.changed(p.ADD)) c |= p.ADD;\n if (pulse.changed(p.REM)) c |= p.REM;\n if (pulse.changed(p.MOD)) c |= p.MOD;\n }\n this.changes = c;\n}\ninherits(MultiPulse, Pulse, {\n /**\n * Creates a new pulse based on the values of this pulse.\n * The dataflow, time stamp and field modification values are copied over.\n * @return {Pulse}\n */\n fork(flags) {\n const p = new Pulse(this.dataflow).init(this, flags & this.NO_FIELDS);\n if (flags !== undefined) {\n if (flags & p.ADD) this.visit(p.ADD, t => p.add.push(t));\n if (flags & p.REM) this.visit(p.REM, t => p.rem.push(t));\n if (flags & p.MOD) this.visit(p.MOD, t => p.mod.push(t));\n }\n return p;\n },\n changed(flags) {\n return this.changes & flags;\n },\n modified(_) {\n const p = this,\n fields = p.fields;\n return !(fields && p.changes & p.MOD) ? 0 : isArray(_) ? _.some(f => fields[f]) : fields[_];\n },\n filter() {\n error('MultiPulse does not support filtering.');\n },\n materialize() {\n error('MultiPulse does not support materialization.');\n },\n visit(flags, visitor) {\n const p = this,\n pulses = p.pulses,\n n = pulses.length;\n let i = 0;\n if (flags & p.SOURCE) {\n for (; i < n; ++i) {\n pulses[i].visit(flags, visitor);\n }\n } else {\n for (; i < n; ++i) {\n if (pulses[i].stamp === p.stamp) {\n pulses[i].visit(flags, visitor);\n }\n }\n }\n return p;\n }\n});\n\n/* eslint-disable require-atomic-updates */\n\n/**\n * Evaluates the dataflow and returns a Promise that resolves when pulse\n * propagation completes. This method will increment the current timestamp\n * and process all updated, pulsed and touched operators. When invoked for\n * the first time, all registered operators will be processed. This method\n * should not be invoked by third-party clients, use {@link runAsync} or\n * {@link run} instead.\n * @param {string} [encode] - The name of an encoding set to invoke during\n * propagation. This value is added to generated Pulse instances;\n * operators can then respond to (or ignore) this setting as appropriate.\n * This parameter can be used in conjunction with the Encode transform in\n * the vega-encode package.\n * @param {function} [prerun] - An optional callback function to invoke\n * immediately before dataflow evaluation commences.\n * @param {function} [postrun] - An optional callback function to invoke\n * after dataflow evaluation completes. The callback will be invoked\n * after those registered via {@link runAfter}.\n * @return {Promise} - A promise that resolves to this dataflow after\n * evaluation completes.\n */\nasync function evaluate(encode, prerun, postrun) {\n const df = this,\n async = [];\n\n // if the pulse value is set, this is a re-entrant call\n if (df._pulse) return reentrant(df);\n\n // wait for pending datasets to load\n if (df._pending) await df._pending;\n\n // invoke prerun function, if provided\n if (prerun) await asyncCallback(df, prerun);\n\n // exit early if there are no updates\n if (!df._touched.length) {\n df.debug('Dataflow invoked, but nothing to do.');\n return df;\n }\n\n // increment timestamp clock\n const stamp = ++df._clock;\n\n // set the current pulse\n df._pulse = new Pulse(df, stamp, encode);\n\n // initialize priority queue, reset touched operators\n df._touched.forEach(op => df._enqueue(op, true));\n df._touched = UniqueList(id);\n let count = 0,\n op,\n next,\n error;\n try {\n while (df._heap.size() > 0) {\n // dequeue operator with highest priority\n op = df._heap.pop();\n\n // re-queue if rank changed\n if (op.rank !== op.qrank) {\n df._enqueue(op, true);\n continue;\n }\n\n // otherwise, evaluate the operator\n next = op.run(df._getPulse(op, encode));\n if (next.then) {\n // await if operator returns a promise directly\n next = await next;\n } else if (next.async) {\n // queue parallel asynchronous execution\n async.push(next.async);\n next = StopPropagation;\n }\n\n // propagate evaluation, enqueue dependent operators\n if (next !== StopPropagation) {\n if (op._targets) op._targets.forEach(op => df._enqueue(op));\n }\n\n // increment visit counter\n ++count;\n }\n } catch (err) {\n df._heap.clear();\n error = err;\n }\n\n // reset pulse map\n df._input = {};\n df._pulse = null;\n df.debug(`Pulse ${stamp}: ${count} operators`);\n if (error) {\n df._postrun = [];\n df.error(error);\n }\n\n // invoke callbacks queued via runAfter\n if (df._postrun.length) {\n const pr = df._postrun.sort((a, b) => b.priority - a.priority);\n df._postrun = [];\n for (let i = 0; i < pr.length; ++i) {\n await asyncCallback(df, pr[i].callback);\n }\n }\n\n // invoke postrun function, if provided\n if (postrun) await asyncCallback(df, postrun);\n\n // handle non-blocking asynchronous callbacks\n if (async.length) {\n Promise.all(async).then(cb => df.runAsync(null, () => {\n cb.forEach(f => {\n try {\n f(df);\n } catch (err) {\n df.error(err);\n }\n });\n }));\n }\n return df;\n}\n\n/**\n * Queues dataflow evaluation to run once any other queued evaluations have\n * completed and returns a Promise that resolves when the queued pulse\n * propagation completes. If provided, a callback function will be invoked\n * immediately before evaluation commences. This method will ensure a\n * separate evaluation is invoked for each time it is called.\n * @param {string} [encode] - The name of an encoding set to invoke during\n * propagation. This value is added to generated Pulse instances;\n * operators can then respond to (or ignore) this setting as appropriate.\n * This parameter can be used in conjunction with the Encode transform in\n * the vega-encode package.\n * @param {function} [prerun] - An optional callback function to invoke\n * immediately before dataflow evaluation commences.\n * @param {function} [postrun] - An optional callback function to invoke\n * after dataflow evaluation completes. The callback will be invoked\n * after those registered via {@link runAfter}.\n * @return {Promise} - A promise that resolves to this dataflow after\n * evaluation completes.\n */\nasync function runAsync(encode, prerun, postrun) {\n // await previously queued functions\n while (this._running) await this._running;\n\n // run dataflow, manage running promise\n const clear = () => this._running = null;\n (this._running = this.evaluate(encode, prerun, postrun)).then(clear, clear);\n return this._running;\n}\n\n/**\n * Requests dataflow evaluation and the immediately returns this dataflow\n * instance. If there are pending data loading or other asynchronous\n * operations, the dataflow will evaluate asynchronously after this method\n * has been invoked. To track when dataflow evaluation completes, use the\n * {@link runAsync} method instead. This method will raise an error if\n * invoked while the dataflow is already in the midst of evaluation.\n * @param {string} [encode] - The name of an encoding set to invoke during\n * propagation. This value is added to generated Pulse instances;\n * operators can then respond to (or ignore) this setting as appropriate.\n * This parameter can be used in conjunction with the Encode transform in\n * the vega-encode module.\n * @param {function} [prerun] - An optional callback function to invoke\n * immediately before dataflow evaluation commences.\n * @param {function} [postrun] - An optional callback function to invoke\n * after dataflow evaluation completes. The callback will be invoked\n * after those registered via {@link runAfter}.\n * @return {Dataflow} - This dataflow instance.\n */\nfunction run(encode, prerun, postrun) {\n return this._pulse ? reentrant(this) : (this.evaluate(encode, prerun, postrun), this);\n}\n\n/**\n * Schedules a callback function to be invoked after the current pulse\n * propagation completes. If no propagation is currently occurring,\n * the function is invoked immediately. Callbacks scheduled via runAfter\n * are invoked immediately upon completion of the current cycle, before\n * any request queued via runAsync. This method is primarily intended for\n * internal use. Third-party callers using runAfter to schedule a callback\n * that invokes {@link run} or {@link runAsync} should not use this method,\n * but instead use {@link runAsync} with prerun or postrun arguments.\n * @param {function(Dataflow)} callback - The callback function to run.\n * The callback will be invoked with this Dataflow instance as its\n * sole argument.\n * @param {boolean} enqueue - A boolean flag indicating that the\n * callback should be queued up to run after the next propagation\n * cycle, suppressing immediate invocation when propagation is not\n * currently occurring.\n * @param {number} [priority] - A priority value used to sort registered\n * callbacks to determine execution order. This argument is intended\n * for internal Vega use only.\n */\nfunction runAfter(callback, enqueue, priority) {\n if (this._pulse || enqueue) {\n // pulse propagation is currently running, queue to run after\n this._postrun.push({\n priority: priority || 0,\n callback: callback\n });\n } else {\n // pulse propagation already complete, invoke immediately\n try {\n callback(this);\n } catch (err) {\n this.error(err);\n }\n }\n}\n\n/**\n * Raise an error for re-entrant dataflow evaluation.\n */\nfunction reentrant(df) {\n df.error('Dataflow already running. Use runAsync() to chain invocations.');\n return df;\n}\n\n/**\n * Enqueue an operator into the priority queue for evaluation. The operator\n * will be enqueued if it has no registered pulse for the current cycle, or if\n * the force argument is true. Upon enqueue, this method also sets the\n * operator's qrank to the current rank value.\n * @param {Operator} op - The operator to enqueue.\n * @param {boolean} [force] - A flag indicating if the operator should be\n * forceably added to the queue, even if it has already been previously\n * enqueued during the current pulse propagation. This is useful when the\n * dataflow graph is dynamically modified and the operator rank changes.\n */\nfunction enqueue(op, force) {\n const q = op.stamp < this._clock;\n if (q) op.stamp = this._clock;\n if (q || force) {\n op.qrank = op.rank;\n this._heap.push(op);\n }\n}\n\n/**\n * Provide a correct pulse for evaluating an operator. If the operator has an\n * explicit source operator, we will try to pull the pulse(s) from it.\n * If there is an array of source operators, we build a multi-pulse.\n * Otherwise, we return a current pulse with correct source data.\n * If the pulse is the pulse map has an explicit target set, we use that.\n * Else if the pulse on the upstream source operator is current, we use that.\n * Else we use the pulse from the pulse map, but copy the source tuple array.\n * @param {Operator} op - The operator for which to get an input pulse.\n * @param {string} [encode] - An (optional) encoding set name with which to\n * annotate the returned pulse. See {@link run} for more information.\n */\nfunction getPulse(op, encode) {\n const s = op.source,\n stamp = this._clock;\n return s && isArray(s) ? new MultiPulse(this, stamp, s.map(_ => _.pulse), encode) : this._input[op.id] || singlePulse(this._pulse, s && s.pulse);\n}\nfunction singlePulse(p, s) {\n if (s && s.stamp === p.stamp) {\n return s;\n }\n p = p.fork();\n if (s && s !== StopPropagation) {\n p.source = s.source;\n }\n return p;\n}\n\nconst NO_OPT = {\n skip: false,\n force: false\n};\n\n/**\n * Touches an operator, scheduling it to be evaluated. If invoked outside of\n * a pulse propagation, the operator will be evaluated the next time this\n * dataflow is run. If invoked in the midst of pulse propagation, the operator\n * will be queued for evaluation if and only if the operator has not yet been\n * evaluated on the current propagation timestamp.\n * @param {Operator} op - The operator to touch.\n * @param {object} [options] - Additional options hash.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @return {Dataflow}\n */\nfunction touch(op, options) {\n const opt = options || NO_OPT;\n if (this._pulse) {\n // if in midst of propagation, add to priority queue\n this._enqueue(op);\n } else {\n // otherwise, queue for next propagation\n this._touched.add(op);\n }\n if (opt.skip) op.skip(true);\n return this;\n}\n\n/**\n * Updates the value of the given operator.\n * @param {Operator} op - The operator to update.\n * @param {*} value - The value to set.\n * @param {object} [options] - Additional options hash.\n * @param {boolean} [options.force] - If true, the operator will\n * be re-evaluated even if its value has not changed.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @return {Dataflow}\n */\nfunction update(op, value, options) {\n const opt = options || NO_OPT;\n if (op.set(value) || opt.force) {\n this.touch(op, opt);\n }\n return this;\n}\n\n/**\n * Pulses an operator with a changeset of tuples. If invoked outside of\n * a pulse propagation, the pulse will be applied the next time this\n * dataflow is run. If invoked in the midst of pulse propagation, the pulse\n * will be added to the set of active pulses and will be applied if and\n * only if the target operator has not yet been evaluated on the current\n * propagation timestamp.\n * @param {Operator} op - The operator to pulse.\n * @param {ChangeSet} value - The tuple changeset to apply.\n * @param {object} [options] - Additional options hash.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @return {Dataflow}\n */\nfunction pulse(op, changeset, options) {\n this.touch(op, options || NO_OPT);\n const p = new Pulse(this, this._clock + (this._pulse ? 0 : 1)),\n t = op.pulse && op.pulse.source || [];\n p.target = op;\n this._input[op.id] = changeset.pulse(p, t);\n return this;\n}\n\nfunction Heap(cmp) {\n let nodes = [];\n return {\n clear: () => nodes = [],\n size: () => nodes.length,\n peek: () => nodes[0],\n push: x => {\n nodes.push(x);\n return siftdown(nodes, 0, nodes.length - 1, cmp);\n },\n pop: () => {\n const last = nodes.pop();\n let item;\n if (nodes.length) {\n item = nodes[0];\n nodes[0] = last;\n siftup(nodes, 0, cmp);\n } else {\n item = last;\n }\n return item;\n }\n };\n}\nfunction siftdown(array, start, idx, cmp) {\n let parent, pidx;\n const item = array[idx];\n while (idx > start) {\n pidx = idx - 1 >> 1;\n parent = array[pidx];\n if (cmp(item, parent) < 0) {\n array[idx] = parent;\n idx = pidx;\n continue;\n }\n break;\n }\n return array[idx] = item;\n}\nfunction siftup(array, idx, cmp) {\n const start = idx,\n end = array.length,\n item = array[idx];\n let cidx = (idx << 1) + 1,\n ridx;\n while (cidx < end) {\n ridx = cidx + 1;\n if (ridx < end && cmp(array[cidx], array[ridx]) >= 0) {\n cidx = ridx;\n }\n array[idx] = array[cidx];\n idx = cidx;\n cidx = (idx << 1) + 1;\n }\n array[idx] = item;\n return siftdown(array, start, idx, cmp);\n}\n\n/**\n * A dataflow graph for reactive processing of data streams.\n * @constructor\n */\nfunction Dataflow() {\n this.logger(logger());\n this.logLevel(Error);\n this._clock = 0;\n this._rank = 0;\n this._locale = defaultLocale();\n try {\n this._loader = loader();\n } catch (e) {\n // do nothing if loader module is unavailable\n }\n this._touched = UniqueList(id);\n this._input = {};\n this._pulse = null;\n this._heap = Heap((a, b) => a.qrank - b.qrank);\n this._postrun = [];\n}\nfunction logMethod(method) {\n return function () {\n return this._log[method].apply(this, arguments);\n };\n}\nDataflow.prototype = {\n /**\n * The current timestamp of this dataflow. This value reflects the\n * timestamp of the previous dataflow run. The dataflow is initialized\n * with a stamp value of 0. The initial run of the dataflow will have\n * a timestap of 1, and so on. This value will match the\n * {@link Pulse.stamp} property.\n * @return {number} - The current timestamp value.\n */\n stamp() {\n return this._clock;\n },\n /**\n * Gets or sets the loader instance to use for data file loading. A\n * loader object must provide a \"load\" method for loading files and a\n * \"sanitize\" method for checking URL/filename validity. Both methods\n * should accept a URI and options hash as arguments, and return a Promise\n * that resolves to the loaded file contents (load) or a hash containing\n * sanitized URI data with the sanitized url assigned to the \"href\" property\n * (sanitize).\n * @param {object} _ - The loader instance to use.\n * @return {object|Dataflow} - If no arguments are provided, returns\n * the current loader instance. Otherwise returns this Dataflow instance.\n */\n loader(_) {\n if (arguments.length) {\n this._loader = _;\n return this;\n } else {\n return this._loader;\n }\n },\n /**\n * Gets or sets the locale instance to use for formatting and parsing\n * string values. The locale object should be provided by the\n * vega-format library, and include methods such as format, timeFormat,\n * utcFormat, timeParse, and utcParse.\n * @param {object} _ - The locale instance to use.\n * @return {object|Dataflow} - If no arguments are provided, returns\n * the current locale instance. Otherwise returns this Dataflow instance.\n */\n locale(_) {\n if (arguments.length) {\n this._locale = _;\n return this;\n } else {\n return this._locale;\n }\n },\n /**\n * Get or set the logger instance used to log messages. If no arguments are\n * provided, returns the current logger instance. Otherwise, sets the logger\n * and return this Dataflow instance. Provided loggers must support the full\n * API of logger objects generated by the vega-util logger method. Note that\n * by default the log level of the new logger will be used; use the logLevel\n * method to adjust the log level as needed.\n */\n logger(logger) {\n if (arguments.length) {\n this._log = logger;\n return this;\n } else {\n return this._log;\n }\n },\n /**\n * Logs an error message. By default, logged messages are written to console\n * output. The message will only be logged if the current log level is high\n * enough to permit error messages.\n */\n error: logMethod('error'),\n /**\n * Logs a warning message. By default, logged messages are written to console\n * output. The message will only be logged if the current log level is high\n * enough to permit warning messages.\n */\n warn: logMethod('warn'),\n /**\n * Logs a information message. By default, logged messages are written to\n * console output. The message will only be logged if the current log level is\n * high enough to permit information messages.\n */\n info: logMethod('info'),\n /**\n * Logs a debug message. By default, logged messages are written to console\n * output. The message will only be logged if the current log level is high\n * enough to permit debug messages.\n */\n debug: logMethod('debug'),\n /**\n * Get or set the current log level. If an argument is provided, it\n * will be used as the new log level.\n * @param {number} [level] - Should be one of None, Warn, Info\n * @return {number} - The current log level.\n */\n logLevel: logMethod('level'),\n /**\n * Empty entry threshold for garbage cleaning. Map data structures will\n * perform cleaning once the number of empty entries exceeds this value.\n */\n cleanThreshold: 1e4,\n // OPERATOR REGISTRATION\n add,\n connect,\n rank,\n rerank,\n // OPERATOR UPDATES\n pulse,\n touch,\n update,\n changeset,\n // DATA LOADING\n ingest,\n parse,\n preload,\n request,\n // EVENT HANDLING\n events,\n on,\n // PULSE PROPAGATION\n evaluate,\n run,\n runAsync,\n runAfter,\n _enqueue: enqueue,\n _getPulse: getPulse\n};\n\n/**\n * Abstract class for operators that process data tuples.\n * Subclasses must provide a {@link transform} method for operator processing.\n * @constructor\n * @param {*} [init] - The initial value for this operator.\n * @param {object} [params] - The parameters for this operator.\n * @param {Operator} [source] - The operator from which to receive pulses.\n */\nfunction Transform(init, params) {\n Operator.call(this, init, null, params);\n}\ninherits(Transform, Operator, {\n /**\n * Overrides {@link Operator.evaluate} for transform operators.\n * Internally, this method calls {@link evaluate} to perform processing.\n * If {@link evaluate} returns a falsy value, the input pulse is returned.\n * This method should NOT be overridden, instead overrride {@link evaluate}.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return the output pulse for this operator (or StopPropagation)\n */\n run(pulse) {\n if (pulse.stamp < this.stamp) return pulse.StopPropagation;\n let rv;\n if (this.skip()) {\n this.skip(false);\n } else {\n rv = this.evaluate(pulse);\n }\n rv = rv || pulse;\n if (rv.then) {\n rv = rv.then(_ => this.pulse = _);\n } else if (rv !== pulse.StopPropagation) {\n this.pulse = rv;\n }\n return rv;\n },\n /**\n * Overrides {@link Operator.evaluate} for transform operators.\n * Marshalls parameter values and then invokes {@link transform}.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return {Pulse} The output pulse (or StopPropagation). A falsy return\n value (including undefined) will let the input pulse pass through.\n */\n evaluate(pulse) {\n const params = this.marshall(pulse.stamp),\n out = this.transform(params, pulse);\n params.clear();\n return out;\n },\n /**\n * Process incoming pulses.\n * Subclasses should override this method to implement transforms.\n * @param {Parameters} _ - The operator parameter values.\n * @param {Pulse} pulse - The current dataflow pulse.\n * @return {Pulse} The output pulse (or StopPropagation). A falsy return\n * value (including undefined) will let the input pulse pass through.\n */\n transform() {}\n});\n\nconst transforms = {};\nfunction definition(type) {\n const t = transform(type);\n return t && t.Definition || null;\n}\nfunction transform(type) {\n type = type && type.toLowerCase();\n return hasOwnProperty(transforms, type) ? transforms[type] : null;\n}\n\nexport { Dataflow, EventStream, MultiPulse, Operator, Parameters, Pulse, Transform, UniqueList, asyncCallback, changeset, definition, derive, ingest$1 as ingest, isChangeSet, isTuple, rederive, replace, stableCompare, transform, transforms, tupleid };\n","export default function max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n","export default function min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n","import ascending from \"./ascending.js\";\nimport permute from \"./permute.js\";\n\nexport default function sort(values, ...F) {\n if (typeof values[Symbol.iterator] !== \"function\") throw new TypeError(\"values is not iterable\");\n values = Array.from(values);\n let [f] = F;\n if ((f && f.length !== 2) || F.length > 1) {\n const index = Uint32Array.from(values, (d, i) => i);\n if (F.length > 1) {\n F = F.map(f => values.map(f));\n index.sort((i, j) => {\n for (const f of F) {\n const c = ascendingDefined(f[i], f[j]);\n if (c) return c;\n }\n });\n } else {\n f = values.map(f);\n index.sort((i, j) => ascendingDefined(f[i], f[j]));\n }\n return permute(values, index);\n }\n return values.sort(compareDefined(f));\n}\n\nexport function compareDefined(compare = ascending) {\n if (compare === ascending) return ascendingDefined;\n if (typeof compare !== \"function\") throw new TypeError(\"compare is not a function\");\n return (a, b) => {\n const x = compare(a, b);\n if (x || x === 0) return x;\n return (compare(b, b) === 0) - (compare(a, a) === 0);\n };\n}\n\nexport function ascendingDefined(a, b) {\n return (a == null || !(a >= a)) - (b == null || !(b >= b)) || (a < b ? -1 : a > b ? 1 : 0);\n}\n","import {ascendingDefined, compareDefined} from \"./sort.js\";\n\n// Based on https://github.com/mourner/quickselect\n// ISC license, Copyright 2018 Vladimir Agafonkin.\nexport default function quickselect(array, k, left = 0, right = Infinity, compare) {\n k = Math.floor(k);\n left = Math.floor(Math.max(0, left));\n right = Math.floor(Math.min(array.length - 1, right));\n\n if (!(left <= k && k <= right)) return array;\n\n compare = compare === undefined ? ascendingDefined : compareDefined(compare);\n\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n const t = array[k];\n let i = left;\n let j = right;\n\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);\n else ++j, swap(array, j, right);\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n\n return array;\n}\n\nfunction swap(array, i, j) {\n const t = array[i];\n array[i] = array[j];\n array[j] = t;\n}\n","export default function number(x) {\n return x === null ? NaN : +x;\n}\n\nexport function* numbers(values, valueof) {\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n","import max from \"./max.js\";\nimport maxIndex from \"./maxIndex.js\";\nimport min from \"./min.js\";\nimport minIndex from \"./minIndex.js\";\nimport quickselect from \"./quickselect.js\";\nimport number, {numbers} from \"./number.js\";\nimport {ascendingDefined} from \"./sort.js\";\nimport greatest from \"./greatest.js\";\n\nexport default function quantile(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return min(values);\n if (p >= 1) return max(values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = max(quickselect(values, i0).subarray(0, i0 + 1)),\n value1 = min(values.subarray(i0 + 1));\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileSorted(values, p, valueof = number) {\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileIndex(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return minIndex(values);\n if (p >= 1) return maxIndex(values);\n var n,\n i = Math.floor((n - 1) * p),\n order = (i, j) => ascendingDefined(values[i], values[j]),\n index = quickselect(Uint32Array.from(values, (_, i) => i), i, 0, n - 1, order);\n return greatest(index.subarray(0, i + 1), i => values[i]);\n}\n","import quantile, {quantileIndex} from \"./quantile.js\";\n\nexport default function median(values, valueof) {\n return quantile(values, 0.5, valueof);\n}\n\nexport function medianIndex(values, valueof) {\n return quantileIndex(values, 0.5, valueof);\n}\n","import { ascending, quantileSorted, deviation, quantile, median } from 'd3-array';\n\nfunction* numbers (values, valueof) {\n if (valueof == null) {\n for (let value of values) {\n if (value != null && value !== '' && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n value = valueof(value, ++index, values);\n if (value != null && value !== '' && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n\nfunction quantiles (array, p, f) {\n const values = Float64Array.from(numbers(array, f));\n\n // don't depend on return value from typed array sort call\n // protects against undefined sort results in Safari (vega/vega-lite#4964)\n values.sort(ascending);\n return p.map(_ => quantileSorted(values, _));\n}\n\nfunction quartiles (array, f) {\n return quantiles(array, [0.25, 0.50, 0.75], f);\n}\n\n// Scott, D. W. (1992) Multivariate Density Estimation:\n// Theory, Practice, and Visualization. Wiley.\nfunction estimateBandwidth (array, f) {\n const n = array.length,\n d = deviation(array, f),\n q = quartiles(array, f),\n h = (q[2] - q[0]) / 1.34,\n v = Math.min(d, h) || d || Math.abs(q[0]) || 1;\n return 1.06 * v * Math.pow(n, -0.2);\n}\n\nfunction bin (_) {\n // determine range\n const maxb = _.maxbins || 20,\n base = _.base || 10,\n logb = Math.log(base),\n div = _.divide || [5, 2];\n let min = _.extent[0],\n max = _.extent[1],\n step,\n level,\n minstep,\n v,\n i,\n n;\n const span = _.span || max - min || Math.abs(min) || 1;\n if (_.step) {\n // if step size is explicitly given, use that\n step = _.step;\n } else if (_.steps) {\n // if provided, limit choice to acceptable step sizes\n v = span / maxb;\n for (i = 0, n = _.steps.length; i < n && _.steps[i] < v; ++i);\n step = _.steps[Math.max(0, i - 1)];\n } else {\n // else use span to determine step size\n level = Math.ceil(Math.log(maxb) / logb);\n minstep = _.minstep || 0;\n step = Math.max(minstep, Math.pow(base, Math.round(Math.log(span) / logb) - level));\n\n // increase step size if too many bins\n while (Math.ceil(span / step) > maxb) {\n step *= base;\n }\n\n // decrease step size if allowed\n for (i = 0, n = div.length; i < n; ++i) {\n v = step / div[i];\n if (v >= minstep && span / v <= maxb) step = v;\n }\n }\n\n // update precision, min and max\n v = Math.log(step);\n const precision = v >= 0 ? 0 : ~~(-v / logb) + 1,\n eps = Math.pow(base, -precision - 1);\n if (_.nice || _.nice === undefined) {\n v = Math.floor(min / step + eps) * step;\n min = min < v ? v - step : v;\n max = Math.ceil(max / step) * step;\n }\n return {\n start: min,\n stop: max === min ? min + step : max,\n step: step\n };\n}\n\nvar random = Math.random;\nfunction setRandom(r) {\n random = r;\n}\n\nfunction bootstrapCI (array, samples, alpha, f) {\n if (!array.length) return [undefined, undefined];\n const values = Float64Array.from(numbers(array, f)),\n n = values.length,\n m = samples;\n let a, i, j, mu;\n for (j = 0, mu = Array(m); j < m; ++j) {\n for (a = 0, i = 0; i < n; ++i) {\n a += values[~~(random() * n)];\n }\n mu[j] = a / n;\n }\n mu.sort(ascending);\n return [quantile(mu, alpha / 2), quantile(mu, 1 - alpha / 2)];\n}\n\n// Dot density binning for dot plot construction.\n// Based on Leland Wilkinson, Dot Plots, The American Statistician, 1999.\n// https://www.cs.uic.edu/~wilkinson/Publications/dotplots.pdf\nfunction dotbin (array, step, smooth, f) {\n f = f || (_ => _);\n const n = array.length,\n v = new Float64Array(n);\n let i = 0,\n j = 1,\n a = f(array[0]),\n b = a,\n w = a + step,\n x;\n for (; j < n; ++j) {\n x = f(array[j]);\n if (x >= w) {\n b = (a + b) / 2;\n for (; i < j; ++i) v[i] = b;\n w = x + step;\n a = x;\n }\n b = x;\n }\n b = (a + b) / 2;\n for (; i < j; ++i) v[i] = b;\n return smooth ? smoothing(v, step + step / 4) : v;\n}\n\n// perform smoothing to reduce variance\n// swap points between \"adjacent\" stacks\n// Wilkinson defines adjacent as within step/4 units\nfunction smoothing(v, thresh) {\n const n = v.length;\n let a = 0,\n b = 1,\n c,\n d;\n\n // get left stack\n while (v[a] === v[b]) ++b;\n while (b < n) {\n // get right stack\n c = b + 1;\n while (v[b] === v[c]) ++c;\n\n // are stacks adjacent?\n // if so, compare sizes and swap as needed\n if (v[b] - v[b - 1] < thresh) {\n d = b + (a + c - b - b >> 1);\n while (d < b) v[d++] = v[b];\n while (d > b) v[d--] = v[a];\n }\n\n // update left stack indices\n a = b;\n b = c;\n }\n return v;\n}\n\nfunction lcg (seed) {\n // Random numbers using a Linear Congruential Generator with seed value\n // Uses glibc values from https://en.wikipedia.org/wiki/Linear_congruential_generator\n return function () {\n seed = (1103515245 * seed + 12345) % 2147483647;\n return seed / 2147483647;\n };\n}\n\nfunction integer (min, max) {\n if (max == null) {\n max = min;\n min = 0;\n }\n let a, b, d;\n const dist = {\n min(_) {\n if (arguments.length) {\n a = _ || 0;\n d = b - a;\n return dist;\n } else {\n return a;\n }\n },\n max(_) {\n if (arguments.length) {\n b = _ || 0;\n d = b - a;\n return dist;\n } else {\n return b;\n }\n },\n sample() {\n return a + Math.floor(d * random());\n },\n pdf(x) {\n return x === Math.floor(x) && x >= a && x < b ? 1 / d : 0;\n },\n cdf(x) {\n const v = Math.floor(x);\n return v < a ? 0 : v >= b ? 1 : (v - a + 1) / d;\n },\n icdf(p) {\n return p >= 0 && p <= 1 ? a - 1 + Math.floor(p * d) : NaN;\n }\n };\n return dist.min(min).max(max);\n}\n\nconst SQRT2PI = Math.sqrt(2 * Math.PI);\nconst SQRT2 = Math.SQRT2;\n\nlet nextSample = NaN;\nfunction sampleNormal(mean, stdev) {\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n let x = 0,\n y = 0,\n rds,\n c;\n if (nextSample === nextSample) {\n x = nextSample;\n nextSample = NaN;\n } else {\n do {\n x = random() * 2 - 1;\n y = random() * 2 - 1;\n rds = x * x + y * y;\n } while (rds === 0 || rds > 1);\n c = Math.sqrt(-2 * Math.log(rds) / rds); // Box-Muller transform\n x *= c;\n nextSample = y * c;\n }\n return mean + x * stdev;\n}\nfunction densityNormal(value, mean, stdev) {\n stdev = stdev == null ? 1 : stdev;\n const z = (value - (mean || 0)) / stdev;\n return Math.exp(-0.5 * z * z) / (stdev * SQRT2PI);\n}\n\n// Approximation from West (2009)\n// Better Approximations to Cumulative Normal Functions\nfunction cumulativeNormal(value, mean, stdev) {\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n const z = (value - mean) / stdev,\n Z = Math.abs(z);\n let cd;\n if (Z > 37) {\n cd = 0;\n } else {\n const exp = Math.exp(-Z * Z / 2);\n let sum;\n if (Z < 7.07106781186547) {\n sum = 3.52624965998911e-02 * Z + 0.700383064443688;\n sum = sum * Z + 6.37396220353165;\n sum = sum * Z + 33.912866078383;\n sum = sum * Z + 112.079291497871;\n sum = sum * Z + 221.213596169931;\n sum = sum * Z + 220.206867912376;\n cd = exp * sum;\n sum = 8.83883476483184e-02 * Z + 1.75566716318264;\n sum = sum * Z + 16.064177579207;\n sum = sum * Z + 86.7807322029461;\n sum = sum * Z + 296.564248779674;\n sum = sum * Z + 637.333633378831;\n sum = sum * Z + 793.826512519948;\n sum = sum * Z + 440.413735824752;\n cd = cd / sum;\n } else {\n sum = Z + 0.65;\n sum = Z + 4 / sum;\n sum = Z + 3 / sum;\n sum = Z + 2 / sum;\n sum = Z + 1 / sum;\n cd = exp / sum / 2.506628274631;\n }\n }\n return z > 0 ? 1 - cd : cd;\n}\n\n// Approximation of Probit function using inverse error function.\nfunction quantileNormal(p, mean, stdev) {\n if (p < 0 || p > 1) return NaN;\n return (mean || 0) + (stdev == null ? 1 : stdev) * SQRT2 * erfinv(2 * p - 1);\n}\n\n// Approximate inverse error function. Implementation from \"Approximating\n// the erfinv function\" by Mike Giles, GPU Computing Gems, volume 2, 2010.\n// Ported from Apache Commons Math, http://www.apache.org/licenses/LICENSE-2.0\nfunction erfinv(x) {\n // beware that the logarithm argument must be\n // commputed as (1.0 - x) * (1.0 + x),\n // it must NOT be simplified as 1.0 - x * x as this\n // would induce rounding errors near the boundaries +/-1\n let w = -Math.log((1 - x) * (1 + x)),\n p;\n if (w < 6.25) {\n w -= 3.125;\n p = -3.6444120640178196996e-21;\n p = -1.685059138182016589e-19 + p * w;\n p = 1.2858480715256400167e-18 + p * w;\n p = 1.115787767802518096e-17 + p * w;\n p = -1.333171662854620906e-16 + p * w;\n p = 2.0972767875968561637e-17 + p * w;\n p = 6.6376381343583238325e-15 + p * w;\n p = -4.0545662729752068639e-14 + p * w;\n p = -8.1519341976054721522e-14 + p * w;\n p = 2.6335093153082322977e-12 + p * w;\n p = -1.2975133253453532498e-11 + p * w;\n p = -5.4154120542946279317e-11 + p * w;\n p = 1.051212273321532285e-09 + p * w;\n p = -4.1126339803469836976e-09 + p * w;\n p = -2.9070369957882005086e-08 + p * w;\n p = 4.2347877827932403518e-07 + p * w;\n p = -1.3654692000834678645e-06 + p * w;\n p = -1.3882523362786468719e-05 + p * w;\n p = 0.0001867342080340571352 + p * w;\n p = -0.00074070253416626697512 + p * w;\n p = -0.0060336708714301490533 + p * w;\n p = 0.24015818242558961693 + p * w;\n p = 1.6536545626831027356 + p * w;\n } else if (w < 16.0) {\n w = Math.sqrt(w) - 3.25;\n p = 2.2137376921775787049e-09;\n p = 9.0756561938885390979e-08 + p * w;\n p = -2.7517406297064545428e-07 + p * w;\n p = 1.8239629214389227755e-08 + p * w;\n p = 1.5027403968909827627e-06 + p * w;\n p = -4.013867526981545969e-06 + p * w;\n p = 2.9234449089955446044e-06 + p * w;\n p = 1.2475304481671778723e-05 + p * w;\n p = -4.7318229009055733981e-05 + p * w;\n p = 6.8284851459573175448e-05 + p * w;\n p = 2.4031110387097893999e-05 + p * w;\n p = -0.0003550375203628474796 + p * w;\n p = 0.00095328937973738049703 + p * w;\n p = -0.0016882755560235047313 + p * w;\n p = 0.0024914420961078508066 + p * w;\n p = -0.0037512085075692412107 + p * w;\n p = 0.005370914553590063617 + p * w;\n p = 1.0052589676941592334 + p * w;\n p = 3.0838856104922207635 + p * w;\n } else if (Number.isFinite(w)) {\n w = Math.sqrt(w) - 5.0;\n p = -2.7109920616438573243e-11;\n p = -2.5556418169965252055e-10 + p * w;\n p = 1.5076572693500548083e-09 + p * w;\n p = -3.7894654401267369937e-09 + p * w;\n p = 7.6157012080783393804e-09 + p * w;\n p = -1.4960026627149240478e-08 + p * w;\n p = 2.9147953450901080826e-08 + p * w;\n p = -6.7711997758452339498e-08 + p * w;\n p = 2.2900482228026654717e-07 + p * w;\n p = -9.9298272942317002539e-07 + p * w;\n p = 4.5260625972231537039e-06 + p * w;\n p = -1.9681778105531670567e-05 + p * w;\n p = 7.5995277030017761139e-05 + p * w;\n p = -0.00021503011930044477347 + p * w;\n p = -0.00013871931833623122026 + p * w;\n p = 1.0103004648645343977 + p * w;\n p = 4.8499064014085844221 + p * w;\n } else {\n p = Infinity;\n }\n return p * x;\n}\nfunction gaussian (mean, stdev) {\n let mu, sigma;\n const dist = {\n mean(_) {\n if (arguments.length) {\n mu = _ || 0;\n return dist;\n } else {\n return mu;\n }\n },\n stdev(_) {\n if (arguments.length) {\n sigma = _ == null ? 1 : _;\n return dist;\n } else {\n return sigma;\n }\n },\n sample: () => sampleNormal(mu, sigma),\n pdf: value => densityNormal(value, mu, sigma),\n cdf: value => cumulativeNormal(value, mu, sigma),\n icdf: p => quantileNormal(p, mu, sigma)\n };\n return dist.mean(mean).stdev(stdev);\n}\n\nfunction kde (support, bandwidth) {\n const kernel = gaussian();\n let n = 0;\n const dist = {\n data(_) {\n if (arguments.length) {\n support = _;\n n = _ ? _.length : 0;\n return dist.bandwidth(bandwidth);\n } else {\n return support;\n }\n },\n bandwidth(_) {\n if (!arguments.length) return bandwidth;\n bandwidth = _;\n if (!bandwidth && support) bandwidth = estimateBandwidth(support);\n return dist;\n },\n sample() {\n return support[~~(random() * n)] + bandwidth * kernel.sample();\n },\n pdf(x) {\n let y = 0,\n i = 0;\n for (; i < n; ++i) {\n y += kernel.pdf((x - support[i]) / bandwidth);\n }\n return y / bandwidth / n;\n },\n cdf(x) {\n let y = 0,\n i = 0;\n for (; i < n; ++i) {\n y += kernel.cdf((x - support[i]) / bandwidth);\n }\n return y / n;\n },\n icdf() {\n throw Error('KDE icdf not supported.');\n }\n };\n return dist.data(support);\n}\n\nfunction sampleLogNormal(mean, stdev) {\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n return Math.exp(mean + sampleNormal() * stdev);\n}\nfunction densityLogNormal(value, mean, stdev) {\n if (value <= 0) return 0;\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n const z = (Math.log(value) - mean) / stdev;\n return Math.exp(-0.5 * z * z) / (stdev * SQRT2PI * value);\n}\nfunction cumulativeLogNormal(value, mean, stdev) {\n return cumulativeNormal(Math.log(value), mean, stdev);\n}\nfunction quantileLogNormal(p, mean, stdev) {\n return Math.exp(quantileNormal(p, mean, stdev));\n}\nfunction lognormal (mean, stdev) {\n let mu, sigma;\n const dist = {\n mean(_) {\n if (arguments.length) {\n mu = _ || 0;\n return dist;\n } else {\n return mu;\n }\n },\n stdev(_) {\n if (arguments.length) {\n sigma = _ == null ? 1 : _;\n return dist;\n } else {\n return sigma;\n }\n },\n sample: () => sampleLogNormal(mu, sigma),\n pdf: value => densityLogNormal(value, mu, sigma),\n cdf: value => cumulativeLogNormal(value, mu, sigma),\n icdf: p => quantileLogNormal(p, mu, sigma)\n };\n return dist.mean(mean).stdev(stdev);\n}\n\nfunction mixture (dists, weights) {\n let m = 0,\n w;\n function normalize(x) {\n const w = [];\n let sum = 0,\n i;\n for (i = 0; i < m; ++i) {\n sum += w[i] = x[i] == null ? 1 : +x[i];\n }\n for (i = 0; i < m; ++i) {\n w[i] /= sum;\n }\n return w;\n }\n const dist = {\n weights(_) {\n if (arguments.length) {\n w = normalize(weights = _ || []);\n return dist;\n }\n return weights;\n },\n distributions(_) {\n if (arguments.length) {\n if (_) {\n m = _.length;\n dists = _;\n } else {\n m = 0;\n dists = [];\n }\n return dist.weights(weights);\n }\n return dists;\n },\n sample() {\n const r = random();\n let d = dists[m - 1],\n v = w[0],\n i = 0;\n\n // first select distribution\n for (; i < m - 1; v += w[++i]) {\n if (r < v) {\n d = dists[i];\n break;\n }\n }\n // then sample from it\n return d.sample();\n },\n pdf(x) {\n let p = 0,\n i = 0;\n for (; i < m; ++i) {\n p += w[i] * dists[i].pdf(x);\n }\n return p;\n },\n cdf(x) {\n let p = 0,\n i = 0;\n for (; i < m; ++i) {\n p += w[i] * dists[i].cdf(x);\n }\n return p;\n },\n icdf() {\n throw Error('Mixture icdf not supported.');\n }\n };\n return dist.distributions(dists).weights(weights);\n}\n\nfunction sampleUniform(min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return min + (max - min) * random();\n}\nfunction densityUniform(value, min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return value >= min && value <= max ? 1 / (max - min) : 0;\n}\nfunction cumulativeUniform(value, min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return value < min ? 0 : value > max ? 1 : (value - min) / (max - min);\n}\nfunction quantileUniform(p, min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return p >= 0 && p <= 1 ? min + p * (max - min) : NaN;\n}\nfunction uniform (min, max) {\n let a, b;\n const dist = {\n min(_) {\n if (arguments.length) {\n a = _ || 0;\n return dist;\n } else {\n return a;\n }\n },\n max(_) {\n if (arguments.length) {\n b = _ == null ? 1 : _;\n return dist;\n } else {\n return b;\n }\n },\n sample: () => sampleUniform(a, b),\n pdf: value => densityUniform(value, a, b),\n cdf: value => cumulativeUniform(value, a, b),\n icdf: p => quantileUniform(p, a, b)\n };\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return dist.min(min).max(max);\n}\n\n// Ordinary Least Squares\nfunction ols (uX, uY, uXY, uX2) {\n const delta = uX2 - uX * uX,\n slope = Math.abs(delta) < 1e-24 ? 0 : (uXY - uX * uY) / delta,\n intercept = uY - slope * uX;\n return [intercept, slope];\n}\n\nfunction points(data, x, y, sort) {\n data = data.filter(d => {\n let u = x(d),\n v = y(d);\n return u != null && (u = +u) >= u && v != null && (v = +v) >= v;\n });\n if (sort) {\n data.sort((a, b) => x(a) - x(b));\n }\n const n = data.length,\n X = new Float64Array(n),\n Y = new Float64Array(n);\n\n // extract values, calculate means\n let i = 0,\n ux = 0,\n uy = 0,\n xv,\n yv,\n d;\n for (d of data) {\n X[i] = xv = +x(d);\n Y[i] = yv = +y(d);\n ++i;\n ux += (xv - ux) / i;\n uy += (yv - uy) / i;\n }\n\n // mean center the data\n for (i = 0; i < n; ++i) {\n X[i] -= ux;\n Y[i] -= uy;\n }\n return [X, Y, ux, uy];\n}\nfunction visitPoints(data, x, y, callback) {\n let i = -1,\n u,\n v;\n for (const d of data) {\n u = x(d);\n v = y(d);\n if (u != null && (u = +u) >= u && v != null && (v = +v) >= v) {\n callback(u, v, ++i);\n }\n }\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\nfunction rSquared (data, x, y, uY, predict) {\n let SSE = 0,\n SST = 0;\n visitPoints(data, x, y, (dx, dy) => {\n const sse = dy - predict(dx),\n sst = dy - uY;\n SSE += sse * sse;\n SST += sst * sst;\n });\n return 1 - SSE / SST;\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\nfunction linear (data, x, y) {\n let X = 0,\n Y = 0,\n XY = 0,\n X2 = 0,\n n = 0;\n visitPoints(data, x, y, (dx, dy) => {\n ++n;\n X += (dx - X) / n;\n Y += (dy - Y) / n;\n XY += (dx * dy - XY) / n;\n X2 += (dx * dx - X2) / n;\n });\n const coef = ols(X, Y, XY, X2),\n predict = x => coef[0] + coef[1] * x;\n return {\n coef: coef,\n predict: predict,\n rSquared: rSquared(data, x, y, Y, predict)\n };\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\nfunction log (data, x, y) {\n let X = 0,\n Y = 0,\n XY = 0,\n X2 = 0,\n n = 0;\n visitPoints(data, x, y, (dx, dy) => {\n ++n;\n dx = Math.log(dx);\n X += (dx - X) / n;\n Y += (dy - Y) / n;\n XY += (dx * dy - XY) / n;\n X2 += (dx * dx - X2) / n;\n });\n const coef = ols(X, Y, XY, X2),\n predict = x => coef[0] + coef[1] * Math.log(x);\n return {\n coef: coef,\n predict: predict,\n rSquared: rSquared(data, x, y, Y, predict)\n };\n}\n\nfunction exp (data, x, y) {\n // eslint-disable-next-line no-unused-vars\n const [xv, yv, ux, uy] = points(data, x, y);\n let YL = 0,\n XY = 0,\n XYL = 0,\n X2Y = 0,\n n = 0,\n dx,\n ly,\n xy;\n visitPoints(data, x, y, (_, dy) => {\n dx = xv[n++];\n ly = Math.log(dy);\n xy = dx * dy;\n YL += (dy * ly - YL) / n;\n XY += (xy - XY) / n;\n XYL += (xy * ly - XYL) / n;\n X2Y += (dx * xy - X2Y) / n;\n });\n const [c0, c1] = ols(XY / uy, YL / uy, XYL / uy, X2Y / uy),\n predict = x => Math.exp(c0 + c1 * (x - ux));\n return {\n coef: [Math.exp(c0 - c1 * ux), c1],\n predict: predict,\n rSquared: rSquared(data, x, y, uy, predict)\n };\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\nfunction pow (data, x, y) {\n let X = 0,\n Y = 0,\n XY = 0,\n X2 = 0,\n YS = 0,\n n = 0;\n visitPoints(data, x, y, (dx, dy) => {\n const lx = Math.log(dx),\n ly = Math.log(dy);\n ++n;\n X += (lx - X) / n;\n Y += (ly - Y) / n;\n XY += (lx * ly - XY) / n;\n X2 += (lx * lx - X2) / n;\n YS += (dy - YS) / n;\n });\n const coef = ols(X, Y, XY, X2),\n predict = x => coef[0] * Math.pow(x, coef[1]);\n coef[0] = Math.exp(coef[0]);\n return {\n coef: coef,\n predict: predict,\n rSquared: rSquared(data, x, y, YS, predict)\n };\n}\n\nfunction quad (data, x, y) {\n const [xv, yv, ux, uy] = points(data, x, y),\n n = xv.length;\n let X2 = 0,\n X3 = 0,\n X4 = 0,\n XY = 0,\n X2Y = 0,\n i,\n dx,\n dy,\n x2;\n for (i = 0; i < n;) {\n dx = xv[i];\n dy = yv[i++];\n x2 = dx * dx;\n X2 += (x2 - X2) / i;\n X3 += (x2 * dx - X3) / i;\n X4 += (x2 * x2 - X4) / i;\n XY += (dx * dy - XY) / i;\n X2Y += (x2 * dy - X2Y) / i;\n }\n const X2X2 = X4 - X2 * X2,\n d = X2 * X2X2 - X3 * X3,\n a = (X2Y * X2 - XY * X3) / d,\n b = (XY * X2X2 - X2Y * X3) / d,\n c = -a * X2,\n predict = x => {\n x = x - ux;\n return a * x * x + b * x + c + uy;\n };\n\n // transform coefficients back from mean-centered space\n return {\n coef: [c - b * ux + a * ux * ux + uy, b - 2 * a * ux, a],\n predict: predict,\n rSquared: rSquared(data, x, y, uy, predict)\n };\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\n// ... which was adapted from regression-js by Tom Alexander\n// Source: https://github.com/Tom-Alexander/regression-js/blob/master/src/regression.js#L246\n// License: https://github.com/Tom-Alexander/regression-js/blob/master/LICENSE\nfunction poly (data, x, y, order) {\n // use more efficient methods for lower orders\n if (order === 1) return linear(data, x, y);\n if (order === 2) return quad(data, x, y);\n const [xv, yv, ux, uy] = points(data, x, y),\n n = xv.length,\n lhs = [],\n rhs = [],\n k = order + 1;\n let i, j, l, v, c;\n for (i = 0; i < k; ++i) {\n for (l = 0, v = 0; l < n; ++l) {\n v += Math.pow(xv[l], i) * yv[l];\n }\n lhs.push(v);\n c = new Float64Array(k);\n for (j = 0; j < k; ++j) {\n for (l = 0, v = 0; l < n; ++l) {\n v += Math.pow(xv[l], i + j);\n }\n c[j] = v;\n }\n rhs.push(c);\n }\n rhs.push(lhs);\n const coef = gaussianElimination(rhs),\n predict = x => {\n x -= ux;\n let y = uy + coef[0] + coef[1] * x + coef[2] * x * x;\n for (i = 3; i < k; ++i) y += coef[i] * Math.pow(x, i);\n return y;\n };\n return {\n coef: uncenter(k, coef, -ux, uy),\n predict: predict,\n rSquared: rSquared(data, x, y, uy, predict)\n };\n}\nfunction uncenter(k, a, x, y) {\n const z = Array(k);\n let i, j, v, c;\n\n // initialize to zero\n for (i = 0; i < k; ++i) z[i] = 0;\n\n // polynomial expansion\n for (i = k - 1; i >= 0; --i) {\n v = a[i];\n c = 1;\n z[i] += v;\n for (j = 1; j <= i; ++j) {\n c *= (i + 1 - j) / j; // binomial coefficent\n z[i - j] += v * Math.pow(x, j) * c;\n }\n }\n\n // bias term\n z[0] += y;\n return z;\n}\n\n// Given an array for a two-dimensional matrix and the polynomial order,\n// solve A * x = b using Gaussian elimination.\nfunction gaussianElimination(matrix) {\n const n = matrix.length - 1,\n coef = [];\n let i, j, k, r, t;\n for (i = 0; i < n; ++i) {\n r = i; // max row\n for (j = i + 1; j < n; ++j) {\n if (Math.abs(matrix[i][j]) > Math.abs(matrix[i][r])) {\n r = j;\n }\n }\n for (k = i; k < n + 1; ++k) {\n t = matrix[k][i];\n matrix[k][i] = matrix[k][r];\n matrix[k][r] = t;\n }\n for (j = i + 1; j < n; ++j) {\n for (k = n; k >= i; k--) {\n matrix[k][j] -= matrix[k][i] * matrix[i][j] / matrix[i][i];\n }\n }\n }\n for (j = n - 1; j >= 0; --j) {\n t = 0;\n for (k = j + 1; k < n; ++k) {\n t += matrix[k][j] * coef[k];\n }\n coef[j] = (matrix[n][j] - t) / matrix[j][j];\n }\n return coef;\n}\n\nconst maxiters = 2,\n epsilon = 1e-12;\n\n// Adapted from science.js by Jason Davies\n// Source: https://github.com/jasondavies/science.js/blob/master/src/stats/loess.js\n// License: https://github.com/jasondavies/science.js/blob/master/LICENSE\nfunction loess (data, x, y, bandwidth) {\n const [xv, yv, ux, uy] = points(data, x, y, true),\n n = xv.length,\n bw = Math.max(2, ~~(bandwidth * n)),\n // # nearest neighbors\n yhat = new Float64Array(n),\n residuals = new Float64Array(n),\n robustWeights = new Float64Array(n).fill(1);\n for (let iter = -1; ++iter <= maxiters;) {\n const interval = [0, bw - 1];\n for (let i = 0; i < n; ++i) {\n const dx = xv[i],\n i0 = interval[0],\n i1 = interval[1],\n edge = dx - xv[i0] > xv[i1] - dx ? i0 : i1;\n let W = 0,\n X = 0,\n Y = 0,\n XY = 0,\n X2 = 0;\n const denom = 1 / Math.abs(xv[edge] - dx || 1); // avoid singularity!\n\n for (let k = i0; k <= i1; ++k) {\n const xk = xv[k],\n yk = yv[k],\n w = tricube(Math.abs(dx - xk) * denom) * robustWeights[k],\n xkw = xk * w;\n W += w;\n X += xkw;\n Y += yk * w;\n XY += yk * xkw;\n X2 += xk * xkw;\n }\n\n // linear regression fit\n const [a, b] = ols(X / W, Y / W, XY / W, X2 / W);\n yhat[i] = a + b * dx;\n residuals[i] = Math.abs(yv[i] - yhat[i]);\n updateInterval(xv, i + 1, interval);\n }\n if (iter === maxiters) {\n break;\n }\n const medianResidual = median(residuals);\n if (Math.abs(medianResidual) < epsilon) break;\n for (let i = 0, arg, w; i < n; ++i) {\n arg = residuals[i] / (6 * medianResidual);\n // default to epsilon (rather than zero) for large deviations\n // keeping weights tiny but non-zero prevents singularites\n robustWeights[i] = arg >= 1 ? epsilon : (w = 1 - arg * arg) * w;\n }\n }\n return output(xv, yhat, ux, uy);\n}\n\n// weighting kernel for local regression\nfunction tricube(x) {\n return (x = 1 - x * x * x) * x * x;\n}\n\n// advance sliding window interval of nearest neighbors\nfunction updateInterval(xv, i, interval) {\n const val = xv[i];\n let left = interval[0],\n right = interval[1] + 1;\n if (right >= xv.length) return;\n\n // step right if distance to new right edge is <= distance to old left edge\n // step when distance is equal to ensure movement over duplicate x values\n while (i > left && xv[right] - val <= val - xv[left]) {\n interval[0] = ++left;\n interval[1] = right;\n ++right;\n }\n}\n\n// generate smoothed output points\n// average points with repeated x values\nfunction output(xv, yhat, ux, uy) {\n const n = xv.length,\n out = [];\n let i = 0,\n cnt = 0,\n prev = [],\n v;\n for (; i < n; ++i) {\n v = xv[i] + ux;\n if (prev[0] === v) {\n // average output values via online update\n prev[1] += (yhat[i] - prev[1]) / ++cnt;\n } else {\n // add new output point\n cnt = 0;\n prev[1] += uy;\n prev = [v, yhat[i]];\n out.push(prev);\n }\n }\n prev[1] += uy;\n return out;\n}\n\n// subdivide up to accuracy of 0.5 degrees\nconst MIN_RADIANS = 0.5 * Math.PI / 180;\n\n// Adaptively sample an interpolated function over a domain extent\nfunction sampleCurve (f, extent, minSteps, maxSteps) {\n minSteps = minSteps || 25;\n maxSteps = Math.max(minSteps, maxSteps || 200);\n const point = x => [x, f(x)],\n minX = extent[0],\n maxX = extent[1],\n span = maxX - minX,\n stop = span / maxSteps,\n prev = [point(minX)],\n next = [];\n if (minSteps === maxSteps) {\n // no adaptation, sample uniform grid directly and return\n for (let i = 1; i < maxSteps; ++i) {\n prev.push(point(minX + i / minSteps * span));\n }\n prev.push(point(maxX));\n return prev;\n } else {\n // sample minimum points on uniform grid\n // then move on to perform adaptive refinement\n next.push(point(maxX));\n for (let i = minSteps; --i > 0;) {\n next.push(point(minX + i / minSteps * span));\n }\n }\n let p0 = prev[0];\n let p1 = next[next.length - 1];\n const sx = 1 / span;\n const sy = scaleY(p0[1], next);\n while (p1) {\n // midpoint for potential curve subdivision\n const pm = point((p0[0] + p1[0]) / 2);\n const dx = pm[0] - p0[0] >= stop;\n if (dx && angleDelta(p0, pm, p1, sx, sy) > MIN_RADIANS) {\n // maximum resolution has not yet been met, and\n // subdivision midpoint is sufficiently different from endpoint\n // save subdivision, push midpoint onto the visitation stack\n next.push(pm);\n } else {\n // subdivision midpoint sufficiently similar to endpoint\n // skip subdivision, store endpoint, move to next point on the stack\n p0 = p1;\n prev.push(p1);\n next.pop();\n }\n p1 = next[next.length - 1];\n }\n return prev;\n}\nfunction scaleY(init, points) {\n let ymin = init;\n let ymax = init;\n const n = points.length;\n for (let i = 0; i < n; ++i) {\n const y = points[i][1];\n if (y < ymin) ymin = y;\n if (y > ymax) ymax = y;\n }\n return 1 / (ymax - ymin);\n}\nfunction angleDelta(p, q, r, sx, sy) {\n const a0 = Math.atan2(sy * (r[1] - p[1]), sx * (r[0] - p[0])),\n a1 = Math.atan2(sy * (q[1] - p[1]), sx * (q[0] - p[0]));\n return Math.abs(a0 - a1);\n}\n\nexport { estimateBandwidth as bandwidthNRD, bin, bootstrapCI, cumulativeLogNormal, cumulativeNormal, cumulativeUniform, densityLogNormal, densityNormal, densityUniform, dotbin, quantileLogNormal, quantileNormal, quantileUniform, quantiles, quartiles, random, integer as randomInteger, kde as randomKDE, lcg as randomLCG, lognormal as randomLogNormal, mixture as randomMixture, gaussian as randomNormal, uniform as randomUniform, exp as regressionExp, linear as regressionLinear, loess as regressionLoess, log as regressionLog, poly as regressionPoly, pow as regressionPow, quad as regressionQuad, sampleCurve, sampleLogNormal, sampleNormal, sampleUniform, setRandom };\n","import variance from \"./variance.js\";\n\nexport default function deviation(values, valueof) {\n const v = variance(values, valueof);\n return v ? Math.sqrt(v) : v;\n}\n","export default function variance(values, valueof) {\n let count = 0;\n let delta;\n let mean = 0;\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n delta = value - mean;\n mean += delta / ++count;\n sum += delta * (value - mean);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n delta = value - mean;\n mean += delta / ++count;\n sum += delta * (value - mean);\n }\n }\n }\n if (count > 1) return sum / (count - 1);\n}\n","export default function range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","import { extend, identity, field, hasOwnProperty, extentIndex, inherits, array, accessorName, error, accessorFields, accessor, toNumber, merge, compare, truthy, extent, span, fastmap, isArray, key, ascending, peek, zero, constant } from 'vega-util';\nimport { tupleid, Transform, replace, ingest, stableCompare, Operator, derive, rederive } from 'vega-dataflow';\nimport { quartiles, bootstrapCI, bin, randomKDE, randomMixture, randomNormal, randomLogNormal, randomUniform, sampleCurve, dotbin, quantiles, random } from 'vega-statistics';\nimport { median, mean, min, max, range, bisector } from 'd3-array';\nimport { TIME_UNITS, utcInterval, timeInterval, timeBin, timeUnits, utcFloor, timeFloor } from 'vega-time';\n\nfunction multikey(f) {\n return x => {\n const n = f.length;\n let i = 1,\n k = String(f[0](x));\n for (; i < n; ++i) {\n k += '|' + f[i](x);\n }\n return k;\n };\n}\nfunction groupkey(fields) {\n return !fields || !fields.length ? function () {\n return '';\n } : fields.length === 1 ? fields[0] : multikey(fields);\n}\n\nfunction measureName(op, field, as) {\n return as || op + (!field ? '' : '_' + field);\n}\nconst noop = () => {};\nconst base_op = {\n init: noop,\n add: noop,\n rem: noop,\n idx: 0\n};\nconst AggregateOps = {\n values: {\n init: m => m.cell.store = true,\n value: m => m.cell.data.values(),\n idx: -1\n },\n count: {\n value: m => m.cell.num\n },\n __count__: {\n value: m => m.missing + m.valid\n },\n missing: {\n value: m => m.missing\n },\n valid: {\n value: m => m.valid\n },\n sum: {\n init: m => m.sum = 0,\n value: m => m.sum,\n add: (m, v) => m.sum += +v,\n rem: (m, v) => m.sum -= v\n },\n product: {\n init: m => m.product = 1,\n value: m => m.valid ? m.product : undefined,\n add: (m, v) => m.product *= v,\n rem: (m, v) => m.product /= v\n },\n mean: {\n init: m => m.mean = 0,\n value: m => m.valid ? m.mean : undefined,\n add: (m, v) => (m.mean_d = v - m.mean, m.mean += m.mean_d / m.valid),\n rem: (m, v) => (m.mean_d = v - m.mean, m.mean -= m.valid ? m.mean_d / m.valid : m.mean)\n },\n average: {\n value: m => m.valid ? m.mean : undefined,\n req: ['mean'],\n idx: 1\n },\n variance: {\n init: m => m.dev = 0,\n value: m => m.valid > 1 ? m.dev / (m.valid - 1) : undefined,\n add: (m, v) => m.dev += m.mean_d * (v - m.mean),\n rem: (m, v) => m.dev -= m.mean_d * (v - m.mean),\n req: ['mean'],\n idx: 1\n },\n variancep: {\n value: m => m.valid > 1 ? m.dev / m.valid : undefined,\n req: ['variance'],\n idx: 2\n },\n stdev: {\n value: m => m.valid > 1 ? Math.sqrt(m.dev / (m.valid - 1)) : undefined,\n req: ['variance'],\n idx: 2\n },\n stdevp: {\n value: m => m.valid > 1 ? Math.sqrt(m.dev / m.valid) : undefined,\n req: ['variance'],\n idx: 2\n },\n stderr: {\n value: m => m.valid > 1 ? Math.sqrt(m.dev / (m.valid * (m.valid - 1))) : undefined,\n req: ['variance'],\n idx: 2\n },\n distinct: {\n value: m => m.cell.data.distinct(m.get),\n req: ['values'],\n idx: 3\n },\n ci0: {\n value: m => m.cell.data.ci0(m.get),\n req: ['values'],\n idx: 3\n },\n ci1: {\n value: m => m.cell.data.ci1(m.get),\n req: ['values'],\n idx: 3\n },\n median: {\n value: m => m.cell.data.q2(m.get),\n req: ['values'],\n idx: 3\n },\n q1: {\n value: m => m.cell.data.q1(m.get),\n req: ['values'],\n idx: 3\n },\n q3: {\n value: m => m.cell.data.q3(m.get),\n req: ['values'],\n idx: 3\n },\n min: {\n init: m => m.min = undefined,\n value: m => m.min = Number.isNaN(m.min) ? m.cell.data.min(m.get) : m.min,\n add: (m, v) => {\n if (v < m.min || m.min === undefined) m.min = v;\n },\n rem: (m, v) => {\n if (v <= m.min) m.min = NaN;\n },\n req: ['values'],\n idx: 4\n },\n max: {\n init: m => m.max = undefined,\n value: m => m.max = Number.isNaN(m.max) ? m.cell.data.max(m.get) : m.max,\n add: (m, v) => {\n if (v > m.max || m.max === undefined) m.max = v;\n },\n rem: (m, v) => {\n if (v >= m.max) m.max = NaN;\n },\n req: ['values'],\n idx: 4\n },\n argmin: {\n init: m => m.argmin = undefined,\n value: m => m.argmin || m.cell.data.argmin(m.get),\n add: (m, v, t) => {\n if (v < m.min) m.argmin = t;\n },\n rem: (m, v) => {\n if (v <= m.min) m.argmin = undefined;\n },\n req: ['min', 'values'],\n idx: 3\n },\n argmax: {\n init: m => m.argmax = undefined,\n value: m => m.argmax || m.cell.data.argmax(m.get),\n add: (m, v, t) => {\n if (v > m.max) m.argmax = t;\n },\n rem: (m, v) => {\n if (v >= m.max) m.argmax = undefined;\n },\n req: ['max', 'values'],\n idx: 3\n }\n};\nconst ValidAggregateOps = Object.keys(AggregateOps).filter(d => d !== '__count__');\nfunction measure(key, value) {\n return out => extend({\n name: key,\n out: out || key\n }, base_op, value);\n}\n[...ValidAggregateOps, '__count__'].forEach(key => {\n AggregateOps[key] = measure(key, AggregateOps[key]);\n});\nfunction createMeasure(op, name) {\n return AggregateOps[op](name);\n}\nfunction compareIndex(a, b) {\n return a.idx - b.idx;\n}\nfunction resolve(agg) {\n const map = {};\n agg.forEach(a => map[a.name] = a);\n const getreqs = a => {\n if (!a.req) return;\n a.req.forEach(key => {\n if (!map[key]) getreqs(map[key] = AggregateOps[key]());\n });\n };\n agg.forEach(getreqs);\n return Object.values(map).sort(compareIndex);\n}\nfunction init() {\n this.valid = 0;\n this.missing = 0;\n this._ops.forEach(op => op.init(this));\n}\nfunction add(v, t) {\n if (v == null || v === '') {\n ++this.missing;\n return;\n }\n if (v !== v) return;\n ++this.valid;\n this._ops.forEach(op => op.add(this, v, t));\n}\nfunction rem(v, t) {\n if (v == null || v === '') {\n --this.missing;\n return;\n }\n if (v !== v) return;\n --this.valid;\n this._ops.forEach(op => op.rem(this, v, t));\n}\nfunction set(t) {\n this._out.forEach(op => t[op.out] = op.value(this));\n return t;\n}\nfunction compileMeasures(agg, field) {\n const get = field || identity,\n ops = resolve(agg),\n out = agg.slice().sort(compareIndex);\n function ctr(cell) {\n this._ops = ops;\n this._out = out;\n this.cell = cell;\n this.init();\n }\n ctr.prototype.init = init;\n ctr.prototype.add = add;\n ctr.prototype.rem = rem;\n ctr.prototype.set = set;\n ctr.prototype.get = get;\n ctr.fields = agg.map(op => op.out);\n return ctr;\n}\n\nfunction TupleStore(key) {\n this._key = key ? field(key) : tupleid;\n this.reset();\n}\nconst prototype$1 = TupleStore.prototype;\nprototype$1.reset = function () {\n this._add = [];\n this._rem = [];\n this._ext = null;\n this._get = null;\n this._q = null;\n};\nprototype$1.add = function (v) {\n this._add.push(v);\n};\nprototype$1.rem = function (v) {\n this._rem.push(v);\n};\nprototype$1.values = function () {\n this._get = null;\n if (this._rem.length === 0) return this._add;\n const a = this._add,\n r = this._rem,\n k = this._key,\n n = a.length,\n m = r.length,\n x = Array(n - m),\n map = {};\n let i, j, v;\n\n // use unique key field to clear removed values\n for (i = 0; i < m; ++i) {\n map[k(r[i])] = 1;\n }\n for (i = 0, j = 0; i < n; ++i) {\n if (map[k(v = a[i])]) {\n map[k(v)] = 0;\n } else {\n x[j++] = v;\n }\n }\n this._rem = [];\n return this._add = x;\n};\n\n// memoizing statistics methods\n\nprototype$1.distinct = function (get) {\n const v = this.values(),\n map = {};\n let n = v.length,\n count = 0,\n s;\n while (--n >= 0) {\n s = get(v[n]) + '';\n if (!hasOwnProperty(map, s)) {\n map[s] = 1;\n ++count;\n }\n }\n return count;\n};\nprototype$1.extent = function (get) {\n if (this._get !== get || !this._ext) {\n const v = this.values(),\n i = extentIndex(v, get);\n this._ext = [v[i[0]], v[i[1]]];\n this._get = get;\n }\n return this._ext;\n};\nprototype$1.argmin = function (get) {\n return this.extent(get)[0] || {};\n};\nprototype$1.argmax = function (get) {\n return this.extent(get)[1] || {};\n};\nprototype$1.min = function (get) {\n const m = this.extent(get)[0];\n return m != null ? get(m) : undefined;\n};\nprototype$1.max = function (get) {\n const m = this.extent(get)[1];\n return m != null ? get(m) : undefined;\n};\nprototype$1.quartile = function (get) {\n if (this._get !== get || !this._q) {\n this._q = quartiles(this.values(), get);\n this._get = get;\n }\n return this._q;\n};\nprototype$1.q1 = function (get) {\n return this.quartile(get)[0];\n};\nprototype$1.q2 = function (get) {\n return this.quartile(get)[1];\n};\nprototype$1.q3 = function (get) {\n return this.quartile(get)[2];\n};\nprototype$1.ci = function (get) {\n if (this._get !== get || !this._ci) {\n this._ci = bootstrapCI(this.values(), 1000, 0.05, get);\n this._get = get;\n }\n return this._ci;\n};\nprototype$1.ci0 = function (get) {\n return this.ci(get)[0];\n};\nprototype$1.ci1 = function (get) {\n return this.ci(get)[1];\n};\n\n/**\n * Group-by aggregation operator.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {Array} [params.fields] - An array of accessors to aggregate.\n * @param {Array} [params.ops] - An array of strings indicating aggregation operations.\n * @param {Array} [params.as] - An array of output field names for aggregated values.\n * @param {boolean} [params.cross=false] - A flag indicating that the full\n * cross-product of groupby values should be generated, including empty cells.\n * If true, the drop parameter is ignored and empty cells are retained.\n * @param {boolean} [params.drop=true] - A flag indicating if empty cells should be removed.\n */\nfunction Aggregate(params) {\n Transform.call(this, null, params);\n this._adds = []; // array of added output tuples\n this._mods = []; // array of modified output tuples\n this._alen = 0; // number of active added tuples\n this._mlen = 0; // number of active modified tuples\n this._drop = true; // should empty aggregation cells be removed\n this._cross = false; // produce full cross-product of group-by values\n\n this._dims = []; // group-by dimension accessors\n this._dnames = []; // group-by dimension names\n\n this._measures = []; // collection of aggregation monoids\n this._countOnly = false; // flag indicating only count aggregation\n this._counts = null; // collection of count fields\n this._prev = null; // previous aggregation cells\n\n this._inputs = null; // array of dependent input tuple field names\n this._outputs = null; // array of output tuple field names\n}\n\nAggregate.Definition = {\n 'type': 'Aggregate',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'ops',\n 'type': 'enum',\n 'array': true,\n 'values': ValidAggregateOps\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'null': true,\n 'array': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }, {\n 'name': 'drop',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'cross',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'key',\n 'type': 'field'\n }]\n};\ninherits(Aggregate, Transform, {\n transform(_, pulse) {\n const aggr = this,\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n mod = _.modified();\n aggr.stamp = out.stamp;\n if (aggr.value && (mod || pulse.modified(aggr._inputs, true))) {\n aggr._prev = aggr.value;\n aggr.value = mod ? aggr.init(_) : {};\n pulse.visit(pulse.SOURCE, t => aggr.add(t));\n } else {\n aggr.value = aggr.value || aggr.init(_);\n pulse.visit(pulse.REM, t => aggr.rem(t));\n pulse.visit(pulse.ADD, t => aggr.add(t));\n }\n\n // Indicate output fields and return aggregate tuples.\n out.modifies(aggr._outputs);\n\n // Should empty cells be dropped?\n aggr._drop = _.drop !== false;\n\n // If domain cross-product requested, generate empty cells as needed\n // and ensure that empty cells are not dropped\n if (_.cross && aggr._dims.length > 1) {\n aggr._drop = false;\n aggr.cross();\n }\n if (pulse.clean() && aggr._drop) {\n out.clean(true).runAfter(() => this.clean());\n }\n return aggr.changes(out);\n },\n cross() {\n const aggr = this,\n curr = aggr.value,\n dims = aggr._dnames,\n vals = dims.map(() => ({})),\n n = dims.length;\n\n // collect all group-by domain values\n function collect(cells) {\n let key, i, t, v;\n for (key in cells) {\n t = cells[key].tuple;\n for (i = 0; i < n; ++i) {\n vals[i][v = t[dims[i]]] = v;\n }\n }\n }\n collect(aggr._prev);\n collect(curr);\n\n // iterate over key cross-product, create cells as needed\n function generate(base, tuple, index) {\n const name = dims[index],\n v = vals[index++];\n for (const k in v) {\n const key = base ? base + '|' + k : k;\n tuple[name] = v[k];\n if (index < n) generate(key, tuple, index);else if (!curr[key]) aggr.cell(key, tuple);\n }\n }\n generate('', {}, 0);\n },\n init(_) {\n // initialize input and output fields\n const inputs = this._inputs = [],\n outputs = this._outputs = [],\n inputMap = {};\n function inputVisit(get) {\n const fields = array(accessorFields(get)),\n n = fields.length;\n let i = 0,\n f;\n for (; i < n; ++i) {\n if (!inputMap[f = fields[i]]) {\n inputMap[f] = 1;\n inputs.push(f);\n }\n }\n }\n\n // initialize group-by dimensions\n this._dims = array(_.groupby);\n this._dnames = this._dims.map(d => {\n const dname = accessorName(d);\n inputVisit(d);\n outputs.push(dname);\n return dname;\n });\n this.cellkey = _.key ? _.key : groupkey(this._dims);\n\n // initialize aggregate measures\n this._countOnly = true;\n this._counts = [];\n this._measures = [];\n const fields = _.fields || [null],\n ops = _.ops || ['count'],\n as = _.as || [],\n n = fields.length,\n map = {};\n let field, op, m, mname, outname, i;\n if (n !== ops.length) {\n error('Unmatched number of fields and aggregate ops.');\n }\n for (i = 0; i < n; ++i) {\n field = fields[i];\n op = ops[i];\n if (field == null && op !== 'count') {\n error('Null aggregate field specified.');\n }\n mname = accessorName(field);\n outname = measureName(op, mname, as[i]);\n outputs.push(outname);\n if (op === 'count') {\n this._counts.push(outname);\n continue;\n }\n m = map[mname];\n if (!m) {\n inputVisit(field);\n m = map[mname] = [];\n m.field = field;\n this._measures.push(m);\n }\n if (op !== 'count') this._countOnly = false;\n m.push(createMeasure(op, outname));\n }\n this._measures = this._measures.map(m => compileMeasures(m, m.field));\n return {}; // aggregation cells (this.value)\n },\n\n // -- Cell Management -----\n\n cellkey: groupkey(),\n cell(key, t) {\n let cell = this.value[key];\n if (!cell) {\n cell = this.value[key] = this.newcell(key, t);\n this._adds[this._alen++] = cell;\n } else if (cell.num === 0 && this._drop && cell.stamp < this.stamp) {\n cell.stamp = this.stamp;\n this._adds[this._alen++] = cell;\n } else if (cell.stamp < this.stamp) {\n cell.stamp = this.stamp;\n this._mods[this._mlen++] = cell;\n }\n return cell;\n },\n newcell(key, t) {\n const cell = {\n key: key,\n num: 0,\n agg: null,\n tuple: this.newtuple(t, this._prev && this._prev[key]),\n stamp: this.stamp,\n store: false\n };\n if (!this._countOnly) {\n const measures = this._measures,\n n = measures.length;\n cell.agg = Array(n);\n for (let i = 0; i < n; ++i) {\n cell.agg[i] = new measures[i](cell);\n }\n }\n if (cell.store) {\n cell.data = new TupleStore();\n }\n return cell;\n },\n newtuple(t, p) {\n const names = this._dnames,\n dims = this._dims,\n n = dims.length,\n x = {};\n for (let i = 0; i < n; ++i) {\n x[names[i]] = dims[i](t);\n }\n return p ? replace(p.tuple, x) : ingest(x);\n },\n clean() {\n const cells = this.value;\n for (const key in cells) {\n if (cells[key].num === 0) {\n delete cells[key];\n }\n }\n },\n // -- Process Tuples -----\n\n add(t) {\n const key = this.cellkey(t),\n cell = this.cell(key, t);\n cell.num += 1;\n if (this._countOnly) return;\n if (cell.store) cell.data.add(t);\n const agg = cell.agg;\n for (let i = 0, n = agg.length; i < n; ++i) {\n agg[i].add(agg[i].get(t), t);\n }\n },\n rem(t) {\n const key = this.cellkey(t),\n cell = this.cell(key, t);\n cell.num -= 1;\n if (this._countOnly) return;\n if (cell.store) cell.data.rem(t);\n const agg = cell.agg;\n for (let i = 0, n = agg.length; i < n; ++i) {\n agg[i].rem(agg[i].get(t), t);\n }\n },\n celltuple(cell) {\n const tuple = cell.tuple,\n counts = this._counts;\n\n // consolidate stored values\n if (cell.store) {\n cell.data.values();\n }\n\n // update tuple properties\n for (let i = 0, n = counts.length; i < n; ++i) {\n tuple[counts[i]] = cell.num;\n }\n if (!this._countOnly) {\n const agg = cell.agg;\n for (let i = 0, n = agg.length; i < n; ++i) {\n agg[i].set(tuple);\n }\n }\n return tuple;\n },\n changes(out) {\n const adds = this._adds,\n mods = this._mods,\n prev = this._prev,\n drop = this._drop,\n add = out.add,\n rem = out.rem,\n mod = out.mod;\n let cell, key, i, n;\n if (prev) for (key in prev) {\n cell = prev[key];\n if (!drop || cell.num) rem.push(cell.tuple);\n }\n for (i = 0, n = this._alen; i < n; ++i) {\n add.push(this.celltuple(adds[i]));\n adds[i] = null; // for garbage collection\n }\n\n for (i = 0, n = this._mlen; i < n; ++i) {\n cell = mods[i];\n (cell.num === 0 && drop ? rem : mod).push(this.celltuple(cell));\n mods[i] = null; // for garbage collection\n }\n\n this._alen = this._mlen = 0; // reset list of active cells\n this._prev = null;\n return out;\n }\n});\n\n// epsilon bias to offset floating point error (#1737)\nconst EPSILON$1 = 1e-14;\n\n/**\n * Generates a binning function for discretizing data.\n * @constructor\n * @param {object} params - The parameters for this operator. The\n * provided values should be valid options for the {@link bin} function.\n * @param {function(object): *} params.field - The data field to bin.\n */\nfunction Bin(params) {\n Transform.call(this, null, params);\n}\nBin.Definition = {\n 'type': 'Bin',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'interval',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'anchor',\n 'type': 'number'\n }, {\n 'name': 'maxbins',\n 'type': 'number',\n 'default': 20\n }, {\n 'name': 'base',\n 'type': 'number',\n 'default': 10\n }, {\n 'name': 'divide',\n 'type': 'number',\n 'array': true,\n 'default': [5, 2]\n }, {\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'required': true\n }, {\n 'name': 'span',\n 'type': 'number'\n }, {\n 'name': 'step',\n 'type': 'number'\n }, {\n 'name': 'steps',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'minstep',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'nice',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'name',\n 'type': 'string'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['bin0', 'bin1']\n }]\n};\ninherits(Bin, Transform, {\n transform(_, pulse) {\n const band = _.interval !== false,\n bins = this._bins(_),\n start = bins.start,\n step = bins.step,\n as = _.as || ['bin0', 'bin1'],\n b0 = as[0],\n b1 = as[1];\n let flag;\n if (_.modified()) {\n pulse = pulse.reflow(true);\n flag = pulse.SOURCE;\n } else {\n flag = pulse.modified(accessorFields(_.field)) ? pulse.ADD_MOD : pulse.ADD;\n }\n pulse.visit(flag, band ? t => {\n const v = bins(t);\n // minimum bin value (inclusive)\n t[b0] = v;\n // maximum bin value (exclusive)\n // use convoluted math for better floating point agreement\n // see https://github.com/vega/vega/issues/830\n // infinite values propagate through this formula! #2227\n t[b1] = v == null ? null : start + step * (1 + (v - start) / step);\n } : t => t[b0] = bins(t));\n return pulse.modifies(band ? as : b0);\n },\n _bins(_) {\n if (this.value && !_.modified()) {\n return this.value;\n }\n const field = _.field,\n bins = bin(_),\n step = bins.step;\n let start = bins.start,\n stop = start + Math.ceil((bins.stop - start) / step) * step,\n a,\n d;\n if ((a = _.anchor) != null) {\n d = a - (start + step * Math.floor((a - start) / step));\n start += d;\n stop += d;\n }\n const f = function (t) {\n let v = toNumber(field(t));\n return v == null ? null : v < start ? -Infinity : v > stop ? +Infinity : (v = Math.max(start, Math.min(v, stop - step)), start + step * Math.floor(EPSILON$1 + (v - start) / step));\n };\n f.start = start;\n f.stop = bins.stop;\n f.step = step;\n return this.value = accessor(f, accessorFields(field), _.name || 'bin_' + accessorName(field));\n }\n});\n\nfunction SortedList (idFunc, source, input) {\n const $ = idFunc;\n let data = source || [],\n add = input || [],\n rem = {},\n cnt = 0;\n return {\n add: t => add.push(t),\n remove: t => rem[$(t)] = ++cnt,\n size: () => data.length,\n data: (compare, resort) => {\n if (cnt) {\n data = data.filter(t => !rem[$(t)]);\n rem = {};\n cnt = 0;\n }\n if (resort && compare) {\n data.sort(compare);\n }\n if (add.length) {\n data = compare ? merge(compare, data, add.sort(compare)) : data.concat(add);\n add = [];\n }\n return data;\n }\n };\n}\n\n/**\n * Collects all data tuples that pass through this operator.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - An optional\n * comparator function for additionally sorting the collected tuples.\n */\nfunction Collect(params) {\n Transform.call(this, [], params);\n}\nCollect.Definition = {\n 'type': 'Collect',\n 'metadata': {\n 'source': true\n },\n 'params': [{\n 'name': 'sort',\n 'type': 'compare'\n }]\n};\ninherits(Collect, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.ALL),\n list = SortedList(tupleid, this.value, out.materialize(out.ADD).add),\n sort = _.sort,\n mod = pulse.changed() || sort && (_.modified('sort') || pulse.modified(sort.fields));\n out.visit(out.REM, list.remove);\n this.modified(mod);\n this.value = out.source = list.data(stableCompare(sort), mod);\n\n // propagate tree root if defined\n if (pulse.source && pulse.source.root) {\n this.value.root = pulse.source.root;\n }\n return out;\n }\n});\n\n/**\n * Generates a comparator function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - The fields to compare.\n * @param {Array} [params.orders] - The sort orders.\n * Each entry should be one of \"ascending\" (default) or \"descending\".\n */\nfunction Compare(params) {\n Operator.call(this, null, update$5, params);\n}\ninherits(Compare, Operator);\nfunction update$5(_) {\n return this.value && !_.modified() ? this.value : compare(_.fields, _.orders);\n}\n\n/**\n * Count regexp-defined pattern occurrences in a text field.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - An accessor for the text field.\n * @param {string} [params.pattern] - RegExp string defining the text pattern.\n * @param {string} [params.case] - One of 'lower', 'upper' or null (mixed) case.\n * @param {string} [params.stopwords] - RegExp string of words to ignore.\n */\nfunction CountPattern(params) {\n Transform.call(this, null, params);\n}\nCountPattern.Definition = {\n 'type': 'CountPattern',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'case',\n 'type': 'enum',\n 'values': ['upper', 'lower', 'mixed'],\n 'default': 'mixed'\n }, {\n 'name': 'pattern',\n 'type': 'string',\n 'default': '[\\\\w\"]+'\n }, {\n 'name': 'stopwords',\n 'type': 'string',\n 'default': ''\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['text', 'count']\n }]\n};\nfunction tokenize(text, tcase, match) {\n switch (tcase) {\n case 'upper':\n text = text.toUpperCase();\n break;\n case 'lower':\n text = text.toLowerCase();\n break;\n }\n return text.match(match);\n}\ninherits(CountPattern, Transform, {\n transform(_, pulse) {\n const process = update => tuple => {\n var tokens = tokenize(get(tuple), _.case, match) || [],\n t;\n for (var i = 0, n = tokens.length; i < n; ++i) {\n if (!stop.test(t = tokens[i])) update(t);\n }\n };\n const init = this._parameterCheck(_, pulse),\n counts = this._counts,\n match = this._match,\n stop = this._stop,\n get = _.field,\n as = _.as || ['text', 'count'],\n add = process(t => counts[t] = 1 + (counts[t] || 0)),\n rem = process(t => counts[t] -= 1);\n if (init) {\n pulse.visit(pulse.SOURCE, add);\n } else {\n pulse.visit(pulse.ADD, add);\n pulse.visit(pulse.REM, rem);\n }\n return this._finish(pulse, as); // generate output tuples\n },\n\n _parameterCheck(_, pulse) {\n let init = false;\n if (_.modified('stopwords') || !this._stop) {\n this._stop = new RegExp('^' + (_.stopwords || '') + '$', 'i');\n init = true;\n }\n if (_.modified('pattern') || !this._match) {\n this._match = new RegExp(_.pattern || '[\\\\w\\']+', 'g');\n init = true;\n }\n if (_.modified('field') || pulse.modified(_.field.fields)) {\n init = true;\n }\n if (init) this._counts = {};\n return init;\n },\n _finish(pulse, as) {\n const counts = this._counts,\n tuples = this._tuples || (this._tuples = {}),\n text = as[0],\n count = as[1],\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n let w, t, c;\n for (w in counts) {\n t = tuples[w];\n c = counts[w] || 0;\n if (!t && c) {\n tuples[w] = t = ingest({});\n t[text] = w;\n t[count] = c;\n out.add.push(t);\n } else if (c === 0) {\n if (t) out.rem.push(t);\n counts[w] = null;\n tuples[w] = null;\n } else if (t[count] !== c) {\n t[count] = c;\n out.mod.push(t);\n }\n }\n return out.modifies(as);\n }\n});\n\n/**\n * Perform a cross-product of a tuple stream with itself.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object):boolean} [params.filter] - An optional filter\n * function for selectively including tuples in the cross product.\n * @param {Array} [params.as] - The names of the output fields.\n */\nfunction Cross(params) {\n Transform.call(this, null, params);\n}\nCross.Definition = {\n 'type': 'Cross',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'filter',\n 'type': 'expr'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['a', 'b']\n }]\n};\ninherits(Cross, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n as = _.as || ['a', 'b'],\n a = as[0],\n b = as[1],\n reset = !this.value || pulse.changed(pulse.ADD_REM) || _.modified('as') || _.modified('filter');\n let data = this.value;\n if (reset) {\n if (data) out.rem = data;\n data = pulse.materialize(pulse.SOURCE).source;\n out.add = this.value = cross(data, a, b, _.filter || truthy);\n } else {\n out.mod = data;\n }\n out.source = this.value;\n return out.modifies(as);\n }\n});\nfunction cross(input, a, b, filter) {\n var data = [],\n t = {},\n n = input.length,\n i = 0,\n j,\n left;\n for (; i < n; ++i) {\n t[a] = left = input[i];\n for (j = 0; j < n; ++j) {\n t[b] = input[j];\n if (filter(t)) {\n data.push(ingest(t));\n t = {};\n t[a] = left;\n }\n }\n }\n return data;\n}\n\nconst Distributions = {\n kde: randomKDE,\n mixture: randomMixture,\n normal: randomNormal,\n lognormal: randomLogNormal,\n uniform: randomUniform\n};\nconst DISTRIBUTIONS = 'distributions',\n FUNCTION = 'function',\n FIELD = 'field';\n\n/**\n * Parse a parameter object for a probability distribution.\n * @param {object} def - The distribution parameter object.\n * @param {function():Array} - A method for requesting\n * source data. Used for distributions (such as KDE) that\n * require sample data points. This method will only be\n * invoked if the 'from' parameter for a target data source\n * is not provided. Typically this method returns backing\n * source data for a Pulse object.\n * @return {object} - The output distribution object.\n */\nfunction parse(def, data) {\n const func = def[FUNCTION];\n if (!hasOwnProperty(Distributions, func)) {\n error('Unknown distribution function: ' + func);\n }\n const d = Distributions[func]();\n for (const name in def) {\n // if data field, extract values\n if (name === FIELD) {\n d.data((def.from || data()).map(def[name]));\n }\n\n // if distribution mixture, recurse to parse each definition\n else if (name === DISTRIBUTIONS) {\n d[name](def[name].map(_ => parse(_, data)));\n }\n\n // otherwise, simply set the parameter\n else if (typeof d[name] === FUNCTION) {\n d[name](def[name]);\n }\n }\n return d;\n}\n\n/**\n * Grid sample points for a probability density. Given a distribution and\n * a sampling extent, will generate points suitable for plotting either\n * PDF (probability density function) or CDF (cumulative distribution\n * function) curves.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.distribution - The probability distribution. This\n * is an object parameter dependent on the distribution type.\n * @param {string} [params.method='pdf'] - The distribution method to sample.\n * One of 'pdf' or 'cdf'.\n * @param {Array} [params.extent] - The [min, max] extent over which\n * to sample the distribution. This argument is required in most cases, but\n * can be omitted if the distribution (e.g., 'kde') supports a 'data' method\n * that returns numerical sample points from which the extent can be deduced.\n * @param {number} [params.minsteps=25] - The minimum number of curve samples\n * for plotting the density.\n * @param {number} [params.maxsteps=200] - The maximum number of curve samples\n * for plotting the density.\n * @param {number} [params.steps] - The exact number of curve samples for\n * plotting the density. If specified, overrides both minsteps and maxsteps\n * to set an exact number of uniform samples. Useful in conjunction with\n * a fixed extent to ensure consistent sample points for stacked densities.\n */\nfunction Density(params) {\n Transform.call(this, null, params);\n}\nconst distributions = [{\n 'key': {\n 'function': 'normal'\n },\n 'params': [{\n 'name': 'mean',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'stdev',\n 'type': 'number',\n 'default': 1\n }]\n}, {\n 'key': {\n 'function': 'lognormal'\n },\n 'params': [{\n 'name': 'mean',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'stdev',\n 'type': 'number',\n 'default': 1\n }]\n}, {\n 'key': {\n 'function': 'uniform'\n },\n 'params': [{\n 'name': 'min',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'max',\n 'type': 'number',\n 'default': 1\n }]\n}, {\n 'key': {\n 'function': 'kde'\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'from',\n 'type': 'data'\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'default': 0\n }]\n}];\nconst mixture = {\n 'key': {\n 'function': 'mixture'\n },\n 'params': [{\n 'name': 'distributions',\n 'type': 'param',\n 'array': true,\n 'params': distributions\n }, {\n 'name': 'weights',\n 'type': 'number',\n 'array': true\n }]\n};\nDensity.Definition = {\n 'type': 'Density',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'steps',\n 'type': 'number'\n }, {\n 'name': 'minsteps',\n 'type': 'number',\n 'default': 25\n }, {\n 'name': 'maxsteps',\n 'type': 'number',\n 'default': 200\n }, {\n 'name': 'method',\n 'type': 'string',\n 'default': 'pdf',\n 'values': ['pdf', 'cdf']\n }, {\n 'name': 'distribution',\n 'type': 'param',\n 'params': distributions.concat(mixture)\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'default': ['value', 'density']\n }]\n};\ninherits(Density, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n if (!this.value || pulse.changed() || _.modified()) {\n const dist = parse(_.distribution, source(pulse)),\n minsteps = _.steps || _.minsteps || 25,\n maxsteps = _.steps || _.maxsteps || 200;\n let method = _.method || 'pdf';\n if (method !== 'pdf' && method !== 'cdf') {\n error('Invalid density method: ' + method);\n }\n if (!_.extent && !dist.data) {\n error('Missing density extent parameter.');\n }\n method = dist[method];\n const as = _.as || ['value', 'density'],\n domain = _.extent || extent(dist.data()),\n values = sampleCurve(method, domain, minsteps, maxsteps).map(v => {\n const tuple = {};\n tuple[as[0]] = v[0];\n tuple[as[1]] = v[1];\n return ingest(tuple);\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n return out;\n }\n});\nfunction source(pulse) {\n return () => pulse.materialize(pulse.SOURCE).source;\n}\n\n// use either provided alias or accessor field name\nfunction fieldNames(fields, as) {\n if (!fields) return null;\n return fields.map((f, i) => as[i] || accessorName(f));\n}\nfunction partition$1(data, groupby, field) {\n const groups = [],\n get = f => f(t);\n let map, i, n, t, k, g;\n\n // partition data points into groups\n if (groupby == null) {\n groups.push(data.map(field));\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n if (!g) {\n map[k] = g = [];\n g.dims = k;\n groups.push(g);\n }\n g.push(field(t));\n }\n }\n return groups;\n}\n\nconst Output = 'bin';\n\n/**\n * Dot density binning for dot plot construction.\n * Based on Leland Wilkinson, Dot Plots, The American Statistician, 1999.\n * https://www.cs.uic.edu/~wilkinson/Publications/dotplots.pdf\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to bin.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {number} [params.step] - The step size (bin width) within which dots should be\n * stacked. Defaults to 1/30 of the extent of the data *field*.\n * @param {boolean} [params.smooth=false] - A boolean flag indicating if dot density\n * stacks should be smoothed to reduce variance.\n */\nfunction DotBin(params) {\n Transform.call(this, null, params);\n}\nDotBin.Definition = {\n 'type': 'DotBin',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'step',\n 'type': 'number'\n }, {\n 'name': 'smooth',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': Output\n }]\n};\nconst autostep = (data, field) => span(extent(data, field)) / 30;\ninherits(DotBin, Transform, {\n transform(_, pulse) {\n if (this.value && !(_.modified() || pulse.changed())) {\n return pulse; // early exit\n }\n\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition$1(pulse.source, _.groupby, identity),\n smooth = _.smooth || false,\n field = _.field,\n step = _.step || autostep(source, field),\n sort = stableCompare((a, b) => field(a) - field(b)),\n as = _.as || Output,\n n = groups.length;\n\n // compute dotplot bins per group\n let min = Infinity,\n max = -Infinity,\n i = 0,\n j;\n for (; i < n; ++i) {\n const g = groups[i].sort(sort);\n j = -1;\n for (const v of dotbin(g, step, smooth, field)) {\n if (v < min) min = v;\n if (v > max) max = v;\n g[++j][as] = v;\n }\n }\n this.value = {\n start: min,\n stop: max,\n step: step\n };\n return pulse.reflow(true).modifies(as);\n }\n});\n\n/**\n * Wraps an expression function with access to external parameters.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function} params.expr - The expression function. The\n * function should accept both a datum and a parameter object.\n * This operator's value will be a new function that wraps the\n * expression function with access to this operator's parameters.\n */\nfunction Expression(params) {\n Operator.call(this, null, update$4, params);\n this.modified(true);\n}\ninherits(Expression, Operator);\nfunction update$4(_) {\n const expr = _.expr;\n return this.value && !_.modified('expr') ? this.value : accessor(datum => expr(datum, _), accessorFields(expr), accessorName(expr));\n}\n\n/**\n * Computes extents (min/max) for a data field.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The field over which to compute extends.\n */\nfunction Extent(params) {\n Transform.call(this, [undefined, undefined], params);\n}\nExtent.Definition = {\n 'type': 'Extent',\n 'metadata': {},\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }]\n};\ninherits(Extent, Transform, {\n transform(_, pulse) {\n const extent = this.value,\n field = _.field,\n mod = pulse.changed() || pulse.modified(field.fields) || _.modified('field');\n let min = extent[0],\n max = extent[1];\n if (mod || min == null) {\n min = +Infinity;\n max = -Infinity;\n }\n pulse.visit(mod ? pulse.SOURCE : pulse.ADD, t => {\n const v = toNumber(field(t));\n if (v != null) {\n // NaNs will fail all comparisons!\n if (v < min) min = v;\n if (v > max) max = v;\n }\n });\n if (!Number.isFinite(min) || !Number.isFinite(max)) {\n let name = accessorName(field);\n if (name) name = ` for field \"${name}\"`;\n pulse.dataflow.warn(`Infinite extent${name}: [${min}, ${max}]`);\n min = max = undefined;\n }\n this.value = [min, max];\n }\n});\n\n/**\n * Provides a bridge between a parent transform and a target subflow that\n * consumes only a subset of the tuples that pass through the parent.\n * @constructor\n * @param {Pulse} pulse - A pulse to use as the value of this operator.\n * @param {Transform} parent - The parent transform (typically a Facet instance).\n */\nfunction Subflow(pulse, parent) {\n Operator.call(this, pulse);\n this.parent = parent;\n this.count = 0;\n}\ninherits(Subflow, Operator, {\n /**\n * Routes pulses from this subflow to a target transform.\n * @param {Transform} target - A transform that receives the subflow of tuples.\n */\n connect(target) {\n this.detachSubflow = target.detachSubflow;\n this.targets().add(target);\n return target.source = this;\n },\n /**\n * Add an 'add' tuple to the subflow pulse.\n * @param {Tuple} t - The tuple being added.\n */\n add(t) {\n this.count += 1;\n this.value.add.push(t);\n },\n /**\n * Add a 'rem' tuple to the subflow pulse.\n * @param {Tuple} t - The tuple being removed.\n */\n rem(t) {\n this.count -= 1;\n this.value.rem.push(t);\n },\n /**\n * Add a 'mod' tuple to the subflow pulse.\n * @param {Tuple} t - The tuple being modified.\n */\n mod(t) {\n this.value.mod.push(t);\n },\n /**\n * Re-initialize this operator's pulse value.\n * @param {Pulse} pulse - The pulse to copy from.\n * @see Pulse.init\n */\n init(pulse) {\n this.value.init(pulse, pulse.NO_SOURCE);\n },\n /**\n * Evaluate this operator. This method overrides the\n * default behavior to simply return the contained pulse value.\n * @return {Pulse}\n */\n evaluate() {\n // assert: this.value.stamp === pulse.stamp\n return this.value;\n }\n});\n\n/**\n * Facets a dataflow into a set of subflows based on a key.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(Dataflow, string): Operator} params.subflow - A function\n * that generates a subflow of operators and returns its root operator.\n * @param {function(object): *} params.key - The key field to facet by.\n */\nfunction Facet(params) {\n Transform.call(this, {}, params);\n this._keys = fastmap(); // cache previously calculated key values\n\n // keep track of active subflows, use as targets array for listeners\n // this allows us to limit propagation to only updated subflows\n const a = this._targets = [];\n a.active = 0;\n a.forEach = f => {\n for (let i = 0, n = a.active; i < n; ++i) {\n f(a[i], i, a);\n }\n };\n}\ninherits(Facet, Transform, {\n activate(flow) {\n this._targets[this._targets.active++] = flow;\n },\n // parent argument provided by PreFacet subclass\n subflow(key, flow, pulse, parent) {\n const flows = this.value;\n let sf = hasOwnProperty(flows, key) && flows[key],\n df,\n p;\n if (!sf) {\n p = parent || (p = this._group[key]) && p.tuple;\n df = pulse.dataflow;\n sf = new Subflow(pulse.fork(pulse.NO_SOURCE), this);\n df.add(sf).connect(flow(df, key, p));\n flows[key] = sf;\n this.activate(sf);\n } else if (sf.value.stamp < pulse.stamp) {\n sf.init(pulse);\n this.activate(sf);\n }\n return sf;\n },\n clean() {\n const flows = this.value;\n let detached = 0;\n for (const key in flows) {\n if (flows[key].count === 0) {\n const detach = flows[key].detachSubflow;\n if (detach) detach();\n delete flows[key];\n ++detached;\n }\n }\n\n // remove inactive targets from the active targets array\n if (detached) {\n const active = this._targets.filter(sf => sf && sf.count > 0);\n this.initTargets(active);\n }\n },\n initTargets(act) {\n const a = this._targets,\n n = a.length,\n m = act ? act.length : 0;\n let i = 0;\n for (; i < m; ++i) {\n a[i] = act[i];\n }\n for (; i < n && a[i] != null; ++i) {\n a[i] = null; // ensure old flows can be garbage collected\n }\n\n a.active = m;\n },\n transform(_, pulse) {\n const df = pulse.dataflow,\n key = _.key,\n flow = _.subflow,\n cache = this._keys,\n rekey = _.modified('key'),\n subflow = key => this.subflow(key, flow, pulse);\n this._group = _.group || {};\n this.initTargets(); // reset list of active subflows\n\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t),\n k = cache.get(id);\n if (k !== undefined) {\n cache.delete(id);\n subflow(k).rem(t);\n }\n });\n pulse.visit(pulse.ADD, t => {\n const k = key(t);\n cache.set(tupleid(t), k);\n subflow(k).add(t);\n });\n if (rekey || pulse.modified(key.fields)) {\n pulse.visit(pulse.MOD, t => {\n const id = tupleid(t),\n k0 = cache.get(id),\n k1 = key(t);\n if (k0 === k1) {\n subflow(k1).mod(t);\n } else {\n cache.set(id, k1);\n subflow(k0).rem(t);\n subflow(k1).add(t);\n }\n });\n } else if (pulse.changed(pulse.MOD)) {\n pulse.visit(pulse.MOD, t => {\n subflow(cache.get(tupleid(t))).mod(t);\n });\n }\n if (rekey) {\n pulse.visit(pulse.REFLOW, t => {\n const id = tupleid(t),\n k0 = cache.get(id),\n k1 = key(t);\n if (k0 !== k1) {\n cache.set(id, k1);\n subflow(k0).rem(t);\n subflow(k1).add(t);\n }\n });\n }\n if (pulse.clean()) {\n df.runAfter(() => {\n this.clean();\n cache.clean();\n });\n } else if (cache.empty > df.cleanThreshold) {\n df.runAfter(cache.clean);\n }\n return pulse;\n }\n});\n\n/**\n * Generates one or more field accessor functions.\n * If the 'name' parameter is an array, an array of field accessors\n * will be created and the 'as' parameter will be ignored.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {string} params.name - The field name(s) to access.\n * @param {string} params.as - The accessor function name.\n */\nfunction Field(params) {\n Operator.call(this, null, update$3, params);\n}\ninherits(Field, Operator);\nfunction update$3(_) {\n return this.value && !_.modified() ? this.value : isArray(_.name) ? array(_.name).map(f => field(f)) : field(_.name, _.as);\n}\n\n/**\n * Filters data tuples according to a predicate function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.expr - The predicate expression function\n * that determines a tuple's filter status. Truthy values pass the filter.\n */\nfunction Filter(params) {\n Transform.call(this, fastmap(), params);\n}\nFilter.Definition = {\n 'type': 'Filter',\n 'metadata': {\n 'changes': true\n },\n 'params': [{\n 'name': 'expr',\n 'type': 'expr',\n 'required': true\n }]\n};\ninherits(Filter, Transform, {\n transform(_, pulse) {\n const df = pulse.dataflow,\n cache = this.value,\n // cache ids of filtered tuples\n output = pulse.fork(),\n add = output.add,\n rem = output.rem,\n mod = output.mod,\n test = _.expr;\n let isMod = true;\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n if (!cache.has(id)) rem.push(t);else cache.delete(id);\n });\n pulse.visit(pulse.ADD, t => {\n if (test(t, _)) add.push(t);else cache.set(tupleid(t), 1);\n });\n function revisit(t) {\n const id = tupleid(t),\n b = test(t, _),\n s = cache.get(id);\n if (b && s) {\n cache.delete(id);\n add.push(t);\n } else if (!b && !s) {\n cache.set(id, 1);\n rem.push(t);\n } else if (isMod && b && !s) {\n mod.push(t);\n }\n }\n pulse.visit(pulse.MOD, revisit);\n if (_.modified()) {\n isMod = false;\n pulse.visit(pulse.REFLOW, revisit);\n }\n if (cache.empty > df.cleanThreshold) df.runAfter(cache.clean);\n return output;\n }\n});\n\n/**\n * Flattens array-typed field values into new data objects.\n * If multiple fields are specified, they are treated as parallel arrays,\n * with output values included for each matching index (or null if missing).\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - An array of field\n * accessors for the tuple fields that should be flattened.\n * @param {string} [params.index] - Optional output field name for index\n * value. If unspecified, no index field is included in the output.\n * @param {Array} [params.as] - Output field names for flattened\n * array fields. Any unspecified fields will use the field name provided\n * by the fields accessors.\n */\nfunction Flatten(params) {\n Transform.call(this, [], params);\n}\nFlatten.Definition = {\n 'type': 'Flatten',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'index',\n 'type': 'string'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }]\n};\ninherits(Flatten, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n fields = _.fields,\n as = fieldNames(fields, _.as || []),\n index = _.index || null,\n m = as.length;\n\n // remove any previous results\n out.rem = this.value;\n\n // generate flattened tuples\n pulse.visit(pulse.SOURCE, t => {\n const arrays = fields.map(f => f(t)),\n maxlen = arrays.reduce((l, a) => Math.max(l, a.length), 0);\n let i = 0,\n j,\n d,\n v;\n for (; i < maxlen; ++i) {\n d = derive(t);\n for (j = 0; j < m; ++j) {\n d[as[j]] = (v = arrays[j][i]) == null ? null : v;\n }\n if (index) {\n d[index] = i;\n }\n out.add.push(d);\n }\n });\n this.value = out.source = out.add;\n if (index) out.modifies(index);\n return out.modifies(as);\n }\n});\n\n/**\n * Folds one more tuple fields into multiple tuples in which the field\n * name and values are available under new 'key' and 'value' fields.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.fields - An array of field accessors\n * for the tuple fields that should be folded.\n * @param {Array} [params.as] - Output field names for folded key\n * and value fields, defaults to ['key', 'value'].\n */\nfunction Fold(params) {\n Transform.call(this, [], params);\n}\nFold.Definition = {\n 'type': 'Fold',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['key', 'value']\n }]\n};\ninherits(Fold, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n fields = _.fields,\n fnames = fields.map(accessorName),\n as = _.as || ['key', 'value'],\n k = as[0],\n v = as[1],\n n = fields.length;\n out.rem = this.value;\n pulse.visit(pulse.SOURCE, t => {\n for (let i = 0, d; i < n; ++i) {\n d = derive(t);\n d[k] = fnames[i];\n d[v] = fields[i](t);\n out.add.push(d);\n }\n });\n this.value = out.source = out.add;\n return out.modifies(as);\n }\n});\n\n/**\n * Invokes a function for each data tuple and saves the results as a new field.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.expr - The formula function to invoke for each tuple.\n * @param {string} params.as - The field name under which to save the result.\n * @param {boolean} [params.initonly=false] - If true, the formula is applied to\n * added tuples only, and does not update in response to modifications.\n */\nfunction Formula(params) {\n Transform.call(this, null, params);\n}\nFormula.Definition = {\n 'type': 'Formula',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'expr',\n 'type': 'expr',\n 'required': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'required': true\n }, {\n 'name': 'initonly',\n 'type': 'boolean'\n }]\n};\ninherits(Formula, Transform, {\n transform(_, pulse) {\n const func = _.expr,\n as = _.as,\n mod = _.modified(),\n flag = _.initonly ? pulse.ADD : mod ? pulse.SOURCE : pulse.modified(func.fields) || pulse.modified(as) ? pulse.ADD_MOD : pulse.ADD;\n if (mod) {\n // parameters updated, need to reflow\n pulse = pulse.materialize().reflow(true);\n }\n if (!_.initonly) {\n pulse.modifies(as);\n }\n return pulse.visit(flag, t => t[as] = func(t, _));\n }\n});\n\n/**\n * Generates data tuples using a provided generator function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(Parameters): object} params.generator - A tuple generator\n * function. This function is given the operator parameters as input.\n * Changes to any additional parameters will not trigger re-calculation\n * of previously generated tuples. Only future tuples are affected.\n * @param {number} params.size - The number of tuples to produce.\n */\nfunction Generate(params) {\n Transform.call(this, [], params);\n}\ninherits(Generate, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.ALL),\n gen = _.generator;\n let data = this.value,\n num = _.size - data.length,\n add,\n rem,\n t;\n if (num > 0) {\n // need more tuples, generate and add\n for (add = []; --num >= 0;) {\n add.push(t = ingest(gen(_)));\n data.push(t);\n }\n out.add = out.add.length ? out.materialize(out.ADD).add.concat(add) : add;\n } else {\n // need fewer tuples, remove\n rem = data.slice(0, -num);\n out.rem = out.rem.length ? out.materialize(out.REM).rem.concat(rem) : rem;\n data = data.slice(-num);\n }\n out.source = this.value = data;\n return out;\n }\n});\n\nconst Methods = {\n value: 'value',\n median: median,\n mean: mean,\n min: min,\n max: max\n};\nconst Empty = [];\n\n/**\n * Impute missing values.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to impute.\n * @param {Array} [params.groupby] - An array of\n * accessors to determine series within which to perform imputation.\n * @param {function(object): *} params.key - An accessor for a key value.\n * Each key value should be unique within a group. New tuples will be\n * imputed for any key values that are not found within a group.\n * @param {Array<*>} [params.keyvals] - Optional array of required key\n * values. New tuples will be imputed for any key values that are not\n * found within a group. In addition, these values will be automatically\n * augmented with the key values observed in the input data.\n * @param {string} [method='value'] - The imputation method to use. One of\n * 'value', 'mean', 'median', 'max', 'min'.\n * @param {*} [value=0] - The constant value to use for imputation\n * when using method 'value'.\n */\nfunction Impute(params) {\n Transform.call(this, [], params);\n}\nImpute.Definition = {\n 'type': 'Impute',\n 'metadata': {\n 'changes': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'key',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'keyvals',\n 'array': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'method',\n 'type': 'enum',\n 'default': 'value',\n 'values': ['value', 'mean', 'median', 'max', 'min']\n }, {\n 'name': 'value',\n 'default': 0\n }]\n};\nfunction getValue(_) {\n var m = _.method || Methods.value,\n v;\n if (Methods[m] == null) {\n error('Unrecognized imputation method: ' + m);\n } else if (m === Methods.value) {\n v = _.value !== undefined ? _.value : 0;\n return () => v;\n } else {\n return Methods[m];\n }\n}\nfunction getField(_) {\n const f = _.field;\n return t => t ? f(t) : NaN;\n}\ninherits(Impute, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ALL),\n impute = getValue(_),\n field = getField(_),\n fName = accessorName(_.field),\n kName = accessorName(_.key),\n gNames = (_.groupby || []).map(accessorName),\n groups = partition(pulse.source, _.groupby, _.key, _.keyvals),\n curr = [],\n prev = this.value,\n m = groups.domain.length,\n group,\n value,\n gVals,\n kVal,\n g,\n i,\n j,\n l,\n n,\n t;\n for (g = 0, l = groups.length; g < l; ++g) {\n group = groups[g];\n gVals = group.values;\n value = NaN;\n\n // add tuples for missing values\n for (j = 0; j < m; ++j) {\n if (group[j] != null) continue;\n kVal = groups.domain[j];\n t = {\n _impute: true\n };\n for (i = 0, n = gVals.length; i < n; ++i) t[gNames[i]] = gVals[i];\n t[kName] = kVal;\n t[fName] = Number.isNaN(value) ? value = impute(group, field) : value;\n curr.push(ingest(t));\n }\n }\n\n // update pulse with imputed tuples\n if (curr.length) out.add = out.materialize(out.ADD).add.concat(curr);\n if (prev.length) out.rem = out.materialize(out.REM).rem.concat(prev);\n this.value = curr;\n return out;\n }\n});\nfunction partition(data, groupby, key, keyvals) {\n var get = f => f(t),\n groups = [],\n domain = keyvals ? keyvals.slice() : [],\n kMap = {},\n gMap = {},\n gVals,\n gKey,\n group,\n i,\n j,\n k,\n n,\n t;\n domain.forEach((k, i) => kMap[k] = i + 1);\n for (i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = key(t);\n j = kMap[k] || (kMap[k] = domain.push(k));\n gKey = (gVals = groupby ? groupby.map(get) : Empty) + '';\n if (!(group = gMap[gKey])) {\n group = gMap[gKey] = [];\n groups.push(group);\n group.values = gVals;\n }\n group[j - 1] = t;\n }\n groups.domain = domain;\n return groups;\n}\n\n/**\n * Extend input tuples with aggregate values.\n * Calcuates aggregate values and joins them with the input stream.\n * @constructor\n */\nfunction JoinAggregate(params) {\n Aggregate.call(this, params);\n}\nJoinAggregate.Definition = {\n 'type': 'JoinAggregate',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'null': true,\n 'array': true\n }, {\n 'name': 'ops',\n 'type': 'enum',\n 'array': true,\n 'values': ValidAggregateOps\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }, {\n 'name': 'key',\n 'type': 'field'\n }]\n};\ninherits(JoinAggregate, Aggregate, {\n transform(_, pulse) {\n const aggr = this,\n mod = _.modified();\n let cells;\n\n // process all input tuples to calculate aggregates\n if (aggr.value && (mod || pulse.modified(aggr._inputs, true))) {\n cells = aggr.value = mod ? aggr.init(_) : {};\n pulse.visit(pulse.SOURCE, t => aggr.add(t));\n } else {\n cells = aggr.value = aggr.value || this.init(_);\n pulse.visit(pulse.REM, t => aggr.rem(t));\n pulse.visit(pulse.ADD, t => aggr.add(t));\n }\n\n // update aggregation cells\n aggr.changes();\n\n // write aggregate values to input tuples\n pulse.visit(pulse.SOURCE, t => {\n extend(t, cells[aggr.cellkey(t)].tuple);\n });\n return pulse.reflow(mod).modifies(this._outputs);\n },\n changes() {\n const adds = this._adds,\n mods = this._mods;\n let i, n;\n for (i = 0, n = this._alen; i < n; ++i) {\n this.celltuple(adds[i]);\n adds[i] = null; // for garbage collection\n }\n\n for (i = 0, n = this._mlen; i < n; ++i) {\n this.celltuple(mods[i]);\n mods[i] = null; // for garbage collection\n }\n\n this._alen = this._mlen = 0; // reset list of active cells\n }\n});\n\n/**\n * Compute kernel density estimates (KDE) for one or more data groups.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby.\n * @param {function(object): *} params.field - An accessor for the data field\n * to estimate.\n * @param {number} [params.bandwidth=0] - The KDE kernel bandwidth.\n * If zero or unspecified, the bandwidth is automatically determined.\n * @param {boolean} [params.counts=false] - A boolean flag indicating if the\n * output values should be probability estimates (false, default) or\n * smoothed counts (true).\n * @param {string} [params.cumulative=false] - A boolean flag indicating if a\n * density (false) or cumulative distribution (true) should be generated.\n * @param {Array} [params.extent] - The domain extent over which to\n * plot the density. If unspecified, the [min, max] data extent is used.\n * @param {string} [params.resolve='independent'] - Indicates how parameters for\n * multiple densities should be resolved. If \"independent\" (the default), each\n * density may have its own domain extent and dynamic number of curve sample\n * steps. If \"shared\", the KDE transform will ensure that all densities are\n * defined over a shared domain and curve steps, enabling stacking.\n * @param {number} [params.minsteps=25] - The minimum number of curve samples\n * for plotting the density.\n * @param {number} [params.maxsteps=200] - The maximum number of curve samples\n * for plotting the density.\n * @param {number} [params.steps] - The exact number of curve samples for\n * plotting the density. If specified, overrides both minsteps and maxsteps\n * to set an exact number of uniform samples. Useful in conjunction with\n * a fixed extent to ensure consistent sample points for stacked densities.\n */\nfunction KDE(params) {\n Transform.call(this, null, params);\n}\nKDE.Definition = {\n 'type': 'KDE',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'cumulative',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'counts',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'resolve',\n 'type': 'enum',\n 'values': ['shared', 'independent'],\n 'default': 'independent'\n }, {\n 'name': 'steps',\n 'type': 'number'\n }, {\n 'name': 'minsteps',\n 'type': 'number',\n 'default': 25\n }, {\n 'name': 'maxsteps',\n 'type': 'number',\n 'default': 200\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'default': ['value', 'density']\n }]\n};\ninherits(KDE, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n if (!this.value || pulse.changed() || _.modified()) {\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition$1(source, _.groupby, _.field),\n names = (_.groupby || []).map(accessorName),\n bandwidth = _.bandwidth,\n method = _.cumulative ? 'cdf' : 'pdf',\n as = _.as || ['value', 'density'],\n values = [];\n let domain = _.extent,\n minsteps = _.steps || _.minsteps || 25,\n maxsteps = _.steps || _.maxsteps || 200;\n if (method !== 'pdf' && method !== 'cdf') {\n error('Invalid density method: ' + method);\n }\n if (_.resolve === 'shared') {\n if (!domain) domain = extent(source, _.field);\n minsteps = maxsteps = _.steps || maxsteps;\n }\n groups.forEach(g => {\n const density = randomKDE(g, bandwidth)[method],\n scale = _.counts ? g.length : 1,\n local = domain || extent(g);\n sampleCurve(density, local, minsteps, maxsteps).forEach(v => {\n const t = {};\n for (let i = 0; i < names.length; ++i) {\n t[names[i]] = g.dims[i];\n }\n t[as[0]] = v[0];\n t[as[1]] = v[1] * scale;\n values.push(ingest(t));\n });\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n return out;\n }\n});\n\n/**\n * Generates a key function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - The field name(s) for the key function.\n * @param {boolean} params.flat - A boolean flag indicating if the field names\n * should be treated as flat property names, side-stepping nested field\n * lookups normally indicated by dot or bracket notation.\n */\nfunction Key(params) {\n Operator.call(this, null, update$2, params);\n}\ninherits(Key, Operator);\nfunction update$2(_) {\n return this.value && !_.modified() ? this.value : key(_.fields, _.flat);\n}\n\n/**\n * Load and parse data from an external source. Marshalls parameter\n * values and then invokes the Dataflow request method.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {string} params.url - The URL to load from.\n * @param {object} params.format - The data format options.\n */\nfunction Load(params) {\n Transform.call(this, [], params);\n this._pending = null;\n}\ninherits(Load, Transform, {\n transform(_, pulse) {\n const df = pulse.dataflow;\n if (this._pending) {\n // update state and return pulse\n return output(this, pulse, this._pending);\n }\n if (stop(_)) return pulse.StopPropagation;\n if (_.values) {\n // parse and ingest values, return output pulse\n return output(this, pulse, df.parse(_.values, _.format));\n } else if (_.async) {\n // return promise for non-blocking async loading\n const p = df.request(_.url, _.format).then(res => {\n this._pending = array(res.data);\n return df => df.touch(this);\n });\n return {\n async: p\n };\n } else {\n // return promise for synchronous loading\n return df.request(_.url, _.format).then(res => output(this, pulse, array(res.data)));\n }\n }\n});\nfunction stop(_) {\n return _.modified('async') && !(_.modified('values') || _.modified('url') || _.modified('format'));\n}\nfunction output(op, pulse, data) {\n data.forEach(ingest);\n const out = pulse.fork(pulse.NO_FIELDS & pulse.NO_SOURCE);\n out.rem = op.value;\n op.value = out.source = out.add = data;\n op._pending = null;\n if (out.rem.length) out.clean(true);\n return out;\n}\n\n/**\n * Extend tuples by joining them with values from a lookup table.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Map} params.index - The lookup table map.\n * @param {Array} params.as - Output field names for each lookup value.\n * @param {*} [params.default] - A default value to use if lookup fails.\n */\nfunction Lookup(params) {\n Transform.call(this, {}, params);\n}\nLookup.Definition = {\n 'type': 'Lookup',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'index',\n 'type': 'index',\n 'params': [{\n 'name': 'from',\n 'type': 'data',\n 'required': true\n }, {\n 'name': 'key',\n 'type': 'field',\n 'required': true\n }]\n }, {\n 'name': 'values',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }, {\n 'name': 'default',\n 'default': null\n }]\n};\ninherits(Lookup, Transform, {\n transform(_, pulse) {\n const keys = _.fields,\n index = _.index,\n values = _.values,\n defaultValue = _.default == null ? null : _.default,\n reset = _.modified(),\n n = keys.length;\n let flag = reset ? pulse.SOURCE : pulse.ADD,\n out = pulse,\n as = _.as,\n set,\n m,\n mods;\n if (values) {\n m = values.length;\n if (n > 1 && !as) {\n error('Multi-field lookup requires explicit \"as\" parameter.');\n }\n if (as && as.length !== n * m) {\n error('The \"as\" parameter has too few output field names.');\n }\n as = as || values.map(accessorName);\n set = function (t) {\n for (var i = 0, k = 0, j, v; i < n; ++i) {\n v = index.get(keys[i](t));\n if (v == null) for (j = 0; j < m; ++j, ++k) t[as[k]] = defaultValue;else for (j = 0; j < m; ++j, ++k) t[as[k]] = values[j](v);\n }\n };\n } else {\n if (!as) {\n error('Missing output field names.');\n }\n set = function (t) {\n for (var i = 0, v; i < n; ++i) {\n v = index.get(keys[i](t));\n t[as[i]] = v == null ? defaultValue : v;\n }\n };\n }\n if (reset) {\n out = pulse.reflow(true);\n } else {\n mods = keys.some(k => pulse.modified(k.fields));\n flag |= mods ? pulse.MOD : 0;\n }\n pulse.visit(flag, set);\n return out.modifies(as);\n }\n});\n\n/**\n * Computes global min/max extents over a collection of extents.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array>} params.extents - The input extents.\n */\nfunction MultiExtent(params) {\n Operator.call(this, null, update$1, params);\n}\ninherits(MultiExtent, Operator);\nfunction update$1(_) {\n if (this.value && !_.modified()) {\n return this.value;\n }\n const ext = _.extents,\n n = ext.length;\n let min = +Infinity,\n max = -Infinity,\n i,\n e;\n for (i = 0; i < n; ++i) {\n e = ext[i];\n if (e[0] < min) min = e[0];\n if (e[1] > max) max = e[1];\n }\n return [min, max];\n}\n\n/**\n * Merge a collection of value arrays.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array>} params.values - The input value arrrays.\n */\nfunction MultiValues(params) {\n Operator.call(this, null, update, params);\n}\ninherits(MultiValues, Operator);\nfunction update(_) {\n return this.value && !_.modified() ? this.value : _.values.reduce((data, _) => data.concat(_), []);\n}\n\n/**\n * Operator whose value is simply its parameter hash. This operator is\n * useful for enabling reactive updates to values of nested objects.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction Params(params) {\n Transform.call(this, null, params);\n}\ninherits(Params, Transform, {\n transform(_, pulse) {\n this.modified(_.modified());\n this.value = _;\n return pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS); // do not pass tuples\n }\n});\n\n/**\n * Aggregate and pivot selected field values to become new fields.\n * This operator is useful to construction cross-tabulations.\n * @constructor\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby. These fields act just like groupby fields of an Aggregate transform.\n * @param {function(object): *} params.field - The field to pivot on. The unique\n * values of this field become new field names in the output stream.\n * @param {function(object): *} params.value - The field to populate pivoted fields.\n * The aggregate values of this field become the values of the new pivoted fields.\n * @param {string} [params.op] - The aggregation operation for the value field,\n * applied per cell in the output stream. The default is \"sum\".\n * @param {number} [params.limit] - An optional parameter indicating the maximum\n * number of pivoted fields to generate. The pivoted field names are sorted in\n * ascending order prior to enforcing the limit.\n */\nfunction Pivot(params) {\n Aggregate.call(this, params);\n}\nPivot.Definition = {\n 'type': 'Pivot',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'value',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'op',\n 'type': 'enum',\n 'values': ValidAggregateOps,\n 'default': 'sum'\n }, {\n 'name': 'limit',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'key',\n 'type': 'field'\n }]\n};\ninherits(Pivot, Aggregate, {\n _transform: Aggregate.prototype.transform,\n transform(_, pulse) {\n return this._transform(aggregateParams(_, pulse), pulse);\n }\n});\n\n// Shoehorn a pivot transform into an aggregate transform!\n// First collect all unique pivot field values.\n// Then generate aggregate fields for each output pivot field.\nfunction aggregateParams(_, pulse) {\n const key = _.field,\n value = _.value,\n op = (_.op === 'count' ? '__count__' : _.op) || 'sum',\n fields = accessorFields(key).concat(accessorFields(value)),\n keys = pivotKeys(key, _.limit || 0, pulse);\n\n // if data stream content changes, pivot fields may change\n // flag parameter modification to ensure re-initialization\n if (pulse.changed()) _.set('__pivot__', null, null, true);\n return {\n key: _.key,\n groupby: _.groupby,\n ops: keys.map(() => op),\n fields: keys.map(k => get(k, key, value, fields)),\n as: keys.map(k => k + ''),\n modified: _.modified.bind(_)\n };\n}\n\n// Generate aggregate field accessor.\n// Output NaN for non-existent values; aggregator will ignore!\nfunction get(k, key, value, fields) {\n return accessor(d => key(d) === k ? value(d) : NaN, fields, k + '');\n}\n\n// Collect (and optionally limit) all unique pivot values.\nfunction pivotKeys(key, limit, pulse) {\n const map = {},\n list = [];\n pulse.visit(pulse.SOURCE, t => {\n const k = key(t);\n if (!map[k]) {\n map[k] = 1;\n list.push(k);\n }\n });\n list.sort(ascending);\n return limit ? list.slice(0, limit) : list;\n}\n\n/**\n * Partitions pre-faceted data into tuple subflows.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(Dataflow, string): Operator} params.subflow - A function\n * that generates a subflow of operators and returns its root operator.\n * @param {function(object): Array} params.field - The field\n * accessor for an array of subflow tuple objects.\n */\nfunction PreFacet(params) {\n Facet.call(this, params);\n}\ninherits(PreFacet, Facet, {\n transform(_, pulse) {\n const flow = _.subflow,\n field = _.field,\n subflow = t => this.subflow(tupleid(t), flow, pulse, t);\n if (_.modified('field') || field && pulse.modified(accessorFields(field))) {\n error('PreFacet does not support field modification.');\n }\n this.initTargets(); // reset list of active subflows\n\n if (field) {\n pulse.visit(pulse.MOD, t => {\n const sf = subflow(t);\n field(t).forEach(_ => sf.mod(_));\n });\n pulse.visit(pulse.ADD, t => {\n const sf = subflow(t);\n field(t).forEach(_ => sf.add(ingest(_)));\n });\n pulse.visit(pulse.REM, t => {\n const sf = subflow(t);\n field(t).forEach(_ => sf.rem(_));\n });\n } else {\n pulse.visit(pulse.MOD, t => subflow(t).mod(t));\n pulse.visit(pulse.ADD, t => subflow(t).add(t));\n pulse.visit(pulse.REM, t => subflow(t).rem(t));\n }\n if (pulse.clean()) {\n pulse.runAfter(() => this.clean());\n }\n return pulse;\n }\n});\n\n/**\n * Performs a relational projection, copying selected fields from source\n * tuples to a new set of derived tuples.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.as] - Output field names for each projected\n * field. Any unspecified fields will use the field name provided by\n * the field accessor.\n */\nfunction Project(params) {\n Transform.call(this, null, params);\n}\nProject.Definition = {\n 'type': 'Project',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }]\n};\ninherits(Project, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n fields = _.fields,\n as = fieldNames(_.fields, _.as || []),\n derive = fields ? (s, t) => project(s, t, fields, as) : rederive;\n let lut;\n if (this.value) {\n lut = this.value;\n } else {\n pulse = pulse.addAll();\n lut = this.value = {};\n }\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n out.rem.push(lut[id]);\n lut[id] = null;\n });\n pulse.visit(pulse.ADD, t => {\n const dt = derive(t, ingest({}));\n lut[tupleid(t)] = dt;\n out.add.push(dt);\n });\n pulse.visit(pulse.MOD, t => {\n out.mod.push(derive(t, lut[tupleid(t)]));\n });\n return out;\n }\n});\nfunction project(s, t, fields, as) {\n for (let i = 0, n = fields.length; i < n; ++i) {\n t[as[i]] = fields[i](s);\n }\n return t;\n}\n\n/**\n * Proxy the value of another operator as a pure signal value.\n * Ensures no tuples are propagated.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {*} params.value - The value to proxy, becomes the value of this operator.\n */\nfunction Proxy(params) {\n Transform.call(this, null, params);\n}\ninherits(Proxy, Transform, {\n transform(_, pulse) {\n this.value = _.value;\n return _.modified('value') ? pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS) : pulse.StopPropagation;\n }\n});\n\n/**\n * Generates sample quantile values from an input data stream.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - An accessor for the data field\n * over which to calculate quantile values.\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby.\n * @param {Array} [params.probs] - An array of probabilities in\n * the range (0, 1) for which to compute quantile values. If not specified,\n * the *step* parameter will be used.\n * @param {Array} [params.step=0.01] - A probability step size for\n * sampling quantile values. All values from one-half the step size up to\n * 1 (exclusive) will be sampled. This parameter is only used if the\n * *quantiles* parameter is not provided.\n */\nfunction Quantile(params) {\n Transform.call(this, null, params);\n}\nQuantile.Definition = {\n 'type': 'Quantile',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'probs',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'step',\n 'type': 'number',\n 'default': 0.01\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'default': ['prob', 'value']\n }]\n};\nconst EPSILON = 1e-14;\ninherits(Quantile, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n as = _.as || ['prob', 'value'];\n if (this.value && !_.modified() && !pulse.changed()) {\n out.source = this.value;\n return out;\n }\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition$1(source, _.groupby, _.field),\n names = (_.groupby || []).map(accessorName),\n values = [],\n step = _.step || 0.01,\n p = _.probs || range(step / 2, 1 - EPSILON, step),\n n = p.length;\n groups.forEach(g => {\n const q = quantiles(g, p);\n for (let i = 0; i < n; ++i) {\n const t = {};\n for (let i = 0; i < names.length; ++i) {\n t[names[i]] = g.dims[i];\n }\n t[as[0]] = p[i];\n t[as[1]] = q[i];\n values.push(ingest(t));\n }\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n return out;\n }\n});\n\n/**\n * Relays a data stream between data processing pipelines.\n * If the derive parameter is set, this transform will create derived\n * copies of observed tuples. This provides derived data streams in which\n * modifications to the tuples do not pollute an upstream data source.\n * @param {object} params - The parameters for this operator.\n * @param {number} [params.derive=false] - Boolean flag indicating if\n * the transform should make derived copies of incoming tuples.\n * @constructor\n */\nfunction Relay(params) {\n Transform.call(this, null, params);\n}\ninherits(Relay, Transform, {\n transform(_, pulse) {\n let out, lut;\n if (this.value) {\n lut = this.value;\n } else {\n out = pulse = pulse.addAll();\n lut = this.value = {};\n }\n if (_.derive) {\n out = pulse.fork(pulse.NO_SOURCE);\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n out.rem.push(lut[id]);\n lut[id] = null;\n });\n pulse.visit(pulse.ADD, t => {\n const dt = derive(t);\n lut[tupleid(t)] = dt;\n out.add.push(dt);\n });\n pulse.visit(pulse.MOD, t => {\n const dt = lut[tupleid(t)];\n for (const k in t) {\n dt[k] = t[k];\n // down stream writes may overwrite re-derived tuples\n // conservatively mark all source fields as modified\n out.modifies(k);\n }\n out.mod.push(dt);\n });\n }\n return out;\n }\n});\n\n/**\n * Samples tuples passing through this operator.\n * Uses reservoir sampling to maintain a representative sample.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {number} [params.size=1000] - The maximum number of samples.\n */\nfunction Sample(params) {\n Transform.call(this, [], params);\n this.count = 0;\n}\nSample.Definition = {\n 'type': 'Sample',\n 'metadata': {},\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'default': 1000\n }]\n};\ninherits(Sample, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n mod = _.modified('size'),\n num = _.size,\n map = this.value.reduce((m, t) => (m[tupleid(t)] = 1, m), {});\n let res = this.value,\n cnt = this.count,\n cap = 0;\n\n // sample reservoir update function\n function update(t) {\n let p, idx;\n if (res.length < num) {\n res.push(t);\n } else {\n idx = ~~((cnt + 1) * random());\n if (idx < res.length && idx >= cap) {\n p = res[idx];\n if (map[tupleid(p)]) out.rem.push(p); // eviction\n res[idx] = t;\n }\n }\n ++cnt;\n }\n if (pulse.rem.length) {\n // find all tuples that should be removed, add to output\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n if (map[id]) {\n map[id] = -1;\n out.rem.push(t);\n }\n --cnt;\n });\n\n // filter removed tuples out of the sample reservoir\n res = res.filter(t => map[tupleid(t)] !== -1);\n }\n if ((pulse.rem.length || mod) && res.length < num && pulse.source) {\n // replenish sample if backing data source is available\n cap = cnt = res.length;\n pulse.visit(pulse.SOURCE, t => {\n // update, but skip previously sampled tuples\n if (!map[tupleid(t)]) update(t);\n });\n cap = -1;\n }\n if (mod && res.length > num) {\n const n = res.length - num;\n for (let i = 0; i < n; ++i) {\n map[tupleid(res[i])] = -1;\n out.rem.push(res[i]);\n }\n res = res.slice(n);\n }\n if (pulse.mod.length) {\n // propagate modified tuples in the sample reservoir\n pulse.visit(pulse.MOD, t => {\n if (map[tupleid(t)]) out.mod.push(t);\n });\n }\n if (pulse.add.length) {\n // update sample reservoir\n pulse.visit(pulse.ADD, update);\n }\n if (pulse.add.length || cap < 0) {\n // output newly added tuples\n out.add = res.filter(t => !map[tupleid(t)]);\n }\n this.count = cnt;\n this.value = out.source = res;\n return out;\n }\n});\n\n/**\n * Generates data tuples for a specified sequence range of numbers.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {number} params.start - The first number in the sequence.\n * @param {number} params.stop - The last number (exclusive) in the sequence.\n * @param {number} [params.step=1] - The step size between numbers in the sequence.\n */\nfunction Sequence(params) {\n Transform.call(this, null, params);\n}\nSequence.Definition = {\n 'type': 'Sequence',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'start',\n 'type': 'number',\n 'required': true\n }, {\n 'name': 'stop',\n 'type': 'number',\n 'required': true\n }, {\n 'name': 'step',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'data'\n }]\n};\ninherits(Sequence, Transform, {\n transform(_, pulse) {\n if (this.value && !_.modified()) return;\n const out = pulse.materialize().fork(pulse.MOD),\n as = _.as || 'data';\n out.rem = this.value ? pulse.rem.concat(this.value) : pulse.rem;\n this.value = range(_.start, _.stop, _.step || 1).map(v => {\n const t = {};\n t[as] = v;\n return ingest(t);\n });\n out.add = pulse.add.concat(this.value);\n return out;\n }\n});\n\n/**\n * Propagates a new pulse without any tuples so long as the input\n * pulse contains some added, removed or modified tuples.\n * @param {object} params - The parameters for this operator.\n * @constructor\n */\nfunction Sieve(params) {\n Transform.call(this, null, params);\n this.modified(true); // always treat as modified\n}\n\ninherits(Sieve, Transform, {\n transform(_, pulse) {\n this.value = pulse.source;\n return pulse.changed() ? pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS) : pulse.StopPropagation;\n }\n});\n\n/**\n * Discretize dates to specific time units.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The data field containing date/time values.\n */\nfunction TimeUnit(params) {\n Transform.call(this, null, params);\n}\nconst OUTPUT = ['unit0', 'unit1'];\nTimeUnit.Definition = {\n 'type': 'TimeUnit',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'interval',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'units',\n 'type': 'enum',\n 'values': TIME_UNITS,\n 'array': true\n }, {\n 'name': 'step',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'maxbins',\n 'type': 'number',\n 'default': 40\n }, {\n 'name': 'extent',\n 'type': 'date',\n 'array': true\n }, {\n 'name': 'timezone',\n 'type': 'enum',\n 'default': 'local',\n 'values': ['local', 'utc']\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': OUTPUT\n }]\n};\ninherits(TimeUnit, Transform, {\n transform(_, pulse) {\n const field = _.field,\n band = _.interval !== false,\n utc = _.timezone === 'utc',\n floor = this._floor(_, pulse),\n offset = (utc ? utcInterval : timeInterval)(floor.unit).offset,\n as = _.as || OUTPUT,\n u0 = as[0],\n u1 = as[1],\n step = floor.step;\n let min = floor.start || Infinity,\n max = floor.stop || -Infinity,\n flag = pulse.ADD;\n if (_.modified() || pulse.changed(pulse.REM) || pulse.modified(accessorFields(field))) {\n pulse = pulse.reflow(true);\n flag = pulse.SOURCE;\n min = Infinity;\n max = -Infinity;\n }\n pulse.visit(flag, t => {\n const v = field(t);\n let a, b;\n if (v == null) {\n t[u0] = null;\n if (band) t[u1] = null;\n } else {\n t[u0] = a = b = floor(v);\n if (band) t[u1] = b = offset(a, step);\n if (a < min) min = a;\n if (b > max) max = b;\n }\n });\n floor.start = min;\n floor.stop = max;\n return pulse.modifies(band ? as : u0);\n },\n _floor(_, pulse) {\n const utc = _.timezone === 'utc';\n\n // get parameters\n const {\n units,\n step\n } = _.units ? {\n units: _.units,\n step: _.step || 1\n } : timeBin({\n extent: _.extent || extent(pulse.materialize(pulse.SOURCE).source, _.field),\n maxbins: _.maxbins\n });\n\n // check / standardize time units\n const tunits = timeUnits(units),\n prev = this.value || {},\n floor = (utc ? utcFloor : timeFloor)(tunits, step);\n floor.unit = peek(tunits);\n floor.units = tunits;\n floor.step = step;\n floor.start = prev.start;\n floor.stop = prev.stop;\n return this.value = floor;\n }\n});\n\n/**\n * An index that maps from unique, string-coerced, field values to tuples.\n * Assumes that the field serves as a unique key with no duplicate values.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The field accessor to index.\n */\nfunction TupleIndex(params) {\n Transform.call(this, fastmap(), params);\n}\ninherits(TupleIndex, Transform, {\n transform(_, pulse) {\n const df = pulse.dataflow,\n field = _.field,\n index = this.value,\n set = t => index.set(field(t), t);\n let mod = true;\n if (_.modified('field') || pulse.modified(field.fields)) {\n index.clear();\n pulse.visit(pulse.SOURCE, set);\n } else if (pulse.changed()) {\n pulse.visit(pulse.REM, t => index.delete(field(t)));\n pulse.visit(pulse.ADD, set);\n } else {\n mod = false;\n }\n this.modified(mod);\n if (index.empty > df.cleanThreshold) df.runAfter(index.clean);\n return pulse.fork();\n }\n});\n\n/**\n * Extracts an array of values. Assumes the source data has already been\n * reduced as needed (e.g., by an upstream Aggregate transform).\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The domain field to extract.\n * @param {function(*,*): number} [params.sort] - An optional\n * comparator function for sorting the values. The comparator will be\n * applied to backing tuples prior to value extraction.\n */\nfunction Values(params) {\n Transform.call(this, null, params);\n}\ninherits(Values, Transform, {\n transform(_, pulse) {\n const run = !this.value || _.modified('field') || _.modified('sort') || pulse.changed() || _.sort && pulse.modified(_.sort.fields);\n if (run) {\n this.value = (_.sort ? pulse.source.slice().sort(stableCompare(_.sort)) : pulse.source).map(_.field);\n }\n }\n});\n\nfunction WindowOp(op, field, param, as) {\n const fn = WindowOps[op](field, param);\n return {\n init: fn.init || zero,\n update: function (w, t) {\n t[as] = fn.next(w);\n }\n };\n}\nconst WindowOps = {\n row_number: function () {\n return {\n next: w => w.index + 1\n };\n },\n rank: function () {\n let rank;\n return {\n init: () => rank = 1,\n next: w => {\n const i = w.index,\n data = w.data;\n return i && w.compare(data[i - 1], data[i]) ? rank = i + 1 : rank;\n }\n };\n },\n dense_rank: function () {\n let drank;\n return {\n init: () => drank = 1,\n next: w => {\n const i = w.index,\n d = w.data;\n return i && w.compare(d[i - 1], d[i]) ? ++drank : drank;\n }\n };\n },\n percent_rank: function () {\n const rank = WindowOps.rank(),\n next = rank.next;\n return {\n init: rank.init,\n next: w => (next(w) - 1) / (w.data.length - 1)\n };\n },\n cume_dist: function () {\n let cume;\n return {\n init: () => cume = 0,\n next: w => {\n const d = w.data,\n c = w.compare;\n let i = w.index;\n if (cume < i) {\n while (i + 1 < d.length && !c(d[i], d[i + 1])) ++i;\n cume = i;\n }\n return (1 + cume) / d.length;\n }\n };\n },\n ntile: function (field, num) {\n num = +num;\n if (!(num > 0)) error('ntile num must be greater than zero.');\n const cume = WindowOps.cume_dist(),\n next = cume.next;\n return {\n init: cume.init,\n next: w => Math.ceil(num * next(w))\n };\n },\n lag: function (field, offset) {\n offset = +offset || 1;\n return {\n next: w => {\n const i = w.index - offset;\n return i >= 0 ? field(w.data[i]) : null;\n }\n };\n },\n lead: function (field, offset) {\n offset = +offset || 1;\n return {\n next: w => {\n const i = w.index + offset,\n d = w.data;\n return i < d.length ? field(d[i]) : null;\n }\n };\n },\n first_value: function (field) {\n return {\n next: w => field(w.data[w.i0])\n };\n },\n last_value: function (field) {\n return {\n next: w => field(w.data[w.i1 - 1])\n };\n },\n nth_value: function (field, nth) {\n nth = +nth;\n if (!(nth > 0)) error('nth_value nth must be greater than zero.');\n return {\n next: w => {\n const i = w.i0 + (nth - 1);\n return i < w.i1 ? field(w.data[i]) : null;\n }\n };\n },\n prev_value: function (field) {\n let prev;\n return {\n init: () => prev = null,\n next: w => {\n const v = field(w.data[w.index]);\n return v != null ? prev = v : prev;\n }\n };\n },\n next_value: function (field) {\n let v, i;\n return {\n init: () => (v = null, i = -1),\n next: w => {\n const d = w.data;\n return w.index <= i ? v : (i = find(field, d, w.index)) < 0 ? (i = d.length, v = null) : v = field(d[i]);\n }\n };\n }\n};\nfunction find(field, data, index) {\n for (let n = data.length; index < n; ++index) {\n const v = field(data[index]);\n if (v != null) return index;\n }\n return -1;\n}\nconst ValidWindowOps = Object.keys(WindowOps);\n\nfunction WindowState(_) {\n const ops = array(_.ops),\n fields = array(_.fields),\n params = array(_.params),\n as = array(_.as),\n outputs = this.outputs = [],\n windows = this.windows = [],\n inputs = {},\n map = {},\n counts = [],\n measures = [];\n let countOnly = true;\n function visitInputs(f) {\n array(accessorFields(f)).forEach(_ => inputs[_] = 1);\n }\n visitInputs(_.sort);\n ops.forEach((op, i) => {\n const field = fields[i],\n mname = accessorName(field),\n name = measureName(op, mname, as[i]);\n visitInputs(field);\n outputs.push(name);\n\n // Window operation\n if (hasOwnProperty(WindowOps, op)) {\n windows.push(WindowOp(op, fields[i], params[i], name));\n }\n\n // Aggregate operation\n else {\n if (field == null && op !== 'count') {\n error('Null aggregate field specified.');\n }\n if (op === 'count') {\n counts.push(name);\n return;\n }\n countOnly = false;\n let m = map[mname];\n if (!m) {\n m = map[mname] = [];\n m.field = field;\n measures.push(m);\n }\n m.push(createMeasure(op, name));\n }\n });\n if (counts.length || measures.length) {\n this.cell = cell(measures, counts, countOnly);\n }\n this.inputs = Object.keys(inputs);\n}\nconst prototype = WindowState.prototype;\nprototype.init = function () {\n this.windows.forEach(_ => _.init());\n if (this.cell) this.cell.init();\n};\nprototype.update = function (w, t) {\n const cell = this.cell,\n wind = this.windows,\n data = w.data,\n m = wind && wind.length;\n let j;\n if (cell) {\n for (j = w.p0; j < w.i0; ++j) cell.rem(data[j]);\n for (j = w.p1; j < w.i1; ++j) cell.add(data[j]);\n cell.set(t);\n }\n for (j = 0; j < m; ++j) wind[j].update(w, t);\n};\nfunction cell(measures, counts, countOnly) {\n measures = measures.map(m => compileMeasures(m, m.field));\n const cell = {\n num: 0,\n agg: null,\n store: false,\n count: counts\n };\n if (!countOnly) {\n var n = measures.length,\n a = cell.agg = Array(n),\n i = 0;\n for (; i < n; ++i) a[i] = new measures[i](cell);\n }\n if (cell.store) {\n var store = cell.data = new TupleStore();\n }\n cell.add = function (t) {\n cell.num += 1;\n if (countOnly) return;\n if (store) store.add(t);\n for (let i = 0; i < n; ++i) {\n a[i].add(a[i].get(t), t);\n }\n };\n cell.rem = function (t) {\n cell.num -= 1;\n if (countOnly) return;\n if (store) store.rem(t);\n for (let i = 0; i < n; ++i) {\n a[i].rem(a[i].get(t), t);\n }\n };\n cell.set = function (t) {\n let i, n;\n\n // consolidate stored values\n if (store) store.values();\n\n // update tuple properties\n for (i = 0, n = counts.length; i < n; ++i) t[counts[i]] = cell.num;\n if (!countOnly) for (i = 0, n = a.length; i < n; ++i) a[i].set(t);\n };\n cell.init = function () {\n cell.num = 0;\n if (store) store.reset();\n for (let i = 0; i < n; ++i) a[i].init();\n };\n return cell;\n}\n\n/**\n * Perform window calculations and write results to the input stream.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - A comparator function for sorting tuples within a window.\n * @param {Array} [params.groupby] - An array of accessors by which to partition tuples into separate windows.\n * @param {Array} params.ops - An array of strings indicating window operations to perform.\n * @param {Array} [params.fields] - An array of accessors\n * for data fields to use as inputs to window operations.\n * @param {Array<*>} [params.params] - An array of parameter values for window operations.\n * @param {Array} [params.as] - An array of output field names for window operations.\n * @param {Array} [params.frame] - Window frame definition as two-element array.\n * @param {boolean} [params.ignorePeers=false] - If true, base window frame boundaries on row\n * number alone, ignoring peers with identical sort values. If false (default),\n * the window boundaries will be adjusted to include peer values.\n */\nfunction Window(params) {\n Transform.call(this, {}, params);\n this._mlen = 0;\n this._mods = [];\n}\nWindow.Definition = {\n 'type': 'Window',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'ops',\n 'type': 'enum',\n 'array': true,\n 'values': ValidWindowOps.concat(ValidAggregateOps)\n }, {\n 'name': 'params',\n 'type': 'number',\n 'null': true,\n 'array': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'null': true,\n 'array': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }, {\n 'name': 'frame',\n 'type': 'number',\n 'null': true,\n 'array': true,\n 'length': 2,\n 'default': [null, 0]\n }, {\n 'name': 'ignorePeers',\n 'type': 'boolean',\n 'default': false\n }]\n};\ninherits(Window, Transform, {\n transform(_, pulse) {\n this.stamp = pulse.stamp;\n const mod = _.modified(),\n cmp = stableCompare(_.sort),\n key = groupkey(_.groupby),\n group = t => this.group(key(t));\n\n // initialize window state\n let state = this.state;\n if (!state || mod) {\n state = this.state = new WindowState(_);\n }\n\n // partition input tuples\n if (mod || pulse.modified(state.inputs)) {\n this.value = {};\n pulse.visit(pulse.SOURCE, t => group(t).add(t));\n } else {\n pulse.visit(pulse.REM, t => group(t).remove(t));\n pulse.visit(pulse.ADD, t => group(t).add(t));\n }\n\n // perform window calculations for each modified partition\n for (let i = 0, n = this._mlen; i < n; ++i) {\n processPartition(this._mods[i], state, cmp, _);\n }\n this._mlen = 0;\n this._mods = [];\n\n // TODO don't reflow everything?\n return pulse.reflow(mod).modifies(state.outputs);\n },\n group(key) {\n let group = this.value[key];\n if (!group) {\n group = this.value[key] = SortedList(tupleid);\n group.stamp = -1;\n }\n if (group.stamp < this.stamp) {\n group.stamp = this.stamp;\n this._mods[this._mlen++] = group;\n }\n return group;\n }\n});\nfunction processPartition(list, state, cmp, _) {\n const sort = _.sort,\n range = sort && !_.ignorePeers,\n frame = _.frame || [null, 0],\n data = list.data(cmp),\n // use cmp for stable sort\n n = data.length,\n b = range ? bisector(sort) : null,\n w = {\n i0: 0,\n i1: 0,\n p0: 0,\n p1: 0,\n index: 0,\n data: data,\n compare: sort || constant(-1)\n };\n state.init();\n for (let i = 0; i < n; ++i) {\n setWindow(w, frame, i, n);\n if (range) adjustRange(w, b);\n state.update(w, data[i]);\n }\n}\nfunction setWindow(w, f, i, n) {\n w.p0 = w.i0;\n w.p1 = w.i1;\n w.i0 = f[0] == null ? 0 : Math.max(0, i - Math.abs(f[0]));\n w.i1 = f[1] == null ? n : Math.min(n, i + Math.abs(f[1]) + 1);\n w.index = i;\n}\n\n// if frame type is 'range', adjust window for peer values\nfunction adjustRange(w, bisect) {\n const r0 = w.i0,\n r1 = w.i1 - 1,\n c = w.compare,\n d = w.data,\n n = d.length - 1;\n if (r0 > 0 && !c(d[r0], d[r0 - 1])) w.i0 = bisect.left(d, d[r0]);\n if (r1 < n && !c(d[r1], d[r1 + 1])) w.i1 = bisect.right(d, d[r1]);\n}\n\nexport { Aggregate as aggregate, Bin as bin, Collect as collect, Compare as compare, CountPattern as countpattern, Cross as cross, Density as density, DotBin as dotbin, Expression as expression, Extent as extent, Facet as facet, Field as field, Filter as filter, Flatten as flatten, Fold as fold, Formula as formula, Generate as generate, Impute as impute, JoinAggregate as joinaggregate, KDE as kde, Key as key, Load as load, Lookup as lookup, MultiExtent as multiextent, MultiValues as multivalues, Params as params, Pivot as pivot, PreFacet as prefacet, Project as project, Proxy as proxy, Quantile as quantile, Relay as relay, Sample as sample, Sequence as sequence, Sieve as sieve, Subflow as subflow, TimeUnit as timeunit, TupleIndex as tupleindex, Values as values, Window as window };\n","export default function mean(values, valueof) {\n let count = 0;\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n ++count, sum += value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n ++count, sum += value;\n }\n }\n }\n if (count) return sum / count;\n}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // falls through\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n","export default function() {}\n","import noop from \"../noop.js\";\nimport {point} from \"./basis.js\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n","import {point} from \"./basis.js\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n","import {Basis} from \"./basis.js\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {point} from \"./cardinal.js\";\n\nexport function CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalOpen(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import noop from \"../noop.js\";\nimport {point} from \"./cardinal.js\";\n\nexport function CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import {epsilon} from \"../math.js\";\nimport {Cardinal} from \"./cardinal.js\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalClosed} from \"./cardinalClosed.js\";\nimport noop from \"../noop.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalOpen} from \"./cardinalOpen.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","import noop from \"../noop.js\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction append(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n let d = Math.floor(digits);\n if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);\n if (d > 15) return append;\n const k = 10 ** d;\n return function(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n}\n\nexport class Path {\n constructor(digits) {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n this._append = digits == null ? append : appendRound(digits);\n }\n moveTo(x, y) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._append`Z`;\n }\n }\n lineTo(x, y) {\n this._append`L${this._x1 = +x},${this._y1 = +y}`;\n }\n quadraticCurveTo(x1, y1, x, y) {\n this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;\n }\n bezierCurveTo(x1, y1, x2, y2, x, y) {\n this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;\n }\n arcTo(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._append`M${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._append`L${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Otherwise, draw an arc!\n else {\n let x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;\n }\n\n this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;\n }\n }\n arc(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._append`M${x0},${y0}`;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._append`L${x0},${y0}`;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._append`A${r},${r},0,1,${cw},${x - dx},${y - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x + r * Math.cos(a1)},${this._y1 = y + r * Math.sin(a1)}`;\n }\n }\n rect(x, y, w, h) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;\n }\n toString() {\n return this._;\n }\n}\n\nexport function path() {\n return new Path;\n}\n\n// Allow instanceof d3.path\npath.prototype = Path.prototype;\n\nexport function pathRound(digits = 3) {\n return new Path(+digits);\n}\n","import {Path} from \"d3-path\";\n\nexport function withPath(shape) {\n let digits = 3;\n\n shape.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) {\n digits = null;\n } else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n return shape;\n };\n\n return () => new Path(digits);\n}\n","import constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\nimport {withPath} from \"./path.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null,\n path = withPath(arc);\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle. If this\n // intersection fails, it’s probably because the arc is too small, so\n // disable the corner radius entirely.\n if (da < pi) {\n if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n } else {\n rc0 = rc1 = 0;\n }\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n","export var slice = Array.prototype.slice;\n\nexport default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x, y) {\n var defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(line);\n\n x = typeof x === \"function\" ? x : (x === undefined) ? pointX : constant(x);\n y = typeof y === \"function\" ? y : (y === undefined) ? pointY : constant(y);\n\n function line(data) {\n var i,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x0, y0, y1) {\n var x1 = null,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(area);\n\n x0 = typeof x0 === \"function\" ? x0 : (x0 === undefined) ? pointX : constant(+x0);\n y0 = typeof y0 === \"function\" ? y0 : (y0 === undefined) ? constant(0) : constant(+y0);\n y1 = typeof y1 === \"function\" ? y1 : (y1 === undefined) ? pointY : constant(+y1);\n\n function area(data) {\n var i,\n j,\n k,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n","import {min, sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const r = sqrt(size + min(size / 28, 0.75)) * 0.59436;\n const t = r / 2;\n const u = t * sqrt3;\n context.moveTo(0, r);\n context.lineTo(0, -r);\n context.moveTo(-u, -t);\n context.lineTo(u, t);\n context.moveTo(-u, t);\n context.lineTo(u, -t);\n }\n};\n","import {pi, sqrt, tau} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst tan30 = sqrt(1 / 3);\nconst tan30_2 = tan30 * 2;\n\nexport default {\n draw(context, size) {\n const y = sqrt(size / tan30_2);\n const x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n","import {sin, cos, sqrt, pi, tau} from \"../math.js\";\n\nconst ka = 0.89081309152928522810;\nconst kr = sin(pi / 10) / sin(7 * pi / 10);\nconst kx = sin(tau / 10) * kr;\nconst ky = -cos(tau / 10) * kr;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size * ka);\n const x = kx * r;\n const y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (let i = 1; i < 5; ++i) {\n const a = tau * i / 5;\n const c = cos(a);\n const s = sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n","function domCanvas(w, h) {\n if (typeof document !== 'undefined' && document.createElement) {\n const c = document.createElement('canvas');\n if (c && c.getContext) {\n c.width = w;\n c.height = h;\n return c;\n }\n }\n return null;\n}\nconst domImage = () => typeof Image !== 'undefined' ? Image : null;\n\nexport { domCanvas as canvas, domCanvas, domImage as image };\n","import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const y = -sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const s = sqrt(size) * 0.6824;\n const t = s / 2;\n const u = (s * sqrt3) / 2; // cos(Math.PI / 6)\n context.moveTo(0, -s);\n context.lineTo(u, t);\n context.lineTo(-u, t);\n context.closePath();\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst c = -0.5;\nconst s = sqrt(3) / 2;\nconst k = 1 / sqrt(12);\nconst a = (k / 2 + 1) * 3;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / a);\n const x0 = r / 2, y0 = r * k;\n const x1 = x0, y1 = r * k + r;\n const x2 = -x1, y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n","import ascending from \"./ascending.js\";\nimport bisector from \"./bisector.js\";\nimport number from \"./number.js\";\n\nconst ascendingBisect = bisector(ascending);\nexport const bisectRight = ascendingBisect.right;\nexport const bisectLeft = ascendingBisect.left;\nexport const bisectCenter = bisector(number).center;\nexport default bisectRight;\n","export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHex8: color_formatHex8,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb() {\n return this;\n },\n clamp() {\n return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n },\n displayable() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatHex8: rgb_formatHex8,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n value = clampi(value);\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n clamp() {\n return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n },\n displayable() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n }\n}));\n\nfunction clamph(value) {\n value = (value || 0) % 360;\n return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","import {basis} from \"./basis.js\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","export default x => () => x;\n","import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n","import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n","export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n","import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n","export default function number(x) {\n return +x;\n}\n","import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateNumber, interpolateRound} from \"d3-interpolate\";\nimport constant from \"./constant.js\";\nimport number from \"./number.js\";\n\nvar unit = [0, 1];\n\nexport function identity(x) {\n return x;\n}\n\nfunction normalize(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n var t;\n if (a > b) t = a, a = b, b = t;\n return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = normalize(domain[i], domain[i + 1]);\n r[i] = interpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport function transformer() {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n transform,\n untransform,\n unknown,\n clamp = identity,\n piecewise,\n output,\n input;\n\n function rescale() {\n var n = Math.min(domain.length, range.length);\n if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);\n piecewise = n > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n }\n\n scale.invert = function(y) {\n return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = Array.from(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t, u) {\n transform = t, untransform = u;\n return rescale();\n };\n}\n\nexport default function continuous() {\n return transformer()(identity, identity);\n}\n","export default function constants(x) {\n return function() {\n return x;\n };\n}\n","export function initRange(domain, range) {\n switch (arguments.length) {\n case 0: break;\n case 1: this.range(domain); break;\n default: this.range(range).domain(domain); break;\n }\n return this;\n}\n\nexport function initInterpolator(domain, interpolator) {\n switch (arguments.length) {\n case 0: break;\n case 1: {\n if (typeof domain === \"function\") this.interpolator(domain);\n else this.range(domain);\n break;\n }\n default: {\n this.domain(domain);\n if (typeof interpolator === \"function\") this.interpolator(interpolator);\n else this.range(interpolator);\n break;\n }\n }\n return this;\n}\n","import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function tickFormat(start, stop, count, specifier) {\n var step = tickStep(start, stop, count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n","import {ticks, tickIncrement} from \"d3-array\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport tickFormat from \"./tickFormat.js\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n var d = domain();\n return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain();\n var i0 = 0;\n var i1 = d.length - 1;\n var start = d[i0];\n var stop = d[i1];\n var prestep;\n var step;\n var maxIter = 10;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n \n while (maxIter-- > 0) {\n step = tickIncrement(start, stop, count);\n if (step === prestep) {\n d[i0] = start\n d[i1] = stop\n return domain(d);\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n } else {\n break;\n }\n prestep = step;\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous();\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n","export default function nice(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n","import {ticks} from \"d3-array\";\nimport {format, formatSpecifier} from \"d3-format\";\nimport nice from \"./nice.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformLog(x) {\n return Math.log(x);\n}\n\nfunction transformExp(x) {\n return Math.exp(x);\n}\n\nfunction transformLogn(x) {\n return -Math.log(-x);\n}\n\nfunction transformExpn(x) {\n return -Math.exp(-x);\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : x => Math.pow(base, x);\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), x => Math.log(x) / base);\n}\n\nfunction reflect(f) {\n return (x, k) => -f(-x, k);\n}\n\nexport function loggish(transform) {\n const scale = transform(transformLog, transformExp);\n const domain = scale.domain;\n let base = 10;\n let logs;\n let pows;\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) {\n logs = reflect(logs), pows = reflect(pows);\n transform(transformLogn, transformExpn);\n } else {\n transform(transformLog, transformExp);\n }\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = count => {\n const d = domain();\n let u = d[0];\n let v = d[d.length - 1];\n const r = v < u;\n\n if (r) ([u, v] = [v, u]);\n\n let i = logs(u);\n let j = logs(v);\n let k;\n let t;\n const n = count == null ? 10 : +count;\n let z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.floor(i), j = Math.ceil(j);\n if (u > 0) for (; i <= j; ++i) {\n for (k = 1; k < base; ++k) {\n t = i < 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i <= j; ++i) {\n for (k = base - 1; k >= 1; --k) {\n t = i > 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n if (z.length * 2 < n) z = ticks(u, v, n);\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = (count, specifier) => {\n if (count == null) count = 10;\n if (specifier == null) specifier = base === 10 ? \"s\" : \",\";\n if (typeof specifier !== \"function\") {\n if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;\n specifier = format(specifier);\n }\n if (count === Infinity) return specifier;\n const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return d => {\n let i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = () => {\n return domain(nice(domain(), {\n floor: x => pows(Math.floor(logs(x))),\n ceil: x => pows(Math.ceil(logs(x)))\n }));\n };\n\n return scale;\n}\n\nexport default function log() {\n const scale = loggish(transformer()).domain([1, 10]);\n scale.copy = () => copy(scale, log()).base(scale.base());\n initRange.apply(scale, arguments);\n return scale;\n}\n","import {linearish} from \"./linear.js\";\nimport {copy, identity, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformPow(exponent) {\n return function(x) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n };\n}\n\nfunction transformSqrt(x) {\n return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);\n}\n\nfunction transformSquare(x) {\n return x < 0 ? -x * x : x * x;\n}\n\nexport function powish(transform) {\n var scale = transform(identity, identity),\n exponent = 1;\n\n function rescale() {\n return exponent === 1 ? transform(identity, identity)\n : exponent === 0.5 ? transform(transformSqrt, transformSquare)\n : transform(transformPow(exponent), transformPow(1 / exponent));\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, rescale()) : exponent;\n };\n\n return linearish(scale);\n}\n\nexport default function pow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, pow()).exponent(scale.exponent());\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n\nexport function sqrt() {\n return pow.apply(null, arguments).exponent(0.5);\n}\n","import {linearish} from \"./linear.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformSymlog(c) {\n return function(x) {\n return Math.sign(x) * Math.log1p(Math.abs(x / c));\n };\n}\n\nfunction transformSymexp(c) {\n return function(x) {\n return Math.sign(x) * Math.expm1(Math.abs(x)) * c;\n };\n}\n\nexport function symlogish(transform) {\n var c = 1, scale = transform(transformSymlog(c), transformSymexp(c));\n\n scale.constant = function(_) {\n return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c;\n };\n\n return linearish(scale);\n}\n\nexport default function symlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, symlog()).constant(scale.constant());\n };\n\n return initRange.apply(scale, arguments);\n}\n","import {bisector, tickStep} from \"d3-array\";\nimport {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from \"./duration.js\";\nimport {millisecond} from \"./millisecond.js\";\nimport {second} from \"./second.js\";\nimport {timeMinute, utcMinute} from \"./minute.js\";\nimport {timeHour, utcHour} from \"./hour.js\";\nimport {timeDay, unixDay} from \"./day.js\";\nimport {timeSunday, utcSunday} from \"./week.js\";\nimport {timeMonth, utcMonth} from \"./month.js\";\nimport {timeYear, utcYear} from \"./year.js\";\n\nfunction ticker(year, month, week, day, hour, minute) {\n\n const tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function ticks(start, stop, count) {\n const reverse = stop < start;\n if (reverse) [start, stop] = [stop, start];\n const interval = count && typeof count.range === \"function\" ? count : tickInterval(start, stop, count);\n const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop\n return reverse ? ticks.reverse() : ticks;\n }\n\n function tickInterval(start, stop, count) {\n const target = Math.abs(stop - start) / count;\n const i = bisector(([,, step]) => step).right(tickIntervals, target);\n if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));\n if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));\n const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n return t.every(step);\n }\n\n return [ticks, tickInterval];\n}\n\nconst [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);\n\nexport {utcTicks, utcTickInterval, timeTicks, timeTickInterval};\n","import {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeTicks, timeTickInterval} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport nice from \"./nice.js\";\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {\n var scale = continuous(),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(Array.from(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval) {\n var d = domain();\n if (!interval || typeof interval.range !== \"function\") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);\n return interval ? domain(nice(d, interval)) : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));\n };\n\n return scale;\n}\n\nexport default function time() {\n return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);\n}\n","import {interpolate, interpolateRound} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 1,\n t0,\n t1,\n k10,\n transform,\n interpolator = identity,\n clamp = false,\n unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1;\n return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0);\n return scale;\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .interpolator(source.interpolator())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport default function sequential() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, sequential());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialLog() {\n var scale = loggish(transformer()).domain([1, 10]);\n\n scale.copy = function() {\n return copy(scale, sequentialLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSqrt() {\n return sequentialPow.apply(null, arguments).exponent(0.5);\n}\n","import {default as value} from \"./value.js\";\n\nexport default function piecewise(interpolate, values) {\n if (values === undefined) values = interpolate, interpolate = value;\n var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);\n while (i < n) I[i] = interpolate(v, v = values[++i]);\n return function(t) {\n var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));\n return I[i](t - i);\n };\n}\n","import {interpolate, interpolateRound, piecewise} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {copy} from \"./sequential.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 0.5,\n x2 = 1,\n s = 1,\n t0,\n t1,\n t2,\n k10,\n k21,\n interpolator = identity,\n transform,\n clamp = false,\n unknown;\n\n function scale(x) {\n return isNaN(x = +x) ? unknown : (x = 0.5 + ((x = +transform(x)) - t1) * (s * x < s * t1 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1, x2] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1, scale) : [x0, x1, x2];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1, r2;\n return arguments.length ? ([r0, r1, r2] = _, interpolator = piecewise(interpolate, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), t2 = t(x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1;\n return scale;\n };\n}\n\nexport default function diverging() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, diverging());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingLog() {\n var scale = loggish(transformer()).domain([0.1, 1, 10]);\n\n scale.copy = function() {\n return copy(scale, divergingLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSqrt() {\n return divergingPow.apply(null, arguments).exponent(0.5);\n}\n","export class InternMap extends Map {\n constructor(entries, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (entries != null) for (const [key, value] of entries) this.set(key, value);\n }\n get(key) {\n return super.get(intern_get(this, key));\n }\n has(key) {\n return super.has(intern_get(this, key));\n }\n set(key, value) {\n return super.set(intern_set(this, key), value);\n }\n delete(key) {\n return super.delete(intern_delete(this, key));\n }\n}\n\nexport class InternSet extends Set {\n constructor(values, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (values != null) for (const value of values) this.add(value);\n }\n has(value) {\n return super.has(intern_get(this, value));\n }\n add(value) {\n return super.add(intern_set(this, value));\n }\n delete(value) {\n return super.delete(intern_delete(this, value));\n }\n}\n\nfunction intern_get({_intern, _key}, value) {\n const key = _key(value);\n return _intern.has(key) ? _intern.get(key) : value;\n}\n\nfunction intern_set({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) return _intern.get(key);\n _intern.set(key, value);\n return value;\n}\n\nfunction intern_delete({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) {\n value = _intern.get(key);\n _intern.delete(key);\n }\n return value;\n}\n\nfunction keyof(value) {\n return value !== null && typeof value === \"object\" ? value.valueOf() : value;\n}\n","import {InternMap} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport const implicit = Symbol(\"implicit\");\n\nexport default function ordinal() {\n var index = new InternMap(),\n domain = [],\n range = [],\n unknown = implicit;\n\n function scale(d) {\n let i = index.get(d);\n if (i === undefined) {\n if (unknown !== implicit) return unknown;\n index.set(d, i = domain.push(d) - 1);\n }\n return range[i % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = new InternMap();\n for (const value of _) {\n if (index.has(value)) continue;\n index.set(value, domain.push(value) - 1);\n }\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal(domain, range).unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n","export default function(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n","import {hue} from \"./color.js\";\n\nexport default function(a, b) {\n var i = hue(+a, +b);\n return function(t) {\n var x = i(t);\n return x - 360 * Math.floor(x / 360);\n };\n}\n","var degrees = 180 / Math.PI;\n\nexport var identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n","import decompose, {identity} from \"./decompose.js\";\n\nvar svgNode;\n\n/* eslint-disable no-undef */\nexport function parseCss(value) {\n const m = new (typeof DOMMatrix === \"function\" ? DOMMatrix : WebKitCSSMatrix)(value + \"\");\n return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);\n}\n\nexport function parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n","import number from \"../number.js\";\nimport {parseCss, parseSvg} from \"./parse.js\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n","var epsilon2 = 1e-12;\n\nfunction cosh(x) {\n return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\nexport default (function zoomRho(rho, rho2, rho4) {\n\n // p0 = [ux0, uy0, w0]\n // p1 = [ux1, uy1, w1]\n function zoom(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 ≅ u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000 * rho / Math.SQRT2;\n\n return i;\n }\n\n zoom.rho = function(_) {\n var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;\n return zoomRho(_1, _2, _4);\n };\n\n return zoom;\n})(Math.SQRT2, 2, 4);\n","import {hsl as colorHsl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hsl(hue) {\n return function(start, end) {\n var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hsl(hue);\nexport var hslLong = hsl(color);\n","export const radians = Math.PI / 180;\nexport const degrees = 180 / Math.PI;\n","import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\n// https://observablehq.com/@mbostock/lab-and-rgb\nconst K = 18,\n Xn = 0.96422,\n Yn = 1,\n Zn = 0.82521,\n t0 = 4 / 29,\n t1 = 6 / 29,\n t2 = 3 * t1 * t1,\n t3 = t1 * t1 * t1;\n\nfunction labConvert(o) {\n if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);\n if (o instanceof Hcl) return hcl2lab(o);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = rgb2lrgb(o.r),\n g = rgb2lrgb(o.g),\n b = rgb2lrgb(o.b),\n y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;\n if (r === g && g === b) x = z = y; else {\n x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);\n z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);\n }\n return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);\n}\n\nexport function gray(l, opacity) {\n return new Lab(l, 0, 0, opacity == null ? 1 : opacity);\n}\n\nexport default function lab(l, a, b, opacity) {\n return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);\n}\n\nexport function Lab(l, a, b, opacity) {\n this.l = +l;\n this.a = +a;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Lab, lab, extend(Color, {\n brighter(k) {\n return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n darker(k) {\n return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n rgb() {\n var y = (this.l + 16) / 116,\n x = isNaN(this.a) ? y : y + this.a / 500,\n z = isNaN(this.b) ? y : y - this.b / 200;\n x = Xn * lab2xyz(x);\n y = Yn * lab2xyz(y);\n z = Zn * lab2xyz(z);\n return new Rgb(\n lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),\n lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),\n lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),\n this.opacity\n );\n }\n}));\n\nfunction xyz2lab(t) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction lrgb2rgb(x) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2lrgb(x) {\n return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\nfunction hclConvert(o) {\n if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);\n if (!(o instanceof Lab)) o = labConvert(o);\n if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);\n var h = Math.atan2(o.b, o.a) * degrees;\n return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);\n}\n\nexport function lch(l, c, h, opacity) {\n return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function hcl(h, c, l, opacity) {\n return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function Hcl(h, c, l, opacity) {\n this.h = +h;\n this.c = +c;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nfunction hcl2lab(o) {\n if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);\n var h = o.h * radians;\n return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);\n}\n\ndefine(Hcl, hcl, extend(Color, {\n brighter(k) {\n return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);\n },\n darker(k) {\n return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);\n },\n rgb() {\n return hcl2lab(this).rgb();\n }\n}));\n","import {lab as colorLab} from \"d3-color\";\nimport color from \"./color.js\";\n\nexport default function lab(start, end) {\n var l = color((start = colorLab(start)).l, (end = colorLab(end)).l),\n a = color(start.a, end.a),\n b = color(start.b, end.b),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.l = l(t);\n start.a = a(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n}\n","import {hcl as colorHcl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hcl(hue) {\n return function(start, end) {\n var h = hue((start = colorHcl(start)).h, (end = colorHcl(end)).h),\n c = color(start.c, end.c),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.c = c(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hcl(hue);\nexport var hclLong = hcl(color);\n","import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb, darker, brighter} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * degrees - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nexport default function cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nexport function Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * radians,\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new Rgb(\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n","import {cubehelix as colorCubehelix} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\nexport default cubehelix(hue);\nexport var cubehelixLong = cubehelix(color);\n","export default function(interpolator, n) {\n var samples = new Array(n);\n for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));\n return samples;\n}\n","import { toNumber, peek, toSet, array, constant, isNumber, span, isObject, isString, error, isArray } from 'vega-util';\nimport { bisectRight, range, bisect } from 'd3-array';\nimport * as $ from 'd3-scale';\nimport { scaleOrdinal, tickFormat as tickFormat$1 } from 'd3-scale';\nexport { scaleImplicit } from 'd3-scale';\nimport * as $$1 from 'd3-interpolate';\nimport { timeInterval, utcInterval } from 'vega-time';\n\nfunction bandSpace (count, paddingInner, paddingOuter) {\n const space = count - paddingInner + paddingOuter * 2;\n return count ? space > 0 ? space : 1 : 0;\n}\n\nconst Identity = 'identity';\nconst Linear = 'linear';\nconst Log = 'log';\nconst Pow = 'pow';\nconst Sqrt = 'sqrt';\nconst Symlog = 'symlog';\nconst Time = 'time';\nconst UTC = 'utc';\nconst Sequential = 'sequential';\nconst Diverging = 'diverging';\nconst Quantile = 'quantile';\nconst Quantize = 'quantize';\nconst Threshold = 'threshold';\nconst Ordinal = 'ordinal';\nconst Point = 'point';\nconst Band = 'band';\nconst BinOrdinal = 'bin-ordinal';\n\n// categories\nconst Continuous = 'continuous';\nconst Discrete = 'discrete';\nconst Discretizing = 'discretizing';\nconst Interpolating = 'interpolating';\nconst Temporal = 'temporal';\n\nfunction invertRange (scale) {\n return function (_) {\n let lo = _[0],\n hi = _[1],\n t;\n if (hi < lo) {\n t = lo;\n lo = hi;\n hi = t;\n }\n return [scale.invert(lo), scale.invert(hi)];\n };\n}\n\nfunction invertRangeExtent (scale) {\n return function (_) {\n const range = scale.range();\n let lo = _[0],\n hi = _[1],\n min = -1,\n max,\n t,\n i,\n n;\n if (hi < lo) {\n t = lo;\n lo = hi;\n hi = t;\n }\n for (i = 0, n = range.length; i < n; ++i) {\n if (range[i] >= lo && range[i] <= hi) {\n if (min < 0) min = i;\n max = i;\n }\n }\n if (min < 0) return undefined;\n lo = scale.invertExtent(range[min]);\n hi = scale.invertExtent(range[max]);\n return [lo[0] === undefined ? lo[1] : lo[0], hi[1] === undefined ? hi[0] : hi[1]];\n };\n}\n\nfunction band() {\n const scale = scaleOrdinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range;\n let range$1 = [0, 1],\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n delete scale.unknown;\n function rescale() {\n const n = domain().length,\n reverse = range$1[1] < range$1[0],\n stop = range$1[1 - reverse],\n space = bandSpace(n, paddingInner, paddingOuter);\n let start = range$1[reverse - 0];\n step = (stop - start) / (space || 1);\n if (round) {\n step = Math.floor(step);\n }\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) {\n start = Math.round(start);\n bandwidth = Math.round(bandwidth);\n }\n const values = range(n).map(i => start + step * i);\n return ordinalRange(reverse ? values.reverse() : values);\n }\n scale.domain = function (_) {\n if (arguments.length) {\n domain(_);\n return rescale();\n } else {\n return domain();\n }\n };\n scale.range = function (_) {\n if (arguments.length) {\n range$1 = [+_[0], +_[1]];\n return rescale();\n } else {\n return range$1.slice();\n }\n };\n scale.rangeRound = function (_) {\n range$1 = [+_[0], +_[1]];\n round = true;\n return rescale();\n };\n scale.bandwidth = function () {\n return bandwidth;\n };\n scale.step = function () {\n return step;\n };\n scale.round = function (_) {\n if (arguments.length) {\n round = !!_;\n return rescale();\n } else {\n return round;\n }\n };\n scale.padding = function (_) {\n if (arguments.length) {\n paddingOuter = Math.max(0, Math.min(1, _));\n paddingInner = paddingOuter;\n return rescale();\n } else {\n return paddingInner;\n }\n };\n scale.paddingInner = function (_) {\n if (arguments.length) {\n paddingInner = Math.max(0, Math.min(1, _));\n return rescale();\n } else {\n return paddingInner;\n }\n };\n scale.paddingOuter = function (_) {\n if (arguments.length) {\n paddingOuter = Math.max(0, Math.min(1, _));\n return rescale();\n } else {\n return paddingOuter;\n }\n };\n scale.align = function (_) {\n if (arguments.length) {\n align = Math.max(0, Math.min(1, _));\n return rescale();\n } else {\n return align;\n }\n };\n scale.invertRange = function (_) {\n // bail if range has null or undefined values\n if (_[0] == null || _[1] == null) return;\n const reverse = range$1[1] < range$1[0],\n values = reverse ? ordinalRange().reverse() : ordinalRange(),\n n = values.length - 1;\n let lo = +_[0],\n hi = +_[1],\n a,\n b,\n t;\n\n // bail if either range endpoint is invalid\n if (lo !== lo || hi !== hi) return;\n\n // order range inputs, bail if outside of scale range\n if (hi < lo) {\n t = lo;\n lo = hi;\n hi = t;\n }\n if (hi < values[0] || lo > range$1[1 - reverse]) return;\n\n // binary search to index into scale range\n a = Math.max(0, bisectRight(values, lo) - 1);\n b = lo === hi ? a : bisectRight(values, hi) - 1;\n\n // increment index a if lo is within padding gap\n if (lo - values[a] > bandwidth + 1e-10) ++a;\n if (reverse) {\n // map + swap\n t = a;\n a = n - b;\n b = n - t;\n }\n return a > b ? undefined : domain().slice(a, b + 1);\n };\n scale.invert = function (_) {\n const value = scale.invertRange([_, _]);\n return value ? value[0] : value;\n };\n scale.copy = function () {\n return band().domain(domain()).range(range$1).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);\n };\n return rescale();\n}\nfunction pointish(scale) {\n const copy = scale.copy;\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n scale.copy = function () {\n return pointish(copy());\n };\n return scale;\n}\nfunction point() {\n return pointish(band().paddingInner(1));\n}\n\nvar map = Array.prototype.map;\nfunction numbers(_) {\n return map.call(_, toNumber);\n}\n\nconst slice = Array.prototype.slice;\n\nfunction scaleBinOrdinal() {\n let domain = [],\n range = [];\n function scale(x) {\n return x == null || x !== x ? undefined : range[(bisect(domain, x) - 1) % range.length];\n }\n scale.domain = function (_) {\n if (arguments.length) {\n domain = numbers(_);\n return scale;\n } else {\n return domain.slice();\n }\n };\n scale.range = function (_) {\n if (arguments.length) {\n range = slice.call(_);\n return scale;\n } else {\n return range.slice();\n }\n };\n scale.tickFormat = function (count, specifier) {\n return tickFormat$1(domain[0], peek(domain), count == null ? 10 : count, specifier);\n };\n scale.copy = function () {\n return scaleBinOrdinal().domain(scale.domain()).range(scale.range());\n };\n return scale;\n}\n\n/** Private scale registry: should not be exported */\nconst scales = new Map();\nconst VEGA_SCALE = Symbol('vega_scale');\nfunction registerScale(scale) {\n scale[VEGA_SCALE] = true;\n return scale;\n}\n\n/**\n * Return true if object was created by a constructor from the vega-scale `scale` function.\n */\nfunction isRegisteredScale(scale) {\n return scale && scale[VEGA_SCALE] === true;\n}\n\n/**\n * Augment scales with their type and needed inverse methods.\n */\nfunction create(type, constructor, metadata) {\n const ctr = function scale() {\n const s = constructor();\n if (!s.invertRange) {\n s.invertRange = s.invert ? invertRange(s) : s.invertExtent ? invertRangeExtent(s) : undefined;\n }\n s.type = type;\n return registerScale(s);\n };\n ctr.metadata = toSet(array(metadata));\n return ctr;\n}\n\n/**\n * Registry function for adding and accessing scale constructor functions.\n * The *type* argument is a String indicating the name of the scale type.\n *\n * If the *scale* argument is not specified, this method returns the matching scale constructor in the registry, or `null` if not found.\n * If the *scale* argument is provided, it must be a scale constructor function to add to the registry under the given *type* name.\n * The *metadata* argument provides additional information to guide appropriate use of scales within Vega.\n *\n * *metadata* can be either a string or string array. The valid string values are:\n * - `\"continuous\"` - the scale is defined over a continuous-valued domain.\n * - `\"discrete\"` - the scale is defined over a discrete domain and range.\n * - `\"discretizing\"` - the scale discretizes a continuous domain to a discrete range.\n * - `\"interpolating\"` - the scale range is defined using a color interpolator.\n * - `\"log\"` - the scale performs a logarithmic transform of the continuous domain.\n * - `\"temporal\"` - the scale domain is defined over date-time values.\n */\nfunction scale(type, scale, metadata) {\n if (arguments.length > 1) {\n scales.set(type, create(type, scale, metadata));\n return this;\n } else {\n return isValidScaleType(type) ? scales.get(type) : undefined;\n }\n}\n\n// identity scale\nscale(Identity, $.scaleIdentity);\n\n// continuous scales\nscale(Linear, $.scaleLinear, Continuous);\nscale(Log, $.scaleLog, [Continuous, Log]);\nscale(Pow, $.scalePow, Continuous);\nscale(Sqrt, $.scaleSqrt, Continuous);\nscale(Symlog, $.scaleSymlog, Continuous);\nscale(Time, $.scaleTime, [Continuous, Temporal]);\nscale(UTC, $.scaleUtc, [Continuous, Temporal]);\n\n// sequential scales\nscale(Sequential, $.scaleSequential, [Continuous, Interpolating]); // backwards compat\nscale(`${Sequential}-${Linear}`, $.scaleSequential, [Continuous, Interpolating]);\nscale(`${Sequential}-${Log}`, $.scaleSequentialLog, [Continuous, Interpolating, Log]);\nscale(`${Sequential}-${Pow}`, $.scaleSequentialPow, [Continuous, Interpolating]);\nscale(`${Sequential}-${Sqrt}`, $.scaleSequentialSqrt, [Continuous, Interpolating]);\nscale(`${Sequential}-${Symlog}`, $.scaleSequentialSymlog, [Continuous, Interpolating]);\n\n// diverging scales\nscale(`${Diverging}-${Linear}`, $.scaleDiverging, [Continuous, Interpolating]);\nscale(`${Diverging}-${Log}`, $.scaleDivergingLog, [Continuous, Interpolating, Log]);\nscale(`${Diverging}-${Pow}`, $.scaleDivergingPow, [Continuous, Interpolating]);\nscale(`${Diverging}-${Sqrt}`, $.scaleDivergingSqrt, [Continuous, Interpolating]);\nscale(`${Diverging}-${Symlog}`, $.scaleDivergingSymlog, [Continuous, Interpolating]);\n\n// discretizing scales\nscale(Quantile, $.scaleQuantile, [Discretizing, Quantile]);\nscale(Quantize, $.scaleQuantize, Discretizing);\nscale(Threshold, $.scaleThreshold, Discretizing);\n\n// discrete scales\nscale(BinOrdinal, scaleBinOrdinal, [Discrete, Discretizing]);\nscale(Ordinal, $.scaleOrdinal, Discrete);\nscale(Band, band, Discrete);\nscale(Point, point, Discrete);\nfunction isValidScaleType(type) {\n return scales.has(type);\n}\nfunction hasType(key, type) {\n const s = scales.get(key);\n return s && s.metadata[type];\n}\nfunction isContinuous(key) {\n return hasType(key, Continuous);\n}\nfunction isDiscrete(key) {\n return hasType(key, Discrete);\n}\nfunction isDiscretizing(key) {\n return hasType(key, Discretizing);\n}\nfunction isLogarithmic(key) {\n return hasType(key, Log);\n}\nfunction isTemporal(key) {\n return hasType(key, Temporal);\n}\nfunction isInterpolating(key) {\n return hasType(key, Interpolating);\n}\nfunction isQuantile(key) {\n return hasType(key, Quantile);\n}\n\nconst scaleProps = ['clamp', 'base', 'constant', 'exponent'];\nfunction interpolateRange(interpolator, range) {\n const start = range[0],\n span = peek(range) - start;\n return function (i) {\n return interpolator(start + i * span);\n };\n}\nfunction interpolateColors(colors, type, gamma) {\n return $$1.piecewise(interpolate(type || 'rgb', gamma), colors);\n}\nfunction quantizeInterpolator(interpolator, count) {\n const samples = new Array(count),\n n = count + 1;\n for (let i = 0; i < count;) samples[i] = interpolator(++i / n);\n return samples;\n}\nfunction scaleCopy(scale) {\n const t = scale.type,\n s = scale.copy();\n s.type = t;\n return s;\n}\nfunction scaleFraction(scale$1, min, max) {\n const delta = max - min;\n let i, t, s;\n if (!delta || !Number.isFinite(delta)) {\n return constant(0.5);\n } else {\n i = (t = scale$1.type).indexOf('-');\n t = i < 0 ? t : t.slice(i + 1);\n s = scale(t)().domain([min, max]).range([0, 1]);\n scaleProps.forEach(m => scale$1[m] ? s[m](scale$1[m]()) : 0);\n return s;\n }\n}\nfunction interpolate(type, gamma) {\n const interp = $$1[method(type)];\n return gamma != null && interp && interp.gamma ? interp.gamma(gamma) : interp;\n}\nfunction method(type) {\n return 'interpolate' + type.toLowerCase().split('-').map(s => s[0].toUpperCase() + s.slice(1)).join('');\n}\n\nconst continuous = {\n blues: 'cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90',\n greens: 'd3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429',\n greys: 'e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e',\n oranges: 'fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303',\n purples: 'e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c',\n reds: 'fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13',\n blueGreen: 'd5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429',\n bluePurple: 'ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71',\n greenBlue: 'd3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1',\n orangeRed: 'fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403',\n purpleBlue: 'dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281',\n purpleBlueGreen: 'dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353',\n purpleRed: 'dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a',\n redPurple: 'fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174',\n yellowGreen: 'e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034',\n yellowOrangeBrown: 'feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204',\n yellowOrangeRed: 'fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225',\n blueOrange: '134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07',\n brownBlueGreen: '704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147',\n purpleGreen: '5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29',\n purpleOrange: '4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07',\n redBlue: '8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85',\n redGrey: '8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434',\n yellowGreenBlue: 'eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185',\n redYellowBlue: 'a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695',\n redYellowGreen: 'a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837',\n pinkYellowGreen: '8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419',\n spectral: '9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2',\n viridis: '440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725',\n magma: '0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf',\n inferno: '0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4',\n plasma: '0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921',\n cividis: '00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647',\n rainbow: '6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa',\n sinebow: 'ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040',\n turbo: '23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00',\n browns: 'eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632',\n tealBlues: 'bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985',\n teals: 'bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667',\n warmGreys: 'dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e',\n goldGreen: 'f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36',\n goldOrange: 'f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26',\n goldRed: 'f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e',\n lightGreyRed: 'efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b',\n lightGreyTeal: 'e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc',\n lightMulti: 'e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c',\n lightOrange: 'f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b',\n lightTealBlue: 'e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988',\n darkBlue: '3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff',\n darkGold: '3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff',\n darkGreen: '3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa',\n darkMulti: '3737371f5287197d8c29a86995ce3fffe800ffffff',\n darkRed: '3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c'\n};\nconst discrete = {\n category10: '1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf',\n category20: '1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5',\n category20b: '393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6',\n category20c: '3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9',\n tableau10: '4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac',\n tableau20: '4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5',\n accent: '7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666',\n dark2: '1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666',\n paired: 'a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928',\n pastel1: 'fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2',\n pastel2: 'b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc',\n set1: 'e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999',\n set2: '66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3',\n set3: '8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f'\n};\n\nfunction colors(palette) {\n const n = palette.length / 6 | 0,\n c = new Array(n);\n for (let i = 0; i < n;) {\n c[i] = '#' + palette.slice(i * 6, ++i * 6);\n }\n return c;\n}\nfunction apply(_, f) {\n for (const k in _) scheme(k, f(_[k]));\n}\nconst schemes = {};\napply(discrete, colors);\napply(continuous, _ => interpolateColors(colors(_)));\nfunction scheme(name, scheme) {\n name = name && name.toLowerCase();\n if (arguments.length > 1) {\n schemes[name] = scheme;\n return this;\n } else {\n return schemes[name];\n }\n}\n\nconst SymbolLegend = 'symbol';\nconst DiscreteLegend = 'discrete';\nconst GradientLegend = 'gradient';\n\nconst defaultFormatter = value => isArray(value) ? value.map(v => String(v)) : String(value);\nconst ascending = (a, b) => a[1] - b[1];\nconst descending = (a, b) => b[1] - a[1];\n\n/**\n * Determine the tick count or interval function.\n * @param {Scale} scale - The scale for which to generate tick values.\n * @param {*} count - The desired tick count or interval specifier.\n * @param {number} minStep - The desired minimum step between tick values.\n * @return {*} - The tick count or interval function.\n */\nfunction tickCount(scale, count, minStep) {\n let step;\n if (isNumber(count)) {\n if (scale.bins) {\n count = Math.max(count, scale.bins.length);\n }\n if (minStep != null) {\n count = Math.min(count, Math.floor(span(scale.domain()) / minStep || 1));\n }\n }\n if (isObject(count)) {\n step = count.step;\n count = count.interval;\n }\n if (isString(count)) {\n count = scale.type === Time ? timeInterval(count) : scale.type == UTC ? utcInterval(count) : error('Only time and utc scales accept interval strings.');\n if (step) count = count.every(step);\n }\n return count;\n}\n\n/**\n * Filter a set of candidate tick values, ensuring that only tick values\n * that lie within the scale range are included.\n * @param {Scale} scale - The scale for which to generate tick values.\n * @param {Array<*>} ticks - The candidate tick values.\n * @param {*} count - The tick count or interval function.\n * @return {Array<*>} - The filtered tick values.\n */\nfunction validTicks(scale, ticks, count) {\n let range = scale.range(),\n lo = range[0],\n hi = peek(range),\n cmp = ascending;\n if (lo > hi) {\n range = hi;\n hi = lo;\n lo = range;\n cmp = descending;\n }\n lo = Math.floor(lo);\n hi = Math.ceil(hi);\n\n // filter ticks to valid values within the range\n // additionally sort ticks in range order (#2579)\n ticks = ticks.map(v => [v, scale(v)]).filter(_ => lo <= _[1] && _[1] <= hi).sort(cmp).map(_ => _[0]);\n if (count > 0 && ticks.length > 1) {\n const endpoints = [ticks[0], peek(ticks)];\n while (ticks.length > count && ticks.length >= 3) {\n ticks = ticks.filter((_, i) => !(i % 2));\n }\n if (ticks.length < 3) {\n ticks = endpoints;\n }\n }\n return ticks;\n}\n\n/**\n * Generate tick values for the given scale and approximate tick count or\n * interval value. If the scale has a 'ticks' method, it will be used to\n * generate the ticks, with the count argument passed as a parameter. If the\n * scale lacks a 'ticks' method, the full scale domain will be returned.\n * @param {Scale} scale - The scale for which to generate tick values.\n * @param {*} [count] - The approximate number of desired ticks.\n * @return {Array<*>} - The generated tick values.\n */\nfunction tickValues(scale, count) {\n return scale.bins ? validTicks(scale, scale.bins) : scale.ticks ? scale.ticks(count) : scale.domain();\n}\n\n/**\n * Generate a label format function for a scale. If the scale has a\n * 'tickFormat' method, it will be used to generate the formatter, with the\n * count and specifier arguments passed as parameters. If the scale lacks a\n * 'tickFormat' method, the returned formatter performs simple string coercion.\n * If the input scale is a logarithmic scale and the format specifier does not\n * indicate a desired decimal precision, a special variable precision formatter\n * that automatically trims trailing zeroes will be generated.\n * @param {Scale} scale - The scale for which to generate the label formatter.\n * @param {*} [count] - The approximate number of desired ticks.\n * @param {string} [specifier] - The format specifier. Must be a legal d3\n * specifier string (see https://github.com/d3/d3-format#formatSpecifier) or\n * time multi-format specifier object.\n * @return {function(*):string} - The generated label formatter.\n */\nfunction tickFormat(locale, scale, count, specifier, formatType, noSkip) {\n const type = scale.type;\n let format = defaultFormatter;\n if (type === Time || formatType === Time) {\n format = locale.timeFormat(specifier);\n } else if (type === UTC || formatType === UTC) {\n format = locale.utcFormat(specifier);\n } else if (isLogarithmic(type)) {\n const varfmt = locale.formatFloat(specifier);\n if (noSkip || scale.bins) {\n format = varfmt;\n } else {\n const test = tickLog(scale, count, false);\n format = _ => test(_) ? varfmt(_) : '';\n }\n } else if (scale.tickFormat) {\n // if d3 scale has tickFormat, it must be continuous\n const d = scale.domain();\n format = locale.formatSpan(d[0], d[d.length - 1], count, specifier);\n } else if (specifier) {\n format = locale.format(specifier);\n }\n return format;\n}\nfunction tickLog(scale, count, values) {\n const ticks = tickValues(scale, count),\n base = scale.base(),\n logb = Math.log(base),\n k = Math.max(1, base * count / ticks.length);\n\n // apply d3-scale's log format filter criteria\n const test = d => {\n let i = d / Math.pow(base, Math.round(Math.log(d) / logb));\n if (i * base < base - 0.5) i *= base;\n return i <= k;\n };\n return values ? ticks.filter(test) : test;\n}\n\nconst symbols = {\n [Quantile]: 'quantiles',\n [Quantize]: 'thresholds',\n [Threshold]: 'domain'\n};\nconst formats = {\n [Quantile]: 'quantiles',\n [Quantize]: 'domain'\n};\nfunction labelValues(scale, count) {\n return scale.bins ? binValues(scale.bins) : scale.type === Log ? tickLog(scale, count, true) : symbols[scale.type] ? thresholdValues(scale[symbols[scale.type]]()) : tickValues(scale, count);\n}\nfunction thresholdFormat(locale, scale, specifier) {\n const _ = scale[formats[scale.type]](),\n n = _.length;\n let d = n > 1 ? _[1] - _[0] : _[0],\n i;\n for (i = 1; i < n; ++i) {\n d = Math.min(d, _[i] - _[i - 1]);\n }\n\n // tickCount = 3 ticks times 10 for increased resolution\n return locale.formatSpan(0, d, 3 * 10, specifier);\n}\nfunction thresholdValues(thresholds) {\n const values = [-Infinity].concat(thresholds);\n values.max = +Infinity;\n return values;\n}\nfunction binValues(bins) {\n const values = bins.slice(0, -1);\n values.max = peek(bins);\n return values;\n}\nconst isDiscreteRange = scale => symbols[scale.type] || scale.bins;\nfunction labelFormat(locale, scale, count, type, specifier, formatType, noSkip) {\n const format = formats[scale.type] && formatType !== Time && formatType !== UTC ? thresholdFormat(locale, scale, specifier) : tickFormat(locale, scale, count, specifier, formatType, noSkip);\n return type === SymbolLegend && isDiscreteRange(scale) ? formatRange(format) : type === DiscreteLegend ? formatDiscrete(format) : formatPoint(format);\n}\nconst formatRange = format => (value, index, array) => {\n const limit = get(array[index + 1], get(array.max, +Infinity)),\n lo = formatValue(value, format),\n hi = formatValue(limit, format);\n return lo && hi ? lo + ' \\u2013 ' + hi : hi ? '< ' + hi : '\\u2265 ' + lo;\n};\nconst get = (value, dflt) => value != null ? value : dflt;\nconst formatDiscrete = format => (value, index) => index ? format(value) : null;\nconst formatPoint = format => value => format(value);\nconst formatValue = (value, format) => Number.isFinite(value) ? format(value) : null;\nfunction labelFraction(scale) {\n const domain = scale.domain(),\n count = domain.length - 1;\n let lo = +domain[0],\n hi = +peek(domain),\n span = hi - lo;\n if (scale.type === Threshold) {\n const adjust = count ? span / count : 0.1;\n lo -= adjust;\n hi += adjust;\n span = hi - lo;\n }\n return value => (value - lo) / span;\n}\n\nfunction format(locale, scale, specifier, formatType) {\n const type = formatType || scale.type;\n\n // replace abbreviated time specifiers to improve screen reader experience\n if (isString(specifier) && isTemporal(type)) {\n specifier = specifier.replace(/%a/g, '%A').replace(/%b/g, '%B');\n }\n return !specifier && type === Time ? locale.timeFormat('%A, %d %B %Y, %X') : !specifier && type === UTC ? locale.utcFormat('%A, %d %B %Y, %X UTC') : labelFormat(locale, scale, 5, null, specifier, formatType, true);\n}\nfunction domainCaption(locale, scale, opt) {\n opt = opt || {};\n const max = Math.max(3, opt.maxlen || 7),\n fmt = format(locale, scale, opt.format, opt.formatType);\n\n // if scale breaks domain into bins, describe boundaries\n if (isDiscretizing(scale.type)) {\n const v = labelValues(scale).slice(1).map(fmt),\n n = v.length;\n return `${n} boundar${n === 1 ? 'y' : 'ies'}: ${v.join(', ')}`;\n }\n\n // if scale domain is discrete, list values\n else if (isDiscrete(scale.type)) {\n const d = scale.domain(),\n n = d.length,\n v = n > max ? d.slice(0, max - 2).map(fmt).join(', ') + ', ending with ' + d.slice(-1).map(fmt) : d.map(fmt).join(', ');\n return `${n} value${n === 1 ? '' : 's'}: ${v}`;\n }\n\n // if scale domain is continuous, describe value range\n else {\n const d = scale.domain();\n return `values from ${fmt(d[0])} to ${fmt(peek(d))}`;\n }\n}\n\nexport { Band, BinOrdinal, DiscreteLegend, Diverging, GradientLegend, Identity, Linear, Log, Ordinal, Point, Pow, Quantile, Quantize, Sequential, Sqrt, SymbolLegend, Symlog, Threshold, Time, UTC, bandSpace, domainCaption, interpolate, interpolateColors, interpolateRange, isContinuous, isDiscrete, isDiscretizing, isInterpolating, isLogarithmic, isQuantile, isRegisteredScale, isTemporal, isValidScaleType, labelFormat, labelFraction, labelValues, quantizeInterpolator, registerScale, scale, scaleCopy, scaleFraction, scheme, tickCount, tickFormat, tickValues, validTicks };\n","import {linearish} from \"./linear.js\";\nimport number from \"./number.js\";\n\nexport default function identity(domain) {\n var unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = Array.from(_, number), scale) : domain.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return identity(domain).unknown(unknown);\n };\n\n domain = arguments.length ? Array.from(domain, number) : [0, 1];\n\n return linearish(scale);\n}\n","import {utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcTicks, utcTickInterval} from \"d3-time\";\nimport {utcFormat} from \"d3-time-format\";\nimport {calendar} from \"./time.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function utcTime() {\n return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);\n}\n","import {ascending, bisect, quantileSorted as threshold} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantile() {\n var domain = [],\n range = [],\n thresholds = [],\n unknown;\n\n function rescale() {\n var i = 0, n = Math.max(1, range.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = threshold(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : range[bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n","import {bisect} from \"d3-array\";\nimport {linearish} from \"./linear.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1],\n unknown;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : scale;\n };\n\n scale.thresholds = function() {\n return domain.slice();\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(linearish(scale), arguments);\n}\n","import {bisect} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function threshold() {\n var domain = [0.5],\n range = [0, 1],\n unknown,\n n = 1;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n","import { hasOwnProperty, isFunction, inherits, truthy, lruCache, isArray, error, toSet, array, peek, extend, isNumber, isObject } from 'vega-util';\nimport { curveBasis, curveBasisClosed, curveBasisOpen, curveBundle, curveCardinal, curveCardinalOpen, curveCardinalClosed, curveCatmullRom, curveCatmullRomClosed, curveCatmullRomOpen, curveLinear, curveLinearClosed, curveMonotoneY, curveMonotoneX, curveNatural, curveStep, curveStepAfter, curveStepBefore, arc as arc$2, area as area$2, line as line$2, symbol as symbol$2 } from 'd3-shape';\nimport { path as path$3 } from 'd3-path';\nexport { path } from 'd3-path';\nimport { image as image$1, canvas } from 'vega-canvas';\nimport { loader } from 'vega-loader';\nimport { isDiscrete, domainCaption } from 'vega-scale';\n\nlet gradient_id = 0;\nfunction resetSVGGradientId() {\n gradient_id = 0;\n}\nconst patternPrefix = 'p_';\nfunction isGradient(value) {\n return value && value.gradient;\n}\nfunction gradientRef(g, defs, base) {\n const type = g.gradient;\n let id = g.id,\n prefix = type === 'radial' ? patternPrefix : '';\n\n // check id, assign default values as needed\n if (!id) {\n id = g.id = 'gradient_' + gradient_id++;\n if (type === 'radial') {\n g.x1 = get(g.x1, 0.5);\n g.y1 = get(g.y1, 0.5);\n g.r1 = get(g.r1, 0);\n g.x2 = get(g.x2, 0.5);\n g.y2 = get(g.y2, 0.5);\n g.r2 = get(g.r2, 0.5);\n prefix = patternPrefix;\n } else {\n g.x1 = get(g.x1, 0);\n g.y1 = get(g.y1, 0);\n g.x2 = get(g.x2, 1);\n g.y2 = get(g.y2, 0);\n }\n }\n\n // register definition\n defs[id] = g;\n\n // return url reference\n return 'url(' + (base || '') + '#' + prefix + id + ')';\n}\nfunction get(val, def) {\n return val != null ? val : def;\n}\nfunction Gradient (p0, p1) {\n var stops = [],\n gradient;\n return gradient = {\n gradient: 'linear',\n x1: p0 ? p0[0] : 0,\n y1: p0 ? p0[1] : 0,\n x2: p1 ? p1[0] : 1,\n y2: p1 ? p1[1] : 0,\n stops: stops,\n stop: function (offset, color) {\n stops.push({\n offset: offset,\n color: color\n });\n return gradient;\n }\n };\n}\n\nconst lookup = {\n 'basis': {\n curve: curveBasis\n },\n 'basis-closed': {\n curve: curveBasisClosed\n },\n 'basis-open': {\n curve: curveBasisOpen\n },\n 'bundle': {\n curve: curveBundle,\n tension: 'beta',\n value: 0.85\n },\n 'cardinal': {\n curve: curveCardinal,\n tension: 'tension',\n value: 0\n },\n 'cardinal-open': {\n curve: curveCardinalOpen,\n tension: 'tension',\n value: 0\n },\n 'cardinal-closed': {\n curve: curveCardinalClosed,\n tension: 'tension',\n value: 0\n },\n 'catmull-rom': {\n curve: curveCatmullRom,\n tension: 'alpha',\n value: 0.5\n },\n 'catmull-rom-closed': {\n curve: curveCatmullRomClosed,\n tension: 'alpha',\n value: 0.5\n },\n 'catmull-rom-open': {\n curve: curveCatmullRomOpen,\n tension: 'alpha',\n value: 0.5\n },\n 'linear': {\n curve: curveLinear\n },\n 'linear-closed': {\n curve: curveLinearClosed\n },\n 'monotone': {\n horizontal: curveMonotoneY,\n vertical: curveMonotoneX\n },\n 'natural': {\n curve: curveNatural\n },\n 'step': {\n curve: curveStep\n },\n 'step-after': {\n curve: curveStepAfter\n },\n 'step-before': {\n curve: curveStepBefore\n }\n};\nfunction curves(type, orientation, tension) {\n var entry = hasOwnProperty(lookup, type) && lookup[type],\n curve = null;\n if (entry) {\n curve = entry.curve || entry[orientation || 'vertical'];\n if (entry.tension && tension != null) {\n curve = curve[entry.tension](tension);\n }\n }\n return curve;\n}\n\nconst paramCounts = {\n m: 2,\n l: 2,\n h: 1,\n v: 1,\n z: 0,\n c: 6,\n s: 4,\n q: 4,\n t: 2,\n a: 7\n};\nconst commandPattern = /[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi;\nconst numberPattern = /^[+-]?(([0-9]*\\.[0-9]+)|([0-9]+\\.)|([0-9]+))([eE][+-]?[0-9]+)?/;\nconst spacePattern = /^((\\s+,?\\s*)|(,\\s*))/;\nconst flagPattern = /^[01]/;\nfunction parse(path) {\n const commands = [];\n const matches = path.match(commandPattern) || [];\n matches.forEach(str => {\n let cmd = str[0];\n const type = cmd.toLowerCase();\n\n // parse parameters\n const paramCount = paramCounts[type];\n const params = parseParams(type, paramCount, str.slice(1).trim());\n const count = params.length;\n\n // error checking based on parameter count\n if (count < paramCount || count && count % paramCount !== 0) {\n throw Error('Invalid SVG path, incorrect parameter count');\n }\n\n // register the command\n commands.push([cmd, ...params.slice(0, paramCount)]);\n\n // exit now if we're done, also handles zero-param 'z'\n if (count === paramCount) {\n return;\n }\n\n // handle implicit line-to\n if (type === 'm') {\n cmd = cmd === 'M' ? 'L' : 'l';\n }\n\n // repeat command when given extended param list\n for (let i = paramCount; i < count; i += paramCount) {\n commands.push([cmd, ...params.slice(i, i + paramCount)]);\n }\n });\n return commands;\n}\nfunction parseParams(type, paramCount, segment) {\n const params = [];\n for (let index = 0; paramCount && index < segment.length;) {\n for (let i = 0; i < paramCount; ++i) {\n const pattern = type === 'a' && (i === 3 || i === 4) ? flagPattern : numberPattern;\n const match = segment.slice(index).match(pattern);\n if (match === null) {\n throw Error('Invalid SVG path, incorrect parameter type');\n }\n index += match[0].length;\n params.push(+match[0]);\n const ws = segment.slice(index).match(spacePattern);\n if (ws !== null) {\n index += ws[0].length;\n }\n }\n }\n return params;\n}\n\nconst DegToRad = Math.PI / 180;\nconst Epsilon = 1e-14;\nconst HalfPi = Math.PI / 2;\nconst Tau = Math.PI * 2;\nconst HalfSqrt3 = Math.sqrt(3) / 2;\n\nvar segmentCache = {};\nvar bezierCache = {};\nvar join = [].join;\n\n// Copied from Inkscape svgtopdf, thanks!\nfunction segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {\n const key = join.call(arguments);\n if (segmentCache[key]) {\n return segmentCache[key];\n }\n const th = rotateX * DegToRad;\n const sin_th = Math.sin(th);\n const cos_th = Math.cos(th);\n rx = Math.abs(rx);\n ry = Math.abs(ry);\n const px = cos_th * (ox - x) * 0.5 + sin_th * (oy - y) * 0.5;\n const py = cos_th * (oy - y) * 0.5 - sin_th * (ox - x) * 0.5;\n let pl = px * px / (rx * rx) + py * py / (ry * ry);\n if (pl > 1) {\n pl = Math.sqrt(pl);\n rx *= pl;\n ry *= pl;\n }\n const a00 = cos_th / rx;\n const a01 = sin_th / rx;\n const a10 = -sin_th / ry;\n const a11 = cos_th / ry;\n const x0 = a00 * ox + a01 * oy;\n const y0 = a10 * ox + a11 * oy;\n const x1 = a00 * x + a01 * y;\n const y1 = a10 * x + a11 * y;\n const d = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0);\n let sfactor_sq = 1 / d - 0.25;\n if (sfactor_sq < 0) sfactor_sq = 0;\n let sfactor = Math.sqrt(sfactor_sq);\n if (sweep == large) sfactor = -sfactor;\n const xc = 0.5 * (x0 + x1) - sfactor * (y1 - y0);\n const yc = 0.5 * (y0 + y1) + sfactor * (x1 - x0);\n const th0 = Math.atan2(y0 - yc, x0 - xc);\n const th1 = Math.atan2(y1 - yc, x1 - xc);\n let th_arc = th1 - th0;\n if (th_arc < 0 && sweep === 1) {\n th_arc += Tau;\n } else if (th_arc > 0 && sweep === 0) {\n th_arc -= Tau;\n }\n const segs = Math.ceil(Math.abs(th_arc / (HalfPi + 0.001)));\n const result = [];\n for (let i = 0; i < segs; ++i) {\n const th2 = th0 + i * th_arc / segs;\n const th3 = th0 + (i + 1) * th_arc / segs;\n result[i] = [xc, yc, th2, th3, rx, ry, sin_th, cos_th];\n }\n return segmentCache[key] = result;\n}\nfunction bezier(params) {\n const key = join.call(params);\n if (bezierCache[key]) {\n return bezierCache[key];\n }\n var cx = params[0],\n cy = params[1],\n th0 = params[2],\n th1 = params[3],\n rx = params[4],\n ry = params[5],\n sin_th = params[6],\n cos_th = params[7];\n const a00 = cos_th * rx;\n const a01 = -sin_th * ry;\n const a10 = sin_th * rx;\n const a11 = cos_th * ry;\n const cos_th0 = Math.cos(th0);\n const sin_th0 = Math.sin(th0);\n const cos_th1 = Math.cos(th1);\n const sin_th1 = Math.sin(th1);\n const th_half = 0.5 * (th1 - th0);\n const sin_th_h2 = Math.sin(th_half * 0.5);\n const t = 8 / 3 * sin_th_h2 * sin_th_h2 / Math.sin(th_half);\n const x1 = cx + cos_th0 - t * sin_th0;\n const y1 = cy + sin_th0 + t * cos_th0;\n const x3 = cx + cos_th1;\n const y3 = cy + sin_th1;\n const x2 = x3 + t * sin_th1;\n const y2 = y3 - t * cos_th1;\n return bezierCache[key] = [a00 * x1 + a01 * y1, a10 * x1 + a11 * y1, a00 * x2 + a01 * y2, a10 * x2 + a11 * y2, a00 * x3 + a01 * y3, a10 * x3 + a11 * y3];\n}\n\nconst temp = ['l', 0, 0, 0, 0, 0, 0, 0];\nfunction scale$1(current, sX, sY) {\n const c = temp[0] = current[0];\n if (c === 'a' || c === 'A') {\n temp[1] = sX * current[1];\n temp[2] = sY * current[2];\n temp[3] = current[3];\n temp[4] = current[4];\n temp[5] = current[5];\n temp[6] = sX * current[6];\n temp[7] = sY * current[7];\n } else if (c === 'h' || c === 'H') {\n temp[1] = sX * current[1];\n } else if (c === 'v' || c === 'V') {\n temp[1] = sY * current[1];\n } else {\n for (var i = 1, n = current.length; i < n; ++i) {\n temp[i] = (i % 2 == 1 ? sX : sY) * current[i];\n }\n }\n return temp;\n}\nfunction pathRender (context, path, l, t, sX, sY) {\n var current,\n // current instruction\n previous = null,\n x = 0,\n // current x\n y = 0,\n // current y\n controlX = 0,\n // current control point x\n controlY = 0,\n // current control point y\n tempX,\n tempY,\n tempControlX,\n tempControlY,\n anchorX = 0,\n anchorY = 0;\n if (l == null) l = 0;\n if (t == null) t = 0;\n if (sX == null) sX = 1;\n if (sY == null) sY = sX;\n if (context.beginPath) context.beginPath();\n for (var i = 0, len = path.length; i < len; ++i) {\n current = path[i];\n if (sX !== 1 || sY !== 1) {\n current = scale$1(current, sX, sY);\n }\n switch (current[0]) {\n // first letter\n\n case 'l':\n // lineto, relative\n x += current[1];\n y += current[2];\n context.lineTo(x + l, y + t);\n break;\n case 'L':\n // lineto, absolute\n x = current[1];\n y = current[2];\n context.lineTo(x + l, y + t);\n break;\n case 'h':\n // horizontal lineto, relative\n x += current[1];\n context.lineTo(x + l, y + t);\n break;\n case 'H':\n // horizontal lineto, absolute\n x = current[1];\n context.lineTo(x + l, y + t);\n break;\n case 'v':\n // vertical lineto, relative\n y += current[1];\n context.lineTo(x + l, y + t);\n break;\n case 'V':\n // verical lineto, absolute\n y = current[1];\n context.lineTo(x + l, y + t);\n break;\n case 'm':\n // moveTo, relative\n x += current[1];\n y += current[2];\n anchorX = x;\n anchorY = y;\n context.moveTo(x + l, y + t);\n break;\n case 'M':\n // moveTo, absolute\n x = current[1];\n y = current[2];\n anchorX = x;\n anchorY = y;\n context.moveTo(x + l, y + t);\n break;\n case 'c':\n // bezierCurveTo, relative\n tempX = x + current[5];\n tempY = y + current[6];\n controlX = x + current[3];\n controlY = y + current[4];\n context.bezierCurveTo(x + current[1] + l,\n // x1\n y + current[2] + t,\n // y1\n controlX + l,\n // x2\n controlY + t,\n // y2\n tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n case 'C':\n // bezierCurveTo, absolute\n x = current[5];\n y = current[6];\n controlX = current[3];\n controlY = current[4];\n context.bezierCurveTo(current[1] + l, current[2] + t, controlX + l, controlY + t, x + l, y + t);\n break;\n case 's':\n // shorthand cubic bezierCurveTo, relative\n // transform to absolute x,y\n tempX = x + current[3];\n tempY = y + current[4];\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n context.bezierCurveTo(controlX + l, controlY + t, x + current[1] + l, y + current[2] + t, tempX + l, tempY + t);\n\n // set control point to 2nd one of this command\n // the first control point is assumed to be the reflection of\n // the second control point on the previous command relative\n // to the current point.\n controlX = x + current[1];\n controlY = y + current[2];\n x = tempX;\n y = tempY;\n break;\n case 'S':\n // shorthand cubic bezierCurveTo, absolute\n tempX = current[3];\n tempY = current[4];\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n context.bezierCurveTo(controlX + l, controlY + t, current[1] + l, current[2] + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n // set control point to 2nd one of this command\n // the first control point is assumed to be the reflection of\n // the second control point on the previous command relative\n // to the current point.\n controlX = current[1];\n controlY = current[2];\n break;\n case 'q':\n // quadraticCurveTo, relative\n // transform to absolute x,y\n tempX = x + current[3];\n tempY = y + current[4];\n controlX = x + current[1];\n controlY = y + current[2];\n context.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n case 'Q':\n // quadraticCurveTo, absolute\n tempX = current[3];\n tempY = current[4];\n context.quadraticCurveTo(current[1] + l, current[2] + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n controlX = current[1];\n controlY = current[2];\n break;\n case 't':\n // shorthand quadraticCurveTo, relative\n\n // transform to absolute x,y\n tempX = x + current[1];\n tempY = y + current[2];\n if (previous[0].match(/[QqTt]/) === null) {\n // If there is no previous command or if the previous command was not a Q, q, T or t,\n // assume the control point is coincident with the current point\n controlX = x;\n controlY = y;\n } else if (previous[0] === 't') {\n // calculate reflection of previous control points for t\n controlX = 2 * x - tempControlX;\n controlY = 2 * y - tempControlY;\n } else if (previous[0] === 'q') {\n // calculate reflection of previous control points for q\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n }\n tempControlX = controlX;\n tempControlY = controlY;\n context.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n controlX = x + current[1];\n controlY = y + current[2];\n break;\n case 'T':\n tempX = current[1];\n tempY = current[2];\n\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n context.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n case 'a':\n drawArc(context, x + l, y + t, [current[1], current[2], current[3], current[4], current[5], current[6] + x + l, current[7] + y + t]);\n x += current[6];\n y += current[7];\n break;\n case 'A':\n drawArc(context, x + l, y + t, [current[1], current[2], current[3], current[4], current[5], current[6] + l, current[7] + t]);\n x = current[6];\n y = current[7];\n break;\n case 'z':\n case 'Z':\n x = anchorX;\n y = anchorY;\n context.closePath();\n break;\n }\n previous = current;\n }\n}\nfunction drawArc(context, x, y, coords) {\n const seg = segments(coords[5],\n // end x\n coords[6],\n // end y\n coords[0],\n // radius x\n coords[1],\n // radius y\n coords[3],\n // large flag\n coords[4],\n // sweep flag\n coords[2],\n // rotation\n x, y);\n for (let i = 0; i < seg.length; ++i) {\n const bez = bezier(seg[i]);\n context.bezierCurveTo(bez[0], bez[1], bez[2], bez[3], bez[4], bez[5]);\n }\n}\n\nconst Tan30 = 0.5773502691896257;\nconst builtins = {\n 'circle': {\n draw: function (context, size) {\n const r = Math.sqrt(size) / 2;\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, Tau);\n }\n },\n 'cross': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n s = r / 2.5;\n context.moveTo(-r, -s);\n context.lineTo(-r, s);\n context.lineTo(-s, s);\n context.lineTo(-s, r);\n context.lineTo(s, r);\n context.lineTo(s, s);\n context.lineTo(r, s);\n context.lineTo(r, -s);\n context.lineTo(s, -s);\n context.lineTo(s, -r);\n context.lineTo(-s, -r);\n context.lineTo(-s, -s);\n context.closePath();\n }\n },\n 'diamond': {\n draw: function (context, size) {\n const r = Math.sqrt(size) / 2;\n context.moveTo(-r, 0);\n context.lineTo(0, -r);\n context.lineTo(r, 0);\n context.lineTo(0, r);\n context.closePath();\n }\n },\n 'square': {\n draw: function (context, size) {\n var w = Math.sqrt(size),\n x = -w / 2;\n context.rect(x, x, w, w);\n }\n },\n 'arrow': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n s = r / 7,\n t = r / 2.5,\n v = r / 8;\n context.moveTo(-s, r);\n context.lineTo(s, r);\n context.lineTo(s, -v);\n context.lineTo(t, -v);\n context.lineTo(0, -r);\n context.lineTo(-t, -v);\n context.lineTo(-s, -v);\n context.closePath();\n }\n },\n 'wedge': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r,\n o = h - r * Tan30,\n b = r / 4;\n context.moveTo(0, -h - o);\n context.lineTo(-b, h - o);\n context.lineTo(b, h - o);\n context.closePath();\n }\n },\n 'triangle': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r,\n o = h - r * Tan30;\n context.moveTo(0, -h - o);\n context.lineTo(-r, h - o);\n context.lineTo(r, h - o);\n context.closePath();\n }\n },\n 'triangle-up': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(0, -h);\n context.lineTo(-r, h);\n context.lineTo(r, h);\n context.closePath();\n }\n },\n 'triangle-down': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(0, h);\n context.lineTo(-r, -h);\n context.lineTo(r, -h);\n context.closePath();\n }\n },\n 'triangle-right': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(h, 0);\n context.lineTo(-h, -r);\n context.lineTo(-h, r);\n context.closePath();\n }\n },\n 'triangle-left': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(-h, 0);\n context.lineTo(h, -r);\n context.lineTo(h, r);\n context.closePath();\n }\n },\n 'stroke': {\n draw: function (context, size) {\n const r = Math.sqrt(size) / 2;\n context.moveTo(-r, 0);\n context.lineTo(r, 0);\n }\n }\n};\nfunction symbols(_) {\n return hasOwnProperty(builtins, _) ? builtins[_] : customSymbol(_);\n}\nvar custom = {};\nfunction customSymbol(path) {\n if (!hasOwnProperty(custom, path)) {\n const parsed = parse(path);\n custom[path] = {\n draw: function (context, size) {\n pathRender(context, parsed, 0, 0, Math.sqrt(size) / 2);\n }\n };\n }\n return custom[path];\n}\n\n// See http://spencermortensen.com/articles/bezier-circle/\nconst C = 0.448084975506; // C = 1 - c\n\nfunction rectangleX(d) {\n return d.x;\n}\nfunction rectangleY(d) {\n return d.y;\n}\nfunction rectangleWidth(d) {\n return d.width;\n}\nfunction rectangleHeight(d) {\n return d.height;\n}\nfunction number(_) {\n return typeof _ === 'function' ? _ : () => +_;\n}\nfunction clamp(value, min, max) {\n return Math.max(min, Math.min(value, max));\n}\nfunction vg_rect () {\n var x = rectangleX,\n y = rectangleY,\n width = rectangleWidth,\n height = rectangleHeight,\n crTL = number(0),\n crTR = crTL,\n crBL = crTL,\n crBR = crTL,\n context = null;\n function rectangle(_, x0, y0) {\n var buffer,\n x1 = x0 != null ? x0 : +x.call(this, _),\n y1 = y0 != null ? y0 : +y.call(this, _),\n w = +width.call(this, _),\n h = +height.call(this, _),\n s = Math.min(w, h) / 2,\n tl = clamp(+crTL.call(this, _), 0, s),\n tr = clamp(+crTR.call(this, _), 0, s),\n bl = clamp(+crBL.call(this, _), 0, s),\n br = clamp(+crBR.call(this, _), 0, s);\n if (!context) context = buffer = path$3();\n if (tl <= 0 && tr <= 0 && bl <= 0 && br <= 0) {\n context.rect(x1, y1, w, h);\n } else {\n var x2 = x1 + w,\n y2 = y1 + h;\n context.moveTo(x1 + tl, y1);\n context.lineTo(x2 - tr, y1);\n context.bezierCurveTo(x2 - C * tr, y1, x2, y1 + C * tr, x2, y1 + tr);\n context.lineTo(x2, y2 - br);\n context.bezierCurveTo(x2, y2 - C * br, x2 - C * br, y2, x2 - br, y2);\n context.lineTo(x1 + bl, y2);\n context.bezierCurveTo(x1 + C * bl, y2, x1, y2 - C * bl, x1, y2 - bl);\n context.lineTo(x1, y1 + tl);\n context.bezierCurveTo(x1, y1 + C * tl, x1 + C * tl, y1, x1 + tl, y1);\n context.closePath();\n }\n if (buffer) {\n context = null;\n return buffer + '' || null;\n }\n }\n rectangle.x = function (_) {\n if (arguments.length) {\n x = number(_);\n return rectangle;\n } else {\n return x;\n }\n };\n rectangle.y = function (_) {\n if (arguments.length) {\n y = number(_);\n return rectangle;\n } else {\n return y;\n }\n };\n rectangle.width = function (_) {\n if (arguments.length) {\n width = number(_);\n return rectangle;\n } else {\n return width;\n }\n };\n rectangle.height = function (_) {\n if (arguments.length) {\n height = number(_);\n return rectangle;\n } else {\n return height;\n }\n };\n rectangle.cornerRadius = function (tl, tr, br, bl) {\n if (arguments.length) {\n crTL = number(tl);\n crTR = tr != null ? number(tr) : crTL;\n crBR = br != null ? number(br) : crTL;\n crBL = bl != null ? number(bl) : crTR;\n return rectangle;\n } else {\n return crTL;\n }\n };\n rectangle.context = function (_) {\n if (arguments.length) {\n context = _ == null ? null : _;\n return rectangle;\n } else {\n return context;\n }\n };\n return rectangle;\n}\n\nfunction vg_trail () {\n var x,\n y,\n size,\n defined,\n context = null,\n ready,\n x1,\n y1,\n r1;\n function point(x2, y2, w2) {\n const r2 = w2 / 2;\n if (ready) {\n var ux = y1 - y2,\n uy = x2 - x1;\n if (ux || uy) {\n // get normal vector\n var ud = Math.sqrt(ux * ux + uy * uy),\n rx = (ux /= ud) * r1,\n ry = (uy /= ud) * r1,\n t = Math.atan2(uy, ux);\n\n // draw segment\n context.moveTo(x1 - rx, y1 - ry);\n context.lineTo(x2 - ux * r2, y2 - uy * r2);\n context.arc(x2, y2, r2, t - Math.PI, t);\n context.lineTo(x1 + rx, y1 + ry);\n context.arc(x1, y1, r1, t, t + Math.PI);\n } else {\n context.arc(x2, y2, r2, 0, Tau);\n }\n context.closePath();\n } else {\n ready = 1;\n }\n x1 = x2;\n y1 = y2;\n r1 = r2;\n }\n function trail(data) {\n var i,\n n = data.length,\n d,\n defined0 = false,\n buffer;\n if (context == null) context = buffer = path$3();\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) ready = 0;\n }\n if (defined0) point(+x(d, i, data), +y(d, i, data), +size(d, i, data));\n }\n if (buffer) {\n context = null;\n return buffer + '' || null;\n }\n }\n trail.x = function (_) {\n if (arguments.length) {\n x = _;\n return trail;\n } else {\n return x;\n }\n };\n trail.y = function (_) {\n if (arguments.length) {\n y = _;\n return trail;\n } else {\n return y;\n }\n };\n trail.size = function (_) {\n if (arguments.length) {\n size = _;\n return trail;\n } else {\n return size;\n }\n };\n trail.defined = function (_) {\n if (arguments.length) {\n defined = _;\n return trail;\n } else {\n return defined;\n }\n };\n trail.context = function (_) {\n if (arguments.length) {\n if (_ == null) {\n context = null;\n } else {\n context = _;\n }\n return trail;\n } else {\n return context;\n }\n };\n return trail;\n}\n\nfunction value$1(a, b) {\n return a != null ? a : b;\n}\nconst x = item => item.x || 0,\n y = item => item.y || 0,\n w = item => item.width || 0,\n h = item => item.height || 0,\n xw = item => (item.x || 0) + (item.width || 0),\n yh = item => (item.y || 0) + (item.height || 0),\n sa = item => item.startAngle || 0,\n ea = item => item.endAngle || 0,\n pa = item => item.padAngle || 0,\n ir = item => item.innerRadius || 0,\n or = item => item.outerRadius || 0,\n cr = item => item.cornerRadius || 0,\n tl = item => value$1(item.cornerRadiusTopLeft, item.cornerRadius) || 0,\n tr = item => value$1(item.cornerRadiusTopRight, item.cornerRadius) || 0,\n br = item => value$1(item.cornerRadiusBottomRight, item.cornerRadius) || 0,\n bl = item => value$1(item.cornerRadiusBottomLeft, item.cornerRadius) || 0,\n sz = item => value$1(item.size, 64),\n ts = item => item.size || 1,\n def = item => !(item.defined === false),\n type = item => symbols(item.shape || 'circle');\nconst arcShape = arc$2().startAngle(sa).endAngle(ea).padAngle(pa).innerRadius(ir).outerRadius(or).cornerRadius(cr),\n areavShape = area$2().x(x).y1(y).y0(yh).defined(def),\n areahShape = area$2().y(y).x1(x).x0(xw).defined(def),\n lineShape = line$2().x(x).y(y).defined(def),\n rectShape = vg_rect().x(x).y(y).width(w).height(h).cornerRadius(tl, tr, br, bl),\n symbolShape = symbol$2().type(type).size(sz),\n trailShape = vg_trail().x(x).y(y).defined(def).size(ts);\nfunction hasCornerRadius(item) {\n return item.cornerRadius || item.cornerRadiusTopLeft || item.cornerRadiusTopRight || item.cornerRadiusBottomRight || item.cornerRadiusBottomLeft;\n}\nfunction arc$1(context, item) {\n return arcShape.context(context)(item);\n}\nfunction area$1(context, items) {\n const item = items[0],\n interp = item.interpolate || 'linear';\n return (item.orient === 'horizontal' ? areahShape : areavShape).curve(curves(interp, item.orient, item.tension)).context(context)(items);\n}\nfunction line$1(context, items) {\n const item = items[0],\n interp = item.interpolate || 'linear';\n return lineShape.curve(curves(interp, item.orient, item.tension)).context(context)(items);\n}\nfunction rectangle(context, item, x, y) {\n return rectShape.context(context)(item, x, y);\n}\nfunction shape$1(context, item) {\n return (item.mark.shape || item.shape).context(context)(item);\n}\nfunction symbol$1(context, item) {\n return symbolShape.context(context)(item);\n}\nfunction trail$1(context, items) {\n return trailShape.context(context)(items);\n}\n\nvar clip_id = 1;\nfunction resetSVGClipId() {\n clip_id = 1;\n}\nfunction clip$1 (renderer, item, size) {\n var clip = item.clip,\n defs = renderer._defs,\n id = item.clip_id || (item.clip_id = 'clip' + clip_id++),\n c = defs.clipping[id] || (defs.clipping[id] = {\n id: id\n });\n if (isFunction(clip)) {\n c.path = clip(null);\n } else if (hasCornerRadius(size)) {\n c.path = rectangle(null, size, 0, 0);\n } else {\n c.width = size.width || 0;\n c.height = size.height || 0;\n }\n return 'url(#' + id + ')';\n}\n\nfunction Bounds(b) {\n this.clear();\n if (b) this.union(b);\n}\nBounds.prototype = {\n clone() {\n return new Bounds(this);\n },\n clear() {\n this.x1 = +Number.MAX_VALUE;\n this.y1 = +Number.MAX_VALUE;\n this.x2 = -Number.MAX_VALUE;\n this.y2 = -Number.MAX_VALUE;\n return this;\n },\n empty() {\n return this.x1 === +Number.MAX_VALUE && this.y1 === +Number.MAX_VALUE && this.x2 === -Number.MAX_VALUE && this.y2 === -Number.MAX_VALUE;\n },\n equals(b) {\n return this.x1 === b.x1 && this.y1 === b.y1 && this.x2 === b.x2 && this.y2 === b.y2;\n },\n set(x1, y1, x2, y2) {\n if (x2 < x1) {\n this.x2 = x1;\n this.x1 = x2;\n } else {\n this.x1 = x1;\n this.x2 = x2;\n }\n if (y2 < y1) {\n this.y2 = y1;\n this.y1 = y2;\n } else {\n this.y1 = y1;\n this.y2 = y2;\n }\n return this;\n },\n add(x, y) {\n if (x < this.x1) this.x1 = x;\n if (y < this.y1) this.y1 = y;\n if (x > this.x2) this.x2 = x;\n if (y > this.y2) this.y2 = y;\n return this;\n },\n expand(d) {\n this.x1 -= d;\n this.y1 -= d;\n this.x2 += d;\n this.y2 += d;\n return this;\n },\n round() {\n this.x1 = Math.floor(this.x1);\n this.y1 = Math.floor(this.y1);\n this.x2 = Math.ceil(this.x2);\n this.y2 = Math.ceil(this.y2);\n return this;\n },\n scale(s) {\n this.x1 *= s;\n this.y1 *= s;\n this.x2 *= s;\n this.y2 *= s;\n return this;\n },\n translate(dx, dy) {\n this.x1 += dx;\n this.x2 += dx;\n this.y1 += dy;\n this.y2 += dy;\n return this;\n },\n rotate(angle, x, y) {\n const p = this.rotatedPoints(angle, x, y);\n return this.clear().add(p[0], p[1]).add(p[2], p[3]).add(p[4], p[5]).add(p[6], p[7]);\n },\n rotatedPoints(angle, x, y) {\n var {\n x1,\n y1,\n x2,\n y2\n } = this,\n cos = Math.cos(angle),\n sin = Math.sin(angle),\n cx = x - x * cos + y * sin,\n cy = y - x * sin - y * cos;\n return [cos * x1 - sin * y1 + cx, sin * x1 + cos * y1 + cy, cos * x1 - sin * y2 + cx, sin * x1 + cos * y2 + cy, cos * x2 - sin * y1 + cx, sin * x2 + cos * y1 + cy, cos * x2 - sin * y2 + cx, sin * x2 + cos * y2 + cy];\n },\n union(b) {\n if (b.x1 < this.x1) this.x1 = b.x1;\n if (b.y1 < this.y1) this.y1 = b.y1;\n if (b.x2 > this.x2) this.x2 = b.x2;\n if (b.y2 > this.y2) this.y2 = b.y2;\n return this;\n },\n intersect(b) {\n if (b.x1 > this.x1) this.x1 = b.x1;\n if (b.y1 > this.y1) this.y1 = b.y1;\n if (b.x2 < this.x2) this.x2 = b.x2;\n if (b.y2 < this.y2) this.y2 = b.y2;\n return this;\n },\n encloses(b) {\n return b && this.x1 <= b.x1 && this.x2 >= b.x2 && this.y1 <= b.y1 && this.y2 >= b.y2;\n },\n alignsWith(b) {\n return b && (this.x1 == b.x1 || this.x2 == b.x2 || this.y1 == b.y1 || this.y2 == b.y2);\n },\n intersects(b) {\n return b && !(this.x2 < b.x1 || this.x1 > b.x2 || this.y2 < b.y1 || this.y1 > b.y2);\n },\n contains(x, y) {\n return !(x < this.x1 || x > this.x2 || y < this.y1 || y > this.y2);\n },\n width() {\n return this.x2 - this.x1;\n },\n height() {\n return this.y2 - this.y1;\n }\n};\n\nfunction Item(mark) {\n this.mark = mark;\n this.bounds = this.bounds || new Bounds();\n}\n\nfunction GroupItem(mark) {\n Item.call(this, mark);\n this.items = this.items || [];\n}\ninherits(GroupItem, Item);\n\nfunction ResourceLoader(customLoader) {\n this._pending = 0;\n this._loader = customLoader || loader();\n}\nfunction increment(loader) {\n loader._pending += 1;\n}\nfunction decrement(loader) {\n loader._pending -= 1;\n}\nResourceLoader.prototype = {\n pending() {\n return this._pending;\n },\n sanitizeURL(uri) {\n const loader = this;\n increment(loader);\n return loader._loader.sanitize(uri, {\n context: 'href'\n }).then(opt => {\n decrement(loader);\n return opt;\n }).catch(() => {\n decrement(loader);\n return null;\n });\n },\n loadImage(uri) {\n const loader = this,\n Image = image$1();\n increment(loader);\n return loader._loader.sanitize(uri, {\n context: 'image'\n }).then(opt => {\n const url = opt.href;\n if (!url || !Image) throw {\n url: url\n };\n const img = new Image();\n\n // set crossOrigin only if cors is defined; empty string sets anonymous mode\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/crossOrigin\n const cors = hasOwnProperty(opt, 'crossOrigin') ? opt.crossOrigin : 'anonymous';\n if (cors != null) img.crossOrigin = cors;\n\n // attempt to load image resource\n img.onload = () => decrement(loader);\n img.onerror = () => decrement(loader);\n img.src = url;\n return img;\n }).catch(e => {\n decrement(loader);\n return {\n complete: false,\n width: 0,\n height: 0,\n src: e && e.url || ''\n };\n });\n },\n ready() {\n const loader = this;\n return new Promise(accept => {\n function poll(value) {\n if (!loader.pending()) accept(value);else setTimeout(() => {\n poll(true);\n }, 10);\n }\n poll(false);\n });\n }\n};\n\nfunction boundStroke (bounds, item, miter) {\n if (item.stroke && item.opacity !== 0 && item.strokeOpacity !== 0) {\n const sw = item.strokeWidth != null ? +item.strokeWidth : 1;\n bounds.expand(sw + (miter ? miterAdjustment(item, sw) : 0));\n }\n return bounds;\n}\nfunction miterAdjustment(item, strokeWidth) {\n // TODO: more sophisticated adjustment? Or miter support in boundContext?\n return item.strokeJoin && item.strokeJoin !== 'miter' ? 0 : strokeWidth;\n}\n\nconst circleThreshold = Tau - 1e-8;\nlet bounds, lx, ly, rot, ma, mb, mc, md;\nconst add = (x, y) => bounds.add(x, y);\nconst addL = (x, y) => add(lx = x, ly = y);\nconst addX = x => add(x, bounds.y1);\nconst addY = y => add(bounds.x1, y);\nconst px = (x, y) => ma * x + mc * y;\nconst py = (x, y) => mb * x + md * y;\nconst addp = (x, y) => add(px(x, y), py(x, y));\nconst addpL = (x, y) => addL(px(x, y), py(x, y));\nfunction boundContext (_, deg) {\n bounds = _;\n if (deg) {\n rot = deg * DegToRad;\n ma = md = Math.cos(rot);\n mb = Math.sin(rot);\n mc = -mb;\n } else {\n ma = md = 1;\n rot = mb = mc = 0;\n }\n return context$1;\n}\nconst context$1 = {\n beginPath() {},\n closePath() {},\n moveTo: addpL,\n lineTo: addpL,\n rect(x, y, w, h) {\n if (rot) {\n addp(x + w, y);\n addp(x + w, y + h);\n addp(x, y + h);\n addpL(x, y);\n } else {\n add(x + w, y + h);\n addL(x, y);\n }\n },\n quadraticCurveTo(x1, y1, x2, y2) {\n const px1 = px(x1, y1),\n py1 = py(x1, y1),\n px2 = px(x2, y2),\n py2 = py(x2, y2);\n quadExtrema(lx, px1, px2, addX);\n quadExtrema(ly, py1, py2, addY);\n addL(px2, py2);\n },\n bezierCurveTo(x1, y1, x2, y2, x3, y3) {\n const px1 = px(x1, y1),\n py1 = py(x1, y1),\n px2 = px(x2, y2),\n py2 = py(x2, y2),\n px3 = px(x3, y3),\n py3 = py(x3, y3);\n cubicExtrema(lx, px1, px2, px3, addX);\n cubicExtrema(ly, py1, py2, py3, addY);\n addL(px3, py3);\n },\n arc(cx, cy, r, sa, ea, ccw) {\n sa += rot;\n ea += rot;\n\n // store last point on path\n lx = r * Math.cos(ea) + cx;\n ly = r * Math.sin(ea) + cy;\n if (Math.abs(ea - sa) > circleThreshold) {\n // treat as full circle\n add(cx - r, cy - r);\n add(cx + r, cy + r);\n } else {\n const update = a => add(r * Math.cos(a) + cx, r * Math.sin(a) + cy);\n let s, i;\n\n // sample end points\n update(sa);\n update(ea);\n\n // sample interior points aligned with 90 degrees\n if (ea !== sa) {\n sa = sa % Tau;\n if (sa < 0) sa += Tau;\n ea = ea % Tau;\n if (ea < 0) ea += Tau;\n if (ea < sa) {\n ccw = !ccw; // flip direction\n s = sa;\n sa = ea;\n ea = s; // swap end-points\n }\n\n if (ccw) {\n ea -= Tau;\n s = sa - sa % HalfPi;\n for (i = 0; i < 4 && s > ea; ++i, s -= HalfPi) update(s);\n } else {\n s = sa - sa % HalfPi + HalfPi;\n for (i = 0; i < 4 && s < ea; ++i, s = s + HalfPi) update(s);\n }\n }\n }\n }\n};\nfunction quadExtrema(x0, x1, x2, cb) {\n const t = (x0 - x1) / (x0 + x2 - 2 * x1);\n if (0 < t && t < 1) cb(x0 + (x1 - x0) * t);\n}\nfunction cubicExtrema(x0, x1, x2, x3, cb) {\n const a = x3 - x0 + 3 * x1 - 3 * x2,\n b = x0 + x2 - 2 * x1,\n c = x0 - x1;\n let t0 = 0,\n t1 = 0,\n r;\n\n // solve for parameter t\n if (Math.abs(a) > Epsilon) {\n // quadratic equation\n r = b * b + c * a;\n if (r >= 0) {\n r = Math.sqrt(r);\n t0 = (-b + r) / a;\n t1 = (-b - r) / a;\n }\n } else {\n // linear equation\n t0 = 0.5 * c / b;\n }\n\n // calculate position\n if (0 < t0 && t0 < 1) cb(cubic(t0, x0, x1, x2, x3));\n if (0 < t1 && t1 < 1) cb(cubic(t1, x0, x1, x2, x3));\n}\nfunction cubic(t, x0, x1, x2, x3) {\n const s = 1 - t,\n s2 = s * s,\n t2 = t * t;\n return s2 * s * x0 + 3 * s2 * t * x1 + 3 * s * t2 * x2 + t2 * t * x3;\n}\n\nvar context = (context = canvas(1, 1)) ? context.getContext('2d') : null;\n\nconst b = new Bounds();\nfunction intersectPath(draw) {\n return function (item, brush) {\n // rely on (inaccurate) bounds intersection if no context\n if (!context) return true;\n\n // add path to offscreen graphics context\n draw(context, item);\n\n // get bounds intersection region\n b.clear().union(item.bounds).intersect(brush).round();\n const {\n x1,\n y1,\n x2,\n y2\n } = b;\n\n // iterate over intersection region\n // perform fine grained inclusion test\n for (let y = y1; y <= y2; ++y) {\n for (let x = x1; x <= x2; ++x) {\n if (context.isPointInPath(x, y)) {\n return true;\n }\n }\n }\n\n // false if no hits in intersection region\n return false;\n };\n}\nfunction intersectPoint(item, box) {\n return box.contains(item.x || 0, item.y || 0);\n}\nfunction intersectRect(item, box) {\n const x = item.x || 0,\n y = item.y || 0,\n w = item.width || 0,\n h = item.height || 0;\n return box.intersects(b.set(x, y, x + w, y + h));\n}\nfunction intersectRule(item, box) {\n const x = item.x || 0,\n y = item.y || 0,\n x2 = item.x2 != null ? item.x2 : x,\n y2 = item.y2 != null ? item.y2 : y;\n return intersectBoxLine(box, x, y, x2, y2);\n}\nfunction intersectBoxLine(box, x, y, u, v) {\n const {\n x1,\n y1,\n x2,\n y2\n } = box,\n dx = u - x,\n dy = v - y;\n let t0 = 0,\n t1 = 1,\n p,\n q,\n r,\n e;\n for (e = 0; e < 4; ++e) {\n if (e === 0) {\n p = -dx;\n q = -(x1 - x);\n }\n if (e === 1) {\n p = dx;\n q = x2 - x;\n }\n if (e === 2) {\n p = -dy;\n q = -(y1 - y);\n }\n if (e === 3) {\n p = dy;\n q = y2 - y;\n }\n if (Math.abs(p) < 1e-10 && q < 0) return false;\n r = q / p;\n if (p < 0) {\n if (r > t1) return false;else if (r > t0) t0 = r;\n } else if (p > 0) {\n if (r < t0) return false;else if (r < t1) t1 = r;\n }\n }\n return true;\n}\n\nfunction blend (context, item) {\n context.globalCompositeOperation = item.blend || 'source-over';\n}\n\nfunction value (value, dflt) {\n return value == null ? dflt : value;\n}\n\nfunction addStops(gradient, stops) {\n const n = stops.length;\n for (let i = 0; i < n; ++i) {\n gradient.addColorStop(stops[i].offset, stops[i].color);\n }\n return gradient;\n}\nfunction gradient (context, spec, bounds) {\n const w = bounds.width(),\n h = bounds.height();\n let gradient;\n if (spec.gradient === 'radial') {\n gradient = context.createRadialGradient(bounds.x1 + value(spec.x1, 0.5) * w, bounds.y1 + value(spec.y1, 0.5) * h, Math.max(w, h) * value(spec.r1, 0), bounds.x1 + value(spec.x2, 0.5) * w, bounds.y1 + value(spec.y2, 0.5) * h, Math.max(w, h) * value(spec.r2, 0.5));\n } else {\n // linear gradient\n const x1 = value(spec.x1, 0),\n y1 = value(spec.y1, 0),\n x2 = value(spec.x2, 1),\n y2 = value(spec.y2, 0);\n if (x1 === x2 || y1 === y2 || w === h) {\n // axis aligned: use normal gradient\n gradient = context.createLinearGradient(bounds.x1 + x1 * w, bounds.y1 + y1 * h, bounds.x1 + x2 * w, bounds.y1 + y2 * h);\n } else {\n // not axis aligned: render gradient into a pattern (#2365)\n // this allows us to use normalized bounding box coordinates\n const image = canvas(Math.ceil(w), Math.ceil(h)),\n ictx = image.getContext('2d');\n ictx.scale(w, h);\n ictx.fillStyle = addStops(ictx.createLinearGradient(x1, y1, x2, y2), spec.stops);\n ictx.fillRect(0, 0, w, h);\n return context.createPattern(image, 'no-repeat');\n }\n }\n return addStops(gradient, spec.stops);\n}\n\nfunction color (context, item, value) {\n return isGradient(value) ? gradient(context, value, item.bounds) : value;\n}\n\nfunction fill (context, item, opacity) {\n opacity *= item.fillOpacity == null ? 1 : item.fillOpacity;\n if (opacity > 0) {\n context.globalAlpha = opacity;\n context.fillStyle = color(context, item, item.fill);\n return true;\n } else {\n return false;\n }\n}\n\nvar Empty = [];\nfunction stroke (context, item, opacity) {\n var lw = (lw = item.strokeWidth) != null ? lw : 1;\n if (lw <= 0) return false;\n opacity *= item.strokeOpacity == null ? 1 : item.strokeOpacity;\n if (opacity > 0) {\n context.globalAlpha = opacity;\n context.strokeStyle = color(context, item, item.stroke);\n context.lineWidth = lw;\n context.lineCap = item.strokeCap || 'butt';\n context.lineJoin = item.strokeJoin || 'miter';\n context.miterLimit = item.strokeMiterLimit || 10;\n if (context.setLineDash) {\n context.setLineDash(item.strokeDash || Empty);\n context.lineDashOffset = item.strokeDashOffset || 0;\n }\n return true;\n } else {\n return false;\n }\n}\n\nfunction compare(a, b) {\n return a.zindex - b.zindex || a.index - b.index;\n}\nfunction zorder(scene) {\n if (!scene.zdirty) return scene.zitems;\n var items = scene.items,\n output = [],\n item,\n i,\n n;\n for (i = 0, n = items.length; i < n; ++i) {\n item = items[i];\n item.index = i;\n if (item.zindex) output.push(item);\n }\n scene.zdirty = false;\n return scene.zitems = output.sort(compare);\n}\nfunction visit(scene, visitor) {\n var items = scene.items,\n i,\n n;\n if (!items || !items.length) return;\n const zitems = zorder(scene);\n if (zitems && zitems.length) {\n for (i = 0, n = items.length; i < n; ++i) {\n if (!items[i].zindex) visitor(items[i]);\n }\n items = zitems;\n }\n for (i = 0, n = items.length; i < n; ++i) {\n visitor(items[i]);\n }\n}\nfunction pickVisit(scene, visitor) {\n var items = scene.items,\n hit,\n i;\n if (!items || !items.length) return null;\n const zitems = zorder(scene);\n if (zitems && zitems.length) items = zitems;\n for (i = items.length; --i >= 0;) {\n if (hit = visitor(items[i])) return hit;\n }\n if (items === zitems) {\n for (items = scene.items, i = items.length; --i >= 0;) {\n if (!items[i].zindex) {\n if (hit = visitor(items[i])) return hit;\n }\n }\n }\n return null;\n}\n\nfunction drawAll(path) {\n return function (context, scene, bounds) {\n visit(scene, item => {\n if (!bounds || bounds.intersects(item.bounds)) {\n drawPath(path, context, item, item);\n }\n });\n };\n}\nfunction drawOne(path) {\n return function (context, scene, bounds) {\n if (scene.items.length && (!bounds || bounds.intersects(scene.bounds))) {\n drawPath(path, context, scene.items[0], scene.items);\n }\n };\n}\nfunction drawPath(path, context, item, items) {\n var opacity = item.opacity == null ? 1 : item.opacity;\n if (opacity === 0) return;\n if (path(context, items)) return;\n blend(context, item);\n if (item.fill && fill(context, item, opacity)) {\n context.fill();\n }\n if (item.stroke && stroke(context, item, opacity)) {\n context.stroke();\n }\n}\n\nfunction pick$1(test) {\n test = test || truthy;\n return function (context, scene, x, y, gx, gy) {\n x *= context.pixelRatio;\n y *= context.pixelRatio;\n return pickVisit(scene, item => {\n const b = item.bounds;\n // first hit test against bounding box\n if (b && !b.contains(gx, gy) || !b) return;\n // if in bounding box, perform more careful test\n if (test(context, item, x, y, gx, gy)) return item;\n });\n };\n}\nfunction hitPath(path, filled) {\n return function (context, o, x, y) {\n var item = Array.isArray(o) ? o[0] : o,\n fill = filled == null ? item.fill : filled,\n stroke = item.stroke && context.isPointInStroke,\n lw,\n lc;\n if (stroke) {\n lw = item.strokeWidth;\n lc = item.strokeCap;\n context.lineWidth = lw != null ? lw : 1;\n context.lineCap = lc != null ? lc : 'butt';\n }\n return path(context, o) ? false : fill && context.isPointInPath(x, y) || stroke && context.isPointInStroke(x, y);\n };\n}\nfunction pickPath(path) {\n return pick$1(hitPath(path));\n}\n\nfunction translate(x, y) {\n return 'translate(' + x + ',' + y + ')';\n}\nfunction rotate(a) {\n return 'rotate(' + a + ')';\n}\nfunction scale(scaleX, scaleY) {\n return 'scale(' + scaleX + ',' + scaleY + ')';\n}\nfunction translateItem(item) {\n return translate(item.x || 0, item.y || 0);\n}\nfunction rotateItem(item) {\n return translate(item.x || 0, item.y || 0) + (item.angle ? ' ' + rotate(item.angle) : '');\n}\nfunction transformItem(item) {\n return translate(item.x || 0, item.y || 0) + (item.angle ? ' ' + rotate(item.angle) : '') + (item.scaleX || item.scaleY ? ' ' + scale(item.scaleX || 1, item.scaleY || 1) : '');\n}\n\nfunction markItemPath (type, shape, isect) {\n function attr(emit, item) {\n emit('transform', rotateItem(item));\n emit('d', shape(null, item));\n }\n function bound(bounds, item) {\n shape(boundContext(bounds, item.angle), item);\n return boundStroke(bounds, item).translate(item.x || 0, item.y || 0);\n }\n function draw(context, item) {\n var x = item.x || 0,\n y = item.y || 0,\n a = item.angle || 0;\n context.translate(x, y);\n if (a) context.rotate(a *= DegToRad);\n context.beginPath();\n shape(context, item);\n if (a) context.rotate(-a);\n context.translate(-x, -y);\n }\n return {\n type: type,\n tag: 'path',\n nested: false,\n attr: attr,\n bound: bound,\n draw: drawAll(draw),\n pick: pickPath(draw),\n isect: isect || intersectPath(draw)\n };\n}\n\nvar arc = markItemPath('arc', arc$1);\n\nfunction pickArea(a, p) {\n var v = a[0].orient === 'horizontal' ? p[1] : p[0],\n z = a[0].orient === 'horizontal' ? 'y' : 'x',\n i = a.length,\n min = +Infinity,\n hit,\n d;\n while (--i >= 0) {\n if (a[i].defined === false) continue;\n d = Math.abs(a[i][z] - v);\n if (d < min) {\n min = d;\n hit = a[i];\n }\n }\n return hit;\n}\nfunction pickLine(a, p) {\n var t = Math.pow(a[0].strokeWidth || 1, 2),\n i = a.length,\n dx,\n dy,\n dd;\n while (--i >= 0) {\n if (a[i].defined === false) continue;\n dx = a[i].x - p[0];\n dy = a[i].y - p[1];\n dd = dx * dx + dy * dy;\n if (dd < t) return a[i];\n }\n return null;\n}\nfunction pickTrail(a, p) {\n var i = a.length,\n dx,\n dy,\n dd;\n while (--i >= 0) {\n if (a[i].defined === false) continue;\n dx = a[i].x - p[0];\n dy = a[i].y - p[1];\n dd = dx * dx + dy * dy;\n dx = a[i].size || 1;\n if (dd < dx * dx) return a[i];\n }\n return null;\n}\n\nfunction markMultiItemPath (type, shape, tip) {\n function attr(emit, item) {\n var items = item.mark.items;\n if (items.length) emit('d', shape(null, items));\n }\n function bound(bounds, mark) {\n var items = mark.items;\n if (items.length === 0) {\n return bounds;\n } else {\n shape(boundContext(bounds), items);\n return boundStroke(bounds, items[0]);\n }\n }\n function draw(context, items) {\n context.beginPath();\n shape(context, items);\n }\n const hit = hitPath(draw);\n function pick(context, scene, x, y, gx, gy) {\n var items = scene.items,\n b = scene.bounds;\n if (!items || !items.length || b && !b.contains(gx, gy)) {\n return null;\n }\n x *= context.pixelRatio;\n y *= context.pixelRatio;\n return hit(context, items, x, y) ? items[0] : null;\n }\n return {\n type: type,\n tag: 'path',\n nested: true,\n attr: attr,\n bound: bound,\n draw: drawOne(draw),\n pick: pick,\n isect: intersectPoint,\n tip: tip\n };\n}\n\nvar area = markMultiItemPath('area', area$1, pickArea);\n\nfunction clip (context, scene) {\n var clip = scene.clip;\n context.save();\n if (isFunction(clip)) {\n context.beginPath();\n clip(context);\n context.clip();\n } else {\n clipGroup(context, scene.group);\n }\n}\nfunction clipGroup(context, group) {\n context.beginPath();\n hasCornerRadius(group) ? rectangle(context, group, 0, 0) : context.rect(0, 0, group.width || 0, group.height || 0);\n context.clip();\n}\n\nfunction offset$1(item) {\n const sw = value(item.strokeWidth, 1);\n return item.strokeOffset != null ? item.strokeOffset : item.stroke && sw > 0.5 && sw < 1.5 ? 0.5 - Math.abs(sw - 1) : 0;\n}\nfunction attr$5(emit, item) {\n emit('transform', translateItem(item));\n}\nfunction emitRectangle(emit, item) {\n const off = offset$1(item);\n emit('d', rectangle(null, item, off, off));\n}\nfunction background(emit, item) {\n emit('class', 'background');\n emit('aria-hidden', true);\n emitRectangle(emit, item);\n}\nfunction foreground(emit, item) {\n emit('class', 'foreground');\n emit('aria-hidden', true);\n if (item.strokeForeground) {\n emitRectangle(emit, item);\n } else {\n emit('d', '');\n }\n}\nfunction content(emit, item, renderer) {\n const url = item.clip ? clip$1(renderer, item, item) : null;\n emit('clip-path', url);\n}\nfunction bound$5(bounds, group) {\n if (!group.clip && group.items) {\n const items = group.items,\n m = items.length;\n for (let j = 0; j < m; ++j) {\n bounds.union(items[j].bounds);\n }\n }\n if ((group.clip || group.width || group.height) && !group.noBound) {\n bounds.add(0, 0).add(group.width || 0, group.height || 0);\n }\n boundStroke(bounds, group);\n return bounds.translate(group.x || 0, group.y || 0);\n}\nfunction rectanglePath(context, group, x, y) {\n const off = offset$1(group);\n context.beginPath();\n rectangle(context, group, (x || 0) + off, (y || 0) + off);\n}\nconst hitBackground = hitPath(rectanglePath);\nconst hitForeground = hitPath(rectanglePath, false);\nconst hitCorner = hitPath(rectanglePath, true);\nfunction draw$4(context, scene, bounds) {\n visit(scene, group => {\n const gx = group.x || 0,\n gy = group.y || 0,\n fore = group.strokeForeground,\n opacity = group.opacity == null ? 1 : group.opacity;\n\n // draw group background\n if ((group.stroke || group.fill) && opacity) {\n rectanglePath(context, group, gx, gy);\n blend(context, group);\n if (group.fill && fill(context, group, opacity)) {\n context.fill();\n }\n if (group.stroke && !fore && stroke(context, group, opacity)) {\n context.stroke();\n }\n }\n\n // setup graphics context, set clip and bounds\n context.save();\n context.translate(gx, gy);\n if (group.clip) clipGroup(context, group);\n if (bounds) bounds.translate(-gx, -gy);\n\n // draw group contents\n visit(group, item => {\n this.draw(context, item, bounds);\n });\n\n // restore graphics context\n if (bounds) bounds.translate(gx, gy);\n context.restore();\n\n // draw group foreground\n if (fore && group.stroke && opacity) {\n rectanglePath(context, group, gx, gy);\n blend(context, group);\n if (stroke(context, group, opacity)) {\n context.stroke();\n }\n }\n });\n}\nfunction pick(context, scene, x, y, gx, gy) {\n if (scene.bounds && !scene.bounds.contains(gx, gy) || !scene.items) {\n return null;\n }\n const cx = x * context.pixelRatio,\n cy = y * context.pixelRatio;\n return pickVisit(scene, group => {\n let hit, dx, dy;\n\n // first hit test bounding box\n const b = group.bounds;\n if (b && !b.contains(gx, gy)) return;\n\n // passed bounds check, test rectangular clip\n dx = group.x || 0;\n dy = group.y || 0;\n const dw = dx + (group.width || 0),\n dh = dy + (group.height || 0),\n c = group.clip;\n if (c && (gx < dx || gx > dw || gy < dy || gy > dh)) return;\n\n // adjust coordinate system\n context.save();\n context.translate(dx, dy);\n dx = gx - dx;\n dy = gy - dy;\n\n // test background for rounded corner clip\n if (c && hasCornerRadius(group) && !hitCorner(context, group, cx, cy)) {\n context.restore();\n return null;\n }\n const fore = group.strokeForeground,\n ix = scene.interactive !== false;\n\n // hit test against group foreground\n if (ix && fore && group.stroke && hitForeground(context, group, cx, cy)) {\n context.restore();\n return group;\n }\n\n // hit test against contained marks\n hit = pickVisit(group, mark => pickMark(mark, dx, dy) ? this.pick(mark, x, y, dx, dy) : null);\n\n // hit test against group background\n if (!hit && ix && (group.fill || !fore && group.stroke) && hitBackground(context, group, cx, cy)) {\n hit = group;\n }\n\n // restore state and return\n context.restore();\n return hit || null;\n });\n}\nfunction pickMark(mark, x, y) {\n return (mark.interactive !== false || mark.marktype === 'group') && mark.bounds && mark.bounds.contains(x, y);\n}\nvar group = {\n type: 'group',\n tag: 'g',\n nested: false,\n attr: attr$5,\n bound: bound$5,\n draw: draw$4,\n pick: pick,\n isect: intersectRect,\n content: content,\n background: background,\n foreground: foreground\n};\n\nvar metadata = {\n 'xmlns': 'http://www.w3.org/2000/svg',\n 'xmlns:xlink': 'http://www.w3.org/1999/xlink',\n 'version': '1.1'\n};\n\nfunction getImage(item, renderer) {\n var image = item.image;\n if (!image || item.url && item.url !== image.url) {\n image = {\n complete: false,\n width: 0,\n height: 0\n };\n renderer.loadImage(item.url).then(image => {\n item.image = image;\n item.image.url = item.url;\n });\n }\n return image;\n}\nfunction imageWidth(item, image) {\n return item.width != null ? item.width : !image || !image.width ? 0 : item.aspect !== false && item.height ? item.height * image.width / image.height : image.width;\n}\nfunction imageHeight(item, image) {\n return item.height != null ? item.height : !image || !image.height ? 0 : item.aspect !== false && item.width ? item.width * image.height / image.width : image.height;\n}\nfunction imageXOffset(align, w) {\n return align === 'center' ? w / 2 : align === 'right' ? w : 0;\n}\nfunction imageYOffset(baseline, h) {\n return baseline === 'middle' ? h / 2 : baseline === 'bottom' ? h : 0;\n}\nfunction attr$4(emit, item, renderer) {\n const img = getImage(item, renderer),\n w = imageWidth(item, img),\n h = imageHeight(item, img),\n x = (item.x || 0) - imageXOffset(item.align, w),\n y = (item.y || 0) - imageYOffset(item.baseline, h),\n i = !img.src && img.toDataURL ? img.toDataURL() : img.src || '';\n emit('href', i, metadata['xmlns:xlink'], 'xlink:href');\n emit('transform', translate(x, y));\n emit('width', w);\n emit('height', h);\n emit('preserveAspectRatio', item.aspect === false ? 'none' : 'xMidYMid');\n}\nfunction bound$4(bounds, item) {\n const img = item.image,\n w = imageWidth(item, img),\n h = imageHeight(item, img),\n x = (item.x || 0) - imageXOffset(item.align, w),\n y = (item.y || 0) - imageYOffset(item.baseline, h);\n return bounds.set(x, y, x + w, y + h);\n}\nfunction draw$3(context, scene, bounds) {\n visit(scene, item => {\n if (bounds && !bounds.intersects(item.bounds)) return; // bounds check\n\n const img = getImage(item, this);\n let w = imageWidth(item, img);\n let h = imageHeight(item, img);\n if (w === 0 || h === 0) return; // early exit\n\n let x = (item.x || 0) - imageXOffset(item.align, w),\n y = (item.y || 0) - imageYOffset(item.baseline, h),\n opacity,\n ar0,\n ar1,\n t;\n if (item.aspect !== false) {\n ar0 = img.width / img.height;\n ar1 = item.width / item.height;\n if (ar0 === ar0 && ar1 === ar1 && ar0 !== ar1) {\n if (ar1 < ar0) {\n t = w / ar0;\n y += (h - t) / 2;\n h = t;\n } else {\n t = h * ar0;\n x += (w - t) / 2;\n w = t;\n }\n }\n }\n if (img.complete || img.toDataURL) {\n blend(context, item);\n context.globalAlpha = (opacity = item.opacity) != null ? opacity : 1;\n context.imageSmoothingEnabled = item.smooth !== false;\n context.drawImage(img, x, y, w, h);\n }\n });\n}\nvar image = {\n type: 'image',\n tag: 'image',\n nested: false,\n attr: attr$4,\n bound: bound$4,\n draw: draw$3,\n pick: pick$1(),\n isect: truthy,\n // bounds check is sufficient\n get: getImage,\n xOffset: imageXOffset,\n yOffset: imageYOffset\n};\n\nvar line = markMultiItemPath('line', line$1, pickLine);\n\nfunction attr$3(emit, item) {\n var sx = item.scaleX || 1,\n sy = item.scaleY || 1;\n if (sx !== 1 || sy !== 1) {\n emit('vector-effect', 'non-scaling-stroke');\n }\n emit('transform', transformItem(item));\n emit('d', item.path);\n}\nfunction path$1(context, item) {\n var path = item.path;\n if (path == null) return true;\n var x = item.x || 0,\n y = item.y || 0,\n sx = item.scaleX || 1,\n sy = item.scaleY || 1,\n a = (item.angle || 0) * DegToRad,\n cache = item.pathCache;\n if (!cache || cache.path !== path) {\n (item.pathCache = cache = parse(path)).path = path;\n }\n if (a && context.rotate && context.translate) {\n context.translate(x, y);\n context.rotate(a);\n pathRender(context, cache, 0, 0, sx, sy);\n context.rotate(-a);\n context.translate(-x, -y);\n } else {\n pathRender(context, cache, x, y, sx, sy);\n }\n}\nfunction bound$3(bounds, item) {\n return path$1(boundContext(bounds, item.angle), item) ? bounds.set(0, 0, 0, 0) : boundStroke(bounds, item, true);\n}\nvar path$2 = {\n type: 'path',\n tag: 'path',\n nested: false,\n attr: attr$3,\n bound: bound$3,\n draw: drawAll(path$1),\n pick: pickPath(path$1),\n isect: intersectPath(path$1)\n};\n\nfunction attr$2(emit, item) {\n emit('d', rectangle(null, item));\n}\nfunction bound$2(bounds, item) {\n var x, y;\n return boundStroke(bounds.set(x = item.x || 0, y = item.y || 0, x + item.width || 0, y + item.height || 0), item);\n}\nfunction draw$2(context, item) {\n context.beginPath();\n rectangle(context, item);\n}\nvar rect = {\n type: 'rect',\n tag: 'path',\n nested: false,\n attr: attr$2,\n bound: bound$2,\n draw: drawAll(draw$2),\n pick: pickPath(draw$2),\n isect: intersectRect\n};\n\nfunction attr$1(emit, item) {\n emit('transform', translateItem(item));\n emit('x2', item.x2 != null ? item.x2 - (item.x || 0) : 0);\n emit('y2', item.y2 != null ? item.y2 - (item.y || 0) : 0);\n}\nfunction bound$1(bounds, item) {\n var x1, y1;\n return boundStroke(bounds.set(x1 = item.x || 0, y1 = item.y || 0, item.x2 != null ? item.x2 : x1, item.y2 != null ? item.y2 : y1), item);\n}\nfunction path(context, item, opacity) {\n var x1, y1, x2, y2;\n if (item.stroke && stroke(context, item, opacity)) {\n x1 = item.x || 0;\n y1 = item.y || 0;\n x2 = item.x2 != null ? item.x2 : x1;\n y2 = item.y2 != null ? item.y2 : y1;\n context.beginPath();\n context.moveTo(x1, y1);\n context.lineTo(x2, y2);\n return true;\n }\n return false;\n}\nfunction draw$1(context, scene, bounds) {\n visit(scene, item => {\n if (bounds && !bounds.intersects(item.bounds)) return; // bounds check\n var opacity = item.opacity == null ? 1 : item.opacity;\n if (opacity && path(context, item, opacity)) {\n blend(context, item);\n context.stroke();\n }\n });\n}\nfunction hit$1(context, item, x, y) {\n if (!context.isPointInStroke) return false;\n return path(context, item, 1) && context.isPointInStroke(x, y);\n}\nvar rule = {\n type: 'rule',\n tag: 'line',\n nested: false,\n attr: attr$1,\n bound: bound$1,\n draw: draw$1,\n pick: pick$1(hit$1),\n isect: intersectRule\n};\n\nvar shape = markItemPath('shape', shape$1);\n\nvar symbol = markItemPath('symbol', symbol$1, intersectPoint);\n\n// memoize text width measurement\nconst widthCache = lruCache();\nvar textMetrics = {\n height: fontSize,\n measureWidth: measureWidth,\n estimateWidth: estimateWidth,\n width: estimateWidth,\n canvas: useCanvas\n};\nuseCanvas(true);\nfunction useCanvas(use) {\n textMetrics.width = use && context ? measureWidth : estimateWidth;\n}\n\n// make simple estimate if no canvas is available\nfunction estimateWidth(item, text) {\n return _estimateWidth(textValue(item, text), fontSize(item));\n}\nfunction _estimateWidth(text, currentFontHeight) {\n return ~~(0.8 * text.length * currentFontHeight);\n}\n\n// measure text width if canvas is available\nfunction measureWidth(item, text) {\n return fontSize(item) <= 0 || !(text = textValue(item, text)) ? 0 : _measureWidth(text, font(item));\n}\nfunction _measureWidth(text, currentFont) {\n const key = `(${currentFont}) ${text}`;\n let width = widthCache.get(key);\n if (width === undefined) {\n context.font = currentFont;\n width = context.measureText(text).width;\n widthCache.set(key, width);\n }\n return width;\n}\nfunction fontSize(item) {\n return item.fontSize != null ? +item.fontSize || 0 : 11;\n}\nfunction lineHeight(item) {\n return item.lineHeight != null ? item.lineHeight : fontSize(item) + 2;\n}\nfunction lineArray(_) {\n return isArray(_) ? _.length > 1 ? _ : _[0] : _;\n}\nfunction textLines(item) {\n return lineArray(item.lineBreak && item.text && !isArray(item.text) ? item.text.split(item.lineBreak) : item.text);\n}\nfunction multiLineOffset(item) {\n const tl = textLines(item);\n return (isArray(tl) ? tl.length - 1 : 0) * lineHeight(item);\n}\nfunction textValue(item, line) {\n const text = line == null ? '' : (line + '').trim();\n return item.limit > 0 && text.length ? truncate(item, text) : text;\n}\nfunction widthGetter(item) {\n if (textMetrics.width === measureWidth) {\n // we are using canvas\n const currentFont = font(item);\n return text => _measureWidth(text, currentFont);\n } else {\n // we are relying on estimates\n const currentFontHeight = fontSize(item);\n return text => _estimateWidth(text, currentFontHeight);\n }\n}\nfunction truncate(item, text) {\n var limit = +item.limit,\n width = widthGetter(item);\n if (width(text) < limit) return text;\n var ellipsis = item.ellipsis || '\\u2026',\n rtl = item.dir === 'rtl',\n lo = 0,\n hi = text.length,\n mid;\n limit -= width(ellipsis);\n if (rtl) {\n while (lo < hi) {\n mid = lo + hi >>> 1;\n if (width(text.slice(mid)) > limit) lo = mid + 1;else hi = mid;\n }\n return ellipsis + text.slice(lo);\n } else {\n while (lo < hi) {\n mid = 1 + (lo + hi >>> 1);\n if (width(text.slice(0, mid)) < limit) lo = mid;else hi = mid - 1;\n }\n return text.slice(0, lo) + ellipsis;\n }\n}\nfunction fontFamily(item, quote) {\n var font = item.font;\n return (quote && font ? String(font).replace(/\"/g, '\\'') : font) || 'sans-serif';\n}\nfunction font(item, quote) {\n return '' + (item.fontStyle ? item.fontStyle + ' ' : '') + (item.fontVariant ? item.fontVariant + ' ' : '') + (item.fontWeight ? item.fontWeight + ' ' : '') + fontSize(item) + 'px ' + fontFamily(item, quote);\n}\nfunction offset(item) {\n // perform our own font baseline calculation\n // why? not all browsers support SVG 1.1 'alignment-baseline' :(\n // this also ensures consistent layout across renderers\n var baseline = item.baseline,\n h = fontSize(item);\n return Math.round(baseline === 'top' ? 0.79 * h : baseline === 'middle' ? 0.30 * h : baseline === 'bottom' ? -0.21 * h : baseline === 'line-top' ? 0.29 * h + 0.5 * lineHeight(item) : baseline === 'line-bottom' ? 0.29 * h - 0.5 * lineHeight(item) : 0);\n}\n\nconst textAlign = {\n 'left': 'start',\n 'center': 'middle',\n 'right': 'end'\n};\nconst tempBounds = new Bounds();\nfunction anchorPoint(item) {\n var x = item.x || 0,\n y = item.y || 0,\n r = item.radius || 0,\n t;\n if (r) {\n t = (item.theta || 0) - HalfPi;\n x += r * Math.cos(t);\n y += r * Math.sin(t);\n }\n tempBounds.x1 = x;\n tempBounds.y1 = y;\n return tempBounds;\n}\nfunction attr(emit, item) {\n var dx = item.dx || 0,\n dy = (item.dy || 0) + offset(item),\n p = anchorPoint(item),\n x = p.x1,\n y = p.y1,\n a = item.angle || 0,\n t;\n emit('text-anchor', textAlign[item.align] || 'start');\n if (a) {\n t = translate(x, y) + ' ' + rotate(a);\n if (dx || dy) t += ' ' + translate(dx, dy);\n } else {\n t = translate(x + dx, y + dy);\n }\n emit('transform', t);\n}\nfunction bound(bounds, item, mode) {\n var h = textMetrics.height(item),\n a = item.align,\n p = anchorPoint(item),\n x = p.x1,\n y = p.y1,\n dx = item.dx || 0,\n dy = (item.dy || 0) + offset(item) - Math.round(0.8 * h),\n // use 4/5 offset\n tl = textLines(item),\n w;\n\n // get dimensions\n if (isArray(tl)) {\n // multi-line text\n h += lineHeight(item) * (tl.length - 1);\n w = tl.reduce((w, t) => Math.max(w, textMetrics.width(item, t)), 0);\n } else {\n // single-line text\n w = textMetrics.width(item, tl);\n }\n\n // horizontal alignment\n if (a === 'center') {\n dx -= w / 2;\n } else if (a === 'right') {\n dx -= w;\n } else ;\n bounds.set(dx += x, dy += y, dx + w, dy + h);\n if (item.angle && !mode) {\n bounds.rotate(item.angle * DegToRad, x, y);\n } else if (mode === 2) {\n return bounds.rotatedPoints(item.angle * DegToRad, x, y);\n }\n return bounds;\n}\nfunction draw(context, scene, bounds) {\n visit(scene, item => {\n var opacity = item.opacity == null ? 1 : item.opacity,\n p,\n x,\n y,\n i,\n lh,\n tl,\n str;\n if (bounds && !bounds.intersects(item.bounds) ||\n // bounds check\n opacity === 0 || item.fontSize <= 0 || item.text == null || item.text.length === 0) return;\n context.font = font(item);\n context.textAlign = item.align || 'left';\n p = anchorPoint(item);\n x = p.x1, y = p.y1;\n if (item.angle) {\n context.save();\n context.translate(x, y);\n context.rotate(item.angle * DegToRad);\n x = y = 0; // reset x, y\n }\n\n x += item.dx || 0;\n y += (item.dy || 0) + offset(item);\n tl = textLines(item);\n blend(context, item);\n if (isArray(tl)) {\n lh = lineHeight(item);\n for (i = 0; i < tl.length; ++i) {\n str = textValue(item, tl[i]);\n if (item.fill && fill(context, item, opacity)) {\n context.fillText(str, x, y);\n }\n if (item.stroke && stroke(context, item, opacity)) {\n context.strokeText(str, x, y);\n }\n y += lh;\n }\n } else {\n str = textValue(item, tl);\n if (item.fill && fill(context, item, opacity)) {\n context.fillText(str, x, y);\n }\n if (item.stroke && stroke(context, item, opacity)) {\n context.strokeText(str, x, y);\n }\n }\n if (item.angle) context.restore();\n });\n}\nfunction hit(context, item, x, y, gx, gy) {\n if (item.fontSize <= 0) return false;\n if (!item.angle) return true; // bounds sufficient if no rotation\n\n // project point into space of unrotated bounds\n var p = anchorPoint(item),\n ax = p.x1,\n ay = p.y1,\n b = bound(tempBounds, item, 1),\n a = -item.angle * DegToRad,\n cos = Math.cos(a),\n sin = Math.sin(a),\n px = cos * gx - sin * gy + (ax - cos * ax + sin * ay),\n py = sin * gx + cos * gy + (ay - sin * ax - cos * ay);\n return b.contains(px, py);\n}\nfunction intersectText(item, box) {\n const p = bound(tempBounds, item, 2);\n return intersectBoxLine(box, p[0], p[1], p[2], p[3]) || intersectBoxLine(box, p[0], p[1], p[4], p[5]) || intersectBoxLine(box, p[4], p[5], p[6], p[7]) || intersectBoxLine(box, p[2], p[3], p[6], p[7]);\n}\nvar text = {\n type: 'text',\n tag: 'text',\n nested: false,\n attr: attr,\n bound: bound,\n draw: draw,\n pick: pick$1(hit),\n isect: intersectText\n};\n\nvar trail = markMultiItemPath('trail', trail$1, pickTrail);\n\nvar Marks = {\n arc: arc,\n area: area,\n group: group,\n image: image,\n line: line,\n path: path$2,\n rect: rect,\n rule: rule,\n shape: shape,\n symbol: symbol,\n text: text,\n trail: trail\n};\n\nfunction boundItem (item, func, opt) {\n var type = Marks[item.mark.marktype],\n bound = func || type.bound;\n if (type.nested) item = item.mark;\n return bound(item.bounds || (item.bounds = new Bounds()), item, opt);\n}\n\nvar DUMMY = {\n mark: null\n};\nfunction boundMark (mark, bounds, opt) {\n var type = Marks[mark.marktype],\n bound = type.bound,\n items = mark.items,\n hasItems = items && items.length,\n i,\n n,\n item,\n b;\n if (type.nested) {\n if (hasItems) {\n item = items[0];\n } else {\n // no items, fake it\n DUMMY.mark = mark;\n item = DUMMY;\n }\n b = boundItem(item, bound, opt);\n bounds = bounds && bounds.union(b) || b;\n return bounds;\n }\n bounds = bounds || mark.bounds && mark.bounds.clear() || new Bounds();\n if (hasItems) {\n for (i = 0, n = items.length; i < n; ++i) {\n bounds.union(boundItem(items[i], bound, opt));\n }\n }\n return mark.bounds = bounds;\n}\n\nconst keys = ['marktype', 'name', 'role', 'interactive', 'clip', 'items', 'zindex', 'x', 'y', 'width', 'height', 'align', 'baseline',\n// layout\n'fill', 'fillOpacity', 'opacity', 'blend',\n// fill\n'stroke', 'strokeOpacity', 'strokeWidth', 'strokeCap',\n// stroke\n'strokeDash', 'strokeDashOffset',\n// stroke dash\n'strokeForeground', 'strokeOffset',\n// group\n'startAngle', 'endAngle', 'innerRadius', 'outerRadius',\n// arc\n'cornerRadius', 'padAngle',\n// arc, rect\n'cornerRadiusTopLeft', 'cornerRadiusTopRight',\n// rect, group\n'cornerRadiusBottomLeft', 'cornerRadiusBottomRight', 'interpolate', 'tension', 'orient', 'defined',\n// area, line\n'url', 'aspect', 'smooth',\n// image\n'path', 'scaleX', 'scaleY',\n// path\n'x2', 'y2',\n// rule\n'size', 'shape',\n// symbol\n'text', 'angle', 'theta', 'radius', 'dir', 'dx', 'dy',\n// text\n'ellipsis', 'limit', 'lineBreak', 'lineHeight', 'font', 'fontSize', 'fontWeight', 'fontStyle', 'fontVariant',\n// font\n'description', 'aria', 'ariaRole', 'ariaRoleDescription' // aria\n];\n\nfunction sceneToJSON(scene, indent) {\n return JSON.stringify(scene, keys, indent);\n}\nfunction sceneFromJSON(json) {\n const scene = typeof json === 'string' ? JSON.parse(json) : json;\n return initialize(scene);\n}\nfunction initialize(scene) {\n var type = scene.marktype,\n items = scene.items,\n parent,\n i,\n n;\n if (items) {\n for (i = 0, n = items.length; i < n; ++i) {\n parent = type ? 'mark' : 'group';\n items[i][parent] = scene;\n if (items[i].zindex) items[i][parent].zdirty = true;\n if ('group' === (type || parent)) initialize(items[i]);\n }\n }\n if (type) boundMark(scene);\n return scene;\n}\n\nfunction Scenegraph(scene) {\n if (arguments.length) {\n this.root = sceneFromJSON(scene);\n } else {\n this.root = createMark({\n marktype: 'group',\n name: 'root',\n role: 'frame'\n });\n this.root.items = [new GroupItem(this.root)];\n }\n}\nScenegraph.prototype = {\n toJSON(indent) {\n return sceneToJSON(this.root, indent || 0);\n },\n mark(markdef, group, index) {\n group = group || this.root.items[0];\n const mark = createMark(markdef, group);\n group.items[index] = mark;\n if (mark.zindex) mark.group.zdirty = true;\n return mark;\n }\n};\nfunction createMark(def, group) {\n const mark = {\n bounds: new Bounds(),\n clip: !!def.clip,\n group: group,\n interactive: def.interactive === false ? false : true,\n items: [],\n marktype: def.marktype,\n name: def.name || undefined,\n role: def.role || undefined,\n zindex: def.zindex || 0\n };\n\n // add accessibility properties if defined\n if (def.aria != null) {\n mark.aria = def.aria;\n }\n if (def.description) {\n mark.description = def.description;\n }\n return mark;\n}\n\n// create a new DOM element\nfunction domCreate(doc, tag, ns) {\n if (!doc && typeof document !== 'undefined' && document.createElement) {\n doc = document;\n }\n return doc ? ns ? doc.createElementNS(ns, tag) : doc.createElement(tag) : null;\n}\n\n// find first child element with matching tag\nfunction domFind(el, tag) {\n tag = tag.toLowerCase();\n var nodes = el.childNodes,\n i = 0,\n n = nodes.length;\n for (; i < n; ++i) if (nodes[i].tagName.toLowerCase() === tag) {\n return nodes[i];\n }\n}\n\n// retrieve child element at given index\n// create & insert if doesn't exist or if tags do not match\nfunction domChild(el, index, tag, ns) {\n var a = el.childNodes[index],\n b;\n if (!a || a.tagName.toLowerCase() !== tag.toLowerCase()) {\n b = a || null;\n a = domCreate(el.ownerDocument, tag, ns);\n el.insertBefore(a, b);\n }\n return a;\n}\n\n// remove all child elements at or above the given index\nfunction domClear(el, index) {\n var nodes = el.childNodes,\n curr = nodes.length;\n while (curr > index) el.removeChild(nodes[--curr]);\n return el;\n}\n\n// generate css class name for mark\nfunction cssClass(mark) {\n return 'mark-' + mark.marktype + (mark.role ? ' role-' + mark.role : '') + (mark.name ? ' ' + mark.name : '');\n}\n\nfunction point (event, el) {\n const rect = el.getBoundingClientRect();\n return [event.clientX - rect.left - (el.clientLeft || 0), event.clientY - rect.top - (el.clientTop || 0)];\n}\n\nfunction resolveItem (item, event, el, origin) {\n var mark = item && item.mark,\n mdef,\n p;\n if (mark && (mdef = Marks[mark.marktype]).tip) {\n p = point(event, el);\n p[0] -= origin[0];\n p[1] -= origin[1];\n while (item = item.mark.group) {\n p[0] -= item.x || 0;\n p[1] -= item.y || 0;\n }\n item = mdef.tip(mark.items, p);\n }\n return item;\n}\n\n/**\n * Create a new Handler instance.\n * @param {object} [customLoader] - Optional loader instance for\n * href URL sanitization. If not specified, a standard loader\n * instance will be generated.\n * @param {function} [customTooltip] - Optional tooltip handler\n * function for custom tooltip display.\n * @constructor\n */\nfunction Handler(customLoader, customTooltip) {\n this._active = null;\n this._handlers = {};\n this._loader = customLoader || loader();\n this._tooltip = customTooltip || defaultTooltip;\n}\n\n// The default tooltip display handler.\n// Sets the HTML title attribute on the visualization container.\nfunction defaultTooltip(handler, event, item, value) {\n handler.element().setAttribute('title', value || '');\n}\nHandler.prototype = {\n /**\n * Initialize a new Handler instance.\n * @param {DOMElement} el - The containing DOM element for the display.\n * @param {Array} origin - The origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {object} [obj] - Optional context object that should serve as\n * the \"this\" context for event callbacks.\n * @return {Handler} - This handler instance.\n */\n initialize(el, origin, obj) {\n this._el = el;\n this._obj = obj || null;\n return this.origin(origin);\n },\n /**\n * Returns the parent container element for a visualization.\n * @return {DOMElement} - The containing DOM element.\n */\n element() {\n return this._el;\n },\n /**\n * Returns the scene element (e.g., canvas or SVG) of the visualization\n * Subclasses must override if the first child is not the scene element.\n * @return {DOMElement} - The scene (e.g., canvas or SVG) element.\n */\n canvas() {\n return this._el && this._el.firstChild;\n },\n /**\n * Get / set the origin coordinates of the visualization.\n */\n origin(origin) {\n if (arguments.length) {\n this._origin = origin || [0, 0];\n return this;\n } else {\n return this._origin.slice();\n }\n },\n /**\n * Get / set the scenegraph root.\n */\n scene(scene) {\n if (!arguments.length) return this._scene;\n this._scene = scene;\n return this;\n },\n /**\n * Add an event handler. Subclasses should override this method.\n */\n on( /*type, handler*/) {},\n /**\n * Remove an event handler. Subclasses should override this method.\n */\n off( /*type, handler*/) {},\n /**\n * Utility method for finding the array index of an event handler.\n * @param {Array} h - An array of registered event handlers.\n * @param {string} type - The event type.\n * @param {function} handler - The event handler instance to find.\n * @return {number} - The handler's array index or -1 if not registered.\n */\n _handlerIndex(h, type, handler) {\n for (let i = h ? h.length : 0; --i >= 0;) {\n if (h[i].type === type && (!handler || h[i].handler === handler)) {\n return i;\n }\n }\n return -1;\n },\n /**\n * Returns an array with registered event handlers.\n * @param {string} [type] - The event type to query. Any annotations\n * are ignored; for example, for the argument \"click.foo\", \".foo\" will\n * be ignored and the method returns all \"click\" handlers. If type is\n * null or unspecified, this method returns handlers for all types.\n * @return {Array} - A new array containing all registered event handlers.\n */\n handlers(type) {\n const h = this._handlers,\n a = [];\n if (type) {\n a.push(...h[this.eventName(type)]);\n } else {\n for (const k in h) {\n a.push(...h[k]);\n }\n }\n return a;\n },\n /**\n * Parses an event name string to return the specific event type.\n * For example, given \"click.foo\" returns \"click\"\n * @param {string} name - The input event type string.\n * @return {string} - A string with the event type only.\n */\n eventName(name) {\n const i = name.indexOf('.');\n return i < 0 ? name : name.slice(0, i);\n },\n /**\n * Handle hyperlink navigation in response to an item.href value.\n * @param {Event} event - The event triggering hyperlink navigation.\n * @param {Item} item - The scenegraph item.\n * @param {string} href - The URL to navigate to.\n */\n handleHref(event, item, href) {\n this._loader.sanitize(href, {\n context: 'href'\n }).then(opt => {\n const e = new MouseEvent(event.type, event),\n a = domCreate(null, 'a');\n for (const name in opt) a.setAttribute(name, opt[name]);\n a.dispatchEvent(e);\n }).catch(() => {/* do nothing */});\n },\n /**\n * Handle tooltip display in response to an item.tooltip value.\n * @param {Event} event - The event triggering tooltip display.\n * @param {Item} item - The scenegraph item.\n * @param {boolean} show - A boolean flag indicating whether\n * to show or hide a tooltip for the given item.\n */\n handleTooltip(event, item, show) {\n if (item && item.tooltip != null) {\n item = resolveItem(item, event, this.canvas(), this._origin);\n const value = show && item && item.tooltip || null;\n this._tooltip.call(this._obj, this, event, item, value);\n }\n },\n /**\n * Returns the size of a scenegraph item and its position relative\n * to the viewport.\n * @param {Item} item - The scenegraph item.\n * @return {object} - A bounding box object (compatible with the\n * DOMRect type) consisting of x, y, width, heigh, top, left,\n * right, and bottom properties.\n */\n getItemBoundingClientRect(item) {\n const el = this.canvas();\n if (!el) return;\n const rect = el.getBoundingClientRect(),\n origin = this._origin,\n bounds = item.bounds,\n width = bounds.width(),\n height = bounds.height();\n let x = bounds.x1 + origin[0] + rect.left,\n y = bounds.y1 + origin[1] + rect.top;\n\n // translate coordinate for each parent group\n while (item.mark && (item = item.mark.group)) {\n x += item.x || 0;\n y += item.y || 0;\n }\n\n // return DOMRect-compatible bounding box\n return {\n x,\n y,\n width,\n height,\n left: x,\n top: y,\n right: x + width,\n bottom: y + height\n };\n }\n};\n\n/**\n * Create a new Renderer instance.\n * @param {object} [loader] - Optional loader instance for\n * image and href URL sanitization. If not specified, a\n * standard loader instance will be generated.\n * @constructor\n */\nfunction Renderer(loader) {\n this._el = null;\n this._bgcolor = null;\n this._loader = new ResourceLoader(loader);\n}\nRenderer.prototype = {\n /**\n * Initialize a new Renderer instance.\n * @param {DOMElement} el - The containing DOM element for the display.\n * @param {number} width - The coordinate width of the display, in pixels.\n * @param {number} height - The coordinate height of the display, in pixels.\n * @param {Array} origin - The origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {Renderer} - This renderer instance.\n */\n initialize(el, width, height, origin, scaleFactor) {\n this._el = el;\n return this.resize(width, height, origin, scaleFactor);\n },\n /**\n * Returns the parent container element for a visualization.\n * @return {DOMElement} - The containing DOM element.\n */\n element() {\n return this._el;\n },\n /**\n * Returns the scene element (e.g., canvas or SVG) of the visualization\n * Subclasses must override if the first child is not the scene element.\n * @return {DOMElement} - The scene (e.g., canvas or SVG) element.\n */\n canvas() {\n return this._el && this._el.firstChild;\n },\n /**\n * Get / set the background color.\n */\n background(bgcolor) {\n if (arguments.length === 0) return this._bgcolor;\n this._bgcolor = bgcolor;\n return this;\n },\n /**\n * Resize the display.\n * @param {number} width - The new coordinate width of the display, in pixels.\n * @param {number} height - The new coordinate height of the display, in pixels.\n * @param {Array} origin - The new origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {Renderer} - This renderer instance;\n */\n resize(width, height, origin, scaleFactor) {\n this._width = width;\n this._height = height;\n this._origin = origin || [0, 0];\n this._scale = scaleFactor || 1;\n return this;\n },\n /**\n * Report a dirty item whose bounds should be redrawn.\n * This base class method does nothing. Subclasses that perform\n * incremental should implement this method.\n * @param {Item} item - The dirty item whose bounds should be redrawn.\n */\n dirty( /*item*/) {},\n /**\n * Render an input scenegraph, potentially with a set of dirty items.\n * This method will perform an immediate rendering with available resources.\n * The renderer may also need to perform image loading to perform a complete\n * render. This process can lead to asynchronous re-rendering of the scene\n * after this method returns. To receive notification when rendering is\n * complete, use the renderAsync method instead.\n * @param {object} scene - The root mark of a scenegraph to render.\n * @return {Renderer} - This renderer instance.\n */\n render(scene) {\n const r = this;\n\n // bind arguments into a render call, and cache it\n // this function may be subsequently called for async redraw\n r._call = function () {\n r._render(scene);\n };\n\n // invoke the renderer\n r._call();\n\n // clear the cached call for garbage collection\n // async redraws will stash their own copy\n r._call = null;\n return r;\n },\n /**\n * Internal rendering method. Renderer subclasses should override this\n * method to actually perform rendering.\n * @param {object} scene - The root mark of a scenegraph to render.\n */\n _render( /*scene*/\n ) {\n // subclasses to override\n },\n /**\n * Asynchronous rendering method. Similar to render, but returns a Promise\n * that resolves when all rendering is completed. Sometimes a renderer must\n * perform image loading to get a complete rendering. The returned\n * Promise will not resolve until this process completes.\n * @param {object} scene - The root mark of a scenegraph to render.\n * @return {Promise} - A Promise that resolves when rendering is complete.\n */\n renderAsync(scene) {\n const r = this.render(scene);\n return this._ready ? this._ready.then(() => r) : Promise.resolve(r);\n },\n /**\n * Internal method for asynchronous resource loading.\n * Proxies method calls to the ImageLoader, and tracks loading\n * progress to invoke a re-render once complete.\n * @param {string} method - The method name to invoke on the ImageLoader.\n * @param {string} uri - The URI for the requested resource.\n * @return {Promise} - A Promise that resolves to the requested resource.\n */\n _load(method, uri) {\n var r = this,\n p = r._loader[method](uri);\n if (!r._ready) {\n // re-render the scene when loading completes\n const call = r._call;\n r._ready = r._loader.ready().then(redraw => {\n if (redraw) call();\n r._ready = null;\n });\n }\n return p;\n },\n /**\n * Sanitize a URL to include as a hyperlink in the rendered scene.\n * This method proxies a call to ImageLoader.sanitizeURL, but also tracks\n * image loading progress and invokes a re-render once complete.\n * @param {string} uri - The URI string to sanitize.\n * @return {Promise} - A Promise that resolves to the sanitized URL.\n */\n sanitizeURL(uri) {\n return this._load('sanitizeURL', uri);\n },\n /**\n * Requests an image to include in the rendered scene.\n * This method proxies a call to ImageLoader.loadImage, but also tracks\n * image loading progress and invokes a re-render once complete.\n * @param {string} uri - The URI string of the image.\n * @return {Promise} - A Promise that resolves to the loaded Image.\n */\n loadImage(uri) {\n return this._load('loadImage', uri);\n }\n};\n\nconst KeyDownEvent = 'keydown';\nconst KeyPressEvent = 'keypress';\nconst KeyUpEvent = 'keyup';\nconst DragEnterEvent = 'dragenter';\nconst DragLeaveEvent = 'dragleave';\nconst DragOverEvent = 'dragover';\nconst MouseDownEvent = 'mousedown';\nconst MouseUpEvent = 'mouseup';\nconst MouseMoveEvent = 'mousemove';\nconst MouseOutEvent = 'mouseout';\nconst MouseOverEvent = 'mouseover';\nconst ClickEvent = 'click';\nconst DoubleClickEvent = 'dblclick';\nconst WheelEvent = 'wheel';\nconst MouseWheelEvent = 'mousewheel';\nconst TouchStartEvent = 'touchstart';\nconst TouchMoveEvent = 'touchmove';\nconst TouchEndEvent = 'touchend';\nconst Events = [KeyDownEvent, KeyPressEvent, KeyUpEvent, DragEnterEvent, DragLeaveEvent, DragOverEvent, MouseDownEvent, MouseUpEvent, MouseMoveEvent, MouseOutEvent, MouseOverEvent, ClickEvent, DoubleClickEvent, WheelEvent, MouseWheelEvent, TouchStartEvent, TouchMoveEvent, TouchEndEvent];\nconst TooltipShowEvent = MouseMoveEvent;\nconst TooltipHideEvent = MouseOutEvent;\nconst HrefEvent = ClickEvent;\n\nfunction CanvasHandler(loader, tooltip) {\n Handler.call(this, loader, tooltip);\n this._down = null;\n this._touch = null;\n this._first = true;\n this._events = {};\n}\nconst eventBundle = type => type === TouchStartEvent || type === TouchMoveEvent || type === TouchEndEvent ? [TouchStartEvent, TouchMoveEvent, TouchEndEvent] : [type];\n\n// lazily add listeners to the canvas as needed\nfunction eventListenerCheck(handler, type) {\n eventBundle(type).forEach(_ => addEventListener(handler, _));\n}\nfunction addEventListener(handler, type) {\n const canvas = handler.canvas();\n if (canvas && !handler._events[type]) {\n handler._events[type] = 1;\n canvas.addEventListener(type, handler[type] ? evt => handler[type](evt) : evt => handler.fire(type, evt));\n }\n}\nfunction move(moveEvent, overEvent, outEvent) {\n return function (evt) {\n const a = this._active,\n p = this.pickEvent(evt);\n if (p === a) {\n // active item and picked item are the same\n this.fire(moveEvent, evt); // fire move\n } else {\n // active item and picked item are different\n if (!a || !a.exit) {\n // fire out for prior active item\n // suppress if active item was removed from scene\n this.fire(outEvent, evt);\n }\n this._active = p; // set new active item\n this.fire(overEvent, evt); // fire over for new active item\n this.fire(moveEvent, evt); // fire move for new active item\n }\n };\n}\n\nfunction inactive(type) {\n return function (evt) {\n this.fire(type, evt);\n this._active = null;\n };\n}\ninherits(CanvasHandler, Handler, {\n initialize(el, origin, obj) {\n this._canvas = el && domFind(el, 'canvas');\n\n // add minimal events required for proper state management\n [ClickEvent, MouseDownEvent, MouseMoveEvent, MouseOutEvent, DragLeaveEvent].forEach(type => eventListenerCheck(this, type));\n return Handler.prototype.initialize.call(this, el, origin, obj);\n },\n // return the backing canvas instance\n canvas() {\n return this._canvas;\n },\n // retrieve the current canvas context\n context() {\n return this._canvas.getContext('2d');\n },\n // supported events\n events: Events,\n // to keep old versions of firefox happy\n DOMMouseScroll(evt) {\n this.fire(MouseWheelEvent, evt);\n },\n mousemove: move(MouseMoveEvent, MouseOverEvent, MouseOutEvent),\n dragover: move(DragOverEvent, DragEnterEvent, DragLeaveEvent),\n mouseout: inactive(MouseOutEvent),\n dragleave: inactive(DragLeaveEvent),\n mousedown(evt) {\n this._down = this._active;\n this.fire(MouseDownEvent, evt);\n },\n click(evt) {\n if (this._down === this._active) {\n this.fire(ClickEvent, evt);\n this._down = null;\n }\n },\n touchstart(evt) {\n this._touch = this.pickEvent(evt.changedTouches[0]);\n if (this._first) {\n this._active = this._touch;\n this._first = false;\n }\n this.fire(TouchStartEvent, evt, true);\n },\n touchmove(evt) {\n this.fire(TouchMoveEvent, evt, true);\n },\n touchend(evt) {\n this.fire(TouchEndEvent, evt, true);\n this._touch = null;\n },\n // fire an event\n fire(type, evt, touch) {\n const a = touch ? this._touch : this._active,\n h = this._handlers[type];\n\n // set event type relative to scenegraph items\n evt.vegaType = type;\n\n // handle hyperlinks and tooltips first\n if (type === HrefEvent && a && a.href) {\n this.handleHref(evt, a, a.href);\n } else if (type === TooltipShowEvent || type === TooltipHideEvent) {\n this.handleTooltip(evt, a, type !== TooltipHideEvent);\n }\n\n // invoke all registered handlers\n if (h) {\n for (let i = 0, len = h.length; i < len; ++i) {\n h[i].handler.call(this._obj, evt, a);\n }\n }\n },\n // add an event handler\n on(type, handler) {\n const name = this.eventName(type),\n h = this._handlers,\n i = this._handlerIndex(h[name], type, handler);\n if (i < 0) {\n eventListenerCheck(this, type);\n (h[name] || (h[name] = [])).push({\n type: type,\n handler: handler\n });\n }\n return this;\n },\n // remove an event handler\n off(type, handler) {\n const name = this.eventName(type),\n h = this._handlers[name],\n i = this._handlerIndex(h, type, handler);\n if (i >= 0) {\n h.splice(i, 1);\n }\n return this;\n },\n pickEvent(evt) {\n const p = point(evt, this._canvas),\n o = this._origin;\n return this.pick(this._scene, p[0], p[1], p[0] - o[0], p[1] - o[1]);\n },\n // find the scenegraph item at the current mouse position\n // x, y -- the absolute x, y mouse coordinates on the canvas element\n // gx, gy -- the relative coordinates within the current group\n pick(scene, x, y, gx, gy) {\n const g = this.context(),\n mark = Marks[scene.marktype];\n return mark.pick.call(this, g, scene, x, y, gx, gy);\n }\n});\n\nfunction devicePixelRatio() {\n return typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1;\n}\nvar pixelRatio = devicePixelRatio();\nfunction resize (canvas, width, height, origin, scaleFactor, opt) {\n const inDOM = typeof HTMLElement !== 'undefined' && canvas instanceof HTMLElement && canvas.parentNode != null,\n context = canvas.getContext('2d'),\n ratio = inDOM ? pixelRatio : scaleFactor;\n canvas.width = width * ratio;\n canvas.height = height * ratio;\n for (const key in opt) {\n context[key] = opt[key];\n }\n if (inDOM && ratio !== 1) {\n canvas.style.width = width + 'px';\n canvas.style.height = height + 'px';\n }\n context.pixelRatio = ratio;\n context.setTransform(ratio, 0, 0, ratio, ratio * origin[0], ratio * origin[1]);\n return canvas;\n}\n\nfunction CanvasRenderer(loader) {\n Renderer.call(this, loader);\n this._options = {};\n this._redraw = false;\n this._dirty = new Bounds();\n this._tempb = new Bounds();\n}\nconst base$1 = Renderer.prototype;\nconst viewBounds = (origin, width, height) => new Bounds().set(0, 0, width, height).translate(-origin[0], -origin[1]);\nfunction clipToBounds(g, b, origin) {\n // expand bounds by 1 pixel, then round to pixel boundaries\n b.expand(1).round();\n\n // align to base pixel grid in case of non-integer scaling (#2425)\n if (g.pixelRatio % 1) {\n b.scale(g.pixelRatio).round().scale(1 / g.pixelRatio);\n }\n\n // to avoid artifacts translate if origin has fractional pixels\n b.translate(-(origin[0] % 1), -(origin[1] % 1));\n\n // set clip path\n g.beginPath();\n g.rect(b.x1, b.y1, b.width(), b.height());\n g.clip();\n return b;\n}\ninherits(CanvasRenderer, Renderer, {\n initialize(el, width, height, origin, scaleFactor, options) {\n this._options = options || {};\n this._canvas = this._options.externalContext ? null : canvas(1, 1, this._options.type); // instantiate a small canvas\n\n if (el && this._canvas) {\n domClear(el, 0).appendChild(this._canvas);\n this._canvas.setAttribute('class', 'marks');\n }\n\n // this method will invoke resize to size the canvas appropriately\n return base$1.initialize.call(this, el, width, height, origin, scaleFactor);\n },\n resize(width, height, origin, scaleFactor) {\n base$1.resize.call(this, width, height, origin, scaleFactor);\n if (this._canvas) {\n // configure canvas size and transform\n resize(this._canvas, this._width, this._height, this._origin, this._scale, this._options.context);\n } else {\n // external context needs to be scaled and positioned to origin\n const ctx = this._options.externalContext;\n if (!ctx) error('CanvasRenderer is missing a valid canvas or context');\n ctx.scale(this._scale, this._scale);\n ctx.translate(this._origin[0], this._origin[1]);\n }\n this._redraw = true;\n return this;\n },\n canvas() {\n return this._canvas;\n },\n context() {\n return this._options.externalContext || (this._canvas ? this._canvas.getContext('2d') : null);\n },\n dirty(item) {\n const b = this._tempb.clear().union(item.bounds);\n let g = item.mark.group;\n while (g) {\n b.translate(g.x || 0, g.y || 0);\n g = g.mark.group;\n }\n this._dirty.union(b);\n },\n _render(scene) {\n const g = this.context(),\n o = this._origin,\n w = this._width,\n h = this._height,\n db = this._dirty,\n vb = viewBounds(o, w, h);\n\n // setup\n g.save();\n const b = this._redraw || db.empty() ? (this._redraw = false, vb.expand(1)) : clipToBounds(g, vb.intersect(db), o);\n this.clear(-o[0], -o[1], w, h);\n\n // render\n this.draw(g, scene, b);\n\n // takedown\n g.restore();\n db.clear();\n return this;\n },\n draw(ctx, scene, bounds) {\n const mark = Marks[scene.marktype];\n if (scene.clip) clip(ctx, scene);\n mark.draw.call(this, ctx, scene, bounds);\n if (scene.clip) ctx.restore();\n },\n clear(x, y, w, h) {\n const opt = this._options,\n g = this.context();\n if (opt.type !== 'pdf' && !opt.externalContext) {\n // calling clear rect voids vector output in pdf mode\n // and could remove external context content (#2615)\n g.clearRect(x, y, w, h);\n }\n if (this._bgcolor != null) {\n g.fillStyle = this._bgcolor;\n g.fillRect(x, y, w, h);\n }\n }\n});\n\nfunction SVGHandler(loader, tooltip) {\n Handler.call(this, loader, tooltip);\n const h = this;\n h._hrefHandler = listener(h, (evt, item) => {\n if (item && item.href) h.handleHref(evt, item, item.href);\n });\n h._tooltipHandler = listener(h, (evt, item) => {\n h.handleTooltip(evt, item, evt.type !== TooltipHideEvent);\n });\n}\n\n// wrap an event listener for the SVG DOM\nconst listener = (context, handler) => evt => {\n let item = evt.target.__data__;\n item = Array.isArray(item) ? item[0] : item;\n evt.vegaType = evt.type;\n handler.call(context._obj, evt, item);\n};\ninherits(SVGHandler, Handler, {\n initialize(el, origin, obj) {\n let svg = this._svg;\n if (svg) {\n svg.removeEventListener(HrefEvent, this._hrefHandler);\n svg.removeEventListener(TooltipShowEvent, this._tooltipHandler);\n svg.removeEventListener(TooltipHideEvent, this._tooltipHandler);\n }\n this._svg = svg = el && domFind(el, 'svg');\n if (svg) {\n svg.addEventListener(HrefEvent, this._hrefHandler);\n svg.addEventListener(TooltipShowEvent, this._tooltipHandler);\n svg.addEventListener(TooltipHideEvent, this._tooltipHandler);\n }\n return Handler.prototype.initialize.call(this, el, origin, obj);\n },\n canvas() {\n return this._svg;\n },\n // add an event handler\n on(type, handler) {\n const name = this.eventName(type),\n h = this._handlers,\n i = this._handlerIndex(h[name], type, handler);\n if (i < 0) {\n const x = {\n type,\n handler,\n listener: listener(this, handler)\n };\n (h[name] || (h[name] = [])).push(x);\n if (this._svg) {\n this._svg.addEventListener(name, x.listener);\n }\n }\n return this;\n },\n // remove an event handler\n off(type, handler) {\n const name = this.eventName(type),\n h = this._handlers[name],\n i = this._handlerIndex(h, type, handler);\n if (i >= 0) {\n if (this._svg) {\n this._svg.removeEventListener(name, h[i].listener);\n }\n h.splice(i, 1);\n }\n return this;\n }\n});\n\nconst ARIA_HIDDEN = 'aria-hidden';\nconst ARIA_LABEL = 'aria-label';\nconst ARIA_ROLE = 'role';\nconst ARIA_ROLEDESCRIPTION = 'aria-roledescription';\nconst GRAPHICS_OBJECT = 'graphics-object';\nconst GRAPHICS_SYMBOL = 'graphics-symbol';\nconst bundle = (role, roledesc, label) => ({\n [ARIA_ROLE]: role,\n [ARIA_ROLEDESCRIPTION]: roledesc,\n [ARIA_LABEL]: label || undefined\n});\n\n// these roles are covered by related roles\n// we can ignore them, no need to generate attributes\nconst AriaIgnore = toSet(['axis-domain', 'axis-grid', 'axis-label', 'axis-tick', 'axis-title', 'legend-band', 'legend-entry', 'legend-gradient', 'legend-label', 'legend-title', 'legend-symbol', 'title']);\n\n// aria attribute generators for guide roles\nconst AriaGuides = {\n 'axis': {\n desc: 'axis',\n caption: axisCaption\n },\n 'legend': {\n desc: 'legend',\n caption: legendCaption\n },\n 'title-text': {\n desc: 'title',\n caption: item => `Title text '${titleCaption(item)}'`\n },\n 'title-subtitle': {\n desc: 'subtitle',\n caption: item => `Subtitle text '${titleCaption(item)}'`\n }\n};\n\n// aria properties generated for mark item encoding channels\nconst AriaEncode = {\n ariaRole: ARIA_ROLE,\n ariaRoleDescription: ARIA_ROLEDESCRIPTION,\n description: ARIA_LABEL\n};\nfunction ariaItemAttributes(emit, item) {\n const hide = item.aria === false;\n emit(ARIA_HIDDEN, hide || undefined);\n if (hide || item.description == null) {\n for (const prop in AriaEncode) {\n emit(AriaEncode[prop], undefined);\n }\n } else {\n const type = item.mark.marktype;\n emit(ARIA_LABEL, item.description);\n emit(ARIA_ROLE, item.ariaRole || (type === 'group' ? GRAPHICS_OBJECT : GRAPHICS_SYMBOL));\n emit(ARIA_ROLEDESCRIPTION, item.ariaRoleDescription || `${type} mark`);\n }\n}\nfunction ariaMarkAttributes(mark) {\n return mark.aria === false ? {\n [ARIA_HIDDEN]: true\n } : AriaIgnore[mark.role] ? null : AriaGuides[mark.role] ? ariaGuide(mark, AriaGuides[mark.role]) : ariaMark(mark);\n}\nfunction ariaMark(mark) {\n const type = mark.marktype;\n const recurse = type === 'group' || type === 'text' || mark.items.some(_ => _.description != null && _.aria !== false);\n return bundle(recurse ? GRAPHICS_OBJECT : GRAPHICS_SYMBOL, `${type} mark container`, mark.description);\n}\nfunction ariaGuide(mark, opt) {\n try {\n const item = mark.items[0],\n caption = opt.caption || (() => '');\n return bundle(opt.role || GRAPHICS_SYMBOL, opt.desc, item.description || caption(item));\n } catch (err) {\n return null;\n }\n}\nfunction titleCaption(item) {\n return array(item.text).join(' ');\n}\nfunction axisCaption(item) {\n const datum = item.datum,\n orient = item.orient,\n title = datum.title ? extractTitle(item) : null,\n ctx = item.context,\n scale = ctx.scales[datum.scale].value,\n locale = ctx.dataflow.locale(),\n type = scale.type,\n xy = orient === 'left' || orient === 'right' ? 'Y' : 'X';\n return `${xy}-axis` + (title ? ` titled '${title}'` : '') + ` for a ${isDiscrete(type) ? 'discrete' : type} scale` + ` with ${domainCaption(locale, scale, item)}`;\n}\nfunction legendCaption(item) {\n const datum = item.datum,\n title = datum.title ? extractTitle(item) : null,\n type = `${datum.type || ''} legend`.trim(),\n scales = datum.scales,\n props = Object.keys(scales),\n ctx = item.context,\n scale = ctx.scales[scales[props[0]]].value,\n locale = ctx.dataflow.locale();\n return capitalize(type) + (title ? ` titled '${title}'` : '') + ` for ${channelCaption(props)}` + ` with ${domainCaption(locale, scale, item)}`;\n}\nfunction extractTitle(item) {\n try {\n return array(peek(item.items).items[0].text).join(' ');\n } catch (err) {\n return null;\n }\n}\nfunction channelCaption(props) {\n props = props.map(p => p + (p === 'fill' || p === 'stroke' ? ' color' : ''));\n return props.length < 2 ? props[0] : props.slice(0, -1).join(', ') + ' and ' + peek(props);\n}\nfunction capitalize(s) {\n return s.length ? s[0].toUpperCase() + s.slice(1) : s;\n}\n\nconst innerText = val => (val + '').replace(/&/g, '&').replace(//g, '>');\nconst attrText = val => innerText(val).replace(/\"/g, '"').replace(/\\t/g, ' ').replace(/\\n/g, ' ').replace(/\\r/g, ' ');\nfunction markup() {\n let buf = '',\n outer = '',\n inner = '';\n const stack = [],\n clear = () => outer = inner = '',\n push = tag => {\n if (outer) {\n buf += `${outer}>${inner}`;\n clear();\n }\n stack.push(tag);\n },\n attr = (name, value) => {\n if (value != null) outer += ` ${name}=\"${attrText(value)}\"`;\n return m;\n },\n m = {\n open(tag) {\n push(tag);\n outer = '<' + tag;\n for (var _len = arguments.length, attrs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n attrs[_key - 1] = arguments[_key];\n }\n for (const set of attrs) {\n for (const key in set) attr(key, set[key]);\n }\n return m;\n },\n close() {\n const tag = stack.pop();\n if (outer) {\n buf += outer + (inner ? `>${inner}` : '/>');\n } else {\n buf += ``;\n }\n clear();\n return m;\n },\n attr,\n text: t => (inner += innerText(t), m),\n toString: () => buf\n };\n return m;\n}\nconst serializeXML = node => _serialize(markup(), node) + '';\nfunction _serialize(m, node) {\n m.open(node.tagName);\n if (node.hasAttributes()) {\n const attrs = node.attributes,\n n = attrs.length;\n for (let i = 0; i < n; ++i) {\n m.attr(attrs[i].name, attrs[i].value);\n }\n }\n if (node.hasChildNodes()) {\n const children = node.childNodes;\n for (const child of children) {\n child.nodeType === 3 // text node\n ? m.text(child.nodeValue) : _serialize(m, child);\n }\n }\n return m.close();\n}\n\nconst stylesAttr = {\n fill: 'fill',\n fillOpacity: 'fill-opacity',\n stroke: 'stroke',\n strokeOpacity: 'stroke-opacity',\n strokeWidth: 'stroke-width',\n strokeCap: 'stroke-linecap',\n strokeJoin: 'stroke-linejoin',\n strokeDash: 'stroke-dasharray',\n strokeDashOffset: 'stroke-dashoffset',\n strokeMiterLimit: 'stroke-miterlimit',\n opacity: 'opacity'\n};\nconst stylesCss = {\n blend: 'mix-blend-mode'\n};\n\n// ensure miter limit default is consistent with canvas (#2498)\nconst rootAttributes = {\n 'fill': 'none',\n 'stroke-miterlimit': 10\n};\n\nconst RootIndex = 0,\n xmlns = 'http://www.w3.org/2000/xmlns/',\n svgns = metadata.xmlns;\nfunction SVGRenderer(loader) {\n Renderer.call(this, loader);\n this._dirtyID = 0;\n this._dirty = [];\n this._svg = null;\n this._root = null;\n this._defs = null;\n}\nconst base = Renderer.prototype;\ninherits(SVGRenderer, Renderer, {\n /**\n * Initialize a new SVGRenderer instance.\n * @param {DOMElement} el - The containing DOM element for the display.\n * @param {number} width - The coordinate width of the display, in pixels.\n * @param {number} height - The coordinate height of the display, in pixels.\n * @param {Array} origin - The origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {SVGRenderer} - This renderer instance.\n */\n initialize(el, width, height, origin, scaleFactor) {\n // create the svg definitions cache\n this._defs = {};\n this._clearDefs();\n if (el) {\n this._svg = domChild(el, 0, 'svg', svgns);\n this._svg.setAttributeNS(xmlns, 'xmlns', svgns);\n this._svg.setAttributeNS(xmlns, 'xmlns:xlink', metadata['xmlns:xlink']);\n this._svg.setAttribute('version', metadata['version']);\n this._svg.setAttribute('class', 'marks');\n domClear(el, 1);\n\n // set the svg root group\n this._root = domChild(this._svg, RootIndex, 'g', svgns);\n setAttributes(this._root, rootAttributes);\n\n // ensure no additional child elements\n domClear(this._svg, RootIndex + 1);\n }\n\n // set background color if defined\n this.background(this._bgcolor);\n return base.initialize.call(this, el, width, height, origin, scaleFactor);\n },\n /**\n * Get / set the background color.\n */\n background(bgcolor) {\n if (arguments.length && this._svg) {\n this._svg.style.setProperty('background-color', bgcolor);\n }\n return base.background.apply(this, arguments);\n },\n /**\n * Resize the display.\n * @param {number} width - The new coordinate width of the display, in pixels.\n * @param {number} height - The new coordinate height of the display, in pixels.\n * @param {Array} origin - The new origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {SVGRenderer} - This renderer instance;\n */\n resize(width, height, origin, scaleFactor) {\n base.resize.call(this, width, height, origin, scaleFactor);\n if (this._svg) {\n setAttributes(this._svg, {\n width: this._width * this._scale,\n height: this._height * this._scale,\n viewBox: `0 0 ${this._width} ${this._height}`\n });\n this._root.setAttribute('transform', `translate(${this._origin})`);\n }\n this._dirty = [];\n return this;\n },\n /**\n * Returns the SVG element of the visualization.\n * @return {DOMElement} - The SVG element.\n */\n canvas() {\n return this._svg;\n },\n /**\n * Returns an SVG text string for the rendered content,\n * or null if this renderer is currently headless.\n */\n svg() {\n const svg = this._svg,\n bg = this._bgcolor;\n if (!svg) return null;\n let node;\n if (bg) {\n svg.removeAttribute('style');\n node = domChild(svg, RootIndex, 'rect', svgns);\n setAttributes(node, {\n width: this._width,\n height: this._height,\n fill: bg\n });\n }\n const text = serializeXML(svg);\n if (bg) {\n svg.removeChild(node);\n this._svg.style.setProperty('background-color', bg);\n }\n return text;\n },\n /**\n * Internal rendering method.\n * @param {object} scene - The root mark of a scenegraph to render.\n */\n _render(scene) {\n // perform spot updates and re-render markup\n if (this._dirtyCheck()) {\n if (this._dirtyAll) this._clearDefs();\n this.mark(this._root, scene);\n domClear(this._root, 1);\n }\n this.defs();\n this._dirty = [];\n ++this._dirtyID;\n return this;\n },\n // -- Manage rendering of items marked as dirty --\n\n /**\n * Flag a mark item as dirty.\n * @param {Item} item - The mark item.\n */\n dirty(item) {\n if (item.dirty !== this._dirtyID) {\n item.dirty = this._dirtyID;\n this._dirty.push(item);\n }\n },\n /**\n * Check if a mark item is considered dirty.\n * @param {Item} item - The mark item.\n */\n isDirty(item) {\n return this._dirtyAll || !item._svg || !item._svg.ownerSVGElement || item.dirty === this._dirtyID;\n },\n /**\n * Internal method to check dirty status and, if possible,\n * make targetted updates without a full rendering pass.\n */\n _dirtyCheck() {\n this._dirtyAll = true;\n const items = this._dirty;\n if (!items.length || !this._dirtyID) return true;\n const id = ++this._dirtyID;\n let item, mark, type, mdef, i, n, o;\n for (i = 0, n = items.length; i < n; ++i) {\n item = items[i];\n mark = item.mark;\n if (mark.marktype !== type) {\n // memoize mark instance lookup\n type = mark.marktype;\n mdef = Marks[type];\n }\n if (mark.zdirty && mark.dirty !== id) {\n this._dirtyAll = false;\n dirtyParents(item, id);\n mark.items.forEach(i => {\n i.dirty = id;\n });\n }\n if (mark.zdirty) continue; // handle in standard drawing pass\n\n if (item.exit) {\n // EXIT\n if (mdef.nested && mark.items.length) {\n // if nested mark with remaining points, update instead\n o = mark.items[0];\n if (o._svg) this._update(mdef, o._svg, o);\n } else if (item._svg) {\n // otherwise remove from DOM\n o = item._svg.parentNode;\n if (o) o.removeChild(item._svg);\n }\n item._svg = null;\n continue;\n }\n item = mdef.nested ? mark.items[0] : item;\n if (item._update === id) continue; // already visited\n\n if (!item._svg || !item._svg.ownerSVGElement) {\n // ENTER\n this._dirtyAll = false;\n dirtyParents(item, id);\n } else {\n // IN-PLACE UPDATE\n this._update(mdef, item._svg, item);\n }\n item._update = id;\n }\n return !this._dirtyAll;\n },\n // -- Construct & maintain scenegraph to SVG mapping ---\n\n /**\n * Render a set of mark items.\n * @param {SVGElement} el - The parent element in the SVG tree.\n * @param {object} scene - The mark parent to render.\n * @param {SVGElement} prev - The previous sibling in the SVG tree.\n */\n mark(el, scene, prev) {\n if (!this.isDirty(scene)) {\n return scene._svg;\n }\n const svg = this._svg,\n mdef = Marks[scene.marktype],\n events = scene.interactive === false ? 'none' : null,\n isGroup = mdef.tag === 'g';\n const parent = bind(scene, el, prev, 'g', svg);\n parent.setAttribute('class', cssClass(scene));\n\n // apply aria attributes to parent container element\n const aria = ariaMarkAttributes(scene);\n for (const key in aria) setAttribute(parent, key, aria[key]);\n if (!isGroup) {\n setAttribute(parent, 'pointer-events', events);\n }\n setAttribute(parent, 'clip-path', scene.clip ? clip$1(this, scene, scene.group) : null);\n let sibling = null,\n i = 0;\n const process = item => {\n const dirty = this.isDirty(item),\n node = bind(item, parent, sibling, mdef.tag, svg);\n if (dirty) {\n this._update(mdef, node, item);\n if (isGroup) recurse(this, node, item);\n }\n sibling = node;\n ++i;\n };\n if (mdef.nested) {\n if (scene.items.length) process(scene.items[0]);\n } else {\n visit(scene, process);\n }\n domClear(parent, i);\n return parent;\n },\n /**\n * Update the attributes of an SVG element for a mark item.\n * @param {object} mdef - The mark definition object\n * @param {SVGElement} el - The SVG element.\n * @param {Item} item - The mark item.\n */\n _update(mdef, el, item) {\n // set dom element and values cache\n // provides access to emit method\n element = el;\n values = el.__values__;\n\n // apply aria-specific properties\n ariaItemAttributes(emit, item);\n\n // apply svg attributes\n mdef.attr(emit, item, this);\n\n // some marks need special treatment\n const extra = mark_extras[mdef.type];\n if (extra) extra.call(this, mdef, el, item);\n\n // apply svg style attributes\n // note: element state may have been modified by 'extra' method\n if (element) this.style(element, item);\n },\n /**\n * Update the presentation attributes of an SVG element for a mark item.\n * @param {SVGElement} el - The SVG element.\n * @param {Item} item - The mark item.\n */\n style(el, item) {\n if (item == null) return;\n for (const prop in stylesAttr) {\n let value = prop === 'font' ? fontFamily(item) : item[prop];\n if (value === values[prop]) continue;\n const name = stylesAttr[prop];\n if (value == null) {\n el.removeAttribute(name);\n } else {\n if (isGradient(value)) {\n value = gradientRef(value, this._defs.gradient, href());\n }\n el.setAttribute(name, value + '');\n }\n values[prop] = value;\n }\n for (const prop in stylesCss) {\n setStyle(el, stylesCss[prop], item[prop]);\n }\n },\n /**\n * Render SVG defs, as needed.\n * Must be called *after* marks have been processed to ensure the\n * collected state is current and accurate.\n */\n defs() {\n const svg = this._svg,\n defs = this._defs;\n let el = defs.el,\n index = 0;\n for (const id in defs.gradient) {\n if (!el) defs.el = el = domChild(svg, RootIndex + 1, 'defs', svgns);\n index = updateGradient(el, defs.gradient[id], index);\n }\n for (const id in defs.clipping) {\n if (!el) defs.el = el = domChild(svg, RootIndex + 1, 'defs', svgns);\n index = updateClipping(el, defs.clipping[id], index);\n }\n\n // clean-up\n if (el) {\n index === 0 ? (svg.removeChild(el), defs.el = null) : domClear(el, index);\n }\n },\n /**\n * Clear defs caches.\n */\n _clearDefs() {\n const def = this._defs;\n def.gradient = {};\n def.clipping = {};\n }\n});\n\n// mark ancestor chain with a dirty id\nfunction dirtyParents(item, id) {\n for (; item && item.dirty !== id; item = item.mark.group) {\n item.dirty = id;\n if (item.mark && item.mark.dirty !== id) {\n item.mark.dirty = id;\n } else return;\n }\n}\n\n// update gradient definitions\nfunction updateGradient(el, grad, index) {\n let i, n, stop;\n if (grad.gradient === 'radial') {\n // SVG radial gradients automatically transform to normalized bbox\n // coordinates, in a way that is cumbersome to replicate in canvas.\n // We wrap the radial gradient in a pattern element, allowing us to\n // maintain a circular gradient that matches what canvas provides.\n let pt = domChild(el, index++, 'pattern', svgns);\n setAttributes(pt, {\n id: patternPrefix + grad.id,\n viewBox: '0,0,1,1',\n width: '100%',\n height: '100%',\n preserveAspectRatio: 'xMidYMid slice'\n });\n pt = domChild(pt, 0, 'rect', svgns);\n setAttributes(pt, {\n width: 1,\n height: 1,\n fill: `url(${href()}#${grad.id})`\n });\n el = domChild(el, index++, 'radialGradient', svgns);\n setAttributes(el, {\n id: grad.id,\n fx: grad.x1,\n fy: grad.y1,\n fr: grad.r1,\n cx: grad.x2,\n cy: grad.y2,\n r: grad.r2\n });\n } else {\n el = domChild(el, index++, 'linearGradient', svgns);\n setAttributes(el, {\n id: grad.id,\n x1: grad.x1,\n x2: grad.x2,\n y1: grad.y1,\n y2: grad.y2\n });\n }\n for (i = 0, n = grad.stops.length; i < n; ++i) {\n stop = domChild(el, i, 'stop', svgns);\n stop.setAttribute('offset', grad.stops[i].offset);\n stop.setAttribute('stop-color', grad.stops[i].color);\n }\n domClear(el, i);\n return index;\n}\n\n// update clipping path definitions\nfunction updateClipping(el, clip, index) {\n let mask;\n el = domChild(el, index, 'clipPath', svgns);\n el.setAttribute('id', clip.id);\n if (clip.path) {\n mask = domChild(el, 0, 'path', svgns);\n mask.setAttribute('d', clip.path);\n } else {\n mask = domChild(el, 0, 'rect', svgns);\n setAttributes(mask, {\n x: 0,\n y: 0,\n width: clip.width,\n height: clip.height\n });\n }\n domClear(el, 1);\n return index + 1;\n}\n\n// Recursively process group contents.\nfunction recurse(renderer, el, group) {\n // child 'g' element is second to last among children (path, g, path)\n // other children here are foreground and background path elements\n el = el.lastChild.previousSibling;\n let prev,\n idx = 0;\n visit(group, item => {\n prev = renderer.mark(el, item, prev);\n ++idx;\n });\n\n // remove any extraneous DOM elements\n domClear(el, 1 + idx);\n}\n\n// Bind a scenegraph item to an SVG DOM element.\n// Create new SVG elements as needed.\nfunction bind(item, el, sibling, tag, svg) {\n let node = item._svg,\n doc;\n\n // create a new dom node if needed\n if (!node) {\n doc = el.ownerDocument;\n node = domCreate(doc, tag, svgns);\n item._svg = node;\n if (item.mark) {\n node.__data__ = item;\n node.__values__ = {\n fill: 'default'\n };\n\n // if group, create background, content, and foreground elements\n if (tag === 'g') {\n const bg = domCreate(doc, 'path', svgns);\n node.appendChild(bg);\n bg.__data__ = item;\n const cg = domCreate(doc, 'g', svgns);\n node.appendChild(cg);\n cg.__data__ = item;\n const fg = domCreate(doc, 'path', svgns);\n node.appendChild(fg);\n fg.__data__ = item;\n fg.__values__ = {\n fill: 'default'\n };\n }\n }\n }\n\n // (re-)insert if (a) not contained in SVG or (b) sibling order has changed\n if (node.ownerSVGElement !== svg || siblingCheck(node, sibling)) {\n el.insertBefore(node, sibling ? sibling.nextSibling : el.firstChild);\n }\n return node;\n}\n\n// check if two nodes are ordered siblings\nfunction siblingCheck(node, sibling) {\n return node.parentNode && node.parentNode.childNodes.length > 1 && node.previousSibling != sibling; // treat null/undefined the same\n}\n\n// -- Set attributes & styles on SVG elements ---\n\nlet element = null,\n // temp var for current SVG element\n values = null; // temp var for current values hash\n\n// Extra configuration for certain mark types\nconst mark_extras = {\n group(mdef, el, item) {\n const fg = element = el.childNodes[2];\n values = fg.__values__;\n mdef.foreground(emit, item, this);\n values = el.__values__; // use parent's values hash\n element = el.childNodes[1];\n mdef.content(emit, item, this);\n const bg = element = el.childNodes[0];\n mdef.background(emit, item, this);\n const value = item.mark.interactive === false ? 'none' : null;\n if (value !== values.events) {\n setAttribute(fg, 'pointer-events', value);\n setAttribute(bg, 'pointer-events', value);\n values.events = value;\n }\n if (item.strokeForeground && item.stroke) {\n const fill = item.fill;\n setAttribute(fg, 'display', null);\n\n // set style of background\n this.style(bg, item);\n setAttribute(bg, 'stroke', null);\n\n // set style of foreground\n if (fill) item.fill = null;\n values = fg.__values__;\n this.style(fg, item);\n if (fill) item.fill = fill;\n\n // leave element null to prevent downstream styling\n element = null;\n } else {\n // ensure foreground is ignored\n setAttribute(fg, 'display', 'none');\n }\n },\n image(mdef, el, item) {\n if (item.smooth === false) {\n setStyle(el, 'image-rendering', 'optimizeSpeed');\n setStyle(el, 'image-rendering', 'pixelated');\n } else {\n setStyle(el, 'image-rendering', null);\n }\n },\n text(mdef, el, item) {\n const tl = textLines(item);\n let key, value, doc, lh;\n if (isArray(tl)) {\n // multi-line text\n value = tl.map(_ => textValue(item, _));\n key = value.join('\\n'); // content cache key\n\n if (key !== values.text) {\n domClear(el, 0);\n doc = el.ownerDocument;\n lh = lineHeight(item);\n value.forEach((t, i) => {\n const ts = domCreate(doc, 'tspan', svgns);\n ts.__data__ = item; // data binding\n ts.textContent = t;\n if (i) {\n ts.setAttribute('x', 0);\n ts.setAttribute('dy', lh);\n }\n el.appendChild(ts);\n });\n values.text = key;\n }\n } else {\n // single-line text\n value = textValue(item, tl);\n if (value !== values.text) {\n el.textContent = value;\n values.text = value;\n }\n }\n setAttribute(el, 'font-family', fontFamily(item));\n setAttribute(el, 'font-size', fontSize(item) + 'px');\n setAttribute(el, 'font-style', item.fontStyle);\n setAttribute(el, 'font-variant', item.fontVariant);\n setAttribute(el, 'font-weight', item.fontWeight);\n }\n};\nfunction emit(name, value, ns) {\n // early exit if value is unchanged\n if (value === values[name]) return;\n\n // use appropriate method given namespace (ns)\n if (ns) {\n setAttributeNS(element, name, value, ns);\n } else {\n setAttribute(element, name, value);\n }\n\n // note current value for future comparison\n values[name] = value;\n}\nfunction setStyle(el, name, value) {\n if (value !== values[name]) {\n if (value == null) {\n el.style.removeProperty(name);\n } else {\n el.style.setProperty(name, value + '');\n }\n values[name] = value;\n }\n}\nfunction setAttributes(el, attrs) {\n for (const key in attrs) {\n setAttribute(el, key, attrs[key]);\n }\n}\nfunction setAttribute(el, name, value) {\n if (value != null) {\n // if value is provided, update DOM attribute\n el.setAttribute(name, value);\n } else {\n // else remove DOM attribute\n el.removeAttribute(name);\n }\n}\nfunction setAttributeNS(el, name, value, ns) {\n if (value != null) {\n // if value is provided, update DOM attribute\n el.setAttributeNS(ns, name, value);\n } else {\n // else remove DOM attribute\n el.removeAttributeNS(ns, name);\n }\n}\nfunction href() {\n let loc;\n return typeof window === 'undefined' ? '' : (loc = window.location).hash ? loc.href.slice(0, -loc.hash.length) : loc.href;\n}\n\nfunction SVGStringRenderer(loader) {\n Renderer.call(this, loader);\n this._text = null;\n this._defs = {\n gradient: {},\n clipping: {}\n };\n}\ninherits(SVGStringRenderer, Renderer, {\n /**\n * Returns the rendered SVG text string,\n * or null if rendering has not yet occurred.\n */\n svg() {\n return this._text;\n },\n /**\n * Internal rendering method.\n * @param {object} scene - The root mark of a scenegraph to render.\n */\n _render(scene) {\n const m = markup();\n\n // svg tag\n m.open('svg', extend({}, metadata, {\n class: 'marks',\n width: this._width * this._scale,\n height: this._height * this._scale,\n viewBox: `0 0 ${this._width} ${this._height}`\n }));\n\n // background, if defined\n const bg = this._bgcolor;\n if (bg && bg !== 'transparent' && bg !== 'none') {\n m.open('rect', {\n width: this._width,\n height: this._height,\n fill: bg\n }).close();\n }\n\n // root content group\n m.open('g', rootAttributes, {\n transform: 'translate(' + this._origin + ')'\n });\n this.mark(m, scene);\n m.close(); // \n\n // defs\n this.defs(m);\n\n // get SVG text string\n this._text = m.close() + '';\n return this;\n },\n /**\n * Render a set of mark items.\n * @param {object} m - The markup context.\n * @param {object} scene - The mark parent to render.\n */\n mark(m, scene) {\n const mdef = Marks[scene.marktype],\n tag = mdef.tag,\n attrList = [ariaItemAttributes, mdef.attr];\n\n // render opening group tag\n m.open('g', {\n 'class': cssClass(scene),\n 'clip-path': scene.clip ? clip$1(this, scene, scene.group) : null\n }, ariaMarkAttributes(scene), {\n 'pointer-events': tag !== 'g' && scene.interactive === false ? 'none' : null\n });\n\n // render contained elements\n const process = item => {\n const href = this.href(item);\n if (href) m.open('a', href);\n m.open(tag, this.attr(scene, item, attrList, tag !== 'g' ? tag : null));\n if (tag === 'text') {\n const tl = textLines(item);\n if (isArray(tl)) {\n // multi-line text\n const attrs = {\n x: 0,\n dy: lineHeight(item)\n };\n for (let i = 0; i < tl.length; ++i) {\n m.open('tspan', i ? attrs : null).text(textValue(item, tl[i])).close();\n }\n } else {\n // single-line text\n m.text(textValue(item, tl));\n }\n } else if (tag === 'g') {\n const fore = item.strokeForeground,\n fill = item.fill,\n stroke = item.stroke;\n if (fore && stroke) {\n item.stroke = null;\n }\n m.open('path', this.attr(scene, item, mdef.background, 'bgrect')).close();\n\n // recurse for group content\n m.open('g', this.attr(scene, item, mdef.content));\n visit(item, scene => this.mark(m, scene));\n m.close();\n if (fore && stroke) {\n if (fill) item.fill = null;\n item.stroke = stroke;\n m.open('path', this.attr(scene, item, mdef.foreground, 'bgrect')).close();\n if (fill) item.fill = fill;\n } else {\n m.open('path', this.attr(scene, item, mdef.foreground, 'bgfore')).close();\n }\n }\n m.close(); // \n if (href) m.close(); // \n };\n\n if (mdef.nested) {\n if (scene.items && scene.items.length) process(scene.items[0]);\n } else {\n visit(scene, process);\n }\n\n // render closing group tag\n return m.close(); // \n },\n\n /**\n * Get href attributes for a hyperlinked mark item.\n * @param {Item} item - The mark item.\n */\n href(item) {\n const href = item.href;\n let attr;\n if (href) {\n if (attr = this._hrefs && this._hrefs[href]) {\n return attr;\n } else {\n this.sanitizeURL(href).then(attr => {\n // rewrite to use xlink namespace\n attr['xlink:href'] = attr.href;\n attr.href = null;\n (this._hrefs || (this._hrefs = {}))[href] = attr;\n });\n }\n }\n return null;\n },\n /**\n * Get an object of SVG attributes for a mark item.\n * @param {object} scene - The mark parent.\n * @param {Item} item - The mark item.\n * @param {array|function} attrs - One or more attribute emitters.\n * @param {string} tag - The tag being rendered.\n */\n attr(scene, item, attrs, tag) {\n const object = {},\n emit = (name, value, ns, prefixed) => {\n object[prefixed || name] = value;\n };\n\n // apply mark specific attributes\n if (Array.isArray(attrs)) {\n attrs.forEach(fn => fn(emit, item, this));\n } else {\n attrs(emit, item, this);\n }\n\n // apply style attributes\n if (tag) {\n style(object, item, scene, tag, this._defs);\n }\n return object;\n },\n /**\n * Render SVG defs, as needed.\n * Must be called *after* marks have been processed to ensure the\n * collected state is current and accurate.\n * @param {object} m - The markup context.\n */\n defs(m) {\n const gradient = this._defs.gradient,\n clipping = this._defs.clipping,\n count = Object.keys(gradient).length + Object.keys(clipping).length;\n if (count === 0) return; // nothing to do\n\n m.open('defs');\n for (const id in gradient) {\n const def = gradient[id],\n stops = def.stops;\n if (def.gradient === 'radial') {\n // SVG radial gradients automatically transform to normalized bbox\n // coordinates, in a way that is cumbersome to replicate in canvas.\n // We wrap the radial gradient in a pattern element, allowing us to\n // maintain a circular gradient that matches what canvas provides.\n\n m.open('pattern', {\n id: patternPrefix + id,\n viewBox: '0,0,1,1',\n width: '100%',\n height: '100%',\n preserveAspectRatio: 'xMidYMid slice'\n });\n m.open('rect', {\n width: '1',\n height: '1',\n fill: 'url(#' + id + ')'\n }).close();\n m.close(); // \n\n m.open('radialGradient', {\n id: id,\n fx: def.x1,\n fy: def.y1,\n fr: def.r1,\n cx: def.x2,\n cy: def.y2,\n r: def.r2\n });\n } else {\n m.open('linearGradient', {\n id: id,\n x1: def.x1,\n x2: def.x2,\n y1: def.y1,\n y2: def.y2\n });\n }\n for (let i = 0; i < stops.length; ++i) {\n m.open('stop', {\n offset: stops[i].offset,\n 'stop-color': stops[i].color\n }).close();\n }\n m.close();\n }\n for (const id in clipping) {\n const def = clipping[id];\n m.open('clipPath', {\n id: id\n });\n if (def.path) {\n m.open('path', {\n d: def.path\n }).close();\n } else {\n m.open('rect', {\n x: 0,\n y: 0,\n width: def.width,\n height: def.height\n }).close();\n }\n m.close();\n }\n m.close();\n }\n});\n\n// Helper function for attr for style presentation attributes\nfunction style(s, item, scene, tag, defs) {\n let styleList;\n if (item == null) return s;\n if (tag === 'bgrect' && scene.interactive === false) {\n s['pointer-events'] = 'none';\n }\n if (tag === 'bgfore') {\n if (scene.interactive === false) {\n s['pointer-events'] = 'none';\n }\n s.display = 'none';\n if (item.fill !== null) return s;\n }\n if (tag === 'image' && item.smooth === false) {\n styleList = ['image-rendering: optimizeSpeed;', 'image-rendering: pixelated;'];\n }\n if (tag === 'text') {\n s['font-family'] = fontFamily(item);\n s['font-size'] = fontSize(item) + 'px';\n s['font-style'] = item.fontStyle;\n s['font-variant'] = item.fontVariant;\n s['font-weight'] = item.fontWeight;\n }\n for (const prop in stylesAttr) {\n let value = item[prop];\n const name = stylesAttr[prop];\n if (value === 'transparent' && (name === 'fill' || name === 'stroke')) ; else if (value != null) {\n if (isGradient(value)) {\n value = gradientRef(value, defs.gradient, '');\n }\n s[name] = value;\n }\n }\n for (const prop in stylesCss) {\n const value = item[prop];\n if (value != null) {\n styleList = styleList || [];\n styleList.push(`${stylesCss[prop]}: ${value};`);\n }\n }\n if (styleList) {\n s.style = styleList.join(' ');\n }\n return s;\n}\n\nconst Canvas = 'canvas';\nconst PNG = 'png';\nconst SVG = 'svg';\nconst None = 'none';\nconst RenderType = {\n Canvas: Canvas,\n PNG: PNG,\n SVG: SVG,\n None: None\n};\nconst modules = {};\nmodules[Canvas] = modules[PNG] = {\n renderer: CanvasRenderer,\n headless: CanvasRenderer,\n handler: CanvasHandler\n};\nmodules[SVG] = {\n renderer: SVGRenderer,\n headless: SVGStringRenderer,\n handler: SVGHandler\n};\nmodules[None] = {};\nfunction renderModule(name, _) {\n name = String(name || '').toLowerCase();\n if (arguments.length > 1) {\n modules[name] = _;\n return this;\n } else {\n return modules[name];\n }\n}\n\nfunction intersect(scene, bounds, filter) {\n const hits = [],\n // intersection results\n box = new Bounds().union(bounds),\n // defensive copy\n type = scene.marktype;\n return type ? intersectMark(scene, box, filter, hits) : type === 'group' ? intersectGroup(scene, box, filter, hits) : error('Intersect scene must be mark node or group item.');\n}\nfunction intersectMark(mark, box, filter, hits) {\n if (visitMark(mark, box, filter)) {\n const items = mark.items,\n type = mark.marktype,\n n = items.length;\n let i = 0;\n if (type === 'group') {\n for (; i < n; ++i) {\n intersectGroup(items[i], box, filter, hits);\n }\n } else {\n for (const test = Marks[type].isect; i < n; ++i) {\n const item = items[i];\n if (intersectItem(item, box, test)) hits.push(item);\n }\n }\n }\n return hits;\n}\nfunction visitMark(mark, box, filter) {\n // process if bounds intersect and if\n // (1) mark is a group mark (so we must recurse), or\n // (2) mark is interactive and passes filter\n return mark.bounds && box.intersects(mark.bounds) && (mark.marktype === 'group' || mark.interactive !== false && (!filter || filter(mark)));\n}\nfunction intersectGroup(group, box, filter, hits) {\n // test intersect against group\n // skip groups by default unless filter says otherwise\n if (filter && filter(group.mark) && intersectItem(group, box, Marks.group.isect)) {\n hits.push(group);\n }\n\n // recursively test children marks\n // translate box to group coordinate space\n const marks = group.items,\n n = marks && marks.length;\n if (n) {\n const x = group.x || 0,\n y = group.y || 0;\n box.translate(-x, -y);\n for (let i = 0; i < n; ++i) {\n intersectMark(marks[i], box, filter, hits);\n }\n box.translate(x, y);\n }\n return hits;\n}\nfunction intersectItem(item, box, test) {\n // test bounds enclosure, bounds intersection, then detailed test\n const bounds = item.bounds;\n return box.encloses(bounds) || box.intersects(bounds) && test(item, box);\n}\n\nconst clipBounds = new Bounds();\nfunction boundClip (mark) {\n const clip = mark.clip;\n if (isFunction(clip)) {\n clip(boundContext(clipBounds.clear()));\n } else if (clip) {\n clipBounds.set(0, 0, mark.group.width, mark.group.height);\n } else return;\n mark.bounds.intersect(clipBounds);\n}\n\nconst TOLERANCE = 1e-9;\nfunction sceneEqual(a, b, key) {\n return a === b ? true : key === 'path' ? pathEqual(a, b) : a instanceof Date && b instanceof Date ? +a === +b : isNumber(a) && isNumber(b) ? Math.abs(a - b) <= TOLERANCE : !a || !b || !isObject(a) && !isObject(b) ? a == b : objectEqual(a, b);\n}\nfunction pathEqual(a, b) {\n return sceneEqual(parse(a), parse(b));\n}\nfunction objectEqual(a, b) {\n var ka = Object.keys(a),\n kb = Object.keys(b),\n key,\n i;\n if (ka.length !== kb.length) return false;\n ka.sort();\n kb.sort();\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i]) return false;\n }\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!sceneEqual(a[key], b[key], key)) return false;\n }\n return typeof a === typeof b;\n}\n\nfunction resetSVGDefIds() {\n resetSVGClipId();\n resetSVGGradientId();\n}\n\nexport { Bounds, CanvasHandler, CanvasRenderer, Gradient, GroupItem, Handler, Item, Marks, RenderType, Renderer, ResourceLoader, SVGHandler, SVGRenderer, SVGStringRenderer, Scenegraph, boundClip, boundContext, boundItem, boundMark, boundStroke, domChild, domClear, domCreate, domFind, font, fontFamily, fontSize, intersect, intersectBoxLine, intersectPath, intersectPoint, intersectRule, lineHeight, markup, multiLineOffset, curves as pathCurves, pathEqual, parse as pathParse, vg_rect as pathRectangle, pathRender, symbols as pathSymbols, vg_trail as pathTrail, point, renderModule, resetSVGClipId, resetSVGDefIds, sceneEqual, sceneFromJSON, pickVisit as scenePickVisit, sceneToJSON, visit as sceneVisit, zorder as sceneZOrder, serializeXML, textMetrics };\n","import constant from \"./constant.js\";\nimport {withPath} from \"./path.js\";\nimport asterisk from \"./symbol/asterisk.js\";\nimport circle from \"./symbol/circle.js\";\nimport cross from \"./symbol/cross.js\";\nimport diamond from \"./symbol/diamond.js\";\nimport diamond2 from \"./symbol/diamond2.js\";\nimport plus from \"./symbol/plus.js\";\nimport square from \"./symbol/square.js\";\nimport square2 from \"./symbol/square2.js\";\nimport star from \"./symbol/star.js\";\nimport triangle from \"./symbol/triangle.js\";\nimport triangle2 from \"./symbol/triangle2.js\";\nimport wye from \"./symbol/wye.js\";\nimport times from \"./symbol/times.js\";\n\n// These symbols are designed to be filled.\nexport const symbolsFill = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\n// These symbols are designed to be stroked (with a width of 1.5px and round caps).\nexport const symbolsStroke = [\n circle,\n plus,\n times,\n triangle2,\n asterisk,\n square2,\n diamond2\n];\n\nexport default function Symbol(type, size) {\n let context = null,\n path = withPath(symbol);\n\n type = typeof type === \"function\" ? type : constant(type || circle);\n size = typeof size === \"function\" ? size : constant(size === undefined ? 64 : +size);\n\n function symbol() {\n let buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n","import { Transform } from 'vega-dataflow';\nimport { Marks, boundClip, GroupItem, Item, Bounds, multiLineOffset, boundStroke } from 'vega-scenegraph';\nimport { inherits, peek, isObject } from 'vega-util';\n\nconst Top = 'top';\nconst Left = 'left';\nconst Right = 'right';\nconst Bottom = 'bottom';\nconst TopLeft = 'top-left';\nconst TopRight = 'top-right';\nconst BottomLeft = 'bottom-left';\nconst BottomRight = 'bottom-right';\nconst Start = 'start';\nconst Middle = 'middle';\nconst End = 'end';\nconst X = 'x';\nconst Y = 'y';\nconst Group = 'group';\nconst AxisRole = 'axis';\nconst TitleRole = 'title';\nconst FrameRole = 'frame';\nconst ScopeRole = 'scope';\nconst LegendRole = 'legend';\nconst RowHeader = 'row-header';\nconst RowFooter = 'row-footer';\nconst RowTitle = 'row-title';\nconst ColHeader = 'column-header';\nconst ColFooter = 'column-footer';\nconst ColTitle = 'column-title';\nconst Padding = 'padding';\nconst Symbols = 'symbol';\nconst Fit = 'fit';\nconst FitX = 'fit-x';\nconst FitY = 'fit-y';\nconst Pad = 'pad';\nconst None = 'none';\nconst All = 'all';\nconst Each = 'each';\nconst Flush = 'flush';\nconst Column = 'column';\nconst Row = 'row';\n\n/**\n * Calculate bounding boxes for scenegraph items.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.mark - The scenegraph mark instance to bound.\n */\nfunction Bound(params) {\n Transform.call(this, null, params);\n}\ninherits(Bound, Transform, {\n transform(_, pulse) {\n const view = pulse.dataflow,\n mark = _.mark,\n type = mark.marktype,\n entry = Marks[type],\n bound = entry.bound;\n let markBounds = mark.bounds,\n rebound;\n if (entry.nested) {\n // multi-item marks have a single bounds instance\n if (mark.items.length) view.dirty(mark.items[0]);\n markBounds = boundItem(mark, bound);\n mark.items.forEach(item => {\n item.bounds.clear().union(markBounds);\n });\n } else if (type === Group || _.modified()) {\n // operator parameters modified -> re-bound all items\n // updates group bounds in response to modified group content\n pulse.visit(pulse.MOD, item => view.dirty(item));\n markBounds.clear();\n mark.items.forEach(item => markBounds.union(boundItem(item, bound)));\n\n // force reflow for axes/legends/titles to propagate any layout changes\n switch (mark.role) {\n case AxisRole:\n case LegendRole:\n case TitleRole:\n pulse.reflow();\n }\n } else {\n // incrementally update bounds, re-bound mark as needed\n rebound = pulse.changed(pulse.REM);\n pulse.visit(pulse.ADD, item => {\n markBounds.union(boundItem(item, bound));\n });\n pulse.visit(pulse.MOD, item => {\n rebound = rebound || markBounds.alignsWith(item.bounds);\n view.dirty(item);\n markBounds.union(boundItem(item, bound));\n });\n if (rebound) {\n markBounds.clear();\n mark.items.forEach(item => markBounds.union(item.bounds));\n }\n }\n\n // ensure mark bounds do not exceed any clipping region\n boundClip(mark);\n return pulse.modifies('bounds');\n }\n});\nfunction boundItem(item, bound, opt) {\n return bound(item.bounds.clear(), item, opt);\n}\n\nconst COUNTER_NAME = ':vega_identifier:';\n\n/**\n * Adds a unique identifier to all added tuples.\n * This transform creates a new signal that serves as an id counter.\n * As a result, the id counter is shared across all instances of this\n * transform, generating unique ids across multiple data streams. In\n * addition, this signal value can be included in a snapshot of the\n * dataflow state, enabling correct resumption of id allocation.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {string} params.as - The field name for the generated identifier.\n */\nfunction Identifier(params) {\n Transform.call(this, 0, params);\n}\nIdentifier.Definition = {\n 'type': 'Identifier',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'as',\n 'type': 'string',\n 'required': true\n }]\n};\ninherits(Identifier, Transform, {\n transform(_, pulse) {\n const counter = getCounter(pulse.dataflow),\n as = _.as;\n let id = counter.value;\n pulse.visit(pulse.ADD, t => t[as] = t[as] || ++id);\n counter.set(this.value = id);\n return pulse;\n }\n});\nfunction getCounter(view) {\n return view._signals[COUNTER_NAME] || (view._signals[COUNTER_NAME] = view.add(0));\n}\n\n/**\n * Bind scenegraph items to a scenegraph mark instance.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.markdef - The mark definition for creating the mark.\n * This is an object of legal scenegraph mark properties which *must* include\n * the 'marktype' property.\n */\nfunction Mark(params) {\n Transform.call(this, null, params);\n}\ninherits(Mark, Transform, {\n transform(_, pulse) {\n let mark = this.value;\n\n // acquire mark on first invocation, bind context and group\n if (!mark) {\n mark = pulse.dataflow.scenegraph().mark(_.markdef, lookup$1(_), _.index);\n mark.group.context = _.context;\n if (!_.context.group) _.context.group = mark.group;\n mark.source = this.source; // point to upstream collector\n mark.clip = _.clip;\n mark.interactive = _.interactive;\n this.value = mark;\n }\n\n // initialize entering items\n const Init = mark.marktype === Group ? GroupItem : Item;\n pulse.visit(pulse.ADD, item => Init.call(item, mark));\n\n // update clipping and/or interactive status\n if (_.modified('clip') || _.modified('interactive')) {\n mark.clip = _.clip;\n mark.interactive = !!_.interactive;\n mark.zdirty = true; // force scenegraph re-eval\n pulse.reflow();\n }\n\n // bind items array to scenegraph mark\n mark.items = pulse.source;\n return pulse;\n }\n});\nfunction lookup$1(_) {\n const g = _.groups,\n p = _.parent;\n return g && g.size === 1 ? g.get(Object.keys(g.object)[0]) : g && p ? g.lookup(p) : null;\n}\n\n/**\n * Analyze items for overlap, changing opacity to hide items with\n * overlapping bounding boxes. This transform will preserve at least\n * two items (e.g., first and last) even if overlap persists.\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - A comparator\n * function for sorting items.\n * @param {object} [params.method] - The overlap removal method to apply.\n * One of 'parity' (default, hide every other item until there is no\n * more overlap) or 'greedy' (sequentially scan and hide and items that\n * overlap with the last visible item).\n * @param {object} [params.boundScale] - A scale whose range should be used\n * to bound the items. Items exceeding the bounds of the scale range\n * will be treated as overlapping. If null or undefined, no bounds check\n * will be applied.\n * @param {object} [params.boundOrient] - The orientation of the scale\n * (top, bottom, left, or right) used to bound items. This parameter is\n * ignored if boundScale is null or undefined.\n * @param {object} [params.boundTolerance] - The tolerance in pixels for\n * bound inclusion testing (default 1). This specifies by how many pixels\n * an item's bounds may exceed the scale range bounds and not be culled.\n * @constructor\n */\nfunction Overlap(params) {\n Transform.call(this, null, params);\n}\nconst methods = {\n parity: items => items.filter((item, i) => i % 2 ? item.opacity = 0 : 1),\n greedy: (items, sep) => {\n let a;\n return items.filter((b, i) => !i || !intersect(a.bounds, b.bounds, sep) ? (a = b, 1) : b.opacity = 0);\n }\n};\n\n// compute bounding box intersection\n// including padding pixels of separation\nconst intersect = (a, b, sep) => sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);\nconst hasOverlap = (items, pad) => {\n for (var i = 1, n = items.length, a = items[0].bounds, b; i < n; a = b, ++i) {\n if (intersect(a, b = items[i].bounds, pad)) return true;\n }\n};\nconst hasBounds = item => {\n const b = item.bounds;\n return b.width() > 1 && b.height() > 1;\n};\nconst boundTest = (scale, orient, tolerance) => {\n var range = scale.range(),\n b = new Bounds();\n if (orient === Top || orient === Bottom) {\n b.set(range[0], -Infinity, range[1], +Infinity);\n } else {\n b.set(-Infinity, range[0], +Infinity, range[1]);\n }\n b.expand(tolerance || 1);\n return item => b.encloses(item.bounds);\n};\n\n// reset all items to be fully opaque\nconst reset = source => {\n source.forEach(item => item.opacity = 1);\n return source;\n};\n\n// add all tuples to mod, fork pulse if parameters were modified\n// fork prevents cross-stream tuple pollution (e.g., pulse from scale)\nconst reflow = (pulse, _) => pulse.reflow(_.modified()).modifies('opacity');\ninherits(Overlap, Transform, {\n transform(_, pulse) {\n const reduce = methods[_.method] || methods.parity,\n sep = _.separation || 0;\n let source = pulse.materialize(pulse.SOURCE).source,\n items,\n test;\n if (!source || !source.length) return;\n if (!_.method) {\n // early exit if method is falsy\n if (_.modified('method')) {\n reset(source);\n pulse = reflow(pulse, _);\n }\n return pulse;\n }\n\n // skip labels with no content\n source = source.filter(hasBounds);\n\n // early exit, nothing to do\n if (!source.length) return;\n if (_.sort) {\n source = source.slice().sort(_.sort);\n }\n items = reset(source);\n pulse = reflow(pulse, _);\n if (items.length >= 3 && hasOverlap(items, sep)) {\n do {\n items = reduce(items, sep);\n } while (items.length >= 3 && hasOverlap(items, sep));\n if (items.length < 3 && !peek(source).opacity) {\n if (items.length > 1) peek(items).opacity = 0;\n peek(source).opacity = 1;\n }\n }\n if (_.boundScale && _.boundTolerance >= 0) {\n test = boundTest(_.boundScale, _.boundOrient, +_.boundTolerance);\n source.forEach(item => {\n if (!test(item)) item.opacity = 0;\n });\n }\n\n // re-calculate mark bounds\n const bounds = items[0].mark.bounds.clear();\n source.forEach(item => {\n if (item.opacity) bounds.union(item.bounds);\n });\n return pulse;\n }\n});\n\n/**\n * Queue modified scenegraph items for rendering.\n * @constructor\n */\nfunction Render(params) {\n Transform.call(this, null, params);\n}\ninherits(Render, Transform, {\n transform(_, pulse) {\n const view = pulse.dataflow;\n pulse.visit(pulse.ALL, item => view.dirty(item));\n\n // set z-index dirty flag as needed\n if (pulse.fields && pulse.fields['zindex']) {\n const item = pulse.source && pulse.source[0];\n if (item) item.mark.zdirty = true;\n }\n }\n});\n\nconst tempBounds = new Bounds();\nfunction set(item, property, value) {\n return item[property] === value ? 0 : (item[property] = value, 1);\n}\n\nfunction isYAxis(mark) {\n var orient = mark.items[0].orient;\n return orient === Left || orient === Right;\n}\nfunction axisIndices(datum) {\n let index = +datum.grid;\n return [datum.ticks ? index++ : -1,\n // ticks index\n datum.labels ? index++ : -1,\n // labels index\n index + +datum.domain // title index\n ];\n}\n\nfunction axisLayout(view, axis, width, height) {\n var item = axis.items[0],\n datum = item.datum,\n delta = item.translate != null ? item.translate : 0.5,\n orient = item.orient,\n indices = axisIndices(datum),\n range = item.range,\n offset = item.offset,\n position = item.position,\n minExtent = item.minExtent,\n maxExtent = item.maxExtent,\n title = datum.title && item.items[indices[2]].items[0],\n titlePadding = item.titlePadding,\n bounds = item.bounds,\n dl = title && multiLineOffset(title),\n x = 0,\n y = 0,\n i,\n s;\n tempBounds.clear().union(bounds);\n bounds.clear();\n if ((i = indices[0]) > -1) bounds.union(item.items[i].bounds);\n if ((i = indices[1]) > -1) bounds.union(item.items[i].bounds);\n\n // position axis group and title\n switch (orient) {\n case Top:\n x = position || 0;\n y = -offset;\n s = Math.max(minExtent, Math.min(maxExtent, -bounds.y1));\n bounds.add(0, -s).add(range, 0);\n if (title) axisTitleLayout(view, title, s, titlePadding, dl, 0, -1, bounds);\n break;\n case Left:\n x = -offset;\n y = position || 0;\n s = Math.max(minExtent, Math.min(maxExtent, -bounds.x1));\n bounds.add(-s, 0).add(0, range);\n if (title) axisTitleLayout(view, title, s, titlePadding, dl, 1, -1, bounds);\n break;\n case Right:\n x = width + offset;\n y = position || 0;\n s = Math.max(minExtent, Math.min(maxExtent, bounds.x2));\n bounds.add(0, 0).add(s, range);\n if (title) axisTitleLayout(view, title, s, titlePadding, dl, 1, 1, bounds);\n break;\n case Bottom:\n x = position || 0;\n y = height + offset;\n s = Math.max(minExtent, Math.min(maxExtent, bounds.y2));\n bounds.add(0, 0).add(range, s);\n if (title) axisTitleLayout(view, title, s, titlePadding, 0, 0, 1, bounds);\n break;\n default:\n x = item.x;\n y = item.y;\n }\n\n // update bounds\n boundStroke(bounds.translate(x, y), item);\n if (set(item, 'x', x + delta) | set(item, 'y', y + delta)) {\n item.bounds = tempBounds;\n view.dirty(item);\n item.bounds = bounds;\n view.dirty(item);\n }\n return item.mark.bounds.clear().union(bounds);\n}\nfunction axisTitleLayout(view, title, offset, pad, dl, isYAxis, sign, bounds) {\n const b = title.bounds;\n if (title.auto) {\n const v = sign * (offset + dl + pad);\n let dx = 0,\n dy = 0;\n view.dirty(title);\n isYAxis ? dx = (title.x || 0) - (title.x = v) : dy = (title.y || 0) - (title.y = v);\n title.mark.bounds.clear().union(b.translate(-dx, -dy));\n view.dirty(title);\n }\n bounds.union(b);\n}\n\n// aggregation functions for grid margin determination\nconst min = (a, b) => Math.floor(Math.min(a, b));\nconst max = (a, b) => Math.ceil(Math.max(a, b));\nfunction gridLayoutGroups(group) {\n var groups = group.items,\n n = groups.length,\n i = 0,\n mark,\n items;\n const views = {\n marks: [],\n rowheaders: [],\n rowfooters: [],\n colheaders: [],\n colfooters: [],\n rowtitle: null,\n coltitle: null\n };\n\n // layout axes, gather legends, collect bounds\n for (; i < n; ++i) {\n mark = groups[i];\n items = mark.items;\n if (mark.marktype === Group) {\n switch (mark.role) {\n case AxisRole:\n case LegendRole:\n case TitleRole:\n break;\n case RowHeader:\n views.rowheaders.push(...items);\n break;\n case RowFooter:\n views.rowfooters.push(...items);\n break;\n case ColHeader:\n views.colheaders.push(...items);\n break;\n case ColFooter:\n views.colfooters.push(...items);\n break;\n case RowTitle:\n views.rowtitle = items[0];\n break;\n case ColTitle:\n views.coltitle = items[0];\n break;\n default:\n views.marks.push(...items);\n }\n }\n }\n return views;\n}\nfunction bboxFlush(item) {\n return new Bounds().set(0, 0, item.width || 0, item.height || 0);\n}\nfunction bboxFull(item) {\n const b = item.bounds.clone();\n return b.empty() ? b.set(0, 0, 0, 0) : b.translate(-(item.x || 0), -(item.y || 0));\n}\nfunction get(opt, key, d) {\n const v = isObject(opt) ? opt[key] : opt;\n return v != null ? v : d !== undefined ? d : 0;\n}\nfunction offsetValue(v) {\n return v < 0 ? Math.ceil(-v) : 0;\n}\nfunction gridLayout(view, groups, opt) {\n var dirty = !opt.nodirty,\n bbox = opt.bounds === Flush ? bboxFlush : bboxFull,\n bounds = tempBounds.set(0, 0, 0, 0),\n alignCol = get(opt.align, Column),\n alignRow = get(opt.align, Row),\n padCol = get(opt.padding, Column),\n padRow = get(opt.padding, Row),\n ncols = opt.columns || groups.length,\n nrows = ncols <= 0 ? 1 : Math.ceil(groups.length / ncols),\n n = groups.length,\n xOffset = Array(n),\n xExtent = Array(ncols),\n xMax = 0,\n yOffset = Array(n),\n yExtent = Array(nrows),\n yMax = 0,\n dx = Array(n),\n dy = Array(n),\n boxes = Array(n),\n m,\n i,\n c,\n r,\n b,\n g,\n px,\n py,\n x,\n y,\n offset;\n for (i = 0; i < ncols; ++i) xExtent[i] = 0;\n for (i = 0; i < nrows; ++i) yExtent[i] = 0;\n\n // determine offsets for each group\n for (i = 0; i < n; ++i) {\n g = groups[i];\n b = boxes[i] = bbox(g);\n g.x = g.x || 0;\n dx[i] = 0;\n g.y = g.y || 0;\n dy[i] = 0;\n c = i % ncols;\n r = ~~(i / ncols);\n xMax = Math.max(xMax, px = Math.ceil(b.x2));\n yMax = Math.max(yMax, py = Math.ceil(b.y2));\n xExtent[c] = Math.max(xExtent[c], px);\n yExtent[r] = Math.max(yExtent[r], py);\n xOffset[i] = padCol + offsetValue(b.x1);\n yOffset[i] = padRow + offsetValue(b.y1);\n if (dirty) view.dirty(groups[i]);\n }\n\n // set initial alignment offsets\n for (i = 0; i < n; ++i) {\n if (i % ncols === 0) xOffset[i] = 0;\n if (i < ncols) yOffset[i] = 0;\n }\n\n // enforce column alignment constraints\n if (alignCol === Each) {\n for (c = 1; c < ncols; ++c) {\n for (offset = 0, i = c; i < n; i += ncols) {\n if (offset < xOffset[i]) offset = xOffset[i];\n }\n for (i = c; i < n; i += ncols) {\n xOffset[i] = offset + xExtent[c - 1];\n }\n }\n } else if (alignCol === All) {\n for (offset = 0, i = 0; i < n; ++i) {\n if (i % ncols && offset < xOffset[i]) offset = xOffset[i];\n }\n for (i = 0; i < n; ++i) {\n if (i % ncols) xOffset[i] = offset + xMax;\n }\n } else {\n for (alignCol = false, c = 1; c < ncols; ++c) {\n for (i = c; i < n; i += ncols) {\n xOffset[i] += xExtent[c - 1];\n }\n }\n }\n\n // enforce row alignment constraints\n if (alignRow === Each) {\n for (r = 1; r < nrows; ++r) {\n for (offset = 0, i = r * ncols, m = i + ncols; i < m; ++i) {\n if (offset < yOffset[i]) offset = yOffset[i];\n }\n for (i = r * ncols; i < m; ++i) {\n yOffset[i] = offset + yExtent[r - 1];\n }\n }\n } else if (alignRow === All) {\n for (offset = 0, i = ncols; i < n; ++i) {\n if (offset < yOffset[i]) offset = yOffset[i];\n }\n for (i = ncols; i < n; ++i) {\n yOffset[i] = offset + yMax;\n }\n } else {\n for (alignRow = false, r = 1; r < nrows; ++r) {\n for (i = r * ncols, m = i + ncols; i < m; ++i) {\n yOffset[i] += yExtent[r - 1];\n }\n }\n }\n\n // perform horizontal grid layout\n for (x = 0, i = 0; i < n; ++i) {\n x = xOffset[i] + (i % ncols ? x : 0);\n dx[i] += x - groups[i].x;\n }\n\n // perform vertical grid layout\n for (c = 0; c < ncols; ++c) {\n for (y = 0, i = c; i < n; i += ncols) {\n y += yOffset[i];\n dy[i] += y - groups[i].y;\n }\n }\n\n // perform horizontal centering\n if (alignCol && get(opt.center, Column) && nrows > 1) {\n for (i = 0; i < n; ++i) {\n b = alignCol === All ? xMax : xExtent[i % ncols];\n x = b - boxes[i].x2 - groups[i].x - dx[i];\n if (x > 0) dx[i] += x / 2;\n }\n }\n\n // perform vertical centering\n if (alignRow && get(opt.center, Row) && ncols !== 1) {\n for (i = 0; i < n; ++i) {\n b = alignRow === All ? yMax : yExtent[~~(i / ncols)];\n y = b - boxes[i].y2 - groups[i].y - dy[i];\n if (y > 0) dy[i] += y / 2;\n }\n }\n\n // position grid relative to anchor\n for (i = 0; i < n; ++i) {\n bounds.union(boxes[i].translate(dx[i], dy[i]));\n }\n x = get(opt.anchor, X);\n y = get(opt.anchor, Y);\n switch (get(opt.anchor, Column)) {\n case End:\n x -= bounds.width();\n break;\n case Middle:\n x -= bounds.width() / 2;\n }\n switch (get(opt.anchor, Row)) {\n case End:\n y -= bounds.height();\n break;\n case Middle:\n y -= bounds.height() / 2;\n }\n x = Math.round(x);\n y = Math.round(y);\n\n // update mark positions, bounds, dirty\n bounds.clear();\n for (i = 0; i < n; ++i) {\n groups[i].mark.bounds.clear();\n }\n for (i = 0; i < n; ++i) {\n g = groups[i];\n g.x += dx[i] += x;\n g.y += dy[i] += y;\n bounds.union(g.mark.bounds.union(g.bounds.translate(dx[i], dy[i])));\n if (dirty) view.dirty(g);\n }\n return bounds;\n}\nfunction trellisLayout(view, group, opt) {\n var views = gridLayoutGroups(group),\n groups = views.marks,\n bbox = opt.bounds === Flush ? boundFlush : boundFull,\n off = opt.offset,\n ncols = opt.columns || groups.length,\n nrows = ncols <= 0 ? 1 : Math.ceil(groups.length / ncols),\n cells = nrows * ncols,\n x,\n y,\n x2,\n y2,\n anchor,\n band,\n offset;\n\n // -- initial grid layout\n const bounds = gridLayout(view, groups, opt);\n if (bounds.empty()) bounds.set(0, 0, 0, 0); // empty grid\n\n // -- layout grid headers and footers --\n\n // perform row header layout\n if (views.rowheaders) {\n band = get(opt.headerBand, Row, null);\n x = layoutHeaders(view, views.rowheaders, groups, ncols, nrows, -get(off, 'rowHeader'), min, 0, bbox, 'x1', 0, ncols, 1, band);\n }\n\n // perform column header layout\n if (views.colheaders) {\n band = get(opt.headerBand, Column, null);\n y = layoutHeaders(view, views.colheaders, groups, ncols, ncols, -get(off, 'columnHeader'), min, 1, bbox, 'y1', 0, 1, ncols, band);\n }\n\n // perform row footer layout\n if (views.rowfooters) {\n band = get(opt.footerBand, Row, null);\n x2 = layoutHeaders(view, views.rowfooters, groups, ncols, nrows, get(off, 'rowFooter'), max, 0, bbox, 'x2', ncols - 1, ncols, 1, band);\n }\n\n // perform column footer layout\n if (views.colfooters) {\n band = get(opt.footerBand, Column, null);\n y2 = layoutHeaders(view, views.colfooters, groups, ncols, ncols, get(off, 'columnFooter'), max, 1, bbox, 'y2', cells - ncols, 1, ncols, band);\n }\n\n // perform row title layout\n if (views.rowtitle) {\n anchor = get(opt.titleAnchor, Row);\n offset = get(off, 'rowTitle');\n offset = anchor === End ? x2 + offset : x - offset;\n band = get(opt.titleBand, Row, 0.5);\n layoutTitle(view, views.rowtitle, offset, 0, bounds, band);\n }\n\n // perform column title layout\n if (views.coltitle) {\n anchor = get(opt.titleAnchor, Column);\n offset = get(off, 'columnTitle');\n offset = anchor === End ? y2 + offset : y - offset;\n band = get(opt.titleBand, Column, 0.5);\n layoutTitle(view, views.coltitle, offset, 1, bounds, band);\n }\n}\nfunction boundFlush(item, field) {\n return field === 'x1' ? item.x || 0 : field === 'y1' ? item.y || 0 : field === 'x2' ? (item.x || 0) + (item.width || 0) : field === 'y2' ? (item.y || 0) + (item.height || 0) : undefined;\n}\nfunction boundFull(item, field) {\n return item.bounds[field];\n}\nfunction layoutHeaders(view, headers, groups, ncols, limit, offset, agg, isX, bound, bf, start, stride, back, band) {\n var n = groups.length,\n init = 0,\n edge = 0,\n i,\n j,\n k,\n m,\n b,\n h,\n g,\n x,\n y;\n\n // if no groups, early exit and return 0\n if (!n) return init;\n\n // compute margin\n for (i = start; i < n; i += stride) {\n if (groups[i]) init = agg(init, bound(groups[i], bf));\n }\n\n // if no headers, return margin calculation\n if (!headers.length) return init;\n\n // check if number of headers exceeds number of rows or columns\n if (headers.length > limit) {\n view.warn('Grid headers exceed limit: ' + limit);\n headers = headers.slice(0, limit);\n }\n\n // apply offset\n init += offset;\n\n // clear mark bounds for all headers\n for (j = 0, m = headers.length; j < m; ++j) {\n view.dirty(headers[j]);\n headers[j].mark.bounds.clear();\n }\n\n // layout each header\n for (i = start, j = 0, m = headers.length; j < m; ++j, i += stride) {\n h = headers[j];\n b = h.mark.bounds;\n\n // search for nearest group to align to\n // necessary if table has empty cells\n for (k = i; k >= 0 && (g = groups[k]) == null; k -= back);\n\n // assign coordinates and update bounds\n if (isX) {\n x = band == null ? g.x : Math.round(g.bounds.x1 + band * g.bounds.width());\n y = init;\n } else {\n x = init;\n y = band == null ? g.y : Math.round(g.bounds.y1 + band * g.bounds.height());\n }\n b.union(h.bounds.translate(x - (h.x || 0), y - (h.y || 0)));\n h.x = x;\n h.y = y;\n view.dirty(h);\n\n // update current edge of layout bounds\n edge = agg(edge, b[bf]);\n }\n return edge;\n}\nfunction layoutTitle(view, g, offset, isX, bounds, band) {\n if (!g) return;\n view.dirty(g);\n\n // compute title coordinates\n var x = offset,\n y = offset;\n isX ? x = Math.round(bounds.x1 + band * bounds.width()) : y = Math.round(bounds.y1 + band * bounds.height());\n\n // assign coordinates and update bounds\n g.bounds.translate(x - (g.x || 0), y - (g.y || 0));\n g.mark.bounds.clear().union(g.bounds);\n g.x = x;\n g.y = y;\n\n // queue title for redraw\n view.dirty(g);\n}\n\n// utility for looking up legend layout configuration\nfunction lookup(config, orient) {\n const opt = config[orient] || {};\n return (key, d) => opt[key] != null ? opt[key] : config[key] != null ? config[key] : d;\n}\n\n// if legends specify offset directly, use the maximum specified value\nfunction offsets(legends, value) {\n let max = -Infinity;\n legends.forEach(item => {\n if (item.offset != null) max = Math.max(max, item.offset);\n });\n return max > -Infinity ? max : value;\n}\nfunction legendParams(g, orient, config, xb, yb, w, h) {\n const _ = lookup(config, orient),\n offset = offsets(g, _('offset', 0)),\n anchor = _('anchor', Start),\n mult = anchor === End ? 1 : anchor === Middle ? 0.5 : 0;\n const p = {\n align: Each,\n bounds: _('bounds', Flush),\n columns: _('direction') === 'vertical' ? 1 : g.length,\n padding: _('margin', 8),\n center: _('center'),\n nodirty: true\n };\n switch (orient) {\n case Left:\n p.anchor = {\n x: Math.floor(xb.x1) - offset,\n column: End,\n y: mult * (h || xb.height() + 2 * xb.y1),\n row: anchor\n };\n break;\n case Right:\n p.anchor = {\n x: Math.ceil(xb.x2) + offset,\n y: mult * (h || xb.height() + 2 * xb.y1),\n row: anchor\n };\n break;\n case Top:\n p.anchor = {\n y: Math.floor(yb.y1) - offset,\n row: End,\n x: mult * (w || yb.width() + 2 * yb.x1),\n column: anchor\n };\n break;\n case Bottom:\n p.anchor = {\n y: Math.ceil(yb.y2) + offset,\n x: mult * (w || yb.width() + 2 * yb.x1),\n column: anchor\n };\n break;\n case TopLeft:\n p.anchor = {\n x: offset,\n y: offset\n };\n break;\n case TopRight:\n p.anchor = {\n x: w - offset,\n y: offset,\n column: End\n };\n break;\n case BottomLeft:\n p.anchor = {\n x: offset,\n y: h - offset,\n row: End\n };\n break;\n case BottomRight:\n p.anchor = {\n x: w - offset,\n y: h - offset,\n column: End,\n row: End\n };\n break;\n }\n return p;\n}\nfunction legendLayout(view, legend) {\n var item = legend.items[0],\n datum = item.datum,\n orient = item.orient,\n bounds = item.bounds,\n x = item.x,\n y = item.y,\n w,\n h;\n\n // cache current bounds for later comparison\n item._bounds ? item._bounds.clear().union(bounds) : item._bounds = bounds.clone();\n bounds.clear();\n\n // adjust legend to accommodate padding and title\n legendGroupLayout(view, item, item.items[0].items[0]);\n\n // aggregate bounds to determine size, and include origin\n bounds = legendBounds(item, bounds);\n w = 2 * item.padding;\n h = 2 * item.padding;\n if (!bounds.empty()) {\n w = Math.ceil(bounds.width() + w);\n h = Math.ceil(bounds.height() + h);\n }\n if (datum.type === Symbols) {\n legendEntryLayout(item.items[0].items[0].items[0].items);\n }\n if (orient !== None) {\n item.x = x = 0;\n item.y = y = 0;\n }\n item.width = w;\n item.height = h;\n boundStroke(bounds.set(x, y, x + w, y + h), item);\n item.mark.bounds.clear().union(bounds);\n return item;\n}\nfunction legendBounds(item, b) {\n // aggregate item bounds\n item.items.forEach(_ => b.union(_.bounds));\n\n // anchor to legend origin\n b.x1 = item.padding;\n b.y1 = item.padding;\n return b;\n}\nfunction legendGroupLayout(view, item, entry) {\n var pad = item.padding,\n ex = pad - entry.x,\n ey = pad - entry.y;\n if (!item.datum.title) {\n if (ex || ey) translate(view, entry, ex, ey);\n } else {\n var title = item.items[1].items[0],\n anchor = title.anchor,\n tpad = item.titlePadding || 0,\n tx = pad - title.x,\n ty = pad - title.y;\n switch (title.orient) {\n case Left:\n ex += Math.ceil(title.bounds.width()) + tpad;\n break;\n case Right:\n case Bottom:\n break;\n default:\n ey += title.bounds.height() + tpad;\n }\n if (ex || ey) translate(view, entry, ex, ey);\n switch (title.orient) {\n case Left:\n ty += legendTitleOffset(item, entry, title, anchor, 1, 1);\n break;\n case Right:\n tx += legendTitleOffset(item, entry, title, End, 0, 0) + tpad;\n ty += legendTitleOffset(item, entry, title, anchor, 1, 1);\n break;\n case Bottom:\n tx += legendTitleOffset(item, entry, title, anchor, 0, 0);\n ty += legendTitleOffset(item, entry, title, End, -1, 0, 1) + tpad;\n break;\n default:\n tx += legendTitleOffset(item, entry, title, anchor, 0, 0);\n }\n if (tx || ty) translate(view, title, tx, ty);\n\n // translate legend if title pushes into negative coordinates\n if ((tx = Math.round(title.bounds.x1 - pad)) < 0) {\n translate(view, entry, -tx, 0);\n translate(view, title, -tx, 0);\n }\n }\n}\nfunction legendTitleOffset(item, entry, title, anchor, y, lr, noBar) {\n const grad = item.datum.type !== 'symbol',\n vgrad = title.datum.vgrad,\n e = grad && (lr || !vgrad) && !noBar ? entry.items[0] : entry,\n s = e.bounds[y ? 'y2' : 'x2'] - item.padding,\n u = vgrad && lr ? s : 0,\n v = vgrad && lr ? 0 : s,\n o = y <= 0 ? 0 : multiLineOffset(title);\n return Math.round(anchor === Start ? u : anchor === End ? v - o : 0.5 * (s - o));\n}\nfunction translate(view, item, dx, dy) {\n item.x += dx;\n item.y += dy;\n item.bounds.translate(dx, dy);\n item.mark.bounds.translate(dx, dy);\n view.dirty(item);\n}\nfunction legendEntryLayout(entries) {\n // get max widths for each column\n const widths = entries.reduce((w, g) => {\n w[g.column] = Math.max(g.bounds.x2 - g.x, w[g.column] || 0);\n return w;\n }, {});\n\n // set dimensions of legend entry groups\n entries.forEach(g => {\n g.width = widths[g.column];\n g.height = g.bounds.y2 - g.y;\n });\n}\n\nfunction titleLayout(view, mark, width, height, viewBounds) {\n var group = mark.items[0],\n frame = group.frame,\n orient = group.orient,\n anchor = group.anchor,\n offset = group.offset,\n padding = group.padding,\n title = group.items[0].items[0],\n subtitle = group.items[1] && group.items[1].items[0],\n end = orient === Left || orient === Right ? height : width,\n start = 0,\n x = 0,\n y = 0,\n sx = 0,\n sy = 0,\n pos;\n if (frame !== Group) {\n orient === Left ? (start = viewBounds.y2, end = viewBounds.y1) : orient === Right ? (start = viewBounds.y1, end = viewBounds.y2) : (start = viewBounds.x1, end = viewBounds.x2);\n } else if (orient === Left) {\n start = height, end = 0;\n }\n pos = anchor === Start ? start : anchor === End ? end : (start + end) / 2;\n if (subtitle && subtitle.text) {\n // position subtitle\n switch (orient) {\n case Top:\n case Bottom:\n sy = title.bounds.height() + padding;\n break;\n case Left:\n sx = title.bounds.width() + padding;\n break;\n case Right:\n sx = -title.bounds.width() - padding;\n break;\n }\n tempBounds.clear().union(subtitle.bounds);\n tempBounds.translate(sx - (subtitle.x || 0), sy - (subtitle.y || 0));\n if (set(subtitle, 'x', sx) | set(subtitle, 'y', sy)) {\n view.dirty(subtitle);\n subtitle.bounds.clear().union(tempBounds);\n subtitle.mark.bounds.clear().union(tempBounds);\n view.dirty(subtitle);\n }\n tempBounds.clear().union(subtitle.bounds);\n } else {\n tempBounds.clear();\n }\n tempBounds.union(title.bounds);\n\n // position title group\n switch (orient) {\n case Top:\n x = pos;\n y = viewBounds.y1 - tempBounds.height() - offset;\n break;\n case Left:\n x = viewBounds.x1 - tempBounds.width() - offset;\n y = pos;\n break;\n case Right:\n x = viewBounds.x2 + tempBounds.width() + offset;\n y = pos;\n break;\n case Bottom:\n x = pos;\n y = viewBounds.y2 + offset;\n break;\n default:\n x = group.x;\n y = group.y;\n }\n if (set(group, 'x', x) | set(group, 'y', y)) {\n tempBounds.translate(x, y);\n view.dirty(group);\n group.bounds.clear().union(tempBounds);\n mark.bounds.clear().union(tempBounds);\n view.dirty(group);\n }\n return group.bounds;\n}\n\n/**\n * Layout view elements such as axes and legends.\n * Also performs size adjustments.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.mark - Scenegraph mark of groups to layout.\n */\nfunction ViewLayout(params) {\n Transform.call(this, null, params);\n}\ninherits(ViewLayout, Transform, {\n transform(_, pulse) {\n const view = pulse.dataflow;\n _.mark.items.forEach(group => {\n if (_.layout) trellisLayout(view, group, _.layout);\n layoutGroup(view, group, _);\n });\n return shouldReflow(_.mark.group) ? pulse.reflow() : pulse;\n }\n});\nfunction shouldReflow(group) {\n // We typically should reflow if layout is invoked (#2568), as child items\n // may have resized and reflow ensures group bounds are re-calculated.\n // However, legend entries have a special exception to avoid instability.\n // For example, if a selected legend symbol gains a stroke on hover,\n // we don't want to re-position subsequent elements in the legend.\n return group && group.mark.role !== 'legend-entry';\n}\nfunction layoutGroup(view, group, _) {\n var items = group.items,\n width = Math.max(0, group.width || 0),\n height = Math.max(0, group.height || 0),\n viewBounds = new Bounds().set(0, 0, width, height),\n xBounds = viewBounds.clone(),\n yBounds = viewBounds.clone(),\n legends = [],\n title,\n mark,\n orient,\n b,\n i,\n n;\n\n // layout axes, gather legends, collect bounds\n for (i = 0, n = items.length; i < n; ++i) {\n mark = items[i];\n switch (mark.role) {\n case AxisRole:\n b = isYAxis(mark) ? xBounds : yBounds;\n b.union(axisLayout(view, mark, width, height));\n break;\n case TitleRole:\n title = mark;\n break;\n case LegendRole:\n legends.push(legendLayout(view, mark));\n break;\n case FrameRole:\n case ScopeRole:\n case RowHeader:\n case RowFooter:\n case RowTitle:\n case ColHeader:\n case ColFooter:\n case ColTitle:\n xBounds.union(mark.bounds);\n yBounds.union(mark.bounds);\n break;\n default:\n viewBounds.union(mark.bounds);\n }\n }\n\n // layout legends, adjust viewBounds\n if (legends.length) {\n // group legends by orient\n const l = {};\n legends.forEach(item => {\n orient = item.orient || Right;\n if (orient !== None) (l[orient] || (l[orient] = [])).push(item);\n });\n\n // perform grid layout for each orient group\n for (const orient in l) {\n const g = l[orient];\n gridLayout(view, g, legendParams(g, orient, _.legends, xBounds, yBounds, width, height));\n }\n\n // update view bounds\n legends.forEach(item => {\n const b = item.bounds;\n if (!b.equals(item._bounds)) {\n item.bounds = item._bounds;\n view.dirty(item); // dirty previous location\n item.bounds = b;\n view.dirty(item);\n }\n if (_.autosize && (_.autosize.type === Fit || _.autosize.type === FitX || _.autosize.type === FitY)) {\n // For autosize fit, incorporate the orthogonal dimension only.\n // Legends that overrun the chart area will then be clipped;\n // otherwise the chart area gets reduced to nothing!\n switch (item.orient) {\n case Left:\n case Right:\n viewBounds.add(b.x1, 0).add(b.x2, 0);\n break;\n case Top:\n case Bottom:\n viewBounds.add(0, b.y1).add(0, b.y2);\n }\n } else {\n viewBounds.union(b);\n }\n });\n }\n\n // combine bounding boxes\n viewBounds.union(xBounds).union(yBounds);\n\n // layout title, adjust bounds\n if (title) {\n viewBounds.union(titleLayout(view, title, width, height, viewBounds));\n }\n\n // override aggregated view bounds if content is clipped\n if (group.clip) {\n viewBounds.set(0, 0, group.width || 0, group.height || 0);\n }\n\n // perform size adjustment\n viewSizeLayout(view, group, viewBounds, _);\n}\nfunction viewSizeLayout(view, group, viewBounds, _) {\n const auto = _.autosize || {},\n type = auto.type;\n if (view._autosize < 1 || !type) return;\n let viewWidth = view._width,\n viewHeight = view._height,\n width = Math.max(0, group.width || 0),\n left = Math.max(0, Math.ceil(-viewBounds.x1)),\n height = Math.max(0, group.height || 0),\n top = Math.max(0, Math.ceil(-viewBounds.y1));\n const right = Math.max(0, Math.ceil(viewBounds.x2 - width)),\n bottom = Math.max(0, Math.ceil(viewBounds.y2 - height));\n if (auto.contains === Padding) {\n const padding = view.padding();\n viewWidth -= padding.left + padding.right;\n viewHeight -= padding.top + padding.bottom;\n }\n if (type === None) {\n left = 0;\n top = 0;\n width = viewWidth;\n height = viewHeight;\n } else if (type === Fit) {\n width = Math.max(0, viewWidth - left - right);\n height = Math.max(0, viewHeight - top - bottom);\n } else if (type === FitX) {\n width = Math.max(0, viewWidth - left - right);\n viewHeight = height + top + bottom;\n } else if (type === FitY) {\n viewWidth = width + left + right;\n height = Math.max(0, viewHeight - top - bottom);\n } else if (type === Pad) {\n viewWidth = width + left + right;\n viewHeight = height + top + bottom;\n }\n view._resizeView(viewWidth, viewHeight, width, height, [left, top], auto.resize);\n}\n\nexport { Bound as bound, Identifier as identifier, Mark as mark, Overlap as overlap, Render as render, ViewLayout as viewlayout };\n","export default function sum(values, valueof) {\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n sum += value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n sum += value;\n }\n }\n }\n return sum;\n}\n","import { Transform, ingest, tupleid, stableCompare } from 'vega-dataflow';\nimport { tickCount, tickFormat, validTicks, tickValues, SymbolLegend, labelFormat, labelValues, GradientLegend, scaleFraction, labelFraction, scale, Sequential, Linear, isContinuous, Time, UTC, Ordinal, scaleImplicit, Log, Sqrt, Pow, Symlog, isLogarithmic, BinOrdinal, isInterpolating, interpolateColors, interpolate, Band, Point, bandSpace, scheme, Threshold, Quantile, Quantize, quantizeInterpolator, interpolateRange, Diverging } from 'vega-scale';\nimport { inherits, isArray, error, fastmap, falsy, isFunction, constant, peek, one, toSet, isString, zoomLog, zoomPow, zoomSymlog, zoomLinear, stringValue } from 'vega-util';\nimport { sum, range } from 'd3-array';\nimport { interpolateRound, interpolate as interpolate$1 } from 'd3-interpolate';\n\n/**\n * Generates axis ticks for visualizing a spatial scale.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Scale} params.scale - The scale to generate ticks for.\n * @param {*} [params.count=10] - The approximate number of ticks, or\n * desired tick interval, to use.\n * @param {Array<*>} [params.values] - The exact tick values to use.\n * These must be legal domain values for the provided scale.\n * If provided, the count argument is ignored.\n * @param {function(*):string} [params.formatSpecifier] - A format specifier\n * to use in conjunction with scale.tickFormat. Legal values are\n * any valid d3 4.0 format specifier.\n * @param {function(*):string} [params.format] - The format function to use.\n * If provided, the formatSpecifier argument is ignored.\n */\nfunction AxisTicks(params) {\n Transform.call(this, null, params);\n}\ninherits(AxisTicks, Transform, {\n transform(_, pulse) {\n if (this.value && !_.modified()) {\n return pulse.StopPropagation;\n }\n var locale = pulse.dataflow.locale(),\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n ticks = this.value,\n scale = _.scale,\n tally = _.count == null ? _.values ? _.values.length : 10 : _.count,\n count = tickCount(scale, tally, _.minstep),\n format = _.format || tickFormat(locale, scale, count, _.formatSpecifier, _.formatType, !!_.values),\n values = _.values ? validTicks(scale, _.values, count) : tickValues(scale, count);\n if (ticks) out.rem = ticks;\n ticks = values.map((value, i) => ingest({\n index: i / (values.length - 1 || 1),\n value: value,\n label: format(value)\n }));\n if (_.extra && ticks.length) {\n // add an extra tick pegged to the initial domain value\n // this is used to generate axes with 'binned' domains\n ticks.push(ingest({\n index: -1,\n extra: {\n value: ticks[0].value\n },\n label: ''\n }));\n }\n out.source = ticks;\n out.add = ticks;\n this.value = ticks;\n return out;\n }\n});\n\n/**\n * Joins a set of data elements against a set of visual items.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): object} [params.item] - An item generator function.\n * @param {function(object): *} [params.key] - The key field associating data and visual items.\n */\nfunction DataJoin(params) {\n Transform.call(this, null, params);\n}\nfunction defaultItemCreate() {\n return ingest({});\n}\nfunction newMap(key) {\n const map = fastmap().test(t => t.exit);\n map.lookup = t => map.get(key(t));\n return map;\n}\ninherits(DataJoin, Transform, {\n transform(_, pulse) {\n var df = pulse.dataflow,\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n item = _.item || defaultItemCreate,\n key = _.key || tupleid,\n map = this.value;\n\n // prevent transient (e.g., hover) requests from\n // cascading across marks derived from marks\n if (isArray(out.encode)) {\n out.encode = null;\n }\n if (map && (_.modified('key') || pulse.modified(key))) {\n error('DataJoin does not support modified key function or fields.');\n }\n if (!map) {\n pulse = pulse.addAll();\n this.value = map = newMap(key);\n }\n pulse.visit(pulse.ADD, t => {\n const k = key(t);\n let x = map.get(k);\n if (x) {\n if (x.exit) {\n map.empty--;\n out.add.push(x);\n } else {\n out.mod.push(x);\n }\n } else {\n x = item(t);\n map.set(k, x);\n out.add.push(x);\n }\n x.datum = t;\n x.exit = false;\n });\n pulse.visit(pulse.MOD, t => {\n const k = key(t),\n x = map.get(k);\n if (x) {\n x.datum = t;\n out.mod.push(x);\n }\n });\n pulse.visit(pulse.REM, t => {\n const k = key(t),\n x = map.get(k);\n if (t === x.datum && !x.exit) {\n out.rem.push(x);\n x.exit = true;\n ++map.empty;\n }\n });\n if (pulse.changed(pulse.ADD_MOD)) out.modifies('datum');\n if (pulse.clean() || _.clean && map.empty > df.cleanThreshold) {\n df.runAfter(map.clean);\n }\n return out;\n }\n});\n\n/**\n * Invokes encoding functions for visual items.\n * @constructor\n * @param {object} params - The parameters to the encoding functions. This\n * parameter object will be passed through to all invoked encoding functions.\n * @param {object} [params.mod=false] - Flag indicating if tuples in the input\n * mod set that are unmodified by encoders should be included in the output.\n * @param {object} param.encoders - The encoding functions\n * @param {function(object, object): boolean} [param.encoders.update] - Update encoding set\n * @param {function(object, object): boolean} [param.encoders.enter] - Enter encoding set\n * @param {function(object, object): boolean} [param.encoders.exit] - Exit encoding set\n */\nfunction Encode(params) {\n Transform.call(this, null, params);\n}\ninherits(Encode, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ADD_REM),\n fmod = _.mod || false,\n encoders = _.encoders,\n encode = pulse.encode;\n\n // if an array, the encode directive includes additional sets\n // that must be defined in order for the primary set to be invoked\n // e.g., only run the update set if the hover set is defined\n if (isArray(encode)) {\n if (out.changed() || encode.every(e => encoders[e])) {\n encode = encode[0];\n out.encode = null; // consume targeted encode directive\n } else {\n return pulse.StopPropagation;\n }\n }\n\n // marshall encoder functions\n var reenter = encode === 'enter',\n update = encoders.update || falsy,\n enter = encoders.enter || falsy,\n exit = encoders.exit || falsy,\n set = (encode && !reenter ? encoders[encode] : update) || falsy;\n if (pulse.changed(pulse.ADD)) {\n pulse.visit(pulse.ADD, t => {\n enter(t, _);\n update(t, _);\n });\n out.modifies(enter.output);\n out.modifies(update.output);\n if (set !== falsy && set !== update) {\n pulse.visit(pulse.ADD, t => {\n set(t, _);\n });\n out.modifies(set.output);\n }\n }\n if (pulse.changed(pulse.REM) && exit !== falsy) {\n pulse.visit(pulse.REM, t => {\n exit(t, _);\n });\n out.modifies(exit.output);\n }\n if (reenter || set !== falsy) {\n const flag = pulse.MOD | (_.modified() ? pulse.REFLOW : 0);\n if (reenter) {\n pulse.visit(flag, t => {\n const mod = enter(t, _) || fmod;\n if (set(t, _) || mod) out.mod.push(t);\n });\n if (out.mod.length) out.modifies(enter.output);\n } else {\n pulse.visit(flag, t => {\n if (set(t, _) || fmod) out.mod.push(t);\n });\n }\n if (out.mod.length) out.modifies(set.output);\n }\n return out.changed() ? out : pulse.StopPropagation;\n }\n});\n\n/**\n * Generates legend entries for visualizing a scale.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Scale} params.scale - The scale to generate items for.\n * @param {*} [params.count=5] - The approximate number of items, or\n * desired tick interval, to use.\n * @param {*} [params.limit] - The maximum number of entries to\n * include in a symbol legend.\n * @param {Array<*>} [params.values] - The exact tick values to use.\n * These must be legal domain values for the provided scale.\n * If provided, the count argument is ignored.\n * @param {string} [params.formatSpecifier] - A format specifier\n * to use in conjunction with scale.tickFormat. Legal values are\n * any valid D3 format specifier string.\n * @param {function(*):string} [params.format] - The format function to use.\n * If provided, the formatSpecifier argument is ignored.\n */\nfunction LegendEntries(params) {\n Transform.call(this, [], params);\n}\ninherits(LegendEntries, Transform, {\n transform(_, pulse) {\n if (this.value != null && !_.modified()) {\n return pulse.StopPropagation;\n }\n var locale = pulse.dataflow.locale(),\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n items = this.value,\n type = _.type || SymbolLegend,\n scale = _.scale,\n limit = +_.limit,\n count = tickCount(scale, _.count == null ? 5 : _.count, _.minstep),\n lskip = !!_.values || type === SymbolLegend,\n format = _.format || labelFormat(locale, scale, count, type, _.formatSpecifier, _.formatType, lskip),\n values = _.values || labelValues(scale, count),\n domain,\n fraction,\n size,\n offset,\n ellipsis;\n if (items) out.rem = items;\n if (type === SymbolLegend) {\n if (limit && values.length > limit) {\n pulse.dataflow.warn('Symbol legend count exceeds limit, filtering items.');\n items = values.slice(0, limit - 1);\n ellipsis = true;\n } else {\n items = values;\n }\n if (isFunction(size = _.size)) {\n // if first value maps to size zero, remove from list (vega#717)\n if (!_.values && scale(items[0]) === 0) {\n items = items.slice(1);\n }\n // compute size offset for legend entries\n offset = items.reduce((max, value) => Math.max(max, size(value, _)), 0);\n } else {\n size = constant(offset = size || 8);\n }\n items = items.map((value, index) => ingest({\n index: index,\n label: format(value, index, items),\n value: value,\n offset: offset,\n size: size(value, _)\n }));\n if (ellipsis) {\n ellipsis = values[items.length];\n items.push(ingest({\n index: items.length,\n label: `\\u2026${values.length - items.length} entries`,\n value: ellipsis,\n offset: offset,\n size: size(ellipsis, _)\n }));\n }\n } else if (type === GradientLegend) {\n domain = scale.domain(), fraction = scaleFraction(scale, domain[0], peek(domain));\n\n // if automatic label generation produces 2 or fewer values,\n // use the domain end points instead (fixes vega/vega#1364)\n if (values.length < 3 && !_.values && domain[0] !== peek(domain)) {\n values = [domain[0], peek(domain)];\n }\n items = values.map((value, index) => ingest({\n index: index,\n label: format(value, index, values),\n value: value,\n perc: fraction(value)\n }));\n } else {\n size = values.length - 1;\n fraction = labelFraction(scale);\n items = values.map((value, index) => ingest({\n index: index,\n label: format(value, index, values),\n value: value,\n perc: index ? fraction(value) : 0,\n perc2: index === size ? 1 : fraction(values[index + 1])\n }));\n }\n out.source = items;\n out.add = items;\n this.value = items;\n return out;\n }\n});\n\nconst sourceX = t => t.source.x;\nconst sourceY = t => t.source.y;\nconst targetX = t => t.target.x;\nconst targetY = t => t.target.y;\n\n/**\n * Layout paths linking source and target elements.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction LinkPath(params) {\n Transform.call(this, {}, params);\n}\nLinkPath.Definition = {\n 'type': 'LinkPath',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'sourceX',\n 'type': 'field',\n 'default': 'source.x'\n }, {\n 'name': 'sourceY',\n 'type': 'field',\n 'default': 'source.y'\n }, {\n 'name': 'targetX',\n 'type': 'field',\n 'default': 'target.x'\n }, {\n 'name': 'targetY',\n 'type': 'field',\n 'default': 'target.y'\n }, {\n 'name': 'orient',\n 'type': 'enum',\n 'default': 'vertical',\n 'values': ['horizontal', 'vertical', 'radial']\n }, {\n 'name': 'shape',\n 'type': 'enum',\n 'default': 'line',\n 'values': ['line', 'arc', 'curve', 'diagonal', 'orthogonal']\n }, {\n 'name': 'require',\n 'type': 'signal'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'path'\n }]\n};\ninherits(LinkPath, Transform, {\n transform(_, pulse) {\n var sx = _.sourceX || sourceX,\n sy = _.sourceY || sourceY,\n tx = _.targetX || targetX,\n ty = _.targetY || targetY,\n as = _.as || 'path',\n orient = _.orient || 'vertical',\n shape = _.shape || 'line',\n path = Paths.get(shape + '-' + orient) || Paths.get(shape);\n if (!path) {\n error('LinkPath unsupported type: ' + _.shape + (_.orient ? '-' + _.orient : ''));\n }\n pulse.visit(pulse.SOURCE, t => {\n t[as] = path(sx(t), sy(t), tx(t), ty(t));\n });\n return pulse.reflow(_.modified()).modifies(as);\n }\n});\nconst line = (sx, sy, tx, ty) => 'M' + sx + ',' + sy + 'L' + tx + ',' + ty;\nconst lineR = (sa, sr, ta, tr) => line(sr * Math.cos(sa), sr * Math.sin(sa), tr * Math.cos(ta), tr * Math.sin(ta));\nconst arc = (sx, sy, tx, ty) => {\n var dx = tx - sx,\n dy = ty - sy,\n rr = Math.sqrt(dx * dx + dy * dy) / 2,\n ra = 180 * Math.atan2(dy, dx) / Math.PI;\n return 'M' + sx + ',' + sy + 'A' + rr + ',' + rr + ' ' + ra + ' 0 1' + ' ' + tx + ',' + ty;\n};\nconst arcR = (sa, sr, ta, tr) => arc(sr * Math.cos(sa), sr * Math.sin(sa), tr * Math.cos(ta), tr * Math.sin(ta));\nconst curve = (sx, sy, tx, ty) => {\n const dx = tx - sx,\n dy = ty - sy,\n ix = 0.2 * (dx + dy),\n iy = 0.2 * (dy - dx);\n return 'M' + sx + ',' + sy + 'C' + (sx + ix) + ',' + (sy + iy) + ' ' + (tx + iy) + ',' + (ty - ix) + ' ' + tx + ',' + ty;\n};\nconst curveR = (sa, sr, ta, tr) => curve(sr * Math.cos(sa), sr * Math.sin(sa), tr * Math.cos(ta), tr * Math.sin(ta));\nconst orthoX = (sx, sy, tx, ty) => 'M' + sx + ',' + sy + 'V' + ty + 'H' + tx;\nconst orthoY = (sx, sy, tx, ty) => 'M' + sx + ',' + sy + 'H' + tx + 'V' + ty;\nconst orthoR = (sa, sr, ta, tr) => {\n const sc = Math.cos(sa),\n ss = Math.sin(sa),\n tc = Math.cos(ta),\n ts = Math.sin(ta),\n sf = Math.abs(ta - sa) > Math.PI ? ta <= sa : ta > sa;\n return 'M' + sr * sc + ',' + sr * ss + 'A' + sr + ',' + sr + ' 0 0,' + (sf ? 1 : 0) + ' ' + sr * tc + ',' + sr * ts + 'L' + tr * tc + ',' + tr * ts;\n};\nconst diagonalX = (sx, sy, tx, ty) => {\n const m = (sx + tx) / 2;\n return 'M' + sx + ',' + sy + 'C' + m + ',' + sy + ' ' + m + ',' + ty + ' ' + tx + ',' + ty;\n};\nconst diagonalY = (sx, sy, tx, ty) => {\n const m = (sy + ty) / 2;\n return 'M' + sx + ',' + sy + 'C' + sx + ',' + m + ' ' + tx + ',' + m + ' ' + tx + ',' + ty;\n};\nconst diagonalR = (sa, sr, ta, tr) => {\n const sc = Math.cos(sa),\n ss = Math.sin(sa),\n tc = Math.cos(ta),\n ts = Math.sin(ta),\n mr = (sr + tr) / 2;\n return 'M' + sr * sc + ',' + sr * ss + 'C' + mr * sc + ',' + mr * ss + ' ' + mr * tc + ',' + mr * ts + ' ' + tr * tc + ',' + tr * ts;\n};\nconst Paths = fastmap({\n 'line': line,\n 'line-radial': lineR,\n 'arc': arc,\n 'arc-radial': arcR,\n 'curve': curve,\n 'curve-radial': curveR,\n 'orthogonal-horizontal': orthoX,\n 'orthogonal-vertical': orthoY,\n 'orthogonal-radial': orthoR,\n 'diagonal-horizontal': diagonalX,\n 'diagonal-vertical': diagonalY,\n 'diagonal-radial': diagonalR\n});\n\n/**\n * Pie and donut chart layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size pie segments.\n * @param {number} [params.startAngle=0] - The start angle (in radians) of the layout.\n * @param {number} [params.endAngle=2π] - The end angle (in radians) of the layout.\n * @param {boolean} [params.sort] - Boolean flag for sorting sectors by value.\n */\nfunction Pie(params) {\n Transform.call(this, null, params);\n}\nPie.Definition = {\n 'type': 'Pie',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'startAngle',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'endAngle',\n 'type': 'number',\n 'default': 6.283185307179586\n }, {\n 'name': 'sort',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['startAngle', 'endAngle']\n }]\n};\ninherits(Pie, Transform, {\n transform(_, pulse) {\n var as = _.as || ['startAngle', 'endAngle'],\n startAngle = as[0],\n endAngle = as[1],\n field = _.field || one,\n start = _.startAngle || 0,\n stop = _.endAngle != null ? _.endAngle : 2 * Math.PI,\n data = pulse.source,\n values = data.map(field),\n n = values.length,\n a = start,\n k = (stop - start) / sum(values),\n index = range(n),\n i,\n t,\n v;\n if (_.sort) {\n index.sort((a, b) => values[a] - values[b]);\n }\n for (i = 0; i < n; ++i) {\n v = values[index[i]];\n t = data[index[i]];\n t[startAngle] = a;\n t[endAngle] = a += v * k;\n }\n this.value = values;\n return pulse.reflow(_.modified()).modifies(as);\n }\n});\n\nconst DEFAULT_COUNT = 5;\nfunction includeZero(scale) {\n const type = scale.type;\n return !scale.bins && (type === Linear || type === Pow || type === Sqrt);\n}\nfunction includePad(type) {\n return isContinuous(type) && type !== Sequential;\n}\nconst SKIP = toSet(['set', 'modified', 'clear', 'type', 'scheme', 'schemeExtent', 'schemeCount', 'domain', 'domainMin', 'domainMid', 'domainMax', 'domainRaw', 'domainImplicit', 'nice', 'zero', 'bins', 'range', 'rangeStep', 'round', 'reverse', 'interpolate', 'interpolateGamma']);\n\n/**\n * Maintains a scale function mapping data values to visual channels.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction Scale(params) {\n Transform.call(this, null, params);\n this.modified(true); // always treat as modified\n}\n\ninherits(Scale, Transform, {\n transform(_, pulse) {\n var df = pulse.dataflow,\n scale$1 = this.value,\n key = scaleKey(_);\n if (!scale$1 || key !== scale$1.type) {\n this.value = scale$1 = scale(key)();\n }\n for (key in _) if (!SKIP[key]) {\n // padding is a scale property for band/point but not others\n if (key === 'padding' && includePad(scale$1.type)) continue;\n // invoke scale property setter, raise warning if not found\n isFunction(scale$1[key]) ? scale$1[key](_[key]) : df.warn('Unsupported scale property: ' + key);\n }\n configureRange(scale$1, _, configureBins(scale$1, _, configureDomain(scale$1, _, df)));\n return pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n }\n});\nfunction scaleKey(_) {\n var t = _.type,\n d = '',\n n;\n\n // backwards compatibility pre Vega 5.\n if (t === Sequential) return Sequential + '-' + Linear;\n if (isContinuousColor(_)) {\n n = _.rawDomain ? _.rawDomain.length : _.domain ? _.domain.length + +(_.domainMid != null) : 0;\n d = n === 2 ? Sequential + '-' : n === 3 ? Diverging + '-' : '';\n }\n return (d + t || Linear).toLowerCase();\n}\nfunction isContinuousColor(_) {\n const t = _.type;\n return isContinuous(t) && t !== Time && t !== UTC && (_.scheme || _.range && _.range.length && _.range.every(isString));\n}\nfunction configureDomain(scale, _, df) {\n // check raw domain, if provided use that and exit early\n const raw = rawDomain(scale, _.domainRaw, df);\n if (raw > -1) return raw;\n var domain = _.domain,\n type = scale.type,\n zero = _.zero || _.zero === undefined && includeZero(scale),\n n,\n mid;\n if (!domain) return 0;\n\n // adjust continuous domain for minimum pixel padding\n if (includePad(type) && _.padding && domain[0] !== peek(domain)) {\n domain = padDomain(type, domain, _.range, _.padding, _.exponent, _.constant);\n }\n\n // adjust domain based on zero, min, max settings\n if (zero || _.domainMin != null || _.domainMax != null || _.domainMid != null) {\n n = (domain = domain.slice()).length - 1 || 1;\n if (zero) {\n if (domain[0] > 0) domain[0] = 0;\n if (domain[n] < 0) domain[n] = 0;\n }\n if (_.domainMin != null) domain[0] = _.domainMin;\n if (_.domainMax != null) domain[n] = _.domainMax;\n if (_.domainMid != null) {\n mid = _.domainMid;\n const i = mid > domain[n] ? n + 1 : mid < domain[0] ? 0 : n;\n if (i !== n) df.warn('Scale domainMid exceeds domain min or max.', mid);\n domain.splice(i, 0, mid);\n }\n }\n\n // set the scale domain\n scale.domain(domainCheck(type, domain, df));\n\n // if ordinal scale domain is defined, prevent implicit\n // domain construction as side-effect of scale lookup\n if (type === Ordinal) {\n scale.unknown(_.domainImplicit ? scaleImplicit : undefined);\n }\n\n // perform 'nice' adjustment as requested\n if (_.nice && scale.nice) {\n scale.nice(_.nice !== true && tickCount(scale, _.nice) || null);\n }\n\n // return the cardinality of the domain\n return domain.length;\n}\nfunction rawDomain(scale, raw, df) {\n if (raw) {\n scale.domain(domainCheck(scale.type, raw, df));\n return raw.length;\n } else {\n return -1;\n }\n}\nfunction padDomain(type, domain, range, pad, exponent, constant) {\n var span = Math.abs(peek(range) - range[0]),\n frac = span / (span - 2 * pad),\n d = type === Log ? zoomLog(domain, null, frac) : type === Sqrt ? zoomPow(domain, null, frac, 0.5) : type === Pow ? zoomPow(domain, null, frac, exponent || 1) : type === Symlog ? zoomSymlog(domain, null, frac, constant || 1) : zoomLinear(domain, null, frac);\n domain = domain.slice();\n domain[0] = d[0];\n domain[domain.length - 1] = d[1];\n return domain;\n}\nfunction domainCheck(type, domain, df) {\n if (isLogarithmic(type)) {\n // sum signs of domain values\n // if all pos or all neg, abs(sum) === domain.length\n var s = Math.abs(domain.reduce((s, v) => s + (v < 0 ? -1 : v > 0 ? 1 : 0), 0));\n if (s !== domain.length) {\n df.warn('Log scale domain includes zero: ' + stringValue(domain));\n }\n }\n return domain;\n}\nfunction configureBins(scale, _, count) {\n let bins = _.bins;\n if (bins && !isArray(bins)) {\n // generate bin boundary array\n const domain = scale.domain(),\n lo = domain[0],\n hi = peek(domain),\n step = bins.step;\n let start = bins.start == null ? lo : bins.start,\n stop = bins.stop == null ? hi : bins.stop;\n if (!step) error('Scale bins parameter missing step property.');\n if (start < lo) start = step * Math.ceil(lo / step);\n if (stop > hi) stop = step * Math.floor(hi / step);\n bins = range(start, stop + step / 2, step);\n }\n if (bins) {\n // assign bin boundaries to scale instance\n scale.bins = bins;\n } else if (scale.bins) {\n // no current bins, remove bins if previously set\n delete scale.bins;\n }\n\n // special handling for bin-ordinal scales\n if (scale.type === BinOrdinal) {\n if (!bins) {\n // the domain specifies the bins\n scale.bins = scale.domain();\n } else if (!_.domain && !_.domainRaw) {\n // the bins specify the domain\n scale.domain(bins);\n count = bins.length;\n }\n }\n\n // return domain cardinality\n return count;\n}\nfunction configureRange(scale, _, count) {\n var type = scale.type,\n round = _.round || false,\n range = _.range;\n\n // if range step specified, calculate full range extent\n if (_.rangeStep != null) {\n range = configureRangeStep(type, _, count);\n }\n\n // else if a range scheme is defined, use that\n else if (_.scheme) {\n range = configureScheme(type, _, count);\n if (isFunction(range)) {\n if (scale.interpolator) {\n return scale.interpolator(range);\n } else {\n error(`Scale type ${type} does not support interpolating color schemes.`);\n }\n }\n }\n\n // given a range array for an interpolating scale, convert to interpolator\n if (range && isInterpolating(type)) {\n return scale.interpolator(interpolateColors(flip(range, _.reverse), _.interpolate, _.interpolateGamma));\n }\n\n // configure rounding / interpolation\n if (range && _.interpolate && scale.interpolate) {\n scale.interpolate(interpolate(_.interpolate, _.interpolateGamma));\n } else if (isFunction(scale.round)) {\n scale.round(round);\n } else if (isFunction(scale.rangeRound)) {\n scale.interpolate(round ? interpolateRound : interpolate$1);\n }\n if (range) scale.range(flip(range, _.reverse));\n}\nfunction configureRangeStep(type, _, count) {\n if (type !== Band && type !== Point) {\n error('Only band and point scales support rangeStep.');\n }\n\n // calculate full range based on requested step size and padding\n var outer = (_.paddingOuter != null ? _.paddingOuter : _.padding) || 0,\n inner = type === Point ? 1 : (_.paddingInner != null ? _.paddingInner : _.padding) || 0;\n return [0, _.rangeStep * bandSpace(count, inner, outer)];\n}\nfunction configureScheme(type, _, count) {\n var extent = _.schemeExtent,\n name,\n scheme$1;\n if (isArray(_.scheme)) {\n scheme$1 = interpolateColors(_.scheme, _.interpolate, _.interpolateGamma);\n } else {\n name = _.scheme.toLowerCase();\n scheme$1 = scheme(name);\n if (!scheme$1) error(`Unrecognized scheme name: ${_.scheme}`);\n }\n\n // determine size for potential discrete range\n count = type === Threshold ? count + 1 : type === BinOrdinal ? count - 1 : type === Quantile || type === Quantize ? +_.schemeCount || DEFAULT_COUNT : count;\n\n // adjust and/or quantize scheme as appropriate\n return isInterpolating(type) ? adjustScheme(scheme$1, extent, _.reverse) : isFunction(scheme$1) ? quantizeInterpolator(adjustScheme(scheme$1, extent), count) : type === Ordinal ? scheme$1 : scheme$1.slice(0, count);\n}\nfunction adjustScheme(scheme, extent, reverse) {\n return isFunction(scheme) && (extent || reverse) ? interpolateRange(scheme, flip(extent || [0, 1], reverse)) : scheme;\n}\nfunction flip(array, reverse) {\n return reverse ? array.slice().reverse() : array;\n}\n\n/**\n * Sorts scenegraph items in the pulse source array.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - A comparator\n * function for sorting tuples.\n */\nfunction SortItems(params) {\n Transform.call(this, null, params);\n}\ninherits(SortItems, Transform, {\n transform(_, pulse) {\n const mod = _.modified('sort') || pulse.changed(pulse.ADD) || pulse.modified(_.sort.fields) || pulse.modified('datum');\n if (mod) pulse.source.sort(stableCompare(_.sort));\n this.modified(mod);\n return pulse;\n }\n});\n\nconst Zero = 'zero',\n Center = 'center',\n Normalize = 'normalize',\n DefOutput = ['y0', 'y1'];\n\n/**\n * Stack layout for visualization elements.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to stack.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {function(object,object): number} [params.sort] - A comparator for stack sorting.\n * @param {string} [offset='zero'] - Stack baseline offset. One of 'zero', 'center', 'normalize'.\n */\nfunction Stack(params) {\n Transform.call(this, null, params);\n}\nStack.Definition = {\n 'type': 'Stack',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'offset',\n 'type': 'enum',\n 'default': Zero,\n 'values': [Zero, Center, Normalize]\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': DefOutput\n }]\n};\ninherits(Stack, Transform, {\n transform(_, pulse) {\n var as = _.as || DefOutput,\n y0 = as[0],\n y1 = as[1],\n sort = stableCompare(_.sort),\n field = _.field || one,\n stack = _.offset === Center ? stackCenter : _.offset === Normalize ? stackNormalize : stackZero,\n groups,\n i,\n n,\n max;\n\n // partition, sum, and sort the stack groups\n groups = partition(pulse.source, _.groupby, sort, field);\n\n // compute stack layouts per group\n for (i = 0, n = groups.length, max = groups.max; i < n; ++i) {\n stack(groups[i], max, field, y0, y1);\n }\n return pulse.reflow(_.modified()).modifies(as);\n }\n});\nfunction stackCenter(group, max, field, y0, y1) {\n var last = (max - group.sum) / 2,\n m = group.length,\n j = 0,\n t;\n for (; j < m; ++j) {\n t = group[j];\n t[y0] = last;\n t[y1] = last += Math.abs(field(t));\n }\n}\nfunction stackNormalize(group, max, field, y0, y1) {\n var scale = 1 / group.sum,\n last = 0,\n m = group.length,\n j = 0,\n v = 0,\n t;\n for (; j < m; ++j) {\n t = group[j];\n t[y0] = last;\n t[y1] = last = scale * (v += Math.abs(field(t)));\n }\n}\nfunction stackZero(group, max, field, y0, y1) {\n var lastPos = 0,\n lastNeg = 0,\n m = group.length,\n j = 0,\n v,\n t;\n for (; j < m; ++j) {\n t = group[j];\n v = +field(t);\n if (v < 0) {\n t[y0] = lastNeg;\n t[y1] = lastNeg += v;\n } else {\n t[y0] = lastPos;\n t[y1] = lastPos += v;\n }\n }\n}\nfunction partition(data, groupby, sort, field) {\n var groups = [],\n get = f => f(t),\n map,\n i,\n n,\n m,\n t,\n k,\n g,\n s,\n max;\n\n // partition data points into stack groups\n if (groupby == null) {\n groups.push(data.slice());\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n if (!g) {\n map[k] = g = [];\n groups.push(g);\n }\n g.push(t);\n }\n }\n\n // compute sums of groups, sort groups as needed\n for (k = 0, max = 0, m = groups.length; k < m; ++k) {\n g = groups[k];\n for (i = 0, s = 0, n = g.length; i < n; ++i) {\n s += Math.abs(field(g[i]));\n }\n g.sum = s;\n if (s > max) max = s;\n if (sort) g.sort(sort);\n }\n groups.max = max;\n return groups;\n}\n\nexport { AxisTicks as axisticks, DataJoin as datajoin, Encode as encode, LegendEntries as legendentries, LinkPath as linkpath, Pie as pie, Scale as scale, SortItems as sortitems, Stack as stack };\n","export default x => x;\n","function streamGeometry(geometry, stream) {\n if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {\n streamGeometryType[geometry.type](geometry, stream);\n }\n}\n\nvar streamObjectType = {\n Feature: function(object, stream) {\n streamGeometry(object.geometry, stream);\n },\n FeatureCollection: function(object, stream) {\n var features = object.features, i = -1, n = features.length;\n while (++i < n) streamGeometry(features[i].geometry, stream);\n }\n};\n\nvar streamGeometryType = {\n Sphere: function(object, stream) {\n stream.sphere();\n },\n Point: function(object, stream) {\n object = object.coordinates;\n stream.point(object[0], object[1], object[2]);\n },\n MultiPoint: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]);\n },\n LineString: function(object, stream) {\n streamLine(object.coordinates, stream, 0);\n },\n MultiLineString: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamLine(coordinates[i], stream, 0);\n },\n Polygon: function(object, stream) {\n streamPolygon(object.coordinates, stream);\n },\n MultiPolygon: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamPolygon(coordinates[i], stream);\n },\n GeometryCollection: function(object, stream) {\n var geometries = object.geometries, i = -1, n = geometries.length;\n while (++i < n) streamGeometry(geometries[i], stream);\n }\n};\n\nfunction streamLine(coordinates, stream, closed) {\n var i = -1, n = coordinates.length - closed, coordinate;\n stream.lineStart();\n while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);\n stream.lineEnd();\n}\n\nfunction streamPolygon(coordinates, stream) {\n var i = -1, n = coordinates.length;\n stream.polygonStart();\n while (++i < n) streamLine(coordinates[i], stream, 1);\n stream.polygonEnd();\n}\n\nexport default function(object, stream) {\n if (object && streamObjectType.hasOwnProperty(object.type)) {\n streamObjectType[object.type](object, stream);\n } else {\n streamGeometry(object, stream);\n }\n}\n","// https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423\nexport class Adder {\n constructor() {\n this._partials = new Float64Array(32);\n this._n = 0;\n }\n add(x) {\n const p = this._partials;\n let i = 0;\n for (let j = 0; j < this._n && j < 32; j++) {\n const y = p[j],\n hi = x + y,\n lo = Math.abs(x) < Math.abs(y) ? x - (hi - y) : y - (hi - x);\n if (lo) p[i++] = lo;\n x = hi;\n }\n p[i] = x;\n this._n = i + 1;\n return this;\n }\n valueOf() {\n const p = this._partials;\n let n = this._n, x, y, lo, hi = 0;\n if (n > 0) {\n hi = p[--n];\n while (n > 0) {\n x = hi;\n y = p[--n];\n hi = x + y;\n lo = y - (hi - x);\n if (lo) break;\n }\n if (n > 0 && ((lo < 0 && p[n - 1] < 0) || (lo > 0 && p[n - 1] > 0))) {\n y = lo * 2;\n x = hi + y;\n if (y == x - hi) hi = x;\n }\n }\n return hi;\n }\n}\n\nexport function fsum(values, valueof) {\n const adder = new Adder();\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n adder.add(value);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n adder.add(value);\n }\n }\n }\n return +adder;\n}\n\nexport function fcumsum(values, valueof) {\n const adder = new Adder();\n let index = -1;\n return Float64Array.from(values, valueof === undefined\n ? v => adder.add(+v || 0)\n : v => adder.add(+valueof(v, ++index, values) || 0)\n );\n}\n","export var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var tau = pi * 2;\n\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var ceil = Math.ceil;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var hypot = Math.hypot;\nexport var log = Math.log;\nexport var pow = Math.pow;\nexport var sin = Math.sin;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sqrt = Math.sqrt;\nexport var tan = Math.tan;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);\n}\n\nexport function haversin(x) {\n return (x = sin(x / 2)) * x;\n}\n","export default function noop() {}\n","import {Adder} from \"d3-array\";\nimport {abs} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar areaSum = new Adder(),\n areaRingSum = new Adder(),\n x00,\n y00,\n x0,\n y0;\n\nvar areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n areaStream.lineStart = areaStream.lineEnd = areaStream.point = noop;\n areaSum.add(abs(areaRingSum));\n areaRingSum = new Adder();\n },\n result: function() {\n var area = areaSum / 2;\n areaSum = new Adder();\n return area;\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaPointFirst(x, y) {\n areaStream.point = areaPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction areaPoint(x, y) {\n areaRingSum.add(y0 * x - x0 * y);\n x0 = x, y0 = y;\n}\n\nfunction areaRingEnd() {\n areaPoint(x00, y00);\n}\n\nexport default areaStream;\n","import noop from \"../noop.js\";\n\nvar x0 = Infinity,\n y0 = x0,\n x1 = -x0,\n y1 = x1;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop,\n result: function() {\n var bounds = [[x0, y0], [x1, y1]];\n x1 = y1 = -(y0 = x0 = Infinity);\n return bounds;\n }\n};\n\nfunction boundsPoint(x, y) {\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n}\n\nexport default boundsStream;\n","import {sqrt} from \"../math.js\";\n\n// TODO Enforce positive area for exterior, negative area for interior?\n\nvar X0 = 0,\n Y0 = 0,\n Z0 = 0,\n X1 = 0,\n Y1 = 0,\n Z1 = 0,\n X2 = 0,\n Y2 = 0,\n Z2 = 0,\n x00,\n y00,\n x0,\n y0;\n\nvar centroidStream = {\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.point = centroidPoint;\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n },\n result: function() {\n var centroid = Z2 ? [X2 / Z2, Y2 / Z2]\n : Z1 ? [X1 / Z1, Y1 / Z1]\n : Z0 ? [X0 / Z0, Y0 / Z0]\n : [NaN, NaN];\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 =\n X2 = Y2 = Z2 = 0;\n return centroid;\n }\n};\n\nfunction centroidPoint(x, y) {\n X0 += x;\n Y0 += y;\n ++Z0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidPointFirstLine;\n}\n\nfunction centroidPointFirstLine(x, y) {\n centroidStream.point = centroidPointLine;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidPointLine(x, y) {\n var dx = x - x0, dy = y - y0, z = sqrt(dx * dx + dy * dy);\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingStart() {\n centroidStream.point = centroidPointFirstRing;\n}\n\nfunction centroidRingEnd() {\n centroidPointRing(x00, y00);\n}\n\nfunction centroidPointFirstRing(x, y) {\n centroidStream.point = centroidPointRing;\n centroidPoint(x00 = x0 = x, y00 = y0 = y);\n}\n\nfunction centroidPointRing(x, y) {\n var dx = x - x0,\n dy = y - y0,\n z = sqrt(dx * dx + dy * dy);\n\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n\n z = y0 * x - x0 * y;\n X2 += z * (x0 + x);\n Y2 += z * (y0 + y);\n Z2 += z * 3;\n centroidPoint(x0 = x, y0 = y);\n}\n\nexport default centroidStream;\n","import {tau} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nexport default function PathContext(context) {\n this._context = context;\n}\n\nPathContext.prototype = {\n _radius: 4.5,\n pointRadius: function(_) {\n return this._radius = _, this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._context.closePath();\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._context.moveTo(x, y);\n this._point = 1;\n break;\n }\n case 1: {\n this._context.lineTo(x, y);\n break;\n }\n default: {\n this._context.moveTo(x + this._radius, y);\n this._context.arc(x, y, this._radius, 0, tau);\n break;\n }\n }\n },\n result: noop\n};\n","import {Adder} from \"d3-array\";\nimport {sqrt} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar lengthSum = new Adder(),\n lengthRing,\n x00,\n y00,\n x0,\n y0;\n\nvar lengthStream = {\n point: noop,\n lineStart: function() {\n lengthStream.point = lengthPointFirst;\n },\n lineEnd: function() {\n if (lengthRing) lengthPoint(x00, y00);\n lengthStream.point = noop;\n },\n polygonStart: function() {\n lengthRing = true;\n },\n polygonEnd: function() {\n lengthRing = null;\n },\n result: function() {\n var length = +lengthSum;\n lengthSum = new Adder();\n return length;\n }\n};\n\nfunction lengthPointFirst(x, y) {\n lengthStream.point = lengthPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction lengthPoint(x, y) {\n x0 -= x, y0 -= y;\n lengthSum.add(sqrt(x0 * x0 + y0 * y0));\n x0 = x, y0 = y;\n}\n\nexport default lengthStream;\n","// Simple caching for constant-radius points.\nlet cacheDigits, cacheAppend, cacheRadius, cacheCircle;\n\nexport default class PathString {\n constructor(digits) {\n this._append = digits == null ? append : appendRound(digits);\n this._radius = 4.5;\n this._ = \"\";\n }\n pointRadius(_) {\n this._radius = +_;\n return this;\n }\n polygonStart() {\n this._line = 0;\n }\n polygonEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line === 0) this._ += \"Z\";\n this._point = NaN;\n }\n point(x, y) {\n switch (this._point) {\n case 0: {\n this._append`M${x},${y}`;\n this._point = 1;\n break;\n }\n case 1: {\n this._append`L${x},${y}`;\n break;\n }\n default: {\n this._append`M${x},${y}`;\n if (this._radius !== cacheRadius || this._append !== cacheAppend) {\n const r = this._radius;\n const s = this._;\n this._ = \"\"; // stash the old string so we can cache the circle path fragment\n this._append`m0,${r}a${r},${r} 0 1,1 0,${-2 * r}a${r},${r} 0 1,1 0,${2 * r}z`;\n cacheRadius = r;\n cacheAppend = this._append;\n cacheCircle = this._;\n this._ = s;\n }\n this._ += cacheCircle;\n break;\n }\n }\n }\n result() {\n const result = this._;\n this._ = \"\";\n return result.length ? result : null;\n }\n}\n\nfunction append(strings) {\n let i = 1;\n this._ += strings[0];\n for (const j = strings.length; i < j; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n const d = Math.floor(digits);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${digits}`);\n if (d > 15) return append;\n if (d !== cacheDigits) {\n const k = 10 ** d;\n cacheDigits = d;\n cacheAppend = function append(strings) {\n let i = 1;\n this._ += strings[0];\n for (const j = strings.length; i < j; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n }\n return cacheAppend;\n}\n","import identity from \"../identity.js\";\nimport stream from \"../stream.js\";\nimport pathArea from \"./area.js\";\nimport pathBounds from \"./bounds.js\";\nimport pathCentroid from \"./centroid.js\";\nimport PathContext from \"./context.js\";\nimport pathMeasure from \"./measure.js\";\nimport PathString from \"./string.js\";\n\nexport default function(projection, context) {\n let digits = 3,\n pointRadius = 4.5,\n projectionStream,\n contextStream;\n\n function path(object) {\n if (object) {\n if (typeof pointRadius === \"function\") contextStream.pointRadius(+pointRadius.apply(this, arguments));\n stream(object, projectionStream(contextStream));\n }\n return contextStream.result();\n }\n\n path.area = function(object) {\n stream(object, projectionStream(pathArea));\n return pathArea.result();\n };\n\n path.measure = function(object) {\n stream(object, projectionStream(pathMeasure));\n return pathMeasure.result();\n };\n\n path.bounds = function(object) {\n stream(object, projectionStream(pathBounds));\n return pathBounds.result();\n };\n\n path.centroid = function(object) {\n stream(object, projectionStream(pathCentroid));\n return pathCentroid.result();\n };\n\n path.projection = function(_) {\n if (!arguments.length) return projection;\n projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream;\n return path;\n };\n\n path.context = function(_) {\n if (!arguments.length) return context;\n contextStream = _ == null ? (context = null, new PathString(digits)) : new PathContext(context = _);\n if (typeof pointRadius !== \"function\") contextStream.pointRadius(pointRadius);\n return path;\n };\n\n path.pointRadius = function(_) {\n if (!arguments.length) return pointRadius;\n pointRadius = typeof _ === \"function\" ? _ : (contextStream.pointRadius(+_), +_);\n return path;\n };\n\n path.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) digits = null;\n else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n if (context === null) contextStream = new PathString(digits);\n return path;\n };\n\n return path.projection(projection).digits(digits).context(context);\n}\n","import noop from \"../noop.js\";\n\nexport default function() {\n var lines = [],\n line;\n return {\n point: function(x, y, m) {\n line.push([x, y, m]);\n },\n lineStart: function() {\n lines.push(line = []);\n },\n lineEnd: noop,\n rejoin: function() {\n if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));\n },\n result: function() {\n var result = lines;\n lines = [];\n line = null;\n return result;\n }\n };\n}\n","import {abs, epsilon} from \"./math.js\";\n\nexport default function(a, b) {\n return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;\n}\n","import pointEqual from \"../pointEqual.js\";\nimport {epsilon} from \"../math.js\";\n\nfunction Intersection(point, points, other, entry) {\n this.x = point;\n this.z = points;\n this.o = other; // another intersection\n this.e = entry; // is an entry?\n this.v = false; // visited\n this.n = this.p = null; // next & previous\n}\n\n// A generalized polygon clipping algorithm: given a polygon that has been cut\n// into its visible line segments, and rejoins the segments by interpolating\n// along the clip edge.\nexport default function(segments, compareIntersection, startInside, interpolate, stream) {\n var subject = [],\n clip = [],\n i,\n n;\n\n segments.forEach(function(segment) {\n if ((n = segment.length - 1) <= 0) return;\n var n, p0 = segment[0], p1 = segment[n], x;\n\n if (pointEqual(p0, p1)) {\n if (!p0[2] && !p1[2]) {\n stream.lineStart();\n for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);\n stream.lineEnd();\n return;\n }\n // handle degenerate cases by moving the point\n p1[0] += 2 * epsilon;\n }\n\n subject.push(x = new Intersection(p0, segment, null, true));\n clip.push(x.o = new Intersection(p0, null, x, false));\n subject.push(x = new Intersection(p1, segment, null, false));\n clip.push(x.o = new Intersection(p1, null, x, true));\n });\n\n if (!subject.length) return;\n\n clip.sort(compareIntersection);\n link(subject);\n link(clip);\n\n for (i = 0, n = clip.length; i < n; ++i) {\n clip[i].e = startInside = !startInside;\n }\n\n var start = subject[0],\n points,\n point;\n\n while (1) {\n // Find first unvisited intersection.\n var current = start,\n isSubject = true;\n while (current.v) if ((current = current.n) === start) return;\n points = current.z;\n stream.lineStart();\n do {\n current.v = current.o.v = true;\n if (current.e) {\n if (isSubject) {\n for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.n.x, 1, stream);\n }\n current = current.n;\n } else {\n if (isSubject) {\n points = current.p.z;\n for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.p.x, -1, stream);\n }\n current = current.p;\n }\n current = current.o;\n points = current.z;\n isSubject = !isSubject;\n } while (!current.v);\n stream.lineEnd();\n }\n}\n\nfunction link(array) {\n if (!(n = array.length)) return;\n var n,\n i = 0,\n a = array[0],\n b;\n while (++i < n) {\n a.n = b = array[i];\n b.p = a;\n a = b;\n }\n a.n = b = array[0];\n b.p = a;\n}\n","import {asin, atan2, cos, sin, sqrt} from \"./math.js\";\n\nexport function spherical(cartesian) {\n return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])];\n}\n\nexport function cartesian(spherical) {\n var lambda = spherical[0], phi = spherical[1], cosPhi = cos(phi);\n return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];\n}\n\nexport function cartesianDot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n\nexport function cartesianCross(a, b) {\n return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];\n}\n\n// TODO return a\nexport function cartesianAddInPlace(a, b) {\n a[0] += b[0], a[1] += b[1], a[2] += b[2];\n}\n\nexport function cartesianScale(vector, k) {\n return [vector[0] * k, vector[1] * k, vector[2] * k];\n}\n\n// TODO return d\nexport function cartesianNormalizeInPlace(d) {\n var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);\n d[0] /= l, d[1] /= l, d[2] /= l;\n}\n","import {Adder} from \"d3-array\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace} from \"./cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, epsilon2, halfPi, pi, quarterPi, sign, sin, tau} from \"./math.js\";\n\nfunction longitude(point) {\n return abs(point[0]) <= pi ? point[0] : sign(point[0]) * ((abs(point[0]) + pi) % tau - pi);\n}\n\nexport default function(polygon, point) {\n var lambda = longitude(point),\n phi = point[1],\n sinPhi = sin(phi),\n normal = [sin(lambda), -cos(lambda), 0],\n angle = 0,\n winding = 0;\n\n var sum = new Adder();\n\n if (sinPhi === 1) phi = halfPi + epsilon;\n else if (sinPhi === -1) phi = -halfPi - epsilon;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n if (!(m = (ring = polygon[i]).length)) continue;\n var ring,\n m,\n point0 = ring[m - 1],\n lambda0 = longitude(point0),\n phi0 = point0[1] / 2 + quarterPi,\n sinPhi0 = sin(phi0),\n cosPhi0 = cos(phi0);\n\n for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {\n var point1 = ring[j],\n lambda1 = longitude(point1),\n phi1 = point1[1] / 2 + quarterPi,\n sinPhi1 = sin(phi1),\n cosPhi1 = cos(phi1),\n delta = lambda1 - lambda0,\n sign = delta >= 0 ? 1 : -1,\n absDelta = sign * delta,\n antimeridian = absDelta > pi,\n k = sinPhi0 * sinPhi1;\n\n sum.add(atan2(k * sign * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta)));\n angle += antimeridian ? delta + sign * tau : delta;\n\n // Are the longitudes either side of the point’s meridian (lambda),\n // and are the latitudes smaller than the parallel (phi)?\n if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {\n var arc = cartesianCross(cartesian(point0), cartesian(point1));\n cartesianNormalizeInPlace(arc);\n var intersection = cartesianCross(normal, arc);\n cartesianNormalizeInPlace(intersection);\n var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);\n if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {\n winding += antimeridian ^ delta >= 0 ? 1 : -1;\n }\n }\n }\n }\n\n // First, determine whether the South pole is inside or outside:\n //\n // It is inside if:\n // * the polygon winds around it in a clockwise direction.\n // * the polygon does not (cumulatively) wind around it, but has a negative\n // (counter-clockwise) area.\n //\n // Second, count the (signed) number of times a segment crosses a lambda\n // from the point to the South pole. If it is zero, then the point is the\n // same side as the South pole.\n\n return (angle < -epsilon || angle < epsilon && sum < -epsilon2) ^ (winding & 1);\n}\n","function* flatten(arrays) {\n for (const array of arrays) {\n yield* array;\n }\n}\n\nexport default function merge(arrays) {\n return Array.from(flatten(arrays));\n}\n","import clipBuffer from \"./buffer.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {epsilon, halfPi} from \"../math.js\";\nimport polygonContains from \"../polygonContains.js\";\nimport {merge} from \"d3-array\";\n\nexport default function(pointVisible, clipLine, interpolate, start) {\n return function(sink) {\n var line = clipLine(sink),\n ringBuffer = clipBuffer(),\n ringSink = clipLine(ringBuffer),\n polygonStarted = false,\n polygon,\n segments,\n ring;\n\n var clip = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() {\n clip.point = pointRing;\n clip.lineStart = ringStart;\n clip.lineEnd = ringEnd;\n segments = [];\n polygon = [];\n },\n polygonEnd: function() {\n clip.point = point;\n clip.lineStart = lineStart;\n clip.lineEnd = lineEnd;\n segments = merge(segments);\n var startInside = polygonContains(polygon, start);\n if (segments.length) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n clipRejoin(segments, compareIntersection, startInside, interpolate, sink);\n } else if (startInside) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n }\n if (polygonStarted) sink.polygonEnd(), polygonStarted = false;\n segments = polygon = null;\n },\n sphere: function() {\n sink.polygonStart();\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n sink.polygonEnd();\n }\n };\n\n function point(lambda, phi) {\n if (pointVisible(lambda, phi)) sink.point(lambda, phi);\n }\n\n function pointLine(lambda, phi) {\n line.point(lambda, phi);\n }\n\n function lineStart() {\n clip.point = pointLine;\n line.lineStart();\n }\n\n function lineEnd() {\n clip.point = point;\n line.lineEnd();\n }\n\n function pointRing(lambda, phi) {\n ring.push([lambda, phi]);\n ringSink.point(lambda, phi);\n }\n\n function ringStart() {\n ringSink.lineStart();\n ring = [];\n }\n\n function ringEnd() {\n pointRing(ring[0][0], ring[0][1]);\n ringSink.lineEnd();\n\n var clean = ringSink.clean(),\n ringSegments = ringBuffer.result(),\n i, n = ringSegments.length, m,\n segment,\n point;\n\n ring.pop();\n polygon.push(ring);\n ring = null;\n\n if (!n) return;\n\n // No intersections.\n if (clean & 1) {\n segment = ringSegments[0];\n if ((m = segment.length - 1) > 0) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n for (i = 0; i < m; ++i) sink.point((point = segment[i])[0], point[1]);\n sink.lineEnd();\n }\n return;\n }\n\n // Rejoin connected segments.\n // TODO reuse ringBuffer.rejoin()?\n if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));\n\n segments.push(ringSegments.filter(validSegment));\n }\n\n return clip;\n };\n}\n\nfunction validSegment(segment) {\n return segment.length > 1;\n}\n\n// Intersections are sorted along the clip edge. For both antimeridian cutting\n// and circle clipping, the same comparison is used.\nfunction compareIntersection(a, b) {\n return ((a = a.x)[0] < 0 ? a[1] - halfPi - epsilon : halfPi - a[1])\n - ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon : halfPi - b[1]);\n}\n","import clip from \"./index.js\";\nimport {abs, atan, cos, epsilon, halfPi, pi, sin} from \"../math.js\";\n\nexport default clip(\n function() { return true; },\n clipAntimeridianLine,\n clipAntimeridianInterpolate,\n [-pi, -halfPi]\n);\n\n// Takes a line and cuts into visible segments. Return values: 0 - there were\n// intersections or the line was empty; 1 - no intersections; 2 - there were\n// intersections, and the first and last segments should be rejoined.\nfunction clipAntimeridianLine(stream) {\n var lambda0 = NaN,\n phi0 = NaN,\n sign0 = NaN,\n clean; // no intersections\n\n return {\n lineStart: function() {\n stream.lineStart();\n clean = 1;\n },\n point: function(lambda1, phi1) {\n var sign1 = lambda1 > 0 ? pi : -pi,\n delta = abs(lambda1 - lambda0);\n if (abs(delta - pi) < epsilon) { // line crosses a pole\n stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n stream.point(lambda1, phi0);\n clean = 0;\n } else if (sign0 !== sign1 && delta >= pi) { // line crosses antimeridian\n if (abs(lambda0 - sign0) < epsilon) lambda0 -= sign0 * epsilon; // handle degeneracies\n if (abs(lambda1 - sign1) < epsilon) lambda1 -= sign1 * epsilon;\n phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n clean = 0;\n }\n stream.point(lambda0 = lambda1, phi0 = phi1);\n sign0 = sign1;\n },\n lineEnd: function() {\n stream.lineEnd();\n lambda0 = phi0 = NaN;\n },\n clean: function() {\n return 2 - clean; // if intersections, rejoin first and last segments\n }\n };\n}\n\nfunction clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) {\n var cosPhi0,\n cosPhi1,\n sinLambda0Lambda1 = sin(lambda0 - lambda1);\n return abs(sinLambda0Lambda1) > epsilon\n ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1)\n - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0))\n / (cosPhi0 * cosPhi1 * sinLambda0Lambda1))\n : (phi0 + phi1) / 2;\n}\n\nfunction clipAntimeridianInterpolate(from, to, direction, stream) {\n var phi;\n if (from == null) {\n phi = direction * halfPi;\n stream.point(-pi, phi);\n stream.point(0, phi);\n stream.point(pi, phi);\n stream.point(pi, 0);\n stream.point(pi, -phi);\n stream.point(0, -phi);\n stream.point(-pi, -phi);\n stream.point(-pi, 0);\n stream.point(-pi, phi);\n } else if (abs(from[0] - to[0]) > epsilon) {\n var lambda = from[0] < to[0] ? pi : -pi;\n phi = direction * lambda / 2;\n stream.point(-lambda, phi);\n stream.point(0, phi);\n stream.point(lambda, phi);\n } else {\n stream.point(to[0], to[1]);\n }\n}\n","import {cartesian, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport constant from \"./constant.js\";\nimport {acos, cos, degrees, epsilon, radians, sin, tau} from \"./math.js\";\nimport {rotateRadians} from \"./rotation.js\";\n\n// Generates a circle centered at [0°, 0°], with a given radius and precision.\nexport function circleStream(stream, radius, delta, direction, t0, t1) {\n if (!delta) return;\n var cosRadius = cos(radius),\n sinRadius = sin(radius),\n step = direction * delta;\n if (t0 == null) {\n t0 = radius + direction * tau;\n t1 = radius - step / 2;\n } else {\n t0 = circleRadius(cosRadius, t0);\n t1 = circleRadius(cosRadius, t1);\n if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau;\n }\n for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) {\n point = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * sin(t)]);\n stream.point(point[0], point[1]);\n }\n}\n\n// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0].\nfunction circleRadius(cosRadius, point) {\n point = cartesian(point), point[0] -= cosRadius;\n cartesianNormalizeInPlace(point);\n var radius = acos(-point[1]);\n return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;\n}\n\nexport default function() {\n var center = constant([0, 0]),\n radius = constant(90),\n precision = constant(6),\n ring,\n rotate,\n stream = {point: point};\n\n function point(x, y) {\n ring.push(x = rotate(x, y));\n x[0] *= degrees, x[1] *= degrees;\n }\n\n function circle() {\n var c = center.apply(this, arguments),\n r = radius.apply(this, arguments) * radians,\n p = precision.apply(this, arguments) * radians;\n ring = [];\n rotate = rotateRadians(-c[0] * radians, -c[1] * radians, 0).invert;\n circleStream(stream, r, p, 1);\n c = {type: \"Polygon\", coordinates: [ring]};\n ring = rotate = null;\n return c;\n }\n\n circle.center = function(_) {\n return arguments.length ? (center = typeof _ === \"function\" ? _ : constant([+_[0], +_[1]]), circle) : center;\n };\n\n circle.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), circle) : radius;\n };\n\n circle.precision = function(_) {\n return arguments.length ? (precision = typeof _ === \"function\" ? _ : constant(+_), circle) : precision;\n };\n\n return circle;\n}\n","import {abs, epsilon} from \"../math.js\";\nimport clipBuffer from \"./buffer.js\";\nimport clipLine from \"./line.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {merge} from \"d3-array\";\n\nvar clipMax = 1e9, clipMin = -clipMax;\n\n// TODO Use d3-polygon’s polygonContains here for the ring check?\n// TODO Eliminate duplicate buffering in clipBuffer and polygon.push?\n\nexport default function clipRectangle(x0, y0, x1, y1) {\n\n function visible(x, y) {\n return x0 <= x && x <= x1 && y0 <= y && y <= y1;\n }\n\n function interpolate(from, to, direction, stream) {\n var a = 0, a1 = 0;\n if (from == null\n || (a = corner(from, direction)) !== (a1 = corner(to, direction))\n || comparePoint(from, to) < 0 ^ direction > 0) {\n do stream.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);\n while ((a = (a + direction + 4) % 4) !== a1);\n } else {\n stream.point(to[0], to[1]);\n }\n }\n\n function corner(p, direction) {\n return abs(p[0] - x0) < epsilon ? direction > 0 ? 0 : 3\n : abs(p[0] - x1) < epsilon ? direction > 0 ? 2 : 1\n : abs(p[1] - y0) < epsilon ? direction > 0 ? 1 : 0\n : direction > 0 ? 3 : 2; // abs(p[1] - y1) < epsilon\n }\n\n function compareIntersection(a, b) {\n return comparePoint(a.x, b.x);\n }\n\n function comparePoint(a, b) {\n var ca = corner(a, 1),\n cb = corner(b, 1);\n return ca !== cb ? ca - cb\n : ca === 0 ? b[1] - a[1]\n : ca === 1 ? a[0] - b[0]\n : ca === 2 ? a[1] - b[1]\n : b[0] - a[0];\n }\n\n return function(stream) {\n var activeStream = stream,\n bufferStream = clipBuffer(),\n segments,\n polygon,\n ring,\n x__, y__, v__, // first point\n x_, y_, v_, // previous point\n first,\n clean;\n\n var clipStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: polygonStart,\n polygonEnd: polygonEnd\n };\n\n function point(x, y) {\n if (visible(x, y)) activeStream.point(x, y);\n }\n\n function polygonInside() {\n var winding = 0;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n for (var ring = polygon[i], j = 1, m = ring.length, point = ring[0], a0, a1, b0 = point[0], b1 = point[1]; j < m; ++j) {\n a0 = b0, a1 = b1, point = ring[j], b0 = point[0], b1 = point[1];\n if (a1 <= y1) { if (b1 > y1 && (b0 - a0) * (y1 - a1) > (b1 - a1) * (x0 - a0)) ++winding; }\n else { if (b1 <= y1 && (b0 - a0) * (y1 - a1) < (b1 - a1) * (x0 - a0)) --winding; }\n }\n }\n\n return winding;\n }\n\n // Buffer geometry within a polygon and then clip it en masse.\n function polygonStart() {\n activeStream = bufferStream, segments = [], polygon = [], clean = true;\n }\n\n function polygonEnd() {\n var startInside = polygonInside(),\n cleanInside = clean && startInside,\n visible = (segments = merge(segments)).length;\n if (cleanInside || visible) {\n stream.polygonStart();\n if (cleanInside) {\n stream.lineStart();\n interpolate(null, null, 1, stream);\n stream.lineEnd();\n }\n if (visible) {\n clipRejoin(segments, compareIntersection, startInside, interpolate, stream);\n }\n stream.polygonEnd();\n }\n activeStream = stream, segments = polygon = ring = null;\n }\n\n function lineStart() {\n clipStream.point = linePoint;\n if (polygon) polygon.push(ring = []);\n first = true;\n v_ = false;\n x_ = y_ = NaN;\n }\n\n // TODO rather than special-case polygons, simply handle them separately.\n // Ideally, coincident intersection points should be jittered to avoid\n // clipping issues.\n function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }\n\n function linePoint(x, y) {\n var v = visible(x, y);\n if (polygon) ring.push([x, y]);\n if (first) {\n x__ = x, y__ = y, v__ = v;\n first = false;\n if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n }\n } else {\n if (v && v_) activeStream.point(x, y);\n else {\n var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))],\n b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))];\n if (clipLine(a, b, x0, y0, x1, y1)) {\n if (!v_) {\n activeStream.lineStart();\n activeStream.point(a[0], a[1]);\n }\n activeStream.point(b[0], b[1]);\n if (!v) activeStream.lineEnd();\n clean = false;\n } else if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n clean = false;\n }\n }\n }\n x_ = x, y_ = y, v_ = v;\n }\n\n return clipStream;\n };\n}\n","export default function(a, b, x0, y0, x1, y1) {\n var ax = a[0],\n ay = a[1],\n bx = b[0],\n by = b[1],\n t0 = 0,\n t1 = 1,\n dx = bx - ax,\n dy = by - ay,\n r;\n\n r = x0 - ax;\n if (!dx && r > 0) return;\n r /= dx;\n if (dx < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dx > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = x1 - ax;\n if (!dx && r < 0) return;\n r /= dx;\n if (dx < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dx > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n r = y0 - ay;\n if (!dy && r > 0) return;\n r /= dy;\n if (dy < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dy > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = y1 - ay;\n if (!dy && r < 0) return;\n r /= dy;\n if (dy < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dy > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy;\n if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy;\n return true;\n}\n","export default function(a, b) {\n\n function compose(x, y) {\n return x = a(x, y), b(x[0], x[1]);\n }\n\n if (a.invert && b.invert) compose.invert = function(x, y) {\n return x = b.invert(x, y), x && a.invert(x[0], x[1]);\n };\n\n return compose;\n}\n","import compose from \"./compose.js\";\nimport {abs, asin, atan2, cos, degrees, pi, radians, sin, tau} from \"./math.js\";\n\nfunction rotationIdentity(lambda, phi) {\n if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;\n return [lambda, phi];\n}\n\nrotationIdentity.invert = rotationIdentity;\n\nexport function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {\n return (deltaLambda %= tau) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma))\n : rotationLambda(deltaLambda))\n : (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma)\n : rotationIdentity);\n}\n\nfunction forwardRotationLambda(deltaLambda) {\n return function(lambda, phi) {\n lambda += deltaLambda;\n if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;\n return [lambda, phi];\n };\n}\n\nfunction rotationLambda(deltaLambda) {\n var rotation = forwardRotationLambda(deltaLambda);\n rotation.invert = forwardRotationLambda(-deltaLambda);\n return rotation;\n}\n\nfunction rotationPhiGamma(deltaPhi, deltaGamma) {\n var cosDeltaPhi = cos(deltaPhi),\n sinDeltaPhi = sin(deltaPhi),\n cosDeltaGamma = cos(deltaGamma),\n sinDeltaGamma = sin(deltaGamma);\n\n function rotation(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaPhi + x * sinDeltaPhi;\n return [\n atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),\n asin(k * cosDeltaGamma + y * sinDeltaGamma)\n ];\n }\n\n rotation.invert = function(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaGamma - y * sinDeltaGamma;\n return [\n atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),\n asin(k * cosDeltaPhi - x * sinDeltaPhi)\n ];\n };\n\n return rotation;\n}\n\nexport default function(rotate) {\n rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);\n\n function forward(coordinates) {\n coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n }\n\n forward.invert = function(coordinates) {\n coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n };\n\n return forward;\n}\n","export default function(methods) {\n return {\n stream: transformer(methods)\n };\n}\n\nexport function transformer(methods) {\n return function(stream) {\n var s = new TransformStream;\n for (var key in methods) s[key] = methods[key];\n s.stream = stream;\n return s;\n };\n}\n\nfunction TransformStream() {}\n\nTransformStream.prototype = {\n constructor: TransformStream,\n point: function(x, y) { this.stream.point(x, y); },\n sphere: function() { this.stream.sphere(); },\n lineStart: function() { this.stream.lineStart(); },\n lineEnd: function() { this.stream.lineEnd(); },\n polygonStart: function() { this.stream.polygonStart(); },\n polygonEnd: function() { this.stream.polygonEnd(); }\n};\n","import {default as geoStream} from \"../stream.js\";\nimport boundsStream from \"../path/bounds.js\";\n\nfunction fit(projection, fitBounds, object) {\n var clip = projection.clipExtent && projection.clipExtent();\n projection.scale(150).translate([0, 0]);\n if (clip != null) projection.clipExtent(null);\n geoStream(object, projection.stream(boundsStream));\n fitBounds(boundsStream.result());\n if (clip != null) projection.clipExtent(clip);\n return projection;\n}\n\nexport function fitExtent(projection, extent, object) {\n return fit(projection, function(b) {\n var w = extent[1][0] - extent[0][0],\n h = extent[1][1] - extent[0][1],\n k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])),\n x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2,\n y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitSize(projection, size, object) {\n return fitExtent(projection, [[0, 0], size], object);\n}\n\nexport function fitWidth(projection, width, object) {\n return fit(projection, function(b) {\n var w = +width,\n k = w / (b[1][0] - b[0][0]),\n x = (w - k * (b[1][0] + b[0][0])) / 2,\n y = -k * b[0][1];\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitHeight(projection, height, object) {\n return fit(projection, function(b) {\n var h = +height,\n k = h / (b[1][1] - b[0][1]),\n x = -k * b[0][0],\n y = (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n","import {cartesian} from \"../cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, radians, sqrt} from \"../math.js\";\nimport {transformer} from \"../transform.js\";\n\nvar maxDepth = 16, // maximum depth of subdivision\n cosMinDistance = cos(30 * radians); // cos(minimum angular distance)\n\nexport default function(project, delta2) {\n return +delta2 ? resample(project, delta2) : resampleNone(project);\n}\n\nfunction resampleNone(project) {\n return transformer({\n point: function(x, y) {\n x = project(x, y);\n this.stream.point(x[0], x[1]);\n }\n });\n}\n\nfunction resample(project, delta2) {\n\n function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) {\n var dx = x1 - x0,\n dy = y1 - y0,\n d2 = dx * dx + dy * dy;\n if (d2 > 4 * delta2 && depth--) {\n var a = a0 + a1,\n b = b0 + b1,\n c = c0 + c1,\n m = sqrt(a * a + b * b + c * c),\n phi2 = asin(c /= m),\n lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a),\n p = project(lambda2, phi2),\n x2 = p[0],\n y2 = p[1],\n dx2 = x2 - x0,\n dy2 = y2 - y0,\n dz = dy * dx2 - dx * dy2;\n if (dz * dz / d2 > delta2 // perpendicular projected distance\n || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end\n || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream);\n stream.point(x2, y2);\n resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream);\n }\n }\n }\n return function(stream) {\n var lambda00, x00, y00, a00, b00, c00, // first point\n lambda0, x0, y0, a0, b0, c0; // previous point\n\n var resampleStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; },\n polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; }\n };\n\n function point(x, y) {\n x = project(x, y);\n stream.point(x[0], x[1]);\n }\n\n function lineStart() {\n x0 = NaN;\n resampleStream.point = linePoint;\n stream.lineStart();\n }\n\n function linePoint(lambda, phi) {\n var c = cartesian([lambda, phi]), p = project(lambda, phi);\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);\n stream.point(x0, y0);\n }\n\n function lineEnd() {\n resampleStream.point = point;\n stream.lineEnd();\n }\n\n function ringStart() {\n lineStart();\n resampleStream.point = ringPoint;\n resampleStream.lineEnd = ringEnd;\n }\n\n function ringPoint(lambda, phi) {\n linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;\n resampleStream.point = linePoint;\n }\n\n function ringEnd() {\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream);\n resampleStream.lineEnd = lineEnd;\n lineEnd();\n }\n\n return resampleStream;\n };\n}\n","import clipAntimeridian from \"../clip/antimeridian.js\";\nimport clipCircle from \"../clip/circle.js\";\nimport clipRectangle from \"../clip/rectangle.js\";\nimport compose from \"../compose.js\";\nimport identity from \"../identity.js\";\nimport {cos, degrees, radians, sin, sqrt} from \"../math.js\";\nimport {rotateRadians} from \"../rotation.js\";\nimport {transformer} from \"../transform.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\nimport resample from \"./resample.js\";\n\nvar transformRadians = transformer({\n point: function(x, y) {\n this.stream.point(x * radians, y * radians);\n }\n});\n\nfunction transformRotate(rotate) {\n return transformer({\n point: function(x, y) {\n var r = rotate(x, y);\n return this.stream.point(r[0], r[1]);\n }\n });\n}\n\nfunction scaleTranslate(k, dx, dy, sx, sy) {\n function transform(x, y) {\n x *= sx; y *= sy;\n return [dx + k * x, dy - k * y];\n }\n transform.invert = function(x, y) {\n return [(x - dx) / k * sx, (dy - y) / k * sy];\n };\n return transform;\n}\n\nfunction scaleTranslateRotate(k, dx, dy, sx, sy, alpha) {\n if (!alpha) return scaleTranslate(k, dx, dy, sx, sy);\n var cosAlpha = cos(alpha),\n sinAlpha = sin(alpha),\n a = cosAlpha * k,\n b = sinAlpha * k,\n ai = cosAlpha / k,\n bi = sinAlpha / k,\n ci = (sinAlpha * dy - cosAlpha * dx) / k,\n fi = (sinAlpha * dx + cosAlpha * dy) / k;\n function transform(x, y) {\n x *= sx; y *= sy;\n return [a * x - b * y + dx, dy - b * x - a * y];\n }\n transform.invert = function(x, y) {\n return [sx * (ai * x - bi * y + ci), sy * (fi - bi * x - ai * y)];\n };\n return transform;\n}\n\nexport default function projection(project) {\n return projectionMutator(function() { return project; })();\n}\n\nexport function projectionMutator(projectAt) {\n var project,\n k = 150, // scale\n x = 480, y = 250, // translate\n lambda = 0, phi = 0, // center\n deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, // pre-rotate\n alpha = 0, // post-rotate angle\n sx = 1, // reflectX\n sy = 1, // reflectX\n theta = null, preclip = clipAntimeridian, // pre-clip angle\n x0 = null, y0, x1, y1, postclip = identity, // post-clip extent\n delta2 = 0.5, // precision\n projectResample,\n projectTransform,\n projectRotateTransform,\n cache,\n cacheStream;\n\n function projection(point) {\n return projectRotateTransform(point[0] * radians, point[1] * radians);\n }\n\n function invert(point) {\n point = projectRotateTransform.invert(point[0], point[1]);\n return point && [point[0] * degrees, point[1] * degrees];\n }\n\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));\n };\n\n projection.preclip = function(_) {\n return arguments.length ? (preclip = _, theta = undefined, reset()) : preclip;\n };\n\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\n };\n\n projection.clipAngle = function(_) {\n return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees;\n };\n\n projection.clipExtent = function(_) {\n return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n projection.scale = function(_) {\n return arguments.length ? (k = +_, recenter()) : k;\n };\n\n projection.translate = function(_) {\n return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y];\n };\n\n projection.center = function(_) {\n return arguments.length ? (lambda = _[0] % 360 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];\n };\n\n projection.rotate = function(_) {\n return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];\n };\n\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, recenter()) : alpha * degrees;\n };\n\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, recenter()) : sx < 0;\n };\n\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0;\n };\n\n projection.precision = function(_) {\n return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2);\n };\n\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n function recenter() {\n var center = scaleTranslateRotate(k, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)),\n transform = scaleTranslateRotate(k, x - center[0], y - center[1], sx, sy, alpha);\n rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma);\n projectTransform = compose(project, transform);\n projectRotateTransform = compose(rotate, projectTransform);\n projectResample = resample(projectTransform, delta2);\n return reset();\n }\n\n function reset() {\n cache = cacheStream = null;\n return projection;\n }\n\n return function() {\n project = projectAt.apply(this, arguments);\n projection.invert = project.invert && invert;\n return recenter();\n };\n}\n","import {cartesian, cartesianAddInPlace, cartesianCross, cartesianDot, cartesianScale, spherical} from \"../cartesian.js\";\nimport {circleStream} from \"../circle.js\";\nimport {abs, cos, epsilon, pi, radians, sqrt} from \"../math.js\";\nimport pointEqual from \"../pointEqual.js\";\nimport clip from \"./index.js\";\n\nexport default function(radius) {\n var cr = cos(radius),\n delta = 6 * radians,\n smallRadius = cr > 0,\n notHemisphere = abs(cr) > epsilon; // TODO optimise for this common case\n\n function interpolate(from, to, direction, stream) {\n circleStream(stream, radius, delta, direction, from, to);\n }\n\n function visible(lambda, phi) {\n return cos(lambda) * cos(phi) > cr;\n }\n\n // Takes a line and cuts into visible segments. Return values used for polygon\n // clipping: 0 - there were intersections or the line was empty; 1 - no\n // intersections 2 - there were intersections, and the first and last segments\n // should be rejoined.\n function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }\n\n // Intersects the great circle between a and b with the clip circle.\n function intersect(a, b, two) {\n var pa = cartesian(a),\n pb = cartesian(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = cartesianCross(pa, pb),\n n2n2 = cartesianDot(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = cartesianCross(n1, n2),\n A = cartesianScale(n1, c1),\n B = cartesianScale(n2, c2);\n cartesianAddInPlace(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = cartesianDot(A, u),\n uu = cartesianDot(u, u),\n t2 = w * w - uu * (cartesianDot(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = sqrt(t2),\n q = cartesianScale(u, (-w - t) / uu);\n cartesianAddInPlace(q, A);\n q = spherical(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = abs(delta - pi) < epsilon,\n meridian = polar || delta < epsilon;\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = cartesianScale(u, (-w + t) / uu);\n cartesianAddInPlace(q1, A);\n return [q, spherical(q1)];\n }\n }\n\n // Generates a 4-bit vector representing the location of a point relative to\n // the small circle's bounding box.\n function code(lambda, phi) {\n var r = smallRadius ? radius : pi - radius,\n code = 0;\n if (lambda < -r) code |= 1; // left\n else if (lambda > r) code |= 2; // right\n if (phi < -r) code |= 4; // below\n else if (phi > r) code |= 8; // above\n return code;\n }\n\n return clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);\n}\n","import {degrees, pi, radians} from \"../math.js\";\nimport {projectionMutator} from \"./index.js\";\n\nexport function conicProjection(projectAt) {\n var phi0 = 0,\n phi1 = pi / 3,\n m = projectionMutator(projectAt),\n p = m(phi0, phi1);\n\n p.parallels = function(_) {\n return arguments.length ? m(phi0 = _[0] * radians, phi1 = _[1] * radians) : [phi0 * degrees, phi1 * degrees];\n };\n\n return p;\n}\n","import {abs, asin, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {cylindricalEqualAreaRaw} from \"./cylindricalEqualArea.js\";\n\nexport function conicEqualAreaRaw(y0, y1) {\n var sy0 = sin(y0), n = (sy0 + sin(y1)) / 2;\n\n // Are the parallels symmetrical around the Equator?\n if (abs(n) < epsilon) return cylindricalEqualAreaRaw(y0);\n\n var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c) / n;\n\n function project(x, y) {\n var r = sqrt(c - 2 * n * sin(y)) / n;\n return [r * sin(x *= n), r0 - r * cos(x)];\n }\n\n project.invert = function(x, y) {\n var r0y = r0 - y,\n l = atan2(x, abs(r0y)) * sign(r0y);\n if (r0y * n < 0)\n l -= pi * sign(x) * sign(r0y);\n return [l / n, asin((c - (x * x + r0y * r0y) * n * n) / (2 * n))];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEqualAreaRaw)\n .scale(155.424)\n .center([0, 33.6442]);\n}\n","import {asin, cos, sin} from \"../math.js\";\n\nexport function cylindricalEqualAreaRaw(phi0) {\n var cosPhi0 = cos(phi0);\n\n function forward(lambda, phi) {\n return [lambda * cosPhi0, sin(phi) / cosPhi0];\n }\n\n forward.invert = function(x, y) {\n return [x / cosPhi0, asin(y * cosPhi0)];\n };\n\n return forward;\n}\n","import conicEqualArea from \"./conicEqualArea.js\";\n\nexport default function() {\n return conicEqualArea()\n .parallels([29.5, 45.5])\n .scale(1070)\n .translate([480, 250])\n .rotate([96, 0])\n .center([-0.6, 38.7]);\n}\n","import {asin, atan2, cos, sin, sqrt} from \"../math.js\";\n\nexport function azimuthalRaw(scale) {\n return function(x, y) {\n var cx = cos(x),\n cy = cos(y),\n k = scale(cx * cy);\n if (k === Infinity) return [2, 0];\n return [\n k * cy * sin(x),\n k * sin(y)\n ];\n }\n}\n\nexport function azimuthalInvert(angle) {\n return function(x, y) {\n var z = sqrt(x * x + y * y),\n c = angle(z),\n sc = sin(c),\n cc = cos(c);\n return [\n atan2(x * sc, z * cc),\n asin(z && y * sc / z)\n ];\n }\n}\n","import {asin, sqrt} from \"../math.js\";\nimport {azimuthalRaw, azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport var azimuthalEqualAreaRaw = azimuthalRaw(function(cxcy) {\n return sqrt(2 / (1 + cxcy));\n});\n\nazimuthalEqualAreaRaw.invert = azimuthalInvert(function(z) {\n return 2 * asin(z / 2);\n});\n\nexport default function() {\n return projection(azimuthalEqualAreaRaw)\n .scale(124.75)\n .clipAngle(180 - 1e-3);\n}\n","import {acos, sin} from \"../math.js\";\nimport {azimuthalRaw, azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport var azimuthalEquidistantRaw = azimuthalRaw(function(c) {\n return (c = acos(c)) && c / sin(c);\n});\n\nazimuthalEquidistantRaw.invert = azimuthalInvert(function(z) {\n return z;\n});\n\nexport default function() {\n return projection(azimuthalEquidistantRaw)\n .scale(79.4188)\n .clipAngle(180 - 1e-3);\n}\n","import {atan, exp, halfPi, log, pi, tan, tau} from \"../math.js\";\nimport rotation from \"../rotation.js\";\nimport projection from \"./index.js\";\n\nexport function mercatorRaw(lambda, phi) {\n return [lambda, log(tan((halfPi + phi) / 2))];\n}\n\nmercatorRaw.invert = function(x, y) {\n return [x, 2 * atan(exp(y)) - halfPi];\n};\n\nexport default function() {\n return mercatorProjection(mercatorRaw)\n .scale(961 / tau);\n}\n\nexport function mercatorProjection(project) {\n var m = projection(project),\n center = m.center,\n scale = m.scale,\n translate = m.translate,\n clipExtent = m.clipExtent,\n x0 = null, y0, x1, y1; // clip extent\n\n m.scale = function(_) {\n return arguments.length ? (scale(_), reclip()) : scale();\n };\n\n m.translate = function(_) {\n return arguments.length ? (translate(_), reclip()) : translate();\n };\n\n m.center = function(_) {\n return arguments.length ? (center(_), reclip()) : center();\n };\n\n m.clipExtent = function(_) {\n return arguments.length ? ((_ == null ? x0 = y0 = x1 = y1 = null : (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1])), reclip()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n function reclip() {\n var k = pi * scale(),\n t = m(rotation(m.rotate()).invert([0, 0]));\n return clipExtent(x0 == null\n ? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw\n ? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]]\n : [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]);\n }\n\n return reclip();\n}\n","import {abs, atan, atan2, cos, epsilon, halfPi, log, pi, pow, sign, sin, sqrt, tan} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {mercatorRaw} from \"./mercator.js\";\n\nfunction tany(y) {\n return tan((halfPi + y) / 2);\n}\n\nexport function conicConformalRaw(y0, y1) {\n var cy0 = cos(y0),\n n = y0 === y1 ? sin(y0) : log(cy0 / cos(y1)) / log(tany(y1) / tany(y0)),\n f = cy0 * pow(tany(y0), n) / n;\n\n if (!n) return mercatorRaw;\n\n function project(x, y) {\n if (f > 0) { if (y < -halfPi + epsilon) y = -halfPi + epsilon; }\n else { if (y > halfPi - epsilon) y = halfPi - epsilon; }\n var r = f / pow(tany(y), n);\n return [r * sin(n * x), f - r * cos(n * x)];\n }\n\n project.invert = function(x, y) {\n var fy = f - y, r = sign(n) * sqrt(x * x + fy * fy),\n l = atan2(x, abs(fy)) * sign(fy);\n if (fy * n < 0)\n l -= pi * sign(x) * sign(fy);\n return [l / n, 2 * atan(pow(f / r, 1 / n)) - halfPi];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicConformalRaw)\n .scale(109.5)\n .parallels([30, 30]);\n}\n","import projection from \"./index.js\";\n\nexport function equirectangularRaw(lambda, phi) {\n return [lambda, phi];\n}\n\nequirectangularRaw.invert = equirectangularRaw;\n\nexport default function() {\n return projection(equirectangularRaw)\n .scale(152.63);\n}\n","import {abs, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {equirectangularRaw} from \"./equirectangular.js\";\n\nexport function conicEquidistantRaw(y0, y1) {\n var cy0 = cos(y0),\n n = y0 === y1 ? sin(y0) : (cy0 - cos(y1)) / (y1 - y0),\n g = cy0 / n + y0;\n\n if (abs(n) < epsilon) return equirectangularRaw;\n\n function project(x, y) {\n var gy = g - y, nx = n * x;\n return [gy * sin(nx), g - gy * cos(nx)];\n }\n\n project.invert = function(x, y) {\n var gy = g - y,\n l = atan2(x, abs(gy)) * sign(gy);\n if (gy * n < 0)\n l -= pi * sign(x) * sign(gy);\n return [l / n, g - sign(n) * sqrt(x * x + gy * gy)];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEquidistantRaw)\n .scale(131.154)\n .center([0, 13.9389]);\n}\n","import projection from \"./index.js\";\nimport {abs, asin, cos, epsilon2, sin, sqrt} from \"../math.js\";\n\nvar A1 = 1.340264,\n A2 = -0.081106,\n A3 = 0.000893,\n A4 = 0.003796,\n M = sqrt(3) / 2,\n iterations = 12;\n\nexport function equalEarthRaw(lambda, phi) {\n var l = asin(M * sin(phi)), l2 = l * l, l6 = l2 * l2 * l2;\n return [\n lambda * cos(l) / (M * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2))),\n l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2))\n ];\n}\n\nequalEarthRaw.invert = function(x, y) {\n var l = y, l2 = l * l, l6 = l2 * l2 * l2;\n for (var i = 0, delta, fy, fpy; i < iterations; ++i) {\n fy = l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - y;\n fpy = A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2);\n l -= delta = fy / fpy, l2 = l * l, l6 = l2 * l2 * l2;\n if (abs(delta) < epsilon2) break;\n }\n return [\n M * x * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / cos(l),\n asin(sin(l) / M)\n ];\n};\n\nexport default function() {\n return projection(equalEarthRaw)\n .scale(177.158);\n}\n","import {atan, cos, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function gnomonicRaw(x, y) {\n var cy = cos(y), k = cos(x) * cy;\n return [cy * sin(x) / k, sin(y) / k];\n}\n\ngnomonicRaw.invert = azimuthalInvert(atan);\n\nexport default function() {\n return projection(gnomonicRaw)\n .scale(144.049)\n .clipAngle(60);\n}\n","import projection from \"./index.js\";\nimport {abs, epsilon} from \"../math.js\";\n\nexport function naturalEarth1Raw(lambda, phi) {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n return [\n lambda * (0.8707 - 0.131979 * phi2 + phi4 * (-0.013791 + phi4 * (0.003971 * phi2 - 0.001529 * phi4))),\n phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4)))\n ];\n}\n\nnaturalEarth1Raw.invert = function(x, y) {\n var phi = y, i = 25, delta;\n do {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n phi -= delta = (phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) - y) /\n (1.007226 + phi2 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi2 - 0.005916 * 11 * phi4)));\n } while (abs(delta) > epsilon && --i > 0);\n return [\n x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))),\n phi\n ];\n};\n\nexport default function() {\n return projection(naturalEarth1Raw)\n .scale(175.295);\n}\n","import {asin, cos, epsilon, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function orthographicRaw(x, y) {\n return [cos(y) * sin(x), sin(y)];\n}\n\northographicRaw.invert = azimuthalInvert(asin);\n\nexport default function() {\n return projection(orthographicRaw)\n .scale(249.5)\n .clipAngle(90 + epsilon);\n}\n","import {atan, cos, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function stereographicRaw(x, y) {\n var cy = cos(y), k = 1 + cos(x) * cy;\n return [cy * sin(x) / k, sin(y) / k];\n}\n\nstereographicRaw.invert = azimuthalInvert(function(z) {\n return 2 * atan(z);\n});\n\nexport default function() {\n return projection(stereographicRaw)\n .scale(250)\n .clipAngle(142);\n}\n","import {atan, exp, halfPi, log, tan} from \"../math.js\";\nimport {mercatorProjection} from \"./mercator.js\";\n\nexport function transverseMercatorRaw(lambda, phi) {\n return [log(tan((halfPi + phi) / 2)), -lambda];\n}\n\ntransverseMercatorRaw.invert = function(x, y) {\n return [-y, 2 * atan(exp(x)) - halfPi];\n};\n\nexport default function() {\n var m = mercatorProjection(transverseMercatorRaw),\n center = m.center,\n rotate = m.rotate;\n\n m.center = function(_) {\n return arguments.length ? center([-_[1], _[0]]) : (_ = center(), [_[1], -_[0]]);\n };\n\n m.rotate = function(_) {\n return arguments.length ? rotate([_[0], _[1], _.length > 2 ? _[2] + 90 : 90]) : (_ = rotate(), [_[0], _[1], _[2] - 90]);\n };\n\n return rotate([0, 0, 90])\n .scale(159.155);\n}\n","export var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var ceil = Math.ceil;\nexport var cos = Math.cos;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var log = Math.log;\nexport var max = Math.max;\nexport var min = Math.min;\nexport var pow = Math.pow;\nexport var round = Math.round;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sin = Math.sin;\nexport var tan = Math.tan;\n\nexport var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var sqrt1_2 = Math.SQRT1_2;\nexport var sqrt2 = sqrt(2);\nexport var sqrtPi = sqrt(pi);\nexport var tau = pi * 2;\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport function sinci(x) {\n return x ? x / Math.sin(x) : 1;\n}\n\nexport function asin(x) {\n return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);\n}\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function sqrt(x) {\n return x > 0 ? Math.sqrt(x) : 0;\n}\n\nexport function tanh(x) {\n x = exp(2 * x);\n return (x - 1) / (x + 1);\n}\n\nexport function sinh(x) {\n return (exp(x) - exp(-x)) / 2;\n}\n\nexport function cosh(x) {\n return (exp(x) + exp(-x)) / 2;\n}\n\nexport function arsinh(x) {\n return log(x + sqrt(x * x + 1));\n}\n\nexport function arcosh(x) {\n return log(x + sqrt(x * x - 1));\n}\n","import {geoProjection as projection} from \"d3-geo\";\nimport {abs, asin, cos, epsilon, halfPi, pi, sin, sqrt2} from \"./math.js\";\n\nexport function mollweideBromleyTheta(cp, phi) {\n var cpsinPhi = cp * sin(phi), i = 30, delta;\n do phi -= delta = (phi + sin(phi) - cpsinPhi) / (1 + cos(phi));\n while (abs(delta) > epsilon && --i > 0);\n return phi / 2;\n}\n\nexport function mollweideBromleyRaw(cx, cy, cp) {\n\n function forward(lambda, phi) {\n return [cx * lambda * cos(phi = mollweideBromleyTheta(cp, phi)), cy * sin(phi)];\n }\n\n forward.invert = function(x, y) {\n return y = asin(y / cy), [x / (cx * cos(y)), asin((2 * y + sin(2 * y)) / cp)];\n };\n\n return forward;\n}\n\nexport var mollweideRaw = mollweideBromleyRaw(sqrt2 / halfPi, sqrt2, pi);\n\nexport default function() {\n return projection(mollweideRaw)\n .scale(169.529);\n}\n","import { geoPath, geoAlbers, geoAlbersUsa, geoAzimuthalEqualArea, geoAzimuthalEquidistant, geoConicConformal, geoConicEqualArea, geoConicEquidistant, geoEqualEarth, geoEquirectangular, geoGnomonic, geoIdentity, geoMercator, geoNaturalEarth1, geoOrthographic, geoStereographic, geoTransverseMercator } from 'd3-geo';\nimport { geoMollweide } from 'd3-geo-projection';\nimport { registerScale } from 'vega-scale';\n\nconst defaultPath = geoPath();\nconst projectionProperties = [\n// standard properties in d3-geo\n'clipAngle', 'clipExtent', 'scale', 'translate', 'center', 'rotate', 'parallels', 'precision', 'reflectX', 'reflectY',\n// extended properties in d3-geo-projections\n'coefficient', 'distance', 'fraction', 'lobes', 'parallel', 'radius', 'ratio', 'spacing', 'tilt'];\n\n/**\n * Augment projections with their type and a copy method.\n */\nfunction create(type, constructor) {\n return function projection() {\n const p = constructor();\n p.type = type;\n p.path = geoPath().projection(p);\n p.copy = p.copy || function () {\n const c = projection();\n projectionProperties.forEach(prop => {\n if (p[prop]) c[prop](p[prop]());\n });\n c.path.pointRadius(p.path.pointRadius());\n return c;\n };\n return registerScale(p);\n };\n}\nfunction projection(type, proj) {\n if (!type || typeof type !== 'string') {\n throw new Error('Projection type must be a name string.');\n }\n type = type.toLowerCase();\n if (arguments.length > 1) {\n projections[type] = create(type, proj);\n return this;\n } else {\n return projections[type] || null;\n }\n}\nfunction getProjectionPath(proj) {\n return proj && proj.path || defaultPath;\n}\nconst projections = {\n // base d3-geo projection types\n albers: geoAlbers,\n albersusa: geoAlbersUsa,\n azimuthalequalarea: geoAzimuthalEqualArea,\n azimuthalequidistant: geoAzimuthalEquidistant,\n conicconformal: geoConicConformal,\n conicequalarea: geoConicEqualArea,\n conicequidistant: geoConicEquidistant,\n equalEarth: geoEqualEarth,\n equirectangular: geoEquirectangular,\n gnomonic: geoGnomonic,\n identity: geoIdentity,\n mercator: geoMercator,\n mollweide: geoMollweide,\n naturalEarth1: geoNaturalEarth1,\n orthographic: geoOrthographic,\n stereographic: geoStereographic,\n transversemercator: geoTransverseMercator\n};\nfor (const key in projections) {\n projection(key, projections[key]);\n}\n\nexport { getProjectionPath, projection, projectionProperties };\n","import {epsilon} from \"../math.js\";\nimport albers from \"./albers.js\";\nimport conicEqualArea from \"./conicEqualArea.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\n\n// The projections must have mutually exclusive clip regions on the sphere,\n// as this will avoid emitting interleaving lines and polygons.\nfunction multiplex(streams) {\n var n = streams.length;\n return {\n point: function(x, y) { var i = -1; while (++i < n) streams[i].point(x, y); },\n sphere: function() { var i = -1; while (++i < n) streams[i].sphere(); },\n lineStart: function() { var i = -1; while (++i < n) streams[i].lineStart(); },\n lineEnd: function() { var i = -1; while (++i < n) streams[i].lineEnd(); },\n polygonStart: function() { var i = -1; while (++i < n) streams[i].polygonStart(); },\n polygonEnd: function() { var i = -1; while (++i < n) streams[i].polygonEnd(); }\n };\n}\n\n// A composite projection for the United States, configured by default for\n// 960×500. The projection also works quite well at 960×600 if you change the\n// scale to 1285 and adjust the translate accordingly. The set of standard\n// parallels for each region comes from USGS, which is published here:\n// http://egsc.usgs.gov/isb/pubs/MapProjections/projections.html#albers\nexport default function() {\n var cache,\n cacheStream,\n lower48 = albers(), lower48Point,\n alaska = conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338\n hawaii = conicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), hawaiiPoint, // ESRI:102007\n point, pointStream = {point: function(x, y) { point = [x, y]; }};\n\n function albersUsa(coordinates) {\n var x = coordinates[0], y = coordinates[1];\n return point = null,\n (lower48Point.point(x, y), point)\n || (alaskaPoint.point(x, y), point)\n || (hawaiiPoint.point(x, y), point);\n }\n\n albersUsa.invert = function(coordinates) {\n var k = lower48.scale(),\n t = lower48.translate(),\n x = (coordinates[0] - t[0]) / k,\n y = (coordinates[1] - t[1]) / k;\n return (y >= 0.120 && y < 0.234 && x >= -0.425 && x < -0.214 ? alaska\n : y >= 0.166 && y < 0.234 && x >= -0.214 && x < -0.115 ? hawaii\n : lower48).invert(coordinates);\n };\n\n albersUsa.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = multiplex([lower48.stream(cacheStream = stream), alaska.stream(stream), hawaii.stream(stream)]);\n };\n\n albersUsa.precision = function(_) {\n if (!arguments.length) return lower48.precision();\n lower48.precision(_), alaska.precision(_), hawaii.precision(_);\n return reset();\n };\n\n albersUsa.scale = function(_) {\n if (!arguments.length) return lower48.scale();\n lower48.scale(_), alaska.scale(_ * 0.35), hawaii.scale(_);\n return albersUsa.translate(lower48.translate());\n };\n\n albersUsa.translate = function(_) {\n if (!arguments.length) return lower48.translate();\n var k = lower48.scale(), x = +_[0], y = +_[1];\n\n lower48Point = lower48\n .translate(_)\n .clipExtent([[x - 0.455 * k, y - 0.238 * k], [x + 0.455 * k, y + 0.238 * k]])\n .stream(pointStream);\n\n alaskaPoint = alaska\n .translate([x - 0.307 * k, y + 0.201 * k])\n .clipExtent([[x - 0.425 * k + epsilon, y + 0.120 * k + epsilon], [x - 0.214 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n hawaiiPoint = hawaii\n .translate([x - 0.205 * k, y + 0.212 * k])\n .clipExtent([[x - 0.214 * k + epsilon, y + 0.166 * k + epsilon], [x - 0.115 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n return reset();\n };\n\n albersUsa.fitExtent = function(extent, object) {\n return fitExtent(albersUsa, extent, object);\n };\n\n albersUsa.fitSize = function(size, object) {\n return fitSize(albersUsa, size, object);\n };\n\n albersUsa.fitWidth = function(width, object) {\n return fitWidth(albersUsa, width, object);\n };\n\n albersUsa.fitHeight = function(height, object) {\n return fitHeight(albersUsa, height, object);\n };\n\n function reset() {\n cache = cacheStream = null;\n return albersUsa;\n }\n\n return albersUsa.scale(1070);\n}\n","import clipRectangle from \"../clip/rectangle.js\";\nimport identity from \"../identity.js\";\nimport {transformer} from \"../transform.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\nimport {cos, degrees, radians, sin} from \"../math.js\";\n\nexport default function() {\n var k = 1, tx = 0, ty = 0, sx = 1, sy = 1, // scale, translate and reflect\n alpha = 0, ca, sa, // angle\n x0 = null, y0, x1, y1, // clip extent\n kx = 1, ky = 1,\n transform = transformer({\n point: function(x, y) {\n var p = projection([x, y])\n this.stream.point(p[0], p[1]);\n }\n }),\n postclip = identity,\n cache,\n cacheStream;\n\n function reset() {\n kx = k * sx;\n ky = k * sy;\n cache = cacheStream = null;\n return projection;\n }\n\n function projection (p) {\n var x = p[0] * kx, y = p[1] * ky;\n if (alpha) {\n var t = y * ca - x * sa;\n x = x * ca + y * sa;\n y = t;\n } \n return [x + tx, y + ty];\n }\n projection.invert = function(p) {\n var x = p[0] - tx, y = p[1] - ty;\n if (alpha) {\n var t = y * ca + x * sa;\n x = x * ca - y * sa;\n y = t;\n }\n return [x / kx, y / ky];\n };\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transform(postclip(cacheStream = stream));\n };\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\n };\n projection.clipExtent = function(_) {\n return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n projection.scale = function(_) {\n return arguments.length ? (k = +_, reset()) : k;\n };\n projection.translate = function(_) {\n return arguments.length ? (tx = +_[0], ty = +_[1], reset()) : [tx, ty];\n }\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, sa = sin(alpha), ca = cos(alpha), reset()) : alpha * degrees;\n };\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, reset()) : sx < 0;\n };\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, reset()) : sy < 0;\n };\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n return projection;\n}\n","import {range} from \"d3-array\";\nimport {abs, ceil, epsilon} from \"./math.js\";\n\nfunction graticuleX(y0, y1, dy) {\n var y = range(y0, y1 - epsilon, dy).concat(y1);\n return function(x) { return y.map(function(y) { return [x, y]; }); };\n}\n\nfunction graticuleY(x0, x1, dx) {\n var x = range(x0, x1 - epsilon, dx).concat(x1);\n return function(y) { return x.map(function(x) { return [x, y]; }); };\n}\n\nexport default function graticule() {\n var x1, x0, X1, X0,\n y1, y0, Y1, Y0,\n dx = 10, dy = dx, DX = 90, DY = 360,\n x, y, X, Y,\n precision = 2.5;\n\n function graticule() {\n return {type: \"MultiLineString\", coordinates: lines()};\n }\n\n function lines() {\n return range(ceil(X0 / DX) * DX, X1, DX).map(X)\n .concat(range(ceil(Y0 / DY) * DY, Y1, DY).map(Y))\n .concat(range(ceil(x0 / dx) * dx, x1, dx).filter(function(x) { return abs(x % DX) > epsilon; }).map(x))\n .concat(range(ceil(y0 / dy) * dy, y1, dy).filter(function(y) { return abs(y % DY) > epsilon; }).map(y));\n }\n\n graticule.lines = function() {\n return lines().map(function(coordinates) { return {type: \"LineString\", coordinates: coordinates}; });\n };\n\n graticule.outline = function() {\n return {\n type: \"Polygon\",\n coordinates: [\n X(X0).concat(\n Y(Y1).slice(1),\n X(X1).reverse().slice(1),\n Y(Y0).reverse().slice(1))\n ]\n };\n };\n\n graticule.extent = function(_) {\n if (!arguments.length) return graticule.extentMinor();\n return graticule.extentMajor(_).extentMinor(_);\n };\n\n graticule.extentMajor = function(_) {\n if (!arguments.length) return [[X0, Y0], [X1, Y1]];\n X0 = +_[0][0], X1 = +_[1][0];\n Y0 = +_[0][1], Y1 = +_[1][1];\n if (X0 > X1) _ = X0, X0 = X1, X1 = _;\n if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.extentMinor = function(_) {\n if (!arguments.length) return [[x0, y0], [x1, y1]];\n x0 = +_[0][0], x1 = +_[1][0];\n y0 = +_[0][1], y1 = +_[1][1];\n if (x0 > x1) _ = x0, x0 = x1, x1 = _;\n if (y0 > y1) _ = y0, y0 = y1, y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.step = function(_) {\n if (!arguments.length) return graticule.stepMinor();\n return graticule.stepMajor(_).stepMinor(_);\n };\n\n graticule.stepMajor = function(_) {\n if (!arguments.length) return [DX, DY];\n DX = +_[0], DY = +_[1];\n return graticule;\n };\n\n graticule.stepMinor = function(_) {\n if (!arguments.length) return [dx, dy];\n dx = +_[0], dy = +_[1];\n return graticule;\n };\n\n graticule.precision = function(_) {\n if (!arguments.length) return precision;\n precision = +_;\n x = graticuleX(y0, y1, 90);\n y = graticuleY(x0, x1, precision);\n X = graticuleX(Y0, Y1, 90);\n Y = graticuleY(X0, X1, precision);\n return graticule;\n };\n\n return graticule\n .extentMajor([[-180, -90 + epsilon], [180, 90 - epsilon]])\n .extentMinor([[-180, -80 - epsilon], [180, 80 + epsilon]]);\n}\n\nexport function graticule10() {\n return graticule()();\n}\n","import { Transform, rederive, ingest, replace } from 'vega-dataflow';\nimport { error, extent, inherits, identity, isArray, isFunction, isNumber, array, constant, one, accessorName, accessorFields, field, extend, toSet, zero } from 'vega-util';\nimport { tickStep, range, max, sum } from 'd3-array';\nimport { bandwidthNRD } from 'vega-statistics';\nimport { getProjectionPath, projectionProperties, projection } from 'vega-projection';\nimport { geoGraticule } from 'd3-geo';\nimport { rgb } from 'd3-color';\nimport { canvas } from 'vega-canvas';\n\nfunction noop() {}\nconst cases = [[], [[[1.0, 1.5], [0.5, 1.0]]], [[[1.5, 1.0], [1.0, 1.5]]], [[[1.5, 1.0], [0.5, 1.0]]], [[[1.0, 0.5], [1.5, 1.0]]], [[[1.0, 1.5], [0.5, 1.0]], [[1.0, 0.5], [1.5, 1.0]]], [[[1.0, 0.5], [1.0, 1.5]]], [[[1.0, 0.5], [0.5, 1.0]]], [[[0.5, 1.0], [1.0, 0.5]]], [[[1.0, 1.5], [1.0, 0.5]]], [[[0.5, 1.0], [1.0, 0.5]], [[1.5, 1.0], [1.0, 1.5]]], [[[1.5, 1.0], [1.0, 0.5]]], [[[0.5, 1.0], [1.5, 1.0]]], [[[1.0, 1.5], [1.5, 1.0]]], [[[0.5, 1.0], [1.0, 1.5]]], []];\n\n// Implementation adapted from d3/d3-contour. Thanks!\nfunction contours () {\n var dx = 1,\n dy = 1,\n smooth = smoothLinear;\n function contours(values, tz) {\n return tz.map(value => contour(values, value));\n }\n\n // Accumulate, smooth contour rings, assign holes to exterior rings.\n // Based on https://github.com/mbostock/shapefile/blob/v0.6.2/shp/polygon.js\n function contour(values, value) {\n var polygons = [],\n holes = [];\n isorings(values, value, ring => {\n smooth(ring, values, value);\n if (area(ring) > 0) polygons.push([ring]);else holes.push(ring);\n });\n holes.forEach(hole => {\n for (var i = 0, n = polygons.length, polygon; i < n; ++i) {\n if (contains((polygon = polygons[i])[0], hole) !== -1) {\n polygon.push(hole);\n return;\n }\n }\n });\n return {\n type: 'MultiPolygon',\n value: value,\n coordinates: polygons\n };\n }\n\n // Marching squares with isolines stitched into rings.\n // Based on https://github.com/topojson/topojson-client/blob/v3.0.0/src/stitch.js\n function isorings(values, value, callback) {\n var fragmentByStart = new Array(),\n fragmentByEnd = new Array(),\n x,\n y,\n t0,\n t1,\n t2,\n t3;\n\n // Special case for the first row (y = -1, t2 = t3 = 0).\n x = y = -1;\n t1 = values[0] >= value;\n cases[t1 << 1].forEach(stitch);\n while (++x < dx - 1) {\n t0 = t1, t1 = values[x + 1] >= value;\n cases[t0 | t1 << 1].forEach(stitch);\n }\n cases[t1 << 0].forEach(stitch);\n\n // General case for the intermediate rows.\n while (++y < dy - 1) {\n x = -1;\n t1 = values[y * dx + dx] >= value;\n t2 = values[y * dx] >= value;\n cases[t1 << 1 | t2 << 2].forEach(stitch);\n while (++x < dx - 1) {\n t0 = t1, t1 = values[y * dx + dx + x + 1] >= value;\n t3 = t2, t2 = values[y * dx + x + 1] >= value;\n cases[t0 | t1 << 1 | t2 << 2 | t3 << 3].forEach(stitch);\n }\n cases[t1 | t2 << 3].forEach(stitch);\n }\n\n // Special case for the last row (y = dy - 1, t0 = t1 = 0).\n x = -1;\n t2 = values[y * dx] >= value;\n cases[t2 << 2].forEach(stitch);\n while (++x < dx - 1) {\n t3 = t2, t2 = values[y * dx + x + 1] >= value;\n cases[t2 << 2 | t3 << 3].forEach(stitch);\n }\n cases[t2 << 3].forEach(stitch);\n function stitch(line) {\n var start = [line[0][0] + x, line[0][1] + y],\n end = [line[1][0] + x, line[1][1] + y],\n startIndex = index(start),\n endIndex = index(end),\n f,\n g;\n if (f = fragmentByEnd[startIndex]) {\n if (g = fragmentByStart[endIndex]) {\n delete fragmentByEnd[f.end];\n delete fragmentByStart[g.start];\n if (f === g) {\n f.ring.push(end);\n callback(f.ring);\n } else {\n fragmentByStart[f.start] = fragmentByEnd[g.end] = {\n start: f.start,\n end: g.end,\n ring: f.ring.concat(g.ring)\n };\n }\n } else {\n delete fragmentByEnd[f.end];\n f.ring.push(end);\n fragmentByEnd[f.end = endIndex] = f;\n }\n } else if (f = fragmentByStart[endIndex]) {\n if (g = fragmentByEnd[startIndex]) {\n delete fragmentByStart[f.start];\n delete fragmentByEnd[g.end];\n if (f === g) {\n f.ring.push(end);\n callback(f.ring);\n } else {\n fragmentByStart[g.start] = fragmentByEnd[f.end] = {\n start: g.start,\n end: f.end,\n ring: g.ring.concat(f.ring)\n };\n }\n } else {\n delete fragmentByStart[f.start];\n f.ring.unshift(start);\n fragmentByStart[f.start = startIndex] = f;\n }\n } else {\n fragmentByStart[startIndex] = fragmentByEnd[endIndex] = {\n start: startIndex,\n end: endIndex,\n ring: [start, end]\n };\n }\n }\n }\n function index(point) {\n return point[0] * 2 + point[1] * (dx + 1) * 4;\n }\n function smoothLinear(ring, values, value) {\n ring.forEach(point => {\n var x = point[0],\n y = point[1],\n xt = x | 0,\n yt = y | 0,\n v0,\n v1 = values[yt * dx + xt];\n if (x > 0 && x < dx && xt === x) {\n v0 = values[yt * dx + xt - 1];\n point[0] = x + (value - v0) / (v1 - v0) - 0.5;\n }\n if (y > 0 && y < dy && yt === y) {\n v0 = values[(yt - 1) * dx + xt];\n point[1] = y + (value - v0) / (v1 - v0) - 0.5;\n }\n });\n }\n contours.contour = contour;\n contours.size = function (_) {\n if (!arguments.length) return [dx, dy];\n var _0 = Math.floor(_[0]),\n _1 = Math.floor(_[1]);\n if (!(_0 >= 0 && _1 >= 0)) error('invalid size');\n return dx = _0, dy = _1, contours;\n };\n contours.smooth = function (_) {\n return arguments.length ? (smooth = _ ? smoothLinear : noop, contours) : smooth === smoothLinear;\n };\n return contours;\n}\nfunction area(ring) {\n var i = 0,\n n = ring.length,\n area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1];\n while (++i < n) area += ring[i - 1][1] * ring[i][0] - ring[i - 1][0] * ring[i][1];\n return area;\n}\nfunction contains(ring, hole) {\n var i = -1,\n n = hole.length,\n c;\n while (++i < n) if (c = ringContains(ring, hole[i])) return c;\n return 0;\n}\nfunction ringContains(ring, point) {\n var x = point[0],\n y = point[1],\n contains = -1;\n for (var i = 0, n = ring.length, j = n - 1; i < n; j = i++) {\n var pi = ring[i],\n xi = pi[0],\n yi = pi[1],\n pj = ring[j],\n xj = pj[0],\n yj = pj[1];\n if (segmentContains(pi, pj, point)) return 0;\n if (yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi) contains = -contains;\n }\n return contains;\n}\nfunction segmentContains(a, b, c) {\n var i;\n return collinear(a, b, c) && within(a[i = +(a[0] === b[0])], c[i], b[i]);\n}\nfunction collinear(a, b, c) {\n return (b[0] - a[0]) * (c[1] - a[1]) === (c[0] - a[0]) * (b[1] - a[1]);\n}\nfunction within(p, q, r) {\n return p <= q && q <= r || r <= q && q <= p;\n}\n\nfunction quantize (k, nice, zero) {\n return function (values) {\n var ex = extent(values),\n start = zero ? Math.min(ex[0], 0) : ex[0],\n stop = ex[1],\n span = stop - start,\n step = nice ? tickStep(start, stop, k) : span / (k + 1);\n return range(start + step, stop, step);\n };\n}\n\n/**\n * Generate isocontours (level sets) based on input raster grid data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} [params.field] - The field with raster grid\n * data. If unspecified, the tuple itself is interpreted as a raster grid.\n * @param {Array} [params.thresholds] - Contour threshold array. If\n * specified, the levels, nice, resolve, and zero parameters are ignored.\n * @param {number} [params.levels] - The desired number of contour levels.\n * @param {boolean} [params.nice] - Boolean flag indicating if the contour\n * threshold values should be automatically aligned to \"nice\"\n * human-friendly values. Setting this flag may cause the number of\n * thresholds to deviate from the specified levels.\n * @param {string} [params.resolve] - The method for resolving thresholds\n * across multiple input grids. If 'independent' (the default), threshold\n * calculation will be performed separately for each grid. If 'shared', a\n * single set of threshold values will be used for all input grids.\n * @param {boolean} [params.zero] - Boolean flag indicating if the contour\n * threshold values should include zero.\n * @param {boolean} [params.smooth] - Boolean flag indicating if the contour\n * polygons should be smoothed using linear interpolation. The default is\n * true. The parameter is ignored when using density estimation.\n * @param {boolean} [params.scale] - Optional numerical value by which to\n * scale the output isocontour coordinates. This parameter can be useful\n * to scale the contours to match a desired output resolution.\n * @param {string} [params.as='contour'] - The output field in which to store\n * the generated isocontour data (default 'contour').\n */\nfunction Isocontour(params) {\n Transform.call(this, null, params);\n}\nIsocontour.Definition = {\n 'type': 'Isocontour',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'thresholds',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'levels',\n 'type': 'number'\n }, {\n 'name': 'nice',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'resolve',\n 'type': 'enum',\n 'values': ['shared', 'independent'],\n 'default': 'independent'\n }, {\n 'name': 'zero',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'smooth',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'scale',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'translate',\n 'type': 'number',\n 'array': true,\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'default': 'contour'\n }]\n};\ninherits(Isocontour, Transform, {\n transform(_, pulse) {\n if (this.value && !pulse.changed() && !_.modified()) {\n return pulse.StopPropagation;\n }\n var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n source = pulse.materialize(pulse.SOURCE).source,\n field = _.field || identity,\n contour = contours().smooth(_.smooth !== false),\n tz = _.thresholds || levels(source, field, _),\n as = _.as === null ? null : _.as || 'contour',\n values = [];\n source.forEach(t => {\n const grid = field(t);\n\n // generate contour paths in GeoJSON format\n const paths = contour.size([grid.width, grid.height])(grid.values, isArray(tz) ? tz : tz(grid.values));\n\n // adjust contour path coordinates as needed\n transformPaths(paths, grid, t, _);\n\n // ingest; copy source data properties to output\n paths.forEach(p => {\n values.push(rederive(t, ingest(as != null ? {\n [as]: p\n } : p)));\n });\n });\n if (this.value) out.rem = this.value;\n this.value = out.source = out.add = values;\n return out;\n }\n});\nfunction levels(values, f, _) {\n const q = quantize(_.levels || 10, _.nice, _.zero !== false);\n return _.resolve !== 'shared' ? q : q(values.map(t => max(f(t).values)));\n}\nfunction transformPaths(paths, grid, datum, _) {\n let s = _.scale || grid.scale,\n t = _.translate || grid.translate;\n if (isFunction(s)) s = s(datum, _);\n if (isFunction(t)) t = t(datum, _);\n if ((s === 1 || s == null) && !t) return;\n const sx = (isNumber(s) ? s : s[0]) || 1,\n sy = (isNumber(s) ? s : s[1]) || 1,\n tx = t && t[0] || 0,\n ty = t && t[1] || 0;\n paths.forEach(transform(grid, sx, sy, tx, ty));\n}\nfunction transform(grid, sx, sy, tx, ty) {\n const x1 = grid.x1 || 0,\n y1 = grid.y1 || 0,\n flip = sx * sy < 0;\n function transformPolygon(coordinates) {\n coordinates.forEach(transformRing);\n }\n function transformRing(coordinates) {\n if (flip) coordinates.reverse(); // maintain winding order\n coordinates.forEach(transformPoint);\n }\n function transformPoint(coordinates) {\n coordinates[0] = (coordinates[0] - x1) * sx + tx;\n coordinates[1] = (coordinates[1] - y1) * sy + ty;\n }\n return function (geometry) {\n geometry.coordinates.forEach(transformPolygon);\n return geometry;\n };\n}\n\nfunction radius(bw, data, f) {\n const v = bw >= 0 ? bw : bandwidthNRD(data, f);\n return Math.round((Math.sqrt(4 * v * v + 1) - 1) / 2);\n}\nfunction number(_) {\n return isFunction(_) ? _ : constant(+_);\n}\n\n// Implementation adapted from d3/d3-contour. Thanks!\nfunction density2D () {\n var x = d => d[0],\n y = d => d[1],\n weight = one,\n bandwidth = [-1, -1],\n dx = 960,\n dy = 500,\n k = 2; // log2(cellSize)\n\n function density(data, counts) {\n const rx = radius(bandwidth[0], data, x) >> k,\n // blur x-radius\n ry = radius(bandwidth[1], data, y) >> k,\n // blur y-radius\n ox = rx ? rx + 2 : 0,\n // x-offset padding for blur\n oy = ry ? ry + 2 : 0,\n // y-offset padding for blur\n n = 2 * ox + (dx >> k),\n // grid width\n m = 2 * oy + (dy >> k),\n // grid height\n values0 = new Float32Array(n * m),\n values1 = new Float32Array(n * m);\n let values = values0;\n data.forEach(d => {\n const xi = ox + (+x(d) >> k),\n yi = oy + (+y(d) >> k);\n if (xi >= 0 && xi < n && yi >= 0 && yi < m) {\n values0[xi + yi * n] += +weight(d);\n }\n });\n if (rx > 0 && ry > 0) {\n blurX(n, m, values0, values1, rx);\n blurY(n, m, values1, values0, ry);\n blurX(n, m, values0, values1, rx);\n blurY(n, m, values1, values0, ry);\n blurX(n, m, values0, values1, rx);\n blurY(n, m, values1, values0, ry);\n } else if (rx > 0) {\n blurX(n, m, values0, values1, rx);\n blurX(n, m, values1, values0, rx);\n blurX(n, m, values0, values1, rx);\n values = values1;\n } else if (ry > 0) {\n blurY(n, m, values0, values1, ry);\n blurY(n, m, values1, values0, ry);\n blurY(n, m, values0, values1, ry);\n values = values1;\n }\n\n // scale density estimates\n // density in points per square pixel or probability density\n const s = counts ? Math.pow(2, -2 * k) : 1 / sum(values);\n for (let i = 0, sz = n * m; i < sz; ++i) values[i] *= s;\n return {\n values: values,\n scale: 1 << k,\n width: n,\n height: m,\n x1: ox,\n y1: oy,\n x2: ox + (dx >> k),\n y2: oy + (dy >> k)\n };\n }\n density.x = function (_) {\n return arguments.length ? (x = number(_), density) : x;\n };\n density.y = function (_) {\n return arguments.length ? (y = number(_), density) : y;\n };\n density.weight = function (_) {\n return arguments.length ? (weight = number(_), density) : weight;\n };\n density.size = function (_) {\n if (!arguments.length) return [dx, dy];\n var _0 = +_[0],\n _1 = +_[1];\n if (!(_0 >= 0 && _1 >= 0)) error('invalid size');\n return dx = _0, dy = _1, density;\n };\n density.cellSize = function (_) {\n if (!arguments.length) return 1 << k;\n if (!((_ = +_) >= 1)) error('invalid cell size');\n k = Math.floor(Math.log(_) / Math.LN2);\n return density;\n };\n density.bandwidth = function (_) {\n if (!arguments.length) return bandwidth;\n _ = array(_);\n if (_.length === 1) _ = [+_[0], +_[0]];\n if (_.length !== 2) error('invalid bandwidth');\n return bandwidth = _, density;\n };\n return density;\n}\nfunction blurX(n, m, source, target, r) {\n const w = (r << 1) + 1;\n for (let j = 0; j < m; ++j) {\n for (let i = 0, sr = 0; i < n + r; ++i) {\n if (i < n) {\n sr += source[i + j * n];\n }\n if (i >= r) {\n if (i >= w) {\n sr -= source[i - w + j * n];\n }\n target[i - r + j * n] = sr / Math.min(i + 1, n - 1 + w - i, w);\n }\n }\n }\n}\nfunction blurY(n, m, source, target, r) {\n const w = (r << 1) + 1;\n for (let i = 0; i < n; ++i) {\n for (let j = 0, sr = 0; j < m + r; ++j) {\n if (j < m) {\n sr += source[i + j * n];\n }\n if (j >= r) {\n if (j >= w) {\n sr -= source[i + (j - w) * n];\n }\n target[i + (j - r) * n] = sr / Math.min(j + 1, m - 1 + w - j, w);\n }\n }\n }\n}\n\n/**\n * Perform 2D kernel-density estimation of point data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.size - The [width, height] extent (in\n * units of input pixels) over which to perform density estimation.\n * @param {function(object): number} params.x - The x-coordinate accessor.\n * @param {function(object): number} params.y - The y-coordinate accessor.\n * @param {function(object): number} [params.weight] - The weight accessor.\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby.\n * @param {number} [params.cellSize] - Contour density calculation cell size.\n * This parameter determines the level of spatial approximation. For example,\n * the default value of 4 maps to 2x reductions in both x- and y- dimensions.\n * A value of 1 will result in an output raster grid whose dimensions exactly\n * matches the size parameter.\n * @param {Array} [params.bandwidth] - The KDE kernel bandwidths,\n * in pixels. The input can be a two-element array specifying separate\n * x and y bandwidths, or a single-element array specifying both. If the\n * bandwidth is unspecified or less than zero, the bandwidth will be\n * automatically determined.\n * @param {boolean} [params.counts=false] - A boolean flag indicating if the\n * output values should be probability estimates (false, default) or\n * smoothed counts (true).\n * @param {string} [params.as='grid'] - The output field in which to store\n * the generated raster grid (default 'grid').\n */\nfunction KDE2D(params) {\n Transform.call(this, null, params);\n}\nKDE2D.Definition = {\n 'type': 'KDE2D',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'required': true\n }, {\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'weight',\n 'type': 'field'\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'cellSize',\n 'type': 'number'\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'counts',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'grid'\n }]\n};\nconst PARAMS = ['x', 'y', 'weight', 'size', 'cellSize', 'bandwidth'];\nfunction params(obj, _) {\n PARAMS.forEach(param => _[param] != null ? obj[param](_[param]) : 0);\n return obj;\n}\ninherits(KDE2D, Transform, {\n transform(_, pulse) {\n if (this.value && !pulse.changed() && !_.modified()) return pulse.StopPropagation;\n var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n source = pulse.materialize(pulse.SOURCE).source,\n groups = partition(source, _.groupby),\n names = (_.groupby || []).map(accessorName),\n kde = params(density2D(), _),\n as = _.as || 'grid',\n values = [];\n function set(t, vals) {\n for (let i = 0; i < names.length; ++i) t[names[i]] = vals[i];\n return t;\n }\n\n // generate density raster grids\n values = groups.map(g => ingest(set({\n [as]: kde(g, _.counts)\n }, g.dims)));\n if (this.value) out.rem = this.value;\n this.value = out.source = out.add = values;\n return out;\n }\n});\nfunction partition(data, groupby) {\n var groups = [],\n get = f => f(t),\n map,\n i,\n n,\n t,\n k,\n g;\n\n // partition data points into groups\n if (groupby == null) {\n groups.push(data);\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n if (!g) {\n map[k] = g = [];\n g.dims = k;\n groups.push(g);\n }\n g.push(t);\n }\n }\n return groups;\n}\n\n/**\n * Generate contours based on kernel-density estimation of point data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.size - The dimensions [width, height] over which to compute contours.\n * If the values parameter is provided, this must be the dimensions of the input data.\n * If density estimation is performed, this is the output view dimensions in pixels.\n * @param {Array} [params.values] - An array of numeric values representing an\n * width x height grid of values over which to compute contours. If unspecified, this\n * transform will instead attempt to compute contours for the kernel density estimate\n * using values drawn from data tuples in the input pulse.\n * @param {function(object): number} [params.x] - The pixel x-coordinate accessor for density estimation.\n * @param {function(object): number} [params.y] - The pixel y-coordinate accessor for density estimation.\n * @param {function(object): number} [params.weight] - The data point weight accessor for density estimation.\n * @param {number} [params.cellSize] - Contour density calculation cell size.\n * @param {number} [params.bandwidth] - Kernel density estimation bandwidth.\n * @param {Array} [params.thresholds] - Contour threshold array. If\n * this parameter is set, the count and nice parameters will be ignored.\n * @param {number} [params.count] - The desired number of contours.\n * @param {boolean} [params.nice] - Boolean flag indicating if the contour\n * threshold values should be automatically aligned to \"nice\"\n * human-friendly values. Setting this flag may cause the number of\n * thresholds to deviate from the specified count.\n * @param {boolean} [params.smooth] - Boolean flag indicating if the contour\n * polygons should be smoothed using linear interpolation. The default is\n * true. The parameter is ignored when using density estimation.\n */\nfunction Contour(params) {\n Transform.call(this, null, params);\n}\nContour.Definition = {\n 'type': 'Contour',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'required': true\n }, {\n 'name': 'values',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'x',\n 'type': 'field'\n }, {\n 'name': 'y',\n 'type': 'field'\n }, {\n 'name': 'weight',\n 'type': 'field'\n }, {\n 'name': 'cellSize',\n 'type': 'number'\n }, {\n 'name': 'bandwidth',\n 'type': 'number'\n }, {\n 'name': 'count',\n 'type': 'number'\n }, {\n 'name': 'nice',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'thresholds',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'smooth',\n 'type': 'boolean',\n 'default': true\n }]\n};\ninherits(Contour, Transform, {\n transform(_, pulse) {\n if (this.value && !pulse.changed() && !_.modified()) {\n return pulse.StopPropagation;\n }\n var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n contour = contours().smooth(_.smooth !== false),\n values = _.values,\n thresh = _.thresholds || quantize(_.count || 10, _.nice, !!values),\n size = _.size,\n grid,\n post;\n if (!values) {\n values = pulse.materialize(pulse.SOURCE).source;\n grid = params(density2D(), _)(values, true);\n post = transform(grid, grid.scale || 1, grid.scale || 1, 0, 0);\n size = [grid.width, grid.height];\n values = grid.values;\n }\n thresh = isArray(thresh) ? thresh : thresh(values);\n values = contour.size(size)(values, thresh);\n if (post) values.forEach(post);\n if (this.value) out.rem = this.value;\n this.value = out.source = out.add = (values || []).map(ingest);\n return out;\n }\n});\n\nconst Feature = 'Feature';\nconst FeatureCollection = 'FeatureCollection';\nconst MultiPoint = 'MultiPoint';\n\n/**\n * Consolidate an array of [longitude, latitude] points or GeoJSON features\n * into a combined GeoJSON object. This transform is particularly useful for\n * combining geo data for a Projection's fit argument. The resulting GeoJSON\n * data is available as this transform's value. Input pulses are unchanged.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.fields] - A two-element array\n * of field accessors for the longitude and latitude values.\n * @param {function(object): *} params.geojson - A field accessor for\n * retrieving GeoJSON feature data.\n */\nfunction GeoJSON(params) {\n Transform.call(this, null, params);\n}\nGeoJSON.Definition = {\n 'type': 'GeoJSON',\n 'metadata': {},\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'geojson',\n 'type': 'field'\n }]\n};\ninherits(GeoJSON, Transform, {\n transform(_, pulse) {\n var features = this._features,\n points = this._points,\n fields = _.fields,\n lon = fields && fields[0],\n lat = fields && fields[1],\n geojson = _.geojson || !fields && identity,\n flag = pulse.ADD,\n mod;\n mod = _.modified() || pulse.changed(pulse.REM) || pulse.modified(accessorFields(geojson)) || lon && pulse.modified(accessorFields(lon)) || lat && pulse.modified(accessorFields(lat));\n if (!this.value || mod) {\n flag = pulse.SOURCE;\n this._features = features = [];\n this._points = points = [];\n }\n if (geojson) {\n pulse.visit(flag, t => features.push(geojson(t)));\n }\n if (lon && lat) {\n pulse.visit(flag, t => {\n var x = lon(t),\n y = lat(t);\n if (x != null && y != null && (x = +x) === x && (y = +y) === y) {\n points.push([x, y]);\n }\n });\n features = features.concat({\n type: Feature,\n geometry: {\n type: MultiPoint,\n coordinates: points\n }\n });\n }\n this.value = {\n type: FeatureCollection,\n features: features\n };\n }\n});\n\n/**\n * Map GeoJSON data to an SVG path string.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(number, number): *} params.projection - The cartographic\n * projection to apply.\n * @param {function(object): *} [params.field] - The field with GeoJSON data,\n * or null if the tuple itself is a GeoJSON feature.\n * @param {string} [params.as='path'] - The output field in which to store\n * the generated path data (default 'path').\n */\nfunction GeoPath(params) {\n Transform.call(this, null, params);\n}\nGeoPath.Definition = {\n 'type': 'GeoPath',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'projection',\n 'type': 'projection'\n }, {\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'pointRadius',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'path'\n }]\n};\ninherits(GeoPath, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ALL),\n path = this.value,\n field = _.field || identity,\n as = _.as || 'path',\n flag = out.SOURCE;\n if (!path || _.modified()) {\n // parameters updated, reset and reflow\n this.value = path = getProjectionPath(_.projection);\n out.materialize().reflow();\n } else {\n flag = field === identity || pulse.modified(field.fields) ? out.ADD_MOD : out.ADD;\n }\n const prev = initPath(path, _.pointRadius);\n out.visit(flag, t => t[as] = path(field(t)));\n path.pointRadius(prev);\n return out.modifies(as);\n }\n});\nfunction initPath(path, pointRadius) {\n const prev = path.pointRadius();\n path.context(null);\n if (pointRadius != null) {\n path.pointRadius(pointRadius);\n }\n return prev;\n}\n\n/**\n * Geo-code a longitude/latitude point to an x/y coordinate.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(number, number): *} params.projection - The cartographic\n * projection to apply.\n * @param {Array} params.fields - A two-element array of\n * field accessors for the longitude and latitude values.\n * @param {Array} [params.as] - A two-element array of field names\n * under which to store the result. Defaults to ['x','y'].\n */\nfunction GeoPoint(params) {\n Transform.call(this, null, params);\n}\nGeoPoint.Definition = {\n 'type': 'GeoPoint',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'projection',\n 'type': 'projection',\n 'required': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['x', 'y']\n }]\n};\ninherits(GeoPoint, Transform, {\n transform(_, pulse) {\n var proj = _.projection,\n lon = _.fields[0],\n lat = _.fields[1],\n as = _.as || ['x', 'y'],\n x = as[0],\n y = as[1],\n mod;\n function set(t) {\n const xy = proj([lon(t), lat(t)]);\n if (xy) {\n t[x] = xy[0];\n t[y] = xy[1];\n } else {\n t[x] = undefined;\n t[y] = undefined;\n }\n }\n if (_.modified()) {\n // parameters updated, reflow\n pulse = pulse.materialize().reflow(true).visit(pulse.SOURCE, set);\n } else {\n mod = pulse.modified(lon.fields) || pulse.modified(lat.fields);\n pulse.visit(mod ? pulse.ADD_MOD : pulse.ADD, set);\n }\n return pulse.modifies(as);\n }\n});\n\n/**\n * Annotate items with a geopath shape generator.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(number, number): *} params.projection - The cartographic\n * projection to apply.\n * @param {function(object): *} [params.field] - The field with GeoJSON data,\n * or null if the tuple itself is a GeoJSON feature.\n * @param {string} [params.as='shape'] - The output field in which to store\n * the generated path data (default 'shape').\n */\nfunction GeoShape(params) {\n Transform.call(this, null, params);\n}\nGeoShape.Definition = {\n 'type': 'GeoShape',\n 'metadata': {\n 'modifies': true,\n 'nomod': true\n },\n 'params': [{\n 'name': 'projection',\n 'type': 'projection'\n }, {\n 'name': 'field',\n 'type': 'field',\n 'default': 'datum'\n }, {\n 'name': 'pointRadius',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'shape'\n }]\n};\ninherits(GeoShape, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ALL),\n shape = this.value,\n as = _.as || 'shape',\n flag = out.ADD;\n if (!shape || _.modified()) {\n // parameters updated, reset and reflow\n this.value = shape = shapeGenerator(getProjectionPath(_.projection), _.field || field('datum'), _.pointRadius);\n out.materialize().reflow();\n flag = out.SOURCE;\n }\n out.visit(flag, t => t[as] = shape);\n return out.modifies(as);\n }\n});\nfunction shapeGenerator(path, field, pointRadius) {\n const shape = pointRadius == null ? _ => path(field(_)) : _ => {\n var prev = path.pointRadius(),\n value = path.pointRadius(pointRadius)(field(_));\n path.pointRadius(prev);\n return value;\n };\n shape.context = _ => {\n path.context(_);\n return shape;\n };\n return shape;\n}\n\n/**\n * GeoJSON feature generator for creating graticules.\n * @constructor\n */\nfunction Graticule(params) {\n Transform.call(this, [], params);\n this.generator = geoGraticule();\n}\nGraticule.Definition = {\n 'type': 'Graticule',\n 'metadata': {\n 'changes': true,\n 'generates': true\n },\n 'params': [{\n 'name': 'extent',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'extentMajor',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'extentMinor',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'step',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'stepMajor',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'default': [90, 360]\n }, {\n 'name': 'stepMinor',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'default': [10, 10]\n }, {\n 'name': 'precision',\n 'type': 'number',\n 'default': 2.5\n }]\n};\ninherits(Graticule, Transform, {\n transform(_, pulse) {\n var src = this.value,\n gen = this.generator,\n t;\n if (!src.length || _.modified()) {\n for (const prop in _) {\n if (isFunction(gen[prop])) {\n gen[prop](_[prop]);\n }\n }\n }\n t = gen();\n if (src.length) {\n pulse.mod.push(replace(src[0], t));\n } else {\n pulse.add.push(ingest(t));\n }\n src[0] = t;\n return pulse;\n }\n});\n\n/**\n * Render a heatmap image for input raster grid data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} [params.field] - The field with raster grid\n * data. If unspecified, the tuple itself is interpreted as a raster grid.\n * @param {string} [params.color] - A constant color value or function for\n * individual pixel color. If a function, it will be invoked with an input\n * object that includes $x, $y, $value, and $max fields for the grid.\n * @param {number} [params.opacity] - A constant opacity value or function for\n * individual pixel opacity. If a function, it will be invoked with an input\n * object that includes $x, $y, $value, and $max fields for the grid.\n * @param {string} [params.resolve] - The method for resolving maximum values\n * across multiple input grids. If 'independent' (the default), maximum\n * calculation will be performed separately for each grid. If 'shared',\n * a single global maximum will be used for all input grids.\n * @param {string} [params.as='image'] - The output field in which to store\n * the generated bitmap canvas images (default 'image').\n */\nfunction Heatmap(params) {\n Transform.call(this, null, params);\n}\nHeatmap.Definition = {\n 'type': 'heatmap',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'color',\n 'type': 'string',\n 'expr': true\n }, {\n 'name': 'opacity',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'resolve',\n 'type': 'enum',\n 'values': ['shared', 'independent'],\n 'default': 'independent'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'image'\n }]\n};\ninherits(Heatmap, Transform, {\n transform(_, pulse) {\n if (!pulse.changed() && !_.modified()) {\n return pulse.StopPropagation;\n }\n var source = pulse.materialize(pulse.SOURCE).source,\n shared = _.resolve === 'shared',\n field = _.field || identity,\n opacity = opacity_(_.opacity, _),\n color = color_(_.color, _),\n as = _.as || 'image',\n obj = {\n $x: 0,\n $y: 0,\n $value: 0,\n $max: shared ? max(source.map(t => max(field(t).values))) : 0\n };\n source.forEach(t => {\n const v = field(t);\n\n // build proxy data object\n const o = extend({}, t, obj);\n // set maximum value if not globally shared\n if (!shared) o.$max = max(v.values || []);\n\n // generate canvas image\n // optimize color/opacity if not pixel-dependent\n t[as] = toCanvas(v, o, color.dep ? color : constant(color(o)), opacity.dep ? opacity : constant(opacity(o)));\n });\n return pulse.reflow(true).modifies(as);\n }\n});\n\n// get image color function\nfunction color_(color, _) {\n let f;\n if (isFunction(color)) {\n f = obj => rgb(color(obj, _));\n f.dep = dependency(color);\n } else {\n // default to mid-grey\n f = constant(rgb(color || '#888'));\n }\n return f;\n}\n\n// get image opacity function\nfunction opacity_(opacity, _) {\n let f;\n if (isFunction(opacity)) {\n f = obj => opacity(obj, _);\n f.dep = dependency(opacity);\n } else if (opacity) {\n f = constant(opacity);\n } else {\n // default to [0, max] opacity gradient\n f = obj => obj.$value / obj.$max || 0;\n f.dep = true;\n }\n return f;\n}\n\n// check if function depends on individual pixel data\nfunction dependency(f) {\n if (!isFunction(f)) return false;\n const set = toSet(accessorFields(f));\n return set.$x || set.$y || set.$value || set.$max;\n}\n\n// render raster grid to canvas\nfunction toCanvas(grid, obj, color, opacity) {\n const n = grid.width,\n m = grid.height,\n x1 = grid.x1 || 0,\n y1 = grid.y1 || 0,\n x2 = grid.x2 || n,\n y2 = grid.y2 || m,\n val = grid.values,\n value = val ? i => val[i] : zero,\n can = canvas(x2 - x1, y2 - y1),\n ctx = can.getContext('2d'),\n img = ctx.getImageData(0, 0, x2 - x1, y2 - y1),\n pix = img.data;\n for (let j = y1, k = 0; j < y2; ++j) {\n obj.$y = j - y1;\n for (let i = x1, r = j * n; i < x2; ++i, k += 4) {\n obj.$x = i - x1;\n obj.$value = value(i + r);\n const v = color(obj);\n pix[k + 0] = v.r;\n pix[k + 1] = v.g;\n pix[k + 2] = v.b;\n pix[k + 3] = ~~(255 * opacity(obj));\n }\n }\n ctx.putImageData(img, 0, 0);\n return can;\n}\n\n/**\n * Maintains a cartographic projection.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction Projection(params) {\n Transform.call(this, null, params);\n this.modified(true); // always treat as modified\n}\n\ninherits(Projection, Transform, {\n transform(_, pulse) {\n let proj = this.value;\n if (!proj || _.modified('type')) {\n this.value = proj = create(_.type);\n projectionProperties.forEach(prop => {\n if (_[prop] != null) set(proj, prop, _[prop]);\n });\n } else {\n projectionProperties.forEach(prop => {\n if (_.modified(prop)) set(proj, prop, _[prop]);\n });\n }\n if (_.pointRadius != null) proj.path.pointRadius(_.pointRadius);\n if (_.fit) fit(proj, _);\n return pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n }\n});\nfunction fit(proj, _) {\n const data = collectGeoJSON(_.fit);\n _.extent ? proj.fitExtent(_.extent, data) : _.size ? proj.fitSize(_.size, data) : 0;\n}\nfunction create(type) {\n const constructor = projection((type || 'mercator').toLowerCase());\n if (!constructor) error('Unrecognized projection type: ' + type);\n return constructor();\n}\nfunction set(proj, key, value) {\n if (isFunction(proj[key])) proj[key](value);\n}\nfunction collectGeoJSON(data) {\n data = array(data);\n return data.length === 1 ? data[0] : {\n type: FeatureCollection,\n features: data.reduce((a, f) => a.concat(featurize(f)), [])\n };\n}\nfunction featurize(f) {\n return f.type === FeatureCollection ? f.features : array(f).filter(d => d != null).map(d => d.type === Feature ? d : {\n type: Feature,\n geometry: d\n });\n}\n\nexport { Contour as contour, GeoJSON as geojson, GeoPath as geopath, GeoPoint as geopoint, GeoShape as geoshape, Graticule as graticule, Heatmap as heatmap, Isocontour as isocontour, KDE2D as kde2d, Projection as projection };\n","export default function(d) {\n const x = +this._x.call(null, d),\n y = +this._y.call(null, d);\n return add(this.cover(x, y), x, y, d);\n}\n\nfunction add(tree, x, y, d) {\n if (isNaN(x) || isNaN(y)) return tree; // ignore invalid points\n\n var parent,\n node = tree._root,\n leaf = {data: d},\n x0 = tree._x0,\n y0 = tree._y0,\n x1 = tree._x1,\n y1 = tree._y1,\n xm,\n ym,\n xp,\n yp,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return tree._root = leaf, tree;\n\n // Find the existing leaf for the new point, or add it.\n while (node.length) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree;\n }\n\n // Is the new point is exactly coincident with the existing point?\n xp = +tree._x.call(null, node.data);\n yp = +tree._y.call(null, node.data);\n if (x === xp && y === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;\n\n // Otherwise, split the leaf node until the old and new point are separated.\n do {\n parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4);\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n } while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | (xp >= xm)));\n return parent[j] = node, parent[i] = leaf, tree;\n}\n\nexport function addAll(data) {\n var d, i, n = data.length,\n x,\n y,\n xz = new Array(n),\n yz = new Array(n),\n x0 = Infinity,\n y0 = Infinity,\n x1 = -Infinity,\n y1 = -Infinity;\n\n // Compute the points and their extent.\n for (i = 0; i < n; ++i) {\n if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d))) continue;\n xz[i] = x;\n yz[i] = y;\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n }\n\n // If there were no (valid) points, abort.\n if (x0 > x1 || y0 > y1) return this;\n\n // Expand the tree to cover the new points.\n this.cover(x0, y0).cover(x1, y1);\n\n // Add the new points.\n for (i = 0; i < n; ++i) {\n add(this, xz[i], yz[i], data[i]);\n }\n\n return this;\n}\n","export default function(node, x0, y0, x1, y1) {\n this.node = node;\n this.x0 = x0;\n this.y0 = y0;\n this.x1 = x1;\n this.y1 = y1;\n}\n","export function defaultX(d) {\n return d[0];\n}\n\nexport default function(_) {\n return arguments.length ? (this._x = _, this) : this._x;\n}\n","export function defaultY(d) {\n return d[1];\n}\n\nexport default function(_) {\n return arguments.length ? (this._y = _, this) : this._y;\n}\n","import tree_add, {addAll as tree_addAll} from \"./add.js\";\nimport tree_cover from \"./cover.js\";\nimport tree_data from \"./data.js\";\nimport tree_extent from \"./extent.js\";\nimport tree_find from \"./find.js\";\nimport tree_remove, {removeAll as tree_removeAll} from \"./remove.js\";\nimport tree_root from \"./root.js\";\nimport tree_size from \"./size.js\";\nimport tree_visit from \"./visit.js\";\nimport tree_visitAfter from \"./visitAfter.js\";\nimport tree_x, {defaultX} from \"./x.js\";\nimport tree_y, {defaultY} from \"./y.js\";\n\nexport default function quadtree(nodes, x, y) {\n var tree = new Quadtree(x == null ? defaultX : x, y == null ? defaultY : y, NaN, NaN, NaN, NaN);\n return nodes == null ? tree : tree.addAll(nodes);\n}\n\nfunction Quadtree(x, y, x0, y0, x1, y1) {\n this._x = x;\n this._y = y;\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n this._root = undefined;\n}\n\nfunction leaf_copy(leaf) {\n var copy = {data: leaf.data}, next = copy;\n while (leaf = leaf.next) next = next.next = {data: leaf.data};\n return copy;\n}\n\nvar treeProto = quadtree.prototype = Quadtree.prototype;\n\ntreeProto.copy = function() {\n var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1),\n node = this._root,\n nodes,\n child;\n\n if (!node) return copy;\n\n if (!node.length) return copy._root = leaf_copy(node), copy;\n\n nodes = [{source: node, target: copy._root = new Array(4)}];\n while (node = nodes.pop()) {\n for (var i = 0; i < 4; ++i) {\n if (child = node.source[i]) {\n if (child.length) nodes.push({source: child, target: node.target[i] = new Array(4)});\n else node.target[i] = leaf_copy(child);\n }\n }\n }\n\n return copy;\n};\n\ntreeProto.add = tree_add;\ntreeProto.addAll = tree_addAll;\ntreeProto.cover = tree_cover;\ntreeProto.data = tree_data;\ntreeProto.extent = tree_extent;\ntreeProto.find = tree_find;\ntreeProto.remove = tree_remove;\ntreeProto.removeAll = tree_removeAll;\ntreeProto.root = tree_root;\ntreeProto.size = tree_size;\ntreeProto.visit = tree_visit;\ntreeProto.visitAfter = tree_visitAfter;\ntreeProto.x = tree_x;\ntreeProto.y = tree_y;\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export default function(random) {\n return (random() - 0.5) * 1e-6;\n}\n","import {quadtree} from \"d3-quadtree\";\nimport constant from \"./constant.js\";\nimport jiggle from \"./jiggle.js\";\n\nfunction x(d) {\n return d.x + d.vx;\n}\n\nfunction y(d) {\n return d.y + d.vy;\n}\n\nexport default function(radius) {\n var nodes,\n radii,\n random,\n strength = 1,\n iterations = 1;\n\n if (typeof radius !== \"function\") radius = constant(radius == null ? 1 : +radius);\n\n function force() {\n var i, n = nodes.length,\n tree,\n node,\n xi,\n yi,\n ri,\n ri2;\n\n for (var k = 0; k < iterations; ++k) {\n tree = quadtree(nodes, x, y).visitAfter(prepare);\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n ri = radii[node.index], ri2 = ri * ri;\n xi = node.x + node.vx;\n yi = node.y + node.vy;\n tree.visit(apply);\n }\n }\n\n function apply(quad, x0, y0, x1, y1) {\n var data = quad.data, rj = quad.r, r = ri + rj;\n if (data) {\n if (data.index > node.index) {\n var x = xi - data.x - data.vx,\n y = yi - data.y - data.vy,\n l = x * x + y * y;\n if (l < r * r) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n l = (r - (l = Math.sqrt(l))) / l * strength;\n node.vx += (x *= l) * (r = (rj *= rj) / (ri2 + rj));\n node.vy += (y *= l) * r;\n data.vx -= x * (r = 1 - r);\n data.vy -= y * r;\n }\n }\n return;\n }\n return x0 > xi + r || x1 < xi - r || y0 > yi + r || y1 < yi - r;\n }\n }\n\n function prepare(quad) {\n if (quad.data) return quad.r = radii[quad.data.index];\n for (var i = quad.r = 0; i < 4; ++i) {\n if (quad[i] && quad[i].r > quad.r) {\n quad.r = quad[i].r;\n }\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length, node;\n radii = new Array(n);\n for (i = 0; i < n; ++i) node = nodes[i], radii[node.index] = +radius(node, i, nodes);\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.iterations = function(_) {\n return arguments.length ? (iterations = +_, force) : iterations;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = +_, force) : strength;\n };\n\n force.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : radius;\n };\n\n return force;\n}\n","export default function(x, y) {\n if (isNaN(x = +x) || isNaN(y = +y)) return this; // ignore invalid points\n\n var x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1;\n\n // If the quadtree has no extent, initialize them.\n // Integer extent are necessary so that if we later double the extent,\n // the existing quadrant boundaries don’t change due to floating point error!\n if (isNaN(x0)) {\n x1 = (x0 = Math.floor(x)) + 1;\n y1 = (y0 = Math.floor(y)) + 1;\n }\n\n // Otherwise, double repeatedly to cover.\n else {\n var z = x1 - x0 || 1,\n node = this._root,\n parent,\n i;\n\n while (x0 > x || x >= x1 || y0 > y || y >= y1) {\n i = (y < y0) << 1 | (x < x0);\n parent = new Array(4), parent[i] = node, node = parent, z *= 2;\n switch (i) {\n case 0: x1 = x0 + z, y1 = y0 + z; break;\n case 1: x0 = x1 - z, y1 = y0 + z; break;\n case 2: x1 = x0 + z, y0 = y1 - z; break;\n case 3: x0 = x1 - z, y0 = y1 - z; break;\n }\n }\n\n if (this._root && this._root.length) this._root = node;\n }\n\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n return this;\n}\n","export default function() {\n var data = [];\n this.visit(function(node) {\n if (!node.length) do data.push(node.data); while (node = node.next)\n });\n return data;\n}\n","export default function(_) {\n return arguments.length\n ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1])\n : isNaN(this._x0) ? undefined : [[this._x0, this._y0], [this._x1, this._y1]];\n}\n","import Quad from \"./quad.js\";\n\nexport default function(x, y, radius) {\n var data,\n x0 = this._x0,\n y0 = this._y0,\n x1,\n y1,\n x2,\n y2,\n x3 = this._x1,\n y3 = this._y1,\n quads = [],\n node = this._root,\n q,\n i;\n\n if (node) quads.push(new Quad(node, x0, y0, x3, y3));\n if (radius == null) radius = Infinity;\n else {\n x0 = x - radius, y0 = y - radius;\n x3 = x + radius, y3 = y + radius;\n radius *= radius;\n }\n\n while (q = quads.pop()) {\n\n // Stop searching if this quadrant can’t contain a closer node.\n if (!(node = q.node)\n || (x1 = q.x0) > x3\n || (y1 = q.y0) > y3\n || (x2 = q.x1) < x0\n || (y2 = q.y1) < y0) continue;\n\n // Bisect the current quadrant.\n if (node.length) {\n var xm = (x1 + x2) / 2,\n ym = (y1 + y2) / 2;\n\n quads.push(\n new Quad(node[3], xm, ym, x2, y2),\n new Quad(node[2], x1, ym, xm, y2),\n new Quad(node[1], xm, y1, x2, ym),\n new Quad(node[0], x1, y1, xm, ym)\n );\n\n // Visit the closest quadrant first.\n if (i = (y >= ym) << 1 | (x >= xm)) {\n q = quads[quads.length - 1];\n quads[quads.length - 1] = quads[quads.length - 1 - i];\n quads[quads.length - 1 - i] = q;\n }\n }\n\n // Visit this point. (Visiting coincident points isn’t necessary!)\n else {\n var dx = x - +this._x.call(null, node.data),\n dy = y - +this._y.call(null, node.data),\n d2 = dx * dx + dy * dy;\n if (d2 < radius) {\n var d = Math.sqrt(radius = d2);\n x0 = x - d, y0 = y - d;\n x3 = x + d, y3 = y + d;\n data = node.data;\n }\n }\n }\n\n return data;\n}\n","export default function(d) {\n if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d))) return this; // ignore invalid points\n\n var parent,\n node = this._root,\n retainer,\n previous,\n next,\n x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1,\n x,\n y,\n xm,\n ym,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return this;\n\n // Find the leaf node for the point.\n // While descending, also retain the deepest parent with a non-removed sibling.\n if (node.length) while (true) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (!(parent = node, node = node[i = bottom << 1 | right])) return this;\n if (!node.length) break;\n if (parent[(i + 1) & 3] || parent[(i + 2) & 3] || parent[(i + 3) & 3]) retainer = parent, j = i;\n }\n\n // Find the point to remove.\n while (node.data !== d) if (!(previous = node, node = node.next)) return this;\n if (next = node.next) delete node.next;\n\n // If there are multiple coincident points, remove just the point.\n if (previous) return (next ? previous.next = next : delete previous.next), this;\n\n // If this is the root point, remove it.\n if (!parent) return this._root = next, this;\n\n // Remove this leaf.\n next ? parent[i] = next : delete parent[i];\n\n // If the parent now contains exactly one leaf, collapse superfluous parents.\n if ((node = parent[0] || parent[1] || parent[2] || parent[3])\n && node === (parent[3] || parent[2] || parent[1] || parent[0])\n && !node.length) {\n if (retainer) retainer[j] = node;\n else this._root = node;\n }\n\n return this;\n}\n\nexport function removeAll(data) {\n for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);\n return this;\n}\n","export default function() {\n return this._root;\n}\n","export default function() {\n var size = 0;\n this.visit(function(node) {\n if (!node.length) do ++size; while (node = node.next)\n });\n return size;\n}\n","import Quad from \"./quad.js\";\n\nexport default function(callback) {\n var quads = [], q, node = this._root, child, x0, y0, x1, y1;\n if (node) quads.push(new Quad(node, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) {\n var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));\n if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));\n if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));\n if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));\n }\n }\n return this;\n}\n","import Quad from \"./quad.js\";\n\nexport default function(callback) {\n var quads = [], next = [], q;\n if (this._root) quads.push(new Quad(this._root, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n var node = q.node;\n if (node.length) {\n var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));\n if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));\n if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));\n if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));\n }\n next.push(q);\n }\n while (q = next.pop()) {\n callback(q.node, q.x0, q.y0, q.x1, q.y1);\n }\n return this;\n}\n","var noop = {value: () => {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n","var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n","// https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use\nconst a = 1664525;\nconst c = 1013904223;\nconst m = 4294967296; // 2^32\n\nexport default function() {\n let s = 1;\n return () => (s = (a * s + c) % m) / m;\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {timer} from \"d3-timer\";\nimport lcg from \"./lcg.js\";\n\nexport function x(d) {\n return d.x;\n}\n\nexport function y(d) {\n return d.y;\n}\n\nvar initialRadius = 10,\n initialAngle = Math.PI * (3 - Math.sqrt(5));\n\nexport default function(nodes) {\n var simulation,\n alpha = 1,\n alphaMin = 0.001,\n alphaDecay = 1 - Math.pow(alphaMin, 1 / 300),\n alphaTarget = 0,\n velocityDecay = 0.6,\n forces = new Map(),\n stepper = timer(step),\n event = dispatch(\"tick\", \"end\"),\n random = lcg();\n\n if (nodes == null) nodes = [];\n\n function step() {\n tick();\n event.call(\"tick\", simulation);\n if (alpha < alphaMin) {\n stepper.stop();\n event.call(\"end\", simulation);\n }\n }\n\n function tick(iterations) {\n var i, n = nodes.length, node;\n\n if (iterations === undefined) iterations = 1;\n\n for (var k = 0; k < iterations; ++k) {\n alpha += (alphaTarget - alpha) * alphaDecay;\n\n forces.forEach(function(force) {\n force(alpha);\n });\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n if (node.fx == null) node.x += node.vx *= velocityDecay;\n else node.x = node.fx, node.vx = 0;\n if (node.fy == null) node.y += node.vy *= velocityDecay;\n else node.y = node.fy, node.vy = 0;\n }\n }\n\n return simulation;\n }\n\n function initializeNodes() {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.index = i;\n if (node.fx != null) node.x = node.fx;\n if (node.fy != null) node.y = node.fy;\n if (isNaN(node.x) || isNaN(node.y)) {\n var radius = initialRadius * Math.sqrt(0.5 + i), angle = i * initialAngle;\n node.x = radius * Math.cos(angle);\n node.y = radius * Math.sin(angle);\n }\n if (isNaN(node.vx) || isNaN(node.vy)) {\n node.vx = node.vy = 0;\n }\n }\n }\n\n function initializeForce(force) {\n if (force.initialize) force.initialize(nodes, random);\n return force;\n }\n\n initializeNodes();\n\n return simulation = {\n tick: tick,\n\n restart: function() {\n return stepper.restart(step), simulation;\n },\n\n stop: function() {\n return stepper.stop(), simulation;\n },\n\n nodes: function(_) {\n return arguments.length ? (nodes = _, initializeNodes(), forces.forEach(initializeForce), simulation) : nodes;\n },\n\n alpha: function(_) {\n return arguments.length ? (alpha = +_, simulation) : alpha;\n },\n\n alphaMin: function(_) {\n return arguments.length ? (alphaMin = +_, simulation) : alphaMin;\n },\n\n alphaDecay: function(_) {\n return arguments.length ? (alphaDecay = +_, simulation) : +alphaDecay;\n },\n\n alphaTarget: function(_) {\n return arguments.length ? (alphaTarget = +_, simulation) : alphaTarget;\n },\n\n velocityDecay: function(_) {\n return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay;\n },\n\n randomSource: function(_) {\n return arguments.length ? (random = _, forces.forEach(initializeForce), simulation) : random;\n },\n\n force: function(name, _) {\n return arguments.length > 1 ? ((_ == null ? forces.delete(name) : forces.set(name, initializeForce(_))), simulation) : forces.get(name);\n },\n\n find: function(x, y, radius) {\n var i = 0,\n n = nodes.length,\n dx,\n dy,\n d2,\n node,\n closest;\n\n if (radius == null) radius = Infinity;\n else radius *= radius;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n dx = x - node.x;\n dy = y - node.y;\n d2 = dx * dx + dy * dy;\n if (d2 < radius) closest = node, radius = d2;\n }\n\n return closest;\n },\n\n on: function(name, _) {\n return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name);\n }\n };\n}\n","import constant from \"./constant.js\";\nimport jiggle from \"./jiggle.js\";\n\nfunction index(d) {\n return d.index;\n}\n\nfunction find(nodeById, nodeId) {\n var node = nodeById.get(nodeId);\n if (!node) throw new Error(\"node not found: \" + nodeId);\n return node;\n}\n\nexport default function(links) {\n var id = index,\n strength = defaultStrength,\n strengths,\n distance = constant(30),\n distances,\n nodes,\n count,\n bias,\n random,\n iterations = 1;\n\n if (links == null) links = [];\n\n function defaultStrength(link) {\n return 1 / Math.min(count[link.source.index], count[link.target.index]);\n }\n\n function force(alpha) {\n for (var k = 0, n = links.length; k < iterations; ++k) {\n for (var i = 0, link, source, target, x, y, l, b; i < n; ++i) {\n link = links[i], source = link.source, target = link.target;\n x = target.x + target.vx - source.x - source.vx || jiggle(random);\n y = target.y + target.vy - source.y - source.vy || jiggle(random);\n l = Math.sqrt(x * x + y * y);\n l = (l - distances[i]) / l * alpha * strengths[i];\n x *= l, y *= l;\n target.vx -= x * (b = bias[i]);\n target.vy -= y * b;\n source.vx += x * (b = 1 - b);\n source.vy += y * b;\n }\n }\n }\n\n function initialize() {\n if (!nodes) return;\n\n var i,\n n = nodes.length,\n m = links.length,\n nodeById = new Map(nodes.map((d, i) => [id(d, i, nodes), d])),\n link;\n\n for (i = 0, count = new Array(n); i < m; ++i) {\n link = links[i], link.index = i;\n if (typeof link.source !== \"object\") link.source = find(nodeById, link.source);\n if (typeof link.target !== \"object\") link.target = find(nodeById, link.target);\n count[link.source.index] = (count[link.source.index] || 0) + 1;\n count[link.target.index] = (count[link.target.index] || 0) + 1;\n }\n\n for (i = 0, bias = new Array(m); i < m; ++i) {\n link = links[i], bias[i] = count[link.source.index] / (count[link.source.index] + count[link.target.index]);\n }\n\n strengths = new Array(m), initializeStrength();\n distances = new Array(m), initializeDistance();\n }\n\n function initializeStrength() {\n if (!nodes) return;\n\n for (var i = 0, n = links.length; i < n; ++i) {\n strengths[i] = +strength(links[i], i, links);\n }\n }\n\n function initializeDistance() {\n if (!nodes) return;\n\n for (var i = 0, n = links.length; i < n; ++i) {\n distances[i] = +distance(links[i], i, links);\n }\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.links = function(_) {\n return arguments.length ? (links = _, initialize(), force) : links;\n };\n\n force.id = function(_) {\n return arguments.length ? (id = _, force) : id;\n };\n\n force.iterations = function(_) {\n return arguments.length ? (iterations = +_, force) : iterations;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initializeStrength(), force) : strength;\n };\n\n force.distance = function(_) {\n return arguments.length ? (distance = typeof _ === \"function\" ? _ : constant(+_), initializeDistance(), force) : distance;\n };\n\n return force;\n}\n","import { Transform } from 'vega-dataflow';\nimport { inherits, array, isFunction, accessorFields, hasOwnProperty, error } from 'vega-util';\nimport { forceSimulation, forceCenter, forceCollide, forceManyBody, forceLink, forceX, forceY } from 'd3-force';\n\nconst ForceMap = {\n center: forceCenter,\n collide: forceCollide,\n nbody: forceManyBody,\n link: forceLink,\n x: forceX,\n y: forceY\n};\nconst Forces = 'forces',\n ForceParams = ['alpha', 'alphaMin', 'alphaTarget', 'velocityDecay', 'forces'],\n ForceConfig = ['static', 'iterations'],\n ForceOutput = ['x', 'y', 'vx', 'vy'];\n\n/**\n * Force simulation layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.forces - The forces to apply.\n */\nfunction Force(params) {\n Transform.call(this, null, params);\n}\nForce.Definition = {\n 'type': 'Force',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'static',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'restart',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'iterations',\n 'type': 'number',\n 'default': 300\n }, {\n 'name': 'alpha',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'alphaMin',\n 'type': 'number',\n 'default': 0.001\n }, {\n 'name': 'alphaTarget',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'velocityDecay',\n 'type': 'number',\n 'default': 0.4\n }, {\n 'name': 'forces',\n 'type': 'param',\n 'array': true,\n 'params': [{\n 'key': {\n 'force': 'center'\n },\n 'params': [{\n 'name': 'x',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'y',\n 'type': 'number',\n 'default': 0\n }]\n }, {\n 'key': {\n 'force': 'collide'\n },\n 'params': [{\n 'name': 'radius',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'strength',\n 'type': 'number',\n 'default': 0.7\n }, {\n 'name': 'iterations',\n 'type': 'number',\n 'default': 1\n }]\n }, {\n 'key': {\n 'force': 'nbody'\n },\n 'params': [{\n 'name': 'strength',\n 'type': 'number',\n 'default': -30,\n 'expr': true\n }, {\n 'name': 'theta',\n 'type': 'number',\n 'default': 0.9\n }, {\n 'name': 'distanceMin',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'distanceMax',\n 'type': 'number'\n }]\n }, {\n 'key': {\n 'force': 'link'\n },\n 'params': [{\n 'name': 'links',\n 'type': 'data'\n }, {\n 'name': 'id',\n 'type': 'field'\n }, {\n 'name': 'distance',\n 'type': 'number',\n 'default': 30,\n 'expr': true\n }, {\n 'name': 'strength',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'iterations',\n 'type': 'number',\n 'default': 1\n }]\n }, {\n 'key': {\n 'force': 'x'\n },\n 'params': [{\n 'name': 'strength',\n 'type': 'number',\n 'default': 0.1\n }, {\n 'name': 'x',\n 'type': 'field'\n }]\n }, {\n 'key': {\n 'force': 'y'\n },\n 'params': [{\n 'name': 'strength',\n 'type': 'number',\n 'default': 0.1\n }, {\n 'name': 'y',\n 'type': 'field'\n }]\n }]\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'modify': false,\n 'default': ForceOutput\n }]\n};\ninherits(Force, Transform, {\n transform(_, pulse) {\n var sim = this.value,\n change = pulse.changed(pulse.ADD_REM),\n params = _.modified(ForceParams),\n iters = _.iterations || 300;\n\n // configure simulation\n if (!sim) {\n this.value = sim = simulation(pulse.source, _);\n sim.on('tick', rerun(pulse.dataflow, this));\n if (!_.static) {\n change = true;\n sim.tick(); // ensure we run on init\n }\n\n pulse.modifies('index');\n } else {\n if (change) {\n pulse.modifies('index');\n sim.nodes(pulse.source);\n }\n if (params || pulse.changed(pulse.MOD)) {\n setup(sim, _, 0, pulse);\n }\n }\n\n // run simulation\n if (params || change || _.modified(ForceConfig) || pulse.changed() && _.restart) {\n sim.alpha(Math.max(sim.alpha(), _.alpha || 1)).alphaDecay(1 - Math.pow(sim.alphaMin(), 1 / iters));\n if (_.static) {\n for (sim.stop(); --iters >= 0;) sim.tick();\n } else {\n if (sim.stopped()) sim.restart();\n if (!change) return pulse.StopPropagation; // defer to sim ticks\n }\n }\n\n return this.finish(_, pulse);\n },\n finish(_, pulse) {\n const dataflow = pulse.dataflow;\n\n // inspect dependencies, touch link source data\n for (let args = this._argops, j = 0, m = args.length, arg; j < m; ++j) {\n arg = args[j];\n if (arg.name !== Forces || arg.op._argval.force !== 'link') {\n continue;\n }\n for (var ops = arg.op._argops, i = 0, n = ops.length, op; i < n; ++i) {\n if (ops[i].name === 'links' && (op = ops[i].op.source)) {\n dataflow.pulse(op, dataflow.changeset().reflow());\n break;\n }\n }\n }\n\n // reflow all nodes\n return pulse.reflow(_.modified()).modifies(ForceOutput);\n }\n});\nfunction rerun(df, op) {\n return () => df.touch(op).run();\n}\nfunction simulation(nodes, _) {\n const sim = forceSimulation(nodes),\n stop = sim.stop,\n restart = sim.restart;\n let stopped = false;\n sim.stopped = () => stopped;\n sim.restart = () => (stopped = false, restart());\n sim.stop = () => (stopped = true, stop());\n return setup(sim, _, true).on('end', () => stopped = true);\n}\nfunction setup(sim, _, init, pulse) {\n var f = array(_.forces),\n i,\n n,\n p,\n name;\n for (i = 0, n = ForceParams.length; i < n; ++i) {\n p = ForceParams[i];\n if (p !== Forces && _.modified(p)) sim[p](_[p]);\n }\n for (i = 0, n = f.length; i < n; ++i) {\n name = Forces + i;\n p = init || _.modified(Forces, i) ? getForce(f[i]) : pulse && modified(f[i], pulse) ? sim.force(name) : null;\n if (p) sim.force(name, p);\n }\n for (n = sim.numForces || 0; i < n; ++i) {\n sim.force(Forces + i, null); // remove\n }\n\n sim.numForces = f.length;\n return sim;\n}\nfunction modified(f, pulse) {\n var k, v;\n for (k in f) {\n if (isFunction(v = f[k]) && pulse.modified(accessorFields(v))) return 1;\n }\n return 0;\n}\nfunction getForce(_) {\n var f, p;\n if (!hasOwnProperty(ForceMap, _.force)) {\n error('Unrecognized force: ' + _.force);\n }\n f = ForceMap[_.force]();\n for (p in _) {\n if (isFunction(f[p])) setForceParam(f[p], _[p], _);\n }\n return f;\n}\nfunction setForceParam(f, v, _) {\n f(isFunction(v) ? d => v(d, _) : v);\n}\n\nexport { Force as force };\n","export default function(x, y) {\n var nodes, strength = 1;\n\n if (x == null) x = 0;\n if (y == null) y = 0;\n\n function force() {\n var i,\n n = nodes.length,\n node,\n sx = 0,\n sy = 0;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i], sx += node.x, sy += node.y;\n }\n\n for (sx = (sx / n - x) * strength, sy = (sy / n - y) * strength, i = 0; i < n; ++i) {\n node = nodes[i], node.x -= sx, node.y -= sy;\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = +_, force) : x;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = +_, force) : y;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = +_, force) : strength;\n };\n\n return force;\n}\n","import {quadtree} from \"d3-quadtree\";\nimport constant from \"./constant.js\";\nimport jiggle from \"./jiggle.js\";\nimport {x, y} from \"./simulation.js\";\n\nexport default function() {\n var nodes,\n node,\n random,\n alpha,\n strength = constant(-30),\n strengths,\n distanceMin2 = 1,\n distanceMax2 = Infinity,\n theta2 = 0.81;\n\n function force(_) {\n var i, n = nodes.length, tree = quadtree(nodes, x, y).visitAfter(accumulate);\n for (alpha = _, i = 0; i < n; ++i) node = nodes[i], tree.visit(apply);\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length, node;\n strengths = new Array(n);\n for (i = 0; i < n; ++i) node = nodes[i], strengths[node.index] = +strength(node, i, nodes);\n }\n\n function accumulate(quad) {\n var strength = 0, q, c, weight = 0, x, y, i;\n\n // For internal nodes, accumulate forces from child quadrants.\n if (quad.length) {\n for (x = y = i = 0; i < 4; ++i) {\n if ((q = quad[i]) && (c = Math.abs(q.value))) {\n strength += q.value, weight += c, x += c * q.x, y += c * q.y;\n }\n }\n quad.x = x / weight;\n quad.y = y / weight;\n }\n\n // For leaf nodes, accumulate forces from coincident quadrants.\n else {\n q = quad;\n q.x = q.data.x;\n q.y = q.data.y;\n do strength += strengths[q.data.index];\n while (q = q.next);\n }\n\n quad.value = strength;\n }\n\n function apply(quad, x1, _, x2) {\n if (!quad.value) return true;\n\n var x = quad.x - node.x,\n y = quad.y - node.y,\n w = x2 - x1,\n l = x * x + y * y;\n\n // Apply the Barnes-Hut approximation if possible.\n // Limit forces for very close nodes; randomize direction if coincident.\n if (w * w / theta2 < l) {\n if (l < distanceMax2) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);\n node.vx += x * quad.value * alpha / l;\n node.vy += y * quad.value * alpha / l;\n }\n return true;\n }\n\n // Otherwise, process points directly.\n else if (quad.length || l >= distanceMax2) return;\n\n // Limit forces for very close nodes; randomize direction if coincident.\n if (quad.data !== node || quad.next) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);\n }\n\n do if (quad.data !== node) {\n w = strengths[quad.data.index] * alpha / l;\n node.vx += x * w;\n node.vy += y * w;\n } while (quad = quad.next);\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.distanceMin = function(_) {\n return arguments.length ? (distanceMin2 = _ * _, force) : Math.sqrt(distanceMin2);\n };\n\n force.distanceMax = function(_) {\n return arguments.length ? (distanceMax2 = _ * _, force) : Math.sqrt(distanceMax2);\n };\n\n force.theta = function(_) {\n return arguments.length ? (theta2 = _ * _, force) : Math.sqrt(theta2);\n };\n\n return force;\n}\n","import constant from \"./constant.js\";\n\nexport default function(x) {\n var strength = constant(0.1),\n nodes,\n strengths,\n xz;\n\n if (typeof x !== \"function\") x = constant(x == null ? 0 : +x);\n\n function force(alpha) {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.vx += (xz[i] - node.x) * strengths[i] * alpha;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n xz = new Array(n);\n for (i = 0; i < n; ++i) {\n strengths[i] = isNaN(xz[i] = +x(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : x;\n };\n\n return force;\n}\n","import constant from \"./constant.js\";\n\nexport default function(y) {\n var strength = constant(0.1),\n nodes,\n strengths,\n yz;\n\n if (typeof y !== \"function\") y = constant(y == null ? 0 : +y);\n\n function force(alpha) {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.vy += (yz[i] - node.y) * strengths[i] * alpha;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n yz = new Array(n);\n for (i = 0; i < n; ++i) {\n strengths[i] = isNaN(yz[i] = +y(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : y;\n };\n\n return force;\n}\n","function count(node) {\n var sum = 0,\n children = node.children,\n i = children && children.length;\n if (!i) sum = 1;\n else while (--i >= 0) sum += children[i].value;\n node.value = sum;\n}\n\nexport default function() {\n return this.eachAfter(count);\n}\n","import node_count from \"./count.js\";\nimport node_each from \"./each.js\";\nimport node_eachBefore from \"./eachBefore.js\";\nimport node_eachAfter from \"./eachAfter.js\";\nimport node_find from \"./find.js\";\nimport node_sum from \"./sum.js\";\nimport node_sort from \"./sort.js\";\nimport node_path from \"./path.js\";\nimport node_ancestors from \"./ancestors.js\";\nimport node_descendants from \"./descendants.js\";\nimport node_leaves from \"./leaves.js\";\nimport node_links from \"./links.js\";\nimport node_iterator from \"./iterator.js\";\n\nexport default function hierarchy(data, children) {\n if (data instanceof Map) {\n data = [undefined, data];\n if (children === undefined) children = mapChildren;\n } else if (children === undefined) {\n children = objectChildren;\n }\n\n var root = new Node(data),\n node,\n nodes = [root],\n child,\n childs,\n i,\n n;\n\n while (node = nodes.pop()) {\n if ((childs = children(node.data)) && (n = (childs = Array.from(childs)).length)) {\n node.children = childs;\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = childs[i] = new Node(childs[i]));\n child.parent = node;\n child.depth = node.depth + 1;\n }\n }\n }\n\n return root.eachBefore(computeHeight);\n}\n\nfunction node_copy() {\n return hierarchy(this).eachBefore(copyData);\n}\n\nfunction objectChildren(d) {\n return d.children;\n}\n\nfunction mapChildren(d) {\n return Array.isArray(d) ? d[1] : null;\n}\n\nfunction copyData(node) {\n if (node.data.value !== undefined) node.value = node.data.value;\n node.data = node.data.data;\n}\n\nexport function computeHeight(node) {\n var height = 0;\n do node.height = height;\n while ((node = node.parent) && (node.height < ++height));\n}\n\nexport function Node(data) {\n this.data = data;\n this.depth =\n this.height = 0;\n this.parent = null;\n}\n\nNode.prototype = hierarchy.prototype = {\n constructor: Node,\n count: node_count,\n each: node_each,\n eachAfter: node_eachAfter,\n eachBefore: node_eachBefore,\n find: node_find,\n sum: node_sum,\n sort: node_sort,\n path: node_path,\n ancestors: node_ancestors,\n descendants: node_descendants,\n leaves: node_leaves,\n links: node_links,\n copy: node_copy,\n [Symbol.iterator]: node_iterator\n};\n","export function optional(f) {\n return f == null ? null : required(f);\n}\n\nexport function required(f) {\n if (typeof f !== \"function\") throw new Error;\n return f;\n}\n","export function constantZero() {\n return 0;\n}\n\nexport default function(x) {\n return function() {\n return x;\n };\n}\n","export default function(callback, that) {\n let index = -1;\n for (const node of this) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n","export default function(callback, that) {\n var node = this, nodes = [node], next = [], children, i, n, index = -1;\n while (node = nodes.pop()) {\n next.push(node);\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n nodes.push(children[i]);\n }\n }\n }\n while (node = next.pop()) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n","export default function(callback, that) {\n var node = this, nodes = [node], children, i, index = -1;\n while (node = nodes.pop()) {\n callback.call(that, node, ++index, this);\n if (children = node.children) {\n for (i = children.length - 1; i >= 0; --i) {\n nodes.push(children[i]);\n }\n }\n }\n return this;\n}\n","export default function(callback, that) {\n let index = -1;\n for (const node of this) {\n if (callback.call(that, node, ++index, this)) {\n return node;\n }\n }\n}\n","export default function(value) {\n return this.eachAfter(function(node) {\n var sum = +value(node.data) || 0,\n children = node.children,\n i = children && children.length;\n while (--i >= 0) sum += children[i].value;\n node.value = sum;\n });\n}\n","export default function(compare) {\n return this.eachBefore(function(node) {\n if (node.children) {\n node.children.sort(compare);\n }\n });\n}\n","export default function(end) {\n var start = this,\n ancestor = leastCommonAncestor(start, end),\n nodes = [start];\n while (start !== ancestor) {\n start = start.parent;\n nodes.push(start);\n }\n var k = nodes.length;\n while (end !== ancestor) {\n nodes.splice(k, 0, end);\n end = end.parent;\n }\n return nodes;\n}\n\nfunction leastCommonAncestor(a, b) {\n if (a === b) return a;\n var aNodes = a.ancestors(),\n bNodes = b.ancestors(),\n c = null;\n a = aNodes.pop();\n b = bNodes.pop();\n while (a === b) {\n c = a;\n a = aNodes.pop();\n b = bNodes.pop();\n }\n return c;\n}\n","export default function() {\n var node = this, nodes = [node];\n while (node = node.parent) {\n nodes.push(node);\n }\n return nodes;\n}\n","export default function() {\n return Array.from(this);\n}\n","export default function() {\n var leaves = [];\n this.eachBefore(function(node) {\n if (!node.children) {\n leaves.push(node);\n }\n });\n return leaves;\n}\n","export default function() {\n var root = this, links = [];\n root.each(function(node) {\n if (node !== root) { // Don’t include the root’s parent, if any.\n links.push({source: node.parent, target: node});\n }\n });\n return links;\n}\n","export default function*() {\n var node = this, current, next = [node], children, i, n;\n do {\n current = next.reverse(), next = [];\n while (node = current.pop()) {\n yield node;\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n next.push(children[i]);\n }\n }\n }\n } while (next.length);\n}\n","// https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use\nconst a = 1664525;\nconst c = 1013904223;\nconst m = 4294967296; // 2^32\n\nexport default function() {\n let s = 1;\n return () => (s = (a * s + c) % m) / m;\n}\n","import {shuffle} from \"../array.js\";\nimport lcg from \"../lcg.js\";\n\nexport default function(circles) {\n return packEncloseRandom(circles, lcg());\n}\n\nexport function packEncloseRandom(circles, random) {\n var i = 0, n = (circles = shuffle(Array.from(circles), random)).length, B = [], p, e;\n\n while (i < n) {\n p = circles[i];\n if (e && enclosesWeak(e, p)) ++i;\n else e = encloseBasis(B = extendBasis(B, p)), i = 0;\n }\n\n return e;\n}\n\nfunction extendBasis(B, p) {\n var i, j;\n\n if (enclosesWeakAll(p, B)) return [p];\n\n // If we get here then B must have at least one element.\n for (i = 0; i < B.length; ++i) {\n if (enclosesNot(p, B[i])\n && enclosesWeakAll(encloseBasis2(B[i], p), B)) {\n return [B[i], p];\n }\n }\n\n // If we get here then B must have at least two elements.\n for (i = 0; i < B.length - 1; ++i) {\n for (j = i + 1; j < B.length; ++j) {\n if (enclosesNot(encloseBasis2(B[i], B[j]), p)\n && enclosesNot(encloseBasis2(B[i], p), B[j])\n && enclosesNot(encloseBasis2(B[j], p), B[i])\n && enclosesWeakAll(encloseBasis3(B[i], B[j], p), B)) {\n return [B[i], B[j], p];\n }\n }\n }\n\n // If we get here then something is very wrong.\n throw new Error;\n}\n\nfunction enclosesNot(a, b) {\n var dr = a.r - b.r, dx = b.x - a.x, dy = b.y - a.y;\n return dr < 0 || dr * dr < dx * dx + dy * dy;\n}\n\nfunction enclosesWeak(a, b) {\n var dr = a.r - b.r + Math.max(a.r, b.r, 1) * 1e-9, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction enclosesWeakAll(a, B) {\n for (var i = 0; i < B.length; ++i) {\n if (!enclosesWeak(a, B[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction encloseBasis(B) {\n switch (B.length) {\n case 1: return encloseBasis1(B[0]);\n case 2: return encloseBasis2(B[0], B[1]);\n case 3: return encloseBasis3(B[0], B[1], B[2]);\n }\n}\n\nfunction encloseBasis1(a) {\n return {\n x: a.x,\n y: a.y,\n r: a.r\n };\n}\n\nfunction encloseBasis2(a, b) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1,\n l = Math.sqrt(x21 * x21 + y21 * y21);\n return {\n x: (x1 + x2 + x21 / l * r21) / 2,\n y: (y1 + y2 + y21 / l * r21) / 2,\n r: (l + r1 + r2) / 2\n };\n}\n\nfunction encloseBasis3(a, b, c) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x3 = c.x, y3 = c.y, r3 = c.r,\n a2 = x1 - x2,\n a3 = x1 - x3,\n b2 = y1 - y2,\n b3 = y1 - y3,\n c2 = r2 - r1,\n c3 = r3 - r1,\n d1 = x1 * x1 + y1 * y1 - r1 * r1,\n d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2,\n d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3,\n ab = a3 * b2 - a2 * b3,\n xa = (b2 * d3 - b3 * d2) / (ab * 2) - x1,\n xb = (b3 * c2 - b2 * c3) / ab,\n ya = (a3 * d2 - a2 * d3) / (ab * 2) - y1,\n yb = (a2 * c3 - a3 * c2) / ab,\n A = xb * xb + yb * yb - 1,\n B = 2 * (r1 + xa * xb + ya * yb),\n C = xa * xa + ya * ya - r1 * r1,\n r = -(Math.abs(A) > 1e-6 ? (B + Math.sqrt(B * B - 4 * A * C)) / (2 * A) : C / B);\n return {\n x: x1 + xa + xb * r,\n y: y1 + ya + yb * r,\n r: r\n };\n}\n","import array from \"../array.js\";\nimport lcg from \"../lcg.js\";\nimport {packEncloseRandom} from \"./enclose.js\";\n\nfunction place(b, a, c) {\n var dx = b.x - a.x, x, a2,\n dy = b.y - a.y, y, b2,\n d2 = dx * dx + dy * dy;\n if (d2) {\n a2 = a.r + c.r, a2 *= a2;\n b2 = b.r + c.r, b2 *= b2;\n if (a2 > b2) {\n x = (d2 + b2 - a2) / (2 * d2);\n y = Math.sqrt(Math.max(0, b2 / d2 - x * x));\n c.x = b.x - x * dx - y * dy;\n c.y = b.y - x * dy + y * dx;\n } else {\n x = (d2 + a2 - b2) / (2 * d2);\n y = Math.sqrt(Math.max(0, a2 / d2 - x * x));\n c.x = a.x + x * dx - y * dy;\n c.y = a.y + x * dy + y * dx;\n }\n } else {\n c.x = a.x + c.r;\n c.y = a.y;\n }\n}\n\nfunction intersects(a, b) {\n var dr = a.r + b.r - 1e-6, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction score(node) {\n var a = node._,\n b = node.next._,\n ab = a.r + b.r,\n dx = (a.x * b.r + b.x * a.r) / ab,\n dy = (a.y * b.r + b.y * a.r) / ab;\n return dx * dx + dy * dy;\n}\n\nfunction Node(circle) {\n this._ = circle;\n this.next = null;\n this.previous = null;\n}\n\nexport function packSiblingsRandom(circles, random) {\n if (!(n = (circles = array(circles)).length)) return 0;\n\n var a, b, c, n, aa, ca, i, j, k, sj, sk;\n\n // Place the first circle.\n a = circles[0], a.x = 0, a.y = 0;\n if (!(n > 1)) return a.r;\n\n // Place the second circle.\n b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0;\n if (!(n > 2)) return a.r + b.r;\n\n // Place the third circle.\n place(b, a, c = circles[2]);\n\n // Initialize the front-chain using the first three circles a, b and c.\n a = new Node(a), b = new Node(b), c = new Node(c);\n a.next = c.previous = b;\n b.next = a.previous = c;\n c.next = b.previous = a;\n\n // Attempt to place each remaining circle…\n pack: for (i = 3; i < n; ++i) {\n place(a._, b._, c = circles[i]), c = new Node(c);\n\n // Find the closest intersecting circle on the front-chain, if any.\n // “Closeness” is determined by linear distance along the front-chain.\n // “Ahead” or “behind” is likewise determined by linear distance.\n j = b.next, k = a.previous, sj = b._.r, sk = a._.r;\n do {\n if (sj <= sk) {\n if (intersects(j._, c._)) {\n b = j, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sj += j._.r, j = j.next;\n } else {\n if (intersects(k._, c._)) {\n a = k, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sk += k._.r, k = k.previous;\n }\n } while (j !== k.next);\n\n // Success! Insert the new circle c between a and b.\n c.previous = a, c.next = b, a.next = b.previous = b = c;\n\n // Compute the new closest circle pair to the centroid.\n aa = score(a);\n while ((c = c.next) !== b) {\n if ((ca = score(c)) < aa) {\n a = c, aa = ca;\n }\n }\n b = a.next;\n }\n\n // Compute the enclosing circle of the front chain.\n a = [b._], c = b; while ((c = c.next) !== b) a.push(c._); c = packEncloseRandom(a, random);\n\n // Translate the circles to put the enclosing circle around the origin.\n for (i = 0; i < n; ++i) a = circles[i], a.x -= c.x, a.y -= c.y;\n\n return c.r;\n}\n\nexport default function(circles) {\n packSiblingsRandom(circles, lcg());\n return circles;\n}\n","export default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n\nexport function shuffle(array, random) {\n let m = array.length,\n t,\n i;\n\n while (m) {\n i = random() * m-- | 0;\n t = array[m];\n array[m] = array[i];\n array[i] = t;\n }\n\n return array;\n}\n","import {optional} from \"../accessors.js\";\nimport constant, {constantZero} from \"../constant.js\";\nimport lcg from \"../lcg.js\";\nimport {packSiblingsRandom} from \"./siblings.js\";\n\nfunction defaultRadius(d) {\n return Math.sqrt(d.value);\n}\n\nexport default function() {\n var radius = null,\n dx = 1,\n dy = 1,\n padding = constantZero;\n\n function pack(root) {\n const random = lcg();\n root.x = dx / 2, root.y = dy / 2;\n if (radius) {\n root.eachBefore(radiusLeaf(radius))\n .eachAfter(packChildrenRandom(padding, 0.5, random))\n .eachBefore(translateChild(1));\n } else {\n root.eachBefore(radiusLeaf(defaultRadius))\n .eachAfter(packChildrenRandom(constantZero, 1, random))\n .eachAfter(packChildrenRandom(padding, root.r / Math.min(dx, dy), random))\n .eachBefore(translateChild(Math.min(dx, dy) / (2 * root.r)));\n }\n return root;\n }\n\n pack.radius = function(x) {\n return arguments.length ? (radius = optional(x), pack) : radius;\n };\n\n pack.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], pack) : [dx, dy];\n };\n\n pack.padding = function(x) {\n return arguments.length ? (padding = typeof x === \"function\" ? x : constant(+x), pack) : padding;\n };\n\n return pack;\n}\n\nfunction radiusLeaf(radius) {\n return function(node) {\n if (!node.children) {\n node.r = Math.max(0, +radius(node) || 0);\n }\n };\n}\n\nfunction packChildrenRandom(padding, k, random) {\n return function(node) {\n if (children = node.children) {\n var children,\n i,\n n = children.length,\n r = padding(node) * k || 0,\n e;\n\n if (r) for (i = 0; i < n; ++i) children[i].r += r;\n e = packSiblingsRandom(children, random);\n if (r) for (i = 0; i < n; ++i) children[i].r -= r;\n node.r = e + r;\n }\n };\n}\n\nfunction translateChild(k) {\n return function(node) {\n var parent = node.parent;\n node.r *= k;\n if (parent) {\n node.x = parent.x + k * node.x;\n node.y = parent.y + k * node.y;\n }\n };\n}\n","export default function(node) {\n node.x0 = Math.round(node.x0);\n node.y0 = Math.round(node.y0);\n node.x1 = Math.round(node.x1);\n node.y1 = Math.round(node.y1);\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (x1 - x0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.y0 = y0, node.y1 = y1;\n node.x0 = x0, node.x1 = x0 += node.value * k;\n }\n}\n","import {optional} from \"./accessors.js\";\nimport {Node, computeHeight} from \"./hierarchy/index.js\";\n\nvar preroot = {depth: -1},\n ambiguous = {},\n imputed = {};\n\nfunction defaultId(d) {\n return d.id;\n}\n\nfunction defaultParentId(d) {\n return d.parentId;\n}\n\nexport default function() {\n var id = defaultId,\n parentId = defaultParentId,\n path;\n\n function stratify(data) {\n var nodes = Array.from(data),\n currentId = id,\n currentParentId = parentId,\n n,\n d,\n i,\n root,\n parent,\n node,\n nodeId,\n nodeKey,\n nodeByKey = new Map;\n\n if (path != null) {\n const I = nodes.map((d, i) => normalize(path(d, i, data)));\n const P = I.map(parentof);\n const S = new Set(I).add(\"\");\n for (const i of P) {\n if (!S.has(i)) {\n S.add(i);\n I.push(i);\n P.push(parentof(i));\n nodes.push(imputed);\n }\n }\n currentId = (_, i) => I[i];\n currentParentId = (_, i) => P[i];\n }\n\n for (i = 0, n = nodes.length; i < n; ++i) {\n d = nodes[i], node = nodes[i] = new Node(d);\n if ((nodeId = currentId(d, i, data)) != null && (nodeId += \"\")) {\n nodeKey = node.id = nodeId;\n nodeByKey.set(nodeKey, nodeByKey.has(nodeKey) ? ambiguous : node);\n }\n if ((nodeId = currentParentId(d, i, data)) != null && (nodeId += \"\")) {\n node.parent = nodeId;\n }\n }\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n if (nodeId = node.parent) {\n parent = nodeByKey.get(nodeId);\n if (!parent) throw new Error(\"missing: \" + nodeId);\n if (parent === ambiguous) throw new Error(\"ambiguous: \" + nodeId);\n if (parent.children) parent.children.push(node);\n else parent.children = [node];\n node.parent = parent;\n } else {\n if (root) throw new Error(\"multiple roots\");\n root = node;\n }\n }\n\n if (!root) throw new Error(\"no root\");\n\n // When imputing internal nodes, only introduce roots if needed.\n // Then replace the imputed marker data with null.\n if (path != null) {\n while (root.data === imputed && root.children.length === 1) {\n root = root.children[0], --n;\n }\n for (let i = nodes.length - 1; i >= 0; --i) {\n node = nodes[i];\n if (node.data !== imputed) break;\n node.data = null;\n }\n }\n\n root.parent = preroot;\n root.eachBefore(function(node) { node.depth = node.parent.depth + 1; --n; }).eachBefore(computeHeight);\n root.parent = null;\n if (n > 0) throw new Error(\"cycle\");\n\n return root;\n }\n\n stratify.id = function(x) {\n return arguments.length ? (id = optional(x), stratify) : id;\n };\n\n stratify.parentId = function(x) {\n return arguments.length ? (parentId = optional(x), stratify) : parentId;\n };\n\n stratify.path = function(x) {\n return arguments.length ? (path = optional(x), stratify) : path;\n };\n\n return stratify;\n}\n\n// To normalize a path, we coerce to a string, strip the trailing slash if any\n// (as long as the trailing slash is not immediately preceded by another slash),\n// and add leading slash if missing.\nfunction normalize(path) {\n path = `${path}`;\n let i = path.length;\n if (slash(path, i - 1) && !slash(path, i - 2)) path = path.slice(0, -1);\n return path[0] === \"/\" ? path : `/${path}`;\n}\n\n// Walk backwards to find the first slash that is not the leading slash, e.g.:\n// \"/foo/bar\" ⇥ \"/foo\", \"/foo\" ⇥ \"/\", \"/\" ↦ \"\". (The root is special-cased\n// because the id of the root must be a truthy value.)\nfunction parentof(path) {\n let i = path.length;\n if (i < 2) return \"\";\n while (--i > 1) if (slash(path, i)) break;\n return path.slice(0, i);\n}\n\n// Slashes can be escaped; to determine whether a slash is a path delimiter, we\n// count the number of preceding backslashes escaping the forward slash: an odd\n// number indicates an escaped forward slash.\nfunction slash(path, i) {\n if (path[i] === \"/\") {\n let k = 0;\n while (i > 0 && path[--i] === \"\\\\\") ++k;\n if ((k & 1) === 0) return true;\n }\n return false;\n}\n","import {Node} from \"./hierarchy/index.js\";\n\nfunction defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\n// function radialSeparation(a, b) {\n// return (a.parent === b.parent ? 1 : 2) / a.depth;\n// }\n\n// This function is used to traverse the left contour of a subtree (or\n// subforest). It returns the successor of v on this contour. This successor is\n// either given by the leftmost child of v or by the thread of v. The function\n// returns null if and only if v is on the highest level of its subtree.\nfunction nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n}\n\n// This function works analogously to nextLeft.\nfunction nextRight(v) {\n var children = v.children;\n return children ? children[children.length - 1] : v.t;\n}\n\n// Shifts the current subtree rooted at w+. This is done by increasing\n// prelim(w+) and mod(w+) by shift.\nfunction moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}\n\n// All other shifts, applied to the smaller subtrees between w- and w+, are\n// performed by this function. To prepare the shifts, we have to adjust\n// change(w+), shift(w+), and change(w-).\nfunction executeShifts(v) {\n var shift = 0,\n change = 0,\n children = v.children,\n i = children.length,\n w;\n while (--i >= 0) {\n w = children[i];\n w.z += shift;\n w.m += shift;\n shift += w.s + (change += w.c);\n }\n}\n\n// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise,\n// returns the specified (default) ancestor.\nfunction nextAncestor(vim, v, ancestor) {\n return vim.a.parent === v.parent ? vim.a : ancestor;\n}\n\nfunction TreeNode(node, i) {\n this._ = node;\n this.parent = null;\n this.children = null;\n this.A = null; // default ancestor\n this.a = this; // ancestor\n this.z = 0; // prelim\n this.m = 0; // mod\n this.c = 0; // change\n this.s = 0; // shift\n this.t = null; // thread\n this.i = i; // number\n}\n\nTreeNode.prototype = Object.create(Node.prototype);\n\nfunction treeRoot(root) {\n var tree = new TreeNode(root, 0),\n node,\n nodes = [tree],\n child,\n children,\n i,\n n;\n\n while (node = nodes.pop()) {\n if (children = node._.children) {\n node.children = new Array(n = children.length);\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = node.children[i] = new TreeNode(children[i], i));\n child.parent = node;\n }\n }\n }\n\n (tree.parent = new TreeNode(null, 0)).children = [tree];\n return tree;\n}\n\n// Node-link tree diagram using the Reingold-Tilford \"tidy\" algorithm\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}\n","function defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\nfunction meanX(children) {\n return children.reduce(meanXReduce, 0) / children.length;\n}\n\nfunction meanXReduce(x, c) {\n return x + c.x;\n}\n\nfunction maxY(children) {\n return 1 + children.reduce(maxYReduce, 0);\n}\n\nfunction maxYReduce(y, c) {\n return Math.max(y, c.y);\n}\n\nfunction leafLeft(node) {\n var children;\n while (children = node.children) node = children[0];\n return node;\n}\n\nfunction leafRight(node) {\n var children;\n while (children = node.children) node = children[children.length - 1];\n return node;\n}\n\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = false;\n\n function cluster(root) {\n var previousNode,\n x = 0;\n\n // First walk, computing the initial x & y values.\n root.eachAfter(function(node) {\n var children = node.children;\n if (children) {\n node.x = meanX(children);\n node.y = maxY(children);\n } else {\n node.x = previousNode ? x += separation(node, previousNode) : 0;\n node.y = 0;\n previousNode = node;\n }\n });\n\n var left = leafLeft(root),\n right = leafRight(root),\n x0 = left.x - separation(left, right) / 2,\n x1 = right.x + separation(right, left) / 2;\n\n // Second walk, normalizing x & y to the desired size.\n return root.eachAfter(nodeSize ? function(node) {\n node.x = (node.x - root.x) * dx;\n node.y = (root.y - node.y) * dy;\n } : function(node) {\n node.x = (node.x - x0) / (x1 - x0) * dx;\n node.y = (1 - (root.y ? node.y / root.y : 1)) * dy;\n });\n }\n\n cluster.separation = function(x) {\n return arguments.length ? (separation = x, cluster) : separation;\n };\n\n cluster.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? null : [dx, dy]);\n };\n\n cluster.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? [dx, dy] : null);\n };\n\n return cluster;\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (y1 - y0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.x0 = x0, node.x1 = x1;\n node.y0 = y0, node.y1 = y0 += node.value * k;\n }\n}\n","import treemapDice from \"./dice.js\";\nimport treemapSlice from \"./slice.js\";\n\nexport var phi = (1 + Math.sqrt(5)) / 2;\n\nexport function squarifyRatio(ratio, parent, x0, y0, x1, y1) {\n var rows = [],\n nodes = parent.children,\n row,\n nodeValue,\n i0 = 0,\n i1 = 0,\n n = nodes.length,\n dx, dy,\n value = parent.value,\n sumValue,\n minValue,\n maxValue,\n newRatio,\n minRatio,\n alpha,\n beta;\n\n while (i0 < n) {\n dx = x1 - x0, dy = y1 - y0;\n\n // Find the next non-empty node.\n do sumValue = nodes[i1++].value; while (!sumValue && i1 < n);\n minValue = maxValue = sumValue;\n alpha = Math.max(dy / dx, dx / dy) / (value * ratio);\n beta = sumValue * sumValue * alpha;\n minRatio = Math.max(maxValue / beta, beta / minValue);\n\n // Keep adding nodes while the aspect ratio maintains or improves.\n for (; i1 < n; ++i1) {\n sumValue += nodeValue = nodes[i1].value;\n if (nodeValue < minValue) minValue = nodeValue;\n if (nodeValue > maxValue) maxValue = nodeValue;\n beta = sumValue * sumValue * alpha;\n newRatio = Math.max(maxValue / beta, beta / minValue);\n if (newRatio > minRatio) { sumValue -= nodeValue; break; }\n minRatio = newRatio;\n }\n\n // Position and record the row orientation.\n rows.push(row = {value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1)});\n if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);\n else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);\n value -= sumValue, i0 = i1;\n }\n\n return rows;\n}\n\nexport default (function custom(ratio) {\n\n function squarify(parent, x0, y0, x1, y1) {\n squarifyRatio(ratio, parent, x0, y0, x1, y1);\n }\n\n squarify.ratio = function(x) {\n return custom((x = +x) > 1 ? x : 1);\n };\n\n return squarify;\n})(phi);\n","import treemapDice from \"./dice.js\";\nimport treemapSlice from \"./slice.js\";\nimport {phi, squarifyRatio} from \"./squarify.js\";\n\nexport default (function custom(ratio) {\n\n function resquarify(parent, x0, y0, x1, y1) {\n if ((rows = parent._squarify) && (rows.ratio === ratio)) {\n var rows,\n row,\n nodes,\n i,\n j = -1,\n n,\n m = rows.length,\n value = parent.value;\n\n while (++j < m) {\n row = rows[j], nodes = row.children;\n for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value;\n if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += (y1 - y0) * row.value / value : y1);\n else treemapSlice(row, x0, y0, value ? x0 += (x1 - x0) * row.value / value : x1, y1);\n value -= row.value;\n }\n } else {\n parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);\n rows.ratio = ratio;\n }\n }\n\n resquarify.ratio = function(x) {\n return custom((x = +x) > 1 ? x : 1);\n };\n\n return resquarify;\n})(phi);\n","import { Transform, isTuple, ingest, tupleid, stableCompare } from 'vega-dataflow';\nimport { inherits, error, array, one, truthy, hasOwnProperty } from 'vega-util';\nimport { hierarchy, pack, partition, stratify, tree, cluster, treemap, treemapBinary, treemapDice, treemapSlice, treemapSliceDice, treemapSquarify, treemapResquarify } from 'd3-hierarchy';\n\n// Build lookup table mapping tuple keys to tree node instances\nfunction lookup (tree, key, filter) {\n const map = {};\n tree.each(node => {\n const t = node.data;\n if (filter(t)) map[key(t)] = node;\n });\n tree.lookup = map;\n return tree;\n}\n\n/**\n * Nest tuples into a tree structure, grouped by key values.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.keys - The key fields to nest by, in order.\n * @param {boolean} [params.generate=false] - A boolean flag indicating if\n * non-leaf nodes generated by this transform should be included in the\n * output. The default (false) includes only the input data (leaf nodes)\n * in the data stream.\n */\nfunction Nest(params) {\n Transform.call(this, null, params);\n}\nNest.Definition = {\n 'type': 'Nest',\n 'metadata': {\n 'treesource': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'keys',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'generate',\n 'type': 'boolean'\n }]\n};\nconst children = n => n.values;\ninherits(Nest, Transform, {\n transform(_, pulse) {\n if (!pulse.source) {\n error('Nest transform requires an upstream data source.');\n }\n var gen = _.generate,\n mod = _.modified(),\n out = pulse.clone(),\n tree = this.value;\n if (!tree || mod || pulse.changed()) {\n // collect nodes to remove\n if (tree) {\n tree.each(node => {\n if (node.children && isTuple(node.data)) {\n out.rem.push(node.data);\n }\n });\n }\n\n // generate new tree structure\n this.value = tree = hierarchy({\n values: array(_.keys).reduce((n, k) => {\n n.key(k);\n return n;\n }, nest()).entries(out.source)\n }, children);\n\n // collect nodes to add\n if (gen) {\n tree.each(node => {\n if (node.children) {\n node = ingest(node.data);\n out.add.push(node);\n out.source.push(node);\n }\n });\n }\n\n // build lookup table\n lookup(tree, tupleid, tupleid);\n }\n out.source.root = tree;\n return out;\n }\n});\nfunction nest() {\n const keys = [],\n nest = {\n entries: array => entries(apply(array, 0), 0),\n key: d => (keys.push(d), nest)\n };\n function apply(array, depth) {\n if (depth >= keys.length) {\n return array;\n }\n const n = array.length,\n key = keys[depth++],\n valuesByKey = {},\n result = {};\n let i = -1,\n keyValue,\n value,\n values;\n while (++i < n) {\n keyValue = key(value = array[i]) + '';\n if (values = valuesByKey[keyValue]) {\n values.push(value);\n } else {\n valuesByKey[keyValue] = [value];\n }\n }\n for (keyValue in valuesByKey) {\n result[keyValue] = apply(valuesByKey[keyValue], depth);\n }\n return result;\n }\n function entries(map, depth) {\n if (++depth > keys.length) return map;\n const array = [];\n for (const key in map) {\n array.push({\n key,\n values: entries(map[key], depth)\n });\n }\n return array;\n }\n return nest;\n}\n\n/**\n * Abstract class for tree layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction HierarchyLayout(params) {\n Transform.call(this, null, params);\n}\nconst defaultSeparation = (a, b) => a.parent === b.parent ? 1 : 2;\ninherits(HierarchyLayout, Transform, {\n transform(_, pulse) {\n if (!pulse.source || !pulse.source.root) {\n error(this.constructor.name + ' transform requires a backing tree data source.');\n }\n const layout = this.layout(_.method),\n fields = this.fields,\n root = pulse.source.root,\n as = _.as || fields;\n if (_.field) root.sum(_.field);else root.count();\n if (_.sort) root.sort(stableCompare(_.sort, d => d.data));\n setParams(layout, this.params, _);\n if (layout.separation) {\n layout.separation(_.separation !== false ? defaultSeparation : one);\n }\n try {\n this.value = layout(root);\n } catch (err) {\n error(err);\n }\n root.each(node => setFields(node, fields, as));\n return pulse.reflow(_.modified()).modifies(as).modifies('leaf');\n }\n});\nfunction setParams(layout, params, _) {\n for (let p, i = 0, n = params.length; i < n; ++i) {\n p = params[i];\n if (p in _) layout[p](_[p]);\n }\n}\nfunction setFields(node, fields, as) {\n const t = node.data,\n n = fields.length - 1;\n for (let i = 0; i < n; ++i) {\n t[as[i]] = node[fields[i]];\n }\n t[as[n]] = node.children ? node.children.length : 0;\n}\n\nconst Output$3 = ['x', 'y', 'r', 'depth', 'children'];\n\n/**\n * Packed circle tree layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size nodes.\n */\nfunction Pack(params) {\n HierarchyLayout.call(this, params);\n}\nPack.Definition = {\n 'type': 'Pack',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'radius',\n 'type': 'field',\n 'default': null\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output$3.length,\n 'default': Output$3\n }]\n};\ninherits(Pack, HierarchyLayout, {\n layout: pack,\n params: ['radius', 'size', 'padding'],\n fields: Output$3\n});\n\nconst Output$2 = ['x0', 'y0', 'x1', 'y1', 'depth', 'children'];\n\n/**\n * Partition tree layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size nodes.\n */\nfunction Partition(params) {\n HierarchyLayout.call(this, params);\n}\nPartition.Definition = {\n 'type': 'Partition',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'round',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output$2.length,\n 'default': Output$2\n }]\n};\ninherits(Partition, HierarchyLayout, {\n layout: partition,\n params: ['size', 'round', 'padding'],\n fields: Output$2\n});\n\n/**\n * Stratify a collection of tuples into a tree structure based on\n * id and parent id fields.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.key - Unique key field for each tuple.\n * @param {function(object): *} params.parentKey - Field with key for parent tuple.\n */\nfunction Stratify(params) {\n Transform.call(this, null, params);\n}\nStratify.Definition = {\n 'type': 'Stratify',\n 'metadata': {\n 'treesource': true\n },\n 'params': [{\n 'name': 'key',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'parentKey',\n 'type': 'field',\n 'required': true\n }]\n};\ninherits(Stratify, Transform, {\n transform(_, pulse) {\n if (!pulse.source) {\n error('Stratify transform requires an upstream data source.');\n }\n let tree = this.value;\n const mod = _.modified(),\n out = pulse.fork(pulse.ALL).materialize(pulse.SOURCE),\n run = !tree || mod || pulse.changed(pulse.ADD_REM) || pulse.modified(_.key.fields) || pulse.modified(_.parentKey.fields);\n\n // prevent upstream source pollution\n out.source = out.source.slice();\n if (run) {\n tree = out.source.length ? lookup(stratify().id(_.key).parentId(_.parentKey)(out.source), _.key, truthy) : lookup(stratify()([{}]), _.key, _.key);\n }\n out.source.root = this.value = tree;\n return out;\n }\n});\n\nconst Layouts = {\n tidy: tree,\n cluster: cluster\n};\nconst Output$1 = ['x', 'y', 'depth', 'children'];\n\n/**\n * Tree layout. Depending on the method parameter, performs either\n * Reingold-Tilford 'tidy' layout or dendrogram 'cluster' layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction Tree(params) {\n HierarchyLayout.call(this, params);\n}\nTree.Definition = {\n 'type': 'Tree',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'method',\n 'type': 'enum',\n 'default': 'tidy',\n 'values': ['tidy', 'cluster']\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'nodeSize',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'separation',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output$1.length,\n 'default': Output$1\n }]\n};\ninherits(Tree, HierarchyLayout, {\n /**\n * Tree layout generator. Supports both 'tidy' and 'cluster' layouts.\n */\n layout(method) {\n const m = method || 'tidy';\n if (hasOwnProperty(Layouts, m)) return Layouts[m]();else error('Unrecognized Tree layout method: ' + m);\n },\n params: ['size', 'nodeSize'],\n fields: Output$1\n});\n\n/**\n * Generate tuples representing links between tree nodes.\n * The resulting tuples will contain 'source' and 'target' fields,\n * which point to parent and child node tuples, respectively.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction TreeLinks(params) {\n Transform.call(this, [], params);\n}\nTreeLinks.Definition = {\n 'type': 'TreeLinks',\n 'metadata': {\n 'tree': true,\n 'generates': true,\n 'changes': true\n },\n 'params': []\n};\ninherits(TreeLinks, Transform, {\n transform(_, pulse) {\n const links = this.value,\n tree = pulse.source && pulse.source.root,\n out = pulse.fork(pulse.NO_SOURCE),\n lut = {};\n if (!tree) error('TreeLinks transform requires a tree data source.');\n if (pulse.changed(pulse.ADD_REM)) {\n // remove previous links\n out.rem = links;\n\n // build lookup table of valid tuples\n pulse.visit(pulse.SOURCE, t => lut[tupleid(t)] = 1);\n\n // generate links for all edges incident on valid tuples\n tree.each(node => {\n const t = node.data,\n p = node.parent && node.parent.data;\n if (p && lut[tupleid(t)] && lut[tupleid(p)]) {\n out.add.push(ingest({\n source: p,\n target: t\n }));\n }\n });\n this.value = out.add;\n } else if (pulse.changed(pulse.MOD)) {\n // build lookup table of modified tuples\n pulse.visit(pulse.MOD, t => lut[tupleid(t)] = 1);\n\n // gather links incident on modified tuples\n links.forEach(link => {\n if (lut[tupleid(link.source)] || lut[tupleid(link.target)]) {\n out.mod.push(link);\n }\n });\n }\n return out;\n }\n});\n\nconst Tiles = {\n binary: treemapBinary,\n dice: treemapDice,\n slice: treemapSlice,\n slicedice: treemapSliceDice,\n squarify: treemapSquarify,\n resquarify: treemapResquarify\n};\nconst Output = ['x0', 'y0', 'x1', 'y1', 'depth', 'children'];\n\n/**\n * Treemap layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size nodes.\n */\nfunction Treemap(params) {\n HierarchyLayout.call(this, params);\n}\nTreemap.Definition = {\n 'type': 'Treemap',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'method',\n 'type': 'enum',\n 'default': 'squarify',\n 'values': ['squarify', 'resquarify', 'binary', 'dice', 'slice', 'slicedice']\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingInner',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingOuter',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingTop',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingRight',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingBottom',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingLeft',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'ratio',\n 'type': 'number',\n 'default': 1.618033988749895\n }, {\n 'name': 'round',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output.length,\n 'default': Output\n }]\n};\ninherits(Treemap, HierarchyLayout, {\n /**\n * Treemap layout generator. Adds 'method' and 'ratio' parameters\n * to configure the underlying tile method.\n */\n layout() {\n const x = treemap();\n x.ratio = _ => {\n const t = x.tile();\n if (t.ratio) x.tile(t.ratio(_));\n };\n x.method = _ => {\n if (hasOwnProperty(Tiles, _)) x.tile(Tiles[_]);else error('Unrecognized Treemap layout method: ' + _);\n };\n return x;\n },\n params: ['method', 'ratio', 'size', 'round', 'padding', 'paddingInner', 'paddingOuter', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n fields: Output\n});\n\nexport { Nest as nest, Pack as pack, Partition as partition, Stratify as stratify, Tree as tree, TreeLinks as treelinks, Treemap as treemap };\n","import roundNode from \"./treemap/round.js\";\nimport treemapDice from \"./treemap/dice.js\";\n\nexport default function() {\n var dx = 1,\n dy = 1,\n padding = 0,\n round = false;\n\n function partition(root) {\n var n = root.height + 1;\n root.x0 =\n root.y0 = padding;\n root.x1 = dx;\n root.y1 = dy / n;\n root.eachBefore(positionNode(dy, n));\n if (round) root.eachBefore(roundNode);\n return root;\n }\n\n function positionNode(dy, n) {\n return function(node) {\n if (node.children) {\n treemapDice(node, node.x0, dy * (node.depth + 1) / n, node.x1, dy * (node.depth + 2) / n);\n }\n var x0 = node.x0,\n y0 = node.y0,\n x1 = node.x1 - padding,\n y1 = node.y1 - padding;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n };\n }\n\n partition.round = function(x) {\n return arguments.length ? (round = !!x, partition) : round;\n };\n\n partition.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], partition) : [dx, dy];\n };\n\n partition.padding = function(x) {\n return arguments.length ? (padding = +x, partition) : padding;\n };\n\n return partition;\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n i, n = nodes.length,\n sum, sums = new Array(n + 1);\n\n for (sums[0] = sum = i = 0; i < n; ++i) {\n sums[i + 1] = sum += nodes[i].value;\n }\n\n partition(0, n, parent.value, x0, y0, x1, y1);\n\n function partition(i, j, value, x0, y0, x1, y1) {\n if (i >= j - 1) {\n var node = nodes[i];\n node.x0 = x0, node.y0 = y0;\n node.x1 = x1, node.y1 = y1;\n return;\n }\n\n var valueOffset = sums[i],\n valueTarget = (value / 2) + valueOffset,\n k = i + 1,\n hi = j - 1;\n\n while (k < hi) {\n var mid = k + hi >>> 1;\n if (sums[mid] < valueTarget) k = mid + 1;\n else hi = mid;\n }\n\n if ((valueTarget - sums[k - 1]) < (sums[k] - valueTarget) && i + 1 < k) --k;\n\n var valueLeft = sums[k] - valueOffset,\n valueRight = value - valueLeft;\n\n if ((x1 - x0) > (y1 - y0)) {\n var xk = value ? (x0 * valueRight + x1 * valueLeft) / value : x1;\n partition(i, k, valueLeft, x0, y0, xk, y1);\n partition(k, j, valueRight, xk, y0, x1, y1);\n } else {\n var yk = value ? (y0 * valueRight + y1 * valueLeft) / value : y1;\n partition(i, k, valueLeft, x0, y0, x1, yk);\n partition(k, j, valueRight, x0, yk, x1, y1);\n }\n }\n}\n","import dice from \"./dice.js\";\nimport slice from \"./slice.js\";\n\nexport default function(parent, x0, y0, x1, y1) {\n (parent.depth & 1 ? slice : dice)(parent, x0, y0, x1, y1);\n}\n","import roundNode from \"./round.js\";\nimport squarify from \"./squarify.js\";\nimport {required} from \"../accessors.js\";\nimport constant, {constantZero} from \"../constant.js\";\n\nexport default function() {\n var tile = squarify,\n round = false,\n dx = 1,\n dy = 1,\n paddingStack = [0],\n paddingInner = constantZero,\n paddingTop = constantZero,\n paddingRight = constantZero,\n paddingBottom = constantZero,\n paddingLeft = constantZero;\n\n function treemap(root) {\n root.x0 =\n root.y0 = 0;\n root.x1 = dx;\n root.y1 = dy;\n root.eachBefore(positionNode);\n paddingStack = [0];\n if (round) root.eachBefore(roundNode);\n return root;\n }\n\n function positionNode(node) {\n var p = paddingStack[node.depth],\n x0 = node.x0 + p,\n y0 = node.y0 + p,\n x1 = node.x1 - p,\n y1 = node.y1 - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n if (node.children) {\n p = paddingStack[node.depth + 1] = paddingInner(node) / 2;\n x0 += paddingLeft(node) - p;\n y0 += paddingTop(node) - p;\n x1 -= paddingRight(node) - p;\n y1 -= paddingBottom(node) - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n tile(node, x0, y0, x1, y1);\n }\n }\n\n treemap.round = function(x) {\n return arguments.length ? (round = !!x, treemap) : round;\n };\n\n treemap.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];\n };\n\n treemap.tile = function(x) {\n return arguments.length ? (tile = required(x), treemap) : tile;\n };\n\n treemap.padding = function(x) {\n return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();\n };\n\n treemap.paddingInner = function(x) {\n return arguments.length ? (paddingInner = typeof x === \"function\" ? x : constant(+x), treemap) : paddingInner;\n };\n\n treemap.paddingOuter = function(x) {\n return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();\n };\n\n treemap.paddingTop = function(x) {\n return arguments.length ? (paddingTop = typeof x === \"function\" ? x : constant(+x), treemap) : paddingTop;\n };\n\n treemap.paddingRight = function(x) {\n return arguments.length ? (paddingRight = typeof x === \"function\" ? x : constant(+x), treemap) : paddingRight;\n };\n\n treemap.paddingBottom = function(x) {\n return arguments.length ? (paddingBottom = typeof x === \"function\" ? x : constant(+x), treemap) : paddingBottom;\n };\n\n treemap.paddingLeft = function(x) {\n return arguments.length ? (paddingLeft = typeof x === \"function\" ? x : constant(+x), treemap) : paddingLeft;\n };\n\n return treemap;\n}\n","import { Marks, textMetrics } from 'vega-scenegraph';\nimport { canvas } from 'vega-canvas';\nimport { rederive, Transform } from 'vega-dataflow';\nimport { inherits, error, array, isFunction } from 'vega-util';\n\n// bit mask for getting first 2 bytes of alpha value\nconst ALPHA_MASK = 0xff000000;\nfunction baseBitmaps($, data) {\n const bitmap = $.bitmap();\n // when there is no base mark but data points are to be avoided\n (data || []).forEach(d => bitmap.set($(d.boundary[0]), $(d.boundary[3])));\n return [bitmap, undefined];\n}\nfunction markBitmaps($, baseMark, avoidMarks, labelInside, isGroupArea) {\n // create canvas\n const width = $.width,\n height = $.height,\n border = labelInside || isGroupArea,\n context = canvas(width, height).getContext('2d'),\n baseMarkContext = canvas(width, height).getContext('2d'),\n strokeContext = border && canvas(width, height).getContext('2d');\n\n // render all marks to be avoided into canvas\n avoidMarks.forEach(items => draw(context, items, false));\n draw(baseMarkContext, baseMark, false);\n if (border) {\n draw(strokeContext, baseMark, true);\n }\n\n // get canvas buffer, create bitmaps\n const buffer = getBuffer(context, width, height),\n baseMarkBuffer = getBuffer(baseMarkContext, width, height),\n strokeBuffer = border && getBuffer(strokeContext, width, height),\n layer1 = $.bitmap(),\n layer2 = border && $.bitmap();\n\n // populate bitmap layers\n let x, y, u, v, index, alpha, strokeAlpha, baseMarkAlpha;\n for (y = 0; y < height; ++y) {\n for (x = 0; x < width; ++x) {\n index = y * width + x;\n alpha = buffer[index] & ALPHA_MASK;\n baseMarkAlpha = baseMarkBuffer[index] & ALPHA_MASK;\n strokeAlpha = border && strokeBuffer[index] & ALPHA_MASK;\n if (alpha || strokeAlpha || baseMarkAlpha) {\n u = $(x);\n v = $(y);\n if (!isGroupArea && (alpha || baseMarkAlpha)) layer1.set(u, v); // update interior bitmap\n if (border && (alpha || strokeAlpha)) layer2.set(u, v); // update border bitmap\n }\n }\n }\n\n return [layer1, layer2];\n}\nfunction getBuffer(context, width, height) {\n return new Uint32Array(context.getImageData(0, 0, width, height).data.buffer);\n}\nfunction draw(context, items, interior) {\n if (!items.length) return;\n const type = items[0].mark.marktype;\n if (type === 'group') {\n items.forEach(group => {\n group.items.forEach(mark => draw(context, mark.items, interior));\n });\n } else {\n Marks[type].draw(context, {\n items: interior ? items.map(prepare) : items\n });\n }\n}\n\n/**\n * Prepare item before drawing into canvas (setting stroke and opacity)\n * @param {object} source item to be prepared\n * @returns prepared item\n */\nfunction prepare(source) {\n const item = rederive(source, {});\n if (item.stroke && item.strokeOpacity !== 0 || item.fill && item.fillOpacity !== 0) {\n return {\n ...item,\n strokeOpacity: 1,\n stroke: '#000',\n fillOpacity: 0\n };\n }\n return item;\n}\n\nconst DIV = 5,\n // bit shift from x, y index to bit vector array index\n MOD = 31,\n // bit mask for index lookup within a bit vector\n SIZE = 32,\n // individual bit vector size\n RIGHT0 = new Uint32Array(SIZE + 1),\n // left-anchored bit vectors, full -> 0\n RIGHT1 = new Uint32Array(SIZE + 1); // right-anchored bit vectors, 0 -> full\n\nRIGHT1[0] = 0;\nRIGHT0[0] = ~RIGHT1[0];\nfor (let i = 1; i <= SIZE; ++i) {\n RIGHT1[i] = RIGHT1[i - 1] << 1 | 1;\n RIGHT0[i] = ~RIGHT1[i];\n}\nfunction Bitmap (w, h) {\n const array = new Uint32Array(~~((w * h + SIZE) / SIZE));\n function _set(index, mask) {\n array[index] |= mask;\n }\n function _clear(index, mask) {\n array[index] &= mask;\n }\n return {\n array: array,\n get: (x, y) => {\n const index = y * w + x;\n return array[index >>> DIV] & 1 << (index & MOD);\n },\n set: (x, y) => {\n const index = y * w + x;\n _set(index >>> DIV, 1 << (index & MOD));\n },\n clear: (x, y) => {\n const index = y * w + x;\n _clear(index >>> DIV, ~(1 << (index & MOD)));\n },\n getRange: (x, y, x2, y2) => {\n let r = y2,\n start,\n end,\n indexStart,\n indexEnd;\n for (; r >= y; --r) {\n start = r * w + x;\n end = r * w + x2;\n indexStart = start >>> DIV;\n indexEnd = end >>> DIV;\n if (indexStart === indexEnd) {\n if (array[indexStart] & RIGHT0[start & MOD] & RIGHT1[(end & MOD) + 1]) {\n return true;\n }\n } else {\n if (array[indexStart] & RIGHT0[start & MOD]) return true;\n if (array[indexEnd] & RIGHT1[(end & MOD) + 1]) return true;\n for (let i = indexStart + 1; i < indexEnd; ++i) {\n if (array[i]) return true;\n }\n }\n }\n return false;\n },\n setRange: (x, y, x2, y2) => {\n let start, end, indexStart, indexEnd, i;\n for (; y <= y2; ++y) {\n start = y * w + x;\n end = y * w + x2;\n indexStart = start >>> DIV;\n indexEnd = end >>> DIV;\n if (indexStart === indexEnd) {\n _set(indexStart, RIGHT0[start & MOD] & RIGHT1[(end & MOD) + 1]);\n } else {\n _set(indexStart, RIGHT0[start & MOD]);\n _set(indexEnd, RIGHT1[(end & MOD) + 1]);\n for (i = indexStart + 1; i < indexEnd; ++i) _set(i, 0xffffffff);\n }\n }\n },\n clearRange: (x, y, x2, y2) => {\n let start, end, indexStart, indexEnd, i;\n for (; y <= y2; ++y) {\n start = y * w + x;\n end = y * w + x2;\n indexStart = start >>> DIV;\n indexEnd = end >>> DIV;\n if (indexStart === indexEnd) {\n _clear(indexStart, RIGHT1[start & MOD] | RIGHT0[(end & MOD) + 1]);\n } else {\n _clear(indexStart, RIGHT1[start & MOD]);\n _clear(indexEnd, RIGHT0[(end & MOD) + 1]);\n for (i = indexStart + 1; i < indexEnd; ++i) _clear(i, 0);\n }\n }\n },\n outOfBounds: (x, y, x2, y2) => x < 0 || y < 0 || y2 >= h || x2 >= w\n };\n}\n\nfunction scaler (width, height, padding) {\n const ratio = Math.max(1, Math.sqrt(width * height / 1e6)),\n w = ~~((width + 2 * padding + ratio) / ratio),\n h = ~~((height + 2 * padding + ratio) / ratio),\n scale = _ => ~~((_ + padding) / ratio);\n scale.invert = _ => _ * ratio - padding;\n scale.bitmap = () => Bitmap(w, h);\n scale.ratio = ratio;\n scale.padding = padding;\n scale.width = width;\n scale.height = height;\n return scale;\n}\n\nfunction placeAreaLabelNaive ($, bitmaps, avoidBaseMark, markIndex) {\n const width = $.width,\n height = $.height;\n\n // try to place a label within an input area mark\n return function (d) {\n const items = d.datum.datum.items[markIndex].items,\n // area points\n n = items.length,\n // number of points\n textHeight = d.datum.fontSize,\n // label width\n textWidth = textMetrics.width(d.datum, d.datum.text); // label height\n\n let maxAreaWidth = 0,\n x1,\n x2,\n y1,\n y2,\n x,\n y,\n areaWidth;\n\n // for each area sample point\n for (let i = 0; i < n; ++i) {\n x1 = items[i].x;\n y1 = items[i].y;\n x2 = items[i].x2 === undefined ? x1 : items[i].x2;\n y2 = items[i].y2 === undefined ? y1 : items[i].y2;\n x = (x1 + x2) / 2;\n y = (y1 + y2) / 2;\n areaWidth = Math.abs(x2 - x1 + y2 - y1);\n if (areaWidth >= maxAreaWidth) {\n maxAreaWidth = areaWidth;\n d.x = x;\n d.y = y;\n }\n }\n x = textWidth / 2;\n y = textHeight / 2;\n x1 = d.x - x;\n x2 = d.x + x;\n y1 = d.y - y;\n y2 = d.y + y;\n d.align = 'center';\n if (x1 < 0 && x2 <= width) {\n d.align = 'left';\n } else if (0 <= x1 && width < x2) {\n d.align = 'right';\n }\n d.baseline = 'middle';\n if (y1 < 0 && y2 <= height) {\n d.baseline = 'top';\n } else if (0 <= y1 && height < y2) {\n d.baseline = 'bottom';\n }\n return true;\n };\n}\n\nfunction outOfBounds(x, y, textWidth, textHeight, width, height) {\n let r = textWidth / 2;\n return x - r < 0 || x + r > width || y - (r = textHeight / 2) < 0 || y + r > height;\n}\nfunction collision($, x, y, textHeight, textWidth, h, bm0, bm1) {\n const w = textWidth * h / (textHeight * 2),\n x1 = $(x - w),\n x2 = $(x + w),\n y1 = $(y - (h = h / 2)),\n y2 = $(y + h);\n return bm0.outOfBounds(x1, y1, x2, y2) || bm0.getRange(x1, y1, x2, y2) || bm1 && bm1.getRange(x1, y1, x2, y2);\n}\n\nfunction placeAreaLabelReducedSearch ($, bitmaps, avoidBaseMark, markIndex) {\n const width = $.width,\n height = $.height,\n bm0 = bitmaps[0],\n // where labels have been placed\n bm1 = bitmaps[1]; // area outlines\n\n function tryLabel(_x, _y, maxSize, textWidth, textHeight) {\n const x = $.invert(_x),\n y = $.invert(_y);\n let lo = maxSize,\n hi = height,\n mid;\n if (!outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, lo, bm0, bm1) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n // if the label fits at the current sample point,\n // perform binary search to find the largest font size that fits\n while (hi - lo >= 1) {\n mid = (lo + hi) / 2;\n if (collision($, x, y, textHeight, textWidth, mid, bm0, bm1)) {\n hi = mid;\n } else {\n lo = mid;\n }\n }\n // place label if current lower bound exceeds prior max font size\n if (lo > maxSize) {\n return [x, y, lo, true];\n }\n }\n }\n\n // try to place a label within an input area mark\n return function (d) {\n const items = d.datum.datum.items[markIndex].items,\n // area points\n n = items.length,\n // number of points\n textHeight = d.datum.fontSize,\n // label width\n textWidth = textMetrics.width(d.datum, d.datum.text); // label height\n\n let maxSize = avoidBaseMark ? textHeight : 0,\n labelPlaced = false,\n labelPlaced2 = false,\n maxAreaWidth = 0,\n x1,\n x2,\n y1,\n y2,\n x,\n y,\n _x,\n _y,\n _x1,\n _xMid,\n _x2,\n _y1,\n _yMid,\n _y2,\n areaWidth,\n result,\n swapTmp;\n\n // for each area sample point\n for (let i = 0; i < n; ++i) {\n x1 = items[i].x;\n y1 = items[i].y;\n x2 = items[i].x2 === undefined ? x1 : items[i].x2;\n y2 = items[i].y2 === undefined ? y1 : items[i].y2;\n if (x1 > x2) {\n swapTmp = x1;\n x1 = x2;\n x2 = swapTmp;\n }\n if (y1 > y2) {\n swapTmp = y1;\n y1 = y2;\n y2 = swapTmp;\n }\n _x1 = $(x1);\n _x2 = $(x2);\n _xMid = ~~((_x1 + _x2) / 2);\n _y1 = $(y1);\n _y2 = $(y2);\n _yMid = ~~((_y1 + _y2) / 2);\n\n // search along the line from mid point between the 2 border to lower border\n for (_x = _xMid; _x >= _x1; --_x) {\n for (_y = _yMid; _y >= _y1; --_y) {\n result = tryLabel(_x, _y, maxSize, textWidth, textHeight);\n if (result) {\n [d.x, d.y, maxSize, labelPlaced] = result;\n }\n }\n }\n\n // search along the line from mid point between the 2 border to upper border\n for (_x = _xMid; _x <= _x2; ++_x) {\n for (_y = _yMid; _y <= _y2; ++_y) {\n result = tryLabel(_x, _y, maxSize, textWidth, textHeight);\n if (result) {\n [d.x, d.y, maxSize, labelPlaced] = result;\n }\n }\n }\n\n // place label at slice center if not placed through other means\n // and if we're not avoiding overlap with other areas\n if (!labelPlaced && !avoidBaseMark) {\n // one span is zero, hence we can add\n areaWidth = Math.abs(x2 - x1 + y2 - y1);\n x = (x1 + x2) / 2;\n y = (y1 + y2) / 2;\n\n // place label if it fits and improves the max area width\n if (areaWidth >= maxAreaWidth && !outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n maxAreaWidth = areaWidth;\n d.x = x;\n d.y = y;\n labelPlaced2 = true;\n }\n }\n }\n\n // record current label placement information, update label bitmap\n if (labelPlaced || labelPlaced2) {\n x = textWidth / 2;\n y = textHeight / 2;\n bm0.setRange($(d.x - x), $(d.y - y), $(d.x + x), $(d.y + y));\n d.align = 'center';\n d.baseline = 'middle';\n return true;\n } else {\n return false;\n }\n };\n}\n\n// pixel direction offsets for flood fill search\nconst X_DIR = [-1, -1, 1, 1];\nconst Y_DIR = [-1, 1, -1, 1];\nfunction placeAreaLabelFloodFill ($, bitmaps, avoidBaseMark, markIndex) {\n const width = $.width,\n height = $.height,\n bm0 = bitmaps[0],\n // where labels have been placed\n bm1 = bitmaps[1],\n // area outlines\n bm2 = $.bitmap(); // flood-fill visitations\n\n // try to place a label within an input area mark\n return function (d) {\n const items = d.datum.datum.items[markIndex].items,\n // area points\n n = items.length,\n // number of points\n textHeight = d.datum.fontSize,\n // label width\n textWidth = textMetrics.width(d.datum, d.datum.text),\n // label height\n stack = []; // flood fill stack\n\n let maxSize = avoidBaseMark ? textHeight : 0,\n labelPlaced = false,\n labelPlaced2 = false,\n maxAreaWidth = 0,\n x1,\n x2,\n y1,\n y2,\n x,\n y,\n _x,\n _y,\n lo,\n hi,\n mid,\n areaWidth;\n\n // for each area sample point\n for (let i = 0; i < n; ++i) {\n x1 = items[i].x;\n y1 = items[i].y;\n x2 = items[i].x2 === undefined ? x1 : items[i].x2;\n y2 = items[i].y2 === undefined ? y1 : items[i].y2;\n\n // add scaled center point to stack\n stack.push([$((x1 + x2) / 2), $((y1 + y2) / 2)]);\n\n // perform flood fill, visit points\n while (stack.length) {\n [_x, _y] = stack.pop();\n\n // exit if point already marked\n if (bm0.get(_x, _y) || bm1.get(_x, _y) || bm2.get(_x, _y)) continue;\n\n // mark point in flood fill bitmap\n // add search points for all (in bound) directions\n bm2.set(_x, _y);\n for (let j = 0; j < 4; ++j) {\n x = _x + X_DIR[j];\n y = _y + Y_DIR[j];\n if (!bm2.outOfBounds(x, y, x, y)) stack.push([x, y]);\n }\n\n // unscale point back to x, y space\n x = $.invert(_x);\n y = $.invert(_y);\n lo = maxSize;\n hi = height; // TODO: make this bound smaller\n\n if (!outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, lo, bm0, bm1) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n // if the label fits at the current sample point,\n // perform binary search to find the largest font size that fits\n while (hi - lo >= 1) {\n mid = (lo + hi) / 2;\n if (collision($, x, y, textHeight, textWidth, mid, bm0, bm1)) {\n hi = mid;\n } else {\n lo = mid;\n }\n }\n // place label if current lower bound exceeds prior max font size\n if (lo > maxSize) {\n d.x = x;\n d.y = y;\n maxSize = lo;\n labelPlaced = true;\n }\n }\n }\n\n // place label at slice center if not placed through other means\n // and if we're not avoiding overlap with other areas\n if (!labelPlaced && !avoidBaseMark) {\n // one span is zero, hence we can add\n areaWidth = Math.abs(x2 - x1 + y2 - y1);\n x = (x1 + x2) / 2;\n y = (y1 + y2) / 2;\n\n // place label if it fits and improves the max area width\n if (areaWidth >= maxAreaWidth && !outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n maxAreaWidth = areaWidth;\n d.x = x;\n d.y = y;\n labelPlaced2 = true;\n }\n }\n }\n\n // record current label placement information, update label bitmap\n if (labelPlaced || labelPlaced2) {\n x = textWidth / 2;\n y = textHeight / 2;\n bm0.setRange($(d.x - x), $(d.y - y), $(d.x + x), $(d.y + y));\n d.align = 'center';\n d.baseline = 'middle';\n return true;\n } else {\n return false;\n }\n };\n}\n\nconst Aligns = ['right', 'center', 'left'],\n Baselines = ['bottom', 'middle', 'top'];\nfunction placeMarkLabel ($, bitmaps, anchors, offsets) {\n const width = $.width,\n height = $.height,\n bm0 = bitmaps[0],\n bm1 = bitmaps[1],\n n = offsets.length;\n return function (d) {\n const boundary = d.boundary,\n textHeight = d.datum.fontSize;\n\n // can not be placed if the mark is not visible in the graph bound\n if (boundary[2] < 0 || boundary[5] < 0 || boundary[0] > width || boundary[3] > height) {\n return false;\n }\n let textWidth = d.textWidth ?? 0,\n dx,\n dy,\n isInside,\n sizeFactor,\n insideFactor,\n x1,\n x2,\n y1,\n y2,\n xc,\n yc,\n _x1,\n _x2,\n _y1,\n _y2;\n\n // for each anchor and offset\n for (let i = 0; i < n; ++i) {\n dx = (anchors[i] & 0x3) - 1;\n dy = (anchors[i] >>> 0x2 & 0x3) - 1;\n isInside = dx === 0 && dy === 0 || offsets[i] < 0;\n sizeFactor = dx && dy ? Math.SQRT1_2 : 1;\n insideFactor = offsets[i] < 0 ? -1 : 1;\n x1 = boundary[1 + dx] + offsets[i] * dx * sizeFactor;\n yc = boundary[4 + dy] + insideFactor * textHeight * dy / 2 + offsets[i] * dy * sizeFactor;\n y1 = yc - textHeight / 2;\n y2 = yc + textHeight / 2;\n _x1 = $(x1);\n _y1 = $(y1);\n _y2 = $(y2);\n if (!textWidth) {\n // to avoid finding width of text label,\n if (!test(_x1, _x1, _y1, _y2, bm0, bm1, x1, x1, y1, y2, boundary, isInside)) {\n // skip this anchor/offset option if we fail to place a label with 1px width\n continue;\n } else {\n // Otherwise, find the label width\n textWidth = textMetrics.width(d.datum, d.datum.text);\n }\n }\n xc = x1 + insideFactor * textWidth * dx / 2;\n x1 = xc - textWidth / 2;\n x2 = xc + textWidth / 2;\n _x1 = $(x1);\n _x2 = $(x2);\n if (test(_x1, _x2, _y1, _y2, bm0, bm1, x1, x2, y1, y2, boundary, isInside)) {\n // place label if the position is placeable\n d.x = !dx ? xc : dx * insideFactor < 0 ? x2 : x1;\n d.y = !dy ? yc : dy * insideFactor < 0 ? y2 : y1;\n d.align = Aligns[dx * insideFactor + 1];\n d.baseline = Baselines[dy * insideFactor + 1];\n bm0.setRange(_x1, _y1, _x2, _y2);\n return true;\n }\n }\n return false;\n };\n}\n\n// Test if a label with the given dimensions can be added without overlap\nfunction test(_x1, _x2, _y1, _y2, bm0, bm1, x1, x2, y1, y2, boundary, isInside) {\n return !(bm0.outOfBounds(_x1, _y1, _x2, _y2) || (isInside && bm1 || bm0).getRange(_x1, _y1, _x2, _y2));\n}\n\n// 8-bit representation of anchors\nconst TOP = 0x0,\n MIDDLE = 0x4,\n BOTTOM = 0x8,\n LEFT = 0x0,\n CENTER = 0x1,\n RIGHT = 0x2;\n\n// Mapping from text anchor to number representation\nconst anchorCode = {\n 'top-left': TOP + LEFT,\n 'top': TOP + CENTER,\n 'top-right': TOP + RIGHT,\n 'left': MIDDLE + LEFT,\n 'middle': MIDDLE + CENTER,\n 'right': MIDDLE + RIGHT,\n 'bottom-left': BOTTOM + LEFT,\n 'bottom': BOTTOM + CENTER,\n 'bottom-right': BOTTOM + RIGHT\n};\nconst placeAreaLabel = {\n 'naive': placeAreaLabelNaive,\n 'reduced-search': placeAreaLabelReducedSearch,\n 'floodfill': placeAreaLabelFloodFill\n};\nfunction labelLayout (texts, size, compare, offset, anchor, avoidMarks, avoidBaseMark, lineAnchor, markIndex, padding, method) {\n // early exit for empty data\n if (!texts.length) return texts;\n const positions = Math.max(offset.length, anchor.length),\n offsets = getOffsets(offset, positions),\n anchors = getAnchors(anchor, positions),\n marktype = markType(texts[0].datum),\n grouptype = marktype === 'group' && texts[0].datum.items[markIndex].marktype,\n isGroupArea = grouptype === 'area',\n boundary = markBoundary(marktype, grouptype, lineAnchor, markIndex),\n infPadding = padding === null || padding === Infinity,\n isNaiveGroupArea = isGroupArea && method === 'naive';\n let maxTextWidth = -1,\n maxTextHeight = -1;\n\n // prepare text mark data for placing\n const data = texts.map(d => {\n const textWidth = infPadding ? textMetrics.width(d, d.text) : undefined;\n maxTextWidth = Math.max(maxTextWidth, textWidth);\n maxTextHeight = Math.max(maxTextHeight, d.fontSize);\n return {\n datum: d,\n opacity: 0,\n x: undefined,\n y: undefined,\n align: undefined,\n baseline: undefined,\n boundary: boundary(d),\n textWidth\n };\n });\n padding = padding === null || padding === Infinity ? Math.max(maxTextWidth, maxTextHeight) + Math.max(...offset) : padding;\n const $ = scaler(size[0], size[1], padding);\n let bitmaps;\n if (!isNaiveGroupArea) {\n // sort labels in priority order, if comparator is provided\n if (compare) {\n data.sort((a, b) => compare(a.datum, b.datum));\n }\n\n // flag indicating if label can be placed inside its base mark\n let labelInside = false;\n for (let i = 0; i < anchors.length && !labelInside; ++i) {\n // label inside if anchor is at center\n // label inside if offset to be inside the mark bound\n labelInside = anchors[i] === 0x5 || offsets[i] < 0;\n }\n\n // extract data information from base mark when base mark is to be avoided\n // base mark is implicitly avoided if it is a group area\n const baseMark = (marktype && avoidBaseMark || isGroupArea) && texts.map(d => d.datum);\n\n // generate bitmaps for layout calculation\n bitmaps = avoidMarks.length || baseMark ? markBitmaps($, baseMark || [], avoidMarks, labelInside, isGroupArea) : baseBitmaps($, avoidBaseMark && data);\n }\n\n // generate label placement function\n const place = isGroupArea ? placeAreaLabel[method]($, bitmaps, avoidBaseMark, markIndex) : placeMarkLabel($, bitmaps, anchors, offsets);\n\n // place all labels\n data.forEach(d => d.opacity = +place(d));\n return data;\n}\nfunction getOffsets(_, count) {\n const offsets = new Float64Array(count),\n n = _.length;\n for (let i = 0; i < n; ++i) offsets[i] = _[i] || 0;\n for (let i = n; i < count; ++i) offsets[i] = offsets[n - 1];\n return offsets;\n}\nfunction getAnchors(_, count) {\n const anchors = new Int8Array(count),\n n = _.length;\n for (let i = 0; i < n; ++i) anchors[i] |= anchorCode[_[i]];\n for (let i = n; i < count; ++i) anchors[i] = anchors[n - 1];\n return anchors;\n}\nfunction markType(item) {\n return item && item.mark && item.mark.marktype;\n}\n\n/**\n * Factory function for function for getting base mark boundary, depending\n * on mark and group type. When mark type is undefined, line or area: boundary\n * is the coordinate of each data point. When base mark is grouped line,\n * boundary is either at the start or end of the line depending on the\n * value of lineAnchor. Otherwise, use bounds of base mark.\n */\nfunction markBoundary(marktype, grouptype, lineAnchor, markIndex) {\n const xy = d => [d.x, d.x, d.x, d.y, d.y, d.y];\n if (!marktype) {\n return xy; // no reactive geometry\n } else if (marktype === 'line' || marktype === 'area') {\n return d => xy(d.datum);\n } else if (grouptype === 'line') {\n return d => {\n const items = d.datum.items[markIndex].items;\n return xy(items.length ? items[lineAnchor === 'start' ? 0 : items.length - 1] : {\n x: NaN,\n y: NaN\n });\n };\n } else {\n return d => {\n const b = d.datum.bounds;\n return [b.x1, (b.x1 + b.x2) / 2, b.x2, b.y1, (b.y1 + b.y2) / 2, b.y2];\n };\n }\n}\n\nconst Output = ['x', 'y', 'opacity', 'align', 'baseline'];\nconst Anchors = ['top-left', 'left', 'bottom-left', 'top', 'bottom', 'top-right', 'right', 'bottom-right'];\n\n/**\n * Compute text label layout to annotate marks.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.size - The size of the layout, provided as a [width, height] array.\n * @param {function(*,*): number} [params.sort] - An optional\n * comparator function for sorting label data in priority order.\n * @param {Array} [params.anchor] - Label anchor points relative to the base mark bounding box.\n * The available options are 'top-left', 'left', 'bottom-left', 'top',\n * 'bottom', 'top-right', 'right', 'bottom-right', 'middle'.\n * @param {Array} [params.offset] - Label offsets (in pixels) from the base mark bounding box.\n * This parameter is parallel to the list of anchor points.\n * @param {number | null} [params.padding=0] - The amount (in pixels) that a label may exceed the layout size.\n * If this parameter is null, a label may exceed the layout size without any boundary.\n * @param {string} [params.lineAnchor='end'] - For group line mark labels only, indicates the anchor\n * position for labels. One of 'start' or 'end'.\n * @param {string} [params.markIndex=0] - For group mark labels only, an index indicating\n * which mark within the group should be labeled.\n * @param {Array} [params.avoidMarks] - A list of additional mark names for which the label\n * layout should avoid overlap.\n * @param {boolean} [params.avoidBaseMark=true] - Boolean flag indicating if labels should avoid\n * overlap with the underlying base mark being labeled.\n * @param {string} [params.method='naive'] - For area make labels only, a method for\n * place labels. One of 'naive', 'reduced-search', or 'floodfill'.\n * @param {Array} [params.as] - The output fields written by the transform.\n * The default is ['x', 'y', 'opacity', 'align', 'baseline'].\n */\nfunction Label(params) {\n Transform.call(this, null, params);\n}\nLabel.Definition = {\n type: 'Label',\n metadata: {\n modifies: true\n },\n params: [{\n name: 'size',\n type: 'number',\n array: true,\n length: 2,\n required: true\n }, {\n name: 'sort',\n type: 'compare'\n }, {\n name: 'anchor',\n type: 'string',\n array: true,\n default: Anchors\n }, {\n name: 'offset',\n type: 'number',\n array: true,\n default: [1]\n }, {\n name: 'padding',\n type: 'number',\n default: 0,\n null: true\n }, {\n name: 'lineAnchor',\n type: 'string',\n values: ['start', 'end'],\n default: 'end'\n }, {\n name: 'markIndex',\n type: 'number',\n default: 0\n }, {\n name: 'avoidBaseMark',\n type: 'boolean',\n default: true\n }, {\n name: 'avoidMarks',\n type: 'data',\n array: true\n }, {\n name: 'method',\n type: 'string',\n default: 'naive'\n }, {\n name: 'as',\n type: 'string',\n array: true,\n length: Output.length,\n default: Output\n }]\n};\ninherits(Label, Transform, {\n transform(_, pulse) {\n function modp(param) {\n const p = _[param];\n return isFunction(p) && pulse.modified(p.fields);\n }\n const mod = _.modified();\n if (!(mod || pulse.changed(pulse.ADD_REM) || modp('sort'))) return;\n if (!_.size || _.size.length !== 2) {\n error('Size parameter should be specified as a [width, height] array.');\n }\n const as = _.as || Output;\n\n // run label layout\n labelLayout(pulse.materialize(pulse.SOURCE).source || [], _.size, _.sort, array(_.offset == null ? 1 : _.offset), array(_.anchor || Anchors), _.avoidMarks || [], _.avoidBaseMark !== false, _.lineAnchor || 'end', _.markIndex || 0, _.padding === undefined ? 0 : _.padding, _.method || 'naive').forEach(l => {\n // write layout results to data stream\n const t = l.datum;\n t[as[0]] = l.x;\n t[as[1]] = l.y;\n t[as[2]] = l.opacity;\n t[as[3]] = l.align;\n t[as[4]] = l.baseline;\n });\n return pulse.reflow(mod).modifies(as);\n }\n});\n\nexport { Label as label };\n","import { regressionLoess, sampleCurve, regressionLinear, regressionLog, regressionExp, regressionPow, regressionQuad, regressionPoly } from 'vega-statistics';\nimport { Transform, ingest } from 'vega-dataflow';\nimport { inherits, accessorName, hasOwnProperty, error, extent } from 'vega-util';\n\nfunction partition (data, groupby) {\n var groups = [],\n get = function (f) {\n return f(t);\n },\n map,\n i,\n n,\n t,\n k,\n g;\n\n // partition data points into stack groups\n if (groupby == null) {\n groups.push(data);\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n if (!g) {\n map[k] = g = [];\n g.dims = k;\n groups.push(g);\n }\n g.push(t);\n }\n }\n return groups;\n}\n\n/**\n * Compute locally-weighted regression fits for one or more data groups.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.x - An accessor for the predictor data field.\n * @param {function(object): *} params.y - An accessor for the predicted data field.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {number} [params.bandwidth=0.3] - The loess bandwidth.\n */\nfunction Loess(params) {\n Transform.call(this, null, params);\n}\nLoess.Definition = {\n 'type': 'Loess',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'default': 0.3\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }]\n};\ninherits(Loess, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n if (!this.value || pulse.changed() || _.modified()) {\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition(source, _.groupby),\n names = (_.groupby || []).map(accessorName),\n m = names.length,\n as = _.as || [accessorName(_.x), accessorName(_.y)],\n values = [];\n groups.forEach(g => {\n regressionLoess(g, _.x, _.y, _.bandwidth || 0.3).forEach(p => {\n const t = {};\n for (let i = 0; i < m; ++i) {\n t[names[i]] = g.dims[i];\n }\n t[as[0]] = p[0];\n t[as[1]] = p[1];\n values.push(ingest(t));\n });\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n return out;\n }\n});\n\nconst Methods = {\n linear: regressionLinear,\n log: regressionLog,\n exp: regressionExp,\n pow: regressionPow,\n quad: regressionQuad,\n poly: regressionPoly\n};\nconst degreesOfFreedom = (method, order) => method === 'poly' ? order : method === 'quad' ? 2 : 1;\n\n/**\n * Compute regression fits for one or more data groups.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.x - An accessor for the predictor data field.\n * @param {function(object): *} params.y - An accessor for the predicted data field.\n * @param {string} [params.method='linear'] - The regression method to apply.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {Array} [params.extent] - The domain extent over which to plot the regression line.\n * @param {number} [params.order=3] - The polynomial order. Only applies to the 'poly' method.\n */\nfunction Regression(params) {\n Transform.call(this, null, params);\n}\nRegression.Definition = {\n 'type': 'Regression',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'method',\n 'type': 'string',\n 'default': 'linear',\n 'values': Object.keys(Methods)\n }, {\n 'name': 'order',\n 'type': 'number',\n 'default': 3\n }, {\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'params',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }]\n};\ninherits(Regression, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n if (!this.value || pulse.changed() || _.modified()) {\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition(source, _.groupby),\n names = (_.groupby || []).map(accessorName),\n method = _.method || 'linear',\n order = _.order || 3,\n dof = degreesOfFreedom(method, order),\n as = _.as || [accessorName(_.x), accessorName(_.y)],\n fit = Methods[method],\n values = [];\n let domain = _.extent;\n if (!hasOwnProperty(Methods, method)) {\n error('Invalid regression method: ' + method);\n }\n if (domain != null) {\n if (method === 'log' && domain[0] <= 0) {\n pulse.dataflow.warn('Ignoring extent with values <= 0 for log regression.');\n domain = null;\n }\n }\n groups.forEach(g => {\n const n = g.length;\n if (n <= dof) {\n pulse.dataflow.warn('Skipping regression with more parameters than data points.');\n return;\n }\n const model = fit(g, _.x, _.y, order);\n if (_.params) {\n // if parameter vectors requested return those\n values.push(ingest({\n keys: g.dims,\n coef: model.coef,\n rSquared: model.rSquared\n }));\n return;\n }\n const dom = domain || extent(g, _.x),\n add = p => {\n const t = {};\n for (let i = 0; i < names.length; ++i) {\n t[names[i]] = g.dims[i];\n }\n t[as[0]] = p[0];\n t[as[1]] = p[1];\n values.push(ingest(t));\n };\n if (method === 'linear') {\n // for linear regression we only need the end points\n dom.forEach(x => add([x, model.predict(x)]));\n } else {\n // otherwise return trend line sample points\n sampleCurve(model.predict, dom, 25, 200).forEach(add);\n }\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n return out;\n }\n});\n\nexport { Loess as loess, Regression as regression };\n","export const epsilon = 1.1102230246251565e-16;\nexport const splitter = 134217729;\nexport const resulterrbound = (3 + 8 * epsilon) * epsilon;\n\n// fast_expansion_sum_zeroelim routine from oritinal code\nexport function sum(elen, e, flen, f, h) {\n let Q, Qnew, hh, bvirt;\n let enow = e[0];\n let fnow = f[0];\n let eindex = 0;\n let findex = 0;\n if ((fnow > enow) === (fnow > -enow)) {\n Q = enow;\n enow = e[++eindex];\n } else {\n Q = fnow;\n fnow = f[++findex];\n }\n let hindex = 0;\n if (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = enow + Q;\n hh = Q - (Qnew - enow);\n enow = e[++eindex];\n } else {\n Qnew = fnow + Q;\n hh = Q - (Qnew - fnow);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n while (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n } else {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n }\n while (eindex < elen) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n while (findex < flen) {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nexport function sum_three(alen, a, blen, b, clen, c, tmp, out) {\n return sum(sum(alen, a, blen, b, tmp), tmp, clen, c, out);\n}\n\n// scale_expansion_zeroelim routine from oritinal code\nexport function scale(elen, e, b, h) {\n let Q, sum, hh, product1, product0;\n let bvirt, c, ahi, alo, bhi, blo;\n\n c = splitter * b;\n bhi = c - (c - b);\n blo = b - bhi;\n let enow = e[0];\n Q = enow * b;\n c = splitter * enow;\n ahi = c - (c - enow);\n alo = enow - ahi;\n hh = alo * blo - (Q - ahi * bhi - alo * bhi - ahi * blo);\n let hindex = 0;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n for (let i = 1; i < elen; i++) {\n enow = e[i];\n product1 = enow * b;\n c = splitter * enow;\n ahi = c - (c - enow);\n alo = enow - ahi;\n product0 = alo * blo - (product1 - ahi * bhi - alo * bhi - ahi * blo);\n sum = Q + product0;\n bvirt = sum - Q;\n hh = Q - (sum - bvirt) + (product0 - bvirt);\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n Q = product1 + sum;\n hh = sum - (Q - product1);\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nexport function negate(elen, e) {\n for (let i = 0; i < elen; i++) e[i] = -e[i];\n return elen;\n}\n\nexport function estimate(elen, e) {\n let Q = e[0];\n for (let i = 1; i < elen; i++) Q += e[i];\n return Q;\n}\n\nexport function vec(n) {\n return new Float64Array(n);\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum} from './util.js';\n\nconst ccwerrboundA = (3 + 16 * epsilon) * epsilon;\nconst ccwerrboundB = (2 + 12 * epsilon) * epsilon;\nconst ccwerrboundC = (9 + 64 * epsilon) * epsilon * epsilon;\n\nconst B = vec(4);\nconst C1 = vec(8);\nconst C2 = vec(12);\nconst D = vec(16);\nconst u = vec(4);\n\nfunction orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {\n let acxtail, acytail, bcxtail, bcytail;\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n const acx = ax - cx;\n const bcx = bx - cx;\n const acy = ay - cy;\n const bcy = by - cy;\n\n s1 = acx * bcy;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcx;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n B[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n B[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n B[2] = _j - (u3 - bvirt) + (_i - bvirt);\n B[3] = u3;\n\n let det = estimate(4, B);\n let errbound = ccwerrboundB * detsum;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - acx;\n acxtail = ax - (acx + bvirt) + (bvirt - cx);\n bvirt = bx - bcx;\n bcxtail = bx - (bcx + bvirt) + (bvirt - cx);\n bvirt = ay - acy;\n acytail = ay - (acy + bvirt) + (bvirt - cy);\n bvirt = by - bcy;\n bcytail = by - (bcy + bvirt) + (bvirt - cy);\n\n if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) {\n return det;\n }\n\n errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det);\n det += (acx * bcytail + bcy * acxtail) - (acy * bcxtail + bcx * acytail);\n if (det >= errbound || -det >= errbound) return det;\n\n s1 = acxtail * bcy;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcx;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const C1len = sum(4, B, 4, u, C1);\n\n s1 = acx * bcytail;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcxtail;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const C2len = sum(C1len, C1, 4, u, C2);\n\n s1 = acxtail * bcytail;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcxtail;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const Dlen = sum(C2len, C2, 4, u, D);\n\n return D[Dlen - 1];\n}\n\nexport function orient2d(ax, ay, bx, by, cx, cy) {\n const detleft = (ay - cy) * (bx - cx);\n const detright = (ax - cx) * (by - cy);\n const det = detleft - detright;\n\n if (detleft === 0 || detright === 0 || (detleft > 0) !== (detright > 0)) return det;\n\n const detsum = Math.abs(detleft + detright);\n if (Math.abs(det) >= ccwerrboundA * detsum) return det;\n\n return -orient2dadapt(ax, ay, bx, by, cx, cy, detsum);\n}\n\nexport function orient2dfast(ax, ay, bx, by, cx, cy) {\n return (ay - cy) * (bx - cx) - (ax - cx) * (by - cy);\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum, scale} from './util.js';\n\nconst o3derrboundA = (7 + 56 * epsilon) * epsilon;\nconst o3derrboundB = (3 + 28 * epsilon) * epsilon;\nconst o3derrboundC = (26 + 288 * epsilon) * epsilon * epsilon;\n\nconst bc = vec(4);\nconst ca = vec(4);\nconst ab = vec(4);\nconst at_b = vec(4);\nconst at_c = vec(4);\nconst bt_c = vec(4);\nconst bt_a = vec(4);\nconst ct_a = vec(4);\nconst ct_b = vec(4);\nconst bct = vec(8);\nconst cat = vec(8);\nconst abt = vec(8);\nconst u = vec(4);\n\nconst _8 = vec(8);\nconst _8b = vec(8);\nconst _16 = vec(8);\nconst _12 = vec(12);\n\nlet fin = vec(192);\nlet fin2 = vec(192);\n\nfunction finadd(finlen, alen, a) {\n finlen = sum(finlen, fin, alen, a, fin2);\n const tmp = fin; fin = fin2; fin2 = tmp;\n return finlen;\n}\n\nfunction tailinit(xtail, ytail, ax, ay, bx, by, a, b) {\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _k, _0, s1, s0, t1, t0, u3, negate;\n if (xtail === 0) {\n if (ytail === 0) {\n a[0] = 0;\n b[0] = 0;\n return 1;\n } else {\n negate = -ytail;\n s1 = negate * ax;\n c = splitter * negate;\n ahi = c - (c - negate);\n alo = negate - ahi;\n c = splitter * ax;\n bhi = c - (c - ax);\n blo = ax - bhi;\n a[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n a[1] = s1;\n s1 = ytail * bx;\n c = splitter * ytail;\n ahi = c - (c - ytail);\n alo = ytail - ahi;\n c = splitter * bx;\n bhi = c - (c - bx);\n blo = bx - bhi;\n b[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n b[1] = s1;\n return 2;\n }\n } else {\n if (ytail === 0) {\n s1 = xtail * ay;\n c = splitter * xtail;\n ahi = c - (c - xtail);\n alo = xtail - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n a[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n a[1] = s1;\n negate = -xtail;\n s1 = negate * by;\n c = splitter * negate;\n ahi = c - (c - negate);\n alo = negate - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n b[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n b[1] = s1;\n return 2;\n } else {\n s1 = xtail * ay;\n c = splitter * xtail;\n ahi = c - (c - xtail);\n alo = xtail - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ytail * ax;\n c = splitter * ytail;\n ahi = c - (c - ytail);\n alo = ytail - ahi;\n c = splitter * ax;\n bhi = c - (c - ax);\n blo = ax - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n a[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n a[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n a[2] = _j - (u3 - bvirt) + (_i - bvirt);\n a[3] = u3;\n s1 = ytail * bx;\n c = splitter * ytail;\n ahi = c - (c - ytail);\n alo = ytail - ahi;\n c = splitter * bx;\n bhi = c - (c - bx);\n blo = bx - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = xtail * by;\n c = splitter * xtail;\n ahi = c - (c - xtail);\n alo = xtail - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n b[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n b[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n b[2] = _j - (u3 - bvirt) + (_i - bvirt);\n b[3] = u3;\n return 4;\n }\n }\n}\n\nfunction tailadd(finlen, a, b, k, z) {\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _k, _0, s1, s0, u3;\n s1 = a * b;\n c = splitter * a;\n ahi = c - (c - a);\n alo = a - ahi;\n c = splitter * b;\n bhi = c - (c - b);\n blo = b - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n c = splitter * k;\n bhi = c - (c - k);\n blo = k - bhi;\n _i = s0 * k;\n c = splitter * s0;\n ahi = c - (c - s0);\n alo = s0 - ahi;\n u[0] = alo * blo - (_i - ahi * bhi - alo * bhi - ahi * blo);\n _j = s1 * k;\n c = splitter * s1;\n ahi = c - (c - s1);\n alo = s1 - ahi;\n _0 = alo * blo - (_j - ahi * bhi - alo * bhi - ahi * blo);\n _k = _i + _0;\n bvirt = _k - _i;\n u[1] = _i - (_k - bvirt) + (_0 - bvirt);\n u3 = _j + _k;\n u[2] = _k - (u3 - _j);\n u[3] = u3;\n finlen = finadd(finlen, 4, u);\n if (z !== 0) {\n c = splitter * z;\n bhi = c - (c - z);\n blo = z - bhi;\n _i = s0 * z;\n c = splitter * s0;\n ahi = c - (c - s0);\n alo = s0 - ahi;\n u[0] = alo * blo - (_i - ahi * bhi - alo * bhi - ahi * blo);\n _j = s1 * z;\n c = splitter * s1;\n ahi = c - (c - s1);\n alo = s1 - ahi;\n _0 = alo * blo - (_j - ahi * bhi - alo * bhi - ahi * blo);\n _k = _i + _0;\n bvirt = _k - _i;\n u[1] = _i - (_k - bvirt) + (_0 - bvirt);\n u3 = _j + _k;\n u[2] = _k - (u3 - _j);\n u[3] = u3;\n finlen = finadd(finlen, 4, u);\n }\n return finlen;\n}\n\nfunction orient3dadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, permanent) {\n let finlen;\n let adxtail, bdxtail, cdxtail;\n let adytail, bdytail, cdytail;\n let adztail, bdztail, cdztail;\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _k, _0, s1, s0, t1, t0, u3;\n\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n const adz = az - dz;\n const bdz = bz - dz;\n const cdz = cz - dz;\n\n s1 = bdx * cdy;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdx * bdy;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bc[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bc[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bc[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bc[3] = u3;\n s1 = cdx * ady;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adx * cdy;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ca[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ca[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ca[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ca[3] = u3;\n s1 = adx * bdy;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdx * ady;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ab[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ab[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ab[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ab[3] = u3;\n\n finlen = sum(\n sum(\n scale(4, bc, adz, _8), _8,\n scale(4, ca, bdz, _8b), _8b, _16), _16,\n scale(4, ab, cdz, _8), _8, fin);\n\n let det = estimate(finlen, fin);\n let errbound = o3derrboundB * permanent;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - adx;\n adxtail = ax - (adx + bvirt) + (bvirt - dx);\n bvirt = bx - bdx;\n bdxtail = bx - (bdx + bvirt) + (bvirt - dx);\n bvirt = cx - cdx;\n cdxtail = cx - (cdx + bvirt) + (bvirt - dx);\n bvirt = ay - ady;\n adytail = ay - (ady + bvirt) + (bvirt - dy);\n bvirt = by - bdy;\n bdytail = by - (bdy + bvirt) + (bvirt - dy);\n bvirt = cy - cdy;\n cdytail = cy - (cdy + bvirt) + (bvirt - dy);\n bvirt = az - adz;\n adztail = az - (adz + bvirt) + (bvirt - dz);\n bvirt = bz - bdz;\n bdztail = bz - (bdz + bvirt) + (bvirt - dz);\n bvirt = cz - cdz;\n cdztail = cz - (cdz + bvirt) + (bvirt - dz);\n\n if (adxtail === 0 && bdxtail === 0 && cdxtail === 0 &&\n adytail === 0 && bdytail === 0 && cdytail === 0 &&\n adztail === 0 && bdztail === 0 && cdztail === 0) {\n return det;\n }\n\n errbound = o3derrboundC * permanent + resulterrbound * Math.abs(det);\n det +=\n adz * (bdx * cdytail + cdy * bdxtail - (bdy * cdxtail + cdx * bdytail)) + adztail * (bdx * cdy - bdy * cdx) +\n bdz * (cdx * adytail + ady * cdxtail - (cdy * adxtail + adx * cdytail)) + bdztail * (cdx * ady - cdy * adx) +\n cdz * (adx * bdytail + bdy * adxtail - (ady * bdxtail + bdx * adytail)) + cdztail * (adx * bdy - ady * bdx);\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n const at_len = tailinit(adxtail, adytail, bdx, bdy, cdx, cdy, at_b, at_c);\n const bt_len = tailinit(bdxtail, bdytail, cdx, cdy, adx, ady, bt_c, bt_a);\n const ct_len = tailinit(cdxtail, cdytail, adx, ady, bdx, bdy, ct_a, ct_b);\n\n const bctlen = sum(bt_len, bt_c, ct_len, ct_b, bct);\n finlen = finadd(finlen, scale(bctlen, bct, adz, _16), _16);\n\n const catlen = sum(ct_len, ct_a, at_len, at_c, cat);\n finlen = finadd(finlen, scale(catlen, cat, bdz, _16), _16);\n\n const abtlen = sum(at_len, at_b, bt_len, bt_a, abt);\n finlen = finadd(finlen, scale(abtlen, abt, cdz, _16), _16);\n\n if (adztail !== 0) {\n finlen = finadd(finlen, scale(4, bc, adztail, _12), _12);\n finlen = finadd(finlen, scale(bctlen, bct, adztail, _16), _16);\n }\n if (bdztail !== 0) {\n finlen = finadd(finlen, scale(4, ca, bdztail, _12), _12);\n finlen = finadd(finlen, scale(catlen, cat, bdztail, _16), _16);\n }\n if (cdztail !== 0) {\n finlen = finadd(finlen, scale(4, ab, cdztail, _12), _12);\n finlen = finadd(finlen, scale(abtlen, abt, cdztail, _16), _16);\n }\n\n if (adxtail !== 0) {\n if (bdytail !== 0) {\n finlen = tailadd(finlen, adxtail, bdytail, cdz, cdztail);\n }\n if (cdytail !== 0) {\n finlen = tailadd(finlen, -adxtail, cdytail, bdz, bdztail);\n }\n }\n if (bdxtail !== 0) {\n if (cdytail !== 0) {\n finlen = tailadd(finlen, bdxtail, cdytail, adz, adztail);\n }\n if (adytail !== 0) {\n finlen = tailadd(finlen, -bdxtail, adytail, cdz, cdztail);\n }\n }\n if (cdxtail !== 0) {\n if (adytail !== 0) {\n finlen = tailadd(finlen, cdxtail, adytail, bdz, bdztail);\n }\n if (bdytail !== 0) {\n finlen = tailadd(finlen, -cdxtail, bdytail, adz, adztail);\n }\n }\n\n return fin[finlen - 1];\n}\n\nexport function orient3d(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz) {\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n const adz = az - dz;\n const bdz = bz - dz;\n const cdz = cz - dz;\n\n const bdxcdy = bdx * cdy;\n const cdxbdy = cdx * bdy;\n\n const cdxady = cdx * ady;\n const adxcdy = adx * cdy;\n\n const adxbdy = adx * bdy;\n const bdxady = bdx * ady;\n\n const det =\n adz * (bdxcdy - cdxbdy) +\n bdz * (cdxady - adxcdy) +\n cdz * (adxbdy - bdxady);\n\n const permanent =\n (Math.abs(bdxcdy) + Math.abs(cdxbdy)) * Math.abs(adz) +\n (Math.abs(cdxady) + Math.abs(adxcdy)) * Math.abs(bdz) +\n (Math.abs(adxbdy) + Math.abs(bdxady)) * Math.abs(cdz);\n\n const errbound = o3derrboundA * permanent;\n if (det > errbound || -det > errbound) {\n return det;\n }\n\n return orient3dadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, permanent);\n}\n\nexport function orient3dfast(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz) {\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n const adz = az - dz;\n const bdz = bz - dz;\n const cdz = cz - dz;\n\n return adx * (bdy * cdz - bdz * cdy) +\n bdx * (cdy * adz - cdz * ady) +\n cdx * (ady * bdz - adz * bdy);\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum, sum_three, scale} from './util.js';\n\nconst iccerrboundA = (10 + 96 * epsilon) * epsilon;\nconst iccerrboundB = (4 + 48 * epsilon) * epsilon;\nconst iccerrboundC = (44 + 576 * epsilon) * epsilon * epsilon;\n\nconst bc = vec(4);\nconst ca = vec(4);\nconst ab = vec(4);\nconst aa = vec(4);\nconst bb = vec(4);\nconst cc = vec(4);\nconst u = vec(4);\nconst v = vec(4);\nconst axtbc = vec(8);\nconst aytbc = vec(8);\nconst bxtca = vec(8);\nconst bytca = vec(8);\nconst cxtab = vec(8);\nconst cytab = vec(8);\nconst abt = vec(8);\nconst bct = vec(8);\nconst cat = vec(8);\nconst abtt = vec(4);\nconst bctt = vec(4);\nconst catt = vec(4);\n\nconst _8 = vec(8);\nconst _16 = vec(16);\nconst _16b = vec(16);\nconst _16c = vec(16);\nconst _32 = vec(32);\nconst _32b = vec(32);\nconst _48 = vec(48);\nconst _64 = vec(64);\n\nlet fin = vec(1152);\nlet fin2 = vec(1152);\n\nfunction finadd(finlen, a, alen) {\n finlen = sum(finlen, fin, a, alen, fin2);\n const tmp = fin; fin = fin2; fin2 = tmp;\n return finlen;\n}\n\nfunction incircleadapt(ax, ay, bx, by, cx, cy, dx, dy, permanent) {\n let finlen;\n let adxtail, bdxtail, cdxtail, adytail, bdytail, cdytail;\n let axtbclen, aytbclen, bxtcalen, bytcalen, cxtablen, cytablen;\n let abtlen, bctlen, catlen;\n let abttlen, bcttlen, cattlen;\n let n1, n0;\n\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n\n s1 = bdx * cdy;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdx * bdy;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bc[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bc[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bc[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bc[3] = u3;\n s1 = cdx * ady;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adx * cdy;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ca[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ca[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ca[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ca[3] = u3;\n s1 = adx * bdy;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdx * ady;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ab[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ab[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ab[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ab[3] = u3;\n\n finlen = sum(\n sum(\n sum(\n scale(scale(4, bc, adx, _8), _8, adx, _16), _16,\n scale(scale(4, bc, ady, _8), _8, ady, _16b), _16b, _32), _32,\n sum(\n scale(scale(4, ca, bdx, _8), _8, bdx, _16), _16,\n scale(scale(4, ca, bdy, _8), _8, bdy, _16b), _16b, _32b), _32b, _64), _64,\n sum(\n scale(scale(4, ab, cdx, _8), _8, cdx, _16), _16,\n scale(scale(4, ab, cdy, _8), _8, cdy, _16b), _16b, _32), _32, fin);\n\n let det = estimate(finlen, fin);\n let errbound = iccerrboundB * permanent;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - adx;\n adxtail = ax - (adx + bvirt) + (bvirt - dx);\n bvirt = ay - ady;\n adytail = ay - (ady + bvirt) + (bvirt - dy);\n bvirt = bx - bdx;\n bdxtail = bx - (bdx + bvirt) + (bvirt - dx);\n bvirt = by - bdy;\n bdytail = by - (bdy + bvirt) + (bvirt - dy);\n bvirt = cx - cdx;\n cdxtail = cx - (cdx + bvirt) + (bvirt - dx);\n bvirt = cy - cdy;\n cdytail = cy - (cdy + bvirt) + (bvirt - dy);\n if (adxtail === 0 && bdxtail === 0 && cdxtail === 0 && adytail === 0 && bdytail === 0 && cdytail === 0) {\n return det;\n }\n\n errbound = iccerrboundC * permanent + resulterrbound * Math.abs(det);\n det += ((adx * adx + ady * ady) * ((bdx * cdytail + cdy * bdxtail) - (bdy * cdxtail + cdx * bdytail)) +\n 2 * (adx * adxtail + ady * adytail) * (bdx * cdy - bdy * cdx)) +\n ((bdx * bdx + bdy * bdy) * ((cdx * adytail + ady * cdxtail) - (cdy * adxtail + adx * cdytail)) +\n 2 * (bdx * bdxtail + bdy * bdytail) * (cdx * ady - cdy * adx)) +\n ((cdx * cdx + cdy * cdy) * ((adx * bdytail + bdy * adxtail) - (ady * bdxtail + bdx * adytail)) +\n 2 * (cdx * cdxtail + cdy * cdytail) * (adx * bdy - ady * bdx));\n\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n if (bdxtail !== 0 || bdytail !== 0 || cdxtail !== 0 || cdytail !== 0) {\n s1 = adx * adx;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n s0 = alo * alo - (s1 - ahi * ahi - (ahi + ahi) * alo);\n t1 = ady * ady;\n c = splitter * ady;\n ahi = c - (c - ady);\n alo = ady - ahi;\n t0 = alo * alo - (t1 - ahi * ahi - (ahi + ahi) * alo);\n _i = s0 + t0;\n bvirt = _i - s0;\n aa[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n aa[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n aa[2] = _j - (u3 - bvirt) + (_i - bvirt);\n aa[3] = u3;\n }\n if (cdxtail !== 0 || cdytail !== 0 || adxtail !== 0 || adytail !== 0) {\n s1 = bdx * bdx;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n s0 = alo * alo - (s1 - ahi * ahi - (ahi + ahi) * alo);\n t1 = bdy * bdy;\n c = splitter * bdy;\n ahi = c - (c - bdy);\n alo = bdy - ahi;\n t0 = alo * alo - (t1 - ahi * ahi - (ahi + ahi) * alo);\n _i = s0 + t0;\n bvirt = _i - s0;\n bb[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n bb[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bb[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bb[3] = u3;\n }\n if (adxtail !== 0 || adytail !== 0 || bdxtail !== 0 || bdytail !== 0) {\n s1 = cdx * cdx;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n s0 = alo * alo - (s1 - ahi * ahi - (ahi + ahi) * alo);\n t1 = cdy * cdy;\n c = splitter * cdy;\n ahi = c - (c - cdy);\n alo = cdy - ahi;\n t0 = alo * alo - (t1 - ahi * ahi - (ahi + ahi) * alo);\n _i = s0 + t0;\n bvirt = _i - s0;\n cc[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n cc[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n cc[2] = _j - (u3 - bvirt) + (_i - bvirt);\n cc[3] = u3;\n }\n\n if (adxtail !== 0) {\n axtbclen = scale(4, bc, adxtail, axtbc);\n finlen = finadd(finlen, sum_three(\n scale(axtbclen, axtbc, 2 * adx, _16), _16,\n scale(scale(4, cc, adxtail, _8), _8, bdy, _16b), _16b,\n scale(scale(4, bb, adxtail, _8), _8, -cdy, _16c), _16c, _32, _48), _48);\n }\n if (adytail !== 0) {\n aytbclen = scale(4, bc, adytail, aytbc);\n finlen = finadd(finlen, sum_three(\n scale(aytbclen, aytbc, 2 * ady, _16), _16,\n scale(scale(4, bb, adytail, _8), _8, cdx, _16b), _16b,\n scale(scale(4, cc, adytail, _8), _8, -bdx, _16c), _16c, _32, _48), _48);\n }\n if (bdxtail !== 0) {\n bxtcalen = scale(4, ca, bdxtail, bxtca);\n finlen = finadd(finlen, sum_three(\n scale(bxtcalen, bxtca, 2 * bdx, _16), _16,\n scale(scale(4, aa, bdxtail, _8), _8, cdy, _16b), _16b,\n scale(scale(4, cc, bdxtail, _8), _8, -ady, _16c), _16c, _32, _48), _48);\n }\n if (bdytail !== 0) {\n bytcalen = scale(4, ca, bdytail, bytca);\n finlen = finadd(finlen, sum_three(\n scale(bytcalen, bytca, 2 * bdy, _16), _16,\n scale(scale(4, cc, bdytail, _8), _8, adx, _16b), _16b,\n scale(scale(4, aa, bdytail, _8), _8, -cdx, _16c), _16c, _32, _48), _48);\n }\n if (cdxtail !== 0) {\n cxtablen = scale(4, ab, cdxtail, cxtab);\n finlen = finadd(finlen, sum_three(\n scale(cxtablen, cxtab, 2 * cdx, _16), _16,\n scale(scale(4, bb, cdxtail, _8), _8, ady, _16b), _16b,\n scale(scale(4, aa, cdxtail, _8), _8, -bdy, _16c), _16c, _32, _48), _48);\n }\n if (cdytail !== 0) {\n cytablen = scale(4, ab, cdytail, cytab);\n finlen = finadd(finlen, sum_three(\n scale(cytablen, cytab, 2 * cdy, _16), _16,\n scale(scale(4, aa, cdytail, _8), _8, bdx, _16b), _16b,\n scale(scale(4, bb, cdytail, _8), _8, -adx, _16c), _16c, _32, _48), _48);\n }\n\n if (adxtail !== 0 || adytail !== 0) {\n if (bdxtail !== 0 || bdytail !== 0 || cdxtail !== 0 || cdytail !== 0) {\n s1 = bdxtail * cdy;\n c = splitter * bdxtail;\n ahi = c - (c - bdxtail);\n alo = bdxtail - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdx * cdytail;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * cdytail;\n bhi = c - (c - cdytail);\n blo = cdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n u[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n u[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n s1 = cdxtail * -bdy;\n c = splitter * cdxtail;\n ahi = c - (c - cdxtail);\n alo = cdxtail - ahi;\n c = splitter * -bdy;\n bhi = c - (c - -bdy);\n blo = -bdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdx * -bdytail;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * -bdytail;\n bhi = c - (c - -bdytail);\n blo = -bdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n v[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n v[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n v[2] = _j - (u3 - bvirt) + (_i - bvirt);\n v[3] = u3;\n bctlen = sum(4, u, 4, v, bct);\n s1 = bdxtail * cdytail;\n c = splitter * bdxtail;\n ahi = c - (c - bdxtail);\n alo = bdxtail - ahi;\n c = splitter * cdytail;\n bhi = c - (c - cdytail);\n blo = cdytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdxtail * bdytail;\n c = splitter * cdxtail;\n ahi = c - (c - cdxtail);\n alo = cdxtail - ahi;\n c = splitter * bdytail;\n bhi = c - (c - bdytail);\n blo = bdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bctt[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bctt[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bctt[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bctt[3] = u3;\n bcttlen = 4;\n } else {\n bct[0] = 0;\n bctlen = 1;\n bctt[0] = 0;\n bcttlen = 1;\n }\n if (adxtail !== 0) {\n const len = scale(bctlen, bct, adxtail, _16c);\n finlen = finadd(finlen, sum(\n scale(axtbclen, axtbc, adxtail, _16), _16,\n scale(len, _16c, 2 * adx, _32), _32, _48), _48);\n\n const len2 = scale(bcttlen, bctt, adxtail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * adx, _16), _16,\n scale(len2, _8, adxtail, _16b), _16b,\n scale(len, _16c, adxtail, _32), _32, _32b, _64), _64);\n\n if (bdytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, cc, adxtail, _8), _8, bdytail, _16), _16);\n }\n if (cdytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, bb, -adxtail, _8), _8, cdytail, _16), _16);\n }\n }\n if (adytail !== 0) {\n const len = scale(bctlen, bct, adytail, _16c);\n finlen = finadd(finlen, sum(\n scale(aytbclen, aytbc, adytail, _16), _16,\n scale(len, _16c, 2 * ady, _32), _32, _48), _48);\n\n const len2 = scale(bcttlen, bctt, adytail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * ady, _16), _16,\n scale(len2, _8, adytail, _16b), _16b,\n scale(len, _16c, adytail, _32), _32, _32b, _64), _64);\n }\n }\n if (bdxtail !== 0 || bdytail !== 0) {\n if (cdxtail !== 0 || cdytail !== 0 || adxtail !== 0 || adytail !== 0) {\n s1 = cdxtail * ady;\n c = splitter * cdxtail;\n ahi = c - (c - cdxtail);\n alo = cdxtail - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdx * adytail;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * adytail;\n bhi = c - (c - adytail);\n blo = adytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n u[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n u[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n n1 = -cdy;\n n0 = -cdytail;\n s1 = adxtail * n1;\n c = splitter * adxtail;\n ahi = c - (c - adxtail);\n alo = adxtail - ahi;\n c = splitter * n1;\n bhi = c - (c - n1);\n blo = n1 - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adx * n0;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * n0;\n bhi = c - (c - n0);\n blo = n0 - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n v[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n v[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n v[2] = _j - (u3 - bvirt) + (_i - bvirt);\n v[3] = u3;\n catlen = sum(4, u, 4, v, cat);\n s1 = cdxtail * adytail;\n c = splitter * cdxtail;\n ahi = c - (c - cdxtail);\n alo = cdxtail - ahi;\n c = splitter * adytail;\n bhi = c - (c - adytail);\n blo = adytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adxtail * cdytail;\n c = splitter * adxtail;\n ahi = c - (c - adxtail);\n alo = adxtail - ahi;\n c = splitter * cdytail;\n bhi = c - (c - cdytail);\n blo = cdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n catt[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n catt[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n catt[2] = _j - (u3 - bvirt) + (_i - bvirt);\n catt[3] = u3;\n cattlen = 4;\n } else {\n cat[0] = 0;\n catlen = 1;\n catt[0] = 0;\n cattlen = 1;\n }\n if (bdxtail !== 0) {\n const len = scale(catlen, cat, bdxtail, _16c);\n finlen = finadd(finlen, sum(\n scale(bxtcalen, bxtca, bdxtail, _16), _16,\n scale(len, _16c, 2 * bdx, _32), _32, _48), _48);\n\n const len2 = scale(cattlen, catt, bdxtail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * bdx, _16), _16,\n scale(len2, _8, bdxtail, _16b), _16b,\n scale(len, _16c, bdxtail, _32), _32, _32b, _64), _64);\n\n if (cdytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, aa, bdxtail, _8), _8, cdytail, _16), _16);\n }\n if (adytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, cc, -bdxtail, _8), _8, adytail, _16), _16);\n }\n }\n if (bdytail !== 0) {\n const len = scale(catlen, cat, bdytail, _16c);\n finlen = finadd(finlen, sum(\n scale(bytcalen, bytca, bdytail, _16), _16,\n scale(len, _16c, 2 * bdy, _32), _32, _48), _48);\n\n const len2 = scale(cattlen, catt, bdytail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * bdy, _16), _16,\n scale(len2, _8, bdytail, _16b), _16b,\n scale(len, _16c, bdytail, _32), _32, _32b, _64), _64);\n }\n }\n if (cdxtail !== 0 || cdytail !== 0) {\n if (adxtail !== 0 || adytail !== 0 || bdxtail !== 0 || bdytail !== 0) {\n s1 = adxtail * bdy;\n c = splitter * adxtail;\n ahi = c - (c - adxtail);\n alo = adxtail - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adx * bdytail;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * bdytail;\n bhi = c - (c - bdytail);\n blo = bdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n u[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n u[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n n1 = -ady;\n n0 = -adytail;\n s1 = bdxtail * n1;\n c = splitter * bdxtail;\n ahi = c - (c - bdxtail);\n alo = bdxtail - ahi;\n c = splitter * n1;\n bhi = c - (c - n1);\n blo = n1 - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdx * n0;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * n0;\n bhi = c - (c - n0);\n blo = n0 - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n v[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n v[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n v[2] = _j - (u3 - bvirt) + (_i - bvirt);\n v[3] = u3;\n abtlen = sum(4, u, 4, v, abt);\n s1 = adxtail * bdytail;\n c = splitter * adxtail;\n ahi = c - (c - adxtail);\n alo = adxtail - ahi;\n c = splitter * bdytail;\n bhi = c - (c - bdytail);\n blo = bdytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdxtail * adytail;\n c = splitter * bdxtail;\n ahi = c - (c - bdxtail);\n alo = bdxtail - ahi;\n c = splitter * adytail;\n bhi = c - (c - adytail);\n blo = adytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n abtt[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n abtt[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n abtt[2] = _j - (u3 - bvirt) + (_i - bvirt);\n abtt[3] = u3;\n abttlen = 4;\n } else {\n abt[0] = 0;\n abtlen = 1;\n abtt[0] = 0;\n abttlen = 1;\n }\n if (cdxtail !== 0) {\n const len = scale(abtlen, abt, cdxtail, _16c);\n finlen = finadd(finlen, sum(\n scale(cxtablen, cxtab, cdxtail, _16), _16,\n scale(len, _16c, 2 * cdx, _32), _32, _48), _48);\n\n const len2 = scale(abttlen, abtt, cdxtail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * cdx, _16), _16,\n scale(len2, _8, cdxtail, _16b), _16b,\n scale(len, _16c, cdxtail, _32), _32, _32b, _64), _64);\n\n if (adytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, bb, cdxtail, _8), _8, adytail, _16), _16);\n }\n if (bdytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, aa, -cdxtail, _8), _8, bdytail, _16), _16);\n }\n }\n if (cdytail !== 0) {\n const len = scale(abtlen, abt, cdytail, _16c);\n finlen = finadd(finlen, sum(\n scale(cytablen, cytab, cdytail, _16), _16,\n scale(len, _16c, 2 * cdy, _32), _32, _48), _48);\n\n const len2 = scale(abttlen, abtt, cdytail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * cdy, _16), _16,\n scale(len2, _8, cdytail, _16b), _16b,\n scale(len, _16c, cdytail, _32), _32, _32b, _64), _64);\n }\n }\n\n return fin[finlen - 1];\n}\n\nexport function incircle(ax, ay, bx, by, cx, cy, dx, dy) {\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n\n const bdxcdy = bdx * cdy;\n const cdxbdy = cdx * bdy;\n const alift = adx * adx + ady * ady;\n\n const cdxady = cdx * ady;\n const adxcdy = adx * cdy;\n const blift = bdx * bdx + bdy * bdy;\n\n const adxbdy = adx * bdy;\n const bdxady = bdx * ady;\n const clift = cdx * cdx + cdy * cdy;\n\n const det =\n alift * (bdxcdy - cdxbdy) +\n blift * (cdxady - adxcdy) +\n clift * (adxbdy - bdxady);\n\n const permanent =\n (Math.abs(bdxcdy) + Math.abs(cdxbdy)) * alift +\n (Math.abs(cdxady) + Math.abs(adxcdy)) * blift +\n (Math.abs(adxbdy) + Math.abs(bdxady)) * clift;\n\n const errbound = iccerrboundA * permanent;\n\n if (det > errbound || -det > errbound) {\n return det;\n }\n return incircleadapt(ax, ay, bx, by, cx, cy, dx, dy, permanent);\n}\n\nexport function incirclefast(ax, ay, bx, by, cx, cy, dx, dy) {\n const adx = ax - dx;\n const ady = ay - dy;\n const bdx = bx - dx;\n const bdy = by - dy;\n const cdx = cx - dx;\n const cdy = cy - dy;\n\n const abdet = adx * bdy - bdx * ady;\n const bcdet = bdx * cdy - cdx * bdy;\n const cadet = cdx * ady - adx * cdy;\n const alift = adx * adx + ady * ady;\n const blift = bdx * bdx + bdy * bdy;\n const clift = cdx * cdx + cdy * cdy;\n\n return alift * bcdet + blift * cadet + clift * abdet;\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum, sum_three, scale, negate} from './util.js';\n\nconst isperrboundA = (16 + 224 * epsilon) * epsilon;\nconst isperrboundB = (5 + 72 * epsilon) * epsilon;\nconst isperrboundC = (71 + 1408 * epsilon) * epsilon * epsilon;\n\nconst ab = vec(4);\nconst bc = vec(4);\nconst cd = vec(4);\nconst de = vec(4);\nconst ea = vec(4);\nconst ac = vec(4);\nconst bd = vec(4);\nconst ce = vec(4);\nconst da = vec(4);\nconst eb = vec(4);\n\nconst abc = vec(24);\nconst bcd = vec(24);\nconst cde = vec(24);\nconst dea = vec(24);\nconst eab = vec(24);\nconst abd = vec(24);\nconst bce = vec(24);\nconst cda = vec(24);\nconst deb = vec(24);\nconst eac = vec(24);\n\nconst adet = vec(1152);\nconst bdet = vec(1152);\nconst cdet = vec(1152);\nconst ddet = vec(1152);\nconst edet = vec(1152);\nconst abdet = vec(2304);\nconst cddet = vec(2304);\nconst cdedet = vec(3456);\nconst deter = vec(5760);\n\nconst _8 = vec(8);\nconst _8b = vec(8);\nconst _8c = vec(8);\nconst _16 = vec(16);\nconst _24 = vec(24);\nconst _48 = vec(48);\nconst _48b = vec(48);\nconst _96 = vec(96);\nconst _192 = vec(192);\nconst _384x = vec(384);\nconst _384y = vec(384);\nconst _384z = vec(384);\nconst _768 = vec(768);\n\nfunction sum_three_scale(a, b, c, az, bz, cz, out) {\n return sum_three(\n scale(4, a, az, _8), _8,\n scale(4, b, bz, _8b), _8b,\n scale(4, c, cz, _8c), _8c, _16, out);\n}\n\nfunction liftexact(alen, a, blen, b, clen, c, dlen, d, x, y, z, out) {\n const len = sum(\n sum(alen, a, blen, b, _48), _48,\n negate(sum(clen, c, dlen, d, _48b), _48b), _48b, _96);\n\n return sum_three(\n scale(scale(len, _96, x, _192), _192, x, _384x), _384x,\n scale(scale(len, _96, y, _192), _192, y, _384y), _384y,\n scale(scale(len, _96, z, _192), _192, z, _384z), _384z, _768, out);\n}\n\nfunction insphereexact(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez) {\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n s1 = ax * by;\n c = splitter * ax;\n ahi = c - (c - ax);\n alo = ax - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bx * ay;\n c = splitter * bx;\n ahi = c - (c - bx);\n alo = bx - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ab[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ab[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ab[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ab[3] = u3;\n s1 = bx * cy;\n c = splitter * bx;\n ahi = c - (c - bx);\n alo = bx - ahi;\n c = splitter * cy;\n bhi = c - (c - cy);\n blo = cy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cx * by;\n c = splitter * cx;\n ahi = c - (c - cx);\n alo = cx - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bc[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bc[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bc[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bc[3] = u3;\n s1 = cx * dy;\n c = splitter * cx;\n ahi = c - (c - cx);\n alo = cx - ahi;\n c = splitter * dy;\n bhi = c - (c - dy);\n blo = dy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = dx * cy;\n c = splitter * dx;\n ahi = c - (c - dx);\n alo = dx - ahi;\n c = splitter * cy;\n bhi = c - (c - cy);\n blo = cy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n cd[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n cd[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n cd[2] = _j - (u3 - bvirt) + (_i - bvirt);\n cd[3] = u3;\n s1 = dx * ey;\n c = splitter * dx;\n ahi = c - (c - dx);\n alo = dx - ahi;\n c = splitter * ey;\n bhi = c - (c - ey);\n blo = ey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ex * dy;\n c = splitter * ex;\n ahi = c - (c - ex);\n alo = ex - ahi;\n c = splitter * dy;\n bhi = c - (c - dy);\n blo = dy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n de[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n de[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n de[2] = _j - (u3 - bvirt) + (_i - bvirt);\n de[3] = u3;\n s1 = ex * ay;\n c = splitter * ex;\n ahi = c - (c - ex);\n alo = ex - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ax * ey;\n c = splitter * ax;\n ahi = c - (c - ax);\n alo = ax - ahi;\n c = splitter * ey;\n bhi = c - (c - ey);\n blo = ey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ea[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ea[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ea[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ea[3] = u3;\n s1 = ax * cy;\n c = splitter * ax;\n ahi = c - (c - ax);\n alo = ax - ahi;\n c = splitter * cy;\n bhi = c - (c - cy);\n blo = cy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cx * ay;\n c = splitter * cx;\n ahi = c - (c - cx);\n alo = cx - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ac[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ac[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ac[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ac[3] = u3;\n s1 = bx * dy;\n c = splitter * bx;\n ahi = c - (c - bx);\n alo = bx - ahi;\n c = splitter * dy;\n bhi = c - (c - dy);\n blo = dy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = dx * by;\n c = splitter * dx;\n ahi = c - (c - dx);\n alo = dx - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bd[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bd[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bd[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bd[3] = u3;\n s1 = cx * ey;\n c = splitter * cx;\n ahi = c - (c - cx);\n alo = cx - ahi;\n c = splitter * ey;\n bhi = c - (c - ey);\n blo = ey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ex * cy;\n c = splitter * ex;\n ahi = c - (c - ex);\n alo = ex - ahi;\n c = splitter * cy;\n bhi = c - (c - cy);\n blo = cy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ce[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ce[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ce[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ce[3] = u3;\n s1 = dx * ay;\n c = splitter * dx;\n ahi = c - (c - dx);\n alo = dx - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ax * dy;\n c = splitter * ax;\n ahi = c - (c - ax);\n alo = ax - ahi;\n c = splitter * dy;\n bhi = c - (c - dy);\n blo = dy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n da[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n da[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n da[2] = _j - (u3 - bvirt) + (_i - bvirt);\n da[3] = u3;\n s1 = ex * by;\n c = splitter * ex;\n ahi = c - (c - ex);\n alo = ex - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bx * ey;\n c = splitter * bx;\n ahi = c - (c - bx);\n alo = bx - ahi;\n c = splitter * ey;\n bhi = c - (c - ey);\n blo = ey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n eb[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n eb[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n eb[2] = _j - (u3 - bvirt) + (_i - bvirt);\n eb[3] = u3;\n\n const abclen = sum_three_scale(ab, bc, ac, cz, az, -bz, abc);\n const bcdlen = sum_three_scale(bc, cd, bd, dz, bz, -cz, bcd);\n const cdelen = sum_three_scale(cd, de, ce, ez, cz, -dz, cde);\n const dealen = sum_three_scale(de, ea, da, az, dz, -ez, dea);\n const eablen = sum_three_scale(ea, ab, eb, bz, ez, -az, eab);\n const abdlen = sum_three_scale(ab, bd, da, dz, az, bz, abd);\n const bcelen = sum_three_scale(bc, ce, eb, ez, bz, cz, bce);\n const cdalen = sum_three_scale(cd, da, ac, az, cz, dz, cda);\n const deblen = sum_three_scale(de, eb, bd, bz, dz, ez, deb);\n const eaclen = sum_three_scale(ea, ac, ce, cz, ez, az, eac);\n\n const deterlen = sum_three(\n liftexact(cdelen, cde, bcelen, bce, deblen, deb, bcdlen, bcd, ax, ay, az, adet), adet,\n liftexact(dealen, dea, cdalen, cda, eaclen, eac, cdelen, cde, bx, by, bz, bdet), bdet,\n sum_three(\n liftexact(eablen, eab, deblen, deb, abdlen, abd, dealen, dea, cx, cy, cz, cdet), cdet,\n liftexact(abclen, abc, eaclen, eac, bcelen, bce, eablen, eab, dx, dy, dz, ddet), ddet,\n liftexact(bcdlen, bcd, abdlen, abd, cdalen, cda, abclen, abc, ex, ey, ez, edet), edet, cddet, cdedet), cdedet, abdet, deter);\n\n return deter[deterlen - 1];\n}\n\nconst xdet = vec(96);\nconst ydet = vec(96);\nconst zdet = vec(96);\nconst fin = vec(1152);\n\nfunction liftadapt(a, b, c, az, bz, cz, x, y, z, out) {\n const len = sum_three_scale(a, b, c, az, bz, cz, _24);\n return sum_three(\n scale(scale(len, _24, x, _48), _48, x, xdet), xdet,\n scale(scale(len, _24, y, _48), _48, y, ydet), ydet,\n scale(scale(len, _24, z, _48), _48, z, zdet), zdet, _192, out);\n}\n\nfunction insphereadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez, permanent) {\n let ab3, bc3, cd3, da3, ac3, bd3;\n\n let aextail, bextail, cextail, dextail;\n let aeytail, beytail, ceytail, deytail;\n let aeztail, beztail, ceztail, deztail;\n\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0;\n\n const aex = ax - ex;\n const bex = bx - ex;\n const cex = cx - ex;\n const dex = dx - ex;\n const aey = ay - ey;\n const bey = by - ey;\n const cey = cy - ey;\n const dey = dy - ey;\n const aez = az - ez;\n const bez = bz - ez;\n const cez = cz - ez;\n const dez = dz - ez;\n\n s1 = aex * bey;\n c = splitter * aex;\n ahi = c - (c - aex);\n alo = aex - ahi;\n c = splitter * bey;\n bhi = c - (c - bey);\n blo = bey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bex * aey;\n c = splitter * bex;\n ahi = c - (c - bex);\n alo = bex - ahi;\n c = splitter * aey;\n bhi = c - (c - aey);\n blo = aey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ab[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ab[1] = _0 - (_i + bvirt) + (bvirt - t1);\n ab3 = _j + _i;\n bvirt = ab3 - _j;\n ab[2] = _j - (ab3 - bvirt) + (_i - bvirt);\n ab[3] = ab3;\n s1 = bex * cey;\n c = splitter * bex;\n ahi = c - (c - bex);\n alo = bex - ahi;\n c = splitter * cey;\n bhi = c - (c - cey);\n blo = cey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cex * bey;\n c = splitter * cex;\n ahi = c - (c - cex);\n alo = cex - ahi;\n c = splitter * bey;\n bhi = c - (c - bey);\n blo = bey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bc[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bc[1] = _0 - (_i + bvirt) + (bvirt - t1);\n bc3 = _j + _i;\n bvirt = bc3 - _j;\n bc[2] = _j - (bc3 - bvirt) + (_i - bvirt);\n bc[3] = bc3;\n s1 = cex * dey;\n c = splitter * cex;\n ahi = c - (c - cex);\n alo = cex - ahi;\n c = splitter * dey;\n bhi = c - (c - dey);\n blo = dey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = dex * cey;\n c = splitter * dex;\n ahi = c - (c - dex);\n alo = dex - ahi;\n c = splitter * cey;\n bhi = c - (c - cey);\n blo = cey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n cd[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n cd[1] = _0 - (_i + bvirt) + (bvirt - t1);\n cd3 = _j + _i;\n bvirt = cd3 - _j;\n cd[2] = _j - (cd3 - bvirt) + (_i - bvirt);\n cd[3] = cd3;\n s1 = dex * aey;\n c = splitter * dex;\n ahi = c - (c - dex);\n alo = dex - ahi;\n c = splitter * aey;\n bhi = c - (c - aey);\n blo = aey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = aex * dey;\n c = splitter * aex;\n ahi = c - (c - aex);\n alo = aex - ahi;\n c = splitter * dey;\n bhi = c - (c - dey);\n blo = dey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n da[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n da[1] = _0 - (_i + bvirt) + (bvirt - t1);\n da3 = _j + _i;\n bvirt = da3 - _j;\n da[2] = _j - (da3 - bvirt) + (_i - bvirt);\n da[3] = da3;\n s1 = aex * cey;\n c = splitter * aex;\n ahi = c - (c - aex);\n alo = aex - ahi;\n c = splitter * cey;\n bhi = c - (c - cey);\n blo = cey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cex * aey;\n c = splitter * cex;\n ahi = c - (c - cex);\n alo = cex - ahi;\n c = splitter * aey;\n bhi = c - (c - aey);\n blo = aey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ac[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ac[1] = _0 - (_i + bvirt) + (bvirt - t1);\n ac3 = _j + _i;\n bvirt = ac3 - _j;\n ac[2] = _j - (ac3 - bvirt) + (_i - bvirt);\n ac[3] = ac3;\n s1 = bex * dey;\n c = splitter * bex;\n ahi = c - (c - bex);\n alo = bex - ahi;\n c = splitter * dey;\n bhi = c - (c - dey);\n blo = dey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = dex * bey;\n c = splitter * dex;\n ahi = c - (c - dex);\n alo = dex - ahi;\n c = splitter * bey;\n bhi = c - (c - bey);\n blo = bey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bd[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bd[1] = _0 - (_i + bvirt) + (bvirt - t1);\n bd3 = _j + _i;\n bvirt = bd3 - _j;\n bd[2] = _j - (bd3 - bvirt) + (_i - bvirt);\n bd[3] = bd3;\n\n const finlen = sum(\n sum(\n negate(liftadapt(bc, cd, bd, dez, bez, -cez, aex, aey, aez, adet), adet), adet,\n liftadapt(cd, da, ac, aez, cez, dez, bex, bey, bez, bdet), bdet, abdet), abdet,\n sum(\n negate(liftadapt(da, ab, bd, bez, dez, aez, cex, cey, cez, cdet), cdet), cdet,\n liftadapt(ab, bc, ac, cez, aez, -bez, dex, dey, dez, ddet), ddet, cddet), cddet, fin);\n\n let det = estimate(finlen, fin);\n let errbound = isperrboundB * permanent;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - aex;\n aextail = ax - (aex + bvirt) + (bvirt - ex);\n bvirt = ay - aey;\n aeytail = ay - (aey + bvirt) + (bvirt - ey);\n bvirt = az - aez;\n aeztail = az - (aez + bvirt) + (bvirt - ez);\n bvirt = bx - bex;\n bextail = bx - (bex + bvirt) + (bvirt - ex);\n bvirt = by - bey;\n beytail = by - (bey + bvirt) + (bvirt - ey);\n bvirt = bz - bez;\n beztail = bz - (bez + bvirt) + (bvirt - ez);\n bvirt = cx - cex;\n cextail = cx - (cex + bvirt) + (bvirt - ex);\n bvirt = cy - cey;\n ceytail = cy - (cey + bvirt) + (bvirt - ey);\n bvirt = cz - cez;\n ceztail = cz - (cez + bvirt) + (bvirt - ez);\n bvirt = dx - dex;\n dextail = dx - (dex + bvirt) + (bvirt - ex);\n bvirt = dy - dey;\n deytail = dy - (dey + bvirt) + (bvirt - ey);\n bvirt = dz - dez;\n deztail = dz - (dez + bvirt) + (bvirt - ez);\n if (aextail === 0 && aeytail === 0 && aeztail === 0 &&\n bextail === 0 && beytail === 0 && beztail === 0 &&\n cextail === 0 && ceytail === 0 && ceztail === 0 &&\n dextail === 0 && deytail === 0 && deztail === 0) {\n return det;\n }\n\n errbound = isperrboundC * permanent + resulterrbound * Math.abs(det);\n\n const abeps = (aex * beytail + bey * aextail) - (aey * bextail + bex * aeytail);\n const bceps = (bex * ceytail + cey * bextail) - (bey * cextail + cex * beytail);\n const cdeps = (cex * deytail + dey * cextail) - (cey * dextail + dex * ceytail);\n const daeps = (dex * aeytail + aey * dextail) - (dey * aextail + aex * deytail);\n const aceps = (aex * ceytail + cey * aextail) - (aey * cextail + cex * aeytail);\n const bdeps = (bex * deytail + dey * bextail) - (bey * dextail + dex * beytail);\n det +=\n (((bex * bex + bey * bey + bez * bez) * ((cez * daeps + dez * aceps + aez * cdeps) +\n (ceztail * da3 + deztail * ac3 + aeztail * cd3)) + (dex * dex + dey * dey + dez * dez) *\n ((aez * bceps - bez * aceps + cez * abeps) + (aeztail * bc3 - beztail * ac3 + ceztail * ab3))) -\n ((aex * aex + aey * aey + aez * aez) * ((bez * cdeps - cez * bdeps + dez * bceps) +\n (beztail * cd3 - ceztail * bd3 + deztail * bc3)) + (cex * cex + cey * cey + cez * cez) *\n ((dez * abeps + aez * bdeps + bez * daeps) + (deztail * ab3 + aeztail * bd3 + beztail * da3)))) +\n 2 * (((bex * bextail + bey * beytail + bez * beztail) * (cez * da3 + dez * ac3 + aez * cd3) +\n (dex * dextail + dey * deytail + dez * deztail) * (aez * bc3 - bez * ac3 + cez * ab3)) -\n ((aex * aextail + aey * aeytail + aez * aeztail) * (bez * cd3 - cez * bd3 + dez * bc3) +\n (cex * cextail + cey * ceytail + cez * ceztail) * (dez * ab3 + aez * bd3 + bez * da3)));\n\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n return insphereexact(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez);\n}\n\nexport function insphere(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez) {\n const aex = ax - ex;\n const bex = bx - ex;\n const cex = cx - ex;\n const dex = dx - ex;\n const aey = ay - ey;\n const bey = by - ey;\n const cey = cy - ey;\n const dey = dy - ey;\n const aez = az - ez;\n const bez = bz - ez;\n const cez = cz - ez;\n const dez = dz - ez;\n\n const aexbey = aex * bey;\n const bexaey = bex * aey;\n const ab = aexbey - bexaey;\n const bexcey = bex * cey;\n const cexbey = cex * bey;\n const bc = bexcey - cexbey;\n const cexdey = cex * dey;\n const dexcey = dex * cey;\n const cd = cexdey - dexcey;\n const dexaey = dex * aey;\n const aexdey = aex * dey;\n const da = dexaey - aexdey;\n const aexcey = aex * cey;\n const cexaey = cex * aey;\n const ac = aexcey - cexaey;\n const bexdey = bex * dey;\n const dexbey = dex * bey;\n const bd = bexdey - dexbey;\n\n const abc = aez * bc - bez * ac + cez * ab;\n const bcd = bez * cd - cez * bd + dez * bc;\n const cda = cez * da + dez * ac + aez * cd;\n const dab = dez * ab + aez * bd + bez * da;\n\n const alift = aex * aex + aey * aey + aez * aez;\n const blift = bex * bex + bey * bey + bez * bez;\n const clift = cex * cex + cey * cey + cez * cez;\n const dlift = dex * dex + dey * dey + dez * dez;\n\n const det = (clift * dab - dlift * abc) + (alift * bcd - blift * cda);\n\n const aezplus = Math.abs(aez);\n const bezplus = Math.abs(bez);\n const cezplus = Math.abs(cez);\n const dezplus = Math.abs(dez);\n const aexbeyplus = Math.abs(aexbey);\n const bexaeyplus = Math.abs(bexaey);\n const bexceyplus = Math.abs(bexcey);\n const cexbeyplus = Math.abs(cexbey);\n const cexdeyplus = Math.abs(cexdey);\n const dexceyplus = Math.abs(dexcey);\n const dexaeyplus = Math.abs(dexaey);\n const aexdeyplus = Math.abs(aexdey);\n const aexceyplus = Math.abs(aexcey);\n const cexaeyplus = Math.abs(cexaey);\n const bexdeyplus = Math.abs(bexdey);\n const dexbeyplus = Math.abs(dexbey);\n const permanent =\n ((cexdeyplus + dexceyplus) * bezplus + (dexbeyplus + bexdeyplus) * cezplus + (bexceyplus + cexbeyplus) * dezplus) * alift +\n ((dexaeyplus + aexdeyplus) * cezplus + (aexceyplus + cexaeyplus) * dezplus + (cexdeyplus + dexceyplus) * aezplus) * blift +\n ((aexbeyplus + bexaeyplus) * dezplus + (bexdeyplus + dexbeyplus) * aezplus + (dexaeyplus + aexdeyplus) * bezplus) * clift +\n ((bexceyplus + cexbeyplus) * aezplus + (cexaeyplus + aexceyplus) * bezplus + (aexbeyplus + bexaeyplus) * cezplus) * dlift;\n\n const errbound = isperrboundA * permanent;\n if (det > errbound || -det > errbound) {\n return det;\n }\n return -insphereadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez, permanent);\n}\n\nexport function inspherefast(pax, pay, paz, pbx, pby, pbz, pcx, pcy, pcz, pdx, pdy, pdz, pex, pey, pez) {\n const aex = pax - pex;\n const bex = pbx - pex;\n const cex = pcx - pex;\n const dex = pdx - pex;\n const aey = pay - pey;\n const bey = pby - pey;\n const cey = pcy - pey;\n const dey = pdy - pey;\n const aez = paz - pez;\n const bez = pbz - pez;\n const cez = pcz - pez;\n const dez = pdz - pez;\n\n const ab = aex * bey - bex * aey;\n const bc = bex * cey - cex * bey;\n const cd = cex * dey - dex * cey;\n const da = dex * aey - aex * dey;\n const ac = aex * cey - cex * aey;\n const bd = bex * dey - dex * bey;\n\n const abc = aez * bc - bez * ac + cez * ab;\n const bcd = bez * cd - cez * bd + dez * bc;\n const cda = cez * da + dez * ac + aez * cd;\n const dab = dez * ab + aez * bd + bez * da;\n\n const alift = aex * aex + aey * aey + aez * aez;\n const blift = bex * bex + bey * bey + bez * bez;\n const clift = cex * cex + cey * cey + cez * cez;\n const dlift = dex * dex + dey * dey + dez * dez;\n\n return (clift * dab - dlift * abc) + (alift * bcd - blift * cda);\n}\n","\nconst EPSILON = Math.pow(2, -52);\nconst EDGE_STACK = new Uint32Array(512);\n\nimport {orient2d} from 'robust-predicates';\n\nexport default class Delaunator {\n\n static from(points, getX = defaultGetX, getY = defaultGetY) {\n const n = points.length;\n const coords = new Float64Array(n * 2);\n\n for (let i = 0; i < n; i++) {\n const p = points[i];\n coords[2 * i] = getX(p);\n coords[2 * i + 1] = getY(p);\n }\n\n return new Delaunator(coords);\n }\n\n constructor(coords) {\n const n = coords.length >> 1;\n if (n > 0 && typeof coords[0] !== 'number') throw new Error('Expected coords to contain numbers.');\n\n this.coords = coords;\n\n // arrays that will store the triangulation graph\n const maxTriangles = Math.max(2 * n - 5, 0);\n this._triangles = new Uint32Array(maxTriangles * 3);\n this._halfedges = new Int32Array(maxTriangles * 3);\n\n // temporary arrays for tracking the edges of the advancing convex hull\n this._hashSize = Math.ceil(Math.sqrt(n));\n this._hullPrev = new Uint32Array(n); // edge to prev edge\n this._hullNext = new Uint32Array(n); // edge to next edge\n this._hullTri = new Uint32Array(n); // edge to adjacent triangle\n this._hullHash = new Int32Array(this._hashSize).fill(-1); // angular edge hash\n\n // temporary arrays for sorting points\n this._ids = new Uint32Array(n);\n this._dists = new Float64Array(n);\n\n this.update();\n }\n\n update() {\n const {coords, _hullPrev: hullPrev, _hullNext: hullNext, _hullTri: hullTri, _hullHash: hullHash} = this;\n const n = coords.length >> 1;\n\n // populate an array of point indices; calculate input data bbox\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n\n for (let i = 0; i < n; i++) {\n const x = coords[2 * i];\n const y = coords[2 * i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n this._ids[i] = i;\n }\n const cx = (minX + maxX) / 2;\n const cy = (minY + maxY) / 2;\n\n let minDist = Infinity;\n let i0, i1, i2;\n\n // pick a seed point close to the center\n for (let i = 0; i < n; i++) {\n const d = dist(cx, cy, coords[2 * i], coords[2 * i + 1]);\n if (d < minDist) {\n i0 = i;\n minDist = d;\n }\n }\n const i0x = coords[2 * i0];\n const i0y = coords[2 * i0 + 1];\n\n minDist = Infinity;\n\n // find the point closest to the seed\n for (let i = 0; i < n; i++) {\n if (i === i0) continue;\n const d = dist(i0x, i0y, coords[2 * i], coords[2 * i + 1]);\n if (d < minDist && d > 0) {\n i1 = i;\n minDist = d;\n }\n }\n let i1x = coords[2 * i1];\n let i1y = coords[2 * i1 + 1];\n\n let minRadius = Infinity;\n\n // find the third point which forms the smallest circumcircle with the first two\n for (let i = 0; i < n; i++) {\n if (i === i0 || i === i1) continue;\n const r = circumradius(i0x, i0y, i1x, i1y, coords[2 * i], coords[2 * i + 1]);\n if (r < minRadius) {\n i2 = i;\n minRadius = r;\n }\n }\n let i2x = coords[2 * i2];\n let i2y = coords[2 * i2 + 1];\n\n if (minRadius === Infinity) {\n // order collinear points by dx (or dy if all x are identical)\n // and return the list as a hull\n for (let i = 0; i < n; i++) {\n this._dists[i] = (coords[2 * i] - coords[0]) || (coords[2 * i + 1] - coords[1]);\n }\n quicksort(this._ids, this._dists, 0, n - 1);\n const hull = new Uint32Array(n);\n let j = 0;\n for (let i = 0, d0 = -Infinity; i < n; i++) {\n const id = this._ids[i];\n if (this._dists[id] > d0) {\n hull[j++] = id;\n d0 = this._dists[id];\n }\n }\n this.hull = hull.subarray(0, j);\n this.triangles = new Uint32Array(0);\n this.halfedges = new Uint32Array(0);\n return;\n }\n\n // swap the order of the seed points for counter-clockwise orientation\n if (orient2d(i0x, i0y, i1x, i1y, i2x, i2y) < 0) {\n const i = i1;\n const x = i1x;\n const y = i1y;\n i1 = i2;\n i1x = i2x;\n i1y = i2y;\n i2 = i;\n i2x = x;\n i2y = y;\n }\n\n const center = circumcenter(i0x, i0y, i1x, i1y, i2x, i2y);\n this._cx = center.x;\n this._cy = center.y;\n\n for (let i = 0; i < n; i++) {\n this._dists[i] = dist(coords[2 * i], coords[2 * i + 1], center.x, center.y);\n }\n\n // sort the points by distance from the seed triangle circumcenter\n quicksort(this._ids, this._dists, 0, n - 1);\n\n // set up the seed triangle as the starting hull\n this._hullStart = i0;\n let hullSize = 3;\n\n hullNext[i0] = hullPrev[i2] = i1;\n hullNext[i1] = hullPrev[i0] = i2;\n hullNext[i2] = hullPrev[i1] = i0;\n\n hullTri[i0] = 0;\n hullTri[i1] = 1;\n hullTri[i2] = 2;\n\n hullHash.fill(-1);\n hullHash[this._hashKey(i0x, i0y)] = i0;\n hullHash[this._hashKey(i1x, i1y)] = i1;\n hullHash[this._hashKey(i2x, i2y)] = i2;\n\n this.trianglesLen = 0;\n this._addTriangle(i0, i1, i2, -1, -1, -1);\n\n for (let k = 0, xp, yp; k < this._ids.length; k++) {\n const i = this._ids[k];\n const x = coords[2 * i];\n const y = coords[2 * i + 1];\n\n // skip near-duplicate points\n if (k > 0 && Math.abs(x - xp) <= EPSILON && Math.abs(y - yp) <= EPSILON) continue;\n xp = x;\n yp = y;\n\n // skip seed triangle points\n if (i === i0 || i === i1 || i === i2) continue;\n\n // find a visible edge on the convex hull using edge hash\n let start = 0;\n for (let j = 0, key = this._hashKey(x, y); j < this._hashSize; j++) {\n start = hullHash[(key + j) % this._hashSize];\n if (start !== -1 && start !== hullNext[start]) break;\n }\n\n start = hullPrev[start];\n let e = start, q;\n while (q = hullNext[e], orient2d(x, y, coords[2 * e], coords[2 * e + 1], coords[2 * q], coords[2 * q + 1]) >= 0) {\n e = q;\n if (e === start) {\n e = -1;\n break;\n }\n }\n if (e === -1) continue; // likely a near-duplicate point; skip it\n\n // add the first triangle from the point\n let t = this._addTriangle(e, i, hullNext[e], -1, -1, hullTri[e]);\n\n // recursively flip triangles from the point until they satisfy the Delaunay condition\n hullTri[i] = this._legalize(t + 2);\n hullTri[e] = t; // keep track of boundary triangles on the hull\n hullSize++;\n\n // walk forward through the hull, adding more triangles and flipping recursively\n let n = hullNext[e];\n while (q = hullNext[n], orient2d(x, y, coords[2 * n], coords[2 * n + 1], coords[2 * q], coords[2 * q + 1]) < 0) {\n t = this._addTriangle(n, i, q, hullTri[i], -1, hullTri[n]);\n hullTri[i] = this._legalize(t + 2);\n hullNext[n] = n; // mark as removed\n hullSize--;\n n = q;\n }\n\n // walk backward from the other side, adding more triangles and flipping\n if (e === start) {\n while (q = hullPrev[e], orient2d(x, y, coords[2 * q], coords[2 * q + 1], coords[2 * e], coords[2 * e + 1]) < 0) {\n t = this._addTriangle(q, i, e, -1, hullTri[e], hullTri[q]);\n this._legalize(t + 2);\n hullTri[q] = t;\n hullNext[e] = e; // mark as removed\n hullSize--;\n e = q;\n }\n }\n\n // update the hull indices\n this._hullStart = hullPrev[i] = e;\n hullNext[e] = hullPrev[n] = i;\n hullNext[i] = n;\n\n // save the two new edges in the hash table\n hullHash[this._hashKey(x, y)] = i;\n hullHash[this._hashKey(coords[2 * e], coords[2 * e + 1])] = e;\n }\n\n this.hull = new Uint32Array(hullSize);\n for (let i = 0, e = this._hullStart; i < hullSize; i++) {\n this.hull[i] = e;\n e = hullNext[e];\n }\n\n // trim typed triangle mesh arrays\n this.triangles = this._triangles.subarray(0, this.trianglesLen);\n this.halfedges = this._halfedges.subarray(0, this.trianglesLen);\n }\n\n _hashKey(x, y) {\n return Math.floor(pseudoAngle(x - this._cx, y - this._cy) * this._hashSize) % this._hashSize;\n }\n\n _legalize(a) {\n const {_triangles: triangles, _halfedges: halfedges, coords} = this;\n\n let i = 0;\n let ar = 0;\n\n // recursion eliminated with a fixed-size stack\n while (true) {\n const b = halfedges[a];\n\n /* if the pair of triangles doesn't satisfy the Delaunay condition\n * (p1 is inside the circumcircle of [p0, pl, pr]), flip them,\n * then do the same check/flip recursively for the new pair of triangles\n *\n * pl pl\n * /||\\ / \\\n * al/ || \\bl al/ \\a\n * / || \\ / \\\n * / a||b \\ flip /___ar___\\\n * p0\\ || /p1 => p0\\---bl---/p1\n * \\ || / \\ /\n * ar\\ || /br b\\ /br\n * \\||/ \\ /\n * pr pr\n */\n const a0 = a - a % 3;\n ar = a0 + (a + 2) % 3;\n\n if (b === -1) { // convex hull edge\n if (i === 0) break;\n a = EDGE_STACK[--i];\n continue;\n }\n\n const b0 = b - b % 3;\n const al = a0 + (a + 1) % 3;\n const bl = b0 + (b + 2) % 3;\n\n const p0 = triangles[ar];\n const pr = triangles[a];\n const pl = triangles[al];\n const p1 = triangles[bl];\n\n const illegal = inCircle(\n coords[2 * p0], coords[2 * p0 + 1],\n coords[2 * pr], coords[2 * pr + 1],\n coords[2 * pl], coords[2 * pl + 1],\n coords[2 * p1], coords[2 * p1 + 1]);\n\n if (illegal) {\n triangles[a] = p1;\n triangles[b] = p0;\n\n const hbl = halfedges[bl];\n\n // edge swapped on the other side of the hull (rare); fix the halfedge reference\n if (hbl === -1) {\n let e = this._hullStart;\n do {\n if (this._hullTri[e] === bl) {\n this._hullTri[e] = a;\n break;\n }\n e = this._hullPrev[e];\n } while (e !== this._hullStart);\n }\n this._link(a, hbl);\n this._link(b, halfedges[ar]);\n this._link(ar, bl);\n\n const br = b0 + (b + 1) % 3;\n\n // don't worry about hitting the cap: it can only happen on extremely degenerate input\n if (i < EDGE_STACK.length) {\n EDGE_STACK[i++] = br;\n }\n } else {\n if (i === 0) break;\n a = EDGE_STACK[--i];\n }\n }\n\n return ar;\n }\n\n _link(a, b) {\n this._halfedges[a] = b;\n if (b !== -1) this._halfedges[b] = a;\n }\n\n // add a new triangle given vertex indices and adjacent half-edge ids\n _addTriangle(i0, i1, i2, a, b, c) {\n const t = this.trianglesLen;\n\n this._triangles[t] = i0;\n this._triangles[t + 1] = i1;\n this._triangles[t + 2] = i2;\n\n this._link(t, a);\n this._link(t + 1, b);\n this._link(t + 2, c);\n\n this.trianglesLen += 3;\n\n return t;\n }\n}\n\n// monotonically increases with real angle, but doesn't need expensive trigonometry\nfunction pseudoAngle(dx, dy) {\n const p = dx / (Math.abs(dx) + Math.abs(dy));\n return (dy > 0 ? 3 - p : 1 + p) / 4; // [0..1]\n}\n\nfunction dist(ax, ay, bx, by) {\n const dx = ax - bx;\n const dy = ay - by;\n return dx * dx + dy * dy;\n}\n\nfunction inCircle(ax, ay, bx, by, cx, cy, px, py) {\n const dx = ax - px;\n const dy = ay - py;\n const ex = bx - px;\n const ey = by - py;\n const fx = cx - px;\n const fy = cy - py;\n\n const ap = dx * dx + dy * dy;\n const bp = ex * ex + ey * ey;\n const cp = fx * fx + fy * fy;\n\n return dx * (ey * cp - bp * fy) -\n dy * (ex * cp - bp * fx) +\n ap * (ex * fy - ey * fx) < 0;\n}\n\nfunction circumradius(ax, ay, bx, by, cx, cy) {\n const dx = bx - ax;\n const dy = by - ay;\n const ex = cx - ax;\n const ey = cy - ay;\n\n const bl = dx * dx + dy * dy;\n const cl = ex * ex + ey * ey;\n const d = 0.5 / (dx * ey - dy * ex);\n\n const x = (ey * bl - dy * cl) * d;\n const y = (dx * cl - ex * bl) * d;\n\n return x * x + y * y;\n}\n\nfunction circumcenter(ax, ay, bx, by, cx, cy) {\n const dx = bx - ax;\n const dy = by - ay;\n const ex = cx - ax;\n const ey = cy - ay;\n\n const bl = dx * dx + dy * dy;\n const cl = ex * ex + ey * ey;\n const d = 0.5 / (dx * ey - dy * ex);\n\n const x = ax + (ey * bl - dy * cl) * d;\n const y = ay + (dx * cl - ex * bl) * d;\n\n return {x, y};\n}\n\nfunction quicksort(ids, dists, left, right) {\n if (right - left <= 20) {\n for (let i = left + 1; i <= right; i++) {\n const temp = ids[i];\n const tempDist = dists[temp];\n let j = i - 1;\n while (j >= left && dists[ids[j]] > tempDist) ids[j + 1] = ids[j--];\n ids[j + 1] = temp;\n }\n } else {\n const median = (left + right) >> 1;\n let i = left + 1;\n let j = right;\n swap(ids, median, i);\n if (dists[ids[left]] > dists[ids[right]]) swap(ids, left, right);\n if (dists[ids[i]] > dists[ids[right]]) swap(ids, i, right);\n if (dists[ids[left]] > dists[ids[i]]) swap(ids, left, i);\n\n const temp = ids[i];\n const tempDist = dists[temp];\n while (true) {\n do i++; while (dists[ids[i]] < tempDist);\n do j--; while (dists[ids[j]] > tempDist);\n if (j < i) break;\n swap(ids, i, j);\n }\n ids[left + 1] = ids[j];\n ids[j] = temp;\n\n if (right - i + 1 >= j - left) {\n quicksort(ids, dists, i, right);\n quicksort(ids, dists, left, j - 1);\n } else {\n quicksort(ids, dists, left, j - 1);\n quicksort(ids, dists, i, right);\n }\n }\n}\n\nfunction swap(arr, i, j) {\n const tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\nfunction defaultGetX(p) {\n return p[0];\n}\nfunction defaultGetY(p) {\n return p[1];\n}\n","const epsilon = 1e-6;\n\nexport default class Path {\n constructor() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n }\n moveTo(x, y) {\n this._ += `M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n }\n lineTo(x, y) {\n this._ += `L${this._x1 = +x},${this._y1 = +y}`;\n }\n arc(x, y, r) {\n x = +x, y = +y, r = +r;\n const x0 = x + r;\n const y0 = y;\n if (r < 0) throw new Error(\"negative radius\");\n if (this._x1 === null) this._ += `M${x0},${y0}`;\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) this._ += \"L\" + x0 + \",\" + y0;\n if (!r) return;\n this._ += `A${r},${r},0,1,1,${x - r},${y}A${r},${r},0,1,1,${this._x1 = x0},${this._y1 = y0}`;\n }\n rect(x, y, w, h) {\n this._ += `M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${+w}v${+h}h${-w}Z`;\n }\n value() {\n return this._ || null;\n }\n}\n","export default class Polygon {\n constructor() {\n this._ = [];\n }\n moveTo(x, y) {\n this._.push([x, y]);\n }\n closePath() {\n this._.push(this._[0].slice());\n }\n lineTo(x, y) {\n this._.push([x, y]);\n }\n value() {\n return this._.length ? this._ : null;\n }\n}\n","import Path from \"./path.js\";\nimport Polygon from \"./polygon.js\";\n\nexport default class Voronoi {\n constructor(delaunay, [xmin, ymin, xmax, ymax] = [0, 0, 960, 500]) {\n if (!((xmax = +xmax) >= (xmin = +xmin)) || !((ymax = +ymax) >= (ymin = +ymin))) throw new Error(\"invalid bounds\");\n this.delaunay = delaunay;\n this._circumcenters = new Float64Array(delaunay.points.length * 2);\n this.vectors = new Float64Array(delaunay.points.length * 2);\n this.xmax = xmax, this.xmin = xmin;\n this.ymax = ymax, this.ymin = ymin;\n this._init();\n }\n update() {\n this.delaunay.update();\n this._init();\n return this;\n }\n _init() {\n const {delaunay: {points, hull, triangles}, vectors} = this;\n let bx, by; // lazily computed barycenter of the hull\n\n // Compute circumcenters.\n const circumcenters = this.circumcenters = this._circumcenters.subarray(0, triangles.length / 3 * 2);\n for (let i = 0, j = 0, n = triangles.length, x, y; i < n; i += 3, j += 2) {\n const t1 = triangles[i] * 2;\n const t2 = triangles[i + 1] * 2;\n const t3 = triangles[i + 2] * 2;\n const x1 = points[t1];\n const y1 = points[t1 + 1];\n const x2 = points[t2];\n const y2 = points[t2 + 1];\n const x3 = points[t3];\n const y3 = points[t3 + 1];\n\n const dx = x2 - x1;\n const dy = y2 - y1;\n const ex = x3 - x1;\n const ey = y3 - y1;\n const ab = (dx * ey - dy * ex) * 2;\n\n if (Math.abs(ab) < 1e-9) {\n // For a degenerate triangle, the circumcenter is at the infinity, in a\n // direction orthogonal to the halfedge and away from the “center” of\n // the diagram , defined as the hull’s barycenter.\n if (bx === undefined) {\n bx = by = 0;\n for (const i of hull) bx += points[i * 2], by += points[i * 2 + 1];\n bx /= hull.length, by /= hull.length;\n }\n const a = 1e9 * Math.sign((bx - x1) * ey - (by - y1) * ex);\n x = (x1 + x3) / 2 - a * ey;\n y = (y1 + y3) / 2 + a * ex;\n } else {\n const d = 1 / ab;\n const bl = dx * dx + dy * dy;\n const cl = ex * ex + ey * ey;\n x = x1 + (ey * bl - dy * cl) * d;\n y = y1 + (dx * cl - ex * bl) * d;\n }\n circumcenters[j] = x;\n circumcenters[j + 1] = y;\n }\n\n // Compute exterior cell rays.\n let h = hull[hull.length - 1];\n let p0, p1 = h * 4;\n let x0, x1 = points[2 * h];\n let y0, y1 = points[2 * h + 1];\n vectors.fill(0);\n for (let i = 0; i < hull.length; ++i) {\n h = hull[i];\n p0 = p1, x0 = x1, y0 = y1;\n p1 = h * 4, x1 = points[2 * h], y1 = points[2 * h + 1];\n vectors[p0 + 2] = vectors[p1] = y0 - y1;\n vectors[p0 + 3] = vectors[p1 + 1] = x1 - x0;\n }\n }\n render(context) {\n const buffer = context == null ? context = new Path : undefined;\n const {delaunay: {halfedges, inedges, hull}, circumcenters, vectors} = this;\n if (hull.length <= 1) return null;\n for (let i = 0, n = halfedges.length; i < n; ++i) {\n const j = halfedges[i];\n if (j < i) continue;\n const ti = Math.floor(i / 3) * 2;\n const tj = Math.floor(j / 3) * 2;\n const xi = circumcenters[ti];\n const yi = circumcenters[ti + 1];\n const xj = circumcenters[tj];\n const yj = circumcenters[tj + 1];\n this._renderSegment(xi, yi, xj, yj, context);\n }\n let h0, h1 = hull[hull.length - 1];\n for (let i = 0; i < hull.length; ++i) {\n h0 = h1, h1 = hull[i];\n const t = Math.floor(inedges[h1] / 3) * 2;\n const x = circumcenters[t];\n const y = circumcenters[t + 1];\n const v = h0 * 4;\n const p = this._project(x, y, vectors[v + 2], vectors[v + 3]);\n if (p) this._renderSegment(x, y, p[0], p[1], context);\n }\n return buffer && buffer.value();\n }\n renderBounds(context) {\n const buffer = context == null ? context = new Path : undefined;\n context.rect(this.xmin, this.ymin, this.xmax - this.xmin, this.ymax - this.ymin);\n return buffer && buffer.value();\n }\n renderCell(i, context) {\n const buffer = context == null ? context = new Path : undefined;\n const points = this._clip(i);\n if (points === null || !points.length) return;\n context.moveTo(points[0], points[1]);\n let n = points.length;\n while (points[0] === points[n-2] && points[1] === points[n-1] && n > 1) n -= 2;\n for (let i = 2; i < n; i += 2) {\n if (points[i] !== points[i-2] || points[i+1] !== points[i-1])\n context.lineTo(points[i], points[i + 1]);\n }\n context.closePath();\n return buffer && buffer.value();\n }\n *cellPolygons() {\n const {delaunay: {points}} = this;\n for (let i = 0, n = points.length / 2; i < n; ++i) {\n const cell = this.cellPolygon(i);\n if (cell) cell.index = i, yield cell;\n }\n }\n cellPolygon(i) {\n const polygon = new Polygon;\n this.renderCell(i, polygon);\n return polygon.value();\n }\n _renderSegment(x0, y0, x1, y1, context) {\n let S;\n const c0 = this._regioncode(x0, y0);\n const c1 = this._regioncode(x1, y1);\n if (c0 === 0 && c1 === 0) {\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n } else if (S = this._clipSegment(x0, y0, x1, y1, c0, c1)) {\n context.moveTo(S[0], S[1]);\n context.lineTo(S[2], S[3]);\n }\n }\n contains(i, x, y) {\n if ((x = +x, x !== x) || (y = +y, y !== y)) return false;\n return this.delaunay._step(i, x, y) === i;\n }\n *neighbors(i) {\n const ci = this._clip(i);\n if (ci) for (const j of this.delaunay.neighbors(i)) {\n const cj = this._clip(j);\n // find the common edge\n if (cj) loop: for (let ai = 0, li = ci.length; ai < li; ai += 2) {\n for (let aj = 0, lj = cj.length; aj < lj; aj += 2) {\n if (ci[ai] === cj[aj]\n && ci[ai + 1] === cj[aj + 1]\n && ci[(ai + 2) % li] === cj[(aj + lj - 2) % lj]\n && ci[(ai + 3) % li] === cj[(aj + lj - 1) % lj]) {\n yield j;\n break loop;\n }\n }\n }\n }\n }\n _cell(i) {\n const {circumcenters, delaunay: {inedges, halfedges, triangles}} = this;\n const e0 = inedges[i];\n if (e0 === -1) return null; // coincident point\n const points = [];\n let e = e0;\n do {\n const t = Math.floor(e / 3);\n points.push(circumcenters[t * 2], circumcenters[t * 2 + 1]);\n e = e % 3 === 2 ? e - 2 : e + 1;\n if (triangles[e] !== i) break; // bad triangulation\n e = halfedges[e];\n } while (e !== e0 && e !== -1);\n return points;\n }\n _clip(i) {\n // degenerate case (1 valid point: return the box)\n if (i === 0 && this.delaunay.hull.length === 1) {\n return [this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax, this.xmin, this.ymin];\n }\n const points = this._cell(i);\n if (points === null) return null;\n const {vectors: V} = this;\n const v = i * 4;\n return this._simplify(V[v] || V[v + 1]\n ? this._clipInfinite(i, points, V[v], V[v + 1], V[v + 2], V[v + 3])\n : this._clipFinite(i, points));\n }\n _clipFinite(i, points) {\n const n = points.length;\n let P = null;\n let x0, y0, x1 = points[n - 2], y1 = points[n - 1];\n let c0, c1 = this._regioncode(x1, y1);\n let e0, e1 = 0;\n for (let j = 0; j < n; j += 2) {\n x0 = x1, y0 = y1, x1 = points[j], y1 = points[j + 1];\n c0 = c1, c1 = this._regioncode(x1, y1);\n if (c0 === 0 && c1 === 0) {\n e0 = e1, e1 = 0;\n if (P) P.push(x1, y1);\n else P = [x1, y1];\n } else {\n let S, sx0, sy0, sx1, sy1;\n if (c0 === 0) {\n if ((S = this._clipSegment(x0, y0, x1, y1, c0, c1)) === null) continue;\n [sx0, sy0, sx1, sy1] = S;\n } else {\n if ((S = this._clipSegment(x1, y1, x0, y0, c1, c0)) === null) continue;\n [sx1, sy1, sx0, sy0] = S;\n e0 = e1, e1 = this._edgecode(sx0, sy0);\n if (e0 && e1) this._edge(i, e0, e1, P, P.length);\n if (P) P.push(sx0, sy0);\n else P = [sx0, sy0];\n }\n e0 = e1, e1 = this._edgecode(sx1, sy1);\n if (e0 && e1) this._edge(i, e0, e1, P, P.length);\n if (P) P.push(sx1, sy1);\n else P = [sx1, sy1];\n }\n }\n if (P) {\n e0 = e1, e1 = this._edgecode(P[0], P[1]);\n if (e0 && e1) this._edge(i, e0, e1, P, P.length);\n } else if (this.contains(i, (this.xmin + this.xmax) / 2, (this.ymin + this.ymax) / 2)) {\n return [this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax, this.xmin, this.ymin];\n }\n return P;\n }\n _clipSegment(x0, y0, x1, y1, c0, c1) {\n // for more robustness, always consider the segment in the same order\n const flip = c0 < c1;\n if (flip) [x0, y0, x1, y1, c0, c1] = [x1, y1, x0, y0, c1, c0];\n while (true) {\n if (c0 === 0 && c1 === 0) return flip ? [x1, y1, x0, y0] : [x0, y0, x1, y1];\n if (c0 & c1) return null;\n let x, y, c = c0 || c1;\n if (c & 0b1000) x = x0 + (x1 - x0) * (this.ymax - y0) / (y1 - y0), y = this.ymax;\n else if (c & 0b0100) x = x0 + (x1 - x0) * (this.ymin - y0) / (y1 - y0), y = this.ymin;\n else if (c & 0b0010) y = y0 + (y1 - y0) * (this.xmax - x0) / (x1 - x0), x = this.xmax;\n else y = y0 + (y1 - y0) * (this.xmin - x0) / (x1 - x0), x = this.xmin;\n if (c0) x0 = x, y0 = y, c0 = this._regioncode(x0, y0);\n else x1 = x, y1 = y, c1 = this._regioncode(x1, y1);\n }\n }\n _clipInfinite(i, points, vx0, vy0, vxn, vyn) {\n let P = Array.from(points), p;\n if (p = this._project(P[0], P[1], vx0, vy0)) P.unshift(p[0], p[1]);\n if (p = this._project(P[P.length - 2], P[P.length - 1], vxn, vyn)) P.push(p[0], p[1]);\n if (P = this._clipFinite(i, P)) {\n for (let j = 0, n = P.length, c0, c1 = this._edgecode(P[n - 2], P[n - 1]); j < n; j += 2) {\n c0 = c1, c1 = this._edgecode(P[j], P[j + 1]);\n if (c0 && c1) j = this._edge(i, c0, c1, P, j), n = P.length;\n }\n } else if (this.contains(i, (this.xmin + this.xmax) / 2, (this.ymin + this.ymax) / 2)) {\n P = [this.xmin, this.ymin, this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax];\n }\n return P;\n }\n _edge(i, e0, e1, P, j) {\n while (e0 !== e1) {\n let x, y;\n switch (e0) {\n case 0b0101: e0 = 0b0100; continue; // top-left\n case 0b0100: e0 = 0b0110, x = this.xmax, y = this.ymin; break; // top\n case 0b0110: e0 = 0b0010; continue; // top-right\n case 0b0010: e0 = 0b1010, x = this.xmax, y = this.ymax; break; // right\n case 0b1010: e0 = 0b1000; continue; // bottom-right\n case 0b1000: e0 = 0b1001, x = this.xmin, y = this.ymax; break; // bottom\n case 0b1001: e0 = 0b0001; continue; // bottom-left\n case 0b0001: e0 = 0b0101, x = this.xmin, y = this.ymin; break; // left\n }\n // Note: this implicitly checks for out of bounds: if P[j] or P[j+1] are\n // undefined, the conditional statement will be executed.\n if ((P[j] !== x || P[j + 1] !== y) && this.contains(i, x, y)) {\n P.splice(j, 0, x, y), j += 2;\n }\n }\n return j;\n }\n _project(x0, y0, vx, vy) {\n let t = Infinity, c, x, y;\n if (vy < 0) { // top\n if (y0 <= this.ymin) return null;\n if ((c = (this.ymin - y0) / vy) < t) y = this.ymin, x = x0 + (t = c) * vx;\n } else if (vy > 0) { // bottom\n if (y0 >= this.ymax) return null;\n if ((c = (this.ymax - y0) / vy) < t) y = this.ymax, x = x0 + (t = c) * vx;\n }\n if (vx > 0) { // right\n if (x0 >= this.xmax) return null;\n if ((c = (this.xmax - x0) / vx) < t) x = this.xmax, y = y0 + (t = c) * vy;\n } else if (vx < 0) { // left\n if (x0 <= this.xmin) return null;\n if ((c = (this.xmin - x0) / vx) < t) x = this.xmin, y = y0 + (t = c) * vy;\n }\n return [x, y];\n }\n _edgecode(x, y) {\n return (x === this.xmin ? 0b0001\n : x === this.xmax ? 0b0010 : 0b0000)\n | (y === this.ymin ? 0b0100\n : y === this.ymax ? 0b1000 : 0b0000);\n }\n _regioncode(x, y) {\n return (x < this.xmin ? 0b0001\n : x > this.xmax ? 0b0010 : 0b0000)\n | (y < this.ymin ? 0b0100\n : y > this.ymax ? 0b1000 : 0b0000);\n }\n _simplify(P) {\n if (P && P.length > 4) {\n for (let i = 0; i < P.length; i+= 2) {\n const j = (i + 2) % P.length, k = (i + 4) % P.length;\n if (P[i] === P[j] && P[j] === P[k] || P[i + 1] === P[j + 1] && P[j + 1] === P[k + 1]) {\n P.splice(j, 2), i -= 2;\n }\n }\n if (!P.length) P = null;\n }\n return P;\n }\n}\n","import Delaunator from \"delaunator\";\nimport Path from \"./path.js\";\nimport Polygon from \"./polygon.js\";\nimport Voronoi from \"./voronoi.js\";\n\nconst tau = 2 * Math.PI, pow = Math.pow;\n\nfunction pointX(p) {\n return p[0];\n}\n\nfunction pointY(p) {\n return p[1];\n}\n\n// A triangulation is collinear if all its triangles have a non-null area\nfunction collinear(d) {\n const {triangles, coords} = d;\n for (let i = 0; i < triangles.length; i += 3) {\n const a = 2 * triangles[i],\n b = 2 * triangles[i + 1],\n c = 2 * triangles[i + 2],\n cross = (coords[c] - coords[a]) * (coords[b + 1] - coords[a + 1])\n - (coords[b] - coords[a]) * (coords[c + 1] - coords[a + 1]);\n if (cross > 1e-10) return false;\n }\n return true;\n}\n\nfunction jitter(x, y, r) {\n return [x + Math.sin(x + y) * r, y + Math.cos(x - y) * r];\n}\n\nexport default class Delaunay {\n static from(points, fx = pointX, fy = pointY, that) {\n return new Delaunay(\"length\" in points\n ? flatArray(points, fx, fy, that)\n : Float64Array.from(flatIterable(points, fx, fy, that)));\n }\n constructor(points) {\n this._delaunator = new Delaunator(points);\n this.inedges = new Int32Array(points.length / 2);\n this._hullIndex = new Int32Array(points.length / 2);\n this.points = this._delaunator.coords;\n this._init();\n }\n update() {\n this._delaunator.update();\n this._init();\n return this;\n }\n _init() {\n const d = this._delaunator, points = this.points;\n\n // check for collinear\n if (d.hull && d.hull.length > 2 && collinear(d)) {\n this.collinear = Int32Array.from({length: points.length/2}, (_,i) => i)\n .sort((i, j) => points[2 * i] - points[2 * j] || points[2 * i + 1] - points[2 * j + 1]); // for exact neighbors\n const e = this.collinear[0], f = this.collinear[this.collinear.length - 1],\n bounds = [ points[2 * e], points[2 * e + 1], points[2 * f], points[2 * f + 1] ],\n r = 1e-8 * Math.hypot(bounds[3] - bounds[1], bounds[2] - bounds[0]);\n for (let i = 0, n = points.length / 2; i < n; ++i) {\n const p = jitter(points[2 * i], points[2 * i + 1], r);\n points[2 * i] = p[0];\n points[2 * i + 1] = p[1];\n }\n this._delaunator = new Delaunator(points);\n } else {\n delete this.collinear;\n }\n\n const halfedges = this.halfedges = this._delaunator.halfedges;\n const hull = this.hull = this._delaunator.hull;\n const triangles = this.triangles = this._delaunator.triangles;\n const inedges = this.inedges.fill(-1);\n const hullIndex = this._hullIndex.fill(-1);\n\n // Compute an index from each point to an (arbitrary) incoming halfedge\n // Used to give the first neighbor of each point; for this reason,\n // on the hull we give priority to exterior halfedges\n for (let e = 0, n = halfedges.length; e < n; ++e) {\n const p = triangles[e % 3 === 2 ? e - 2 : e + 1];\n if (halfedges[e] === -1 || inedges[p] === -1) inedges[p] = e;\n }\n for (let i = 0, n = hull.length; i < n; ++i) {\n hullIndex[hull[i]] = i;\n }\n\n // degenerate case: 1 or 2 (distinct) points\n if (hull.length <= 2 && hull.length > 0) {\n this.triangles = new Int32Array(3).fill(-1);\n this.halfedges = new Int32Array(3).fill(-1);\n this.triangles[0] = hull[0];\n inedges[hull[0]] = 1;\n if (hull.length === 2) {\n inedges[hull[1]] = 0;\n this.triangles[1] = hull[1];\n this.triangles[2] = hull[1];\n }\n }\n }\n voronoi(bounds) {\n return new Voronoi(this, bounds);\n }\n *neighbors(i) {\n const {inedges, hull, _hullIndex, halfedges, triangles, collinear} = this;\n\n // degenerate case with several collinear points\n if (collinear) {\n const l = collinear.indexOf(i);\n if (l > 0) yield collinear[l - 1];\n if (l < collinear.length - 1) yield collinear[l + 1];\n return;\n }\n\n const e0 = inedges[i];\n if (e0 === -1) return; // coincident point\n let e = e0, p0 = -1;\n do {\n yield p0 = triangles[e];\n e = e % 3 === 2 ? e - 2 : e + 1;\n if (triangles[e] !== i) return; // bad triangulation\n e = halfedges[e];\n if (e === -1) {\n const p = hull[(_hullIndex[i] + 1) % hull.length];\n if (p !== p0) yield p;\n return;\n }\n } while (e !== e0);\n }\n find(x, y, i = 0) {\n if ((x = +x, x !== x) || (y = +y, y !== y)) return -1;\n const i0 = i;\n let c;\n while ((c = this._step(i, x, y)) >= 0 && c !== i && c !== i0) i = c;\n return c;\n }\n _step(i, x, y) {\n const {inedges, hull, _hullIndex, halfedges, triangles, points} = this;\n if (inedges[i] === -1 || !points.length) return (i + 1) % (points.length >> 1);\n let c = i;\n let dc = pow(x - points[i * 2], 2) + pow(y - points[i * 2 + 1], 2);\n const e0 = inedges[i];\n let e = e0;\n do {\n let t = triangles[e];\n const dt = pow(x - points[t * 2], 2) + pow(y - points[t * 2 + 1], 2);\n if (dt < dc) dc = dt, c = t;\n e = e % 3 === 2 ? e - 2 : e + 1;\n if (triangles[e] !== i) break; // bad triangulation\n e = halfedges[e];\n if (e === -1) {\n e = hull[(_hullIndex[i] + 1) % hull.length];\n if (e !== t) {\n if (pow(x - points[e * 2], 2) + pow(y - points[e * 2 + 1], 2) < dc) return e;\n }\n break;\n }\n } while (e !== e0);\n return c;\n }\n render(context) {\n const buffer = context == null ? context = new Path : undefined;\n const {points, halfedges, triangles} = this;\n for (let i = 0, n = halfedges.length; i < n; ++i) {\n const j = halfedges[i];\n if (j < i) continue;\n const ti = triangles[i] * 2;\n const tj = triangles[j] * 2;\n context.moveTo(points[ti], points[ti + 1]);\n context.lineTo(points[tj], points[tj + 1]);\n }\n this.renderHull(context);\n return buffer && buffer.value();\n }\n renderPoints(context, r) {\n if (r === undefined && (!context || typeof context.moveTo !== \"function\")) r = context, context = null;\n r = r == undefined ? 2 : +r;\n const buffer = context == null ? context = new Path : undefined;\n const {points} = this;\n for (let i = 0, n = points.length; i < n; i += 2) {\n const x = points[i], y = points[i + 1];\n context.moveTo(x + r, y);\n context.arc(x, y, r, 0, tau);\n }\n return buffer && buffer.value();\n }\n renderHull(context) {\n const buffer = context == null ? context = new Path : undefined;\n const {hull, points} = this;\n const h = hull[0] * 2, n = hull.length;\n context.moveTo(points[h], points[h + 1]);\n for (let i = 1; i < n; ++i) {\n const h = 2 * hull[i];\n context.lineTo(points[h], points[h + 1]);\n }\n context.closePath();\n return buffer && buffer.value();\n }\n hullPolygon() {\n const polygon = new Polygon;\n this.renderHull(polygon);\n return polygon.value();\n }\n renderTriangle(i, context) {\n const buffer = context == null ? context = new Path : undefined;\n const {points, triangles} = this;\n const t0 = triangles[i *= 3] * 2;\n const t1 = triangles[i + 1] * 2;\n const t2 = triangles[i + 2] * 2;\n context.moveTo(points[t0], points[t0 + 1]);\n context.lineTo(points[t1], points[t1 + 1]);\n context.lineTo(points[t2], points[t2 + 1]);\n context.closePath();\n return buffer && buffer.value();\n }\n *trianglePolygons() {\n const {triangles} = this;\n for (let i = 0, n = triangles.length / 3; i < n; ++i) {\n yield this.trianglePolygon(i);\n }\n }\n trianglePolygon(i) {\n const polygon = new Polygon;\n this.renderTriangle(i, polygon);\n return polygon.value();\n }\n}\n\nfunction flatArray(points, fx, fy, that) {\n const n = points.length;\n const array = new Float64Array(n * 2);\n for (let i = 0; i < n; ++i) {\n const p = points[i];\n array[i * 2] = fx.call(that, p, i, points);\n array[i * 2 + 1] = fy.call(that, p, i, points);\n }\n return array;\n}\n\nfunction* flatIterable(points, fx, fy, that) {\n let i = 0;\n for (const p of points) {\n yield fx.call(that, p, i, points);\n yield fy.call(that, p, i, points);\n ++i;\n }\n}\n","import { Transform } from 'vega-dataflow';\nimport { inherits } from 'vega-util';\nimport { Delaunay } from 'd3-delaunay';\n\nfunction Voronoi(params) {\n Transform.call(this, null, params);\n}\nVoronoi.Definition = {\n 'type': 'Voronoi',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'extent',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'default': [[-1e5, -1e5], [1e5, 1e5]],\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'path'\n }]\n};\nconst defaultExtent = [-1e5, -1e5, 1e5, 1e5];\ninherits(Voronoi, Transform, {\n transform(_, pulse) {\n const as = _.as || 'path',\n data = pulse.source;\n\n // nothing to do if no data\n if (!data || !data.length) return pulse;\n\n // configure and construct voronoi diagram\n let s = _.size;\n s = s ? [0, 0, s[0], s[1]] : (s = _.extent) ? [s[0][0], s[0][1], s[1][0], s[1][1]] : defaultExtent;\n const voronoi = this.value = Delaunay.from(data, _.x, _.y).voronoi(s);\n\n // map polygons to paths\n for (let i = 0, n = data.length; i < n; ++i) {\n const polygon = voronoi.cellPolygon(i);\n data[i][as] = polygon ? toPathString(polygon) : null;\n }\n return pulse.reflow(_.modified()).modifies(as);\n }\n});\n\n// suppress duplicated end point vertices\nfunction toPathString(p) {\n const x = p[0][0],\n y = p[0][1];\n let n = p.length - 1;\n for (; p[n][0] === x && p[n][1] === y; --n);\n return 'M' + p.slice(0, n + 1).join('L') + 'Z';\n}\n\nexport { Voronoi as voronoi };\n","import { canvas } from 'vega-canvas';\nimport { Transform } from 'vega-dataflow';\nimport { inherits, error, isFunction, constant, extent } from 'vega-util';\nimport { scale } from 'vega-scale';\nimport { random } from 'vega-statistics';\n\n/*\nCopyright (c) 2013, Jason Davies.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n * The name Jason Davies may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL JASON DAVIES BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\nOR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\nADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n// Word cloud layout by Jason Davies, https://www.jasondavies.com/wordcloud/\n// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf\n\nvar cloudRadians = Math.PI / 180,\n cw = 1 << 11 >> 5,\n ch = 1 << 11;\nfunction cloud () {\n var size = [256, 256],\n text,\n font,\n fontSize,\n fontStyle,\n fontWeight,\n rotate,\n padding,\n spiral = archimedeanSpiral,\n words = [],\n random = Math.random,\n cloud = {};\n cloud.layout = function () {\n var contextAndRatio = getContext(canvas()),\n board = zeroArray((size[0] >> 5) * size[1]),\n bounds = null,\n n = words.length,\n i = -1,\n tags = [],\n data = words.map(d => ({\n text: text(d),\n font: font(d),\n style: fontStyle(d),\n weight: fontWeight(d),\n rotate: rotate(d),\n size: ~~(fontSize(d) + 1e-14),\n padding: padding(d),\n xoff: 0,\n yoff: 0,\n x1: 0,\n y1: 0,\n x0: 0,\n y0: 0,\n hasText: false,\n sprite: null,\n datum: d\n })).sort((a, b) => b.size - a.size);\n while (++i < n) {\n var d = data[i];\n d.x = size[0] * (random() + .5) >> 1;\n d.y = size[1] * (random() + .5) >> 1;\n cloudSprite(contextAndRatio, d, data, i);\n if (d.hasText && place(board, d, bounds)) {\n tags.push(d);\n if (bounds) cloudBounds(bounds, d);else bounds = [{\n x: d.x + d.x0,\n y: d.y + d.y0\n }, {\n x: d.x + d.x1,\n y: d.y + d.y1\n }];\n // Temporary hack\n d.x -= size[0] >> 1;\n d.y -= size[1] >> 1;\n }\n }\n return tags;\n };\n function getContext(canvas) {\n canvas.width = canvas.height = 1;\n var ratio = Math.sqrt(canvas.getContext('2d').getImageData(0, 0, 1, 1).data.length >> 2);\n canvas.width = (cw << 5) / ratio;\n canvas.height = ch / ratio;\n var context = canvas.getContext('2d');\n context.fillStyle = context.strokeStyle = 'red';\n context.textAlign = 'center';\n return {\n context: context,\n ratio: ratio\n };\n }\n function place(board, tag, bounds) {\n var startX = tag.x,\n startY = tag.y,\n maxDelta = Math.sqrt(size[0] * size[0] + size[1] * size[1]),\n s = spiral(size),\n dt = random() < .5 ? 1 : -1,\n t = -dt,\n dxdy,\n dx,\n dy;\n while (dxdy = s(t += dt)) {\n dx = ~~dxdy[0];\n dy = ~~dxdy[1];\n if (Math.min(Math.abs(dx), Math.abs(dy)) >= maxDelta) break;\n tag.x = startX + dx;\n tag.y = startY + dy;\n if (tag.x + tag.x0 < 0 || tag.y + tag.y0 < 0 || tag.x + tag.x1 > size[0] || tag.y + tag.y1 > size[1]) continue;\n // TODO only check for collisions within current bounds.\n if (!bounds || !cloudCollide(tag, board, size[0])) {\n if (!bounds || collideRects(tag, bounds)) {\n var sprite = tag.sprite,\n w = tag.width >> 5,\n sw = size[0] >> 5,\n lx = tag.x - (w << 4),\n sx = lx & 0x7f,\n msx = 32 - sx,\n h = tag.y1 - tag.y0,\n x = (tag.y + tag.y0) * sw + (lx >> 5),\n last;\n for (var j = 0; j < h; j++) {\n last = 0;\n for (var i = 0; i <= w; i++) {\n board[x + i] |= last << msx | (i < w ? (last = sprite[j * w + i]) >>> sx : 0);\n }\n x += sw;\n }\n tag.sprite = null;\n return true;\n }\n }\n }\n return false;\n }\n cloud.words = function (_) {\n if (arguments.length) {\n words = _;\n return cloud;\n } else {\n return words;\n }\n };\n cloud.size = function (_) {\n if (arguments.length) {\n size = [+_[0], +_[1]];\n return cloud;\n } else {\n return size;\n }\n };\n cloud.font = function (_) {\n if (arguments.length) {\n font = functor(_);\n return cloud;\n } else {\n return font;\n }\n };\n cloud.fontStyle = function (_) {\n if (arguments.length) {\n fontStyle = functor(_);\n return cloud;\n } else {\n return fontStyle;\n }\n };\n cloud.fontWeight = function (_) {\n if (arguments.length) {\n fontWeight = functor(_);\n return cloud;\n } else {\n return fontWeight;\n }\n };\n cloud.rotate = function (_) {\n if (arguments.length) {\n rotate = functor(_);\n return cloud;\n } else {\n return rotate;\n }\n };\n cloud.text = function (_) {\n if (arguments.length) {\n text = functor(_);\n return cloud;\n } else {\n return text;\n }\n };\n cloud.spiral = function (_) {\n if (arguments.length) {\n spiral = spirals[_] || _;\n return cloud;\n } else {\n return spiral;\n }\n };\n cloud.fontSize = function (_) {\n if (arguments.length) {\n fontSize = functor(_);\n return cloud;\n } else {\n return fontSize;\n }\n };\n cloud.padding = function (_) {\n if (arguments.length) {\n padding = functor(_);\n return cloud;\n } else {\n return padding;\n }\n };\n cloud.random = function (_) {\n if (arguments.length) {\n random = _;\n return cloud;\n } else {\n return random;\n }\n };\n return cloud;\n}\n\n// Fetches a monochrome sprite bitmap for the specified text.\n// Load in batches for speed.\nfunction cloudSprite(contextAndRatio, d, data, di) {\n if (d.sprite) return;\n var c = contextAndRatio.context,\n ratio = contextAndRatio.ratio;\n c.clearRect(0, 0, (cw << 5) / ratio, ch / ratio);\n var x = 0,\n y = 0,\n maxh = 0,\n n = data.length,\n w,\n w32,\n h,\n i,\n j;\n --di;\n while (++di < n) {\n d = data[di];\n c.save();\n c.font = d.style + ' ' + d.weight + ' ' + ~~((d.size + 1) / ratio) + 'px ' + d.font;\n w = c.measureText(d.text + 'm').width * ratio;\n h = d.size << 1;\n if (d.rotate) {\n var sr = Math.sin(d.rotate * cloudRadians),\n cr = Math.cos(d.rotate * cloudRadians),\n wcr = w * cr,\n wsr = w * sr,\n hcr = h * cr,\n hsr = h * sr;\n w = Math.max(Math.abs(wcr + hsr), Math.abs(wcr - hsr)) + 0x1f >> 5 << 5;\n h = ~~Math.max(Math.abs(wsr + hcr), Math.abs(wsr - hcr));\n } else {\n w = w + 0x1f >> 5 << 5;\n }\n if (h > maxh) maxh = h;\n if (x + w >= cw << 5) {\n x = 0;\n y += maxh;\n maxh = 0;\n }\n if (y + h >= ch) break;\n c.translate((x + (w >> 1)) / ratio, (y + (h >> 1)) / ratio);\n if (d.rotate) c.rotate(d.rotate * cloudRadians);\n c.fillText(d.text, 0, 0);\n if (d.padding) {\n c.lineWidth = 2 * d.padding;\n c.strokeText(d.text, 0, 0);\n }\n c.restore();\n d.width = w;\n d.height = h;\n d.xoff = x;\n d.yoff = y;\n d.x1 = w >> 1;\n d.y1 = h >> 1;\n d.x0 = -d.x1;\n d.y0 = -d.y1;\n d.hasText = true;\n x += w;\n }\n var pixels = c.getImageData(0, 0, (cw << 5) / ratio, ch / ratio).data,\n sprite = [];\n while (--di >= 0) {\n d = data[di];\n if (!d.hasText) continue;\n w = d.width;\n w32 = w >> 5;\n h = d.y1 - d.y0;\n // Zero the buffer\n for (i = 0; i < h * w32; i++) sprite[i] = 0;\n x = d.xoff;\n if (x == null) return;\n y = d.yoff;\n var seen = 0,\n seenRow = -1;\n for (j = 0; j < h; j++) {\n for (i = 0; i < w; i++) {\n var k = w32 * j + (i >> 5),\n m = pixels[(y + j) * (cw << 5) + (x + i) << 2] ? 1 << 31 - i % 32 : 0;\n sprite[k] |= m;\n seen |= m;\n }\n if (seen) seenRow = j;else {\n d.y0++;\n h--;\n j--;\n y++;\n }\n }\n d.y1 = d.y0 + seenRow;\n d.sprite = sprite.slice(0, (d.y1 - d.y0) * w32);\n }\n}\n\n// Use mask-based collision detection.\nfunction cloudCollide(tag, board, sw) {\n sw >>= 5;\n var sprite = tag.sprite,\n w = tag.width >> 5,\n lx = tag.x - (w << 4),\n sx = lx & 0x7f,\n msx = 32 - sx,\n h = tag.y1 - tag.y0,\n x = (tag.y + tag.y0) * sw + (lx >> 5),\n last;\n for (var j = 0; j < h; j++) {\n last = 0;\n for (var i = 0; i <= w; i++) {\n if ((last << msx | (i < w ? (last = sprite[j * w + i]) >>> sx : 0)) & board[x + i]) return true;\n }\n x += sw;\n }\n return false;\n}\nfunction cloudBounds(bounds, d) {\n var b0 = bounds[0],\n b1 = bounds[1];\n if (d.x + d.x0 < b0.x) b0.x = d.x + d.x0;\n if (d.y + d.y0 < b0.y) b0.y = d.y + d.y0;\n if (d.x + d.x1 > b1.x) b1.x = d.x + d.x1;\n if (d.y + d.y1 > b1.y) b1.y = d.y + d.y1;\n}\nfunction collideRects(a, b) {\n return a.x + a.x1 > b[0].x && a.x + a.x0 < b[1].x && a.y + a.y1 > b[0].y && a.y + a.y0 < b[1].y;\n}\nfunction archimedeanSpiral(size) {\n var e = size[0] / size[1];\n return function (t) {\n return [e * (t *= .1) * Math.cos(t), t * Math.sin(t)];\n };\n}\nfunction rectangularSpiral(size) {\n var dy = 4,\n dx = dy * size[0] / size[1],\n x = 0,\n y = 0;\n return function (t) {\n var sign = t < 0 ? -1 : 1;\n // See triangular numbers: T_n = n * (n + 1) / 2.\n switch (Math.sqrt(1 + 4 * sign * t) - sign & 3) {\n case 0:\n x += dx;\n break;\n case 1:\n y += dy;\n break;\n case 2:\n x -= dx;\n break;\n default:\n y -= dy;\n break;\n }\n return [x, y];\n };\n}\n\n// TODO reuse arrays?\nfunction zeroArray(n) {\n var a = [],\n i = -1;\n while (++i < n) a[i] = 0;\n return a;\n}\nfunction functor(d) {\n return typeof d === 'function' ? d : function () {\n return d;\n };\n}\nvar spirals = {\n archimedean: archimedeanSpiral,\n rectangular: rectangularSpiral\n};\n\nconst Output = ['x', 'y', 'font', 'fontSize', 'fontStyle', 'fontWeight', 'angle'];\nconst Params = ['text', 'font', 'rotate', 'fontSize', 'fontStyle', 'fontWeight'];\nfunction Wordcloud(params) {\n Transform.call(this, cloud(), params);\n}\nWordcloud.Definition = {\n 'type': 'Wordcloud',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'font',\n 'type': 'string',\n 'expr': true,\n 'default': 'sans-serif'\n }, {\n 'name': 'fontStyle',\n 'type': 'string',\n 'expr': true,\n 'default': 'normal'\n }, {\n 'name': 'fontWeight',\n 'type': 'string',\n 'expr': true,\n 'default': 'normal'\n }, {\n 'name': 'fontSize',\n 'type': 'number',\n 'expr': true,\n 'default': 14\n }, {\n 'name': 'fontSizeRange',\n 'type': 'number',\n 'array': 'nullable',\n 'default': [10, 50]\n }, {\n 'name': 'rotate',\n 'type': 'number',\n 'expr': true,\n 'default': 0\n }, {\n 'name': 'text',\n 'type': 'field'\n }, {\n 'name': 'spiral',\n 'type': 'string',\n 'values': ['archimedean', 'rectangular']\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 7,\n 'default': Output\n }]\n};\ninherits(Wordcloud, Transform, {\n transform(_, pulse) {\n if (_.size && !(_.size[0] && _.size[1])) {\n error('Wordcloud size dimensions must be non-zero.');\n }\n function modp(param) {\n const p = _[param];\n return isFunction(p) && pulse.modified(p.fields);\n }\n const mod = _.modified();\n if (!(mod || pulse.changed(pulse.ADD_REM) || Params.some(modp))) return;\n const data = pulse.materialize(pulse.SOURCE).source,\n layout = this.value,\n as = _.as || Output;\n let fontSize = _.fontSize || 14,\n range;\n isFunction(fontSize) ? range = _.fontSizeRange : fontSize = constant(fontSize);\n\n // create font size scaling function as needed\n if (range) {\n const fsize = fontSize,\n sizeScale = scale('sqrt')().domain(extent(data, fsize)).range(range);\n fontSize = x => sizeScale(fsize(x));\n }\n data.forEach(t => {\n t[as[0]] = NaN;\n t[as[1]] = NaN;\n t[as[3]] = 0;\n });\n\n // configure layout\n const words = layout.words(data).text(_.text).size(_.size || [500, 500]).padding(_.padding || 1).spiral(_.spiral || 'archimedean').rotate(_.rotate || 0).font(_.font || 'sans-serif').fontStyle(_.fontStyle || 'normal').fontWeight(_.fontWeight || 'normal').fontSize(fontSize).random(random).layout();\n const size = layout.size(),\n dx = size[0] >> 1,\n dy = size[1] >> 1,\n n = words.length;\n for (let i = 0, w, t; i < n; ++i) {\n w = words[i];\n t = w.datum;\n t[as[0]] = w.x + dx;\n t[as[1]] = w.y + dy;\n t[as[2]] = w.font;\n t[as[3]] = w.size;\n t[as[4]] = w.style;\n t[as[5]] = w.weight;\n t[as[6]] = w.rotate;\n }\n return pulse.reflow(mod).modifies(as);\n }\n});\n\nexport { Wordcloud as wordcloud };\n","import { bisectLeft, bisectRight, permute } from 'd3-array';\nimport { Transform } from 'vega-dataflow';\nimport { inherits } from 'vega-util';\n\nconst array8 = n => new Uint8Array(n);\nconst array16 = n => new Uint16Array(n);\nconst array32 = n => new Uint32Array(n);\n\n/**\n * Maintains CrossFilter state.\n */\nfunction Bitmaps() {\n let width = 8,\n data = [],\n seen = array32(0),\n curr = array(0, width),\n prev = array(0, width);\n return {\n data: () => data,\n seen: () => seen = lengthen(seen, data.length),\n add(array) {\n for (let i = 0, j = data.length, n = array.length, t; i < n; ++i) {\n t = array[i];\n t._index = j++;\n data.push(t);\n }\n },\n remove(num, map) {\n // map: index -> boolean (true => remove)\n const n = data.length,\n copy = Array(n - num),\n reindex = data; // reuse old data array for index map\n let t, i, j;\n\n // seek forward to first removal\n for (i = 0; !map[i] && i < n; ++i) {\n copy[i] = data[i];\n reindex[i] = i;\n }\n\n // condense arrays\n for (j = i; i < n; ++i) {\n t = data[i];\n if (!map[i]) {\n reindex[i] = j;\n curr[j] = curr[i];\n prev[j] = prev[i];\n copy[j] = t;\n t._index = j++;\n } else {\n reindex[i] = -1;\n }\n curr[i] = 0; // clear unused bits\n }\n\n data = copy;\n return reindex;\n },\n size: () => data.length,\n curr: () => curr,\n prev: () => prev,\n reset: k => prev[k] = curr[k],\n all: () => width < 0x101 ? 0xff : width < 0x10001 ? 0xffff : 0xffffffff,\n set(k, one) {\n curr[k] |= one;\n },\n clear(k, one) {\n curr[k] &= ~one;\n },\n resize(n, m) {\n const k = curr.length;\n if (n > k || m > width) {\n width = Math.max(m, width);\n curr = array(n, width, curr);\n prev = array(n, width);\n }\n }\n };\n}\nfunction lengthen(array, length, copy) {\n if (array.length >= length) return array;\n copy = copy || new array.constructor(length);\n copy.set(array);\n return copy;\n}\nfunction array(n, m, array) {\n const copy = (m < 0x101 ? array8 : m < 0x10001 ? array16 : array32)(n);\n if (array) copy.set(array);\n return copy;\n}\n\nfunction Dimension (index, i, query) {\n const bit = 1 << i;\n return {\n one: bit,\n zero: ~bit,\n range: query.slice(),\n bisect: index.bisect,\n index: index.index,\n size: index.size,\n onAdd(added, curr) {\n const dim = this,\n range = dim.bisect(dim.range, added.value),\n idx = added.index,\n lo = range[0],\n hi = range[1],\n n1 = idx.length;\n let i;\n for (i = 0; i < lo; ++i) curr[idx[i]] |= bit;\n for (i = hi; i < n1; ++i) curr[idx[i]] |= bit;\n return dim;\n }\n };\n}\n\n/**\n * Maintains a list of values, sorted by key.\n */\nfunction SortedIndex() {\n let index = array32(0),\n value = [],\n size = 0;\n function insert(key, data, base) {\n if (!data.length) return [];\n const n0 = size,\n n1 = data.length,\n addi = array32(n1);\n let addv = Array(n1),\n oldv,\n oldi,\n i;\n for (i = 0; i < n1; ++i) {\n addv[i] = key(data[i]);\n addi[i] = i;\n }\n addv = sort(addv, addi);\n if (n0) {\n oldv = value;\n oldi = index;\n value = Array(n0 + n1);\n index = array32(n0 + n1);\n merge(base, oldv, oldi, n0, addv, addi, n1, value, index);\n } else {\n if (base > 0) for (i = 0; i < n1; ++i) {\n addi[i] += base;\n }\n value = addv;\n index = addi;\n }\n size = n0 + n1;\n return {\n index: addi,\n value: addv\n };\n }\n function remove(num, map) {\n // map: index -> remove\n const n = size;\n let idx, i, j;\n\n // seek forward to first removal\n for (i = 0; !map[index[i]] && i < n; ++i);\n\n // condense index and value arrays\n for (j = i; i < n; ++i) {\n if (!map[idx = index[i]]) {\n index[j] = idx;\n value[j] = value[i];\n ++j;\n }\n }\n size = n - num;\n }\n function reindex(map) {\n for (let i = 0, n = size; i < n; ++i) {\n index[i] = map[index[i]];\n }\n }\n function bisect(range, array) {\n let n;\n if (array) {\n n = array.length;\n } else {\n array = value;\n n = size;\n }\n return [bisectLeft(array, range[0], 0, n), bisectRight(array, range[1], 0, n)];\n }\n return {\n insert: insert,\n remove: remove,\n bisect: bisect,\n reindex: reindex,\n index: () => index,\n size: () => size\n };\n}\nfunction sort(values, index) {\n values.sort.call(index, (a, b) => {\n const x = values[a],\n y = values[b];\n return x < y ? -1 : x > y ? 1 : 0;\n });\n return permute(values, index);\n}\nfunction merge(base, value0, index0, n0, value1, index1, n1, value, index) {\n let i0 = 0,\n i1 = 0,\n i;\n for (i = 0; i0 < n0 && i1 < n1; ++i) {\n if (value0[i0] < value1[i1]) {\n value[i] = value0[i0];\n index[i] = index0[i0++];\n } else {\n value[i] = value1[i1];\n index[i] = index1[i1++] + base;\n }\n }\n for (; i0 < n0; ++i0, ++i) {\n value[i] = value0[i0];\n index[i] = index0[i0];\n }\n for (; i1 < n1; ++i1, ++i) {\n value[i] = value1[i1];\n index[i] = index1[i1] + base;\n }\n}\n\n/**\n * An indexed multi-dimensional filter.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - An array of dimension accessors to filter.\n * @param {Array} params.query - An array of per-dimension range queries.\n */\nfunction CrossFilter(params) {\n Transform.call(this, Bitmaps(), params);\n this._indices = null;\n this._dims = null;\n}\nCrossFilter.Definition = {\n 'type': 'CrossFilter',\n 'metadata': {},\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'query',\n 'type': 'array',\n 'array': true,\n 'required': true,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }]\n};\ninherits(CrossFilter, Transform, {\n transform(_, pulse) {\n if (!this._dims) {\n return this.init(_, pulse);\n } else {\n var init = _.modified('fields') || _.fields.some(f => pulse.modified(f.fields));\n return init ? this.reinit(_, pulse) : this.eval(_, pulse);\n }\n },\n init(_, pulse) {\n const fields = _.fields,\n query = _.query,\n indices = this._indices = {},\n dims = this._dims = [],\n m = query.length;\n let i = 0,\n key,\n index;\n\n // instantiate indices and dimensions\n for (; i < m; ++i) {\n key = fields[i].fname;\n index = indices[key] || (indices[key] = SortedIndex());\n dims.push(Dimension(index, i, query[i]));\n }\n return this.eval(_, pulse);\n },\n reinit(_, pulse) {\n const output = pulse.materialize().fork(),\n fields = _.fields,\n query = _.query,\n indices = this._indices,\n dims = this._dims,\n bits = this.value,\n curr = bits.curr(),\n prev = bits.prev(),\n all = bits.all(),\n out = output.rem = output.add,\n mod = output.mod,\n m = query.length,\n adds = {};\n let add, index, key, mods, remMap, modMap, i, n, f;\n\n // set prev to current state\n prev.set(curr);\n\n // if pulse has remove tuples, process them first\n if (pulse.rem.length) {\n remMap = this.remove(_, pulse, output);\n }\n\n // if pulse has added tuples, add them to state\n if (pulse.add.length) {\n bits.add(pulse.add);\n }\n\n // if pulse has modified tuples, create an index map\n if (pulse.mod.length) {\n modMap = {};\n for (mods = pulse.mod, i = 0, n = mods.length; i < n; ++i) {\n modMap[mods[i]._index] = 1;\n }\n }\n\n // re-initialize indices as needed, update curr bitmap\n for (i = 0; i < m; ++i) {\n f = fields[i];\n if (!dims[i] || _.modified('fields', i) || pulse.modified(f.fields)) {\n key = f.fname;\n if (!(add = adds[key])) {\n indices[key] = index = SortedIndex();\n adds[key] = add = index.insert(f, pulse.source, 0);\n }\n dims[i] = Dimension(index, i, query[i]).onAdd(add, curr);\n }\n }\n\n // visit each tuple\n // if filter state changed, push index to add/rem\n // else if in mod and passes a filter, push index to mod\n for (i = 0, n = bits.data().length; i < n; ++i) {\n if (remMap[i]) {\n // skip if removed tuple\n continue;\n } else if (prev[i] !== curr[i]) {\n // add if state changed\n out.push(i);\n } else if (modMap[i] && curr[i] !== all) {\n // otherwise, pass mods through\n mod.push(i);\n }\n }\n bits.mask = (1 << m) - 1;\n return output;\n },\n eval(_, pulse) {\n const output = pulse.materialize().fork(),\n m = this._dims.length;\n let mask = 0;\n if (pulse.rem.length) {\n this.remove(_, pulse, output);\n mask |= (1 << m) - 1;\n }\n if (_.modified('query') && !_.modified('fields')) {\n mask |= this.update(_, pulse, output);\n }\n if (pulse.add.length) {\n this.insert(_, pulse, output);\n mask |= (1 << m) - 1;\n }\n if (pulse.mod.length) {\n this.modify(pulse, output);\n mask |= (1 << m) - 1;\n }\n this.value.mask = mask;\n return output;\n },\n insert(_, pulse, output) {\n const tuples = pulse.add,\n bits = this.value,\n dims = this._dims,\n indices = this._indices,\n fields = _.fields,\n adds = {},\n out = output.add,\n n = bits.size() + tuples.length,\n m = dims.length;\n let k = bits.size(),\n j,\n key,\n add;\n\n // resize bitmaps and add tuples as needed\n bits.resize(n, m);\n bits.add(tuples);\n const curr = bits.curr(),\n prev = bits.prev(),\n all = bits.all();\n\n // add to dimensional indices\n for (j = 0; j < m; ++j) {\n key = fields[j].fname;\n add = adds[key] || (adds[key] = indices[key].insert(fields[j], tuples, k));\n dims[j].onAdd(add, curr);\n }\n\n // set previous filters, output if passes at least one filter\n for (; k < n; ++k) {\n prev[k] = all;\n if (curr[k] !== all) out.push(k);\n }\n },\n modify(pulse, output) {\n const out = output.mod,\n bits = this.value,\n curr = bits.curr(),\n all = bits.all(),\n tuples = pulse.mod;\n let i, n, k;\n for (i = 0, n = tuples.length; i < n; ++i) {\n k = tuples[i]._index;\n if (curr[k] !== all) out.push(k);\n }\n },\n remove(_, pulse, output) {\n const indices = this._indices,\n bits = this.value,\n curr = bits.curr(),\n prev = bits.prev(),\n all = bits.all(),\n map = {},\n out = output.rem,\n tuples = pulse.rem;\n let i, n, k, f;\n\n // process tuples, output if passes at least one filter\n for (i = 0, n = tuples.length; i < n; ++i) {\n k = tuples[i]._index;\n map[k] = 1; // build index map\n prev[k] = f = curr[k];\n curr[k] = all;\n if (f !== all) out.push(k);\n }\n\n // remove from dimensional indices\n for (k in indices) {\n indices[k].remove(n, map);\n }\n this.reindex(pulse, n, map);\n return map;\n },\n // reindex filters and indices after propagation completes\n reindex(pulse, num, map) {\n const indices = this._indices,\n bits = this.value;\n pulse.runAfter(() => {\n const indexMap = bits.remove(num, map);\n for (const key in indices) indices[key].reindex(indexMap);\n });\n },\n update(_, pulse, output) {\n const dims = this._dims,\n query = _.query,\n stamp = pulse.stamp,\n m = dims.length;\n let mask = 0,\n i,\n q;\n\n // survey how many queries have changed\n output.filters = 0;\n for (q = 0; q < m; ++q) {\n if (_.modified('query', q)) {\n i = q;\n ++mask;\n }\n }\n if (mask === 1) {\n // only one query changed, use more efficient update\n mask = dims[i].one;\n this.incrementOne(dims[i], query[i], output.add, output.rem);\n } else {\n // multiple queries changed, perform full record keeping\n for (q = 0, mask = 0; q < m; ++q) {\n if (!_.modified('query', q)) continue;\n mask |= dims[q].one;\n this.incrementAll(dims[q], query[q], stamp, output.add);\n output.rem = output.add; // duplicate add/rem for downstream resolve\n }\n }\n\n return mask;\n },\n incrementAll(dim, query, stamp, out) {\n const bits = this.value,\n seen = bits.seen(),\n curr = bits.curr(),\n prev = bits.prev(),\n index = dim.index(),\n old = dim.bisect(dim.range),\n range = dim.bisect(query),\n lo1 = range[0],\n hi1 = range[1],\n lo0 = old[0],\n hi0 = old[1],\n one = dim.one;\n let i, j, k;\n\n // Fast incremental update based on previous lo index.\n if (lo1 < lo0) {\n for (i = lo1, j = Math.min(lo0, hi1); i < j; ++i) {\n k = index[i];\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n curr[k] ^= one;\n }\n } else if (lo1 > lo0) {\n for (i = lo0, j = Math.min(lo1, hi0); i < j; ++i) {\n k = index[i];\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n curr[k] ^= one;\n }\n }\n\n // Fast incremental update based on previous hi index.\n if (hi1 > hi0) {\n for (i = Math.max(lo1, hi0), j = hi1; i < j; ++i) {\n k = index[i];\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n curr[k] ^= one;\n }\n } else if (hi1 < hi0) {\n for (i = Math.max(lo0, hi1), j = hi0; i < j; ++i) {\n k = index[i];\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n curr[k] ^= one;\n }\n }\n dim.range = query.slice();\n },\n incrementOne(dim, query, add, rem) {\n const bits = this.value,\n curr = bits.curr(),\n index = dim.index(),\n old = dim.bisect(dim.range),\n range = dim.bisect(query),\n lo1 = range[0],\n hi1 = range[1],\n lo0 = old[0],\n hi0 = old[1],\n one = dim.one;\n let i, j, k;\n\n // Fast incremental update based on previous lo index.\n if (lo1 < lo0) {\n for (i = lo1, j = Math.min(lo0, hi1); i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n add.push(k);\n }\n } else if (lo1 > lo0) {\n for (i = lo0, j = Math.min(lo1, hi0); i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n rem.push(k);\n }\n }\n\n // Fast incremental update based on previous hi index.\n if (hi1 > hi0) {\n for (i = Math.max(lo1, hi0), j = hi1; i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n add.push(k);\n }\n } else if (hi1 < hi0) {\n for (i = Math.max(lo0, hi1), j = hi0; i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n rem.push(k);\n }\n }\n dim.range = query.slice();\n }\n});\n\n/**\n * Selectively filters tuples by resolving against a filter bitmap.\n * Useful for processing the output of a cross-filter transform.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.ignore - A bit mask indicating which filters to ignore.\n * @param {object} params.filter - The per-tuple filter bitmaps. Typically this\n * parameter value is a reference to a {@link CrossFilter} transform.\n */\nfunction ResolveFilter(params) {\n Transform.call(this, null, params);\n}\nResolveFilter.Definition = {\n 'type': 'ResolveFilter',\n 'metadata': {},\n 'params': [{\n 'name': 'ignore',\n 'type': 'number',\n 'required': true,\n 'description': 'A bit mask indicating which filters to ignore.'\n }, {\n 'name': 'filter',\n 'type': 'object',\n 'required': true,\n 'description': 'Per-tuple filter bitmaps from a CrossFilter transform.'\n }]\n};\ninherits(ResolveFilter, Transform, {\n transform(_, pulse) {\n const ignore = ~(_.ignore || 0),\n // bit mask where zeros -> dims to ignore\n bitmap = _.filter,\n mask = bitmap.mask;\n\n // exit early if no relevant filter changes\n if ((mask & ignore) === 0) return pulse.StopPropagation;\n const output = pulse.fork(pulse.ALL),\n data = bitmap.data(),\n curr = bitmap.curr(),\n prev = bitmap.prev(),\n pass = k => !(curr[k] & ignore) ? data[k] : null;\n\n // propagate all mod tuples that pass the filter\n output.filter(output.MOD, pass);\n\n // determine add & rem tuples via filter functions\n // for efficiency, we do *not* populate new arrays,\n // instead we add filter functions applied downstream\n\n if (!(mask & mask - 1)) {\n // only one filter changed\n output.filter(output.ADD, pass);\n output.filter(output.REM, k => (curr[k] & ignore) === mask ? data[k] : null);\n } else {\n // multiple filters changed\n output.filter(output.ADD, k => {\n const c = curr[k] & ignore,\n f = !c && c ^ prev[k] & ignore;\n return f ? data[k] : null;\n });\n output.filter(output.REM, k => {\n const c = curr[k] & ignore,\n f = c && !(c ^ (c ^ prev[k] & ignore));\n return f ? data[k] : null;\n });\n }\n\n // add filter to source data in case of reflow...\n return output.filter(output.SOURCE, t => pass(t._index));\n }\n});\n\nexport { CrossFilter as crossfilter, ResolveFilter as resolvefilter };\n","export default function permute(source, keys) {\n return Array.from(keys, key => source[key]);\n}\n","import { error, toSet, isFunction, isString, hasOwnProperty } from 'vega-util';\n\nconst RawCode = 'RawCode';\nconst Literal = 'Literal';\nconst Property = 'Property';\nconst Identifier = 'Identifier';\nconst ArrayExpression = 'ArrayExpression';\nconst BinaryExpression = 'BinaryExpression';\nconst CallExpression = 'CallExpression';\nconst ConditionalExpression = 'ConditionalExpression';\nconst LogicalExpression = 'LogicalExpression';\nconst MemberExpression = 'MemberExpression';\nconst ObjectExpression = 'ObjectExpression';\nconst UnaryExpression = 'UnaryExpression';\nfunction ASTNode(type) {\n this.type = type;\n}\nASTNode.prototype.visit = function (visitor) {\n let c, i, n;\n if (visitor(this)) return 1;\n for (c = children(this), i = 0, n = c.length; i < n; ++i) {\n if (c[i].visit(visitor)) return 1;\n }\n};\nfunction children(node) {\n switch (node.type) {\n case ArrayExpression:\n return node.elements;\n case BinaryExpression:\n case LogicalExpression:\n return [node.left, node.right];\n case CallExpression:\n return [node.callee].concat(node.arguments);\n case ConditionalExpression:\n return [node.test, node.consequent, node.alternate];\n case MemberExpression:\n return [node.object, node.property];\n case ObjectExpression:\n return node.properties;\n case Property:\n return [node.key, node.value];\n case UnaryExpression:\n return [node.argument];\n case Identifier:\n case Literal:\n case RawCode:\n default:\n return [];\n }\n}\n\n/*\n The following expression parser is based on Esprima (http://esprima.org/).\n Original header comment and license for Esprima is included here:\n\n Copyright (C) 2013 Ariya Hidayat \n Copyright (C) 2013 Thaddee Tyl \n Copyright (C) 2013 Mathias Bynens \n Copyright (C) 2012 Ariya Hidayat \n Copyright (C) 2012 Mathias Bynens \n Copyright (C) 2012 Joost-Wim Boekesteijn \n Copyright (C) 2012 Kris Kowal \n Copyright (C) 2012 Yusuke Suzuki \n Copyright (C) 2012 Arpad Borsos \n Copyright (C) 2011 Ariya Hidayat \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\nvar TokenName, source, index, length, lookahead;\nvar TokenBooleanLiteral = 1,\n TokenEOF = 2,\n TokenIdentifier = 3,\n TokenKeyword = 4,\n TokenNullLiteral = 5,\n TokenNumericLiteral = 6,\n TokenPunctuator = 7,\n TokenStringLiteral = 8,\n TokenRegularExpression = 9;\nTokenName = {};\nTokenName[TokenBooleanLiteral] = 'Boolean';\nTokenName[TokenEOF] = '';\nTokenName[TokenIdentifier] = 'Identifier';\nTokenName[TokenKeyword] = 'Keyword';\nTokenName[TokenNullLiteral] = 'Null';\nTokenName[TokenNumericLiteral] = 'Numeric';\nTokenName[TokenPunctuator] = 'Punctuator';\nTokenName[TokenStringLiteral] = 'String';\nTokenName[TokenRegularExpression] = 'RegularExpression';\nvar SyntaxArrayExpression = 'ArrayExpression',\n SyntaxBinaryExpression = 'BinaryExpression',\n SyntaxCallExpression = 'CallExpression',\n SyntaxConditionalExpression = 'ConditionalExpression',\n SyntaxIdentifier = 'Identifier',\n SyntaxLiteral = 'Literal',\n SyntaxLogicalExpression = 'LogicalExpression',\n SyntaxMemberExpression = 'MemberExpression',\n SyntaxObjectExpression = 'ObjectExpression',\n SyntaxProperty = 'Property',\n SyntaxUnaryExpression = 'UnaryExpression';\n\n// Error messages should be identical to V8.\nvar MessageUnexpectedToken = 'Unexpected token %0',\n MessageUnexpectedNumber = 'Unexpected number',\n MessageUnexpectedString = 'Unexpected string',\n MessageUnexpectedIdentifier = 'Unexpected identifier',\n MessageUnexpectedReserved = 'Unexpected reserved word',\n MessageUnexpectedEOS = 'Unexpected end of input',\n MessageInvalidRegExp = 'Invalid regular expression',\n MessageUnterminatedRegExp = 'Invalid regular expression: missing /',\n MessageStrictOctalLiteral = 'Octal literals are not allowed in strict mode.',\n MessageStrictDuplicateProperty = 'Duplicate data property in object literal not allowed in strict mode';\nvar ILLEGAL = 'ILLEGAL',\n DISABLED = 'Disabled.';\n\n// See also tools/generate-unicode-regex.py.\nvar RegexNonAsciiIdentifierStart = new RegExp('[\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0370-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0620-\\\\u064A\\\\u066E\\\\u066F\\\\u0671-\\\\u06D3\\\\u06D5\\\\u06E5\\\\u06E6\\\\u06EE\\\\u06EF\\\\u06FA-\\\\u06FC\\\\u06FF\\\\u0710\\\\u0712-\\\\u072F\\\\u074D-\\\\u07A5\\\\u07B1\\\\u07CA-\\\\u07EA\\\\u07F4\\\\u07F5\\\\u07FA\\\\u0800-\\\\u0815\\\\u081A\\\\u0824\\\\u0828\\\\u0840-\\\\u0858\\\\u08A0-\\\\u08B2\\\\u0904-\\\\u0939\\\\u093D\\\\u0950\\\\u0958-\\\\u0961\\\\u0971-\\\\u0980\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BD\\\\u09CE\\\\u09DC\\\\u09DD\\\\u09DF-\\\\u09E1\\\\u09F0\\\\u09F1\\\\u0A05-\\\\u0A0A\\\\u0A0F\\\\u0A10\\\\u0A13-\\\\u0A28\\\\u0A2A-\\\\u0A30\\\\u0A32\\\\u0A33\\\\u0A35\\\\u0A36\\\\u0A38\\\\u0A39\\\\u0A59-\\\\u0A5C\\\\u0A5E\\\\u0A72-\\\\u0A74\\\\u0A85-\\\\u0A8D\\\\u0A8F-\\\\u0A91\\\\u0A93-\\\\u0AA8\\\\u0AAA-\\\\u0AB0\\\\u0AB2\\\\u0AB3\\\\u0AB5-\\\\u0AB9\\\\u0ABD\\\\u0AD0\\\\u0AE0\\\\u0AE1\\\\u0B05-\\\\u0B0C\\\\u0B0F\\\\u0B10\\\\u0B13-\\\\u0B28\\\\u0B2A-\\\\u0B30\\\\u0B32\\\\u0B33\\\\u0B35-\\\\u0B39\\\\u0B3D\\\\u0B5C\\\\u0B5D\\\\u0B5F-\\\\u0B61\\\\u0B71\\\\u0B83\\\\u0B85-\\\\u0B8A\\\\u0B8E-\\\\u0B90\\\\u0B92-\\\\u0B95\\\\u0B99\\\\u0B9A\\\\u0B9C\\\\u0B9E\\\\u0B9F\\\\u0BA3\\\\u0BA4\\\\u0BA8-\\\\u0BAA\\\\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\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1711\\\\u1720-\\\\u1731\\\\u1740-\\\\u1751\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1780-\\\\u17B3\\\\u17D7\\\\u17DC\\\\u1820-\\\\u1877\\\\u1880-\\\\u18A8\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1950-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19C1-\\\\u19C7\\\\u1A00-\\\\u1A16\\\\u1A20-\\\\u1A54\\\\u1AA7\\\\u1B05-\\\\u1B33\\\\u1B45-\\\\u1B4B\\\\u1B83-\\\\u1BA0\\\\u1BAE\\\\u1BAF\\\\u1BBA-\\\\u1BE5\\\\u1C00-\\\\u1C23\\\\u1C4D-\\\\u1C4F\\\\u1C5A-\\\\u1C7D\\\\u1CE9-\\\\u1CEC\\\\u1CEE-\\\\u1CF1\\\\u1CF5\\\\u1CF6\\\\u1D00-\\\\u1DBF\\\\u1E00-\\\\u1F15\\\\u1F18-\\\\u1F1D\\\\u1F20-\\\\u1F45\\\\u1F48-\\\\u1F4D\\\\u1F50-\\\\u1F57\\\\u1F59\\\\u1F5B\\\\u1F5D\\\\u1F5F-\\\\u1F7D\\\\u1F80-\\\\u1FB4\\\\u1FB6-\\\\u1FBC\\\\u1FBE\\\\u1FC2-\\\\u1FC4\\\\u1FC6-\\\\u1FCC\\\\u1FD0-\\\\u1FD3\\\\u1FD6-\\\\u1FDB\\\\u1FE0-\\\\u1FEC\\\\u1FF2-\\\\u1FF4\\\\u1FF6-\\\\u1FFC\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u2102\\\\u2107\\\\u210A-\\\\u2113\\\\u2115\\\\u2119-\\\\u211D\\\\u2124\\\\u2126\\\\u2128\\\\u212A-\\\\u212D\\\\u212F-\\\\u2139\\\\u213C-\\\\u213F\\\\u2145-\\\\u2149\\\\u214E\\\\u2160-\\\\u2188\\\\u2C00-\\\\u2C2E\\\\u2C30-\\\\u2C5E\\\\u2C60-\\\\u2CE4\\\\u2CEB-\\\\u2CEE\\\\u2CF2\\\\u2CF3\\\\u2D00-\\\\u2D25\\\\u2D27\\\\u2D2D\\\\u2D30-\\\\u2D67\\\\u2D6F\\\\u2D80-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2E2F\\\\u3005-\\\\u3007\\\\u3021-\\\\u3029\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FCC\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA61F\\\\uA62A\\\\uA62B\\\\uA640-\\\\uA66E\\\\uA67F-\\\\uA69D\\\\uA6A0-\\\\uA6EF\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B-\\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\\\uFF21-\\\\uFF3A\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]'),\n // eslint-disable-next-line no-misleading-character-class\n RegexNonAsciiIdentifierPart = new RegExp('[\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0300-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u0483-\\\\u0487\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u0591-\\\\u05BD\\\\u05BF\\\\u05C1\\\\u05C2\\\\u05C4\\\\u05C5\\\\u05C7\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0610-\\\\u061A\\\\u0620-\\\\u0669\\\\u066E-\\\\u06D3\\\\u06D5-\\\\u06DC\\\\u06DF-\\\\u06E8\\\\u06EA-\\\\u06FC\\\\u06FF\\\\u0710-\\\\u074A\\\\u074D-\\\\u07B1\\\\u07C0-\\\\u07F5\\\\u07FA\\\\u0800-\\\\u082D\\\\u0840-\\\\u085B\\\\u08A0-\\\\u08B2\\\\u08E4-\\\\u0963\\\\u0966-\\\\u096F\\\\u0971-\\\\u0983\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BC-\\\\u09C4\\\\u09C7\\\\u09C8\\\\u09CB-\\\\u09CE\\\\u09D7\\\\u09DC\\\\u09DD\\\\u09DF-\\\\u09E3\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\\\\u0EAD-\\\\u0EB9\\\\u0EBB-\\\\u0EBD\\\\u0EC0-\\\\u0EC4\\\\u0EC6\\\\u0EC8-\\\\u0ECD\\\\u0ED0-\\\\u0ED9\\\\u0EDC-\\\\u0EDF\\\\u0F00\\\\u0F18\\\\u0F19\\\\u0F20-\\\\u0F29\\\\u0F35\\\\u0F37\\\\u0F39\\\\u0F3E-\\\\u0F47\\\\u0F49-\\\\u0F6C\\\\u0F71-\\\\u0F84\\\\u0F86-\\\\u0F97\\\\u0F99-\\\\u0FBC\\\\u0FC6\\\\u1000-\\\\u1049\\\\u1050-\\\\u109D\\\\u10A0-\\\\u10C5\\\\u10C7\\\\u10CD\\\\u10D0-\\\\u10FA\\\\u10FC-\\\\u1248\\\\u124A-\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u135D-\\\\u135F\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1714\\\\u1720-\\\\u1734\\\\u1740-\\\\u1753\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1772\\\\u1773\\\\u1780-\\\\u17D3\\\\u17D7\\\\u17DC\\\\u17DD\\\\u17E0-\\\\u17E9\\\\u180B-\\\\u180D\\\\u1810-\\\\u1819\\\\u1820-\\\\u1877\\\\u1880-\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1920-\\\\u192B\\\\u1930-\\\\u193B\\\\u1946-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19B0-\\\\u19C9\\\\u19D0-\\\\u19D9\\\\u1A00-\\\\u1A1B\\\\u1A20-\\\\u1A5E\\\\u1A60-\\\\u1A7C\\\\u1A7F-\\\\u1A89\\\\u1A90-\\\\u1A99\\\\u1AA7\\\\u1AB0-\\\\u1ABD\\\\u1B00-\\\\u1B4B\\\\u1B50-\\\\u1B59\\\\u1B6B-\\\\u1B73\\\\u1B80-\\\\u1BF3\\\\u1C00-\\\\u1C37\\\\u1C40-\\\\u1C49\\\\u1C4D-\\\\u1C7D\\\\u1CD0-\\\\u1CD2\\\\u1CD4-\\\\u1CF6\\\\u1CF8\\\\u1CF9\\\\u1D00-\\\\u1DF5\\\\u1DFC-\\\\u1F15\\\\u1F18-\\\\u1F1D\\\\u1F20-\\\\u1F45\\\\u1F48-\\\\u1F4D\\\\u1F50-\\\\u1F57\\\\u1F59\\\\u1F5B\\\\u1F5D\\\\u1F5F-\\\\u1F7D\\\\u1F80-\\\\u1FB4\\\\u1FB6-\\\\u1FBC\\\\u1FBE\\\\u1FC2-\\\\u1FC4\\\\u1FC6-\\\\u1FCC\\\\u1FD0-\\\\u1FD3\\\\u1FD6-\\\\u1FDB\\\\u1FE0-\\\\u1FEC\\\\u1FF2-\\\\u1FF4\\\\u1FF6-\\\\u1FFC\\\\u200C\\\\u200D\\\\u203F\\\\u2040\\\\u2054\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u20D0-\\\\u20DC\\\\u20E1\\\\u20E5-\\\\u20F0\\\\u2102\\\\u2107\\\\u210A-\\\\u2113\\\\u2115\\\\u2119-\\\\u211D\\\\u2124\\\\u2126\\\\u2128\\\\u212A-\\\\u212D\\\\u212F-\\\\u2139\\\\u213C-\\\\u213F\\\\u2145-\\\\u2149\\\\u214E\\\\u2160-\\\\u2188\\\\u2C00-\\\\u2C2E\\\\u2C30-\\\\u2C5E\\\\u2C60-\\\\u2CE4\\\\u2CEB-\\\\u2CF3\\\\u2D00-\\\\u2D25\\\\u2D27\\\\u2D2D\\\\u2D30-\\\\u2D67\\\\u2D6F\\\\u2D7F-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2DE0-\\\\u2DFF\\\\u2E2F\\\\u3005-\\\\u3007\\\\u3021-\\\\u302F\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u3099\\\\u309A\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FCC\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA62B\\\\uA640-\\\\uA66F\\\\uA674-\\\\uA67D\\\\uA67F-\\\\uA69D\\\\uA69F-\\\\uA6F1\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B-\\\\uA78E\\\\uA790-\\\\uA7AD\\\\uA7B0\\\\uA7B1\\\\uA7F7-\\\\uA827\\\\uA840-\\\\uA873\\\\uA880-\\\\uA8C4\\\\uA8D0-\\\\uA8D9\\\\uA8E0-\\\\uA8F7\\\\uA8FB\\\\uA900-\\\\uA92D\\\\uA930-\\\\uA953\\\\uA960-\\\\uA97C\\\\uA980-\\\\uA9C0\\\\uA9CF-\\\\uA9D9\\\\uA9E0-\\\\uA9FE\\\\uAA00-\\\\uAA36\\\\uAA40-\\\\uAA4D\\\\uAA50-\\\\uAA59\\\\uAA60-\\\\uAA76\\\\uAA7A-\\\\uAAC2\\\\uAADB-\\\\uAADD\\\\uAAE0-\\\\uAAEF\\\\uAAF2-\\\\uAAF6\\\\uAB01-\\\\uAB06\\\\uAB09-\\\\uAB0E\\\\uAB11-\\\\uAB16\\\\uAB20-\\\\uAB26\\\\uAB28-\\\\uAB2E\\\\uAB30-\\\\uAB5A\\\\uAB5C-\\\\uAB5F\\\\uAB64\\\\uAB65\\\\uABC0-\\\\uABEA\\\\uABEC\\\\uABED\\\\uABF0-\\\\uABF9\\\\uAC00-\\\\uD7A3\\\\uD7B0-\\\\uD7C6\\\\uD7CB-\\\\uD7FB\\\\uF900-\\\\uFA6D\\\\uFA70-\\\\uFAD9\\\\uFB00-\\\\uFB06\\\\uFB13-\\\\uFB17\\\\uFB1D-\\\\uFB28\\\\uFB2A-\\\\uFB36\\\\uFB38-\\\\uFB3C\\\\uFB3E\\\\uFB40\\\\uFB41\\\\uFB43\\\\uFB44\\\\uFB46-\\\\uFBB1\\\\uFBD3-\\\\uFD3D\\\\uFD50-\\\\uFD8F\\\\uFD92-\\\\uFDC7\\\\uFDF0-\\\\uFDFB\\\\uFE00-\\\\uFE0F\\\\uFE20-\\\\uFE2D\\\\uFE33\\\\uFE34\\\\uFE4D-\\\\uFE4F\\\\uFE70-\\\\uFE74\\\\uFE76-\\\\uFEFC\\\\uFF10-\\\\uFF19\\\\uFF21-\\\\uFF3A\\\\uFF3F\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]');\n\n// Ensure the condition is true, otherwise throw an error.\n// This is only to have a better contract semantic, i.e. another safety net\n// to catch a logic error. The condition shall be fulfilled in normal case.\n// Do NOT use this to enforce a certain condition on any user input.\n\nfunction assert(condition, message) {\n /* istanbul ignore next */\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n}\nfunction isDecimalDigit(ch) {\n return ch >= 0x30 && ch <= 0x39; // 0..9\n}\n\nfunction isHexDigit(ch) {\n return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;\n}\nfunction isOctalDigit(ch) {\n return '01234567'.indexOf(ch) >= 0;\n}\n\n// 7.2 White Space\n\nfunction isWhiteSpace(ch) {\n return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0;\n}\n\n// 7.3 Line Terminators\n\nfunction isLineTerminator(ch) {\n return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;\n}\n\n// 7.6 Identifier Names and Identifiers\n\nfunction isIdentifierStart(ch) {\n return ch === 0x24 || ch === 0x5F ||\n // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A ||\n // A..Z\n ch >= 0x61 && ch <= 0x7A ||\n // a..z\n ch === 0x5C ||\n // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierStart.test(String.fromCharCode(ch));\n}\nfunction isIdentifierPart(ch) {\n return ch === 0x24 || ch === 0x5F ||\n // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A ||\n // A..Z\n ch >= 0x61 && ch <= 0x7A ||\n // a..z\n ch >= 0x30 && ch <= 0x39 ||\n // 0..9\n ch === 0x5C ||\n // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierPart.test(String.fromCharCode(ch));\n}\n\n// 7.6.1.1 Keywords\n\nconst keywords = {\n 'if': 1,\n 'in': 1,\n 'do': 1,\n 'var': 1,\n 'for': 1,\n 'new': 1,\n 'try': 1,\n 'let': 1,\n 'this': 1,\n 'else': 1,\n 'case': 1,\n 'void': 1,\n 'with': 1,\n 'enum': 1,\n 'while': 1,\n 'break': 1,\n 'catch': 1,\n 'throw': 1,\n 'const': 1,\n 'yield': 1,\n 'class': 1,\n 'super': 1,\n 'return': 1,\n 'typeof': 1,\n 'delete': 1,\n 'switch': 1,\n 'export': 1,\n 'import': 1,\n 'public': 1,\n 'static': 1,\n 'default': 1,\n 'finally': 1,\n 'extends': 1,\n 'package': 1,\n 'private': 1,\n 'function': 1,\n 'continue': 1,\n 'debugger': 1,\n 'interface': 1,\n 'protected': 1,\n 'instanceof': 1,\n 'implements': 1\n};\nfunction skipComment() {\n while (index < length) {\n const ch = source.charCodeAt(index);\n if (isWhiteSpace(ch) || isLineTerminator(ch)) {\n ++index;\n } else {\n break;\n }\n }\n}\nfunction scanHexEscape(prefix) {\n var i,\n len,\n ch,\n code = 0;\n len = prefix === 'u' ? 4 : 2;\n for (i = 0; i < len; ++i) {\n if (index < length && isHexDigit(source[index])) {\n ch = source[index++];\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n } else {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n return String.fromCharCode(code);\n}\nfunction scanUnicodeCodePointEscape() {\n var ch, code, cu1, cu2;\n ch = source[index];\n code = 0;\n\n // At least, one hex digit is required.\n if (ch === '}') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n while (index < length) {\n ch = source[index++];\n if (!isHexDigit(ch)) {\n break;\n }\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n }\n if (code > 0x10FFFF || ch !== '}') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n // UTF-16 Encoding\n if (code <= 0xFFFF) {\n return String.fromCharCode(code);\n }\n cu1 = (code - 0x10000 >> 10) + 0xD800;\n cu2 = (code - 0x10000 & 1023) + 0xDC00;\n return String.fromCharCode(cu1, cu2);\n}\nfunction getEscapedIdentifier() {\n var ch, id;\n ch = source.charCodeAt(index++);\n id = String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierStart(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n id = ch;\n }\n while (index < length) {\n ch = source.charCodeAt(index);\n if (!isIdentifierPart(ch)) {\n break;\n }\n ++index;\n id += String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n id = id.substr(0, id.length - 1);\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierPart(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n id += ch;\n }\n }\n return id;\n}\nfunction getIdentifier() {\n var start, ch;\n start = index++;\n while (index < length) {\n ch = source.charCodeAt(index);\n if (ch === 0x5C) {\n // Blackslash (U+005C) marks Unicode escape sequence.\n index = start;\n return getEscapedIdentifier();\n }\n if (isIdentifierPart(ch)) {\n ++index;\n } else {\n break;\n }\n }\n return source.slice(start, index);\n}\nfunction scanIdentifier() {\n var start, id, type;\n start = index;\n\n // Backslash (U+005C) starts an escaped character.\n id = source.charCodeAt(index) === 0x5C ? getEscapedIdentifier() : getIdentifier();\n\n // There is no keyword or literal with only one character.\n // Thus, it must be an identifier.\n if (id.length === 1) {\n type = TokenIdentifier;\n } else if (keywords.hasOwnProperty(id)) {\n // eslint-disable-line no-prototype-builtins\n type = TokenKeyword;\n } else if (id === 'null') {\n type = TokenNullLiteral;\n } else if (id === 'true' || id === 'false') {\n type = TokenBooleanLiteral;\n } else {\n type = TokenIdentifier;\n }\n return {\n type: type,\n value: id,\n start: start,\n end: index\n };\n}\n\n// 7.7 Punctuators\n\nfunction scanPunctuator() {\n var start = index,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2,\n ch3,\n ch4;\n switch (code) {\n // Check for most common single-character punctuators.\n case 0x2E: // . dot\n case 0x28: // ( open bracket\n case 0x29: // ) close bracket\n case 0x3B: // ; semicolon\n case 0x2C: // , comma\n case 0x7B: // { open curly brace\n case 0x7D: // } close curly brace\n case 0x5B: // [\n case 0x5D: // ]\n case 0x3A: // :\n case 0x3F: // ?\n case 0x7E:\n // ~\n ++index;\n return {\n type: TokenPunctuator,\n value: String.fromCharCode(code),\n start: start,\n end: index\n };\n default:\n code2 = source.charCodeAt(index + 1);\n\n // '=' (U+003D) marks an assignment or comparison operator.\n if (code2 === 0x3D) {\n switch (code) {\n case 0x2B: // +\n case 0x2D: // -\n case 0x2F: // /\n case 0x3C: // <\n case 0x3E: // >\n case 0x5E: // ^\n case 0x7C: // |\n case 0x25: // %\n case 0x26: // &\n case 0x2A:\n // *\n index += 2;\n return {\n type: TokenPunctuator,\n value: String.fromCharCode(code) + String.fromCharCode(code2),\n start: start,\n end: index\n };\n case 0x21: // !\n case 0x3D:\n // =\n index += 2;\n\n // !== and ===\n if (source.charCodeAt(index) === 0x3D) {\n ++index;\n }\n return {\n type: TokenPunctuator,\n value: source.slice(start, index),\n start: start,\n end: index\n };\n }\n }\n }\n\n // 4-character punctuator: >>>=\n\n ch4 = source.substr(index, 4);\n if (ch4 === '>>>=') {\n index += 4;\n return {\n type: TokenPunctuator,\n value: ch4,\n start: start,\n end: index\n };\n }\n\n // 3-character punctuators: === !== >>> <<= >>=\n\n ch3 = ch4.substr(0, 3);\n if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {\n index += 3;\n return {\n type: TokenPunctuator,\n value: ch3,\n start: start,\n end: index\n };\n }\n\n // Other 2-character punctuators: ++ -- << >> && ||\n ch2 = ch3.substr(0, 2);\n if (ch1 === ch2[1] && '+-<>&|'.indexOf(ch1) >= 0 || ch2 === '=>') {\n index += 2;\n return {\n type: TokenPunctuator,\n value: ch2,\n start: start,\n end: index\n };\n }\n if (ch2 === '//') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n // 1-character punctuators: < > = ! + - * % & | ^ /\n\n if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n ++index;\n return {\n type: TokenPunctuator,\n value: ch1,\n start: start,\n end: index\n };\n }\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n}\n\n// 7.8.3 Numeric Literals\n\nfunction scanHexLiteral(start) {\n let number = '';\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n if (number.length === 0) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n return {\n type: TokenNumericLiteral,\n value: parseInt('0x' + number, 16),\n start: start,\n end: index\n };\n}\nfunction scanOctalLiteral(start) {\n let number = '0' + source[index++];\n while (index < length) {\n if (!isOctalDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n return {\n type: TokenNumericLiteral,\n value: parseInt(number, 8),\n octal: true,\n start: start,\n end: index\n };\n}\nfunction scanNumericLiteral() {\n var number, start, ch;\n ch = source[index];\n assert(isDecimalDigit(ch.charCodeAt(0)) || ch === '.', 'Numeric literal must start with a decimal digit or a decimal point');\n start = index;\n number = '';\n if (ch !== '.') {\n number = source[index++];\n ch = source[index];\n\n // Hex number starts with '0x'.\n // Octal number starts with '0'.\n if (number === '0') {\n if (ch === 'x' || ch === 'X') {\n ++index;\n return scanHexLiteral(start);\n }\n if (isOctalDigit(ch)) {\n return scanOctalLiteral(start);\n }\n\n // decimal number starts with '0' such as '09' is illegal.\n if (ch && isDecimalDigit(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n if (ch === '.') {\n number += source[index++];\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n if (ch === 'e' || ch === 'E') {\n number += source[index++];\n ch = source[index];\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n if (isDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n return {\n type: TokenNumericLiteral,\n value: parseFloat(number),\n start: start,\n end: index\n };\n}\n\n// 7.8.4 String Literals\n\nfunction scanStringLiteral() {\n var str = '',\n quote,\n start,\n ch,\n code,\n octal = false;\n quote = source[index];\n assert(quote === '\\'' || quote === '\"', 'String literal must starts with a quote');\n start = index;\n ++index;\n while (index < length) {\n ch = source[index++];\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'u':\n case 'x':\n if (source[index] === '{') {\n ++index;\n str += scanUnicodeCodePointEscape();\n } else {\n str += scanHexEscape(ch);\n }\n break;\n case 'n':\n str += '\\n';\n break;\n case 'r':\n str += '\\r';\n break;\n case 't':\n str += '\\t';\n break;\n case 'b':\n str += '\\b';\n break;\n case 'f':\n str += '\\f';\n break;\n case 'v':\n str += '\\x0B';\n break;\n default:\n if (isOctalDigit(ch)) {\n code = '01234567'.indexOf(ch);\n\n // \\0 is not octal escape sequence\n if (code !== 0) {\n octal = true;\n }\n if (index < length && isOctalDigit(source[index])) {\n octal = true;\n code = code * 8 + '01234567'.indexOf(source[index++]);\n\n // 3 digits are only allowed when string starts\n // with 0, 1, 2, 3\n if ('0123'.indexOf(ch) >= 0 && index < length && isOctalDigit(source[index])) {\n code = code * 8 + '01234567'.indexOf(source[index++]);\n }\n }\n str += String.fromCharCode(code);\n } else {\n str += ch;\n }\n break;\n }\n } else {\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n if (quote !== '') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n return {\n type: TokenStringLiteral,\n value: str,\n octal: octal,\n start: start,\n end: index\n };\n}\nfunction testRegExp(pattern, flags) {\n let tmp = pattern;\n if (flags.indexOf('u') >= 0) {\n // Replace each astral symbol and every Unicode code point\n // escape sequence with a single ASCII symbol to avoid throwing on\n // regular expressions that are only valid in combination with the\n // `/u` flag.\n // Note: replacing with the ASCII symbol `x` might cause false\n // negatives in unlikely scenarios. For example, `[\\u{61}-b]` is a\n // perfectly valid pattern that is equivalent to `[a-b]`, but it\n // would be replaced by `[x-b]` which throws an error.\n tmp = tmp.replace(/\\\\u\\{([0-9a-fA-F]+)\\}/g, ($0, $1) => {\n if (parseInt($1, 16) <= 0x10FFFF) {\n return 'x';\n }\n throwError({}, MessageInvalidRegExp);\n }).replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g, 'x');\n }\n\n // First, detect invalid regular expressions.\n try {\n new RegExp(tmp);\n } catch (e) {\n throwError({}, MessageInvalidRegExp);\n }\n\n // Return a regular expression object for this pattern-flag pair, or\n // `null` in case the current environment doesn't support the flags it\n // uses.\n try {\n return new RegExp(pattern, flags);\n } catch (exception) {\n return null;\n }\n}\nfunction scanRegExpBody() {\n var ch, str, classMarker, terminated, body;\n ch = source[index];\n assert(ch === '/', 'Regular expression literal must start with a slash');\n str = source[index++];\n classMarker = false;\n terminated = false;\n while (index < length) {\n ch = source[index++];\n str += ch;\n if (ch === '\\\\') {\n ch = source[index++];\n // ECMA-262 7.8.5\n if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, MessageUnterminatedRegExp);\n }\n str += ch;\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, MessageUnterminatedRegExp);\n } else if (classMarker) {\n if (ch === ']') {\n classMarker = false;\n }\n } else {\n if (ch === '/') {\n terminated = true;\n break;\n } else if (ch === '[') {\n classMarker = true;\n }\n }\n }\n if (!terminated) {\n throwError({}, MessageUnterminatedRegExp);\n }\n\n // Exclude leading and trailing slash.\n body = str.substr(1, str.length - 2);\n return {\n value: body,\n literal: str\n };\n}\nfunction scanRegExpFlags() {\n var ch, str, flags;\n str = '';\n flags = '';\n while (index < length) {\n ch = source[index];\n if (!isIdentifierPart(ch.charCodeAt(0))) {\n break;\n }\n ++index;\n if (ch === '\\\\' && index < length) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } else {\n flags += ch;\n str += ch;\n }\n }\n if (flags.search(/[^gimuy]/g) >= 0) {\n throwError({}, MessageInvalidRegExp, flags);\n }\n return {\n value: flags,\n literal: str\n };\n}\nfunction scanRegExp() {\n var start, body, flags, value;\n lookahead = null;\n skipComment();\n start = index;\n body = scanRegExpBody();\n flags = scanRegExpFlags();\n value = testRegExp(body.value, flags.value);\n return {\n literal: body.literal + flags.literal,\n value: value,\n regex: {\n pattern: body.value,\n flags: flags.value\n },\n start: start,\n end: index\n };\n}\nfunction isIdentifierName(token) {\n return token.type === TokenIdentifier || token.type === TokenKeyword || token.type === TokenBooleanLiteral || token.type === TokenNullLiteral;\n}\nfunction advance() {\n skipComment();\n if (index >= length) {\n return {\n type: TokenEOF,\n start: index,\n end: index\n };\n }\n const ch = source.charCodeAt(index);\n if (isIdentifierStart(ch)) {\n return scanIdentifier();\n }\n\n // Very common: ( and ) and ;\n if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {\n return scanPunctuator();\n }\n\n // String literal starts with single quote (U+0027) or double quote (U+0022).\n if (ch === 0x27 || ch === 0x22) {\n return scanStringLiteral();\n }\n\n // Dot (.) U+002E can also start a floating-point number, hence the need\n // to check the next character.\n if (ch === 0x2E) {\n if (isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNumericLiteral();\n }\n return scanPunctuator();\n }\n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n return scanPunctuator();\n}\nfunction lex() {\n const token = lookahead;\n index = token.end;\n lookahead = advance();\n index = token.end;\n return token;\n}\nfunction peek() {\n const pos = index;\n lookahead = advance();\n index = pos;\n}\nfunction finishArrayExpression(elements) {\n const node = new ASTNode(SyntaxArrayExpression);\n node.elements = elements;\n return node;\n}\nfunction finishBinaryExpression(operator, left, right) {\n const node = new ASTNode(operator === '||' || operator === '&&' ? SyntaxLogicalExpression : SyntaxBinaryExpression);\n node.operator = operator;\n node.left = left;\n node.right = right;\n return node;\n}\nfunction finishCallExpression(callee, args) {\n const node = new ASTNode(SyntaxCallExpression);\n node.callee = callee;\n node.arguments = args;\n return node;\n}\nfunction finishConditionalExpression(test, consequent, alternate) {\n const node = new ASTNode(SyntaxConditionalExpression);\n node.test = test;\n node.consequent = consequent;\n node.alternate = alternate;\n return node;\n}\nfunction finishIdentifier(name) {\n const node = new ASTNode(SyntaxIdentifier);\n node.name = name;\n return node;\n}\nfunction finishLiteral(token) {\n const node = new ASTNode(SyntaxLiteral);\n node.value = token.value;\n node.raw = source.slice(token.start, token.end);\n if (token.regex) {\n if (node.raw === '//') {\n node.raw = '/(?:)/';\n }\n node.regex = token.regex;\n }\n return node;\n}\nfunction finishMemberExpression(accessor, object, property) {\n const node = new ASTNode(SyntaxMemberExpression);\n node.computed = accessor === '[';\n node.object = object;\n node.property = property;\n if (!node.computed) property.member = true;\n return node;\n}\nfunction finishObjectExpression(properties) {\n const node = new ASTNode(SyntaxObjectExpression);\n node.properties = properties;\n return node;\n}\nfunction finishProperty(kind, key, value) {\n const node = new ASTNode(SyntaxProperty);\n node.key = key;\n node.value = value;\n node.kind = kind;\n return node;\n}\nfunction finishUnaryExpression(operator, argument) {\n const node = new ASTNode(SyntaxUnaryExpression);\n node.operator = operator;\n node.argument = argument;\n node.prefix = true;\n return node;\n}\n\n// Throw an exception\n\nfunction throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(/%(\\d)/g, (whole, index) => {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n });\n error = new Error(msg);\n error.index = index;\n error.description = msg;\n throw error;\n}\n\n// Throw an exception because of the token.\n\nfunction throwUnexpected(token) {\n if (token.type === TokenEOF) {\n throwError(token, MessageUnexpectedEOS);\n }\n if (token.type === TokenNumericLiteral) {\n throwError(token, MessageUnexpectedNumber);\n }\n if (token.type === TokenStringLiteral) {\n throwError(token, MessageUnexpectedString);\n }\n if (token.type === TokenIdentifier) {\n throwError(token, MessageUnexpectedIdentifier);\n }\n if (token.type === TokenKeyword) {\n throwError(token, MessageUnexpectedReserved);\n }\n\n // BooleanLiteral, NullLiteral, or Punctuator.\n throwError(token, MessageUnexpectedToken, token.value);\n}\n\n// Expect the next token to match the specified punctuator.\n// If not, an exception will be thrown.\n\nfunction expect(value) {\n const token = lex();\n if (token.type !== TokenPunctuator || token.value !== value) {\n throwUnexpected(token);\n }\n}\n\n// Return true if the next token matches the specified punctuator.\n\nfunction match(value) {\n return lookahead.type === TokenPunctuator && lookahead.value === value;\n}\n\n// Return true if the next token matches the specified keyword\n\nfunction matchKeyword(keyword) {\n return lookahead.type === TokenKeyword && lookahead.value === keyword;\n}\n\n// 11.1.4 Array Initialiser\n\nfunction parseArrayInitialiser() {\n const elements = [];\n index = lookahead.start;\n expect('[');\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elements.push(parseConditionalExpression());\n if (!match(']')) {\n expect(',');\n }\n }\n }\n lex();\n return finishArrayExpression(elements);\n}\n\n// 11.1.5 Object Initialiser\n\nfunction parseObjectPropertyKey() {\n index = lookahead.start;\n const token = lex();\n\n // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n\n if (token.type === TokenStringLiteral || token.type === TokenNumericLiteral) {\n if (token.octal) {\n throwError(token, MessageStrictOctalLiteral);\n }\n return finishLiteral(token);\n }\n return finishIdentifier(token.value);\n}\nfunction parseObjectProperty() {\n var token, key, id, value;\n index = lookahead.start;\n token = lookahead;\n if (token.type === TokenIdentifier) {\n id = parseObjectPropertyKey();\n expect(':');\n value = parseConditionalExpression();\n return finishProperty('init', id, value);\n }\n if (token.type === TokenEOF || token.type === TokenPunctuator) {\n throwUnexpected(token);\n } else {\n key = parseObjectPropertyKey();\n expect(':');\n value = parseConditionalExpression();\n return finishProperty('init', key, value);\n }\n}\nfunction parseObjectInitialiser() {\n var properties = [],\n property,\n name,\n key,\n map = {},\n toString = String;\n index = lookahead.start;\n expect('{');\n while (!match('}')) {\n property = parseObjectProperty();\n if (property.key.type === SyntaxIdentifier) {\n name = property.key.name;\n } else {\n name = toString(property.key.value);\n }\n key = '$' + name;\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n throwError({}, MessageStrictDuplicateProperty);\n } else {\n map[key] = true;\n }\n properties.push(property);\n if (!match('}')) {\n expect(',');\n }\n }\n expect('}');\n return finishObjectExpression(properties);\n}\n\n// 11.1.6 The Grouping Operator\n\nfunction parseGroupExpression() {\n expect('(');\n const expr = parseExpression();\n expect(')');\n return expr;\n}\n\n// 11.1 Primary Expressions\n\nconst legalKeywords = {\n 'if': 1\n};\nfunction parsePrimaryExpression() {\n var type, token, expr;\n if (match('(')) {\n return parseGroupExpression();\n }\n if (match('[')) {\n return parseArrayInitialiser();\n }\n if (match('{')) {\n return parseObjectInitialiser();\n }\n type = lookahead.type;\n index = lookahead.start;\n if (type === TokenIdentifier || legalKeywords[lookahead.value]) {\n expr = finishIdentifier(lex().value);\n } else if (type === TokenStringLiteral || type === TokenNumericLiteral) {\n if (lookahead.octal) {\n throwError(lookahead, MessageStrictOctalLiteral);\n }\n expr = finishLiteral(lex());\n } else if (type === TokenKeyword) {\n throw new Error(DISABLED);\n } else if (type === TokenBooleanLiteral) {\n token = lex();\n token.value = token.value === 'true';\n expr = finishLiteral(token);\n } else if (type === TokenNullLiteral) {\n token = lex();\n token.value = null;\n expr = finishLiteral(token);\n } else if (match('/') || match('/=')) {\n expr = finishLiteral(scanRegExp());\n peek();\n } else {\n throwUnexpected(lex());\n }\n return expr;\n}\n\n// 11.2 Left-Hand-Side Expressions\n\nfunction parseArguments() {\n const args = [];\n expect('(');\n if (!match(')')) {\n while (index < length) {\n args.push(parseConditionalExpression());\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n expect(')');\n return args;\n}\nfunction parseNonComputedProperty() {\n index = lookahead.start;\n const token = lex();\n if (!isIdentifierName(token)) {\n throwUnexpected(token);\n }\n return finishIdentifier(token.value);\n}\nfunction parseNonComputedMember() {\n expect('.');\n return parseNonComputedProperty();\n}\nfunction parseComputedMember() {\n expect('[');\n const expr = parseExpression();\n expect(']');\n return expr;\n}\nfunction parseLeftHandSideExpressionAllowCall() {\n var expr, args, property;\n expr = parsePrimaryExpression();\n for (;;) {\n if (match('.')) {\n property = parseNonComputedMember();\n expr = finishMemberExpression('.', expr, property);\n } else if (match('(')) {\n args = parseArguments();\n expr = finishCallExpression(expr, args);\n } else if (match('[')) {\n property = parseComputedMember();\n expr = finishMemberExpression('[', expr, property);\n } else {\n break;\n }\n }\n return expr;\n}\n\n// 11.3 Postfix Expressions\n\nfunction parsePostfixExpression() {\n const expr = parseLeftHandSideExpressionAllowCall();\n if (lookahead.type === TokenPunctuator) {\n if (match('++') || match('--')) {\n throw new Error(DISABLED);\n }\n }\n return expr;\n}\n\n// 11.4 Unary Operators\n\nfunction parseUnaryExpression() {\n var token, expr;\n if (lookahead.type !== TokenPunctuator && lookahead.type !== TokenKeyword) {\n expr = parsePostfixExpression();\n } else if (match('++') || match('--')) {\n throw new Error(DISABLED);\n } else if (match('+') || match('-') || match('~') || match('!')) {\n token = lex();\n expr = parseUnaryExpression();\n expr = finishUnaryExpression(token.value, expr);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n throw new Error(DISABLED);\n } else {\n expr = parsePostfixExpression();\n }\n return expr;\n}\nfunction binaryPrecedence(token) {\n let prec = 0;\n if (token.type !== TokenPunctuator && token.type !== TokenKeyword) {\n return 0;\n }\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n case '&&':\n prec = 2;\n break;\n case '|':\n prec = 3;\n break;\n case '^':\n prec = 4;\n break;\n case '&':\n prec = 5;\n break;\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n case 'in':\n prec = 7;\n break;\n case '<<':\n case '>>':\n case '>>>':\n prec = 8;\n break;\n case '+':\n case '-':\n prec = 9;\n break;\n case '*':\n case '/':\n case '%':\n prec = 11;\n break;\n }\n return prec;\n}\n\n// 11.5 Multiplicative Operators\n// 11.6 Additive Operators\n// 11.7 Bitwise Shift Operators\n// 11.8 Relational Operators\n// 11.9 Equality Operators\n// 11.10 Binary Bitwise Operators\n// 11.11 Binary Logical Operators\n\nfunction parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n marker = lookahead;\n left = parseUnaryExpression();\n token = lookahead;\n prec = binaryPrecedence(token);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n stack = [left, token, right];\n while ((prec = binaryPrecedence(lookahead)) > 0) {\n // Reduce: make a binary expression from the three topmost entries.\n while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = finishBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n markers.pop();\n expr = finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n return expr;\n}\n\n// 11.12 Conditional Operator\n\nfunction parseConditionalExpression() {\n var expr, consequent, alternate;\n expr = parseBinaryExpression();\n if (match('?')) {\n lex();\n consequent = parseConditionalExpression();\n expect(':');\n alternate = parseConditionalExpression();\n expr = finishConditionalExpression(expr, consequent, alternate);\n }\n return expr;\n}\n\n// 11.14 Comma Operator\n\nfunction parseExpression() {\n const expr = parseConditionalExpression();\n if (match(',')) {\n throw new Error(DISABLED); // no sequence expressions\n }\n\n return expr;\n}\nfunction parser (code) {\n source = code;\n index = 0;\n length = source.length;\n lookahead = null;\n peek();\n const expr = parseExpression();\n if (lookahead.type !== TokenEOF) {\n throw new Error('Unexpect token after expression.');\n }\n return expr;\n}\n\nvar Constants = {\n NaN: 'NaN',\n E: 'Math.E',\n LN2: 'Math.LN2',\n LN10: 'Math.LN10',\n LOG2E: 'Math.LOG2E',\n LOG10E: 'Math.LOG10E',\n PI: 'Math.PI',\n SQRT1_2: 'Math.SQRT1_2',\n SQRT2: 'Math.SQRT2',\n MIN_VALUE: 'Number.MIN_VALUE',\n MAX_VALUE: 'Number.MAX_VALUE'\n};\n\nfunction Functions (codegen) {\n function fncall(name, args, cast, type) {\n let obj = codegen(args[0]);\n if (cast) {\n obj = cast + '(' + obj + ')';\n if (cast.lastIndexOf('new ', 0) === 0) obj = '(' + obj + ')';\n }\n return obj + '.' + name + (type < 0 ? '' : type === 0 ? '()' : '(' + args.slice(1).map(codegen).join(',') + ')');\n }\n function fn(name, cast, type) {\n return args => fncall(name, args, cast, type);\n }\n const DATE = 'new Date',\n STRING = 'String',\n REGEXP = 'RegExp';\n return {\n // MATH functions\n isNaN: 'Number.isNaN',\n isFinite: 'Number.isFinite',\n abs: 'Math.abs',\n acos: 'Math.acos',\n asin: 'Math.asin',\n atan: 'Math.atan',\n atan2: 'Math.atan2',\n ceil: 'Math.ceil',\n cos: 'Math.cos',\n exp: 'Math.exp',\n floor: 'Math.floor',\n log: 'Math.log',\n max: 'Math.max',\n min: 'Math.min',\n pow: 'Math.pow',\n random: 'Math.random',\n round: 'Math.round',\n sin: 'Math.sin',\n sqrt: 'Math.sqrt',\n tan: 'Math.tan',\n clamp: function (args) {\n if (args.length < 3) error('Missing arguments to clamp function.');\n if (args.length > 3) error('Too many arguments to clamp function.');\n const a = args.map(codegen);\n return 'Math.max(' + a[1] + ', Math.min(' + a[2] + ',' + a[0] + '))';\n },\n // DATE functions\n now: 'Date.now',\n utc: 'Date.UTC',\n datetime: DATE,\n date: fn('getDate', DATE, 0),\n day: fn('getDay', DATE, 0),\n year: fn('getFullYear', DATE, 0),\n month: fn('getMonth', DATE, 0),\n hours: fn('getHours', DATE, 0),\n minutes: fn('getMinutes', DATE, 0),\n seconds: fn('getSeconds', DATE, 0),\n milliseconds: fn('getMilliseconds', DATE, 0),\n time: fn('getTime', DATE, 0),\n timezoneoffset: fn('getTimezoneOffset', DATE, 0),\n utcdate: fn('getUTCDate', DATE, 0),\n utcday: fn('getUTCDay', DATE, 0),\n utcyear: fn('getUTCFullYear', DATE, 0),\n utcmonth: fn('getUTCMonth', DATE, 0),\n utchours: fn('getUTCHours', DATE, 0),\n utcminutes: fn('getUTCMinutes', DATE, 0),\n utcseconds: fn('getUTCSeconds', DATE, 0),\n utcmilliseconds: fn('getUTCMilliseconds', DATE, 0),\n // sequence functions\n length: fn('length', null, -1),\n // STRING functions\n parseFloat: 'parseFloat',\n parseInt: 'parseInt',\n upper: fn('toUpperCase', STRING, 0),\n lower: fn('toLowerCase', STRING, 0),\n substring: fn('substring', STRING),\n split: fn('split', STRING),\n trim: fn('trim', STRING, 0),\n // REGEXP functions\n regexp: REGEXP,\n test: fn('test', REGEXP),\n // Control Flow functions\n if: function (args) {\n if (args.length < 3) error('Missing arguments to if function.');\n if (args.length > 3) error('Too many arguments to if function.');\n const a = args.map(codegen);\n return '(' + a[0] + '?' + a[1] + ':' + a[2] + ')';\n }\n };\n}\n\nfunction stripQuotes(s) {\n const n = s && s.length - 1;\n return n && (s[0] === '\"' && s[n] === '\"' || s[0] === '\\'' && s[n] === '\\'') ? s.slice(1, -1) : s;\n}\nfunction codegen (opt) {\n opt = opt || {};\n const allowed = opt.allowed ? toSet(opt.allowed) : {},\n forbidden = opt.forbidden ? toSet(opt.forbidden) : {},\n constants = opt.constants || Constants,\n functions = (opt.functions || Functions)(visit),\n globalvar = opt.globalvar,\n fieldvar = opt.fieldvar,\n outputGlobal = isFunction(globalvar) ? globalvar : id => `${globalvar}[\"${id}\"]`;\n let globals = {},\n fields = {},\n memberDepth = 0;\n function visit(ast) {\n if (isString(ast)) return ast;\n const generator = Generators[ast.type];\n if (generator == null) error('Unsupported type: ' + ast.type);\n return generator(ast);\n }\n const Generators = {\n Literal: n => n.raw,\n Identifier: n => {\n const id = n.name;\n if (memberDepth > 0) {\n return id;\n } else if (hasOwnProperty(forbidden, id)) {\n return error('Illegal identifier: ' + id);\n } else if (hasOwnProperty(constants, id)) {\n return constants[id];\n } else if (hasOwnProperty(allowed, id)) {\n return id;\n } else {\n globals[id] = 1;\n return outputGlobal(id);\n }\n },\n MemberExpression: n => {\n const d = !n.computed,\n o = visit(n.object);\n if (d) memberDepth += 1;\n const p = visit(n.property);\n if (o === fieldvar) {\n // strip quotes to sanitize field name (#1653)\n fields[stripQuotes(p)] = 1;\n }\n if (d) memberDepth -= 1;\n return o + (d ? '.' + p : '[' + p + ']');\n },\n CallExpression: n => {\n if (n.callee.type !== 'Identifier') {\n error('Illegal callee type: ' + n.callee.type);\n }\n const callee = n.callee.name,\n args = n.arguments,\n fn = hasOwnProperty(functions, callee) && functions[callee];\n if (!fn) error('Unrecognized function: ' + callee);\n return isFunction(fn) ? fn(args) : fn + '(' + args.map(visit).join(',') + ')';\n },\n ArrayExpression: n => '[' + n.elements.map(visit).join(',') + ']',\n BinaryExpression: n => '(' + visit(n.left) + ' ' + n.operator + ' ' + visit(n.right) + ')',\n UnaryExpression: n => '(' + n.operator + visit(n.argument) + ')',\n ConditionalExpression: n => '(' + visit(n.test) + '?' + visit(n.consequent) + ':' + visit(n.alternate) + ')',\n LogicalExpression: n => '(' + visit(n.left) + n.operator + visit(n.right) + ')',\n ObjectExpression: n => '{' + n.properties.map(visit).join(',') + '}',\n Property: n => {\n memberDepth += 1;\n const k = visit(n.key);\n memberDepth -= 1;\n return k + ':' + visit(n.value);\n }\n };\n function codegen(ast) {\n const result = {\n code: visit(ast),\n globals: Object.keys(globals),\n fields: Object.keys(fields)\n };\n globals = {};\n fields = {};\n return result;\n }\n codegen.functions = functions;\n codegen.constants = constants;\n return codegen;\n}\n\nexport { ASTNode, ArrayExpression, BinaryExpression, CallExpression, ConditionalExpression, Identifier, Literal, LogicalExpression, MemberExpression, ObjectExpression, Property, RawCode, UnaryExpression, codegen as codegenExpression, Constants as constants, Functions as functions, parser as parseExpression };\n","import {Adder} from \"d3-array\";\nimport {atan2, cos, quarterPi, radians, sin, tau} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nexport var areaRingSum = new Adder();\n\n// hello?\n\nvar areaSum = new Adder(),\n lambda00,\n phi00,\n lambda0,\n cosPhi0,\n sinPhi0;\n\nexport var areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaRingSum = new Adder();\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n var areaRing = +areaRingSum;\n areaSum.add(areaRing < 0 ? tau + areaRing : areaRing);\n this.lineStart = this.lineEnd = this.point = noop;\n },\n sphere: function() {\n areaSum.add(tau);\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaRingEnd() {\n areaPoint(lambda00, phi00);\n}\n\nfunction areaPointFirst(lambda, phi) {\n areaStream.point = areaPoint;\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi);\n}\n\nfunction areaPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n phi = phi / 2 + quarterPi; // half the angular distance from south pole\n\n // Spherical excess E for a spherical triangle with vertices: south pole,\n // previous point, current point. Uses a formula derived from Cagnoli’s\n // theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2).\n var dLambda = lambda - lambda0,\n sdLambda = dLambda >= 0 ? 1 : -1,\n adLambda = sdLambda * dLambda,\n cosPhi = cos(phi),\n sinPhi = sin(phi),\n k = sinPhi0 * sinPhi,\n u = cosPhi0 * cosPhi + k * cos(adLambda),\n v = k * sdLambda * sin(adLambda);\n areaRingSum.add(atan2(v, u));\n\n // Advance the previous points.\n lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;\n}\n\nexport default function(object) {\n areaSum = new Adder();\n stream(object, areaStream);\n return areaSum * 2;\n}\n","import {Adder} from \"d3-array\";\nimport {areaStream, areaRingSum} from \"./area.js\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport {abs, degrees, epsilon, radians} from \"./math.js\";\nimport stream from \"./stream.js\";\n\nvar lambda0, phi0, lambda1, phi1, // bounds\n lambda2, // previous lambda-coordinate\n lambda00, phi00, // first point\n p0, // previous 3D point\n deltaSum,\n ranges,\n range;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: boundsLineStart,\n lineEnd: boundsLineEnd,\n polygonStart: function() {\n boundsStream.point = boundsRingPoint;\n boundsStream.lineStart = boundsRingStart;\n boundsStream.lineEnd = boundsRingEnd;\n deltaSum = new Adder();\n areaStream.polygonStart();\n },\n polygonEnd: function() {\n areaStream.polygonEnd();\n boundsStream.point = boundsPoint;\n boundsStream.lineStart = boundsLineStart;\n boundsStream.lineEnd = boundsLineEnd;\n if (areaRingSum < 0) lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n else if (deltaSum > epsilon) phi1 = 90;\n else if (deltaSum < -epsilon) phi0 = -90;\n range[0] = lambda0, range[1] = lambda1;\n },\n sphere: function() {\n lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n }\n};\n\nfunction boundsPoint(lambda, phi) {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n}\n\nfunction linePoint(lambda, phi) {\n var p = cartesian([lambda * radians, phi * radians]);\n if (p0) {\n var normal = cartesianCross(p0, p),\n equatorial = [normal[1], -normal[0], 0],\n inflection = cartesianCross(equatorial, normal);\n cartesianNormalizeInPlace(inflection);\n inflection = spherical(inflection);\n var delta = lambda - lambda2,\n sign = delta > 0 ? 1 : -1,\n lambdai = inflection[0] * degrees * sign,\n phii,\n antimeridian = abs(delta) > 180;\n if (antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = inflection[1] * degrees;\n if (phii > phi1) phi1 = phii;\n } else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = -inflection[1] * degrees;\n if (phii < phi0) phi0 = phii;\n } else {\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n }\n if (antimeridian) {\n if (lambda < lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n } else {\n if (lambda1 >= lambda0) {\n if (lambda < lambda0) lambda0 = lambda;\n if (lambda > lambda1) lambda1 = lambda;\n } else {\n if (lambda > lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n }\n }\n } else {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n }\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n p0 = p, lambda2 = lambda;\n}\n\nfunction boundsLineStart() {\n boundsStream.point = linePoint;\n}\n\nfunction boundsLineEnd() {\n range[0] = lambda0, range[1] = lambda1;\n boundsStream.point = boundsPoint;\n p0 = null;\n}\n\nfunction boundsRingPoint(lambda, phi) {\n if (p0) {\n var delta = lambda - lambda2;\n deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);\n } else {\n lambda00 = lambda, phi00 = phi;\n }\n areaStream.point(lambda, phi);\n linePoint(lambda, phi);\n}\n\nfunction boundsRingStart() {\n areaStream.lineStart();\n}\n\nfunction boundsRingEnd() {\n boundsRingPoint(lambda00, phi00);\n areaStream.lineEnd();\n if (abs(deltaSum) > epsilon) lambda0 = -(lambda1 = 180);\n range[0] = lambda0, range[1] = lambda1;\n p0 = null;\n}\n\n// Finds the left-right distance between two longitudes.\n// This is almost the same as (lambda1 - lambda0 + 360°) % 360°, except that we want\n// the distance between ±180° to be 360°.\nfunction angle(lambda0, lambda1) {\n return (lambda1 -= lambda0) < 0 ? lambda1 + 360 : lambda1;\n}\n\nfunction rangeCompare(a, b) {\n return a[0] - b[0];\n}\n\nfunction rangeContains(range, x) {\n return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;\n}\n\nexport default function(feature) {\n var i, n, a, b, merged, deltaMax, delta;\n\n phi1 = lambda1 = -(lambda0 = phi0 = Infinity);\n ranges = [];\n stream(feature, boundsStream);\n\n // First, sort ranges by their minimum longitudes.\n if (n = ranges.length) {\n ranges.sort(rangeCompare);\n\n // Then, merge any ranges that overlap.\n for (i = 1, a = ranges[0], merged = [a]; i < n; ++i) {\n b = ranges[i];\n if (rangeContains(a, b[0]) || rangeContains(a, b[1])) {\n if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];\n if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];\n } else {\n merged.push(a = b);\n }\n }\n\n // Finally, find the largest gap between the merged ranges.\n // The final bounding box will be the inverse of this gap.\n for (deltaMax = -Infinity, n = merged.length - 1, i = 0, a = merged[n]; i <= n; a = b, ++i) {\n b = merged[i];\n if ((delta = angle(a[1], b[0])) > deltaMax) deltaMax = delta, lambda0 = b[0], lambda1 = a[1];\n }\n }\n\n ranges = range = null;\n\n return lambda0 === Infinity || phi0 === Infinity\n ? [[NaN, NaN], [NaN, NaN]]\n : [[lambda0, phi0], [lambda1, phi1]];\n}\n","import {Adder} from \"d3-array\";\nimport {asin, atan2, cos, degrees, epsilon, epsilon2, hypot, radians, sin, sqrt} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nvar W0, W1,\n X0, Y0, Z0,\n X1, Y1, Z1,\n X2, Y2, Z2,\n lambda00, phi00, // first point\n x0, y0, z0; // previous point\n\nvar centroidStream = {\n sphere: noop,\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n }\n};\n\n// Arithmetic mean of Cartesian vectors.\nfunction centroidPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n centroidPointCartesian(cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi));\n}\n\nfunction centroidPointCartesian(x, y, z) {\n ++W0;\n X0 += (x - X0) / W0;\n Y0 += (y - Y0) / W0;\n Z0 += (z - Z0) / W0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidLinePointFirst;\n}\n\nfunction centroidLinePointFirst(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidStream.point = centroidLinePoint;\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLinePoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n w = atan2(sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\n// See J. E. Brock, The Inertia Tensor for a Spherical Triangle,\n// J. Applied Mechanics 42, 239 (1975).\nfunction centroidRingStart() {\n centroidStream.point = centroidRingPointFirst;\n}\n\nfunction centroidRingEnd() {\n centroidRingPoint(lambda00, phi00);\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingPointFirst(lambda, phi) {\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n centroidStream.point = centroidRingPoint;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidRingPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n cx = y0 * z - z0 * y,\n cy = z0 * x - x0 * z,\n cz = x0 * y - y0 * x,\n m = hypot(cx, cy, cz),\n w = asin(m), // line weight = angle\n v = m && -w / m; // area weight multiplier\n X2.add(v * cx);\n Y2.add(v * cy);\n Z2.add(v * cz);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nexport default function(object) {\n W0 = W1 =\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 = 0;\n X2 = new Adder();\n Y2 = new Adder();\n Z2 = new Adder();\n stream(object, centroidStream);\n\n var x = +X2,\n y = +Y2,\n z = +Z2,\n m = hypot(x, y, z);\n\n // If the area-weighted ccentroid is undefined, fall back to length-weighted ccentroid.\n if (m < epsilon2) {\n x = X1, y = Y1, z = Z1;\n // If the feature has zero length, fall back to arithmetic mean of point vectors.\n if (W1 < epsilon) x = X0, y = Y0, z = Z0;\n m = hypot(x, y, z);\n // If the feature still has an undefined ccentroid, then return.\n if (m < epsilon2) return [NaN, NaN];\n }\n\n return [atan2(y, x) * degrees, asin(z / m) * degrees];\n}\n","export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n","import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can’t do this\n // for a comparator (except for specific, known comparators) because we can’t\n // tell if the comparator is symmetric, and an asymmetric comparator can’t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n","import {InternSet} from \"internmap\";\n\nexport default function intersection(values, ...others) {\n values = new InternSet(values);\n others = others.map(set);\n out: for (const value of values) {\n for (const other of others) {\n if (!other.has(value)) {\n values.delete(value);\n continue out;\n }\n }\n }\n return values;\n}\n\nfunction set(values) {\n return values instanceof InternSet ? values : new InternSet(values);\n}\n","import { bisector, union, intersection } from 'd3-array';\nimport { field, isDate, toNumber, isArray, inrange, extend, array, error, peek, hasOwnProperty } from 'vega-util';\nimport { Literal } from 'vega-expression';\n\nconst Intersect = 'intersect';\nconst Union = 'union';\nconst VlMulti = 'vlMulti';\nconst VlPoint = 'vlPoint';\nconst Or = 'or';\nconst And = 'and';\nconst SelectionId = '_vgsid_';\nconst $selectionId = field(SelectionId);\n\nconst TYPE_ENUM = 'E',\n TYPE_RANGE_INC = 'R',\n TYPE_RANGE_EXC = 'R-E',\n TYPE_RANGE_LE = 'R-LE',\n TYPE_RANGE_RE = 'R-RE',\n UNIT_INDEX = 'index:unit';\n\n// TODO: revisit date coercion?\nfunction testPoint(datum, entry) {\n var fields = entry.fields,\n values = entry.values,\n n = fields.length,\n i = 0,\n dval,\n f;\n for (; i < n; ++i) {\n f = fields[i];\n f.getter = field.getter || field(f.field);\n dval = f.getter(datum);\n if (isDate(dval)) dval = toNumber(dval);\n if (isDate(values[i])) values[i] = toNumber(values[i]);\n if (isDate(values[i][0])) values[i] = values[i].map(toNumber);\n if (f.type === TYPE_ENUM) {\n // Enumerated fields can either specify individual values (single/multi selections)\n // or an array of values (interval selections).\n if (isArray(values[i]) ? values[i].indexOf(dval) < 0 : dval !== values[i]) {\n return false;\n }\n } else {\n if (f.type === TYPE_RANGE_INC) {\n if (!inrange(dval, values[i])) return false;\n } else if (f.type === TYPE_RANGE_RE) {\n // Discrete selection of bins test within the range [bin_start, bin_end).\n if (!inrange(dval, values[i], true, false)) return false;\n } else if (f.type === TYPE_RANGE_EXC) {\n // 'R-E'/'R-LE' included for completeness.\n if (!inrange(dval, values[i], false, false)) return false;\n } else if (f.type === TYPE_RANGE_LE) {\n if (!inrange(dval, values[i], false, true)) return false;\n }\n }\n }\n return true;\n}\n\n/**\n * Tests if a tuple is contained within an interactive selection.\n * @param {string} name - The name of the data set representing the selection.\n * Tuples in the dataset are of the form\n * {unit: string, fields: array, values: array<*>}.\n * Fielddef is of the form\n * {field: string, channel: string, type: 'E' | 'R'} where\n * 'type' identifies whether tuples in the dataset enumerate\n * values for the field, or specify a continuous range.\n * @param {object} datum - The tuple to test for inclusion.\n * @param {string} op - The set operation for combining selections.\n * One of 'intersect' or 'union' (default).\n * @return {boolean} - True if the datum is in the selection, false otherwise.\n */\nfunction selectionTest(name, datum, op) {\n var data = this.context.data[name],\n entries = data ? data.values.value : [],\n unitIdx = data ? data[UNIT_INDEX] && data[UNIT_INDEX].value : undefined,\n intersect = op === Intersect,\n n = entries.length,\n i = 0,\n entry,\n miss,\n count,\n unit,\n b;\n for (; i < n; ++i) {\n entry = entries[i];\n if (unitIdx && intersect) {\n // multi selections union within the same unit and intersect across units.\n miss = miss || {};\n count = miss[unit = entry.unit] || 0;\n\n // if we've already matched this unit, skip.\n if (count === -1) continue;\n b = testPoint(datum, entry);\n miss[unit] = b ? -1 : ++count;\n\n // if we match and there are no other units return true\n // if we've missed against all tuples in this unit return false\n if (b && unitIdx.size === 1) return true;\n if (!b && count === unitIdx.get(unit).count) return false;\n } else {\n b = testPoint(datum, entry);\n\n // if we find a miss and we do require intersection return false\n // if we find a match and we don't require intersection return true\n if (intersect ^ b) return b;\n }\n }\n\n // if intersecting and we made it here, then we saw no misses\n // if not intersecting, then we saw no matches\n // if no active selections, return false\n return n && intersect;\n}\nconst bisect = bisector($selectionId),\n bisectLeft = bisect.left,\n bisectRight = bisect.right;\nfunction selectionIdTest(name, datum, op) {\n const data = this.context.data[name],\n entries = data ? data.values.value : [],\n unitIdx = data ? data[UNIT_INDEX] && data[UNIT_INDEX].value : undefined,\n intersect = op === Intersect,\n value = $selectionId(datum),\n index = bisectLeft(entries, value);\n if (index === entries.length) return false;\n if ($selectionId(entries[index]) !== value) return false;\n if (unitIdx && intersect) {\n if (unitIdx.size === 1) return true;\n if (bisectRight(entries, value) - index < unitIdx.size) return false;\n }\n return true;\n}\n\n/**\n * Maps an array of scene graph items to an array of selection tuples.\n * @param {string} name - The name of the dataset representing the selection.\n * @param {string} base - The base object that generated tuples extend.\n *\n * @returns {array} An array of selection entries for the given unit.\n */\nfunction selectionTuples(array, base) {\n return array.map(x => extend(base.fields ? {\n values: base.fields.map(f => (f.getter || (f.getter = field(f.field)))(x.datum))\n } : {\n [SelectionId]: $selectionId(x.datum)\n }, base));\n}\n\n/**\n * Resolves selection for use as a scale domain or reads via the API.\n * @param {string} name - The name of the dataset representing the selection\n * @param {string} [op='union'] - The set operation for combining selections.\n * One of 'intersect' or 'union' (default).\n * @param {boolean} isMulti - Identifies a \"multi\" selection to perform more\n * expensive resolution computation.\n * @param {boolean} vl5 - With Vega-Lite v5, \"multi\" selections are now called \"point\"\n * selections, and thus the resolved tuple should reflect this name.\n * This parameter allows us to reflect this change without triggering\n * a major version bump for Vega.\n * @returns {object} An object of selected fields and values.\n */\nfunction selectionResolve(name, op, isMulti, vl5) {\n var data = this.context.data[name],\n entries = data ? data.values.value : [],\n resolved = {},\n multiRes = {},\n types = {},\n entry,\n fields,\n values,\n unit,\n field,\n value,\n res,\n resUnit,\n type,\n union,\n n = entries.length,\n i = 0,\n j,\n m;\n\n // First union all entries within the same unit.\n for (; i < n; ++i) {\n entry = entries[i];\n unit = entry.unit;\n fields = entry.fields;\n values = entry.values;\n if (fields && values) {\n // Intentional selection stores\n for (j = 0, m = fields.length; j < m; ++j) {\n field = fields[j];\n res = resolved[field.field] || (resolved[field.field] = {});\n resUnit = res[unit] || (res[unit] = []);\n types[field.field] = type = field.type.charAt(0);\n union = ops[`${type}_union`];\n res[unit] = union(resUnit, array(values[j]));\n }\n\n // If the same multi-selection is repeated over views and projected over\n // an encoding, it may operate over different fields making it especially\n // tricky to reliably resolve it. At best, we can de-dupe identical entries\n // but doing so may be more computationally expensive than it is worth.\n // Instead, for now, we simply transform our store representation into\n // a more human-friendly one.\n if (isMulti) {\n resUnit = multiRes[unit] || (multiRes[unit] = []);\n resUnit.push(array(values).reduce((obj, curr, j) => (obj[fields[j].field] = curr, obj), {}));\n }\n } else {\n // Short circuit extensional selectionId stores which hold sorted IDs unique to each unit.\n field = SelectionId;\n value = $selectionId(entry);\n res = resolved[field] || (resolved[field] = {});\n resUnit = res[unit] || (res[unit] = []);\n resUnit.push(value);\n if (isMulti) {\n resUnit = multiRes[unit] || (multiRes[unit] = []);\n resUnit.push({\n [SelectionId]: value\n });\n }\n }\n }\n\n // Then resolve fields across units as per the op.\n op = op || Union;\n if (resolved[SelectionId]) {\n resolved[SelectionId] = ops[`${SelectionId}_${op}`](...Object.values(resolved[SelectionId]));\n } else {\n Object.keys(resolved).forEach(field => {\n resolved[field] = Object.keys(resolved[field]).map(unit => resolved[field][unit]).reduce((acc, curr) => acc === undefined ? curr : ops[`${types[field]}_${op}`](acc, curr));\n });\n }\n entries = Object.keys(multiRes);\n if (isMulti && entries.length) {\n const key = vl5 ? VlPoint : VlMulti;\n resolved[key] = op === Union ? {\n [Or]: entries.reduce((acc, k) => (acc.push(...multiRes[k]), acc), [])\n } : {\n [And]: entries.map(k => ({\n [Or]: multiRes[k]\n }))\n };\n }\n return resolved;\n}\nvar ops = {\n [`${SelectionId}_union`]: union,\n [`${SelectionId}_intersect`]: intersection,\n E_union: function (base, value) {\n if (!base.length) return value;\n var i = 0,\n n = value.length;\n for (; i < n; ++i) if (base.indexOf(value[i]) < 0) base.push(value[i]);\n return base;\n },\n E_intersect: function (base, value) {\n return !base.length ? value : base.filter(v => value.indexOf(v) >= 0);\n },\n R_union: function (base, value) {\n var lo = toNumber(value[0]),\n hi = toNumber(value[1]);\n if (lo > hi) {\n lo = value[1];\n hi = value[0];\n }\n if (!base.length) return [lo, hi];\n if (base[0] > lo) base[0] = lo;\n if (base[1] < hi) base[1] = hi;\n return base;\n },\n R_intersect: function (base, value) {\n var lo = toNumber(value[0]),\n hi = toNumber(value[1]);\n if (lo > hi) {\n lo = value[1];\n hi = value[0];\n }\n if (!base.length) return [lo, hi];\n if (hi < base[0] || base[1] < lo) {\n return [];\n } else {\n if (base[0] < lo) base[0] = lo;\n if (base[1] > hi) base[1] = hi;\n }\n return base;\n }\n};\n\nconst DataPrefix = ':',\n IndexPrefix = '@';\nfunction selectionVisitor(name, args, scope, params) {\n if (args[0].type !== Literal) error('First argument to selection functions must be a string literal.');\n const data = args[0].value,\n op = args.length >= 2 && peek(args).value,\n field = 'unit',\n indexName = IndexPrefix + field,\n dataName = DataPrefix + data;\n\n // eslint-disable-next-line no-prototype-builtins\n if (op === Intersect && !hasOwnProperty(params, indexName)) {\n params[indexName] = scope.getData(data).indataRef(scope, field);\n }\n\n // eslint-disable-next-line no-prototype-builtins\n if (!hasOwnProperty(params, dataName)) {\n params[dataName] = scope.getData(data).tuplesRef();\n }\n}\n\nexport { selectionIdTest, selectionResolve, selectionTest, selectionTuples, selectionVisitor };\n","import {InternSet} from \"internmap\";\n\nexport default function union(...others) {\n const set = new InternSet();\n for (const other of others) {\n for (const o of other) {\n set.add(o);\n }\n }\n return set;\n}\n","import { truthy, error, hasOwnProperty, isFunction, isString, stringValue, extend, isArray, isObject, field, peek, identity, array as array$1, isBoolean, isDate, isNumber, isRegExp, toBoolean, toDate, toNumber, toString, flush, lerp, pad, span, inrange, truncate, quarter, utcquarter, extent, clampRange, panLinear, panLog, panPow, panSymlog, zoomLinear, zoomLog, zoomPow, zoomSymlog } from 'vega-util';\nimport { Literal, codegenExpression, constants, functions, parseExpression, CallExpression } from 'vega-expression';\nimport { isRegisteredScale, bandSpace, scale as scale$1, scaleFraction } from 'vega-scale';\nimport { geoArea as geoArea$1, geoBounds as geoBounds$1, geoCentroid as geoCentroid$1 } from 'd3-geo';\nimport { rgb, lab, hcl, hsl } from 'd3-color';\nimport { isTuple } from 'vega-dataflow';\nimport { Gradient, pathRender, pathParse, Bounds, intersect as intersect$1 } from 'vega-scenegraph';\nimport { selectionVisitor, selectionTest, selectionIdTest, selectionResolve, selectionTuples } from 'vega-selections';\nimport { random, cumulativeNormal, cumulativeLogNormal, cumulativeUniform, densityNormal, densityLogNormal, densityUniform, quantileNormal, quantileLogNormal, quantileUniform, sampleNormal, sampleLogNormal, sampleUniform } from 'vega-statistics';\nimport { utcOffset, utcSequence, timeOffset, timeSequence, timeUnitSpecifier, week, utcweek, dayofyear, utcdayofyear } from 'vega-time';\nimport { range as range$1 } from 'd3-array';\n\nfunction data(name) {\n const data = this.context.data[name];\n return data ? data.values.value : [];\n}\nfunction indata(name, field, value) {\n const index = this.context.data[name]['index:' + field],\n entry = index ? index.value.get(value) : undefined;\n return entry ? entry.count : entry;\n}\nfunction setdata(name, tuples) {\n const df = this.context.dataflow,\n data = this.context.data[name],\n input = data.input;\n df.pulse(input, df.changeset().remove(truthy).insert(tuples));\n return 1;\n}\n\nfunction encode (item, name, retval) {\n if (item) {\n const df = this.context.dataflow,\n target = item.mark.source;\n df.pulse(target, df.changeset().encode(item, name));\n }\n return retval !== undefined ? retval : item;\n}\n\nconst wrap = method => function (value, spec) {\n const locale = this.context.dataflow.locale();\n return locale[method](spec)(value);\n};\nconst format = wrap('format');\nconst timeFormat = wrap('timeFormat');\nconst utcFormat = wrap('utcFormat');\nconst timeParse = wrap('timeParse');\nconst utcParse = wrap('utcParse');\nconst dateObj = new Date(2000, 0, 1);\nfunction time(month, day, specifier) {\n if (!Number.isInteger(month) || !Number.isInteger(day)) return '';\n dateObj.setYear(2000);\n dateObj.setMonth(month);\n dateObj.setDate(day);\n return timeFormat.call(this, dateObj, specifier);\n}\nfunction monthFormat(month) {\n return time.call(this, month, 1, '%B');\n}\nfunction monthAbbrevFormat(month) {\n return time.call(this, month, 1, '%b');\n}\nfunction dayFormat(day) {\n return time.call(this, 0, 2 + day, '%A');\n}\nfunction dayAbbrevFormat(day) {\n return time.call(this, 0, 2 + day, '%a');\n}\n\nconst DataPrefix = ':';\nconst IndexPrefix = '@';\nconst ScalePrefix = '%';\nconst SignalPrefix = '$';\n\nfunction dataVisitor(name, args, scope, params) {\n if (args[0].type !== Literal) {\n error('First argument to data functions must be a string literal.');\n }\n const data = args[0].value,\n dataName = DataPrefix + data;\n if (!hasOwnProperty(dataName, params)) {\n try {\n params[dataName] = scope.getData(data).tuplesRef();\n } catch (err) {\n // if data set does not exist, there's nothing to track\n }\n }\n}\nfunction indataVisitor(name, args, scope, params) {\n if (args[0].type !== Literal) error('First argument to indata must be a string literal.');\n if (args[1].type !== Literal) error('Second argument to indata must be a string literal.');\n const data = args[0].value,\n field = args[1].value,\n indexName = IndexPrefix + field;\n if (!hasOwnProperty(indexName, params)) {\n params[indexName] = scope.getData(data).indataRef(scope, field);\n }\n}\nfunction scaleVisitor(name, args, scope, params) {\n if (args[0].type === Literal) {\n // add scale dependency\n addScaleDependency(scope, params, args[0].value);\n } else {\n // indirect scale lookup; add all scales as parameters\n for (name in scope.scales) {\n addScaleDependency(scope, params, name);\n }\n }\n}\nfunction addScaleDependency(scope, params, name) {\n const scaleName = ScalePrefix + name;\n if (!hasOwnProperty(params, scaleName)) {\n try {\n params[scaleName] = scope.scaleRef(name);\n } catch (err) {\n // TODO: error handling? warning?\n }\n }\n}\n\nfunction getScale(nameOrFunction, ctx) {\n if (isFunction(nameOrFunction)) {\n return nameOrFunction;\n }\n if (isString(nameOrFunction)) {\n const maybeScale = ctx.scales[nameOrFunction];\n return maybeScale && isRegisteredScale(maybeScale.value) ? maybeScale.value : undefined;\n }\n return undefined;\n}\nfunction internalScaleFunctions(codegen, fnctx, visitors) {\n // add helper method to the 'this' expression function context\n fnctx.__bandwidth = s => s && s.bandwidth ? s.bandwidth() : 0;\n\n // register AST visitors for internal scale functions\n visitors._bandwidth = scaleVisitor;\n visitors._range = scaleVisitor;\n visitors._scale = scaleVisitor;\n\n // resolve scale reference directly to the signal hash argument\n const ref = arg => '_[' + (arg.type === Literal ? stringValue(ScalePrefix + arg.value) : stringValue(ScalePrefix) + '+' + codegen(arg)) + ']';\n\n // define and return internal scale function code generators\n // these internal functions are called by mark encoders\n return {\n _bandwidth: args => `this.__bandwidth(${ref(args[0])})`,\n _range: args => `${ref(args[0])}.range()`,\n _scale: args => `${ref(args[0])}(${codegen(args[1])})`\n };\n}\n\nfunction geoMethod(methodName, globalMethod) {\n return function (projection, geojson, group) {\n if (projection) {\n // projection defined, use it\n const p = getScale(projection, (group || this).context);\n return p && p.path[methodName](geojson);\n } else {\n // projection undefined, use global method\n return globalMethod(geojson);\n }\n };\n}\nconst geoArea = geoMethod('area', geoArea$1);\nconst geoBounds = geoMethod('bounds', geoBounds$1);\nconst geoCentroid = geoMethod('centroid', geoCentroid$1);\n\nfunction inScope (item) {\n const group = this.context.group;\n let value = false;\n if (group) while (item) {\n if (item === group) {\n value = true;\n break;\n }\n item = item.mark.group;\n }\n return value;\n}\n\nfunction log(df, method, args) {\n try {\n df[method].apply(df, ['EXPRESSION'].concat([].slice.call(args)));\n } catch (err) {\n df.warn(err);\n }\n return args[args.length - 1];\n}\nfunction warn() {\n return log(this.context.dataflow, 'warn', arguments);\n}\nfunction info() {\n return log(this.context.dataflow, 'info', arguments);\n}\nfunction debug() {\n return log(this.context.dataflow, 'debug', arguments);\n}\n\n// https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\nfunction channel_luminance_value(channelValue) {\n const val = channelValue / 255;\n if (val <= 0.03928) {\n return val / 12.92;\n }\n return Math.pow((val + 0.055) / 1.055, 2.4);\n}\nfunction luminance(color) {\n const c = rgb(color),\n r = channel_luminance_value(c.r),\n g = channel_luminance_value(c.g),\n b = channel_luminance_value(c.b);\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n}\n\n// https://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef\nfunction contrast(color1, color2) {\n const lum1 = luminance(color1),\n lum2 = luminance(color2),\n lumL = Math.max(lum1, lum2),\n lumD = Math.min(lum1, lum2);\n return (lumL + 0.05) / (lumD + 0.05);\n}\n\nfunction merge () {\n const args = [].slice.call(arguments);\n args.unshift({});\n return extend(...args);\n}\n\nfunction equal(a, b) {\n return a === b || a !== a && b !== b ? true : isArray(a) ? isArray(b) && a.length === b.length ? equalArray(a, b) : false : isObject(a) && isObject(b) ? equalObject(a, b) : false;\n}\nfunction equalArray(a, b) {\n for (let i = 0, n = a.length; i < n; ++i) {\n if (!equal(a[i], b[i])) return false;\n }\n return true;\n}\nfunction equalObject(a, b) {\n for (const key in a) {\n if (!equal(a[key], b[key])) return false;\n }\n return true;\n}\nfunction removePredicate(props) {\n return _ => equalObject(props, _);\n}\nfunction modify (name, insert, remove, toggle, modify, values) {\n const df = this.context.dataflow,\n data = this.context.data[name],\n input = data.input,\n stamp = df.stamp();\n let changes = data.changes,\n predicate,\n key;\n if (df._trigger === false || !(input.value.length || insert || toggle)) {\n // nothing to do!\n return 0;\n }\n if (!changes || changes.stamp < stamp) {\n data.changes = changes = df.changeset();\n changes.stamp = stamp;\n df.runAfter(() => {\n data.modified = true;\n df.pulse(input, changes).run();\n }, true, 1);\n }\n if (remove) {\n predicate = remove === true ? truthy : isArray(remove) || isTuple(remove) ? remove : removePredicate(remove);\n changes.remove(predicate);\n }\n if (insert) {\n changes.insert(insert);\n }\n if (toggle) {\n predicate = removePredicate(toggle);\n if (input.value.some(predicate)) {\n changes.remove(predicate);\n } else {\n changes.insert(toggle);\n }\n }\n if (modify) {\n for (key in values) {\n changes.modify(modify, key, values[key]);\n }\n }\n return 1;\n}\n\nfunction pinchDistance(event) {\n const t = event.touches,\n dx = t[0].clientX - t[1].clientX,\n dy = t[0].clientY - t[1].clientY;\n return Math.sqrt(dx * dx + dy * dy);\n}\nfunction pinchAngle(event) {\n const t = event.touches;\n return Math.atan2(t[0].clientY - t[1].clientY, t[0].clientX - t[1].clientX);\n}\n\n// memoize accessor functions\nconst accessors = {};\nfunction pluck (data, name) {\n const accessor = accessors[name] || (accessors[name] = field(name));\n return isArray(data) ? data.map(accessor) : accessor(data);\n}\n\nfunction array(seq) {\n return isArray(seq) || ArrayBuffer.isView(seq) ? seq : null;\n}\nfunction sequence(seq) {\n return array(seq) || (isString(seq) ? seq : null);\n}\nfunction join(seq) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return array(seq).join(...args);\n}\nfunction indexof(seq) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n return sequence(seq).indexOf(...args);\n}\nfunction lastindexof(seq) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n return sequence(seq).lastIndexOf(...args);\n}\nfunction slice(seq) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n return sequence(seq).slice(...args);\n}\nfunction replace(str, pattern, repl) {\n if (isFunction(repl)) error('Function argument passed to replace.');\n return String(str).replace(pattern, repl);\n}\nfunction reverse(seq) {\n return array(seq).slice().reverse();\n}\n\nfunction bandspace(count, paddingInner, paddingOuter) {\n return bandSpace(count || 0, paddingInner || 0, paddingOuter || 0);\n}\nfunction bandwidth(name, group) {\n const s = getScale(name, (group || this).context);\n return s && s.bandwidth ? s.bandwidth() : 0;\n}\nfunction copy(name, group) {\n const s = getScale(name, (group || this).context);\n return s ? s.copy() : undefined;\n}\nfunction domain(name, group) {\n const s = getScale(name, (group || this).context);\n return s ? s.domain() : [];\n}\nfunction invert(name, range, group) {\n const s = getScale(name, (group || this).context);\n return !s ? undefined : isArray(range) ? (s.invertRange || s.invert)(range) : (s.invert || s.invertExtent)(range);\n}\nfunction range(name, group) {\n const s = getScale(name, (group || this).context);\n return s && s.range ? s.range() : [];\n}\nfunction scale(name, value, group) {\n const s = getScale(name, (group || this).context);\n return s ? s(value) : undefined;\n}\n\nfunction scaleGradient (scale, p0, p1, count, group) {\n scale = getScale(scale, (group || this).context);\n const gradient = Gradient(p0, p1);\n let stops = scale.domain(),\n min = stops[0],\n max = peek(stops),\n fraction = identity;\n if (!(max - min)) {\n // expand scale if domain has zero span, fix #1479\n scale = (scale.interpolator ? scale$1('sequential')().interpolator(scale.interpolator()) : scale$1('linear')().interpolate(scale.interpolate()).range(scale.range())).domain([min = 0, max = 1]);\n } else {\n fraction = scaleFraction(scale, min, max);\n }\n if (scale.ticks) {\n stops = scale.ticks(+count || 15);\n if (min !== stops[0]) stops.unshift(min);\n if (max !== peek(stops)) stops.push(max);\n }\n stops.forEach(_ => gradient.stop(fraction(_), scale(_)));\n return gradient;\n}\n\nfunction geoShape(projection, geojson, group) {\n const p = getScale(projection, (group || this).context);\n return function (context) {\n return p ? p.path.context(context)(geojson) : '';\n };\n}\nfunction pathShape(path) {\n let p = null;\n return function (context) {\n return context ? pathRender(context, p = p || pathParse(path)) : path;\n };\n}\n\nconst datum = d => d.data;\nfunction treeNodes(name, context) {\n const tree = data.call(context, name);\n return tree.root && tree.root.lookup || {};\n}\nfunction treePath(name, source, target) {\n const nodes = treeNodes(name, this),\n s = nodes[source],\n t = nodes[target];\n return s && t ? s.path(t).map(datum) : undefined;\n}\nfunction treeAncestors(name, node) {\n const n = treeNodes(name, this)[node];\n return n ? n.ancestors().map(datum) : undefined;\n}\n\nconst _window = () => typeof window !== 'undefined' && window || null;\nfunction screen() {\n const w = _window();\n return w ? w.screen : {};\n}\nfunction windowSize() {\n const w = _window();\n return w ? [w.innerWidth, w.innerHeight] : [undefined, undefined];\n}\nfunction containerSize() {\n const view = this.context.dataflow,\n el = view.container && view.container();\n return el ? [el.clientWidth, el.clientHeight] : [undefined, undefined];\n}\n\nfunction intersect (b, opt, group) {\n if (!b) return [];\n const [u, v] = b,\n box = new Bounds().set(u[0], u[1], v[0], v[1]),\n scene = group || this.context.dataflow.scenegraph().root;\n return intersect$1(scene, box, filter(opt));\n}\nfunction filter(opt) {\n let p = null;\n if (opt) {\n const types = array$1(opt.marktype),\n names = array$1(opt.markname);\n p = _ => (!types.length || types.some(t => _.marktype === t)) && (!names.length || names.some(s => _.name === s));\n }\n return p;\n}\n\n/**\n * Appends a new point to the lasso\n *\n * @param {*} lasso the lasso in pixel space\n * @param {*} x the x coordinate in pixel space\n * @param {*} y the y coordinate in pixel space\n * @param {*} minDist the minimum distance, in pixels, that thenew point needs to be apart from the last point\n * @returns a new array containing the lasso with the new point\n */\nfunction lassoAppend(lasso, x, y) {\n let minDist = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 5;\n lasso = array$1(lasso);\n const last = lasso[lasso.length - 1];\n\n // Add point to lasso if its the first point or distance to last point exceed minDist\n return last === undefined || Math.sqrt((last[0] - x) ** 2 + (last[1] - y) ** 2) > minDist ? [...lasso, [x, y]] : lasso;\n}\n\n/**\n * Generates a svg path command which draws a lasso\n *\n * @param {*} lasso the lasso in pixel space in the form [[x,y], [x,y], ...]\n * @returns the svg path command that draws the lasso\n */\nfunction lassoPath(lasso) {\n return array$1(lasso).reduce((svg, _ref, i) => {\n let [x, y] = _ref;\n return svg += i == 0 ? `M ${x},${y} ` : i === lasso.length - 1 ? ' Z' : `L ${x},${y} `;\n }, '');\n}\n\n/**\n * Inverts the lasso from pixel space to an array of vega scenegraph tuples\n *\n * @param {*} data the dataset\n * @param {*} pixelLasso the lasso in pixel space, [[x,y], [x,y], ...]\n * @param {*} unit the unit where the lasso is defined\n *\n * @returns an array of vega scenegraph tuples\n */\nfunction intersectLasso(markname, pixelLasso, unit) {\n const {\n x,\n y,\n mark\n } = unit;\n const bb = new Bounds().set(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER);\n\n // Get bounding box around lasso\n for (const [px, py] of pixelLasso) {\n if (px < bb.x1) bb.x1 = px;\n if (px > bb.x2) bb.x2 = px;\n if (py < bb.y1) bb.y1 = py;\n if (py > bb.y2) bb.y2 = py;\n }\n\n // Translate bb against unit coordinates\n bb.translate(x, y);\n const intersection = intersect([[bb.x1, bb.y1], [bb.x2, bb.y2]], markname, mark);\n\n // Check every point against the lasso\n return intersection.filter(tuple => pointInPolygon(tuple.x, tuple.y, pixelLasso));\n}\n\n/**\n * Performs a test if a point is inside a polygon based on the idea from\n * https://wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html\n *\n * This method will not need the same start/end point since it wraps around the edges of the array\n *\n * @param {*} test a point to test against\n * @param {*} polygon a polygon in the form [[x,y], [x,y], ...]\n * @returns true if the point lies inside the polygon, false otherwise\n */\nfunction pointInPolygon(testx, testy, polygon) {\n let intersections = 0;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const [prevX, prevY] = polygon[j];\n const [x, y] = polygon[i];\n\n // count intersections\n if (y > testy != prevY > testy && testx < (prevX - x) * (testy - y) / (prevY - y) + x) {\n intersections++;\n }\n }\n\n // point is in polygon if intersection count is odd\n return intersections & 1;\n}\n\n// Expression function context object\nconst functionContext = {\n random() {\n return random();\n },\n // override default\n cumulativeNormal,\n cumulativeLogNormal,\n cumulativeUniform,\n densityNormal,\n densityLogNormal,\n densityUniform,\n quantileNormal,\n quantileLogNormal,\n quantileUniform,\n sampleNormal,\n sampleLogNormal,\n sampleUniform,\n isArray,\n isBoolean,\n isDate,\n isDefined(_) {\n return _ !== undefined;\n },\n isNumber,\n isObject,\n isRegExp,\n isString,\n isTuple,\n isValid(_) {\n return _ != null && _ === _;\n },\n toBoolean,\n toDate(_) {\n return toDate(_);\n },\n // suppress extra arguments\n toNumber,\n toString,\n indexof,\n join,\n lastindexof,\n replace,\n reverse,\n slice,\n flush,\n lerp,\n merge,\n pad,\n peek,\n pluck,\n span,\n inrange,\n truncate,\n rgb,\n lab,\n hcl,\n hsl,\n luminance,\n contrast,\n sequence: range$1,\n format,\n utcFormat,\n utcParse,\n utcOffset,\n utcSequence,\n timeFormat,\n timeParse,\n timeOffset,\n timeSequence,\n timeUnitSpecifier,\n monthFormat,\n monthAbbrevFormat,\n dayFormat,\n dayAbbrevFormat,\n quarter,\n utcquarter,\n week,\n utcweek,\n dayofyear,\n utcdayofyear,\n warn,\n info,\n debug,\n extent(_) {\n return extent(_);\n },\n // suppress extra arguments\n inScope,\n intersect,\n clampRange,\n pinchDistance,\n pinchAngle,\n screen,\n containerSize,\n windowSize,\n bandspace,\n setdata,\n pathShape,\n panLinear,\n panLog,\n panPow,\n panSymlog,\n zoomLinear,\n zoomLog,\n zoomPow,\n zoomSymlog,\n encode,\n modify,\n lassoAppend,\n lassoPath,\n intersectLasso\n};\nconst eventFunctions = ['view', 'item', 'group', 'xy', 'x', 'y'],\n // event functions\n eventPrefix = 'event.vega.',\n // event function prefix\n thisPrefix = 'this.',\n // function context prefix\n astVisitors = {}; // AST visitors for dependency analysis\n\n// export code generator parameters\nconst codegenParams = {\n forbidden: ['_'],\n allowed: ['datum', 'event', 'item'],\n fieldvar: 'datum',\n globalvar: id => `_[${stringValue(SignalPrefix + id)}]`,\n functions: buildFunctions,\n constants: constants,\n visitors: astVisitors\n};\n\n// export code generator\nconst codeGenerator = codegenExpression(codegenParams);\n\n// Build expression function registry\nfunction buildFunctions(codegen) {\n const fn = functions(codegen);\n eventFunctions.forEach(name => fn[name] = eventPrefix + name);\n for (const name in functionContext) {\n fn[name] = thisPrefix + name;\n }\n extend(fn, internalScaleFunctions(codegen, functionContext, astVisitors));\n return fn;\n}\n\n// Register an expression function\nfunction expressionFunction(name, fn, visitor) {\n if (arguments.length === 1) {\n return functionContext[name];\n }\n\n // register with the functionContext\n functionContext[name] = fn;\n\n // if there is an astVisitor register that, too\n if (visitor) astVisitors[name] = visitor;\n\n // if the code generator has already been initialized,\n // we need to also register the function with it\n if (codeGenerator) codeGenerator.functions[name] = thisPrefix + name;\n return this;\n}\n\n// register expression functions with ast visitors\nexpressionFunction('bandwidth', bandwidth, scaleVisitor);\nexpressionFunction('copy', copy, scaleVisitor);\nexpressionFunction('domain', domain, scaleVisitor);\nexpressionFunction('range', range, scaleVisitor);\nexpressionFunction('invert', invert, scaleVisitor);\nexpressionFunction('scale', scale, scaleVisitor);\nexpressionFunction('gradient', scaleGradient, scaleVisitor);\nexpressionFunction('geoArea', geoArea, scaleVisitor);\nexpressionFunction('geoBounds', geoBounds, scaleVisitor);\nexpressionFunction('geoCentroid', geoCentroid, scaleVisitor);\nexpressionFunction('geoShape', geoShape, scaleVisitor);\nexpressionFunction('indata', indata, indataVisitor);\nexpressionFunction('data', data, dataVisitor);\nexpressionFunction('treePath', treePath, dataVisitor);\nexpressionFunction('treeAncestors', treeAncestors, dataVisitor);\n\n// register Vega-Lite selection functions\nexpressionFunction('vlSelectionTest', selectionTest, selectionVisitor);\nexpressionFunction('vlSelectionIdTest', selectionIdTest, selectionVisitor);\nexpressionFunction('vlSelectionResolve', selectionResolve, selectionVisitor);\nexpressionFunction('vlSelectionTuples', selectionTuples);\n\nfunction parser (expr, scope) {\n const params = {};\n\n // parse the expression to an abstract syntax tree (ast)\n let ast;\n try {\n expr = isString(expr) ? expr : stringValue(expr) + '';\n ast = parseExpression(expr);\n } catch (err) {\n error('Expression parse error: ' + expr);\n }\n\n // analyze ast function calls for dependencies\n ast.visit(node => {\n if (node.type !== CallExpression) return;\n const name = node.callee.name,\n visit = codegenParams.visitors[name];\n if (visit) visit(name, node.arguments, scope, params);\n });\n\n // perform code generation\n const gen = codeGenerator(ast);\n\n // collect signal dependencies\n gen.globals.forEach(name => {\n const signalName = SignalPrefix + name;\n if (!hasOwnProperty(params, signalName) && scope.getSignal(name)) {\n params[signalName] = scope.signalRef(name);\n }\n });\n\n // return generated expression code and dependencies\n return {\n $expr: extend({\n code: gen.code\n }, scope.options.ast ? {\n ast\n } : null),\n $fields: gen.fields,\n $params: params\n };\n}\n\nexport { DataPrefix, IndexPrefix, ScalePrefix, SignalPrefix, bandspace, bandwidth, codeGenerator, codegenParams, containerSize, contrast, copy, data, dataVisitor, dayAbbrevFormat, dayFormat, debug, domain, encode, expressionFunction, format, functionContext, geoArea, geoBounds, geoCentroid, geoShape, inScope, indata, indataVisitor, indexof, info, invert, join, lastindexof, luminance, merge, modify, monthAbbrevFormat, monthFormat, parser as parseExpression, pathShape, pinchAngle, pinchDistance, pluck, range, replace, reverse, scale, scaleGradient, scaleVisitor, screen, setdata, slice, timeFormat, timeParse, treeAncestors, treePath, utcFormat, utcParse, warn, windowSize };\n","import { toSet, stringValue, error, isArray, isObject, hasOwnProperty, accessor, key, field, array, compare, truthy } from 'vega-util';\nimport { tupleid } from 'vega-dataflow';\n\n/**\n * Parse a serialized dataflow specification.\n */\nfunction parse (spec) {\n const ctx = this,\n operators = spec.operators || [];\n\n // parse background\n if (spec.background) {\n ctx.background = spec.background;\n }\n\n // parse event configuration\n if (spec.eventConfig) {\n ctx.eventConfig = spec.eventConfig;\n }\n\n // parse locale configuration\n if (spec.locale) {\n ctx.locale = spec.locale;\n }\n\n // parse operators\n operators.forEach(entry => ctx.parseOperator(entry));\n\n // parse operator parameters\n operators.forEach(entry => ctx.parseOperatorParameters(entry));\n\n // parse streams\n (spec.streams || []).forEach(entry => ctx.parseStream(entry));\n\n // parse updates\n (spec.updates || []).forEach(entry => ctx.parseUpdate(entry));\n return ctx.resolve();\n}\n\nconst Skip = toSet(['rule']),\n Swap = toSet(['group', 'image', 'rect']);\nfunction adjustSpatial(encode, marktype) {\n let code = '';\n if (Skip[marktype]) return code;\n if (encode.x2) {\n if (encode.x) {\n if (Swap[marktype]) {\n code += 'if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;';\n }\n code += 'o.width=o.x2-o.x;';\n } else {\n code += 'o.x=o.x2-(o.width||0);';\n }\n }\n if (encode.xc) {\n code += 'o.x=o.xc-(o.width||0)/2;';\n }\n if (encode.y2) {\n if (encode.y) {\n if (Swap[marktype]) {\n code += 'if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;';\n }\n code += 'o.height=o.y2-o.y;';\n } else {\n code += 'o.y=o.y2-(o.height||0);';\n }\n }\n if (encode.yc) {\n code += 'o.y=o.yc-(o.height||0)/2;';\n }\n return code;\n}\nfunction canonicalType(type) {\n return (type + '').toLowerCase();\n}\nfunction isOperator(type) {\n return canonicalType(type) === 'operator';\n}\nfunction isCollect(type) {\n return canonicalType(type) === 'collect';\n}\n\nfunction expression(ctx, args, code) {\n // wrap code in return statement if expression does not terminate\n if (!code.endsWith(';')) {\n code = 'return(' + code + ');';\n }\n const fn = Function(...args.concat(code));\n return ctx && ctx.functions ? fn.bind(ctx.functions) : fn;\n}\n\n// generate code for comparing a single field\nfunction _compare(u, v, lt, gt) {\n return `((u = ${u}) < (v = ${v}) || u == null) && v != null ? ${lt}\n : (u > v || v == null) && u != null ? ${gt}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${lt}\n : v !== v && u === u ? ${gt} : `;\n}\nvar expressionCodegen = {\n /**\n * Parse an expression used to update an operator value.\n */\n operator: (ctx, expr) => expression(ctx, ['_'], expr.code),\n /**\n * Parse an expression provided as an operator parameter value.\n */\n parameter: (ctx, expr) => expression(ctx, ['datum', '_'], expr.code),\n /**\n * Parse an expression applied to an event stream.\n */\n event: (ctx, expr) => expression(ctx, ['event'], expr.code),\n /**\n * Parse an expression used to handle an event-driven operator update.\n */\n handler: (ctx, expr) => {\n const code = `var datum=event.item&&event.item.datum;return ${expr.code};`;\n return expression(ctx, ['_', 'event'], code);\n },\n /**\n * Parse an expression that performs visual encoding.\n */\n encode: (ctx, encode) => {\n const {\n marktype,\n channels\n } = encode;\n let code = 'var o=item,datum=o.datum,m=0,$;';\n for (const name in channels) {\n const o = 'o[' + stringValue(name) + ']';\n code += `$=${channels[name].code};if(${o}!==$)${o}=$,m=1;`;\n }\n code += adjustSpatial(channels, marktype);\n code += 'return m;';\n return expression(ctx, ['item', '_'], code);\n },\n /**\n * Optimized code generators for access and comparison.\n */\n codegen: {\n get(path) {\n const ref = `[${path.map(stringValue).join('][')}]`;\n const get = Function('_', `return _${ref};`);\n get.path = ref;\n return get;\n },\n comparator(fields, orders) {\n let t;\n const map = (f, i) => {\n const o = orders[i];\n let u, v;\n if (f.path) {\n u = `a${f.path}`;\n v = `b${f.path}`;\n } else {\n (t = t || {})['f' + i] = f;\n u = `this.f${i}(a)`;\n v = `this.f${i}(b)`;\n }\n return _compare(u, v, -o, o);\n };\n const fn = Function('a', 'b', 'var u, v; return ' + fields.map(map).join('') + '0;');\n return t ? fn.bind(t) : fn;\n }\n }\n};\n\n/**\n * Parse a dataflow operator.\n */\nfunction parseOperator(spec) {\n const ctx = this;\n if (isOperator(spec.type) || !spec.type) {\n ctx.operator(spec, spec.update ? ctx.operatorExpression(spec.update) : null);\n } else {\n ctx.transform(spec, spec.type);\n }\n}\n\n/**\n * Parse and assign operator parameters.\n */\nfunction parseOperatorParameters(spec) {\n const ctx = this;\n if (spec.params) {\n const op = ctx.get(spec.id);\n if (!op) error('Invalid operator id: ' + spec.id);\n ctx.dataflow.connect(op, op.parameters(ctx.parseParameters(spec.params), spec.react, spec.initonly));\n }\n}\n\n/**\n * Parse a set of operator parameters.\n */\nfunction parseParameters(spec, params) {\n params = params || {};\n const ctx = this;\n for (const key in spec) {\n const value = spec[key];\n params[key] = isArray(value) ? value.map(v => parseParameter(v, ctx, params)) : parseParameter(value, ctx, params);\n }\n return params;\n}\n\n/**\n * Parse a single parameter.\n */\nfunction parseParameter(spec, ctx, params) {\n if (!spec || !isObject(spec)) return spec;\n for (let i = 0, n = PARSERS.length, p; i < n; ++i) {\n p = PARSERS[i];\n if (hasOwnProperty(spec, p.key)) {\n return p.parse(spec, ctx, params);\n }\n }\n return spec;\n}\n\n/** Reference parsers. */\nvar PARSERS = [{\n key: '$ref',\n parse: getOperator\n}, {\n key: '$key',\n parse: getKey\n}, {\n key: '$expr',\n parse: getExpression\n}, {\n key: '$field',\n parse: getField\n}, {\n key: '$encode',\n parse: getEncode\n}, {\n key: '$compare',\n parse: getCompare\n}, {\n key: '$context',\n parse: getContext\n}, {\n key: '$subflow',\n parse: getSubflow\n}, {\n key: '$tupleid',\n parse: getTupleId\n}];\n\n/**\n * Resolve an operator reference.\n */\nfunction getOperator(_, ctx) {\n return ctx.get(_.$ref) || error('Operator not defined: ' + _.$ref);\n}\n\n/**\n * Resolve an expression reference.\n */\nfunction getExpression(_, ctx, params) {\n if (_.$params) {\n // parse expression parameters\n ctx.parseParameters(_.$params, params);\n }\n const k = 'e:' + _.$expr.code;\n return ctx.fn[k] || (ctx.fn[k] = accessor(ctx.parameterExpression(_.$expr), _.$fields));\n}\n\n/**\n * Resolve a key accessor reference.\n */\nfunction getKey(_, ctx) {\n const k = 'k:' + _.$key + '_' + !!_.$flat;\n return ctx.fn[k] || (ctx.fn[k] = key(_.$key, _.$flat, ctx.expr.codegen));\n}\n\n/**\n * Resolve a field accessor reference.\n */\nfunction getField(_, ctx) {\n if (!_.$field) return null;\n const k = 'f:' + _.$field + '_' + _.$name;\n return ctx.fn[k] || (ctx.fn[k] = field(_.$field, _.$name, ctx.expr.codegen));\n}\n\n/**\n * Resolve a comparator function reference.\n */\nfunction getCompare(_, ctx) {\n // As of Vega 5.5.3, $tupleid sort is no longer used.\n // Keep here for now for backwards compatibility.\n const k = 'c:' + _.$compare + '_' + _.$order,\n c = array(_.$compare).map(_ => _ && _.$tupleid ? tupleid : _);\n return ctx.fn[k] || (ctx.fn[k] = compare(c, _.$order, ctx.expr.codegen));\n}\n\n/**\n * Resolve an encode operator reference.\n */\nfunction getEncode(_, ctx) {\n const spec = _.$encode,\n encode = {};\n for (const name in spec) {\n const enc = spec[name];\n encode[name] = accessor(ctx.encodeExpression(enc.$expr), enc.$fields);\n encode[name].output = enc.$output;\n }\n return encode;\n}\n\n/**\n * Resolve a context reference.\n */\nfunction getContext(_, ctx) {\n return ctx;\n}\n\n/**\n * Resolve a recursive subflow specification.\n */\nfunction getSubflow(_, ctx) {\n const spec = _.$subflow;\n return function (dataflow, key, parent) {\n const subctx = ctx.fork().parse(spec),\n op = subctx.get(spec.operators[0].id),\n p = subctx.signals.parent;\n if (p) p.set(parent);\n op.detachSubflow = () => ctx.detach(subctx);\n return op;\n };\n}\n\n/**\n * Resolve a tuple id reference.\n */\nfunction getTupleId() {\n return tupleid;\n}\n\n/**\n * Parse an event stream specification.\n */\nfunction parseStream (spec) {\n var ctx = this,\n filter = spec.filter != null ? ctx.eventExpression(spec.filter) : undefined,\n stream = spec.stream != null ? ctx.get(spec.stream) : undefined,\n args;\n if (spec.source) {\n stream = ctx.events(spec.source, spec.type, filter);\n } else if (spec.merge) {\n args = spec.merge.map(_ => ctx.get(_));\n stream = args[0].merge.apply(args[0], args.slice(1));\n }\n if (spec.between) {\n args = spec.between.map(_ => ctx.get(_));\n stream = stream.between(args[0], args[1]);\n }\n if (spec.filter) {\n stream = stream.filter(filter);\n }\n if (spec.throttle != null) {\n stream = stream.throttle(+spec.throttle);\n }\n if (spec.debounce != null) {\n stream = stream.debounce(+spec.debounce);\n }\n if (stream == null) {\n error('Invalid stream definition: ' + JSON.stringify(spec));\n }\n if (spec.consume) stream.consume(true);\n ctx.stream(spec, stream);\n}\n\n/**\n * Parse an event-driven operator update.\n */\nfunction parseUpdate (spec) {\n var ctx = this,\n srcid = isObject(srcid = spec.source) ? srcid.$ref : srcid,\n source = ctx.get(srcid),\n target = null,\n update = spec.update,\n params = undefined;\n if (!source) error('Source not defined: ' + spec.source);\n target = spec.target && spec.target.$expr ? ctx.eventExpression(spec.target.$expr) : ctx.get(spec.target);\n if (update && update.$expr) {\n if (update.$params) {\n params = ctx.parseParameters(update.$params);\n }\n update = ctx.handlerExpression(update.$expr);\n }\n ctx.update(spec, source, target, update, params);\n}\n\nconst SKIP = {\n skip: true\n};\nfunction getState(options) {\n var ctx = this,\n state = {};\n if (options.signals) {\n var signals = state.signals = {};\n Object.keys(ctx.signals).forEach(key => {\n const op = ctx.signals[key];\n if (options.signals(key, op)) {\n signals[key] = op.value;\n }\n });\n }\n if (options.data) {\n var data = state.data = {};\n Object.keys(ctx.data).forEach(key => {\n const dataset = ctx.data[key];\n if (options.data(key, dataset)) {\n data[key] = dataset.input.value;\n }\n });\n }\n if (ctx.subcontext && options.recurse !== false) {\n state.subcontext = ctx.subcontext.map(ctx => ctx.getState(options));\n }\n return state;\n}\nfunction setState(state) {\n var ctx = this,\n df = ctx.dataflow,\n data = state.data,\n signals = state.signals;\n Object.keys(signals || {}).forEach(key => {\n df.update(ctx.signals[key], signals[key], SKIP);\n });\n Object.keys(data || {}).forEach(key => {\n df.pulse(ctx.data[key].input, df.changeset().remove(truthy).insert(data[key]));\n });\n (state.subcontext || []).forEach((substate, i) => {\n const subctx = ctx.subcontext[i];\n if (subctx) subctx.setState(substate);\n });\n}\n\n/**\n * Context objects store the current parse state.\n * Enables lookup of parsed operators, event streams, accessors, etc.\n * Provides a 'fork' method for creating child contexts for subflows.\n */\nfunction context (df, transforms, functions, expr) {\n return new Context(df, transforms, functions, expr);\n}\nfunction Context(df, transforms, functions, expr) {\n this.dataflow = df;\n this.transforms = transforms;\n this.events = df.events.bind(df);\n this.expr = expr || expressionCodegen, this.signals = {};\n this.scales = {};\n this.nodes = {};\n this.data = {};\n this.fn = {};\n if (functions) {\n this.functions = Object.create(functions);\n this.functions.context = this;\n }\n}\nfunction Subcontext(ctx) {\n this.dataflow = ctx.dataflow;\n this.transforms = ctx.transforms;\n this.events = ctx.events;\n this.expr = ctx.expr;\n this.signals = Object.create(ctx.signals);\n this.scales = Object.create(ctx.scales);\n this.nodes = Object.create(ctx.nodes);\n this.data = Object.create(ctx.data);\n this.fn = Object.create(ctx.fn);\n if (ctx.functions) {\n this.functions = Object.create(ctx.functions);\n this.functions.context = this;\n }\n}\nContext.prototype = Subcontext.prototype = {\n fork() {\n const ctx = new Subcontext(this);\n (this.subcontext || (this.subcontext = [])).push(ctx);\n return ctx;\n },\n detach(ctx) {\n this.subcontext = this.subcontext.filter(c => c !== ctx);\n\n // disconnect all nodes in the subcontext\n // wipe out targets first for better efficiency\n const keys = Object.keys(ctx.nodes);\n for (const key of keys) ctx.nodes[key]._targets = null;\n for (const key of keys) ctx.nodes[key].detach();\n ctx.nodes = null;\n },\n get(id) {\n return this.nodes[id];\n },\n set(id, node) {\n return this.nodes[id] = node;\n },\n add(spec, op) {\n const ctx = this,\n df = ctx.dataflow,\n data = spec.value;\n ctx.set(spec.id, op);\n if (isCollect(spec.type) && data) {\n if (data.$ingest) {\n df.ingest(op, data.$ingest, data.$format);\n } else if (data.$request) {\n df.preload(op, data.$request, data.$format);\n } else {\n df.pulse(op, df.changeset().insert(data));\n }\n }\n if (spec.root) {\n ctx.root = op;\n }\n if (spec.parent) {\n let p = ctx.get(spec.parent.$ref);\n if (p) {\n df.connect(p, [op]);\n op.targets().add(p);\n } else {\n (ctx.unresolved = ctx.unresolved || []).push(() => {\n p = ctx.get(spec.parent.$ref);\n df.connect(p, [op]);\n op.targets().add(p);\n });\n }\n }\n if (spec.signal) {\n ctx.signals[spec.signal] = op;\n }\n if (spec.scale) {\n ctx.scales[spec.scale] = op;\n }\n if (spec.data) {\n for (const name in spec.data) {\n const data = ctx.data[name] || (ctx.data[name] = {});\n spec.data[name].forEach(role => data[role] = op);\n }\n }\n },\n resolve() {\n (this.unresolved || []).forEach(fn => fn());\n delete this.unresolved;\n return this;\n },\n operator(spec, update) {\n this.add(spec, this.dataflow.add(spec.value, update));\n },\n transform(spec, type) {\n this.add(spec, this.dataflow.add(this.transforms[canonicalType(type)]));\n },\n stream(spec, stream) {\n this.set(spec.id, stream);\n },\n update(spec, stream, target, update, params) {\n this.dataflow.on(stream, target, update, params, spec.options);\n },\n // expression parsing\n operatorExpression(expr) {\n return this.expr.operator(this, expr);\n },\n parameterExpression(expr) {\n return this.expr.parameter(this, expr);\n },\n eventExpression(expr) {\n return this.expr.event(this, expr);\n },\n handlerExpression(expr) {\n return this.expr.handler(this, expr);\n },\n encodeExpression(encode) {\n return this.expr.encode(this, encode);\n },\n // parse methods\n parse,\n parseOperator,\n parseOperatorParameters,\n parseParameters,\n parseStream,\n parseUpdate,\n // state methods\n getState,\n setState\n};\n\nexport { context };\n","import { isString, hasOwnProperty, error, truthy, constant, extend, array, isObject, isArray, toSet, debounce, isDate, inherits, stringValue } from 'vega-util';\nimport { changeset, isChangeSet, EventStream, transforms, Dataflow, asyncCallback } from 'vega-dataflow';\nimport { point, renderModule, CanvasHandler, RenderType, Scenegraph } from 'vega-scenegraph';\nimport { tickStep } from 'd3-array';\nimport { functionContext } from 'vega-functions';\nimport { context } from 'vega-runtime';\nimport { interval } from 'd3-timer';\nimport { locale } from 'vega-format';\n\n// initialize aria role and label attributes\nfunction initializeAria(view) {\n const el = view.container();\n if (el) {\n el.setAttribute('role', 'graphics-document');\n el.setAttribute('aria-roleDescription', 'visualization');\n ariaLabel(el, view.description());\n }\n}\n\n// update aria-label if we have a DOM container element\nfunction ariaLabel(el, desc) {\n if (el) desc == null ? el.removeAttribute('aria-label') : el.setAttribute('aria-label', desc);\n}\n\nfunction background (view) {\n // respond to background signal\n view.add(null, _ => {\n view._background = _.bg;\n view._resize = 1;\n return _.bg;\n }, {\n bg: view._signals.background\n });\n}\n\nconst Default = 'default';\nfunction cursor (view) {\n // get cursor signal, add to dataflow if needed\n const cursor = view._signals.cursor || (view._signals.cursor = view.add({\n user: Default,\n item: null\n }));\n\n // evaluate cursor on each mousemove event\n view.on(view.events('view', 'mousemove'), cursor, (_, event) => {\n const value = cursor.value,\n user = value ? isString(value) ? value : value.user : Default,\n item = event.item && event.item.cursor || null;\n return value && user === value.user && item == value.item ? value : {\n user: user,\n item: item\n };\n });\n\n // when cursor signal updates, set visible cursor\n view.add(null, function (_) {\n let user = _.cursor,\n item = this.value;\n if (!isString(user)) {\n item = user.item;\n user = user.user;\n }\n setCursor(view, user && user !== Default ? user : item || user);\n return item;\n }, {\n cursor: cursor\n });\n}\nfunction setCursor(view, cursor) {\n const el = view.globalCursor() ? typeof document !== 'undefined' && document.body : view.container();\n if (el) {\n return cursor == null ? el.style.removeProperty('cursor') : el.style.cursor = cursor;\n }\n}\n\nfunction dataref(view, name) {\n var data = view._runtime.data;\n if (!hasOwnProperty(data, name)) {\n error('Unrecognized data set: ' + name);\n }\n return data[name];\n}\nfunction data(name, values) {\n return arguments.length < 2 ? dataref(this, name).values.value : change.call(this, name, changeset().remove(truthy).insert(values));\n}\nfunction change(name, changes) {\n if (!isChangeSet(changes)) {\n error('Second argument to changes must be a changeset.');\n }\n const dataset = dataref(this, name);\n dataset.modified = true;\n return this.pulse(dataset.input, changes);\n}\nfunction insert(name, _) {\n return change.call(this, name, changeset().insert(_));\n}\nfunction remove(name, _) {\n return change.call(this, name, changeset().remove(_));\n}\n\nfunction width(view) {\n var padding = view.padding();\n return Math.max(0, view._viewWidth + padding.left + padding.right);\n}\nfunction height(view) {\n var padding = view.padding();\n return Math.max(0, view._viewHeight + padding.top + padding.bottom);\n}\nfunction offset(view) {\n var padding = view.padding(),\n origin = view._origin;\n return [padding.left + origin[0], padding.top + origin[1]];\n}\nfunction resizeRenderer(view) {\n var origin = offset(view),\n w = width(view),\n h = height(view);\n view._renderer.background(view.background());\n view._renderer.resize(w, h, origin);\n view._handler.origin(origin);\n view._resizeListeners.forEach(handler => {\n try {\n handler(w, h);\n } catch (error) {\n view.error(error);\n }\n });\n}\n\n/**\n * Extend an event with additional view-specific methods.\n * Adds a new property ('vega') to an event that provides a number\n * of methods for querying information about the current interaction.\n * The vega object provides the following methods:\n * view - Returns the backing View instance.\n * item - Returns the currently active scenegraph item (if any).\n * group - Returns the currently active scenegraph group (if any).\n * This method accepts a single string-typed argument indicating the name\n * of the desired parent group. The scenegraph will be traversed from\n * the item up towards the root to search for a matching group. If no\n * argument is provided the enclosing group for the active item is\n * returned, unless the item it itself a group, in which case it is\n * returned directly.\n * xy - Returns a two-element array containing the x and y coordinates for\n * mouse or touch events. For touch events, this is based on the first\n * elements in the changedTouches array. This method accepts a single\n * argument: either an item instance or mark name that should serve as\n * the reference coordinate system. If no argument is provided the\n * top-level view coordinate system is assumed.\n * x - Returns the current x-coordinate, accepts the same arguments as xy.\n * y - Returns the current y-coordinate, accepts the same arguments as xy.\n * @param {Event} event - The input event to extend.\n * @param {Item} item - The currently active scenegraph item (if any).\n * @return {Event} - The extended input event.\n */\nfunction eventExtend (view, event, item) {\n var r = view._renderer,\n el = r && r.canvas(),\n p,\n e,\n translate;\n if (el) {\n translate = offset(view);\n e = event.changedTouches ? event.changedTouches[0] : event;\n p = point(e, el);\n p[0] -= translate[0];\n p[1] -= translate[1];\n }\n event.dataflow = view;\n event.item = item;\n event.vega = extension(view, item, p);\n return event;\n}\nfunction extension(view, item, point) {\n const itemGroup = item ? item.mark.marktype === 'group' ? item : item.mark.group : null;\n function group(name) {\n var g = itemGroup,\n i;\n if (name) for (i = item; i; i = i.mark.group) {\n if (i.mark.name === name) {\n g = i;\n break;\n }\n }\n return g && g.mark && g.mark.interactive ? g : {};\n }\n function xy(item) {\n if (!item) return point;\n if (isString(item)) item = group(item);\n const p = point.slice();\n while (item) {\n p[0] -= item.x || 0;\n p[1] -= item.y || 0;\n item = item.mark && item.mark.group;\n }\n return p;\n }\n return {\n view: constant(view),\n item: constant(item || {}),\n group: group,\n xy: xy,\n x: item => xy(item)[0],\n y: item => xy(item)[1]\n };\n}\n\nconst VIEW = 'view',\n TIMER = 'timer',\n WINDOW = 'window',\n NO_TRAP = {\n trap: false\n };\n\n/**\n * Initialize event handling configuration.\n * @param {object} config - The configuration settings.\n * @return {object}\n */\nfunction initializeEventConfig(config) {\n const events = extend({\n defaults: {}\n }, config);\n const unpack = (obj, keys) => {\n keys.forEach(k => {\n if (isArray(obj[k])) obj[k] = toSet(obj[k]);\n });\n };\n unpack(events.defaults, ['prevent', 'allow']);\n unpack(events, ['view', 'window', 'selector']);\n return events;\n}\nfunction trackEventListener(view, sources, type, handler) {\n view._eventListeners.push({\n type: type,\n sources: array(sources),\n handler: handler\n });\n}\nfunction prevent(view, type) {\n var def = view._eventConfig.defaults,\n prevent = def.prevent,\n allow = def.allow;\n return prevent === false || allow === true ? false : prevent === true || allow === false ? true : prevent ? prevent[type] : allow ? !allow[type] : view.preventDefault();\n}\nfunction permit(view, key, type) {\n const rule = view._eventConfig && view._eventConfig[key];\n if (rule === false || isObject(rule) && !rule[type]) {\n view.warn(`Blocked ${key} ${type} event listener.`);\n return false;\n }\n return true;\n}\n\n/**\n * Create a new event stream from an event source.\n * @param {object} source - The event source to monitor.\n * @param {string} type - The event type.\n * @param {function(object): boolean} [filter] - Event filter function.\n * @return {EventStream}\n */\nfunction events(source, type, filter) {\n var view = this,\n s = new EventStream(filter),\n send = function (e, item) {\n view.runAsync(null, () => {\n if (source === VIEW && prevent(view, type)) {\n e.preventDefault();\n }\n s.receive(eventExtend(view, e, item));\n });\n },\n sources;\n if (source === TIMER) {\n if (permit(view, 'timer', type)) {\n view.timer(send, type);\n }\n } else if (source === VIEW) {\n if (permit(view, 'view', type)) {\n // send traps errors, so use {trap: false} option\n view.addEventListener(type, send, NO_TRAP);\n }\n } else {\n if (source === WINDOW) {\n if (permit(view, 'window', type) && typeof window !== 'undefined') {\n sources = [window];\n }\n } else if (typeof document !== 'undefined') {\n if (permit(view, 'selector', type)) {\n sources = Array.from(document.querySelectorAll(source));\n }\n }\n if (!sources) {\n view.warn('Can not resolve event source: ' + source);\n } else {\n for (var i = 0, n = sources.length; i < n; ++i) {\n sources[i].addEventListener(type, send);\n }\n trackEventListener(view, sources, type, send);\n }\n }\n return s;\n}\n\nfunction itemFilter(event) {\n return event.item;\n}\nfunction markTarget(event) {\n // grab upstream collector feeding the mark operator\n return event.item.mark.source;\n}\nfunction invoke(name) {\n return function (_, event) {\n return event.vega.view().changeset().encode(event.item, name);\n };\n}\nfunction hover (hoverSet, leaveSet) {\n hoverSet = [hoverSet || 'hover'];\n leaveSet = [leaveSet || 'update', hoverSet[0]];\n\n // invoke hover set upon mouseover\n this.on(this.events('view', 'mouseover', itemFilter), markTarget, invoke(hoverSet));\n\n // invoke leave set upon mouseout\n this.on(this.events('view', 'mouseout', itemFilter), markTarget, invoke(leaveSet));\n return this;\n}\n\n/**\n * Finalize a View instance that is being removed.\n * Cancel any running timers.\n * Remove all external event listeners.\n * Remove any currently displayed tooltip.\n */\nfunction finalize () {\n var tooltip = this._tooltip,\n timers = this._timers,\n listeners = this._eventListeners,\n n,\n m,\n e;\n n = timers.length;\n while (--n >= 0) {\n timers[n].stop();\n }\n n = listeners.length;\n while (--n >= 0) {\n e = listeners[n];\n m = e.sources.length;\n while (--m >= 0) {\n e.sources[m].removeEventListener(e.type, e.handler);\n }\n }\n if (tooltip) {\n tooltip.call(this, this._handler, null, null, null);\n }\n return this;\n}\n\nfunction element (tag, attr, text) {\n const el = document.createElement(tag);\n for (const key in attr) el.setAttribute(key, attr[key]);\n if (text != null) el.textContent = text;\n return el;\n}\n\nconst BindClass = 'vega-bind',\n NameClass = 'vega-bind-name',\n RadioClass = 'vega-bind-radio';\n\n/**\n * Bind a signal to an external HTML input element. The resulting two-way\n * binding will propagate input changes to signals, and propagate signal\n * changes to the input element state. If this view instance has no parent\n * element, we assume the view is headless and no bindings are created.\n * @param {Element|string} el - The parent DOM element to which the input\n * element should be appended as a child. If string-valued, this argument\n * will be treated as a CSS selector. If null or undefined, the parent\n * element of this view will be used as the element.\n * @param {object} param - The binding parameters which specify the signal\n * to bind to, the input element type, and type-specific configuration.\n * @return {View} - This view instance.\n */\nfunction bind (view, el, binding) {\n if (!el) return;\n const param = binding.param;\n let bind = binding.state;\n if (!bind) {\n bind = binding.state = {\n elements: null,\n active: false,\n set: null,\n update: value => {\n if (value != view.signal(param.signal)) {\n view.runAsync(null, () => {\n bind.source = true;\n view.signal(param.signal, value);\n });\n }\n }\n };\n if (param.debounce) {\n bind.update = debounce(param.debounce, bind.update);\n }\n }\n const create = param.input == null && param.element ? target : generate;\n create(bind, el, param, view);\n if (!bind.active) {\n view.on(view._signals[param.signal], null, () => {\n bind.source ? bind.source = false : bind.set(view.signal(param.signal));\n });\n bind.active = true;\n }\n return bind;\n}\n\n/**\n * Bind the signal to an external EventTarget.\n */\nfunction target(bind, node, param, view) {\n const type = param.event || 'input';\n const handler = () => bind.update(node.value);\n\n // initialize signal value to external input value\n view.signal(param.signal, node.value);\n\n // listen for changes on the element\n node.addEventListener(type, handler);\n\n // register with view, so we can remove it upon finalization\n trackEventListener(view, node, type, handler);\n\n // propagate change to element\n bind.set = value => {\n node.value = value;\n node.dispatchEvent(event(type));\n };\n}\nfunction event(type) {\n return typeof Event !== 'undefined' ? new Event(type) : {\n type\n };\n}\n\n/**\n * Generate an HTML input form element and bind it to a signal.\n */\nfunction generate(bind, el, param, view) {\n const value = view.signal(param.signal);\n const div = element('div', {\n 'class': BindClass\n });\n const wrapper = param.input === 'radio' ? div : div.appendChild(element('label'));\n wrapper.appendChild(element('span', {\n 'class': NameClass\n }, param.name || param.signal));\n el.appendChild(div);\n let input = form;\n switch (param.input) {\n case 'checkbox':\n input = checkbox;\n break;\n case 'select':\n input = select;\n break;\n case 'radio':\n input = radio;\n break;\n case 'range':\n input = range;\n break;\n }\n input(bind, wrapper, param, value);\n}\n\n/**\n * Generates an arbitrary input form element.\n * The input type is controlled via user-provided parameters.\n */\nfunction form(bind, el, param, value) {\n const node = element('input');\n for (const key in param) {\n if (key !== 'signal' && key !== 'element') {\n node.setAttribute(key === 'input' ? 'type' : key, param[key]);\n }\n }\n node.setAttribute('name', param.signal);\n node.value = value;\n el.appendChild(node);\n node.addEventListener('input', () => bind.update(node.value));\n bind.elements = [node];\n bind.set = value => node.value = value;\n}\n\n/**\n * Generates a checkbox input element.\n */\nfunction checkbox(bind, el, param, value) {\n const attr = {\n type: 'checkbox',\n name: param.signal\n };\n if (value) attr.checked = true;\n const node = element('input', attr);\n el.appendChild(node);\n node.addEventListener('change', () => bind.update(node.checked));\n bind.elements = [node];\n bind.set = value => node.checked = !!value || null;\n}\n\n/**\n * Generates a selection list input element.\n */\nfunction select(bind, el, param, value) {\n const node = element('select', {\n name: param.signal\n }),\n labels = param.labels || [];\n param.options.forEach((option, i) => {\n const attr = {\n value: option\n };\n if (valuesEqual(option, value)) attr.selected = true;\n node.appendChild(element('option', attr, (labels[i] || option) + ''));\n });\n el.appendChild(node);\n node.addEventListener('change', () => {\n bind.update(param.options[node.selectedIndex]);\n });\n bind.elements = [node];\n bind.set = value => {\n for (let i = 0, n = param.options.length; i < n; ++i) {\n if (valuesEqual(param.options[i], value)) {\n node.selectedIndex = i;\n return;\n }\n }\n };\n}\n\n/**\n * Generates a radio button group.\n */\nfunction radio(bind, el, param, value) {\n const group = element('span', {\n 'class': RadioClass\n }),\n labels = param.labels || [];\n el.appendChild(group);\n bind.elements = param.options.map((option, i) => {\n const attr = {\n type: 'radio',\n name: param.signal,\n value: option\n };\n if (valuesEqual(option, value)) attr.checked = true;\n const input = element('input', attr);\n input.addEventListener('change', () => bind.update(option));\n const label = element('label', {}, (labels[i] || option) + '');\n label.prepend(input);\n group.appendChild(label);\n return input;\n });\n bind.set = value => {\n const nodes = bind.elements,\n n = nodes.length;\n for (let i = 0; i < n; ++i) {\n if (valuesEqual(nodes[i].value, value)) nodes[i].checked = true;\n }\n };\n}\n\n/**\n * Generates a slider input element.\n */\nfunction range(bind, el, param, value) {\n value = value !== undefined ? value : (+param.max + +param.min) / 2;\n const max = param.max != null ? param.max : Math.max(100, +value) || 100,\n min = param.min || Math.min(0, max, +value) || 0,\n step = param.step || tickStep(min, max, 100);\n const node = element('input', {\n type: 'range',\n name: param.signal,\n min: min,\n max: max,\n step: step\n });\n node.value = value;\n const span = element('span', {}, +value);\n el.appendChild(node);\n el.appendChild(span);\n const update = () => {\n span.textContent = node.value;\n bind.update(+node.value);\n };\n\n // subscribe to both input and change\n node.addEventListener('input', update);\n node.addEventListener('change', update);\n bind.elements = [node];\n bind.set = value => {\n node.value = value;\n span.textContent = value;\n };\n}\nfunction valuesEqual(a, b) {\n return a === b || a + '' === b + '';\n}\n\nfunction initializeRenderer (view, r, el, constructor, scaleFactor, opt) {\n r = r || new constructor(view.loader());\n return r.initialize(el, width(view), height(view), offset(view), scaleFactor, opt).background(view.background());\n}\n\nfunction trap (view, fn) {\n return !fn ? null : function () {\n try {\n fn.apply(this, arguments);\n } catch (error) {\n view.error(error);\n }\n };\n}\n\nfunction initializeHandler (view, prevHandler, el, constructor) {\n // instantiate scenegraph handler\n const handler = new constructor(view.loader(), trap(view, view.tooltip())).scene(view.scenegraph().root).initialize(el, offset(view), view);\n\n // transfer event handlers\n if (prevHandler) {\n prevHandler.handlers().forEach(h => {\n handler.on(h.type, h.handler);\n });\n }\n return handler;\n}\n\nfunction initialize (el, elBind) {\n const view = this,\n type = view._renderType,\n config = view._eventConfig.bind,\n module = renderModule(type);\n\n // containing dom element\n el = view._el = el ? lookup(view, el, true) : null;\n\n // initialize aria attributes\n initializeAria(view);\n\n // select appropriate renderer & handler\n if (!module) view.error('Unrecognized renderer type: ' + type);\n const Handler = module.handler || CanvasHandler,\n Renderer = el ? module.renderer : module.headless;\n\n // initialize renderer and input handler\n view._renderer = !Renderer ? null : initializeRenderer(view, view._renderer, el, Renderer);\n view._handler = initializeHandler(view, view._handler, el, Handler);\n view._redraw = true;\n\n // initialize signal bindings\n if (el && config !== 'none') {\n elBind = elBind ? view._elBind = lookup(view, elBind, true) : el.appendChild(element('form', {\n 'class': 'vega-bindings'\n }));\n view._bind.forEach(_ => {\n if (_.param.element && config !== 'container') {\n _.element = lookup(view, _.param.element, !!_.param.input);\n }\n });\n view._bind.forEach(_ => {\n bind(view, _.element || elBind, _);\n });\n }\n return view;\n}\nfunction lookup(view, el, clear) {\n if (typeof el === 'string') {\n if (typeof document !== 'undefined') {\n el = document.querySelector(el);\n if (!el) {\n view.error('Signal bind element not found: ' + el);\n return null;\n }\n } else {\n view.error('DOM document instance not found.');\n return null;\n }\n }\n if (el && clear) {\n try {\n el.textContent = '';\n } catch (e) {\n el = null;\n view.error(e);\n }\n }\n return el;\n}\n\nconst number = _ => +_ || 0;\nconst paddingObject = _ => ({\n top: _,\n bottom: _,\n left: _,\n right: _\n});\nfunction padding (_) {\n return isObject(_) ? {\n top: number(_.top),\n bottom: number(_.bottom),\n left: number(_.left),\n right: number(_.right)\n } : paddingObject(number(_));\n}\n\n/**\n * Render the current scene in a headless fashion.\n * This method is asynchronous, returning a Promise instance.\n * @return {Promise} - A Promise that resolves to a renderer.\n */\nasync function renderHeadless (view, type, scaleFactor, opt) {\n const module = renderModule(type),\n ctr = module && module.headless;\n if (!ctr) error('Unrecognized renderer type: ' + type);\n await view.runAsync();\n return initializeRenderer(view, null, null, ctr, scaleFactor, opt).renderAsync(view._scenegraph.root);\n}\n\n/**\n * Produce an image URL for the visualization. Depending on the type\n * parameter, the generated URL contains data for either a PNG or SVG image.\n * The URL can be used (for example) to download images of the visualization.\n * This method is asynchronous, returning a Promise instance.\n * @param {string} type - The image type. One of 'svg', 'png' or 'canvas'.\n * The 'canvas' and 'png' types are synonyms for a PNG image.\n * @return {Promise} - A promise that resolves to an image URL.\n */\nasync function renderToImageURL (type, scaleFactor) {\n if (type !== RenderType.Canvas && type !== RenderType.SVG && type !== RenderType.PNG) {\n error('Unrecognized image type: ' + type);\n }\n const r = await renderHeadless(this, type, scaleFactor);\n return type === RenderType.SVG ? toBlobURL(r.svg(), 'image/svg+xml') : r.canvas().toDataURL('image/png');\n}\nfunction toBlobURL(data, mime) {\n const blob = new Blob([data], {\n type: mime\n });\n return window.URL.createObjectURL(blob);\n}\n\n/**\n * Produce a Canvas instance containing a rendered visualization.\n * This method is asynchronous, returning a Promise instance.\n * @return {Promise} - A promise that resolves to a Canvas instance.\n */\nasync function renderToCanvas (scaleFactor, opt) {\n const r = await renderHeadless(this, RenderType.Canvas, scaleFactor, opt);\n return r.canvas();\n}\n\n/**\n * Produce a rendered SVG string of the visualization.\n * This method is asynchronous, returning a Promise instance.\n * @return {Promise} - A promise that resolves to an SVG string.\n */\nasync function renderToSVG (scaleFactor) {\n const r = await renderHeadless(this, RenderType.SVG, scaleFactor);\n return r.svg();\n}\n\nfunction runtime (view, spec, expr) {\n return context(view, transforms, functionContext, expr).parse(spec);\n}\n\nfunction scale(name) {\n var scales = this._runtime.scales;\n if (!hasOwnProperty(scales, name)) {\n error('Unrecognized scale or projection: ' + name);\n }\n return scales[name].value;\n}\n\nvar Width = 'width',\n Height = 'height',\n Padding = 'padding',\n Skip = {\n skip: true\n };\nfunction viewWidth(view, width) {\n var a = view.autosize(),\n p = view.padding();\n return width - (a && a.contains === Padding ? p.left + p.right : 0);\n}\nfunction viewHeight(view, height) {\n var a = view.autosize(),\n p = view.padding();\n return height - (a && a.contains === Padding ? p.top + p.bottom : 0);\n}\nfunction initializeResize(view) {\n var s = view._signals,\n w = s[Width],\n h = s[Height],\n p = s[Padding];\n function resetSize() {\n view._autosize = view._resize = 1;\n }\n\n // respond to width signal\n view._resizeWidth = view.add(null, _ => {\n view._width = _.size;\n view._viewWidth = viewWidth(view, _.size);\n resetSize();\n }, {\n size: w\n });\n\n // respond to height signal\n view._resizeHeight = view.add(null, _ => {\n view._height = _.size;\n view._viewHeight = viewHeight(view, _.size);\n resetSize();\n }, {\n size: h\n });\n\n // respond to padding signal\n const resizePadding = view.add(null, resetSize, {\n pad: p\n });\n\n // set rank to run immediately after source signal\n view._resizeWidth.rank = w.rank + 1;\n view._resizeHeight.rank = h.rank + 1;\n resizePadding.rank = p.rank + 1;\n}\nfunction resizeView(viewWidth, viewHeight, width, height, origin, auto) {\n this.runAfter(view => {\n let rerun = 0;\n\n // reset autosize flag\n view._autosize = 0;\n\n // width value changed: update signal, skip resize op\n if (view.width() !== width) {\n rerun = 1;\n view.signal(Width, width, Skip); // set width, skip update calc\n view._resizeWidth.skip(true); // skip width resize handler\n }\n\n // height value changed: update signal, skip resize op\n if (view.height() !== height) {\n rerun = 1;\n view.signal(Height, height, Skip); // set height, skip update calc\n view._resizeHeight.skip(true); // skip height resize handler\n }\n\n // view width changed: update view property, set resize flag\n if (view._viewWidth !== viewWidth) {\n view._resize = 1;\n view._viewWidth = viewWidth;\n }\n\n // view height changed: update view property, set resize flag\n if (view._viewHeight !== viewHeight) {\n view._resize = 1;\n view._viewHeight = viewHeight;\n }\n\n // origin changed: update view property, set resize flag\n if (view._origin[0] !== origin[0] || view._origin[1] !== origin[1]) {\n view._resize = 1;\n view._origin = origin;\n }\n\n // run dataflow on width/height signal change\n if (rerun) view.run('enter');\n if (auto) view.runAfter(v => v.resize());\n }, false, 1);\n}\n\n/**\n * Get the current view state, consisting of signal values and/or data sets.\n * @param {object} [options] - Options flags indicating which state to export.\n * If unspecified, all signals and data sets will be exported.\n * @param {function(string, Operator):boolean} [options.signals] - Optional\n * predicate function for testing if a signal should be included in the\n * exported state. If unspecified, all signals will be included, except for\n * those named 'parent' or those which refer to a Transform value.\n * @param {function(string, object):boolean} [options.data] - Optional\n * predicate function for testing if a data set's input should be included\n * in the exported state. If unspecified, all data sets that have been\n * explicitly modified will be included.\n * @param {boolean} [options.recurse=true] - Flag indicating if the exported\n * state should recursively include state from group mark sub-contexts.\n * @return {object} - An object containing the exported state values.\n */\nfunction getState(options) {\n return this._runtime.getState(options || {\n data: dataTest,\n signals: signalTest,\n recurse: true\n });\n}\nfunction dataTest(name, data) {\n return data.modified && isArray(data.input.value) && name.indexOf('_:vega:_');\n}\nfunction signalTest(name, op) {\n return !(name === 'parent' || op instanceof transforms.proxy);\n}\n\n/**\n * Sets the current view state and updates the view by invoking run.\n * @param {object} state - A state object containing signal and/or\n * data set values, following the format used by the getState method.\n * @return {View} - This view instance.\n */\nfunction setState(state) {\n this.runAsync(null, v => {\n v._trigger = false;\n v._runtime.setState(state);\n }, v => {\n v._trigger = true;\n });\n return this;\n}\n\nfunction timer (callback, delay) {\n function tick(elapsed) {\n callback({\n timestamp: Date.now(),\n elapsed: elapsed\n });\n }\n this._timers.push(interval(tick, delay));\n}\n\nfunction defaultTooltip (handler, event, item, value) {\n const el = handler.element();\n if (el) el.setAttribute('title', formatTooltip(value));\n}\nfunction formatTooltip(value) {\n return value == null ? '' : isArray(value) ? formatArray(value) : isObject(value) && !isDate(value) ? formatObject(value) : value + '';\n}\nfunction formatObject(obj) {\n return Object.keys(obj).map(key => {\n const v = obj[key];\n return key + ': ' + (isArray(v) ? formatArray(v) : formatValue(v));\n }).join('\\n');\n}\nfunction formatArray(value) {\n return '[' + value.map(formatValue).join(', ') + ']';\n}\nfunction formatValue(value) {\n return isArray(value) ? '[\\u2026]' : isObject(value) && !isDate(value) ? '{\\u2026}' : value;\n}\n\n/**\n * Create a new View instance from a Vega dataflow runtime specification.\n * The generated View will not immediately be ready for display. Callers\n * should also invoke the initialize method (e.g., to set the parent\n * DOM element in browser-based deployment) and then invoke the run\n * method to evaluate the dataflow graph. Rendering will automatically\n * be performed upon dataflow runs.\n * @constructor\n * @param {object} spec - The Vega dataflow runtime specification.\n */\nfunction View(spec, options) {\n const view = this;\n options = options || {};\n Dataflow.call(view);\n if (options.loader) view.loader(options.loader);\n if (options.logger) view.logger(options.logger);\n if (options.logLevel != null) view.logLevel(options.logLevel);\n if (options.locale || spec.locale) {\n const loc = extend({}, spec.locale, options.locale);\n view.locale(locale(loc.number, loc.time));\n }\n view._el = null;\n view._elBind = null;\n view._renderType = options.renderer || RenderType.Canvas;\n view._scenegraph = new Scenegraph();\n const root = view._scenegraph.root;\n\n // initialize renderer, handler and event management\n view._renderer = null;\n view._tooltip = options.tooltip || defaultTooltip, view._redraw = true;\n view._handler = new CanvasHandler().scene(root);\n view._globalCursor = false;\n view._preventDefault = false;\n view._timers = [];\n view._eventListeners = [];\n view._resizeListeners = [];\n\n // initialize event configuration\n view._eventConfig = initializeEventConfig(spec.eventConfig);\n view.globalCursor(view._eventConfig.globalCursor);\n\n // initialize dataflow graph\n const ctx = runtime(view, spec, options.expr);\n view._runtime = ctx;\n view._signals = ctx.signals;\n view._bind = (spec.bindings || []).map(_ => ({\n state: null,\n param: extend({}, _)\n }));\n\n // initialize scenegraph\n if (ctx.root) ctx.root.set(root);\n root.source = ctx.data.root.input;\n view.pulse(ctx.data.root.input, view.changeset().insert(root.items));\n\n // initialize view size\n view._width = view.width();\n view._height = view.height();\n view._viewWidth = viewWidth(view, view._width);\n view._viewHeight = viewHeight(view, view._height);\n view._origin = [0, 0];\n view._resize = 0;\n view._autosize = 1;\n initializeResize(view);\n\n // initialize background color\n background(view);\n\n // initialize cursor\n cursor(view);\n\n // initialize view description\n view.description(spec.description);\n\n // initialize hover proessing, if requested\n if (options.hover) view.hover();\n\n // initialize DOM container(s) and renderer\n if (options.container) view.initialize(options.container, options.bind);\n}\nfunction lookupSignal(view, name) {\n return hasOwnProperty(view._signals, name) ? view._signals[name] : error('Unrecognized signal name: ' + stringValue(name));\n}\nfunction findOperatorHandler(op, handler) {\n const h = (op._targets || []).filter(op => op._update && op._update.handler === handler);\n return h.length ? h[0] : null;\n}\nfunction addOperatorListener(view, name, op, handler) {\n let h = findOperatorHandler(op, handler);\n if (!h) {\n h = trap(view, () => handler(name, op.value));\n h.handler = handler;\n view.on(op, null, h);\n }\n return view;\n}\nfunction removeOperatorListener(view, op, handler) {\n const h = findOperatorHandler(op, handler);\n if (h) op._targets.remove(h);\n return view;\n}\ninherits(View, Dataflow, {\n // -- DATAFLOW / RENDERING ----\n\n async evaluate(encode, prerun, postrun) {\n // evaluate dataflow and prerun\n await Dataflow.prototype.evaluate.call(this, encode, prerun);\n\n // render as needed\n if (this._redraw || this._resize) {\n try {\n if (this._renderer) {\n if (this._resize) {\n this._resize = 0;\n resizeRenderer(this);\n }\n await this._renderer.renderAsync(this._scenegraph.root);\n }\n this._redraw = false;\n } catch (e) {\n this.error(e);\n }\n }\n\n // evaluate postrun\n if (postrun) asyncCallback(this, postrun);\n return this;\n },\n dirty(item) {\n this._redraw = true;\n this._renderer && this._renderer.dirty(item);\n },\n // -- GET / SET ----\n\n description(text) {\n if (arguments.length) {\n const desc = text != null ? text + '' : null;\n if (desc !== this._desc) ariaLabel(this._el, this._desc = desc);\n return this;\n }\n return this._desc;\n },\n container() {\n return this._el;\n },\n scenegraph() {\n return this._scenegraph;\n },\n origin() {\n return this._origin.slice();\n },\n signal(name, value, options) {\n const op = lookupSignal(this, name);\n return arguments.length === 1 ? op.value : this.update(op, value, options);\n },\n width(_) {\n return arguments.length ? this.signal('width', _) : this.signal('width');\n },\n height(_) {\n return arguments.length ? this.signal('height', _) : this.signal('height');\n },\n padding(_) {\n return arguments.length ? this.signal('padding', padding(_)) : padding(this.signal('padding'));\n },\n autosize(_) {\n return arguments.length ? this.signal('autosize', _) : this.signal('autosize');\n },\n background(_) {\n return arguments.length ? this.signal('background', _) : this.signal('background');\n },\n renderer(type) {\n if (!arguments.length) return this._renderType;\n if (!renderModule(type)) error('Unrecognized renderer type: ' + type);\n if (type !== this._renderType) {\n this._renderType = type;\n this._resetRenderer();\n }\n return this;\n },\n tooltip(handler) {\n if (!arguments.length) return this._tooltip;\n if (handler !== this._tooltip) {\n this._tooltip = handler;\n this._resetRenderer();\n }\n return this;\n },\n loader(loader) {\n if (!arguments.length) return this._loader;\n if (loader !== this._loader) {\n Dataflow.prototype.loader.call(this, loader);\n this._resetRenderer();\n }\n return this;\n },\n resize() {\n // set flag to perform autosize\n this._autosize = 1;\n // touch autosize signal to ensure top-level ViewLayout runs\n return this.touch(lookupSignal(this, 'autosize'));\n },\n _resetRenderer() {\n if (this._renderer) {\n this._renderer = null;\n this.initialize(this._el, this._elBind);\n }\n },\n // -- SIZING ----\n _resizeView: resizeView,\n // -- EVENT HANDLING ----\n\n addEventListener(type, handler, options) {\n let callback = handler;\n if (!(options && options.trap === false)) {\n // wrap callback in error handler\n callback = trap(this, handler);\n callback.raw = handler;\n }\n this._handler.on(type, callback);\n return this;\n },\n removeEventListener(type, handler) {\n var handlers = this._handler.handlers(type),\n i = handlers.length,\n h,\n t;\n\n // search registered handlers, remove if match found\n while (--i >= 0) {\n t = handlers[i].type;\n h = handlers[i].handler;\n if (type === t && (handler === h || handler === h.raw)) {\n this._handler.off(t, h);\n break;\n }\n }\n return this;\n },\n addResizeListener(handler) {\n const l = this._resizeListeners;\n if (l.indexOf(handler) < 0) {\n // add handler if it isn't already registered\n // note: error trapping handled elsewhere, so\n // no need to wrap handlers here\n l.push(handler);\n }\n return this;\n },\n removeResizeListener(handler) {\n var l = this._resizeListeners,\n i = l.indexOf(handler);\n if (i >= 0) {\n l.splice(i, 1);\n }\n return this;\n },\n addSignalListener(name, handler) {\n return addOperatorListener(this, name, lookupSignal(this, name), handler);\n },\n removeSignalListener(name, handler) {\n return removeOperatorListener(this, lookupSignal(this, name), handler);\n },\n addDataListener(name, handler) {\n return addOperatorListener(this, name, dataref(this, name).values, handler);\n },\n removeDataListener(name, handler) {\n return removeOperatorListener(this, dataref(this, name).values, handler);\n },\n globalCursor(_) {\n if (arguments.length) {\n if (this._globalCursor !== !!_) {\n const prev = setCursor(this, null); // clear previous cursor\n this._globalCursor = !!_;\n if (prev) setCursor(this, prev); // swap cursor\n }\n\n return this;\n } else {\n return this._globalCursor;\n }\n },\n preventDefault(_) {\n if (arguments.length) {\n this._preventDefault = _;\n return this;\n } else {\n return this._preventDefault;\n }\n },\n timer,\n events,\n finalize,\n hover,\n // -- DATA ----\n data,\n change,\n insert,\n remove,\n // -- SCALES --\n scale,\n // -- INITIALIZATION ----\n initialize,\n // -- HEADLESS RENDERING ----\n toImageURL: renderToImageURL,\n toCanvas: renderToCanvas,\n toSVG: renderToSVG,\n // -- SAVE / RESTORE STATE ----\n getState,\n setState\n});\n\nexport { View };\n","import {Timer, now} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n var t = new Timer, total = delay;\n if (delay == null) return t.restart(callback, delay, time), t;\n t._restart = t.restart;\n t.restart = function(callback, delay, time) {\n delay = +delay, time = time == null ? now() : +time;\n t._restart(function tick(elapsed) {\n elapsed += total;\n t._restart(tick, total += delay, time);\n callback(elapsed);\n }, delay, time);\n }\n t.restart(callback, delay, time);\n return t;\n}\n","const VIEW = 'view',\n LBRACK = '[',\n RBRACK = ']',\n LBRACE = '{',\n RBRACE = '}',\n COLON = ':',\n COMMA = ',',\n NAME = '@',\n GT = '>',\n ILLEGAL = /[[\\]{}]/,\n DEFAULT_MARKS = {\n '*': 1,\n arc: 1,\n area: 1,\n group: 1,\n image: 1,\n line: 1,\n path: 1,\n rect: 1,\n rule: 1,\n shape: 1,\n symbol: 1,\n text: 1,\n trail: 1\n };\nlet DEFAULT_SOURCE, MARKS;\n\n/**\n * Parse an event selector string.\n * Returns an array of event stream definitions.\n */\nfunction eventSelector (selector, source, marks) {\n DEFAULT_SOURCE = source || VIEW;\n MARKS = marks || DEFAULT_MARKS;\n return parseMerge(selector.trim()).map(parseSelector);\n}\nfunction isMarkType(type) {\n return MARKS[type];\n}\nfunction find(s, i, endChar, pushChar, popChar) {\n const n = s.length;\n let count = 0,\n c;\n for (; i < n; ++i) {\n c = s[i];\n if (!count && c === endChar) return i;else if (popChar && popChar.indexOf(c) >= 0) --count;else if (pushChar && pushChar.indexOf(c) >= 0) ++count;\n }\n return i;\n}\nfunction parseMerge(s) {\n const output = [],\n n = s.length;\n let start = 0,\n i = 0;\n while (i < n) {\n i = find(s, i, COMMA, LBRACK + LBRACE, RBRACK + RBRACE);\n output.push(s.substring(start, i).trim());\n start = ++i;\n }\n if (output.length === 0) {\n throw 'Empty event selector: ' + s;\n }\n return output;\n}\nfunction parseSelector(s) {\n return s[0] === '[' ? parseBetween(s) : parseStream(s);\n}\nfunction parseBetween(s) {\n const n = s.length;\n let i = 1,\n b;\n i = find(s, i, RBRACK, LBRACK, RBRACK);\n if (i === n) {\n throw 'Empty between selector: ' + s;\n }\n b = parseMerge(s.substring(1, i));\n if (b.length !== 2) {\n throw 'Between selector must have two elements: ' + s;\n }\n s = s.slice(i + 1).trim();\n if (s[0] !== GT) {\n throw 'Expected \\'>\\' after between selector: ' + s;\n }\n b = b.map(parseSelector);\n const stream = parseSelector(s.slice(1).trim());\n if (stream.between) {\n return {\n between: b,\n stream: stream\n };\n } else {\n stream.between = b;\n }\n return stream;\n}\nfunction parseStream(s) {\n const stream = {\n source: DEFAULT_SOURCE\n },\n source = [];\n let throttle = [0, 0],\n markname = 0,\n start = 0,\n n = s.length,\n i = 0,\n j,\n filter;\n\n // extract throttle from end\n if (s[n - 1] === RBRACE) {\n i = s.lastIndexOf(LBRACE);\n if (i >= 0) {\n try {\n throttle = parseThrottle(s.substring(i + 1, n - 1));\n } catch (e) {\n throw 'Invalid throttle specification: ' + s;\n }\n s = s.slice(0, i).trim();\n n = s.length;\n } else throw 'Unmatched right brace: ' + s;\n i = 0;\n }\n if (!n) throw s;\n\n // set name flag based on first char\n if (s[0] === NAME) markname = ++i;\n\n // extract first part of multi-part stream selector\n j = find(s, i, COLON);\n if (j < n) {\n source.push(s.substring(start, j).trim());\n start = i = ++j;\n }\n\n // extract remaining part of stream selector\n i = find(s, i, LBRACK);\n if (i === n) {\n source.push(s.substring(start, n).trim());\n } else {\n source.push(s.substring(start, i).trim());\n filter = [];\n start = ++i;\n if (start === n) throw 'Unmatched left bracket: ' + s;\n }\n\n // extract filters\n while (i < n) {\n i = find(s, i, RBRACK);\n if (i === n) throw 'Unmatched left bracket: ' + s;\n filter.push(s.substring(start, i).trim());\n if (i < n - 1 && s[++i] !== LBRACK) throw 'Expected left bracket: ' + s;\n start = ++i;\n }\n\n // marshall event stream specification\n if (!(n = source.length) || ILLEGAL.test(source[n - 1])) {\n throw 'Invalid event selector: ' + s;\n }\n if (n > 1) {\n stream.type = source[1];\n if (markname) {\n stream.markname = source[0].slice(1);\n } else if (isMarkType(source[0])) {\n stream.marktype = source[0];\n } else {\n stream.source = source[0];\n }\n } else {\n stream.type = source[0];\n }\n if (stream.type.slice(-1) === '!') {\n stream.consume = true;\n stream.type = stream.type.slice(0, -1);\n }\n if (filter != null) stream.filter = filter;\n if (throttle[0]) stream.throttle = throttle[0];\n if (throttle[1]) stream.debounce = throttle[1];\n return stream;\n}\nfunction parseThrottle(s) {\n const a = s.split(COMMA);\n if (!s.length || a.length > 2) throw s;\n return a.map(_ => {\n const x = +_;\n if (x !== x) throw s;\n return x;\n });\n}\n\nexport { eventSelector as parseSelector };\n","import { isObject, isArray, extend, hasOwnProperty, array, stringValue, peek, error, isString, splitAccessPath, mergeConfig } from 'vega-util';\nimport { parseExpression } from 'vega-functions';\nimport { parseSelector } from 'vega-event-selector';\nimport { isValidScaleType, isDiscrete, isQuantile, isContinuous, isDiscretizing } from 'vega-scale';\nimport { definition as definition$1 } from 'vega-dataflow';\n\nfunction parseAutosize (spec) {\n return isObject(spec) ? spec : {\n type: spec || 'pad'\n };\n}\n\nconst number = _ => +_ || 0;\nconst paddingObject = _ => ({\n top: _,\n bottom: _,\n left: _,\n right: _\n});\nfunction parsePadding (spec) {\n return !isObject(spec) ? paddingObject(number(spec)) : spec.signal ? spec : {\n top: number(spec.top),\n bottom: number(spec.bottom),\n left: number(spec.left),\n right: number(spec.right)\n };\n}\n\nconst encoder = _ => isObject(_) && !isArray(_) ? extend({}, _) : {\n value: _\n};\nfunction addEncode(object, name, value, set) {\n if (value != null) {\n const isEncoder = isObject(value) && !isArray(value) || isArray(value) && value.length && isObject(value[0]);\n\n // Always assign signal to update, even if the signal is from the enter block\n if (isEncoder) {\n object.update[name] = value;\n } else {\n object[set || 'enter'][name] = {\n value: value\n };\n }\n return 1;\n } else {\n return 0;\n }\n}\nfunction addEncoders(object, enter, update) {\n for (const name in enter) {\n addEncode(object, name, enter[name]);\n }\n for (const name in update) {\n addEncode(object, name, update[name], 'update');\n }\n}\nfunction extendEncode(encode, extra, skip) {\n for (const name in extra) {\n if (skip && hasOwnProperty(skip, name)) continue;\n encode[name] = extend(encode[name] || {}, extra[name]);\n }\n return encode;\n}\nfunction has(key, encode) {\n return encode && (encode.enter && encode.enter[key] || encode.update && encode.update[key]);\n}\n\nconst MarkRole = 'mark';\nconst FrameRole = 'frame';\nconst ScopeRole = 'scope';\nconst AxisRole = 'axis';\nconst AxisDomainRole = 'axis-domain';\nconst AxisGridRole = 'axis-grid';\nconst AxisLabelRole = 'axis-label';\nconst AxisTickRole = 'axis-tick';\nconst AxisTitleRole = 'axis-title';\nconst LegendRole = 'legend';\nconst LegendBandRole = 'legend-band';\nconst LegendEntryRole = 'legend-entry';\nconst LegendGradientRole = 'legend-gradient';\nconst LegendLabelRole = 'legend-label';\nconst LegendSymbolRole = 'legend-symbol';\nconst LegendTitleRole = 'legend-title';\nconst TitleRole = 'title';\nconst TitleTextRole = 'title-text';\nconst TitleSubtitleRole = 'title-subtitle';\n\nfunction applyDefaults (encode, type, role, style, config) {\n const defaults = {},\n enter = {};\n let update, key, skip, props;\n\n // if text mark, apply global lineBreak settings (#2370)\n key = 'lineBreak';\n if (type === 'text' && config[key] != null && !has(key, encode)) {\n applyDefault(defaults, key, config[key]);\n }\n\n // ignore legend and axis roles\n if (role == 'legend' || String(role).startsWith('axis')) {\n role = null;\n }\n\n // resolve mark config\n props = role === FrameRole ? config.group : role === MarkRole ? extend({}, config.mark, config[type]) : null;\n for (key in props) {\n // do not apply defaults if relevant fields are defined\n skip = has(key, encode) || (key === 'fill' || key === 'stroke') && (has('fill', encode) || has('stroke', encode));\n if (!skip) applyDefault(defaults, key, props[key]);\n }\n\n // resolve styles, apply with increasing precedence\n array(style).forEach(name => {\n const props = config.style && config.style[name];\n for (const key in props) {\n if (!has(key, encode)) {\n applyDefault(defaults, key, props[key]);\n }\n }\n });\n encode = extend({}, encode); // defensive copy\n for (key in defaults) {\n props = defaults[key];\n if (props.signal) {\n (update = update || {})[key] = props;\n } else {\n enter[key] = props;\n }\n }\n encode.enter = extend(enter, encode.enter);\n if (update) encode.update = extend(update, encode.update);\n return encode;\n}\nfunction applyDefault(defaults, key, value) {\n defaults[key] = value && value.signal ? {\n signal: value.signal\n } : {\n value: value\n };\n}\n\nconst scaleRef = scale => isString(scale) ? stringValue(scale) : scale.signal ? `(${scale.signal})` : field(scale);\nfunction entry$1(enc) {\n if (enc.gradient != null) {\n return gradient(enc);\n }\n let value = enc.signal ? `(${enc.signal})` : enc.color ? color(enc.color) : enc.field != null ? field(enc.field) : enc.value !== undefined ? stringValue(enc.value) : undefined;\n if (enc.scale != null) {\n value = scale(enc, value);\n }\n if (value === undefined) {\n value = null;\n }\n if (enc.exponent != null) {\n value = `pow(${value},${property(enc.exponent)})`;\n }\n if (enc.mult != null) {\n value += `*${property(enc.mult)}`;\n }\n if (enc.offset != null) {\n value += `+${property(enc.offset)}`;\n }\n if (enc.round) {\n value = `round(${value})`;\n }\n return value;\n}\nconst _color = (type, x, y, z) => `(${type}(${[x, y, z].map(entry$1).join(',')})+'')`;\nfunction color(enc) {\n return enc.c ? _color('hcl', enc.h, enc.c, enc.l) : enc.h || enc.s ? _color('hsl', enc.h, enc.s, enc.l) : enc.l || enc.a ? _color('lab', enc.l, enc.a, enc.b) : enc.r || enc.g || enc.b ? _color('rgb', enc.r, enc.g, enc.b) : null;\n}\nfunction gradient(enc) {\n // map undefined to null; expression lang does not allow undefined\n const args = [enc.start, enc.stop, enc.count].map(_ => _ == null ? null : stringValue(_));\n\n // trim null inputs from the end\n while (args.length && peek(args) == null) args.pop();\n args.unshift(scaleRef(enc.gradient));\n return `gradient(${args.join(',')})`;\n}\nfunction property(property) {\n return isObject(property) ? '(' + entry$1(property) + ')' : property;\n}\nfunction field(ref) {\n return resolveField(isObject(ref) ? ref : {\n datum: ref\n });\n}\nfunction resolveField(ref) {\n let object, level, field;\n if (ref.signal) {\n object = 'datum';\n field = ref.signal;\n } else if (ref.group || ref.parent) {\n level = Math.max(1, ref.level || 1);\n object = 'item';\n while (level-- > 0) {\n object += '.mark.group';\n }\n if (ref.parent) {\n field = ref.parent;\n object += '.datum';\n } else {\n field = ref.group;\n }\n } else if (ref.datum) {\n object = 'datum';\n field = ref.datum;\n } else {\n error('Invalid field reference: ' + stringValue(ref));\n }\n if (!ref.signal) {\n field = isString(field) ? splitAccessPath(field).map(stringValue).join('][') : resolveField(field);\n }\n return object + '[' + field + ']';\n}\nfunction scale(enc, value) {\n const scale = scaleRef(enc.scale);\n if (enc.range != null) {\n // pull value from scale range\n value = `lerp(_range(${scale}), ${+enc.range})`;\n } else {\n // run value through scale and/or pull scale bandwidth\n if (value !== undefined) value = `_scale(${scale}, ${value})`;\n if (enc.band) {\n value = (value ? value + '+' : '') + `_bandwidth(${scale})` + (+enc.band === 1 ? '' : '*' + property(enc.band));\n if (enc.extra) {\n // include logic to handle extraneous elements\n value = `(datum.extra ? _scale(${scale}, datum.extra.value) : ${value})`;\n }\n }\n if (value == null) value = '0';\n }\n return value;\n}\n\nfunction rule (enc) {\n let code = '';\n enc.forEach(rule => {\n const value = entry$1(rule);\n code += rule.test ? `(${rule.test})?${value}:` : value;\n });\n\n // if no else clause, terminate with null (#1366)\n if (peek(code) === ':') {\n code += 'null';\n }\n return code;\n}\n\nfunction parseEncode (encode, type, role, style, scope, params) {\n const enc = {};\n params = params || {};\n params.encoders = {\n $encode: enc\n };\n encode = applyDefaults(encode, type, role, style, scope.config);\n for (const key in encode) {\n enc[key] = parseBlock(encode[key], type, params, scope);\n }\n return params;\n}\nfunction parseBlock(block, marktype, params, scope) {\n const channels = {},\n fields = {};\n for (const name in block) {\n if (block[name] != null) {\n // skip any null entries\n channels[name] = parse$1(expr(block[name]), scope, params, fields);\n }\n }\n return {\n $expr: {\n marktype,\n channels\n },\n $fields: Object.keys(fields),\n $output: Object.keys(block)\n };\n}\nfunction expr(enc) {\n return isArray(enc) ? rule(enc) : entry$1(enc);\n}\nfunction parse$1(code, scope, params, fields) {\n const expr = parseExpression(code, scope);\n expr.$fields.forEach(name => fields[name] = 1);\n extend(params, expr.$params);\n return expr.$expr;\n}\n\nconst OUTER = 'outer',\n OUTER_INVALID = ['value', 'update', 'init', 'react', 'bind'];\nfunction outerError(prefix, name) {\n error(prefix + ' for \"outer\" push: ' + stringValue(name));\n}\nfunction parseSignal (signal, scope) {\n const name = signal.name;\n if (signal.push === OUTER) {\n // signal must already be defined, raise error if not\n if (!scope.signals[name]) outerError('No prior signal definition', name);\n // signal push must not use properties reserved for standard definition\n OUTER_INVALID.forEach(prop => {\n if (signal[prop] !== undefined) outerError('Invalid property ', prop);\n });\n } else {\n // define a new signal in the current scope\n const op = scope.addSignal(name, signal.value);\n if (signal.react === false) op.react = false;\n if (signal.bind) scope.addBinding(name, signal.bind);\n }\n}\n\nfunction Entry(type, value, params, parent) {\n this.id = -1;\n this.type = type;\n this.value = value;\n this.params = params;\n if (parent) this.parent = parent;\n}\nfunction entry(type, value, params, parent) {\n return new Entry(type, value, params, parent);\n}\nfunction operator(value, params) {\n return entry('operator', value, params);\n}\n\n// -----\n\nfunction ref(op) {\n const ref = {\n $ref: op.id\n };\n // if operator not yet registered, cache ref to resolve later\n if (op.id < 0) (op.refs = op.refs || []).push(ref);\n return ref;\n}\nfunction fieldRef$1(field, name) {\n return name ? {\n $field: field,\n $name: name\n } : {\n $field: field\n };\n}\nconst keyFieldRef = fieldRef$1('key');\nfunction compareRef(fields, orders) {\n return {\n $compare: fields,\n $order: orders\n };\n}\nfunction keyRef(fields, flat) {\n const ref = {\n $key: fields\n };\n if (flat) ref.$flat = true;\n return ref;\n}\n\n// -----\n\nconst Ascending = 'ascending';\nconst Descending = 'descending';\nfunction sortKey(sort) {\n return !isObject(sort) ? '' : (sort.order === Descending ? '-' : '+') + aggrField(sort.op, sort.field);\n}\nfunction aggrField(op, field) {\n return (op && op.signal ? '$' + op.signal : op || '') + (op && field ? '_' : '') + (field && field.signal ? '$' + field.signal : field || '');\n}\n\n// -----\n\nconst Scope$1 = 'scope';\nconst View = 'view';\nfunction isSignal(_) {\n return _ && _.signal;\n}\nfunction isExpr$1(_) {\n return _ && _.expr;\n}\nfunction hasSignal(_) {\n if (isSignal(_)) return true;\n if (isObject(_)) for (const key in _) {\n if (hasSignal(_[key])) return true;\n }\n return false;\n}\nfunction value(specValue, defaultValue) {\n return specValue != null ? specValue : defaultValue;\n}\nfunction deref(v) {\n return v && v.signal || v;\n}\n\nconst Timer = 'timer';\nfunction parseStream(stream, scope) {\n const method = stream.merge ? mergeStream : stream.stream ? nestedStream : stream.type ? eventStream : error('Invalid stream specification: ' + stringValue(stream));\n return method(stream, scope);\n}\nfunction eventSource(source) {\n return source === Scope$1 ? View : source || View;\n}\nfunction mergeStream(stream, scope) {\n const list = stream.merge.map(s => parseStream(s, scope)),\n entry = streamParameters({\n merge: list\n }, stream, scope);\n return scope.addStream(entry).id;\n}\nfunction nestedStream(stream, scope) {\n const id = parseStream(stream.stream, scope),\n entry = streamParameters({\n stream: id\n }, stream, scope);\n return scope.addStream(entry).id;\n}\nfunction eventStream(stream, scope) {\n let id;\n if (stream.type === Timer) {\n id = scope.event(Timer, stream.throttle);\n stream = {\n between: stream.between,\n filter: stream.filter\n };\n } else {\n id = scope.event(eventSource(stream.source), stream.type);\n }\n const entry = streamParameters({\n stream: id\n }, stream, scope);\n return Object.keys(entry).length === 1 ? id : scope.addStream(entry).id;\n}\nfunction streamParameters(entry, stream, scope) {\n let param = stream.between;\n if (param) {\n if (param.length !== 2) {\n error('Stream \"between\" parameter must have 2 entries: ' + stringValue(stream));\n }\n entry.between = [parseStream(param[0], scope), parseStream(param[1], scope)];\n }\n param = stream.filter ? [].concat(stream.filter) : [];\n if (stream.marktype || stream.markname || stream.markrole) {\n // add filter for mark type, name and/or role\n param.push(filterMark(stream.marktype, stream.markname, stream.markrole));\n }\n if (stream.source === Scope$1) {\n // add filter to limit events from sub-scope only\n param.push('inScope(event.item)');\n }\n if (param.length) {\n entry.filter = parseExpression('(' + param.join(')&&(') + ')', scope).$expr;\n }\n if ((param = stream.throttle) != null) {\n entry.throttle = +param;\n }\n if ((param = stream.debounce) != null) {\n entry.debounce = +param;\n }\n if (stream.consume) {\n entry.consume = true;\n }\n return entry;\n}\nfunction filterMark(type, name, role) {\n const item = 'event.item';\n return item + (type && type !== '*' ? '&&' + item + '.mark.marktype===\\'' + type + '\\'' : '') + (role ? '&&' + item + '.mark.role===\\'' + role + '\\'' : '') + (name ? '&&' + item + '.mark.name===\\'' + name + '\\'' : '');\n}\n\n// bypass expression parser for internal operator references\nconst OP_VALUE_EXPR = {\n code: '_.$value',\n ast: {\n type: 'Identifier',\n value: 'value'\n }\n};\nfunction parseUpdate (spec, scope, target) {\n const encode = spec.encode,\n entry = {\n target: target\n };\n let events = spec.events,\n update = spec.update,\n sources = [];\n if (!events) {\n error('Signal update missing events specification.');\n }\n\n // interpret as an event selector string\n if (isString(events)) {\n events = parseSelector(events, scope.isSubscope() ? Scope$1 : View);\n }\n\n // separate event streams from signal updates\n events = array(events).filter(s => s.signal || s.scale ? (sources.push(s), 0) : 1);\n\n // merge internal operator listeners\n if (sources.length > 1) {\n sources = [mergeSources(sources)];\n }\n\n // merge event streams, include as source\n if (events.length) {\n sources.push(events.length > 1 ? {\n merge: events\n } : events[0]);\n }\n if (encode != null) {\n if (update) error('Signal encode and update are mutually exclusive.');\n update = 'encode(item(),' + stringValue(encode) + ')';\n }\n\n // resolve update value\n entry.update = isString(update) ? parseExpression(update, scope) : update.expr != null ? parseExpression(update.expr, scope) : update.value != null ? update.value : update.signal != null ? {\n $expr: OP_VALUE_EXPR,\n $params: {\n $value: scope.signalRef(update.signal)\n }\n } : error('Invalid signal update specification.');\n if (spec.force) {\n entry.options = {\n force: true\n };\n }\n sources.forEach(source => scope.addUpdate(extend(streamSource(source, scope), entry)));\n}\nfunction streamSource(stream, scope) {\n return {\n source: stream.signal ? scope.signalRef(stream.signal) : stream.scale ? scope.scaleRef(stream.scale) : parseStream(stream, scope)\n };\n}\nfunction mergeSources(sources) {\n return {\n signal: '[' + sources.map(s => s.scale ? 'scale(\"' + s.scale + '\")' : s.signal) + ']'\n };\n}\n\nfunction parseSignalUpdates (signal, scope) {\n const op = scope.getSignal(signal.name);\n let expr = signal.update;\n if (signal.init) {\n if (expr) {\n error('Signals can not include both init and update expressions.');\n } else {\n expr = signal.init;\n op.initonly = true;\n }\n }\n if (expr) {\n expr = parseExpression(expr, scope);\n op.update = expr.$expr;\n op.params = expr.$params;\n }\n if (signal.on) {\n signal.on.forEach(_ => parseUpdate(_, scope, op.id));\n }\n}\n\nconst transform = name => (params, value, parent) => entry(name, value, params || undefined, parent);\nconst Aggregate = transform('aggregate');\nconst AxisTicks = transform('axisticks');\nconst Bound = transform('bound');\nconst Collect = transform('collect');\nconst Compare = transform('compare');\nconst DataJoin = transform('datajoin');\nconst Encode = transform('encode');\nconst Expression = transform('expression');\nconst Facet = transform('facet');\nconst Field = transform('field');\nconst Key = transform('key');\nconst LegendEntries = transform('legendentries');\nconst Load = transform('load');\nconst Mark = transform('mark');\nconst MultiExtent = transform('multiextent');\nconst MultiValues = transform('multivalues');\nconst Overlap = transform('overlap');\nconst Params = transform('params');\nconst PreFacet = transform('prefacet');\nconst Projection = transform('projection');\nconst Proxy = transform('proxy');\nconst Relay = transform('relay');\nconst Render = transform('render');\nconst Scale = transform('scale');\nconst Sieve = transform('sieve');\nconst SortItems = transform('sortitems');\nconst ViewLayout = transform('viewlayout');\nconst Values = transform('values');\n\nlet FIELD_REF_ID = 0;\nconst MULTIDOMAIN_SORT_OPS = {\n min: 'min',\n max: 'max',\n count: 'sum'\n};\nfunction initScale(spec, scope) {\n const type = spec.type || 'linear';\n if (!isValidScaleType(type)) {\n error('Unrecognized scale type: ' + stringValue(type));\n }\n scope.addScale(spec.name, {\n type,\n domain: undefined\n });\n}\nfunction parseScale(spec, scope) {\n const params = scope.getScale(spec.name).params;\n let key;\n params.domain = parseScaleDomain(spec.domain, spec, scope);\n if (spec.range != null) {\n params.range = parseScaleRange(spec, scope, params);\n }\n if (spec.interpolate != null) {\n parseScaleInterpolate(spec.interpolate, params);\n }\n if (spec.nice != null) {\n params.nice = parseScaleNice(spec.nice);\n }\n if (spec.bins != null) {\n params.bins = parseScaleBins(spec.bins, scope);\n }\n for (key in spec) {\n if (hasOwnProperty(params, key) || key === 'name') continue;\n params[key] = parseLiteral(spec[key], scope);\n }\n}\nfunction parseLiteral(v, scope) {\n return !isObject(v) ? v : v.signal ? scope.signalRef(v.signal) : error('Unsupported object: ' + stringValue(v));\n}\nfunction parseArray(v, scope) {\n return v.signal ? scope.signalRef(v.signal) : v.map(v => parseLiteral(v, scope));\n}\nfunction dataLookupError(name) {\n error('Can not find data set: ' + stringValue(name));\n}\n\n// -- SCALE DOMAIN ----\n\nfunction parseScaleDomain(domain, spec, scope) {\n if (!domain) {\n if (spec.domainMin != null || spec.domainMax != null) {\n error('No scale domain defined for domainMin/domainMax to override.');\n }\n return; // default domain\n }\n\n return domain.signal ? scope.signalRef(domain.signal) : (isArray(domain) ? explicitDomain : domain.fields ? multipleDomain : singularDomain)(domain, spec, scope);\n}\nfunction explicitDomain(domain, spec, scope) {\n return domain.map(v => parseLiteral(v, scope));\n}\nfunction singularDomain(domain, spec, scope) {\n const data = scope.getData(domain.data);\n if (!data) dataLookupError(domain.data);\n return isDiscrete(spec.type) ? data.valuesRef(scope, domain.field, parseSort(domain.sort, false)) : isQuantile(spec.type) ? data.domainRef(scope, domain.field) : data.extentRef(scope, domain.field);\n}\nfunction multipleDomain(domain, spec, scope) {\n const data = domain.data,\n fields = domain.fields.reduce((dom, d) => {\n d = isString(d) ? {\n data: data,\n field: d\n } : isArray(d) || d.signal ? fieldRef(d, scope) : d;\n dom.push(d);\n return dom;\n }, []);\n return (isDiscrete(spec.type) ? ordinalMultipleDomain : isQuantile(spec.type) ? quantileMultipleDomain : numericMultipleDomain)(domain, scope, fields);\n}\nfunction fieldRef(data, scope) {\n const name = '_:vega:_' + FIELD_REF_ID++,\n coll = Collect({});\n if (isArray(data)) {\n coll.value = {\n $ingest: data\n };\n } else if (data.signal) {\n const code = 'setdata(' + stringValue(name) + ',' + data.signal + ')';\n coll.params.input = scope.signalRef(code);\n }\n scope.addDataPipeline(name, [coll, Sieve({})]);\n return {\n data: name,\n field: 'data'\n };\n}\nfunction ordinalMultipleDomain(domain, scope, fields) {\n const sort = parseSort(domain.sort, true);\n let a, v;\n\n // get value counts for each domain field\n const counts = fields.map(f => {\n const data = scope.getData(f.data);\n if (!data) dataLookupError(f.data);\n return data.countsRef(scope, f.field, sort);\n });\n\n // aggregate the results from each domain field\n const p = {\n groupby: keyFieldRef,\n pulse: counts\n };\n if (sort) {\n a = sort.op || 'count';\n v = sort.field ? aggrField(a, sort.field) : 'count';\n p.ops = [MULTIDOMAIN_SORT_OPS[a]];\n p.fields = [scope.fieldRef(v)];\n p.as = [v];\n }\n a = scope.add(Aggregate(p));\n\n // collect aggregate output\n const c = scope.add(Collect({\n pulse: ref(a)\n }));\n\n // extract values for combined domain\n v = scope.add(Values({\n field: keyFieldRef,\n sort: scope.sortRef(sort),\n pulse: ref(c)\n }));\n return ref(v);\n}\nfunction parseSort(sort, multidomain) {\n if (sort) {\n if (!sort.field && !sort.op) {\n if (isObject(sort)) sort.field = 'key';else sort = {\n field: 'key'\n };\n } else if (!sort.field && sort.op !== 'count') {\n error('No field provided for sort aggregate op: ' + sort.op);\n } else if (multidomain && sort.field) {\n if (sort.op && !MULTIDOMAIN_SORT_OPS[sort.op]) {\n error('Multiple domain scales can not be sorted using ' + sort.op);\n }\n }\n }\n return sort;\n}\nfunction quantileMultipleDomain(domain, scope, fields) {\n // get value arrays for each domain field\n const values = fields.map(f => {\n const data = scope.getData(f.data);\n if (!data) dataLookupError(f.data);\n return data.domainRef(scope, f.field);\n });\n\n // combine value arrays\n return ref(scope.add(MultiValues({\n values: values\n })));\n}\nfunction numericMultipleDomain(domain, scope, fields) {\n // get extents for each domain field\n const extents = fields.map(f => {\n const data = scope.getData(f.data);\n if (!data) dataLookupError(f.data);\n return data.extentRef(scope, f.field);\n });\n\n // combine extents\n return ref(scope.add(MultiExtent({\n extents: extents\n })));\n}\n\n// -- SCALE BINS -----\n\nfunction parseScaleBins(v, scope) {\n return v.signal || isArray(v) ? parseArray(v, scope) : scope.objectProperty(v);\n}\n\n// -- SCALE NICE -----\n\nfunction parseScaleNice(nice) {\n return isObject(nice) ? {\n interval: parseLiteral(nice.interval),\n step: parseLiteral(nice.step)\n } : parseLiteral(nice);\n}\n\n// -- SCALE INTERPOLATION -----\n\nfunction parseScaleInterpolate(interpolate, params) {\n params.interpolate = parseLiteral(interpolate.type || interpolate);\n if (interpolate.gamma != null) {\n params.interpolateGamma = parseLiteral(interpolate.gamma);\n }\n}\n\n// -- SCALE RANGE -----\n\nfunction parseScaleRange(spec, scope, params) {\n const config = scope.config.range;\n let range = spec.range;\n if (range.signal) {\n return scope.signalRef(range.signal);\n } else if (isString(range)) {\n if (config && hasOwnProperty(config, range)) {\n spec = extend({}, spec, {\n range: config[range]\n });\n return parseScaleRange(spec, scope, params);\n } else if (range === 'width') {\n range = [0, {\n signal: 'width'\n }];\n } else if (range === 'height') {\n range = isDiscrete(spec.type) ? [0, {\n signal: 'height'\n }] : [{\n signal: 'height'\n }, 0];\n } else {\n error('Unrecognized scale range value: ' + stringValue(range));\n }\n } else if (range.scheme) {\n params.scheme = isArray(range.scheme) ? parseArray(range.scheme, scope) : parseLiteral(range.scheme, scope);\n if (range.extent) params.schemeExtent = parseArray(range.extent, scope);\n if (range.count) params.schemeCount = parseLiteral(range.count, scope);\n return;\n } else if (range.step) {\n params.rangeStep = parseLiteral(range.step, scope);\n return;\n } else if (isDiscrete(spec.type) && !isArray(range)) {\n return parseScaleDomain(range, spec, scope);\n } else if (!isArray(range)) {\n error('Unsupported range type: ' + stringValue(range));\n }\n return range.map(v => (isArray(v) ? parseArray : parseLiteral)(v, scope));\n}\n\nfunction parseProjection (proj, scope) {\n const config = scope.config.projection || {},\n params = {};\n for (const name in proj) {\n if (name === 'name') continue;\n params[name] = parseParameter$1(proj[name], name, scope);\n }\n\n // apply projection defaults from config\n for (const name in config) {\n if (params[name] == null) {\n params[name] = parseParameter$1(config[name], name, scope);\n }\n }\n scope.addProjection(proj.name, params);\n}\nfunction parseParameter$1(_, name, scope) {\n return isArray(_) ? _.map(_ => parseParameter$1(_, name, scope)) : !isObject(_) ? _ : _.signal ? scope.signalRef(_.signal) : name === 'fit' ? _ : error('Unsupported parameter object: ' + stringValue(_));\n}\n\nconst Top = 'top';\nconst Left = 'left';\nconst Right = 'right';\nconst Bottom = 'bottom';\nconst Center = 'center';\nconst Vertical = 'vertical';\nconst Start = 'start';\nconst Middle = 'middle';\nconst End = 'end';\nconst Index = 'index';\nconst Label = 'label';\nconst Offset = 'offset';\nconst Perc = 'perc';\nconst Perc2 = 'perc2';\nconst Value = 'value';\nconst GuideLabelStyle = 'guide-label';\nconst GuideTitleStyle = 'guide-title';\nconst GroupTitleStyle = 'group-title';\nconst GroupSubtitleStyle = 'group-subtitle';\nconst Symbols = 'symbol';\nconst Gradient = 'gradient';\nconst Discrete = 'discrete';\nconst Size = 'size';\nconst Shape = 'shape';\nconst Fill = 'fill';\nconst Stroke = 'stroke';\nconst StrokeWidth = 'strokeWidth';\nconst StrokeDash = 'strokeDash';\nconst Opacity = 'opacity';\n\n// Encoding channels supported by legends\n// In priority order of 'canonical' scale\nconst LegendScales = [Size, Shape, Fill, Stroke, StrokeWidth, StrokeDash, Opacity];\nconst Skip = {\n name: 1,\n style: 1,\n interactive: 1\n};\nconst zero = {\n value: 0\n};\nconst one = {\n value: 1\n};\n\nconst GroupMark = 'group';\nconst RectMark = 'rect';\nconst RuleMark = 'rule';\nconst SymbolMark = 'symbol';\nconst TextMark = 'text';\n\nfunction guideGroup (mark) {\n mark.type = GroupMark;\n mark.interactive = mark.interactive || false;\n return mark;\n}\n\nfunction lookup(spec, config) {\n const _ = (name, dflt) => value(spec[name], value(config[name], dflt));\n _.isVertical = s => Vertical === value(spec.direction, config.direction || (s ? config.symbolDirection : config.gradientDirection));\n _.gradientLength = () => value(spec.gradientLength, config.gradientLength || config.gradientWidth);\n _.gradientThickness = () => value(spec.gradientThickness, config.gradientThickness || config.gradientHeight);\n _.entryColumns = () => value(spec.columns, value(config.columns, +_.isVertical(true)));\n return _;\n}\nfunction getEncoding(name, encode) {\n const v = encode && (encode.update && encode.update[name] || encode.enter && encode.enter[name]);\n return v && v.signal ? v : v ? v.value : null;\n}\nfunction getStyle(name, scope, style) {\n const s = scope.config.style[style];\n return s && s[name];\n}\nfunction anchorExpr(s, e, m) {\n return `item.anchor === '${Start}' ? ${s} : item.anchor === '${End}' ? ${e} : ${m}`;\n}\nconst alignExpr$1 = anchorExpr(stringValue(Left), stringValue(Right), stringValue(Center));\nfunction tickBand(_) {\n const v = _('tickBand');\n let offset = _('tickOffset'),\n band,\n extra;\n if (!v) {\n // if no tick band entry, fall back on other properties\n band = _('bandPosition');\n extra = _('tickExtra');\n } else if (v.signal) {\n // if signal, augment code to interpret values\n band = {\n signal: `(${v.signal}) === 'extent' ? 1 : 0.5`\n };\n extra = {\n signal: `(${v.signal}) === 'extent'`\n };\n if (!isObject(offset)) {\n offset = {\n signal: `(${v.signal}) === 'extent' ? 0 : ${offset}`\n };\n }\n } else if (v === 'extent') {\n // if constant, simply set values\n band = 1;\n extra = true;\n offset = 0;\n } else {\n band = 0.5;\n extra = false;\n }\n return {\n extra,\n band,\n offset\n };\n}\nfunction extendOffset(value, offset) {\n return !offset ? value : !value ? offset : !isObject(value) ? {\n value,\n offset\n } : Object.assign({}, value, {\n offset: extendOffset(value.offset, offset)\n });\n}\n\nfunction guideMark (mark, extras) {\n if (extras) {\n mark.name = extras.name;\n mark.style = extras.style || mark.style;\n mark.interactive = !!extras.interactive;\n mark.encode = extendEncode(mark.encode, extras, Skip);\n } else {\n mark.interactive = false;\n }\n return mark;\n}\n\nfunction legendGradient (spec, scale, config, userEncode) {\n const _ = lookup(spec, config),\n vertical = _.isVertical(),\n thickness = _.gradientThickness(),\n length = _.gradientLength();\n let enter, start, stop, width, height;\n if (vertical) {\n start = [0, 1];\n stop = [0, 0];\n width = thickness;\n height = length;\n } else {\n start = [0, 0];\n stop = [1, 0];\n width = length;\n height = thickness;\n }\n const encode = {\n enter: enter = {\n opacity: zero,\n x: zero,\n y: zero,\n width: encoder(width),\n height: encoder(height)\n },\n update: extend({}, enter, {\n opacity: one,\n fill: {\n gradient: scale,\n start: start,\n stop: stop\n }\n }),\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('gradientStrokeColor'),\n strokeWidth: _('gradientStrokeWidth')\n }, {\n // update\n opacity: _('gradientOpacity')\n });\n return guideMark({\n type: RectMark,\n role: LegendGradientRole,\n encode\n }, userEncode);\n}\n\nfunction legendGradientDiscrete (spec, scale, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n vertical = _.isVertical(),\n thickness = _.gradientThickness(),\n length = _.gradientLength();\n let u,\n v,\n uu,\n vv,\n adjust = '';\n vertical ? (u = 'y', uu = 'y2', v = 'x', vv = 'width', adjust = '1-') : (u = 'x', uu = 'x2', v = 'y', vv = 'height');\n const enter = {\n opacity: zero,\n fill: {\n scale: scale,\n field: Value\n }\n };\n enter[u] = {\n signal: adjust + 'datum.' + Perc,\n mult: length\n };\n enter[v] = zero;\n enter[uu] = {\n signal: adjust + 'datum.' + Perc2,\n mult: length\n };\n enter[vv] = encoder(thickness);\n const encode = {\n enter: enter,\n update: extend({}, enter, {\n opacity: one\n }),\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('gradientStrokeColor'),\n strokeWidth: _('gradientStrokeWidth')\n }, {\n // update\n opacity: _('gradientOpacity')\n });\n return guideMark({\n type: RectMark,\n role: LegendBandRole,\n key: Value,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nconst alignExpr = `datum.${Perc}<=0?\"${Left}\":datum.${Perc}>=1?\"${Right}\":\"${Center}\"`,\n baselineExpr = `datum.${Perc}<=0?\"${Bottom}\":datum.${Perc}>=1?\"${Top}\":\"${Middle}\"`;\nfunction legendGradientLabels (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n vertical = _.isVertical(),\n thickness = encoder(_.gradientThickness()),\n length = _.gradientLength();\n let overlap = _('labelOverlap'),\n enter,\n update,\n u,\n v,\n adjust = '';\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one,\n text: {\n field: Label\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n fill: _('labelColor'),\n fillOpacity: _('labelOpacity'),\n font: _('labelFont'),\n fontSize: _('labelFontSize'),\n fontStyle: _('labelFontStyle'),\n fontWeight: _('labelFontWeight'),\n limit: value(spec.labelLimit, config.gradientLabelLimit)\n });\n if (vertical) {\n enter.align = {\n value: 'left'\n };\n enter.baseline = update.baseline = {\n signal: baselineExpr\n };\n u = 'y';\n v = 'x';\n adjust = '1-';\n } else {\n enter.align = update.align = {\n signal: alignExpr\n };\n enter.baseline = {\n value: 'top'\n };\n u = 'x';\n v = 'y';\n }\n enter[u] = update[u] = {\n signal: adjust + 'datum.' + Perc,\n mult: length\n };\n enter[v] = update[v] = thickness;\n thickness.offset = value(spec.labelOffset, config.gradientLabelOffset) || 0;\n overlap = overlap ? {\n separation: _('labelSeparation'),\n method: overlap,\n order: 'datum.' + Index\n } : undefined;\n\n // type, role, style, key, dataRef, encode, extras\n return guideMark({\n type: TextMark,\n role: LegendLabelRole,\n style: GuideLabelStyle,\n key: Value,\n from: dataRef,\n encode,\n overlap\n }, userEncode);\n}\n\n// userEncode is top-level, includes entries, symbols, labels\nfunction legendSymbolGroups (spec, config, userEncode, dataRef, columns) {\n const _ = lookup(spec, config),\n entries = userEncode.entries,\n interactive = !!(entries && entries.interactive),\n name = entries ? entries.name : undefined,\n height = _('clipHeight'),\n symbolOffset = _('symbolOffset'),\n valueRef = {\n data: 'value'\n },\n xSignal = `(${columns}) ? datum.${Offset} : datum.${Size}`,\n yEncode = height ? encoder(height) : {\n field: Size\n },\n index = `datum.${Index}`,\n ncols = `max(1, ${columns})`;\n let encode, enter, update, nrows, sort;\n yEncode.mult = 0.5;\n\n // -- LEGEND SYMBOLS --\n encode = {\n enter: enter = {\n opacity: zero,\n x: {\n signal: xSignal,\n mult: 0.5,\n offset: symbolOffset\n },\n y: yEncode\n },\n update: update = {\n opacity: one,\n x: enter.x,\n y: enter.y\n },\n exit: {\n opacity: zero\n }\n };\n let baseFill = null,\n baseStroke = null;\n if (!spec.fill) {\n baseFill = config.symbolBaseFillColor;\n baseStroke = config.symbolBaseStrokeColor;\n }\n addEncoders(encode, {\n fill: _('symbolFillColor', baseFill),\n shape: _('symbolType'),\n size: _('symbolSize'),\n stroke: _('symbolStrokeColor', baseStroke),\n strokeDash: _('symbolDash'),\n strokeDashOffset: _('symbolDashOffset'),\n strokeWidth: _('symbolStrokeWidth')\n }, {\n // update\n opacity: _('symbolOpacity')\n });\n LegendScales.forEach(scale => {\n if (spec[scale]) {\n update[scale] = enter[scale] = {\n scale: spec[scale],\n field: Value\n };\n }\n });\n const symbols = guideMark({\n type: SymbolMark,\n role: LegendSymbolRole,\n key: Value,\n from: valueRef,\n clip: height ? true : undefined,\n encode\n }, userEncode.symbols);\n\n // -- LEGEND LABELS --\n const labelOffset = encoder(symbolOffset);\n labelOffset.offset = _('labelOffset');\n encode = {\n enter: enter = {\n opacity: zero,\n x: {\n signal: xSignal,\n offset: labelOffset\n },\n y: yEncode\n },\n update: update = {\n opacity: one,\n text: {\n field: Label\n },\n x: enter.x,\n y: enter.y\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n align: _('labelAlign'),\n baseline: _('labelBaseline'),\n fill: _('labelColor'),\n fillOpacity: _('labelOpacity'),\n font: _('labelFont'),\n fontSize: _('labelFontSize'),\n fontStyle: _('labelFontStyle'),\n fontWeight: _('labelFontWeight'),\n limit: _('labelLimit')\n });\n const labels = guideMark({\n type: TextMark,\n role: LegendLabelRole,\n style: GuideLabelStyle,\n key: Value,\n from: valueRef,\n encode\n }, userEncode.labels);\n\n // -- LEGEND ENTRY GROUPS --\n encode = {\n enter: {\n noBound: {\n value: !height\n },\n // ignore width/height in bounds calc\n width: zero,\n height: height ? encoder(height) : zero,\n opacity: zero\n },\n exit: {\n opacity: zero\n },\n update: update = {\n opacity: one,\n row: {\n signal: null\n },\n column: {\n signal: null\n }\n }\n };\n\n // annotate and sort groups to ensure correct ordering\n if (_.isVertical(true)) {\n nrows = `ceil(item.mark.items.length / ${ncols})`;\n update.row.signal = `${index}%${nrows}`;\n update.column.signal = `floor(${index} / ${nrows})`;\n sort = {\n field: ['row', index]\n };\n } else {\n update.row.signal = `floor(${index} / ${ncols})`;\n update.column.signal = `${index} % ${ncols}`;\n sort = {\n field: index\n };\n }\n // handle zero column case (implies infinite columns)\n update.column.signal = `(${columns})?${update.column.signal}:${index}`;\n\n // facet legend entries into sub-groups\n dataRef = {\n facet: {\n data: dataRef,\n name: 'value',\n groupby: Index\n }\n };\n return guideGroup({\n role: ScopeRole,\n from: dataRef,\n encode: extendEncode(encode, entries, Skip),\n marks: [symbols, labels],\n name,\n interactive,\n sort\n });\n}\nfunction legendSymbolLayout(spec, config) {\n const _ = lookup(spec, config);\n\n // layout parameters for legend entries\n return {\n align: _('gridAlign'),\n columns: _.entryColumns(),\n center: {\n row: true,\n column: false\n },\n padding: {\n row: _('rowPadding'),\n column: _('columnPadding')\n }\n };\n}\n\n// expression logic for align, anchor, angle, and baseline calculation\nconst isL = 'item.orient === \"left\"',\n isR = 'item.orient === \"right\"',\n isLR = `(${isL} || ${isR})`,\n isVG = `datum.vgrad && ${isLR}`,\n baseline = anchorExpr('\"top\"', '\"bottom\"', '\"middle\"'),\n alignFlip = anchorExpr('\"right\"', '\"left\"', '\"center\"'),\n exprAlign = `datum.vgrad && ${isR} ? (${alignFlip}) : (${isLR} && !(datum.vgrad && ${isL})) ? \"left\" : ${alignExpr$1}`,\n exprAnchor = `item._anchor || (${isLR} ? \"middle\" : \"start\")`,\n exprAngle = `${isVG} ? (${isL} ? -90 : 90) : 0`,\n exprBaseline = `${isLR} ? (datum.vgrad ? (${isR} ? \"bottom\" : \"top\") : ${baseline}) : \"top\"`;\nfunction legendTitle (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config);\n const encode = {\n enter: {\n opacity: zero\n },\n update: {\n opacity: one,\n x: {\n field: {\n group: 'padding'\n }\n },\n y: {\n field: {\n group: 'padding'\n }\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n orient: _('titleOrient'),\n _anchor: _('titleAnchor'),\n anchor: {\n signal: exprAnchor\n },\n angle: {\n signal: exprAngle\n },\n align: {\n signal: exprAlign\n },\n baseline: {\n signal: exprBaseline\n },\n text: spec.title,\n fill: _('titleColor'),\n fillOpacity: _('titleOpacity'),\n font: _('titleFont'),\n fontSize: _('titleFontSize'),\n fontStyle: _('titleFontStyle'),\n fontWeight: _('titleFontWeight'),\n limit: _('titleLimit'),\n lineHeight: _('titleLineHeight')\n }, {\n // require update\n align: _('titleAlign'),\n baseline: _('titleBaseline')\n });\n return guideMark({\n type: TextMark,\n role: LegendTitleRole,\n style: GuideTitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction clip (clip, scope) {\n let expr;\n if (isObject(clip)) {\n if (clip.signal) {\n expr = clip.signal;\n } else if (clip.path) {\n expr = 'pathShape(' + param(clip.path) + ')';\n } else if (clip.sphere) {\n expr = 'geoShape(' + param(clip.sphere) + ', {type: \"Sphere\"})';\n }\n }\n return expr ? scope.signalRef(expr) : !!clip;\n}\nfunction param(value) {\n return isObject(value) && value.signal ? value.signal : stringValue(value);\n}\n\nfunction getRole (spec) {\n const role = spec.role || '';\n return !role.indexOf('axis') || !role.indexOf('legend') || !role.indexOf('title') ? role : spec.type === GroupMark ? ScopeRole : role || MarkRole;\n}\n\nfunction definition (spec) {\n return {\n marktype: spec.type,\n name: spec.name || undefined,\n role: spec.role || getRole(spec),\n zindex: +spec.zindex || undefined,\n aria: spec.aria,\n description: spec.description\n };\n}\n\nfunction interactive (spec, scope) {\n return spec && spec.signal ? scope.signalRef(spec.signal) : spec === false ? false : true;\n}\n\n/**\n * Parse a data transform specification.\n */\nfunction parseTransform (spec, scope) {\n const def = definition$1(spec.type);\n if (!def) error('Unrecognized transform type: ' + stringValue(spec.type));\n const t = entry(def.type.toLowerCase(), null, parseParameters(def, spec, scope));\n if (spec.signal) scope.addSignal(spec.signal, scope.proxy(t));\n t.metadata = def.metadata || {};\n return t;\n}\n\n/**\n * Parse all parameters of a data transform.\n */\nfunction parseParameters(def, spec, scope) {\n const params = {},\n n = def.params.length;\n for (let i = 0; i < n; ++i) {\n const pdef = def.params[i];\n params[pdef.name] = parseParameter(pdef, spec, scope);\n }\n return params;\n}\n\n/**\n * Parse a data transform parameter.\n */\nfunction parseParameter(def, spec, scope) {\n const type = def.type,\n value = spec[def.name];\n if (type === 'index') {\n return parseIndexParameter(def, spec, scope);\n } else if (value === undefined) {\n if (def.required) {\n error('Missing required ' + stringValue(spec.type) + ' parameter: ' + stringValue(def.name));\n }\n return;\n } else if (type === 'param') {\n return parseSubParameters(def, spec, scope);\n } else if (type === 'projection') {\n return scope.projectionRef(spec[def.name]);\n }\n return def.array && !isSignal(value) ? value.map(v => parameterValue(def, v, scope)) : parameterValue(def, value, scope);\n}\n\n/**\n * Parse a single parameter value.\n */\nfunction parameterValue(def, value, scope) {\n const type = def.type;\n if (isSignal(value)) {\n return isExpr(type) ? error('Expression references can not be signals.') : isField(type) ? scope.fieldRef(value) : isCompare(type) ? scope.compareRef(value) : scope.signalRef(value.signal);\n } else {\n const expr = def.expr || isField(type);\n return expr && outerExpr(value) ? scope.exprRef(value.expr, value.as) : expr && outerField(value) ? fieldRef$1(value.field, value.as) : isExpr(type) ? parseExpression(value, scope) : isData(type) ? ref(scope.getData(value).values) : isField(type) ? fieldRef$1(value) : isCompare(type) ? scope.compareRef(value) : value;\n }\n}\n\n/**\n * Parse parameter for accessing an index of another data set.\n */\nfunction parseIndexParameter(def, spec, scope) {\n if (!isString(spec.from)) {\n error('Lookup \"from\" parameter must be a string literal.');\n }\n return scope.getData(spec.from).lookupRef(scope, spec.key);\n}\n\n/**\n * Parse a parameter that contains one or more sub-parameter objects.\n */\nfunction parseSubParameters(def, spec, scope) {\n const value = spec[def.name];\n if (def.array) {\n if (!isArray(value)) {\n // signals not allowed!\n error('Expected an array of sub-parameters. Instead: ' + stringValue(value));\n }\n return value.map(v => parseSubParameter(def, v, scope));\n } else {\n return parseSubParameter(def, value, scope);\n }\n}\n\n/**\n * Parse a sub-parameter object.\n */\nfunction parseSubParameter(def, value, scope) {\n const n = def.params.length;\n let pdef;\n\n // loop over defs to find matching key\n for (let i = 0; i < n; ++i) {\n pdef = def.params[i];\n for (const k in pdef.key) {\n if (pdef.key[k] !== value[k]) {\n pdef = null;\n break;\n }\n }\n if (pdef) break;\n }\n // raise error if matching key not found\n if (!pdef) error('Unsupported parameter: ' + stringValue(value));\n\n // parse params, create Params transform, return ref\n const params = extend(parseParameters(pdef, value, scope), pdef.key);\n return ref(scope.add(Params(params)));\n}\n\n// -- Utilities -----\n\nconst outerExpr = _ => _ && _.expr;\nconst outerField = _ => _ && _.field;\nconst isData = _ => _ === 'data';\nconst isExpr = _ => _ === 'expr';\nconst isField = _ => _ === 'field';\nconst isCompare = _ => _ === 'compare';\n\nfunction parseData$1 (from, group, scope) {\n let facet, key, op, dataRef, parent;\n\n // if no source data, generate singleton datum\n if (!from) {\n dataRef = ref(scope.add(Collect(null, [{}])));\n }\n\n // if faceted, process facet specification\n else if (facet = from.facet) {\n if (!group) error('Only group marks can be faceted.');\n\n // use pre-faceted source data, if available\n if (facet.field != null) {\n dataRef = parent = getDataRef(facet, scope);\n } else {\n // generate facet aggregates if no direct data specification\n if (!from.data) {\n op = parseTransform(extend({\n type: 'aggregate',\n groupby: array(facet.groupby)\n }, facet.aggregate), scope);\n op.params.key = scope.keyRef(facet.groupby);\n op.params.pulse = getDataRef(facet, scope);\n dataRef = parent = ref(scope.add(op));\n } else {\n parent = ref(scope.getData(from.data).aggregate);\n }\n key = scope.keyRef(facet.groupby, true);\n }\n }\n\n // if not yet defined, get source data reference\n if (!dataRef) {\n dataRef = getDataRef(from, scope);\n }\n return {\n key: key,\n pulse: dataRef,\n parent: parent\n };\n}\nfunction getDataRef(from, scope) {\n return from.$ref ? from : from.data && from.data.$ref ? from.data : ref(scope.getData(from.data).output);\n}\n\nfunction DataScope(scope, input, output, values, aggr) {\n this.scope = scope; // parent scope object\n this.input = input; // first operator in pipeline (tuple input)\n this.output = output; // last operator in pipeline (tuple output)\n this.values = values; // operator for accessing tuples (but not tuple flow)\n\n // last aggregate in transform pipeline\n this.aggregate = aggr;\n\n // lookup table of field indices\n this.index = {};\n}\nDataScope.fromEntries = function (scope, entries) {\n const n = entries.length,\n values = entries[n - 1],\n output = entries[n - 2];\n let input = entries[0],\n aggr = null,\n i = 1;\n if (input && input.type === 'load') {\n input = entries[1];\n }\n\n // add operator entries to this scope, wire up pulse chain\n scope.add(entries[0]);\n for (; i < n; ++i) {\n entries[i].params.pulse = ref(entries[i - 1]);\n scope.add(entries[i]);\n if (entries[i].type === 'aggregate') aggr = entries[i];\n }\n return new DataScope(scope, input, output, values, aggr);\n};\nfunction fieldKey(field) {\n return isString(field) ? field : null;\n}\nfunction addSortField(scope, p, sort) {\n const as = aggrField(sort.op, sort.field);\n let s;\n if (p.ops) {\n for (let i = 0, n = p.as.length; i < n; ++i) {\n if (p.as[i] === as) return;\n }\n } else {\n p.ops = ['count'];\n p.fields = [null];\n p.as = ['count'];\n }\n if (sort.op) {\n p.ops.push((s = sort.op.signal) ? scope.signalRef(s) : sort.op);\n p.fields.push(scope.fieldRef(sort.field));\n p.as.push(as);\n }\n}\nfunction cache(scope, ds, name, optype, field, counts, index) {\n const cache = ds[name] || (ds[name] = {}),\n sort = sortKey(counts);\n let k = fieldKey(field),\n v,\n op;\n if (k != null) {\n scope = ds.scope;\n k = k + (sort ? '|' + sort : '');\n v = cache[k];\n }\n if (!v) {\n const params = counts ? {\n field: keyFieldRef,\n pulse: ds.countsRef(scope, field, counts)\n } : {\n field: scope.fieldRef(field),\n pulse: ref(ds.output)\n };\n if (sort) params.sort = scope.sortRef(counts);\n op = scope.add(entry(optype, undefined, params));\n if (index) ds.index[field] = op;\n v = ref(op);\n if (k != null) cache[k] = v;\n }\n return v;\n}\nDataScope.prototype = {\n countsRef(scope, field, sort) {\n const ds = this,\n cache = ds.counts || (ds.counts = {}),\n k = fieldKey(field);\n let v, a, p;\n if (k != null) {\n scope = ds.scope;\n v = cache[k];\n }\n if (!v) {\n p = {\n groupby: scope.fieldRef(field, 'key'),\n pulse: ref(ds.output)\n };\n if (sort && sort.field) addSortField(scope, p, sort);\n a = scope.add(Aggregate(p));\n v = scope.add(Collect({\n pulse: ref(a)\n }));\n v = {\n agg: a,\n ref: ref(v)\n };\n if (k != null) cache[k] = v;\n } else if (sort && sort.field) {\n addSortField(scope, v.agg.params, sort);\n }\n return v.ref;\n },\n tuplesRef() {\n return ref(this.values);\n },\n extentRef(scope, field) {\n return cache(scope, this, 'extent', 'extent', field, false);\n },\n domainRef(scope, field) {\n return cache(scope, this, 'domain', 'values', field, false);\n },\n valuesRef(scope, field, sort) {\n return cache(scope, this, 'vals', 'values', field, sort || true);\n },\n lookupRef(scope, field) {\n return cache(scope, this, 'lookup', 'tupleindex', field, false);\n },\n indataRef(scope, field) {\n return cache(scope, this, 'indata', 'tupleindex', field, true, true);\n }\n};\n\nfunction parseFacet (spec, scope, group) {\n const facet = spec.from.facet,\n name = facet.name,\n data = getDataRef(facet, scope);\n let op;\n if (!facet.name) {\n error('Facet must have a name: ' + stringValue(facet));\n }\n if (!facet.data) {\n error('Facet must reference a data set: ' + stringValue(facet));\n }\n if (facet.field) {\n op = scope.add(PreFacet({\n field: scope.fieldRef(facet.field),\n pulse: data\n }));\n } else if (facet.groupby) {\n op = scope.add(Facet({\n key: scope.keyRef(facet.groupby),\n group: ref(scope.proxy(group.parent)),\n pulse: data\n }));\n } else {\n error('Facet must specify groupby or field: ' + stringValue(facet));\n }\n\n // initialize facet subscope\n const subscope = scope.fork(),\n source = subscope.add(Collect()),\n values = subscope.add(Sieve({\n pulse: ref(source)\n }));\n subscope.addData(name, new DataScope(subscope, source, source, values));\n subscope.addSignal('parent', null);\n\n // parse faceted subflow\n op.params.subflow = {\n $subflow: subscope.parse(spec).toRuntime()\n };\n}\n\nfunction parseSubflow (spec, scope, input) {\n const op = scope.add(PreFacet({\n pulse: input.pulse\n })),\n subscope = scope.fork();\n subscope.add(Sieve());\n subscope.addSignal('parent', null);\n\n // parse group mark subflow\n op.params.subflow = {\n $subflow: subscope.parse(spec).toRuntime()\n };\n}\n\nfunction parseTrigger (spec, scope, name) {\n const remove = spec.remove,\n insert = spec.insert,\n toggle = spec.toggle,\n modify = spec.modify,\n values = spec.values,\n op = scope.add(operator());\n const update = 'if(' + spec.trigger + ',modify(\"' + name + '\",' + [insert, remove, toggle, modify, values].map(_ => _ == null ? 'null' : _).join(',') + '),0)';\n const expr = parseExpression(update, scope);\n op.update = expr.$expr;\n op.params = expr.$params;\n}\n\nfunction parseMark (spec, scope) {\n const role = getRole(spec),\n group = spec.type === GroupMark,\n facet = spec.from && spec.from.facet,\n overlap = spec.overlap;\n let layout = spec.layout || role === ScopeRole || role === FrameRole,\n ops,\n op,\n store,\n enc,\n name,\n layoutRef,\n boundRef;\n const nested = role === MarkRole || layout || facet;\n\n // resolve input data\n const input = parseData$1(spec.from, group, scope);\n\n // data join to map tuples to visual items\n op = scope.add(DataJoin({\n key: input.key || (spec.key ? fieldRef$1(spec.key) : undefined),\n pulse: input.pulse,\n clean: !group\n }));\n const joinRef = ref(op);\n\n // collect visual items\n op = store = scope.add(Collect({\n pulse: joinRef\n }));\n\n // connect visual items to scenegraph\n op = scope.add(Mark({\n markdef: definition(spec),\n interactive: interactive(spec.interactive, scope),\n clip: clip(spec.clip, scope),\n context: {\n $context: true\n },\n groups: scope.lookup(),\n parent: scope.signals.parent ? scope.signalRef('parent') : null,\n index: scope.markpath(),\n pulse: ref(op)\n }));\n const markRef = ref(op);\n\n // add visual encoders\n op = enc = scope.add(Encode(parseEncode(spec.encode, spec.type, role, spec.style, scope, {\n mod: false,\n pulse: markRef\n })));\n\n // monitor parent marks to propagate changes\n op.params.parent = scope.encode();\n\n // add post-encoding transforms, if defined\n if (spec.transform) {\n spec.transform.forEach(_ => {\n const tx = parseTransform(_, scope),\n md = tx.metadata;\n if (md.generates || md.changes) {\n error('Mark transforms should not generate new data.');\n }\n if (!md.nomod) enc.params.mod = true; // update encode mod handling\n tx.params.pulse = ref(op);\n scope.add(op = tx);\n });\n }\n\n // if item sort specified, perform post-encoding\n if (spec.sort) {\n op = scope.add(SortItems({\n sort: scope.compareRef(spec.sort),\n pulse: ref(op)\n }));\n }\n const encodeRef = ref(op);\n\n // add view layout operator if needed\n if (facet || layout) {\n layout = scope.add(ViewLayout({\n layout: scope.objectProperty(spec.layout),\n legends: scope.legends,\n mark: markRef,\n pulse: encodeRef\n }));\n layoutRef = ref(layout);\n }\n\n // compute bounding boxes\n const bound = scope.add(Bound({\n mark: markRef,\n pulse: layoutRef || encodeRef\n }));\n boundRef = ref(bound);\n\n // if group mark, recurse to parse nested content\n if (group) {\n // juggle layout & bounds to ensure they run *after* any faceting transforms\n if (nested) {\n ops = scope.operators;\n ops.pop();\n if (layout) ops.pop();\n }\n scope.pushState(encodeRef, layoutRef || boundRef, joinRef);\n facet ? parseFacet(spec, scope, input) // explicit facet\n : nested ? parseSubflow(spec, scope, input) // standard mark group\n : scope.parse(spec); // guide group, we can avoid nested scopes\n scope.popState();\n if (nested) {\n if (layout) ops.push(layout);\n ops.push(bound);\n }\n }\n\n // if requested, add overlap removal transform\n if (overlap) {\n boundRef = parseOverlap(overlap, boundRef, scope);\n }\n\n // render / sieve items\n const render = scope.add(Render({\n pulse: boundRef\n })),\n sieve = scope.add(Sieve({\n pulse: ref(render)\n }, undefined, scope.parent()));\n\n // if mark is named, make accessible as reactive geometry\n // add trigger updates if defined\n if (spec.name != null) {\n name = spec.name;\n scope.addData(name, new DataScope(scope, store, render, sieve));\n if (spec.on) spec.on.forEach(on => {\n if (on.insert || on.remove || on.toggle) {\n error('Marks only support modify triggers.');\n }\n parseTrigger(on, scope, name);\n });\n }\n}\nfunction parseOverlap(overlap, source, scope) {\n const method = overlap.method,\n bound = overlap.bound,\n sep = overlap.separation;\n const params = {\n separation: isSignal(sep) ? scope.signalRef(sep.signal) : sep,\n method: isSignal(method) ? scope.signalRef(method.signal) : method,\n pulse: source\n };\n if (overlap.order) {\n params.sort = scope.compareRef({\n field: overlap.order\n });\n }\n if (bound) {\n const tol = bound.tolerance;\n params.boundTolerance = isSignal(tol) ? scope.signalRef(tol.signal) : +tol;\n params.boundScale = scope.scaleRef(bound.scale);\n params.boundOrient = bound.orient;\n }\n return ref(scope.add(Overlap(params)));\n}\n\nfunction parseLegend (spec, scope) {\n const config = scope.config.legend,\n encode = spec.encode || {},\n _ = lookup(spec, config),\n legendEncode = encode.legend || {},\n name = legendEncode.name || undefined,\n interactive = legendEncode.interactive,\n style = legendEncode.style,\n scales = {};\n let scale = 0,\n entryLayout,\n params,\n children;\n\n // resolve scales and 'canonical' scale name\n LegendScales.forEach(s => spec[s] ? (scales[s] = spec[s], scale = scale || spec[s]) : 0);\n if (!scale) error('Missing valid scale for legend.');\n\n // resolve legend type (symbol, gradient, or discrete gradient)\n const type = legendType(spec, scope.scaleType(scale));\n\n // single-element data source for legend group\n const datum = {\n title: spec.title != null,\n scales: scales,\n type: type,\n vgrad: type !== 'symbol' && _.isVertical()\n };\n const dataRef = ref(scope.add(Collect(null, [datum])));\n\n // encoding properties for legend entry sub-group\n const entryEncode = {\n enter: {\n x: {\n value: 0\n },\n y: {\n value: 0\n }\n }\n };\n\n // data source for legend values\n const entryRef = ref(scope.add(LegendEntries(params = {\n type: type,\n scale: scope.scaleRef(scale),\n count: scope.objectProperty(_('tickCount')),\n limit: scope.property(_('symbolLimit')),\n values: scope.objectProperty(spec.values),\n minstep: scope.property(spec.tickMinStep),\n formatType: scope.property(spec.formatType),\n formatSpecifier: scope.property(spec.format)\n })));\n\n // continuous gradient legend\n if (type === Gradient) {\n children = [legendGradient(spec, scale, config, encode.gradient), legendGradientLabels(spec, config, encode.labels, entryRef)];\n // adjust default tick count based on the gradient length\n params.count = params.count || scope.signalRef(`max(2,2*floor((${deref(_.gradientLength())})/100))`);\n }\n\n // discrete gradient legend\n else if (type === Discrete) {\n children = [legendGradientDiscrete(spec, scale, config, encode.gradient, entryRef), legendGradientLabels(spec, config, encode.labels, entryRef)];\n }\n\n // symbol legend\n else {\n // determine legend symbol group layout\n entryLayout = legendSymbolLayout(spec, config);\n children = [legendSymbolGroups(spec, config, encode, entryRef, deref(entryLayout.columns))];\n // pass symbol size information to legend entry generator\n params.size = sizeExpression(spec, scope, children[0].marks);\n }\n\n // generate legend marks\n children = [guideGroup({\n role: LegendEntryRole,\n from: dataRef,\n encode: entryEncode,\n marks: children,\n layout: entryLayout,\n interactive\n })];\n\n // include legend title if defined\n if (datum.title) {\n children.push(legendTitle(spec, config, encode.title, dataRef));\n }\n\n // parse legend specification\n return parseMark(guideGroup({\n role: LegendRole,\n from: dataRef,\n encode: extendEncode(buildLegendEncode(_, spec, config), legendEncode, Skip),\n marks: children,\n aria: _('aria'),\n description: _('description'),\n zindex: _('zindex'),\n name,\n interactive,\n style\n }), scope);\n}\nfunction legendType(spec, scaleType) {\n let type = spec.type || Symbols;\n if (!spec.type && scaleCount(spec) === 1 && (spec.fill || spec.stroke)) {\n type = isContinuous(scaleType) ? Gradient : isDiscretizing(scaleType) ? Discrete : Symbols;\n }\n return type !== Gradient ? type : isDiscretizing(scaleType) ? Discrete : Gradient;\n}\nfunction scaleCount(spec) {\n return LegendScales.reduce((count, type) => count + (spec[type] ? 1 : 0), 0);\n}\nfunction buildLegendEncode(_, spec, config) {\n const encode = {\n enter: {},\n update: {}\n };\n addEncoders(encode, {\n orient: _('orient'),\n offset: _('offset'),\n padding: _('padding'),\n titlePadding: _('titlePadding'),\n cornerRadius: _('cornerRadius'),\n fill: _('fillColor'),\n stroke: _('strokeColor'),\n strokeWidth: config.strokeWidth,\n strokeDash: config.strokeDash,\n x: _('legendX'),\n y: _('legendY'),\n // accessibility support\n format: spec.format,\n formatType: spec.formatType\n });\n return encode;\n}\nfunction sizeExpression(spec, scope, marks) {\n const size = deref(getChannel('size', spec, marks)),\n strokeWidth = deref(getChannel('strokeWidth', spec, marks)),\n fontSize = deref(getFontSize(marks[1].encode, scope, GuideLabelStyle));\n return parseExpression(`max(ceil(sqrt(${size})+${strokeWidth}),${fontSize})`, scope);\n}\nfunction getChannel(name, spec, marks) {\n return spec[name] ? `scale(\"${spec[name]}\",datum)` : getEncoding(name, marks[0].encode);\n}\nfunction getFontSize(encode, scope, style) {\n return getEncoding('fontSize', encode) || getStyle('fontSize', scope, style);\n}\n\nconst angleExpr = `item.orient===\"${Left}\"?-90:item.orient===\"${Right}\"?90:0`;\nfunction parseTitle (spec, scope) {\n spec = isString(spec) ? {\n text: spec\n } : spec;\n const _ = lookup(spec, scope.config.title),\n encode = spec.encode || {},\n userEncode = encode.group || {},\n name = userEncode.name || undefined,\n interactive = userEncode.interactive,\n style = userEncode.style,\n children = [];\n\n // single-element data source for group title\n const datum = {},\n dataRef = ref(scope.add(Collect(null, [datum])));\n\n // include title text\n children.push(buildTitle(spec, _, titleEncode(spec), dataRef));\n\n // include subtitle text\n if (spec.subtitle) {\n children.push(buildSubTitle(spec, _, encode.subtitle, dataRef));\n }\n\n // parse title specification\n return parseMark(guideGroup({\n role: TitleRole,\n from: dataRef,\n encode: groupEncode(_, userEncode),\n marks: children,\n aria: _('aria'),\n description: _('description'),\n zindex: _('zindex'),\n name,\n interactive,\n style\n }), scope);\n}\n\n// provide backwards-compatibility for title custom encode;\n// the top-level encode block has been *deprecated*.\nfunction titleEncode(spec) {\n const encode = spec.encode;\n return encode && encode.title || extend({\n name: spec.name,\n interactive: spec.interactive,\n style: spec.style\n }, encode);\n}\nfunction groupEncode(_, userEncode) {\n const encode = {\n enter: {},\n update: {}\n };\n addEncoders(encode, {\n orient: _('orient'),\n anchor: _('anchor'),\n align: {\n signal: alignExpr$1\n },\n angle: {\n signal: angleExpr\n },\n limit: _('limit'),\n frame: _('frame'),\n offset: _('offset') || 0,\n padding: _('subtitlePadding')\n });\n return extendEncode(encode, userEncode, Skip);\n}\nfunction buildTitle(spec, _, userEncode, dataRef) {\n const zero = {\n value: 0\n },\n text = spec.text,\n encode = {\n enter: {\n opacity: zero\n },\n update: {\n opacity: {\n value: 1\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n text: text,\n align: {\n signal: 'item.mark.group.align'\n },\n angle: {\n signal: 'item.mark.group.angle'\n },\n limit: {\n signal: 'item.mark.group.limit'\n },\n baseline: 'top',\n dx: _('dx'),\n dy: _('dy'),\n fill: _('color'),\n font: _('font'),\n fontSize: _('fontSize'),\n fontStyle: _('fontStyle'),\n fontWeight: _('fontWeight'),\n lineHeight: _('lineHeight')\n }, {\n // update\n align: _('align'),\n angle: _('angle'),\n baseline: _('baseline')\n });\n return guideMark({\n type: TextMark,\n role: TitleTextRole,\n style: GroupTitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\nfunction buildSubTitle(spec, _, userEncode, dataRef) {\n const zero = {\n value: 0\n },\n text = spec.subtitle,\n encode = {\n enter: {\n opacity: zero\n },\n update: {\n opacity: {\n value: 1\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n text: text,\n align: {\n signal: 'item.mark.group.align'\n },\n angle: {\n signal: 'item.mark.group.angle'\n },\n limit: {\n signal: 'item.mark.group.limit'\n },\n baseline: 'top',\n dx: _('dx'),\n dy: _('dy'),\n fill: _('subtitleColor'),\n font: _('subtitleFont'),\n fontSize: _('subtitleFontSize'),\n fontStyle: _('subtitleFontStyle'),\n fontWeight: _('subtitleFontWeight'),\n lineHeight: _('subtitleLineHeight')\n }, {\n // update\n align: _('align'),\n angle: _('angle'),\n baseline: _('baseline')\n });\n return guideMark({\n type: TextMark,\n role: TitleSubtitleRole,\n style: GroupSubtitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction parseData(data, scope) {\n const transforms = [];\n if (data.transform) {\n data.transform.forEach(tx => {\n transforms.push(parseTransform(tx, scope));\n });\n }\n if (data.on) {\n data.on.forEach(on => {\n parseTrigger(on, scope, data.name);\n });\n }\n scope.addDataPipeline(data.name, analyze(data, scope, transforms));\n}\n\n/**\n * Analyze a data pipeline, add needed operators.\n */\nfunction analyze(data, scope, ops) {\n const output = [];\n let source = null,\n modify = false,\n generate = false,\n upstream,\n i,\n n,\n t,\n m;\n if (data.values) {\n // hard-wired input data set\n if (isSignal(data.values) || hasSignal(data.format)) {\n // if either values is signal or format has signal, use dynamic loader\n output.push(load(scope, data));\n output.push(source = collect());\n } else {\n // otherwise, ingest upon dataflow init\n output.push(source = collect({\n $ingest: data.values,\n $format: data.format\n }));\n }\n } else if (data.url) {\n // load data from external source\n if (hasSignal(data.url) || hasSignal(data.format)) {\n // if either url or format has signal, use dynamic loader\n output.push(load(scope, data));\n output.push(source = collect());\n } else {\n // otherwise, request load upon dataflow init\n output.push(source = collect({\n $request: data.url,\n $format: data.format\n }));\n }\n } else if (data.source) {\n // derives from one or more other data sets\n source = upstream = array(data.source).map(d => ref(scope.getData(d).output));\n output.push(null); // populate later\n }\n\n // scan data transforms, add collectors as needed\n for (i = 0, n = ops.length; i < n; ++i) {\n t = ops[i];\n m = t.metadata;\n if (!source && !m.source) {\n output.push(source = collect());\n }\n output.push(t);\n if (m.generates) generate = true;\n if (m.modifies && !generate) modify = true;\n if (m.source) source = t;else if (m.changes) source = null;\n }\n if (upstream) {\n n = upstream.length - 1;\n output[0] = Relay({\n derive: modify,\n pulse: n ? upstream : upstream[0]\n });\n if (modify || n) {\n // collect derived and multi-pulse tuples\n output.splice(1, 0, collect());\n }\n }\n if (!source) output.push(collect());\n output.push(Sieve({}));\n return output;\n}\nfunction collect(values) {\n const s = Collect({}, values);\n s.metadata = {\n source: true\n };\n return s;\n}\nfunction load(scope, data) {\n return Load({\n url: data.url ? scope.property(data.url) : undefined,\n async: data.async ? scope.property(data.async) : undefined,\n values: data.values ? scope.property(data.values) : undefined,\n format: scope.objectProperty(data.format)\n });\n}\n\nconst isX = orient => orient === Bottom || orient === Top;\n\n// get sign coefficient based on axis orient\nconst getSign = (orient, a, b) => isSignal(orient) ? ifLeftTopExpr(orient.signal, a, b) : orient === Left || orient === Top ? a : b;\n\n// condition on axis x-direction\nconst ifX = (orient, a, b) => isSignal(orient) ? ifXEnc(orient.signal, a, b) : isX(orient) ? a : b;\n\n// condition on axis y-direction\nconst ifY = (orient, a, b) => isSignal(orient) ? ifYEnc(orient.signal, a, b) : isX(orient) ? b : a;\nconst ifTop = (orient, a, b) => isSignal(orient) ? ifTopExpr(orient.signal, a, b) : orient === Top ? {\n value: a\n} : {\n value: b\n};\nconst ifRight = (orient, a, b) => isSignal(orient) ? ifRightExpr(orient.signal, a, b) : orient === Right ? {\n value: a\n} : {\n value: b\n};\nconst ifXEnc = ($orient, a, b) => ifEnc(`${$orient} === '${Top}' || ${$orient} === '${Bottom}'`, a, b);\nconst ifYEnc = ($orient, a, b) => ifEnc(`${$orient} !== '${Top}' && ${$orient} !== '${Bottom}'`, a, b);\nconst ifLeftTopExpr = ($orient, a, b) => ifExpr(`${$orient} === '${Left}' || ${$orient} === '${Top}'`, a, b);\nconst ifTopExpr = ($orient, a, b) => ifExpr(`${$orient} === '${Top}'`, a, b);\nconst ifRightExpr = ($orient, a, b) => ifExpr(`${$orient} === '${Right}'`, a, b);\nconst ifEnc = (test, a, b) => {\n // ensure inputs are encoder objects (or null)\n a = a != null ? encoder(a) : a;\n b = b != null ? encoder(b) : b;\n if (isSimple(a) && isSimple(b)) {\n // if possible generate simple signal expression\n a = a ? a.signal || stringValue(a.value) : null;\n b = b ? b.signal || stringValue(b.value) : null;\n return {\n signal: `${test} ? (${a}) : (${b})`\n };\n } else {\n // otherwise generate rule set\n return [extend({\n test\n }, a)].concat(b || []);\n }\n};\nconst isSimple = enc => enc == null || Object.keys(enc).length === 1;\nconst ifExpr = (test, a, b) => ({\n signal: `${test} ? (${toExpr(a)}) : (${toExpr(b)})`\n});\nconst ifOrient = ($orient, t, b, l, r) => ({\n signal: (l != null ? `${$orient} === '${Left}' ? (${toExpr(l)}) : ` : '') + (b != null ? `${$orient} === '${Bottom}' ? (${toExpr(b)}) : ` : '') + (r != null ? `${$orient} === '${Right}' ? (${toExpr(r)}) : ` : '') + (t != null ? `${$orient} === '${Top}' ? (${toExpr(t)}) : ` : '') + '(null)'\n});\nconst toExpr = v => isSignal(v) ? v.signal : v == null ? null : stringValue(v);\nconst mult = (sign, value) => value === 0 ? 0 : isSignal(sign) ? {\n signal: `(${sign.signal}) * ${value}`\n} : {\n value: sign * value\n};\nconst patch = (value, base) => {\n const s = value.signal;\n return s && s.endsWith('(null)') ? {\n signal: s.slice(0, -6) + base.signal\n } : value;\n};\n\nfunction fallback(prop, config, axisConfig, style) {\n let styleProp;\n if (config && hasOwnProperty(config, prop)) {\n return config[prop];\n } else if (hasOwnProperty(axisConfig, prop)) {\n return axisConfig[prop];\n } else if (prop.startsWith('title')) {\n switch (prop) {\n case 'titleColor':\n styleProp = 'fill';\n break;\n case 'titleFont':\n case 'titleFontSize':\n case 'titleFontWeight':\n styleProp = prop[5].toLowerCase() + prop.slice(6);\n }\n return style[GuideTitleStyle][styleProp];\n } else if (prop.startsWith('label')) {\n switch (prop) {\n case 'labelColor':\n styleProp = 'fill';\n break;\n case 'labelFont':\n case 'labelFontSize':\n styleProp = prop[5].toLowerCase() + prop.slice(6);\n }\n return style[GuideLabelStyle][styleProp];\n }\n return null;\n}\nfunction keys(objects) {\n const map = {};\n for (const obj of objects) {\n if (!obj) continue;\n for (const key in obj) map[key] = 1;\n }\n return Object.keys(map);\n}\nfunction axisConfig (spec, scope) {\n var config = scope.config,\n style = config.style,\n axis = config.axis,\n band = scope.scaleType(spec.scale) === 'band' && config.axisBand,\n orient = spec.orient,\n xy,\n or,\n key;\n if (isSignal(orient)) {\n const xyKeys = keys([config.axisX, config.axisY]),\n orientKeys = keys([config.axisTop, config.axisBottom, config.axisLeft, config.axisRight]);\n xy = {};\n for (key of xyKeys) {\n xy[key] = ifX(orient, fallback(key, config.axisX, axis, style), fallback(key, config.axisY, axis, style));\n }\n or = {};\n for (key of orientKeys) {\n or[key] = ifOrient(orient.signal, fallback(key, config.axisTop, axis, style), fallback(key, config.axisBottom, axis, style), fallback(key, config.axisLeft, axis, style), fallback(key, config.axisRight, axis, style));\n }\n } else {\n xy = orient === Top || orient === Bottom ? config.axisX : config.axisY;\n or = config['axis' + orient[0].toUpperCase() + orient.slice(1)];\n }\n const result = xy || or || band ? extend({}, axis, xy, or, band) : axis;\n return result;\n}\n\nfunction axisDomain (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n orient = spec.orient;\n let enter, update;\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('domainColor'),\n strokeCap: _('domainCap'),\n strokeDash: _('domainDash'),\n strokeDashOffset: _('domainDashOffset'),\n strokeWidth: _('domainWidth'),\n strokeOpacity: _('domainOpacity')\n });\n const pos0 = position(spec, 0);\n const pos1 = position(spec, 1);\n enter.x = update.x = ifX(orient, pos0, zero);\n enter.x2 = update.x2 = ifX(orient, pos1);\n enter.y = update.y = ifY(orient, pos0, zero);\n enter.y2 = update.y2 = ifY(orient, pos1);\n return guideMark({\n type: RuleMark,\n role: AxisDomainRole,\n from: dataRef,\n encode\n }, userEncode);\n}\nfunction position(spec, pos) {\n return {\n scale: spec.scale,\n range: pos\n };\n}\n\nfunction axisGrid (spec, config, userEncode, dataRef, band) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n vscale = spec.gridScale,\n sign = getSign(orient, 1, -1),\n offset = offsetValue(spec.offset, sign);\n let enter, exit, update;\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one\n },\n exit: exit = {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('gridColor'),\n strokeCap: _('gridCap'),\n strokeDash: _('gridDash'),\n strokeDashOffset: _('gridDashOffset'),\n strokeOpacity: _('gridOpacity'),\n strokeWidth: _('gridWidth')\n });\n const tickPos = {\n scale: spec.scale,\n field: Value,\n band: band.band,\n extra: band.extra,\n offset: band.offset,\n round: _('tickRound')\n };\n const sz = ifX(orient, {\n signal: 'height'\n }, {\n signal: 'width'\n });\n const gridStart = vscale ? {\n scale: vscale,\n range: 0,\n mult: sign,\n offset: offset\n } : {\n value: 0,\n offset: offset\n };\n const gridEnd = vscale ? {\n scale: vscale,\n range: 1,\n mult: sign,\n offset: offset\n } : extend(sz, {\n mult: sign,\n offset: offset\n });\n enter.x = update.x = ifX(orient, tickPos, gridStart);\n enter.y = update.y = ifY(orient, tickPos, gridStart);\n enter.x2 = update.x2 = ifY(orient, gridEnd);\n enter.y2 = update.y2 = ifX(orient, gridEnd);\n exit.x = ifX(orient, tickPos);\n exit.y = ifY(orient, tickPos);\n return guideMark({\n type: RuleMark,\n role: AxisGridRole,\n key: Value,\n from: dataRef,\n encode\n }, userEncode);\n}\nfunction offsetValue(offset, sign) {\n if (sign === 1) ; else if (!isObject(offset)) {\n offset = isSignal(sign) ? {\n signal: `(${sign.signal}) * (${offset || 0})`\n } : sign * (offset || 0);\n } else {\n let entry = offset = extend({}, offset);\n while (entry.mult != null) {\n if (!isObject(entry.mult)) {\n entry.mult = isSignal(sign) // no offset if sign === 1\n ? {\n signal: `(${entry.mult}) * (${sign.signal})`\n } : entry.mult * sign;\n return offset;\n } else {\n entry = entry.mult = extend({}, entry.mult);\n }\n }\n entry.mult = sign;\n }\n return offset;\n}\n\nfunction axisTicks (spec, config, userEncode, dataRef, size, band) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n sign = getSign(orient, -1, 1);\n let enter, exit, update;\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one\n },\n exit: exit = {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('tickColor'),\n strokeCap: _('tickCap'),\n strokeDash: _('tickDash'),\n strokeDashOffset: _('tickDashOffset'),\n strokeOpacity: _('tickOpacity'),\n strokeWidth: _('tickWidth')\n });\n const tickSize = encoder(size);\n tickSize.mult = sign;\n const tickPos = {\n scale: spec.scale,\n field: Value,\n band: band.band,\n extra: band.extra,\n offset: band.offset,\n round: _('tickRound')\n };\n update.y = enter.y = ifX(orient, zero, tickPos);\n update.y2 = enter.y2 = ifX(orient, tickSize);\n exit.x = ifX(orient, tickPos);\n update.x = enter.x = ifY(orient, zero, tickPos);\n update.x2 = enter.x2 = ifY(orient, tickSize);\n exit.y = ifY(orient, tickPos);\n return guideMark({\n type: RuleMark,\n role: AxisTickRole,\n key: Value,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction flushExpr(scale, threshold, a, b, c) {\n return {\n signal: 'flush(range(\"' + scale + '\"), ' + 'scale(\"' + scale + '\", datum.value), ' + threshold + ',' + a + ',' + b + ',' + c + ')'\n };\n}\nfunction axisLabels (spec, config, userEncode, dataRef, size, band) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n scale = spec.scale,\n sign = getSign(orient, -1, 1),\n flush = deref(_('labelFlush')),\n flushOffset = deref(_('labelFlushOffset')),\n labelAlign = _('labelAlign'),\n labelBaseline = _('labelBaseline');\n let flushOn = flush === 0 || !!flush,\n update;\n const tickSize = encoder(size);\n tickSize.mult = sign;\n tickSize.offset = encoder(_('labelPadding') || 0);\n tickSize.offset.mult = sign;\n const tickPos = {\n scale: scale,\n field: Value,\n band: 0.5,\n offset: extendOffset(band.offset, _('labelOffset'))\n };\n const align = ifX(orient, flushOn ? flushExpr(scale, flush, '\"left\"', '\"right\"', '\"center\"') : {\n value: 'center'\n }, ifRight(orient, 'left', 'right'));\n const baseline = ifX(orient, ifTop(orient, 'bottom', 'top'), flushOn ? flushExpr(scale, flush, '\"top\"', '\"bottom\"', '\"middle\"') : {\n value: 'middle'\n });\n const offsetExpr = flushExpr(scale, flush, `-(${flushOffset})`, flushOffset, 0);\n flushOn = flushOn && flushOffset;\n const enter = {\n opacity: zero,\n x: ifX(orient, tickPos, tickSize),\n y: ifY(orient, tickPos, tickSize)\n };\n const encode = {\n enter: enter,\n update: update = {\n opacity: one,\n text: {\n field: Label\n },\n x: enter.x,\n y: enter.y,\n align,\n baseline\n },\n exit: {\n opacity: zero,\n x: enter.x,\n y: enter.y\n }\n };\n addEncoders(encode, {\n dx: !labelAlign && flushOn ? ifX(orient, offsetExpr) : null,\n dy: !labelBaseline && flushOn ? ifY(orient, offsetExpr) : null\n });\n addEncoders(encode, {\n angle: _('labelAngle'),\n fill: _('labelColor'),\n fillOpacity: _('labelOpacity'),\n font: _('labelFont'),\n fontSize: _('labelFontSize'),\n fontWeight: _('labelFontWeight'),\n fontStyle: _('labelFontStyle'),\n limit: _('labelLimit'),\n lineHeight: _('labelLineHeight')\n }, {\n align: labelAlign,\n baseline: labelBaseline\n });\n const bound = _('labelBound');\n let overlap = _('labelOverlap');\n\n // if overlap method or bound defined, request label overlap removal\n overlap = overlap || bound ? {\n separation: _('labelSeparation'),\n method: overlap,\n order: 'datum.index',\n bound: bound ? {\n scale,\n orient,\n tolerance: bound\n } : null\n } : undefined;\n if (update.align !== align) {\n update.align = patch(update.align, align);\n }\n if (update.baseline !== baseline) {\n update.baseline = patch(update.baseline, baseline);\n }\n return guideMark({\n type: TextMark,\n role: AxisLabelRole,\n style: GuideLabelStyle,\n key: Value,\n from: dataRef,\n encode,\n overlap\n }, userEncode);\n}\n\nfunction axisTitle (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n sign = getSign(orient, -1, 1);\n let enter, update;\n const encode = {\n enter: enter = {\n opacity: zero,\n anchor: encoder(_('titleAnchor', null)),\n align: {\n signal: alignExpr$1\n }\n },\n update: update = extend({}, enter, {\n opacity: one,\n text: encoder(spec.title)\n }),\n exit: {\n opacity: zero\n }\n };\n const titlePos = {\n signal: `lerp(range(\"${spec.scale}\"), ${anchorExpr(0, 1, 0.5)})`\n };\n update.x = ifX(orient, titlePos);\n update.y = ifY(orient, titlePos);\n enter.angle = ifX(orient, zero, mult(sign, 90));\n enter.baseline = ifX(orient, ifTop(orient, Bottom, Top), {\n value: Bottom\n });\n update.angle = enter.angle;\n update.baseline = enter.baseline;\n addEncoders(encode, {\n fill: _('titleColor'),\n fillOpacity: _('titleOpacity'),\n font: _('titleFont'),\n fontSize: _('titleFontSize'),\n fontStyle: _('titleFontStyle'),\n fontWeight: _('titleFontWeight'),\n limit: _('titleLimit'),\n lineHeight: _('titleLineHeight')\n }, {\n // require update\n align: _('titleAlign'),\n angle: _('titleAngle'),\n baseline: _('titleBaseline')\n });\n autoLayout(_, orient, encode, userEncode);\n encode.update.align = patch(encode.update.align, enter.align);\n encode.update.angle = patch(encode.update.angle, enter.angle);\n encode.update.baseline = patch(encode.update.baseline, enter.baseline);\n return guideMark({\n type: TextMark,\n role: AxisTitleRole,\n style: GuideTitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\nfunction autoLayout(_, orient, encode, userEncode) {\n const auto = (value, dim) => value != null ? (encode.update[dim] = patch(encoder(value), encode.update[dim]), false) : !has(dim, userEncode) ? true : false;\n const autoY = auto(_('titleX'), 'x'),\n autoX = auto(_('titleY'), 'y');\n encode.enter.auto = autoX === autoY ? encoder(autoX) : ifX(orient, encoder(autoX), encoder(autoY));\n}\n\nfunction parseAxis (spec, scope) {\n const config = axisConfig(spec, scope),\n encode = spec.encode || {},\n axisEncode = encode.axis || {},\n name = axisEncode.name || undefined,\n interactive = axisEncode.interactive,\n style = axisEncode.style,\n _ = lookup(spec, config),\n band = tickBand(_);\n\n // single-element data source for axis group\n const datum = {\n scale: spec.scale,\n ticks: !!_('ticks'),\n labels: !!_('labels'),\n grid: !!_('grid'),\n domain: !!_('domain'),\n title: spec.title != null\n };\n const dataRef = ref(scope.add(Collect({}, [datum])));\n\n // data source for axis ticks\n const ticksRef = ref(scope.add(AxisTicks({\n scale: scope.scaleRef(spec.scale),\n extra: scope.property(band.extra),\n count: scope.objectProperty(spec.tickCount),\n values: scope.objectProperty(spec.values),\n minstep: scope.property(spec.tickMinStep),\n formatType: scope.property(spec.formatType),\n formatSpecifier: scope.property(spec.format)\n })));\n\n // generate axis marks\n const children = [];\n let size;\n\n // include axis gridlines if requested\n if (datum.grid) {\n children.push(axisGrid(spec, config, encode.grid, ticksRef, band));\n }\n\n // include axis ticks if requested\n if (datum.ticks) {\n size = _('tickSize');\n children.push(axisTicks(spec, config, encode.ticks, ticksRef, size, band));\n }\n\n // include axis labels if requested\n if (datum.labels) {\n size = datum.ticks ? size : 0;\n children.push(axisLabels(spec, config, encode.labels, ticksRef, size, band));\n }\n\n // include axis domain path if requested\n if (datum.domain) {\n children.push(axisDomain(spec, config, encode.domain, dataRef));\n }\n\n // include axis title if defined\n if (datum.title) {\n children.push(axisTitle(spec, config, encode.title, dataRef));\n }\n\n // parse axis specification\n return parseMark(guideGroup({\n role: AxisRole,\n from: dataRef,\n encode: extendEncode(buildAxisEncode(_, spec), axisEncode, Skip),\n marks: children,\n aria: _('aria'),\n description: _('description'),\n zindex: _('zindex'),\n name,\n interactive,\n style\n }), scope);\n}\nfunction buildAxisEncode(_, spec) {\n const encode = {\n enter: {},\n update: {}\n };\n addEncoders(encode, {\n orient: _('orient'),\n offset: _('offset') || 0,\n position: value(spec.position, 0),\n titlePadding: _('titlePadding'),\n minExtent: _('minExtent'),\n maxExtent: _('maxExtent'),\n range: {\n signal: `abs(span(range(\"${spec.scale}\")))`\n },\n translate: _('translate'),\n // accessibility support\n format: spec.format,\n formatType: spec.formatType\n });\n return encode;\n}\n\nfunction parseScope (spec, scope, preprocessed) {\n const signals = array(spec.signals),\n scales = array(spec.scales);\n\n // parse signal definitions, if not already preprocessed\n if (!preprocessed) signals.forEach(_ => parseSignal(_, scope));\n\n // parse cartographic projection definitions\n array(spec.projections).forEach(_ => parseProjection(_, scope));\n\n // initialize scale references\n scales.forEach(_ => initScale(_, scope));\n\n // parse data sources\n array(spec.data).forEach(_ => parseData(_, scope));\n\n // parse scale definitions\n scales.forEach(_ => parseScale(_, scope));\n\n // parse signal updates\n (preprocessed || signals).forEach(_ => parseSignalUpdates(_, scope));\n\n // parse axis definitions\n array(spec.axes).forEach(_ => parseAxis(_, scope));\n\n // parse mark definitions\n array(spec.marks).forEach(_ => parseMark(_, scope));\n\n // parse legend definitions\n array(spec.legends).forEach(_ => parseLegend(_, scope));\n\n // parse title, if defined\n if (spec.title) parseTitle(spec.title, scope);\n\n // parse collected lambda (anonymous) expressions\n scope.parseLambdas();\n return scope;\n}\n\nconst rootEncode = spec => extendEncode({\n enter: {\n x: {\n value: 0\n },\n y: {\n value: 0\n }\n },\n update: {\n width: {\n signal: 'width'\n },\n height: {\n signal: 'height'\n }\n }\n}, spec);\nfunction parseView(spec, scope) {\n const config = scope.config;\n\n // add scenegraph root\n const root = ref(scope.root = scope.add(operator()));\n\n // parse top-level signal definitions\n const signals = collectSignals(spec, config);\n signals.forEach(_ => parseSignal(_, scope));\n\n // assign description, event, legend, and locale configuration\n scope.description = spec.description || config.description;\n scope.eventConfig = config.events;\n scope.legends = scope.objectProperty(config.legend && config.legend.layout);\n scope.locale = config.locale;\n\n // store root group item\n const input = scope.add(Collect());\n\n // encode root group item\n const encode = scope.add(Encode(parseEncode(rootEncode(spec.encode), GroupMark, FrameRole, spec.style, scope, {\n pulse: ref(input)\n })));\n\n // perform view layout\n const parent = scope.add(ViewLayout({\n layout: scope.objectProperty(spec.layout),\n legends: scope.legends,\n autosize: scope.signalRef('autosize'),\n mark: root,\n pulse: ref(encode)\n }));\n scope.operators.pop();\n\n // parse remainder of specification\n scope.pushState(ref(encode), ref(parent), null);\n parseScope(spec, scope, signals);\n scope.operators.push(parent);\n\n // bound / render / sieve root item\n let op = scope.add(Bound({\n mark: root,\n pulse: ref(parent)\n }));\n op = scope.add(Render({\n pulse: ref(op)\n }));\n op = scope.add(Sieve({\n pulse: ref(op)\n }));\n\n // track metadata for root item\n scope.addData('root', new DataScope(scope, input, input, op));\n return scope;\n}\nfunction signalObject(name, value) {\n return value && value.signal ? {\n name,\n update: value.signal\n } : {\n name,\n value\n };\n}\n\n/**\n * Collect top-level signals, merging values as needed. Signals\n * defined in the config signals arrays are added only if that\n * signal is not explicitly defined in the specification.\n * Built-in signals (autosize, background, padding, width, height)\n * receive special treatment. They are initialized using the\n * top-level spec property, or, if undefined in the spec, using\n * the corresponding top-level config property. If this property\n * is a signal reference object, the signal expression maps to the\n * signal 'update' property. If the spec's top-level signal array\n * contains an entry that matches a built-in signal, that entry\n * will be merged with the built-in specification, potentially\n * overwriting existing 'value' or 'update' properties.\n */\nfunction collectSignals(spec, config) {\n const _ = name => value(spec[name], config[name]),\n signals = [signalObject('background', _('background')), signalObject('autosize', parseAutosize(_('autosize'))), signalObject('padding', parsePadding(_('padding'))), signalObject('width', _('width') || 0), signalObject('height', _('height') || 0)],\n pre = signals.reduce((p, s) => (p[s.name] = s, p), {}),\n map = {};\n\n // add spec signal array\n array(spec.signals).forEach(s => {\n if (hasOwnProperty(pre, s.name)) {\n // merge if built-in signal\n s = extend(pre[s.name], s);\n } else {\n // otherwise add to signal list\n signals.push(s);\n }\n map[s.name] = s;\n });\n\n // add config signal array\n array(config.signals).forEach(s => {\n if (!hasOwnProperty(map, s.name) && !hasOwnProperty(pre, s.name)) {\n // add to signal list if not already defined\n signals.push(s);\n }\n });\n return signals;\n}\n\nfunction Scope(config, options) {\n this.config = config || {};\n this.options = options || {};\n this.bindings = [];\n this.field = {};\n this.signals = {};\n this.lambdas = {};\n this.scales = {};\n this.events = {};\n this.data = {};\n this.streams = [];\n this.updates = [];\n this.operators = [];\n this.eventConfig = null;\n this.locale = null;\n this._id = 0;\n this._subid = 0;\n this._nextsub = [0];\n this._parent = [];\n this._encode = [];\n this._lookup = [];\n this._markpath = [];\n}\nfunction Subscope(scope) {\n this.config = scope.config;\n this.options = scope.options;\n this.legends = scope.legends;\n this.field = Object.create(scope.field);\n this.signals = Object.create(scope.signals);\n this.lambdas = Object.create(scope.lambdas);\n this.scales = Object.create(scope.scales);\n this.events = Object.create(scope.events);\n this.data = Object.create(scope.data);\n this.streams = [];\n this.updates = [];\n this.operators = [];\n this._id = 0;\n this._subid = ++scope._nextsub[0];\n this._nextsub = scope._nextsub;\n this._parent = scope._parent.slice();\n this._encode = scope._encode.slice();\n this._lookup = scope._lookup.slice();\n this._markpath = scope._markpath;\n}\nScope.prototype = Subscope.prototype = {\n parse(spec) {\n return parseScope(spec, this);\n },\n fork() {\n return new Subscope(this);\n },\n isSubscope() {\n return this._subid > 0;\n },\n toRuntime() {\n this.finish();\n return {\n description: this.description,\n operators: this.operators,\n streams: this.streams,\n updates: this.updates,\n bindings: this.bindings,\n eventConfig: this.eventConfig,\n locale: this.locale\n };\n },\n id() {\n return (this._subid ? this._subid + ':' : 0) + this._id++;\n },\n add(op) {\n this.operators.push(op);\n op.id = this.id();\n // if pre-registration references exist, resolve them now\n if (op.refs) {\n op.refs.forEach(ref => {\n ref.$ref = op.id;\n });\n op.refs = null;\n }\n return op;\n },\n proxy(op) {\n const vref = op instanceof Entry ? ref(op) : op;\n return this.add(Proxy({\n value: vref\n }));\n },\n addStream(stream) {\n this.streams.push(stream);\n stream.id = this.id();\n return stream;\n },\n addUpdate(update) {\n this.updates.push(update);\n return update;\n },\n // Apply metadata\n finish() {\n let name, ds;\n\n // annotate root\n if (this.root) this.root.root = true;\n\n // annotate signals\n for (name in this.signals) {\n this.signals[name].signal = name;\n }\n\n // annotate scales\n for (name in this.scales) {\n this.scales[name].scale = name;\n }\n\n // annotate data sets\n function annotate(op, name, type) {\n let data, list;\n if (op) {\n data = op.data || (op.data = {});\n list = data[name] || (data[name] = []);\n list.push(type);\n }\n }\n for (name in this.data) {\n ds = this.data[name];\n annotate(ds.input, name, 'input');\n annotate(ds.output, name, 'output');\n annotate(ds.values, name, 'values');\n for (const field in ds.index) {\n annotate(ds.index[field], name, 'index:' + field);\n }\n }\n return this;\n },\n // ----\n\n pushState(encode, parent, lookup) {\n this._encode.push(ref(this.add(Sieve({\n pulse: encode\n }))));\n this._parent.push(parent);\n this._lookup.push(lookup ? ref(this.proxy(lookup)) : null);\n this._markpath.push(-1);\n },\n popState() {\n this._encode.pop();\n this._parent.pop();\n this._lookup.pop();\n this._markpath.pop();\n },\n parent() {\n return peek(this._parent);\n },\n encode() {\n return peek(this._encode);\n },\n lookup() {\n return peek(this._lookup);\n },\n markpath() {\n const p = this._markpath;\n return ++p[p.length - 1];\n },\n // ----\n\n fieldRef(field, name) {\n if (isString(field)) return fieldRef$1(field, name);\n if (!field.signal) {\n error('Unsupported field reference: ' + stringValue(field));\n }\n const s = field.signal;\n let f = this.field[s];\n if (!f) {\n const params = {\n name: this.signalRef(s)\n };\n if (name) params.as = name;\n this.field[s] = f = ref(this.add(Field(params)));\n }\n return f;\n },\n compareRef(cmp) {\n let signal = false;\n const check = _ => isSignal(_) ? (signal = true, this.signalRef(_.signal)) : isExpr$1(_) ? (signal = true, this.exprRef(_.expr)) : _;\n const fields = array(cmp.field).map(check),\n orders = array(cmp.order).map(check);\n return signal ? ref(this.add(Compare({\n fields: fields,\n orders: orders\n }))) : compareRef(fields, orders);\n },\n keyRef(fields, flat) {\n let signal = false;\n const check = _ => isSignal(_) ? (signal = true, ref(sig[_.signal])) : _;\n const sig = this.signals;\n fields = array(fields).map(check);\n return signal ? ref(this.add(Key({\n fields: fields,\n flat: flat\n }))) : keyRef(fields, flat);\n },\n sortRef(sort) {\n if (!sort) return sort;\n\n // including id ensures stable sorting\n const a = aggrField(sort.op, sort.field),\n o = sort.order || Ascending;\n return o.signal ? ref(this.add(Compare({\n fields: a,\n orders: this.signalRef(o.signal)\n }))) : compareRef(a, o);\n },\n // ----\n\n event(source, type) {\n const key = source + ':' + type;\n if (!this.events[key]) {\n const id = this.id();\n this.streams.push({\n id: id,\n source: source,\n type: type\n });\n this.events[key] = id;\n }\n return this.events[key];\n },\n // ----\n\n hasOwnSignal(name) {\n return hasOwnProperty(this.signals, name);\n },\n addSignal(name, value) {\n if (this.hasOwnSignal(name)) {\n error('Duplicate signal name: ' + stringValue(name));\n }\n const op = value instanceof Entry ? value : this.add(operator(value));\n return this.signals[name] = op;\n },\n getSignal(name) {\n if (!this.signals[name]) {\n error('Unrecognized signal name: ' + stringValue(name));\n }\n return this.signals[name];\n },\n signalRef(s) {\n if (this.signals[s]) {\n return ref(this.signals[s]);\n } else if (!hasOwnProperty(this.lambdas, s)) {\n this.lambdas[s] = this.add(operator(null));\n }\n return ref(this.lambdas[s]);\n },\n parseLambdas() {\n const code = Object.keys(this.lambdas);\n for (let i = 0, n = code.length; i < n; ++i) {\n const s = code[i],\n e = parseExpression(s, this),\n op = this.lambdas[s];\n op.params = e.$params;\n op.update = e.$expr;\n }\n },\n property(spec) {\n return spec && spec.signal ? this.signalRef(spec.signal) : spec;\n },\n objectProperty(spec) {\n return !spec || !isObject(spec) ? spec : this.signalRef(spec.signal || propertyLambda(spec));\n },\n exprRef(code, name) {\n const params = {\n expr: parseExpression(code, this)\n };\n if (name) params.expr.$name = name;\n return ref(this.add(Expression(params)));\n },\n addBinding(name, bind) {\n if (!this.bindings) {\n error('Nested signals do not support binding: ' + stringValue(name));\n }\n this.bindings.push(extend({\n signal: name\n }, bind));\n },\n // ----\n\n addScaleProj(name, transform) {\n if (hasOwnProperty(this.scales, name)) {\n error('Duplicate scale or projection name: ' + stringValue(name));\n }\n this.scales[name] = this.add(transform);\n },\n addScale(name, params) {\n this.addScaleProj(name, Scale(params));\n },\n addProjection(name, params) {\n this.addScaleProj(name, Projection(params));\n },\n getScale(name) {\n if (!this.scales[name]) {\n error('Unrecognized scale name: ' + stringValue(name));\n }\n return this.scales[name];\n },\n scaleRef(name) {\n return ref(this.getScale(name));\n },\n scaleType(name) {\n return this.getScale(name).params.type;\n },\n projectionRef(name) {\n return this.scaleRef(name);\n },\n projectionType(name) {\n return this.scaleType(name);\n },\n // ----\n\n addData(name, dataScope) {\n if (hasOwnProperty(this.data, name)) {\n error('Duplicate data set name: ' + stringValue(name));\n }\n return this.data[name] = dataScope;\n },\n getData(name) {\n if (!this.data[name]) {\n error('Undefined data set name: ' + stringValue(name));\n }\n return this.data[name];\n },\n addDataPipeline(name, entries) {\n if (hasOwnProperty(this.data, name)) {\n error('Duplicate data set name: ' + stringValue(name));\n }\n return this.addData(name, DataScope.fromEntries(this, entries));\n }\n};\nfunction propertyLambda(spec) {\n return (isArray(spec) ? arrayLambda : objectLambda)(spec);\n}\nfunction arrayLambda(array) {\n const n = array.length;\n let code = '[';\n for (let i = 0; i < n; ++i) {\n const value = array[i];\n code += (i > 0 ? ',' : '') + (isObject(value) ? value.signal || propertyLambda(value) : stringValue(value));\n }\n return code + ']';\n}\nfunction objectLambda(obj) {\n let code = '{',\n i = 0,\n key,\n value;\n for (key in obj) {\n value = obj[key];\n code += (++i > 1 ? ',' : '') + stringValue(key) + ':' + (isObject(value) ? value.signal || propertyLambda(value) : stringValue(value));\n }\n return code + '}';\n}\n\n/**\n * Standard configuration defaults for Vega specification parsing.\n * Users can provide their own (sub-)set of these default values\n * by passing in a config object to the top-level parse method.\n */\nfunction defaults () {\n const defaultFont = 'sans-serif',\n defaultSymbolSize = 30,\n defaultStrokeWidth = 2,\n defaultColor = '#4c78a8',\n black = '#000',\n gray = '#888',\n lightGray = '#ddd';\n return {\n // default visualization description\n description: 'Vega visualization',\n // default padding around visualization\n padding: 0,\n // default for automatic sizing; options: 'none', 'pad', 'fit'\n // or provide an object (e.g., {'type': 'pad', 'resize': true})\n autosize: 'pad',\n // default view background color\n // covers the entire view component\n background: null,\n // default event handling configuration\n // preventDefault for view-sourced event types except 'wheel'\n events: {\n defaults: {\n allow: ['wheel']\n }\n },\n // defaults for top-level group marks\n // accepts mark properties (fill, stroke, etc)\n // covers the data rectangle within group width/height\n group: null,\n // defaults for basic mark types\n // each subset accepts mark properties (fill, stroke, etc)\n mark: null,\n arc: {\n fill: defaultColor\n },\n area: {\n fill: defaultColor\n },\n image: null,\n line: {\n stroke: defaultColor,\n strokeWidth: defaultStrokeWidth\n },\n path: {\n stroke: defaultColor\n },\n rect: {\n fill: defaultColor\n },\n rule: {\n stroke: black\n },\n shape: {\n stroke: defaultColor\n },\n symbol: {\n fill: defaultColor,\n size: 64\n },\n text: {\n fill: black,\n font: defaultFont,\n fontSize: 11\n },\n trail: {\n fill: defaultColor,\n size: defaultStrokeWidth\n },\n // style definitions\n style: {\n // axis & legend labels\n 'guide-label': {\n fill: black,\n font: defaultFont,\n fontSize: 10\n },\n // axis & legend titles\n 'guide-title': {\n fill: black,\n font: defaultFont,\n fontSize: 11,\n fontWeight: 'bold'\n },\n // headers, including chart title\n 'group-title': {\n fill: black,\n font: defaultFont,\n fontSize: 13,\n fontWeight: 'bold'\n },\n // chart subtitle\n 'group-subtitle': {\n fill: black,\n font: defaultFont,\n fontSize: 12\n },\n // defaults for styled point marks in Vega-Lite\n point: {\n size: defaultSymbolSize,\n strokeWidth: defaultStrokeWidth,\n shape: 'circle'\n },\n circle: {\n size: defaultSymbolSize,\n strokeWidth: defaultStrokeWidth\n },\n square: {\n size: defaultSymbolSize,\n strokeWidth: defaultStrokeWidth,\n shape: 'square'\n },\n // defaults for styled group marks in Vega-Lite\n cell: {\n fill: 'transparent',\n stroke: lightGray\n },\n view: {\n fill: 'transparent'\n }\n },\n // defaults for title\n title: {\n orient: 'top',\n anchor: 'middle',\n offset: 4,\n subtitlePadding: 3\n },\n // defaults for axes\n axis: {\n minExtent: 0,\n maxExtent: 200,\n bandPosition: 0.5,\n domain: true,\n domainWidth: 1,\n domainColor: gray,\n grid: false,\n gridWidth: 1,\n gridColor: lightGray,\n labels: true,\n labelAngle: 0,\n labelLimit: 180,\n labelOffset: 0,\n labelPadding: 2,\n ticks: true,\n tickColor: gray,\n tickOffset: 0,\n tickRound: true,\n tickSize: 5,\n tickWidth: 1,\n titlePadding: 4\n },\n // correction for centering bias\n axisBand: {\n tickOffset: -0.5\n },\n // defaults for cartographic projection\n projection: {\n type: 'mercator'\n },\n // defaults for legends\n legend: {\n orient: 'right',\n padding: 0,\n gridAlign: 'each',\n columnPadding: 10,\n rowPadding: 2,\n symbolDirection: 'vertical',\n gradientDirection: 'vertical',\n gradientLength: 200,\n gradientThickness: 16,\n gradientStrokeColor: lightGray,\n gradientStrokeWidth: 0,\n gradientLabelOffset: 2,\n labelAlign: 'left',\n labelBaseline: 'middle',\n labelLimit: 160,\n labelOffset: 4,\n labelOverlap: true,\n symbolLimit: 30,\n symbolType: 'circle',\n symbolSize: 100,\n symbolOffset: 0,\n symbolStrokeWidth: 1.5,\n symbolBaseFillColor: 'transparent',\n symbolBaseStrokeColor: gray,\n titleLimit: 180,\n titleOrient: 'top',\n titlePadding: 5,\n layout: {\n offset: 18,\n direction: 'horizontal',\n left: {\n direction: 'vertical'\n },\n right: {\n direction: 'vertical'\n }\n }\n },\n // defaults for scale ranges\n range: {\n category: {\n scheme: 'tableau10'\n },\n ordinal: {\n scheme: 'blues'\n },\n heatmap: {\n scheme: 'yellowgreenblue'\n },\n ramp: {\n scheme: 'blues'\n },\n diverging: {\n scheme: 'blueorange',\n extent: [1, 0]\n },\n symbol: ['circle', 'square', 'triangle-up', 'cross', 'diamond', 'triangle-right', 'triangle-down', 'triangle-left']\n }\n };\n}\n\nfunction parse (spec, config, options) {\n if (!isObject(spec)) {\n error('Input Vega specification must be an object.');\n }\n config = mergeConfig(defaults(), config, spec.config);\n return parseView(spec, new Scope(config, options)).toRuntime();\n}\n\nexport { AxisDomainRole, AxisGridRole, AxisLabelRole, AxisRole, AxisTickRole, AxisTitleRole, DataScope, FrameRole, LegendEntryRole, LegendLabelRole, LegendRole, LegendSymbolRole, LegendTitleRole, MarkRole, Scope, ScopeRole, defaults as config, parse, parseSignal as signal, parseSignalUpdates as signalUpdates, parseStream as stream };\n","import { extend } from 'vega-util';\nexport * from 'vega-util';\nimport { transforms } from 'vega-dataflow';\nexport { Dataflow, EventStream, MultiPulse, Operator, Parameters, Pulse, Transform, changeset, definition, ingest, isTuple, transform, transforms, tupleid } from 'vega-dataflow';\nimport * as tx from 'vega-transforms';\nimport * as vtx from 'vega-view-transforms';\nimport * as encode from 'vega-encode';\nimport * as geo from 'vega-geo';\nimport * as force from 'vega-force';\nimport * as tree from 'vega-hierarchy';\nimport * as label from 'vega-label';\nimport * as reg from 'vega-regression';\nimport * as voronoi from 'vega-voronoi';\nimport * as wordcloud from 'vega-wordcloud';\nimport * as xf from 'vega-crossfilter';\nexport * from 'vega-statistics';\nexport * from 'vega-time';\nexport * from 'vega-loader';\nexport * from 'vega-scenegraph';\nexport { interpolate, interpolateColors, interpolateRange, quantizeInterpolator, scale, scheme } from 'vega-scale';\nexport { projection } from 'vega-projection';\nexport { View } from 'vega-view';\nexport { defaultLocale, numberFormatDefaultLocale as formatLocale, locale, resetDefaultLocale, timeFormatDefaultLocale as timeFormatLocale } from 'vega-format';\nexport { expressionFunction } from 'vega-functions';\nexport { parse } from 'vega-parser';\nexport { context as runtimeContext } from 'vega-runtime';\nexport { codegenExpression, parseExpression } from 'vega-expression';\nexport { parseSelector } from 'vega-event-selector';\n\nvar version = \"5.24.0\";\n\n// -- Transforms -----\nextend(transforms, tx, vtx, encode, geo, force, label, tree, reg, voronoi, wordcloud, xf);\n\nexport { version };\n","function adjustSpatial (item, encode, swap) {\n let t;\n if (encode.x2) {\n if (encode.x) {\n if (swap && item.x > item.x2) {\n t = item.x;\n item.x = item.x2;\n item.x2 = t;\n }\n item.width = item.x2 - item.x;\n } else {\n item.x = item.x2 - (item.width || 0);\n }\n }\n if (encode.xc) {\n item.x = item.xc - (item.width || 0) / 2;\n }\n if (encode.y2) {\n if (encode.y) {\n if (swap && item.y > item.y2) {\n t = item.y;\n item.y = item.y2;\n item.y2 = t;\n }\n item.height = item.y2 - item.y;\n } else {\n item.y = item.y2 - (item.height || 0);\n }\n }\n if (encode.yc) {\n item.y = item.yc - (item.height || 0) / 2;\n }\n}\n\nvar Constants = {\n NaN: NaN,\n E: Math.E,\n LN2: Math.LN2,\n LN10: Math.LN10,\n LOG2E: Math.LOG2E,\n LOG10E: Math.LOG10E,\n PI: Math.PI,\n SQRT1_2: Math.SQRT1_2,\n SQRT2: Math.SQRT2,\n MIN_VALUE: Number.MIN_VALUE,\n MAX_VALUE: Number.MAX_VALUE\n};\n\nvar Ops = {\n '*': (a, b) => a * b,\n '+': (a, b) => a + b,\n '-': (a, b) => a - b,\n '/': (a, b) => a / b,\n '%': (a, b) => a % b,\n '>': (a, b) => a > b,\n '<': (a, b) => a < b,\n '<=': (a, b) => a <= b,\n '>=': (a, b) => a >= b,\n '==': (a, b) => a == b,\n '!=': (a, b) => a != b,\n '===': (a, b) => a === b,\n '!==': (a, b) => a !== b,\n '&': (a, b) => a & b,\n '|': (a, b) => a | b,\n '^': (a, b) => a ^ b,\n '<<': (a, b) => a << b,\n '>>': (a, b) => a >> b,\n '>>>': (a, b) => a >>> b\n};\n\nvar Unary = {\n '+': a => +a,\n '-': a => -a,\n '~': a => ~a,\n '!': a => !a\n};\n\nconst slice = Array.prototype.slice;\nconst apply = (m, args, cast) => {\n const obj = cast ? cast(args[0]) : args[0];\n return obj[m].apply(obj, slice.call(args, 1));\n};\nconst datetime = (y, m, d, H, M, S, ms) => new Date(y, m || 0, d != null ? d : 1, H || 0, M || 0, S || 0, ms || 0);\nvar Functions = {\n // math functions\n isNaN: Number.isNaN,\n isFinite: Number.isFinite,\n abs: Math.abs,\n acos: Math.acos,\n asin: Math.asin,\n atan: Math.atan,\n atan2: Math.atan2,\n ceil: Math.ceil,\n cos: Math.cos,\n exp: Math.exp,\n floor: Math.floor,\n log: Math.log,\n max: Math.max,\n min: Math.min,\n pow: Math.pow,\n random: Math.random,\n round: Math.round,\n sin: Math.sin,\n sqrt: Math.sqrt,\n tan: Math.tan,\n clamp: (a, b, c) => Math.max(b, Math.min(c, a)),\n // date functions\n now: Date.now,\n utc: Date.UTC,\n datetime: datetime,\n date: d => new Date(d).getDate(),\n day: d => new Date(d).getDay(),\n year: d => new Date(d).getFullYear(),\n month: d => new Date(d).getMonth(),\n hours: d => new Date(d).getHours(),\n minutes: d => new Date(d).getMinutes(),\n seconds: d => new Date(d).getSeconds(),\n milliseconds: d => new Date(d).getMilliseconds(),\n time: d => new Date(d).getTime(),\n timezoneoffset: d => new Date(d).getTimezoneOffset(),\n utcdate: d => new Date(d).getUTCDate(),\n utcday: d => new Date(d).getUTCDay(),\n utcyear: d => new Date(d).getUTCFullYear(),\n utcmonth: d => new Date(d).getUTCMonth(),\n utchours: d => new Date(d).getUTCHours(),\n utcminutes: d => new Date(d).getUTCMinutes(),\n utcseconds: d => new Date(d).getUTCSeconds(),\n utcmilliseconds: d => new Date(d).getUTCMilliseconds(),\n // sequence functions\n length: x => x.length,\n join: function () {\n return apply('join', arguments);\n },\n indexof: function () {\n return apply('indexOf', arguments);\n },\n lastindexof: function () {\n return apply('lastIndexOf', arguments);\n },\n slice: function () {\n return apply('slice', arguments);\n },\n reverse: x => x.slice().reverse(),\n // string functions\n parseFloat: parseFloat,\n parseInt: parseInt,\n upper: x => String(x).toUpperCase(),\n lower: x => String(x).toLowerCase(),\n substring: function () {\n return apply('substring', arguments, String);\n },\n split: function () {\n return apply('split', arguments, String);\n },\n replace: function () {\n return apply('replace', arguments, String);\n },\n trim: x => String(x).trim(),\n // regexp functions\n regexp: RegExp,\n test: (r, t) => RegExp(r).test(t)\n};\n\nconst EventFunctions = ['view', 'item', 'group', 'xy', 'x', 'y'];\nconst DisallowedMethods = new Set([Function, eval, setTimeout, setInterval]);\nif (typeof setImmediate === 'function') DisallowedMethods.add(setImmediate);\nconst Visitors = {\n Literal: ($, n) => n.value,\n Identifier: ($, n) => {\n const id = n.name;\n return $.memberDepth > 0 ? id : id === 'datum' ? $.datum : id === 'event' ? $.event : id === 'item' ? $.item : Constants[id] || $.params['$' + id];\n },\n MemberExpression: ($, n) => {\n const d = !n.computed,\n o = $(n.object);\n if (d) $.memberDepth += 1;\n const p = $(n.property);\n if (d) $.memberDepth -= 1;\n if (DisallowedMethods.has(o[p])) {\n // eslint-disable-next-line no-console\n console.error(`Prevented interpretation of member \"${p}\" which could lead to insecure code execution`);\n return;\n }\n return o[p];\n },\n CallExpression: ($, n) => {\n const args = n.arguments;\n let name = n.callee.name;\n\n // handle special internal functions used by encoders\n // re-route to corresponding standard function\n if (name.startsWith('_')) {\n name = name.slice(1);\n }\n\n // special case \"if\" due to conditional evaluation of branches\n return name === 'if' ? $(args[0]) ? $(args[1]) : $(args[2]) : ($.fn[name] || Functions[name]).apply($.fn, args.map($));\n },\n ArrayExpression: ($, n) => n.elements.map($),\n BinaryExpression: ($, n) => Ops[n.operator]($(n.left), $(n.right)),\n UnaryExpression: ($, n) => Unary[n.operator]($(n.argument)),\n ConditionalExpression: ($, n) => $(n.test) ? $(n.consequent) : $(n.alternate),\n LogicalExpression: ($, n) => n.operator === '&&' ? $(n.left) && $(n.right) : $(n.left) || $(n.right),\n ObjectExpression: ($, n) => n.properties.reduce((o, p) => {\n $.memberDepth += 1;\n const k = $(p.key);\n $.memberDepth -= 1;\n if (DisallowedMethods.has($(p.value))) {\n // eslint-disable-next-line no-console\n console.error(`Prevented interpretation of property \"${k}\" which could lead to insecure code execution`);\n } else {\n o[k] = $(p.value);\n }\n return o;\n }, {})\n};\nfunction interpret (ast, fn, params, datum, event, item) {\n const $ = n => Visitors[n.type]($, n);\n $.memberDepth = 0;\n $.fn = Object.create(fn);\n $.params = params;\n $.datum = datum;\n $.event = event;\n $.item = item;\n\n // route event functions to annotated vega event context\n EventFunctions.forEach(f => $.fn[f] = function () {\n return event.vega[f](...arguments);\n });\n return $(ast);\n}\n\nvar expression = {\n /**\n * Parse an expression used to update an operator value.\n */\n operator(ctx, expr) {\n const ast = expr.ast,\n fn = ctx.functions;\n return _ => interpret(ast, fn, _);\n },\n /**\n * Parse an expression provided as an operator parameter value.\n */\n parameter(ctx, expr) {\n const ast = expr.ast,\n fn = ctx.functions;\n return (datum, _) => interpret(ast, fn, _, datum);\n },\n /**\n * Parse an expression applied to an event stream.\n */\n event(ctx, expr) {\n const ast = expr.ast,\n fn = ctx.functions;\n return event => interpret(ast, fn, undefined, undefined, event);\n },\n /**\n * Parse an expression used to handle an event-driven operator update.\n */\n handler(ctx, expr) {\n const ast = expr.ast,\n fn = ctx.functions;\n return (_, event) => {\n const datum = event.item && event.item.datum;\n return interpret(ast, fn, _, datum, event);\n };\n },\n /**\n * Parse an expression that performs visual encoding.\n */\n encode(ctx, encode) {\n const {\n marktype,\n channels\n } = encode,\n fn = ctx.functions,\n swap = marktype === 'group' || marktype === 'image' || marktype === 'rect';\n return (item, _) => {\n const datum = item.datum;\n let m = 0,\n v;\n for (const name in channels) {\n v = interpret(channels[name].ast, fn, _, datum, undefined, item);\n if (item[name] !== v) {\n item[name] = v;\n m = 1;\n }\n }\n if (marktype !== 'rule') {\n adjustSpatial(item, channels, swap);\n }\n return m;\n };\n }\n};\n\nexport { expression as expressionInterpreter };\n","function accessor (fn, fields, name) {\n fn.fields = fields || [];\n fn.fname = name;\n return fn;\n}\nfunction accessorName(fn) {\n return fn == null ? null : fn.fname;\n}\nfunction accessorFields(fn) {\n return fn == null ? null : fn.fields;\n}\n\nfunction getter (path) {\n return path.length === 1 ? get1(path[0]) : getN(path);\n}\n\nconst get1 = field => function (obj) {\n return obj[field];\n};\n\nconst getN = path => {\n const len = path.length;\n return function (obj) {\n for (let i = 0; i < len; ++i) {\n obj = obj[path[i]];\n }\n\n return obj;\n };\n};\n\nfunction error (message) {\n throw Error(message);\n}\n\nfunction splitAccessPath (p) {\n const path = [],\n n = p.length;\n let q = null,\n b = 0,\n s = '',\n i,\n j,\n c;\n p = p + '';\n\n function push() {\n path.push(s + p.substring(i, j));\n s = '';\n i = j + 1;\n }\n\n for (i = j = 0; j < n; ++j) {\n c = p[j];\n\n if (c === '\\\\') {\n s += p.substring(i, j);\n s += p.substring(++j, ++j);\n i = j;\n } else if (c === q) {\n push();\n q = null;\n b = -1;\n } else if (q) {\n continue;\n } else if (i === b && c === '\"') {\n i = j + 1;\n q = c;\n } else if (i === b && c === \"'\") {\n i = j + 1;\n q = c;\n } else if (c === '.' && !b) {\n if (j > i) {\n push();\n } else {\n i = j + 1;\n }\n } else if (c === '[') {\n if (j > i) push();\n b = i = j + 1;\n } else if (c === ']') {\n if (!b) error('Access path missing open bracket: ' + p);\n if (b > 0) push();\n b = 0;\n i = j + 1;\n }\n }\n\n if (b) error('Access path missing closing bracket: ' + p);\n if (q) error('Access path missing closing quote: ' + p);\n\n if (j > i) {\n j++;\n push();\n }\n\n return path;\n}\n\nfunction field (field, name, opt) {\n const path = splitAccessPath(field);\n field = path.length === 1 ? path[0] : field;\n return accessor((opt && opt.get || getter)(path), [field], name || field);\n}\n\nconst id = field('id');\nconst identity = accessor(_ => _, [], 'identity');\nconst zero = accessor(() => 0, [], 'zero');\nconst one = accessor(() => 1, [], 'one');\nconst truthy = accessor(() => true, [], 'true');\nconst falsy = accessor(() => false, [], 'false');\n\nfunction log$1(method, level, input) {\n const args = [level].concat([].slice.call(input));\n console[method].apply(console, args); // eslint-disable-line no-console\n}\n\nconst None = 0;\nconst Error$1 = 1;\nconst Warn = 2;\nconst Info = 3;\nconst Debug = 4;\nfunction logger (_, method) {\n let level = _ || None;\n return {\n level(_) {\n if (arguments.length) {\n level = +_;\n return this;\n } else {\n return level;\n }\n },\n\n error() {\n if (level >= Error$1) log$1(method || 'error', 'ERROR', arguments);\n return this;\n },\n\n warn() {\n if (level >= Warn) log$1(method || 'warn', 'WARN', arguments);\n return this;\n },\n\n info() {\n if (level >= Info) log$1(method || 'log', 'INFO', arguments);\n return this;\n },\n\n debug() {\n if (level >= Debug) log$1(method || 'log', 'DEBUG', arguments);\n return this;\n }\n\n };\n}\n\nvar isArray = Array.isArray;\n\nfunction isObject (_) {\n return _ === Object(_);\n}\n\nconst isLegalKey = key => key !== '__proto__';\n\nfunction mergeConfig(...configs) {\n return configs.reduce((out, source) => {\n for (const key in source) {\n if (key === 'signals') {\n // for signals, we merge the signals arrays\n // source signals take precedence over\n // existing signals with the same name\n out.signals = mergeNamed(out.signals, source.signals);\n } else {\n // otherwise, merge objects subject to recursion constraints\n // for legend block, recurse for the layout entry only\n // for style block, recurse for all properties\n // otherwise, no recursion: objects overwrite, no merging\n const r = key === 'legend' ? {\n layout: 1\n } : key === 'style' ? true : null;\n writeConfig(out, key, source[key], r);\n }\n }\n\n return out;\n }, {});\n}\nfunction writeConfig(output, key, value, recurse) {\n if (!isLegalKey(key)) return;\n let k, o;\n\n if (isObject(value) && !isArray(value)) {\n o = isObject(output[key]) ? output[key] : output[key] = {};\n\n for (k in value) {\n if (recurse && (recurse === true || recurse[k])) {\n writeConfig(o, k, value[k]);\n } else if (isLegalKey(k)) {\n o[k] = value[k];\n }\n }\n } else {\n output[key] = value;\n }\n}\n\nfunction mergeNamed(a, b) {\n if (a == null) return b;\n const map = {},\n out = [];\n\n function add(_) {\n if (!map[_.name]) {\n map[_.name] = 1;\n out.push(_);\n }\n }\n\n b.forEach(add);\n a.forEach(add);\n return out;\n}\n\nfunction peek (array) {\n return array[array.length - 1];\n}\n\nfunction toNumber (_) {\n return _ == null || _ === '' ? null : +_;\n}\n\nconst exp = sign => x => sign * Math.exp(x);\n\nconst log = sign => x => Math.log(sign * x);\n\nconst symlog = c => x => Math.sign(x) * Math.log1p(Math.abs(x / c));\n\nconst symexp = c => x => Math.sign(x) * Math.expm1(Math.abs(x)) * c;\n\nconst pow = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n\nfunction pan(domain, delta, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n dd = (d1 - d0) * delta;\n return [ground(d0 - dd), ground(d1 - dd)];\n}\n\nfunction panLinear(domain, delta) {\n return pan(domain, delta, toNumber, identity);\n}\nfunction panLog(domain, delta) {\n var sign = Math.sign(domain[0]);\n return pan(domain, delta, log(sign), exp(sign));\n}\nfunction panPow(domain, delta, exponent) {\n return pan(domain, delta, pow(exponent), pow(1 / exponent));\n}\nfunction panSymlog(domain, delta, constant) {\n return pan(domain, delta, symlog(constant), symexp(constant));\n}\n\nfunction zoom(domain, anchor, scale, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n da = anchor != null ? lift(anchor) : (d0 + d1) / 2;\n return [ground(da + (d0 - da) * scale), ground(da + (d1 - da) * scale)];\n}\n\nfunction zoomLinear(domain, anchor, scale) {\n return zoom(domain, anchor, scale, toNumber, identity);\n}\nfunction zoomLog(domain, anchor, scale) {\n const sign = Math.sign(domain[0]);\n return zoom(domain, anchor, scale, log(sign), exp(sign));\n}\nfunction zoomPow(domain, anchor, scale, exponent) {\n return zoom(domain, anchor, scale, pow(exponent), pow(1 / exponent));\n}\nfunction zoomSymlog(domain, anchor, scale, constant) {\n return zoom(domain, anchor, scale, symlog(constant), symexp(constant));\n}\n\nfunction quarter(date) {\n return 1 + ~~(new Date(date).getMonth() / 3);\n}\nfunction utcquarter(date) {\n return 1 + ~~(new Date(date).getUTCMonth() / 3);\n}\n\nfunction array (_) {\n return _ != null ? isArray(_) ? _ : [_] : [];\n}\n\n/**\n * Span-preserving range clamp. If the span of the input range is less\n * than (max - min) and an endpoint exceeds either the min or max value,\n * the range is translated such that the span is preserved and one\n * endpoint touches the boundary of the min/max range.\n * If the span exceeds (max - min), the range [min, max] is returned.\n */\nfunction clampRange (range, min, max) {\n let lo = range[0],\n hi = range[1],\n span;\n\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n\n span = hi - lo;\n return span >= max - min ? [min, max] : [lo = Math.min(Math.max(lo, min), max - span), lo + span];\n}\n\nfunction isFunction (_) {\n return typeof _ === 'function';\n}\n\nconst DESCENDING = 'descending';\nfunction compare (fields, orders, opt) {\n opt = opt || {};\n orders = array(orders) || [];\n const ord = [],\n get = [],\n fmap = {},\n gen = opt.comparator || comparator;\n array(fields).forEach((f, i) => {\n if (f == null) return;\n ord.push(orders[i] === DESCENDING ? -1 : 1);\n get.push(f = isFunction(f) ? f : field(f, null, opt));\n (accessorFields(f) || []).forEach(_ => fmap[_] = 1);\n });\n return get.length === 0 ? null : accessor(gen(get, ord), Object.keys(fmap));\n}\nconst ascending = (u, v) => (u < v || u == null) && v != null ? -1 : (u > v || v == null) && u != null ? 1 : (v = v instanceof Date ? +v : v, u = u instanceof Date ? +u : u) !== u && v === v ? -1 : v !== v && u === u ? 1 : 0;\n\nconst comparator = (fields, orders) => fields.length === 1 ? compare1(fields[0], orders[0]) : compareN(fields, orders, fields.length);\n\nconst compare1 = (field, order) => function (a, b) {\n return ascending(field(a), field(b)) * order;\n};\n\nconst compareN = (fields, orders, n) => {\n orders.push(0); // pad zero for convenient lookup\n\n return function (a, b) {\n let f,\n c = 0,\n i = -1;\n\n while (c === 0 && ++i < n) {\n f = fields[i];\n c = ascending(f(a), f(b));\n }\n\n return c * orders[i];\n };\n};\n\nfunction constant (_) {\n return isFunction(_) ? _ : () => _;\n}\n\nfunction debounce (delay, handler) {\n let tid;\n return e => {\n if (tid) clearTimeout(tid);\n tid = setTimeout(() => (handler(e), tid = null), delay);\n };\n}\n\nfunction extend (_) {\n for (let x, k, i = 1, len = arguments.length; i < len; ++i) {\n x = arguments[i];\n\n for (k in x) {\n _[k] = x[k];\n }\n }\n\n return _;\n}\n\n/**\n * Return an array with minimum and maximum values, in the\n * form [min, max]. Ignores null, undefined, and NaN values.\n */\nfunction extent (array, f) {\n let i = 0,\n n,\n v,\n min,\n max;\n\n if (array && (n = array.length)) {\n if (f == null) {\n // find first valid value\n for (v = array[i]; i < n && (v == null || v !== v); v = array[++i]);\n\n min = max = v; // visit all other values\n\n for (; i < n; ++i) {\n v = array[i]; // skip null/undefined; NaN will fail all comparisons\n\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n } else {\n // find first valid value\n for (v = f(array[i]); i < n && (v == null || v !== v); v = f(array[++i]));\n\n min = max = v; // visit all other values\n\n for (; i < n; ++i) {\n v = f(array[i]); // skip null/undefined; NaN will fail all comparisons\n\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n }\n }\n\n return [min, max];\n}\n\nfunction extentIndex (array, f) {\n const n = array.length;\n let i = -1,\n a,\n b,\n c,\n u,\n v;\n\n if (f == null) {\n while (++i < n) {\n b = array[i];\n\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n\n if (i === n) return [-1, -1];\n u = v = i;\n\n while (++i < n) {\n b = array[i];\n\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n } else {\n while (++i < n) {\n b = f(array[i], i, array);\n\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n\n if (i === n) return [-1, -1];\n u = v = i;\n\n while (++i < n) {\n b = f(array[i], i, array);\n\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n }\n\n return [u, v];\n}\n\nconst hop = Object.prototype.hasOwnProperty;\nfunction has (object, property) {\n return hop.call(object, property);\n}\n\nconst NULL = {};\nfunction fastmap (input) {\n let obj = {},\n test;\n\n function has$1(key) {\n return has(obj, key) && obj[key] !== NULL;\n }\n\n const map = {\n size: 0,\n empty: 0,\n object: obj,\n has: has$1,\n\n get(key) {\n return has$1(key) ? obj[key] : undefined;\n },\n\n set(key, value) {\n if (!has$1(key)) {\n ++map.size;\n if (obj[key] === NULL) --map.empty;\n }\n\n obj[key] = value;\n return this;\n },\n\n delete(key) {\n if (has$1(key)) {\n --map.size;\n ++map.empty;\n obj[key] = NULL;\n }\n\n return this;\n },\n\n clear() {\n map.size = map.empty = 0;\n map.object = obj = {};\n },\n\n test(_) {\n if (arguments.length) {\n test = _;\n return map;\n } else {\n return test;\n }\n },\n\n clean() {\n const next = {};\n let size = 0;\n\n for (const key in obj) {\n const value = obj[key];\n\n if (value !== NULL && (!test || !test(value))) {\n next[key] = value;\n ++size;\n }\n }\n\n map.size = size;\n map.empty = 0;\n map.object = obj = next;\n }\n\n };\n if (input) Object.keys(input).forEach(key => {\n map.set(key, input[key]);\n });\n return map;\n}\n\nfunction flush (range, value, threshold, left, right, center) {\n if (!threshold && threshold !== 0) return center;\n const t = +threshold;\n let a = range[0],\n b = peek(range),\n l; // swap endpoints if range is reversed\n\n if (b < a) {\n l = a;\n a = b;\n b = l;\n } // compare value to endpoints\n\n\n l = Math.abs(value - a);\n const r = Math.abs(b - value); // adjust if value is within threshold distance of endpoint\n\n return l < r && l <= t ? left : r <= t ? right : center;\n}\n\nfunction inherits (child, parent, members) {\n const proto = child.prototype = Object.create(parent.prototype);\n Object.defineProperty(proto, 'constructor', {\n value: child,\n writable: true,\n enumerable: true,\n configurable: true\n });\n return extend(proto, members);\n}\n\n/**\n * Predicate that returns true if the value lies within the span\n * of the given range. The left and right flags control the use\n * of inclusive (true) or exclusive (false) comparisons.\n */\nfunction inrange (value, range, left, right) {\n let r0 = range[0],\n r1 = range[range.length - 1],\n t;\n\n if (r0 > r1) {\n t = r0;\n r0 = r1;\n r1 = t;\n }\n\n left = left === undefined || left;\n right = right === undefined || right;\n return (left ? r0 <= value : r0 < value) && (right ? value <= r1 : value < r1);\n}\n\nfunction isBoolean (_) {\n return typeof _ === 'boolean';\n}\n\nfunction isDate (_) {\n return Object.prototype.toString.call(_) === '[object Date]';\n}\n\nfunction isIterable (_) {\n return _ && isFunction(_[Symbol.iterator]);\n}\n\nfunction isNumber (_) {\n return typeof _ === 'number';\n}\n\nfunction isRegExp (_) {\n return Object.prototype.toString.call(_) === '[object RegExp]';\n}\n\nfunction isString (_) {\n return typeof _ === 'string';\n}\n\nfunction key (fields, flat, opt) {\n if (fields) {\n fields = flat ? array(fields).map(f => f.replace(/\\\\(.)/g, '$1')) : array(fields);\n }\n\n const len = fields && fields.length,\n gen = opt && opt.get || getter,\n map = f => gen(flat ? [f] : splitAccessPath(f));\n\n let fn;\n\n if (!len) {\n fn = function () {\n return '';\n };\n } else if (len === 1) {\n const get = map(fields[0]);\n\n fn = function (_) {\n return '' + get(_);\n };\n } else {\n const get = fields.map(map);\n\n fn = function (_) {\n let s = '' + get[0](_),\n i = 0;\n\n while (++i < len) s += '|' + get[i](_);\n\n return s;\n };\n }\n\n return accessor(fn, fields, 'key');\n}\n\nfunction lerp (array, frac) {\n const lo = array[0],\n hi = peek(array),\n f = +frac;\n return !f ? lo : f === 1 ? hi : lo + f * (hi - lo);\n}\n\nconst DEFAULT_MAX_SIZE = 10000; // adapted from https://github.com/dominictarr/hashlru/ (MIT License)\n\nfunction lruCache (maxsize) {\n maxsize = +maxsize || DEFAULT_MAX_SIZE;\n let curr, prev, size;\n\n const clear = () => {\n curr = {};\n prev = {};\n size = 0;\n };\n\n const update = (key, value) => {\n if (++size > maxsize) {\n prev = curr;\n curr = {};\n size = 1;\n }\n\n return curr[key] = value;\n };\n\n clear();\n return {\n clear,\n has: key => has(curr, key) || has(prev, key),\n get: key => has(curr, key) ? curr[key] : has(prev, key) ? update(key, prev[key]) : undefined,\n set: (key, value) => has(curr, key) ? curr[key] = value : update(key, value)\n };\n}\n\nfunction merge (compare, array0, array1, output) {\n const n0 = array0.length,\n n1 = array1.length;\n if (!n1) return array0;\n if (!n0) return array1;\n const merged = output || new array0.constructor(n0 + n1);\n let i0 = 0,\n i1 = 0,\n i = 0;\n\n for (; i0 < n0 && i1 < n1; ++i) {\n merged[i] = compare(array0[i0], array1[i1]) > 0 ? array1[i1++] : array0[i0++];\n }\n\n for (; i0 < n0; ++i0, ++i) {\n merged[i] = array0[i0];\n }\n\n for (; i1 < n1; ++i1, ++i) {\n merged[i] = array1[i1];\n }\n\n return merged;\n}\n\nfunction repeat (str, reps) {\n let s = '';\n\n while (--reps >= 0) s += str;\n\n return s;\n}\n\nfunction pad (str, length, padchar, align) {\n const c = padchar || ' ',\n s = str + '',\n n = length - s.length;\n return n <= 0 ? s : align === 'left' ? repeat(c, n) + s : align === 'center' ? repeat(c, ~~(n / 2)) + s + repeat(c, Math.ceil(n / 2)) : s + repeat(c, n);\n}\n\n/**\n * Return the numerical span of an array: the difference between\n * the last and first values.\n */\n\nfunction span (array) {\n return array && peek(array) - array[0] || 0;\n}\n\nfunction $(x) {\n return isArray(x) ? '[' + x.map($) + ']' : isObject(x) || isString(x) ? // Output valid JSON and JS source strings.\n // See http://timelessrepo.com/json-isnt-a-javascript-subset\n JSON.stringify(x).replace('\\u2028', '\\\\u2028').replace('\\u2029', '\\\\u2029') : x;\n}\n\nfunction toBoolean (_) {\n return _ == null || _ === '' ? null : !_ || _ === 'false' || _ === '0' ? false : !!_;\n}\n\nconst defaultParser = _ => isNumber(_) ? _ : isDate(_) ? _ : Date.parse(_);\n\nfunction toDate (_, parser) {\n parser = parser || defaultParser;\n return _ == null || _ === '' ? null : parser(_);\n}\n\nfunction toString (_) {\n return _ == null || _ === '' ? null : _ + '';\n}\n\nfunction toSet (_) {\n const s = {},\n n = _.length;\n\n for (let i = 0; i < n; ++i) s[_[i]] = true;\n\n return s;\n}\n\nfunction truncate (str, length, align, ellipsis) {\n const e = ellipsis != null ? ellipsis : '\\u2026',\n s = str + '',\n n = s.length,\n l = Math.max(0, length - e.length);\n return n <= length ? s : align === 'left' ? e + s.slice(n - l) : align === 'center' ? s.slice(0, Math.ceil(l / 2)) + e + s.slice(n - ~~(l / 2)) : s.slice(0, l) + e;\n}\n\nfunction visitArray (array, filter, visitor) {\n if (array) {\n if (filter) {\n const n = array.length;\n\n for (let i = 0; i < n; ++i) {\n const t = filter(array[i]);\n if (t) visitor(t, i, array);\n }\n } else {\n array.forEach(visitor);\n }\n }\n}\n\nexport { Debug, Error$1 as Error, Info, None, Warn, accessor, accessorFields, accessorName, array, ascending, clampRange, compare, constant, debounce, error, extend, extent, extentIndex, falsy, fastmap, field, flush, has as hasOwnProperty, id, identity, inherits, inrange, isArray, isBoolean, isDate, isFunction, isIterable, isNumber, isObject, isRegExp, isString, key, lerp, logger, lruCache, merge, mergeConfig, one, pad, panLinear, panLog, panPow, panSymlog, peek, quarter, repeat, span, splitAccessPath, $ as stringValue, toBoolean, toDate, toNumber, toSet, toString, truncate, truthy, utcquarter, visitArray, writeConfig, zero, zoomLinear, zoomLog, zoomPow, zoomSymlog };\n","Array.prototype.flat||Object.defineProperty(Array.prototype,\"flat\",{configurable:!0,value:function r(){var t=isNaN(arguments[0])?1:Number(arguments[0]);return t?Array.prototype.reduce.call(this,function(a,e){return Array.isArray(e)?a.push.apply(a,r.call(e,t-1)):a.push(e),a},[]):Array.prototype.slice.call(this)},writable:!0}),Array.prototype.flatMap||Object.defineProperty(Array.prototype,\"flatMap\",{configurable:!0,value:function(r){return Array.prototype.map.apply(this,arguments).flat()},writable:!0})\n","export function isLogicalOr(op) {\n return !!op.or;\n}\nexport function isLogicalAnd(op) {\n return !!op.and;\n}\nexport function isLogicalNot(op) {\n return !!op.not;\n}\nexport function forEachLeaf(op, fn) {\n if (isLogicalNot(op)) {\n forEachLeaf(op.not, fn);\n }\n else if (isLogicalAnd(op)) {\n for (const subop of op.and) {\n forEachLeaf(subop, fn);\n }\n }\n else if (isLogicalOr(op)) {\n for (const subop of op.or) {\n forEachLeaf(subop, fn);\n }\n }\n else {\n fn(op);\n }\n}\nexport function normalizeLogicalComposition(op, normalizer) {\n if (isLogicalNot(op)) {\n return { not: normalizeLogicalComposition(op.not, normalizer) };\n }\n else if (isLogicalAnd(op)) {\n return { and: op.and.map(o => normalizeLogicalComposition(o, normalizer)) };\n }\n else if (isLogicalOr(op)) {\n return { or: op.or.map(o => normalizeLogicalComposition(o, normalizer)) };\n }\n else {\n return normalizer(op);\n }\n}\n//# sourceMappingURL=logical.js.map","import 'array-flat-polyfill';\nimport { default as clone_ } from 'clone';\nimport deepEqual_ from 'fast-deep-equal';\nimport stableStringify from 'fast-json-stable-stringify';\nimport { hasOwnProperty, isNumber, isString, splitAccessPath, stringValue, writeConfig } from 'vega-util';\nimport { isLogicalAnd, isLogicalNot, isLogicalOr } from './logical';\nexport const deepEqual = deepEqual_;\nexport const duplicate = clone_;\n/**\n * Creates an object composed of the picked object properties.\n *\n * var object = {'a': 1, 'b': '2', 'c': 3};\n * pick(object, ['a', 'c']);\n * // → {'a': 1, 'c': 3}\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function pick(obj, props) {\n const copy = {};\n for (const prop of props) {\n if (hasOwnProperty(obj, prop)) {\n copy[prop] = obj[prop];\n }\n }\n return copy;\n}\n/**\n * The opposite of _.pick; this method creates an object composed of the own\n * and inherited enumerable string keyed properties of object that are not omitted.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function omit(obj, props) {\n const copy = Object.assign({}, obj);\n for (const prop of props) {\n delete copy[prop];\n }\n return copy;\n}\n/**\n * Monkey patch Set so that `stringify` produces a string representation of sets.\n */\nSet.prototype['toJSON'] = function () {\n return `Set(${[...this].map(x => stableStringify(x)).join(',')})`;\n};\n/**\n * Converts any object to a string representation that can be consumed by humans.\n */\nexport const stringify = stableStringify;\n/**\n * Converts any object to a string of limited size, or a number.\n */\nexport function hash(a) {\n if (isNumber(a)) {\n return a;\n }\n const str = isString(a) ? a : stableStringify(a);\n // short strings can be used as hash directly, longer strings are hashed to reduce memory usage\n if (str.length < 250) {\n return str;\n }\n // from http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/\n let h = 0;\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i);\n h = (h << 5) - h + char;\n h = h & h; // Convert to 32bit integer\n }\n return h;\n}\nexport function isNullOrFalse(x) {\n return x === false || x === null;\n}\nexport function contains(array, item) {\n return array.indexOf(item) > -1;\n}\n/**\n * Returns true if any item returns true.\n */\nexport function some(arr, f) {\n let i = 0;\n for (const [k, a] of arr.entries()) {\n if (f(a, k, i++)) {\n return true;\n }\n }\n return false;\n}\n/**\n * Returns true if all items return true.\n */\nexport function every(arr, f) {\n let i = 0;\n for (const [k, a] of arr.entries()) {\n if (!f(a, k, i++)) {\n return false;\n }\n }\n return true;\n}\n/**\n * recursively merges src into dest\n */\nexport function mergeDeep(dest, ...src) {\n for (const s of src) {\n deepMerge_(dest, s !== null && s !== void 0 ? s : {});\n }\n return dest;\n}\nfunction deepMerge_(dest, src) {\n for (const property of keys(src)) {\n writeConfig(dest, property, src[property], true);\n }\n}\nexport function unique(values, f) {\n const results = [];\n const u = {};\n let v;\n for (const val of values) {\n v = f(val);\n if (v in u) {\n continue;\n }\n u[v] = 1;\n results.push(val);\n }\n return results;\n}\n/**\n * Returns true if the two dictionaries disagree. Applies only to defined values.\n */\nexport function isEqual(dict, other) {\n const dictKeys = keys(dict);\n const otherKeys = keys(other);\n if (dictKeys.length !== otherKeys.length) {\n return false;\n }\n for (const key of dictKeys) {\n if (dict[key] !== other[key]) {\n return false;\n }\n }\n return true;\n}\nexport function setEqual(a, b) {\n if (a.size !== b.size) {\n return false;\n }\n for (const e of a) {\n if (!b.has(e)) {\n return false;\n }\n }\n return true;\n}\nexport function hasIntersection(a, b) {\n for (const key of a) {\n if (b.has(key)) {\n return true;\n }\n }\n return false;\n}\nexport function prefixGenerator(a) {\n const prefixes = new Set();\n for (const x of a) {\n const splitField = splitAccessPath(x);\n // Wrap every element other than the first in `[]`\n const wrappedWithAccessors = splitField.map((y, i) => (i === 0 ? y : `[${y}]`));\n const computedPrefixes = wrappedWithAccessors.map((_, i) => wrappedWithAccessors.slice(0, i + 1).join(''));\n for (const y of computedPrefixes) {\n prefixes.add(y);\n }\n }\n return prefixes;\n}\n/**\n * Returns true if a and b have an intersection. Also return true if a or b are undefined\n * since this means we don't know what fields a node produces or depends on.\n */\nexport function fieldIntersection(a, b) {\n if (a === undefined || b === undefined) {\n return true;\n }\n return hasIntersection(prefixGenerator(a), prefixGenerator(b));\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function isEmpty(obj) {\n return keys(obj).length === 0;\n}\n// This is a stricter version of Object.keys but with better types. See https://github.com/Microsoft/TypeScript/pull/12253#issuecomment-263132208\nexport const keys = Object.keys;\nexport const vals = Object.values;\nexport const entries = Object.entries;\nexport function isBoolean(b) {\n return b === true || b === false;\n}\n/**\n * Convert a string into a valid variable name\n */\nexport function varName(s) {\n // Replace non-alphanumeric characters (anything besides a-zA-Z0-9_) with _\n const alphanumericS = s.replace(/\\W/g, '_');\n // Add _ if the string has leading numbers.\n return (s.match(/^\\d+/) ? '_' : '') + alphanumericS;\n}\nexport function logicalExpr(op, cb) {\n if (isLogicalNot(op)) {\n return '!(' + logicalExpr(op.not, cb) + ')';\n }\n else if (isLogicalAnd(op)) {\n return '(' + op.and.map((and) => logicalExpr(and, cb)).join(') && (') + ')';\n }\n else if (isLogicalOr(op)) {\n return '(' + op.or.map((or) => logicalExpr(or, cb)).join(') || (') + ')';\n }\n else {\n return cb(op);\n }\n}\n/**\n * Delete nested property of an object, and delete the ancestors of the property if they become empty.\n */\nexport function deleteNestedProperty(obj, orderedProps) {\n if (orderedProps.length === 0) {\n return true;\n }\n const prop = orderedProps.shift(); // eslint-disable-line @typescript-eslint/no-non-null-assertion\n if (prop in obj && deleteNestedProperty(obj[prop], orderedProps)) {\n delete obj[prop];\n }\n return isEmpty(obj);\n}\nexport function titleCase(s) {\n return s.charAt(0).toUpperCase() + s.substr(1);\n}\n/**\n * Converts a path to an access path with datum.\n * @param path The field name.\n * @param datum The string to use for `datum`.\n */\nexport function accessPathWithDatum(path, datum = 'datum') {\n const pieces = splitAccessPath(path);\n const prefixes = [];\n for (let i = 1; i <= pieces.length; i++) {\n const prefix = `[${pieces.slice(0, i).map(stringValue).join('][')}]`;\n prefixes.push(`${datum}${prefix}`);\n }\n return prefixes.join(' && ');\n}\n/**\n * Return access with datum to the flattened field.\n *\n * @param path The field name.\n * @param datum The string to use for `datum`.\n */\nexport function flatAccessWithDatum(path, datum = 'datum') {\n return `${datum}[${stringValue(splitAccessPath(path).join('.'))}]`;\n}\nfunction escapePathAccess(string) {\n return string.replace(/(\\[|\\]|\\.|'|\")/g, '\\\\$1');\n}\n/**\n * Replaces path accesses with access to non-nested field.\n * For example, `foo[\"bar\"].baz` becomes `foo\\\\.bar\\\\.baz`.\n */\nexport function replacePathInField(path) {\n return `${splitAccessPath(path).map(escapePathAccess).join('\\\\.')}`;\n}\n/**\n * Replace all occurrences of a string with another string.\n *\n * @param string the string to replace in\n * @param find the string to replace\n * @param replacement the replacement\n */\nexport function replaceAll(string, find, replacement) {\n return string.replace(new RegExp(find.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'g'), replacement);\n}\n/**\n * Remove path accesses with access from field.\n * For example, `foo[\"bar\"].baz` becomes `foo.bar.baz`.\n */\nexport function removePathFromField(path) {\n return `${splitAccessPath(path).join('.')}`;\n}\n/**\n * Count the depth of the path. Returns 1 for fields that are not nested.\n */\nexport function accessPathDepth(path) {\n if (!path) {\n return 0;\n }\n return splitAccessPath(path).length;\n}\n/**\n * This is a replacement for chained || for numeric properties or properties that respect null so that 0 will be included.\n */\nexport function getFirstDefined(...args) {\n for (const arg of args) {\n if (arg !== undefined) {\n return arg;\n }\n }\n return undefined;\n}\n// variable used to generate id\nlet idCounter = 42;\n/**\n * Returns a new random id every time it gets called.\n *\n * Has side effect!\n */\nexport function uniqueId(prefix) {\n const id = ++idCounter;\n return prefix ? String(prefix) + id : id;\n}\n/**\n * Resets the id counter used in uniqueId. This can be useful for testing.\n */\nexport function resetIdCounter() {\n idCounter = 42;\n}\nexport function internalField(name) {\n return isInternalField(name) ? name : `__${name}`;\n}\nexport function isInternalField(name) {\n return name.indexOf('__') === 0;\n}\n/**\n * Normalize angle to be within [0,360).\n */\nexport function normalizeAngle(angle) {\n if (angle === undefined) {\n return undefined;\n }\n return ((angle % 360) + 360) % 360;\n}\n/**\n * Returns whether the passed in value is a valid number.\n */\nexport function isNumeric(value) {\n if (isNumber(value)) {\n return true;\n }\n return !isNaN(value) && !isNaN(parseFloat(value));\n}\n//# sourceMappingURL=util.js.map","import { keys } from './util';\nexport const CONDITIONAL_AXIS_PROP_INDEX = {\n labelAlign: {\n part: 'labels',\n vgProp: 'align'\n },\n labelBaseline: {\n part: 'labels',\n vgProp: 'baseline'\n },\n labelColor: {\n part: 'labels',\n vgProp: 'fill'\n },\n labelFont: {\n part: 'labels',\n vgProp: 'font'\n },\n labelFontSize: {\n part: 'labels',\n vgProp: 'fontSize'\n },\n labelFontStyle: {\n part: 'labels',\n vgProp: 'fontStyle'\n },\n labelFontWeight: {\n part: 'labels',\n vgProp: 'fontWeight'\n },\n labelOpacity: {\n part: 'labels',\n vgProp: 'opacity'\n },\n labelOffset: null,\n labelPadding: null,\n gridColor: {\n part: 'grid',\n vgProp: 'stroke'\n },\n gridDash: {\n part: 'grid',\n vgProp: 'strokeDash'\n },\n gridDashOffset: {\n part: 'grid',\n vgProp: 'strokeDashOffset'\n },\n gridOpacity: {\n part: 'grid',\n vgProp: 'opacity'\n },\n gridWidth: {\n part: 'grid',\n vgProp: 'strokeWidth'\n },\n tickColor: {\n part: 'ticks',\n vgProp: 'stroke'\n },\n tickDash: {\n part: 'ticks',\n vgProp: 'strokeDash'\n },\n tickDashOffset: {\n part: 'ticks',\n vgProp: 'strokeDashOffset'\n },\n tickOpacity: {\n part: 'ticks',\n vgProp: 'opacity'\n },\n tickSize: null,\n tickWidth: {\n part: 'ticks',\n vgProp: 'strokeWidth'\n }\n};\nexport function isConditionalAxisValue(v) {\n return v && v['condition'];\n}\nexport const AXIS_PARTS = ['domain', 'grid', 'labels', 'ticks', 'title'];\n/**\n * A dictionary listing whether a certain axis property is applicable for only main axes or only grid axes.\n */\nexport const AXIS_PROPERTY_TYPE = {\n grid: 'grid',\n gridCap: 'grid',\n gridColor: 'grid',\n gridDash: 'grid',\n gridDashOffset: 'grid',\n gridOpacity: 'grid',\n gridScale: 'grid',\n gridWidth: 'grid',\n orient: 'main',\n bandPosition: 'both',\n aria: 'main',\n description: 'main',\n domain: 'main',\n domainCap: 'main',\n domainColor: 'main',\n domainDash: 'main',\n domainDashOffset: 'main',\n domainOpacity: 'main',\n domainWidth: 'main',\n format: 'main',\n formatType: 'main',\n labelAlign: 'main',\n labelAngle: 'main',\n labelBaseline: 'main',\n labelBound: 'main',\n labelColor: 'main',\n labelFlush: 'main',\n labelFlushOffset: 'main',\n labelFont: 'main',\n labelFontSize: 'main',\n labelFontStyle: 'main',\n labelFontWeight: 'main',\n labelLimit: 'main',\n labelLineHeight: 'main',\n labelOffset: 'main',\n labelOpacity: 'main',\n labelOverlap: 'main',\n labelPadding: 'main',\n labels: 'main',\n labelSeparation: 'main',\n maxExtent: 'main',\n minExtent: 'main',\n offset: 'both',\n position: 'main',\n tickCap: 'main',\n tickColor: 'main',\n tickDash: 'main',\n tickDashOffset: 'main',\n tickMinStep: 'main',\n tickOffset: 'both',\n tickOpacity: 'main',\n tickRound: 'both',\n ticks: 'main',\n tickSize: 'main',\n tickWidth: 'both',\n title: 'main',\n titleAlign: 'main',\n titleAnchor: 'main',\n titleAngle: 'main',\n titleBaseline: 'main',\n titleColor: 'main',\n titleFont: 'main',\n titleFontSize: 'main',\n titleFontStyle: 'main',\n titleFontWeight: 'main',\n titleLimit: 'main',\n titleLineHeight: 'main',\n titleOpacity: 'main',\n titlePadding: 'main',\n titleX: 'main',\n titleY: 'main',\n encode: 'both',\n scale: 'both',\n tickBand: 'both',\n tickCount: 'both',\n tickExtra: 'both',\n translate: 'both',\n values: 'both',\n zindex: 'both' // this is actually set afterward, so it doesn't matter\n};\nexport const COMMON_AXIS_PROPERTIES_INDEX = {\n orient: 1,\n aria: 1,\n bandPosition: 1,\n description: 1,\n domain: 1,\n domainCap: 1,\n domainColor: 1,\n domainDash: 1,\n domainDashOffset: 1,\n domainOpacity: 1,\n domainWidth: 1,\n format: 1,\n formatType: 1,\n grid: 1,\n gridCap: 1,\n gridColor: 1,\n gridDash: 1,\n gridDashOffset: 1,\n gridOpacity: 1,\n gridWidth: 1,\n labelAlign: 1,\n labelAngle: 1,\n labelBaseline: 1,\n labelBound: 1,\n labelColor: 1,\n labelFlush: 1,\n labelFlushOffset: 1,\n labelFont: 1,\n labelFontSize: 1,\n labelFontStyle: 1,\n labelFontWeight: 1,\n labelLimit: 1,\n labelLineHeight: 1,\n labelOffset: 1,\n labelOpacity: 1,\n labelOverlap: 1,\n labelPadding: 1,\n labels: 1,\n labelSeparation: 1,\n maxExtent: 1,\n minExtent: 1,\n offset: 1,\n position: 1,\n tickBand: 1,\n tickCap: 1,\n tickColor: 1,\n tickCount: 1,\n tickDash: 1,\n tickDashOffset: 1,\n tickExtra: 1,\n tickMinStep: 1,\n tickOffset: 1,\n tickOpacity: 1,\n tickRound: 1,\n ticks: 1,\n tickSize: 1,\n tickWidth: 1,\n title: 1,\n titleAlign: 1,\n titleAnchor: 1,\n titleAngle: 1,\n titleBaseline: 1,\n titleColor: 1,\n titleFont: 1,\n titleFontSize: 1,\n titleFontStyle: 1,\n titleFontWeight: 1,\n titleLimit: 1,\n titleLineHeight: 1,\n titleOpacity: 1,\n titlePadding: 1,\n titleX: 1,\n titleY: 1,\n translate: 1,\n values: 1,\n zindex: 1\n};\nconst AXIS_PROPERTIES_INDEX = Object.assign(Object.assign({}, COMMON_AXIS_PROPERTIES_INDEX), { style: 1, labelExpr: 1, encoding: 1 });\nexport function isAxisProperty(prop) {\n return !!AXIS_PROPERTIES_INDEX[prop];\n}\n// Export for dependent projects\nexport const AXIS_PROPERTIES = keys(AXIS_PROPERTIES_INDEX);\nconst AXIS_CONFIGS_INDEX = {\n axis: 1,\n axisBand: 1,\n axisBottom: 1,\n axisDiscrete: 1,\n axisLeft: 1,\n axisPoint: 1,\n axisQuantitative: 1,\n axisRight: 1,\n axisTemporal: 1,\n axisTop: 1,\n axisX: 1,\n axisXBand: 1,\n axisXDiscrete: 1,\n axisXPoint: 1,\n axisXQuantitative: 1,\n axisXTemporal: 1,\n axisY: 1,\n axisYBand: 1,\n axisYDiscrete: 1,\n axisYPoint: 1,\n axisYQuantitative: 1,\n axisYTemporal: 1\n};\nexport const AXIS_CONFIGS = keys(AXIS_CONFIGS_INDEX);\n//# sourceMappingURL=axis.js.map","import { isString, toSet } from 'vega-util';\nimport { contains, keys } from './util';\nconst AGGREGATE_OP_INDEX = {\n argmax: 1,\n argmin: 1,\n average: 1,\n count: 1,\n distinct: 1,\n product: 1,\n max: 1,\n mean: 1,\n median: 1,\n min: 1,\n missing: 1,\n q1: 1,\n q3: 1,\n ci0: 1,\n ci1: 1,\n stderr: 1,\n stdev: 1,\n stdevp: 1,\n sum: 1,\n valid: 1,\n values: 1,\n variance: 1,\n variancep: 1\n};\nexport const MULTIDOMAIN_SORT_OP_INDEX = {\n count: 1,\n min: 1,\n max: 1\n};\nexport function isArgminDef(a) {\n return !!a && !!a['argmin'];\n}\nexport function isArgmaxDef(a) {\n return !!a && !!a['argmax'];\n}\nexport const AGGREGATE_OPS = keys(AGGREGATE_OP_INDEX);\nexport function isAggregateOp(a) {\n return isString(a) && !!AGGREGATE_OP_INDEX[a];\n}\nexport const COUNTING_OPS = ['count', 'valid', 'missing', 'distinct'];\nexport function isCountingAggregateOp(aggregate) {\n return isString(aggregate) && contains(COUNTING_OPS, aggregate);\n}\nexport function isMinMaxOp(aggregate) {\n return isString(aggregate) && contains(['min', 'max'], aggregate);\n}\n/** Additive-based aggregation operations. These can be applied to stack. */\nexport const SUM_OPS = ['count', 'sum', 'distinct', 'valid', 'missing'];\n/**\n * Aggregation operators that always produce values within the range [domainMin, domainMax].\n */\nexport const SHARED_DOMAIN_OPS = ['mean', 'average', 'median', 'q1', 'q3', 'min', 'max'];\nexport const SHARED_DOMAIN_OP_INDEX = toSet(SHARED_DOMAIN_OPS);\n//# sourceMappingURL=aggregate.js.map","/*\n * Constants and utilities for encoding channels (Visual variables)\n * such as 'x', 'y', 'color'.\n */\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { keys } from './util';\n// Facet\nexport const ROW = 'row';\nexport const COLUMN = 'column';\nexport const FACET = 'facet';\n// Position\nexport const X = 'x';\nexport const Y = 'y';\nexport const X2 = 'x2';\nexport const Y2 = 'y2';\n// Arc-Position\nexport const RADIUS = 'radius';\nexport const RADIUS2 = 'radius2';\nexport const THETA = 'theta';\nexport const THETA2 = 'theta2';\n// Geo Position\nexport const LATITUDE = 'latitude';\nexport const LONGITUDE = 'longitude';\nexport const LATITUDE2 = 'latitude2';\nexport const LONGITUDE2 = 'longitude2';\n// Mark property with scale\nexport const COLOR = 'color';\nexport const FILL = 'fill';\nexport const STROKE = 'stroke';\nexport const SHAPE = 'shape';\nexport const SIZE = 'size';\nexport const ANGLE = 'angle';\nexport const OPACITY = 'opacity';\nexport const FILLOPACITY = 'fillOpacity';\nexport const STROKEOPACITY = 'strokeOpacity';\nexport const STROKEWIDTH = 'strokeWidth';\nexport const STROKEDASH = 'strokeDash';\n// Non-scale channel\nexport const TEXT = 'text';\nexport const ORDER = 'order';\nexport const DETAIL = 'detail';\nexport const KEY = 'key';\nexport const TOOLTIP = 'tooltip';\nexport const HREF = 'href';\nexport const URL = 'url';\nexport const DESCRIPTION = 'description';\nconst POSITION_CHANNEL_INDEX = {\n x: 1,\n y: 1,\n x2: 1,\n y2: 1\n};\nconst POLAR_POSITION_CHANNEL_INDEX = {\n theta: 1,\n theta2: 1,\n radius: 1,\n radius2: 1\n};\nexport function isPolarPositionChannel(c) {\n return c in POLAR_POSITION_CHANNEL_INDEX;\n}\nconst GEO_POSIITON_CHANNEL_INDEX = {\n longitude: 1,\n longitude2: 1,\n latitude: 1,\n latitude2: 1\n};\nexport function getPositionChannelFromLatLong(channel) {\n switch (channel) {\n case LATITUDE:\n return 'y';\n case LATITUDE2:\n return 'y2';\n case LONGITUDE:\n return 'x';\n case LONGITUDE2:\n return 'x2';\n }\n}\nexport function isGeoPositionChannel(c) {\n return c in GEO_POSIITON_CHANNEL_INDEX;\n}\nexport const GEOPOSITION_CHANNELS = keys(GEO_POSIITON_CHANNEL_INDEX);\nconst UNIT_CHANNEL_INDEX = Object.assign(Object.assign(Object.assign(Object.assign({}, POSITION_CHANNEL_INDEX), POLAR_POSITION_CHANNEL_INDEX), GEO_POSIITON_CHANNEL_INDEX), { \n // color\n color: 1, fill: 1, stroke: 1, \n // other non-position with scale\n opacity: 1, fillOpacity: 1, strokeOpacity: 1, strokeWidth: 1, strokeDash: 1, size: 1, angle: 1, shape: 1, \n // channels without scales\n order: 1, text: 1, detail: 1, key: 1, tooltip: 1, href: 1, url: 1, description: 1 });\nexport function isColorChannel(channel) {\n return channel === COLOR || channel === FILL || channel === STROKE;\n}\nconst FACET_CHANNEL_INDEX = {\n row: 1,\n column: 1,\n facet: 1\n};\nexport const FACET_CHANNELS = keys(FACET_CHANNEL_INDEX);\nconst CHANNEL_INDEX = Object.assign(Object.assign({}, UNIT_CHANNEL_INDEX), FACET_CHANNEL_INDEX);\nexport const CHANNELS = keys(CHANNEL_INDEX);\nconst { order: _o, detail: _d, tooltip: _tt1 } = CHANNEL_INDEX, SINGLE_DEF_CHANNEL_INDEX = __rest(CHANNEL_INDEX, [\"order\", \"detail\", \"tooltip\"]);\nconst { row: _r, column: _c, facet: _f } = SINGLE_DEF_CHANNEL_INDEX, SINGLE_DEF_UNIT_CHANNEL_INDEX = __rest(SINGLE_DEF_CHANNEL_INDEX, [\"row\", \"column\", \"facet\"]);\n/**\n * Channels that cannot have an array of channelDef.\n * model.fieldDef, getFieldDef only work for these channels.\n *\n * (The only two channels that can have an array of channelDefs are \"detail\" and \"order\".\n * Since there can be multiple fieldDefs for detail and order, getFieldDef/model.fieldDef\n * are not applicable for them. Similarly, selection projection won't work with \"detail\" and \"order\".)\n */\nexport const SINGLE_DEF_CHANNELS = keys(SINGLE_DEF_CHANNEL_INDEX);\nexport const SINGLE_DEF_UNIT_CHANNELS = keys(SINGLE_DEF_UNIT_CHANNEL_INDEX);\nexport function isSingleDefUnitChannel(str) {\n return !!SINGLE_DEF_UNIT_CHANNEL_INDEX[str];\n}\nexport function isChannel(str) {\n return !!CHANNEL_INDEX[str];\n}\nexport const SECONDARY_RANGE_CHANNEL = [X2, Y2, LATITUDE2, LONGITUDE2, THETA2, RADIUS2];\nexport function isSecondaryRangeChannel(c) {\n const main = getMainRangeChannel(c);\n return main !== c;\n}\n/**\n * Get the main channel for a range channel. E.g. `x` for `x2`.\n */\nexport function getMainRangeChannel(channel) {\n switch (channel) {\n case X2:\n return X;\n case Y2:\n return Y;\n case LATITUDE2:\n return LATITUDE;\n case LONGITUDE2:\n return LONGITUDE;\n case THETA2:\n return THETA;\n case RADIUS2:\n return RADIUS;\n }\n return channel;\n}\nexport function getVgPositionChannel(channel) {\n if (isPolarPositionChannel(channel)) {\n switch (channel) {\n case THETA:\n return 'startAngle';\n case THETA2:\n return 'endAngle';\n case RADIUS:\n return 'outerRadius';\n case RADIUS2:\n return 'innerRadius';\n }\n }\n return channel;\n}\n/**\n * Get the main channel for a range channel. E.g. `x` for `x2`.\n */\nexport function getSecondaryRangeChannel(channel) {\n switch (channel) {\n case X:\n return X2;\n case Y:\n return Y2;\n case LATITUDE:\n return LATITUDE2;\n case LONGITUDE:\n return LONGITUDE2;\n case THETA:\n return THETA2;\n case RADIUS:\n return RADIUS2;\n }\n return undefined;\n}\nexport function getSizeChannel(channel) {\n switch (channel) {\n case X:\n case X2:\n return 'width';\n case Y:\n case Y2:\n return 'height';\n }\n return undefined;\n}\n/**\n * Get the main channel for a range channel. E.g. `x` for `x2`.\n */\nexport function getOffsetChannel(channel) {\n switch (channel) {\n case X:\n return 'xOffset';\n case Y:\n return 'yOffset';\n case X2:\n return 'x2Offset';\n case Y2:\n return 'y2Offset';\n case THETA:\n return 'thetaOffset';\n case RADIUS:\n return 'radiusOffset';\n case THETA2:\n return 'theta2Offset';\n case RADIUS2:\n return 'radius2Offset';\n }\n return undefined;\n}\n// CHANNELS without COLUMN, ROW\nexport const UNIT_CHANNELS = keys(UNIT_CHANNEL_INDEX);\n// NONPOSITION_CHANNELS = UNIT_CHANNELS without X, Y, X2, Y2;\nconst { x: _x, y: _y, \n// x2 and y2 share the same scale as x and y\nx2: _x2, y2: _y2, latitude: _latitude, longitude: _longitude, latitude2: _latitude2, longitude2: _longitude2, theta: _theta, theta2: _theta2, radius: _radius, radius2: _radius2 } = UNIT_CHANNEL_INDEX, \n// The rest of unit channels then have scale\nNONPOSITION_CHANNEL_INDEX = __rest(UNIT_CHANNEL_INDEX, [\"x\", \"y\", \"x2\", \"y2\", \"latitude\", \"longitude\", \"latitude2\", \"longitude2\", \"theta\", \"theta2\", \"radius\", \"radius2\"]);\nexport const NONPOSITION_CHANNELS = keys(NONPOSITION_CHANNEL_INDEX);\nexport const POSITION_SCALE_CHANNEL_INDEX = {\n x: 1,\n y: 1\n};\nexport const POSITION_SCALE_CHANNELS = keys(POSITION_SCALE_CHANNEL_INDEX);\nexport function isXorY(channel) {\n return channel in POSITION_SCALE_CHANNEL_INDEX;\n}\nexport const POLAR_POSITION_SCALE_CHANNEL_INDEX = {\n theta: 1,\n radius: 1\n};\nexport const POLAR_POSITION_SCALE_CHANNELS = keys(POLAR_POSITION_SCALE_CHANNEL_INDEX);\nexport function getPositionScaleChannel(sizeType) {\n return sizeType === 'width' ? X : Y;\n}\n// NON_POSITION_SCALE_CHANNEL = SCALE_CHANNELS without X, Y\nconst { \n// x2 and y2 share the same scale as x and y\n// text and tooltip have format instead of scale,\n// href has neither format, nor scale\ntext: _t, tooltip: _tt, href: _hr, url: _u, description: _al, \n// detail and order have no scale\ndetail: _dd, key: _k, order: _oo } = NONPOSITION_CHANNEL_INDEX, NONPOSITION_SCALE_CHANNEL_INDEX = __rest(NONPOSITION_CHANNEL_INDEX, [\"text\", \"tooltip\", \"href\", \"url\", \"description\", \"detail\", \"key\", \"order\"]);\nexport const NONPOSITION_SCALE_CHANNELS = keys(NONPOSITION_SCALE_CHANNEL_INDEX);\nexport function isNonPositionScaleChannel(channel) {\n return !!NONPOSITION_CHANNEL_INDEX[channel];\n}\n/**\n * @returns whether Vega supports legends for a particular channel\n */\nexport function supportLegend(channel) {\n switch (channel) {\n case COLOR:\n case FILL:\n case STROKE:\n case SIZE:\n case SHAPE:\n case OPACITY:\n case STROKEWIDTH:\n case STROKEDASH:\n return true;\n case FILLOPACITY:\n case STROKEOPACITY:\n case ANGLE:\n return false;\n }\n}\n// Declare SCALE_CHANNEL_INDEX\nconst SCALE_CHANNEL_INDEX = Object.assign(Object.assign(Object.assign({}, POSITION_SCALE_CHANNEL_INDEX), POLAR_POSITION_SCALE_CHANNEL_INDEX), NONPOSITION_SCALE_CHANNEL_INDEX);\n/** List of channels with scales */\nexport const SCALE_CHANNELS = keys(SCALE_CHANNEL_INDEX);\nexport function isScaleChannel(channel) {\n return !!SCALE_CHANNEL_INDEX[channel];\n}\n/**\n * Return whether a channel supports a particular mark type.\n * @param channel channel name\n * @param mark the mark type\n * @return whether the mark supports the channel\n */\nexport function supportMark(channel, mark) {\n return getSupportedMark(channel)[mark];\n}\nconst ALL_MARKS = {\n // all marks\n arc: 'always',\n area: 'always',\n bar: 'always',\n circle: 'always',\n geoshape: 'always',\n image: 'always',\n line: 'always',\n rule: 'always',\n point: 'always',\n rect: 'always',\n square: 'always',\n trail: 'always',\n text: 'always',\n tick: 'always'\n};\nconst { geoshape: _g } = ALL_MARKS, ALL_MARKS_EXCEPT_GEOSHAPE = __rest(ALL_MARKS, [\"geoshape\"]);\n/**\n * Return a dictionary showing whether a channel supports mark type.\n * @param channel\n * @return A dictionary mapping mark types to 'always', 'binned', or undefined\n */\nfunction getSupportedMark(channel) {\n switch (channel) {\n case COLOR:\n case FILL:\n case STROKE:\n // falls through\n case DESCRIPTION:\n case DETAIL:\n case KEY:\n case TOOLTIP:\n case HREF:\n case ORDER: // TODO: revise (order might not support rect, which is not stackable?)\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n case STROKEWIDTH:\n // falls through\n case FACET:\n case ROW: // falls through\n case COLUMN:\n return ALL_MARKS;\n case X:\n case Y:\n case LATITUDE:\n case LONGITUDE:\n // all marks except geoshape. geoshape does not use X, Y -- it uses a projection\n return ALL_MARKS_EXCEPT_GEOSHAPE;\n case X2:\n case Y2:\n case LATITUDE2:\n case LONGITUDE2:\n return {\n area: 'always',\n bar: 'always',\n image: 'always',\n rect: 'always',\n rule: 'always',\n circle: 'binned',\n point: 'binned',\n square: 'binned',\n tick: 'binned',\n line: 'binned',\n trail: 'binned'\n };\n case SIZE:\n return {\n point: 'always',\n tick: 'always',\n rule: 'always',\n circle: 'always',\n square: 'always',\n bar: 'always',\n text: 'always',\n line: 'always',\n trail: 'always'\n };\n case STROKEDASH:\n return {\n line: 'always',\n point: 'always',\n tick: 'always',\n rule: 'always',\n circle: 'always',\n square: 'always',\n bar: 'always',\n geoshape: 'always'\n };\n case SHAPE:\n return { point: 'always', geoshape: 'always' };\n case TEXT:\n return { text: 'always' };\n case ANGLE:\n return { point: 'always', square: 'always', text: 'always' };\n case URL:\n return { image: 'always' };\n case THETA:\n return { text: 'always', arc: 'always' };\n case RADIUS:\n return { text: 'always', arc: 'always' };\n case THETA2:\n case RADIUS2:\n return { arc: 'always' };\n }\n}\nexport function rangeType(channel) {\n switch (channel) {\n case X:\n case Y:\n case THETA:\n case RADIUS:\n case SIZE:\n case ANGLE:\n case STROKEWIDTH:\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n // X2 and Y2 use X and Y scales, so they similarly have continuous range. [falls through]\n case X2:\n case Y2:\n case THETA2:\n case RADIUS2:\n return undefined;\n case FACET:\n case ROW:\n case COLUMN:\n case SHAPE:\n case STROKEDASH:\n // TEXT, TOOLTIP, URL, and HREF have no scale but have discrete output [falls through]\n case TEXT:\n case TOOLTIP:\n case HREF:\n case URL:\n case DESCRIPTION:\n return 'discrete';\n // Color can be either continuous or discrete, depending on scale type.\n case COLOR:\n case FILL:\n case STROKE:\n return 'flexible';\n // No scale, no range type.\n case LATITUDE:\n case LONGITUDE:\n case LATITUDE2:\n case LONGITUDE2:\n case DETAIL:\n case KEY:\n case ORDER:\n return undefined;\n }\n}\n//# sourceMappingURL=channel.js.map","import { isBoolean, isObject } from 'vega-util';\nimport { COLOR, COLUMN, FILL, FILLOPACITY, OPACITY, ROW, SHAPE, SIZE, STROKE, STROKEDASH, STROKEOPACITY, STROKEWIDTH } from './channel';\nimport { normalizeBin } from './channeldef';\nimport { entries, keys, varName } from './util';\n/**\n * Create a key for the bin configuration. Not for prebinned bin.\n */\nexport function binToString(bin) {\n if (isBoolean(bin)) {\n bin = normalizeBin(bin, undefined);\n }\n return ('bin' +\n keys(bin)\n .map(p => (isSelectionExtent(bin[p]) ? varName(`_${p}_${entries(bin[p])}`) : varName(`_${p}_${bin[p]}`)))\n .join(''));\n}\n/**\n * Vega-Lite should bin the data.\n */\nexport function isBinning(bin) {\n return bin === true || (isBinParams(bin) && !bin.binned);\n}\n/**\n * The data is already binned and so Vega-Lite should not bin it again.\n */\nexport function isBinned(bin) {\n return bin === 'binned' || (isBinParams(bin) && bin.binned === true);\n}\nexport function isBinParams(bin) {\n return isObject(bin);\n}\nexport function isSelectionExtent(extent) {\n return extent === null || extent === void 0 ? void 0 : extent['selection'];\n}\nexport function autoMaxBins(channel) {\n switch (channel) {\n case ROW:\n case COLUMN:\n case SIZE:\n case COLOR:\n case FILL:\n case STROKE:\n case STROKEWIDTH:\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n // Facets and Size shouldn't have too many bins\n // We choose 6 like shape to simplify the rule [falls through]\n case SHAPE:\n return 6; // Vega's \"shape\" has 6 distinct values\n case STROKEDASH:\n return 4; // We only provide 5 different stroke dash values (but 4 is more effective)\n default:\n return 10;\n }\n}\n//# sourceMappingURL=bin.js.map","import { getSizeChannel } from '../channel';\nimport { stringify } from '../util';\nexport function invalidSpec(spec) {\n return `Invalid specification ${JSON.stringify(spec)}. Make sure the specification includes at least one of the following properties: \"mark\", \"layer\", \"facet\", \"hconcat\", \"vconcat\", \"concat\", or \"repeat\".`;\n}\n// FIT\nexport const FIT_NON_SINGLE = 'Autosize \"fit\" only works for single views and layered views.';\nexport function containerSizeNonSingle(name) {\n const uName = name == 'width' ? 'Width' : 'Height';\n return `${uName} \"container\" only works for single views and layered views.`;\n}\nexport function containerSizeNotCompatibleWithAutosize(name) {\n const uName = name == 'width' ? 'Width' : 'Height';\n const fitDirection = name == 'width' ? 'x' : 'y';\n return `${uName} \"container\" only works well with autosize \"fit\" or \"fit-${fitDirection}\".`;\n}\nexport function droppingFit(channel) {\n return channel\n ? `Dropping \"fit-${channel}\" because spec has discrete ${getSizeChannel(channel)}.`\n : `Dropping \"fit\" because spec has discrete size.`;\n}\n// VIEW SIZE\nexport function unknownField(channel) {\n return `Unknown field for ${channel}. Cannot calculate view size.`;\n}\n// SELECTION\nexport function cannotProjectOnChannelWithoutField(channel) {\n return `Cannot project a selection on encoding channel \"${channel}\", which has no field.`;\n}\nexport function cannotProjectAggregate(channel, aggregate) {\n return `Cannot project a selection on encoding channel \"${channel}\" as it uses an aggregate function (\"${aggregate}\").`;\n}\nexport function nearestNotSupportForContinuous(mark) {\n return `The \"nearest\" transform is not supported for ${mark} marks.`;\n}\nexport function selectionNotSupported(mark) {\n return `Selection not supported for ${mark} yet.`;\n}\nexport function selectionNotFound(name) {\n return `Cannot find a selection named \"${name}\".`;\n}\nexport const SCALE_BINDINGS_CONTINUOUS = 'Scale bindings are currently only supported for scales with unbinned, continuous domains.';\nexport const LEGEND_BINDINGS_MUST_HAVE_PROJECTION = 'Legend bindings are only supported for selections over an individual field or encoding channel.';\nexport function noSameUnitLookup(name) {\n return (`Cannot define and lookup the \"${name}\" selection in the same view. ` +\n `Try moving the lookup into a second, layered view?`);\n}\nexport const NEEDS_SAME_SELECTION = 'The same selection must be used to override scale domains in a layered view.';\nexport const INTERVAL_INITIALIZED_WITH_X_Y = 'Interval selections should be initialized using \"x\" and/or \"y\" keys.';\n// REPEAT\nexport function noSuchRepeatedValue(field) {\n return `Unknown repeated value \"${field}\".`;\n}\nexport function columnsNotSupportByRowCol(type) {\n return `The \"columns\" property cannot be used when \"${type}\" has nested row/column.`;\n}\n// CONCAT / REPEAT\nexport const CONCAT_CANNOT_SHARE_AXIS = 'Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).';\n// DATA\nexport function unrecognizedParse(p) {\n return `Unrecognized parse \"${p}\".`;\n}\nexport function differentParse(field, local, ancestor) {\n return `An ancestor parsed field \"${field}\" as ${ancestor} but a child wants to parse the field as ${local}.`;\n}\nexport const ADD_SAME_CHILD_TWICE = 'Attempt to add the same child twice.';\n// TRANSFORMS\nexport function invalidTransformIgnored(transform) {\n return `Ignoring an invalid transform: ${stringify(transform)}.`;\n}\nexport const NO_FIELDS_NEEDS_AS = 'If \"from.fields\" is not specified, \"as\" has to be a string that specifies the key to be used for the data from the secondary source.';\n// ENCODING & FACET\nexport function customFormatTypeNotAllowed(channel) {\n return `Config.customFormatTypes is not true, thus custom format type and format for channel ${channel} are dropped.`;\n}\nexport function projectionOverridden(opt) {\n const { parentProjection, projection } = opt;\n return `Layer's shared projection ${stringify(parentProjection)} is overridden by a child projection ${stringify(projection)}.`;\n}\nexport const REPLACE_ANGLE_WITH_THETA = 'Arc marks uses theta channel rather than angle, replacing angle with theta.';\nexport function primitiveChannelDef(channel, type, value) {\n return `Channel ${channel} is a ${type}. Converted to {value: ${stringify(value)}}.`;\n}\nexport function invalidFieldType(type) {\n return `Invalid field type \"${type}\".`;\n}\nexport function invalidFieldTypeForCountAggregate(type, aggregate) {\n return `Invalid field type \"${type}\" for aggregate: \"${aggregate}\", using \"quantitative\" instead.`;\n}\nexport function invalidAggregate(aggregate) {\n return `Invalid aggregation operator \"${aggregate}\".`;\n}\nexport function missingFieldType(channel, newType) {\n return `Missing type for channel \"${channel}\", using \"${newType}\" instead.`;\n}\nexport function droppingColor(type, opt) {\n const { fill, stroke } = opt;\n return `Dropping color ${type} as the plot also has ${fill && stroke ? 'fill and stroke' : fill ? 'fill' : 'stroke'}.`;\n}\nexport function emptyFieldDef(fieldDef, channel) {\n return `Dropping ${stringify(fieldDef)} from channel \"${channel}\" since it does not contain any data field, datum, value, or signal.`;\n}\nexport function latLongDeprecated(channel, type, newChannel) {\n return `${channel}-encoding with type ${type} is deprecated. Replacing with ${newChannel}-encoding.`;\n}\nexport const LINE_WITH_VARYING_SIZE = 'Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.';\nexport function incompatibleChannel(channel, markOrFacet, when) {\n return `${channel} dropped as it is incompatible with \"${markOrFacet}\"${when ? ` when ${when}` : ''}.`;\n}\nexport function invalidEncodingChannel(channel) {\n return `${channel}-encoding is dropped as ${channel} is not a valid encoding channel.`;\n}\nexport function facetChannelShouldBeDiscrete(channel) {\n return `${channel} encoding should be discrete (ordinal / nominal / binned).`;\n}\nexport function facetChannelDropped(channels) {\n return `Facet encoding dropped as ${channels.join(' and ')} ${channels.length > 1 ? 'are' : 'is'} also specified.`;\n}\nexport function discreteChannelCannotEncode(channel, type) {\n return `Using discrete channel \"${channel}\" to encode \"${type}\" field can be misleading as it does not encode ${type === 'ordinal' ? 'order' : 'magnitude'}.`;\n}\n// MARK\nexport function rangeMarkAlignmentCannotBeExpression(align) {\n return `The ${align} for range marks cannot be an expression`;\n}\nexport function lineWithRange(hasX2, hasY2) {\n const channels = hasX2 && hasY2 ? 'x2 and y2' : hasX2 ? 'x2' : 'y2';\n return `Line mark is for continuous lines and thus cannot be used with ${channels}. We will use the rule mark (line segments) instead.`;\n}\nexport function orientOverridden(original, actual) {\n return `Specified orient \"${original}\" overridden with \"${actual}\".`;\n}\n// SCALE\nexport const CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN = 'Custom domain scale cannot be unioned with default field-based domain.';\nexport const RANGE_STEP_DEPRECATED = `Scale's \"rangeStep\" is deprecated and will be removed in Vega-Lite 5.0. Please use \"width\"/\"height\": {\"step\": ...} instead. See https://vega.github.io/vega-lite/docs/size.html.`;\nexport function cannotUseScalePropertyWithNonColor(prop) {\n return `Cannot use the scale property \"${prop}\" with non-color channel.`;\n}\nexport function unaggregateDomainHasNoEffectForRawField(fieldDef) {\n return `Using unaggregated domain with raw field has no effect (${stringify(fieldDef)}).`;\n}\nexport function unaggregateDomainWithNonSharedDomainOp(aggregate) {\n return `Unaggregated domain not applicable for \"${aggregate}\" since it produces values outside the origin domain of the source data.`;\n}\nexport function unaggregatedDomainWithLogScale(fieldDef) {\n return `Unaggregated domain is currently unsupported for log scale (${stringify(fieldDef)}).`;\n}\nexport function cannotApplySizeToNonOrientedMark(mark) {\n return `Cannot apply size to non-oriented mark \"${mark}\".`;\n}\nexport function scaleTypeNotWorkWithChannel(channel, scaleType, defaultScaleType) {\n return `Channel \"${channel}\" does not work with \"${scaleType}\" scale. We are using \"${defaultScaleType}\" scale instead.`;\n}\nexport function scaleTypeNotWorkWithFieldDef(scaleType, defaultScaleType) {\n return `FieldDef does not work with \"${scaleType}\" scale. We are using \"${defaultScaleType}\" scale instead.`;\n}\nexport function scalePropertyNotWorkWithScaleType(scaleType, propName, channel) {\n return `${channel}-scale's \"${propName}\" is dropped as it does not work with ${scaleType} scale.`;\n}\nexport function scaleTypeNotWorkWithMark(mark, scaleType) {\n return `Scale type \"${scaleType}\" does not work with mark \"${mark}\".`;\n}\nexport function stepDropped(channel) {\n return `The step for \"${channel}\" is dropped because the ${channel === 'width' ? 'x' : 'y'} is continuous.`;\n}\nexport function mergeConflictingProperty(property, propertyOf, v1, v2) {\n return `Conflicting ${propertyOf.toString()} property \"${property.toString()}\" (${stringify(v1)} and ${stringify(v2)}). Using ${stringify(v1)}.`;\n}\nexport function mergeConflictingDomainProperty(property, propertyOf, v1, v2) {\n return `Conflicting ${propertyOf.toString()} property \"${property.toString()}\" (${stringify(v1)} and ${stringify(v2)}). Using the union of the two domains.`;\n}\nexport function independentScaleMeansIndependentGuide(channel) {\n return `Setting the scale to be independent for \"${channel}\" means we also have to set the guide (axis or legend) to be independent.`;\n}\nexport function domainSortDropped(sort) {\n return `Dropping sort property ${stringify(sort)} as unioned domains only support boolean or op \"count\", \"min\", and \"max\".`;\n}\nexport const MORE_THAN_ONE_SORT = 'Domains that should be unioned has conflicting sort properties. Sort will be set to true.';\nexport const FACETED_INDEPENDENT_DIFFERENT_SOURCES = 'Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.';\nexport const FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES = 'Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.';\nexport const FACETED_INDEPENDENT_SAME_SOURCE = 'Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.';\n// AXIS\nexport const INVALID_CHANNEL_FOR_AXIS = 'Invalid channel for axis.';\n// STACK\nexport function cannotStackRangedMark(channel) {\n return `Cannot stack \"${channel}\" if there is already \"${channel}2\".`;\n}\nexport function cannotStackNonLinearScale(scaleType) {\n return `Cannot stack non-linear scale (${scaleType}).`;\n}\nexport function stackNonSummativeAggregate(aggregate) {\n return `Stacking is applied even though the aggregate function is non-summative (\"${aggregate}\").`;\n}\n// TIMEUNIT\nexport function invalidTimeUnit(unitName, value) {\n return `Invalid ${unitName}: ${stringify(value)}.`;\n}\nexport function droppedDay(d) {\n return `Dropping day from datetime ${stringify(d)} as day cannot be combined with other units.`;\n}\nexport function errorBarCenterAndExtentAreNotNeeded(center, extent) {\n return `${extent ? 'extent ' : ''}${extent && center ? 'and ' : ''}${center ? 'center ' : ''}${extent && center ? 'are ' : 'is '}not needed when data are aggregated.`;\n}\nexport function errorBarCenterIsUsedWithWrongExtent(center, extent, mark) {\n return `${center} is not usually used with ${extent} for ${mark}.`;\n}\nexport function errorBarContinuousAxisHasCustomizedAggregate(aggregate, compositeMark) {\n return `Continuous axis should not have customized aggregation function ${aggregate}; ${compositeMark} already agregates the axis.`;\n}\nexport function errorBand1DNotSupport(property) {\n return `1D error band does not support ${property}.`;\n}\n// CHANNEL\nexport function channelRequiredForBinned(channel) {\n return `Channel ${channel} is required for \"binned\" bin.`;\n}\nexport function channelShouldNotBeUsedForBinned(channel) {\n return `Channel ${channel} should not be used with \"binned\" bin.`;\n}\nexport function domainRequiredForThresholdScale(channel) {\n return `Domain for ${channel} is required for threshold scale.`;\n}\n//# sourceMappingURL=message.js.map","/**\n * Vega-Lite's singleton logger utility.\n */\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n privateMap.set(receiver, value);\n return value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n return privateMap.get(receiver);\n};\nvar _level;\nimport { Debug, Error as ErrorLevel, Info, logger, Warn } from 'vega-util';\nimport * as message_1 from './message';\nexport { message_1 as message };\n/**\n * Main (default) Vega Logger instance for Vega-Lite.\n */\nconst main = logger(Warn);\nlet current = main;\n/**\n * Logger tool for checking if the code throws correct warning.\n */\nexport class LocalLogger {\n constructor() {\n this.warns = [];\n this.infos = [];\n this.debugs = [];\n _level.set(this, Warn);\n }\n level(_) {\n if (_) {\n __classPrivateFieldSet(this, _level, _);\n return this;\n }\n return __classPrivateFieldGet(this, _level);\n }\n warn(...args) {\n if (__classPrivateFieldGet(this, _level) >= Warn)\n this.warns.push(...args);\n return this;\n }\n info(...args) {\n if (__classPrivateFieldGet(this, _level) >= Info)\n this.infos.push(...args);\n return this;\n }\n debug(...args) {\n if (__classPrivateFieldGet(this, _level) >= Debug)\n this.debugs.push(...args);\n return this;\n }\n error(...args) {\n if (__classPrivateFieldGet(this, _level) >= ErrorLevel)\n throw Error(...args);\n return this;\n }\n}\n_level = new WeakMap();\nexport function wrap(f) {\n return () => {\n current = new LocalLogger();\n f(current);\n reset();\n };\n}\n/**\n * Set the singleton logger to be a custom logger.\n */\nexport function set(newLogger) {\n current = newLogger;\n return current;\n}\n/**\n * Reset the main logger to use the default Vega Logger.\n */\nexport function reset() {\n current = main;\n return current;\n}\nexport function error(...args) {\n current.error(...args);\n}\nexport function warn(...args) {\n current.warn(...args);\n}\nexport function info(...args) {\n current.info(...args);\n}\nexport function debug(...args) {\n current.debug(...args);\n}\n//# sourceMappingURL=index.js.map","// DateTime definition object\nimport { isNumber, isObject } from 'vega-util';\nimport * as log from './log';\nimport { TIMEUNIT_PARTS } from './timeunit';\nimport { duplicate, isNumeric, keys } from './util';\nexport function isDateTime(o) {\n if (o && isObject(o)) {\n for (const part of TIMEUNIT_PARTS) {\n if (part in o) {\n return true;\n }\n }\n }\n return false;\n}\nexport const MONTHS = [\n 'january',\n 'february',\n 'march',\n 'april',\n 'may',\n 'june',\n 'july',\n 'august',\n 'september',\n 'october',\n 'november',\n 'december'\n];\nexport const SHORT_MONTHS = MONTHS.map(m => m.substr(0, 3));\nexport const DAYS = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];\nexport const SHORT_DAYS = DAYS.map(d => d.substr(0, 3));\nfunction normalizeQuarter(q) {\n if (isNumeric(q)) {\n q = +q;\n }\n if (isNumber(q)) {\n if (q > 4) {\n log.warn(log.message.invalidTimeUnit('quarter', q));\n }\n // We accept 1-based quarter, so need to readjust to 0-based quarter\n return q - 1;\n }\n else {\n // Invalid quarter\n throw new Error(log.message.invalidTimeUnit('quarter', q));\n }\n}\nfunction normalizeMonth(m) {\n if (isNumeric(m)) {\n m = +m;\n }\n if (isNumber(m)) {\n // We accept 1-based month, so need to readjust to 0-based month\n return m - 1;\n }\n else {\n const lowerM = m.toLowerCase();\n const monthIndex = MONTHS.indexOf(lowerM);\n if (monthIndex !== -1) {\n return monthIndex; // 0 for january, ...\n }\n const shortM = lowerM.substr(0, 3);\n const shortMonthIndex = SHORT_MONTHS.indexOf(shortM);\n if (shortMonthIndex !== -1) {\n return shortMonthIndex;\n }\n // Invalid month\n throw new Error(log.message.invalidTimeUnit('month', m));\n }\n}\nfunction normalizeDay(d) {\n if (isNumeric(d)) {\n d = +d;\n }\n if (isNumber(d)) {\n // mod so that this can be both 0-based where 0 = sunday\n // and 1-based where 7=sunday\n return d % 7;\n }\n else {\n const lowerD = d.toLowerCase();\n const dayIndex = DAYS.indexOf(lowerD);\n if (dayIndex !== -1) {\n return dayIndex; // 0 for january, ...\n }\n const shortD = lowerD.substr(0, 3);\n const shortDayIndex = SHORT_DAYS.indexOf(shortD);\n if (shortDayIndex !== -1) {\n return shortDayIndex;\n }\n // Invalid day\n throw new Error(log.message.invalidTimeUnit('day', d));\n }\n}\n/**\n * @param d the date.\n * @param normalize whether to normalize quarter, month, day. This should probably be true if d is a DateTime.\n * @returns array of date time parts [year, month, day, hours, minutes, seconds, milliseconds]\n */\nfunction dateTimeParts(d, normalize) {\n const parts = [];\n if (normalize && d.day !== undefined) {\n if (keys(d).length > 1) {\n log.warn(log.message.droppedDay(d));\n d = duplicate(d);\n delete d.day;\n }\n }\n if (d.year !== undefined) {\n parts.push(d.year);\n }\n else {\n // Just like Vega's timeunit transform, set default year to 2012, so domain conversion will be compatible with Vega\n // Note: 2012 is a leap year (and so the date February 29 is respected) that begins on a Sunday (and so days of the week will order properly at the beginning of the year).\n parts.push(2012);\n }\n if (d.month !== undefined) {\n const month = normalize ? normalizeMonth(d.month) : d.month;\n parts.push(month);\n }\n else if (d.quarter !== undefined) {\n const quarter = normalize ? normalizeQuarter(d.quarter) : d.quarter;\n parts.push(isNumber(quarter) ? quarter * 3 : quarter + '*3');\n }\n else {\n parts.push(0); // months start at zero in JS\n }\n if (d.date !== undefined) {\n parts.push(d.date);\n }\n else if (d.day !== undefined) {\n // HACK: Day only works as a standalone unit\n // This is only correct because we always set year to 2006 for day\n const day = normalize ? normalizeDay(d.day) : d.day;\n parts.push(isNumber(day) ? day + 1 : day + '+1');\n }\n else {\n parts.push(1); // Date starts at 1 in JS\n }\n // Note: can't use TimeUnit enum here as importing it will create\n // circular dependency problem!\n for (const timeUnit of ['hours', 'minutes', 'seconds', 'milliseconds']) {\n const unit = d[timeUnit];\n parts.push(typeof unit === 'undefined' ? 0 : unit);\n }\n return parts;\n}\n/**\n * Return Vega expression for a date time.\n *\n * @param d the date time.\n * @returns the Vega expression.\n */\nexport function dateTimeToExpr(d) {\n const parts = dateTimeParts(d, true);\n const string = parts.join(', ');\n if (d.utc) {\n return `utc(${string})`;\n }\n else {\n return `datetime(${string})`;\n }\n}\n/**\n * Return Vega expression for a date time expression.\n *\n * @param d the internal date time object with expression.\n * @returns the Vega expression.\n */\nexport function dateTimeExprToExpr(d) {\n const parts = dateTimeParts(d, false);\n const string = parts.join(', ');\n if (d.utc) {\n return `utc(${string})`;\n }\n else {\n return `datetime(${string})`;\n }\n}\n/**\n * @param d the date time.\n * @returns the timestamp.\n */\nexport function dateTimeToTimestamp(d) {\n const parts = dateTimeParts(d, true);\n if (d.utc) {\n return +new Date(Date.UTC(...parts));\n }\n else {\n return +new Date(...parts);\n }\n}\n//# sourceMappingURL=datetime.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport stringify from 'fast-json-stable-stringify';\nimport { isObject, isString } from 'vega-util';\nimport { dateTimeExprToExpr } from './datetime';\nimport { accessPathWithDatum, keys, varName } from './util';\n/** Time Unit that only corresponds to only one part of Date objects. */\nexport const LOCAL_SINGLE_TIMEUNIT_INDEX = {\n year: 1,\n quarter: 1,\n month: 1,\n week: 1,\n day: 1,\n dayofyear: 1,\n date: 1,\n hours: 1,\n minutes: 1,\n seconds: 1,\n milliseconds: 1\n};\nexport const TIMEUNIT_PARTS = keys(LOCAL_SINGLE_TIMEUNIT_INDEX);\nexport function isLocalSingleTimeUnit(timeUnit) {\n return !!LOCAL_SINGLE_TIMEUNIT_INDEX[timeUnit];\n}\nexport const UTC_SINGLE_TIMEUNIT_INDEX = {\n utcyear: 1,\n utcquarter: 1,\n utcmonth: 1,\n utcweek: 1,\n utcday: 1,\n utcdayofyear: 1,\n utcdate: 1,\n utchours: 1,\n utcminutes: 1,\n utcseconds: 1,\n utcmilliseconds: 1\n};\nexport const LOCAL_MULTI_TIMEUNIT_INDEX = {\n yearquarter: 1,\n yearquartermonth: 1,\n yearmonth: 1,\n yearmonthdate: 1,\n yearmonthdatehours: 1,\n yearmonthdatehoursminutes: 1,\n yearmonthdatehoursminutesseconds: 1,\n yearweek: 1,\n yearweekday: 1,\n yearweekdayhours: 1,\n yearweekdayhoursminutes: 1,\n yearweekdayhoursminutesseconds: 1,\n yeardayofyear: 1,\n quartermonth: 1,\n monthdate: 1,\n monthdatehours: 1,\n monthdatehoursminutes: 1,\n monthdatehoursminutesseconds: 1,\n weekday: 1,\n weeksdayhours: 1,\n weekdayhoursminutes: 1,\n weekdayhoursminutesseconds: 1,\n dayhours: 1,\n dayhoursminutes: 1,\n dayhoursminutesseconds: 1,\n hoursminutes: 1,\n hoursminutesseconds: 1,\n minutesseconds: 1,\n secondsmilliseconds: 1\n};\nexport const UTC_MULTI_TIMEUNIT_INDEX = {\n utcyearquarter: 1,\n utcyearquartermonth: 1,\n utcyearmonth: 1,\n utcyearmonthdate: 1,\n utcyearmonthdatehours: 1,\n utcyearmonthdatehoursminutes: 1,\n utcyearmonthdatehoursminutesseconds: 1,\n utcyearweek: 1,\n utcyearweekday: 1,\n utcyearweekdayhours: 1,\n utcyearweekdayhoursminutes: 1,\n utcyearweekdayhoursminutesseconds: 1,\n utcyeardayofyear: 1,\n utcquartermonth: 1,\n utcmonthdate: 1,\n utcmonthdatehours: 1,\n utcmonthdatehoursminutes: 1,\n utcmonthdatehoursminutesseconds: 1,\n utcweekday: 1,\n utcweeksdayhours: 1,\n utcweekdayhoursminutes: 1,\n utcweekdayhoursminutesseconds: 1,\n utcdayhours: 1,\n utcdayhoursminutes: 1,\n utcdayhoursminutesseconds: 1,\n utchoursminutes: 1,\n utchoursminutesseconds: 1,\n utcminutesseconds: 1,\n utcsecondsmilliseconds: 1\n};\nexport function isUTCTimeUnit(t) {\n return t.startsWith('utc');\n}\nexport function getLocalTimeUnit(t) {\n return t.substr(3);\n}\n// In order of increasing specificity\nexport const VEGALITE_TIMEFORMAT = {\n 'year-month': '%b %Y ',\n 'year-month-date': '%b %d, %Y '\n};\nexport function getTimeUnitParts(timeUnit) {\n const parts = [];\n for (const part of TIMEUNIT_PARTS) {\n if (containsTimeUnit(timeUnit, part)) {\n parts.push(part);\n }\n }\n return parts;\n}\n/** Returns true if fullTimeUnit contains the timeUnit, false otherwise. */\nexport function containsTimeUnit(fullTimeUnit, timeUnit) {\n const index = fullTimeUnit.indexOf(timeUnit);\n if (index < 0) {\n return false;\n }\n // exclude milliseconds\n if (index > 0 && timeUnit === 'seconds' && fullTimeUnit.charAt(index - 1) === 'i') {\n return false;\n }\n // exclude dayofyear\n if (fullTimeUnit.length > index + 3 && timeUnit === 'day' && fullTimeUnit.charAt(index + 3) === 'o') {\n return false;\n }\n if (index > 0 && timeUnit === 'year' && fullTimeUnit.charAt(index - 1) === 'f') {\n return false;\n }\n return true;\n}\n/**\n * Returns Vega expression for a given timeUnit and fieldRef\n */\nexport function fieldExpr(fullTimeUnit, field, { end } = { end: false }) {\n const fieldRef = accessPathWithDatum(field);\n const utc = isUTCTimeUnit(fullTimeUnit) ? 'utc' : '';\n function func(timeUnit) {\n if (timeUnit === 'quarter') {\n // quarter starting at 0 (0,3,6,9).\n return `(${utc}quarter(${fieldRef})-1)`;\n }\n else {\n return `${utc}${timeUnit}(${fieldRef})`;\n }\n }\n let lastTimeUnit;\n const dateExpr = {};\n for (const part of TIMEUNIT_PARTS) {\n if (containsTimeUnit(fullTimeUnit, part)) {\n dateExpr[part] = func(part);\n lastTimeUnit = part;\n }\n }\n if (end) {\n dateExpr[lastTimeUnit] += '+1';\n }\n return dateTimeExprToExpr(dateExpr);\n}\nexport function timeUnitSpecifierExpression(timeUnit) {\n if (!timeUnit) {\n return undefined;\n }\n const timeUnitParts = getTimeUnitParts(timeUnit);\n return `timeUnitSpecifier(${stringify(timeUnitParts)}, ${stringify(VEGALITE_TIMEFORMAT)})`;\n}\n/**\n * Returns the signal expression used for axis labels for a time unit.\n */\nexport function formatExpression(timeUnit, field, isUTCScale) {\n if (!timeUnit) {\n return undefined;\n }\n const expr = timeUnitSpecifierExpression(timeUnit);\n // We only use utcFormat for utc scale\n // For utc time units, the data is already converted as a part of timeUnit transform.\n // Thus, utc time units should use timeFormat to avoid shifting the time twice.\n const utc = isUTCScale || isUTCTimeUnit(timeUnit);\n return `${utc ? 'utc' : 'time'}Format(${field}, ${expr})`;\n}\nexport function normalizeTimeUnit(timeUnit) {\n if (!timeUnit) {\n return undefined;\n }\n let params;\n if (isString(timeUnit)) {\n params = {\n unit: timeUnit\n };\n }\n else if (isObject(timeUnit)) {\n params = Object.assign(Object.assign({}, timeUnit), (timeUnit.unit ? { unit: timeUnit.unit } : {}));\n }\n if (isUTCTimeUnit(params.unit)) {\n params.utc = true;\n params.unit = getLocalTimeUnit(params.unit);\n }\n return params;\n}\nexport function timeUnitToString(tu) {\n const _a = normalizeTimeUnit(tu), { utc } = _a, rest = __rest(_a, [\"utc\"]);\n if (rest.unit) {\n return ((utc ? 'utc' : '') +\n keys(rest)\n .map(p => varName(`${p === 'unit' ? '' : `_${p}_`}${rest[p]}`))\n .join(''));\n }\n else {\n // when maxbins is specified instead of units\n return ((utc ? 'utc' : '') +\n 'timeunit' +\n keys(rest)\n .map(p => varName(`_${p}_${rest[p]}`))\n .join(''));\n }\n}\n//# sourceMappingURL=timeunit.js.map","import { isArray } from 'vega-util';\nimport { keys } from './util';\nexport function isSignalRef(o) {\n return o && !!o['signal'];\n}\nexport function isVgRangeStep(range) {\n return !!range['step'];\n}\nexport function isDataRefUnionedDomain(domain) {\n if (!isArray(domain)) {\n return 'fields' in domain && !('data' in domain);\n }\n return false;\n}\nexport function isFieldRefUnionDomain(domain) {\n if (!isArray(domain)) {\n return 'fields' in domain && 'data' in domain;\n }\n return false;\n}\nexport function isDataRefDomain(domain) {\n if (!isArray(domain)) {\n return 'field' in domain && 'data' in domain;\n }\n return false;\n}\nconst VG_MARK_CONFIG_INDEX = {\n aria: 1,\n description: 1,\n ariaRole: 1,\n ariaRoleDescription: 1,\n blend: 1,\n opacity: 1,\n fill: 1,\n fillOpacity: 1,\n stroke: 1,\n strokeCap: 1,\n strokeWidth: 1,\n strokeOpacity: 1,\n strokeDash: 1,\n strokeDashOffset: 1,\n strokeJoin: 1,\n strokeOffset: 1,\n strokeMiterLimit: 1,\n startAngle: 1,\n endAngle: 1,\n padAngle: 1,\n innerRadius: 1,\n outerRadius: 1,\n size: 1,\n shape: 1,\n interpolate: 1,\n tension: 1,\n orient: 1,\n align: 1,\n baseline: 1,\n text: 1,\n dir: 1,\n dx: 1,\n dy: 1,\n ellipsis: 1,\n limit: 1,\n radius: 1,\n theta: 1,\n angle: 1,\n font: 1,\n fontSize: 1,\n fontWeight: 1,\n fontStyle: 1,\n lineBreak: 1,\n lineHeight: 1,\n cursor: 1,\n href: 1,\n tooltip: 1,\n cornerRadius: 1,\n cornerRadiusTopLeft: 1,\n cornerRadiusTopRight: 1,\n cornerRadiusBottomLeft: 1,\n cornerRadiusBottomRight: 1,\n aspect: 1,\n width: 1,\n height: 1,\n url: 1,\n smooth: 1\n // commented below are vg channel that do not have mark config.\n // x: 1,\n // y: 1,\n // x2: 1,\n // y2: 1,\n // xc'|'yc'\n // clip: 1,\n // path: 1,\n // url: 1,\n};\nexport const VG_MARK_CONFIGS = keys(VG_MARK_CONFIG_INDEX);\nexport const VG_MARK_INDEX = {\n arc: 1,\n area: 1,\n group: 1,\n image: 1,\n line: 1,\n path: 1,\n rect: 1,\n rule: 1,\n shape: 1,\n symbol: 1,\n text: 1,\n trail: 1\n};\n// Vega's cornerRadius channels.\nexport const VG_CORNERRADIUS_CHANNELS = [\n 'cornerRadius',\n 'cornerRadiusTopLeft',\n 'cornerRadiusTopRight',\n 'cornerRadiusBottomLeft',\n 'cornerRadiusBottomRight'\n];\n//# sourceMappingURL=vega.schema.js.map","import { isArray } from 'vega-util';\nimport { valueExpr, vgField } from './channeldef';\nimport { fieldExpr as timeUnitFieldExpr, normalizeTimeUnit } from './timeunit';\nimport { isSignalRef } from './vega.schema';\nexport function isSelectionPredicate(predicate) {\n return predicate === null || predicate === void 0 ? void 0 : predicate['selection'];\n}\nexport function isFieldEqualPredicate(predicate) {\n return predicate && !!predicate.field && predicate.equal !== undefined;\n}\nexport function isFieldLTPredicate(predicate) {\n return predicate && !!predicate.field && predicate.lt !== undefined;\n}\nexport function isFieldLTEPredicate(predicate) {\n return predicate && !!predicate.field && predicate.lte !== undefined;\n}\nexport function isFieldGTPredicate(predicate) {\n return predicate && !!predicate.field && predicate.gt !== undefined;\n}\nexport function isFieldGTEPredicate(predicate) {\n return predicate && !!predicate.field && predicate.gte !== undefined;\n}\nexport function isFieldRangePredicate(predicate) {\n if (predicate && predicate.field) {\n if (isArray(predicate.range) && predicate.range.length === 2) {\n return true;\n }\n else if (isSignalRef(predicate.range)) {\n return true;\n }\n }\n return false;\n}\nexport function isFieldOneOfPredicate(predicate) {\n return (predicate && !!predicate.field && (isArray(predicate.oneOf) || isArray(predicate.in)) // backward compatibility\n );\n}\nexport function isFieldValidPredicate(predicate) {\n return predicate && !!predicate.field && predicate.valid !== undefined;\n}\nexport function isFieldPredicate(predicate) {\n return (isFieldOneOfPredicate(predicate) ||\n isFieldEqualPredicate(predicate) ||\n isFieldRangePredicate(predicate) ||\n isFieldLTPredicate(predicate) ||\n isFieldGTPredicate(predicate) ||\n isFieldLTEPredicate(predicate) ||\n isFieldGTEPredicate(predicate));\n}\nfunction predicateValueExpr(v, timeUnit) {\n return valueExpr(v, { timeUnit, wrapTime: true });\n}\nfunction predicateValuesExpr(vals, timeUnit) {\n return vals.map(v => predicateValueExpr(v, timeUnit));\n}\n// This method is used by Voyager. Do not change its behavior without changing Voyager.\nexport function fieldFilterExpression(predicate, useInRange = true) {\n var _a;\n const { field } = predicate;\n const timeUnit = (_a = normalizeTimeUnit(predicate.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit;\n const fieldExpr = timeUnit\n ? // For timeUnit, cast into integer with time() so we can use ===, inrange, indexOf to compare values directly.\n // TODO: We calculate timeUnit on the fly here. Consider if we would like to consolidate this with timeUnit pipeline\n // TODO: support utc\n 'time(' + timeUnitFieldExpr(timeUnit, field) + ')'\n : vgField(predicate, { expr: 'datum' });\n if (isFieldEqualPredicate(predicate)) {\n return fieldExpr + '===' + predicateValueExpr(predicate.equal, timeUnit);\n }\n else if (isFieldLTPredicate(predicate)) {\n const upper = predicate.lt;\n return `${fieldExpr}<${predicateValueExpr(upper, timeUnit)}`;\n }\n else if (isFieldGTPredicate(predicate)) {\n const lower = predicate.gt;\n return `${fieldExpr}>${predicateValueExpr(lower, timeUnit)}`;\n }\n else if (isFieldLTEPredicate(predicate)) {\n const upper = predicate.lte;\n return `${fieldExpr}<=${predicateValueExpr(upper, timeUnit)}`;\n }\n else if (isFieldGTEPredicate(predicate)) {\n const lower = predicate.gte;\n return `${fieldExpr}>=${predicateValueExpr(lower, timeUnit)}`;\n }\n else if (isFieldOneOfPredicate(predicate)) {\n return `indexof([${predicateValuesExpr(predicate.oneOf, timeUnit).join(',')}], ${fieldExpr}) !== -1`;\n }\n else if (isFieldValidPredicate(predicate)) {\n return fieldValidPredicate(fieldExpr, predicate.valid);\n }\n else if (isFieldRangePredicate(predicate)) {\n const { range } = predicate;\n const lower = isSignalRef(range) ? { signal: `${range.signal}[0]` } : range[0];\n const upper = isSignalRef(range) ? { signal: `${range.signal}[1]` } : range[1];\n if (lower !== null && upper !== null && useInRange) {\n return ('inrange(' +\n fieldExpr +\n ', [' +\n predicateValueExpr(lower, timeUnit) +\n ', ' +\n predicateValueExpr(upper, timeUnit) +\n '])');\n }\n const exprs = [];\n if (lower !== null) {\n exprs.push(`${fieldExpr} >= ${predicateValueExpr(lower, timeUnit)}`);\n }\n if (upper !== null) {\n exprs.push(`${fieldExpr} <= ${predicateValueExpr(upper, timeUnit)}`);\n }\n return exprs.length > 0 ? exprs.join(' && ') : 'true';\n }\n /* istanbul ignore next: it should never reach here */\n throw new Error(`Invalid field predicate: ${JSON.stringify(predicate)}`);\n}\nexport function fieldValidPredicate(fieldExpr, valid = true) {\n if (valid) {\n return `isValid(${fieldExpr}) && isFinite(+${fieldExpr})`;\n }\n else {\n return `!isValid(${fieldExpr}) || !isFinite(+${fieldExpr})`;\n }\n}\nexport function normalizePredicate(f) {\n var _a;\n if (isFieldPredicate(f) && f.timeUnit) {\n return Object.assign(Object.assign({}, f), { timeUnit: (_a = normalizeTimeUnit(f.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit });\n }\n return f;\n}\n//# sourceMappingURL=predicate.js.map","import { keys } from './util';\n/**\n * Data type based on level of measurement\n */\nexport const Type = {\n quantitative: 'quantitative',\n ordinal: 'ordinal',\n temporal: 'temporal',\n nominal: 'nominal',\n geojson: 'geojson'\n};\nexport function isType(t) {\n return t in Type;\n}\nexport const QUANTITATIVE = Type.quantitative;\nexport const ORDINAL = Type.ordinal;\nexport const TEMPORAL = Type.temporal;\nexport const NOMINAL = Type.nominal;\nexport const GEOJSON = Type.geojson;\nexport const TYPES = keys(Type);\n/**\n * Get full, lowercase type name for a given type.\n * @param type\n * @return Full type name.\n */\nexport function getFullName(type) {\n if (type) {\n type = type.toLowerCase();\n switch (type) {\n case 'q':\n case QUANTITATIVE:\n return 'quantitative';\n case 't':\n case TEMPORAL:\n return 'temporal';\n case 'o':\n case ORDINAL:\n return 'ordinal';\n case 'n':\n case NOMINAL:\n return 'nominal';\n case GEOJSON:\n return 'geojson';\n }\n }\n // If we get invalid input, return undefined type.\n return undefined;\n}\n//# sourceMappingURL=type.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isString, toSet } from 'vega-util';\nimport * as CHANNEL from './channel';\nimport { isColorChannel } from './channel';\nimport * as log from './log';\nimport { NOMINAL, ORDINAL, QUANTITATIVE, TEMPORAL } from './type';\nimport { contains, keys } from './util';\nexport const ScaleType = {\n // Continuous - Quantitative\n LINEAR: 'linear',\n LOG: 'log',\n POW: 'pow',\n SQRT: 'sqrt',\n SYMLOG: 'symlog',\n IDENTITY: 'identity',\n SEQUENTIAL: 'sequential',\n // Continuous - Time\n TIME: 'time',\n UTC: 'utc',\n // Discretizing scales\n QUANTILE: 'quantile',\n QUANTIZE: 'quantize',\n THRESHOLD: 'threshold',\n BIN_ORDINAL: 'bin-ordinal',\n // Discrete scales\n ORDINAL: 'ordinal',\n POINT: 'point',\n BAND: 'band'\n};\n/**\n * Index for scale categories -- only scale of the same categories can be merged together.\n * Current implementation is trying to be conservative and avoid merging scale type that might not work together\n */\nexport const SCALE_CATEGORY_INDEX = {\n linear: 'numeric',\n log: 'numeric',\n pow: 'numeric',\n sqrt: 'numeric',\n symlog: 'numeric',\n identity: 'numeric',\n sequential: 'numeric',\n time: 'time',\n utc: 'time',\n ordinal: 'ordinal',\n 'bin-ordinal': 'bin-ordinal',\n point: 'ordinal-position',\n band: 'ordinal-position',\n quantile: 'discretizing',\n quantize: 'discretizing',\n threshold: 'discretizing'\n};\nexport const SCALE_TYPES = keys(SCALE_CATEGORY_INDEX);\n/**\n * Whether the two given scale types can be merged together.\n */\nexport function scaleCompatible(scaleType1, scaleType2) {\n const scaleCategory1 = SCALE_CATEGORY_INDEX[scaleType1];\n const scaleCategory2 = SCALE_CATEGORY_INDEX[scaleType2];\n return (scaleCategory1 === scaleCategory2 ||\n (scaleCategory1 === 'ordinal-position' && scaleCategory2 === 'time') ||\n (scaleCategory2 === 'ordinal-position' && scaleCategory1 === 'time'));\n}\n/**\n * Index for scale precedence -- high score = higher priority for merging.\n */\nconst SCALE_PRECEDENCE_INDEX = {\n // numeric\n linear: 0,\n log: 1,\n pow: 1,\n sqrt: 1,\n symlog: 1,\n identity: 1,\n sequential: 1,\n // time\n time: 0,\n utc: 0,\n // ordinal-position -- these have higher precedence than continuous scales as they support more types of data\n point: 10,\n band: 11,\n // non grouped types\n ordinal: 0,\n 'bin-ordinal': 0,\n quantile: 0,\n quantize: 0,\n threshold: 0\n};\n/**\n * Return scale categories -- only scale of the same categories can be merged together.\n */\nexport function scaleTypePrecedence(scaleType) {\n return SCALE_PRECEDENCE_INDEX[scaleType];\n}\nexport const CONTINUOUS_TO_CONTINUOUS_SCALES = ['linear', 'log', 'pow', 'sqrt', 'symlog', 'time', 'utc'];\nconst CONTINUOUS_TO_CONTINUOUS_INDEX = toSet(CONTINUOUS_TO_CONTINUOUS_SCALES);\nexport const QUANTITATIVE_SCALES = ['linear', 'log', 'pow', 'sqrt', 'symlog'];\nconst QUANTITATIVE_SCALES_INDEX = toSet(QUANTITATIVE_SCALES);\nexport function isQuantitative(type) {\n return type in QUANTITATIVE_SCALES_INDEX;\n}\nexport const CONTINUOUS_TO_DISCRETE_SCALES = ['quantile', 'quantize', 'threshold'];\nconst CONTINUOUS_TO_DISCRETE_INDEX = toSet(CONTINUOUS_TO_DISCRETE_SCALES);\nexport const CONTINUOUS_DOMAIN_SCALES = CONTINUOUS_TO_CONTINUOUS_SCALES.concat([\n 'quantile',\n 'quantize',\n 'threshold',\n 'sequential',\n 'identity'\n]);\nconst CONTINUOUS_DOMAIN_INDEX = toSet(CONTINUOUS_DOMAIN_SCALES);\nexport const DISCRETE_DOMAIN_SCALES = ['ordinal', 'bin-ordinal', 'point', 'band'];\nconst DISCRETE_DOMAIN_INDEX = toSet(DISCRETE_DOMAIN_SCALES);\nexport const TIME_SCALE_TYPES = ['time', 'utc'];\nexport function hasDiscreteDomain(type) {\n return type in DISCRETE_DOMAIN_INDEX;\n}\nexport function hasContinuousDomain(type) {\n return type in CONTINUOUS_DOMAIN_INDEX;\n}\nexport function isContinuousToContinuous(type) {\n return type in CONTINUOUS_TO_CONTINUOUS_INDEX;\n}\nexport function isContinuousToDiscrete(type) {\n return type in CONTINUOUS_TO_DISCRETE_INDEX;\n}\nexport const defaultScaleConfig = {\n pointPadding: 0.5,\n barBandPaddingInner: 0.1,\n rectBandPaddingInner: 0,\n minBandSize: 2,\n minFontSize: 8,\n maxFontSize: 40,\n minOpacity: 0.3,\n maxOpacity: 0.8,\n // FIXME: revise if these *can* become ratios of width/height step\n minSize: 9,\n minStrokeWidth: 1,\n maxStrokeWidth: 4,\n quantileCount: 4,\n quantizeCount: 4\n};\nexport function isExtendedScheme(scheme) {\n return !isString(scheme) && !!scheme['name'];\n}\nexport function isSelectionDomain(domain) {\n return domain === null || domain === void 0 ? void 0 : domain['selection'];\n}\nexport function isDomainUnionWith(domain) {\n return domain && domain['unionWith'];\n}\nconst SCALE_PROPERTY_INDEX = {\n type: 1,\n domain: 1,\n domainMax: 1,\n domainMin: 1,\n domainMid: 1,\n align: 1,\n range: 1,\n rangeMax: 1,\n rangeMin: 1,\n scheme: 1,\n bins: 1,\n // Other properties\n reverse: 1,\n round: 1,\n // quantitative / time\n clamp: 1,\n nice: 1,\n // quantitative\n base: 1,\n exponent: 1,\n constant: 1,\n interpolate: 1,\n zero: 1,\n // band/point\n padding: 1,\n paddingInner: 1,\n paddingOuter: 1\n};\nexport const SCALE_PROPERTIES = keys(SCALE_PROPERTY_INDEX);\nconst { type, domain, range, rangeMax, rangeMin, scheme } = SCALE_PROPERTY_INDEX, NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTY_INDEX = __rest(SCALE_PROPERTY_INDEX, [\"type\", \"domain\", \"range\", \"rangeMax\", \"rangeMin\", \"scheme\"]);\nexport const NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES = keys(NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTY_INDEX);\nexport function scaleTypeSupportProperty(scaleType, propName) {\n switch (propName) {\n case 'type':\n case 'domain':\n case 'reverse':\n case 'range':\n return true;\n case 'scheme':\n case 'interpolate':\n return !contains(['point', 'band', 'identity'], scaleType);\n case 'bins':\n return !contains(['point', 'band', 'identity', 'ordinal'], scaleType);\n case 'round':\n return isContinuousToContinuous(scaleType) || scaleType === 'band' || scaleType === 'point';\n case 'padding':\n case 'rangeMin':\n case 'rangeMax':\n return isContinuousToContinuous(scaleType) || contains(['point', 'band'], scaleType);\n case 'paddingOuter':\n case 'align':\n return contains(['point', 'band'], scaleType);\n case 'paddingInner':\n return scaleType === 'band';\n case 'domainMax':\n case 'domainMid':\n case 'domainMin':\n case 'clamp':\n return isContinuousToContinuous(scaleType);\n case 'nice':\n return isContinuousToContinuous(scaleType) || scaleType === 'quantize' || scaleType === 'threshold';\n case 'exponent':\n return scaleType === 'pow';\n case 'base':\n return scaleType === 'log';\n case 'constant':\n return scaleType === 'symlog';\n case 'zero':\n return (hasContinuousDomain(scaleType) &&\n !contains([\n 'log',\n 'time',\n 'utc',\n 'threshold',\n 'quantile' // quantile depends on distribution so zero does not matter\n ], scaleType));\n }\n}\n/**\n * Returns undefined if the input channel supports the input scale property name\n */\nexport function channelScalePropertyIncompatability(channel, propName) {\n switch (propName) {\n case 'interpolate':\n case 'scheme':\n case 'domainMid':\n if (!isColorChannel(channel)) {\n return log.message.cannotUseScalePropertyWithNonColor(channel);\n }\n return undefined;\n case 'align':\n case 'type':\n case 'bins':\n case 'domain':\n case 'domainMax':\n case 'domainMin':\n case 'range':\n case 'base':\n case 'exponent':\n case 'constant':\n case 'nice':\n case 'padding':\n case 'paddingInner':\n case 'paddingOuter':\n case 'rangeMax':\n case 'rangeMin':\n case 'reverse':\n case 'round':\n case 'clamp':\n case 'zero':\n return undefined; // GOOD!\n }\n}\nexport function scaleTypeSupportDataType(specifiedType, fieldDefType) {\n if (contains([ORDINAL, NOMINAL], fieldDefType)) {\n return specifiedType === undefined || hasDiscreteDomain(specifiedType);\n }\n else if (fieldDefType === TEMPORAL) {\n return contains([ScaleType.TIME, ScaleType.UTC, undefined], specifiedType);\n }\n else if (fieldDefType === QUANTITATIVE) {\n return contains([\n ScaleType.LOG,\n ScaleType.POW,\n ScaleType.SQRT,\n ScaleType.SYMLOG,\n ScaleType.QUANTILE,\n ScaleType.QUANTIZE,\n ScaleType.THRESHOLD,\n ScaleType.LINEAR,\n undefined\n ], specifiedType);\n }\n return true;\n}\nexport function channelSupportScaleType(channel, scaleType) {\n if (!CHANNEL.isScaleChannel(channel)) {\n return false;\n }\n switch (channel) {\n case CHANNEL.X:\n case CHANNEL.Y:\n case CHANNEL.THETA:\n case CHANNEL.RADIUS:\n return isContinuousToContinuous(scaleType) || contains(['band', 'point'], scaleType);\n case CHANNEL.SIZE: // TODO: size and opacity can support ordinal with more modification\n case CHANNEL.STROKEWIDTH:\n case CHANNEL.OPACITY:\n case CHANNEL.FILLOPACITY:\n case CHANNEL.STROKEOPACITY:\n case CHANNEL.ANGLE:\n // Although it generally doesn't make sense to use band with size and opacity,\n // it can also work since we use band: 0.5 to get midpoint.\n return (isContinuousToContinuous(scaleType) ||\n isContinuousToDiscrete(scaleType) ||\n contains(['band', 'point', 'ordinal'], scaleType));\n case CHANNEL.COLOR:\n case CHANNEL.FILL:\n case CHANNEL.STROKE:\n return scaleType !== 'band'; // band does not make sense with color\n case CHANNEL.STROKEDASH:\n return scaleType === 'ordinal' || isContinuousToDiscrete(scaleType);\n case CHANNEL.SHAPE:\n return scaleType === 'ordinal'; // shape = lookup only\n }\n}\n//# sourceMappingURL=scale.js.map","import { signalRefOrValue } from './compile/common';\nimport { keys } from './util';\nimport { isSignalRef } from './vega.schema';\nexport function isExprRef(o) {\n return o && !!o['expr'];\n}\nexport function isExprOrSignalRef(o) {\n return isExprRef(o) || isSignalRef(o);\n}\nexport function replaceExprRefInIndex(index) {\n const props = keys(index || {});\n const newIndex = {};\n for (const prop of props) {\n newIndex[prop] = signalRefOrValue(index[prop]);\n }\n return newIndex;\n}\n//# sourceMappingURL=expr.js.map","import { toSet } from 'vega-util';\nimport { contains, keys } from './util';\n/**\n * All types of primitive marks.\n */\nexport const Mark = {\n arc: 'arc',\n area: 'area',\n bar: 'bar',\n image: 'image',\n line: 'line',\n point: 'point',\n rect: 'rect',\n rule: 'rule',\n text: 'text',\n tick: 'tick',\n trail: 'trail',\n circle: 'circle',\n square: 'square',\n geoshape: 'geoshape'\n};\nexport const ARC = Mark.arc;\nexport const AREA = Mark.area;\nexport const BAR = Mark.bar;\nexport const IMAGE = Mark.image;\nexport const LINE = Mark.line;\nexport const POINT = Mark.point;\nexport const RECT = Mark.rect;\nexport const RULE = Mark.rule;\nexport const TEXT = Mark.text;\nexport const TICK = Mark.tick;\nexport const TRAIL = Mark.trail;\nexport const CIRCLE = Mark.circle;\nexport const SQUARE = Mark.square;\nexport const GEOSHAPE = Mark.geoshape;\nexport function isMark(m) {\n return m in Mark;\n}\nexport function isPathMark(m) {\n return contains(['line', 'area', 'trail'], m);\n}\nexport function isRectBasedMark(m) {\n return contains(['rect', 'bar', 'image', 'arc' /* arc is rect/interval in polar coordinate */], m);\n}\nexport const PRIMITIVE_MARKS = keys(Mark);\nexport function isMarkDef(mark) {\n return mark['type'];\n}\nconst PRIMITIVE_MARK_INDEX = toSet(PRIMITIVE_MARKS);\nexport function isPrimitiveMark(mark) {\n const markType = isMarkDef(mark) ? mark.type : mark;\n return markType in PRIMITIVE_MARK_INDEX;\n}\nexport const STROKE_CONFIG = [\n 'stroke',\n 'strokeWidth',\n 'strokeDash',\n 'strokeDashOffset',\n 'strokeOpacity',\n 'strokeJoin',\n 'strokeMiterLimit'\n];\nexport const FILL_CONFIG = ['fill', 'fillOpacity'];\nexport const FILL_STROKE_CONFIG = [...STROKE_CONFIG, ...FILL_CONFIG];\nconst VL_ONLY_MARK_CONFIG_INDEX = {\n color: 1,\n filled: 1,\n invalid: 1,\n order: 1,\n radius2: 1,\n theta2: 1,\n timeUnitBand: 1,\n timeUnitBandPosition: 1\n};\nexport const VL_ONLY_MARK_CONFIG_PROPERTIES = keys(VL_ONLY_MARK_CONFIG_INDEX);\nexport const VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX = {\n area: ['line', 'point'],\n bar: ['binSpacing', 'continuousBandSize', 'discreteBandSize'],\n rect: ['binSpacing', 'continuousBandSize', 'discreteBandSize'],\n line: ['point'],\n tick: ['bandSize', 'thickness']\n};\nexport const defaultMarkConfig = {\n color: '#4c78a8',\n invalid: 'filter',\n timeUnitBand: 1\n};\nconst MARK_CONFIG_INDEX = {\n mark: 1,\n arc: 1,\n area: 1,\n bar: 1,\n circle: 1,\n image: 1,\n line: 1,\n point: 1,\n rect: 1,\n rule: 1,\n square: 1,\n text: 1,\n tick: 1,\n trail: 1,\n geoshape: 1\n};\nexport const MARK_CONFIGS = keys(MARK_CONFIG_INDEX);\nexport const BAR_CORNER_RADIUS_INDEX = {\n horizontal: ['cornerRadiusTopRight', 'cornerRadiusBottomRight'],\n vertical: ['cornerRadiusTopLeft', 'cornerRadiusTopRight']\n};\nconst DEFAULT_RECT_BAND_SIZE = 5;\nexport const defaultBarConfig = {\n binSpacing: 1,\n continuousBandSize: DEFAULT_RECT_BAND_SIZE,\n timeUnitBandPosition: 0.5\n};\nexport const defaultRectConfig = {\n binSpacing: 0,\n continuousBandSize: DEFAULT_RECT_BAND_SIZE,\n timeUnitBandPosition: 0.5\n};\nexport const defaultTickConfig = {\n thickness: 1\n};\nexport function getMarkType(m) {\n return isMarkDef(m) ? m.type : m;\n}\n//# sourceMappingURL=mark.js.map","import { isFunction, isString } from 'vega-util';\nimport { isCountingAggregateOp } from '../../../aggregate';\nimport { isBinned, isBinning } from '../../../bin';\nimport { getMainRangeChannel, X, X2, Y2 } from '../../../channel';\nimport { binRequiresRange, getBand, isDatumDef, isFieldDef, isFieldOrDatumDef, isTypedFieldDef, isValueDef, vgField } from '../../../channeldef';\nimport { dateTimeToExpr, isDateTime } from '../../../datetime';\nimport { isExprRef } from '../../../expr';\nimport * as log from '../../../log';\nimport { isPathMark } from '../../../mark';\nimport { fieldValidPredicate } from '../../../predicate';\nimport { hasDiscreteDomain, isContinuousToContinuous } from '../../../scale';\nimport { TEMPORAL } from '../../../type';\nimport { contains } from '../../../util';\nimport { isSignalRef } from '../../../vega.schema';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nexport function midPointRefWithPositionInvalidTest(params) {\n const { channel, channelDef, markDef, scale, config } = params;\n const ref = midPoint(params);\n // Wrap to check if the positional value is invalid, if so, plot the point on the min value\n if (\n // Only this for field def without counting aggregate (as count wouldn't be null)\n isFieldDef(channelDef) &&\n !isCountingAggregateOp(channelDef.aggregate) &&\n // and only for continuous scale without zero (otherwise, null / invalid will be interpreted as zero, which doesn't cause layout problem)\n scale &&\n isContinuousToContinuous(scale.get('type')) &&\n scale.get('zero') === false) {\n return wrapPositionInvalidTest({\n fieldDef: channelDef,\n channel,\n markDef,\n ref,\n config\n });\n }\n return ref;\n}\nexport function wrapPositionInvalidTest({ fieldDef, channel, markDef, ref, config }) {\n if (isPathMark(markDef.type)) {\n // path mark already use defined to skip points, no need to do it here.\n return ref;\n }\n const invalid = getMarkPropOrConfig('invalid', markDef, config);\n if (invalid === null) {\n // if there is no invalid filter, don't do the invalid test\n return ref;\n }\n return [fieldInvalidTestValueRef(fieldDef, channel), ref];\n}\nexport function fieldInvalidTestValueRef(fieldDef, channel) {\n const test = fieldInvalidPredicate(fieldDef, true);\n const mainChannel = getMainRangeChannel(channel); // we can cast here as the output can't be other things.\n const zeroValueRef = mainChannel === 'y'\n ? { field: { group: 'height' } }\n : // x / angle / radius can all use 0\n { value: 0 };\n return Object.assign({ test }, zeroValueRef);\n}\nexport function fieldInvalidPredicate(field, invalid = true) {\n return fieldValidPredicate(isString(field) ? field : vgField(field, { expr: 'datum' }), !invalid);\n}\nexport function datumDefToExpr(datumDef) {\n const { datum } = datumDef;\n if (isDateTime(datum)) {\n return dateTimeToExpr(datum);\n }\n return `${JSON.stringify(datum)}`;\n}\nexport function valueRefForFieldOrDatumDef(fieldDef, scaleName, opt, encode) {\n const ref = {};\n if (scaleName) {\n ref.scale = scaleName;\n }\n if (isDatumDef(fieldDef)) {\n const { datum } = fieldDef;\n if (isDateTime(datum)) {\n ref.signal = dateTimeToExpr(datum);\n }\n else if (isSignalRef(datum)) {\n ref.signal = datum.signal;\n }\n else if (isExprRef(datum)) {\n ref.signal = datum.expr;\n }\n else {\n ref.value = datum;\n }\n }\n else {\n ref.field = vgField(fieldDef, opt);\n }\n if (encode) {\n const { offset, band } = encode;\n if (offset) {\n ref.offset = offset;\n }\n if (band) {\n ref.band = band;\n }\n }\n return ref;\n}\n/**\n * Signal that returns the middle of a bin from start and end field. Should only be used with x and y.\n */\nexport function interpolatedSignalRef({ scaleName, fieldOrDatumDef, fieldOrDatumDef2, offset, startSuffix, band = 0.5 }) {\n const expr = 0 < band && band < 1 ? 'datum' : undefined;\n const start = vgField(fieldOrDatumDef, { expr, suffix: startSuffix });\n const end = fieldOrDatumDef2 !== undefined\n ? vgField(fieldOrDatumDef2, { expr })\n : vgField(fieldOrDatumDef, { suffix: 'end', expr });\n const ref = {};\n if (band === 0 || band === 1) {\n ref.scale = scaleName;\n const val = band === 0 ? start : end;\n ref.field = val;\n }\n else {\n const datum = `${band} * ${start} + ${1 - band} * ${end}`;\n ref.signal = `scale(\"${scaleName}\", ${datum})`;\n }\n if (offset) {\n ref.offset = offset;\n }\n return ref;\n}\n/**\n * @returns {VgValueRef} Value Ref for xc / yc or mid point for other channels.\n */\nexport function midPoint({ channel, channelDef, channel2Def, markDef, config, scaleName, scale, stack, offset, defaultRef, band }) {\n var _a;\n // TODO: datum support\n if (channelDef) {\n /* istanbul ignore else */\n if (isFieldOrDatumDef(channelDef)) {\n if (isTypedFieldDef(channelDef)) {\n band = band !== null && band !== void 0 ? band : getBand({\n channel,\n fieldDef: channelDef,\n fieldDef2: channel2Def,\n markDef,\n stack,\n config,\n isMidPoint: true\n });\n const { bin, timeUnit, type } = channelDef;\n if (isBinning(bin) || (band && timeUnit && type === TEMPORAL)) {\n // Use middle only for x an y to place marks in the center between start and end of the bin range.\n // We do not use the mid point for other channels (e.g. size) so that properties of legends and marks match.\n if (stack && stack.impute) {\n // For stack, we computed bin_mid so we can impute.\n return valueRefForFieldOrDatumDef(channelDef, scaleName, { binSuffix: 'mid' }, { offset });\n }\n if (band) {\n // if band = 0, no need to call interpolation\n // For non-stack, we can just calculate bin mid on the fly using signal.\n return interpolatedSignalRef({ scaleName, fieldOrDatumDef: channelDef, band, offset });\n }\n return valueRefForFieldOrDatumDef(channelDef, scaleName, binRequiresRange(channelDef, channel) ? { binSuffix: 'range' } : {}, {\n offset\n });\n }\n else if (isBinned(bin)) {\n if (isFieldDef(channel2Def)) {\n return interpolatedSignalRef({\n scaleName,\n fieldOrDatumDef: channelDef,\n fieldOrDatumDef2: channel2Def,\n band,\n offset\n });\n }\n else {\n const channel2 = channel === X ? X2 : Y2;\n log.warn(log.message.channelRequiredForBinned(channel2));\n }\n }\n }\n const scaleType = scale === null || scale === void 0 ? void 0 : scale.get('type');\n return valueRefForFieldOrDatumDef(channelDef, scaleName, hasDiscreteDomain(scaleType) ? { binSuffix: 'range' } : {}, // no need for bin suffix if there is no scale\n {\n offset,\n // For band, to get mid point, need to offset by half of the band\n band: scaleType === 'band' ? (_a = band !== null && band !== void 0 ? band : channelDef.band) !== null && _a !== void 0 ? _a : 0.5 : undefined\n });\n }\n else if (isValueDef(channelDef)) {\n const value = channelDef.value;\n const offsetMixins = offset ? { offset } : {};\n return Object.assign(Object.assign({}, widthHeightValueOrSignalRef(channel, value)), offsetMixins);\n }\n // If channelDef is neither field def or value def, it's a condition-only def.\n // In such case, we will use default ref.\n }\n if (isFunction(defaultRef)) {\n defaultRef = defaultRef();\n }\n if (defaultRef) {\n // for non-position, ref could be undefined.\n return Object.assign(Object.assign({}, defaultRef), (offset ? { offset } : {}));\n }\n return defaultRef;\n}\n/**\n * Convert special \"width\" and \"height\" values in Vega-Lite into Vega value ref.\n */\nexport function widthHeightValueOrSignalRef(channel, value) {\n if (contains(['x', 'x2'], channel) && value === 'width') {\n return { field: { group: 'width' } };\n }\n else if (contains(['y', 'y2'], channel) && value === 'height') {\n return { field: { group: 'height' } };\n }\n return signalOrValueRef(value);\n}\n//# sourceMappingURL=valueref.js.map","import { isString } from 'vega-util';\nimport { isBinning } from '../bin';\nimport { channelDefType, isFieldDef, isFieldOrDatumDefForTimeFormat, isScaleFieldDef, vgField } from '../channeldef';\nimport { fieldValidPredicate } from '../predicate';\nimport { ScaleType } from '../scale';\nimport { formatExpression, normalizeTimeUnit, timeUnitSpecifierExpression } from '../timeunit';\nimport { QUANTITATIVE } from '../type';\nimport { isSignalRef } from '../vega.schema';\nimport { datumDefToExpr } from './mark/encode/valueref';\nexport function isCustomFormatType(formatType) {\n return formatType && formatType !== 'number' && formatType !== 'time';\n}\nfunction customFormatExpr(formatType, field, format) {\n return `${formatType}(${field}${format ? `, ${JSON.stringify(format)}` : ''})`;\n}\nexport const BIN_RANGE_DELIMITER = ' \\u2013 ';\nexport function formatSignalRef({ fieldOrDatumDef, format, formatType, expr, normalizeStack, config }) {\n var _a, _b;\n if (isCustomFormatType(formatType)) {\n return formatCustomType({\n fieldOrDatumDef,\n format,\n formatType,\n expr,\n config\n });\n }\n const field = fieldToFormat(fieldOrDatumDef, expr, normalizeStack);\n if (isFieldOrDatumDefForTimeFormat(fieldOrDatumDef)) {\n const signal = timeFormatExpression(field, isFieldDef(fieldOrDatumDef) ? (_a = normalizeTimeUnit(fieldOrDatumDef.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit : undefined, format, config.timeFormat, isScaleFieldDef(fieldOrDatumDef) && ((_b = fieldOrDatumDef.scale) === null || _b === void 0 ? void 0 : _b.type) === ScaleType.UTC);\n return signal ? { signal } : undefined;\n }\n format = numberFormat(channelDefType(fieldOrDatumDef), format, config);\n if (isFieldDef(fieldOrDatumDef) && isBinning(fieldOrDatumDef.bin)) {\n const endField = vgField(fieldOrDatumDef, { expr, binSuffix: 'end' });\n return {\n signal: binFormatExpression(field, endField, format, formatType, config)\n };\n }\n else if (format || channelDefType(fieldOrDatumDef) === 'quantitative') {\n return {\n signal: `${formatExpr(field, format)}`\n };\n }\n else {\n return { signal: `isValid(${field}) ? ${field} : \"\"+${field}` };\n }\n}\nfunction fieldToFormat(fieldOrDatumDef, expr, normalizeStack) {\n if (isFieldDef(fieldOrDatumDef)) {\n if (normalizeStack) {\n return `${vgField(fieldOrDatumDef, { expr, suffix: 'end' })}-${vgField(fieldOrDatumDef, {\n expr,\n suffix: 'start'\n })}`;\n }\n else {\n return vgField(fieldOrDatumDef, { expr });\n }\n }\n else {\n return datumDefToExpr(fieldOrDatumDef);\n }\n}\nexport function formatCustomType({ fieldOrDatumDef, format, formatType, expr, normalizeStack, config, field }) {\n field = field !== null && field !== void 0 ? field : fieldToFormat(fieldOrDatumDef, expr, normalizeStack);\n if (isFieldDef(fieldOrDatumDef) && isBinning(fieldOrDatumDef.bin)) {\n const endField = vgField(fieldOrDatumDef, { expr, binSuffix: 'end' });\n return {\n signal: binFormatExpression(field, endField, format, formatType, config)\n };\n }\n return { signal: customFormatExpr(formatType, field, format) };\n}\nexport function guideFormat(fieldOrDatumDef, type, format, formatType, config, omitTimeFormatConfig // axis doesn't use config.timeFormat\n) {\n var _a;\n if (isCustomFormatType(formatType)) {\n return undefined; // handled in encode block\n }\n if (isFieldOrDatumDefForTimeFormat(fieldOrDatumDef)) {\n const timeUnit = isFieldDef(fieldOrDatumDef) ? (_a = normalizeTimeUnit(fieldOrDatumDef.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit : undefined;\n return timeFormat(format, timeUnit, config, omitTimeFormatConfig);\n }\n return numberFormat(type, format, config);\n}\nexport function guideFormatType(formatType, fieldOrDatumDef, scaleType) {\n if (formatType && (isSignalRef(formatType) || formatType === 'number' || formatType === 'time')) {\n return formatType;\n }\n if (isFieldOrDatumDefForTimeFormat(fieldOrDatumDef) && scaleType !== 'time' && scaleType !== 'utc') {\n return 'time';\n }\n return undefined;\n}\n/**\n * Returns number format for a fieldDef.\n */\nexport function numberFormat(type, specifiedFormat, config) {\n // Specified format in axis/legend has higher precedence than fieldDef.format\n if (isString(specifiedFormat)) {\n return specifiedFormat;\n }\n if (type === QUANTITATIVE) {\n // we only apply the default if the field is quantitative\n return config.numberFormat;\n }\n return undefined;\n}\n/**\n * Returns time format for a fieldDef for use in guides.\n */\nexport function timeFormat(specifiedFormat, timeUnit, config, omitTimeFormatConfig) {\n if (specifiedFormat) {\n return specifiedFormat;\n }\n if (timeUnit) {\n return {\n signal: timeUnitSpecifierExpression(timeUnit)\n };\n }\n return omitTimeFormatConfig ? undefined : config.timeFormat;\n}\nfunction formatExpr(field, format) {\n return `format(${field}, \"${format || ''}\")`;\n}\nfunction binNumberFormatExpr(field, format, formatType, config) {\n var _a;\n if (isCustomFormatType(formatType)) {\n return customFormatExpr(formatType, field, format);\n }\n return formatExpr(field, (_a = (isString(format) ? format : undefined)) !== null && _a !== void 0 ? _a : config.numberFormat);\n}\nexport function binFormatExpression(startField, endField, format, formatType, config) {\n const start = binNumberFormatExpr(startField, format, formatType, config);\n const end = binNumberFormatExpr(endField, format, formatType, config);\n return `${fieldValidPredicate(startField, false)} ? \"null\" : ${start} + \"${BIN_RANGE_DELIMITER}\" + ${end}`;\n}\n/**\n * Returns the time expression used for axis/legend labels or text mark for a temporal field\n */\nexport function timeFormatExpression(field, timeUnit, format, rawTimeFormat, // should be provided only for actual text and headers, not axis/legend labels\nisUTCScale) {\n if (!timeUnit || format) {\n // If there is no time unit, or if user explicitly specifies format for axis/legend/text.\n format = isString(format) ? format : rawTimeFormat; // only use provided timeFormat if there is no timeUnit.\n return `${isUTCScale ? 'utc' : 'time'}Format(${field}, '${format}')`;\n }\n else {\n return formatExpression(timeUnit, field, isUTCScale);\n }\n}\n//# sourceMappingURL=format.js.map","import { isArray } from 'vega-util';\nexport const DEFAULT_SORT_OP = 'min';\nconst SORT_BY_CHANNEL_INDEX = {\n x: 1,\n y: 1,\n color: 1,\n fill: 1,\n stroke: 1,\n strokeWidth: 1,\n size: 1,\n shape: 1,\n fillOpacity: 1,\n strokeOpacity: 1,\n opacity: 1,\n text: 1\n};\nexport function isSortByChannel(c) {\n return c in SORT_BY_CHANNEL_INDEX;\n}\nexport function isSortByEncoding(sort) {\n return !!sort && !!sort['encoding'];\n}\nexport function isSortField(sort) {\n return !!sort && (sort['op'] === 'count' || !!sort['field']);\n}\nexport function isSortArray(sort) {\n return !!sort && isArray(sort);\n}\n//# sourceMappingURL=sort.js.map","export function isFacetMapping(f) {\n return 'row' in f || 'column' in f;\n}\nexport function isFacetFieldDef(channelDef) {\n return !!channelDef && 'header' in channelDef;\n}\nexport function isFacetSpec(spec) {\n return 'facet' in spec;\n}\n//# sourceMappingURL=facet.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray, isBoolean, isNumber, isString } from 'vega-util';\nimport { isAggregateOp, isArgmaxDef, isArgminDef, isCountingAggregateOp } from './aggregate';\nimport { autoMaxBins, binToString, isBinned, isBinning } from './bin';\nimport { ANGLE, COLOR, COLUMN, DESCRIPTION, DETAIL, FACET, FILL, FILLOPACITY, HREF, isScaleChannel, isSecondaryRangeChannel, isXorY, KEY, LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2, OPACITY, ORDER, RADIUS, RADIUS2, ROW, SHAPE, SIZE, STROKE, STROKEDASH, STROKEOPACITY, STROKEWIDTH, TEXT, THETA, THETA2, TOOLTIP, URL, X, X2, Y, Y2 } from './channel';\nimport { getMarkConfig } from './compile/common';\nimport { isCustomFormatType } from './compile/format';\nimport { dateTimeToExpr, isDateTime } from './datetime';\nimport { isExprRef } from './expr';\nimport * as log from './log';\nimport { isRectBasedMark } from './mark';\nimport { SCALE_CATEGORY_INDEX } from './scale';\nimport { isSortByChannel } from './sort';\nimport { isFacetFieldDef } from './spec/facet';\nimport { getTimeUnitParts, isLocalSingleTimeUnit, normalizeTimeUnit, timeUnitToString } from './timeunit';\nimport { getFullName, QUANTITATIVE } from './type';\nimport { contains, flatAccessWithDatum, getFirstDefined, internalField, omit, removePathFromField, replacePathInField, titleCase } from './util';\nimport { isSignalRef } from './vega.schema';\nexport function isConditionalSelection(c) {\n return c['selection'];\n}\nexport function isRepeatRef(field) {\n return field && !isString(field) && 'repeat' in field;\n}\nexport function toFieldDefBase(fieldDef) {\n const { field, timeUnit, bin, aggregate } = fieldDef;\n return Object.assign(Object.assign(Object.assign(Object.assign({}, (timeUnit ? { timeUnit } : {})), (bin ? { bin } : {})), (aggregate ? { aggregate } : {})), { field });\n}\nexport function isSortableFieldDef(fieldDef) {\n return 'sort' in fieldDef;\n}\nexport function getBand({ channel, fieldDef, fieldDef2, markDef: mark, stack, config, isMidPoint }) {\n if (isFieldOrDatumDef(fieldDef) && fieldDef.band !== undefined) {\n return fieldDef.band;\n }\n if (isFieldDef(fieldDef)) {\n const { timeUnit, bin } = fieldDef;\n if (timeUnit && !fieldDef2) {\n if (isMidPoint) {\n return getMarkConfig('timeUnitBandPosition', mark, config);\n }\n else {\n return isRectBasedMark(mark.type) ? getMarkConfig('timeUnitBand', mark, config) : 0;\n }\n }\n else if (isBinning(bin)) {\n return isRectBasedMark(mark.type) && !isMidPoint ? 1 : 0.5;\n }\n }\n if ((stack === null || stack === void 0 ? void 0 : stack.fieldChannel) === channel && isMidPoint) {\n return 0.5;\n }\n return undefined;\n}\nexport function hasBand(channel, fieldDef, fieldDef2, stack, markDef, config) {\n if (isBinning(fieldDef.bin) || (fieldDef.timeUnit && isTypedFieldDef(fieldDef) && fieldDef.type === 'temporal')) {\n return !!getBand({ channel, fieldDef, fieldDef2, stack, markDef, config });\n }\n return false;\n}\nexport function isConditionalDef(channelDef) {\n return !!channelDef && 'condition' in channelDef;\n}\n/**\n * Return if a channelDef is a ConditionalValueDef with ConditionFieldDef\n */\nexport function hasConditionalFieldDef(channelDef) {\n const condition = channelDef && channelDef['condition'];\n return !!condition && !isArray(condition) && isFieldDef(condition);\n}\nexport function hasConditionalFieldOrDatumDef(channelDef) {\n const condition = channelDef && channelDef['condition'];\n return !!condition && !isArray(condition) && isFieldOrDatumDef(condition);\n}\nexport function hasConditionalValueDef(channelDef) {\n const condition = channelDef && channelDef['condition'];\n return !!condition && (isArray(condition) || isValueDef(condition));\n}\nexport function isFieldDef(channelDef) {\n // TODO: we can't use field in channelDef here as it's somehow failing runtime test\n return !!channelDef && (!!channelDef['field'] || channelDef['aggregate'] === 'count');\n}\nexport function channelDefType(channelDef) {\n return channelDef && channelDef['type'];\n}\nexport function isDatumDef(channelDef) {\n return !!channelDef && 'datum' in channelDef;\n}\nexport function isContinuousFieldOrDatumDef(cd) {\n // TODO: make datum support DateTime object\n return (isTypedFieldDef(cd) && isContinuous(cd)) || isNumericDataDef(cd);\n}\nexport function isQuantitativeFieldOrDatumDef(cd) {\n // TODO: make datum support DateTime object\n return channelDefType(cd) === 'quantitative' || isNumericDataDef(cd);\n}\nexport function isNumericDataDef(cd) {\n return isDatumDef(cd) && isNumber(cd.datum);\n}\nexport function isFieldOrDatumDef(channelDef) {\n return isFieldDef(channelDef) || isDatumDef(channelDef);\n}\nexport function isTypedFieldDef(channelDef) {\n return !!channelDef && ('field' in channelDef || channelDef['aggregate'] === 'count') && 'type' in channelDef;\n}\nexport function isValueDef(channelDef) {\n return channelDef && 'value' in channelDef && 'value' in channelDef;\n}\nexport function isScaleFieldDef(channelDef) {\n return !!channelDef && ('scale' in channelDef || 'sort' in channelDef);\n}\nexport function isPositionFieldOrDatumDef(channelDef) {\n return channelDef && ('axis' in channelDef || 'stack' in channelDef || 'impute' in channelDef);\n}\nexport function isMarkPropFieldOrDatumDef(channelDef) {\n return !!channelDef && 'legend' in channelDef;\n}\nexport function isStringFieldOrDatumDef(channelDef) {\n return !!channelDef && ('format' in channelDef || 'formatType' in channelDef);\n}\nexport function toStringFieldDef(fieldDef) {\n // omit properties that don't exist in string field defs\n return omit(fieldDef, ['legend', 'axis', 'header', 'scale']);\n}\nfunction isOpFieldDef(fieldDef) {\n return 'op' in fieldDef;\n}\n/**\n * Get a Vega field reference from a Vega-Lite field def.\n */\nexport function vgField(fieldDef, opt = {}) {\n var _a, _b, _c;\n let field = fieldDef.field;\n const prefix = opt.prefix;\n let suffix = opt.suffix;\n let argAccessor = ''; // for accessing argmin/argmax field at the end without getting escaped\n if (isCount(fieldDef)) {\n field = internalField('count');\n }\n else {\n let fn;\n if (!opt.nofn) {\n if (isOpFieldDef(fieldDef)) {\n fn = fieldDef.op;\n }\n else {\n const { bin, aggregate, timeUnit } = fieldDef;\n if (isBinning(bin)) {\n fn = binToString(bin);\n suffix = ((_a = opt.binSuffix) !== null && _a !== void 0 ? _a : '') + ((_b = opt.suffix) !== null && _b !== void 0 ? _b : '');\n }\n else if (aggregate) {\n if (isArgmaxDef(aggregate)) {\n argAccessor = `[\"${field}\"]`;\n field = `argmax_${aggregate.argmax}`;\n }\n else if (isArgminDef(aggregate)) {\n argAccessor = `[\"${field}\"]`;\n field = `argmin_${aggregate.argmin}`;\n }\n else {\n fn = String(aggregate);\n }\n }\n else if (timeUnit) {\n fn = timeUnitToString(timeUnit);\n suffix = ((!contains(['range', 'mid'], opt.binSuffix) && opt.binSuffix) || '') + ((_c = opt.suffix) !== null && _c !== void 0 ? _c : '');\n }\n }\n }\n if (fn) {\n field = field ? `${fn}_${field}` : fn;\n }\n }\n if (suffix) {\n field = `${field}_${suffix}`;\n }\n if (prefix) {\n field = `${prefix}_${field}`;\n }\n if (opt.forAs) {\n return removePathFromField(field);\n }\n else if (opt.expr) {\n // Expression to access flattened field. No need to escape dots.\n return flatAccessWithDatum(field, opt.expr) + argAccessor;\n }\n else {\n // We flattened all fields so paths should have become dot.\n return replacePathInField(field) + argAccessor;\n }\n}\nexport function isDiscrete(def) {\n switch (def.type) {\n case 'nominal':\n case 'ordinal':\n case 'geojson':\n return true;\n case 'quantitative':\n return isFieldDef(def) && !!def.bin;\n case 'temporal':\n return false;\n }\n throw new Error(log.message.invalidFieldType(def.type));\n}\nexport function isContinuous(fieldDef) {\n return !isDiscrete(fieldDef);\n}\nexport function isCount(fieldDef) {\n return fieldDef.aggregate === 'count';\n}\nexport function verbalTitleFormatter(fieldDef, config) {\n var _a;\n const { field, bin, timeUnit, aggregate } = fieldDef;\n if (aggregate === 'count') {\n return config.countTitle;\n }\n else if (isBinning(bin)) {\n return `${field} (binned)`;\n }\n else if (timeUnit) {\n const unit = (_a = normalizeTimeUnit(timeUnit)) === null || _a === void 0 ? void 0 : _a.unit;\n if (unit) {\n return `${field} (${getTimeUnitParts(unit).join('-')})`;\n }\n }\n else if (aggregate) {\n if (isArgmaxDef(aggregate)) {\n return `${field} for max ${aggregate.argmax}`;\n }\n else if (isArgminDef(aggregate)) {\n return `${field} for min ${aggregate.argmin}`;\n }\n else {\n return `${titleCase(aggregate)} of ${field}`;\n }\n }\n return field;\n}\nexport function functionalTitleFormatter(fieldDef) {\n const { aggregate, bin, timeUnit, field } = fieldDef;\n if (isArgmaxDef(aggregate)) {\n return `${field} for argmax(${aggregate.argmax})`;\n }\n else if (isArgminDef(aggregate)) {\n return `${field} for argmin(${aggregate.argmin})`;\n }\n const timeUnitParams = normalizeTimeUnit(timeUnit);\n const fn = aggregate || (timeUnitParams === null || timeUnitParams === void 0 ? void 0 : timeUnitParams.unit) || ((timeUnitParams === null || timeUnitParams === void 0 ? void 0 : timeUnitParams.maxbins) && 'timeunit') || (isBinning(bin) && 'bin');\n if (fn) {\n return fn.toUpperCase() + '(' + field + ')';\n }\n else {\n return field;\n }\n}\nexport const defaultTitleFormatter = (fieldDef, config) => {\n switch (config.fieldTitle) {\n case 'plain':\n return fieldDef.field;\n case 'functional':\n return functionalTitleFormatter(fieldDef);\n default:\n return verbalTitleFormatter(fieldDef, config);\n }\n};\nlet titleFormatter = defaultTitleFormatter;\nexport function setTitleFormatter(formatter) {\n titleFormatter = formatter;\n}\nexport function resetTitleFormatter() {\n setTitleFormatter(defaultTitleFormatter);\n}\nexport function title(fieldOrDatumDef, config, { allowDisabling, includeDefault = true }) {\n var _a, _b;\n const guideTitle = (_a = getGuide(fieldOrDatumDef)) === null || _a === void 0 ? void 0 : _a.title;\n if (!isFieldDef(fieldOrDatumDef)) {\n return guideTitle;\n }\n const fieldDef = fieldOrDatumDef;\n const def = includeDefault ? defaultTitle(fieldDef, config) : undefined;\n if (allowDisabling) {\n return getFirstDefined(guideTitle, fieldDef.title, def);\n }\n else {\n return (_b = guideTitle !== null && guideTitle !== void 0 ? guideTitle : fieldDef.title) !== null && _b !== void 0 ? _b : def;\n }\n}\nexport function getGuide(fieldDef) {\n if (isPositionFieldOrDatumDef(fieldDef) && fieldDef.axis) {\n return fieldDef.axis;\n }\n else if (isMarkPropFieldOrDatumDef(fieldDef) && fieldDef.legend) {\n return fieldDef.legend;\n }\n else if (isFacetFieldDef(fieldDef) && fieldDef.header) {\n return fieldDef.header;\n }\n return undefined;\n}\nexport function defaultTitle(fieldDef, config) {\n return titleFormatter(fieldDef, config);\n}\nexport function getFormatMixins(fieldDef) {\n var _a;\n if (isStringFieldOrDatumDef(fieldDef)) {\n const { format, formatType } = fieldDef;\n return { format, formatType };\n }\n else {\n const guide = (_a = getGuide(fieldDef)) !== null && _a !== void 0 ? _a : {};\n const { format, formatType } = guide;\n return { format, formatType };\n }\n}\nexport function defaultType(fieldDef, channel) {\n var _a;\n switch (channel) {\n case 'latitude':\n case 'longitude':\n return 'quantitative';\n case 'row':\n case 'column':\n case 'facet':\n case 'shape':\n case 'strokeDash':\n return 'nominal';\n case 'order':\n return 'ordinal';\n }\n if (isSortableFieldDef(fieldDef) && isArray(fieldDef.sort)) {\n return 'ordinal';\n }\n const { aggregate, bin, timeUnit } = fieldDef;\n if (timeUnit) {\n return 'temporal';\n }\n if (bin || (aggregate && !isArgmaxDef(aggregate) && !isArgminDef(aggregate))) {\n return 'quantitative';\n }\n if (isScaleFieldDef(fieldDef) && ((_a = fieldDef.scale) === null || _a === void 0 ? void 0 : _a.type)) {\n switch (SCALE_CATEGORY_INDEX[fieldDef.scale.type]) {\n case 'numeric':\n case 'discretizing':\n return 'quantitative';\n case 'time':\n return 'temporal';\n }\n }\n return 'nominal';\n}\n/**\n * Returns the fieldDef -- either from the outer channelDef or from the condition of channelDef.\n * @param channelDef\n */\nexport function getFieldDef(channelDef) {\n if (isFieldDef(channelDef)) {\n return channelDef;\n }\n else if (hasConditionalFieldDef(channelDef)) {\n return channelDef.condition;\n }\n return undefined;\n}\nexport function getFieldOrDatumDef(channelDef) {\n if (isFieldOrDatumDef(channelDef)) {\n return channelDef;\n }\n else if (hasConditionalFieldOrDatumDef(channelDef)) {\n return channelDef.condition;\n }\n return undefined;\n}\n/**\n * Convert type to full, lowercase type, or augment the fieldDef with a default type if missing.\n */\nexport function initChannelDef(channelDef, channel, config, opt = {}) {\n if (isString(channelDef) || isNumber(channelDef) || isBoolean(channelDef)) {\n const primitiveType = isString(channelDef) ? 'string' : isNumber(channelDef) ? 'number' : 'boolean';\n log.warn(log.message.primitiveChannelDef(channel, primitiveType, channelDef));\n return { value: channelDef };\n }\n // If a fieldDef contains a field, we need type.\n if (isFieldOrDatumDef(channelDef)) {\n return initFieldOrDatumDef(channelDef, channel, config, opt);\n }\n else if (hasConditionalFieldOrDatumDef(channelDef)) {\n return Object.assign(Object.assign({}, channelDef), { \n // Need to cast as normalizeFieldDef normally return FieldDef, but here we know that it is definitely Condition\n condition: initFieldOrDatumDef(channelDef.condition, channel, config, opt) });\n }\n return channelDef;\n}\nexport function initFieldOrDatumDef(fd, channel, config, opt) {\n if (isStringFieldOrDatumDef(fd)) {\n const { format, formatType } = fd, rest = __rest(fd, [\"format\", \"formatType\"]);\n if (isCustomFormatType(formatType) && !config.customFormatTypes) {\n log.warn(log.message.customFormatTypeNotAllowed(channel));\n return initFieldOrDatumDef(rest, channel, config, opt);\n }\n }\n else {\n const guideType = isPositionFieldOrDatumDef(fd)\n ? 'axis'\n : isMarkPropFieldOrDatumDef(fd)\n ? 'legend'\n : isFacetFieldDef(fd)\n ? 'header'\n : null;\n if (guideType && fd[guideType]) {\n const _a = fd[guideType], { format, formatType } = _a, newGuide = __rest(_a, [\"format\", \"formatType\"]);\n if (isCustomFormatType(formatType) && !config.customFormatTypes) {\n log.warn(log.message.customFormatTypeNotAllowed(channel));\n return initFieldOrDatumDef(Object.assign(Object.assign({}, fd), { [guideType]: newGuide }), channel, config, opt);\n }\n }\n }\n if (isFieldDef(fd)) {\n return initFieldDef(fd, channel, opt);\n }\n return initDatumDef(fd);\n}\nfunction initDatumDef(datumDef) {\n let type = datumDef['type'];\n if (type) {\n return datumDef;\n }\n const { datum } = datumDef;\n type = isNumber(datum) ? 'quantitative' : isString(datum) ? 'nominal' : isDateTime(datum) ? 'temporal' : undefined;\n return Object.assign(Object.assign({}, datumDef), { type });\n}\nexport function initFieldDef(fd, channel, { compositeMark = false } = {}) {\n const { aggregate, timeUnit, bin, field } = fd;\n const fieldDef = Object.assign({}, fd);\n // Drop invalid aggregate\n if (!compositeMark && aggregate && !isAggregateOp(aggregate) && !isArgmaxDef(aggregate) && !isArgminDef(aggregate)) {\n log.warn(log.message.invalidAggregate(aggregate));\n delete fieldDef.aggregate;\n }\n // Normalize Time Unit\n if (timeUnit) {\n fieldDef.timeUnit = normalizeTimeUnit(timeUnit);\n }\n if (field) {\n fieldDef.field = `${field}`;\n }\n // Normalize bin\n if (isBinning(bin)) {\n fieldDef.bin = normalizeBin(bin, channel);\n }\n if (isBinned(bin) && !isXorY(channel)) {\n log.warn(log.message.channelShouldNotBeUsedForBinned(channel));\n }\n // Normalize Type\n if (isTypedFieldDef(fieldDef)) {\n const { type } = fieldDef;\n const fullType = getFullName(type);\n if (type !== fullType) {\n // convert short type to full type\n fieldDef.type = fullType;\n }\n if (type !== 'quantitative') {\n if (isCountingAggregateOp(aggregate)) {\n log.warn(log.message.invalidFieldTypeForCountAggregate(type, aggregate));\n fieldDef.type = 'quantitative';\n }\n }\n }\n else if (!isSecondaryRangeChannel(channel)) {\n // If type is empty / invalid, then augment with default type\n const newType = defaultType(fieldDef, channel);\n fieldDef['type'] = newType;\n }\n if (isTypedFieldDef(fieldDef)) {\n const { compatible, warning } = channelCompatibility(fieldDef, channel) || {};\n if (compatible === false) {\n log.warn(warning);\n }\n }\n if (isSortableFieldDef(fieldDef) && isString(fieldDef.sort)) {\n const { sort } = fieldDef;\n if (isSortByChannel(sort)) {\n return Object.assign(Object.assign({}, fieldDef), { sort: { encoding: sort } });\n }\n const sub = sort.substr(1);\n if (sort.charAt(0) === '-' && isSortByChannel(sub)) {\n return Object.assign(Object.assign({}, fieldDef), { sort: { encoding: sub, order: 'descending' } });\n }\n }\n if (isFacetFieldDef(fieldDef)) {\n const { header } = fieldDef;\n const { orient } = header, rest = __rest(header, [\"orient\"]);\n if (orient) {\n return Object.assign(Object.assign({}, fieldDef), { header: Object.assign(Object.assign({}, rest), { labelOrient: header.labelOrient || orient, titleOrient: header.titleOrient || orient }) });\n }\n }\n return fieldDef;\n}\nexport function normalizeBin(bin, channel) {\n if (isBoolean(bin)) {\n return { maxbins: autoMaxBins(channel) };\n }\n else if (bin === 'binned') {\n return {\n binned: true\n };\n }\n else if (!bin.maxbins && !bin.step) {\n return Object.assign(Object.assign({}, bin), { maxbins: autoMaxBins(channel) });\n }\n else {\n return bin;\n }\n}\nconst COMPATIBLE = { compatible: true };\nexport function channelCompatibility(fieldDef, channel) {\n const type = fieldDef.type;\n if (type === 'geojson' && channel !== 'shape') {\n return {\n compatible: false,\n warning: `Channel ${channel} should not be used with a geojson data.`\n };\n }\n switch (channel) {\n case ROW:\n case COLUMN:\n case FACET:\n if (isContinuous(fieldDef)) {\n return {\n compatible: false,\n warning: log.message.facetChannelShouldBeDiscrete(channel)\n };\n }\n return COMPATIBLE;\n case X:\n case Y:\n case COLOR:\n case FILL:\n case STROKE:\n case TEXT:\n case DETAIL:\n case KEY:\n case TOOLTIP:\n case HREF:\n case URL:\n case ANGLE:\n case THETA:\n case RADIUS:\n case DESCRIPTION:\n return COMPATIBLE;\n case LONGITUDE:\n case LONGITUDE2:\n case LATITUDE:\n case LATITUDE2:\n if (type !== QUANTITATIVE) {\n return {\n compatible: false,\n warning: `Channel ${channel} should be used with a quantitative field only, not ${fieldDef.type} field.`\n };\n }\n return COMPATIBLE;\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n case STROKEWIDTH:\n case SIZE:\n case THETA2:\n case RADIUS2:\n case X2:\n case Y2:\n if (type === 'nominal' && !fieldDef['sort']) {\n return {\n compatible: false,\n warning: `Channel ${channel} should not be used with an unsorted discrete field.`\n };\n }\n return COMPATIBLE;\n case STROKEDASH:\n if (!contains(['ordinal', 'nominal'], fieldDef.type)) {\n return {\n compatible: false,\n warning: 'StrokeDash channel should be used with only discrete data.'\n };\n }\n return COMPATIBLE;\n case SHAPE:\n if (!contains(['ordinal', 'nominal', 'geojson'], fieldDef.type)) {\n return {\n compatible: false,\n warning: 'Shape channel should be used with only either discrete or geojson data.'\n };\n }\n return COMPATIBLE;\n case ORDER:\n if (fieldDef.type === 'nominal' && !('sort' in fieldDef)) {\n return {\n compatible: false,\n warning: `Channel order is inappropriate for nominal field, which has no inherent order.`\n };\n }\n return COMPATIBLE;\n }\n}\n/**\n * Check if the field def uses a time format or does not use any format but is temporal\n * (this does not cover field defs that are temporal but use a number format).\n */\nexport function isFieldOrDatumDefForTimeFormat(fieldOrDatumDef) {\n const { formatType } = getFormatMixins(fieldOrDatumDef);\n return formatType === 'time' || (!formatType && isTimeFieldDef(fieldOrDatumDef));\n}\n/**\n * Check if field def has type `temporal`. If you want to also cover field defs that use a time format, use `isTimeFormatFieldDef`.\n */\nexport function isTimeFieldDef(def) {\n return def && (def['type'] === 'temporal' || (isFieldDef(def) && !!def.timeUnit));\n}\n/**\n * Getting a value associated with a fielddef.\n * Convert the value to Vega expression if applicable (for datetime object, or string if the field def is temporal or has timeUnit)\n */\nexport function valueExpr(v, { timeUnit, type, wrapTime, undefinedIfExprNotRequired }) {\n var _a;\n const unit = timeUnit && ((_a = normalizeTimeUnit(timeUnit)) === null || _a === void 0 ? void 0 : _a.unit);\n let isTime = unit || type === 'temporal';\n let expr;\n if (isExprRef(v)) {\n expr = v.expr;\n }\n else if (isSignalRef(v)) {\n expr = v.signal;\n }\n else if (isDateTime(v)) {\n isTime = true;\n expr = dateTimeToExpr(v);\n }\n else if (isString(v) || isNumber(v)) {\n if (isTime) {\n expr = `datetime(${JSON.stringify(v)})`;\n if (isLocalSingleTimeUnit(unit)) {\n // for single timeUnit, we will use dateTimeToExpr to convert number/string to match the timeUnit\n if ((isNumber(v) && v < 10000) || (isString(v) && isNaN(Date.parse(v)))) {\n expr = dateTimeToExpr({ [unit]: v });\n }\n }\n }\n }\n if (expr) {\n return wrapTime && isTime ? `time(${expr})` : expr;\n }\n // number or boolean or normal string\n return undefinedIfExprNotRequired ? undefined : JSON.stringify(v);\n}\n/**\n * Standardize value array -- convert each value to Vega expression if applicable\n */\nexport function valueArray(fieldOrDatumDef, values) {\n const { type } = fieldOrDatumDef;\n return values.map(v => {\n const expr = valueExpr(v, {\n timeUnit: isFieldDef(fieldOrDatumDef) ? fieldOrDatumDef.timeUnit : undefined,\n type,\n undefinedIfExprNotRequired: true\n });\n // return signal for the expression if we need an expression\n if (expr !== undefined) {\n return { signal: expr };\n }\n // otherwise just return the original value\n return v;\n });\n}\n/**\n * Checks whether a fieldDef for a particular channel requires a computed bin range.\n */\nexport function binRequiresRange(fieldDef, channel) {\n if (!isBinning(fieldDef.bin)) {\n console.warn('Only call this method for binned field defs.');\n return false;\n }\n // We need the range only when the user explicitly forces a binned field to be use discrete scale. In this case, bin range is used in axis and legend labels.\n // We could check whether the axis or legend exists (not disabled) but that seems overkill.\n return isScaleChannel(channel) && contains(['ordinal', 'nominal'], fieldDef.type);\n}\n//# sourceMappingURL=channeldef.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray, isString } from 'vega-util';\nimport { pick } from './util';\nexport function extractTitleConfig(titleConfig) {\n const { \n // These are non-mark title config that need to be hardcoded\n anchor, frame, offset, orient, \n // color needs to be redirect to fill\n color, \n // subtitle properties\n subtitleColor, subtitleFont, subtitleFontSize, subtitleFontStyle, subtitleFontWeight, subtitleLineHeight, subtitlePadding } = titleConfig, \n // The rest are mark config.\n rest = __rest(titleConfig, [\"anchor\", \"frame\", \"offset\", \"orient\", \"color\", \"subtitleColor\", \"subtitleFont\", \"subtitleFontSize\", \"subtitleFontStyle\", \"subtitleFontWeight\", \"subtitleLineHeight\", \"subtitlePadding\"]);\n const titleMarkConfig = Object.assign(Object.assign({}, rest), (color ? { fill: color } : {}));\n // These are non-mark title config that need to be hardcoded\n const nonMark = Object.assign(Object.assign(Object.assign(Object.assign({}, (anchor ? { anchor } : {})), (frame ? { frame } : {})), (offset ? { offset } : {})), (orient ? { orient } : {}));\n // subtitle part can stay in config.title since header titles do not use subtitle\n const subtitle = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (subtitleColor ? { subtitleColor } : {})), (subtitleFont ? { subtitleFont } : {})), (subtitleFontSize ? { subtitleFontSize } : {})), (subtitleFontStyle ? { subtitleFontStyle } : {})), (subtitleFontWeight ? { subtitleFontWeight } : {})), (subtitleLineHeight ? { subtitleLineHeight } : {})), (subtitlePadding ? { subtitlePadding } : {}));\n const subtitleMarkConfig = pick(titleMarkConfig, ['align', 'baseline', 'dx', 'dy', 'limit']);\n return { titleMarkConfig, subtitleMarkConfig, nonMark, subtitle };\n}\nexport function isText(v) {\n return isString(v) || (isArray(v) && isString(v[0]));\n}\n//# sourceMappingURL=title.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array, isArray, stringValue } from 'vega-util';\nimport { vgField } from '../channeldef';\nimport { isExprRef } from '../expr';\nimport { isText } from '../title';\nimport { deepEqual, getFirstDefined } from '../util';\nimport { isSignalRef } from '../vega.schema';\nexport const BIN_RANGE_DELIMITER = ' \\u2013 ';\nexport function signalOrValueRefWithCondition(val) {\n const condition = isArray(val.condition)\n ? val.condition.map(conditionalSignalRefOrValue)\n : conditionalSignalRefOrValue(val.condition);\n return Object.assign(Object.assign({}, signalRefOrValue(val)), { condition });\n}\nexport function signalRefOrValue(value) {\n if (isExprRef(value)) {\n const { expr } = value, rest = __rest(value, [\"expr\"]);\n return Object.assign({ signal: expr }, rest);\n }\n return value;\n}\nexport function conditionalSignalRefOrValue(value) {\n if (isExprRef(value)) {\n const { expr } = value, rest = __rest(value, [\"expr\"]);\n return Object.assign({ signal: expr }, rest);\n }\n return value;\n}\nexport function signalOrValueRef(value) {\n if (isExprRef(value)) {\n const { expr } = value, rest = __rest(value, [\"expr\"]);\n return Object.assign({ signal: expr }, rest);\n }\n if (isSignalRef(value)) {\n return value;\n }\n return value !== undefined ? { value } : undefined;\n}\nexport function exprFromValueOrSignalRef(ref) {\n if (isSignalRef(ref)) {\n return ref.signal;\n }\n return stringValue(ref.value);\n}\nexport function signalOrStringValue(v) {\n if (isSignalRef(v)) {\n return v.signal;\n }\n return v == null ? null : stringValue(v);\n}\nexport function applyMarkConfig(e, model, propsList) {\n for (const property of propsList) {\n const value = getMarkConfig(property, model.markDef, model.config);\n if (value !== undefined) {\n e[property] = signalOrValueRef(value);\n }\n }\n return e;\n}\nexport function getStyles(mark) {\n var _a;\n return [].concat(mark.type, (_a = mark.style) !== null && _a !== void 0 ? _a : []);\n}\nexport function getMarkPropOrConfig(channel, mark, config, opt = {}) {\n const { vgChannel, ignoreVgConfig } = opt;\n if (vgChannel && mark[vgChannel] !== undefined) {\n return mark[vgChannel];\n }\n else if (mark[channel] !== undefined) {\n return mark[channel];\n }\n else if (ignoreVgConfig && (!vgChannel || vgChannel === channel)) {\n return undefined;\n }\n return getMarkConfig(channel, mark, config, opt);\n}\n/**\n * Return property value from style or mark specific config property if exists.\n * Otherwise, return general mark specific config.\n */\nexport function getMarkConfig(channel, mark, config, { vgChannel } = {}) {\n return getFirstDefined(\n // style config has highest precedence\n vgChannel ? getMarkStyleConfig(channel, mark, config.style) : undefined, getMarkStyleConfig(channel, mark, config.style), \n // then mark-specific config\n vgChannel ? config[mark.type][vgChannel] : undefined, config[mark.type][channel], // Need to cast because MarkDef doesn't perfectly match with AnyMarkConfig, but if the type isn't available, we'll get nothing here, which is fine\n // If there is vgChannel, skip vl channel.\n // For example, vl size for text is vg fontSize, but config.mark.size is only for point size.\n vgChannel ? config.mark[vgChannel] : config.mark[channel] // Need to cast for the same reason as above\n );\n}\nexport function getMarkStyleConfig(prop, mark, styleConfigIndex) {\n return getStyleConfig(prop, getStyles(mark), styleConfigIndex);\n}\nexport function getStyleConfig(p, styles, styleConfigIndex) {\n styles = array(styles);\n let value;\n for (const style of styles) {\n const styleConfig = styleConfigIndex[style];\n if (styleConfig && styleConfig[p] !== undefined) {\n value = styleConfig[p];\n }\n }\n return value;\n}\n/**\n * Return Vega sort parameters (tuple of field and order).\n */\nexport function sortParams(orderDef, fieldRefOption) {\n return array(orderDef).reduce((s, orderChannelDef) => {\n var _a;\n s.field.push(vgField(orderChannelDef, fieldRefOption));\n s.order.push((_a = orderChannelDef.sort) !== null && _a !== void 0 ? _a : 'ascending');\n return s;\n }, { field: [], order: [] });\n}\nexport function mergeTitleFieldDefs(f1, f2) {\n const merged = [...f1];\n f2.forEach(fdToMerge => {\n for (const fieldDef1 of merged) {\n // If already exists, no need to append to merged array\n if (deepEqual(fieldDef1, fdToMerge)) {\n return;\n }\n }\n merged.push(fdToMerge);\n });\n return merged;\n}\nexport function mergeTitle(title1, title2) {\n if (deepEqual(title1, title2) || !title2) {\n // if titles are the same or title2 is falsy\n return title1;\n }\n else if (!title1) {\n // if title1 is falsy\n return title2;\n }\n else {\n return [...array(title1), ...array(title2)].join(', ');\n }\n}\nexport function mergeTitleComponent(v1, v2) {\n const v1Val = v1.value;\n const v2Val = v2.value;\n if (v1Val == null || v2Val === null) {\n return {\n explicit: v1.explicit,\n value: null\n };\n }\n else if ((isText(v1Val) || isSignalRef(v1Val)) && (isText(v2Val) || isSignalRef(v2Val))) {\n return {\n explicit: v1.explicit,\n value: mergeTitle(v1Val, v2Val)\n };\n }\n else if (isText(v1Val) || isSignalRef(v1Val)) {\n return {\n explicit: v1.explicit,\n value: v1Val\n };\n }\n else if (isText(v2Val) || isSignalRef(v2Val)) {\n return {\n explicit: v1.explicit,\n value: v2Val\n };\n }\n else if (!isText(v1Val) && !isSignalRef(v1Val) && !isText(v2Val) && !isSignalRef(v2Val)) {\n return {\n explicit: v1.explicit,\n value: mergeTitleFieldDefs(v1Val, v2Val)\n };\n }\n /* istanbul ignore next: Condition should not happen -- only for warning in development. */\n throw new Error('It should never reach here');\n}\n//# sourceMappingURL=common.js.map","export function isUnitSpec(spec) {\n return 'mark' in spec;\n}\n//# sourceMappingURL=unit.js.map","import { getMarkType } from '../mark';\nimport { isUnitSpec } from '../spec/unit';\nexport class CompositeMarkNormalizer {\n constructor(name, run) {\n this.name = name;\n this.run = run;\n }\n hasMatchingType(spec) {\n if (isUnitSpec(spec)) {\n return getMarkType(spec.mark) === this.name;\n }\n return false;\n }\n}\n//# sourceMappingURL=base.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array, isArray } from 'vega-util';\nimport { isArgmaxDef, isArgminDef } from './aggregate';\nimport { isBinned, isBinning } from './bin';\nimport { ANGLE, CHANNELS, COLOR, DESCRIPTION, DETAIL, FILL, FILLOPACITY, HREF, isChannel, isNonPositionScaleChannel, isSecondaryRangeChannel, isXorY, KEY, LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2, OPACITY, ORDER, RADIUS, RADIUS2, SHAPE, SIZE, STROKE, STROKEDASH, STROKEOPACITY, STROKEWIDTH, supportMark, TEXT, THETA, THETA2, TOOLTIP, URL, X, X2, Y, Y2 } from './channel';\nimport { binRequiresRange, getFieldDef, getGuide, hasConditionalFieldDef, initChannelDef, initFieldDef, isConditionalDef, isDatumDef, isFieldDef, isTypedFieldDef, isValueDef, title, vgField } from './channeldef';\nimport * as log from './log';\nimport { QUANTITATIVE, TEMPORAL } from './type';\nimport { keys, some } from './util';\nimport { isSignalRef } from './vega.schema';\nexport function channelHasField(encoding, channel) {\n const channelDef = encoding && encoding[channel];\n if (channelDef) {\n if (isArray(channelDef)) {\n return some(channelDef, fieldDef => !!fieldDef.field);\n }\n else {\n return isFieldDef(channelDef) || hasConditionalFieldDef(channelDef);\n }\n }\n return false;\n}\nexport function isAggregate(encoding) {\n return some(CHANNELS, channel => {\n if (channelHasField(encoding, channel)) {\n const channelDef = encoding[channel];\n if (isArray(channelDef)) {\n return some(channelDef, fieldDef => !!fieldDef.aggregate);\n }\n else {\n const fieldDef = getFieldDef(channelDef);\n return fieldDef && !!fieldDef.aggregate;\n }\n }\n return false;\n });\n}\nexport function extractTransformsFromEncoding(oldEncoding, config) {\n const groupby = [];\n const bins = [];\n const timeUnits = [];\n const aggregate = [];\n const encoding = {};\n forEach(oldEncoding, (channelDef, channel) => {\n // Extract potential embedded transformations along with remaining properties\n if (isFieldDef(channelDef)) {\n const { field, aggregate: aggOp, bin, timeUnit } = channelDef, remaining = __rest(channelDef, [\"field\", \"aggregate\", \"bin\", \"timeUnit\"]);\n if (aggOp || timeUnit || bin) {\n const guide = getGuide(channelDef);\n const isTitleDefined = guide && guide.title;\n let newField = vgField(channelDef, { forAs: true });\n const newFieldDef = Object.assign(Object.assign(Object.assign({}, (isTitleDefined ? [] : { title: title(channelDef, config, { allowDisabling: true }) })), remaining), { \n // Always overwrite field\n field: newField });\n if (aggOp) {\n let op;\n if (isArgmaxDef(aggOp)) {\n op = 'argmax';\n newField = vgField({ op: 'argmax', field: aggOp.argmax }, { forAs: true });\n newFieldDef.field = `${newField}.${field}`;\n }\n else if (isArgminDef(aggOp)) {\n op = 'argmin';\n newField = vgField({ op: 'argmin', field: aggOp.argmin }, { forAs: true });\n newFieldDef.field = `${newField}.${field}`;\n }\n else if (aggOp !== 'boxplot' && aggOp !== 'errorbar' && aggOp !== 'errorband') {\n op = aggOp;\n }\n if (op) {\n const aggregateEntry = {\n op,\n as: newField\n };\n if (field) {\n aggregateEntry.field = field;\n }\n aggregate.push(aggregateEntry);\n }\n }\n else {\n groupby.push(newField);\n if (isTypedFieldDef(channelDef) && isBinning(bin)) {\n bins.push({ bin, field, as: newField });\n // Add additional groupbys for range and end of bins\n groupby.push(vgField(channelDef, { binSuffix: 'end' }));\n if (binRequiresRange(channelDef, channel)) {\n groupby.push(vgField(channelDef, { binSuffix: 'range' }));\n }\n // Create accompanying 'x2' or 'y2' field if channel is 'x' or 'y' respectively\n if (isXorY(channel)) {\n const secondaryChannel = {\n field: newField + '_end'\n };\n encoding[channel + '2'] = secondaryChannel;\n }\n newFieldDef.bin = 'binned';\n if (!isSecondaryRangeChannel(channel)) {\n newFieldDef['type'] = QUANTITATIVE;\n }\n }\n else if (timeUnit) {\n timeUnits.push({\n timeUnit,\n field,\n as: newField\n });\n // define the format type for later compilation\n const formatType = isTypedFieldDef(channelDef) && channelDef.type !== TEMPORAL && 'time';\n if (formatType) {\n if (channel === TEXT || channel === TOOLTIP) {\n newFieldDef['formatType'] = formatType;\n }\n else if (isNonPositionScaleChannel(channel)) {\n newFieldDef['legend'] = Object.assign({ formatType }, newFieldDef['legend']);\n }\n else if (isXorY(channel)) {\n newFieldDef['axis'] = Object.assign({ formatType }, newFieldDef['axis']);\n }\n }\n }\n }\n // now the field should refer to post-transformed field instead\n encoding[channel] = newFieldDef;\n }\n else {\n groupby.push(field);\n encoding[channel] = oldEncoding[channel];\n }\n }\n else {\n // For value def / signal ref / datum def, just copy\n encoding[channel] = oldEncoding[channel];\n }\n });\n return {\n bins,\n timeUnits,\n aggregate,\n groupby,\n encoding\n };\n}\nexport function markChannelCompatible(encoding, channel, mark) {\n const markSupported = supportMark(channel, mark);\n if (!markSupported) {\n return false;\n }\n else if (markSupported === 'binned') {\n const primaryFieldDef = encoding[channel === X2 ? X : Y];\n // circle, point, square and tick only support x2/y2 when their corresponding x/y fieldDef\n // has \"binned\" data and thus need x2/y2 to specify the bin-end field.\n if (isFieldDef(primaryFieldDef) && isFieldDef(encoding[channel]) && isBinned(primaryFieldDef.bin)) {\n return true;\n }\n else {\n return false;\n }\n }\n return true;\n}\nexport function initEncoding(encoding, mark, filled, config) {\n return keys(encoding).reduce((normalizedEncoding, channel) => {\n if (!isChannel(channel)) {\n // Drop invalid channel\n log.warn(log.message.invalidEncodingChannel(channel));\n return normalizedEncoding;\n }\n const channelDef = encoding[channel];\n if (channel === 'angle' && mark === 'arc' && !encoding.theta) {\n log.warn(log.message.REPLACE_ANGLE_WITH_THETA);\n channel = THETA;\n }\n if (!markChannelCompatible(encoding, channel, mark)) {\n // Drop unsupported channel\n log.warn(log.message.incompatibleChannel(channel, mark));\n return normalizedEncoding;\n }\n // Drop line's size if the field is aggregated.\n if (channel === SIZE && mark === 'line') {\n const fieldDef = getFieldDef(encoding[channel]);\n if (fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.aggregate) {\n log.warn(log.message.LINE_WITH_VARYING_SIZE);\n return normalizedEncoding;\n }\n }\n // Drop color if either fill or stroke is specified\n if (channel === COLOR && (filled ? 'fill' in encoding : 'stroke' in encoding)) {\n log.warn(log.message.droppingColor('encoding', { fill: 'fill' in encoding, stroke: 'stroke' in encoding }));\n return normalizedEncoding;\n }\n if (channel === DETAIL ||\n (channel === ORDER && !isArray(channelDef) && !isValueDef(channelDef)) ||\n (channel === TOOLTIP && isArray(channelDef))) {\n if (channelDef) {\n // Array of fieldDefs for detail channel (or production rule)\n normalizedEncoding[channel] = array(channelDef).reduce((defs, fieldDef) => {\n if (!isFieldDef(fieldDef)) {\n log.warn(log.message.emptyFieldDef(fieldDef, channel));\n }\n else {\n defs.push(initFieldDef(fieldDef, channel));\n }\n return defs;\n }, []);\n }\n }\n else {\n if (channel === TOOLTIP && channelDef === null) {\n // Preserve null so we can use it to disable tooltip\n normalizedEncoding[channel] = null;\n }\n else if (!isFieldDef(channelDef) &&\n !isDatumDef(channelDef) &&\n !isValueDef(channelDef) &&\n !isConditionalDef(channelDef) &&\n !isSignalRef(channelDef)) {\n log.warn(log.message.emptyFieldDef(channelDef, channel));\n return normalizedEncoding;\n }\n normalizedEncoding[channel] = initChannelDef(channelDef, channel, config);\n }\n return normalizedEncoding;\n }, {});\n}\n/**\n * For composite marks, we have to call initChannelDef during init so we can infer types earlier.\n */\nexport function normalizeEncoding(encoding, config) {\n const normalizedEncoding = {};\n for (const channel of keys(encoding)) {\n const newChannelDef = initChannelDef(encoding[channel], channel, config, { compositeMark: true });\n normalizedEncoding[channel] = newChannelDef;\n }\n return normalizedEncoding;\n}\nexport function fieldDefs(encoding) {\n const arr = [];\n for (const channel of keys(encoding)) {\n if (channelHasField(encoding, channel)) {\n const channelDef = encoding[channel];\n const channelDefArray = array(channelDef);\n for (const def of channelDefArray) {\n if (isFieldDef(def)) {\n arr.push(def);\n }\n else if (hasConditionalFieldDef(def)) {\n arr.push(def.condition);\n }\n }\n }\n }\n return arr;\n}\nexport function forEach(mapping, f, thisArg) {\n if (!mapping) {\n return;\n }\n for (const channel of keys(mapping)) {\n const el = mapping[channel];\n if (isArray(el)) {\n for (const channelDef of el) {\n f.call(thisArg, channelDef, channel);\n }\n }\n else {\n f.call(thisArg, el, channel);\n }\n }\n}\nexport function reduce(mapping, f, init, thisArg) {\n if (!mapping) {\n return init;\n }\n return keys(mapping).reduce((r, channel) => {\n const map = mapping[channel];\n if (isArray(map)) {\n return map.reduce((r1, channelDef) => {\n return f.call(thisArg, r1, channelDef, channel);\n }, r);\n }\n else {\n return f.call(thisArg, r, map, channel);\n }\n }, init);\n}\n/**\n * Returns list of path grouping fields for the given encoding\n */\nexport function pathGroupingFields(mark, encoding) {\n return keys(encoding).reduce((details, channel) => {\n switch (channel) {\n // x, y, x2, y2, lat, long, lat1, long2, order, tooltip, href, aria label, cursor should not cause lines to group\n case X:\n case Y:\n case HREF:\n case DESCRIPTION:\n case URL:\n case X2:\n case Y2:\n case THETA:\n case THETA2:\n case RADIUS:\n case RADIUS2:\n // falls through\n case LATITUDE:\n case LONGITUDE:\n case LATITUDE2:\n case LONGITUDE2:\n // TODO: case 'cursor':\n // text, shape, shouldn't be a part of line/trail/area [falls through]\n case TEXT:\n case SHAPE:\n case ANGLE:\n // falls through\n // tooltip fields should not be added to group by [falls through]\n case TOOLTIP:\n return details;\n case ORDER:\n // order should not group line / trail\n if (mark === 'line' || mark === 'trail') {\n return details;\n }\n // but order should group area for stacking (falls through)\n case DETAIL:\n case KEY: {\n const channelDef = encoding[channel];\n if (isArray(channelDef) || isFieldDef(channelDef)) {\n for (const fieldDef of array(channelDef)) {\n if (!fieldDef.aggregate) {\n details.push(vgField(fieldDef, {}));\n }\n }\n }\n return details;\n }\n case SIZE:\n if (mark === 'trail') {\n // For trail, size should not group trail lines.\n return details;\n }\n // For line, size should group lines.\n // falls through\n case COLOR:\n case FILL:\n case STROKE:\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n case STROKEDASH:\n case STROKEWIDTH: {\n // TODO strokeDashOffset:\n // falls through\n const fieldDef = getFieldDef(encoding[channel]);\n if (fieldDef && !fieldDef.aggregate) {\n details.push(vgField(fieldDef, {}));\n }\n return details;\n }\n }\n }, []);\n}\n//# sourceMappingURL=encoding.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray, isBoolean, isString } from 'vega-util';\nimport { isContinuousFieldOrDatumDef, isFieldDef, isFieldOrDatumDefForTimeFormat } from '../channeldef';\nimport { fieldDefs } from '../encoding';\nimport * as log from '../log';\nimport { isMarkDef } from '../mark';\nimport { getFirstDefined, hash, unique } from '../util';\nimport { isSignalRef } from '../vega.schema';\nimport { toStringFieldDef } from './../channeldef';\nexport function filterTooltipWithAggregatedField(oldEncoding) {\n const { tooltip } = oldEncoding, filteredEncoding = __rest(oldEncoding, [\"tooltip\"]);\n if (!tooltip) {\n return { filteredEncoding };\n }\n let customTooltipWithAggregatedField;\n let customTooltipWithoutAggregatedField;\n if (isArray(tooltip)) {\n for (const t of tooltip) {\n if (t.aggregate) {\n if (!customTooltipWithAggregatedField) {\n customTooltipWithAggregatedField = [];\n }\n customTooltipWithAggregatedField.push(t);\n }\n else {\n if (!customTooltipWithoutAggregatedField) {\n customTooltipWithoutAggregatedField = [];\n }\n customTooltipWithoutAggregatedField.push(t);\n }\n }\n if (customTooltipWithAggregatedField) {\n filteredEncoding.tooltip = customTooltipWithAggregatedField;\n }\n }\n else {\n if (tooltip['aggregate']) {\n filteredEncoding.tooltip = tooltip;\n }\n else {\n customTooltipWithoutAggregatedField = tooltip;\n }\n }\n if (isArray(customTooltipWithoutAggregatedField) && customTooltipWithoutAggregatedField.length === 1) {\n customTooltipWithoutAggregatedField = customTooltipWithoutAggregatedField[0];\n }\n return { customTooltipWithoutAggregatedField, filteredEncoding };\n}\nexport function getCompositeMarkTooltip(tooltipSummary, continuousAxisChannelDef, encodingWithoutContinuousAxis, withFieldName = true) {\n if ('tooltip' in encodingWithoutContinuousAxis) {\n return { tooltip: encodingWithoutContinuousAxis.tooltip };\n }\n const fiveSummaryTooltip = tooltipSummary.map(({ fieldPrefix, titlePrefix }) => {\n const mainTitle = withFieldName ? ` of ${getTitle(continuousAxisChannelDef)}` : '';\n return {\n field: fieldPrefix + continuousAxisChannelDef.field,\n type: continuousAxisChannelDef.type,\n title: isSignalRef(titlePrefix) ? { signal: titlePrefix + `\"${escape(mainTitle)}\"` } : titlePrefix + mainTitle\n };\n });\n const tooltipFieldDefs = fieldDefs(encodingWithoutContinuousAxis).map(toStringFieldDef);\n return {\n tooltip: [\n ...fiveSummaryTooltip,\n // need to cast because TextFieldDef supports fewer types of bin\n ...unique(tooltipFieldDefs, hash)\n ]\n };\n}\nexport function getTitle(continuousAxisChannelDef) {\n const { title, field } = continuousAxisChannelDef;\n return getFirstDefined(title, field);\n}\nexport function makeCompositeAggregatePartFactory(compositeMarkDef, continuousAxis, continuousAxisChannelDef, sharedEncoding, compositeMarkConfig) {\n const { scale, axis } = continuousAxisChannelDef;\n return ({ partName, mark, positionPrefix, endPositionPrefix = undefined, extraEncoding = {} }) => {\n const title = getTitle(continuousAxisChannelDef);\n return partLayerMixins(compositeMarkDef, partName, compositeMarkConfig, {\n mark,\n encoding: Object.assign(Object.assign(Object.assign({ [continuousAxis]: Object.assign(Object.assign(Object.assign({ field: positionPrefix + '_' + continuousAxisChannelDef.field, type: continuousAxisChannelDef.type }, (title !== undefined ? { title } : {})), (scale !== undefined ? { scale } : {})), (axis !== undefined ? { axis } : {})) }, (isString(endPositionPrefix)\n ? {\n [continuousAxis + '2']: {\n field: endPositionPrefix + '_' + continuousAxisChannelDef.field\n }\n }\n : {})), sharedEncoding), extraEncoding)\n });\n };\n}\nexport function partLayerMixins(markDef, part, compositeMarkConfig, partBaseSpec) {\n const { clip, color, opacity } = markDef;\n const mark = markDef.type;\n if (markDef[part] || (markDef[part] === undefined && compositeMarkConfig[part])) {\n return [\n Object.assign(Object.assign({}, partBaseSpec), { mark: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, compositeMarkConfig[part]), (clip ? { clip } : {})), (color ? { color } : {})), (opacity ? { opacity } : {})), (isMarkDef(partBaseSpec.mark) ? partBaseSpec.mark : { type: partBaseSpec.mark })), { style: `${mark}-${part}` }), (isBoolean(markDef[part]) ? {} : markDef[part])) })\n ];\n }\n return [];\n}\nexport function compositeMarkContinuousAxis(spec, orient, compositeMark) {\n const { encoding } = spec;\n const continuousAxis = orient === 'vertical' ? 'y' : 'x';\n const continuousAxisChannelDef = encoding[continuousAxis]; // Safe to cast because if x is not continuous fielddef, the orient would not be horizontal.\n const continuousAxisChannelDef2 = encoding[continuousAxis + '2'];\n const continuousAxisChannelDefError = encoding[continuousAxis + 'Error'];\n const continuousAxisChannelDefError2 = encoding[continuousAxis + 'Error2'];\n return {\n continuousAxisChannelDef: filterAggregateFromChannelDef(continuousAxisChannelDef, compositeMark),\n continuousAxisChannelDef2: filterAggregateFromChannelDef(continuousAxisChannelDef2, compositeMark),\n continuousAxisChannelDefError: filterAggregateFromChannelDef(continuousAxisChannelDefError, compositeMark),\n continuousAxisChannelDefError2: filterAggregateFromChannelDef(continuousAxisChannelDefError2, compositeMark),\n continuousAxis\n };\n}\nfunction filterAggregateFromChannelDef(continuousAxisChannelDef, compositeMark) {\n if (continuousAxisChannelDef && continuousAxisChannelDef.aggregate) {\n const { aggregate } = continuousAxisChannelDef, continuousAxisWithoutAggregate = __rest(continuousAxisChannelDef, [\"aggregate\"]);\n if (aggregate !== compositeMark) {\n log.warn(log.message.errorBarContinuousAxisHasCustomizedAggregate(aggregate, compositeMark));\n }\n return continuousAxisWithoutAggregate;\n }\n else {\n return continuousAxisChannelDef;\n }\n}\nexport function compositeMarkOrient(spec, compositeMark) {\n const { mark, encoding } = spec;\n const { x, y } = encoding;\n if (isMarkDef(mark) && mark.orient) {\n return mark.orient;\n }\n if (isContinuousFieldOrDatumDef(x)) {\n // x is continuous\n if (isContinuousFieldOrDatumDef(y)) {\n // both x and y are continuous\n const xAggregate = isFieldDef(x) && x.aggregate;\n const yAggregate = isFieldDef(y) && y.aggregate;\n if (!xAggregate && yAggregate === compositeMark) {\n return 'vertical';\n }\n else if (!yAggregate && xAggregate === compositeMark) {\n return 'horizontal';\n }\n else if (xAggregate === compositeMark && yAggregate === compositeMark) {\n throw new Error('Both x and y cannot have aggregate');\n }\n else {\n if (isFieldOrDatumDefForTimeFormat(y) && !isFieldOrDatumDefForTimeFormat(x)) {\n // y is temporal but x is not\n return 'horizontal';\n }\n // default orientation for two continuous\n return 'vertical';\n }\n }\n return 'horizontal';\n }\n else if (isContinuousFieldOrDatumDef(y)) {\n // y is continuous but x is not\n return 'vertical';\n }\n else {\n // Neither x nor y is continuous.\n throw new Error(`Need a valid continuous axis for ${compositeMark}s`);\n }\n}\n//# sourceMappingURL=common.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isNumber, isObject } from 'vega-util';\nimport { getMarkPropOrConfig } from '../compile/common';\nimport { extractTransformsFromEncoding, normalizeEncoding } from '../encoding';\nimport * as log from '../log';\nimport { isMarkDef } from '../mark';\nimport { isEmpty, omit } from '../util';\nimport { CompositeMarkNormalizer } from './base';\nimport { compositeMarkContinuousAxis, compositeMarkOrient, filterTooltipWithAggregatedField, getCompositeMarkTooltip, getTitle, makeCompositeAggregatePartFactory, partLayerMixins } from './common';\nexport const BOXPLOT = 'boxplot';\nexport const BOXPLOT_PARTS = ['box', 'median', 'outliers', 'rule', 'ticks'];\nexport const boxPlotNormalizer = new CompositeMarkNormalizer(BOXPLOT, normalizeBoxPlot);\nexport function getBoxPlotType(extent) {\n if (isNumber(extent)) {\n return 'tukey';\n }\n // Ham: If we ever want to, we could add another extent syntax `{kIQR: number}` for the original [Q1-k*IQR, Q3+k*IQR] whisker and call this boxPlotType = `kIQR`. However, I'm not exposing this for now.\n return extent;\n}\nexport function normalizeBoxPlot(spec, { config }) {\n var _a, _b;\n // Need to initEncoding first so we can infer type\n spec = Object.assign(Object.assign({}, spec), { encoding: normalizeEncoding(spec.encoding, config) });\n const { mark, encoding: _encoding, selection, projection: _p } = spec, outerSpec = __rest(spec, [\"mark\", \"encoding\", \"selection\", \"projection\"]);\n const markDef = isMarkDef(mark) ? mark : { type: mark };\n // TODO(https://github.com/vega/vega-lite/issues/3702): add selection support\n if (selection) {\n log.warn(log.message.selectionNotSupported('boxplot'));\n }\n const extent = (_a = markDef.extent) !== null && _a !== void 0 ? _a : config.boxplot.extent;\n const sizeValue = getMarkPropOrConfig('size', markDef, // TODO: https://github.com/vega/vega-lite/issues/6245\n config);\n const boxPlotType = getBoxPlotType(extent);\n const { bins, timeUnits, transform, continuousAxisChannelDef, continuousAxis, groupby, aggregate, encodingWithoutContinuousAxis, ticksOrient, boxOrient, customTooltipWithoutAggregatedField } = boxParams(spec, extent, config);\n const { color, size } = encodingWithoutContinuousAxis, encodingWithoutSizeColorAndContinuousAxis = __rest(encodingWithoutContinuousAxis, [\"color\", \"size\"]);\n const makeBoxPlotPart = (sharedEncoding) => {\n return makeCompositeAggregatePartFactory(markDef, continuousAxis, continuousAxisChannelDef, sharedEncoding, config.boxplot);\n };\n const makeBoxPlotExtent = makeBoxPlotPart(encodingWithoutSizeColorAndContinuousAxis);\n const makeBoxPlotBox = makeBoxPlotPart(encodingWithoutContinuousAxis);\n const makeBoxPlotMidTick = makeBoxPlotPart(Object.assign(Object.assign({}, encodingWithoutSizeColorAndContinuousAxis), (size ? { size } : {})));\n const fiveSummaryTooltipEncoding = getCompositeMarkTooltip([\n { fieldPrefix: boxPlotType === 'min-max' ? 'upper_whisker_' : 'max_', titlePrefix: 'Max' },\n { fieldPrefix: 'upper_box_', titlePrefix: 'Q3' },\n { fieldPrefix: 'mid_box_', titlePrefix: 'Median' },\n { fieldPrefix: 'lower_box_', titlePrefix: 'Q1' },\n { fieldPrefix: boxPlotType === 'min-max' ? 'lower_whisker_' : 'min_', titlePrefix: 'Min' }\n ], continuousAxisChannelDef, encodingWithoutContinuousAxis);\n // ## Whisker Layers\n const endTick = { type: 'tick', color: 'black', opacity: 1, orient: ticksOrient, invalid: null, aria: false };\n const whiskerTooltipEncoding = boxPlotType === 'min-max'\n ? fiveSummaryTooltipEncoding // for min-max, show five-summary tooltip for whisker\n : // for tukey / k-IQR, just show upper/lower-whisker\n getCompositeMarkTooltip([\n { fieldPrefix: 'upper_whisker_', titlePrefix: 'Upper Whisker' },\n { fieldPrefix: 'lower_whisker_', titlePrefix: 'Lower Whisker' }\n ], continuousAxisChannelDef, encodingWithoutContinuousAxis);\n const whiskerLayers = [\n ...makeBoxPlotExtent({\n partName: 'rule',\n mark: { type: 'rule', invalid: null, aria: false },\n positionPrefix: 'lower_whisker',\n endPositionPrefix: 'lower_box',\n extraEncoding: whiskerTooltipEncoding\n }),\n ...makeBoxPlotExtent({\n partName: 'rule',\n mark: { type: 'rule', invalid: null, aria: false },\n positionPrefix: 'upper_box',\n endPositionPrefix: 'upper_whisker',\n extraEncoding: whiskerTooltipEncoding\n }),\n ...makeBoxPlotExtent({\n partName: 'ticks',\n mark: endTick,\n positionPrefix: 'lower_whisker',\n extraEncoding: whiskerTooltipEncoding\n }),\n ...makeBoxPlotExtent({\n partName: 'ticks',\n mark: endTick,\n positionPrefix: 'upper_whisker',\n extraEncoding: whiskerTooltipEncoding\n })\n ];\n // ## Box Layers\n // TODO: support hiding certain mark parts\n const boxLayers = [\n ...(boxPlotType !== 'tukey' ? whiskerLayers : []),\n ...makeBoxPlotBox({\n partName: 'box',\n mark: Object.assign(Object.assign({ type: 'bar' }, (sizeValue ? { size: sizeValue } : {})), { orient: boxOrient, invalid: null, ariaRoleDescription: 'box' }),\n positionPrefix: 'lower_box',\n endPositionPrefix: 'upper_box',\n extraEncoding: fiveSummaryTooltipEncoding\n }),\n ...makeBoxPlotMidTick({\n partName: 'median',\n mark: Object.assign(Object.assign(Object.assign({ type: 'tick', invalid: null }, (isObject(config.boxplot.median) && config.boxplot.median.color ? { color: config.boxplot.median.color } : {})), (sizeValue ? { size: sizeValue } : {})), { orient: ticksOrient, aria: false }),\n positionPrefix: 'mid_box',\n extraEncoding: fiveSummaryTooltipEncoding\n })\n ];\n if (boxPlotType === 'min-max') {\n return Object.assign(Object.assign({}, outerSpec), { transform: ((_b = outerSpec.transform) !== null && _b !== void 0 ? _b : []).concat(transform), layer: boxLayers });\n }\n // Tukey Box Plot\n const lowerBoxExpr = `datum[\"lower_box_${continuousAxisChannelDef.field}\"]`;\n const upperBoxExpr = `datum[\"upper_box_${continuousAxisChannelDef.field}\"]`;\n const iqrExpr = `(${upperBoxExpr} - ${lowerBoxExpr})`;\n const lowerWhiskerExpr = `${lowerBoxExpr} - ${extent} * ${iqrExpr}`;\n const upperWhiskerExpr = `${upperBoxExpr} + ${extent} * ${iqrExpr}`;\n const fieldExpr = `datum[\"${continuousAxisChannelDef.field}\"]`;\n const joinaggregateTransform = {\n joinaggregate: boxParamsQuartiles(continuousAxisChannelDef.field),\n groupby\n };\n const filteredWhiskerSpec = {\n transform: [\n {\n filter: `(${lowerWhiskerExpr} <= ${fieldExpr}) && (${fieldExpr} <= ${upperWhiskerExpr})`\n },\n {\n aggregate: [\n {\n op: 'min',\n field: continuousAxisChannelDef.field,\n as: 'lower_whisker_' + continuousAxisChannelDef.field\n },\n {\n op: 'max',\n field: continuousAxisChannelDef.field,\n as: 'upper_whisker_' + continuousAxisChannelDef.field\n },\n // preserve lower_box / upper_box\n {\n op: 'min',\n field: 'lower_box_' + continuousAxisChannelDef.field,\n as: 'lower_box_' + continuousAxisChannelDef.field\n },\n {\n op: 'max',\n field: 'upper_box_' + continuousAxisChannelDef.field,\n as: 'upper_box_' + continuousAxisChannelDef.field\n },\n ...aggregate\n ],\n groupby\n }\n ],\n layer: whiskerLayers\n };\n const { tooltip } = encodingWithoutSizeColorAndContinuousAxis, encodingWithoutSizeColorContinuousAxisAndTooltip = __rest(encodingWithoutSizeColorAndContinuousAxis, [\"tooltip\"]);\n const { scale, axis } = continuousAxisChannelDef;\n const title = getTitle(continuousAxisChannelDef);\n const axisWithoutTitle = omit(axis, ['title']);\n const outlierLayersMixins = partLayerMixins(markDef, 'outliers', config.boxplot, {\n transform: [{ filter: `(${fieldExpr} < ${lowerWhiskerExpr}) || (${fieldExpr} > ${upperWhiskerExpr})` }],\n mark: 'point',\n encoding: Object.assign(Object.assign(Object.assign({ [continuousAxis]: Object.assign(Object.assign(Object.assign({ field: continuousAxisChannelDef.field, type: continuousAxisChannelDef.type }, (title !== undefined ? { title } : {})), (scale !== undefined ? { scale } : {})), (isEmpty(axisWithoutTitle) ? {} : { axis: axisWithoutTitle })) }, encodingWithoutSizeColorContinuousAxisAndTooltip), (color ? { color } : {})), (customTooltipWithoutAggregatedField ? { tooltip: customTooltipWithoutAggregatedField } : {}))\n })[0];\n let filteredLayersMixins;\n const filteredLayersMixinsTransforms = [...bins, ...timeUnits, joinaggregateTransform];\n if (outlierLayersMixins) {\n filteredLayersMixins = {\n transform: filteredLayersMixinsTransforms,\n layer: [outlierLayersMixins, filteredWhiskerSpec]\n };\n }\n else {\n filteredLayersMixins = filteredWhiskerSpec;\n filteredLayersMixins.transform.unshift(...filteredLayersMixinsTransforms);\n }\n return Object.assign(Object.assign({}, outerSpec), { layer: [\n filteredLayersMixins,\n {\n // boxplot\n transform,\n layer: boxLayers\n }\n ] });\n}\nfunction boxParamsQuartiles(continousAxisField) {\n return [\n {\n op: 'q1',\n field: continousAxisField,\n as: 'lower_box_' + continousAxisField\n },\n {\n op: 'q3',\n field: continousAxisField,\n as: 'upper_box_' + continousAxisField\n }\n ];\n}\nfunction boxParams(spec, extent, config) {\n const orient = compositeMarkOrient(spec, BOXPLOT);\n const { continuousAxisChannelDef, continuousAxis } = compositeMarkContinuousAxis(spec, orient, BOXPLOT);\n const continuousFieldName = continuousAxisChannelDef.field;\n const boxPlotType = getBoxPlotType(extent);\n const boxplotSpecificAggregate = [\n ...boxParamsQuartiles(continuousFieldName),\n {\n op: 'median',\n field: continuousFieldName,\n as: 'mid_box_' + continuousFieldName\n },\n {\n op: 'min',\n field: continuousFieldName,\n as: (boxPlotType === 'min-max' ? 'lower_whisker_' : 'min_') + continuousFieldName\n },\n {\n op: 'max',\n field: continuousFieldName,\n as: (boxPlotType === 'min-max' ? 'upper_whisker_' : 'max_') + continuousFieldName\n }\n ];\n const postAggregateCalculates = boxPlotType === 'min-max' || boxPlotType === 'tukey'\n ? []\n : [\n // This is for the original k-IQR, which we do not expose\n {\n calculate: `datum[\"upper_box_${continuousFieldName}\"] - datum[\"lower_box_${continuousFieldName}\"]`,\n as: 'iqr_' + continuousFieldName\n },\n {\n calculate: `min(datum[\"upper_box_${continuousFieldName}\"] + datum[\"iqr_${continuousFieldName}\"] * ${extent}, datum[\"max_${continuousFieldName}\"])`,\n as: 'upper_whisker_' + continuousFieldName\n },\n {\n calculate: `max(datum[\"lower_box_${continuousFieldName}\"] - datum[\"iqr_${continuousFieldName}\"] * ${extent}, datum[\"min_${continuousFieldName}\"])`,\n as: 'lower_whisker_' + continuousFieldName\n }\n ];\n const _a = spec.encoding, _b = continuousAxis, oldContinuousAxisChannelDef = _a[_b], oldEncodingWithoutContinuousAxis = __rest(_a, [typeof _b === \"symbol\" ? _b : _b + \"\"]);\n const { customTooltipWithoutAggregatedField, filteredEncoding } = filterTooltipWithAggregatedField(oldEncodingWithoutContinuousAxis);\n const { bins, timeUnits, aggregate, groupby, encoding: encodingWithoutContinuousAxis } = extractTransformsFromEncoding(filteredEncoding, config);\n const ticksOrient = orient === 'vertical' ? 'horizontal' : 'vertical';\n const boxOrient = orient;\n const transform = [\n ...bins,\n ...timeUnits,\n {\n aggregate: [...aggregate, ...boxplotSpecificAggregate],\n groupby\n },\n ...postAggregateCalculates\n ];\n return {\n bins,\n timeUnits,\n transform,\n groupby,\n aggregate,\n continuousAxisChannelDef,\n continuousAxis,\n encodingWithoutContinuousAxis,\n ticksOrient,\n boxOrient,\n customTooltipWithoutAggregatedField\n };\n}\n//# sourceMappingURL=boxplot.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isContinuousFieldOrDatumDef, isFieldOrDatumDef, title } from '../channeldef';\nimport { extractTransformsFromEncoding, normalizeEncoding } from '../encoding';\nimport * as log from '../log';\nimport { isMarkDef } from '../mark';\nimport { replaceAll, titleCase } from '../util';\nimport { CompositeMarkNormalizer } from './base';\nimport { compositeMarkContinuousAxis, compositeMarkOrient, getCompositeMarkTooltip, makeCompositeAggregatePartFactory } from './common';\nexport const ERRORBAR = 'errorbar';\nexport const ERRORBAR_PARTS = ['ticks', 'rule'];\nexport const errorBarNormalizer = new CompositeMarkNormalizer(ERRORBAR, normalizeErrorBar);\nexport function normalizeErrorBar(spec, { config }) {\n // Need to initEncoding first so we can infer type\n spec = Object.assign(Object.assign({}, spec), { encoding: normalizeEncoding(spec.encoding, config) });\n const { transform, continuousAxisChannelDef, continuousAxis, encodingWithoutContinuousAxis, ticksOrient, markDef, outerSpec, tooltipEncoding } = errorBarParams(spec, ERRORBAR, config);\n delete encodingWithoutContinuousAxis['size'];\n const makeErrorBarPart = makeCompositeAggregatePartFactory(markDef, continuousAxis, continuousAxisChannelDef, encodingWithoutContinuousAxis, config.errorbar);\n const thickness = markDef.thickness;\n const size = markDef.size;\n const tick = Object.assign(Object.assign({ type: 'tick', orient: ticksOrient, aria: false }, (thickness !== undefined ? { thickness } : {})), (size !== undefined ? { size } : {}));\n const layer = [\n ...makeErrorBarPart({\n partName: 'ticks',\n mark: tick,\n positionPrefix: 'lower',\n extraEncoding: tooltipEncoding\n }),\n ...makeErrorBarPart({\n partName: 'ticks',\n mark: tick,\n positionPrefix: 'upper',\n extraEncoding: tooltipEncoding\n }),\n ...makeErrorBarPart({\n partName: 'rule',\n mark: Object.assign({ type: 'rule', ariaRoleDescription: 'errorbar' }, (thickness !== undefined ? { size: thickness } : {})),\n positionPrefix: 'lower',\n endPositionPrefix: 'upper',\n extraEncoding: tooltipEncoding\n })\n ];\n return Object.assign(Object.assign(Object.assign({}, outerSpec), { transform }), (layer.length > 1 ? { layer } : Object.assign({}, layer[0])));\n}\nfunction errorBarOrientAndInputType(spec, compositeMark) {\n const { encoding } = spec;\n if (errorBarIsInputTypeRaw(encoding)) {\n return {\n orient: compositeMarkOrient(spec, compositeMark),\n inputType: 'raw'\n };\n }\n const isTypeAggregatedUpperLower = errorBarIsInputTypeAggregatedUpperLower(encoding);\n const isTypeAggregatedError = errorBarIsInputTypeAggregatedError(encoding);\n const x = encoding.x;\n const y = encoding.y;\n if (isTypeAggregatedUpperLower) {\n // type is aggregated-upper-lower\n if (isTypeAggregatedError) {\n throw new Error(`${compositeMark} cannot be both type aggregated-upper-lower and aggregated-error`);\n }\n const x2 = encoding.x2;\n const y2 = encoding.y2;\n if (isFieldOrDatumDef(x2) && isFieldOrDatumDef(y2)) {\n // having both x, x2 and y, y2\n throw new Error(`${compositeMark} cannot have both x2 and y2`);\n }\n else if (isFieldOrDatumDef(x2)) {\n if (isContinuousFieldOrDatumDef(x)) {\n // having x, x2 quantitative and field y, y2 are not specified\n return { orient: 'horizontal', inputType: 'aggregated-upper-lower' };\n }\n else {\n // having x, x2 that are not both quantitative\n throw new Error(`Both x and x2 have to be quantitative in ${compositeMark}`);\n }\n }\n else if (isFieldOrDatumDef(y2)) {\n // y2 is a FieldDef\n if (isContinuousFieldOrDatumDef(y)) {\n // having y, y2 quantitative and field x, x2 are not specified\n return { orient: 'vertical', inputType: 'aggregated-upper-lower' };\n }\n else {\n // having y, y2 that are not both quantitative\n throw new Error(`Both y and y2 have to be quantitative in ${compositeMark}`);\n }\n }\n throw new Error('No ranged axis');\n }\n else {\n // type is aggregated-error\n const xError = encoding.xError;\n const xError2 = encoding.xError2;\n const yError = encoding.yError;\n const yError2 = encoding.yError2;\n if (isFieldOrDatumDef(xError2) && !isFieldOrDatumDef(xError)) {\n // having xError2 without xError\n throw new Error(`${compositeMark} cannot have xError2 without xError`);\n }\n if (isFieldOrDatumDef(yError2) && !isFieldOrDatumDef(yError)) {\n // having yError2 without yError\n throw new Error(`${compositeMark} cannot have yError2 without yError`);\n }\n if (isFieldOrDatumDef(xError) && isFieldOrDatumDef(yError)) {\n // having both xError and yError\n throw new Error(`${compositeMark} cannot have both xError and yError with both are quantiative`);\n }\n else if (isFieldOrDatumDef(xError)) {\n if (isContinuousFieldOrDatumDef(x)) {\n // having x and xError that are all quantitative\n return { orient: 'horizontal', inputType: 'aggregated-error' };\n }\n else {\n // having x, xError, and xError2 that are not all quantitative\n throw new Error('All x, xError, and xError2 (if exist) have to be quantitative');\n }\n }\n else if (isFieldOrDatumDef(yError)) {\n if (isContinuousFieldOrDatumDef(y)) {\n // having y and yError that are all quantitative\n return { orient: 'vertical', inputType: 'aggregated-error' };\n }\n else {\n // having y, yError, and yError2 that are not all quantitative\n throw new Error('All y, yError, and yError2 (if exist) have to be quantitative');\n }\n }\n throw new Error('No ranged axis');\n }\n}\nfunction errorBarIsInputTypeRaw(encoding) {\n return ((isFieldOrDatumDef(encoding.x) || isFieldOrDatumDef(encoding.y)) &&\n !isFieldOrDatumDef(encoding.x2) &&\n !isFieldOrDatumDef(encoding.y2) &&\n !isFieldOrDatumDef(encoding.xError) &&\n !isFieldOrDatumDef(encoding.xError2) &&\n !isFieldOrDatumDef(encoding.yError) &&\n !isFieldOrDatumDef(encoding.yError2));\n}\nfunction errorBarIsInputTypeAggregatedUpperLower(encoding) {\n return isFieldOrDatumDef(encoding.x2) || isFieldOrDatumDef(encoding.y2);\n}\nfunction errorBarIsInputTypeAggregatedError(encoding) {\n return (isFieldOrDatumDef(encoding.xError) ||\n isFieldOrDatumDef(encoding.xError2) ||\n isFieldOrDatumDef(encoding.yError) ||\n isFieldOrDatumDef(encoding.yError2));\n}\nexport function errorBarParams(spec, compositeMark, config) {\n var _a;\n // TODO: use selection\n const { mark, encoding, selection, projection: _p } = spec, outerSpec = __rest(spec, [\"mark\", \"encoding\", \"selection\", \"projection\"]);\n const markDef = isMarkDef(mark) ? mark : { type: mark };\n // TODO(https://github.com/vega/vega-lite/issues/3702): add selection support\n if (selection) {\n log.warn(log.message.selectionNotSupported(compositeMark));\n }\n const { orient, inputType } = errorBarOrientAndInputType(spec, compositeMark);\n const { continuousAxisChannelDef, continuousAxisChannelDef2, continuousAxisChannelDefError, continuousAxisChannelDefError2, continuousAxis } = compositeMarkContinuousAxis(spec, orient, compositeMark);\n const { errorBarSpecificAggregate, postAggregateCalculates, tooltipSummary, tooltipTitleWithFieldName } = errorBarAggregationAndCalculation(markDef, continuousAxisChannelDef, continuousAxisChannelDef2, continuousAxisChannelDefError, continuousAxisChannelDefError2, inputType, compositeMark, config);\n const _b = encoding, _c = continuousAxis, oldContinuousAxisChannelDef = _b[_c], _d = continuousAxis === 'x' ? 'x2' : 'y2', oldContinuousAxisChannelDef2 = _b[_d], _e = continuousAxis === 'x' ? 'xError' : 'yError', oldContinuousAxisChannelDefError = _b[_e], _f = continuousAxis === 'x' ? 'xError2' : 'yError2', oldContinuousAxisChannelDefError2 = _b[_f], oldEncodingWithoutContinuousAxis = __rest(_b, [typeof _c === \"symbol\" ? _c : _c + \"\", typeof _d === \"symbol\" ? _d : _d + \"\", typeof _e === \"symbol\" ? _e : _e + \"\", typeof _f === \"symbol\" ? _f : _f + \"\"]);\n const { bins, timeUnits, aggregate: oldAggregate, groupby: oldGroupBy, encoding: encodingWithoutContinuousAxis } = extractTransformsFromEncoding(oldEncodingWithoutContinuousAxis, config);\n const aggregate = [...oldAggregate, ...errorBarSpecificAggregate];\n const groupby = inputType !== 'raw' ? [] : oldGroupBy;\n const tooltipEncoding = getCompositeMarkTooltip(tooltipSummary, continuousAxisChannelDef, encodingWithoutContinuousAxis, tooltipTitleWithFieldName);\n return {\n transform: [\n ...((_a = outerSpec.transform) !== null && _a !== void 0 ? _a : []),\n ...bins,\n ...timeUnits,\n ...(aggregate.length === 0 ? [] : [{ aggregate, groupby }]),\n ...postAggregateCalculates\n ],\n groupby,\n continuousAxisChannelDef,\n continuousAxis,\n encodingWithoutContinuousAxis,\n ticksOrient: orient === 'vertical' ? 'horizontal' : 'vertical',\n markDef,\n outerSpec,\n tooltipEncoding\n };\n}\nfunction errorBarAggregationAndCalculation(markDef, continuousAxisChannelDef, continuousAxisChannelDef2, continuousAxisChannelDefError, continuousAxisChannelDefError2, inputType, compositeMark, config) {\n let errorBarSpecificAggregate = [];\n let postAggregateCalculates = [];\n const continuousFieldName = continuousAxisChannelDef.field;\n let tooltipSummary;\n let tooltipTitleWithFieldName = false;\n if (inputType === 'raw') {\n const center = markDef.center\n ? markDef.center\n : markDef.extent\n ? markDef.extent === 'iqr'\n ? 'median'\n : 'mean'\n : config.errorbar.center;\n const extent = markDef.extent ? markDef.extent : center === 'mean' ? 'stderr' : 'iqr';\n if ((center === 'median') !== (extent === 'iqr')) {\n log.warn(log.message.errorBarCenterIsUsedWithWrongExtent(center, extent, compositeMark));\n }\n if (extent === 'stderr' || extent === 'stdev') {\n errorBarSpecificAggregate = [\n { op: extent, field: continuousFieldName, as: 'extent_' + continuousFieldName },\n { op: center, field: continuousFieldName, as: 'center_' + continuousFieldName }\n ];\n postAggregateCalculates = [\n {\n calculate: `datum[\"center_${continuousFieldName}\"] + datum[\"extent_${continuousFieldName}\"]`,\n as: 'upper_' + continuousFieldName\n },\n {\n calculate: `datum[\"center_${continuousFieldName}\"] - datum[\"extent_${continuousFieldName}\"]`,\n as: 'lower_' + continuousFieldName\n }\n ];\n tooltipSummary = [\n { fieldPrefix: 'center_', titlePrefix: titleCase(center) },\n { fieldPrefix: 'upper_', titlePrefix: getTitlePrefix(center, extent, '+') },\n { fieldPrefix: 'lower_', titlePrefix: getTitlePrefix(center, extent, '-') }\n ];\n tooltipTitleWithFieldName = true;\n }\n else {\n let centerOp;\n let lowerExtentOp;\n let upperExtentOp;\n if (extent === 'ci') {\n centerOp = 'mean';\n lowerExtentOp = 'ci0';\n upperExtentOp = 'ci1';\n }\n else {\n centerOp = 'median';\n lowerExtentOp = 'q1';\n upperExtentOp = 'q3';\n }\n errorBarSpecificAggregate = [\n { op: lowerExtentOp, field: continuousFieldName, as: 'lower_' + continuousFieldName },\n { op: upperExtentOp, field: continuousFieldName, as: 'upper_' + continuousFieldName },\n { op: centerOp, field: continuousFieldName, as: 'center_' + continuousFieldName }\n ];\n tooltipSummary = [\n {\n fieldPrefix: 'upper_',\n titlePrefix: title({ field: continuousFieldName, aggregate: upperExtentOp, type: 'quantitative' }, config, {\n allowDisabling: false\n })\n },\n {\n fieldPrefix: 'lower_',\n titlePrefix: title({ field: continuousFieldName, aggregate: lowerExtentOp, type: 'quantitative' }, config, {\n allowDisabling: false\n })\n },\n {\n fieldPrefix: 'center_',\n titlePrefix: title({ field: continuousFieldName, aggregate: centerOp, type: 'quantitative' }, config, {\n allowDisabling: false\n })\n }\n ];\n }\n }\n else {\n if (markDef.center || markDef.extent) {\n log.warn(log.message.errorBarCenterAndExtentAreNotNeeded(markDef.center, markDef.extent));\n }\n if (inputType === 'aggregated-upper-lower') {\n tooltipSummary = [];\n postAggregateCalculates = [\n { calculate: `datum[\"${continuousAxisChannelDef2.field}\"]`, as: 'upper_' + continuousFieldName },\n { calculate: `datum[\"${continuousFieldName}\"]`, as: 'lower_' + continuousFieldName }\n ];\n }\n else if (inputType === 'aggregated-error') {\n tooltipSummary = [{ fieldPrefix: '', titlePrefix: continuousFieldName }];\n postAggregateCalculates = [\n {\n calculate: `datum[\"${continuousFieldName}\"] + datum[\"${continuousAxisChannelDefError.field}\"]`,\n as: 'upper_' + continuousFieldName\n }\n ];\n if (continuousAxisChannelDefError2) {\n postAggregateCalculates.push({\n calculate: `datum[\"${continuousFieldName}\"] + datum[\"${continuousAxisChannelDefError2.field}\"]`,\n as: 'lower_' + continuousFieldName\n });\n }\n else {\n postAggregateCalculates.push({\n calculate: `datum[\"${continuousFieldName}\"] - datum[\"${continuousAxisChannelDefError.field}\"]`,\n as: 'lower_' + continuousFieldName\n });\n }\n }\n for (const postAggregateCalculate of postAggregateCalculates) {\n tooltipSummary.push({\n fieldPrefix: postAggregateCalculate.as.substring(0, 6),\n titlePrefix: replaceAll(replaceAll(postAggregateCalculate.calculate, 'datum[\"', ''), '\"]', '')\n });\n }\n }\n return { postAggregateCalculates, errorBarSpecificAggregate, tooltipSummary, tooltipTitleWithFieldName };\n}\nfunction getTitlePrefix(center, extent, operation) {\n return titleCase(center) + ' ' + operation + ' ' + extent;\n}\n//# sourceMappingURL=errorbar.js.map","import { normalizeEncoding } from '../encoding';\nimport * as log from '../log';\nimport { CompositeMarkNormalizer } from './base';\nimport { makeCompositeAggregatePartFactory } from './common';\nimport { errorBarParams } from './errorbar';\nexport const ERRORBAND = 'errorband';\nexport const ERRORBAND_PARTS = ['band', 'borders'];\nexport const errorBandNormalizer = new CompositeMarkNormalizer(ERRORBAND, normalizeErrorBand);\nexport function normalizeErrorBand(spec, { config }) {\n // Need to initEncoding first so we can infer type\n spec = Object.assign(Object.assign({}, spec), { encoding: normalizeEncoding(spec.encoding, config) });\n const { transform, continuousAxisChannelDef, continuousAxis, encodingWithoutContinuousAxis, markDef, outerSpec, tooltipEncoding } = errorBarParams(spec, ERRORBAND, config);\n const errorBandDef = markDef;\n const makeErrorBandPart = makeCompositeAggregatePartFactory(errorBandDef, continuousAxis, continuousAxisChannelDef, encodingWithoutContinuousAxis, config.errorband);\n const is2D = spec.encoding.x !== undefined && spec.encoding.y !== undefined;\n let bandMark = { type: is2D ? 'area' : 'rect' };\n let bordersMark = { type: is2D ? 'line' : 'rule' };\n const interpolate = Object.assign(Object.assign({}, (errorBandDef.interpolate ? { interpolate: errorBandDef.interpolate } : {})), (errorBandDef.tension && errorBandDef.interpolate ? { tension: errorBandDef.tension } : {}));\n if (is2D) {\n bandMark = Object.assign(Object.assign(Object.assign({}, bandMark), interpolate), { ariaRoleDescription: 'errorband' });\n bordersMark = Object.assign(Object.assign(Object.assign({}, bordersMark), interpolate), { aria: false });\n }\n else if (errorBandDef.interpolate) {\n log.warn(log.message.errorBand1DNotSupport('interpolate'));\n }\n else if (errorBandDef.tension) {\n log.warn(log.message.errorBand1DNotSupport('tension'));\n }\n return Object.assign(Object.assign({}, outerSpec), { transform, layer: [\n ...makeErrorBandPart({\n partName: 'band',\n mark: bandMark,\n positionPrefix: 'lower',\n endPositionPrefix: 'upper',\n extraEncoding: tooltipEncoding\n }),\n ...makeErrorBandPart({\n partName: 'borders',\n mark: bordersMark,\n positionPrefix: 'lower',\n extraEncoding: tooltipEncoding\n }),\n ...makeErrorBandPart({\n partName: 'borders',\n mark: bordersMark,\n positionPrefix: 'upper',\n extraEncoding: tooltipEncoding\n })\n ] });\n}\n//# sourceMappingURL=errorband.js.map","import { keys } from '../util';\nimport { CompositeMarkNormalizer } from './base';\nimport { BOXPLOT, BOXPLOT_PARTS, normalizeBoxPlot } from './boxplot';\nimport { ERRORBAND, ERRORBAND_PARTS, normalizeErrorBand } from './errorband';\nimport { ERRORBAR, ERRORBAR_PARTS, normalizeErrorBar } from './errorbar';\n/**\n * Registry index for all composite mark's normalizer\n */\nconst compositeMarkRegistry = {};\nexport function add(mark, run, parts) {\n const normalizer = new CompositeMarkNormalizer(mark, run);\n compositeMarkRegistry[mark] = { normalizer, parts };\n}\nexport function remove(mark) {\n delete compositeMarkRegistry[mark];\n}\nexport function getAllCompositeMarks() {\n return keys(compositeMarkRegistry);\n}\nadd(BOXPLOT, normalizeBoxPlot, BOXPLOT_PARTS);\nadd(ERRORBAR, normalizeErrorBar, ERRORBAR_PARTS);\nadd(ERRORBAND, normalizeErrorBand, ERRORBAND_PARTS);\n//# sourceMappingURL=index.js.map","export const VL_ONLY_LEGEND_CONFIG = [\n 'gradientHorizontalMaxLength',\n 'gradientHorizontalMinLength',\n 'gradientVerticalMaxLength',\n 'gradientVerticalMinLength',\n 'unselectedOpacity'\n];\n//# sourceMappingURL=guide.js.map","import { keys } from './util';\nexport const HEADER_TITLE_PROPERTIES_MAP = {\n titleAlign: 'align',\n titleAnchor: 'anchor',\n titleAngle: 'angle',\n titleBaseline: 'baseline',\n titleColor: 'color',\n titleFont: 'font',\n titleFontSize: 'fontSize',\n titleFontStyle: 'fontStyle',\n titleFontWeight: 'fontWeight',\n titleLimit: 'limit',\n titleLineHeight: 'lineHeight',\n titleOrient: 'orient',\n titlePadding: 'offset'\n};\nexport const HEADER_LABEL_PROPERTIES_MAP = {\n labelAlign: 'align',\n labelAnchor: 'anchor',\n labelAngle: 'angle',\n labelBaseline: 'baseline',\n labelColor: 'color',\n labelFont: 'font',\n labelFontSize: 'fontSize',\n labelFontStyle: 'fontStyle',\n labelFontWeight: 'fontWeight',\n labelLimit: 'limit',\n labelLineHeight: 'lineHeight',\n labelOrient: 'orient',\n labelPadding: 'offset'\n};\nexport const HEADER_TITLE_PROPERTIES = keys(HEADER_TITLE_PROPERTIES_MAP);\nexport const HEADER_LABEL_PROPERTIES = keys(HEADER_LABEL_PROPERTIES_MAP);\nconst HEADER_CONFIGS_INDEX = {\n header: 1,\n headerRow: 1,\n headerColumn: 1,\n headerFacet: 1\n};\nexport const HEADER_CONFIGS = keys(HEADER_CONFIGS_INDEX);\n//# sourceMappingURL=header.js.map","import { keys } from './util';\nexport const LEGEND_SCALE_CHANNELS = [\n 'size',\n 'shape',\n 'fill',\n 'stroke',\n 'strokeDash',\n 'strokeWidth',\n 'opacity'\n];\nexport const defaultLegendConfig = {\n gradientHorizontalMaxLength: 200,\n gradientHorizontalMinLength: 100,\n gradientVerticalMaxLength: 200,\n gradientVerticalMinLength: 64,\n unselectedOpacity: 0.35\n};\nexport const COMMON_LEGEND_PROPERTY_INDEX = {\n aria: 1,\n clipHeight: 1,\n columnPadding: 1,\n columns: 1,\n cornerRadius: 1,\n description: 1,\n direction: 1,\n fillColor: 1,\n format: 1,\n formatType: 1,\n gradientLength: 1,\n gradientOpacity: 1,\n gradientStrokeColor: 1,\n gradientStrokeWidth: 1,\n gradientThickness: 1,\n gridAlign: 1,\n labelAlign: 1,\n labelBaseline: 1,\n labelColor: 1,\n labelFont: 1,\n labelFontSize: 1,\n labelFontStyle: 1,\n labelFontWeight: 1,\n labelLimit: 1,\n labelOffset: 1,\n labelOpacity: 1,\n labelOverlap: 1,\n labelPadding: 1,\n labelSeparation: 1,\n legendX: 1,\n legendY: 1,\n offset: 1,\n orient: 1,\n padding: 1,\n rowPadding: 1,\n strokeColor: 1,\n symbolDash: 1,\n symbolDashOffset: 1,\n symbolFillColor: 1,\n symbolLimit: 1,\n symbolOffset: 1,\n symbolOpacity: 1,\n symbolSize: 1,\n symbolStrokeColor: 1,\n symbolStrokeWidth: 1,\n symbolType: 1,\n tickCount: 1,\n tickMinStep: 1,\n title: 1,\n titleAlign: 1,\n titleAnchor: 1,\n titleBaseline: 1,\n titleColor: 1,\n titleFont: 1,\n titleFontSize: 1,\n titleFontStyle: 1,\n titleFontWeight: 1,\n titleLimit: 1,\n titleLineHeight: 1,\n titleOpacity: 1,\n titleOrient: 1,\n titlePadding: 1,\n type: 1,\n values: 1,\n zindex: 1\n};\nexport const LEGEND_PROPERTIES = keys(COMMON_LEGEND_PROPERTY_INDEX);\n//# sourceMappingURL=legend.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nexport function assembleParameterSignals(params) {\n const signals = [];\n for (const param of params || []) {\n const { expr, bind } = param, rest = __rest(param, [\"expr\", \"bind\"]);\n if (bind && expr) {\n // Vega's InitSignal -- apply expr to \"init\"\n const signal = Object.assign(Object.assign({}, rest), { bind, init: expr });\n signals.push(signal);\n }\n else {\n const signal = Object.assign(Object.assign(Object.assign({}, rest), (expr ? { update: expr } : {})), (bind ? { bind } : {}));\n signals.push(signal);\n }\n }\n return signals;\n}\n//# sourceMappingURL=parameter.js.map","import { isObject } from 'vega-util';\nexport const SELECTION_ID = '_vgsid_';\nexport const defaultConfig = {\n single: {\n on: 'click',\n fields: [SELECTION_ID],\n resolve: 'global',\n empty: 'all',\n clear: 'dblclick'\n },\n multi: {\n on: 'click',\n fields: [SELECTION_ID],\n toggle: 'event.shiftKey',\n resolve: 'global',\n empty: 'all',\n clear: 'dblclick'\n },\n interval: {\n on: '[mousedown, window:mouseup] > window:mousemove!',\n encodings: ['x', 'y'],\n translate: '[mousedown, window:mouseup] > window:mousemove!',\n zoom: 'wheel!',\n mark: { fill: '#333', fillOpacity: 0.125, stroke: 'white' },\n resolve: 'global',\n clear: 'dblclick'\n }\n};\nexport function isLegendBinding(bind) {\n return !!bind && (bind === 'legend' || !!bind.legend);\n}\nexport function isLegendStreamBinding(bind) {\n return isLegendBinding(bind) && isObject(bind);\n}\n//# sourceMappingURL=selection.js.map","export function isAnyConcatSpec(spec) {\n return isVConcatSpec(spec) || isHConcatSpec(spec) || isConcatSpec(spec);\n}\nexport function isConcatSpec(spec) {\n return 'concat' in spec;\n}\nexport function isVConcatSpec(spec) {\n return 'vconcat' in spec;\n}\nexport function isHConcatSpec(spec) {\n return 'hconcat' in spec;\n}\n//# sourceMappingURL=concat.js.map","import { isNumber, isObject } from 'vega-util';\nimport { keys } from '../util';\nimport { isConcatSpec, isVConcatSpec } from './concat';\nimport { isFacetMapping, isFacetSpec } from './facet';\nexport function isStep(size) {\n return isObject(size) && size['step'] !== undefined;\n}\nexport function isFrameMixins(o) {\n return o['view'] || o['width'] || o['height'];\n}\nexport const DEFAULT_SPACING = 20;\nconst COMPOSITION_LAYOUT_INDEX = {\n align: 1,\n bounds: 1,\n center: 1,\n columns: 1,\n spacing: 1\n};\nconst COMPOSITION_LAYOUT_PROPERTIES = keys(COMPOSITION_LAYOUT_INDEX);\nexport function extractCompositionLayout(spec, specType, config) {\n var _a, _b;\n const compositionConfig = config[specType];\n const layout = {};\n // Apply config first\n const { spacing: spacingConfig, columns } = compositionConfig;\n if (spacingConfig !== undefined) {\n layout.spacing = spacingConfig;\n }\n if (columns !== undefined) {\n if ((isFacetSpec(spec) && !isFacetMapping(spec.facet)) || isConcatSpec(spec)) {\n layout.columns = columns;\n }\n }\n if (isVConcatSpec(spec)) {\n layout.columns = 1;\n }\n // Then copy properties from the spec\n for (const prop of COMPOSITION_LAYOUT_PROPERTIES) {\n if (spec[prop] !== undefined) {\n if (prop === 'spacing') {\n const spacing = spec[prop];\n layout[prop] = isNumber(spacing)\n ? spacing\n : {\n row: (_a = spacing.row) !== null && _a !== void 0 ? _a : spacingConfig,\n column: (_b = spacing.column) !== null && _b !== void 0 ? _b : spacingConfig\n };\n }\n else {\n layout[prop] = spec[prop];\n }\n }\n }\n return layout;\n}\n//# sourceMappingURL=base.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isObject, mergeConfig } from 'vega-util';\nimport { AXIS_CONFIGS, isConditionalAxisValue } from './axis';\nimport { signalOrValueRefWithCondition, signalRefOrValue } from './compile/common';\nimport { getAllCompositeMarks } from './compositemark';\nimport { replaceExprRefInIndex } from './expr';\nimport { VL_ONLY_LEGEND_CONFIG } from './guide';\nimport { HEADER_CONFIGS } from './header';\nimport { defaultLegendConfig } from './legend';\nimport * as mark from './mark';\nimport { MARK_CONFIGS, PRIMITIVE_MARKS, VL_ONLY_MARK_CONFIG_PROPERTIES, VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX } from './mark';\nimport { assembleParameterSignals } from './parameter';\nimport { defaultScaleConfig } from './scale';\nimport { defaultConfig as defaultSelectionConfig } from './selection';\nimport { DEFAULT_SPACING, isStep } from './spec/base';\nimport { extractTitleConfig } from './title';\nimport { duplicate, getFirstDefined, isEmpty, keys, omit } from './util';\nexport function getViewConfigContinuousSize(viewConfig, channel) {\n var _a;\n return (_a = viewConfig[channel]) !== null && _a !== void 0 ? _a : viewConfig[channel === 'width' ? 'continuousWidth' : 'continuousHeight']; // get width/height for backwards compatibility\n}\nexport function getViewConfigDiscreteStep(viewConfig, channel) {\n const size = getViewConfigDiscreteSize(viewConfig, channel);\n return isStep(size) ? size.step : DEFAULT_STEP;\n}\nexport function getViewConfigDiscreteSize(viewConfig, channel) {\n var _a;\n const size = (_a = viewConfig[channel]) !== null && _a !== void 0 ? _a : viewConfig[channel === 'width' ? 'discreteWidth' : 'discreteHeight']; // get width/height for backwards compatibility\n return getFirstDefined(size, { step: viewConfig.step });\n}\nexport const DEFAULT_STEP = 20;\nexport const defaultViewConfig = {\n continuousWidth: 200,\n continuousHeight: 200,\n step: DEFAULT_STEP\n};\nexport function isVgScheme(rangeScheme) {\n return rangeScheme && !!rangeScheme['scheme'];\n}\nexport const defaultConfig = {\n background: 'white',\n padding: 5,\n timeFormat: '%b %d, %Y',\n countTitle: 'Count of Records',\n view: defaultViewConfig,\n mark: mark.defaultMarkConfig,\n arc: {},\n area: {},\n bar: mark.defaultBarConfig,\n circle: {},\n geoshape: {},\n image: {},\n line: {},\n point: {},\n rect: mark.defaultRectConfig,\n rule: { color: 'black' },\n square: {},\n text: { color: 'black' },\n tick: mark.defaultTickConfig,\n trail: {},\n boxplot: {\n size: 14,\n extent: 1.5,\n box: {},\n median: { color: 'white' },\n outliers: {},\n rule: {},\n ticks: null\n },\n errorbar: {\n center: 'mean',\n rule: true,\n ticks: false\n },\n errorband: {\n band: {\n opacity: 0.3\n },\n borders: false\n },\n scale: defaultScaleConfig,\n projection: {},\n legend: defaultLegendConfig,\n header: { titlePadding: 10, labelPadding: 10 },\n headerColumn: {},\n headerRow: {},\n headerFacet: {},\n selection: defaultSelectionConfig,\n style: {},\n title: {},\n facet: { spacing: DEFAULT_SPACING },\n concat: { spacing: DEFAULT_SPACING }\n};\n// Tableau10 color palette, copied from `vegaScale.scheme('tableau10')`\nconst tab10 = [\n '#4c78a8',\n '#f58518',\n '#e45756',\n '#72b7b2',\n '#54a24b',\n '#eeca3b',\n '#b279a2',\n '#ff9da6',\n '#9d755d',\n '#bab0ac'\n];\nexport const DEFAULT_FONT_SIZE = {\n text: 11,\n guideLabel: 10,\n guideTitle: 11,\n groupTitle: 13,\n groupSubtitle: 12\n};\nexport const DEFAULT_COLOR = {\n blue: tab10[0],\n orange: tab10[1],\n red: tab10[2],\n teal: tab10[3],\n green: tab10[4],\n yellow: tab10[5],\n purple: tab10[6],\n pink: tab10[7],\n brown: tab10[8],\n gray0: '#000',\n gray1: '#111',\n gray2: '#222',\n gray3: '#333',\n gray4: '#444',\n gray5: '#555',\n gray6: '#666',\n gray7: '#777',\n gray8: '#888',\n gray9: '#999',\n gray10: '#aaa',\n gray11: '#bbb',\n gray12: '#ccc',\n gray13: '#ddd',\n gray14: '#eee',\n gray15: '#fff'\n};\nexport function colorSignalConfig(color = {}) {\n return {\n signals: [\n {\n name: 'color',\n value: isObject(color) ? Object.assign(Object.assign({}, DEFAULT_COLOR), color) : DEFAULT_COLOR\n }\n ],\n mark: { color: { signal: 'color.blue' } },\n rule: { color: { signal: 'color.gray0' } },\n text: {\n color: { signal: 'color.gray0' }\n },\n style: {\n 'guide-label': {\n fill: { signal: 'color.gray0' }\n },\n 'guide-title': {\n fill: { signal: 'color.gray0' }\n },\n 'group-title': {\n fill: { signal: 'color.gray0' }\n },\n 'group-subtitle': {\n fill: { signal: 'color.gray0' }\n },\n cell: {\n stroke: { signal: 'color.gray8' }\n }\n },\n axis: {\n domainColor: { signal: 'color.gray13' },\n gridColor: { signal: 'color.gray8' },\n tickColor: { signal: 'color.gray13' }\n },\n range: {\n category: [\n { signal: 'color.blue' },\n { signal: 'color.orange' },\n { signal: 'color.red' },\n { signal: 'color.teal' },\n { signal: 'color.green' },\n { signal: 'color.yellow' },\n { signal: 'color.purple' },\n { signal: 'color.pink' },\n { signal: 'color.brown' },\n { signal: 'color.grey8' }\n ]\n }\n };\n}\nexport function fontSizeSignalConfig(fontSize) {\n return {\n signals: [\n {\n name: 'fontSize',\n value: isObject(fontSize) ? Object.assign(Object.assign({}, DEFAULT_FONT_SIZE), fontSize) : DEFAULT_FONT_SIZE\n }\n ],\n text: {\n fontSize: { signal: 'fontSize.text' }\n },\n style: {\n 'guide-label': {\n fontSize: { signal: 'fontSize.guideLabel' }\n },\n 'guide-title': {\n fontSize: { signal: 'fontSize.guideTitle' }\n },\n 'group-title': {\n fontSize: { signal: 'fontSize.groupTitle' }\n },\n 'group-subtitle': {\n fontSize: { signal: 'fontSize.groupSubtitle' }\n }\n }\n };\n}\nexport function fontConfig(font) {\n return {\n text: { font },\n style: {\n 'guide-label': { font },\n 'guide-title': { font },\n 'group-title': { font },\n 'group-subtitle': { font }\n }\n };\n}\nfunction getAxisConfigInternal(axisConfig) {\n const props = keys(axisConfig || {});\n const axisConfigInternal = {};\n for (const prop of props) {\n const val = axisConfig[prop];\n axisConfigInternal[prop] = isConditionalAxisValue(val)\n ? signalOrValueRefWithCondition(val)\n : signalRefOrValue(val);\n }\n return axisConfigInternal;\n}\nfunction getStyleConfigInternal(styleConfig) {\n const props = keys(styleConfig);\n const styleConfigInternal = {};\n for (const prop of props) {\n // We need to cast to cheat a bit here since styleConfig can be either mark config or axis config\n styleConfigInternal[prop] = getAxisConfigInternal(styleConfig[prop]);\n }\n return styleConfigInternal;\n}\nconst configPropsWithExpr = [\n ...MARK_CONFIGS,\n ...AXIS_CONFIGS,\n ...HEADER_CONFIGS,\n 'background',\n 'padding',\n 'legend',\n 'lineBreak',\n 'scale',\n 'style',\n 'title',\n 'view'\n];\n/**\n * Merge specified config with default config and config for the `color` flag,\n * then replace all expressions with signals\n */\nexport function initConfig(specifiedConfig = {}) {\n const { color, font, fontSize } = specifiedConfig, restConfig = __rest(specifiedConfig, [\"color\", \"font\", \"fontSize\"]);\n const mergedConfig = mergeConfig({}, defaultConfig, font ? fontConfig(font) : {}, color ? colorSignalConfig(color) : {}, fontSize ? fontSizeSignalConfig(fontSize) : {}, restConfig || {});\n const outputConfig = omit(mergedConfig, configPropsWithExpr);\n for (const prop of ['background', 'lineBreak', 'padding']) {\n if (mergedConfig[prop]) {\n outputConfig[prop] = signalRefOrValue(mergedConfig[prop]);\n }\n }\n for (const markConfigType of mark.MARK_CONFIGS) {\n if (mergedConfig[markConfigType]) {\n outputConfig[markConfigType] = replaceExprRefInIndex(mergedConfig[markConfigType]);\n }\n }\n for (const axisConfigType of AXIS_CONFIGS) {\n if (mergedConfig[axisConfigType]) {\n outputConfig[axisConfigType] = getAxisConfigInternal(mergedConfig[axisConfigType]);\n }\n }\n for (const headerConfigType of HEADER_CONFIGS) {\n if (mergedConfig[headerConfigType]) {\n outputConfig[headerConfigType] = replaceExprRefInIndex(mergedConfig[headerConfigType]);\n }\n }\n if (mergedConfig.legend) {\n outputConfig.legend = replaceExprRefInIndex(mergedConfig.legend);\n }\n if (mergedConfig.scale) {\n outputConfig.scale = replaceExprRefInIndex(mergedConfig.scale);\n }\n if (mergedConfig.style) {\n outputConfig.style = getStyleConfigInternal(mergedConfig.style);\n }\n if (mergedConfig.title) {\n outputConfig.title = replaceExprRefInIndex(mergedConfig.title);\n }\n if (mergedConfig.view) {\n outputConfig.view = replaceExprRefInIndex(mergedConfig.view);\n }\n return outputConfig;\n}\nconst MARK_STYLES = ['view', ...PRIMITIVE_MARKS];\nconst VL_ONLY_CONFIG_PROPERTIES = [\n 'color',\n 'fontSize',\n 'background',\n 'padding',\n 'facet',\n 'concat',\n 'numberFormat',\n 'timeFormat',\n 'countTitle',\n 'header',\n 'axisQuantitative',\n 'axisTemporal',\n 'axisDiscrete',\n 'axisPoint',\n 'axisXBand',\n 'axisXPoint',\n 'axisXDiscrete',\n 'axisXQuantitative',\n 'axisXTemporal',\n 'axisYBand',\n 'axisYPoint',\n 'axisYDiscrete',\n 'axisYQuantitative',\n 'axisYTemporal',\n 'scale',\n 'selection',\n 'overlay' // FIXME: Redesign and unhide this\n];\nconst VL_ONLY_ALL_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX = Object.assign({ view: ['continuousWidth', 'continuousHeight', 'discreteWidth', 'discreteHeight', 'step'] }, VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX);\nexport function stripAndRedirectConfig(config) {\n config = duplicate(config);\n for (const prop of VL_ONLY_CONFIG_PROPERTIES) {\n delete config[prop];\n }\n if (config.axis) {\n // delete condition axis config\n for (const prop in config.axis) {\n if (isConditionalAxisValue(config.axis[prop])) {\n delete config.axis[prop];\n }\n }\n }\n if (config.legend) {\n for (const prop of VL_ONLY_LEGEND_CONFIG) {\n delete config.legend[prop];\n }\n }\n // Remove Vega-Lite only generic mark config\n if (config.mark) {\n for (const prop of VL_ONLY_MARK_CONFIG_PROPERTIES) {\n delete config.mark[prop];\n }\n if (config.mark.tooltip && isObject(config.mark.tooltip)) {\n delete config.mark.tooltip;\n }\n }\n if (config.params) {\n config.signals = (config.signals || []).concat(assembleParameterSignals(config.params));\n delete config.params;\n }\n for (const markType of MARK_STYLES) {\n // Remove Vega-Lite-only mark config\n for (const prop of VL_ONLY_MARK_CONFIG_PROPERTIES) {\n delete config[markType][prop];\n }\n // Remove Vega-Lite only mark-specific config\n const vlOnlyMarkSpecificConfigs = VL_ONLY_ALL_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX[markType];\n if (vlOnlyMarkSpecificConfigs) {\n for (const prop of vlOnlyMarkSpecificConfigs) {\n delete config[markType][prop];\n }\n }\n // Redirect mark config to config.style so that mark config only affect its own mark type\n // without affecting other marks that share the same underlying Vega marks.\n // For example, config.rect should not affect bar marks.\n redirectConfigToStyleConfig(config, markType);\n }\n for (const m of getAllCompositeMarks()) {\n // Clean up the composite mark config as we don't need them in the output specs anymore\n delete config[m];\n }\n redirectTitleConfig(config);\n // Remove empty config objects.\n for (const prop in config) {\n if (isObject(config[prop]) && isEmpty(config[prop])) {\n delete config[prop];\n }\n }\n return isEmpty(config) ? undefined : config;\n}\n/**\n *\n * Redirect config.title -- so that title config do not affect header labels,\n * which also uses `title` directive to implement.\n *\n * For subtitle configs in config.title, keep them in config.title as header titles never have subtitles.\n */\nfunction redirectTitleConfig(config) {\n const { titleMarkConfig, subtitleMarkConfig, subtitle } = extractTitleConfig(config.title);\n // set config.style if title/subtitleMarkConfig is not an empty object\n if (!isEmpty(titleMarkConfig)) {\n config.style['group-title'] = Object.assign(Object.assign({}, config.style['group-title']), titleMarkConfig // config.title has higher precedence than config.style.group-title in Vega\n );\n }\n if (!isEmpty(subtitleMarkConfig)) {\n config.style['group-subtitle'] = Object.assign(Object.assign({}, config.style['group-subtitle']), subtitleMarkConfig);\n }\n // subtitle part can stay in config.title since header titles do not use subtitle\n if (!isEmpty(subtitle)) {\n config.title = subtitle;\n }\n else {\n delete config.title;\n }\n}\nfunction redirectConfigToStyleConfig(config, prop, // string = composite mark\ntoProp, compositeMarkPart) {\n const propConfig = compositeMarkPart ? config[prop][compositeMarkPart] : config[prop];\n if (prop === 'view') {\n toProp = 'cell'; // View's default style is \"cell\"\n }\n const style = Object.assign(Object.assign({}, propConfig), config.style[toProp !== null && toProp !== void 0 ? toProp : prop]);\n // set config.style if it is not an empty object\n if (!isEmpty(style)) {\n config.style[toProp !== null && toProp !== void 0 ? toProp : prop] = style;\n }\n if (!compositeMarkPart) {\n // For composite mark, so don't delete the whole config yet as we have to do multiple redirections.\n delete config[prop];\n }\n}\n//# sourceMappingURL=config.js.map","export function isLayerSpec(spec) {\n return 'layer' in spec;\n}\n//# sourceMappingURL=layer.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as log from '../log';\nimport { isConcatSpec, isHConcatSpec, isVConcatSpec } from './concat';\nimport { isFacetSpec } from './facet';\nimport { isLayerSpec } from './layer';\nimport { isRepeatSpec } from './repeat';\nimport { isUnitSpec } from './unit';\nexport class SpecMapper {\n map(spec, params) {\n if (isFacetSpec(spec)) {\n return this.mapFacet(spec, params);\n }\n else if (isRepeatSpec(spec)) {\n return this.mapRepeat(spec, params);\n }\n else if (isHConcatSpec(spec)) {\n return this.mapHConcat(spec, params);\n }\n else if (isVConcatSpec(spec)) {\n return this.mapVConcat(spec, params);\n }\n else if (isConcatSpec(spec)) {\n return this.mapConcat(spec, params);\n }\n else {\n return this.mapLayerOrUnit(spec, params);\n }\n }\n mapLayerOrUnit(spec, params) {\n if (isLayerSpec(spec)) {\n return this.mapLayer(spec, params);\n }\n else if (isUnitSpec(spec)) {\n return this.mapUnit(spec, params);\n }\n throw new Error(log.message.invalidSpec(spec));\n }\n mapLayer(spec, params) {\n return Object.assign(Object.assign({}, spec), { layer: spec.layer.map(subspec => this.mapLayerOrUnit(subspec, params)) });\n }\n mapHConcat(spec, params) {\n return Object.assign(Object.assign({}, spec), { hconcat: spec.hconcat.map(subspec => this.map(subspec, params)) });\n }\n mapVConcat(spec, params) {\n return Object.assign(Object.assign({}, spec), { vconcat: spec.vconcat.map(subspec => this.map(subspec, params)) });\n }\n mapConcat(spec, params) {\n const { concat } = spec, rest = __rest(spec, [\"concat\"]);\n return Object.assign(Object.assign({}, rest), { concat: concat.map(subspec => this.map(subspec, params)) });\n }\n mapFacet(spec, params) {\n return Object.assign(Object.assign({}, spec), { \n // TODO: remove \"any\" once we support all facet listed in https://github.com/vega/vega-lite/issues/2760\n spec: this.map(spec.spec, params) });\n }\n mapRepeat(spec, params) {\n return Object.assign(Object.assign({}, spec), { \n // as any is required here since TS cannot infer that the output type satisfies the input type\n spec: this.map(spec.spec, params) });\n }\n}\n//# sourceMappingURL=map.js.map","import { isArray } from 'vega-util';\nexport function isRepeatSpec(spec) {\n return 'repeat' in spec;\n}\nexport function isLayerRepeatSpec(spec) {\n return !isArray(spec.repeat) && spec.repeat['layer'];\n}\n//# sourceMappingURL=repeat.js.map","import { array, isBoolean } from 'vega-util';\nimport { SUM_OPS } from './aggregate';\nimport { getSecondaryRangeChannel, NONPOSITION_CHANNELS } from './channel';\nimport { channelDefType, getFieldDef, isFieldDef, isFieldOrDatumDef, vgField } from './channeldef';\nimport { channelHasField, isAggregate } from './encoding';\nimport * as log from './log';\nimport { ARC, AREA, BAR, CIRCLE, isMarkDef, isPathMark, LINE, POINT, RULE, SQUARE, TEXT, TICK } from './mark';\nimport { ScaleType } from './scale';\nimport { contains } from './util';\nconst STACK_OFFSET_INDEX = {\n zero: 1,\n center: 1,\n normalize: 1\n};\nexport function isStackOffset(s) {\n return s in STACK_OFFSET_INDEX;\n}\nexport const STACKABLE_MARKS = new Set([ARC, BAR, AREA, RULE, POINT, CIRCLE, SQUARE, LINE, TEXT, TICK]);\nexport const STACK_BY_DEFAULT_MARKS = new Set([BAR, AREA, ARC]);\nfunction potentialStackedChannel(encoding, x) {\n var _a, _b;\n const y = x === 'x' ? 'y' : 'radius';\n const xDef = encoding[x];\n const yDef = encoding[y];\n if (isFieldDef(xDef) && isFieldDef(yDef)) {\n if (channelDefType(xDef) === 'quantitative' && channelDefType(yDef) === 'quantitative') {\n if (xDef.stack) {\n return x;\n }\n else if (yDef.stack) {\n return y;\n }\n const xAggregate = isFieldDef(xDef) && !!xDef.aggregate;\n const yAggregate = isFieldDef(yDef) && !!yDef.aggregate;\n // if there is no explicit stacking, only apply stack if there is only one aggregate for x or y\n if (xAggregate !== yAggregate) {\n return xAggregate ? x : y;\n }\n else {\n const xScale = (_a = xDef.scale) === null || _a === void 0 ? void 0 : _a.type;\n const yScale = (_b = yDef.scale) === null || _b === void 0 ? void 0 : _b.type;\n if (xScale && xScale !== 'linear') {\n return y;\n }\n else if (yScale && yScale !== 'linear') {\n return x;\n }\n }\n }\n else if (channelDefType(xDef) === 'quantitative') {\n return x;\n }\n else if (channelDefType(yDef) === 'quantitative') {\n return y;\n }\n }\n else if (channelDefType(xDef) === 'quantitative') {\n return x;\n }\n else if (channelDefType(yDef) === 'quantitative') {\n return y;\n }\n return undefined;\n}\nfunction getDimensionChannel(channel) {\n switch (channel) {\n case 'x':\n return 'y';\n case 'y':\n return 'x';\n case 'theta':\n return 'radius';\n case 'radius':\n return 'theta';\n }\n}\n// Note: CompassQL uses this method and only pass in required properties of each argument object.\n// If required properties change, make sure to update CompassQL.\nexport function stack(m, encoding, opt = {}) {\n const mark = isMarkDef(m) ? m.type : m;\n // Should have stackable mark\n if (!STACKABLE_MARKS.has(mark)) {\n return null;\n }\n // Run potential stacked twice, one for Cartesian and another for Polar,\n // so text marks can be stacked in any of the coordinates.\n // Note: The logic here is not perfectly correct. If we want to support stacked dot plots where each dot is a pie chart with label, we have to change the stack logic here to separate Cartesian stacking for polar stacking.\n // However, since we probably never want to do that, let's just note the limitation here.\n const fieldChannel = potentialStackedChannel(encoding, 'x') || potentialStackedChannel(encoding, 'theta');\n if (!fieldChannel) {\n return null;\n }\n const stackedFieldDef = encoding[fieldChannel];\n const stackedField = isFieldDef(stackedFieldDef) ? vgField(stackedFieldDef, {}) : undefined;\n let dimensionChannel = getDimensionChannel(fieldChannel);\n let dimensionDef = encoding[dimensionChannel];\n let dimensionField = isFieldDef(dimensionDef) ? vgField(dimensionDef, {}) : undefined;\n // avoid grouping by the stacked field\n if (dimensionField === stackedField) {\n dimensionField = undefined;\n dimensionDef = undefined;\n dimensionChannel = undefined;\n }\n // Should have grouping level of detail that is different from the dimension field\n const stackBy = NONPOSITION_CHANNELS.reduce((sc, channel) => {\n // Ignore tooltip in stackBy (https://github.com/vega/vega-lite/issues/4001)\n if (channel !== 'tooltip' && channelHasField(encoding, channel)) {\n const channelDef = encoding[channel];\n for (const cDef of array(channelDef)) {\n const fieldDef = getFieldDef(cDef);\n if (fieldDef.aggregate) {\n continue;\n }\n // Check whether the channel's field is identical to x/y's field or if the channel is a repeat\n const f = vgField(fieldDef, {});\n if (\n // if fielddef is a repeat, just include it in the stack by\n !f ||\n // otherwise, the field must be different from x and y fields.\n f !== dimensionField) {\n sc.push({ channel, fieldDef });\n }\n }\n }\n return sc;\n }, []);\n // Automatically determine offset\n let offset;\n if (stackedFieldDef.stack !== undefined) {\n if (isBoolean(stackedFieldDef.stack)) {\n offset = stackedFieldDef.stack ? 'zero' : null;\n }\n else {\n offset = stackedFieldDef.stack;\n }\n }\n else if (stackBy.length > 0 && STACK_BY_DEFAULT_MARKS.has(mark)) {\n // Bar and Area with sum ops are automatically stacked by default\n offset = 'zero';\n }\n if (!offset || !isStackOffset(offset)) {\n return null;\n }\n if (isAggregate(encoding) && stackBy.length === 0) {\n return null;\n }\n // warn when stacking non-linear\n if (stackedFieldDef.scale && stackedFieldDef.scale.type && stackedFieldDef.scale.type !== ScaleType.LINEAR) {\n if (opt.disallowNonLinearStack) {\n return null;\n }\n else {\n log.warn(log.message.cannotStackNonLinearScale(stackedFieldDef.scale.type));\n }\n }\n // Check if it is a ranged mark\n if (isFieldOrDatumDef(encoding[getSecondaryRangeChannel(fieldChannel)])) {\n if (stackedFieldDef.stack !== undefined) {\n log.warn(log.message.cannotStackRangedMark(fieldChannel));\n }\n return null;\n }\n // Warn if stacking non-summative aggregate\n if (isFieldDef(stackedFieldDef) && stackedFieldDef.aggregate && !contains(SUM_OPS, stackedFieldDef.aggregate)) {\n log.warn(log.message.stackNonSummativeAggregate(stackedFieldDef.aggregate));\n }\n return {\n groupbyChannel: dimensionDef ? dimensionChannel : undefined,\n groupbyField: dimensionField,\n fieldChannel,\n impute: stackedFieldDef.impute === null ? false : isPathMark(mark),\n stackBy,\n offset\n };\n}\n//# sourceMappingURL=stack.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isObject } from 'vega-util';\nimport { normalizeEncoding } from '../encoding';\nimport { isMarkDef } from '../mark';\nimport { isUnitSpec } from '../spec/unit';\nimport { stack } from '../stack';\nimport { keys, omit, pick } from '../util';\nfunction dropLineAndPoint(markDef) {\n const { point: _point, line: _line } = markDef, mark = __rest(markDef, [\"point\", \"line\"]);\n return keys(mark).length > 1 ? mark : mark.type;\n}\nfunction dropLineAndPointFromConfig(config) {\n for (const mark of ['line', 'area', 'rule', 'trail']) {\n if (config[mark]) {\n config = Object.assign(Object.assign({}, config), { \n // TODO: remove as any\n [mark]: omit(config[mark], ['point', 'line']) });\n }\n }\n return config;\n}\nfunction getPointOverlay(markDef, markConfig = {}, encoding) {\n if (markDef.point === 'transparent') {\n return { opacity: 0 };\n }\n else if (markDef.point) {\n // truthy : true or object\n return isObject(markDef.point) ? markDef.point : {};\n }\n else if (markDef.point !== undefined) {\n // false or null\n return null;\n }\n else {\n // undefined (not disabled)\n if (markConfig.point || encoding.shape) {\n // enable point overlay if config[mark].point is truthy or if encoding.shape is provided\n return isObject(markConfig.point) ? markConfig.point : {};\n }\n // markDef.point is defined as falsy\n return undefined;\n }\n}\nfunction getLineOverlay(markDef, markConfig = {}) {\n if (markDef.line) {\n // true or object\n return markDef.line === true ? {} : markDef.line;\n }\n else if (markDef.line !== undefined) {\n // false or null\n return null;\n }\n else {\n // undefined (not disabled)\n if (markConfig.line) {\n // enable line overlay if config[mark].line is truthy\n return markConfig.line === true ? {} : markConfig.line;\n }\n // markDef.point is defined as falsy\n return undefined;\n }\n}\nexport class PathOverlayNormalizer {\n constructor() {\n this.name = 'path-overlay';\n }\n hasMatchingType(spec, config) {\n if (isUnitSpec(spec)) {\n const { mark, encoding } = spec;\n const markDef = isMarkDef(mark) ? mark : { type: mark };\n switch (markDef.type) {\n case 'line':\n case 'rule':\n case 'trail':\n return !!getPointOverlay(markDef, config[markDef.type], encoding);\n case 'area':\n return (\n // false / null are also included as we want to remove the properties\n !!getPointOverlay(markDef, config[markDef.type], encoding) ||\n !!getLineOverlay(markDef, config[markDef.type]));\n }\n }\n return false;\n }\n run(spec, params, normalize) {\n const { config } = params;\n const { selection, projection, mark, encoding: e } = spec, outerSpec = __rest(spec, [\"selection\", \"projection\", \"mark\", \"encoding\"]);\n // Need to call normalizeEncoding because we need the inferred types to correctly determine stack\n const encoding = normalizeEncoding(e, config);\n const markDef = isMarkDef(mark) ? mark : { type: mark };\n const pointOverlay = getPointOverlay(markDef, config[markDef.type], encoding);\n const lineOverlay = markDef.type === 'area' && getLineOverlay(markDef, config[markDef.type]);\n const layer = [\n Object.assign(Object.assign({}, (selection ? { selection } : {})), { mark: dropLineAndPoint(Object.assign(Object.assign({}, (markDef.type === 'area' && markDef.opacity === undefined && markDef.fillOpacity === undefined\n ? { opacity: 0.7 }\n : {})), markDef)), \n // drop shape from encoding as this might be used to trigger point overlay\n encoding: omit(encoding, ['shape']) })\n ];\n // FIXME: determine rules for applying selections.\n // Need to copy stack config to overlayed layer\n const stackProps = stack(markDef, encoding);\n let overlayEncoding = encoding;\n if (stackProps) {\n const { fieldChannel: stackFieldChannel, offset } = stackProps;\n overlayEncoding = Object.assign(Object.assign({}, encoding), { [stackFieldChannel]: Object.assign(Object.assign({}, encoding[stackFieldChannel]), (offset ? { stack: offset } : {})) });\n }\n if (lineOverlay) {\n layer.push(Object.assign(Object.assign({}, (projection ? { projection } : {})), { mark: Object.assign(Object.assign({ type: 'line' }, pick(markDef, ['clip', 'interpolate', 'tension', 'tooltip'])), lineOverlay), encoding: overlayEncoding }));\n }\n if (pointOverlay) {\n layer.push(Object.assign(Object.assign({}, (projection ? { projection } : {})), { mark: Object.assign(Object.assign({ type: 'point', opacity: 1, filled: true }, pick(markDef, ['clip', 'tooltip'])), pointOverlay), encoding: overlayEncoding }));\n }\n return normalize(Object.assign(Object.assign({}, outerSpec), { layer }), Object.assign(Object.assign({}, params), { config: dropLineAndPointFromConfig(config) }));\n }\n}\n//# sourceMappingURL=pathoverlay.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { getSizeChannel, POSITION_SCALE_CHANNELS } from '../channel';\nimport { isFieldOrDatumDef } from '../channeldef';\nimport * as log from '../log';\nimport { isUnitSpec } from '../spec/unit';\nimport { isEmpty } from '../util';\nexport class RangeStepNormalizer {\n constructor() {\n this.name = 'RangeStep';\n }\n hasMatchingType(spec) {\n var _a;\n if (isUnitSpec(spec) && spec.encoding) {\n for (const channel of POSITION_SCALE_CHANNELS) {\n const def = spec.encoding[channel];\n if (def && isFieldOrDatumDef(def)) {\n if ((_a = def === null || def === void 0 ? void 0 : def.scale) === null || _a === void 0 ? void 0 : _a['rangeStep']) {\n return true;\n }\n }\n }\n }\n return false;\n }\n run(spec) {\n var _a;\n const sizeMixins = {};\n let encoding = Object.assign({}, spec.encoding);\n for (const channel of POSITION_SCALE_CHANNELS) {\n const sizeType = getSizeChannel(channel);\n const def = encoding[channel];\n if (def && isFieldOrDatumDef(def)) {\n if ((_a = def === null || def === void 0 ? void 0 : def.scale) === null || _a === void 0 ? void 0 : _a['rangeStep']) {\n const { scale } = def, defWithoutScale = __rest(def, [\"scale\"]);\n const _b = scale, { rangeStep } = _b, scaleWithoutRangeStep = __rest(_b, [\"rangeStep\"]);\n sizeMixins[sizeType] = { step: scale['rangeStep'] };\n log.warn(log.message.RANGE_STEP_DEPRECATED);\n encoding = Object.assign(Object.assign({}, encoding), { [channel]: Object.assign(Object.assign({}, defWithoutScale), (isEmpty(scaleWithoutRangeStep) ? {} : { scale: scaleWithoutRangeStep })) });\n }\n }\n }\n return Object.assign(Object.assign(Object.assign({}, sizeMixins), spec), { encoding });\n }\n}\n//# sourceMappingURL=rangestep.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { hasOwnProperty, isArray } from 'vega-util';\nimport { hasConditionalFieldOrDatumDef, isConditionalDef, isFieldDef, isFieldOrDatumDef, isRepeatRef, isSortableFieldDef } from '../channeldef';\nimport * as log from '../log';\nimport { isSortField } from '../sort';\nimport { isFacetMapping } from '../spec/facet';\nexport function replaceRepeaterInFacet(facet, repeater) {\n if (!repeater) {\n return facet;\n }\n if (isFacetMapping(facet)) {\n return replaceRepeaterInMapping(facet, repeater);\n }\n return replaceRepeaterInFieldDef(facet, repeater);\n}\nexport function replaceRepeaterInEncoding(encoding, repeater) {\n if (!repeater) {\n return encoding;\n }\n return replaceRepeaterInMapping(encoding, repeater);\n}\n/**\n * Replaces repeated value and returns if the repeated value is valid.\n */\nfunction replaceRepeatInProp(prop, o, repeater) {\n const val = o[prop];\n if (isRepeatRef(val)) {\n if (val.repeat in repeater) {\n return Object.assign(Object.assign({}, o), { [prop]: repeater[val.repeat] });\n }\n else {\n log.warn(log.message.noSuchRepeatedValue(val.repeat));\n return undefined;\n }\n }\n return o;\n}\n/**\n * Replace repeater values in a field def with the concrete field name.\n */\nfunction replaceRepeaterInFieldDef(fieldDef, repeater) {\n fieldDef = replaceRepeatInProp('field', fieldDef, repeater);\n if (fieldDef === undefined) {\n // the field def should be ignored\n return undefined;\n }\n else if (fieldDef === null) {\n return null;\n }\n if (isSortableFieldDef(fieldDef) && isSortField(fieldDef.sort)) {\n const sort = replaceRepeatInProp('field', fieldDef.sort, repeater);\n fieldDef = Object.assign(Object.assign({}, fieldDef), (sort ? { sort } : {}));\n }\n return fieldDef;\n}\nfunction replaceRepeaterInFieldOrDatumDef(def, repeater) {\n if (isFieldDef(def)) {\n return replaceRepeaterInFieldDef(def, repeater);\n }\n else {\n const datumDef = replaceRepeatInProp('datum', def, repeater);\n if (datumDef !== def && !datumDef.type) {\n datumDef.type = 'nominal';\n }\n return datumDef;\n }\n}\nfunction replaceRepeaterInChannelDef(channelDef, repeater) {\n if (isFieldOrDatumDef(channelDef)) {\n const fd = replaceRepeaterInFieldOrDatumDef(channelDef, repeater);\n if (fd) {\n return fd;\n }\n else if (isConditionalDef(channelDef)) {\n return { condition: channelDef.condition };\n }\n }\n else {\n if (hasConditionalFieldOrDatumDef(channelDef)) {\n const fd = replaceRepeaterInFieldOrDatumDef(channelDef.condition, repeater);\n if (fd) {\n return Object.assign(Object.assign({}, channelDef), { condition: fd });\n }\n else {\n const { condition } = channelDef, channelDefWithoutCondition = __rest(channelDef, [\"condition\"]);\n return channelDefWithoutCondition;\n }\n }\n return channelDef;\n }\n return undefined;\n}\nfunction replaceRepeaterInMapping(mapping, repeater) {\n const out = {};\n for (const channel in mapping) {\n if (hasOwnProperty(mapping, channel)) {\n const channelDef = mapping[channel];\n if (isArray(channelDef)) {\n // array cannot have condition\n out[channel] = channelDef // somehow we need to cast it here\n .map(cd => replaceRepeaterInChannelDef(cd, repeater))\n .filter(cd => cd);\n }\n else {\n const cd = replaceRepeaterInChannelDef(channelDef, repeater);\n if (cd !== undefined) {\n out[channel] = cd;\n }\n }\n }\n }\n return out;\n}\n//# sourceMappingURL=repeater.js.map","import { isBinned } from '../bin';\nimport { getMainRangeChannel, SECONDARY_RANGE_CHANNEL } from '../channel';\nimport { isDatumDef, isFieldDef } from '../channeldef';\nimport * as log from '../log';\nimport { isUnitSpec } from '../spec/unit';\nexport class RuleForRangedLineNormalizer {\n constructor() {\n this.name = 'RuleForRangedLine';\n }\n hasMatchingType(spec) {\n if (isUnitSpec(spec)) {\n const { encoding, mark } = spec;\n if (mark === 'line') {\n for (const channel of SECONDARY_RANGE_CHANNEL) {\n const mainChannel = getMainRangeChannel(channel);\n const mainChannelDef = encoding[mainChannel];\n if (encoding[channel]) {\n if ((isFieldDef(mainChannelDef) && !isBinned(mainChannelDef.bin)) || isDatumDef(mainChannelDef)) {\n return true;\n }\n }\n }\n }\n }\n return false;\n }\n run(spec, params, normalize) {\n const { encoding } = spec;\n log.warn(log.message.lineWithRange(!!encoding.x2, !!encoding.y2));\n return normalize(Object.assign(Object.assign({}, spec), { mark: 'rule' }), params);\n }\n}\n//# sourceMappingURL=ruleforrangedline.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray } from 'vega-util';\nimport { COLUMN, FACET, ROW } from '../channel';\nimport { hasConditionalFieldOrDatumDef, isFieldOrDatumDef, isValueDef } from '../channeldef';\nimport { boxPlotNormalizer } from '../compositemark/boxplot';\nimport { errorBandNormalizer } from '../compositemark/errorband';\nimport { errorBarNormalizer } from '../compositemark/errorbar';\nimport { channelHasField } from '../encoding';\nimport * as log from '../log';\nimport { isFacetMapping } from '../spec/facet';\nimport { SpecMapper } from '../spec/map';\nimport { isLayerRepeatSpec } from '../spec/repeat';\nimport { isUnitSpec } from '../spec/unit';\nimport { isEmpty, keys, omit, varName } from '../util';\nimport { isSignalRef } from '../vega.schema';\nimport { PathOverlayNormalizer } from './pathoverlay';\nimport { RangeStepNormalizer } from './rangestep';\nimport { replaceRepeaterInEncoding, replaceRepeaterInFacet } from './repeater';\nimport { RuleForRangedLineNormalizer } from './ruleforrangedline';\nexport class CoreNormalizer extends SpecMapper {\n constructor() {\n super(...arguments);\n this.nonFacetUnitNormalizers = [\n boxPlotNormalizer,\n errorBarNormalizer,\n errorBandNormalizer,\n new PathOverlayNormalizer(),\n new RuleForRangedLineNormalizer(),\n new RangeStepNormalizer()\n ];\n }\n map(spec, params) {\n // Special handling for a faceted unit spec as it can return a facet spec, not just a layer or unit spec like a normal unit spec.\n if (isUnitSpec(spec)) {\n const hasRow = channelHasField(spec.encoding, ROW);\n const hasColumn = channelHasField(spec.encoding, COLUMN);\n const hasFacet = channelHasField(spec.encoding, FACET);\n if (hasRow || hasColumn || hasFacet) {\n return this.mapFacetedUnit(spec, params);\n }\n }\n return super.map(spec, params);\n }\n // This is for normalizing non-facet unit\n mapUnit(spec, params) {\n const { parentEncoding, parentProjection } = params;\n const encoding = replaceRepeaterInEncoding(spec.encoding, params.repeater);\n const specWithReplacedEncoding = Object.assign(Object.assign({}, spec), (encoding ? { encoding } : {}));\n if (parentEncoding || parentProjection) {\n return this.mapUnitWithParentEncodingOrProjection(specWithReplacedEncoding, params);\n }\n const normalizeLayerOrUnit = this.mapLayerOrUnit.bind(this);\n for (const unitNormalizer of this.nonFacetUnitNormalizers) {\n if (unitNormalizer.hasMatchingType(specWithReplacedEncoding, params.config)) {\n return unitNormalizer.run(specWithReplacedEncoding, params, normalizeLayerOrUnit);\n }\n }\n return specWithReplacedEncoding;\n }\n mapRepeat(spec, params) {\n if (isLayerRepeatSpec(spec)) {\n return this.mapLayerRepeat(spec, params);\n }\n else {\n return this.mapNonLayerRepeat(spec, params);\n }\n }\n mapLayerRepeat(spec, params) {\n const { repeat, spec: childSpec } = spec, rest = __rest(spec, [\"repeat\", \"spec\"]);\n const { row, column, layer } = repeat;\n const { repeater = {}, repeaterPrefix = '' } = params;\n if (row || column) {\n return this.mapRepeat(Object.assign(Object.assign({}, spec), { repeat: Object.assign(Object.assign({}, (row ? { row } : {})), (column ? { column } : {})), spec: {\n repeat: { layer },\n spec: childSpec\n } }), params);\n }\n else {\n return Object.assign(Object.assign({}, rest), { layer: layer.map(layerValue => {\n const childRepeater = Object.assign(Object.assign({}, repeater), { layer: layerValue });\n const childName = (childSpec.name || '') + repeaterPrefix + `child__layer_${varName(layerValue)}`;\n const child = this.mapLayerOrUnit(childSpec, Object.assign(Object.assign({}, params), { repeater: childRepeater, repeaterPrefix: childName }));\n child.name = childName;\n return child;\n }) });\n }\n }\n mapNonLayerRepeat(spec, params) {\n var _a;\n const { repeat, spec: childSpec, data } = spec, remainingProperties = __rest(spec, [\"repeat\", \"spec\", \"data\"]);\n if (!isArray(repeat) && spec.columns) {\n // is repeat with row/column\n spec = omit(spec, ['columns']);\n log.warn(log.message.columnsNotSupportByRowCol('repeat'));\n }\n const concat = [];\n const { repeater = {}, repeaterPrefix = '' } = params;\n const row = (!isArray(repeat) && repeat.row) || [repeater ? repeater.row : null];\n const column = (!isArray(repeat) && repeat.column) || [repeater ? repeater.column : null];\n const repeatValues = (isArray(repeat) && repeat) || [repeater ? repeater.repeat : null];\n // cross product\n for (const repeatValue of repeatValues) {\n for (const rowValue of row) {\n for (const columnValue of column) {\n const childRepeater = {\n repeat: repeatValue,\n row: rowValue,\n column: columnValue,\n layer: repeater.layer\n };\n const childName = (childSpec.name || '') +\n repeaterPrefix +\n 'child__' +\n (isArray(repeat)\n ? `${varName(repeatValue)}`\n : (repeat.row ? `row_${varName(rowValue)}` : '') +\n (repeat.column ? `column_${varName(columnValue)}` : ''));\n const child = this.map(childSpec, Object.assign(Object.assign({}, params), { repeater: childRepeater, repeaterPrefix: childName }));\n child.name = childName;\n // we move data up\n concat.push(omit(child, ['data']));\n }\n }\n }\n const columns = isArray(repeat) ? spec.columns : repeat.column ? repeat.column.length : 1;\n return Object.assign(Object.assign({ data: (_a = childSpec.data) !== null && _a !== void 0 ? _a : data, align: 'all' }, remainingProperties), { columns,\n concat });\n }\n mapFacet(spec, params) {\n const { facet } = spec;\n if (isFacetMapping(facet) && spec.columns) {\n // is facet with row/column\n spec = omit(spec, ['columns']);\n log.warn(log.message.columnsNotSupportByRowCol('facet'));\n }\n return super.mapFacet(spec, params);\n }\n mapUnitWithParentEncodingOrProjection(spec, params) {\n const { encoding, projection } = spec;\n const { parentEncoding, parentProjection, config } = params;\n const mergedProjection = mergeProjection({ parentProjection, projection });\n const mergedEncoding = mergeEncoding({\n parentEncoding,\n encoding: replaceRepeaterInEncoding(encoding, params.repeater)\n });\n return this.mapUnit(Object.assign(Object.assign(Object.assign({}, spec), (mergedProjection ? { projection: mergedProjection } : {})), (mergedEncoding ? { encoding: mergedEncoding } : {})), { config });\n }\n mapFacetedUnit(spec, params) {\n // New encoding in the inside spec should not contain row / column\n // as row/column should be moved to facet\n const _a = spec.encoding, { row, column, facet } = _a, encoding = __rest(_a, [\"row\", \"column\", \"facet\"]);\n // Mark and encoding should be moved into the inner spec\n const { mark, width, projection, height, view, selection, encoding: _ } = spec, outerSpec = __rest(spec, [\"mark\", \"width\", \"projection\", \"height\", \"view\", \"selection\", \"encoding\"]);\n const { facetMapping, layout } = this.getFacetMappingAndLayout({ row, column, facet }, params);\n const newEncoding = replaceRepeaterInEncoding(encoding, params.repeater);\n return this.mapFacet(Object.assign(Object.assign(Object.assign({}, outerSpec), layout), { \n // row / column has higher precedence than facet\n facet: facetMapping, spec: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (width ? { width } : {})), (height ? { height } : {})), (view ? { view } : {})), (projection ? { projection } : {})), { mark, encoding: newEncoding }), (selection ? { selection } : {})) }), params);\n }\n getFacetMappingAndLayout(facets, params) {\n var _a;\n const { row, column, facet } = facets;\n if (row || column) {\n if (facet) {\n log.warn(log.message.facetChannelDropped([...(row ? [ROW] : []), ...(column ? [COLUMN] : [])]));\n }\n const facetMapping = {};\n const layout = {};\n for (const channel of [ROW, COLUMN]) {\n const def = facets[channel];\n if (def) {\n const { align, center, spacing, columns } = def, defWithoutLayout = __rest(def, [\"align\", \"center\", \"spacing\", \"columns\"]);\n facetMapping[channel] = defWithoutLayout;\n for (const prop of ['align', 'center', 'spacing']) {\n if (def[prop] !== undefined) {\n layout[prop] = (_a = layout[prop]) !== null && _a !== void 0 ? _a : {};\n layout[prop][channel] = def[prop];\n }\n }\n }\n }\n return { facetMapping, layout };\n }\n else {\n const { align, center, spacing, columns } = facet, facetMapping = __rest(facet, [\"align\", \"center\", \"spacing\", \"columns\"]);\n return {\n facetMapping: replaceRepeaterInFacet(facetMapping, params.repeater),\n layout: Object.assign(Object.assign(Object.assign(Object.assign({}, (align ? { align } : {})), (center ? { center } : {})), (spacing ? { spacing } : {})), (columns ? { columns } : {}))\n };\n }\n }\n mapLayer(spec, _a) {\n // Special handling for extended layer spec\n var { parentEncoding, parentProjection } = _a, otherParams = __rest(_a, [\"parentEncoding\", \"parentProjection\"]);\n const { encoding, projection } = spec, rest = __rest(spec, [\"encoding\", \"projection\"]);\n const params = Object.assign(Object.assign({}, otherParams), { parentEncoding: mergeEncoding({ parentEncoding, encoding, layer: true }), parentProjection: mergeProjection({ parentProjection, projection }) });\n return super.mapLayer(rest, params);\n }\n}\nfunction mergeEncoding({ parentEncoding, encoding = {}, layer }) {\n let merged = {};\n if (parentEncoding) {\n const channels = new Set([...keys(parentEncoding), ...keys(encoding)]);\n for (const channel of channels) {\n const channelDef = encoding[channel];\n const parentChannelDef = parentEncoding[channel];\n if (isFieldOrDatumDef(channelDef)) {\n // Field/Datum Def can inherit properties from its parent\n // Note that parentChannelDef doesn't have to be a field/datum def if the channelDef is already one.\n const mergedChannelDef = Object.assign(Object.assign({}, parentChannelDef), channelDef);\n merged[channel] = mergedChannelDef;\n }\n else if (hasConditionalFieldOrDatumDef(channelDef)) {\n merged[channel] = Object.assign(Object.assign({}, channelDef), { condition: Object.assign(Object.assign({}, parentChannelDef), channelDef.condition) });\n }\n else if (channelDef || channelDef === null) {\n merged[channel] = channelDef;\n }\n else if (layer ||\n isValueDef(parentChannelDef) ||\n isSignalRef(parentChannelDef) ||\n isFieldOrDatumDef(parentChannelDef) ||\n isArray(parentChannelDef)) {\n merged[channel] = parentChannelDef;\n }\n }\n }\n else {\n merged = encoding;\n }\n return !merged || isEmpty(merged) ? undefined : merged;\n}\nfunction mergeProjection(opt) {\n const { parentProjection, projection } = opt;\n if (parentProjection && projection) {\n log.warn(log.message.projectionOverridden({ parentProjection, projection }));\n }\n return projection !== null && projection !== void 0 ? projection : parentProjection;\n}\n//# sourceMappingURL=core.js.map","import { isString } from 'vega-util';\nimport { initConfig } from '../config';\nimport * as log from '../log';\nimport { isLayerSpec, isUnitSpec } from '../spec';\nimport { deepEqual } from '../util';\nimport { CoreNormalizer } from './core';\nexport function normalize(spec, config) {\n if (config === undefined) {\n config = initConfig(spec.config);\n }\n const normalizedSpec = normalizeGenericSpec(spec, config);\n const { width, height } = spec;\n const autosize = normalizeAutoSize(normalizedSpec, { width, height, autosize: spec.autosize }, config);\n return Object.assign(Object.assign({}, normalizedSpec), (autosize ? { autosize } : {}));\n}\nconst normalizer = new CoreNormalizer();\n/**\n * Decompose extended unit specs into composition of pure unit specs.\n */\nfunction normalizeGenericSpec(spec, config = {}) {\n return normalizer.map(spec, { config });\n}\nfunction _normalizeAutoSize(autosize) {\n return isString(autosize) ? { type: autosize } : autosize !== null && autosize !== void 0 ? autosize : {};\n}\n/**\n * Normalize autosize and deal with width or height == \"container\".\n */\nexport function normalizeAutoSize(spec, sizeInfo, config) {\n let { width, height } = sizeInfo;\n const isFitCompatible = isUnitSpec(spec) || isLayerSpec(spec);\n const autosizeDefault = {};\n if (!isFitCompatible) {\n // If spec is not compatible with autosize == \"fit\", discard width/height == container\n if (width == 'container') {\n log.warn(log.message.containerSizeNonSingle('width'));\n width = undefined;\n }\n if (height == 'container') {\n log.warn(log.message.containerSizeNonSingle('height'));\n height = undefined;\n }\n }\n else {\n // Default autosize parameters to fit when width/height is \"container\"\n if (width == 'container' && height == 'container') {\n autosizeDefault.type = 'fit';\n autosizeDefault.contains = 'padding';\n }\n else if (width == 'container') {\n autosizeDefault.type = 'fit-x';\n autosizeDefault.contains = 'padding';\n }\n else if (height == 'container') {\n autosizeDefault.type = 'fit-y';\n autosizeDefault.contains = 'padding';\n }\n }\n const autosize = Object.assign(Object.assign(Object.assign({ type: 'pad' }, autosizeDefault), (config ? _normalizeAutoSize(config.autosize) : {})), _normalizeAutoSize(spec.autosize));\n if (autosize.type === 'fit' && !isFitCompatible) {\n log.warn(log.message.FIT_NON_SINGLE);\n autosize.type = 'pad';\n }\n if (width == 'container' && !(autosize.type == 'fit' || autosize.type == 'fit-x')) {\n log.warn(log.message.containerSizeNotCompatibleWithAutosize('width'));\n }\n if (height == 'container' && !(autosize.type == 'fit' || autosize.type == 'fit-y')) {\n log.warn(log.message.containerSizeNotCompatibleWithAutosize('height'));\n }\n // Delete autosize property if it's Vega's default\n if (deepEqual(autosize, { type: 'pad' })) {\n return undefined;\n }\n return autosize;\n}\n//# sourceMappingURL=index.js.map","import { getPositionScaleChannel } from '../channel';\nimport { signalRefOrValue } from '../compile/common';\nexport function isFitType(autoSizeType) {\n return autoSizeType === 'fit' || autoSizeType === 'fit-x' || autoSizeType === 'fit-y';\n}\nexport function getFitType(sizeType) {\n return sizeType ? `fit-${getPositionScaleChannel(sizeType)}` : 'fit';\n}\nconst TOP_LEVEL_PROPERTIES = [\n 'background',\n 'padding'\n // We do not include \"autosize\" here as it is supported by only unit and layer specs and thus need to be normalized\n];\nexport function extractTopLevelProperties(t, includeParams) {\n const o = {};\n for (const p of TOP_LEVEL_PROPERTIES) {\n if (t && t[p] !== undefined) {\n o[p] = signalRefOrValue(t[p]);\n }\n }\n if (includeParams) {\n o.params = t.params;\n }\n return o;\n}\n//# sourceMappingURL=toplevel.js.map","import * as log from '../log';\nimport { deepEqual, duplicate, getFirstDefined, keys } from '../util';\n/**\n * Generic class for storing properties that are explicitly specified\n * and implicitly determined by the compiler.\n * This is important for scale/axis/legend merging as\n * we want to prioritize properties that users explicitly specified.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport class Split {\n constructor(explicit = {}, implicit = {}) {\n this.explicit = explicit;\n this.implicit = implicit;\n }\n clone() {\n return new Split(duplicate(this.explicit), duplicate(this.implicit));\n }\n combine() {\n // FIXME remove \"as any\".\n // Add \"as any\" to avoid an error \"Spread types may only be created from object types\".\n return Object.assign(Object.assign({}, this.explicit), this.implicit);\n }\n get(key) {\n // Explicit has higher precedence\n return getFirstDefined(this.explicit[key], this.implicit[key]);\n }\n getWithExplicit(key) {\n // Explicit has higher precedence\n if (this.explicit[key] !== undefined) {\n return { explicit: true, value: this.explicit[key] };\n }\n else if (this.implicit[key] !== undefined) {\n return { explicit: false, value: this.implicit[key] };\n }\n return { explicit: false, value: undefined };\n }\n setWithExplicit(key, value) {\n if (value.value !== undefined) {\n this.set(key, value.value, value.explicit);\n }\n }\n set(key, value, explicit) {\n delete this[explicit ? 'implicit' : 'explicit'][key];\n this[explicit ? 'explicit' : 'implicit'][key] = value;\n return this;\n }\n copyKeyFromSplit(key, s) {\n // Explicit has higher precedence\n if (s.explicit[key] !== undefined) {\n this.set(key, s.explicit[key], true);\n }\n else if (s.implicit[key] !== undefined) {\n this.set(key, s.implicit[key], false);\n }\n }\n copyKeyFromObject(key, s) {\n // Explicit has higher precedence\n if (s[key] !== undefined) {\n this.set(key, s[key], true);\n }\n }\n /**\n * Merge split object into this split object. Properties from the other split\n * overwrite properties from this split.\n */\n copyAll(other) {\n for (const key of keys(other.combine())) {\n const val = other.getWithExplicit(key);\n this.setWithExplicit(key, val);\n }\n }\n}\nexport function makeExplicit(value) {\n return {\n explicit: true,\n value\n };\n}\nexport function makeImplicit(value) {\n return {\n explicit: false,\n value\n };\n}\nexport function tieBreakByComparing(compare) {\n return (v1, v2, property, propertyOf) => {\n const diff = compare(v1.value, v2.value);\n if (diff > 0) {\n return v1;\n }\n else if (diff < 0) {\n return v2;\n }\n return defaultTieBreaker(v1, v2, property, propertyOf);\n };\n}\nexport function defaultTieBreaker(v1, v2, property, propertyOf) {\n if (v1.explicit && v2.explicit) {\n log.warn(log.message.mergeConflictingProperty(property, propertyOf, v1.value, v2.value));\n }\n // If equal score, prefer v1.\n return v1;\n}\nexport function mergeValuesWithExplicit(v1, v2, property, propertyOf, tieBreaker = defaultTieBreaker) {\n if (v1 === undefined || v1.value === undefined) {\n // For first run\n return v2;\n }\n if (v1.explicit && !v2.explicit) {\n return v1;\n }\n else if (v2.explicit && !v1.explicit) {\n return v2;\n }\n else if (deepEqual(v1.value, v2.value)) {\n return v1;\n }\n else {\n return tieBreaker(v1, v2, property, propertyOf);\n }\n}\n//# sourceMappingURL=split.js.map","import { Split } from '../split';\n/**\n * Class to track interesting properties (see https://15721.courses.cs.cmu.edu/spring2016/papers/graefe-ieee1995.pdf)\n * about how fields have been parsed or whether they have been derived in a transform. We use this to not parse the\n * same field again (or differently).\n */\nexport class AncestorParse extends Split {\n constructor(explicit = {}, implicit = {}, parseNothing = false) {\n super(explicit, implicit);\n this.explicit = explicit;\n this.implicit = implicit;\n this.parseNothing = parseNothing;\n }\n clone() {\n const clone = super.clone();\n clone.parseNothing = this.parseNothing;\n return clone;\n }\n}\n//# sourceMappingURL=index.js.map","export function isUrlData(data) {\n return 'url' in data;\n}\nexport function isInlineData(data) {\n return 'values' in data;\n}\nexport function isNamedData(data) {\n return 'name' in data && !isUrlData(data) && !isInlineData(data) && !isGenerator(data);\n}\nexport function isGenerator(data) {\n return data && (isSequenceGenerator(data) || isSphereGenerator(data) || isGraticuleGenerator(data));\n}\nexport function isSequenceGenerator(data) {\n return 'sequence' in data;\n}\nexport function isSphereGenerator(data) {\n return 'sphere' in data;\n}\nexport function isGraticuleGenerator(data) {\n return 'graticule' in data;\n}\nexport var DataSourceType;\n(function (DataSourceType) {\n DataSourceType[DataSourceType[\"Raw\"] = 0] = \"Raw\";\n DataSourceType[DataSourceType[\"Main\"] = 1] = \"Main\";\n DataSourceType[DataSourceType[\"Row\"] = 2] = \"Row\";\n DataSourceType[DataSourceType[\"Column\"] = 3] = \"Column\";\n DataSourceType[DataSourceType[\"Lookup\"] = 4] = \"Lookup\";\n})(DataSourceType || (DataSourceType = {}));\n//# sourceMappingURL=data.js.map","import { normalizeLogicalComposition } from './logical';\nimport { normalizePredicate } from './predicate';\nexport function isFilter(t) {\n return 'filter' in t;\n}\nexport function isImputeSequence(t) {\n return (t === null || t === void 0 ? void 0 : t['stop']) !== undefined;\n}\nexport function isLookup(t) {\n return 'lookup' in t;\n}\nexport function isLookupData(from) {\n return 'data' in from;\n}\nexport function isLookupSelection(from) {\n return 'selection' in from;\n}\nexport function isPivot(t) {\n return 'pivot' in t;\n}\nexport function isDensity(t) {\n return 'density' in t;\n}\nexport function isQuantile(t) {\n return 'quantile' in t;\n}\nexport function isRegression(t) {\n return 'regression' in t;\n}\nexport function isLoess(t) {\n return 'loess' in t;\n}\nexport function isSample(t) {\n return 'sample' in t;\n}\nexport function isWindow(t) {\n return 'window' in t;\n}\nexport function isJoinAggregate(t) {\n return 'joinaggregate' in t;\n}\nexport function isFlatten(t) {\n return 'flatten' in t;\n}\nexport function isCalculate(t) {\n return 'calculate' in t;\n}\nexport function isBin(t) {\n return 'bin' in t;\n}\nexport function isImpute(t) {\n return 'impute' in t;\n}\nexport function isTimeUnit(t) {\n return 'timeUnit' in t;\n}\nexport function isAggregate(t) {\n return 'aggregate' in t;\n}\nexport function isStack(t) {\n return 'stack' in t;\n}\nexport function isFold(t) {\n return 'fold' in t;\n}\nexport function normalizeTransform(transform) {\n return transform.map(t => {\n if (isFilter(t)) {\n return {\n filter: normalizeLogicalComposition(t.filter, normalizePredicate)\n };\n }\n return t;\n });\n}\n//# sourceMappingURL=transform.js.map","const VIEW = 'view',\n LBRACK = '[',\n RBRACK = ']',\n LBRACE = '{',\n RBRACE = '}',\n COLON = ':',\n COMMA = ',',\n NAME = '@',\n GT = '>',\n ILLEGAL = /[[\\]{}]/,\n DEFAULT_MARKS = {\n '*': 1,\n arc: 1,\n area: 1,\n group: 1,\n image: 1,\n line: 1,\n path: 1,\n rect: 1,\n rule: 1,\n shape: 1,\n symbol: 1,\n text: 1,\n trail: 1\n};\nlet DEFAULT_SOURCE, MARKS;\n/**\n * Parse an event selector string.\n * Returns an array of event stream definitions.\n */\n\nfunction eventSelector (selector, source, marks) {\n DEFAULT_SOURCE = source || VIEW;\n MARKS = marks || DEFAULT_MARKS;\n return parseMerge(selector.trim()).map(parseSelector);\n}\n\nfunction isMarkType(type) {\n return MARKS[type];\n}\n\nfunction find(s, i, endChar, pushChar, popChar) {\n const n = s.length;\n let count = 0,\n c;\n\n for (; i < n; ++i) {\n c = s[i];\n if (!count && c === endChar) return i;else if (popChar && popChar.indexOf(c) >= 0) --count;else if (pushChar && pushChar.indexOf(c) >= 0) ++count;\n }\n\n return i;\n}\n\nfunction parseMerge(s) {\n const output = [],\n n = s.length;\n let start = 0,\n i = 0;\n\n while (i < n) {\n i = find(s, i, COMMA, LBRACK + LBRACE, RBRACK + RBRACE);\n output.push(s.substring(start, i).trim());\n start = ++i;\n }\n\n if (output.length === 0) {\n throw 'Empty event selector: ' + s;\n }\n\n return output;\n}\n\nfunction parseSelector(s) {\n return s[0] === '[' ? parseBetween(s) : parseStream(s);\n}\n\nfunction parseBetween(s) {\n const n = s.length;\n let i = 1,\n b;\n i = find(s, i, RBRACK, LBRACK, RBRACK);\n\n if (i === n) {\n throw 'Empty between selector: ' + s;\n }\n\n b = parseMerge(s.substring(1, i));\n\n if (b.length !== 2) {\n throw 'Between selector must have two elements: ' + s;\n }\n\n s = s.slice(i + 1).trim();\n\n if (s[0] !== GT) {\n throw 'Expected \\'>\\' after between selector: ' + s;\n }\n\n b = b.map(parseSelector);\n const stream = parseSelector(s.slice(1).trim());\n\n if (stream.between) {\n return {\n between: b,\n stream: stream\n };\n } else {\n stream.between = b;\n }\n\n return stream;\n}\n\nfunction parseStream(s) {\n const stream = {\n source: DEFAULT_SOURCE\n },\n source = [];\n let throttle = [0, 0],\n markname = 0,\n start = 0,\n n = s.length,\n i = 0,\n j,\n filter; // extract throttle from end\n\n if (s[n - 1] === RBRACE) {\n i = s.lastIndexOf(LBRACE);\n\n if (i >= 0) {\n try {\n throttle = parseThrottle(s.substring(i + 1, n - 1));\n } catch (e) {\n throw 'Invalid throttle specification: ' + s;\n }\n\n s = s.slice(0, i).trim();\n n = s.length;\n } else throw 'Unmatched right brace: ' + s;\n\n i = 0;\n }\n\n if (!n) throw s; // set name flag based on first char\n\n if (s[0] === NAME) markname = ++i; // extract first part of multi-part stream selector\n\n j = find(s, i, COLON);\n\n if (j < n) {\n source.push(s.substring(start, j).trim());\n start = i = ++j;\n } // extract remaining part of stream selector\n\n\n i = find(s, i, LBRACK);\n\n if (i === n) {\n source.push(s.substring(start, n).trim());\n } else {\n source.push(s.substring(start, i).trim());\n filter = [];\n start = ++i;\n if (start === n) throw 'Unmatched left bracket: ' + s;\n } // extract filters\n\n\n while (i < n) {\n i = find(s, i, RBRACK);\n if (i === n) throw 'Unmatched left bracket: ' + s;\n filter.push(s.substring(start, i).trim());\n if (i < n - 1 && s[++i] !== LBRACK) throw 'Expected left bracket: ' + s;\n start = ++i;\n } // marshall event stream specification\n\n\n if (!(n = source.length) || ILLEGAL.test(source[n - 1])) {\n throw 'Invalid event selector: ' + s;\n }\n\n if (n > 1) {\n stream.type = source[1];\n\n if (markname) {\n stream.markname = source[0].slice(1);\n } else if (isMarkType(source[0])) {\n stream.marktype = source[0];\n } else {\n stream.source = source[0];\n }\n } else {\n stream.type = source[0];\n }\n\n if (stream.type.slice(-1) === '!') {\n stream.consume = true;\n stream.type = stream.type.slice(0, -1);\n }\n\n if (filter != null) stream.filter = filter;\n if (throttle[0]) stream.throttle = throttle[0];\n if (throttle[1]) stream.debounce = throttle[1];\n return stream;\n}\n\nfunction parseThrottle(s) {\n const a = s.split(COMMA);\n if (!s.length || a.length > 2) throw s;\n return a.map(_ => {\n const x = +_;\n if (x !== x) throw s;\n return x;\n });\n}\n\nexport { eventSelector as selector };\n","import { array } from 'vega-util';\nimport { isConditionalDef, isConditionalSelection } from '../../../channeldef';\nimport { expression } from '../../predicate';\nimport { parseSelectionPredicate } from '../../selection/parse';\n/**\n * Return a mixin that includes a Vega production rule for a Vega-Lite conditional channel definition\n * or a simple mixin if channel def has no condition.\n */\nexport function wrapCondition(model, channelDef, vgChannel, refFn) {\n const condition = isConditionalDef(channelDef) && channelDef.condition;\n const valueRef = refFn(channelDef);\n if (condition) {\n const conditions = array(condition);\n const vgConditions = conditions.map(c => {\n const conditionValueRef = refFn(c);\n const test = isConditionalSelection(c)\n ? parseSelectionPredicate(model, c.selection) // FIXME: remove casting once TS is no longer dumb about it\n : expression(model, c.test); // FIXME: remove casting once TS is no longer dumb about it\n return Object.assign({ test }, conditionValueRef);\n });\n return {\n [vgChannel]: [...vgConditions, ...(valueRef !== undefined ? [valueRef] : [])]\n };\n }\n else {\n return valueRef !== undefined ? { [vgChannel]: valueRef } : {};\n }\n}\n//# sourceMappingURL=conditional.js.map","import { getFormatMixins, isFieldOrDatumDef, isValueDef } from '../../../channeldef';\nimport { signalOrValueRef } from '../../common';\nimport { formatSignalRef } from '../../format';\nimport { wrapCondition } from './conditional';\nexport function text(model, channel = 'text') {\n const channelDef = model.encoding[channel];\n return wrapCondition(model, channelDef, channel, cDef => textRef(cDef, model.config));\n}\nexport function textRef(channelDef, config, expr = 'datum') {\n // text\n if (channelDef) {\n if (isValueDef(channelDef)) {\n return signalOrValueRef(channelDef.value);\n }\n if (isFieldOrDatumDef(channelDef)) {\n const { format, formatType } = getFormatMixins(channelDef);\n return formatSignalRef({ fieldOrDatumDef: channelDef, format, formatType, expr, config });\n }\n }\n return undefined;\n}\n//# sourceMappingURL=text.js.map","import { array, isArray, isObject, isString } from 'vega-util';\nimport { isBinned } from '../../../bin';\nimport { getMainRangeChannel, isXorY } from '../../../channel';\nimport { defaultTitle, getFieldDef, getFormatMixins, hasConditionalFieldDef, isFieldDef, isTypedFieldDef, vgField } from '../../../channeldef';\nimport { forEach } from '../../../encoding';\nimport { entries } from '../../../util';\nimport { isSignalRef } from '../../../vega.schema';\nimport { getMarkPropOrConfig } from '../../common';\nimport { binFormatExpression, formatSignalRef } from '../../format';\nimport { wrapCondition } from './conditional';\nimport { textRef } from './text';\nexport function tooltip(model, opt = {}) {\n const { encoding, markDef, config, stack } = model;\n const channelDef = encoding.tooltip;\n if (isArray(channelDef)) {\n return { tooltip: tooltipRefForEncoding({ tooltip: channelDef }, stack, config, opt) };\n }\n else {\n const datum = opt.reactiveGeom ? 'datum.datum' : 'datum';\n return wrapCondition(model, channelDef, 'tooltip', cDef => {\n // use valueRef based on channelDef first\n const tooltipRefFromChannelDef = textRef(cDef, config, datum);\n if (tooltipRefFromChannelDef) {\n return tooltipRefFromChannelDef;\n }\n if (cDef === null) {\n // Allow using encoding.tooltip = null to disable tooltip\n return undefined;\n }\n let markTooltip = getMarkPropOrConfig('tooltip', markDef, config);\n if (markTooltip === true) {\n markTooltip = { content: 'encoding' };\n }\n if (isString(markTooltip)) {\n return { value: markTooltip };\n }\n else if (isObject(markTooltip)) {\n // `tooltip` is `{fields: 'encodings' | 'fields'}`\n if (isSignalRef(markTooltip)) {\n return markTooltip;\n }\n else if (markTooltip.content === 'encoding') {\n return tooltipRefForEncoding(encoding, stack, config, opt);\n }\n else {\n return { signal: datum };\n }\n }\n return undefined;\n });\n }\n}\nexport function tooltipData(encoding, stack, config, { reactiveGeom } = {}) {\n const toSkip = {};\n const expr = reactiveGeom ? 'datum.datum' : 'datum';\n const tuples = [];\n function add(fDef, channel) {\n const mainChannel = getMainRangeChannel(channel);\n const fieldDef = isTypedFieldDef(fDef)\n ? fDef\n : Object.assign(Object.assign({}, fDef), { type: encoding[mainChannel].type // for secondary field def, copy type from main channel\n });\n const title = fieldDef.title || defaultTitle(fieldDef, config);\n const key = array(title).join(', ');\n let value;\n if (isXorY(channel)) {\n const channel2 = channel === 'x' ? 'x2' : 'y2';\n const fieldDef2 = getFieldDef(encoding[channel2]);\n if (isBinned(fieldDef.bin) && fieldDef2) {\n const startField = vgField(fieldDef, { expr });\n const endField = vgField(fieldDef2, { expr });\n const { format, formatType } = getFormatMixins(fieldDef);\n value = binFormatExpression(startField, endField, format, formatType, config);\n toSkip[channel2] = true;\n }\n else if (stack && stack.fieldChannel === channel && stack.offset === 'normalize') {\n const { format, formatType } = getFormatMixins(fieldDef);\n value = formatSignalRef({ fieldOrDatumDef: fieldDef, format, formatType, expr, config, normalizeStack: true })\n .signal;\n }\n }\n value = value !== null && value !== void 0 ? value : textRef(fieldDef, config, expr).signal;\n tuples.push({ channel, key, value });\n }\n forEach(encoding, (channelDef, channel) => {\n if (isFieldDef(channelDef)) {\n add(channelDef, channel);\n }\n else if (hasConditionalFieldDef(channelDef)) {\n add(channelDef.condition, channel);\n }\n });\n const out = {};\n for (const { channel, key, value } of tuples) {\n if (!toSkip[channel] && !out[key]) {\n out[key] = value;\n }\n }\n return out;\n}\nexport function tooltipRefForEncoding(encoding, stack, config, { reactiveGeom } = {}) {\n const data = tooltipData(encoding, stack, config, { reactiveGeom });\n const keyValues = entries(data).map(([key, value]) => `\"${key}\": ${value}`);\n return keyValues.length > 0 ? { signal: `{${keyValues.join(', ')}}` } : undefined;\n}\n//# sourceMappingURL=tooltip.js.map","import { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { wrapCondition } from './conditional';\nimport * as ref from './valueref';\n/**\n * Return encode for non-positional channels with scales. (Text doesn't have scale.)\n */\nexport function nonPosition(channel, model, opt = {}) {\n const { markDef, encoding, config } = model;\n const { vgChannel } = opt;\n let { defaultRef, defaultValue } = opt;\n if (defaultRef === undefined) {\n // prettier-ignore\n defaultValue = defaultValue !== null && defaultValue !== void 0 ? defaultValue : getMarkPropOrConfig(channel, markDef, config, { vgChannel, ignoreVgConfig: true });\n if (defaultValue !== undefined) {\n defaultRef = signalOrValueRef(defaultValue);\n }\n }\n const channelDef = encoding[channel];\n return wrapCondition(model, channelDef, vgChannel !== null && vgChannel !== void 0 ? vgChannel : channel, cDef => {\n return ref.midPoint({\n channel,\n channelDef: cDef,\n markDef,\n config,\n scaleName: model.scaleName(channel),\n scale: model.getScaleComponent(channel),\n stack: null,\n defaultRef\n });\n });\n}\n//# sourceMappingURL=nonposition.js.map","import * as log from '../../../log';\nimport { contains } from '../../../util';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { nonPosition } from './nonposition';\nexport function color(model, opt = { filled: undefined }) {\n var _a, _b, _c, _d;\n const { markDef, encoding, config } = model;\n const { type: markType } = markDef;\n // Allow filled to be overridden (for trail's \"filled\")\n const filled = (_a = opt.filled) !== null && _a !== void 0 ? _a : getMarkPropOrConfig('filled', markDef, config);\n const transparentIfNeeded = contains(['bar', 'point', 'circle', 'square', 'geoshape'], markType)\n ? 'transparent'\n : undefined;\n const defaultFill = (_c = (_b = getMarkPropOrConfig(filled === true ? 'color' : undefined, markDef, config, { vgChannel: 'fill' })) !== null && _b !== void 0 ? _b : \n // need to add this manually as getMarkConfig normally drops config.mark[channel] if vgChannel is specified\n config.mark[filled === true && 'color']) !== null && _c !== void 0 ? _c : \n // If there is no fill, always fill symbols, bar, geoshape\n // with transparent fills https://github.com/vega/vega-lite/issues/1316\n transparentIfNeeded;\n const defaultStroke = (_d = getMarkPropOrConfig(filled === false ? 'color' : undefined, markDef, config, { vgChannel: 'stroke' })) !== null && _d !== void 0 ? _d : \n // need to add this manually as getMarkConfig normally drops config.mark[channel] if vgChannel is specified\n config.mark[filled === false && 'color'];\n const colorVgChannel = filled ? 'fill' : 'stroke';\n const fillStrokeMarkDefAndConfig = Object.assign(Object.assign({}, (defaultFill ? { fill: signalOrValueRef(defaultFill) } : {})), (defaultStroke ? { stroke: signalOrValueRef(defaultStroke) } : {}));\n if (markDef.color && (filled ? markDef.fill : markDef.stroke)) {\n log.warn(log.message.droppingColor('property', { fill: 'fill' in markDef, stroke: 'stroke' in markDef }));\n }\n return Object.assign(Object.assign(Object.assign(Object.assign({}, fillStrokeMarkDefAndConfig), nonPosition('color', model, {\n vgChannel: colorVgChannel,\n defaultValue: filled ? defaultFill : defaultStroke\n })), nonPosition('fill', model, {\n // if there is encoding.fill, include default fill just in case we have conditional-only fill encoding\n defaultValue: encoding.fill ? defaultFill : undefined\n })), nonPosition('stroke', model, {\n // if there is encoding.stroke, include default fill just in case we have conditional-only stroke encoding\n defaultValue: encoding.stroke ? defaultStroke : undefined\n }));\n}\n//# sourceMappingURL=color.js.map","import { getOffsetChannel } from '../../../channel';\nexport function getOffset(channel, markDef) {\n const offsetChannel = getOffsetChannel(channel);\n // TODO: in the future read from encoding channel too\n const markDefOffsetValue = markDef[offsetChannel];\n if (markDefOffsetValue) {\n return markDefOffsetValue;\n }\n return undefined;\n}\n//# sourceMappingURL=offset.js.map","import { getMainRangeChannel, getSecondaryRangeChannel, getSizeChannel, getVgPositionChannel, isXorY } from '../../../channel';\nimport { getBand, isFieldDef, isFieldOrDatumDef } from '../../../channeldef';\nimport { ScaleType } from '../../../scale';\nimport { contains } from '../../../util';\nimport { getMarkPropOrConfig } from '../../common';\nimport { getOffset } from './offset';\nimport * as ref from './valueref';\n/**\n * Return encode for point (non-band) position channels.\n */\nexport function pointPosition(channel, model, { defaultPos, vgChannel, isMidPoint }) {\n const { encoding, markDef, config, stack } = model;\n const channelDef = encoding[channel];\n const channel2Def = encoding[getSecondaryRangeChannel(channel)];\n const scaleName = model.scaleName(channel);\n const scale = model.getScaleComponent(channel);\n const offset = getOffset(channel, markDef);\n // Get default position or position from mark def\n const defaultRef = pointPositionDefaultRef({\n model,\n defaultPos,\n channel,\n scaleName,\n scale\n });\n const valueRef = !channelDef && isXorY(channel) && (encoding.latitude || encoding.longitude)\n ? // use geopoint output if there are lat/long and there is no point position overriding lat/long.\n { field: model.getName(channel) }\n : positionRef({\n channel,\n channelDef,\n channel2Def,\n markDef,\n config,\n isMidPoint,\n scaleName,\n scale,\n stack,\n offset,\n defaultRef\n });\n return valueRef ? { [vgChannel || channel]: valueRef } : undefined;\n}\n// TODO: we need to find a way to refactor these so that scaleName is a part of scale\n// but that's complicated. For now, this is a huge step moving forward.\n/**\n * @return Vega ValueRef for normal x- or y-position without projection\n */\nexport function positionRef(params) {\n const { channel, channelDef, isMidPoint, scaleName, stack, offset, markDef, config } = params;\n // This isn't a part of midPoint because we use midPoint for non-position too\n if (isFieldOrDatumDef(channelDef) && stack && channel === stack.fieldChannel) {\n if (isFieldDef(channelDef)) {\n const band = getBand({\n channel,\n fieldDef: channelDef,\n isMidPoint,\n markDef,\n stack,\n config\n });\n if (band !== undefined) {\n return ref.interpolatedSignalRef({\n scaleName,\n fieldOrDatumDef: channelDef,\n startSuffix: 'start',\n band,\n offset\n });\n }\n }\n // x or y use stack_end so that stacked line's point mark use stack_end too.\n return ref.valueRefForFieldOrDatumDef(channelDef, scaleName, { suffix: 'end' }, { offset });\n }\n return ref.midPointRefWithPositionInvalidTest(params);\n}\nexport function pointPositionDefaultRef({ model, defaultPos, channel, scaleName, scale }) {\n const { markDef, config } = model;\n return () => {\n const mainChannel = getMainRangeChannel(channel);\n const vgChannel = getVgPositionChannel(channel);\n const definedValueOrConfig = getMarkPropOrConfig(channel, markDef, config, { vgChannel });\n if (definedValueOrConfig !== undefined) {\n return ref.widthHeightValueOrSignalRef(channel, definedValueOrConfig);\n }\n switch (defaultPos) {\n case 'zeroOrMin':\n case 'zeroOrMax':\n if (scaleName) {\n const scaleType = scale.get('type');\n if (contains([ScaleType.LOG, ScaleType.TIME, ScaleType.UTC], scaleType)) {\n // Log scales cannot have zero.\n // Zero in time scale is arbitrary, and does not affect ratio.\n // (Time is an interval level of measurement, not ratio).\n // See https://en.wikipedia.org/wiki/Level_of_measurement for more info.\n }\n else {\n if (scale.domainDefinitelyIncludesZero()) {\n return {\n scale: scaleName,\n value: 0\n };\n }\n }\n }\n if (defaultPos === 'zeroOrMin') {\n return mainChannel === 'y' ? { field: { group: 'height' } } : { value: 0 };\n }\n else {\n // zeroOrMax\n switch (mainChannel) {\n case 'radius':\n // max of radius is min(width, height) / 2\n return {\n signal: `min(${model.width.signal},${model.height.signal})/2`\n };\n case 'theta':\n return { signal: '2*PI' };\n case 'x':\n return { field: { group: 'width' } };\n case 'y':\n return { value: 0 };\n }\n }\n break;\n case 'mid': {\n const sizeRef = model[getSizeChannel(channel)];\n return Object.assign(Object.assign({}, sizeRef), { mult: 0.5 });\n }\n }\n // defaultPos === null\n return undefined;\n };\n}\n//# sourceMappingURL=position-point.js.map","import { getVgPositionChannel } from '../../../channel';\nimport * as log from '../../../log';\nimport { isSignalRef } from '../../../vega.schema';\nimport { getMarkPropOrConfig } from '../../common';\nconst ALIGNED_X_CHANNEL = {\n left: 'x',\n center: 'xc',\n right: 'x2'\n};\nconst BASELINED_Y_CHANNEL = {\n top: 'y',\n middle: 'yc',\n bottom: 'y2'\n};\nexport function vgAlignedPositionChannel(channel, markDef, config, defaultAlign = 'middle') {\n if (channel === 'radius' || channel === 'theta') {\n return getVgPositionChannel(channel);\n }\n const alignChannel = channel === 'x' ? 'align' : 'baseline';\n const align = getMarkPropOrConfig(alignChannel, markDef, config);\n let alignExcludingSignal;\n if (isSignalRef(align)) {\n log.warn(log.message.rangeMarkAlignmentCannotBeExpression(alignChannel));\n alignExcludingSignal = undefined;\n }\n else {\n alignExcludingSignal = align;\n }\n if (channel === 'x') {\n return ALIGNED_X_CHANNEL[alignExcludingSignal || (defaultAlign === 'top' ? 'left' : 'center')];\n }\n else {\n return BASELINED_Y_CHANNEL[alignExcludingSignal || defaultAlign];\n }\n}\n//# sourceMappingURL=position-align.js.map","import { getMainRangeChannel, getSecondaryRangeChannel, getSizeChannel, getVgPositionChannel } from '../../../channel';\nimport { isFieldOrDatumDef } from '../../../channeldef';\nimport { getMarkStyleConfig } from '../../common';\nimport { getOffset } from './offset';\nimport { vgAlignedPositionChannel } from './position-align';\nimport { pointPosition, pointPositionDefaultRef } from './position-point';\nimport * as ref from './valueref';\n/**\n * Utility for area/rule position, which can be either point or range. (One of the axes should be point and the other should be range.)\n */\nexport function pointOrRangePosition(channel, model, { defaultPos, defaultPos2, range }) {\n if (range) {\n return rangePosition(channel, model, { defaultPos, defaultPos2 });\n }\n return pointPosition(channel, model, { defaultPos });\n}\nexport function rangePosition(channel, model, { defaultPos, defaultPos2 }) {\n const { markDef, config } = model;\n const channel2 = getSecondaryRangeChannel(channel);\n const sizeChannel = getSizeChannel(channel);\n const pos2Mixins = pointPosition2OrSize(model, defaultPos2, channel2);\n const vgChannel = pos2Mixins[sizeChannel]\n ? // If there is width/height, we need to position the marks based on the alignment.\n vgAlignedPositionChannel(channel, markDef, config)\n : // Otherwise, make sure to apply to the right Vg Channel (for arc mark)\n getVgPositionChannel(channel);\n return Object.assign(Object.assign({}, pointPosition(channel, model, { defaultPos, vgChannel })), pos2Mixins);\n}\n/**\n * Return encode for x2, y2.\n * If channel is not specified, return one channel based on orientation.\n */\nfunction pointPosition2OrSize(model, defaultPos, channel) {\n const { encoding, mark, markDef, stack, config } = model;\n const baseChannel = getMainRangeChannel(channel);\n const sizeChannel = getSizeChannel(channel);\n const vgChannel = getVgPositionChannel(channel);\n const channelDef = encoding[baseChannel];\n const scaleName = model.scaleName(baseChannel);\n const scale = model.getScaleComponent(baseChannel);\n const offset = channel in encoding || channel in markDef\n ? getOffset(channel, model.markDef)\n : getOffset(baseChannel, model.markDef);\n if (!channelDef && (channel === 'x2' || channel === 'y2') && (encoding.latitude || encoding.longitude)) {\n // use geopoint output if there are lat2/long2 and there is no point position2 overriding lat2/long2.\n return { [vgChannel]: { field: model.getName(channel) } };\n }\n const valueRef = position2Ref({\n channel,\n channelDef,\n channel2Def: encoding[channel],\n markDef,\n config,\n scaleName,\n scale,\n stack,\n offset,\n defaultRef: undefined\n });\n if (valueRef !== undefined) {\n return { [vgChannel]: valueRef };\n }\n // TODO: check width/height encoding here once we add them\n // no x2/y2 encoding, then try to read x2/y2 or width/height based on precedence:\n // markDef > config.style > mark-specific config (config[mark]) > general mark config (config.mark)\n return (position2orSize(channel, markDef) ||\n position2orSize(channel, {\n [channel]: getMarkStyleConfig(channel, markDef, config.style),\n [sizeChannel]: getMarkStyleConfig(sizeChannel, markDef, config.style)\n }) ||\n position2orSize(channel, config[mark]) ||\n position2orSize(channel, config.mark) || {\n [vgChannel]: pointPositionDefaultRef({\n model,\n defaultPos,\n channel,\n scaleName,\n scale\n })()\n });\n}\nexport function position2Ref({ channel, channelDef, channel2Def, markDef, config, scaleName, scale, stack, offset, defaultRef }) {\n if (isFieldOrDatumDef(channelDef) &&\n stack &&\n // If fieldChannel is X and channel is X2 (or Y and Y2)\n channel.charAt(0) === stack.fieldChannel.charAt(0)) {\n return ref.valueRefForFieldOrDatumDef(channelDef, scaleName, { suffix: 'start' }, { offset });\n }\n return ref.midPointRefWithPositionInvalidTest({\n channel,\n channelDef: channel2Def,\n scaleName,\n scale,\n stack,\n markDef,\n config,\n offset,\n defaultRef\n });\n}\nfunction position2orSize(channel, markDef) {\n const sizeChannel = getSizeChannel(channel);\n const vgChannel = getVgPositionChannel(channel);\n if (markDef[vgChannel] !== undefined) {\n return { [vgChannel]: ref.widthHeightValueOrSignalRef(channel, markDef[vgChannel]) };\n }\n else if (markDef[channel] !== undefined) {\n return { [vgChannel]: ref.widthHeightValueOrSignalRef(channel, markDef[channel]) };\n }\n else if (markDef[sizeChannel]) {\n return { [sizeChannel]: ref.widthHeightValueOrSignalRef(channel, markDef[sizeChannel]) };\n }\n return undefined;\n}\n//# sourceMappingURL=position-range.js.map","import { isArray, isNumber } from 'vega-util';\nimport { isBinned, isBinning, isBinParams } from '../../../bin';\nimport { getSecondaryRangeChannel, getSizeChannel, getVgPositionChannel, isPolarPositionChannel, isXorY } from '../../../channel';\nimport { getBand, isFieldDef, isFieldOrDatumDef, vgField } from '../../../channeldef';\nimport { DEFAULT_STEP, getViewConfigDiscreteStep } from '../../../config';\nimport * as log from '../../../log';\nimport { hasDiscreteDomain, ScaleType } from '../../../scale';\nimport { getFirstDefined } from '../../../util';\nimport { isSignalRef, isVgRangeStep } from '../../../vega.schema';\nimport { getMarkPropOrConfig, signalOrStringValue } from '../../common';\nimport { nonPosition } from './nonposition';\nimport { getOffset } from './offset';\nimport { vgAlignedPositionChannel } from './position-align';\nimport { pointPositionDefaultRef } from './position-point';\nimport { rangePosition } from './position-range';\nimport * as ref from './valueref';\nexport function rectPosition(model, channel, mark) {\n var _a, _b, _c, _d;\n const { config, encoding, markDef, stack } = model;\n const channel2 = getSecondaryRangeChannel(channel);\n const sizeChannel = getSizeChannel(channel);\n const channelDef = encoding[channel];\n const channelDef2 = encoding[channel2];\n const scale = model.getScaleComponent(channel);\n const scaleType = scale ? scale.get('type') : undefined;\n const scaleName = model.scaleName(channel);\n const orient = markDef.orient;\n const hasSizeDef = (_b = (_a = encoding[sizeChannel]) !== null && _a !== void 0 ? _a : encoding.size) !== null && _b !== void 0 ? _b : getMarkPropOrConfig('size', markDef, config, { vgChannel: sizeChannel });\n const isBarBand = mark === 'bar' && (channel === 'x' ? orient === 'vertical' : orient === 'horizontal');\n // x, x2, and width -- we must specify two of these in all conditions\n if (isFieldDef(channelDef) &&\n (isBinning(channelDef.bin) || isBinned(channelDef.bin) || (channelDef.timeUnit && !channelDef2)) &&\n !hasSizeDef &&\n !hasDiscreteDomain(scaleType)) {\n const band = getBand({ channel, fieldDef: channelDef, stack, markDef, config });\n const axis = (_c = model.component.axes[channel]) === null || _c === void 0 ? void 0 : _c[0];\n const axisTranslate = (_d = axis === null || axis === void 0 ? void 0 : axis.get('translate')) !== null && _d !== void 0 ? _d : 0.5; // vega default is 0.5\n return rectBinPosition({\n fieldDef: channelDef,\n fieldDef2: channelDef2,\n channel,\n markDef,\n scaleName,\n band,\n axisTranslate,\n spacing: isXorY(channel) ? getMarkPropOrConfig('binSpacing', markDef, config) : undefined,\n reverse: scale.get('reverse'),\n config\n });\n }\n else if (((isFieldOrDatumDef(channelDef) && hasDiscreteDomain(scaleType)) || isBarBand) && !channelDef2) {\n return positionAndSize(mark, channelDef, channel, model);\n }\n else {\n return rangePosition(channel, model, { defaultPos: 'zeroOrMax', defaultPos2: 'zeroOrMin' });\n }\n}\nfunction defaultSizeRef(mark, sizeChannel, scaleName, scale, config, band) {\n if (scale) {\n const scaleType = scale.get('type');\n if (scaleType === 'point' || scaleType === 'band') {\n if (config[mark].discreteBandSize !== undefined) {\n return { value: config[mark].discreteBandSize };\n }\n if (scaleType === ScaleType.POINT) {\n const scaleRange = scale.get('range');\n if (isVgRangeStep(scaleRange) && isNumber(scaleRange.step)) {\n return { value: scaleRange.step - 2 };\n }\n return { value: DEFAULT_STEP - 2 };\n }\n else {\n // BAND\n return { scale: scaleName, band };\n }\n }\n else {\n // continuous scale\n return { value: config[mark].continuousBandSize };\n }\n }\n // No Scale\n const step = getViewConfigDiscreteStep(config.view, sizeChannel);\n const value = getFirstDefined(\n // No scale is like discrete bar (with one item)\n config[mark].discreteBandSize, step - 2);\n return value !== undefined ? { value } : undefined;\n}\n/**\n * Output position encoding and its size encoding for continuous, point, and band scales.\n */\nfunction positionAndSize(mark, fieldDef, channel, model) {\n var _a;\n const { markDef, encoding, config, stack } = model;\n const orient = markDef.orient;\n const scaleName = model.scaleName(channel);\n const scale = model.getScaleComponent(channel);\n const vgSizeChannel = getSizeChannel(channel);\n const channel2 = getSecondaryRangeChannel(channel);\n // use \"size\" channel for bars, if there is orient and the channel matches the right orientation\n const useVlSizeChannel = (orient === 'horizontal' && channel === 'y') || (orient === 'vertical' && channel === 'x');\n const sizeFromMarkOrConfig = getMarkPropOrConfig(useVlSizeChannel ? 'size' : vgSizeChannel, markDef, config, {\n vgChannel: vgSizeChannel\n });\n // Use size encoding / mark property / config if it exists\n let sizeMixins;\n if (encoding.size || sizeFromMarkOrConfig !== undefined) {\n if (useVlSizeChannel) {\n sizeMixins = nonPosition('size', model, { vgChannel: vgSizeChannel, defaultValue: sizeFromMarkOrConfig });\n }\n else {\n log.warn(log.message.cannotApplySizeToNonOrientedMark(markDef.type));\n }\n }\n // Otherwise, apply default value\n const band = (_a = (isFieldOrDatumDef(fieldDef) ? getBand({ channel, fieldDef, markDef, stack, config }) : undefined)) !== null && _a !== void 0 ? _a : 1;\n sizeMixins = sizeMixins || { [vgSizeChannel]: defaultSizeRef(mark, vgSizeChannel, scaleName, scale, config, band) };\n /*\n Band scales with size value and all point scales, use xc/yc + band=0.5\n \n Otherwise (band scales that has size based on a band ref), use x/y with position band = (1 - size_band) / 2.\n In this case, size_band is the band specified in the x/y-encoding.\n By default band is 1, so `(1 - band) / 2` = 0.\n If band is 0.6, the the x/y position in such case should be `(1 - band) / 2` = 0.2\n */\n const center = (scale === null || scale === void 0 ? void 0 : scale.get('type')) !== 'band' || !('band' in sizeMixins[vgSizeChannel]);\n const vgChannel = vgAlignedPositionChannel(channel, markDef, config, center ? 'middle' : 'top');\n const offset = getOffset(channel, markDef);\n const posRef = ref.midPointRefWithPositionInvalidTest({\n channel,\n channelDef: fieldDef,\n markDef,\n config,\n scaleName,\n scale,\n stack,\n offset,\n defaultRef: pointPositionDefaultRef({ model, defaultPos: 'mid', channel, scaleName, scale }),\n band: center ? 0.5 : (1 - band) / 2\n });\n if (vgSizeChannel) {\n return Object.assign({ [vgChannel]: posRef }, sizeMixins);\n }\n else {\n // otherwise, we must simulate size by setting position2 = position + size\n // (for theta/radius since Vega doesn't have thetaWidth/radiusWidth)\n const vgChannel2 = getVgPositionChannel(channel2);\n const sizeRef = sizeMixins[vgSizeChannel];\n const sizeOffset = offset ? Object.assign(Object.assign({}, sizeRef), { offset }) : sizeRef;\n return {\n [vgChannel]: posRef,\n // posRef might be an array that wraps position invalid test\n [vgChannel2]: isArray(posRef)\n ? [posRef[0], Object.assign(Object.assign({}, posRef[1]), { offset: sizeOffset })]\n : Object.assign(Object.assign({}, posRef), { offset: sizeOffset })\n };\n }\n}\nfunction getBinSpacing(channel, spacing, reverse, translate, offset) {\n if (isPolarPositionChannel(channel)) {\n return 0;\n }\n const spacingOffset = channel === 'x' || channel === 'y2' ? -spacing / 2 : spacing / 2;\n if (isSignalRef(reverse) || isSignalRef(offset) || isSignalRef(translate)) {\n const reverseExpr = signalOrStringValue(reverse);\n const offsetExpr = signalOrStringValue(offset);\n const translateExpr = signalOrStringValue(translate);\n const t = translateExpr ? `${translateExpr} + ` : '';\n const r = reverseExpr ? `(${reverseExpr} ? -1 : 1) * ` : '';\n const o = offsetExpr ? `(${offsetExpr} + ${spacingOffset})` : spacingOffset;\n return {\n signal: t + r + o\n };\n }\n else {\n offset = offset || 0;\n return translate + (reverse ? -offset - spacingOffset : +offset + spacingOffset);\n }\n}\nexport function rectBinPosition({ fieldDef, fieldDef2, channel, band, scaleName, markDef, spacing = 0, axisTranslate, reverse, config }) {\n const channel2 = getSecondaryRangeChannel(channel);\n const vgChannel = getVgPositionChannel(channel);\n const vgChannel2 = getVgPositionChannel(channel2);\n const offset = getOffset(channel, markDef);\n if (isBinning(fieldDef.bin) || fieldDef.timeUnit) {\n return {\n [vgChannel2]: rectBinRef({\n channel,\n fieldDef,\n scaleName,\n markDef,\n band: (1 - band) / 2,\n offset: getBinSpacing(channel2, spacing, reverse, axisTranslate, offset),\n config\n }),\n [vgChannel]: rectBinRef({\n channel,\n fieldDef,\n scaleName,\n markDef,\n band: 1 - (1 - band) / 2,\n offset: getBinSpacing(channel, spacing, reverse, axisTranslate, offset),\n config\n })\n };\n }\n else if (isBinned(fieldDef.bin)) {\n const startRef = ref.valueRefForFieldOrDatumDef(fieldDef, scaleName, {}, { offset: getBinSpacing(channel2, spacing, reverse, axisTranslate, offset) });\n if (isFieldDef(fieldDef2)) {\n return {\n [vgChannel2]: startRef,\n [vgChannel]: ref.valueRefForFieldOrDatumDef(fieldDef2, scaleName, {}, { offset: getBinSpacing(channel, spacing, reverse, axisTranslate, offset) })\n };\n }\n else if (isBinParams(fieldDef.bin) && fieldDef.bin.step) {\n return {\n [vgChannel2]: startRef,\n [vgChannel]: {\n signal: `scale(\"${scaleName}\", ${vgField(fieldDef, { expr: 'datum' })} + ${fieldDef.bin.step})`,\n offset: getBinSpacing(channel, spacing, reverse, axisTranslate, offset)\n }\n };\n }\n }\n log.warn(log.message.channelRequiredForBinned(channel2));\n return undefined;\n}\n/**\n * Value Ref for binned fields\n */\nexport function rectBinRef({ channel, fieldDef, scaleName, markDef, band, offset, config }) {\n const r = ref.interpolatedSignalRef({\n scaleName,\n fieldOrDatumDef: fieldDef,\n band,\n offset\n });\n return ref.wrapPositionInvalidTest({\n fieldDef,\n channel,\n markDef,\n ref: r,\n config\n });\n}\n//# sourceMappingURL=position-rect.js.map","import { array } from 'vega-util';\nimport { SCALE_CHANNELS } from '../../../channel';\nimport { isPathMark } from '../../../mark';\nimport { hasContinuousDomain } from '../../../scale';\nimport { keys } from '../../../util';\nimport { VG_MARK_CONFIGS } from '../../../vega.schema';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { aria } from './aria';\nimport { color } from './color';\nimport { nonPosition } from './nonposition';\nimport { text } from './text';\nimport { tooltip } from './tooltip';\nimport { fieldInvalidPredicate } from './valueref';\nimport { zindex } from './zindex';\nexport { color } from './color';\nexport { wrapCondition } from './conditional';\nexport { nonPosition } from './nonposition';\nexport { pointPosition } from './position-point';\nexport { pointOrRangePosition, rangePosition } from './position-range';\nexport { rectPosition } from './position-rect';\nexport { text } from './text';\nexport { tooltip } from './tooltip';\nconst ALWAYS_IGNORE = new Set(['aria']);\nexport function baseEncodeEntry(model, ignore) {\n const { fill = undefined, stroke = undefined } = ignore.color === 'include' ? color(model) : {};\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, markDefProperties(model.markDef, ignore)), wrapAllFieldsInvalid(model, 'fill', fill)), wrapAllFieldsInvalid(model, 'stroke', stroke)), nonPosition('opacity', model)), nonPosition('fillOpacity', model)), nonPosition('strokeOpacity', model)), nonPosition('strokeWidth', model)), nonPosition('strokeDash', model)), zindex(model)), tooltip(model)), text(model, 'href')), aria(model));\n}\n// TODO: mark VgValueRef[] as readonly after https://github.com/vega/vega/pull/1987\nfunction wrapAllFieldsInvalid(model, channel, valueRef) {\n const { config, mark, markDef } = model;\n const invalid = getMarkPropOrConfig('invalid', markDef, config);\n if (invalid === 'hide' && valueRef && !isPathMark(mark)) {\n // For non-path marks, we have to exclude invalid values (null and NaN) for scales with continuous domains.\n // For path marks, we will use \"defined\" property and skip these values instead.\n const test = allFieldsInvalidPredicate(model, { invalid: true, channels: SCALE_CHANNELS });\n if (test) {\n return {\n [channel]: [\n // prepend the invalid case\n // TODO: support custom value\n { test, value: null },\n ...array(valueRef)\n ]\n };\n }\n }\n return valueRef ? { [channel]: valueRef } : {};\n}\nfunction markDefProperties(mark, ignore) {\n return VG_MARK_CONFIGS.reduce((m, prop) => {\n if (!ALWAYS_IGNORE.has(prop) && mark[prop] !== undefined && ignore[prop] !== 'ignore') {\n m[prop] = signalOrValueRef(mark[prop]);\n }\n return m;\n }, {});\n}\nfunction allFieldsInvalidPredicate(model, { invalid = false, channels }) {\n const filterIndex = channels.reduce((aggregator, channel) => {\n const scaleComponent = model.getScaleComponent(channel);\n if (scaleComponent) {\n const scaleType = scaleComponent.get('type');\n const field = model.vgField(channel, { expr: 'datum' });\n // While discrete domain scales can handle invalid values, continuous scales can't.\n if (field && hasContinuousDomain(scaleType)) {\n aggregator[field] = true;\n }\n }\n return aggregator;\n }, {});\n const fields = keys(filterIndex);\n if (fields.length > 0) {\n const op = invalid ? '||' : '&&';\n return fields.map(field => fieldInvalidPredicate(field, invalid)).join(` ${op} `);\n }\n return undefined;\n}\n//# sourceMappingURL=base.js.map","import { isValueDef } from '../../../channeldef';\nimport { isPathMark } from '../../../mark';\nimport { signalOrValueRef } from '../../common';\nimport { wrapCondition } from './conditional';\nexport function zindex(model) {\n const { encoding, mark } = model;\n const order = encoding.order;\n if (!isPathMark(mark) && isValueDef(order)) {\n return wrapCondition(model, order, 'zindex', cd => signalOrValueRef(cd.value));\n }\n return {};\n}\n//# sourceMappingURL=zindex.js.map","import { entries, isEmpty } from '../../../util';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { VG_MARK_INDEX } from './../../../vega.schema';\nimport { wrapCondition } from './conditional';\nimport { textRef } from './text';\nimport { tooltipData } from './tooltip';\nexport function aria(model) {\n const { markDef, config } = model;\n const enableAria = getMarkPropOrConfig('aria', markDef, config);\n // We can ignore other aria properties if ariaHidden is true.\n if (enableAria === false) {\n // getMarkGroups sets aria to false already so we don't have to set it in the encode block\n return {};\n }\n return Object.assign(Object.assign(Object.assign({}, (enableAria ? { aria: enableAria } : {})), ariaRoleDescription(model)), description(model));\n}\nfunction ariaRoleDescription(model) {\n const { mark, markDef, config } = model;\n if (config.aria === false) {\n return {};\n }\n const ariaRoleDesc = getMarkPropOrConfig('ariaRoleDescription', markDef, config);\n if (ariaRoleDesc != null) {\n return { ariaRoleDescription: { value: ariaRoleDesc } };\n }\n return mark in VG_MARK_INDEX ? {} : { ariaRoleDescription: { value: mark } };\n}\nexport function description(model) {\n const { encoding, markDef, config, stack } = model;\n const channelDef = encoding.description;\n if (channelDef) {\n return wrapCondition(model, channelDef, 'description', cDef => textRef(cDef, model.config));\n }\n // Use default from mark def or config if defined.\n // Functions in encode usually just return undefined but since we are defining a default below, we need to check the default here.\n const descriptionValue = getMarkPropOrConfig('description', markDef, config);\n if (descriptionValue != null) {\n return {\n description: signalOrValueRef(descriptionValue)\n };\n }\n if (config.aria === false) {\n return {};\n }\n const data = tooltipData(encoding, stack, config);\n if (isEmpty(data)) {\n return undefined;\n }\n return {\n description: {\n signal: entries(data)\n .map(([key, value], index) => `\"${index > 0 ? '; ' : ''}${key}: \" + (${value})`)\n .join(' + ')\n }\n };\n}\n//# sourceMappingURL=aria.js.map","import { POSITION_SCALE_CHANNELS } from '../../../channel';\nimport { hasContinuousDomain } from '../../../scale';\nimport { keys } from '../../../util';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { fieldInvalidPredicate } from './valueref';\nexport function defined(model) {\n const { config, markDef } = model;\n const invalid = getMarkPropOrConfig('invalid', markDef, config);\n if (invalid) {\n const signal = allFieldsInvalidPredicate(model, { channels: POSITION_SCALE_CHANNELS });\n if (signal) {\n return { defined: { signal } };\n }\n }\n return {};\n}\nfunction allFieldsInvalidPredicate(model, { invalid = false, channels }) {\n const filterIndex = channels.reduce((aggregator, channel) => {\n const scaleComponent = model.getScaleComponent(channel);\n if (scaleComponent) {\n const scaleType = scaleComponent.get('type');\n const field = model.vgField(channel, { expr: 'datum' });\n // While discrete domain scales can handle invalid values, continuous scales can't.\n if (field && hasContinuousDomain(scaleType)) {\n aggregator[field] = true;\n }\n }\n return aggregator;\n }, {});\n const fields = keys(filterIndex);\n if (fields.length > 0) {\n const op = invalid ? '||' : '&&';\n return fields.map(field => fieldInvalidPredicate(field, invalid)).join(` ${op} `);\n }\n return undefined;\n}\nexport function valueIfDefined(prop, value) {\n if (value !== undefined) {\n return { [prop]: signalOrValueRef(value) };\n }\n return undefined;\n}\n//# sourceMappingURL=defined.js.map","import * as log from '../../../log';\nimport { isPathMark } from '../../../mark';\nimport { tooltip } from '../../mark/encode';\nconst VORONOI = 'voronoi';\nconst nearest = {\n has: selCmpt => {\n return selCmpt.type !== 'interval' && selCmpt.nearest;\n },\n parse: (model, selCmpt) => {\n // Scope selection events to the voronoi mark to prevent capturing\n // events that occur on the group mark (https://github.com/vega/vega/issues/2112).\n if (selCmpt.events) {\n for (const s of selCmpt.events) {\n s.markname = model.getName(VORONOI);\n }\n }\n },\n marks: (model, selCmpt, marks) => {\n const { x, y } = selCmpt.project.hasChannel;\n const markType = model.mark;\n if (isPathMark(markType)) {\n log.warn(log.message.nearestNotSupportForContinuous(markType));\n return marks;\n }\n const cellDef = {\n name: model.getName(VORONOI),\n type: 'path',\n interactive: true,\n from: { data: model.getName('marks') },\n encode: {\n update: Object.assign({ fill: { value: 'transparent' }, strokeWidth: { value: 0.35 }, stroke: { value: 'transparent' }, isVoronoi: { value: true } }, tooltip(model, { reactiveGeom: true }))\n },\n transform: [\n {\n type: 'voronoi',\n x: { expr: x || !y ? 'datum.datum.x || 0' : '0' },\n y: { expr: y || !x ? 'datum.datum.y || 0' : '0' },\n size: [model.getSizeSignalRef('width'), model.getSizeSignalRef('height')]\n }\n ]\n };\n let index = 0;\n let exists = false;\n marks.forEach((mark, i) => {\n var _a;\n const name = (_a = mark.name) !== null && _a !== void 0 ? _a : '';\n if (name === model.component.mark[0].name) {\n index = i;\n }\n else if (name.indexOf(VORONOI) >= 0) {\n exists = true;\n }\n });\n if (!exists) {\n marks.splice(index + 1, 0, cellDef);\n }\n return marks;\n }\n};\nexport default nearest;\n//# sourceMappingURL=nearest.js.map","import * as log from '../../log';\nimport { uniqueId } from '../../util';\n/**\n * A node in the dataflow tree.\n */\nexport class DataFlowNode {\n constructor(parent, debugName) {\n this.debugName = debugName;\n this._children = [];\n this._parent = null;\n if (parent) {\n this.parent = parent;\n }\n }\n /**\n * Clone this node with a deep copy but don't clone links to children or parents.\n */\n clone() {\n throw new Error('Cannot clone node');\n }\n get parent() {\n return this._parent;\n }\n /**\n * Set the parent of the node and also add this node to the parent's children.\n */\n set parent(parent) {\n this._parent = parent;\n if (parent) {\n parent.addChild(this);\n }\n }\n get children() {\n return this._children;\n }\n numChildren() {\n return this._children.length;\n }\n addChild(child, loc) {\n // do not add the same child twice\n if (this._children.indexOf(child) > -1) {\n log.warn(log.message.ADD_SAME_CHILD_TWICE);\n return;\n }\n if (loc !== undefined) {\n this._children.splice(loc, 0, child);\n }\n else {\n this._children.push(child);\n }\n }\n removeChild(oldChild) {\n const loc = this._children.indexOf(oldChild);\n this._children.splice(loc, 1);\n return loc;\n }\n /**\n * Remove node from the dataflow.\n */\n remove() {\n let loc = this._parent.removeChild(this);\n for (const child of this._children) {\n // do not use the set method because we want to insert at a particular location\n child._parent = this._parent;\n this._parent.addChild(child, loc++);\n }\n }\n /**\n * Insert another node as a parent of this node.\n */\n insertAsParentOf(other) {\n const parent = other.parent;\n parent.removeChild(this);\n this.parent = parent;\n other.parent = this;\n }\n swapWithParent() {\n const parent = this._parent;\n const newParent = parent.parent;\n // reconnect the children\n for (const child of this._children) {\n child.parent = parent;\n }\n // remove old links\n this._children = []; // equivalent to removing every child link one by one\n parent.removeChild(this);\n parent.parent.removeChild(parent);\n // swap two nodes\n this.parent = newParent;\n parent.parent = this;\n }\n}\nexport class OutputNode extends DataFlowNode {\n /**\n * @param source The name of the source. Will change in assemble.\n * @param type The type of the output node.\n * @param refCounts A global ref counter map.\n */\n constructor(parent, source, type, refCounts) {\n super(parent, source);\n this.type = type;\n this.refCounts = refCounts;\n this._source = this._name = source;\n if (this.refCounts && !(this._name in this.refCounts)) {\n this.refCounts[this._name] = 0;\n }\n }\n clone() {\n const cloneObj = new this.constructor();\n cloneObj.debugName = 'clone_' + this.debugName;\n cloneObj._source = this._source;\n cloneObj._name = 'clone_' + this._name;\n cloneObj.type = this.type;\n cloneObj.refCounts = this.refCounts;\n cloneObj.refCounts[cloneObj._name] = 0;\n return cloneObj;\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return new Set();\n }\n hash() {\n if (this._hash === undefined) {\n this._hash = `Output ${uniqueId()}`;\n }\n return this._hash;\n }\n /**\n * Request the datasource name and increase the ref counter.\n *\n * During the parsing phase, this will return the simple name such as 'main' or 'raw'.\n * It is crucial to request the name from an output node to mark it as a required node.\n * If nobody ever requests the name, this datasource will not be instantiated in the assemble phase.\n *\n * In the assemble phase, this will return the correct name.\n */\n getSource() {\n this.refCounts[this._name]++;\n return this._source;\n }\n isRequired() {\n return !!this.refCounts[this._name];\n }\n setSource(source) {\n this._source = source;\n }\n}\n//# sourceMappingURL=dataflow.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { getSecondaryRangeChannel } from '../../channel';\nimport { hasBand, vgField } from '../../channeldef';\nimport { getTimeUnitParts, normalizeTimeUnit } from '../../timeunit';\nimport { duplicate, hash, isEmpty, replacePathInField, vals, entries } from '../../util';\nimport { isUnitModel } from '../model';\nimport { DataFlowNode } from './dataflow';\nexport class TimeUnitNode extends DataFlowNode {\n constructor(parent, formula) {\n super(parent);\n this.formula = formula;\n }\n clone() {\n return new TimeUnitNode(null, duplicate(this.formula));\n }\n static makeFromEncoding(parent, model) {\n const formula = model.reduceFieldDef((timeUnitComponent, fieldDef, channel) => {\n const { field, timeUnit } = fieldDef;\n const channelDef2 = isUnitModel(model) ? model.encoding[getSecondaryRangeChannel(channel)] : undefined;\n const band = isUnitModel(model) && hasBand(channel, fieldDef, channelDef2, model.stack, model.markDef, model.config);\n if (timeUnit) {\n const as = vgField(fieldDef, { forAs: true });\n timeUnitComponent[hash({\n as,\n field,\n timeUnit\n })] = Object.assign({ as,\n field,\n timeUnit }, (band ? { band: true } : {}));\n }\n return timeUnitComponent;\n }, {});\n if (isEmpty(formula)) {\n return null;\n }\n return new TimeUnitNode(parent, formula);\n }\n static makeFromTransform(parent, t) {\n const _a = Object.assign({}, t), { timeUnit } = _a, other = __rest(_a, [\"timeUnit\"]);\n const normalizedTimeUnit = normalizeTimeUnit(timeUnit);\n const component = Object.assign(Object.assign({}, other), { timeUnit: normalizedTimeUnit });\n return new TimeUnitNode(parent, {\n [hash(component)]: component\n });\n }\n /**\n * Merge together TimeUnitNodes assigning the children of `other` to `this`\n * and removing `other`.\n */\n merge(other) {\n this.formula = Object.assign({}, this.formula);\n // if the same hash happen twice, merge \"band\"\n for (const key in other.formula) {\n if (!this.formula[key] || other.formula[key].band) {\n // copy if it's not a duplicate or if we need to copy band over\n this.formula[key] = other.formula[key];\n }\n }\n for (const child of other.children) {\n other.removeChild(child);\n child.parent = this;\n }\n other.remove();\n }\n /**\n * Remove time units coming from the other node.\n */\n removeFormulas(fields) {\n const newFormula = {};\n for (const [key, timeUnit] of entries(this.formula)) {\n if (!fields.has(timeUnit.as)) {\n newFormula[key] = timeUnit;\n }\n }\n this.formula = newFormula;\n }\n producedFields() {\n return new Set(vals(this.formula).map(f => f.as));\n }\n dependentFields() {\n return new Set(vals(this.formula).map(f => f.field));\n }\n hash() {\n return `TimeUnit ${hash(this.formula)}`;\n }\n assemble() {\n const transforms = [];\n for (const f of vals(this.formula)) {\n const { field, as, timeUnit } = f;\n const _a = normalizeTimeUnit(timeUnit), { unit, utc } = _a, params = __rest(_a, [\"unit\", \"utc\"]);\n transforms.push(Object.assign(Object.assign(Object.assign(Object.assign({ field: replacePathInField(field), type: 'timeunit' }, (unit ? { units: getTimeUnitParts(unit) } : {})), (utc ? { timezone: 'utc' } : {})), params), { as: [as, `${as}_end`] }));\n }\n return transforms;\n }\n}\n//# sourceMappingURL=timeunit.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array } from 'vega-util';\nimport { isSingleDefUnitChannel } from '../../../channel';\nimport * as log from '../../../log';\nimport { hasContinuousDomain } from '../../../scale';\nimport { hash, keys, replacePathInField, varName, isEmpty } from '../../../util';\nimport { TimeUnitNode } from '../../data/timeunit';\nexport const TUPLE_FIELDS = '_tuple_fields';\nexport class SelectionProjectionComponent {\n constructor(...items) {\n this.items = items;\n this.hasChannel = {};\n this.hasField = {};\n }\n}\nconst project = {\n has: () => {\n return true; // This transform handles its own defaults, so always run parse.\n },\n parse: (model, selCmpt, selDef) => {\n var _a, _b, _c;\n const name = selCmpt.name;\n const proj = (_a = selCmpt.project) !== null && _a !== void 0 ? _a : (selCmpt.project = new SelectionProjectionComponent());\n const parsed = {};\n const timeUnits = {};\n const signals = new Set();\n const signalName = (p, range) => {\n const suffix = range === 'visual' ? p.channel : p.field;\n let sg = varName(`${name}_${suffix}`);\n for (let counter = 1; signals.has(sg); counter++) {\n sg = varName(`${name}_${suffix}_${counter}`);\n }\n signals.add(sg);\n return { [range]: sg };\n };\n // If no explicit projection (either fields or encodings) is specified, set some defaults.\n // If an initial value is set, try to infer projections.\n // Otherwise, use the default configuration.\n if (!selDef.fields && !selDef.encodings) {\n const cfg = model.config.selection[selDef.type];\n if (selDef.init) {\n for (const init of array(selDef.init)) {\n for (const key of keys(init)) {\n if (isSingleDefUnitChannel(key)) {\n (selDef.encodings || (selDef.encodings = [])).push(key);\n }\n else {\n if (selDef.type === 'interval') {\n log.warn(log.message.INTERVAL_INITIALIZED_WITH_X_Y);\n selDef.encodings = cfg.encodings;\n }\n else {\n (selDef.fields || (selDef.fields = [])).push(key);\n }\n }\n }\n }\n }\n else {\n selDef.encodings = cfg.encodings;\n selDef.fields = cfg.fields;\n }\n }\n // TODO: find a possible channel mapping for these fields.\n for (const field of (_b = selDef.fields) !== null && _b !== void 0 ? _b : []) {\n const p = { type: 'E', field };\n p.signals = Object.assign({}, signalName(p, 'data'));\n proj.items.push(p);\n proj.hasField[field] = p;\n }\n for (const channel of (_c = selDef.encodings) !== null && _c !== void 0 ? _c : []) {\n const fieldDef = model.fieldDef(channel);\n if (fieldDef) {\n let field = fieldDef.field;\n if (fieldDef.aggregate) {\n log.warn(log.message.cannotProjectAggregate(channel, fieldDef.aggregate));\n continue;\n }\n else if (!field) {\n log.warn(log.message.cannotProjectOnChannelWithoutField(channel));\n continue;\n }\n if (fieldDef.timeUnit) {\n field = model.vgField(channel);\n // Construct TimeUnitComponents which will be combined into a\n // TimeUnitNode. This node may need to be inserted into the\n // dataflow if the selection is used across views that do not\n // have these time units defined.\n const component = {\n timeUnit: fieldDef.timeUnit,\n as: field,\n field: fieldDef.field\n };\n timeUnits[hash(component)] = component;\n }\n // Prevent duplicate projections on the same field.\n // TODO: what if the same field is bound to multiple channels (e.g., SPLOM diag).\n if (!parsed[field]) {\n // Determine whether the tuple will store enumerated or ranged values.\n // Interval selections store ranges for continuous scales, and enumerations otherwise.\n // Single/multi selections store ranges for binned fields, and enumerations otherwise.\n let type = 'E';\n if (selCmpt.type === 'interval') {\n const scaleType = model.getScaleComponent(channel).get('type');\n if (hasContinuousDomain(scaleType)) {\n type = 'R';\n }\n }\n else if (fieldDef.bin) {\n type = 'R-RE';\n }\n const p = { field, channel, type };\n p.signals = Object.assign(Object.assign({}, signalName(p, 'data')), signalName(p, 'visual'));\n proj.items.push((parsed[field] = p));\n proj.hasField[field] = proj.hasChannel[channel] = parsed[field];\n }\n }\n else {\n log.warn(log.message.cannotProjectOnChannelWithoutField(channel));\n }\n }\n if (selDef.init) {\n const parseInit = (i) => {\n return proj.items.map(p => (i[p.channel] !== undefined ? i[p.channel] : i[p.field]));\n };\n if (selDef.type === 'interval') {\n selCmpt.init = parseInit(selDef.init);\n }\n else {\n const init = array(selDef.init);\n selCmpt.init = init.map(parseInit);\n }\n }\n if (!isEmpty(timeUnits)) {\n proj.timeUnit = new TimeUnitNode(null, timeUnits);\n }\n },\n signals: (model, selCmpt, allSignals) => {\n const name = selCmpt.name + TUPLE_FIELDS;\n const hasSignal = allSignals.filter(s => s.name === name);\n return hasSignal.length > 0\n ? allSignals\n : allSignals.concat({\n name,\n value: selCmpt.project.items.map(proj => {\n const { signals, hasLegend } = proj, rest = __rest(proj, [\"signals\", \"hasLegend\"]);\n rest.field = replacePathInField(rest.field);\n return rest;\n })\n });\n }\n};\nexport default project;\n//# sourceMappingURL=project.js.map","import { stringValue } from 'vega-util';\nimport { TUPLE } from '..';\nimport { varName } from '../../../util';\nimport { assembleInit } from '../assemble';\nimport nearest from './nearest';\nimport { TUPLE_FIELDS } from './project';\nimport { isLegendBinding } from '../../../selection';\nconst inputBindings = {\n has: selCmpt => {\n return (selCmpt.type === 'single' &&\n selCmpt.resolve === 'global' &&\n selCmpt.bind &&\n selCmpt.bind !== 'scales' &&\n !isLegendBinding(selCmpt.bind));\n },\n parse: (model, selCmpt, selDef, origDef) => {\n // Binding a selection to input widgets disables default direct manipulation interaction.\n // A user can choose to re-enable it by explicitly specifying triggering input events.\n if (!origDef.on)\n delete selCmpt.events;\n if (!origDef.clear)\n delete selCmpt.clear;\n },\n topLevelSignals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const proj = selCmpt.project;\n const bind = selCmpt.bind;\n const init = selCmpt.init && selCmpt.init[0]; // Can only exist on single selections (one initial value).\n const datum = nearest.has(selCmpt) ? '(item().isVoronoi ? datum.datum : datum)' : 'datum';\n proj.items.forEach((p, i) => {\n var _a, _b;\n const sgname = varName(`${name}_${p.field}`);\n const hasSignal = signals.filter(s => s.name === sgname);\n if (!hasSignal.length) {\n signals.unshift(Object.assign(Object.assign({ name: sgname }, (init ? { init: assembleInit(init[i]) } : { value: null })), { on: selCmpt.events\n ? [\n {\n events: selCmpt.events,\n update: `datum && item().mark.marktype !== 'group' ? ${datum}[${stringValue(p.field)}] : null`\n }\n ]\n : [], bind: (_b = (_a = bind[p.field]) !== null && _a !== void 0 ? _a : bind[p.channel]) !== null && _b !== void 0 ? _b : bind }));\n }\n });\n return signals;\n },\n signals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const proj = selCmpt.project;\n const signal = signals.filter(s => s.name === name + TUPLE)[0];\n const fields = name + TUPLE_FIELDS;\n const values = proj.items.map(p => varName(`${name}_${p.field}`));\n const valid = values.map(v => `${v} !== null`).join(' && ');\n if (values.length) {\n signal.update = `${valid} ? {fields: ${fields}, values: [${values.join(', ')}]} : null`;\n }\n delete signal.value;\n delete signal.on;\n return signals;\n }\n};\nexport default inputBindings;\n//# sourceMappingURL=inputs.js.map","import { TUPLE, unitName } from '..';\nexport const TOGGLE = '_toggle';\nconst toggle = {\n has: selCmpt => {\n return selCmpt.type === 'multi' && !!selCmpt.toggle;\n },\n signals: (model, selCmpt, signals) => {\n return signals.concat({\n name: selCmpt.name + TOGGLE,\n value: false,\n on: [{ events: selCmpt.events, update: selCmpt.toggle }]\n });\n },\n modifyExpr: (model, selCmpt) => {\n const tpl = selCmpt.name + TUPLE;\n const signal = selCmpt.name + TOGGLE;\n return (`${signal} ? null : ${tpl}, ` +\n (selCmpt.resolve === 'global' ? `${signal} ? null : true, ` : `${signal} ? null : {unit: ${unitName(model)}}, `) +\n `${signal} ? ${tpl} : null`);\n }\n};\nexport default toggle;\n//# sourceMappingURL=toggle.js.map","import { selector as parseSelector } from 'vega-event-selector';\nimport { isString } from 'vega-util';\nimport { TUPLE } from '..';\nimport { varName } from '../../../util';\nimport inputBindings from './inputs';\nimport toggle, { TOGGLE } from './toggle';\nconst clear = {\n has: selCmpt => {\n return selCmpt.clear !== undefined && selCmpt.clear !== false;\n },\n parse: (model, selCmpt, selDef) => {\n if (selDef.clear) {\n selCmpt.clear = isString(selDef.clear) ? parseSelector(selDef.clear, 'scope') : selDef.clear;\n }\n },\n topLevelSignals: (model, selCmpt, signals) => {\n if (inputBindings.has(selCmpt)) {\n for (const proj of selCmpt.project.items) {\n const idx = signals.findIndex(n => n.name === varName(`${selCmpt.name}_${proj.field}`));\n if (idx !== -1) {\n signals[idx].on.push({ events: selCmpt.clear, update: 'null' });\n }\n }\n }\n return signals;\n },\n signals: (model, selCmpt, signals) => {\n function addClear(idx, update) {\n if (idx !== -1 && signals[idx].on) {\n signals[idx].on.push({ events: selCmpt.clear, update });\n }\n }\n // Be as minimalist as possible when adding clear triggers to minimize dataflow execution.\n if (selCmpt.type === 'interval') {\n for (const proj of selCmpt.project.items) {\n const vIdx = signals.findIndex(n => n.name === proj.signals.visual);\n addClear(vIdx, '[0, 0]');\n if (vIdx === -1) {\n const dIdx = signals.findIndex(n => n.name === proj.signals.data);\n addClear(dIdx, 'null');\n }\n }\n }\n else {\n let tIdx = signals.findIndex(n => n.name === selCmpt.name + TUPLE);\n addClear(tIdx, 'null');\n if (toggle.has(selCmpt)) {\n tIdx = signals.findIndex(n => n.name === selCmpt.name + TOGGLE);\n addClear(tIdx, 'false');\n }\n }\n return signals;\n }\n};\nexport default clear;\n//# sourceMappingURL=clear.js.map","import { stringValue } from 'vega-util';\nimport { VL_SELECTION_RESOLVE } from '..';\nimport { isScaleChannel } from '../../../channel';\nimport * as log from '../../../log';\nimport { hasContinuousDomain } from '../../../scale';\nimport { isLayerModel } from '../../model';\nconst scaleBindings = {\n has: selCmpt => {\n return selCmpt.type === 'interval' && selCmpt.resolve === 'global' && selCmpt.bind && selCmpt.bind === 'scales';\n },\n parse: (model, selCmpt) => {\n const bound = (selCmpt.scales = []);\n for (const proj of selCmpt.project.items) {\n const channel = proj.channel;\n if (!isScaleChannel(channel)) {\n continue;\n }\n const scale = model.getScaleComponent(channel);\n const scaleType = scale ? scale.get('type') : undefined;\n if (!scale || !hasContinuousDomain(scaleType)) {\n log.warn(log.message.SCALE_BINDINGS_CONTINUOUS);\n continue;\n }\n const extent = { selection: selCmpt.name, field: proj.field };\n scale.set('selectionExtent', extent, true);\n bound.push(proj);\n }\n },\n topLevelSignals: (model, selCmpt, signals) => {\n const bound = selCmpt.scales.filter(proj => signals.filter(s => s.name === proj.signals.data).length === 0);\n // Top-level signals are only needed for multiview displays and if this\n // view's top-level signals haven't already been generated.\n if (!model.parent || isTopLevelLayer(model) || bound.length === 0) {\n return signals;\n }\n // vlSelectionResolve does not account for the behavior of bound scales in\n // multiview displays. Each unit view adds a tuple to the store, but the\n // state of the selection is the unit selection most recently updated. This\n // state is captured by the top-level signals that we insert and \"push\n // outer\" to from within the units. We need to reassemble this state into\n // the top-level named signal, except no single selCmpt has a global view.\n const namedSg = signals.filter(s => s.name === selCmpt.name)[0];\n let update = namedSg.update;\n if (update.indexOf(VL_SELECTION_RESOLVE) >= 0) {\n namedSg.update = `{${bound.map(proj => `${stringValue(proj.field)}: ${proj.signals.data}`).join(', ')}}`;\n }\n else {\n for (const proj of bound) {\n const mapping = `${stringValue(proj.field)}: ${proj.signals.data}`;\n if (update.indexOf(mapping) < 0) {\n update = `${update.substring(0, update.length - 1)}, ${mapping}}`;\n }\n }\n namedSg.update = update;\n }\n return signals.concat(bound.map(proj => ({ name: proj.signals.data })));\n },\n signals: (model, selCmpt, signals) => {\n // Nested signals need only push to top-level signals with multiview displays.\n if (model.parent && !isTopLevelLayer(model)) {\n for (const proj of selCmpt.scales) {\n const signal = signals.filter(s => s.name === proj.signals.data)[0];\n signal.push = 'outer';\n delete signal.value;\n delete signal.update;\n }\n }\n return signals;\n }\n};\nexport default scaleBindings;\nexport function domain(model, channel) {\n const scale = stringValue(model.scaleName(channel));\n return `domain(${scale})`;\n}\nfunction isTopLevelLayer(model) {\n var _a;\n return model.parent && isLayerModel(model.parent) && ((_a = !model.parent.parent) !== null && _a !== void 0 ? _a : isTopLevelLayer(model.parent.parent));\n}\n//# sourceMappingURL=scales.js.map","import { selector as parseSelector } from 'vega-event-selector';\nimport { array, isString } from 'vega-util';\nimport { forEachSelection, TUPLE } from '..';\nimport * as log from '../../../log';\nimport { isLegendBinding, isLegendStreamBinding, SELECTION_ID } from '../../../selection';\nimport { duplicate, varName } from '../../../util';\nimport { TUPLE_FIELDS } from './project';\nimport { TOGGLE } from './toggle';\nconst legendBindings = {\n has: (selCmpt) => {\n const spec = selCmpt.resolve === 'global' && selCmpt.bind && isLegendBinding(selCmpt.bind);\n const projLen = selCmpt.project.items.length === 1 && selCmpt.project.items[0].field !== SELECTION_ID;\n if (spec && !projLen) {\n log.warn(log.message.LEGEND_BINDINGS_MUST_HAVE_PROJECTION);\n }\n return spec && projLen;\n },\n parse: (model, selCmpt, selDef, origDef) => {\n var _a;\n // Binding a selection to a legend disables default direct manipulation interaction.\n // A user can choose to re-enable it by explicitly specifying triggering input events.\n if (!origDef.on)\n delete selCmpt.events;\n if (!origDef.clear)\n delete selCmpt.clear;\n if (origDef.on || origDef.clear) {\n const legendFilter = 'event.item && indexof(event.item.mark.role, \"legend\") < 0';\n for (const evt of selCmpt.events) {\n evt.filter = array((_a = evt.filter) !== null && _a !== void 0 ? _a : []);\n if (evt.filter.indexOf(legendFilter) < 0) {\n evt.filter.push(legendFilter);\n }\n }\n }\n const evt = isLegendStreamBinding(selCmpt.bind) ? selCmpt.bind.legend : 'click';\n const stream = isString(evt) ? parseSelector(evt, 'view') : array(evt);\n selCmpt.bind = { legend: { merge: stream } };\n },\n topLevelSignals: (model, selCmpt, signals) => {\n const selName = selCmpt.name;\n const stream = isLegendStreamBinding(selCmpt.bind) && selCmpt.bind.legend;\n const markName = (name) => (s) => {\n const ds = duplicate(s);\n ds.markname = name;\n return ds;\n };\n for (const proj of selCmpt.project.items) {\n if (!proj.hasLegend)\n continue;\n const prefix = `${varName(proj.field)}_legend`;\n const sgName = `${selName}_${prefix}`;\n const hasSignal = signals.filter(s => s.name === sgName);\n if (hasSignal.length === 0) {\n const events = stream.merge\n .map(markName(`${prefix}_symbols`))\n .concat(stream.merge.map(markName(`${prefix}_labels`)))\n .concat(stream.merge.map(markName(`${prefix}_entries`)));\n signals.unshift(Object.assign(Object.assign({ name: sgName }, (!selCmpt.init ? { value: null } : {})), { on: [\n // Legend entries do not store values, so we need to walk the scenegraph to the symbol datum.\n { events, update: 'datum.value || item().items[0].items[0].datum.value', force: true },\n { events: stream.merge, update: `!event.item || !datum ? null : ${sgName}`, force: true }\n ] }));\n }\n }\n return signals;\n },\n signals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const proj = selCmpt.project;\n const tuple = signals.find(s => s.name === name + TUPLE);\n const fields = name + TUPLE_FIELDS;\n const values = proj.items.filter(p => p.hasLegend).map(p => varName(`${name}_${varName(p.field)}_legend`));\n const valid = values.map(v => `${v} !== null`).join(' && ');\n const update = `${valid} ? {fields: ${fields}, values: [${values.join(', ')}]} : null`;\n if (selCmpt.events && values.length > 0) {\n tuple.on.push({\n events: values.map(signal => ({ signal })),\n update\n });\n }\n else if (values.length > 0) {\n tuple.update = update;\n delete tuple.value;\n delete tuple.on;\n }\n const toggle = signals.find(s => s.name === name + TOGGLE);\n const events = isLegendStreamBinding(selCmpt.bind) && selCmpt.bind.legend;\n if (toggle) {\n if (!selCmpt.events)\n toggle.on[0].events = events;\n else\n toggle.on.push(Object.assign(Object.assign({}, toggle.on[0]), { events }));\n }\n return signals;\n }\n};\nexport default legendBindings;\nexport function parseInteractiveLegend(model, channel, legendCmpt) {\n var _a;\n const field = (_a = model.fieldDef(channel)) === null || _a === void 0 ? void 0 : _a.field;\n forEachSelection(model, selCmpt => {\n var _a, _b;\n const proj = (_a = selCmpt.project.hasField[field]) !== null && _a !== void 0 ? _a : selCmpt.project.hasChannel[channel];\n if (proj && legendBindings.has(selCmpt)) {\n const legendSelections = (_b = legendCmpt.get('selections')) !== null && _b !== void 0 ? _b : [];\n legendSelections.push(selCmpt.name);\n legendCmpt.set('selections', legendSelections, false);\n proj.hasLegend = true;\n }\n });\n}\n//# sourceMappingURL=legends.js.map","import { selector as parseSelector } from 'vega-event-selector';\nimport { X, Y } from '../../../channel';\nimport { BRUSH as INTERVAL_BRUSH } from '../interval';\nimport scalesCompiler, { domain } from './scales';\nconst ANCHOR = '_translate_anchor';\nconst DELTA = '_translate_delta';\nconst translate = {\n has: selCmpt => {\n return selCmpt.type === 'interval' && selCmpt.translate;\n },\n signals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const hasScales = scalesCompiler.has(selCmpt);\n const anchor = name + ANCHOR;\n const { x, y } = selCmpt.project.hasChannel;\n let events = parseSelector(selCmpt.translate, 'scope');\n if (!hasScales) {\n events = events.map(e => ((e.between[0].markname = name + INTERVAL_BRUSH), e));\n }\n signals.push({\n name: anchor,\n value: {},\n on: [\n {\n events: events.map(e => e.between[0]),\n update: '{x: x(unit), y: y(unit)' +\n (x !== undefined ? ', extent_x: ' + (hasScales ? domain(model, X) : `slice(${x.signals.visual})`) : '') +\n (y !== undefined ? ', extent_y: ' + (hasScales ? domain(model, Y) : `slice(${y.signals.visual})`) : '') +\n '}'\n }\n ]\n }, {\n name: name + DELTA,\n value: {},\n on: [\n {\n events: events,\n update: `{x: ${anchor}.x - x(unit), y: ${anchor}.y - y(unit)}`\n }\n ]\n });\n if (x !== undefined) {\n onDelta(model, selCmpt, x, 'width', signals);\n }\n if (y !== undefined) {\n onDelta(model, selCmpt, y, 'height', signals);\n }\n return signals;\n }\n};\nexport default translate;\nfunction onDelta(model, selCmpt, proj, size, signals) {\n var _a;\n const name = selCmpt.name;\n const anchor = name + ANCHOR;\n const delta = name + DELTA;\n const channel = proj.channel;\n const hasScales = scalesCompiler.has(selCmpt);\n const signal = signals.filter(s => s.name === proj.signals[hasScales ? 'data' : 'visual'])[0];\n const sizeSg = model.getSizeSignalRef(size).signal;\n const scaleCmpt = model.getScaleComponent(channel);\n const scaleType = scaleCmpt.get('type');\n const sign = hasScales && channel === X ? '-' : ''; // Invert delta when panning x-scales.\n const extent = `${anchor}.extent_${channel}`;\n const offset = `${sign}${delta}.${channel} / ` + (hasScales ? `${sizeSg}` : `span(${extent})`);\n const panFn = !hasScales\n ? 'panLinear'\n : scaleType === 'log'\n ? 'panLog'\n : scaleType === 'pow'\n ? 'panPow'\n : 'panLinear';\n const update = `${panFn}(${extent}, ${offset}` +\n (hasScales && scaleType === 'pow' ? `, ${(_a = scaleCmpt.get('exponent')) !== null && _a !== void 0 ? _a : 1}` : '') +\n ')';\n signal.on.push({\n events: { signal: delta },\n update: hasScales ? update : `clampRange(${update}, 0, ${sizeSg})`\n });\n}\n//# sourceMappingURL=translate.js.map","import { selector as parseSelector } from 'vega-event-selector';\nimport { stringValue } from 'vega-util';\nimport { X, Y } from '../../../channel';\nimport { BRUSH as INTERVAL_BRUSH } from '../interval';\nimport { default as scalesCompiler, domain } from './scales';\nconst ANCHOR = '_zoom_anchor';\nconst DELTA = '_zoom_delta';\nconst zoom = {\n has: selCmpt => {\n return selCmpt.type === 'interval' && selCmpt.zoom;\n },\n signals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const hasScales = scalesCompiler.has(selCmpt);\n const delta = name + DELTA;\n const { x, y } = selCmpt.project.hasChannel;\n const sx = stringValue(model.scaleName(X));\n const sy = stringValue(model.scaleName(Y));\n let events = parseSelector(selCmpt.zoom, 'scope');\n if (!hasScales) {\n events = events.map(e => ((e.markname = name + INTERVAL_BRUSH), e));\n }\n signals.push({\n name: name + ANCHOR,\n on: [\n {\n events: events,\n update: !hasScales\n ? `{x: x(unit), y: y(unit)}`\n : '{' +\n [sx ? `x: invert(${sx}, x(unit))` : '', sy ? `y: invert(${sy}, y(unit))` : '']\n .filter(expr => !!expr)\n .join(', ') +\n '}'\n }\n ]\n }, {\n name: delta,\n on: [\n {\n events: events,\n force: true,\n update: 'pow(1.001, event.deltaY * pow(16, event.deltaMode))'\n }\n ]\n });\n if (x !== undefined) {\n onDelta(model, selCmpt, x, 'width', signals);\n }\n if (y !== undefined) {\n onDelta(model, selCmpt, y, 'height', signals);\n }\n return signals;\n }\n};\nexport default zoom;\nfunction onDelta(model, selCmpt, proj, size, signals) {\n var _a;\n const name = selCmpt.name;\n const channel = proj.channel;\n const hasScales = scalesCompiler.has(selCmpt);\n const signal = signals.filter(s => s.name === proj.signals[hasScales ? 'data' : 'visual'])[0];\n const sizeSg = model.getSizeSignalRef(size).signal;\n const scaleCmpt = model.getScaleComponent(channel);\n const scaleType = scaleCmpt.get('type');\n const base = hasScales ? domain(model, channel) : signal.name;\n const delta = name + DELTA;\n const anchor = `${name}${ANCHOR}.${channel}`;\n const zoomFn = !hasScales\n ? 'zoomLinear'\n : scaleType === 'log'\n ? 'zoomLog'\n : scaleType === 'pow'\n ? 'zoomPow'\n : 'zoomLinear';\n const update = `${zoomFn}(${base}, ${anchor}, ${delta}` +\n (hasScales && scaleType === 'pow' ? `, ${(_a = scaleCmpt.get('exponent')) !== null && _a !== void 0 ? _a : 1}` : '') +\n ')';\n signal.on.push({\n events: { signal: delta },\n update: hasScales ? update : `clampRange(${update}, 0, ${sizeSg})`\n });\n}\n//# sourceMappingURL=zoom.js.map","import clear from './clear';\nimport inputs from './inputs';\nimport nearest from './nearest';\nimport project from './project';\nimport scales from './scales';\nimport legends from './legends';\nimport toggle from './toggle';\nimport translate from './translate';\nimport zoom from './zoom';\nconst compilers = [project, toggle, scales, legends, translate, zoom, inputs, nearest, clear];\nexport function forEachTransform(selCmpt, cb) {\n for (const t of compilers) {\n if (t.has(selCmpt)) {\n cb(t);\n }\n }\n}\n//# sourceMappingURL=transforms.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { selector as parseSelector } from 'vega-event-selector';\nimport { identity, isArray, stringValue } from 'vega-util';\nimport { forEachSelection, MODIFY, STORE, unitName, VL_SELECTION_RESOLVE, TUPLE } from '.';\nimport { dateTimeToExpr, isDateTime, dateTimeToTimestamp } from '../../datetime';\nimport { keys, varName } from '../../util';\nimport { isUnitModel } from '../model';\nimport { forEachTransform } from './transforms/transforms';\nimport { parseSelectionBinExtent } from './parse';\nexport function assembleInit(init, isExpr = true, wrap = identity) {\n if (isArray(init)) {\n const assembled = init.map(v => assembleInit(v, isExpr, wrap));\n return isExpr ? `[${assembled.join(', ')}]` : assembled;\n }\n else if (isDateTime(init)) {\n if (isExpr) {\n return wrap(dateTimeToExpr(init));\n }\n else {\n return wrap(dateTimeToTimestamp(init));\n }\n }\n return isExpr ? wrap(JSON.stringify(init)) : init;\n}\nexport function assembleUnitSelectionSignals(model, signals) {\n forEachSelection(model, (selCmpt, selCompiler) => {\n const name = selCmpt.name;\n let modifyExpr = selCompiler.modifyExpr(model, selCmpt);\n signals.push(...selCompiler.signals(model, selCmpt));\n forEachTransform(selCmpt, txCompiler => {\n if (txCompiler.signals) {\n signals = txCompiler.signals(model, selCmpt, signals);\n }\n if (txCompiler.modifyExpr) {\n modifyExpr = txCompiler.modifyExpr(model, selCmpt, modifyExpr);\n }\n });\n signals.push({\n name: name + MODIFY,\n on: [\n {\n events: { signal: selCmpt.name + TUPLE },\n update: `modify(${stringValue(selCmpt.name + STORE)}, ${modifyExpr})`\n }\n ]\n });\n });\n return cleanupEmptyOnArray(signals);\n}\nexport function assembleFacetSignals(model, signals) {\n if (model.component.selection && keys(model.component.selection).length) {\n const name = stringValue(model.getName('cell'));\n signals.unshift({\n name: 'facet',\n value: {},\n on: [\n {\n events: parseSelector('mousemove', 'scope'),\n update: `isTuple(facet) ? facet : group(${name}).datum`\n }\n ]\n });\n }\n return cleanupEmptyOnArray(signals);\n}\nexport function assembleTopLevelSignals(model, signals) {\n let hasSelections = false;\n forEachSelection(model, (selCmpt, selCompiler) => {\n const name = selCmpt.name;\n const store = stringValue(name + STORE);\n const hasSg = signals.filter(s => s.name === name);\n if (hasSg.length === 0) {\n const resolve = selCmpt.resolve === 'global' ? 'union' : selCmpt.resolve;\n const isMulti = selCmpt.type === 'multi' ? ', true)' : ')';\n signals.push({\n name: selCmpt.name,\n update: `${VL_SELECTION_RESOLVE}(${store}, ${stringValue(resolve)}${isMulti}`\n });\n }\n hasSelections = true;\n if (selCompiler.topLevelSignals) {\n signals = selCompiler.topLevelSignals(model, selCmpt, signals);\n }\n forEachTransform(selCmpt, txCompiler => {\n if (txCompiler.topLevelSignals) {\n signals = txCompiler.topLevelSignals(model, selCmpt, signals);\n }\n });\n });\n if (hasSelections) {\n const hasUnit = signals.filter(s => s.name === 'unit');\n if (hasUnit.length === 0) {\n signals.unshift({\n name: 'unit',\n value: {},\n on: [{ events: 'mousemove', update: 'isTuple(group()) ? group() : unit' }]\n });\n }\n }\n return cleanupEmptyOnArray(signals);\n}\nexport function assembleUnitSelectionData(model, data) {\n const dataCopy = [...data];\n forEachSelection(model, selCmpt => {\n const init = { name: selCmpt.name + STORE };\n if (selCmpt.init) {\n const fields = selCmpt.project.items.map(proj => {\n const { signals } = proj, rest = __rest(proj, [\"signals\"]);\n return rest;\n });\n const insert = selCmpt.init.map(i => assembleInit(i, false));\n init.values =\n selCmpt.type === 'interval'\n ? [{ unit: unitName(model, { escape: false }), fields, values: insert }]\n : insert.map(i => ({ unit: unitName(model, { escape: false }), fields, values: i }));\n }\n const contains = dataCopy.filter(d => d.name === selCmpt.name + STORE);\n if (!contains.length) {\n dataCopy.push(init);\n }\n });\n return dataCopy;\n}\nexport function assembleUnitSelectionMarks(model, marks) {\n forEachSelection(model, (selCmpt, selCompiler) => {\n marks = selCompiler.marks ? selCompiler.marks(model, selCmpt, marks) : marks;\n forEachTransform(selCmpt, txCompiler => {\n if (txCompiler.marks) {\n marks = txCompiler.marks(model, selCmpt, marks);\n }\n });\n });\n return marks;\n}\nexport function assembleLayerSelectionMarks(model, marks) {\n for (const child of model.children) {\n if (isUnitModel(child)) {\n marks = assembleUnitSelectionMarks(child, marks);\n }\n }\n return marks;\n}\nexport function assembleSelectionScaleDomain(model, extent) {\n const name = extent.selection;\n const selCmpt = model.getSelectionComponent(name, varName(name));\n return { signal: parseSelectionBinExtent(selCmpt, extent) };\n}\nfunction cleanupEmptyOnArray(signals) {\n return signals.map(s => {\n if (s.on && !s.on.length)\n delete s.on;\n return s;\n });\n}\n//# sourceMappingURL=assemble.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array, stringValue } from 'vega-util';\nimport { STORE, TUPLE, unitName } from '.';\nimport { X, Y } from '../../channel';\nimport { warn } from '../../log';\nimport { hasContinuousDomain } from '../../scale';\nimport { keys } from '../../util';\nimport { assembleInit } from './assemble';\nimport { TUPLE_FIELDS } from './transforms/project';\nimport scales from './transforms/scales';\nexport const BRUSH = '_brush';\nexport const SCALE_TRIGGER = '_scale_trigger';\nconst interval = {\n signals: (model, selCmpt) => {\n const name = selCmpt.name;\n const fieldsSg = name + TUPLE_FIELDS;\n const hasScales = scales.has(selCmpt);\n const signals = [];\n const dataSignals = [];\n const scaleTriggers = [];\n if (selCmpt.translate && !hasScales) {\n const filterExpr = `!event.item || event.item.mark.name !== ${stringValue(name + BRUSH)}`;\n events(selCmpt, (on, evt) => {\n var _a;\n const filters = array((_a = evt.between[0].filter) !== null && _a !== void 0 ? _a : (evt.between[0].filter = []));\n if (filters.indexOf(filterExpr) < 0) {\n filters.push(filterExpr);\n }\n return on;\n });\n }\n selCmpt.project.items.forEach((proj, i) => {\n const channel = proj.channel;\n if (channel !== X && channel !== Y) {\n warn('Interval selections only support x and y encoding channels.');\n return;\n }\n const init = selCmpt.init ? selCmpt.init[i] : null;\n const cs = channelSignals(model, selCmpt, proj, init);\n const dname = proj.signals.data;\n const vname = proj.signals.visual;\n const scaleName = stringValue(model.scaleName(channel));\n const scaleType = model.getScaleComponent(channel).get('type');\n const toNum = hasContinuousDomain(scaleType) ? '+' : '';\n signals.push(...cs);\n dataSignals.push(dname);\n scaleTriggers.push({\n scaleName: model.scaleName(channel),\n expr: `(!isArray(${dname}) || ` +\n `(${toNum}invert(${scaleName}, ${vname})[0] === ${toNum}${dname}[0] && ` +\n `${toNum}invert(${scaleName}, ${vname})[1] === ${toNum}${dname}[1]))`\n });\n });\n // Proxy scale reactions to ensure that an infinite loop doesn't occur\n // when an interval selection filter touches the scale.\n if (!hasScales) {\n signals.push({\n name: name + SCALE_TRIGGER,\n value: {},\n on: [\n {\n events: scaleTriggers.map(t => ({ scale: t.scaleName })),\n update: scaleTriggers.map(t => t.expr).join(' && ') + ` ? ${name + SCALE_TRIGGER} : {}`\n }\n ]\n });\n }\n // Only add an interval to the store if it has valid data extents. Data extents\n // are set to null if pixel extents are equal to account for intervals over\n // ordinal/nominal domains which, when inverted, will still produce a valid datum.\n const init = selCmpt.init;\n const update = `unit: ${unitName(model)}, fields: ${fieldsSg}, values`;\n return signals.concat(Object.assign(Object.assign({ name: name + TUPLE }, (init ? { init: `{${update}: ${assembleInit(init)}}` } : {})), { on: [\n {\n events: [{ signal: dataSignals.join(' || ') }],\n update: dataSignals.join(' && ') + ` ? {${update}: [${dataSignals}]} : null`\n }\n ] }));\n },\n modifyExpr: (model, selCmpt) => {\n const tpl = selCmpt.name + TUPLE;\n return tpl + ', ' + (selCmpt.resolve === 'global' ? 'true' : `{unit: ${unitName(model)}}`);\n },\n marks: (model, selCmpt, marks) => {\n const name = selCmpt.name;\n const { x, y } = selCmpt.project.hasChannel;\n const xvname = x && x.signals.visual;\n const yvname = y && y.signals.visual;\n const store = `data(${stringValue(selCmpt.name + STORE)})`;\n // Do not add a brush if we're binding to scales.\n if (scales.has(selCmpt)) {\n return marks;\n }\n const update = {\n x: x !== undefined ? { signal: `${xvname}[0]` } : { value: 0 },\n y: y !== undefined ? { signal: `${yvname}[0]` } : { value: 0 },\n x2: x !== undefined ? { signal: `${xvname}[1]` } : { field: { group: 'width' } },\n y2: y !== undefined ? { signal: `${yvname}[1]` } : { field: { group: 'height' } }\n };\n // If the selection is resolved to global, only a single interval is in\n // the store. Wrap brush mark's encodings with a production rule to test\n // this based on the `unit` property. Hide the brush mark if it corresponds\n // to a unit different from the one in the store.\n if (selCmpt.resolve === 'global') {\n for (const key of keys(update)) {\n update[key] = [\n Object.assign({ test: `${store}.length && ${store}[0].unit === ${unitName(model)}` }, update[key]),\n { value: 0 }\n ];\n }\n }\n // Two brush marks ensure that fill colors and other aesthetic choices do\n // not interefere with the core marks, but that the brushed region can still\n // be interacted with (e.g., dragging it around).\n const _a = selCmpt.mark, { fill, fillOpacity, cursor } = _a, stroke = __rest(_a, [\"fill\", \"fillOpacity\", \"cursor\"]);\n const vgStroke = keys(stroke).reduce((def, k) => {\n def[k] = [\n {\n test: [x !== undefined && `${xvname}[0] !== ${xvname}[1]`, y !== undefined && `${yvname}[0] !== ${yvname}[1]`]\n .filter(t => t)\n .join(' && '),\n value: stroke[k]\n },\n { value: null }\n ];\n return def;\n }, {});\n return [\n {\n name: name + BRUSH + '_bg',\n type: 'rect',\n clip: true,\n encode: {\n enter: {\n fill: { value: fill },\n fillOpacity: { value: fillOpacity }\n },\n update: update\n }\n },\n ...marks,\n {\n name: name + BRUSH,\n type: 'rect',\n clip: true,\n encode: {\n enter: Object.assign(Object.assign({}, (cursor ? { cursor: { value: cursor } } : {})), { fill: { value: 'transparent' } }),\n update: Object.assign(Object.assign({}, update), vgStroke)\n }\n }\n ];\n }\n};\nexport default interval;\n/**\n * Returns the visual and data signals for an interval selection.\n */\nfunction channelSignals(model, selCmpt, proj, init) {\n const channel = proj.channel;\n const vname = proj.signals.visual;\n const dname = proj.signals.data;\n const hasScales = scales.has(selCmpt);\n const scaleName = stringValue(model.scaleName(channel));\n const scale = model.getScaleComponent(channel);\n const scaleType = scale ? scale.get('type') : undefined;\n const scaled = (str) => `scale(${scaleName}, ${str})`;\n const size = model.getSizeSignalRef(channel === X ? 'width' : 'height').signal;\n const coord = `${channel}(unit)`;\n const on = events(selCmpt, (def, evt) => {\n return [\n ...def,\n { events: evt.between[0], update: `[${coord}, ${coord}]` },\n { events: evt, update: `[${vname}[0], clamp(${coord}, 0, ${size})]` } // Brush End\n ];\n });\n // React to pan/zooms of continuous scales. Non-continuous scales\n // (band, point) cannot be pan/zoomed and any other changes\n // to their domains (e.g., filtering) should clear the brushes.\n on.push({\n events: { signal: selCmpt.name + SCALE_TRIGGER },\n update: hasContinuousDomain(scaleType) ? `[${scaled(`${dname}[0]`)}, ${scaled(`${dname}[1]`)}]` : `[0, 0]`\n });\n return hasScales\n ? [{ name: dname, on: [] }]\n : [\n Object.assign(Object.assign({ name: vname }, (init ? { init: assembleInit(init, true, scaled) } : { value: [] })), { on: on }),\n Object.assign(Object.assign({ name: dname }, (init ? { init: assembleInit(init) } : {})), { on: [\n {\n events: { signal: vname },\n update: `${vname}[0] === ${vname}[1] ? null : invert(${scaleName}, ${vname})`\n }\n ] })\n ];\n}\nfunction events(selCmpt, cb) {\n return selCmpt.events.reduce((on, evt) => {\n if (!evt.between) {\n warn(`${evt} is not an ordered event stream for interval selections.`);\n return on;\n }\n return cb(on, evt);\n }, []);\n}\n//# sourceMappingURL=interval.js.map","import { stringValue } from 'vega-util';\nimport { TUPLE, unitName } from '.';\nimport { TUPLE_FIELDS } from './transforms/project';\nexport function singleOrMultiSignals(model, selCmpt) {\n const name = selCmpt.name;\n const fieldsSg = name + TUPLE_FIELDS;\n const project = selCmpt.project;\n const datum = '(item().isVoronoi ? datum.datum : datum)';\n const values = project.items\n .map(p => {\n const fieldDef = model.fieldDef(p.channel);\n // Binned fields should capture extents, for a range test against the raw field.\n return fieldDef && fieldDef.bin\n ? `[${datum}[${stringValue(model.vgField(p.channel, {}))}], ` +\n `${datum}[${stringValue(model.vgField(p.channel, { binSuffix: 'end' }))}]]`\n : `${datum}[${stringValue(p.field)}]`;\n })\n .join(', ');\n // Only add a discrete selection to the store if a datum is present _and_\n // the interaction isn't occurring on a group mark. This guards against\n // polluting interactive state with invalid values in faceted displays\n // as the group marks are also data-driven. We force the update to account\n // for constant null states but varying toggles (e.g., shift-click in\n // whitespace followed by a click in whitespace; the store should only\n // be cleared on the second click).\n const update = `unit: ${unitName(model)}, fields: ${fieldsSg}, values`;\n const events = selCmpt.events;\n return [\n {\n name: name + TUPLE,\n on: events\n ? [\n {\n events,\n update: `datum && item().mark.marktype !== 'group' ? {${update}: [${values}]} : null`,\n force: true\n }\n ]\n : []\n }\n ];\n}\nconst multi = {\n signals: singleOrMultiSignals,\n modifyExpr: (model, selCmpt) => {\n const tpl = selCmpt.name + TUPLE;\n return tpl + ', ' + (selCmpt.resolve === 'global' ? 'null' : `{unit: ${unitName(model)}}`);\n }\n};\nexport default multi;\n//# sourceMappingURL=multi.js.map","import { TUPLE, unitName } from '.';\nimport { singleOrMultiSignals } from './multi';\nconst single = {\n signals: singleOrMultiSignals,\n modifyExpr: (model, selCmpt) => {\n const tpl = selCmpt.name + TUPLE;\n return tpl + ', ' + (selCmpt.resolve === 'global' ? 'true' : `{unit: ${unitName(model)}}`);\n }\n};\nexport default single;\n//# sourceMappingURL=single.js.map","import { stringValue } from 'vega-util';\nimport { FACET_CHANNELS } from '../../channel';\nimport { SELECTION_ID } from '../../selection';\nimport { vals } from '../../util';\nimport { isFacetModel } from '../model';\nimport interval from './interval';\nimport multi from './multi';\nimport single from './single';\nexport const STORE = '_store';\nexport const TUPLE = '_tuple';\nexport const MODIFY = '_modify';\nexport const SELECTION_DOMAIN = '_selection_domain_';\nexport const VL_SELECTION_RESOLVE = 'vlSelectionResolve';\nconst compilers = { single, multi, interval };\nexport function forEachSelection(model, cb) {\n const selections = model.component.selection;\n if (selections) {\n for (const sel of vals(selections)) {\n const success = cb(sel, compilers[sel.type]);\n if (success === true)\n break;\n }\n }\n}\nfunction getFacetModel(model) {\n let parent = model.parent;\n while (parent) {\n if (isFacetModel(parent)) {\n break;\n }\n parent = parent.parent;\n }\n return parent;\n}\nexport function unitName(model, { escape } = { escape: true }) {\n let name = escape ? stringValue(model.name) : model.name;\n const facetModel = getFacetModel(model);\n if (facetModel) {\n const { facet } = facetModel;\n for (const channel of FACET_CHANNELS) {\n if (facet[channel]) {\n name += ` + '__facet_${channel}_' + (facet[${stringValue(facetModel.vgField(channel))}])`;\n }\n }\n }\n return name;\n}\nexport function requiresSelectionId(model) {\n let identifier = false;\n forEachSelection(model, selCmpt => {\n identifier = identifier || selCmpt.project.items.some(proj => proj.field === SELECTION_ID);\n });\n return identifier;\n}\n//# sourceMappingURL=index.js.map","function accessor (fn, fields, name) {\n fn.fields = fields || [];\n fn.fname = name;\n return fn;\n}\nfunction accessorName(fn) {\n return fn == null ? null : fn.fname;\n}\nfunction accessorFields(fn) {\n return fn == null ? null : fn.fields;\n}\n\nfunction getter (path) {\n return path.length === 1 ? get1(path[0]) : getN(path);\n}\nconst get1 = field => function (obj) {\n return obj[field];\n};\nconst getN = path => {\n const len = path.length;\n return function (obj) {\n for (let i = 0; i < len; ++i) {\n obj = obj[path[i]];\n }\n return obj;\n };\n};\n\nfunction error (message) {\n throw Error(message);\n}\n\nfunction splitAccessPath (p) {\n const path = [],\n n = p.length;\n let q = null,\n b = 0,\n s = '',\n i,\n j,\n c;\n p = p + '';\n function push() {\n path.push(s + p.substring(i, j));\n s = '';\n i = j + 1;\n }\n for (i = j = 0; j < n; ++j) {\n c = p[j];\n if (c === '\\\\') {\n s += p.substring(i, j);\n s += p.substring(++j, ++j);\n i = j;\n } else if (c === q) {\n push();\n q = null;\n b = -1;\n } else if (q) {\n continue;\n } else if (i === b && c === '\"') {\n i = j + 1;\n q = c;\n } else if (i === b && c === \"'\") {\n i = j + 1;\n q = c;\n } else if (c === '.' && !b) {\n if (j > i) {\n push();\n } else {\n i = j + 1;\n }\n } else if (c === '[') {\n if (j > i) push();\n b = i = j + 1;\n } else if (c === ']') {\n if (!b) error('Access path missing open bracket: ' + p);\n if (b > 0) push();\n b = 0;\n i = j + 1;\n }\n }\n if (b) error('Access path missing closing bracket: ' + p);\n if (q) error('Access path missing closing quote: ' + p);\n if (j > i) {\n j++;\n push();\n }\n return path;\n}\n\nfunction field (field, name, opt) {\n const path = splitAccessPath(field);\n field = path.length === 1 ? path[0] : field;\n return accessor((opt && opt.get || getter)(path), [field], name || field);\n}\n\nconst id = field('id');\nconst identity = accessor(_ => _, [], 'identity');\nconst zero = accessor(() => 0, [], 'zero');\nconst one = accessor(() => 1, [], 'one');\nconst truthy = accessor(() => true, [], 'true');\nconst falsy = accessor(() => false, [], 'false');\n\nfunction log$1(method, level, input) {\n const args = [level].concat([].slice.call(input));\n console[method].apply(console, args); // eslint-disable-line no-console\n}\n\nconst None = 0;\nconst Error$1 = 1;\nconst Warn = 2;\nconst Info = 3;\nconst Debug = 4;\nfunction logger (_, method) {\n let handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : log$1;\n let level = _ || None;\n return {\n level(_) {\n if (arguments.length) {\n level = +_;\n return this;\n } else {\n return level;\n }\n },\n error() {\n if (level >= Error$1) handler(method || 'error', 'ERROR', arguments);\n return this;\n },\n warn() {\n if (level >= Warn) handler(method || 'warn', 'WARN', arguments);\n return this;\n },\n info() {\n if (level >= Info) handler(method || 'log', 'INFO', arguments);\n return this;\n },\n debug() {\n if (level >= Debug) handler(method || 'log', 'DEBUG', arguments);\n return this;\n }\n };\n}\n\nvar isArray = Array.isArray;\n\nfunction isObject (_) {\n return _ === Object(_);\n}\n\nconst isLegalKey = key => key !== '__proto__';\nfunction mergeConfig() {\n for (var _len = arguments.length, configs = new Array(_len), _key = 0; _key < _len; _key++) {\n configs[_key] = arguments[_key];\n }\n return configs.reduce((out, source) => {\n for (const key in source) {\n if (key === 'signals') {\n // for signals, we merge the signals arrays\n // source signals take precedence over\n // existing signals with the same name\n out.signals = mergeNamed(out.signals, source.signals);\n } else {\n // otherwise, merge objects subject to recursion constraints\n // for legend block, recurse for the layout entry only\n // for style block, recurse for all properties\n // otherwise, no recursion: objects overwrite, no merging\n const r = key === 'legend' ? {\n layout: 1\n } : key === 'style' ? true : null;\n writeConfig(out, key, source[key], r);\n }\n }\n return out;\n }, {});\n}\nfunction writeConfig(output, key, value, recurse) {\n if (!isLegalKey(key)) return;\n let k, o;\n if (isObject(value) && !isArray(value)) {\n o = isObject(output[key]) ? output[key] : output[key] = {};\n for (k in value) {\n if (recurse && (recurse === true || recurse[k])) {\n writeConfig(o, k, value[k]);\n } else if (isLegalKey(k)) {\n o[k] = value[k];\n }\n }\n } else {\n output[key] = value;\n }\n}\nfunction mergeNamed(a, b) {\n if (a == null) return b;\n const map = {},\n out = [];\n function add(_) {\n if (!map[_.name]) {\n map[_.name] = 1;\n out.push(_);\n }\n }\n b.forEach(add);\n a.forEach(add);\n return out;\n}\n\nfunction peek (array) {\n return array[array.length - 1];\n}\n\nfunction toNumber (_) {\n return _ == null || _ === '' ? null : +_;\n}\n\nconst exp = sign => x => sign * Math.exp(x);\nconst log = sign => x => Math.log(sign * x);\nconst symlog = c => x => Math.sign(x) * Math.log1p(Math.abs(x / c));\nconst symexp = c => x => Math.sign(x) * Math.expm1(Math.abs(x)) * c;\nconst pow = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\nfunction pan(domain, delta, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n dd = (d1 - d0) * delta;\n return [ground(d0 - dd), ground(d1 - dd)];\n}\nfunction panLinear(domain, delta) {\n return pan(domain, delta, toNumber, identity);\n}\nfunction panLog(domain, delta) {\n var sign = Math.sign(domain[0]);\n return pan(domain, delta, log(sign), exp(sign));\n}\nfunction panPow(domain, delta, exponent) {\n return pan(domain, delta, pow(exponent), pow(1 / exponent));\n}\nfunction panSymlog(domain, delta, constant) {\n return pan(domain, delta, symlog(constant), symexp(constant));\n}\nfunction zoom(domain, anchor, scale, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n da = anchor != null ? lift(anchor) : (d0 + d1) / 2;\n return [ground(da + (d0 - da) * scale), ground(da + (d1 - da) * scale)];\n}\nfunction zoomLinear(domain, anchor, scale) {\n return zoom(domain, anchor, scale, toNumber, identity);\n}\nfunction zoomLog(domain, anchor, scale) {\n const sign = Math.sign(domain[0]);\n return zoom(domain, anchor, scale, log(sign), exp(sign));\n}\nfunction zoomPow(domain, anchor, scale, exponent) {\n return zoom(domain, anchor, scale, pow(exponent), pow(1 / exponent));\n}\nfunction zoomSymlog(domain, anchor, scale, constant) {\n return zoom(domain, anchor, scale, symlog(constant), symexp(constant));\n}\n\nfunction quarter(date) {\n return 1 + ~~(new Date(date).getMonth() / 3);\n}\nfunction utcquarter(date) {\n return 1 + ~~(new Date(date).getUTCMonth() / 3);\n}\n\nfunction array (_) {\n return _ != null ? isArray(_) ? _ : [_] : [];\n}\n\n/**\n * Span-preserving range clamp. If the span of the input range is less\n * than (max - min) and an endpoint exceeds either the min or max value,\n * the range is translated such that the span is preserved and one\n * endpoint touches the boundary of the min/max range.\n * If the span exceeds (max - min), the range [min, max] is returned.\n */\nfunction clampRange (range, min, max) {\n let lo = range[0],\n hi = range[1],\n span;\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n span = hi - lo;\n return span >= max - min ? [min, max] : [lo = Math.min(Math.max(lo, min), max - span), lo + span];\n}\n\nfunction isFunction (_) {\n return typeof _ === 'function';\n}\n\nconst DESCENDING = 'descending';\nfunction compare (fields, orders, opt) {\n opt = opt || {};\n orders = array(orders) || [];\n const ord = [],\n get = [],\n fmap = {},\n gen = opt.comparator || comparator;\n array(fields).forEach((f, i) => {\n if (f == null) return;\n ord.push(orders[i] === DESCENDING ? -1 : 1);\n get.push(f = isFunction(f) ? f : field(f, null, opt));\n (accessorFields(f) || []).forEach(_ => fmap[_] = 1);\n });\n return get.length === 0 ? null : accessor(gen(get, ord), Object.keys(fmap));\n}\nconst ascending = (u, v) => (u < v || u == null) && v != null ? -1 : (u > v || v == null) && u != null ? 1 : (v = v instanceof Date ? +v : v, u = u instanceof Date ? +u : u) !== u && v === v ? -1 : v !== v && u === u ? 1 : 0;\nconst comparator = (fields, orders) => fields.length === 1 ? compare1(fields[0], orders[0]) : compareN(fields, orders, fields.length);\nconst compare1 = (field, order) => function (a, b) {\n return ascending(field(a), field(b)) * order;\n};\nconst compareN = (fields, orders, n) => {\n orders.push(0); // pad zero for convenient lookup\n return function (a, b) {\n let f,\n c = 0,\n i = -1;\n while (c === 0 && ++i < n) {\n f = fields[i];\n c = ascending(f(a), f(b));\n }\n return c * orders[i];\n };\n};\n\nfunction constant (_) {\n return isFunction(_) ? _ : () => _;\n}\n\nfunction debounce (delay, handler) {\n let tid;\n return e => {\n if (tid) clearTimeout(tid);\n tid = setTimeout(() => (handler(e), tid = null), delay);\n };\n}\n\nfunction extend (_) {\n for (let x, k, i = 1, len = arguments.length; i < len; ++i) {\n x = arguments[i];\n for (k in x) {\n _[k] = x[k];\n }\n }\n return _;\n}\n\n/**\n * Return an array with minimum and maximum values, in the\n * form [min, max]. Ignores null, undefined, and NaN values.\n */\nfunction extent (array, f) {\n let i = 0,\n n,\n v,\n min,\n max;\n if (array && (n = array.length)) {\n if (f == null) {\n // find first valid value\n for (v = array[i]; i < n && (v == null || v !== v); v = array[++i]);\n min = max = v;\n\n // visit all other values\n for (; i < n; ++i) {\n v = array[i];\n // skip null/undefined; NaN will fail all comparisons\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n } else {\n // find first valid value\n for (v = f(array[i]); i < n && (v == null || v !== v); v = f(array[++i]));\n min = max = v;\n\n // visit all other values\n for (; i < n; ++i) {\n v = f(array[i]);\n // skip null/undefined; NaN will fail all comparisons\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n }\n }\n return [min, max];\n}\n\nfunction extentIndex (array, f) {\n const n = array.length;\n let i = -1,\n a,\n b,\n c,\n u,\n v;\n if (f == null) {\n while (++i < n) {\n b = array[i];\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n if (i === n) return [-1, -1];\n u = v = i;\n while (++i < n) {\n b = array[i];\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n } else {\n while (++i < n) {\n b = f(array[i], i, array);\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n if (i === n) return [-1, -1];\n u = v = i;\n while (++i < n) {\n b = f(array[i], i, array);\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n }\n return [u, v];\n}\n\nconst hop = Object.prototype.hasOwnProperty;\nfunction has (object, property) {\n return hop.call(object, property);\n}\n\nconst NULL = {};\nfunction fastmap (input) {\n let obj = {},\n test;\n function has$1(key) {\n return has(obj, key) && obj[key] !== NULL;\n }\n const map = {\n size: 0,\n empty: 0,\n object: obj,\n has: has$1,\n get(key) {\n return has$1(key) ? obj[key] : undefined;\n },\n set(key, value) {\n if (!has$1(key)) {\n ++map.size;\n if (obj[key] === NULL) --map.empty;\n }\n obj[key] = value;\n return this;\n },\n delete(key) {\n if (has$1(key)) {\n --map.size;\n ++map.empty;\n obj[key] = NULL;\n }\n return this;\n },\n clear() {\n map.size = map.empty = 0;\n map.object = obj = {};\n },\n test(_) {\n if (arguments.length) {\n test = _;\n return map;\n } else {\n return test;\n }\n },\n clean() {\n const next = {};\n let size = 0;\n for (const key in obj) {\n const value = obj[key];\n if (value !== NULL && (!test || !test(value))) {\n next[key] = value;\n ++size;\n }\n }\n map.size = size;\n map.empty = 0;\n map.object = obj = next;\n }\n };\n if (input) Object.keys(input).forEach(key => {\n map.set(key, input[key]);\n });\n return map;\n}\n\nfunction flush (range, value, threshold, left, right, center) {\n if (!threshold && threshold !== 0) return center;\n const t = +threshold;\n let a = range[0],\n b = peek(range),\n l;\n\n // swap endpoints if range is reversed\n if (b < a) {\n l = a;\n a = b;\n b = l;\n }\n\n // compare value to endpoints\n l = Math.abs(value - a);\n const r = Math.abs(b - value);\n\n // adjust if value is within threshold distance of endpoint\n return l < r && l <= t ? left : r <= t ? right : center;\n}\n\nfunction inherits (child, parent, members) {\n const proto = child.prototype = Object.create(parent.prototype);\n Object.defineProperty(proto, 'constructor', {\n value: child,\n writable: true,\n enumerable: true,\n configurable: true\n });\n return extend(proto, members);\n}\n\n/**\n * Predicate that returns true if the value lies within the span\n * of the given range. The left and right flags control the use\n * of inclusive (true) or exclusive (false) comparisons.\n */\nfunction inrange (value, range, left, right) {\n let r0 = range[0],\n r1 = range[range.length - 1],\n t;\n if (r0 > r1) {\n t = r0;\n r0 = r1;\n r1 = t;\n }\n left = left === undefined || left;\n right = right === undefined || right;\n return (left ? r0 <= value : r0 < value) && (right ? value <= r1 : value < r1);\n}\n\nfunction isBoolean (_) {\n return typeof _ === 'boolean';\n}\n\nfunction isDate (_) {\n return Object.prototype.toString.call(_) === '[object Date]';\n}\n\nfunction isIterable (_) {\n return _ && isFunction(_[Symbol.iterator]);\n}\n\nfunction isNumber (_) {\n return typeof _ === 'number';\n}\n\nfunction isRegExp (_) {\n return Object.prototype.toString.call(_) === '[object RegExp]';\n}\n\nfunction isString (_) {\n return typeof _ === 'string';\n}\n\nfunction key (fields, flat, opt) {\n if (fields) {\n fields = flat ? array(fields).map(f => f.replace(/\\\\(.)/g, '$1')) : array(fields);\n }\n const len = fields && fields.length,\n gen = opt && opt.get || getter,\n map = f => gen(flat ? [f] : splitAccessPath(f));\n let fn;\n if (!len) {\n fn = function () {\n return '';\n };\n } else if (len === 1) {\n const get = map(fields[0]);\n fn = function (_) {\n return '' + get(_);\n };\n } else {\n const get = fields.map(map);\n fn = function (_) {\n let s = '' + get[0](_),\n i = 0;\n while (++i < len) s += '|' + get[i](_);\n return s;\n };\n }\n return accessor(fn, fields, 'key');\n}\n\nfunction lerp (array, frac) {\n const lo = array[0],\n hi = peek(array),\n f = +frac;\n return !f ? lo : f === 1 ? hi : lo + f * (hi - lo);\n}\n\nconst DEFAULT_MAX_SIZE = 10000;\n\n// adapted from https://github.com/dominictarr/hashlru/ (MIT License)\nfunction lruCache (maxsize) {\n maxsize = +maxsize || DEFAULT_MAX_SIZE;\n let curr, prev, size;\n const clear = () => {\n curr = {};\n prev = {};\n size = 0;\n };\n const update = (key, value) => {\n if (++size > maxsize) {\n prev = curr;\n curr = {};\n size = 1;\n }\n return curr[key] = value;\n };\n clear();\n return {\n clear,\n has: key => has(curr, key) || has(prev, key),\n get: key => has(curr, key) ? curr[key] : has(prev, key) ? update(key, prev[key]) : undefined,\n set: (key, value) => has(curr, key) ? curr[key] = value : update(key, value)\n };\n}\n\nfunction merge (compare, array0, array1, output) {\n const n0 = array0.length,\n n1 = array1.length;\n if (!n1) return array0;\n if (!n0) return array1;\n const merged = output || new array0.constructor(n0 + n1);\n let i0 = 0,\n i1 = 0,\n i = 0;\n for (; i0 < n0 && i1 < n1; ++i) {\n merged[i] = compare(array0[i0], array1[i1]) > 0 ? array1[i1++] : array0[i0++];\n }\n for (; i0 < n0; ++i0, ++i) {\n merged[i] = array0[i0];\n }\n for (; i1 < n1; ++i1, ++i) {\n merged[i] = array1[i1];\n }\n return merged;\n}\n\nfunction repeat (str, reps) {\n let s = '';\n while (--reps >= 0) s += str;\n return s;\n}\n\nfunction pad (str, length, padchar, align) {\n const c = padchar || ' ',\n s = str + '',\n n = length - s.length;\n return n <= 0 ? s : align === 'left' ? repeat(c, n) + s : align === 'center' ? repeat(c, ~~(n / 2)) + s + repeat(c, Math.ceil(n / 2)) : s + repeat(c, n);\n}\n\n/**\n * Return the numerical span of an array: the difference between\n * the last and first values.\n */\nfunction span (array) {\n return array && peek(array) - array[0] || 0;\n}\n\nfunction $(x) {\n return isArray(x) ? '[' + x.map($) + ']' : isObject(x) || isString(x) ?\n // Output valid JSON and JS source strings.\n // See http://timelessrepo.com/json-isnt-a-javascript-subset\n JSON.stringify(x).replace('\\u2028', '\\\\u2028').replace('\\u2029', '\\\\u2029') : x;\n}\n\nfunction toBoolean (_) {\n return _ == null || _ === '' ? null : !_ || _ === 'false' || _ === '0' ? false : !!_;\n}\n\nconst defaultParser = _ => isNumber(_) ? _ : isDate(_) ? _ : Date.parse(_);\nfunction toDate (_, parser) {\n parser = parser || defaultParser;\n return _ == null || _ === '' ? null : parser(_);\n}\n\nfunction toString (_) {\n return _ == null || _ === '' ? null : _ + '';\n}\n\nfunction toSet (_) {\n const s = {},\n n = _.length;\n for (let i = 0; i < n; ++i) s[_[i]] = true;\n return s;\n}\n\nfunction truncate (str, length, align, ellipsis) {\n const e = ellipsis != null ? ellipsis : '\\u2026',\n s = str + '',\n n = s.length,\n l = Math.max(0, length - e.length);\n return n <= length ? s : align === 'left' ? e + s.slice(n - l) : align === 'center' ? s.slice(0, Math.ceil(l / 2)) + e + s.slice(n - ~~(l / 2)) : s.slice(0, l) + e;\n}\n\nfunction visitArray (array, filter, visitor) {\n if (array) {\n if (filter) {\n const n = array.length;\n for (let i = 0; i < n; ++i) {\n const t = filter(array[i]);\n if (t) visitor(t, i, array);\n }\n } else {\n array.forEach(visitor);\n }\n }\n}\n\nexport { Debug, Error$1 as Error, Info, None, Warn, accessor, accessorFields, accessorName, array, ascending, clampRange, compare, constant, debounce, error, extend, extent, extentIndex, falsy, fastmap, field, flush, has as hasOwnProperty, id, identity, inherits, inrange, isArray, isBoolean, isDate, isFunction, isIterable, isNumber, isObject, isRegExp, isString, key, lerp, logger, lruCache, merge, mergeConfig, one, pad, panLinear, panLog, panPow, panSymlog, peek, quarter, repeat, span, splitAccessPath, $ as stringValue, toBoolean, toDate, toNumber, toSet, toString, truncate, truthy, utcquarter, visitArray, writeConfig, zero, zoomLinear, zoomLog, zoomPow, zoomSymlog };\n","import { error, toSet, isFunction, isString, hasOwnProperty } from 'vega-util';\n\nconst RawCode = 'RawCode';\nconst Literal = 'Literal';\nconst Property = 'Property';\nconst Identifier = 'Identifier';\nconst ArrayExpression = 'ArrayExpression';\nconst BinaryExpression = 'BinaryExpression';\nconst CallExpression = 'CallExpression';\nconst ConditionalExpression = 'ConditionalExpression';\nconst LogicalExpression = 'LogicalExpression';\nconst MemberExpression = 'MemberExpression';\nconst ObjectExpression = 'ObjectExpression';\nconst UnaryExpression = 'UnaryExpression';\nfunction ASTNode(type) {\n this.type = type;\n}\n\nASTNode.prototype.visit = function (visitor) {\n let c, i, n;\n if (visitor(this)) return 1;\n\n for (c = children(this), i = 0, n = c.length; i < n; ++i) {\n if (c[i].visit(visitor)) return 1;\n }\n};\n\nfunction children(node) {\n switch (node.type) {\n case ArrayExpression:\n return node.elements;\n\n case BinaryExpression:\n case LogicalExpression:\n return [node.left, node.right];\n\n case CallExpression:\n return [node.callee].concat(node.arguments);\n\n case ConditionalExpression:\n return [node.test, node.consequent, node.alternate];\n\n case MemberExpression:\n return [node.object, node.property];\n\n case ObjectExpression:\n return node.properties;\n\n case Property:\n return [node.key, node.value];\n\n case UnaryExpression:\n return [node.argument];\n\n case Identifier:\n case Literal:\n case RawCode:\n default:\n return [];\n }\n}\n\n/*\n The following expression parser is based on Esprima (http://esprima.org/).\n Original header comment and license for Esprima is included here:\n\n Copyright (C) 2013 Ariya Hidayat \n Copyright (C) 2013 Thaddee Tyl \n Copyright (C) 2013 Mathias Bynens \n Copyright (C) 2012 Ariya Hidayat \n Copyright (C) 2012 Mathias Bynens \n Copyright (C) 2012 Joost-Wim Boekesteijn \n Copyright (C) 2012 Kris Kowal \n Copyright (C) 2012 Yusuke Suzuki \n Copyright (C) 2012 Arpad Borsos \n Copyright (C) 2011 Ariya Hidayat \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\nvar TokenName, source, index, length, lookahead;\nvar TokenBooleanLiteral = 1,\n TokenEOF = 2,\n TokenIdentifier = 3,\n TokenKeyword = 4,\n TokenNullLiteral = 5,\n TokenNumericLiteral = 6,\n TokenPunctuator = 7,\n TokenStringLiteral = 8,\n TokenRegularExpression = 9;\nTokenName = {};\nTokenName[TokenBooleanLiteral] = 'Boolean';\nTokenName[TokenEOF] = '';\nTokenName[TokenIdentifier] = 'Identifier';\nTokenName[TokenKeyword] = 'Keyword';\nTokenName[TokenNullLiteral] = 'Null';\nTokenName[TokenNumericLiteral] = 'Numeric';\nTokenName[TokenPunctuator] = 'Punctuator';\nTokenName[TokenStringLiteral] = 'String';\nTokenName[TokenRegularExpression] = 'RegularExpression';\nvar SyntaxArrayExpression = 'ArrayExpression',\n SyntaxBinaryExpression = 'BinaryExpression',\n SyntaxCallExpression = 'CallExpression',\n SyntaxConditionalExpression = 'ConditionalExpression',\n SyntaxIdentifier = 'Identifier',\n SyntaxLiteral = 'Literal',\n SyntaxLogicalExpression = 'LogicalExpression',\n SyntaxMemberExpression = 'MemberExpression',\n SyntaxObjectExpression = 'ObjectExpression',\n SyntaxProperty = 'Property',\n SyntaxUnaryExpression = 'UnaryExpression'; // Error messages should be identical to V8.\n\nvar MessageUnexpectedToken = 'Unexpected token %0',\n MessageUnexpectedNumber = 'Unexpected number',\n MessageUnexpectedString = 'Unexpected string',\n MessageUnexpectedIdentifier = 'Unexpected identifier',\n MessageUnexpectedReserved = 'Unexpected reserved word',\n MessageUnexpectedEOS = 'Unexpected end of input',\n MessageInvalidRegExp = 'Invalid regular expression',\n MessageUnterminatedRegExp = 'Invalid regular expression: missing /',\n MessageStrictOctalLiteral = 'Octal literals are not allowed in strict mode.',\n MessageStrictDuplicateProperty = 'Duplicate data property in object literal not allowed in strict mode';\nvar ILLEGAL = 'ILLEGAL',\n DISABLED = 'Disabled.'; // See also tools/generate-unicode-regex.py.\n\nvar RegexNonAsciiIdentifierStart = new RegExp('[\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0370-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0620-\\\\u064A\\\\u066E\\\\u066F\\\\u0671-\\\\u06D3\\\\u06D5\\\\u06E5\\\\u06E6\\\\u06EE\\\\u06EF\\\\u06FA-\\\\u06FC\\\\u06FF\\\\u0710\\\\u0712-\\\\u072F\\\\u074D-\\\\u07A5\\\\u07B1\\\\u07CA-\\\\u07EA\\\\u07F4\\\\u07F5\\\\u07FA\\\\u0800-\\\\u0815\\\\u081A\\\\u0824\\\\u0828\\\\u0840-\\\\u0858\\\\u08A0-\\\\u08B2\\\\u0904-\\\\u0939\\\\u093D\\\\u0950\\\\u0958-\\\\u0961\\\\u0971-\\\\u0980\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BD\\\\u09CE\\\\u09DC\\\\u09DD\\\\u09DF-\\\\u09E1\\\\u09F0\\\\u09F1\\\\u0A05-\\\\u0A0A\\\\u0A0F\\\\u0A10\\\\u0A13-\\\\u0A28\\\\u0A2A-\\\\u0A30\\\\u0A32\\\\u0A33\\\\u0A35\\\\u0A36\\\\u0A38\\\\u0A39\\\\u0A59-\\\\u0A5C\\\\u0A5E\\\\u0A72-\\\\u0A74\\\\u0A85-\\\\u0A8D\\\\u0A8F-\\\\u0A91\\\\u0A93-\\\\u0AA8\\\\u0AAA-\\\\u0AB0\\\\u0AB2\\\\u0AB3\\\\u0AB5-\\\\u0AB9\\\\u0ABD\\\\u0AD0\\\\u0AE0\\\\u0AE1\\\\u0B05-\\\\u0B0C\\\\u0B0F\\\\u0B10\\\\u0B13-\\\\u0B28\\\\u0B2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\\u0F47\\\\u0F49-\\\\u0F6C\\\\u0F88-\\\\u0F8C\\\\u1000-\\\\u102A\\\\u103F\\\\u1050-\\\\u1055\\\\u105A-\\\\u105D\\\\u1061\\\\u1065\\\\u1066\\\\u106E-\\\\u1070\\\\u1075-\\\\u1081\\\\u108E\\\\u10A0-\\\\u10C5\\\\u10C7\\\\u10CD\\\\u10D0-\\\\u10FA\\\\u10FC-\\\\u1248\\\\u124A-\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1711\\\\u1720-\\\\u1731\\\\u1740-\\\\u1751\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1780-\\\\u17B3\\\\u17D7\\\\u17DC\\\\u1820-\\\\u1877\\\\u1880-\\\\u18A8\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1950-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19C1-\\\\u19C7\\\\u1A00-\\\\u1A16\\\\u1A20-\\\\u1A54\\\\u1AA7\\\\u1B05-\\\\u1B33\\\\u1B45-\\\\u1B4B\\\\u1B83-\\\\u1BA0\\\\u1BAE\\\\u1BAF\\\\u1BBA-\\\\u1BE5\\\\u1C00-\\\\u1C23\\\\u1C4D-\\\\u1C4F\\\\u1C5A-\\\\u1C7D\\\\u1CE9-\\\\u1CEC\\\\u1CEE-\\\\u1CF1\\\\u1CF5\\\\u1CF6\\\\u1D00-\\\\u1DBF\\\\u1E00-\\\\u1F15\\\\u1F18-\\\\u1F1D\\\\u1F20-\\\\u1F45\\\\u1F48-\\\\u1F4D\\\\u1F50-\\\\u1F57\\\\u1F59\\\\u1F5B\\\\u1F5D\\\\u1F5F-\\\\u1F7D\\\\u1F80-\\\\u1FB4\\\\u1FB6-\\\\u1FBC\\\\u1FBE\\\\u1FC2-\\\\u1FC4\\\\u1FC6-\\\\u1FCC\\\\u1FD0-\\\\u1FD3\\\\u1FD6-\\\\u1FDB\\\\u1FE0-\\\\u1FEC\\\\u1FF2-\\\\u1FF4\\\\u1FF6-\\\\u1FFC\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u2102\\\\u2107\\\\u210A-\\\\u2113\\\\u2115\\\\u2119-\\\\u211D\\\\u2124\\\\u2126\\\\u2128\\\\u212A-\\\\u212D\\\\u212F-\\\\u2139\\\\u213C-\\\\u213F\\\\u2145-\\\\u2149\\\\u214E\\\\u2160-\\\\u2188\\\\u2C00-\\\\u2C2E\\\\u2C30-\\\\u2C5E\\\\u2C60-\\\\u2CE4\\\\u2CEB-\\\\u2CEE\\\\u2CF2\\\\u2CF3\\\\u2D00-\\\\u2D25\\\\u2D27\\\\u2D2D\\\\u2D30-\\\\u2D67\\\\u2D6F\\\\u2D80-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2E2F\\\\u3005-\\\\u3007\\\\u3021-\\\\u3029\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\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13-\\\\uFB17\\\\uFB1D\\\\uFB1F-\\\\uFB28\\\\uFB2A-\\\\uFB36\\\\uFB38-\\\\uFB3C\\\\uFB3E\\\\uFB40\\\\uFB41\\\\uFB43\\\\uFB44\\\\uFB46-\\\\uFBB1\\\\uFBD3-\\\\uFD3D\\\\uFD50-\\\\uFD8F\\\\uFD92-\\\\uFDC7\\\\uFDF0-\\\\uFDFB\\\\uFE70-\\\\uFE74\\\\uFE76-\\\\uFEFC\\\\uFF21-\\\\uFF3A\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]'),\n // eslint-disable-next-line no-misleading-character-class\nRegexNonAsciiIdentifierPart = new RegExp('[\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0300-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u0483-\\\\u0487\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u0591-\\\\u05BD\\\\u05BF\\\\u05C1\\\\u05C2\\\\u05C4\\\\u05C5\\\\u05C7\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0610-\\\\u061A\\\\u0620-\\\\u0669\\\\u066E-\\\\u06D3\\\\u06D5-\\\\u06DC\\\\u06DF-\\\\u06E8\\\\u06EA-\\\\u06FC\\\\u06FF\\\\u0710-\\\\u074A\\\\u074D-\\\\u07B1\\\\u07C0-\\\\u07F5\\\\u07FA\\\\u0800-\\\\u082D\\\\u0840-\\\\u085B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0DDF\\\\u0DE6-\\\\u0DEF\\\\u0DF2\\\\u0DF3\\\\u0E01-\\\\u0E3A\\\\u0E40-\\\\u0E4E\\\\u0E50-\\\\u0E59\\\\u0E81\\\\u0E82\\\\u0E84\\\\u0E87\\\\u0E88\\\\u0E8A\\\\u0E8D\\\\u0E94-\\\\u0E97\\\\u0E99-\\\\u0E9F\\\\u0EA1-\\\\u0EA3\\\\u0EA5\\\\u0EA7\\\\u0EAA\\\\u0EAB\\\\u0EAD-\\\\u0EB9\\\\u0EBB-\\\\u0EBD\\\\u0EC0-\\\\u0EC4\\\\u0EC6\\\\u0EC8-\\\\u0ECD\\\\u0ED0-\\\\u0ED9\\\\u0EDC-\\\\u0EDF\\\\u0F00\\\\u0F18\\\\u0F19\\\\u0F20-\\\\u0F29\\\\u0F35\\\\u0F37\\\\u0F39\\\\u0F3E-\\\\u0F47\\\\u0F49-\\\\u0F6C\\\\u0F71-\\\\u0F84\\\\u0F86-\\\\u0F97\\\\u0F99-\\\\u0FBC\\\\u0FC6\\\\u1000-\\\\u1049\\\\u1050-\\\\u109D\\\\u10A0-\\\\u10C5\\\\u10C7\\\\u10CD\\\\u10D0-\\\\u10FA\\\\u10FC-\\\\u1248\\\\u124A-\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u135D-\\\\u135F\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1714\\\\u1720-\\\\u1734\\\\u1740-\\\\u1753\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1772\\\\u1773\\\\u1780-\\\\u17D3\\\\u17D7\\\\u17DC\\\\u17DD\\\\u17E0-\\\\u17E9\\\\u180B-\\\\u180D\\\\u1810-\\\\u1819\\\\u1820-\\\\u1877\\\\u1880-\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1920-\\\\u192B\\\\u1930-\\\\u193B\\\\u1946-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19B0-\\\\u19C9\\\\u19D0-\\\\u19D9\\\\u1A00-\\\\u1A1B\\\\u1A20-\\\\u1A5E\\\\u1A60-\\\\u1A7C\\\\u1A7F-\\\\u1A89\\\\u1A90-\\\\u1A99\\\\u1AA7\\\\u1AB0-\\\\u1ABD\\\\u1B00-\\\\u1B4B\\\\u1B50-\\\\u1B59\\\\u1B6B-\\\\u1B73\\\\u1B80-\\\\u1BF3\\\\u1C00-\\\\u1C37\\\\u1C40-\\\\u1C49\\\\u1C4D-\\\\u1C7D\\\\u1CD0-\\\\u1CD2\\\\u1CD4-\\\\u1CF6\\\\u1CF8\\\\u1CF9\\\\u1D00-\\\\u1DF5\\\\u1DFC-\\\\u1F15\\\\u1F18-\\\\u1F1D\\\\u1F20-\\\\u1F45\\\\u1F48-\\\\u1F4D\\\\u1F50-\\\\u1F57\\\\u1F59\\\\u1F5B\\\\u1F5D\\\\u1F5F-\\\\u1F7D\\\\u1F80-\\\\u1FB4\\\\u1FB6-\\\\u1FBC\\\\u1FBE\\\\u1FC2-\\\\u1FC4\\\\u1FC6-\\\\u1FCC\\\\u1FD0-\\\\u1FD3\\\\u1FD6-\\\\u1FDB\\\\u1FE0-\\\\u1FEC\\\\u1FF2-\\\\u1FF4\\\\u1FF6-\\\\u1FFC\\\\u200C\\\\u200D\\\\u203F\\\\u2040\\\\u2054\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u20D0-\\\\u20DC\\\\u20E1\\\\u20E5-\\\\u20F0\\\\u2102\\\\u2107\\\\u210A-\\\\u2113\\\\u2115\\\\u2119-\\\\u211D\\\\u2124\\\\u2126\\\\u2128\\\\u212A-\\\\u212D\\\\u212F-\\\\u2139\\\\u213C-\\\\u213F\\\\u2145-\\\\u2149\\\\u214E\\\\u2160-\\\\u2188\\\\u2C00-\\\\u2C2E\\\\u2C30-\\\\u2C5E\\\\u2C60-\\\\u2CE4\\\\u2CEB-\\\\u2CF3\\\\u2D00-\\\\u2D25\\\\u2D27\\\\u2D2D\\\\u2D30-\\\\u2D67\\\\u2D6F\\\\u2D7F-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2DE0-\\\\u2DFF\\\\u2E2F\\\\u3005-\\\\u3007\\\\u3021-\\\\u302F\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u3099\\\\u309A\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FCC\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA62B\\\\uA640-\\\\uA66F\\\\uA674-\\\\uA67D\\\\uA67F-\\\\uA69D\\\\uA69F-\\\\uA6F1\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B-\\\\uA78E\\\\uA790-\\\\uA7AD\\\\uA7B0\\\\uA7B1\\\\uA7F7-\\\\uA827\\\\uA840-\\\\uA873\\\\uA880-\\\\uA8C4\\\\uA8D0-\\\\uA8D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FDA-\\\\uFFDC]'); // Ensure the condition is true, otherwise throw an error.\n// This is only to have a better contract semantic, i.e. another safety net\n// to catch a logic error. The condition shall be fulfilled in normal case.\n// Do NOT use this to enforce a certain condition on any user input.\n\nfunction assert(condition, message) {\n /* istanbul ignore next */\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n}\n\nfunction isDecimalDigit(ch) {\n return ch >= 0x30 && ch <= 0x39; // 0..9\n}\n\nfunction isHexDigit(ch) {\n return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;\n}\n\nfunction isOctalDigit(ch) {\n return '01234567'.indexOf(ch) >= 0;\n} // 7.2 White Space\n\n\nfunction isWhiteSpace(ch) {\n return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0;\n} // 7.3 Line Terminators\n\n\nfunction isLineTerminator(ch) {\n return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;\n} // 7.6 Identifier Names and Identifiers\n\n\nfunction isIdentifierStart(ch) {\n return ch === 0x24 || ch === 0x5F || // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A || // A..Z\n ch >= 0x61 && ch <= 0x7A || // a..z\n ch === 0x5C || // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierStart.test(String.fromCharCode(ch));\n}\n\nfunction isIdentifierPart(ch) {\n return ch === 0x24 || ch === 0x5F || // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A || // A..Z\n ch >= 0x61 && ch <= 0x7A || // a..z\n ch >= 0x30 && ch <= 0x39 || // 0..9\n ch === 0x5C || // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierPart.test(String.fromCharCode(ch));\n} // 7.6.1.1 Keywords\n\n\nconst keywords = {\n 'if': 1,\n 'in': 1,\n 'do': 1,\n 'var': 1,\n 'for': 1,\n 'new': 1,\n 'try': 1,\n 'let': 1,\n 'this': 1,\n 'else': 1,\n 'case': 1,\n 'void': 1,\n 'with': 1,\n 'enum': 1,\n 'while': 1,\n 'break': 1,\n 'catch': 1,\n 'throw': 1,\n 'const': 1,\n 'yield': 1,\n 'class': 1,\n 'super': 1,\n 'return': 1,\n 'typeof': 1,\n 'delete': 1,\n 'switch': 1,\n 'export': 1,\n 'import': 1,\n 'public': 1,\n 'static': 1,\n 'default': 1,\n 'finally': 1,\n 'extends': 1,\n 'package': 1,\n 'private': 1,\n 'function': 1,\n 'continue': 1,\n 'debugger': 1,\n 'interface': 1,\n 'protected': 1,\n 'instanceof': 1,\n 'implements': 1\n};\n\nfunction skipComment() {\n while (index < length) {\n const ch = source.charCodeAt(index);\n\n if (isWhiteSpace(ch) || isLineTerminator(ch)) {\n ++index;\n } else {\n break;\n }\n }\n}\n\nfunction scanHexEscape(prefix) {\n var i,\n len,\n ch,\n code = 0;\n len = prefix === 'u' ? 4 : 2;\n\n for (i = 0; i < len; ++i) {\n if (index < length && isHexDigit(source[index])) {\n ch = source[index++];\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n } else {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n\n return String.fromCharCode(code);\n}\n\nfunction scanUnicodeCodePointEscape() {\n var ch, code, cu1, cu2;\n ch = source[index];\n code = 0; // At least, one hex digit is required.\n\n if (ch === '}') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n while (index < length) {\n ch = source[index++];\n\n if (!isHexDigit(ch)) {\n break;\n }\n\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n }\n\n if (code > 0x10FFFF || ch !== '}') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } // UTF-16 Encoding\n\n\n if (code <= 0xFFFF) {\n return String.fromCharCode(code);\n }\n\n cu1 = (code - 0x10000 >> 10) + 0xD800;\n cu2 = (code - 0x10000 & 1023) + 0xDC00;\n return String.fromCharCode(cu1, cu2);\n}\n\nfunction getEscapedIdentifier() {\n var ch, id;\n ch = source.charCodeAt(index++);\n id = String.fromCharCode(ch); // '\\u' (U+005C, U+0075) denotes an escaped character.\n\n if (ch === 0x5C) {\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n ++index;\n ch = scanHexEscape('u');\n\n if (!ch || ch === '\\\\' || !isIdentifierStart(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n id = ch;\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n\n if (!isIdentifierPart(ch)) {\n break;\n }\n\n ++index;\n id += String.fromCharCode(ch); // '\\u' (U+005C, U+0075) denotes an escaped character.\n\n if (ch === 0x5C) {\n id = id.substr(0, id.length - 1);\n\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n ++index;\n ch = scanHexEscape('u');\n\n if (!ch || ch === '\\\\' || !isIdentifierPart(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n id += ch;\n }\n }\n\n return id;\n}\n\nfunction getIdentifier() {\n var start, ch;\n start = index++;\n\n while (index < length) {\n ch = source.charCodeAt(index);\n\n if (ch === 0x5C) {\n // Blackslash (U+005C) marks Unicode escape sequence.\n index = start;\n return getEscapedIdentifier();\n }\n\n if (isIdentifierPart(ch)) {\n ++index;\n } else {\n break;\n }\n }\n\n return source.slice(start, index);\n}\n\nfunction scanIdentifier() {\n var start, id, type;\n start = index; // Backslash (U+005C) starts an escaped character.\n\n id = source.charCodeAt(index) === 0x5C ? getEscapedIdentifier() : getIdentifier(); // There is no keyword or literal with only one character.\n // Thus, it must be an identifier.\n\n if (id.length === 1) {\n type = TokenIdentifier;\n } else if (keywords.hasOwnProperty(id)) {\n // eslint-disable-line no-prototype-builtins\n type = TokenKeyword;\n } else if (id === 'null') {\n type = TokenNullLiteral;\n } else if (id === 'true' || id === 'false') {\n type = TokenBooleanLiteral;\n } else {\n type = TokenIdentifier;\n }\n\n return {\n type: type,\n value: id,\n start: start,\n end: index\n };\n} // 7.7 Punctuators\n\n\nfunction scanPunctuator() {\n var start = index,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2,\n ch3,\n ch4;\n\n switch (code) {\n // Check for most common single-character punctuators.\n case 0x2E: // . dot\n\n case 0x28: // ( open bracket\n\n case 0x29: // ) close bracket\n\n case 0x3B: // ; semicolon\n\n case 0x2C: // , comma\n\n case 0x7B: // { open curly brace\n\n case 0x7D: // } close curly brace\n\n case 0x5B: // [\n\n case 0x5D: // ]\n\n case 0x3A: // :\n\n case 0x3F: // ?\n\n case 0x7E:\n // ~\n ++index;\n return {\n type: TokenPunctuator,\n value: String.fromCharCode(code),\n start: start,\n end: index\n };\n\n default:\n code2 = source.charCodeAt(index + 1); // '=' (U+003D) marks an assignment or comparison operator.\n\n if (code2 === 0x3D) {\n switch (code) {\n case 0x2B: // +\n\n case 0x2D: // -\n\n case 0x2F: // /\n\n case 0x3C: // <\n\n case 0x3E: // >\n\n case 0x5E: // ^\n\n case 0x7C: // |\n\n case 0x25: // %\n\n case 0x26: // &\n\n case 0x2A:\n // *\n index += 2;\n return {\n type: TokenPunctuator,\n value: String.fromCharCode(code) + String.fromCharCode(code2),\n start: start,\n end: index\n };\n\n case 0x21: // !\n\n case 0x3D:\n // =\n index += 2; // !== and ===\n\n if (source.charCodeAt(index) === 0x3D) {\n ++index;\n }\n\n return {\n type: TokenPunctuator,\n value: source.slice(start, index),\n start: start,\n end: index\n };\n }\n }\n\n } // 4-character punctuator: >>>=\n\n\n ch4 = source.substr(index, 4);\n\n if (ch4 === '>>>=') {\n index += 4;\n return {\n type: TokenPunctuator,\n value: ch4,\n start: start,\n end: index\n };\n } // 3-character punctuators: === !== >>> <<= >>=\n\n\n ch3 = ch4.substr(0, 3);\n\n if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {\n index += 3;\n return {\n type: TokenPunctuator,\n value: ch3,\n start: start,\n end: index\n };\n } // Other 2-character punctuators: ++ -- << >> && ||\n\n\n ch2 = ch3.substr(0, 2);\n\n if (ch1 === ch2[1] && '+-<>&|'.indexOf(ch1) >= 0 || ch2 === '=>') {\n index += 2;\n return {\n type: TokenPunctuator,\n value: ch2,\n start: start,\n end: index\n };\n }\n\n if (ch2 === '//') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } // 1-character punctuators: < > = ! + - * % & | ^ /\n\n\n if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n ++index;\n return {\n type: TokenPunctuator,\n value: ch1,\n start: start,\n end: index\n };\n }\n\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n} // 7.8.3 Numeric Literals\n\n\nfunction scanHexLiteral(start) {\n let number = '';\n\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n\n number += source[index++];\n }\n\n if (number.length === 0) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenNumericLiteral,\n value: parseInt('0x' + number, 16),\n start: start,\n end: index\n };\n}\n\nfunction scanOctalLiteral(start) {\n let number = '0' + source[index++];\n\n while (index < length) {\n if (!isOctalDigit(source[index])) {\n break;\n }\n\n number += source[index++];\n }\n\n if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenNumericLiteral,\n value: parseInt(number, 8),\n octal: true,\n start: start,\n end: index\n };\n}\n\nfunction scanNumericLiteral() {\n var number, start, ch;\n ch = source[index];\n assert(isDecimalDigit(ch.charCodeAt(0)) || ch === '.', 'Numeric literal must start with a decimal digit or a decimal point');\n start = index;\n number = '';\n\n if (ch !== '.') {\n number = source[index++];\n ch = source[index]; // Hex number starts with '0x'.\n // Octal number starts with '0'.\n\n if (number === '0') {\n if (ch === 'x' || ch === 'X') {\n ++index;\n return scanHexLiteral(start);\n }\n\n if (isOctalDigit(ch)) {\n return scanOctalLiteral(start);\n } // decimal number starts with '0' such as '09' is illegal.\n\n\n if (ch && isDecimalDigit(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n\n ch = source[index];\n }\n\n if (ch === '.') {\n number += source[index++];\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n\n ch = source[index];\n }\n\n if (ch === 'e' || ch === 'E') {\n number += source[index++];\n ch = source[index];\n\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n\n if (isDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenNumericLiteral,\n value: parseFloat(number),\n start: start,\n end: index\n };\n} // 7.8.4 String Literals\n\n\nfunction scanStringLiteral() {\n var str = '',\n quote,\n start,\n ch,\n code,\n octal = false;\n quote = source[index];\n assert(quote === '\\'' || quote === '\"', 'String literal must starts with a quote');\n start = index;\n ++index;\n\n while (index < length) {\n ch = source[index++];\n\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n\n if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'u':\n case 'x':\n if (source[index] === '{') {\n ++index;\n str += scanUnicodeCodePointEscape();\n } else {\n str += scanHexEscape(ch);\n }\n\n break;\n\n case 'n':\n str += '\\n';\n break;\n\n case 'r':\n str += '\\r';\n break;\n\n case 't':\n str += '\\t';\n break;\n\n case 'b':\n str += '\\b';\n break;\n\n case 'f':\n str += '\\f';\n break;\n\n case 'v':\n str += '\\x0B';\n break;\n\n default:\n if (isOctalDigit(ch)) {\n code = '01234567'.indexOf(ch); // \\0 is not octal escape sequence\n\n if (code !== 0) {\n octal = true;\n }\n\n if (index < length && isOctalDigit(source[index])) {\n octal = true;\n code = code * 8 + '01234567'.indexOf(source[index++]); // 3 digits are only allowed when string starts\n // with 0, 1, 2, 3\n\n if ('0123'.indexOf(ch) >= 0 && index < length && isOctalDigit(source[index])) {\n code = code * 8 + '01234567'.indexOf(source[index++]);\n }\n }\n\n str += String.fromCharCode(code);\n } else {\n str += ch;\n }\n\n break;\n }\n } else {\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n\n if (quote !== '') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenStringLiteral,\n value: str,\n octal: octal,\n start: start,\n end: index\n };\n}\n\nfunction testRegExp(pattern, flags) {\n let tmp = pattern;\n\n if (flags.indexOf('u') >= 0) {\n // Replace each astral symbol and every Unicode code point\n // escape sequence with a single ASCII symbol to avoid throwing on\n // regular expressions that are only valid in combination with the\n // `/u` flag.\n // Note: replacing with the ASCII symbol `x` might cause false\n // negatives in unlikely scenarios. For example, `[\\u{61}-b]` is a\n // perfectly valid pattern that is equivalent to `[a-b]`, but it\n // would be replaced by `[x-b]` which throws an error.\n tmp = tmp.replace(/\\\\u\\{([0-9a-fA-F]+)\\}/g, ($0, $1) => {\n if (parseInt($1, 16) <= 0x10FFFF) {\n return 'x';\n }\n\n throwError({}, MessageInvalidRegExp);\n }).replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g, 'x');\n } // First, detect invalid regular expressions.\n\n\n try {\n new RegExp(tmp);\n } catch (e) {\n throwError({}, MessageInvalidRegExp);\n } // Return a regular expression object for this pattern-flag pair, or\n // `null` in case the current environment doesn't support the flags it\n // uses.\n\n\n try {\n return new RegExp(pattern, flags);\n } catch (exception) {\n return null;\n }\n}\n\nfunction scanRegExpBody() {\n var ch, str, classMarker, terminated, body;\n ch = source[index];\n assert(ch === '/', 'Regular expression literal must start with a slash');\n str = source[index++];\n classMarker = false;\n terminated = false;\n\n while (index < length) {\n ch = source[index++];\n str += ch;\n\n if (ch === '\\\\') {\n ch = source[index++]; // ECMA-262 7.8.5\n\n if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, MessageUnterminatedRegExp);\n }\n\n str += ch;\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, MessageUnterminatedRegExp);\n } else if (classMarker) {\n if (ch === ']') {\n classMarker = false;\n }\n } else {\n if (ch === '/') {\n terminated = true;\n break;\n } else if (ch === '[') {\n classMarker = true;\n }\n }\n }\n\n if (!terminated) {\n throwError({}, MessageUnterminatedRegExp);\n } // Exclude leading and trailing slash.\n\n\n body = str.substr(1, str.length - 2);\n return {\n value: body,\n literal: str\n };\n}\n\nfunction scanRegExpFlags() {\n var ch, str, flags;\n str = '';\n flags = '';\n\n while (index < length) {\n ch = source[index];\n\n if (!isIdentifierPart(ch.charCodeAt(0))) {\n break;\n }\n\n ++index;\n\n if (ch === '\\\\' && index < length) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } else {\n flags += ch;\n str += ch;\n }\n }\n\n if (flags.search(/[^gimuy]/g) >= 0) {\n throwError({}, MessageInvalidRegExp, flags);\n }\n\n return {\n value: flags,\n literal: str\n };\n}\n\nfunction scanRegExp() {\n var start, body, flags, value;\n lookahead = null;\n skipComment();\n start = index;\n body = scanRegExpBody();\n flags = scanRegExpFlags();\n value = testRegExp(body.value, flags.value);\n return {\n literal: body.literal + flags.literal,\n value: value,\n regex: {\n pattern: body.value,\n flags: flags.value\n },\n start: start,\n end: index\n };\n}\n\nfunction isIdentifierName(token) {\n return token.type === TokenIdentifier || token.type === TokenKeyword || token.type === TokenBooleanLiteral || token.type === TokenNullLiteral;\n}\n\nfunction advance() {\n skipComment();\n\n if (index >= length) {\n return {\n type: TokenEOF,\n start: index,\n end: index\n };\n }\n\n const ch = source.charCodeAt(index);\n\n if (isIdentifierStart(ch)) {\n return scanIdentifier();\n } // Very common: ( and ) and ;\n\n\n if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {\n return scanPunctuator();\n } // String literal starts with single quote (U+0027) or double quote (U+0022).\n\n\n if (ch === 0x27 || ch === 0x22) {\n return scanStringLiteral();\n } // Dot (.) U+002E can also start a floating-point number, hence the need\n // to check the next character.\n\n\n if (ch === 0x2E) {\n if (isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNumericLiteral();\n }\n\n return scanPunctuator();\n }\n\n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n\n return scanPunctuator();\n}\n\nfunction lex() {\n const token = lookahead;\n index = token.end;\n lookahead = advance();\n index = token.end;\n return token;\n}\n\nfunction peek() {\n const pos = index;\n lookahead = advance();\n index = pos;\n}\n\nfunction finishArrayExpression(elements) {\n const node = new ASTNode(SyntaxArrayExpression);\n node.elements = elements;\n return node;\n}\n\nfunction finishBinaryExpression(operator, left, right) {\n const node = new ASTNode(operator === '||' || operator === '&&' ? SyntaxLogicalExpression : SyntaxBinaryExpression);\n node.operator = operator;\n node.left = left;\n node.right = right;\n return node;\n}\n\nfunction finishCallExpression(callee, args) {\n const node = new ASTNode(SyntaxCallExpression);\n node.callee = callee;\n node.arguments = args;\n return node;\n}\n\nfunction finishConditionalExpression(test, consequent, alternate) {\n const node = new ASTNode(SyntaxConditionalExpression);\n node.test = test;\n node.consequent = consequent;\n node.alternate = alternate;\n return node;\n}\n\nfunction finishIdentifier(name) {\n const node = new ASTNode(SyntaxIdentifier);\n node.name = name;\n return node;\n}\n\nfunction finishLiteral(token) {\n const node = new ASTNode(SyntaxLiteral);\n node.value = token.value;\n node.raw = source.slice(token.start, token.end);\n\n if (token.regex) {\n if (node.raw === '//') {\n node.raw = '/(?:)/';\n }\n\n node.regex = token.regex;\n }\n\n return node;\n}\n\nfunction finishMemberExpression(accessor, object, property) {\n const node = new ASTNode(SyntaxMemberExpression);\n node.computed = accessor === '[';\n node.object = object;\n node.property = property;\n if (!node.computed) property.member = true;\n return node;\n}\n\nfunction finishObjectExpression(properties) {\n const node = new ASTNode(SyntaxObjectExpression);\n node.properties = properties;\n return node;\n}\n\nfunction finishProperty(kind, key, value) {\n const node = new ASTNode(SyntaxProperty);\n node.key = key;\n node.value = value;\n node.kind = kind;\n return node;\n}\n\nfunction finishUnaryExpression(operator, argument) {\n const node = new ASTNode(SyntaxUnaryExpression);\n node.operator = operator;\n node.argument = argument;\n node.prefix = true;\n return node;\n} // Throw an exception\n\n\nfunction throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(/%(\\d)/g, (whole, index) => {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n });\n error = new Error(msg);\n error.index = index;\n error.description = msg;\n throw error;\n} // Throw an exception because of the token.\n\n\nfunction throwUnexpected(token) {\n if (token.type === TokenEOF) {\n throwError(token, MessageUnexpectedEOS);\n }\n\n if (token.type === TokenNumericLiteral) {\n throwError(token, MessageUnexpectedNumber);\n }\n\n if (token.type === TokenStringLiteral) {\n throwError(token, MessageUnexpectedString);\n }\n\n if (token.type === TokenIdentifier) {\n throwError(token, MessageUnexpectedIdentifier);\n }\n\n if (token.type === TokenKeyword) {\n throwError(token, MessageUnexpectedReserved);\n } // BooleanLiteral, NullLiteral, or Punctuator.\n\n\n throwError(token, MessageUnexpectedToken, token.value);\n} // Expect the next token to match the specified punctuator.\n// If not, an exception will be thrown.\n\n\nfunction expect(value) {\n const token = lex();\n\n if (token.type !== TokenPunctuator || token.value !== value) {\n throwUnexpected(token);\n }\n} // Return true if the next token matches the specified punctuator.\n\n\nfunction match(value) {\n return lookahead.type === TokenPunctuator && lookahead.value === value;\n} // Return true if the next token matches the specified keyword\n\n\nfunction matchKeyword(keyword) {\n return lookahead.type === TokenKeyword && lookahead.value === keyword;\n} // 11.1.4 Array Initialiser\n\n\nfunction parseArrayInitialiser() {\n const elements = [];\n index = lookahead.start;\n expect('[');\n\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elements.push(parseConditionalExpression());\n\n if (!match(']')) {\n expect(',');\n }\n }\n }\n\n lex();\n return finishArrayExpression(elements);\n} // 11.1.5 Object Initialiser\n\n\nfunction parseObjectPropertyKey() {\n index = lookahead.start;\n const token = lex(); // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n\n if (token.type === TokenStringLiteral || token.type === TokenNumericLiteral) {\n if (token.octal) {\n throwError(token, MessageStrictOctalLiteral);\n }\n\n return finishLiteral(token);\n }\n\n return finishIdentifier(token.value);\n}\n\nfunction parseObjectProperty() {\n var token, key, id, value;\n index = lookahead.start;\n token = lookahead;\n\n if (token.type === TokenIdentifier) {\n id = parseObjectPropertyKey();\n expect(':');\n value = parseConditionalExpression();\n return finishProperty('init', id, value);\n }\n\n if (token.type === TokenEOF || token.type === TokenPunctuator) {\n throwUnexpected(token);\n } else {\n key = parseObjectPropertyKey();\n expect(':');\n value = parseConditionalExpression();\n return finishProperty('init', key, value);\n }\n}\n\nfunction parseObjectInitialiser() {\n var properties = [],\n property,\n name,\n key,\n map = {},\n toString = String;\n index = lookahead.start;\n expect('{');\n\n while (!match('}')) {\n property = parseObjectProperty();\n\n if (property.key.type === SyntaxIdentifier) {\n name = property.key.name;\n } else {\n name = toString(property.key.value);\n }\n\n key = '$' + name;\n\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n throwError({}, MessageStrictDuplicateProperty);\n } else {\n map[key] = true;\n }\n\n properties.push(property);\n\n if (!match('}')) {\n expect(',');\n }\n }\n\n expect('}');\n return finishObjectExpression(properties);\n} // 11.1.6 The Grouping Operator\n\n\nfunction parseGroupExpression() {\n expect('(');\n const expr = parseExpression();\n expect(')');\n return expr;\n} // 11.1 Primary Expressions\n\n\nconst legalKeywords = {\n 'if': 1\n};\n\nfunction parsePrimaryExpression() {\n var type, token, expr;\n\n if (match('(')) {\n return parseGroupExpression();\n }\n\n if (match('[')) {\n return parseArrayInitialiser();\n }\n\n if (match('{')) {\n return parseObjectInitialiser();\n }\n\n type = lookahead.type;\n index = lookahead.start;\n\n if (type === TokenIdentifier || legalKeywords[lookahead.value]) {\n expr = finishIdentifier(lex().value);\n } else if (type === TokenStringLiteral || type === TokenNumericLiteral) {\n if (lookahead.octal) {\n throwError(lookahead, MessageStrictOctalLiteral);\n }\n\n expr = finishLiteral(lex());\n } else if (type === TokenKeyword) {\n throw new Error(DISABLED);\n } else if (type === TokenBooleanLiteral) {\n token = lex();\n token.value = token.value === 'true';\n expr = finishLiteral(token);\n } else if (type === TokenNullLiteral) {\n token = lex();\n token.value = null;\n expr = finishLiteral(token);\n } else if (match('/') || match('/=')) {\n expr = finishLiteral(scanRegExp());\n peek();\n } else {\n throwUnexpected(lex());\n }\n\n return expr;\n} // 11.2 Left-Hand-Side Expressions\n\n\nfunction parseArguments() {\n const args = [];\n expect('(');\n\n if (!match(')')) {\n while (index < length) {\n args.push(parseConditionalExpression());\n\n if (match(')')) {\n break;\n }\n\n expect(',');\n }\n }\n\n expect(')');\n return args;\n}\n\nfunction parseNonComputedProperty() {\n index = lookahead.start;\n const token = lex();\n\n if (!isIdentifierName(token)) {\n throwUnexpected(token);\n }\n\n return finishIdentifier(token.value);\n}\n\nfunction parseNonComputedMember() {\n expect('.');\n return parseNonComputedProperty();\n}\n\nfunction parseComputedMember() {\n expect('[');\n const expr = parseExpression();\n expect(']');\n return expr;\n}\n\nfunction parseLeftHandSideExpressionAllowCall() {\n var expr, args, property;\n expr = parsePrimaryExpression();\n\n for (;;) {\n if (match('.')) {\n property = parseNonComputedMember();\n expr = finishMemberExpression('.', expr, property);\n } else if (match('(')) {\n args = parseArguments();\n expr = finishCallExpression(expr, args);\n } else if (match('[')) {\n property = parseComputedMember();\n expr = finishMemberExpression('[', expr, property);\n } else {\n break;\n }\n }\n\n return expr;\n} // 11.3 Postfix Expressions\n\n\nfunction parsePostfixExpression() {\n const expr = parseLeftHandSideExpressionAllowCall();\n\n if (lookahead.type === TokenPunctuator) {\n if (match('++') || match('--')) {\n throw new Error(DISABLED);\n }\n }\n\n return expr;\n} // 11.4 Unary Operators\n\n\nfunction parseUnaryExpression() {\n var token, expr;\n\n if (lookahead.type !== TokenPunctuator && lookahead.type !== TokenKeyword) {\n expr = parsePostfixExpression();\n } else if (match('++') || match('--')) {\n throw new Error(DISABLED);\n } else if (match('+') || match('-') || match('~') || match('!')) {\n token = lex();\n expr = parseUnaryExpression();\n expr = finishUnaryExpression(token.value, expr);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n throw new Error(DISABLED);\n } else {\n expr = parsePostfixExpression();\n }\n\n return expr;\n}\n\nfunction binaryPrecedence(token) {\n let prec = 0;\n\n if (token.type !== TokenPunctuator && token.type !== TokenKeyword) {\n return 0;\n }\n\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n\n case '&&':\n prec = 2;\n break;\n\n case '|':\n prec = 3;\n break;\n\n case '^':\n prec = 4;\n break;\n\n case '&':\n prec = 5;\n break;\n\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n case 'in':\n prec = 7;\n break;\n\n case '<<':\n case '>>':\n case '>>>':\n prec = 8;\n break;\n\n case '+':\n case '-':\n prec = 9;\n break;\n\n case '*':\n case '/':\n case '%':\n prec = 11;\n break;\n }\n\n return prec;\n} // 11.5 Multiplicative Operators\n// 11.6 Additive Operators\n// 11.7 Bitwise Shift Operators\n// 11.8 Relational Operators\n// 11.9 Equality Operators\n// 11.10 Binary Bitwise Operators\n// 11.11 Binary Logical Operators\n\n\nfunction parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n marker = lookahead;\n left = parseUnaryExpression();\n token = lookahead;\n prec = binaryPrecedence(token);\n\n if (prec === 0) {\n return left;\n }\n\n token.prec = prec;\n lex();\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead)) > 0) {\n // Reduce: make a binary expression from the three topmost entries.\n while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = finishBinaryExpression(operator, left, right);\n stack.push(expr);\n } // Shift.\n\n\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n } // Final reduce to clean-up the stack.\n\n\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n\n while (i > 1) {\n markers.pop();\n expr = finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n} // 11.12 Conditional Operator\n\n\nfunction parseConditionalExpression() {\n var expr, consequent, alternate;\n expr = parseBinaryExpression();\n\n if (match('?')) {\n lex();\n consequent = parseConditionalExpression();\n expect(':');\n alternate = parseConditionalExpression();\n expr = finishConditionalExpression(expr, consequent, alternate);\n }\n\n return expr;\n} // 11.14 Comma Operator\n\n\nfunction parseExpression() {\n const expr = parseConditionalExpression();\n\n if (match(',')) {\n throw new Error(DISABLED); // no sequence expressions\n }\n\n return expr;\n}\n\nfunction parser (code) {\n source = code;\n index = 0;\n length = source.length;\n lookahead = null;\n peek();\n const expr = parseExpression();\n\n if (lookahead.type !== TokenEOF) {\n throw new Error('Unexpect token after expression.');\n }\n\n return expr;\n}\n\nvar Constants = {\n NaN: 'NaN',\n E: 'Math.E',\n LN2: 'Math.LN2',\n LN10: 'Math.LN10',\n LOG2E: 'Math.LOG2E',\n LOG10E: 'Math.LOG10E',\n PI: 'Math.PI',\n SQRT1_2: 'Math.SQRT1_2',\n SQRT2: 'Math.SQRT2',\n MIN_VALUE: 'Number.MIN_VALUE',\n MAX_VALUE: 'Number.MAX_VALUE'\n};\n\nfunction Functions (codegen) {\n function fncall(name, args, cast, type) {\n let obj = codegen(args[0]);\n\n if (cast) {\n obj = cast + '(' + obj + ')';\n if (cast.lastIndexOf('new ', 0) === 0) obj = '(' + obj + ')';\n }\n\n return obj + '.' + name + (type < 0 ? '' : type === 0 ? '()' : '(' + args.slice(1).map(codegen).join(',') + ')');\n }\n\n function fn(name, cast, type) {\n return args => fncall(name, args, cast, type);\n }\n\n const DATE = 'new Date',\n STRING = 'String',\n REGEXP = 'RegExp';\n return {\n // MATH functions\n isNaN: 'Number.isNaN',\n isFinite: 'Number.isFinite',\n abs: 'Math.abs',\n acos: 'Math.acos',\n asin: 'Math.asin',\n atan: 'Math.atan',\n atan2: 'Math.atan2',\n ceil: 'Math.ceil',\n cos: 'Math.cos',\n exp: 'Math.exp',\n floor: 'Math.floor',\n log: 'Math.log',\n max: 'Math.max',\n min: 'Math.min',\n pow: 'Math.pow',\n random: 'Math.random',\n round: 'Math.round',\n sin: 'Math.sin',\n sqrt: 'Math.sqrt',\n tan: 'Math.tan',\n clamp: function (args) {\n if (args.length < 3) error('Missing arguments to clamp function.');\n if (args.length > 3) error('Too many arguments to clamp function.');\n const a = args.map(codegen);\n return 'Math.max(' + a[1] + ', Math.min(' + a[2] + ',' + a[0] + '))';\n },\n // DATE functions\n now: 'Date.now',\n utc: 'Date.UTC',\n datetime: DATE,\n date: fn('getDate', DATE, 0),\n day: fn('getDay', DATE, 0),\n year: fn('getFullYear', DATE, 0),\n month: fn('getMonth', DATE, 0),\n hours: fn('getHours', DATE, 0),\n minutes: fn('getMinutes', DATE, 0),\n seconds: fn('getSeconds', DATE, 0),\n milliseconds: fn('getMilliseconds', DATE, 0),\n time: fn('getTime', DATE, 0),\n timezoneoffset: fn('getTimezoneOffset', DATE, 0),\n utcdate: fn('getUTCDate', DATE, 0),\n utcday: fn('getUTCDay', DATE, 0),\n utcyear: fn('getUTCFullYear', DATE, 0),\n utcmonth: fn('getUTCMonth', DATE, 0),\n utchours: fn('getUTCHours', DATE, 0),\n utcminutes: fn('getUTCMinutes', DATE, 0),\n utcseconds: fn('getUTCSeconds', DATE, 0),\n utcmilliseconds: fn('getUTCMilliseconds', DATE, 0),\n // sequence functions\n length: fn('length', null, -1),\n join: fn('join', null),\n indexof: fn('indexOf', null),\n lastindexof: fn('lastIndexOf', null),\n slice: fn('slice', null),\n reverse: function (args) {\n return '(' + codegen(args[0]) + ').slice().reverse()';\n },\n // STRING functions\n parseFloat: 'parseFloat',\n parseInt: 'parseInt',\n upper: fn('toUpperCase', STRING, 0),\n lower: fn('toLowerCase', STRING, 0),\n substring: fn('substring', STRING),\n split: fn('split', STRING),\n replace: fn('replace', STRING),\n trim: fn('trim', STRING, 0),\n // REGEXP functions\n regexp: REGEXP,\n test: fn('test', REGEXP),\n // Control Flow functions\n if: function (args) {\n if (args.length < 3) error('Missing arguments to if function.');\n if (args.length > 3) error('Too many arguments to if function.');\n const a = args.map(codegen);\n return '(' + a[0] + '?' + a[1] + ':' + a[2] + ')';\n }\n };\n}\n\nfunction stripQuotes(s) {\n const n = s && s.length - 1;\n return n && (s[0] === '\"' && s[n] === '\"' || s[0] === '\\'' && s[n] === '\\'') ? s.slice(1, -1) : s;\n}\n\nfunction codegen (opt) {\n opt = opt || {};\n const allowed = opt.allowed ? toSet(opt.allowed) : {},\n forbidden = opt.forbidden ? toSet(opt.forbidden) : {},\n constants = opt.constants || Constants,\n functions = (opt.functions || Functions)(visit),\n globalvar = opt.globalvar,\n fieldvar = opt.fieldvar,\n outputGlobal = isFunction(globalvar) ? globalvar : id => \"\".concat(globalvar, \"[\\\"\").concat(id, \"\\\"]\");\n let globals = {},\n fields = {},\n memberDepth = 0;\n\n function visit(ast) {\n if (isString(ast)) return ast;\n const generator = Generators[ast.type];\n if (generator == null) error('Unsupported type: ' + ast.type);\n return generator(ast);\n }\n\n const Generators = {\n Literal: n => n.raw,\n Identifier: n => {\n const id = n.name;\n\n if (memberDepth > 0) {\n return id;\n } else if (hasOwnProperty(forbidden, id)) {\n return error('Illegal identifier: ' + id);\n } else if (hasOwnProperty(constants, id)) {\n return constants[id];\n } else if (hasOwnProperty(allowed, id)) {\n return id;\n } else {\n globals[id] = 1;\n return outputGlobal(id);\n }\n },\n MemberExpression: n => {\n const d = !n.computed,\n o = visit(n.object);\n if (d) memberDepth += 1;\n const p = visit(n.property);\n\n if (o === fieldvar) {\n // strip quotes to sanitize field name (#1653)\n fields[stripQuotes(p)] = 1;\n }\n\n if (d) memberDepth -= 1;\n return o + (d ? '.' + p : '[' + p + ']');\n },\n CallExpression: n => {\n if (n.callee.type !== 'Identifier') {\n error('Illegal callee type: ' + n.callee.type);\n }\n\n const callee = n.callee.name,\n args = n.arguments,\n fn = hasOwnProperty(functions, callee) && functions[callee];\n if (!fn) error('Unrecognized function: ' + callee);\n return isFunction(fn) ? fn(args) : fn + '(' + args.map(visit).join(',') + ')';\n },\n ArrayExpression: n => '[' + n.elements.map(visit).join(',') + ']',\n BinaryExpression: n => '(' + visit(n.left) + ' ' + n.operator + ' ' + visit(n.right) + ')',\n UnaryExpression: n => '(' + n.operator + visit(n.argument) + ')',\n ConditionalExpression: n => '(' + visit(n.test) + '?' + visit(n.consequent) + ':' + visit(n.alternate) + ')',\n LogicalExpression: n => '(' + visit(n.left) + n.operator + visit(n.right) + ')',\n ObjectExpression: n => '{' + n.properties.map(visit).join(',') + '}',\n Property: n => {\n memberDepth += 1;\n const k = visit(n.key);\n memberDepth -= 1;\n return k + ':' + visit(n.value);\n }\n };\n\n function codegen(ast) {\n const result = {\n code: visit(ast),\n globals: Object.keys(globals),\n fields: Object.keys(fields)\n };\n globals = {};\n fields = {};\n return result;\n }\n\n codegen.functions = functions;\n codegen.constants = constants;\n return codegen;\n}\n\nexport { ASTNode, ArrayExpression, BinaryExpression, CallExpression, ConditionalExpression, Identifier, Literal, LogicalExpression, MemberExpression, ObjectExpression, Property, RawCode, UnaryExpression, codegen, Constants as constants, Functions as functions, parser as parse };\n","import { parse } from 'vega-expression';\nfunction getName(node) {\n const name = [];\n if (node.type === 'Identifier') {\n return [node.name];\n }\n if (node.type === 'Literal') {\n return [node.value];\n }\n if (node.type === 'MemberExpression') {\n name.push(...getName(node.object));\n name.push(...getName(node.property));\n }\n return name;\n}\nfunction startsWithDatum(node) {\n if (node.object.type === 'MemberExpression') {\n return startsWithDatum(node.object);\n }\n return node.object.name === 'datum';\n}\nexport function getDependentFields(expression) {\n const ast = parse(expression);\n const dependents = new Set();\n ast.visit((node) => {\n if (node.type === 'MemberExpression' && startsWithDatum(node)) {\n dependents.add(getName(node).slice(1).join('.'));\n }\n });\n return dependents;\n}\n//# sourceMappingURL=expressions.js.map","import { duplicate } from '../../util';\nimport { expression } from '../predicate';\nimport { DataFlowNode } from './dataflow';\nimport { getDependentFields } from './expressions';\nexport class FilterNode extends DataFlowNode {\n constructor(parent, model, filter) {\n super(parent);\n this.model = model;\n this.filter = filter;\n // TODO: refactor this to not take a node and\n // then add a static function makeFromOperand and make the constructor take only an expression\n this.expr = expression(this.model, this.filter, this);\n this._dependentFields = getDependentFields(this.expr);\n }\n clone() {\n return new FilterNode(null, this.model, duplicate(this.filter));\n }\n dependentFields() {\n return this._dependentFields;\n }\n producedFields() {\n return new Set(); // filter does not produce any new fields\n }\n assemble() {\n return {\n type: 'filter',\n expr: this.expr\n };\n }\n hash() {\n return `Filter ${this.expr}`;\n }\n}\n//# sourceMappingURL=filter.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { selector as parseSelector } from 'vega-event-selector';\nimport { isString, stringValue } from 'vega-util';\nimport { forEachSelection, STORE } from '.';\nimport { warn } from '../../log';\nimport { duplicate, keys, logicalExpr, varName } from '../../util';\nimport { OutputNode } from '../data/dataflow';\nimport { FilterNode } from '../data/filter';\nimport { forEachTransform } from './transforms/transforms';\nimport { DataSourceType } from '../../data';\nexport function parseUnitSelection(model, selDefs) {\n var _a;\n const selCmpts = {};\n const selectionConfig = model.config.selection;\n for (const name of keys(selDefs !== null && selDefs !== void 0 ? selDefs : {})) {\n const selDef = duplicate(selDefs[name]);\n const _b = selectionConfig[selDef.type], { fields, encodings } = _b, cfg = __rest(_b, [\"fields\", \"encodings\"]); // Project transform applies its defaults.\n // Set default values from config if a property hasn't been specified,\n // or if it is true. E.g., \"translate\": true should use the default\n // event handlers for translate. However, true may be a valid value for\n // a property (e.g., \"nearest\": true).\n for (const key in cfg) {\n // A selection should contain either `encodings` or `fields`, only use\n // default values for these two values if neither of them is specified.\n if ((key === 'encodings' && selDef.fields) || (key === 'fields' && selDef.encodings)) {\n continue;\n }\n if (key === 'mark') {\n selDef[key] = Object.assign(Object.assign({}, cfg[key]), selDef[key]);\n }\n if (selDef[key] === undefined || selDef[key] === true) {\n selDef[key] = (_a = cfg[key]) !== null && _a !== void 0 ? _a : selDef[key];\n }\n }\n const safeName = varName(name);\n const selCmpt = (selCmpts[safeName] = Object.assign(Object.assign({}, selDef), { name: safeName, events: isString(selDef.on) ? parseSelector(selDef.on, 'scope') : duplicate(selDef.on) }));\n forEachTransform(selCmpt, txCompiler => {\n if (txCompiler.has(selCmpt) && txCompiler.parse) {\n txCompiler.parse(model, selCmpt, selDef, selDefs[name]);\n }\n });\n }\n return selCmpts;\n}\nexport function parseSelectionPredicate(model, selections, dfnode, datum = 'datum') {\n const stores = [];\n function expr(name) {\n const vname = varName(name);\n const selCmpt = model.getSelectionComponent(vname, name);\n const store = stringValue(vname + STORE);\n if (selCmpt.project.timeUnit) {\n const child = dfnode !== null && dfnode !== void 0 ? dfnode : model.component.data.raw;\n const tunode = selCmpt.project.timeUnit.clone();\n if (child.parent) {\n tunode.insertAsParentOf(child);\n }\n else {\n child.parent = tunode;\n }\n }\n if (selCmpt.empty !== 'none') {\n stores.push(store);\n }\n return (`vlSelectionTest(${store}, ${datum}` + (selCmpt.resolve === 'global' ? ')' : `, ${stringValue(selCmpt.resolve)})`));\n }\n const predicateStr = logicalExpr(selections, expr);\n return ((stores.length ? '!(' + stores.map(s => `length(data(${s}))`).join(' || ') + ') || ' : '') + `(${predicateStr})`);\n}\nexport function parseSelectionBinExtent(selCmpt, extent) {\n const encoding = extent['encoding'];\n let field = extent['field'];\n if (!encoding && !field) {\n field = selCmpt.project.items[0].field;\n if (selCmpt.project.items.length > 1) {\n warn('A \"field\" or \"encoding\" must be specified when using a selection as a scale domain. ' +\n `Using \"field\": ${stringValue(field)}.`);\n }\n }\n else if (encoding && !field) {\n const encodings = selCmpt.project.items.filter(p => p.channel === encoding);\n if (!encodings.length || encodings.length > 1) {\n field = selCmpt.project.items[0].field;\n warn((!encodings.length ? 'No ' : 'Multiple ') +\n `matching ${stringValue(encoding)} encoding found for selection ${stringValue(extent.selection)}. ` +\n `Using \"field\": ${stringValue(field)}.`);\n }\n else {\n field = encodings[0].field;\n }\n }\n return `${selCmpt.name}[${stringValue(field)}]`;\n}\nexport function materializeSelections(model, main) {\n forEachSelection(model, selCmpt => {\n const selection = selCmpt.name;\n const lookupName = model.getName(`lookup_${selection}`);\n model.component.data.outputNodes[lookupName] = selCmpt.materialized = new OutputNode(new FilterNode(main, model, { selection }), lookupName, DataSourceType.Lookup, model.component.data.outputNodeRefCounts);\n });\n}\n//# sourceMappingURL=parse.js.map","import { isString } from 'vega-util';\nimport { fieldFilterExpression, isSelectionPredicate } from '../predicate';\nimport { logicalExpr } from '../util';\nimport { parseSelectionPredicate } from './selection/parse';\n/**\n * Converts a predicate into an expression.\n */\n// model is only used for selection filters.\nexport function expression(model, filterOp, node) {\n return logicalExpr(filterOp, (predicate) => {\n if (isString(predicate)) {\n return predicate;\n }\n else if (isSelectionPredicate(predicate)) {\n return parseSelectionPredicate(model, predicate.selection, node);\n }\n else {\n // Filter Object\n return fieldFilterExpression(predicate);\n }\n });\n}\n//# sourceMappingURL=predicate.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array, isArray } from 'vega-util';\nimport { AXIS_PARTS, AXIS_PROPERTY_TYPE, CONDITIONAL_AXIS_PROP_INDEX, isConditionalAxisValue } from '../../axis';\nimport { POSITION_SCALE_CHANNELS } from '../../channel';\nimport { defaultTitle } from '../../channeldef';\nimport { isText } from '../../title';\nimport { getFirstDefined, isEmpty, replaceAll } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { exprFromValueOrSignalRef } from '../common';\nimport { expression } from '../predicate';\nfunction assembleTitle(title, config) {\n if (!title) {\n return undefined;\n }\n if (isArray(title) && !isText(title)) {\n return title.map(fieldDef => defaultTitle(fieldDef, config)).join(', ');\n }\n return title;\n}\nfunction setAxisEncode(axis, part, vgProp, vgRef) {\n var _a, _b, _c;\n axis.encode = (_a = axis.encode) !== null && _a !== void 0 ? _a : {};\n axis.encode[part] = (_b = axis.encode[part]) !== null && _b !== void 0 ? _b : {};\n axis.encode[part].update = (_c = axis.encode[part].update) !== null && _c !== void 0 ? _c : {};\n // TODO: remove as any after https://github.com/prisma/nexus-prisma/issues/291\n axis.encode[part].update[vgProp] = vgRef;\n}\nexport function assembleAxis(axisCmpt, kind, config, opt = { header: false }) {\n var _a, _b;\n const _c = axisCmpt.combine(), { disable, orient, scale, labelExpr, title, zindex } = _c, axis = __rest(_c, [\"disable\", \"orient\", \"scale\", \"labelExpr\", \"title\", \"zindex\"]);\n if (disable) {\n return undefined;\n }\n for (const prop in axis) {\n const propType = AXIS_PROPERTY_TYPE[prop];\n const propValue = axis[prop];\n if (propType && propType !== kind && propType !== 'both') {\n // Remove properties that are not valid for this kind of axis\n delete axis[prop];\n }\n else if (isConditionalAxisValue(propValue)) {\n // deal with conditional axis value\n const { condition } = propValue, valueOrSignalRef = __rest(propValue, [\"condition\"]);\n const conditions = array(condition);\n const propIndex = CONDITIONAL_AXIS_PROP_INDEX[prop];\n if (propIndex) {\n const { vgProp, part } = propIndex;\n // If there is a corresponding Vega property for the channel,\n // use Vega's custom axis encoding and delete the original axis property to avoid conflicts\n const vgRef = [\n ...conditions.map(c => {\n const { test } = c, valueOrSignalCRef = __rest(c, [\"test\"]);\n return Object.assign({ test: expression(null, test) }, valueOrSignalCRef);\n }),\n valueOrSignalRef\n ];\n setAxisEncode(axis, part, vgProp, vgRef);\n delete axis[prop];\n }\n else if (propIndex === null) {\n // If propIndex is null, this means we support conditional axis property by converting the condition to signal instead.\n const signalRef = {\n signal: conditions\n .map(c => {\n const { test } = c, valueOrSignalCRef = __rest(c, [\"test\"]);\n return `${expression(null, test)} ? ${exprFromValueOrSignalRef(valueOrSignalCRef)} : `;\n })\n .join('') + exprFromValueOrSignalRef(valueOrSignalRef)\n };\n axis[prop] = signalRef;\n }\n }\n else if (isSignalRef(propValue)) {\n const propIndex = CONDITIONAL_AXIS_PROP_INDEX[prop];\n if (propIndex) {\n const { vgProp, part } = propIndex;\n setAxisEncode(axis, part, vgProp, propValue);\n delete axis[prop];\n } // else do nothing since the property already supports signal\n }\n }\n if (kind === 'grid') {\n if (!axis.grid) {\n return undefined;\n }\n // Remove unnecessary encode block\n if (axis.encode) {\n // Only need to keep encode block for grid\n const { grid } = axis.encode;\n axis.encode = Object.assign({}, (grid ? { grid } : {}));\n if (isEmpty(axis.encode)) {\n delete axis.encode;\n }\n }\n return Object.assign(Object.assign({ scale,\n orient }, axis), { domain: false, labels: false, aria: false, \n // Always set min/maxExtent to 0 to ensure that `config.axis*.minExtent` and `config.axis*.maxExtent`\n // would not affect gridAxis\n maxExtent: 0, minExtent: 0, ticks: false, zindex: getFirstDefined(zindex, 0) // put grid behind marks by default\n });\n }\n else {\n // kind === 'main'\n if (!opt.header && axisCmpt.mainExtracted) {\n // if mainExtracted has been extracted to a separate facet\n return undefined;\n }\n if (labelExpr !== undefined) {\n let expr = labelExpr;\n if (((_b = (_a = axis.encode) === null || _a === void 0 ? void 0 : _a.labels) === null || _b === void 0 ? void 0 : _b.update) && isSignalRef(axis.encode.labels.update.text)) {\n expr = replaceAll(labelExpr, 'datum.label', axis.encode.labels.update.text.signal);\n }\n setAxisEncode(axis, 'labels', 'text', { signal: expr });\n }\n if (axis.labelAlign === null) {\n delete axis.labelAlign;\n }\n // Remove unnecessary encode block\n if (axis.encode) {\n for (const part of AXIS_PARTS) {\n if (!axisCmpt.hasAxisPart(part)) {\n delete axis.encode[part];\n }\n }\n if (isEmpty(axis.encode)) {\n delete axis.encode;\n }\n }\n const titleString = assembleTitle(title, config);\n return Object.assign(Object.assign(Object.assign(Object.assign({ scale,\n orient, grid: false }, (titleString ? { title: titleString } : {})), axis), (config.aria === false ? { aria: false } : {})), { zindex: getFirstDefined(zindex, 0) // put axis line above marks by default\n });\n }\n}\n/**\n * Add axis signals so grid line works correctly\n * (Fix https://github.com/vega/vega-lite/issues/4226)\n */\nexport function assembleAxisSignals(model) {\n const { axes } = model.component;\n const signals = [];\n for (const channel of POSITION_SCALE_CHANNELS) {\n if (axes[channel]) {\n for (const axis of axes[channel]) {\n if (!axis.get('disable') && !axis.get('gridScale')) {\n // If there is x-axis but no y-scale for gridScale, need to set height/width so x-axis can draw the grid with the right height. Same for y-axis and width.\n const sizeType = channel === 'x' ? 'height' : 'width';\n const update = model.getSizeSignalRef(sizeType).signal;\n if (sizeType !== update) {\n signals.push({\n name: sizeType,\n update: update\n });\n }\n }\n }\n }\n }\n return signals;\n}\nexport function assembleAxes(axisComponents, config) {\n const { x = [], y = [] } = axisComponents;\n return [\n ...x.map(a => assembleAxis(a, 'grid', config)),\n ...y.map(a => assembleAxis(a, 'grid', config)),\n ...x.map(a => assembleAxis(a, 'main', config)),\n ...y.map(a => assembleAxis(a, 'main', config))\n ].filter(a => a); // filter undefined\n}\n//# sourceMappingURL=assemble.js.map","import { array } from 'vega-util';\nimport { isQuantitative } from '../../scale';\nimport { keys, titleCase } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { getStyleConfig, signalOrStringValue } from '../common';\nfunction getAxisConfigFromConfigTypes(configTypes, config, channel, orient) {\n // TODO: add special casing to add conditional value based on orient signal\n return Object.assign.apply(null, [\n {},\n ...configTypes.map(configType => {\n if (configType === 'axisOrient') {\n const orient1 = channel === 'x' ? 'bottom' : 'left';\n const orientConfig1 = config[channel === 'x' ? 'axisBottom' : 'axisLeft'] || {};\n const orientConfig2 = config[channel === 'x' ? 'axisTop' : 'axisRight'] || {};\n const props = new Set([...keys(orientConfig1), ...keys(orientConfig2)]);\n const conditionalOrientAxisConfig = {};\n for (const prop of props.values()) {\n conditionalOrientAxisConfig[prop] = {\n // orient is surely signal in this case\n signal: `${orient['signal']} === \"${orient1}\" ? ${signalOrStringValue(orientConfig1[prop])} : ${signalOrStringValue(orientConfig2[prop])}`\n };\n }\n return conditionalOrientAxisConfig;\n }\n return config[configType];\n })\n ]);\n}\nexport function getAxisConfigs(channel, scaleType, orient, config) {\n const typeBasedConfigTypes = scaleType === 'band'\n ? ['axisDiscrete', 'axisBand']\n : scaleType === 'point'\n ? ['axisDiscrete', 'axisPoint']\n : isQuantitative(scaleType)\n ? ['axisQuantitative']\n : scaleType === 'time' || scaleType === 'utc'\n ? ['axisTemporal']\n : [];\n const axisChannel = channel === 'x' ? 'axisX' : 'axisY';\n const axisOrient = isSignalRef(orient) ? 'axisOrient' : 'axis' + titleCase(orient); // axisTop, axisBottom, ...\n const vlOnlyConfigTypes = [\n // technically Vega does have axisBand, but if we make another separation here,\n // it will further introduce complexity in the code\n ...typeBasedConfigTypes,\n ...typeBasedConfigTypes.map(c => axisChannel + c.substr(4))\n ];\n const vgConfigTypes = ['axis', axisOrient, axisChannel];\n return {\n vlOnlyAxisConfig: getAxisConfigFromConfigTypes(vlOnlyConfigTypes, config, channel, orient),\n vgAxisConfig: getAxisConfigFromConfigTypes(vgConfigTypes, config, channel, orient),\n axisConfigStyle: getAxisConfigStyle([...vgConfigTypes, ...vlOnlyConfigTypes], config)\n };\n}\nexport function getAxisConfigStyle(axisConfigTypes, config) {\n var _a;\n const toMerge = [{}];\n for (const configType of axisConfigTypes) {\n // TODO: add special casing to add conditional value based on orient signal\n let style = (_a = config[configType]) === null || _a === void 0 ? void 0 : _a.style;\n if (style) {\n style = array(style);\n for (const s of style) {\n toMerge.push(config.style[s]);\n }\n }\n }\n return Object.assign.apply(null, toMerge);\n}\nexport function getAxisConfig(property, styleConfigIndex, style, axisConfigs = {}) {\n var _a;\n const styleConfig = getStyleConfig(property, style, styleConfigIndex);\n if (styleConfig !== undefined) {\n return {\n configFrom: 'style',\n configValue: styleConfig\n };\n }\n for (const configFrom of ['vlOnlyAxisConfig', 'vgAxisConfig', 'axisConfigStyle']) {\n if (((_a = axisConfigs[configFrom]) === null || _a === void 0 ? void 0 : _a[property]) !== undefined) {\n return { configFrom, configValue: axisConfigs[configFrom][property] };\n }\n }\n return {};\n}\n//# sourceMappingURL=config.js.map","import { isArray, isObject } from 'vega-util';\nimport { isBinned, isBinning } from '../../bin';\nimport { X } from '../../channel';\nimport { isDiscrete, isFieldDef, toFieldDefBase, valueArray } from '../../channeldef';\nimport { hasDiscreteDomain } from '../../scale';\nimport { normalizeTimeUnit } from '../../timeunit';\nimport { NOMINAL, ORDINAL } from '../../type';\nimport { contains, normalizeAngle } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { mergeTitle, mergeTitleFieldDefs } from '../common';\nimport { guideFormat, guideFormatType } from '../format';\nimport { getAxisConfig } from './config';\nexport const axisRules = {\n scale: ({ model, channel }) => model.scaleName(channel),\n format: ({ fieldOrDatumDef, config, axis }) => {\n const { format, formatType } = axis;\n return guideFormat(fieldOrDatumDef, fieldOrDatumDef.type, format, formatType, config, true);\n },\n formatType: ({ axis, fieldOrDatumDef, scaleType }) => {\n const { formatType } = axis;\n return guideFormatType(formatType, fieldOrDatumDef, scaleType);\n },\n grid: ({ fieldOrDatumDef, axis, scaleType }) => {\n var _a;\n if (isFieldDef(fieldOrDatumDef) && isBinned(fieldOrDatumDef.bin)) {\n return false;\n }\n else {\n return (_a = axis.grid) !== null && _a !== void 0 ? _a : defaultGrid(scaleType, fieldOrDatumDef);\n }\n },\n gridScale: ({ model, channel }) => gridScale(model, channel),\n labelAlign: ({ axis, labelAngle, orient, channel }) => axis.labelAlign || defaultLabelAlign(labelAngle, orient, channel),\n labelAngle: ({ labelAngle }) => labelAngle,\n labelBaseline: ({ axis, labelAngle, orient, channel }) => axis.labelBaseline || defaultLabelBaseline(labelAngle, orient, channel),\n labelFlush: ({ axis, fieldOrDatumDef, channel }) => { var _a; return (_a = axis.labelFlush) !== null && _a !== void 0 ? _a : defaultLabelFlush(fieldOrDatumDef.type, channel); },\n labelOverlap: ({ axis, fieldOrDatumDef, scaleType }) => { var _a; return (_a = axis.labelOverlap) !== null && _a !== void 0 ? _a : defaultLabelOverlap(fieldOrDatumDef.type, scaleType, isFieldDef(fieldOrDatumDef) && !!fieldOrDatumDef.timeUnit, isFieldDef(fieldOrDatumDef) ? fieldOrDatumDef.sort : undefined); },\n // we already calculate orient in parse\n orient: ({ orient }) => orient,\n tickCount: ({ channel, model, axis, fieldOrDatumDef, scaleType }) => {\n var _a;\n const sizeType = channel === 'x' ? 'width' : channel === 'y' ? 'height' : undefined;\n const size = sizeType ? model.getSizeSignalRef(sizeType) : undefined;\n return (_a = axis.tickCount) !== null && _a !== void 0 ? _a : defaultTickCount({ fieldOrDatumDef, scaleType, size, values: axis.values });\n },\n title: ({ axis, model, channel }) => {\n if (axis.title !== undefined) {\n return axis.title;\n }\n const fieldDefTitle = getFieldDefTitle(model, channel);\n if (fieldDefTitle !== undefined) {\n return fieldDefTitle;\n }\n const fieldDef = model.typedFieldDef(channel);\n const channel2 = channel === 'x' ? 'x2' : 'y2';\n const fieldDef2 = model.fieldDef(channel2);\n // If title not specified, store base parts of fieldDef (and fieldDef2 if exists)\n return mergeTitleFieldDefs(fieldDef ? [toFieldDefBase(fieldDef)] : [], isFieldDef(fieldDef2) ? [toFieldDefBase(fieldDef2)] : []);\n },\n values: ({ axis, fieldOrDatumDef }) => values(axis, fieldOrDatumDef),\n zindex: ({ axis, fieldOrDatumDef, mark }) => { var _a; return (_a = axis.zindex) !== null && _a !== void 0 ? _a : defaultZindex(mark, fieldOrDatumDef); }\n};\n// TODO: we need to refactor this method after we take care of config refactoring\n/**\n * Default rules for whether to show a grid should be shown for a channel.\n * If `grid` is unspecified, the default value is `true` for ordinal scales that are not binned\n */\nexport function defaultGrid(scaleType, fieldDef) {\n return !hasDiscreteDomain(scaleType) && isFieldDef(fieldDef) && !isBinning(fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.bin);\n}\nexport function gridScale(model, channel) {\n const gridChannel = channel === 'x' ? 'y' : 'x';\n if (model.getScaleComponent(gridChannel)) {\n return model.scaleName(gridChannel);\n }\n return undefined;\n}\nexport function getLabelAngle(fieldOrDatumDef, axis, channel, styleConfig, axisConfigs) {\n const labelAngle = axis === null || axis === void 0 ? void 0 : axis.labelAngle;\n // try axis value\n if (labelAngle !== undefined) {\n return isSignalRef(labelAngle) ? labelAngle : normalizeAngle(labelAngle);\n }\n else {\n // try axis config value\n const { configValue: angle } = getAxisConfig('labelAngle', styleConfig, axis === null || axis === void 0 ? void 0 : axis.style, axisConfigs);\n if (angle !== undefined) {\n return normalizeAngle(angle);\n }\n else {\n // get default value\n if (channel === X &&\n contains([NOMINAL, ORDINAL], fieldOrDatumDef.type) &&\n !(isFieldDef(fieldOrDatumDef) && fieldOrDatumDef.timeUnit)) {\n return 270;\n }\n // no default\n return undefined;\n }\n }\n}\nexport function normalizeAngleExpr(angle) {\n return `(((${angle.signal} % 360) + 360) % 360)`;\n}\nexport function defaultLabelBaseline(angle, orient, channel, alwaysIncludeMiddle) {\n if (angle !== undefined) {\n if (channel === 'x') {\n if (isSignalRef(angle)) {\n const a = normalizeAngleExpr(angle);\n const orientIsTop = isSignalRef(orient) ? `(${orient.signal} === \"top\")` : orient === 'top';\n return {\n signal: `(45 < ${a} && ${a} < 135) || (225 < ${a} && ${a} < 315) ? \"middle\" :` +\n `(${a} <= 45 || 315 <= ${a}) === ${orientIsTop} ? \"bottom\" : \"top\"`\n };\n }\n if ((45 < angle && angle < 135) || (225 < angle && angle < 315)) {\n return 'middle';\n }\n if (isSignalRef(orient)) {\n const op = angle <= 45 || 315 <= angle ? '===' : '!==';\n return { signal: `${orient.signal} ${op} \"top\" ? \"bottom\" : \"top\"` };\n }\n return (angle <= 45 || 315 <= angle) === (orient === 'top') ? 'bottom' : 'top';\n }\n else {\n if (isSignalRef(angle)) {\n const a = normalizeAngleExpr(angle);\n const orientIsLeft = isSignalRef(orient) ? `(${orient.signal} === \"left\")` : orient === 'left';\n const middle = alwaysIncludeMiddle ? '\"middle\"' : 'null';\n return {\n signal: `${a} <= 45 || 315 <= ${a} || (135 <= ${a} && ${a} <= 225) ? ${middle} : (45 <= ${a} && ${a} <= 135) === ${orientIsLeft} ? \"top\" : \"bottom\"`\n };\n }\n if (angle <= 45 || 315 <= angle || (135 <= angle && angle <= 225)) {\n return alwaysIncludeMiddle ? 'middle' : null;\n }\n if (isSignalRef(orient)) {\n const op = 45 <= angle && angle <= 135 ? '===' : '!==';\n return { signal: `${orient.signal} ${op} \"left\" ? \"top\" : \"bottom\"` };\n }\n return (45 <= angle && angle <= 135) === (orient === 'left') ? 'top' : 'bottom';\n }\n }\n return undefined;\n}\nexport function defaultLabelAlign(angle, orient, channel) {\n if (angle === undefined) {\n return undefined;\n }\n const isX = channel === 'x';\n const startAngle = isX ? 0 : 90;\n const mainOrient = isX ? 'bottom' : 'left';\n if (isSignalRef(angle)) {\n const a = normalizeAngleExpr(angle);\n const orientIsMain = isSignalRef(orient) ? `(${orient.signal} === \"${mainOrient}\")` : orient === mainOrient;\n return {\n signal: `(${startAngle ? '(' + a + ' + 90)' : a} % 180 === 0) ? ${isX ? null : '\"center\"'} :` +\n `(${startAngle} < ${a} && ${a} < ${180 + startAngle}) === ${orientIsMain} ? \"left\" : \"right\"`\n };\n }\n if ((angle + startAngle) % 180 === 0) {\n // For bottom, use default label align so label flush still works\n return isX ? null : 'center';\n }\n if (isSignalRef(orient)) {\n const op = startAngle < angle && angle < 180 + startAngle ? '===' : '!==';\n const orientIsMain = `${orient.signal} ${op} \"${mainOrient}\"`;\n return {\n signal: `${orientIsMain} ? \"left\" : \"right\"`\n };\n }\n if ((startAngle < angle && angle < 180 + startAngle) === (orient === mainOrient)) {\n return 'left';\n }\n return 'right';\n}\nexport function defaultLabelFlush(type, channel) {\n if (channel === 'x' && contains(['quantitative', 'temporal'], type)) {\n return true;\n }\n return undefined;\n}\nexport function defaultLabelOverlap(type, scaleType, hasTimeUnit, sort) {\n // do not prevent overlap for nominal data because there is no way to infer what the missing labels are\n if ((hasTimeUnit && !isObject(sort)) || (type !== 'nominal' && type !== 'ordinal')) {\n if (scaleType === 'log' || scaleType === 'symlog') {\n return 'greedy';\n }\n return true;\n }\n return undefined;\n}\nexport function defaultOrient(channel) {\n return channel === 'x' ? 'bottom' : 'left';\n}\nexport function defaultTickCount({ fieldOrDatumDef, scaleType, size, values: vals }) {\n var _a;\n if (!vals && !hasDiscreteDomain(scaleType) && scaleType !== 'log') {\n if (isFieldDef(fieldOrDatumDef)) {\n if (isBinning(fieldOrDatumDef.bin)) {\n // for binned data, we don't want more ticks than maxbins\n return { signal: `ceil(${size.signal}/10)` };\n }\n if (fieldOrDatumDef.timeUnit &&\n contains(['month', 'hours', 'day', 'quarter'], (_a = normalizeTimeUnit(fieldOrDatumDef.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit)) {\n return undefined;\n }\n }\n return { signal: `ceil(${size.signal}/40)` };\n }\n return undefined;\n}\nexport function getFieldDefTitle(model, channel) {\n const channel2 = channel === 'x' ? 'x2' : 'y2';\n const fieldDef = model.fieldDef(channel);\n const fieldDef2 = model.fieldDef(channel2);\n const title1 = fieldDef ? fieldDef.title : undefined;\n const title2 = fieldDef2 ? fieldDef2.title : undefined;\n if (title1 && title2) {\n return mergeTitle(title1, title2);\n }\n else if (title1) {\n return title1;\n }\n else if (title2) {\n return title2;\n }\n else if (title1 !== undefined) {\n // falsy value to disable config\n return title1;\n }\n else if (title2 !== undefined) {\n // falsy value to disable config\n return title2;\n }\n return undefined;\n}\nexport function values(axis, fieldOrDatumDef) {\n const vals = axis.values;\n if (isArray(vals)) {\n return valueArray(fieldOrDatumDef, vals);\n }\n else if (isSignalRef(vals)) {\n return vals;\n }\n return undefined;\n}\nexport function defaultZindex(mark, fieldDef) {\n if (mark === 'rect' && isDiscrete(fieldDef)) {\n return 1;\n }\n return 0;\n}\n//# sourceMappingURL=properties.js.map","import { isScaleFieldDef, vgField } from '../../channeldef';\nimport { fieldFilterExpression } from '../../predicate';\nimport { isSortArray } from '../../sort';\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nimport { getDependentFields } from './expressions';\nexport class CalculateNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n this._dependentFields = getDependentFields(this.transform.calculate);\n }\n clone() {\n return new CalculateNode(null, duplicate(this.transform));\n }\n static parseAllForSortIndex(parent, model) {\n // get all the encoding with sort fields from model\n model.forEachFieldDef((fieldDef, channel) => {\n if (!isScaleFieldDef(fieldDef)) {\n return;\n }\n if (isSortArray(fieldDef.sort)) {\n const { field, timeUnit } = fieldDef;\n const sort = fieldDef.sort;\n // generate `datum[\"a\"] === val0 ? 0 : datum[\"a\"] === val1 ? 1 : ... : n` via FieldEqualPredicate\n const calculate = sort\n .map((sortValue, i) => {\n return `${fieldFilterExpression({ field, timeUnit, equal: sortValue })} ? ${i} : `;\n })\n .join('') + sort.length;\n parent = new CalculateNode(parent, {\n calculate,\n as: sortArrayIndexField(fieldDef, channel, { forAs: true })\n });\n }\n });\n return parent;\n }\n producedFields() {\n return new Set([this.transform.as]);\n }\n dependentFields() {\n return this._dependentFields;\n }\n assemble() {\n return {\n type: 'formula',\n expr: this.transform.calculate,\n as: this.transform.as\n };\n }\n hash() {\n return `Calculate ${hash(this.transform)}`;\n }\n}\nexport function sortArrayIndexField(fieldDef, channel, opt) {\n return vgField(fieldDef, Object.assign({ prefix: channel, suffix: 'sort_index' }, (opt !== null && opt !== void 0 ? opt : {})));\n}\n//# sourceMappingURL=calculate.js.map","import { contains, getFirstDefined } from '../../util';\n/**\n * Get header channel, which can be different from facet channel when orient is specified or when the facet channel is facet.\n */\nexport function getHeaderChannel(channel, orient) {\n if (contains(['top', 'bottom'], orient)) {\n return 'column';\n }\n else if (contains(['left', 'right'], orient)) {\n return 'row';\n }\n return channel === 'row' ? 'row' : 'column';\n}\nexport function getHeaderProperty(prop, header, config, channel) {\n const headerSpecificConfig = channel === 'row' ? config.headerRow : channel === 'column' ? config.headerColumn : config.headerFacet;\n return getFirstDefined((header || {})[prop], headerSpecificConfig[prop], config.header[prop]);\n}\nexport function getHeaderProperties(properties, header, config, channel) {\n const props = {};\n for (const prop of properties) {\n const value = getHeaderProperty(prop, header || {}, config, channel);\n if (value !== undefined) {\n props[prop] = value;\n }\n }\n return props;\n}\n//# sourceMappingURL=common.js.map","export const HEADER_CHANNELS = ['row', 'column'];\nexport const HEADER_TYPES = ['header', 'footer'];\n//# sourceMappingURL=component.js.map","/**\n * Utility for generating row / column headers\n */\nimport { isArray } from 'vega-util';\nimport { FACET_CHANNELS } from '../../channel';\nimport { vgField } from '../../channeldef';\nimport { HEADER_LABEL_PROPERTIES, HEADER_LABEL_PROPERTIES_MAP, HEADER_TITLE_PROPERTIES, HEADER_TITLE_PROPERTIES_MAP } from '../../header';\nimport { isSortField } from '../../sort';\nimport { isFacetMapping } from '../../spec/facet';\nimport { contains, isEmpty, normalizeAngle, replaceAll } from '../../util';\nimport { defaultLabelAlign, defaultLabelBaseline } from '../axis/properties';\nimport { sortArrayIndexField } from '../data/calculate';\nimport { formatSignalRef } from '../format';\nimport { isFacetModel } from '../model';\nimport { getHeaderChannel, getHeaderProperties, getHeaderProperty } from './common';\nimport { HEADER_TYPES } from './component';\n// TODO: rename to assembleHeaderTitleGroup\nexport function assembleTitleGroup(model, channel) {\n const title = model.component.layoutHeaders[channel].title;\n const config = model.config ? model.config : undefined;\n const facetFieldDef = model.component.layoutHeaders[channel].facetFieldDef\n ? model.component.layoutHeaders[channel].facetFieldDef\n : undefined;\n const { titleAnchor, titleAngle: ta, titleOrient } = getHeaderProperties(['titleAnchor', 'titleAngle', 'titleOrient'], facetFieldDef.header, config, channel);\n const headerChannel = getHeaderChannel(channel, titleOrient);\n const titleAngle = normalizeAngle(ta);\n return {\n name: `${channel}-title`,\n type: 'group',\n role: `${headerChannel}-title`,\n title: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ text: title }, (channel === 'row' ? { orient: 'left' } : {})), { style: 'guide-title' }), defaultHeaderGuideBaseline(titleAngle, headerChannel)), defaultHeaderGuideAlign(headerChannel, titleAngle, titleAnchor)), assembleHeaderProperties(config, facetFieldDef, channel, HEADER_TITLE_PROPERTIES, HEADER_TITLE_PROPERTIES_MAP))\n };\n}\nexport function defaultHeaderGuideAlign(headerChannel, angle, anchor = 'middle') {\n switch (anchor) {\n case 'start':\n return { align: 'left' };\n case 'end':\n return { align: 'right' };\n }\n const align = defaultLabelAlign(angle, headerChannel === 'row' ? 'left' : 'top', headerChannel === 'row' ? 'y' : 'x');\n return align ? { align } : {};\n}\nexport function defaultHeaderGuideBaseline(angle, channel) {\n const baseline = defaultLabelBaseline(angle, channel === 'row' ? 'left' : 'top', channel === 'row' ? 'y' : 'x', true);\n return baseline ? { baseline } : {};\n}\nexport function assembleHeaderGroups(model, channel) {\n const layoutHeader = model.component.layoutHeaders[channel];\n const groups = [];\n for (const headerType of HEADER_TYPES) {\n if (layoutHeader[headerType]) {\n for (const headerComponent of layoutHeader[headerType]) {\n const group = assembleHeaderGroup(model, channel, headerType, layoutHeader, headerComponent);\n if (group != null) {\n groups.push(group);\n }\n }\n }\n }\n return groups;\n}\nfunction getSort(facetFieldDef, channel) {\n var _a;\n const { sort } = facetFieldDef;\n if (isSortField(sort)) {\n return {\n field: vgField(sort, { expr: 'datum' }),\n order: (_a = sort.order) !== null && _a !== void 0 ? _a : 'ascending'\n };\n }\n else if (isArray(sort)) {\n return {\n field: sortArrayIndexField(facetFieldDef, channel, { expr: 'datum' }),\n order: 'ascending'\n };\n }\n else {\n return {\n field: vgField(facetFieldDef, { expr: 'datum' }),\n order: sort !== null && sort !== void 0 ? sort : 'ascending'\n };\n }\n}\nexport function assembleLabelTitle(facetFieldDef, channel, config) {\n const { format, formatType, labelAngle, labelAnchor, labelOrient, labelExpr } = getHeaderProperties(['format', 'formatType', 'labelAngle', 'labelAnchor', 'labelOrient', 'labelExpr'], facetFieldDef.header, config, channel);\n const titleTextExpr = formatSignalRef({ fieldOrDatumDef: facetFieldDef, format, formatType, expr: 'parent', config })\n .signal;\n const headerChannel = getHeaderChannel(channel, labelOrient);\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ text: {\n signal: labelExpr\n ? replaceAll(replaceAll(labelExpr, 'datum.label', titleTextExpr), 'datum.value', vgField(facetFieldDef, { expr: 'parent' }))\n : titleTextExpr\n } }, (channel === 'row' ? { orient: 'left' } : {})), { style: 'guide-label', frame: 'group' }), defaultHeaderGuideBaseline(labelAngle, headerChannel)), defaultHeaderGuideAlign(headerChannel, labelAngle, labelAnchor)), assembleHeaderProperties(config, facetFieldDef, channel, HEADER_LABEL_PROPERTIES, HEADER_LABEL_PROPERTIES_MAP));\n}\nexport function assembleHeaderGroup(model, channel, headerType, layoutHeader, headerComponent) {\n if (headerComponent) {\n let title = null;\n const { facetFieldDef } = layoutHeader;\n const config = model.config ? model.config : undefined;\n if (facetFieldDef && headerComponent.labels) {\n const { labelOrient } = getHeaderProperties(['labelOrient'], facetFieldDef.header, config, channel);\n // Include label title in the header if orient aligns with the channel\n if ((channel === 'row' && !contains(['top', 'bottom'], labelOrient)) ||\n (channel === 'column' && !contains(['left', 'right'], labelOrient))) {\n title = assembleLabelTitle(facetFieldDef, channel, config);\n }\n }\n const isFacetWithoutRowCol = isFacetModel(model) && !isFacetMapping(model.facet);\n const axes = headerComponent.axes;\n const hasAxes = (axes === null || axes === void 0 ? void 0 : axes.length) > 0;\n if (title || hasAxes) {\n const sizeChannel = channel === 'row' ? 'height' : 'width';\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ name: model.getName(`${channel}_${headerType}`), type: 'group', role: `${channel}-${headerType}` }, (layoutHeader.facetFieldDef\n ? {\n from: { data: model.getName(channel + '_domain') },\n sort: getSort(facetFieldDef, channel)\n }\n : {})), (hasAxes && isFacetWithoutRowCol\n ? {\n from: { data: model.getName(`facet_domain_${channel}`) }\n }\n : {})), (title ? { title } : {})), (headerComponent.sizeSignal\n ? {\n encode: {\n update: {\n [sizeChannel]: headerComponent.sizeSignal\n }\n }\n }\n : {})), (hasAxes ? { axes } : {}));\n }\n }\n return null;\n}\nconst LAYOUT_TITLE_BAND = {\n column: {\n start: 0,\n end: 1\n },\n row: {\n start: 1,\n end: 0\n }\n};\nexport function getLayoutTitleBand(titleAnchor, headerChannel) {\n return LAYOUT_TITLE_BAND[headerChannel][titleAnchor];\n}\nexport function assembleLayoutTitleBand(headerComponentIndex, config) {\n const titleBand = {};\n for (const channel of FACET_CHANNELS) {\n const headerComponent = headerComponentIndex[channel];\n if (headerComponent === null || headerComponent === void 0 ? void 0 : headerComponent.facetFieldDef) {\n const { titleAnchor, titleOrient } = getHeaderProperties(['titleAnchor', 'titleOrient'], headerComponent.facetFieldDef.header, config, channel);\n const headerChannel = getHeaderChannel(channel, titleOrient);\n const band = getLayoutTitleBand(titleAnchor, headerChannel);\n if (band !== undefined) {\n titleBand[headerChannel] = band;\n }\n }\n }\n return isEmpty(titleBand) ? undefined : titleBand;\n}\nexport function assembleHeaderProperties(config, facetFieldDef, channel, properties, propertiesMap) {\n const props = {};\n for (const prop of properties) {\n if (!propertiesMap[prop]) {\n continue;\n }\n const value = getHeaderProperty(prop, facetFieldDef === null || facetFieldDef === void 0 ? void 0 : facetFieldDef.header, config, channel);\n if (value !== undefined) {\n props[propertiesMap[prop]] = value;\n }\n }\n return props;\n}\n//# sourceMappingURL=assemble.js.map","import { getViewConfigContinuousSize } from '../../config';\nimport { hasDiscreteDomain } from '../../scale';\nimport { getFirstDefined } from '../../util';\nimport { isVgRangeStep } from '../../vega.schema';\nimport { signalOrStringValue } from '../common';\nimport { isFacetModel } from '../model';\nexport function assembleLayoutSignals(model) {\n return [\n ...sizeSignals(model, 'width'),\n ...sizeSignals(model, 'height'),\n ...sizeSignals(model, 'childWidth'),\n ...sizeSignals(model, 'childHeight')\n ];\n}\nexport function sizeSignals(model, sizeType) {\n const channel = sizeType === 'width' ? 'x' : 'y';\n const size = model.component.layoutSize.get(sizeType);\n if (!size || size === 'merged') {\n return [];\n }\n // Read size signal name from name map, just in case it is the top-level size signal that got renamed.\n const name = model.getSizeSignalRef(sizeType).signal;\n if (size === 'step') {\n const scaleComponent = model.getScaleComponent(channel);\n if (scaleComponent) {\n const type = scaleComponent.get('type');\n const range = scaleComponent.get('range');\n if (hasDiscreteDomain(type) && isVgRangeStep(range)) {\n const scaleName = model.scaleName(channel);\n if (isFacetModel(model.parent)) {\n // If parent is facet and this is an independent scale, return only signal signal\n // as the width/height will be calculated using the cardinality from\n // facet's aggregate rather than reading from scale domain\n const parentResolve = model.parent.component.resolve;\n if (parentResolve.scale[channel] === 'independent') {\n return [stepSignal(scaleName, range)];\n }\n }\n return [\n stepSignal(scaleName, range),\n {\n name,\n update: sizeExpr(scaleName, scaleComponent, `domain('${scaleName}').length`)\n }\n ];\n }\n }\n /* istanbul ignore next: Condition should not happen -- only for warning in development. */\n throw new Error('layout size is step although width/height is not step.');\n }\n else if (size == 'container') {\n const isWidth = name.endsWith('width');\n const expr = isWidth ? 'containerSize()[0]' : 'containerSize()[1]';\n const defaultValue = getViewConfigContinuousSize(model.config.view, isWidth ? 'width' : 'height');\n const safeExpr = `isFinite(${expr}) ? ${expr} : ${defaultValue}`;\n return [{ name, init: safeExpr, on: [{ update: safeExpr, events: 'window:resize' }] }];\n }\n else {\n return [\n {\n name,\n value: size\n }\n ];\n }\n}\nfunction stepSignal(scaleName, range) {\n return {\n name: scaleName + '_step',\n value: range.step\n };\n}\nexport function sizeExpr(scaleName, scaleComponent, cardinality) {\n const type = scaleComponent.get('type');\n const padding = scaleComponent.get('padding');\n const paddingOuter = getFirstDefined(scaleComponent.get('paddingOuter'), padding);\n let paddingInner = scaleComponent.get('paddingInner');\n paddingInner =\n type === 'band'\n ? // only band has real paddingInner\n paddingInner !== undefined\n ? paddingInner\n : padding\n : // For point, as calculated in https://github.com/vega/vega-scale/blob/master/src/band.js#L128,\n // it's equivalent to have paddingInner = 1 since there is only n-1 steps between n points.\n 1;\n return `bandspace(${cardinality}, ${signalOrStringValue(paddingInner)}, ${signalOrStringValue(paddingOuter)}) * ${scaleName}_step`;\n}\n//# sourceMappingURL=assemble.js.map","export function getSizeTypeFromLayoutSizeType(layoutSizeType) {\n return layoutSizeType === 'childWidth' ? 'width' : layoutSizeType === 'childHeight' ? 'height' : layoutSizeType;\n}\n//# sourceMappingURL=component.js.map","import { keys } from '../util';\nimport { signalOrValueRef } from './common';\nimport { wrapCondition } from './mark/encode';\nexport function guideEncodeEntry(encoding, model) {\n return keys(encoding).reduce((encode, channel) => {\n const valueDef = encoding[channel];\n return Object.assign(Object.assign({}, encode), wrapCondition(model, valueDef, channel, def => signalOrValueRef(def.value)));\n }, {});\n}\n//# sourceMappingURL=guide.js.map","import { isXorY } from '../channel';\nimport * as log from '../log';\nimport { isConcatModel, isFacetModel, isLayerModel } from './model';\nexport function defaultScaleResolve(channel, model) {\n if (isLayerModel(model) || isFacetModel(model)) {\n return 'shared';\n }\n else if (isConcatModel(model)) {\n return isXorY(channel) ? 'independent' : 'shared';\n }\n /* istanbul ignore next: should never reach here. */\n throw new Error('invalid model type for resolve');\n}\nexport function parseGuideResolve(resolve, channel) {\n const channelScaleResolve = resolve.scale[channel];\n const guide = isXorY(channel) ? 'axis' : 'legend';\n if (channelScaleResolve === 'independent') {\n if (resolve[guide][channel] === 'shared') {\n log.warn(log.message.independentScaleMeansIndependentGuide(channel));\n }\n return 'independent';\n }\n return resolve[guide][channel] || 'shared';\n}\n//# sourceMappingURL=resolve.js.map","import { COMMON_LEGEND_PROPERTY_INDEX } from '../../legend';\nimport { keys } from '../../util';\nimport { Split } from '../split';\nconst LEGEND_COMPONENT_PROPERTY_INDEX = Object.assign(Object.assign({}, COMMON_LEGEND_PROPERTY_INDEX), { disable: 1, labelExpr: 1, selections: 1, \n // channel scales\n opacity: 1, shape: 1, stroke: 1, fill: 1, size: 1, strokeWidth: 1, strokeDash: 1, \n // encode\n encode: 1 });\nexport const LEGEND_COMPONENT_PROPERTIES = keys(LEGEND_COMPONENT_PROPERTY_INDEX);\nexport class LegendComponent extends Split {\n}\n//# sourceMappingURL=component.js.map","import { array, isArray, stringValue } from 'vega-util';\nimport { COLOR, OPACITY } from '../../channel';\nimport { hasConditionalValueDef, isFieldDef, isValueDef } from '../../channeldef';\nimport { FILL_STROKE_CONFIG } from '../../mark';\nimport { getFirstDefined, isEmpty, varName } from '../../util';\nimport { applyMarkConfig, signalOrValueRef } from '../common';\nimport { formatCustomType, isCustomFormatType } from '../format';\nimport * as mixins from '../mark/encode';\nimport { STORE } from '../selection';\nexport const legendEncodeRules = {\n symbols,\n gradient,\n labels,\n entries\n};\nexport function symbols(symbolsSpec, { fieldOrDatumDef, model, channel, legendCmpt, legendType }) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n if (legendType !== 'symbol') {\n return undefined;\n }\n const { markDef, encoding, config, mark } = model;\n const filled = markDef.filled && mark !== 'trail';\n let out = Object.assign(Object.assign({}, applyMarkConfig({}, model, FILL_STROKE_CONFIG)), mixins.color(model, { filled })); // FIXME: remove this when VgEncodeEntry is compatible with SymbolEncodeEntry\n const symbolOpacity = (_a = legendCmpt.get('symbolOpacity')) !== null && _a !== void 0 ? _a : config.legend.symbolOpacity;\n const symbolFillColor = (_b = legendCmpt.get('symbolFillColor')) !== null && _b !== void 0 ? _b : config.legend.symbolFillColor;\n const symbolStrokeColor = (_c = legendCmpt.get('symbolStrokeColor')) !== null && _c !== void 0 ? _c : config.legend.symbolStrokeColor;\n const opacity = symbolOpacity === undefined ? (_d = getMaxValue(encoding.opacity)) !== null && _d !== void 0 ? _d : markDef.opacity : undefined;\n if (out.fill) {\n // for fill legend, we don't want any fill in symbol\n if (channel === 'fill' || (filled && channel === COLOR)) {\n delete out.fill;\n }\n else {\n if (out.fill['field']) {\n // For others, set fill to some opaque value (or nothing if a color is already set)\n if (symbolFillColor) {\n delete out.fill;\n }\n else {\n out.fill = signalOrValueRef((_e = config.legend.symbolBaseFillColor) !== null && _e !== void 0 ? _e : 'black');\n out.fillOpacity = signalOrValueRef(opacity !== null && opacity !== void 0 ? opacity : 1);\n }\n }\n else if (isArray(out.fill)) {\n const fill = (_h = (_g = getFirstConditionValue((_f = encoding.fill) !== null && _f !== void 0 ? _f : encoding.color)) !== null && _g !== void 0 ? _g : markDef.fill) !== null && _h !== void 0 ? _h : (filled && markDef.color);\n if (fill) {\n out.fill = signalOrValueRef(fill);\n }\n }\n }\n }\n if (out.stroke) {\n if (channel === 'stroke' || (!filled && channel === COLOR)) {\n delete out.stroke;\n }\n else {\n if (out.stroke['field'] || symbolStrokeColor) {\n // For others, remove stroke field\n delete out.stroke;\n }\n else if (isArray(out.stroke)) {\n const stroke = getFirstDefined(getFirstConditionValue(encoding.stroke || encoding.color), markDef.stroke, filled ? markDef.color : undefined);\n if (stroke) {\n out.stroke = { value: stroke };\n }\n }\n }\n }\n if (channel !== OPACITY) {\n const condition = isFieldDef(fieldOrDatumDef) && selectedCondition(model, legendCmpt, fieldOrDatumDef);\n if (condition) {\n out.opacity = [\n Object.assign({ test: condition }, signalOrValueRef(opacity !== null && opacity !== void 0 ? opacity : 1)),\n signalOrValueRef(config.legend.unselectedOpacity)\n ];\n }\n else if (opacity) {\n out.opacity = signalOrValueRef(opacity);\n }\n }\n out = Object.assign(Object.assign({}, out), symbolsSpec);\n return isEmpty(out) ? undefined : out;\n}\nexport function gradient(gradientSpec, { model, legendType, legendCmpt }) {\n var _a;\n if (legendType !== 'gradient') {\n return undefined;\n }\n const { config, markDef, encoding } = model;\n let out = {};\n const gradientOpacity = (_a = legendCmpt.get('gradientOpacity')) !== null && _a !== void 0 ? _a : config.legend.gradientOpacity;\n const opacity = gradientOpacity === undefined ? getMaxValue(encoding.opacity) || markDef.opacity : undefined;\n if (opacity) {\n // only apply opacity if it is neither zero or undefined\n out.opacity = signalOrValueRef(opacity);\n }\n out = Object.assign(Object.assign({}, out), gradientSpec);\n return isEmpty(out) ? undefined : out;\n}\nexport function labels(specifiedlabelsSpec, { fieldOrDatumDef, model, channel, legendCmpt }) {\n const legend = model.legend(channel) || {};\n const config = model.config;\n const condition = isFieldDef(fieldOrDatumDef) ? selectedCondition(model, legendCmpt, fieldOrDatumDef) : undefined;\n const opacity = condition ? [{ test: condition, value: 1 }, { value: config.legend.unselectedOpacity }] : undefined;\n const { format, formatType } = legend;\n const text = isCustomFormatType(formatType)\n ? formatCustomType({\n fieldOrDatumDef,\n field: 'datum.value',\n format,\n formatType,\n config\n })\n : undefined;\n const labelsSpec = Object.assign(Object.assign(Object.assign({}, (opacity ? { opacity } : {})), (text ? { text } : {})), specifiedlabelsSpec);\n return isEmpty(labelsSpec) ? undefined : labelsSpec;\n}\nexport function entries(entriesSpec, { legendCmpt }) {\n const selections = legendCmpt.get('selections');\n return (selections === null || selections === void 0 ? void 0 : selections.length) ? Object.assign(Object.assign({}, entriesSpec), { fill: { value: 'transparent' } }) : entriesSpec;\n}\nfunction getMaxValue(channelDef) {\n return getConditionValue(channelDef, (v, conditionalDef) => Math.max(v, conditionalDef.value));\n}\nexport function getFirstConditionValue(channelDef) {\n return getConditionValue(channelDef, (v, conditionalDef) => {\n return getFirstDefined(v, conditionalDef.value);\n });\n}\nfunction getConditionValue(channelDef, reducer) {\n if (hasConditionalValueDef(channelDef)) {\n return array(channelDef.condition).reduce(reducer, channelDef.value);\n }\n else if (isValueDef(channelDef)) {\n return channelDef.value;\n }\n return undefined;\n}\nfunction selectedCondition(model, legendCmpt, fieldDef) {\n const selections = legendCmpt.get('selections');\n if (!(selections === null || selections === void 0 ? void 0 : selections.length))\n return undefined;\n const field = stringValue(fieldDef.field);\n return selections\n .map(name => {\n const store = stringValue(varName(name) + STORE);\n return `(!length(data(${store})) || (${name}[${field}] && indexof(${name}[${field}], datum.value) >= 0))`;\n })\n .join(' || ');\n}\n//# sourceMappingURL=encode.js.map","import { isArray } from 'vega-util';\nimport { isColorChannel } from '../../channel';\nimport { title as fieldDefTitle, valueArray } from '../../channeldef';\nimport { isContinuousToContinuous } from '../../scale';\nimport { contains, getFirstDefined } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { guideFormat, guideFormatType } from '../format';\nimport { getFirstConditionValue } from './encode';\nexport const legendRules = {\n direction: ({ direction }) => direction,\n format: ({ fieldOrDatumDef, legend, config }) => {\n const { format, formatType } = legend;\n return guideFormat(fieldOrDatumDef, fieldOrDatumDef.type, format, formatType, config, false);\n },\n formatType: ({ legend, fieldOrDatumDef, scaleType }) => {\n const { formatType } = legend;\n return guideFormatType(formatType, fieldOrDatumDef, scaleType);\n },\n gradientLength: params => {\n var _a, _b;\n const { legend, legendConfig } = params;\n return (_b = (_a = legend.gradientLength) !== null && _a !== void 0 ? _a : legendConfig.gradientLength) !== null && _b !== void 0 ? _b : defaultGradientLength(params);\n },\n labelOverlap: ({ legend, legendConfig, scaleType }) => { var _a, _b; return (_b = (_a = legend.labelOverlap) !== null && _a !== void 0 ? _a : legendConfig.labelOverlap) !== null && _b !== void 0 ? _b : defaultLabelOverlap(scaleType); },\n symbolType: ({ legend, markDef, channel, encoding }) => { var _a; return (_a = legend.symbolType) !== null && _a !== void 0 ? _a : defaultSymbolType(markDef.type, channel, encoding.shape, markDef.shape); },\n title: ({ fieldOrDatumDef, config }) => fieldDefTitle(fieldOrDatumDef, config, { allowDisabling: true }),\n type: ({ legendType, scaleType, channel }) => {\n if (isColorChannel(channel) && isContinuousToContinuous(scaleType)) {\n if (legendType === 'gradient') {\n return undefined;\n }\n }\n else if (legendType === 'symbol') {\n return undefined;\n }\n return legendType;\n },\n values: ({ fieldOrDatumDef, legend }) => values(legend, fieldOrDatumDef)\n};\nexport function values(legend, fieldOrDatumDef) {\n const vals = legend.values;\n if (isArray(vals)) {\n return valueArray(fieldOrDatumDef, vals);\n }\n else if (isSignalRef(vals)) {\n return vals;\n }\n return undefined;\n}\nexport function defaultSymbolType(mark, channel, shapeChannelDef, markShape) {\n var _a;\n if (channel !== 'shape') {\n // use the value from the shape encoding or the mark config if they exist\n const shape = (_a = getFirstConditionValue(shapeChannelDef)) !== null && _a !== void 0 ? _a : markShape;\n if (shape) {\n return shape;\n }\n }\n switch (mark) {\n case 'bar':\n case 'rect':\n case 'image':\n case 'square':\n return 'square';\n case 'line':\n case 'trail':\n case 'rule':\n return 'stroke';\n case 'arc':\n case 'point':\n case 'circle':\n case 'tick':\n case 'geoshape':\n case 'area':\n case 'text':\n return 'circle';\n }\n}\nexport function clipHeight(legendType) {\n if (legendType === 'gradient') {\n return 20;\n }\n return undefined;\n}\nexport function getLegendType(params) {\n const { legend } = params;\n return getFirstDefined(legend.type, defaultType(params));\n}\nexport function defaultType({ channel, timeUnit, scaleType }) {\n // Following the logic in https://github.com/vega/vega-parser/blob/master/src/parsers/legend.js\n if (isColorChannel(channel)) {\n if (contains(['quarter', 'month', 'day'], timeUnit)) {\n return 'symbol';\n }\n if (isContinuousToContinuous(scaleType)) {\n return 'gradient';\n }\n }\n return 'symbol';\n}\nexport function getDirection({ legendConfig, legendType, orient, legend }) {\n var _a, _b;\n return ((_b = (_a = legend.direction) !== null && _a !== void 0 ? _a : legendConfig[legendType ? 'gradientDirection' : 'symbolDirection']) !== null && _b !== void 0 ? _b : defaultDirection(orient, legendType));\n}\nexport function defaultDirection(orient, legendType) {\n switch (orient) {\n case 'top':\n case 'bottom':\n return 'horizontal';\n case 'left':\n case 'right':\n case 'none':\n case undefined: // undefined = \"right\" in Vega\n return undefined; // vertical is Vega's default\n default:\n // top-left / ...\n // For inner legend, uses compact layout like Tableau\n return legendType === 'gradient' ? 'horizontal' : undefined;\n }\n}\nexport function defaultGradientLength({ legendConfig, model, direction, orient, scaleType }) {\n const { gradientHorizontalMaxLength, gradientHorizontalMinLength, gradientVerticalMaxLength, gradientVerticalMinLength } = legendConfig;\n if (isContinuousToContinuous(scaleType)) {\n if (direction === 'horizontal') {\n if (orient === 'top' || orient === 'bottom') {\n return gradientLengthSignal(model, 'width', gradientHorizontalMinLength, gradientHorizontalMaxLength);\n }\n else {\n return gradientHorizontalMinLength;\n }\n }\n else {\n // vertical / undefined (Vega uses vertical by default)\n return gradientLengthSignal(model, 'height', gradientVerticalMinLength, gradientVerticalMaxLength);\n }\n }\n return undefined;\n}\nfunction gradientLengthSignal(model, sizeType, min, max) {\n const sizeSignal = model.getSizeSignalRef(sizeType).signal;\n return { signal: `clamp(${sizeSignal}, ${min}, ${max})` };\n}\nexport function defaultLabelOverlap(scaleType) {\n if (contains(['quantile', 'threshold', 'log', 'symlog'], scaleType)) {\n return 'greedy';\n }\n return undefined;\n}\n//# sourceMappingURL=properties.js.map","import { COLOR, SHAPE } from '../../channel';\nimport { getFieldOrDatumDef, isFieldDef } from '../../channeldef';\nimport { LEGEND_SCALE_CHANNELS } from '../../legend';\nimport { normalizeTimeUnit } from '../../timeunit';\nimport { GEOJSON } from '../../type';\nimport { deleteNestedProperty, isEmpty, keys, varName } from '../../util';\nimport { mergeTitleComponent } from '../common';\nimport { guideEncodeEntry } from '../guide';\nimport { isUnitModel } from '../model';\nimport { parseGuideResolve } from '../resolve';\nimport { parseInteractiveLegend } from '../selection/transforms/legends';\nimport { defaultTieBreaker, makeImplicit, mergeValuesWithExplicit } from '../split';\nimport { LegendComponent, LEGEND_COMPONENT_PROPERTIES } from './component';\nimport { legendEncodeRules } from './encode';\nimport { getDirection, getLegendType, legendRules } from './properties';\nexport function parseLegend(model) {\n const legendComponent = isUnitModel(model) ? parseUnitLegend(model) : parseNonUnitLegend(model);\n model.component.legends = legendComponent;\n return legendComponent;\n}\nfunction parseUnitLegend(model) {\n const { encoding } = model;\n const legendComponent = {};\n for (const channel of [COLOR, ...LEGEND_SCALE_CHANNELS]) {\n const def = getFieldOrDatumDef(encoding[channel]);\n if (!def || !model.getScaleComponent(channel)) {\n continue;\n }\n if (channel === SHAPE && isFieldDef(def) && def.type === GEOJSON) {\n continue;\n }\n legendComponent[channel] = parseLegendForChannel(model, channel);\n }\n return legendComponent;\n}\nfunction getLegendDefWithScale(model, channel) {\n const scale = model.scaleName(channel);\n if (model.mark === 'trail') {\n if (channel === 'color') {\n // trail is a filled mark, but its default symbolType (\"stroke\") should use \"stroke\"\n return { stroke: scale };\n }\n else if (channel === 'size') {\n return { strokeWidth: scale };\n }\n }\n if (channel === 'color') {\n return model.markDef.filled ? { fill: scale } : { stroke: scale };\n }\n return { [channel]: scale };\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isExplicit(value, property, legend, fieldDef) {\n switch (property) {\n case 'disable':\n return legend !== undefined; // if axis is specified or null/false, then it's enable/disable state is explicit\n case 'values':\n // specified legend.values is already respected, but may get transformed.\n return !!(legend === null || legend === void 0 ? void 0 : legend.values);\n case 'title':\n // title can be explicit if fieldDef.title is set\n if (property === 'title' && value === (fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.title)) {\n return true;\n }\n }\n // Otherwise, things are explicit if the returned value matches the specified property\n return value === (legend || {})[property];\n}\nexport function parseLegendForChannel(model, channel) {\n var _a, _b, _c;\n let legend = model.legend(channel);\n const { markDef, encoding, config } = model;\n const legendConfig = config.legend;\n const legendCmpt = new LegendComponent({}, getLegendDefWithScale(model, channel));\n parseInteractiveLegend(model, channel, legendCmpt);\n const disable = legend !== undefined ? !legend : legendConfig.disable;\n legendCmpt.set('disable', disable, legend !== undefined);\n if (disable) {\n return legendCmpt;\n }\n legend = legend || {};\n const scaleType = model.getScaleComponent(channel).get('type');\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n const timeUnit = isFieldDef(fieldOrDatumDef) ? (_a = normalizeTimeUnit(fieldOrDatumDef.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit : undefined;\n const orient = legend.orient || config.legend.orient || 'right';\n const legendType = getLegendType({ legend, channel, timeUnit, scaleType });\n const direction = getDirection({ legend, legendType, orient, legendConfig });\n const ruleParams = {\n legend,\n channel,\n model,\n markDef,\n encoding,\n fieldOrDatumDef,\n legendConfig,\n config,\n scaleType,\n orient,\n legendType,\n direction\n };\n for (const property of LEGEND_COMPONENT_PROPERTIES) {\n if ((legendType === 'gradient' && property.startsWith('symbol')) ||\n (legendType === 'symbol' && property.startsWith('gradient'))) {\n continue;\n }\n const value = property in legendRules ? legendRules[property](ruleParams) : legend[property];\n if (value !== undefined) {\n const explicit = isExplicit(value, property, legend, model.fieldDef(channel));\n if (explicit || config.legend[property] === undefined) {\n legendCmpt.set(property, value, explicit);\n }\n }\n }\n const legendEncoding = (_b = legend === null || legend === void 0 ? void 0 : legend.encoding) !== null && _b !== void 0 ? _b : {};\n const selections = legendCmpt.get('selections');\n const legendEncode = {};\n const legendEncodeParams = { fieldOrDatumDef, model, channel, legendCmpt, legendType };\n for (const part of ['labels', 'legend', 'title', 'symbols', 'gradient', 'entries']) {\n const legendEncodingPart = guideEncodeEntry((_c = legendEncoding[part]) !== null && _c !== void 0 ? _c : {}, model);\n const value = part in legendEncodeRules\n ? legendEncodeRules[part](legendEncodingPart, legendEncodeParams) // apply rule\n : legendEncodingPart; // no rule -- just default values\n if (value !== undefined && !isEmpty(value)) {\n legendEncode[part] = Object.assign(Object.assign(Object.assign({}, ((selections === null || selections === void 0 ? void 0 : selections.length) && isFieldDef(fieldOrDatumDef)\n ? { name: `${varName(fieldOrDatumDef.field)}_legend_${part}` }\n : {})), ((selections === null || selections === void 0 ? void 0 : selections.length) ? { interactive: !!selections } : {})), { update: value });\n }\n }\n if (!isEmpty(legendEncode)) {\n legendCmpt.set('encode', legendEncode, !!(legend === null || legend === void 0 ? void 0 : legend.encoding));\n }\n return legendCmpt;\n}\nfunction parseNonUnitLegend(model) {\n const { legends, resolve } = model.component;\n for (const child of model.children) {\n parseLegend(child);\n for (const channel of keys(child.component.legends)) {\n resolve.legend[channel] = parseGuideResolve(model.component.resolve, channel);\n if (resolve.legend[channel] === 'shared') {\n // If the resolve says shared (and has not been overridden)\n // We will try to merge and see if there is a conflict\n legends[channel] = mergeLegendComponent(legends[channel], child.component.legends[channel]);\n if (!legends[channel]) {\n // If merge returns nothing, there is a conflict so we cannot make the legend shared.\n // Thus, mark legend as independent and remove the legend component.\n resolve.legend[channel] = 'independent';\n delete legends[channel];\n }\n }\n }\n }\n for (const channel of keys(legends)) {\n for (const child of model.children) {\n if (!child.component.legends[channel]) {\n // skip if the child does not have a particular legend\n continue;\n }\n if (resolve.legend[channel] === 'shared') {\n // After merging shared legend, make sure to remove legend from child\n delete child.component.legends[channel];\n }\n }\n }\n return legends;\n}\nexport function mergeLegendComponent(mergedLegend, childLegend) {\n var _a, _b, _c, _d;\n if (!mergedLegend) {\n return childLegend.clone();\n }\n const mergedOrient = mergedLegend.getWithExplicit('orient');\n const childOrient = childLegend.getWithExplicit('orient');\n if (mergedOrient.explicit && childOrient.explicit && mergedOrient.value !== childOrient.value) {\n // TODO: throw warning if resolve is explicit (We don't have info about explicit/implicit resolve yet.)\n // Cannot merge due to inconsistent orient\n return undefined;\n }\n let typeMerged = false;\n // Otherwise, let's merge\n for (const prop of LEGEND_COMPONENT_PROPERTIES) {\n const mergedValueWithExplicit = mergeValuesWithExplicit(mergedLegend.getWithExplicit(prop), childLegend.getWithExplicit(prop), prop, 'legend', \n // Tie breaker function\n (v1, v2) => {\n switch (prop) {\n case 'symbolType':\n return mergeSymbolType(v1, v2);\n case 'title':\n return mergeTitleComponent(v1, v2);\n case 'type':\n // There are only two types. If we have different types, then prefer symbol over gradient.\n typeMerged = true;\n return makeImplicit('symbol');\n }\n return defaultTieBreaker(v1, v2, prop, 'legend');\n });\n mergedLegend.setWithExplicit(prop, mergedValueWithExplicit);\n }\n if (typeMerged) {\n if ((_b = (_a = mergedLegend.implicit) === null || _a === void 0 ? void 0 : _a.encode) === null || _b === void 0 ? void 0 : _b.gradient) {\n deleteNestedProperty(mergedLegend.implicit, ['encode', 'gradient']);\n }\n if ((_d = (_c = mergedLegend.explicit) === null || _c === void 0 ? void 0 : _c.encode) === null || _d === void 0 ? void 0 : _d.gradient) {\n deleteNestedProperty(mergedLegend.explicit, ['encode', 'gradient']);\n }\n }\n return mergedLegend;\n}\nfunction mergeSymbolType(st1, st2) {\n if (st2.value === 'circle') {\n // prefer \"circle\" over \"stroke\"\n return st2;\n }\n return st1;\n}\n//# sourceMappingURL=parse.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { LEGEND_SCALE_CHANNELS } from '../../legend';\nimport { keys, replaceAll, stringify, vals } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { mergeLegendComponent } from './parse';\nfunction setLegendEncode(legend, part, vgProp, vgRef) {\n var _a, _b, _c;\n legend.encode = (_a = legend.encode) !== null && _a !== void 0 ? _a : {};\n legend.encode[part] = (_b = legend.encode[part]) !== null && _b !== void 0 ? _b : {};\n legend.encode[part].update = (_c = legend.encode[part].update) !== null && _c !== void 0 ? _c : {};\n // TODO: remove as any after https://github.com/prisma/nexus-prisma/issues/291\n legend.encode[part].update[vgProp] = vgRef;\n}\nexport function assembleLegends(model) {\n const legendComponentIndex = model.component.legends;\n const legendByDomain = {};\n for (const channel of keys(legendComponentIndex)) {\n const scaleComponent = model.getScaleComponent(channel);\n const domainHash = stringify(scaleComponent.get('domains'));\n if (legendByDomain[domainHash]) {\n for (const mergedLegendComponent of legendByDomain[domainHash]) {\n const merged = mergeLegendComponent(mergedLegendComponent, legendComponentIndex[channel]);\n if (!merged) {\n // If cannot merge, need to add this legend separately\n legendByDomain[domainHash].push(legendComponentIndex[channel]);\n }\n }\n }\n else {\n legendByDomain[domainHash] = [legendComponentIndex[channel].clone()];\n }\n }\n const legends = vals(legendByDomain)\n .flat()\n .map(l => assembleLegend(l, model.config))\n .filter(l => l !== undefined);\n return legends;\n}\nexport function assembleLegend(legendCmpt, config) {\n var _a, _b, _c;\n const _d = legendCmpt.combine(), { disable, labelExpr, selections } = _d, legend = __rest(_d, [\"disable\", \"labelExpr\", \"selections\"]);\n if (disable) {\n return undefined;\n }\n if (config.aria === false && legend.aria == undefined) {\n legend.aria = false;\n }\n if ((_a = legend.encode) === null || _a === void 0 ? void 0 : _a.symbols) {\n const out = legend.encode.symbols.update;\n if (out.fill && out.fill['value'] !== 'transparent' && !out.stroke && !legend.stroke) {\n // For non color channel's legend, we need to override symbol stroke config from Vega config if stroke channel is not used.\n out.stroke = { value: 'transparent' };\n }\n // Remove properties that the legend is encoding.\n for (const property of LEGEND_SCALE_CHANNELS) {\n if (legend[property]) {\n delete out[property];\n }\n }\n }\n if (!legend.title) {\n // title schema doesn't include null, ''\n delete legend.title;\n }\n if (labelExpr !== undefined) {\n let expr = labelExpr;\n if (((_c = (_b = legend.encode) === null || _b === void 0 ? void 0 : _b.labels) === null || _c === void 0 ? void 0 : _c.update) && isSignalRef(legend.encode.labels.update.text)) {\n expr = replaceAll(labelExpr, 'datum.label', legend.encode.labels.update.text.signal);\n }\n setLegendEncode(legend, 'labels', 'text', { signal: expr });\n }\n return legend;\n}\n//# sourceMappingURL=assemble.js.map","import { contains } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { isConcatModel, isLayerModel } from '../model';\nexport function assembleProjections(model) {\n if (isLayerModel(model) || isConcatModel(model)) {\n return assembleProjectionsForModelAndChildren(model);\n }\n else {\n return assembleProjectionForModel(model);\n }\n}\nexport function assembleProjectionsForModelAndChildren(model) {\n return model.children.reduce((projections, child) => {\n return projections.concat(child.assembleProjections());\n }, assembleProjectionForModel(model));\n}\nexport function assembleProjectionForModel(model) {\n const component = model.component.projection;\n if (!component || component.merged) {\n return [];\n }\n const projection = component.combine();\n const { name } = projection; // we need to extract name so that it is always present in the output and pass TS type validation\n if (!component.data) {\n // generate custom projection, no automatic fitting\n return [\n Object.assign(Object.assign({ name }, { translate: { signal: '[width / 2, height / 2]' } }), projection)\n ];\n }\n else {\n // generate projection that uses extent fitting\n const size = {\n signal: `[${component.size.map(ref => ref.signal).join(', ')}]`\n };\n const fits = component.data.reduce((sources, data) => {\n const source = isSignalRef(data) ? data.signal : `data('${model.lookupDataSource(data)}')`;\n if (!contains(sources, source)) {\n // build a unique list of sources\n sources.push(source);\n }\n return sources;\n }, []);\n if (fits.length <= 0) {\n throw new Error(\"Projection's fit didn't find any data sources\");\n }\n return [\n Object.assign({ name,\n size, fit: {\n signal: fits.length > 1 ? `[${fits.join(', ')}]` : fits[0]\n } }, projection)\n ];\n }\n}\n//# sourceMappingURL=assemble.js.map","export const PROJECTION_PROPERTIES = [\n 'type',\n 'clipAngle',\n 'clipExtent',\n 'center',\n 'rotate',\n 'precision',\n 'reflectX',\n 'reflectY',\n 'coefficient',\n 'distance',\n 'fraction',\n 'lobes',\n 'parallel',\n 'radius',\n 'ratio',\n 'spacing',\n 'tilt'\n];\n//# sourceMappingURL=projection.js.map","import { Split } from '../split';\nexport class ProjectionComponent extends Split {\n constructor(name, specifiedProjection, size, data) {\n super(Object.assign({}, specifiedProjection), // all explicit properties of projection\n { name } // name as initial implicit property\n );\n this.specifiedProjection = specifiedProjection;\n this.size = size;\n this.data = data;\n this.merged = false;\n }\n /**\n * Whether the projection parameters should fit provided data.\n */\n get isFit() {\n return !!this.data;\n }\n}\n//# sourceMappingURL=component.js.map","import { hasOwnProperty } from 'vega-util';\nimport { LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2, SHAPE } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { DataSourceType } from '../../data';\nimport { PROJECTION_PROPERTIES } from '../../projection';\nimport { GEOJSON } from '../../type';\nimport { duplicate, every, stringify } from '../../util';\nimport { isUnitModel } from '../model';\nimport { ProjectionComponent } from './component';\nexport function parseProjection(model) {\n model.component.projection = isUnitModel(model) ? parseUnitProjection(model) : parseNonUnitProjections(model);\n}\nfunction parseUnitProjection(model) {\n var _a;\n if (model.hasProjection) {\n const proj = model.specifiedProjection;\n const fit = !(proj && (proj.scale != null || proj.translate != null));\n const size = fit ? [model.getSizeSignalRef('width'), model.getSizeSignalRef('height')] : undefined;\n const data = fit ? gatherFitData(model) : undefined;\n return new ProjectionComponent(model.projectionName(true), Object.assign(Object.assign({}, ((_a = model.config.projection) !== null && _a !== void 0 ? _a : {})), (proj !== null && proj !== void 0 ? proj : {})), size, data);\n }\n return undefined;\n}\nfunction gatherFitData(model) {\n const data = [];\n const { encoding } = model;\n for (const posssiblePair of [\n [LONGITUDE, LATITUDE],\n [LONGITUDE2, LATITUDE2]\n ]) {\n if (getFieldOrDatumDef(encoding[posssiblePair[0]]) || getFieldOrDatumDef(encoding[posssiblePair[1]])) {\n data.push({\n signal: model.getName(`geojson_${data.length}`)\n });\n }\n }\n if (model.channelHasField(SHAPE) && model.typedFieldDef(SHAPE).type === GEOJSON) {\n data.push({\n signal: model.getName(`geojson_${data.length}`)\n });\n }\n if (data.length === 0) {\n // main source is geojson, so we can just use that\n data.push(model.requestDataName(DataSourceType.Main));\n }\n return data;\n}\nfunction mergeIfNoConflict(first, second) {\n const allPropertiesShared = every(PROJECTION_PROPERTIES, prop => {\n // neither has the property\n if (!hasOwnProperty(first.explicit, prop) && !hasOwnProperty(second.explicit, prop)) {\n return true;\n }\n // both have property and an equal value for property\n if (hasOwnProperty(first.explicit, prop) &&\n hasOwnProperty(second.explicit, prop) &&\n // some properties might be signals or objects and require hashing for comparison\n stringify(first.get(prop)) === stringify(second.get(prop))) {\n return true;\n }\n return false;\n });\n const size = stringify(first.size) === stringify(second.size);\n if (size) {\n if (allPropertiesShared) {\n return first;\n }\n else if (stringify(first.explicit) === stringify({})) {\n return second;\n }\n else if (stringify(second.explicit) === stringify({})) {\n return first;\n }\n }\n // if all properties don't match, let each unit spec have its own projection\n return null;\n}\nfunction parseNonUnitProjections(model) {\n if (model.children.length === 0) {\n return undefined;\n }\n let nonUnitProjection;\n // parse all children first\n for (const child of model.children) {\n parseProjection(child);\n }\n // analyze parsed projections, attempt to merge\n const mergable = every(model.children, child => {\n const projection = child.component.projection;\n if (!projection) {\n // child layer does not use a projection\n return true;\n }\n else if (!nonUnitProjection) {\n // cached 'projection' is null, cache this one\n nonUnitProjection = projection;\n return true;\n }\n else {\n const merge = mergeIfNoConflict(nonUnitProjection, projection);\n if (merge) {\n nonUnitProjection = merge;\n }\n return !!merge;\n }\n });\n // if cached one and all other children share the same projection,\n if (nonUnitProjection && mergable) {\n // so we can elevate it to the layer level\n const name = model.projectionName(true);\n const modelProjection = new ProjectionComponent(name, nonUnitProjection.specifiedProjection, nonUnitProjection.size, duplicate(nonUnitProjection.data));\n // rename and assign all others as merged\n for (const child of model.children) {\n const projection = child.component.projection;\n if (projection) {\n if (projection.isFit) {\n modelProjection.data.push(...child.component.projection.data);\n }\n child.renameProjection(projection.get('name'), name);\n projection.merged = true;\n }\n }\n return modelProjection;\n }\n return undefined;\n}\n//# sourceMappingURL=parse.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isString } from 'vega-util';\nimport { binToString, isBinning, isSelectionExtent } from '../../bin';\nimport { binRequiresRange, isTypedFieldDef, normalizeBin, vgField } from '../../channeldef';\nimport { duplicate, hash, isEmpty, keys, replacePathInField, unique, vals, varName } from '../../util';\nimport { binFormatExpression } from '../format';\nimport { isUnitModel } from '../model';\nimport { parseSelectionBinExtent } from '../selection/parse';\nimport { DataFlowNode } from './dataflow';\nfunction rangeFormula(model, fieldDef, channel, config) {\n var _a, _b;\n if (binRequiresRange(fieldDef, channel)) {\n // read format from axis or legend, if there is no format then use config.numberFormat\n const guide = isUnitModel(model)\n ? (_b = (_a = model.axis(channel)) !== null && _a !== void 0 ? _a : model.legend(channel)) !== null && _b !== void 0 ? _b : {} : {};\n const startField = vgField(fieldDef, { expr: 'datum' });\n const endField = vgField(fieldDef, { expr: 'datum', binSuffix: 'end' });\n return {\n formulaAs: vgField(fieldDef, { binSuffix: 'range', forAs: true }),\n formula: binFormatExpression(startField, endField, guide.format, guide.formatType, config)\n };\n }\n return {};\n}\nfunction binKey(bin, field) {\n return `${binToString(bin)}_${field}`;\n}\nfunction getSignalsFromModel(model, key) {\n return {\n signal: model.getName(`${key}_bins`),\n extentSignal: model.getName(`${key}_extent`)\n };\n}\nexport function getBinSignalName(model, field, bin) {\n var _a;\n const normalizedBin = (_a = normalizeBin(bin, undefined)) !== null && _a !== void 0 ? _a : {};\n const key = binKey(normalizedBin, field);\n return model.getName(`${key}_bins`);\n}\nfunction isBinTransform(t) {\n return 'as' in t;\n}\nfunction createBinComponent(t, bin, model) {\n let as;\n let span;\n if (isBinTransform(t)) {\n as = isString(t.as) ? [t.as, `${t.as}_end`] : [t.as[0], t.as[1]];\n }\n else {\n as = [vgField(t, { forAs: true }), vgField(t, { binSuffix: 'end', forAs: true })];\n }\n const normalizedBin = Object.assign({}, normalizeBin(bin, undefined));\n const key = binKey(normalizedBin, t.field);\n const { signal, extentSignal } = getSignalsFromModel(model, key);\n if (isSelectionExtent(normalizedBin.extent)) {\n const ext = normalizedBin.extent;\n const selName = ext.selection;\n span = parseSelectionBinExtent(model.getSelectionComponent(varName(selName), selName), ext);\n delete normalizedBin.extent; // Vega-Lite selection extent map to Vega's span property.\n }\n const binComponent = Object.assign(Object.assign(Object.assign({ bin: normalizedBin, field: t.field, as: [as] }, (signal ? { signal } : {})), (extentSignal ? { extentSignal } : {})), (span ? { span } : {}));\n return { key, binComponent };\n}\nexport class BinNode extends DataFlowNode {\n constructor(parent, bins) {\n super(parent);\n this.bins = bins;\n }\n clone() {\n return new BinNode(null, duplicate(this.bins));\n }\n static makeFromEncoding(parent, model) {\n const bins = model.reduceFieldDef((binComponentIndex, fieldDef, channel) => {\n if (isTypedFieldDef(fieldDef) && isBinning(fieldDef.bin)) {\n const { key, binComponent } = createBinComponent(fieldDef, fieldDef.bin, model);\n binComponentIndex[key] = Object.assign(Object.assign(Object.assign({}, binComponent), binComponentIndex[key]), rangeFormula(model, fieldDef, channel, model.config));\n }\n return binComponentIndex;\n }, {});\n if (isEmpty(bins)) {\n return null;\n }\n return new BinNode(parent, bins);\n }\n /**\n * Creates a bin node from BinTransform.\n * The optional parameter should provide\n */\n static makeFromTransform(parent, t, model) {\n const { key, binComponent } = createBinComponent(t, t.bin, model);\n return new BinNode(parent, {\n [key]: binComponent\n });\n }\n /**\n * Merge bin nodes. This method either integrates the bin config from the other node\n * or if this node already has a bin config, renames the corresponding signal in the model.\n */\n merge(other, renameSignal) {\n for (const key of keys(other.bins)) {\n if (key in this.bins) {\n renameSignal(other.bins[key].signal, this.bins[key].signal);\n // Ensure that we don't have duplicate names for signal pairs\n this.bins[key].as = unique([...this.bins[key].as, ...other.bins[key].as], hash);\n }\n else {\n this.bins[key] = other.bins[key];\n }\n }\n for (const child of other.children) {\n other.removeChild(child);\n child.parent = this;\n }\n other.remove();\n }\n producedFields() {\n return new Set(vals(this.bins)\n .map(c => c.as)\n .flat(2));\n }\n dependentFields() {\n return new Set(vals(this.bins).map(c => c.field));\n }\n hash() {\n return `Bin ${hash(this.bins)}`;\n }\n assemble() {\n return vals(this.bins).flatMap(bin => {\n const transform = [];\n const [binAs, ...remainingAs] = bin.as;\n const _a = bin.bin, { extent } = _a, params = __rest(_a, [\"extent\"]);\n const binTrans = Object.assign(Object.assign(Object.assign({ type: 'bin', field: replacePathInField(bin.field), as: binAs, signal: bin.signal }, (!isSelectionExtent(extent) ? { extent } : { extent: null })), (bin.span ? { span: { signal: `span(${bin.span})` } } : {})), params);\n if (!extent && bin.extentSignal) {\n transform.push({\n type: 'extent',\n field: replacePathInField(bin.field),\n signal: bin.extentSignal\n });\n binTrans.extent = { signal: bin.extentSignal };\n }\n transform.push(binTrans);\n for (const as of remainingAs) {\n for (let i = 0; i < 2; i++) {\n transform.push({\n type: 'formula',\n expr: vgField({ field: binAs[i] }, { expr: 'datum' }),\n as: as[i]\n });\n }\n }\n if (bin.formula) {\n transform.push({\n type: 'formula',\n expr: bin.formula,\n as: bin.formulaAs\n });\n }\n return transform;\n });\n }\n}\n//# sourceMappingURL=bin.js.map","import { isArgmaxDef, isArgminDef } from '../../aggregate';\nimport { getPositionChannelFromLatLong, getSecondaryRangeChannel, isGeoPositionChannel, isScaleChannel } from '../../channel';\nimport { binRequiresRange, hasBand, isTypedFieldDef, vgField } from '../../channeldef';\nimport * as log from '../../log';\nimport { duplicate, hash, keys, replacePathInField, setEqual } from '../../util';\nimport { isUnitModel } from '../model';\nimport { DataFlowNode } from './dataflow';\nfunction addDimension(dims, channel, fieldDef, model) {\n const channelDef2 = isUnitModel(model) ? model.encoding[getSecondaryRangeChannel(channel)] : undefined;\n if (isTypedFieldDef(fieldDef) &&\n isUnitModel(model) &&\n hasBand(channel, fieldDef, channelDef2, model.stack, model.markDef, model.config)) {\n dims.add(vgField(fieldDef, {}));\n dims.add(vgField(fieldDef, { suffix: 'end' }));\n if (fieldDef.bin && binRequiresRange(fieldDef, channel)) {\n dims.add(vgField(fieldDef, { binSuffix: 'range' }));\n }\n }\n else if (isGeoPositionChannel(channel)) {\n const posChannel = getPositionChannelFromLatLong(channel);\n dims.add(model.getName(posChannel));\n }\n else {\n dims.add(vgField(fieldDef));\n }\n return dims;\n}\nfunction mergeMeasures(parentMeasures, childMeasures) {\n var _a;\n for (const field of keys(childMeasures)) {\n // when we merge a measure, we either have to add an aggregation operator or even a new field\n const ops = childMeasures[field];\n for (const op of keys(ops)) {\n if (field in parentMeasures) {\n // add operator to existing measure field\n parentMeasures[field][op] = new Set([...((_a = parentMeasures[field][op]) !== null && _a !== void 0 ? _a : []), ...ops[op]]);\n }\n else {\n parentMeasures[field] = { [op]: ops[op] };\n }\n }\n }\n}\nexport class AggregateNode extends DataFlowNode {\n /**\n * @param dimensions string set for dimensions\n * @param measures dictionary mapping field name => dict of aggregation functions and names to use\n */\n constructor(parent, dimensions, measures) {\n super(parent);\n this.dimensions = dimensions;\n this.measures = measures;\n }\n clone() {\n return new AggregateNode(null, new Set(this.dimensions), duplicate(this.measures));\n }\n get groupBy() {\n return this.dimensions;\n }\n static makeFromEncoding(parent, model) {\n let isAggregate = false;\n model.forEachFieldDef(fd => {\n if (fd.aggregate) {\n isAggregate = true;\n }\n });\n const meas = {};\n const dims = new Set();\n if (!isAggregate) {\n // no need to create this node if the model has no aggregation\n return null;\n }\n model.forEachFieldDef((fieldDef, channel) => {\n var _a, _b, _c, _d;\n const { aggregate, field } = fieldDef;\n if (aggregate) {\n if (aggregate === 'count') {\n meas['*'] = (_a = meas['*']) !== null && _a !== void 0 ? _a : {};\n meas['*']['count'] = new Set([vgField(fieldDef, { forAs: true })]);\n }\n else {\n if (isArgminDef(aggregate) || isArgmaxDef(aggregate)) {\n const op = isArgminDef(aggregate) ? 'argmin' : 'argmax';\n const argField = aggregate[op];\n meas[argField] = (_b = meas[argField]) !== null && _b !== void 0 ? _b : {};\n meas[argField][op] = new Set([vgField({ op, field: argField }, { forAs: true })]);\n }\n else {\n meas[field] = (_c = meas[field]) !== null && _c !== void 0 ? _c : {};\n meas[field][aggregate] = new Set([vgField(fieldDef, { forAs: true })]);\n }\n // For scale channel with domain === 'unaggregated', add min/max so we can use their union as unaggregated domain\n if (isScaleChannel(channel) && model.scaleDomain(channel) === 'unaggregated') {\n meas[field] = (_d = meas[field]) !== null && _d !== void 0 ? _d : {};\n meas[field]['min'] = new Set([vgField({ field, aggregate: 'min' }, { forAs: true })]);\n meas[field]['max'] = new Set([vgField({ field, aggregate: 'max' }, { forAs: true })]);\n }\n }\n }\n else {\n addDimension(dims, channel, fieldDef, model);\n }\n });\n if (dims.size + keys(meas).length === 0) {\n return null;\n }\n return new AggregateNode(parent, dims, meas);\n }\n static makeFromTransform(parent, t) {\n var _a, _b, _c;\n const dims = new Set();\n const meas = {};\n for (const s of t.aggregate) {\n const { op, field, as } = s;\n if (op) {\n if (op === 'count') {\n meas['*'] = (_a = meas['*']) !== null && _a !== void 0 ? _a : {};\n meas['*']['count'] = new Set([as ? as : vgField(s, { forAs: true })]);\n }\n else {\n meas[field] = (_b = meas[field]) !== null && _b !== void 0 ? _b : {};\n meas[field][op] = new Set([as ? as : vgField(s, { forAs: true })]);\n }\n }\n }\n for (const s of (_c = t.groupby) !== null && _c !== void 0 ? _c : []) {\n dims.add(s);\n }\n if (dims.size + keys(meas).length === 0) {\n return null;\n }\n return new AggregateNode(parent, dims, meas);\n }\n merge(other) {\n if (setEqual(this.dimensions, other.dimensions)) {\n mergeMeasures(this.measures, other.measures);\n return true;\n }\n else {\n log.debug('different dimensions, cannot merge');\n return false;\n }\n }\n addDimensions(fields) {\n fields.forEach(this.dimensions.add, this.dimensions);\n }\n dependentFields() {\n return new Set([...this.dimensions, ...keys(this.measures)]);\n }\n producedFields() {\n const out = new Set();\n for (const field of keys(this.measures)) {\n for (const op of keys(this.measures[field])) {\n const m = this.measures[field][op];\n if (m.size === 0) {\n out.add(`${op}_${field}`);\n }\n else {\n m.forEach(out.add, out);\n }\n }\n }\n return out;\n }\n hash() {\n return `Aggregate ${hash({ dimensions: this.dimensions, measures: this.measures })}`;\n }\n assemble() {\n const ops = [];\n const fields = [];\n const as = [];\n for (const field of keys(this.measures)) {\n for (const op of keys(this.measures[field])) {\n for (const alias of this.measures[field][op]) {\n as.push(alias);\n ops.push(op);\n fields.push(field === '*' ? null : replacePathInField(field));\n }\n }\n }\n const result = {\n type: 'aggregate',\n groupby: [...this.dimensions].map(replacePathInField),\n ops,\n fields,\n as\n };\n return result;\n }\n}\n//# sourceMappingURL=aggregate.js.map","import { isArray } from 'vega-util';\nimport { isBinning } from '../../bin';\nimport { COLUMN, FACET_CHANNELS, POSITION_SCALE_CHANNELS, ROW } from '../../channel';\nimport { vgField } from '../../channeldef';\nimport * as log from '../../log';\nimport { hasDiscreteDomain } from '../../scale';\nimport { DEFAULT_SORT_OP, isSortField } from '../../sort';\nimport { hash } from '../../util';\nimport { isVgRangeStep } from '../../vega.schema';\nimport { HEADER_CHANNELS, HEADER_TYPES } from '../header/component';\nimport { assembleDomain, getFieldFromDomain } from '../scale/domain';\nimport { sortArrayIndexField } from './calculate';\nimport { DataFlowNode } from './dataflow';\n/**\n * A node that helps us track what fields we are faceting by.\n */\nexport class FacetNode extends DataFlowNode {\n /**\n * @param model The facet model.\n * @param name The name that this facet source will have.\n * @param data The source data for this facet data.\n */\n constructor(parent, model, name, data) {\n super(parent);\n this.model = model;\n this.name = name;\n this.data = data;\n for (const channel of FACET_CHANNELS) {\n const fieldDef = model.facet[channel];\n if (fieldDef) {\n const { bin, sort } = fieldDef;\n this[channel] = Object.assign({ name: model.getName(`${channel}_domain`), fields: [vgField(fieldDef), ...(isBinning(bin) ? [vgField(fieldDef, { binSuffix: 'end' })] : [])] }, (isSortField(sort)\n ? { sortField: sort }\n : isArray(sort)\n ? { sortIndexField: sortArrayIndexField(fieldDef, channel) }\n : {}));\n }\n }\n this.childModel = model.child;\n }\n hash() {\n let out = `Facet`;\n for (const channel of FACET_CHANNELS) {\n if (this[channel]) {\n out += ` ${channel.charAt(0)}:${hash(this[channel])}`;\n }\n }\n return out;\n }\n get fields() {\n var _a;\n const f = [];\n for (const channel of FACET_CHANNELS) {\n if ((_a = this[channel]) === null || _a === void 0 ? void 0 : _a.fields) {\n f.push(...this[channel].fields);\n }\n }\n return f;\n }\n dependentFields() {\n const depFields = new Set(this.fields);\n for (const channel of FACET_CHANNELS) {\n if (this[channel]) {\n if (this[channel].sortField) {\n depFields.add(this[channel].sortField.field);\n }\n if (this[channel].sortIndexField) {\n depFields.add(this[channel].sortIndexField);\n }\n }\n }\n return depFields;\n }\n producedFields() {\n return new Set(); // facet does not produce any new fields\n }\n /**\n * The name to reference this source is its name.\n */\n getSource() {\n return this.name;\n }\n getChildIndependentFieldsWithStep() {\n const childIndependentFieldsWithStep = {};\n for (const channel of POSITION_SCALE_CHANNELS) {\n const childScaleComponent = this.childModel.component.scales[channel];\n if (childScaleComponent && !childScaleComponent.merged) {\n // independent scale\n const type = childScaleComponent.get('type');\n const range = childScaleComponent.get('range');\n if (hasDiscreteDomain(type) && isVgRangeStep(range)) {\n const domain = assembleDomain(this.childModel, channel);\n const field = getFieldFromDomain(domain);\n if (field) {\n childIndependentFieldsWithStep[channel] = field;\n }\n else {\n log.warn(log.message.unknownField(channel));\n }\n }\n }\n }\n return childIndependentFieldsWithStep;\n }\n assembleRowColumnHeaderData(channel, crossedDataName, childIndependentFieldsWithStep) {\n const childChannel = { row: 'y', column: 'x' }[channel];\n const fields = [];\n const ops = [];\n const as = [];\n if (childIndependentFieldsWithStep && childIndependentFieldsWithStep[childChannel]) {\n if (crossedDataName) {\n // If there is a crossed data, calculate max\n fields.push(`distinct_${childIndependentFieldsWithStep[childChannel]}`);\n ops.push('max');\n }\n else {\n // If there is no crossed data, just calculate distinct\n fields.push(childIndependentFieldsWithStep[childChannel]);\n ops.push('distinct');\n }\n // Although it is technically a max, just name it distinct so it's easier to refer to it\n as.push(`distinct_${childIndependentFieldsWithStep[childChannel]}`);\n }\n const { sortField, sortIndexField } = this[channel];\n if (sortField) {\n const { op = DEFAULT_SORT_OP, field } = sortField;\n fields.push(field);\n ops.push(op);\n as.push(vgField(sortField, { forAs: true }));\n }\n else if (sortIndexField) {\n fields.push(sortIndexField);\n ops.push('max');\n as.push(sortIndexField);\n }\n return {\n name: this[channel].name,\n // Use data from the crossed one if it exist\n source: crossedDataName !== null && crossedDataName !== void 0 ? crossedDataName : this.data,\n transform: [\n Object.assign({ type: 'aggregate', groupby: this[channel].fields }, (fields.length\n ? {\n fields,\n ops,\n as\n }\n : {}))\n ]\n };\n }\n assembleFacetHeaderData(childIndependentFieldsWithStep) {\n var _a, _b;\n const { columns } = this.model.layout;\n const { layoutHeaders } = this.model.component;\n const data = [];\n const hasSharedAxis = {};\n for (const headerChannel of HEADER_CHANNELS) {\n for (const headerType of HEADER_TYPES) {\n const headers = (_a = (layoutHeaders[headerChannel] && layoutHeaders[headerChannel][headerType])) !== null && _a !== void 0 ? _a : [];\n for (const header of headers) {\n if (((_b = header.axes) === null || _b === void 0 ? void 0 : _b.length) > 0) {\n hasSharedAxis[headerChannel] = true;\n break;\n }\n }\n }\n if (hasSharedAxis[headerChannel]) {\n const cardinality = `length(data(\"${this.facet.name}\"))`;\n const stop = headerChannel === 'row'\n ? columns\n ? { signal: `ceil(${cardinality} / ${columns})` }\n : 1\n : columns\n ? { signal: `min(${cardinality}, ${columns})` }\n : { signal: cardinality };\n data.push({\n name: `${this.facet.name}_${headerChannel}`,\n transform: [\n {\n type: 'sequence',\n start: 0,\n stop\n }\n ]\n });\n }\n }\n const { row, column } = hasSharedAxis;\n if (row || column) {\n data.unshift(this.assembleRowColumnHeaderData('facet', null, childIndependentFieldsWithStep));\n }\n return data;\n }\n assemble() {\n var _a, _b;\n const data = [];\n let crossedDataName = null;\n const childIndependentFieldsWithStep = this.getChildIndependentFieldsWithStep();\n const { column, row, facet } = this;\n if (column && row && (childIndependentFieldsWithStep.x || childIndependentFieldsWithStep.y)) {\n // Need to create a cross dataset to correctly calculate cardinality\n crossedDataName = `cross_${this.column.name}_${this.row.name}`;\n const fields = [].concat((_a = childIndependentFieldsWithStep.x) !== null && _a !== void 0 ? _a : [], (_b = childIndependentFieldsWithStep.y) !== null && _b !== void 0 ? _b : []);\n const ops = fields.map(() => 'distinct');\n data.push({\n name: crossedDataName,\n source: this.data,\n transform: [\n {\n type: 'aggregate',\n groupby: this.fields,\n fields,\n ops\n }\n ]\n });\n }\n for (const channel of [COLUMN, ROW]) {\n if (this[channel]) {\n data.push(this.assembleRowColumnHeaderData(channel, crossedDataName, childIndependentFieldsWithStep));\n }\n }\n if (facet) {\n const facetData = this.assembleFacetHeaderData(childIndependentFieldsWithStep);\n if (facetData) {\n data.push(...facetData);\n }\n }\n return data;\n }\n}\n//# sourceMappingURL=facet.js.map","import { isNumber, isString } from 'vega-util';\nimport { isMinMaxOp } from '../../aggregate';\nimport { getMainRangeChannel } from '../../channel';\nimport { isFieldDef, isFieldOrDatumDefForTimeFormat, isScaleFieldDef, isTypedFieldDef } from '../../channeldef';\nimport { isGenerator } from '../../data';\nimport { isDateTime } from '../../datetime';\nimport * as log from '../../log';\nimport { forEachLeaf } from '../../logical';\nimport { isPathMark } from '../../mark';\nimport { isFieldEqualPredicate, isFieldGTEPredicate, isFieldGTPredicate, isFieldLTEPredicate, isFieldLTPredicate, isFieldOneOfPredicate, isFieldPredicate, isFieldRangePredicate } from '../../predicate';\nimport { isSortField } from '../../sort';\nimport { accessPathDepth, accessPathWithDatum, duplicate, hash, keys, removePathFromField } from '../../util';\nimport { signalRefOrValue } from '../common';\nimport { isFacetModel, isUnitModel } from '../model';\nimport { Split } from '../split';\nimport { DataFlowNode } from './dataflow';\n/**\n * Remove quotes from a string.\n */\nfunction unquote(pattern) {\n if ((pattern[0] === \"'\" && pattern[pattern.length - 1] === \"'\") ||\n (pattern[0] === '\"' && pattern[pattern.length - 1] === '\"')) {\n return pattern.slice(1, -1);\n }\n return pattern;\n}\n/**\n * @param field The field.\n * @param parse What to parse the field as.\n */\nfunction parseExpression(field, parse) {\n const f = accessPathWithDatum(field);\n if (parse === 'number') {\n return `toNumber(${f})`;\n }\n else if (parse === 'boolean') {\n return `toBoolean(${f})`;\n }\n else if (parse === 'string') {\n return `toString(${f})`;\n }\n else if (parse === 'date') {\n return `toDate(${f})`;\n }\n else if (parse === 'flatten') {\n return f;\n }\n else if (parse.indexOf('date:') === 0) {\n const specifier = unquote(parse.slice(5, parse.length));\n return `timeParse(${f},'${specifier}')`;\n }\n else if (parse.indexOf('utc:') === 0) {\n const specifier = unquote(parse.slice(4, parse.length));\n return `utcParse(${f},'${specifier}')`;\n }\n else {\n log.warn(log.message.unrecognizedParse(parse));\n return null;\n }\n}\nexport function getImplicitFromFilterTransform(transform) {\n const implicit = {};\n forEachLeaf(transform.filter, filter => {\n var _a;\n if (isFieldPredicate(filter)) {\n // Automatically add a parse node for filters with filter objects\n let val = null;\n // For EqualFilter, just use the equal property.\n // For RangeFilter and OneOfFilter, all array members should have\n // the same type, so we only use the first one.\n if (isFieldEqualPredicate(filter)) {\n val = signalRefOrValue(filter.equal);\n }\n else if (isFieldLTEPredicate(filter)) {\n val = signalRefOrValue(filter.lte);\n }\n else if (isFieldLTPredicate(filter)) {\n val = signalRefOrValue(filter.lt);\n }\n else if (isFieldGTPredicate(filter)) {\n val = signalRefOrValue(filter.gt);\n }\n else if (isFieldGTEPredicate(filter)) {\n val = signalRefOrValue(filter.gte);\n }\n else if (isFieldRangePredicate(filter)) {\n val = filter.range[0];\n }\n else if (isFieldOneOfPredicate(filter)) {\n val = ((_a = filter.oneOf) !== null && _a !== void 0 ? _a : filter['in'])[0];\n } // else -- for filter expression, we can't infer anything\n if (val) {\n if (isDateTime(val)) {\n implicit[filter.field] = 'date';\n }\n else if (isNumber(val)) {\n implicit[filter.field] = 'number';\n }\n else if (isString(val)) {\n implicit[filter.field] = 'string';\n }\n }\n if (filter.timeUnit) {\n implicit[filter.field] = 'date';\n }\n }\n });\n return implicit;\n}\n/**\n * Creates a parse node for implicit parsing from a model and updates ancestorParse.\n */\nexport function getImplicitFromEncoding(model) {\n const implicit = {};\n function add(fieldDef) {\n if (isFieldOrDatumDefForTimeFormat(fieldDef)) {\n implicit[fieldDef.field] = 'date';\n }\n else if (fieldDef.type === 'quantitative' &&\n isMinMaxOp(fieldDef.aggregate) // we need to parse numbers to support correct min and max\n ) {\n implicit[fieldDef.field] = 'number';\n }\n else if (accessPathDepth(fieldDef.field) > 1) {\n // For non-date/non-number (strings and booleans), derive a flattened field for a referenced nested field.\n // (Parsing numbers / dates already flattens numeric and temporal fields.)\n if (!(fieldDef.field in implicit)) {\n implicit[fieldDef.field] = 'flatten';\n }\n }\n else if (isScaleFieldDef(fieldDef) && isSortField(fieldDef.sort) && accessPathDepth(fieldDef.sort.field) > 1) {\n // Flatten fields that we sort by but that are not otherwise flattened.\n if (!(fieldDef.sort.field in implicit)) {\n implicit[fieldDef.sort.field] = 'flatten';\n }\n }\n }\n if (isUnitModel(model) || isFacetModel(model)) {\n // Parse encoded fields\n model.forEachFieldDef((fieldDef, channel) => {\n if (isTypedFieldDef(fieldDef)) {\n add(fieldDef);\n }\n else {\n const mainChannel = getMainRangeChannel(channel);\n const mainFieldDef = model.fieldDef(mainChannel);\n add(Object.assign(Object.assign({}, fieldDef), { type: mainFieldDef.type }));\n }\n });\n }\n // Parse quantitative dimension fields of path marks as numbers so that we sort them correctly.\n if (isUnitModel(model)) {\n const { mark, markDef, encoding } = model;\n if (isPathMark(mark) &&\n // No need to sort by dimension if we have a connected scatterplot (order channel is present)\n !model.encoding.order) {\n const dimensionChannel = markDef.orient === 'horizontal' ? 'y' : 'x';\n const dimensionChannelDef = encoding[dimensionChannel];\n if (isFieldDef(dimensionChannelDef) &&\n dimensionChannelDef.type === 'quantitative' &&\n !(dimensionChannelDef.field in implicit)) {\n implicit[dimensionChannelDef.field] = 'number';\n }\n }\n }\n return implicit;\n}\n/**\n * Creates a parse node for implicit parsing from a model and updates ancestorParse.\n */\nexport function getImplicitFromSelection(model) {\n const implicit = {};\n if (isUnitModel(model) && model.component.selection) {\n for (const name of keys(model.component.selection)) {\n const selCmpt = model.component.selection[name];\n for (const proj of selCmpt.project.items) {\n if (!proj.channel && accessPathDepth(proj.field) > 1) {\n implicit[proj.field] = 'flatten';\n }\n }\n }\n }\n return implicit;\n}\nexport class ParseNode extends DataFlowNode {\n constructor(parent, parse) {\n super(parent);\n this._parse = parse;\n }\n clone() {\n return new ParseNode(null, duplicate(this._parse));\n }\n hash() {\n return `Parse ${hash(this._parse)}`;\n }\n /**\n * Creates a parse node from a data.format.parse and updates ancestorParse.\n */\n static makeExplicit(parent, model, ancestorParse) {\n // Custom parse\n let explicit = {};\n const data = model.data;\n if (!isGenerator(data) && data && data.format && data.format.parse) {\n explicit = data.format.parse;\n }\n return this.makeWithAncestors(parent, explicit, {}, ancestorParse);\n }\n /**\n * Creates a parse node from \"explicit\" parse and \"implicit\" parse and updates ancestorParse.\n */\n static makeWithAncestors(parent, explicit, implicit, ancestorParse) {\n // We should not parse what has already been parsed in a parent (explicitly or implicitly) or what has been derived (maked as \"derived\"). We also don't need to flatten a field that has already been parsed.\n for (const field of keys(implicit)) {\n const parsedAs = ancestorParse.getWithExplicit(field);\n if (parsedAs.value !== undefined) {\n // We always ignore derived fields even if they are implicitly defined because we expect users to create the right types.\n if (parsedAs.explicit ||\n parsedAs.value === implicit[field] ||\n parsedAs.value === 'derived' ||\n implicit[field] === 'flatten') {\n delete implicit[field];\n }\n else {\n log.warn(log.message.differentParse(field, implicit[field], parsedAs.value));\n }\n }\n }\n for (const field of keys(explicit)) {\n const parsedAs = ancestorParse.get(field);\n if (parsedAs !== undefined) {\n // Don't parse a field again if it has been parsed with the same type already.\n if (parsedAs === explicit[field]) {\n delete explicit[field];\n }\n else {\n log.warn(log.message.differentParse(field, explicit[field], parsedAs));\n }\n }\n }\n const parse = new Split(explicit, implicit);\n // add the format parse from this model so that children don't parse the same field again\n ancestorParse.copyAll(parse);\n // copy only non-null parses\n const p = {};\n for (const key of keys(parse.combine())) {\n const val = parse.get(key);\n if (val !== null) {\n p[key] = val;\n }\n }\n if (keys(p).length === 0 || ancestorParse.parseNothing) {\n return null;\n }\n return new ParseNode(parent, p);\n }\n get parse() {\n return this._parse;\n }\n merge(other) {\n this._parse = Object.assign(Object.assign({}, this._parse), other.parse);\n other.remove();\n }\n /**\n * Assemble an object for Vega's format.parse property.\n */\n assembleFormatParse() {\n const formatParse = {};\n for (const field of keys(this._parse)) {\n const p = this._parse[field];\n if (accessPathDepth(field) === 1) {\n formatParse[field] = p;\n }\n }\n return formatParse;\n }\n // format parse depends and produces all fields in its parse\n producedFields() {\n return new Set(keys(this._parse));\n }\n dependentFields() {\n return new Set(keys(this._parse));\n }\n assembleTransforms(onlyNested = false) {\n return keys(this._parse)\n .filter(field => (onlyNested ? accessPathDepth(field) > 1 : true))\n .map(field => {\n const expr = parseExpression(field, this._parse[field]);\n if (!expr) {\n return null;\n }\n const formula = {\n type: 'formula',\n expr,\n as: removePathFromField(field) // Vega output is always flattened\n };\n return formula;\n })\n .filter(t => t !== null);\n }\n}\n//# sourceMappingURL=formatparse.js.map","import { SELECTION_ID } from '../../selection';\nimport { DataFlowNode } from './dataflow';\nexport class IdentifierNode extends DataFlowNode {\n clone() {\n return new IdentifierNode(null);\n }\n constructor(parent) {\n super(parent);\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return new Set([SELECTION_ID]);\n }\n hash() {\n return 'Identifier';\n }\n assemble() {\n return { type: 'identifier', as: SELECTION_ID };\n }\n}\n//# sourceMappingURL=identifier.js.map","import { hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class GraticuleNode extends DataFlowNode {\n constructor(parent, params) {\n super(parent);\n this.params = params;\n }\n clone() {\n return new GraticuleNode(null, this.params);\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return undefined; // there should never be a node before graticule\n }\n hash() {\n return `Graticule ${hash(this.params)}`;\n }\n assemble() {\n return Object.assign({ type: 'graticule' }, (this.params === true ? {} : this.params));\n }\n}\n//# sourceMappingURL=graticule.js.map","import { hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class SequenceNode extends DataFlowNode {\n constructor(parent, params) {\n super(parent);\n this.params = params;\n }\n clone() {\n return new SequenceNode(null, this.params);\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n var _a;\n return new Set([(_a = this.params.as) !== null && _a !== void 0 ? _a : 'data']);\n }\n hash() {\n return `Hash ${hash(this.params)}`;\n }\n assemble() {\n return Object.assign({ type: 'sequence' }, this.params);\n }\n}\n//# sourceMappingURL=sequence.js.map","import { isGenerator, isInlineData, isNamedData, isSphereGenerator, isUrlData } from '../../data';\nimport { contains, isEmpty, omit } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class SourceNode extends DataFlowNode {\n constructor(data) {\n super(null); // source cannot have parent\n data = data !== null && data !== void 0 ? data : { name: 'source' };\n let format;\n if (!isGenerator(data)) {\n format = data.format ? Object.assign({}, omit(data.format, ['parse'])) : {};\n }\n if (isInlineData(data)) {\n this._data = { values: data.values };\n }\n else if (isUrlData(data)) {\n this._data = { url: data.url };\n if (!format.type) {\n // Extract extension from URL using snippet from\n // http://stackoverflow.com/questions/680929/how-to-extract-extension-from-filename-string-in-javascript\n let defaultExtension = /(?:\\.([^.]+))?$/.exec(data.url)[1];\n if (!contains(['json', 'csv', 'tsv', 'dsv', 'topojson'], defaultExtension)) {\n defaultExtension = 'json';\n }\n // defaultExtension has type string but we ensure that it is DataFormatType above\n format.type = defaultExtension;\n }\n }\n else if (isSphereGenerator(data)) {\n // hardwire GeoJSON sphere data into output specification\n this._data = { values: [{ type: 'Sphere' }] };\n }\n else if (isNamedData(data) || isGenerator(data)) {\n this._data = {};\n }\n // set flag to check if generator\n this._generator = isGenerator(data);\n // any dataset can be named\n if (data.name) {\n this._name = data.name;\n }\n if (format && !isEmpty(format)) {\n this._data.format = format;\n }\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return undefined; // we don't know what this source produces\n }\n get data() {\n return this._data;\n }\n hasName() {\n return !!this._name;\n }\n get isGenerator() {\n return this._generator;\n }\n get dataName() {\n return this._name;\n }\n set dataName(name) {\n this._name = name;\n }\n set parent(parent) {\n throw new Error('Source nodes have to be roots.');\n }\n remove() {\n throw new Error('Source nodes are roots and cannot be removed.');\n }\n hash() {\n throw new Error('Cannot hash sources');\n }\n assemble() {\n return Object.assign(Object.assign({ name: this._name }, this._data), { transform: [] });\n }\n}\n//# sourceMappingURL=source.js.map","var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n privateMap.set(receiver, value);\n return value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n return privateMap.get(receiver);\n};\nvar _modified;\nimport { GraticuleNode } from './graticule';\nimport { SequenceNode } from './sequence';\nimport { SourceNode } from './source';\n/**\n * Whether this dataflow node is the source of the dataflow that produces data i.e. a source or a generator.\n */\nexport function isDataSourceNode(node) {\n return node instanceof SourceNode || node instanceof GraticuleNode || node instanceof SequenceNode;\n}\n/**\n * Abstract base class for Dataflow optimizers.\n * Contains only mutation handling logic. Subclasses need to implement iteration logic.\n */\nexport class Optimizer {\n constructor() {\n _modified.set(this, void 0);\n __classPrivateFieldSet(this, _modified, false);\n }\n // Once true, #modified is never set to false\n setModified() {\n __classPrivateFieldSet(this, _modified, true);\n }\n get modifiedFlag() {\n return __classPrivateFieldGet(this, _modified);\n }\n}\n_modified = new WeakMap();\n/**\n * Starts from a node and runs the optimization function (the \"run\" method) upwards to the root,\n * depending on the continue and modified flag values returned by the optimization function.\n */\nexport class BottomUpOptimizer extends Optimizer {\n /**\n * Compute a map of node depths that we can use to determine a topological sort order.\n */\n getNodeDepths(node, depth, depths) {\n depths.set(node, depth);\n for (const child of node.children) {\n this.getNodeDepths(child, depth + 1, depths);\n }\n return depths;\n }\n /**\n * Run the optimizer on all nodes starting from the leaves.\n */\n optimize(node) {\n const depths = this.getNodeDepths(node, 0, new Map());\n const topologicalSort = [...depths.entries()].sort((a, b) => b[1] - a[1]);\n for (const tuple of topologicalSort) {\n this.run(tuple[0]);\n }\n return this.modifiedFlag;\n }\n}\n/**\n * The optimizer function (the \"run\" method), is invoked on the given node and then continues recursively.\n */\nexport class TopDownOptimizer extends Optimizer {\n /**\n * Run the optimizer depth first on all nodes starting from the roots.\n */\n optimize(node) {\n this.run(node);\n for (const child of node.children) {\n this.optimize(child);\n }\n return this.modifiedFlag;\n }\n}\n//# sourceMappingURL=optimizer.js.map","import { fieldIntersection, hash, hasIntersection, isEmpty, keys, some } from '../../util';\nimport { requiresSelectionId } from '../selection';\nimport { AggregateNode } from './aggregate';\nimport { BinNode } from './bin';\nimport { OutputNode } from './dataflow';\nimport { FacetNode } from './facet';\nimport { FilterNode } from './filter';\nimport { ParseNode } from './formatparse';\nimport { IdentifierNode } from './identifier';\nimport { BottomUpOptimizer, isDataSourceNode, Optimizer, TopDownOptimizer } from './optimizer';\nimport { SourceNode } from './source';\nimport { TimeUnitNode } from './timeunit';\n/**\n * Merge identical nodes at forks by comparing hashes.\n *\n * Does not need to iterate from leaves so we implement this with recursion as it's a bit simpler.\n */\nexport class MergeIdenticalNodes extends TopDownOptimizer {\n mergeNodes(parent, nodes) {\n const mergedNode = nodes.shift();\n for (const node of nodes) {\n parent.removeChild(node);\n node.parent = mergedNode;\n node.remove();\n }\n }\n run(node) {\n const hashes = node.children.map(x => x.hash());\n const buckets = {};\n for (let i = 0; i < hashes.length; i++) {\n if (buckets[hashes[i]] === undefined) {\n buckets[hashes[i]] = [node.children[i]];\n }\n else {\n buckets[hashes[i]].push(node.children[i]);\n }\n }\n for (const k of keys(buckets)) {\n if (buckets[k].length > 1) {\n this.setModified();\n this.mergeNodes(node, buckets[k]);\n }\n }\n }\n}\n/**\n * Optimizer that removes identifier nodes that are not needed for selections.\n */\nexport class RemoveUnnecessaryIdentifierNodes extends TopDownOptimizer {\n constructor(model) {\n super();\n this.requiresSelectionId = model && requiresSelectionId(model);\n }\n run(node) {\n if (node instanceof IdentifierNode) {\n // Only preserve IdentifierNodes if we have default discrete selections\n // in our model tree, and if the nodes come after tuple producing nodes.\n if (!(this.requiresSelectionId &&\n (isDataSourceNode(node.parent) || node.parent instanceof AggregateNode || node.parent instanceof ParseNode))) {\n this.setModified();\n node.remove();\n }\n }\n }\n}\n/**\n * Removes duplicate time unit nodes (as determined by the name of the output field) that may be generated due to\n * selections projected over time units. Only keeps the first time unit in any branch.\n *\n * This optimizer is a custom top down optimizer that keep track of produced fields in a branch.\n */\nexport class RemoveDuplicateTimeUnits extends Optimizer {\n optimize(node) {\n this.run(node, new Set());\n return this.modifiedFlag;\n }\n run(node, timeUnitFields) {\n let producedFields = new Set();\n if (node instanceof TimeUnitNode) {\n producedFields = node.producedFields();\n if (hasIntersection(producedFields, timeUnitFields)) {\n this.setModified();\n node.removeFormulas(timeUnitFields);\n if (node.producedFields.length === 0) {\n node.remove();\n }\n }\n }\n for (const child of node.children) {\n this.run(child, new Set([...timeUnitFields, ...producedFields]));\n }\n }\n}\n/**\n * Remove output nodes that are not required.\n */\nexport class RemoveUnnecessaryOutputNodes extends TopDownOptimizer {\n constructor() {\n super();\n }\n run(node) {\n if (node instanceof OutputNode && !node.isRequired()) {\n this.setModified();\n node.remove();\n }\n }\n}\n/**\n * Move parse nodes up to forks and merges them if possible.\n */\nexport class MoveParseUp extends BottomUpOptimizer {\n run(node) {\n if (isDataSourceNode(node)) {\n return;\n }\n if (node.numChildren() > 1) {\n // Don't move parse further up but continue with parent.\n return;\n }\n for (const child of node.children) {\n if (child instanceof ParseNode) {\n if (node instanceof ParseNode) {\n this.setModified();\n node.merge(child);\n }\n else {\n // Don't swap with nodes that produce something that the parse node depends on (e.g. lookup).\n if (fieldIntersection(node.producedFields(), child.dependentFields())) {\n continue;\n }\n this.setModified();\n child.swapWithParent();\n }\n }\n }\n return;\n }\n}\n/**\n * Inserts an intermediate ParseNode containing all non-conflicting parse fields and removes the empty ParseNodes.\n *\n * We assume that dependent paths that do not have a parse node can be just merged.\n */\nexport class MergeParse extends BottomUpOptimizer {\n run(node) {\n const originalChildren = [...node.children];\n const parseChildren = node.children.filter((child) => child instanceof ParseNode);\n if (node.numChildren() > 1 && parseChildren.length >= 1) {\n const commonParse = {};\n const conflictingParse = new Set();\n for (const parseNode of parseChildren) {\n const parse = parseNode.parse;\n for (const k of keys(parse)) {\n if (!(k in commonParse)) {\n commonParse[k] = parse[k];\n }\n else if (commonParse[k] !== parse[k]) {\n conflictingParse.add(k);\n }\n }\n }\n for (const field of conflictingParse) {\n delete commonParse[field];\n }\n if (!isEmpty(commonParse)) {\n this.setModified();\n const mergedParseNode = new ParseNode(node, commonParse);\n for (const childNode of originalChildren) {\n if (childNode instanceof ParseNode) {\n for (const key of keys(commonParse)) {\n delete childNode.parse[key];\n }\n }\n node.removeChild(childNode);\n childNode.parent = mergedParseNode;\n // remove empty parse nodes\n if (childNode instanceof ParseNode && keys(childNode.parse).length === 0) {\n childNode.remove();\n }\n }\n }\n }\n }\n}\n/**\n * Repeatedly remove leaf nodes that are not output or facet nodes.\n * The reason is that we don't need subtrees that don't have any output nodes.\n * Facet nodes are needed for the row or column domains.\n */\nexport class RemoveUnusedSubtrees extends BottomUpOptimizer {\n run(node) {\n if (node instanceof OutputNode || node.numChildren() > 0 || node instanceof FacetNode) {\n // no need to continue with parent because it is output node or will have children (there was a fork)\n }\n else if (node instanceof SourceNode) {\n // ignore empty unused sources as they will be removed in optimizationDataflowHelper\n }\n else {\n this.setModified();\n node.remove();\n }\n }\n}\n/**\n * Merge adjacent time unit nodes.\n */\nexport class MergeTimeUnits extends BottomUpOptimizer {\n run(node) {\n const timeUnitChildren = node.children.filter((x) => x instanceof TimeUnitNode);\n const combination = timeUnitChildren.pop();\n for (const timeUnit of timeUnitChildren) {\n this.setModified();\n combination.merge(timeUnit);\n }\n }\n}\nexport class MergeAggregates extends BottomUpOptimizer {\n run(node) {\n const aggChildren = node.children.filter((child) => child instanceof AggregateNode);\n // Object which we'll use to map the fields which an aggregate is grouped by to\n // the set of aggregates with that grouping. This is useful as only aggregates\n // with the same group by can be merged\n const groupedAggregates = {};\n // Build groupedAggregates\n for (const agg of aggChildren) {\n const groupBys = hash(agg.groupBy);\n if (!(groupBys in groupedAggregates)) {\n groupedAggregates[groupBys] = [];\n }\n groupedAggregates[groupBys].push(agg);\n }\n // Merge aggregateNodes with same key in groupedAggregates\n for (const group of keys(groupedAggregates)) {\n const mergeableAggs = groupedAggregates[group];\n if (mergeableAggs.length > 1) {\n const mergedAggs = mergeableAggs.pop();\n for (const agg of mergeableAggs) {\n if (mergedAggs.merge(agg)) {\n node.removeChild(agg);\n agg.parent = mergedAggs;\n agg.remove();\n this.setModified();\n }\n }\n }\n }\n }\n}\n/**\n * Merge bin nodes and move them up through forks. Stop at filters, parse, identifier as we want them to stay before the bin node.\n */\nexport class MergeBins extends BottomUpOptimizer {\n constructor(model) {\n super();\n this.model = model;\n }\n run(node) {\n const moveBinsUp = !(isDataSourceNode(node) ||\n node instanceof FilterNode ||\n node instanceof ParseNode ||\n node instanceof IdentifierNode);\n const promotableBins = [];\n const remainingBins = [];\n for (const child of node.children) {\n if (child instanceof BinNode) {\n if (moveBinsUp && !fieldIntersection(node.producedFields(), child.dependentFields())) {\n promotableBins.push(child);\n }\n else {\n remainingBins.push(child);\n }\n }\n }\n if (promotableBins.length > 0) {\n const promotedBin = promotableBins.pop();\n for (const bin of promotableBins) {\n promotedBin.merge(bin, this.model.renameSignal.bind(this.model));\n }\n this.setModified();\n if (node instanceof BinNode) {\n node.merge(promotedBin, this.model.renameSignal.bind(this.model));\n }\n else {\n promotedBin.swapWithParent();\n }\n }\n if (remainingBins.length > 1) {\n const remainingBin = remainingBins.pop();\n for (const bin of remainingBins) {\n remainingBin.merge(bin, this.model.renameSignal.bind(this.model));\n }\n this.setModified();\n }\n }\n}\n/**\n * This optimizer takes output nodes that are at a fork and moves them before the fork.\n *\n * The algorithm iterates over the children and tries to find the last output node in a chain of output nodes.\n * It then moves all output nodes before that main output node. All other children (and the children of the output nodes)\n * are inserted after the main output node.\n */\nexport class MergeOutputs extends BottomUpOptimizer {\n run(node) {\n const children = [...node.children];\n const hasOutputChild = some(children, child => child instanceof OutputNode);\n if (!hasOutputChild || node.numChildren() <= 1) {\n return;\n }\n const otherChildren = [];\n // The output node we will connect all other nodes to.\n // Output nodes will be added before the new node, other nodes after.\n let mainOutput;\n for (const child of children) {\n if (child instanceof OutputNode) {\n let lastOutput = child;\n while (lastOutput.numChildren() === 1) {\n const [theChild] = lastOutput.children;\n if (theChild instanceof OutputNode) {\n lastOutput = theChild;\n }\n else {\n break;\n }\n }\n otherChildren.push(...lastOutput.children);\n if (mainOutput) {\n // Move the output nodes before the mainOutput. We do this by setting\n // the parent of the first not to the parent of the main output and\n // the main output's parent to the last output.\n // note: the child is the first output\n node.removeChild(child);\n child.parent = mainOutput.parent;\n mainOutput.parent.removeChild(mainOutput);\n mainOutput.parent = lastOutput;\n this.setModified();\n }\n else {\n mainOutput = lastOutput;\n }\n }\n else {\n otherChildren.push(child);\n }\n }\n if (otherChildren.length) {\n this.setModified();\n for (const child of otherChildren) {\n child.parent.removeChild(child);\n child.parent = mainOutput;\n }\n }\n }\n}\n//# sourceMappingURL=optimizers.js.map","import { vgField } from '../../channeldef';\nimport { duplicate, hash } from '../../util';\nimport { unique } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for the join aggregate transform nodes.\n */\nexport class JoinAggregateTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new JoinAggregateTransformNode(null, duplicate(this.transform));\n }\n addDimensions(fields) {\n this.transform.groupby = unique(this.transform.groupby.concat(fields), d => d);\n }\n dependentFields() {\n const out = new Set();\n if (this.transform.groupby) {\n this.transform.groupby.forEach(out.add, out);\n }\n this.transform.joinaggregate\n .map(w => w.field)\n .filter(f => f !== undefined)\n .forEach(out.add, out);\n return out;\n }\n producedFields() {\n return new Set(this.transform.joinaggregate.map(this.getDefaultName));\n }\n getDefaultName(joinAggregateFieldDef) {\n var _a;\n return (_a = joinAggregateFieldDef.as) !== null && _a !== void 0 ? _a : vgField(joinAggregateFieldDef);\n }\n hash() {\n return `JoinAggregateTransform ${hash(this.transform)}`;\n }\n assemble() {\n const fields = [];\n const ops = [];\n const as = [];\n for (const joinaggregate of this.transform.joinaggregate) {\n ops.push(joinaggregate.op);\n as.push(this.getDefaultName(joinaggregate));\n fields.push(joinaggregate.field === undefined ? null : joinaggregate.field);\n }\n const groupby = this.transform.groupby;\n return Object.assign({ type: 'joinaggregate', as,\n ops,\n fields }, (groupby !== undefined ? { groupby } : {}));\n }\n}\n//# sourceMappingURL=joinaggregate.js.map","import { isArray, isString } from 'vega-util';\nimport { getFieldDef, isFieldDef, vgField } from '../../channeldef';\nimport { duplicate, getFirstDefined, hash } from '../../util';\nimport { sortParams } from '../common';\nimport { DataFlowNode } from './dataflow';\nfunction getStackByFields(model) {\n return model.stack.stackBy.reduce((fields, by) => {\n const fieldDef = by.fieldDef;\n const _field = vgField(fieldDef);\n if (_field) {\n fields.push(_field);\n }\n return fields;\n }, []);\n}\nfunction isValidAsArray(as) {\n return isArray(as) && as.every(s => isString(s)) && as.length > 1;\n}\nexport class StackNode extends DataFlowNode {\n constructor(parent, stack) {\n super(parent);\n this._stack = stack;\n }\n clone() {\n return new StackNode(null, duplicate(this._stack));\n }\n static makeFromTransform(parent, stackTransform) {\n const { stack, groupby, as, offset = 'zero' } = stackTransform;\n const sortFields = [];\n const sortOrder = [];\n if (stackTransform.sort !== undefined) {\n for (const sortField of stackTransform.sort) {\n sortFields.push(sortField.field);\n sortOrder.push(getFirstDefined(sortField.order, 'ascending'));\n }\n }\n const sort = {\n field: sortFields,\n order: sortOrder\n };\n let normalizedAs;\n if (isValidAsArray(as)) {\n normalizedAs = as;\n }\n else if (isString(as)) {\n normalizedAs = [as, as + '_end'];\n }\n else {\n normalizedAs = [stackTransform.stack + '_start', stackTransform.stack + '_end'];\n }\n return new StackNode(parent, {\n stackField: stack,\n groupby,\n offset,\n sort,\n facetby: [],\n as: normalizedAs\n });\n }\n static makeFromEncoding(parent, model) {\n const stackProperties = model.stack;\n const { encoding } = model;\n if (!stackProperties) {\n return null;\n }\n const { groupbyChannel, fieldChannel, offset, impute } = stackProperties;\n let dimensionFieldDef;\n if (groupbyChannel) {\n const cDef = encoding[groupbyChannel];\n dimensionFieldDef = getFieldDef(cDef); // Fair to cast as groupByChannel is always either x or y\n }\n const stackby = getStackByFields(model);\n const orderDef = model.encoding.order;\n let sort;\n if (isArray(orderDef) || isFieldDef(orderDef)) {\n sort = sortParams(orderDef);\n }\n else {\n // default = descending by stackFields\n // FIXME is the default here correct for binned fields?\n sort = stackby.reduce((s, field) => {\n s.field.push(field);\n s.order.push(fieldChannel === 'y' ? 'descending' : 'ascending');\n return s;\n }, { field: [], order: [] });\n }\n return new StackNode(parent, {\n dimensionFieldDef,\n stackField: model.vgField(fieldChannel),\n facetby: [],\n stackby,\n sort,\n offset,\n impute,\n as: [\n model.vgField(fieldChannel, { suffix: 'start', forAs: true }),\n model.vgField(fieldChannel, { suffix: 'end', forAs: true })\n ]\n });\n }\n get stack() {\n return this._stack;\n }\n addDimensions(fields) {\n this._stack.facetby.push(...fields);\n }\n dependentFields() {\n const out = new Set();\n out.add(this._stack.stackField);\n this.getGroupbyFields().forEach(out.add, out);\n this._stack.facetby.forEach(out.add, out);\n this._stack.sort.field.forEach(out.add, out);\n return out;\n }\n producedFields() {\n return new Set(this._stack.as);\n }\n hash() {\n return `Stack ${hash(this._stack)}`;\n }\n getGroupbyFields() {\n const { dimensionFieldDef, impute, groupby } = this._stack;\n if (dimensionFieldDef) {\n if (dimensionFieldDef.bin) {\n if (impute) {\n // For binned group by field with impute, we calculate bin_mid\n // as we cannot impute two fields simultaneously\n return [vgField(dimensionFieldDef, { binSuffix: 'mid' })];\n }\n return [\n // For binned group by field without impute, we need both bin (start) and bin_end\n vgField(dimensionFieldDef, {}),\n vgField(dimensionFieldDef, { binSuffix: 'end' })\n ];\n }\n return [vgField(dimensionFieldDef)];\n }\n return groupby !== null && groupby !== void 0 ? groupby : [];\n }\n assemble() {\n const transform = [];\n const { facetby, dimensionFieldDef, stackField: field, stackby, sort, offset, impute, as } = this._stack;\n // Impute\n if (impute && dimensionFieldDef) {\n const { band = 0.5, bin } = dimensionFieldDef;\n if (bin) {\n // As we can only impute one field at a time, we need to calculate\n // mid point for a binned field\n transform.push({\n type: 'formula',\n expr: `${band}*` +\n vgField(dimensionFieldDef, { expr: 'datum' }) +\n `+${1 - band}*` +\n vgField(dimensionFieldDef, { expr: 'datum', binSuffix: 'end' }),\n as: vgField(dimensionFieldDef, { binSuffix: 'mid', forAs: true })\n });\n }\n transform.push({\n type: 'impute',\n field,\n groupby: [...stackby, ...facetby],\n key: vgField(dimensionFieldDef, { binSuffix: 'mid' }),\n method: 'value',\n value: 0\n });\n }\n // Stack\n transform.push({\n type: 'stack',\n groupby: [...this.getGroupbyFields(), ...facetby],\n field,\n sort,\n as,\n offset\n });\n return transform;\n }\n}\n//# sourceMappingURL=stack.js.map","import { isAggregateOp } from '../../aggregate';\nimport { vgField } from '../../channeldef';\nimport { duplicate, hash } from '../../util';\nimport { unique } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for the window transform nodes\n */\nexport class WindowTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new WindowTransformNode(null, duplicate(this.transform));\n }\n addDimensions(fields) {\n this.transform.groupby = unique(this.transform.groupby.concat(fields), d => d);\n }\n dependentFields() {\n var _a, _b;\n const out = new Set();\n ((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : []).forEach(out.add, out);\n ((_b = this.transform.sort) !== null && _b !== void 0 ? _b : []).forEach(m => out.add(m.field));\n this.transform.window\n .map(w => w.field)\n .filter(f => f !== undefined)\n .forEach(out.add, out);\n return out;\n }\n producedFields() {\n return new Set(this.transform.window.map(this.getDefaultName));\n }\n getDefaultName(windowFieldDef) {\n var _a;\n return (_a = windowFieldDef.as) !== null && _a !== void 0 ? _a : vgField(windowFieldDef);\n }\n hash() {\n return `WindowTransform ${hash(this.transform)}`;\n }\n assemble() {\n var _a;\n const fields = [];\n const ops = [];\n const as = [];\n const params = [];\n for (const window of this.transform.window) {\n ops.push(window.op);\n as.push(this.getDefaultName(window));\n params.push(window.param === undefined ? null : window.param);\n fields.push(window.field === undefined ? null : window.field);\n }\n const frame = this.transform.frame;\n const groupby = this.transform.groupby;\n if (frame && frame[0] === null && frame[1] === null && ops.every(o => isAggregateOp(o))) {\n // when the window does not rely on any particular window ops or frame, switch to a simpler and more efficient joinaggregate\n return Object.assign({ type: 'joinaggregate', as, ops: ops, fields }, (groupby !== undefined ? { groupby } : {}));\n }\n const sortFields = [];\n const sortOrder = [];\n if (this.transform.sort !== undefined) {\n for (const sortField of this.transform.sort) {\n sortFields.push(sortField.field);\n sortOrder.push((_a = sortField.order) !== null && _a !== void 0 ? _a : 'ascending');\n }\n }\n const sort = {\n field: sortFields,\n order: sortOrder\n };\n const ignorePeers = this.transform.ignorePeers;\n return Object.assign(Object.assign(Object.assign({ type: 'window', params,\n as,\n ops,\n fields,\n sort }, (ignorePeers !== undefined ? { ignorePeers } : {})), (groupby !== undefined ? { groupby } : {})), (frame !== undefined ? { frame } : {}));\n }\n}\n//# sourceMappingURL=window.js.map","import { DataSourceType } from '../../data';\nimport { AggregateNode } from './aggregate';\nimport { OutputNode } from './dataflow';\nimport { FacetNode } from './facet';\nimport { JoinAggregateTransformNode } from './joinaggregate';\nimport { FACET_SCALE_PREFIX } from './optimize';\nimport { StackNode } from './stack';\nimport { WindowTransformNode } from './window';\n/**\n * Clones the subtree and ignores output nodes except for the leaves, which are renamed.\n */\nfunction cloneSubtree(facet) {\n function clone(node) {\n if (!(node instanceof FacetNode)) {\n const copy = node.clone();\n if (copy instanceof OutputNode) {\n const newName = FACET_SCALE_PREFIX + copy.getSource();\n copy.setSource(newName);\n facet.model.component.data.outputNodes[newName] = copy;\n }\n else if (copy instanceof AggregateNode ||\n copy instanceof StackNode ||\n copy instanceof WindowTransformNode ||\n copy instanceof JoinAggregateTransformNode) {\n copy.addDimensions(facet.fields);\n }\n for (const n of node.children.flatMap(clone)) {\n n.parent = copy;\n }\n return [copy];\n }\n return node.children.flatMap(clone);\n }\n return clone;\n}\n/**\n * Move facet nodes down to the next fork or output node. Also pull the main output with the facet node.\n * After moving down the facet node, make a copy of the subtree and make it a child of the main output.\n */\nexport function moveFacetDown(node) {\n if (node instanceof FacetNode) {\n if (node.numChildren() === 1 && !(node.children[0] instanceof OutputNode)) {\n // move down until we hit a fork or output node\n const child = node.children[0];\n if (child instanceof AggregateNode ||\n child instanceof StackNode ||\n child instanceof WindowTransformNode ||\n child instanceof JoinAggregateTransformNode) {\n child.addDimensions(node.fields);\n }\n child.swapWithParent();\n moveFacetDown(node);\n }\n else {\n // move main to facet\n const facetMain = node.model.component.data.main;\n moveMainDownToFacet(facetMain);\n // replicate the subtree and place it before the facet's main node\n const cloner = cloneSubtree(node);\n const copy = node.children.map(cloner).flat();\n for (const c of copy) {\n c.parent = facetMain;\n }\n }\n }\n else {\n node.children.map(moveFacetDown);\n }\n}\nfunction moveMainDownToFacet(node) {\n if (node instanceof OutputNode && node.type === DataSourceType.Main) {\n if (node.numChildren() === 1) {\n const child = node.children[0];\n if (!(child instanceof FacetNode)) {\n child.swapWithParent();\n moveMainDownToFacet(node);\n }\n }\n }\n}\n//# sourceMappingURL=subtree.js.map","import * as log from '../../log';\nimport * as optimizers from './optimizers';\nimport { moveFacetDown } from './subtree';\nexport const FACET_SCALE_PREFIX = 'scale_';\nexport const MAX_OPTIMIZATION_RUNS = 5;\n/**\n * Iterates over a dataflow graph and checks whether all links are consistent.\n */\nexport function checkLinks(nodes) {\n for (const node of nodes) {\n for (const child of node.children) {\n if (child.parent !== node) {\n // log.error('Dataflow graph is inconsistent.', node, child);\n return false;\n }\n }\n if (!checkLinks(node.children)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Run the specified optimizer on the provided nodes.\n *\n * @param optimizer The optimizer instance to run.\n * @param nodes A set of nodes to optimize.\n */\nfunction runOptimizer(optimizer, nodes) {\n let modified = false;\n for (const node of nodes) {\n modified = optimizer.optimize(node) || modified;\n }\n return modified;\n}\nfunction optimizationDataflowHelper(dataComponent, model, firstPass) {\n let roots = dataComponent.sources;\n let modified = false;\n modified = runOptimizer(new optimizers.RemoveUnnecessaryOutputNodes(), roots) || modified;\n modified = runOptimizer(new optimizers.RemoveUnnecessaryIdentifierNodes(model), roots) || modified;\n // remove source nodes that don't have any children because they also don't have output nodes\n roots = roots.filter(r => r.numChildren() > 0);\n modified = runOptimizer(new optimizers.RemoveUnusedSubtrees(), roots) || modified;\n roots = roots.filter(r => r.numChildren() > 0);\n if (!firstPass) {\n // Only run these optimizations after the optimizer has moved down the facet node.\n // With this change, we can be more aggressive in the optimizations.\n modified = runOptimizer(new optimizers.MoveParseUp(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeBins(model), roots) || modified;\n modified = runOptimizer(new optimizers.RemoveDuplicateTimeUnits(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeParse(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeAggregates(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeTimeUnits(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeIdenticalNodes(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeOutputs(), roots) || modified;\n }\n dataComponent.sources = roots;\n return modified;\n}\n/**\n * Optimizes the dataflow of the passed in data component.\n */\nexport function optimizeDataflow(data, model) {\n // check before optimizations\n checkLinks(data.sources);\n let firstPassCounter = 0;\n let secondPassCounter = 0;\n for (let i = 0; i < MAX_OPTIMIZATION_RUNS; i++) {\n if (!optimizationDataflowHelper(data, model, true)) {\n break;\n }\n firstPassCounter++;\n }\n // move facets down and make a copy of the subtree so that we can have scales at the top level\n data.sources.map(moveFacetDown);\n for (let i = 0; i < MAX_OPTIMIZATION_RUNS; i++) {\n if (!optimizationDataflowHelper(data, model, false)) {\n break;\n }\n secondPassCounter++;\n }\n // check after optimizations\n checkLinks(data.sources);\n if (Math.max(firstPassCounter, secondPassCounter) === MAX_OPTIMIZATION_RUNS) {\n log.warn(`Maximum optimization runs(${MAX_OPTIMIZATION_RUNS}) reached.`);\n }\n}\n//# sourceMappingURL=optimize.js.map","/**\n * A class that behaves like a SignalRef but lazily generates the signal.\n * The provided generator function should use `Model.getSignalName` to use the correct signal name.\n */\nexport class SignalRefWrapper {\n constructor(exprGenerator) {\n Object.defineProperty(this, 'signal', {\n enumerable: true,\n get: exprGenerator\n });\n }\n static fromName(rename, signalName) {\n return new SignalRefWrapper(() => rename(signalName));\n }\n}\n//# sourceMappingURL=signal.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isObject, isString } from 'vega-util';\nimport { isAggregateOp, isArgmaxDef, isArgminDef, MULTIDOMAIN_SORT_OP_INDEX as UNIONDOMAIN_SORT_OP_INDEX, SHARED_DOMAIN_OP_INDEX } from '../../aggregate';\nimport { isBinning, isBinParams, isSelectionExtent } from '../../bin';\nimport { getSecondaryRangeChannel, isScaleChannel } from '../../channel';\nimport { binRequiresRange, getFieldOrDatumDef, hasBand, isDatumDef, isFieldDef, valueExpr, vgField } from '../../channeldef';\nimport { DataSourceType } from '../../data';\nimport * as log from '../../log';\nimport { hasDiscreteDomain, isDomainUnionWith, isSelectionDomain } from '../../scale';\nimport { DEFAULT_SORT_OP, isSortArray, isSortByEncoding, isSortField } from '../../sort';\nimport { normalizeTimeUnit } from '../../timeunit';\nimport * as util from '../../util';\nimport { isDataRefDomain, isDataRefUnionedDomain, isFieldRefUnionDomain, isSignalRef } from '../../vega.schema';\nimport { getBinSignalName } from '../data/bin';\nimport { sortArrayIndexField } from '../data/calculate';\nimport { FACET_SCALE_PREFIX } from '../data/optimize';\nimport { isFacetModel, isUnitModel } from '../model';\nimport { SignalRefWrapper } from '../signal';\nimport { makeExplicit, makeImplicit, mergeValuesWithExplicit } from '../split';\nexport function parseScaleDomain(model) {\n if (isUnitModel(model)) {\n parseUnitScaleDomain(model);\n }\n else {\n parseNonUnitScaleDomain(model);\n }\n}\nfunction parseUnitScaleDomain(model) {\n const localScaleComponents = model.component.scales;\n for (const channel of util.keys(localScaleComponents)) {\n const domains = parseDomainForChannel(model, channel);\n const localScaleCmpt = localScaleComponents[channel];\n localScaleCmpt.setWithExplicit('domains', domains);\n parseSelectionDomain(model, channel);\n if (model.component.data.isFaceted) {\n // get resolve from closest facet parent as this decides whether we need to refer to cloned subtree or not\n let facetParent = model;\n while (!isFacetModel(facetParent) && facetParent.parent) {\n facetParent = facetParent.parent;\n }\n const resolve = facetParent.component.resolve.scale[channel];\n if (resolve === 'shared') {\n for (const domain of domains.value) {\n // Replace the scale domain with data output from a cloned subtree after the facet.\n if (isDataRefDomain(domain)) {\n // use data from cloned subtree (which is the same as data but with a prefix added once)\n domain.data = FACET_SCALE_PREFIX + domain.data.replace(FACET_SCALE_PREFIX, '');\n }\n }\n }\n }\n }\n}\nfunction parseNonUnitScaleDomain(model) {\n for (const child of model.children) {\n parseScaleDomain(child);\n }\n const localScaleComponents = model.component.scales;\n for (const channel of util.keys(localScaleComponents)) {\n let domains;\n let selectionExtent = null;\n for (const child of model.children) {\n const childComponent = child.component.scales[channel];\n if (childComponent) {\n if (domains === undefined) {\n domains = childComponent.getWithExplicit('domains');\n }\n else {\n domains = mergeValuesWithExplicit(domains, childComponent.getWithExplicit('domains'), 'domains', 'scale', domainsTieBreaker);\n }\n const se = childComponent.get('selectionExtent');\n if (selectionExtent && se && selectionExtent.selection !== se.selection) {\n log.warn(log.message.NEEDS_SAME_SELECTION);\n }\n selectionExtent = se;\n }\n }\n localScaleComponents[channel].setWithExplicit('domains', domains);\n if (selectionExtent) {\n localScaleComponents[channel].set('selectionExtent', selectionExtent, true);\n }\n }\n}\n/**\n * Remove unaggregated domain if it is not applicable\n * Add unaggregated domain if domain is not specified and config.scale.useUnaggregatedDomain is true.\n */\nfunction normalizeUnaggregatedDomain(domain, fieldDef, scaleType, scaleConfig) {\n if (domain === 'unaggregated') {\n const { valid, reason } = canUseUnaggregatedDomain(fieldDef, scaleType);\n if (!valid) {\n log.warn(reason);\n return undefined;\n }\n }\n else if (domain === undefined && scaleConfig.useUnaggregatedDomain) {\n // Apply config if domain is not specified.\n const { valid } = canUseUnaggregatedDomain(fieldDef, scaleType);\n if (valid) {\n return 'unaggregated';\n }\n }\n return domain;\n}\nexport function parseDomainForChannel(model, channel) {\n const scaleType = model.getScaleComponent(channel).get('type');\n const { encoding } = model;\n const domain = normalizeUnaggregatedDomain(model.scaleDomain(channel), model.typedFieldDef(channel), scaleType, model.config.scale);\n if (domain !== model.scaleDomain(channel)) {\n model.specifiedScales[channel] = Object.assign(Object.assign({}, model.specifiedScales[channel]), { domain });\n }\n // If channel is either X or Y then union them with X2 & Y2 if they exist\n if (channel === 'x' && getFieldOrDatumDef(encoding.x2)) {\n if (getFieldOrDatumDef(encoding.x)) {\n return mergeValuesWithExplicit(parseSingleChannelDomain(scaleType, domain, model, 'x'), parseSingleChannelDomain(scaleType, domain, model, 'x2'), 'domain', 'scale', domainsTieBreaker);\n }\n else {\n return parseSingleChannelDomain(scaleType, domain, model, 'x2');\n }\n }\n else if (channel === 'y' && getFieldOrDatumDef(encoding.y2)) {\n if (getFieldOrDatumDef(encoding.y)) {\n return mergeValuesWithExplicit(parseSingleChannelDomain(scaleType, domain, model, 'y'), parseSingleChannelDomain(scaleType, domain, model, 'y2'), 'domain', 'scale', domainsTieBreaker);\n }\n else {\n return parseSingleChannelDomain(scaleType, domain, model, 'y2');\n }\n }\n return parseSingleChannelDomain(scaleType, domain, model, channel);\n}\nfunction mapDomainToDataSignal(domain, type, timeUnit) {\n return domain.map(v => {\n const data = valueExpr(v, { timeUnit, type });\n return { signal: `{data: ${data}}` };\n });\n}\nfunction convertDomainIfItIsDateTime(domain, type, timeUnit) {\n var _a;\n // explicit value\n const normalizedTimeUnit = (_a = normalizeTimeUnit(timeUnit)) === null || _a === void 0 ? void 0 : _a.unit;\n if (type === 'temporal' || normalizedTimeUnit) {\n return mapDomainToDataSignal(domain, type, normalizedTimeUnit);\n }\n return [domain]; // Date time won't make sense\n}\nfunction parseSingleChannelDomain(scaleType, domain, model, channel) {\n const { encoding } = model;\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n const { type } = fieldOrDatumDef;\n const timeUnit = fieldOrDatumDef['timeUnit'];\n if (isDomainUnionWith(domain)) {\n const defaultDomain = parseSingleChannelDomain(scaleType, undefined, model, channel);\n const unionWith = convertDomainIfItIsDateTime(domain.unionWith, type, timeUnit);\n return makeExplicit([...defaultDomain.value, ...unionWith]);\n }\n else if (isSignalRef(domain)) {\n return makeExplicit([domain]);\n }\n else if (domain && domain !== 'unaggregated' && !isSelectionDomain(domain)) {\n return makeExplicit(convertDomainIfItIsDateTime(domain, type, timeUnit));\n }\n const stack = model.stack;\n if (stack && channel === stack.fieldChannel) {\n if (stack.offset === 'normalize') {\n return makeImplicit([[0, 1]]);\n }\n const data = model.requestDataName(DataSourceType.Main);\n return makeImplicit([\n {\n data,\n field: model.vgField(channel, { suffix: 'start' })\n },\n {\n data,\n field: model.vgField(channel, { suffix: 'end' })\n }\n ]);\n }\n const sort = isScaleChannel(channel) && isFieldDef(fieldOrDatumDef) ? domainSort(model, channel, scaleType) : undefined;\n if (isDatumDef(fieldOrDatumDef)) {\n const d = convertDomainIfItIsDateTime([fieldOrDatumDef.datum], type, timeUnit);\n return makeImplicit(d);\n }\n const fieldDef = fieldOrDatumDef; // now we can be sure it's a fieldDef\n if (domain === 'unaggregated') {\n const data = model.requestDataName(DataSourceType.Main);\n const { field } = fieldOrDatumDef;\n return makeImplicit([\n {\n data,\n field: vgField({ field, aggregate: 'min' })\n },\n {\n data,\n field: vgField({ field, aggregate: 'max' })\n }\n ]);\n }\n else if (isBinning(fieldDef.bin)) {\n if (hasDiscreteDomain(scaleType)) {\n if (scaleType === 'bin-ordinal') {\n // we can omit the domain as it is inferred from the `bins` property\n return makeImplicit([]);\n }\n // ordinal bin scale takes domain from bin_range, ordered by bin start\n // This is useful for both axis-based scale (x/y) and legend-based scale (other channels).\n return makeImplicit([\n {\n // If sort by aggregation of a specified sort field, we need to use RAW table,\n // so we can aggregate values for the scale independently from the main aggregation.\n data: util.isBoolean(sort)\n ? model.requestDataName(DataSourceType.Main)\n : model.requestDataName(DataSourceType.Raw),\n // Use range if we added it and the scale does not support computing a range as a signal.\n field: model.vgField(channel, binRequiresRange(fieldDef, channel) ? { binSuffix: 'range' } : {}),\n // we have to use a sort object if sort = true to make the sort correct by bin start\n sort: sort === true || !isObject(sort)\n ? {\n field: model.vgField(channel, {}),\n op: 'min' // min or max doesn't matter since we sort by the start of the bin range\n }\n : sort\n }\n ]);\n }\n else {\n // continuous scales\n const { bin } = fieldDef;\n if (isBinning(bin)) {\n const binSignal = getBinSignalName(model, fieldDef.field, bin);\n return makeImplicit([\n new SignalRefWrapper(() => {\n const signal = model.getSignalName(binSignal);\n return `[${signal}.start, ${signal}.stop]`;\n })\n ]);\n }\n else {\n return makeImplicit([\n {\n data: model.requestDataName(DataSourceType.Main),\n field: model.vgField(channel, {})\n }\n ]);\n }\n }\n }\n else if (fieldDef.timeUnit &&\n util.contains(['time', 'utc'], scaleType) &&\n hasBand(channel, fieldDef, isUnitModel(model) ? model.encoding[getSecondaryRangeChannel(channel)] : undefined, model.stack, model.markDef, model.config)) {\n const data = model.requestDataName(DataSourceType.Main);\n return makeImplicit([\n {\n data,\n field: model.vgField(channel)\n },\n {\n data,\n field: model.vgField(channel, { suffix: 'end' })\n }\n ]);\n }\n else if (sort) {\n return makeImplicit([\n {\n // If sort by aggregation of a specified sort field, we need to use RAW table,\n // so we can aggregate values for the scale independently from the main aggregation.\n data: util.isBoolean(sort)\n ? model.requestDataName(DataSourceType.Main)\n : model.requestDataName(DataSourceType.Raw),\n field: model.vgField(channel),\n sort: sort\n }\n ]);\n }\n else {\n return makeImplicit([\n {\n data: model.requestDataName(DataSourceType.Main),\n field: model.vgField(channel)\n }\n ]);\n }\n}\nfunction normalizeSortField(sort, isStackedMeasure) {\n const { op, field, order } = sort;\n return Object.assign(Object.assign({ \n // Apply default op\n op: op !== null && op !== void 0 ? op : (isStackedMeasure ? 'sum' : DEFAULT_SORT_OP) }, (field ? { field: util.replacePathInField(field) } : {})), (order ? { order } : {}));\n}\nfunction parseSelectionDomain(model, channel) {\n var _a;\n const scale = model.component.scales[channel];\n const spec = model.specifiedScales[channel].domain;\n const bin = (_a = model.fieldDef(channel)) === null || _a === void 0 ? void 0 : _a.bin;\n const domain = isSelectionDomain(spec) && spec;\n const extent = isBinParams(bin) && isSelectionExtent(bin.extent) && bin.extent;\n if (domain || extent) {\n // As scale parsing occurs before selection parsing, we cannot set\n // domainRaw directly. So instead, we store the selectionExtent on\n // the scale component, and then add domainRaw during scale assembly.\n scale.set('selectionExtent', domain !== null && domain !== void 0 ? domain : extent, true);\n }\n}\nexport function domainSort(model, channel, scaleType) {\n if (!hasDiscreteDomain(scaleType)) {\n return undefined;\n }\n // save to cast as the only exception is the geojson type for shape, which would not generate a scale\n const fieldDef = model.fieldDef(channel);\n const sort = fieldDef.sort;\n // if the sort is specified with array, use the derived sort index field\n if (isSortArray(sort)) {\n return {\n op: 'min',\n field: sortArrayIndexField(fieldDef, channel),\n order: 'ascending'\n };\n }\n const { stack } = model;\n const stackDimensions = stack\n ? [...(stack.groupbyField ? [stack.groupbyField] : []), ...stack.stackBy.map(s => s.fieldDef.field)]\n : undefined;\n // Sorted based on an aggregate calculation over a specified sort field (only for ordinal scale)\n if (isSortField(sort)) {\n const isStackedMeasure = stack && !util.contains(stackDimensions, sort.field);\n return normalizeSortField(sort, isStackedMeasure);\n }\n else if (isSortByEncoding(sort)) {\n const { encoding, order } = sort;\n const fieldDefToSortBy = model.fieldDef(encoding);\n const { aggregate, field } = fieldDefToSortBy;\n const isStackedMeasure = stack && !util.contains(stackDimensions, field);\n if (isArgminDef(aggregate) || isArgmaxDef(aggregate)) {\n return normalizeSortField({\n field: vgField(fieldDefToSortBy),\n order\n }, isStackedMeasure);\n }\n else if (isAggregateOp(aggregate) || !aggregate) {\n return normalizeSortField({\n op: aggregate,\n field,\n order\n }, isStackedMeasure);\n }\n }\n else if (sort === 'descending') {\n return {\n op: 'min',\n field: model.vgField(channel),\n order: 'descending'\n };\n }\n else if (util.contains(['ascending', undefined /* default =ascending*/], sort)) {\n return true;\n }\n // sort == null\n return undefined;\n}\n/**\n * Determine if a scale can use unaggregated domain.\n * @return {Boolean} Returns true if all of the following conditions apply:\n * 1. `scale.domain` is `unaggregated`\n * 2. Aggregation function is not `count` or `sum`\n * 3. The scale is quantitative or time scale.\n */\nexport function canUseUnaggregatedDomain(fieldDef, scaleType) {\n const { aggregate, type } = fieldDef;\n if (!aggregate) {\n return {\n valid: false,\n reason: log.message.unaggregateDomainHasNoEffectForRawField(fieldDef)\n };\n }\n if (isString(aggregate) && !SHARED_DOMAIN_OP_INDEX[aggregate]) {\n return {\n valid: false,\n reason: log.message.unaggregateDomainWithNonSharedDomainOp(aggregate)\n };\n }\n if (type === 'quantitative') {\n if (scaleType === 'log') {\n return {\n valid: false,\n reason: log.message.unaggregatedDomainWithLogScale(fieldDef)\n };\n }\n }\n return { valid: true };\n}\n/**\n * Tie breaker for mergeValuesWithExplicit for domains. We concat the specified values.\n */\nfunction domainsTieBreaker(v1, v2, property, propertyOf) {\n if (v1.explicit && v2.explicit) {\n log.warn(log.message.mergeConflictingDomainProperty(property, propertyOf, v1.value, v2.value));\n }\n // If equal score, concat the domains so that we union them later.\n return { explicit: v1.explicit, value: [...v1.value, ...v2.value] };\n}\n/**\n * Converts an array of domains to a single Vega scale domain.\n */\nexport function mergeDomains(domains) {\n const uniqueDomains = util.unique(domains.map(domain => {\n // ignore sort property when computing the unique domains\n if (isDataRefDomain(domain)) {\n const { sort: _s } = domain, domainWithoutSort = __rest(domain, [\"sort\"]);\n return domainWithoutSort;\n }\n return domain;\n }), util.hash);\n const sorts = util.unique(domains\n .map(d => {\n if (isDataRefDomain(d)) {\n const s = d.sort;\n if (s !== undefined && !util.isBoolean(s)) {\n if ('op' in s && s.op === 'count') {\n // let's make sure that if op is count, we don't use a field\n delete s.field;\n }\n if (s.order === 'ascending') {\n // drop order: ascending as it is the default\n delete s.order;\n }\n }\n return s;\n }\n return undefined;\n })\n .filter(s => s !== undefined), util.hash);\n if (uniqueDomains.length === 0) {\n return undefined;\n }\n else if (uniqueDomains.length === 1) {\n const domain = domains[0];\n if (isDataRefDomain(domain) && sorts.length > 0) {\n let sort = sorts[0];\n if (sorts.length > 1) {\n log.warn(log.message.MORE_THAN_ONE_SORT);\n sort = true;\n }\n else {\n // Simplify domain sort by removing field and op when the field is the same as the domain field.\n if (isObject(sort) && 'field' in sort) {\n const sortField = sort.field;\n if (domain.field === sortField) {\n sort = sort.order ? { order: sort.order } : true;\n }\n }\n }\n return Object.assign(Object.assign({}, domain), { sort });\n }\n return domain;\n }\n // only keep sort properties that work with unioned domains\n const unionDomainSorts = util.unique(sorts.map(s => {\n if (util.isBoolean(s) || !('op' in s) || (isString(s.op) && s.op in UNIONDOMAIN_SORT_OP_INDEX)) {\n return s;\n }\n log.warn(log.message.domainSortDropped(s));\n return true;\n }), util.hash);\n let sort;\n if (unionDomainSorts.length === 1) {\n sort = unionDomainSorts[0];\n }\n else if (unionDomainSorts.length > 1) {\n log.warn(log.message.MORE_THAN_ONE_SORT);\n sort = true;\n }\n const allData = util.unique(domains.map(d => {\n if (isDataRefDomain(d)) {\n return d.data;\n }\n return null;\n }), x => x);\n if (allData.length === 1 && allData[0] !== null) {\n // create a union domain of different fields with a single data source\n const domain = Object.assign({ data: allData[0], fields: uniqueDomains.map(d => d.field) }, (sort ? { sort } : {}));\n return domain;\n }\n return Object.assign({ fields: uniqueDomains }, (sort ? { sort } : {}));\n}\n/**\n * Return a field if a scale uses a single field.\n * Return `undefined` otherwise.\n */\nexport function getFieldFromDomain(domain) {\n if (isDataRefDomain(domain) && isString(domain.field)) {\n return domain.field;\n }\n else if (isDataRefUnionedDomain(domain)) {\n let field;\n for (const nonUnionDomain of domain.fields) {\n if (isDataRefDomain(nonUnionDomain) && isString(nonUnionDomain.field)) {\n if (!field) {\n field = nonUnionDomain.field;\n }\n else if (field !== nonUnionDomain.field) {\n log.warn(log.message.FACETED_INDEPENDENT_DIFFERENT_SOURCES);\n return field;\n }\n }\n }\n log.warn(log.message.FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES);\n return field;\n }\n else if (isFieldRefUnionDomain(domain)) {\n log.warn(log.message.FACETED_INDEPENDENT_SAME_SOURCE);\n const field = domain.fields[0];\n return isString(field) ? field : undefined;\n }\n return undefined;\n}\nexport function assembleDomain(model, channel) {\n const scaleComponent = model.component.scales[channel];\n const domains = scaleComponent.get('domains').map((domain) => {\n // Correct references to data as the original domain's data was determined\n // in parseScale, which happens before parseData. Thus the original data\n // reference can be incorrect.\n if (isDataRefDomain(domain)) {\n domain.data = model.lookupDataSource(domain.data);\n }\n return domain;\n });\n // domains is an array that has to be merged into a single vega domain\n return mergeDomains(domains);\n}\n//# sourceMappingURL=domain.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isObject } from 'vega-util';\nimport { isXorY } from '../../channel';\nimport { keys } from '../../util';\nimport { isDataRefDomain, isVgRangeStep } from '../../vega.schema';\nimport { isConcatModel, isLayerModel } from '../model';\nimport { assembleSelectionScaleDomain } from '../selection/assemble';\nimport { assembleDomain } from './domain';\nexport function assembleScales(model) {\n if (isLayerModel(model) || isConcatModel(model)) {\n // For concat and layer, include scales of children too\n return model.children.reduce((scales, child) => {\n return scales.concat(assembleScales(child));\n }, assembleScalesForModel(model));\n }\n else {\n // For facet, child scales would not be included in the parent's scope.\n // For unit, there is no child.\n return assembleScalesForModel(model);\n }\n}\nexport function assembleScalesForModel(model) {\n return keys(model.component.scales).reduce((scales, channel) => {\n const scaleComponent = model.component.scales[channel];\n if (scaleComponent.merged) {\n // Skipped merged scales\n return scales;\n }\n const scale = scaleComponent.combine();\n const { name, type, selectionExtent, domains: _d, range: _r, reverse } = scale, otherScaleProps = __rest(scale, [\"name\", \"type\", \"selectionExtent\", \"domains\", \"range\", \"reverse\"]);\n const range = assembleScaleRange(scale.range, name, channel, model);\n let domainRaw;\n if (selectionExtent) {\n domainRaw = assembleSelectionScaleDomain(model, selectionExtent);\n }\n const domain = assembleDomain(model, channel);\n scales.push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ name,\n type }, (domain ? { domain } : {})), (domainRaw ? { domainRaw } : {})), { range }), (reverse !== undefined ? { reverse: reverse } : {})), otherScaleProps));\n return scales;\n }, []);\n}\nexport function assembleScaleRange(scaleRange, scaleName, channel, model) {\n // add signals to x/y range\n if (isXorY(channel)) {\n if (isVgRangeStep(scaleRange)) {\n // For width/height step, use a signal created in layout assemble instead of a constant step.\n return {\n step: { signal: scaleName + '_step' }\n };\n }\n }\n else if (isObject(scaleRange) && isDataRefDomain(scaleRange)) {\n return Object.assign(Object.assign({}, scaleRange), { data: model.lookupDataSource(scaleRange.data) });\n }\n return scaleRange;\n}\n//# sourceMappingURL=assemble.js.map","import { isArray } from 'vega-util';\nimport { some } from '../../util';\nimport { Split } from '../split';\nexport class ScaleComponent extends Split {\n constructor(name, typeWithExplicit) {\n super({}, // no initial explicit property\n { name } // name as initial implicit property\n );\n this.merged = false;\n this.setWithExplicit('type', typeWithExplicit);\n }\n /**\n * Whether the scale definitely includes zero in the domain\n */\n domainDefinitelyIncludesZero() {\n if (this.get('zero') !== false) {\n return true;\n }\n return some(this.get('domains'), d => isArray(d) && d.length === 2 && d[0] <= 0 && d[1] >= 0);\n }\n}\n//# sourceMappingURL=component.js.map","import { isArray, isNumber, isObject } from 'vega-util';\nimport { isBinning } from '../../bin';\nimport { ANGLE, COLOR, FILL, FILLOPACITY, isXorY, OPACITY, RADIUS, SCALE_CHANNELS, SHAPE, SIZE, STROKE, STROKEDASH, STROKEOPACITY, STROKEWIDTH, THETA, X, Y } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { getViewConfigDiscreteSize, getViewConfigDiscreteStep } from '../../config';\nimport { DataSourceType } from '../../data';\nimport * as log from '../../log';\nimport { channelScalePropertyIncompatability, hasContinuousDomain, hasDiscreteDomain, isContinuousToDiscrete, isExtendedScheme, scaleTypeSupportProperty } from '../../scale';\nimport { isStep } from '../../spec/base';\nimport * as util from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { signalOrStringValue } from '../common';\nimport { getBinSignalName } from '../data/bin';\nimport { SignalRefWrapper } from '../signal';\nimport { makeExplicit, makeImplicit } from '../split';\nexport const RANGE_PROPERTIES = ['range', 'scheme'];\nfunction getSizeChannel(channel) {\n return channel === 'x' ? 'width' : channel === 'y' ? 'height' : undefined;\n}\nexport function parseUnitScaleRange(model) {\n const localScaleComponents = model.component.scales;\n // use SCALE_CHANNELS instead of scales[channel] to ensure that x, y come first!\n for (const channel of SCALE_CHANNELS) {\n const localScaleCmpt = localScaleComponents[channel];\n if (!localScaleCmpt) {\n continue;\n }\n const rangeWithExplicit = parseRangeForChannel(channel, model);\n localScaleCmpt.setWithExplicit('range', rangeWithExplicit);\n }\n}\nfunction getBinStepSignal(model, channel) {\n const fieldDef = model.fieldDef(channel);\n if (fieldDef && fieldDef.bin && isBinning(fieldDef.bin)) {\n const binSignal = getBinSignalName(model, fieldDef.field, fieldDef.bin);\n // TODO: extract this to be range step signal\n const sizeType = getSizeChannel(channel);\n const sizeSignal = model.getName(sizeType);\n return new SignalRefWrapper(() => {\n const updatedName = model.getSignalName(binSignal);\n const binCount = `(${updatedName}.stop - ${updatedName}.start) / ${updatedName}.step`;\n return `${model.getSignalName(sizeSignal)} / (${binCount})`;\n });\n }\n return undefined;\n}\n/**\n * Return mixins that includes one of the Vega range types (explicit range, range.step, range.scheme).\n */\nexport function parseRangeForChannel(channel, model) {\n const specifiedScale = model.specifiedScales[channel];\n const { size } = model;\n const mergedScaleCmpt = model.getScaleComponent(channel);\n const scaleType = mergedScaleCmpt.get('type');\n // Check if any of the range properties is specified.\n // If so, check if it is compatible and make sure that we only output one of the properties\n for (const property of RANGE_PROPERTIES) {\n if (specifiedScale[property] !== undefined) {\n const supportedByScaleType = scaleTypeSupportProperty(scaleType, property);\n const channelIncompatability = channelScalePropertyIncompatability(channel, property);\n if (!supportedByScaleType) {\n log.warn(log.message.scalePropertyNotWorkWithScaleType(scaleType, property, channel));\n }\n else if (channelIncompatability) {\n // channel\n log.warn(channelIncompatability);\n }\n else {\n switch (property) {\n case 'range': {\n const range = specifiedScale.range;\n if (isArray(range)) {\n if (isXorY(channel)) {\n return makeExplicit(range.map(v => {\n if (v === 'width' || v === 'height') {\n // get signal for width/height\n // Just like default range logic below, we use SignalRefWrapper to account for potential merges and renames.\n const sizeSignal = model.getName(v);\n const getSignalName = model.getSignalName.bind(model);\n return SignalRefWrapper.fromName(getSignalName, sizeSignal);\n }\n return v;\n }));\n }\n }\n else if (isObject(range)) {\n return makeExplicit({\n data: model.requestDataName(DataSourceType.Main),\n field: range.field,\n sort: { op: 'min', field: model.vgField(channel) }\n });\n }\n return makeExplicit(range);\n }\n case 'scheme':\n return makeExplicit(parseScheme(specifiedScale[property]));\n }\n }\n }\n }\n if (channel === X || channel === Y) {\n const sizeChannel = channel === X ? 'width' : 'height';\n const sizeValue = size[sizeChannel];\n if (isStep(sizeValue)) {\n if (hasDiscreteDomain(scaleType)) {\n return makeExplicit({ step: sizeValue.step });\n }\n else {\n log.warn(log.message.stepDropped(sizeChannel));\n }\n }\n }\n const { rangeMin, rangeMax } = specifiedScale;\n const d = defaultRange(channel, model);\n if ((rangeMin !== undefined || rangeMax !== undefined) &&\n // it's ok to check just rangeMin's compatibility since rangeMin/rangeMax are the same\n scaleTypeSupportProperty(scaleType, 'rangeMin') &&\n isArray(d) &&\n d.length === 2) {\n return makeExplicit([rangeMin !== null && rangeMin !== void 0 ? rangeMin : d[0], rangeMax !== null && rangeMax !== void 0 ? rangeMax : d[1]]);\n }\n return makeImplicit(d);\n}\nfunction parseScheme(scheme) {\n if (isExtendedScheme(scheme)) {\n return Object.assign({ scheme: scheme.name }, util.omit(scheme, ['name']));\n }\n return { scheme: scheme };\n}\nfunction defaultRange(channel, model) {\n const { size, config, mark, encoding } = model;\n const getSignalName = model.getSignalName.bind(model);\n const { type } = getFieldOrDatumDef(encoding[channel]);\n const mergedScaleCmpt = model.getScaleComponent(channel);\n const scaleType = mergedScaleCmpt.get('type');\n const { domain, domainMid } = model.specifiedScales[channel];\n switch (channel) {\n case X:\n case Y: {\n // If there is no explicit width/height for discrete x/y scales\n if (util.contains(['point', 'band'], scaleType)) {\n if (channel === X && !size.width) {\n const w = getViewConfigDiscreteSize(config.view, 'width');\n if (isStep(w)) {\n return w;\n }\n }\n else if (channel === Y && !size.height) {\n const h = getViewConfigDiscreteSize(config.view, 'height');\n if (isStep(h)) {\n return h;\n }\n }\n }\n // If step is null, use zero to width or height.\n // Note that we use SignalRefWrapper to account for potential merges and renames.\n const sizeType = getSizeChannel(channel);\n const sizeSignal = model.getName(sizeType);\n if (channel === Y && hasContinuousDomain(scaleType)) {\n // For y continuous scale, we have to start from the height as the bottom part has the max value.\n return [SignalRefWrapper.fromName(getSignalName, sizeSignal), 0];\n }\n else {\n return [0, SignalRefWrapper.fromName(getSignalName, sizeSignal)];\n }\n }\n case SIZE: {\n // TODO: support custom rangeMin, rangeMax\n const zero = model.component.scales[channel].get('zero');\n const rangeMin = sizeRangeMin(mark, zero, config);\n const rangeMax = sizeRangeMax(mark, size, model, config);\n if (isContinuousToDiscrete(scaleType)) {\n return interpolateRange(rangeMin, rangeMax, defaultContinuousToDiscreteCount(scaleType, config, domain, channel));\n }\n else {\n return [rangeMin, rangeMax];\n }\n }\n case THETA:\n return [0, Math.PI * 2];\n case ANGLE:\n // TODO: add config.scale.min/maxAngleDegree (for point and text) and config.scale.min/maxAngleRadian (for arc) once we add arc marks.\n // (It's weird to add just config.scale.min/maxAngleDegree for now)\n return [0, 360];\n case RADIUS: {\n // max radius = half od min(width,height)\n return [\n 0,\n new SignalRefWrapper(() => {\n const w = model.getSignalName('width');\n const h = model.getSignalName('height');\n return `min(${w},${h})/2`;\n })\n ];\n }\n case STROKEWIDTH:\n // TODO: support custom rangeMin, rangeMax\n return [config.scale.minStrokeWidth, config.scale.maxStrokeWidth];\n case STROKEDASH:\n return [\n // TODO: add this to Vega's config.range?\n [1, 0],\n [4, 2],\n [2, 1],\n [1, 1],\n [1, 2, 4, 2]\n ];\n case SHAPE:\n return 'symbol';\n case COLOR:\n case FILL:\n case STROKE:\n if (scaleType === 'ordinal') {\n // Only nominal data uses ordinal scale by default\n return type === 'nominal' ? 'category' : 'ordinal';\n }\n else {\n if (domainMid !== undefined) {\n return 'diverging';\n }\n else {\n return mark === 'rect' || mark === 'geoshape' ? 'heatmap' : 'ramp';\n }\n }\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n // TODO: support custom rangeMin, rangeMax\n return [config.scale.minOpacity, config.scale.maxOpacity];\n }\n /* istanbul ignore next: should never reach here */\n throw new Error(`Scale range undefined for channel ${channel}`);\n}\nexport function defaultContinuousToDiscreteCount(scaleType, config, domain, channel) {\n switch (scaleType) {\n case 'quantile':\n return config.scale.quantileCount;\n case 'quantize':\n return config.scale.quantizeCount;\n case 'threshold':\n if (domain !== undefined && isArray(domain)) {\n return domain.length + 1;\n }\n else {\n log.warn(log.message.domainRequiredForThresholdScale(channel));\n // default threshold boundaries for threshold scale since domain has cardinality of 2\n return 3;\n }\n }\n}\n/**\n * Returns the linear interpolation of the range according to the cardinality\n *\n * @param rangeMin start of the range\n * @param rangeMax end of the range\n * @param cardinality number of values in the output range\n */\nexport function interpolateRange(rangeMin, rangeMax, cardinality) {\n // always return a signal since it's better to compute the sequence in Vega later\n const f = () => {\n const rMax = signalOrStringValue(rangeMax);\n const rMin = signalOrStringValue(rangeMin);\n const step = `(${rMax} - ${rMin}) / (${cardinality} - 1)`;\n return `sequence(${rMin}, ${rMax} + ${step}, ${step})`;\n };\n if (isSignalRef(rangeMax)) {\n return new SignalRefWrapper(f);\n }\n else {\n return { signal: f() };\n }\n}\nfunction sizeRangeMin(mark, zero, config) {\n if (zero) {\n if (isSignalRef(zero)) {\n return { signal: `${zero.signal} ? 0 : ${sizeRangeMin(mark, false, config)}` };\n }\n else {\n return 0;\n }\n }\n switch (mark) {\n case 'bar':\n case 'tick':\n return config.scale.minBandSize;\n case 'line':\n case 'trail':\n case 'rule':\n return config.scale.minStrokeWidth;\n case 'text':\n return config.scale.minFontSize;\n case 'point':\n case 'square':\n case 'circle':\n return config.scale.minSize;\n }\n /* istanbul ignore next: should never reach here */\n // sizeRangeMin not implemented for the mark\n throw new Error(log.message.incompatibleChannel('size', mark));\n}\nexport const MAX_SIZE_RANGE_STEP_RATIO = 0.95;\nfunction sizeRangeMax(mark, size, model, config) {\n const xyStepSignals = {\n x: getBinStepSignal(model, 'x'),\n y: getBinStepSignal(model, 'y')\n };\n switch (mark) {\n case 'bar':\n case 'tick': {\n if (config.scale.maxBandSize !== undefined) {\n return config.scale.maxBandSize;\n }\n const min = minXYStep(size, xyStepSignals, config.view);\n if (isNumber(min)) {\n return min - 1;\n }\n else {\n return new SignalRefWrapper(() => `${min.signal} - 1`);\n }\n }\n case 'line':\n case 'trail':\n case 'rule':\n return config.scale.maxStrokeWidth;\n case 'text':\n return config.scale.maxFontSize;\n case 'point':\n case 'square':\n case 'circle': {\n if (config.scale.maxSize) {\n return config.scale.maxSize;\n }\n const pointStep = minXYStep(size, xyStepSignals, config.view);\n if (isNumber(pointStep)) {\n return Math.pow(MAX_SIZE_RANGE_STEP_RATIO * pointStep, 2);\n }\n else {\n return new SignalRefWrapper(() => `pow(${MAX_SIZE_RANGE_STEP_RATIO} * ${pointStep.signal}, 2)`);\n }\n }\n }\n /* istanbul ignore next: should never reach here */\n // sizeRangeMax not implemented for the mark\n throw new Error(log.message.incompatibleChannel('size', mark));\n}\n/**\n * @returns {number} Range step of x or y or minimum between the two if both are ordinal scale.\n */\nfunction minXYStep(size, xyStepSignals, viewConfig) {\n const widthStep = isStep(size.width) ? size.width.step : getViewConfigDiscreteStep(viewConfig, 'width');\n const heightStep = isStep(size.height) ? size.height.step : getViewConfigDiscreteStep(viewConfig, 'height');\n if (xyStepSignals.x || xyStepSignals.y) {\n return new SignalRefWrapper(() => {\n const exprs = [\n xyStepSignals.x ? xyStepSignals.x.signal : widthStep,\n xyStepSignals.y ? xyStepSignals.y.signal : heightStep\n ];\n return `min(${exprs.join(', ')})`;\n });\n }\n return Math.min(widthStep, heightStep);\n}\n//# sourceMappingURL=range.js.map","import { isArray } from 'vega-util';\nimport { isBinned, isBinning, isBinParams } from '../../bin';\nimport { COLOR, FILL, POLAR_POSITION_SCALE_CHANNELS, POSITION_SCALE_CHANNELS, POSITION_SCALE_CHANNEL_INDEX, STROKE } from '../../channel';\nimport { getFieldDef, getFieldOrDatumDef, isFieldDef, valueExpr } from '../../channeldef';\nimport { isDateTime } from '../../datetime';\nimport * as log from '../../log';\nimport { channelScalePropertyIncompatability, hasContinuousDomain, isContinuousToContinuous, isContinuousToDiscrete, ScaleType, scaleTypeSupportProperty } from '../../scale';\nimport * as util from '../../util';\nimport { contains, getFirstDefined, keys } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { getBinSignalName } from '../data/bin';\nimport { isUnitModel } from '../model';\nimport { SignalRefWrapper } from '../signal';\nimport { mergeValuesWithExplicit, tieBreakByComparing } from '../split';\nimport { parseUnitScaleRange } from './range';\nexport function parseScaleProperty(model, property) {\n if (isUnitModel(model)) {\n parseUnitScaleProperty(model, property);\n }\n else {\n parseNonUnitScaleProperty(model, property);\n }\n}\nfunction parseUnitScaleProperty(model, property) {\n const localScaleComponents = model.component.scales;\n const { config, encoding, markDef, specifiedScales } = model;\n for (const channel of keys(localScaleComponents)) {\n const specifiedScale = specifiedScales[channel];\n const localScaleCmpt = localScaleComponents[channel];\n const mergedScaleCmpt = model.getScaleComponent(channel);\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n const specifiedValue = specifiedScale[property];\n const scaleType = mergedScaleCmpt.get('type');\n const scalePadding = mergedScaleCmpt.get('padding');\n const scalePaddingInner = mergedScaleCmpt.get('paddingInner');\n const supportedByScaleType = scaleTypeSupportProperty(scaleType, property);\n const channelIncompatability = channelScalePropertyIncompatability(channel, property);\n if (specifiedValue !== undefined) {\n // If there is a specified value, check if it is compatible with scale type and channel\n if (!supportedByScaleType) {\n log.warn(log.message.scalePropertyNotWorkWithScaleType(scaleType, property, channel));\n }\n else if (channelIncompatability) {\n // channel\n log.warn(channelIncompatability);\n }\n }\n if (supportedByScaleType && channelIncompatability === undefined) {\n if (specifiedValue !== undefined) {\n const timeUnit = fieldOrDatumDef['timeUnit'];\n const type = fieldOrDatumDef.type;\n switch (property) {\n // domainMax/Min to signal if the value is a datetime object\n case 'domainMax':\n case 'domainMin':\n if (isDateTime(specifiedScale[property]) || type === 'temporal' || timeUnit) {\n localScaleCmpt.set(property, { signal: valueExpr(specifiedScale[property], { type, timeUnit }) }, true);\n }\n else {\n localScaleCmpt.set(property, specifiedScale[property], true);\n }\n break;\n default:\n localScaleCmpt.copyKeyFromObject(property, specifiedScale);\n }\n }\n else {\n const value = property in scaleRules\n ? scaleRules[property]({\n model,\n channel,\n fieldOrDatumDef,\n scaleType,\n scalePadding,\n scalePaddingInner,\n domain: specifiedScale.domain,\n markDef,\n config\n })\n : config.scale[property];\n if (value !== undefined) {\n localScaleCmpt.set(property, value, false);\n }\n }\n }\n }\n}\nexport const scaleRules = {\n bins: ({ model, fieldOrDatumDef }) => (isFieldDef(fieldOrDatumDef) ? bins(model, fieldOrDatumDef) : undefined),\n interpolate: ({ channel, fieldOrDatumDef }) => interpolate(channel, fieldOrDatumDef.type),\n nice: ({ scaleType, channel, fieldOrDatumDef }) => nice(scaleType, channel, fieldOrDatumDef),\n padding: ({ channel, scaleType, fieldOrDatumDef, markDef, config }) => padding(channel, scaleType, config.scale, fieldOrDatumDef, markDef, config.bar),\n paddingInner: ({ scalePadding, channel, markDef, config }) => paddingInner(scalePadding, channel, markDef.type, config.scale),\n paddingOuter: ({ scalePadding, channel, scaleType, markDef, scalePaddingInner, config }) => paddingOuter(scalePadding, channel, scaleType, markDef.type, scalePaddingInner, config.scale),\n reverse: ({ fieldOrDatumDef, scaleType, channel, config }) => {\n const sort = isFieldDef(fieldOrDatumDef) ? fieldOrDatumDef.sort : undefined;\n return reverse(scaleType, sort, channel, config.scale);\n },\n zero: ({ channel, fieldOrDatumDef, domain, markDef, scaleType }) => zero(channel, fieldOrDatumDef, domain, markDef, scaleType)\n};\n// This method is here rather than in range.ts to avoid circular dependency.\nexport function parseScaleRange(model) {\n if (isUnitModel(model)) {\n parseUnitScaleRange(model);\n }\n else {\n parseNonUnitScaleProperty(model, 'range');\n }\n}\nexport function parseNonUnitScaleProperty(model, property) {\n const localScaleComponents = model.component.scales;\n for (const child of model.children) {\n if (property === 'range') {\n parseScaleRange(child);\n }\n else {\n parseScaleProperty(child, property);\n }\n }\n for (const channel of keys(localScaleComponents)) {\n let valueWithExplicit;\n for (const child of model.children) {\n const childComponent = child.component.scales[channel];\n if (childComponent) {\n const childValueWithExplicit = childComponent.getWithExplicit(property);\n valueWithExplicit = mergeValuesWithExplicit(valueWithExplicit, childValueWithExplicit, property, 'scale', tieBreakByComparing((v1, v2) => {\n switch (property) {\n case 'range':\n // For step, prefer larger step\n if (v1.step && v2.step) {\n return v1.step - v2.step;\n }\n return 0;\n // TODO: precedence rule for other properties\n }\n return 0;\n }));\n }\n }\n localScaleComponents[channel].setWithExplicit(property, valueWithExplicit);\n }\n}\nexport function bins(model, fieldDef) {\n const bin = fieldDef.bin;\n if (isBinning(bin)) {\n const binSignal = getBinSignalName(model, fieldDef.field, bin);\n return new SignalRefWrapper(() => {\n return model.getSignalName(binSignal);\n });\n }\n else if (isBinned(bin) && isBinParams(bin) && bin.step !== undefined) {\n // start and stop will be determined from the scale domain\n return {\n step: bin.step\n };\n }\n return undefined;\n}\nexport function interpolate(channel, type) {\n if (contains([COLOR, FILL, STROKE], channel) && type !== 'nominal') {\n return 'hcl';\n }\n return undefined;\n}\nexport function nice(scaleType, channel, fieldOrDatumDef) {\n var _a;\n if (((_a = getFieldDef(fieldOrDatumDef)) === null || _a === void 0 ? void 0 : _a.bin) || util.contains([ScaleType.TIME, ScaleType.UTC], scaleType)) {\n return undefined;\n }\n return channel in POSITION_SCALE_CHANNEL_INDEX ? true : undefined;\n}\nexport function padding(channel, scaleType, scaleConfig, fieldOrDatumDef, markDef, barConfig) {\n if (channel in POSITION_SCALE_CHANNEL_INDEX) {\n if (isContinuousToContinuous(scaleType)) {\n if (scaleConfig.continuousPadding !== undefined) {\n return scaleConfig.continuousPadding;\n }\n const { type, orient } = markDef;\n if (type === 'bar' && !(isFieldDef(fieldOrDatumDef) && (fieldOrDatumDef.bin || fieldOrDatumDef.timeUnit))) {\n if ((orient === 'vertical' && channel === 'x') || (orient === 'horizontal' && channel === 'y')) {\n return barConfig.continuousBandSize;\n }\n }\n }\n if (scaleType === ScaleType.POINT) {\n return scaleConfig.pointPadding;\n }\n }\n return undefined;\n}\nexport function paddingInner(paddingValue, channel, mark, scaleConfig) {\n if (paddingValue !== undefined) {\n // If user has already manually specified \"padding\", no need to add default paddingInner.\n return undefined;\n }\n if (channel in POSITION_SCALE_CHANNEL_INDEX) {\n // Padding is only set for X and Y by default.\n // Basically it doesn't make sense to add padding for color and size.\n // paddingOuter would only be called if it's a band scale, just return the default for bandScale.\n const { bandPaddingInner, barBandPaddingInner, rectBandPaddingInner } = scaleConfig;\n return getFirstDefined(bandPaddingInner, mark === 'bar' ? barBandPaddingInner : rectBandPaddingInner);\n }\n return undefined;\n}\nexport function paddingOuter(paddingValue, channel, scaleType, mark, paddingInnerValue, scaleConfig) {\n if (paddingValue !== undefined) {\n // If user has already manually specified \"padding\", no need to add default paddingOuter.\n return undefined;\n }\n if (channel in POSITION_SCALE_CHANNEL_INDEX) {\n // Padding is only set for X and Y by default.\n // Basically it doesn't make sense to add padding for color and size.\n if (scaleType === ScaleType.BAND) {\n const { bandPaddingOuter } = scaleConfig;\n return getFirstDefined(bandPaddingOuter, \n /* By default, paddingOuter is paddingInner / 2. The reason is that\n size (width/height) = step * (cardinality - paddingInner + 2 * paddingOuter).\n and we want the width/height to be integer by default.\n Note that step (by default) and cardinality are integers.) */\n isSignalRef(paddingInnerValue) ? { signal: `${paddingInnerValue.signal}/2` } : paddingInnerValue / 2);\n }\n }\n return undefined;\n}\nexport function reverse(scaleType, sort, channel, scaleConfig) {\n if (channel === 'x' && scaleConfig.xReverse !== undefined) {\n if (hasContinuousDomain(scaleType) && sort === 'descending') {\n if (isSignalRef(scaleConfig.xReverse)) {\n return { signal: `!${scaleConfig.xReverse.signal}` };\n }\n else {\n return !scaleConfig.xReverse;\n }\n }\n return scaleConfig.xReverse;\n }\n if (hasContinuousDomain(scaleType) && sort === 'descending') {\n // For continuous domain scales, Vega does not support domain sort.\n // Thus, we reverse range instead if sort is descending\n return true;\n }\n return undefined;\n}\nexport function zero(channel, fieldDef, specifiedDomain, markDef, scaleType) {\n // If users explicitly provide a domain range, we should not augment zero as that will be unexpected.\n const hasCustomDomain = !!specifiedDomain && specifiedDomain !== 'unaggregated';\n if (hasCustomDomain) {\n if (hasContinuousDomain(scaleType)) {\n if (isArray(specifiedDomain)) {\n const first = specifiedDomain[0];\n const last = specifiedDomain[specifiedDomain.length - 1];\n if (first <= 0 && last >= 0) {\n // if the domain includes zero, make zero remains true\n return true;\n }\n }\n return false;\n }\n }\n // If there is no custom domain, return true only for the following cases:\n // 1) using quantitative field with size\n // While this can be either ratio or interval fields, our assumption is that\n // ratio are more common. However, if the scaleType is discretizing scale, we want to return\n // false so that range doesn't start at zero\n if (channel === 'size' && fieldDef.type === 'quantitative' && !isContinuousToDiscrete(scaleType)) {\n return true;\n }\n // 2) non-binned, quantitative x-scale or y-scale\n // (For binning, we should not include zero by default because binning are calculated without zero.)\n if (!(isFieldDef(fieldDef) && fieldDef.bin) &&\n util.contains([...POSITION_SCALE_CHANNELS, ...POLAR_POSITION_SCALE_CHANNELS], channel)) {\n const { orient, type } = markDef;\n if (contains(['bar', 'area', 'line', 'trail'], type)) {\n if ((orient === 'horizontal' && channel === 'y') || (orient === 'vertical' && channel === 'x')) {\n return false;\n }\n }\n return true;\n }\n return false;\n}\n//# sourceMappingURL=properties.js.map","import { SCALE_CHANNELS, SHAPE } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { GEOSHAPE } from '../../mark';\nimport { NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES, scaleCompatible, scaleTypePrecedence } from '../../scale';\nimport { GEOJSON } from '../../type';\nimport { keys } from '../../util';\nimport { isUnitModel } from '../model';\nimport { defaultScaleResolve } from '../resolve';\nimport { mergeValuesWithExplicit, tieBreakByComparing } from '../split';\nimport { ScaleComponent } from './component';\nimport { parseScaleDomain } from './domain';\nimport { parseScaleProperty, parseScaleRange } from './properties';\nimport { scaleType } from './type';\nexport function parseScales(model, { ignoreRange } = {}) {\n parseScaleCore(model);\n parseScaleDomain(model);\n for (const prop of NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES) {\n parseScaleProperty(model, prop);\n }\n if (!ignoreRange) {\n // range depends on zero\n parseScaleRange(model);\n }\n}\nexport function parseScaleCore(model) {\n if (isUnitModel(model)) {\n model.component.scales = parseUnitScaleCore(model);\n }\n else {\n model.component.scales = parseNonUnitScaleCore(model);\n }\n}\n/**\n * Parse scales for all channels of a model.\n */\nfunction parseUnitScaleCore(model) {\n const { encoding, mark } = model;\n return SCALE_CHANNELS.reduce((scaleComponents, channel) => {\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]); // must be typed def to have scale\n // Don't generate scale for shape of geoshape\n if (fieldOrDatumDef && mark === GEOSHAPE && channel === SHAPE && fieldOrDatumDef.type === GEOJSON) {\n return scaleComponents;\n }\n let specifiedScale = fieldOrDatumDef && fieldOrDatumDef['scale'];\n if (fieldOrDatumDef && specifiedScale !== null && specifiedScale !== false) {\n specifiedScale = specifiedScale !== null && specifiedScale !== void 0 ? specifiedScale : {};\n const sType = scaleType(specifiedScale, channel, fieldOrDatumDef, mark);\n scaleComponents[channel] = new ScaleComponent(model.scaleName(channel + '', true), {\n value: sType,\n explicit: specifiedScale.type === sType\n });\n }\n return scaleComponents;\n }, {});\n}\nconst scaleTypeTieBreaker = tieBreakByComparing((st1, st2) => scaleTypePrecedence(st1) - scaleTypePrecedence(st2));\nfunction parseNonUnitScaleCore(model) {\n var _a;\n const scaleComponents = (model.component.scales = {});\n const scaleTypeWithExplicitIndex = {};\n const resolve = model.component.resolve;\n // Parse each child scale and determine if a particular channel can be merged.\n for (const child of model.children) {\n parseScaleCore(child);\n // Instead of always merging right away -- check if it is compatible to merge first!\n for (const channel of keys(child.component.scales)) {\n // if resolve is undefined, set default first\n resolve.scale[channel] = (_a = resolve.scale[channel]) !== null && _a !== void 0 ? _a : defaultScaleResolve(channel, model);\n if (resolve.scale[channel] === 'shared') {\n const explicitScaleType = scaleTypeWithExplicitIndex[channel];\n const childScaleType = child.component.scales[channel].getWithExplicit('type');\n if (explicitScaleType) {\n if (scaleCompatible(explicitScaleType.value, childScaleType.value)) {\n // merge scale component if type are compatible\n scaleTypeWithExplicitIndex[channel] = mergeValuesWithExplicit(explicitScaleType, childScaleType, 'type', 'scale', scaleTypeTieBreaker);\n }\n else {\n // Otherwise, update conflicting channel to be independent\n resolve.scale[channel] = 'independent';\n // Remove from the index so they don't get merged\n delete scaleTypeWithExplicitIndex[channel];\n }\n }\n else {\n scaleTypeWithExplicitIndex[channel] = childScaleType;\n }\n }\n }\n }\n // Merge each channel listed in the index\n for (const channel of keys(scaleTypeWithExplicitIndex)) {\n // Create new merged scale component\n const name = model.scaleName(channel, true);\n const typeWithExplicit = scaleTypeWithExplicitIndex[channel];\n scaleComponents[channel] = new ScaleComponent(name, typeWithExplicit);\n // rename each child and mark them as merged\n for (const child of model.children) {\n const childScale = child.component.scales[channel];\n if (childScale) {\n child.renameScale(childScale.get('name'), name);\n childScale.merged = true;\n }\n }\n }\n return scaleComponents;\n}\n//# sourceMappingURL=parse.js.map","import { isBinning } from '../../bin';\nimport { isColorChannel, isScaleChannel, rangeType } from '../../channel';\nimport { isFieldDef, isPositionFieldOrDatumDef } from '../../channeldef';\nimport * as log from '../../log';\nimport { channelSupportScaleType, scaleTypeSupportDataType } from '../../scale';\nimport { normalizeTimeUnit } from '../../timeunit';\nimport * as util from '../../util';\nimport { POLAR_POSITION_SCALE_CHANNEL_INDEX, POSITION_SCALE_CHANNEL_INDEX } from './../../channel';\n/**\n * Determine if there is a specified scale type and if it is appropriate,\n * or determine default type if type is unspecified or inappropriate.\n */\n// NOTE: CompassQL uses this method.\nexport function scaleType(specifiedScale, channel, fieldDef, mark) {\n const defaultScaleType = defaultType(channel, fieldDef, mark);\n const { type } = specifiedScale;\n if (!isScaleChannel(channel)) {\n // There is no scale for these channels\n return null;\n }\n if (type !== undefined) {\n // Check if explicitly specified scale type is supported by the channel\n if (!channelSupportScaleType(channel, type)) {\n log.warn(log.message.scaleTypeNotWorkWithChannel(channel, type, defaultScaleType));\n return defaultScaleType;\n }\n // Check if explicitly specified scale type is supported by the data type\n if (isFieldDef(fieldDef) && !scaleTypeSupportDataType(type, fieldDef.type)) {\n log.warn(log.message.scaleTypeNotWorkWithFieldDef(type, defaultScaleType));\n return defaultScaleType;\n }\n return type;\n }\n return defaultScaleType;\n}\n/**\n * Determine appropriate default scale type.\n */\n// NOTE: Voyager uses this method.\nfunction defaultType(channel, fieldDef, mark) {\n var _a;\n switch (fieldDef.type) {\n case 'nominal':\n case 'ordinal':\n if (isColorChannel(channel) || rangeType(channel) === 'discrete') {\n if (channel === 'shape' && fieldDef.type === 'ordinal') {\n log.warn(log.message.discreteChannelCannotEncode(channel, 'ordinal'));\n }\n return 'ordinal';\n }\n if (channel in POSITION_SCALE_CHANNEL_INDEX) {\n if (util.contains(['rect', 'bar', 'image', 'rule'], mark)) {\n // The rect/bar mark should fit into a band.\n // For rule, using band scale to make rule align with axis ticks better https://github.com/vega/vega-lite/issues/3429\n return 'band';\n }\n }\n else if (mark === 'arc' && channel in POLAR_POSITION_SCALE_CHANNEL_INDEX) {\n return 'band';\n }\n if (fieldDef.band !== undefined || (isPositionFieldOrDatumDef(fieldDef) && ((_a = fieldDef.axis) === null || _a === void 0 ? void 0 : _a.tickBand))) {\n return 'band';\n }\n // Otherwise, use ordinal point scale so we can easily get center positions of the marks.\n return 'point';\n case 'temporal':\n if (isColorChannel(channel)) {\n return 'time';\n }\n else if (rangeType(channel) === 'discrete') {\n log.warn(log.message.discreteChannelCannotEncode(channel, 'temporal'));\n // TODO: consider using quantize (equivalent to binning) once we have it\n return 'ordinal';\n }\n else if (isFieldDef(fieldDef) && fieldDef.timeUnit && normalizeTimeUnit(fieldDef.timeUnit).utc) {\n return 'utc';\n }\n return 'time';\n case 'quantitative':\n if (isColorChannel(channel)) {\n if (isFieldDef(fieldDef) && isBinning(fieldDef.bin)) {\n return 'bin-ordinal';\n }\n return 'linear';\n }\n else if (rangeType(channel) === 'discrete') {\n log.warn(log.message.discreteChannelCannotEncode(channel, 'quantitative'));\n // TODO: consider using quantize (equivalent to binning) once we have it\n return 'ordinal';\n }\n return 'linear';\n case 'geojson':\n return undefined;\n }\n /* istanbul ignore next: should never reach this */\n throw new Error(log.message.invalidFieldType(fieldDef.type));\n}\n//# sourceMappingURL=type.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { FACET_CHANNELS, getPositionScaleChannel, isChannel, isScaleChannel } from '../channel';\nimport { getFieldDef, vgField } from '../channeldef';\nimport { DataSourceType } from '../data';\nimport { forEach, reduce } from '../encoding';\nimport { replaceExprRefInIndex } from '../expr';\nimport * as log from '../log';\nimport { hasDiscreteDomain } from '../scale';\nimport { isFacetSpec } from '../spec';\nimport { extractCompositionLayout } from '../spec/base';\nimport { extractTitleConfig, isText } from '../title';\nimport { normalizeTransform } from '../transform';\nimport { contains, duplicate, isEmpty, keys, varName } from '../util';\nimport { isVgRangeStep } from '../vega.schema';\nimport { assembleAxes } from './axis/assemble';\nimport { signalOrValueRef, signalRefOrValue } from './common';\nimport { assembleHeaderGroups, assembleLayoutTitleBand, assembleTitleGroup } from './header/assemble';\nimport { HEADER_CHANNELS } from './header/component';\nimport { sizeExpr } from './layoutsize/assemble';\nimport { getSizeTypeFromLayoutSizeType } from './layoutsize/component';\nimport { assembleLegends } from './legend/assemble';\nimport { parseLegend } from './legend/parse';\nimport { assembleProjections } from './projection/assemble';\nimport { parseProjection } from './projection/parse';\nimport { assembleScales } from './scale/assemble';\nimport { assembleDomain, getFieldFromDomain } from './scale/domain';\nimport { parseScales } from './scale/parse';\nimport { Split } from './split';\nexport class NameMap {\n constructor() {\n this.nameMap = {};\n }\n rename(oldName, newName) {\n this.nameMap[oldName] = newName;\n }\n has(name) {\n return this.nameMap[name] !== undefined;\n }\n get(name) {\n // If the name appears in the _nameMap, we need to read its new name.\n // We have to loop over the dict just in case the new name also gets renamed.\n while (this.nameMap[name] && name !== this.nameMap[name]) {\n name = this.nameMap[name];\n }\n return name;\n }\n}\n/*\n We use type guards instead of `instanceof` as `instanceof` makes\n different parts of the compiler depend on the actual implementation of\n the model classes, which in turn depend on different parts of the compiler.\n Thus, `instanceof` leads to circular dependency problems.\n\n On the other hand, type guards only make different parts of the compiler\n depend on the type of the model classes, but not the actual implementation.\n*/\nexport function isUnitModel(model) {\n return (model === null || model === void 0 ? void 0 : model.type) === 'unit';\n}\nexport function isFacetModel(model) {\n return (model === null || model === void 0 ? void 0 : model.type) === 'facet';\n}\nexport function isConcatModel(model) {\n return (model === null || model === void 0 ? void 0 : model.type) === 'concat';\n}\nexport function isLayerModel(model) {\n return (model === null || model === void 0 ? void 0 : model.type) === 'layer';\n}\nexport class Model {\n constructor(spec, type, parent, parentGivenName, config, resolve, view) {\n var _a, _b;\n this.type = type;\n this.parent = parent;\n this.config = config;\n this.children = [];\n /**\n * Corrects the data references in marks after assemble.\n */\n this.correctDataNames = (mark) => {\n // TODO: make this correct\n // for normal data references\n if (mark.from && mark.from.data) {\n mark.from.data = this.lookupDataSource(mark.from.data);\n }\n // for access to facet data\n if (mark.from && mark.from.facet && mark.from.facet.data) {\n mark.from.facet.data = this.lookupDataSource(mark.from.facet.data);\n }\n return mark;\n };\n this.parent = parent;\n this.config = config;\n this.view = replaceExprRefInIndex(view);\n // If name is not provided, always use parent's givenName to avoid name conflicts.\n this.name = (_a = spec.name) !== null && _a !== void 0 ? _a : parentGivenName;\n this.title = isText(spec.title) ? { text: spec.title } : spec.title ? this.initTitle(spec.title) : undefined;\n // Shared name maps\n this.scaleNameMap = parent ? parent.scaleNameMap : new NameMap();\n this.projectionNameMap = parent ? parent.projectionNameMap : new NameMap();\n this.signalNameMap = parent ? parent.signalNameMap : new NameMap();\n this.data = spec.data;\n this.description = spec.description;\n this.transforms = normalizeTransform((_b = spec.transform) !== null && _b !== void 0 ? _b : []);\n this.layout = type === 'layer' || type === 'unit' ? {} : extractCompositionLayout(spec, type, config);\n this.component = {\n data: {\n sources: parent ? parent.component.data.sources : [],\n outputNodes: parent ? parent.component.data.outputNodes : {},\n outputNodeRefCounts: parent ? parent.component.data.outputNodeRefCounts : {},\n // data is faceted if the spec is a facet spec or the parent has faceted data and data is undefined\n isFaceted: isFacetSpec(spec) || (parent && parent.component.data.isFaceted && spec.data === undefined)\n },\n layoutSize: new Split(),\n layoutHeaders: { row: {}, column: {}, facet: {} },\n mark: null,\n resolve: Object.assign({ scale: {}, axis: {}, legend: {} }, (resolve ? duplicate(resolve) : {})),\n selection: null,\n scales: null,\n projection: null,\n axes: {},\n legends: {}\n };\n }\n initTitle(title) {\n const props = keys(title);\n const titleInternal = {\n text: signalRefOrValue(title.text)\n };\n for (const prop of props) {\n titleInternal[prop] = signalRefOrValue(title[prop]);\n }\n return titleInternal;\n }\n get width() {\n return this.getSizeSignalRef('width');\n }\n get height() {\n return this.getSizeSignalRef('height');\n }\n parse() {\n this.parseScale();\n this.parseLayoutSize(); // depends on scale\n this.renameTopLevelLayoutSizeSignal();\n this.parseSelections();\n this.parseProjection();\n this.parseData(); // (pathorder) depends on markDef; selection filters depend on parsed selections; depends on projection because some transforms require the finalized projection name.\n this.parseAxesAndHeaders(); // depends on scale and layout size\n this.parseLegends(); // depends on scale, markDef\n this.parseMarkGroup(); // depends on data name, scale, layout size, axisGroup, and children's scale, axis, legend and mark.\n }\n parseScale() {\n parseScales(this);\n }\n parseProjection() {\n parseProjection(this);\n }\n /**\n * Rename top-level spec's size to be just width / height, ignoring model name.\n * This essentially merges the top-level spec's width/height signals with the width/height signals\n * to help us reduce redundant signals declaration.\n */\n renameTopLevelLayoutSizeSignal() {\n if (this.getName('width') !== 'width') {\n this.renameSignal(this.getName('width'), 'width');\n }\n if (this.getName('height') !== 'height') {\n this.renameSignal(this.getName('height'), 'height');\n }\n }\n parseLegends() {\n parseLegend(this);\n }\n assembleGroupStyle() {\n var _a, _b;\n if (this.type === 'unit' || this.type === 'layer') {\n return (_b = (_a = this.view) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : 'cell';\n }\n return undefined;\n }\n assembleEncodeFromView(view) {\n // Exclude \"style\"\n const { style: _ } = view, baseView = __rest(view, [\"style\"]);\n const e = {};\n for (const property of keys(baseView)) {\n const value = baseView[property];\n if (value !== undefined) {\n e[property] = signalOrValueRef(value);\n }\n }\n return e;\n }\n assembleGroupEncodeEntry(isTopLevel) {\n let encodeEntry = {};\n if (this.view) {\n encodeEntry = this.assembleEncodeFromView(this.view);\n }\n if (!isTopLevel) {\n // Descriptions are already added to the top-level description so we only need to add them to the inner views.\n if (this.description) {\n encodeEntry['description'] = signalOrValueRef(this.description);\n }\n // For top-level spec, we can set the global width and height signal to adjust the group size.\n // For other child specs, we have to manually set width and height in the encode entry.\n if (this.type === 'unit' || this.type === 'layer') {\n return Object.assign({ width: this.getSizeSignalRef('width'), height: this.getSizeSignalRef('height') }, (encodeEntry !== null && encodeEntry !== void 0 ? encodeEntry : {}));\n }\n }\n return isEmpty(encodeEntry) ? undefined : encodeEntry;\n }\n assembleLayout() {\n if (!this.layout) {\n return undefined;\n }\n const _a = this.layout, { spacing } = _a, layout = __rest(_a, [\"spacing\"]);\n const { component, config } = this;\n const titleBand = assembleLayoutTitleBand(component.layoutHeaders, config);\n return Object.assign(Object.assign(Object.assign({ padding: spacing }, this.assembleDefaultLayout()), layout), (titleBand ? { titleBand } : {}));\n }\n assembleDefaultLayout() {\n return {};\n }\n assembleHeaderMarks() {\n const { layoutHeaders } = this.component;\n let headerMarks = [];\n for (const channel of FACET_CHANNELS) {\n if (layoutHeaders[channel].title) {\n headerMarks.push(assembleTitleGroup(this, channel));\n }\n }\n for (const channel of HEADER_CHANNELS) {\n headerMarks = headerMarks.concat(assembleHeaderGroups(this, channel));\n }\n return headerMarks;\n }\n assembleAxes() {\n return assembleAxes(this.component.axes, this.config);\n }\n assembleLegends() {\n return assembleLegends(this);\n }\n assembleProjections() {\n return assembleProjections(this);\n }\n assembleTitle() {\n var _a, _b, _c;\n const _d = (_a = this.title) !== null && _a !== void 0 ? _a : {}, { encoding } = _d, titleNoEncoding = __rest(_d, [\"encoding\"]);\n const title = Object.assign(Object.assign(Object.assign({}, extractTitleConfig(this.config.title).nonMark), titleNoEncoding), (encoding ? { encode: { update: encoding } } : {}));\n if (title.text) {\n if (contains(['unit', 'layer'], this.type)) {\n // Unit/Layer\n if (contains(['middle', undefined], title.anchor)) {\n title.frame = (_b = title.frame) !== null && _b !== void 0 ? _b : 'group';\n }\n }\n else {\n // composition with Vega layout\n // Set title = \"start\" by default for composition as \"middle\" does not look nice\n // https://github.com/vega/vega/issues/960#issuecomment-471360328\n title.anchor = (_c = title.anchor) !== null && _c !== void 0 ? _c : 'start';\n }\n return isEmpty(title) ? undefined : title;\n }\n return undefined;\n }\n /**\n * Assemble the mark group for this model. We accept optional `signals` so that we can include concat top-level signals with the top-level model's local signals.\n */\n assembleGroup(signals = []) {\n const group = {};\n signals = signals.concat(this.assembleSignals());\n if (signals.length > 0) {\n group.signals = signals;\n }\n const layout = this.assembleLayout();\n if (layout) {\n group.layout = layout;\n }\n group.marks = [].concat(this.assembleHeaderMarks(), this.assembleMarks());\n // Only include scales if this spec is top-level or if parent is facet.\n // (Otherwise, it will be merged with upper-level's scope.)\n const scales = !this.parent || isFacetModel(this.parent) ? assembleScales(this) : [];\n if (scales.length > 0) {\n group.scales = scales;\n }\n const axes = this.assembleAxes();\n if (axes.length > 0) {\n group.axes = axes;\n }\n const legends = this.assembleLegends();\n if (legends.length > 0) {\n group.legends = legends;\n }\n return group;\n }\n getName(text) {\n return varName((this.name ? this.name + '_' : '') + text);\n }\n getDataName(type) {\n return this.getName(DataSourceType[type].toLowerCase());\n }\n /**\n * Request a data source name for the given data source type and mark that data source as required.\n * This method should be called in parse, so that all used data source can be correctly instantiated in assembleData().\n * You can lookup the correct dataset name in assemble with `lookupDataSource`.\n */\n requestDataName(name) {\n const fullName = this.getDataName(name);\n // Increase ref count. This is critical because otherwise we won't create a data source.\n // We also increase the ref counts on OutputNode.getSource() calls.\n const refCounts = this.component.data.outputNodeRefCounts;\n refCounts[fullName] = (refCounts[fullName] || 0) + 1;\n return fullName;\n }\n getSizeSignalRef(layoutSizeType) {\n if (isFacetModel(this.parent)) {\n const sizeType = getSizeTypeFromLayoutSizeType(layoutSizeType);\n const channel = getPositionScaleChannel(sizeType);\n const scaleComponent = this.component.scales[channel];\n if (scaleComponent && !scaleComponent.merged) {\n // independent scale\n const type = scaleComponent.get('type');\n const range = scaleComponent.get('range');\n if (hasDiscreteDomain(type) && isVgRangeStep(range)) {\n const scaleName = scaleComponent.get('name');\n const domain = assembleDomain(this, channel);\n const field = getFieldFromDomain(domain);\n if (field) {\n const fieldRef = vgField({ aggregate: 'distinct', field }, { expr: 'datum' });\n return {\n signal: sizeExpr(scaleName, scaleComponent, fieldRef)\n };\n }\n else {\n log.warn(log.message.unknownField(channel));\n return null;\n }\n }\n }\n }\n return {\n signal: this.signalNameMap.get(this.getName(layoutSizeType))\n };\n }\n /**\n * Lookup the name of the datasource for an output node. You probably want to call this in assemble.\n */\n lookupDataSource(name) {\n const node = this.component.data.outputNodes[name];\n if (!node) {\n // Name not found in map so let's just return what we got.\n // This can happen if we already have the correct name.\n return name;\n }\n return node.getSource();\n }\n getSignalName(oldSignalName) {\n return this.signalNameMap.get(oldSignalName);\n }\n renameSignal(oldName, newName) {\n this.signalNameMap.rename(oldName, newName);\n }\n renameScale(oldName, newName) {\n this.scaleNameMap.rename(oldName, newName);\n }\n renameProjection(oldName, newName) {\n this.projectionNameMap.rename(oldName, newName);\n }\n /**\n * @return scale name for a given channel after the scale has been parsed and named.\n */\n scaleName(originalScaleName, parse) {\n if (parse) {\n // During the parse phase always return a value\n // No need to refer to rename map because a scale can't be renamed\n // before it has the original name.\n return this.getName(originalScaleName);\n }\n // If there is a scale for the channel, it should either\n // be in the scale component or exist in the name map\n if (\n // If there is a scale for the channel, there should be a local scale component for it\n (isChannel(originalScaleName) && isScaleChannel(originalScaleName) && this.component.scales[originalScaleName]) ||\n // in the scale name map (the scale get merged by its parent)\n this.scaleNameMap.has(this.getName(originalScaleName))) {\n return this.scaleNameMap.get(this.getName(originalScaleName));\n }\n return undefined;\n }\n /**\n * @return projection name after the projection has been parsed and named.\n */\n projectionName(parse) {\n if (parse) {\n // During the parse phase always return a value\n // No need to refer to rename map because a projection can't be renamed\n // before it has the original name.\n return this.getName('projection');\n }\n if ((this.component.projection && !this.component.projection.merged) ||\n this.projectionNameMap.has(this.getName('projection'))) {\n return this.projectionNameMap.get(this.getName('projection'));\n }\n return undefined;\n }\n /**\n * Traverse a model's hierarchy to get the scale component for a particular channel.\n */\n getScaleComponent(channel) {\n /* istanbul ignore next: This is warning for debugging test */\n if (!this.component.scales) {\n throw new Error('getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().');\n }\n const localScaleComponent = this.component.scales[channel];\n if (localScaleComponent && !localScaleComponent.merged) {\n return localScaleComponent;\n }\n return this.parent ? this.parent.getScaleComponent(channel) : undefined;\n }\n /**\n * Traverse a model's hierarchy to get a particular selection component.\n */\n getSelectionComponent(variableName, origName) {\n let sel = this.component.selection[variableName];\n if (!sel && this.parent) {\n sel = this.parent.getSelectionComponent(variableName, origName);\n }\n if (!sel) {\n throw new Error(log.message.selectionNotFound(origName));\n }\n return sel;\n }\n /**\n * Returns true if the model has a signalRef for an axis orient.\n */\n hasAxisOrientSignalRef() {\n var _a, _b;\n return (((_a = this.component.axes.x) === null || _a === void 0 ? void 0 : _a.some(a => a.hasOrientSignalRef())) || ((_b = this.component.axes.y) === null || _b === void 0 ? void 0 : _b.some(a => a.hasOrientSignalRef())));\n }\n}\n/** Abstract class for UnitModel and FacetModel. Both of which can contain fieldDefs as a part of its own specification. */\nexport class ModelWithField extends Model {\n /** Get \"field\" reference for Vega */\n vgField(channel, opt = {}) {\n const fieldDef = this.fieldDef(channel);\n if (!fieldDef) {\n return undefined;\n }\n return vgField(fieldDef, opt);\n }\n reduceFieldDef(f, init) {\n return reduce(this.getMapping(), (acc, cd, c) => {\n const fieldDef = getFieldDef(cd);\n if (fieldDef) {\n return f(acc, fieldDef, c);\n }\n return acc;\n }, init);\n }\n forEachFieldDef(f, t) {\n forEach(this.getMapping(), (cd, c) => {\n const fieldDef = getFieldDef(cd);\n if (fieldDef) {\n f(fieldDef, c);\n }\n }, t);\n }\n}\n//# sourceMappingURL=model.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for density transform nodes\n */\nexport class DensityTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : 'value', (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : 'density'];\n }\n clone() {\n return new DensityTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.density, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `DensityTransform ${hash(this.transform)}`;\n }\n assemble() {\n const _a = this.transform, { density } = _a, rest = __rest(_a, [\"density\"]);\n const result = Object.assign({ type: 'kde', field: density }, rest);\n return result;\n }\n}\n//# sourceMappingURL=density.js.map","import { isScaleChannel } from '../../channel';\nimport { vgField as fieldRef } from '../../channeldef';\nimport { isPathMark } from '../../mark';\nimport { hasContinuousDomain } from '../../scale';\nimport { hash, keys } from '../../util';\nimport { getMarkPropOrConfig } from '../common';\nimport { DataFlowNode } from './dataflow';\nexport class FilterInvalidNode extends DataFlowNode {\n constructor(parent, filter) {\n super(parent);\n this.filter = filter;\n }\n clone() {\n return new FilterInvalidNode(null, Object.assign({}, this.filter));\n }\n static make(parent, model) {\n const { config, mark, markDef } = model;\n const invalid = getMarkPropOrConfig('invalid', markDef, config);\n if (invalid !== 'filter') {\n return null;\n }\n const filter = model.reduceFieldDef((aggregator, fieldDef, channel) => {\n const scaleComponent = isScaleChannel(channel) && model.getScaleComponent(channel);\n if (scaleComponent) {\n const scaleType = scaleComponent.get('type');\n // While discrete domain scales can handle invalid values, continuous scales can't.\n // Thus, for non-path marks, we have to filter null for scales with continuous domains.\n // (For path marks, we will use \"defined\" property and skip these values instead.)\n if (hasContinuousDomain(scaleType) && fieldDef.aggregate !== 'count' && !isPathMark(mark)) {\n aggregator[fieldDef.field] = fieldDef; // we know that the fieldDef is a typed field def\n }\n }\n return aggregator;\n }, {});\n if (!keys(filter).length) {\n return null;\n }\n return new FilterInvalidNode(parent, filter);\n }\n dependentFields() {\n return new Set(keys(this.filter));\n }\n producedFields() {\n return new Set(); // filter does not produce any new fields\n }\n hash() {\n return `FilterInvalid ${hash(this.filter)}`;\n }\n /**\n * Create the VgTransforms for each of the filtered fields.\n */\n assemble() {\n const filters = keys(this.filter).reduce((vegaFilters, field) => {\n const fieldDef = this.filter[field];\n const ref = fieldRef(fieldDef, { expr: 'datum' });\n if (fieldDef !== null) {\n if (fieldDef.type === 'temporal') {\n vegaFilters.push(`(isDate(${ref}) || (isValid(${ref}) && isFinite(+${ref})))`);\n }\n else if (fieldDef.type === 'quantitative') {\n vegaFilters.push(`isValid(${ref})`);\n vegaFilters.push(`isFinite(+${ref})`);\n }\n else {\n // should never get here\n }\n }\n return vegaFilters;\n }, []);\n return filters.length > 0\n ? {\n type: 'filter',\n expr: filters.join(' && ')\n }\n : null;\n }\n}\n//# sourceMappingURL=filterinvalid.js.map","import { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for flatten transform nodes\n */\nexport class FlattenTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const { flatten, as = [] } = this.transform;\n this.transform.as = flatten.map((f, i) => { var _a; return (_a = as[i]) !== null && _a !== void 0 ? _a : f; });\n }\n clone() {\n return new FlattenTransformNode(this.parent, duplicate(this.transform));\n }\n dependentFields() {\n return new Set(this.transform.flatten);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `FlattenTransform ${hash(this.transform)}`;\n }\n assemble() {\n const { flatten: fields, as } = this.transform;\n const result = {\n type: 'flatten',\n fields,\n as\n };\n return result;\n }\n}\n//# sourceMappingURL=flatten.js.map","import { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for flatten transform nodes\n */\nexport class FoldTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : 'key', (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : 'value'];\n }\n clone() {\n return new FoldTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n return new Set(this.transform.fold);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `FoldTransform ${hash(this.transform)}`;\n }\n assemble() {\n const { fold, as } = this.transform;\n const result = {\n type: 'fold',\n fields: fold,\n as\n };\n return result;\n }\n}\n//# sourceMappingURL=fold.js.map","import { isString } from 'vega-util';\nimport { LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2, SHAPE } from '../../channel';\nimport { getFieldOrDatumDef, isDatumDef, isFieldDef, isValueDef } from '../../channeldef';\nimport { GEOJSON } from '../../type';\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class GeoJSONNode extends DataFlowNode {\n constructor(parent, fields, geojson, signal) {\n super(parent);\n this.fields = fields;\n this.geojson = geojson;\n this.signal = signal;\n }\n clone() {\n return new GeoJSONNode(null, duplicate(this.fields), this.geojson, this.signal);\n }\n static parseAll(parent, model) {\n if (model.component.projection && !model.component.projection.isFit) {\n return parent;\n }\n let geoJsonCounter = 0;\n for (const coordinates of [\n [LONGITUDE, LATITUDE],\n [LONGITUDE2, LATITUDE2]\n ]) {\n const pair = coordinates.map(channel => {\n const def = getFieldOrDatumDef(model.encoding[channel]);\n return isFieldDef(def)\n ? def.field\n : isDatumDef(def)\n ? { expr: `${def.datum}` }\n : isValueDef(def)\n ? { expr: `${def['value']}` }\n : undefined;\n });\n if (pair[0] || pair[1]) {\n parent = new GeoJSONNode(parent, pair, null, model.getName(`geojson_${geoJsonCounter++}`));\n }\n }\n if (model.channelHasField(SHAPE)) {\n const fieldDef = model.typedFieldDef(SHAPE);\n if (fieldDef.type === GEOJSON) {\n parent = new GeoJSONNode(parent, null, fieldDef.field, model.getName(`geojson_${geoJsonCounter++}`));\n }\n }\n return parent;\n }\n dependentFields() {\n var _a;\n const fields = ((_a = this.fields) !== null && _a !== void 0 ? _a : []).filter(isString);\n return new Set([...(this.geojson ? [this.geojson] : []), ...fields]);\n }\n producedFields() {\n return new Set();\n }\n hash() {\n return `GeoJSON ${this.geojson} ${this.signal} ${hash(this.fields)}`;\n }\n assemble() {\n return Object.assign(Object.assign(Object.assign({ type: 'geojson' }, (this.fields ? { fields: this.fields } : {})), (this.geojson ? { geojson: this.geojson } : {})), { signal: this.signal });\n }\n}\n//# sourceMappingURL=geojson.js.map","import { isString } from 'vega-util';\nimport { LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2 } from '../../channel';\nimport { getFieldOrDatumDef, isDatumDef, isFieldDef, isValueDef } from '../../channeldef';\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class GeoPointNode extends DataFlowNode {\n constructor(parent, projection, fields, as) {\n super(parent);\n this.projection = projection;\n this.fields = fields;\n this.as = as;\n }\n clone() {\n return new GeoPointNode(null, this.projection, duplicate(this.fields), duplicate(this.as));\n }\n static parseAll(parent, model) {\n if (!model.projectionName()) {\n return parent;\n }\n for (const coordinates of [\n [LONGITUDE, LATITUDE],\n [LONGITUDE2, LATITUDE2]\n ]) {\n const pair = coordinates.map(channel => {\n const def = getFieldOrDatumDef(model.encoding[channel]);\n return isFieldDef(def)\n ? def.field\n : isDatumDef(def)\n ? { expr: `${def.datum}` }\n : isValueDef(def)\n ? { expr: `${def['value']}` }\n : undefined;\n });\n const suffix = coordinates[0] === LONGITUDE2 ? '2' : '';\n if (pair[0] || pair[1]) {\n parent = new GeoPointNode(parent, model.projectionName(), pair, [\n model.getName('x' + suffix),\n model.getName('y' + suffix)\n ]);\n }\n }\n return parent;\n }\n dependentFields() {\n return new Set(this.fields.filter(isString));\n }\n producedFields() {\n return new Set(this.as);\n }\n hash() {\n return `Geopoint ${this.projection} ${hash(this.fields)} ${hash(this.as)}`;\n }\n assemble() {\n return {\n type: 'geopoint',\n projection: this.projection,\n fields: this.fields,\n as: this.as\n };\n }\n}\n//# sourceMappingURL=geopoint.js.map","import { isFieldDef } from '../../channeldef';\nimport { pathGroupingFields } from '../../encoding';\nimport { isImputeSequence } from '../../transform';\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class ImputeNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new ImputeNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.impute, this.transform.key, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set([this.transform.impute]);\n }\n processSequence(keyvals) {\n const { start = 0, stop, step } = keyvals;\n const result = [start, stop, ...(step ? [step] : [])].join(',');\n return { signal: `sequence(${result})` };\n }\n static makeFromTransform(parent, imputeTransform) {\n return new ImputeNode(parent, imputeTransform);\n }\n static makeFromEncoding(parent, model) {\n const encoding = model.encoding;\n const xDef = encoding.x;\n const yDef = encoding.y;\n if (isFieldDef(xDef) && isFieldDef(yDef)) {\n const imputedChannel = xDef.impute ? xDef : yDef.impute ? yDef : undefined;\n if (imputedChannel === undefined) {\n return undefined;\n }\n const keyChannel = xDef.impute ? yDef : yDef.impute ? xDef : undefined;\n const { method, value, frame, keyvals } = imputedChannel.impute;\n const groupbyFields = pathGroupingFields(model.mark, encoding);\n return new ImputeNode(parent, Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ impute: imputedChannel.field, key: keyChannel.field }, (method ? { method } : {})), (value !== undefined ? { value } : {})), (frame ? { frame } : {})), (keyvals !== undefined ? { keyvals } : {})), (groupbyFields.length ? { groupby: groupbyFields } : {})));\n }\n return null;\n }\n hash() {\n return `Impute ${hash(this.transform)}`;\n }\n assemble() {\n const { impute, key, keyvals, method, groupby, value, frame = [null, null] } = this.transform;\n const imputeTransform = Object.assign(Object.assign(Object.assign(Object.assign({ type: 'impute', field: impute, key }, (keyvals ? { keyvals: isImputeSequence(keyvals) ? this.processSequence(keyvals) : keyvals } : {})), { method: 'value' }), (groupby ? { groupby } : {})), { value: !method || method === 'value' ? value : null });\n if (method && method !== 'value') {\n const deriveNewField = Object.assign({ type: 'window', as: [`imputed_${impute}_value`], ops: [method], fields: [impute], frame, ignorePeers: false }, (groupby ? { groupby } : {}));\n const replaceOriginal = {\n type: 'formula',\n expr: `datum.${impute} === null ? datum.imputed_${impute}_value : datum.${impute}`,\n as: impute\n };\n return [imputeTransform, deriveNewField, replaceOriginal];\n }\n else {\n return [imputeTransform];\n }\n }\n}\n//# sourceMappingURL=impute.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for loess transform nodes\n */\nexport class LoessTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : transform.on, (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : transform.loess];\n }\n clone() {\n return new LoessTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.loess, this.transform.on, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `LoessTransform ${hash(this.transform)}`;\n }\n assemble() {\n const _a = this.transform, { loess, on } = _a, rest = __rest(_a, [\"loess\", \"on\"]);\n const result = Object.assign({ type: 'loess', x: on, y: loess }, rest);\n return result;\n }\n}\n//# sourceMappingURL=loess.js.map","import { array, isString } from 'vega-util';\nimport * as log from '../../log';\nimport { isLookupData, isLookupSelection } from '../../transform';\nimport { duplicate, hash, varName } from '../../util';\nimport { DataFlowNode, OutputNode } from './dataflow';\nimport { findSource } from './parse';\nimport { SourceNode } from './source';\nimport { DataSourceType } from '../../data';\nexport class LookupNode extends DataFlowNode {\n constructor(parent, transform, secondary) {\n super(parent);\n this.transform = transform;\n this.secondary = secondary;\n }\n clone() {\n return new LookupNode(null, duplicate(this.transform), this.secondary);\n }\n static make(parent, model, transform, counter) {\n const sources = model.component.data.sources;\n const { from } = transform;\n let fromOutputNode = null;\n if (isLookupData(from)) {\n let fromSource = findSource(from.data, sources);\n if (!fromSource) {\n fromSource = new SourceNode(from.data);\n sources.push(fromSource);\n }\n const fromOutputName = model.getName(`lookup_${counter}`);\n fromOutputNode = new OutputNode(fromSource, fromOutputName, DataSourceType.Lookup, model.component.data.outputNodeRefCounts);\n model.component.data.outputNodes[fromOutputName] = fromOutputNode;\n }\n else if (isLookupSelection(from)) {\n const selName = from.selection;\n transform = Object.assign({ as: selName }, transform);\n fromOutputNode = model.getSelectionComponent(varName(selName), selName).materialized;\n if (!fromOutputNode) {\n throw new Error(log.message.noSameUnitLookup(selName));\n }\n }\n return new LookupNode(parent, transform, fromOutputNode.getSource());\n }\n dependentFields() {\n return new Set([this.transform.lookup]);\n }\n producedFields() {\n return new Set(this.transform.as ? array(this.transform.as) : this.transform.from.fields);\n }\n hash() {\n return `Lookup ${hash({ transform: this.transform, secondary: this.secondary })}`;\n }\n assemble() {\n let foreign;\n if (this.transform.from.fields) {\n // lookup a few fields and add create a flat output\n foreign = Object.assign({ values: this.transform.from.fields }, (this.transform.as ? { as: array(this.transform.as) } : {}));\n }\n else {\n // lookup full record and nest it\n let asName = this.transform.as;\n if (!isString(asName)) {\n log.warn(log.message.NO_FIELDS_NEEDS_AS);\n asName = '_lookup';\n }\n foreign = {\n as: [asName]\n };\n }\n return Object.assign(Object.assign({ type: 'lookup', from: this.secondary, key: this.transform.from.key, fields: [this.transform.lookup] }, foreign), (this.transform.default ? { default: this.transform.default } : {}));\n }\n}\n//# sourceMappingURL=lookup.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for quantile transform nodes\n */\nexport class QuantileTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : 'prob', (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : 'value'];\n }\n clone() {\n return new QuantileTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.quantile, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `QuantileTransform ${hash(this.transform)}`;\n }\n assemble() {\n const _a = this.transform, { quantile } = _a, rest = __rest(_a, [\"quantile\"]);\n const result = Object.assign({ type: 'quantile', field: quantile }, rest);\n return result;\n }\n}\n//# sourceMappingURL=quantile.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for regression transform nodes\n */\nexport class RegressionTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : transform.on, (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : transform.regression];\n }\n clone() {\n return new RegressionTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.regression, this.transform.on, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `RegressionTransform ${hash(this.transform)}`;\n }\n assemble() {\n const _a = this.transform, { regression, on } = _a, rest = __rest(_a, [\"regression\", \"on\"]);\n const result = Object.assign({ type: 'regression', x: on, y: regression }, rest);\n return result;\n }\n}\n//# sourceMappingURL=regression.js.map","import { duplicate, hash, unique } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for pivot transform nodes.\n */\nexport class PivotTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new PivotTransformNode(null, duplicate(this.transform));\n }\n addDimensions(fields) {\n var _a;\n this.transform.groupby = unique(((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : []).concat(fields), d => d);\n }\n producedFields() {\n return undefined; // return undefined so that potentially everything can depend on the pivot\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.pivot, this.transform.value, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n hash() {\n return `PivotTransform ${hash(this.transform)}`;\n }\n assemble() {\n const { pivot, value, groupby, limit, op } = this.transform;\n return Object.assign(Object.assign(Object.assign({ type: 'pivot', field: pivot, value }, (limit !== undefined ? { limit } : {})), (op !== undefined ? { op } : {})), (groupby !== undefined ? { groupby } : {}));\n }\n}\n//# sourceMappingURL=pivot.js.map","import { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for the sample transform nodes\n */\nexport class SampleTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new SampleTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return new Set();\n }\n hash() {\n return `SampleTransform ${hash(this.transform)}`;\n }\n assemble() {\n return {\n type: 'sample',\n size: this.transform.sample\n };\n }\n}\n//# sourceMappingURL=sample.js.map","import { isUrlData } from '../../data';\nimport { AggregateNode } from './aggregate';\nimport { BinNode } from './bin';\nimport { CalculateNode } from './calculate';\nimport { OutputNode } from './dataflow';\nimport { DensityTransformNode } from './density';\nimport { FacetNode } from './facet';\nimport { FilterNode } from './filter';\nimport { FilterInvalidNode } from './filterinvalid';\nimport { FlattenTransformNode } from './flatten';\nimport { FoldTransformNode } from './fold';\nimport { ParseNode } from './formatparse';\nimport { GeoJSONNode } from './geojson';\nimport { GeoPointNode } from './geopoint';\nimport { GraticuleNode } from './graticule';\nimport { IdentifierNode } from './identifier';\nimport { ImputeNode } from './impute';\nimport { JoinAggregateTransformNode } from './joinaggregate';\nimport { LoessTransformNode } from './loess';\nimport { LookupNode } from './lookup';\nimport { QuantileTransformNode } from './quantile';\nimport { RegressionTransformNode } from './regression';\nimport { PivotTransformNode } from './pivot';\nimport { SampleTransformNode } from './sample';\nimport { SequenceNode } from './sequence';\nimport { SourceNode } from './source';\nimport { StackNode } from './stack';\nimport { TimeUnitNode } from './timeunit';\nimport { WindowTransformNode } from './window';\nfunction makeWalkTree(data) {\n // to name datasources\n let datasetIndex = 0;\n /**\n * Recursively walk down the tree.\n */\n function walkTree(node, dataSource) {\n var _a;\n if (node instanceof SourceNode) {\n // If the source is a named data source or a data source with values, we need\n // to put it in a different data source. Otherwise, Vega may override the data.\n if (!node.isGenerator && !isUrlData(node.data)) {\n data.push(dataSource);\n const newData = {\n name: null,\n source: dataSource.name,\n transform: []\n };\n dataSource = newData;\n }\n }\n if (node instanceof ParseNode) {\n if (node.parent instanceof SourceNode && !dataSource.source) {\n // If node's parent is a root source and the data source does not refer to another data source, use normal format parse\n dataSource.format = Object.assign(Object.assign({}, ((_a = dataSource.format) !== null && _a !== void 0 ? _a : {})), { parse: node.assembleFormatParse() });\n // add calculates for all nested fields\n dataSource.transform.push(...node.assembleTransforms(true));\n }\n else {\n // Otherwise use Vega expression to parse\n dataSource.transform.push(...node.assembleTransforms());\n }\n }\n if (node instanceof FacetNode) {\n if (!dataSource.name) {\n dataSource.name = `data_${datasetIndex++}`;\n }\n if (!dataSource.source || dataSource.transform.length > 0) {\n data.push(dataSource);\n node.data = dataSource.name;\n }\n else {\n node.data = dataSource.source;\n }\n for (const d of node.assemble()) {\n data.push(d);\n }\n // break here because the rest of the tree has to be taken care of by the facet.\n return;\n }\n if (node instanceof GraticuleNode ||\n node instanceof SequenceNode ||\n node instanceof FilterInvalidNode ||\n node instanceof FilterNode ||\n node instanceof CalculateNode ||\n node instanceof GeoPointNode ||\n node instanceof GeoJSONNode ||\n node instanceof AggregateNode ||\n node instanceof LookupNode ||\n node instanceof WindowTransformNode ||\n node instanceof JoinAggregateTransformNode ||\n node instanceof FoldTransformNode ||\n node instanceof FlattenTransformNode ||\n node instanceof DensityTransformNode ||\n node instanceof LoessTransformNode ||\n node instanceof QuantileTransformNode ||\n node instanceof RegressionTransformNode ||\n node instanceof IdentifierNode ||\n node instanceof SampleTransformNode ||\n node instanceof PivotTransformNode) {\n dataSource.transform.push(node.assemble());\n }\n if (node instanceof BinNode ||\n node instanceof TimeUnitNode ||\n node instanceof ImputeNode ||\n node instanceof StackNode) {\n dataSource.transform.push(...node.assemble());\n }\n if (node instanceof OutputNode) {\n if (dataSource.source && dataSource.transform.length === 0) {\n node.setSource(dataSource.source);\n }\n else if (node.parent instanceof OutputNode) {\n // Note that an output node may be required but we still do not assemble a\n // separate data source for it.\n node.setSource(dataSource.name);\n }\n else {\n if (!dataSource.name) {\n dataSource.name = `data_${datasetIndex++}`;\n }\n // Here we set the name of the datasource we generated. From now on\n // other assemblers can use it.\n node.setSource(dataSource.name);\n // if this node has more than one child, we will add a datasource automatically\n if (node.numChildren() === 1) {\n data.push(dataSource);\n const newData = {\n name: null,\n source: dataSource.name,\n transform: []\n };\n dataSource = newData;\n }\n }\n }\n switch (node.numChildren()) {\n case 0:\n // done\n if (node instanceof OutputNode && (!dataSource.source || dataSource.transform.length > 0)) {\n // do not push empty datasources that are simply references\n data.push(dataSource);\n }\n break;\n case 1:\n walkTree(node.children[0], dataSource);\n break;\n default: {\n if (!dataSource.name) {\n dataSource.name = `data_${datasetIndex++}`;\n }\n let source = dataSource.name;\n if (!dataSource.source || dataSource.transform.length > 0) {\n data.push(dataSource);\n }\n else {\n source = dataSource.source;\n }\n for (const child of node.children) {\n const newData = {\n name: null,\n source: source,\n transform: []\n };\n walkTree(child, newData);\n }\n break;\n }\n }\n }\n return walkTree;\n}\n/**\n * Assemble data sources that are derived from faceted data.\n */\nexport function assembleFacetData(root) {\n const data = [];\n const walkTree = makeWalkTree(data);\n for (const child of root.children) {\n walkTree(child, {\n source: root.name,\n name: null,\n transform: []\n });\n }\n return data;\n}\n/**\n * Create Vega data array from a given compiled model and append all of them to the given array\n *\n * @param model\n * @param data array\n * @return modified data array\n */\nexport function assembleRootData(dataComponent, datasets) {\n var _a, _b;\n const data = [];\n // dataComponent.sources.forEach(debug);\n // draw(dataComponent.sources);\n const walkTree = makeWalkTree(data);\n let sourceIndex = 0;\n for (const root of dataComponent.sources) {\n // assign a name if the source does not have a name yet\n if (!root.hasName()) {\n root.dataName = `source_${sourceIndex++}`;\n }\n const newData = root.assemble();\n walkTree(root, newData);\n }\n // remove empty transform arrays for cleaner output\n for (const d of data) {\n if (d.transform.length === 0) {\n delete d.transform;\n }\n }\n // move sources without transforms (the ones that are potentially used in lookups) to the beginning\n let whereTo = 0;\n for (const [i, d] of data.entries()) {\n if (((_a = d.transform) !== null && _a !== void 0 ? _a : []).length === 0 && !d.source) {\n data.splice(whereTo++, 0, data.splice(i, 1)[0]);\n }\n }\n // now fix the from references in lookup transforms\n for (const d of data) {\n for (const t of (_b = d.transform) !== null && _b !== void 0 ? _b : []) {\n if (t.type === 'lookup') {\n t.from = dataComponent.outputNodes[t.from].getSource();\n }\n }\n }\n // inline values for datasets that are in the datastore\n for (const d of data) {\n if (d.name in datasets) {\n d.values = datasets[d.name];\n }\n }\n return data;\n}\n//# sourceMappingURL=assemble.js.map","import { isArray } from 'vega-util';\nimport { FACET_CHANNELS } from '../../channel';\nimport { title as fieldDefTitle } from '../../channeldef';\nimport { contains, getFirstDefined } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { assembleAxis } from '../axis/assemble';\nimport { parseGuideResolve } from '../resolve';\nimport { getHeaderProperty } from './common';\nexport function getHeaderType(orient) {\n if (orient === 'top' || orient === 'left' || isSignalRef(orient)) {\n // we always use header for orient signal since we can't dynamically make header becomes footer\n return 'header';\n }\n return 'footer';\n}\nexport function parseFacetHeaders(model) {\n for (const channel of FACET_CHANNELS) {\n parseFacetHeader(model, channel);\n }\n mergeChildAxis(model, 'x');\n mergeChildAxis(model, 'y');\n}\nfunction parseFacetHeader(model, channel) {\n var _a;\n const { facet, config, child, component } = model;\n if (model.channelHasField(channel)) {\n const fieldDef = facet[channel];\n const titleConfig = getHeaderProperty('title', null, config, channel);\n let title = fieldDefTitle(fieldDef, config, {\n allowDisabling: true,\n includeDefault: titleConfig === undefined || !!titleConfig\n });\n if (child.component.layoutHeaders[channel].title) {\n // TODO: better handle multiline titles\n title = isArray(title) ? title.join(', ') : title;\n // merge title with child to produce \"Title / Subtitle / Sub-subtitle\"\n title += ' / ' + child.component.layoutHeaders[channel].title;\n child.component.layoutHeaders[channel].title = null;\n }\n const labelOrient = getHeaderProperty('labelOrient', fieldDef, config, channel);\n const header = (_a = fieldDef.header) !== null && _a !== void 0 ? _a : {};\n const labels = getFirstDefined(header.labels, config.header.labels, true);\n const headerType = contains(['bottom', 'right'], labelOrient) ? 'footer' : 'header';\n component.layoutHeaders[channel] = {\n title,\n facetFieldDef: fieldDef,\n [headerType]: channel === 'facet' ? [] : [makeHeaderComponent(model, channel, labels)]\n };\n }\n}\nfunction makeHeaderComponent(model, channel, labels) {\n const sizeType = channel === 'row' ? 'height' : 'width';\n return {\n labels,\n sizeSignal: model.child.component.layoutSize.get(sizeType) ? model.child.getSizeSignalRef(sizeType) : undefined,\n axes: []\n };\n}\nfunction mergeChildAxis(model, channel) {\n var _a;\n const { child } = model;\n if (child.component.axes[channel]) {\n const { layoutHeaders, resolve } = model.component;\n resolve.axis[channel] = parseGuideResolve(resolve, channel);\n if (resolve.axis[channel] === 'shared') {\n // For shared axis, move the axes to facet's header or footer\n const headerChannel = channel === 'x' ? 'column' : 'row';\n const layoutHeader = layoutHeaders[headerChannel];\n for (const axisComponent of child.component.axes[channel]) {\n const headerType = getHeaderType(axisComponent.get('orient'));\n layoutHeader[headerType] = (_a = layoutHeader[headerType]) !== null && _a !== void 0 ? _a : [makeHeaderComponent(model, headerChannel, false)];\n // FIXME: assemble shouldn't be called here, but we do it this way so we only extract the main part of the axes\n const mainAxis = assembleAxis(axisComponent, 'main', model.config, { header: true });\n if (mainAxis) {\n // LayoutHeader no longer keep track of property precedence, thus let's combine.\n layoutHeader[headerType][0].axes.push(mainAxis);\n }\n axisComponent.mainExtracted = true;\n }\n }\n else {\n // Otherwise do nothing for independent axes\n }\n }\n}\n//# sourceMappingURL=parse.js.map","import { getPositionScaleChannel, getSizeChannel, POSITION_SCALE_CHANNELS } from '../../channel';\nimport { getViewConfigContinuousSize, getViewConfigDiscreteSize } from '../../config';\nimport { hasDiscreteDomain } from '../../scale';\nimport { isStep } from '../../spec/base';\nimport { isVgRangeStep } from '../../vega.schema';\nimport { mergeValuesWithExplicit } from '../split';\nimport { getSizeTypeFromLayoutSizeType } from './component';\nexport function parseLayerLayoutSize(model) {\n parseChildrenLayoutSize(model);\n parseNonUnitLayoutSizeForChannel(model, 'width');\n parseNonUnitLayoutSizeForChannel(model, 'height');\n}\nexport const parseRepeatLayoutSize = parseConcatLayoutSize;\nexport function parseConcatLayoutSize(model) {\n parseChildrenLayoutSize(model);\n // for columns === 1 (vconcat), we can completely merge width. Otherwise, we can treat merged width as childWidth.\n const widthType = model.layout.columns === 1 ? 'width' : 'childWidth';\n // for columns === undefined (hconcat), we can completely merge height. Otherwise, we can treat merged height as childHeight.\n const heightType = model.layout.columns === undefined ? 'height' : 'childHeight';\n parseNonUnitLayoutSizeForChannel(model, widthType);\n parseNonUnitLayoutSizeForChannel(model, heightType);\n}\nexport function parseChildrenLayoutSize(model) {\n for (const child of model.children) {\n child.parseLayoutSize();\n }\n}\n/**\n * Merge child layout size (width or height).\n */\nfunction parseNonUnitLayoutSizeForChannel(model, layoutSizeType) {\n /*\n * For concat, the parent width or height might not be the same as the children's shared height.\n * For example, hconcat's subviews may share width, but the shared width is not the hconcat view's width.\n *\n * layoutSizeType represents the output of the view (could be childWidth/childHeight/width/height)\n * while the sizeType represents the properties of the child.\n */\n const sizeType = getSizeTypeFromLayoutSizeType(layoutSizeType);\n const channel = getPositionScaleChannel(sizeType);\n const resolve = model.component.resolve;\n const layoutSizeCmpt = model.component.layoutSize;\n let mergedSize;\n // Try to merge layout size\n for (const child of model.children) {\n const childSize = child.component.layoutSize.getWithExplicit(sizeType);\n const scaleResolve = resolve.scale[channel];\n if (scaleResolve === 'independent' && childSize.value === 'step') {\n // Do not merge independent scales with range-step as their size depends\n // on the scale domains, which can be different between scales.\n mergedSize = undefined;\n break;\n }\n if (mergedSize) {\n if (scaleResolve === 'independent' && mergedSize.value !== childSize.value) {\n // For independent scale, only merge if all the sizes are the same.\n // If the values are different, abandon the merge!\n mergedSize = undefined;\n break;\n }\n mergedSize = mergeValuesWithExplicit(mergedSize, childSize, sizeType, '');\n }\n else {\n mergedSize = childSize;\n }\n }\n if (mergedSize) {\n // If merged, rename size and set size of all children.\n for (const child of model.children) {\n model.renameSignal(child.getName(sizeType), model.getName(layoutSizeType));\n child.component.layoutSize.set(sizeType, 'merged', false);\n }\n layoutSizeCmpt.setWithExplicit(layoutSizeType, mergedSize);\n }\n else {\n layoutSizeCmpt.setWithExplicit(layoutSizeType, {\n explicit: false,\n value: undefined\n });\n }\n}\nexport function parseUnitLayoutSize(model) {\n const { size, component } = model;\n for (const channel of POSITION_SCALE_CHANNELS) {\n const sizeType = getSizeChannel(channel);\n if (size[sizeType]) {\n const specifiedSize = size[sizeType];\n component.layoutSize.set(sizeType, isStep(specifiedSize) ? 'step' : specifiedSize, true);\n }\n else {\n const defaultSize = defaultUnitSize(model, sizeType);\n component.layoutSize.set(sizeType, defaultSize, false);\n }\n }\n}\nfunction defaultUnitSize(model, sizeType) {\n const channel = sizeType === 'width' ? 'x' : 'y';\n const config = model.config;\n const scaleComponent = model.getScaleComponent(channel);\n if (scaleComponent) {\n const scaleType = scaleComponent.get('type');\n const range = scaleComponent.get('range');\n if (hasDiscreteDomain(scaleType)) {\n const size = getViewConfigDiscreteSize(config.view, sizeType);\n if (isVgRangeStep(range) || isStep(size)) {\n // For discrete domain with range.step, use dynamic width/height\n return 'step';\n }\n else {\n return size;\n }\n }\n else {\n return getViewConfigContinuousSize(config.view, sizeType);\n }\n }\n else if (model.hasProjection || model.mark === 'arc') {\n // arc should use continuous size by default otherwise the pie is extremely small\n return getViewConfigContinuousSize(config.view, sizeType);\n }\n else {\n const size = getViewConfigDiscreteSize(config.view, sizeType);\n return isStep(size) ? size.step : size;\n }\n}\n//# sourceMappingURL=parse.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray } from 'vega-util';\nimport { isBinning } from '../bin';\nimport { COLUMN, FACET_CHANNELS, POSITION_SCALE_CHANNELS, ROW } from '../channel';\nimport { initFieldDef, vgField } from '../channeldef';\nimport { replaceExprRefInIndex } from '../expr';\nimport * as log from '../log';\nimport { hasDiscreteDomain } from '../scale';\nimport { DEFAULT_SORT_OP, isSortField } from '../sort';\nimport { isFacetMapping } from '../spec/facet';\nimport { contains, keys } from '../util';\nimport { isVgRangeStep } from '../vega.schema';\nimport { buildModel } from './buildmodel';\nimport { assembleFacetData } from './data/assemble';\nimport { sortArrayIndexField } from './data/calculate';\nimport { parseData } from './data/parse';\nimport { assembleLabelTitle } from './header/assemble';\nimport { getHeaderChannel, getHeaderProperty } from './header/common';\nimport { HEADER_CHANNELS, HEADER_TYPES } from './header/component';\nimport { parseFacetHeaders } from './header/parse';\nimport { parseChildrenLayoutSize } from './layoutsize/parse';\nimport { ModelWithField } from './model';\nimport { assembleDomain, getFieldFromDomain } from './scale/domain';\nimport { assembleFacetSignals } from './selection/assemble';\nexport function facetSortFieldName(fieldDef, sort, opt) {\n return vgField(sort, Object.assign({ suffix: `by_${vgField(fieldDef)}` }, (opt !== null && opt !== void 0 ? opt : {})));\n}\nexport class FacetModel extends ModelWithField {\n constructor(spec, parent, parentGivenName, config) {\n super(spec, 'facet', parent, parentGivenName, config, spec.resolve);\n this.child = buildModel(spec.spec, this, this.getName('child'), undefined, config);\n this.children = [this.child];\n this.facet = this.initFacet(spec.facet);\n }\n initFacet(facet) {\n // clone to prevent side effect to the original spec\n if (!isFacetMapping(facet)) {\n return { facet: this.initFacetFieldDef(facet, 'facet') };\n }\n const channels = keys(facet);\n const normalizedFacet = {};\n for (const channel of channels) {\n if (!contains([ROW, COLUMN], channel)) {\n // Drop unsupported channel\n log.warn(log.message.incompatibleChannel(channel, 'facet'));\n break;\n }\n const fieldDef = facet[channel];\n if (fieldDef.field === undefined) {\n log.warn(log.message.emptyFieldDef(fieldDef, channel));\n break;\n }\n normalizedFacet[channel] = this.initFacetFieldDef(fieldDef, channel);\n }\n return normalizedFacet;\n }\n initFacetFieldDef(fieldDef, channel) {\n const { header } = fieldDef, rest = __rest(fieldDef, [\"header\"]);\n // Cast because we call initFieldDef, which assumes general FieldDef.\n // However, FacetFieldDef is a bit more constrained than the general FieldDef\n const facetFieldDef = initFieldDef(rest, channel);\n if (header) {\n facetFieldDef.header = replaceExprRefInIndex(header);\n }\n return facetFieldDef;\n }\n channelHasField(channel) {\n return !!this.facet[channel];\n }\n fieldDef(channel) {\n return this.facet[channel];\n }\n parseData() {\n this.component.data = parseData(this);\n this.child.parseData();\n }\n parseLayoutSize() {\n parseChildrenLayoutSize(this);\n }\n parseSelections() {\n // As a facet has a single child, the selection components are the same.\n // The child maintains its selections to assemble signals, which remain\n // within its unit.\n this.child.parseSelections();\n this.component.selection = this.child.component.selection;\n }\n parseMarkGroup() {\n this.child.parseMarkGroup();\n }\n parseAxesAndHeaders() {\n this.child.parseAxesAndHeaders();\n parseFacetHeaders(this);\n }\n assembleSelectionTopLevelSignals(signals) {\n return this.child.assembleSelectionTopLevelSignals(signals);\n }\n assembleSignals() {\n this.child.assembleSignals();\n return [];\n }\n assembleSelectionData(data) {\n return this.child.assembleSelectionData(data);\n }\n getHeaderLayoutMixins() {\n var _a, _b, _c;\n const layoutMixins = {};\n for (const channel of FACET_CHANNELS) {\n for (const headerType of HEADER_TYPES) {\n const layoutHeaderComponent = this.component.layoutHeaders[channel];\n const headerComponent = layoutHeaderComponent[headerType];\n const { facetFieldDef } = layoutHeaderComponent;\n if (facetFieldDef) {\n const titleOrient = getHeaderProperty('titleOrient', facetFieldDef.header, this.config, channel);\n if (contains(['right', 'bottom'], titleOrient)) {\n const headerChannel = getHeaderChannel(channel, titleOrient);\n layoutMixins.titleAnchor = (_a = layoutMixins.titleAnchor) !== null && _a !== void 0 ? _a : {};\n layoutMixins.titleAnchor[headerChannel] = 'end';\n }\n }\n if (headerComponent === null || headerComponent === void 0 ? void 0 : headerComponent[0]) {\n // set header/footerBand\n const sizeType = channel === 'row' ? 'height' : 'width';\n const bandType = headerType === 'header' ? 'headerBand' : 'footerBand';\n if (channel !== 'facet' && !this.child.component.layoutSize.get(sizeType)) {\n // If facet child does not have size signal, then apply headerBand\n layoutMixins[bandType] = (_b = layoutMixins[bandType]) !== null && _b !== void 0 ? _b : {};\n layoutMixins[bandType][channel] = 0.5;\n }\n if (layoutHeaderComponent.title) {\n layoutMixins.offset = (_c = layoutMixins.offset) !== null && _c !== void 0 ? _c : {};\n layoutMixins.offset[channel === 'row' ? 'rowTitle' : 'columnTitle'] = 10;\n }\n }\n }\n }\n return layoutMixins;\n }\n assembleDefaultLayout() {\n const { column, row } = this.facet;\n const columns = column ? this.columnDistinctSignal() : row ? 1 : undefined;\n let align = 'all';\n // Do not align the cells if the scale corresponding to the direction is indepent.\n // We always align when we facet into both row and column.\n if (!row && this.component.resolve.scale.x === 'independent') {\n align = 'none';\n }\n else if (!column && this.component.resolve.scale.y === 'independent') {\n align = 'none';\n }\n return Object.assign(Object.assign(Object.assign({}, this.getHeaderLayoutMixins()), (columns ? { columns } : {})), { bounds: 'full', align });\n }\n assembleLayoutSignals() {\n // FIXME(https://github.com/vega/vega-lite/issues/1193): this can be incorrect if we have independent scales.\n return this.child.assembleLayoutSignals();\n }\n columnDistinctSignal() {\n if (this.parent && this.parent instanceof FacetModel) {\n // For nested facet, we will add columns to group mark instead\n // See discussion in https://github.com/vega/vega/issues/952\n // and https://github.com/vega/vega-view/releases/tag/v1.2.6\n return undefined;\n }\n else {\n // In facetNode.assemble(), the name is always this.getName('column') + '_layout'.\n const facetLayoutDataName = this.getName('column_domain');\n return { signal: `length(data('${facetLayoutDataName}'))` };\n }\n }\n assembleGroup(signals) {\n if (this.parent && this.parent instanceof FacetModel) {\n // Provide number of columns for layout.\n // See discussion in https://github.com/vega/vega/issues/952\n // and https://github.com/vega/vega-view/releases/tag/v1.2.6\n return Object.assign(Object.assign({}, (this.channelHasField('column')\n ? {\n encode: {\n update: {\n // TODO(https://github.com/vega/vega-lite/issues/2759):\n // Correct the signal for facet of concat of facet_column\n columns: { field: vgField(this.facet.column, { prefix: 'distinct' }) }\n }\n }\n }\n : {})), super.assembleGroup(signals));\n }\n return super.assembleGroup(signals);\n }\n /**\n * Aggregate cardinality for calculating size\n */\n getCardinalityAggregateForChild() {\n const fields = [];\n const ops = [];\n const as = [];\n if (this.child instanceof FacetModel) {\n if (this.child.channelHasField('column')) {\n const field = vgField(this.child.facet.column);\n fields.push(field);\n ops.push('distinct');\n as.push(`distinct_${field}`);\n }\n }\n else {\n for (const channel of POSITION_SCALE_CHANNELS) {\n const childScaleComponent = this.child.component.scales[channel];\n if (childScaleComponent && !childScaleComponent.merged) {\n const type = childScaleComponent.get('type');\n const range = childScaleComponent.get('range');\n if (hasDiscreteDomain(type) && isVgRangeStep(range)) {\n const domain = assembleDomain(this.child, channel);\n const field = getFieldFromDomain(domain);\n if (field) {\n fields.push(field);\n ops.push('distinct');\n as.push(`distinct_${field}`);\n }\n else {\n log.warn(log.message.unknownField(channel));\n }\n }\n }\n }\n }\n return { fields, ops, as };\n }\n assembleFacet() {\n const { name, data } = this.component.data.facetRoot;\n const { row, column } = this.facet;\n const { fields, ops, as } = this.getCardinalityAggregateForChild();\n const groupby = [];\n for (const channel of FACET_CHANNELS) {\n const fieldDef = this.facet[channel];\n if (fieldDef) {\n groupby.push(vgField(fieldDef));\n const { bin, sort } = fieldDef;\n if (isBinning(bin)) {\n groupby.push(vgField(fieldDef, { binSuffix: 'end' }));\n }\n if (isSortField(sort)) {\n const { field, op = DEFAULT_SORT_OP } = sort;\n const outputName = facetSortFieldName(fieldDef, sort);\n if (row && column) {\n // For crossed facet, use pre-calculate field as it requires a different groupby\n // For each calculated field, apply max and assign them to the same name as\n // all values of the same group should be the same anyway.\n fields.push(outputName);\n ops.push('max');\n as.push(outputName);\n }\n else {\n fields.push(field);\n ops.push(op);\n as.push(outputName);\n }\n }\n else if (isArray(sort)) {\n const outputName = sortArrayIndexField(fieldDef, channel);\n fields.push(outputName);\n ops.push('max');\n as.push(outputName);\n }\n }\n }\n const cross = !!row && !!column;\n return Object.assign({ name,\n data,\n groupby }, (cross || fields.length > 0\n ? {\n aggregate: Object.assign(Object.assign({}, (cross ? { cross } : {})), (fields.length ? { fields, ops, as } : {}))\n }\n : {}));\n }\n facetSortFields(channel) {\n const { facet } = this;\n const fieldDef = facet[channel];\n if (fieldDef) {\n if (isSortField(fieldDef.sort)) {\n return [facetSortFieldName(fieldDef, fieldDef.sort, { expr: 'datum' })];\n }\n else if (isArray(fieldDef.sort)) {\n return [sortArrayIndexField(fieldDef, channel, { expr: 'datum' })];\n }\n return [vgField(fieldDef, { expr: 'datum' })];\n }\n return [];\n }\n facetSortOrder(channel) {\n const { facet } = this;\n const fieldDef = facet[channel];\n if (fieldDef) {\n const { sort } = fieldDef;\n const order = (isSortField(sort) ? sort.order : !isArray(sort) && sort) || 'ascending';\n return [order];\n }\n return [];\n }\n assembleLabelTitle() {\n var _a;\n const { facet, config } = this;\n if (facet.facet) {\n // Facet always uses title to display labels\n return assembleLabelTitle(facet.facet, 'facet', config);\n }\n const ORTHOGONAL_ORIENT = {\n row: ['top', 'bottom'],\n column: ['left', 'right']\n };\n for (const channel of HEADER_CHANNELS) {\n if (facet[channel]) {\n const labelOrient = getHeaderProperty('labelOrient', (_a = facet[channel]) === null || _a === void 0 ? void 0 : _a.header, config, channel);\n if (contains(ORTHOGONAL_ORIENT[channel], labelOrient)) {\n // Row/Column with orthogonal labelOrient must use title to display labels\n return assembleLabelTitle(facet[channel], channel, config);\n }\n }\n }\n return undefined;\n }\n assembleMarks() {\n const { child } = this;\n // If we facet by two dimensions, we need to add a cross operator to the aggregation\n // so that we create all groups\n const facetRoot = this.component.data.facetRoot;\n const data = assembleFacetData(facetRoot);\n const encodeEntry = child.assembleGroupEncodeEntry(false);\n const title = this.assembleLabelTitle() || child.assembleTitle();\n const style = child.assembleGroupStyle();\n const markGroup = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ name: this.getName('cell'), type: 'group' }, (title ? { title } : {})), (style ? { style } : {})), { from: {\n facet: this.assembleFacet()\n }, \n // TODO: move this to after data\n sort: {\n field: FACET_CHANNELS.map(c => this.facetSortFields(c)).flat(),\n order: FACET_CHANNELS.map(c => this.facetSortOrder(c)).flat()\n } }), (data.length > 0 ? { data: data } : {})), (encodeEntry ? { encode: { update: encodeEntry } } : {})), child.assembleGroup(assembleFacetSignals(this, [])));\n return [markGroup];\n }\n getMapping() {\n return this.facet;\n }\n}\n//# sourceMappingURL=facet.js.map","import { AncestorParse } from '.';\nimport { isGenerator, isGraticuleGenerator, isInlineData, isNamedData, isSequenceGenerator, isUrlData, DataSourceType } from '../../data';\nimport * as log from '../../log';\nimport { isAggregate, isBin, isCalculate, isDensity, isFilter, isFlatten, isFold, isImpute, isJoinAggregate, isLoess, isLookup, isPivot, isQuantile, isRegression, isSample, isStack, isTimeUnit, isWindow } from '../../transform';\nimport { deepEqual, mergeDeep } from '../../util';\nimport { isFacetModel, isLayerModel, isUnitModel } from '../model';\nimport { requiresSelectionId } from '../selection';\nimport { materializeSelections } from '../selection/parse';\nimport { AggregateNode } from './aggregate';\nimport { BinNode } from './bin';\nimport { CalculateNode } from './calculate';\nimport { OutputNode } from './dataflow';\nimport { DensityTransformNode } from './density';\nimport { FacetNode } from './facet';\nimport { FilterNode } from './filter';\nimport { FilterInvalidNode } from './filterinvalid';\nimport { FlattenTransformNode } from './flatten';\nimport { FoldTransformNode } from './fold';\nimport { getImplicitFromEncoding, getImplicitFromFilterTransform, getImplicitFromSelection, ParseNode } from './formatparse';\nimport { GeoJSONNode } from './geojson';\nimport { GeoPointNode } from './geopoint';\nimport { GraticuleNode } from './graticule';\nimport { IdentifierNode } from './identifier';\nimport { ImputeNode } from './impute';\nimport { JoinAggregateTransformNode } from './joinaggregate';\nimport { makeJoinAggregateFromFacet } from './joinaggregatefacet';\nimport { LoessTransformNode } from './loess';\nimport { LookupNode } from './lookup';\nimport { PivotTransformNode } from './pivot';\nimport { QuantileTransformNode } from './quantile';\nimport { RegressionTransformNode } from './regression';\nimport { SampleTransformNode } from './sample';\nimport { SequenceNode } from './sequence';\nimport { SourceNode } from './source';\nimport { StackNode } from './stack';\nimport { TimeUnitNode } from './timeunit';\nimport { WindowTransformNode } from './window';\nexport function findSource(data, sources) {\n var _a, _b, _c, _d;\n for (const other of sources) {\n const otherData = other.data;\n // if both datasets have a name defined, we cannot merge\n if (data.name && other.hasName() && data.name !== other.dataName) {\n continue;\n }\n const formatMesh = (_a = data['format']) === null || _a === void 0 ? void 0 : _a.mesh;\n const otherFeature = (_b = otherData.format) === null || _b === void 0 ? void 0 : _b.feature;\n // feature and mesh are mutually exclusive\n if (formatMesh && otherFeature) {\n continue;\n }\n // we have to extract the same feature or mesh\n const formatFeature = (_c = data['format']) === null || _c === void 0 ? void 0 : _c.feature;\n if ((formatFeature || otherFeature) && formatFeature !== otherFeature) {\n continue;\n }\n const otherMesh = (_d = otherData.format) === null || _d === void 0 ? void 0 : _d.mesh;\n if ((formatMesh || otherMesh) && formatMesh !== otherMesh) {\n continue;\n }\n if (isInlineData(data) && isInlineData(otherData)) {\n if (deepEqual(data.values, otherData.values)) {\n return other;\n }\n }\n else if (isUrlData(data) && isUrlData(otherData)) {\n if (data.url === otherData.url) {\n return other;\n }\n }\n else if (isNamedData(data)) {\n if (data.name === other.dataName) {\n return other;\n }\n }\n }\n return null;\n}\nfunction parseRoot(model, sources) {\n if (model.data || !model.parent) {\n // if the model defines a data source or is the root, create a source node\n if (model.data === null) {\n // data: null means we should ignore the parent's data so we just create a new data source\n const source = new SourceNode({ values: [] });\n sources.push(source);\n return source;\n }\n const existingSource = findSource(model.data, sources);\n if (existingSource) {\n if (!isGenerator(model.data)) {\n existingSource.data.format = mergeDeep({}, model.data.format, existingSource.data.format);\n }\n // if the new source has a name but the existing one does not, we can set it\n if (!existingSource.hasName() && model.data.name) {\n existingSource.dataName = model.data.name;\n }\n return existingSource;\n }\n else {\n const source = new SourceNode(model.data);\n sources.push(source);\n return source;\n }\n }\n else {\n // If we don't have a source defined (overriding parent's data), use the parent's facet root or main.\n return model.parent.component.data.facetRoot\n ? model.parent.component.data.facetRoot\n : model.parent.component.data.main;\n }\n}\n/**\n * Parses a transform array into a chain of connected dataflow nodes.\n */\nexport function parseTransformArray(head, model, ancestorParse) {\n var _a, _b;\n let lookupCounter = 0;\n for (const t of model.transforms) {\n let derivedType = undefined;\n let transformNode;\n if (isCalculate(t)) {\n transformNode = head = new CalculateNode(head, t);\n derivedType = 'derived';\n }\n else if (isFilter(t)) {\n const implicit = getImplicitFromFilterTransform(t);\n transformNode = head = (_a = ParseNode.makeWithAncestors(head, {}, implicit, ancestorParse)) !== null && _a !== void 0 ? _a : head;\n head = new FilterNode(head, model, t.filter);\n }\n else if (isBin(t)) {\n transformNode = head = BinNode.makeFromTransform(head, t, model);\n derivedType = 'number';\n }\n else if (isTimeUnit(t)) {\n derivedType = 'date';\n const parsedAs = ancestorParse.getWithExplicit(t.field);\n // Create parse node because the input to time unit is always date.\n if (parsedAs.value === undefined) {\n head = new ParseNode(head, { [t.field]: derivedType });\n ancestorParse.set(t.field, derivedType, false);\n }\n transformNode = head = TimeUnitNode.makeFromTransform(head, t);\n }\n else if (isAggregate(t)) {\n transformNode = head = AggregateNode.makeFromTransform(head, t);\n derivedType = 'number';\n if (requiresSelectionId(model)) {\n head = new IdentifierNode(head);\n }\n }\n else if (isLookup(t)) {\n transformNode = head = LookupNode.make(head, model, t, lookupCounter++);\n derivedType = 'derived';\n }\n else if (isWindow(t)) {\n transformNode = head = new WindowTransformNode(head, t);\n derivedType = 'number';\n }\n else if (isJoinAggregate(t)) {\n transformNode = head = new JoinAggregateTransformNode(head, t);\n derivedType = 'number';\n }\n else if (isStack(t)) {\n transformNode = head = StackNode.makeFromTransform(head, t);\n derivedType = 'derived';\n }\n else if (isFold(t)) {\n transformNode = head = new FoldTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isFlatten(t)) {\n transformNode = head = new FlattenTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isPivot(t)) {\n transformNode = head = new PivotTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isSample(t)) {\n head = new SampleTransformNode(head, t);\n }\n else if (isImpute(t)) {\n transformNode = head = ImputeNode.makeFromTransform(head, t);\n derivedType = 'derived';\n }\n else if (isDensity(t)) {\n transformNode = head = new DensityTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isQuantile(t)) {\n transformNode = head = new QuantileTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isRegression(t)) {\n transformNode = head = new RegressionTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isLoess(t)) {\n transformNode = head = new LoessTransformNode(head, t);\n derivedType = 'derived';\n }\n else {\n log.warn(log.message.invalidTransformIgnored(t));\n continue;\n }\n if (transformNode && derivedType !== undefined) {\n for (const field of (_b = transformNode.producedFields()) !== null && _b !== void 0 ? _b : []) {\n ancestorParse.set(field, derivedType, false);\n }\n }\n }\n return head;\n}\n/*\nDescription of the dataflow (http://asciiflow.com/):\n +--------+\n | Source |\n +---+----+\n |\n v\n FormatParse\n (explicit)\n |\n v\n Transforms\n(Filter, Calculate, Binning, TimeUnit, Aggregate, Window, ...)\n |\n v\n FormatParse\n (implicit)\n |\n v\n Binning (in `encoding`)\n |\n v\n Timeunit (in `encoding`)\n |\n v\nFormula From Sort Array\n |\n v\n +--+--+\n | Raw |\n +-----+\n |\n v\n Aggregate (in `encoding`)\n |\n v\n Stack (in `encoding`)\n |\n v\n Invalid Filter\n |\n v\n +----------+\n | Main |\n +----------+\n |\n v\n +-------+\n | Facet |----> \"column\", \"column-layout\", and \"row\"\n +-------+\n |\n v\n ...Child data...\n*/\nexport function parseData(model) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n let head = parseRoot(model, model.component.data.sources);\n const { outputNodes, outputNodeRefCounts } = model.component.data;\n const ancestorParse = model.parent ? model.parent.component.data.ancestorParse.clone() : new AncestorParse();\n const data = model.data;\n if (isGenerator(data)) {\n // insert generator transform\n if (isSequenceGenerator(data)) {\n head = new SequenceNode(head, data.sequence);\n }\n else if (isGraticuleGenerator(data)) {\n head = new GraticuleNode(head, data.graticule);\n }\n // no parsing necessary for generator\n ancestorParse.parseNothing = true;\n }\n else if (((_a = data === null || data === void 0 ? void 0 : data.format) === null || _a === void 0 ? void 0 : _a.parse) === null) {\n // format.parse: null means disable parsing\n ancestorParse.parseNothing = true;\n }\n head = (_b = ParseNode.makeExplicit(head, model, ancestorParse)) !== null && _b !== void 0 ? _b : head;\n // Default discrete selections require an identifer transform to\n // uniquely identify data points. Add this transform at the head of\n // the pipeline such that the identifier field is available for all\n // subsequent datasets. During optimization, we will remove this\n // transform if it proves to be unnecessary. Additional identifier\n // transforms will be necessary when new tuples are constructed\n // (e.g., post-aggregation).\n head = new IdentifierNode(head);\n // HACK: This is equivalent for merging bin extent for union scale.\n // FIXME(https://github.com/vega/vega-lite/issues/2270): Correctly merge extent / bin node for shared bin scale\n const parentIsLayer = model.parent && isLayerModel(model.parent);\n if (isUnitModel(model) || isFacetModel(model)) {\n if (parentIsLayer) {\n head = (_c = BinNode.makeFromEncoding(head, model)) !== null && _c !== void 0 ? _c : head;\n }\n }\n if (model.transforms.length > 0) {\n head = parseTransformArray(head, model, ancestorParse);\n }\n // create parse nodes for fields that need to be parsed (or flattened) implicitly\n const implicitSelection = getImplicitFromSelection(model);\n const implicitEncoding = getImplicitFromEncoding(model);\n head = (_d = ParseNode.makeWithAncestors(head, {}, Object.assign(Object.assign({}, implicitSelection), implicitEncoding), ancestorParse)) !== null && _d !== void 0 ? _d : head;\n if (isUnitModel(model)) {\n head = GeoJSONNode.parseAll(head, model);\n head = GeoPointNode.parseAll(head, model);\n }\n if (isUnitModel(model) || isFacetModel(model)) {\n if (!parentIsLayer) {\n head = (_e = BinNode.makeFromEncoding(head, model)) !== null && _e !== void 0 ? _e : head;\n }\n head = (_f = TimeUnitNode.makeFromEncoding(head, model)) !== null && _f !== void 0 ? _f : head;\n head = CalculateNode.parseAllForSortIndex(head, model);\n }\n // add an output node pre aggregation\n const rawName = model.getDataName(DataSourceType.Raw);\n const raw = new OutputNode(head, rawName, DataSourceType.Raw, outputNodeRefCounts);\n outputNodes[rawName] = raw;\n head = raw;\n if (isUnitModel(model)) {\n const agg = AggregateNode.makeFromEncoding(head, model);\n if (agg) {\n head = agg;\n if (requiresSelectionId(model)) {\n head = new IdentifierNode(head);\n }\n }\n head = (_g = ImputeNode.makeFromEncoding(head, model)) !== null && _g !== void 0 ? _g : head;\n head = (_h = StackNode.makeFromEncoding(head, model)) !== null && _h !== void 0 ? _h : head;\n }\n if (isUnitModel(model)) {\n head = (_j = FilterInvalidNode.make(head, model)) !== null && _j !== void 0 ? _j : head;\n }\n // output node for marks\n const mainName = model.getDataName(DataSourceType.Main);\n const main = new OutputNode(head, mainName, DataSourceType.Main, outputNodeRefCounts);\n outputNodes[mainName] = main;\n head = main;\n if (isUnitModel(model)) {\n materializeSelections(model, main);\n }\n // add facet marker\n let facetRoot = null;\n if (isFacetModel(model)) {\n const facetName = model.getName('facet');\n // Derive new aggregate for facet's sort field\n // augment data source with new fields for crossed facet\n head = (_k = makeJoinAggregateFromFacet(head, model.facet)) !== null && _k !== void 0 ? _k : head;\n facetRoot = new FacetNode(head, model, facetName, main.getSource());\n outputNodes[facetName] = facetRoot;\n }\n return Object.assign(Object.assign({}, model.component.data), { outputNodes,\n outputNodeRefCounts,\n raw,\n main,\n facetRoot,\n ancestorParse });\n}\n//# sourceMappingURL=parse.js.map","import { vgField } from '../../channeldef';\nimport { DEFAULT_SORT_OP, isSortField } from '../../sort';\nimport { facetSortFieldName } from '../facet';\nimport { JoinAggregateTransformNode } from './joinaggregate';\nexport function makeJoinAggregateFromFacet(parent, facet) {\n const { row, column } = facet;\n if (row && column) {\n let newParent = null;\n // only need to make one for crossed facet\n for (const fieldDef of [row, column]) {\n if (isSortField(fieldDef.sort)) {\n const { field, op = DEFAULT_SORT_OP } = fieldDef.sort;\n parent = newParent = new JoinAggregateTransformNode(parent, {\n joinaggregate: [\n {\n op,\n field,\n as: facetSortFieldName(fieldDef, fieldDef.sort, { forAs: true })\n }\n ],\n groupby: [vgField(fieldDef)]\n });\n }\n }\n return newParent;\n }\n return null;\n}\n//# sourceMappingURL=joinaggregatefacet.js.map","import * as log from '../log';\nimport { isHConcatSpec, isVConcatSpec } from '../spec';\nimport { keys } from '../util';\nimport { buildModel } from './buildmodel';\nimport { parseData } from './data/parse';\nimport { assembleLayoutSignals } from './layoutsize/assemble';\nimport { parseConcatLayoutSize } from './layoutsize/parse';\nimport { Model } from './model';\nexport class ConcatModel extends Model {\n constructor(spec, parent, parentGivenName, config) {\n var _a, _b, _c, _d;\n super(spec, 'concat', parent, parentGivenName, config, spec.resolve);\n if (((_b = (_a = spec.resolve) === null || _a === void 0 ? void 0 : _a.axis) === null || _b === void 0 ? void 0 : _b.x) === 'shared' || ((_d = (_c = spec.resolve) === null || _c === void 0 ? void 0 : _c.axis) === null || _d === void 0 ? void 0 : _d.y) === 'shared') {\n log.warn(log.message.CONCAT_CANNOT_SHARE_AXIS);\n }\n this.children = this.getChildren(spec).map((child, i) => {\n return buildModel(child, this, this.getName('concat_' + i), undefined, config);\n });\n }\n parseData() {\n this.component.data = parseData(this);\n for (const child of this.children) {\n child.parseData();\n }\n }\n parseSelections() {\n // Merge selections up the hierarchy so that they may be referenced\n // across unit specs. Persist their definitions within each child\n // to assemble signals which remain within output Vega unit groups.\n this.component.selection = {};\n for (const child of this.children) {\n child.parseSelections();\n for (const key of keys(child.component.selection)) {\n this.component.selection[key] = child.component.selection[key];\n }\n }\n }\n parseMarkGroup() {\n for (const child of this.children) {\n child.parseMarkGroup();\n }\n }\n parseAxesAndHeaders() {\n for (const child of this.children) {\n child.parseAxesAndHeaders();\n }\n // TODO(#2415): support shared axes\n }\n getChildren(spec) {\n if (isVConcatSpec(spec)) {\n return spec.vconcat;\n }\n else if (isHConcatSpec(spec)) {\n return spec.hconcat;\n }\n return spec.concat;\n }\n parseLayoutSize() {\n parseConcatLayoutSize(this);\n }\n parseAxisGroup() {\n return null;\n }\n assembleSelectionTopLevelSignals(signals) {\n return this.children.reduce((sg, child) => child.assembleSelectionTopLevelSignals(sg), signals);\n }\n assembleSignals() {\n this.children.forEach(child => child.assembleSignals());\n return [];\n }\n assembleLayoutSignals() {\n const layoutSignals = assembleLayoutSignals(this);\n for (const child of this.children) {\n layoutSignals.push(...child.assembleLayoutSignals());\n }\n return layoutSignals;\n }\n assembleSelectionData(data) {\n return this.children.reduce((db, child) => child.assembleSelectionData(db), data);\n }\n assembleMarks() {\n // only children have marks\n return this.children.map(child => {\n const title = child.assembleTitle();\n const style = child.assembleGroupStyle();\n const encodeEntry = child.assembleGroupEncodeEntry(false);\n return Object.assign(Object.assign(Object.assign(Object.assign({ type: 'group', name: child.getName('group') }, (title ? { title } : {})), (style ? { style } : {})), (encodeEntry ? { encode: { update: encodeEntry } } : {})), child.assembleGroup());\n });\n }\n assembleDefaultLayout() {\n const columns = this.layout.columns;\n return Object.assign(Object.assign({}, (columns != null ? { columns: columns } : {})), { bounds: 'full', \n // Use align each so it can work with multiple plots with different size\n align: 'each' });\n }\n}\n//# sourceMappingURL=concat.js.map","import { COMMON_AXIS_PROPERTIES_INDEX } from '../../axis';\nimport { duplicate, keys } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { Split } from '../split';\nfunction isFalseOrNull(v) {\n return v === false || v === null;\n}\nconst AXIS_COMPONENT_PROPERTIES_INDEX = Object.assign(Object.assign({ disable: 1, gridScale: 1, scale: 1 }, COMMON_AXIS_PROPERTIES_INDEX), { labelExpr: 1, encode: 1 });\nexport const AXIS_COMPONENT_PROPERTIES = keys(AXIS_COMPONENT_PROPERTIES_INDEX);\nexport class AxisComponent extends Split {\n constructor(explicit = {}, implicit = {}, mainExtracted = false) {\n super();\n this.explicit = explicit;\n this.implicit = implicit;\n this.mainExtracted = mainExtracted;\n }\n clone() {\n return new AxisComponent(duplicate(this.explicit), duplicate(this.implicit), this.mainExtracted);\n }\n hasAxisPart(part) {\n // FIXME(https://github.com/vega/vega-lite/issues/2552) this method can be wrong if users use a Vega theme.\n if (part === 'axis') {\n // always has the axis container part\n return true;\n }\n if (part === 'grid' || part === 'title') {\n return !!this.get(part);\n }\n // Other parts are enabled by default, so they should not be false or null.\n return !isFalseOrNull(this.get(part));\n }\n hasOrientSignalRef() {\n return isSignalRef(this.explicit.orient);\n }\n}\n//# sourceMappingURL=component.js.map","import { AXIS_PARTS, isAxisProperty, isConditionalAxisValue } from '../../axis';\nimport { POSITION_SCALE_CHANNELS } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { getFirstDefined, isEmpty, keys, normalizeAngle } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { mergeTitleComponent } from '../common';\nimport { guideEncodeEntry } from '../guide';\nimport { parseGuideResolve } from '../resolve';\nimport { defaultTieBreaker, mergeValuesWithExplicit } from '../split';\nimport { AxisComponent, AXIS_COMPONENT_PROPERTIES } from './component';\nimport { getAxisConfig, getAxisConfigs } from './config';\nimport * as encode from './encode';\nimport { axisRules, defaultOrient, getFieldDefTitle, getLabelAngle } from './properties';\nexport function parseUnitAxes(model) {\n return POSITION_SCALE_CHANNELS.reduce((axis, channel) => {\n if (model.component.scales[channel]) {\n axis[channel] = [parseAxis(channel, model)];\n }\n return axis;\n }, {});\n}\nconst OPPOSITE_ORIENT = {\n bottom: 'top',\n top: 'bottom',\n left: 'right',\n right: 'left'\n};\nexport function parseLayerAxes(model) {\n var _a;\n const { axes, resolve } = model.component;\n const axisCount = { top: 0, bottom: 0, right: 0, left: 0 };\n for (const child of model.children) {\n child.parseAxesAndHeaders();\n for (const channel of keys(child.component.axes)) {\n resolve.axis[channel] = parseGuideResolve(model.component.resolve, channel);\n if (resolve.axis[channel] === 'shared') {\n // If the resolve says shared (and has not been overridden)\n // We will try to merge and see if there is a conflict\n axes[channel] = mergeAxisComponents(axes[channel], child.component.axes[channel]);\n if (!axes[channel]) {\n // If merge returns nothing, there is a conflict so we cannot make the axis shared.\n // Thus, mark axis as independent and remove the axis component.\n resolve.axis[channel] = 'independent';\n delete axes[channel];\n }\n }\n }\n }\n // Move axes to layer's axis component and merge shared axes\n for (const channel of POSITION_SCALE_CHANNELS) {\n for (const child of model.children) {\n if (!child.component.axes[channel]) {\n // skip if the child does not have a particular axis\n continue;\n }\n if (resolve.axis[channel] === 'independent') {\n // If axes are independent, concat the axisComponent array.\n axes[channel] = ((_a = axes[channel]) !== null && _a !== void 0 ? _a : []).concat(child.component.axes[channel]);\n // Automatically adjust orient\n for (const axisComponent of child.component.axes[channel]) {\n const { value: orient, explicit } = axisComponent.getWithExplicit('orient');\n if (isSignalRef(orient)) {\n continue;\n }\n if (axisCount[orient] > 0 && !explicit) {\n // Change axis orient if the number do not match\n const oppositeOrient = OPPOSITE_ORIENT[orient];\n if (axisCount[orient] > axisCount[oppositeOrient]) {\n axisComponent.set('orient', oppositeOrient, false);\n }\n }\n axisCount[orient]++;\n // TODO(https://github.com/vega/vega-lite/issues/2634): automatically add extra offset?\n }\n }\n // After merging, make sure to remove axes from child\n delete child.component.axes[channel];\n }\n // Suppress grid lines for dual axis charts (https://github.com/vega/vega-lite/issues/4676)\n if (resolve.axis[channel] === 'independent' && axes[channel] && axes[channel].length > 1) {\n for (const axisCmpt of axes[channel]) {\n if (!!axisCmpt.get('grid') && !axisCmpt.explicit.grid) {\n axisCmpt.implicit.grid = false;\n }\n }\n }\n }\n}\nfunction mergeAxisComponents(mergedAxisCmpts, childAxisCmpts) {\n if (mergedAxisCmpts) {\n // FIXME: this is a bit wrong once we support multiple axes\n if (mergedAxisCmpts.length !== childAxisCmpts.length) {\n return undefined; // Cannot merge axis component with different number of axes.\n }\n const length = mergedAxisCmpts.length;\n for (let i = 0; i < length; i++) {\n const merged = mergedAxisCmpts[i];\n const child = childAxisCmpts[i];\n if (!!merged !== !!child) {\n return undefined;\n }\n else if (merged && child) {\n const mergedOrient = merged.getWithExplicit('orient');\n const childOrient = child.getWithExplicit('orient');\n if (mergedOrient.explicit && childOrient.explicit && mergedOrient.value !== childOrient.value) {\n // TODO: throw warning if resolve is explicit (We don't have info about explicit/implicit resolve yet.)\n // Cannot merge due to inconsistent orient\n return undefined;\n }\n else {\n mergedAxisCmpts[i] = mergeAxisComponent(merged, child);\n }\n }\n }\n }\n else {\n // For first one, return a copy of the child\n return childAxisCmpts.map(axisComponent => axisComponent.clone());\n }\n return mergedAxisCmpts;\n}\nfunction mergeAxisComponent(merged, child) {\n for (const prop of AXIS_COMPONENT_PROPERTIES) {\n const mergedValueWithExplicit = mergeValuesWithExplicit(merged.getWithExplicit(prop), child.getWithExplicit(prop), prop, 'axis', \n // Tie breaker function\n (v1, v2) => {\n switch (prop) {\n case 'title':\n return mergeTitleComponent(v1, v2);\n case 'gridScale':\n return {\n explicit: v1.explicit,\n value: getFirstDefined(v1.value, v2.value)\n };\n }\n return defaultTieBreaker(v1, v2, prop, 'axis');\n });\n merged.setWithExplicit(prop, mergedValueWithExplicit);\n }\n return merged;\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isExplicit(value, property, axis, model, channel) {\n if (property === 'disable') {\n return axis !== undefined; // if axis is specified or null/false, then it's enable/disable state is explicit\n }\n axis = axis || {};\n switch (property) {\n case 'titleAngle':\n case 'labelAngle':\n return value === (isSignalRef(axis.labelAngle) ? axis.labelAngle : normalizeAngle(axis.labelAngle));\n case 'values':\n return !!axis.values;\n // specified axis.values is already respected, but may get transformed.\n case 'encode':\n // both VL axis.encoding and axis.labelAngle affect VG axis.encode\n return !!axis.encoding || !!axis.labelAngle;\n case 'title':\n // title can be explicit if fieldDef.title is set\n if (value === getFieldDefTitle(model, channel)) {\n return true;\n }\n }\n // Otherwise, things are explicit if the returned value matches the specified property\n return value === axis[property];\n}\n/**\n * Properties to always include values from config\n */\nconst propsToAlwaysIncludeConfig = new Set([\n 'grid',\n 'translate',\n // the rest are not axis configs in Vega, but are in VL, so we need to set too.\n 'format',\n 'formatType',\n 'orient',\n 'labelExpr',\n 'tickCount',\n 'position',\n 'tickMinStep'\n]);\nfunction parseAxis(channel, model) {\n var _a, _b, _c;\n let axis = model.axis(channel);\n const axisComponent = new AxisComponent();\n const fieldOrDatumDef = getFieldOrDatumDef(model.encoding[channel]);\n const { mark, config } = model;\n const orient = (axis === null || axis === void 0 ? void 0 : axis.orient) || ((_a = config[channel === 'x' ? 'axisX' : 'axisY']) === null || _a === void 0 ? void 0 : _a.orient) || ((_b = config.axis) === null || _b === void 0 ? void 0 : _b.orient) ||\n defaultOrient(channel);\n const scaleType = model.getScaleComponent(channel).get('type');\n const axisConfigs = getAxisConfigs(channel, scaleType, orient, model.config);\n const disable = axis !== undefined ? !axis : getAxisConfig('disable', config.style, axis === null || axis === void 0 ? void 0 : axis.style, axisConfigs).configValue;\n axisComponent.set('disable', disable, axis !== undefined);\n if (disable) {\n return axisComponent;\n }\n axis = axis || {};\n const labelAngle = getLabelAngle(fieldOrDatumDef, axis, channel, config.style, axisConfigs);\n const ruleParams = {\n fieldOrDatumDef,\n axis,\n channel,\n model,\n scaleType,\n orient,\n labelAngle,\n mark,\n config\n };\n // 1.2. Add properties\n for (const property of AXIS_COMPONENT_PROPERTIES) {\n const value = property in axisRules ? axisRules[property](ruleParams) : isAxisProperty(property) ? axis[property] : undefined;\n const hasValue = value !== undefined;\n const explicit = isExplicit(value, property, axis, model, channel);\n if (hasValue && explicit) {\n axisComponent.set(property, value, explicit);\n }\n else {\n const { configValue = undefined, configFrom = undefined } = isAxisProperty(property) && property !== 'values'\n ? getAxisConfig(property, config.style, axis.style, axisConfigs)\n : {};\n const hasConfigValue = configValue !== undefined;\n if (hasValue && !hasConfigValue) {\n // only set property if it is explicitly set or has no config value (otherwise we will accidentally override config)\n axisComponent.set(property, value, explicit);\n }\n else if (\n // Cases need implicit values\n // 1. Axis config that aren't available in Vega\n !(configFrom === 'vgAxisConfig') ||\n // 2. Certain properties are always included (see `propsToAlwaysIncludeConfig`'s declaration for more details)\n (propsToAlwaysIncludeConfig.has(property) && hasConfigValue) ||\n // 3. Conditional axis values and signals\n isConditionalAxisValue(configValue) ||\n isSignalRef(configValue)) {\n // If a config is specified and is conditional, copy conditional value from axis config\n axisComponent.set(property, configValue, false);\n }\n }\n }\n // 2) Add guide encode definition groups\n const axisEncoding = (_c = axis.encoding) !== null && _c !== void 0 ? _c : {};\n const axisEncode = AXIS_PARTS.reduce((e, part) => {\n var _a;\n if (!axisComponent.hasAxisPart(part)) {\n // No need to create encode for a disabled part.\n return e;\n }\n const axisEncodingPart = guideEncodeEntry((_a = axisEncoding[part]) !== null && _a !== void 0 ? _a : {}, model);\n const value = part === 'labels' ? encode.labels(model, channel, axisEncodingPart) : axisEncodingPart;\n if (value !== undefined && !isEmpty(value)) {\n e[part] = { update: value };\n }\n return e;\n }, {});\n // FIXME: By having encode as one property, we won't have fine grained encode merging.\n if (!isEmpty(axisEncode)) {\n axisComponent.set('encode', axisEncode, !!axis.encoding || axis.labelAngle !== undefined);\n }\n return axisComponent;\n}\n//# sourceMappingURL=parse.js.map","import { getSecondaryRangeChannel } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { formatCustomType, isCustomFormatType } from '../format';\nexport function labels(model, channel, specifiedLabelsSpec) {\n var _a;\n const { encoding, config } = model;\n const fieldOrDatumDef = (_a = getFieldOrDatumDef(encoding[channel])) !== null && _a !== void 0 ? _a : getFieldOrDatumDef(encoding[getSecondaryRangeChannel(channel)]);\n const axis = model.axis(channel) || {};\n const { format, formatType } = axis;\n if (isCustomFormatType(formatType)) {\n return Object.assign({ text: formatCustomType({\n fieldOrDatumDef,\n field: 'datum.value',\n format,\n formatType,\n config\n }) }, specifiedLabelsSpec);\n }\n return specifiedLabelsSpec;\n}\n//# sourceMappingURL=encode.js.map","import * as encode from './encode';\nfunction encodeEntry(model, fixedShape) {\n const { config } = model;\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'include',\n orient: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.nonPosition('size', model)), encode.nonPosition('angle', model)), shapeMixins(model, config, fixedShape));\n}\nexport function shapeMixins(model, config, fixedShape) {\n if (fixedShape) {\n return { shape: { value: fixedShape } };\n }\n return encode.nonPosition('shape', model);\n}\nexport const point = {\n vgMark: 'symbol',\n encodeEntry: (model) => {\n return encodeEntry(model);\n }\n};\nexport const circle = {\n vgMark: 'symbol',\n encodeEntry: (model) => {\n return encodeEntry(model, 'circle');\n }\n};\nexport const square = {\n vgMark: 'symbol',\n encodeEntry: (model) => {\n return encodeEntry(model, 'square');\n }\n};\n//# sourceMappingURL=point.js.map","import { isNumber } from 'vega-util';\nimport { getViewConfigDiscreteStep } from '../../config';\nimport { isVgRangeStep } from '../../vega.schema';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../common';\nimport * as encode from './encode';\nexport const tick = {\n vgMark: 'rect',\n encodeEntry: (model) => {\n const { config, markDef } = model;\n const orient = markDef.orient;\n const vgSizeChannel = orient === 'horizontal' ? 'width' : 'height';\n const vgThicknessChannel = orient === 'horizontal' ? 'height' : 'width';\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid', vgChannel: 'xc' })), encode.pointPosition('y', model, { defaultPos: 'mid', vgChannel: 'yc' })), encode.nonPosition('size', model, {\n defaultValue: defaultSize(model),\n vgChannel: vgSizeChannel\n })), { [vgThicknessChannel]: signalOrValueRef(getMarkPropOrConfig('thickness', markDef, config)) });\n }\n};\nfunction defaultSize(model) {\n var _a;\n const { config, markDef } = model;\n const { orient } = markDef;\n const vgSizeChannel = orient === 'horizontal' ? 'width' : 'height';\n const scale = model.getScaleComponent(orient === 'horizontal' ? 'x' : 'y');\n const markPropOrConfig = (_a = getMarkPropOrConfig('size', markDef, config, { vgChannel: vgSizeChannel })) !== null && _a !== void 0 ? _a : config.tick.bandSize;\n if (markPropOrConfig !== undefined) {\n return markPropOrConfig;\n }\n else {\n const scaleRange = scale ? scale.get('range') : undefined;\n if (scaleRange && isVgRangeStep(scaleRange) && isNumber(scaleRange.step)) {\n return (scaleRange.step * 3) / 4;\n }\n const defaultViewStep = getViewConfigDiscreteStep(config.view, vgSizeChannel);\n return (defaultViewStep * 3) / 4;\n }\n}\n//# sourceMappingURL=tick.js.map","import { isArray } from 'vega-util';\nimport { isFieldDef, isValueDef, vgField } from '../../channeldef';\nimport { DataSourceType } from '../../data';\nimport { isAggregate, pathGroupingFields } from '../../encoding';\nimport { AREA, BAR, isPathMark, LINE, TRAIL } from '../../mark';\nimport { isSortByEncoding, isSortField } from '../../sort';\nimport { contains, getFirstDefined, isNullOrFalse, keys, omit, pick } from '../../util';\nimport { VG_CORNERRADIUS_CHANNELS } from '../../vega.schema';\nimport { getMarkConfig, getMarkPropOrConfig, getStyles, signalOrValueRef, sortParams } from '../common';\nimport { arc } from './arc';\nimport { area } from './area';\nimport { bar } from './bar';\nimport { geoshape } from './geoshape';\nimport { image } from './image';\nimport { line, trail } from './line';\nimport { circle, point, square } from './point';\nimport { rect } from './rect';\nimport { rule } from './rule';\nimport { text } from './text';\nimport { tick } from './tick';\nconst markCompiler = {\n arc,\n area,\n bar,\n circle,\n geoshape,\n image,\n line,\n point,\n rect,\n rule,\n square,\n text,\n tick,\n trail\n};\nexport function parseMarkGroups(model) {\n if (contains([LINE, AREA, TRAIL], model.mark)) {\n const details = pathGroupingFields(model.mark, model.encoding);\n if (details.length > 0) {\n return getPathGroups(model, details);\n }\n // otherwise use standard mark groups\n }\n else if (contains([BAR], model.mark)) {\n const hasCornerRadius = VG_CORNERRADIUS_CHANNELS.some(prop => getMarkPropOrConfig(prop, model.markDef, model.config));\n if (model.stack && !model.fieldDef('size') && hasCornerRadius) {\n return getGroupsForStackedBarWithCornerRadius(model);\n }\n }\n return getMarkGroup(model);\n}\nconst FACETED_PATH_PREFIX = 'faceted_path_';\nfunction getPathGroups(model, details) {\n // TODO: for non-stacked plot, map order to zindex. (Maybe rename order for layer to zindex?)\n return [\n {\n name: model.getName('pathgroup'),\n type: 'group',\n from: {\n facet: {\n name: FACETED_PATH_PREFIX + model.requestDataName(DataSourceType.Main),\n data: model.requestDataName(DataSourceType.Main),\n groupby: details\n }\n },\n encode: {\n update: {\n width: { field: { group: 'width' } },\n height: { field: { group: 'height' } }\n }\n },\n // With subfacet for line/area group, need to use faceted data from above.\n marks: getMarkGroup(model, { fromPrefix: FACETED_PATH_PREFIX })\n }\n ];\n}\nconst STACK_GROUP_PREFIX = 'stack_group_';\n/**\n * We need to put stacked bars into groups in order to enable cornerRadius for stacks.\n * If stack is used and the model doesn't have size encoding, we put the mark into groups,\n * and apply cornerRadius properties at the group.\n */\nfunction getGroupsForStackedBarWithCornerRadius(model) {\n // Generate the mark\n const [mark] = getMarkGroup(model, { fromPrefix: STACK_GROUP_PREFIX });\n // Get the scale for the stacked field\n const fieldScale = model.scaleName(model.stack.fieldChannel);\n const stackField = (opt = {}) => model.vgField(model.stack.fieldChannel, opt);\n // Find the min/max of the pixel value on the stacked direction\n const stackFieldGroup = (func, expr) => {\n const vgFieldMinMax = [\n stackField({ prefix: 'min', suffix: 'start', expr }),\n stackField({ prefix: 'max', suffix: 'start', expr }),\n stackField({ prefix: 'min', suffix: 'end', expr }),\n stackField({ prefix: 'max', suffix: 'end', expr })\n ];\n return `${func}(${vgFieldMinMax.map(field => `scale('${fieldScale}',${field})`).join(',')})`;\n };\n let groupUpdate;\n let innerGroupUpdate;\n // Build the encoding for group and an inner group\n if (model.stack.fieldChannel === 'x') {\n // Move cornerRadius, y/yc/y2/height properties to group\n // Group x/x2 should be the min/max of the marks within\n groupUpdate = Object.assign(Object.assign({}, pick(mark.encode.update, ['y', 'yc', 'y2', 'height', ...VG_CORNERRADIUS_CHANNELS])), { x: { signal: stackFieldGroup('min', 'datum') }, x2: { signal: stackFieldGroup('max', 'datum') }, clip: { value: true } });\n // Inner group should revert the x translation, and pass height through\n innerGroupUpdate = {\n x: { field: { group: 'x' }, mult: -1 },\n height: { field: { group: 'height' } }\n };\n // The marks should use the same height as group, without y/yc/y2 properties (because it's already done by group)\n // This is why size encoding is not supported yet\n mark.encode.update = Object.assign(Object.assign({}, omit(mark.encode.update, ['y', 'yc', 'y2'])), { height: { field: { group: 'height' } } });\n }\n else {\n groupUpdate = Object.assign(Object.assign({}, pick(mark.encode.update, ['x', 'xc', 'x2', 'width'])), { y: { signal: stackFieldGroup('min', 'datum') }, y2: { signal: stackFieldGroup('max', 'datum') }, clip: { value: true } });\n innerGroupUpdate = {\n y: { field: { group: 'y' }, mult: -1 },\n width: { field: { group: 'width' } }\n };\n mark.encode.update = Object.assign(Object.assign({}, omit(mark.encode.update, ['x', 'xc', 'x2'])), { width: { field: { group: 'width' } } });\n }\n // Deal with cornerRadius properties\n for (const key of VG_CORNERRADIUS_CHANNELS) {\n const configValue = getMarkConfig(key, model.markDef, model.config);\n // Move from mark to group\n if (mark.encode.update[key]) {\n groupUpdate[key] = mark.encode.update[key];\n delete mark.encode.update[key];\n }\n else if (configValue) {\n groupUpdate[key] = signalOrValueRef(configValue);\n }\n // Overwrite any cornerRadius on mark set by config --- they are already moved to the group\n if (configValue) {\n mark.encode.update[key] = { value: 0 };\n }\n }\n // For bin and time unit, we have to add bin/timeunit -end channels.\n const groupByField = model.fieldDef(model.stack.groupbyChannel);\n const groupby = vgField(groupByField) ? [vgField(groupByField)] : [];\n if ((groupByField === null || groupByField === void 0 ? void 0 : groupByField.bin) || (groupByField === null || groupByField === void 0 ? void 0 : groupByField.timeUnit)) {\n groupby.push(vgField(groupByField, { binSuffix: 'end' }));\n }\n const strokeProperties = [\n 'stroke',\n 'strokeWidth',\n 'strokeJoin',\n 'strokeCap',\n 'strokeDash',\n 'strokeDashOffset',\n 'strokeMiterLimit',\n 'strokeOpacity'\n ];\n // Generate stroke properties for the group\n groupUpdate = strokeProperties.reduce((encode, prop) => {\n if (mark.encode.update[prop]) {\n return Object.assign(Object.assign({}, encode), { [prop]: mark.encode.update[prop] });\n }\n else {\n const configValue = getMarkConfig(prop, model.markDef, model.config);\n if (configValue !== undefined) {\n return Object.assign(Object.assign({}, encode), { [prop]: signalOrValueRef(configValue) });\n }\n else {\n return encode;\n }\n }\n }, groupUpdate);\n // Apply strokeForeground and strokeOffset if stroke is used\n if (groupUpdate.stroke) {\n groupUpdate.strokeForeground = { value: true };\n groupUpdate.strokeOffset = { value: 0 };\n }\n return [\n {\n type: 'group',\n from: {\n facet: {\n data: model.requestDataName(DataSourceType.Main),\n name: STACK_GROUP_PREFIX + model.requestDataName(DataSourceType.Main),\n groupby,\n aggregate: {\n fields: [\n stackField({ suffix: 'start' }),\n stackField({ suffix: 'start' }),\n stackField({ suffix: 'end' }),\n stackField({ suffix: 'end' })\n ],\n ops: ['min', 'max', 'min', 'max']\n }\n }\n },\n encode: {\n update: groupUpdate\n },\n marks: [\n {\n type: 'group',\n encode: { update: innerGroupUpdate },\n marks: [mark]\n }\n ]\n }\n ];\n}\nexport function getSort(model) {\n const { encoding, stack, mark, markDef, config } = model;\n const order = encoding.order;\n if ((!isArray(order) && isValueDef(order) && isNullOrFalse(order.value)) ||\n (!order && isNullOrFalse(getMarkPropOrConfig('order', markDef, config)))) {\n return undefined;\n }\n else if ((isArray(order) || isFieldDef(order)) && !stack) {\n // Sort by the order field if it is specified and the field is not stacked. (For stacked field, order specify stack order.)\n return sortParams(order, { expr: 'datum' });\n }\n else if (isPathMark(mark)) {\n // For both line and area, we sort values based on dimension by default\n const dimensionChannel = markDef.orient === 'horizontal' ? 'y' : 'x';\n const dimensionChannelDef = encoding[dimensionChannel];\n if (isFieldDef(dimensionChannelDef)) {\n const s = dimensionChannelDef.sort;\n if (isArray(s)) {\n return {\n field: vgField(dimensionChannelDef, { prefix: dimensionChannel, suffix: 'sort_index', expr: 'datum' })\n };\n }\n else if (isSortField(s)) {\n return {\n field: vgField({\n // FIXME: this op might not already exist?\n // FIXME: what if dimensionChannel (x or y) contains custom domain?\n aggregate: isAggregate(model.encoding) ? s.op : undefined,\n field: s.field\n }, { expr: 'datum' })\n };\n }\n else if (isSortByEncoding(s)) {\n const fieldDefToSort = model.fieldDef(s.encoding);\n return {\n field: vgField(fieldDefToSort, { expr: 'datum' }),\n order: s.order\n };\n }\n else if (s === null) {\n return undefined;\n }\n else {\n return {\n field: vgField(dimensionChannelDef, {\n // For stack with imputation, we only have bin_mid\n binSuffix: model.stack && model.stack.impute ? 'mid' : undefined,\n expr: 'datum'\n })\n };\n }\n }\n return undefined;\n }\n return undefined;\n}\nfunction getMarkGroup(model, opt = { fromPrefix: '' }) {\n const { mark, markDef, encoding, config } = model;\n const clip = getFirstDefined(markDef.clip, scaleClip(model), projectionClip(model));\n const style = getStyles(markDef);\n const key = encoding.key;\n const sort = getSort(model);\n const interactive = interactiveFlag(model);\n const aria = getMarkPropOrConfig('aria', markDef, config);\n const postEncodingTransform = markCompiler[mark].postEncodingTransform\n ? markCompiler[mark].postEncodingTransform(model)\n : null;\n return [\n Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ name: model.getName('marks'), type: markCompiler[mark].vgMark }, (clip ? { clip: true } : {})), (style ? { style } : {})), (key ? { key: key.field } : {})), (sort ? { sort } : {})), (interactive ? interactive : {})), (aria === false ? { aria } : {})), { from: { data: opt.fromPrefix + model.requestDataName(DataSourceType.Main) }, encode: {\n update: markCompiler[mark].encodeEntry(model)\n } }), (postEncodingTransform\n ? {\n transform: postEncodingTransform\n }\n : {}))\n ];\n}\n/**\n * If scales are bound to interval selections, we want to automatically clip\n * marks to account for panning/zooming interactions. We identify bound scales\n * by the selectionExtent property, which gets added during scale parsing.\n */\nfunction scaleClip(model) {\n const xScale = model.getScaleComponent('x');\n const yScale = model.getScaleComponent('y');\n return (xScale && xScale.get('selectionExtent')) || (yScale && yScale.get('selectionExtent')) ? true : undefined;\n}\n/**\n * If we use a custom projection with auto-fitting to the geodata extent,\n * we need to clip to ensure the chart size doesn't explode.\n */\nfunction projectionClip(model) {\n const projection = model.component.projection;\n return projection && !projection.isFit ? true : undefined;\n}\n/**\n * Only output interactive flags if we have selections defined somewhere in our model hierarchy.\n */\nfunction interactiveFlag(model) {\n if (!model.component.selection)\n return null;\n const unitCount = keys(model.component.selection).length;\n let parentCount = unitCount;\n let parent = model.parent;\n while (parent && parentCount === 0) {\n parentCount = keys(parent.component.selection).length;\n parent = parent.parent;\n }\n return parentCount\n ? {\n interactive: unitCount > 0 || !!model.encoding.tooltip\n }\n : null;\n}\n//# sourceMappingURL=mark.js.map","import * as encode from './encode';\nexport const arc = {\n vgMark: 'arc',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'ignore',\n orient: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.rectPosition(model, 'radius', 'arc')), encode.rectPosition(model, 'theta', 'arc'));\n }\n};\n//# sourceMappingURL=arc.js.map","import * as encode from './encode';\nexport const area = {\n vgMark: 'area',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'include',\n size: 'ignore',\n theta: 'ignore'\n })), encode.pointOrRangePosition('x', model, {\n defaultPos: 'zeroOrMin',\n defaultPos2: 'zeroOrMin',\n range: model.markDef.orient === 'horizontal'\n })), encode.pointOrRangePosition('y', model, {\n defaultPos: 'zeroOrMin',\n defaultPos2: 'zeroOrMin',\n range: model.markDef.orient === 'vertical'\n })), encode.defined(model));\n }\n};\n//# sourceMappingURL=area.js.map","import * as encode from './encode';\nexport const bar = {\n vgMark: 'rect',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.rectPosition(model, 'x', 'bar')), encode.rectPosition(model, 'y', 'bar'));\n }\n};\n//# sourceMappingURL=bar.js.map","import { isFieldDef, vgField } from '../../channeldef';\nimport { GEOJSON } from '../../type';\nimport * as encode from './encode';\nexport const geoshape = {\n vgMark: 'shape',\n encodeEntry: (model) => {\n return Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'ignore',\n orient: 'ignore',\n theta: 'ignore'\n }));\n },\n postEncodingTransform: (model) => {\n const { encoding } = model;\n const shapeDef = encoding.shape;\n const transform = Object.assign({ type: 'geoshape', projection: model.projectionName() }, (shapeDef && isFieldDef(shapeDef) && shapeDef.type === GEOJSON\n ? { field: vgField(shapeDef, { expr: 'datum' }) }\n : {}));\n return [transform];\n }\n};\n//# sourceMappingURL=geoshape.js.map","import * as encode from './encode';\nexport const image = {\n vgMark: 'image',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'ignore',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.rectPosition(model, 'x', 'image')), encode.rectPosition(model, 'y', 'image')), encode.text(model, 'url'));\n }\n};\n//# sourceMappingURL=image.js.map","import * as encode from './encode';\nexport const line = {\n vgMark: 'line',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'ignore',\n orient: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.nonPosition('size', model, {\n vgChannel: 'strokeWidth' // VL's line size is strokeWidth\n })), encode.defined(model));\n }\n};\nexport const trail = {\n vgMark: 'trail',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'include',\n orient: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.nonPosition('size', model)), encode.defined(model));\n }\n};\n//# sourceMappingURL=line.js.map","import * as encode from './encode';\nexport const rect = {\n vgMark: 'rect',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.rectPosition(model, 'x', 'rect')), encode.rectPosition(model, 'y', 'rect'));\n }\n};\n//# sourceMappingURL=rect.js.map","import * as encode from './encode';\nexport const rule = {\n vgMark: 'rule',\n encodeEntry: (model) => {\n const { markDef } = model;\n const orient = markDef.orient;\n if (!model.encoding.x && !model.encoding.y && !model.encoding.latitude && !model.encoding.longitude) {\n // Show nothing if we have none of x, y, lat, and long.\n return {};\n }\n return Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.pointOrRangePosition('x', model, {\n defaultPos: orient === 'horizontal' ? 'zeroOrMax' : 'mid',\n defaultPos2: 'zeroOrMin',\n range: orient !== 'vertical' // include x2 for horizontal or line segment rule\n })), encode.pointOrRangePosition('y', model, {\n defaultPos: orient === 'vertical' ? 'zeroOrMax' : 'mid',\n defaultPos2: 'zeroOrMin',\n range: orient !== 'horizontal' // include y2 for vertical or line segment rule\n })), encode.nonPosition('size', model, {\n vgChannel: 'strokeWidth' // VL's rule size is strokeWidth\n }));\n }\n};\n//# sourceMappingURL=rule.js.map","import { getMarkPropOrConfig } from '../common';\nimport * as encode from './encode';\nexport const text = {\n vgMark: 'text',\n encodeEntry: (model) => {\n const { config, encoding } = model;\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'include',\n baseline: 'include',\n color: 'include',\n size: 'ignore',\n orient: 'ignore',\n theta: 'include'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.text(model)), encode.nonPosition('size', model, {\n vgChannel: 'fontSize' // VL's text size is fontSize\n })), encode.nonPosition('angle', model)), encode.valueIfDefined('align', align(model.markDef, encoding, config))), encode.valueIfDefined('baseline', baseline(model.markDef, encoding, config))), encode.pointPosition('radius', model, { defaultPos: null, isMidPoint: true })), encode.pointPosition('theta', model, { defaultPos: null, isMidPoint: true }));\n }\n};\nfunction align(markDef, encoding, config) {\n const a = getMarkPropOrConfig('align', markDef, config);\n if (a === undefined) {\n return 'center';\n }\n // If there is a config, Vega-parser will process this already.\n return undefined;\n}\nfunction baseline(markDef, encoding, config) {\n const b = getMarkPropOrConfig('baseline', markDef, config);\n if (b === undefined) {\n return 'middle';\n }\n // If there is a config, Vega-parser will process this already.\n return undefined;\n}\n//# sourceMappingURL=text.js.map","import { isArray } from 'vega-util';\nimport { isConditionalAxisValue } from '../axis';\nimport { GEOPOSITION_CHANNELS, NONPOSITION_SCALE_CHANNELS, POSITION_SCALE_CHANNELS, SCALE_CHANNELS, supportLegend, X, Y } from '../channel';\nimport { getFieldDef, getFieldOrDatumDef, isFieldOrDatumDef, isTypedFieldDef } from '../channeldef';\nimport { isGraticuleGenerator } from '../data';\nimport * as vlEncoding from '../encoding';\nimport { initEncoding } from '../encoding';\nimport { replaceExprRefInIndex } from '../expr';\nimport { GEOSHAPE, isMarkDef } from '../mark';\nimport { isFrameMixins } from '../spec/base';\nimport { stack } from '../stack';\nimport { keys } from '../util';\nimport { assembleAxisSignals } from './axis/assemble';\nimport { parseUnitAxes } from './axis/parse';\nimport { signalOrValueRefWithCondition, signalRefOrValue } from './common';\nimport { parseData } from './data/parse';\nimport { assembleLayoutSignals } from './layoutsize/assemble';\nimport { initLayoutSize } from './layoutsize/init';\nimport { parseUnitLayoutSize } from './layoutsize/parse';\nimport { defaultFilled, initMarkdef } from './mark/init';\nimport { parseMarkGroups } from './mark/mark';\nimport { isLayerModel, ModelWithField } from './model';\nimport { assembleTopLevelSignals, assembleUnitSelectionData, assembleUnitSelectionMarks, assembleUnitSelectionSignals } from './selection/assemble';\nimport { parseUnitSelection } from './selection/parse';\n/**\n * Internal model of Vega-Lite specification for the compiler.\n */\nexport class UnitModel extends ModelWithField {\n constructor(spec, parent, parentGivenName, parentGivenSize = {}, config) {\n super(spec, 'unit', parent, parentGivenName, config, undefined, isFrameMixins(spec) ? spec.view : undefined);\n this.specifiedScales = {};\n this.specifiedAxes = {};\n this.specifiedLegends = {};\n this.specifiedProjection = {};\n this.selection = {};\n this.children = [];\n const markDef = isMarkDef(spec.mark) ? Object.assign({}, spec.mark) : { type: spec.mark };\n const mark = markDef.type;\n // Need to init filled before other mark properties because encoding depends on filled but other mark properties depend on types inside encoding\n if (markDef.filled === undefined) {\n markDef.filled = defaultFilled(markDef, config, {\n graticule: spec.data && isGraticuleGenerator(spec.data)\n });\n }\n const encoding = (this.encoding = initEncoding(spec.encoding || {}, mark, markDef.filled, config));\n this.markDef = initMarkdef(markDef, encoding, config);\n this.size = initLayoutSize({\n encoding: encoding,\n size: isFrameMixins(spec)\n ? Object.assign(Object.assign(Object.assign({}, parentGivenSize), (spec.width ? { width: spec.width } : {})), (spec.height ? { height: spec.height } : {})) : parentGivenSize\n });\n // calculate stack properties\n this.stack = stack(mark, encoding);\n this.specifiedScales = this.initScales(mark, encoding);\n this.specifiedAxes = this.initAxes(encoding);\n this.specifiedLegends = this.initLegends(encoding);\n this.specifiedProjection = spec.projection;\n // Selections will be initialized upon parse.\n this.selection = spec.selection;\n }\n get hasProjection() {\n const { encoding } = this;\n const isGeoShapeMark = this.mark === GEOSHAPE;\n const hasGeoPosition = encoding && GEOPOSITION_CHANNELS.some(channel => isFieldOrDatumDef(encoding[channel]));\n return isGeoShapeMark || hasGeoPosition;\n }\n /**\n * Return specified Vega-Lite scale domain for a particular channel\n * @param channel\n */\n scaleDomain(channel) {\n const scale = this.specifiedScales[channel];\n return scale ? scale.domain : undefined;\n }\n axis(channel) {\n return this.specifiedAxes[channel];\n }\n legend(channel) {\n return this.specifiedLegends[channel];\n }\n initScales(mark, encoding) {\n return SCALE_CHANNELS.reduce((scales, channel) => {\n var _a;\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n if (fieldOrDatumDef) {\n scales[channel] = this.initScale((_a = fieldOrDatumDef.scale) !== null && _a !== void 0 ? _a : {});\n }\n return scales;\n }, {});\n }\n initScale(scale) {\n const { domain, range } = scale;\n const scaleInternal = replaceExprRefInIndex(scale);\n if (isArray(domain)) {\n scaleInternal.domain = domain.map(signalRefOrValue);\n }\n if (isArray(range)) {\n scaleInternal.range = range.map(signalRefOrValue);\n }\n return scaleInternal;\n }\n initAxes(encoding) {\n return POSITION_SCALE_CHANNELS.reduce((_axis, channel) => {\n // Position Axis\n // TODO: handle ConditionFieldDef\n const channelDef = encoding[channel];\n if (isFieldOrDatumDef(channelDef) ||\n (channel === X && isFieldOrDatumDef(encoding.x2)) ||\n (channel === Y && isFieldOrDatumDef(encoding.y2))) {\n const axisSpec = isFieldOrDatumDef(channelDef) ? channelDef.axis : undefined;\n _axis[channel] = axisSpec\n ? this.initAxis(Object.assign({}, axisSpec)) // convert truthy value to object\n : axisSpec;\n }\n return _axis;\n }, {});\n }\n initAxis(axis) {\n const props = keys(axis);\n const axisInternal = {};\n for (const prop of props) {\n const val = axis[prop];\n axisInternal[prop] = isConditionalAxisValue(val)\n ? signalOrValueRefWithCondition(val)\n : signalRefOrValue(val);\n }\n return axisInternal;\n }\n initLegends(encoding) {\n return NONPOSITION_SCALE_CHANNELS.reduce((_legend, channel) => {\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n if (fieldOrDatumDef && supportLegend(channel)) {\n const legend = fieldOrDatumDef.legend;\n _legend[channel] = legend\n ? replaceExprRefInIndex(legend) // convert truthy value to object\n : legend;\n }\n return _legend;\n }, {});\n }\n parseData() {\n this.component.data = parseData(this);\n }\n parseLayoutSize() {\n parseUnitLayoutSize(this);\n }\n parseSelections() {\n this.component.selection = parseUnitSelection(this, this.selection);\n }\n parseMarkGroup() {\n this.component.mark = parseMarkGroups(this);\n }\n parseAxesAndHeaders() {\n this.component.axes = parseUnitAxes(this);\n }\n assembleSelectionTopLevelSignals(signals) {\n return assembleTopLevelSignals(this, signals);\n }\n assembleSignals() {\n return [...assembleAxisSignals(this), ...assembleUnitSelectionSignals(this, [])];\n }\n assembleSelectionData(data) {\n return assembleUnitSelectionData(this, data);\n }\n assembleLayout() {\n return null;\n }\n assembleLayoutSignals() {\n return assembleLayoutSignals(this);\n }\n assembleMarks() {\n var _a;\n let marks = (_a = this.component.mark) !== null && _a !== void 0 ? _a : [];\n // If this unit is part of a layer, selections should augment\n // all in concert rather than each unit individually. This\n // ensures correct interleaving of clipping and brushed marks.\n if (!this.parent || !isLayerModel(this.parent)) {\n marks = assembleUnitSelectionMarks(this, marks);\n }\n return marks.map(this.correctDataNames);\n }\n getMapping() {\n return this.encoding;\n }\n get mark() {\n return this.markDef.type;\n }\n channelHasField(channel) {\n return vlEncoding.channelHasField(this.encoding, channel);\n }\n fieldDef(channel) {\n const channelDef = this.encoding[channel];\n return getFieldDef(channelDef);\n }\n typedFieldDef(channel) {\n const fieldDef = this.fieldDef(channel);\n if (isTypedFieldDef(fieldDef)) {\n return fieldDef;\n }\n return null;\n }\n}\n//# sourceMappingURL=unit.js.map","import { isBinned, isBinning } from '../../bin';\nimport { isContinuousFieldOrDatumDef, isFieldDef, isNumericDataDef } from '../../channeldef';\nimport { isAggregate } from '../../encoding';\nimport { replaceExprRefInIndex } from '../../expr';\nimport * as log from '../../log';\nimport { AREA, BAR, BAR_CORNER_RADIUS_INDEX as BAR_CORNER_RADIUS_END_INDEX, CIRCLE, IMAGE, LINE, POINT, RECT, RULE, SQUARE, TEXT, TICK } from '../../mark';\nimport { QUANTITATIVE, TEMPORAL } from '../../type';\nimport { contains, getFirstDefined } from '../../util';\nimport { getMarkConfig, getMarkPropOrConfig } from '../common';\nexport function initMarkdef(originalMarkDef, encoding, config) {\n const markDef = replaceExprRefInIndex(originalMarkDef);\n // set orient, which can be overridden by rules as sometimes the specified orient is invalid.\n const specifiedOrient = getMarkPropOrConfig('orient', markDef, config);\n markDef.orient = orient(markDef.type, encoding, specifiedOrient);\n if (specifiedOrient !== undefined && specifiedOrient !== markDef.orient) {\n log.warn(log.message.orientOverridden(markDef.orient, specifiedOrient));\n }\n if (markDef.type === 'bar' && markDef.orient) {\n const cornerRadiusEnd = getMarkPropOrConfig('cornerRadiusEnd', markDef, config);\n if (cornerRadiusEnd !== undefined) {\n const newProps = (markDef.orient === 'horizontal' && encoding.x2) || (markDef.orient === 'vertical' && encoding.y2)\n ? ['cornerRadius']\n : BAR_CORNER_RADIUS_END_INDEX[markDef.orient];\n for (const newProp of newProps) {\n markDef[newProp] = cornerRadiusEnd;\n }\n if (markDef.cornerRadiusEnd !== undefined) {\n delete markDef.cornerRadiusEnd; // no need to keep the original cap cornerRadius\n }\n }\n }\n // set opacity and filled if not specified in mark config\n const specifiedOpacity = getMarkPropOrConfig('opacity', markDef, config);\n if (specifiedOpacity === undefined) {\n markDef.opacity = opacity(markDef.type, encoding);\n }\n // set cursor, which should be pointer if href channel is present unless otherwise specified\n const specifiedCursor = getMarkPropOrConfig('cursor', markDef, config);\n if (specifiedCursor === undefined) {\n markDef.cursor = cursor(markDef, encoding, config);\n }\n return markDef;\n}\nfunction cursor(markDef, encoding, config) {\n if (encoding.href || markDef.href || getMarkPropOrConfig('href', markDef, config)) {\n return 'pointer';\n }\n return markDef.cursor;\n}\nfunction opacity(mark, encoding) {\n if (contains([POINT, TICK, CIRCLE, SQUARE], mark)) {\n // point-based marks\n if (!isAggregate(encoding)) {\n return 0.7;\n }\n }\n return undefined;\n}\nexport function defaultFilled(markDef, config, { graticule }) {\n if (graticule) {\n return false;\n }\n const filledConfig = getMarkConfig('filled', markDef, config);\n const mark = markDef.type;\n return getFirstDefined(filledConfig, mark !== POINT && mark !== LINE && mark !== RULE);\n}\nfunction orient(mark, encoding, specifiedOrient) {\n switch (mark) {\n case POINT:\n case CIRCLE:\n case SQUARE:\n case TEXT:\n case RECT:\n case IMAGE:\n // orient is meaningless for these marks.\n return undefined;\n }\n const { x, y, x2, y2 } = encoding;\n switch (mark) {\n case BAR:\n if (isFieldDef(x) && (isBinned(x.bin) || (isFieldDef(y) && y.aggregate && !x.aggregate))) {\n return 'vertical';\n }\n if (isFieldDef(y) && (isBinned(y.bin) || (isFieldDef(x) && x.aggregate && !y.aggregate))) {\n return 'horizontal';\n }\n if (y2 || x2) {\n // Ranged bar does not always have clear orientation, so we allow overriding\n if (specifiedOrient) {\n return specifiedOrient;\n }\n // If y is range and x is non-range, non-bin Q, y is likely a prebinned field\n if (!x2) {\n if ((isFieldDef(x) && x.type === QUANTITATIVE && !isBinning(x.bin)) || isNumericDataDef(x)) {\n return 'horizontal';\n }\n }\n // If x is range and y is non-range, non-bin Q, x is likely a prebinned field\n if (!y2) {\n if ((isFieldDef(y) && y.type === QUANTITATIVE && !isBinning(y.bin)) || isNumericDataDef(y)) {\n return 'vertical';\n }\n }\n }\n // falls through\n case RULE:\n // return undefined for line segment rule and bar with both axis ranged\n // we have to ignore the case that the data are already binned\n if (x2 && !(isFieldDef(x) && isBinned(x.bin)) && y2 && !(isFieldDef(y) && isBinned(y.bin))) {\n return undefined;\n }\n // falls through\n case AREA:\n // If there are range for both x and y, y (vertical) has higher precedence.\n if (y2) {\n if (isFieldDef(y) && isBinned(y.bin)) {\n return 'horizontal';\n }\n else {\n return 'vertical';\n }\n }\n else if (x2) {\n if (isFieldDef(x) && isBinned(x.bin)) {\n return 'vertical';\n }\n else {\n return 'horizontal';\n }\n }\n else if (mark === RULE) {\n if (x && !y) {\n return 'vertical';\n }\n else if (y && !x) {\n return 'horizontal';\n }\n }\n // falls through\n case LINE:\n case TICK: {\n // Tick is opposite to bar, line, area and never have ranged mark.\n const xIsContinuous = isContinuousFieldOrDatumDef(x);\n const yIsContinuous = isContinuousFieldOrDatumDef(y);\n if (xIsContinuous && !yIsContinuous) {\n return mark !== 'tick' ? 'horizontal' : 'vertical';\n }\n else if (!xIsContinuous && yIsContinuous) {\n return mark !== 'tick' ? 'vertical' : 'horizontal';\n }\n else if (xIsContinuous && yIsContinuous) {\n const xDef = x; // we can cast here since they are surely fieldDef\n const yDef = y;\n const xIsTemporal = xDef.type === TEMPORAL;\n const yIsTemporal = yDef.type === TEMPORAL;\n // temporal without timeUnit is considered continuous, but better serves as dimension\n if (xIsTemporal && !yIsTemporal) {\n return mark !== 'tick' ? 'vertical' : 'horizontal';\n }\n else if (!xIsTemporal && yIsTemporal) {\n return mark !== 'tick' ? 'horizontal' : 'vertical';\n }\n if (!xDef.aggregate && yDef.aggregate) {\n return mark !== 'tick' ? 'vertical' : 'horizontal';\n }\n else if (xDef.aggregate && !yDef.aggregate) {\n return mark !== 'tick' ? 'horizontal' : 'vertical';\n }\n if (specifiedOrient) {\n // When ambiguous, use user specified one.\n return specifiedOrient;\n }\n return 'vertical';\n }\n else {\n // Discrete x Discrete case\n if (specifiedOrient) {\n // When ambiguous, use user specified one.\n return specifiedOrient;\n }\n return undefined;\n }\n }\n }\n return 'vertical';\n}\n//# sourceMappingURL=init.js.map","import { getSizeChannel, POSITION_SCALE_CHANNELS } from '../../channel';\nimport { isContinuousFieldOrDatumDef } from '../../channeldef';\nimport * as log from '../../log';\nimport { isStep } from '../../spec/base';\nexport function initLayoutSize({ encoding, size }) {\n for (const channel of POSITION_SCALE_CHANNELS) {\n const sizeType = getSizeChannel(channel);\n if (isStep(size[sizeType])) {\n if (isContinuousFieldOrDatumDef(encoding[channel])) {\n delete size[sizeType];\n log.warn(log.message.stepDropped(sizeType));\n }\n }\n }\n return size;\n}\n//# sourceMappingURL=init.js.map","import * as log from '../log';\nimport { isLayerSpec, isUnitSpec } from '../spec';\nimport { keys } from '../util';\nimport { assembleAxisSignals } from './axis/assemble';\nimport { parseLayerAxes } from './axis/parse';\nimport { parseData } from './data/parse';\nimport { assembleLayoutSignals } from './layoutsize/assemble';\nimport { parseLayerLayoutSize } from './layoutsize/parse';\nimport { assembleLegends } from './legend/assemble';\nimport { Model } from './model';\nimport { assembleLayerSelectionMarks } from './selection/assemble';\nimport { UnitModel } from './unit';\nexport class LayerModel extends Model {\n constructor(spec, parent, parentGivenName, parentGivenSize, config) {\n super(spec, 'layer', parent, parentGivenName, config, spec.resolve, spec.view);\n const layoutSize = Object.assign(Object.assign(Object.assign({}, parentGivenSize), (spec.width ? { width: spec.width } : {})), (spec.height ? { height: spec.height } : {}));\n this.children = spec.layer.map((layer, i) => {\n if (isLayerSpec(layer)) {\n return new LayerModel(layer, this, this.getName('layer_' + i), layoutSize, config);\n }\n else if (isUnitSpec(layer)) {\n return new UnitModel(layer, this, this.getName('layer_' + i), layoutSize, config);\n }\n throw new Error(log.message.invalidSpec(layer));\n });\n }\n parseData() {\n this.component.data = parseData(this);\n for (const child of this.children) {\n child.parseData();\n }\n }\n parseLayoutSize() {\n parseLayerLayoutSize(this);\n }\n parseSelections() {\n // Merge selections up the hierarchy so that they may be referenced\n // across unit specs. Persist their definitions within each child\n // to assemble signals which remain within output Vega unit groups.\n this.component.selection = {};\n for (const child of this.children) {\n child.parseSelections();\n for (const key of keys(child.component.selection)) {\n this.component.selection[key] = child.component.selection[key];\n }\n }\n }\n parseMarkGroup() {\n for (const child of this.children) {\n child.parseMarkGroup();\n }\n }\n parseAxesAndHeaders() {\n parseLayerAxes(this);\n }\n assembleSelectionTopLevelSignals(signals) {\n return this.children.reduce((sg, child) => child.assembleSelectionTopLevelSignals(sg), signals);\n }\n // TODO: Support same named selections across children.\n assembleSignals() {\n return this.children.reduce((signals, child) => {\n return signals.concat(child.assembleSignals());\n }, assembleAxisSignals(this));\n }\n assembleLayoutSignals() {\n return this.children.reduce((signals, child) => {\n return signals.concat(child.assembleLayoutSignals());\n }, assembleLayoutSignals(this));\n }\n assembleSelectionData(data) {\n return this.children.reduce((db, child) => child.assembleSelectionData(db), data);\n }\n assembleTitle() {\n let title = super.assembleTitle();\n if (title) {\n return title;\n }\n // If title does not provide layer, look into children\n for (const child of this.children) {\n title = child.assembleTitle();\n if (title) {\n return title;\n }\n }\n return undefined;\n }\n assembleLayout() {\n return null;\n }\n assembleMarks() {\n return assembleLayerSelectionMarks(this, this.children.flatMap(child => {\n return child.assembleMarks();\n }));\n }\n assembleLegends() {\n return this.children.reduce((legends, child) => {\n return legends.concat(child.assembleLegends());\n }, assembleLegends(this));\n }\n}\n//# sourceMappingURL=layer.js.map","import * as log from '../log';\nimport { isAnyConcatSpec, isFacetSpec, isLayerSpec, isUnitSpec } from '../spec';\nimport { ConcatModel } from './concat';\nimport { FacetModel } from './facet';\nimport { LayerModel } from './layer';\nimport { UnitModel } from './unit';\nexport function buildModel(spec, parent, parentGivenName, unitSize, config) {\n if (isFacetSpec(spec)) {\n return new FacetModel(spec, parent, parentGivenName, config);\n }\n else if (isLayerSpec(spec)) {\n return new LayerModel(spec, parent, parentGivenName, unitSize, config);\n }\n else if (isUnitSpec(spec)) {\n return new UnitModel(spec, parent, parentGivenName, unitSize, config);\n }\n else if (isAnyConcatSpec(spec)) {\n return new ConcatModel(spec, parent, parentGivenName, config);\n }\n throw new Error(log.message.invalidSpec(spec));\n}\n//# sourceMappingURL=buildmodel.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isString, mergeConfig } from 'vega-util';\nimport { getPositionScaleChannel } from '../channel';\nimport * as vlFieldDef from '../channeldef';\nimport { initConfig, stripAndRedirectConfig } from '../config';\nimport * as log from '../log';\nimport { normalize } from '../normalize';\nimport { assembleParameterSignals } from '../parameter';\nimport { extractTopLevelProperties, getFitType, isFitType } from '../spec/toplevel';\nimport { keys } from '../util';\nimport { buildModel } from './buildmodel';\nimport { assembleRootData } from './data/assemble';\nimport { optimizeDataflow } from './data/optimize';\n/**\n * Vega-Lite's main function, for compiling Vega-Lite spec into Vega spec.\n *\n * At a high-level, we make the following transformations in different phases:\n *\n * Input spec\n * |\n * | (Normalization)\n * v\n * Normalized Spec (Row/Column channels in single-view specs becomes faceted specs, composite marks becomes layered specs.)\n * |\n * | (Build Model)\n * v\n * A model tree of the spec\n * |\n * | (Parse)\n * v\n * A model tree with parsed components (intermediate structure of visualization primitives in a format that can be easily merged)\n * |\n * | (Optimize)\n * v\n * A model tree with parsed components with the data component optimized\n * |\n * | (Assemble)\n * v\n * Vega spec\n *\n * @param inputSpec The Vega-Lite specification.\n * @param opt Optional arguments passed to the Vega-Lite compiler.\n * @returns An object containing the compiled Vega spec and normalized Vega-Lite spec.\n */\nexport function compile(inputSpec, opt = {}) {\n // 0. Augment opt with default opts\n if (opt.logger) {\n // set the singleton logger to the provided logger\n log.set(opt.logger);\n }\n if (opt.fieldTitle) {\n // set the singleton field title formatter\n vlFieldDef.setTitleFormatter(opt.fieldTitle);\n }\n try {\n // 1. Initialize config by deep merging default config with the config provided via option and the input spec.\n const config = initConfig(mergeConfig(opt.config, inputSpec.config));\n // 2. Normalize: Convert input spec -> normalized spec\n // - Decompose all extended unit specs into composition of unit spec. For example, a box plot get expanded into multiple layers of bars, ticks, and rules. The shorthand row/column channel is also expanded to a facet spec.\n // - Normalize autosize and width or height spec\n const spec = normalize(inputSpec, config);\n // 3. Build Model: normalized spec -> Model (a tree structure)\n // This phases instantiates the models with default config by doing a top-down traversal. This allows us to pass properties that child models derive from their parents via their constructors.\n // See the abstract `Model` class and its children (UnitModel, LayerModel, FacetModel, ConcatModel) for different types of models.\n const model = buildModel(spec, null, '', undefined, config);\n // 4 Parse: Model --> Model with components\n // Note that components = intermediate representations that are equivalent to Vega specs.\n // We need these intermediate representation because we need to merge many visualization \"components\" like projections, scales, axes, and legends.\n // We will later convert these components into actual Vega specs in the assemble phase.\n // In this phase, we do a bottom-up traversal over the whole tree to\n // parse for each type of components once (e.g., data, layout, mark, scale).\n // By doing bottom-up traversal, we start parsing components of unit specs and\n // then merge child components of parent composite specs.\n //\n // Please see inside model.parse() for order of different components parsed.\n model.parse();\n // drawDataflow(model.component.data.sources);\n // 5. Optimize the dataflow. This will modify the data component of the model.\n optimizeDataflow(model.component.data, model);\n // drawDataflow(model.component.data.sources);\n // 6. Assemble: convert model components --> Vega Spec.\n const vgSpec = assembleTopLevelModel(model, getTopLevelProperties(inputSpec, spec.autosize, config, model), inputSpec.datasets, inputSpec.usermeta);\n return {\n spec: vgSpec,\n normalized: spec\n };\n }\n finally {\n // Reset the singleton logger if a logger is provided\n if (opt.logger) {\n log.reset();\n }\n // Reset the singleton field title formatter if provided\n if (opt.fieldTitle) {\n vlFieldDef.resetTitleFormatter();\n }\n }\n}\nfunction getTopLevelProperties(inputSpec, autosize, config, model) {\n const width = model.component.layoutSize.get('width');\n const height = model.component.layoutSize.get('height');\n if (autosize === undefined) {\n autosize = { type: 'pad' };\n if (model.hasAxisOrientSignalRef()) {\n autosize.resize = true;\n }\n }\n else if (isString(autosize)) {\n autosize = { type: autosize };\n }\n if (width && height && isFitType(autosize.type)) {\n if (width === 'step' && height === 'step') {\n log.warn(log.message.droppingFit());\n autosize.type = 'pad';\n }\n else if (width === 'step' || height === 'step') {\n // effectively XOR, because else if\n // get step dimension\n const sizeType = width === 'step' ? 'width' : 'height';\n // log that we're dropping fit for respective channel\n log.warn(log.message.droppingFit(getPositionScaleChannel(sizeType)));\n // setting type to inverse fit (so if we dropped fit-x, type is now fit-y)\n const inverseSizeType = sizeType === 'width' ? 'height' : 'width';\n autosize.type = getFitType(inverseSizeType);\n }\n }\n return Object.assign(Object.assign(Object.assign({}, (keys(autosize).length === 1 && autosize.type\n ? autosize.type === 'pad'\n ? {}\n : { autosize: autosize.type }\n : { autosize })), extractTopLevelProperties(config, false)), extractTopLevelProperties(inputSpec, true));\n}\n/*\n * Assemble the top-level model to a Vega spec.\n *\n * Note: this couldn't be `model.assemble()` since the top-level model\n * needs some special treatment to generate top-level properties.\n */\nfunction assembleTopLevelModel(model, topLevelProperties, datasets = {}, usermeta) {\n // Config with Vega-Lite only config removed.\n const vgConfig = model.config ? stripAndRedirectConfig(model.config) : undefined;\n const data = [].concat(model.assembleSelectionData([]), \n // only assemble data in the root\n assembleRootData(model.component.data, datasets));\n const projections = model.assembleProjections();\n const title = model.assembleTitle();\n const style = model.assembleGroupStyle();\n const encodeEntry = model.assembleGroupEncodeEntry(true);\n let layoutSignals = model.assembleLayoutSignals();\n // move width and height signals with values to top level\n layoutSignals = layoutSignals.filter(signal => {\n if ((signal.name === 'width' || signal.name === 'height') && signal.value !== undefined) {\n topLevelProperties[signal.name] = +signal.value;\n return false;\n }\n return true;\n });\n const { params } = topLevelProperties, otherTopLevelProps = __rest(topLevelProperties, [\"params\"]);\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ $schema: 'https://vega.github.io/schema/vega/v5.json' }, (model.description ? { description: model.description } : {})), otherTopLevelProps), (title ? { title } : {})), (style ? { style } : {})), (encodeEntry ? { encode: { update: encodeEntry } } : {})), { data }), (projections.length > 0 ? { projections: projections } : {})), model.assembleGroup([\n ...layoutSignals,\n ...model.assembleSelectionTopLevelSignals([]),\n ...assembleParameterSignals(params)\n ])), (vgConfig ? { config: vgConfig } : {})), (usermeta ? { usermeta } : {}));\n}\n//# sourceMappingURL=compile.js.map","function e(e){const[n,r]=/schema\\/([\\w-]+)\\/([\\w\\.\\-]+)\\.json$/g.exec(e).slice(1,3);return{library:n,version:r}}export default e;\n//# sourceMappingURL=parser.module.js.map\n","var name = \"vega-themes\";\nvar version$1 = \"2.12.1\";\nvar description = \"Themes for stylized Vega and Vega-Lite visualizations.\";\nvar keywords = [\n\t\"vega\",\n\t\"vega-lite\",\n\t\"themes\",\n\t\"style\"\n];\nvar license = \"BSD-3-Clause\";\nvar author = {\n\tname: \"UW Interactive Data Lab\",\n\turl: \"https://idl.cs.washington.edu\"\n};\nvar contributors = [\n\t{\n\t\tname: \"Emily Gu\",\n\t\turl: \"https://github.com/emilygu\"\n\t},\n\t{\n\t\tname: \"Arvind Satyanarayan\",\n\t\turl: \"http://arvindsatya.com\"\n\t},\n\t{\n\t\tname: \"Jeffrey Heer\",\n\t\turl: \"https://idl.cs.washington.edu\"\n\t},\n\t{\n\t\tname: \"Dominik Moritz\",\n\t\turl: \"https://www.domoritz.de\"\n\t}\n];\nvar main = \"build/vega-themes.js\";\nvar module = \"build/vega-themes.module.js\";\nvar unpkg = \"build/vega-themes.min.js\";\nvar jsdelivr = \"build/vega-themes.min.js\";\nvar types = \"build/vega-themes.module.d.ts\";\nvar repository = {\n\ttype: \"git\",\n\turl: \"https://github.com/vega/vega-themes.git\"\n};\nvar files = [\n\t\"src\",\n\t\"build\"\n];\nvar scripts = {\n\tprebuild: \"yarn clean\",\n\tbuild: \"rollup -c\",\n\tclean: \"rimraf build && rimraf examples/build\",\n\t\"copy:data\": \"rsync -r node_modules/vega-datasets/data/* examples/data\",\n\t\"copy:build\": \"rsync -r build/* examples/build\",\n\t\"deploy:gh\": \"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples\",\n\tpreversion: \"yarn lint\",\n\tserve: \"browser-sync start -s -f build examples --serveStatic examples\",\n\tstart: \"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'\",\n\tprepare: \"beemo create-config\",\n\teslintbase: \"beemo eslint .\",\n\tformat: \"yarn eslintbase --fix\",\n\tlint: \"yarn eslintbase\",\n\trelease: \"release-it\"\n};\nvar devDependencies = {\n\t\"@release-it/conventional-changelog\": \"^5.1.1\",\n\t\"@rollup/plugin-json\": \"^6.0.0\",\n\t\"@rollup/plugin-node-resolve\": \"^15.0.1\",\n\t\"@rollup/plugin-terser\": \"^0.4.0\",\n\t\"browser-sync\": \"^2.27.10\",\n\tconcurrently: \"^7.3.0\",\n\t\"gh-pages\": \"^5.0.0\",\n\t\"release-it\": \"^15.6.0\",\n\t\"rollup-plugin-bundle-size\": \"^1.0.3\",\n\t\"rollup-plugin-ts\": \"^3.0.2\",\n\trollup: \"^3.15.0\",\n\ttypescript: \"^4.7.4\",\n\t\"vega-lite-dev-config\": \"^0.21.0\",\n\t\"vega-lite\": \"^5.0.0\",\n\tvega: \"^5.19.1\"\n};\nvar peerDependencies = {\n\tvega: \"*\",\n\t\"vega-lite\": \"*\"\n};\nvar dependencies = {\n};\nvar pkg = {\n\tname: name,\n\tversion: version$1,\n\tdescription: description,\n\tkeywords: keywords,\n\tlicense: license,\n\tauthor: author,\n\tcontributors: contributors,\n\tmain: main,\n\tmodule: module,\n\tunpkg: unpkg,\n\tjsdelivr: jsdelivr,\n\ttypes: types,\n\trepository: repository,\n\tfiles: files,\n\tscripts: scripts,\n\tdevDependencies: devDependencies,\n\tpeerDependencies: peerDependencies,\n\tdependencies: dependencies\n};\n\nconst lightColor = '#fff';\nconst medColor = '#888';\nconst darkTheme = {\n background: '#333',\n view: {\n stroke: medColor,\n },\n title: {\n color: lightColor,\n subtitleColor: lightColor,\n },\n style: {\n 'guide-label': {\n fill: lightColor,\n },\n 'guide-title': {\n fill: lightColor,\n },\n },\n axis: {\n domainColor: lightColor,\n gridColor: medColor,\n tickColor: lightColor,\n },\n};\n\nconst markColor$7 = '#4572a7';\nconst excelTheme = {\n background: '#fff',\n arc: { fill: markColor$7 },\n area: { fill: markColor$7 },\n line: { stroke: markColor$7, strokeWidth: 2 },\n path: { stroke: markColor$7 },\n rect: { fill: markColor$7 },\n shape: { stroke: markColor$7 },\n symbol: { fill: markColor$7, strokeWidth: 1.5, size: 50 },\n axis: {\n bandPosition: 0.5,\n grid: true,\n gridColor: '#000000',\n gridOpacity: 1,\n gridWidth: 0.5,\n labelPadding: 10,\n tickSize: 5,\n tickWidth: 0.5,\n },\n axisBand: {\n grid: false,\n tickExtra: true,\n },\n legend: {\n labelBaseline: 'middle',\n labelFontSize: 11,\n symbolSize: 50,\n symbolType: 'square',\n },\n range: {\n category: [\n '#4572a7',\n '#aa4643',\n '#8aa453',\n '#71598e',\n '#4598ae',\n '#d98445',\n '#94aace',\n '#d09393',\n '#b9cc98',\n '#a99cbc',\n ],\n },\n};\n\nconst markColor$6 = '#30a2da';\nconst axisColor$2 = '#cbcbcb';\nconst guideLabelColor = '#999';\nconst guideTitleColor = '#333';\nconst backgroundColor$2 = '#f0f0f0';\nconst blackTitle = '#333';\nconst fiveThirtyEightTheme = {\n arc: { fill: markColor$6 },\n area: { fill: markColor$6 },\n axis: {\n domainColor: axisColor$2,\n grid: true,\n gridColor: axisColor$2,\n gridWidth: 1,\n labelColor: guideLabelColor,\n labelFontSize: 10,\n titleColor: guideTitleColor,\n tickColor: axisColor$2,\n tickSize: 10,\n titleFontSize: 14,\n titlePadding: 10,\n labelPadding: 4,\n },\n axisBand: {\n grid: false,\n },\n background: backgroundColor$2,\n group: {\n fill: backgroundColor$2,\n },\n legend: {\n labelColor: blackTitle,\n labelFontSize: 11,\n padding: 1,\n symbolSize: 30,\n symbolType: 'square',\n titleColor: blackTitle,\n titleFontSize: 14,\n titlePadding: 10,\n },\n line: {\n stroke: markColor$6,\n strokeWidth: 2,\n },\n path: { stroke: markColor$6, strokeWidth: 0.5 },\n rect: { fill: markColor$6 },\n range: {\n category: [\n '#30a2da',\n '#fc4f30',\n '#e5ae38',\n '#6d904f',\n '#8b8b8b',\n '#b96db8',\n '#ff9e27',\n '#56cc60',\n '#52d2ca',\n '#52689e',\n '#545454',\n '#9fe4f8',\n ],\n diverging: ['#cc0020', '#e77866', '#f6e7e1', '#d6e8ed', '#91bfd9', '#1d78b5'],\n heatmap: ['#d6e8ed', '#cee0e5', '#91bfd9', '#549cc6', '#1d78b5'],\n },\n point: {\n filled: true,\n shape: 'circle',\n },\n shape: { stroke: markColor$6 },\n bar: {\n binSpacing: 2,\n fill: markColor$6,\n stroke: null,\n },\n title: {\n anchor: 'start',\n fontSize: 24,\n fontWeight: 600,\n offset: 20,\n },\n};\n\nconst markColor$5 = '#000';\nconst ggplot2Theme = {\n group: {\n fill: '#e5e5e5',\n },\n arc: { fill: markColor$5 },\n area: { fill: markColor$5 },\n line: { stroke: markColor$5 },\n path: { stroke: markColor$5 },\n rect: { fill: markColor$5 },\n shape: { stroke: markColor$5 },\n symbol: { fill: markColor$5, size: 40 },\n axis: {\n domain: false,\n grid: true,\n gridColor: '#FFFFFF',\n gridOpacity: 1,\n labelColor: '#7F7F7F',\n labelPadding: 4,\n tickColor: '#7F7F7F',\n tickSize: 5.67,\n titleFontSize: 16,\n titleFontWeight: 'normal',\n },\n legend: {\n labelBaseline: 'middle',\n labelFontSize: 11,\n symbolSize: 40,\n },\n range: {\n category: [\n '#000000',\n '#7F7F7F',\n '#1A1A1A',\n '#999999',\n '#333333',\n '#B0B0B0',\n '#4D4D4D',\n '#C9C9C9',\n '#666666',\n '#DCDCDC',\n ],\n },\n};\n\nconst headlineFontSize = 22;\nconst headlineFontWeight = 'normal';\nconst labelFont$1 = 'Benton Gothic, sans-serif';\nconst labelFontSize = 11.5;\nconst labelFontWeight = 'normal';\nconst markColor$4 = '#82c6df';\n// const markHighlight = '#006d8f';\n// const markDemocrat = '#5789b8';\n// const markRepublican = '#d94f54';\nconst titleFont = 'Benton Gothic Bold, sans-serif';\nconst titleFontWeight = 'normal';\nconst titleFontSize$1 = 13;\nconst colorSchemes$1 = {\n 'category-6': ['#ec8431', '#829eb1', '#c89d29', '#3580b1', '#adc839', '#ab7fb4'],\n 'fire-7': ['#fbf2c7', '#f9e39c', '#f8d36e', '#f4bb6a', '#e68a4f', '#d15a40', '#ab4232'],\n 'fireandice-6': ['#e68a4f', '#f4bb6a', '#f9e39c', '#dadfe2', '#a6b7c6', '#849eae'],\n 'ice-7': ['#edefee', '#dadfe2', '#c4ccd2', '#a6b7c6', '#849eae', '#607785', '#47525d'],\n};\nconst latimesTheme = {\n background: '#ffffff',\n title: {\n anchor: 'start',\n color: '#000000',\n font: titleFont,\n fontSize: headlineFontSize,\n fontWeight: headlineFontWeight,\n },\n arc: { fill: markColor$4 },\n area: { fill: markColor$4 },\n line: { stroke: markColor$4, strokeWidth: 2 },\n path: { stroke: markColor$4 },\n rect: { fill: markColor$4 },\n shape: { stroke: markColor$4 },\n symbol: { fill: markColor$4, size: 30 },\n axis: {\n labelFont: labelFont$1,\n labelFontSize,\n labelFontWeight,\n titleFont,\n titleFontSize: titleFontSize$1,\n titleFontWeight,\n },\n axisX: {\n labelAngle: 0,\n labelPadding: 4,\n tickSize: 3,\n },\n axisY: {\n labelBaseline: 'middle',\n maxExtent: 45,\n minExtent: 45,\n tickSize: 2,\n titleAlign: 'left',\n titleAngle: 0,\n titleX: -45,\n titleY: -11,\n },\n legend: {\n labelFont: labelFont$1,\n labelFontSize,\n symbolType: 'square',\n titleFont,\n titleFontSize: titleFontSize$1,\n titleFontWeight,\n },\n range: {\n category: colorSchemes$1['category-6'],\n diverging: colorSchemes$1['fireandice-6'],\n heatmap: colorSchemes$1['fire-7'],\n ordinal: colorSchemes$1['fire-7'],\n ramp: colorSchemes$1['fire-7'],\n },\n};\n\nconst markColor$3 = '#ab5787';\nconst axisColor$1 = '#979797';\nconst quartzTheme = {\n background: '#f9f9f9',\n arc: { fill: markColor$3 },\n area: { fill: markColor$3 },\n line: { stroke: markColor$3 },\n path: { stroke: markColor$3 },\n rect: { fill: markColor$3 },\n shape: { stroke: markColor$3 },\n symbol: { fill: markColor$3, size: 30 },\n axis: {\n domainColor: axisColor$1,\n domainWidth: 0.5,\n gridWidth: 0.2,\n labelColor: axisColor$1,\n tickColor: axisColor$1,\n tickWidth: 0.2,\n titleColor: axisColor$1,\n },\n axisBand: {\n grid: false,\n },\n axisX: {\n grid: true,\n tickSize: 10,\n },\n axisY: {\n domain: false,\n grid: true,\n tickSize: 0,\n },\n legend: {\n labelFontSize: 11,\n padding: 1,\n symbolSize: 30,\n symbolType: 'square',\n },\n range: {\n category: [\n '#ab5787',\n '#51b2e5',\n '#703c5c',\n '#168dd9',\n '#d190b6',\n '#00609f',\n '#d365ba',\n '#154866',\n '#666666',\n '#c4c4c4',\n ],\n },\n};\n\nconst markColor$2 = '#3e5c69';\nconst voxTheme = {\n background: '#fff',\n arc: { fill: markColor$2 },\n area: { fill: markColor$2 },\n line: { stroke: markColor$2 },\n path: { stroke: markColor$2 },\n rect: { fill: markColor$2 },\n shape: { stroke: markColor$2 },\n symbol: { fill: markColor$2 },\n axis: {\n domainWidth: 0.5,\n grid: true,\n labelPadding: 2,\n tickSize: 5,\n tickWidth: 0.5,\n titleFontWeight: 'normal',\n },\n axisBand: {\n grid: false,\n },\n axisX: {\n gridWidth: 0.2,\n },\n axisY: {\n gridDash: [3],\n gridWidth: 0.4,\n },\n legend: {\n labelFontSize: 11,\n padding: 1,\n symbolType: 'square',\n },\n range: {\n category: ['#3e5c69', '#6793a6', '#182429', '#0570b0', '#3690c0', '#74a9cf', '#a6bddb', '#e2ddf2'],\n },\n};\n\nconst markColor$1 = '#1696d2';\nconst axisColor = '#000000';\nconst backgroundColor$1 = '#FFFFFF';\nconst font = 'Lato';\nconst labelFont = 'Lato';\nconst sourceFont = 'Lato';\nconst gridColor$1 = '#DEDDDD';\nconst titleFontSize = 18;\nconst colorSchemes = {\n 'main-colors': ['#1696d2', '#d2d2d2', '#000000', '#fdbf11', '#ec008b', '#55b748', '#5c5859', '#db2b27'],\n 'shades-blue': ['#CFE8F3', '#A2D4EC', '#73BFE2', '#46ABDB', '#1696D2', '#12719E', '#0A4C6A', '#062635'],\n 'shades-gray': ['#F5F5F5', '#ECECEC', '#E3E3E3', '#DCDBDB', '#D2D2D2', '#9D9D9D', '#696969', '#353535'],\n 'shades-yellow': ['#FFF2CF', '#FCE39E', '#FDD870', '#FCCB41', '#FDBF11', '#E88E2D', '#CA5800', '#843215'],\n 'shades-magenta': ['#F5CBDF', '#EB99C2', '#E46AA7', '#E54096', '#EC008B', '#AF1F6B', '#761548', '#351123'],\n 'shades-green': ['#DCEDD9', '#BCDEB4', '#98CF90', '#78C26D', '#55B748', '#408941', '#2C5C2D', '#1A2E19'],\n 'shades-black': ['#D5D5D4', '#ADABAC', '#848081', '#5C5859', '#332D2F', '#262223', '#1A1717', '#0E0C0D'],\n 'shades-red': ['#F8D5D4', '#F1AAA9', '#E9807D', '#E25552', '#DB2B27', '#A4201D', '#6E1614', '#370B0A'],\n 'one-group': ['#1696d2', '#000000'],\n 'two-groups-cat-1': ['#1696d2', '#000000'],\n 'two-groups-cat-2': ['#1696d2', '#fdbf11'],\n 'two-groups-cat-3': ['#1696d2', '#db2b27'],\n 'two-groups-seq': ['#a2d4ec', '#1696d2'],\n 'three-groups-cat': ['#1696d2', '#fdbf11', '#000000'],\n 'three-groups-seq': ['#a2d4ec', '#1696d2', '#0a4c6a'],\n 'four-groups-cat-1': ['#000000', '#d2d2d2', '#fdbf11', '#1696d2'],\n 'four-groups-cat-2': ['#1696d2', '#ec0008b', '#fdbf11', '#5c5859'],\n 'four-groups-seq': ['#cfe8f3', '#73bf42', '#1696d2', '#0a4c6a'],\n 'five-groups-cat-1': ['#1696d2', '#fdbf11', '#d2d2d2', '#ec008b', '#000000'],\n 'five-groups-cat-2': ['#1696d2', '#0a4c6a', '#d2d2d2', '#fdbf11', '#332d2f'],\n 'five-groups-seq': ['#cfe8f3', '#73bf42', '#1696d2', '#0a4c6a', '#000000'],\n 'six-groups-cat-1': ['#1696d2', '#ec008b', '#fdbf11', '#000000', '#d2d2d2', '#55b748'],\n 'six-groups-cat-2': ['#1696d2', '#d2d2d2', '#ec008b', '#fdbf11', '#332d2f', '#0a4c6a'],\n 'six-groups-seq': ['#cfe8f3', '#a2d4ec', '#73bfe2', '#46abdb', '#1696d2', '#12719e'],\n 'diverging-colors': ['#ca5800', '#fdbf11', '#fdd870', '#fff2cf', '#cfe8f3', '#73bfe2', '#1696d2', '#0a4c6a'],\n};\nconst urbanInstituteTheme = {\n background: backgroundColor$1,\n title: {\n anchor: 'start',\n fontSize: titleFontSize,\n font: font,\n },\n axisX: {\n domain: true,\n domainColor: axisColor,\n domainWidth: 1,\n grid: false,\n labelFontSize: 12,\n labelFont: labelFont,\n labelAngle: 0,\n tickColor: axisColor,\n tickSize: 5,\n titleFontSize: 12,\n titlePadding: 10,\n titleFont: font,\n },\n axisY: {\n domain: false,\n domainWidth: 1,\n grid: true,\n gridColor: gridColor$1,\n gridWidth: 1,\n labelFontSize: 12,\n labelFont: labelFont,\n labelPadding: 8,\n ticks: false,\n titleFontSize: 12,\n titlePadding: 10,\n titleFont: font,\n titleAngle: 0,\n titleY: -10,\n titleX: 18,\n },\n legend: {\n labelFontSize: 12,\n labelFont: labelFont,\n symbolSize: 100,\n titleFontSize: 12,\n titlePadding: 10,\n titleFont: font,\n orient: 'right',\n offset: 10,\n },\n view: {\n stroke: 'transparent',\n },\n range: {\n category: colorSchemes['six-groups-cat-1'],\n diverging: colorSchemes['diverging-colors'],\n heatmap: colorSchemes['diverging-colors'],\n ordinal: colorSchemes['six-groups-seq'],\n ramp: colorSchemes['shades-blue'],\n },\n area: {\n fill: markColor$1,\n },\n rect: {\n fill: markColor$1,\n },\n line: {\n color: markColor$1,\n stroke: markColor$1,\n strokeWidth: 5,\n },\n trail: {\n color: markColor$1,\n stroke: markColor$1,\n strokeWidth: 0,\n size: 1,\n },\n path: {\n stroke: markColor$1,\n strokeWidth: 0.5,\n },\n point: {\n filled: true,\n },\n text: {\n font: sourceFont,\n color: markColor$1,\n fontSize: 11,\n align: 'center',\n fontWeight: 400,\n size: 11,\n },\n style: {\n bar: {\n fill: markColor$1,\n stroke: null,\n },\n },\n arc: { fill: markColor$1 },\n shape: { stroke: markColor$1 },\n symbol: { fill: markColor$1, size: 30 },\n};\n\n/**\n * Copyright 2020 Google LLC.\n *\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file or at\n * https://developers.google.com/open-source/licenses/bsd\n */\nconst markColor = '#3366CC';\nconst gridColor = '#ccc';\nconst defaultFont = 'Arial, sans-serif';\nconst googlechartsTheme = {\n arc: { fill: markColor },\n area: { fill: markColor },\n path: { stroke: markColor },\n rect: { fill: markColor },\n shape: { stroke: markColor },\n symbol: { stroke: markColor },\n circle: { fill: markColor },\n background: '#fff',\n padding: {\n top: 10,\n right: 10,\n bottom: 10,\n left: 10,\n },\n style: {\n 'guide-label': {\n font: defaultFont,\n fontSize: 12,\n },\n 'guide-title': {\n font: defaultFont,\n fontSize: 12,\n },\n 'group-title': {\n font: defaultFont,\n fontSize: 12,\n },\n },\n title: {\n font: defaultFont,\n fontSize: 14,\n fontWeight: 'bold',\n dy: -3,\n anchor: 'start',\n },\n axis: {\n gridColor: gridColor,\n tickColor: gridColor,\n domain: false,\n grid: true,\n },\n range: {\n category: [\n '#4285F4',\n '#DB4437',\n '#F4B400',\n '#0F9D58',\n '#AB47BC',\n '#00ACC1',\n '#FF7043',\n '#9E9D24',\n '#5C6BC0',\n '#F06292',\n '#00796B',\n '#C2185B',\n ],\n heatmap: ['#c6dafc', '#5e97f6', '#2a56c6'],\n },\n};\n\nconst ptToPx = (value) => value * (1 / 3 + 1);\nconst fontSmallPx = ptToPx(9);\nconst legendFontPx = ptToPx(10);\nconst fontLargePx = ptToPx(12);\nconst fontStandard = 'Segoe UI';\nconst fontTitle = 'wf_standard-font, helvetica, arial, sans-serif';\nconst firstLevelElementColor = '#252423';\nconst secondLevelElementColor = '#605E5C';\nconst backgroundColor = 'transparent';\nconst backgroundSecondaryColor = '#C8C6C4';\nconst paletteColor1 = '#118DFF';\nconst paletteColor2 = '#12239E';\nconst paletteColor3 = '#E66C37';\nconst paletteColor4 = '#6B007B';\nconst paletteColor5 = '#E044A7';\nconst paletteColor6 = '#744EC2';\nconst paletteColor7 = '#D9B300';\nconst paletteColor8 = '#D64550';\nconst divergentColorMax = paletteColor1;\nconst divergentColorMin = '#DEEFFF';\nconst divergentPalette = [divergentColorMin, divergentColorMax];\nconst ordinalPalette = [\n divergentColorMin,\n '#c7e4ff',\n '#b0d9ff',\n '#9aceff',\n '#83c3ff',\n '#6cb9ff',\n '#55aeff',\n '#3fa3ff',\n '#2898ff',\n divergentColorMax,\n];\nconst powerbiTheme = {\n view: { stroke: backgroundColor },\n background: backgroundColor,\n font: fontStandard,\n header: {\n titleFont: fontTitle,\n titleFontSize: fontLargePx,\n titleColor: firstLevelElementColor,\n labelFont: fontStandard,\n labelFontSize: legendFontPx,\n labelColor: secondLevelElementColor,\n },\n axis: {\n ticks: false,\n grid: false,\n domain: false,\n labelColor: secondLevelElementColor,\n labelFontSize: fontSmallPx,\n titleFont: fontTitle,\n titleColor: firstLevelElementColor,\n titleFontSize: fontLargePx,\n titleFontWeight: 'normal',\n },\n axisQuantitative: {\n tickCount: 3,\n grid: true,\n gridColor: backgroundSecondaryColor,\n gridDash: [1, 5],\n labelFlush: false,\n },\n axisBand: { tickExtra: true },\n axisX: { labelPadding: 5 },\n axisY: { labelPadding: 10 },\n bar: { fill: paletteColor1 },\n line: {\n stroke: paletteColor1,\n strokeWidth: 3,\n strokeCap: 'round',\n strokeJoin: 'round',\n },\n text: { font: fontStandard, fontSize: fontSmallPx, fill: secondLevelElementColor },\n arc: { fill: paletteColor1 },\n area: { fill: paletteColor1, line: true, opacity: 0.6 },\n path: { stroke: paletteColor1 },\n rect: { fill: paletteColor1 },\n point: { fill: paletteColor1, filled: true, size: 75 },\n shape: { stroke: paletteColor1 },\n symbol: { fill: paletteColor1, strokeWidth: 1.5, size: 50 },\n legend: {\n titleFont: fontStandard,\n titleFontWeight: 'bold',\n titleColor: secondLevelElementColor,\n labelFont: fontStandard,\n labelFontSize: legendFontPx,\n labelColor: secondLevelElementColor,\n symbolType: 'circle',\n symbolSize: 75,\n },\n range: {\n category: [\n paletteColor1,\n paletteColor2,\n paletteColor3,\n paletteColor4,\n paletteColor5,\n paletteColor6,\n paletteColor7,\n paletteColor8,\n ],\n diverging: divergentPalette,\n heatmap: divergentPalette,\n ordinal: ordinalPalette,\n },\n};\n\nconst version = pkg.version;\n\nexport { darkTheme as dark, excelTheme as excel, fiveThirtyEightTheme as fivethirtyeight, ggplot2Theme as ggplot2, googlechartsTheme as googlecharts, latimesTheme as latimes, powerbiTheme as powerbi, quartzTheme as quartz, urbanInstituteTheme as urbaninstitute, version, voxTheme as vox };\n","import { isArray, isString, isObject } from 'vega-util';\n\nvar name = \"vega-tooltip\";\nvar version$1 = \"0.30.1\";\nvar description = \"A tooltip plugin for Vega-Lite and Vega visualizations.\";\nvar keywords = [\n\t\"vega-lite\",\n\t\"vega\",\n\t\"tooltip\"\n];\nvar repository = {\n\ttype: \"git\",\n\turl: \"https://github.com/vega/vega-tooltip.git\"\n};\nvar author = {\n\tname: \"UW Interactive Data Lab\",\n\turl: \"https://idl.cs.washington.edu\"\n};\nvar collaborators = [\n\t\"Dominik Moritz\",\n\t\"Sira Horradarn\",\n\t\"Zening Qu\",\n\t\"Kanit Wongsuphasawat\",\n\t\"Yuri Astrakhan\",\n\t\"Jeffrey Heer\"\n];\nvar license = \"BSD-3-Clause\";\nvar bugs = {\n\turl: \"https://github.com/vega/vega-tooltip/issues\"\n};\nvar homepage = \"https://github.com/vega/vega-tooltip#readme\";\nvar main = \"build/vega-tooltip.js\";\nvar module = \"build/vega-tooltip.module.js\";\nvar unpkg = \"build/vega-tooltip.min.js\";\nvar jsdelivr = \"build/vega-tooltip.min.js\";\nvar types = \"build/vega-tooltip.module.d.ts\";\nvar files = [\n\t\"src\",\n\t\"build\",\n\t\"types\"\n];\nvar scripts = {\n\tprebuild: \"yarn clean && yarn build:style\",\n\tbuild: \"rollup -c\",\n\t\"build:style\": \"./build-style.sh\",\n\tclean: \"rimraf build && rimraf src/style.ts\",\n\t\"copy:data\": \"rsync -r node_modules/vega-datasets/data/* examples/data\",\n\t\"copy:build\": \"rsync -r build/* examples/build\",\n\t\"deploy:gh\": \"yarn build && yarn copy:build && gh-pages -d examples && yarn clean\",\n\tprepublishOnly: \"yarn clean && yarn build\",\n\tpreversion: \"yarn lint && yarn test\",\n\tserve: \"browser-sync start -s -f build examples --serveStatic examples\",\n\tstart: \"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'\",\n\tpretest: \"yarn build:style\",\n\ttest: \"beemo jest\",\n\t\"test:inspect\": \"node --inspect-brk ./node_modules/.bin/jest --runInBand\",\n\tprepare: \"beemo create-config && yarn copy:data\",\n\tprettierbase: \"beemo prettier '*.{css,scss,html}'\",\n\teslintbase: \"beemo eslint .\",\n\tformat: \"yarn eslintbase --fix && yarn prettierbase --write\",\n\tlint: \"yarn eslintbase && yarn prettierbase --check\",\n\trelease: \"release-it\"\n};\nvar devDependencies = {\n\t\"@release-it/conventional-changelog\": \"^5.1.1\",\n\t\"@rollup/plugin-json\": \"^6.0.0\",\n\t\"@rollup/plugin-node-resolve\": \"^15.0.1\",\n\t\"release-it\": \"^15.6.0\",\n\t\"browser-sync\": \"^2.27.11\",\n\tconcurrently: \"^7.6.0\",\n\t\"gh-pages\": \"^5.0.0\",\n\t\"jest-environment-jsdom\": \"^29.4.2\",\n\tpath: \"^0.12.7\",\n\trollup: \"^3.15.0\",\n\t\"rollup-plugin-bundle-size\": \"^1.0.3\",\n\t\"@rollup/plugin-terser\": \"^0.4.0\",\n\t\"rollup-plugin-ts\": \"^3.2.0\",\n\tsass: \"^1.58.0\",\n\ttypescript: \"~4.9.5\",\n\t\"vega-datasets\": \"^2.5.4\",\n\t\"vega-lite-dev-config\": \"^0.21.0\",\n\t\"vega-typings\": \"^0.22.3\"\n};\nvar dependencies = {\n\t\"vega-util\": \"^1.17.0\"\n};\nvar pkg = {\n\tname: name,\n\tversion: version$1,\n\tdescription: description,\n\tkeywords: keywords,\n\trepository: repository,\n\tauthor: author,\n\tcollaborators: collaborators,\n\tlicense: license,\n\tbugs: bugs,\n\thomepage: homepage,\n\tmain: main,\n\tmodule: module,\n\tunpkg: unpkg,\n\tjsdelivr: jsdelivr,\n\ttypes: types,\n\tfiles: files,\n\tscripts: scripts,\n\tdevDependencies: devDependencies,\n\tdependencies: dependencies\n};\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\n\n/**\n * Format the value to be shown in the tooltip.\n *\n * @param value The value to show in the tooltip.\n * @param valueToHtml Function to convert a single cell value to an HTML string\n */\nfunction formatValue(value, valueToHtml, maxDepth) {\n if (isArray(value)) {\n return `[${value.map((v) => valueToHtml(isString(v) ? v : stringify(v, maxDepth))).join(', ')}]`;\n }\n if (isObject(value)) {\n let content = '';\n const _a = value, { title, image } = _a, rest = __rest(_a, [\"title\", \"image\"]);\n if (title) {\n content += `

${valueToHtml(title)}

`;\n }\n if (image) {\n content += ``;\n }\n const keys = Object.keys(rest);\n if (keys.length > 0) {\n content += '';\n for (const key of keys) {\n let val = rest[key];\n // ignore undefined properties\n if (val === undefined) {\n continue;\n }\n if (isObject(val)) {\n val = stringify(val, maxDepth);\n }\n content += ``;\n }\n content += `
${valueToHtml(key)}:${valueToHtml(val)}
`;\n }\n return content || '{}'; // show empty object if there are no properties\n }\n return valueToHtml(value);\n}\nfunction replacer(maxDepth) {\n const stack = [];\n return function (key, value) {\n if (typeof value !== 'object' || value === null) {\n return value;\n }\n const pos = stack.indexOf(this) + 1;\n stack.length = pos;\n if (stack.length > maxDepth) {\n return '[Object]';\n }\n if (stack.indexOf(value) >= 0) {\n return '[Circular]';\n }\n stack.push(value);\n return value;\n };\n}\n/**\n * Stringify any JS object to valid JSON\n */\nfunction stringify(obj, maxDepth) {\n return JSON.stringify(obj, replacer(maxDepth));\n}\n\n// generated with build-style.sh\nvar defaultStyle = `#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black;\n}\n#vg-tooltip-element.visible {\n visibility: visible;\n}\n#vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px;\n}\n#vg-tooltip-element img {\n max-width: 200px;\n max-height: 200px;\n}\n#vg-tooltip-element table {\n border-spacing: 0;\n}\n#vg-tooltip-element table tr {\n border: none;\n}\n#vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px;\n}\n#vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px;\n}\n#vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left;\n}\n#vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white;\n}\n#vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf;\n}\n`;\n\nconst EL_ID = 'vg-tooltip-element';\nconst DEFAULT_OPTIONS = {\n /**\n * X offset.\n */\n offsetX: 10,\n /**\n * Y offset.\n */\n offsetY: 10,\n /**\n * ID of the tooltip element.\n */\n id: EL_ID,\n /**\n * ID of the tooltip CSS style.\n */\n styleId: 'vega-tooltip-style',\n /**\n * The name of the theme. You can use the CSS class called [THEME]-theme to style the tooltips.\n *\n * There are two predefined themes: \"light\" (default) and \"dark\".\n */\n theme: 'light',\n /**\n * Do not use the default styles provided by Vega Tooltip. If you enable this option, you need to use your own styles. It is not necessary to disable the default style when using a custom theme.\n */\n disableDefaultStyle: false,\n /**\n * HTML sanitizer function that removes dangerous HTML to prevent XSS.\n *\n * This should be a function from string to string. You may replace it with a formatter such as a markdown formatter.\n */\n sanitize: escapeHTML,\n /**\n * The maximum recursion depth when printing objects in the tooltip.\n */\n maxDepth: 2,\n /**\n * A function to customize the rendered HTML of the tooltip.\n * @param value A value string, or object of value strings keyed by field\n * @param sanitize The `sanitize` function from `options.sanitize`\n * @returns {string} The returned string will become the `innerHTML` of the tooltip element\n */\n formatTooltip: formatValue,\n};\n/**\n * Escape special HTML characters.\n *\n * @param value A value to convert to string and HTML-escape.\n */\nfunction escapeHTML(value) {\n return String(value).replace(/&/g, '&').replace(/ window.innerWidth) {\n x = +event.clientX - offsetX - tooltipBox.width;\n }\n let y = event.clientY + offsetY;\n if (y + tooltipBox.height > window.innerHeight) {\n y = +event.clientY - offsetY - tooltipBox.height;\n }\n return { x, y };\n}\n\n/**\n * The tooltip handler class.\n */\nclass Handler {\n /**\n * Create the tooltip handler and initialize the element and style.\n *\n * @param options Tooltip Options\n */\n constructor(options) {\n this.options = Object.assign(Object.assign({}, DEFAULT_OPTIONS), options);\n const elementId = this.options.id;\n this.el = null;\n // bind this to call\n this.call = this.tooltipHandler.bind(this);\n // prepend a default stylesheet for tooltips to the head\n if (!this.options.disableDefaultStyle && !document.getElementById(this.options.styleId)) {\n const style = document.createElement('style');\n style.setAttribute('id', this.options.styleId);\n style.innerHTML = createDefaultStyle(elementId);\n const head = document.head;\n if (head.childNodes.length > 0) {\n head.insertBefore(style, head.childNodes[0]);\n }\n else {\n head.appendChild(style);\n }\n }\n }\n /**\n * The tooltip handler function.\n */\n tooltipHandler(handler, event, item, value) {\n // console.log(handler, event, item, value);\n var _a;\n // append a div element that we use as a tooltip unless it already exists\n this.el = document.getElementById(this.options.id);\n if (!this.el) {\n this.el = document.createElement('div');\n this.el.setAttribute('id', this.options.id);\n this.el.classList.add('vg-tooltip');\n const tooltipContainer = (_a = document.fullscreenElement) !== null && _a !== void 0 ? _a : document.body;\n tooltipContainer.appendChild(this.el);\n }\n // hide tooltip for null, undefined, or empty string values\n if (value == null || value === '') {\n this.el.classList.remove('visible', `${this.options.theme}-theme`);\n return;\n }\n // set the tooltip content\n this.el.innerHTML = this.options.formatTooltip(value, this.options.sanitize, this.options.maxDepth);\n // make the tooltip visible\n this.el.classList.add('visible', `${this.options.theme}-theme`);\n const { x, y } = calculatePosition(event, this.el.getBoundingClientRect(), this.options.offsetX, this.options.offsetY);\n this.el.style.top = `${y}px`;\n this.el.style.left = `${x}px`;\n }\n}\n\nconst version = pkg.version;\n/**\n * Create a tooltip handler and register it with the provided view.\n *\n * @param view The Vega view.\n * @param opt Tooltip options.\n */\nfunction index (view, opt) {\n const handler = new Handler(opt);\n view.tooltip(handler.call).run();\n return handler;\n}\n\nexport { DEFAULT_OPTIONS, Handler, calculatePosition, createDefaultStyle, index as default, escapeHTML, formatValue, replacer, stringify, version };\n//# sourceMappingURL=vega-tooltip.module.js.map\n","import { applyPatch } from 'fast-json-patch';\nimport stringify from 'json-stringify-pretty-compact';\nimport * as vegaImport from 'vega';\nimport { writeConfig, mergeConfig, isString, isBoolean, isObject } from 'vega';\nimport { expressionInterpreter } from 'vega-interpreter';\nimport * as vegaLiteImport from 'vega-lite';\nimport schemaParser from 'vega-schema-url-parser';\nimport * as themes from 'vega-themes';\nimport { Handler } from 'vega-tooltip';\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\nfunction _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\n\nfunction _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}\n\nfunction _defineProperty(obj, key, value) {\n key = _toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar Op = Object.prototype;\nvar hasOwn = Op.hasOwnProperty;\nvar undefined$1; // More compressible than void 0.\nvar $Symbol = typeof Symbol === \"function\" ? Symbol : {};\nvar iteratorSymbol = $Symbol.iterator || \"@@iterator\";\nvar asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\nvar toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\nfunction wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n return generator;\n}\n\n// Try/catch helper to minimize deoptimizations. Returns a completion\n// record like context.tryEntries[i].completion. This interface could\n// have been (and was previously) designed to take a closure to be\n// invoked without arguments, but in all the cases we care about we\n// already have an existing method we want to call, so there's no need\n// to create a new function object. We can even get away with assuming\n// the method takes exactly one argument, since that happens to be true\n// in every case, so we don't have to touch the arguments object. The\n// only additional allocation required is the completion record, which\n// has a stable shape and so hopefully should be cheap to allocate.\nfunction tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n}\nvar GenStateSuspendedStart = \"suspendedStart\";\nvar GenStateSuspendedYield = \"suspendedYield\";\nvar GenStateExecuting = \"executing\";\nvar GenStateCompleted = \"completed\";\n\n// Returning this object from the innerFn has the same effect as\n// breaking out of the dispatch switch statement.\nvar ContinueSentinel = {};\n\n// Dummy constructor functions that we use as the .constructor and\n// .constructor.prototype properties for functions that return Generator\n// objects. For full spec compliance, you may wish to configure your\n// minifier not to mangle the names of these two functions.\nfunction Generator() {}\nfunction GeneratorFunction() {}\nfunction GeneratorFunctionPrototype() {}\n\n// This is a polyfill for %IteratorPrototype% for environments that\n// don't natively support it.\nvar IteratorPrototype = {};\nIteratorPrototype[iteratorSymbol] = function () {\n return this;\n};\nvar getProto = Object.getPrototypeOf;\nvar NativeIteratorPrototype = getProto && getProto(getProto(values([])));\nif (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n}\nvar Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);\nGeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\nGeneratorFunctionPrototype.constructor = GeneratorFunction;\nGeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = \"GeneratorFunction\";\n\n// Helper for defining the .next, .throw, and .return methods of the\n// Iterator interface in terms of a single ._invoke method.\nfunction defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n}\nfunction isGeneratorFunction(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\" : false;\n}\nfunction mark(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n}\n\n// Within the body of any async function, `await x` is transformed to\n// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n// `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n// meant to be awaited.\nfunction awrap(arg) {\n return {\n __await: arg\n };\n}\nfunction AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value && typeof value === \"object\" && hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function (value) {\n invoke(\"next\", value, resolve, reject);\n }, function (err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n return PromiseImpl.resolve(value).then(function (unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function (error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n var previousPromise;\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function (resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n}\ndefineIteratorMethods(AsyncIterator.prototype);\nAsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n};\n\n// Note that simple async functions are implemented on top of\n// AsyncIterator objects; they just return a Promise for the value of\n// the final result produced by the iterator.\nfunction async(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);\n return isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function (result) {\n return result.done ? result.value : iter.next();\n });\n}\nfunction makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n context.method = method;\n context.arg = arg;\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n context.dispatchException(context.arg);\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n state = GenStateExecuting;\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done ? GenStateCompleted : GenStateSuspendedYield;\n if (record.arg === ContinueSentinel) {\n continue;\n }\n return {\n value: record.arg,\n done: context.done\n };\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n}\n\n// Call delegate.iterator[context.method](context.arg) and handle the\n// result, either by returning a { value, done } result from the\n// delegate iterator, or by modifying context.method and context.arg,\n// setting context.delegate to null, and returning the ContinueSentinel.\nfunction maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined$1) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined$1;\n maybeInvokeDelegate(delegate, context);\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n context.method = \"throw\";\n context.arg = new TypeError(\"The iterator does not provide a 'throw' method\");\n }\n return ContinueSentinel;\n }\n var record = tryCatch(method, delegate.iterator, context.arg);\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n var info = record.arg;\n if (!info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined$1;\n }\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n}\n\n// Define Generator.prototype.{next,throw,return} in terms of the\n// unified ._invoke helper method.\ndefineIteratorMethods(Gp);\nGp[toStringTagSymbol] = \"Generator\";\n\n// A Generator should always return itself as the iterator object when the\n// @@iterator function is called on it. Some browsers' implementations of the\n// iterator prototype chain incorrectly implement this, causing the Generator\n// object to not be returned from this call. This ensures that doesn't happen.\n// See https://github.com/facebook/regenerator/issues/274 for more details.\nGp[iteratorSymbol] = function () {\n return this;\n};\nGp.toString = function () {\n return \"[object Generator]\";\n};\nfunction pushTryEntry(locs) {\n var entry = {\n tryLoc: locs[0]\n };\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n this.tryEntries.push(entry);\n}\nfunction resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n}\nfunction Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{\n tryLoc: \"root\"\n }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n}\nfunction keys(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n}\nfunction values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n if (!isNaN(iterable.length)) {\n var i = -1,\n next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n next.value = undefined$1;\n next.done = true;\n return next;\n };\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return {\n next: doneResult\n };\n}\nfunction doneResult() {\n return {\n value: undefined$1,\n done: true\n };\n}\nContext.prototype = {\n constructor: Context,\n reset: function reset(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined$1;\n this.done = false;\n this.delegate = null;\n this.method = \"next\";\n this.arg = undefined$1;\n this.tryEntries.forEach(resetTryEntry);\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {\n this[name] = undefined$1;\n }\n }\n }\n },\n stop: function stop() {\n this.done = true;\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n return this.rval;\n },\n dispatchException: function dispatchException(exception) {\n if (this.done) {\n throw exception;\n }\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined$1;\n }\n return !!caught;\n }\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n abrupt: function abrupt(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n if (finallyEntry && (type === \"break\" || type === \"continue\") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n return this.complete(record);\n },\n complete: function complete(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n if (record.type === \"break\" || record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n return ContinueSentinel;\n },\n finish: function finish(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n \"catch\": function _catch(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined$1;\n }\n return ContinueSentinel;\n }\n};\n\n// Export a default namespace that plays well with Rollup\nvar _regeneratorRuntime = {\n wrap,\n isGeneratorFunction,\n AsyncIterator,\n mark,\n awrap,\n async,\n keys,\n values\n};\n\nvar iterator;\nvar hasRequiredIterator;\nfunction requireIterator() {\n if (hasRequiredIterator) return iterator;\n hasRequiredIterator = 1;\n iterator = function iterator(Yallist) {\n Yallist.prototype[Symbol.iterator] = /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {\n var walker;\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n walker = this.head;\n case 1:\n if (!walker) {\n _context.next = 7;\n break;\n }\n _context.next = 4;\n return walker.value;\n case 4:\n walker = walker.next;\n _context.next = 1;\n break;\n case 7:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n });\n };\n return iterator;\n}\n\nvar yallist = Yallist$1;\nYallist$1.Node = Node;\nYallist$1.create = Yallist$1;\nfunction Yallist$1(list) {\n var self = this;\n if (!(self instanceof Yallist$1)) {\n self = new Yallist$1();\n }\n self.tail = null;\n self.head = null;\n self.length = 0;\n if (list && typeof list.forEach === 'function') {\n list.forEach(function (item) {\n self.push(item);\n });\n } else if (arguments.length > 0) {\n for (var i = 0, l = arguments.length; i < l; i++) {\n self.push(arguments[i]);\n }\n }\n return self;\n}\nYallist$1.prototype.removeNode = function (node) {\n if (node.list !== this) {\n throw new Error('removing node which does not belong to this list');\n }\n var next = node.next;\n var prev = node.prev;\n if (next) {\n next.prev = prev;\n }\n if (prev) {\n prev.next = next;\n }\n if (node === this.head) {\n this.head = next;\n }\n if (node === this.tail) {\n this.tail = prev;\n }\n node.list.length--;\n node.next = null;\n node.prev = null;\n node.list = null;\n return next;\n};\nYallist$1.prototype.unshiftNode = function (node) {\n if (node === this.head) {\n return;\n }\n if (node.list) {\n node.list.removeNode(node);\n }\n var head = this.head;\n node.list = this;\n node.next = head;\n if (head) {\n head.prev = node;\n }\n this.head = node;\n if (!this.tail) {\n this.tail = node;\n }\n this.length++;\n};\nYallist$1.prototype.pushNode = function (node) {\n if (node === this.tail) {\n return;\n }\n if (node.list) {\n node.list.removeNode(node);\n }\n var tail = this.tail;\n node.list = this;\n node.prev = tail;\n if (tail) {\n tail.next = node;\n }\n this.tail = node;\n if (!this.head) {\n this.head = node;\n }\n this.length++;\n};\nYallist$1.prototype.push = function () {\n for (var i = 0, l = arguments.length; i < l; i++) {\n push(this, arguments[i]);\n }\n return this.length;\n};\nYallist$1.prototype.unshift = function () {\n for (var i = 0, l = arguments.length; i < l; i++) {\n unshift(this, arguments[i]);\n }\n return this.length;\n};\nYallist$1.prototype.pop = function () {\n if (!this.tail) {\n return undefined;\n }\n var res = this.tail.value;\n this.tail = this.tail.prev;\n if (this.tail) {\n this.tail.next = null;\n } else {\n this.head = null;\n }\n this.length--;\n return res;\n};\nYallist$1.prototype.shift = function () {\n if (!this.head) {\n return undefined;\n }\n var res = this.head.value;\n this.head = this.head.next;\n if (this.head) {\n this.head.prev = null;\n } else {\n this.tail = null;\n }\n this.length--;\n return res;\n};\nYallist$1.prototype.forEach = function (fn, thisp) {\n thisp = thisp || this;\n for (var walker = this.head, i = 0; walker !== null; i++) {\n fn.call(thisp, walker.value, i, this);\n walker = walker.next;\n }\n};\nYallist$1.prototype.forEachReverse = function (fn, thisp) {\n thisp = thisp || this;\n for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {\n fn.call(thisp, walker.value, i, this);\n walker = walker.prev;\n }\n};\nYallist$1.prototype.get = function (n) {\n for (var i = 0, walker = this.head; walker !== null && i < n; i++) {\n // abort out of the list early if we hit a cycle\n walker = walker.next;\n }\n if (i === n && walker !== null) {\n return walker.value;\n }\n};\nYallist$1.prototype.getReverse = function (n) {\n for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {\n // abort out of the list early if we hit a cycle\n walker = walker.prev;\n }\n if (i === n && walker !== null) {\n return walker.value;\n }\n};\nYallist$1.prototype.map = function (fn, thisp) {\n thisp = thisp || this;\n var res = new Yallist$1();\n for (var walker = this.head; walker !== null;) {\n res.push(fn.call(thisp, walker.value, this));\n walker = walker.next;\n }\n return res;\n};\nYallist$1.prototype.mapReverse = function (fn, thisp) {\n thisp = thisp || this;\n var res = new Yallist$1();\n for (var walker = this.tail; walker !== null;) {\n res.push(fn.call(thisp, walker.value, this));\n walker = walker.prev;\n }\n return res;\n};\nYallist$1.prototype.reduce = function (fn, initial) {\n var acc;\n var walker = this.head;\n if (arguments.length > 1) {\n acc = initial;\n } else if (this.head) {\n walker = this.head.next;\n acc = this.head.value;\n } else {\n throw new TypeError('Reduce of empty list with no initial value');\n }\n for (var i = 0; walker !== null; i++) {\n acc = fn(acc, walker.value, i);\n walker = walker.next;\n }\n return acc;\n};\nYallist$1.prototype.reduceReverse = function (fn, initial) {\n var acc;\n var walker = this.tail;\n if (arguments.length > 1) {\n acc = initial;\n } else if (this.tail) {\n walker = this.tail.prev;\n acc = this.tail.value;\n } else {\n throw new TypeError('Reduce of empty list with no initial value');\n }\n for (var i = this.length - 1; walker !== null; i--) {\n acc = fn(acc, walker.value, i);\n walker = walker.prev;\n }\n return acc;\n};\nYallist$1.prototype.toArray = function () {\n var arr = new Array(this.length);\n for (var i = 0, walker = this.head; walker !== null; i++) {\n arr[i] = walker.value;\n walker = walker.next;\n }\n return arr;\n};\nYallist$1.prototype.toArrayReverse = function () {\n var arr = new Array(this.length);\n for (var i = 0, walker = this.tail; walker !== null; i++) {\n arr[i] = walker.value;\n walker = walker.prev;\n }\n return arr;\n};\nYallist$1.prototype.slice = function (from, to) {\n to = to || this.length;\n if (to < 0) {\n to += this.length;\n }\n from = from || 0;\n if (from < 0) {\n from += this.length;\n }\n var ret = new Yallist$1();\n if (to < from || to < 0) {\n return ret;\n }\n if (from < 0) {\n from = 0;\n }\n if (to > this.length) {\n to = this.length;\n }\n for (var i = 0, walker = this.head; walker !== null && i < from; i++) {\n walker = walker.next;\n }\n for (; walker !== null && i < to; i++, walker = walker.next) {\n ret.push(walker.value);\n }\n return ret;\n};\nYallist$1.prototype.sliceReverse = function (from, to) {\n to = to || this.length;\n if (to < 0) {\n to += this.length;\n }\n from = from || 0;\n if (from < 0) {\n from += this.length;\n }\n var ret = new Yallist$1();\n if (to < from || to < 0) {\n return ret;\n }\n if (from < 0) {\n from = 0;\n }\n if (to > this.length) {\n to = this.length;\n }\n for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {\n walker = walker.prev;\n }\n for (; walker !== null && i > from; i--, walker = walker.prev) {\n ret.push(walker.value);\n }\n return ret;\n};\nYallist$1.prototype.splice = function (start, deleteCount) {\n if (start > this.length) {\n start = this.length - 1;\n }\n if (start < 0) {\n start = this.length + start;\n }\n for (var i = 0, walker = this.head; walker !== null && i < start; i++) {\n walker = walker.next;\n }\n var ret = [];\n for (var i = 0; walker && i < deleteCount; i++) {\n ret.push(walker.value);\n walker = this.removeNode(walker);\n }\n if (walker === null) {\n walker = this.tail;\n }\n if (walker !== this.head && walker !== this.tail) {\n walker = walker.prev;\n }\n for (var i = 0; i < (arguments.length <= 2 ? 0 : arguments.length - 2); i++) {\n walker = insert(this, walker, i + 2 < 2 || arguments.length <= i + 2 ? undefined : arguments[i + 2]);\n }\n return ret;\n};\nYallist$1.prototype.reverse = function () {\n var head = this.head;\n var tail = this.tail;\n for (var walker = head; walker !== null; walker = walker.prev) {\n var p = walker.prev;\n walker.prev = walker.next;\n walker.next = p;\n }\n this.head = tail;\n this.tail = head;\n return this;\n};\nfunction insert(self, node, value) {\n var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self);\n if (inserted.next === null) {\n self.tail = inserted;\n }\n if (inserted.prev === null) {\n self.head = inserted;\n }\n self.length++;\n return inserted;\n}\nfunction push(self, item) {\n self.tail = new Node(item, self.tail, null, self);\n if (!self.head) {\n self.head = self.tail;\n }\n self.length++;\n}\nfunction unshift(self, item) {\n self.head = new Node(item, null, self.head, self);\n if (!self.tail) {\n self.tail = self.head;\n }\n self.length++;\n}\nfunction Node(value, prev, next, list) {\n if (!(this instanceof Node)) {\n return new Node(value, prev, next, list);\n }\n this.list = list;\n this.value = value;\n if (prev) {\n prev.next = this;\n this.prev = prev;\n } else {\n this.prev = null;\n }\n if (next) {\n next.prev = this;\n this.next = next;\n } else {\n this.next = null;\n }\n}\ntry {\n // add if support for Symbol.iterator is present\n requireIterator()(Yallist$1);\n} catch (er) {}\n\n// A linked list to keep track of recently-used-ness\nvar Yallist = yallist;\nvar MAX = Symbol('max');\nvar LENGTH = Symbol('length');\nvar LENGTH_CALCULATOR = Symbol('lengthCalculator');\nvar ALLOW_STALE = Symbol('allowStale');\nvar MAX_AGE = Symbol('maxAge');\nvar DISPOSE = Symbol('dispose');\nvar NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet');\nvar LRU_LIST = Symbol('lruList');\nvar CACHE = Symbol('cache');\nvar UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet');\nvar naiveLength = () => 1;\n\n// lruList is a yallist where the head is the youngest\n// item, and the tail is the oldest. the list contains the Hit\n// objects as the entries.\n// Each Hit object has a reference to its Yallist.Node. This\n// never changes.\n//\n// cache is a Map (or PseudoMap) that matches the keys to\n// the Yallist.Node object.\nclass LRUCache {\n constructor(options) {\n if (typeof options === 'number') options = {\n max: options\n };\n if (!options) options = {};\n if (options.max && (typeof options.max !== 'number' || options.max < 0)) throw new TypeError('max must be a non-negative number');\n // Kind of weird to have a default max of Infinity, but oh well.\n this[MAX] = options.max || Infinity;\n var lc = options.length || naiveLength;\n this[LENGTH_CALCULATOR] = typeof lc !== 'function' ? naiveLength : lc;\n this[ALLOW_STALE] = options.stale || false;\n if (options.maxAge && typeof options.maxAge !== 'number') throw new TypeError('maxAge must be a number');\n this[MAX_AGE] = options.maxAge || 0;\n this[DISPOSE] = options.dispose;\n this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;\n this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;\n this.reset();\n }\n\n // resize the cache when the max changes.\n set max(mL) {\n if (typeof mL !== 'number' || mL < 0) throw new TypeError('max must be a non-negative number');\n this[MAX] = mL || Infinity;\n trim(this);\n }\n get max() {\n return this[MAX];\n }\n set allowStale(allowStale) {\n this[ALLOW_STALE] = !!allowStale;\n }\n get allowStale() {\n return this[ALLOW_STALE];\n }\n set maxAge(mA) {\n if (typeof mA !== 'number') throw new TypeError('maxAge must be a non-negative number');\n this[MAX_AGE] = mA;\n trim(this);\n }\n get maxAge() {\n return this[MAX_AGE];\n }\n\n // resize the cache when the lengthCalculator changes.\n set lengthCalculator(lC) {\n if (typeof lC !== 'function') lC = naiveLength;\n if (lC !== this[LENGTH_CALCULATOR]) {\n this[LENGTH_CALCULATOR] = lC;\n this[LENGTH] = 0;\n this[LRU_LIST].forEach(hit => {\n hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);\n this[LENGTH] += hit.length;\n });\n }\n trim(this);\n }\n get lengthCalculator() {\n return this[LENGTH_CALCULATOR];\n }\n get length() {\n return this[LENGTH];\n }\n get itemCount() {\n return this[LRU_LIST].length;\n }\n rforEach(fn, thisp) {\n thisp = thisp || this;\n for (var walker = this[LRU_LIST].tail; walker !== null;) {\n var prev = walker.prev;\n forEachStep(this, fn, walker, thisp);\n walker = prev;\n }\n }\n forEach(fn, thisp) {\n thisp = thisp || this;\n for (var walker = this[LRU_LIST].head; walker !== null;) {\n var next = walker.next;\n forEachStep(this, fn, walker, thisp);\n walker = next;\n }\n }\n keys() {\n return this[LRU_LIST].toArray().map(k => k.key);\n }\n values() {\n return this[LRU_LIST].toArray().map(k => k.value);\n }\n reset() {\n if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {\n this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value));\n }\n this[CACHE] = new Map(); // hash of items by key\n this[LRU_LIST] = new Yallist(); // list of items in order of use recency\n this[LENGTH] = 0; // length of items in the list\n }\n\n dump() {\n return this[LRU_LIST].map(hit => isStale(this, hit) ? false : {\n k: hit.key,\n v: hit.value,\n e: hit.now + (hit.maxAge || 0)\n }).toArray().filter(h => h);\n }\n dumpLru() {\n return this[LRU_LIST];\n }\n set(key, value, maxAge) {\n maxAge = maxAge || this[MAX_AGE];\n if (maxAge && typeof maxAge !== 'number') throw new TypeError('maxAge must be a number');\n var now = maxAge ? Date.now() : 0;\n var len = this[LENGTH_CALCULATOR](value, key);\n if (this[CACHE].has(key)) {\n if (len > this[MAX]) {\n del(this, this[CACHE].get(key));\n return false;\n }\n var node = this[CACHE].get(key);\n var item = node.value;\n\n // dispose of the old one before overwriting\n // split out into 2 ifs for better coverage tracking\n if (this[DISPOSE]) {\n if (!this[NO_DISPOSE_ON_SET]) this[DISPOSE](key, item.value);\n }\n item.now = now;\n item.maxAge = maxAge;\n item.value = value;\n this[LENGTH] += len - item.length;\n item.length = len;\n this.get(key);\n trim(this);\n return true;\n }\n var hit = new Entry(key, value, len, now, maxAge);\n\n // oversized objects fall out of cache automatically.\n if (hit.length > this[MAX]) {\n if (this[DISPOSE]) this[DISPOSE](key, value);\n return false;\n }\n this[LENGTH] += hit.length;\n this[LRU_LIST].unshift(hit);\n this[CACHE].set(key, this[LRU_LIST].head);\n trim(this);\n return true;\n }\n has(key) {\n if (!this[CACHE].has(key)) return false;\n var hit = this[CACHE].get(key).value;\n return !isStale(this, hit);\n }\n get(key) {\n return get(this, key, true);\n }\n peek(key) {\n return get(this, key, false);\n }\n pop() {\n var node = this[LRU_LIST].tail;\n if (!node) return null;\n del(this, node);\n return node.value;\n }\n del(key) {\n del(this, this[CACHE].get(key));\n }\n load(arr) {\n // reset the cache\n this.reset();\n var now = Date.now();\n // A previous serialized cache has the most recent items first\n for (var l = arr.length - 1; l >= 0; l--) {\n var hit = arr[l];\n var expiresAt = hit.e || 0;\n if (expiresAt === 0)\n // the item was created without expiration in a non aged cache\n this.set(hit.k, hit.v);else {\n var maxAge = expiresAt - now;\n // dont add already expired items\n if (maxAge > 0) {\n this.set(hit.k, hit.v, maxAge);\n }\n }\n }\n }\n prune() {\n this[CACHE].forEach((value, key) => get(this, key, false));\n }\n}\nvar get = (self, key, doUse) => {\n var node = self[CACHE].get(key);\n if (node) {\n var hit = node.value;\n if (isStale(self, hit)) {\n del(self, node);\n if (!self[ALLOW_STALE]) return undefined;\n } else {\n if (doUse) {\n if (self[UPDATE_AGE_ON_GET]) node.value.now = Date.now();\n self[LRU_LIST].unshiftNode(node);\n }\n }\n return hit.value;\n }\n};\nvar isStale = (self, hit) => {\n if (!hit || !hit.maxAge && !self[MAX_AGE]) return false;\n var diff = Date.now() - hit.now;\n return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE];\n};\nvar trim = self => {\n if (self[LENGTH] > self[MAX]) {\n for (var walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null;) {\n // We know that we're about to delete this one, and also\n // what the next least recently used key will be, so just\n // go ahead and set it now.\n var prev = walker.prev;\n del(self, walker);\n walker = prev;\n }\n }\n};\nvar del = (self, node) => {\n if (node) {\n var hit = node.value;\n if (self[DISPOSE]) self[DISPOSE](hit.key, hit.value);\n self[LENGTH] -= hit.length;\n self[CACHE].delete(hit.key);\n self[LRU_LIST].removeNode(node);\n }\n};\nclass Entry {\n constructor(key, value, length, now, maxAge) {\n this.key = key;\n this.value = value;\n this.length = length;\n this.now = now;\n this.maxAge = maxAge || 0;\n }\n}\nvar forEachStep = (self, fn, node, thisp) => {\n var hit = node.value;\n if (isStale(self, hit)) {\n del(self, node);\n if (!self[ALLOW_STALE]) hit = undefined;\n }\n if (hit) fn.call(thisp, hit.value, hit.key, self);\n};\nvar lruCache = LRUCache;\n\n// parse out just the options we care about so we always get a consistent\n// obj with keys in a consistent order.\nvar opts = ['includePrerelease', 'loose', 'rtl'];\nvar parseOptions$1 = options => !options ? {} : typeof options !== 'object' ? {\n loose: true\n} : opts.filter(k => options[k]).reduce((o, k) => {\n o[k] = true;\n return o;\n}, {});\nvar parseOptions_1 = parseOptions$1;\n\nvar reExports = {};\nvar re$1 = {\n get exports(){ return reExports; },\n set exports(v){ reExports = v; },\n};\n\n// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nvar SEMVER_SPEC_VERSION = '2.0.0';\nvar MAX_LENGTH$1 = 256;\nvar MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */9007199254740991;\n\n// Max safe segment length for coercion.\nvar MAX_SAFE_COMPONENT_LENGTH = 16;\nvar constants = {\n SEMVER_SPEC_VERSION,\n MAX_LENGTH: MAX_LENGTH$1,\n MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,\n MAX_SAFE_COMPONENT_LENGTH\n};\n\nvar debug$1 = typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\\bsemver\\b/i.test(process.env.NODE_DEBUG) ? function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return console.error('SEMVER', ...args);\n} : () => {};\nvar debug_1 = debug$1;\n\n(function (module, exports) {\n var MAX_SAFE_COMPONENT_LENGTH = constants.MAX_SAFE_COMPONENT_LENGTH;\n var debug = debug_1;\n exports = module.exports = {};\n\n // The actual regexps go on exports.re\n var re = exports.re = [];\n var src = exports.src = [];\n var t = exports.t = {};\n var R = 0;\n var createToken = (name, value, isGlobal) => {\n var index = R++;\n debug(name, index, value);\n t[name] = index;\n src[index] = value;\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined);\n };\n\n // The following Regular Expressions can be used for tokenizing,\n // validating, and parsing SemVer version strings.\n\n // ## Numeric Identifier\n // A single `0`, or a non-zero digit followed by zero or more digits.\n\n createToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*');\n createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+');\n\n // ## Non-numeric Identifier\n // Zero or more digits, followed by a letter or hyphen, and then zero or\n // more letters, digits, or hyphens.\n\n createToken('NONNUMERICIDENTIFIER', '\\\\d*[a-zA-Z-][a-zA-Z0-9-]*');\n\n // ## Main Version\n // Three dot-separated numeric identifiers.\n\n createToken('MAINVERSION', \"(\".concat(src[t.NUMERICIDENTIFIER], \")\\\\.\") + \"(\".concat(src[t.NUMERICIDENTIFIER], \")\\\\.\") + \"(\".concat(src[t.NUMERICIDENTIFIER], \")\"));\n createToken('MAINVERSIONLOOSE', \"(\".concat(src[t.NUMERICIDENTIFIERLOOSE], \")\\\\.\") + \"(\".concat(src[t.NUMERICIDENTIFIERLOOSE], \")\\\\.\") + \"(\".concat(src[t.NUMERICIDENTIFIERLOOSE], \")\"));\n\n // ## Pre-release Version Identifier\n // A numeric identifier, or a non-numeric identifier.\n\n createToken('PRERELEASEIDENTIFIER', \"(?:\".concat(src[t.NUMERICIDENTIFIER], \"|\").concat(src[t.NONNUMERICIDENTIFIER], \")\"));\n createToken('PRERELEASEIDENTIFIERLOOSE', \"(?:\".concat(src[t.NUMERICIDENTIFIERLOOSE], \"|\").concat(src[t.NONNUMERICIDENTIFIER], \")\"));\n\n // ## Pre-release Version\n // Hyphen, followed by one or more dot-separated pre-release version\n // identifiers.\n\n createToken('PRERELEASE', \"(?:-(\".concat(src[t.PRERELEASEIDENTIFIER], \"(?:\\\\.\").concat(src[t.PRERELEASEIDENTIFIER], \")*))\"));\n createToken('PRERELEASELOOSE', \"(?:-?(\".concat(src[t.PRERELEASEIDENTIFIERLOOSE], \"(?:\\\\.\").concat(src[t.PRERELEASEIDENTIFIERLOOSE], \")*))\"));\n\n // ## Build Metadata Identifier\n // Any combination of digits, letters, or hyphens.\n\n createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+');\n\n // ## Build Metadata\n // Plus sign, followed by one or more period-separated build metadata\n // identifiers.\n\n createToken('BUILD', \"(?:\\\\+(\".concat(src[t.BUILDIDENTIFIER], \"(?:\\\\.\").concat(src[t.BUILDIDENTIFIER], \")*))\"));\n\n // ## Full Version String\n // A main version, followed optionally by a pre-release version and\n // build metadata.\n\n // Note that the only major, minor, patch, and pre-release sections of\n // the version string are capturing groups. The build metadata is not a\n // capturing group, because it should not ever be used in version\n // comparison.\n\n createToken('FULLPLAIN', \"v?\".concat(src[t.MAINVERSION]).concat(src[t.PRERELEASE], \"?\").concat(src[t.BUILD], \"?\"));\n createToken('FULL', \"^\".concat(src[t.FULLPLAIN], \"$\"));\n\n // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n // common in the npm registry.\n createToken('LOOSEPLAIN', \"[v=\\\\s]*\".concat(src[t.MAINVERSIONLOOSE]).concat(src[t.PRERELEASELOOSE], \"?\").concat(src[t.BUILD], \"?\"));\n createToken('LOOSE', \"^\".concat(src[t.LOOSEPLAIN], \"$\"));\n createToken('GTLT', '((?:<|>)?=?)');\n\n // Something like \"2.*\" or \"1.2.x\".\n // Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n // Only the first item is strictly required.\n createToken('XRANGEIDENTIFIERLOOSE', \"\".concat(src[t.NUMERICIDENTIFIERLOOSE], \"|x|X|\\\\*\"));\n createToken('XRANGEIDENTIFIER', \"\".concat(src[t.NUMERICIDENTIFIER], \"|x|X|\\\\*\"));\n createToken('XRANGEPLAIN', \"[v=\\\\s]*(\".concat(src[t.XRANGEIDENTIFIER], \")\") + \"(?:\\\\.(\".concat(src[t.XRANGEIDENTIFIER], \")\") + \"(?:\\\\.(\".concat(src[t.XRANGEIDENTIFIER], \")\") + \"(?:\".concat(src[t.PRERELEASE], \")?\").concat(src[t.BUILD], \"?\") + \")?)?\");\n createToken('XRANGEPLAINLOOSE', \"[v=\\\\s]*(\".concat(src[t.XRANGEIDENTIFIERLOOSE], \")\") + \"(?:\\\\.(\".concat(src[t.XRANGEIDENTIFIERLOOSE], \")\") + \"(?:\\\\.(\".concat(src[t.XRANGEIDENTIFIERLOOSE], \")\") + \"(?:\".concat(src[t.PRERELEASELOOSE], \")?\").concat(src[t.BUILD], \"?\") + \")?)?\");\n createToken('XRANGE', \"^\".concat(src[t.GTLT], \"\\\\s*\").concat(src[t.XRANGEPLAIN], \"$\"));\n createToken('XRANGELOOSE', \"^\".concat(src[t.GTLT], \"\\\\s*\").concat(src[t.XRANGEPLAINLOOSE], \"$\"));\n\n // Coercion.\n // Extract anything that could conceivably be a part of a valid semver\n createToken('COERCE', \"\".concat('(^|[^\\\\d])' + '(\\\\d{1,').concat(MAX_SAFE_COMPONENT_LENGTH, \"})\") + \"(?:\\\\.(\\\\d{1,\".concat(MAX_SAFE_COMPONENT_LENGTH, \"}))?\") + \"(?:\\\\.(\\\\d{1,\".concat(MAX_SAFE_COMPONENT_LENGTH, \"}))?\") + \"(?:$|[^\\\\d])\");\n createToken('COERCERTL', src[t.COERCE], true);\n\n // Tilde ranges.\n // Meaning is \"reasonably at or greater than\"\n createToken('LONETILDE', '(?:~>?)');\n createToken('TILDETRIM', \"(\\\\s*)\".concat(src[t.LONETILDE], \"\\\\s+\"), true);\n exports.tildeTrimReplace = '$1~';\n createToken('TILDE', \"^\".concat(src[t.LONETILDE]).concat(src[t.XRANGEPLAIN], \"$\"));\n createToken('TILDELOOSE', \"^\".concat(src[t.LONETILDE]).concat(src[t.XRANGEPLAINLOOSE], \"$\"));\n\n // Caret ranges.\n // Meaning is \"at least and backwards compatible with\"\n createToken('LONECARET', '(?:\\\\^)');\n createToken('CARETTRIM', \"(\\\\s*)\".concat(src[t.LONECARET], \"\\\\s+\"), true);\n exports.caretTrimReplace = '$1^';\n createToken('CARET', \"^\".concat(src[t.LONECARET]).concat(src[t.XRANGEPLAIN], \"$\"));\n createToken('CARETLOOSE', \"^\".concat(src[t.LONECARET]).concat(src[t.XRANGEPLAINLOOSE], \"$\"));\n\n // A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\n createToken('COMPARATORLOOSE', \"^\".concat(src[t.GTLT], \"\\\\s*(\").concat(src[t.LOOSEPLAIN], \")$|^$\"));\n createToken('COMPARATOR', \"^\".concat(src[t.GTLT], \"\\\\s*(\").concat(src[t.FULLPLAIN], \")$|^$\"));\n\n // An expression to strip any whitespace between the gtlt and the thing\n // it modifies, so that `> 1.2.3` ==> `>1.2.3`\n createToken('COMPARATORTRIM', \"(\\\\s*)\".concat(src[t.GTLT], \"\\\\s*(\").concat(src[t.LOOSEPLAIN], \"|\").concat(src[t.XRANGEPLAIN], \")\"), true);\n exports.comparatorTrimReplace = '$1$2$3';\n\n // Something like `1.2.3 - 1.2.4`\n // Note that these all use the loose form, because they'll be\n // checked against either the strict or loose comparator form\n // later.\n createToken('HYPHENRANGE', \"^\\\\s*(\".concat(src[t.XRANGEPLAIN], \")\") + \"\\\\s+-\\\\s+\" + \"(\".concat(src[t.XRANGEPLAIN], \")\") + \"\\\\s*$\");\n createToken('HYPHENRANGELOOSE', \"^\\\\s*(\".concat(src[t.XRANGEPLAINLOOSE], \")\") + \"\\\\s+-\\\\s+\" + \"(\".concat(src[t.XRANGEPLAINLOOSE], \")\") + \"\\\\s*$\");\n\n // Star ranges basically just allow anything at all.\n createToken('STAR', '(<|>)?=?\\\\s*\\\\*');\n // >=0.0.0 is like a star\n createToken('GTE0', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$');\n createToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$');\n})(re$1, reExports);\n\nvar numeric = /^[0-9]+$/;\nvar compareIdentifiers$1 = (a, b) => {\n var anum = numeric.test(a);\n var bnum = numeric.test(b);\n if (anum && bnum) {\n a = +a;\n b = +b;\n }\n return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;\n};\nvar rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a);\nvar identifiers = {\n compareIdentifiers: compareIdentifiers$1,\n rcompareIdentifiers\n};\n\nvar debug = debug_1;\nvar MAX_LENGTH = constants.MAX_LENGTH,\n MAX_SAFE_INTEGER = constants.MAX_SAFE_INTEGER;\nvar re = reExports.re,\n t = reExports.t;\nvar parseOptions = parseOptions_1;\nvar compareIdentifiers = identifiers.compareIdentifiers;\nlet SemVer$1 = class SemVer {\n constructor(version, options) {\n options = parseOptions(options);\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {\n return version;\n } else {\n version = version.version;\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(\"Invalid Version: \".concat(version));\n }\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\"version is longer than \".concat(MAX_LENGTH, \" characters\"));\n }\n debug('SemVer', version, options);\n this.options = options;\n this.loose = !!options.loose;\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease;\n var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);\n if (!m) {\n throw new TypeError(\"Invalid Version: \".concat(version));\n }\n this.raw = version;\n\n // these are actually numbers\n this.major = +m[1];\n this.minor = +m[2];\n this.patch = +m[3];\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version');\n }\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version');\n }\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version');\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = [];\n } else {\n this.prerelease = m[4].split('.').map(id => {\n if (/^[0-9]+$/.test(id)) {\n var num = +id;\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num;\n }\n }\n return id;\n });\n }\n this.build = m[5] ? m[5].split('.') : [];\n this.format();\n }\n format() {\n this.version = \"\".concat(this.major, \".\").concat(this.minor, \".\").concat(this.patch);\n if (this.prerelease.length) {\n this.version += \"-\".concat(this.prerelease.join('.'));\n }\n return this.version;\n }\n toString() {\n return this.version;\n }\n compare(other) {\n debug('SemVer.compare', this.version, this.options, other);\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0;\n }\n other = new SemVer(other, this.options);\n }\n if (other.version === this.version) {\n return 0;\n }\n return this.compareMain(other) || this.comparePre(other);\n }\n compareMain(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);\n }\n comparePre(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1;\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1;\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0;\n }\n var i = 0;\n do {\n var a = this.prerelease[i];\n var b = other.prerelease[i];\n debug('prerelease compare', i, a, b);\n if (a === undefined && b === undefined) {\n return 0;\n } else if (b === undefined) {\n return 1;\n } else if (a === undefined) {\n return -1;\n } else if (a === b) {\n continue;\n } else {\n return compareIdentifiers(a, b);\n }\n } while (++i);\n }\n compareBuild(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n var i = 0;\n do {\n var a = this.build[i];\n var b = other.build[i];\n debug('prerelease compare', i, a, b);\n if (a === undefined && b === undefined) {\n return 0;\n } else if (b === undefined) {\n return 1;\n } else if (a === undefined) {\n return -1;\n } else if (a === b) {\n continue;\n } else {\n return compareIdentifiers(a, b);\n }\n } while (++i);\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc(release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor = 0;\n this.major++;\n this.inc('pre', identifier);\n break;\n case 'preminor':\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor++;\n this.inc('pre', identifier);\n break;\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0;\n this.inc('patch', identifier);\n this.inc('pre', identifier);\n break;\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier);\n }\n this.inc('pre', identifier);\n break;\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {\n this.major++;\n }\n this.minor = 0;\n this.patch = 0;\n this.prerelease = [];\n break;\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++;\n }\n this.patch = 0;\n this.prerelease = [];\n break;\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++;\n }\n this.prerelease = [];\n break;\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0];\n } else {\n var i = this.prerelease.length;\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++;\n i = -2;\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0);\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0];\n }\n } else {\n this.prerelease = [identifier, 0];\n }\n }\n break;\n default:\n throw new Error(\"invalid increment argument: \".concat(release));\n }\n this.format();\n this.raw = this.version;\n return this;\n }\n};\nvar semver = SemVer$1;\n\nvar SemVer = semver;\nvar compare$6 = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));\nvar compare_1 = compare$6;\n\nvar compare$5 = compare_1;\nvar eq$1 = (a, b, loose) => compare$5(a, b, loose) === 0;\nvar eq_1 = eq$1;\n\nvar compare$4 = compare_1;\nvar neq$1 = (a, b, loose) => compare$4(a, b, loose) !== 0;\nvar neq_1 = neq$1;\n\nvar compare$3 = compare_1;\nvar gt$1 = (a, b, loose) => compare$3(a, b, loose) > 0;\nvar gt_1 = gt$1;\n\nvar compare$2 = compare_1;\nvar gte$1 = (a, b, loose) => compare$2(a, b, loose) >= 0;\nvar gte_1 = gte$1;\n\nvar compare$1 = compare_1;\nvar lt$1 = (a, b, loose) => compare$1(a, b, loose) < 0;\nvar lt_1 = lt$1;\n\nvar compare = compare_1;\nvar lte$1 = (a, b, loose) => compare(a, b, loose) <= 0;\nvar lte_1 = lte$1;\n\nvar eq = eq_1;\nvar neq = neq_1;\nvar gt = gt_1;\nvar gte = gte_1;\nvar lt = lt_1;\nvar lte = lte_1;\nvar cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object') {\n a = a.version;\n }\n if (typeof b === 'object') {\n b = b.version;\n }\n return a === b;\n case '!==':\n if (typeof a === 'object') {\n a = a.version;\n }\n if (typeof b === 'object') {\n b = b.version;\n }\n return a !== b;\n case '':\n case '=':\n case '==':\n return eq(a, b, loose);\n case '!=':\n return neq(a, b, loose);\n case '>':\n return gt(a, b, loose);\n case '>=':\n return gte(a, b, loose);\n case '<':\n return lt(a, b, loose);\n case '<=':\n return lte(a, b, loose);\n default:\n throw new TypeError(\"Invalid operator: \".concat(op));\n }\n};\nvar cmp_1 = cmp;\n\nvar comparator;\nvar hasRequiredComparator;\nfunction requireComparator() {\n if (hasRequiredComparator) return comparator;\n hasRequiredComparator = 1;\n var ANY = Symbol('SemVer ANY');\n // hoisted class for cyclic dependency\n class Comparator {\n static get ANY() {\n return ANY;\n }\n constructor(comp, options) {\n options = parseOptions(options);\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp;\n } else {\n comp = comp.value;\n }\n }\n debug('comparator', comp, options);\n this.options = options;\n this.loose = !!options.loose;\n this.parse(comp);\n if (this.semver === ANY) {\n this.value = '';\n } else {\n this.value = this.operator + this.semver.version;\n }\n debug('comp', this);\n }\n parse(comp) {\n var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];\n var m = comp.match(r);\n if (!m) {\n throw new TypeError(\"Invalid comparator: \".concat(comp));\n }\n this.operator = m[1] !== undefined ? m[1] : '';\n if (this.operator === '=') {\n this.operator = '';\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY;\n } else {\n this.semver = new SemVer(m[2], this.options.loose);\n }\n }\n toString() {\n return this.value;\n }\n test(version) {\n debug('Comparator.test', version, this.options.loose);\n if (this.semver === ANY || version === ANY) {\n return true;\n }\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options);\n } catch (er) {\n return false;\n }\n }\n return cmp(version, this.operator, this.semver, this.options);\n }\n intersects(comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required');\n }\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n };\n }\n if (this.operator === '') {\n if (this.value === '') {\n return true;\n }\n return new Range(comp.value, options).test(this.value);\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true;\n }\n return new Range(this.value, options).test(comp.semver);\n }\n var sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>');\n var sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<');\n var sameSemVer = this.semver.version === comp.semver.version;\n var differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<=');\n var oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, options) && (this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<');\n var oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, options) && (this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>');\n return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;\n }\n }\n comparator = Comparator;\n var parseOptions = parseOptions_1;\n var re = reExports.re,\n t = reExports.t;\n var cmp = cmp_1;\n var debug = debug_1;\n var SemVer = semver;\n var Range = requireRange();\n return comparator;\n}\n\nfunction _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }\nfunction _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nvar range;\nvar hasRequiredRange;\nfunction requireRange() {\n if (hasRequiredRange) return range;\n hasRequiredRange = 1;\n // hoisted class for cyclic dependency\n class Range {\n constructor(range, options) {\n options = parseOptions(options);\n if (range instanceof Range) {\n if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {\n return range;\n } else {\n return new Range(range.raw, options);\n }\n }\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value;\n this.set = [[range]];\n this.format();\n return this;\n }\n this.options = options;\n this.loose = !!options.loose;\n this.includePrerelease = !!options.includePrerelease;\n\n // First, split based on boolean or ||\n this.raw = range;\n this.set = range.split('||')\n // map the range to a 2d array of comparators\n .map(r => this.parseRange(r.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length);\n if (!this.set.length) {\n throw new TypeError(\"Invalid SemVer Range: \".concat(range));\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n var first = this.set[0];\n this.set = this.set.filter(c => !isNullSet(c[0]));\n if (this.set.length === 0) {\n this.set = [first];\n } else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n var _iterator = _createForOfIteratorHelper$1(this.set),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var c = _step.value;\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c];\n break;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n }\n this.format();\n }\n format() {\n this.range = this.set.map(comps => {\n return comps.join(' ').trim();\n }).join('||').trim();\n return this.range;\n }\n toString() {\n return this.range;\n }\n parseRange(range) {\n range = range.trim();\n\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n var memoOpts = Object.keys(this.options).join(',');\n var memoKey = \"parseRange:\".concat(memoOpts, \":\").concat(range);\n var cached = cache.get(memoKey);\n if (cached) {\n return cached;\n }\n var loose = this.options.loose;\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease));\n debug('hyphen replace', range);\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);\n debug('comparator trim', range);\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace);\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace);\n\n // normalize spaces\n range = range.split(/\\s+/).join(' ');\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n var rangeList = range.split(' ').map(comp => parseComparator(comp, this.options)).join(' ').split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options));\n if (loose) {\n // in loose mode, throw out any that are not valid comparators\n rangeList = rangeList.filter(comp => {\n debug('loose invalid filter', comp, this.options);\n return !!comp.match(re[t.COMPARATORLOOSE]);\n });\n }\n debug('range list', rangeList);\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n var rangeMap = new Map();\n var comparators = rangeList.map(comp => new Comparator(comp, this.options));\n var _iterator2 = _createForOfIteratorHelper$1(comparators),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var comp = _step2.value;\n if (isNullSet(comp)) {\n return [comp];\n }\n rangeMap.set(comp.value, comp);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n if (rangeMap.size > 1 && rangeMap.has('')) {\n rangeMap.delete('');\n }\n var result = [...rangeMap.values()];\n cache.set(memoKey, result);\n return result;\n }\n intersects(range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required');\n }\n return this.set.some(thisComparators => {\n return isSatisfiable(thisComparators, options) && range.set.some(rangeComparators => {\n return isSatisfiable(rangeComparators, options) && thisComparators.every(thisComparator => {\n return rangeComparators.every(rangeComparator => {\n return thisComparator.intersects(rangeComparator, options);\n });\n });\n });\n });\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test(version) {\n if (!version) {\n return false;\n }\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options);\n } catch (er) {\n return false;\n }\n }\n for (var i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true;\n }\n }\n return false;\n }\n }\n range = Range;\n var LRU = lruCache;\n var cache = new LRU({\n max: 1000\n });\n var parseOptions = parseOptions_1;\n var Comparator = requireComparator();\n var debug = debug_1;\n var SemVer = semver;\n var re = reExports.re,\n t = reExports.t,\n comparatorTrimReplace = reExports.comparatorTrimReplace,\n tildeTrimReplace = reExports.tildeTrimReplace,\n caretTrimReplace = reExports.caretTrimReplace;\n var isNullSet = c => c.value === '<0.0.0-0';\n var isAny = c => c.value === '';\n\n // take a set of comparators and determine whether there\n // exists a version which can satisfy it\n var isSatisfiable = (comparators, options) => {\n var result = true;\n var remainingComparators = comparators.slice();\n var testComparator = remainingComparators.pop();\n while (result && remainingComparators.length) {\n result = remainingComparators.every(otherComparator => {\n return testComparator.intersects(otherComparator, options);\n });\n testComparator = remainingComparators.pop();\n }\n return result;\n };\n\n // comprised of xranges, tildes, stars, and gtlt's at this point.\n // already replaced the hyphen ranges\n // turn into a set of JUST comparators.\n var parseComparator = (comp, options) => {\n debug('comp', comp, options);\n comp = replaceCarets(comp, options);\n debug('caret', comp);\n comp = replaceTildes(comp, options);\n debug('tildes', comp);\n comp = replaceXRanges(comp, options);\n debug('xrange', comp);\n comp = replaceStars(comp, options);\n debug('stars', comp);\n return comp;\n };\n var isX = id => !id || id.toLowerCase() === 'x' || id === '*';\n\n // ~, ~> --> * (any, kinda silly)\n // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\n // ~0.0.1 --> >=0.0.1 <0.1.0-0\n var replaceTildes = (comp, options) => comp.trim().split(/\\s+/).map(c => {\n return replaceTilde(c, options);\n }).join(' ');\n var replaceTilde = (comp, options) => {\n var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr);\n var ret;\n if (isX(M)) {\n ret = '';\n } else if (isX(m)) {\n ret = \">=\".concat(M, \".0.0 <\").concat(+M + 1, \".0.0-0\");\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = \">=\".concat(M, \".\").concat(m, \".0 <\").concat(M, \".\").concat(+m + 1, \".0-0\");\n } else if (pr) {\n debug('replaceTilde pr', pr);\n ret = \">=\".concat(M, \".\").concat(m, \".\").concat(p, \"-\").concat(pr, \" <\").concat(M, \".\").concat(+m + 1, \".0-0\");\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = \">=\".concat(M, \".\").concat(m, \".\").concat(p, \" <\").concat(M, \".\").concat(+m + 1, \".0-0\");\n }\n debug('tilde return', ret);\n return ret;\n });\n };\n\n // ^ --> * (any, kinda silly)\n // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n // ^1.2.3 --> >=1.2.3 <2.0.0-0\n // ^1.2.0 --> >=1.2.0 <2.0.0-0\n // ^0.0.1 --> >=0.0.1 <0.0.2-0\n // ^0.1.0 --> >=0.1.0 <0.2.0-0\n var replaceCarets = (comp, options) => comp.trim().split(/\\s+/).map(c => {\n return replaceCaret(c, options);\n }).join(' ');\n var replaceCaret = (comp, options) => {\n debug('caret', comp, options);\n var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];\n var z = options.includePrerelease ? '-0' : '';\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr);\n var ret;\n if (isX(M)) {\n ret = '';\n } else if (isX(m)) {\n ret = \">=\".concat(M, \".0.0\").concat(z, \" <\").concat(+M + 1, \".0.0-0\");\n } else if (isX(p)) {\n if (M === '0') {\n ret = \">=\".concat(M, \".\").concat(m, \".0\").concat(z, \" <\").concat(M, \".\").concat(+m + 1, \".0-0\");\n } else {\n ret = \">=\".concat(M, \".\").concat(m, \".0\").concat(z, \" <\").concat(+M + 1, \".0.0-0\");\n }\n } else if (pr) {\n debug('replaceCaret pr', pr);\n if (M === '0') {\n if (m === '0') {\n ret = \">=\".concat(M, \".\").concat(m, \".\").concat(p, \"-\").concat(pr, \" <\").concat(M, \".\").concat(m, \".\").concat(+p + 1, \"-0\");\n } else {\n ret = \">=\".concat(M, \".\").concat(m, \".\").concat(p, \"-\").concat(pr, \" <\").concat(M, \".\").concat(+m + 1, \".0-0\");\n }\n } else {\n ret = \">=\".concat(M, \".\").concat(m, \".\").concat(p, \"-\").concat(pr, \" <\").concat(+M + 1, \".0.0-0\");\n }\n } else {\n debug('no pr');\n if (M === '0') {\n if (m === '0') {\n ret = \">=\".concat(M, \".\").concat(m, \".\").concat(p).concat(z, \" <\").concat(M, \".\").concat(m, \".\").concat(+p + 1, \"-0\");\n } else {\n ret = \">=\".concat(M, \".\").concat(m, \".\").concat(p).concat(z, \" <\").concat(M, \".\").concat(+m + 1, \".0-0\");\n }\n } else {\n ret = \">=\".concat(M, \".\").concat(m, \".\").concat(p, \" <\").concat(+M + 1, \".0.0-0\");\n }\n }\n debug('caret return', ret);\n return ret;\n });\n };\n var replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options);\n return comp.split(/\\s+/).map(c => {\n return replaceXRange(c, options);\n }).join(' ');\n };\n var replaceXRange = (comp, options) => {\n comp = comp.trim();\n var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr);\n var xM = isX(M);\n var xm = xM || isX(m);\n var xp = xm || isX(p);\n var anyX = xp;\n if (gtlt === '=' && anyX) {\n gtlt = '';\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : '';\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0';\n } else {\n // nothing is forbidden\n ret = '*';\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0;\n }\n p = 0;\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>=';\n if (xm) {\n M = +M + 1;\n m = 0;\n p = 0;\n } else {\n m = +m + 1;\n p = 0;\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<';\n if (xm) {\n M = +M + 1;\n } else {\n m = +m + 1;\n }\n }\n if (gtlt === '<') {\n pr = '-0';\n }\n ret = \"\".concat(gtlt + M, \".\").concat(m, \".\").concat(p).concat(pr);\n } else if (xm) {\n ret = \">=\".concat(M, \".0.0\").concat(pr, \" <\").concat(+M + 1, \".0.0-0\");\n } else if (xp) {\n ret = \">=\".concat(M, \".\").concat(m, \".0\").concat(pr, \" <\").concat(M, \".\").concat(+m + 1, \".0-0\");\n }\n debug('xRange return', ret);\n return ret;\n });\n };\n\n // Because * is AND-ed with everything else in the comparator,\n // and '' means \"any version\", just remove the *s entirely.\n var replaceStars = (comp, options) => {\n debug('replaceStars', comp, options);\n // Looseness is ignored here. star is always as loose as it gets!\n return comp.trim().replace(re[t.STAR], '');\n };\n var replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options);\n return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '');\n };\n\n // This function is passed to string.replace(re[t.HYPHENRANGE])\n // M, m, patch, prerelease, build\n // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n // 1.2 - 3.4 => >=1.2.0 <3.5.0-0\n var hyphenReplace = incPr => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => {\n if (isX(fM)) {\n from = '';\n } else if (isX(fm)) {\n from = \">=\".concat(fM, \".0.0\").concat(incPr ? '-0' : '');\n } else if (isX(fp)) {\n from = \">=\".concat(fM, \".\").concat(fm, \".0\").concat(incPr ? '-0' : '');\n } else if (fpr) {\n from = \">=\".concat(from);\n } else {\n from = \">=\".concat(from).concat(incPr ? '-0' : '');\n }\n if (isX(tM)) {\n to = '';\n } else if (isX(tm)) {\n to = \"<\".concat(+tM + 1, \".0.0-0\");\n } else if (isX(tp)) {\n to = \"<\".concat(tM, \".\").concat(+tm + 1, \".0-0\");\n } else if (tpr) {\n to = \"<=\".concat(tM, \".\").concat(tm, \".\").concat(tp, \"-\").concat(tpr);\n } else if (incPr) {\n to = \"<\".concat(tM, \".\").concat(tm, \".\").concat(+tp + 1, \"-0\");\n } else {\n to = \"<=\".concat(to);\n }\n return \"\".concat(from, \" \").concat(to).trim();\n };\n var testSet = (set, version, options) => {\n for (var i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false;\n }\n }\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (var _i = 0; _i < set.length; _i++) {\n debug(set[_i].semver);\n if (set[_i].semver === Comparator.ANY) {\n continue;\n }\n if (set[_i].semver.prerelease.length > 0) {\n var allowed = set[_i].semver;\n if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {\n return true;\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false;\n }\n return true;\n };\n return range;\n}\n\nvar Range = requireRange();\nvar satisfies = (version, range, options) => {\n try {\n range = new Range(range, options);\n } catch (er) {\n return false;\n }\n return range.test(version);\n};\nvar satisfies_1 = satisfies;\n\n/**\n * Open editor url in a new window, and pass a message.\n */\nfunction post (window, url, data) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n var editor = window.open(url);\n var wait = 10000;\n var step = 250;\n var _URL = new URL(url),\n origin = _URL.origin;\n // eslint-disable-next-line no-bitwise\n var count = ~~(wait / step);\n function listen(evt) {\n if (evt.source === editor) {\n count = 0;\n window.removeEventListener('message', listen, false);\n }\n }\n window.addEventListener('message', listen, false);\n\n // send message\n // periodically resend until ack received or timeout\n function send() {\n if (count <= 0) {\n return;\n }\n editor.postMessage(data, origin);\n setTimeout(send, step);\n count -= 1;\n }\n setTimeout(send, step);\n}\n\n// generated with build-style.sh\nvar embedStyle = \".vega-embed {\\n position: relative;\\n display: inline-block;\\n box-sizing: border-box;\\n}\\n.vega-embed.has-actions {\\n padding-right: 38px;\\n}\\n.vega-embed details:not([open]) > :not(summary) {\\n display: none !important;\\n}\\n.vega-embed summary {\\n list-style: none;\\n position: absolute;\\n top: 0;\\n right: 0;\\n padding: 6px;\\n z-index: 1000;\\n background: white;\\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\\n color: #1b1e23;\\n border: 1px solid #aaa;\\n border-radius: 999px;\\n opacity: 0.2;\\n transition: opacity 0.4s ease-in;\\n cursor: pointer;\\n line-height: 0px;\\n}\\n.vega-embed summary::-webkit-details-marker {\\n display: none;\\n}\\n.vega-embed summary:active {\\n box-shadow: #aaa 0px 0px 0px 1px inset;\\n}\\n.vega-embed summary svg {\\n width: 14px;\\n height: 14px;\\n}\\n.vega-embed details[open] summary {\\n opacity: 0.7;\\n}\\n.vega-embed:hover summary, .vega-embed:focus-within summary {\\n opacity: 1 !important;\\n transition: opacity 0.2s ease;\\n}\\n.vega-embed .vega-actions {\\n position: absolute;\\n z-index: 1001;\\n top: 35px;\\n right: -9px;\\n display: flex;\\n flex-direction: column;\\n padding-bottom: 8px;\\n padding-top: 8px;\\n border-radius: 4px;\\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\\n border: 1px solid #d9d9d9;\\n background: white;\\n animation-duration: 0.15s;\\n animation-name: scale-in;\\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\\n text-align: left;\\n}\\n.vega-embed .vega-actions a {\\n padding: 8px 16px;\\n font-family: sans-serif;\\n font-size: 14px;\\n font-weight: 600;\\n white-space: nowrap;\\n color: #434a56;\\n text-decoration: none;\\n}\\n.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {\\n background-color: #f7f7f9;\\n color: black;\\n}\\n.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\\n content: \\\"\\\";\\n display: inline-block;\\n position: absolute;\\n}\\n.vega-embed .vega-actions::before {\\n left: auto;\\n right: 14px;\\n top: -16px;\\n border: 8px solid rgba(0, 0, 0, 0);\\n border-bottom-color: #d9d9d9;\\n}\\n.vega-embed .vega-actions::after {\\n left: auto;\\n right: 15px;\\n top: -14px;\\n border: 7px solid rgba(0, 0, 0, 0);\\n border-bottom-color: #fff;\\n}\\n.vega-embed .chart-wrapper.fit-x {\\n width: 100%;\\n}\\n.vega-embed .chart-wrapper.fit-y {\\n height: 100%;\\n}\\n\\n.vega-embed-wrapper {\\n max-width: 100%;\\n overflow: auto;\\n padding-right: 14px;\\n}\\n\\n@keyframes scale-in {\\n from {\\n opacity: 0;\\n transform: scale(0.6);\\n }\\n to {\\n opacity: 1;\\n transform: scale(1);\\n }\\n}\\n\";\n\n// polyfill for IE\nif (!String.prototype.startsWith) {\n // eslint-disable-next-line no-extend-native,func-names\n String.prototype.startsWith = function (search, pos) {\n return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\n };\n}\nfunction mergeDeep(dest) {\n for (var _len = arguments.length, src = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n src[_key - 1] = arguments[_key];\n }\n for (var _i = 0, _src = src; _i < _src.length; _i++) {\n var s = _src[_i];\n deepMerge_(dest, s);\n }\n return dest;\n}\nfunction deepMerge_(dest, src) {\n for (var _i2 = 0, _Object$keys = Object.keys(src); _i2 < _Object$keys.length; _i2++) {\n var property = _Object$keys[_i2];\n writeConfig(dest, property, src[property], true);\n }\n}\n\nvar name = \"vega-embed\";\nvar version$1 = \"6.21.3\";\nvar description = \"Publish Vega visualizations as embedded web components.\";\nvar keywords = [\"vega\", \"data\", \"visualization\", \"component\", \"embed\"];\nvar repository = {\n type: \"git\",\n url: \"http://github.com/vega/vega-embed.git\"\n};\nvar author = {\n name: \"UW Interactive Data Lab\",\n url: \"http://idl.cs.washington.edu\"\n};\nvar contributors = [{\n name: \"Dominik Moritz\",\n url: \"https://www.domoritz.de\"\n}];\nvar bugs = {\n url: \"https://github.com/vega/vega-embed/issues\"\n};\nvar homepage = \"https://github.com/vega/vega-embed#readme\";\nvar license = \"BSD-3-Clause\";\nvar main = \"build/vega-embed.js\";\nvar module = \"build/vega-embed.module.js\";\nvar unpkg = \"build/vega-embed.min.js\";\nvar jsdelivr = \"build/vega-embed.min.js\";\nvar types = \"build/vega-embed.module.d.ts\";\nvar files = [\"src\", \"build\", \"build-es5\", \"patches\"];\nvar devDependencies = {\n \"@babel/plugin-transform-runtime\": \"^7.19.6\",\n \"@release-it/conventional-changelog\": \"^5.1.1\",\n \"@rollup/plugin-commonjs\": \"24.0.1\",\n \"@rollup/plugin-json\": \"^6.0.0\",\n \"@rollup/plugin-node-resolve\": \"^15.0.1\",\n \"@rollup/plugin-terser\": \"^0.4.0\",\n \"@types/semver\": \"^7.3.13\",\n \"browser-sync\": \"^2.27.11\",\n concurrently: \"^7.6.0\",\n \"del-cli\": \"^5.0.0\",\n \"jest-canvas-mock\": \"^2.4.0\",\n \"jest-environment-jsdom\": \"^29.4.3\",\n \"patch-package\": \"^6.5.1\",\n \"postinstall-postinstall\": \"^2.1.0\",\n \"release-it\": \"^15.6.0\",\n \"rollup-plugin-bundle-size\": \"^1.0.3\",\n \"rollup-plugin-ts\": \"^3.2.0\",\n rollup: \"3.15.0\",\n sass: \"^1.58.1\",\n typescript: \"^4.9.5\",\n \"vega-lite-dev-config\": \"^0.21.0\",\n \"vega-lite\": \"^5.2.0\",\n vega: \"^5.22.1\"\n};\nvar peerDependencies = {\n vega: \"^5.21.0\",\n \"vega-lite\": \"*\"\n};\nvar dependencies = {\n \"fast-json-patch\": \"^3.1.1\",\n \"json-stringify-pretty-compact\": \"^3.0.0\",\n semver: \"^7.3.8\",\n tslib: \"^2.5.0\",\n \"vega-interpreter\": \"^1.0.4\",\n \"vega-schema-url-parser\": \"^2.2.0\",\n \"vega-themes\": \"^2.12.1\",\n \"vega-tooltip\": \"^0.30.1\"\n};\nvar bundledDependencies = [\"yallist\"];\nvar scripts = {\n prebuild: \"yarn clean && yarn build:style\",\n build: \"rollup -c\",\n \"build:style\": \"./build-style.sh\",\n clean: \"del-cli build build-es5 src/style.ts\",\n prepublishOnly: \"yarn clean && yarn build\",\n preversion: \"yarn lint && yarn test\",\n serve: \"browser-sync start --directory -s -f build *.html\",\n start: \"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'\",\n pretest: \"yarn build:style\",\n test: \"beemo jest --stdio stream\",\n \"test:inspect\": \"node --inspect-brk ./node_modules/.bin/jest --runInBand\",\n prepare: \"beemo create-config && npx patch-package\",\n prettierbase: \"beemo prettier '*.{css,scss,html}'\",\n eslintbase: \"beemo eslint .\",\n format: \"yarn eslintbase --fix && yarn prettierbase --write\",\n lint: \"yarn eslintbase && yarn prettierbase --check\",\n release: \"release-it\"\n};\nvar pkg = {\n name: name,\n version: version$1,\n description: description,\n keywords: keywords,\n repository: repository,\n author: author,\n contributors: contributors,\n bugs: bugs,\n homepage: homepage,\n license: license,\n main: main,\n module: module,\n unpkg: unpkg,\n jsdelivr: jsdelivr,\n types: types,\n files: files,\n devDependencies: devDependencies,\n peerDependencies: peerDependencies,\n dependencies: dependencies,\n bundledDependencies: bundledDependencies,\n scripts: scripts\n};\n\nvar _w$vl;\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nvar version = pkg.version;\nvar vega = vegaImport;\nvar _vegaLite = vegaLiteImport;\nvar w = typeof window !== 'undefined' ? window : undefined;\nif (_vegaLite === undefined && w !== null && w !== void 0 && (_w$vl = w.vl) !== null && _w$vl !== void 0 && _w$vl.compile) {\n _vegaLite = w.vl;\n}\nvar DEFAULT_ACTIONS = {\n export: {\n svg: true,\n png: true\n },\n source: true,\n compiled: true,\n editor: true\n};\nvar I18N = {\n CLICK_TO_VIEW_ACTIONS: 'Click to view actions',\n COMPILED_ACTION: 'View Compiled Vega',\n EDITOR_ACTION: 'Open in Vega Editor',\n PNG_ACTION: 'Save as PNG',\n SOURCE_ACTION: 'View Source',\n SVG_ACTION: 'Save as SVG'\n};\nvar NAMES = {\n vega: 'Vega',\n 'vega-lite': 'Vega-Lite'\n};\nvar VERSION = {\n vega: vega.version,\n 'vega-lite': _vegaLite ? _vegaLite.version : 'not available'\n};\nvar PREPROCESSOR = {\n vega: vgSpec => vgSpec,\n 'vega-lite': (vlSpec, config) => _vegaLite.compile(vlSpec, {\n config: config\n }).spec\n};\nvar SVG_CIRCLES = \"\\n\\n \\n \\n \\n\";\nvar CHART_WRAPPER_CLASS = 'chart-wrapper';\nfunction isTooltipHandler(h) {\n return typeof h === 'function';\n}\nfunction viewSource(source, sourceHeader, sourceFooter, mode) {\n var header = \"\".concat(sourceHeader, \"
\");\n  var footer = \"
\".concat(sourceFooter, \"\");\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n var win = window.open('');\n win.document.write(header + source + footer);\n win.document.title = \"\".concat(NAMES[mode], \" JSON Source\");\n}\n\n/**\n * Try to guess the type of spec.\n *\n * @param spec Vega or Vega-Lite spec.\n */\nfunction guessMode(spec, providedMode) {\n // Decide mode\n if (spec.$schema) {\n var parsed = schemaParser(spec.$schema);\n if (providedMode && providedMode !== parsed.library) {\n var _NAMES$providedMode;\n console.warn(\"The given visualization spec is written in \".concat(NAMES[parsed.library], \", but mode argument sets \").concat((_NAMES$providedMode = NAMES[providedMode]) !== null && _NAMES$providedMode !== void 0 ? _NAMES$providedMode : providedMode, \".\"));\n }\n var mode = parsed.library;\n if (!satisfies_1(VERSION[mode], \"^\".concat(parsed.version.slice(1)))) {\n console.warn(\"The input spec uses \".concat(NAMES[mode], \" \").concat(parsed.version, \", but the current version of \").concat(NAMES[mode], \" is v\").concat(VERSION[mode], \".\"));\n }\n return mode;\n }\n\n // try to guess from the provided spec\n if ('mark' in spec || 'encoding' in spec || 'layer' in spec || 'hconcat' in spec || 'vconcat' in spec || 'facet' in spec || 'repeat' in spec) {\n return 'vega-lite';\n }\n if ('marks' in spec || 'signals' in spec || 'scales' in spec || 'axes' in spec) {\n return 'vega';\n }\n return providedMode !== null && providedMode !== void 0 ? providedMode : 'vega';\n}\nfunction isLoader(o) {\n return !!(o && 'load' in o);\n}\nfunction createLoader(opts) {\n return isLoader(opts) ? opts : vega.loader(opts);\n}\nfunction embedOptionsFromUsermeta(parsedSpec) {\n var _embedOptions, _parsedSpec$usermeta;\n var opts = (_embedOptions = (_parsedSpec$usermeta = parsedSpec.usermeta) === null || _parsedSpec$usermeta === void 0 ? void 0 : _parsedSpec$usermeta.embedOptions) !== null && _embedOptions !== void 0 ? _embedOptions : {};\n if (isString(opts.defaultStyle)) {\n // we don't allow styles set via usermeta since it would allow injection of logic (we set the style via innerHTML)\n opts.defaultStyle = false;\n }\n return opts;\n}\n\n/**\n * Embed a Vega visualization component in a web page. This function returns a promise.\n *\n * @param el DOM element in which to place component (DOM node or CSS selector).\n * @param spec String : A URL string from which to load the Vega specification.\n * Object : The Vega/Vega-Lite specification as a parsed JSON object.\n * @param opts A JavaScript object containing options for embedding.\n */\nfunction embed(_x, _x2) {\n return _embed2.apply(this, arguments);\n}\nfunction _embed2() {\n _embed2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(el, spec) {\n var _parsedOpts$config, _usermetaOpts$config;\n var opts,\n parsedSpec,\n loader,\n loadedEmbedOptions,\n usermetaLoader,\n _opts$loader,\n usermetaOpts,\n parsedOpts,\n mergedOpts,\n _args = arguments;\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n opts = _args.length > 2 && _args[2] !== undefined ? _args[2] : {};\n if (!isString(spec)) {\n _context.next = 10;\n break;\n }\n loader = createLoader(opts.loader);\n _context.t0 = JSON;\n _context.next = 6;\n return loader.load(spec);\n case 6:\n _context.t1 = _context.sent;\n parsedSpec = _context.t0.parse.call(_context.t0, _context.t1);\n _context.next = 11;\n break;\n case 10:\n parsedSpec = spec;\n case 11:\n loadedEmbedOptions = embedOptionsFromUsermeta(parsedSpec);\n usermetaLoader = loadedEmbedOptions.loader; // either create the loader for the first time or create a new loader if the spec has new loader options\n if (!loader || usermetaLoader) {\n loader = createLoader((_opts$loader = opts.loader) !== null && _opts$loader !== void 0 ? _opts$loader : usermetaLoader);\n }\n _context.next = 16;\n return loadOpts(loadedEmbedOptions, loader);\n case 16:\n usermetaOpts = _context.sent;\n _context.next = 19;\n return loadOpts(opts, loader);\n case 19:\n parsedOpts = _context.sent;\n mergedOpts = _objectSpread(_objectSpread({}, mergeDeep(parsedOpts, usermetaOpts)), {}, {\n config: mergeConfig((_parsedOpts$config = parsedOpts.config) !== null && _parsedOpts$config !== void 0 ? _parsedOpts$config : {}, (_usermetaOpts$config = usermetaOpts.config) !== null && _usermetaOpts$config !== void 0 ? _usermetaOpts$config : {})\n });\n _context.next = 23;\n return _embed(el, parsedSpec, mergedOpts, loader);\n case 23:\n return _context.abrupt(\"return\", _context.sent);\n case 24:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _embed2.apply(this, arguments);\n}\nfunction loadOpts(_x3, _x4) {\n return _loadOpts.apply(this, arguments);\n}\nfunction _loadOpts() {\n _loadOpts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(opt, loader) {\n var _opt$config;\n var config, patch;\n return _regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n if (!isString(opt.config)) {\n _context2.next = 8;\n break;\n }\n _context2.t1 = JSON;\n _context2.next = 4;\n return loader.load(opt.config);\n case 4:\n _context2.t2 = _context2.sent;\n _context2.t0 = _context2.t1.parse.call(_context2.t1, _context2.t2);\n _context2.next = 9;\n break;\n case 8:\n _context2.t0 = (_opt$config = opt.config) !== null && _opt$config !== void 0 ? _opt$config : {};\n case 9:\n config = _context2.t0;\n if (!isString(opt.patch)) {\n _context2.next = 18;\n break;\n }\n _context2.t4 = JSON;\n _context2.next = 14;\n return loader.load(opt.patch);\n case 14:\n _context2.t5 = _context2.sent;\n _context2.t3 = _context2.t4.parse.call(_context2.t4, _context2.t5);\n _context2.next = 19;\n break;\n case 18:\n _context2.t3 = opt.patch;\n case 19:\n patch = _context2.t3;\n return _context2.abrupt(\"return\", _objectSpread(_objectSpread(_objectSpread({}, opt), patch ? {\n patch\n } : {}), config ? {\n config\n } : {}));\n case 21:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _loadOpts.apply(this, arguments);\n}\nfunction getRoot(el) {\n var _document$head;\n var possibleRoot = el.getRootNode ? el.getRootNode() : document;\n return possibleRoot instanceof ShadowRoot ? {\n root: possibleRoot,\n rootContainer: possibleRoot\n } : {\n root: document,\n rootContainer: (_document$head = document.head) !== null && _document$head !== void 0 ? _document$head : document.body\n };\n}\nfunction _embed(_x5, _x6) {\n return _embed3.apply(this, arguments);\n}\nfunction _embed3() {\n _embed3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(el, spec) {\n var _opts$config, _opts$actions, _opts$renderer, _opts$logLevel, _opts$downloadFileNam, _ref, _expressionInterprete;\n var opts,\n loader,\n config,\n actions,\n i18n,\n renderer,\n logLevel,\n downloadFileName,\n element,\n ID,\n _getRoot,\n root,\n rootContainer,\n style,\n mode,\n vgSpec,\n parsed,\n container,\n chartWrapper,\n patch,\n name,\n expressionFunction,\n ast,\n runtime,\n view,\n handler,\n hover,\n _ref2,\n hoverSet,\n updateSet,\n documentClickHandler,\n wrapper,\n details,\n summary,\n ctrl,\n _iterator,\n _step,\n _loop,\n viewSourceLink,\n compileLink,\n _opts$editorUrl,\n editorUrl,\n editorLink,\n finalize,\n _args5 = arguments;\n return _regeneratorRuntime.wrap(function _callee4$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n finalize = function _finalize() {\n if (documentClickHandler) {\n document.removeEventListener('click', documentClickHandler);\n }\n view.finalize();\n };\n opts = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};\n loader = _args5.length > 3 ? _args5[3] : undefined;\n config = opts.theme ? mergeConfig(themes[opts.theme], (_opts$config = opts.config) !== null && _opts$config !== void 0 ? _opts$config : {}) : opts.config;\n actions = isBoolean(opts.actions) ? opts.actions : mergeDeep({}, DEFAULT_ACTIONS, (_opts$actions = opts.actions) !== null && _opts$actions !== void 0 ? _opts$actions : {});\n i18n = _objectSpread(_objectSpread({}, I18N), opts.i18n);\n renderer = (_opts$renderer = opts.renderer) !== null && _opts$renderer !== void 0 ? _opts$renderer : 'canvas';\n logLevel = (_opts$logLevel = opts.logLevel) !== null && _opts$logLevel !== void 0 ? _opts$logLevel : vega.Warn;\n downloadFileName = (_opts$downloadFileNam = opts.downloadFileName) !== null && _opts$downloadFileNam !== void 0 ? _opts$downloadFileNam : 'visualization';\n element = typeof el === 'string' ? document.querySelector(el) : el;\n if (element) {\n _context5.next = 12;\n break;\n }\n throw new Error(\"\".concat(el, \" does not exist\"));\n case 12:\n if (opts.defaultStyle !== false) {\n ID = 'vega-embed-style';\n _getRoot = getRoot(element), root = _getRoot.root, rootContainer = _getRoot.rootContainer;\n if (!root.getElementById(ID)) {\n style = document.createElement('style');\n style.id = ID;\n style.innerHTML = opts.defaultStyle === undefined || opts.defaultStyle === true ? (embedStyle ).toString() : opts.defaultStyle;\n rootContainer.appendChild(style);\n }\n }\n mode = guessMode(spec, opts.mode);\n vgSpec = PREPROCESSOR[mode](spec, config);\n if (mode === 'vega-lite') {\n if (vgSpec.$schema) {\n parsed = schemaParser(vgSpec.$schema);\n if (!satisfies_1(VERSION.vega, \"^\".concat(parsed.version.slice(1)))) {\n console.warn(\"The compiled spec uses Vega \".concat(parsed.version, \", but current version is v\").concat(VERSION.vega, \".\"));\n }\n }\n }\n element.classList.add('vega-embed');\n if (actions) {\n element.classList.add('has-actions');\n }\n element.innerHTML = ''; // clear container\n container = element;\n if (actions) {\n chartWrapper = document.createElement('div');\n chartWrapper.classList.add(CHART_WRAPPER_CLASS);\n element.appendChild(chartWrapper);\n container = chartWrapper;\n }\n patch = opts.patch;\n if (patch) {\n vgSpec = patch instanceof Function ? patch(vgSpec) : applyPatch(vgSpec, patch, true, false).newDocument;\n }\n\n // Set locale. Note that this is a global setting.\n if (opts.formatLocale) {\n vega.formatLocale(opts.formatLocale);\n }\n if (opts.timeFormatLocale) {\n vega.timeFormatLocale(opts.timeFormatLocale);\n }\n\n // Set custom expression functions\n if (opts.expressionFunctions) {\n for (name in opts.expressionFunctions) {\n expressionFunction = opts.expressionFunctions[name];\n if ('fn' in expressionFunction) {\n vega.expressionFunction(name, expressionFunction.fn, expressionFunction['visitor']);\n } else if (expressionFunction instanceof Function) {\n vega.expressionFunction(name, expressionFunction);\n }\n }\n }\n ast = opts.ast; // Do not apply the config to Vega when we have already applied it to Vega-Lite.\n // This call may throw an Error if parsing fails.\n runtime = vega.parse(vgSpec, mode === 'vega-lite' ? {} : config, {\n ast\n });\n view = new (opts.viewClass || vega.View)(runtime, _objectSpread({\n loader,\n logLevel,\n renderer\n }, ast ? {\n expr: (_ref = (_expressionInterprete = vega.expressionInterpreter) !== null && _expressionInterprete !== void 0 ? _expressionInterprete : opts.expr) !== null && _ref !== void 0 ? _ref : expressionInterpreter\n } : {}));\n view.addSignalListener('autosize', (_, autosize) => {\n var type = autosize.type;\n if (type == 'fit-x') {\n container.classList.add('fit-x');\n container.classList.remove('fit-y');\n } else if (type == 'fit-y') {\n container.classList.remove('fit-x');\n container.classList.add('fit-y');\n } else if (type == 'fit') {\n container.classList.add('fit-x', 'fit-y');\n } else {\n container.classList.remove('fit-x', 'fit-y');\n }\n });\n if (opts.tooltip !== false) {\n handler = isTooltipHandler(opts.tooltip) ? opts.tooltip :\n // user provided boolean true or tooltip options\n new Handler(opts.tooltip === true ? {} : opts.tooltip).call;\n view.tooltip(handler);\n }\n hover = opts.hover;\n if (hover === undefined) {\n hover = mode === 'vega';\n }\n if (hover) {\n _ref2 = typeof hover === 'boolean' ? {} : hover, hoverSet = _ref2.hoverSet, updateSet = _ref2.updateSet;\n view.hover(hoverSet, updateSet);\n }\n if (opts) {\n if (opts.width != null) {\n view.width(opts.width);\n }\n if (opts.height != null) {\n view.height(opts.height);\n }\n if (opts.padding != null) {\n view.padding(opts.padding);\n }\n }\n _context5.next = 37;\n return view.initialize(container, opts.bind).runAsync();\n case 37:\n if (!(actions !== false)) {\n _context5.next = 63;\n break;\n }\n wrapper = element;\n if (opts.defaultStyle !== false) {\n details = document.createElement('details');\n details.title = i18n.CLICK_TO_VIEW_ACTIONS;\n element.append(details);\n wrapper = details;\n summary = document.createElement('summary');\n summary.innerHTML = SVG_CIRCLES;\n details.append(summary);\n documentClickHandler = ev => {\n if (!details.contains(ev.target)) {\n details.removeAttribute('open');\n }\n };\n document.addEventListener('click', documentClickHandler);\n }\n ctrl = document.createElement('div');\n wrapper.append(ctrl);\n ctrl.classList.add('vega-actions');\n\n // add 'Export' action\n if (!(actions === true || actions.export !== false)) {\n _context5.next = 60;\n break;\n }\n _iterator = _createForOfIteratorHelper(['svg', 'png']);\n _context5.prev = 45;\n _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {\n var ext, i18nExportAction, exportLink, scaleFactor;\n return _regeneratorRuntime.wrap(function _loop$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n ext = _step.value;\n if (actions === true || actions.export === true || actions.export[ext]) {\n i18nExportAction = i18n[\"\".concat(ext.toUpperCase(), \"_ACTION\")];\n exportLink = document.createElement('a');\n scaleFactor = isObject(opts.scaleFactor) ? opts.scaleFactor[ext] : opts.scaleFactor;\n exportLink.text = i18nExportAction;\n exportLink.href = '#';\n exportLink.target = '_blank';\n exportLink.download = \"\".concat(downloadFileName, \".\").concat(ext);\n // add link on mousedown so that it's correct when the click happens\n exportLink.addEventListener('mousedown', /*#__PURE__*/function () {\n var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(e) {\n var url;\n return _regeneratorRuntime.wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n e.preventDefault();\n _context3.next = 3;\n return view.toImageURL(ext, scaleFactor);\n case 3:\n url = _context3.sent;\n this.href = url;\n case 5:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n return function (_x7) {\n return _ref3.apply(this, arguments);\n };\n }());\n ctrl.append(exportLink);\n }\n case 2:\n case \"end\":\n return _context4.stop();\n }\n }, _loop);\n });\n _iterator.s();\n case 48:\n if ((_step = _iterator.n()).done) {\n _context5.next = 52;\n break;\n }\n return _context5.delegateYield(_loop(), \"t0\", 50);\n case 50:\n _context5.next = 48;\n break;\n case 52:\n _context5.next = 57;\n break;\n case 54:\n _context5.prev = 54;\n _context5.t1 = _context5[\"catch\"](45);\n _iterator.e(_context5.t1);\n case 57:\n _context5.prev = 57;\n _iterator.f();\n return _context5.finish(57);\n case 60:\n // add 'View Source' action\n if (actions === true || actions.source !== false) {\n viewSourceLink = document.createElement('a');\n viewSourceLink.text = i18n.SOURCE_ACTION;\n viewSourceLink.href = '#';\n viewSourceLink.addEventListener('click', function (e) {\n var _opts$sourceHeader, _opts$sourceFooter;\n viewSource(stringify(spec), (_opts$sourceHeader = opts.sourceHeader) !== null && _opts$sourceHeader !== void 0 ? _opts$sourceHeader : '', (_opts$sourceFooter = opts.sourceFooter) !== null && _opts$sourceFooter !== void 0 ? _opts$sourceFooter : '', mode);\n e.preventDefault();\n });\n ctrl.append(viewSourceLink);\n }\n\n // add 'View Compiled' action\n if (mode === 'vega-lite' && (actions === true || actions.compiled !== false)) {\n compileLink = document.createElement('a');\n compileLink.text = i18n.COMPILED_ACTION;\n compileLink.href = '#';\n compileLink.addEventListener('click', function (e) {\n var _opts$sourceHeader2, _opts$sourceFooter2;\n viewSource(stringify(vgSpec), (_opts$sourceHeader2 = opts.sourceHeader) !== null && _opts$sourceHeader2 !== void 0 ? _opts$sourceHeader2 : '', (_opts$sourceFooter2 = opts.sourceFooter) !== null && _opts$sourceFooter2 !== void 0 ? _opts$sourceFooter2 : '', 'vega');\n e.preventDefault();\n });\n ctrl.append(compileLink);\n }\n\n // add 'Open in Vega Editor' action\n if (actions === true || actions.editor !== false) {\n editorUrl = (_opts$editorUrl = opts.editorUrl) !== null && _opts$editorUrl !== void 0 ? _opts$editorUrl : 'https://vega.github.io/editor/';\n editorLink = document.createElement('a');\n editorLink.text = i18n.EDITOR_ACTION;\n editorLink.href = '#';\n editorLink.addEventListener('click', function (e) {\n post(window, editorUrl, {\n config: config,\n mode,\n renderer,\n spec: stringify(spec)\n });\n e.preventDefault();\n });\n ctrl.append(editorLink);\n }\n case 63:\n return _context5.abrupt(\"return\", {\n view,\n spec,\n vgSpec,\n finalize,\n embedOptions: opts\n });\n case 64:\n case \"end\":\n return _context5.stop();\n }\n }, _callee4, null, [[45, 54, 57, 60]]);\n }));\n return _embed3.apply(this, arguments);\n}\n\nexport { DEFAULT_ACTIONS, embed as default, guessMode, vega, _vegaLite as vegaLite, version };\n//# sourceMappingURL=vega-embed.module.js.map\n","module.exports = __WEBPACK_EXTERNAL_MODULE__146__;","\"use strict\";\n\n// Note: This regex matches even invalid JSON strings, but since we’re\n// working on the output of `JSON.stringify` we know that only valid strings\n// are present (unless the user supplied a weird `options.indent` but in\n// that case we don’t care since the output would be invalid anyway).\nvar stringOrChar = /(\"(?:[^\\\\\"]|\\\\.)*\")|[:,]/g;\n\nmodule.exports = function stringify(passedObj, options) {\n var indent, maxLength, replacer;\n\n options = options || {};\n indent = JSON.stringify(\n [1],\n undefined,\n options.indent === undefined ? 2 : options.indent\n ).slice(2, -3);\n maxLength =\n indent === \"\"\n ? Infinity\n : options.maxLength === undefined\n ? 80\n : options.maxLength;\n replacer = options.replacer;\n\n return (function _stringify(obj, currentIndent, reserved) {\n // prettier-ignore\n var end, index, items, key, keyPart, keys, length, nextIndent, prettified, start, string, value;\n\n if (obj && typeof obj.toJSON === \"function\") {\n obj = obj.toJSON();\n }\n\n string = JSON.stringify(obj, replacer);\n\n if (string === undefined) {\n return string;\n }\n\n length = maxLength - currentIndent.length - reserved;\n\n if (string.length <= length) {\n prettified = string.replace(\n stringOrChar,\n function (match, stringLiteral) {\n return stringLiteral || match + \" \";\n }\n );\n if (prettified.length <= length) {\n return prettified;\n }\n }\n\n if (replacer != null) {\n obj = JSON.parse(string);\n replacer = undefined;\n }\n\n if (typeof obj === \"object\" && obj !== null) {\n nextIndent = currentIndent + indent;\n items = [];\n index = 0;\n\n if (Array.isArray(obj)) {\n start = \"[\";\n end = \"]\";\n length = obj.length;\n for (; index < length; index++) {\n items.push(\n _stringify(obj[index], nextIndent, index === length - 1 ? 0 : 1) ||\n \"null\"\n );\n }\n } else {\n start = \"{\";\n end = \"}\";\n keys = Object.keys(obj);\n length = keys.length;\n for (; index < length; index++) {\n key = keys[index];\n keyPart = JSON.stringify(key) + \": \";\n value = _stringify(\n obj[key],\n nextIndent,\n keyPart.length + (index === length - 1 ? 0 : 1)\n );\n if (value !== undefined) {\n items.push(keyPart + value);\n }\n }\n }\n\n if (items.length > 0) {\n return [start, indent + items.join(\",\\n\" + nextIndent), end].join(\n \"\\n\" + currentIndent\n );\n }\n }\n\n return string;\n })(passedObj, \"\", 0);\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(607);\n"],"names":["clone","_instanceof","obj","type","nativeMap","nativeSet","nativePromise","Map","_","Set","Promise","parent","circular","depth","prototype","includeNonEnumerable","allParents","allChildren","useBuffer","Buffer","Infinity","_clone","child","proto","resolve","reject","then","value","err","__isArray","__isRegExp","RegExp","source","__getRegExpFlags","lastIndex","__isDate","Date","getTime","isBuffer","allocUnsafe","length","copy","Error","Object","create","getPrototypeOf","index","indexOf","push","i","forEach","key","keyChild","valueChild","set","entryChild","add","attrs","getOwnPropertyDescriptor","getOwnPropertySymbols","symbols","symbol","descriptor","enumerable","defineProperty","allPropertyNames","getOwnPropertyNames","propertyName","__objToStr","o","toString","call","re","flags","global","ignoreCase","multiline","clonePrototype","c","module","exports","createThunk","Procedure","this","argTypes","shimArgs","arrayArgs","arrayBlockIndices","scalarArgs","offsetArgs","offsetArgIndex","indexArgs","shapeArgs","funcName","pre","body","post","debug","user_args","proc","proc_args","args","slice","arg_type","blockIndices","count","lvalue","offset","array","printCode","blockSize","uniq","innerFill","order","j","dimension","nargs","has_index","code","vars","idx","pidx","join","processBlock","block","dtypes","carg","name","ptrStr","arrNum","offArgIndex","localStr","arrStr","replace","reStrArr","ptrStrArr","Math","abs","trim","typeSummary","summary","Array","allEqual","t","digits","match","charAt","typesig","orders","blockBegin","blockEnd","loopBegin","loopEnd","loopOrders","newOrder","arglist","zeros","off_arg","init_string","thisVars","concat","matched","countMatches","indexStr","outerFill","console","log","loopName","Function","f","compile","thunkName","string_typesig","max","shapeLengthConditions","shapeConditions","thunk","bind","undefined","esprima","PREFIX_COUNTER","CompiledArgument","rvalue","CompiledRoutine","localVars","func","src","ast","parse","range","prefix","argNames","params","expression","callee","names","getArgNames","compiledArgs","exploded","n","rewrite","node","nstr","lo","hi","visit","computed","object","property","argNo","usage","left","operator","LVALUE","getUsage","identifier","window","g","self","isGlobal","id","createLocal","keys","REQUIRED_FIELDS","OPTIONAL_FIELDS","warn","dupe_array","result","dupe_number","root","factory","Token","TokenName","FnExprTokens","Syntax","PropertyKind","Messages","Regex","SyntaxTreeDelegate","strict","lineNumber","lineStart","delegate","lookahead","state","extra","assert","condition","message","isDecimalDigit","ch","isHexDigit","isOctalDigit","isWhiteSpace","isLineTerminator","isIdentifierStart","NonAsciiIdentifierStart","test","String","fromCharCode","isIdentifierPart","NonAsciiIdentifierPart","isStrictModeReservedWord","isRestrictedWord","isKeyword","addComment","start","end","loc","comment","lastCommentStart","comments","attachComment","leadingComments","trailingComments","skipSingleLineComment","line","column","charCodeAt","skipMultiLineComment","throwError","UnexpectedToken","skipComment","scanHexEscape","len","toLowerCase","getEscapedIdentifier","substr","getIdentifier","scanPunctuator","code2","ch2","ch3","ch4","ch1","tokenize","openParenToken","tokens","openCurlyToken","Punctuator","scanNumericLiteral","number","NumericLiteral","parseInt","scanHexLiteral","isImplicitOctalLiteral","octal","scanOctalLiteral","parseFloat","scanRegExp","str","classMarker","terminated","UnterminatedRegExp","literal","scanRegExpBody","restore","throwErrorTolerant","scanRegExpFlags","pattern","e","InvalidRegExp","testRegExp","RegularExpression","collectRegex","pos","regex","token","pop","advance","EOF","Identifier","Keyword","NullLiteral","BooleanLiteral","quote","unescaped","startLineNumber","startLineStart","StringLiteral","scanStringLiteral","prevToken","checkToken","advanceSlash","collectToken","lex","peek","Position","SourceLocation","startLine","startColumn","peekLineTerminator","found","messageFormat","error","arguments","msg","whole","description","apply","errors","throwUnexpected","UnexpectedEOS","UnexpectedNumber","UnexpectedString","UnexpectedIdentifier","isFutureReservedWord","UnexpectedReserved","StrictReservedWord","expect","expectKeyword","keyword","matchKeyword","consumeSemicolon","oldIndex","oldLineNumber","oldLineStart","oldLookahead","isLeftHandSide","expr","MemberExpression","parsePropertyFunction","param","first","previousStrict","startToken","parseFunctionSourceElements","StrictParamName","markEnd","createFunctionExpression","parseObjectPropertyKey","StrictOctalLiteral","createLiteral","createIdentifier","parseObjectProperty","parseAssignmentExpression","createProperty","parseVariableIdentifier","parsePrimaryExpression","parseExpression","parseGroupExpression","elements","createArrayExpression","parseArrayInitialiser","kind","properties","map","Data","Get","hasOwnProperty","StrictDuplicateProperty","AccessorDataProperty","AccessorGetSet","createObjectExpression","parseObjectInitialiser","stricted","firstRestricted","tmp","StrictFunctionName","parseParams","parseFunctionExpression","createThisExpression","parseArguments","parseNonComputedProperty","isIdentifierName","parseNonComputedMember","parseComputedMember","parseNewExpression","allowIn","createMemberExpression","parseLeftHandSideExpression","createNewExpression","parsePostfixExpression","previousAllowIn","createCallExpression","parseLeftHandSideExpressionAllowCall","StrictLHSPostfix","InvalidLHSInAssignment","createPostfixExpression","parseUnaryExpression","StrictLHSPrefix","createUnaryExpression","argument","StrictDelete","binaryPrecedence","prec","parseConditionalExpression","consequent","alternate","marker","markers","stack","right","createBinaryExpression","parseBinaryExpression","createConditionalExpression","op","StrictLHSAssignment","createAssignmentExpression","createSequenceExpression","expressions","parseBlock","statement","list","parseSourceElement","parseStatementList","createBlockStatement","parseVariableDeclaration","init","StrictVarName","createVariableDeclarator","parseVariableDeclarationList","parseForStatement","update","oldInIteration","declarations","createVariableDeclaration","InvalidLHSInForIn","inIteration","parseStatement","createForStatement","createForInStatement","parseSwitchCase","createSwitchCase","parseTryStatement","handlers","finalizer","StrictCatchVariable","createCatchClause","NoCatchOrFinally","createTryStatement","labeledBody","createEmptyStatement","createExpressionStatement","parseExpressionStatement","label","inSwitch","IllegalBreak","createBreakStatement","labelSet","UnknownLabel","parseBreakStatement","IllegalContinue","createContinueStatement","parseContinueStatement","createDebuggerStatement","createDoWhileStatement","parseFunctionDeclaration","createIfStatement","parseIfStatement","inFunctionBody","IllegalReturn","createReturnStatement","discriminant","cases","clause","oldInSwitch","defaultFound","createSwitchStatement","MultipleDefaultsInSwitch","parseSwitchStatement","NewlineAfterThrow","createThrowStatement","parseThrowStatement","createWhileStatement","parseWhileStatement","StrictModeWith","createWithStatement","parseWithStatement","Redeclaration","createLabeledStatement","sourceElement","oldLabelSet","oldInFunctionBody","sourceElements","Literal","paramSet","StrictParamDupe","createFunctionDeclaration","parseProgram","parseSourceElements","createProgram","filterTokenLocation","entry","AssignmentExpression","ArrayExpression","BlockStatement","BinaryExpression","BreakStatement","CallExpression","CatchClause","ConditionalExpression","ContinueStatement","DoWhileStatement","DebuggerStatement","EmptyStatement","ExpressionStatement","ForStatement","ForInStatement","FunctionDeclaration","FunctionExpression","IfStatement","LabeledStatement","LogicalExpression","NewExpression","ObjectExpression","Program","Property","ReturnStatement","SequenceExpression","SwitchStatement","SwitchCase","ThisExpression","ThrowStatement","TryStatement","UnaryExpression","UpdateExpression","VariableDeclaration","VariableDeclarator","WhileStatement","WithStatement","processComment","lastChild","bottomRightStack","postProcess","each","defaults","rest","generator","raw","accessor","guardedHandlers","version","options","tolerant","lexError","program","types","freeze","equal","a","b","constructor","isArray","valueOf","data","opts","cmp","cycles","aobj","bobj","seen","stringify","toJSON","isFinite","JSON","out","TypeError","seenIndex","sort","splice","readFloatLE","isSlowBuffer","_isBuffer","decompress","pako","lz4","zlib","input","inflate","Uint8Array","buffer","rowProxy","table_serialization","EchoTableWidgetView","EchoTableWidgetModel","TableWidgetModel","widgets_1","get","serializers_1","compression_1","tableToJSON","JSONToTable","ndarray","dtypeToArray","int8","Int8Array","int16","Int16Array","int32","Int32Array","uint8","uint16","Uint16Array","uint32","Uint32Array","float32","Float32Array","float64","Float64Array","RowIndex","Symbol","manager","size","decoder","TextDecoder","col","val","entries","compression","valBuffer","dtype","u8buf","strcol","decode","lstr","shape","min","columns","widget","table","fields","arraycolumn","stringcolumn","v","isNaN","r","deserialize","serialize","__awaiter","thisArg","_arguments","P","fulfilled","step","next","rejected","done","base_1","ndarray_unpack","DOMWidgetModel","assign","_model_name","_view_name","_model_module","_view_module","_model_module_version","_view_module_version","_table","_columns","serializers","echo","unpack_models","DOMWidgetView","render","that","model","res","touch","xxhash","util","hashSize","blockBuf","makeBuffer","hashTable","makeHashTable","magicNum","bsUncompressed","bsMap","buf","sliceArray","arraySlice","compressBound","decompressBound","sIndex","readU32","useBlockSum","useContentSize","bsIdx","maxBlockSize","readU64","maxSize","decompressBlock","dst","sLength","dIndex","mLength","mOffset","sEnd","literalCount","compressBlock","mIndex","mAnchor","searchMatchCount","seq","hash","hashU32","decompressFrame","useContentSum","compSize","compressFrame","writeU32","bsDefault","remaining","clearHashTable","z","compress","x","imul","al","bl","prime1","prime2","prime3","prime5","rotl32","rotmul32","h","m","shiftxor32","s","xxhapply","m0","m1","xxh1","xxh4","xxh16","seed","l","dup","do_unpack","cwise","arr","iota","hasTypedArrays","compare1st","stride","terms","compileConstructor","className","useGetters","procedure","CACHED_CONSTRUCTORS","indices","index_str","shapeArg","strideArg","a_vars","c_vars","tShape","tStride","ctor","d","sz","arrayDType","ctor_list","Deflate","deflate","deflateRaw","gzip","Inflate","inflateRaw","ungzip","constants","zlib_deflate","utils","strings","ZStream","Z_NO_FLUSH","Z_SYNC_FLUSH","Z_FULL_FLUSH","Z_FINISH","Z_OK","Z_STREAM_END","Z_DEFAULT_COMPRESSION","Z_DEFAULT_STRATEGY","Z_DEFLATED","level","method","chunkSize","windowBits","memLevel","strategy","opt","ended","chunks","strm","avail_out","status","deflateInit2","header","deflateSetHeader","dictionary","dict","string2buf","deflateSetDictionary","_dict_set","deflator","flush_mode","_flush_mode","next_in","avail_in","output","next_out","onData","subarray","deflateEnd","onEnd","chunk","flattenChunks","zlib_inflate","GZheader","Z_NEED_DICT","Z_STREAM_ERROR","Z_DATA_ERROR","Z_MEM_ERROR","to","inflateInit2","inflateGetHeader","inflateSetDictionary","inflator","last_avail_out","wrap","inflateReset","next_out_utf8","utf8border","tail","utf8str","buf2string","inflateEnd","_has","sources","shift","p","STR_APPLY_UIA_OK","__","_utf8len","q","TextEncoder","encode","c2","m_pos","str_len","buf_len","utf16buf","c_len","buf2binstring","adler","s1","s2","Z_PARTIAL_FLUSH","Z_BLOCK","Z_TREES","Z_ERRNO","Z_BUF_ERROR","Z_NO_COMPRESSION","Z_BEST_SPEED","Z_BEST_COMPRESSION","Z_FILTERED","Z_HUFFMAN_ONLY","Z_RLE","Z_FIXED","Z_BINARY","Z_TEXT","Z_UNKNOWN","crcTable","k","makeTable","crc","_tr_init","_tr_stored_block","_tr_flush_block","_tr_tally","_tr_align","adler32","crc32","MAX_MATCH","MIN_LOOKAHEAD","INIT_STATE","BUSY_STATE","FINISH_STATE","errorCode","rank","zero","slide_hash","wsize","w_size","hash_size","head","prev","HASH","hash_shift","hash_mask","flush_pending","pending","pending_buf","pending_out","total_out","flush_block_only","last","block_start","strstart","put_byte","putShortMSB","read_buf","total_in","longest_match","cur_match","chain_length","max_chain_length","scan","best_len","prev_length","nice_match","limit","_win","wmask","w_mask","strend","scan_end1","scan_end","good_match","match_start","fill_window","_w_size","more","window_size","insert","ins_h","deflate_stored","flush","have","min_block","pending_buf_size","used","bi_valid","matches","high_water","deflate_fast","hash_head","bflush","match_length","max_lazy_match","MIN_MATCH","sym_next","deflate_slow","max_insert","prev_match","match_available","Config","good_length","max_lazy","nice_length","max_chain","configuration_table","DeflateState","gzhead","gzindex","last_flush","w_bits","hash_bits","dyn_ltree","HEAP_SIZE","dyn_dtree","bl_tree","l_desc","d_desc","bl_desc","bl_count","MAX_BITS","heap","heap_len","heap_max","sym_buf","lit_bufsize","sym_end","opt_len","static_len","bi_buf","deflateStateCheck","deflateResetKeep","data_type","deflateReset","ret","deflateInit","old_flush","level_flags","text","hcrc","time","os","beg","gzhead_extra","bstate","deflate_huff","deflate_rle","dictLength","tmpDict","avail","deflateInfo","xflags","extra_len","BAD","_in","_out","dmax","whave","wnext","s_window","hold","bits","lcode","dcode","lmask","dmask","here","dist","from","from_source","lencode","distcode","lenbits","distbits","top","dolen","mode","dodist","sane","inflate_fast","inflate_table","HEAD","DICT","TYPE","TYPEDO","COPY_","LEN_","LEN","CHECK","MEM","zswap32","InflateState","havedict","check","total","wbits","ncode","nlen","ndist","lens","work","lendyn","distdyn","back","was","inflateStateCheck","inflateResetKeep","inflateReset2","lenfix","distfix","virgin","fixedtables","sym","updatewindow","inflateInit","put","here_bits","here_op","here_val","last_bits","last_op","last_val","hbuf","inf_leave","dictid","inflateInfo","lbase","lext","dbase","dext","lens_index","codes","table_index","incr","fill","low","mask","curr","drop","huff","base","MAXBITS","offs","extra_lbits","extra_dbits","extra_blbits","bl_order","static_ltree","static_dtree","D_CODES","_dist_code","_length_code","base_length","base_dist","StaticTreeDesc","static_tree","extra_bits","extra_base","elems","max_length","has_stree","static_l_desc","static_d_desc","static_bl_desc","TreeDesc","dyn_tree","stat_desc","max_code","d_code","put_short","w","send_bits","send_code","tree","bi_reverse","gen_codes","next_code","init_block","LITERALS","END_BLOCK","bi_windup","smaller","_n2","_m2","pqdownheap","compress_block","ltree","dtree","lc","sx","build_tree","desc","stree","xbits","overflow","gen_bitlen","scan_tree","curlen","prevlen","nextlen","max_count","min_count","REP_3_6","REPZ_3_10","REPZ_11_138","send_tree","static_init_done","stored_len","LENGTH_CODES","L_CODES","tr_static_init","opt_lenb","static_lenb","max_blindex","block_mask","detect_data_type","BL_CODES","build_bl_tree","lcodes","dcodes","blcodes","send_all_trees","STATIC_TREES","bi_flush","default","showError","el","innerHTML","VegaWidgetModel","VegaWidget","selector","spec","output_area","imgIndex","outputs","item","metadata","imageIndex","jsIndex","javascriptIndex","document","getElementById","substring","loader","http","credentials","view","toImageURL","imageData","split","output_type","catch","pkg","MODULE_VERSION","MODULE_NAME","viewInstance","_spec_source","_opt_source","_df","_img_url","imgURL","mgr","viewElement","hasBeenUpdated","id_","crypto","randomUUID","canvas","querySelector","width","style","height","url","toDataURL","model_name","model_module","model_module_version","view_name","view_module","view_module_version","createElement","errorElement","appendChild","color","reembed","imgJson","imgElement","vegaEmbed","finalize","send","applyUpdate","resize","filter","remove","newValues","updateDataFrame","updateArray2D","changeSet","changeset","change","runAsync","applyUpdates","updates","on","ev","checkWidgetUpdate","textContent","proxy","rows","fancyCol","cols","row","compare","sorted","ptr","unique_pred","unique_eq","extendStatics","__extends","setPrototypeOf","__proto__","_hasOwnProperty","_objectKeys","keys_1","_deepClone","isInteger","charCode","escapePathComponent","path","unescapePathComponent","hasUndefined","i_1","objKeys","objKeysLength","patchErrorMessageFormatter","messageParts","PatchError","_super","operation","_newTarget","_this","JsonPatchError","deepClone","objOps","newDocument","removed","move","getValueByPointer","originalValue","applyOperation","valueToCopy","_areEquals","_get","arrOps","pointer","getOriginalDestination","validateOperation","mutateDocument","banPrototypeModifications","validator","returnValue","existingPathFragment","validateFunction","applyPatch","patch","results","length_1","applyReducer","operationResult","pathLen","existingPathLen","validate","sequence","externalValidator","arrA","arrB","beforeDict","WeakMap","Mirror","observers","ObserverInfo","callback","observer","unobserve","observe","mirror","getMirror","observerInfo","getObserverFromMirror","dirtyCheck","generate","fastCheck","clearTimeout","setTimeout","addEventListener","patches","delete","removeObserverFromMirror","removeEventListener","invertible","_generate","temp","newKeys","oldKeys","deleted","oldVal","newVal","tree1","tree2","fn","fname","accessorName","accessorFields","getter","get1","getN","field","splitAccessPath","identity","one","truthy","falsy","log$1","None","Error$1","logger","handler","info","isObject","isLegalKey","mergeConfig","_len","configs","_key","reduce","signals","mergeNamed","layout","writeConfig","recurse","toNumber","exp","sign","symlog","log1p","symexp","expm1","pow","exponent","pan","domain","delta","lift","ground","d0","d1","dd","panLinear","panLog","panPow","panSymlog","constant","zoom","anchor","scale","da","zoomLinear","zoomLog","zoomPow","zoomSymlog","quarter","date","getMonth","utcquarter","getUTCMonth","clampRange","span","DESCENDING","ord","fmap","gen","comparator","ascending","u","compare1","compareN","debounce","delay","tid","extend","extent","extentIndex","hop","has","NULL","fastmap","has$1","empty","clear","clean","threshold","center","inherits","members","writable","configurable","inrange","r0","r1","isBoolean","isDate","isIterable","iterator","isNumber","isRegExp","flat","lerp","frac","DEFAULT_MAX_SIZE","lruCache","maxsize","merge","array0","array1","n0","n1","merged","i0","i1","repeat","reps","pad","padchar","align","ceil","$","toBoolean","defaultParser","toDate","parser","truncate","ellipsis","visitArray","visitor","EOL","QUOTE","NEWLINE","RETURN","objectConverter","inferColumns","columnSet","delimiter","reFormat","DELIMITER","parseRows","N","I","eof","eol","preformatBody","formatValue","formatRow","year","hours","getUTCHours","minutes","getUTCMinutes","seconds","getUTCSeconds","milliseconds","getUTCMilliseconds","getUTCFullYear","getUTCDate","formatDate","convert","customConverter","format","formatBody","formatRows","topology","objects","features","geometries","bbox","geometry","transformPoint","transform","x0","y0","kx","ky","dx","translate","dy","arcs","arc","points","reverse","point","ring","polygon","coordinates","stitchedArcs","fragmentByStart","fragmentByEnd","fragments","emptyIndex","p1","p0","dp","ends","fg","unshift","gf","meshArcs","geom","geomsByArc","extract0","extract1","extract2","extract3","geoms","extractArcs","stitch","e10","sqrt","e5","e2","tickSpec","stop","power","floor","log10","factor","i2","inc","round","ticks","tickIncrement","tickStep","prefixExponent","formatSpecifier","specifier","exec","FormatSpecifier","comma","precision","formatDecimalParts","toExponential","coefficient","NaN","toFixed","toLocaleString","toPrecision","formatRounded","toUpperCase","formatPrefix","prefixes","locale","grouping","thousands","group","Number","currencyPrefix","currency","currencySuffix","decimal","numerals","formatNumerals","percent","minus","nan","newFormat","formatTypes","suffix","formatType","maybeSuffix","valuePrefix","valueSuffix","valueNegative","formatTrim","padding","t0","t1","timeInterval","floori","offseti","interval","previous","setTime","every","durationSecond","durationMinute","durationHour","durationDay","durationWeek","durationMonth","durationYear","timeDay","setHours","setDate","getDate","getTimezoneOffset","utcDay","setUTCHours","setUTCDate","unixDay","timeWeekday","getDay","timeSunday","timeMonday","timeTuesday","timeWednesday","timeThursday","timeFriday","timeSaturday","utcWeekday","getUTCDay","utcSunday","utcMonday","utcTuesday","utcWednesday","utcThursday","utcFriday","utcSaturday","timeYear","setMonth","setFullYear","getFullYear","utcYear","setUTCMonth","setUTCFullYear","timeMonth","utcMonth","timeHour","getMilliseconds","getSeconds","getMinutes","getHours","utcHour","setUTCMinutes","timeMinute","utcMinute","setUTCSeconds","second","millisecond","descending","bisector","compare2","mid","YEAR","QUARTER","MONTH","WEEK","DATE","DAY","DAYOFYEAR","HOURS","MINUTES","SECONDS","MILLISECONDS","TIME_UNITS","UNITS","timeUnits","units","unit","defaultSpecifiers","timeUnitSpecifier","specifiers","fmt","localYear","y","dayofyear","localDayOfYear","week","localWeekNum","localFirst","localDate","H","M","S","L","utcdayofyear","utcDayOfYear","utcweek","utcWeekNum","UTC","utcFirst","utcDate","inv","newDate","phase","getUnit","weekday","day","firstDay","localGet","localInv","timeFloor","utcGet","utcInv","utcFloor","timeIntervals","utcIntervals","utcInterval","ival","timeOffset","utcOffset","timeSequence","utcSequence","Milli","Seconds","Minutes","Hours","Day","Month","Year","intervals","bin","ext","maxbins","target","formatLocale","locale_dateTime","dateTime","locale_date","locale_time","locale_periods","periods","locale_weekdays","days","locale_shortWeekdays","shortDays","locale_months","months","locale_shortMonths","shortMonths","periodRe","formatRe","periodLookup","formatLookup","weekdayRe","weekdayLookup","shortWeekdayRe","shortWeekdayLookup","monthRe","monthLookup","shortMonthRe","shortMonthLookup","formats","formatDayOfMonth","formatMicroseconds","formatYearISO","formatFullYearISO","formatHour24","formatHour12","formatDayOfYear","formatMilliseconds","formatMonthNumber","formatMinutes","formatUnixTimestamp","formatUnixTimestampSeconds","formatSeconds","formatWeekdayNumberMonday","formatWeekNumberSunday","formatWeekNumberISO","formatWeekdayNumberSunday","formatWeekNumberMonday","formatFullYear","formatZone","formatLiteralPercent","utcFormats","formatUTCDayOfMonth","formatUTCMicroseconds","formatUTCYearISO","formatUTCFullYearISO","formatUTCHour24","formatUTCHour12","formatUTCDayOfYear","formatUTCMilliseconds","formatUTCMonthNumber","formatUTCMinutes","formatUTCSeconds","formatUTCWeekdayNumberMonday","formatUTCWeekNumberSunday","formatUTCWeekNumberISO","formatUTCWeekdayNumberSunday","formatUTCWeekNumberMonday","formatUTCYear","formatUTCFullYear","formatUTCZone","parses","string","parseSpecifier","parseDayOfMonth","parseMicroseconds","parseYear","parseFullYear","parseHour24","parseDayOfYear","parseMilliseconds","parseMonthNumber","parseMinutes","parseQuarter","parseUnixTimestamp","parseUnixTimestampSeconds","parseSeconds","parseWeekdayNumberMonday","parseWeekNumberSunday","parseWeekNumberISO","parseWeekdayNumberSunday","parseWeekNumberMonday","parseZone","parseLiteralPercent","pads","newParse","Z","Q","V","W","U","X","utcFormat","utcParse","timeFormat","timeParse","numberRe","percentRe","requoteRe","requote","dISO","dow","UTCdISO","memoize","cache","numberLocale","formatFloat","numberFormat","decimalChar","dec","lastIndexOf","rightmostDigit","trimZeroes","formatSpan","precisionPrefix","precisionRound","precisionFixed","defaultNumberLocale","defaultTimeLocale","resetNumberFormatDefaultLocale","numberFormatLocale","definition","numberFormatDefaultLocale","timeMultiFormat","minute","hour","month","timeLocale","resetTimeFormatDefaultLocale","timeFormatLocale","timeFormatDefaultLocale","createLocale","numberSpec","timeSpec","resetDefaultLocale","protocol_re","allowed_re","whitespace_re","fileProtocol","async","load","uri","sanitize","href","localFile","file","fileAccess","isFile","loadFile","isAllowed","hasProtocol","baseURL","startsWith","endsWith","defaultProtocol","rel","context","crossOrigin","fileLoader","fs","filename","accept","readFile","fileReject","httpLoader","fetch","response","ok","statusText","httpReject","isValid","typeParsers","boolean","integer","unknown","typeTests","typeList","inferType","values","inferTypes","delimitedFormat","delim","responseType","dsv","json","prop","parseJSON","filters","interior","exterior","topojson","feature","mesh","csv","tsv","reader","read","schema","timeParser","utcParser","datum","parsers","parts","loaderFactory","UniqueList","idFunc","ids","asyncCallback","df","TUPLE_ID_KEY","TUPLE_ID","isTuple","tupleid","setid","ingest$1","derive","rederive","stableCompare","isChangeSet","rem","mod","remp","modp","reflow","modify","tuple","pulse","tuples","cur","modifies","CACHE","Parameters","force","modified","OP_ID","NO_PARAMS","Operator","react","stamp","qrank","_update","parameters","flag","bit","targets","_targets","skip","initonly","argval","_argval","argops","_argops","deps","marshall","detach","evaluate","StopPropagation","run","rv","STREAM_ID","EventStream","receive","_filter","_apply","stream","consume","_consume","evt","trg","preventDefault","stopPropagation","throttle","pause","now","dataflow","between","active","SKIP","onStream","onOperator","updater","connect","Pulse","materialize","addFilter","MultiPulse","pulses","changed","ADD","REM","MOD","changes","reentrant","ADD_REM","ADD_MOD","ALL","REFLOW","SOURCE","NO_SOURCE","NO_FIELDS","fork","addAll","addF","remF","modF","srcF","cleans","runAfter","nomod","some","sum","NO_OPT","siftdown","Dataflow","logLevel","_clock","_rank","_locale","_loader","_touched","_input","_pulse","_heap","nodes","ridx","cidx","siftup","Heap","_postrun","logMethod","_log","Transform","cleanThreshold","targetRank","rerank","queue","_enqueue","ingest","preload","_pending","requests","loadPending","request","events","querySelectorAll","prerun","postrun","_getPulse","pr","priority","all","cb","_running","enqueue","singlePulse","transforms","Definition","valueof","compareDefined","sd","swap","quantile","value0","quantileSorted","median","quantiles","quartiles","estimateBandwidth","mean","variance","deviation","maxb","logb","div","divide","minstep","steps","eps","nice","random","setRandom","bootstrapCI","samples","alpha","mu","dotbin","smooth","thresh","smoothing","sample","pdf","cdf","icdf","SQRT2PI","PI","SQRT2","nextSample","sampleNormal","stdev","rds","densityNormal","cumulativeNormal","cd","quantileNormal","erfinv","gaussian","sigma","kde","support","bandwidth","kernel","sampleLogNormal","densityLogNormal","cumulativeLogNormal","quantileLogNormal","lognormal","mixture","dists","weights","normalize","distributions","sampleUniform","densityUniform","cumulativeUniform","quantileUniform","uniform","ols","uX","uY","uXY","uX2","slope","Y","xv","yv","ux","uy","visitPoints","rSquared","predict","SSE","SST","sse","sst","linear","XY","X2","coef","ly","xy","YL","XYL","X2Y","c0","c1","YS","lx","quad","x2","X3","X4","X2X2","poly","lhs","rhs","matrix","gaussianElimination","uncenter","maxiters","epsilon","loess","bw","yhat","residuals","robustWeights","iter","edge","denom","xk","yk","tricube","xkw","updateInterval","medianResidual","arg","cnt","MIN_RADIANS","sampleCurve","minSteps","maxSteps","minX","maxX","sy","ymin","ymax","scaleY","pm","angleDelta","a0","atan2","a1","groupkey","measureName","as","noop","base_op","AggregateOps","cell","store","num","__count__","missing","valid","product","mean_d","average","req","dev","variancep","stdevp","stderr","distinct","ci0","ci1","q2","q1","q3","argmin","argmax","ValidAggregateOps","createMeasure","compareIndex","_ops","compileMeasures","agg","ops","getreqs","ctr","TupleStore","reset","measure","prototype$1","Aggregate","_adds","_mods","_alen","_mlen","_drop","_cross","_dims","_dnames","_measures","_countOnly","_counts","_prev","_inputs","_outputs","Bin","SortedList","resort","Collect","Compare","update$5","CountPattern","Cross","_add","_rem","_ext","_q","quartile","ci","_ci","aggr","cross","dims","vals","collect","cells","inputs","inputMap","inputVisit","groupby","dname","cellkey","mname","outname","newcell","newtuple","measures","celltuple","counts","adds","mods","band","bins","_bins","b0","b1","process","tcase","case","_parameterCheck","_match","_stop","_finish","stopwords","_tuples","Distributions","normal","FUNCTION","def","Density","fieldNames","partition$1","groups","DotBin","Expression","update$4","Extent","Subflow","Facet","_keys","Field","update$3","Filter","Flatten","Fold","Formula","Generate","distribution","minsteps","maxsteps","autostep","detachSubflow","activate","flow","subflow","flows","sf","_group","detached","initTargets","act","rekey","k0","k1","isMod","revisit","arrays","maxlen","fnames","Methods","Empty","Impute","JoinAggregate","KDE","Key","update$2","Load","Lookup","MultiExtent","update$1","extents","MultiValues","Params","Pivot","PreFacet","Project","Proxy","Quantile","Relay","Sample","Sequence","Sieve","TimeUnit","gVals","kVal","impute","getValue","getField","fName","kName","gNames","keyvals","gKey","kMap","gMap","partition","_impute","cumulative","density","defaultValue","_transform","pivotKeys","aggregateParams","project","lut","dt","probs","cap","OUTPUT","TupleIndex","Values","utc","timezone","_floor","u0","u1","tunits","WindowOps","row_number","dense_rank","drank","percent_rank","cume_dist","cume","ntile","lag","lead","first_value","last_value","nth_value","nth","prev_value","next_value","find","ValidWindowOps","WindowState","windows","countOnly","visitInputs","WindowOp","Window","processPartition","ignorePeers","frame","setWindow","adjustRange","bisect","_context","bezierCurveTo","_x0","_x1","_y0","_y1","Basis","BasisClosed","BasisOpen","Bundle","beta","_basis","_beta","wind","areaStart","_line","areaEnd","_point","lineEnd","lineTo","closePath","moveTo","_x2","_x3","_x4","_y2","_y3","_y4","_x","_y","custom","bundle","_k","Cardinal","tension","cardinal","CardinalOpen","CardinalClosed","_x5","_y5","cos","sin","pi","halfPi","tau","asin","x1","y1","y2","_l01_a","_l01_2a","_l12_a","_l12_2a","_l23_a","_l23_2a","CatmullRom","_alpha","x23","y23","catmullRom","CatmullRomClosed","CatmullRomOpen","Linear","LinearClosed","slope3","h0","h1","s0","slope2","MonotoneX","MonotoneY","ReflectContext","Natural","controlPoints","Step","_t","_t0","px","py","tauEpsilon","append","Path","_append","appendRound","quadraticCurveTo","arcTo","x21","y21","x01","y01","l01_2","x20","y20","l21_2","l20_2","l21","l01","tan","acos","t01","t21","ccw","cw","rect","withPath","RangeError","arcInnerRadius","innerRadius","arcOuterRadius","outerRadius","arcStartAngle","startAngle","arcEndAngle","endAngle","arcPadAngle","padAngle","cornerTangents","rc","ox","oy","x11","y11","x10","y10","x00","y00","d2","D","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","cx","cy","defined","curve","defined0","area","x0z","y0z","arealine","lineX0","lineY0","lineY1","lineX1","draw","domCanvas","getContext","domImage","Image","ascendingBisect","bisectRight","bisectLeft","Color","darker","brighter","reI","reN","reP","reHex","reRgbInteger","reRgbPercent","reRgbaInteger","reRgbaPercent","reHslPercent","reHslaPercent","named","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","color_formatHex","rgb","formatHex","color_formatRgb","formatRgb","rgbn","Rgb","rgba","hsla","rgbConvert","opacity","rgb_formatHex","hex","rgb_formatRgb","clampa","clampi","Hsl","hslConvert","hsl","clamph","clampt","hsl2rgb","m2","v0","v1","v2","v3","t2","t3","channels","displayable","formatHex8","formatHsl","clamp","hue","nogamma","rgbGamma","exponential","gamma","rgbSpline","spline","colors","rgbBasis","rgbBasisClosed","isNumberArray","ArrayBuffer","isView","DataView","numberArray","genericArray","nb","na","reA","reB","am","bm","bs","bi","bimap","interpolate","polymap","transformer","untransform","piecewise","rescale","clamper","invert","rangeRound","continuous","initRange","initInterpolator","interpolator","tickFormat","linearish","prestep","maxIter","transformLog","transformExp","transformLogn","transformExpn","pow10","reflect","loggish","logs","pows","E","log2","logp","powp","transformPow","transformSqrt","transformSquare","powish","transformSymlog","transformSymexp","symlogish","ticker","tickIntervals","tickInterval","utcTicks","utcTickInterval","timeTicks","timeTickInterval","calendar","formatMillisecond","formatSecond","formatMinute","formatHour","formatDay","formatWeek","formatMonth","formatYear","k10","sequential","sequentialPow","k21","r2","divergingPow","InternMap","keyof","super","defineProperties","_intern","intern_get","intern_set","intern_delete","InternSet","implicit","ordinal","svgNode","translateX","translateY","rotate","skewX","scaleX","atan","interpolateTransform","pxComma","pxParen","degParen","xa","ya","xb","yb","interpolateTransformCss","DOMMatrix","WebKitCSSMatrix","isIdentity","decompose","interpolateTransformSvg","createElementNS","setAttribute","baseVal","consolidate","cosh","zoomRho","rho","rho2","rho4","ux0","uy0","w0","ux1","uy1","w1","coshr0","tanh","sinh","duration","_1","_2","hslLong","Xn","Yn","Zn","labConvert","Lab","Hcl","hcl2lab","rgb2lrgb","xyz2lab","lab","lab2xyz","lrgb2rgb","hcl","hclConvert","hclLong","A","B","C","ED","EB","BC_DA","Cubehelix","cubehelixConvert","cubehelix","cubehelixGamma","cubehelixLong","bandSpace","paddingInner","paddingOuter","space","Log","Pow","Sqrt","Symlog","Time","Sequential","Diverging","Quantize","Threshold","Ordinal","Point","Band","BinOrdinal","Continuous","Discrete","Discretizing","Interpolating","Temporal","ordinalRange","range$1","invertRange","pointish","scales","VEGA_SCALE","registerScale","invertExtent","invertRangeExtent","isValidScaleType","hasType","isContinuous","isDiscrete","isDiscretizing","isLogarithmic","isInterpolating","isQuantile","sequentialLog","sequentialSymlog","diverging","divergingLog","divergingSymlog","thresholds","quantize","scaleBinOrdinal","scaleProps","interpolateRange","interpolateColors","quantizeInterpolator","scaleFraction","scale$1","interp","palette","scheme","schemes","category10","category20","category20b","category20c","tableau10","tableau20","accent","dark2","paired","pastel1","pastel2","set1","set2","set3","blues","greens","greys","oranges","purples","reds","blueGreen","bluePurple","greenBlue","orangeRed","purpleBlue","purpleBlueGreen","purpleRed","redPurple","yellowGreen","yellowOrangeBrown","yellowOrangeRed","blueOrange","brownBlueGreen","purpleGreen","purpleOrange","redBlue","redGrey","yellowGreenBlue","redYellowBlue","redYellowGreen","pinkYellowGreen","spectral","viridis","magma","inferno","plasma","cividis","rainbow","sinebow","turbo","browns","tealBlues","teals","warmGreys","goldGreen","goldOrange","goldRed","lightGreyRed","lightGreyTeal","lightMulti","lightOrange","lightTealBlue","darkBlue","darkGold","darkGreen","darkMulti","darkRed","SymbolLegend","DiscreteLegend","defaultFormatter","tickCount","minStep","validTicks","endpoints","tickValues","noSkip","varfmt","tickLog","labelValues","binValues","thresholdValues","isDiscreteRange","labelFormat","thresholdFormat","formatRange","formatDiscrete","formatPoint","dflt","domainCaption","isTemporal","gradient_id","patternPrefix","isGradient","gradient","gradientRef","defs","Gradient","stops","lookup","horizontal","vertical","curves","orientation","paramCounts","commandPattern","numberPattern","spacePattern","flagPattern","commands","cmd","paramCount","segment","ws","DegToRad","HalfPi","Tau","HalfSqrt3","segmentCache","bezierCache","bezier","th0","th1","rx","ry","sin_th","cos_th","a00","a01","a10","a11","cos_th0","sin_th0","cos_th1","sin_th1","th_half","sin_th_h2","x3","y3","current","sX","sY","pathRender","tempX","tempY","tempControlX","tempControlY","controlX","controlY","anchorX","anchorY","beginPath","drawArc","coords","seg","large","sweep","rotateX","th","pl","sfactor_sq","sfactor","xc","yc","th_arc","segs","th2","th3","segments","bez","Tan30","builtins","parsed","customSymbol","rectangleX","rectangleY","rectangleWidth","rectangleHeight","vg_rect","crTL","crTR","crBL","crBR","rectangle","tl","tr","br","cornerRadius","vg_trail","ready","w2","ud","trail","value$1","arcShape","padRadius","da0","da1","ap","rp","rc0","rc1","oc","x32","y32","intersect","ax","ay","bx","by","kc","centroid","areavShape","areahShape","lineShape","rectShape","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomRight","cornerRadiusBottomLeft","symbolShape","circle","trailShape","hasCornerRadius","clip_id","resetSVGClipId","clip$1","renderer","clip","_defs","clipping","Bounds","union","Item","mark","bounds","GroupItem","items","ResourceLoader","customLoader","increment","decrement","boundStroke","miter","stroke","strokeOpacity","sw","strokeWidth","expand","strokeJoin","miterAdjustment","MAX_VALUE","equals","angle","rotatedPoints","encloses","alignsWith","intersects","contains","sanitizeURL","loadImage","img","cors","onload","onerror","complete","poll","circleThreshold","rot","ma","mb","mc","md","addL","addX","addY","addp","addpL","boundContext","deg","context$1","px1","py1","px2","py2","quadExtrema","px3","py3","cubicExtrema","sa","ea","cubic","intersectPath","brush","isPointInPath","intersectPoint","box","intersectRect","intersectRule","intersectBoxLine","blend","globalCompositeOperation","addStops","addColorStop","createRadialGradient","image","ictx","fillStyle","createLinearGradient","fillRect","createPattern","fillOpacity","globalAlpha","lw","strokeStyle","lineWidth","lineCap","strokeCap","lineJoin","miterLimit","strokeMiterLimit","setLineDash","strokeDash","lineDashOffset","strokeDashOffset","zindex","zorder","scene","zdirty","zitems","pickVisit","hit","drawAll","drawPath","drawOne","pick$1","gx","gy","pixelRatio","hitPath","filled","isPointInStroke","pickPath","translateItem","markItemPath","isect","tag","nested","attr","emit","rotateItem","bound","pick","markMultiItemPath","tip","orient","clipGroup","offset$1","strokeOffset","emitRectangle","off","rectanglePath","hitBackground","hitForeground","hitCorner","noBound","fore","strokeForeground","save","dw","dh","ix","interactive","marktype","pickMark","content","background","foreground","getImage","imageWidth","aspect","imageHeight","imageXOffset","imageYOffset","baseline","ar0","ar1","imageSmoothingEnabled","drawImage","xOffset","yOffset","path$1","pathCache","path$2","transformItem","draw$2","rule","widthCache","textMetrics","fontSize","measureWidth","estimateWidth","useCanvas","use","_estimateWidth","textValue","currentFontHeight","_measureWidth","font","currentFont","measureText","lineHeight","textLines","lineBreak","multiLineOffset","widthGetter","rtl","dir","fontFamily","fontStyle","fontVariant","fontWeight","textAlign","tempBounds","anchorPoint","radius","theta","lh","fillText","strokeText","Marks","boundItem","DUMMY","boundMark","hasItems","sceneToJSON","indent","sceneFromJSON","initialize","Scenegraph","createMark","role","aria","domCreate","doc","ns","domFind","childNodes","tagName","domChild","ownerDocument","insertBefore","domClear","removeChild","cssClass","event","getBoundingClientRect","clientX","clientLeft","clientY","clientTop","Handler","customTooltip","_active","_handlers","_tooltip","defaultTooltip","element","Renderer","_el","_bgcolor","markdef","origin","_obj","firstChild","_origin","_scene","_handlerIndex","eventName","handleHref","MouseEvent","dispatchEvent","handleTooltip","show","tooltip","mdef","resolveItem","getItemBoundingClientRect","bottom","scaleFactor","bgcolor","_width","_height","_scale","dirty","_call","_render","renderAsync","_ready","_load","redraw","DragEnterEvent","DragLeaveEvent","DragOverEvent","MouseDownEvent","MouseMoveEvent","MouseOutEvent","MouseOverEvent","ClickEvent","MouseWheelEvent","TouchStartEvent","TouchMoveEvent","TouchEndEvent","TooltipShowEvent","TooltipHideEvent","HrefEvent","CanvasHandler","_down","_touch","_first","_events","eventListenerCheck","eventBundle","fire","moveEvent","overEvent","outEvent","pickEvent","exit","inactive","_canvas","DOMMouseScroll","mousemove","dragover","mouseout","dragleave","mousedown","click","touchstart","changedTouches","touchmove","touchend","vegaType","devicePixelRatio","CanvasRenderer","_options","_redraw","_dirty","_tempb","base$1","SVGHandler","_hrefHandler","listener","_tooltipHandler","externalContext","inDOM","HTMLElement","parentNode","ratio","setTransform","ctx","db","vb","viewBounds","clipToBounds","clearRect","__data__","svg","_svg","ARIA_HIDDEN","ARIA_LABEL","ARIA_ROLE","ARIA_ROLEDESCRIPTION","GRAPHICS_OBJECT","GRAPHICS_SYMBOL","roledesc","AriaIgnore","AriaGuides","caption","title","extractTitle","props","channelCaption","titleCaption","AriaEncode","ariaRole","ariaRoleDescription","ariaItemAttributes","hide","ariaMarkAttributes","ariaGuide","ariaMark","innerText","attrText","markup","outer","inner","open","close","serializeXML","_serialize","hasAttributes","attributes","hasChildNodes","children","nodeType","nodeValue","stylesAttr","stylesCss","rootAttributes","xmlns","svgns","SVGRenderer","_dirtyID","_root","dirtyParents","updateGradient","grad","pt","setAttributes","viewBox","preserveAspectRatio","fx","fy","fr","updateClipping","sibling","__values__","bg","cg","ownerSVGElement","previousSibling","siblingCheck","nextSibling","_clearDefs","setAttributeNS","RootIndex","setProperty","removeAttribute","_dirtyCheck","_dirtyAll","isDirty","isGroup","mark_extras","setStyle","ts","removeAttributeNS","removeProperty","location","SVGStringRenderer","_text","class","attrList","_hrefs","prefixed","styleList","display","Canvas","RenderType","PNG","SVG","modules","renderModule","hits","intersectMark","intersectGroup","visitMark","intersectItem","marks","headless","clipBounds","boundClip","TOLERANCE","sceneEqual","pathEqual","ka","kb","objectEqual","resetSVGDefIds","Top","Left","Right","Bottom","Start","Middle","End","Group","AxisRole","TitleRole","LegendRole","RowHeader","RowFooter","RowTitle","ColHeader","ColFooter","ColTitle","FitX","FitY","All","Each","Flush","Column","Row","Bound","rebound","markBounds","COUNTER_NAME","Mark","Overlap","counter","_signals","scenegraph","lookup$1","Init","methods","parity","greedy","sep","hasOverlap","hasBounds","Render","separation","boundScale","boundTolerance","tolerance","boundTest","boundOrient","isYAxis","axisLayout","axis","grid","labels","axisIndices","position","minExtent","maxExtent","titlePadding","dl","axisTitleLayout","auto","bboxFlush","bboxFull","offsetValue","gridLayout","nodirty","alignCol","alignRow","padCol","padRow","ncols","nrows","xExtent","xMax","yExtent","yMax","boxes","boundFlush","boundFull","layoutHeaders","headers","isX","bf","layoutTitle","legendParams","config","legends","offsets","mult","legendLayout","legend","_bounds","ex","ey","tpad","tx","ty","legendTitleOffset","legendGroupLayout","legendBounds","widths","legendEntryLayout","lr","noBar","vgrad","ViewLayout","AxisTicks","DataJoin","defaultItemCreate","Encode","LegendEntries","views","rowheaders","rowfooters","colheaders","colfooters","rowtitle","coltitle","gridLayoutGroups","headerBand","footerBand","titleAnchor","titleBand","trellisLayout","xBounds","yBounds","autosize","subtitle","titleLayout","_autosize","viewWidth","viewHeight","_resizeView","viewSizeLayout","layoutGroup","shouldReflow","newMap","fmod","encoders","reenter","enter","fraction","lskip","perc","adjust","labelFraction","perc2","sourceX","sourceY","targetX","targetY","LinkPath","Paths","rr","iy","sr","ta","sc","ss","tc","mr","Pie","includePad","Scale","domainCheck","adjustScheme","flip","SortItems","isContinuousColor","rawDomain","domainMid","scaleKey","rangeStep","configureRangeStep","scheme$1","schemeExtent","interpolateGamma","schemeCount","configureScheme","configureRange","domainRaw","configureBins","includeZero","padDomain","domainMin","domainMax","domainImplicit","configureDomain","Zero","Center","Normalize","DefOutput","Stack","stackCenter","stackNormalize","stackZero","lastPos","lastNeg","streamGeometry","streamGeometryType","streamObjectType","Feature","FeatureCollection","Sphere","sphere","MultiPoint","LineString","streamLine","MultiLineString","Polygon","streamPolygon","MultiPolygon","GeometryCollection","closed","coordinate","polygonStart","polygonEnd","Adder","_partials","_n","quarterPi","hypot","areaSum","areaRingSum","areaStream","areaRingStart","areaRingEnd","areaPointFirst","areaPoint","boundsStream","X0","Y0","Z0","X1","Y1","Z1","Y2","Z2","centroidStream","centroidPoint","centroidLineStart","centroidLineEnd","centroidRingStart","centroidRingEnd","centroidPointFirstLine","centroidPointLine","centroidPointFirstRing","centroidPointRing","PathContext","_radius","pointRadius","lengthRing","lengthSum","lengthStream","lengthPointFirst","lengthPoint","cacheDigits","cacheAppend","cacheRadius","cacheCircle","PathString","projection","projectionStream","contextStream","lines","rejoin","Intersection","other","compareIntersection","startInside","subject","pointEqual","isSubject","spherical","cartesian","lambda","phi","cosPhi","cartesianDot","cartesianCross","cartesianAddInPlace","cartesianScale","vector","cartesianNormalizeInPlace","longitude","flatten","pointVisible","clipLine","sink","ringBuffer","ringSink","polygonStarted","pointRing","ringStart","ringEnd","sinPhi","winding","point0","lambda0","phi0","sinPhi0","cosPhi0","lambda1","sinPhi1","cosPhi1","point1","phi1","absDelta","antimeridian","intersection","phiArc","polygonContains","pointLine","ringSegments","validSegment","sign0","sign1","sinLambda0Lambda1","clipAntimeridianIntersect","direction","circleRadius","cosRadius","clipMax","clipMin","clipRectangle","visible","corner","comparePoint","ca","x__","y__","v__","x_","y_","v_","activeStream","bufferStream","clipStream","linePoint","polygonInside","cleanInside","compose","rotationIdentity","deltaLambda","deltaPhi","deltaGamma","rotationLambda","rotationPhiGamma","forwardRotationLambda","rotation","cosDeltaPhi","sinDeltaPhi","cosDeltaGamma","sinDeltaGamma","TransformStream","fit","fitBounds","clipExtent","fitExtent","fitSize","fitWidth","fitHeight","maxDepth","cosMinDistance","delta2","resampleLineTo","phi2","lambda2","dx2","dy2","dz","lambda00","b00","c00","resampleStream","ringPoint","resampleNone","transformRadians","scaleTranslateRotate","scaleTranslate","cosAlpha","sinAlpha","ai","fi","projectionMutator","projectAt","projectResample","projectTransform","projectRotateTransform","cacheStream","preclip","postclip","recenter","resample","transformRotate","clipAngle","cr","smallRadius","notHemisphere","two","n2","n2n2","n1n2","determinant","n1xn2","uu","polar","v00","point2","sinRadius","circleStream","reflectX","reflectY","conicProjection","parallels","conicEqualAreaRaw","sy0","forward","cylindricalEqualAreaRaw","r0y","conicEqualArea","azimuthalRaw","azimuthalInvert","cc","azimuthalEqualAreaRaw","cxcy","azimuthalEquidistantRaw","mercatorRaw","mercatorProjection","reclip","tany","conicConformalRaw","equirectangularRaw","conicEquidistantRaw","nx","A1","A2","A3","A4","equalEarthRaw","l2","l6","gnomonicRaw","naturalEarth1Raw","phi4","orthographicRaw","stereographicRaw","transverseMercatorRaw","sqrt2","SQRT1_2","mollweideBromleyTheta","cp","cpsinPhi","mollweideRaw","mollweideBromleyRaw","defaultPath","projectionProperties","proj","projections","getProjectionPath","albers","albersusa","lower48Point","alaskaPoint","hawaiiPoint","lower48","alaska","hawaii","pointStream","albersUsa","streams","azimuthalequalarea","azimuthalequidistant","conicconformal","conicequalarea","conicequidistant","equalEarth","equirectangular","gnomonic","mercator","mollweide","naturalEarth1","orthographic","stereographic","transversemercator","graticuleX","graticuleY","contours","smoothLinear","tz","contour","polygons","holes","startIndex","endIndex","isorings","hole","xt","yt","_0","ringContains","xi","yi","pj","xj","yj","segmentContains","collinear","Isocontour","transformPolygon","transformRing","density2D","weight","values0","values1","blurX","blurY","cellSize","LN2","KDE2D","levels","paths","transformPaths","PARAMS","Contour","GeoJSON","GeoPath","GeoPoint","GeoShape","Graticule","DX","DY","graticule","outline","extentMajor","extentMinor","stepMajor","stepMinor","Heatmap","dependency","$x","$y","$value","$max","Projection","xm","ym","xp","yp","leaf","defaultX","defaultY","quadtree","Quadtree","leaf_copy","_features","_points","lon","lat","geojson","initPath","shapeGenerator","shared","dep","opacity_","color_","can","getImageData","pix","putImageData","toCanvas","featurize","collectGeoJSON","treeProto","vx","vy","cover","xz","yz","quads","retainer","removeAll","visitAfter","dispatch","Dispatch","typename","T","taskHead","taskTail","timeout","pokeDelay","clockLast","clockNow","clockSkew","clock","performance","setFrame","requestAnimationFrame","clearNow","Timer","_time","_next","timer","restart","wake","timerFlush","sleep","nap","poke","clearInterval","setInterval","initialAngle","nodeById","nodeId","ForceMap","strength","collide","radii","iterations","ri","ri2","prepare","rj","jiggle","_nodes","_random","nbody","strengths","distanceMin2","distanceMax2","theta2","accumulate","distanceMin","distanceMax","link","links","distances","bias","distance","initializeStrength","initializeDistance","Forces","ForceParams","ForceConfig","ForceOutput","Force","setup","sim","forces","getForce","numForces","setForceParam","hierarchy","mapChildren","objectChildren","childs","Node","eachBefore","computeHeight","copyData","optional","required","constantZero","iters","simulation","alphaMin","alphaDecay","alphaTarget","velocityDecay","stepper","tick","initializeNodes","initializeForce","randomSource","closest","stopped","static","finish","eachAfter","ancestor","aNodes","ancestors","bNodes","leastCommonAncestor","descendants","leaves","extendBasis","enclosesWeakAll","enclosesNot","encloseBasis2","encloseBasis3","dr","enclosesWeak","encloseBasis","r21","r3","a2","a3","b2","b3","c3","d3","ab","place","score","packSiblingsRandom","circles","aa","sj","sk","pack","shuffle","packEncloseRandom","defaultRadius","radiusLeaf","packChildrenRandom","translateChild","preroot","ambiguous","imputed","defaultId","defaultParentId","parentId","stratify","nodeKey","currentId","currentParentId","nodeByKey","slash","parentof","defaultSeparation","nextLeft","nextRight","moveSubtree","wm","wp","nextAncestor","vim","TreeNode","meanXReduce","maxYReduce","squarifyRatio","sumValue","minValue","maxValue","newRatio","minRatio","dice","squarify","resquarify","_squarify","Nest","nest","valuesByKey","keyValue","HierarchyLayout","setParams","setFields","Output$3","Pack","Output$2","Partition","Stratify","positionNode","parentKey","Layouts","tidy","nodeSize","treeRoot","firstWalk","secondWalk","sizeNode","siblings","executeShifts","midpoint","vip","vop","vom","sip","sop","som","apportion","cluster","previousNode","meanX","maxY","leafLeft","leafRight","Output$1","Tree","TreeLinks","Tiles","binary","sums","valueOffset","valueTarget","valueLeft","valueRight","slicedice","Treemap","tile","paddingStack","paddingTop","paddingRight","paddingBottom","paddingLeft","treemap","ALPHA_MASK","getBuffer","DIV","SIZE","RIGHT0","RIGHT1","outOfBounds","textWidth","textHeight","collision","bm0","bm1","getRange","X_DIR","Y_DIR","Aligns","Baselines","boundary","isInside","anchorCode","TOP","MIDDLE","BOTTOM","placeAreaLabel","bitmaps","avoidBaseMark","markIndex","areaWidth","maxAreaWidth","tryLabel","_xMid","_yMid","swapTmp","labelPlaced","labelPlaced2","setRange","bm2","bitmap","labelLayout","texts","avoidMarks","lineAnchor","positions","getOffsets","anchors","getAnchors","grouptype","isGroupArea","markBoundary","infPadding","isNaiveGroupArea","maxTextWidth","maxTextHeight","_set","_clear","indexStart","indexEnd","clearRange","Bitmap","scaler","labelInside","baseMark","border","baseMarkContext","strokeContext","baseMarkBuffer","strokeBuffer","layer1","layer2","strokeAlpha","baseMarkAlpha","markBitmaps","baseBitmaps","sizeFactor","insideFactor","placeMarkLabel","Anchors","Label","Loess","null","Regression","dof","degreesOfFreedom","dom","elen","flen","Qnew","hh","bvirt","enow","fnow","eindex","findex","hindex","vec","C1","C2","orient2d","detleft","detright","det","detsum","acxtail","acytail","bcxtail","bcytail","ahi","alo","bhi","blo","_i","_j","u3","acx","bcx","acy","bcy","errbound","C1len","C2len","Dlen","orient2dadapt","EDGE_STACK","Delaunator","getX","defaultGetX","getY","defaultGetY","maxTriangles","_triangles","_halfedges","_hashSize","_hullPrev","_hullNext","_hullTri","_hullHash","_ids","_dists","hullPrev","hullNext","hullTri","hullHash","minY","minDist","i0x","i0y","i1x","i1y","minRadius","circumradius","i2x","i2y","quicksort","hull","triangles","halfedges","cl","circumcenter","_cx","_cy","_hullStart","hullSize","_hashKey","trianglesLen","_addTriangle","_legalize","pseudoAngle","ar","inCircle","hbl","_link","bp","tempDist","Voronoi","delaunay","xmin","xmax","_circumcenters","vectors","_init","circumcenters","inedges","ti","tj","_renderSegment","_project","renderBounds","renderCell","_clip","cellPolygon","_regioncode","_clipSegment","_step","neighbors","cj","loop","li","aj","lj","_cell","e0","_simplify","_clipInfinite","_clipFinite","e1","sx0","sx1","sy1","_edgecode","_edge","vx0","vy0","vxn","vyn","pointX","pointY","jitter","Delaunay","flatArray","flatIterable","_delaunator","_hullIndex","hullIndex","voronoi","dc","renderHull","renderPoints","hullPolygon","renderTriangle","trianglePolygon","defaultExtent","toPathString","cloudRadians","cloudSprite","contextAndRatio","di","sprite","w32","maxh","wcr","wsr","hcr","hsr","xoff","yoff","hasText","pixels","seenRow","cloudCollide","board","msx","cloudBounds","collideRects","archimedeanSpiral","functor","spirals","archimedean","rectangular","Wordcloud","spiral","words","cloud","dxdy","startX","startY","maxDelta","zeroArray","tags","fontSizeRange","fsize","sizeScale","array8","array16","array32","Dimension","query","onAdd","added","dim","SortedIndex","addi","oldv","oldi","addv","index0","value1","index1","reindex","CrossFilter","lengthen","_index","Bitmaps","_indices","ResolveFilter","reinit","eval","remMap","modMap","indexMap","incrementOne","incrementAll","old","lo1","hi1","lo0","hi0","ignore","pass","ASTNode","TokenBooleanLiteral","TokenEOF","TokenIdentifier","TokenKeyword","TokenNullLiteral","TokenNumericLiteral","TokenPunctuator","TokenStringLiteral","SyntaxArrayExpression","SyntaxBinaryExpression","SyntaxCallExpression","SyntaxConditionalExpression","SyntaxIdentifier","SyntaxLiteral","SyntaxLogicalExpression","SyntaxMemberExpression","SyntaxObjectExpression","SyntaxProperty","SyntaxUnaryExpression","MessageUnexpectedToken","MessageUnexpectedNumber","MessageUnexpectedString","MessageUnexpectedIdentifier","MessageUnexpectedReserved","MessageUnexpectedEOS","MessageInvalidRegExp","MessageUnterminatedRegExp","MessageStrictOctalLiteral","MessageStrictDuplicateProperty","ILLEGAL","DISABLED","RegexNonAsciiIdentifierStart","RegexNonAsciiIdentifierPart","keywords","scanUnicodeCodePointEscape","cu1","cu2","scanIdentifier","finishBinaryExpression","finishCallExpression","finishIdentifier","finishLiteral","finishMemberExpression","member","finishProperty","legalKeywords","finishArrayExpression","finishObjectExpression","search","$0","$1","exception","finishUnaryExpression","finishConditionalExpression","Constants","LN10","LOG2E","LOG10E","MIN_VALUE","Functions","codegen","cast","fncall","STRING","REGEXP","datetime","timezoneoffset","utcdate","utcday","utcyear","utcmonth","utchours","utcminutes","utcseconds","utcmilliseconds","upper","lower","regexp","if","allowed","forbidden","functions","globalvar","fieldvar","outputGlobal","globals","memberDepth","Generators","stripQuotes","phi00","deltaSum","ranges","areaRing","dLambda","sdLambda","adLambda","W0","W1","z0","boundsLineStart","boundsLineEnd","boundsRingPoint","boundsRingStart","boundsRingEnd","inflection","phii","lambdai","rangeCompare","rangeContains","centroidPointCartesian","centroidLinePointFirst","centroidLinePoint","centroidRingPointFirst","centroidRingPoint","cz","Intersect","Union","SelectionId","$selectionId","UNIT_INDEX","testPoint","dval","others","E_union","E_intersect","R_union","R_intersect","selectionVisitor","scope","indexName","dataName","getData","indataRef","tuplesRef","dateObj","setYear","ScalePrefix","SignalPrefix","dataVisitor","scaleVisitor","addScaleDependency","scaleName","scaleRef","getScale","nameOrFunction","maybeScale","geoMethod","methodName","globalMethod","geoArea","geoBounds","deltaMax","geoCentroid","channel_luminance_value","channelValue","luminance","equalArray","equalObject","removePredicate","accessors","treeNodes","_window","markname","functionContext","isDefined","isString","indexof","_len2","_key2","lastindexof","_len3","_key3","repl","_len4","_key4","pluck","contrast","color1","color2","lum1","lum2","monthFormat","monthAbbrevFormat","dayFormat","dayAbbrevFormat","inScope","pinchDistance","touches","pinchAngle","screen","containerSize","container","clientWidth","clientHeight","windowSize","innerWidth","innerHeight","bandspace","setdata","pathShape","retval","toggle","predicate","_trigger","lassoAppend","lasso","lassoPath","_ref","intersectLasso","pixelLasso","bb","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","testx","testy","intersections","prevX","prevY","pointInPolygon","eventFunctions","thisPrefix","astVisitors","codegenParams","fnctx","visitors","__bandwidth","_bandwidth","_range","ref","internalScaleFunctions","codeGenerator","expressionFunction","signalName","getSignal","signalRef","$expr","$fields","$params","miss","unitIdx","isMulti","vl5","resUnit","resolved","multiRes","acc","Skip","Swap","canonicalType","expressionCodegen","parameter","adjustSpatial","lt","gt","_compare","parseParameter","PARSERS","$ref","$key","$flat","parseParameters","parameterExpression","$field","$name","$encode","enc","encodeExpression","$output","$compare","$order","$tupleid","$subflow","subctx","operators","Context","Subcontext","ariaLabel","subcontext","$ingest","$format","$request","unresolved","signal","operatorExpression","eventExpression","handlerExpression","eventConfig","parseOperator","parseOperatorParameters","parseStream","parseUpdate","srcid","getState","dataset","setState","substate","Default","setCursor","cursor","globalCursor","dataref","_runtime","_viewWidth","_viewHeight","VIEW","NO_TRAP","trap","trackEventListener","_eventListeners","permit","_eventConfig","itemFilter","markTarget","invoke","vega","RadioClass","Event","wrapper","checked","option","valuesEqual","selected","selectedIndex","prepend","initializeRenderer","paddingObject","renderHeadless","_scenegraph","Width","Height","dataTest","signalTest","formatArray","formatTooltip","View","_elBind","_renderType","_renderer","_handler","_globalCursor","_preventDefault","_timers","_resizeListeners","unpack","initializeEventConfig","runtime","_bind","bindings","_resize","resetSize","_resizeWidth","_resizeHeight","resizePadding","initializeResize","_background","user","hover","lookupSignal","findOperatorHandler","addOperatorListener","removeOperatorListener","_desc","_resetRenderer","rerun","addResizeListener","removeResizeListener","addSignalListener","removeSignalListener","addDataListener","removeDataListener","_restart","elapsed","timestamp","prevent","allow","itemGroup","extension","eventExtend","timers","listeners","hoverSet","leaveSet","elBind","initializeAria","prevHandler","initializeHandler","binding","mime","blob","Blob","URL","createObjectURL","toBlobURL","toSVG","LBRACK","RBRACK","LBRACE","RBRACE","COLON","COMMA","NAME","GT","DEFAULT_MARKS","DEFAULT_SOURCE","MARKS","eventSelector","parseMerge","parseSelector","endChar","pushChar","popChar","parseBetween","parseThrottle","parseAutosize","parsePadding","encoder","addEncode","addEncoders","extendEncode","MarkRole","AxisDomainRole","AxisGridRole","AxisLabelRole","AxisTickRole","AxisTitleRole","LegendBandRole","LegendEntryRole","LegendGradientRole","LegendLabelRole","LegendSymbolRole","LegendTitleRole","TitleTextRole","TitleSubtitleRole","applyDefault","entry$1","_color","resolveField","parseEncode","applyDefaults","parse$1","OUTER","OUTER_INVALID","outerError","parseSignal","addSignal","addBinding","Entry","refs","fieldRef$1","keyFieldRef","compareRef","aggrField","Scope$1","isSignal","hasSignal","specValue","deref","mergeStream","nestedStream","eventStream","streamParameters","addStream","markrole","filterMark","OP_VALUE_EXPR","mergeSources","FIELD_REF_ID","MULTIDOMAIN_SORT_OPS","parseScale","parseScaleDomain","parseScaleRange","parseLiteral","parseScaleInterpolate","parseScaleNice","parseArray","objectProperty","parseScaleBins","dataLookupError","explicitDomain","multipleDomain","singularDomain","valuesRef","parseSort","domainRef","extentRef","coll","addDataPipeline","fieldRef","ordinalMultipleDomain","quantileMultipleDomain","numericMultipleDomain","countsRef","sortRef","multidomain","parseParameter$1","Vertical","Index","Offset","Perc","Perc2","Value","GuideLabelStyle","GuideTitleStyle","GroupTitleStyle","GroupSubtitleStyle","Size","LegendScales","GroupMark","RectMark","RuleMark","SymbolMark","TextMark","guideGroup","isVertical","symbolDirection","gradientDirection","gradientLength","gradientWidth","gradientThickness","gradientHeight","entryColumns","getEncoding","anchorExpr","alignExpr$1","extendOffset","guideMark","extras","legendGradient","userEncode","thickness","legendGradientDiscrete","dataRef","vv","alignExpr","baselineExpr","legendGradientLabels","overlap","labelLimit","gradientLabelLimit","labelOffset","gradientLabelOffset","legendSymbolGroups","symbolOffset","valueRef","xSignal","yEncode","baseFill","baseStroke","symbolBaseFillColor","symbolBaseStrokeColor","facet","isL","isR","isLR","isVG","exprAlign","exprAnchor","exprAngle","exprBaseline","getRole","parseTransform","pdef","lookupRef","parseIndexParameter","parseSubParameter","parseSubParameters","projectionRef","parameterValue","isExpr","isField","isCompare","outerExpr","exprRef","outerField","isData","getDataRef","DataScope","aggregate","fieldKey","addSortField","ds","optype","sortKey","parseTrigger","trigger","parseMark","layoutRef","boundRef","keyRef","parseData$1","joinRef","$context","markpath","markRef","generates","encodeRef","pushState","subscope","addData","toRuntime","parseFacet","parseSubflow","popState","tol","parseOverlap","sieve","buildLegendEncode","getChannel","fromEntries","angleExpr","groupEncode","getSign","ifLeftTopExpr","ifX","ifXEnc","ifY","ifYEnc","ifTop","ifTopExpr","ifRight","ifRightExpr","$orient","ifEnc","ifExpr","isSimple","toExpr","ifOrient","fallback","axisConfig","styleProp","flushExpr","parseAxis","or","scaleType","axisBand","xyKeys","axisX","axisY","orientKeys","axisTop","axisBottom","axisLeft","axisRight","axisEncode","tickBand","ticksRef","tickMinStep","vscale","gridScale","tickPos","gridStart","gridEnd","axisGrid","tickSize","axisTicks","flushOffset","labelAlign","labelBaseline","flushOn","offsetExpr","axisLabels","pos0","pos1","axisDomain","titlePos","autoY","autoX","autoLayout","axisTitle","buildAxisEncode","parseScope","preprocessed","addProjection","parseProjection","addScale","initScale","upstream","analyze","parseData","isSubscope","addUpdate","streamSource","parseSignalUpdates","axes","legendEncode","entryLayout","scaleCount","legendType","entryRef","legendSymbolLayout","getStyle","getFontSize","sizeExpression","_anchor","legendTitle","parseLegend","buildTitle","titleEncode","buildSubTitle","parseTitle","parseLambdas","rootEncode","signalObject","Scope","lambdas","_id","_subid","_nextsub","_parent","_encode","_lookup","_markpath","Subscope","propertyLambda","arrayLambda","objectLambda","defaultFont","defaultColor","lightGray","square","subtitlePadding","bandPosition","domainWidth","domainColor","gridWidth","gridColor","labelAngle","labelPadding","tickColor","tickOffset","tickRound","tickWidth","gridAlign","columnPadding","rowPadding","gradientStrokeColor","gradientStrokeWidth","labelOverlap","symbolLimit","symbolType","symbolSize","symbolStrokeWidth","titleLimit","titleOrient","category","heatmap","ramp","collectSignals","parseView","vref","annotate","isExpr$1","sig","hasOwnSignal","addScaleProj","projectionType","dataScope","Ops","Unary","ms","EventFunctions","DisallowedMethods","setImmediate","Visitors","interpret","flatMap","isLogicalOr","isLogicalAnd","and","isLogicalNot","not","forEachLeaf","subop","normalizeLogicalComposition","normalizer","deepEqual","duplicate","omit","isNullOrFalse","mergeDeep","dest","deepMerge_","unique","isEqual","dictKeys","otherKeys","setEqual","hasIntersection","prefixGenerator","wrappedWithAccessors","computedPrefixes","fieldIntersection","isEmpty","varName","alphanumericS","logicalExpr","deleteNestedProperty","orderedProps","titleCase","accessPathWithDatum","pieces","flatAccessWithDatum","escapePathAccess","replacePathInField","replaceAll","replacement","removePathFromField","accessPathDepth","getFirstDefined","idCounter","uniqueId","resetIdCounter","internalField","isInternalField","normalizeAngle","isNumeric","CONDITIONAL_AXIS_PROP_INDEX","part","vgProp","labelColor","labelFont","labelFontSize","labelFontStyle","labelFontWeight","labelOpacity","gridDash","gridDashOffset","gridOpacity","tickDash","tickDashOffset","tickOpacity","isConditionalAxisValue","AXIS_PARTS","AXIS_PROPERTY_TYPE","gridCap","domainCap","domainDash","domainDashOffset","domainOpacity","labelBound","labelFlush","labelFlushOffset","labelLineHeight","labelSeparation","tickCap","titleAlign","titleAngle","titleBaseline","titleColor","titleFont","titleFontSize","titleFontStyle","titleFontWeight","titleLineHeight","titleOpacity","titleX","titleY","tickExtra","COMMON_AXIS_PROPERTIES_INDEX","AXIS_PROPERTIES_INDEX","labelExpr","encoding","isAxisProperty","AXIS_CONFIGS","axisDiscrete","axisPoint","axisQuantitative","axisTemporal","axisXBand","axisXDiscrete","axisXPoint","axisXQuantitative","axisXTemporal","axisYBand","axisYDiscrete","axisYPoint","axisYQuantitative","axisYTemporal","AGGREGATE_OP_INDEX","MULTIDOMAIN_SORT_OP_INDEX","isArgminDef","isArgmaxDef","isAggregateOp","COUNTING_OPS","isCountingAggregateOp","SUM_OPS","SHARED_DOMAIN_OP_INDEX","__rest","propertyIsEnumerable","ROW","COLUMN","FACET","RADIUS","RADIUS2","THETA","THETA2","LATITUDE","LONGITUDE","LATITUDE2","LONGITUDE2","COLOR","FILL","STROKE","SHAPE","ANGLE","OPACITY","FILLOPACITY","STROKEOPACITY","STROKEWIDTH","STROKEDASH","TEXT","ORDER","DETAIL","KEY","TOOLTIP","HREF","DESCRIPTION","POLAR_POSITION_CHANNEL_INDEX","radius2","isPolarPositionChannel","GEO_POSIITON_CHANNEL_INDEX","longitude2","latitude","latitude2","GEOPOSITION_CHANNELS","UNIT_CHANNEL_INDEX","detail","isColorChannel","channel","FACET_CHANNEL_INDEX","FACET_CHANNELS","CHANNEL_INDEX","CHANNELS","_o","_d","_tt1","SINGLE_DEF_CHANNEL_INDEX","_r","_c","_f","SINGLE_DEF_UNIT_CHANNEL_INDEX","isChannel","SECONDARY_RANGE_CHANNEL","isSecondaryRangeChannel","getMainRangeChannel","getVgPositionChannel","getSecondaryRangeChannel","getSizeChannel","_latitude","_longitude","_latitude2","_longitude2","_theta","_theta2","_radius2","NONPOSITION_CHANNEL_INDEX","NONPOSITION_CHANNELS","POSITION_SCALE_CHANNEL_INDEX","POSITION_SCALE_CHANNELS","isXorY","POLAR_POSITION_SCALE_CHANNEL_INDEX","POLAR_POSITION_SCALE_CHANNELS","getPositionScaleChannel","sizeType","_tt","_hr","_u","_al","_dd","_oo","NONPOSITION_SCALE_CHANNEL_INDEX","NONPOSITION_SCALE_CHANNELS","SCALE_CHANNEL_INDEX","SCALE_CHANNELS","isScaleChannel","ALL_MARKS","bar","geoshape","_g","ALL_MARKS_EXCEPT_GEOSHAPE","rangeType","binToString","normalizeBin","isSelectionExtent","isBinning","isBinParams","binned","isBinned","autoMaxBins","invalidSpec","FIT_NON_SINGLE","containerSizeNonSingle","containerSizeNotCompatibleWithAutosize","droppingFit","unknownField","cannotProjectOnChannelWithoutField","cannotProjectAggregate","selectionNotSupported","columnsNotSupportByRowCol","differentParse","local","customFormatTypeNotAllowed","invalidFieldType","droppingColor","emptyFieldDef","fieldDef","incompatibleChannel","markOrFacet","when","facetChannelShouldBeDiscrete","discreteChannelCannotEncode","unaggregateDomainHasNoEffectForRawField","unaggregateDomainWithNonSharedDomainOp","unaggregatedDomainWithLogScale","scalePropertyNotWorkWithScaleType","propName","stepDropped","MORE_THAN_ONE_SORT","invalidTimeUnit","unitName","errorBand1DNotSupport","channelRequiredForBinned","main","isDateTime","TIMEUNIT_PARTS","MONTHS","SHORT_MONTHS","DAYS","SHORT_DAYS","dateTimeParts","lowerM","monthIndex","shortM","shortMonthIndex","normalizeMonth","normalizeQuarter","lowerD","dayIndex","shortD","shortDayIndex","normalizeDay","timeUnit","dateTimeToExpr","LOCAL_SINGLE_TIMEUNIT_INDEX","isUTCTimeUnit","VEGALITE_TIMEFORMAT","getTimeUnitParts","containsTimeUnit","fullTimeUnit","timeUnitSpecifierExpression","timeUnitParts","normalizeTimeUnit","getLocalTimeUnit","isVgRangeStep","isDataRefDomain","VG_MARK_CONFIGS","VG_MARK_INDEX","VG_CORNERRADIUS_CHANNELS","isFieldEqualPredicate","isFieldLTPredicate","isFieldLTEPredicate","lte","isFieldGTPredicate","isFieldGTEPredicate","gte","isFieldRangePredicate","isFieldOneOfPredicate","oneOf","in","isFieldPredicate","predicateValueExpr","valueExpr","wrapTime","fieldFilterExpression","useInRange","_a","fieldExpr","lastTimeUnit","dateExpr","dateTimeExprToExpr","vgField","predicateValuesExpr","isFieldValidPredicate","fieldValidPredicate","exprs","normalizePredicate","Type","quantitative","temporal","nominal","QUANTITATIVE","ORDINAL","TEMPORAL","NOMINAL","GEOJSON","ScaleType","LINEAR","LOG","POW","SQRT","SYMLOG","IDENTITY","SEQUENTIAL","TIME","QUANTILE","QUANTIZE","THRESHOLD","BIN_ORDINAL","POINT","BAND","SCALE_CATEGORY_INDEX","scaleCompatible","scaleType1","scaleType2","scaleCategory1","scaleCategory2","SCALE_PRECEDENCE_INDEX","scaleTypePrecedence","CONTINUOUS_TO_CONTINUOUS_SCALES","CONTINUOUS_TO_CONTINUOUS_INDEX","QUANTITATIVE_SCALES_INDEX","CONTINUOUS_TO_DISCRETE_INDEX","CONTINUOUS_DOMAIN_INDEX","DISCRETE_DOMAIN_INDEX","hasDiscreteDomain","hasContinuousDomain","isContinuousToContinuous","isContinuousToDiscrete","isSelectionDomain","SCALE_PROPERTY_INDEX","rangeMax","rangeMin","NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTY_INDEX","NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES","scaleTypeSupportProperty","channelScalePropertyIncompatability","isExprRef","replaceExprRefInIndex","newIndex","signalRefOrValue","ARC","AREA","BAR","IMAGE","LINE","RECT","RULE","TICK","TRAIL","CIRCLE","SQUARE","GEOSHAPE","isPathMark","isRectBasedMark","PRIMITIVE_MARKS","isMarkDef","FILL_STROKE_CONFIG","VL_ONLY_MARK_CONFIG_PROPERTIES","invalid","timeUnitBand","timeUnitBandPosition","MARK_CONFIGS","BAR_CORNER_RADIUS_INDEX","midPointRefWithPositionInvalidTest","channelDef","markDef","midPoint","isFieldDef","wrapPositionInvalidTest","getMarkPropOrConfig","fieldInvalidTestValueRef","fieldInvalidPredicate","zeroValueRef","valueRefForFieldOrDatumDef","isDatumDef","interpolatedSignalRef","fieldOrDatumDef","fieldOrDatumDef2","startSuffix","channel2Def","defaultRef","isFieldOrDatumDef","isTypedFieldDef","getBand","fieldDef2","isMidPoint","binSuffix","binRequiresRange","isValueDef","offsetMixins","widthHeightValueOrSignalRef","signalOrValueRef","isCustomFormatType","customFormatExpr","BIN_RANGE_DELIMITER","formatSignalRef","normalizeStack","_b","formatCustomType","fieldToFormat","isFieldOrDatumDefForTimeFormat","rawTimeFormat","isUTCScale","formatExpression","timeFormatExpression","isScaleFieldDef","channelDefType","binFormatExpression","formatExpr","datumDef","datumDefToExpr","guideFormat","omitTimeFormatConfig","specifiedFormat","guideFormatType","binNumberFormatExpr","startField","endField","DEFAULT_SORT_OP","SORT_BY_CHANNEL_INDEX","isSortByChannel","isSortByEncoding","isSortField","isSortArray","isFacetMapping","isFacetFieldDef","isFacetSpec","toFieldDefBase","isSortableFieldDef","getMarkConfig","fieldChannel","hasBand","isConditionalDef","hasConditionalFieldDef","hasConditionalFieldOrDatumDef","isContinuousFieldOrDatumDef","isNumericDataDef","isPositionFieldOrDatumDef","isMarkPropFieldOrDatumDef","isStringFieldOrDatumDef","toStringFieldDef","argAccessor","isCount","nofn","isOpFieldDef","tu","timeUnitToString","forAs","defaultTitleFormatter","fieldTitle","timeUnitParams","functionalTitleFormatter","countTitle","verbalTitleFormatter","titleFormatter","setTitleFormatter","formatter","allowDisabling","includeDefault","guideTitle","getGuide","defaultTitle","getFormatMixins","guide","getFieldDef","getFieldOrDatumDef","initChannelDef","initFieldOrDatumDef","fd","customFormatTypes","guideType","newGuide","initFieldDef","initDatumDef","compositeMark","fullType","getFullName","newType","defaultType","compatible","warning","COMPATIBLE","channelCompatibility","sub","labelOrient","isTimeFieldDef","undefinedIfExprNotRequired","isTime","isLocalSingleTimeUnit","valueArray","extractTitleConfig","titleConfig","subtitleColor","subtitleFont","subtitleFontSize","subtitleFontStyle","subtitleFontWeight","subtitleLineHeight","titleMarkConfig","nonMark","subtitleMarkConfig","isText","signalOrValueRefWithCondition","conditionalSignalRefOrValue","exprFromValueOrSignalRef","signalOrStringValue","getStyles","vgChannel","ignoreVgConfig","getMarkStyleConfig","styleConfigIndex","getStyleConfig","styles","styleConfig","sortParams","orderDef","fieldRefOption","orderChannelDef","mergeTitleFieldDefs","f1","f2","fdToMerge","fieldDef1","mergeTitle","title1","title2","mergeTitleComponent","v1Val","v2Val","explicit","isUnitSpec","CompositeMarkNormalizer","hasMatchingType","getMarkType","channelHasField","isAggregate","extractTransformsFromEncoding","oldEncoding","aggOp","isTitleDefined","newField","newFieldDef","aggregateEntry","secondaryChannel","isNonPositionScaleChannel","initEncoding","normalizedEncoding","markSupported","getSupportedMark","supportMark","primaryFieldDef","markChannelCompatible","normalizeEncoding","newChannelDef","mapping","pathGroupingFields","details","getCompositeMarkTooltip","tooltipSummary","continuousAxisChannelDef","encodingWithoutContinuousAxis","withFieldName","fiveSummaryTooltip","fieldPrefix","titlePrefix","mainTitle","getTitle","escape","tooltipFieldDefs","channelDefArray","fieldDefs","makeCompositeAggregatePartFactory","compositeMarkDef","continuousAxis","sharedEncoding","compositeMarkConfig","partName","positionPrefix","endPositionPrefix","extraEncoding","partLayerMixins","partBaseSpec","compositeMarkContinuousAxis","continuousAxisChannelDef2","continuousAxisChannelDefError","continuousAxisChannelDefError2","filterAggregateFromChannelDef","continuousAxisWithoutAggregate","compositeMarkOrient","xAggregate","yAggregate","BOXPLOT","boxPlotNormalizer","normalizeBoxPlot","getBoxPlotType","_encoding","selection","_p","outerSpec","boxplot","sizeValue","boxPlotType","ticksOrient","boxOrient","customTooltipWithoutAggregatedField","continuousFieldName","boxplotSpecificAggregate","boxParamsQuartiles","postAggregateCalculates","calculate","oldEncodingWithoutContinuousAxis","filteredEncoding","customTooltipWithAggregatedField","filterTooltipWithAggregatedField","boxParams","encodingWithoutSizeColorAndContinuousAxis","makeBoxPlotPart","makeBoxPlotExtent","makeBoxPlotBox","makeBoxPlotMidTick","fiveSummaryTooltipEncoding","endTick","whiskerTooltipEncoding","whiskerLayers","boxLayers","layer","lowerBoxExpr","upperBoxExpr","iqrExpr","lowerWhiskerExpr","upperWhiskerExpr","joinaggregateTransform","joinaggregate","filteredWhiskerSpec","encodingWithoutSizeColorContinuousAxisAndTooltip","axisWithoutTitle","outlierLayersMixins","filteredLayersMixins","filteredLayersMixinsTransforms","continousAxisField","ERRORBAR","errorBarNormalizer","normalizeErrorBar","tooltipEncoding","errorBarParams","makeErrorBarPart","errorbar","inputType","xError","xError2","yError","yError2","errorBarIsInputTypeRaw","isTypeAggregatedUpperLower","errorBarIsInputTypeAggregatedUpperLower","isTypeAggregatedError","errorBarIsInputTypeAggregatedError","errorBarOrientAndInputType","errorBarSpecificAggregate","tooltipTitleWithFieldName","getTitlePrefix","centerOp","lowerExtentOp","upperExtentOp","postAggregateCalculate","errorBarAggregationAndCalculation","_e","oldAggregate","oldGroupBy","ERRORBAND","errorBandNormalizer","normalizeErrorBand","errorBandDef","makeErrorBandPart","errorband","is2D","bandMark","bordersMark","compositeMarkRegistry","VL_ONLY_LEGEND_CONFIG","HEADER_TITLE_PROPERTIES_MAP","HEADER_LABEL_PROPERTIES_MAP","labelAnchor","HEADER_TITLE_PROPERTIES","HEADER_LABEL_PROPERTIES","HEADER_CONFIGS","headerRow","headerColumn","headerFacet","LEGEND_SCALE_CHANNELS","COMMON_LEGEND_PROPERTY_INDEX","clipHeight","fillColor","gradientOpacity","legendX","legendY","strokeColor","symbolDash","symbolDashOffset","symbolFillColor","symbolOpacity","symbolStrokeColor","assembleParameterSignals","SELECTION_ID","defaultConfig","single","multi","encodings","isLegendBinding","isLegendStreamBinding","isConcatSpec","isVConcatSpec","isHConcatSpec","isStep","isFrameMixins","COMPOSITION_LAYOUT_PROPERTIES","spacing","getViewConfigContinuousSize","viewConfig","getViewConfigDiscreteStep","getViewConfigDiscreteSize","DEFAULT_STEP","continuousWidth","continuousHeight","binSpacing","continuousBandSize","outliers","borders","pointPadding","barBandPaddingInner","rectBandPaddingInner","minBandSize","minFontSize","maxFontSize","minOpacity","maxOpacity","minSize","minStrokeWidth","maxStrokeWidth","quantileCount","quantizeCount","gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity","tab10","DEFAULT_FONT_SIZE","guideLabel","groupTitle","groupSubtitle","DEFAULT_COLOR","gray0","gray1","gray2","gray3","gray4","gray5","gray6","gray7","gray8","gray9","gray10","gray11","gray12","gray13","gray14","gray15","getAxisConfigInternal","axisConfigInternal","configPropsWithExpr","initConfig","specifiedConfig","restConfig","mergedConfig","fontConfig","colorSignalConfig","fontSizeSignalConfig","outputConfig","markConfigType","axisConfigType","headerConfigType","styleConfigInternal","getStyleConfigInternal","MARK_STYLES","VL_ONLY_CONFIG_PROPERTIES","VL_ONLY_ALL_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX","redirectConfigToStyleConfig","toProp","compositeMarkPart","propConfig","isLayerSpec","SpecMapper","mapFacet","isRepeatSpec","mapRepeat","mapHConcat","mapVConcat","mapConcat","mapLayerOrUnit","mapLayer","mapUnit","subspec","hconcat","vconcat","STACK_OFFSET_INDEX","STACKABLE_MARKS","STACK_BY_DEFAULT_MARKS","potentialStackedChannel","xDef","yDef","xScale","yScale","stackedFieldDef","stackedField","dimensionChannel","getDimensionChannel","dimensionDef","dimensionField","stackBy","cDef","disallowNonLinearStack","groupbyChannel","groupbyField","dropLineAndPoint","dropLineAndPointFromConfig","getPointOverlay","markConfig","getLineOverlay","PathOverlayNormalizer","pointOverlay","lineOverlay","stackProps","overlayEncoding","stackFieldChannel","RangeStepNormalizer","sizeMixins","defWithoutScale","scaleWithoutRangeStep","replaceRepeaterInFacet","repeater","replaceRepeaterInMapping","replaceRepeaterInFieldDef","replaceRepeaterInEncoding","replaceRepeatInProp","isRepeatRef","replaceRepeaterInFieldOrDatumDef","replaceRepeaterInChannelDef","RuleForRangedLineNormalizer","mainChannelDef","hasX2","hasY2","mergeEncoding","parentEncoding","parentChannelDef","mergedChannelDef","mergeProjection","parentProjection","normalizedSpec","normalizeGenericSpec","sizeInfo","isFitCompatible","autosizeDefault","_normalizeAutoSize","normalizeAutoSize","nonFacetUnitNormalizers","hasRow","hasColumn","hasFacet","mapFacetedUnit","specWithReplacedEncoding","mapUnitWithParentEncodingOrProjection","normalizeLayerOrUnit","unitNormalizer","isLayerRepeatSpec","mapLayerRepeat","mapNonLayerRepeat","childSpec","repeaterPrefix","layerValue","childRepeater","childName","remainingProperties","repeatValues","repeatValue","rowValue","columnValue","mergedProjection","mergedEncoding","facetMapping","getFacetMappingAndLayout","newEncoding","facets","defWithoutLayout","otherParams","TOP_LEVEL_PROPERTIES","extractTopLevelProperties","includeParams","Split","combine","getWithExplicit","setWithExplicit","copyKeyFromSplit","copyKeyFromObject","copyAll","makeExplicit","makeImplicit","tieBreakByComparing","propertyOf","diff","defaultTieBreaker","mergeValuesWithExplicit","tieBreaker","AncestorParse","parseNothing","isUrlData","isInlineData","isNamedData","isGenerator","isSequenceGenerator","isSphereGenerator","isGraticuleGenerator","DataSourceType","isFilter","isImputeSequence","isLookup","isPivot","isDensity","isRegression","isLoess","isSample","isWindow","isJoinAggregate","isFlatten","isCalculate","isBin","isImpute","isTimeUnit","isStack","isFold","wrapCondition","refFn","vgConditions","conditionValueRef","isConditionalSelection","parseSelectionPredicate","textRef","tooltipRefForEncoding","reactiveGeom","tooltipRefFromChannelDef","markTooltip","tooltipData","toSkip","fDef","mainChannel","channel2","keyValues","nonPosition","getScaleComponent","markType","transparentIfNeeded","defaultFill","defaultStroke","colorVgChannel","fillStrokeMarkDefAndConfig","getOffset","offsetChannel","getOffsetChannel","markDefOffsetValue","pointPosition","defaultPos","pointPositionDefaultRef","getName","positionRef","definedValueOrConfig","domainDefinitelyIncludesZero","sizeRef","ALIGNED_X_CHANNEL","BASELINED_Y_CHANNEL","middle","vgAlignedPositionChannel","defaultAlign","alignChannel","alignExcludingSignal","pointOrRangePosition","defaultPos2","rangePosition","sizeChannel","pos2Mixins","baseChannel","position2Ref","position2orSize","pointPosition2OrSize","rectPosition","channelDef2","hasSizeDef","isBarBand","component","axisTranslate","vgChannel2","rectBinRef","getBinSpacing","startRef","rectBinPosition","vgSizeChannel","useVlSizeChannel","sizeFromMarkOrConfig","defaultSizeRef","posRef","sizeOffset","positionAndSize","discreteBandSize","scaleRange","spacingOffset","reverseExpr","translateExpr","ALWAYS_IGNORE","baseEncodeEntry","markDefProperties","wrapAllFieldsInvalid","enableAria","ariaRoleDesc","descriptionValue","filterIndex","aggregator","scaleComponent","allFieldsInvalidPredicate","valueIfDefined","VORONOI","nearest","selCmpt","hasChannel","cellDef","isVoronoi","getSizeSignalRef","exists","DataFlowNode","debugName","_children","addChild","numChildren","oldChild","insertAsParentOf","swapWithParent","newParent","OutputNode","refCounts","_source","_name","cloneObj","dependentFields","producedFields","_hash","getSource","isRequired","setSource","TimeUnitNode","formula","reduceFieldDef","timeUnitComponent","isUnitModel","normalizedTimeUnit","removeFormulas","newFormula","assemble","TUPLE_FIELDS","SelectionProjectionComponent","hasField","selDef","sg","cfg","parseInit","allSignals","hasLegend","inputBindings","origDef","topLevelSignals","sgname","assembleInit","TUPLE","TOGGLE","modifyExpr","tpl","findIndex","addClear","vIdx","visual","tIdx","scaleBindings","isTopLevelLayer","namedSg","VL_SELECTION_RESOLVE","isLayerModel","legendBindings","projLen","legendFilter","selName","markName","sgName","ANCHOR","DELTA","hasScales","onDelta","sizeSg","scaleCmpt","compilers","forEachTransform","assembled","dateTimeToTimestamp","assembleUnitSelectionMarks","forEachSelection","selCompiler","txCompiler","cleanupEmptyOnArray","BRUSH","SCALE_TRIGGER","fieldsSg","dataSignals","scaleTriggers","filterExpr","cs","vname","scaled","coord","channelSignals","toNum","xvname","yvname","STORE","vgStroke","singleOrMultiSignals","selections","sel","facetModel","isFacetModel","getFacetModel","requiresSelectionId","startsWithDatum","getDependentFields","dependents","FilterNode","_dependentFields","dfnode","stores","predicateStr","getSelectionComponent","tunode","parseSelectionBinExtent","filterOp","isSelectionPredicate","setAxisEncode","vgRef","assembleAxis","axisCmpt","disable","propType","propValue","valueOrSignalRef","conditions","propIndex","valueOrSignalCRef","mainExtracted","hasAxisPart","titleString","assembleTitle","assembleAxisSignals","getAxisConfigFromConfigTypes","configTypes","configType","orient1","orientConfig1","orientConfig2","conditionalOrientAxisConfig","getAxisConfigStyle","axisConfigTypes","toMerge","getAxisConfig","axisConfigs","configFrom","configValue","axisRules","defaultGrid","gridChannel","defaultLabelAlign","defaultLabelBaseline","defaultLabelFlush","hasTimeUnit","defaultLabelOverlap","defaultTickCount","fieldDefTitle","getFieldDefTitle","typedFieldDef","defaultZindex","normalizeAngleExpr","alwaysIncludeMiddle","mainOrient","CalculateNode","forEachFieldDef","sortValue","sortArrayIndexField","getHeaderChannel","getHeaderProperty","headerSpecificConfig","getHeaderProperties","HEADER_CHANNELS","HEADER_TYPES","assembleTitleGroup","facetFieldDef","headerChannel","defaultHeaderGuideBaseline","defaultHeaderGuideAlign","assembleHeaderProperties","assembleHeaderGroups","layoutHeader","headerType","headerComponent","assembleHeaderGroup","getSort","assembleLabelTitle","titleTextExpr","isFacetWithoutRowCol","hasAxes","sizeSignal","LAYOUT_TITLE_BAND","getLayoutTitleBand","propertiesMap","assembleLayoutSignals","sizeSignals","layoutSize","stepSignal","sizeExpr","isWidth","safeExpr","cardinality","getSizeTypeFromLayoutSizeType","layoutSizeType","guideEncodeEntry","valueDef","defaultScaleResolve","isConcatModel","parseGuideResolve","channelScaleResolve","LEGEND_COMPONENT_PROPERTY_INDEX","LEGEND_COMPONENT_PROPERTIES","LegendComponent","legendEncodeRules","symbolsSpec","legendCmpt","_h","propsList","applyMarkConfig","getMaxValue","getFirstConditionValue","selectedCondition","gradientSpec","specifiedlabelsSpec","labelsSpec","entriesSpec","getConditionValue","conditionalDef","reducer","hasConditionalValueDef","legendRules","legendConfig","gradientLengthSignal","defaultGradientLength","shapeChannelDef","markShape","defaultSymbolType","getDirection","defaultDirection","legendComponent","parseLegendForChannel","parseUnitLegend","mergeLegendComponent","parseNonUnitLegend","isExplicit","getLegendDefWithScale","legendSelections","parseInteractiveLegend","getLegendType","ruleParams","legendEncoding","legendEncodeParams","legendEncodingPart","mergedLegend","childLegend","mergedOrient","childOrient","typeMerged","mergedValueWithExplicit","st1","st2","assembleLegends","legendComponentIndex","legendByDomain","domainHash","mergedLegendComponent","setLegendEncode","assembleLegend","assembleProjectionForModel","fits","lookupDataSource","PROJECTION_PROPERTIES","ProjectionComponent","specifiedProjection","isFit","hasProjection","posssiblePair","requestDataName","Main","gatherFitData","projectionName","parseUnitProjection","nonUnitProjection","mergable","allPropertiesShared","mergeIfNoConflict","modelProjection","renameProjection","parseNonUnitProjections","binKey","getBinSignalName","createBinComponent","isBinTransform","normalizedBin","extentSignal","getSignalsFromModel","binComponent","BinNode","binComponentIndex","formulaAs","rangeFormula","renameSignal","binAs","remainingAs","binTrans","AggregateNode","dimensions","groupBy","meas","argField","scaleDomain","posChannel","getPositionChannelFromLatLong","addDimension","parentMeasures","childMeasures","mergeMeasures","addDimensions","alias","FacetNode","sortField","sortIndexField","childModel","depFields","getChildIndependentFieldsWithStep","childIndependentFieldsWithStep","childScaleComponent","getFieldFromDomain","assembleDomain","assembleRowColumnHeaderData","crossedDataName","childChannel","assembleFacetHeaderData","hasSharedAxis","facetData","unquote","getImplicitFromFilterTransform","ParseNode","_parse","ancestorParse","makeWithAncestors","parsedAs","assembleFormatParse","formatParse","assembleTransforms","onlyNested","IdentifierNode","GraticuleNode","SequenceNode","SourceNode","_data","defaultExtension","_generator","hasName","_modified","receiver","privateMap","isDataSourceNode","Optimizer","setModified","modifiedFlag","BottomUpOptimizer","getNodeDepths","depths","optimize","topologicalSort","TopDownOptimizer","MergeIdenticalNodes","mergeNodes","mergedNode","hashes","buckets","RemoveUnnecessaryIdentifierNodes","RemoveDuplicateTimeUnits","timeUnitFields","RemoveUnnecessaryOutputNodes","MoveParseUp","MergeParse","originalChildren","parseChildren","commonParse","conflictingParse","parseNode","mergedParseNode","childNode","RemoveUnusedSubtrees","MergeTimeUnits","timeUnitChildren","combination","MergeAggregates","aggChildren","groupedAggregates","groupBys","mergeableAggs","mergedAggs","MergeBins","moveBinsUp","promotableBins","remainingBins","promotedBin","remainingBin","MergeOutputs","otherChildren","mainOutput","lastOutput","theChild","JoinAggregateTransformNode","getDefaultName","joinAggregateFieldDef","StackNode","_stack","stackTransform","sortFields","sortOrder","normalizedAs","isValidAsArray","stackField","facetby","stackProperties","dimensionFieldDef","stackby","_field","getStackByFields","getGroupbyFields","WindowTransformNode","windowFieldDef","moveFacetDown","facetMain","moveMainDownToFacet","cloner","newName","FACET_SCALE_PREFIX","outputNodes","MAX_OPTIMIZATION_RUNS","checkLinks","runOptimizer","optimizer","optimizationDataflowHelper","dataComponent","firstPass","roots","SignalRefWrapper","exprGenerator","rename","localScaleComponents","domains","parseDomainForChannel","parseSelectionDomain","isFaceted","facetParent","parseUnitScaleDomain","selectionExtent","childComponent","domainsTieBreaker","se","parseNonUnitScaleDomain","scaleConfig","reason","canUseUnaggregatedDomain","useUnaggregatedDomain","normalizeUnaggregatedDomain","specifiedScales","parseSingleChannelDomain","convertDomainIfItIsDateTime","mapDomainToDataSignal","isDomainUnionWith","defaultDomain","unionWith","stackDimensions","normalizeSortField","fieldDefToSortBy","isStackedMeasure","domainSort","Raw","binSignal","getSignalName","isDataRefUnionedDomain","nonUnionDomain","isFieldRefUnionDomain","uniqueDomains","_s","sorts","unionDomainSorts","allData","mergeDomains","assembleScales","assembleScalesForModel","otherScaleProps","assembleScaleRange","assembleSelectionScaleDomain","ScaleComponent","typeWithExplicit","RANGE_PROPERTIES","getBinStepSignal","updatedName","binCount","parseRangeForChannel","specifiedScale","supportedByScaleType","channelIncompatability","fromName","parseScheme","sizeRangeMin","xyStepSignals","maxBandSize","minXYStep","pointStep","MAX_SIZE_RANGE_STEP_RATIO","sizeRangeMax","rMax","rMin","defaultContinuousToDiscreteCount","defaultRange","isExtendedScheme","widthStep","heightStep","parseScaleProperty","localScaleCmpt","mergedScaleCmpt","specifiedValue","scalePadding","scalePaddingInner","scaleRules","parseUnitScaleProperty","parseNonUnitScaleProperty","barConfig","continuousPadding","paddingValue","bandPaddingInner","paddingInnerValue","bandPaddingOuter","xReverse","specifiedDomain","rangeWithExplicit","parseUnitScaleRange","valueWithExplicit","parseScaleCore","scaleComponents","sType","defaultScaleType","channelSupportScaleType","specifiedType","fieldDefType","parseUnitScaleCore","scaleTypeWithExplicitIndex","explicitScaleType","childScaleType","scaleTypeTieBreaker","childScale","renameScale","parseNonUnitScaleCore","NameMap","nameMap","oldName","Model","parentGivenName","correctDataNames","initTitle","scaleNameMap","projectionNameMap","signalNameMap","specType","compositionConfig","spacingConfig","extractCompositionLayout","outputNodeRefCounts","titleInternal","parseLayoutSize","renameTopLevelLayoutSizeSignal","parseSelections","parseAxesAndHeaders","parseLegends","parseMarkGroup","ignoreRange","parseScales","assembleGroupStyle","assembleEncodeFromView","baseView","assembleGroupEncodeEntry","isTopLevel","encodeEntry","assembleLayout","headerComponentIndex","assembleLayoutTitleBand","assembleDefaultLayout","assembleHeaderMarks","headerMarks","assembleAxes","axisComponents","assembleProjections","assembleProjectionsForModelAndChildren","titleNoEncoding","assembleGroup","assembleSignals","assembleMarks","getDataName","fullName","oldSignalName","originalScaleName","localScaleComponent","variableName","origName","hasAxisOrientSignalRef","hasOrientSignalRef","ModelWithField","getMapping","DensityTransformNode","specifiedAs","FilterInvalidNode","vegaFilters","FlattenTransformNode","FoldTransformNode","fold","GeoJSONNode","geoJsonCounter","pair","GeoPointNode","ImputeNode","processSequence","imputeTransform","imputedChannel","keyChannel","groupbyFields","LoessTransformNode","LookupNode","secondary","fromOutputNode","isLookupData","fromSource","findSource","fromOutputName","isLookupSelection","materialized","foreign","asName","QuantileTransformNode","RegressionTransformNode","regression","PivotTransformNode","pivot","SampleTransformNode","makeWalkTree","datasetIndex","walkTree","dataSource","parseFacetHeader","makeHeaderComponent","mergeChildAxis","axisComponent","mainAxis","parseChildrenLayoutSize","parseNonUnitLayoutSizeForChannel","layoutSizeCmpt","mergedSize","childSize","scaleResolve","defaultUnitSize","facetSortFieldName","FacetModel","buildModel","initFacet","initFacetFieldDef","normalizedFacet","parseFacetHeaders","assembleSelectionTopLevelSignals","assembleSelectionData","getHeaderLayoutMixins","layoutMixins","layoutHeaderComponent","bandType","columnDistinctSignal","getCardinalityAggregateForChild","assembleFacet","facetRoot","outputName","facetSortFields","facetSortOrder","ORTHOGONAL_ORIENT","assembleFacetData","assembleFacetSignals","otherData","formatMesh","otherFeature","formatFeature","otherMesh","existingSource","parseRoot","parentIsLayer","makeFromEncoding","lookupCounter","derivedType","transformNode","makeFromTransform","make","parseTransformArray","implicitSelection","getImplicitFromSelection","implicitEncoding","mainFieldDef","dimensionChannelDef","getImplicitFromEncoding","parseAll","parseAllForSortIndex","rawName","mainName","lookupName","materializeSelections","facetName","makeJoinAggregateFromFacet","ConcatModel","getChildren","widthType","heightType","parseConcatLayoutSize","parseAxisGroup","layoutSignals","AXIS_COMPONENT_PROPERTIES_INDEX","AXIS_COMPONENT_PROPERTIES","AxisComponent","OPPOSITE_ORIENT","mergeAxisComponents","mergedAxisCmpts","childAxisCmpts","mergeAxisComponent","propsToAlwaysIncludeConfig","defaultOrient","typeBasedConfigTypes","axisChannel","axisOrient","vlOnlyConfigTypes","vgConfigTypes","vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle","getAxisConfigs","getLabelAngle","hasValue","hasConfigValue","axisEncoding","axisEncodingPart","specifiedLabelsSpec","fixedShape","shapeMixins","defaultSize","markPropOrConfig","bandSize","markCompiler","vgMark","postEncodingTransform","shapeDef","vgThicknessChannel","FACETED_PATH_PREFIX","STACK_GROUP_PREFIX","getMarkGroup","fromPrefix","scaleClip","projectionClip","unitCount","parentCount","interactiveFlag","UnitModel","parentGivenSize","specifiedAxes","specifiedLegends","filledConfig","defaultFilled","originalMarkDef","specifiedOrient","xIsContinuous","yIsContinuous","xIsTemporal","yIsTemporal","cornerRadiusEnd","newProps","newProp","initMarkdef","initLayoutSize","initScales","initAxes","initLegends","isGeoShapeMark","hasGeoPosition","scaleInternal","_axis","axisSpec","initAxis","axisInternal","_legend","supportLegend","specifiedSize","parseUnitLayoutSize","selDefs","selCmpts","selectionConfig","safeName","parseUnitSelection","getPathGroups","fieldScale","stackFieldGroup","groupUpdate","innerGroupUpdate","groupByField","getGroupsForStackedBarWithCornerRadius","parseMarkGroups","hasSelections","assembleTopLevelSignals","dataCopy","assembleUnitSelectionData","LayerModel","axisCount","oppositeOrient","parseLayerAxes","assembleLayerSelectionMarks","unitSize","isAnyConcatSpec","inputSpec","newLogger","firstPassCounter","secondPassCounter","optimizeDataflow","vgSpec","topLevelProperties","datasets","usermeta","vgConfig","vlOnlyMarkSpecificConfigs","redirectTitleConfig","stripAndRedirectConfig","sourceIndex","newData","whereTo","assembleRootData","otherTopLevelProps","$schema","assembleTopLevelModel","autoSizeType","inverseSizeType","getFitType","getTopLevelProperties","normalized","library","lightColor","medColor","darkTheme","markColor$7","excelTheme","markColor$6","axisColor$2","backgroundColor$2","blackTitle","fiveThirtyEightTheme","markColor$5","ggplot2Theme","labelFont$1","markColor$4","colorSchemes$1","latimesTheme","markColor$3","axisColor$1","quartzTheme","markColor$2","voxTheme","markColor$1","axisColor","colorSchemes","urbanInstituteTheme","markColor","googlechartsTheme","ptToPx","fontSmallPx","legendFontPx","fontLargePx","fontStandard","fontTitle","firstLevelElementColor","secondLevelElementColor","backgroundColor","paletteColor1","divergentColorMin","divergentPalette","powerbiTheme","replacer","EL_ID","DEFAULT_OPTIONS","offsetX","offsetY","styleId","theme","disableDefaultStyle","valueToHtml","elementId","tooltipHandler","createDefaultStyle","classList","fullscreenElement","tooltipBox","calculatePosition","_typeof","_defineProperty","hint","prim","toPrimitive","_toPrimitive","_toPropertyKey","asyncGeneratorStep","_throw","_asyncToGenerator","undefined$1","Op","hasOwn","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","innerFn","outerFn","tryLocsList","protoGenerator","Generator","_invoke","GenStateSuspendedStart","GenStateExecuting","GenStateCompleted","doneResult","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","GenStateSuspendedYield","makeInvokeMethod","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","NativeIteratorPrototype","Gp","defineIteratorMethods","isGeneratorFunction","genFun","displayName","AsyncIterator","PromiseImpl","__await","unwrapped","previousPromise","callInvokeWithMethodAndArg","resultName","nextLoc","pushTryEntry","locs","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","iterable","iteratorMethod","skipTempReset","rootRecord","rval","handle","caught","hasCatch","hasFinally","finallyEntry","thrown","delegateYield","hasRequiredIterator","_regeneratorRuntime","awrap","yallist","Yallist$1","inserted","removeNode","unshiftNode","pushNode","thisp","walker","forEachReverse","getReverse","mapReverse","initial","reduceReverse","toArray","toArrayReverse","sliceReverse","deleteCount","Yallist","_callee","er","MAX","LENGTH","LENGTH_CALCULATOR","ALLOW_STALE","MAX_AGE","DISPOSE","NO_DISPOSE_ON_SET","LRU_LIST","UPDATE_AGE_ON_GET","naiveLength","doUse","isStale","del","maxAge","forEachStep","parseOptions_1","loose","reExports","re$1","SEMVER_SPEC_VERSION","MAX_LENGTH","MAX_SAFE_COMPONENT_LENGTH","debug_1","env","NODE_DEBUG","R","createToken","NUMERICIDENTIFIER","NUMERICIDENTIFIERLOOSE","NONNUMERICIDENTIFIER","PRERELEASEIDENTIFIER","PRERELEASEIDENTIFIERLOOSE","BUILDIDENTIFIER","MAINVERSION","PRERELEASE","BUILD","FULLPLAIN","MAINVERSIONLOOSE","PRERELEASELOOSE","LOOSEPLAIN","XRANGEIDENTIFIER","XRANGEIDENTIFIERLOOSE","GTLT","XRANGEPLAIN","XRANGEPLAINLOOSE","COERCE","LONETILDE","tildeTrimReplace","LONECARET","caretTrimReplace","comparatorTrimReplace","hasRequiredComparator","hasRequiredRange","numeric","identifiers","anum","bnum","parseOptions","compareIdentifiers","semver","SemVer","includePrerelease","LOOSE","FULL","major","minor","prerelease","build","compareMain","comparePre","compareBuild","release","compare_1","compare$5","compare$4","compare$3","compare$2","compare$1","eq","neq","cmp_1","_createForOfIteratorHelper$1","allowArrayLike","it","minLen","_arrayLikeToArray$1","_unsupportedIterableToArray$1","F","normalCompletion","didErr","_e2","return","arr2","Range","requireRange","Comparator","parseRange","isNullSet","_iterator","isAny","comps","memoOpts","memoKey","cached","hr","HYPHENRANGELOOSE","HYPHENRANGE","hyphenReplace","COMPARATORTRIM","rangeList","TILDETRIM","CARETTRIM","comp","parseComparator","replaceGTE0","COMPARATORLOOSE","_step2","rangeMap","comparators","_iterator2","thisComparators","isSatisfiable","rangeComparators","thisComparator","rangeComparator","testSet","stale","dispose","noDisposeOnSet","updateAgeOnGet","mL","allowStale","mA","lengthCalculator","lC","itemCount","rforEach","dump","dumpLru","expiresAt","prune","ANY","COMPARATOR","sameDirectionIncreasing","sameDirectionDecreasing","sameSemVer","differentDirectionsInclusive","oppositeDirectionsLessThan","oppositeDirectionsGreaterThan","requireComparator","remainingComparators","testComparator","otherComparator","replaceCarets","replaceTildes","replaceXRanges","replaceStars","replaceTilde","TILDELOOSE","TILDE","replaceCaret","CARETLOOSE","CARET","replaceXRange","XRANGELOOSE","XRANGE","gtlt","xM","anyX","STAR","GTE0PRE","GTE0","incPr","fM","fm","fp","fpr","fb","tM","tm","tp","tpr","tb","satisfies_1","editor","listen","postMessage","_w$vl","embedStyle","_src","_i2","_Object$keys","_createForOfIteratorHelper","_arrayLikeToArray","_unsupportedIterableToArray","ownKeys","enumerableOnly","_objectSpread","getOwnPropertyDescriptors","_vegaLite","vl","DEFAULT_ACTIONS","export","png","compiled","I18N","CLICK_TO_VIEW_ACTIONS","COMPILED_ACTION","EDITOR_ACTION","PNG_ACTION","SOURCE_ACTION","SVG_ACTION","NAMES","VERSION","PREPROCESSOR","vlSpec","SVG_CIRCLES","CHART_WRAPPER_CLASS","viewSource","sourceHeader","sourceFooter","footer","win","write","guessMode","providedMode","_NAMES$providedMode","createLoader","embedOptionsFromUsermeta","parsedSpec","_embedOptions","_parsedSpec$usermeta","embedOptions","defaultStyle","_embed2","_parsedOpts$config","_usermetaOpts$config","loadedEmbedOptions","usermetaLoader","_opts$loader","usermetaOpts","parsedOpts","mergedOpts","_args","loadOpts","_embed","_loadOpts","_callee2","_opt$config","_context2","t4","t5","getRoot","_document$head","possibleRoot","getRootNode","ShadowRoot","rootContainer","_x6","_embed3","_callee4","_opts$config","_opts$actions","_opts$renderer","_opts$logLevel","_opts$downloadFileNam","_expressionInterprete","actions","i18n","downloadFileName","ID","_getRoot","chartWrapper","_ref2","updateSet","documentClickHandler","ctrl","_loop","viewSourceLink","compileLink","_opts$editorUrl","editorUrl","editorLink","_args5","_context5","Warn","expressionFunctions","viewClass","expressionInterpreter","i18nExportAction","exportLink","_context4","download","_ref3","_callee3","_context3","_x7","_opts$sourceHeader","_opts$sourceFooter","_opts$sourceHeader2","_opts$sourceFooter2","__WEBPACK_EXTERNAL_MODULE__146__","stringOrChar","passedObj","maxLength","_stringify","currentIndent","reserved","keyPart","nextIndent","prettified","stringLiteral","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","__esModule","globalThis"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";0DAAA,IAAIA,EAAQ,WACZ,aAEA,SAASC,EAAYC,EAAKC,GACxB,OAAe,MAARA,GAAgBD,aAAeC,CACxC,CAEA,IAAIC,EASAC,EAOAC,EAfJ,IACEF,EAAYG,GAC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,IAAM,EAEP,OADA8tP,EAAoBngO,EAAEgsC,EAAQ,CAAEp5C,EAAGo5C,IAC5BA,CAAM,ECLdm0L,EAAoBngO,EAAI,CAAC1tB,EAASmhJ,KACjC,IAAI,IAAIhjJ,KAAOgjJ,EACX0sG,EAAoBxuP,EAAE8hJ,EAAYhjJ,KAAS0vP,EAAoBxuP,EAAEW,EAAS7B,IAC5ER,OAAOqB,eAAegB,EAAS7B,EAAK,CAAEY,YAAY,EAAM6jB,IAAKu+H,EAAWhjJ,IAE1E,ECND0vP,EAAoBplP,EAAI,WACvB,GAA0B,iBAAfwlP,WAAyB,OAAOA,WAC3C,IACC,OAAO9tP,MAAQ,IAAIqF,SAAS,cAAb,EAChB,CAAE,MAAOsJ,GACR,GAAsB,iBAAXtG,OAAqB,OAAOA,MACxC,CACA,CAPuB,GCAxBqlP,EAAoBxuP,EAAI,CAACnE,EAAKqgE,IAAU59D,OAAO7B,UAAUyY,eAAehV,KAAKrE,EAAKqgE,GCClFsyL,EAAoBjoO,EAAK5lB,IACH,oBAAXmkB,QAA0BA,OAAO+pO,aAC1CvwP,OAAOqB,eAAegB,EAASmkB,OAAO+pO,YAAa,CAAEvxP,MAAO,WAE7DgB,OAAOqB,eAAegB,EAAS,aAAc,CAAErD,OAAO,GAAO,ECFpCkxP,EAAoB","sources":["webpack://jupyter-vega/./node_modules/clone/clone.js","webpack://jupyter-vega/./node_modules/cwise-compiler/compiler.js","webpack://jupyter-vega/./node_modules/cwise-compiler/lib/compile.js","webpack://jupyter-vega/./node_modules/cwise-compiler/lib/thunk.js","webpack://jupyter-vega/./node_modules/cwise-parser/index.js","webpack://jupyter-vega/./node_modules/cwise/lib/cwise-esprima.js","webpack://jupyter-vega/./node_modules/dup/dup.js","webpack://jupyter-vega/./node_modules/esprima/esprima.js","webpack://jupyter-vega/./node_modules/fast-deep-equal/index.js","webpack://jupyter-vega/./node_modules/fast-json-stable-stringify/index.js","webpack://jupyter-vega/./node_modules/iota-array/iota.js","webpack://jupyter-vega/./node_modules/is-buffer/index.js","webpack://jupyter-vega/./node_modules/jupyter-tablewidgets/lib/compression.js","webpack://jupyter-vega/./node_modules/jupyter-tablewidgets/lib/index.js","webpack://jupyter-vega/./node_modules/jupyter-tablewidgets/lib/serializers.js","webpack://jupyter-vega/./node_modules/jupyter-tablewidgets/lib/widgets.js","webpack://jupyter-vega/./node_modules/lz4js/lz4.js","webpack://jupyter-vega/./node_modules/lz4js/util.js","webpack://jupyter-vega/./node_modules/lz4js/xxh32.js","webpack://jupyter-vega/./node_modules/ndarray-unpack/unpack.js","webpack://jupyter-vega/./node_modules/ndarray/ndarray.js","webpack://jupyter-vega/./node_modules/pako/index.js","webpack://jupyter-vega/./node_modules/pako/lib/deflate.js","webpack://jupyter-vega/./node_modules/pako/lib/inflate.js","webpack://jupyter-vega/./node_modules/pako/lib/utils/common.js","webpack://jupyter-vega/./node_modules/pako/lib/utils/strings.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/adler32.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/constants.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/crc32.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/deflate.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/gzheader.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/inffast.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/inflate.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/inftrees.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/messages.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/trees.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/zstream.js","webpack://jupyter-vega/./src/index.ts","webpack://jupyter-vega/./src/version.ts","webpack://jupyter-vega/./src/widget.ts","webpack://jupyter-vega/./node_modules/uniq/uniq.js","webpack://jupyter-vega/./node_modules/vega-embed/build/vega-embed.js","webpack://jupyter-vega/./node_modules/vega-lite/node_modules/vega-util/build/vega-util.module.js","webpack://jupyter-vega/./node_modules/array-flat-polyfill/index.mjs","webpack://jupyter-vega/./node_modules/vega-lite/build/src/logical.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/util.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/axis.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/aggregate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/channel.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/bin.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/log/message.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/log/index.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/datetime.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/timeunit.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/vega.schema.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/predicate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/type.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/scale.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/expr.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/mark.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/valueref.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/format.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/sort.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/facet.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/channeldef.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/title.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/common.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/unit.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/base.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/encoding.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/common.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/boxplot.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/errorbar.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/errorband.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/index.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/guide.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/header.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/legend.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/parameter.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/selection.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/concat.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/base.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/config.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/layer.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/map.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/repeat.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/stack.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/pathoverlay.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/rangestep.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/repeater.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/ruleforrangedline.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/core.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/index.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/toplevel.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/split.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/index.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/data.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/transform.js","webpack://jupyter-vega/./node_modules/vega-lite/node_modules/vega-event-selector/build/vega-event-selector.module.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/conditional.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/text.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/tooltip.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/nonposition.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/color.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/offset.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/position-point.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/position-align.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/position-range.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/position-rect.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/base.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/zindex.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/aria.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/defined.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/nearest.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/dataflow.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/timeunit.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/project.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/inputs.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/toggle.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/clear.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/scales.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/legends.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/translate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/zoom.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/transforms.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/interval.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/multi.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/single.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/index.js","webpack://jupyter-vega/./node_modules/vega-lite/node_modules/vega-expression/node_modules/vega-util/build/vega-util.module.js","webpack://jupyter-vega/./node_modules/vega-lite/node_modules/vega-expression/build/vega-expression.module.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/expressions.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/filter.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/predicate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/config.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/properties.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/calculate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/header/common.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/header/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/header/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layoutsize/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layoutsize/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/guide.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/resolve.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/encode.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/properties.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/projection/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/projection.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/projection/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/projection/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/bin.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/aggregate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/facet.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/formatparse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/identifier.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/graticule.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/sequence.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/source.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/optimizer.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/optimizers.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/joinaggregate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/stack.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/window.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/subtree.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/optimize.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/signal.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/domain.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/range.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/properties.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/type.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/model.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/density.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/filterinvalid.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/flatten.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/fold.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/geojson.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/geopoint.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/impute.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/loess.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/lookup.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/quantile.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/regression.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/pivot.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/sample.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/header/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layoutsize/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/facet.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/joinaggregatefacet.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/concat.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/encode.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/point.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/tick.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/mark.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/arc.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/area.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/bar.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/geoshape.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/image.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/line.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/rect.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/rule.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/text.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/unit.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/init.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layoutsize/init.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layer.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/buildmodel.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/compile.js","webpack://jupyter-vega/./node_modules/vega-util/build/vega-util.module.js","webpack://jupyter-vega/./node_modules/d3-dsv/src/dsv.js","webpack://jupyter-vega/./node_modules/topojson-client/src/identity.js","webpack://jupyter-vega/./node_modules/topojson-client/src/feature.js","webpack://jupyter-vega/./node_modules/topojson-client/src/transform.js","webpack://jupyter-vega/./node_modules/topojson-client/src/reverse.js","webpack://jupyter-vega/./node_modules/topojson-client/src/stitch.js","webpack://jupyter-vega/./node_modules/topojson-client/src/mesh.js","webpack://jupyter-vega/./node_modules/d3-array/src/ticks.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatSpecifier.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatPrefixAuto.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatDecimal.js","webpack://jupyter-vega/./node_modules/d3-format/src/exponent.js","webpack://jupyter-vega/./node_modules/d3-format/src/precisionPrefix.js","webpack://jupyter-vega/./node_modules/d3-format/src/precisionRound.js","webpack://jupyter-vega/./node_modules/d3-format/src/precisionFixed.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatRounded.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatTypes.js","webpack://jupyter-vega/./node_modules/d3-format/src/identity.js","webpack://jupyter-vega/./node_modules/d3-format/src/locale.js","webpack://jupyter-vega/./node_modules/d3-format/src/defaultLocale.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatGroup.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatNumerals.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatTrim.js","webpack://jupyter-vega/./node_modules/d3-time/src/interval.js","webpack://jupyter-vega/./node_modules/d3-time/src/duration.js","webpack://jupyter-vega/./node_modules/d3-time/src/day.js","webpack://jupyter-vega/./node_modules/d3-time/src/week.js","webpack://jupyter-vega/./node_modules/d3-time/src/year.js","webpack://jupyter-vega/./node_modules/d3-time/src/month.js","webpack://jupyter-vega/./node_modules/d3-time/src/hour.js","webpack://jupyter-vega/./node_modules/d3-time/src/minute.js","webpack://jupyter-vega/./node_modules/d3-time/src/second.js","webpack://jupyter-vega/./node_modules/d3-time/src/millisecond.js","webpack://jupyter-vega/./node_modules/d3-array/src/ascending.js","webpack://jupyter-vega/./node_modules/d3-array/src/descending.js","webpack://jupyter-vega/./node_modules/d3-array/src/bisector.js","webpack://jupyter-vega/./node_modules/vega-time/build/vega-time.module.js","webpack://jupyter-vega/./node_modules/d3-time-format/src/locale.js","webpack://jupyter-vega/./node_modules/d3-time-format/src/defaultLocale.js","webpack://jupyter-vega/./node_modules/vega-format/build/vega-format.module.js","webpack://jupyter-vega/./node_modules/vega-loader/build/vega-loader.browser.module.js","webpack://jupyter-vega/./node_modules/vega-dataflow/build/vega-dataflow.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/max.js","webpack://jupyter-vega/./node_modules/d3-array/src/min.js","webpack://jupyter-vega/./node_modules/d3-array/src/sort.js","webpack://jupyter-vega/./node_modules/d3-array/src/quickselect.js","webpack://jupyter-vega/./node_modules/d3-array/src/number.js","webpack://jupyter-vega/./node_modules/d3-array/src/quantile.js","webpack://jupyter-vega/./node_modules/d3-array/src/median.js","webpack://jupyter-vega/./node_modules/vega-statistics/build/vega-statistics.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/deviation.js","webpack://jupyter-vega/./node_modules/d3-array/src/variance.js","webpack://jupyter-vega/./node_modules/d3-array/src/range.js","webpack://jupyter-vega/./node_modules/vega-transforms/build/vega-transforms.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/mean.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/basis.js","webpack://jupyter-vega/./node_modules/d3-shape/src/noop.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/basisClosed.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/basisOpen.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/bundle.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/cardinal.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/cardinalOpen.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/cardinalClosed.js","webpack://jupyter-vega/./node_modules/d3-shape/src/math.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/catmullRom.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/catmullRomClosed.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/catmullRomOpen.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/linear.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/linearClosed.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/monotone.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/natural.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/step.js","webpack://jupyter-vega/./node_modules/d3-shape/src/constant.js","webpack://jupyter-vega/./node_modules/d3-path/src/path.js","webpack://jupyter-vega/./node_modules/d3-shape/src/path.js","webpack://jupyter-vega/./node_modules/d3-shape/src/arc.js","webpack://jupyter-vega/./node_modules/d3-shape/src/array.js","webpack://jupyter-vega/./node_modules/d3-shape/src/point.js","webpack://jupyter-vega/./node_modules/d3-shape/src/line.js","webpack://jupyter-vega/./node_modules/d3-shape/src/area.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/asterisk.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/circle.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/diamond.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/star.js","webpack://jupyter-vega/./node_modules/vega-canvas/build/vega-canvas.browser.module.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/triangle.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/triangle2.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/wye.js","webpack://jupyter-vega/./node_modules/d3-array/src/bisect.js","webpack://jupyter-vega/./node_modules/d3-color/src/define.js","webpack://jupyter-vega/./node_modules/d3-color/src/color.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/basis.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/basisClosed.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/constant.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/color.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/rgb.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/numberArray.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/array.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/date.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/number.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/object.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/string.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/value.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/round.js","webpack://jupyter-vega/./node_modules/d3-scale/src/number.js","webpack://jupyter-vega/./node_modules/d3-scale/src/continuous.js","webpack://jupyter-vega/./node_modules/d3-scale/src/constant.js","webpack://jupyter-vega/./node_modules/d3-scale/src/init.js","webpack://jupyter-vega/./node_modules/d3-scale/src/tickFormat.js","webpack://jupyter-vega/./node_modules/d3-scale/src/linear.js","webpack://jupyter-vega/./node_modules/d3-scale/src/nice.js","webpack://jupyter-vega/./node_modules/d3-scale/src/log.js","webpack://jupyter-vega/./node_modules/d3-scale/src/pow.js","webpack://jupyter-vega/./node_modules/d3-scale/src/symlog.js","webpack://jupyter-vega/./node_modules/d3-time/src/ticks.js","webpack://jupyter-vega/./node_modules/d3-scale/src/time.js","webpack://jupyter-vega/./node_modules/d3-scale/src/sequential.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/piecewise.js","webpack://jupyter-vega/./node_modules/d3-scale/src/diverging.js","webpack://jupyter-vega/./node_modules/internmap/src/index.js","webpack://jupyter-vega/./node_modules/d3-scale/src/ordinal.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/discrete.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/hue.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/transform/decompose.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/transform/parse.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/transform/index.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/zoom.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/hsl.js","webpack://jupyter-vega/./node_modules/d3-color/src/math.js","webpack://jupyter-vega/./node_modules/d3-color/src/lab.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/lab.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/hcl.js","webpack://jupyter-vega/./node_modules/d3-color/src/cubehelix.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/cubehelix.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/quantize.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/colors.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/Accent.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/category10.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/Dark2.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/observable10.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/Paired.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/Pastel1.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/Pastel2.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/Set1.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/Set2.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/Set3.js","webpack://jupyter-vega/./node_modules/vega-scale/build/vega-scale.module.js","webpack://jupyter-vega/./node_modules/d3-scale/src/identity.js","webpack://jupyter-vega/./node_modules/d3-scale/src/utcTime.js","webpack://jupyter-vega/./node_modules/d3-scale/src/quantile.js","webpack://jupyter-vega/./node_modules/d3-scale/src/quantize.js","webpack://jupyter-vega/./node_modules/d3-scale/src/threshold.js","webpack://jupyter-vega/./node_modules/vega-scenegraph/build/vega-scenegraph.module.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol.js","webpack://jupyter-vega/./node_modules/vega-view-transforms/build/vega-view-transforms.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/sum.js","webpack://jupyter-vega/./node_modules/vega-encode/build/vega-encode.module.js","webpack://jupyter-vega/./node_modules/d3-geo/src/identity.js","webpack://jupyter-vega/./node_modules/d3-geo/src/stream.js","webpack://jupyter-vega/./node_modules/d3-array/src/fsum.js","webpack://jupyter-vega/./node_modules/d3-geo/src/math.js","webpack://jupyter-vega/./node_modules/d3-geo/src/noop.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/area.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/bounds.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/centroid.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/context.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/measure.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/string.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/index.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/buffer.js","webpack://jupyter-vega/./node_modules/d3-geo/src/pointEqual.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/rejoin.js","webpack://jupyter-vega/./node_modules/d3-geo/src/cartesian.js","webpack://jupyter-vega/./node_modules/d3-geo/src/polygonContains.js","webpack://jupyter-vega/./node_modules/d3-array/src/merge.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/index.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/antimeridian.js","webpack://jupyter-vega/./node_modules/d3-geo/src/circle.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/rectangle.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/line.js","webpack://jupyter-vega/./node_modules/d3-geo/src/compose.js","webpack://jupyter-vega/./node_modules/d3-geo/src/rotation.js","webpack://jupyter-vega/./node_modules/d3-geo/src/transform.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/fit.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/resample.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/index.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/circle.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/conic.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/conicEqualArea.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/cylindricalEqualArea.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/albers.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/azimuthal.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/azimuthalEqualArea.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/azimuthalEquidistant.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/mercator.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/conicConformal.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/equirectangular.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/conicEquidistant.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/equalEarth.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/gnomonic.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/naturalEarth1.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/orthographic.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/stereographic.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/transverseMercator.js","webpack://jupyter-vega/./node_modules/d3-geo-projection/src/math.js","webpack://jupyter-vega/./node_modules/d3-geo-projection/src/mollweide.js","webpack://jupyter-vega/./node_modules/vega-projection/build/vega-projection.module.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/albersUsa.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/identity.js","webpack://jupyter-vega/./node_modules/d3-geo/src/graticule.js","webpack://jupyter-vega/./node_modules/vega-geo/build/vega-geo.module.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/add.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/quad.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/x.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/y.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/quadtree.js","webpack://jupyter-vega/./node_modules/d3-force/src/constant.js","webpack://jupyter-vega/./node_modules/d3-force/src/jiggle.js","webpack://jupyter-vega/./node_modules/d3-force/src/collide.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/cover.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/data.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/extent.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/find.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/remove.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/root.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/size.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/visit.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/visitAfter.js","webpack://jupyter-vega/./node_modules/d3-dispatch/src/dispatch.js","webpack://jupyter-vega/./node_modules/d3-timer/src/timer.js","webpack://jupyter-vega/./node_modules/d3-force/src/lcg.js","webpack://jupyter-vega/./node_modules/d3-force/src/simulation.js","webpack://jupyter-vega/./node_modules/d3-force/src/link.js","webpack://jupyter-vega/./node_modules/vega-force/build/vega-force.module.js","webpack://jupyter-vega/./node_modules/d3-force/src/center.js","webpack://jupyter-vega/./node_modules/d3-force/src/manyBody.js","webpack://jupyter-vega/./node_modules/d3-force/src/x.js","webpack://jupyter-vega/./node_modules/d3-force/src/y.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/count.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/index.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/accessors.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/constant.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/each.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/eachAfter.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/eachBefore.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/find.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/sum.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/sort.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/path.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/ancestors.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/descendants.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/leaves.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/links.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/iterator.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/lcg.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/pack/enclose.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/pack/siblings.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/array.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/pack/index.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/round.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/dice.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/stratify.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/tree.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/cluster.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/slice.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/squarify.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/resquarify.js","webpack://jupyter-vega/./node_modules/vega-hierarchy/build/vega-hierarchy.module.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/partition.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/binary.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/sliceDice.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/index.js","webpack://jupyter-vega/./node_modules/vega-label/build/vega-label.module.js","webpack://jupyter-vega/./node_modules/vega-regression/build/vega-regression.module.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/util.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/orient2d.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/orient3d.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/incircle.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/insphere.js","webpack://jupyter-vega/./node_modules/delaunator/index.js","webpack://jupyter-vega/./node_modules/d3-delaunay/src/path.js","webpack://jupyter-vega/./node_modules/d3-delaunay/src/polygon.js","webpack://jupyter-vega/./node_modules/d3-delaunay/src/voronoi.js","webpack://jupyter-vega/./node_modules/d3-delaunay/src/delaunay.js","webpack://jupyter-vega/./node_modules/vega-voronoi/build/vega-voronoi.module.js","webpack://jupyter-vega/./node_modules/vega-wordcloud/build/vega-wordcloud.module.js","webpack://jupyter-vega/./node_modules/vega-crossfilter/build/vega-crossfilter.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/permute.js","webpack://jupyter-vega/./node_modules/vega-expression/build/vega-expression.module.js","webpack://jupyter-vega/./node_modules/d3-geo/src/area.js","webpack://jupyter-vega/./node_modules/d3-geo/src/bounds.js","webpack://jupyter-vega/./node_modules/d3-geo/src/centroid.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/ascending.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/descending.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/bisector.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/intersection.js","webpack://jupyter-vega/./node_modules/vega-selections/build/vega-selection.module.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/union.js","webpack://jupyter-vega/./node_modules/vega-functions/build/vega-functions.module.js","webpack://jupyter-vega/./node_modules/vega-runtime/build/vega-runtime.module.js","webpack://jupyter-vega/./node_modules/vega-view/build/vega-view.module.js","webpack://jupyter-vega/./node_modules/d3-timer/src/interval.js","webpack://jupyter-vega/./node_modules/vega-event-selector/build/vega-event-selector.module.js","webpack://jupyter-vega/./node_modules/vega-parser/build/vega-parser.module.js","webpack://jupyter-vega/./node_modules/vega/build/vega.module.js","webpack://jupyter-vega/external amd \"@jupyter-widgets/base\"","webpack://jupyter-vega/webpack/bootstrap","webpack://jupyter-vega/webpack/runtime/compat get default export","webpack://jupyter-vega/webpack/runtime/define property getters","webpack://jupyter-vega/webpack/runtime/global","webpack://jupyter-vega/webpack/runtime/hasOwnProperty shorthand","webpack://jupyter-vega/webpack/runtime/make namespace object","webpack://jupyter-vega/webpack/startup"],"sourcesContent":["var clone = (function() {\n'use strict';\n\nfunction _instanceof(obj, type) {\n return type != null && obj instanceof type;\n}\n\nvar nativeMap;\ntry {\n nativeMap = Map;\n} catch(_) {\n // maybe a reference error because no `Map`. Give it a dummy value that no\n // value will ever be an instanceof.\n nativeMap = function() {};\n}\n\nvar nativeSet;\ntry {\n nativeSet = Set;\n} catch(_) {\n nativeSet = function() {};\n}\n\nvar nativePromise;\ntry {\n nativePromise = Promise;\n} catch(_) {\n nativePromise = function() {};\n}\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n * @param `includeNonEnumerable` - set to true if the non-enumerable properties\n * should be cloned as well. Non-enumerable properties on the prototype\n * chain will be ignored. (optional - false by default)\n*/\nfunction clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n}\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n}\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n}\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n}\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n}\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif (typeof module === 'object' && module.exports) {\n module.exports = clone;\n}\n","\"use strict\"\n\nvar createThunk = require(\"./lib/thunk.js\")\n\nfunction Procedure() {\n this.argTypes = []\n this.shimArgs = []\n this.arrayArgs = []\n this.arrayBlockIndices = []\n this.scalarArgs = []\n this.offsetArgs = []\n this.offsetArgIndex = []\n this.indexArgs = []\n this.shapeArgs = []\n this.funcName = \"\"\n this.pre = null\n this.body = null\n this.post = null\n this.debug = false\n}\n\nfunction compileCwise(user_args) {\n //Create procedure\n var proc = new Procedure()\n \n //Parse blocks\n proc.pre = user_args.pre\n proc.body = user_args.body\n proc.post = user_args.post\n\n //Parse arguments\n var proc_args = user_args.args.slice(0)\n proc.argTypes = proc_args\n for(var i=0; i0) {\n throw new Error(\"cwise: pre() block may not reference array args\")\n }\n if(i < proc.post.args.length && proc.post.args[i].count>0) {\n throw new Error(\"cwise: post() block may not reference array args\")\n }\n } else if(arg_type === \"scalar\") {\n proc.scalarArgs.push(i)\n proc.shimArgs.push(\"scalar\" + i)\n } else if(arg_type === \"index\") {\n proc.indexArgs.push(i)\n if(i < proc.pre.args.length && proc.pre.args[i].count > 0) {\n throw new Error(\"cwise: pre() block may not reference array index\")\n }\n if(i < proc.body.args.length && proc.body.args[i].lvalue) {\n throw new Error(\"cwise: body() block may not write to array index\")\n }\n if(i < proc.post.args.length && proc.post.args[i].count > 0) {\n throw new Error(\"cwise: post() block may not reference array index\")\n }\n } else if(arg_type === \"shape\") {\n proc.shapeArgs.push(i)\n if(i < proc.pre.args.length && proc.pre.args[i].lvalue) {\n throw new Error(\"cwise: pre() block may not write to array shape\")\n }\n if(i < proc.body.args.length && proc.body.args[i].lvalue) {\n throw new Error(\"cwise: body() block may not write to array shape\")\n }\n if(i < proc.post.args.length && proc.post.args[i].lvalue) {\n throw new Error(\"cwise: post() block may not write to array shape\")\n }\n } else if(typeof arg_type === \"object\" && arg_type.offset) {\n proc.argTypes[i] = \"offset\"\n proc.offsetArgs.push({ array: arg_type.array, offset:arg_type.offset })\n proc.offsetArgIndex.push(i)\n } else {\n throw new Error(\"cwise: Unknown argument type \" + proc_args[i])\n }\n }\n \n //Make sure at least one array argument was specified\n if(proc.arrayArgs.length <= 0) {\n throw new Error(\"cwise: No array arguments specified\")\n }\n \n //Make sure arguments are correct\n if(proc.pre.args.length > proc_args.length) {\n throw new Error(\"cwise: Too many arguments in pre() block\")\n }\n if(proc.body.args.length > proc_args.length) {\n throw new Error(\"cwise: Too many arguments in body() block\")\n }\n if(proc.post.args.length > proc_args.length) {\n throw new Error(\"cwise: Too many arguments in post() block\")\n }\n\n //Check debug flag\n proc.debug = !!user_args.printCode || !!user_args.debug\n \n //Retrieve name\n proc.funcName = user_args.funcName || \"cwise\"\n \n //Read in block size\n proc.blockSize = user_args.blockSize || 64\n\n return createThunk(proc)\n}\n\nmodule.exports = compileCwise\n","\"use strict\"\n\nvar uniq = require(\"uniq\")\n\n// This function generates very simple loops analogous to how you typically traverse arrays (the outermost loop corresponds to the slowest changing index, the innermost loop to the fastest changing index)\n// TODO: If two arrays have the same strides (and offsets) there is potential for decreasing the number of \"pointers\" and related variables. The drawback is that the type signature would become more specific and that there would thus be less potential for caching, but it might still be worth it, especially when dealing with large numbers of arguments.\nfunction innerFill(order, proc, body) {\n var dimension = order.length\n , nargs = proc.arrayArgs.length\n , has_index = proc.indexArgs.length>0\n , code = []\n , vars = []\n , idx=0, pidx=0, i, j\n for(i=0; i 0) {\n code.push(\"var \" + vars.join(\",\"))\n } \n //Scan loop\n for(i=dimension-1; i>=0; --i) { // Start at largest stride and work your way inwards\n idx = order[i]\n code.push([\"for(i\",i,\"=0;i\",i,\" 0) {\n code.push([\"index[\",pidx,\"]-=s\",pidx].join(\"\"))\n }\n code.push([\"++index[\",idx,\"]\"].join(\"\"))\n }\n code.push(\"}\")\n }\n return code.join(\"\\n\")\n}\n\n// Generate \"outer\" loops that loop over blocks of data, applying \"inner\" loops to the blocks by manipulating the local variables in such a way that the inner loop only \"sees\" the current block.\n// TODO: If this is used, then the previous declaration (done by generateCwiseOp) of s* is essentially unnecessary.\n// I believe the s* are not used elsewhere (in particular, I don't think they're used in the pre/post parts and \"shape\" is defined independently), so it would be possible to make defining the s* dependent on what loop method is being used.\nfunction outerFill(matched, order, proc, body) {\n var dimension = order.length\n , nargs = proc.arrayArgs.length\n , blockSize = proc.blockSize\n , has_index = proc.indexArgs.length > 0\n , code = []\n for(var i=0; i0;){\"].join(\"\")) // Iterate back to front\n code.push([\"if(j\",i,\"<\",blockSize,\"){\"].join(\"\")) // Either decrease j by blockSize (s = blockSize), or set it to zero (after setting s = j).\n code.push([\"s\",order[i],\"=j\",i].join(\"\"))\n code.push([\"j\",i,\"=0\"].join(\"\"))\n code.push([\"}else{s\",order[i],\"=\",blockSize].join(\"\"))\n code.push([\"j\",i,\"-=\",blockSize,\"}\"].join(\"\"))\n if(has_index) {\n code.push([\"index[\",order[i],\"]=j\",i].join(\"\"))\n }\n }\n for(var i=0; i 0) {\n allEqual = allEqual && summary[i] === summary[i-1]\n }\n }\n if(allEqual) {\n return summary[0]\n }\n return summary.join(\"\")\n}\n\n//Generates a cwise operator\nfunction generateCWiseOp(proc, typesig) {\n\n //Compute dimension\n // Arrays get put first in typesig, and there are two entries per array (dtype and order), so this gets the number of dimensions in the first array arg.\n var dimension = (typesig[1].length - Math.abs(proc.arrayBlockIndices[0]))|0\n var orders = new Array(proc.arrayArgs.length)\n var dtypes = new Array(proc.arrayArgs.length)\n for(var i=0; i 0) {\n vars.push(\"shape=SS.slice(0)\") // Makes the shape over which we iterate available to the user defined functions (so you can use width/height for example)\n }\n if(proc.indexArgs.length > 0) {\n // Prepare an array to keep track of the (logical) indices, initialized to dimension zeroes.\n var zeros = new Array(dimension)\n for(var i=0; i 0) {\n code.push(\"var \" + vars.join(\",\"))\n }\n for(var i=0; i 3) {\n code.push(processBlock(proc.pre, proc, dtypes))\n }\n\n //Process body\n var body = processBlock(proc.body, proc, dtypes)\n var matched = countMatches(loopOrders)\n if(matched < dimension) {\n code.push(outerFill(matched, loopOrders[0], proc, body)) // TODO: Rather than passing loopOrders[0], it might be interesting to look at passing an order that represents the majority of the arguments for example.\n } else {\n code.push(innerFill(loopOrders[0], proc, body))\n }\n\n //Inline epilog\n if(proc.post.body.length > 3) {\n code.push(processBlock(proc.post, proc, dtypes))\n }\n \n if(proc.debug) {\n console.log(\"-----Generated cwise routine for \", typesig, \":\\n\" + code.join(\"\\n\") + \"\\n----------\")\n }\n \n var loopName = [(proc.funcName||\"unnamed\"), \"_cwise_loop_\", orders[0].join(\"s\"),\"m\",matched,typeSummary(dtypes)].join(\"\")\n var f = new Function([\"function \",loopName,\"(\", arglist.join(\",\"),\"){\", code.join(\"\\n\"),\"} return \", loopName].join(\"\"))\n return f()\n}\nmodule.exports = generateCWiseOp\n","\"use strict\"\n\n// The function below is called when constructing a cwise function object, and does the following:\n// A function object is constructed which accepts as argument a compilation function and returns another function.\n// It is this other function that is eventually returned by createThunk, and this function is the one that actually\n// checks whether a certain pattern of arguments has already been used before and compiles new loops as needed.\n// The compilation passed to the first function object is used for compiling new functions.\n// Once this function object is created, it is called with compile as argument, where the first argument of compile\n// is bound to \"proc\" (essentially containing a preprocessed version of the user arguments to cwise).\n// So createThunk roughly works like this:\n// function createThunk(proc) {\n// var thunk = function(compileBound) {\n// var CACHED = {}\n// return function(arrays and scalars) {\n// if (dtype and order of arrays in CACHED) {\n// var func = CACHED[dtype and order of arrays]\n// } else {\n// var func = CACHED[dtype and order of arrays] = compileBound(dtype and order of arrays)\n// }\n// return func(arrays and scalars)\n// }\n// }\n// return thunk(compile.bind1(proc))\n// }\n\nvar compile = require(\"./compile.js\")\n\nfunction createThunk(proc) {\n var code = [\"'use strict'\", \"var CACHED={}\"]\n var vars = []\n var thunkName = proc.funcName + \"_cwise_thunk\"\n \n //Build thunk\n code.push([\"return function \", thunkName, \"(\", proc.shimArgs.join(\",\"), \"){\"].join(\"\"))\n var typesig = []\n var string_typesig = []\n var proc_args = [[\"array\",proc.arrayArgs[0],\".shape.slice(\", // Slice shape so that we only retain the shape over which we iterate (which gets passed to the cwise operator as SS).\n Math.max(0,proc.arrayBlockIndices[0]),proc.arrayBlockIndices[0]<0?(\",\"+proc.arrayBlockIndices[0]+\")\"):\")\"].join(\"\")]\n var shapeLengthConditions = [], shapeConditions = []\n // Process array arguments\n for(var i=0; i0) { // Gather conditions to check for shape equality (ignoring block indices)\n shapeLengthConditions.push(\"array\" + proc.arrayArgs[0] + \".shape.length===array\" + j + \".shape.length+\" + (Math.abs(proc.arrayBlockIndices[0])-Math.abs(proc.arrayBlockIndices[i])))\n shapeConditions.push(\"array\" + proc.arrayArgs[0] + \".shape[shapeIndex+\" + Math.max(0,proc.arrayBlockIndices[0]) + \"]===array\" + j + \".shape[shapeIndex+\" + Math.max(0,proc.arrayBlockIndices[i]) + \"]\")\n }\n }\n // Check for shape equality\n if (proc.arrayArgs.length > 1) {\n code.push(\"if (!(\" + shapeLengthConditions.join(\" && \") + \")) throw new Error('cwise: Arrays do not all have the same dimensionality!')\")\n code.push(\"for(var shapeIndex=array\" + proc.arrayArgs[0] + \".shape.length-\" + Math.abs(proc.arrayBlockIndices[0]) + \"; shapeIndex-->0;) {\")\n code.push(\"if (!(\" + shapeConditions.join(\" && \") + \")) throw new Error('cwise: Arrays do not all have the same shape!')\")\n code.push(\"}\")\n }\n // Process scalar arguments\n for(var i=0; i= 0) {\n var carg = compiledArgs[argNo]\n var usage = getUsage(node)\n if(usage & LVALUE) {\n carg.lvalue = true\n }\n if(usage & RVALUE) {\n carg.rvalue = true\n }\n ++carg.count\n rewrite(node, carg.name)\n } else if(isGlobal(name)) {\n //Don't rewrite globals\n } else {\n rewrite(node, createLocal(name))\n }\n } else if(node.type === \"Literal\") {\n if(typeof node.value === \"string\") {\n rewrite(node, escapeString(node.value))\n }\n } else if(node.type === \"WithStatement\") {\n throw new Error(\"cwise-parser: with() statements not allowed\")\n } else {\n //Visit all children\n var keys = Object.keys(node)\n for(var i=0, n=keys.length; i 0) {\n return dupe_number(count|0, value)\n }\n break\n case \"object\":\n if(typeof (count.length) === \"number\") {\n return dupe_array(count, value, 0)\n }\n break\n }\n return []\n}\n\nmodule.exports = dupe","/*\n Copyright (C) 2013 Ariya Hidayat \n Copyright (C) 2013 Thaddee Tyl \n Copyright (C) 2013 Mathias Bynens \n Copyright (C) 2012 Ariya Hidayat \n Copyright (C) 2012 Mathias Bynens \n Copyright (C) 2012 Joost-Wim Boekesteijn \n Copyright (C) 2012 Kris Kowal \n Copyright (C) 2012 Yusuke Suzuki \n Copyright (C) 2012 Arpad Borsos \n Copyright (C) 2011 Ariya Hidayat \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n/*jslint bitwise:true plusplus:true */\n/*global esprima:true, define:true, exports:true, window: true,\nthrowErrorTolerant: true,\nthrowError: true, generateStatement: true, peek: true,\nparseAssignmentExpression: true, parseBlock: true, parseExpression: true,\nparseFunctionDeclaration: true, parseFunctionExpression: true,\nparseFunctionSourceElements: true, parseVariableIdentifier: true,\nparseLeftHandSideExpression: true,\nparseUnaryExpression: true,\nparseStatement: true, parseSourceElement: true */\n\n(function (root, factory) {\n 'use strict';\n\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js,\n // Rhino, and plain browser loading.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define(['exports'], factory);\n } else if (typeof exports !== 'undefined') {\n factory(exports);\n } else {\n factory((root.esprima = {}));\n }\n}(this, function (exports) {\n 'use strict';\n\n var Token,\n TokenName,\n FnExprTokens,\n Syntax,\n PropertyKind,\n Messages,\n Regex,\n SyntaxTreeDelegate,\n source,\n strict,\n index,\n lineNumber,\n lineStart,\n length,\n delegate,\n lookahead,\n state,\n extra;\n\n Token = {\n BooleanLiteral: 1,\n EOF: 2,\n Identifier: 3,\n Keyword: 4,\n NullLiteral: 5,\n NumericLiteral: 6,\n Punctuator: 7,\n StringLiteral: 8,\n RegularExpression: 9\n };\n\n TokenName = {};\n TokenName[Token.BooleanLiteral] = 'Boolean';\n TokenName[Token.EOF] = '';\n TokenName[Token.Identifier] = 'Identifier';\n TokenName[Token.Keyword] = 'Keyword';\n TokenName[Token.NullLiteral] = 'Null';\n TokenName[Token.NumericLiteral] = 'Numeric';\n TokenName[Token.Punctuator] = 'Punctuator';\n TokenName[Token.StringLiteral] = 'String';\n TokenName[Token.RegularExpression] = 'RegularExpression';\n\n // A function following one of those tokens is an expression.\n FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new',\n 'return', 'case', 'delete', 'throw', 'void',\n // assignment operators\n '=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=',\n '&=', '|=', '^=', ',',\n // binary/unary operators\n '+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&',\n '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=',\n '<=', '<', '>', '!=', '!=='];\n\n Syntax = {\n AssignmentExpression: 'AssignmentExpression',\n ArrayExpression: 'ArrayExpression',\n BlockStatement: 'BlockStatement',\n BinaryExpression: 'BinaryExpression',\n BreakStatement: 'BreakStatement',\n CallExpression: 'CallExpression',\n CatchClause: 'CatchClause',\n ConditionalExpression: 'ConditionalExpression',\n ContinueStatement: 'ContinueStatement',\n DoWhileStatement: 'DoWhileStatement',\n DebuggerStatement: 'DebuggerStatement',\n EmptyStatement: 'EmptyStatement',\n ExpressionStatement: 'ExpressionStatement',\n ForStatement: 'ForStatement',\n ForInStatement: 'ForInStatement',\n FunctionDeclaration: 'FunctionDeclaration',\n FunctionExpression: 'FunctionExpression',\n Identifier: 'Identifier',\n IfStatement: 'IfStatement',\n Literal: 'Literal',\n LabeledStatement: 'LabeledStatement',\n LogicalExpression: 'LogicalExpression',\n MemberExpression: 'MemberExpression',\n NewExpression: 'NewExpression',\n ObjectExpression: 'ObjectExpression',\n Program: 'Program',\n Property: 'Property',\n ReturnStatement: 'ReturnStatement',\n SequenceExpression: 'SequenceExpression',\n SwitchStatement: 'SwitchStatement',\n SwitchCase: 'SwitchCase',\n ThisExpression: 'ThisExpression',\n ThrowStatement: 'ThrowStatement',\n TryStatement: 'TryStatement',\n UnaryExpression: 'UnaryExpression',\n UpdateExpression: 'UpdateExpression',\n VariableDeclaration: 'VariableDeclaration',\n VariableDeclarator: 'VariableDeclarator',\n WhileStatement: 'WhileStatement',\n WithStatement: 'WithStatement'\n };\n\n PropertyKind = {\n Data: 1,\n Get: 2,\n Set: 4\n };\n\n // Error messages should be identical to V8.\n Messages = {\n UnexpectedToken: 'Unexpected token %0',\n UnexpectedNumber: 'Unexpected number',\n UnexpectedString: 'Unexpected string',\n UnexpectedIdentifier: 'Unexpected identifier',\n UnexpectedReserved: 'Unexpected reserved word',\n UnexpectedEOS: 'Unexpected end of input',\n NewlineAfterThrow: 'Illegal newline after throw',\n InvalidRegExp: 'Invalid regular expression',\n UnterminatedRegExp: 'Invalid regular expression: missing /',\n InvalidLHSInAssignment: 'Invalid left-hand side in assignment',\n InvalidLHSInForIn: 'Invalid left-hand side in for-in',\n MultipleDefaultsInSwitch: 'More than one default clause in switch statement',\n NoCatchOrFinally: 'Missing catch or finally after try',\n UnknownLabel: 'Undefined label \\'%0\\'',\n Redeclaration: '%0 \\'%1\\' has already been declared',\n IllegalContinue: 'Illegal continue statement',\n IllegalBreak: 'Illegal break statement',\n IllegalReturn: 'Illegal return statement',\n StrictModeWith: 'Strict mode code may not include a with statement',\n StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',\n StrictVarName: 'Variable name may not be eval or arguments in strict mode',\n StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',\n StrictParamDupe: 'Strict mode function may not have duplicate parameter names',\n StrictFunctionName: 'Function name may not be eval or arguments in strict mode',\n StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',\n StrictDelete: 'Delete of an unqualified identifier in strict mode.',\n StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode',\n AccessorDataProperty: 'Object literal may not have data and accessor property with the same name',\n AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name',\n StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',\n StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',\n StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',\n StrictReservedWord: 'Use of future reserved word in strict mode'\n };\n\n // See also tools/generate-unicode-regex.py.\n Regex = {\n NonAsciiIdentifierStart: new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]'),\n NonAsciiIdentifierPart: new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0\\u08A2-\\u08AC\\u08E4-\\u08FE\\u0900-\\u0963\\u0966-\\u096F\\u0971-\\u0977\\u0979-\\u097F\\u0981-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\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u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1D00-\\u1DE6\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA697\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A\\uAA7B\\uAA80-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE26\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]')\n };\n\n // Ensure the condition is true, otherwise throw an error.\n // This is only to have a better contract semantic, i.e. another safety net\n // to catch a logic error. The condition shall be fulfilled in normal case.\n // Do NOT use this to enforce a certain condition on any user input.\n\n function assert(condition, message) {\n /* istanbul ignore if */\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }\n\n function isDecimalDigit(ch) {\n return (ch >= 48 && ch <= 57); // 0..9\n }\n\n function isHexDigit(ch) {\n return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;\n }\n\n function isOctalDigit(ch) {\n return '01234567'.indexOf(ch) >= 0;\n }\n\n\n // 7.2 White Space\n\n function isWhiteSpace(ch) {\n return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||\n (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);\n }\n\n // 7.3 Line Terminators\n\n function isLineTerminator(ch) {\n return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029);\n }\n\n // 7.6 Identifier Names and Identifiers\n\n function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }\n\n function isIdentifierPart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch >= 0x30 && ch <= 0x39) || // 0..9\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch)));\n }\n\n // 7.6.1.2 Future Reserved Words\n\n function isFutureReservedWord(id) {\n switch (id) {\n case 'class':\n case 'enum':\n case 'export':\n case 'extends':\n case 'import':\n case 'super':\n return true;\n default:\n return false;\n }\n }\n\n function isStrictModeReservedWord(id) {\n switch (id) {\n case 'implements':\n case 'interface':\n case 'package':\n case 'private':\n case 'protected':\n case 'public':\n case 'static':\n case 'yield':\n case 'let':\n return true;\n default:\n return false;\n }\n }\n\n function isRestrictedWord(id) {\n return id === 'eval' || id === 'arguments';\n }\n\n // 7.6.1.1 Keywords\n\n function isKeyword(id) {\n if (strict && isStrictModeReservedWord(id)) {\n return true;\n }\n\n // 'const' is specialized as Keyword in V8.\n // 'yield' and 'let' are for compatiblity with SpiderMonkey and ES.next.\n // Some others are from future reserved words.\n\n switch (id.length) {\n case 2:\n return (id === 'if') || (id === 'in') || (id === 'do');\n case 3:\n return (id === 'var') || (id === 'for') || (id === 'new') ||\n (id === 'try') || (id === 'let');\n case 4:\n return (id === 'this') || (id === 'else') || (id === 'case') ||\n (id === 'void') || (id === 'with') || (id === 'enum');\n case 5:\n return (id === 'while') || (id === 'break') || (id === 'catch') ||\n (id === 'throw') || (id === 'const') || (id === 'yield') ||\n (id === 'class') || (id === 'super');\n case 6:\n return (id === 'return') || (id === 'typeof') || (id === 'delete') ||\n (id === 'switch') || (id === 'export') || (id === 'import');\n case 7:\n return (id === 'default') || (id === 'finally') || (id === 'extends');\n case 8:\n return (id === 'function') || (id === 'continue') || (id === 'debugger');\n case 10:\n return (id === 'instanceof');\n default:\n return false;\n }\n }\n\n // 7.4 Comments\n\n function addComment(type, value, start, end, loc) {\n var comment, attacher;\n\n assert(typeof start === 'number', 'Comment must have valid position');\n\n // Because the way the actual token is scanned, often the comments\n // (if any) are skipped twice during the lexical analysis.\n // Thus, we need to skip adding a comment if the comment array already\n // handled it.\n if (state.lastCommentStart >= start) {\n return;\n }\n state.lastCommentStart = start;\n\n comment = {\n type: type,\n value: value\n };\n if (extra.range) {\n comment.range = [start, end];\n }\n if (extra.loc) {\n comment.loc = loc;\n }\n extra.comments.push(comment);\n if (extra.attachComment) {\n extra.leadingComments.push(comment);\n extra.trailingComments.push(comment);\n }\n }\n\n function skipSingleLineComment(offset) {\n var start, loc, ch, comment;\n\n start = index - offset;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart - offset\n }\n };\n\n while (index < length) {\n ch = source.charCodeAt(index);\n ++index;\n if (isLineTerminator(ch)) {\n if (extra.comments) {\n comment = source.slice(start + offset, index - 1);\n loc.end = {\n line: lineNumber,\n column: index - lineStart - 1\n };\n addComment('Line', comment, start, index - 1, loc);\n }\n if (ch === 13 && source.charCodeAt(index) === 10) {\n ++index;\n }\n ++lineNumber;\n lineStart = index;\n return;\n }\n }\n\n if (extra.comments) {\n comment = source.slice(start + offset, index);\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n addComment('Line', comment, start, index, loc);\n }\n }\n\n function skipMultiLineComment() {\n var start, loc, ch, comment;\n\n if (extra.comments) {\n start = index - 2;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart - 2\n }\n };\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n if (isLineTerminator(ch)) {\n if (ch === 0x0D && source.charCodeAt(index + 1) === 0x0A) {\n ++index;\n }\n ++lineNumber;\n ++index;\n lineStart = index;\n if (index >= length) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n } else if (ch === 0x2A) {\n // Block comment ends with '*/'.\n if (source.charCodeAt(index + 1) === 0x2F) {\n ++index;\n ++index;\n if (extra.comments) {\n comment = source.slice(start + 2, index - 2);\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n addComment('Block', comment, start, index, loc);\n }\n return;\n }\n ++index;\n } else {\n ++index;\n }\n }\n\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n function skipComment() {\n var ch, start;\n\n start = (index === 0);\n while (index < length) {\n ch = source.charCodeAt(index);\n\n if (isWhiteSpace(ch)) {\n ++index;\n } else if (isLineTerminator(ch)) {\n ++index;\n if (ch === 0x0D && source.charCodeAt(index) === 0x0A) {\n ++index;\n }\n ++lineNumber;\n lineStart = index;\n start = true;\n } else if (ch === 0x2F) { // U+002F is '/'\n ch = source.charCodeAt(index + 1);\n if (ch === 0x2F) {\n ++index;\n ++index;\n skipSingleLineComment(2);\n start = true;\n } else if (ch === 0x2A) { // U+002A is '*'\n ++index;\n ++index;\n skipMultiLineComment();\n } else {\n break;\n }\n } else if (start && ch === 0x2D) { // U+002D is '-'\n // U+003E is '>'\n if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) {\n // '-->' is a single-line comment\n index += 3;\n skipSingleLineComment(3);\n } else {\n break;\n }\n } else if (ch === 0x3C) { // U+003C is '<'\n if (source.slice(index + 1, index + 4) === '!--') {\n ++index; // `<`\n ++index; // `!`\n ++index; // `-`\n ++index; // `-`\n skipSingleLineComment(4);\n } else {\n break;\n }\n } else {\n break;\n }\n }\n }\n\n function scanHexEscape(prefix) {\n var i, len, ch, code = 0;\n\n len = (prefix === 'u') ? 4 : 2;\n for (i = 0; i < len; ++i) {\n if (index < length && isHexDigit(source[index])) {\n ch = source[index++];\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n } else {\n return '';\n }\n }\n return String.fromCharCode(code);\n }\n\n function getEscapedIdentifier() {\n var ch, id;\n\n ch = source.charCodeAt(index++);\n id = String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierStart(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n id = ch;\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n if (!isIdentifierPart(ch)) {\n break;\n }\n ++index;\n id += String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n id = id.substr(0, id.length - 1);\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierPart(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n id += ch;\n }\n }\n\n return id;\n }\n\n function getIdentifier() {\n var start, ch;\n\n start = index++;\n while (index < length) {\n ch = source.charCodeAt(index);\n if (ch === 0x5C) {\n // Blackslash (U+005C) marks Unicode escape sequence.\n index = start;\n return getEscapedIdentifier();\n }\n if (isIdentifierPart(ch)) {\n ++index;\n } else {\n break;\n }\n }\n\n return source.slice(start, index);\n }\n\n function scanIdentifier() {\n var start, id, type;\n\n start = index;\n\n // Backslash (U+005C) starts an escaped character.\n id = (source.charCodeAt(index) === 0x5C) ? getEscapedIdentifier() : getIdentifier();\n\n // There is no keyword or literal with only one character.\n // Thus, it must be an identifier.\n if (id.length === 1) {\n type = Token.Identifier;\n } else if (isKeyword(id)) {\n type = Token.Keyword;\n } else if (id === 'null') {\n type = Token.NullLiteral;\n } else if (id === 'true' || id === 'false') {\n type = Token.BooleanLiteral;\n } else {\n type = Token.Identifier;\n }\n\n return {\n type: type,\n value: id,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n\n // 7.7 Punctuators\n\n function scanPunctuator() {\n var start = index,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2,\n ch3,\n ch4;\n\n switch (code) {\n\n // Check for most common single-character punctuators.\n case 0x2E: // . dot\n case 0x28: // ( open bracket\n case 0x29: // ) close bracket\n case 0x3B: // ; semicolon\n case 0x2C: // , comma\n case 0x7B: // { open curly brace\n case 0x7D: // } close curly brace\n case 0x5B: // [\n case 0x5D: // ]\n case 0x3A: // :\n case 0x3F: // ?\n case 0x7E: // ~\n ++index;\n if (extra.tokenize) {\n if (code === 0x28) {\n extra.openParenToken = extra.tokens.length;\n } else if (code === 0x7B) {\n extra.openCurlyToken = extra.tokens.length;\n }\n }\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n\n default:\n code2 = source.charCodeAt(index + 1);\n\n // '=' (U+003D) marks an assignment or comparison operator.\n if (code2 === 0x3D) {\n switch (code) {\n case 0x2B: // +\n case 0x2D: // -\n case 0x2F: // /\n case 0x3C: // <\n case 0x3E: // >\n case 0x5E: // ^\n case 0x7C: // |\n case 0x25: // %\n case 0x26: // &\n case 0x2A: // *\n index += 2;\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code) + String.fromCharCode(code2),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n\n case 0x21: // !\n case 0x3D: // =\n index += 2;\n\n // !== and ===\n if (source.charCodeAt(index) === 0x3D) {\n ++index;\n }\n return {\n type: Token.Punctuator,\n value: source.slice(start, index),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n }\n }\n\n // 4-character punctuator: >>>=\n\n ch4 = source.substr(index, 4);\n\n if (ch4 === '>>>=') {\n index += 4;\n return {\n type: Token.Punctuator,\n value: ch4,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 3-character punctuators: === !== >>> <<= >>=\n\n ch3 = ch4.substr(0, 3);\n\n if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {\n index += 3;\n return {\n type: Token.Punctuator,\n value: ch3,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // Other 2-character punctuators: ++ -- << >> && ||\n ch2 = ch3.substr(0, 2);\n\n if ((ch1 === ch2[1] && ('+-<>&|'.indexOf(ch1) >= 0)) || ch2 === '=>') {\n index += 2;\n return {\n type: Token.Punctuator,\n value: ch2,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 1-character punctuators: < > = ! + - * % & | ^ /\n if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n ++index;\n return {\n type: Token.Punctuator,\n value: ch1,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n // 7.8.3 Numeric Literals\n\n function scanHexLiteral(start) {\n var number = '';\n\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (number.length === 0) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt('0x' + number, 16),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function scanOctalLiteral(start) {\n var number = '0' + source[index++];\n while (index < length) {\n if (!isOctalDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt(number, 8),\n octal: true,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function isImplicitOctalLiteral() {\n var i, ch;\n\n // Implicit octal, unless there is a non-octal digit.\n // (Annex B.1.1 on Numeric Literals)\n for (i = index + 1; i < length; ++i) {\n ch = source[i];\n if (ch === '8' || ch === '9') {\n return false;\n }\n if (!isOctalDigit(ch)) {\n return true;\n }\n }\n\n return true;\n }\n\n function scanNumericLiteral() {\n var number, start, ch;\n\n ch = source[index];\n assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),\n 'Numeric literal must start with a decimal digit or a decimal point');\n\n start = index;\n number = '';\n if (ch !== '.') {\n number = source[index++];\n ch = source[index];\n\n // Hex number starts with '0x'.\n // Octal number starts with '0'.\n if (number === '0') {\n if (ch === 'x' || ch === 'X') {\n ++index;\n return scanHexLiteral(start);\n }\n if (isOctalDigit(ch)) {\n if (isImplicitOctalLiteral()) {\n return scanOctalLiteral(start);\n }\n }\n }\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === '.') {\n number += source[index++];\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === 'e' || ch === 'E') {\n number += source[index++];\n\n ch = source[index];\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n if (isDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseFloat(number),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 7.8.4 String Literals\n\n function scanStringLiteral() {\n var str = '', quote, start, ch, code, unescaped, restore, octal = false, startLineNumber, startLineStart;\n startLineNumber = lineNumber;\n startLineStart = lineStart;\n\n quote = source[index];\n assert((quote === '\\'' || quote === '\"'),\n 'String literal must starts with a quote');\n\n start = index;\n ++index;\n\n while (index < length) {\n ch = source[index++];\n\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'u':\n case 'x':\n restore = index;\n unescaped = scanHexEscape(ch);\n if (unescaped) {\n str += unescaped;\n } else {\n index = restore;\n str += ch;\n }\n break;\n case 'n':\n str += '\\n';\n break;\n case 'r':\n str += '\\r';\n break;\n case 't':\n str += '\\t';\n break;\n case 'b':\n str += '\\b';\n break;\n case 'f':\n str += '\\f';\n break;\n case 'v':\n str += '\\x0B';\n break;\n\n default:\n if (isOctalDigit(ch)) {\n code = '01234567'.indexOf(ch);\n\n // \\0 is not octal escape sequence\n if (code !== 0) {\n octal = true;\n }\n\n if (index < length && isOctalDigit(source[index])) {\n octal = true;\n code = code * 8 + '01234567'.indexOf(source[index++]);\n\n // 3 digits are only allowed when string starts\n // with 0, 1, 2, 3\n if ('0123'.indexOf(ch) >= 0 &&\n index < length &&\n isOctalDigit(source[index])) {\n code = code * 8 + '01234567'.indexOf(source[index++]);\n }\n }\n str += String.fromCharCode(code);\n } else {\n str += ch;\n }\n break;\n }\n } else {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n\n if (quote !== '') {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.StringLiteral,\n value: str,\n octal: octal,\n startLineNumber: startLineNumber,\n startLineStart: startLineStart,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function testRegExp(pattern, flags) {\n var value;\n try {\n value = new RegExp(pattern, flags);\n } catch (e) {\n throwError({}, Messages.InvalidRegExp);\n }\n return value;\n }\n\n function scanRegExpBody() {\n var ch, str, classMarker, terminated, body;\n\n ch = source[index];\n assert(ch === '/', 'Regular expression literal must start with a slash');\n str = source[index++];\n\n classMarker = false;\n terminated = false;\n while (index < length) {\n ch = source[index++];\n str += ch;\n if (ch === '\\\\') {\n ch = source[index++];\n // ECMA-262 7.8.5\n if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, Messages.UnterminatedRegExp);\n }\n str += ch;\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, Messages.UnterminatedRegExp);\n } else if (classMarker) {\n if (ch === ']') {\n classMarker = false;\n }\n } else {\n if (ch === '/') {\n terminated = true;\n break;\n } else if (ch === '[') {\n classMarker = true;\n }\n }\n }\n\n if (!terminated) {\n throwError({}, Messages.UnterminatedRegExp);\n }\n\n // Exclude leading and trailing slash.\n body = str.substr(1, str.length - 2);\n return {\n value: body,\n literal: str\n };\n }\n\n function scanRegExpFlags() {\n var ch, str, flags, restore;\n\n str = '';\n flags = '';\n while (index < length) {\n ch = source[index];\n if (!isIdentifierPart(ch.charCodeAt(0))) {\n break;\n }\n\n ++index;\n if (ch === '\\\\' && index < length) {\n ch = source[index];\n if (ch === 'u') {\n ++index;\n restore = index;\n ch = scanHexEscape('u');\n if (ch) {\n flags += ch;\n for (str += '\\\\u'; restore < index; ++restore) {\n str += source[restore];\n }\n } else {\n index = restore;\n flags += 'u';\n str += '\\\\u';\n }\n throwErrorTolerant({}, Messages.UnexpectedToken, 'ILLEGAL');\n } else {\n str += '\\\\';\n throwErrorTolerant({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n } else {\n flags += ch;\n str += ch;\n }\n }\n\n return {\n value: flags,\n literal: str\n };\n }\n\n function scanRegExp() {\n var start, body, flags, pattern, value;\n\n lookahead = null;\n skipComment();\n start = index;\n\n body = scanRegExpBody();\n flags = scanRegExpFlags();\n value = testRegExp(body.value, flags.value);\n\n if (extra.tokenize) {\n return {\n type: Token.RegularExpression,\n value: value,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n return {\n literal: body.literal + flags.literal,\n value: value,\n start: start,\n end: index\n };\n }\n\n function collectRegex() {\n var pos, loc, regex, token;\n\n skipComment();\n\n pos = index;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart\n }\n };\n\n regex = scanRegExp();\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n\n /* istanbul ignore next */\n if (!extra.tokenize) {\n // Pop the previous token, which is likely '/' or '/='\n if (extra.tokens.length > 0) {\n token = extra.tokens[extra.tokens.length - 1];\n if (token.range[0] === pos && token.type === 'Punctuator') {\n if (token.value === '/' || token.value === '/=') {\n extra.tokens.pop();\n }\n }\n }\n\n extra.tokens.push({\n type: 'RegularExpression',\n value: regex.literal,\n range: [pos, index],\n loc: loc\n });\n }\n\n return regex;\n }\n\n function isIdentifierName(token) {\n return token.type === Token.Identifier ||\n token.type === Token.Keyword ||\n token.type === Token.BooleanLiteral ||\n token.type === Token.NullLiteral;\n }\n\n function advanceSlash() {\n var prevToken,\n checkToken;\n // Using the following algorithm:\n // https://github.com/mozilla/sweet.js/wiki/design\n prevToken = extra.tokens[extra.tokens.length - 1];\n if (!prevToken) {\n // Nothing before that: it cannot be a division.\n return collectRegex();\n }\n if (prevToken.type === 'Punctuator') {\n if (prevToken.value === ']') {\n return scanPunctuator();\n }\n if (prevToken.value === ')') {\n checkToken = extra.tokens[extra.openParenToken - 1];\n if (checkToken &&\n checkToken.type === 'Keyword' &&\n (checkToken.value === 'if' ||\n checkToken.value === 'while' ||\n checkToken.value === 'for' ||\n checkToken.value === 'with')) {\n return collectRegex();\n }\n return scanPunctuator();\n }\n if (prevToken.value === '}') {\n // Dividing a function by anything makes little sense,\n // but we have to check for that.\n if (extra.tokens[extra.openCurlyToken - 3] &&\n extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') {\n // Anonymous function.\n checkToken = extra.tokens[extra.openCurlyToken - 4];\n if (!checkToken) {\n return scanPunctuator();\n }\n } else if (extra.tokens[extra.openCurlyToken - 4] &&\n extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') {\n // Named function.\n checkToken = extra.tokens[extra.openCurlyToken - 5];\n if (!checkToken) {\n return collectRegex();\n }\n } else {\n return scanPunctuator();\n }\n // checkToken determines whether the function is\n // a declaration or an expression.\n if (FnExprTokens.indexOf(checkToken.value) >= 0) {\n // It is an expression.\n return scanPunctuator();\n }\n // It is a declaration.\n return collectRegex();\n }\n return collectRegex();\n }\n if (prevToken.type === 'Keyword' && prevToken.value !== 'this') {\n return collectRegex();\n }\n return scanPunctuator();\n }\n\n function advance() {\n var ch;\n\n skipComment();\n\n if (index >= length) {\n return {\n type: Token.EOF,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: index,\n end: index\n };\n }\n\n ch = source.charCodeAt(index);\n\n if (isIdentifierStart(ch)) {\n return scanIdentifier();\n }\n\n // Very common: ( and ) and ;\n if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {\n return scanPunctuator();\n }\n\n // String literal starts with single quote (U+0027) or double quote (U+0022).\n if (ch === 0x27 || ch === 0x22) {\n return scanStringLiteral();\n }\n\n\n // Dot (.) U+002E can also start a floating-point number, hence the need\n // to check the next character.\n if (ch === 0x2E) {\n if (isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNumericLiteral();\n }\n return scanPunctuator();\n }\n\n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n\n // Slash (/) U+002F can also start a regex.\n if (extra.tokenize && ch === 0x2F) {\n return advanceSlash();\n }\n\n return scanPunctuator();\n }\n\n function collectToken() {\n var loc, token, range, value;\n\n skipComment();\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart\n }\n };\n\n token = advance();\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n\n if (token.type !== Token.EOF) {\n value = source.slice(token.start, token.end);\n extra.tokens.push({\n type: TokenName[token.type],\n value: value,\n range: [token.start, token.end],\n loc: loc\n });\n }\n\n return token;\n }\n\n function lex() {\n var token;\n\n token = lookahead;\n index = token.end;\n lineNumber = token.lineNumber;\n lineStart = token.lineStart;\n\n lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();\n\n index = token.end;\n lineNumber = token.lineNumber;\n lineStart = token.lineStart;\n\n return token;\n }\n\n function peek() {\n var pos, line, start;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();\n index = pos;\n lineNumber = line;\n lineStart = start;\n }\n\n function Position(line, column) {\n this.line = line;\n this.column = column;\n }\n\n function SourceLocation(startLine, startColumn, line, column) {\n this.start = new Position(startLine, startColumn);\n this.end = new Position(line, column);\n }\n\n SyntaxTreeDelegate = {\n\n name: 'SyntaxTree',\n\n processComment: function (node) {\n var lastChild, trailingComments;\n\n if (node.type === Syntax.Program) {\n if (node.body.length > 0) {\n return;\n }\n }\n\n if (extra.trailingComments.length > 0) {\n if (extra.trailingComments[0].range[0] >= node.range[1]) {\n trailingComments = extra.trailingComments;\n extra.trailingComments = [];\n } else {\n extra.trailingComments.length = 0;\n }\n } else {\n if (extra.bottomRightStack.length > 0 &&\n extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments &&\n extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments[0].range[0] >= node.range[1]) {\n trailingComments = extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments;\n delete extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments;\n }\n }\n\n // Eating the stack.\n while (extra.bottomRightStack.length > 0 && extra.bottomRightStack[extra.bottomRightStack.length - 1].range[0] >= node.range[0]) {\n lastChild = extra.bottomRightStack.pop();\n }\n\n if (lastChild) {\n if (lastChild.leadingComments && lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= node.range[0]) {\n node.leadingComments = lastChild.leadingComments;\n delete lastChild.leadingComments;\n }\n } else if (extra.leadingComments.length > 0 && extra.leadingComments[extra.leadingComments.length - 1].range[1] <= node.range[0]) {\n node.leadingComments = extra.leadingComments;\n extra.leadingComments = [];\n }\n\n\n if (trailingComments) {\n node.trailingComments = trailingComments;\n }\n\n extra.bottomRightStack.push(node);\n },\n\n markEnd: function (node, startToken) {\n if (extra.range) {\n node.range = [startToken.start, index];\n }\n if (extra.loc) {\n node.loc = new SourceLocation(\n startToken.startLineNumber === undefined ? startToken.lineNumber : startToken.startLineNumber,\n startToken.start - (startToken.startLineStart === undefined ? startToken.lineStart : startToken.startLineStart),\n lineNumber,\n index - lineStart\n );\n this.postProcess(node);\n }\n\n if (extra.attachComment) {\n this.processComment(node);\n }\n return node;\n },\n\n postProcess: function (node) {\n if (extra.source) {\n node.loc.source = extra.source;\n }\n return node;\n },\n\n createArrayExpression: function (elements) {\n return {\n type: Syntax.ArrayExpression,\n elements: elements\n };\n },\n\n createAssignmentExpression: function (operator, left, right) {\n return {\n type: Syntax.AssignmentExpression,\n operator: operator,\n left: left,\n right: right\n };\n },\n\n createBinaryExpression: function (operator, left, right) {\n var type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression :\n Syntax.BinaryExpression;\n return {\n type: type,\n operator: operator,\n left: left,\n right: right\n };\n },\n\n createBlockStatement: function (body) {\n return {\n type: Syntax.BlockStatement,\n body: body\n };\n },\n\n createBreakStatement: function (label) {\n return {\n type: Syntax.BreakStatement,\n label: label\n };\n },\n\n createCallExpression: function (callee, args) {\n return {\n type: Syntax.CallExpression,\n callee: callee,\n 'arguments': args\n };\n },\n\n createCatchClause: function (param, body) {\n return {\n type: Syntax.CatchClause,\n param: param,\n body: body\n };\n },\n\n createConditionalExpression: function (test, consequent, alternate) {\n return {\n type: Syntax.ConditionalExpression,\n test: test,\n consequent: consequent,\n alternate: alternate\n };\n },\n\n createContinueStatement: function (label) {\n return {\n type: Syntax.ContinueStatement,\n label: label\n };\n },\n\n createDebuggerStatement: function () {\n return {\n type: Syntax.DebuggerStatement\n };\n },\n\n createDoWhileStatement: function (body, test) {\n return {\n type: Syntax.DoWhileStatement,\n body: body,\n test: test\n };\n },\n\n createEmptyStatement: function () {\n return {\n type: Syntax.EmptyStatement\n };\n },\n\n createExpressionStatement: function (expression) {\n return {\n type: Syntax.ExpressionStatement,\n expression: expression\n };\n },\n\n createForStatement: function (init, test, update, body) {\n return {\n type: Syntax.ForStatement,\n init: init,\n test: test,\n update: update,\n body: body\n };\n },\n\n createForInStatement: function (left, right, body) {\n return {\n type: Syntax.ForInStatement,\n left: left,\n right: right,\n body: body,\n each: false\n };\n },\n\n createFunctionDeclaration: function (id, params, defaults, body) {\n return {\n type: Syntax.FunctionDeclaration,\n id: id,\n params: params,\n defaults: defaults,\n body: body,\n rest: null,\n generator: false,\n expression: false\n };\n },\n\n createFunctionExpression: function (id, params, defaults, body) {\n return {\n type: Syntax.FunctionExpression,\n id: id,\n params: params,\n defaults: defaults,\n body: body,\n rest: null,\n generator: false,\n expression: false\n };\n },\n\n createIdentifier: function (name) {\n return {\n type: Syntax.Identifier,\n name: name\n };\n },\n\n createIfStatement: function (test, consequent, alternate) {\n return {\n type: Syntax.IfStatement,\n test: test,\n consequent: consequent,\n alternate: alternate\n };\n },\n\n createLabeledStatement: function (label, body) {\n return {\n type: Syntax.LabeledStatement,\n label: label,\n body: body\n };\n },\n\n createLiteral: function (token) {\n return {\n type: Syntax.Literal,\n value: token.value,\n raw: source.slice(token.start, token.end)\n };\n },\n\n createMemberExpression: function (accessor, object, property) {\n return {\n type: Syntax.MemberExpression,\n computed: accessor === '[',\n object: object,\n property: property\n };\n },\n\n createNewExpression: function (callee, args) {\n return {\n type: Syntax.NewExpression,\n callee: callee,\n 'arguments': args\n };\n },\n\n createObjectExpression: function (properties) {\n return {\n type: Syntax.ObjectExpression,\n properties: properties\n };\n },\n\n createPostfixExpression: function (operator, argument) {\n return {\n type: Syntax.UpdateExpression,\n operator: operator,\n argument: argument,\n prefix: false\n };\n },\n\n createProgram: function (body) {\n return {\n type: Syntax.Program,\n body: body\n };\n },\n\n createProperty: function (kind, key, value) {\n return {\n type: Syntax.Property,\n key: key,\n value: value,\n kind: kind\n };\n },\n\n createReturnStatement: function (argument) {\n return {\n type: Syntax.ReturnStatement,\n argument: argument\n };\n },\n\n createSequenceExpression: function (expressions) {\n return {\n type: Syntax.SequenceExpression,\n expressions: expressions\n };\n },\n\n createSwitchCase: function (test, consequent) {\n return {\n type: Syntax.SwitchCase,\n test: test,\n consequent: consequent\n };\n },\n\n createSwitchStatement: function (discriminant, cases) {\n return {\n type: Syntax.SwitchStatement,\n discriminant: discriminant,\n cases: cases\n };\n },\n\n createThisExpression: function () {\n return {\n type: Syntax.ThisExpression\n };\n },\n\n createThrowStatement: function (argument) {\n return {\n type: Syntax.ThrowStatement,\n argument: argument\n };\n },\n\n createTryStatement: function (block, guardedHandlers, handlers, finalizer) {\n return {\n type: Syntax.TryStatement,\n block: block,\n guardedHandlers: guardedHandlers,\n handlers: handlers,\n finalizer: finalizer\n };\n },\n\n createUnaryExpression: function (operator, argument) {\n if (operator === '++' || operator === '--') {\n return {\n type: Syntax.UpdateExpression,\n operator: operator,\n argument: argument,\n prefix: true\n };\n }\n return {\n type: Syntax.UnaryExpression,\n operator: operator,\n argument: argument,\n prefix: true\n };\n },\n\n createVariableDeclaration: function (declarations, kind) {\n return {\n type: Syntax.VariableDeclaration,\n declarations: declarations,\n kind: kind\n };\n },\n\n createVariableDeclarator: function (id, init) {\n return {\n type: Syntax.VariableDeclarator,\n id: id,\n init: init\n };\n },\n\n createWhileStatement: function (test, body) {\n return {\n type: Syntax.WhileStatement,\n test: test,\n body: body\n };\n },\n\n createWithStatement: function (object, body) {\n return {\n type: Syntax.WithStatement,\n object: object,\n body: body\n };\n }\n };\n\n // Return true if there is a line terminator before the next token.\n\n function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }\n\n // Throw an exception\n\n function throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(\n /%(\\d)/g,\n function (whole, index) {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n }\n );\n\n if (typeof token.lineNumber === 'number') {\n error = new Error('Line ' + token.lineNumber + ': ' + msg);\n error.index = token.start;\n error.lineNumber = token.lineNumber;\n error.column = token.start - lineStart + 1;\n } else {\n error = new Error('Line ' + lineNumber + ': ' + msg);\n error.index = index;\n error.lineNumber = lineNumber;\n error.column = index - lineStart + 1;\n }\n\n error.description = msg;\n throw error;\n }\n\n function throwErrorTolerant() {\n try {\n throwError.apply(null, arguments);\n } catch (e) {\n if (extra.errors) {\n extra.errors.push(e);\n } else {\n throw e;\n }\n }\n }\n\n\n // Throw an exception because of the token.\n\n function throwUnexpected(token) {\n if (token.type === Token.EOF) {\n throwError(token, Messages.UnexpectedEOS);\n }\n\n if (token.type === Token.NumericLiteral) {\n throwError(token, Messages.UnexpectedNumber);\n }\n\n if (token.type === Token.StringLiteral) {\n throwError(token, Messages.UnexpectedString);\n }\n\n if (token.type === Token.Identifier) {\n throwError(token, Messages.UnexpectedIdentifier);\n }\n\n if (token.type === Token.Keyword) {\n if (isFutureReservedWord(token.value)) {\n throwError(token, Messages.UnexpectedReserved);\n } else if (strict && isStrictModeReservedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictReservedWord);\n return;\n }\n throwError(token, Messages.UnexpectedToken, token.value);\n }\n\n // BooleanLiteral, NullLiteral, or Punctuator.\n throwError(token, Messages.UnexpectedToken, token.value);\n }\n\n // Expect the next token to match the specified punctuator.\n // If not, an exception will be thrown.\n\n function expect(value) {\n var token = lex();\n if (token.type !== Token.Punctuator || token.value !== value) {\n throwUnexpected(token);\n }\n }\n\n // Expect the next token to match the specified keyword.\n // If not, an exception will be thrown.\n\n function expectKeyword(keyword) {\n var token = lex();\n if (token.type !== Token.Keyword || token.value !== keyword) {\n throwUnexpected(token);\n }\n }\n\n // Return true if the next token matches the specified punctuator.\n\n function match(value) {\n return lookahead.type === Token.Punctuator && lookahead.value === value;\n }\n\n // Return true if the next token matches the specified keyword\n\n function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }\n\n // Return true if the next token is an assignment operator\n\n function matchAssign() {\n var op;\n\n if (lookahead.type !== Token.Punctuator) {\n return false;\n }\n op = lookahead.value;\n return op === '=' ||\n op === '*=' ||\n op === '/=' ||\n op === '%=' ||\n op === '+=' ||\n op === '-=' ||\n op === '<<=' ||\n op === '>>=' ||\n op === '>>>=' ||\n op === '&=' ||\n op === '^=' ||\n op === '|=';\n }\n\n function consumeSemicolon() {\n var line, oldIndex = index, oldLineNumber = lineNumber,\n oldLineStart = lineStart, oldLookahead = lookahead;\n\n // Catch the very common case first: immediately a semicolon (U+003B).\n if (source.charCodeAt(index) === 0x3B || match(';')) {\n lex();\n return;\n }\n\n line = lineNumber;\n skipComment();\n if (lineNumber !== line) {\n index = oldIndex;\n lineNumber = oldLineNumber;\n lineStart = oldLineStart;\n lookahead = oldLookahead;\n return;\n }\n\n if (lookahead.type !== Token.EOF && !match('}')) {\n throwUnexpected(lookahead);\n }\n }\n\n // Return true if provided expression is LeftHandSideExpression\n\n function isLeftHandSide(expr) {\n return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression;\n }\n\n // 11.1.4 Array Initialiser\n\n function parseArrayInitialiser() {\n var elements = [], startToken;\n\n startToken = lookahead;\n expect('[');\n\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elements.push(parseAssignmentExpression());\n\n if (!match(']')) {\n expect(',');\n }\n }\n }\n\n lex();\n\n return delegate.markEnd(delegate.createArrayExpression(elements), startToken);\n }\n\n // 11.1.5 Object Initialiser\n\n function parsePropertyFunction(param, first) {\n var previousStrict, body, startToken;\n\n previousStrict = strict;\n startToken = lookahead;\n body = parseFunctionSourceElements();\n if (first && strict && isRestrictedWord(param[0].name)) {\n throwErrorTolerant(first, Messages.StrictParamName);\n }\n strict = previousStrict;\n return delegate.markEnd(delegate.createFunctionExpression(null, param, [], body), startToken);\n }\n\n function parseObjectPropertyKey() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n\n if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) {\n if (strict && token.octal) {\n throwErrorTolerant(token, Messages.StrictOctalLiteral);\n }\n return delegate.markEnd(delegate.createLiteral(token), startToken);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseObjectProperty() {\n var token, key, id, value, param, startToken;\n\n token = lookahead;\n startToken = lookahead;\n\n if (token.type === Token.Identifier) {\n\n id = parseObjectPropertyKey();\n\n // Property Assignment: Getter and Setter.\n\n if (token.value === 'get' && !match(':')) {\n key = parseObjectPropertyKey();\n expect('(');\n expect(')');\n value = parsePropertyFunction([]);\n return delegate.markEnd(delegate.createProperty('get', key, value), startToken);\n }\n if (token.value === 'set' && !match(':')) {\n key = parseObjectPropertyKey();\n expect('(');\n token = lookahead;\n if (token.type !== Token.Identifier) {\n expect(')');\n throwErrorTolerant(token, Messages.UnexpectedToken, token.value);\n value = parsePropertyFunction([]);\n } else {\n param = [ parseVariableIdentifier() ];\n expect(')');\n value = parsePropertyFunction(param, token);\n }\n return delegate.markEnd(delegate.createProperty('set', key, value), startToken);\n }\n expect(':');\n value = parseAssignmentExpression();\n return delegate.markEnd(delegate.createProperty('init', id, value), startToken);\n }\n if (token.type === Token.EOF || token.type === Token.Punctuator) {\n throwUnexpected(token);\n } else {\n key = parseObjectPropertyKey();\n expect(':');\n value = parseAssignmentExpression();\n return delegate.markEnd(delegate.createProperty('init', key, value), startToken);\n }\n }\n\n function parseObjectInitialiser() {\n var properties = [], property, name, key, kind, map = {}, toString = String, startToken;\n\n startToken = lookahead;\n\n expect('{');\n\n while (!match('}')) {\n property = parseObjectProperty();\n\n if (property.key.type === Syntax.Identifier) {\n name = property.key.name;\n } else {\n name = toString(property.key.value);\n }\n kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set;\n\n key = '$' + name;\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n if (map[key] === PropertyKind.Data) {\n if (strict && kind === PropertyKind.Data) {\n throwErrorTolerant({}, Messages.StrictDuplicateProperty);\n } else if (kind !== PropertyKind.Data) {\n throwErrorTolerant({}, Messages.AccessorDataProperty);\n }\n } else {\n if (kind === PropertyKind.Data) {\n throwErrorTolerant({}, Messages.AccessorDataProperty);\n } else if (map[key] & kind) {\n throwErrorTolerant({}, Messages.AccessorGetSet);\n }\n }\n map[key] |= kind;\n } else {\n map[key] = kind;\n }\n\n properties.push(property);\n\n if (!match('}')) {\n expect(',');\n }\n }\n\n expect('}');\n\n return delegate.markEnd(delegate.createObjectExpression(properties), startToken);\n }\n\n // 11.1.6 The Grouping Operator\n\n function parseGroupExpression() {\n var expr;\n\n expect('(');\n\n expr = parseExpression();\n\n expect(')');\n\n return expr;\n }\n\n\n // 11.1 Primary Expressions\n\n function parsePrimaryExpression() {\n var type, token, expr, startToken;\n\n if (match('(')) {\n return parseGroupExpression();\n }\n\n if (match('[')) {\n return parseArrayInitialiser();\n }\n\n if (match('{')) {\n return parseObjectInitialiser();\n }\n\n type = lookahead.type;\n startToken = lookahead;\n\n if (type === Token.Identifier) {\n expr = delegate.createIdentifier(lex().value);\n } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {\n if (strict && lookahead.octal) {\n throwErrorTolerant(lookahead, Messages.StrictOctalLiteral);\n }\n expr = delegate.createLiteral(lex());\n } else if (type === Token.Keyword) {\n if (matchKeyword('function')) {\n return parseFunctionExpression();\n }\n if (matchKeyword('this')) {\n lex();\n expr = delegate.createThisExpression();\n } else {\n throwUnexpected(lex());\n }\n } else if (type === Token.BooleanLiteral) {\n token = lex();\n token.value = (token.value === 'true');\n expr = delegate.createLiteral(token);\n } else if (type === Token.NullLiteral) {\n token = lex();\n token.value = null;\n expr = delegate.createLiteral(token);\n } else if (match('/') || match('/=')) {\n if (typeof extra.tokens !== 'undefined') {\n expr = delegate.createLiteral(collectRegex());\n } else {\n expr = delegate.createLiteral(scanRegExp());\n }\n peek();\n } else {\n throwUnexpected(lex());\n }\n\n return delegate.markEnd(expr, startToken);\n }\n\n // 11.2 Left-Hand-Side Expressions\n\n function parseArguments() {\n var args = [];\n\n expect('(');\n\n if (!match(')')) {\n while (index < length) {\n args.push(parseAssignmentExpression());\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return args;\n }\n\n function parseNonComputedProperty() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n if (!isIdentifierName(token)) {\n throwUnexpected(token);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseNonComputedMember() {\n expect('.');\n\n return parseNonComputedProperty();\n }\n\n function parseComputedMember() {\n var expr;\n\n expect('[');\n\n expr = parseExpression();\n\n expect(']');\n\n return expr;\n }\n\n function parseNewExpression() {\n var callee, args, startToken;\n\n startToken = lookahead;\n expectKeyword('new');\n callee = parseLeftHandSideExpression();\n args = match('(') ? parseArguments() : [];\n\n return delegate.markEnd(delegate.createNewExpression(callee, args), startToken);\n }\n\n function parseLeftHandSideExpressionAllowCall() {\n var expr, args, property, startToken, previousAllowIn = state.allowIn;\n\n startToken = lookahead;\n state.allowIn = true;\n expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n\n for (;;) {\n if (match('.')) {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n } else if (match('(')) {\n args = parseArguments();\n expr = delegate.createCallExpression(expr, args);\n } else if (match('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else {\n break;\n }\n delegate.markEnd(expr, startToken);\n }\n state.allowIn = previousAllowIn;\n\n return expr;\n }\n\n function parseLeftHandSideExpression() {\n var expr, property, startToken;\n assert(state.allowIn, 'callee of new expression always allow in keyword.');\n\n startToken = lookahead;\n\n expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n\n while (match('.') || match('[')) {\n if (match('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n }\n delegate.markEnd(expr, startToken);\n }\n return expr;\n }\n\n // 11.3 Postfix Expressions\n\n function parsePostfixExpression() {\n var expr, token, startToken = lookahead;\n\n expr = parseLeftHandSideExpressionAllowCall();\n\n if (lookahead.type === Token.Punctuator) {\n if ((match('++') || match('--')) && !peekLineTerminator()) {\n // 11.3.1, 11.3.2\n if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n throwErrorTolerant({}, Messages.StrictLHSPostfix);\n }\n\n if (!isLeftHandSide(expr)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n token = lex();\n expr = delegate.markEnd(delegate.createPostfixExpression(token.value, expr), startToken);\n }\n }\n\n return expr;\n }\n\n // 11.4 Unary Operators\n\n function parseUnaryExpression() {\n var token, expr, startToken;\n\n if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {\n expr = parsePostfixExpression();\n } else if (match('++') || match('--')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n // 11.4.4, 11.4.5\n if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n throwErrorTolerant({}, Messages.StrictLHSPrefix);\n }\n\n if (!isLeftHandSide(expr)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n } else if (match('+') || match('-') || match('~') || match('!')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) {\n throwErrorTolerant({}, Messages.StrictDelete);\n }\n } else {\n expr = parsePostfixExpression();\n }\n\n return expr;\n }\n\n function binaryPrecedence(token, allowIn) {\n var prec = 0;\n\n if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {\n return 0;\n }\n\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n\n case '&&':\n prec = 2;\n break;\n\n case '|':\n prec = 3;\n break;\n\n case '^':\n prec = 4;\n break;\n\n case '&':\n prec = 5;\n break;\n\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n prec = 7;\n break;\n\n case 'in':\n prec = allowIn ? 7 : 0;\n break;\n\n case '<<':\n case '>>':\n case '>>>':\n prec = 8;\n break;\n\n case '+':\n case '-':\n prec = 9;\n break;\n\n case '*':\n case '/':\n case '%':\n prec = 11;\n break;\n\n default:\n break;\n }\n\n return prec;\n }\n\n // 11.5 Multiplicative Operators\n // 11.6 Additive Operators\n // 11.7 Bitwise Shift Operators\n // 11.8 Relational Operators\n // 11.9 Equality Operators\n // 11.10 Binary Bitwise Operators\n // 11.11 Binary Logical Operators\n\n function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers[markers.length - 1];\n delegate.markEnd(expr, marker);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n delegate.markEnd(expr, marker);\n }\n\n return expr;\n }\n\n\n // 11.12 Conditional Operator\n\n function parseConditionalExpression() {\n var expr, previousAllowIn, consequent, alternate, startToken;\n\n startToken = lookahead;\n\n expr = parseBinaryExpression();\n\n if (match('?')) {\n lex();\n previousAllowIn = state.allowIn;\n state.allowIn = true;\n consequent = parseAssignmentExpression();\n state.allowIn = previousAllowIn;\n expect(':');\n alternate = parseAssignmentExpression();\n\n expr = delegate.createConditionalExpression(expr, consequent, alternate);\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 11.13 Assignment Operators\n\n function parseAssignmentExpression() {\n var token, left, right, node, startToken;\n\n token = lookahead;\n startToken = lookahead;\n\n node = left = parseConditionalExpression();\n\n if (matchAssign()) {\n // LeftHandSideExpression\n if (!isLeftHandSide(left)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n // 11.13.1\n if (strict && left.type === Syntax.Identifier && isRestrictedWord(left.name)) {\n throwErrorTolerant(token, Messages.StrictLHSAssignment);\n }\n\n token = lex();\n right = parseAssignmentExpression();\n node = delegate.markEnd(delegate.createAssignmentExpression(token.value, left, right), startToken);\n }\n\n return node;\n }\n\n // 11.14 Comma Operator\n\n function parseExpression() {\n var expr, startToken = lookahead;\n\n expr = parseAssignmentExpression();\n\n if (match(',')) {\n expr = delegate.createSequenceExpression([ expr ]);\n\n while (index < length) {\n if (!match(',')) {\n break;\n }\n lex();\n expr.expressions.push(parseAssignmentExpression());\n }\n\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 12.1 Block\n\n function parseStatementList() {\n var list = [],\n statement;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n statement = parseSourceElement();\n if (typeof statement === 'undefined') {\n break;\n }\n list.push(statement);\n }\n\n return list;\n }\n\n function parseBlock() {\n var block, startToken;\n\n startToken = lookahead;\n expect('{');\n\n block = parseStatementList();\n\n expect('}');\n\n return delegate.markEnd(delegate.createBlockStatement(block), startToken);\n }\n\n // 12.2 Variable Statement\n\n function parseVariableIdentifier() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n if (token.type !== Token.Identifier) {\n throwUnexpected(token);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseVariableDeclaration(kind) {\n var init = null, id, startToken;\n\n startToken = lookahead;\n id = parseVariableIdentifier();\n\n // 12.2.1\n if (strict && isRestrictedWord(id.name)) {\n throwErrorTolerant({}, Messages.StrictVarName);\n }\n\n if (kind === 'const') {\n expect('=');\n init = parseAssignmentExpression();\n } else if (match('=')) {\n lex();\n init = parseAssignmentExpression();\n }\n\n return delegate.markEnd(delegate.createVariableDeclarator(id, init), startToken);\n }\n\n function parseVariableDeclarationList(kind) {\n var list = [];\n\n do {\n list.push(parseVariableDeclaration(kind));\n if (!match(',')) {\n break;\n }\n lex();\n } while (index < length);\n\n return list;\n }\n\n function parseVariableStatement() {\n var declarations;\n\n expectKeyword('var');\n\n declarations = parseVariableDeclarationList();\n\n consumeSemicolon();\n\n return delegate.createVariableDeclaration(declarations, 'var');\n }\n\n // kind may be `const` or `let`\n // Both are experimental and not in the specification yet.\n // see http://wiki.ecmascript.org/doku.php?id=harmony:const\n // and http://wiki.ecmascript.org/doku.php?id=harmony:let\n function parseConstLetDeclaration(kind) {\n var declarations, startToken;\n\n startToken = lookahead;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken);\n }\n\n // 12.3 Empty Statement\n\n function parseEmptyStatement() {\n expect(';');\n return delegate.createEmptyStatement();\n }\n\n // 12.4 Expression Statement\n\n function parseExpressionStatement() {\n var expr = parseExpression();\n consumeSemicolon();\n return delegate.createExpressionStatement(expr);\n }\n\n // 12.5 If statement\n\n function parseIfStatement() {\n var test, consequent, alternate;\n\n expectKeyword('if');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n consequent = parseStatement();\n\n if (matchKeyword('else')) {\n lex();\n alternate = parseStatement();\n } else {\n alternate = null;\n }\n\n return delegate.createIfStatement(test, consequent, alternate);\n }\n\n // 12.6 Iteration Statements\n\n function parseDoWhileStatement() {\n var body, test, oldInIteration;\n\n expectKeyword('do');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n expectKeyword('while');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n if (match(';')) {\n lex();\n }\n\n return delegate.createDoWhileStatement(body, test);\n }\n\n function parseWhileStatement() {\n var test, body, oldInIteration;\n\n expectKeyword('while');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n return delegate.createWhileStatement(test, body);\n }\n\n function parseForVariableDeclaration() {\n var token, declarations, startToken;\n\n startToken = lookahead;\n token = lex();\n declarations = parseVariableDeclarationList();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, token.value), startToken);\n }\n\n function parseForStatement() {\n var init, test, update, left, right, body, oldInIteration, previousAllowIn = state.allowIn;\n\n init = test = update = null;\n\n expectKeyword('for');\n\n expect('(');\n\n if (match(';')) {\n lex();\n } else {\n if (matchKeyword('var') || matchKeyword('let')) {\n state.allowIn = false;\n init = parseForVariableDeclaration();\n state.allowIn = previousAllowIn;\n\n if (init.declarations.length === 1 && matchKeyword('in')) {\n lex();\n left = init;\n right = parseExpression();\n init = null;\n }\n } else {\n state.allowIn = false;\n init = parseExpression();\n state.allowIn = previousAllowIn;\n\n if (matchKeyword('in')) {\n // LeftHandSideExpression\n if (!isLeftHandSide(init)) {\n throwErrorTolerant({}, Messages.InvalidLHSInForIn);\n }\n\n lex();\n left = init;\n right = parseExpression();\n init = null;\n }\n }\n\n if (typeof left === 'undefined') {\n expect(';');\n }\n }\n\n if (typeof left === 'undefined') {\n\n if (!match(';')) {\n test = parseExpression();\n }\n expect(';');\n\n if (!match(')')) {\n update = parseExpression();\n }\n }\n\n expect(')');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n return (typeof left === 'undefined') ?\n delegate.createForStatement(init, test, update, body) :\n delegate.createForInStatement(left, right, body);\n }\n\n // 12.7 The continue statement\n\n function parseContinueStatement() {\n var label = null, key;\n\n expectKeyword('continue');\n\n // Optimize the most common form: 'continue;'.\n if (source.charCodeAt(index) === 0x3B) {\n lex();\n\n if (!state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(null);\n }\n\n if (peekLineTerminator()) {\n if (!state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(null);\n }\n\n if (lookahead.type === Token.Identifier) {\n label = parseVariableIdentifier();\n\n key = '$' + label.name;\n if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.UnknownLabel, label.name);\n }\n }\n\n consumeSemicolon();\n\n if (label === null && !state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(label);\n }\n\n // 12.8 The break statement\n\n function parseBreakStatement() {\n var label = null, key;\n\n expectKeyword('break');\n\n // Catch the very common case first: immediately a semicolon (U+003B).\n if (source.charCodeAt(index) === 0x3B) {\n lex();\n\n if (!(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(null);\n }\n\n if (peekLineTerminator()) {\n if (!(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(null);\n }\n\n if (lookahead.type === Token.Identifier) {\n label = parseVariableIdentifier();\n\n key = '$' + label.name;\n if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.UnknownLabel, label.name);\n }\n }\n\n consumeSemicolon();\n\n if (label === null && !(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(label);\n }\n\n // 12.9 The return statement\n\n function parseReturnStatement() {\n var argument = null;\n\n expectKeyword('return');\n\n if (!state.inFunctionBody) {\n throwErrorTolerant({}, Messages.IllegalReturn);\n }\n\n // 'return' followed by a space and an identifier is very common.\n if (source.charCodeAt(index) === 0x20) {\n if (isIdentifierStart(source.charCodeAt(index + 1))) {\n argument = parseExpression();\n consumeSemicolon();\n return delegate.createReturnStatement(argument);\n }\n }\n\n if (peekLineTerminator()) {\n return delegate.createReturnStatement(null);\n }\n\n if (!match(';')) {\n if (!match('}') && lookahead.type !== Token.EOF) {\n argument = parseExpression();\n }\n }\n\n consumeSemicolon();\n\n return delegate.createReturnStatement(argument);\n }\n\n // 12.10 The with statement\n\n function parseWithStatement() {\n var object, body;\n\n if (strict) {\n // TODO(ikarienator): Should we update the test cases instead?\n skipComment();\n throwErrorTolerant({}, Messages.StrictModeWith);\n }\n\n expectKeyword('with');\n\n expect('(');\n\n object = parseExpression();\n\n expect(')');\n\n body = parseStatement();\n\n return delegate.createWithStatement(object, body);\n }\n\n // 12.10 The swith statement\n\n function parseSwitchCase() {\n var test, consequent = [], statement, startToken;\n\n startToken = lookahead;\n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n\n while (index < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n statement = parseStatement();\n consequent.push(statement);\n }\n\n return delegate.markEnd(delegate.createSwitchCase(test, consequent), startToken);\n }\n\n function parseSwitchStatement() {\n var discriminant, cases, clause, oldInSwitch, defaultFound;\n\n expectKeyword('switch');\n\n expect('(');\n\n discriminant = parseExpression();\n\n expect(')');\n\n expect('{');\n\n cases = [];\n\n if (match('}')) {\n lex();\n return delegate.createSwitchStatement(discriminant, cases);\n }\n\n oldInSwitch = state.inSwitch;\n state.inSwitch = true;\n defaultFound = false;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n clause = parseSwitchCase();\n if (clause.test === null) {\n if (defaultFound) {\n throwError({}, Messages.MultipleDefaultsInSwitch);\n }\n defaultFound = true;\n }\n cases.push(clause);\n }\n\n state.inSwitch = oldInSwitch;\n\n expect('}');\n\n return delegate.createSwitchStatement(discriminant, cases);\n }\n\n // 12.13 The throw statement\n\n function parseThrowStatement() {\n var argument;\n\n expectKeyword('throw');\n\n if (peekLineTerminator()) {\n throwError({}, Messages.NewlineAfterThrow);\n }\n\n argument = parseExpression();\n\n consumeSemicolon();\n\n return delegate.createThrowStatement(argument);\n }\n\n // 12.14 The try statement\n\n function parseCatchClause() {\n var param, body, startToken;\n\n startToken = lookahead;\n expectKeyword('catch');\n\n expect('(');\n if (match(')')) {\n throwUnexpected(lookahead);\n }\n\n param = parseVariableIdentifier();\n // 12.14.1\n if (strict && isRestrictedWord(param.name)) {\n throwErrorTolerant({}, Messages.StrictCatchVariable);\n }\n\n expect(')');\n body = parseBlock();\n return delegate.markEnd(delegate.createCatchClause(param, body), startToken);\n }\n\n function parseTryStatement() {\n var block, handlers = [], finalizer = null;\n\n expectKeyword('try');\n\n block = parseBlock();\n\n if (matchKeyword('catch')) {\n handlers.push(parseCatchClause());\n }\n\n if (matchKeyword('finally')) {\n lex();\n finalizer = parseBlock();\n }\n\n if (handlers.length === 0 && !finalizer) {\n throwError({}, Messages.NoCatchOrFinally);\n }\n\n return delegate.createTryStatement(block, [], handlers, finalizer);\n }\n\n // 12.15 The debugger statement\n\n function parseDebuggerStatement() {\n expectKeyword('debugger');\n\n consumeSemicolon();\n\n return delegate.createDebuggerStatement();\n }\n\n // 12 Statements\n\n function parseStatement() {\n var type = lookahead.type,\n expr,\n labeledBody,\n key,\n startToken;\n\n if (type === Token.EOF) {\n throwUnexpected(lookahead);\n }\n\n if (type === Token.Punctuator && lookahead.value === '{') {\n return parseBlock();\n }\n\n startToken = lookahead;\n\n if (type === Token.Punctuator) {\n switch (lookahead.value) {\n case ';':\n return delegate.markEnd(parseEmptyStatement(), startToken);\n case '(':\n return delegate.markEnd(parseExpressionStatement(), startToken);\n default:\n break;\n }\n }\n\n if (type === Token.Keyword) {\n switch (lookahead.value) {\n case 'break':\n return delegate.markEnd(parseBreakStatement(), startToken);\n case 'continue':\n return delegate.markEnd(parseContinueStatement(), startToken);\n case 'debugger':\n return delegate.markEnd(parseDebuggerStatement(), startToken);\n case 'do':\n return delegate.markEnd(parseDoWhileStatement(), startToken);\n case 'for':\n return delegate.markEnd(parseForStatement(), startToken);\n case 'function':\n return delegate.markEnd(parseFunctionDeclaration(), startToken);\n case 'if':\n return delegate.markEnd(parseIfStatement(), startToken);\n case 'return':\n return delegate.markEnd(parseReturnStatement(), startToken);\n case 'switch':\n return delegate.markEnd(parseSwitchStatement(), startToken);\n case 'throw':\n return delegate.markEnd(parseThrowStatement(), startToken);\n case 'try':\n return delegate.markEnd(parseTryStatement(), startToken);\n case 'var':\n return delegate.markEnd(parseVariableStatement(), startToken);\n case 'while':\n return delegate.markEnd(parseWhileStatement(), startToken);\n case 'with':\n return delegate.markEnd(parseWithStatement(), startToken);\n default:\n break;\n }\n }\n\n expr = parseExpression();\n\n // 12.12 Labelled Statements\n if ((expr.type === Syntax.Identifier) && match(':')) {\n lex();\n\n key = '$' + expr.name;\n if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.Redeclaration, 'Label', expr.name);\n }\n\n state.labelSet[key] = true;\n labeledBody = parseStatement();\n delete state.labelSet[key];\n return delegate.markEnd(delegate.createLabeledStatement(expr, labeledBody), startToken);\n }\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createExpressionStatement(expr), startToken);\n }\n\n // 13 Function Definition\n\n function parseFunctionSourceElements() {\n var sourceElement, sourceElements = [], token, directive, firstRestricted,\n oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, startToken;\n\n startToken = lookahead;\n expect('{');\n\n while (index < length) {\n if (lookahead.type !== Token.StringLiteral) {\n break;\n }\n token = lookahead;\n\n sourceElement = parseSourceElement();\n sourceElements.push(sourceElement);\n if (sourceElement.expression.type !== Syntax.Literal) {\n // this is not directive\n break;\n }\n directive = source.slice(token.start + 1, token.end - 1);\n if (directive === 'use strict') {\n strict = true;\n if (firstRestricted) {\n throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);\n }\n } else {\n if (!firstRestricted && token.octal) {\n firstRestricted = token;\n }\n }\n }\n\n oldLabelSet = state.labelSet;\n oldInIteration = state.inIteration;\n oldInSwitch = state.inSwitch;\n oldInFunctionBody = state.inFunctionBody;\n\n state.labelSet = {};\n state.inIteration = false;\n state.inSwitch = false;\n state.inFunctionBody = true;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n sourceElement = parseSourceElement();\n if (typeof sourceElement === 'undefined') {\n break;\n }\n sourceElements.push(sourceElement);\n }\n\n expect('}');\n\n state.labelSet = oldLabelSet;\n state.inIteration = oldInIteration;\n state.inSwitch = oldInSwitch;\n state.inFunctionBody = oldInFunctionBody;\n\n return delegate.markEnd(delegate.createBlockStatement(sourceElements), startToken);\n }\n\n function parseParams(firstRestricted) {\n var param, params = [], token, stricted, paramSet, key, message;\n expect('(');\n\n if (!match(')')) {\n paramSet = {};\n while (index < length) {\n token = lookahead;\n param = parseVariableIdentifier();\n key = '$' + token.value;\n if (strict) {\n if (isRestrictedWord(token.value)) {\n stricted = token;\n message = Messages.StrictParamName;\n }\n if (Object.prototype.hasOwnProperty.call(paramSet, key)) {\n stricted = token;\n message = Messages.StrictParamDupe;\n }\n } else if (!firstRestricted) {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictParamName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n } else if (Object.prototype.hasOwnProperty.call(paramSet, key)) {\n firstRestricted = token;\n message = Messages.StrictParamDupe;\n }\n }\n params.push(param);\n paramSet[key] = true;\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return {\n params: params,\n stricted: stricted,\n firstRestricted: firstRestricted,\n message: message\n };\n }\n\n function parseFunctionDeclaration() {\n var id, params = [], body, token, stricted, tmp, firstRestricted, message, previousStrict, startToken;\n\n startToken = lookahead;\n\n expectKeyword('function');\n token = lookahead;\n id = parseVariableIdentifier();\n if (strict) {\n if (isRestrictedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictFunctionName);\n }\n } else {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictFunctionName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n }\n }\n\n tmp = parseParams(firstRestricted);\n params = tmp.params;\n stricted = tmp.stricted;\n firstRestricted = tmp.firstRestricted;\n if (tmp.message) {\n message = tmp.message;\n }\n\n previousStrict = strict;\n body = parseFunctionSourceElements();\n if (strict && firstRestricted) {\n throwError(firstRestricted, message);\n }\n if (strict && stricted) {\n throwErrorTolerant(stricted, message);\n }\n strict = previousStrict;\n\n return delegate.markEnd(delegate.createFunctionDeclaration(id, params, [], body), startToken);\n }\n\n function parseFunctionExpression() {\n var token, id = null, stricted, firstRestricted, message, tmp, params = [], body, previousStrict, startToken;\n\n startToken = lookahead;\n expectKeyword('function');\n\n if (!match('(')) {\n token = lookahead;\n id = parseVariableIdentifier();\n if (strict) {\n if (isRestrictedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictFunctionName);\n }\n } else {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictFunctionName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n }\n }\n }\n\n tmp = parseParams(firstRestricted);\n params = tmp.params;\n stricted = tmp.stricted;\n firstRestricted = tmp.firstRestricted;\n if (tmp.message) {\n message = tmp.message;\n }\n\n previousStrict = strict;\n body = parseFunctionSourceElements();\n if (strict && firstRestricted) {\n throwError(firstRestricted, message);\n }\n if (strict && stricted) {\n throwErrorTolerant(stricted, message);\n }\n strict = previousStrict;\n\n return delegate.markEnd(delegate.createFunctionExpression(id, params, [], body), startToken);\n }\n\n // 14 Program\n\n function parseSourceElement() {\n if (lookahead.type === Token.Keyword) {\n switch (lookahead.value) {\n case 'const':\n case 'let':\n return parseConstLetDeclaration(lookahead.value);\n case 'function':\n return parseFunctionDeclaration();\n default:\n return parseStatement();\n }\n }\n\n if (lookahead.type !== Token.EOF) {\n return parseStatement();\n }\n }\n\n function parseSourceElements() {\n var sourceElement, sourceElements = [], token, directive, firstRestricted;\n\n while (index < length) {\n token = lookahead;\n if (token.type !== Token.StringLiteral) {\n break;\n }\n\n sourceElement = parseSourceElement();\n sourceElements.push(sourceElement);\n if (sourceElement.expression.type !== Syntax.Literal) {\n // this is not directive\n break;\n }\n directive = source.slice(token.start + 1, token.end - 1);\n if (directive === 'use strict') {\n strict = true;\n if (firstRestricted) {\n throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);\n }\n } else {\n if (!firstRestricted && token.octal) {\n firstRestricted = token;\n }\n }\n }\n\n while (index < length) {\n sourceElement = parseSourceElement();\n /* istanbul ignore if */\n if (typeof sourceElement === 'undefined') {\n break;\n }\n sourceElements.push(sourceElement);\n }\n return sourceElements;\n }\n\n function parseProgram() {\n var body, startToken;\n\n skipComment();\n peek();\n startToken = lookahead;\n strict = false;\n\n body = parseSourceElements();\n return delegate.markEnd(delegate.createProgram(body), startToken);\n }\n\n function filterTokenLocation() {\n var i, entry, token, tokens = [];\n\n for (i = 0; i < extra.tokens.length; ++i) {\n entry = extra.tokens[i];\n token = {\n type: entry.type,\n value: entry.value\n };\n if (extra.range) {\n token.range = entry.range;\n }\n if (extra.loc) {\n token.loc = entry.loc;\n }\n tokens.push(token);\n }\n\n extra.tokens = tokens;\n }\n\n function tokenize(code, options) {\n var toString,\n token,\n tokens;\n\n toString = String;\n if (typeof code !== 'string' && !(code instanceof String)) {\n code = toString(code);\n }\n\n delegate = SyntaxTreeDelegate;\n source = code;\n index = 0;\n lineNumber = (source.length > 0) ? 1 : 0;\n lineStart = 0;\n length = source.length;\n lookahead = null;\n state = {\n allowIn: true,\n labelSet: {},\n inFunctionBody: false,\n inIteration: false,\n inSwitch: false,\n lastCommentStart: -1\n };\n\n extra = {};\n\n // Options matching.\n options = options || {};\n\n // Of course we collect tokens here.\n options.tokens = true;\n extra.tokens = [];\n extra.tokenize = true;\n // The following two fields are necessary to compute the Regex tokens.\n extra.openParenToken = -1;\n extra.openCurlyToken = -1;\n\n extra.range = (typeof options.range === 'boolean') && options.range;\n extra.loc = (typeof options.loc === 'boolean') && options.loc;\n\n if (typeof options.comment === 'boolean' && options.comment) {\n extra.comments = [];\n }\n if (typeof options.tolerant === 'boolean' && options.tolerant) {\n extra.errors = [];\n }\n\n try {\n peek();\n if (lookahead.type === Token.EOF) {\n return extra.tokens;\n }\n\n token = lex();\n while (lookahead.type !== Token.EOF) {\n try {\n token = lex();\n } catch (lexError) {\n token = lookahead;\n if (extra.errors) {\n extra.errors.push(lexError);\n // We have to break on the first error\n // to avoid infinite loops.\n break;\n } else {\n throw lexError;\n }\n }\n }\n\n filterTokenLocation();\n tokens = extra.tokens;\n if (typeof extra.comments !== 'undefined') {\n tokens.comments = extra.comments;\n }\n if (typeof extra.errors !== 'undefined') {\n tokens.errors = extra.errors;\n }\n } catch (e) {\n throw e;\n } finally {\n extra = {};\n }\n return tokens;\n }\n\n function parse(code, options) {\n var program, toString;\n\n toString = String;\n if (typeof code !== 'string' && !(code instanceof String)) {\n code = toString(code);\n }\n\n delegate = SyntaxTreeDelegate;\n source = code;\n index = 0;\n lineNumber = (source.length > 0) ? 1 : 0;\n lineStart = 0;\n length = source.length;\n lookahead = null;\n state = {\n allowIn: true,\n labelSet: {},\n inFunctionBody: false,\n inIteration: false,\n inSwitch: false,\n lastCommentStart: -1\n };\n\n extra = {};\n if (typeof options !== 'undefined') {\n extra.range = (typeof options.range === 'boolean') && options.range;\n extra.loc = (typeof options.loc === 'boolean') && options.loc;\n extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment;\n\n if (extra.loc && options.source !== null && options.source !== undefined) {\n extra.source = toString(options.source);\n }\n\n if (typeof options.tokens === 'boolean' && options.tokens) {\n extra.tokens = [];\n }\n if (typeof options.comment === 'boolean' && options.comment) {\n extra.comments = [];\n }\n if (typeof options.tolerant === 'boolean' && options.tolerant) {\n extra.errors = [];\n }\n if (extra.attachComment) {\n extra.range = true;\n extra.comments = [];\n extra.bottomRightStack = [];\n extra.trailingComments = [];\n extra.leadingComments = [];\n }\n }\n\n try {\n program = parseProgram();\n if (typeof extra.comments !== 'undefined') {\n program.comments = extra.comments;\n }\n if (typeof extra.tokens !== 'undefined') {\n filterTokenLocation();\n program.tokens = extra.tokens;\n }\n if (typeof extra.errors !== 'undefined') {\n program.errors = extra.errors;\n }\n } catch (e) {\n throw e;\n } finally {\n extra = {};\n }\n\n return program;\n }\n\n // Sync with *.json manifests.\n exports.version = '1.2.5';\n\n exports.tokenize = tokenize;\n\n exports.parse = parse;\n\n // Deep copy.\n /* istanbul ignore next */\n exports.Syntax = (function () {\n var name, types = {};\n\n if (typeof Object.create === 'function') {\n types = Object.create(null);\n }\n\n for (name in Syntax) {\n if (Syntax.hasOwnProperty(name)) {\n types[name] = Syntax[name];\n }\n }\n\n if (typeof Object.freeze === 'function') {\n Object.freeze(types);\n }\n\n return types;\n }());\n\n}));\n/* vim: set sw=4 ts=4 et tw=80 : */\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","'use strict';\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n","\"use strict\"\n\nfunction iota(n) {\n var result = new Array(n)\n for(var i=0; i\n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","\"use strict\";\n// Initial software, Jean-Daniel Fekete, Christian Poli, Copyright (c) Inria, BSD 3-Clause License, 2021\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.decompress = void 0;\nconst pako = require(\"pako\");\nconst lz4 = require(\"lz4js\");\nexports.decompress = {\n zlib: (input) => {\n return pako.inflate(new Uint8Array(input)).buffer;\n },\n lz4: (input) => {\n return lz4.decompress(new Uint8Array(input)).buffer;\n },\n};\n//# sourceMappingURL=compression.js.map","\"use strict\";\n// Initial software, Jean-Daniel Fekete, Christian Poli, Copyright (c) Inria, BSD 3-Clause License, 2021\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = exports.decompress = exports.rowProxy = exports.table_serialization = exports.EchoTableWidgetView = exports.EchoTableWidgetModel = exports.TableWidgetModel = void 0;\nvar widgets_1 = require(\"./widgets\");\nObject.defineProperty(exports, \"TableWidgetModel\", { enumerable: true, get: function () { return widgets_1.TableWidgetModel; } });\nObject.defineProperty(exports, \"EchoTableWidgetModel\", { enumerable: true, get: function () { return widgets_1.EchoTableWidgetModel; } });\nObject.defineProperty(exports, \"EchoTableWidgetView\", { enumerable: true, get: function () { return widgets_1.EchoTableWidgetView; } });\nvar serializers_1 = require(\"./serializers\");\nObject.defineProperty(exports, \"table_serialization\", { enumerable: true, get: function () { return serializers_1.table_serialization; } });\nObject.defineProperty(exports, \"rowProxy\", { enumerable: true, get: function () { return serializers_1.rowProxy; } });\nvar compression_1 = require(\"./compression\");\nObject.defineProperty(exports, \"decompress\", { enumerable: true, get: function () { return compression_1.decompress; } });\nexports.version = require('../package.json').version;\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Initial software, Jean-Daniel Fekete, Christian Poli, Copyright (c) Inria, BSD 3-Clause License, 2021\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.table_serialization = exports.tableToJSON = exports.rowProxy = exports.JSONToTable = void 0;\nconst ndarray = require(\"ndarray\");\nconst compression_1 = require(\"./compression\");\nconst dtypeToArray = {\n \"bool\": Uint8Array,\n int8: Int8Array,\n int16: Int16Array,\n int32: Int32Array,\n uint8: Uint8Array,\n uint16: Uint16Array,\n uint32: Uint32Array,\n float32: Float32Array,\n float64: Float64Array,\n str: Array\n};\nconst RowIndex = Symbol('rowIndex');\nfunction JSONToTable(obj, manager) {\n if (obj === null) {\n return null;\n }\n var data = {};\n var size = Infinity;\n let decoder = new TextDecoder(\"utf-8\");\n let buffer;\n for (const [col, val] of Object.entries(obj.data)) {\n // console.log(col, val);\n if (val.compression !== undefined) {\n let valBuffer = val.buffer;\n buffer = compression_1.decompress[val.compression](valBuffer.buffer);\n if (val.dtype === \"str\") {\n let u8buf = buffer;\n let strcol = decoder.decode(u8buf);\n let lstr = JSON.parse(strcol);\n data[col] = lstr;\n }\n else { //numeric\n data[col] = ndarray(new dtypeToArray[val.dtype](buffer), val.shape);\n size = Math.min(size, val.shape[0]);\n }\n }\n else { // no compression\n if (val.dtype === \"str\") {\n let lstr = val.buffer;\n data[col] = lstr;\n size = Math.min(size, lstr.length);\n }\n else { //numeric\n let valBuffer = val.buffer;\n data[col] = ndarray(new dtypeToArray[val.dtype](valBuffer.buffer), val.shape);\n size = Math.min(size, val.shape[0]);\n }\n }\n }\n var result = { columns: obj.columns, data: data, size: size };\n // console.log(\"result\", result);\n //let objFoo = obj.data.foo;\n return result;\n}\nexports.JSONToTable = JSONToTable;\nfunction rowProxy(table) {\n if (table === null) {\n return null;\n }\n var fields = table.columns;\n var proto = {};\n fields.forEach((name) => {\n const column = table.data[name];\n const arraycolumn = column;\n const stringcolumn = column;\n // skip columns with duplicate names\n if (proto.hasOwnProperty(name))\n return;\n if (arraycolumn.shape === undefined) {\n Object.defineProperty(proto, name, {\n get: function () {\n const i = this[RowIndex];\n return stringcolumn[i];\n },\n set: function () {\n throw Error('Arrow field values can not be overwritten.');\n },\n enumerable: true\n });\n }\n else {\n Object.defineProperty(proto, name, {\n get: function () {\n const i = this[RowIndex];\n const v = arraycolumn.get(i);\n return isNaN(v) ? null : v;\n },\n set: function () {\n throw Error('Arrow field values can not be overwritten.');\n },\n enumerable: true\n });\n }\n });\n return (i) => {\n var r = Object.create(proto);\n r[RowIndex] = i;\n return r;\n };\n}\nexports.rowProxy = rowProxy;\nfunction tableToJSON(obj, widget) {\n return null; // TODO: implement or remove ...\n}\nexports.tableToJSON = tableToJSON;\n/**\n * Serializers for to/from tables/dataframes\n */\nexports.table_serialization = { deserialize: JSONToTable, serialize: tableToJSON };\n//# sourceMappingURL=serializers.js.map","\"use strict\";\n// Initial software, Jean-Daniel Fekete, Christian Poli, Copyright (c) Inria, BSD 3-Clause License, 2021\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EchoTableWidgetView = exports.EchoTableWidgetModel = exports.TableWidgetModel = void 0;\nconst base_1 = require(\"@jupyter-widgets/base\");\nconst ndarray = require(\"ndarray\");\nconst ndarray_unpack = require(\"ndarray-unpack\");\nconst serializers_1 = require(\"./serializers\");\nlet version = require('../package.json').version;\nclass TableWidgetModel extends base_1.DOMWidgetModel {\n defaults() {\n return Object.assign(Object.assign({}, base_1.DOMWidgetModel.prototype.defaults()), { _model_name: \"TableWidgetModel\", _view_name: null, _model_module: 'jupyter-tablewidgets', _view_module: null, _model_module_version: version, _view_module_version: '', _table: ndarray([]), _columns: [] });\n }\n ;\n}\nexports.TableWidgetModel = TableWidgetModel;\nTableWidgetModel.serializers = Object.assign(Object.assign({}, base_1.DOMWidgetModel.serializers), { _table: serializers_1.table_serialization });\n// https://gist.github.com/pbugnion/63cf43b41ec0eed2d0b7e7426d1c67d2\nclass EchoTableWidgetModel extends base_1.DOMWidgetModel {\n defaults() {\n return Object.assign(Object.assign({}, base_1.DOMWidgetModel.prototype.defaults()), { _model_name: \"EchoTableWidgetModel\", _view_name: \"EchoTableWidgetView\", _model_module: 'jupyter-tablewidgets', _view_module: 'jupyter-tablewidgets', _model_module_version: version, _view_module_version: version, data: [], echo: [] });\n }\n ;\n}\nexports.EchoTableWidgetModel = EchoTableWidgetModel;\nEchoTableWidgetModel.serializers = Object.assign(Object.assign({}, base_1.DOMWidgetModel.serializers), { data: { deserialize: base_1.unpack_models } });\nclass EchoTableWidgetView extends base_1.DOMWidgetView {\n render() {\n return __awaiter(this, void 0, void 0, function* () {\n let that = this.model;\n let subwg = that.get(\"data\");\n let table = subwg.get(\"_table\");\n let res = { 'columns': table.columns, 'data': {} };\n for (const [col, v] of Object.entries(table.data)) {\n let val = v;\n if (val.dtype !== undefined) {\n res.data[col] = ndarray_unpack(val);\n }\n else {\n res.data[col] = val;\n }\n }\n that.set(\"echo\", res);\n this.touch();\n });\n }\n ;\n}\nexports.EchoTableWidgetView = EchoTableWidgetView;\n//# sourceMappingURL=widgets.js.map","// lz4.js - An implementation of Lz4 in plain JavaScript.\n//\n// TODO:\n// - Unify header parsing/writing.\n// - Support options (block size, checksums)\n// - Support streams\n// - Better error handling (handle bad offset, etc.)\n// - HC support (better search algorithm)\n// - Tests/benchmarking\n\nvar xxhash = require('./xxh32.js');\nvar util = require('./util.js');\n\n// Constants\n// --\n\n// Compression format parameters/constants.\nvar minMatch = 4;\nvar minLength = 13;\nvar searchLimit = 5;\nvar skipTrigger = 6;\nvar hashSize = 1 << 16;\n\n// Token constants.\nvar mlBits = 4;\nvar mlMask = (1 << mlBits) - 1;\nvar runBits = 4;\nvar runMask = (1 << runBits) - 1;\n\n// Shared buffers\nvar blockBuf = makeBuffer(5 << 20);\nvar hashTable = makeHashTable();\n\n// Frame constants.\nvar magicNum = 0x184D2204;\n\n// Frame descriptor flags.\nvar fdContentChksum = 0x4;\nvar fdContentSize = 0x8;\nvar fdBlockChksum = 0x10;\n// var fdBlockIndep = 0x20;\nvar fdVersion = 0x40;\nvar fdVersionMask = 0xC0;\n\n// Block sizes.\nvar bsUncompressed = 0x80000000;\nvar bsDefault = 7;\nvar bsShift = 4;\nvar bsMask = 7;\nvar bsMap = {\n 4: 0x10000,\n 5: 0x40000,\n 6: 0x100000,\n 7: 0x400000\n};\n\n// Utility functions/primitives\n// --\n\n// Makes our hashtable. On older browsers, may return a plain array.\nfunction makeHashTable () {\n try {\n return new Uint32Array(hashSize);\n } catch (error) {\n var hashTable = new Array(hashSize);\n\n for (var i = 0; i < hashSize; i++) {\n hashTable[i] = 0;\n }\n\n return hashTable;\n }\n}\n\n// Clear hashtable.\nfunction clearHashTable (table) {\n for (var i = 0; i < hashSize; i++) {\n hashTable[i] = 0;\n }\n}\n\n// Makes a byte buffer. On older browsers, may return a plain array.\nfunction makeBuffer (size) {\n try {\n return new Uint8Array(size);\n } catch (error) {\n var buf = new Array(size);\n\n for (var i = 0; i < size; i++) {\n buf[i] = 0;\n }\n\n return buf;\n }\n}\n\nfunction sliceArray (array, start, end) {\n if (typeof array.buffer !== undefined) {\n if (Uint8Array.prototype.slice) {\n return array.slice(start, end);\n } else {\n // Uint8Array#slice polyfill.\n var len = array.length;\n\n // Calculate start.\n start = start | 0;\n start = (start < 0) ? Math.max(len + start, 0) : Math.min(start, len);\n\n // Calculate end.\n end = (end === undefined) ? len : end | 0;\n end = (end < 0) ? Math.max(len + end, 0) : Math.min(end, len);\n\n // Copy into new array.\n var arraySlice = new Uint8Array(end - start);\n for (var i = start, n = 0; i < end;) {\n arraySlice[n++] = array[i++];\n }\n\n return arraySlice;\n }\n } else {\n // Assume normal array.\n return array.slice(start, end);\n }\n}\n\n// Implementation\n// --\n\n// Calculates an upper bound for lz4 compression.\nexports.compressBound = function compressBound (n) {\n return (n + (n / 255) + 16) | 0;\n};\n\n// Calculates an upper bound for lz4 decompression, by reading the data.\nexports.decompressBound = function decompressBound (src) {\n var sIndex = 0;\n\n // Read magic number\n if (util.readU32(src, sIndex) !== magicNum) {\n throw new Error('invalid magic number');\n }\n\n sIndex += 4;\n\n // Read descriptor\n var descriptor = src[sIndex++];\n\n // Check version\n if ((descriptor & fdVersionMask) !== fdVersion) {\n throw new Error('incompatible descriptor version ' + (descriptor & fdVersionMask));\n }\n\n // Read flags\n var useBlockSum = (descriptor & fdBlockChksum) !== 0;\n var useContentSize = (descriptor & fdContentSize) !== 0;\n\n // Read block size\n var bsIdx = (src[sIndex++] >> bsShift) & bsMask;\n\n if (bsMap[bsIdx] === undefined) {\n throw new Error('invalid block size ' + bsIdx);\n }\n\n var maxBlockSize = bsMap[bsIdx];\n\n // Get content size\n if (useContentSize) {\n return util.readU64(src, sIndex);\n }\n\n // Checksum\n sIndex++;\n\n // Read blocks.\n var maxSize = 0;\n while (true) {\n var blockSize = util.readU32(src, sIndex);\n sIndex += 4;\n\n if (blockSize & bsUncompressed) {\n blockSize &= ~bsUncompressed;\n maxSize += blockSize;\n } else {\n maxSize += maxBlockSize;\n }\n\n if (blockSize === 0) {\n return maxSize;\n }\n\n if (useBlockSum) {\n sIndex += 4;\n }\n\n sIndex += blockSize;\n }\n};\n\n// Creates a buffer of a given byte-size, falling back to plain arrays.\nexports.makeBuffer = makeBuffer;\n\n// Decompresses a block of Lz4.\nexports.decompressBlock = function decompressBlock (src, dst, sIndex, sLength, dIndex) {\n var mLength, mOffset, sEnd, n, i;\n\n // Setup initial state.\n sEnd = sIndex + sLength;\n\n // Consume entire input block.\n while (sIndex < sEnd) {\n var token = src[sIndex++];\n\n // Copy literals.\n var literalCount = (token >> 4);\n if (literalCount > 0) {\n // Parse length.\n if (literalCount === 0xf) {\n while (true) {\n literalCount += src[sIndex];\n if (src[sIndex++] !== 0xff) {\n break;\n }\n }\n }\n\n // Copy literals\n for (n = sIndex + literalCount; sIndex < n;) {\n dst[dIndex++] = src[sIndex++];\n }\n }\n\n if (sIndex >= sEnd) {\n break;\n }\n\n // Copy match.\n mLength = (token & 0xf);\n\n // Parse offset.\n mOffset = src[sIndex++] | (src[sIndex++] << 8);\n\n // Parse length.\n if (mLength === 0xf) {\n while (true) {\n mLength += src[sIndex];\n if (src[sIndex++] !== 0xff) {\n break;\n }\n }\n }\n\n mLength += minMatch;\n\n // Copy match.\n for (i = dIndex - mOffset, n = i + mLength; i < n;) {\n dst[dIndex++] = dst[i++] | 0;\n }\n }\n\n return dIndex;\n};\n\n// Compresses a block with Lz4.\nexports.compressBlock = function compressBlock (src, dst, sIndex, sLength, hashTable) {\n var mIndex, mAnchor, mLength, mOffset, mStep;\n var literalCount, dIndex, sEnd, n;\n\n // Setup initial state.\n dIndex = 0;\n sEnd = sLength + sIndex;\n mAnchor = sIndex;\n\n // Process only if block is large enough.\n if (sLength >= minLength) {\n var searchMatchCount = (1 << skipTrigger) + 3;\n\n // Consume until last n literals (Lz4 spec limitation.)\n while (sIndex + minMatch < sEnd - searchLimit) {\n var seq = util.readU32(src, sIndex);\n var hash = util.hashU32(seq) >>> 0;\n\n // Crush hash to 16 bits.\n hash = ((hash >> 16) ^ hash) >>> 0 & 0xffff;\n\n // Look for a match in the hashtable. NOTE: remove one; see below.\n mIndex = hashTable[hash] - 1;\n\n // Put pos in hash table. NOTE: add one so that zero = invalid.\n hashTable[hash] = sIndex + 1;\n\n // Determine if there is a match (within range.)\n if (mIndex < 0 || ((sIndex - mIndex) >>> 16) > 0 || util.readU32(src, mIndex) !== seq) {\n mStep = searchMatchCount++ >> skipTrigger;\n sIndex += mStep;\n continue;\n }\n\n searchMatchCount = (1 << skipTrigger) + 3;\n\n // Calculate literal count and offset.\n literalCount = sIndex - mAnchor;\n mOffset = sIndex - mIndex;\n\n // We've already matched one word, so get that out of the way.\n sIndex += minMatch;\n mIndex += minMatch;\n\n // Determine match length.\n // N.B.: mLength does not include minMatch, Lz4 adds it back\n // in decoding.\n mLength = sIndex;\n while (sIndex < sEnd - searchLimit && src[sIndex] === src[mIndex]) {\n sIndex++;\n mIndex++;\n }\n mLength = sIndex - mLength;\n\n // Write token + literal count.\n var token = mLength < mlMask ? mLength : mlMask;\n if (literalCount >= runMask) {\n dst[dIndex++] = (runMask << mlBits) + token;\n for (n = literalCount - runMask; n >= 0xff; n -= 0xff) {\n dst[dIndex++] = 0xff;\n }\n dst[dIndex++] = n;\n } else {\n dst[dIndex++] = (literalCount << mlBits) + token;\n }\n\n // Write literals.\n for (var i = 0; i < literalCount; i++) {\n dst[dIndex++] = src[mAnchor + i];\n }\n\n // Write offset.\n dst[dIndex++] = mOffset;\n dst[dIndex++] = (mOffset >> 8);\n\n // Write match length.\n if (mLength >= mlMask) {\n for (n = mLength - mlMask; n >= 0xff; n -= 0xff) {\n dst[dIndex++] = 0xff;\n }\n dst[dIndex++] = n;\n }\n\n // Move the anchor.\n mAnchor = sIndex;\n }\n }\n\n // Nothing was encoded.\n if (mAnchor === 0) {\n return 0;\n }\n\n // Write remaining literals.\n // Write literal token+count.\n literalCount = sEnd - mAnchor;\n if (literalCount >= runMask) {\n dst[dIndex++] = (runMask << mlBits);\n for (n = literalCount - runMask; n >= 0xff; n -= 0xff) {\n dst[dIndex++] = 0xff;\n }\n dst[dIndex++] = n;\n } else {\n dst[dIndex++] = (literalCount << mlBits);\n }\n\n // Write literals.\n sIndex = mAnchor;\n while (sIndex < sEnd) {\n dst[dIndex++] = src[sIndex++];\n }\n\n return dIndex;\n};\n\n// Decompresses a frame of Lz4 data.\nexports.decompressFrame = function decompressFrame (src, dst) {\n var useBlockSum, useContentSum, useContentSize, descriptor;\n var sIndex = 0;\n var dIndex = 0;\n\n // Read magic number\n if (util.readU32(src, sIndex) !== magicNum) {\n throw new Error('invalid magic number');\n }\n\n sIndex += 4;\n\n // Read descriptor\n descriptor = src[sIndex++];\n\n // Check version\n if ((descriptor & fdVersionMask) !== fdVersion) {\n throw new Error('incompatible descriptor version');\n }\n\n // Read flags\n useBlockSum = (descriptor & fdBlockChksum) !== 0;\n useContentSum = (descriptor & fdContentChksum) !== 0;\n useContentSize = (descriptor & fdContentSize) !== 0;\n\n // Read block size\n var bsIdx = (src[sIndex++] >> bsShift) & bsMask;\n\n if (bsMap[bsIdx] === undefined) {\n throw new Error('invalid block size');\n }\n\n if (useContentSize) {\n // TODO: read content size\n sIndex += 8;\n }\n\n sIndex++;\n\n // Read blocks.\n while (true) {\n var compSize;\n\n compSize = util.readU32(src, sIndex);\n sIndex += 4;\n\n if (compSize === 0) {\n break;\n }\n\n if (useBlockSum) {\n // TODO: read block checksum\n sIndex += 4;\n }\n\n // Check if block is compressed\n if ((compSize & bsUncompressed) !== 0) {\n // Mask off the 'uncompressed' bit\n compSize &= ~bsUncompressed;\n\n // Copy uncompressed data into destination buffer.\n for (var j = 0; j < compSize; j++) {\n dst[dIndex++] = src[sIndex++];\n }\n } else {\n // Decompress into blockBuf\n dIndex = exports.decompressBlock(src, dst, sIndex, compSize, dIndex);\n sIndex += compSize;\n }\n }\n\n if (useContentSum) {\n // TODO: read content checksum\n sIndex += 4;\n }\n\n return dIndex;\n};\n\n// Compresses data to an Lz4 frame.\nexports.compressFrame = function compressFrame (src, dst) {\n var dIndex = 0;\n\n // Write magic number.\n util.writeU32(dst, dIndex, magicNum);\n dIndex += 4;\n\n // Descriptor flags.\n dst[dIndex++] = fdVersion;\n dst[dIndex++] = bsDefault << bsShift;\n\n // Descriptor checksum.\n dst[dIndex] = xxhash.hash(0, dst, 4, dIndex - 4) >> 8;\n dIndex++;\n\n // Write blocks.\n var maxBlockSize = bsMap[bsDefault];\n var remaining = src.length;\n var sIndex = 0;\n\n // Clear the hashtable.\n clearHashTable(hashTable);\n\n // Split input into blocks and write.\n while (remaining > 0) {\n var compSize = 0;\n var blockSize = remaining > maxBlockSize ? maxBlockSize : remaining;\n\n compSize = exports.compressBlock(src, blockBuf, sIndex, blockSize, hashTable);\n\n if (compSize > blockSize || compSize === 0) {\n // Output uncompressed.\n util.writeU32(dst, dIndex, 0x80000000 | blockSize);\n dIndex += 4;\n\n for (var z = sIndex + blockSize; sIndex < z;) {\n dst[dIndex++] = src[sIndex++];\n }\n\n remaining -= blockSize;\n } else {\n // Output compressed.\n util.writeU32(dst, dIndex, compSize);\n dIndex += 4;\n\n for (var j = 0; j < compSize;) {\n dst[dIndex++] = blockBuf[j++];\n }\n\n sIndex += blockSize;\n remaining -= blockSize;\n }\n }\n\n // Write blank end block.\n util.writeU32(dst, dIndex, 0);\n dIndex += 4;\n\n return dIndex;\n};\n\n// Decompresses a buffer containing an Lz4 frame. maxSize is optional; if not\n// provided, a maximum size will be determined by examining the data. The\n// buffer returned will always be perfectly-sized.\nexports.decompress = function decompress (src, maxSize) {\n var dst, size;\n\n if (maxSize === undefined) {\n maxSize = exports.decompressBound(src);\n }\n\n dst = exports.makeBuffer(maxSize);\n size = exports.decompressFrame(src, dst);\n\n if (size !== maxSize) {\n dst = sliceArray(dst, 0, size);\n }\n\n return dst;\n};\n\n// Compresses a buffer to an Lz4 frame. maxSize is optional; if not provided,\n// a buffer will be created based on the theoretical worst output size for a\n// given input size. The buffer returned will always be perfectly-sized.\nexports.compress = function compress (src, maxSize) {\n var dst, size;\n\n if (maxSize === undefined) {\n maxSize = exports.compressBound(src.length);\n }\n\n dst = exports.makeBuffer(maxSize);\n size = exports.compressFrame(src, dst);\n\n if (size !== maxSize) {\n dst = sliceArray(dst, 0, size);\n }\n\n return dst;\n};\n","// Simple hash function, from: http://burtleburtle.net/bob/hash/integer.html.\n// Chosen because it doesn't use multiply and achieves full avalanche.\nexports.hashU32 = function hashU32 (a) {\n a = a | 0;\n a = a + 2127912214 + (a << 12) | 0;\n a = a ^ -949894596 ^ a >>> 19;\n a = a + 374761393 + (a << 5) | 0;\n a = a + -744332180 ^ a << 9;\n a = a + -42973499 + (a << 3) | 0;\n return a ^ -1252372727 ^ a >>> 16 | 0;\n};\n\n// Reads a 64-bit little-endian integer from an array.\nexports.readU64 = function readU64 (b, n) {\n var x = 0;\n x |= b[n++] << 0;\n x |= b[n++] << 8;\n x |= b[n++] << 16;\n x |= b[n++] << 24;\n x |= b[n++] << 32;\n x |= b[n++] << 40;\n x |= b[n++] << 48;\n x |= b[n++] << 56;\n return x;\n};\n\n// Reads a 32-bit little-endian integer from an array.\nexports.readU32 = function readU32 (b, n) {\n var x = 0;\n x |= b[n++] << 0;\n x |= b[n++] << 8;\n x |= b[n++] << 16;\n x |= b[n++] << 24;\n return x;\n};\n\n// Writes a 32-bit little-endian integer from an array.\nexports.writeU32 = function writeU32 (b, n, x) {\n b[n++] = (x >> 0) & 0xff;\n b[n++] = (x >> 8) & 0xff;\n b[n++] = (x >> 16) & 0xff;\n b[n++] = (x >> 24) & 0xff;\n};\n\n// Multiplies two numbers using 32-bit integer multiplication.\n// Algorithm from Emscripten.\nexports.imul = function imul (a, b) {\n var ah = a >>> 16;\n var al = a & 65535;\n var bh = b >>> 16;\n var bl = b & 65535;\n\n return al * bl + (ah * bl + al * bh << 16) | 0;\n};\n","// xxh32.js - implementation of xxhash32 in plain JavaScript\nvar util = require('./util.js');\n\n// xxhash32 primes\nvar prime1 = 0x9e3779b1;\nvar prime2 = 0x85ebca77;\nvar prime3 = 0xc2b2ae3d;\nvar prime4 = 0x27d4eb2f;\nvar prime5 = 0x165667b1;\n\n// Utility functions/primitives\n// --\n\nfunction rotl32 (x, r) {\n x = x | 0;\n r = r | 0;\n\n return x >>> (32 - r | 0) | x << r | 0;\n}\n\nfunction rotmul32 (h, r, m) {\n h = h | 0;\n r = r | 0;\n m = m | 0;\n\n return util.imul(h >>> (32 - r | 0) | h << r, m) | 0;\n}\n\nfunction shiftxor32 (h, s) {\n h = h | 0;\n s = s | 0;\n\n return h >>> s ^ h | 0;\n}\n\n// Implementation\n// --\n\nfunction xxhapply (h, src, m0, s, m1) {\n return rotmul32(util.imul(src, m0) + h, s, m1);\n}\n\nfunction xxh1 (h, src, index) {\n return rotmul32((h + util.imul(src[index], prime5)), 11, prime1);\n}\n\nfunction xxh4 (h, src, index) {\n return xxhapply(h, util.readU32(src, index), prime3, 17, prime4);\n}\n\nfunction xxh16 (h, src, index) {\n return [\n xxhapply(h[0], util.readU32(src, index + 0), prime2, 13, prime1),\n xxhapply(h[1], util.readU32(src, index + 4), prime2, 13, prime1),\n xxhapply(h[2], util.readU32(src, index + 8), prime2, 13, prime1),\n xxhapply(h[3], util.readU32(src, index + 12), prime2, 13, prime1)\n ];\n}\n\nfunction xxh32 (seed, src, index, len) {\n var h, l;\n l = len;\n if (len >= 16) {\n h = [\n seed + prime1 + prime2,\n seed + prime2,\n seed,\n seed - prime1\n ];\n\n while (len >= 16) {\n h = xxh16(h, src, index);\n\n index += 16;\n len -= 16;\n }\n\n h = rotl32(h[0], 1) + rotl32(h[1], 7) + rotl32(h[2], 12) + rotl32(h[3], 18) + l;\n } else {\n h = (seed + prime5 + len) >>> 0;\n }\n\n while (len >= 4) {\n h = xxh4(h, src, index);\n\n index += 4;\n len -= 4;\n }\n\n while (len > 0) {\n h = xxh1(h, src, index);\n\n index++;\n len--;\n }\n\n h = shiftxor32(util.imul(shiftxor32(util.imul(shiftxor32(h, 15), prime2), 13), prime3), 16);\n\n return h >>> 0;\n}\n\nexports.hash = xxh32;\n","\"use strict\"\n\nvar dup = require(\"dup\")\nvar cwise = require(\"cwise\")\n\nvar do_unpack = cwise({ \n args: [\"array\", \"scalar\", \"index\"],\n body: function unpackCwise(arr, a, idx) {\n var v = a, i\n for(i=0;iMath.abs(this.stride[1]))?[1,0]:[0,1]}})\")\n } else if(dimension === 3) {\n code.push(\n\"var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);\\\nif(s0>s1){\\\nif(s1>s2){\\\nreturn [2,1,0];\\\n}else if(s0>s2){\\\nreturn [1,2,0];\\\n}else{\\\nreturn [1,0,2];\\\n}\\\n}else if(s0>s2){\\\nreturn [2,0,1];\\\n}else if(s2>s1){\\\nreturn [0,1,2];\\\n}else{\\\nreturn [0,2,1];\\\n}}})\")\n }\n } else {\n code.push(\"ORDER})\")\n }\n }\n\n //view.set(i0, ..., v):\n code.push(\n\"proto.set=function \"+className+\"_set(\"+args.join(\",\")+\",v){\")\n if(useGetters) {\n code.push(\"return this.data.set(\"+index_str+\",v)}\")\n } else {\n code.push(\"return this.data[\"+index_str+\"]=v}\")\n }\n\n //view.get(i0, ...):\n code.push(\"proto.get=function \"+className+\"_get(\"+args.join(\",\")+\"){\")\n if(useGetters) {\n code.push(\"return this.data.get(\"+index_str+\")}\")\n } else {\n code.push(\"return this.data[\"+index_str+\"]}\")\n }\n\n //view.index:\n code.push(\n \"proto.index=function \"+className+\"_index(\", args.join(), \"){return \"+index_str+\"}\")\n\n //view.hi():\n code.push(\"proto.hi=function \"+className+\"_hi(\"+args.join(\",\")+\"){return new \"+className+\"(this.data,\"+\n indices.map(function(i) {\n return [\"(typeof i\",i,\"!=='number'||i\",i,\"<0)?this.shape[\", i, \"]:i\", i,\"|0\"].join(\"\")\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"this.stride[\"+i + \"]\"\n }).join(\",\")+\",this.offset)}\")\n\n //view.lo():\n var a_vars = indices.map(function(i) { return \"a\"+i+\"=this.shape[\"+i+\"]\" })\n var c_vars = indices.map(function(i) { return \"c\"+i+\"=this.stride[\"+i+\"]\" })\n code.push(\"proto.lo=function \"+className+\"_lo(\"+args.join(\",\")+\"){var b=this.offset,d=0,\"+a_vars.join(\",\")+\",\"+c_vars.join(\",\"))\n for(var i=0; i=0){\\\nd=i\"+i+\"|0;\\\nb+=c\"+i+\"*d;\\\na\"+i+\"-=d}\")\n }\n code.push(\"return new \"+className+\"(this.data,\"+\n indices.map(function(i) {\n return \"a\"+i\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"c\"+i\n }).join(\",\")+\",b)}\")\n\n //view.step():\n code.push(\"proto.step=function \"+className+\"_step(\"+args.join(\",\")+\"){var \"+\n indices.map(function(i) {\n return \"a\"+i+\"=this.shape[\"+i+\"]\"\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"b\"+i+\"=this.stride[\"+i+\"]\"\n }).join(\",\")+\",c=this.offset,d=0,ceil=Math.ceil\")\n for(var i=0; i=0){c=(c+this.stride[\"+i+\"]*i\"+i+\")|0}else{a.push(this.shape[\"+i+\"]);b.push(this.stride[\"+i+\"])}\")\n }\n code.push(\"var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}\")\n\n //Add return statement\n code.push(\"return function construct_\"+className+\"(data,shape,stride,offset){return new \"+className+\"(data,\"+\n indices.map(function(i) {\n return \"shape[\"+i+\"]\"\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"stride[\"+i+\"]\"\n }).join(\",\")+\",offset)}\")\n\n //Compile procedure\n var procedure = new Function(\"CTOR_LIST\", \"ORDER\", code.join(\"\\n\"))\n return procedure(CACHED_CONSTRUCTORS[dtype], order)\n}\n\nfunction arrayDType(data) {\n if(isBuffer(data)) {\n return \"buffer\"\n }\n if(hasTypedArrays) {\n switch(Object.prototype.toString.call(data)) {\n case \"[object Float64Array]\":\n return \"float64\"\n case \"[object Float32Array]\":\n return \"float32\"\n case \"[object Int8Array]\":\n return \"int8\"\n case \"[object Int16Array]\":\n return \"int16\"\n case \"[object Int32Array]\":\n return \"int32\"\n case \"[object Uint8Array]\":\n return \"uint8\"\n case \"[object Uint16Array]\":\n return \"uint16\"\n case \"[object Uint32Array]\":\n return \"uint32\"\n case \"[object Uint8ClampedArray]\":\n return \"uint8_clamped\"\n case \"[object BigInt64Array]\":\n return \"bigint64\"\n case \"[object BigUint64Array]\":\n return \"biguint64\"\n }\n }\n if(Array.isArray(data)) {\n return \"array\"\n }\n return \"generic\"\n}\n\nvar CACHED_CONSTRUCTORS = {\n \"float32\":[],\n \"float64\":[],\n \"int8\":[],\n \"int16\":[],\n \"int32\":[],\n \"uint8\":[],\n \"uint16\":[],\n \"uint32\":[],\n \"array\":[],\n \"uint8_clamped\":[],\n \"bigint64\": [],\n \"biguint64\": [],\n \"buffer\":[],\n \"generic\":[]\n}\n\n;(function() {\n for(var id in CACHED_CONSTRUCTORS) {\n CACHED_CONSTRUCTORS[id].push(compileConstructor(id, -1))\n }\n});\n\nfunction wrappedNDArrayCtor(data, shape, stride, offset) {\n if(data === undefined) {\n var ctor = CACHED_CONSTRUCTORS.array[0]\n return ctor([])\n } else if(typeof data === \"number\") {\n data = [data]\n }\n if(shape === undefined) {\n shape = [ data.length ]\n }\n var d = shape.length\n if(stride === undefined) {\n stride = new Array(d)\n for(var i=d-1, sz=1; i>=0; --i) {\n stride[i] = sz\n sz *= shape[i]\n }\n }\n if(offset === undefined) {\n offset = 0\n for(var i=0; i Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param).\n **/\n\n/**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n **/\n\n/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\n\n/**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw deflate\n * - `gzip` (Boolean) - create gzip wrapper\n * - `header` (Object) - custom header for gzip\n * - `text` (Boolean) - true if compressed data believed to be text\n * - `time` (Number) - modification time, unix timestamp\n * - `os` (Number) - operation system code\n * - `extra` (Array) - array of bytes with extra data (max 65536)\n * - `name` (String) - file name (binary string)\n * - `comment` (String) - comment (binary string)\n * - `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * , chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true); // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n **/\nfunction Deflate(options) {\n this.options = utils.assign({\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY\n }, options || {});\n\n let opt = this.options;\n\n if (opt.raw && (opt.windowBits > 0)) {\n opt.windowBits = -opt.windowBits;\n }\n\n else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n opt.windowBits += 16;\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n let status = zlib_deflate.deflateInit2(\n this.strm,\n opt.level,\n opt.method,\n opt.windowBits,\n opt.memLevel,\n opt.strategy\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n if (opt.header) {\n zlib_deflate.deflateSetHeader(this.strm, opt.header);\n }\n\n if (opt.dictionary) {\n let dict;\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n // If we need to compress text, change encoding to utf8.\n dict = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(opt.dictionary);\n } else {\n dict = opt.dictionary;\n }\n\n status = zlib_deflate.deflateSetDictionary(this.strm, dict);\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this._dict_set = true;\n }\n}\n\n/**\n * Deflate#push(data[, flush_mode]) -> Boolean\n * - data (Uint8Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with\n * new compressed chunks. Returns `true` on success. The last data block must\n * have `flush_mode` Z_FINISH (or `true`). That will flush internal pending\n * buffers and call [[Deflate#onEnd]].\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nDeflate.prototype.push = function (data, flush_mode) {\n const strm = this.strm;\n const chunkSize = this.options.chunkSize;\n let status, _flush_mode;\n\n if (this.ended) { return false; }\n\n if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;\n else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH;\n\n // Convert data if needed\n if (typeof data === 'string') {\n // If we need to compress text, change encoding to utf8.\n strm.input = strings.string2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n for (;;) {\n if (strm.avail_out === 0) {\n strm.output = new Uint8Array(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n // Make sure avail_out > 6 to avoid repeating markers\n if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH) && strm.avail_out <= 6) {\n this.onData(strm.output.subarray(0, strm.next_out));\n strm.avail_out = 0;\n continue;\n }\n\n status = zlib_deflate.deflate(strm, _flush_mode);\n\n // Ended => flush and finish\n if (status === Z_STREAM_END) {\n if (strm.next_out > 0) {\n this.onData(strm.output.subarray(0, strm.next_out));\n }\n status = zlib_deflate.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK;\n }\n\n // Flush if out buffer full\n if (strm.avail_out === 0) {\n this.onData(strm.output);\n continue;\n }\n\n // Flush if requested and has data\n if (_flush_mode > 0 && strm.next_out > 0) {\n this.onData(strm.output.subarray(0, strm.next_out));\n strm.avail_out = 0;\n continue;\n }\n\n if (strm.avail_in === 0) break;\n }\n\n return true;\n};\n\n\n/**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array): output data.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nDeflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Deflate#onEnd(status) -> Void\n * - status (Number): deflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called once after you tell deflate that the input stream is\n * complete (Z_FINISH). By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nDeflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n this.result = utils.flattenChunks(this.chunks);\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * deflate(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\n *\n * - level\n * - windowBits\n * - memLevel\n * - strategy\n * - dictionary\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * const data = new Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate(input, options) {\n const deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}\n\n\nmodule.exports.Deflate = Deflate;\nmodule.exports.deflate = deflate;\nmodule.exports.deflateRaw = deflateRaw;\nmodule.exports.gzip = gzip;\nmodule.exports.constants = require('./zlib/constants');\n","'use strict';\n\n\nconst zlib_inflate = require('./zlib/inflate');\nconst utils = require('./utils/common');\nconst strings = require('./utils/strings');\nconst msg = require('./zlib/messages');\nconst ZStream = require('./zlib/zstream');\nconst GZheader = require('./zlib/gzheader');\n\nconst toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH, Z_FINISH,\n Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR\n} = require('./zlib/constants');\n\n/* ===========================================================================*/\n\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * const chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * const chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate(options) {\n this.options = utils.assign({\n chunkSize: 1024 * 64,\n windowBits: 15,\n to: ''\n }, options || {});\n\n const opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n let status = zlib_inflate.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this.header = new GZheader();\n\n zlib_inflate.inflateGetHeader(this.strm, this.header);\n\n // Setup dictionary\n if (opt.dictionary) {\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n opt.dictionary = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n opt.dictionary = new Uint8Array(opt.dictionary);\n }\n if (opt.raw) { //In raw mode we need to set the dictionary early\n status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n }\n }\n}\n\n/**\n * Inflate#push(data[, flush_mode]) -> Boolean\n * - data (Uint8Array|ArrayBuffer): input data\n * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE\n * flush modes. See constants. Skipped or `false` means Z_NO_FLUSH,\n * `true` means Z_FINISH.\n *\n * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. If end of stream detected,\n * [[Inflate#onEnd]] will be called.\n *\n * `flush_mode` is not needed for normal operation, because end of stream\n * detected automatically. You may try to use it for advanced things, but\n * this functionality was not tested.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nInflate.prototype.push = function (data, flush_mode) {\n const strm = this.strm;\n const chunkSize = this.options.chunkSize;\n const dictionary = this.options.dictionary;\n let status, _flush_mode, last_avail_out;\n\n if (this.ended) return false;\n\n if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;\n else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH;\n\n // Convert data if needed\n if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n for (;;) {\n if (strm.avail_out === 0) {\n strm.output = new Uint8Array(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = zlib_inflate.inflate(strm, _flush_mode);\n\n if (status === Z_NEED_DICT && dictionary) {\n status = zlib_inflate.inflateSetDictionary(strm, dictionary);\n\n if (status === Z_OK) {\n status = zlib_inflate.inflate(strm, _flush_mode);\n } else if (status === Z_DATA_ERROR) {\n // Replace code with more verbose\n status = Z_NEED_DICT;\n }\n }\n\n // Skip snyc markers if more data follows and not raw mode\n while (strm.avail_in > 0 &&\n status === Z_STREAM_END &&\n strm.state.wrap > 0 &&\n data[strm.next_in] !== 0)\n {\n zlib_inflate.inflateReset(strm);\n status = zlib_inflate.inflate(strm, _flush_mode);\n }\n\n switch (status) {\n case Z_STREAM_ERROR:\n case Z_DATA_ERROR:\n case Z_NEED_DICT:\n case Z_MEM_ERROR:\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n // Remember real `avail_out` value, because we may patch out buffer content\n // to align utf8 strings boundaries.\n last_avail_out = strm.avail_out;\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === Z_STREAM_END) {\n\n if (this.options.to === 'string') {\n\n let next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n let tail = strm.next_out - next_out_utf8;\n let utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail & realign counters\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) strm.output.set(strm.output.subarray(next_out_utf8, next_out_utf8 + tail), 0);\n\n this.onData(utf8str);\n\n } else {\n this.onData(strm.output.length === strm.next_out ? strm.output : strm.output.subarray(0, strm.next_out));\n }\n }\n }\n\n // Must repeat iteration if out buffer is full\n if (status === Z_OK && last_avail_out === 0) continue;\n\n // Finalize if end of stream reached.\n if (status === Z_STREAM_END) {\n status = zlib_inflate.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return true;\n }\n\n if (strm.avail_in === 0) break;\n }\n\n return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|String): output data. When string output requested,\n * each chunk will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nInflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH). By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako');\n * const input = pako.deflate(new Uint8Array([1,2,3,4,5,6,7,8,9]));\n * let output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err) {\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate(input, options) {\n const inflator = new Inflate(options);\n\n inflator.push(input);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) throw inflator.msg || msg[inflator.err];\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nmodule.exports.Inflate = Inflate;\nmodule.exports.inflate = inflate;\nmodule.exports.inflateRaw = inflateRaw;\nmodule.exports.ungzip = inflate;\nmodule.exports.constants = require('./zlib/constants');\n","'use strict';\n\n\nconst _has = (obj, key) => {\n return Object.prototype.hasOwnProperty.call(obj, key);\n};\n\nmodule.exports.assign = function (obj /*from1, from2, from3, ...*/) {\n const sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n const source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (const p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// Join array of chunks to single array.\nmodule.exports.flattenChunks = (chunks) => {\n // calculate data length\n let len = 0;\n\n for (let i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n const result = new Uint8Array(len);\n\n for (let i = 0, pos = 0, l = chunks.length; i < l; i++) {\n let chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n};\n","// String encode/decode helpers\n'use strict';\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nlet STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nconst _utf8len = new Uint8Array(256);\nfor (let q = 0; q < 256; q++) {\n _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nmodule.exports.string2buf = (str) => {\n if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) {\n return new TextEncoder().encode(str);\n }\n\n let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n buf = new Uint8Array(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n};\n\n// Helper\nconst buf2binstring = (buf, len) => {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if (buf.subarray && STR_APPLY_UIA_OK) {\n return String.fromCharCode.apply(null, buf.length === len ? buf : buf.subarray(0, len));\n }\n }\n\n let result = '';\n for (let i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n};\n\n\n// convert array to string\nmodule.exports.buf2string = (buf, max) => {\n const len = max || buf.length;\n\n if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) {\n return new TextDecoder().decode(buf.subarray(0, max));\n }\n\n let i, out;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n const utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n let c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n let c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nmodule.exports.utf8border = (buf, max) => {\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n let pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n","'use strict';\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst adler32 = (adler, buf, len, pos) => {\n let s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n};\n\n\nmodule.exports = adler32;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n","'use strict';\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nconst makeTable = () => {\n let c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n};\n\n// Create table on load. Just 255 signed longs. Not a problem.\nconst crcTable = new Uint32Array(makeTable());\n\n\nconst crc32 = (crc, buf, len, pos) => {\n const t = crcTable;\n const end = pos + len;\n\n crc ^= -1;\n\n for (let i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n};\n\n\nmodule.exports = crc32;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst { _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align } = require('./trees');\nconst adler32 = require('./adler32');\nconst crc32 = require('./crc32');\nconst msg = require('./messages');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH, Z_PARTIAL_FLUSH, Z_FULL_FLUSH, Z_FINISH, Z_BLOCK,\n Z_OK, Z_STREAM_END, Z_STREAM_ERROR, Z_DATA_ERROR, Z_BUF_ERROR,\n Z_DEFAULT_COMPRESSION,\n Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED, Z_DEFAULT_STRATEGY,\n Z_UNKNOWN,\n Z_DEFLATED\n} = require('./constants');\n\n/*============================================================================*/\n\n\nconst MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nconst MAX_WBITS = 15;\n/* 32K LZ77 window */\nconst DEF_MEM_LEVEL = 8;\n\n\nconst LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nconst LITERALS = 256;\n/* number of literal bytes 0..255 */\nconst L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nconst D_CODES = 30;\n/* number of distance codes */\nconst BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nconst HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nconst MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\nconst MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nconst PRESET_DICT = 0x20;\n\nconst INIT_STATE = 42; /* zlib header -> BUSY_STATE */\n//#ifdef GZIP\nconst GZIP_STATE = 57; /* gzip header -> BUSY_STATE | EXTRA_STATE */\n//#endif\nconst EXTRA_STATE = 69; /* gzip extra block -> NAME_STATE */\nconst NAME_STATE = 73; /* gzip file name -> COMMENT_STATE */\nconst COMMENT_STATE = 91; /* gzip comment -> HCRC_STATE */\nconst HCRC_STATE = 103; /* gzip header CRC -> BUSY_STATE */\nconst BUSY_STATE = 113; /* deflate -> FINISH_STATE */\nconst FINISH_STATE = 666; /* stream complete */\n\nconst BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nconst BS_BLOCK_DONE = 2; /* block flush performed */\nconst BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nconst BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nconst OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nconst err = (strm, errorCode) => {\n strm.msg = msg[errorCode];\n return errorCode;\n};\n\nconst rank = (f) => {\n return ((f) * 2) - ((f) > 4 ? 9 : 0);\n};\n\nconst zero = (buf) => {\n let len = buf.length; while (--len >= 0) { buf[len] = 0; }\n};\n\n/* ===========================================================================\n * Slide the hash table when sliding the window down (could be avoided with 32\n * bit values at the expense of memory usage). We slide even when level == 0 to\n * keep the hash table consistent if we switch back to level > 0 later.\n */\nconst slide_hash = (s) => {\n let n, m;\n let p;\n let wsize = s.w_size;\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= wsize ? m - wsize : 0);\n } while (--n);\n n = wsize;\n//#ifndef FASTEST\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= wsize ? m - wsize : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n//#endif\n};\n\n/* eslint-disable new-cap */\nlet HASH_ZLIB = (s, prev, data) => ((prev << s.hash_shift) ^ data) & s.hash_mask;\n// This hash causes less collisions, https://github.com/nodeca/pako/issues/135\n// But breaks binary compatibility\n//let HASH_FAST = (s, prev, data) => ((prev << 8) + (prev >> 8) + (data << 4)) & s.hash_mask;\nlet HASH = HASH_ZLIB;\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output, except for\n * some deflate_stored() output, goes through this function so some\n * applications may wish to modify it to avoid allocating a large\n * strm->next_out buffer and copying into it. (See also read_buf()).\n */\nconst flush_pending = (strm) => {\n const s = strm.state;\n\n //_tr_flush_bits(s);\n let len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n strm.output.set(s.pending_buf.subarray(s.pending_out, s.pending_out + len), strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n};\n\n\nconst flush_block_only = (s, last) => {\n _tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n};\n\n\nconst put_byte = (s, b) => {\n s.pending_buf[s.pending++] = b;\n};\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nconst putShortMSB = (s, b) => {\n\n // put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n};\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nconst read_buf = (strm, buf, start, size) => {\n\n let len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n buf.set(strm.input.subarray(strm.next_in, strm.next_in + len), start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n};\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nconst longest_match = (s, cur_match) => {\n\n let chain_length = s.max_chain_length; /* max hash chain length */\n let scan = s.strstart; /* current string */\n let match; /* matched string */\n let len; /* length of current match */\n let best_len = s.prev_length; /* best match length so far */\n let nice_match = s.nice_match; /* stop if match long enough */\n const limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n const _win = s.window; // shortcut\n\n const wmask = s.w_mask;\n const prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n const strend = s.strstart + MAX_MATCH;\n let scan_end1 = _win[scan + best_len - 1];\n let scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n};\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nconst fill_window = (s) => {\n\n const _w_size = s.w_size;\n let n, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n s.window.set(s.window.subarray(_w_size, _w_size + _w_size - more), 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n slide_hash(s);\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + 1]);\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]);\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// const curr = s.strstart + s.lookahead;\n// let init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n};\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n *\n * In case deflateParams() is used to later switch to a non-zero compression\n * level, s->matches (otherwise unused when storing) keeps track of the number\n * of hash table slides to perform. If s->matches is 1, then one hash table\n * slide will be done when switching. If s->matches is 2, the maximum value\n * allowed here, then the hash table will be cleared, since two or more slides\n * is the same as a clear.\n *\n * deflate_stored() is written to minimize the number of times an input byte is\n * copied. It is most efficient with large input and output buffers, which\n * maximizes the opportunites to have a single copy from next_in to next_out.\n */\nconst deflate_stored = (s, flush) => {\n\n /* Smallest worthy block size when not flushing or finishing. By default\n * this is 32K. This can be as small as 507 bytes for memLevel == 1. For\n * large input and output buffers, the stored block size will be larger.\n */\n let min_block = s.pending_buf_size - 5 > s.w_size ? s.w_size : s.pending_buf_size - 5;\n\n /* Copy as many min_block or larger stored blocks directly to next_out as\n * possible. If flushing, copy the remaining available input to next_out as\n * stored blocks, if there is enough space.\n */\n let len, left, have, last = 0;\n let used = s.strm.avail_in;\n do {\n /* Set len to the maximum size block that we can copy directly with the\n * available input data and output space. Set left to how much of that\n * would be copied from what's left in the window.\n */\n len = 65535/* MAX_STORED */; /* maximum deflate stored block length */\n have = (s.bi_valid + 42) >> 3; /* number of header bytes */\n if (s.strm.avail_out < have) { /* need room for header */\n break;\n }\n /* maximum stored block length that will fit in avail_out: */\n have = s.strm.avail_out - have;\n left = s.strstart - s.block_start; /* bytes left in window */\n if (len > left + s.strm.avail_in) {\n len = left + s.strm.avail_in; /* limit len to the input */\n }\n if (len > have) {\n len = have; /* limit len to the output */\n }\n\n /* If the stored block would be less than min_block in length, or if\n * unable to copy all of the available input when flushing, then try\n * copying to the window and the pending buffer instead. Also don't\n * write an empty block when flushing -- deflate() does that.\n */\n if (len < min_block && ((len === 0 && flush !== Z_FINISH) ||\n flush === Z_NO_FLUSH ||\n len !== left + s.strm.avail_in)) {\n break;\n }\n\n /* Make a dummy stored block in pending to get the header bytes,\n * including any pending bits. This also updates the debugging counts.\n */\n last = flush === Z_FINISH && len === left + s.strm.avail_in ? 1 : 0;\n _tr_stored_block(s, 0, 0, last);\n\n /* Replace the lengths in the dummy stored block with len. */\n s.pending_buf[s.pending - 4] = len;\n s.pending_buf[s.pending - 3] = len >> 8;\n s.pending_buf[s.pending - 2] = ~len;\n s.pending_buf[s.pending - 1] = ~len >> 8;\n\n /* Write the stored block header bytes. */\n flush_pending(s.strm);\n\n//#ifdef ZLIB_DEBUG\n// /* Update debugging counts for the data about to be copied. */\n// s->compressed_len += len << 3;\n// s->bits_sent += len << 3;\n//#endif\n\n /* Copy uncompressed bytes from the window to next_out. */\n if (left) {\n if (left > len) {\n left = len;\n }\n //zmemcpy(s->strm->next_out, s->window + s->block_start, left);\n s.strm.output.set(s.window.subarray(s.block_start, s.block_start + left), s.strm.next_out);\n s.strm.next_out += left;\n s.strm.avail_out -= left;\n s.strm.total_out += left;\n s.block_start += left;\n len -= left;\n }\n\n /* Copy uncompressed bytes directly from next_in to next_out, updating\n * the check value.\n */\n if (len) {\n read_buf(s.strm, s.strm.output, s.strm.next_out, len);\n s.strm.next_out += len;\n s.strm.avail_out -= len;\n s.strm.total_out += len;\n }\n } while (last === 0);\n\n /* Update the sliding window with the last s->w_size bytes of the copied\n * data, or append all of the copied data to the existing window if less\n * than s->w_size bytes were copied. Also update the number of bytes to\n * insert in the hash tables, in the event that deflateParams() switches to\n * a non-zero compression level.\n */\n used -= s.strm.avail_in; /* number of input bytes directly copied */\n if (used) {\n /* If any input was used, then no unused input remains in the window,\n * therefore s->block_start == s->strstart.\n */\n if (used >= s.w_size) { /* supplant the previous history */\n s.matches = 2; /* clear hash */\n //zmemcpy(s->window, s->strm->next_in - s->w_size, s->w_size);\n s.window.set(s.strm.input.subarray(s.strm.next_in - s.w_size, s.strm.next_in), 0);\n s.strstart = s.w_size;\n s.insert = s.strstart;\n }\n else {\n if (s.window_size - s.strstart <= used) {\n /* Slide the window down. */\n s.strstart -= s.w_size;\n //zmemcpy(s->window, s->window + s->w_size, s->strstart);\n s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0);\n if (s.matches < 2) {\n s.matches++; /* add a pending slide_hash() */\n }\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n }\n //zmemcpy(s->window + s->strstart, s->strm->next_in - used, used);\n s.window.set(s.strm.input.subarray(s.strm.next_in - used, s.strm.next_in), s.strstart);\n s.strstart += used;\n s.insert += used > s.w_size - s.insert ? s.w_size - s.insert : used;\n }\n s.block_start = s.strstart;\n }\n if (s.high_water < s.strstart) {\n s.high_water = s.strstart;\n }\n\n /* If the last block was written to next_out, then done. */\n if (last) {\n return BS_FINISH_DONE;\n }\n\n /* If flushing and all input has been consumed, then done. */\n if (flush !== Z_NO_FLUSH && flush !== Z_FINISH &&\n s.strm.avail_in === 0 && s.strstart === s.block_start) {\n return BS_BLOCK_DONE;\n }\n\n /* Fill the window with any remaining input. */\n have = s.window_size - s.strstart;\n if (s.strm.avail_in > have && s.block_start >= s.w_size) {\n /* Slide the window down. */\n s.block_start -= s.w_size;\n s.strstart -= s.w_size;\n //zmemcpy(s->window, s->window + s->w_size, s->strstart);\n s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0);\n if (s.matches < 2) {\n s.matches++; /* add a pending slide_hash() */\n }\n have += s.w_size; /* more space now */\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n }\n if (have > s.strm.avail_in) {\n have = s.strm.avail_in;\n }\n if (have) {\n read_buf(s.strm, s.window, s.strstart, have);\n s.strstart += have;\n s.insert += have > s.w_size - s.insert ? s.w_size - s.insert : have;\n }\n if (s.high_water < s.strstart) {\n s.high_water = s.strstart;\n }\n\n /* There was not enough avail_out to write a complete worthy or flushed\n * stored block to next_out. Write a stored block to pending instead, if we\n * have enough input for a worthy block, or if flushing and there is enough\n * room for the remaining input as a stored block in the pending buffer.\n */\n have = (s.bi_valid + 42) >> 3; /* number of header bytes */\n /* maximum stored block length that will fit in pending: */\n have = s.pending_buf_size - have > 65535/* MAX_STORED */ ? 65535/* MAX_STORED */ : s.pending_buf_size - have;\n min_block = have > s.w_size ? s.w_size : have;\n left = s.strstart - s.block_start;\n if (left >= min_block ||\n ((left || flush === Z_FINISH) && flush !== Z_NO_FLUSH &&\n s.strm.avail_in === 0 && left <= have)) {\n len = left > have ? have : left;\n last = flush === Z_FINISH && s.strm.avail_in === 0 &&\n len === left ? 1 : 0;\n _tr_stored_block(s, s.block_start, len, last);\n s.block_start += len;\n flush_pending(s.strm);\n }\n\n /* We've done all we can with the available input and output. */\n return last ? BS_FINISH_STARTED : BS_NEED_MORE;\n};\n\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nconst deflate_fast = (s, flush) => {\n\n let hash_head; /* head of the hash chain */\n let bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + 1]);\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nconst deflate_slow = (s, flush) => {\n\n let hash_head; /* head of hash chain */\n let bflush; /* set if current block must be flushed */\n\n let max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n};\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nconst deflate_rle = (s, flush) => {\n\n let bflush; /* set if current block must be flushed */\n let prev; /* byte at distance one to match */\n let scan, strend; /* scan goes up to strend for length of run */\n\n const _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nconst deflate_huff = (s, flush) => {\n\n let bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n break; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}\n\nconst configuration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nconst lm_init = (s) => {\n\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n};\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new Uint16Array(HEAP_SIZE * 2);\n this.dyn_dtree = new Uint16Array((2 * D_CODES + 1) * 2);\n this.bl_tree = new Uint16Array((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new Uint16Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new Uint16Array(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new Uint16Array(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.sym_buf = 0; /* buffer for distances and literals/lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.sym_next = 0; /* running index in sym_buf */\n this.sym_end = 0; /* symbol table full when sym_next reaches this */\n\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n}\n\n\n/* =========================================================================\n * Check for a valid deflate stream state. Return 0 if ok, 1 if not.\n */\nconst deflateStateCheck = (strm) => {\n\n if (!strm) {\n return 1;\n }\n const s = strm.state;\n if (!s || s.strm !== strm || (s.status !== INIT_STATE &&\n//#ifdef GZIP\n s.status !== GZIP_STATE &&\n//#endif\n s.status !== EXTRA_STATE &&\n s.status !== NAME_STATE &&\n s.status !== COMMENT_STATE &&\n s.status !== HCRC_STATE &&\n s.status !== BUSY_STATE &&\n s.status !== FINISH_STATE)) {\n return 1;\n }\n return 0;\n};\n\n\nconst deflateResetKeep = (strm) => {\n\n if (deflateStateCheck(strm)) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n const s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status =\n//#ifdef GZIP\n s.wrap === 2 ? GZIP_STATE :\n//#endif\n s.wrap ? INIT_STATE : BUSY_STATE;\n strm.adler = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = -2;\n _tr_init(s);\n return Z_OK;\n};\n\n\nconst deflateReset = (strm) => {\n\n const ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n};\n\n\nconst deflateSetHeader = (strm, head) => {\n\n if (deflateStateCheck(strm) || strm.state.wrap !== 2) {\n return Z_STREAM_ERROR;\n }\n strm.state.gzhead = head;\n return Z_OK;\n};\n\n\nconst deflateInit2 = (strm, level, method, windowBits, memLevel, strategy) => {\n\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR;\n }\n let wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED || (windowBits === 8 && wrap !== 1)) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n const s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n s.status = INIT_STATE; /* to pass state test in deflateReset() */\n\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n s.window = new Uint8Array(s.w_size * 2);\n s.head = new Uint16Array(s.hash_size);\n s.prev = new Uint16Array(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n /* We overlay pending_buf and sym_buf. This works since the average size\n * for length/distance pairs over any compressed block is assured to be 31\n * bits or less.\n *\n * Analysis: The longest fixed codes are a length code of 8 bits plus 5\n * extra bits, for lengths 131 to 257. The longest fixed distance codes are\n * 5 bits plus 13 extra bits, for distances 16385 to 32768. The longest\n * possible fixed-codes length/distance pair is then 31 bits total.\n *\n * sym_buf starts one-fourth of the way into pending_buf. So there are\n * three bytes in sym_buf for every four bytes in pending_buf. Each symbol\n * in sym_buf is three bytes -- two for the distance and one for the\n * literal/length. As each symbol is consumed, the pointer to the next\n * sym_buf value to read moves forward three bytes. From that symbol, up to\n * 31 bits are written to pending_buf. The closest the written pending_buf\n * bits gets to the next sym_buf symbol to read is just before the last\n * code is written. At that time, 31*(n-2) bits have been written, just\n * after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at\n * 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1\n * symbols are written.) The closest the writing gets to what is unread is\n * then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and\n * can range from 128 to 32768.\n *\n * Therefore, at a minimum, there are 142 bits of space between what is\n * written and what is read in the overlain buffers, so the symbols cannot\n * be overwritten by the compressed data. That space is actually 139 bits,\n * due to the three-bit fixed-code block header.\n *\n * That covers the case where either Z_FIXED is specified, forcing fixed\n * codes, or when the use of fixed codes is chosen, because that choice\n * results in a smaller compressed block than dynamic codes. That latter\n * condition then assures that the above analysis also covers all dynamic\n * blocks. A dynamic-code block will only be chosen to be emitted if it has\n * fewer bits than a fixed-code block would for the same set of symbols.\n * Therefore its average symbol length is assured to be less than 31. So\n * the compressed data for a dynamic block also cannot overwrite the\n * symbols from which it is being constructed.\n */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n s.pending_buf = new Uint8Array(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->sym_buf = s->pending_buf + s->lit_bufsize;\n s.sym_buf = s.lit_bufsize;\n\n //s->sym_end = (s->lit_bufsize - 1) * 3;\n s.sym_end = (s.lit_bufsize - 1) * 3;\n /* We avoid equality with lit_bufsize*3 because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n};\n\nconst deflateInit = (strm, level) => {\n\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n};\n\n\n/* ========================================================================= */\nconst deflate = (strm, flush) => {\n\n if (deflateStateCheck(strm) || flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n\n const s = strm.state;\n\n if (!strm.output ||\n (strm.avail_in !== 0 && !strm.input) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n\n const old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK;\n }\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* Write the header */\n if (s.status === INIT_STATE && s.wrap === 0) {\n s.status = BUSY_STATE;\n }\n if (s.status === INIT_STATE) {\n /* zlib header */\n let header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n let level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n putShortMSB(s, header);\n\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n }\n//#ifdef GZIP\n if (s.status === GZIP_STATE) {\n /* gzip header */\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) { // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n }\n else {\n put_byte(s, (s.gzhead.text ? 1 : 0) +\n (s.gzhead.hcrc ? 2 : 0) +\n (!s.gzhead.extra ? 0 : 4) +\n (!s.gzhead.name ? 0 : 8) +\n (!s.gzhead.comment ? 0 : 16)\n );\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, (s.gzhead.time >> 8) & 0xff);\n put_byte(s, (s.gzhead.time >> 16) & 0xff);\n put_byte(s, (s.gzhead.time >> 24) & 0xff);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let left = (s.gzhead.extra.length & 0xffff) - s.gzindex;\n while (s.pending + left > s.pending_buf_size) {\n let copy = s.pending_buf_size - s.pending;\n // zmemcpy(s.pending_buf + s.pending,\n // s.gzhead.extra + s.gzindex, copy);\n s.pending_buf.set(s.gzhead.extra.subarray(s.gzindex, s.gzindex + copy), s.pending);\n s.pending = s.pending_buf_size;\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex += copy;\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n beg = 0;\n left -= copy;\n }\n // JS specific: s.gzhead.extra may be TypedArray or Array for backward compatibility\n // TypedArray.slice and TypedArray.from don't exist in IE10-IE11\n let gzhead_extra = new Uint8Array(s.gzhead.extra);\n // zmemcpy(s->pending_buf + s->pending,\n // s->gzhead->extra + s->gzindex, left);\n s.pending_buf.set(gzhead_extra.subarray(s.gzindex, s.gzindex + left), s.pending);\n s.pending += left;\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex = 0;\n }\n s.status = NAME_STATE;\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let val;\n do {\n if (s.pending === s.pending_buf_size) {\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n beg = 0;\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex = 0;\n }\n s.status = COMMENT_STATE;\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let val;\n do {\n if (s.pending === s.pending_buf_size) {\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n beg = 0;\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n }\n s.status = HCRC_STATE;\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n }\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n }\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n }\n//#endif\n\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n let bstate = s.level === 0 ? deflate_stored(s, flush) :\n s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :\n s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush);\n\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n _tr_align(s);\n }\n else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n _tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH) {\n /*** CLEAR_HASH(s); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n }\n\n if (flush !== Z_FINISH) { return Z_OK; }\n if (s.wrap <= 0) { return Z_STREAM_END; }\n\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n put_byte(s, (strm.adler >> 16) & 0xff);\n put_byte(s, (strm.adler >> 24) & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, (strm.total_in >> 8) & 0xff);\n put_byte(s, (strm.total_in >> 16) & 0xff);\n put_byte(s, (strm.total_in >> 24) & 0xff);\n }\n else\n {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n};\n\n\nconst deflateEnd = (strm) => {\n\n if (deflateStateCheck(strm)) {\n return Z_STREAM_ERROR;\n }\n\n const status = strm.state.status;\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n};\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nconst deflateSetDictionary = (strm, dictionary) => {\n\n let dictLength = dictionary.length;\n\n if (deflateStateCheck(strm)) {\n return Z_STREAM_ERROR;\n }\n\n const s = strm.state;\n const wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR;\n }\n\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n let tmpDict = new Uint8Array(s.w_size);\n tmpDict.set(dictionary.subarray(dictLength - s.w_size, dictLength), 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n const avail = strm.avail_in;\n const next = strm.next_in;\n const input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n let str = s.strstart;\n let n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]);\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK;\n};\n\n\nmodule.exports.deflateInit = deflateInit;\nmodule.exports.deflateInit2 = deflateInit2;\nmodule.exports.deflateReset = deflateReset;\nmodule.exports.deflateResetKeep = deflateResetKeep;\nmodule.exports.deflateSetHeader = deflateSetHeader;\nmodule.exports.deflate = deflate;\nmodule.exports.deflateEnd = deflateEnd;\nmodule.exports.deflateSetDictionary = deflateSetDictionary;\nmodule.exports.deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nmodule.exports.deflateBound = deflateBound;\nmodule.exports.deflateCopy = deflateCopy;\nmodule.exports.deflateGetDictionary = deflateGetDictionary;\nmodule.exports.deflateParams = deflateParams;\nmodule.exports.deflatePending = deflatePending;\nmodule.exports.deflatePrime = deflatePrime;\nmodule.exports.deflateTune = deflateTune;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nmodule.exports = GZheader;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nconst BAD = 16209; /* got a data error -- remain here until reset */\nconst TYPE = 16191; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n let _in; /* local strm.input */\n let last; /* have enough input while in < last */\n let _out; /* local strm.output */\n let beg; /* inflate()'s initial strm.output */\n let end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n let dmax; /* maximum distance from zlib header */\n//#endif\n let wsize; /* window size or zero if not using window */\n let whave; /* valid bytes in the window */\n let wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n let s_window; /* allocated sliding window, if wsize != 0 */\n let hold; /* local strm.hold */\n let bits; /* local strm.bits */\n let lcode; /* local strm.lencode */\n let dcode; /* local strm.distcode */\n let lmask; /* mask for first level of length codes */\n let dmask; /* mask for first level of distance codes */\n let here; /* retrieved table entry */\n let op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n let len; /* match length, unused bytes */\n let dist; /* match distance */\n let from; /* where to copy match from */\n let from_source;\n\n\n let input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n const state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst adler32 = require('./adler32');\nconst crc32 = require('./crc32');\nconst inflate_fast = require('./inffast');\nconst inflate_table = require('./inftrees');\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_FINISH, Z_BLOCK, Z_TREES,\n Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR, Z_BUF_ERROR,\n Z_DEFLATED\n} = require('./constants');\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nconst HEAD = 16180; /* i: waiting for magic header */\nconst FLAGS = 16181; /* i: waiting for method and flags (gzip) */\nconst TIME = 16182; /* i: waiting for modification time (gzip) */\nconst OS = 16183; /* i: waiting for extra flags and operating system (gzip) */\nconst EXLEN = 16184; /* i: waiting for extra length (gzip) */\nconst EXTRA = 16185; /* i: waiting for extra bytes (gzip) */\nconst NAME = 16186; /* i: waiting for end of file name (gzip) */\nconst COMMENT = 16187; /* i: waiting for end of comment (gzip) */\nconst HCRC = 16188; /* i: waiting for header crc (gzip) */\nconst DICTID = 16189; /* i: waiting for dictionary check value */\nconst DICT = 16190; /* waiting for inflateSetDictionary() call */\nconst TYPE = 16191; /* i: waiting for type bits, including last-flag bit */\nconst TYPEDO = 16192; /* i: same, but skip check to exit inflate on new block */\nconst STORED = 16193; /* i: waiting for stored size (length and complement) */\nconst COPY_ = 16194; /* i/o: same as COPY below, but only first time in */\nconst COPY = 16195; /* i/o: waiting for input or output to copy stored block */\nconst TABLE = 16196; /* i: waiting for dynamic block table lengths */\nconst LENLENS = 16197; /* i: waiting for code length code lengths */\nconst CODELENS = 16198; /* i: waiting for length/lit and distance code lengths */\nconst LEN_ = 16199; /* i: same as LEN below, but only first time in */\nconst LEN = 16200; /* i: waiting for length/lit/eob code */\nconst LENEXT = 16201; /* i: waiting for length extra bits */\nconst DIST = 16202; /* i: waiting for distance code */\nconst DISTEXT = 16203; /* i: waiting for distance extra bits */\nconst MATCH = 16204; /* o: waiting for output space to copy string */\nconst LIT = 16205; /* o: waiting for output space to write literal */\nconst CHECK = 16206; /* i: waiting for 32-bit check value */\nconst LENGTH = 16207; /* i: waiting for 32-bit length (gzip) */\nconst DONE = 16208; /* finished check, done -- remain here until reset */\nconst BAD = 16209; /* got a data error -- remain here until reset */\nconst MEM = 16210; /* got an inflate() memory error -- remain here until reset */\nconst SYNC = 16211; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nconst ENOUGH_LENS = 852;\nconst ENOUGH_DISTS = 592;\n//const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst MAX_WBITS = 15;\n/* 32K LZ77 window */\nconst DEF_WBITS = MAX_WBITS;\n\n\nconst zswap32 = (q) => {\n\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n};\n\n\nfunction InflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip,\n bit 2 true to validate check value */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib), or\n -1 if raw or no header yet */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new Uint16Array(320); /* temporary storage for code lengths */\n this.work = new Uint16Array(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new Int32Array(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\n\nconst inflateStateCheck = (strm) => {\n\n if (!strm) {\n return 1;\n }\n const state = strm.state;\n if (!state || state.strm !== strm ||\n state.mode < HEAD || state.mode > SYNC) {\n return 1;\n }\n return 0;\n};\n\n\nconst inflateResetKeep = (strm) => {\n\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.flags = -1;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS);\n state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n};\n\n\nconst inflateReset = (strm) => {\n\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n};\n\n\nconst inflateReset2 = (strm, windowBits) => {\n let wrap;\n\n /* get the state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 5;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n};\n\n\nconst inflateInit2 = (strm, windowBits) => {\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n const state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.strm = strm;\n state.window = null/*Z_NULL*/;\n state.mode = HEAD; /* to pass state test in inflateReset2() */\n const ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n};\n\n\nconst inflateInit = (strm) => {\n\n return inflateInit2(strm, DEF_WBITS);\n};\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nlet virgin = true;\n\nlet lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\n\nconst fixedtables = (state) => {\n\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n lenfix = new Int32Array(512);\n distfix = new Int32Array(32);\n\n /* literal/length table */\n let sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n};\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nconst updatewindow = (strm, src, end, copy) => {\n\n let dist;\n const state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new Uint8Array(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n state.window.set(src.subarray(end - state.wsize, end), 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n state.window.set(src.subarray(end - copy, end - copy + dist), state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n state.window.set(src.subarray(end - copy, end), 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n};\n\n\nconst inflate = (strm, flush) => {\n\n let state;\n let input, output; // input/output buffers\n let next; /* next input INDEX */\n let put; /* next output INDEX */\n let have, left; /* available input and output */\n let hold; /* bit buffer */\n let bits; /* bits in bit buffer */\n let _in, _out; /* save starting available input and output */\n let copy; /* number of stored or match bytes to copy */\n let from; /* where to copy match bytes from */\n let from_source;\n let here = 0; /* current decoding table entry */\n let here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //let last; /* parent table entry */\n let last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n let len; /* length to copy for repeats, bits to drop */\n let ret; /* return code */\n const hbuf = new Uint8Array(4); /* buffer for gzip header crc calculation */\n let opts;\n\n let n; // temporary variable for NEED_BITS\n\n const order = /* permutation of code lengths */\n new Uint8Array([ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]);\n\n\n if (inflateStateCheck(strm) || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n if (state.wbits === 0) {\n state.wbits = 15;\n }\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n if (len > 15 || len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n\n // !!! pako patch. Force use `options.windowBits` if passed.\n // Required to always use max window size by default.\n state.dmax = 1 << state.wbits;\n //state.dmax = 1 << len;\n\n state.flags = 0; /* indicate zlib header */\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Uint8Array(state.head.extra_len);\n }\n state.head.extra.set(\n input.subarray(\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n next + copy\n ),\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 4) && hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n output.set(input.subarray(next, next + copy), put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if ((state.wrap & 4) && _out) {\n strm.adler = state.check =\n /*UPDATE_CHECK(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.wrap & 4) && (state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 4) && hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if ((state.wrap & 4) && _out) {\n strm.adler = state.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n};\n\n\nconst inflateEnd = (strm) => {\n\n if (inflateStateCheck(strm)) {\n return Z_STREAM_ERROR;\n }\n\n let state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n};\n\n\nconst inflateGetHeader = (strm, head) => {\n\n /* check state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n};\n\n\nconst inflateSetDictionary = (strm, dictionary) => {\n const dictLength = dictionary.length;\n\n let state;\n let dictid;\n let ret;\n\n /* check state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n};\n\n\nmodule.exports.inflateReset = inflateReset;\nmodule.exports.inflateReset2 = inflateReset2;\nmodule.exports.inflateResetKeep = inflateResetKeep;\nmodule.exports.inflateInit = inflateInit;\nmodule.exports.inflateInit2 = inflateInit2;\nmodule.exports.inflate = inflate;\nmodule.exports.inflateEnd = inflateEnd;\nmodule.exports.inflateGetHeader = inflateGetHeader;\nmodule.exports.inflateSetDictionary = inflateSetDictionary;\nmodule.exports.inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nmodule.exports.inflateCodesUsed = inflateCodesUsed;\nmodule.exports.inflateCopy = inflateCopy;\nmodule.exports.inflateGetDictionary = inflateGetDictionary;\nmodule.exports.inflateMark = inflateMark;\nmodule.exports.inflatePrime = inflatePrime;\nmodule.exports.inflateSync = inflateSync;\nmodule.exports.inflateSyncPoint = inflateSyncPoint;\nmodule.exports.inflateUndermine = inflateUndermine;\nmodule.exports.inflateValidate = inflateValidate;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst MAXBITS = 15;\nconst ENOUGH_LENS = 852;\nconst ENOUGH_DISTS = 592;\n//const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\nconst lbase = new Uint16Array([ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n]);\n\nconst lext = new Uint8Array([ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n]);\n\nconst dbase = new Uint16Array([ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n]);\n\nconst dext = new Uint8Array([ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n]);\n\nconst inflate_table = (type, lens, lens_index, codes, table, table_index, work, opts) =>\n{\n const bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n let len = 0; /* a code's length in bits */\n let sym = 0; /* index of code symbols */\n let min = 0, max = 0; /* minimum and maximum code lengths */\n let root = 0; /* number of index bits for root table */\n let curr = 0; /* number of index bits for current table */\n let drop = 0; /* code bits to drop for sub-table */\n let left = 0; /* number of prefix codes available */\n let used = 0; /* code entries in table used */\n let huff = 0; /* Huffman code */\n let incr; /* for incrementing code, index */\n let fill; /* index for replicating entries */\n let low; /* low bits for current root entry */\n let mask; /* mask for low root bits */\n let next; /* next available space in table */\n let base = null; /* base value table to use */\n// let shoextra; /* extra bits table to use */\n let match; /* use base and extra for symbol >= match */\n const count = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n const offs = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n let extra = null;\n\n let here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n match = 20;\n\n } else if (type === LENS) {\n base = lbase;\n extra = lext;\n match = 257;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n match = 0;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] + 1 < match) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] >= match) {\n here_op = extra[work[sym] - match];\n here_val = base[work[sym] - match];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n\n\nmodule.exports = inflate_table;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* eslint-disable space-unary-ops */\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//const Z_FILTERED = 1;\n//const Z_HUFFMAN_ONLY = 2;\n//const Z_RLE = 3;\nconst Z_FIXED = 4;\n//const Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nconst Z_BINARY = 0;\nconst Z_TEXT = 1;\n//const Z_ASCII = 1; // = Z_TEXT\nconst Z_UNKNOWN = 2;\n\n/*============================================================================*/\n\n\nfunction zero(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nconst STORED_BLOCK = 0;\nconst STATIC_TREES = 1;\nconst DYN_TREES = 2;\n/* The three kinds of block type */\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nconst LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nconst LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nconst L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nconst D_CODES = 30;\n/* number of distance codes */\n\nconst BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nconst HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nconst MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nconst MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nconst END_BLOCK = 256;\n/* end of block literal code */\n\nconst REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nconst REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nconst REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nconst extra_lbits = /* extra bits for each length code */\n new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]);\n\nconst extra_dbits = /* extra bits for each distance code */\n new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]);\n\nconst extra_blbits = /* extra bits for each bit length code */\n new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]);\n\nconst bl_order =\n new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nconst DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nconst static_ltree = new Array((L_CODES + 2) * 2);\nzero(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nconst static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nconst _dist_code = new Array(DIST_CODE_LEN);\nzero(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nconst _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nconst base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nconst base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nlet static_l_desc;\nlet static_d_desc;\nlet static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nconst d_code = (dist) => {\n\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n};\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nconst put_short = (s, w) => {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n};\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nconst send_bits = (s, value, length) => {\n\n if (s.bi_valid > (Buf_size - length)) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n};\n\n\nconst send_code = (s, c, tree) => {\n\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n};\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nconst bi_reverse = (code, len) => {\n\n let res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n};\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nconst bi_flush = (s) => {\n\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n};\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nconst gen_bitlen = (s, desc) => {\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n\n const tree = desc.dyn_tree;\n const max_code = desc.max_code;\n const stree = desc.stat_desc.static_tree;\n const has_stree = desc.stat_desc.has_stree;\n const extra = desc.stat_desc.extra_bits;\n const base = desc.stat_desc.extra_base;\n const max_length = desc.stat_desc.max_length;\n let h; /* heap index */\n let n, m; /* iterate over the tree elements */\n let bits; /* bit length */\n let xbits; /* extra bits */\n let f; /* frequency */\n let overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Tracev((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Tracev((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n};\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nconst gen_codes = (tree, max_code, bl_count) => {\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n\n const next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n let code = 0; /* running code value */\n let bits; /* bit index */\n let n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n code = (code + bl_count[bits - 1]) << 1;\n next_code[bits] = code;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1< {\n\n let n; /* iterates over tree elements */\n let bits; /* bit counter */\n let length; /* length value */\n let code; /* code value */\n let dist; /* distance index */\n const bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n};\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nconst init_block = (s) => {\n\n let n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.sym_next = s.matches = 0;\n};\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nconst bi_windup = (s) =>\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n};\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nconst smaller = (tree, n, m, depth) => {\n\n const _n2 = n * 2;\n const _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n};\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nconst pqdownheap = (s, tree, k) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n\n const v = s.heap[k];\n let j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n};\n\n\n// inlined manually\n// const SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nconst compress_block = (s, ltree, dtree) => {\n// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n\n let dist; /* distance of matched string */\n let lc; /* match length or unmatched char (if dist == 0) */\n let sx = 0; /* running index in sym_buf */\n let code; /* the code to send */\n let extra; /* number of extra bits to send */\n\n if (s.sym_next !== 0) {\n do {\n dist = s.pending_buf[s.sym_buf + sx++] & 0xff;\n dist += (s.pending_buf[s.sym_buf + sx++] & 0xff) << 8;\n lc = s.pending_buf[s.sym_buf + sx++];\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and sym_buf is ok: */\n //Assert(s->pending < s->lit_bufsize + sx, \"pendingBuf overflow\");\n\n } while (sx < s.sym_next);\n }\n\n send_code(s, END_BLOCK, ltree);\n};\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nconst build_tree = (s, desc) => {\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n\n const tree = desc.dyn_tree;\n const stree = desc.stat_desc.static_tree;\n const has_stree = desc.stat_desc.has_stree;\n const elems = desc.stat_desc.elems;\n let n, m; /* iterate over heap elements */\n let max_code = -1; /* largest code with non zero frequency */\n let node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE;\n\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);\n tree[node * 2]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n /*** pqremove ***/\n n = s.heap[1/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n};\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nconst scan_tree = (s, tree, max_code) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n};\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nconst send_tree = (s, tree, max_code) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n};\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nconst build_bl_tree = (s) => {\n\n let max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n};\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nconst send_all_trees = (s, lcodes, dcodes, blcodes) => {\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n\n let rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n};\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"block list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"allow list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nconst detect_data_type = (s) => {\n /* block_mask is the bit mask of block-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n let block_mask = 0xf3ffc07f;\n let n;\n\n /* Check for non-textual (\"block-listed\") bytes. */\n for (n = 0; n <= 31; n++, block_mask >>>= 1) {\n if ((block_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"allow-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n }\n\n /* There are no \"block-listed\" or \"allow-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n};\n\n\nlet static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nconst _tr_init = (s) =>\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n};\n\n\n/* ===========================================================================\n * Send a stored block\n */\nconst _tr_stored_block = (s, buf, stored_len, last) => {\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n bi_windup(s); /* align on byte boundary */\n put_short(s, stored_len);\n put_short(s, ~stored_len);\n if (stored_len) {\n s.pending_buf.set(s.window.subarray(buf, buf + stored_len), s.pending);\n }\n s.pending += stored_len;\n};\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nconst _tr_align = (s) => {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n};\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and write out the encoded block.\n */\nconst _tr_flush_block = (s, buf, stored_len, last) => {\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n\n let opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n let max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->sym_next / 3));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n};\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nconst _tr_tally = (s, dist, lc) => {\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n\n s.pending_buf[s.sym_buf + s.sym_next++] = dist;\n s.pending_buf[s.sym_buf + s.sym_next++] = dist >> 8;\n s.pending_buf[s.sym_buf + s.sym_next++] = lc;\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n return (s.sym_next === s.sym_end);\n};\n\nmodule.exports._tr_init = _tr_init;\nmodule.exports._tr_stored_block = _tr_stored_block;\nmodule.exports._tr_flush_block = _tr_flush_block;\nmodule.exports._tr_tally = _tr_tally;\nmodule.exports._tr_align = _tr_align;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nmodule.exports = ZStream;\n","import { Spec } from \"vega\";\nimport vegaEmbed, { EmbedOptions, Mode } from \"vega-embed\";\nimport { TopLevelSpec } from \"vega-lite\";\n\nexport { default as vegaEmbed } from \"vega-embed\";\nexport { VegaWidgetModel, VegaWidget } from \"./widget\";\nexport const version = require(\"../package.json\").version;\n\nfunction javascriptIndex(selector: string, outputs: any) {\n // Return the index in the output array of the JS repr of this viz\n for (let i = 0; i < outputs.length; i++) {\n const item = outputs[i];\n if (\n item.metadata &&\n item.metadata[\"jupyter-vega\"] === selector &&\n item.data[\"application/javascript\"] !== undefined\n ) {\n return i;\n }\n }\n return -1;\n}\n\nfunction imageIndex(selector: string, outputs: any) {\n // Return the index in the output array of the PNG repr of this viz\n for (let i = 0; i < outputs.length; i++) {\n const item = outputs[i];\n if (\n item.metadata &&\n item.metadata[\"jupyter-vega\"] === selector &&\n item.data[\"image/png\"] !== undefined\n ) {\n return i;\n }\n }\n return -1;\n}\n\nfunction showError(el: HTMLElement, error: Error) {\n el.innerHTML = `
\n

Javascript Error: ${error.message}

\n

This usually means there's a typo in your chart specification.\n See the JavaScript console for the full traceback.

\n
`;\n\n throw error;\n}\n\nexport function render(\n selector: string,\n spec: Spec | TopLevelSpec,\n type: Mode,\n opt: EmbedOptions,\n output_area: any,\n) {\n // Find the indices of this visualizations JS and PNG\n // representation.\n const imgIndex = imageIndex(selector, output_area.outputs);\n const jsIndex = javascriptIndex(selector, output_area.outputs);\n\n // If we have already rendered a static image, don't render\n // the JS version or append a new PNG version\n if (imgIndex > -1 && jsIndex > -1) {\n return;\n }\n\n // Never been rendered, so render JS and append the PNG to the\n // outputs for the cell\n const el = document.getElementById(selector.substring(1))!;\n vegaEmbed(el, spec, {\n loader: { http: { credentials: \"same-origin\" } },\n ...opt,\n mode: type,\n })\n .then((result) => {\n result.view\n .toImageURL(\"png\")\n .then((imageData) => {\n if (output_area !== undefined) {\n const output = {\n data: {\n \"image/png\": imageData.split(\",\")[1],\n },\n metadata: { \"jupyter-vega\": selector },\n output_type: \"display_data\",\n };\n // This appends the PNG output, but doesn't render it this time\n // as the JS version will be rendered already.\n output_area.outputs.push(output);\n }\n })\n .catch((error) => showError(el, error));\n })\n .catch((error) => showError(el, error));\n}\n\nexport * from \"./widget\";\n","const pkg = require(\"../package.json\");\nexport const MODULE_VERSION = pkg.version;\nexport const MODULE_NAME = pkg.name;\n","import { DOMWidgetView, DOMWidgetModel } from \"@jupyter-widgets/base\";\nimport { MODULE_NAME, MODULE_VERSION } from \"./version\";\nimport { vegaEmbed } from \"./index\";\nimport { Result } from \"vega-embed\";\nimport * as ndarray from \"ndarray\";\nimport { table_serialization, rowProxy, IDict } from \"jupyter-tablewidgets\";\n\ninterface WidgetUpdate {\n key: string;\n remove?: string;\n insert?: any[] | \"@dataframe\" | \"@array2d\";\n}\n\ninterface WidgetUpdateMessage {\n type: \"update\";\n updates: WidgetUpdate[];\n resize: boolean;\n}\n\nfunction serializeImgURL(imgURL: string, mgr: VegaWidgetModel): string {\n if (\n mgr.viewInstance === null ||\n mgr.viewInstance.viewElement === undefined ||\n mgr.viewInstance.hasBeenUpdated === false\n ) {\n return imgURL;\n }\n let id_ = mgr.viewInstance.viewElement.id;\n if (id_ === \"\" || id_ === undefined) {\n id_ = \"VEGA_ID_\" + crypto.randomUUID();\n mgr.viewInstance.viewElement.id = id_;\n }\n let canvas = document.querySelector(`#${id_} canvas`);\n if (canvas === null) {\n return imgURL;\n }\n return JSON.stringify({\n // @ts-ignore\n width: canvas.style.width || canvas.width,\n // @ts-ignore\n height: canvas.style.height || canvas.height,\n // @ts-ignore\n url: canvas.toDataURL(),\n });\n}\n\n// validate the ev object and cast it to the correct type\nfunction checkWidgetUpdate(ev: any): WidgetUpdateMessage | null {\n if (ev.type != \"update\") {\n return null;\n }\n\n // TODO: Fully validate ev and give a easy to understand error message if it is ill-formed\n return ev as WidgetUpdateMessage;\n}\n\nexport class VegaWidgetModel extends DOMWidgetModel {\n defaults() {\n return {\n ...DOMWidgetModel.prototype.defaults(),\n _model_name: \"VegaWidgetModel\",\n _view_name: \"VegaWidget\",\n _spec_source: \"\",\n _opt_source: \"\",\n _df: ndarray([]),\n _img_url: \"\",\n _columns: [],\n };\n }\n viewInstance: VegaWidget | null = null;\n static serializers = {\n ...DOMWidgetModel.serializers,\n _img_url: { serialize: serializeImgURL } as any,\n _df: table_serialization as any,\n };\n\n static model_name = \"VegaWidgetModel\";\n static model_module = MODULE_NAME;\n static model_module_version = MODULE_VERSION;\n static view_name = \"VegaWidget\";\n static view_module = MODULE_NAME;\n static view_module_version = MODULE_VERSION;\n}\n\nexport class VegaWidget extends DOMWidgetView {\n result?: Result;\n hasBeenUpdated: boolean = false; // when it is \"true\" it means that the view has been updated at least once\n viewElement = document.createElement(\"div\");\n errorElement = document.createElement(\"div\");\n\n async render() {\n this.el.appendChild(this.viewElement);\n this.errorElement.style.color = \"red\";\n this.el.appendChild(this.errorElement);\n let model = this.model as VegaWidgetModel;\n model.viewInstance = this;\n const reembed = async () => {\n const spec = JSON.parse(this.model.get(\"_spec_source\"));\n const opt = JSON.parse(this.model.get(\"_opt_source\") || \"{}\");\n const imgURL = this.model.get(\"_img_url\");\n if (imgURL !== \"\" && imgURL !== \"null\") {\n let imgJson = JSON.parse(imgURL);\n let imgElement = document.createElement(\"img\");\n imgElement.src = imgJson.url;\n let h = parseInt(imgJson.height);\n if (h > 0) {\n imgElement.height = h;\n }\n let w = parseInt(imgJson.width);\n if (w > 0) {\n imgElement.width = w;\n }\n this.viewElement.appendChild(imgElement);\n this.model.set(\"_img_url\", \"null\");\n return;\n }\n if (spec == null) {\n return;\n }\n try {\n const result = await vegaEmbed(this.viewElement, spec, {\n loader: { http: { credentials: \"same-origin\" } },\n ...opt,\n });\n if (this.result) {\n this.result.finalize();\n }\n this.result = result;\n this.send({ type: \"display\" });\n } catch (err) {\n if (this.result) {\n this.result.finalize();\n }\n console.error(err);\n }\n };\n\n const applyUpdate = async (update: WidgetUpdate, resize: boolean) => {\n const result = this.result;\n if (result == null) {\n throw new Error(\"Internal error: no view attached to widget\");\n }\n const filter = new Function(\n \"datum\",\n `return (${update.remove || \"false\"})`,\n );\n let newValues = update.insert || [];\n switch (newValues) {\n case \"@dataframe\": {\n newValues = this.updateDataFrame();\n break;\n }\n case \"@array2d\": {\n newValues = this.updateArray2D();\n }\n }\n const changeSet = result.view\n .changeset()\n .remove(filter)\n .insert(newValues);\n const view = result.view.change(update.key, changeSet);\n if (resize) view.resize();\n await view.runAsync();\n };\n\n const applyUpdates = async (message: WidgetUpdateMessage) => {\n this.hasBeenUpdated = true;\n for (const update of message.updates) {\n await applyUpdate(update, message.resize);\n }\n };\n\n this.model.on(\"change:_spec_source\", reembed);\n this.model.on(\"change:_opt_source\", reembed);\n this.model.on(\"msg:custom\", (ev: any) => {\n const message = checkWidgetUpdate(ev);\n if (message == null) {\n return;\n }\n\n applyUpdates(message).catch((err: Error) => {\n this.errorElement.textContent = String(err);\n console.error(err);\n });\n });\n\n // initial rendering\n await reembed();\n }\n\n updateDataFrame(): any[] {\n const table = this.model.get(\"_df\");\n const proxy = rowProxy(table);\n const rows = Array(table.size);\n for (let i = 0; i < rows.length; ++i) {\n rows[i] = proxy(i);\n }\n return rows;\n }\n\n updateArray2D(): any[] {\n /* A 2D array is encoded for transfer like a dataframe\n having an unique, (2D) column.\n The column name is \"special\", i.e. it is a string containing\n three comma separated keys, e.g. \"x,y,z\"\n this format is useful for encoding, for example, a heatmap */\n const table = this.model.get(\"_df\");\n const res = Array(table.size * table.size);\n const fancyCol = table.columns[0];\n const arr: ndarray.NdArray = table.data[fancyCol];\n const cols: string[] = fancyCol.split(\",\");\n let k = 0;\n for (let i = 0; i < arr.shape[0]; i++) {\n for (let j = 0; j < arr.shape[1]; j++) {\n let row: IDict = {};\n row[cols[0]] = i;\n row[cols[1]] = j;\n row[cols[2]] = arr.get(i, j);\n res[k++] = row;\n }\n }\n return res;\n }\n}\n","\"use strict\"\n\nfunction unique_pred(list, compare) {\n var ptr = 1\n , len = list.length\n , a=list[0], b=list[0]\n for(var i=1; i= 48 && charCode <= 57) {\n i++;\n continue;\n }\n return false;\n }\n return true;\n }\n /**\n * Escapes a json pointer path\n * @param path The raw pointer\n * @return the Escaped path\n */\n function escapePathComponent(path) {\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1) return path;\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\n }\n /**\n * Unescapes a json pointer path\n * @param path The escaped pointer\n * @return The unescaped path\n */\n function unescapePathComponent(path) {\n return path.replace(/~1/g, '/').replace(/~0/g, '~');\n }\n /**\n * Recursively checks whether an object has any undefined values inside.\n */\n function hasUndefined(obj) {\n if (obj === undefined) {\n return true;\n }\n if (obj) {\n if (Array.isArray(obj)) {\n for (var i_1 = 0, len = obj.length; i_1 < len; i_1++) {\n if (hasUndefined(obj[i_1])) {\n return true;\n }\n }\n } else if (typeof obj === \"object\") {\n var objKeys = _objectKeys(obj);\n var objKeysLength = objKeys.length;\n for (var i = 0; i < objKeysLength; i++) {\n if (hasUndefined(obj[objKeys[i]])) {\n return true;\n }\n }\n }\n }\n return false;\n }\n function patchErrorMessageFormatter(message, args) {\n var messageParts = [message];\n for (var key in args) {\n var value = typeof args[key] === 'object' ? JSON.stringify(args[key], null, 2) : args[key]; // pretty print\n if (typeof value !== 'undefined') {\n messageParts.push(key + \": \" + value);\n }\n }\n return messageParts.join('\\n');\n }\n var PatchError = /** @class */function (_super) {\n __extends(PatchError, _super);\n function PatchError(message, name, index, operation, tree) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, patchErrorMessageFormatter(message, {\n name: name,\n index: index,\n operation: operation,\n tree: tree\n })) || this;\n _this.name = name;\n _this.index = index;\n _this.operation = operation;\n _this.tree = tree;\n Object.setPrototypeOf(_this, _newTarget.prototype); // restore prototype chain, see https://stackoverflow.com/a/48342359\n _this.message = patchErrorMessageFormatter(message, {\n name: name,\n index: index,\n operation: operation,\n tree: tree\n });\n return _this;\n }\n return PatchError;\n }(Error);\n\n var JsonPatchError = PatchError;\n var deepClone = _deepClone;\n /* We use a Javascript hash to store each\n function. Each hash entry (property) uses\n the operation identifiers specified in rfc6902.\n In this way, we can map each patch operation\n to its dedicated function in efficient way.\n */\n /* The operations applicable to an object */\n var objOps = {\n add: function (obj, key, document) {\n obj[key] = this.value;\n return {\n newDocument: document\n };\n },\n remove: function (obj, key, document) {\n var removed = obj[key];\n delete obj[key];\n return {\n newDocument: document,\n removed: removed\n };\n },\n replace: function (obj, key, document) {\n var removed = obj[key];\n obj[key] = this.value;\n return {\n newDocument: document,\n removed: removed\n };\n },\n move: function (obj, key, document) {\n /* in case move target overwrites an existing value,\n return the removed value, this can be taxing performance-wise,\n and is potentially unneeded */\n var removed = getValueByPointer(document, this.path);\n if (removed) {\n removed = _deepClone(removed);\n }\n var originalValue = applyOperation(document, {\n op: \"remove\",\n path: this.from\n }).removed;\n applyOperation(document, {\n op: \"add\",\n path: this.path,\n value: originalValue\n });\n return {\n newDocument: document,\n removed: removed\n };\n },\n copy: function (obj, key, document) {\n var valueToCopy = getValueByPointer(document, this.from);\n // enforce copy by value so further operations don't affect source (see issue #177)\n applyOperation(document, {\n op: \"add\",\n path: this.path,\n value: _deepClone(valueToCopy)\n });\n return {\n newDocument: document\n };\n },\n test: function (obj, key, document) {\n return {\n newDocument: document,\n test: _areEquals(obj[key], this.value)\n };\n },\n _get: function (obj, key, document) {\n this.value = obj[key];\n return {\n newDocument: document\n };\n }\n };\n /* The operations applicable to an array. Many are the same as for the object */\n var arrOps = {\n add: function (arr, i, document) {\n if (isInteger(i)) {\n arr.splice(i, 0, this.value);\n } else {\n // array props\n arr[i] = this.value;\n }\n // this may be needed when using '-' in an array\n return {\n newDocument: document,\n index: i\n };\n },\n remove: function (arr, i, document) {\n var removedList = arr.splice(i, 1);\n return {\n newDocument: document,\n removed: removedList[0]\n };\n },\n replace: function (arr, i, document) {\n var removed = arr[i];\n arr[i] = this.value;\n return {\n newDocument: document,\n removed: removed\n };\n },\n move: objOps.move,\n copy: objOps.copy,\n test: objOps.test,\n _get: objOps._get\n };\n /**\n * Retrieves a value from a JSON document by a JSON pointer.\n * Returns the value.\n *\n * @param document The document to get the value from\n * @param pointer an escaped JSON pointer\n * @return The retrieved value\n */\n function getValueByPointer(document, pointer) {\n if (pointer == '') {\n return document;\n }\n var getOriginalDestination = {\n op: \"_get\",\n path: pointer\n };\n applyOperation(document, getOriginalDestination);\n return getOriginalDestination.value;\n }\n /**\n * Apply a single JSON Patch Operation on a JSON document.\n * Returns the {newDocument, result} of the operation.\n * It modifies the `document` and `operation` objects - it gets the values by reference.\n * If you would like to avoid touching your values, clone them:\n * `jsonpatch.applyOperation(document, jsonpatch._deepClone(operation))`.\n *\n * @param document The document to patch\n * @param operation The operation to apply\n * @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.\n * @param mutateDocument Whether to mutate the original document or clone it before applying\n * @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.\n * @return `{newDocument, result}` after the operation\n */\n function applyOperation(document, operation, validateOperation, mutateDocument, banPrototypeModifications, index) {\n if (validateOperation === void 0) {\n validateOperation = false;\n }\n if (mutateDocument === void 0) {\n mutateDocument = true;\n }\n if (banPrototypeModifications === void 0) {\n banPrototypeModifications = true;\n }\n if (index === void 0) {\n index = 0;\n }\n if (validateOperation) {\n if (typeof validateOperation == 'function') {\n validateOperation(operation, 0, document, operation.path);\n } else {\n validator(operation, 0);\n }\n }\n /* ROOT OPERATIONS */\n if (operation.path === \"\") {\n var returnValue = {\n newDocument: document\n };\n if (operation.op === 'add') {\n returnValue.newDocument = operation.value;\n return returnValue;\n } else if (operation.op === 'replace') {\n returnValue.newDocument = operation.value;\n returnValue.removed = document; //document we removed\n return returnValue;\n } else if (operation.op === 'move' || operation.op === 'copy') {\n // it's a move or copy to root\n returnValue.newDocument = getValueByPointer(document, operation.from); // get the value by json-pointer in `from` field\n if (operation.op === 'move') {\n // report removed item\n returnValue.removed = document;\n }\n return returnValue;\n } else if (operation.op === 'test') {\n returnValue.test = _areEquals(document, operation.value);\n if (returnValue.test === false) {\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n returnValue.newDocument = document;\n return returnValue;\n } else if (operation.op === 'remove') {\n // a remove on root\n returnValue.removed = document;\n returnValue.newDocument = null;\n return returnValue;\n } else if (operation.op === '_get') {\n operation.value = document;\n return returnValue;\n } else {\n /* bad operation */\n if (validateOperation) {\n throw new JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document);\n } else {\n return returnValue;\n }\n }\n } /* END ROOT OPERATIONS */else {\n if (!mutateDocument) {\n document = _deepClone(document);\n }\n var path = operation.path || \"\";\n var keys = path.split('/');\n var obj = document;\n var t = 1; //skip empty element - http://jsperf.com/to-shift-or-not-to-shift\n var len = keys.length;\n var existingPathFragment = undefined;\n var key = void 0;\n var validateFunction = void 0;\n if (typeof validateOperation == 'function') {\n validateFunction = validateOperation;\n } else {\n validateFunction = validator;\n }\n while (true) {\n key = keys[t];\n if (key && key.indexOf('~') != -1) {\n key = unescapePathComponent(key);\n }\n if (banPrototypeModifications && (key == '__proto__' || key == 'prototype' && t > 0 && keys[t - 1] == 'constructor')) {\n throw new TypeError('JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README');\n }\n if (validateOperation) {\n if (existingPathFragment === undefined) {\n if (obj[key] === undefined) {\n existingPathFragment = keys.slice(0, t).join('/');\n } else if (t == len - 1) {\n existingPathFragment = operation.path;\n }\n if (existingPathFragment !== undefined) {\n validateFunction(operation, 0, document, existingPathFragment);\n }\n }\n }\n t++;\n if (Array.isArray(obj)) {\n if (key === '-') {\n key = obj.length;\n } else {\n if (validateOperation && !isInteger(key)) {\n throw new JsonPatchError(\"Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index\", \"OPERATION_PATH_ILLEGAL_ARRAY_INDEX\", index, operation, document);\n } // only parse key when it's an integer for `arr.prop` to work\n else if (isInteger(key)) {\n key = ~~key;\n }\n }\n if (t >= len) {\n if (validateOperation && operation.op === \"add\" && key > obj.length) {\n throw new JsonPatchError(\"The specified index MUST NOT be greater than the number of elements in the array\", \"OPERATION_VALUE_OUT_OF_BOUNDS\", index, operation, document);\n }\n var returnValue = arrOps[operation.op].call(operation, obj, key, document); // Apply patch\n if (returnValue.test === false) {\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n return returnValue;\n }\n } else {\n if (t >= len) {\n var returnValue = objOps[operation.op].call(operation, obj, key, document); // Apply patch\n if (returnValue.test === false) {\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n return returnValue;\n }\n }\n obj = obj[key];\n // If we have more keys in the path, but the next value isn't a non-null object,\n // throw an OPERATION_PATH_UNRESOLVABLE error instead of iterating again.\n if (validateOperation && t < len && (!obj || typeof obj !== \"object\")) {\n throw new JsonPatchError('Cannot perform operation at the desired path', 'OPERATION_PATH_UNRESOLVABLE', index, operation, document);\n }\n }\n }\n }\n /**\n * Apply a full JSON Patch array on a JSON document.\n * Returns the {newDocument, result} of the patch.\n * It modifies the `document` object and `patch` - it gets the values by reference.\n * If you would like to avoid touching your values, clone them:\n * `jsonpatch.applyPatch(document, jsonpatch._deepClone(patch))`.\n *\n * @param document The document to patch\n * @param patch The patch to apply\n * @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.\n * @param mutateDocument Whether to mutate the original document or clone it before applying\n * @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.\n * @return An array of `{newDocument, result}` after the patch\n */\n function applyPatch(document, patch, validateOperation, mutateDocument, banPrototypeModifications) {\n if (mutateDocument === void 0) {\n mutateDocument = true;\n }\n if (banPrototypeModifications === void 0) {\n banPrototypeModifications = true;\n }\n if (validateOperation) {\n if (!Array.isArray(patch)) {\n throw new JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');\n }\n }\n if (!mutateDocument) {\n document = _deepClone(document);\n }\n var results = new Array(patch.length);\n for (var i = 0, length_1 = patch.length; i < length_1; i++) {\n // we don't need to pass mutateDocument argument because if it was true, we already deep cloned the object, we'll just pass `true`\n results[i] = applyOperation(document, patch[i], validateOperation, true, banPrototypeModifications, i);\n document = results[i].newDocument; // in case root was replaced\n }\n results.newDocument = document;\n return results;\n }\n /**\n * Apply a single JSON Patch Operation on a JSON document.\n * Returns the updated document.\n * Suitable as a reducer.\n *\n * @param document The document to patch\n * @param operation The operation to apply\n * @return The updated document\n */\n function applyReducer(document, operation, index) {\n var operationResult = applyOperation(document, operation);\n if (operationResult.test === false) {\n // failed test\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n return operationResult.newDocument;\n }\n /**\n * Validates a single operation. Called from `jsonpatch.validate`. Throws `JsonPatchError` in case of an error.\n * @param {object} operation - operation object (patch)\n * @param {number} index - index of operation in the sequence\n * @param {object} [document] - object where the operation is supposed to be applied\n * @param {string} [existingPathFragment] - comes along with `document`\n */\n function validator(operation, index, document, existingPathFragment) {\n if (typeof operation !== 'object' || operation === null || Array.isArray(operation)) {\n throw new JsonPatchError('Operation is not an object', 'OPERATION_NOT_AN_OBJECT', index, operation, document);\n } else if (!objOps[operation.op]) {\n throw new JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document);\n } else if (typeof operation.path !== 'string') {\n throw new JsonPatchError('Operation `path` property is not a string', 'OPERATION_PATH_INVALID', index, operation, document);\n } else if (operation.path.indexOf('/') !== 0 && operation.path.length > 0) {\n // paths that aren't empty string should start with \"/\"\n throw new JsonPatchError('Operation `path` property must start with \"/\"', 'OPERATION_PATH_INVALID', index, operation, document);\n } else if ((operation.op === 'move' || operation.op === 'copy') && typeof operation.from !== 'string') {\n throw new JsonPatchError('Operation `from` property is not present (applicable in `move` and `copy` operations)', 'OPERATION_FROM_REQUIRED', index, operation, document);\n } else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && operation.value === undefined) {\n throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_REQUIRED', index, operation, document);\n } else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && hasUndefined(operation.value)) {\n throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED', index, operation, document);\n } else if (document) {\n if (operation.op == \"add\") {\n var pathLen = operation.path.split(\"/\").length;\n var existingPathLen = existingPathFragment.split(\"/\").length;\n if (pathLen !== existingPathLen + 1 && pathLen !== existingPathLen) {\n throw new JsonPatchError('Cannot perform an `add` operation at the desired path', 'OPERATION_PATH_CANNOT_ADD', index, operation, document);\n }\n } else if (operation.op === 'replace' || operation.op === 'remove' || operation.op === '_get') {\n if (operation.path !== existingPathFragment) {\n throw new JsonPatchError('Cannot perform the operation at a path that does not exist', 'OPERATION_PATH_UNRESOLVABLE', index, operation, document);\n }\n } else if (operation.op === 'move' || operation.op === 'copy') {\n var existingValue = {\n op: \"_get\",\n path: operation.from,\n value: undefined\n };\n var error = validate([existingValue], document);\n if (error && error.name === 'OPERATION_PATH_UNRESOLVABLE') {\n throw new JsonPatchError('Cannot perform the operation from a path that does not exist', 'OPERATION_FROM_UNRESOLVABLE', index, operation, document);\n }\n }\n }\n }\n /**\n * Validates a sequence of operations. If `document` parameter is provided, the sequence is additionally validated against the object document.\n * If error is encountered, returns a JsonPatchError object\n * @param sequence\n * @param document\n * @returns {JsonPatchError|undefined}\n */\n function validate(sequence, document, externalValidator) {\n try {\n if (!Array.isArray(sequence)) {\n throw new JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');\n }\n if (document) {\n //clone document and sequence so that we can safely try applying operations\n applyPatch(_deepClone(document), _deepClone(sequence), externalValidator || true);\n } else {\n externalValidator = externalValidator || validator;\n for (var i = 0; i < sequence.length; i++) {\n externalValidator(sequence[i], i, document, undefined);\n }\n }\n } catch (e) {\n if (e instanceof JsonPatchError) {\n return e;\n } else {\n throw e;\n }\n }\n }\n // based on https://github.com/epoberezkin/fast-deep-equal\n // MIT License\n // Copyright (c) 2017 Evgeny Poberezkin\n // Permission is hereby granted, free of charge, to any person obtaining a copy\n // of this software and associated documentation files (the \"Software\"), to deal\n // in the Software without restriction, including without limitation the rights\n // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n // copies of the Software, and to permit persons to whom the Software is\n // furnished to do so, subject to the following conditions:\n // The above copyright notice and this permission notice shall be included in all\n // copies or substantial portions of the Software.\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n // SOFTWARE.\n function _areEquals(a, b) {\n if (a === b) return true;\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = Array.isArray(a),\n arrB = Array.isArray(b),\n i,\n length,\n key;\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;) if (!_areEquals(a[i], b[i])) return false;\n return true;\n }\n if (arrA != arrB) return false;\n var keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n for (i = length; i-- !== 0;) if (!b.hasOwnProperty(keys[i])) return false;\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (!_areEquals(a[key], b[key])) return false;\n }\n return true;\n }\n return a !== a && b !== b;\n }\n\n var core = /*#__PURE__*/Object.freeze({\n __proto__: null,\n JsonPatchError: JsonPatchError,\n _areEquals: _areEquals,\n applyOperation: applyOperation,\n applyPatch: applyPatch,\n applyReducer: applyReducer,\n deepClone: deepClone,\n getValueByPointer: getValueByPointer,\n validate: validate,\n validator: validator\n });\n\n /*!\n * https://github.com/Starcounter-Jack/JSON-Patch\n * (c) 2017-2021 Joachim Wester\n * MIT license\n */\n var beforeDict = new WeakMap();\n var Mirror = /** @class */function () {\n function Mirror(obj) {\n this.observers = new Map();\n this.obj = obj;\n }\n return Mirror;\n }();\n var ObserverInfo = /** @class */function () {\n function ObserverInfo(callback, observer) {\n this.callback = callback;\n this.observer = observer;\n }\n return ObserverInfo;\n }();\n function getMirror(obj) {\n return beforeDict.get(obj);\n }\n function getObserverFromMirror(mirror, callback) {\n return mirror.observers.get(callback);\n }\n function removeObserverFromMirror(mirror, observer) {\n mirror.observers.delete(observer.callback);\n }\n /**\n * Detach an observer from an object\n */\n function unobserve(root, observer) {\n observer.unobserve();\n }\n /**\n * Observes changes made to an object, which can then be retrieved using generate\n */\n function observe(obj, callback) {\n var patches = [];\n var observer;\n var mirror = getMirror(obj);\n if (!mirror) {\n mirror = new Mirror(obj);\n beforeDict.set(obj, mirror);\n } else {\n var observerInfo = getObserverFromMirror(mirror, callback);\n observer = observerInfo && observerInfo.observer;\n }\n if (observer) {\n return observer;\n }\n observer = {};\n mirror.value = _deepClone(obj);\n if (callback) {\n observer.callback = callback;\n observer.next = null;\n var dirtyCheck = function () {\n generate(observer);\n };\n var fastCheck = function () {\n clearTimeout(observer.next);\n observer.next = setTimeout(dirtyCheck);\n };\n if (typeof window !== 'undefined') {\n //not Node\n window.addEventListener('mouseup', fastCheck);\n window.addEventListener('keyup', fastCheck);\n window.addEventListener('mousedown', fastCheck);\n window.addEventListener('keydown', fastCheck);\n window.addEventListener('change', fastCheck);\n }\n }\n observer.patches = patches;\n observer.object = obj;\n observer.unobserve = function () {\n generate(observer);\n clearTimeout(observer.next);\n removeObserverFromMirror(mirror, observer);\n if (typeof window !== 'undefined') {\n window.removeEventListener('mouseup', fastCheck);\n window.removeEventListener('keyup', fastCheck);\n window.removeEventListener('mousedown', fastCheck);\n window.removeEventListener('keydown', fastCheck);\n window.removeEventListener('change', fastCheck);\n }\n };\n mirror.observers.set(callback, new ObserverInfo(callback, observer));\n return observer;\n }\n /**\n * Generate an array of patches from an observer\n */\n function generate(observer, invertible) {\n if (invertible === void 0) {\n invertible = false;\n }\n var mirror = beforeDict.get(observer.object);\n _generate(mirror.value, observer.object, observer.patches, \"\", invertible);\n if (observer.patches.length) {\n applyPatch(mirror.value, observer.patches);\n }\n var temp = observer.patches;\n if (temp.length > 0) {\n observer.patches = [];\n if (observer.callback) {\n observer.callback(temp);\n }\n }\n return temp;\n }\n // Dirty check if obj is different from mirror, generate patches and update mirror\n function _generate(mirror, obj, patches, path, invertible) {\n if (obj === mirror) {\n return;\n }\n if (typeof obj.toJSON === \"function\") {\n obj = obj.toJSON();\n }\n var newKeys = _objectKeys(obj);\n var oldKeys = _objectKeys(mirror);\n var deleted = false;\n //if ever \"move\" operation is implemented here, make sure this test runs OK: \"should not generate the same patch twice (move)\"\n for (var t = oldKeys.length - 1; t >= 0; t--) {\n var key = oldKeys[t];\n var oldVal = mirror[key];\n if (hasOwnProperty(obj, key) && !(obj[key] === undefined && oldVal !== undefined && Array.isArray(obj) === false)) {\n var newVal = obj[key];\n if (typeof oldVal == \"object\" && oldVal != null && typeof newVal == \"object\" && newVal != null && Array.isArray(oldVal) === Array.isArray(newVal)) {\n _generate(oldVal, newVal, patches, path + \"/\" + escapePathComponent(key), invertible);\n } else {\n if (oldVal !== newVal) {\n if (invertible) {\n patches.push({\n op: \"test\",\n path: path + \"/\" + escapePathComponent(key),\n value: _deepClone(oldVal)\n });\n }\n patches.push({\n op: \"replace\",\n path: path + \"/\" + escapePathComponent(key),\n value: _deepClone(newVal)\n });\n }\n }\n } else if (Array.isArray(mirror) === Array.isArray(obj)) {\n if (invertible) {\n patches.push({\n op: \"test\",\n path: path + \"/\" + escapePathComponent(key),\n value: _deepClone(oldVal)\n });\n }\n patches.push({\n op: \"remove\",\n path: path + \"/\" + escapePathComponent(key)\n });\n deleted = true; // property has been deleted\n } else {\n if (invertible) {\n patches.push({\n op: \"test\",\n path: path,\n value: mirror\n });\n }\n patches.push({\n op: \"replace\",\n path: path,\n value: obj\n });\n }\n }\n if (!deleted && newKeys.length == oldKeys.length) {\n return;\n }\n for (var t = 0; t < newKeys.length; t++) {\n var key = newKeys[t];\n if (!hasOwnProperty(mirror, key) && obj[key] !== undefined) {\n patches.push({\n op: \"add\",\n path: path + \"/\" + escapePathComponent(key),\n value: _deepClone(obj[key])\n });\n }\n }\n }\n /**\n * Create an array of patches from the differences in two objects\n */\n function compare$7(tree1, tree2, invertible) {\n if (invertible === void 0) {\n invertible = false;\n }\n var patches = [];\n _generate(tree1, tree2, patches, '', invertible);\n return patches;\n }\n\n var duplex = /*#__PURE__*/Object.freeze({\n __proto__: null,\n compare: compare$7,\n generate: generate,\n observe: observe,\n unobserve: unobserve\n });\n\n Object.assign({}, core, duplex, {\n JsonPatchError: PatchError,\n deepClone: _deepClone,\n escapePathComponent,\n unescapePathComponent\n });\n\n function getDefaultExportFromCjs (x) {\n \treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n }\n\n // Note: This regex matches even invalid JSON strings, but since we’re\n // working on the output of `JSON.stringify` we know that only valid strings\n // are present (unless the user supplied a weird `options.indent` but in\n // that case we don’t care since the output would be invalid anyway).\n var stringOrChar = /(\"(?:[^\\\\\"]|\\\\.)*\")|[:,]/g;\n var jsonStringifyPrettyCompact = function stringify(passedObj, options) {\n var indent, maxLength, replacer;\n options = options || {};\n indent = JSON.stringify([1], undefined, options.indent === undefined ? 2 : options.indent).slice(2, -3);\n maxLength = indent === \"\" ? Infinity : options.maxLength === undefined ? 80 : options.maxLength;\n replacer = options.replacer;\n return function _stringify(obj, currentIndent, reserved) {\n // prettier-ignore\n var end, index, items, key, keyPart, keys, length, nextIndent, prettified, start, string, value;\n if (obj && typeof obj.toJSON === \"function\") {\n obj = obj.toJSON();\n }\n string = JSON.stringify(obj, replacer);\n if (string === undefined) {\n return string;\n }\n length = maxLength - currentIndent.length - reserved;\n if (string.length <= length) {\n prettified = string.replace(stringOrChar, function (match, stringLiteral) {\n return stringLiteral || match + \" \";\n });\n if (prettified.length <= length) {\n return prettified;\n }\n }\n if (replacer != null) {\n obj = JSON.parse(string);\n replacer = undefined;\n }\n if (typeof obj === \"object\" && obj !== null) {\n nextIndent = currentIndent + indent;\n items = [];\n index = 0;\n if (Array.isArray(obj)) {\n start = \"[\";\n end = \"]\";\n length = obj.length;\n for (; index < length; index++) {\n items.push(_stringify(obj[index], nextIndent, index === length - 1 ? 0 : 1) || \"null\");\n }\n } else {\n start = \"{\";\n end = \"}\";\n keys = Object.keys(obj);\n length = keys.length;\n for (; index < length; index++) {\n key = keys[index];\n keyPart = JSON.stringify(key) + \": \";\n value = _stringify(obj[key], nextIndent, keyPart.length + (index === length - 1 ? 0 : 1));\n if (value !== undefined) {\n items.push(keyPart + value);\n }\n }\n }\n if (items.length > 0) {\n return [start, indent + items.join(\",\\n\" + nextIndent), end].join(\"\\n\" + currentIndent);\n }\n }\n return string;\n }(passedObj, \"\", 0);\n };\n var stringify$1 = /*@__PURE__*/getDefaultExportFromCjs(jsonStringifyPrettyCompact);\n\n class LRUCache {\n constructor() {\n this.max = 1000;\n this.map = new Map();\n }\n get(key) {\n const value = this.map.get(key);\n if (value === undefined) {\n return undefined;\n } else {\n // Remove the key from the map and add it to the end\n this.map.delete(key);\n this.map.set(key, value);\n return value;\n }\n }\n delete(key) {\n return this.map.delete(key);\n }\n set(key, value) {\n const deleted = this.delete(key);\n if (!deleted && value !== undefined) {\n // If cache is full, delete the least recently used item\n if (this.map.size >= this.max) {\n const firstKey = this.map.keys().next().value;\n this.delete(firstKey);\n }\n this.map.set(key, value);\n }\n return this;\n }\n }\n var lrucache = LRUCache;\n\n // parse out just the options we care about\n const looseOption = Object.freeze({\n loose: true\n });\n const emptyOpts = Object.freeze({});\n const parseOptions$1 = options => {\n if (!options) {\n return emptyOpts;\n }\n if (typeof options !== 'object') {\n return looseOption;\n }\n return options;\n };\n var parseOptions_1 = parseOptions$1;\n\n var re$1 = {exports: {}};\n\n // Note: this is the semver.org version of the spec that it implements\n // Not necessarily the package version of this code.\n const SEMVER_SPEC_VERSION = '2.0.0';\n const MAX_LENGTH$1 = 256;\n const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */9007199254740991;\n\n // Max safe segment length for coercion.\n const MAX_SAFE_COMPONENT_LENGTH = 16;\n\n // Max safe length for a build identifier. The max length minus 6 characters for\n // the shortest version with a build 0.0.0+BUILD.\n const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH$1 - 6;\n const RELEASE_TYPES = ['major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', 'prerelease'];\n var constants = {\n MAX_LENGTH: MAX_LENGTH$1,\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,\n RELEASE_TYPES,\n SEMVER_SPEC_VERSION,\n FLAG_INCLUDE_PRERELEASE: 0b001,\n FLAG_LOOSE: 0b010\n };\n\n const debug$1 = typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\\bsemver\\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error('SEMVER', ...args) : () => {};\n var debug_1 = debug$1;\n\n (function (module, exports) {\n const {\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_LENGTH\n } = constants;\n const debug = debug_1;\n exports = module.exports = {};\n\n // The actual regexps go on exports.re\n const re = exports.re = [];\n const safeRe = exports.safeRe = [];\n const src = exports.src = [];\n const t = exports.t = {};\n let R = 0;\n const LETTERDASHNUMBER = '[a-zA-Z0-9-]';\n\n // Replace some greedy regex tokens to prevent regex dos issues. These regex are\n // used internally via the safeRe object since all inputs in this library get\n // normalized first to trim and collapse all extra whitespace. The original\n // regexes are exported for userland consumption and lower level usage. A\n // future breaking change could export the safer regex only with a note that\n // all input should have extra whitespace removed.\n const safeRegexReplacements = [['\\\\s', 1], ['\\\\d', MAX_LENGTH], [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]];\n const makeSafeRegex = value => {\n for (const [token, max] of safeRegexReplacements) {\n value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);\n }\n return value;\n };\n const createToken = (name, value, isGlobal) => {\n const safe = makeSafeRegex(value);\n const index = R++;\n debug(name, index, value);\n t[name] = index;\n src[index] = value;\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined);\n safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined);\n };\n\n // The following Regular Expressions can be used for tokenizing,\n // validating, and parsing SemVer version strings.\n\n // ## Numeric Identifier\n // A single `0`, or a non-zero digit followed by zero or more digits.\n\n createToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*');\n createToken('NUMERICIDENTIFIERLOOSE', '\\\\d+');\n\n // ## Non-numeric Identifier\n // Zero or more digits, followed by a letter or hyphen, and then zero or\n // more letters, digits, or hyphens.\n\n createToken('NONNUMERICIDENTIFIER', `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);\n\n // ## Main Version\n // Three dot-separated numeric identifiers.\n\n createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` + `(${src[t.NUMERICIDENTIFIER]})\\\\.` + `(${src[t.NUMERICIDENTIFIER]})`);\n createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})`);\n\n // ## Pre-release Version Identifier\n // A numeric identifier, or a non-numeric identifier.\n\n createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);\n createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);\n\n // ## Pre-release Version\n // Hyphen, followed by one or more dot-separated pre-release version\n // identifiers.\n\n createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`);\n createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);\n\n // ## Build Metadata Identifier\n // Any combination of digits, letters, or hyphens.\n\n createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`);\n\n // ## Build Metadata\n // Plus sign, followed by one or more period-separated build metadata\n // identifiers.\n\n createToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`);\n\n // ## Full Version String\n // A main version, followed optionally by a pre-release version and\n // build metadata.\n\n // Note that the only major, minor, patch, and pre-release sections of\n // the version string are capturing groups. The build metadata is not a\n // capturing group, because it should not ever be used in version\n // comparison.\n\n createToken('FULLPLAIN', `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);\n createToken('FULL', `^${src[t.FULLPLAIN]}$`);\n\n // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n // common in the npm registry.\n createToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);\n createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`);\n createToken('GTLT', '((?:<|>)?=?)');\n\n // Something like \"2.*\" or \"1.2.x\".\n // Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n // Only the first item is strictly required.\n createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`);\n createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`);\n createToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` + `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?` + `)?)?`);\n createToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?` + `)?)?`);\n createToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`);\n createToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`);\n\n // Coercion.\n // Extract anything that could conceivably be a part of a valid semver\n createToken('COERCEPLAIN', `${'(^|[^\\\\d])' + '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);\n createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\\\d])`);\n createToken('COERCEFULL', src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?` + `(?:${src[t.BUILD]})?` + `(?:$|[^\\\\d])`);\n createToken('COERCERTL', src[t.COERCE], true);\n createToken('COERCERTLFULL', src[t.COERCEFULL], true);\n\n // Tilde ranges.\n // Meaning is \"reasonably at or greater than\"\n createToken('LONETILDE', '(?:~>?)');\n createToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true);\n exports.tildeTrimReplace = '$1~';\n createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);\n createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);\n\n // Caret ranges.\n // Meaning is \"at least and backwards compatible with\"\n createToken('LONECARET', '(?:\\\\^)');\n createToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true);\n exports.caretTrimReplace = '$1^';\n createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);\n createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);\n\n // A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\n createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`);\n createToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`);\n\n // An expression to strip any whitespace between the gtlt and the thing\n // it modifies, so that `> 1.2.3` ==> `>1.2.3`\n createToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);\n exports.comparatorTrimReplace = '$1$2$3';\n\n // Something like `1.2.3 - 1.2.4`\n // Note that these all use the loose form, because they'll be\n // checked against either the strict or loose comparator form\n // later.\n createToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` + `\\\\s+-\\\\s+` + `(${src[t.XRANGEPLAIN]})` + `\\\\s*$`);\n createToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` + `\\\\s+-\\\\s+` + `(${src[t.XRANGEPLAINLOOSE]})` + `\\\\s*$`);\n\n // Star ranges basically just allow anything at all.\n createToken('STAR', '(<|>)?=?\\\\s*\\\\*');\n // >=0.0.0 is like a star\n createToken('GTE0', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$');\n createToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$');\n })(re$1, re$1.exports);\n var reExports = re$1.exports;\n\n const numeric = /^[0-9]+$/;\n const compareIdentifiers$1 = (a, b) => {\n const anum = numeric.test(a);\n const bnum = numeric.test(b);\n if (anum && bnum) {\n a = +a;\n b = +b;\n }\n return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;\n };\n const rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a);\n var identifiers = {\n compareIdentifiers: compareIdentifiers$1,\n rcompareIdentifiers\n };\n\n const debug = debug_1;\n const {\n MAX_LENGTH,\n MAX_SAFE_INTEGER\n } = constants;\n const {\n safeRe: re,\n t\n } = reExports;\n const parseOptions = parseOptions_1;\n const {\n compareIdentifiers\n } = identifiers;\n let SemVer$1 = class SemVer {\n constructor(version, options) {\n options = parseOptions(options);\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {\n return version;\n } else {\n version = version.version;\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`);\n }\n if (version.length > MAX_LENGTH) {\n throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);\n }\n debug('SemVer', version, options);\n this.options = options;\n this.loose = !!options.loose;\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease;\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`);\n }\n this.raw = version;\n\n // these are actually numbers\n this.major = +m[1];\n this.minor = +m[2];\n this.patch = +m[3];\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version');\n }\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version');\n }\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version');\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = [];\n } else {\n this.prerelease = m[4].split('.').map(id => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id;\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num;\n }\n }\n return id;\n });\n }\n this.build = m[5] ? m[5].split('.') : [];\n this.format();\n }\n format() {\n this.version = `${this.major}.${this.minor}.${this.patch}`;\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`;\n }\n return this.version;\n }\n toString() {\n return this.version;\n }\n compare(other) {\n debug('SemVer.compare', this.version, this.options, other);\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0;\n }\n other = new SemVer(other, this.options);\n }\n if (other.version === this.version) {\n return 0;\n }\n return this.compareMain(other) || this.comparePre(other);\n }\n compareMain(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);\n }\n comparePre(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1;\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1;\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0;\n }\n let i = 0;\n do {\n const a = this.prerelease[i];\n const b = other.prerelease[i];\n debug('prerelease compare', i, a, b);\n if (a === undefined && b === undefined) {\n return 0;\n } else if (b === undefined) {\n return 1;\n } else if (a === undefined) {\n return -1;\n } else if (a === b) {\n continue;\n } else {\n return compareIdentifiers(a, b);\n }\n } while (++i);\n }\n compareBuild(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n let i = 0;\n do {\n const a = this.build[i];\n const b = other.build[i];\n debug('build compare', i, a, b);\n if (a === undefined && b === undefined) {\n return 0;\n } else if (b === undefined) {\n return 1;\n } else if (a === undefined) {\n return -1;\n } else if (a === b) {\n continue;\n } else {\n return compareIdentifiers(a, b);\n }\n } while (++i);\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc(release, identifier, identifierBase) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor = 0;\n this.major++;\n this.inc('pre', identifier, identifierBase);\n break;\n case 'preminor':\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor++;\n this.inc('pre', identifier, identifierBase);\n break;\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0;\n this.inc('patch', identifier, identifierBase);\n this.inc('pre', identifier, identifierBase);\n break;\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier, identifierBase);\n }\n this.inc('pre', identifier, identifierBase);\n break;\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {\n this.major++;\n }\n this.minor = 0;\n this.patch = 0;\n this.prerelease = [];\n break;\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++;\n }\n this.patch = 0;\n this.prerelease = [];\n break;\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++;\n }\n this.prerelease = [];\n break;\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n {\n const base = Number(identifierBase) ? 1 : 0;\n if (!identifier && identifierBase === false) {\n throw new Error('invalid increment argument: identifier is empty');\n }\n if (this.prerelease.length === 0) {\n this.prerelease = [base];\n } else {\n let i = this.prerelease.length;\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++;\n i = -2;\n }\n }\n if (i === -1) {\n // didn't increment anything\n if (identifier === this.prerelease.join('.') && identifierBase === false) {\n throw new Error('invalid increment argument: identifier already exists');\n }\n this.prerelease.push(base);\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n let prerelease = [identifier, base];\n if (identifierBase === false) {\n prerelease = [identifier];\n }\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = prerelease;\n }\n } else {\n this.prerelease = prerelease;\n }\n }\n break;\n }\n default:\n throw new Error(`invalid increment argument: ${release}`);\n }\n this.raw = this.format();\n if (this.build.length) {\n this.raw += `+${this.build.join('.')}`;\n }\n return this;\n }\n };\n var semver = SemVer$1;\n\n const SemVer = semver;\n const compare$6 = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));\n var compare_1 = compare$6;\n\n const compare$5 = compare_1;\n const eq$1 = (a, b, loose) => compare$5(a, b, loose) === 0;\n var eq_1 = eq$1;\n\n const compare$4 = compare_1;\n const neq$1 = (a, b, loose) => compare$4(a, b, loose) !== 0;\n var neq_1 = neq$1;\n\n const compare$3 = compare_1;\n const gt$1 = (a, b, loose) => compare$3(a, b, loose) > 0;\n var gt_1 = gt$1;\n\n const compare$2 = compare_1;\n const gte$1 = (a, b, loose) => compare$2(a, b, loose) >= 0;\n var gte_1 = gte$1;\n\n const compare$1 = compare_1;\n const lt$1 = (a, b, loose) => compare$1(a, b, loose) < 0;\n var lt_1 = lt$1;\n\n const compare = compare_1;\n const lte$1 = (a, b, loose) => compare(a, b, loose) <= 0;\n var lte_1 = lte$1;\n\n const eq = eq_1;\n const neq = neq_1;\n const gt = gt_1;\n const gte = gte_1;\n const lt = lt_1;\n const lte = lte_1;\n const cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object') {\n a = a.version;\n }\n if (typeof b === 'object') {\n b = b.version;\n }\n return a === b;\n case '!==':\n if (typeof a === 'object') {\n a = a.version;\n }\n if (typeof b === 'object') {\n b = b.version;\n }\n return a !== b;\n case '':\n case '=':\n case '==':\n return eq(a, b, loose);\n case '!=':\n return neq(a, b, loose);\n case '>':\n return gt(a, b, loose);\n case '>=':\n return gte(a, b, loose);\n case '<':\n return lt(a, b, loose);\n case '<=':\n return lte(a, b, loose);\n default:\n throw new TypeError(`Invalid operator: ${op}`);\n }\n };\n var cmp_1 = cmp;\n\n var comparator;\n var hasRequiredComparator;\n function requireComparator() {\n if (hasRequiredComparator) return comparator;\n hasRequiredComparator = 1;\n const ANY = Symbol('SemVer ANY');\n // hoisted class for cyclic dependency\n class Comparator {\n static get ANY() {\n return ANY;\n }\n constructor(comp, options) {\n options = parseOptions(options);\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp;\n } else {\n comp = comp.value;\n }\n }\n comp = comp.trim().split(/\\s+/).join(' ');\n debug('comparator', comp, options);\n this.options = options;\n this.loose = !!options.loose;\n this.parse(comp);\n if (this.semver === ANY) {\n this.value = '';\n } else {\n this.value = this.operator + this.semver.version;\n }\n debug('comp', this);\n }\n parse(comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];\n const m = comp.match(r);\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`);\n }\n this.operator = m[1] !== undefined ? m[1] : '';\n if (this.operator === '=') {\n this.operator = '';\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY;\n } else {\n this.semver = new SemVer(m[2], this.options.loose);\n }\n }\n toString() {\n return this.value;\n }\n test(version) {\n debug('Comparator.test', version, this.options.loose);\n if (this.semver === ANY || version === ANY) {\n return true;\n }\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options);\n } catch (er) {\n return false;\n }\n }\n return cmp(version, this.operator, this.semver, this.options);\n }\n intersects(comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required');\n }\n if (this.operator === '') {\n if (this.value === '') {\n return true;\n }\n return new Range(comp.value, options).test(this.value);\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true;\n }\n return new Range(this.value, options).test(comp.semver);\n }\n options = parseOptions(options);\n\n // Special cases where nothing can possibly be lower\n if (options.includePrerelease && (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {\n return false;\n }\n if (!options.includePrerelease && (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {\n return false;\n }\n\n // Same direction increasing (> or >=)\n if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {\n return true;\n }\n // Same direction decreasing (< or <=)\n if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {\n return true;\n }\n // same SemVer and both sides are inclusive (<= or >=)\n if (this.semver.version === comp.semver.version && this.operator.includes('=') && comp.operator.includes('=')) {\n return true;\n }\n // opposite directions less than\n if (cmp(this.semver, '<', comp.semver, options) && this.operator.startsWith('>') && comp.operator.startsWith('<')) {\n return true;\n }\n // opposite directions greater than\n if (cmp(this.semver, '>', comp.semver, options) && this.operator.startsWith('<') && comp.operator.startsWith('>')) {\n return true;\n }\n return false;\n }\n }\n comparator = Comparator;\n const parseOptions = parseOptions_1;\n const {\n safeRe: re,\n t\n } = reExports;\n const cmp = cmp_1;\n const debug = debug_1;\n const SemVer = semver;\n const Range = requireRange();\n return comparator;\n }\n\n var range;\n var hasRequiredRange;\n function requireRange() {\n if (hasRequiredRange) return range;\n hasRequiredRange = 1;\n // hoisted class for cyclic dependency\n class Range {\n constructor(range, options) {\n options = parseOptions(options);\n if (range instanceof Range) {\n if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {\n return range;\n } else {\n return new Range(range.raw, options);\n }\n }\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value;\n this.set = [[range]];\n this.format();\n return this;\n }\n this.options = options;\n this.loose = !!options.loose;\n this.includePrerelease = !!options.includePrerelease;\n\n // First reduce all whitespace as much as possible so we do not have to rely\n // on potentially slow regexes like \\s*. This is then stored and used for\n // future error messages as well.\n this.raw = range.trim().split(/\\s+/).join(' ');\n\n // First, split on ||\n this.set = this.raw.split('||')\n // map the range to a 2d array of comparators\n .map(r => this.parseRange(r.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length);\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${this.raw}`);\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0];\n this.set = this.set.filter(c => !isNullSet(c[0]));\n if (this.set.length === 0) {\n this.set = [first];\n } else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c];\n break;\n }\n }\n }\n }\n this.format();\n }\n format() {\n this.range = this.set.map(comps => comps.join(' ').trim()).join('||').trim();\n return this.range;\n }\n toString() {\n return this.range;\n }\n parseRange(range) {\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);\n const memoKey = memoOpts + ':' + range;\n const cached = cache.get(memoKey);\n if (cached) {\n return cached;\n }\n const loose = this.options.loose;\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease));\n debug('hyphen replace', range);\n\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);\n debug('comparator trim', range);\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace);\n debug('tilde trim', range);\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace);\n debug('caret trim', range);\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n let rangeList = range.split(' ').map(comp => parseComparator(comp, this.options)).join(' ').split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options));\n if (loose) {\n // in loose mode, throw out any that are not valid comparators\n rangeList = rangeList.filter(comp => {\n debug('loose invalid filter', comp, this.options);\n return !!comp.match(re[t.COMPARATORLOOSE]);\n });\n }\n debug('range list', rangeList);\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const rangeMap = new Map();\n const comparators = rangeList.map(comp => new Comparator(comp, this.options));\n for (const comp of comparators) {\n if (isNullSet(comp)) {\n return [comp];\n }\n rangeMap.set(comp.value, comp);\n }\n if (rangeMap.size > 1 && rangeMap.has('')) {\n rangeMap.delete('');\n }\n const result = [...rangeMap.values()];\n cache.set(memoKey, result);\n return result;\n }\n intersects(range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required');\n }\n return this.set.some(thisComparators => {\n return isSatisfiable(thisComparators, options) && range.set.some(rangeComparators => {\n return isSatisfiable(rangeComparators, options) && thisComparators.every(thisComparator => {\n return rangeComparators.every(rangeComparator => {\n return thisComparator.intersects(rangeComparator, options);\n });\n });\n });\n });\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test(version) {\n if (!version) {\n return false;\n }\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options);\n } catch (er) {\n return false;\n }\n }\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true;\n }\n }\n return false;\n }\n }\n range = Range;\n const LRU = lrucache;\n const cache = new LRU();\n const parseOptions = parseOptions_1;\n const Comparator = requireComparator();\n const debug = debug_1;\n const SemVer = semver;\n const {\n safeRe: re,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace\n } = reExports;\n const {\n FLAG_INCLUDE_PRERELEASE,\n FLAG_LOOSE\n } = constants;\n const isNullSet = c => c.value === '<0.0.0-0';\n const isAny = c => c.value === '';\n\n // take a set of comparators and determine whether there\n // exists a version which can satisfy it\n const isSatisfiable = (comparators, options) => {\n let result = true;\n const remainingComparators = comparators.slice();\n let testComparator = remainingComparators.pop();\n while (result && remainingComparators.length) {\n result = remainingComparators.every(otherComparator => {\n return testComparator.intersects(otherComparator, options);\n });\n testComparator = remainingComparators.pop();\n }\n return result;\n };\n\n // comprised of xranges, tildes, stars, and gtlt's at this point.\n // already replaced the hyphen ranges\n // turn into a set of JUST comparators.\n const parseComparator = (comp, options) => {\n debug('comp', comp, options);\n comp = replaceCarets(comp, options);\n debug('caret', comp);\n comp = replaceTildes(comp, options);\n debug('tildes', comp);\n comp = replaceXRanges(comp, options);\n debug('xrange', comp);\n comp = replaceStars(comp, options);\n debug('stars', comp);\n return comp;\n };\n const isX = id => !id || id.toLowerCase() === 'x' || id === '*';\n\n // ~, ~> --> * (any, kinda silly)\n // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\n // ~0.0.1 --> >=0.0.1 <0.1.0-0\n const replaceTildes = (comp, options) => {\n return comp.trim().split(/\\s+/).map(c => replaceTilde(c, options)).join(' ');\n };\n const replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr);\n let ret;\n if (isX(M)) {\n ret = '';\n } else if (isX(m)) {\n ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;\n } else if (pr) {\n debug('replaceTilde pr', pr);\n ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;\n }\n debug('tilde return', ret);\n return ret;\n });\n };\n\n // ^ --> * (any, kinda silly)\n // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n // ^1.2.3 --> >=1.2.3 <2.0.0-0\n // ^1.2.0 --> >=1.2.0 <2.0.0-0\n // ^0.0.1 --> >=0.0.1 <0.0.2-0\n // ^0.1.0 --> >=0.1.0 <0.2.0-0\n const replaceCarets = (comp, options) => {\n return comp.trim().split(/\\s+/).map(c => replaceCaret(c, options)).join(' ');\n };\n const replaceCaret = (comp, options) => {\n debug('caret', comp, options);\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];\n const z = options.includePrerelease ? '-0' : '';\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr);\n let ret;\n if (isX(M)) {\n ret = '';\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;\n }\n } else if (pr) {\n debug('replaceCaret pr', pr);\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;\n } else {\n ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;\n }\n } else {\n debug('no pr');\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;\n } else {\n ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;\n }\n } else {\n ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;\n }\n }\n debug('caret return', ret);\n return ret;\n });\n };\n const replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options);\n return comp.split(/\\s+/).map(c => replaceXRange(c, options)).join(' ');\n };\n const replaceXRange = (comp, options) => {\n comp = comp.trim();\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr);\n const xM = isX(M);\n const xm = xM || isX(m);\n const xp = xm || isX(p);\n const anyX = xp;\n if (gtlt === '=' && anyX) {\n gtlt = '';\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : '';\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0';\n } else {\n // nothing is forbidden\n ret = '*';\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0;\n }\n p = 0;\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>=';\n if (xm) {\n M = +M + 1;\n m = 0;\n p = 0;\n } else {\n m = +m + 1;\n p = 0;\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<';\n if (xm) {\n M = +M + 1;\n } else {\n m = +m + 1;\n }\n }\n if (gtlt === '<') {\n pr = '-0';\n }\n ret = `${gtlt + M}.${m}.${p}${pr}`;\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;\n }\n debug('xRange return', ret);\n return ret;\n });\n };\n\n // Because * is AND-ed with everything else in the comparator,\n // and '' means \"any version\", just remove the *s entirely.\n const replaceStars = (comp, options) => {\n debug('replaceStars', comp, options);\n // Looseness is ignored here. star is always as loose as it gets!\n return comp.trim().replace(re[t.STAR], '');\n };\n const replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options);\n return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '');\n };\n\n // This function is passed to string.replace(re[t.HYPHENRANGE])\n // M, m, patch, prerelease, build\n // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n // 1.2 - 3.4 => >=1.2.0 <3.5.0-0\n // TODO build?\n const hyphenReplace = incPr => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {\n if (isX(fM)) {\n from = '';\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`;\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`;\n } else if (fpr) {\n from = `>=${from}`;\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`;\n }\n if (isX(tM)) {\n to = '';\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`;\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`;\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`;\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`;\n } else {\n to = `<=${to}`;\n }\n return `${from} ${to}`.trim();\n };\n const testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false;\n }\n }\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver);\n if (set[i].semver === Comparator.ANY) {\n continue;\n }\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver;\n if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {\n return true;\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false;\n }\n return true;\n };\n return range;\n }\n\n const Range = requireRange();\n const satisfies = (version, range, options) => {\n try {\n range = new Range(range, options);\n } catch (er) {\n return false;\n }\n return range.test(version);\n };\n var satisfies_1 = satisfies;\n var satisfies$1 = /*@__PURE__*/getDefaultExportFromCjs(satisfies_1);\n\n function adjustSpatial(item, encode, swap) {\n let t;\n if (encode.x2) {\n if (encode.x) {\n if (swap && item.x > item.x2) {\n t = item.x;\n item.x = item.x2;\n item.x2 = t;\n }\n item.width = item.x2 - item.x;\n } else {\n item.x = item.x2 - (item.width || 0);\n }\n }\n if (encode.xc) {\n item.x = item.xc - (item.width || 0) / 2;\n }\n if (encode.y2) {\n if (encode.y) {\n if (swap && item.y > item.y2) {\n t = item.y;\n item.y = item.y2;\n item.y2 = t;\n }\n item.height = item.y2 - item.y;\n } else {\n item.y = item.y2 - (item.height || 0);\n }\n }\n if (encode.yc) {\n item.y = item.yc - (item.height || 0) / 2;\n }\n }\n var Constants = {\n NaN: NaN,\n E: Math.E,\n LN2: Math.LN2,\n LN10: Math.LN10,\n LOG2E: Math.LOG2E,\n LOG10E: Math.LOG10E,\n PI: Math.PI,\n SQRT1_2: Math.SQRT1_2,\n SQRT2: Math.SQRT2,\n MIN_VALUE: Number.MIN_VALUE,\n MAX_VALUE: Number.MAX_VALUE\n };\n var Ops = {\n '*': (a, b) => a * b,\n '+': (a, b) => a + b,\n '-': (a, b) => a - b,\n '/': (a, b) => a / b,\n '%': (a, b) => a % b,\n '>': (a, b) => a > b,\n '<': (a, b) => a < b,\n '<=': (a, b) => a <= b,\n '>=': (a, b) => a >= b,\n '==': (a, b) => a == b,\n '!=': (a, b) => a != b,\n '===': (a, b) => a === b,\n '!==': (a, b) => a !== b,\n '&': (a, b) => a & b,\n '|': (a, b) => a | b,\n '^': (a, b) => a ^ b,\n '<<': (a, b) => a << b,\n '>>': (a, b) => a >> b,\n '>>>': (a, b) => a >>> b\n };\n var Unary = {\n '+': a => +a,\n '-': a => -a,\n '~': a => ~a,\n '!': a => !a\n };\n const slice = Array.prototype.slice;\n const apply = (m, args, cast) => {\n const obj = cast ? cast(args[0]) : args[0];\n return obj[m].apply(obj, slice.call(args, 1));\n };\n const datetime = (y, m, d, H, M, S, ms) => new Date(y, m || 0, d != null ? d : 1, H || 0, M || 0, S || 0, ms || 0);\n var Functions = {\n // math functions\n isNaN: Number.isNaN,\n isFinite: Number.isFinite,\n abs: Math.abs,\n acos: Math.acos,\n asin: Math.asin,\n atan: Math.atan,\n atan2: Math.atan2,\n ceil: Math.ceil,\n cos: Math.cos,\n exp: Math.exp,\n floor: Math.floor,\n log: Math.log,\n max: Math.max,\n min: Math.min,\n pow: Math.pow,\n random: Math.random,\n round: Math.round,\n sin: Math.sin,\n sqrt: Math.sqrt,\n tan: Math.tan,\n clamp: (a, b, c) => Math.max(b, Math.min(c, a)),\n // date functions\n now: Date.now,\n utc: Date.UTC,\n datetime: datetime,\n date: d => new Date(d).getDate(),\n day: d => new Date(d).getDay(),\n year: d => new Date(d).getFullYear(),\n month: d => new Date(d).getMonth(),\n hours: d => new Date(d).getHours(),\n minutes: d => new Date(d).getMinutes(),\n seconds: d => new Date(d).getSeconds(),\n milliseconds: d => new Date(d).getMilliseconds(),\n time: d => new Date(d).getTime(),\n timezoneoffset: d => new Date(d).getTimezoneOffset(),\n utcdate: d => new Date(d).getUTCDate(),\n utcday: d => new Date(d).getUTCDay(),\n utcyear: d => new Date(d).getUTCFullYear(),\n utcmonth: d => new Date(d).getUTCMonth(),\n utchours: d => new Date(d).getUTCHours(),\n utcminutes: d => new Date(d).getUTCMinutes(),\n utcseconds: d => new Date(d).getUTCSeconds(),\n utcmilliseconds: d => new Date(d).getUTCMilliseconds(),\n // sequence functions\n length: x => x.length,\n join: function () {\n return apply('join', arguments);\n },\n indexof: function () {\n return apply('indexOf', arguments);\n },\n lastindexof: function () {\n return apply('lastIndexOf', arguments);\n },\n slice: function () {\n return apply('slice', arguments);\n },\n reverse: x => x.slice().reverse(),\n // string functions\n parseFloat: parseFloat,\n parseInt: parseInt,\n upper: x => String(x).toUpperCase(),\n lower: x => String(x).toLowerCase(),\n substring: function () {\n return apply('substring', arguments, String);\n },\n split: function () {\n return apply('split', arguments, String);\n },\n replace: function () {\n return apply('replace', arguments, String);\n },\n trim: x => String(x).trim(),\n // regexp functions\n regexp: RegExp,\n test: (r, t) => RegExp(r).test(t)\n };\n const EventFunctions = ['view', 'item', 'group', 'xy', 'x', 'y'];\n const DisallowedMethods = new Set([Function, eval, setTimeout, setInterval]);\n if (typeof setImmediate === 'function') DisallowedMethods.add(setImmediate);\n const Visitors = {\n Literal: ($, n) => n.value,\n Identifier: ($, n) => {\n const id = n.name;\n return $.memberDepth > 0 ? id : id === 'datum' ? $.datum : id === 'event' ? $.event : id === 'item' ? $.item : Constants[id] || $.params['$' + id];\n },\n MemberExpression: ($, n) => {\n const d = !n.computed,\n o = $(n.object);\n if (d) $.memberDepth += 1;\n const p = $(n.property);\n if (d) $.memberDepth -= 1;\n if (DisallowedMethods.has(o[p])) {\n // eslint-disable-next-line no-console\n console.error(`Prevented interpretation of member \"${p}\" which could lead to insecure code execution`);\n return;\n }\n return o[p];\n },\n CallExpression: ($, n) => {\n const args = n.arguments;\n let name = n.callee.name;\n\n // handle special internal functions used by encoders\n // re-route to corresponding standard function\n if (name.startsWith('_')) {\n name = name.slice(1);\n }\n\n // special case \"if\" due to conditional evaluation of branches\n return name === 'if' ? $(args[0]) ? $(args[1]) : $(args[2]) : ($.fn[name] || Functions[name]).apply($.fn, args.map($));\n },\n ArrayExpression: ($, n) => n.elements.map($),\n BinaryExpression: ($, n) => Ops[n.operator]($(n.left), $(n.right)),\n UnaryExpression: ($, n) => Unary[n.operator]($(n.argument)),\n ConditionalExpression: ($, n) => $(n.test) ? $(n.consequent) : $(n.alternate),\n LogicalExpression: ($, n) => n.operator === '&&' ? $(n.left) && $(n.right) : $(n.left) || $(n.right),\n ObjectExpression: ($, n) => n.properties.reduce((o, p) => {\n $.memberDepth += 1;\n const k = $(p.key);\n $.memberDepth -= 1;\n if (DisallowedMethods.has($(p.value))) {\n // eslint-disable-next-line no-console\n console.error(`Prevented interpretation of property \"${k}\" which could lead to insecure code execution`);\n } else {\n o[k] = $(p.value);\n }\n return o;\n }, {})\n };\n function interpret(ast, fn, params, datum, event, item) {\n const $ = n => Visitors[n.type]($, n);\n $.memberDepth = 0;\n $.fn = Object.create(fn);\n $.params = params;\n $.datum = datum;\n $.event = event;\n $.item = item;\n\n // route event functions to annotated vega event context\n EventFunctions.forEach(f => $.fn[f] = function () {\n return event.vega[f](...arguments);\n });\n return $(ast);\n }\n var expression = {\n /**\n * Parse an expression used to update an operator value.\n */\n operator(ctx, expr) {\n const ast = expr.ast,\n fn = ctx.functions;\n return _ => interpret(ast, fn, _);\n },\n /**\n * Parse an expression provided as an operator parameter value.\n */\n parameter(ctx, expr) {\n const ast = expr.ast,\n fn = ctx.functions;\n return (datum, _) => interpret(ast, fn, _, datum);\n },\n /**\n * Parse an expression applied to an event stream.\n */\n event(ctx, expr) {\n const ast = expr.ast,\n fn = ctx.functions;\n return event => interpret(ast, fn, undefined, undefined, event);\n },\n /**\n * Parse an expression used to handle an event-driven operator update.\n */\n handler(ctx, expr) {\n const ast = expr.ast,\n fn = ctx.functions;\n return (_, event) => {\n const datum = event.item && event.item.datum;\n return interpret(ast, fn, _, datum, event);\n };\n },\n /**\n * Parse an expression that performs visual encoding.\n */\n encode(ctx, encode) {\n const {\n marktype,\n channels\n } = encode,\n fn = ctx.functions,\n swap = marktype === 'group' || marktype === 'image' || marktype === 'rect';\n return (item, _) => {\n const datum = item.datum;\n let m = 0,\n v;\n for (const name in channels) {\n v = interpret(channels[name].ast, fn, _, datum, undefined, item);\n if (item[name] !== v) {\n item[name] = v;\n m = 1;\n }\n }\n if (marktype !== 'rule') {\n adjustSpatial(item, channels, swap);\n }\n return m;\n };\n }\n };\n\n function e(e) {\n const [n, r] = /schema\\/([\\w-]+)\\/([\\w\\.\\-]+)\\.json$/g.exec(e).slice(1, 3);\n return {\n library: n,\n version: r\n };\n }\n\n var name$1 = \"vega-themes\";\n var version$1$1 = \"2.15.0\";\n var description$1 = \"Themes for stylized Vega and Vega-Lite visualizations.\";\n var keywords$1 = [\"vega\", \"vega-lite\", \"themes\", \"style\"];\n var license$1 = \"BSD-3-Clause\";\n var author$1 = {\n name: \"UW Interactive Data Lab\",\n url: \"https://idl.cs.washington.edu\"\n };\n var contributors$1 = [{\n name: \"Emily Gu\",\n url: \"https://github.com/emilygu\"\n }, {\n name: \"Arvind Satyanarayan\",\n url: \"http://arvindsatya.com\"\n }, {\n name: \"Jeffrey Heer\",\n url: \"https://idl.cs.washington.edu\"\n }, {\n name: \"Dominik Moritz\",\n url: \"https://www.domoritz.de\"\n }];\n var main$1 = \"build/vega-themes.js\";\n var module$1 = \"build/vega-themes.module.js\";\n var unpkg$1 = \"build/vega-themes.min.js\";\n var jsdelivr$1 = \"build/vega-themes.min.js\";\n var types$1 = \"build/vega-themes.module.d.ts\";\n var repository$1 = {\n type: \"git\",\n url: \"https://github.com/vega/vega-themes.git\"\n };\n var files$1 = [\"src\", \"build\"];\n var scripts$1 = {\n prebuild: \"yarn clean\",\n build: \"rollup -c\",\n clean: \"rimraf build && rimraf examples/build\",\n \"copy:data\": \"rsync -r node_modules/vega-datasets/data/* examples/data\",\n \"copy:build\": \"rsync -r build/* examples/build\",\n \"deploy:gh\": \"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples\",\n preversion: \"yarn lint\",\n serve: \"browser-sync start -s -f build examples --serveStatic examples\",\n start: \"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'\",\n format: \"eslint . --fix\",\n lint: \"eslint .\",\n release: \"release-it\"\n };\n var devDependencies$1 = {\n \"@babel/core\": \"^7.24.6\",\n \"@babel/plugin-transform-runtime\": \"^7.24.6\",\n \"@babel/preset-env\": \"^7.24.6\",\n \"@babel/preset-typescript\": \"^7.24.6\",\n \"@release-it/conventional-changelog\": \"^8.0.1\",\n \"@rollup/plugin-json\": \"^6.1.0\",\n \"@rollup/plugin-node-resolve\": \"^15.2.3\",\n \"@rollup/plugin-terser\": \"^0.4.4\",\n \"@typescript-eslint/eslint-plugin\": \"^7.11.0\",\n \"@typescript-eslint/parser\": \"^7.11.0\",\n \"browser-sync\": \"^3.0.2\",\n concurrently: \"^8.2.2\",\n eslint: \"^8.45.0\",\n \"eslint-config-prettier\": \"^9.1.0\",\n \"eslint-plugin-prettier\": \"^5.1.3\",\n \"gh-pages\": \"^6.1.1\",\n prettier: \"^3.2.5\",\n \"release-it\": \"^17.3.0\",\n rollup: \"^4.18.0\",\n \"rollup-plugin-bundle-size\": \"^1.0.3\",\n \"rollup-plugin-ts\": \"^3.4.5\",\n typescript: \"^5.4.5\",\n vega: \"^5.25.0\",\n \"vega-lite\": \"^5.9.3\"\n };\n var peerDependencies$1 = {\n vega: \"*\",\n \"vega-lite\": \"*\"\n };\n var dependencies$1 = {};\n var pkg$1 = {\n name: name$1,\n version: version$1$1,\n description: description$1,\n keywords: keywords$1,\n license: license$1,\n author: author$1,\n contributors: contributors$1,\n main: main$1,\n module: module$1,\n unpkg: unpkg$1,\n jsdelivr: jsdelivr$1,\n types: types$1,\n repository: repository$1,\n files: files$1,\n scripts: scripts$1,\n devDependencies: devDependencies$1,\n peerDependencies: peerDependencies$1,\n dependencies: dependencies$1\n };\n const lightColor = '#fff';\n const medColor = '#888';\n const darkTheme = {\n background: '#333',\n view: {\n stroke: medColor\n },\n title: {\n color: lightColor,\n subtitleColor: lightColor\n },\n style: {\n 'guide-label': {\n fill: lightColor\n },\n 'guide-title': {\n fill: lightColor\n }\n },\n axis: {\n domainColor: lightColor,\n gridColor: medColor,\n tickColor: lightColor\n }\n };\n const markColor$7 = '#4572a7';\n const excelTheme = {\n background: '#fff',\n arc: {\n fill: markColor$7\n },\n area: {\n fill: markColor$7\n },\n line: {\n stroke: markColor$7,\n strokeWidth: 2\n },\n path: {\n stroke: markColor$7\n },\n rect: {\n fill: markColor$7\n },\n shape: {\n stroke: markColor$7\n },\n symbol: {\n fill: markColor$7,\n strokeWidth: 1.5,\n size: 50\n },\n axis: {\n bandPosition: 0.5,\n grid: true,\n gridColor: '#000000',\n gridOpacity: 1,\n gridWidth: 0.5,\n labelPadding: 10,\n tickSize: 5,\n tickWidth: 0.5\n },\n axisBand: {\n grid: false,\n tickExtra: true\n },\n legend: {\n labelBaseline: 'middle',\n labelFontSize: 11,\n symbolSize: 50,\n symbolType: 'square'\n },\n range: {\n category: ['#4572a7', '#aa4643', '#8aa453', '#71598e', '#4598ae', '#d98445', '#94aace', '#d09393', '#b9cc98', '#a99cbc']\n }\n };\n const markColor$6 = '#30a2da';\n const axisColor$2 = '#cbcbcb';\n const guideLabelColor = '#999';\n const guideTitleColor = '#333';\n const backgroundColor$2 = '#f0f0f0';\n const blackTitle = '#333';\n const fiveThirtyEightTheme = {\n arc: {\n fill: markColor$6\n },\n area: {\n fill: markColor$6\n },\n axis: {\n domainColor: axisColor$2,\n grid: true,\n gridColor: axisColor$2,\n gridWidth: 1,\n labelColor: guideLabelColor,\n labelFontSize: 10,\n titleColor: guideTitleColor,\n tickColor: axisColor$2,\n tickSize: 10,\n titleFontSize: 14,\n titlePadding: 10,\n labelPadding: 4\n },\n axisBand: {\n grid: false\n },\n background: backgroundColor$2,\n group: {\n fill: backgroundColor$2\n },\n legend: {\n labelColor: blackTitle,\n labelFontSize: 11,\n padding: 1,\n symbolSize: 30,\n symbolType: 'square',\n titleColor: blackTitle,\n titleFontSize: 14,\n titlePadding: 10\n },\n line: {\n stroke: markColor$6,\n strokeWidth: 2\n },\n path: {\n stroke: markColor$6,\n strokeWidth: 0.5\n },\n rect: {\n fill: markColor$6\n },\n range: {\n category: ['#30a2da', '#fc4f30', '#e5ae38', '#6d904f', '#8b8b8b', '#b96db8', '#ff9e27', '#56cc60', '#52d2ca', '#52689e', '#545454', '#9fe4f8'],\n diverging: ['#cc0020', '#e77866', '#f6e7e1', '#d6e8ed', '#91bfd9', '#1d78b5'],\n heatmap: ['#d6e8ed', '#cee0e5', '#91bfd9', '#549cc6', '#1d78b5']\n },\n point: {\n filled: true,\n shape: 'circle'\n },\n shape: {\n stroke: markColor$6\n },\n bar: {\n binSpacing: 2,\n fill: markColor$6,\n stroke: null\n },\n title: {\n anchor: 'start',\n fontSize: 24,\n fontWeight: 600,\n offset: 20\n }\n };\n const markColor$5 = '#000';\n const ggplot2Theme = {\n group: {\n fill: '#e5e5e5'\n },\n arc: {\n fill: markColor$5\n },\n area: {\n fill: markColor$5\n },\n line: {\n stroke: markColor$5\n },\n path: {\n stroke: markColor$5\n },\n rect: {\n fill: markColor$5\n },\n shape: {\n stroke: markColor$5\n },\n symbol: {\n fill: markColor$5,\n size: 40\n },\n axis: {\n domain: false,\n grid: true,\n gridColor: '#FFFFFF',\n gridOpacity: 1,\n labelColor: '#7F7F7F',\n labelPadding: 4,\n tickColor: '#7F7F7F',\n tickSize: 5.67,\n titleFontSize: 16,\n titleFontWeight: 'normal'\n },\n legend: {\n labelBaseline: 'middle',\n labelFontSize: 11,\n symbolSize: 40\n },\n range: {\n category: ['#000000', '#7F7F7F', '#1A1A1A', '#999999', '#333333', '#B0B0B0', '#4D4D4D', '#C9C9C9', '#666666', '#DCDCDC']\n }\n };\n const headlineFontSize = 22;\n const headlineFontWeight = 'normal';\n const labelFont$1 = 'Benton Gothic, sans-serif';\n const labelFontSize = 11.5;\n const labelFontWeight = 'normal';\n const markColor$4 = '#82c6df';\n // const markHighlight = '#006d8f';\n // const markDemocrat = '#5789b8';\n // const markRepublican = '#d94f54';\n const titleFont = 'Benton Gothic Bold, sans-serif';\n const titleFontWeight = 'normal';\n const titleFontSize$1 = 13;\n const colorSchemes$1 = {\n 'category-6': ['#ec8431', '#829eb1', '#c89d29', '#3580b1', '#adc839', '#ab7fb4'],\n 'fire-7': ['#fbf2c7', '#f9e39c', '#f8d36e', '#f4bb6a', '#e68a4f', '#d15a40', '#ab4232'],\n 'fireandice-6': ['#e68a4f', '#f4bb6a', '#f9e39c', '#dadfe2', '#a6b7c6', '#849eae'],\n 'ice-7': ['#edefee', '#dadfe2', '#c4ccd2', '#a6b7c6', '#849eae', '#607785', '#47525d']\n };\n const latimesTheme = {\n background: '#ffffff',\n title: {\n anchor: 'start',\n color: '#000000',\n font: titleFont,\n fontSize: headlineFontSize,\n fontWeight: headlineFontWeight\n },\n arc: {\n fill: markColor$4\n },\n area: {\n fill: markColor$4\n },\n line: {\n stroke: markColor$4,\n strokeWidth: 2\n },\n path: {\n stroke: markColor$4\n },\n rect: {\n fill: markColor$4\n },\n shape: {\n stroke: markColor$4\n },\n symbol: {\n fill: markColor$4,\n size: 30\n },\n axis: {\n labelFont: labelFont$1,\n labelFontSize,\n labelFontWeight,\n titleFont,\n titleFontSize: titleFontSize$1,\n titleFontWeight\n },\n axisX: {\n labelAngle: 0,\n labelPadding: 4,\n tickSize: 3\n },\n axisY: {\n labelBaseline: 'middle',\n maxExtent: 45,\n minExtent: 45,\n tickSize: 2,\n titleAlign: 'left',\n titleAngle: 0,\n titleX: -45,\n titleY: -11\n },\n legend: {\n labelFont: labelFont$1,\n labelFontSize,\n symbolType: 'square',\n titleFont,\n titleFontSize: titleFontSize$1,\n titleFontWeight\n },\n range: {\n category: colorSchemes$1['category-6'],\n diverging: colorSchemes$1['fireandice-6'],\n heatmap: colorSchemes$1['fire-7'],\n ordinal: colorSchemes$1['fire-7'],\n ramp: colorSchemes$1['fire-7']\n }\n };\n const markColor$3 = '#ab5787';\n const axisColor$1 = '#979797';\n const quartzTheme = {\n background: '#f9f9f9',\n arc: {\n fill: markColor$3\n },\n area: {\n fill: markColor$3\n },\n line: {\n stroke: markColor$3\n },\n path: {\n stroke: markColor$3\n },\n rect: {\n fill: markColor$3\n },\n shape: {\n stroke: markColor$3\n },\n symbol: {\n fill: markColor$3,\n size: 30\n },\n axis: {\n domainColor: axisColor$1,\n domainWidth: 0.5,\n gridWidth: 0.2,\n labelColor: axisColor$1,\n tickColor: axisColor$1,\n tickWidth: 0.2,\n titleColor: axisColor$1\n },\n axisBand: {\n grid: false\n },\n axisX: {\n grid: true,\n tickSize: 10\n },\n axisY: {\n domain: false,\n grid: true,\n tickSize: 0\n },\n legend: {\n labelFontSize: 11,\n padding: 1,\n symbolSize: 30,\n symbolType: 'square'\n },\n range: {\n category: ['#ab5787', '#51b2e5', '#703c5c', '#168dd9', '#d190b6', '#00609f', '#d365ba', '#154866', '#666666', '#c4c4c4']\n }\n };\n const markColor$2 = '#3e5c69';\n const voxTheme = {\n background: '#fff',\n arc: {\n fill: markColor$2\n },\n area: {\n fill: markColor$2\n },\n line: {\n stroke: markColor$2\n },\n path: {\n stroke: markColor$2\n },\n rect: {\n fill: markColor$2\n },\n shape: {\n stroke: markColor$2\n },\n symbol: {\n fill: markColor$2\n },\n axis: {\n domainWidth: 0.5,\n grid: true,\n labelPadding: 2,\n tickSize: 5,\n tickWidth: 0.5,\n titleFontWeight: 'normal'\n },\n axisBand: {\n grid: false\n },\n axisX: {\n gridWidth: 0.2\n },\n axisY: {\n gridDash: [3],\n gridWidth: 0.4\n },\n legend: {\n labelFontSize: 11,\n padding: 1,\n symbolType: 'square'\n },\n range: {\n category: ['#3e5c69', '#6793a6', '#182429', '#0570b0', '#3690c0', '#74a9cf', '#a6bddb', '#e2ddf2']\n }\n };\n const markColor$1 = '#1696d2';\n const axisColor = '#000000';\n const backgroundColor$1 = '#FFFFFF';\n const font = 'Lato';\n const labelFont = 'Lato';\n const sourceFont = 'Lato';\n const gridColor$1 = '#DEDDDD';\n const titleFontSize = 18;\n const colorSchemes = {\n 'main-colors': ['#1696d2', '#d2d2d2', '#000000', '#fdbf11', '#ec008b', '#55b748', '#5c5859', '#db2b27'],\n 'shades-blue': ['#CFE8F3', '#A2D4EC', '#73BFE2', '#46ABDB', '#1696D2', '#12719E', '#0A4C6A', '#062635'],\n 'shades-gray': ['#F5F5F5', '#ECECEC', '#E3E3E3', '#DCDBDB', '#D2D2D2', '#9D9D9D', '#696969', '#353535'],\n 'shades-yellow': ['#FFF2CF', '#FCE39E', '#FDD870', '#FCCB41', '#FDBF11', '#E88E2D', '#CA5800', '#843215'],\n 'shades-magenta': ['#F5CBDF', '#EB99C2', '#E46AA7', '#E54096', '#EC008B', '#AF1F6B', '#761548', '#351123'],\n 'shades-green': ['#DCEDD9', '#BCDEB4', '#98CF90', '#78C26D', '#55B748', '#408941', '#2C5C2D', '#1A2E19'],\n 'shades-black': ['#D5D5D4', '#ADABAC', '#848081', '#5C5859', '#332D2F', '#262223', '#1A1717', '#0E0C0D'],\n 'shades-red': ['#F8D5D4', '#F1AAA9', '#E9807D', '#E25552', '#DB2B27', '#A4201D', '#6E1614', '#370B0A'],\n 'one-group': ['#1696d2', '#000000'],\n 'two-groups-cat-1': ['#1696d2', '#000000'],\n 'two-groups-cat-2': ['#1696d2', '#fdbf11'],\n 'two-groups-cat-3': ['#1696d2', '#db2b27'],\n 'two-groups-seq': ['#a2d4ec', '#1696d2'],\n 'three-groups-cat': ['#1696d2', '#fdbf11', '#000000'],\n 'three-groups-seq': ['#a2d4ec', '#1696d2', '#0a4c6a'],\n 'four-groups-cat-1': ['#000000', '#d2d2d2', '#fdbf11', '#1696d2'],\n 'four-groups-cat-2': ['#1696d2', '#ec0008b', '#fdbf11', '#5c5859'],\n 'four-groups-seq': ['#cfe8f3', '#73bf42', '#1696d2', '#0a4c6a'],\n 'five-groups-cat-1': ['#1696d2', '#fdbf11', '#d2d2d2', '#ec008b', '#000000'],\n 'five-groups-cat-2': ['#1696d2', '#0a4c6a', '#d2d2d2', '#fdbf11', '#332d2f'],\n 'five-groups-seq': ['#cfe8f3', '#73bf42', '#1696d2', '#0a4c6a', '#000000'],\n 'six-groups-cat-1': ['#1696d2', '#ec008b', '#fdbf11', '#000000', '#d2d2d2', '#55b748'],\n 'six-groups-cat-2': ['#1696d2', '#d2d2d2', '#ec008b', '#fdbf11', '#332d2f', '#0a4c6a'],\n 'six-groups-seq': ['#cfe8f3', '#a2d4ec', '#73bfe2', '#46abdb', '#1696d2', '#12719e'],\n 'diverging-colors': ['#ca5800', '#fdbf11', '#fdd870', '#fff2cf', '#cfe8f3', '#73bfe2', '#1696d2', '#0a4c6a']\n };\n const urbanInstituteTheme = {\n background: backgroundColor$1,\n title: {\n anchor: 'start',\n fontSize: titleFontSize,\n font: font\n },\n axisX: {\n domain: true,\n domainColor: axisColor,\n domainWidth: 1,\n grid: false,\n labelFontSize: 12,\n labelFont: labelFont,\n labelAngle: 0,\n tickColor: axisColor,\n tickSize: 5,\n titleFontSize: 12,\n titlePadding: 10,\n titleFont: font\n },\n axisY: {\n domain: false,\n domainWidth: 1,\n grid: true,\n gridColor: gridColor$1,\n gridWidth: 1,\n labelFontSize: 12,\n labelFont: labelFont,\n labelPadding: 8,\n ticks: false,\n titleFontSize: 12,\n titlePadding: 10,\n titleFont: font,\n titleAngle: 0,\n titleY: -10,\n titleX: 18\n },\n legend: {\n labelFontSize: 12,\n labelFont: labelFont,\n symbolSize: 100,\n titleFontSize: 12,\n titlePadding: 10,\n titleFont: font,\n orient: 'right',\n offset: 10\n },\n view: {\n stroke: 'transparent'\n },\n range: {\n category: colorSchemes['six-groups-cat-1'],\n diverging: colorSchemes['diverging-colors'],\n heatmap: colorSchemes['diverging-colors'],\n ordinal: colorSchemes['six-groups-seq'],\n ramp: colorSchemes['shades-blue']\n },\n area: {\n fill: markColor$1\n },\n rect: {\n fill: markColor$1\n },\n line: {\n color: markColor$1,\n stroke: markColor$1,\n strokeWidth: 5\n },\n trail: {\n color: markColor$1,\n stroke: markColor$1,\n strokeWidth: 0,\n size: 1\n },\n path: {\n stroke: markColor$1,\n strokeWidth: 0.5\n },\n point: {\n filled: true\n },\n text: {\n font: sourceFont,\n color: markColor$1,\n fontSize: 11,\n align: 'center',\n fontWeight: 400,\n size: 11\n },\n style: {\n bar: {\n fill: markColor$1,\n stroke: null\n }\n },\n arc: {\n fill: markColor$1\n },\n shape: {\n stroke: markColor$1\n },\n symbol: {\n fill: markColor$1,\n size: 30\n }\n };\n\n /**\n * Copyright 2020 Google LLC.\n *\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file or at\n * https://developers.google.com/open-source/licenses/bsd\n */\n\n const markColor = '#3366CC';\n const gridColor = '#ccc';\n const defaultFont$1 = 'Arial, sans-serif';\n const googlechartsTheme = {\n arc: {\n fill: markColor\n },\n area: {\n fill: markColor\n },\n path: {\n stroke: markColor\n },\n rect: {\n fill: markColor\n },\n shape: {\n stroke: markColor\n },\n symbol: {\n stroke: markColor\n },\n circle: {\n fill: markColor\n },\n background: '#fff',\n padding: {\n top: 10,\n right: 10,\n bottom: 10,\n left: 10\n },\n style: {\n 'guide-label': {\n font: defaultFont$1,\n fontSize: 12\n },\n 'guide-title': {\n font: defaultFont$1,\n fontSize: 12\n },\n 'group-title': {\n font: defaultFont$1,\n fontSize: 12\n }\n },\n title: {\n font: defaultFont$1,\n fontSize: 14,\n fontWeight: 'bold',\n dy: -3,\n anchor: 'start'\n },\n axis: {\n gridColor: gridColor,\n tickColor: gridColor,\n domain: false,\n grid: true\n },\n range: {\n category: ['#4285F4', '#DB4437', '#F4B400', '#0F9D58', '#AB47BC', '#00ACC1', '#FF7043', '#9E9D24', '#5C6BC0', '#F06292', '#00796B', '#C2185B'],\n heatmap: ['#c6dafc', '#5e97f6', '#2a56c6']\n }\n };\n const ptToPx = value => value * (1 / 3 + 1);\n const fontSmallPx = ptToPx(9);\n const legendFontPx = ptToPx(10);\n const fontLargePx = ptToPx(12);\n const fontStandard = 'Segoe UI';\n const fontTitle = 'wf_standard-font, helvetica, arial, sans-serif';\n const firstLevelElementColor = '#252423';\n const secondLevelElementColor = '#605E5C';\n const backgroundColor = 'transparent';\n const backgroundSecondaryColor = '#C8C6C4';\n const paletteColor1 = '#118DFF';\n const paletteColor2 = '#12239E';\n const paletteColor3 = '#E66C37';\n const paletteColor4 = '#6B007B';\n const paletteColor5 = '#E044A7';\n const paletteColor6 = '#744EC2';\n const paletteColor7 = '#D9B300';\n const paletteColor8 = '#D64550';\n const divergentColorMax = paletteColor1;\n const divergentColorMin = '#DEEFFF';\n const divergentPalette = [divergentColorMin, divergentColorMax];\n const ordinalPalette = [divergentColorMin, '#c7e4ff', '#b0d9ff', '#9aceff', '#83c3ff', '#6cb9ff', '#55aeff', '#3fa3ff', '#2898ff', divergentColorMax];\n const powerbiTheme = {\n view: {\n stroke: backgroundColor\n },\n background: backgroundColor,\n font: fontStandard,\n header: {\n titleFont: fontTitle,\n titleFontSize: fontLargePx,\n titleColor: firstLevelElementColor,\n labelFont: fontStandard,\n labelFontSize: legendFontPx,\n labelColor: secondLevelElementColor\n },\n axis: {\n ticks: false,\n grid: false,\n domain: false,\n labelColor: secondLevelElementColor,\n labelFontSize: fontSmallPx,\n titleFont: fontTitle,\n titleColor: firstLevelElementColor,\n titleFontSize: fontLargePx,\n titleFontWeight: 'normal'\n },\n axisQuantitative: {\n tickCount: 3,\n grid: true,\n gridColor: backgroundSecondaryColor,\n gridDash: [1, 5],\n labelFlush: false\n },\n axisBand: {\n tickExtra: true\n },\n axisX: {\n labelPadding: 5\n },\n axisY: {\n labelPadding: 10\n },\n bar: {\n fill: paletteColor1\n },\n line: {\n stroke: paletteColor1,\n strokeWidth: 3,\n strokeCap: 'round',\n strokeJoin: 'round'\n },\n text: {\n font: fontStandard,\n fontSize: fontSmallPx,\n fill: secondLevelElementColor\n },\n arc: {\n fill: paletteColor1\n },\n area: {\n fill: paletteColor1,\n line: true,\n opacity: 0.6\n },\n path: {\n stroke: paletteColor1\n },\n rect: {\n fill: paletteColor1\n },\n point: {\n fill: paletteColor1,\n filled: true,\n size: 75\n },\n shape: {\n stroke: paletteColor1\n },\n symbol: {\n fill: paletteColor1,\n strokeWidth: 1.5,\n size: 50\n },\n legend: {\n titleFont: fontStandard,\n titleFontWeight: 'bold',\n titleColor: secondLevelElementColor,\n labelFont: fontStandard,\n labelFontSize: legendFontPx,\n labelColor: secondLevelElementColor,\n symbolType: 'circle',\n symbolSize: 75\n },\n range: {\n category: [paletteColor1, paletteColor2, paletteColor3, paletteColor4, paletteColor5, paletteColor6, paletteColor7, paletteColor8],\n diverging: divergentPalette,\n heatmap: divergentPalette,\n ordinal: ordinalPalette\n }\n };\n const defaultFont = 'IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,\".sfnstext-regular\",sans-serif';\n const condensedFont = 'IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, \".SFNSText-Regular\", sans-serif';\n const fontWeight = 400;\n const TOKENS = {\n textPrimary: {\n g90: '#f4f4f4',\n g100: '#f4f4f4',\n white: '#161616',\n g10: '#161616'\n },\n textSecondary: {\n g90: '#c6c6c6',\n g100: '#c6c6c6',\n white: '#525252',\n g10: '#525252'\n },\n // layer\n layerAccent01: {\n white: '#e0e0e0',\n g10: '#e0e0e0',\n g90: '#525252',\n g100: '#393939'\n },\n // grid\n gridBg: {\n white: '#ffffff',\n g10: '#ffffff',\n g90: '#161616',\n g100: '#161616'\n }\n };\n const darkCategories = ['#8a3ffc', '#33b1ff', '#007d79', '#ff7eb6', '#fa4d56', '#fff1f1', '#6fdc8c', '#4589ff', '#d12771', '#d2a106', '#08bdba', '#bae6ff', '#ba4e00', '#d4bbff'];\n const lightCategories = ['#6929c4', '#1192e8', '#005d5d', '#9f1853', '#fa4d56', '#570408', '#198038', '#002d9c', '#ee538b', '#b28600', '#009d9a', '#012749', '#8a3800', '#a56eff'];\n function genCarbonConfig({\n theme,\n background\n }) {\n const type = ['white', 'g10'].includes(theme) ? 'light' : 'dark';\n const viewbg = TOKENS.gridBg[theme];\n const titleColor = TOKENS.textPrimary[theme];\n const textColor = TOKENS.textSecondary[theme];\n const category = type === 'dark' ? darkCategories : lightCategories;\n const markColor = type === 'dark' ? '#d4bbff' : '#6929c4';\n return {\n background,\n arc: {\n fill: markColor\n },\n area: {\n fill: markColor\n },\n path: {\n stroke: markColor\n },\n rect: {\n fill: markColor\n },\n shape: {\n stroke: markColor\n },\n symbol: {\n stroke: markColor\n },\n circle: {\n fill: markColor\n },\n view: {\n fill: viewbg,\n stroke: viewbg\n },\n group: {\n fill: viewbg\n },\n title: {\n color: titleColor,\n anchor: 'start',\n dy: -15,\n fontSize: 16,\n font: defaultFont,\n fontWeight: 600\n },\n axis: {\n // Axis labels\n labelColor: textColor,\n labelFontSize: 12,\n labelFont: condensedFont,\n labelFontWeight: fontWeight,\n // Axis titles\n titleColor: titleColor,\n titleFontWeight: 600,\n titleFontSize: 12,\n // MISC\n grid: true,\n gridColor: TOKENS.layerAccent01[theme],\n labelAngle: 0\n },\n axisX: {\n titlePadding: 10\n },\n axisY: {\n titlePadding: 2.5\n },\n style: {\n 'guide-label': {\n font: defaultFont,\n fill: textColor,\n fontWeight: fontWeight\n },\n 'guide-title': {\n font: defaultFont,\n fill: textColor,\n fontWeight: fontWeight\n }\n },\n range: {\n category,\n diverging: ['#750e13', '#a2191f', '#da1e28', '#fa4d56', '#ff8389', '#ffb3b8', '#ffd7d9', '#fff1f1', '#e5f6ff', '#bae6ff', '#82cfff', '#33b1ff', '#1192e8', '#0072c3', '#00539a', '#003a6d'],\n heatmap: ['#f6f2ff', '#e8daff', '#d4bbff', '#be95ff', '#a56eff', '#8a3ffc', '#6929c4', '#491d8b', '#31135e', '#1c0f30']\n }\n };\n }\n const carbonwhite = genCarbonConfig({\n theme: 'white',\n background: '#ffffff'\n });\n const carbong10 = genCarbonConfig({\n theme: 'g10',\n background: '#f4f4f4'\n });\n const carbong90 = genCarbonConfig({\n theme: 'g90',\n background: '#262626'\n });\n const carbong100 = genCarbonConfig({\n theme: 'g100',\n background: '#161616'\n });\n const version$2 = pkg$1.version;\n\n var themes = /*#__PURE__*/Object.freeze({\n __proto__: null,\n carbong10: carbong10,\n carbong100: carbong100,\n carbong90: carbong90,\n carbonwhite: carbonwhite,\n dark: darkTheme,\n excel: excelTheme,\n fivethirtyeight: fiveThirtyEightTheme,\n ggplot2: ggplot2Theme,\n googlecharts: googlechartsTheme,\n latimes: latimesTheme,\n powerbi: powerbiTheme,\n quartz: quartzTheme,\n urbaninstitute: urbanInstituteTheme,\n version: version$2,\n vox: voxTheme\n });\n\n function accessor(fn, fields, name) {\n fn.fields = fields || [];\n fn.fname = name;\n return fn;\n }\n function getter(path) {\n return path.length === 1 ? get1(path[0]) : getN(path);\n }\n const get1 = field => function (obj) {\n return obj[field];\n };\n const getN = path => {\n const len = path.length;\n return function (obj) {\n for (let i = 0; i < len; ++i) {\n obj = obj[path[i]];\n }\n return obj;\n };\n };\n function error(message) {\n throw Error(message);\n }\n function splitAccessPath(p) {\n const path = [],\n n = p.length;\n let q = null,\n b = 0,\n s = '',\n i,\n j,\n c;\n p = p + '';\n function push() {\n path.push(s + p.substring(i, j));\n s = '';\n i = j + 1;\n }\n for (i = j = 0; j < n; ++j) {\n c = p[j];\n if (c === '\\\\') {\n s += p.substring(i, j++);\n i = j;\n } else if (c === q) {\n push();\n q = null;\n b = -1;\n } else if (q) {\n continue;\n } else if (i === b && c === '\"') {\n i = j + 1;\n q = c;\n } else if (i === b && c === \"'\") {\n i = j + 1;\n q = c;\n } else if (c === '.' && !b) {\n if (j > i) {\n push();\n } else {\n i = j + 1;\n }\n } else if (c === '[') {\n if (j > i) push();\n b = i = j + 1;\n } else if (c === ']') {\n if (!b) error('Access path missing open bracket: ' + p);\n if (b > 0) push();\n b = 0;\n i = j + 1;\n }\n }\n if (b) error('Access path missing closing bracket: ' + p);\n if (q) error('Access path missing closing quote: ' + p);\n if (j > i) {\n j++;\n push();\n }\n return path;\n }\n function field(field, name, opt) {\n const path = splitAccessPath(field);\n field = path.length === 1 ? path[0] : field;\n return accessor((getter)(path), [field], field);\n }\n field('id');\n accessor(_ => _, [], 'identity');\n accessor(() => 0, [], 'zero');\n accessor(() => 1, [], 'one');\n accessor(() => true, [], 'true');\n accessor(() => false, [], 'false');\n var isArray = Array.isArray;\n function isObject(_) {\n return _ === Object(_);\n }\n function isString(_) {\n return typeof _ === 'string';\n }\n\n /**\n * Format the value to be shown in the tooltip.\n *\n * @param value The value to show in the tooltip.\n * @param valueToHtml Function to convert a single cell value to an HTML string\n */\n function formatValue(value, valueToHtml, maxDepth, baseURL) {\n if (isArray(value)) {\n return `[${value.map(v => valueToHtml(isString(v) ? v : stringify(v, maxDepth))).join(', ')}]`;\n }\n if (isObject(value)) {\n let content = '';\n const {\n title,\n image,\n ...rest\n } = value;\n if (title) {\n content += `

${valueToHtml(title)}

`;\n }\n if (image) {\n content += ``;\n }\n const keys = Object.keys(rest);\n if (keys.length > 0) {\n content += '';\n for (const key of keys) {\n let val = rest[key];\n\n // ignore undefined properties\n if (val === undefined) {\n continue;\n }\n if (isObject(val)) {\n val = stringify(val, maxDepth);\n }\n content += ``;\n }\n content += `
${valueToHtml(key)}${valueToHtml(val)}
`;\n }\n return content || '{}'; // show empty object if there are no properties\n }\n return valueToHtml(value);\n }\n function replacer(maxDepth) {\n const stack = [];\n return function (key, value) {\n if (typeof value !== 'object' || value === null) {\n return value;\n }\n const pos = stack.indexOf(this) + 1;\n stack.length = pos;\n if (stack.length > maxDepth) {\n return '[Object]';\n }\n if (stack.indexOf(value) >= 0) {\n return '[Circular]';\n }\n stack.push(value);\n return value;\n };\n }\n\n /**\n * Stringify any JS object to valid JSON\n */\n function stringify(obj, maxDepth) {\n return JSON.stringify(obj, replacer(maxDepth));\n }\n\n // generated with build-style.sh\n var defaultStyle = `#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black;\n}\n#vg-tooltip-element.visible {\n visibility: visible;\n}\n#vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px;\n}\n#vg-tooltip-element table {\n border-spacing: 0;\n}\n#vg-tooltip-element table tr {\n border: none;\n}\n#vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px;\n}\n#vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px;\n}\n#vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left;\n}\n#vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white;\n}\n#vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf;\n}\n`;\n const EL_ID = 'vg-tooltip-element';\n const DEFAULT_OPTIONS = {\n /**\n * X offset.\n */\n offsetX: 10,\n /**\n * Y offset.\n */\n offsetY: 10,\n /**\n * ID of the tooltip element.\n */\n id: EL_ID,\n /**\n * ID of the tooltip CSS style.\n */\n styleId: 'vega-tooltip-style',\n /**\n * The name of the theme. You can use the CSS class called [THEME]-theme to style the tooltips.\n *\n * There are two predefined themes: \"light\" (default) and \"dark\".\n */\n theme: 'light',\n /**\n * Do not use the default styles provided by Vega Tooltip. If you enable this option, you need to use your own styles. It is not necessary to disable the default style when using a custom theme.\n */\n disableDefaultStyle: false,\n /**\n * HTML sanitizer function that removes dangerous HTML to prevent XSS.\n *\n * This should be a function from string to string. You may replace it with a formatter such as a markdown formatter.\n */\n sanitize: escapeHTML,\n /**\n * The maximum recursion depth when printing objects in the tooltip.\n */\n maxDepth: 2,\n /**\n * A function to customize the rendered HTML of the tooltip.\n * @param value A value string, or object of value strings keyed by field\n * @param sanitize The `sanitize` function from `options.sanitize`\n * @param baseURL The `baseURL` from `options.baseURL`\n * @returns {string} The returned string will become the `innerHTML` of the tooltip element\n */\n formatTooltip: formatValue,\n /**\n * The baseurl to use in image paths.\n */\n baseURL: ''\n };\n /**\n * Escape special HTML characters.\n *\n * @param value A value to convert to string and HTML-escape.\n */\n function escapeHTML(value) {\n return String(value).replace(/&/g, '&').replace(/ window.innerWidth) {\n x = +event.clientX - offsetX - tooltipBox.width;\n }\n let y = event.clientY + offsetY;\n if (y + tooltipBox.height > window.innerHeight) {\n y = +event.clientY - offsetY - tooltipBox.height;\n }\n return {\n x,\n y\n };\n }\n\n /**\n * The tooltip handler class.\n */\n class Handler {\n /**\n * The handler function. We bind this to this function in the constructor.\n */\n\n /**\n * Complete tooltip options.\n */\n\n /**\n * The tooltip html element.\n */\n\n /**\n * Create the tooltip handler and initialize the element and style.\n *\n * @param options Tooltip Options\n */\n constructor(options) {\n this.options = {\n ...DEFAULT_OPTIONS,\n ...options\n };\n const elementId = this.options.id;\n this.el = null;\n\n // bind this to call\n this.call = this.tooltipHandler.bind(this);\n\n // prepend a default stylesheet for tooltips to the head\n if (!this.options.disableDefaultStyle && !document.getElementById(this.options.styleId)) {\n const style = document.createElement('style');\n style.setAttribute('id', this.options.styleId);\n style.innerHTML = createDefaultStyle(elementId);\n const head = document.head;\n if (head.childNodes.length > 0) {\n head.insertBefore(style, head.childNodes[0]);\n } else {\n head.appendChild(style);\n }\n }\n }\n\n /**\n * The tooltip handler function.\n */\n tooltipHandler(handler, event, item, value) {\n // console.log(handler, event, item, value);\n\n // append a div element that we use as a tooltip unless it already exists\n this.el = document.getElementById(this.options.id);\n if (!this.el) {\n this.el = document.createElement('div');\n this.el.setAttribute('id', this.options.id);\n this.el.classList.add('vg-tooltip');\n const tooltipContainer = document.fullscreenElement ?? document.body;\n tooltipContainer.appendChild(this.el);\n }\n\n // hide tooltip for null, undefined, or empty string values\n if (value == null || value === '') {\n this.el.classList.remove('visible', `${this.options.theme}-theme`);\n return;\n }\n\n // set the tooltip content\n this.el.innerHTML = this.options.formatTooltip(value, this.options.sanitize, this.options.maxDepth, this.options.baseURL);\n\n // make the tooltip visible\n this.el.classList.add('visible', `${this.options.theme}-theme`);\n const {\n x,\n y\n } = calculatePosition(event, this.el.getBoundingClientRect(), this.options.offsetX, this.options.offsetY);\n this.el.style.top = `${y}px`;\n this.el.style.left = `${x}px`;\n }\n }\n\n /**\n * Open editor url in a new window, and pass a message.\n */\n function post (window, url, data) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const editor = window.open(url);\n const wait = 10_000;\n const step = 250;\n const {\n origin\n } = new URL(url);\n // eslint-disable-next-line no-bitwise\n let count = ~~(wait / step);\n function listen(evt) {\n if (evt.source === editor) {\n count = 0;\n window.removeEventListener('message', listen, false);\n }\n }\n window.addEventListener('message', listen, false);\n\n // send message\n // periodically resend until ack received or timeout\n function send() {\n if (count <= 0) {\n return;\n }\n editor.postMessage(data, origin);\n setTimeout(send, step);\n count -= 1;\n }\n setTimeout(send, step);\n }\n\n // generated with build-style.sh\n var embedStyle = `.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box;\n}\n.vega-embed.has-actions {\n padding-right: 38px;\n}\n.vega-embed details:not([open]) > :not(summary) {\n display: none !important;\n}\n.vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n cursor: pointer;\n line-height: 0px;\n}\n.vega-embed summary::-webkit-details-marker {\n display: none;\n}\n.vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset;\n}\n.vega-embed summary svg {\n width: 14px;\n height: 14px;\n}\n.vega-embed details[open] summary {\n opacity: 0.7;\n}\n.vega-embed:hover summary, .vega-embed:focus-within summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease;\n}\n.vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left;\n}\n.vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none;\n}\n.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {\n background-color: #f7f7f9;\n color: black;\n}\n.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: \"\";\n display: inline-block;\n position: absolute;\n}\n.vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid rgba(0, 0, 0, 0);\n border-bottom-color: #d9d9d9;\n}\n.vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid rgba(0, 0, 0, 0);\n border-bottom-color: #fff;\n}\n.vega-embed .chart-wrapper.fit-x {\n width: 100%;\n}\n.vega-embed .chart-wrapper.fit-y {\n height: 100%;\n}\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: auto;\n padding-right: 14px;\n}\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n`;\n\n function isURL(s) {\n return s.startsWith('http://') || s.startsWith('https://') || s.startsWith('//');\n }\n function mergeDeep(dest, ...src) {\n for (const s of src) {\n deepMerge_(dest, s);\n }\n return dest;\n }\n function deepMerge_(dest, src) {\n for (const property of Object.keys(src)) {\n vegaImport.writeConfig(dest, property, src[property], true);\n }\n }\n\n var name = \"vega-embed\";\n var version$1 = \"6.26.0\";\n var description = \"Publish Vega visualizations as embedded web components.\";\n var keywords = [\"vega\", \"data\", \"visualization\", \"component\", \"embed\"];\n var repository = {\n type: \"git\",\n url: \"http://github.com/vega/vega-embed.git\"\n };\n var author = {\n name: \"UW Interactive Data Lab\",\n url: \"http://idl.cs.washington.edu\"\n };\n var contributors = [{\n name: \"Dominik Moritz\",\n url: \"https://www.domoritz.de\"\n }];\n var bugs = {\n url: \"https://github.com/vega/vega-embed/issues\"\n };\n var homepage = \"https://github.com/vega/vega-embed#readme\";\n var license = \"BSD-3-Clause\";\n var main = \"build/vega-embed.js\";\n var module = \"build/vega-embed.module.js\";\n var unpkg = \"build/vega-embed.min.js\";\n var jsdelivr = \"build/vega-embed.min.js\";\n var types = \"build/vega-embed.module.d.ts\";\n var files = [\"src\", \"build\"];\n var exports$1 = {\n \".\": {\n \"import\": {\n types: \"./build/vega-embed.module.d.ts\",\n \"default\": \"./build/vega-embed.module.js\"\n },\n require: {\n \"default\": \"./build/vega-embed.js\"\n }\n }\n };\n var devDependencies = {\n \"@babel/core\": \"^7.24.7\",\n \"@babel/eslint-parser\": \"^7.24.7\",\n \"@babel/plugin-transform-runtime\": \"^7.24.7\",\n \"@babel/preset-env\": \"^7.24.7\",\n \"@babel/preset-typescript\": \"^7.24.7\",\n \"@release-it/conventional-changelog\": \"^8.0.1\",\n \"@rollup/plugin-commonjs\": \"26.0.1\",\n \"@rollup/plugin-json\": \"^6.1.0\",\n \"@rollup/plugin-node-resolve\": \"^15.2.3\",\n \"@rollup/plugin-terser\": \"^0.4.4\",\n \"@types/semver\": \"^7.5.8\",\n \"@typescript-eslint/parser\": \"^7.15.0\",\n \"@vitest/coverage-v8\": \"^1.6.0\",\n \"browser-sync\": \"^3.0.2\",\n concurrently: \"^8.2.2\",\n \"del-cli\": \"^5.1.0\",\n eslint: \"^9.6.0\",\n \"eslint-config-prettier\": \"^9.1.0\",\n \"eslint-plugin-prettier\": \"^5.1.3\",\n \"eslint-plugin-vitest\": \"^0.5.4\",\n jsdom: \"^24.1.0\",\n \"postinstall-postinstall\": \"^2.1.0\",\n prettier: \"^3.3.2\",\n \"release-it\": \"^17.4.1\",\n rollup: \"4.18.0\",\n \"rollup-plugin-bundle-size\": \"^1.0.3\",\n \"rollup-plugin-ts\": \"^3.4.5\",\n sass: \"^1.77.6\",\n typescript: \"^5.5.3\",\n \"typescript-eslint\": \"^7.15.0\",\n vega: \"^5.30.0\",\n \"vega-lite\": \"^5.19.0\",\n vitest: \"^1.6.0\",\n \"vitest-canvas-mock\": \"^0.3.3\"\n };\n var peerDependencies = {\n vega: \"^5.21.0\",\n \"vega-lite\": \"*\"\n };\n var dependencies = {\n \"fast-json-patch\": \"^3.1.1\",\n \"json-stringify-pretty-compact\": \"^3.0.0\",\n semver: \"^7.6.2\",\n tslib: \"^2.6.3\",\n \"vega-interpreter\": \"^1.0.5\",\n \"vega-schema-url-parser\": \"^2.2.0\",\n \"vega-themes\": \"^2.15.0\",\n \"vega-tooltip\": \"^0.34.0\"\n };\n var scripts = {\n prebuild: \"yarn clean && yarn build:style\",\n build: \"rollup -c\",\n \"build:style\": \"./build-style.sh\",\n clean: \"del-cli build src/style.ts\",\n prepublishOnly: \"yarn clean && yarn build\",\n preversion: \"yarn lint && yarn test\",\n serve: \"browser-sync start --directory -s -f build *.html\",\n start: \"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'\",\n pretest: \"yarn build:style\",\n test: \"vitest run\",\n prettierbase: \"prettier '*.{css,scss,html}'\",\n format: \"eslint . --fix && yarn prettierbase --write\",\n lint: \"eslint . && yarn prettierbase --check\",\n release: \"release-it\"\n };\n var pkg = {\n name: name,\n version: version$1,\n description: description,\n keywords: keywords,\n repository: repository,\n author: author,\n contributors: contributors,\n bugs: bugs,\n homepage: homepage,\n license: license,\n main: main,\n module: module,\n unpkg: unpkg,\n jsdelivr: jsdelivr,\n types: types,\n files: files,\n exports: exports$1,\n devDependencies: devDependencies,\n peerDependencies: peerDependencies,\n dependencies: dependencies,\n scripts: scripts\n };\n\n const version = pkg.version;\n const vega = vegaImport__namespace;\n let vegaLite = vegaLiteImport__namespace;\n\n // For backwards compatibility with Vega-Lite before v4.\n const w = typeof window !== 'undefined' ? window : undefined;\n if (vegaLite === undefined && w?.vl?.compile) {\n vegaLite = w.vl;\n }\n const DEFAULT_ACTIONS = {\n export: {\n svg: true,\n png: true\n },\n source: true,\n compiled: true,\n editor: true\n };\n const I18N = {\n CLICK_TO_VIEW_ACTIONS: 'Click to view actions',\n COMPILED_ACTION: 'View Compiled Vega',\n EDITOR_ACTION: 'Open in Vega Editor',\n PNG_ACTION: 'Save as PNG',\n SOURCE_ACTION: 'View Source',\n SVG_ACTION: 'Save as SVG'\n };\n const NAMES = {\n vega: 'Vega',\n 'vega-lite': 'Vega-Lite'\n };\n const VERSION = {\n vega: vega.version,\n 'vega-lite': vegaLite ? vegaLite.version : 'not available'\n };\n const PREPROCESSOR = {\n vega: vgSpec => vgSpec,\n 'vega-lite': (vlSpec, config) => vegaLite.compile(vlSpec, {\n config: config\n }).spec\n };\n const SVG_CIRCLES = `\n\n \n \n \n`;\n const CHART_WRAPPER_CLASS = 'chart-wrapper';\n function isTooltipHandler(h) {\n return typeof h === 'function';\n }\n function viewSource(source, sourceHeader, sourceFooter, mode) {\n const header = `${sourceHeader}
`;\n      const footer = `
${sourceFooter}`;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const win = window.open('');\n win.document.write(header + source + footer);\n win.document.title = `${NAMES[mode]} JSON Source`;\n }\n\n /**\n * Try to guess the type of spec.\n *\n * @param spec Vega or Vega-Lite spec.\n */\n function guessMode(spec, providedMode) {\n // Decide mode\n if (spec.$schema) {\n const parsed = e(spec.$schema);\n if (providedMode && providedMode !== parsed.library) {\n console.warn(`The given visualization spec is written in ${NAMES[parsed.library]}, but mode argument sets ${NAMES[providedMode] ?? providedMode}.`);\n }\n const mode = parsed.library;\n if (!satisfies$1(VERSION[mode], `^${parsed.version.slice(1)}`)) {\n console.warn(`The input spec uses ${NAMES[mode]} ${parsed.version}, but the current version of ${NAMES[mode]} is v${VERSION[mode]}.`);\n }\n return mode;\n }\n\n // try to guess from the provided spec\n if ('mark' in spec || 'encoding' in spec || 'layer' in spec || 'hconcat' in spec || 'vconcat' in spec || 'facet' in spec || 'repeat' in spec) {\n return 'vega-lite';\n }\n if ('marks' in spec || 'signals' in spec || 'scales' in spec || 'axes' in spec) {\n return 'vega';\n }\n return providedMode ?? 'vega';\n }\n function isLoader(o) {\n return !!(o && 'load' in o);\n }\n function createLoader(opts) {\n return isLoader(opts) ? opts : vega.loader(opts);\n }\n function embedOptionsFromUsermeta(parsedSpec) {\n const opts = parsedSpec.usermeta?.embedOptions ?? {};\n if (vegaImport.isString(opts.defaultStyle)) {\n // we don't allow styles set via usermeta since it would allow injection of logic (we set the style via innerHTML)\n opts.defaultStyle = false;\n }\n return opts;\n }\n\n /**\n * Embed a Vega visualization component in a web page. This function returns a promise.\n *\n * @param el DOM element in which to place component (DOM node or CSS selector).\n * @param spec String : A URL string from which to load the Vega specification.\n * Object : The Vega/Vega-Lite specification as a parsed JSON object.\n * @param opts A JavaScript object containing options for embedding.\n */\n async function embed(el, spec, opts = {}) {\n let parsedSpec;\n let loader;\n if (vegaImport.isString(spec)) {\n loader = createLoader(opts.loader);\n parsedSpec = JSON.parse(await loader.load(spec));\n } else {\n parsedSpec = spec;\n }\n const loadedEmbedOptions = embedOptionsFromUsermeta(parsedSpec);\n const usermetaLoader = loadedEmbedOptions.loader;\n\n // either create the loader for the first time or create a new loader if the spec has new loader options\n if (!loader || usermetaLoader) {\n loader = createLoader(opts.loader ?? usermetaLoader);\n }\n const usermetaOpts = await loadOpts(loadedEmbedOptions, loader);\n const parsedOpts = await loadOpts(opts, loader);\n const mergedOpts = {\n ...mergeDeep(parsedOpts, usermetaOpts),\n config: vegaImport.mergeConfig(parsedOpts.config ?? {}, usermetaOpts.config ?? {})\n };\n return await _embed(el, parsedSpec, mergedOpts, loader);\n }\n async function loadOpts(opt, loader) {\n const config = vegaImport.isString(opt.config) ? JSON.parse(await loader.load(opt.config)) : opt.config ?? {};\n const patch = vegaImport.isString(opt.patch) ? JSON.parse(await loader.load(opt.patch)) : opt.patch;\n return {\n ...opt,\n ...(patch ? {\n patch\n } : {}),\n ...(config ? {\n config\n } : {})\n };\n }\n function getRoot(el) {\n const possibleRoot = el.getRootNode ? el.getRootNode() : document;\n return possibleRoot instanceof ShadowRoot ? {\n root: possibleRoot,\n rootContainer: possibleRoot\n } : {\n root: document,\n rootContainer: document.head ?? document.body\n };\n }\n async function _embed(el, spec, opts = {}, loader) {\n const config = opts.theme ? vegaImport.mergeConfig(themes[opts.theme], opts.config ?? {}) : opts.config;\n const actions = vegaImport.isBoolean(opts.actions) ? opts.actions : mergeDeep({}, DEFAULT_ACTIONS, opts.actions ?? {});\n const i18n = {\n ...I18N,\n ...opts.i18n\n };\n const renderer = opts.renderer ?? 'canvas';\n const logLevel = opts.logLevel ?? vega.Warn;\n const downloadFileName = opts.downloadFileName ?? 'visualization';\n const element = typeof el === 'string' ? document.querySelector(el) : el;\n if (!element) {\n throw new Error(`${el} does not exist`);\n }\n if (opts.defaultStyle !== false) {\n const ID = 'vega-embed-style';\n const {\n root,\n rootContainer\n } = getRoot(element);\n if (!root.getElementById(ID)) {\n const style = document.createElement('style');\n style.id = ID;\n style.innerHTML = opts.defaultStyle === undefined || opts.defaultStyle === true ? (embedStyle ).toString() : opts.defaultStyle;\n rootContainer.appendChild(style);\n }\n }\n const mode = guessMode(spec, opts.mode);\n let vgSpec = PREPROCESSOR[mode](spec, config);\n if (mode === 'vega-lite') {\n if (vgSpec.$schema) {\n const parsed = e(vgSpec.$schema);\n if (!satisfies$1(VERSION.vega, `^${parsed.version.slice(1)}`)) {\n console.warn(`The compiled spec uses Vega ${parsed.version}, but current version is v${VERSION.vega}.`);\n }\n }\n }\n element.classList.add('vega-embed');\n if (actions) {\n element.classList.add('has-actions');\n }\n element.innerHTML = ''; // clear container\n\n let container = element;\n if (actions) {\n const chartWrapper = document.createElement('div');\n chartWrapper.classList.add(CHART_WRAPPER_CLASS);\n element.appendChild(chartWrapper);\n container = chartWrapper;\n }\n const patch = opts.patch;\n if (patch) {\n vgSpec = patch instanceof Function ? patch(vgSpec) : applyPatch(vgSpec, patch, true, false).newDocument;\n }\n\n // Set locale. Note that this is a global setting.\n if (opts.formatLocale) {\n vega.formatLocale(opts.formatLocale);\n }\n if (opts.timeFormatLocale) {\n vega.timeFormatLocale(opts.timeFormatLocale);\n }\n\n // Set custom expression functions\n if (opts.expressionFunctions) {\n for (const name in opts.expressionFunctions) {\n const expressionFunction = opts.expressionFunctions[name];\n if ('fn' in expressionFunction) {\n vega.expressionFunction(name, expressionFunction.fn, expressionFunction['visitor']);\n } else if (expressionFunction instanceof Function) {\n vega.expressionFunction(name, expressionFunction);\n }\n }\n }\n const {\n ast\n } = opts;\n\n // Do not apply the config to Vega when we have already applied it to Vega-Lite.\n // This call may throw an Error if parsing fails.\n const runtime = vega.parse(vgSpec, mode === 'vega-lite' ? {} : config, {\n ast\n });\n const view = new (opts.viewClass || vega.View)(runtime, {\n loader,\n logLevel,\n renderer,\n ...(ast ? {\n expr: vega.expressionInterpreter ?? opts.expr ?? expression\n } : {})\n });\n view.addSignalListener('autosize', (_, autosize) => {\n const {\n type\n } = autosize;\n if (type == 'fit-x') {\n container.classList.add('fit-x');\n container.classList.remove('fit-y');\n } else if (type == 'fit-y') {\n container.classList.remove('fit-x');\n container.classList.add('fit-y');\n } else if (type == 'fit') {\n container.classList.add('fit-x', 'fit-y');\n } else {\n container.classList.remove('fit-x', 'fit-y');\n }\n });\n if (opts.tooltip !== false) {\n const {\n loader: loader_,\n tooltip\n } = opts;\n const baseURL = loader_ && !isLoader(loader_) ? loader_?.baseURL : undefined;\n const handler = isTooltipHandler(tooltip) ? tooltip :\n // user provided boolean true or tooltip options\n new Handler({\n baseURL,\n ...(tooltip === true ? {} : tooltip)\n }).call;\n view.tooltip(handler);\n }\n let {\n hover\n } = opts;\n if (hover === undefined) {\n hover = mode === 'vega';\n }\n if (hover) {\n const {\n hoverSet,\n updateSet\n } = typeof hover === 'boolean' ? {} : hover;\n view.hover(hoverSet, updateSet);\n }\n if (opts) {\n if (opts.width != null) {\n view.width(opts.width);\n }\n if (opts.height != null) {\n view.height(opts.height);\n }\n if (opts.padding != null) {\n view.padding(opts.padding);\n }\n }\n await view.initialize(container, opts.bind).runAsync();\n let documentClickHandler;\n if (actions !== false) {\n let wrapper = element;\n if (opts.defaultStyle !== false || opts.forceActionsMenu) {\n const details = document.createElement('details');\n details.title = i18n.CLICK_TO_VIEW_ACTIONS;\n element.append(details);\n wrapper = details;\n const summary = document.createElement('summary');\n summary.innerHTML = SVG_CIRCLES;\n details.append(summary);\n documentClickHandler = ev => {\n if (!details.contains(ev.target)) {\n details.removeAttribute('open');\n }\n };\n document.addEventListener('click', documentClickHandler);\n }\n const ctrl = document.createElement('div');\n wrapper.append(ctrl);\n ctrl.classList.add('vega-actions');\n\n // add 'Export' action\n if (actions === true || actions.export !== false) {\n for (const ext of ['svg', 'png']) {\n if (actions === true || actions.export === true || actions.export[ext]) {\n const i18nExportAction = i18n[`${ext.toUpperCase()}_ACTION`];\n const exportLink = document.createElement('a');\n const scaleFactor = vegaImport.isObject(opts.scaleFactor) ? opts.scaleFactor[ext] : opts.scaleFactor;\n exportLink.text = i18nExportAction;\n exportLink.href = '#';\n exportLink.target = '_blank';\n exportLink.download = `${downloadFileName}.${ext}`;\n // add link on mousedown so that it's correct when the click happens\n exportLink.addEventListener('mousedown', async function (e) {\n e.preventDefault();\n const url = await view.toImageURL(ext, scaleFactor);\n this.href = url;\n });\n ctrl.append(exportLink);\n }\n }\n }\n\n // add 'View Source' action\n if (actions === true || actions.source !== false) {\n const viewSourceLink = document.createElement('a');\n viewSourceLink.text = i18n.SOURCE_ACTION;\n viewSourceLink.href = '#';\n viewSourceLink.addEventListener('click', function (e) {\n viewSource(stringify$1(spec), opts.sourceHeader ?? '', opts.sourceFooter ?? '', mode);\n e.preventDefault();\n });\n ctrl.append(viewSourceLink);\n }\n\n // add 'View Compiled' action\n if (mode === 'vega-lite' && (actions === true || actions.compiled !== false)) {\n const compileLink = document.createElement('a');\n compileLink.text = i18n.COMPILED_ACTION;\n compileLink.href = '#';\n compileLink.addEventListener('click', function (e) {\n viewSource(stringify$1(vgSpec), opts.sourceHeader ?? '', opts.sourceFooter ?? '', 'vega');\n e.preventDefault();\n });\n ctrl.append(compileLink);\n }\n\n // add 'Open in Vega Editor' action\n if (actions === true || actions.editor !== false) {\n const editorUrl = opts.editorUrl ?? 'https://vega.github.io/editor/';\n const editorLink = document.createElement('a');\n editorLink.text = i18n.EDITOR_ACTION;\n editorLink.href = '#';\n editorLink.addEventListener('click', function (e) {\n post(window, editorUrl, {\n config: config,\n mode: patch ? 'vega' : mode,\n renderer,\n spec: stringify$1(patch ? vgSpec : spec)\n });\n e.preventDefault();\n });\n ctrl.append(editorLink);\n }\n }\n function finalize() {\n if (documentClickHandler) {\n document.removeEventListener('click', documentClickHandler);\n }\n view.finalize();\n }\n return {\n view,\n spec,\n vgSpec,\n finalize,\n embedOptions: opts\n };\n }\n\n /**\n * Create a promise to an HTML Div element with an embedded Vega-Lite or Vega visualization.\n * The element has a value property with the view. By default all actions except for the editor action are disabled.\n *\n * The main use case is in [Observable](https://observablehq.com/).\n */\n async function container (spec, opt = {}) {\n const wrapper = document.createElement('div');\n wrapper.classList.add('vega-embed-wrapper');\n const div = document.createElement('div');\n wrapper.appendChild(div);\n const actions = opt.actions === true || opt.actions === false ? opt.actions : {\n export: true,\n source: false,\n compiled: true,\n editor: true,\n ...opt.actions\n };\n const result = await embed(div, spec, {\n actions,\n ...opt\n });\n wrapper.value = result.view;\n return wrapper;\n }\n\n /**\n * Returns true if the object is an HTML element.\n */\n function isElement(obj) {\n return obj instanceof HTMLElement;\n }\n const wrapper = (...args) => {\n if (args.length > 1 && (vegaImport.isString(args[0]) && !isURL(args[0]) || isElement(args[0]) || args.length === 3)) {\n return embed(args[0], args[1], args[2]);\n }\n return container(args[0], args[1]);\n };\n wrapper.vegaLite = vegaLite;\n wrapper.vl = vegaLite; // backwards compatibility\n wrapper.container = container;\n wrapper.embed = embed;\n wrapper.vega = vega;\n wrapper.default = embed;\n wrapper.version = version;\n\n return wrapper;\n\n}));\n//# sourceMappingURL=vega-embed.js.map\n","function accessor (fn, fields, name) {\n fn.fields = fields || [];\n fn.fname = name;\n return fn;\n}\nfunction accessorName(fn) {\n return fn == null ? null : fn.fname;\n}\nfunction accessorFields(fn) {\n return fn == null ? null : fn.fields;\n}\n\nfunction getter (path) {\n return path.length === 1 ? get1(path[0]) : getN(path);\n}\n\nconst get1 = field => function (obj) {\n return obj[field];\n};\n\nconst getN = path => {\n const len = path.length;\n return function (obj) {\n for (let i = 0; i < len; ++i) {\n obj = obj[path[i]];\n }\n\n return obj;\n };\n};\n\nfunction error (message) {\n throw Error(message);\n}\n\nfunction splitAccessPath (p) {\n const path = [],\n n = p.length;\n let q = null,\n b = 0,\n s = '',\n i,\n j,\n c;\n p = p + '';\n\n function push() {\n path.push(s + p.substring(i, j));\n s = '';\n i = j + 1;\n }\n\n for (i = j = 0; j < n; ++j) {\n c = p[j];\n\n if (c === '\\\\') {\n s += p.substring(i, j);\n s += p.substring(++j, ++j);\n i = j;\n } else if (c === q) {\n push();\n q = null;\n b = -1;\n } else if (q) {\n continue;\n } else if (i === b && c === '\"') {\n i = j + 1;\n q = c;\n } else if (i === b && c === \"'\") {\n i = j + 1;\n q = c;\n } else if (c === '.' && !b) {\n if (j > i) {\n push();\n } else {\n i = j + 1;\n }\n } else if (c === '[') {\n if (j > i) push();\n b = i = j + 1;\n } else if (c === ']') {\n if (!b) error('Access path missing open bracket: ' + p);\n if (b > 0) push();\n b = 0;\n i = j + 1;\n }\n }\n\n if (b) error('Access path missing closing bracket: ' + p);\n if (q) error('Access path missing closing quote: ' + p);\n\n if (j > i) {\n j++;\n push();\n }\n\n return path;\n}\n\nfunction field (field, name, opt) {\n const path = splitAccessPath(field);\n field = path.length === 1 ? path[0] : field;\n return accessor((opt && opt.get || getter)(path), [field], name || field);\n}\n\nconst id = field('id');\nconst identity = accessor(_ => _, [], 'identity');\nconst zero = accessor(() => 0, [], 'zero');\nconst one = accessor(() => 1, [], 'one');\nconst truthy = accessor(() => true, [], 'true');\nconst falsy = accessor(() => false, [], 'false');\n\nfunction log$1(method, level, input) {\n const args = [level].concat([].slice.call(input));\n console[method].apply(console, args); // eslint-disable-line no-console\n}\n\nconst None = 0;\nconst Error$1 = 1;\nconst Warn = 2;\nconst Info = 3;\nconst Debug = 4;\nfunction logger (_, method) {\n let level = _ || None;\n return {\n level(_) {\n if (arguments.length) {\n level = +_;\n return this;\n } else {\n return level;\n }\n },\n\n error() {\n if (level >= Error$1) log$1(method || 'error', 'ERROR', arguments);\n return this;\n },\n\n warn() {\n if (level >= Warn) log$1(method || 'warn', 'WARN', arguments);\n return this;\n },\n\n info() {\n if (level >= Info) log$1(method || 'log', 'INFO', arguments);\n return this;\n },\n\n debug() {\n if (level >= Debug) log$1(method || 'log', 'DEBUG', arguments);\n return this;\n }\n\n };\n}\n\nvar isArray = Array.isArray;\n\nfunction isObject (_) {\n return _ === Object(_);\n}\n\nconst isLegalKey = key => key !== '__proto__';\n\nfunction mergeConfig(...configs) {\n return configs.reduce((out, source) => {\n for (const key in source) {\n if (key === 'signals') {\n // for signals, we merge the signals arrays\n // source signals take precedence over\n // existing signals with the same name\n out.signals = mergeNamed(out.signals, source.signals);\n } else {\n // otherwise, merge objects subject to recursion constraints\n // for legend block, recurse for the layout entry only\n // for style block, recurse for all properties\n // otherwise, no recursion: objects overwrite, no merging\n const r = key === 'legend' ? {\n layout: 1\n } : key === 'style' ? true : null;\n writeConfig(out, key, source[key], r);\n }\n }\n\n return out;\n }, {});\n}\nfunction writeConfig(output, key, value, recurse) {\n if (!isLegalKey(key)) return;\n let k, o;\n\n if (isObject(value) && !isArray(value)) {\n o = isObject(output[key]) ? output[key] : output[key] = {};\n\n for (k in value) {\n if (recurse && (recurse === true || recurse[k])) {\n writeConfig(o, k, value[k]);\n } else if (isLegalKey(k)) {\n o[k] = value[k];\n }\n }\n } else {\n output[key] = value;\n }\n}\n\nfunction mergeNamed(a, b) {\n if (a == null) return b;\n const map = {},\n out = [];\n\n function add(_) {\n if (!map[_.name]) {\n map[_.name] = 1;\n out.push(_);\n }\n }\n\n b.forEach(add);\n a.forEach(add);\n return out;\n}\n\nfunction peek (array) {\n return array[array.length - 1];\n}\n\nfunction toNumber (_) {\n return _ == null || _ === '' ? null : +_;\n}\n\nconst exp = sign => x => sign * Math.exp(x);\n\nconst log = sign => x => Math.log(sign * x);\n\nconst symlog = c => x => Math.sign(x) * Math.log1p(Math.abs(x / c));\n\nconst symexp = c => x => Math.sign(x) * Math.expm1(Math.abs(x)) * c;\n\nconst pow = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n\nfunction pan(domain, delta, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n dd = (d1 - d0) * delta;\n return [ground(d0 - dd), ground(d1 - dd)];\n}\n\nfunction panLinear(domain, delta) {\n return pan(domain, delta, toNumber, identity);\n}\nfunction panLog(domain, delta) {\n var sign = Math.sign(domain[0]);\n return pan(domain, delta, log(sign), exp(sign));\n}\nfunction panPow(domain, delta, exponent) {\n return pan(domain, delta, pow(exponent), pow(1 / exponent));\n}\nfunction panSymlog(domain, delta, constant) {\n return pan(domain, delta, symlog(constant), symexp(constant));\n}\n\nfunction zoom(domain, anchor, scale, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n da = anchor != null ? lift(anchor) : (d0 + d1) / 2;\n return [ground(da + (d0 - da) * scale), ground(da + (d1 - da) * scale)];\n}\n\nfunction zoomLinear(domain, anchor, scale) {\n return zoom(domain, anchor, scale, toNumber, identity);\n}\nfunction zoomLog(domain, anchor, scale) {\n const sign = Math.sign(domain[0]);\n return zoom(domain, anchor, scale, log(sign), exp(sign));\n}\nfunction zoomPow(domain, anchor, scale, exponent) {\n return zoom(domain, anchor, scale, pow(exponent), pow(1 / exponent));\n}\nfunction zoomSymlog(domain, anchor, scale, constant) {\n return zoom(domain, anchor, scale, symlog(constant), symexp(constant));\n}\n\nfunction quarter(date) {\n return 1 + ~~(new Date(date).getMonth() / 3);\n}\nfunction utcquarter(date) {\n return 1 + ~~(new Date(date).getUTCMonth() / 3);\n}\n\nfunction array (_) {\n return _ != null ? isArray(_) ? _ : [_] : [];\n}\n\n/**\n * Span-preserving range clamp. If the span of the input range is less\n * than (max - min) and an endpoint exceeds either the min or max value,\n * the range is translated such that the span is preserved and one\n * endpoint touches the boundary of the min/max range.\n * If the span exceeds (max - min), the range [min, max] is returned.\n */\nfunction clampRange (range, min, max) {\n let lo = range[0],\n hi = range[1],\n span;\n\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n\n span = hi - lo;\n return span >= max - min ? [min, max] : [lo = Math.min(Math.max(lo, min), max - span), lo + span];\n}\n\nfunction isFunction (_) {\n return typeof _ === 'function';\n}\n\nconst DESCENDING = 'descending';\nfunction compare (fields, orders, opt) {\n opt = opt || {};\n orders = array(orders) || [];\n const ord = [],\n get = [],\n fmap = {},\n gen = opt.comparator || comparator;\n array(fields).forEach((f, i) => {\n if (f == null) return;\n ord.push(orders[i] === DESCENDING ? -1 : 1);\n get.push(f = isFunction(f) ? f : field(f, null, opt));\n (accessorFields(f) || []).forEach(_ => fmap[_] = 1);\n });\n return get.length === 0 ? null : accessor(gen(get, ord), Object.keys(fmap));\n}\nconst ascending = (u, v) => (u < v || u == null) && v != null ? -1 : (u > v || v == null) && u != null ? 1 : (v = v instanceof Date ? +v : v, u = u instanceof Date ? +u : u) !== u && v === v ? -1 : v !== v && u === u ? 1 : 0;\n\nconst comparator = (fields, orders) => fields.length === 1 ? compare1(fields[0], orders[0]) : compareN(fields, orders, fields.length);\n\nconst compare1 = (field, order) => function (a, b) {\n return ascending(field(a), field(b)) * order;\n};\n\nconst compareN = (fields, orders, n) => {\n orders.push(0); // pad zero for convenient lookup\n\n return function (a, b) {\n let f,\n c = 0,\n i = -1;\n\n while (c === 0 && ++i < n) {\n f = fields[i];\n c = ascending(f(a), f(b));\n }\n\n return c * orders[i];\n };\n};\n\nfunction constant (_) {\n return isFunction(_) ? _ : () => _;\n}\n\nfunction debounce (delay, handler) {\n let tid;\n return e => {\n if (tid) clearTimeout(tid);\n tid = setTimeout(() => (handler(e), tid = null), delay);\n };\n}\n\nfunction extend (_) {\n for (let x, k, i = 1, len = arguments.length; i < len; ++i) {\n x = arguments[i];\n\n for (k in x) {\n _[k] = x[k];\n }\n }\n\n return _;\n}\n\n/**\n * Return an array with minimum and maximum values, in the\n * form [min, max]. Ignores null, undefined, and NaN values.\n */\nfunction extent (array, f) {\n let i = 0,\n n,\n v,\n min,\n max;\n\n if (array && (n = array.length)) {\n if (f == null) {\n // find first valid value\n for (v = array[i]; i < n && (v == null || v !== v); v = array[++i]);\n\n min = max = v; // visit all other values\n\n for (; i < n; ++i) {\n v = array[i]; // skip null/undefined; NaN will fail all comparisons\n\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n } else {\n // find first valid value\n for (v = f(array[i]); i < n && (v == null || v !== v); v = f(array[++i]));\n\n min = max = v; // visit all other values\n\n for (; i < n; ++i) {\n v = f(array[i]); // skip null/undefined; NaN will fail all comparisons\n\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n }\n }\n\n return [min, max];\n}\n\nfunction extentIndex (array, f) {\n const n = array.length;\n let i = -1,\n a,\n b,\n c,\n u,\n v;\n\n if (f == null) {\n while (++i < n) {\n b = array[i];\n\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n\n if (i === n) return [-1, -1];\n u = v = i;\n\n while (++i < n) {\n b = array[i];\n\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n } else {\n while (++i < n) {\n b = f(array[i], i, array);\n\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n\n if (i === n) return [-1, -1];\n u = v = i;\n\n while (++i < n) {\n b = f(array[i], i, array);\n\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n }\n\n return [u, v];\n}\n\nconst hop = Object.prototype.hasOwnProperty;\nfunction has (object, property) {\n return hop.call(object, property);\n}\n\nconst NULL = {};\nfunction fastmap (input) {\n let obj = {},\n test;\n\n function has$1(key) {\n return has(obj, key) && obj[key] !== NULL;\n }\n\n const map = {\n size: 0,\n empty: 0,\n object: obj,\n has: has$1,\n\n get(key) {\n return has$1(key) ? obj[key] : undefined;\n },\n\n set(key, value) {\n if (!has$1(key)) {\n ++map.size;\n if (obj[key] === NULL) --map.empty;\n }\n\n obj[key] = value;\n return this;\n },\n\n delete(key) {\n if (has$1(key)) {\n --map.size;\n ++map.empty;\n obj[key] = NULL;\n }\n\n return this;\n },\n\n clear() {\n map.size = map.empty = 0;\n map.object = obj = {};\n },\n\n test(_) {\n if (arguments.length) {\n test = _;\n return map;\n } else {\n return test;\n }\n },\n\n clean() {\n const next = {};\n let size = 0;\n\n for (const key in obj) {\n const value = obj[key];\n\n if (value !== NULL && (!test || !test(value))) {\n next[key] = value;\n ++size;\n }\n }\n\n map.size = size;\n map.empty = 0;\n map.object = obj = next;\n }\n\n };\n if (input) Object.keys(input).forEach(key => {\n map.set(key, input[key]);\n });\n return map;\n}\n\nfunction flush (range, value, threshold, left, right, center) {\n if (!threshold && threshold !== 0) return center;\n const t = +threshold;\n let a = range[0],\n b = peek(range),\n l; // swap endpoints if range is reversed\n\n if (b < a) {\n l = a;\n a = b;\n b = l;\n } // compare value to endpoints\n\n\n l = Math.abs(value - a);\n const r = Math.abs(b - value); // adjust if value is within threshold distance of endpoint\n\n return l < r && l <= t ? left : r <= t ? right : center;\n}\n\nfunction inherits (child, parent, members) {\n const proto = child.prototype = Object.create(parent.prototype);\n Object.defineProperty(proto, 'constructor', {\n value: child,\n writable: true,\n enumerable: true,\n configurable: true\n });\n return extend(proto, members);\n}\n\n/**\n * Predicate that returns true if the value lies within the span\n * of the given range. The left and right flags control the use\n * of inclusive (true) or exclusive (false) comparisons.\n */\nfunction inrange (value, range, left, right) {\n let r0 = range[0],\n r1 = range[range.length - 1],\n t;\n\n if (r0 > r1) {\n t = r0;\n r0 = r1;\n r1 = t;\n }\n\n left = left === undefined || left;\n right = right === undefined || right;\n return (left ? r0 <= value : r0 < value) && (right ? value <= r1 : value < r1);\n}\n\nfunction isBoolean (_) {\n return typeof _ === 'boolean';\n}\n\nfunction isDate (_) {\n return Object.prototype.toString.call(_) === '[object Date]';\n}\n\nfunction isIterable (_) {\n return _ && isFunction(_[Symbol.iterator]);\n}\n\nfunction isNumber (_) {\n return typeof _ === 'number';\n}\n\nfunction isRegExp (_) {\n return Object.prototype.toString.call(_) === '[object RegExp]';\n}\n\nfunction isString (_) {\n return typeof _ === 'string';\n}\n\nfunction key (fields, flat, opt) {\n if (fields) {\n fields = flat ? array(fields).map(f => f.replace(/\\\\(.)/g, '$1')) : array(fields);\n }\n\n const len = fields && fields.length,\n gen = opt && opt.get || getter,\n map = f => gen(flat ? [f] : splitAccessPath(f));\n\n let fn;\n\n if (!len) {\n fn = function () {\n return '';\n };\n } else if (len === 1) {\n const get = map(fields[0]);\n\n fn = function (_) {\n return '' + get(_);\n };\n } else {\n const get = fields.map(map);\n\n fn = function (_) {\n let s = '' + get[0](_),\n i = 0;\n\n while (++i < len) s += '|' + get[i](_);\n\n return s;\n };\n }\n\n return accessor(fn, fields, 'key');\n}\n\nfunction lerp (array, frac) {\n const lo = array[0],\n hi = peek(array),\n f = +frac;\n return !f ? lo : f === 1 ? hi : lo + f * (hi - lo);\n}\n\nconst DEFAULT_MAX_SIZE = 10000; // adapted from https://github.com/dominictarr/hashlru/ (MIT License)\n\nfunction lruCache (maxsize) {\n maxsize = +maxsize || DEFAULT_MAX_SIZE;\n let curr, prev, size;\n\n const clear = () => {\n curr = {};\n prev = {};\n size = 0;\n };\n\n const update = (key, value) => {\n if (++size > maxsize) {\n prev = curr;\n curr = {};\n size = 1;\n }\n\n return curr[key] = value;\n };\n\n clear();\n return {\n clear,\n has: key => has(curr, key) || has(prev, key),\n get: key => has(curr, key) ? curr[key] : has(prev, key) ? update(key, prev[key]) : undefined,\n set: (key, value) => has(curr, key) ? curr[key] = value : update(key, value)\n };\n}\n\nfunction merge (compare, array0, array1, output) {\n const n0 = array0.length,\n n1 = array1.length;\n if (!n1) return array0;\n if (!n0) return array1;\n const merged = output || new array0.constructor(n0 + n1);\n let i0 = 0,\n i1 = 0,\n i = 0;\n\n for (; i0 < n0 && i1 < n1; ++i) {\n merged[i] = compare(array0[i0], array1[i1]) > 0 ? array1[i1++] : array0[i0++];\n }\n\n for (; i0 < n0; ++i0, ++i) {\n merged[i] = array0[i0];\n }\n\n for (; i1 < n1; ++i1, ++i) {\n merged[i] = array1[i1];\n }\n\n return merged;\n}\n\nfunction repeat (str, reps) {\n let s = '';\n\n while (--reps >= 0) s += str;\n\n return s;\n}\n\nfunction pad (str, length, padchar, align) {\n const c = padchar || ' ',\n s = str + '',\n n = length - s.length;\n return n <= 0 ? s : align === 'left' ? repeat(c, n) + s : align === 'center' ? repeat(c, ~~(n / 2)) + s + repeat(c, Math.ceil(n / 2)) : s + repeat(c, n);\n}\n\n/**\n * Return the numerical span of an array: the difference between\n * the last and first values.\n */\n\nfunction span (array) {\n return array && peek(array) - array[0] || 0;\n}\n\nfunction $(x) {\n return isArray(x) ? '[' + x.map($) + ']' : isObject(x) || isString(x) ? // Output valid JSON and JS source strings.\n // See http://timelessrepo.com/json-isnt-a-javascript-subset\n JSON.stringify(x).replace('\\u2028', '\\\\u2028').replace('\\u2029', '\\\\u2029') : x;\n}\n\nfunction toBoolean (_) {\n return _ == null || _ === '' ? null : !_ || _ === 'false' || _ === '0' ? false : !!_;\n}\n\nconst defaultParser = _ => isNumber(_) ? _ : isDate(_) ? _ : Date.parse(_);\n\nfunction toDate (_, parser) {\n parser = parser || defaultParser;\n return _ == null || _ === '' ? null : parser(_);\n}\n\nfunction toString (_) {\n return _ == null || _ === '' ? null : _ + '';\n}\n\nfunction toSet (_) {\n const s = {},\n n = _.length;\n\n for (let i = 0; i < n; ++i) s[_[i]] = true;\n\n return s;\n}\n\nfunction truncate (str, length, align, ellipsis) {\n const e = ellipsis != null ? ellipsis : '\\u2026',\n s = str + '',\n n = s.length,\n l = Math.max(0, length - e.length);\n return n <= length ? s : align === 'left' ? e + s.slice(n - l) : align === 'center' ? s.slice(0, Math.ceil(l / 2)) + e + s.slice(n - ~~(l / 2)) : s.slice(0, l) + e;\n}\n\nfunction visitArray (array, filter, visitor) {\n if (array) {\n if (filter) {\n const n = array.length;\n\n for (let i = 0; i < n; ++i) {\n const t = filter(array[i]);\n if (t) visitor(t, i, array);\n }\n } else {\n array.forEach(visitor);\n }\n }\n}\n\nexport { Debug, Error$1 as Error, Info, None, Warn, accessor, accessorFields, accessorName, array, ascending, clampRange, compare, constant, debounce, error, extend, extent, extentIndex, falsy, fastmap, field, flush, has as hasOwnProperty, id, identity, inherits, inrange, isArray, isBoolean, isDate, isFunction, isIterable, isNumber, isObject, isRegExp, isString, key, lerp, logger, lruCache, merge, mergeConfig, one, pad, panLinear, panLog, panPow, panSymlog, peek, quarter, repeat, span, splitAccessPath, $ as stringValue, toBoolean, toDate, toNumber, toSet, toString, truncate, truthy, utcquarter, visitArray, writeConfig, zero, zoomLinear, zoomLog, zoomPow, zoomSymlog };\n","Array.prototype.flat||Object.defineProperty(Array.prototype,\"flat\",{configurable:!0,value:function r(){var t=isNaN(arguments[0])?1:Number(arguments[0]);return t?Array.prototype.reduce.call(this,function(a,e){return Array.isArray(e)?a.push.apply(a,r.call(e,t-1)):a.push(e),a},[]):Array.prototype.slice.call(this)},writable:!0}),Array.prototype.flatMap||Object.defineProperty(Array.prototype,\"flatMap\",{configurable:!0,value:function(r){return Array.prototype.map.apply(this,arguments).flat()},writable:!0})\n","export function isLogicalOr(op) {\n return !!op.or;\n}\nexport function isLogicalAnd(op) {\n return !!op.and;\n}\nexport function isLogicalNot(op) {\n return !!op.not;\n}\nexport function forEachLeaf(op, fn) {\n if (isLogicalNot(op)) {\n forEachLeaf(op.not, fn);\n }\n else if (isLogicalAnd(op)) {\n for (const subop of op.and) {\n forEachLeaf(subop, fn);\n }\n }\n else if (isLogicalOr(op)) {\n for (const subop of op.or) {\n forEachLeaf(subop, fn);\n }\n }\n else {\n fn(op);\n }\n}\nexport function normalizeLogicalComposition(op, normalizer) {\n if (isLogicalNot(op)) {\n return { not: normalizeLogicalComposition(op.not, normalizer) };\n }\n else if (isLogicalAnd(op)) {\n return { and: op.and.map(o => normalizeLogicalComposition(o, normalizer)) };\n }\n else if (isLogicalOr(op)) {\n return { or: op.or.map(o => normalizeLogicalComposition(o, normalizer)) };\n }\n else {\n return normalizer(op);\n }\n}\n//# sourceMappingURL=logical.js.map","import 'array-flat-polyfill';\nimport { default as clone_ } from 'clone';\nimport deepEqual_ from 'fast-deep-equal';\nimport stableStringify from 'fast-json-stable-stringify';\nimport { hasOwnProperty, isNumber, isString, splitAccessPath, stringValue, writeConfig } from 'vega-util';\nimport { isLogicalAnd, isLogicalNot, isLogicalOr } from './logical';\nexport const deepEqual = deepEqual_;\nexport const duplicate = clone_;\n/**\n * Creates an object composed of the picked object properties.\n *\n * var object = {'a': 1, 'b': '2', 'c': 3};\n * pick(object, ['a', 'c']);\n * // → {'a': 1, 'c': 3}\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function pick(obj, props) {\n const copy = {};\n for (const prop of props) {\n if (hasOwnProperty(obj, prop)) {\n copy[prop] = obj[prop];\n }\n }\n return copy;\n}\n/**\n * The opposite of _.pick; this method creates an object composed of the own\n * and inherited enumerable string keyed properties of object that are not omitted.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function omit(obj, props) {\n const copy = Object.assign({}, obj);\n for (const prop of props) {\n delete copy[prop];\n }\n return copy;\n}\n/**\n * Monkey patch Set so that `stringify` produces a string representation of sets.\n */\nSet.prototype['toJSON'] = function () {\n return `Set(${[...this].map(x => stableStringify(x)).join(',')})`;\n};\n/**\n * Converts any object to a string representation that can be consumed by humans.\n */\nexport const stringify = stableStringify;\n/**\n * Converts any object to a string of limited size, or a number.\n */\nexport function hash(a) {\n if (isNumber(a)) {\n return a;\n }\n const str = isString(a) ? a : stableStringify(a);\n // short strings can be used as hash directly, longer strings are hashed to reduce memory usage\n if (str.length < 250) {\n return str;\n }\n // from http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/\n let h = 0;\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i);\n h = (h << 5) - h + char;\n h = h & h; // Convert to 32bit integer\n }\n return h;\n}\nexport function isNullOrFalse(x) {\n return x === false || x === null;\n}\nexport function contains(array, item) {\n return array.indexOf(item) > -1;\n}\n/**\n * Returns true if any item returns true.\n */\nexport function some(arr, f) {\n let i = 0;\n for (const [k, a] of arr.entries()) {\n if (f(a, k, i++)) {\n return true;\n }\n }\n return false;\n}\n/**\n * Returns true if all items return true.\n */\nexport function every(arr, f) {\n let i = 0;\n for (const [k, a] of arr.entries()) {\n if (!f(a, k, i++)) {\n return false;\n }\n }\n return true;\n}\n/**\n * recursively merges src into dest\n */\nexport function mergeDeep(dest, ...src) {\n for (const s of src) {\n deepMerge_(dest, s !== null && s !== void 0 ? s : {});\n }\n return dest;\n}\nfunction deepMerge_(dest, src) {\n for (const property of keys(src)) {\n writeConfig(dest, property, src[property], true);\n }\n}\nexport function unique(values, f) {\n const results = [];\n const u = {};\n let v;\n for (const val of values) {\n v = f(val);\n if (v in u) {\n continue;\n }\n u[v] = 1;\n results.push(val);\n }\n return results;\n}\n/**\n * Returns true if the two dictionaries disagree. Applies only to defined values.\n */\nexport function isEqual(dict, other) {\n const dictKeys = keys(dict);\n const otherKeys = keys(other);\n if (dictKeys.length !== otherKeys.length) {\n return false;\n }\n for (const key of dictKeys) {\n if (dict[key] !== other[key]) {\n return false;\n }\n }\n return true;\n}\nexport function setEqual(a, b) {\n if (a.size !== b.size) {\n return false;\n }\n for (const e of a) {\n if (!b.has(e)) {\n return false;\n }\n }\n return true;\n}\nexport function hasIntersection(a, b) {\n for (const key of a) {\n if (b.has(key)) {\n return true;\n }\n }\n return false;\n}\nexport function prefixGenerator(a) {\n const prefixes = new Set();\n for (const x of a) {\n const splitField = splitAccessPath(x);\n // Wrap every element other than the first in `[]`\n const wrappedWithAccessors = splitField.map((y, i) => (i === 0 ? y : `[${y}]`));\n const computedPrefixes = wrappedWithAccessors.map((_, i) => wrappedWithAccessors.slice(0, i + 1).join(''));\n for (const y of computedPrefixes) {\n prefixes.add(y);\n }\n }\n return prefixes;\n}\n/**\n * Returns true if a and b have an intersection. Also return true if a or b are undefined\n * since this means we don't know what fields a node produces or depends on.\n */\nexport function fieldIntersection(a, b) {\n if (a === undefined || b === undefined) {\n return true;\n }\n return hasIntersection(prefixGenerator(a), prefixGenerator(b));\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function isEmpty(obj) {\n return keys(obj).length === 0;\n}\n// This is a stricter version of Object.keys but with better types. See https://github.com/Microsoft/TypeScript/pull/12253#issuecomment-263132208\nexport const keys = Object.keys;\nexport const vals = Object.values;\nexport const entries = Object.entries;\nexport function isBoolean(b) {\n return b === true || b === false;\n}\n/**\n * Convert a string into a valid variable name\n */\nexport function varName(s) {\n // Replace non-alphanumeric characters (anything besides a-zA-Z0-9_) with _\n const alphanumericS = s.replace(/\\W/g, '_');\n // Add _ if the string has leading numbers.\n return (s.match(/^\\d+/) ? '_' : '') + alphanumericS;\n}\nexport function logicalExpr(op, cb) {\n if (isLogicalNot(op)) {\n return '!(' + logicalExpr(op.not, cb) + ')';\n }\n else if (isLogicalAnd(op)) {\n return '(' + op.and.map((and) => logicalExpr(and, cb)).join(') && (') + ')';\n }\n else if (isLogicalOr(op)) {\n return '(' + op.or.map((or) => logicalExpr(or, cb)).join(') || (') + ')';\n }\n else {\n return cb(op);\n }\n}\n/**\n * Delete nested property of an object, and delete the ancestors of the property if they become empty.\n */\nexport function deleteNestedProperty(obj, orderedProps) {\n if (orderedProps.length === 0) {\n return true;\n }\n const prop = orderedProps.shift(); // eslint-disable-line @typescript-eslint/no-non-null-assertion\n if (prop in obj && deleteNestedProperty(obj[prop], orderedProps)) {\n delete obj[prop];\n }\n return isEmpty(obj);\n}\nexport function titleCase(s) {\n return s.charAt(0).toUpperCase() + s.substr(1);\n}\n/**\n * Converts a path to an access path with datum.\n * @param path The field name.\n * @param datum The string to use for `datum`.\n */\nexport function accessPathWithDatum(path, datum = 'datum') {\n const pieces = splitAccessPath(path);\n const prefixes = [];\n for (let i = 1; i <= pieces.length; i++) {\n const prefix = `[${pieces.slice(0, i).map(stringValue).join('][')}]`;\n prefixes.push(`${datum}${prefix}`);\n }\n return prefixes.join(' && ');\n}\n/**\n * Return access with datum to the flattened field.\n *\n * @param path The field name.\n * @param datum The string to use for `datum`.\n */\nexport function flatAccessWithDatum(path, datum = 'datum') {\n return `${datum}[${stringValue(splitAccessPath(path).join('.'))}]`;\n}\nfunction escapePathAccess(string) {\n return string.replace(/(\\[|\\]|\\.|'|\")/g, '\\\\$1');\n}\n/**\n * Replaces path accesses with access to non-nested field.\n * For example, `foo[\"bar\"].baz` becomes `foo\\\\.bar\\\\.baz`.\n */\nexport function replacePathInField(path) {\n return `${splitAccessPath(path).map(escapePathAccess).join('\\\\.')}`;\n}\n/**\n * Replace all occurrences of a string with another string.\n *\n * @param string the string to replace in\n * @param find the string to replace\n * @param replacement the replacement\n */\nexport function replaceAll(string, find, replacement) {\n return string.replace(new RegExp(find.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'g'), replacement);\n}\n/**\n * Remove path accesses with access from field.\n * For example, `foo[\"bar\"].baz` becomes `foo.bar.baz`.\n */\nexport function removePathFromField(path) {\n return `${splitAccessPath(path).join('.')}`;\n}\n/**\n * Count the depth of the path. Returns 1 for fields that are not nested.\n */\nexport function accessPathDepth(path) {\n if (!path) {\n return 0;\n }\n return splitAccessPath(path).length;\n}\n/**\n * This is a replacement for chained || for numeric properties or properties that respect null so that 0 will be included.\n */\nexport function getFirstDefined(...args) {\n for (const arg of args) {\n if (arg !== undefined) {\n return arg;\n }\n }\n return undefined;\n}\n// variable used to generate id\nlet idCounter = 42;\n/**\n * Returns a new random id every time it gets called.\n *\n * Has side effect!\n */\nexport function uniqueId(prefix) {\n const id = ++idCounter;\n return prefix ? String(prefix) + id : id;\n}\n/**\n * Resets the id counter used in uniqueId. This can be useful for testing.\n */\nexport function resetIdCounter() {\n idCounter = 42;\n}\nexport function internalField(name) {\n return isInternalField(name) ? name : `__${name}`;\n}\nexport function isInternalField(name) {\n return name.indexOf('__') === 0;\n}\n/**\n * Normalize angle to be within [0,360).\n */\nexport function normalizeAngle(angle) {\n if (angle === undefined) {\n return undefined;\n }\n return ((angle % 360) + 360) % 360;\n}\n/**\n * Returns whether the passed in value is a valid number.\n */\nexport function isNumeric(value) {\n if (isNumber(value)) {\n return true;\n }\n return !isNaN(value) && !isNaN(parseFloat(value));\n}\n//# sourceMappingURL=util.js.map","import { keys } from './util';\nexport const CONDITIONAL_AXIS_PROP_INDEX = {\n labelAlign: {\n part: 'labels',\n vgProp: 'align'\n },\n labelBaseline: {\n part: 'labels',\n vgProp: 'baseline'\n },\n labelColor: {\n part: 'labels',\n vgProp: 'fill'\n },\n labelFont: {\n part: 'labels',\n vgProp: 'font'\n },\n labelFontSize: {\n part: 'labels',\n vgProp: 'fontSize'\n },\n labelFontStyle: {\n part: 'labels',\n vgProp: 'fontStyle'\n },\n labelFontWeight: {\n part: 'labels',\n vgProp: 'fontWeight'\n },\n labelOpacity: {\n part: 'labels',\n vgProp: 'opacity'\n },\n labelOffset: null,\n labelPadding: null,\n gridColor: {\n part: 'grid',\n vgProp: 'stroke'\n },\n gridDash: {\n part: 'grid',\n vgProp: 'strokeDash'\n },\n gridDashOffset: {\n part: 'grid',\n vgProp: 'strokeDashOffset'\n },\n gridOpacity: {\n part: 'grid',\n vgProp: 'opacity'\n },\n gridWidth: {\n part: 'grid',\n vgProp: 'strokeWidth'\n },\n tickColor: {\n part: 'ticks',\n vgProp: 'stroke'\n },\n tickDash: {\n part: 'ticks',\n vgProp: 'strokeDash'\n },\n tickDashOffset: {\n part: 'ticks',\n vgProp: 'strokeDashOffset'\n },\n tickOpacity: {\n part: 'ticks',\n vgProp: 'opacity'\n },\n tickSize: null,\n tickWidth: {\n part: 'ticks',\n vgProp: 'strokeWidth'\n }\n};\nexport function isConditionalAxisValue(v) {\n return v && v['condition'];\n}\nexport const AXIS_PARTS = ['domain', 'grid', 'labels', 'ticks', 'title'];\n/**\n * A dictionary listing whether a certain axis property is applicable for only main axes or only grid axes.\n */\nexport const AXIS_PROPERTY_TYPE = {\n grid: 'grid',\n gridCap: 'grid',\n gridColor: 'grid',\n gridDash: 'grid',\n gridDashOffset: 'grid',\n gridOpacity: 'grid',\n gridScale: 'grid',\n gridWidth: 'grid',\n orient: 'main',\n bandPosition: 'both',\n aria: 'main',\n description: 'main',\n domain: 'main',\n domainCap: 'main',\n domainColor: 'main',\n domainDash: 'main',\n domainDashOffset: 'main',\n domainOpacity: 'main',\n domainWidth: 'main',\n format: 'main',\n formatType: 'main',\n labelAlign: 'main',\n labelAngle: 'main',\n labelBaseline: 'main',\n labelBound: 'main',\n labelColor: 'main',\n labelFlush: 'main',\n labelFlushOffset: 'main',\n labelFont: 'main',\n labelFontSize: 'main',\n labelFontStyle: 'main',\n labelFontWeight: 'main',\n labelLimit: 'main',\n labelLineHeight: 'main',\n labelOffset: 'main',\n labelOpacity: 'main',\n labelOverlap: 'main',\n labelPadding: 'main',\n labels: 'main',\n labelSeparation: 'main',\n maxExtent: 'main',\n minExtent: 'main',\n offset: 'both',\n position: 'main',\n tickCap: 'main',\n tickColor: 'main',\n tickDash: 'main',\n tickDashOffset: 'main',\n tickMinStep: 'main',\n tickOffset: 'both',\n tickOpacity: 'main',\n tickRound: 'both',\n ticks: 'main',\n tickSize: 'main',\n tickWidth: 'both',\n title: 'main',\n titleAlign: 'main',\n titleAnchor: 'main',\n titleAngle: 'main',\n titleBaseline: 'main',\n titleColor: 'main',\n titleFont: 'main',\n titleFontSize: 'main',\n titleFontStyle: 'main',\n titleFontWeight: 'main',\n titleLimit: 'main',\n titleLineHeight: 'main',\n titleOpacity: 'main',\n titlePadding: 'main',\n titleX: 'main',\n titleY: 'main',\n encode: 'both',\n scale: 'both',\n tickBand: 'both',\n tickCount: 'both',\n tickExtra: 'both',\n translate: 'both',\n values: 'both',\n zindex: 'both' // this is actually set afterward, so it doesn't matter\n};\nexport const COMMON_AXIS_PROPERTIES_INDEX = {\n orient: 1,\n aria: 1,\n bandPosition: 1,\n description: 1,\n domain: 1,\n domainCap: 1,\n domainColor: 1,\n domainDash: 1,\n domainDashOffset: 1,\n domainOpacity: 1,\n domainWidth: 1,\n format: 1,\n formatType: 1,\n grid: 1,\n gridCap: 1,\n gridColor: 1,\n gridDash: 1,\n gridDashOffset: 1,\n gridOpacity: 1,\n gridWidth: 1,\n labelAlign: 1,\n labelAngle: 1,\n labelBaseline: 1,\n labelBound: 1,\n labelColor: 1,\n labelFlush: 1,\n labelFlushOffset: 1,\n labelFont: 1,\n labelFontSize: 1,\n labelFontStyle: 1,\n labelFontWeight: 1,\n labelLimit: 1,\n labelLineHeight: 1,\n labelOffset: 1,\n labelOpacity: 1,\n labelOverlap: 1,\n labelPadding: 1,\n labels: 1,\n labelSeparation: 1,\n maxExtent: 1,\n minExtent: 1,\n offset: 1,\n position: 1,\n tickBand: 1,\n tickCap: 1,\n tickColor: 1,\n tickCount: 1,\n tickDash: 1,\n tickDashOffset: 1,\n tickExtra: 1,\n tickMinStep: 1,\n tickOffset: 1,\n tickOpacity: 1,\n tickRound: 1,\n ticks: 1,\n tickSize: 1,\n tickWidth: 1,\n title: 1,\n titleAlign: 1,\n titleAnchor: 1,\n titleAngle: 1,\n titleBaseline: 1,\n titleColor: 1,\n titleFont: 1,\n titleFontSize: 1,\n titleFontStyle: 1,\n titleFontWeight: 1,\n titleLimit: 1,\n titleLineHeight: 1,\n titleOpacity: 1,\n titlePadding: 1,\n titleX: 1,\n titleY: 1,\n translate: 1,\n values: 1,\n zindex: 1\n};\nconst AXIS_PROPERTIES_INDEX = Object.assign(Object.assign({}, COMMON_AXIS_PROPERTIES_INDEX), { style: 1, labelExpr: 1, encoding: 1 });\nexport function isAxisProperty(prop) {\n return !!AXIS_PROPERTIES_INDEX[prop];\n}\n// Export for dependent projects\nexport const AXIS_PROPERTIES = keys(AXIS_PROPERTIES_INDEX);\nconst AXIS_CONFIGS_INDEX = {\n axis: 1,\n axisBand: 1,\n axisBottom: 1,\n axisDiscrete: 1,\n axisLeft: 1,\n axisPoint: 1,\n axisQuantitative: 1,\n axisRight: 1,\n axisTemporal: 1,\n axisTop: 1,\n axisX: 1,\n axisXBand: 1,\n axisXDiscrete: 1,\n axisXPoint: 1,\n axisXQuantitative: 1,\n axisXTemporal: 1,\n axisY: 1,\n axisYBand: 1,\n axisYDiscrete: 1,\n axisYPoint: 1,\n axisYQuantitative: 1,\n axisYTemporal: 1\n};\nexport const AXIS_CONFIGS = keys(AXIS_CONFIGS_INDEX);\n//# sourceMappingURL=axis.js.map","import { isString, toSet } from 'vega-util';\nimport { contains, keys } from './util';\nconst AGGREGATE_OP_INDEX = {\n argmax: 1,\n argmin: 1,\n average: 1,\n count: 1,\n distinct: 1,\n product: 1,\n max: 1,\n mean: 1,\n median: 1,\n min: 1,\n missing: 1,\n q1: 1,\n q3: 1,\n ci0: 1,\n ci1: 1,\n stderr: 1,\n stdev: 1,\n stdevp: 1,\n sum: 1,\n valid: 1,\n values: 1,\n variance: 1,\n variancep: 1\n};\nexport const MULTIDOMAIN_SORT_OP_INDEX = {\n count: 1,\n min: 1,\n max: 1\n};\nexport function isArgminDef(a) {\n return !!a && !!a['argmin'];\n}\nexport function isArgmaxDef(a) {\n return !!a && !!a['argmax'];\n}\nexport const AGGREGATE_OPS = keys(AGGREGATE_OP_INDEX);\nexport function isAggregateOp(a) {\n return isString(a) && !!AGGREGATE_OP_INDEX[a];\n}\nexport const COUNTING_OPS = ['count', 'valid', 'missing', 'distinct'];\nexport function isCountingAggregateOp(aggregate) {\n return isString(aggregate) && contains(COUNTING_OPS, aggregate);\n}\nexport function isMinMaxOp(aggregate) {\n return isString(aggregate) && contains(['min', 'max'], aggregate);\n}\n/** Additive-based aggregation operations. These can be applied to stack. */\nexport const SUM_OPS = ['count', 'sum', 'distinct', 'valid', 'missing'];\n/**\n * Aggregation operators that always produce values within the range [domainMin, domainMax].\n */\nexport const SHARED_DOMAIN_OPS = ['mean', 'average', 'median', 'q1', 'q3', 'min', 'max'];\nexport const SHARED_DOMAIN_OP_INDEX = toSet(SHARED_DOMAIN_OPS);\n//# sourceMappingURL=aggregate.js.map","/*\n * Constants and utilities for encoding channels (Visual variables)\n * such as 'x', 'y', 'color'.\n */\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { keys } from './util';\n// Facet\nexport const ROW = 'row';\nexport const COLUMN = 'column';\nexport const FACET = 'facet';\n// Position\nexport const X = 'x';\nexport const Y = 'y';\nexport const X2 = 'x2';\nexport const Y2 = 'y2';\n// Arc-Position\nexport const RADIUS = 'radius';\nexport const RADIUS2 = 'radius2';\nexport const THETA = 'theta';\nexport const THETA2 = 'theta2';\n// Geo Position\nexport const LATITUDE = 'latitude';\nexport const LONGITUDE = 'longitude';\nexport const LATITUDE2 = 'latitude2';\nexport const LONGITUDE2 = 'longitude2';\n// Mark property with scale\nexport const COLOR = 'color';\nexport const FILL = 'fill';\nexport const STROKE = 'stroke';\nexport const SHAPE = 'shape';\nexport const SIZE = 'size';\nexport const ANGLE = 'angle';\nexport const OPACITY = 'opacity';\nexport const FILLOPACITY = 'fillOpacity';\nexport const STROKEOPACITY = 'strokeOpacity';\nexport const STROKEWIDTH = 'strokeWidth';\nexport const STROKEDASH = 'strokeDash';\n// Non-scale channel\nexport const TEXT = 'text';\nexport const ORDER = 'order';\nexport const DETAIL = 'detail';\nexport const KEY = 'key';\nexport const TOOLTIP = 'tooltip';\nexport const HREF = 'href';\nexport const URL = 'url';\nexport const DESCRIPTION = 'description';\nconst POSITION_CHANNEL_INDEX = {\n x: 1,\n y: 1,\n x2: 1,\n y2: 1\n};\nconst POLAR_POSITION_CHANNEL_INDEX = {\n theta: 1,\n theta2: 1,\n radius: 1,\n radius2: 1\n};\nexport function isPolarPositionChannel(c) {\n return c in POLAR_POSITION_CHANNEL_INDEX;\n}\nconst GEO_POSIITON_CHANNEL_INDEX = {\n longitude: 1,\n longitude2: 1,\n latitude: 1,\n latitude2: 1\n};\nexport function getPositionChannelFromLatLong(channel) {\n switch (channel) {\n case LATITUDE:\n return 'y';\n case LATITUDE2:\n return 'y2';\n case LONGITUDE:\n return 'x';\n case LONGITUDE2:\n return 'x2';\n }\n}\nexport function isGeoPositionChannel(c) {\n return c in GEO_POSIITON_CHANNEL_INDEX;\n}\nexport const GEOPOSITION_CHANNELS = keys(GEO_POSIITON_CHANNEL_INDEX);\nconst UNIT_CHANNEL_INDEX = Object.assign(Object.assign(Object.assign(Object.assign({}, POSITION_CHANNEL_INDEX), POLAR_POSITION_CHANNEL_INDEX), GEO_POSIITON_CHANNEL_INDEX), { \n // color\n color: 1, fill: 1, stroke: 1, \n // other non-position with scale\n opacity: 1, fillOpacity: 1, strokeOpacity: 1, strokeWidth: 1, strokeDash: 1, size: 1, angle: 1, shape: 1, \n // channels without scales\n order: 1, text: 1, detail: 1, key: 1, tooltip: 1, href: 1, url: 1, description: 1 });\nexport function isColorChannel(channel) {\n return channel === COLOR || channel === FILL || channel === STROKE;\n}\nconst FACET_CHANNEL_INDEX = {\n row: 1,\n column: 1,\n facet: 1\n};\nexport const FACET_CHANNELS = keys(FACET_CHANNEL_INDEX);\nconst CHANNEL_INDEX = Object.assign(Object.assign({}, UNIT_CHANNEL_INDEX), FACET_CHANNEL_INDEX);\nexport const CHANNELS = keys(CHANNEL_INDEX);\nconst { order: _o, detail: _d, tooltip: _tt1 } = CHANNEL_INDEX, SINGLE_DEF_CHANNEL_INDEX = __rest(CHANNEL_INDEX, [\"order\", \"detail\", \"tooltip\"]);\nconst { row: _r, column: _c, facet: _f } = SINGLE_DEF_CHANNEL_INDEX, SINGLE_DEF_UNIT_CHANNEL_INDEX = __rest(SINGLE_DEF_CHANNEL_INDEX, [\"row\", \"column\", \"facet\"]);\n/**\n * Channels that cannot have an array of channelDef.\n * model.fieldDef, getFieldDef only work for these channels.\n *\n * (The only two channels that can have an array of channelDefs are \"detail\" and \"order\".\n * Since there can be multiple fieldDefs for detail and order, getFieldDef/model.fieldDef\n * are not applicable for them. Similarly, selection projection won't work with \"detail\" and \"order\".)\n */\nexport const SINGLE_DEF_CHANNELS = keys(SINGLE_DEF_CHANNEL_INDEX);\nexport const SINGLE_DEF_UNIT_CHANNELS = keys(SINGLE_DEF_UNIT_CHANNEL_INDEX);\nexport function isSingleDefUnitChannel(str) {\n return !!SINGLE_DEF_UNIT_CHANNEL_INDEX[str];\n}\nexport function isChannel(str) {\n return !!CHANNEL_INDEX[str];\n}\nexport const SECONDARY_RANGE_CHANNEL = [X2, Y2, LATITUDE2, LONGITUDE2, THETA2, RADIUS2];\nexport function isSecondaryRangeChannel(c) {\n const main = getMainRangeChannel(c);\n return main !== c;\n}\n/**\n * Get the main channel for a range channel. E.g. `x` for `x2`.\n */\nexport function getMainRangeChannel(channel) {\n switch (channel) {\n case X2:\n return X;\n case Y2:\n return Y;\n case LATITUDE2:\n return LATITUDE;\n case LONGITUDE2:\n return LONGITUDE;\n case THETA2:\n return THETA;\n case RADIUS2:\n return RADIUS;\n }\n return channel;\n}\nexport function getVgPositionChannel(channel) {\n if (isPolarPositionChannel(channel)) {\n switch (channel) {\n case THETA:\n return 'startAngle';\n case THETA2:\n return 'endAngle';\n case RADIUS:\n return 'outerRadius';\n case RADIUS2:\n return 'innerRadius';\n }\n }\n return channel;\n}\n/**\n * Get the main channel for a range channel. E.g. `x` for `x2`.\n */\nexport function getSecondaryRangeChannel(channel) {\n switch (channel) {\n case X:\n return X2;\n case Y:\n return Y2;\n case LATITUDE:\n return LATITUDE2;\n case LONGITUDE:\n return LONGITUDE2;\n case THETA:\n return THETA2;\n case RADIUS:\n return RADIUS2;\n }\n return undefined;\n}\nexport function getSizeChannel(channel) {\n switch (channel) {\n case X:\n case X2:\n return 'width';\n case Y:\n case Y2:\n return 'height';\n }\n return undefined;\n}\n/**\n * Get the main channel for a range channel. E.g. `x` for `x2`.\n */\nexport function getOffsetChannel(channel) {\n switch (channel) {\n case X:\n return 'xOffset';\n case Y:\n return 'yOffset';\n case X2:\n return 'x2Offset';\n case Y2:\n return 'y2Offset';\n case THETA:\n return 'thetaOffset';\n case RADIUS:\n return 'radiusOffset';\n case THETA2:\n return 'theta2Offset';\n case RADIUS2:\n return 'radius2Offset';\n }\n return undefined;\n}\n// CHANNELS without COLUMN, ROW\nexport const UNIT_CHANNELS = keys(UNIT_CHANNEL_INDEX);\n// NONPOSITION_CHANNELS = UNIT_CHANNELS without X, Y, X2, Y2;\nconst { x: _x, y: _y, \n// x2 and y2 share the same scale as x and y\nx2: _x2, y2: _y2, latitude: _latitude, longitude: _longitude, latitude2: _latitude2, longitude2: _longitude2, theta: _theta, theta2: _theta2, radius: _radius, radius2: _radius2 } = UNIT_CHANNEL_INDEX, \n// The rest of unit channels then have scale\nNONPOSITION_CHANNEL_INDEX = __rest(UNIT_CHANNEL_INDEX, [\"x\", \"y\", \"x2\", \"y2\", \"latitude\", \"longitude\", \"latitude2\", \"longitude2\", \"theta\", \"theta2\", \"radius\", \"radius2\"]);\nexport const NONPOSITION_CHANNELS = keys(NONPOSITION_CHANNEL_INDEX);\nexport const POSITION_SCALE_CHANNEL_INDEX = {\n x: 1,\n y: 1\n};\nexport const POSITION_SCALE_CHANNELS = keys(POSITION_SCALE_CHANNEL_INDEX);\nexport function isXorY(channel) {\n return channel in POSITION_SCALE_CHANNEL_INDEX;\n}\nexport const POLAR_POSITION_SCALE_CHANNEL_INDEX = {\n theta: 1,\n radius: 1\n};\nexport const POLAR_POSITION_SCALE_CHANNELS = keys(POLAR_POSITION_SCALE_CHANNEL_INDEX);\nexport function getPositionScaleChannel(sizeType) {\n return sizeType === 'width' ? X : Y;\n}\n// NON_POSITION_SCALE_CHANNEL = SCALE_CHANNELS without X, Y\nconst { \n// x2 and y2 share the same scale as x and y\n// text and tooltip have format instead of scale,\n// href has neither format, nor scale\ntext: _t, tooltip: _tt, href: _hr, url: _u, description: _al, \n// detail and order have no scale\ndetail: _dd, key: _k, order: _oo } = NONPOSITION_CHANNEL_INDEX, NONPOSITION_SCALE_CHANNEL_INDEX = __rest(NONPOSITION_CHANNEL_INDEX, [\"text\", \"tooltip\", \"href\", \"url\", \"description\", \"detail\", \"key\", \"order\"]);\nexport const NONPOSITION_SCALE_CHANNELS = keys(NONPOSITION_SCALE_CHANNEL_INDEX);\nexport function isNonPositionScaleChannel(channel) {\n return !!NONPOSITION_CHANNEL_INDEX[channel];\n}\n/**\n * @returns whether Vega supports legends for a particular channel\n */\nexport function supportLegend(channel) {\n switch (channel) {\n case COLOR:\n case FILL:\n case STROKE:\n case SIZE:\n case SHAPE:\n case OPACITY:\n case STROKEWIDTH:\n case STROKEDASH:\n return true;\n case FILLOPACITY:\n case STROKEOPACITY:\n case ANGLE:\n return false;\n }\n}\n// Declare SCALE_CHANNEL_INDEX\nconst SCALE_CHANNEL_INDEX = Object.assign(Object.assign(Object.assign({}, POSITION_SCALE_CHANNEL_INDEX), POLAR_POSITION_SCALE_CHANNEL_INDEX), NONPOSITION_SCALE_CHANNEL_INDEX);\n/** List of channels with scales */\nexport const SCALE_CHANNELS = keys(SCALE_CHANNEL_INDEX);\nexport function isScaleChannel(channel) {\n return !!SCALE_CHANNEL_INDEX[channel];\n}\n/**\n * Return whether a channel supports a particular mark type.\n * @param channel channel name\n * @param mark the mark type\n * @return whether the mark supports the channel\n */\nexport function supportMark(channel, mark) {\n return getSupportedMark(channel)[mark];\n}\nconst ALL_MARKS = {\n // all marks\n arc: 'always',\n area: 'always',\n bar: 'always',\n circle: 'always',\n geoshape: 'always',\n image: 'always',\n line: 'always',\n rule: 'always',\n point: 'always',\n rect: 'always',\n square: 'always',\n trail: 'always',\n text: 'always',\n tick: 'always'\n};\nconst { geoshape: _g } = ALL_MARKS, ALL_MARKS_EXCEPT_GEOSHAPE = __rest(ALL_MARKS, [\"geoshape\"]);\n/**\n * Return a dictionary showing whether a channel supports mark type.\n * @param channel\n * @return A dictionary mapping mark types to 'always', 'binned', or undefined\n */\nfunction getSupportedMark(channel) {\n switch (channel) {\n case COLOR:\n case FILL:\n case STROKE:\n // falls through\n case DESCRIPTION:\n case DETAIL:\n case KEY:\n case TOOLTIP:\n case HREF:\n case ORDER: // TODO: revise (order might not support rect, which is not stackable?)\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n case STROKEWIDTH:\n // falls through\n case FACET:\n case ROW: // falls through\n case COLUMN:\n return ALL_MARKS;\n case X:\n case Y:\n case LATITUDE:\n case LONGITUDE:\n // all marks except geoshape. geoshape does not use X, Y -- it uses a projection\n return ALL_MARKS_EXCEPT_GEOSHAPE;\n case X2:\n case Y2:\n case LATITUDE2:\n case LONGITUDE2:\n return {\n area: 'always',\n bar: 'always',\n image: 'always',\n rect: 'always',\n rule: 'always',\n circle: 'binned',\n point: 'binned',\n square: 'binned',\n tick: 'binned',\n line: 'binned',\n trail: 'binned'\n };\n case SIZE:\n return {\n point: 'always',\n tick: 'always',\n rule: 'always',\n circle: 'always',\n square: 'always',\n bar: 'always',\n text: 'always',\n line: 'always',\n trail: 'always'\n };\n case STROKEDASH:\n return {\n line: 'always',\n point: 'always',\n tick: 'always',\n rule: 'always',\n circle: 'always',\n square: 'always',\n bar: 'always',\n geoshape: 'always'\n };\n case SHAPE:\n return { point: 'always', geoshape: 'always' };\n case TEXT:\n return { text: 'always' };\n case ANGLE:\n return { point: 'always', square: 'always', text: 'always' };\n case URL:\n return { image: 'always' };\n case THETA:\n return { text: 'always', arc: 'always' };\n case RADIUS:\n return { text: 'always', arc: 'always' };\n case THETA2:\n case RADIUS2:\n return { arc: 'always' };\n }\n}\nexport function rangeType(channel) {\n switch (channel) {\n case X:\n case Y:\n case THETA:\n case RADIUS:\n case SIZE:\n case ANGLE:\n case STROKEWIDTH:\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n // X2 and Y2 use X and Y scales, so they similarly have continuous range. [falls through]\n case X2:\n case Y2:\n case THETA2:\n case RADIUS2:\n return undefined;\n case FACET:\n case ROW:\n case COLUMN:\n case SHAPE:\n case STROKEDASH:\n // TEXT, TOOLTIP, URL, and HREF have no scale but have discrete output [falls through]\n case TEXT:\n case TOOLTIP:\n case HREF:\n case URL:\n case DESCRIPTION:\n return 'discrete';\n // Color can be either continuous or discrete, depending on scale type.\n case COLOR:\n case FILL:\n case STROKE:\n return 'flexible';\n // No scale, no range type.\n case LATITUDE:\n case LONGITUDE:\n case LATITUDE2:\n case LONGITUDE2:\n case DETAIL:\n case KEY:\n case ORDER:\n return undefined;\n }\n}\n//# sourceMappingURL=channel.js.map","import { isBoolean, isObject } from 'vega-util';\nimport { COLOR, COLUMN, FILL, FILLOPACITY, OPACITY, ROW, SHAPE, SIZE, STROKE, STROKEDASH, STROKEOPACITY, STROKEWIDTH } from './channel';\nimport { normalizeBin } from './channeldef';\nimport { entries, keys, varName } from './util';\n/**\n * Create a key for the bin configuration. Not for prebinned bin.\n */\nexport function binToString(bin) {\n if (isBoolean(bin)) {\n bin = normalizeBin(bin, undefined);\n }\n return ('bin' +\n keys(bin)\n .map(p => (isSelectionExtent(bin[p]) ? varName(`_${p}_${entries(bin[p])}`) : varName(`_${p}_${bin[p]}`)))\n .join(''));\n}\n/**\n * Vega-Lite should bin the data.\n */\nexport function isBinning(bin) {\n return bin === true || (isBinParams(bin) && !bin.binned);\n}\n/**\n * The data is already binned and so Vega-Lite should not bin it again.\n */\nexport function isBinned(bin) {\n return bin === 'binned' || (isBinParams(bin) && bin.binned === true);\n}\nexport function isBinParams(bin) {\n return isObject(bin);\n}\nexport function isSelectionExtent(extent) {\n return extent === null || extent === void 0 ? void 0 : extent['selection'];\n}\nexport function autoMaxBins(channel) {\n switch (channel) {\n case ROW:\n case COLUMN:\n case SIZE:\n case COLOR:\n case FILL:\n case STROKE:\n case STROKEWIDTH:\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n // Facets and Size shouldn't have too many bins\n // We choose 6 like shape to simplify the rule [falls through]\n case SHAPE:\n return 6; // Vega's \"shape\" has 6 distinct values\n case STROKEDASH:\n return 4; // We only provide 5 different stroke dash values (but 4 is more effective)\n default:\n return 10;\n }\n}\n//# sourceMappingURL=bin.js.map","import { getSizeChannel } from '../channel';\nimport { stringify } from '../util';\nexport function invalidSpec(spec) {\n return `Invalid specification ${JSON.stringify(spec)}. Make sure the specification includes at least one of the following properties: \"mark\", \"layer\", \"facet\", \"hconcat\", \"vconcat\", \"concat\", or \"repeat\".`;\n}\n// FIT\nexport const FIT_NON_SINGLE = 'Autosize \"fit\" only works for single views and layered views.';\nexport function containerSizeNonSingle(name) {\n const uName = name == 'width' ? 'Width' : 'Height';\n return `${uName} \"container\" only works for single views and layered views.`;\n}\nexport function containerSizeNotCompatibleWithAutosize(name) {\n const uName = name == 'width' ? 'Width' : 'Height';\n const fitDirection = name == 'width' ? 'x' : 'y';\n return `${uName} \"container\" only works well with autosize \"fit\" or \"fit-${fitDirection}\".`;\n}\nexport function droppingFit(channel) {\n return channel\n ? `Dropping \"fit-${channel}\" because spec has discrete ${getSizeChannel(channel)}.`\n : `Dropping \"fit\" because spec has discrete size.`;\n}\n// VIEW SIZE\nexport function unknownField(channel) {\n return `Unknown field for ${channel}. Cannot calculate view size.`;\n}\n// SELECTION\nexport function cannotProjectOnChannelWithoutField(channel) {\n return `Cannot project a selection on encoding channel \"${channel}\", which has no field.`;\n}\nexport function cannotProjectAggregate(channel, aggregate) {\n return `Cannot project a selection on encoding channel \"${channel}\" as it uses an aggregate function (\"${aggregate}\").`;\n}\nexport function nearestNotSupportForContinuous(mark) {\n return `The \"nearest\" transform is not supported for ${mark} marks.`;\n}\nexport function selectionNotSupported(mark) {\n return `Selection not supported for ${mark} yet.`;\n}\nexport function selectionNotFound(name) {\n return `Cannot find a selection named \"${name}\".`;\n}\nexport const SCALE_BINDINGS_CONTINUOUS = 'Scale bindings are currently only supported for scales with unbinned, continuous domains.';\nexport const LEGEND_BINDINGS_MUST_HAVE_PROJECTION = 'Legend bindings are only supported for selections over an individual field or encoding channel.';\nexport function noSameUnitLookup(name) {\n return (`Cannot define and lookup the \"${name}\" selection in the same view. ` +\n `Try moving the lookup into a second, layered view?`);\n}\nexport const NEEDS_SAME_SELECTION = 'The same selection must be used to override scale domains in a layered view.';\nexport const INTERVAL_INITIALIZED_WITH_X_Y = 'Interval selections should be initialized using \"x\" and/or \"y\" keys.';\n// REPEAT\nexport function noSuchRepeatedValue(field) {\n return `Unknown repeated value \"${field}\".`;\n}\nexport function columnsNotSupportByRowCol(type) {\n return `The \"columns\" property cannot be used when \"${type}\" has nested row/column.`;\n}\n// CONCAT / REPEAT\nexport const CONCAT_CANNOT_SHARE_AXIS = 'Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).';\n// DATA\nexport function unrecognizedParse(p) {\n return `Unrecognized parse \"${p}\".`;\n}\nexport function differentParse(field, local, ancestor) {\n return `An ancestor parsed field \"${field}\" as ${ancestor} but a child wants to parse the field as ${local}.`;\n}\nexport const ADD_SAME_CHILD_TWICE = 'Attempt to add the same child twice.';\n// TRANSFORMS\nexport function invalidTransformIgnored(transform) {\n return `Ignoring an invalid transform: ${stringify(transform)}.`;\n}\nexport const NO_FIELDS_NEEDS_AS = 'If \"from.fields\" is not specified, \"as\" has to be a string that specifies the key to be used for the data from the secondary source.';\n// ENCODING & FACET\nexport function customFormatTypeNotAllowed(channel) {\n return `Config.customFormatTypes is not true, thus custom format type and format for channel ${channel} are dropped.`;\n}\nexport function projectionOverridden(opt) {\n const { parentProjection, projection } = opt;\n return `Layer's shared projection ${stringify(parentProjection)} is overridden by a child projection ${stringify(projection)}.`;\n}\nexport const REPLACE_ANGLE_WITH_THETA = 'Arc marks uses theta channel rather than angle, replacing angle with theta.';\nexport function primitiveChannelDef(channel, type, value) {\n return `Channel ${channel} is a ${type}. Converted to {value: ${stringify(value)}}.`;\n}\nexport function invalidFieldType(type) {\n return `Invalid field type \"${type}\".`;\n}\nexport function invalidFieldTypeForCountAggregate(type, aggregate) {\n return `Invalid field type \"${type}\" for aggregate: \"${aggregate}\", using \"quantitative\" instead.`;\n}\nexport function invalidAggregate(aggregate) {\n return `Invalid aggregation operator \"${aggregate}\".`;\n}\nexport function missingFieldType(channel, newType) {\n return `Missing type for channel \"${channel}\", using \"${newType}\" instead.`;\n}\nexport function droppingColor(type, opt) {\n const { fill, stroke } = opt;\n return `Dropping color ${type} as the plot also has ${fill && stroke ? 'fill and stroke' : fill ? 'fill' : 'stroke'}.`;\n}\nexport function emptyFieldDef(fieldDef, channel) {\n return `Dropping ${stringify(fieldDef)} from channel \"${channel}\" since it does not contain any data field, datum, value, or signal.`;\n}\nexport function latLongDeprecated(channel, type, newChannel) {\n return `${channel}-encoding with type ${type} is deprecated. Replacing with ${newChannel}-encoding.`;\n}\nexport const LINE_WITH_VARYING_SIZE = 'Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.';\nexport function incompatibleChannel(channel, markOrFacet, when) {\n return `${channel} dropped as it is incompatible with \"${markOrFacet}\"${when ? ` when ${when}` : ''}.`;\n}\nexport function invalidEncodingChannel(channel) {\n return `${channel}-encoding is dropped as ${channel} is not a valid encoding channel.`;\n}\nexport function facetChannelShouldBeDiscrete(channel) {\n return `${channel} encoding should be discrete (ordinal / nominal / binned).`;\n}\nexport function facetChannelDropped(channels) {\n return `Facet encoding dropped as ${channels.join(' and ')} ${channels.length > 1 ? 'are' : 'is'} also specified.`;\n}\nexport function discreteChannelCannotEncode(channel, type) {\n return `Using discrete channel \"${channel}\" to encode \"${type}\" field can be misleading as it does not encode ${type === 'ordinal' ? 'order' : 'magnitude'}.`;\n}\n// MARK\nexport function rangeMarkAlignmentCannotBeExpression(align) {\n return `The ${align} for range marks cannot be an expression`;\n}\nexport function lineWithRange(hasX2, hasY2) {\n const channels = hasX2 && hasY2 ? 'x2 and y2' : hasX2 ? 'x2' : 'y2';\n return `Line mark is for continuous lines and thus cannot be used with ${channels}. We will use the rule mark (line segments) instead.`;\n}\nexport function orientOverridden(original, actual) {\n return `Specified orient \"${original}\" overridden with \"${actual}\".`;\n}\n// SCALE\nexport const CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN = 'Custom domain scale cannot be unioned with default field-based domain.';\nexport const RANGE_STEP_DEPRECATED = `Scale's \"rangeStep\" is deprecated and will be removed in Vega-Lite 5.0. Please use \"width\"/\"height\": {\"step\": ...} instead. See https://vega.github.io/vega-lite/docs/size.html.`;\nexport function cannotUseScalePropertyWithNonColor(prop) {\n return `Cannot use the scale property \"${prop}\" with non-color channel.`;\n}\nexport function unaggregateDomainHasNoEffectForRawField(fieldDef) {\n return `Using unaggregated domain with raw field has no effect (${stringify(fieldDef)}).`;\n}\nexport function unaggregateDomainWithNonSharedDomainOp(aggregate) {\n return `Unaggregated domain not applicable for \"${aggregate}\" since it produces values outside the origin domain of the source data.`;\n}\nexport function unaggregatedDomainWithLogScale(fieldDef) {\n return `Unaggregated domain is currently unsupported for log scale (${stringify(fieldDef)}).`;\n}\nexport function cannotApplySizeToNonOrientedMark(mark) {\n return `Cannot apply size to non-oriented mark \"${mark}\".`;\n}\nexport function scaleTypeNotWorkWithChannel(channel, scaleType, defaultScaleType) {\n return `Channel \"${channel}\" does not work with \"${scaleType}\" scale. We are using \"${defaultScaleType}\" scale instead.`;\n}\nexport function scaleTypeNotWorkWithFieldDef(scaleType, defaultScaleType) {\n return `FieldDef does not work with \"${scaleType}\" scale. We are using \"${defaultScaleType}\" scale instead.`;\n}\nexport function scalePropertyNotWorkWithScaleType(scaleType, propName, channel) {\n return `${channel}-scale's \"${propName}\" is dropped as it does not work with ${scaleType} scale.`;\n}\nexport function scaleTypeNotWorkWithMark(mark, scaleType) {\n return `Scale type \"${scaleType}\" does not work with mark \"${mark}\".`;\n}\nexport function stepDropped(channel) {\n return `The step for \"${channel}\" is dropped because the ${channel === 'width' ? 'x' : 'y'} is continuous.`;\n}\nexport function mergeConflictingProperty(property, propertyOf, v1, v2) {\n return `Conflicting ${propertyOf.toString()} property \"${property.toString()}\" (${stringify(v1)} and ${stringify(v2)}). Using ${stringify(v1)}.`;\n}\nexport function mergeConflictingDomainProperty(property, propertyOf, v1, v2) {\n return `Conflicting ${propertyOf.toString()} property \"${property.toString()}\" (${stringify(v1)} and ${stringify(v2)}). Using the union of the two domains.`;\n}\nexport function independentScaleMeansIndependentGuide(channel) {\n return `Setting the scale to be independent for \"${channel}\" means we also have to set the guide (axis or legend) to be independent.`;\n}\nexport function domainSortDropped(sort) {\n return `Dropping sort property ${stringify(sort)} as unioned domains only support boolean or op \"count\", \"min\", and \"max\".`;\n}\nexport const MORE_THAN_ONE_SORT = 'Domains that should be unioned has conflicting sort properties. Sort will be set to true.';\nexport const FACETED_INDEPENDENT_DIFFERENT_SOURCES = 'Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.';\nexport const FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES = 'Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.';\nexport const FACETED_INDEPENDENT_SAME_SOURCE = 'Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.';\n// AXIS\nexport const INVALID_CHANNEL_FOR_AXIS = 'Invalid channel for axis.';\n// STACK\nexport function cannotStackRangedMark(channel) {\n return `Cannot stack \"${channel}\" if there is already \"${channel}2\".`;\n}\nexport function cannotStackNonLinearScale(scaleType) {\n return `Cannot stack non-linear scale (${scaleType}).`;\n}\nexport function stackNonSummativeAggregate(aggregate) {\n return `Stacking is applied even though the aggregate function is non-summative (\"${aggregate}\").`;\n}\n// TIMEUNIT\nexport function invalidTimeUnit(unitName, value) {\n return `Invalid ${unitName}: ${stringify(value)}.`;\n}\nexport function droppedDay(d) {\n return `Dropping day from datetime ${stringify(d)} as day cannot be combined with other units.`;\n}\nexport function errorBarCenterAndExtentAreNotNeeded(center, extent) {\n return `${extent ? 'extent ' : ''}${extent && center ? 'and ' : ''}${center ? 'center ' : ''}${extent && center ? 'are ' : 'is '}not needed when data are aggregated.`;\n}\nexport function errorBarCenterIsUsedWithWrongExtent(center, extent, mark) {\n return `${center} is not usually used with ${extent} for ${mark}.`;\n}\nexport function errorBarContinuousAxisHasCustomizedAggregate(aggregate, compositeMark) {\n return `Continuous axis should not have customized aggregation function ${aggregate}; ${compositeMark} already agregates the axis.`;\n}\nexport function errorBand1DNotSupport(property) {\n return `1D error band does not support ${property}.`;\n}\n// CHANNEL\nexport function channelRequiredForBinned(channel) {\n return `Channel ${channel} is required for \"binned\" bin.`;\n}\nexport function channelShouldNotBeUsedForBinned(channel) {\n return `Channel ${channel} should not be used with \"binned\" bin.`;\n}\nexport function domainRequiredForThresholdScale(channel) {\n return `Domain for ${channel} is required for threshold scale.`;\n}\n//# sourceMappingURL=message.js.map","/**\n * Vega-Lite's singleton logger utility.\n */\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n privateMap.set(receiver, value);\n return value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n return privateMap.get(receiver);\n};\nvar _level;\nimport { Debug, Error as ErrorLevel, Info, logger, Warn } from 'vega-util';\nimport * as message_1 from './message';\nexport { message_1 as message };\n/**\n * Main (default) Vega Logger instance for Vega-Lite.\n */\nconst main = logger(Warn);\nlet current = main;\n/**\n * Logger tool for checking if the code throws correct warning.\n */\nexport class LocalLogger {\n constructor() {\n this.warns = [];\n this.infos = [];\n this.debugs = [];\n _level.set(this, Warn);\n }\n level(_) {\n if (_) {\n __classPrivateFieldSet(this, _level, _);\n return this;\n }\n return __classPrivateFieldGet(this, _level);\n }\n warn(...args) {\n if (__classPrivateFieldGet(this, _level) >= Warn)\n this.warns.push(...args);\n return this;\n }\n info(...args) {\n if (__classPrivateFieldGet(this, _level) >= Info)\n this.infos.push(...args);\n return this;\n }\n debug(...args) {\n if (__classPrivateFieldGet(this, _level) >= Debug)\n this.debugs.push(...args);\n return this;\n }\n error(...args) {\n if (__classPrivateFieldGet(this, _level) >= ErrorLevel)\n throw Error(...args);\n return this;\n }\n}\n_level = new WeakMap();\nexport function wrap(f) {\n return () => {\n current = new LocalLogger();\n f(current);\n reset();\n };\n}\n/**\n * Set the singleton logger to be a custom logger.\n */\nexport function set(newLogger) {\n current = newLogger;\n return current;\n}\n/**\n * Reset the main logger to use the default Vega Logger.\n */\nexport function reset() {\n current = main;\n return current;\n}\nexport function error(...args) {\n current.error(...args);\n}\nexport function warn(...args) {\n current.warn(...args);\n}\nexport function info(...args) {\n current.info(...args);\n}\nexport function debug(...args) {\n current.debug(...args);\n}\n//# sourceMappingURL=index.js.map","// DateTime definition object\nimport { isNumber, isObject } from 'vega-util';\nimport * as log from './log';\nimport { TIMEUNIT_PARTS } from './timeunit';\nimport { duplicate, isNumeric, keys } from './util';\nexport function isDateTime(o) {\n if (o && isObject(o)) {\n for (const part of TIMEUNIT_PARTS) {\n if (part in o) {\n return true;\n }\n }\n }\n return false;\n}\nexport const MONTHS = [\n 'january',\n 'february',\n 'march',\n 'april',\n 'may',\n 'june',\n 'july',\n 'august',\n 'september',\n 'october',\n 'november',\n 'december'\n];\nexport const SHORT_MONTHS = MONTHS.map(m => m.substr(0, 3));\nexport const DAYS = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];\nexport const SHORT_DAYS = DAYS.map(d => d.substr(0, 3));\nfunction normalizeQuarter(q) {\n if (isNumeric(q)) {\n q = +q;\n }\n if (isNumber(q)) {\n if (q > 4) {\n log.warn(log.message.invalidTimeUnit('quarter', q));\n }\n // We accept 1-based quarter, so need to readjust to 0-based quarter\n return q - 1;\n }\n else {\n // Invalid quarter\n throw new Error(log.message.invalidTimeUnit('quarter', q));\n }\n}\nfunction normalizeMonth(m) {\n if (isNumeric(m)) {\n m = +m;\n }\n if (isNumber(m)) {\n // We accept 1-based month, so need to readjust to 0-based month\n return m - 1;\n }\n else {\n const lowerM = m.toLowerCase();\n const monthIndex = MONTHS.indexOf(lowerM);\n if (monthIndex !== -1) {\n return monthIndex; // 0 for january, ...\n }\n const shortM = lowerM.substr(0, 3);\n const shortMonthIndex = SHORT_MONTHS.indexOf(shortM);\n if (shortMonthIndex !== -1) {\n return shortMonthIndex;\n }\n // Invalid month\n throw new Error(log.message.invalidTimeUnit('month', m));\n }\n}\nfunction normalizeDay(d) {\n if (isNumeric(d)) {\n d = +d;\n }\n if (isNumber(d)) {\n // mod so that this can be both 0-based where 0 = sunday\n // and 1-based where 7=sunday\n return d % 7;\n }\n else {\n const lowerD = d.toLowerCase();\n const dayIndex = DAYS.indexOf(lowerD);\n if (dayIndex !== -1) {\n return dayIndex; // 0 for january, ...\n }\n const shortD = lowerD.substr(0, 3);\n const shortDayIndex = SHORT_DAYS.indexOf(shortD);\n if (shortDayIndex !== -1) {\n return shortDayIndex;\n }\n // Invalid day\n throw new Error(log.message.invalidTimeUnit('day', d));\n }\n}\n/**\n * @param d the date.\n * @param normalize whether to normalize quarter, month, day. This should probably be true if d is a DateTime.\n * @returns array of date time parts [year, month, day, hours, minutes, seconds, milliseconds]\n */\nfunction dateTimeParts(d, normalize) {\n const parts = [];\n if (normalize && d.day !== undefined) {\n if (keys(d).length > 1) {\n log.warn(log.message.droppedDay(d));\n d = duplicate(d);\n delete d.day;\n }\n }\n if (d.year !== undefined) {\n parts.push(d.year);\n }\n else {\n // Just like Vega's timeunit transform, set default year to 2012, so domain conversion will be compatible with Vega\n // Note: 2012 is a leap year (and so the date February 29 is respected) that begins on a Sunday (and so days of the week will order properly at the beginning of the year).\n parts.push(2012);\n }\n if (d.month !== undefined) {\n const month = normalize ? normalizeMonth(d.month) : d.month;\n parts.push(month);\n }\n else if (d.quarter !== undefined) {\n const quarter = normalize ? normalizeQuarter(d.quarter) : d.quarter;\n parts.push(isNumber(quarter) ? quarter * 3 : quarter + '*3');\n }\n else {\n parts.push(0); // months start at zero in JS\n }\n if (d.date !== undefined) {\n parts.push(d.date);\n }\n else if (d.day !== undefined) {\n // HACK: Day only works as a standalone unit\n // This is only correct because we always set year to 2006 for day\n const day = normalize ? normalizeDay(d.day) : d.day;\n parts.push(isNumber(day) ? day + 1 : day + '+1');\n }\n else {\n parts.push(1); // Date starts at 1 in JS\n }\n // Note: can't use TimeUnit enum here as importing it will create\n // circular dependency problem!\n for (const timeUnit of ['hours', 'minutes', 'seconds', 'milliseconds']) {\n const unit = d[timeUnit];\n parts.push(typeof unit === 'undefined' ? 0 : unit);\n }\n return parts;\n}\n/**\n * Return Vega expression for a date time.\n *\n * @param d the date time.\n * @returns the Vega expression.\n */\nexport function dateTimeToExpr(d) {\n const parts = dateTimeParts(d, true);\n const string = parts.join(', ');\n if (d.utc) {\n return `utc(${string})`;\n }\n else {\n return `datetime(${string})`;\n }\n}\n/**\n * Return Vega expression for a date time expression.\n *\n * @param d the internal date time object with expression.\n * @returns the Vega expression.\n */\nexport function dateTimeExprToExpr(d) {\n const parts = dateTimeParts(d, false);\n const string = parts.join(', ');\n if (d.utc) {\n return `utc(${string})`;\n }\n else {\n return `datetime(${string})`;\n }\n}\n/**\n * @param d the date time.\n * @returns the timestamp.\n */\nexport function dateTimeToTimestamp(d) {\n const parts = dateTimeParts(d, true);\n if (d.utc) {\n return +new Date(Date.UTC(...parts));\n }\n else {\n return +new Date(...parts);\n }\n}\n//# sourceMappingURL=datetime.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport stringify from 'fast-json-stable-stringify';\nimport { isObject, isString } from 'vega-util';\nimport { dateTimeExprToExpr } from './datetime';\nimport { accessPathWithDatum, keys, varName } from './util';\n/** Time Unit that only corresponds to only one part of Date objects. */\nexport const LOCAL_SINGLE_TIMEUNIT_INDEX = {\n year: 1,\n quarter: 1,\n month: 1,\n week: 1,\n day: 1,\n dayofyear: 1,\n date: 1,\n hours: 1,\n minutes: 1,\n seconds: 1,\n milliseconds: 1\n};\nexport const TIMEUNIT_PARTS = keys(LOCAL_SINGLE_TIMEUNIT_INDEX);\nexport function isLocalSingleTimeUnit(timeUnit) {\n return !!LOCAL_SINGLE_TIMEUNIT_INDEX[timeUnit];\n}\nexport const UTC_SINGLE_TIMEUNIT_INDEX = {\n utcyear: 1,\n utcquarter: 1,\n utcmonth: 1,\n utcweek: 1,\n utcday: 1,\n utcdayofyear: 1,\n utcdate: 1,\n utchours: 1,\n utcminutes: 1,\n utcseconds: 1,\n utcmilliseconds: 1\n};\nexport const LOCAL_MULTI_TIMEUNIT_INDEX = {\n yearquarter: 1,\n yearquartermonth: 1,\n yearmonth: 1,\n yearmonthdate: 1,\n yearmonthdatehours: 1,\n yearmonthdatehoursminutes: 1,\n yearmonthdatehoursminutesseconds: 1,\n yearweek: 1,\n yearweekday: 1,\n yearweekdayhours: 1,\n yearweekdayhoursminutes: 1,\n yearweekdayhoursminutesseconds: 1,\n yeardayofyear: 1,\n quartermonth: 1,\n monthdate: 1,\n monthdatehours: 1,\n monthdatehoursminutes: 1,\n monthdatehoursminutesseconds: 1,\n weekday: 1,\n weeksdayhours: 1,\n weekdayhoursminutes: 1,\n weekdayhoursminutesseconds: 1,\n dayhours: 1,\n dayhoursminutes: 1,\n dayhoursminutesseconds: 1,\n hoursminutes: 1,\n hoursminutesseconds: 1,\n minutesseconds: 1,\n secondsmilliseconds: 1\n};\nexport const UTC_MULTI_TIMEUNIT_INDEX = {\n utcyearquarter: 1,\n utcyearquartermonth: 1,\n utcyearmonth: 1,\n utcyearmonthdate: 1,\n utcyearmonthdatehours: 1,\n utcyearmonthdatehoursminutes: 1,\n utcyearmonthdatehoursminutesseconds: 1,\n utcyearweek: 1,\n utcyearweekday: 1,\n utcyearweekdayhours: 1,\n utcyearweekdayhoursminutes: 1,\n utcyearweekdayhoursminutesseconds: 1,\n utcyeardayofyear: 1,\n utcquartermonth: 1,\n utcmonthdate: 1,\n utcmonthdatehours: 1,\n utcmonthdatehoursminutes: 1,\n utcmonthdatehoursminutesseconds: 1,\n utcweekday: 1,\n utcweeksdayhours: 1,\n utcweekdayhoursminutes: 1,\n utcweekdayhoursminutesseconds: 1,\n utcdayhours: 1,\n utcdayhoursminutes: 1,\n utcdayhoursminutesseconds: 1,\n utchoursminutes: 1,\n utchoursminutesseconds: 1,\n utcminutesseconds: 1,\n utcsecondsmilliseconds: 1\n};\nexport function isUTCTimeUnit(t) {\n return t.startsWith('utc');\n}\nexport function getLocalTimeUnit(t) {\n return t.substr(3);\n}\n// In order of increasing specificity\nexport const VEGALITE_TIMEFORMAT = {\n 'year-month': '%b %Y ',\n 'year-month-date': '%b %d, %Y '\n};\nexport function getTimeUnitParts(timeUnit) {\n const parts = [];\n for (const part of TIMEUNIT_PARTS) {\n if (containsTimeUnit(timeUnit, part)) {\n parts.push(part);\n }\n }\n return parts;\n}\n/** Returns true if fullTimeUnit contains the timeUnit, false otherwise. */\nexport function containsTimeUnit(fullTimeUnit, timeUnit) {\n const index = fullTimeUnit.indexOf(timeUnit);\n if (index < 0) {\n return false;\n }\n // exclude milliseconds\n if (index > 0 && timeUnit === 'seconds' && fullTimeUnit.charAt(index - 1) === 'i') {\n return false;\n }\n // exclude dayofyear\n if (fullTimeUnit.length > index + 3 && timeUnit === 'day' && fullTimeUnit.charAt(index + 3) === 'o') {\n return false;\n }\n if (index > 0 && timeUnit === 'year' && fullTimeUnit.charAt(index - 1) === 'f') {\n return false;\n }\n return true;\n}\n/**\n * Returns Vega expression for a given timeUnit and fieldRef\n */\nexport function fieldExpr(fullTimeUnit, field, { end } = { end: false }) {\n const fieldRef = accessPathWithDatum(field);\n const utc = isUTCTimeUnit(fullTimeUnit) ? 'utc' : '';\n function func(timeUnit) {\n if (timeUnit === 'quarter') {\n // quarter starting at 0 (0,3,6,9).\n return `(${utc}quarter(${fieldRef})-1)`;\n }\n else {\n return `${utc}${timeUnit}(${fieldRef})`;\n }\n }\n let lastTimeUnit;\n const dateExpr = {};\n for (const part of TIMEUNIT_PARTS) {\n if (containsTimeUnit(fullTimeUnit, part)) {\n dateExpr[part] = func(part);\n lastTimeUnit = part;\n }\n }\n if (end) {\n dateExpr[lastTimeUnit] += '+1';\n }\n return dateTimeExprToExpr(dateExpr);\n}\nexport function timeUnitSpecifierExpression(timeUnit) {\n if (!timeUnit) {\n return undefined;\n }\n const timeUnitParts = getTimeUnitParts(timeUnit);\n return `timeUnitSpecifier(${stringify(timeUnitParts)}, ${stringify(VEGALITE_TIMEFORMAT)})`;\n}\n/**\n * Returns the signal expression used for axis labels for a time unit.\n */\nexport function formatExpression(timeUnit, field, isUTCScale) {\n if (!timeUnit) {\n return undefined;\n }\n const expr = timeUnitSpecifierExpression(timeUnit);\n // We only use utcFormat for utc scale\n // For utc time units, the data is already converted as a part of timeUnit transform.\n // Thus, utc time units should use timeFormat to avoid shifting the time twice.\n const utc = isUTCScale || isUTCTimeUnit(timeUnit);\n return `${utc ? 'utc' : 'time'}Format(${field}, ${expr})`;\n}\nexport function normalizeTimeUnit(timeUnit) {\n if (!timeUnit) {\n return undefined;\n }\n let params;\n if (isString(timeUnit)) {\n params = {\n unit: timeUnit\n };\n }\n else if (isObject(timeUnit)) {\n params = Object.assign(Object.assign({}, timeUnit), (timeUnit.unit ? { unit: timeUnit.unit } : {}));\n }\n if (isUTCTimeUnit(params.unit)) {\n params.utc = true;\n params.unit = getLocalTimeUnit(params.unit);\n }\n return params;\n}\nexport function timeUnitToString(tu) {\n const _a = normalizeTimeUnit(tu), { utc } = _a, rest = __rest(_a, [\"utc\"]);\n if (rest.unit) {\n return ((utc ? 'utc' : '') +\n keys(rest)\n .map(p => varName(`${p === 'unit' ? '' : `_${p}_`}${rest[p]}`))\n .join(''));\n }\n else {\n // when maxbins is specified instead of units\n return ((utc ? 'utc' : '') +\n 'timeunit' +\n keys(rest)\n .map(p => varName(`_${p}_${rest[p]}`))\n .join(''));\n }\n}\n//# sourceMappingURL=timeunit.js.map","import { isArray } from 'vega-util';\nimport { keys } from './util';\nexport function isSignalRef(o) {\n return o && !!o['signal'];\n}\nexport function isVgRangeStep(range) {\n return !!range['step'];\n}\nexport function isDataRefUnionedDomain(domain) {\n if (!isArray(domain)) {\n return 'fields' in domain && !('data' in domain);\n }\n return false;\n}\nexport function isFieldRefUnionDomain(domain) {\n if (!isArray(domain)) {\n return 'fields' in domain && 'data' in domain;\n }\n return false;\n}\nexport function isDataRefDomain(domain) {\n if (!isArray(domain)) {\n return 'field' in domain && 'data' in domain;\n }\n return false;\n}\nconst VG_MARK_CONFIG_INDEX = {\n aria: 1,\n description: 1,\n ariaRole: 1,\n ariaRoleDescription: 1,\n blend: 1,\n opacity: 1,\n fill: 1,\n fillOpacity: 1,\n stroke: 1,\n strokeCap: 1,\n strokeWidth: 1,\n strokeOpacity: 1,\n strokeDash: 1,\n strokeDashOffset: 1,\n strokeJoin: 1,\n strokeOffset: 1,\n strokeMiterLimit: 1,\n startAngle: 1,\n endAngle: 1,\n padAngle: 1,\n innerRadius: 1,\n outerRadius: 1,\n size: 1,\n shape: 1,\n interpolate: 1,\n tension: 1,\n orient: 1,\n align: 1,\n baseline: 1,\n text: 1,\n dir: 1,\n dx: 1,\n dy: 1,\n ellipsis: 1,\n limit: 1,\n radius: 1,\n theta: 1,\n angle: 1,\n font: 1,\n fontSize: 1,\n fontWeight: 1,\n fontStyle: 1,\n lineBreak: 1,\n lineHeight: 1,\n cursor: 1,\n href: 1,\n tooltip: 1,\n cornerRadius: 1,\n cornerRadiusTopLeft: 1,\n cornerRadiusTopRight: 1,\n cornerRadiusBottomLeft: 1,\n cornerRadiusBottomRight: 1,\n aspect: 1,\n width: 1,\n height: 1,\n url: 1,\n smooth: 1\n // commented below are vg channel that do not have mark config.\n // x: 1,\n // y: 1,\n // x2: 1,\n // y2: 1,\n // xc'|'yc'\n // clip: 1,\n // path: 1,\n // url: 1,\n};\nexport const VG_MARK_CONFIGS = keys(VG_MARK_CONFIG_INDEX);\nexport const VG_MARK_INDEX = {\n arc: 1,\n area: 1,\n group: 1,\n image: 1,\n line: 1,\n path: 1,\n rect: 1,\n rule: 1,\n shape: 1,\n symbol: 1,\n text: 1,\n trail: 1\n};\n// Vega's cornerRadius channels.\nexport const VG_CORNERRADIUS_CHANNELS = [\n 'cornerRadius',\n 'cornerRadiusTopLeft',\n 'cornerRadiusTopRight',\n 'cornerRadiusBottomLeft',\n 'cornerRadiusBottomRight'\n];\n//# sourceMappingURL=vega.schema.js.map","import { isArray } from 'vega-util';\nimport { valueExpr, vgField } from './channeldef';\nimport { fieldExpr as timeUnitFieldExpr, normalizeTimeUnit } from './timeunit';\nimport { isSignalRef } from './vega.schema';\nexport function isSelectionPredicate(predicate) {\n return predicate === null || predicate === void 0 ? void 0 : predicate['selection'];\n}\nexport function isFieldEqualPredicate(predicate) {\n return predicate && !!predicate.field && predicate.equal !== undefined;\n}\nexport function isFieldLTPredicate(predicate) {\n return predicate && !!predicate.field && predicate.lt !== undefined;\n}\nexport function isFieldLTEPredicate(predicate) {\n return predicate && !!predicate.field && predicate.lte !== undefined;\n}\nexport function isFieldGTPredicate(predicate) {\n return predicate && !!predicate.field && predicate.gt !== undefined;\n}\nexport function isFieldGTEPredicate(predicate) {\n return predicate && !!predicate.field && predicate.gte !== undefined;\n}\nexport function isFieldRangePredicate(predicate) {\n if (predicate && predicate.field) {\n if (isArray(predicate.range) && predicate.range.length === 2) {\n return true;\n }\n else if (isSignalRef(predicate.range)) {\n return true;\n }\n }\n return false;\n}\nexport function isFieldOneOfPredicate(predicate) {\n return (predicate && !!predicate.field && (isArray(predicate.oneOf) || isArray(predicate.in)) // backward compatibility\n );\n}\nexport function isFieldValidPredicate(predicate) {\n return predicate && !!predicate.field && predicate.valid !== undefined;\n}\nexport function isFieldPredicate(predicate) {\n return (isFieldOneOfPredicate(predicate) ||\n isFieldEqualPredicate(predicate) ||\n isFieldRangePredicate(predicate) ||\n isFieldLTPredicate(predicate) ||\n isFieldGTPredicate(predicate) ||\n isFieldLTEPredicate(predicate) ||\n isFieldGTEPredicate(predicate));\n}\nfunction predicateValueExpr(v, timeUnit) {\n return valueExpr(v, { timeUnit, wrapTime: true });\n}\nfunction predicateValuesExpr(vals, timeUnit) {\n return vals.map(v => predicateValueExpr(v, timeUnit));\n}\n// This method is used by Voyager. Do not change its behavior without changing Voyager.\nexport function fieldFilterExpression(predicate, useInRange = true) {\n var _a;\n const { field } = predicate;\n const timeUnit = (_a = normalizeTimeUnit(predicate.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit;\n const fieldExpr = timeUnit\n ? // For timeUnit, cast into integer with time() so we can use ===, inrange, indexOf to compare values directly.\n // TODO: We calculate timeUnit on the fly here. Consider if we would like to consolidate this with timeUnit pipeline\n // TODO: support utc\n 'time(' + timeUnitFieldExpr(timeUnit, field) + ')'\n : vgField(predicate, { expr: 'datum' });\n if (isFieldEqualPredicate(predicate)) {\n return fieldExpr + '===' + predicateValueExpr(predicate.equal, timeUnit);\n }\n else if (isFieldLTPredicate(predicate)) {\n const upper = predicate.lt;\n return `${fieldExpr}<${predicateValueExpr(upper, timeUnit)}`;\n }\n else if (isFieldGTPredicate(predicate)) {\n const lower = predicate.gt;\n return `${fieldExpr}>${predicateValueExpr(lower, timeUnit)}`;\n }\n else if (isFieldLTEPredicate(predicate)) {\n const upper = predicate.lte;\n return `${fieldExpr}<=${predicateValueExpr(upper, timeUnit)}`;\n }\n else if (isFieldGTEPredicate(predicate)) {\n const lower = predicate.gte;\n return `${fieldExpr}>=${predicateValueExpr(lower, timeUnit)}`;\n }\n else if (isFieldOneOfPredicate(predicate)) {\n return `indexof([${predicateValuesExpr(predicate.oneOf, timeUnit).join(',')}], ${fieldExpr}) !== -1`;\n }\n else if (isFieldValidPredicate(predicate)) {\n return fieldValidPredicate(fieldExpr, predicate.valid);\n }\n else if (isFieldRangePredicate(predicate)) {\n const { range } = predicate;\n const lower = isSignalRef(range) ? { signal: `${range.signal}[0]` } : range[0];\n const upper = isSignalRef(range) ? { signal: `${range.signal}[1]` } : range[1];\n if (lower !== null && upper !== null && useInRange) {\n return ('inrange(' +\n fieldExpr +\n ', [' +\n predicateValueExpr(lower, timeUnit) +\n ', ' +\n predicateValueExpr(upper, timeUnit) +\n '])');\n }\n const exprs = [];\n if (lower !== null) {\n exprs.push(`${fieldExpr} >= ${predicateValueExpr(lower, timeUnit)}`);\n }\n if (upper !== null) {\n exprs.push(`${fieldExpr} <= ${predicateValueExpr(upper, timeUnit)}`);\n }\n return exprs.length > 0 ? exprs.join(' && ') : 'true';\n }\n /* istanbul ignore next: it should never reach here */\n throw new Error(`Invalid field predicate: ${JSON.stringify(predicate)}`);\n}\nexport function fieldValidPredicate(fieldExpr, valid = true) {\n if (valid) {\n return `isValid(${fieldExpr}) && isFinite(+${fieldExpr})`;\n }\n else {\n return `!isValid(${fieldExpr}) || !isFinite(+${fieldExpr})`;\n }\n}\nexport function normalizePredicate(f) {\n var _a;\n if (isFieldPredicate(f) && f.timeUnit) {\n return Object.assign(Object.assign({}, f), { timeUnit: (_a = normalizeTimeUnit(f.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit });\n }\n return f;\n}\n//# sourceMappingURL=predicate.js.map","import { keys } from './util';\n/**\n * Data type based on level of measurement\n */\nexport const Type = {\n quantitative: 'quantitative',\n ordinal: 'ordinal',\n temporal: 'temporal',\n nominal: 'nominal',\n geojson: 'geojson'\n};\nexport function isType(t) {\n return t in Type;\n}\nexport const QUANTITATIVE = Type.quantitative;\nexport const ORDINAL = Type.ordinal;\nexport const TEMPORAL = Type.temporal;\nexport const NOMINAL = Type.nominal;\nexport const GEOJSON = Type.geojson;\nexport const TYPES = keys(Type);\n/**\n * Get full, lowercase type name for a given type.\n * @param type\n * @return Full type name.\n */\nexport function getFullName(type) {\n if (type) {\n type = type.toLowerCase();\n switch (type) {\n case 'q':\n case QUANTITATIVE:\n return 'quantitative';\n case 't':\n case TEMPORAL:\n return 'temporal';\n case 'o':\n case ORDINAL:\n return 'ordinal';\n case 'n':\n case NOMINAL:\n return 'nominal';\n case GEOJSON:\n return 'geojson';\n }\n }\n // If we get invalid input, return undefined type.\n return undefined;\n}\n//# sourceMappingURL=type.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isString, toSet } from 'vega-util';\nimport * as CHANNEL from './channel';\nimport { isColorChannel } from './channel';\nimport * as log from './log';\nimport { NOMINAL, ORDINAL, QUANTITATIVE, TEMPORAL } from './type';\nimport { contains, keys } from './util';\nexport const ScaleType = {\n // Continuous - Quantitative\n LINEAR: 'linear',\n LOG: 'log',\n POW: 'pow',\n SQRT: 'sqrt',\n SYMLOG: 'symlog',\n IDENTITY: 'identity',\n SEQUENTIAL: 'sequential',\n // Continuous - Time\n TIME: 'time',\n UTC: 'utc',\n // Discretizing scales\n QUANTILE: 'quantile',\n QUANTIZE: 'quantize',\n THRESHOLD: 'threshold',\n BIN_ORDINAL: 'bin-ordinal',\n // Discrete scales\n ORDINAL: 'ordinal',\n POINT: 'point',\n BAND: 'band'\n};\n/**\n * Index for scale categories -- only scale of the same categories can be merged together.\n * Current implementation is trying to be conservative and avoid merging scale type that might not work together\n */\nexport const SCALE_CATEGORY_INDEX = {\n linear: 'numeric',\n log: 'numeric',\n pow: 'numeric',\n sqrt: 'numeric',\n symlog: 'numeric',\n identity: 'numeric',\n sequential: 'numeric',\n time: 'time',\n utc: 'time',\n ordinal: 'ordinal',\n 'bin-ordinal': 'bin-ordinal',\n point: 'ordinal-position',\n band: 'ordinal-position',\n quantile: 'discretizing',\n quantize: 'discretizing',\n threshold: 'discretizing'\n};\nexport const SCALE_TYPES = keys(SCALE_CATEGORY_INDEX);\n/**\n * Whether the two given scale types can be merged together.\n */\nexport function scaleCompatible(scaleType1, scaleType2) {\n const scaleCategory1 = SCALE_CATEGORY_INDEX[scaleType1];\n const scaleCategory2 = SCALE_CATEGORY_INDEX[scaleType2];\n return (scaleCategory1 === scaleCategory2 ||\n (scaleCategory1 === 'ordinal-position' && scaleCategory2 === 'time') ||\n (scaleCategory2 === 'ordinal-position' && scaleCategory1 === 'time'));\n}\n/**\n * Index for scale precedence -- high score = higher priority for merging.\n */\nconst SCALE_PRECEDENCE_INDEX = {\n // numeric\n linear: 0,\n log: 1,\n pow: 1,\n sqrt: 1,\n symlog: 1,\n identity: 1,\n sequential: 1,\n // time\n time: 0,\n utc: 0,\n // ordinal-position -- these have higher precedence than continuous scales as they support more types of data\n point: 10,\n band: 11,\n // non grouped types\n ordinal: 0,\n 'bin-ordinal': 0,\n quantile: 0,\n quantize: 0,\n threshold: 0\n};\n/**\n * Return scale categories -- only scale of the same categories can be merged together.\n */\nexport function scaleTypePrecedence(scaleType) {\n return SCALE_PRECEDENCE_INDEX[scaleType];\n}\nexport const CONTINUOUS_TO_CONTINUOUS_SCALES = ['linear', 'log', 'pow', 'sqrt', 'symlog', 'time', 'utc'];\nconst CONTINUOUS_TO_CONTINUOUS_INDEX = toSet(CONTINUOUS_TO_CONTINUOUS_SCALES);\nexport const QUANTITATIVE_SCALES = ['linear', 'log', 'pow', 'sqrt', 'symlog'];\nconst QUANTITATIVE_SCALES_INDEX = toSet(QUANTITATIVE_SCALES);\nexport function isQuantitative(type) {\n return type in QUANTITATIVE_SCALES_INDEX;\n}\nexport const CONTINUOUS_TO_DISCRETE_SCALES = ['quantile', 'quantize', 'threshold'];\nconst CONTINUOUS_TO_DISCRETE_INDEX = toSet(CONTINUOUS_TO_DISCRETE_SCALES);\nexport const CONTINUOUS_DOMAIN_SCALES = CONTINUOUS_TO_CONTINUOUS_SCALES.concat([\n 'quantile',\n 'quantize',\n 'threshold',\n 'sequential',\n 'identity'\n]);\nconst CONTINUOUS_DOMAIN_INDEX = toSet(CONTINUOUS_DOMAIN_SCALES);\nexport const DISCRETE_DOMAIN_SCALES = ['ordinal', 'bin-ordinal', 'point', 'band'];\nconst DISCRETE_DOMAIN_INDEX = toSet(DISCRETE_DOMAIN_SCALES);\nexport const TIME_SCALE_TYPES = ['time', 'utc'];\nexport function hasDiscreteDomain(type) {\n return type in DISCRETE_DOMAIN_INDEX;\n}\nexport function hasContinuousDomain(type) {\n return type in CONTINUOUS_DOMAIN_INDEX;\n}\nexport function isContinuousToContinuous(type) {\n return type in CONTINUOUS_TO_CONTINUOUS_INDEX;\n}\nexport function isContinuousToDiscrete(type) {\n return type in CONTINUOUS_TO_DISCRETE_INDEX;\n}\nexport const defaultScaleConfig = {\n pointPadding: 0.5,\n barBandPaddingInner: 0.1,\n rectBandPaddingInner: 0,\n minBandSize: 2,\n minFontSize: 8,\n maxFontSize: 40,\n minOpacity: 0.3,\n maxOpacity: 0.8,\n // FIXME: revise if these *can* become ratios of width/height step\n minSize: 9,\n minStrokeWidth: 1,\n maxStrokeWidth: 4,\n quantileCount: 4,\n quantizeCount: 4\n};\nexport function isExtendedScheme(scheme) {\n return !isString(scheme) && !!scheme['name'];\n}\nexport function isSelectionDomain(domain) {\n return domain === null || domain === void 0 ? void 0 : domain['selection'];\n}\nexport function isDomainUnionWith(domain) {\n return domain && domain['unionWith'];\n}\nconst SCALE_PROPERTY_INDEX = {\n type: 1,\n domain: 1,\n domainMax: 1,\n domainMin: 1,\n domainMid: 1,\n align: 1,\n range: 1,\n rangeMax: 1,\n rangeMin: 1,\n scheme: 1,\n bins: 1,\n // Other properties\n reverse: 1,\n round: 1,\n // quantitative / time\n clamp: 1,\n nice: 1,\n // quantitative\n base: 1,\n exponent: 1,\n constant: 1,\n interpolate: 1,\n zero: 1,\n // band/point\n padding: 1,\n paddingInner: 1,\n paddingOuter: 1\n};\nexport const SCALE_PROPERTIES = keys(SCALE_PROPERTY_INDEX);\nconst { type, domain, range, rangeMax, rangeMin, scheme } = SCALE_PROPERTY_INDEX, NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTY_INDEX = __rest(SCALE_PROPERTY_INDEX, [\"type\", \"domain\", \"range\", \"rangeMax\", \"rangeMin\", \"scheme\"]);\nexport const NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES = keys(NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTY_INDEX);\nexport function scaleTypeSupportProperty(scaleType, propName) {\n switch (propName) {\n case 'type':\n case 'domain':\n case 'reverse':\n case 'range':\n return true;\n case 'scheme':\n case 'interpolate':\n return !contains(['point', 'band', 'identity'], scaleType);\n case 'bins':\n return !contains(['point', 'band', 'identity', 'ordinal'], scaleType);\n case 'round':\n return isContinuousToContinuous(scaleType) || scaleType === 'band' || scaleType === 'point';\n case 'padding':\n case 'rangeMin':\n case 'rangeMax':\n return isContinuousToContinuous(scaleType) || contains(['point', 'band'], scaleType);\n case 'paddingOuter':\n case 'align':\n return contains(['point', 'band'], scaleType);\n case 'paddingInner':\n return scaleType === 'band';\n case 'domainMax':\n case 'domainMid':\n case 'domainMin':\n case 'clamp':\n return isContinuousToContinuous(scaleType);\n case 'nice':\n return isContinuousToContinuous(scaleType) || scaleType === 'quantize' || scaleType === 'threshold';\n case 'exponent':\n return scaleType === 'pow';\n case 'base':\n return scaleType === 'log';\n case 'constant':\n return scaleType === 'symlog';\n case 'zero':\n return (hasContinuousDomain(scaleType) &&\n !contains([\n 'log',\n 'time',\n 'utc',\n 'threshold',\n 'quantile' // quantile depends on distribution so zero does not matter\n ], scaleType));\n }\n}\n/**\n * Returns undefined if the input channel supports the input scale property name\n */\nexport function channelScalePropertyIncompatability(channel, propName) {\n switch (propName) {\n case 'interpolate':\n case 'scheme':\n case 'domainMid':\n if (!isColorChannel(channel)) {\n return log.message.cannotUseScalePropertyWithNonColor(channel);\n }\n return undefined;\n case 'align':\n case 'type':\n case 'bins':\n case 'domain':\n case 'domainMax':\n case 'domainMin':\n case 'range':\n case 'base':\n case 'exponent':\n case 'constant':\n case 'nice':\n case 'padding':\n case 'paddingInner':\n case 'paddingOuter':\n case 'rangeMax':\n case 'rangeMin':\n case 'reverse':\n case 'round':\n case 'clamp':\n case 'zero':\n return undefined; // GOOD!\n }\n}\nexport function scaleTypeSupportDataType(specifiedType, fieldDefType) {\n if (contains([ORDINAL, NOMINAL], fieldDefType)) {\n return specifiedType === undefined || hasDiscreteDomain(specifiedType);\n }\n else if (fieldDefType === TEMPORAL) {\n return contains([ScaleType.TIME, ScaleType.UTC, undefined], specifiedType);\n }\n else if (fieldDefType === QUANTITATIVE) {\n return contains([\n ScaleType.LOG,\n ScaleType.POW,\n ScaleType.SQRT,\n ScaleType.SYMLOG,\n ScaleType.QUANTILE,\n ScaleType.QUANTIZE,\n ScaleType.THRESHOLD,\n ScaleType.LINEAR,\n undefined\n ], specifiedType);\n }\n return true;\n}\nexport function channelSupportScaleType(channel, scaleType) {\n if (!CHANNEL.isScaleChannel(channel)) {\n return false;\n }\n switch (channel) {\n case CHANNEL.X:\n case CHANNEL.Y:\n case CHANNEL.THETA:\n case CHANNEL.RADIUS:\n return isContinuousToContinuous(scaleType) || contains(['band', 'point'], scaleType);\n case CHANNEL.SIZE: // TODO: size and opacity can support ordinal with more modification\n case CHANNEL.STROKEWIDTH:\n case CHANNEL.OPACITY:\n case CHANNEL.FILLOPACITY:\n case CHANNEL.STROKEOPACITY:\n case CHANNEL.ANGLE:\n // Although it generally doesn't make sense to use band with size and opacity,\n // it can also work since we use band: 0.5 to get midpoint.\n return (isContinuousToContinuous(scaleType) ||\n isContinuousToDiscrete(scaleType) ||\n contains(['band', 'point', 'ordinal'], scaleType));\n case CHANNEL.COLOR:\n case CHANNEL.FILL:\n case CHANNEL.STROKE:\n return scaleType !== 'band'; // band does not make sense with color\n case CHANNEL.STROKEDASH:\n return scaleType === 'ordinal' || isContinuousToDiscrete(scaleType);\n case CHANNEL.SHAPE:\n return scaleType === 'ordinal'; // shape = lookup only\n }\n}\n//# sourceMappingURL=scale.js.map","import { signalRefOrValue } from './compile/common';\nimport { keys } from './util';\nimport { isSignalRef } from './vega.schema';\nexport function isExprRef(o) {\n return o && !!o['expr'];\n}\nexport function isExprOrSignalRef(o) {\n return isExprRef(o) || isSignalRef(o);\n}\nexport function replaceExprRefInIndex(index) {\n const props = keys(index || {});\n const newIndex = {};\n for (const prop of props) {\n newIndex[prop] = signalRefOrValue(index[prop]);\n }\n return newIndex;\n}\n//# sourceMappingURL=expr.js.map","import { toSet } from 'vega-util';\nimport { contains, keys } from './util';\n/**\n * All types of primitive marks.\n */\nexport const Mark = {\n arc: 'arc',\n area: 'area',\n bar: 'bar',\n image: 'image',\n line: 'line',\n point: 'point',\n rect: 'rect',\n rule: 'rule',\n text: 'text',\n tick: 'tick',\n trail: 'trail',\n circle: 'circle',\n square: 'square',\n geoshape: 'geoshape'\n};\nexport const ARC = Mark.arc;\nexport const AREA = Mark.area;\nexport const BAR = Mark.bar;\nexport const IMAGE = Mark.image;\nexport const LINE = Mark.line;\nexport const POINT = Mark.point;\nexport const RECT = Mark.rect;\nexport const RULE = Mark.rule;\nexport const TEXT = Mark.text;\nexport const TICK = Mark.tick;\nexport const TRAIL = Mark.trail;\nexport const CIRCLE = Mark.circle;\nexport const SQUARE = Mark.square;\nexport const GEOSHAPE = Mark.geoshape;\nexport function isMark(m) {\n return m in Mark;\n}\nexport function isPathMark(m) {\n return contains(['line', 'area', 'trail'], m);\n}\nexport function isRectBasedMark(m) {\n return contains(['rect', 'bar', 'image', 'arc' /* arc is rect/interval in polar coordinate */], m);\n}\nexport const PRIMITIVE_MARKS = keys(Mark);\nexport function isMarkDef(mark) {\n return mark['type'];\n}\nconst PRIMITIVE_MARK_INDEX = toSet(PRIMITIVE_MARKS);\nexport function isPrimitiveMark(mark) {\n const markType = isMarkDef(mark) ? mark.type : mark;\n return markType in PRIMITIVE_MARK_INDEX;\n}\nexport const STROKE_CONFIG = [\n 'stroke',\n 'strokeWidth',\n 'strokeDash',\n 'strokeDashOffset',\n 'strokeOpacity',\n 'strokeJoin',\n 'strokeMiterLimit'\n];\nexport const FILL_CONFIG = ['fill', 'fillOpacity'];\nexport const FILL_STROKE_CONFIG = [...STROKE_CONFIG, ...FILL_CONFIG];\nconst VL_ONLY_MARK_CONFIG_INDEX = {\n color: 1,\n filled: 1,\n invalid: 1,\n order: 1,\n radius2: 1,\n theta2: 1,\n timeUnitBand: 1,\n timeUnitBandPosition: 1\n};\nexport const VL_ONLY_MARK_CONFIG_PROPERTIES = keys(VL_ONLY_MARK_CONFIG_INDEX);\nexport const VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX = {\n area: ['line', 'point'],\n bar: ['binSpacing', 'continuousBandSize', 'discreteBandSize'],\n rect: ['binSpacing', 'continuousBandSize', 'discreteBandSize'],\n line: ['point'],\n tick: ['bandSize', 'thickness']\n};\nexport const defaultMarkConfig = {\n color: '#4c78a8',\n invalid: 'filter',\n timeUnitBand: 1\n};\nconst MARK_CONFIG_INDEX = {\n mark: 1,\n arc: 1,\n area: 1,\n bar: 1,\n circle: 1,\n image: 1,\n line: 1,\n point: 1,\n rect: 1,\n rule: 1,\n square: 1,\n text: 1,\n tick: 1,\n trail: 1,\n geoshape: 1\n};\nexport const MARK_CONFIGS = keys(MARK_CONFIG_INDEX);\nexport const BAR_CORNER_RADIUS_INDEX = {\n horizontal: ['cornerRadiusTopRight', 'cornerRadiusBottomRight'],\n vertical: ['cornerRadiusTopLeft', 'cornerRadiusTopRight']\n};\nconst DEFAULT_RECT_BAND_SIZE = 5;\nexport const defaultBarConfig = {\n binSpacing: 1,\n continuousBandSize: DEFAULT_RECT_BAND_SIZE,\n timeUnitBandPosition: 0.5\n};\nexport const defaultRectConfig = {\n binSpacing: 0,\n continuousBandSize: DEFAULT_RECT_BAND_SIZE,\n timeUnitBandPosition: 0.5\n};\nexport const defaultTickConfig = {\n thickness: 1\n};\nexport function getMarkType(m) {\n return isMarkDef(m) ? m.type : m;\n}\n//# sourceMappingURL=mark.js.map","import { isFunction, isString } from 'vega-util';\nimport { isCountingAggregateOp } from '../../../aggregate';\nimport { isBinned, isBinning } from '../../../bin';\nimport { getMainRangeChannel, X, X2, Y2 } from '../../../channel';\nimport { binRequiresRange, getBand, isDatumDef, isFieldDef, isFieldOrDatumDef, isTypedFieldDef, isValueDef, vgField } from '../../../channeldef';\nimport { dateTimeToExpr, isDateTime } from '../../../datetime';\nimport { isExprRef } from '../../../expr';\nimport * as log from '../../../log';\nimport { isPathMark } from '../../../mark';\nimport { fieldValidPredicate } from '../../../predicate';\nimport { hasDiscreteDomain, isContinuousToContinuous } from '../../../scale';\nimport { TEMPORAL } from '../../../type';\nimport { contains } from '../../../util';\nimport { isSignalRef } from '../../../vega.schema';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nexport function midPointRefWithPositionInvalidTest(params) {\n const { channel, channelDef, markDef, scale, config } = params;\n const ref = midPoint(params);\n // Wrap to check if the positional value is invalid, if so, plot the point on the min value\n if (\n // Only this for field def without counting aggregate (as count wouldn't be null)\n isFieldDef(channelDef) &&\n !isCountingAggregateOp(channelDef.aggregate) &&\n // and only for continuous scale without zero (otherwise, null / invalid will be interpreted as zero, which doesn't cause layout problem)\n scale &&\n isContinuousToContinuous(scale.get('type')) &&\n scale.get('zero') === false) {\n return wrapPositionInvalidTest({\n fieldDef: channelDef,\n channel,\n markDef,\n ref,\n config\n });\n }\n return ref;\n}\nexport function wrapPositionInvalidTest({ fieldDef, channel, markDef, ref, config }) {\n if (isPathMark(markDef.type)) {\n // path mark already use defined to skip points, no need to do it here.\n return ref;\n }\n const invalid = getMarkPropOrConfig('invalid', markDef, config);\n if (invalid === null) {\n // if there is no invalid filter, don't do the invalid test\n return ref;\n }\n return [fieldInvalidTestValueRef(fieldDef, channel), ref];\n}\nexport function fieldInvalidTestValueRef(fieldDef, channel) {\n const test = fieldInvalidPredicate(fieldDef, true);\n const mainChannel = getMainRangeChannel(channel); // we can cast here as the output can't be other things.\n const zeroValueRef = mainChannel === 'y'\n ? { field: { group: 'height' } }\n : // x / angle / radius can all use 0\n { value: 0 };\n return Object.assign({ test }, zeroValueRef);\n}\nexport function fieldInvalidPredicate(field, invalid = true) {\n return fieldValidPredicate(isString(field) ? field : vgField(field, { expr: 'datum' }), !invalid);\n}\nexport function datumDefToExpr(datumDef) {\n const { datum } = datumDef;\n if (isDateTime(datum)) {\n return dateTimeToExpr(datum);\n }\n return `${JSON.stringify(datum)}`;\n}\nexport function valueRefForFieldOrDatumDef(fieldDef, scaleName, opt, encode) {\n const ref = {};\n if (scaleName) {\n ref.scale = scaleName;\n }\n if (isDatumDef(fieldDef)) {\n const { datum } = fieldDef;\n if (isDateTime(datum)) {\n ref.signal = dateTimeToExpr(datum);\n }\n else if (isSignalRef(datum)) {\n ref.signal = datum.signal;\n }\n else if (isExprRef(datum)) {\n ref.signal = datum.expr;\n }\n else {\n ref.value = datum;\n }\n }\n else {\n ref.field = vgField(fieldDef, opt);\n }\n if (encode) {\n const { offset, band } = encode;\n if (offset) {\n ref.offset = offset;\n }\n if (band) {\n ref.band = band;\n }\n }\n return ref;\n}\n/**\n * Signal that returns the middle of a bin from start and end field. Should only be used with x and y.\n */\nexport function interpolatedSignalRef({ scaleName, fieldOrDatumDef, fieldOrDatumDef2, offset, startSuffix, band = 0.5 }) {\n const expr = 0 < band && band < 1 ? 'datum' : undefined;\n const start = vgField(fieldOrDatumDef, { expr, suffix: startSuffix });\n const end = fieldOrDatumDef2 !== undefined\n ? vgField(fieldOrDatumDef2, { expr })\n : vgField(fieldOrDatumDef, { suffix: 'end', expr });\n const ref = {};\n if (band === 0 || band === 1) {\n ref.scale = scaleName;\n const val = band === 0 ? start : end;\n ref.field = val;\n }\n else {\n const datum = `${band} * ${start} + ${1 - band} * ${end}`;\n ref.signal = `scale(\"${scaleName}\", ${datum})`;\n }\n if (offset) {\n ref.offset = offset;\n }\n return ref;\n}\n/**\n * @returns {VgValueRef} Value Ref for xc / yc or mid point for other channels.\n */\nexport function midPoint({ channel, channelDef, channel2Def, markDef, config, scaleName, scale, stack, offset, defaultRef, band }) {\n var _a;\n // TODO: datum support\n if (channelDef) {\n /* istanbul ignore else */\n if (isFieldOrDatumDef(channelDef)) {\n if (isTypedFieldDef(channelDef)) {\n band = band !== null && band !== void 0 ? band : getBand({\n channel,\n fieldDef: channelDef,\n fieldDef2: channel2Def,\n markDef,\n stack,\n config,\n isMidPoint: true\n });\n const { bin, timeUnit, type } = channelDef;\n if (isBinning(bin) || (band && timeUnit && type === TEMPORAL)) {\n // Use middle only for x an y to place marks in the center between start and end of the bin range.\n // We do not use the mid point for other channels (e.g. size) so that properties of legends and marks match.\n if (stack && stack.impute) {\n // For stack, we computed bin_mid so we can impute.\n return valueRefForFieldOrDatumDef(channelDef, scaleName, { binSuffix: 'mid' }, { offset });\n }\n if (band) {\n // if band = 0, no need to call interpolation\n // For non-stack, we can just calculate bin mid on the fly using signal.\n return interpolatedSignalRef({ scaleName, fieldOrDatumDef: channelDef, band, offset });\n }\n return valueRefForFieldOrDatumDef(channelDef, scaleName, binRequiresRange(channelDef, channel) ? { binSuffix: 'range' } : {}, {\n offset\n });\n }\n else if (isBinned(bin)) {\n if (isFieldDef(channel2Def)) {\n return interpolatedSignalRef({\n scaleName,\n fieldOrDatumDef: channelDef,\n fieldOrDatumDef2: channel2Def,\n band,\n offset\n });\n }\n else {\n const channel2 = channel === X ? X2 : Y2;\n log.warn(log.message.channelRequiredForBinned(channel2));\n }\n }\n }\n const scaleType = scale === null || scale === void 0 ? void 0 : scale.get('type');\n return valueRefForFieldOrDatumDef(channelDef, scaleName, hasDiscreteDomain(scaleType) ? { binSuffix: 'range' } : {}, // no need for bin suffix if there is no scale\n {\n offset,\n // For band, to get mid point, need to offset by half of the band\n band: scaleType === 'band' ? (_a = band !== null && band !== void 0 ? band : channelDef.band) !== null && _a !== void 0 ? _a : 0.5 : undefined\n });\n }\n else if (isValueDef(channelDef)) {\n const value = channelDef.value;\n const offsetMixins = offset ? { offset } : {};\n return Object.assign(Object.assign({}, widthHeightValueOrSignalRef(channel, value)), offsetMixins);\n }\n // If channelDef is neither field def or value def, it's a condition-only def.\n // In such case, we will use default ref.\n }\n if (isFunction(defaultRef)) {\n defaultRef = defaultRef();\n }\n if (defaultRef) {\n // for non-position, ref could be undefined.\n return Object.assign(Object.assign({}, defaultRef), (offset ? { offset } : {}));\n }\n return defaultRef;\n}\n/**\n * Convert special \"width\" and \"height\" values in Vega-Lite into Vega value ref.\n */\nexport function widthHeightValueOrSignalRef(channel, value) {\n if (contains(['x', 'x2'], channel) && value === 'width') {\n return { field: { group: 'width' } };\n }\n else if (contains(['y', 'y2'], channel) && value === 'height') {\n return { field: { group: 'height' } };\n }\n return signalOrValueRef(value);\n}\n//# sourceMappingURL=valueref.js.map","import { isString } from 'vega-util';\nimport { isBinning } from '../bin';\nimport { channelDefType, isFieldDef, isFieldOrDatumDefForTimeFormat, isScaleFieldDef, vgField } from '../channeldef';\nimport { fieldValidPredicate } from '../predicate';\nimport { ScaleType } from '../scale';\nimport { formatExpression, normalizeTimeUnit, timeUnitSpecifierExpression } from '../timeunit';\nimport { QUANTITATIVE } from '../type';\nimport { isSignalRef } from '../vega.schema';\nimport { datumDefToExpr } from './mark/encode/valueref';\nexport function isCustomFormatType(formatType) {\n return formatType && formatType !== 'number' && formatType !== 'time';\n}\nfunction customFormatExpr(formatType, field, format) {\n return `${formatType}(${field}${format ? `, ${JSON.stringify(format)}` : ''})`;\n}\nexport const BIN_RANGE_DELIMITER = ' \\u2013 ';\nexport function formatSignalRef({ fieldOrDatumDef, format, formatType, expr, normalizeStack, config }) {\n var _a, _b;\n if (isCustomFormatType(formatType)) {\n return formatCustomType({\n fieldOrDatumDef,\n format,\n formatType,\n expr,\n config\n });\n }\n const field = fieldToFormat(fieldOrDatumDef, expr, normalizeStack);\n if (isFieldOrDatumDefForTimeFormat(fieldOrDatumDef)) {\n const signal = timeFormatExpression(field, isFieldDef(fieldOrDatumDef) ? (_a = normalizeTimeUnit(fieldOrDatumDef.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit : undefined, format, config.timeFormat, isScaleFieldDef(fieldOrDatumDef) && ((_b = fieldOrDatumDef.scale) === null || _b === void 0 ? void 0 : _b.type) === ScaleType.UTC);\n return signal ? { signal } : undefined;\n }\n format = numberFormat(channelDefType(fieldOrDatumDef), format, config);\n if (isFieldDef(fieldOrDatumDef) && isBinning(fieldOrDatumDef.bin)) {\n const endField = vgField(fieldOrDatumDef, { expr, binSuffix: 'end' });\n return {\n signal: binFormatExpression(field, endField, format, formatType, config)\n };\n }\n else if (format || channelDefType(fieldOrDatumDef) === 'quantitative') {\n return {\n signal: `${formatExpr(field, format)}`\n };\n }\n else {\n return { signal: `isValid(${field}) ? ${field} : \"\"+${field}` };\n }\n}\nfunction fieldToFormat(fieldOrDatumDef, expr, normalizeStack) {\n if (isFieldDef(fieldOrDatumDef)) {\n if (normalizeStack) {\n return `${vgField(fieldOrDatumDef, { expr, suffix: 'end' })}-${vgField(fieldOrDatumDef, {\n expr,\n suffix: 'start'\n })}`;\n }\n else {\n return vgField(fieldOrDatumDef, { expr });\n }\n }\n else {\n return datumDefToExpr(fieldOrDatumDef);\n }\n}\nexport function formatCustomType({ fieldOrDatumDef, format, formatType, expr, normalizeStack, config, field }) {\n field = field !== null && field !== void 0 ? field : fieldToFormat(fieldOrDatumDef, expr, normalizeStack);\n if (isFieldDef(fieldOrDatumDef) && isBinning(fieldOrDatumDef.bin)) {\n const endField = vgField(fieldOrDatumDef, { expr, binSuffix: 'end' });\n return {\n signal: binFormatExpression(field, endField, format, formatType, config)\n };\n }\n return { signal: customFormatExpr(formatType, field, format) };\n}\nexport function guideFormat(fieldOrDatumDef, type, format, formatType, config, omitTimeFormatConfig // axis doesn't use config.timeFormat\n) {\n var _a;\n if (isCustomFormatType(formatType)) {\n return undefined; // handled in encode block\n }\n if (isFieldOrDatumDefForTimeFormat(fieldOrDatumDef)) {\n const timeUnit = isFieldDef(fieldOrDatumDef) ? (_a = normalizeTimeUnit(fieldOrDatumDef.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit : undefined;\n return timeFormat(format, timeUnit, config, omitTimeFormatConfig);\n }\n return numberFormat(type, format, config);\n}\nexport function guideFormatType(formatType, fieldOrDatumDef, scaleType) {\n if (formatType && (isSignalRef(formatType) || formatType === 'number' || formatType === 'time')) {\n return formatType;\n }\n if (isFieldOrDatumDefForTimeFormat(fieldOrDatumDef) && scaleType !== 'time' && scaleType !== 'utc') {\n return 'time';\n }\n return undefined;\n}\n/**\n * Returns number format for a fieldDef.\n */\nexport function numberFormat(type, specifiedFormat, config) {\n // Specified format in axis/legend has higher precedence than fieldDef.format\n if (isString(specifiedFormat)) {\n return specifiedFormat;\n }\n if (type === QUANTITATIVE) {\n // we only apply the default if the field is quantitative\n return config.numberFormat;\n }\n return undefined;\n}\n/**\n * Returns time format for a fieldDef for use in guides.\n */\nexport function timeFormat(specifiedFormat, timeUnit, config, omitTimeFormatConfig) {\n if (specifiedFormat) {\n return specifiedFormat;\n }\n if (timeUnit) {\n return {\n signal: timeUnitSpecifierExpression(timeUnit)\n };\n }\n return omitTimeFormatConfig ? undefined : config.timeFormat;\n}\nfunction formatExpr(field, format) {\n return `format(${field}, \"${format || ''}\")`;\n}\nfunction binNumberFormatExpr(field, format, formatType, config) {\n var _a;\n if (isCustomFormatType(formatType)) {\n return customFormatExpr(formatType, field, format);\n }\n return formatExpr(field, (_a = (isString(format) ? format : undefined)) !== null && _a !== void 0 ? _a : config.numberFormat);\n}\nexport function binFormatExpression(startField, endField, format, formatType, config) {\n const start = binNumberFormatExpr(startField, format, formatType, config);\n const end = binNumberFormatExpr(endField, format, formatType, config);\n return `${fieldValidPredicate(startField, false)} ? \"null\" : ${start} + \"${BIN_RANGE_DELIMITER}\" + ${end}`;\n}\n/**\n * Returns the time expression used for axis/legend labels or text mark for a temporal field\n */\nexport function timeFormatExpression(field, timeUnit, format, rawTimeFormat, // should be provided only for actual text and headers, not axis/legend labels\nisUTCScale) {\n if (!timeUnit || format) {\n // If there is no time unit, or if user explicitly specifies format for axis/legend/text.\n format = isString(format) ? format : rawTimeFormat; // only use provided timeFormat if there is no timeUnit.\n return `${isUTCScale ? 'utc' : 'time'}Format(${field}, '${format}')`;\n }\n else {\n return formatExpression(timeUnit, field, isUTCScale);\n }\n}\n//# sourceMappingURL=format.js.map","import { isArray } from 'vega-util';\nexport const DEFAULT_SORT_OP = 'min';\nconst SORT_BY_CHANNEL_INDEX = {\n x: 1,\n y: 1,\n color: 1,\n fill: 1,\n stroke: 1,\n strokeWidth: 1,\n size: 1,\n shape: 1,\n fillOpacity: 1,\n strokeOpacity: 1,\n opacity: 1,\n text: 1\n};\nexport function isSortByChannel(c) {\n return c in SORT_BY_CHANNEL_INDEX;\n}\nexport function isSortByEncoding(sort) {\n return !!sort && !!sort['encoding'];\n}\nexport function isSortField(sort) {\n return !!sort && (sort['op'] === 'count' || !!sort['field']);\n}\nexport function isSortArray(sort) {\n return !!sort && isArray(sort);\n}\n//# sourceMappingURL=sort.js.map","export function isFacetMapping(f) {\n return 'row' in f || 'column' in f;\n}\nexport function isFacetFieldDef(channelDef) {\n return !!channelDef && 'header' in channelDef;\n}\nexport function isFacetSpec(spec) {\n return 'facet' in spec;\n}\n//# sourceMappingURL=facet.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray, isBoolean, isNumber, isString } from 'vega-util';\nimport { isAggregateOp, isArgmaxDef, isArgminDef, isCountingAggregateOp } from './aggregate';\nimport { autoMaxBins, binToString, isBinned, isBinning } from './bin';\nimport { ANGLE, COLOR, COLUMN, DESCRIPTION, DETAIL, FACET, FILL, FILLOPACITY, HREF, isScaleChannel, isSecondaryRangeChannel, isXorY, KEY, LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2, OPACITY, ORDER, RADIUS, RADIUS2, ROW, SHAPE, SIZE, STROKE, STROKEDASH, STROKEOPACITY, STROKEWIDTH, TEXT, THETA, THETA2, TOOLTIP, URL, X, X2, Y, Y2 } from './channel';\nimport { getMarkConfig } from './compile/common';\nimport { isCustomFormatType } from './compile/format';\nimport { dateTimeToExpr, isDateTime } from './datetime';\nimport { isExprRef } from './expr';\nimport * as log from './log';\nimport { isRectBasedMark } from './mark';\nimport { SCALE_CATEGORY_INDEX } from './scale';\nimport { isSortByChannel } from './sort';\nimport { isFacetFieldDef } from './spec/facet';\nimport { getTimeUnitParts, isLocalSingleTimeUnit, normalizeTimeUnit, timeUnitToString } from './timeunit';\nimport { getFullName, QUANTITATIVE } from './type';\nimport { contains, flatAccessWithDatum, getFirstDefined, internalField, omit, removePathFromField, replacePathInField, titleCase } from './util';\nimport { isSignalRef } from './vega.schema';\nexport function isConditionalSelection(c) {\n return c['selection'];\n}\nexport function isRepeatRef(field) {\n return field && !isString(field) && 'repeat' in field;\n}\nexport function toFieldDefBase(fieldDef) {\n const { field, timeUnit, bin, aggregate } = fieldDef;\n return Object.assign(Object.assign(Object.assign(Object.assign({}, (timeUnit ? { timeUnit } : {})), (bin ? { bin } : {})), (aggregate ? { aggregate } : {})), { field });\n}\nexport function isSortableFieldDef(fieldDef) {\n return 'sort' in fieldDef;\n}\nexport function getBand({ channel, fieldDef, fieldDef2, markDef: mark, stack, config, isMidPoint }) {\n if (isFieldOrDatumDef(fieldDef) && fieldDef.band !== undefined) {\n return fieldDef.band;\n }\n if (isFieldDef(fieldDef)) {\n const { timeUnit, bin } = fieldDef;\n if (timeUnit && !fieldDef2) {\n if (isMidPoint) {\n return getMarkConfig('timeUnitBandPosition', mark, config);\n }\n else {\n return isRectBasedMark(mark.type) ? getMarkConfig('timeUnitBand', mark, config) : 0;\n }\n }\n else if (isBinning(bin)) {\n return isRectBasedMark(mark.type) && !isMidPoint ? 1 : 0.5;\n }\n }\n if ((stack === null || stack === void 0 ? void 0 : stack.fieldChannel) === channel && isMidPoint) {\n return 0.5;\n }\n return undefined;\n}\nexport function hasBand(channel, fieldDef, fieldDef2, stack, markDef, config) {\n if (isBinning(fieldDef.bin) || (fieldDef.timeUnit && isTypedFieldDef(fieldDef) && fieldDef.type === 'temporal')) {\n return !!getBand({ channel, fieldDef, fieldDef2, stack, markDef, config });\n }\n return false;\n}\nexport function isConditionalDef(channelDef) {\n return !!channelDef && 'condition' in channelDef;\n}\n/**\n * Return if a channelDef is a ConditionalValueDef with ConditionFieldDef\n */\nexport function hasConditionalFieldDef(channelDef) {\n const condition = channelDef && channelDef['condition'];\n return !!condition && !isArray(condition) && isFieldDef(condition);\n}\nexport function hasConditionalFieldOrDatumDef(channelDef) {\n const condition = channelDef && channelDef['condition'];\n return !!condition && !isArray(condition) && isFieldOrDatumDef(condition);\n}\nexport function hasConditionalValueDef(channelDef) {\n const condition = channelDef && channelDef['condition'];\n return !!condition && (isArray(condition) || isValueDef(condition));\n}\nexport function isFieldDef(channelDef) {\n // TODO: we can't use field in channelDef here as it's somehow failing runtime test\n return !!channelDef && (!!channelDef['field'] || channelDef['aggregate'] === 'count');\n}\nexport function channelDefType(channelDef) {\n return channelDef && channelDef['type'];\n}\nexport function isDatumDef(channelDef) {\n return !!channelDef && 'datum' in channelDef;\n}\nexport function isContinuousFieldOrDatumDef(cd) {\n // TODO: make datum support DateTime object\n return (isTypedFieldDef(cd) && isContinuous(cd)) || isNumericDataDef(cd);\n}\nexport function isQuantitativeFieldOrDatumDef(cd) {\n // TODO: make datum support DateTime object\n return channelDefType(cd) === 'quantitative' || isNumericDataDef(cd);\n}\nexport function isNumericDataDef(cd) {\n return isDatumDef(cd) && isNumber(cd.datum);\n}\nexport function isFieldOrDatumDef(channelDef) {\n return isFieldDef(channelDef) || isDatumDef(channelDef);\n}\nexport function isTypedFieldDef(channelDef) {\n return !!channelDef && ('field' in channelDef || channelDef['aggregate'] === 'count') && 'type' in channelDef;\n}\nexport function isValueDef(channelDef) {\n return channelDef && 'value' in channelDef && 'value' in channelDef;\n}\nexport function isScaleFieldDef(channelDef) {\n return !!channelDef && ('scale' in channelDef || 'sort' in channelDef);\n}\nexport function isPositionFieldOrDatumDef(channelDef) {\n return channelDef && ('axis' in channelDef || 'stack' in channelDef || 'impute' in channelDef);\n}\nexport function isMarkPropFieldOrDatumDef(channelDef) {\n return !!channelDef && 'legend' in channelDef;\n}\nexport function isStringFieldOrDatumDef(channelDef) {\n return !!channelDef && ('format' in channelDef || 'formatType' in channelDef);\n}\nexport function toStringFieldDef(fieldDef) {\n // omit properties that don't exist in string field defs\n return omit(fieldDef, ['legend', 'axis', 'header', 'scale']);\n}\nfunction isOpFieldDef(fieldDef) {\n return 'op' in fieldDef;\n}\n/**\n * Get a Vega field reference from a Vega-Lite field def.\n */\nexport function vgField(fieldDef, opt = {}) {\n var _a, _b, _c;\n let field = fieldDef.field;\n const prefix = opt.prefix;\n let suffix = opt.suffix;\n let argAccessor = ''; // for accessing argmin/argmax field at the end without getting escaped\n if (isCount(fieldDef)) {\n field = internalField('count');\n }\n else {\n let fn;\n if (!opt.nofn) {\n if (isOpFieldDef(fieldDef)) {\n fn = fieldDef.op;\n }\n else {\n const { bin, aggregate, timeUnit } = fieldDef;\n if (isBinning(bin)) {\n fn = binToString(bin);\n suffix = ((_a = opt.binSuffix) !== null && _a !== void 0 ? _a : '') + ((_b = opt.suffix) !== null && _b !== void 0 ? _b : '');\n }\n else if (aggregate) {\n if (isArgmaxDef(aggregate)) {\n argAccessor = `[\"${field}\"]`;\n field = `argmax_${aggregate.argmax}`;\n }\n else if (isArgminDef(aggregate)) {\n argAccessor = `[\"${field}\"]`;\n field = `argmin_${aggregate.argmin}`;\n }\n else {\n fn = String(aggregate);\n }\n }\n else if (timeUnit) {\n fn = timeUnitToString(timeUnit);\n suffix = ((!contains(['range', 'mid'], opt.binSuffix) && opt.binSuffix) || '') + ((_c = opt.suffix) !== null && _c !== void 0 ? _c : '');\n }\n }\n }\n if (fn) {\n field = field ? `${fn}_${field}` : fn;\n }\n }\n if (suffix) {\n field = `${field}_${suffix}`;\n }\n if (prefix) {\n field = `${prefix}_${field}`;\n }\n if (opt.forAs) {\n return removePathFromField(field);\n }\n else if (opt.expr) {\n // Expression to access flattened field. No need to escape dots.\n return flatAccessWithDatum(field, opt.expr) + argAccessor;\n }\n else {\n // We flattened all fields so paths should have become dot.\n return replacePathInField(field) + argAccessor;\n }\n}\nexport function isDiscrete(def) {\n switch (def.type) {\n case 'nominal':\n case 'ordinal':\n case 'geojson':\n return true;\n case 'quantitative':\n return isFieldDef(def) && !!def.bin;\n case 'temporal':\n return false;\n }\n throw new Error(log.message.invalidFieldType(def.type));\n}\nexport function isContinuous(fieldDef) {\n return !isDiscrete(fieldDef);\n}\nexport function isCount(fieldDef) {\n return fieldDef.aggregate === 'count';\n}\nexport function verbalTitleFormatter(fieldDef, config) {\n var _a;\n const { field, bin, timeUnit, aggregate } = fieldDef;\n if (aggregate === 'count') {\n return config.countTitle;\n }\n else if (isBinning(bin)) {\n return `${field} (binned)`;\n }\n else if (timeUnit) {\n const unit = (_a = normalizeTimeUnit(timeUnit)) === null || _a === void 0 ? void 0 : _a.unit;\n if (unit) {\n return `${field} (${getTimeUnitParts(unit).join('-')})`;\n }\n }\n else if (aggregate) {\n if (isArgmaxDef(aggregate)) {\n return `${field} for max ${aggregate.argmax}`;\n }\n else if (isArgminDef(aggregate)) {\n return `${field} for min ${aggregate.argmin}`;\n }\n else {\n return `${titleCase(aggregate)} of ${field}`;\n }\n }\n return field;\n}\nexport function functionalTitleFormatter(fieldDef) {\n const { aggregate, bin, timeUnit, field } = fieldDef;\n if (isArgmaxDef(aggregate)) {\n return `${field} for argmax(${aggregate.argmax})`;\n }\n else if (isArgminDef(aggregate)) {\n return `${field} for argmin(${aggregate.argmin})`;\n }\n const timeUnitParams = normalizeTimeUnit(timeUnit);\n const fn = aggregate || (timeUnitParams === null || timeUnitParams === void 0 ? void 0 : timeUnitParams.unit) || ((timeUnitParams === null || timeUnitParams === void 0 ? void 0 : timeUnitParams.maxbins) && 'timeunit') || (isBinning(bin) && 'bin');\n if (fn) {\n return fn.toUpperCase() + '(' + field + ')';\n }\n else {\n return field;\n }\n}\nexport const defaultTitleFormatter = (fieldDef, config) => {\n switch (config.fieldTitle) {\n case 'plain':\n return fieldDef.field;\n case 'functional':\n return functionalTitleFormatter(fieldDef);\n default:\n return verbalTitleFormatter(fieldDef, config);\n }\n};\nlet titleFormatter = defaultTitleFormatter;\nexport function setTitleFormatter(formatter) {\n titleFormatter = formatter;\n}\nexport function resetTitleFormatter() {\n setTitleFormatter(defaultTitleFormatter);\n}\nexport function title(fieldOrDatumDef, config, { allowDisabling, includeDefault = true }) {\n var _a, _b;\n const guideTitle = (_a = getGuide(fieldOrDatumDef)) === null || _a === void 0 ? void 0 : _a.title;\n if (!isFieldDef(fieldOrDatumDef)) {\n return guideTitle;\n }\n const fieldDef = fieldOrDatumDef;\n const def = includeDefault ? defaultTitle(fieldDef, config) : undefined;\n if (allowDisabling) {\n return getFirstDefined(guideTitle, fieldDef.title, def);\n }\n else {\n return (_b = guideTitle !== null && guideTitle !== void 0 ? guideTitle : fieldDef.title) !== null && _b !== void 0 ? _b : def;\n }\n}\nexport function getGuide(fieldDef) {\n if (isPositionFieldOrDatumDef(fieldDef) && fieldDef.axis) {\n return fieldDef.axis;\n }\n else if (isMarkPropFieldOrDatumDef(fieldDef) && fieldDef.legend) {\n return fieldDef.legend;\n }\n else if (isFacetFieldDef(fieldDef) && fieldDef.header) {\n return fieldDef.header;\n }\n return undefined;\n}\nexport function defaultTitle(fieldDef, config) {\n return titleFormatter(fieldDef, config);\n}\nexport function getFormatMixins(fieldDef) {\n var _a;\n if (isStringFieldOrDatumDef(fieldDef)) {\n const { format, formatType } = fieldDef;\n return { format, formatType };\n }\n else {\n const guide = (_a = getGuide(fieldDef)) !== null && _a !== void 0 ? _a : {};\n const { format, formatType } = guide;\n return { format, formatType };\n }\n}\nexport function defaultType(fieldDef, channel) {\n var _a;\n switch (channel) {\n case 'latitude':\n case 'longitude':\n return 'quantitative';\n case 'row':\n case 'column':\n case 'facet':\n case 'shape':\n case 'strokeDash':\n return 'nominal';\n case 'order':\n return 'ordinal';\n }\n if (isSortableFieldDef(fieldDef) && isArray(fieldDef.sort)) {\n return 'ordinal';\n }\n const { aggregate, bin, timeUnit } = fieldDef;\n if (timeUnit) {\n return 'temporal';\n }\n if (bin || (aggregate && !isArgmaxDef(aggregate) && !isArgminDef(aggregate))) {\n return 'quantitative';\n }\n if (isScaleFieldDef(fieldDef) && ((_a = fieldDef.scale) === null || _a === void 0 ? void 0 : _a.type)) {\n switch (SCALE_CATEGORY_INDEX[fieldDef.scale.type]) {\n case 'numeric':\n case 'discretizing':\n return 'quantitative';\n case 'time':\n return 'temporal';\n }\n }\n return 'nominal';\n}\n/**\n * Returns the fieldDef -- either from the outer channelDef or from the condition of channelDef.\n * @param channelDef\n */\nexport function getFieldDef(channelDef) {\n if (isFieldDef(channelDef)) {\n return channelDef;\n }\n else if (hasConditionalFieldDef(channelDef)) {\n return channelDef.condition;\n }\n return undefined;\n}\nexport function getFieldOrDatumDef(channelDef) {\n if (isFieldOrDatumDef(channelDef)) {\n return channelDef;\n }\n else if (hasConditionalFieldOrDatumDef(channelDef)) {\n return channelDef.condition;\n }\n return undefined;\n}\n/**\n * Convert type to full, lowercase type, or augment the fieldDef with a default type if missing.\n */\nexport function initChannelDef(channelDef, channel, config, opt = {}) {\n if (isString(channelDef) || isNumber(channelDef) || isBoolean(channelDef)) {\n const primitiveType = isString(channelDef) ? 'string' : isNumber(channelDef) ? 'number' : 'boolean';\n log.warn(log.message.primitiveChannelDef(channel, primitiveType, channelDef));\n return { value: channelDef };\n }\n // If a fieldDef contains a field, we need type.\n if (isFieldOrDatumDef(channelDef)) {\n return initFieldOrDatumDef(channelDef, channel, config, opt);\n }\n else if (hasConditionalFieldOrDatumDef(channelDef)) {\n return Object.assign(Object.assign({}, channelDef), { \n // Need to cast as normalizeFieldDef normally return FieldDef, but here we know that it is definitely Condition\n condition: initFieldOrDatumDef(channelDef.condition, channel, config, opt) });\n }\n return channelDef;\n}\nexport function initFieldOrDatumDef(fd, channel, config, opt) {\n if (isStringFieldOrDatumDef(fd)) {\n const { format, formatType } = fd, rest = __rest(fd, [\"format\", \"formatType\"]);\n if (isCustomFormatType(formatType) && !config.customFormatTypes) {\n log.warn(log.message.customFormatTypeNotAllowed(channel));\n return initFieldOrDatumDef(rest, channel, config, opt);\n }\n }\n else {\n const guideType = isPositionFieldOrDatumDef(fd)\n ? 'axis'\n : isMarkPropFieldOrDatumDef(fd)\n ? 'legend'\n : isFacetFieldDef(fd)\n ? 'header'\n : null;\n if (guideType && fd[guideType]) {\n const _a = fd[guideType], { format, formatType } = _a, newGuide = __rest(_a, [\"format\", \"formatType\"]);\n if (isCustomFormatType(formatType) && !config.customFormatTypes) {\n log.warn(log.message.customFormatTypeNotAllowed(channel));\n return initFieldOrDatumDef(Object.assign(Object.assign({}, fd), { [guideType]: newGuide }), channel, config, opt);\n }\n }\n }\n if (isFieldDef(fd)) {\n return initFieldDef(fd, channel, opt);\n }\n return initDatumDef(fd);\n}\nfunction initDatumDef(datumDef) {\n let type = datumDef['type'];\n if (type) {\n return datumDef;\n }\n const { datum } = datumDef;\n type = isNumber(datum) ? 'quantitative' : isString(datum) ? 'nominal' : isDateTime(datum) ? 'temporal' : undefined;\n return Object.assign(Object.assign({}, datumDef), { type });\n}\nexport function initFieldDef(fd, channel, { compositeMark = false } = {}) {\n const { aggregate, timeUnit, bin, field } = fd;\n const fieldDef = Object.assign({}, fd);\n // Drop invalid aggregate\n if (!compositeMark && aggregate && !isAggregateOp(aggregate) && !isArgmaxDef(aggregate) && !isArgminDef(aggregate)) {\n log.warn(log.message.invalidAggregate(aggregate));\n delete fieldDef.aggregate;\n }\n // Normalize Time Unit\n if (timeUnit) {\n fieldDef.timeUnit = normalizeTimeUnit(timeUnit);\n }\n if (field) {\n fieldDef.field = `${field}`;\n }\n // Normalize bin\n if (isBinning(bin)) {\n fieldDef.bin = normalizeBin(bin, channel);\n }\n if (isBinned(bin) && !isXorY(channel)) {\n log.warn(log.message.channelShouldNotBeUsedForBinned(channel));\n }\n // Normalize Type\n if (isTypedFieldDef(fieldDef)) {\n const { type } = fieldDef;\n const fullType = getFullName(type);\n if (type !== fullType) {\n // convert short type to full type\n fieldDef.type = fullType;\n }\n if (type !== 'quantitative') {\n if (isCountingAggregateOp(aggregate)) {\n log.warn(log.message.invalidFieldTypeForCountAggregate(type, aggregate));\n fieldDef.type = 'quantitative';\n }\n }\n }\n else if (!isSecondaryRangeChannel(channel)) {\n // If type is empty / invalid, then augment with default type\n const newType = defaultType(fieldDef, channel);\n fieldDef['type'] = newType;\n }\n if (isTypedFieldDef(fieldDef)) {\n const { compatible, warning } = channelCompatibility(fieldDef, channel) || {};\n if (compatible === false) {\n log.warn(warning);\n }\n }\n if (isSortableFieldDef(fieldDef) && isString(fieldDef.sort)) {\n const { sort } = fieldDef;\n if (isSortByChannel(sort)) {\n return Object.assign(Object.assign({}, fieldDef), { sort: { encoding: sort } });\n }\n const sub = sort.substr(1);\n if (sort.charAt(0) === '-' && isSortByChannel(sub)) {\n return Object.assign(Object.assign({}, fieldDef), { sort: { encoding: sub, order: 'descending' } });\n }\n }\n if (isFacetFieldDef(fieldDef)) {\n const { header } = fieldDef;\n const { orient } = header, rest = __rest(header, [\"orient\"]);\n if (orient) {\n return Object.assign(Object.assign({}, fieldDef), { header: Object.assign(Object.assign({}, rest), { labelOrient: header.labelOrient || orient, titleOrient: header.titleOrient || orient }) });\n }\n }\n return fieldDef;\n}\nexport function normalizeBin(bin, channel) {\n if (isBoolean(bin)) {\n return { maxbins: autoMaxBins(channel) };\n }\n else if (bin === 'binned') {\n return {\n binned: true\n };\n }\n else if (!bin.maxbins && !bin.step) {\n return Object.assign(Object.assign({}, bin), { maxbins: autoMaxBins(channel) });\n }\n else {\n return bin;\n }\n}\nconst COMPATIBLE = { compatible: true };\nexport function channelCompatibility(fieldDef, channel) {\n const type = fieldDef.type;\n if (type === 'geojson' && channel !== 'shape') {\n return {\n compatible: false,\n warning: `Channel ${channel} should not be used with a geojson data.`\n };\n }\n switch (channel) {\n case ROW:\n case COLUMN:\n case FACET:\n if (isContinuous(fieldDef)) {\n return {\n compatible: false,\n warning: log.message.facetChannelShouldBeDiscrete(channel)\n };\n }\n return COMPATIBLE;\n case X:\n case Y:\n case COLOR:\n case FILL:\n case STROKE:\n case TEXT:\n case DETAIL:\n case KEY:\n case TOOLTIP:\n case HREF:\n case URL:\n case ANGLE:\n case THETA:\n case RADIUS:\n case DESCRIPTION:\n return COMPATIBLE;\n case LONGITUDE:\n case LONGITUDE2:\n case LATITUDE:\n case LATITUDE2:\n if (type !== QUANTITATIVE) {\n return {\n compatible: false,\n warning: `Channel ${channel} should be used with a quantitative field only, not ${fieldDef.type} field.`\n };\n }\n return COMPATIBLE;\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n case STROKEWIDTH:\n case SIZE:\n case THETA2:\n case RADIUS2:\n case X2:\n case Y2:\n if (type === 'nominal' && !fieldDef['sort']) {\n return {\n compatible: false,\n warning: `Channel ${channel} should not be used with an unsorted discrete field.`\n };\n }\n return COMPATIBLE;\n case STROKEDASH:\n if (!contains(['ordinal', 'nominal'], fieldDef.type)) {\n return {\n compatible: false,\n warning: 'StrokeDash channel should be used with only discrete data.'\n };\n }\n return COMPATIBLE;\n case SHAPE:\n if (!contains(['ordinal', 'nominal', 'geojson'], fieldDef.type)) {\n return {\n compatible: false,\n warning: 'Shape channel should be used with only either discrete or geojson data.'\n };\n }\n return COMPATIBLE;\n case ORDER:\n if (fieldDef.type === 'nominal' && !('sort' in fieldDef)) {\n return {\n compatible: false,\n warning: `Channel order is inappropriate for nominal field, which has no inherent order.`\n };\n }\n return COMPATIBLE;\n }\n}\n/**\n * Check if the field def uses a time format or does not use any format but is temporal\n * (this does not cover field defs that are temporal but use a number format).\n */\nexport function isFieldOrDatumDefForTimeFormat(fieldOrDatumDef) {\n const { formatType } = getFormatMixins(fieldOrDatumDef);\n return formatType === 'time' || (!formatType && isTimeFieldDef(fieldOrDatumDef));\n}\n/**\n * Check if field def has type `temporal`. If you want to also cover field defs that use a time format, use `isTimeFormatFieldDef`.\n */\nexport function isTimeFieldDef(def) {\n return def && (def['type'] === 'temporal' || (isFieldDef(def) && !!def.timeUnit));\n}\n/**\n * Getting a value associated with a fielddef.\n * Convert the value to Vega expression if applicable (for datetime object, or string if the field def is temporal or has timeUnit)\n */\nexport function valueExpr(v, { timeUnit, type, wrapTime, undefinedIfExprNotRequired }) {\n var _a;\n const unit = timeUnit && ((_a = normalizeTimeUnit(timeUnit)) === null || _a === void 0 ? void 0 : _a.unit);\n let isTime = unit || type === 'temporal';\n let expr;\n if (isExprRef(v)) {\n expr = v.expr;\n }\n else if (isSignalRef(v)) {\n expr = v.signal;\n }\n else if (isDateTime(v)) {\n isTime = true;\n expr = dateTimeToExpr(v);\n }\n else if (isString(v) || isNumber(v)) {\n if (isTime) {\n expr = `datetime(${JSON.stringify(v)})`;\n if (isLocalSingleTimeUnit(unit)) {\n // for single timeUnit, we will use dateTimeToExpr to convert number/string to match the timeUnit\n if ((isNumber(v) && v < 10000) || (isString(v) && isNaN(Date.parse(v)))) {\n expr = dateTimeToExpr({ [unit]: v });\n }\n }\n }\n }\n if (expr) {\n return wrapTime && isTime ? `time(${expr})` : expr;\n }\n // number or boolean or normal string\n return undefinedIfExprNotRequired ? undefined : JSON.stringify(v);\n}\n/**\n * Standardize value array -- convert each value to Vega expression if applicable\n */\nexport function valueArray(fieldOrDatumDef, values) {\n const { type } = fieldOrDatumDef;\n return values.map(v => {\n const expr = valueExpr(v, {\n timeUnit: isFieldDef(fieldOrDatumDef) ? fieldOrDatumDef.timeUnit : undefined,\n type,\n undefinedIfExprNotRequired: true\n });\n // return signal for the expression if we need an expression\n if (expr !== undefined) {\n return { signal: expr };\n }\n // otherwise just return the original value\n return v;\n });\n}\n/**\n * Checks whether a fieldDef for a particular channel requires a computed bin range.\n */\nexport function binRequiresRange(fieldDef, channel) {\n if (!isBinning(fieldDef.bin)) {\n console.warn('Only call this method for binned field defs.');\n return false;\n }\n // We need the range only when the user explicitly forces a binned field to be use discrete scale. In this case, bin range is used in axis and legend labels.\n // We could check whether the axis or legend exists (not disabled) but that seems overkill.\n return isScaleChannel(channel) && contains(['ordinal', 'nominal'], fieldDef.type);\n}\n//# sourceMappingURL=channeldef.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray, isString } from 'vega-util';\nimport { pick } from './util';\nexport function extractTitleConfig(titleConfig) {\n const { \n // These are non-mark title config that need to be hardcoded\n anchor, frame, offset, orient, \n // color needs to be redirect to fill\n color, \n // subtitle properties\n subtitleColor, subtitleFont, subtitleFontSize, subtitleFontStyle, subtitleFontWeight, subtitleLineHeight, subtitlePadding } = titleConfig, \n // The rest are mark config.\n rest = __rest(titleConfig, [\"anchor\", \"frame\", \"offset\", \"orient\", \"color\", \"subtitleColor\", \"subtitleFont\", \"subtitleFontSize\", \"subtitleFontStyle\", \"subtitleFontWeight\", \"subtitleLineHeight\", \"subtitlePadding\"]);\n const titleMarkConfig = Object.assign(Object.assign({}, rest), (color ? { fill: color } : {}));\n // These are non-mark title config that need to be hardcoded\n const nonMark = Object.assign(Object.assign(Object.assign(Object.assign({}, (anchor ? { anchor } : {})), (frame ? { frame } : {})), (offset ? { offset } : {})), (orient ? { orient } : {}));\n // subtitle part can stay in config.title since header titles do not use subtitle\n const subtitle = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (subtitleColor ? { subtitleColor } : {})), (subtitleFont ? { subtitleFont } : {})), (subtitleFontSize ? { subtitleFontSize } : {})), (subtitleFontStyle ? { subtitleFontStyle } : {})), (subtitleFontWeight ? { subtitleFontWeight } : {})), (subtitleLineHeight ? { subtitleLineHeight } : {})), (subtitlePadding ? { subtitlePadding } : {}));\n const subtitleMarkConfig = pick(titleMarkConfig, ['align', 'baseline', 'dx', 'dy', 'limit']);\n return { titleMarkConfig, subtitleMarkConfig, nonMark, subtitle };\n}\nexport function isText(v) {\n return isString(v) || (isArray(v) && isString(v[0]));\n}\n//# sourceMappingURL=title.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array, isArray, stringValue } from 'vega-util';\nimport { vgField } from '../channeldef';\nimport { isExprRef } from '../expr';\nimport { isText } from '../title';\nimport { deepEqual, getFirstDefined } from '../util';\nimport { isSignalRef } from '../vega.schema';\nexport const BIN_RANGE_DELIMITER = ' \\u2013 ';\nexport function signalOrValueRefWithCondition(val) {\n const condition = isArray(val.condition)\n ? val.condition.map(conditionalSignalRefOrValue)\n : conditionalSignalRefOrValue(val.condition);\n return Object.assign(Object.assign({}, signalRefOrValue(val)), { condition });\n}\nexport function signalRefOrValue(value) {\n if (isExprRef(value)) {\n const { expr } = value, rest = __rest(value, [\"expr\"]);\n return Object.assign({ signal: expr }, rest);\n }\n return value;\n}\nexport function conditionalSignalRefOrValue(value) {\n if (isExprRef(value)) {\n const { expr } = value, rest = __rest(value, [\"expr\"]);\n return Object.assign({ signal: expr }, rest);\n }\n return value;\n}\nexport function signalOrValueRef(value) {\n if (isExprRef(value)) {\n const { expr } = value, rest = __rest(value, [\"expr\"]);\n return Object.assign({ signal: expr }, rest);\n }\n if (isSignalRef(value)) {\n return value;\n }\n return value !== undefined ? { value } : undefined;\n}\nexport function exprFromValueOrSignalRef(ref) {\n if (isSignalRef(ref)) {\n return ref.signal;\n }\n return stringValue(ref.value);\n}\nexport function signalOrStringValue(v) {\n if (isSignalRef(v)) {\n return v.signal;\n }\n return v == null ? null : stringValue(v);\n}\nexport function applyMarkConfig(e, model, propsList) {\n for (const property of propsList) {\n const value = getMarkConfig(property, model.markDef, model.config);\n if (value !== undefined) {\n e[property] = signalOrValueRef(value);\n }\n }\n return e;\n}\nexport function getStyles(mark) {\n var _a;\n return [].concat(mark.type, (_a = mark.style) !== null && _a !== void 0 ? _a : []);\n}\nexport function getMarkPropOrConfig(channel, mark, config, opt = {}) {\n const { vgChannel, ignoreVgConfig } = opt;\n if (vgChannel && mark[vgChannel] !== undefined) {\n return mark[vgChannel];\n }\n else if (mark[channel] !== undefined) {\n return mark[channel];\n }\n else if (ignoreVgConfig && (!vgChannel || vgChannel === channel)) {\n return undefined;\n }\n return getMarkConfig(channel, mark, config, opt);\n}\n/**\n * Return property value from style or mark specific config property if exists.\n * Otherwise, return general mark specific config.\n */\nexport function getMarkConfig(channel, mark, config, { vgChannel } = {}) {\n return getFirstDefined(\n // style config has highest precedence\n vgChannel ? getMarkStyleConfig(channel, mark, config.style) : undefined, getMarkStyleConfig(channel, mark, config.style), \n // then mark-specific config\n vgChannel ? config[mark.type][vgChannel] : undefined, config[mark.type][channel], // Need to cast because MarkDef doesn't perfectly match with AnyMarkConfig, but if the type isn't available, we'll get nothing here, which is fine\n // If there is vgChannel, skip vl channel.\n // For example, vl size for text is vg fontSize, but config.mark.size is only for point size.\n vgChannel ? config.mark[vgChannel] : config.mark[channel] // Need to cast for the same reason as above\n );\n}\nexport function getMarkStyleConfig(prop, mark, styleConfigIndex) {\n return getStyleConfig(prop, getStyles(mark), styleConfigIndex);\n}\nexport function getStyleConfig(p, styles, styleConfigIndex) {\n styles = array(styles);\n let value;\n for (const style of styles) {\n const styleConfig = styleConfigIndex[style];\n if (styleConfig && styleConfig[p] !== undefined) {\n value = styleConfig[p];\n }\n }\n return value;\n}\n/**\n * Return Vega sort parameters (tuple of field and order).\n */\nexport function sortParams(orderDef, fieldRefOption) {\n return array(orderDef).reduce((s, orderChannelDef) => {\n var _a;\n s.field.push(vgField(orderChannelDef, fieldRefOption));\n s.order.push((_a = orderChannelDef.sort) !== null && _a !== void 0 ? _a : 'ascending');\n return s;\n }, { field: [], order: [] });\n}\nexport function mergeTitleFieldDefs(f1, f2) {\n const merged = [...f1];\n f2.forEach(fdToMerge => {\n for (const fieldDef1 of merged) {\n // If already exists, no need to append to merged array\n if (deepEqual(fieldDef1, fdToMerge)) {\n return;\n }\n }\n merged.push(fdToMerge);\n });\n return merged;\n}\nexport function mergeTitle(title1, title2) {\n if (deepEqual(title1, title2) || !title2) {\n // if titles are the same or title2 is falsy\n return title1;\n }\n else if (!title1) {\n // if title1 is falsy\n return title2;\n }\n else {\n return [...array(title1), ...array(title2)].join(', ');\n }\n}\nexport function mergeTitleComponent(v1, v2) {\n const v1Val = v1.value;\n const v2Val = v2.value;\n if (v1Val == null || v2Val === null) {\n return {\n explicit: v1.explicit,\n value: null\n };\n }\n else if ((isText(v1Val) || isSignalRef(v1Val)) && (isText(v2Val) || isSignalRef(v2Val))) {\n return {\n explicit: v1.explicit,\n value: mergeTitle(v1Val, v2Val)\n };\n }\n else if (isText(v1Val) || isSignalRef(v1Val)) {\n return {\n explicit: v1.explicit,\n value: v1Val\n };\n }\n else if (isText(v2Val) || isSignalRef(v2Val)) {\n return {\n explicit: v1.explicit,\n value: v2Val\n };\n }\n else if (!isText(v1Val) && !isSignalRef(v1Val) && !isText(v2Val) && !isSignalRef(v2Val)) {\n return {\n explicit: v1.explicit,\n value: mergeTitleFieldDefs(v1Val, v2Val)\n };\n }\n /* istanbul ignore next: Condition should not happen -- only for warning in development. */\n throw new Error('It should never reach here');\n}\n//# sourceMappingURL=common.js.map","export function isUnitSpec(spec) {\n return 'mark' in spec;\n}\n//# sourceMappingURL=unit.js.map","import { getMarkType } from '../mark';\nimport { isUnitSpec } from '../spec/unit';\nexport class CompositeMarkNormalizer {\n constructor(name, run) {\n this.name = name;\n this.run = run;\n }\n hasMatchingType(spec) {\n if (isUnitSpec(spec)) {\n return getMarkType(spec.mark) === this.name;\n }\n return false;\n }\n}\n//# sourceMappingURL=base.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array, isArray } from 'vega-util';\nimport { isArgmaxDef, isArgminDef } from './aggregate';\nimport { isBinned, isBinning } from './bin';\nimport { ANGLE, CHANNELS, COLOR, DESCRIPTION, DETAIL, FILL, FILLOPACITY, HREF, isChannel, isNonPositionScaleChannel, isSecondaryRangeChannel, isXorY, KEY, LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2, OPACITY, ORDER, RADIUS, RADIUS2, SHAPE, SIZE, STROKE, STROKEDASH, STROKEOPACITY, STROKEWIDTH, supportMark, TEXT, THETA, THETA2, TOOLTIP, URL, X, X2, Y, Y2 } from './channel';\nimport { binRequiresRange, getFieldDef, getGuide, hasConditionalFieldDef, initChannelDef, initFieldDef, isConditionalDef, isDatumDef, isFieldDef, isTypedFieldDef, isValueDef, title, vgField } from './channeldef';\nimport * as log from './log';\nimport { QUANTITATIVE, TEMPORAL } from './type';\nimport { keys, some } from './util';\nimport { isSignalRef } from './vega.schema';\nexport function channelHasField(encoding, channel) {\n const channelDef = encoding && encoding[channel];\n if (channelDef) {\n if (isArray(channelDef)) {\n return some(channelDef, fieldDef => !!fieldDef.field);\n }\n else {\n return isFieldDef(channelDef) || hasConditionalFieldDef(channelDef);\n }\n }\n return false;\n}\nexport function isAggregate(encoding) {\n return some(CHANNELS, channel => {\n if (channelHasField(encoding, channel)) {\n const channelDef = encoding[channel];\n if (isArray(channelDef)) {\n return some(channelDef, fieldDef => !!fieldDef.aggregate);\n }\n else {\n const fieldDef = getFieldDef(channelDef);\n return fieldDef && !!fieldDef.aggregate;\n }\n }\n return false;\n });\n}\nexport function extractTransformsFromEncoding(oldEncoding, config) {\n const groupby = [];\n const bins = [];\n const timeUnits = [];\n const aggregate = [];\n const encoding = {};\n forEach(oldEncoding, (channelDef, channel) => {\n // Extract potential embedded transformations along with remaining properties\n if (isFieldDef(channelDef)) {\n const { field, aggregate: aggOp, bin, timeUnit } = channelDef, remaining = __rest(channelDef, [\"field\", \"aggregate\", \"bin\", \"timeUnit\"]);\n if (aggOp || timeUnit || bin) {\n const guide = getGuide(channelDef);\n const isTitleDefined = guide && guide.title;\n let newField = vgField(channelDef, { forAs: true });\n const newFieldDef = Object.assign(Object.assign(Object.assign({}, (isTitleDefined ? [] : { title: title(channelDef, config, { allowDisabling: true }) })), remaining), { \n // Always overwrite field\n field: newField });\n if (aggOp) {\n let op;\n if (isArgmaxDef(aggOp)) {\n op = 'argmax';\n newField = vgField({ op: 'argmax', field: aggOp.argmax }, { forAs: true });\n newFieldDef.field = `${newField}.${field}`;\n }\n else if (isArgminDef(aggOp)) {\n op = 'argmin';\n newField = vgField({ op: 'argmin', field: aggOp.argmin }, { forAs: true });\n newFieldDef.field = `${newField}.${field}`;\n }\n else if (aggOp !== 'boxplot' && aggOp !== 'errorbar' && aggOp !== 'errorband') {\n op = aggOp;\n }\n if (op) {\n const aggregateEntry = {\n op,\n as: newField\n };\n if (field) {\n aggregateEntry.field = field;\n }\n aggregate.push(aggregateEntry);\n }\n }\n else {\n groupby.push(newField);\n if (isTypedFieldDef(channelDef) && isBinning(bin)) {\n bins.push({ bin, field, as: newField });\n // Add additional groupbys for range and end of bins\n groupby.push(vgField(channelDef, { binSuffix: 'end' }));\n if (binRequiresRange(channelDef, channel)) {\n groupby.push(vgField(channelDef, { binSuffix: 'range' }));\n }\n // Create accompanying 'x2' or 'y2' field if channel is 'x' or 'y' respectively\n if (isXorY(channel)) {\n const secondaryChannel = {\n field: newField + '_end'\n };\n encoding[channel + '2'] = secondaryChannel;\n }\n newFieldDef.bin = 'binned';\n if (!isSecondaryRangeChannel(channel)) {\n newFieldDef['type'] = QUANTITATIVE;\n }\n }\n else if (timeUnit) {\n timeUnits.push({\n timeUnit,\n field,\n as: newField\n });\n // define the format type for later compilation\n const formatType = isTypedFieldDef(channelDef) && channelDef.type !== TEMPORAL && 'time';\n if (formatType) {\n if (channel === TEXT || channel === TOOLTIP) {\n newFieldDef['formatType'] = formatType;\n }\n else if (isNonPositionScaleChannel(channel)) {\n newFieldDef['legend'] = Object.assign({ formatType }, newFieldDef['legend']);\n }\n else if (isXorY(channel)) {\n newFieldDef['axis'] = Object.assign({ formatType }, newFieldDef['axis']);\n }\n }\n }\n }\n // now the field should refer to post-transformed field instead\n encoding[channel] = newFieldDef;\n }\n else {\n groupby.push(field);\n encoding[channel] = oldEncoding[channel];\n }\n }\n else {\n // For value def / signal ref / datum def, just copy\n encoding[channel] = oldEncoding[channel];\n }\n });\n return {\n bins,\n timeUnits,\n aggregate,\n groupby,\n encoding\n };\n}\nexport function markChannelCompatible(encoding, channel, mark) {\n const markSupported = supportMark(channel, mark);\n if (!markSupported) {\n return false;\n }\n else if (markSupported === 'binned') {\n const primaryFieldDef = encoding[channel === X2 ? X : Y];\n // circle, point, square and tick only support x2/y2 when their corresponding x/y fieldDef\n // has \"binned\" data and thus need x2/y2 to specify the bin-end field.\n if (isFieldDef(primaryFieldDef) && isFieldDef(encoding[channel]) && isBinned(primaryFieldDef.bin)) {\n return true;\n }\n else {\n return false;\n }\n }\n return true;\n}\nexport function initEncoding(encoding, mark, filled, config) {\n return keys(encoding).reduce((normalizedEncoding, channel) => {\n if (!isChannel(channel)) {\n // Drop invalid channel\n log.warn(log.message.invalidEncodingChannel(channel));\n return normalizedEncoding;\n }\n const channelDef = encoding[channel];\n if (channel === 'angle' && mark === 'arc' && !encoding.theta) {\n log.warn(log.message.REPLACE_ANGLE_WITH_THETA);\n channel = THETA;\n }\n if (!markChannelCompatible(encoding, channel, mark)) {\n // Drop unsupported channel\n log.warn(log.message.incompatibleChannel(channel, mark));\n return normalizedEncoding;\n }\n // Drop line's size if the field is aggregated.\n if (channel === SIZE && mark === 'line') {\n const fieldDef = getFieldDef(encoding[channel]);\n if (fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.aggregate) {\n log.warn(log.message.LINE_WITH_VARYING_SIZE);\n return normalizedEncoding;\n }\n }\n // Drop color if either fill or stroke is specified\n if (channel === COLOR && (filled ? 'fill' in encoding : 'stroke' in encoding)) {\n log.warn(log.message.droppingColor('encoding', { fill: 'fill' in encoding, stroke: 'stroke' in encoding }));\n return normalizedEncoding;\n }\n if (channel === DETAIL ||\n (channel === ORDER && !isArray(channelDef) && !isValueDef(channelDef)) ||\n (channel === TOOLTIP && isArray(channelDef))) {\n if (channelDef) {\n // Array of fieldDefs for detail channel (or production rule)\n normalizedEncoding[channel] = array(channelDef).reduce((defs, fieldDef) => {\n if (!isFieldDef(fieldDef)) {\n log.warn(log.message.emptyFieldDef(fieldDef, channel));\n }\n else {\n defs.push(initFieldDef(fieldDef, channel));\n }\n return defs;\n }, []);\n }\n }\n else {\n if (channel === TOOLTIP && channelDef === null) {\n // Preserve null so we can use it to disable tooltip\n normalizedEncoding[channel] = null;\n }\n else if (!isFieldDef(channelDef) &&\n !isDatumDef(channelDef) &&\n !isValueDef(channelDef) &&\n !isConditionalDef(channelDef) &&\n !isSignalRef(channelDef)) {\n log.warn(log.message.emptyFieldDef(channelDef, channel));\n return normalizedEncoding;\n }\n normalizedEncoding[channel] = initChannelDef(channelDef, channel, config);\n }\n return normalizedEncoding;\n }, {});\n}\n/**\n * For composite marks, we have to call initChannelDef during init so we can infer types earlier.\n */\nexport function normalizeEncoding(encoding, config) {\n const normalizedEncoding = {};\n for (const channel of keys(encoding)) {\n const newChannelDef = initChannelDef(encoding[channel], channel, config, { compositeMark: true });\n normalizedEncoding[channel] = newChannelDef;\n }\n return normalizedEncoding;\n}\nexport function fieldDefs(encoding) {\n const arr = [];\n for (const channel of keys(encoding)) {\n if (channelHasField(encoding, channel)) {\n const channelDef = encoding[channel];\n const channelDefArray = array(channelDef);\n for (const def of channelDefArray) {\n if (isFieldDef(def)) {\n arr.push(def);\n }\n else if (hasConditionalFieldDef(def)) {\n arr.push(def.condition);\n }\n }\n }\n }\n return arr;\n}\nexport function forEach(mapping, f, thisArg) {\n if (!mapping) {\n return;\n }\n for (const channel of keys(mapping)) {\n const el = mapping[channel];\n if (isArray(el)) {\n for (const channelDef of el) {\n f.call(thisArg, channelDef, channel);\n }\n }\n else {\n f.call(thisArg, el, channel);\n }\n }\n}\nexport function reduce(mapping, f, init, thisArg) {\n if (!mapping) {\n return init;\n }\n return keys(mapping).reduce((r, channel) => {\n const map = mapping[channel];\n if (isArray(map)) {\n return map.reduce((r1, channelDef) => {\n return f.call(thisArg, r1, channelDef, channel);\n }, r);\n }\n else {\n return f.call(thisArg, r, map, channel);\n }\n }, init);\n}\n/**\n * Returns list of path grouping fields for the given encoding\n */\nexport function pathGroupingFields(mark, encoding) {\n return keys(encoding).reduce((details, channel) => {\n switch (channel) {\n // x, y, x2, y2, lat, long, lat1, long2, order, tooltip, href, aria label, cursor should not cause lines to group\n case X:\n case Y:\n case HREF:\n case DESCRIPTION:\n case URL:\n case X2:\n case Y2:\n case THETA:\n case THETA2:\n case RADIUS:\n case RADIUS2:\n // falls through\n case LATITUDE:\n case LONGITUDE:\n case LATITUDE2:\n case LONGITUDE2:\n // TODO: case 'cursor':\n // text, shape, shouldn't be a part of line/trail/area [falls through]\n case TEXT:\n case SHAPE:\n case ANGLE:\n // falls through\n // tooltip fields should not be added to group by [falls through]\n case TOOLTIP:\n return details;\n case ORDER:\n // order should not group line / trail\n if (mark === 'line' || mark === 'trail') {\n return details;\n }\n // but order should group area for stacking (falls through)\n case DETAIL:\n case KEY: {\n const channelDef = encoding[channel];\n if (isArray(channelDef) || isFieldDef(channelDef)) {\n for (const fieldDef of array(channelDef)) {\n if (!fieldDef.aggregate) {\n details.push(vgField(fieldDef, {}));\n }\n }\n }\n return details;\n }\n case SIZE:\n if (mark === 'trail') {\n // For trail, size should not group trail lines.\n return details;\n }\n // For line, size should group lines.\n // falls through\n case COLOR:\n case FILL:\n case STROKE:\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n case STROKEDASH:\n case STROKEWIDTH: {\n // TODO strokeDashOffset:\n // falls through\n const fieldDef = getFieldDef(encoding[channel]);\n if (fieldDef && !fieldDef.aggregate) {\n details.push(vgField(fieldDef, {}));\n }\n return details;\n }\n }\n }, []);\n}\n//# sourceMappingURL=encoding.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray, isBoolean, isString } from 'vega-util';\nimport { isContinuousFieldOrDatumDef, isFieldDef, isFieldOrDatumDefForTimeFormat } from '../channeldef';\nimport { fieldDefs } from '../encoding';\nimport * as log from '../log';\nimport { isMarkDef } from '../mark';\nimport { getFirstDefined, hash, unique } from '../util';\nimport { isSignalRef } from '../vega.schema';\nimport { toStringFieldDef } from './../channeldef';\nexport function filterTooltipWithAggregatedField(oldEncoding) {\n const { tooltip } = oldEncoding, filteredEncoding = __rest(oldEncoding, [\"tooltip\"]);\n if (!tooltip) {\n return { filteredEncoding };\n }\n let customTooltipWithAggregatedField;\n let customTooltipWithoutAggregatedField;\n if (isArray(tooltip)) {\n for (const t of tooltip) {\n if (t.aggregate) {\n if (!customTooltipWithAggregatedField) {\n customTooltipWithAggregatedField = [];\n }\n customTooltipWithAggregatedField.push(t);\n }\n else {\n if (!customTooltipWithoutAggregatedField) {\n customTooltipWithoutAggregatedField = [];\n }\n customTooltipWithoutAggregatedField.push(t);\n }\n }\n if (customTooltipWithAggregatedField) {\n filteredEncoding.tooltip = customTooltipWithAggregatedField;\n }\n }\n else {\n if (tooltip['aggregate']) {\n filteredEncoding.tooltip = tooltip;\n }\n else {\n customTooltipWithoutAggregatedField = tooltip;\n }\n }\n if (isArray(customTooltipWithoutAggregatedField) && customTooltipWithoutAggregatedField.length === 1) {\n customTooltipWithoutAggregatedField = customTooltipWithoutAggregatedField[0];\n }\n return { customTooltipWithoutAggregatedField, filteredEncoding };\n}\nexport function getCompositeMarkTooltip(tooltipSummary, continuousAxisChannelDef, encodingWithoutContinuousAxis, withFieldName = true) {\n if ('tooltip' in encodingWithoutContinuousAxis) {\n return { tooltip: encodingWithoutContinuousAxis.tooltip };\n }\n const fiveSummaryTooltip = tooltipSummary.map(({ fieldPrefix, titlePrefix }) => {\n const mainTitle = withFieldName ? ` of ${getTitle(continuousAxisChannelDef)}` : '';\n return {\n field: fieldPrefix + continuousAxisChannelDef.field,\n type: continuousAxisChannelDef.type,\n title: isSignalRef(titlePrefix) ? { signal: titlePrefix + `\"${escape(mainTitle)}\"` } : titlePrefix + mainTitle\n };\n });\n const tooltipFieldDefs = fieldDefs(encodingWithoutContinuousAxis).map(toStringFieldDef);\n return {\n tooltip: [\n ...fiveSummaryTooltip,\n // need to cast because TextFieldDef supports fewer types of bin\n ...unique(tooltipFieldDefs, hash)\n ]\n };\n}\nexport function getTitle(continuousAxisChannelDef) {\n const { title, field } = continuousAxisChannelDef;\n return getFirstDefined(title, field);\n}\nexport function makeCompositeAggregatePartFactory(compositeMarkDef, continuousAxis, continuousAxisChannelDef, sharedEncoding, compositeMarkConfig) {\n const { scale, axis } = continuousAxisChannelDef;\n return ({ partName, mark, positionPrefix, endPositionPrefix = undefined, extraEncoding = {} }) => {\n const title = getTitle(continuousAxisChannelDef);\n return partLayerMixins(compositeMarkDef, partName, compositeMarkConfig, {\n mark,\n encoding: Object.assign(Object.assign(Object.assign({ [continuousAxis]: Object.assign(Object.assign(Object.assign({ field: positionPrefix + '_' + continuousAxisChannelDef.field, type: continuousAxisChannelDef.type }, (title !== undefined ? { title } : {})), (scale !== undefined ? { scale } : {})), (axis !== undefined ? { axis } : {})) }, (isString(endPositionPrefix)\n ? {\n [continuousAxis + '2']: {\n field: endPositionPrefix + '_' + continuousAxisChannelDef.field\n }\n }\n : {})), sharedEncoding), extraEncoding)\n });\n };\n}\nexport function partLayerMixins(markDef, part, compositeMarkConfig, partBaseSpec) {\n const { clip, color, opacity } = markDef;\n const mark = markDef.type;\n if (markDef[part] || (markDef[part] === undefined && compositeMarkConfig[part])) {\n return [\n Object.assign(Object.assign({}, partBaseSpec), { mark: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, compositeMarkConfig[part]), (clip ? { clip } : {})), (color ? { color } : {})), (opacity ? { opacity } : {})), (isMarkDef(partBaseSpec.mark) ? partBaseSpec.mark : { type: partBaseSpec.mark })), { style: `${mark}-${part}` }), (isBoolean(markDef[part]) ? {} : markDef[part])) })\n ];\n }\n return [];\n}\nexport function compositeMarkContinuousAxis(spec, orient, compositeMark) {\n const { encoding } = spec;\n const continuousAxis = orient === 'vertical' ? 'y' : 'x';\n const continuousAxisChannelDef = encoding[continuousAxis]; // Safe to cast because if x is not continuous fielddef, the orient would not be horizontal.\n const continuousAxisChannelDef2 = encoding[continuousAxis + '2'];\n const continuousAxisChannelDefError = encoding[continuousAxis + 'Error'];\n const continuousAxisChannelDefError2 = encoding[continuousAxis + 'Error2'];\n return {\n continuousAxisChannelDef: filterAggregateFromChannelDef(continuousAxisChannelDef, compositeMark),\n continuousAxisChannelDef2: filterAggregateFromChannelDef(continuousAxisChannelDef2, compositeMark),\n continuousAxisChannelDefError: filterAggregateFromChannelDef(continuousAxisChannelDefError, compositeMark),\n continuousAxisChannelDefError2: filterAggregateFromChannelDef(continuousAxisChannelDefError2, compositeMark),\n continuousAxis\n };\n}\nfunction filterAggregateFromChannelDef(continuousAxisChannelDef, compositeMark) {\n if (continuousAxisChannelDef && continuousAxisChannelDef.aggregate) {\n const { aggregate } = continuousAxisChannelDef, continuousAxisWithoutAggregate = __rest(continuousAxisChannelDef, [\"aggregate\"]);\n if (aggregate !== compositeMark) {\n log.warn(log.message.errorBarContinuousAxisHasCustomizedAggregate(aggregate, compositeMark));\n }\n return continuousAxisWithoutAggregate;\n }\n else {\n return continuousAxisChannelDef;\n }\n}\nexport function compositeMarkOrient(spec, compositeMark) {\n const { mark, encoding } = spec;\n const { x, y } = encoding;\n if (isMarkDef(mark) && mark.orient) {\n return mark.orient;\n }\n if (isContinuousFieldOrDatumDef(x)) {\n // x is continuous\n if (isContinuousFieldOrDatumDef(y)) {\n // both x and y are continuous\n const xAggregate = isFieldDef(x) && x.aggregate;\n const yAggregate = isFieldDef(y) && y.aggregate;\n if (!xAggregate && yAggregate === compositeMark) {\n return 'vertical';\n }\n else if (!yAggregate && xAggregate === compositeMark) {\n return 'horizontal';\n }\n else if (xAggregate === compositeMark && yAggregate === compositeMark) {\n throw new Error('Both x and y cannot have aggregate');\n }\n else {\n if (isFieldOrDatumDefForTimeFormat(y) && !isFieldOrDatumDefForTimeFormat(x)) {\n // y is temporal but x is not\n return 'horizontal';\n }\n // default orientation for two continuous\n return 'vertical';\n }\n }\n return 'horizontal';\n }\n else if (isContinuousFieldOrDatumDef(y)) {\n // y is continuous but x is not\n return 'vertical';\n }\n else {\n // Neither x nor y is continuous.\n throw new Error(`Need a valid continuous axis for ${compositeMark}s`);\n }\n}\n//# sourceMappingURL=common.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isNumber, isObject } from 'vega-util';\nimport { getMarkPropOrConfig } from '../compile/common';\nimport { extractTransformsFromEncoding, normalizeEncoding } from '../encoding';\nimport * as log from '../log';\nimport { isMarkDef } from '../mark';\nimport { isEmpty, omit } from '../util';\nimport { CompositeMarkNormalizer } from './base';\nimport { compositeMarkContinuousAxis, compositeMarkOrient, filterTooltipWithAggregatedField, getCompositeMarkTooltip, getTitle, makeCompositeAggregatePartFactory, partLayerMixins } from './common';\nexport const BOXPLOT = 'boxplot';\nexport const BOXPLOT_PARTS = ['box', 'median', 'outliers', 'rule', 'ticks'];\nexport const boxPlotNormalizer = new CompositeMarkNormalizer(BOXPLOT, normalizeBoxPlot);\nexport function getBoxPlotType(extent) {\n if (isNumber(extent)) {\n return 'tukey';\n }\n // Ham: If we ever want to, we could add another extent syntax `{kIQR: number}` for the original [Q1-k*IQR, Q3+k*IQR] whisker and call this boxPlotType = `kIQR`. However, I'm not exposing this for now.\n return extent;\n}\nexport function normalizeBoxPlot(spec, { config }) {\n var _a, _b;\n // Need to initEncoding first so we can infer type\n spec = Object.assign(Object.assign({}, spec), { encoding: normalizeEncoding(spec.encoding, config) });\n const { mark, encoding: _encoding, selection, projection: _p } = spec, outerSpec = __rest(spec, [\"mark\", \"encoding\", \"selection\", \"projection\"]);\n const markDef = isMarkDef(mark) ? mark : { type: mark };\n // TODO(https://github.com/vega/vega-lite/issues/3702): add selection support\n if (selection) {\n log.warn(log.message.selectionNotSupported('boxplot'));\n }\n const extent = (_a = markDef.extent) !== null && _a !== void 0 ? _a : config.boxplot.extent;\n const sizeValue = getMarkPropOrConfig('size', markDef, // TODO: https://github.com/vega/vega-lite/issues/6245\n config);\n const boxPlotType = getBoxPlotType(extent);\n const { bins, timeUnits, transform, continuousAxisChannelDef, continuousAxis, groupby, aggregate, encodingWithoutContinuousAxis, ticksOrient, boxOrient, customTooltipWithoutAggregatedField } = boxParams(spec, extent, config);\n const { color, size } = encodingWithoutContinuousAxis, encodingWithoutSizeColorAndContinuousAxis = __rest(encodingWithoutContinuousAxis, [\"color\", \"size\"]);\n const makeBoxPlotPart = (sharedEncoding) => {\n return makeCompositeAggregatePartFactory(markDef, continuousAxis, continuousAxisChannelDef, sharedEncoding, config.boxplot);\n };\n const makeBoxPlotExtent = makeBoxPlotPart(encodingWithoutSizeColorAndContinuousAxis);\n const makeBoxPlotBox = makeBoxPlotPart(encodingWithoutContinuousAxis);\n const makeBoxPlotMidTick = makeBoxPlotPart(Object.assign(Object.assign({}, encodingWithoutSizeColorAndContinuousAxis), (size ? { size } : {})));\n const fiveSummaryTooltipEncoding = getCompositeMarkTooltip([\n { fieldPrefix: boxPlotType === 'min-max' ? 'upper_whisker_' : 'max_', titlePrefix: 'Max' },\n { fieldPrefix: 'upper_box_', titlePrefix: 'Q3' },\n { fieldPrefix: 'mid_box_', titlePrefix: 'Median' },\n { fieldPrefix: 'lower_box_', titlePrefix: 'Q1' },\n { fieldPrefix: boxPlotType === 'min-max' ? 'lower_whisker_' : 'min_', titlePrefix: 'Min' }\n ], continuousAxisChannelDef, encodingWithoutContinuousAxis);\n // ## Whisker Layers\n const endTick = { type: 'tick', color: 'black', opacity: 1, orient: ticksOrient, invalid: null, aria: false };\n const whiskerTooltipEncoding = boxPlotType === 'min-max'\n ? fiveSummaryTooltipEncoding // for min-max, show five-summary tooltip for whisker\n : // for tukey / k-IQR, just show upper/lower-whisker\n getCompositeMarkTooltip([\n { fieldPrefix: 'upper_whisker_', titlePrefix: 'Upper Whisker' },\n { fieldPrefix: 'lower_whisker_', titlePrefix: 'Lower Whisker' }\n ], continuousAxisChannelDef, encodingWithoutContinuousAxis);\n const whiskerLayers = [\n ...makeBoxPlotExtent({\n partName: 'rule',\n mark: { type: 'rule', invalid: null, aria: false },\n positionPrefix: 'lower_whisker',\n endPositionPrefix: 'lower_box',\n extraEncoding: whiskerTooltipEncoding\n }),\n ...makeBoxPlotExtent({\n partName: 'rule',\n mark: { type: 'rule', invalid: null, aria: false },\n positionPrefix: 'upper_box',\n endPositionPrefix: 'upper_whisker',\n extraEncoding: whiskerTooltipEncoding\n }),\n ...makeBoxPlotExtent({\n partName: 'ticks',\n mark: endTick,\n positionPrefix: 'lower_whisker',\n extraEncoding: whiskerTooltipEncoding\n }),\n ...makeBoxPlotExtent({\n partName: 'ticks',\n mark: endTick,\n positionPrefix: 'upper_whisker',\n extraEncoding: whiskerTooltipEncoding\n })\n ];\n // ## Box Layers\n // TODO: support hiding certain mark parts\n const boxLayers = [\n ...(boxPlotType !== 'tukey' ? whiskerLayers : []),\n ...makeBoxPlotBox({\n partName: 'box',\n mark: Object.assign(Object.assign({ type: 'bar' }, (sizeValue ? { size: sizeValue } : {})), { orient: boxOrient, invalid: null, ariaRoleDescription: 'box' }),\n positionPrefix: 'lower_box',\n endPositionPrefix: 'upper_box',\n extraEncoding: fiveSummaryTooltipEncoding\n }),\n ...makeBoxPlotMidTick({\n partName: 'median',\n mark: Object.assign(Object.assign(Object.assign({ type: 'tick', invalid: null }, (isObject(config.boxplot.median) && config.boxplot.median.color ? { color: config.boxplot.median.color } : {})), (sizeValue ? { size: sizeValue } : {})), { orient: ticksOrient, aria: false }),\n positionPrefix: 'mid_box',\n extraEncoding: fiveSummaryTooltipEncoding\n })\n ];\n if (boxPlotType === 'min-max') {\n return Object.assign(Object.assign({}, outerSpec), { transform: ((_b = outerSpec.transform) !== null && _b !== void 0 ? _b : []).concat(transform), layer: boxLayers });\n }\n // Tukey Box Plot\n const lowerBoxExpr = `datum[\"lower_box_${continuousAxisChannelDef.field}\"]`;\n const upperBoxExpr = `datum[\"upper_box_${continuousAxisChannelDef.field}\"]`;\n const iqrExpr = `(${upperBoxExpr} - ${lowerBoxExpr})`;\n const lowerWhiskerExpr = `${lowerBoxExpr} - ${extent} * ${iqrExpr}`;\n const upperWhiskerExpr = `${upperBoxExpr} + ${extent} * ${iqrExpr}`;\n const fieldExpr = `datum[\"${continuousAxisChannelDef.field}\"]`;\n const joinaggregateTransform = {\n joinaggregate: boxParamsQuartiles(continuousAxisChannelDef.field),\n groupby\n };\n const filteredWhiskerSpec = {\n transform: [\n {\n filter: `(${lowerWhiskerExpr} <= ${fieldExpr}) && (${fieldExpr} <= ${upperWhiskerExpr})`\n },\n {\n aggregate: [\n {\n op: 'min',\n field: continuousAxisChannelDef.field,\n as: 'lower_whisker_' + continuousAxisChannelDef.field\n },\n {\n op: 'max',\n field: continuousAxisChannelDef.field,\n as: 'upper_whisker_' + continuousAxisChannelDef.field\n },\n // preserve lower_box / upper_box\n {\n op: 'min',\n field: 'lower_box_' + continuousAxisChannelDef.field,\n as: 'lower_box_' + continuousAxisChannelDef.field\n },\n {\n op: 'max',\n field: 'upper_box_' + continuousAxisChannelDef.field,\n as: 'upper_box_' + continuousAxisChannelDef.field\n },\n ...aggregate\n ],\n groupby\n }\n ],\n layer: whiskerLayers\n };\n const { tooltip } = encodingWithoutSizeColorAndContinuousAxis, encodingWithoutSizeColorContinuousAxisAndTooltip = __rest(encodingWithoutSizeColorAndContinuousAxis, [\"tooltip\"]);\n const { scale, axis } = continuousAxisChannelDef;\n const title = getTitle(continuousAxisChannelDef);\n const axisWithoutTitle = omit(axis, ['title']);\n const outlierLayersMixins = partLayerMixins(markDef, 'outliers', config.boxplot, {\n transform: [{ filter: `(${fieldExpr} < ${lowerWhiskerExpr}) || (${fieldExpr} > ${upperWhiskerExpr})` }],\n mark: 'point',\n encoding: Object.assign(Object.assign(Object.assign({ [continuousAxis]: Object.assign(Object.assign(Object.assign({ field: continuousAxisChannelDef.field, type: continuousAxisChannelDef.type }, (title !== undefined ? { title } : {})), (scale !== undefined ? { scale } : {})), (isEmpty(axisWithoutTitle) ? {} : { axis: axisWithoutTitle })) }, encodingWithoutSizeColorContinuousAxisAndTooltip), (color ? { color } : {})), (customTooltipWithoutAggregatedField ? { tooltip: customTooltipWithoutAggregatedField } : {}))\n })[0];\n let filteredLayersMixins;\n const filteredLayersMixinsTransforms = [...bins, ...timeUnits, joinaggregateTransform];\n if (outlierLayersMixins) {\n filteredLayersMixins = {\n transform: filteredLayersMixinsTransforms,\n layer: [outlierLayersMixins, filteredWhiskerSpec]\n };\n }\n else {\n filteredLayersMixins = filteredWhiskerSpec;\n filteredLayersMixins.transform.unshift(...filteredLayersMixinsTransforms);\n }\n return Object.assign(Object.assign({}, outerSpec), { layer: [\n filteredLayersMixins,\n {\n // boxplot\n transform,\n layer: boxLayers\n }\n ] });\n}\nfunction boxParamsQuartiles(continousAxisField) {\n return [\n {\n op: 'q1',\n field: continousAxisField,\n as: 'lower_box_' + continousAxisField\n },\n {\n op: 'q3',\n field: continousAxisField,\n as: 'upper_box_' + continousAxisField\n }\n ];\n}\nfunction boxParams(spec, extent, config) {\n const orient = compositeMarkOrient(spec, BOXPLOT);\n const { continuousAxisChannelDef, continuousAxis } = compositeMarkContinuousAxis(spec, orient, BOXPLOT);\n const continuousFieldName = continuousAxisChannelDef.field;\n const boxPlotType = getBoxPlotType(extent);\n const boxplotSpecificAggregate = [\n ...boxParamsQuartiles(continuousFieldName),\n {\n op: 'median',\n field: continuousFieldName,\n as: 'mid_box_' + continuousFieldName\n },\n {\n op: 'min',\n field: continuousFieldName,\n as: (boxPlotType === 'min-max' ? 'lower_whisker_' : 'min_') + continuousFieldName\n },\n {\n op: 'max',\n field: continuousFieldName,\n as: (boxPlotType === 'min-max' ? 'upper_whisker_' : 'max_') + continuousFieldName\n }\n ];\n const postAggregateCalculates = boxPlotType === 'min-max' || boxPlotType === 'tukey'\n ? []\n : [\n // This is for the original k-IQR, which we do not expose\n {\n calculate: `datum[\"upper_box_${continuousFieldName}\"] - datum[\"lower_box_${continuousFieldName}\"]`,\n as: 'iqr_' + continuousFieldName\n },\n {\n calculate: `min(datum[\"upper_box_${continuousFieldName}\"] + datum[\"iqr_${continuousFieldName}\"] * ${extent}, datum[\"max_${continuousFieldName}\"])`,\n as: 'upper_whisker_' + continuousFieldName\n },\n {\n calculate: `max(datum[\"lower_box_${continuousFieldName}\"] - datum[\"iqr_${continuousFieldName}\"] * ${extent}, datum[\"min_${continuousFieldName}\"])`,\n as: 'lower_whisker_' + continuousFieldName\n }\n ];\n const _a = spec.encoding, _b = continuousAxis, oldContinuousAxisChannelDef = _a[_b], oldEncodingWithoutContinuousAxis = __rest(_a, [typeof _b === \"symbol\" ? _b : _b + \"\"]);\n const { customTooltipWithoutAggregatedField, filteredEncoding } = filterTooltipWithAggregatedField(oldEncodingWithoutContinuousAxis);\n const { bins, timeUnits, aggregate, groupby, encoding: encodingWithoutContinuousAxis } = extractTransformsFromEncoding(filteredEncoding, config);\n const ticksOrient = orient === 'vertical' ? 'horizontal' : 'vertical';\n const boxOrient = orient;\n const transform = [\n ...bins,\n ...timeUnits,\n {\n aggregate: [...aggregate, ...boxplotSpecificAggregate],\n groupby\n },\n ...postAggregateCalculates\n ];\n return {\n bins,\n timeUnits,\n transform,\n groupby,\n aggregate,\n continuousAxisChannelDef,\n continuousAxis,\n encodingWithoutContinuousAxis,\n ticksOrient,\n boxOrient,\n customTooltipWithoutAggregatedField\n };\n}\n//# sourceMappingURL=boxplot.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isContinuousFieldOrDatumDef, isFieldOrDatumDef, title } from '../channeldef';\nimport { extractTransformsFromEncoding, normalizeEncoding } from '../encoding';\nimport * as log from '../log';\nimport { isMarkDef } from '../mark';\nimport { replaceAll, titleCase } from '../util';\nimport { CompositeMarkNormalizer } from './base';\nimport { compositeMarkContinuousAxis, compositeMarkOrient, getCompositeMarkTooltip, makeCompositeAggregatePartFactory } from './common';\nexport const ERRORBAR = 'errorbar';\nexport const ERRORBAR_PARTS = ['ticks', 'rule'];\nexport const errorBarNormalizer = new CompositeMarkNormalizer(ERRORBAR, normalizeErrorBar);\nexport function normalizeErrorBar(spec, { config }) {\n // Need to initEncoding first so we can infer type\n spec = Object.assign(Object.assign({}, spec), { encoding: normalizeEncoding(spec.encoding, config) });\n const { transform, continuousAxisChannelDef, continuousAxis, encodingWithoutContinuousAxis, ticksOrient, markDef, outerSpec, tooltipEncoding } = errorBarParams(spec, ERRORBAR, config);\n delete encodingWithoutContinuousAxis['size'];\n const makeErrorBarPart = makeCompositeAggregatePartFactory(markDef, continuousAxis, continuousAxisChannelDef, encodingWithoutContinuousAxis, config.errorbar);\n const thickness = markDef.thickness;\n const size = markDef.size;\n const tick = Object.assign(Object.assign({ type: 'tick', orient: ticksOrient, aria: false }, (thickness !== undefined ? { thickness } : {})), (size !== undefined ? { size } : {}));\n const layer = [\n ...makeErrorBarPart({\n partName: 'ticks',\n mark: tick,\n positionPrefix: 'lower',\n extraEncoding: tooltipEncoding\n }),\n ...makeErrorBarPart({\n partName: 'ticks',\n mark: tick,\n positionPrefix: 'upper',\n extraEncoding: tooltipEncoding\n }),\n ...makeErrorBarPart({\n partName: 'rule',\n mark: Object.assign({ type: 'rule', ariaRoleDescription: 'errorbar' }, (thickness !== undefined ? { size: thickness } : {})),\n positionPrefix: 'lower',\n endPositionPrefix: 'upper',\n extraEncoding: tooltipEncoding\n })\n ];\n return Object.assign(Object.assign(Object.assign({}, outerSpec), { transform }), (layer.length > 1 ? { layer } : Object.assign({}, layer[0])));\n}\nfunction errorBarOrientAndInputType(spec, compositeMark) {\n const { encoding } = spec;\n if (errorBarIsInputTypeRaw(encoding)) {\n return {\n orient: compositeMarkOrient(spec, compositeMark),\n inputType: 'raw'\n };\n }\n const isTypeAggregatedUpperLower = errorBarIsInputTypeAggregatedUpperLower(encoding);\n const isTypeAggregatedError = errorBarIsInputTypeAggregatedError(encoding);\n const x = encoding.x;\n const y = encoding.y;\n if (isTypeAggregatedUpperLower) {\n // type is aggregated-upper-lower\n if (isTypeAggregatedError) {\n throw new Error(`${compositeMark} cannot be both type aggregated-upper-lower and aggregated-error`);\n }\n const x2 = encoding.x2;\n const y2 = encoding.y2;\n if (isFieldOrDatumDef(x2) && isFieldOrDatumDef(y2)) {\n // having both x, x2 and y, y2\n throw new Error(`${compositeMark} cannot have both x2 and y2`);\n }\n else if (isFieldOrDatumDef(x2)) {\n if (isContinuousFieldOrDatumDef(x)) {\n // having x, x2 quantitative and field y, y2 are not specified\n return { orient: 'horizontal', inputType: 'aggregated-upper-lower' };\n }\n else {\n // having x, x2 that are not both quantitative\n throw new Error(`Both x and x2 have to be quantitative in ${compositeMark}`);\n }\n }\n else if (isFieldOrDatumDef(y2)) {\n // y2 is a FieldDef\n if (isContinuousFieldOrDatumDef(y)) {\n // having y, y2 quantitative and field x, x2 are not specified\n return { orient: 'vertical', inputType: 'aggregated-upper-lower' };\n }\n else {\n // having y, y2 that are not both quantitative\n throw new Error(`Both y and y2 have to be quantitative in ${compositeMark}`);\n }\n }\n throw new Error('No ranged axis');\n }\n else {\n // type is aggregated-error\n const xError = encoding.xError;\n const xError2 = encoding.xError2;\n const yError = encoding.yError;\n const yError2 = encoding.yError2;\n if (isFieldOrDatumDef(xError2) && !isFieldOrDatumDef(xError)) {\n // having xError2 without xError\n throw new Error(`${compositeMark} cannot have xError2 without xError`);\n }\n if (isFieldOrDatumDef(yError2) && !isFieldOrDatumDef(yError)) {\n // having yError2 without yError\n throw new Error(`${compositeMark} cannot have yError2 without yError`);\n }\n if (isFieldOrDatumDef(xError) && isFieldOrDatumDef(yError)) {\n // having both xError and yError\n throw new Error(`${compositeMark} cannot have both xError and yError with both are quantiative`);\n }\n else if (isFieldOrDatumDef(xError)) {\n if (isContinuousFieldOrDatumDef(x)) {\n // having x and xError that are all quantitative\n return { orient: 'horizontal', inputType: 'aggregated-error' };\n }\n else {\n // having x, xError, and xError2 that are not all quantitative\n throw new Error('All x, xError, and xError2 (if exist) have to be quantitative');\n }\n }\n else if (isFieldOrDatumDef(yError)) {\n if (isContinuousFieldOrDatumDef(y)) {\n // having y and yError that are all quantitative\n return { orient: 'vertical', inputType: 'aggregated-error' };\n }\n else {\n // having y, yError, and yError2 that are not all quantitative\n throw new Error('All y, yError, and yError2 (if exist) have to be quantitative');\n }\n }\n throw new Error('No ranged axis');\n }\n}\nfunction errorBarIsInputTypeRaw(encoding) {\n return ((isFieldOrDatumDef(encoding.x) || isFieldOrDatumDef(encoding.y)) &&\n !isFieldOrDatumDef(encoding.x2) &&\n !isFieldOrDatumDef(encoding.y2) &&\n !isFieldOrDatumDef(encoding.xError) &&\n !isFieldOrDatumDef(encoding.xError2) &&\n !isFieldOrDatumDef(encoding.yError) &&\n !isFieldOrDatumDef(encoding.yError2));\n}\nfunction errorBarIsInputTypeAggregatedUpperLower(encoding) {\n return isFieldOrDatumDef(encoding.x2) || isFieldOrDatumDef(encoding.y2);\n}\nfunction errorBarIsInputTypeAggregatedError(encoding) {\n return (isFieldOrDatumDef(encoding.xError) ||\n isFieldOrDatumDef(encoding.xError2) ||\n isFieldOrDatumDef(encoding.yError) ||\n isFieldOrDatumDef(encoding.yError2));\n}\nexport function errorBarParams(spec, compositeMark, config) {\n var _a;\n // TODO: use selection\n const { mark, encoding, selection, projection: _p } = spec, outerSpec = __rest(spec, [\"mark\", \"encoding\", \"selection\", \"projection\"]);\n const markDef = isMarkDef(mark) ? mark : { type: mark };\n // TODO(https://github.com/vega/vega-lite/issues/3702): add selection support\n if (selection) {\n log.warn(log.message.selectionNotSupported(compositeMark));\n }\n const { orient, inputType } = errorBarOrientAndInputType(spec, compositeMark);\n const { continuousAxisChannelDef, continuousAxisChannelDef2, continuousAxisChannelDefError, continuousAxisChannelDefError2, continuousAxis } = compositeMarkContinuousAxis(spec, orient, compositeMark);\n const { errorBarSpecificAggregate, postAggregateCalculates, tooltipSummary, tooltipTitleWithFieldName } = errorBarAggregationAndCalculation(markDef, continuousAxisChannelDef, continuousAxisChannelDef2, continuousAxisChannelDefError, continuousAxisChannelDefError2, inputType, compositeMark, config);\n const _b = encoding, _c = continuousAxis, oldContinuousAxisChannelDef = _b[_c], _d = continuousAxis === 'x' ? 'x2' : 'y2', oldContinuousAxisChannelDef2 = _b[_d], _e = continuousAxis === 'x' ? 'xError' : 'yError', oldContinuousAxisChannelDefError = _b[_e], _f = continuousAxis === 'x' ? 'xError2' : 'yError2', oldContinuousAxisChannelDefError2 = _b[_f], oldEncodingWithoutContinuousAxis = __rest(_b, [typeof _c === \"symbol\" ? _c : _c + \"\", typeof _d === \"symbol\" ? _d : _d + \"\", typeof _e === \"symbol\" ? _e : _e + \"\", typeof _f === \"symbol\" ? _f : _f + \"\"]);\n const { bins, timeUnits, aggregate: oldAggregate, groupby: oldGroupBy, encoding: encodingWithoutContinuousAxis } = extractTransformsFromEncoding(oldEncodingWithoutContinuousAxis, config);\n const aggregate = [...oldAggregate, ...errorBarSpecificAggregate];\n const groupby = inputType !== 'raw' ? [] : oldGroupBy;\n const tooltipEncoding = getCompositeMarkTooltip(tooltipSummary, continuousAxisChannelDef, encodingWithoutContinuousAxis, tooltipTitleWithFieldName);\n return {\n transform: [\n ...((_a = outerSpec.transform) !== null && _a !== void 0 ? _a : []),\n ...bins,\n ...timeUnits,\n ...(aggregate.length === 0 ? [] : [{ aggregate, groupby }]),\n ...postAggregateCalculates\n ],\n groupby,\n continuousAxisChannelDef,\n continuousAxis,\n encodingWithoutContinuousAxis,\n ticksOrient: orient === 'vertical' ? 'horizontal' : 'vertical',\n markDef,\n outerSpec,\n tooltipEncoding\n };\n}\nfunction errorBarAggregationAndCalculation(markDef, continuousAxisChannelDef, continuousAxisChannelDef2, continuousAxisChannelDefError, continuousAxisChannelDefError2, inputType, compositeMark, config) {\n let errorBarSpecificAggregate = [];\n let postAggregateCalculates = [];\n const continuousFieldName = continuousAxisChannelDef.field;\n let tooltipSummary;\n let tooltipTitleWithFieldName = false;\n if (inputType === 'raw') {\n const center = markDef.center\n ? markDef.center\n : markDef.extent\n ? markDef.extent === 'iqr'\n ? 'median'\n : 'mean'\n : config.errorbar.center;\n const extent = markDef.extent ? markDef.extent : center === 'mean' ? 'stderr' : 'iqr';\n if ((center === 'median') !== (extent === 'iqr')) {\n log.warn(log.message.errorBarCenterIsUsedWithWrongExtent(center, extent, compositeMark));\n }\n if (extent === 'stderr' || extent === 'stdev') {\n errorBarSpecificAggregate = [\n { op: extent, field: continuousFieldName, as: 'extent_' + continuousFieldName },\n { op: center, field: continuousFieldName, as: 'center_' + continuousFieldName }\n ];\n postAggregateCalculates = [\n {\n calculate: `datum[\"center_${continuousFieldName}\"] + datum[\"extent_${continuousFieldName}\"]`,\n as: 'upper_' + continuousFieldName\n },\n {\n calculate: `datum[\"center_${continuousFieldName}\"] - datum[\"extent_${continuousFieldName}\"]`,\n as: 'lower_' + continuousFieldName\n }\n ];\n tooltipSummary = [\n { fieldPrefix: 'center_', titlePrefix: titleCase(center) },\n { fieldPrefix: 'upper_', titlePrefix: getTitlePrefix(center, extent, '+') },\n { fieldPrefix: 'lower_', titlePrefix: getTitlePrefix(center, extent, '-') }\n ];\n tooltipTitleWithFieldName = true;\n }\n else {\n let centerOp;\n let lowerExtentOp;\n let upperExtentOp;\n if (extent === 'ci') {\n centerOp = 'mean';\n lowerExtentOp = 'ci0';\n upperExtentOp = 'ci1';\n }\n else {\n centerOp = 'median';\n lowerExtentOp = 'q1';\n upperExtentOp = 'q3';\n }\n errorBarSpecificAggregate = [\n { op: lowerExtentOp, field: continuousFieldName, as: 'lower_' + continuousFieldName },\n { op: upperExtentOp, field: continuousFieldName, as: 'upper_' + continuousFieldName },\n { op: centerOp, field: continuousFieldName, as: 'center_' + continuousFieldName }\n ];\n tooltipSummary = [\n {\n fieldPrefix: 'upper_',\n titlePrefix: title({ field: continuousFieldName, aggregate: upperExtentOp, type: 'quantitative' }, config, {\n allowDisabling: false\n })\n },\n {\n fieldPrefix: 'lower_',\n titlePrefix: title({ field: continuousFieldName, aggregate: lowerExtentOp, type: 'quantitative' }, config, {\n allowDisabling: false\n })\n },\n {\n fieldPrefix: 'center_',\n titlePrefix: title({ field: continuousFieldName, aggregate: centerOp, type: 'quantitative' }, config, {\n allowDisabling: false\n })\n }\n ];\n }\n }\n else {\n if (markDef.center || markDef.extent) {\n log.warn(log.message.errorBarCenterAndExtentAreNotNeeded(markDef.center, markDef.extent));\n }\n if (inputType === 'aggregated-upper-lower') {\n tooltipSummary = [];\n postAggregateCalculates = [\n { calculate: `datum[\"${continuousAxisChannelDef2.field}\"]`, as: 'upper_' + continuousFieldName },\n { calculate: `datum[\"${continuousFieldName}\"]`, as: 'lower_' + continuousFieldName }\n ];\n }\n else if (inputType === 'aggregated-error') {\n tooltipSummary = [{ fieldPrefix: '', titlePrefix: continuousFieldName }];\n postAggregateCalculates = [\n {\n calculate: `datum[\"${continuousFieldName}\"] + datum[\"${continuousAxisChannelDefError.field}\"]`,\n as: 'upper_' + continuousFieldName\n }\n ];\n if (continuousAxisChannelDefError2) {\n postAggregateCalculates.push({\n calculate: `datum[\"${continuousFieldName}\"] + datum[\"${continuousAxisChannelDefError2.field}\"]`,\n as: 'lower_' + continuousFieldName\n });\n }\n else {\n postAggregateCalculates.push({\n calculate: `datum[\"${continuousFieldName}\"] - datum[\"${continuousAxisChannelDefError.field}\"]`,\n as: 'lower_' + continuousFieldName\n });\n }\n }\n for (const postAggregateCalculate of postAggregateCalculates) {\n tooltipSummary.push({\n fieldPrefix: postAggregateCalculate.as.substring(0, 6),\n titlePrefix: replaceAll(replaceAll(postAggregateCalculate.calculate, 'datum[\"', ''), '\"]', '')\n });\n }\n }\n return { postAggregateCalculates, errorBarSpecificAggregate, tooltipSummary, tooltipTitleWithFieldName };\n}\nfunction getTitlePrefix(center, extent, operation) {\n return titleCase(center) + ' ' + operation + ' ' + extent;\n}\n//# sourceMappingURL=errorbar.js.map","import { normalizeEncoding } from '../encoding';\nimport * as log from '../log';\nimport { CompositeMarkNormalizer } from './base';\nimport { makeCompositeAggregatePartFactory } from './common';\nimport { errorBarParams } from './errorbar';\nexport const ERRORBAND = 'errorband';\nexport const ERRORBAND_PARTS = ['band', 'borders'];\nexport const errorBandNormalizer = new CompositeMarkNormalizer(ERRORBAND, normalizeErrorBand);\nexport function normalizeErrorBand(spec, { config }) {\n // Need to initEncoding first so we can infer type\n spec = Object.assign(Object.assign({}, spec), { encoding: normalizeEncoding(spec.encoding, config) });\n const { transform, continuousAxisChannelDef, continuousAxis, encodingWithoutContinuousAxis, markDef, outerSpec, tooltipEncoding } = errorBarParams(spec, ERRORBAND, config);\n const errorBandDef = markDef;\n const makeErrorBandPart = makeCompositeAggregatePartFactory(errorBandDef, continuousAxis, continuousAxisChannelDef, encodingWithoutContinuousAxis, config.errorband);\n const is2D = spec.encoding.x !== undefined && spec.encoding.y !== undefined;\n let bandMark = { type: is2D ? 'area' : 'rect' };\n let bordersMark = { type: is2D ? 'line' : 'rule' };\n const interpolate = Object.assign(Object.assign({}, (errorBandDef.interpolate ? { interpolate: errorBandDef.interpolate } : {})), (errorBandDef.tension && errorBandDef.interpolate ? { tension: errorBandDef.tension } : {}));\n if (is2D) {\n bandMark = Object.assign(Object.assign(Object.assign({}, bandMark), interpolate), { ariaRoleDescription: 'errorband' });\n bordersMark = Object.assign(Object.assign(Object.assign({}, bordersMark), interpolate), { aria: false });\n }\n else if (errorBandDef.interpolate) {\n log.warn(log.message.errorBand1DNotSupport('interpolate'));\n }\n else if (errorBandDef.tension) {\n log.warn(log.message.errorBand1DNotSupport('tension'));\n }\n return Object.assign(Object.assign({}, outerSpec), { transform, layer: [\n ...makeErrorBandPart({\n partName: 'band',\n mark: bandMark,\n positionPrefix: 'lower',\n endPositionPrefix: 'upper',\n extraEncoding: tooltipEncoding\n }),\n ...makeErrorBandPart({\n partName: 'borders',\n mark: bordersMark,\n positionPrefix: 'lower',\n extraEncoding: tooltipEncoding\n }),\n ...makeErrorBandPart({\n partName: 'borders',\n mark: bordersMark,\n positionPrefix: 'upper',\n extraEncoding: tooltipEncoding\n })\n ] });\n}\n//# sourceMappingURL=errorband.js.map","import { keys } from '../util';\nimport { CompositeMarkNormalizer } from './base';\nimport { BOXPLOT, BOXPLOT_PARTS, normalizeBoxPlot } from './boxplot';\nimport { ERRORBAND, ERRORBAND_PARTS, normalizeErrorBand } from './errorband';\nimport { ERRORBAR, ERRORBAR_PARTS, normalizeErrorBar } from './errorbar';\n/**\n * Registry index for all composite mark's normalizer\n */\nconst compositeMarkRegistry = {};\nexport function add(mark, run, parts) {\n const normalizer = new CompositeMarkNormalizer(mark, run);\n compositeMarkRegistry[mark] = { normalizer, parts };\n}\nexport function remove(mark) {\n delete compositeMarkRegistry[mark];\n}\nexport function getAllCompositeMarks() {\n return keys(compositeMarkRegistry);\n}\nadd(BOXPLOT, normalizeBoxPlot, BOXPLOT_PARTS);\nadd(ERRORBAR, normalizeErrorBar, ERRORBAR_PARTS);\nadd(ERRORBAND, normalizeErrorBand, ERRORBAND_PARTS);\n//# sourceMappingURL=index.js.map","export const VL_ONLY_LEGEND_CONFIG = [\n 'gradientHorizontalMaxLength',\n 'gradientHorizontalMinLength',\n 'gradientVerticalMaxLength',\n 'gradientVerticalMinLength',\n 'unselectedOpacity'\n];\n//# sourceMappingURL=guide.js.map","import { keys } from './util';\nexport const HEADER_TITLE_PROPERTIES_MAP = {\n titleAlign: 'align',\n titleAnchor: 'anchor',\n titleAngle: 'angle',\n titleBaseline: 'baseline',\n titleColor: 'color',\n titleFont: 'font',\n titleFontSize: 'fontSize',\n titleFontStyle: 'fontStyle',\n titleFontWeight: 'fontWeight',\n titleLimit: 'limit',\n titleLineHeight: 'lineHeight',\n titleOrient: 'orient',\n titlePadding: 'offset'\n};\nexport const HEADER_LABEL_PROPERTIES_MAP = {\n labelAlign: 'align',\n labelAnchor: 'anchor',\n labelAngle: 'angle',\n labelBaseline: 'baseline',\n labelColor: 'color',\n labelFont: 'font',\n labelFontSize: 'fontSize',\n labelFontStyle: 'fontStyle',\n labelFontWeight: 'fontWeight',\n labelLimit: 'limit',\n labelLineHeight: 'lineHeight',\n labelOrient: 'orient',\n labelPadding: 'offset'\n};\nexport const HEADER_TITLE_PROPERTIES = keys(HEADER_TITLE_PROPERTIES_MAP);\nexport const HEADER_LABEL_PROPERTIES = keys(HEADER_LABEL_PROPERTIES_MAP);\nconst HEADER_CONFIGS_INDEX = {\n header: 1,\n headerRow: 1,\n headerColumn: 1,\n headerFacet: 1\n};\nexport const HEADER_CONFIGS = keys(HEADER_CONFIGS_INDEX);\n//# sourceMappingURL=header.js.map","import { keys } from './util';\nexport const LEGEND_SCALE_CHANNELS = [\n 'size',\n 'shape',\n 'fill',\n 'stroke',\n 'strokeDash',\n 'strokeWidth',\n 'opacity'\n];\nexport const defaultLegendConfig = {\n gradientHorizontalMaxLength: 200,\n gradientHorizontalMinLength: 100,\n gradientVerticalMaxLength: 200,\n gradientVerticalMinLength: 64,\n unselectedOpacity: 0.35\n};\nexport const COMMON_LEGEND_PROPERTY_INDEX = {\n aria: 1,\n clipHeight: 1,\n columnPadding: 1,\n columns: 1,\n cornerRadius: 1,\n description: 1,\n direction: 1,\n fillColor: 1,\n format: 1,\n formatType: 1,\n gradientLength: 1,\n gradientOpacity: 1,\n gradientStrokeColor: 1,\n gradientStrokeWidth: 1,\n gradientThickness: 1,\n gridAlign: 1,\n labelAlign: 1,\n labelBaseline: 1,\n labelColor: 1,\n labelFont: 1,\n labelFontSize: 1,\n labelFontStyle: 1,\n labelFontWeight: 1,\n labelLimit: 1,\n labelOffset: 1,\n labelOpacity: 1,\n labelOverlap: 1,\n labelPadding: 1,\n labelSeparation: 1,\n legendX: 1,\n legendY: 1,\n offset: 1,\n orient: 1,\n padding: 1,\n rowPadding: 1,\n strokeColor: 1,\n symbolDash: 1,\n symbolDashOffset: 1,\n symbolFillColor: 1,\n symbolLimit: 1,\n symbolOffset: 1,\n symbolOpacity: 1,\n symbolSize: 1,\n symbolStrokeColor: 1,\n symbolStrokeWidth: 1,\n symbolType: 1,\n tickCount: 1,\n tickMinStep: 1,\n title: 1,\n titleAlign: 1,\n titleAnchor: 1,\n titleBaseline: 1,\n titleColor: 1,\n titleFont: 1,\n titleFontSize: 1,\n titleFontStyle: 1,\n titleFontWeight: 1,\n titleLimit: 1,\n titleLineHeight: 1,\n titleOpacity: 1,\n titleOrient: 1,\n titlePadding: 1,\n type: 1,\n values: 1,\n zindex: 1\n};\nexport const LEGEND_PROPERTIES = keys(COMMON_LEGEND_PROPERTY_INDEX);\n//# sourceMappingURL=legend.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nexport function assembleParameterSignals(params) {\n const signals = [];\n for (const param of params || []) {\n const { expr, bind } = param, rest = __rest(param, [\"expr\", \"bind\"]);\n if (bind && expr) {\n // Vega's InitSignal -- apply expr to \"init\"\n const signal = Object.assign(Object.assign({}, rest), { bind, init: expr });\n signals.push(signal);\n }\n else {\n const signal = Object.assign(Object.assign(Object.assign({}, rest), (expr ? { update: expr } : {})), (bind ? { bind } : {}));\n signals.push(signal);\n }\n }\n return signals;\n}\n//# sourceMappingURL=parameter.js.map","import { isObject } from 'vega-util';\nexport const SELECTION_ID = '_vgsid_';\nexport const defaultConfig = {\n single: {\n on: 'click',\n fields: [SELECTION_ID],\n resolve: 'global',\n empty: 'all',\n clear: 'dblclick'\n },\n multi: {\n on: 'click',\n fields: [SELECTION_ID],\n toggle: 'event.shiftKey',\n resolve: 'global',\n empty: 'all',\n clear: 'dblclick'\n },\n interval: {\n on: '[mousedown, window:mouseup] > window:mousemove!',\n encodings: ['x', 'y'],\n translate: '[mousedown, window:mouseup] > window:mousemove!',\n zoom: 'wheel!',\n mark: { fill: '#333', fillOpacity: 0.125, stroke: 'white' },\n resolve: 'global',\n clear: 'dblclick'\n }\n};\nexport function isLegendBinding(bind) {\n return !!bind && (bind === 'legend' || !!bind.legend);\n}\nexport function isLegendStreamBinding(bind) {\n return isLegendBinding(bind) && isObject(bind);\n}\n//# sourceMappingURL=selection.js.map","export function isAnyConcatSpec(spec) {\n return isVConcatSpec(spec) || isHConcatSpec(spec) || isConcatSpec(spec);\n}\nexport function isConcatSpec(spec) {\n return 'concat' in spec;\n}\nexport function isVConcatSpec(spec) {\n return 'vconcat' in spec;\n}\nexport function isHConcatSpec(spec) {\n return 'hconcat' in spec;\n}\n//# sourceMappingURL=concat.js.map","import { isNumber, isObject } from 'vega-util';\nimport { keys } from '../util';\nimport { isConcatSpec, isVConcatSpec } from './concat';\nimport { isFacetMapping, isFacetSpec } from './facet';\nexport function isStep(size) {\n return isObject(size) && size['step'] !== undefined;\n}\nexport function isFrameMixins(o) {\n return o['view'] || o['width'] || o['height'];\n}\nexport const DEFAULT_SPACING = 20;\nconst COMPOSITION_LAYOUT_INDEX = {\n align: 1,\n bounds: 1,\n center: 1,\n columns: 1,\n spacing: 1\n};\nconst COMPOSITION_LAYOUT_PROPERTIES = keys(COMPOSITION_LAYOUT_INDEX);\nexport function extractCompositionLayout(spec, specType, config) {\n var _a, _b;\n const compositionConfig = config[specType];\n const layout = {};\n // Apply config first\n const { spacing: spacingConfig, columns } = compositionConfig;\n if (spacingConfig !== undefined) {\n layout.spacing = spacingConfig;\n }\n if (columns !== undefined) {\n if ((isFacetSpec(spec) && !isFacetMapping(spec.facet)) || isConcatSpec(spec)) {\n layout.columns = columns;\n }\n }\n if (isVConcatSpec(spec)) {\n layout.columns = 1;\n }\n // Then copy properties from the spec\n for (const prop of COMPOSITION_LAYOUT_PROPERTIES) {\n if (spec[prop] !== undefined) {\n if (prop === 'spacing') {\n const spacing = spec[prop];\n layout[prop] = isNumber(spacing)\n ? spacing\n : {\n row: (_a = spacing.row) !== null && _a !== void 0 ? _a : spacingConfig,\n column: (_b = spacing.column) !== null && _b !== void 0 ? _b : spacingConfig\n };\n }\n else {\n layout[prop] = spec[prop];\n }\n }\n }\n return layout;\n}\n//# sourceMappingURL=base.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isObject, mergeConfig } from 'vega-util';\nimport { AXIS_CONFIGS, isConditionalAxisValue } from './axis';\nimport { signalOrValueRefWithCondition, signalRefOrValue } from './compile/common';\nimport { getAllCompositeMarks } from './compositemark';\nimport { replaceExprRefInIndex } from './expr';\nimport { VL_ONLY_LEGEND_CONFIG } from './guide';\nimport { HEADER_CONFIGS } from './header';\nimport { defaultLegendConfig } from './legend';\nimport * as mark from './mark';\nimport { MARK_CONFIGS, PRIMITIVE_MARKS, VL_ONLY_MARK_CONFIG_PROPERTIES, VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX } from './mark';\nimport { assembleParameterSignals } from './parameter';\nimport { defaultScaleConfig } from './scale';\nimport { defaultConfig as defaultSelectionConfig } from './selection';\nimport { DEFAULT_SPACING, isStep } from './spec/base';\nimport { extractTitleConfig } from './title';\nimport { duplicate, getFirstDefined, isEmpty, keys, omit } from './util';\nexport function getViewConfigContinuousSize(viewConfig, channel) {\n var _a;\n return (_a = viewConfig[channel]) !== null && _a !== void 0 ? _a : viewConfig[channel === 'width' ? 'continuousWidth' : 'continuousHeight']; // get width/height for backwards compatibility\n}\nexport function getViewConfigDiscreteStep(viewConfig, channel) {\n const size = getViewConfigDiscreteSize(viewConfig, channel);\n return isStep(size) ? size.step : DEFAULT_STEP;\n}\nexport function getViewConfigDiscreteSize(viewConfig, channel) {\n var _a;\n const size = (_a = viewConfig[channel]) !== null && _a !== void 0 ? _a : viewConfig[channel === 'width' ? 'discreteWidth' : 'discreteHeight']; // get width/height for backwards compatibility\n return getFirstDefined(size, { step: viewConfig.step });\n}\nexport const DEFAULT_STEP = 20;\nexport const defaultViewConfig = {\n continuousWidth: 200,\n continuousHeight: 200,\n step: DEFAULT_STEP\n};\nexport function isVgScheme(rangeScheme) {\n return rangeScheme && !!rangeScheme['scheme'];\n}\nexport const defaultConfig = {\n background: 'white',\n padding: 5,\n timeFormat: '%b %d, %Y',\n countTitle: 'Count of Records',\n view: defaultViewConfig,\n mark: mark.defaultMarkConfig,\n arc: {},\n area: {},\n bar: mark.defaultBarConfig,\n circle: {},\n geoshape: {},\n image: {},\n line: {},\n point: {},\n rect: mark.defaultRectConfig,\n rule: { color: 'black' },\n square: {},\n text: { color: 'black' },\n tick: mark.defaultTickConfig,\n trail: {},\n boxplot: {\n size: 14,\n extent: 1.5,\n box: {},\n median: { color: 'white' },\n outliers: {},\n rule: {},\n ticks: null\n },\n errorbar: {\n center: 'mean',\n rule: true,\n ticks: false\n },\n errorband: {\n band: {\n opacity: 0.3\n },\n borders: false\n },\n scale: defaultScaleConfig,\n projection: {},\n legend: defaultLegendConfig,\n header: { titlePadding: 10, labelPadding: 10 },\n headerColumn: {},\n headerRow: {},\n headerFacet: {},\n selection: defaultSelectionConfig,\n style: {},\n title: {},\n facet: { spacing: DEFAULT_SPACING },\n concat: { spacing: DEFAULT_SPACING }\n};\n// Tableau10 color palette, copied from `vegaScale.scheme('tableau10')`\nconst tab10 = [\n '#4c78a8',\n '#f58518',\n '#e45756',\n '#72b7b2',\n '#54a24b',\n '#eeca3b',\n '#b279a2',\n '#ff9da6',\n '#9d755d',\n '#bab0ac'\n];\nexport const DEFAULT_FONT_SIZE = {\n text: 11,\n guideLabel: 10,\n guideTitle: 11,\n groupTitle: 13,\n groupSubtitle: 12\n};\nexport const DEFAULT_COLOR = {\n blue: tab10[0],\n orange: tab10[1],\n red: tab10[2],\n teal: tab10[3],\n green: tab10[4],\n yellow: tab10[5],\n purple: tab10[6],\n pink: tab10[7],\n brown: tab10[8],\n gray0: '#000',\n gray1: '#111',\n gray2: '#222',\n gray3: '#333',\n gray4: '#444',\n gray5: '#555',\n gray6: '#666',\n gray7: '#777',\n gray8: '#888',\n gray9: '#999',\n gray10: '#aaa',\n gray11: '#bbb',\n gray12: '#ccc',\n gray13: '#ddd',\n gray14: '#eee',\n gray15: '#fff'\n};\nexport function colorSignalConfig(color = {}) {\n return {\n signals: [\n {\n name: 'color',\n value: isObject(color) ? Object.assign(Object.assign({}, DEFAULT_COLOR), color) : DEFAULT_COLOR\n }\n ],\n mark: { color: { signal: 'color.blue' } },\n rule: { color: { signal: 'color.gray0' } },\n text: {\n color: { signal: 'color.gray0' }\n },\n style: {\n 'guide-label': {\n fill: { signal: 'color.gray0' }\n },\n 'guide-title': {\n fill: { signal: 'color.gray0' }\n },\n 'group-title': {\n fill: { signal: 'color.gray0' }\n },\n 'group-subtitle': {\n fill: { signal: 'color.gray0' }\n },\n cell: {\n stroke: { signal: 'color.gray8' }\n }\n },\n axis: {\n domainColor: { signal: 'color.gray13' },\n gridColor: { signal: 'color.gray8' },\n tickColor: { signal: 'color.gray13' }\n },\n range: {\n category: [\n { signal: 'color.blue' },\n { signal: 'color.orange' },\n { signal: 'color.red' },\n { signal: 'color.teal' },\n { signal: 'color.green' },\n { signal: 'color.yellow' },\n { signal: 'color.purple' },\n { signal: 'color.pink' },\n { signal: 'color.brown' },\n { signal: 'color.grey8' }\n ]\n }\n };\n}\nexport function fontSizeSignalConfig(fontSize) {\n return {\n signals: [\n {\n name: 'fontSize',\n value: isObject(fontSize) ? Object.assign(Object.assign({}, DEFAULT_FONT_SIZE), fontSize) : DEFAULT_FONT_SIZE\n }\n ],\n text: {\n fontSize: { signal: 'fontSize.text' }\n },\n style: {\n 'guide-label': {\n fontSize: { signal: 'fontSize.guideLabel' }\n },\n 'guide-title': {\n fontSize: { signal: 'fontSize.guideTitle' }\n },\n 'group-title': {\n fontSize: { signal: 'fontSize.groupTitle' }\n },\n 'group-subtitle': {\n fontSize: { signal: 'fontSize.groupSubtitle' }\n }\n }\n };\n}\nexport function fontConfig(font) {\n return {\n text: { font },\n style: {\n 'guide-label': { font },\n 'guide-title': { font },\n 'group-title': { font },\n 'group-subtitle': { font }\n }\n };\n}\nfunction getAxisConfigInternal(axisConfig) {\n const props = keys(axisConfig || {});\n const axisConfigInternal = {};\n for (const prop of props) {\n const val = axisConfig[prop];\n axisConfigInternal[prop] = isConditionalAxisValue(val)\n ? signalOrValueRefWithCondition(val)\n : signalRefOrValue(val);\n }\n return axisConfigInternal;\n}\nfunction getStyleConfigInternal(styleConfig) {\n const props = keys(styleConfig);\n const styleConfigInternal = {};\n for (const prop of props) {\n // We need to cast to cheat a bit here since styleConfig can be either mark config or axis config\n styleConfigInternal[prop] = getAxisConfigInternal(styleConfig[prop]);\n }\n return styleConfigInternal;\n}\nconst configPropsWithExpr = [\n ...MARK_CONFIGS,\n ...AXIS_CONFIGS,\n ...HEADER_CONFIGS,\n 'background',\n 'padding',\n 'legend',\n 'lineBreak',\n 'scale',\n 'style',\n 'title',\n 'view'\n];\n/**\n * Merge specified config with default config and config for the `color` flag,\n * then replace all expressions with signals\n */\nexport function initConfig(specifiedConfig = {}) {\n const { color, font, fontSize } = specifiedConfig, restConfig = __rest(specifiedConfig, [\"color\", \"font\", \"fontSize\"]);\n const mergedConfig = mergeConfig({}, defaultConfig, font ? fontConfig(font) : {}, color ? colorSignalConfig(color) : {}, fontSize ? fontSizeSignalConfig(fontSize) : {}, restConfig || {});\n const outputConfig = omit(mergedConfig, configPropsWithExpr);\n for (const prop of ['background', 'lineBreak', 'padding']) {\n if (mergedConfig[prop]) {\n outputConfig[prop] = signalRefOrValue(mergedConfig[prop]);\n }\n }\n for (const markConfigType of mark.MARK_CONFIGS) {\n if (mergedConfig[markConfigType]) {\n outputConfig[markConfigType] = replaceExprRefInIndex(mergedConfig[markConfigType]);\n }\n }\n for (const axisConfigType of AXIS_CONFIGS) {\n if (mergedConfig[axisConfigType]) {\n outputConfig[axisConfigType] = getAxisConfigInternal(mergedConfig[axisConfigType]);\n }\n }\n for (const headerConfigType of HEADER_CONFIGS) {\n if (mergedConfig[headerConfigType]) {\n outputConfig[headerConfigType] = replaceExprRefInIndex(mergedConfig[headerConfigType]);\n }\n }\n if (mergedConfig.legend) {\n outputConfig.legend = replaceExprRefInIndex(mergedConfig.legend);\n }\n if (mergedConfig.scale) {\n outputConfig.scale = replaceExprRefInIndex(mergedConfig.scale);\n }\n if (mergedConfig.style) {\n outputConfig.style = getStyleConfigInternal(mergedConfig.style);\n }\n if (mergedConfig.title) {\n outputConfig.title = replaceExprRefInIndex(mergedConfig.title);\n }\n if (mergedConfig.view) {\n outputConfig.view = replaceExprRefInIndex(mergedConfig.view);\n }\n return outputConfig;\n}\nconst MARK_STYLES = ['view', ...PRIMITIVE_MARKS];\nconst VL_ONLY_CONFIG_PROPERTIES = [\n 'color',\n 'fontSize',\n 'background',\n 'padding',\n 'facet',\n 'concat',\n 'numberFormat',\n 'timeFormat',\n 'countTitle',\n 'header',\n 'axisQuantitative',\n 'axisTemporal',\n 'axisDiscrete',\n 'axisPoint',\n 'axisXBand',\n 'axisXPoint',\n 'axisXDiscrete',\n 'axisXQuantitative',\n 'axisXTemporal',\n 'axisYBand',\n 'axisYPoint',\n 'axisYDiscrete',\n 'axisYQuantitative',\n 'axisYTemporal',\n 'scale',\n 'selection',\n 'overlay' // FIXME: Redesign and unhide this\n];\nconst VL_ONLY_ALL_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX = Object.assign({ view: ['continuousWidth', 'continuousHeight', 'discreteWidth', 'discreteHeight', 'step'] }, VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX);\nexport function stripAndRedirectConfig(config) {\n config = duplicate(config);\n for (const prop of VL_ONLY_CONFIG_PROPERTIES) {\n delete config[prop];\n }\n if (config.axis) {\n // delete condition axis config\n for (const prop in config.axis) {\n if (isConditionalAxisValue(config.axis[prop])) {\n delete config.axis[prop];\n }\n }\n }\n if (config.legend) {\n for (const prop of VL_ONLY_LEGEND_CONFIG) {\n delete config.legend[prop];\n }\n }\n // Remove Vega-Lite only generic mark config\n if (config.mark) {\n for (const prop of VL_ONLY_MARK_CONFIG_PROPERTIES) {\n delete config.mark[prop];\n }\n if (config.mark.tooltip && isObject(config.mark.tooltip)) {\n delete config.mark.tooltip;\n }\n }\n if (config.params) {\n config.signals = (config.signals || []).concat(assembleParameterSignals(config.params));\n delete config.params;\n }\n for (const markType of MARK_STYLES) {\n // Remove Vega-Lite-only mark config\n for (const prop of VL_ONLY_MARK_CONFIG_PROPERTIES) {\n delete config[markType][prop];\n }\n // Remove Vega-Lite only mark-specific config\n const vlOnlyMarkSpecificConfigs = VL_ONLY_ALL_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX[markType];\n if (vlOnlyMarkSpecificConfigs) {\n for (const prop of vlOnlyMarkSpecificConfigs) {\n delete config[markType][prop];\n }\n }\n // Redirect mark config to config.style so that mark config only affect its own mark type\n // without affecting other marks that share the same underlying Vega marks.\n // For example, config.rect should not affect bar marks.\n redirectConfigToStyleConfig(config, markType);\n }\n for (const m of getAllCompositeMarks()) {\n // Clean up the composite mark config as we don't need them in the output specs anymore\n delete config[m];\n }\n redirectTitleConfig(config);\n // Remove empty config objects.\n for (const prop in config) {\n if (isObject(config[prop]) && isEmpty(config[prop])) {\n delete config[prop];\n }\n }\n return isEmpty(config) ? undefined : config;\n}\n/**\n *\n * Redirect config.title -- so that title config do not affect header labels,\n * which also uses `title` directive to implement.\n *\n * For subtitle configs in config.title, keep them in config.title as header titles never have subtitles.\n */\nfunction redirectTitleConfig(config) {\n const { titleMarkConfig, subtitleMarkConfig, subtitle } = extractTitleConfig(config.title);\n // set config.style if title/subtitleMarkConfig is not an empty object\n if (!isEmpty(titleMarkConfig)) {\n config.style['group-title'] = Object.assign(Object.assign({}, config.style['group-title']), titleMarkConfig // config.title has higher precedence than config.style.group-title in Vega\n );\n }\n if (!isEmpty(subtitleMarkConfig)) {\n config.style['group-subtitle'] = Object.assign(Object.assign({}, config.style['group-subtitle']), subtitleMarkConfig);\n }\n // subtitle part can stay in config.title since header titles do not use subtitle\n if (!isEmpty(subtitle)) {\n config.title = subtitle;\n }\n else {\n delete config.title;\n }\n}\nfunction redirectConfigToStyleConfig(config, prop, // string = composite mark\ntoProp, compositeMarkPart) {\n const propConfig = compositeMarkPart ? config[prop][compositeMarkPart] : config[prop];\n if (prop === 'view') {\n toProp = 'cell'; // View's default style is \"cell\"\n }\n const style = Object.assign(Object.assign({}, propConfig), config.style[toProp !== null && toProp !== void 0 ? toProp : prop]);\n // set config.style if it is not an empty object\n if (!isEmpty(style)) {\n config.style[toProp !== null && toProp !== void 0 ? toProp : prop] = style;\n }\n if (!compositeMarkPart) {\n // For composite mark, so don't delete the whole config yet as we have to do multiple redirections.\n delete config[prop];\n }\n}\n//# sourceMappingURL=config.js.map","export function isLayerSpec(spec) {\n return 'layer' in spec;\n}\n//# sourceMappingURL=layer.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as log from '../log';\nimport { isConcatSpec, isHConcatSpec, isVConcatSpec } from './concat';\nimport { isFacetSpec } from './facet';\nimport { isLayerSpec } from './layer';\nimport { isRepeatSpec } from './repeat';\nimport { isUnitSpec } from './unit';\nexport class SpecMapper {\n map(spec, params) {\n if (isFacetSpec(spec)) {\n return this.mapFacet(spec, params);\n }\n else if (isRepeatSpec(spec)) {\n return this.mapRepeat(spec, params);\n }\n else if (isHConcatSpec(spec)) {\n return this.mapHConcat(spec, params);\n }\n else if (isVConcatSpec(spec)) {\n return this.mapVConcat(spec, params);\n }\n else if (isConcatSpec(spec)) {\n return this.mapConcat(spec, params);\n }\n else {\n return this.mapLayerOrUnit(spec, params);\n }\n }\n mapLayerOrUnit(spec, params) {\n if (isLayerSpec(spec)) {\n return this.mapLayer(spec, params);\n }\n else if (isUnitSpec(spec)) {\n return this.mapUnit(spec, params);\n }\n throw new Error(log.message.invalidSpec(spec));\n }\n mapLayer(spec, params) {\n return Object.assign(Object.assign({}, spec), { layer: spec.layer.map(subspec => this.mapLayerOrUnit(subspec, params)) });\n }\n mapHConcat(spec, params) {\n return Object.assign(Object.assign({}, spec), { hconcat: spec.hconcat.map(subspec => this.map(subspec, params)) });\n }\n mapVConcat(spec, params) {\n return Object.assign(Object.assign({}, spec), { vconcat: spec.vconcat.map(subspec => this.map(subspec, params)) });\n }\n mapConcat(spec, params) {\n const { concat } = spec, rest = __rest(spec, [\"concat\"]);\n return Object.assign(Object.assign({}, rest), { concat: concat.map(subspec => this.map(subspec, params)) });\n }\n mapFacet(spec, params) {\n return Object.assign(Object.assign({}, spec), { \n // TODO: remove \"any\" once we support all facet listed in https://github.com/vega/vega-lite/issues/2760\n spec: this.map(spec.spec, params) });\n }\n mapRepeat(spec, params) {\n return Object.assign(Object.assign({}, spec), { \n // as any is required here since TS cannot infer that the output type satisfies the input type\n spec: this.map(spec.spec, params) });\n }\n}\n//# sourceMappingURL=map.js.map","import { isArray } from 'vega-util';\nexport function isRepeatSpec(spec) {\n return 'repeat' in spec;\n}\nexport function isLayerRepeatSpec(spec) {\n return !isArray(spec.repeat) && spec.repeat['layer'];\n}\n//# sourceMappingURL=repeat.js.map","import { array, isBoolean } from 'vega-util';\nimport { SUM_OPS } from './aggregate';\nimport { getSecondaryRangeChannel, NONPOSITION_CHANNELS } from './channel';\nimport { channelDefType, getFieldDef, isFieldDef, isFieldOrDatumDef, vgField } from './channeldef';\nimport { channelHasField, isAggregate } from './encoding';\nimport * as log from './log';\nimport { ARC, AREA, BAR, CIRCLE, isMarkDef, isPathMark, LINE, POINT, RULE, SQUARE, TEXT, TICK } from './mark';\nimport { ScaleType } from './scale';\nimport { contains } from './util';\nconst STACK_OFFSET_INDEX = {\n zero: 1,\n center: 1,\n normalize: 1\n};\nexport function isStackOffset(s) {\n return s in STACK_OFFSET_INDEX;\n}\nexport const STACKABLE_MARKS = new Set([ARC, BAR, AREA, RULE, POINT, CIRCLE, SQUARE, LINE, TEXT, TICK]);\nexport const STACK_BY_DEFAULT_MARKS = new Set([BAR, AREA, ARC]);\nfunction potentialStackedChannel(encoding, x) {\n var _a, _b;\n const y = x === 'x' ? 'y' : 'radius';\n const xDef = encoding[x];\n const yDef = encoding[y];\n if (isFieldDef(xDef) && isFieldDef(yDef)) {\n if (channelDefType(xDef) === 'quantitative' && channelDefType(yDef) === 'quantitative') {\n if (xDef.stack) {\n return x;\n }\n else if (yDef.stack) {\n return y;\n }\n const xAggregate = isFieldDef(xDef) && !!xDef.aggregate;\n const yAggregate = isFieldDef(yDef) && !!yDef.aggregate;\n // if there is no explicit stacking, only apply stack if there is only one aggregate for x or y\n if (xAggregate !== yAggregate) {\n return xAggregate ? x : y;\n }\n else {\n const xScale = (_a = xDef.scale) === null || _a === void 0 ? void 0 : _a.type;\n const yScale = (_b = yDef.scale) === null || _b === void 0 ? void 0 : _b.type;\n if (xScale && xScale !== 'linear') {\n return y;\n }\n else if (yScale && yScale !== 'linear') {\n return x;\n }\n }\n }\n else if (channelDefType(xDef) === 'quantitative') {\n return x;\n }\n else if (channelDefType(yDef) === 'quantitative') {\n return y;\n }\n }\n else if (channelDefType(xDef) === 'quantitative') {\n return x;\n }\n else if (channelDefType(yDef) === 'quantitative') {\n return y;\n }\n return undefined;\n}\nfunction getDimensionChannel(channel) {\n switch (channel) {\n case 'x':\n return 'y';\n case 'y':\n return 'x';\n case 'theta':\n return 'radius';\n case 'radius':\n return 'theta';\n }\n}\n// Note: CompassQL uses this method and only pass in required properties of each argument object.\n// If required properties change, make sure to update CompassQL.\nexport function stack(m, encoding, opt = {}) {\n const mark = isMarkDef(m) ? m.type : m;\n // Should have stackable mark\n if (!STACKABLE_MARKS.has(mark)) {\n return null;\n }\n // Run potential stacked twice, one for Cartesian and another for Polar,\n // so text marks can be stacked in any of the coordinates.\n // Note: The logic here is not perfectly correct. If we want to support stacked dot plots where each dot is a pie chart with label, we have to change the stack logic here to separate Cartesian stacking for polar stacking.\n // However, since we probably never want to do that, let's just note the limitation here.\n const fieldChannel = potentialStackedChannel(encoding, 'x') || potentialStackedChannel(encoding, 'theta');\n if (!fieldChannel) {\n return null;\n }\n const stackedFieldDef = encoding[fieldChannel];\n const stackedField = isFieldDef(stackedFieldDef) ? vgField(stackedFieldDef, {}) : undefined;\n let dimensionChannel = getDimensionChannel(fieldChannel);\n let dimensionDef = encoding[dimensionChannel];\n let dimensionField = isFieldDef(dimensionDef) ? vgField(dimensionDef, {}) : undefined;\n // avoid grouping by the stacked field\n if (dimensionField === stackedField) {\n dimensionField = undefined;\n dimensionDef = undefined;\n dimensionChannel = undefined;\n }\n // Should have grouping level of detail that is different from the dimension field\n const stackBy = NONPOSITION_CHANNELS.reduce((sc, channel) => {\n // Ignore tooltip in stackBy (https://github.com/vega/vega-lite/issues/4001)\n if (channel !== 'tooltip' && channelHasField(encoding, channel)) {\n const channelDef = encoding[channel];\n for (const cDef of array(channelDef)) {\n const fieldDef = getFieldDef(cDef);\n if (fieldDef.aggregate) {\n continue;\n }\n // Check whether the channel's field is identical to x/y's field or if the channel is a repeat\n const f = vgField(fieldDef, {});\n if (\n // if fielddef is a repeat, just include it in the stack by\n !f ||\n // otherwise, the field must be different from x and y fields.\n f !== dimensionField) {\n sc.push({ channel, fieldDef });\n }\n }\n }\n return sc;\n }, []);\n // Automatically determine offset\n let offset;\n if (stackedFieldDef.stack !== undefined) {\n if (isBoolean(stackedFieldDef.stack)) {\n offset = stackedFieldDef.stack ? 'zero' : null;\n }\n else {\n offset = stackedFieldDef.stack;\n }\n }\n else if (stackBy.length > 0 && STACK_BY_DEFAULT_MARKS.has(mark)) {\n // Bar and Area with sum ops are automatically stacked by default\n offset = 'zero';\n }\n if (!offset || !isStackOffset(offset)) {\n return null;\n }\n if (isAggregate(encoding) && stackBy.length === 0) {\n return null;\n }\n // warn when stacking non-linear\n if (stackedFieldDef.scale && stackedFieldDef.scale.type && stackedFieldDef.scale.type !== ScaleType.LINEAR) {\n if (opt.disallowNonLinearStack) {\n return null;\n }\n else {\n log.warn(log.message.cannotStackNonLinearScale(stackedFieldDef.scale.type));\n }\n }\n // Check if it is a ranged mark\n if (isFieldOrDatumDef(encoding[getSecondaryRangeChannel(fieldChannel)])) {\n if (stackedFieldDef.stack !== undefined) {\n log.warn(log.message.cannotStackRangedMark(fieldChannel));\n }\n return null;\n }\n // Warn if stacking non-summative aggregate\n if (isFieldDef(stackedFieldDef) && stackedFieldDef.aggregate && !contains(SUM_OPS, stackedFieldDef.aggregate)) {\n log.warn(log.message.stackNonSummativeAggregate(stackedFieldDef.aggregate));\n }\n return {\n groupbyChannel: dimensionDef ? dimensionChannel : undefined,\n groupbyField: dimensionField,\n fieldChannel,\n impute: stackedFieldDef.impute === null ? false : isPathMark(mark),\n stackBy,\n offset\n };\n}\n//# sourceMappingURL=stack.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isObject } from 'vega-util';\nimport { normalizeEncoding } from '../encoding';\nimport { isMarkDef } from '../mark';\nimport { isUnitSpec } from '../spec/unit';\nimport { stack } from '../stack';\nimport { keys, omit, pick } from '../util';\nfunction dropLineAndPoint(markDef) {\n const { point: _point, line: _line } = markDef, mark = __rest(markDef, [\"point\", \"line\"]);\n return keys(mark).length > 1 ? mark : mark.type;\n}\nfunction dropLineAndPointFromConfig(config) {\n for (const mark of ['line', 'area', 'rule', 'trail']) {\n if (config[mark]) {\n config = Object.assign(Object.assign({}, config), { \n // TODO: remove as any\n [mark]: omit(config[mark], ['point', 'line']) });\n }\n }\n return config;\n}\nfunction getPointOverlay(markDef, markConfig = {}, encoding) {\n if (markDef.point === 'transparent') {\n return { opacity: 0 };\n }\n else if (markDef.point) {\n // truthy : true or object\n return isObject(markDef.point) ? markDef.point : {};\n }\n else if (markDef.point !== undefined) {\n // false or null\n return null;\n }\n else {\n // undefined (not disabled)\n if (markConfig.point || encoding.shape) {\n // enable point overlay if config[mark].point is truthy or if encoding.shape is provided\n return isObject(markConfig.point) ? markConfig.point : {};\n }\n // markDef.point is defined as falsy\n return undefined;\n }\n}\nfunction getLineOverlay(markDef, markConfig = {}) {\n if (markDef.line) {\n // true or object\n return markDef.line === true ? {} : markDef.line;\n }\n else if (markDef.line !== undefined) {\n // false or null\n return null;\n }\n else {\n // undefined (not disabled)\n if (markConfig.line) {\n // enable line overlay if config[mark].line is truthy\n return markConfig.line === true ? {} : markConfig.line;\n }\n // markDef.point is defined as falsy\n return undefined;\n }\n}\nexport class PathOverlayNormalizer {\n constructor() {\n this.name = 'path-overlay';\n }\n hasMatchingType(spec, config) {\n if (isUnitSpec(spec)) {\n const { mark, encoding } = spec;\n const markDef = isMarkDef(mark) ? mark : { type: mark };\n switch (markDef.type) {\n case 'line':\n case 'rule':\n case 'trail':\n return !!getPointOverlay(markDef, config[markDef.type], encoding);\n case 'area':\n return (\n // false / null are also included as we want to remove the properties\n !!getPointOverlay(markDef, config[markDef.type], encoding) ||\n !!getLineOverlay(markDef, config[markDef.type]));\n }\n }\n return false;\n }\n run(spec, params, normalize) {\n const { config } = params;\n const { selection, projection, mark, encoding: e } = spec, outerSpec = __rest(spec, [\"selection\", \"projection\", \"mark\", \"encoding\"]);\n // Need to call normalizeEncoding because we need the inferred types to correctly determine stack\n const encoding = normalizeEncoding(e, config);\n const markDef = isMarkDef(mark) ? mark : { type: mark };\n const pointOverlay = getPointOverlay(markDef, config[markDef.type], encoding);\n const lineOverlay = markDef.type === 'area' && getLineOverlay(markDef, config[markDef.type]);\n const layer = [\n Object.assign(Object.assign({}, (selection ? { selection } : {})), { mark: dropLineAndPoint(Object.assign(Object.assign({}, (markDef.type === 'area' && markDef.opacity === undefined && markDef.fillOpacity === undefined\n ? { opacity: 0.7 }\n : {})), markDef)), \n // drop shape from encoding as this might be used to trigger point overlay\n encoding: omit(encoding, ['shape']) })\n ];\n // FIXME: determine rules for applying selections.\n // Need to copy stack config to overlayed layer\n const stackProps = stack(markDef, encoding);\n let overlayEncoding = encoding;\n if (stackProps) {\n const { fieldChannel: stackFieldChannel, offset } = stackProps;\n overlayEncoding = Object.assign(Object.assign({}, encoding), { [stackFieldChannel]: Object.assign(Object.assign({}, encoding[stackFieldChannel]), (offset ? { stack: offset } : {})) });\n }\n if (lineOverlay) {\n layer.push(Object.assign(Object.assign({}, (projection ? { projection } : {})), { mark: Object.assign(Object.assign({ type: 'line' }, pick(markDef, ['clip', 'interpolate', 'tension', 'tooltip'])), lineOverlay), encoding: overlayEncoding }));\n }\n if (pointOverlay) {\n layer.push(Object.assign(Object.assign({}, (projection ? { projection } : {})), { mark: Object.assign(Object.assign({ type: 'point', opacity: 1, filled: true }, pick(markDef, ['clip', 'tooltip'])), pointOverlay), encoding: overlayEncoding }));\n }\n return normalize(Object.assign(Object.assign({}, outerSpec), { layer }), Object.assign(Object.assign({}, params), { config: dropLineAndPointFromConfig(config) }));\n }\n}\n//# sourceMappingURL=pathoverlay.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { getSizeChannel, POSITION_SCALE_CHANNELS } from '../channel';\nimport { isFieldOrDatumDef } from '../channeldef';\nimport * as log from '../log';\nimport { isUnitSpec } from '../spec/unit';\nimport { isEmpty } from '../util';\nexport class RangeStepNormalizer {\n constructor() {\n this.name = 'RangeStep';\n }\n hasMatchingType(spec) {\n var _a;\n if (isUnitSpec(spec) && spec.encoding) {\n for (const channel of POSITION_SCALE_CHANNELS) {\n const def = spec.encoding[channel];\n if (def && isFieldOrDatumDef(def)) {\n if ((_a = def === null || def === void 0 ? void 0 : def.scale) === null || _a === void 0 ? void 0 : _a['rangeStep']) {\n return true;\n }\n }\n }\n }\n return false;\n }\n run(spec) {\n var _a;\n const sizeMixins = {};\n let encoding = Object.assign({}, spec.encoding);\n for (const channel of POSITION_SCALE_CHANNELS) {\n const sizeType = getSizeChannel(channel);\n const def = encoding[channel];\n if (def && isFieldOrDatumDef(def)) {\n if ((_a = def === null || def === void 0 ? void 0 : def.scale) === null || _a === void 0 ? void 0 : _a['rangeStep']) {\n const { scale } = def, defWithoutScale = __rest(def, [\"scale\"]);\n const _b = scale, { rangeStep } = _b, scaleWithoutRangeStep = __rest(_b, [\"rangeStep\"]);\n sizeMixins[sizeType] = { step: scale['rangeStep'] };\n log.warn(log.message.RANGE_STEP_DEPRECATED);\n encoding = Object.assign(Object.assign({}, encoding), { [channel]: Object.assign(Object.assign({}, defWithoutScale), (isEmpty(scaleWithoutRangeStep) ? {} : { scale: scaleWithoutRangeStep })) });\n }\n }\n }\n return Object.assign(Object.assign(Object.assign({}, sizeMixins), spec), { encoding });\n }\n}\n//# sourceMappingURL=rangestep.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { hasOwnProperty, isArray } from 'vega-util';\nimport { hasConditionalFieldOrDatumDef, isConditionalDef, isFieldDef, isFieldOrDatumDef, isRepeatRef, isSortableFieldDef } from '../channeldef';\nimport * as log from '../log';\nimport { isSortField } from '../sort';\nimport { isFacetMapping } from '../spec/facet';\nexport function replaceRepeaterInFacet(facet, repeater) {\n if (!repeater) {\n return facet;\n }\n if (isFacetMapping(facet)) {\n return replaceRepeaterInMapping(facet, repeater);\n }\n return replaceRepeaterInFieldDef(facet, repeater);\n}\nexport function replaceRepeaterInEncoding(encoding, repeater) {\n if (!repeater) {\n return encoding;\n }\n return replaceRepeaterInMapping(encoding, repeater);\n}\n/**\n * Replaces repeated value and returns if the repeated value is valid.\n */\nfunction replaceRepeatInProp(prop, o, repeater) {\n const val = o[prop];\n if (isRepeatRef(val)) {\n if (val.repeat in repeater) {\n return Object.assign(Object.assign({}, o), { [prop]: repeater[val.repeat] });\n }\n else {\n log.warn(log.message.noSuchRepeatedValue(val.repeat));\n return undefined;\n }\n }\n return o;\n}\n/**\n * Replace repeater values in a field def with the concrete field name.\n */\nfunction replaceRepeaterInFieldDef(fieldDef, repeater) {\n fieldDef = replaceRepeatInProp('field', fieldDef, repeater);\n if (fieldDef === undefined) {\n // the field def should be ignored\n return undefined;\n }\n else if (fieldDef === null) {\n return null;\n }\n if (isSortableFieldDef(fieldDef) && isSortField(fieldDef.sort)) {\n const sort = replaceRepeatInProp('field', fieldDef.sort, repeater);\n fieldDef = Object.assign(Object.assign({}, fieldDef), (sort ? { sort } : {}));\n }\n return fieldDef;\n}\nfunction replaceRepeaterInFieldOrDatumDef(def, repeater) {\n if (isFieldDef(def)) {\n return replaceRepeaterInFieldDef(def, repeater);\n }\n else {\n const datumDef = replaceRepeatInProp('datum', def, repeater);\n if (datumDef !== def && !datumDef.type) {\n datumDef.type = 'nominal';\n }\n return datumDef;\n }\n}\nfunction replaceRepeaterInChannelDef(channelDef, repeater) {\n if (isFieldOrDatumDef(channelDef)) {\n const fd = replaceRepeaterInFieldOrDatumDef(channelDef, repeater);\n if (fd) {\n return fd;\n }\n else if (isConditionalDef(channelDef)) {\n return { condition: channelDef.condition };\n }\n }\n else {\n if (hasConditionalFieldOrDatumDef(channelDef)) {\n const fd = replaceRepeaterInFieldOrDatumDef(channelDef.condition, repeater);\n if (fd) {\n return Object.assign(Object.assign({}, channelDef), { condition: fd });\n }\n else {\n const { condition } = channelDef, channelDefWithoutCondition = __rest(channelDef, [\"condition\"]);\n return channelDefWithoutCondition;\n }\n }\n return channelDef;\n }\n return undefined;\n}\nfunction replaceRepeaterInMapping(mapping, repeater) {\n const out = {};\n for (const channel in mapping) {\n if (hasOwnProperty(mapping, channel)) {\n const channelDef = mapping[channel];\n if (isArray(channelDef)) {\n // array cannot have condition\n out[channel] = channelDef // somehow we need to cast it here\n .map(cd => replaceRepeaterInChannelDef(cd, repeater))\n .filter(cd => cd);\n }\n else {\n const cd = replaceRepeaterInChannelDef(channelDef, repeater);\n if (cd !== undefined) {\n out[channel] = cd;\n }\n }\n }\n }\n return out;\n}\n//# sourceMappingURL=repeater.js.map","import { isBinned } from '../bin';\nimport { getMainRangeChannel, SECONDARY_RANGE_CHANNEL } from '../channel';\nimport { isDatumDef, isFieldDef } from '../channeldef';\nimport * as log from '../log';\nimport { isUnitSpec } from '../spec/unit';\nexport class RuleForRangedLineNormalizer {\n constructor() {\n this.name = 'RuleForRangedLine';\n }\n hasMatchingType(spec) {\n if (isUnitSpec(spec)) {\n const { encoding, mark } = spec;\n if (mark === 'line') {\n for (const channel of SECONDARY_RANGE_CHANNEL) {\n const mainChannel = getMainRangeChannel(channel);\n const mainChannelDef = encoding[mainChannel];\n if (encoding[channel]) {\n if ((isFieldDef(mainChannelDef) && !isBinned(mainChannelDef.bin)) || isDatumDef(mainChannelDef)) {\n return true;\n }\n }\n }\n }\n }\n return false;\n }\n run(spec, params, normalize) {\n const { encoding } = spec;\n log.warn(log.message.lineWithRange(!!encoding.x2, !!encoding.y2));\n return normalize(Object.assign(Object.assign({}, spec), { mark: 'rule' }), params);\n }\n}\n//# sourceMappingURL=ruleforrangedline.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray } from 'vega-util';\nimport { COLUMN, FACET, ROW } from '../channel';\nimport { hasConditionalFieldOrDatumDef, isFieldOrDatumDef, isValueDef } from '../channeldef';\nimport { boxPlotNormalizer } from '../compositemark/boxplot';\nimport { errorBandNormalizer } from '../compositemark/errorband';\nimport { errorBarNormalizer } from '../compositemark/errorbar';\nimport { channelHasField } from '../encoding';\nimport * as log from '../log';\nimport { isFacetMapping } from '../spec/facet';\nimport { SpecMapper } from '../spec/map';\nimport { isLayerRepeatSpec } from '../spec/repeat';\nimport { isUnitSpec } from '../spec/unit';\nimport { isEmpty, keys, omit, varName } from '../util';\nimport { isSignalRef } from '../vega.schema';\nimport { PathOverlayNormalizer } from './pathoverlay';\nimport { RangeStepNormalizer } from './rangestep';\nimport { replaceRepeaterInEncoding, replaceRepeaterInFacet } from './repeater';\nimport { RuleForRangedLineNormalizer } from './ruleforrangedline';\nexport class CoreNormalizer extends SpecMapper {\n constructor() {\n super(...arguments);\n this.nonFacetUnitNormalizers = [\n boxPlotNormalizer,\n errorBarNormalizer,\n errorBandNormalizer,\n new PathOverlayNormalizer(),\n new RuleForRangedLineNormalizer(),\n new RangeStepNormalizer()\n ];\n }\n map(spec, params) {\n // Special handling for a faceted unit spec as it can return a facet spec, not just a layer or unit spec like a normal unit spec.\n if (isUnitSpec(spec)) {\n const hasRow = channelHasField(spec.encoding, ROW);\n const hasColumn = channelHasField(spec.encoding, COLUMN);\n const hasFacet = channelHasField(spec.encoding, FACET);\n if (hasRow || hasColumn || hasFacet) {\n return this.mapFacetedUnit(spec, params);\n }\n }\n return super.map(spec, params);\n }\n // This is for normalizing non-facet unit\n mapUnit(spec, params) {\n const { parentEncoding, parentProjection } = params;\n const encoding = replaceRepeaterInEncoding(spec.encoding, params.repeater);\n const specWithReplacedEncoding = Object.assign(Object.assign({}, spec), (encoding ? { encoding } : {}));\n if (parentEncoding || parentProjection) {\n return this.mapUnitWithParentEncodingOrProjection(specWithReplacedEncoding, params);\n }\n const normalizeLayerOrUnit = this.mapLayerOrUnit.bind(this);\n for (const unitNormalizer of this.nonFacetUnitNormalizers) {\n if (unitNormalizer.hasMatchingType(specWithReplacedEncoding, params.config)) {\n return unitNormalizer.run(specWithReplacedEncoding, params, normalizeLayerOrUnit);\n }\n }\n return specWithReplacedEncoding;\n }\n mapRepeat(spec, params) {\n if (isLayerRepeatSpec(spec)) {\n return this.mapLayerRepeat(spec, params);\n }\n else {\n return this.mapNonLayerRepeat(spec, params);\n }\n }\n mapLayerRepeat(spec, params) {\n const { repeat, spec: childSpec } = spec, rest = __rest(spec, [\"repeat\", \"spec\"]);\n const { row, column, layer } = repeat;\n const { repeater = {}, repeaterPrefix = '' } = params;\n if (row || column) {\n return this.mapRepeat(Object.assign(Object.assign({}, spec), { repeat: Object.assign(Object.assign({}, (row ? { row } : {})), (column ? { column } : {})), spec: {\n repeat: { layer },\n spec: childSpec\n } }), params);\n }\n else {\n return Object.assign(Object.assign({}, rest), { layer: layer.map(layerValue => {\n const childRepeater = Object.assign(Object.assign({}, repeater), { layer: layerValue });\n const childName = (childSpec.name || '') + repeaterPrefix + `child__layer_${varName(layerValue)}`;\n const child = this.mapLayerOrUnit(childSpec, Object.assign(Object.assign({}, params), { repeater: childRepeater, repeaterPrefix: childName }));\n child.name = childName;\n return child;\n }) });\n }\n }\n mapNonLayerRepeat(spec, params) {\n var _a;\n const { repeat, spec: childSpec, data } = spec, remainingProperties = __rest(spec, [\"repeat\", \"spec\", \"data\"]);\n if (!isArray(repeat) && spec.columns) {\n // is repeat with row/column\n spec = omit(spec, ['columns']);\n log.warn(log.message.columnsNotSupportByRowCol('repeat'));\n }\n const concat = [];\n const { repeater = {}, repeaterPrefix = '' } = params;\n const row = (!isArray(repeat) && repeat.row) || [repeater ? repeater.row : null];\n const column = (!isArray(repeat) && repeat.column) || [repeater ? repeater.column : null];\n const repeatValues = (isArray(repeat) && repeat) || [repeater ? repeater.repeat : null];\n // cross product\n for (const repeatValue of repeatValues) {\n for (const rowValue of row) {\n for (const columnValue of column) {\n const childRepeater = {\n repeat: repeatValue,\n row: rowValue,\n column: columnValue,\n layer: repeater.layer\n };\n const childName = (childSpec.name || '') +\n repeaterPrefix +\n 'child__' +\n (isArray(repeat)\n ? `${varName(repeatValue)}`\n : (repeat.row ? `row_${varName(rowValue)}` : '') +\n (repeat.column ? `column_${varName(columnValue)}` : ''));\n const child = this.map(childSpec, Object.assign(Object.assign({}, params), { repeater: childRepeater, repeaterPrefix: childName }));\n child.name = childName;\n // we move data up\n concat.push(omit(child, ['data']));\n }\n }\n }\n const columns = isArray(repeat) ? spec.columns : repeat.column ? repeat.column.length : 1;\n return Object.assign(Object.assign({ data: (_a = childSpec.data) !== null && _a !== void 0 ? _a : data, align: 'all' }, remainingProperties), { columns,\n concat });\n }\n mapFacet(spec, params) {\n const { facet } = spec;\n if (isFacetMapping(facet) && spec.columns) {\n // is facet with row/column\n spec = omit(spec, ['columns']);\n log.warn(log.message.columnsNotSupportByRowCol('facet'));\n }\n return super.mapFacet(spec, params);\n }\n mapUnitWithParentEncodingOrProjection(spec, params) {\n const { encoding, projection } = spec;\n const { parentEncoding, parentProjection, config } = params;\n const mergedProjection = mergeProjection({ parentProjection, projection });\n const mergedEncoding = mergeEncoding({\n parentEncoding,\n encoding: replaceRepeaterInEncoding(encoding, params.repeater)\n });\n return this.mapUnit(Object.assign(Object.assign(Object.assign({}, spec), (mergedProjection ? { projection: mergedProjection } : {})), (mergedEncoding ? { encoding: mergedEncoding } : {})), { config });\n }\n mapFacetedUnit(spec, params) {\n // New encoding in the inside spec should not contain row / column\n // as row/column should be moved to facet\n const _a = spec.encoding, { row, column, facet } = _a, encoding = __rest(_a, [\"row\", \"column\", \"facet\"]);\n // Mark and encoding should be moved into the inner spec\n const { mark, width, projection, height, view, selection, encoding: _ } = spec, outerSpec = __rest(spec, [\"mark\", \"width\", \"projection\", \"height\", \"view\", \"selection\", \"encoding\"]);\n const { facetMapping, layout } = this.getFacetMappingAndLayout({ row, column, facet }, params);\n const newEncoding = replaceRepeaterInEncoding(encoding, params.repeater);\n return this.mapFacet(Object.assign(Object.assign(Object.assign({}, outerSpec), layout), { \n // row / column has higher precedence than facet\n facet: facetMapping, spec: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (width ? { width } : {})), (height ? { height } : {})), (view ? { view } : {})), (projection ? { projection } : {})), { mark, encoding: newEncoding }), (selection ? { selection } : {})) }), params);\n }\n getFacetMappingAndLayout(facets, params) {\n var _a;\n const { row, column, facet } = facets;\n if (row || column) {\n if (facet) {\n log.warn(log.message.facetChannelDropped([...(row ? [ROW] : []), ...(column ? [COLUMN] : [])]));\n }\n const facetMapping = {};\n const layout = {};\n for (const channel of [ROW, COLUMN]) {\n const def = facets[channel];\n if (def) {\n const { align, center, spacing, columns } = def, defWithoutLayout = __rest(def, [\"align\", \"center\", \"spacing\", \"columns\"]);\n facetMapping[channel] = defWithoutLayout;\n for (const prop of ['align', 'center', 'spacing']) {\n if (def[prop] !== undefined) {\n layout[prop] = (_a = layout[prop]) !== null && _a !== void 0 ? _a : {};\n layout[prop][channel] = def[prop];\n }\n }\n }\n }\n return { facetMapping, layout };\n }\n else {\n const { align, center, spacing, columns } = facet, facetMapping = __rest(facet, [\"align\", \"center\", \"spacing\", \"columns\"]);\n return {\n facetMapping: replaceRepeaterInFacet(facetMapping, params.repeater),\n layout: Object.assign(Object.assign(Object.assign(Object.assign({}, (align ? { align } : {})), (center ? { center } : {})), (spacing ? { spacing } : {})), (columns ? { columns } : {}))\n };\n }\n }\n mapLayer(spec, _a) {\n // Special handling for extended layer spec\n var { parentEncoding, parentProjection } = _a, otherParams = __rest(_a, [\"parentEncoding\", \"parentProjection\"]);\n const { encoding, projection } = spec, rest = __rest(spec, [\"encoding\", \"projection\"]);\n const params = Object.assign(Object.assign({}, otherParams), { parentEncoding: mergeEncoding({ parentEncoding, encoding, layer: true }), parentProjection: mergeProjection({ parentProjection, projection }) });\n return super.mapLayer(rest, params);\n }\n}\nfunction mergeEncoding({ parentEncoding, encoding = {}, layer }) {\n let merged = {};\n if (parentEncoding) {\n const channels = new Set([...keys(parentEncoding), ...keys(encoding)]);\n for (const channel of channels) {\n const channelDef = encoding[channel];\n const parentChannelDef = parentEncoding[channel];\n if (isFieldOrDatumDef(channelDef)) {\n // Field/Datum Def can inherit properties from its parent\n // Note that parentChannelDef doesn't have to be a field/datum def if the channelDef is already one.\n const mergedChannelDef = Object.assign(Object.assign({}, parentChannelDef), channelDef);\n merged[channel] = mergedChannelDef;\n }\n else if (hasConditionalFieldOrDatumDef(channelDef)) {\n merged[channel] = Object.assign(Object.assign({}, channelDef), { condition: Object.assign(Object.assign({}, parentChannelDef), channelDef.condition) });\n }\n else if (channelDef || channelDef === null) {\n merged[channel] = channelDef;\n }\n else if (layer ||\n isValueDef(parentChannelDef) ||\n isSignalRef(parentChannelDef) ||\n isFieldOrDatumDef(parentChannelDef) ||\n isArray(parentChannelDef)) {\n merged[channel] = parentChannelDef;\n }\n }\n }\n else {\n merged = encoding;\n }\n return !merged || isEmpty(merged) ? undefined : merged;\n}\nfunction mergeProjection(opt) {\n const { parentProjection, projection } = opt;\n if (parentProjection && projection) {\n log.warn(log.message.projectionOverridden({ parentProjection, projection }));\n }\n return projection !== null && projection !== void 0 ? projection : parentProjection;\n}\n//# sourceMappingURL=core.js.map","import { isString } from 'vega-util';\nimport { initConfig } from '../config';\nimport * as log from '../log';\nimport { isLayerSpec, isUnitSpec } from '../spec';\nimport { deepEqual } from '../util';\nimport { CoreNormalizer } from './core';\nexport function normalize(spec, config) {\n if (config === undefined) {\n config = initConfig(spec.config);\n }\n const normalizedSpec = normalizeGenericSpec(spec, config);\n const { width, height } = spec;\n const autosize = normalizeAutoSize(normalizedSpec, { width, height, autosize: spec.autosize }, config);\n return Object.assign(Object.assign({}, normalizedSpec), (autosize ? { autosize } : {}));\n}\nconst normalizer = new CoreNormalizer();\n/**\n * Decompose extended unit specs into composition of pure unit specs.\n */\nfunction normalizeGenericSpec(spec, config = {}) {\n return normalizer.map(spec, { config });\n}\nfunction _normalizeAutoSize(autosize) {\n return isString(autosize) ? { type: autosize } : autosize !== null && autosize !== void 0 ? autosize : {};\n}\n/**\n * Normalize autosize and deal with width or height == \"container\".\n */\nexport function normalizeAutoSize(spec, sizeInfo, config) {\n let { width, height } = sizeInfo;\n const isFitCompatible = isUnitSpec(spec) || isLayerSpec(spec);\n const autosizeDefault = {};\n if (!isFitCompatible) {\n // If spec is not compatible with autosize == \"fit\", discard width/height == container\n if (width == 'container') {\n log.warn(log.message.containerSizeNonSingle('width'));\n width = undefined;\n }\n if (height == 'container') {\n log.warn(log.message.containerSizeNonSingle('height'));\n height = undefined;\n }\n }\n else {\n // Default autosize parameters to fit when width/height is \"container\"\n if (width == 'container' && height == 'container') {\n autosizeDefault.type = 'fit';\n autosizeDefault.contains = 'padding';\n }\n else if (width == 'container') {\n autosizeDefault.type = 'fit-x';\n autosizeDefault.contains = 'padding';\n }\n else if (height == 'container') {\n autosizeDefault.type = 'fit-y';\n autosizeDefault.contains = 'padding';\n }\n }\n const autosize = Object.assign(Object.assign(Object.assign({ type: 'pad' }, autosizeDefault), (config ? _normalizeAutoSize(config.autosize) : {})), _normalizeAutoSize(spec.autosize));\n if (autosize.type === 'fit' && !isFitCompatible) {\n log.warn(log.message.FIT_NON_SINGLE);\n autosize.type = 'pad';\n }\n if (width == 'container' && !(autosize.type == 'fit' || autosize.type == 'fit-x')) {\n log.warn(log.message.containerSizeNotCompatibleWithAutosize('width'));\n }\n if (height == 'container' && !(autosize.type == 'fit' || autosize.type == 'fit-y')) {\n log.warn(log.message.containerSizeNotCompatibleWithAutosize('height'));\n }\n // Delete autosize property if it's Vega's default\n if (deepEqual(autosize, { type: 'pad' })) {\n return undefined;\n }\n return autosize;\n}\n//# sourceMappingURL=index.js.map","import { getPositionScaleChannel } from '../channel';\nimport { signalRefOrValue } from '../compile/common';\nexport function isFitType(autoSizeType) {\n return autoSizeType === 'fit' || autoSizeType === 'fit-x' || autoSizeType === 'fit-y';\n}\nexport function getFitType(sizeType) {\n return sizeType ? `fit-${getPositionScaleChannel(sizeType)}` : 'fit';\n}\nconst TOP_LEVEL_PROPERTIES = [\n 'background',\n 'padding'\n // We do not include \"autosize\" here as it is supported by only unit and layer specs and thus need to be normalized\n];\nexport function extractTopLevelProperties(t, includeParams) {\n const o = {};\n for (const p of TOP_LEVEL_PROPERTIES) {\n if (t && t[p] !== undefined) {\n o[p] = signalRefOrValue(t[p]);\n }\n }\n if (includeParams) {\n o.params = t.params;\n }\n return o;\n}\n//# sourceMappingURL=toplevel.js.map","import * as log from '../log';\nimport { deepEqual, duplicate, getFirstDefined, keys } from '../util';\n/**\n * Generic class for storing properties that are explicitly specified\n * and implicitly determined by the compiler.\n * This is important for scale/axis/legend merging as\n * we want to prioritize properties that users explicitly specified.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport class Split {\n constructor(explicit = {}, implicit = {}) {\n this.explicit = explicit;\n this.implicit = implicit;\n }\n clone() {\n return new Split(duplicate(this.explicit), duplicate(this.implicit));\n }\n combine() {\n // FIXME remove \"as any\".\n // Add \"as any\" to avoid an error \"Spread types may only be created from object types\".\n return Object.assign(Object.assign({}, this.explicit), this.implicit);\n }\n get(key) {\n // Explicit has higher precedence\n return getFirstDefined(this.explicit[key], this.implicit[key]);\n }\n getWithExplicit(key) {\n // Explicit has higher precedence\n if (this.explicit[key] !== undefined) {\n return { explicit: true, value: this.explicit[key] };\n }\n else if (this.implicit[key] !== undefined) {\n return { explicit: false, value: this.implicit[key] };\n }\n return { explicit: false, value: undefined };\n }\n setWithExplicit(key, value) {\n if (value.value !== undefined) {\n this.set(key, value.value, value.explicit);\n }\n }\n set(key, value, explicit) {\n delete this[explicit ? 'implicit' : 'explicit'][key];\n this[explicit ? 'explicit' : 'implicit'][key] = value;\n return this;\n }\n copyKeyFromSplit(key, s) {\n // Explicit has higher precedence\n if (s.explicit[key] !== undefined) {\n this.set(key, s.explicit[key], true);\n }\n else if (s.implicit[key] !== undefined) {\n this.set(key, s.implicit[key], false);\n }\n }\n copyKeyFromObject(key, s) {\n // Explicit has higher precedence\n if (s[key] !== undefined) {\n this.set(key, s[key], true);\n }\n }\n /**\n * Merge split object into this split object. Properties from the other split\n * overwrite properties from this split.\n */\n copyAll(other) {\n for (const key of keys(other.combine())) {\n const val = other.getWithExplicit(key);\n this.setWithExplicit(key, val);\n }\n }\n}\nexport function makeExplicit(value) {\n return {\n explicit: true,\n value\n };\n}\nexport function makeImplicit(value) {\n return {\n explicit: false,\n value\n };\n}\nexport function tieBreakByComparing(compare) {\n return (v1, v2, property, propertyOf) => {\n const diff = compare(v1.value, v2.value);\n if (diff > 0) {\n return v1;\n }\n else if (diff < 0) {\n return v2;\n }\n return defaultTieBreaker(v1, v2, property, propertyOf);\n };\n}\nexport function defaultTieBreaker(v1, v2, property, propertyOf) {\n if (v1.explicit && v2.explicit) {\n log.warn(log.message.mergeConflictingProperty(property, propertyOf, v1.value, v2.value));\n }\n // If equal score, prefer v1.\n return v1;\n}\nexport function mergeValuesWithExplicit(v1, v2, property, propertyOf, tieBreaker = defaultTieBreaker) {\n if (v1 === undefined || v1.value === undefined) {\n // For first run\n return v2;\n }\n if (v1.explicit && !v2.explicit) {\n return v1;\n }\n else if (v2.explicit && !v1.explicit) {\n return v2;\n }\n else if (deepEqual(v1.value, v2.value)) {\n return v1;\n }\n else {\n return tieBreaker(v1, v2, property, propertyOf);\n }\n}\n//# sourceMappingURL=split.js.map","import { Split } from '../split';\n/**\n * Class to track interesting properties (see https://15721.courses.cs.cmu.edu/spring2016/papers/graefe-ieee1995.pdf)\n * about how fields have been parsed or whether they have been derived in a transform. We use this to not parse the\n * same field again (or differently).\n */\nexport class AncestorParse extends Split {\n constructor(explicit = {}, implicit = {}, parseNothing = false) {\n super(explicit, implicit);\n this.explicit = explicit;\n this.implicit = implicit;\n this.parseNothing = parseNothing;\n }\n clone() {\n const clone = super.clone();\n clone.parseNothing = this.parseNothing;\n return clone;\n }\n}\n//# sourceMappingURL=index.js.map","export function isUrlData(data) {\n return 'url' in data;\n}\nexport function isInlineData(data) {\n return 'values' in data;\n}\nexport function isNamedData(data) {\n return 'name' in data && !isUrlData(data) && !isInlineData(data) && !isGenerator(data);\n}\nexport function isGenerator(data) {\n return data && (isSequenceGenerator(data) || isSphereGenerator(data) || isGraticuleGenerator(data));\n}\nexport function isSequenceGenerator(data) {\n return 'sequence' in data;\n}\nexport function isSphereGenerator(data) {\n return 'sphere' in data;\n}\nexport function isGraticuleGenerator(data) {\n return 'graticule' in data;\n}\nexport var DataSourceType;\n(function (DataSourceType) {\n DataSourceType[DataSourceType[\"Raw\"] = 0] = \"Raw\";\n DataSourceType[DataSourceType[\"Main\"] = 1] = \"Main\";\n DataSourceType[DataSourceType[\"Row\"] = 2] = \"Row\";\n DataSourceType[DataSourceType[\"Column\"] = 3] = \"Column\";\n DataSourceType[DataSourceType[\"Lookup\"] = 4] = \"Lookup\";\n})(DataSourceType || (DataSourceType = {}));\n//# sourceMappingURL=data.js.map","import { normalizeLogicalComposition } from './logical';\nimport { normalizePredicate } from './predicate';\nexport function isFilter(t) {\n return 'filter' in t;\n}\nexport function isImputeSequence(t) {\n return (t === null || t === void 0 ? void 0 : t['stop']) !== undefined;\n}\nexport function isLookup(t) {\n return 'lookup' in t;\n}\nexport function isLookupData(from) {\n return 'data' in from;\n}\nexport function isLookupSelection(from) {\n return 'selection' in from;\n}\nexport function isPivot(t) {\n return 'pivot' in t;\n}\nexport function isDensity(t) {\n return 'density' in t;\n}\nexport function isQuantile(t) {\n return 'quantile' in t;\n}\nexport function isRegression(t) {\n return 'regression' in t;\n}\nexport function isLoess(t) {\n return 'loess' in t;\n}\nexport function isSample(t) {\n return 'sample' in t;\n}\nexport function isWindow(t) {\n return 'window' in t;\n}\nexport function isJoinAggregate(t) {\n return 'joinaggregate' in t;\n}\nexport function isFlatten(t) {\n return 'flatten' in t;\n}\nexport function isCalculate(t) {\n return 'calculate' in t;\n}\nexport function isBin(t) {\n return 'bin' in t;\n}\nexport function isImpute(t) {\n return 'impute' in t;\n}\nexport function isTimeUnit(t) {\n return 'timeUnit' in t;\n}\nexport function isAggregate(t) {\n return 'aggregate' in t;\n}\nexport function isStack(t) {\n return 'stack' in t;\n}\nexport function isFold(t) {\n return 'fold' in t;\n}\nexport function normalizeTransform(transform) {\n return transform.map(t => {\n if (isFilter(t)) {\n return {\n filter: normalizeLogicalComposition(t.filter, normalizePredicate)\n };\n }\n return t;\n });\n}\n//# sourceMappingURL=transform.js.map","const VIEW = 'view',\n LBRACK = '[',\n RBRACK = ']',\n LBRACE = '{',\n RBRACE = '}',\n COLON = ':',\n COMMA = ',',\n NAME = '@',\n GT = '>',\n ILLEGAL = /[[\\]{}]/,\n DEFAULT_MARKS = {\n '*': 1,\n arc: 1,\n area: 1,\n group: 1,\n image: 1,\n line: 1,\n path: 1,\n rect: 1,\n rule: 1,\n shape: 1,\n symbol: 1,\n text: 1,\n trail: 1\n};\nlet DEFAULT_SOURCE, MARKS;\n/**\n * Parse an event selector string.\n * Returns an array of event stream definitions.\n */\n\nfunction eventSelector (selector, source, marks) {\n DEFAULT_SOURCE = source || VIEW;\n MARKS = marks || DEFAULT_MARKS;\n return parseMerge(selector.trim()).map(parseSelector);\n}\n\nfunction isMarkType(type) {\n return MARKS[type];\n}\n\nfunction find(s, i, endChar, pushChar, popChar) {\n const n = s.length;\n let count = 0,\n c;\n\n for (; i < n; ++i) {\n c = s[i];\n if (!count && c === endChar) return i;else if (popChar && popChar.indexOf(c) >= 0) --count;else if (pushChar && pushChar.indexOf(c) >= 0) ++count;\n }\n\n return i;\n}\n\nfunction parseMerge(s) {\n const output = [],\n n = s.length;\n let start = 0,\n i = 0;\n\n while (i < n) {\n i = find(s, i, COMMA, LBRACK + LBRACE, RBRACK + RBRACE);\n output.push(s.substring(start, i).trim());\n start = ++i;\n }\n\n if (output.length === 0) {\n throw 'Empty event selector: ' + s;\n }\n\n return output;\n}\n\nfunction parseSelector(s) {\n return s[0] === '[' ? parseBetween(s) : parseStream(s);\n}\n\nfunction parseBetween(s) {\n const n = s.length;\n let i = 1,\n b;\n i = find(s, i, RBRACK, LBRACK, RBRACK);\n\n if (i === n) {\n throw 'Empty between selector: ' + s;\n }\n\n b = parseMerge(s.substring(1, i));\n\n if (b.length !== 2) {\n throw 'Between selector must have two elements: ' + s;\n }\n\n s = s.slice(i + 1).trim();\n\n if (s[0] !== GT) {\n throw 'Expected \\'>\\' after between selector: ' + s;\n }\n\n b = b.map(parseSelector);\n const stream = parseSelector(s.slice(1).trim());\n\n if (stream.between) {\n return {\n between: b,\n stream: stream\n };\n } else {\n stream.between = b;\n }\n\n return stream;\n}\n\nfunction parseStream(s) {\n const stream = {\n source: DEFAULT_SOURCE\n },\n source = [];\n let throttle = [0, 0],\n markname = 0,\n start = 0,\n n = s.length,\n i = 0,\n j,\n filter; // extract throttle from end\n\n if (s[n - 1] === RBRACE) {\n i = s.lastIndexOf(LBRACE);\n\n if (i >= 0) {\n try {\n throttle = parseThrottle(s.substring(i + 1, n - 1));\n } catch (e) {\n throw 'Invalid throttle specification: ' + s;\n }\n\n s = s.slice(0, i).trim();\n n = s.length;\n } else throw 'Unmatched right brace: ' + s;\n\n i = 0;\n }\n\n if (!n) throw s; // set name flag based on first char\n\n if (s[0] === NAME) markname = ++i; // extract first part of multi-part stream selector\n\n j = find(s, i, COLON);\n\n if (j < n) {\n source.push(s.substring(start, j).trim());\n start = i = ++j;\n } // extract remaining part of stream selector\n\n\n i = find(s, i, LBRACK);\n\n if (i === n) {\n source.push(s.substring(start, n).trim());\n } else {\n source.push(s.substring(start, i).trim());\n filter = [];\n start = ++i;\n if (start === n) throw 'Unmatched left bracket: ' + s;\n } // extract filters\n\n\n while (i < n) {\n i = find(s, i, RBRACK);\n if (i === n) throw 'Unmatched left bracket: ' + s;\n filter.push(s.substring(start, i).trim());\n if (i < n - 1 && s[++i] !== LBRACK) throw 'Expected left bracket: ' + s;\n start = ++i;\n } // marshall event stream specification\n\n\n if (!(n = source.length) || ILLEGAL.test(source[n - 1])) {\n throw 'Invalid event selector: ' + s;\n }\n\n if (n > 1) {\n stream.type = source[1];\n\n if (markname) {\n stream.markname = source[0].slice(1);\n } else if (isMarkType(source[0])) {\n stream.marktype = source[0];\n } else {\n stream.source = source[0];\n }\n } else {\n stream.type = source[0];\n }\n\n if (stream.type.slice(-1) === '!') {\n stream.consume = true;\n stream.type = stream.type.slice(0, -1);\n }\n\n if (filter != null) stream.filter = filter;\n if (throttle[0]) stream.throttle = throttle[0];\n if (throttle[1]) stream.debounce = throttle[1];\n return stream;\n}\n\nfunction parseThrottle(s) {\n const a = s.split(COMMA);\n if (!s.length || a.length > 2) throw s;\n return a.map(_ => {\n const x = +_;\n if (x !== x) throw s;\n return x;\n });\n}\n\nexport { eventSelector as selector };\n","import { array } from 'vega-util';\nimport { isConditionalDef, isConditionalSelection } from '../../../channeldef';\nimport { expression } from '../../predicate';\nimport { parseSelectionPredicate } from '../../selection/parse';\n/**\n * Return a mixin that includes a Vega production rule for a Vega-Lite conditional channel definition\n * or a simple mixin if channel def has no condition.\n */\nexport function wrapCondition(model, channelDef, vgChannel, refFn) {\n const condition = isConditionalDef(channelDef) && channelDef.condition;\n const valueRef = refFn(channelDef);\n if (condition) {\n const conditions = array(condition);\n const vgConditions = conditions.map(c => {\n const conditionValueRef = refFn(c);\n const test = isConditionalSelection(c)\n ? parseSelectionPredicate(model, c.selection) // FIXME: remove casting once TS is no longer dumb about it\n : expression(model, c.test); // FIXME: remove casting once TS is no longer dumb about it\n return Object.assign({ test }, conditionValueRef);\n });\n return {\n [vgChannel]: [...vgConditions, ...(valueRef !== undefined ? [valueRef] : [])]\n };\n }\n else {\n return valueRef !== undefined ? { [vgChannel]: valueRef } : {};\n }\n}\n//# sourceMappingURL=conditional.js.map","import { getFormatMixins, isFieldOrDatumDef, isValueDef } from '../../../channeldef';\nimport { signalOrValueRef } from '../../common';\nimport { formatSignalRef } from '../../format';\nimport { wrapCondition } from './conditional';\nexport function text(model, channel = 'text') {\n const channelDef = model.encoding[channel];\n return wrapCondition(model, channelDef, channel, cDef => textRef(cDef, model.config));\n}\nexport function textRef(channelDef, config, expr = 'datum') {\n // text\n if (channelDef) {\n if (isValueDef(channelDef)) {\n return signalOrValueRef(channelDef.value);\n }\n if (isFieldOrDatumDef(channelDef)) {\n const { format, formatType } = getFormatMixins(channelDef);\n return formatSignalRef({ fieldOrDatumDef: channelDef, format, formatType, expr, config });\n }\n }\n return undefined;\n}\n//# sourceMappingURL=text.js.map","import { array, isArray, isObject, isString } from 'vega-util';\nimport { isBinned } from '../../../bin';\nimport { getMainRangeChannel, isXorY } from '../../../channel';\nimport { defaultTitle, getFieldDef, getFormatMixins, hasConditionalFieldDef, isFieldDef, isTypedFieldDef, vgField } from '../../../channeldef';\nimport { forEach } from '../../../encoding';\nimport { entries } from '../../../util';\nimport { isSignalRef } from '../../../vega.schema';\nimport { getMarkPropOrConfig } from '../../common';\nimport { binFormatExpression, formatSignalRef } from '../../format';\nimport { wrapCondition } from './conditional';\nimport { textRef } from './text';\nexport function tooltip(model, opt = {}) {\n const { encoding, markDef, config, stack } = model;\n const channelDef = encoding.tooltip;\n if (isArray(channelDef)) {\n return { tooltip: tooltipRefForEncoding({ tooltip: channelDef }, stack, config, opt) };\n }\n else {\n const datum = opt.reactiveGeom ? 'datum.datum' : 'datum';\n return wrapCondition(model, channelDef, 'tooltip', cDef => {\n // use valueRef based on channelDef first\n const tooltipRefFromChannelDef = textRef(cDef, config, datum);\n if (tooltipRefFromChannelDef) {\n return tooltipRefFromChannelDef;\n }\n if (cDef === null) {\n // Allow using encoding.tooltip = null to disable tooltip\n return undefined;\n }\n let markTooltip = getMarkPropOrConfig('tooltip', markDef, config);\n if (markTooltip === true) {\n markTooltip = { content: 'encoding' };\n }\n if (isString(markTooltip)) {\n return { value: markTooltip };\n }\n else if (isObject(markTooltip)) {\n // `tooltip` is `{fields: 'encodings' | 'fields'}`\n if (isSignalRef(markTooltip)) {\n return markTooltip;\n }\n else if (markTooltip.content === 'encoding') {\n return tooltipRefForEncoding(encoding, stack, config, opt);\n }\n else {\n return { signal: datum };\n }\n }\n return undefined;\n });\n }\n}\nexport function tooltipData(encoding, stack, config, { reactiveGeom } = {}) {\n const toSkip = {};\n const expr = reactiveGeom ? 'datum.datum' : 'datum';\n const tuples = [];\n function add(fDef, channel) {\n const mainChannel = getMainRangeChannel(channel);\n const fieldDef = isTypedFieldDef(fDef)\n ? fDef\n : Object.assign(Object.assign({}, fDef), { type: encoding[mainChannel].type // for secondary field def, copy type from main channel\n });\n const title = fieldDef.title || defaultTitle(fieldDef, config);\n const key = array(title).join(', ');\n let value;\n if (isXorY(channel)) {\n const channel2 = channel === 'x' ? 'x2' : 'y2';\n const fieldDef2 = getFieldDef(encoding[channel2]);\n if (isBinned(fieldDef.bin) && fieldDef2) {\n const startField = vgField(fieldDef, { expr });\n const endField = vgField(fieldDef2, { expr });\n const { format, formatType } = getFormatMixins(fieldDef);\n value = binFormatExpression(startField, endField, format, formatType, config);\n toSkip[channel2] = true;\n }\n else if (stack && stack.fieldChannel === channel && stack.offset === 'normalize') {\n const { format, formatType } = getFormatMixins(fieldDef);\n value = formatSignalRef({ fieldOrDatumDef: fieldDef, format, formatType, expr, config, normalizeStack: true })\n .signal;\n }\n }\n value = value !== null && value !== void 0 ? value : textRef(fieldDef, config, expr).signal;\n tuples.push({ channel, key, value });\n }\n forEach(encoding, (channelDef, channel) => {\n if (isFieldDef(channelDef)) {\n add(channelDef, channel);\n }\n else if (hasConditionalFieldDef(channelDef)) {\n add(channelDef.condition, channel);\n }\n });\n const out = {};\n for (const { channel, key, value } of tuples) {\n if (!toSkip[channel] && !out[key]) {\n out[key] = value;\n }\n }\n return out;\n}\nexport function tooltipRefForEncoding(encoding, stack, config, { reactiveGeom } = {}) {\n const data = tooltipData(encoding, stack, config, { reactiveGeom });\n const keyValues = entries(data).map(([key, value]) => `\"${key}\": ${value}`);\n return keyValues.length > 0 ? { signal: `{${keyValues.join(', ')}}` } : undefined;\n}\n//# sourceMappingURL=tooltip.js.map","import { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { wrapCondition } from './conditional';\nimport * as ref from './valueref';\n/**\n * Return encode for non-positional channels with scales. (Text doesn't have scale.)\n */\nexport function nonPosition(channel, model, opt = {}) {\n const { markDef, encoding, config } = model;\n const { vgChannel } = opt;\n let { defaultRef, defaultValue } = opt;\n if (defaultRef === undefined) {\n // prettier-ignore\n defaultValue = defaultValue !== null && defaultValue !== void 0 ? defaultValue : getMarkPropOrConfig(channel, markDef, config, { vgChannel, ignoreVgConfig: true });\n if (defaultValue !== undefined) {\n defaultRef = signalOrValueRef(defaultValue);\n }\n }\n const channelDef = encoding[channel];\n return wrapCondition(model, channelDef, vgChannel !== null && vgChannel !== void 0 ? vgChannel : channel, cDef => {\n return ref.midPoint({\n channel,\n channelDef: cDef,\n markDef,\n config,\n scaleName: model.scaleName(channel),\n scale: model.getScaleComponent(channel),\n stack: null,\n defaultRef\n });\n });\n}\n//# sourceMappingURL=nonposition.js.map","import * as log from '../../../log';\nimport { contains } from '../../../util';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { nonPosition } from './nonposition';\nexport function color(model, opt = { filled: undefined }) {\n var _a, _b, _c, _d;\n const { markDef, encoding, config } = model;\n const { type: markType } = markDef;\n // Allow filled to be overridden (for trail's \"filled\")\n const filled = (_a = opt.filled) !== null && _a !== void 0 ? _a : getMarkPropOrConfig('filled', markDef, config);\n const transparentIfNeeded = contains(['bar', 'point', 'circle', 'square', 'geoshape'], markType)\n ? 'transparent'\n : undefined;\n const defaultFill = (_c = (_b = getMarkPropOrConfig(filled === true ? 'color' : undefined, markDef, config, { vgChannel: 'fill' })) !== null && _b !== void 0 ? _b : \n // need to add this manually as getMarkConfig normally drops config.mark[channel] if vgChannel is specified\n config.mark[filled === true && 'color']) !== null && _c !== void 0 ? _c : \n // If there is no fill, always fill symbols, bar, geoshape\n // with transparent fills https://github.com/vega/vega-lite/issues/1316\n transparentIfNeeded;\n const defaultStroke = (_d = getMarkPropOrConfig(filled === false ? 'color' : undefined, markDef, config, { vgChannel: 'stroke' })) !== null && _d !== void 0 ? _d : \n // need to add this manually as getMarkConfig normally drops config.mark[channel] if vgChannel is specified\n config.mark[filled === false && 'color'];\n const colorVgChannel = filled ? 'fill' : 'stroke';\n const fillStrokeMarkDefAndConfig = Object.assign(Object.assign({}, (defaultFill ? { fill: signalOrValueRef(defaultFill) } : {})), (defaultStroke ? { stroke: signalOrValueRef(defaultStroke) } : {}));\n if (markDef.color && (filled ? markDef.fill : markDef.stroke)) {\n log.warn(log.message.droppingColor('property', { fill: 'fill' in markDef, stroke: 'stroke' in markDef }));\n }\n return Object.assign(Object.assign(Object.assign(Object.assign({}, fillStrokeMarkDefAndConfig), nonPosition('color', model, {\n vgChannel: colorVgChannel,\n defaultValue: filled ? defaultFill : defaultStroke\n })), nonPosition('fill', model, {\n // if there is encoding.fill, include default fill just in case we have conditional-only fill encoding\n defaultValue: encoding.fill ? defaultFill : undefined\n })), nonPosition('stroke', model, {\n // if there is encoding.stroke, include default fill just in case we have conditional-only stroke encoding\n defaultValue: encoding.stroke ? defaultStroke : undefined\n }));\n}\n//# sourceMappingURL=color.js.map","import { getOffsetChannel } from '../../../channel';\nexport function getOffset(channel, markDef) {\n const offsetChannel = getOffsetChannel(channel);\n // TODO: in the future read from encoding channel too\n const markDefOffsetValue = markDef[offsetChannel];\n if (markDefOffsetValue) {\n return markDefOffsetValue;\n }\n return undefined;\n}\n//# sourceMappingURL=offset.js.map","import { getMainRangeChannel, getSecondaryRangeChannel, getSizeChannel, getVgPositionChannel, isXorY } from '../../../channel';\nimport { getBand, isFieldDef, isFieldOrDatumDef } from '../../../channeldef';\nimport { ScaleType } from '../../../scale';\nimport { contains } from '../../../util';\nimport { getMarkPropOrConfig } from '../../common';\nimport { getOffset } from './offset';\nimport * as ref from './valueref';\n/**\n * Return encode for point (non-band) position channels.\n */\nexport function pointPosition(channel, model, { defaultPos, vgChannel, isMidPoint }) {\n const { encoding, markDef, config, stack } = model;\n const channelDef = encoding[channel];\n const channel2Def = encoding[getSecondaryRangeChannel(channel)];\n const scaleName = model.scaleName(channel);\n const scale = model.getScaleComponent(channel);\n const offset = getOffset(channel, markDef);\n // Get default position or position from mark def\n const defaultRef = pointPositionDefaultRef({\n model,\n defaultPos,\n channel,\n scaleName,\n scale\n });\n const valueRef = !channelDef && isXorY(channel) && (encoding.latitude || encoding.longitude)\n ? // use geopoint output if there are lat/long and there is no point position overriding lat/long.\n { field: model.getName(channel) }\n : positionRef({\n channel,\n channelDef,\n channel2Def,\n markDef,\n config,\n isMidPoint,\n scaleName,\n scale,\n stack,\n offset,\n defaultRef\n });\n return valueRef ? { [vgChannel || channel]: valueRef } : undefined;\n}\n// TODO: we need to find a way to refactor these so that scaleName is a part of scale\n// but that's complicated. For now, this is a huge step moving forward.\n/**\n * @return Vega ValueRef for normal x- or y-position without projection\n */\nexport function positionRef(params) {\n const { channel, channelDef, isMidPoint, scaleName, stack, offset, markDef, config } = params;\n // This isn't a part of midPoint because we use midPoint for non-position too\n if (isFieldOrDatumDef(channelDef) && stack && channel === stack.fieldChannel) {\n if (isFieldDef(channelDef)) {\n const band = getBand({\n channel,\n fieldDef: channelDef,\n isMidPoint,\n markDef,\n stack,\n config\n });\n if (band !== undefined) {\n return ref.interpolatedSignalRef({\n scaleName,\n fieldOrDatumDef: channelDef,\n startSuffix: 'start',\n band,\n offset\n });\n }\n }\n // x or y use stack_end so that stacked line's point mark use stack_end too.\n return ref.valueRefForFieldOrDatumDef(channelDef, scaleName, { suffix: 'end' }, { offset });\n }\n return ref.midPointRefWithPositionInvalidTest(params);\n}\nexport function pointPositionDefaultRef({ model, defaultPos, channel, scaleName, scale }) {\n const { markDef, config } = model;\n return () => {\n const mainChannel = getMainRangeChannel(channel);\n const vgChannel = getVgPositionChannel(channel);\n const definedValueOrConfig = getMarkPropOrConfig(channel, markDef, config, { vgChannel });\n if (definedValueOrConfig !== undefined) {\n return ref.widthHeightValueOrSignalRef(channel, definedValueOrConfig);\n }\n switch (defaultPos) {\n case 'zeroOrMin':\n case 'zeroOrMax':\n if (scaleName) {\n const scaleType = scale.get('type');\n if (contains([ScaleType.LOG, ScaleType.TIME, ScaleType.UTC], scaleType)) {\n // Log scales cannot have zero.\n // Zero in time scale is arbitrary, and does not affect ratio.\n // (Time is an interval level of measurement, not ratio).\n // See https://en.wikipedia.org/wiki/Level_of_measurement for more info.\n }\n else {\n if (scale.domainDefinitelyIncludesZero()) {\n return {\n scale: scaleName,\n value: 0\n };\n }\n }\n }\n if (defaultPos === 'zeroOrMin') {\n return mainChannel === 'y' ? { field: { group: 'height' } } : { value: 0 };\n }\n else {\n // zeroOrMax\n switch (mainChannel) {\n case 'radius':\n // max of radius is min(width, height) / 2\n return {\n signal: `min(${model.width.signal},${model.height.signal})/2`\n };\n case 'theta':\n return { signal: '2*PI' };\n case 'x':\n return { field: { group: 'width' } };\n case 'y':\n return { value: 0 };\n }\n }\n break;\n case 'mid': {\n const sizeRef = model[getSizeChannel(channel)];\n return Object.assign(Object.assign({}, sizeRef), { mult: 0.5 });\n }\n }\n // defaultPos === null\n return undefined;\n };\n}\n//# sourceMappingURL=position-point.js.map","import { getVgPositionChannel } from '../../../channel';\nimport * as log from '../../../log';\nimport { isSignalRef } from '../../../vega.schema';\nimport { getMarkPropOrConfig } from '../../common';\nconst ALIGNED_X_CHANNEL = {\n left: 'x',\n center: 'xc',\n right: 'x2'\n};\nconst BASELINED_Y_CHANNEL = {\n top: 'y',\n middle: 'yc',\n bottom: 'y2'\n};\nexport function vgAlignedPositionChannel(channel, markDef, config, defaultAlign = 'middle') {\n if (channel === 'radius' || channel === 'theta') {\n return getVgPositionChannel(channel);\n }\n const alignChannel = channel === 'x' ? 'align' : 'baseline';\n const align = getMarkPropOrConfig(alignChannel, markDef, config);\n let alignExcludingSignal;\n if (isSignalRef(align)) {\n log.warn(log.message.rangeMarkAlignmentCannotBeExpression(alignChannel));\n alignExcludingSignal = undefined;\n }\n else {\n alignExcludingSignal = align;\n }\n if (channel === 'x') {\n return ALIGNED_X_CHANNEL[alignExcludingSignal || (defaultAlign === 'top' ? 'left' : 'center')];\n }\n else {\n return BASELINED_Y_CHANNEL[alignExcludingSignal || defaultAlign];\n }\n}\n//# sourceMappingURL=position-align.js.map","import { getMainRangeChannel, getSecondaryRangeChannel, getSizeChannel, getVgPositionChannel } from '../../../channel';\nimport { isFieldOrDatumDef } from '../../../channeldef';\nimport { getMarkStyleConfig } from '../../common';\nimport { getOffset } from './offset';\nimport { vgAlignedPositionChannel } from './position-align';\nimport { pointPosition, pointPositionDefaultRef } from './position-point';\nimport * as ref from './valueref';\n/**\n * Utility for area/rule position, which can be either point or range. (One of the axes should be point and the other should be range.)\n */\nexport function pointOrRangePosition(channel, model, { defaultPos, defaultPos2, range }) {\n if (range) {\n return rangePosition(channel, model, { defaultPos, defaultPos2 });\n }\n return pointPosition(channel, model, { defaultPos });\n}\nexport function rangePosition(channel, model, { defaultPos, defaultPos2 }) {\n const { markDef, config } = model;\n const channel2 = getSecondaryRangeChannel(channel);\n const sizeChannel = getSizeChannel(channel);\n const pos2Mixins = pointPosition2OrSize(model, defaultPos2, channel2);\n const vgChannel = pos2Mixins[sizeChannel]\n ? // If there is width/height, we need to position the marks based on the alignment.\n vgAlignedPositionChannel(channel, markDef, config)\n : // Otherwise, make sure to apply to the right Vg Channel (for arc mark)\n getVgPositionChannel(channel);\n return Object.assign(Object.assign({}, pointPosition(channel, model, { defaultPos, vgChannel })), pos2Mixins);\n}\n/**\n * Return encode for x2, y2.\n * If channel is not specified, return one channel based on orientation.\n */\nfunction pointPosition2OrSize(model, defaultPos, channel) {\n const { encoding, mark, markDef, stack, config } = model;\n const baseChannel = getMainRangeChannel(channel);\n const sizeChannel = getSizeChannel(channel);\n const vgChannel = getVgPositionChannel(channel);\n const channelDef = encoding[baseChannel];\n const scaleName = model.scaleName(baseChannel);\n const scale = model.getScaleComponent(baseChannel);\n const offset = channel in encoding || channel in markDef\n ? getOffset(channel, model.markDef)\n : getOffset(baseChannel, model.markDef);\n if (!channelDef && (channel === 'x2' || channel === 'y2') && (encoding.latitude || encoding.longitude)) {\n // use geopoint output if there are lat2/long2 and there is no point position2 overriding lat2/long2.\n return { [vgChannel]: { field: model.getName(channel) } };\n }\n const valueRef = position2Ref({\n channel,\n channelDef,\n channel2Def: encoding[channel],\n markDef,\n config,\n scaleName,\n scale,\n stack,\n offset,\n defaultRef: undefined\n });\n if (valueRef !== undefined) {\n return { [vgChannel]: valueRef };\n }\n // TODO: check width/height encoding here once we add them\n // no x2/y2 encoding, then try to read x2/y2 or width/height based on precedence:\n // markDef > config.style > mark-specific config (config[mark]) > general mark config (config.mark)\n return (position2orSize(channel, markDef) ||\n position2orSize(channel, {\n [channel]: getMarkStyleConfig(channel, markDef, config.style),\n [sizeChannel]: getMarkStyleConfig(sizeChannel, markDef, config.style)\n }) ||\n position2orSize(channel, config[mark]) ||\n position2orSize(channel, config.mark) || {\n [vgChannel]: pointPositionDefaultRef({\n model,\n defaultPos,\n channel,\n scaleName,\n scale\n })()\n });\n}\nexport function position2Ref({ channel, channelDef, channel2Def, markDef, config, scaleName, scale, stack, offset, defaultRef }) {\n if (isFieldOrDatumDef(channelDef) &&\n stack &&\n // If fieldChannel is X and channel is X2 (or Y and Y2)\n channel.charAt(0) === stack.fieldChannel.charAt(0)) {\n return ref.valueRefForFieldOrDatumDef(channelDef, scaleName, { suffix: 'start' }, { offset });\n }\n return ref.midPointRefWithPositionInvalidTest({\n channel,\n channelDef: channel2Def,\n scaleName,\n scale,\n stack,\n markDef,\n config,\n offset,\n defaultRef\n });\n}\nfunction position2orSize(channel, markDef) {\n const sizeChannel = getSizeChannel(channel);\n const vgChannel = getVgPositionChannel(channel);\n if (markDef[vgChannel] !== undefined) {\n return { [vgChannel]: ref.widthHeightValueOrSignalRef(channel, markDef[vgChannel]) };\n }\n else if (markDef[channel] !== undefined) {\n return { [vgChannel]: ref.widthHeightValueOrSignalRef(channel, markDef[channel]) };\n }\n else if (markDef[sizeChannel]) {\n return { [sizeChannel]: ref.widthHeightValueOrSignalRef(channel, markDef[sizeChannel]) };\n }\n return undefined;\n}\n//# sourceMappingURL=position-range.js.map","import { isArray, isNumber } from 'vega-util';\nimport { isBinned, isBinning, isBinParams } from '../../../bin';\nimport { getSecondaryRangeChannel, getSizeChannel, getVgPositionChannel, isPolarPositionChannel, isXorY } from '../../../channel';\nimport { getBand, isFieldDef, isFieldOrDatumDef, vgField } from '../../../channeldef';\nimport { DEFAULT_STEP, getViewConfigDiscreteStep } from '../../../config';\nimport * as log from '../../../log';\nimport { hasDiscreteDomain, ScaleType } from '../../../scale';\nimport { getFirstDefined } from '../../../util';\nimport { isSignalRef, isVgRangeStep } from '../../../vega.schema';\nimport { getMarkPropOrConfig, signalOrStringValue } from '../../common';\nimport { nonPosition } from './nonposition';\nimport { getOffset } from './offset';\nimport { vgAlignedPositionChannel } from './position-align';\nimport { pointPositionDefaultRef } from './position-point';\nimport { rangePosition } from './position-range';\nimport * as ref from './valueref';\nexport function rectPosition(model, channel, mark) {\n var _a, _b, _c, _d;\n const { config, encoding, markDef, stack } = model;\n const channel2 = getSecondaryRangeChannel(channel);\n const sizeChannel = getSizeChannel(channel);\n const channelDef = encoding[channel];\n const channelDef2 = encoding[channel2];\n const scale = model.getScaleComponent(channel);\n const scaleType = scale ? scale.get('type') : undefined;\n const scaleName = model.scaleName(channel);\n const orient = markDef.orient;\n const hasSizeDef = (_b = (_a = encoding[sizeChannel]) !== null && _a !== void 0 ? _a : encoding.size) !== null && _b !== void 0 ? _b : getMarkPropOrConfig('size', markDef, config, { vgChannel: sizeChannel });\n const isBarBand = mark === 'bar' && (channel === 'x' ? orient === 'vertical' : orient === 'horizontal');\n // x, x2, and width -- we must specify two of these in all conditions\n if (isFieldDef(channelDef) &&\n (isBinning(channelDef.bin) || isBinned(channelDef.bin) || (channelDef.timeUnit && !channelDef2)) &&\n !hasSizeDef &&\n !hasDiscreteDomain(scaleType)) {\n const band = getBand({ channel, fieldDef: channelDef, stack, markDef, config });\n const axis = (_c = model.component.axes[channel]) === null || _c === void 0 ? void 0 : _c[0];\n const axisTranslate = (_d = axis === null || axis === void 0 ? void 0 : axis.get('translate')) !== null && _d !== void 0 ? _d : 0.5; // vega default is 0.5\n return rectBinPosition({\n fieldDef: channelDef,\n fieldDef2: channelDef2,\n channel,\n markDef,\n scaleName,\n band,\n axisTranslate,\n spacing: isXorY(channel) ? getMarkPropOrConfig('binSpacing', markDef, config) : undefined,\n reverse: scale.get('reverse'),\n config\n });\n }\n else if (((isFieldOrDatumDef(channelDef) && hasDiscreteDomain(scaleType)) || isBarBand) && !channelDef2) {\n return positionAndSize(mark, channelDef, channel, model);\n }\n else {\n return rangePosition(channel, model, { defaultPos: 'zeroOrMax', defaultPos2: 'zeroOrMin' });\n }\n}\nfunction defaultSizeRef(mark, sizeChannel, scaleName, scale, config, band) {\n if (scale) {\n const scaleType = scale.get('type');\n if (scaleType === 'point' || scaleType === 'band') {\n if (config[mark].discreteBandSize !== undefined) {\n return { value: config[mark].discreteBandSize };\n }\n if (scaleType === ScaleType.POINT) {\n const scaleRange = scale.get('range');\n if (isVgRangeStep(scaleRange) && isNumber(scaleRange.step)) {\n return { value: scaleRange.step - 2 };\n }\n return { value: DEFAULT_STEP - 2 };\n }\n else {\n // BAND\n return { scale: scaleName, band };\n }\n }\n else {\n // continuous scale\n return { value: config[mark].continuousBandSize };\n }\n }\n // No Scale\n const step = getViewConfigDiscreteStep(config.view, sizeChannel);\n const value = getFirstDefined(\n // No scale is like discrete bar (with one item)\n config[mark].discreteBandSize, step - 2);\n return value !== undefined ? { value } : undefined;\n}\n/**\n * Output position encoding and its size encoding for continuous, point, and band scales.\n */\nfunction positionAndSize(mark, fieldDef, channel, model) {\n var _a;\n const { markDef, encoding, config, stack } = model;\n const orient = markDef.orient;\n const scaleName = model.scaleName(channel);\n const scale = model.getScaleComponent(channel);\n const vgSizeChannel = getSizeChannel(channel);\n const channel2 = getSecondaryRangeChannel(channel);\n // use \"size\" channel for bars, if there is orient and the channel matches the right orientation\n const useVlSizeChannel = (orient === 'horizontal' && channel === 'y') || (orient === 'vertical' && channel === 'x');\n const sizeFromMarkOrConfig = getMarkPropOrConfig(useVlSizeChannel ? 'size' : vgSizeChannel, markDef, config, {\n vgChannel: vgSizeChannel\n });\n // Use size encoding / mark property / config if it exists\n let sizeMixins;\n if (encoding.size || sizeFromMarkOrConfig !== undefined) {\n if (useVlSizeChannel) {\n sizeMixins = nonPosition('size', model, { vgChannel: vgSizeChannel, defaultValue: sizeFromMarkOrConfig });\n }\n else {\n log.warn(log.message.cannotApplySizeToNonOrientedMark(markDef.type));\n }\n }\n // Otherwise, apply default value\n const band = (_a = (isFieldOrDatumDef(fieldDef) ? getBand({ channel, fieldDef, markDef, stack, config }) : undefined)) !== null && _a !== void 0 ? _a : 1;\n sizeMixins = sizeMixins || { [vgSizeChannel]: defaultSizeRef(mark, vgSizeChannel, scaleName, scale, config, band) };\n /*\n Band scales with size value and all point scales, use xc/yc + band=0.5\n \n Otherwise (band scales that has size based on a band ref), use x/y with position band = (1 - size_band) / 2.\n In this case, size_band is the band specified in the x/y-encoding.\n By default band is 1, so `(1 - band) / 2` = 0.\n If band is 0.6, the the x/y position in such case should be `(1 - band) / 2` = 0.2\n */\n const center = (scale === null || scale === void 0 ? void 0 : scale.get('type')) !== 'band' || !('band' in sizeMixins[vgSizeChannel]);\n const vgChannel = vgAlignedPositionChannel(channel, markDef, config, center ? 'middle' : 'top');\n const offset = getOffset(channel, markDef);\n const posRef = ref.midPointRefWithPositionInvalidTest({\n channel,\n channelDef: fieldDef,\n markDef,\n config,\n scaleName,\n scale,\n stack,\n offset,\n defaultRef: pointPositionDefaultRef({ model, defaultPos: 'mid', channel, scaleName, scale }),\n band: center ? 0.5 : (1 - band) / 2\n });\n if (vgSizeChannel) {\n return Object.assign({ [vgChannel]: posRef }, sizeMixins);\n }\n else {\n // otherwise, we must simulate size by setting position2 = position + size\n // (for theta/radius since Vega doesn't have thetaWidth/radiusWidth)\n const vgChannel2 = getVgPositionChannel(channel2);\n const sizeRef = sizeMixins[vgSizeChannel];\n const sizeOffset = offset ? Object.assign(Object.assign({}, sizeRef), { offset }) : sizeRef;\n return {\n [vgChannel]: posRef,\n // posRef might be an array that wraps position invalid test\n [vgChannel2]: isArray(posRef)\n ? [posRef[0], Object.assign(Object.assign({}, posRef[1]), { offset: sizeOffset })]\n : Object.assign(Object.assign({}, posRef), { offset: sizeOffset })\n };\n }\n}\nfunction getBinSpacing(channel, spacing, reverse, translate, offset) {\n if (isPolarPositionChannel(channel)) {\n return 0;\n }\n const spacingOffset = channel === 'x' || channel === 'y2' ? -spacing / 2 : spacing / 2;\n if (isSignalRef(reverse) || isSignalRef(offset) || isSignalRef(translate)) {\n const reverseExpr = signalOrStringValue(reverse);\n const offsetExpr = signalOrStringValue(offset);\n const translateExpr = signalOrStringValue(translate);\n const t = translateExpr ? `${translateExpr} + ` : '';\n const r = reverseExpr ? `(${reverseExpr} ? -1 : 1) * ` : '';\n const o = offsetExpr ? `(${offsetExpr} + ${spacingOffset})` : spacingOffset;\n return {\n signal: t + r + o\n };\n }\n else {\n offset = offset || 0;\n return translate + (reverse ? -offset - spacingOffset : +offset + spacingOffset);\n }\n}\nexport function rectBinPosition({ fieldDef, fieldDef2, channel, band, scaleName, markDef, spacing = 0, axisTranslate, reverse, config }) {\n const channel2 = getSecondaryRangeChannel(channel);\n const vgChannel = getVgPositionChannel(channel);\n const vgChannel2 = getVgPositionChannel(channel2);\n const offset = getOffset(channel, markDef);\n if (isBinning(fieldDef.bin) || fieldDef.timeUnit) {\n return {\n [vgChannel2]: rectBinRef({\n channel,\n fieldDef,\n scaleName,\n markDef,\n band: (1 - band) / 2,\n offset: getBinSpacing(channel2, spacing, reverse, axisTranslate, offset),\n config\n }),\n [vgChannel]: rectBinRef({\n channel,\n fieldDef,\n scaleName,\n markDef,\n band: 1 - (1 - band) / 2,\n offset: getBinSpacing(channel, spacing, reverse, axisTranslate, offset),\n config\n })\n };\n }\n else if (isBinned(fieldDef.bin)) {\n const startRef = ref.valueRefForFieldOrDatumDef(fieldDef, scaleName, {}, { offset: getBinSpacing(channel2, spacing, reverse, axisTranslate, offset) });\n if (isFieldDef(fieldDef2)) {\n return {\n [vgChannel2]: startRef,\n [vgChannel]: ref.valueRefForFieldOrDatumDef(fieldDef2, scaleName, {}, { offset: getBinSpacing(channel, spacing, reverse, axisTranslate, offset) })\n };\n }\n else if (isBinParams(fieldDef.bin) && fieldDef.bin.step) {\n return {\n [vgChannel2]: startRef,\n [vgChannel]: {\n signal: `scale(\"${scaleName}\", ${vgField(fieldDef, { expr: 'datum' })} + ${fieldDef.bin.step})`,\n offset: getBinSpacing(channel, spacing, reverse, axisTranslate, offset)\n }\n };\n }\n }\n log.warn(log.message.channelRequiredForBinned(channel2));\n return undefined;\n}\n/**\n * Value Ref for binned fields\n */\nexport function rectBinRef({ channel, fieldDef, scaleName, markDef, band, offset, config }) {\n const r = ref.interpolatedSignalRef({\n scaleName,\n fieldOrDatumDef: fieldDef,\n band,\n offset\n });\n return ref.wrapPositionInvalidTest({\n fieldDef,\n channel,\n markDef,\n ref: r,\n config\n });\n}\n//# sourceMappingURL=position-rect.js.map","import { array } from 'vega-util';\nimport { SCALE_CHANNELS } from '../../../channel';\nimport { isPathMark } from '../../../mark';\nimport { hasContinuousDomain } from '../../../scale';\nimport { keys } from '../../../util';\nimport { VG_MARK_CONFIGS } from '../../../vega.schema';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { aria } from './aria';\nimport { color } from './color';\nimport { nonPosition } from './nonposition';\nimport { text } from './text';\nimport { tooltip } from './tooltip';\nimport { fieldInvalidPredicate } from './valueref';\nimport { zindex } from './zindex';\nexport { color } from './color';\nexport { wrapCondition } from './conditional';\nexport { nonPosition } from './nonposition';\nexport { pointPosition } from './position-point';\nexport { pointOrRangePosition, rangePosition } from './position-range';\nexport { rectPosition } from './position-rect';\nexport { text } from './text';\nexport { tooltip } from './tooltip';\nconst ALWAYS_IGNORE = new Set(['aria']);\nexport function baseEncodeEntry(model, ignore) {\n const { fill = undefined, stroke = undefined } = ignore.color === 'include' ? color(model) : {};\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, markDefProperties(model.markDef, ignore)), wrapAllFieldsInvalid(model, 'fill', fill)), wrapAllFieldsInvalid(model, 'stroke', stroke)), nonPosition('opacity', model)), nonPosition('fillOpacity', model)), nonPosition('strokeOpacity', model)), nonPosition('strokeWidth', model)), nonPosition('strokeDash', model)), zindex(model)), tooltip(model)), text(model, 'href')), aria(model));\n}\n// TODO: mark VgValueRef[] as readonly after https://github.com/vega/vega/pull/1987\nfunction wrapAllFieldsInvalid(model, channel, valueRef) {\n const { config, mark, markDef } = model;\n const invalid = getMarkPropOrConfig('invalid', markDef, config);\n if (invalid === 'hide' && valueRef && !isPathMark(mark)) {\n // For non-path marks, we have to exclude invalid values (null and NaN) for scales with continuous domains.\n // For path marks, we will use \"defined\" property and skip these values instead.\n const test = allFieldsInvalidPredicate(model, { invalid: true, channels: SCALE_CHANNELS });\n if (test) {\n return {\n [channel]: [\n // prepend the invalid case\n // TODO: support custom value\n { test, value: null },\n ...array(valueRef)\n ]\n };\n }\n }\n return valueRef ? { [channel]: valueRef } : {};\n}\nfunction markDefProperties(mark, ignore) {\n return VG_MARK_CONFIGS.reduce((m, prop) => {\n if (!ALWAYS_IGNORE.has(prop) && mark[prop] !== undefined && ignore[prop] !== 'ignore') {\n m[prop] = signalOrValueRef(mark[prop]);\n }\n return m;\n }, {});\n}\nfunction allFieldsInvalidPredicate(model, { invalid = false, channels }) {\n const filterIndex = channels.reduce((aggregator, channel) => {\n const scaleComponent = model.getScaleComponent(channel);\n if (scaleComponent) {\n const scaleType = scaleComponent.get('type');\n const field = model.vgField(channel, { expr: 'datum' });\n // While discrete domain scales can handle invalid values, continuous scales can't.\n if (field && hasContinuousDomain(scaleType)) {\n aggregator[field] = true;\n }\n }\n return aggregator;\n }, {});\n const fields = keys(filterIndex);\n if (fields.length > 0) {\n const op = invalid ? '||' : '&&';\n return fields.map(field => fieldInvalidPredicate(field, invalid)).join(` ${op} `);\n }\n return undefined;\n}\n//# sourceMappingURL=base.js.map","import { isValueDef } from '../../../channeldef';\nimport { isPathMark } from '../../../mark';\nimport { signalOrValueRef } from '../../common';\nimport { wrapCondition } from './conditional';\nexport function zindex(model) {\n const { encoding, mark } = model;\n const order = encoding.order;\n if (!isPathMark(mark) && isValueDef(order)) {\n return wrapCondition(model, order, 'zindex', cd => signalOrValueRef(cd.value));\n }\n return {};\n}\n//# sourceMappingURL=zindex.js.map","import { entries, isEmpty } from '../../../util';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { VG_MARK_INDEX } from './../../../vega.schema';\nimport { wrapCondition } from './conditional';\nimport { textRef } from './text';\nimport { tooltipData } from './tooltip';\nexport function aria(model) {\n const { markDef, config } = model;\n const enableAria = getMarkPropOrConfig('aria', markDef, config);\n // We can ignore other aria properties if ariaHidden is true.\n if (enableAria === false) {\n // getMarkGroups sets aria to false already so we don't have to set it in the encode block\n return {};\n }\n return Object.assign(Object.assign(Object.assign({}, (enableAria ? { aria: enableAria } : {})), ariaRoleDescription(model)), description(model));\n}\nfunction ariaRoleDescription(model) {\n const { mark, markDef, config } = model;\n if (config.aria === false) {\n return {};\n }\n const ariaRoleDesc = getMarkPropOrConfig('ariaRoleDescription', markDef, config);\n if (ariaRoleDesc != null) {\n return { ariaRoleDescription: { value: ariaRoleDesc } };\n }\n return mark in VG_MARK_INDEX ? {} : { ariaRoleDescription: { value: mark } };\n}\nexport function description(model) {\n const { encoding, markDef, config, stack } = model;\n const channelDef = encoding.description;\n if (channelDef) {\n return wrapCondition(model, channelDef, 'description', cDef => textRef(cDef, model.config));\n }\n // Use default from mark def or config if defined.\n // Functions in encode usually just return undefined but since we are defining a default below, we need to check the default here.\n const descriptionValue = getMarkPropOrConfig('description', markDef, config);\n if (descriptionValue != null) {\n return {\n description: signalOrValueRef(descriptionValue)\n };\n }\n if (config.aria === false) {\n return {};\n }\n const data = tooltipData(encoding, stack, config);\n if (isEmpty(data)) {\n return undefined;\n }\n return {\n description: {\n signal: entries(data)\n .map(([key, value], index) => `\"${index > 0 ? '; ' : ''}${key}: \" + (${value})`)\n .join(' + ')\n }\n };\n}\n//# sourceMappingURL=aria.js.map","import { POSITION_SCALE_CHANNELS } from '../../../channel';\nimport { hasContinuousDomain } from '../../../scale';\nimport { keys } from '../../../util';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { fieldInvalidPredicate } from './valueref';\nexport function defined(model) {\n const { config, markDef } = model;\n const invalid = getMarkPropOrConfig('invalid', markDef, config);\n if (invalid) {\n const signal = allFieldsInvalidPredicate(model, { channels: POSITION_SCALE_CHANNELS });\n if (signal) {\n return { defined: { signal } };\n }\n }\n return {};\n}\nfunction allFieldsInvalidPredicate(model, { invalid = false, channels }) {\n const filterIndex = channels.reduce((aggregator, channel) => {\n const scaleComponent = model.getScaleComponent(channel);\n if (scaleComponent) {\n const scaleType = scaleComponent.get('type');\n const field = model.vgField(channel, { expr: 'datum' });\n // While discrete domain scales can handle invalid values, continuous scales can't.\n if (field && hasContinuousDomain(scaleType)) {\n aggregator[field] = true;\n }\n }\n return aggregator;\n }, {});\n const fields = keys(filterIndex);\n if (fields.length > 0) {\n const op = invalid ? '||' : '&&';\n return fields.map(field => fieldInvalidPredicate(field, invalid)).join(` ${op} `);\n }\n return undefined;\n}\nexport function valueIfDefined(prop, value) {\n if (value !== undefined) {\n return { [prop]: signalOrValueRef(value) };\n }\n return undefined;\n}\n//# sourceMappingURL=defined.js.map","import * as log from '../../../log';\nimport { isPathMark } from '../../../mark';\nimport { tooltip } from '../../mark/encode';\nconst VORONOI = 'voronoi';\nconst nearest = {\n has: selCmpt => {\n return selCmpt.type !== 'interval' && selCmpt.nearest;\n },\n parse: (model, selCmpt) => {\n // Scope selection events to the voronoi mark to prevent capturing\n // events that occur on the group mark (https://github.com/vega/vega/issues/2112).\n if (selCmpt.events) {\n for (const s of selCmpt.events) {\n s.markname = model.getName(VORONOI);\n }\n }\n },\n marks: (model, selCmpt, marks) => {\n const { x, y } = selCmpt.project.hasChannel;\n const markType = model.mark;\n if (isPathMark(markType)) {\n log.warn(log.message.nearestNotSupportForContinuous(markType));\n return marks;\n }\n const cellDef = {\n name: model.getName(VORONOI),\n type: 'path',\n interactive: true,\n from: { data: model.getName('marks') },\n encode: {\n update: Object.assign({ fill: { value: 'transparent' }, strokeWidth: { value: 0.35 }, stroke: { value: 'transparent' }, isVoronoi: { value: true } }, tooltip(model, { reactiveGeom: true }))\n },\n transform: [\n {\n type: 'voronoi',\n x: { expr: x || !y ? 'datum.datum.x || 0' : '0' },\n y: { expr: y || !x ? 'datum.datum.y || 0' : '0' },\n size: [model.getSizeSignalRef('width'), model.getSizeSignalRef('height')]\n }\n ]\n };\n let index = 0;\n let exists = false;\n marks.forEach((mark, i) => {\n var _a;\n const name = (_a = mark.name) !== null && _a !== void 0 ? _a : '';\n if (name === model.component.mark[0].name) {\n index = i;\n }\n else if (name.indexOf(VORONOI) >= 0) {\n exists = true;\n }\n });\n if (!exists) {\n marks.splice(index + 1, 0, cellDef);\n }\n return marks;\n }\n};\nexport default nearest;\n//# sourceMappingURL=nearest.js.map","import * as log from '../../log';\nimport { uniqueId } from '../../util';\n/**\n * A node in the dataflow tree.\n */\nexport class DataFlowNode {\n constructor(parent, debugName) {\n this.debugName = debugName;\n this._children = [];\n this._parent = null;\n if (parent) {\n this.parent = parent;\n }\n }\n /**\n * Clone this node with a deep copy but don't clone links to children or parents.\n */\n clone() {\n throw new Error('Cannot clone node');\n }\n get parent() {\n return this._parent;\n }\n /**\n * Set the parent of the node and also add this node to the parent's children.\n */\n set parent(parent) {\n this._parent = parent;\n if (parent) {\n parent.addChild(this);\n }\n }\n get children() {\n return this._children;\n }\n numChildren() {\n return this._children.length;\n }\n addChild(child, loc) {\n // do not add the same child twice\n if (this._children.indexOf(child) > -1) {\n log.warn(log.message.ADD_SAME_CHILD_TWICE);\n return;\n }\n if (loc !== undefined) {\n this._children.splice(loc, 0, child);\n }\n else {\n this._children.push(child);\n }\n }\n removeChild(oldChild) {\n const loc = this._children.indexOf(oldChild);\n this._children.splice(loc, 1);\n return loc;\n }\n /**\n * Remove node from the dataflow.\n */\n remove() {\n let loc = this._parent.removeChild(this);\n for (const child of this._children) {\n // do not use the set method because we want to insert at a particular location\n child._parent = this._parent;\n this._parent.addChild(child, loc++);\n }\n }\n /**\n * Insert another node as a parent of this node.\n */\n insertAsParentOf(other) {\n const parent = other.parent;\n parent.removeChild(this);\n this.parent = parent;\n other.parent = this;\n }\n swapWithParent() {\n const parent = this._parent;\n const newParent = parent.parent;\n // reconnect the children\n for (const child of this._children) {\n child.parent = parent;\n }\n // remove old links\n this._children = []; // equivalent to removing every child link one by one\n parent.removeChild(this);\n parent.parent.removeChild(parent);\n // swap two nodes\n this.parent = newParent;\n parent.parent = this;\n }\n}\nexport class OutputNode extends DataFlowNode {\n /**\n * @param source The name of the source. Will change in assemble.\n * @param type The type of the output node.\n * @param refCounts A global ref counter map.\n */\n constructor(parent, source, type, refCounts) {\n super(parent, source);\n this.type = type;\n this.refCounts = refCounts;\n this._source = this._name = source;\n if (this.refCounts && !(this._name in this.refCounts)) {\n this.refCounts[this._name] = 0;\n }\n }\n clone() {\n const cloneObj = new this.constructor();\n cloneObj.debugName = 'clone_' + this.debugName;\n cloneObj._source = this._source;\n cloneObj._name = 'clone_' + this._name;\n cloneObj.type = this.type;\n cloneObj.refCounts = this.refCounts;\n cloneObj.refCounts[cloneObj._name] = 0;\n return cloneObj;\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return new Set();\n }\n hash() {\n if (this._hash === undefined) {\n this._hash = `Output ${uniqueId()}`;\n }\n return this._hash;\n }\n /**\n * Request the datasource name and increase the ref counter.\n *\n * During the parsing phase, this will return the simple name such as 'main' or 'raw'.\n * It is crucial to request the name from an output node to mark it as a required node.\n * If nobody ever requests the name, this datasource will not be instantiated in the assemble phase.\n *\n * In the assemble phase, this will return the correct name.\n */\n getSource() {\n this.refCounts[this._name]++;\n return this._source;\n }\n isRequired() {\n return !!this.refCounts[this._name];\n }\n setSource(source) {\n this._source = source;\n }\n}\n//# sourceMappingURL=dataflow.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { getSecondaryRangeChannel } from '../../channel';\nimport { hasBand, vgField } from '../../channeldef';\nimport { getTimeUnitParts, normalizeTimeUnit } from '../../timeunit';\nimport { duplicate, hash, isEmpty, replacePathInField, vals, entries } from '../../util';\nimport { isUnitModel } from '../model';\nimport { DataFlowNode } from './dataflow';\nexport class TimeUnitNode extends DataFlowNode {\n constructor(parent, formula) {\n super(parent);\n this.formula = formula;\n }\n clone() {\n return new TimeUnitNode(null, duplicate(this.formula));\n }\n static makeFromEncoding(parent, model) {\n const formula = model.reduceFieldDef((timeUnitComponent, fieldDef, channel) => {\n const { field, timeUnit } = fieldDef;\n const channelDef2 = isUnitModel(model) ? model.encoding[getSecondaryRangeChannel(channel)] : undefined;\n const band = isUnitModel(model) && hasBand(channel, fieldDef, channelDef2, model.stack, model.markDef, model.config);\n if (timeUnit) {\n const as = vgField(fieldDef, { forAs: true });\n timeUnitComponent[hash({\n as,\n field,\n timeUnit\n })] = Object.assign({ as,\n field,\n timeUnit }, (band ? { band: true } : {}));\n }\n return timeUnitComponent;\n }, {});\n if (isEmpty(formula)) {\n return null;\n }\n return new TimeUnitNode(parent, formula);\n }\n static makeFromTransform(parent, t) {\n const _a = Object.assign({}, t), { timeUnit } = _a, other = __rest(_a, [\"timeUnit\"]);\n const normalizedTimeUnit = normalizeTimeUnit(timeUnit);\n const component = Object.assign(Object.assign({}, other), { timeUnit: normalizedTimeUnit });\n return new TimeUnitNode(parent, {\n [hash(component)]: component\n });\n }\n /**\n * Merge together TimeUnitNodes assigning the children of `other` to `this`\n * and removing `other`.\n */\n merge(other) {\n this.formula = Object.assign({}, this.formula);\n // if the same hash happen twice, merge \"band\"\n for (const key in other.formula) {\n if (!this.formula[key] || other.formula[key].band) {\n // copy if it's not a duplicate or if we need to copy band over\n this.formula[key] = other.formula[key];\n }\n }\n for (const child of other.children) {\n other.removeChild(child);\n child.parent = this;\n }\n other.remove();\n }\n /**\n * Remove time units coming from the other node.\n */\n removeFormulas(fields) {\n const newFormula = {};\n for (const [key, timeUnit] of entries(this.formula)) {\n if (!fields.has(timeUnit.as)) {\n newFormula[key] = timeUnit;\n }\n }\n this.formula = newFormula;\n }\n producedFields() {\n return new Set(vals(this.formula).map(f => f.as));\n }\n dependentFields() {\n return new Set(vals(this.formula).map(f => f.field));\n }\n hash() {\n return `TimeUnit ${hash(this.formula)}`;\n }\n assemble() {\n const transforms = [];\n for (const f of vals(this.formula)) {\n const { field, as, timeUnit } = f;\n const _a = normalizeTimeUnit(timeUnit), { unit, utc } = _a, params = __rest(_a, [\"unit\", \"utc\"]);\n transforms.push(Object.assign(Object.assign(Object.assign(Object.assign({ field: replacePathInField(field), type: 'timeunit' }, (unit ? { units: getTimeUnitParts(unit) } : {})), (utc ? { timezone: 'utc' } : {})), params), { as: [as, `${as}_end`] }));\n }\n return transforms;\n }\n}\n//# sourceMappingURL=timeunit.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array } from 'vega-util';\nimport { isSingleDefUnitChannel } from '../../../channel';\nimport * as log from '../../../log';\nimport { hasContinuousDomain } from '../../../scale';\nimport { hash, keys, replacePathInField, varName, isEmpty } from '../../../util';\nimport { TimeUnitNode } from '../../data/timeunit';\nexport const TUPLE_FIELDS = '_tuple_fields';\nexport class SelectionProjectionComponent {\n constructor(...items) {\n this.items = items;\n this.hasChannel = {};\n this.hasField = {};\n }\n}\nconst project = {\n has: () => {\n return true; // This transform handles its own defaults, so always run parse.\n },\n parse: (model, selCmpt, selDef) => {\n var _a, _b, _c;\n const name = selCmpt.name;\n const proj = (_a = selCmpt.project) !== null && _a !== void 0 ? _a : (selCmpt.project = new SelectionProjectionComponent());\n const parsed = {};\n const timeUnits = {};\n const signals = new Set();\n const signalName = (p, range) => {\n const suffix = range === 'visual' ? p.channel : p.field;\n let sg = varName(`${name}_${suffix}`);\n for (let counter = 1; signals.has(sg); counter++) {\n sg = varName(`${name}_${suffix}_${counter}`);\n }\n signals.add(sg);\n return { [range]: sg };\n };\n // If no explicit projection (either fields or encodings) is specified, set some defaults.\n // If an initial value is set, try to infer projections.\n // Otherwise, use the default configuration.\n if (!selDef.fields && !selDef.encodings) {\n const cfg = model.config.selection[selDef.type];\n if (selDef.init) {\n for (const init of array(selDef.init)) {\n for (const key of keys(init)) {\n if (isSingleDefUnitChannel(key)) {\n (selDef.encodings || (selDef.encodings = [])).push(key);\n }\n else {\n if (selDef.type === 'interval') {\n log.warn(log.message.INTERVAL_INITIALIZED_WITH_X_Y);\n selDef.encodings = cfg.encodings;\n }\n else {\n (selDef.fields || (selDef.fields = [])).push(key);\n }\n }\n }\n }\n }\n else {\n selDef.encodings = cfg.encodings;\n selDef.fields = cfg.fields;\n }\n }\n // TODO: find a possible channel mapping for these fields.\n for (const field of (_b = selDef.fields) !== null && _b !== void 0 ? _b : []) {\n const p = { type: 'E', field };\n p.signals = Object.assign({}, signalName(p, 'data'));\n proj.items.push(p);\n proj.hasField[field] = p;\n }\n for (const channel of (_c = selDef.encodings) !== null && _c !== void 0 ? _c : []) {\n const fieldDef = model.fieldDef(channel);\n if (fieldDef) {\n let field = fieldDef.field;\n if (fieldDef.aggregate) {\n log.warn(log.message.cannotProjectAggregate(channel, fieldDef.aggregate));\n continue;\n }\n else if (!field) {\n log.warn(log.message.cannotProjectOnChannelWithoutField(channel));\n continue;\n }\n if (fieldDef.timeUnit) {\n field = model.vgField(channel);\n // Construct TimeUnitComponents which will be combined into a\n // TimeUnitNode. This node may need to be inserted into the\n // dataflow if the selection is used across views that do not\n // have these time units defined.\n const component = {\n timeUnit: fieldDef.timeUnit,\n as: field,\n field: fieldDef.field\n };\n timeUnits[hash(component)] = component;\n }\n // Prevent duplicate projections on the same field.\n // TODO: what if the same field is bound to multiple channels (e.g., SPLOM diag).\n if (!parsed[field]) {\n // Determine whether the tuple will store enumerated or ranged values.\n // Interval selections store ranges for continuous scales, and enumerations otherwise.\n // Single/multi selections store ranges for binned fields, and enumerations otherwise.\n let type = 'E';\n if (selCmpt.type === 'interval') {\n const scaleType = model.getScaleComponent(channel).get('type');\n if (hasContinuousDomain(scaleType)) {\n type = 'R';\n }\n }\n else if (fieldDef.bin) {\n type = 'R-RE';\n }\n const p = { field, channel, type };\n p.signals = Object.assign(Object.assign({}, signalName(p, 'data')), signalName(p, 'visual'));\n proj.items.push((parsed[field] = p));\n proj.hasField[field] = proj.hasChannel[channel] = parsed[field];\n }\n }\n else {\n log.warn(log.message.cannotProjectOnChannelWithoutField(channel));\n }\n }\n if (selDef.init) {\n const parseInit = (i) => {\n return proj.items.map(p => (i[p.channel] !== undefined ? i[p.channel] : i[p.field]));\n };\n if (selDef.type === 'interval') {\n selCmpt.init = parseInit(selDef.init);\n }\n else {\n const init = array(selDef.init);\n selCmpt.init = init.map(parseInit);\n }\n }\n if (!isEmpty(timeUnits)) {\n proj.timeUnit = new TimeUnitNode(null, timeUnits);\n }\n },\n signals: (model, selCmpt, allSignals) => {\n const name = selCmpt.name + TUPLE_FIELDS;\n const hasSignal = allSignals.filter(s => s.name === name);\n return hasSignal.length > 0\n ? allSignals\n : allSignals.concat({\n name,\n value: selCmpt.project.items.map(proj => {\n const { signals, hasLegend } = proj, rest = __rest(proj, [\"signals\", \"hasLegend\"]);\n rest.field = replacePathInField(rest.field);\n return rest;\n })\n });\n }\n};\nexport default project;\n//# sourceMappingURL=project.js.map","import { stringValue } from 'vega-util';\nimport { TUPLE } from '..';\nimport { varName } from '../../../util';\nimport { assembleInit } from '../assemble';\nimport nearest from './nearest';\nimport { TUPLE_FIELDS } from './project';\nimport { isLegendBinding } from '../../../selection';\nconst inputBindings = {\n has: selCmpt => {\n return (selCmpt.type === 'single' &&\n selCmpt.resolve === 'global' &&\n selCmpt.bind &&\n selCmpt.bind !== 'scales' &&\n !isLegendBinding(selCmpt.bind));\n },\n parse: (model, selCmpt, selDef, origDef) => {\n // Binding a selection to input widgets disables default direct manipulation interaction.\n // A user can choose to re-enable it by explicitly specifying triggering input events.\n if (!origDef.on)\n delete selCmpt.events;\n if (!origDef.clear)\n delete selCmpt.clear;\n },\n topLevelSignals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const proj = selCmpt.project;\n const bind = selCmpt.bind;\n const init = selCmpt.init && selCmpt.init[0]; // Can only exist on single selections (one initial value).\n const datum = nearest.has(selCmpt) ? '(item().isVoronoi ? datum.datum : datum)' : 'datum';\n proj.items.forEach((p, i) => {\n var _a, _b;\n const sgname = varName(`${name}_${p.field}`);\n const hasSignal = signals.filter(s => s.name === sgname);\n if (!hasSignal.length) {\n signals.unshift(Object.assign(Object.assign({ name: sgname }, (init ? { init: assembleInit(init[i]) } : { value: null })), { on: selCmpt.events\n ? [\n {\n events: selCmpt.events,\n update: `datum && item().mark.marktype !== 'group' ? ${datum}[${stringValue(p.field)}] : null`\n }\n ]\n : [], bind: (_b = (_a = bind[p.field]) !== null && _a !== void 0 ? _a : bind[p.channel]) !== null && _b !== void 0 ? _b : bind }));\n }\n });\n return signals;\n },\n signals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const proj = selCmpt.project;\n const signal = signals.filter(s => s.name === name + TUPLE)[0];\n const fields = name + TUPLE_FIELDS;\n const values = proj.items.map(p => varName(`${name}_${p.field}`));\n const valid = values.map(v => `${v} !== null`).join(' && ');\n if (values.length) {\n signal.update = `${valid} ? {fields: ${fields}, values: [${values.join(', ')}]} : null`;\n }\n delete signal.value;\n delete signal.on;\n return signals;\n }\n};\nexport default inputBindings;\n//# sourceMappingURL=inputs.js.map","import { TUPLE, unitName } from '..';\nexport const TOGGLE = '_toggle';\nconst toggle = {\n has: selCmpt => {\n return selCmpt.type === 'multi' && !!selCmpt.toggle;\n },\n signals: (model, selCmpt, signals) => {\n return signals.concat({\n name: selCmpt.name + TOGGLE,\n value: false,\n on: [{ events: selCmpt.events, update: selCmpt.toggle }]\n });\n },\n modifyExpr: (model, selCmpt) => {\n const tpl = selCmpt.name + TUPLE;\n const signal = selCmpt.name + TOGGLE;\n return (`${signal} ? null : ${tpl}, ` +\n (selCmpt.resolve === 'global' ? `${signal} ? null : true, ` : `${signal} ? null : {unit: ${unitName(model)}}, `) +\n `${signal} ? ${tpl} : null`);\n }\n};\nexport default toggle;\n//# sourceMappingURL=toggle.js.map","import { selector as parseSelector } from 'vega-event-selector';\nimport { isString } from 'vega-util';\nimport { TUPLE } from '..';\nimport { varName } from '../../../util';\nimport inputBindings from './inputs';\nimport toggle, { TOGGLE } from './toggle';\nconst clear = {\n has: selCmpt => {\n return selCmpt.clear !== undefined && selCmpt.clear !== false;\n },\n parse: (model, selCmpt, selDef) => {\n if (selDef.clear) {\n selCmpt.clear = isString(selDef.clear) ? parseSelector(selDef.clear, 'scope') : selDef.clear;\n }\n },\n topLevelSignals: (model, selCmpt, signals) => {\n if (inputBindings.has(selCmpt)) {\n for (const proj of selCmpt.project.items) {\n const idx = signals.findIndex(n => n.name === varName(`${selCmpt.name}_${proj.field}`));\n if (idx !== -1) {\n signals[idx].on.push({ events: selCmpt.clear, update: 'null' });\n }\n }\n }\n return signals;\n },\n signals: (model, selCmpt, signals) => {\n function addClear(idx, update) {\n if (idx !== -1 && signals[idx].on) {\n signals[idx].on.push({ events: selCmpt.clear, update });\n }\n }\n // Be as minimalist as possible when adding clear triggers to minimize dataflow execution.\n if (selCmpt.type === 'interval') {\n for (const proj of selCmpt.project.items) {\n const vIdx = signals.findIndex(n => n.name === proj.signals.visual);\n addClear(vIdx, '[0, 0]');\n if (vIdx === -1) {\n const dIdx = signals.findIndex(n => n.name === proj.signals.data);\n addClear(dIdx, 'null');\n }\n }\n }\n else {\n let tIdx = signals.findIndex(n => n.name === selCmpt.name + TUPLE);\n addClear(tIdx, 'null');\n if (toggle.has(selCmpt)) {\n tIdx = signals.findIndex(n => n.name === selCmpt.name + TOGGLE);\n addClear(tIdx, 'false');\n }\n }\n return signals;\n }\n};\nexport default clear;\n//# sourceMappingURL=clear.js.map","import { stringValue } from 'vega-util';\nimport { VL_SELECTION_RESOLVE } from '..';\nimport { isScaleChannel } from '../../../channel';\nimport * as log from '../../../log';\nimport { hasContinuousDomain } from '../../../scale';\nimport { isLayerModel } from '../../model';\nconst scaleBindings = {\n has: selCmpt => {\n return selCmpt.type === 'interval' && selCmpt.resolve === 'global' && selCmpt.bind && selCmpt.bind === 'scales';\n },\n parse: (model, selCmpt) => {\n const bound = (selCmpt.scales = []);\n for (const proj of selCmpt.project.items) {\n const channel = proj.channel;\n if (!isScaleChannel(channel)) {\n continue;\n }\n const scale = model.getScaleComponent(channel);\n const scaleType = scale ? scale.get('type') : undefined;\n if (!scale || !hasContinuousDomain(scaleType)) {\n log.warn(log.message.SCALE_BINDINGS_CONTINUOUS);\n continue;\n }\n const extent = { selection: selCmpt.name, field: proj.field };\n scale.set('selectionExtent', extent, true);\n bound.push(proj);\n }\n },\n topLevelSignals: (model, selCmpt, signals) => {\n const bound = selCmpt.scales.filter(proj => signals.filter(s => s.name === proj.signals.data).length === 0);\n // Top-level signals are only needed for multiview displays and if this\n // view's top-level signals haven't already been generated.\n if (!model.parent || isTopLevelLayer(model) || bound.length === 0) {\n return signals;\n }\n // vlSelectionResolve does not account for the behavior of bound scales in\n // multiview displays. Each unit view adds a tuple to the store, but the\n // state of the selection is the unit selection most recently updated. This\n // state is captured by the top-level signals that we insert and \"push\n // outer\" to from within the units. We need to reassemble this state into\n // the top-level named signal, except no single selCmpt has a global view.\n const namedSg = signals.filter(s => s.name === selCmpt.name)[0];\n let update = namedSg.update;\n if (update.indexOf(VL_SELECTION_RESOLVE) >= 0) {\n namedSg.update = `{${bound.map(proj => `${stringValue(proj.field)}: ${proj.signals.data}`).join(', ')}}`;\n }\n else {\n for (const proj of bound) {\n const mapping = `${stringValue(proj.field)}: ${proj.signals.data}`;\n if (update.indexOf(mapping) < 0) {\n update = `${update.substring(0, update.length - 1)}, ${mapping}}`;\n }\n }\n namedSg.update = update;\n }\n return signals.concat(bound.map(proj => ({ name: proj.signals.data })));\n },\n signals: (model, selCmpt, signals) => {\n // Nested signals need only push to top-level signals with multiview displays.\n if (model.parent && !isTopLevelLayer(model)) {\n for (const proj of selCmpt.scales) {\n const signal = signals.filter(s => s.name === proj.signals.data)[0];\n signal.push = 'outer';\n delete signal.value;\n delete signal.update;\n }\n }\n return signals;\n }\n};\nexport default scaleBindings;\nexport function domain(model, channel) {\n const scale = stringValue(model.scaleName(channel));\n return `domain(${scale})`;\n}\nfunction isTopLevelLayer(model) {\n var _a;\n return model.parent && isLayerModel(model.parent) && ((_a = !model.parent.parent) !== null && _a !== void 0 ? _a : isTopLevelLayer(model.parent.parent));\n}\n//# sourceMappingURL=scales.js.map","import { selector as parseSelector } from 'vega-event-selector';\nimport { array, isString } from 'vega-util';\nimport { forEachSelection, TUPLE } from '..';\nimport * as log from '../../../log';\nimport { isLegendBinding, isLegendStreamBinding, SELECTION_ID } from '../../../selection';\nimport { duplicate, varName } from '../../../util';\nimport { TUPLE_FIELDS } from './project';\nimport { TOGGLE } from './toggle';\nconst legendBindings = {\n has: (selCmpt) => {\n const spec = selCmpt.resolve === 'global' && selCmpt.bind && isLegendBinding(selCmpt.bind);\n const projLen = selCmpt.project.items.length === 1 && selCmpt.project.items[0].field !== SELECTION_ID;\n if (spec && !projLen) {\n log.warn(log.message.LEGEND_BINDINGS_MUST_HAVE_PROJECTION);\n }\n return spec && projLen;\n },\n parse: (model, selCmpt, selDef, origDef) => {\n var _a;\n // Binding a selection to a legend disables default direct manipulation interaction.\n // A user can choose to re-enable it by explicitly specifying triggering input events.\n if (!origDef.on)\n delete selCmpt.events;\n if (!origDef.clear)\n delete selCmpt.clear;\n if (origDef.on || origDef.clear) {\n const legendFilter = 'event.item && indexof(event.item.mark.role, \"legend\") < 0';\n for (const evt of selCmpt.events) {\n evt.filter = array((_a = evt.filter) !== null && _a !== void 0 ? _a : []);\n if (evt.filter.indexOf(legendFilter) < 0) {\n evt.filter.push(legendFilter);\n }\n }\n }\n const evt = isLegendStreamBinding(selCmpt.bind) ? selCmpt.bind.legend : 'click';\n const stream = isString(evt) ? parseSelector(evt, 'view') : array(evt);\n selCmpt.bind = { legend: { merge: stream } };\n },\n topLevelSignals: (model, selCmpt, signals) => {\n const selName = selCmpt.name;\n const stream = isLegendStreamBinding(selCmpt.bind) && selCmpt.bind.legend;\n const markName = (name) => (s) => {\n const ds = duplicate(s);\n ds.markname = name;\n return ds;\n };\n for (const proj of selCmpt.project.items) {\n if (!proj.hasLegend)\n continue;\n const prefix = `${varName(proj.field)}_legend`;\n const sgName = `${selName}_${prefix}`;\n const hasSignal = signals.filter(s => s.name === sgName);\n if (hasSignal.length === 0) {\n const events = stream.merge\n .map(markName(`${prefix}_symbols`))\n .concat(stream.merge.map(markName(`${prefix}_labels`)))\n .concat(stream.merge.map(markName(`${prefix}_entries`)));\n signals.unshift(Object.assign(Object.assign({ name: sgName }, (!selCmpt.init ? { value: null } : {})), { on: [\n // Legend entries do not store values, so we need to walk the scenegraph to the symbol datum.\n { events, update: 'datum.value || item().items[0].items[0].datum.value', force: true },\n { events: stream.merge, update: `!event.item || !datum ? null : ${sgName}`, force: true }\n ] }));\n }\n }\n return signals;\n },\n signals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const proj = selCmpt.project;\n const tuple = signals.find(s => s.name === name + TUPLE);\n const fields = name + TUPLE_FIELDS;\n const values = proj.items.filter(p => p.hasLegend).map(p => varName(`${name}_${varName(p.field)}_legend`));\n const valid = values.map(v => `${v} !== null`).join(' && ');\n const update = `${valid} ? {fields: ${fields}, values: [${values.join(', ')}]} : null`;\n if (selCmpt.events && values.length > 0) {\n tuple.on.push({\n events: values.map(signal => ({ signal })),\n update\n });\n }\n else if (values.length > 0) {\n tuple.update = update;\n delete tuple.value;\n delete tuple.on;\n }\n const toggle = signals.find(s => s.name === name + TOGGLE);\n const events = isLegendStreamBinding(selCmpt.bind) && selCmpt.bind.legend;\n if (toggle) {\n if (!selCmpt.events)\n toggle.on[0].events = events;\n else\n toggle.on.push(Object.assign(Object.assign({}, toggle.on[0]), { events }));\n }\n return signals;\n }\n};\nexport default legendBindings;\nexport function parseInteractiveLegend(model, channel, legendCmpt) {\n var _a;\n const field = (_a = model.fieldDef(channel)) === null || _a === void 0 ? void 0 : _a.field;\n forEachSelection(model, selCmpt => {\n var _a, _b;\n const proj = (_a = selCmpt.project.hasField[field]) !== null && _a !== void 0 ? _a : selCmpt.project.hasChannel[channel];\n if (proj && legendBindings.has(selCmpt)) {\n const legendSelections = (_b = legendCmpt.get('selections')) !== null && _b !== void 0 ? _b : [];\n legendSelections.push(selCmpt.name);\n legendCmpt.set('selections', legendSelections, false);\n proj.hasLegend = true;\n }\n });\n}\n//# sourceMappingURL=legends.js.map","import { selector as parseSelector } from 'vega-event-selector';\nimport { X, Y } from '../../../channel';\nimport { BRUSH as INTERVAL_BRUSH } from '../interval';\nimport scalesCompiler, { domain } from './scales';\nconst ANCHOR = '_translate_anchor';\nconst DELTA = '_translate_delta';\nconst translate = {\n has: selCmpt => {\n return selCmpt.type === 'interval' && selCmpt.translate;\n },\n signals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const hasScales = scalesCompiler.has(selCmpt);\n const anchor = name + ANCHOR;\n const { x, y } = selCmpt.project.hasChannel;\n let events = parseSelector(selCmpt.translate, 'scope');\n if (!hasScales) {\n events = events.map(e => ((e.between[0].markname = name + INTERVAL_BRUSH), e));\n }\n signals.push({\n name: anchor,\n value: {},\n on: [\n {\n events: events.map(e => e.between[0]),\n update: '{x: x(unit), y: y(unit)' +\n (x !== undefined ? ', extent_x: ' + (hasScales ? domain(model, X) : `slice(${x.signals.visual})`) : '') +\n (y !== undefined ? ', extent_y: ' + (hasScales ? domain(model, Y) : `slice(${y.signals.visual})`) : '') +\n '}'\n }\n ]\n }, {\n name: name + DELTA,\n value: {},\n on: [\n {\n events: events,\n update: `{x: ${anchor}.x - x(unit), y: ${anchor}.y - y(unit)}`\n }\n ]\n });\n if (x !== undefined) {\n onDelta(model, selCmpt, x, 'width', signals);\n }\n if (y !== undefined) {\n onDelta(model, selCmpt, y, 'height', signals);\n }\n return signals;\n }\n};\nexport default translate;\nfunction onDelta(model, selCmpt, proj, size, signals) {\n var _a;\n const name = selCmpt.name;\n const anchor = name + ANCHOR;\n const delta = name + DELTA;\n const channel = proj.channel;\n const hasScales = scalesCompiler.has(selCmpt);\n const signal = signals.filter(s => s.name === proj.signals[hasScales ? 'data' : 'visual'])[0];\n const sizeSg = model.getSizeSignalRef(size).signal;\n const scaleCmpt = model.getScaleComponent(channel);\n const scaleType = scaleCmpt.get('type');\n const sign = hasScales && channel === X ? '-' : ''; // Invert delta when panning x-scales.\n const extent = `${anchor}.extent_${channel}`;\n const offset = `${sign}${delta}.${channel} / ` + (hasScales ? `${sizeSg}` : `span(${extent})`);\n const panFn = !hasScales\n ? 'panLinear'\n : scaleType === 'log'\n ? 'panLog'\n : scaleType === 'pow'\n ? 'panPow'\n : 'panLinear';\n const update = `${panFn}(${extent}, ${offset}` +\n (hasScales && scaleType === 'pow' ? `, ${(_a = scaleCmpt.get('exponent')) !== null && _a !== void 0 ? _a : 1}` : '') +\n ')';\n signal.on.push({\n events: { signal: delta },\n update: hasScales ? update : `clampRange(${update}, 0, ${sizeSg})`\n });\n}\n//# sourceMappingURL=translate.js.map","import { selector as parseSelector } from 'vega-event-selector';\nimport { stringValue } from 'vega-util';\nimport { X, Y } from '../../../channel';\nimport { BRUSH as INTERVAL_BRUSH } from '../interval';\nimport { default as scalesCompiler, domain } from './scales';\nconst ANCHOR = '_zoom_anchor';\nconst DELTA = '_zoom_delta';\nconst zoom = {\n has: selCmpt => {\n return selCmpt.type === 'interval' && selCmpt.zoom;\n },\n signals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const hasScales = scalesCompiler.has(selCmpt);\n const delta = name + DELTA;\n const { x, y } = selCmpt.project.hasChannel;\n const sx = stringValue(model.scaleName(X));\n const sy = stringValue(model.scaleName(Y));\n let events = parseSelector(selCmpt.zoom, 'scope');\n if (!hasScales) {\n events = events.map(e => ((e.markname = name + INTERVAL_BRUSH), e));\n }\n signals.push({\n name: name + ANCHOR,\n on: [\n {\n events: events,\n update: !hasScales\n ? `{x: x(unit), y: y(unit)}`\n : '{' +\n [sx ? `x: invert(${sx}, x(unit))` : '', sy ? `y: invert(${sy}, y(unit))` : '']\n .filter(expr => !!expr)\n .join(', ') +\n '}'\n }\n ]\n }, {\n name: delta,\n on: [\n {\n events: events,\n force: true,\n update: 'pow(1.001, event.deltaY * pow(16, event.deltaMode))'\n }\n ]\n });\n if (x !== undefined) {\n onDelta(model, selCmpt, x, 'width', signals);\n }\n if (y !== undefined) {\n onDelta(model, selCmpt, y, 'height', signals);\n }\n return signals;\n }\n};\nexport default zoom;\nfunction onDelta(model, selCmpt, proj, size, signals) {\n var _a;\n const name = selCmpt.name;\n const channel = proj.channel;\n const hasScales = scalesCompiler.has(selCmpt);\n const signal = signals.filter(s => s.name === proj.signals[hasScales ? 'data' : 'visual'])[0];\n const sizeSg = model.getSizeSignalRef(size).signal;\n const scaleCmpt = model.getScaleComponent(channel);\n const scaleType = scaleCmpt.get('type');\n const base = hasScales ? domain(model, channel) : signal.name;\n const delta = name + DELTA;\n const anchor = `${name}${ANCHOR}.${channel}`;\n const zoomFn = !hasScales\n ? 'zoomLinear'\n : scaleType === 'log'\n ? 'zoomLog'\n : scaleType === 'pow'\n ? 'zoomPow'\n : 'zoomLinear';\n const update = `${zoomFn}(${base}, ${anchor}, ${delta}` +\n (hasScales && scaleType === 'pow' ? `, ${(_a = scaleCmpt.get('exponent')) !== null && _a !== void 0 ? _a : 1}` : '') +\n ')';\n signal.on.push({\n events: { signal: delta },\n update: hasScales ? update : `clampRange(${update}, 0, ${sizeSg})`\n });\n}\n//# sourceMappingURL=zoom.js.map","import clear from './clear';\nimport inputs from './inputs';\nimport nearest from './nearest';\nimport project from './project';\nimport scales from './scales';\nimport legends from './legends';\nimport toggle from './toggle';\nimport translate from './translate';\nimport zoom from './zoom';\nconst compilers = [project, toggle, scales, legends, translate, zoom, inputs, nearest, clear];\nexport function forEachTransform(selCmpt, cb) {\n for (const t of compilers) {\n if (t.has(selCmpt)) {\n cb(t);\n }\n }\n}\n//# sourceMappingURL=transforms.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { selector as parseSelector } from 'vega-event-selector';\nimport { identity, isArray, stringValue } from 'vega-util';\nimport { forEachSelection, MODIFY, STORE, unitName, VL_SELECTION_RESOLVE, TUPLE } from '.';\nimport { dateTimeToExpr, isDateTime, dateTimeToTimestamp } from '../../datetime';\nimport { keys, varName } from '../../util';\nimport { isUnitModel } from '../model';\nimport { forEachTransform } from './transforms/transforms';\nimport { parseSelectionBinExtent } from './parse';\nexport function assembleInit(init, isExpr = true, wrap = identity) {\n if (isArray(init)) {\n const assembled = init.map(v => assembleInit(v, isExpr, wrap));\n return isExpr ? `[${assembled.join(', ')}]` : assembled;\n }\n else if (isDateTime(init)) {\n if (isExpr) {\n return wrap(dateTimeToExpr(init));\n }\n else {\n return wrap(dateTimeToTimestamp(init));\n }\n }\n return isExpr ? wrap(JSON.stringify(init)) : init;\n}\nexport function assembleUnitSelectionSignals(model, signals) {\n forEachSelection(model, (selCmpt, selCompiler) => {\n const name = selCmpt.name;\n let modifyExpr = selCompiler.modifyExpr(model, selCmpt);\n signals.push(...selCompiler.signals(model, selCmpt));\n forEachTransform(selCmpt, txCompiler => {\n if (txCompiler.signals) {\n signals = txCompiler.signals(model, selCmpt, signals);\n }\n if (txCompiler.modifyExpr) {\n modifyExpr = txCompiler.modifyExpr(model, selCmpt, modifyExpr);\n }\n });\n signals.push({\n name: name + MODIFY,\n on: [\n {\n events: { signal: selCmpt.name + TUPLE },\n update: `modify(${stringValue(selCmpt.name + STORE)}, ${modifyExpr})`\n }\n ]\n });\n });\n return cleanupEmptyOnArray(signals);\n}\nexport function assembleFacetSignals(model, signals) {\n if (model.component.selection && keys(model.component.selection).length) {\n const name = stringValue(model.getName('cell'));\n signals.unshift({\n name: 'facet',\n value: {},\n on: [\n {\n events: parseSelector('mousemove', 'scope'),\n update: `isTuple(facet) ? facet : group(${name}).datum`\n }\n ]\n });\n }\n return cleanupEmptyOnArray(signals);\n}\nexport function assembleTopLevelSignals(model, signals) {\n let hasSelections = false;\n forEachSelection(model, (selCmpt, selCompiler) => {\n const name = selCmpt.name;\n const store = stringValue(name + STORE);\n const hasSg = signals.filter(s => s.name === name);\n if (hasSg.length === 0) {\n const resolve = selCmpt.resolve === 'global' ? 'union' : selCmpt.resolve;\n const isMulti = selCmpt.type === 'multi' ? ', true)' : ')';\n signals.push({\n name: selCmpt.name,\n update: `${VL_SELECTION_RESOLVE}(${store}, ${stringValue(resolve)}${isMulti}`\n });\n }\n hasSelections = true;\n if (selCompiler.topLevelSignals) {\n signals = selCompiler.topLevelSignals(model, selCmpt, signals);\n }\n forEachTransform(selCmpt, txCompiler => {\n if (txCompiler.topLevelSignals) {\n signals = txCompiler.topLevelSignals(model, selCmpt, signals);\n }\n });\n });\n if (hasSelections) {\n const hasUnit = signals.filter(s => s.name === 'unit');\n if (hasUnit.length === 0) {\n signals.unshift({\n name: 'unit',\n value: {},\n on: [{ events: 'mousemove', update: 'isTuple(group()) ? group() : unit' }]\n });\n }\n }\n return cleanupEmptyOnArray(signals);\n}\nexport function assembleUnitSelectionData(model, data) {\n const dataCopy = [...data];\n forEachSelection(model, selCmpt => {\n const init = { name: selCmpt.name + STORE };\n if (selCmpt.init) {\n const fields = selCmpt.project.items.map(proj => {\n const { signals } = proj, rest = __rest(proj, [\"signals\"]);\n return rest;\n });\n const insert = selCmpt.init.map(i => assembleInit(i, false));\n init.values =\n selCmpt.type === 'interval'\n ? [{ unit: unitName(model, { escape: false }), fields, values: insert }]\n : insert.map(i => ({ unit: unitName(model, { escape: false }), fields, values: i }));\n }\n const contains = dataCopy.filter(d => d.name === selCmpt.name + STORE);\n if (!contains.length) {\n dataCopy.push(init);\n }\n });\n return dataCopy;\n}\nexport function assembleUnitSelectionMarks(model, marks) {\n forEachSelection(model, (selCmpt, selCompiler) => {\n marks = selCompiler.marks ? selCompiler.marks(model, selCmpt, marks) : marks;\n forEachTransform(selCmpt, txCompiler => {\n if (txCompiler.marks) {\n marks = txCompiler.marks(model, selCmpt, marks);\n }\n });\n });\n return marks;\n}\nexport function assembleLayerSelectionMarks(model, marks) {\n for (const child of model.children) {\n if (isUnitModel(child)) {\n marks = assembleUnitSelectionMarks(child, marks);\n }\n }\n return marks;\n}\nexport function assembleSelectionScaleDomain(model, extent) {\n const name = extent.selection;\n const selCmpt = model.getSelectionComponent(name, varName(name));\n return { signal: parseSelectionBinExtent(selCmpt, extent) };\n}\nfunction cleanupEmptyOnArray(signals) {\n return signals.map(s => {\n if (s.on && !s.on.length)\n delete s.on;\n return s;\n });\n}\n//# sourceMappingURL=assemble.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array, stringValue } from 'vega-util';\nimport { STORE, TUPLE, unitName } from '.';\nimport { X, Y } from '../../channel';\nimport { warn } from '../../log';\nimport { hasContinuousDomain } from '../../scale';\nimport { keys } from '../../util';\nimport { assembleInit } from './assemble';\nimport { TUPLE_FIELDS } from './transforms/project';\nimport scales from './transforms/scales';\nexport const BRUSH = '_brush';\nexport const SCALE_TRIGGER = '_scale_trigger';\nconst interval = {\n signals: (model, selCmpt) => {\n const name = selCmpt.name;\n const fieldsSg = name + TUPLE_FIELDS;\n const hasScales = scales.has(selCmpt);\n const signals = [];\n const dataSignals = [];\n const scaleTriggers = [];\n if (selCmpt.translate && !hasScales) {\n const filterExpr = `!event.item || event.item.mark.name !== ${stringValue(name + BRUSH)}`;\n events(selCmpt, (on, evt) => {\n var _a;\n const filters = array((_a = evt.between[0].filter) !== null && _a !== void 0 ? _a : (evt.between[0].filter = []));\n if (filters.indexOf(filterExpr) < 0) {\n filters.push(filterExpr);\n }\n return on;\n });\n }\n selCmpt.project.items.forEach((proj, i) => {\n const channel = proj.channel;\n if (channel !== X && channel !== Y) {\n warn('Interval selections only support x and y encoding channels.');\n return;\n }\n const init = selCmpt.init ? selCmpt.init[i] : null;\n const cs = channelSignals(model, selCmpt, proj, init);\n const dname = proj.signals.data;\n const vname = proj.signals.visual;\n const scaleName = stringValue(model.scaleName(channel));\n const scaleType = model.getScaleComponent(channel).get('type');\n const toNum = hasContinuousDomain(scaleType) ? '+' : '';\n signals.push(...cs);\n dataSignals.push(dname);\n scaleTriggers.push({\n scaleName: model.scaleName(channel),\n expr: `(!isArray(${dname}) || ` +\n `(${toNum}invert(${scaleName}, ${vname})[0] === ${toNum}${dname}[0] && ` +\n `${toNum}invert(${scaleName}, ${vname})[1] === ${toNum}${dname}[1]))`\n });\n });\n // Proxy scale reactions to ensure that an infinite loop doesn't occur\n // when an interval selection filter touches the scale.\n if (!hasScales) {\n signals.push({\n name: name + SCALE_TRIGGER,\n value: {},\n on: [\n {\n events: scaleTriggers.map(t => ({ scale: t.scaleName })),\n update: scaleTriggers.map(t => t.expr).join(' && ') + ` ? ${name + SCALE_TRIGGER} : {}`\n }\n ]\n });\n }\n // Only add an interval to the store if it has valid data extents. Data extents\n // are set to null if pixel extents are equal to account for intervals over\n // ordinal/nominal domains which, when inverted, will still produce a valid datum.\n const init = selCmpt.init;\n const update = `unit: ${unitName(model)}, fields: ${fieldsSg}, values`;\n return signals.concat(Object.assign(Object.assign({ name: name + TUPLE }, (init ? { init: `{${update}: ${assembleInit(init)}}` } : {})), { on: [\n {\n events: [{ signal: dataSignals.join(' || ') }],\n update: dataSignals.join(' && ') + ` ? {${update}: [${dataSignals}]} : null`\n }\n ] }));\n },\n modifyExpr: (model, selCmpt) => {\n const tpl = selCmpt.name + TUPLE;\n return tpl + ', ' + (selCmpt.resolve === 'global' ? 'true' : `{unit: ${unitName(model)}}`);\n },\n marks: (model, selCmpt, marks) => {\n const name = selCmpt.name;\n const { x, y } = selCmpt.project.hasChannel;\n const xvname = x && x.signals.visual;\n const yvname = y && y.signals.visual;\n const store = `data(${stringValue(selCmpt.name + STORE)})`;\n // Do not add a brush if we're binding to scales.\n if (scales.has(selCmpt)) {\n return marks;\n }\n const update = {\n x: x !== undefined ? { signal: `${xvname}[0]` } : { value: 0 },\n y: y !== undefined ? { signal: `${yvname}[0]` } : { value: 0 },\n x2: x !== undefined ? { signal: `${xvname}[1]` } : { field: { group: 'width' } },\n y2: y !== undefined ? { signal: `${yvname}[1]` } : { field: { group: 'height' } }\n };\n // If the selection is resolved to global, only a single interval is in\n // the store. Wrap brush mark's encodings with a production rule to test\n // this based on the `unit` property. Hide the brush mark if it corresponds\n // to a unit different from the one in the store.\n if (selCmpt.resolve === 'global') {\n for (const key of keys(update)) {\n update[key] = [\n Object.assign({ test: `${store}.length && ${store}[0].unit === ${unitName(model)}` }, update[key]),\n { value: 0 }\n ];\n }\n }\n // Two brush marks ensure that fill colors and other aesthetic choices do\n // not interefere with the core marks, but that the brushed region can still\n // be interacted with (e.g., dragging it around).\n const _a = selCmpt.mark, { fill, fillOpacity, cursor } = _a, stroke = __rest(_a, [\"fill\", \"fillOpacity\", \"cursor\"]);\n const vgStroke = keys(stroke).reduce((def, k) => {\n def[k] = [\n {\n test: [x !== undefined && `${xvname}[0] !== ${xvname}[1]`, y !== undefined && `${yvname}[0] !== ${yvname}[1]`]\n .filter(t => t)\n .join(' && '),\n value: stroke[k]\n },\n { value: null }\n ];\n return def;\n }, {});\n return [\n {\n name: name + BRUSH + '_bg',\n type: 'rect',\n clip: true,\n encode: {\n enter: {\n fill: { value: fill },\n fillOpacity: { value: fillOpacity }\n },\n update: update\n }\n },\n ...marks,\n {\n name: name + BRUSH,\n type: 'rect',\n clip: true,\n encode: {\n enter: Object.assign(Object.assign({}, (cursor ? { cursor: { value: cursor } } : {})), { fill: { value: 'transparent' } }),\n update: Object.assign(Object.assign({}, update), vgStroke)\n }\n }\n ];\n }\n};\nexport default interval;\n/**\n * Returns the visual and data signals for an interval selection.\n */\nfunction channelSignals(model, selCmpt, proj, init) {\n const channel = proj.channel;\n const vname = proj.signals.visual;\n const dname = proj.signals.data;\n const hasScales = scales.has(selCmpt);\n const scaleName = stringValue(model.scaleName(channel));\n const scale = model.getScaleComponent(channel);\n const scaleType = scale ? scale.get('type') : undefined;\n const scaled = (str) => `scale(${scaleName}, ${str})`;\n const size = model.getSizeSignalRef(channel === X ? 'width' : 'height').signal;\n const coord = `${channel}(unit)`;\n const on = events(selCmpt, (def, evt) => {\n return [\n ...def,\n { events: evt.between[0], update: `[${coord}, ${coord}]` },\n { events: evt, update: `[${vname}[0], clamp(${coord}, 0, ${size})]` } // Brush End\n ];\n });\n // React to pan/zooms of continuous scales. Non-continuous scales\n // (band, point) cannot be pan/zoomed and any other changes\n // to their domains (e.g., filtering) should clear the brushes.\n on.push({\n events: { signal: selCmpt.name + SCALE_TRIGGER },\n update: hasContinuousDomain(scaleType) ? `[${scaled(`${dname}[0]`)}, ${scaled(`${dname}[1]`)}]` : `[0, 0]`\n });\n return hasScales\n ? [{ name: dname, on: [] }]\n : [\n Object.assign(Object.assign({ name: vname }, (init ? { init: assembleInit(init, true, scaled) } : { value: [] })), { on: on }),\n Object.assign(Object.assign({ name: dname }, (init ? { init: assembleInit(init) } : {})), { on: [\n {\n events: { signal: vname },\n update: `${vname}[0] === ${vname}[1] ? null : invert(${scaleName}, ${vname})`\n }\n ] })\n ];\n}\nfunction events(selCmpt, cb) {\n return selCmpt.events.reduce((on, evt) => {\n if (!evt.between) {\n warn(`${evt} is not an ordered event stream for interval selections.`);\n return on;\n }\n return cb(on, evt);\n }, []);\n}\n//# sourceMappingURL=interval.js.map","import { stringValue } from 'vega-util';\nimport { TUPLE, unitName } from '.';\nimport { TUPLE_FIELDS } from './transforms/project';\nexport function singleOrMultiSignals(model, selCmpt) {\n const name = selCmpt.name;\n const fieldsSg = name + TUPLE_FIELDS;\n const project = selCmpt.project;\n const datum = '(item().isVoronoi ? datum.datum : datum)';\n const values = project.items\n .map(p => {\n const fieldDef = model.fieldDef(p.channel);\n // Binned fields should capture extents, for a range test against the raw field.\n return fieldDef && fieldDef.bin\n ? `[${datum}[${stringValue(model.vgField(p.channel, {}))}], ` +\n `${datum}[${stringValue(model.vgField(p.channel, { binSuffix: 'end' }))}]]`\n : `${datum}[${stringValue(p.field)}]`;\n })\n .join(', ');\n // Only add a discrete selection to the store if a datum is present _and_\n // the interaction isn't occurring on a group mark. This guards against\n // polluting interactive state with invalid values in faceted displays\n // as the group marks are also data-driven. We force the update to account\n // for constant null states but varying toggles (e.g., shift-click in\n // whitespace followed by a click in whitespace; the store should only\n // be cleared on the second click).\n const update = `unit: ${unitName(model)}, fields: ${fieldsSg}, values`;\n const events = selCmpt.events;\n return [\n {\n name: name + TUPLE,\n on: events\n ? [\n {\n events,\n update: `datum && item().mark.marktype !== 'group' ? {${update}: [${values}]} : null`,\n force: true\n }\n ]\n : []\n }\n ];\n}\nconst multi = {\n signals: singleOrMultiSignals,\n modifyExpr: (model, selCmpt) => {\n const tpl = selCmpt.name + TUPLE;\n return tpl + ', ' + (selCmpt.resolve === 'global' ? 'null' : `{unit: ${unitName(model)}}`);\n }\n};\nexport default multi;\n//# sourceMappingURL=multi.js.map","import { TUPLE, unitName } from '.';\nimport { singleOrMultiSignals } from './multi';\nconst single = {\n signals: singleOrMultiSignals,\n modifyExpr: (model, selCmpt) => {\n const tpl = selCmpt.name + TUPLE;\n return tpl + ', ' + (selCmpt.resolve === 'global' ? 'true' : `{unit: ${unitName(model)}}`);\n }\n};\nexport default single;\n//# sourceMappingURL=single.js.map","import { stringValue } from 'vega-util';\nimport { FACET_CHANNELS } from '../../channel';\nimport { SELECTION_ID } from '../../selection';\nimport { vals } from '../../util';\nimport { isFacetModel } from '../model';\nimport interval from './interval';\nimport multi from './multi';\nimport single from './single';\nexport const STORE = '_store';\nexport const TUPLE = '_tuple';\nexport const MODIFY = '_modify';\nexport const SELECTION_DOMAIN = '_selection_domain_';\nexport const VL_SELECTION_RESOLVE = 'vlSelectionResolve';\nconst compilers = { single, multi, interval };\nexport function forEachSelection(model, cb) {\n const selections = model.component.selection;\n if (selections) {\n for (const sel of vals(selections)) {\n const success = cb(sel, compilers[sel.type]);\n if (success === true)\n break;\n }\n }\n}\nfunction getFacetModel(model) {\n let parent = model.parent;\n while (parent) {\n if (isFacetModel(parent)) {\n break;\n }\n parent = parent.parent;\n }\n return parent;\n}\nexport function unitName(model, { escape } = { escape: true }) {\n let name = escape ? stringValue(model.name) : model.name;\n const facetModel = getFacetModel(model);\n if (facetModel) {\n const { facet } = facetModel;\n for (const channel of FACET_CHANNELS) {\n if (facet[channel]) {\n name += ` + '__facet_${channel}_' + (facet[${stringValue(facetModel.vgField(channel))}])`;\n }\n }\n }\n return name;\n}\nexport function requiresSelectionId(model) {\n let identifier = false;\n forEachSelection(model, selCmpt => {\n identifier = identifier || selCmpt.project.items.some(proj => proj.field === SELECTION_ID);\n });\n return identifier;\n}\n//# sourceMappingURL=index.js.map","function accessor (fn, fields, name) {\n fn.fields = fields || [];\n fn.fname = name;\n return fn;\n}\nfunction accessorName(fn) {\n return fn == null ? null : fn.fname;\n}\nfunction accessorFields(fn) {\n return fn == null ? null : fn.fields;\n}\n\nfunction getter (path) {\n return path.length === 1 ? get1(path[0]) : getN(path);\n}\nconst get1 = field => function (obj) {\n return obj[field];\n};\nconst getN = path => {\n const len = path.length;\n return function (obj) {\n for (let i = 0; i < len; ++i) {\n obj = obj[path[i]];\n }\n return obj;\n };\n};\n\nfunction error (message) {\n throw Error(message);\n}\n\nfunction splitAccessPath (p) {\n const path = [],\n n = p.length;\n let q = null,\n b = 0,\n s = '',\n i,\n j,\n c;\n p = p + '';\n function push() {\n path.push(s + p.substring(i, j));\n s = '';\n i = j + 1;\n }\n for (i = j = 0; j < n; ++j) {\n c = p[j];\n if (c === '\\\\') {\n s += p.substring(i, j++);\n i = j;\n } else if (c === q) {\n push();\n q = null;\n b = -1;\n } else if (q) {\n continue;\n } else if (i === b && c === '\"') {\n i = j + 1;\n q = c;\n } else if (i === b && c === \"'\") {\n i = j + 1;\n q = c;\n } else if (c === '.' && !b) {\n if (j > i) {\n push();\n } else {\n i = j + 1;\n }\n } else if (c === '[') {\n if (j > i) push();\n b = i = j + 1;\n } else if (c === ']') {\n if (!b) error('Access path missing open bracket: ' + p);\n if (b > 0) push();\n b = 0;\n i = j + 1;\n }\n }\n if (b) error('Access path missing closing bracket: ' + p);\n if (q) error('Access path missing closing quote: ' + p);\n if (j > i) {\n j++;\n push();\n }\n return path;\n}\n\nfunction field (field, name, opt) {\n const path = splitAccessPath(field);\n field = path.length === 1 ? path[0] : field;\n return accessor((opt && opt.get || getter)(path), [field], name || field);\n}\n\nconst id = field('id');\nconst identity = accessor(_ => _, [], 'identity');\nconst zero = accessor(() => 0, [], 'zero');\nconst one = accessor(() => 1, [], 'one');\nconst truthy = accessor(() => true, [], 'true');\nconst falsy = accessor(() => false, [], 'false');\n\nfunction log$1(method, level, input) {\n const args = [level].concat([].slice.call(input));\n console[method].apply(console, args); // eslint-disable-line no-console\n}\n\nconst None = 0;\nconst Error$1 = 1;\nconst Warn = 2;\nconst Info = 3;\nconst Debug = 4;\nfunction logger (_, method) {\n let handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : log$1;\n let level = _ || None;\n return {\n level(_) {\n if (arguments.length) {\n level = +_;\n return this;\n } else {\n return level;\n }\n },\n error() {\n if (level >= Error$1) handler(method || 'error', 'ERROR', arguments);\n return this;\n },\n warn() {\n if (level >= Warn) handler(method || 'warn', 'WARN', arguments);\n return this;\n },\n info() {\n if (level >= Info) handler(method || 'log', 'INFO', arguments);\n return this;\n },\n debug() {\n if (level >= Debug) handler(method || 'log', 'DEBUG', arguments);\n return this;\n }\n };\n}\n\nvar isArray = Array.isArray;\n\nfunction isObject (_) {\n return _ === Object(_);\n}\n\nconst isLegalKey = key => key !== '__proto__';\nfunction mergeConfig() {\n for (var _len = arguments.length, configs = new Array(_len), _key = 0; _key < _len; _key++) {\n configs[_key] = arguments[_key];\n }\n return configs.reduce((out, source) => {\n for (const key in source) {\n if (key === 'signals') {\n // for signals, we merge the signals arrays\n // source signals take precedence over\n // existing signals with the same name\n out.signals = mergeNamed(out.signals, source.signals);\n } else {\n // otherwise, merge objects subject to recursion constraints\n // for legend block, recurse for the layout entry only\n // for style block, recurse for all properties\n // otherwise, no recursion: objects overwrite, no merging\n const r = key === 'legend' ? {\n layout: 1\n } : key === 'style' ? true : null;\n writeConfig(out, key, source[key], r);\n }\n }\n return out;\n }, {});\n}\nfunction writeConfig(output, key, value, recurse) {\n if (!isLegalKey(key)) return;\n let k, o;\n if (isObject(value) && !isArray(value)) {\n o = isObject(output[key]) ? output[key] : output[key] = {};\n for (k in value) {\n if (recurse && (recurse === true || recurse[k])) {\n writeConfig(o, k, value[k]);\n } else if (isLegalKey(k)) {\n o[k] = value[k];\n }\n }\n } else {\n output[key] = value;\n }\n}\nfunction mergeNamed(a, b) {\n if (a == null) return b;\n const map = {},\n out = [];\n function add(_) {\n if (!map[_.name]) {\n map[_.name] = 1;\n out.push(_);\n }\n }\n b.forEach(add);\n a.forEach(add);\n return out;\n}\n\nfunction peek (array) {\n return array[array.length - 1];\n}\n\nfunction toNumber (_) {\n return _ == null || _ === '' ? null : +_;\n}\n\nconst exp = sign => x => sign * Math.exp(x);\nconst log = sign => x => Math.log(sign * x);\nconst symlog = c => x => Math.sign(x) * Math.log1p(Math.abs(x / c));\nconst symexp = c => x => Math.sign(x) * Math.expm1(Math.abs(x)) * c;\nconst pow = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\nfunction pan(domain, delta, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n dd = (d1 - d0) * delta;\n return [ground(d0 - dd), ground(d1 - dd)];\n}\nfunction panLinear(domain, delta) {\n return pan(domain, delta, toNumber, identity);\n}\nfunction panLog(domain, delta) {\n var sign = Math.sign(domain[0]);\n return pan(domain, delta, log(sign), exp(sign));\n}\nfunction panPow(domain, delta, exponent) {\n return pan(domain, delta, pow(exponent), pow(1 / exponent));\n}\nfunction panSymlog(domain, delta, constant) {\n return pan(domain, delta, symlog(constant), symexp(constant));\n}\nfunction zoom(domain, anchor, scale, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n da = anchor != null ? lift(anchor) : (d0 + d1) / 2;\n return [ground(da + (d0 - da) * scale), ground(da + (d1 - da) * scale)];\n}\nfunction zoomLinear(domain, anchor, scale) {\n return zoom(domain, anchor, scale, toNumber, identity);\n}\nfunction zoomLog(domain, anchor, scale) {\n const sign = Math.sign(domain[0]);\n return zoom(domain, anchor, scale, log(sign), exp(sign));\n}\nfunction zoomPow(domain, anchor, scale, exponent) {\n return zoom(domain, anchor, scale, pow(exponent), pow(1 / exponent));\n}\nfunction zoomSymlog(domain, anchor, scale, constant) {\n return zoom(domain, anchor, scale, symlog(constant), symexp(constant));\n}\n\nfunction quarter(date) {\n return 1 + ~~(new Date(date).getMonth() / 3);\n}\nfunction utcquarter(date) {\n return 1 + ~~(new Date(date).getUTCMonth() / 3);\n}\n\nfunction array (_) {\n return _ != null ? isArray(_) ? _ : [_] : [];\n}\n\n/**\n * Span-preserving range clamp. If the span of the input range is less\n * than (max - min) and an endpoint exceeds either the min or max value,\n * the range is translated such that the span is preserved and one\n * endpoint touches the boundary of the min/max range.\n * If the span exceeds (max - min), the range [min, max] is returned.\n */\nfunction clampRange (range, min, max) {\n let lo = range[0],\n hi = range[1],\n span;\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n span = hi - lo;\n return span >= max - min ? [min, max] : [lo = Math.min(Math.max(lo, min), max - span), lo + span];\n}\n\nfunction isFunction (_) {\n return typeof _ === 'function';\n}\n\nconst DESCENDING = 'descending';\nfunction compare (fields, orders, opt) {\n opt = opt || {};\n orders = array(orders) || [];\n const ord = [],\n get = [],\n fmap = {},\n gen = opt.comparator || comparator;\n array(fields).forEach((f, i) => {\n if (f == null) return;\n ord.push(orders[i] === DESCENDING ? -1 : 1);\n get.push(f = isFunction(f) ? f : field(f, null, opt));\n (accessorFields(f) || []).forEach(_ => fmap[_] = 1);\n });\n return get.length === 0 ? null : accessor(gen(get, ord), Object.keys(fmap));\n}\nconst ascending = (u, v) => (u < v || u == null) && v != null ? -1 : (u > v || v == null) && u != null ? 1 : (v = v instanceof Date ? +v : v, u = u instanceof Date ? +u : u) !== u && v === v ? -1 : v !== v && u === u ? 1 : 0;\nconst comparator = (fields, orders) => fields.length === 1 ? compare1(fields[0], orders[0]) : compareN(fields, orders, fields.length);\nconst compare1 = (field, order) => function (a, b) {\n return ascending(field(a), field(b)) * order;\n};\nconst compareN = (fields, orders, n) => {\n orders.push(0); // pad zero for convenient lookup\n return function (a, b) {\n let f,\n c = 0,\n i = -1;\n while (c === 0 && ++i < n) {\n f = fields[i];\n c = ascending(f(a), f(b));\n }\n return c * orders[i];\n };\n};\n\nfunction constant (_) {\n return isFunction(_) ? _ : () => _;\n}\n\nfunction debounce (delay, handler) {\n let tid;\n return e => {\n if (tid) clearTimeout(tid);\n tid = setTimeout(() => (handler(e), tid = null), delay);\n };\n}\n\nfunction extend (_) {\n for (let x, k, i = 1, len = arguments.length; i < len; ++i) {\n x = arguments[i];\n for (k in x) {\n _[k] = x[k];\n }\n }\n return _;\n}\n\n/**\n * Return an array with minimum and maximum values, in the\n * form [min, max]. Ignores null, undefined, and NaN values.\n */\nfunction extent (array, f) {\n let i = 0,\n n,\n v,\n min,\n max;\n if (array && (n = array.length)) {\n if (f == null) {\n // find first valid value\n for (v = array[i]; i < n && (v == null || v !== v); v = array[++i]);\n min = max = v;\n\n // visit all other values\n for (; i < n; ++i) {\n v = array[i];\n // skip null/undefined; NaN will fail all comparisons\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n } else {\n // find first valid value\n for (v = f(array[i]); i < n && (v == null || v !== v); v = f(array[++i]));\n min = max = v;\n\n // visit all other values\n for (; i < n; ++i) {\n v = f(array[i]);\n // skip null/undefined; NaN will fail all comparisons\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n }\n }\n return [min, max];\n}\n\nfunction extentIndex (array, f) {\n const n = array.length;\n let i = -1,\n a,\n b,\n c,\n u,\n v;\n if (f == null) {\n while (++i < n) {\n b = array[i];\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n if (i === n) return [-1, -1];\n u = v = i;\n while (++i < n) {\n b = array[i];\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n } else {\n while (++i < n) {\n b = f(array[i], i, array);\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n if (i === n) return [-1, -1];\n u = v = i;\n while (++i < n) {\n b = f(array[i], i, array);\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n }\n return [u, v];\n}\n\nconst hop = Object.prototype.hasOwnProperty;\nfunction has (object, property) {\n return hop.call(object, property);\n}\n\nconst NULL = {};\nfunction fastmap (input) {\n let obj = {},\n test;\n function has$1(key) {\n return has(obj, key) && obj[key] !== NULL;\n }\n const map = {\n size: 0,\n empty: 0,\n object: obj,\n has: has$1,\n get(key) {\n return has$1(key) ? obj[key] : undefined;\n },\n set(key, value) {\n if (!has$1(key)) {\n ++map.size;\n if (obj[key] === NULL) --map.empty;\n }\n obj[key] = value;\n return this;\n },\n delete(key) {\n if (has$1(key)) {\n --map.size;\n ++map.empty;\n obj[key] = NULL;\n }\n return this;\n },\n clear() {\n map.size = map.empty = 0;\n map.object = obj = {};\n },\n test(_) {\n if (arguments.length) {\n test = _;\n return map;\n } else {\n return test;\n }\n },\n clean() {\n const next = {};\n let size = 0;\n for (const key in obj) {\n const value = obj[key];\n if (value !== NULL && (!test || !test(value))) {\n next[key] = value;\n ++size;\n }\n }\n map.size = size;\n map.empty = 0;\n map.object = obj = next;\n }\n };\n if (input) Object.keys(input).forEach(key => {\n map.set(key, input[key]);\n });\n return map;\n}\n\nfunction flush (range, value, threshold, left, right, center) {\n if (!threshold && threshold !== 0) return center;\n const t = +threshold;\n let a = range[0],\n b = peek(range),\n l;\n\n // swap endpoints if range is reversed\n if (b < a) {\n l = a;\n a = b;\n b = l;\n }\n\n // compare value to endpoints\n l = Math.abs(value - a);\n const r = Math.abs(b - value);\n\n // adjust if value is within threshold distance of endpoint\n return l < r && l <= t ? left : r <= t ? right : center;\n}\n\nfunction inherits (child, parent, members) {\n const proto = child.prototype = Object.create(parent.prototype);\n Object.defineProperty(proto, 'constructor', {\n value: child,\n writable: true,\n enumerable: true,\n configurable: true\n });\n return extend(proto, members);\n}\n\n/**\n * Predicate that returns true if the value lies within the span\n * of the given range. The left and right flags control the use\n * of inclusive (true) or exclusive (false) comparisons.\n */\nfunction inrange (value, range, left, right) {\n let r0 = range[0],\n r1 = range[range.length - 1],\n t;\n if (r0 > r1) {\n t = r0;\n r0 = r1;\n r1 = t;\n }\n left = left === undefined || left;\n right = right === undefined || right;\n return (left ? r0 <= value : r0 < value) && (right ? value <= r1 : value < r1);\n}\n\nfunction isBoolean (_) {\n return typeof _ === 'boolean';\n}\n\nfunction isDate (_) {\n return Object.prototype.toString.call(_) === '[object Date]';\n}\n\nfunction isIterable (_) {\n return _ && isFunction(_[Symbol.iterator]);\n}\n\nfunction isNumber (_) {\n return typeof _ === 'number';\n}\n\nfunction isRegExp (_) {\n return Object.prototype.toString.call(_) === '[object RegExp]';\n}\n\nfunction isString (_) {\n return typeof _ === 'string';\n}\n\nfunction key (fields, flat, opt) {\n if (fields) {\n fields = flat ? array(fields).map(f => f.replace(/\\\\(.)/g, '$1')) : array(fields);\n }\n const len = fields && fields.length,\n gen = opt && opt.get || getter,\n map = f => gen(flat ? [f] : splitAccessPath(f));\n let fn;\n if (!len) {\n fn = function () {\n return '';\n };\n } else if (len === 1) {\n const get = map(fields[0]);\n fn = function (_) {\n return '' + get(_);\n };\n } else {\n const get = fields.map(map);\n fn = function (_) {\n let s = '' + get[0](_),\n i = 0;\n while (++i < len) s += '|' + get[i](_);\n return s;\n };\n }\n return accessor(fn, fields, 'key');\n}\n\nfunction lerp (array, frac) {\n const lo = array[0],\n hi = peek(array),\n f = +frac;\n return !f ? lo : f === 1 ? hi : lo + f * (hi - lo);\n}\n\nconst DEFAULT_MAX_SIZE = 10000;\n\n// adapted from https://github.com/dominictarr/hashlru/ (MIT License)\nfunction lruCache (maxsize) {\n maxsize = +maxsize || DEFAULT_MAX_SIZE;\n let curr, prev, size;\n const clear = () => {\n curr = {};\n prev = {};\n size = 0;\n };\n const update = (key, value) => {\n if (++size > maxsize) {\n prev = curr;\n curr = {};\n size = 1;\n }\n return curr[key] = value;\n };\n clear();\n return {\n clear,\n has: key => has(curr, key) || has(prev, key),\n get: key => has(curr, key) ? curr[key] : has(prev, key) ? update(key, prev[key]) : undefined,\n set: (key, value) => has(curr, key) ? curr[key] = value : update(key, value)\n };\n}\n\nfunction merge (compare, array0, array1, output) {\n const n0 = array0.length,\n n1 = array1.length;\n if (!n1) return array0;\n if (!n0) return array1;\n const merged = output || new array0.constructor(n0 + n1);\n let i0 = 0,\n i1 = 0,\n i = 0;\n for (; i0 < n0 && i1 < n1; ++i) {\n merged[i] = compare(array0[i0], array1[i1]) > 0 ? array1[i1++] : array0[i0++];\n }\n for (; i0 < n0; ++i0, ++i) {\n merged[i] = array0[i0];\n }\n for (; i1 < n1; ++i1, ++i) {\n merged[i] = array1[i1];\n }\n return merged;\n}\n\nfunction repeat (str, reps) {\n let s = '';\n while (--reps >= 0) s += str;\n return s;\n}\n\nfunction pad (str, length, padchar, align) {\n const c = padchar || ' ',\n s = str + '',\n n = length - s.length;\n return n <= 0 ? s : align === 'left' ? repeat(c, n) + s : align === 'center' ? repeat(c, ~~(n / 2)) + s + repeat(c, Math.ceil(n / 2)) : s + repeat(c, n);\n}\n\n/**\n * Return the numerical span of an array: the difference between\n * the last and first values.\n */\nfunction span (array) {\n return array && peek(array) - array[0] || 0;\n}\n\nfunction $(x) {\n return isArray(x) ? '[' + x.map($) + ']' : isObject(x) || isString(x) ?\n // Output valid JSON and JS source strings.\n // See http://timelessrepo.com/json-isnt-a-javascript-subset\n JSON.stringify(x).replace('\\u2028', '\\\\u2028').replace('\\u2029', '\\\\u2029') : x;\n}\n\nfunction toBoolean (_) {\n return _ == null || _ === '' ? null : !_ || _ === 'false' || _ === '0' ? false : !!_;\n}\n\nconst defaultParser = _ => isNumber(_) ? _ : isDate(_) ? _ : Date.parse(_);\nfunction toDate (_, parser) {\n parser = parser || defaultParser;\n return _ == null || _ === '' ? null : parser(_);\n}\n\nfunction toString (_) {\n return _ == null || _ === '' ? null : _ + '';\n}\n\nfunction toSet (_) {\n const s = {},\n n = _.length;\n for (let i = 0; i < n; ++i) s[_[i]] = true;\n return s;\n}\n\nfunction truncate (str, length, align, ellipsis) {\n const e = ellipsis != null ? ellipsis : '\\u2026',\n s = str + '',\n n = s.length,\n l = Math.max(0, length - e.length);\n return n <= length ? s : align === 'left' ? e + s.slice(n - l) : align === 'center' ? s.slice(0, Math.ceil(l / 2)) + e + s.slice(n - ~~(l / 2)) : s.slice(0, l) + e;\n}\n\nfunction visitArray (array, filter, visitor) {\n if (array) {\n if (filter) {\n const n = array.length;\n for (let i = 0; i < n; ++i) {\n const t = filter(array[i]);\n if (t) visitor(t, i, array);\n }\n } else {\n array.forEach(visitor);\n }\n }\n}\n\nexport { Debug, Error$1 as Error, Info, None, Warn, accessor, accessorFields, accessorName, array, ascending, clampRange, compare, constant, debounce, error, extend, extent, extentIndex, falsy, fastmap, field, flush, has as hasOwnProperty, id, identity, inherits, inrange, isArray, isBoolean, isDate, isFunction, isIterable, isNumber, isObject, isRegExp, isString, key, lerp, logger, lruCache, merge, mergeConfig, one, pad, panLinear, panLog, panPow, panSymlog, peek, quarter, repeat, span, splitAccessPath, $ as stringValue, toBoolean, toDate, toNumber, toSet, toString, truncate, truthy, utcquarter, visitArray, writeConfig, zero, zoomLinear, zoomLog, zoomPow, zoomSymlog };\n","import { error, toSet, isFunction, isString, hasOwnProperty } from 'vega-util';\n\nconst RawCode = 'RawCode';\nconst Literal = 'Literal';\nconst Property = 'Property';\nconst Identifier = 'Identifier';\nconst ArrayExpression = 'ArrayExpression';\nconst BinaryExpression = 'BinaryExpression';\nconst CallExpression = 'CallExpression';\nconst ConditionalExpression = 'ConditionalExpression';\nconst LogicalExpression = 'LogicalExpression';\nconst MemberExpression = 'MemberExpression';\nconst ObjectExpression = 'ObjectExpression';\nconst UnaryExpression = 'UnaryExpression';\nfunction ASTNode(type) {\n this.type = type;\n}\n\nASTNode.prototype.visit = function (visitor) {\n let c, i, n;\n if (visitor(this)) return 1;\n\n for (c = children(this), i = 0, n = c.length; i < n; ++i) {\n if (c[i].visit(visitor)) return 1;\n }\n};\n\nfunction children(node) {\n switch (node.type) {\n case ArrayExpression:\n return node.elements;\n\n case BinaryExpression:\n case LogicalExpression:\n return [node.left, node.right];\n\n case CallExpression:\n return [node.callee].concat(node.arguments);\n\n case ConditionalExpression:\n return [node.test, node.consequent, node.alternate];\n\n case MemberExpression:\n return [node.object, node.property];\n\n case ObjectExpression:\n return node.properties;\n\n case Property:\n return [node.key, node.value];\n\n case UnaryExpression:\n return [node.argument];\n\n case Identifier:\n case Literal:\n case RawCode:\n default:\n return [];\n }\n}\n\n/*\n The following expression parser is based on Esprima (http://esprima.org/).\n Original header comment and license for Esprima is included here:\n\n Copyright (C) 2013 Ariya Hidayat \n Copyright (C) 2013 Thaddee Tyl \n Copyright (C) 2013 Mathias Bynens \n Copyright (C) 2012 Ariya Hidayat \n Copyright (C) 2012 Mathias Bynens \n Copyright (C) 2012 Joost-Wim Boekesteijn \n Copyright (C) 2012 Kris Kowal \n Copyright (C) 2012 Yusuke Suzuki \n Copyright (C) 2012 Arpad Borsos \n Copyright (C) 2011 Ariya Hidayat \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\nvar TokenName, source, index, length, lookahead;\nvar TokenBooleanLiteral = 1,\n TokenEOF = 2,\n TokenIdentifier = 3,\n TokenKeyword = 4,\n TokenNullLiteral = 5,\n TokenNumericLiteral = 6,\n TokenPunctuator = 7,\n TokenStringLiteral = 8,\n TokenRegularExpression = 9;\nTokenName = {};\nTokenName[TokenBooleanLiteral] = 'Boolean';\nTokenName[TokenEOF] = '';\nTokenName[TokenIdentifier] = 'Identifier';\nTokenName[TokenKeyword] = 'Keyword';\nTokenName[TokenNullLiteral] = 'Null';\nTokenName[TokenNumericLiteral] = 'Numeric';\nTokenName[TokenPunctuator] = 'Punctuator';\nTokenName[TokenStringLiteral] = 'String';\nTokenName[TokenRegularExpression] = 'RegularExpression';\nvar SyntaxArrayExpression = 'ArrayExpression',\n SyntaxBinaryExpression = 'BinaryExpression',\n SyntaxCallExpression = 'CallExpression',\n SyntaxConditionalExpression = 'ConditionalExpression',\n SyntaxIdentifier = 'Identifier',\n SyntaxLiteral = 'Literal',\n SyntaxLogicalExpression = 'LogicalExpression',\n SyntaxMemberExpression = 'MemberExpression',\n SyntaxObjectExpression = 'ObjectExpression',\n SyntaxProperty = 'Property',\n SyntaxUnaryExpression = 'UnaryExpression'; // Error messages should be identical to V8.\n\nvar MessageUnexpectedToken = 'Unexpected token %0',\n MessageUnexpectedNumber = 'Unexpected number',\n MessageUnexpectedString = 'Unexpected string',\n MessageUnexpectedIdentifier = 'Unexpected identifier',\n MessageUnexpectedReserved = 'Unexpected reserved word',\n MessageUnexpectedEOS = 'Unexpected end of input',\n MessageInvalidRegExp = 'Invalid regular expression',\n MessageUnterminatedRegExp = 'Invalid regular expression: missing /',\n MessageStrictOctalLiteral = 'Octal literals are not allowed in strict mode.',\n MessageStrictDuplicateProperty = 'Duplicate data property in object literal not allowed in strict mode';\nvar ILLEGAL = 'ILLEGAL',\n DISABLED = 'Disabled.'; // See also tools/generate-unicode-regex.py.\n\nvar RegexNonAsciiIdentifierStart = new RegExp('[\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0370-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0620-\\\\u064A\\\\u066E\\\\u066F\\\\u0671-\\\\u06D3\\\\u06D5\\\\u06E5\\\\u06E6\\\\u06EE\\\\u06EF\\\\u06FA-\\\\u06FC\\\\u06FF\\\\u0710\\\\u0712-\\\\u072F\\\\u074D-\\\\u07A5\\\\u07B1\\\\u07CA-\\\\u07EA\\\\u07F4\\\\u07F5\\\\u07FA\\\\u0800-\\\\u0815\\\\u081A\\\\u0824\\\\u0828\\\\u0840-\\\\u0858\\\\u08A0-\\\\u08B2\\\\u0904-\\\\u0939\\\\u093D\\\\u0950\\\\u0958-\\\\u0961\\\\u0971-\\\\u0980\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BD\\\\u09CE\\\\u09DC\\\\u09DD\\\\u09DF-\\\\u09E1\\\\u09F0\\\\u09F1\\\\u0A05-\\\\u0A0A\\\\u0A0F\\\\u0A10\\\\u0A13-\\\\u0A28\\\\u0A2A-\\\\u0A30\\\\u0A32\\\\u0A33\\\\u0A35\\\\u0A36\\\\u0A38\\\\u0A39\\\\u0A59-\\\\u0A5C\\\\u0A5E\\\\u0A72-\\\\u0A74\\\\u0A85-\\\\u0A8D\\\\u0A8F-\\\\u0A91\\\\u0A93-\\\\u0AA8\\\\u0AAA-\\\\u0AB0\\\\u0AB2\\\\u0AB3\\\\u0AB5-\\\\u0AB9\\\\u0ABD\\\\u0AD0\\\\u0AE0\\\\u0AE1\\\\u0B05-\\\\u0B0C\\\\u0B0F\\\\u0B10\\\\u0B13-\\\\u0B28\\\\u0B2A-\\\\u0B30\\\\u0B32\\\\u0B33\\\\u0B35-\\\\u0B39\\\\u0B3D\\\\u0B5C\\\\u0B5D\\\\u0B5F-\\\\u0B61\\\\u0B71\\\\u0B83\\\\u0B85-\\\\u0B8A\\\\u0B8E-\\\\u0B90\\\\u0B92-\\\\u0B95\\\\u0B99\\\\u0B9A\\\\u0B9C\\\\u0B9E\\\\u0B9F\\\\u0BA3\\\\u0BA4\\\\u0BA8-\\\\u0BAA\\\\u0BAE-\\\\u0BB9\\\\u0BD0\\\\u0C05-\\\\u0C0C\\\\u0C0E-\\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\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1711\\\\u1720-\\\\u1731\\\\u1740-\\\\u1751\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1780-\\\\u17B3\\\\u17D7\\\\u17DC\\\\u1820-\\\\u1877\\\\u1880-\\\\u18A8\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1950-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19C1-\\\\u19C7\\\\u1A00-\\\\u1A16\\\\u1A20-\\\\u1A54\\\\u1AA7\\\\u1B05-\\\\u1B33\\\\u1B45-\\\\u1B4B\\\\u1B83-\\\\u1BA0\\\\u1BAE\\\\u1BAF\\\\u1BBA-\\\\u1BE5\\\\u1C00-\\\\u1C23\\\\u1C4D-\\\\u1C4F\\\\u1C5A-\\\\u1C7D\\\\u1CE9-\\\\u1CEC\\\\u1CEE-\\\\u1CF1\\\\u1CF5\\\\u1CF6\\\\u1D00-\\\\u1DBF\\\\u1E00-\\\\u1F15\\\\u1F18-\\\\u1F1D\\\\u1F20-\\\\u1F45\\\\u1F48-\\\\u1F4D\\\\u1F50-\\\\u1F57\\\\u1F59\\\\u1F5B\\\\u1F5D\\\\u1F5F-\\\\u1F7D\\\\u1F80-\\\\u1FB4\\\\u1FB6-\\\\u1FBC\\\\u1FBE\\\\u1FC2-\\\\u1FC4\\\\u1FC6-\\\\u1FCC\\\\u1FD0-\\\\u1FD3\\\\u1FD6-\\\\u1FDB\\\\u1FE0-\\\\u1FEC\\\\u1FF2-\\\\u1FF4\\\\u1FF6-\\\\u1FFC\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u2102\\\\u2107\\\\u210A-\\\\u2113\\\\u2115\\\\u2119-\\\\u211D\\\\u2124\\\\u2126\\\\u2128\\\\u212A-\\\\u212D\\\\u212F-\\\\u2139\\\\u213C-\\\\u213F\\\\u2145-\\\\u2149\\\\u214E\\\\u2160-\\\\u2188\\\\u2C00-\\\\u2C2E\\\\u2C30-\\\\u2C5E\\\\u2C60-\\\\u2CE4\\\\u2CEB-\\\\u2CEE\\\\u2CF2\\\\u2CF3\\\\u2D00-\\\\u2D25\\\\u2D27\\\\u2D2D\\\\u2D30-\\\\u2D67\\\\u2D6F\\\\u2D80-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2E2F\\\\u3005-\\\\u3007\\\\u3021-\\\\u3029\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FCC\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA61F\\\\uA62A\\\\uA62B\\\\uA640-\\\\uA66E\\\\uA67F-\\\\uA69D\\\\uA6A0-\\\\uA6EF\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B-\\\\uA78E\\\\uA790-\\\\uA7AD\\\\uA7B0\\\\uA7B1\\\\uA7F7-\\\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\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]'),\n // eslint-disable-next-line no-misleading-character-class\nRegexNonAsciiIdentifierPart = new RegExp('[\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0300-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u0483-\\\\u0487\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u0591-\\\\u05BD\\\\u05BF\\\\u05C1\\\\u05C2\\\\u05C4\\\\u05C5\\\\u05C7\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0610-\\\\u061A\\\\u0620-\\\\u0669\\\\u066E-\\\\u06D3\\\\u06D5-\\\\u06DC\\\\u06DF-\\\\u06E8\\\\u06EA-\\\\u06FC\\\\u06FF\\\\u0710-\\\\u074A\\\\u074D-\\\\u07B1\\\\u07C0-\\\\u07F5\\\\u07FA\\\\u0800-\\\\u082D\\\\u0840-\\\\u085B\\\\u08A0-\\\\u08B2\\\\u08E4-\\\\u0963\\\\u0966-\\\\u096F\\\\u0971-\\\\u0983\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BC-\\\\u09C4\\\\u09C7\\\\u09C8\\\\u09CB-\\\\u09CE\\\\u09D7\\\\u09DC\\\\u09DD\\\\u09DF-\\\\u09E3\\\\u09E6-\\\\u09F1\\\\u0A01-\\\\u0A03\\\\u0A05-\\\\u0A0A\\\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EC4\\\\u0EC6\\\\u0EC8-\\\\u0ECD\\\\u0ED0-\\\\u0ED9\\\\u0EDC-\\\\u0EDF\\\\u0F00\\\\u0F18\\\\u0F19\\\\u0F20-\\\\u0F29\\\\u0F35\\\\u0F37\\\\u0F39\\\\u0F3E-\\\\u0F47\\\\u0F49-\\\\u0F6C\\\\u0F71-\\\\u0F84\\\\u0F86-\\\\u0F97\\\\u0F99-\\\\u0FBC\\\\u0FC6\\\\u1000-\\\\u1049\\\\u1050-\\\\u109D\\\\u10A0-\\\\u10C5\\\\u10C7\\\\u10CD\\\\u10D0-\\\\u10FA\\\\u10FC-\\\\u1248\\\\u124A-\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u135D-\\\\u135F\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1714\\\\u1720-\\\\u1734\\\\u1740-\\\\u1753\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1772\\\\u1773\\\\u1780-\\\\u17D3\\\\u17D7\\\\u17DC\\\\u17DD\\\\u17E0-\\\\u17E9\\\\u180B-\\\\u180D\\\\u1810-\\\\u1819\\\\u1820-\\\\u1877\\\\u1880-\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1920-\\\\u192B\\\\u1930-\\\\u193B\\\\u1946-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19B0-\\\\u19C9\\\\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\\\\u2D6F\\\\u2D7F-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2DE0-\\\\u2DFF\\\\u2E2F\\\\u3005-\\\\u3007\\\\u3021-\\\\u302F\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u3099\\\\u309A\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FCC\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA62B\\\\uA640-\\\\uA66F\\\\uA674-\\\\uA67D\\\\uA67F-\\\\uA69D\\\\uA69F-\\\\uA6F1\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B-\\\\uA78E\\\\uA790-\\\\uA7AD\\\\uA7B0\\\\uA7B1\\\\uA7F7-\\\\uA827\\\\uA840-\\\\uA873\\\\uA880-\\\\uA8C4\\\\uA8D0-\\\\uA8D9\\\\uA8E0-\\\\uA8F7\\\\uA8FB\\\\uA900-\\\\uA92D\\\\uA930-\\\\uA953\\\\uA960-\\\\uA97C\\\\uA980-\\\\uA9C0\\\\uA9CF-\\\\uA9D9\\\\uA9E0-\\\\uA9FE\\\\uAA00-\\\\uAA36\\\\uAA40-\\\\uAA4D\\\\uAA50-\\\\uAA59\\\\uAA60-\\\\uAA76\\\\uAA7A-\\\\uAAC2\\\\uAADB-\\\\uAADD\\\\uAAE0-\\\\uAAEF\\\\uAAF2-\\\\uAAF6\\\\uAB01-\\\\uAB06\\\\uAB09-\\\\uAB0E\\\\uAB11-\\\\uAB16\\\\uAB20-\\\\uAB26\\\\uAB28-\\\\uAB2E\\\\uAB30-\\\\uAB5A\\\\uAB5C-\\\\uAB5F\\\\uAB64\\\\uAB65\\\\uABC0-\\\\uABEA\\\\uABEC\\\\uABED\\\\uABF0-\\\\uABF9\\\\uAC00-\\\\uD7A3\\\\uD7B0-\\\\uD7C6\\\\uD7CB-\\\\uD7FB\\\\uF900-\\\\uFA6D\\\\uFA70-\\\\uFAD9\\\\uFB00-\\\\uFB06\\\\uFB13-\\\\uFB17\\\\uFB1D-\\\\uFB28\\\\uFB2A-\\\\uFB36\\\\uFB38-\\\\uFB3C\\\\uFB3E\\\\uFB40\\\\uFB41\\\\uFB43\\\\uFB44\\\\uFB46-\\\\uFBB1\\\\uFBD3-\\\\uFD3D\\\\uFD50-\\\\uFD8F\\\\uFD92-\\\\uFDC7\\\\uFDF0-\\\\uFDFB\\\\uFE00-\\\\uFE0F\\\\uFE20-\\\\uFE2D\\\\uFE33\\\\uFE34\\\\uFE4D-\\\\uFE4F\\\\uFE70-\\\\uFE74\\\\uFE76-\\\\uFEFC\\\\uFF10-\\\\uFF19\\\\uFF21-\\\\uFF3A\\\\uFF3F\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]'); // Ensure the condition is true, otherwise throw an error.\n// This is only to have a better contract semantic, i.e. another safety net\n// to catch a logic error. The condition shall be fulfilled in normal case.\n// Do NOT use this to enforce a certain condition on any user input.\n\nfunction assert(condition, message) {\n /* istanbul ignore next */\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n}\n\nfunction isDecimalDigit(ch) {\n return ch >= 0x30 && ch <= 0x39; // 0..9\n}\n\nfunction isHexDigit(ch) {\n return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;\n}\n\nfunction isOctalDigit(ch) {\n return '01234567'.indexOf(ch) >= 0;\n} // 7.2 White Space\n\n\nfunction isWhiteSpace(ch) {\n return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0;\n} // 7.3 Line Terminators\n\n\nfunction isLineTerminator(ch) {\n return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;\n} // 7.6 Identifier Names and Identifiers\n\n\nfunction isIdentifierStart(ch) {\n return ch === 0x24 || ch === 0x5F || // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A || // A..Z\n ch >= 0x61 && ch <= 0x7A || // a..z\n ch === 0x5C || // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierStart.test(String.fromCharCode(ch));\n}\n\nfunction isIdentifierPart(ch) {\n return ch === 0x24 || ch === 0x5F || // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A || // A..Z\n ch >= 0x61 && ch <= 0x7A || // a..z\n ch >= 0x30 && ch <= 0x39 || // 0..9\n ch === 0x5C || // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierPart.test(String.fromCharCode(ch));\n} // 7.6.1.1 Keywords\n\n\nconst keywords = {\n 'if': 1,\n 'in': 1,\n 'do': 1,\n 'var': 1,\n 'for': 1,\n 'new': 1,\n 'try': 1,\n 'let': 1,\n 'this': 1,\n 'else': 1,\n 'case': 1,\n 'void': 1,\n 'with': 1,\n 'enum': 1,\n 'while': 1,\n 'break': 1,\n 'catch': 1,\n 'throw': 1,\n 'const': 1,\n 'yield': 1,\n 'class': 1,\n 'super': 1,\n 'return': 1,\n 'typeof': 1,\n 'delete': 1,\n 'switch': 1,\n 'export': 1,\n 'import': 1,\n 'public': 1,\n 'static': 1,\n 'default': 1,\n 'finally': 1,\n 'extends': 1,\n 'package': 1,\n 'private': 1,\n 'function': 1,\n 'continue': 1,\n 'debugger': 1,\n 'interface': 1,\n 'protected': 1,\n 'instanceof': 1,\n 'implements': 1\n};\n\nfunction skipComment() {\n while (index < length) {\n const ch = source.charCodeAt(index);\n\n if (isWhiteSpace(ch) || isLineTerminator(ch)) {\n ++index;\n } else {\n break;\n }\n }\n}\n\nfunction scanHexEscape(prefix) {\n var i,\n len,\n ch,\n code = 0;\n len = prefix === 'u' ? 4 : 2;\n\n for (i = 0; i < len; ++i) {\n if (index < length && isHexDigit(source[index])) {\n ch = source[index++];\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n } else {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n\n return String.fromCharCode(code);\n}\n\nfunction scanUnicodeCodePointEscape() {\n var ch, code, cu1, cu2;\n ch = source[index];\n code = 0; // At least, one hex digit is required.\n\n if (ch === '}') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n while (index < length) {\n ch = source[index++];\n\n if (!isHexDigit(ch)) {\n break;\n }\n\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n }\n\n if (code > 0x10FFFF || ch !== '}') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } // UTF-16 Encoding\n\n\n if (code <= 0xFFFF) {\n return String.fromCharCode(code);\n }\n\n cu1 = (code - 0x10000 >> 10) + 0xD800;\n cu2 = (code - 0x10000 & 1023) + 0xDC00;\n return String.fromCharCode(cu1, cu2);\n}\n\nfunction getEscapedIdentifier() {\n var ch, id;\n ch = source.charCodeAt(index++);\n id = String.fromCharCode(ch); // '\\u' (U+005C, U+0075) denotes an escaped character.\n\n if (ch === 0x5C) {\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n ++index;\n ch = scanHexEscape('u');\n\n if (!ch || ch === '\\\\' || !isIdentifierStart(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n id = ch;\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n\n if (!isIdentifierPart(ch)) {\n break;\n }\n\n ++index;\n id += String.fromCharCode(ch); // '\\u' (U+005C, U+0075) denotes an escaped character.\n\n if (ch === 0x5C) {\n id = id.substr(0, id.length - 1);\n\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n ++index;\n ch = scanHexEscape('u');\n\n if (!ch || ch === '\\\\' || !isIdentifierPart(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n id += ch;\n }\n }\n\n return id;\n}\n\nfunction getIdentifier() {\n var start, ch;\n start = index++;\n\n while (index < length) {\n ch = source.charCodeAt(index);\n\n if (ch === 0x5C) {\n // Blackslash (U+005C) marks Unicode escape sequence.\n index = start;\n return getEscapedIdentifier();\n }\n\n if (isIdentifierPart(ch)) {\n ++index;\n } else {\n break;\n }\n }\n\n return source.slice(start, index);\n}\n\nfunction scanIdentifier() {\n var start, id, type;\n start = index; // Backslash (U+005C) starts an escaped character.\n\n id = source.charCodeAt(index) === 0x5C ? getEscapedIdentifier() : getIdentifier(); // There is no keyword or literal with only one character.\n // Thus, it must be an identifier.\n\n if (id.length === 1) {\n type = TokenIdentifier;\n } else if (keywords.hasOwnProperty(id)) {\n // eslint-disable-line no-prototype-builtins\n type = TokenKeyword;\n } else if (id === 'null') {\n type = TokenNullLiteral;\n } else if (id === 'true' || id === 'false') {\n type = TokenBooleanLiteral;\n } else {\n type = TokenIdentifier;\n }\n\n return {\n type: type,\n value: id,\n start: start,\n end: index\n };\n} // 7.7 Punctuators\n\n\nfunction scanPunctuator() {\n var start = index,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2,\n ch3,\n ch4;\n\n switch (code) {\n // Check for most common single-character punctuators.\n case 0x2E: // . dot\n\n case 0x28: // ( open bracket\n\n case 0x29: // ) close bracket\n\n case 0x3B: // ; semicolon\n\n case 0x2C: // , comma\n\n case 0x7B: // { open curly brace\n\n case 0x7D: // } close curly brace\n\n case 0x5B: // [\n\n case 0x5D: // ]\n\n case 0x3A: // :\n\n case 0x3F: // ?\n\n case 0x7E:\n // ~\n ++index;\n return {\n type: TokenPunctuator,\n value: String.fromCharCode(code),\n start: start,\n end: index\n };\n\n default:\n code2 = source.charCodeAt(index + 1); // '=' (U+003D) marks an assignment or comparison operator.\n\n if (code2 === 0x3D) {\n switch (code) {\n case 0x2B: // +\n\n case 0x2D: // -\n\n case 0x2F: // /\n\n case 0x3C: // <\n\n case 0x3E: // >\n\n case 0x5E: // ^\n\n case 0x7C: // |\n\n case 0x25: // %\n\n case 0x26: // &\n\n case 0x2A:\n // *\n index += 2;\n return {\n type: TokenPunctuator,\n value: String.fromCharCode(code) + String.fromCharCode(code2),\n start: start,\n end: index\n };\n\n case 0x21: // !\n\n case 0x3D:\n // =\n index += 2; // !== and ===\n\n if (source.charCodeAt(index) === 0x3D) {\n ++index;\n }\n\n return {\n type: TokenPunctuator,\n value: source.slice(start, index),\n start: start,\n end: index\n };\n }\n }\n\n } // 4-character punctuator: >>>=\n\n\n ch4 = source.substr(index, 4);\n\n if (ch4 === '>>>=') {\n index += 4;\n return {\n type: TokenPunctuator,\n value: ch4,\n start: start,\n end: index\n };\n } // 3-character punctuators: === !== >>> <<= >>=\n\n\n ch3 = ch4.substr(0, 3);\n\n if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {\n index += 3;\n return {\n type: TokenPunctuator,\n value: ch3,\n start: start,\n end: index\n };\n } // Other 2-character punctuators: ++ -- << >> && ||\n\n\n ch2 = ch3.substr(0, 2);\n\n if (ch1 === ch2[1] && '+-<>&|'.indexOf(ch1) >= 0 || ch2 === '=>') {\n index += 2;\n return {\n type: TokenPunctuator,\n value: ch2,\n start: start,\n end: index\n };\n }\n\n if (ch2 === '//') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } // 1-character punctuators: < > = ! + - * % & | ^ /\n\n\n if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n ++index;\n return {\n type: TokenPunctuator,\n value: ch1,\n start: start,\n end: index\n };\n }\n\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n} // 7.8.3 Numeric Literals\n\n\nfunction scanHexLiteral(start) {\n let number = '';\n\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n\n number += source[index++];\n }\n\n if (number.length === 0) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenNumericLiteral,\n value: parseInt('0x' + number, 16),\n start: start,\n end: index\n };\n}\n\nfunction scanOctalLiteral(start) {\n let number = '0' + source[index++];\n\n while (index < length) {\n if (!isOctalDigit(source[index])) {\n break;\n }\n\n number += source[index++];\n }\n\n if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenNumericLiteral,\n value: parseInt(number, 8),\n octal: true,\n start: start,\n end: index\n };\n}\n\nfunction scanNumericLiteral() {\n var number, start, ch;\n ch = source[index];\n assert(isDecimalDigit(ch.charCodeAt(0)) || ch === '.', 'Numeric literal must start with a decimal digit or a decimal point');\n start = index;\n number = '';\n\n if (ch !== '.') {\n number = source[index++];\n ch = source[index]; // Hex number starts with '0x'.\n // Octal number starts with '0'.\n\n if (number === '0') {\n if (ch === 'x' || ch === 'X') {\n ++index;\n return scanHexLiteral(start);\n }\n\n if (isOctalDigit(ch)) {\n return scanOctalLiteral(start);\n } // decimal number starts with '0' such as '09' is illegal.\n\n\n if (ch && isDecimalDigit(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n\n ch = source[index];\n }\n\n if (ch === '.') {\n number += source[index++];\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n\n ch = source[index];\n }\n\n if (ch === 'e' || ch === 'E') {\n number += source[index++];\n ch = source[index];\n\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n\n if (isDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenNumericLiteral,\n value: parseFloat(number),\n start: start,\n end: index\n };\n} // 7.8.4 String Literals\n\n\nfunction scanStringLiteral() {\n var str = '',\n quote,\n start,\n ch,\n code,\n octal = false;\n quote = source[index];\n assert(quote === '\\'' || quote === '\"', 'String literal must starts with a quote');\n start = index;\n ++index;\n\n while (index < length) {\n ch = source[index++];\n\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n\n if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'u':\n case 'x':\n if (source[index] === '{') {\n ++index;\n str += scanUnicodeCodePointEscape();\n } else {\n str += scanHexEscape(ch);\n }\n\n break;\n\n case 'n':\n str += '\\n';\n break;\n\n case 'r':\n str += '\\r';\n break;\n\n case 't':\n str += '\\t';\n break;\n\n case 'b':\n str += '\\b';\n break;\n\n case 'f':\n str += '\\f';\n break;\n\n case 'v':\n str += '\\x0B';\n break;\n\n default:\n if (isOctalDigit(ch)) {\n code = '01234567'.indexOf(ch); // \\0 is not octal escape sequence\n\n if (code !== 0) {\n octal = true;\n }\n\n if (index < length && isOctalDigit(source[index])) {\n octal = true;\n code = code * 8 + '01234567'.indexOf(source[index++]); // 3 digits are only allowed when string starts\n // with 0, 1, 2, 3\n\n if ('0123'.indexOf(ch) >= 0 && index < length && isOctalDigit(source[index])) {\n code = code * 8 + '01234567'.indexOf(source[index++]);\n }\n }\n\n str += String.fromCharCode(code);\n } else {\n str += ch;\n }\n\n break;\n }\n } else {\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n\n if (quote !== '') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenStringLiteral,\n value: str,\n octal: octal,\n start: start,\n end: index\n };\n}\n\nfunction testRegExp(pattern, flags) {\n let tmp = pattern;\n\n if (flags.indexOf('u') >= 0) {\n // Replace each astral symbol and every Unicode code point\n // escape sequence with a single ASCII symbol to avoid throwing on\n // regular expressions that are only valid in combination with the\n // `/u` flag.\n // Note: replacing with the ASCII symbol `x` might cause false\n // negatives in unlikely scenarios. For example, `[\\u{61}-b]` is a\n // perfectly valid pattern that is equivalent to `[a-b]`, but it\n // would be replaced by `[x-b]` which throws an error.\n tmp = tmp.replace(/\\\\u\\{([0-9a-fA-F]+)\\}/g, ($0, $1) => {\n if (parseInt($1, 16) <= 0x10FFFF) {\n return 'x';\n }\n\n throwError({}, MessageInvalidRegExp);\n }).replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g, 'x');\n } // First, detect invalid regular expressions.\n\n\n try {\n new RegExp(tmp);\n } catch (e) {\n throwError({}, MessageInvalidRegExp);\n } // Return a regular expression object for this pattern-flag pair, or\n // `null` in case the current environment doesn't support the flags it\n // uses.\n\n\n try {\n return new RegExp(pattern, flags);\n } catch (exception) {\n return null;\n }\n}\n\nfunction scanRegExpBody() {\n var ch, str, classMarker, terminated, body;\n ch = source[index];\n assert(ch === '/', 'Regular expression literal must start with a slash');\n str = source[index++];\n classMarker = false;\n terminated = false;\n\n while (index < length) {\n ch = source[index++];\n str += ch;\n\n if (ch === '\\\\') {\n ch = source[index++]; // ECMA-262 7.8.5\n\n if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, MessageUnterminatedRegExp);\n }\n\n str += ch;\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, MessageUnterminatedRegExp);\n } else if (classMarker) {\n if (ch === ']') {\n classMarker = false;\n }\n } else {\n if (ch === '/') {\n terminated = true;\n break;\n } else if (ch === '[') {\n classMarker = true;\n }\n }\n }\n\n if (!terminated) {\n throwError({}, MessageUnterminatedRegExp);\n } // Exclude leading and trailing slash.\n\n\n body = str.substr(1, str.length - 2);\n return {\n value: body,\n literal: str\n };\n}\n\nfunction scanRegExpFlags() {\n var ch, str, flags;\n str = '';\n flags = '';\n\n while (index < length) {\n ch = source[index];\n\n if (!isIdentifierPart(ch.charCodeAt(0))) {\n break;\n }\n\n ++index;\n\n if (ch === '\\\\' && index < length) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } else {\n flags += ch;\n str += ch;\n }\n }\n\n if (flags.search(/[^gimuy]/g) >= 0) {\n throwError({}, MessageInvalidRegExp, flags);\n }\n\n return {\n value: flags,\n literal: str\n };\n}\n\nfunction scanRegExp() {\n var start, body, flags, value;\n lookahead = null;\n skipComment();\n start = index;\n body = scanRegExpBody();\n flags = scanRegExpFlags();\n value = testRegExp(body.value, flags.value);\n return {\n literal: body.literal + flags.literal,\n value: value,\n regex: {\n pattern: body.value,\n flags: flags.value\n },\n start: start,\n end: index\n };\n}\n\nfunction isIdentifierName(token) {\n return token.type === TokenIdentifier || token.type === TokenKeyword || token.type === TokenBooleanLiteral || token.type === TokenNullLiteral;\n}\n\nfunction advance() {\n skipComment();\n\n if (index >= length) {\n return {\n type: TokenEOF,\n start: index,\n end: index\n };\n }\n\n const ch = source.charCodeAt(index);\n\n if (isIdentifierStart(ch)) {\n return scanIdentifier();\n } // Very common: ( and ) and ;\n\n\n if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {\n return scanPunctuator();\n } // String literal starts with single quote (U+0027) or double quote (U+0022).\n\n\n if (ch === 0x27 || ch === 0x22) {\n return scanStringLiteral();\n } // Dot (.) U+002E can also start a floating-point number, hence the need\n // to check the next character.\n\n\n if (ch === 0x2E) {\n if (isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNumericLiteral();\n }\n\n return scanPunctuator();\n }\n\n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n\n return scanPunctuator();\n}\n\nfunction lex() {\n const token = lookahead;\n index = token.end;\n lookahead = advance();\n index = token.end;\n return token;\n}\n\nfunction peek() {\n const pos = index;\n lookahead = advance();\n index = pos;\n}\n\nfunction finishArrayExpression(elements) {\n const node = new ASTNode(SyntaxArrayExpression);\n node.elements = elements;\n return node;\n}\n\nfunction finishBinaryExpression(operator, left, right) {\n const node = new ASTNode(operator === '||' || operator === '&&' ? SyntaxLogicalExpression : SyntaxBinaryExpression);\n node.operator = operator;\n node.left = left;\n node.right = right;\n return node;\n}\n\nfunction finishCallExpression(callee, args) {\n const node = new ASTNode(SyntaxCallExpression);\n node.callee = callee;\n node.arguments = args;\n return node;\n}\n\nfunction finishConditionalExpression(test, consequent, alternate) {\n const node = new ASTNode(SyntaxConditionalExpression);\n node.test = test;\n node.consequent = consequent;\n node.alternate = alternate;\n return node;\n}\n\nfunction finishIdentifier(name) {\n const node = new ASTNode(SyntaxIdentifier);\n node.name = name;\n return node;\n}\n\nfunction finishLiteral(token) {\n const node = new ASTNode(SyntaxLiteral);\n node.value = token.value;\n node.raw = source.slice(token.start, token.end);\n\n if (token.regex) {\n if (node.raw === '//') {\n node.raw = '/(?:)/';\n }\n\n node.regex = token.regex;\n }\n\n return node;\n}\n\nfunction finishMemberExpression(accessor, object, property) {\n const node = new ASTNode(SyntaxMemberExpression);\n node.computed = accessor === '[';\n node.object = object;\n node.property = property;\n if (!node.computed) property.member = true;\n return node;\n}\n\nfunction finishObjectExpression(properties) {\n const node = new ASTNode(SyntaxObjectExpression);\n node.properties = properties;\n return node;\n}\n\nfunction finishProperty(kind, key, value) {\n const node = new ASTNode(SyntaxProperty);\n node.key = key;\n node.value = value;\n node.kind = kind;\n return node;\n}\n\nfunction finishUnaryExpression(operator, argument) {\n const node = new ASTNode(SyntaxUnaryExpression);\n node.operator = operator;\n node.argument = argument;\n node.prefix = true;\n return node;\n} // Throw an exception\n\n\nfunction throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(/%(\\d)/g, (whole, index) => {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n });\n error = new Error(msg);\n error.index = index;\n error.description = msg;\n throw error;\n} // Throw an exception because of the token.\n\n\nfunction throwUnexpected(token) {\n if (token.type === TokenEOF) {\n throwError(token, MessageUnexpectedEOS);\n }\n\n if (token.type === TokenNumericLiteral) {\n throwError(token, MessageUnexpectedNumber);\n }\n\n if (token.type === TokenStringLiteral) {\n throwError(token, MessageUnexpectedString);\n }\n\n if (token.type === TokenIdentifier) {\n throwError(token, MessageUnexpectedIdentifier);\n }\n\n if (token.type === TokenKeyword) {\n throwError(token, MessageUnexpectedReserved);\n } // BooleanLiteral, NullLiteral, or Punctuator.\n\n\n throwError(token, MessageUnexpectedToken, token.value);\n} // Expect the next token to match the specified punctuator.\n// If not, an exception will be thrown.\n\n\nfunction expect(value) {\n const token = lex();\n\n if (token.type !== TokenPunctuator || token.value !== value) {\n throwUnexpected(token);\n }\n} // Return true if the next token matches the specified punctuator.\n\n\nfunction match(value) {\n return lookahead.type === TokenPunctuator && lookahead.value === value;\n} // Return true if the next token matches the specified keyword\n\n\nfunction matchKeyword(keyword) {\n return lookahead.type === TokenKeyword && lookahead.value === keyword;\n} // 11.1.4 Array Initialiser\n\n\nfunction parseArrayInitialiser() {\n const elements = [];\n index = lookahead.start;\n expect('[');\n\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elements.push(parseConditionalExpression());\n\n if (!match(']')) {\n expect(',');\n }\n }\n }\n\n lex();\n return finishArrayExpression(elements);\n} // 11.1.5 Object Initialiser\n\n\nfunction parseObjectPropertyKey() {\n index = lookahead.start;\n const token = lex(); // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n\n if (token.type === TokenStringLiteral || token.type === TokenNumericLiteral) {\n if (token.octal) {\n throwError(token, MessageStrictOctalLiteral);\n }\n\n return finishLiteral(token);\n }\n\n return finishIdentifier(token.value);\n}\n\nfunction parseObjectProperty() {\n var token, key, id, value;\n index = lookahead.start;\n token = lookahead;\n\n if (token.type === TokenIdentifier) {\n id = parseObjectPropertyKey();\n expect(':');\n value = parseConditionalExpression();\n return finishProperty('init', id, value);\n }\n\n if (token.type === TokenEOF || token.type === TokenPunctuator) {\n throwUnexpected(token);\n } else {\n key = parseObjectPropertyKey();\n expect(':');\n value = parseConditionalExpression();\n return finishProperty('init', key, value);\n }\n}\n\nfunction parseObjectInitialiser() {\n var properties = [],\n property,\n name,\n key,\n map = {},\n toString = String;\n index = lookahead.start;\n expect('{');\n\n while (!match('}')) {\n property = parseObjectProperty();\n\n if (property.key.type === SyntaxIdentifier) {\n name = property.key.name;\n } else {\n name = toString(property.key.value);\n }\n\n key = '$' + name;\n\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n throwError({}, MessageStrictDuplicateProperty);\n } else {\n map[key] = true;\n }\n\n properties.push(property);\n\n if (!match('}')) {\n expect(',');\n }\n }\n\n expect('}');\n return finishObjectExpression(properties);\n} // 11.1.6 The Grouping Operator\n\n\nfunction parseGroupExpression() {\n expect('(');\n const expr = parseExpression();\n expect(')');\n return expr;\n} // 11.1 Primary Expressions\n\n\nconst legalKeywords = {\n 'if': 1\n};\n\nfunction parsePrimaryExpression() {\n var type, token, expr;\n\n if (match('(')) {\n return parseGroupExpression();\n }\n\n if (match('[')) {\n return parseArrayInitialiser();\n }\n\n if (match('{')) {\n return parseObjectInitialiser();\n }\n\n type = lookahead.type;\n index = lookahead.start;\n\n if (type === TokenIdentifier || legalKeywords[lookahead.value]) {\n expr = finishIdentifier(lex().value);\n } else if (type === TokenStringLiteral || type === TokenNumericLiteral) {\n if (lookahead.octal) {\n throwError(lookahead, MessageStrictOctalLiteral);\n }\n\n expr = finishLiteral(lex());\n } else if (type === TokenKeyword) {\n throw new Error(DISABLED);\n } else if (type === TokenBooleanLiteral) {\n token = lex();\n token.value = token.value === 'true';\n expr = finishLiteral(token);\n } else if (type === TokenNullLiteral) {\n token = lex();\n token.value = null;\n expr = finishLiteral(token);\n } else if (match('/') || match('/=')) {\n expr = finishLiteral(scanRegExp());\n peek();\n } else {\n throwUnexpected(lex());\n }\n\n return expr;\n} // 11.2 Left-Hand-Side Expressions\n\n\nfunction parseArguments() {\n const args = [];\n expect('(');\n\n if (!match(')')) {\n while (index < length) {\n args.push(parseConditionalExpression());\n\n if (match(')')) {\n break;\n }\n\n expect(',');\n }\n }\n\n expect(')');\n return args;\n}\n\nfunction parseNonComputedProperty() {\n index = lookahead.start;\n const token = lex();\n\n if (!isIdentifierName(token)) {\n throwUnexpected(token);\n }\n\n return finishIdentifier(token.value);\n}\n\nfunction parseNonComputedMember() {\n expect('.');\n return parseNonComputedProperty();\n}\n\nfunction parseComputedMember() {\n expect('[');\n const expr = parseExpression();\n expect(']');\n return expr;\n}\n\nfunction parseLeftHandSideExpressionAllowCall() {\n var expr, args, property;\n expr = parsePrimaryExpression();\n\n for (;;) {\n if (match('.')) {\n property = parseNonComputedMember();\n expr = finishMemberExpression('.', expr, property);\n } else if (match('(')) {\n args = parseArguments();\n expr = finishCallExpression(expr, args);\n } else if (match('[')) {\n property = parseComputedMember();\n expr = finishMemberExpression('[', expr, property);\n } else {\n break;\n }\n }\n\n return expr;\n} // 11.3 Postfix Expressions\n\n\nfunction parsePostfixExpression() {\n const expr = parseLeftHandSideExpressionAllowCall();\n\n if (lookahead.type === TokenPunctuator) {\n if (match('++') || match('--')) {\n throw new Error(DISABLED);\n }\n }\n\n return expr;\n} // 11.4 Unary Operators\n\n\nfunction parseUnaryExpression() {\n var token, expr;\n\n if (lookahead.type !== TokenPunctuator && lookahead.type !== TokenKeyword) {\n expr = parsePostfixExpression();\n } else if (match('++') || match('--')) {\n throw new Error(DISABLED);\n } else if (match('+') || match('-') || match('~') || match('!')) {\n token = lex();\n expr = parseUnaryExpression();\n expr = finishUnaryExpression(token.value, expr);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n throw new Error(DISABLED);\n } else {\n expr = parsePostfixExpression();\n }\n\n return expr;\n}\n\nfunction binaryPrecedence(token) {\n let prec = 0;\n\n if (token.type !== TokenPunctuator && token.type !== TokenKeyword) {\n return 0;\n }\n\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n\n case '&&':\n prec = 2;\n break;\n\n case '|':\n prec = 3;\n break;\n\n case '^':\n prec = 4;\n break;\n\n case '&':\n prec = 5;\n break;\n\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n case 'in':\n prec = 7;\n break;\n\n case '<<':\n case '>>':\n case '>>>':\n prec = 8;\n break;\n\n case '+':\n case '-':\n prec = 9;\n break;\n\n case '*':\n case '/':\n case '%':\n prec = 11;\n break;\n }\n\n return prec;\n} // 11.5 Multiplicative Operators\n// 11.6 Additive Operators\n// 11.7 Bitwise Shift Operators\n// 11.8 Relational Operators\n// 11.9 Equality Operators\n// 11.10 Binary Bitwise Operators\n// 11.11 Binary Logical Operators\n\n\nfunction parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n marker = lookahead;\n left = parseUnaryExpression();\n token = lookahead;\n prec = binaryPrecedence(token);\n\n if (prec === 0) {\n return left;\n }\n\n token.prec = prec;\n lex();\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead)) > 0) {\n // Reduce: make a binary expression from the three topmost entries.\n while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = finishBinaryExpression(operator, left, right);\n stack.push(expr);\n } // Shift.\n\n\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n } // Final reduce to clean-up the stack.\n\n\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n\n while (i > 1) {\n markers.pop();\n expr = finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n} // 11.12 Conditional Operator\n\n\nfunction parseConditionalExpression() {\n var expr, consequent, alternate;\n expr = parseBinaryExpression();\n\n if (match('?')) {\n lex();\n consequent = parseConditionalExpression();\n expect(':');\n alternate = parseConditionalExpression();\n expr = finishConditionalExpression(expr, consequent, alternate);\n }\n\n return expr;\n} // 11.14 Comma Operator\n\n\nfunction parseExpression() {\n const expr = parseConditionalExpression();\n\n if (match(',')) {\n throw new Error(DISABLED); // no sequence expressions\n }\n\n return expr;\n}\n\nfunction parser (code) {\n source = code;\n index = 0;\n length = source.length;\n lookahead = null;\n peek();\n const expr = parseExpression();\n\n if (lookahead.type !== TokenEOF) {\n throw new Error('Unexpect token after expression.');\n }\n\n return expr;\n}\n\nvar Constants = {\n NaN: 'NaN',\n E: 'Math.E',\n LN2: 'Math.LN2',\n LN10: 'Math.LN10',\n LOG2E: 'Math.LOG2E',\n LOG10E: 'Math.LOG10E',\n PI: 'Math.PI',\n SQRT1_2: 'Math.SQRT1_2',\n SQRT2: 'Math.SQRT2',\n MIN_VALUE: 'Number.MIN_VALUE',\n MAX_VALUE: 'Number.MAX_VALUE'\n};\n\nfunction Functions (codegen) {\n function fncall(name, args, cast, type) {\n let obj = codegen(args[0]);\n\n if (cast) {\n obj = cast + '(' + obj + ')';\n if (cast.lastIndexOf('new ', 0) === 0) obj = '(' + obj + ')';\n }\n\n return obj + '.' + name + (type < 0 ? '' : type === 0 ? '()' : '(' + args.slice(1).map(codegen).join(',') + ')');\n }\n\n function fn(name, cast, type) {\n return args => fncall(name, args, cast, type);\n }\n\n const DATE = 'new Date',\n STRING = 'String',\n REGEXP = 'RegExp';\n return {\n // MATH functions\n isNaN: 'Number.isNaN',\n isFinite: 'Number.isFinite',\n abs: 'Math.abs',\n acos: 'Math.acos',\n asin: 'Math.asin',\n atan: 'Math.atan',\n atan2: 'Math.atan2',\n ceil: 'Math.ceil',\n cos: 'Math.cos',\n exp: 'Math.exp',\n floor: 'Math.floor',\n log: 'Math.log',\n max: 'Math.max',\n min: 'Math.min',\n pow: 'Math.pow',\n random: 'Math.random',\n round: 'Math.round',\n sin: 'Math.sin',\n sqrt: 'Math.sqrt',\n tan: 'Math.tan',\n clamp: function (args) {\n if (args.length < 3) error('Missing arguments to clamp function.');\n if (args.length > 3) error('Too many arguments to clamp function.');\n const a = args.map(codegen);\n return 'Math.max(' + a[1] + ', Math.min(' + a[2] + ',' + a[0] + '))';\n },\n // DATE functions\n now: 'Date.now',\n utc: 'Date.UTC',\n datetime: DATE,\n date: fn('getDate', DATE, 0),\n day: fn('getDay', DATE, 0),\n year: fn('getFullYear', DATE, 0),\n month: fn('getMonth', DATE, 0),\n hours: fn('getHours', DATE, 0),\n minutes: fn('getMinutes', DATE, 0),\n seconds: fn('getSeconds', DATE, 0),\n milliseconds: fn('getMilliseconds', DATE, 0),\n time: fn('getTime', DATE, 0),\n timezoneoffset: fn('getTimezoneOffset', DATE, 0),\n utcdate: fn('getUTCDate', DATE, 0),\n utcday: fn('getUTCDay', DATE, 0),\n utcyear: fn('getUTCFullYear', DATE, 0),\n utcmonth: fn('getUTCMonth', DATE, 0),\n utchours: fn('getUTCHours', DATE, 0),\n utcminutes: fn('getUTCMinutes', DATE, 0),\n utcseconds: fn('getUTCSeconds', DATE, 0),\n utcmilliseconds: fn('getUTCMilliseconds', DATE, 0),\n // sequence functions\n length: fn('length', null, -1),\n join: fn('join', null),\n indexof: fn('indexOf', null),\n lastindexof: fn('lastIndexOf', null),\n slice: fn('slice', null),\n reverse: function (args) {\n return '(' + codegen(args[0]) + ').slice().reverse()';\n },\n // STRING functions\n parseFloat: 'parseFloat',\n parseInt: 'parseInt',\n upper: fn('toUpperCase', STRING, 0),\n lower: fn('toLowerCase', STRING, 0),\n substring: fn('substring', STRING),\n split: fn('split', STRING),\n replace: fn('replace', STRING),\n trim: fn('trim', STRING, 0),\n // REGEXP functions\n regexp: REGEXP,\n test: fn('test', REGEXP),\n // Control Flow functions\n if: function (args) {\n if (args.length < 3) error('Missing arguments to if function.');\n if (args.length > 3) error('Too many arguments to if function.');\n const a = args.map(codegen);\n return '(' + a[0] + '?' + a[1] + ':' + a[2] + ')';\n }\n };\n}\n\nfunction stripQuotes(s) {\n const n = s && s.length - 1;\n return n && (s[0] === '\"' && s[n] === '\"' || s[0] === '\\'' && s[n] === '\\'') ? s.slice(1, -1) : s;\n}\n\nfunction codegen (opt) {\n opt = opt || {};\n const allowed = opt.allowed ? toSet(opt.allowed) : {},\n forbidden = opt.forbidden ? toSet(opt.forbidden) : {},\n constants = opt.constants || Constants,\n functions = (opt.functions || Functions)(visit),\n globalvar = opt.globalvar,\n fieldvar = opt.fieldvar,\n outputGlobal = isFunction(globalvar) ? globalvar : id => \"\".concat(globalvar, \"[\\\"\").concat(id, \"\\\"]\");\n let globals = {},\n fields = {},\n memberDepth = 0;\n\n function visit(ast) {\n if (isString(ast)) return ast;\n const generator = Generators[ast.type];\n if (generator == null) error('Unsupported type: ' + ast.type);\n return generator(ast);\n }\n\n const Generators = {\n Literal: n => n.raw,\n Identifier: n => {\n const id = n.name;\n\n if (memberDepth > 0) {\n return id;\n } else if (hasOwnProperty(forbidden, id)) {\n return error('Illegal identifier: ' + id);\n } else if (hasOwnProperty(constants, id)) {\n return constants[id];\n } else if (hasOwnProperty(allowed, id)) {\n return id;\n } else {\n globals[id] = 1;\n return outputGlobal(id);\n }\n },\n MemberExpression: n => {\n const d = !n.computed,\n o = visit(n.object);\n if (d) memberDepth += 1;\n const p = visit(n.property);\n\n if (o === fieldvar) {\n // strip quotes to sanitize field name (#1653)\n fields[stripQuotes(p)] = 1;\n }\n\n if (d) memberDepth -= 1;\n return o + (d ? '.' + p : '[' + p + ']');\n },\n CallExpression: n => {\n if (n.callee.type !== 'Identifier') {\n error('Illegal callee type: ' + n.callee.type);\n }\n\n const callee = n.callee.name,\n args = n.arguments,\n fn = hasOwnProperty(functions, callee) && functions[callee];\n if (!fn) error('Unrecognized function: ' + callee);\n return isFunction(fn) ? fn(args) : fn + '(' + args.map(visit).join(',') + ')';\n },\n ArrayExpression: n => '[' + n.elements.map(visit).join(',') + ']',\n BinaryExpression: n => '(' + visit(n.left) + ' ' + n.operator + ' ' + visit(n.right) + ')',\n UnaryExpression: n => '(' + n.operator + visit(n.argument) + ')',\n ConditionalExpression: n => '(' + visit(n.test) + '?' + visit(n.consequent) + ':' + visit(n.alternate) + ')',\n LogicalExpression: n => '(' + visit(n.left) + n.operator + visit(n.right) + ')',\n ObjectExpression: n => '{' + n.properties.map(visit).join(',') + '}',\n Property: n => {\n memberDepth += 1;\n const k = visit(n.key);\n memberDepth -= 1;\n return k + ':' + visit(n.value);\n }\n };\n\n function codegen(ast) {\n const result = {\n code: visit(ast),\n globals: Object.keys(globals),\n fields: Object.keys(fields)\n };\n globals = {};\n fields = {};\n return result;\n }\n\n codegen.functions = functions;\n codegen.constants = constants;\n return codegen;\n}\n\nexport { ASTNode, ArrayExpression, BinaryExpression, CallExpression, ConditionalExpression, Identifier, Literal, LogicalExpression, MemberExpression, ObjectExpression, Property, RawCode, UnaryExpression, codegen, Constants as constants, Functions as functions, parser as parse };\n","import { parse } from 'vega-expression';\nfunction getName(node) {\n const name = [];\n if (node.type === 'Identifier') {\n return [node.name];\n }\n if (node.type === 'Literal') {\n return [node.value];\n }\n if (node.type === 'MemberExpression') {\n name.push(...getName(node.object));\n name.push(...getName(node.property));\n }\n return name;\n}\nfunction startsWithDatum(node) {\n if (node.object.type === 'MemberExpression') {\n return startsWithDatum(node.object);\n }\n return node.object.name === 'datum';\n}\nexport function getDependentFields(expression) {\n const ast = parse(expression);\n const dependents = new Set();\n ast.visit((node) => {\n if (node.type === 'MemberExpression' && startsWithDatum(node)) {\n dependents.add(getName(node).slice(1).join('.'));\n }\n });\n return dependents;\n}\n//# sourceMappingURL=expressions.js.map","import { duplicate } from '../../util';\nimport { expression } from '../predicate';\nimport { DataFlowNode } from './dataflow';\nimport { getDependentFields } from './expressions';\nexport class FilterNode extends DataFlowNode {\n constructor(parent, model, filter) {\n super(parent);\n this.model = model;\n this.filter = filter;\n // TODO: refactor this to not take a node and\n // then add a static function makeFromOperand and make the constructor take only an expression\n this.expr = expression(this.model, this.filter, this);\n this._dependentFields = getDependentFields(this.expr);\n }\n clone() {\n return new FilterNode(null, this.model, duplicate(this.filter));\n }\n dependentFields() {\n return this._dependentFields;\n }\n producedFields() {\n return new Set(); // filter does not produce any new fields\n }\n assemble() {\n return {\n type: 'filter',\n expr: this.expr\n };\n }\n hash() {\n return `Filter ${this.expr}`;\n }\n}\n//# sourceMappingURL=filter.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { selector as parseSelector } from 'vega-event-selector';\nimport { isString, stringValue } from 'vega-util';\nimport { forEachSelection, STORE } from '.';\nimport { warn } from '../../log';\nimport { duplicate, keys, logicalExpr, varName } from '../../util';\nimport { OutputNode } from '../data/dataflow';\nimport { FilterNode } from '../data/filter';\nimport { forEachTransform } from './transforms/transforms';\nimport { DataSourceType } from '../../data';\nexport function parseUnitSelection(model, selDefs) {\n var _a;\n const selCmpts = {};\n const selectionConfig = model.config.selection;\n for (const name of keys(selDefs !== null && selDefs !== void 0 ? selDefs : {})) {\n const selDef = duplicate(selDefs[name]);\n const _b = selectionConfig[selDef.type], { fields, encodings } = _b, cfg = __rest(_b, [\"fields\", \"encodings\"]); // Project transform applies its defaults.\n // Set default values from config if a property hasn't been specified,\n // or if it is true. E.g., \"translate\": true should use the default\n // event handlers for translate. However, true may be a valid value for\n // a property (e.g., \"nearest\": true).\n for (const key in cfg) {\n // A selection should contain either `encodings` or `fields`, only use\n // default values for these two values if neither of them is specified.\n if ((key === 'encodings' && selDef.fields) || (key === 'fields' && selDef.encodings)) {\n continue;\n }\n if (key === 'mark') {\n selDef[key] = Object.assign(Object.assign({}, cfg[key]), selDef[key]);\n }\n if (selDef[key] === undefined || selDef[key] === true) {\n selDef[key] = (_a = cfg[key]) !== null && _a !== void 0 ? _a : selDef[key];\n }\n }\n const safeName = varName(name);\n const selCmpt = (selCmpts[safeName] = Object.assign(Object.assign({}, selDef), { name: safeName, events: isString(selDef.on) ? parseSelector(selDef.on, 'scope') : duplicate(selDef.on) }));\n forEachTransform(selCmpt, txCompiler => {\n if (txCompiler.has(selCmpt) && txCompiler.parse) {\n txCompiler.parse(model, selCmpt, selDef, selDefs[name]);\n }\n });\n }\n return selCmpts;\n}\nexport function parseSelectionPredicate(model, selections, dfnode, datum = 'datum') {\n const stores = [];\n function expr(name) {\n const vname = varName(name);\n const selCmpt = model.getSelectionComponent(vname, name);\n const store = stringValue(vname + STORE);\n if (selCmpt.project.timeUnit) {\n const child = dfnode !== null && dfnode !== void 0 ? dfnode : model.component.data.raw;\n const tunode = selCmpt.project.timeUnit.clone();\n if (child.parent) {\n tunode.insertAsParentOf(child);\n }\n else {\n child.parent = tunode;\n }\n }\n if (selCmpt.empty !== 'none') {\n stores.push(store);\n }\n return (`vlSelectionTest(${store}, ${datum}` + (selCmpt.resolve === 'global' ? ')' : `, ${stringValue(selCmpt.resolve)})`));\n }\n const predicateStr = logicalExpr(selections, expr);\n return ((stores.length ? '!(' + stores.map(s => `length(data(${s}))`).join(' || ') + ') || ' : '') + `(${predicateStr})`);\n}\nexport function parseSelectionBinExtent(selCmpt, extent) {\n const encoding = extent['encoding'];\n let field = extent['field'];\n if (!encoding && !field) {\n field = selCmpt.project.items[0].field;\n if (selCmpt.project.items.length > 1) {\n warn('A \"field\" or \"encoding\" must be specified when using a selection as a scale domain. ' +\n `Using \"field\": ${stringValue(field)}.`);\n }\n }\n else if (encoding && !field) {\n const encodings = selCmpt.project.items.filter(p => p.channel === encoding);\n if (!encodings.length || encodings.length > 1) {\n field = selCmpt.project.items[0].field;\n warn((!encodings.length ? 'No ' : 'Multiple ') +\n `matching ${stringValue(encoding)} encoding found for selection ${stringValue(extent.selection)}. ` +\n `Using \"field\": ${stringValue(field)}.`);\n }\n else {\n field = encodings[0].field;\n }\n }\n return `${selCmpt.name}[${stringValue(field)}]`;\n}\nexport function materializeSelections(model, main) {\n forEachSelection(model, selCmpt => {\n const selection = selCmpt.name;\n const lookupName = model.getName(`lookup_${selection}`);\n model.component.data.outputNodes[lookupName] = selCmpt.materialized = new OutputNode(new FilterNode(main, model, { selection }), lookupName, DataSourceType.Lookup, model.component.data.outputNodeRefCounts);\n });\n}\n//# sourceMappingURL=parse.js.map","import { isString } from 'vega-util';\nimport { fieldFilterExpression, isSelectionPredicate } from '../predicate';\nimport { logicalExpr } from '../util';\nimport { parseSelectionPredicate } from './selection/parse';\n/**\n * Converts a predicate into an expression.\n */\n// model is only used for selection filters.\nexport function expression(model, filterOp, node) {\n return logicalExpr(filterOp, (predicate) => {\n if (isString(predicate)) {\n return predicate;\n }\n else if (isSelectionPredicate(predicate)) {\n return parseSelectionPredicate(model, predicate.selection, node);\n }\n else {\n // Filter Object\n return fieldFilterExpression(predicate);\n }\n });\n}\n//# sourceMappingURL=predicate.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array, isArray } from 'vega-util';\nimport { AXIS_PARTS, AXIS_PROPERTY_TYPE, CONDITIONAL_AXIS_PROP_INDEX, isConditionalAxisValue } from '../../axis';\nimport { POSITION_SCALE_CHANNELS } from '../../channel';\nimport { defaultTitle } from '../../channeldef';\nimport { isText } from '../../title';\nimport { getFirstDefined, isEmpty, replaceAll } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { exprFromValueOrSignalRef } from '../common';\nimport { expression } from '../predicate';\nfunction assembleTitle(title, config) {\n if (!title) {\n return undefined;\n }\n if (isArray(title) && !isText(title)) {\n return title.map(fieldDef => defaultTitle(fieldDef, config)).join(', ');\n }\n return title;\n}\nfunction setAxisEncode(axis, part, vgProp, vgRef) {\n var _a, _b, _c;\n axis.encode = (_a = axis.encode) !== null && _a !== void 0 ? _a : {};\n axis.encode[part] = (_b = axis.encode[part]) !== null && _b !== void 0 ? _b : {};\n axis.encode[part].update = (_c = axis.encode[part].update) !== null && _c !== void 0 ? _c : {};\n // TODO: remove as any after https://github.com/prisma/nexus-prisma/issues/291\n axis.encode[part].update[vgProp] = vgRef;\n}\nexport function assembleAxis(axisCmpt, kind, config, opt = { header: false }) {\n var _a, _b;\n const _c = axisCmpt.combine(), { disable, orient, scale, labelExpr, title, zindex } = _c, axis = __rest(_c, [\"disable\", \"orient\", \"scale\", \"labelExpr\", \"title\", \"zindex\"]);\n if (disable) {\n return undefined;\n }\n for (const prop in axis) {\n const propType = AXIS_PROPERTY_TYPE[prop];\n const propValue = axis[prop];\n if (propType && propType !== kind && propType !== 'both') {\n // Remove properties that are not valid for this kind of axis\n delete axis[prop];\n }\n else if (isConditionalAxisValue(propValue)) {\n // deal with conditional axis value\n const { condition } = propValue, valueOrSignalRef = __rest(propValue, [\"condition\"]);\n const conditions = array(condition);\n const propIndex = CONDITIONAL_AXIS_PROP_INDEX[prop];\n if (propIndex) {\n const { vgProp, part } = propIndex;\n // If there is a corresponding Vega property for the channel,\n // use Vega's custom axis encoding and delete the original axis property to avoid conflicts\n const vgRef = [\n ...conditions.map(c => {\n const { test } = c, valueOrSignalCRef = __rest(c, [\"test\"]);\n return Object.assign({ test: expression(null, test) }, valueOrSignalCRef);\n }),\n valueOrSignalRef\n ];\n setAxisEncode(axis, part, vgProp, vgRef);\n delete axis[prop];\n }\n else if (propIndex === null) {\n // If propIndex is null, this means we support conditional axis property by converting the condition to signal instead.\n const signalRef = {\n signal: conditions\n .map(c => {\n const { test } = c, valueOrSignalCRef = __rest(c, [\"test\"]);\n return `${expression(null, test)} ? ${exprFromValueOrSignalRef(valueOrSignalCRef)} : `;\n })\n .join('') + exprFromValueOrSignalRef(valueOrSignalRef)\n };\n axis[prop] = signalRef;\n }\n }\n else if (isSignalRef(propValue)) {\n const propIndex = CONDITIONAL_AXIS_PROP_INDEX[prop];\n if (propIndex) {\n const { vgProp, part } = propIndex;\n setAxisEncode(axis, part, vgProp, propValue);\n delete axis[prop];\n } // else do nothing since the property already supports signal\n }\n }\n if (kind === 'grid') {\n if (!axis.grid) {\n return undefined;\n }\n // Remove unnecessary encode block\n if (axis.encode) {\n // Only need to keep encode block for grid\n const { grid } = axis.encode;\n axis.encode = Object.assign({}, (grid ? { grid } : {}));\n if (isEmpty(axis.encode)) {\n delete axis.encode;\n }\n }\n return Object.assign(Object.assign({ scale,\n orient }, axis), { domain: false, labels: false, aria: false, \n // Always set min/maxExtent to 0 to ensure that `config.axis*.minExtent` and `config.axis*.maxExtent`\n // would not affect gridAxis\n maxExtent: 0, minExtent: 0, ticks: false, zindex: getFirstDefined(zindex, 0) // put grid behind marks by default\n });\n }\n else {\n // kind === 'main'\n if (!opt.header && axisCmpt.mainExtracted) {\n // if mainExtracted has been extracted to a separate facet\n return undefined;\n }\n if (labelExpr !== undefined) {\n let expr = labelExpr;\n if (((_b = (_a = axis.encode) === null || _a === void 0 ? void 0 : _a.labels) === null || _b === void 0 ? void 0 : _b.update) && isSignalRef(axis.encode.labels.update.text)) {\n expr = replaceAll(labelExpr, 'datum.label', axis.encode.labels.update.text.signal);\n }\n setAxisEncode(axis, 'labels', 'text', { signal: expr });\n }\n if (axis.labelAlign === null) {\n delete axis.labelAlign;\n }\n // Remove unnecessary encode block\n if (axis.encode) {\n for (const part of AXIS_PARTS) {\n if (!axisCmpt.hasAxisPart(part)) {\n delete axis.encode[part];\n }\n }\n if (isEmpty(axis.encode)) {\n delete axis.encode;\n }\n }\n const titleString = assembleTitle(title, config);\n return Object.assign(Object.assign(Object.assign(Object.assign({ scale,\n orient, grid: false }, (titleString ? { title: titleString } : {})), axis), (config.aria === false ? { aria: false } : {})), { zindex: getFirstDefined(zindex, 0) // put axis line above marks by default\n });\n }\n}\n/**\n * Add axis signals so grid line works correctly\n * (Fix https://github.com/vega/vega-lite/issues/4226)\n */\nexport function assembleAxisSignals(model) {\n const { axes } = model.component;\n const signals = [];\n for (const channel of POSITION_SCALE_CHANNELS) {\n if (axes[channel]) {\n for (const axis of axes[channel]) {\n if (!axis.get('disable') && !axis.get('gridScale')) {\n // If there is x-axis but no y-scale for gridScale, need to set height/width so x-axis can draw the grid with the right height. Same for y-axis and width.\n const sizeType = channel === 'x' ? 'height' : 'width';\n const update = model.getSizeSignalRef(sizeType).signal;\n if (sizeType !== update) {\n signals.push({\n name: sizeType,\n update: update\n });\n }\n }\n }\n }\n }\n return signals;\n}\nexport function assembleAxes(axisComponents, config) {\n const { x = [], y = [] } = axisComponents;\n return [\n ...x.map(a => assembleAxis(a, 'grid', config)),\n ...y.map(a => assembleAxis(a, 'grid', config)),\n ...x.map(a => assembleAxis(a, 'main', config)),\n ...y.map(a => assembleAxis(a, 'main', config))\n ].filter(a => a); // filter undefined\n}\n//# sourceMappingURL=assemble.js.map","import { array } from 'vega-util';\nimport { isQuantitative } from '../../scale';\nimport { keys, titleCase } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { getStyleConfig, signalOrStringValue } from '../common';\nfunction getAxisConfigFromConfigTypes(configTypes, config, channel, orient) {\n // TODO: add special casing to add conditional value based on orient signal\n return Object.assign.apply(null, [\n {},\n ...configTypes.map(configType => {\n if (configType === 'axisOrient') {\n const orient1 = channel === 'x' ? 'bottom' : 'left';\n const orientConfig1 = config[channel === 'x' ? 'axisBottom' : 'axisLeft'] || {};\n const orientConfig2 = config[channel === 'x' ? 'axisTop' : 'axisRight'] || {};\n const props = new Set([...keys(orientConfig1), ...keys(orientConfig2)]);\n const conditionalOrientAxisConfig = {};\n for (const prop of props.values()) {\n conditionalOrientAxisConfig[prop] = {\n // orient is surely signal in this case\n signal: `${orient['signal']} === \"${orient1}\" ? ${signalOrStringValue(orientConfig1[prop])} : ${signalOrStringValue(orientConfig2[prop])}`\n };\n }\n return conditionalOrientAxisConfig;\n }\n return config[configType];\n })\n ]);\n}\nexport function getAxisConfigs(channel, scaleType, orient, config) {\n const typeBasedConfigTypes = scaleType === 'band'\n ? ['axisDiscrete', 'axisBand']\n : scaleType === 'point'\n ? ['axisDiscrete', 'axisPoint']\n : isQuantitative(scaleType)\n ? ['axisQuantitative']\n : scaleType === 'time' || scaleType === 'utc'\n ? ['axisTemporal']\n : [];\n const axisChannel = channel === 'x' ? 'axisX' : 'axisY';\n const axisOrient = isSignalRef(orient) ? 'axisOrient' : 'axis' + titleCase(orient); // axisTop, axisBottom, ...\n const vlOnlyConfigTypes = [\n // technically Vega does have axisBand, but if we make another separation here,\n // it will further introduce complexity in the code\n ...typeBasedConfigTypes,\n ...typeBasedConfigTypes.map(c => axisChannel + c.substr(4))\n ];\n const vgConfigTypes = ['axis', axisOrient, axisChannel];\n return {\n vlOnlyAxisConfig: getAxisConfigFromConfigTypes(vlOnlyConfigTypes, config, channel, orient),\n vgAxisConfig: getAxisConfigFromConfigTypes(vgConfigTypes, config, channel, orient),\n axisConfigStyle: getAxisConfigStyle([...vgConfigTypes, ...vlOnlyConfigTypes], config)\n };\n}\nexport function getAxisConfigStyle(axisConfigTypes, config) {\n var _a;\n const toMerge = [{}];\n for (const configType of axisConfigTypes) {\n // TODO: add special casing to add conditional value based on orient signal\n let style = (_a = config[configType]) === null || _a === void 0 ? void 0 : _a.style;\n if (style) {\n style = array(style);\n for (const s of style) {\n toMerge.push(config.style[s]);\n }\n }\n }\n return Object.assign.apply(null, toMerge);\n}\nexport function getAxisConfig(property, styleConfigIndex, style, axisConfigs = {}) {\n var _a;\n const styleConfig = getStyleConfig(property, style, styleConfigIndex);\n if (styleConfig !== undefined) {\n return {\n configFrom: 'style',\n configValue: styleConfig\n };\n }\n for (const configFrom of ['vlOnlyAxisConfig', 'vgAxisConfig', 'axisConfigStyle']) {\n if (((_a = axisConfigs[configFrom]) === null || _a === void 0 ? void 0 : _a[property]) !== undefined) {\n return { configFrom, configValue: axisConfigs[configFrom][property] };\n }\n }\n return {};\n}\n//# sourceMappingURL=config.js.map","import { isArray, isObject } from 'vega-util';\nimport { isBinned, isBinning } from '../../bin';\nimport { X } from '../../channel';\nimport { isDiscrete, isFieldDef, toFieldDefBase, valueArray } from '../../channeldef';\nimport { hasDiscreteDomain } from '../../scale';\nimport { normalizeTimeUnit } from '../../timeunit';\nimport { NOMINAL, ORDINAL } from '../../type';\nimport { contains, normalizeAngle } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { mergeTitle, mergeTitleFieldDefs } from '../common';\nimport { guideFormat, guideFormatType } from '../format';\nimport { getAxisConfig } from './config';\nexport const axisRules = {\n scale: ({ model, channel }) => model.scaleName(channel),\n format: ({ fieldOrDatumDef, config, axis }) => {\n const { format, formatType } = axis;\n return guideFormat(fieldOrDatumDef, fieldOrDatumDef.type, format, formatType, config, true);\n },\n formatType: ({ axis, fieldOrDatumDef, scaleType }) => {\n const { formatType } = axis;\n return guideFormatType(formatType, fieldOrDatumDef, scaleType);\n },\n grid: ({ fieldOrDatumDef, axis, scaleType }) => {\n var _a;\n if (isFieldDef(fieldOrDatumDef) && isBinned(fieldOrDatumDef.bin)) {\n return false;\n }\n else {\n return (_a = axis.grid) !== null && _a !== void 0 ? _a : defaultGrid(scaleType, fieldOrDatumDef);\n }\n },\n gridScale: ({ model, channel }) => gridScale(model, channel),\n labelAlign: ({ axis, labelAngle, orient, channel }) => axis.labelAlign || defaultLabelAlign(labelAngle, orient, channel),\n labelAngle: ({ labelAngle }) => labelAngle,\n labelBaseline: ({ axis, labelAngle, orient, channel }) => axis.labelBaseline || defaultLabelBaseline(labelAngle, orient, channel),\n labelFlush: ({ axis, fieldOrDatumDef, channel }) => { var _a; return (_a = axis.labelFlush) !== null && _a !== void 0 ? _a : defaultLabelFlush(fieldOrDatumDef.type, channel); },\n labelOverlap: ({ axis, fieldOrDatumDef, scaleType }) => { var _a; return (_a = axis.labelOverlap) !== null && _a !== void 0 ? _a : defaultLabelOverlap(fieldOrDatumDef.type, scaleType, isFieldDef(fieldOrDatumDef) && !!fieldOrDatumDef.timeUnit, isFieldDef(fieldOrDatumDef) ? fieldOrDatumDef.sort : undefined); },\n // we already calculate orient in parse\n orient: ({ orient }) => orient,\n tickCount: ({ channel, model, axis, fieldOrDatumDef, scaleType }) => {\n var _a;\n const sizeType = channel === 'x' ? 'width' : channel === 'y' ? 'height' : undefined;\n const size = sizeType ? model.getSizeSignalRef(sizeType) : undefined;\n return (_a = axis.tickCount) !== null && _a !== void 0 ? _a : defaultTickCount({ fieldOrDatumDef, scaleType, size, values: axis.values });\n },\n title: ({ axis, model, channel }) => {\n if (axis.title !== undefined) {\n return axis.title;\n }\n const fieldDefTitle = getFieldDefTitle(model, channel);\n if (fieldDefTitle !== undefined) {\n return fieldDefTitle;\n }\n const fieldDef = model.typedFieldDef(channel);\n const channel2 = channel === 'x' ? 'x2' : 'y2';\n const fieldDef2 = model.fieldDef(channel2);\n // If title not specified, store base parts of fieldDef (and fieldDef2 if exists)\n return mergeTitleFieldDefs(fieldDef ? [toFieldDefBase(fieldDef)] : [], isFieldDef(fieldDef2) ? [toFieldDefBase(fieldDef2)] : []);\n },\n values: ({ axis, fieldOrDatumDef }) => values(axis, fieldOrDatumDef),\n zindex: ({ axis, fieldOrDatumDef, mark }) => { var _a; return (_a = axis.zindex) !== null && _a !== void 0 ? _a : defaultZindex(mark, fieldOrDatumDef); }\n};\n// TODO: we need to refactor this method after we take care of config refactoring\n/**\n * Default rules for whether to show a grid should be shown for a channel.\n * If `grid` is unspecified, the default value is `true` for ordinal scales that are not binned\n */\nexport function defaultGrid(scaleType, fieldDef) {\n return !hasDiscreteDomain(scaleType) && isFieldDef(fieldDef) && !isBinning(fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.bin);\n}\nexport function gridScale(model, channel) {\n const gridChannel = channel === 'x' ? 'y' : 'x';\n if (model.getScaleComponent(gridChannel)) {\n return model.scaleName(gridChannel);\n }\n return undefined;\n}\nexport function getLabelAngle(fieldOrDatumDef, axis, channel, styleConfig, axisConfigs) {\n const labelAngle = axis === null || axis === void 0 ? void 0 : axis.labelAngle;\n // try axis value\n if (labelAngle !== undefined) {\n return isSignalRef(labelAngle) ? labelAngle : normalizeAngle(labelAngle);\n }\n else {\n // try axis config value\n const { configValue: angle } = getAxisConfig('labelAngle', styleConfig, axis === null || axis === void 0 ? void 0 : axis.style, axisConfigs);\n if (angle !== undefined) {\n return normalizeAngle(angle);\n }\n else {\n // get default value\n if (channel === X &&\n contains([NOMINAL, ORDINAL], fieldOrDatumDef.type) &&\n !(isFieldDef(fieldOrDatumDef) && fieldOrDatumDef.timeUnit)) {\n return 270;\n }\n // no default\n return undefined;\n }\n }\n}\nexport function normalizeAngleExpr(angle) {\n return `(((${angle.signal} % 360) + 360) % 360)`;\n}\nexport function defaultLabelBaseline(angle, orient, channel, alwaysIncludeMiddle) {\n if (angle !== undefined) {\n if (channel === 'x') {\n if (isSignalRef(angle)) {\n const a = normalizeAngleExpr(angle);\n const orientIsTop = isSignalRef(orient) ? `(${orient.signal} === \"top\")` : orient === 'top';\n return {\n signal: `(45 < ${a} && ${a} < 135) || (225 < ${a} && ${a} < 315) ? \"middle\" :` +\n `(${a} <= 45 || 315 <= ${a}) === ${orientIsTop} ? \"bottom\" : \"top\"`\n };\n }\n if ((45 < angle && angle < 135) || (225 < angle && angle < 315)) {\n return 'middle';\n }\n if (isSignalRef(orient)) {\n const op = angle <= 45 || 315 <= angle ? '===' : '!==';\n return { signal: `${orient.signal} ${op} \"top\" ? \"bottom\" : \"top\"` };\n }\n return (angle <= 45 || 315 <= angle) === (orient === 'top') ? 'bottom' : 'top';\n }\n else {\n if (isSignalRef(angle)) {\n const a = normalizeAngleExpr(angle);\n const orientIsLeft = isSignalRef(orient) ? `(${orient.signal} === \"left\")` : orient === 'left';\n const middle = alwaysIncludeMiddle ? '\"middle\"' : 'null';\n return {\n signal: `${a} <= 45 || 315 <= ${a} || (135 <= ${a} && ${a} <= 225) ? ${middle} : (45 <= ${a} && ${a} <= 135) === ${orientIsLeft} ? \"top\" : \"bottom\"`\n };\n }\n if (angle <= 45 || 315 <= angle || (135 <= angle && angle <= 225)) {\n return alwaysIncludeMiddle ? 'middle' : null;\n }\n if (isSignalRef(orient)) {\n const op = 45 <= angle && angle <= 135 ? '===' : '!==';\n return { signal: `${orient.signal} ${op} \"left\" ? \"top\" : \"bottom\"` };\n }\n return (45 <= angle && angle <= 135) === (orient === 'left') ? 'top' : 'bottom';\n }\n }\n return undefined;\n}\nexport function defaultLabelAlign(angle, orient, channel) {\n if (angle === undefined) {\n return undefined;\n }\n const isX = channel === 'x';\n const startAngle = isX ? 0 : 90;\n const mainOrient = isX ? 'bottom' : 'left';\n if (isSignalRef(angle)) {\n const a = normalizeAngleExpr(angle);\n const orientIsMain = isSignalRef(orient) ? `(${orient.signal} === \"${mainOrient}\")` : orient === mainOrient;\n return {\n signal: `(${startAngle ? '(' + a + ' + 90)' : a} % 180 === 0) ? ${isX ? null : '\"center\"'} :` +\n `(${startAngle} < ${a} && ${a} < ${180 + startAngle}) === ${orientIsMain} ? \"left\" : \"right\"`\n };\n }\n if ((angle + startAngle) % 180 === 0) {\n // For bottom, use default label align so label flush still works\n return isX ? null : 'center';\n }\n if (isSignalRef(orient)) {\n const op = startAngle < angle && angle < 180 + startAngle ? '===' : '!==';\n const orientIsMain = `${orient.signal} ${op} \"${mainOrient}\"`;\n return {\n signal: `${orientIsMain} ? \"left\" : \"right\"`\n };\n }\n if ((startAngle < angle && angle < 180 + startAngle) === (orient === mainOrient)) {\n return 'left';\n }\n return 'right';\n}\nexport function defaultLabelFlush(type, channel) {\n if (channel === 'x' && contains(['quantitative', 'temporal'], type)) {\n return true;\n }\n return undefined;\n}\nexport function defaultLabelOverlap(type, scaleType, hasTimeUnit, sort) {\n // do not prevent overlap for nominal data because there is no way to infer what the missing labels are\n if ((hasTimeUnit && !isObject(sort)) || (type !== 'nominal' && type !== 'ordinal')) {\n if (scaleType === 'log' || scaleType === 'symlog') {\n return 'greedy';\n }\n return true;\n }\n return undefined;\n}\nexport function defaultOrient(channel) {\n return channel === 'x' ? 'bottom' : 'left';\n}\nexport function defaultTickCount({ fieldOrDatumDef, scaleType, size, values: vals }) {\n var _a;\n if (!vals && !hasDiscreteDomain(scaleType) && scaleType !== 'log') {\n if (isFieldDef(fieldOrDatumDef)) {\n if (isBinning(fieldOrDatumDef.bin)) {\n // for binned data, we don't want more ticks than maxbins\n return { signal: `ceil(${size.signal}/10)` };\n }\n if (fieldOrDatumDef.timeUnit &&\n contains(['month', 'hours', 'day', 'quarter'], (_a = normalizeTimeUnit(fieldOrDatumDef.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit)) {\n return undefined;\n }\n }\n return { signal: `ceil(${size.signal}/40)` };\n }\n return undefined;\n}\nexport function getFieldDefTitle(model, channel) {\n const channel2 = channel === 'x' ? 'x2' : 'y2';\n const fieldDef = model.fieldDef(channel);\n const fieldDef2 = model.fieldDef(channel2);\n const title1 = fieldDef ? fieldDef.title : undefined;\n const title2 = fieldDef2 ? fieldDef2.title : undefined;\n if (title1 && title2) {\n return mergeTitle(title1, title2);\n }\n else if (title1) {\n return title1;\n }\n else if (title2) {\n return title2;\n }\n else if (title1 !== undefined) {\n // falsy value to disable config\n return title1;\n }\n else if (title2 !== undefined) {\n // falsy value to disable config\n return title2;\n }\n return undefined;\n}\nexport function values(axis, fieldOrDatumDef) {\n const vals = axis.values;\n if (isArray(vals)) {\n return valueArray(fieldOrDatumDef, vals);\n }\n else if (isSignalRef(vals)) {\n return vals;\n }\n return undefined;\n}\nexport function defaultZindex(mark, fieldDef) {\n if (mark === 'rect' && isDiscrete(fieldDef)) {\n return 1;\n }\n return 0;\n}\n//# sourceMappingURL=properties.js.map","import { isScaleFieldDef, vgField } from '../../channeldef';\nimport { fieldFilterExpression } from '../../predicate';\nimport { isSortArray } from '../../sort';\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nimport { getDependentFields } from './expressions';\nexport class CalculateNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n this._dependentFields = getDependentFields(this.transform.calculate);\n }\n clone() {\n return new CalculateNode(null, duplicate(this.transform));\n }\n static parseAllForSortIndex(parent, model) {\n // get all the encoding with sort fields from model\n model.forEachFieldDef((fieldDef, channel) => {\n if (!isScaleFieldDef(fieldDef)) {\n return;\n }\n if (isSortArray(fieldDef.sort)) {\n const { field, timeUnit } = fieldDef;\n const sort = fieldDef.sort;\n // generate `datum[\"a\"] === val0 ? 0 : datum[\"a\"] === val1 ? 1 : ... : n` via FieldEqualPredicate\n const calculate = sort\n .map((sortValue, i) => {\n return `${fieldFilterExpression({ field, timeUnit, equal: sortValue })} ? ${i} : `;\n })\n .join('') + sort.length;\n parent = new CalculateNode(parent, {\n calculate,\n as: sortArrayIndexField(fieldDef, channel, { forAs: true })\n });\n }\n });\n return parent;\n }\n producedFields() {\n return new Set([this.transform.as]);\n }\n dependentFields() {\n return this._dependentFields;\n }\n assemble() {\n return {\n type: 'formula',\n expr: this.transform.calculate,\n as: this.transform.as\n };\n }\n hash() {\n return `Calculate ${hash(this.transform)}`;\n }\n}\nexport function sortArrayIndexField(fieldDef, channel, opt) {\n return vgField(fieldDef, Object.assign({ prefix: channel, suffix: 'sort_index' }, (opt !== null && opt !== void 0 ? opt : {})));\n}\n//# sourceMappingURL=calculate.js.map","import { contains, getFirstDefined } from '../../util';\n/**\n * Get header channel, which can be different from facet channel when orient is specified or when the facet channel is facet.\n */\nexport function getHeaderChannel(channel, orient) {\n if (contains(['top', 'bottom'], orient)) {\n return 'column';\n }\n else if (contains(['left', 'right'], orient)) {\n return 'row';\n }\n return channel === 'row' ? 'row' : 'column';\n}\nexport function getHeaderProperty(prop, header, config, channel) {\n const headerSpecificConfig = channel === 'row' ? config.headerRow : channel === 'column' ? config.headerColumn : config.headerFacet;\n return getFirstDefined((header || {})[prop], headerSpecificConfig[prop], config.header[prop]);\n}\nexport function getHeaderProperties(properties, header, config, channel) {\n const props = {};\n for (const prop of properties) {\n const value = getHeaderProperty(prop, header || {}, config, channel);\n if (value !== undefined) {\n props[prop] = value;\n }\n }\n return props;\n}\n//# sourceMappingURL=common.js.map","export const HEADER_CHANNELS = ['row', 'column'];\nexport const HEADER_TYPES = ['header', 'footer'];\n//# sourceMappingURL=component.js.map","/**\n * Utility for generating row / column headers\n */\nimport { isArray } from 'vega-util';\nimport { FACET_CHANNELS } from '../../channel';\nimport { vgField } from '../../channeldef';\nimport { HEADER_LABEL_PROPERTIES, HEADER_LABEL_PROPERTIES_MAP, HEADER_TITLE_PROPERTIES, HEADER_TITLE_PROPERTIES_MAP } from '../../header';\nimport { isSortField } from '../../sort';\nimport { isFacetMapping } from '../../spec/facet';\nimport { contains, isEmpty, normalizeAngle, replaceAll } from '../../util';\nimport { defaultLabelAlign, defaultLabelBaseline } from '../axis/properties';\nimport { sortArrayIndexField } from '../data/calculate';\nimport { formatSignalRef } from '../format';\nimport { isFacetModel } from '../model';\nimport { getHeaderChannel, getHeaderProperties, getHeaderProperty } from './common';\nimport { HEADER_TYPES } from './component';\n// TODO: rename to assembleHeaderTitleGroup\nexport function assembleTitleGroup(model, channel) {\n const title = model.component.layoutHeaders[channel].title;\n const config = model.config ? model.config : undefined;\n const facetFieldDef = model.component.layoutHeaders[channel].facetFieldDef\n ? model.component.layoutHeaders[channel].facetFieldDef\n : undefined;\n const { titleAnchor, titleAngle: ta, titleOrient } = getHeaderProperties(['titleAnchor', 'titleAngle', 'titleOrient'], facetFieldDef.header, config, channel);\n const headerChannel = getHeaderChannel(channel, titleOrient);\n const titleAngle = normalizeAngle(ta);\n return {\n name: `${channel}-title`,\n type: 'group',\n role: `${headerChannel}-title`,\n title: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ text: title }, (channel === 'row' ? { orient: 'left' } : {})), { style: 'guide-title' }), defaultHeaderGuideBaseline(titleAngle, headerChannel)), defaultHeaderGuideAlign(headerChannel, titleAngle, titleAnchor)), assembleHeaderProperties(config, facetFieldDef, channel, HEADER_TITLE_PROPERTIES, HEADER_TITLE_PROPERTIES_MAP))\n };\n}\nexport function defaultHeaderGuideAlign(headerChannel, angle, anchor = 'middle') {\n switch (anchor) {\n case 'start':\n return { align: 'left' };\n case 'end':\n return { align: 'right' };\n }\n const align = defaultLabelAlign(angle, headerChannel === 'row' ? 'left' : 'top', headerChannel === 'row' ? 'y' : 'x');\n return align ? { align } : {};\n}\nexport function defaultHeaderGuideBaseline(angle, channel) {\n const baseline = defaultLabelBaseline(angle, channel === 'row' ? 'left' : 'top', channel === 'row' ? 'y' : 'x', true);\n return baseline ? { baseline } : {};\n}\nexport function assembleHeaderGroups(model, channel) {\n const layoutHeader = model.component.layoutHeaders[channel];\n const groups = [];\n for (const headerType of HEADER_TYPES) {\n if (layoutHeader[headerType]) {\n for (const headerComponent of layoutHeader[headerType]) {\n const group = assembleHeaderGroup(model, channel, headerType, layoutHeader, headerComponent);\n if (group != null) {\n groups.push(group);\n }\n }\n }\n }\n return groups;\n}\nfunction getSort(facetFieldDef, channel) {\n var _a;\n const { sort } = facetFieldDef;\n if (isSortField(sort)) {\n return {\n field: vgField(sort, { expr: 'datum' }),\n order: (_a = sort.order) !== null && _a !== void 0 ? _a : 'ascending'\n };\n }\n else if (isArray(sort)) {\n return {\n field: sortArrayIndexField(facetFieldDef, channel, { expr: 'datum' }),\n order: 'ascending'\n };\n }\n else {\n return {\n field: vgField(facetFieldDef, { expr: 'datum' }),\n order: sort !== null && sort !== void 0 ? sort : 'ascending'\n };\n }\n}\nexport function assembleLabelTitle(facetFieldDef, channel, config) {\n const { format, formatType, labelAngle, labelAnchor, labelOrient, labelExpr } = getHeaderProperties(['format', 'formatType', 'labelAngle', 'labelAnchor', 'labelOrient', 'labelExpr'], facetFieldDef.header, config, channel);\n const titleTextExpr = formatSignalRef({ fieldOrDatumDef: facetFieldDef, format, formatType, expr: 'parent', config })\n .signal;\n const headerChannel = getHeaderChannel(channel, labelOrient);\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ text: {\n signal: labelExpr\n ? replaceAll(replaceAll(labelExpr, 'datum.label', titleTextExpr), 'datum.value', vgField(facetFieldDef, { expr: 'parent' }))\n : titleTextExpr\n } }, (channel === 'row' ? { orient: 'left' } : {})), { style: 'guide-label', frame: 'group' }), defaultHeaderGuideBaseline(labelAngle, headerChannel)), defaultHeaderGuideAlign(headerChannel, labelAngle, labelAnchor)), assembleHeaderProperties(config, facetFieldDef, channel, HEADER_LABEL_PROPERTIES, HEADER_LABEL_PROPERTIES_MAP));\n}\nexport function assembleHeaderGroup(model, channel, headerType, layoutHeader, headerComponent) {\n if (headerComponent) {\n let title = null;\n const { facetFieldDef } = layoutHeader;\n const config = model.config ? model.config : undefined;\n if (facetFieldDef && headerComponent.labels) {\n const { labelOrient } = getHeaderProperties(['labelOrient'], facetFieldDef.header, config, channel);\n // Include label title in the header if orient aligns with the channel\n if ((channel === 'row' && !contains(['top', 'bottom'], labelOrient)) ||\n (channel === 'column' && !contains(['left', 'right'], labelOrient))) {\n title = assembleLabelTitle(facetFieldDef, channel, config);\n }\n }\n const isFacetWithoutRowCol = isFacetModel(model) && !isFacetMapping(model.facet);\n const axes = headerComponent.axes;\n const hasAxes = (axes === null || axes === void 0 ? void 0 : axes.length) > 0;\n if (title || hasAxes) {\n const sizeChannel = channel === 'row' ? 'height' : 'width';\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ name: model.getName(`${channel}_${headerType}`), type: 'group', role: `${channel}-${headerType}` }, (layoutHeader.facetFieldDef\n ? {\n from: { data: model.getName(channel + '_domain') },\n sort: getSort(facetFieldDef, channel)\n }\n : {})), (hasAxes && isFacetWithoutRowCol\n ? {\n from: { data: model.getName(`facet_domain_${channel}`) }\n }\n : {})), (title ? { title } : {})), (headerComponent.sizeSignal\n ? {\n encode: {\n update: {\n [sizeChannel]: headerComponent.sizeSignal\n }\n }\n }\n : {})), (hasAxes ? { axes } : {}));\n }\n }\n return null;\n}\nconst LAYOUT_TITLE_BAND = {\n column: {\n start: 0,\n end: 1\n },\n row: {\n start: 1,\n end: 0\n }\n};\nexport function getLayoutTitleBand(titleAnchor, headerChannel) {\n return LAYOUT_TITLE_BAND[headerChannel][titleAnchor];\n}\nexport function assembleLayoutTitleBand(headerComponentIndex, config) {\n const titleBand = {};\n for (const channel of FACET_CHANNELS) {\n const headerComponent = headerComponentIndex[channel];\n if (headerComponent === null || headerComponent === void 0 ? void 0 : headerComponent.facetFieldDef) {\n const { titleAnchor, titleOrient } = getHeaderProperties(['titleAnchor', 'titleOrient'], headerComponent.facetFieldDef.header, config, channel);\n const headerChannel = getHeaderChannel(channel, titleOrient);\n const band = getLayoutTitleBand(titleAnchor, headerChannel);\n if (band !== undefined) {\n titleBand[headerChannel] = band;\n }\n }\n }\n return isEmpty(titleBand) ? undefined : titleBand;\n}\nexport function assembleHeaderProperties(config, facetFieldDef, channel, properties, propertiesMap) {\n const props = {};\n for (const prop of properties) {\n if (!propertiesMap[prop]) {\n continue;\n }\n const value = getHeaderProperty(prop, facetFieldDef === null || facetFieldDef === void 0 ? void 0 : facetFieldDef.header, config, channel);\n if (value !== undefined) {\n props[propertiesMap[prop]] = value;\n }\n }\n return props;\n}\n//# sourceMappingURL=assemble.js.map","import { getViewConfigContinuousSize } from '../../config';\nimport { hasDiscreteDomain } from '../../scale';\nimport { getFirstDefined } from '../../util';\nimport { isVgRangeStep } from '../../vega.schema';\nimport { signalOrStringValue } from '../common';\nimport { isFacetModel } from '../model';\nexport function assembleLayoutSignals(model) {\n return [\n ...sizeSignals(model, 'width'),\n ...sizeSignals(model, 'height'),\n ...sizeSignals(model, 'childWidth'),\n ...sizeSignals(model, 'childHeight')\n ];\n}\nexport function sizeSignals(model, sizeType) {\n const channel = sizeType === 'width' ? 'x' : 'y';\n const size = model.component.layoutSize.get(sizeType);\n if (!size || size === 'merged') {\n return [];\n }\n // Read size signal name from name map, just in case it is the top-level size signal that got renamed.\n const name = model.getSizeSignalRef(sizeType).signal;\n if (size === 'step') {\n const scaleComponent = model.getScaleComponent(channel);\n if (scaleComponent) {\n const type = scaleComponent.get('type');\n const range = scaleComponent.get('range');\n if (hasDiscreteDomain(type) && isVgRangeStep(range)) {\n const scaleName = model.scaleName(channel);\n if (isFacetModel(model.parent)) {\n // If parent is facet and this is an independent scale, return only signal signal\n // as the width/height will be calculated using the cardinality from\n // facet's aggregate rather than reading from scale domain\n const parentResolve = model.parent.component.resolve;\n if (parentResolve.scale[channel] === 'independent') {\n return [stepSignal(scaleName, range)];\n }\n }\n return [\n stepSignal(scaleName, range),\n {\n name,\n update: sizeExpr(scaleName, scaleComponent, `domain('${scaleName}').length`)\n }\n ];\n }\n }\n /* istanbul ignore next: Condition should not happen -- only for warning in development. */\n throw new Error('layout size is step although width/height is not step.');\n }\n else if (size == 'container') {\n const isWidth = name.endsWith('width');\n const expr = isWidth ? 'containerSize()[0]' : 'containerSize()[1]';\n const defaultValue = getViewConfigContinuousSize(model.config.view, isWidth ? 'width' : 'height');\n const safeExpr = `isFinite(${expr}) ? ${expr} : ${defaultValue}`;\n return [{ name, init: safeExpr, on: [{ update: safeExpr, events: 'window:resize' }] }];\n }\n else {\n return [\n {\n name,\n value: size\n }\n ];\n }\n}\nfunction stepSignal(scaleName, range) {\n return {\n name: scaleName + '_step',\n value: range.step\n };\n}\nexport function sizeExpr(scaleName, scaleComponent, cardinality) {\n const type = scaleComponent.get('type');\n const padding = scaleComponent.get('padding');\n const paddingOuter = getFirstDefined(scaleComponent.get('paddingOuter'), padding);\n let paddingInner = scaleComponent.get('paddingInner');\n paddingInner =\n type === 'band'\n ? // only band has real paddingInner\n paddingInner !== undefined\n ? paddingInner\n : padding\n : // For point, as calculated in https://github.com/vega/vega-scale/blob/master/src/band.js#L128,\n // it's equivalent to have paddingInner = 1 since there is only n-1 steps between n points.\n 1;\n return `bandspace(${cardinality}, ${signalOrStringValue(paddingInner)}, ${signalOrStringValue(paddingOuter)}) * ${scaleName}_step`;\n}\n//# sourceMappingURL=assemble.js.map","export function getSizeTypeFromLayoutSizeType(layoutSizeType) {\n return layoutSizeType === 'childWidth' ? 'width' : layoutSizeType === 'childHeight' ? 'height' : layoutSizeType;\n}\n//# sourceMappingURL=component.js.map","import { keys } from '../util';\nimport { signalOrValueRef } from './common';\nimport { wrapCondition } from './mark/encode';\nexport function guideEncodeEntry(encoding, model) {\n return keys(encoding).reduce((encode, channel) => {\n const valueDef = encoding[channel];\n return Object.assign(Object.assign({}, encode), wrapCondition(model, valueDef, channel, def => signalOrValueRef(def.value)));\n }, {});\n}\n//# sourceMappingURL=guide.js.map","import { isXorY } from '../channel';\nimport * as log from '../log';\nimport { isConcatModel, isFacetModel, isLayerModel } from './model';\nexport function defaultScaleResolve(channel, model) {\n if (isLayerModel(model) || isFacetModel(model)) {\n return 'shared';\n }\n else if (isConcatModel(model)) {\n return isXorY(channel) ? 'independent' : 'shared';\n }\n /* istanbul ignore next: should never reach here. */\n throw new Error('invalid model type for resolve');\n}\nexport function parseGuideResolve(resolve, channel) {\n const channelScaleResolve = resolve.scale[channel];\n const guide = isXorY(channel) ? 'axis' : 'legend';\n if (channelScaleResolve === 'independent') {\n if (resolve[guide][channel] === 'shared') {\n log.warn(log.message.independentScaleMeansIndependentGuide(channel));\n }\n return 'independent';\n }\n return resolve[guide][channel] || 'shared';\n}\n//# sourceMappingURL=resolve.js.map","import { COMMON_LEGEND_PROPERTY_INDEX } from '../../legend';\nimport { keys } from '../../util';\nimport { Split } from '../split';\nconst LEGEND_COMPONENT_PROPERTY_INDEX = Object.assign(Object.assign({}, COMMON_LEGEND_PROPERTY_INDEX), { disable: 1, labelExpr: 1, selections: 1, \n // channel scales\n opacity: 1, shape: 1, stroke: 1, fill: 1, size: 1, strokeWidth: 1, strokeDash: 1, \n // encode\n encode: 1 });\nexport const LEGEND_COMPONENT_PROPERTIES = keys(LEGEND_COMPONENT_PROPERTY_INDEX);\nexport class LegendComponent extends Split {\n}\n//# sourceMappingURL=component.js.map","import { array, isArray, stringValue } from 'vega-util';\nimport { COLOR, OPACITY } from '../../channel';\nimport { hasConditionalValueDef, isFieldDef, isValueDef } from '../../channeldef';\nimport { FILL_STROKE_CONFIG } from '../../mark';\nimport { getFirstDefined, isEmpty, varName } from '../../util';\nimport { applyMarkConfig, signalOrValueRef } from '../common';\nimport { formatCustomType, isCustomFormatType } from '../format';\nimport * as mixins from '../mark/encode';\nimport { STORE } from '../selection';\nexport const legendEncodeRules = {\n symbols,\n gradient,\n labels,\n entries\n};\nexport function symbols(symbolsSpec, { fieldOrDatumDef, model, channel, legendCmpt, legendType }) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n if (legendType !== 'symbol') {\n return undefined;\n }\n const { markDef, encoding, config, mark } = model;\n const filled = markDef.filled && mark !== 'trail';\n let out = Object.assign(Object.assign({}, applyMarkConfig({}, model, FILL_STROKE_CONFIG)), mixins.color(model, { filled })); // FIXME: remove this when VgEncodeEntry is compatible with SymbolEncodeEntry\n const symbolOpacity = (_a = legendCmpt.get('symbolOpacity')) !== null && _a !== void 0 ? _a : config.legend.symbolOpacity;\n const symbolFillColor = (_b = legendCmpt.get('symbolFillColor')) !== null && _b !== void 0 ? _b : config.legend.symbolFillColor;\n const symbolStrokeColor = (_c = legendCmpt.get('symbolStrokeColor')) !== null && _c !== void 0 ? _c : config.legend.symbolStrokeColor;\n const opacity = symbolOpacity === undefined ? (_d = getMaxValue(encoding.opacity)) !== null && _d !== void 0 ? _d : markDef.opacity : undefined;\n if (out.fill) {\n // for fill legend, we don't want any fill in symbol\n if (channel === 'fill' || (filled && channel === COLOR)) {\n delete out.fill;\n }\n else {\n if (out.fill['field']) {\n // For others, set fill to some opaque value (or nothing if a color is already set)\n if (symbolFillColor) {\n delete out.fill;\n }\n else {\n out.fill = signalOrValueRef((_e = config.legend.symbolBaseFillColor) !== null && _e !== void 0 ? _e : 'black');\n out.fillOpacity = signalOrValueRef(opacity !== null && opacity !== void 0 ? opacity : 1);\n }\n }\n else if (isArray(out.fill)) {\n const fill = (_h = (_g = getFirstConditionValue((_f = encoding.fill) !== null && _f !== void 0 ? _f : encoding.color)) !== null && _g !== void 0 ? _g : markDef.fill) !== null && _h !== void 0 ? _h : (filled && markDef.color);\n if (fill) {\n out.fill = signalOrValueRef(fill);\n }\n }\n }\n }\n if (out.stroke) {\n if (channel === 'stroke' || (!filled && channel === COLOR)) {\n delete out.stroke;\n }\n else {\n if (out.stroke['field'] || symbolStrokeColor) {\n // For others, remove stroke field\n delete out.stroke;\n }\n else if (isArray(out.stroke)) {\n const stroke = getFirstDefined(getFirstConditionValue(encoding.stroke || encoding.color), markDef.stroke, filled ? markDef.color : undefined);\n if (stroke) {\n out.stroke = { value: stroke };\n }\n }\n }\n }\n if (channel !== OPACITY) {\n const condition = isFieldDef(fieldOrDatumDef) && selectedCondition(model, legendCmpt, fieldOrDatumDef);\n if (condition) {\n out.opacity = [\n Object.assign({ test: condition }, signalOrValueRef(opacity !== null && opacity !== void 0 ? opacity : 1)),\n signalOrValueRef(config.legend.unselectedOpacity)\n ];\n }\n else if (opacity) {\n out.opacity = signalOrValueRef(opacity);\n }\n }\n out = Object.assign(Object.assign({}, out), symbolsSpec);\n return isEmpty(out) ? undefined : out;\n}\nexport function gradient(gradientSpec, { model, legendType, legendCmpt }) {\n var _a;\n if (legendType !== 'gradient') {\n return undefined;\n }\n const { config, markDef, encoding } = model;\n let out = {};\n const gradientOpacity = (_a = legendCmpt.get('gradientOpacity')) !== null && _a !== void 0 ? _a : config.legend.gradientOpacity;\n const opacity = gradientOpacity === undefined ? getMaxValue(encoding.opacity) || markDef.opacity : undefined;\n if (opacity) {\n // only apply opacity if it is neither zero or undefined\n out.opacity = signalOrValueRef(opacity);\n }\n out = Object.assign(Object.assign({}, out), gradientSpec);\n return isEmpty(out) ? undefined : out;\n}\nexport function labels(specifiedlabelsSpec, { fieldOrDatumDef, model, channel, legendCmpt }) {\n const legend = model.legend(channel) || {};\n const config = model.config;\n const condition = isFieldDef(fieldOrDatumDef) ? selectedCondition(model, legendCmpt, fieldOrDatumDef) : undefined;\n const opacity = condition ? [{ test: condition, value: 1 }, { value: config.legend.unselectedOpacity }] : undefined;\n const { format, formatType } = legend;\n const text = isCustomFormatType(formatType)\n ? formatCustomType({\n fieldOrDatumDef,\n field: 'datum.value',\n format,\n formatType,\n config\n })\n : undefined;\n const labelsSpec = Object.assign(Object.assign(Object.assign({}, (opacity ? { opacity } : {})), (text ? { text } : {})), specifiedlabelsSpec);\n return isEmpty(labelsSpec) ? undefined : labelsSpec;\n}\nexport function entries(entriesSpec, { legendCmpt }) {\n const selections = legendCmpt.get('selections');\n return (selections === null || selections === void 0 ? void 0 : selections.length) ? Object.assign(Object.assign({}, entriesSpec), { fill: { value: 'transparent' } }) : entriesSpec;\n}\nfunction getMaxValue(channelDef) {\n return getConditionValue(channelDef, (v, conditionalDef) => Math.max(v, conditionalDef.value));\n}\nexport function getFirstConditionValue(channelDef) {\n return getConditionValue(channelDef, (v, conditionalDef) => {\n return getFirstDefined(v, conditionalDef.value);\n });\n}\nfunction getConditionValue(channelDef, reducer) {\n if (hasConditionalValueDef(channelDef)) {\n return array(channelDef.condition).reduce(reducer, channelDef.value);\n }\n else if (isValueDef(channelDef)) {\n return channelDef.value;\n }\n return undefined;\n}\nfunction selectedCondition(model, legendCmpt, fieldDef) {\n const selections = legendCmpt.get('selections');\n if (!(selections === null || selections === void 0 ? void 0 : selections.length))\n return undefined;\n const field = stringValue(fieldDef.field);\n return selections\n .map(name => {\n const store = stringValue(varName(name) + STORE);\n return `(!length(data(${store})) || (${name}[${field}] && indexof(${name}[${field}], datum.value) >= 0))`;\n })\n .join(' || ');\n}\n//# sourceMappingURL=encode.js.map","import { isArray } from 'vega-util';\nimport { isColorChannel } from '../../channel';\nimport { title as fieldDefTitle, valueArray } from '../../channeldef';\nimport { isContinuousToContinuous } from '../../scale';\nimport { contains, getFirstDefined } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { guideFormat, guideFormatType } from '../format';\nimport { getFirstConditionValue } from './encode';\nexport const legendRules = {\n direction: ({ direction }) => direction,\n format: ({ fieldOrDatumDef, legend, config }) => {\n const { format, formatType } = legend;\n return guideFormat(fieldOrDatumDef, fieldOrDatumDef.type, format, formatType, config, false);\n },\n formatType: ({ legend, fieldOrDatumDef, scaleType }) => {\n const { formatType } = legend;\n return guideFormatType(formatType, fieldOrDatumDef, scaleType);\n },\n gradientLength: params => {\n var _a, _b;\n const { legend, legendConfig } = params;\n return (_b = (_a = legend.gradientLength) !== null && _a !== void 0 ? _a : legendConfig.gradientLength) !== null && _b !== void 0 ? _b : defaultGradientLength(params);\n },\n labelOverlap: ({ legend, legendConfig, scaleType }) => { var _a, _b; return (_b = (_a = legend.labelOverlap) !== null && _a !== void 0 ? _a : legendConfig.labelOverlap) !== null && _b !== void 0 ? _b : defaultLabelOverlap(scaleType); },\n symbolType: ({ legend, markDef, channel, encoding }) => { var _a; return (_a = legend.symbolType) !== null && _a !== void 0 ? _a : defaultSymbolType(markDef.type, channel, encoding.shape, markDef.shape); },\n title: ({ fieldOrDatumDef, config }) => fieldDefTitle(fieldOrDatumDef, config, { allowDisabling: true }),\n type: ({ legendType, scaleType, channel }) => {\n if (isColorChannel(channel) && isContinuousToContinuous(scaleType)) {\n if (legendType === 'gradient') {\n return undefined;\n }\n }\n else if (legendType === 'symbol') {\n return undefined;\n }\n return legendType;\n },\n values: ({ fieldOrDatumDef, legend }) => values(legend, fieldOrDatumDef)\n};\nexport function values(legend, fieldOrDatumDef) {\n const vals = legend.values;\n if (isArray(vals)) {\n return valueArray(fieldOrDatumDef, vals);\n }\n else if (isSignalRef(vals)) {\n return vals;\n }\n return undefined;\n}\nexport function defaultSymbolType(mark, channel, shapeChannelDef, markShape) {\n var _a;\n if (channel !== 'shape') {\n // use the value from the shape encoding or the mark config if they exist\n const shape = (_a = getFirstConditionValue(shapeChannelDef)) !== null && _a !== void 0 ? _a : markShape;\n if (shape) {\n return shape;\n }\n }\n switch (mark) {\n case 'bar':\n case 'rect':\n case 'image':\n case 'square':\n return 'square';\n case 'line':\n case 'trail':\n case 'rule':\n return 'stroke';\n case 'arc':\n case 'point':\n case 'circle':\n case 'tick':\n case 'geoshape':\n case 'area':\n case 'text':\n return 'circle';\n }\n}\nexport function clipHeight(legendType) {\n if (legendType === 'gradient') {\n return 20;\n }\n return undefined;\n}\nexport function getLegendType(params) {\n const { legend } = params;\n return getFirstDefined(legend.type, defaultType(params));\n}\nexport function defaultType({ channel, timeUnit, scaleType }) {\n // Following the logic in https://github.com/vega/vega-parser/blob/master/src/parsers/legend.js\n if (isColorChannel(channel)) {\n if (contains(['quarter', 'month', 'day'], timeUnit)) {\n return 'symbol';\n }\n if (isContinuousToContinuous(scaleType)) {\n return 'gradient';\n }\n }\n return 'symbol';\n}\nexport function getDirection({ legendConfig, legendType, orient, legend }) {\n var _a, _b;\n return ((_b = (_a = legend.direction) !== null && _a !== void 0 ? _a : legendConfig[legendType ? 'gradientDirection' : 'symbolDirection']) !== null && _b !== void 0 ? _b : defaultDirection(orient, legendType));\n}\nexport function defaultDirection(orient, legendType) {\n switch (orient) {\n case 'top':\n case 'bottom':\n return 'horizontal';\n case 'left':\n case 'right':\n case 'none':\n case undefined: // undefined = \"right\" in Vega\n return undefined; // vertical is Vega's default\n default:\n // top-left / ...\n // For inner legend, uses compact layout like Tableau\n return legendType === 'gradient' ? 'horizontal' : undefined;\n }\n}\nexport function defaultGradientLength({ legendConfig, model, direction, orient, scaleType }) {\n const { gradientHorizontalMaxLength, gradientHorizontalMinLength, gradientVerticalMaxLength, gradientVerticalMinLength } = legendConfig;\n if (isContinuousToContinuous(scaleType)) {\n if (direction === 'horizontal') {\n if (orient === 'top' || orient === 'bottom') {\n return gradientLengthSignal(model, 'width', gradientHorizontalMinLength, gradientHorizontalMaxLength);\n }\n else {\n return gradientHorizontalMinLength;\n }\n }\n else {\n // vertical / undefined (Vega uses vertical by default)\n return gradientLengthSignal(model, 'height', gradientVerticalMinLength, gradientVerticalMaxLength);\n }\n }\n return undefined;\n}\nfunction gradientLengthSignal(model, sizeType, min, max) {\n const sizeSignal = model.getSizeSignalRef(sizeType).signal;\n return { signal: `clamp(${sizeSignal}, ${min}, ${max})` };\n}\nexport function defaultLabelOverlap(scaleType) {\n if (contains(['quantile', 'threshold', 'log', 'symlog'], scaleType)) {\n return 'greedy';\n }\n return undefined;\n}\n//# sourceMappingURL=properties.js.map","import { COLOR, SHAPE } from '../../channel';\nimport { getFieldOrDatumDef, isFieldDef } from '../../channeldef';\nimport { LEGEND_SCALE_CHANNELS } from '../../legend';\nimport { normalizeTimeUnit } from '../../timeunit';\nimport { GEOJSON } from '../../type';\nimport { deleteNestedProperty, isEmpty, keys, varName } from '../../util';\nimport { mergeTitleComponent } from '../common';\nimport { guideEncodeEntry } from '../guide';\nimport { isUnitModel } from '../model';\nimport { parseGuideResolve } from '../resolve';\nimport { parseInteractiveLegend } from '../selection/transforms/legends';\nimport { defaultTieBreaker, makeImplicit, mergeValuesWithExplicit } from '../split';\nimport { LegendComponent, LEGEND_COMPONENT_PROPERTIES } from './component';\nimport { legendEncodeRules } from './encode';\nimport { getDirection, getLegendType, legendRules } from './properties';\nexport function parseLegend(model) {\n const legendComponent = isUnitModel(model) ? parseUnitLegend(model) : parseNonUnitLegend(model);\n model.component.legends = legendComponent;\n return legendComponent;\n}\nfunction parseUnitLegend(model) {\n const { encoding } = model;\n const legendComponent = {};\n for (const channel of [COLOR, ...LEGEND_SCALE_CHANNELS]) {\n const def = getFieldOrDatumDef(encoding[channel]);\n if (!def || !model.getScaleComponent(channel)) {\n continue;\n }\n if (channel === SHAPE && isFieldDef(def) && def.type === GEOJSON) {\n continue;\n }\n legendComponent[channel] = parseLegendForChannel(model, channel);\n }\n return legendComponent;\n}\nfunction getLegendDefWithScale(model, channel) {\n const scale = model.scaleName(channel);\n if (model.mark === 'trail') {\n if (channel === 'color') {\n // trail is a filled mark, but its default symbolType (\"stroke\") should use \"stroke\"\n return { stroke: scale };\n }\n else if (channel === 'size') {\n return { strokeWidth: scale };\n }\n }\n if (channel === 'color') {\n return model.markDef.filled ? { fill: scale } : { stroke: scale };\n }\n return { [channel]: scale };\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isExplicit(value, property, legend, fieldDef) {\n switch (property) {\n case 'disable':\n return legend !== undefined; // if axis is specified or null/false, then it's enable/disable state is explicit\n case 'values':\n // specified legend.values is already respected, but may get transformed.\n return !!(legend === null || legend === void 0 ? void 0 : legend.values);\n case 'title':\n // title can be explicit if fieldDef.title is set\n if (property === 'title' && value === (fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.title)) {\n return true;\n }\n }\n // Otherwise, things are explicit if the returned value matches the specified property\n return value === (legend || {})[property];\n}\nexport function parseLegendForChannel(model, channel) {\n var _a, _b, _c;\n let legend = model.legend(channel);\n const { markDef, encoding, config } = model;\n const legendConfig = config.legend;\n const legendCmpt = new LegendComponent({}, getLegendDefWithScale(model, channel));\n parseInteractiveLegend(model, channel, legendCmpt);\n const disable = legend !== undefined ? !legend : legendConfig.disable;\n legendCmpt.set('disable', disable, legend !== undefined);\n if (disable) {\n return legendCmpt;\n }\n legend = legend || {};\n const scaleType = model.getScaleComponent(channel).get('type');\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n const timeUnit = isFieldDef(fieldOrDatumDef) ? (_a = normalizeTimeUnit(fieldOrDatumDef.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit : undefined;\n const orient = legend.orient || config.legend.orient || 'right';\n const legendType = getLegendType({ legend, channel, timeUnit, scaleType });\n const direction = getDirection({ legend, legendType, orient, legendConfig });\n const ruleParams = {\n legend,\n channel,\n model,\n markDef,\n encoding,\n fieldOrDatumDef,\n legendConfig,\n config,\n scaleType,\n orient,\n legendType,\n direction\n };\n for (const property of LEGEND_COMPONENT_PROPERTIES) {\n if ((legendType === 'gradient' && property.startsWith('symbol')) ||\n (legendType === 'symbol' && property.startsWith('gradient'))) {\n continue;\n }\n const value = property in legendRules ? legendRules[property](ruleParams) : legend[property];\n if (value !== undefined) {\n const explicit = isExplicit(value, property, legend, model.fieldDef(channel));\n if (explicit || config.legend[property] === undefined) {\n legendCmpt.set(property, value, explicit);\n }\n }\n }\n const legendEncoding = (_b = legend === null || legend === void 0 ? void 0 : legend.encoding) !== null && _b !== void 0 ? _b : {};\n const selections = legendCmpt.get('selections');\n const legendEncode = {};\n const legendEncodeParams = { fieldOrDatumDef, model, channel, legendCmpt, legendType };\n for (const part of ['labels', 'legend', 'title', 'symbols', 'gradient', 'entries']) {\n const legendEncodingPart = guideEncodeEntry((_c = legendEncoding[part]) !== null && _c !== void 0 ? _c : {}, model);\n const value = part in legendEncodeRules\n ? legendEncodeRules[part](legendEncodingPart, legendEncodeParams) // apply rule\n : legendEncodingPart; // no rule -- just default values\n if (value !== undefined && !isEmpty(value)) {\n legendEncode[part] = Object.assign(Object.assign(Object.assign({}, ((selections === null || selections === void 0 ? void 0 : selections.length) && isFieldDef(fieldOrDatumDef)\n ? { name: `${varName(fieldOrDatumDef.field)}_legend_${part}` }\n : {})), ((selections === null || selections === void 0 ? void 0 : selections.length) ? { interactive: !!selections } : {})), { update: value });\n }\n }\n if (!isEmpty(legendEncode)) {\n legendCmpt.set('encode', legendEncode, !!(legend === null || legend === void 0 ? void 0 : legend.encoding));\n }\n return legendCmpt;\n}\nfunction parseNonUnitLegend(model) {\n const { legends, resolve } = model.component;\n for (const child of model.children) {\n parseLegend(child);\n for (const channel of keys(child.component.legends)) {\n resolve.legend[channel] = parseGuideResolve(model.component.resolve, channel);\n if (resolve.legend[channel] === 'shared') {\n // If the resolve says shared (and has not been overridden)\n // We will try to merge and see if there is a conflict\n legends[channel] = mergeLegendComponent(legends[channel], child.component.legends[channel]);\n if (!legends[channel]) {\n // If merge returns nothing, there is a conflict so we cannot make the legend shared.\n // Thus, mark legend as independent and remove the legend component.\n resolve.legend[channel] = 'independent';\n delete legends[channel];\n }\n }\n }\n }\n for (const channel of keys(legends)) {\n for (const child of model.children) {\n if (!child.component.legends[channel]) {\n // skip if the child does not have a particular legend\n continue;\n }\n if (resolve.legend[channel] === 'shared') {\n // After merging shared legend, make sure to remove legend from child\n delete child.component.legends[channel];\n }\n }\n }\n return legends;\n}\nexport function mergeLegendComponent(mergedLegend, childLegend) {\n var _a, _b, _c, _d;\n if (!mergedLegend) {\n return childLegend.clone();\n }\n const mergedOrient = mergedLegend.getWithExplicit('orient');\n const childOrient = childLegend.getWithExplicit('orient');\n if (mergedOrient.explicit && childOrient.explicit && mergedOrient.value !== childOrient.value) {\n // TODO: throw warning if resolve is explicit (We don't have info about explicit/implicit resolve yet.)\n // Cannot merge due to inconsistent orient\n return undefined;\n }\n let typeMerged = false;\n // Otherwise, let's merge\n for (const prop of LEGEND_COMPONENT_PROPERTIES) {\n const mergedValueWithExplicit = mergeValuesWithExplicit(mergedLegend.getWithExplicit(prop), childLegend.getWithExplicit(prop), prop, 'legend', \n // Tie breaker function\n (v1, v2) => {\n switch (prop) {\n case 'symbolType':\n return mergeSymbolType(v1, v2);\n case 'title':\n return mergeTitleComponent(v1, v2);\n case 'type':\n // There are only two types. If we have different types, then prefer symbol over gradient.\n typeMerged = true;\n return makeImplicit('symbol');\n }\n return defaultTieBreaker(v1, v2, prop, 'legend');\n });\n mergedLegend.setWithExplicit(prop, mergedValueWithExplicit);\n }\n if (typeMerged) {\n if ((_b = (_a = mergedLegend.implicit) === null || _a === void 0 ? void 0 : _a.encode) === null || _b === void 0 ? void 0 : _b.gradient) {\n deleteNestedProperty(mergedLegend.implicit, ['encode', 'gradient']);\n }\n if ((_d = (_c = mergedLegend.explicit) === null || _c === void 0 ? void 0 : _c.encode) === null || _d === void 0 ? void 0 : _d.gradient) {\n deleteNestedProperty(mergedLegend.explicit, ['encode', 'gradient']);\n }\n }\n return mergedLegend;\n}\nfunction mergeSymbolType(st1, st2) {\n if (st2.value === 'circle') {\n // prefer \"circle\" over \"stroke\"\n return st2;\n }\n return st1;\n}\n//# sourceMappingURL=parse.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { LEGEND_SCALE_CHANNELS } from '../../legend';\nimport { keys, replaceAll, stringify, vals } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { mergeLegendComponent } from './parse';\nfunction setLegendEncode(legend, part, vgProp, vgRef) {\n var _a, _b, _c;\n legend.encode = (_a = legend.encode) !== null && _a !== void 0 ? _a : {};\n legend.encode[part] = (_b = legend.encode[part]) !== null && _b !== void 0 ? _b : {};\n legend.encode[part].update = (_c = legend.encode[part].update) !== null && _c !== void 0 ? _c : {};\n // TODO: remove as any after https://github.com/prisma/nexus-prisma/issues/291\n legend.encode[part].update[vgProp] = vgRef;\n}\nexport function assembleLegends(model) {\n const legendComponentIndex = model.component.legends;\n const legendByDomain = {};\n for (const channel of keys(legendComponentIndex)) {\n const scaleComponent = model.getScaleComponent(channel);\n const domainHash = stringify(scaleComponent.get('domains'));\n if (legendByDomain[domainHash]) {\n for (const mergedLegendComponent of legendByDomain[domainHash]) {\n const merged = mergeLegendComponent(mergedLegendComponent, legendComponentIndex[channel]);\n if (!merged) {\n // If cannot merge, need to add this legend separately\n legendByDomain[domainHash].push(legendComponentIndex[channel]);\n }\n }\n }\n else {\n legendByDomain[domainHash] = [legendComponentIndex[channel].clone()];\n }\n }\n const legends = vals(legendByDomain)\n .flat()\n .map(l => assembleLegend(l, model.config))\n .filter(l => l !== undefined);\n return legends;\n}\nexport function assembleLegend(legendCmpt, config) {\n var _a, _b, _c;\n const _d = legendCmpt.combine(), { disable, labelExpr, selections } = _d, legend = __rest(_d, [\"disable\", \"labelExpr\", \"selections\"]);\n if (disable) {\n return undefined;\n }\n if (config.aria === false && legend.aria == undefined) {\n legend.aria = false;\n }\n if ((_a = legend.encode) === null || _a === void 0 ? void 0 : _a.symbols) {\n const out = legend.encode.symbols.update;\n if (out.fill && out.fill['value'] !== 'transparent' && !out.stroke && !legend.stroke) {\n // For non color channel's legend, we need to override symbol stroke config from Vega config if stroke channel is not used.\n out.stroke = { value: 'transparent' };\n }\n // Remove properties that the legend is encoding.\n for (const property of LEGEND_SCALE_CHANNELS) {\n if (legend[property]) {\n delete out[property];\n }\n }\n }\n if (!legend.title) {\n // title schema doesn't include null, ''\n delete legend.title;\n }\n if (labelExpr !== undefined) {\n let expr = labelExpr;\n if (((_c = (_b = legend.encode) === null || _b === void 0 ? void 0 : _b.labels) === null || _c === void 0 ? void 0 : _c.update) && isSignalRef(legend.encode.labels.update.text)) {\n expr = replaceAll(labelExpr, 'datum.label', legend.encode.labels.update.text.signal);\n }\n setLegendEncode(legend, 'labels', 'text', { signal: expr });\n }\n return legend;\n}\n//# sourceMappingURL=assemble.js.map","import { contains } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { isConcatModel, isLayerModel } from '../model';\nexport function assembleProjections(model) {\n if (isLayerModel(model) || isConcatModel(model)) {\n return assembleProjectionsForModelAndChildren(model);\n }\n else {\n return assembleProjectionForModel(model);\n }\n}\nexport function assembleProjectionsForModelAndChildren(model) {\n return model.children.reduce((projections, child) => {\n return projections.concat(child.assembleProjections());\n }, assembleProjectionForModel(model));\n}\nexport function assembleProjectionForModel(model) {\n const component = model.component.projection;\n if (!component || component.merged) {\n return [];\n }\n const projection = component.combine();\n const { name } = projection; // we need to extract name so that it is always present in the output and pass TS type validation\n if (!component.data) {\n // generate custom projection, no automatic fitting\n return [\n Object.assign(Object.assign({ name }, { translate: { signal: '[width / 2, height / 2]' } }), projection)\n ];\n }\n else {\n // generate projection that uses extent fitting\n const size = {\n signal: `[${component.size.map(ref => ref.signal).join(', ')}]`\n };\n const fits = component.data.reduce((sources, data) => {\n const source = isSignalRef(data) ? data.signal : `data('${model.lookupDataSource(data)}')`;\n if (!contains(sources, source)) {\n // build a unique list of sources\n sources.push(source);\n }\n return sources;\n }, []);\n if (fits.length <= 0) {\n throw new Error(\"Projection's fit didn't find any data sources\");\n }\n return [\n Object.assign({ name,\n size, fit: {\n signal: fits.length > 1 ? `[${fits.join(', ')}]` : fits[0]\n } }, projection)\n ];\n }\n}\n//# sourceMappingURL=assemble.js.map","export const PROJECTION_PROPERTIES = [\n 'type',\n 'clipAngle',\n 'clipExtent',\n 'center',\n 'rotate',\n 'precision',\n 'reflectX',\n 'reflectY',\n 'coefficient',\n 'distance',\n 'fraction',\n 'lobes',\n 'parallel',\n 'radius',\n 'ratio',\n 'spacing',\n 'tilt'\n];\n//# sourceMappingURL=projection.js.map","import { Split } from '../split';\nexport class ProjectionComponent extends Split {\n constructor(name, specifiedProjection, size, data) {\n super(Object.assign({}, specifiedProjection), // all explicit properties of projection\n { name } // name as initial implicit property\n );\n this.specifiedProjection = specifiedProjection;\n this.size = size;\n this.data = data;\n this.merged = false;\n }\n /**\n * Whether the projection parameters should fit provided data.\n */\n get isFit() {\n return !!this.data;\n }\n}\n//# sourceMappingURL=component.js.map","import { hasOwnProperty } from 'vega-util';\nimport { LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2, SHAPE } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { DataSourceType } from '../../data';\nimport { PROJECTION_PROPERTIES } from '../../projection';\nimport { GEOJSON } from '../../type';\nimport { duplicate, every, stringify } from '../../util';\nimport { isUnitModel } from '../model';\nimport { ProjectionComponent } from './component';\nexport function parseProjection(model) {\n model.component.projection = isUnitModel(model) ? parseUnitProjection(model) : parseNonUnitProjections(model);\n}\nfunction parseUnitProjection(model) {\n var _a;\n if (model.hasProjection) {\n const proj = model.specifiedProjection;\n const fit = !(proj && (proj.scale != null || proj.translate != null));\n const size = fit ? [model.getSizeSignalRef('width'), model.getSizeSignalRef('height')] : undefined;\n const data = fit ? gatherFitData(model) : undefined;\n return new ProjectionComponent(model.projectionName(true), Object.assign(Object.assign({}, ((_a = model.config.projection) !== null && _a !== void 0 ? _a : {})), (proj !== null && proj !== void 0 ? proj : {})), size, data);\n }\n return undefined;\n}\nfunction gatherFitData(model) {\n const data = [];\n const { encoding } = model;\n for (const posssiblePair of [\n [LONGITUDE, LATITUDE],\n [LONGITUDE2, LATITUDE2]\n ]) {\n if (getFieldOrDatumDef(encoding[posssiblePair[0]]) || getFieldOrDatumDef(encoding[posssiblePair[1]])) {\n data.push({\n signal: model.getName(`geojson_${data.length}`)\n });\n }\n }\n if (model.channelHasField(SHAPE) && model.typedFieldDef(SHAPE).type === GEOJSON) {\n data.push({\n signal: model.getName(`geojson_${data.length}`)\n });\n }\n if (data.length === 0) {\n // main source is geojson, so we can just use that\n data.push(model.requestDataName(DataSourceType.Main));\n }\n return data;\n}\nfunction mergeIfNoConflict(first, second) {\n const allPropertiesShared = every(PROJECTION_PROPERTIES, prop => {\n // neither has the property\n if (!hasOwnProperty(first.explicit, prop) && !hasOwnProperty(second.explicit, prop)) {\n return true;\n }\n // both have property and an equal value for property\n if (hasOwnProperty(first.explicit, prop) &&\n hasOwnProperty(second.explicit, prop) &&\n // some properties might be signals or objects and require hashing for comparison\n stringify(first.get(prop)) === stringify(second.get(prop))) {\n return true;\n }\n return false;\n });\n const size = stringify(first.size) === stringify(second.size);\n if (size) {\n if (allPropertiesShared) {\n return first;\n }\n else if (stringify(first.explicit) === stringify({})) {\n return second;\n }\n else if (stringify(second.explicit) === stringify({})) {\n return first;\n }\n }\n // if all properties don't match, let each unit spec have its own projection\n return null;\n}\nfunction parseNonUnitProjections(model) {\n if (model.children.length === 0) {\n return undefined;\n }\n let nonUnitProjection;\n // parse all children first\n for (const child of model.children) {\n parseProjection(child);\n }\n // analyze parsed projections, attempt to merge\n const mergable = every(model.children, child => {\n const projection = child.component.projection;\n if (!projection) {\n // child layer does not use a projection\n return true;\n }\n else if (!nonUnitProjection) {\n // cached 'projection' is null, cache this one\n nonUnitProjection = projection;\n return true;\n }\n else {\n const merge = mergeIfNoConflict(nonUnitProjection, projection);\n if (merge) {\n nonUnitProjection = merge;\n }\n return !!merge;\n }\n });\n // if cached one and all other children share the same projection,\n if (nonUnitProjection && mergable) {\n // so we can elevate it to the layer level\n const name = model.projectionName(true);\n const modelProjection = new ProjectionComponent(name, nonUnitProjection.specifiedProjection, nonUnitProjection.size, duplicate(nonUnitProjection.data));\n // rename and assign all others as merged\n for (const child of model.children) {\n const projection = child.component.projection;\n if (projection) {\n if (projection.isFit) {\n modelProjection.data.push(...child.component.projection.data);\n }\n child.renameProjection(projection.get('name'), name);\n projection.merged = true;\n }\n }\n return modelProjection;\n }\n return undefined;\n}\n//# sourceMappingURL=parse.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isString } from 'vega-util';\nimport { binToString, isBinning, isSelectionExtent } from '../../bin';\nimport { binRequiresRange, isTypedFieldDef, normalizeBin, vgField } from '../../channeldef';\nimport { duplicate, hash, isEmpty, keys, replacePathInField, unique, vals, varName } from '../../util';\nimport { binFormatExpression } from '../format';\nimport { isUnitModel } from '../model';\nimport { parseSelectionBinExtent } from '../selection/parse';\nimport { DataFlowNode } from './dataflow';\nfunction rangeFormula(model, fieldDef, channel, config) {\n var _a, _b;\n if (binRequiresRange(fieldDef, channel)) {\n // read format from axis or legend, if there is no format then use config.numberFormat\n const guide = isUnitModel(model)\n ? (_b = (_a = model.axis(channel)) !== null && _a !== void 0 ? _a : model.legend(channel)) !== null && _b !== void 0 ? _b : {} : {};\n const startField = vgField(fieldDef, { expr: 'datum' });\n const endField = vgField(fieldDef, { expr: 'datum', binSuffix: 'end' });\n return {\n formulaAs: vgField(fieldDef, { binSuffix: 'range', forAs: true }),\n formula: binFormatExpression(startField, endField, guide.format, guide.formatType, config)\n };\n }\n return {};\n}\nfunction binKey(bin, field) {\n return `${binToString(bin)}_${field}`;\n}\nfunction getSignalsFromModel(model, key) {\n return {\n signal: model.getName(`${key}_bins`),\n extentSignal: model.getName(`${key}_extent`)\n };\n}\nexport function getBinSignalName(model, field, bin) {\n var _a;\n const normalizedBin = (_a = normalizeBin(bin, undefined)) !== null && _a !== void 0 ? _a : {};\n const key = binKey(normalizedBin, field);\n return model.getName(`${key}_bins`);\n}\nfunction isBinTransform(t) {\n return 'as' in t;\n}\nfunction createBinComponent(t, bin, model) {\n let as;\n let span;\n if (isBinTransform(t)) {\n as = isString(t.as) ? [t.as, `${t.as}_end`] : [t.as[0], t.as[1]];\n }\n else {\n as = [vgField(t, { forAs: true }), vgField(t, { binSuffix: 'end', forAs: true })];\n }\n const normalizedBin = Object.assign({}, normalizeBin(bin, undefined));\n const key = binKey(normalizedBin, t.field);\n const { signal, extentSignal } = getSignalsFromModel(model, key);\n if (isSelectionExtent(normalizedBin.extent)) {\n const ext = normalizedBin.extent;\n const selName = ext.selection;\n span = parseSelectionBinExtent(model.getSelectionComponent(varName(selName), selName), ext);\n delete normalizedBin.extent; // Vega-Lite selection extent map to Vega's span property.\n }\n const binComponent = Object.assign(Object.assign(Object.assign({ bin: normalizedBin, field: t.field, as: [as] }, (signal ? { signal } : {})), (extentSignal ? { extentSignal } : {})), (span ? { span } : {}));\n return { key, binComponent };\n}\nexport class BinNode extends DataFlowNode {\n constructor(parent, bins) {\n super(parent);\n this.bins = bins;\n }\n clone() {\n return new BinNode(null, duplicate(this.bins));\n }\n static makeFromEncoding(parent, model) {\n const bins = model.reduceFieldDef((binComponentIndex, fieldDef, channel) => {\n if (isTypedFieldDef(fieldDef) && isBinning(fieldDef.bin)) {\n const { key, binComponent } = createBinComponent(fieldDef, fieldDef.bin, model);\n binComponentIndex[key] = Object.assign(Object.assign(Object.assign({}, binComponent), binComponentIndex[key]), rangeFormula(model, fieldDef, channel, model.config));\n }\n return binComponentIndex;\n }, {});\n if (isEmpty(bins)) {\n return null;\n }\n return new BinNode(parent, bins);\n }\n /**\n * Creates a bin node from BinTransform.\n * The optional parameter should provide\n */\n static makeFromTransform(parent, t, model) {\n const { key, binComponent } = createBinComponent(t, t.bin, model);\n return new BinNode(parent, {\n [key]: binComponent\n });\n }\n /**\n * Merge bin nodes. This method either integrates the bin config from the other node\n * or if this node already has a bin config, renames the corresponding signal in the model.\n */\n merge(other, renameSignal) {\n for (const key of keys(other.bins)) {\n if (key in this.bins) {\n renameSignal(other.bins[key].signal, this.bins[key].signal);\n // Ensure that we don't have duplicate names for signal pairs\n this.bins[key].as = unique([...this.bins[key].as, ...other.bins[key].as], hash);\n }\n else {\n this.bins[key] = other.bins[key];\n }\n }\n for (const child of other.children) {\n other.removeChild(child);\n child.parent = this;\n }\n other.remove();\n }\n producedFields() {\n return new Set(vals(this.bins)\n .map(c => c.as)\n .flat(2));\n }\n dependentFields() {\n return new Set(vals(this.bins).map(c => c.field));\n }\n hash() {\n return `Bin ${hash(this.bins)}`;\n }\n assemble() {\n return vals(this.bins).flatMap(bin => {\n const transform = [];\n const [binAs, ...remainingAs] = bin.as;\n const _a = bin.bin, { extent } = _a, params = __rest(_a, [\"extent\"]);\n const binTrans = Object.assign(Object.assign(Object.assign({ type: 'bin', field: replacePathInField(bin.field), as: binAs, signal: bin.signal }, (!isSelectionExtent(extent) ? { extent } : { extent: null })), (bin.span ? { span: { signal: `span(${bin.span})` } } : {})), params);\n if (!extent && bin.extentSignal) {\n transform.push({\n type: 'extent',\n field: replacePathInField(bin.field),\n signal: bin.extentSignal\n });\n binTrans.extent = { signal: bin.extentSignal };\n }\n transform.push(binTrans);\n for (const as of remainingAs) {\n for (let i = 0; i < 2; i++) {\n transform.push({\n type: 'formula',\n expr: vgField({ field: binAs[i] }, { expr: 'datum' }),\n as: as[i]\n });\n }\n }\n if (bin.formula) {\n transform.push({\n type: 'formula',\n expr: bin.formula,\n as: bin.formulaAs\n });\n }\n return transform;\n });\n }\n}\n//# sourceMappingURL=bin.js.map","import { isArgmaxDef, isArgminDef } from '../../aggregate';\nimport { getPositionChannelFromLatLong, getSecondaryRangeChannel, isGeoPositionChannel, isScaleChannel } from '../../channel';\nimport { binRequiresRange, hasBand, isTypedFieldDef, vgField } from '../../channeldef';\nimport * as log from '../../log';\nimport { duplicate, hash, keys, replacePathInField, setEqual } from '../../util';\nimport { isUnitModel } from '../model';\nimport { DataFlowNode } from './dataflow';\nfunction addDimension(dims, channel, fieldDef, model) {\n const channelDef2 = isUnitModel(model) ? model.encoding[getSecondaryRangeChannel(channel)] : undefined;\n if (isTypedFieldDef(fieldDef) &&\n isUnitModel(model) &&\n hasBand(channel, fieldDef, channelDef2, model.stack, model.markDef, model.config)) {\n dims.add(vgField(fieldDef, {}));\n dims.add(vgField(fieldDef, { suffix: 'end' }));\n if (fieldDef.bin && binRequiresRange(fieldDef, channel)) {\n dims.add(vgField(fieldDef, { binSuffix: 'range' }));\n }\n }\n else if (isGeoPositionChannel(channel)) {\n const posChannel = getPositionChannelFromLatLong(channel);\n dims.add(model.getName(posChannel));\n }\n else {\n dims.add(vgField(fieldDef));\n }\n return dims;\n}\nfunction mergeMeasures(parentMeasures, childMeasures) {\n var _a;\n for (const field of keys(childMeasures)) {\n // when we merge a measure, we either have to add an aggregation operator or even a new field\n const ops = childMeasures[field];\n for (const op of keys(ops)) {\n if (field in parentMeasures) {\n // add operator to existing measure field\n parentMeasures[field][op] = new Set([...((_a = parentMeasures[field][op]) !== null && _a !== void 0 ? _a : []), ...ops[op]]);\n }\n else {\n parentMeasures[field] = { [op]: ops[op] };\n }\n }\n }\n}\nexport class AggregateNode extends DataFlowNode {\n /**\n * @param dimensions string set for dimensions\n * @param measures dictionary mapping field name => dict of aggregation functions and names to use\n */\n constructor(parent, dimensions, measures) {\n super(parent);\n this.dimensions = dimensions;\n this.measures = measures;\n }\n clone() {\n return new AggregateNode(null, new Set(this.dimensions), duplicate(this.measures));\n }\n get groupBy() {\n return this.dimensions;\n }\n static makeFromEncoding(parent, model) {\n let isAggregate = false;\n model.forEachFieldDef(fd => {\n if (fd.aggregate) {\n isAggregate = true;\n }\n });\n const meas = {};\n const dims = new Set();\n if (!isAggregate) {\n // no need to create this node if the model has no aggregation\n return null;\n }\n model.forEachFieldDef((fieldDef, channel) => {\n var _a, _b, _c, _d;\n const { aggregate, field } = fieldDef;\n if (aggregate) {\n if (aggregate === 'count') {\n meas['*'] = (_a = meas['*']) !== null && _a !== void 0 ? _a : {};\n meas['*']['count'] = new Set([vgField(fieldDef, { forAs: true })]);\n }\n else {\n if (isArgminDef(aggregate) || isArgmaxDef(aggregate)) {\n const op = isArgminDef(aggregate) ? 'argmin' : 'argmax';\n const argField = aggregate[op];\n meas[argField] = (_b = meas[argField]) !== null && _b !== void 0 ? _b : {};\n meas[argField][op] = new Set([vgField({ op, field: argField }, { forAs: true })]);\n }\n else {\n meas[field] = (_c = meas[field]) !== null && _c !== void 0 ? _c : {};\n meas[field][aggregate] = new Set([vgField(fieldDef, { forAs: true })]);\n }\n // For scale channel with domain === 'unaggregated', add min/max so we can use their union as unaggregated domain\n if (isScaleChannel(channel) && model.scaleDomain(channel) === 'unaggregated') {\n meas[field] = (_d = meas[field]) !== null && _d !== void 0 ? _d : {};\n meas[field]['min'] = new Set([vgField({ field, aggregate: 'min' }, { forAs: true })]);\n meas[field]['max'] = new Set([vgField({ field, aggregate: 'max' }, { forAs: true })]);\n }\n }\n }\n else {\n addDimension(dims, channel, fieldDef, model);\n }\n });\n if (dims.size + keys(meas).length === 0) {\n return null;\n }\n return new AggregateNode(parent, dims, meas);\n }\n static makeFromTransform(parent, t) {\n var _a, _b, _c;\n const dims = new Set();\n const meas = {};\n for (const s of t.aggregate) {\n const { op, field, as } = s;\n if (op) {\n if (op === 'count') {\n meas['*'] = (_a = meas['*']) !== null && _a !== void 0 ? _a : {};\n meas['*']['count'] = new Set([as ? as : vgField(s, { forAs: true })]);\n }\n else {\n meas[field] = (_b = meas[field]) !== null && _b !== void 0 ? _b : {};\n meas[field][op] = new Set([as ? as : vgField(s, { forAs: true })]);\n }\n }\n }\n for (const s of (_c = t.groupby) !== null && _c !== void 0 ? _c : []) {\n dims.add(s);\n }\n if (dims.size + keys(meas).length === 0) {\n return null;\n }\n return new AggregateNode(parent, dims, meas);\n }\n merge(other) {\n if (setEqual(this.dimensions, other.dimensions)) {\n mergeMeasures(this.measures, other.measures);\n return true;\n }\n else {\n log.debug('different dimensions, cannot merge');\n return false;\n }\n }\n addDimensions(fields) {\n fields.forEach(this.dimensions.add, this.dimensions);\n }\n dependentFields() {\n return new Set([...this.dimensions, ...keys(this.measures)]);\n }\n producedFields() {\n const out = new Set();\n for (const field of keys(this.measures)) {\n for (const op of keys(this.measures[field])) {\n const m = this.measures[field][op];\n if (m.size === 0) {\n out.add(`${op}_${field}`);\n }\n else {\n m.forEach(out.add, out);\n }\n }\n }\n return out;\n }\n hash() {\n return `Aggregate ${hash({ dimensions: this.dimensions, measures: this.measures })}`;\n }\n assemble() {\n const ops = [];\n const fields = [];\n const as = [];\n for (const field of keys(this.measures)) {\n for (const op of keys(this.measures[field])) {\n for (const alias of this.measures[field][op]) {\n as.push(alias);\n ops.push(op);\n fields.push(field === '*' ? null : replacePathInField(field));\n }\n }\n }\n const result = {\n type: 'aggregate',\n groupby: [...this.dimensions].map(replacePathInField),\n ops,\n fields,\n as\n };\n return result;\n }\n}\n//# sourceMappingURL=aggregate.js.map","import { isArray } from 'vega-util';\nimport { isBinning } from '../../bin';\nimport { COLUMN, FACET_CHANNELS, POSITION_SCALE_CHANNELS, ROW } from '../../channel';\nimport { vgField } from '../../channeldef';\nimport * as log from '../../log';\nimport { hasDiscreteDomain } from '../../scale';\nimport { DEFAULT_SORT_OP, isSortField } from '../../sort';\nimport { hash } from '../../util';\nimport { isVgRangeStep } from '../../vega.schema';\nimport { HEADER_CHANNELS, HEADER_TYPES } from '../header/component';\nimport { assembleDomain, getFieldFromDomain } from '../scale/domain';\nimport { sortArrayIndexField } from './calculate';\nimport { DataFlowNode } from './dataflow';\n/**\n * A node that helps us track what fields we are faceting by.\n */\nexport class FacetNode extends DataFlowNode {\n /**\n * @param model The facet model.\n * @param name The name that this facet source will have.\n * @param data The source data for this facet data.\n */\n constructor(parent, model, name, data) {\n super(parent);\n this.model = model;\n this.name = name;\n this.data = data;\n for (const channel of FACET_CHANNELS) {\n const fieldDef = model.facet[channel];\n if (fieldDef) {\n const { bin, sort } = fieldDef;\n this[channel] = Object.assign({ name: model.getName(`${channel}_domain`), fields: [vgField(fieldDef), ...(isBinning(bin) ? [vgField(fieldDef, { binSuffix: 'end' })] : [])] }, (isSortField(sort)\n ? { sortField: sort }\n : isArray(sort)\n ? { sortIndexField: sortArrayIndexField(fieldDef, channel) }\n : {}));\n }\n }\n this.childModel = model.child;\n }\n hash() {\n let out = `Facet`;\n for (const channel of FACET_CHANNELS) {\n if (this[channel]) {\n out += ` ${channel.charAt(0)}:${hash(this[channel])}`;\n }\n }\n return out;\n }\n get fields() {\n var _a;\n const f = [];\n for (const channel of FACET_CHANNELS) {\n if ((_a = this[channel]) === null || _a === void 0 ? void 0 : _a.fields) {\n f.push(...this[channel].fields);\n }\n }\n return f;\n }\n dependentFields() {\n const depFields = new Set(this.fields);\n for (const channel of FACET_CHANNELS) {\n if (this[channel]) {\n if (this[channel].sortField) {\n depFields.add(this[channel].sortField.field);\n }\n if (this[channel].sortIndexField) {\n depFields.add(this[channel].sortIndexField);\n }\n }\n }\n return depFields;\n }\n producedFields() {\n return new Set(); // facet does not produce any new fields\n }\n /**\n * The name to reference this source is its name.\n */\n getSource() {\n return this.name;\n }\n getChildIndependentFieldsWithStep() {\n const childIndependentFieldsWithStep = {};\n for (const channel of POSITION_SCALE_CHANNELS) {\n const childScaleComponent = this.childModel.component.scales[channel];\n if (childScaleComponent && !childScaleComponent.merged) {\n // independent scale\n const type = childScaleComponent.get('type');\n const range = childScaleComponent.get('range');\n if (hasDiscreteDomain(type) && isVgRangeStep(range)) {\n const domain = assembleDomain(this.childModel, channel);\n const field = getFieldFromDomain(domain);\n if (field) {\n childIndependentFieldsWithStep[channel] = field;\n }\n else {\n log.warn(log.message.unknownField(channel));\n }\n }\n }\n }\n return childIndependentFieldsWithStep;\n }\n assembleRowColumnHeaderData(channel, crossedDataName, childIndependentFieldsWithStep) {\n const childChannel = { row: 'y', column: 'x' }[channel];\n const fields = [];\n const ops = [];\n const as = [];\n if (childIndependentFieldsWithStep && childIndependentFieldsWithStep[childChannel]) {\n if (crossedDataName) {\n // If there is a crossed data, calculate max\n fields.push(`distinct_${childIndependentFieldsWithStep[childChannel]}`);\n ops.push('max');\n }\n else {\n // If there is no crossed data, just calculate distinct\n fields.push(childIndependentFieldsWithStep[childChannel]);\n ops.push('distinct');\n }\n // Although it is technically a max, just name it distinct so it's easier to refer to it\n as.push(`distinct_${childIndependentFieldsWithStep[childChannel]}`);\n }\n const { sortField, sortIndexField } = this[channel];\n if (sortField) {\n const { op = DEFAULT_SORT_OP, field } = sortField;\n fields.push(field);\n ops.push(op);\n as.push(vgField(sortField, { forAs: true }));\n }\n else if (sortIndexField) {\n fields.push(sortIndexField);\n ops.push('max');\n as.push(sortIndexField);\n }\n return {\n name: this[channel].name,\n // Use data from the crossed one if it exist\n source: crossedDataName !== null && crossedDataName !== void 0 ? crossedDataName : this.data,\n transform: [\n Object.assign({ type: 'aggregate', groupby: this[channel].fields }, (fields.length\n ? {\n fields,\n ops,\n as\n }\n : {}))\n ]\n };\n }\n assembleFacetHeaderData(childIndependentFieldsWithStep) {\n var _a, _b;\n const { columns } = this.model.layout;\n const { layoutHeaders } = this.model.component;\n const data = [];\n const hasSharedAxis = {};\n for (const headerChannel of HEADER_CHANNELS) {\n for (const headerType of HEADER_TYPES) {\n const headers = (_a = (layoutHeaders[headerChannel] && layoutHeaders[headerChannel][headerType])) !== null && _a !== void 0 ? _a : [];\n for (const header of headers) {\n if (((_b = header.axes) === null || _b === void 0 ? void 0 : _b.length) > 0) {\n hasSharedAxis[headerChannel] = true;\n break;\n }\n }\n }\n if (hasSharedAxis[headerChannel]) {\n const cardinality = `length(data(\"${this.facet.name}\"))`;\n const stop = headerChannel === 'row'\n ? columns\n ? { signal: `ceil(${cardinality} / ${columns})` }\n : 1\n : columns\n ? { signal: `min(${cardinality}, ${columns})` }\n : { signal: cardinality };\n data.push({\n name: `${this.facet.name}_${headerChannel}`,\n transform: [\n {\n type: 'sequence',\n start: 0,\n stop\n }\n ]\n });\n }\n }\n const { row, column } = hasSharedAxis;\n if (row || column) {\n data.unshift(this.assembleRowColumnHeaderData('facet', null, childIndependentFieldsWithStep));\n }\n return data;\n }\n assemble() {\n var _a, _b;\n const data = [];\n let crossedDataName = null;\n const childIndependentFieldsWithStep = this.getChildIndependentFieldsWithStep();\n const { column, row, facet } = this;\n if (column && row && (childIndependentFieldsWithStep.x || childIndependentFieldsWithStep.y)) {\n // Need to create a cross dataset to correctly calculate cardinality\n crossedDataName = `cross_${this.column.name}_${this.row.name}`;\n const fields = [].concat((_a = childIndependentFieldsWithStep.x) !== null && _a !== void 0 ? _a : [], (_b = childIndependentFieldsWithStep.y) !== null && _b !== void 0 ? _b : []);\n const ops = fields.map(() => 'distinct');\n data.push({\n name: crossedDataName,\n source: this.data,\n transform: [\n {\n type: 'aggregate',\n groupby: this.fields,\n fields,\n ops\n }\n ]\n });\n }\n for (const channel of [COLUMN, ROW]) {\n if (this[channel]) {\n data.push(this.assembleRowColumnHeaderData(channel, crossedDataName, childIndependentFieldsWithStep));\n }\n }\n if (facet) {\n const facetData = this.assembleFacetHeaderData(childIndependentFieldsWithStep);\n if (facetData) {\n data.push(...facetData);\n }\n }\n return data;\n }\n}\n//# sourceMappingURL=facet.js.map","import { isNumber, isString } from 'vega-util';\nimport { isMinMaxOp } from '../../aggregate';\nimport { getMainRangeChannel } from '../../channel';\nimport { isFieldDef, isFieldOrDatumDefForTimeFormat, isScaleFieldDef, isTypedFieldDef } from '../../channeldef';\nimport { isGenerator } from '../../data';\nimport { isDateTime } from '../../datetime';\nimport * as log from '../../log';\nimport { forEachLeaf } from '../../logical';\nimport { isPathMark } from '../../mark';\nimport { isFieldEqualPredicate, isFieldGTEPredicate, isFieldGTPredicate, isFieldLTEPredicate, isFieldLTPredicate, isFieldOneOfPredicate, isFieldPredicate, isFieldRangePredicate } from '../../predicate';\nimport { isSortField } from '../../sort';\nimport { accessPathDepth, accessPathWithDatum, duplicate, hash, keys, removePathFromField } from '../../util';\nimport { signalRefOrValue } from '../common';\nimport { isFacetModel, isUnitModel } from '../model';\nimport { Split } from '../split';\nimport { DataFlowNode } from './dataflow';\n/**\n * Remove quotes from a string.\n */\nfunction unquote(pattern) {\n if ((pattern[0] === \"'\" && pattern[pattern.length - 1] === \"'\") ||\n (pattern[0] === '\"' && pattern[pattern.length - 1] === '\"')) {\n return pattern.slice(1, -1);\n }\n return pattern;\n}\n/**\n * @param field The field.\n * @param parse What to parse the field as.\n */\nfunction parseExpression(field, parse) {\n const f = accessPathWithDatum(field);\n if (parse === 'number') {\n return `toNumber(${f})`;\n }\n else if (parse === 'boolean') {\n return `toBoolean(${f})`;\n }\n else if (parse === 'string') {\n return `toString(${f})`;\n }\n else if (parse === 'date') {\n return `toDate(${f})`;\n }\n else if (parse === 'flatten') {\n return f;\n }\n else if (parse.indexOf('date:') === 0) {\n const specifier = unquote(parse.slice(5, parse.length));\n return `timeParse(${f},'${specifier}')`;\n }\n else if (parse.indexOf('utc:') === 0) {\n const specifier = unquote(parse.slice(4, parse.length));\n return `utcParse(${f},'${specifier}')`;\n }\n else {\n log.warn(log.message.unrecognizedParse(parse));\n return null;\n }\n}\nexport function getImplicitFromFilterTransform(transform) {\n const implicit = {};\n forEachLeaf(transform.filter, filter => {\n var _a;\n if (isFieldPredicate(filter)) {\n // Automatically add a parse node for filters with filter objects\n let val = null;\n // For EqualFilter, just use the equal property.\n // For RangeFilter and OneOfFilter, all array members should have\n // the same type, so we only use the first one.\n if (isFieldEqualPredicate(filter)) {\n val = signalRefOrValue(filter.equal);\n }\n else if (isFieldLTEPredicate(filter)) {\n val = signalRefOrValue(filter.lte);\n }\n else if (isFieldLTPredicate(filter)) {\n val = signalRefOrValue(filter.lt);\n }\n else if (isFieldGTPredicate(filter)) {\n val = signalRefOrValue(filter.gt);\n }\n else if (isFieldGTEPredicate(filter)) {\n val = signalRefOrValue(filter.gte);\n }\n else if (isFieldRangePredicate(filter)) {\n val = filter.range[0];\n }\n else if (isFieldOneOfPredicate(filter)) {\n val = ((_a = filter.oneOf) !== null && _a !== void 0 ? _a : filter['in'])[0];\n } // else -- for filter expression, we can't infer anything\n if (val) {\n if (isDateTime(val)) {\n implicit[filter.field] = 'date';\n }\n else if (isNumber(val)) {\n implicit[filter.field] = 'number';\n }\n else if (isString(val)) {\n implicit[filter.field] = 'string';\n }\n }\n if (filter.timeUnit) {\n implicit[filter.field] = 'date';\n }\n }\n });\n return implicit;\n}\n/**\n * Creates a parse node for implicit parsing from a model and updates ancestorParse.\n */\nexport function getImplicitFromEncoding(model) {\n const implicit = {};\n function add(fieldDef) {\n if (isFieldOrDatumDefForTimeFormat(fieldDef)) {\n implicit[fieldDef.field] = 'date';\n }\n else if (fieldDef.type === 'quantitative' &&\n isMinMaxOp(fieldDef.aggregate) // we need to parse numbers to support correct min and max\n ) {\n implicit[fieldDef.field] = 'number';\n }\n else if (accessPathDepth(fieldDef.field) > 1) {\n // For non-date/non-number (strings and booleans), derive a flattened field for a referenced nested field.\n // (Parsing numbers / dates already flattens numeric and temporal fields.)\n if (!(fieldDef.field in implicit)) {\n implicit[fieldDef.field] = 'flatten';\n }\n }\n else if (isScaleFieldDef(fieldDef) && isSortField(fieldDef.sort) && accessPathDepth(fieldDef.sort.field) > 1) {\n // Flatten fields that we sort by but that are not otherwise flattened.\n if (!(fieldDef.sort.field in implicit)) {\n implicit[fieldDef.sort.field] = 'flatten';\n }\n }\n }\n if (isUnitModel(model) || isFacetModel(model)) {\n // Parse encoded fields\n model.forEachFieldDef((fieldDef, channel) => {\n if (isTypedFieldDef(fieldDef)) {\n add(fieldDef);\n }\n else {\n const mainChannel = getMainRangeChannel(channel);\n const mainFieldDef = model.fieldDef(mainChannel);\n add(Object.assign(Object.assign({}, fieldDef), { type: mainFieldDef.type }));\n }\n });\n }\n // Parse quantitative dimension fields of path marks as numbers so that we sort them correctly.\n if (isUnitModel(model)) {\n const { mark, markDef, encoding } = model;\n if (isPathMark(mark) &&\n // No need to sort by dimension if we have a connected scatterplot (order channel is present)\n !model.encoding.order) {\n const dimensionChannel = markDef.orient === 'horizontal' ? 'y' : 'x';\n const dimensionChannelDef = encoding[dimensionChannel];\n if (isFieldDef(dimensionChannelDef) &&\n dimensionChannelDef.type === 'quantitative' &&\n !(dimensionChannelDef.field in implicit)) {\n implicit[dimensionChannelDef.field] = 'number';\n }\n }\n }\n return implicit;\n}\n/**\n * Creates a parse node for implicit parsing from a model and updates ancestorParse.\n */\nexport function getImplicitFromSelection(model) {\n const implicit = {};\n if (isUnitModel(model) && model.component.selection) {\n for (const name of keys(model.component.selection)) {\n const selCmpt = model.component.selection[name];\n for (const proj of selCmpt.project.items) {\n if (!proj.channel && accessPathDepth(proj.field) > 1) {\n implicit[proj.field] = 'flatten';\n }\n }\n }\n }\n return implicit;\n}\nexport class ParseNode extends DataFlowNode {\n constructor(parent, parse) {\n super(parent);\n this._parse = parse;\n }\n clone() {\n return new ParseNode(null, duplicate(this._parse));\n }\n hash() {\n return `Parse ${hash(this._parse)}`;\n }\n /**\n * Creates a parse node from a data.format.parse and updates ancestorParse.\n */\n static makeExplicit(parent, model, ancestorParse) {\n // Custom parse\n let explicit = {};\n const data = model.data;\n if (!isGenerator(data) && data && data.format && data.format.parse) {\n explicit = data.format.parse;\n }\n return this.makeWithAncestors(parent, explicit, {}, ancestorParse);\n }\n /**\n * Creates a parse node from \"explicit\" parse and \"implicit\" parse and updates ancestorParse.\n */\n static makeWithAncestors(parent, explicit, implicit, ancestorParse) {\n // We should not parse what has already been parsed in a parent (explicitly or implicitly) or what has been derived (maked as \"derived\"). We also don't need to flatten a field that has already been parsed.\n for (const field of keys(implicit)) {\n const parsedAs = ancestorParse.getWithExplicit(field);\n if (parsedAs.value !== undefined) {\n // We always ignore derived fields even if they are implicitly defined because we expect users to create the right types.\n if (parsedAs.explicit ||\n parsedAs.value === implicit[field] ||\n parsedAs.value === 'derived' ||\n implicit[field] === 'flatten') {\n delete implicit[field];\n }\n else {\n log.warn(log.message.differentParse(field, implicit[field], parsedAs.value));\n }\n }\n }\n for (const field of keys(explicit)) {\n const parsedAs = ancestorParse.get(field);\n if (parsedAs !== undefined) {\n // Don't parse a field again if it has been parsed with the same type already.\n if (parsedAs === explicit[field]) {\n delete explicit[field];\n }\n else {\n log.warn(log.message.differentParse(field, explicit[field], parsedAs));\n }\n }\n }\n const parse = new Split(explicit, implicit);\n // add the format parse from this model so that children don't parse the same field again\n ancestorParse.copyAll(parse);\n // copy only non-null parses\n const p = {};\n for (const key of keys(parse.combine())) {\n const val = parse.get(key);\n if (val !== null) {\n p[key] = val;\n }\n }\n if (keys(p).length === 0 || ancestorParse.parseNothing) {\n return null;\n }\n return new ParseNode(parent, p);\n }\n get parse() {\n return this._parse;\n }\n merge(other) {\n this._parse = Object.assign(Object.assign({}, this._parse), other.parse);\n other.remove();\n }\n /**\n * Assemble an object for Vega's format.parse property.\n */\n assembleFormatParse() {\n const formatParse = {};\n for (const field of keys(this._parse)) {\n const p = this._parse[field];\n if (accessPathDepth(field) === 1) {\n formatParse[field] = p;\n }\n }\n return formatParse;\n }\n // format parse depends and produces all fields in its parse\n producedFields() {\n return new Set(keys(this._parse));\n }\n dependentFields() {\n return new Set(keys(this._parse));\n }\n assembleTransforms(onlyNested = false) {\n return keys(this._parse)\n .filter(field => (onlyNested ? accessPathDepth(field) > 1 : true))\n .map(field => {\n const expr = parseExpression(field, this._parse[field]);\n if (!expr) {\n return null;\n }\n const formula = {\n type: 'formula',\n expr,\n as: removePathFromField(field) // Vega output is always flattened\n };\n return formula;\n })\n .filter(t => t !== null);\n }\n}\n//# sourceMappingURL=formatparse.js.map","import { SELECTION_ID } from '../../selection';\nimport { DataFlowNode } from './dataflow';\nexport class IdentifierNode extends DataFlowNode {\n clone() {\n return new IdentifierNode(null);\n }\n constructor(parent) {\n super(parent);\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return new Set([SELECTION_ID]);\n }\n hash() {\n return 'Identifier';\n }\n assemble() {\n return { type: 'identifier', as: SELECTION_ID };\n }\n}\n//# sourceMappingURL=identifier.js.map","import { hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class GraticuleNode extends DataFlowNode {\n constructor(parent, params) {\n super(parent);\n this.params = params;\n }\n clone() {\n return new GraticuleNode(null, this.params);\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return undefined; // there should never be a node before graticule\n }\n hash() {\n return `Graticule ${hash(this.params)}`;\n }\n assemble() {\n return Object.assign({ type: 'graticule' }, (this.params === true ? {} : this.params));\n }\n}\n//# sourceMappingURL=graticule.js.map","import { hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class SequenceNode extends DataFlowNode {\n constructor(parent, params) {\n super(parent);\n this.params = params;\n }\n clone() {\n return new SequenceNode(null, this.params);\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n var _a;\n return new Set([(_a = this.params.as) !== null && _a !== void 0 ? _a : 'data']);\n }\n hash() {\n return `Hash ${hash(this.params)}`;\n }\n assemble() {\n return Object.assign({ type: 'sequence' }, this.params);\n }\n}\n//# sourceMappingURL=sequence.js.map","import { isGenerator, isInlineData, isNamedData, isSphereGenerator, isUrlData } from '../../data';\nimport { contains, isEmpty, omit } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class SourceNode extends DataFlowNode {\n constructor(data) {\n super(null); // source cannot have parent\n data = data !== null && data !== void 0 ? data : { name: 'source' };\n let format;\n if (!isGenerator(data)) {\n format = data.format ? Object.assign({}, omit(data.format, ['parse'])) : {};\n }\n if (isInlineData(data)) {\n this._data = { values: data.values };\n }\n else if (isUrlData(data)) {\n this._data = { url: data.url };\n if (!format.type) {\n // Extract extension from URL using snippet from\n // http://stackoverflow.com/questions/680929/how-to-extract-extension-from-filename-string-in-javascript\n let defaultExtension = /(?:\\.([^.]+))?$/.exec(data.url)[1];\n if (!contains(['json', 'csv', 'tsv', 'dsv', 'topojson'], defaultExtension)) {\n defaultExtension = 'json';\n }\n // defaultExtension has type string but we ensure that it is DataFormatType above\n format.type = defaultExtension;\n }\n }\n else if (isSphereGenerator(data)) {\n // hardwire GeoJSON sphere data into output specification\n this._data = { values: [{ type: 'Sphere' }] };\n }\n else if (isNamedData(data) || isGenerator(data)) {\n this._data = {};\n }\n // set flag to check if generator\n this._generator = isGenerator(data);\n // any dataset can be named\n if (data.name) {\n this._name = data.name;\n }\n if (format && !isEmpty(format)) {\n this._data.format = format;\n }\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return undefined; // we don't know what this source produces\n }\n get data() {\n return this._data;\n }\n hasName() {\n return !!this._name;\n }\n get isGenerator() {\n return this._generator;\n }\n get dataName() {\n return this._name;\n }\n set dataName(name) {\n this._name = name;\n }\n set parent(parent) {\n throw new Error('Source nodes have to be roots.');\n }\n remove() {\n throw new Error('Source nodes are roots and cannot be removed.');\n }\n hash() {\n throw new Error('Cannot hash sources');\n }\n assemble() {\n return Object.assign(Object.assign({ name: this._name }, this._data), { transform: [] });\n }\n}\n//# sourceMappingURL=source.js.map","var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n privateMap.set(receiver, value);\n return value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n return privateMap.get(receiver);\n};\nvar _modified;\nimport { GraticuleNode } from './graticule';\nimport { SequenceNode } from './sequence';\nimport { SourceNode } from './source';\n/**\n * Whether this dataflow node is the source of the dataflow that produces data i.e. a source or a generator.\n */\nexport function isDataSourceNode(node) {\n return node instanceof SourceNode || node instanceof GraticuleNode || node instanceof SequenceNode;\n}\n/**\n * Abstract base class for Dataflow optimizers.\n * Contains only mutation handling logic. Subclasses need to implement iteration logic.\n */\nexport class Optimizer {\n constructor() {\n _modified.set(this, void 0);\n __classPrivateFieldSet(this, _modified, false);\n }\n // Once true, #modified is never set to false\n setModified() {\n __classPrivateFieldSet(this, _modified, true);\n }\n get modifiedFlag() {\n return __classPrivateFieldGet(this, _modified);\n }\n}\n_modified = new WeakMap();\n/**\n * Starts from a node and runs the optimization function (the \"run\" method) upwards to the root,\n * depending on the continue and modified flag values returned by the optimization function.\n */\nexport class BottomUpOptimizer extends Optimizer {\n /**\n * Compute a map of node depths that we can use to determine a topological sort order.\n */\n getNodeDepths(node, depth, depths) {\n depths.set(node, depth);\n for (const child of node.children) {\n this.getNodeDepths(child, depth + 1, depths);\n }\n return depths;\n }\n /**\n * Run the optimizer on all nodes starting from the leaves.\n */\n optimize(node) {\n const depths = this.getNodeDepths(node, 0, new Map());\n const topologicalSort = [...depths.entries()].sort((a, b) => b[1] - a[1]);\n for (const tuple of topologicalSort) {\n this.run(tuple[0]);\n }\n return this.modifiedFlag;\n }\n}\n/**\n * The optimizer function (the \"run\" method), is invoked on the given node and then continues recursively.\n */\nexport class TopDownOptimizer extends Optimizer {\n /**\n * Run the optimizer depth first on all nodes starting from the roots.\n */\n optimize(node) {\n this.run(node);\n for (const child of node.children) {\n this.optimize(child);\n }\n return this.modifiedFlag;\n }\n}\n//# sourceMappingURL=optimizer.js.map","import { fieldIntersection, hash, hasIntersection, isEmpty, keys, some } from '../../util';\nimport { requiresSelectionId } from '../selection';\nimport { AggregateNode } from './aggregate';\nimport { BinNode } from './bin';\nimport { OutputNode } from './dataflow';\nimport { FacetNode } from './facet';\nimport { FilterNode } from './filter';\nimport { ParseNode } from './formatparse';\nimport { IdentifierNode } from './identifier';\nimport { BottomUpOptimizer, isDataSourceNode, Optimizer, TopDownOptimizer } from './optimizer';\nimport { SourceNode } from './source';\nimport { TimeUnitNode } from './timeunit';\n/**\n * Merge identical nodes at forks by comparing hashes.\n *\n * Does not need to iterate from leaves so we implement this with recursion as it's a bit simpler.\n */\nexport class MergeIdenticalNodes extends TopDownOptimizer {\n mergeNodes(parent, nodes) {\n const mergedNode = nodes.shift();\n for (const node of nodes) {\n parent.removeChild(node);\n node.parent = mergedNode;\n node.remove();\n }\n }\n run(node) {\n const hashes = node.children.map(x => x.hash());\n const buckets = {};\n for (let i = 0; i < hashes.length; i++) {\n if (buckets[hashes[i]] === undefined) {\n buckets[hashes[i]] = [node.children[i]];\n }\n else {\n buckets[hashes[i]].push(node.children[i]);\n }\n }\n for (const k of keys(buckets)) {\n if (buckets[k].length > 1) {\n this.setModified();\n this.mergeNodes(node, buckets[k]);\n }\n }\n }\n}\n/**\n * Optimizer that removes identifier nodes that are not needed for selections.\n */\nexport class RemoveUnnecessaryIdentifierNodes extends TopDownOptimizer {\n constructor(model) {\n super();\n this.requiresSelectionId = model && requiresSelectionId(model);\n }\n run(node) {\n if (node instanceof IdentifierNode) {\n // Only preserve IdentifierNodes if we have default discrete selections\n // in our model tree, and if the nodes come after tuple producing nodes.\n if (!(this.requiresSelectionId &&\n (isDataSourceNode(node.parent) || node.parent instanceof AggregateNode || node.parent instanceof ParseNode))) {\n this.setModified();\n node.remove();\n }\n }\n }\n}\n/**\n * Removes duplicate time unit nodes (as determined by the name of the output field) that may be generated due to\n * selections projected over time units. Only keeps the first time unit in any branch.\n *\n * This optimizer is a custom top down optimizer that keep track of produced fields in a branch.\n */\nexport class RemoveDuplicateTimeUnits extends Optimizer {\n optimize(node) {\n this.run(node, new Set());\n return this.modifiedFlag;\n }\n run(node, timeUnitFields) {\n let producedFields = new Set();\n if (node instanceof TimeUnitNode) {\n producedFields = node.producedFields();\n if (hasIntersection(producedFields, timeUnitFields)) {\n this.setModified();\n node.removeFormulas(timeUnitFields);\n if (node.producedFields.length === 0) {\n node.remove();\n }\n }\n }\n for (const child of node.children) {\n this.run(child, new Set([...timeUnitFields, ...producedFields]));\n }\n }\n}\n/**\n * Remove output nodes that are not required.\n */\nexport class RemoveUnnecessaryOutputNodes extends TopDownOptimizer {\n constructor() {\n super();\n }\n run(node) {\n if (node instanceof OutputNode && !node.isRequired()) {\n this.setModified();\n node.remove();\n }\n }\n}\n/**\n * Move parse nodes up to forks and merges them if possible.\n */\nexport class MoveParseUp extends BottomUpOptimizer {\n run(node) {\n if (isDataSourceNode(node)) {\n return;\n }\n if (node.numChildren() > 1) {\n // Don't move parse further up but continue with parent.\n return;\n }\n for (const child of node.children) {\n if (child instanceof ParseNode) {\n if (node instanceof ParseNode) {\n this.setModified();\n node.merge(child);\n }\n else {\n // Don't swap with nodes that produce something that the parse node depends on (e.g. lookup).\n if (fieldIntersection(node.producedFields(), child.dependentFields())) {\n continue;\n }\n this.setModified();\n child.swapWithParent();\n }\n }\n }\n return;\n }\n}\n/**\n * Inserts an intermediate ParseNode containing all non-conflicting parse fields and removes the empty ParseNodes.\n *\n * We assume that dependent paths that do not have a parse node can be just merged.\n */\nexport class MergeParse extends BottomUpOptimizer {\n run(node) {\n const originalChildren = [...node.children];\n const parseChildren = node.children.filter((child) => child instanceof ParseNode);\n if (node.numChildren() > 1 && parseChildren.length >= 1) {\n const commonParse = {};\n const conflictingParse = new Set();\n for (const parseNode of parseChildren) {\n const parse = parseNode.parse;\n for (const k of keys(parse)) {\n if (!(k in commonParse)) {\n commonParse[k] = parse[k];\n }\n else if (commonParse[k] !== parse[k]) {\n conflictingParse.add(k);\n }\n }\n }\n for (const field of conflictingParse) {\n delete commonParse[field];\n }\n if (!isEmpty(commonParse)) {\n this.setModified();\n const mergedParseNode = new ParseNode(node, commonParse);\n for (const childNode of originalChildren) {\n if (childNode instanceof ParseNode) {\n for (const key of keys(commonParse)) {\n delete childNode.parse[key];\n }\n }\n node.removeChild(childNode);\n childNode.parent = mergedParseNode;\n // remove empty parse nodes\n if (childNode instanceof ParseNode && keys(childNode.parse).length === 0) {\n childNode.remove();\n }\n }\n }\n }\n }\n}\n/**\n * Repeatedly remove leaf nodes that are not output or facet nodes.\n * The reason is that we don't need subtrees that don't have any output nodes.\n * Facet nodes are needed for the row or column domains.\n */\nexport class RemoveUnusedSubtrees extends BottomUpOptimizer {\n run(node) {\n if (node instanceof OutputNode || node.numChildren() > 0 || node instanceof FacetNode) {\n // no need to continue with parent because it is output node or will have children (there was a fork)\n }\n else if (node instanceof SourceNode) {\n // ignore empty unused sources as they will be removed in optimizationDataflowHelper\n }\n else {\n this.setModified();\n node.remove();\n }\n }\n}\n/**\n * Merge adjacent time unit nodes.\n */\nexport class MergeTimeUnits extends BottomUpOptimizer {\n run(node) {\n const timeUnitChildren = node.children.filter((x) => x instanceof TimeUnitNode);\n const combination = timeUnitChildren.pop();\n for (const timeUnit of timeUnitChildren) {\n this.setModified();\n combination.merge(timeUnit);\n }\n }\n}\nexport class MergeAggregates extends BottomUpOptimizer {\n run(node) {\n const aggChildren = node.children.filter((child) => child instanceof AggregateNode);\n // Object which we'll use to map the fields which an aggregate is grouped by to\n // the set of aggregates with that grouping. This is useful as only aggregates\n // with the same group by can be merged\n const groupedAggregates = {};\n // Build groupedAggregates\n for (const agg of aggChildren) {\n const groupBys = hash(agg.groupBy);\n if (!(groupBys in groupedAggregates)) {\n groupedAggregates[groupBys] = [];\n }\n groupedAggregates[groupBys].push(agg);\n }\n // Merge aggregateNodes with same key in groupedAggregates\n for (const group of keys(groupedAggregates)) {\n const mergeableAggs = groupedAggregates[group];\n if (mergeableAggs.length > 1) {\n const mergedAggs = mergeableAggs.pop();\n for (const agg of mergeableAggs) {\n if (mergedAggs.merge(agg)) {\n node.removeChild(agg);\n agg.parent = mergedAggs;\n agg.remove();\n this.setModified();\n }\n }\n }\n }\n }\n}\n/**\n * Merge bin nodes and move them up through forks. Stop at filters, parse, identifier as we want them to stay before the bin node.\n */\nexport class MergeBins extends BottomUpOptimizer {\n constructor(model) {\n super();\n this.model = model;\n }\n run(node) {\n const moveBinsUp = !(isDataSourceNode(node) ||\n node instanceof FilterNode ||\n node instanceof ParseNode ||\n node instanceof IdentifierNode);\n const promotableBins = [];\n const remainingBins = [];\n for (const child of node.children) {\n if (child instanceof BinNode) {\n if (moveBinsUp && !fieldIntersection(node.producedFields(), child.dependentFields())) {\n promotableBins.push(child);\n }\n else {\n remainingBins.push(child);\n }\n }\n }\n if (promotableBins.length > 0) {\n const promotedBin = promotableBins.pop();\n for (const bin of promotableBins) {\n promotedBin.merge(bin, this.model.renameSignal.bind(this.model));\n }\n this.setModified();\n if (node instanceof BinNode) {\n node.merge(promotedBin, this.model.renameSignal.bind(this.model));\n }\n else {\n promotedBin.swapWithParent();\n }\n }\n if (remainingBins.length > 1) {\n const remainingBin = remainingBins.pop();\n for (const bin of remainingBins) {\n remainingBin.merge(bin, this.model.renameSignal.bind(this.model));\n }\n this.setModified();\n }\n }\n}\n/**\n * This optimizer takes output nodes that are at a fork and moves them before the fork.\n *\n * The algorithm iterates over the children and tries to find the last output node in a chain of output nodes.\n * It then moves all output nodes before that main output node. All other children (and the children of the output nodes)\n * are inserted after the main output node.\n */\nexport class MergeOutputs extends BottomUpOptimizer {\n run(node) {\n const children = [...node.children];\n const hasOutputChild = some(children, child => child instanceof OutputNode);\n if (!hasOutputChild || node.numChildren() <= 1) {\n return;\n }\n const otherChildren = [];\n // The output node we will connect all other nodes to.\n // Output nodes will be added before the new node, other nodes after.\n let mainOutput;\n for (const child of children) {\n if (child instanceof OutputNode) {\n let lastOutput = child;\n while (lastOutput.numChildren() === 1) {\n const [theChild] = lastOutput.children;\n if (theChild instanceof OutputNode) {\n lastOutput = theChild;\n }\n else {\n break;\n }\n }\n otherChildren.push(...lastOutput.children);\n if (mainOutput) {\n // Move the output nodes before the mainOutput. We do this by setting\n // the parent of the first not to the parent of the main output and\n // the main output's parent to the last output.\n // note: the child is the first output\n node.removeChild(child);\n child.parent = mainOutput.parent;\n mainOutput.parent.removeChild(mainOutput);\n mainOutput.parent = lastOutput;\n this.setModified();\n }\n else {\n mainOutput = lastOutput;\n }\n }\n else {\n otherChildren.push(child);\n }\n }\n if (otherChildren.length) {\n this.setModified();\n for (const child of otherChildren) {\n child.parent.removeChild(child);\n child.parent = mainOutput;\n }\n }\n }\n}\n//# sourceMappingURL=optimizers.js.map","import { vgField } from '../../channeldef';\nimport { duplicate, hash } from '../../util';\nimport { unique } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for the join aggregate transform nodes.\n */\nexport class JoinAggregateTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new JoinAggregateTransformNode(null, duplicate(this.transform));\n }\n addDimensions(fields) {\n this.transform.groupby = unique(this.transform.groupby.concat(fields), d => d);\n }\n dependentFields() {\n const out = new Set();\n if (this.transform.groupby) {\n this.transform.groupby.forEach(out.add, out);\n }\n this.transform.joinaggregate\n .map(w => w.field)\n .filter(f => f !== undefined)\n .forEach(out.add, out);\n return out;\n }\n producedFields() {\n return new Set(this.transform.joinaggregate.map(this.getDefaultName));\n }\n getDefaultName(joinAggregateFieldDef) {\n var _a;\n return (_a = joinAggregateFieldDef.as) !== null && _a !== void 0 ? _a : vgField(joinAggregateFieldDef);\n }\n hash() {\n return `JoinAggregateTransform ${hash(this.transform)}`;\n }\n assemble() {\n const fields = [];\n const ops = [];\n const as = [];\n for (const joinaggregate of this.transform.joinaggregate) {\n ops.push(joinaggregate.op);\n as.push(this.getDefaultName(joinaggregate));\n fields.push(joinaggregate.field === undefined ? null : joinaggregate.field);\n }\n const groupby = this.transform.groupby;\n return Object.assign({ type: 'joinaggregate', as,\n ops,\n fields }, (groupby !== undefined ? { groupby } : {}));\n }\n}\n//# sourceMappingURL=joinaggregate.js.map","import { isArray, isString } from 'vega-util';\nimport { getFieldDef, isFieldDef, vgField } from '../../channeldef';\nimport { duplicate, getFirstDefined, hash } from '../../util';\nimport { sortParams } from '../common';\nimport { DataFlowNode } from './dataflow';\nfunction getStackByFields(model) {\n return model.stack.stackBy.reduce((fields, by) => {\n const fieldDef = by.fieldDef;\n const _field = vgField(fieldDef);\n if (_field) {\n fields.push(_field);\n }\n return fields;\n }, []);\n}\nfunction isValidAsArray(as) {\n return isArray(as) && as.every(s => isString(s)) && as.length > 1;\n}\nexport class StackNode extends DataFlowNode {\n constructor(parent, stack) {\n super(parent);\n this._stack = stack;\n }\n clone() {\n return new StackNode(null, duplicate(this._stack));\n }\n static makeFromTransform(parent, stackTransform) {\n const { stack, groupby, as, offset = 'zero' } = stackTransform;\n const sortFields = [];\n const sortOrder = [];\n if (stackTransform.sort !== undefined) {\n for (const sortField of stackTransform.sort) {\n sortFields.push(sortField.field);\n sortOrder.push(getFirstDefined(sortField.order, 'ascending'));\n }\n }\n const sort = {\n field: sortFields,\n order: sortOrder\n };\n let normalizedAs;\n if (isValidAsArray(as)) {\n normalizedAs = as;\n }\n else if (isString(as)) {\n normalizedAs = [as, as + '_end'];\n }\n else {\n normalizedAs = [stackTransform.stack + '_start', stackTransform.stack + '_end'];\n }\n return new StackNode(parent, {\n stackField: stack,\n groupby,\n offset,\n sort,\n facetby: [],\n as: normalizedAs\n });\n }\n static makeFromEncoding(parent, model) {\n const stackProperties = model.stack;\n const { encoding } = model;\n if (!stackProperties) {\n return null;\n }\n const { groupbyChannel, fieldChannel, offset, impute } = stackProperties;\n let dimensionFieldDef;\n if (groupbyChannel) {\n const cDef = encoding[groupbyChannel];\n dimensionFieldDef = getFieldDef(cDef); // Fair to cast as groupByChannel is always either x or y\n }\n const stackby = getStackByFields(model);\n const orderDef = model.encoding.order;\n let sort;\n if (isArray(orderDef) || isFieldDef(orderDef)) {\n sort = sortParams(orderDef);\n }\n else {\n // default = descending by stackFields\n // FIXME is the default here correct for binned fields?\n sort = stackby.reduce((s, field) => {\n s.field.push(field);\n s.order.push(fieldChannel === 'y' ? 'descending' : 'ascending');\n return s;\n }, { field: [], order: [] });\n }\n return new StackNode(parent, {\n dimensionFieldDef,\n stackField: model.vgField(fieldChannel),\n facetby: [],\n stackby,\n sort,\n offset,\n impute,\n as: [\n model.vgField(fieldChannel, { suffix: 'start', forAs: true }),\n model.vgField(fieldChannel, { suffix: 'end', forAs: true })\n ]\n });\n }\n get stack() {\n return this._stack;\n }\n addDimensions(fields) {\n this._stack.facetby.push(...fields);\n }\n dependentFields() {\n const out = new Set();\n out.add(this._stack.stackField);\n this.getGroupbyFields().forEach(out.add, out);\n this._stack.facetby.forEach(out.add, out);\n this._stack.sort.field.forEach(out.add, out);\n return out;\n }\n producedFields() {\n return new Set(this._stack.as);\n }\n hash() {\n return `Stack ${hash(this._stack)}`;\n }\n getGroupbyFields() {\n const { dimensionFieldDef, impute, groupby } = this._stack;\n if (dimensionFieldDef) {\n if (dimensionFieldDef.bin) {\n if (impute) {\n // For binned group by field with impute, we calculate bin_mid\n // as we cannot impute two fields simultaneously\n return [vgField(dimensionFieldDef, { binSuffix: 'mid' })];\n }\n return [\n // For binned group by field without impute, we need both bin (start) and bin_end\n vgField(dimensionFieldDef, {}),\n vgField(dimensionFieldDef, { binSuffix: 'end' })\n ];\n }\n return [vgField(dimensionFieldDef)];\n }\n return groupby !== null && groupby !== void 0 ? groupby : [];\n }\n assemble() {\n const transform = [];\n const { facetby, dimensionFieldDef, stackField: field, stackby, sort, offset, impute, as } = this._stack;\n // Impute\n if (impute && dimensionFieldDef) {\n const { band = 0.5, bin } = dimensionFieldDef;\n if (bin) {\n // As we can only impute one field at a time, we need to calculate\n // mid point for a binned field\n transform.push({\n type: 'formula',\n expr: `${band}*` +\n vgField(dimensionFieldDef, { expr: 'datum' }) +\n `+${1 - band}*` +\n vgField(dimensionFieldDef, { expr: 'datum', binSuffix: 'end' }),\n as: vgField(dimensionFieldDef, { binSuffix: 'mid', forAs: true })\n });\n }\n transform.push({\n type: 'impute',\n field,\n groupby: [...stackby, ...facetby],\n key: vgField(dimensionFieldDef, { binSuffix: 'mid' }),\n method: 'value',\n value: 0\n });\n }\n // Stack\n transform.push({\n type: 'stack',\n groupby: [...this.getGroupbyFields(), ...facetby],\n field,\n sort,\n as,\n offset\n });\n return transform;\n }\n}\n//# sourceMappingURL=stack.js.map","import { isAggregateOp } from '../../aggregate';\nimport { vgField } from '../../channeldef';\nimport { duplicate, hash } from '../../util';\nimport { unique } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for the window transform nodes\n */\nexport class WindowTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new WindowTransformNode(null, duplicate(this.transform));\n }\n addDimensions(fields) {\n this.transform.groupby = unique(this.transform.groupby.concat(fields), d => d);\n }\n dependentFields() {\n var _a, _b;\n const out = new Set();\n ((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : []).forEach(out.add, out);\n ((_b = this.transform.sort) !== null && _b !== void 0 ? _b : []).forEach(m => out.add(m.field));\n this.transform.window\n .map(w => w.field)\n .filter(f => f !== undefined)\n .forEach(out.add, out);\n return out;\n }\n producedFields() {\n return new Set(this.transform.window.map(this.getDefaultName));\n }\n getDefaultName(windowFieldDef) {\n var _a;\n return (_a = windowFieldDef.as) !== null && _a !== void 0 ? _a : vgField(windowFieldDef);\n }\n hash() {\n return `WindowTransform ${hash(this.transform)}`;\n }\n assemble() {\n var _a;\n const fields = [];\n const ops = [];\n const as = [];\n const params = [];\n for (const window of this.transform.window) {\n ops.push(window.op);\n as.push(this.getDefaultName(window));\n params.push(window.param === undefined ? null : window.param);\n fields.push(window.field === undefined ? null : window.field);\n }\n const frame = this.transform.frame;\n const groupby = this.transform.groupby;\n if (frame && frame[0] === null && frame[1] === null && ops.every(o => isAggregateOp(o))) {\n // when the window does not rely on any particular window ops or frame, switch to a simpler and more efficient joinaggregate\n return Object.assign({ type: 'joinaggregate', as, ops: ops, fields }, (groupby !== undefined ? { groupby } : {}));\n }\n const sortFields = [];\n const sortOrder = [];\n if (this.transform.sort !== undefined) {\n for (const sortField of this.transform.sort) {\n sortFields.push(sortField.field);\n sortOrder.push((_a = sortField.order) !== null && _a !== void 0 ? _a : 'ascending');\n }\n }\n const sort = {\n field: sortFields,\n order: sortOrder\n };\n const ignorePeers = this.transform.ignorePeers;\n return Object.assign(Object.assign(Object.assign({ type: 'window', params,\n as,\n ops,\n fields,\n sort }, (ignorePeers !== undefined ? { ignorePeers } : {})), (groupby !== undefined ? { groupby } : {})), (frame !== undefined ? { frame } : {}));\n }\n}\n//# sourceMappingURL=window.js.map","import { DataSourceType } from '../../data';\nimport { AggregateNode } from './aggregate';\nimport { OutputNode } from './dataflow';\nimport { FacetNode } from './facet';\nimport { JoinAggregateTransformNode } from './joinaggregate';\nimport { FACET_SCALE_PREFIX } from './optimize';\nimport { StackNode } from './stack';\nimport { WindowTransformNode } from './window';\n/**\n * Clones the subtree and ignores output nodes except for the leaves, which are renamed.\n */\nfunction cloneSubtree(facet) {\n function clone(node) {\n if (!(node instanceof FacetNode)) {\n const copy = node.clone();\n if (copy instanceof OutputNode) {\n const newName = FACET_SCALE_PREFIX + copy.getSource();\n copy.setSource(newName);\n facet.model.component.data.outputNodes[newName] = copy;\n }\n else if (copy instanceof AggregateNode ||\n copy instanceof StackNode ||\n copy instanceof WindowTransformNode ||\n copy instanceof JoinAggregateTransformNode) {\n copy.addDimensions(facet.fields);\n }\n for (const n of node.children.flatMap(clone)) {\n n.parent = copy;\n }\n return [copy];\n }\n return node.children.flatMap(clone);\n }\n return clone;\n}\n/**\n * Move facet nodes down to the next fork or output node. Also pull the main output with the facet node.\n * After moving down the facet node, make a copy of the subtree and make it a child of the main output.\n */\nexport function moveFacetDown(node) {\n if (node instanceof FacetNode) {\n if (node.numChildren() === 1 && !(node.children[0] instanceof OutputNode)) {\n // move down until we hit a fork or output node\n const child = node.children[0];\n if (child instanceof AggregateNode ||\n child instanceof StackNode ||\n child instanceof WindowTransformNode ||\n child instanceof JoinAggregateTransformNode) {\n child.addDimensions(node.fields);\n }\n child.swapWithParent();\n moveFacetDown(node);\n }\n else {\n // move main to facet\n const facetMain = node.model.component.data.main;\n moveMainDownToFacet(facetMain);\n // replicate the subtree and place it before the facet's main node\n const cloner = cloneSubtree(node);\n const copy = node.children.map(cloner).flat();\n for (const c of copy) {\n c.parent = facetMain;\n }\n }\n }\n else {\n node.children.map(moveFacetDown);\n }\n}\nfunction moveMainDownToFacet(node) {\n if (node instanceof OutputNode && node.type === DataSourceType.Main) {\n if (node.numChildren() === 1) {\n const child = node.children[0];\n if (!(child instanceof FacetNode)) {\n child.swapWithParent();\n moveMainDownToFacet(node);\n }\n }\n }\n}\n//# sourceMappingURL=subtree.js.map","import * as log from '../../log';\nimport * as optimizers from './optimizers';\nimport { moveFacetDown } from './subtree';\nexport const FACET_SCALE_PREFIX = 'scale_';\nexport const MAX_OPTIMIZATION_RUNS = 5;\n/**\n * Iterates over a dataflow graph and checks whether all links are consistent.\n */\nexport function checkLinks(nodes) {\n for (const node of nodes) {\n for (const child of node.children) {\n if (child.parent !== node) {\n // log.error('Dataflow graph is inconsistent.', node, child);\n return false;\n }\n }\n if (!checkLinks(node.children)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Run the specified optimizer on the provided nodes.\n *\n * @param optimizer The optimizer instance to run.\n * @param nodes A set of nodes to optimize.\n */\nfunction runOptimizer(optimizer, nodes) {\n let modified = false;\n for (const node of nodes) {\n modified = optimizer.optimize(node) || modified;\n }\n return modified;\n}\nfunction optimizationDataflowHelper(dataComponent, model, firstPass) {\n let roots = dataComponent.sources;\n let modified = false;\n modified = runOptimizer(new optimizers.RemoveUnnecessaryOutputNodes(), roots) || modified;\n modified = runOptimizer(new optimizers.RemoveUnnecessaryIdentifierNodes(model), roots) || modified;\n // remove source nodes that don't have any children because they also don't have output nodes\n roots = roots.filter(r => r.numChildren() > 0);\n modified = runOptimizer(new optimizers.RemoveUnusedSubtrees(), roots) || modified;\n roots = roots.filter(r => r.numChildren() > 0);\n if (!firstPass) {\n // Only run these optimizations after the optimizer has moved down the facet node.\n // With this change, we can be more aggressive in the optimizations.\n modified = runOptimizer(new optimizers.MoveParseUp(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeBins(model), roots) || modified;\n modified = runOptimizer(new optimizers.RemoveDuplicateTimeUnits(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeParse(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeAggregates(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeTimeUnits(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeIdenticalNodes(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeOutputs(), roots) || modified;\n }\n dataComponent.sources = roots;\n return modified;\n}\n/**\n * Optimizes the dataflow of the passed in data component.\n */\nexport function optimizeDataflow(data, model) {\n // check before optimizations\n checkLinks(data.sources);\n let firstPassCounter = 0;\n let secondPassCounter = 0;\n for (let i = 0; i < MAX_OPTIMIZATION_RUNS; i++) {\n if (!optimizationDataflowHelper(data, model, true)) {\n break;\n }\n firstPassCounter++;\n }\n // move facets down and make a copy of the subtree so that we can have scales at the top level\n data.sources.map(moveFacetDown);\n for (let i = 0; i < MAX_OPTIMIZATION_RUNS; i++) {\n if (!optimizationDataflowHelper(data, model, false)) {\n break;\n }\n secondPassCounter++;\n }\n // check after optimizations\n checkLinks(data.sources);\n if (Math.max(firstPassCounter, secondPassCounter) === MAX_OPTIMIZATION_RUNS) {\n log.warn(`Maximum optimization runs(${MAX_OPTIMIZATION_RUNS}) reached.`);\n }\n}\n//# sourceMappingURL=optimize.js.map","/**\n * A class that behaves like a SignalRef but lazily generates the signal.\n * The provided generator function should use `Model.getSignalName` to use the correct signal name.\n */\nexport class SignalRefWrapper {\n constructor(exprGenerator) {\n Object.defineProperty(this, 'signal', {\n enumerable: true,\n get: exprGenerator\n });\n }\n static fromName(rename, signalName) {\n return new SignalRefWrapper(() => rename(signalName));\n }\n}\n//# sourceMappingURL=signal.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isObject, isString } from 'vega-util';\nimport { isAggregateOp, isArgmaxDef, isArgminDef, MULTIDOMAIN_SORT_OP_INDEX as UNIONDOMAIN_SORT_OP_INDEX, SHARED_DOMAIN_OP_INDEX } from '../../aggregate';\nimport { isBinning, isBinParams, isSelectionExtent } from '../../bin';\nimport { getSecondaryRangeChannel, isScaleChannel } from '../../channel';\nimport { binRequiresRange, getFieldOrDatumDef, hasBand, isDatumDef, isFieldDef, valueExpr, vgField } from '../../channeldef';\nimport { DataSourceType } from '../../data';\nimport * as log from '../../log';\nimport { hasDiscreteDomain, isDomainUnionWith, isSelectionDomain } from '../../scale';\nimport { DEFAULT_SORT_OP, isSortArray, isSortByEncoding, isSortField } from '../../sort';\nimport { normalizeTimeUnit } from '../../timeunit';\nimport * as util from '../../util';\nimport { isDataRefDomain, isDataRefUnionedDomain, isFieldRefUnionDomain, isSignalRef } from '../../vega.schema';\nimport { getBinSignalName } from '../data/bin';\nimport { sortArrayIndexField } from '../data/calculate';\nimport { FACET_SCALE_PREFIX } from '../data/optimize';\nimport { isFacetModel, isUnitModel } from '../model';\nimport { SignalRefWrapper } from '../signal';\nimport { makeExplicit, makeImplicit, mergeValuesWithExplicit } from '../split';\nexport function parseScaleDomain(model) {\n if (isUnitModel(model)) {\n parseUnitScaleDomain(model);\n }\n else {\n parseNonUnitScaleDomain(model);\n }\n}\nfunction parseUnitScaleDomain(model) {\n const localScaleComponents = model.component.scales;\n for (const channel of util.keys(localScaleComponents)) {\n const domains = parseDomainForChannel(model, channel);\n const localScaleCmpt = localScaleComponents[channel];\n localScaleCmpt.setWithExplicit('domains', domains);\n parseSelectionDomain(model, channel);\n if (model.component.data.isFaceted) {\n // get resolve from closest facet parent as this decides whether we need to refer to cloned subtree or not\n let facetParent = model;\n while (!isFacetModel(facetParent) && facetParent.parent) {\n facetParent = facetParent.parent;\n }\n const resolve = facetParent.component.resolve.scale[channel];\n if (resolve === 'shared') {\n for (const domain of domains.value) {\n // Replace the scale domain with data output from a cloned subtree after the facet.\n if (isDataRefDomain(domain)) {\n // use data from cloned subtree (which is the same as data but with a prefix added once)\n domain.data = FACET_SCALE_PREFIX + domain.data.replace(FACET_SCALE_PREFIX, '');\n }\n }\n }\n }\n }\n}\nfunction parseNonUnitScaleDomain(model) {\n for (const child of model.children) {\n parseScaleDomain(child);\n }\n const localScaleComponents = model.component.scales;\n for (const channel of util.keys(localScaleComponents)) {\n let domains;\n let selectionExtent = null;\n for (const child of model.children) {\n const childComponent = child.component.scales[channel];\n if (childComponent) {\n if (domains === undefined) {\n domains = childComponent.getWithExplicit('domains');\n }\n else {\n domains = mergeValuesWithExplicit(domains, childComponent.getWithExplicit('domains'), 'domains', 'scale', domainsTieBreaker);\n }\n const se = childComponent.get('selectionExtent');\n if (selectionExtent && se && selectionExtent.selection !== se.selection) {\n log.warn(log.message.NEEDS_SAME_SELECTION);\n }\n selectionExtent = se;\n }\n }\n localScaleComponents[channel].setWithExplicit('domains', domains);\n if (selectionExtent) {\n localScaleComponents[channel].set('selectionExtent', selectionExtent, true);\n }\n }\n}\n/**\n * Remove unaggregated domain if it is not applicable\n * Add unaggregated domain if domain is not specified and config.scale.useUnaggregatedDomain is true.\n */\nfunction normalizeUnaggregatedDomain(domain, fieldDef, scaleType, scaleConfig) {\n if (domain === 'unaggregated') {\n const { valid, reason } = canUseUnaggregatedDomain(fieldDef, scaleType);\n if (!valid) {\n log.warn(reason);\n return undefined;\n }\n }\n else if (domain === undefined && scaleConfig.useUnaggregatedDomain) {\n // Apply config if domain is not specified.\n const { valid } = canUseUnaggregatedDomain(fieldDef, scaleType);\n if (valid) {\n return 'unaggregated';\n }\n }\n return domain;\n}\nexport function parseDomainForChannel(model, channel) {\n const scaleType = model.getScaleComponent(channel).get('type');\n const { encoding } = model;\n const domain = normalizeUnaggregatedDomain(model.scaleDomain(channel), model.typedFieldDef(channel), scaleType, model.config.scale);\n if (domain !== model.scaleDomain(channel)) {\n model.specifiedScales[channel] = Object.assign(Object.assign({}, model.specifiedScales[channel]), { domain });\n }\n // If channel is either X or Y then union them with X2 & Y2 if they exist\n if (channel === 'x' && getFieldOrDatumDef(encoding.x2)) {\n if (getFieldOrDatumDef(encoding.x)) {\n return mergeValuesWithExplicit(parseSingleChannelDomain(scaleType, domain, model, 'x'), parseSingleChannelDomain(scaleType, domain, model, 'x2'), 'domain', 'scale', domainsTieBreaker);\n }\n else {\n return parseSingleChannelDomain(scaleType, domain, model, 'x2');\n }\n }\n else if (channel === 'y' && getFieldOrDatumDef(encoding.y2)) {\n if (getFieldOrDatumDef(encoding.y)) {\n return mergeValuesWithExplicit(parseSingleChannelDomain(scaleType, domain, model, 'y'), parseSingleChannelDomain(scaleType, domain, model, 'y2'), 'domain', 'scale', domainsTieBreaker);\n }\n else {\n return parseSingleChannelDomain(scaleType, domain, model, 'y2');\n }\n }\n return parseSingleChannelDomain(scaleType, domain, model, channel);\n}\nfunction mapDomainToDataSignal(domain, type, timeUnit) {\n return domain.map(v => {\n const data = valueExpr(v, { timeUnit, type });\n return { signal: `{data: ${data}}` };\n });\n}\nfunction convertDomainIfItIsDateTime(domain, type, timeUnit) {\n var _a;\n // explicit value\n const normalizedTimeUnit = (_a = normalizeTimeUnit(timeUnit)) === null || _a === void 0 ? void 0 : _a.unit;\n if (type === 'temporal' || normalizedTimeUnit) {\n return mapDomainToDataSignal(domain, type, normalizedTimeUnit);\n }\n return [domain]; // Date time won't make sense\n}\nfunction parseSingleChannelDomain(scaleType, domain, model, channel) {\n const { encoding } = model;\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n const { type } = fieldOrDatumDef;\n const timeUnit = fieldOrDatumDef['timeUnit'];\n if (isDomainUnionWith(domain)) {\n const defaultDomain = parseSingleChannelDomain(scaleType, undefined, model, channel);\n const unionWith = convertDomainIfItIsDateTime(domain.unionWith, type, timeUnit);\n return makeExplicit([...defaultDomain.value, ...unionWith]);\n }\n else if (isSignalRef(domain)) {\n return makeExplicit([domain]);\n }\n else if (domain && domain !== 'unaggregated' && !isSelectionDomain(domain)) {\n return makeExplicit(convertDomainIfItIsDateTime(domain, type, timeUnit));\n }\n const stack = model.stack;\n if (stack && channel === stack.fieldChannel) {\n if (stack.offset === 'normalize') {\n return makeImplicit([[0, 1]]);\n }\n const data = model.requestDataName(DataSourceType.Main);\n return makeImplicit([\n {\n data,\n field: model.vgField(channel, { suffix: 'start' })\n },\n {\n data,\n field: model.vgField(channel, { suffix: 'end' })\n }\n ]);\n }\n const sort = isScaleChannel(channel) && isFieldDef(fieldOrDatumDef) ? domainSort(model, channel, scaleType) : undefined;\n if (isDatumDef(fieldOrDatumDef)) {\n const d = convertDomainIfItIsDateTime([fieldOrDatumDef.datum], type, timeUnit);\n return makeImplicit(d);\n }\n const fieldDef = fieldOrDatumDef; // now we can be sure it's a fieldDef\n if (domain === 'unaggregated') {\n const data = model.requestDataName(DataSourceType.Main);\n const { field } = fieldOrDatumDef;\n return makeImplicit([\n {\n data,\n field: vgField({ field, aggregate: 'min' })\n },\n {\n data,\n field: vgField({ field, aggregate: 'max' })\n }\n ]);\n }\n else if (isBinning(fieldDef.bin)) {\n if (hasDiscreteDomain(scaleType)) {\n if (scaleType === 'bin-ordinal') {\n // we can omit the domain as it is inferred from the `bins` property\n return makeImplicit([]);\n }\n // ordinal bin scale takes domain from bin_range, ordered by bin start\n // This is useful for both axis-based scale (x/y) and legend-based scale (other channels).\n return makeImplicit([\n {\n // If sort by aggregation of a specified sort field, we need to use RAW table,\n // so we can aggregate values for the scale independently from the main aggregation.\n data: util.isBoolean(sort)\n ? model.requestDataName(DataSourceType.Main)\n : model.requestDataName(DataSourceType.Raw),\n // Use range if we added it and the scale does not support computing a range as a signal.\n field: model.vgField(channel, binRequiresRange(fieldDef, channel) ? { binSuffix: 'range' } : {}),\n // we have to use a sort object if sort = true to make the sort correct by bin start\n sort: sort === true || !isObject(sort)\n ? {\n field: model.vgField(channel, {}),\n op: 'min' // min or max doesn't matter since we sort by the start of the bin range\n }\n : sort\n }\n ]);\n }\n else {\n // continuous scales\n const { bin } = fieldDef;\n if (isBinning(bin)) {\n const binSignal = getBinSignalName(model, fieldDef.field, bin);\n return makeImplicit([\n new SignalRefWrapper(() => {\n const signal = model.getSignalName(binSignal);\n return `[${signal}.start, ${signal}.stop]`;\n })\n ]);\n }\n else {\n return makeImplicit([\n {\n data: model.requestDataName(DataSourceType.Main),\n field: model.vgField(channel, {})\n }\n ]);\n }\n }\n }\n else if (fieldDef.timeUnit &&\n util.contains(['time', 'utc'], scaleType) &&\n hasBand(channel, fieldDef, isUnitModel(model) ? model.encoding[getSecondaryRangeChannel(channel)] : undefined, model.stack, model.markDef, model.config)) {\n const data = model.requestDataName(DataSourceType.Main);\n return makeImplicit([\n {\n data,\n field: model.vgField(channel)\n },\n {\n data,\n field: model.vgField(channel, { suffix: 'end' })\n }\n ]);\n }\n else if (sort) {\n return makeImplicit([\n {\n // If sort by aggregation of a specified sort field, we need to use RAW table,\n // so we can aggregate values for the scale independently from the main aggregation.\n data: util.isBoolean(sort)\n ? model.requestDataName(DataSourceType.Main)\n : model.requestDataName(DataSourceType.Raw),\n field: model.vgField(channel),\n sort: sort\n }\n ]);\n }\n else {\n return makeImplicit([\n {\n data: model.requestDataName(DataSourceType.Main),\n field: model.vgField(channel)\n }\n ]);\n }\n}\nfunction normalizeSortField(sort, isStackedMeasure) {\n const { op, field, order } = sort;\n return Object.assign(Object.assign({ \n // Apply default op\n op: op !== null && op !== void 0 ? op : (isStackedMeasure ? 'sum' : DEFAULT_SORT_OP) }, (field ? { field: util.replacePathInField(field) } : {})), (order ? { order } : {}));\n}\nfunction parseSelectionDomain(model, channel) {\n var _a;\n const scale = model.component.scales[channel];\n const spec = model.specifiedScales[channel].domain;\n const bin = (_a = model.fieldDef(channel)) === null || _a === void 0 ? void 0 : _a.bin;\n const domain = isSelectionDomain(spec) && spec;\n const extent = isBinParams(bin) && isSelectionExtent(bin.extent) && bin.extent;\n if (domain || extent) {\n // As scale parsing occurs before selection parsing, we cannot set\n // domainRaw directly. So instead, we store the selectionExtent on\n // the scale component, and then add domainRaw during scale assembly.\n scale.set('selectionExtent', domain !== null && domain !== void 0 ? domain : extent, true);\n }\n}\nexport function domainSort(model, channel, scaleType) {\n if (!hasDiscreteDomain(scaleType)) {\n return undefined;\n }\n // save to cast as the only exception is the geojson type for shape, which would not generate a scale\n const fieldDef = model.fieldDef(channel);\n const sort = fieldDef.sort;\n // if the sort is specified with array, use the derived sort index field\n if (isSortArray(sort)) {\n return {\n op: 'min',\n field: sortArrayIndexField(fieldDef, channel),\n order: 'ascending'\n };\n }\n const { stack } = model;\n const stackDimensions = stack\n ? [...(stack.groupbyField ? [stack.groupbyField] : []), ...stack.stackBy.map(s => s.fieldDef.field)]\n : undefined;\n // Sorted based on an aggregate calculation over a specified sort field (only for ordinal scale)\n if (isSortField(sort)) {\n const isStackedMeasure = stack && !util.contains(stackDimensions, sort.field);\n return normalizeSortField(sort, isStackedMeasure);\n }\n else if (isSortByEncoding(sort)) {\n const { encoding, order } = sort;\n const fieldDefToSortBy = model.fieldDef(encoding);\n const { aggregate, field } = fieldDefToSortBy;\n const isStackedMeasure = stack && !util.contains(stackDimensions, field);\n if (isArgminDef(aggregate) || isArgmaxDef(aggregate)) {\n return normalizeSortField({\n field: vgField(fieldDefToSortBy),\n order\n }, isStackedMeasure);\n }\n else if (isAggregateOp(aggregate) || !aggregate) {\n return normalizeSortField({\n op: aggregate,\n field,\n order\n }, isStackedMeasure);\n }\n }\n else if (sort === 'descending') {\n return {\n op: 'min',\n field: model.vgField(channel),\n order: 'descending'\n };\n }\n else if (util.contains(['ascending', undefined /* default =ascending*/], sort)) {\n return true;\n }\n // sort == null\n return undefined;\n}\n/**\n * Determine if a scale can use unaggregated domain.\n * @return {Boolean} Returns true if all of the following conditions apply:\n * 1. `scale.domain` is `unaggregated`\n * 2. Aggregation function is not `count` or `sum`\n * 3. The scale is quantitative or time scale.\n */\nexport function canUseUnaggregatedDomain(fieldDef, scaleType) {\n const { aggregate, type } = fieldDef;\n if (!aggregate) {\n return {\n valid: false,\n reason: log.message.unaggregateDomainHasNoEffectForRawField(fieldDef)\n };\n }\n if (isString(aggregate) && !SHARED_DOMAIN_OP_INDEX[aggregate]) {\n return {\n valid: false,\n reason: log.message.unaggregateDomainWithNonSharedDomainOp(aggregate)\n };\n }\n if (type === 'quantitative') {\n if (scaleType === 'log') {\n return {\n valid: false,\n reason: log.message.unaggregatedDomainWithLogScale(fieldDef)\n };\n }\n }\n return { valid: true };\n}\n/**\n * Tie breaker for mergeValuesWithExplicit for domains. We concat the specified values.\n */\nfunction domainsTieBreaker(v1, v2, property, propertyOf) {\n if (v1.explicit && v2.explicit) {\n log.warn(log.message.mergeConflictingDomainProperty(property, propertyOf, v1.value, v2.value));\n }\n // If equal score, concat the domains so that we union them later.\n return { explicit: v1.explicit, value: [...v1.value, ...v2.value] };\n}\n/**\n * Converts an array of domains to a single Vega scale domain.\n */\nexport function mergeDomains(domains) {\n const uniqueDomains = util.unique(domains.map(domain => {\n // ignore sort property when computing the unique domains\n if (isDataRefDomain(domain)) {\n const { sort: _s } = domain, domainWithoutSort = __rest(domain, [\"sort\"]);\n return domainWithoutSort;\n }\n return domain;\n }), util.hash);\n const sorts = util.unique(domains\n .map(d => {\n if (isDataRefDomain(d)) {\n const s = d.sort;\n if (s !== undefined && !util.isBoolean(s)) {\n if ('op' in s && s.op === 'count') {\n // let's make sure that if op is count, we don't use a field\n delete s.field;\n }\n if (s.order === 'ascending') {\n // drop order: ascending as it is the default\n delete s.order;\n }\n }\n return s;\n }\n return undefined;\n })\n .filter(s => s !== undefined), util.hash);\n if (uniqueDomains.length === 0) {\n return undefined;\n }\n else if (uniqueDomains.length === 1) {\n const domain = domains[0];\n if (isDataRefDomain(domain) && sorts.length > 0) {\n let sort = sorts[0];\n if (sorts.length > 1) {\n log.warn(log.message.MORE_THAN_ONE_SORT);\n sort = true;\n }\n else {\n // Simplify domain sort by removing field and op when the field is the same as the domain field.\n if (isObject(sort) && 'field' in sort) {\n const sortField = sort.field;\n if (domain.field === sortField) {\n sort = sort.order ? { order: sort.order } : true;\n }\n }\n }\n return Object.assign(Object.assign({}, domain), { sort });\n }\n return domain;\n }\n // only keep sort properties that work with unioned domains\n const unionDomainSorts = util.unique(sorts.map(s => {\n if (util.isBoolean(s) || !('op' in s) || (isString(s.op) && s.op in UNIONDOMAIN_SORT_OP_INDEX)) {\n return s;\n }\n log.warn(log.message.domainSortDropped(s));\n return true;\n }), util.hash);\n let sort;\n if (unionDomainSorts.length === 1) {\n sort = unionDomainSorts[0];\n }\n else if (unionDomainSorts.length > 1) {\n log.warn(log.message.MORE_THAN_ONE_SORT);\n sort = true;\n }\n const allData = util.unique(domains.map(d => {\n if (isDataRefDomain(d)) {\n return d.data;\n }\n return null;\n }), x => x);\n if (allData.length === 1 && allData[0] !== null) {\n // create a union domain of different fields with a single data source\n const domain = Object.assign({ data: allData[0], fields: uniqueDomains.map(d => d.field) }, (sort ? { sort } : {}));\n return domain;\n }\n return Object.assign({ fields: uniqueDomains }, (sort ? { sort } : {}));\n}\n/**\n * Return a field if a scale uses a single field.\n * Return `undefined` otherwise.\n */\nexport function getFieldFromDomain(domain) {\n if (isDataRefDomain(domain) && isString(domain.field)) {\n return domain.field;\n }\n else if (isDataRefUnionedDomain(domain)) {\n let field;\n for (const nonUnionDomain of domain.fields) {\n if (isDataRefDomain(nonUnionDomain) && isString(nonUnionDomain.field)) {\n if (!field) {\n field = nonUnionDomain.field;\n }\n else if (field !== nonUnionDomain.field) {\n log.warn(log.message.FACETED_INDEPENDENT_DIFFERENT_SOURCES);\n return field;\n }\n }\n }\n log.warn(log.message.FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES);\n return field;\n }\n else if (isFieldRefUnionDomain(domain)) {\n log.warn(log.message.FACETED_INDEPENDENT_SAME_SOURCE);\n const field = domain.fields[0];\n return isString(field) ? field : undefined;\n }\n return undefined;\n}\nexport function assembleDomain(model, channel) {\n const scaleComponent = model.component.scales[channel];\n const domains = scaleComponent.get('domains').map((domain) => {\n // Correct references to data as the original domain's data was determined\n // in parseScale, which happens before parseData. Thus the original data\n // reference can be incorrect.\n if (isDataRefDomain(domain)) {\n domain.data = model.lookupDataSource(domain.data);\n }\n return domain;\n });\n // domains is an array that has to be merged into a single vega domain\n return mergeDomains(domains);\n}\n//# sourceMappingURL=domain.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isObject } from 'vega-util';\nimport { isXorY } from '../../channel';\nimport { keys } from '../../util';\nimport { isDataRefDomain, isVgRangeStep } from '../../vega.schema';\nimport { isConcatModel, isLayerModel } from '../model';\nimport { assembleSelectionScaleDomain } from '../selection/assemble';\nimport { assembleDomain } from './domain';\nexport function assembleScales(model) {\n if (isLayerModel(model) || isConcatModel(model)) {\n // For concat and layer, include scales of children too\n return model.children.reduce((scales, child) => {\n return scales.concat(assembleScales(child));\n }, assembleScalesForModel(model));\n }\n else {\n // For facet, child scales would not be included in the parent's scope.\n // For unit, there is no child.\n return assembleScalesForModel(model);\n }\n}\nexport function assembleScalesForModel(model) {\n return keys(model.component.scales).reduce((scales, channel) => {\n const scaleComponent = model.component.scales[channel];\n if (scaleComponent.merged) {\n // Skipped merged scales\n return scales;\n }\n const scale = scaleComponent.combine();\n const { name, type, selectionExtent, domains: _d, range: _r, reverse } = scale, otherScaleProps = __rest(scale, [\"name\", \"type\", \"selectionExtent\", \"domains\", \"range\", \"reverse\"]);\n const range = assembleScaleRange(scale.range, name, channel, model);\n let domainRaw;\n if (selectionExtent) {\n domainRaw = assembleSelectionScaleDomain(model, selectionExtent);\n }\n const domain = assembleDomain(model, channel);\n scales.push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ name,\n type }, (domain ? { domain } : {})), (domainRaw ? { domainRaw } : {})), { range }), (reverse !== undefined ? { reverse: reverse } : {})), otherScaleProps));\n return scales;\n }, []);\n}\nexport function assembleScaleRange(scaleRange, scaleName, channel, model) {\n // add signals to x/y range\n if (isXorY(channel)) {\n if (isVgRangeStep(scaleRange)) {\n // For width/height step, use a signal created in layout assemble instead of a constant step.\n return {\n step: { signal: scaleName + '_step' }\n };\n }\n }\n else if (isObject(scaleRange) && isDataRefDomain(scaleRange)) {\n return Object.assign(Object.assign({}, scaleRange), { data: model.lookupDataSource(scaleRange.data) });\n }\n return scaleRange;\n}\n//# sourceMappingURL=assemble.js.map","import { isArray } from 'vega-util';\nimport { some } from '../../util';\nimport { Split } from '../split';\nexport class ScaleComponent extends Split {\n constructor(name, typeWithExplicit) {\n super({}, // no initial explicit property\n { name } // name as initial implicit property\n );\n this.merged = false;\n this.setWithExplicit('type', typeWithExplicit);\n }\n /**\n * Whether the scale definitely includes zero in the domain\n */\n domainDefinitelyIncludesZero() {\n if (this.get('zero') !== false) {\n return true;\n }\n return some(this.get('domains'), d => isArray(d) && d.length === 2 && d[0] <= 0 && d[1] >= 0);\n }\n}\n//# sourceMappingURL=component.js.map","import { isArray, isNumber, isObject } from 'vega-util';\nimport { isBinning } from '../../bin';\nimport { ANGLE, COLOR, FILL, FILLOPACITY, isXorY, OPACITY, RADIUS, SCALE_CHANNELS, SHAPE, SIZE, STROKE, STROKEDASH, STROKEOPACITY, STROKEWIDTH, THETA, X, Y } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { getViewConfigDiscreteSize, getViewConfigDiscreteStep } from '../../config';\nimport { DataSourceType } from '../../data';\nimport * as log from '../../log';\nimport { channelScalePropertyIncompatability, hasContinuousDomain, hasDiscreteDomain, isContinuousToDiscrete, isExtendedScheme, scaleTypeSupportProperty } from '../../scale';\nimport { isStep } from '../../spec/base';\nimport * as util from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { signalOrStringValue } from '../common';\nimport { getBinSignalName } from '../data/bin';\nimport { SignalRefWrapper } from '../signal';\nimport { makeExplicit, makeImplicit } from '../split';\nexport const RANGE_PROPERTIES = ['range', 'scheme'];\nfunction getSizeChannel(channel) {\n return channel === 'x' ? 'width' : channel === 'y' ? 'height' : undefined;\n}\nexport function parseUnitScaleRange(model) {\n const localScaleComponents = model.component.scales;\n // use SCALE_CHANNELS instead of scales[channel] to ensure that x, y come first!\n for (const channel of SCALE_CHANNELS) {\n const localScaleCmpt = localScaleComponents[channel];\n if (!localScaleCmpt) {\n continue;\n }\n const rangeWithExplicit = parseRangeForChannel(channel, model);\n localScaleCmpt.setWithExplicit('range', rangeWithExplicit);\n }\n}\nfunction getBinStepSignal(model, channel) {\n const fieldDef = model.fieldDef(channel);\n if (fieldDef && fieldDef.bin && isBinning(fieldDef.bin)) {\n const binSignal = getBinSignalName(model, fieldDef.field, fieldDef.bin);\n // TODO: extract this to be range step signal\n const sizeType = getSizeChannel(channel);\n const sizeSignal = model.getName(sizeType);\n return new SignalRefWrapper(() => {\n const updatedName = model.getSignalName(binSignal);\n const binCount = `(${updatedName}.stop - ${updatedName}.start) / ${updatedName}.step`;\n return `${model.getSignalName(sizeSignal)} / (${binCount})`;\n });\n }\n return undefined;\n}\n/**\n * Return mixins that includes one of the Vega range types (explicit range, range.step, range.scheme).\n */\nexport function parseRangeForChannel(channel, model) {\n const specifiedScale = model.specifiedScales[channel];\n const { size } = model;\n const mergedScaleCmpt = model.getScaleComponent(channel);\n const scaleType = mergedScaleCmpt.get('type');\n // Check if any of the range properties is specified.\n // If so, check if it is compatible and make sure that we only output one of the properties\n for (const property of RANGE_PROPERTIES) {\n if (specifiedScale[property] !== undefined) {\n const supportedByScaleType = scaleTypeSupportProperty(scaleType, property);\n const channelIncompatability = channelScalePropertyIncompatability(channel, property);\n if (!supportedByScaleType) {\n log.warn(log.message.scalePropertyNotWorkWithScaleType(scaleType, property, channel));\n }\n else if (channelIncompatability) {\n // channel\n log.warn(channelIncompatability);\n }\n else {\n switch (property) {\n case 'range': {\n const range = specifiedScale.range;\n if (isArray(range)) {\n if (isXorY(channel)) {\n return makeExplicit(range.map(v => {\n if (v === 'width' || v === 'height') {\n // get signal for width/height\n // Just like default range logic below, we use SignalRefWrapper to account for potential merges and renames.\n const sizeSignal = model.getName(v);\n const getSignalName = model.getSignalName.bind(model);\n return SignalRefWrapper.fromName(getSignalName, sizeSignal);\n }\n return v;\n }));\n }\n }\n else if (isObject(range)) {\n return makeExplicit({\n data: model.requestDataName(DataSourceType.Main),\n field: range.field,\n sort: { op: 'min', field: model.vgField(channel) }\n });\n }\n return makeExplicit(range);\n }\n case 'scheme':\n return makeExplicit(parseScheme(specifiedScale[property]));\n }\n }\n }\n }\n if (channel === X || channel === Y) {\n const sizeChannel = channel === X ? 'width' : 'height';\n const sizeValue = size[sizeChannel];\n if (isStep(sizeValue)) {\n if (hasDiscreteDomain(scaleType)) {\n return makeExplicit({ step: sizeValue.step });\n }\n else {\n log.warn(log.message.stepDropped(sizeChannel));\n }\n }\n }\n const { rangeMin, rangeMax } = specifiedScale;\n const d = defaultRange(channel, model);\n if ((rangeMin !== undefined || rangeMax !== undefined) &&\n // it's ok to check just rangeMin's compatibility since rangeMin/rangeMax are the same\n scaleTypeSupportProperty(scaleType, 'rangeMin') &&\n isArray(d) &&\n d.length === 2) {\n return makeExplicit([rangeMin !== null && rangeMin !== void 0 ? rangeMin : d[0], rangeMax !== null && rangeMax !== void 0 ? rangeMax : d[1]]);\n }\n return makeImplicit(d);\n}\nfunction parseScheme(scheme) {\n if (isExtendedScheme(scheme)) {\n return Object.assign({ scheme: scheme.name }, util.omit(scheme, ['name']));\n }\n return { scheme: scheme };\n}\nfunction defaultRange(channel, model) {\n const { size, config, mark, encoding } = model;\n const getSignalName = model.getSignalName.bind(model);\n const { type } = getFieldOrDatumDef(encoding[channel]);\n const mergedScaleCmpt = model.getScaleComponent(channel);\n const scaleType = mergedScaleCmpt.get('type');\n const { domain, domainMid } = model.specifiedScales[channel];\n switch (channel) {\n case X:\n case Y: {\n // If there is no explicit width/height for discrete x/y scales\n if (util.contains(['point', 'band'], scaleType)) {\n if (channel === X && !size.width) {\n const w = getViewConfigDiscreteSize(config.view, 'width');\n if (isStep(w)) {\n return w;\n }\n }\n else if (channel === Y && !size.height) {\n const h = getViewConfigDiscreteSize(config.view, 'height');\n if (isStep(h)) {\n return h;\n }\n }\n }\n // If step is null, use zero to width or height.\n // Note that we use SignalRefWrapper to account for potential merges and renames.\n const sizeType = getSizeChannel(channel);\n const sizeSignal = model.getName(sizeType);\n if (channel === Y && hasContinuousDomain(scaleType)) {\n // For y continuous scale, we have to start from the height as the bottom part has the max value.\n return [SignalRefWrapper.fromName(getSignalName, sizeSignal), 0];\n }\n else {\n return [0, SignalRefWrapper.fromName(getSignalName, sizeSignal)];\n }\n }\n case SIZE: {\n // TODO: support custom rangeMin, rangeMax\n const zero = model.component.scales[channel].get('zero');\n const rangeMin = sizeRangeMin(mark, zero, config);\n const rangeMax = sizeRangeMax(mark, size, model, config);\n if (isContinuousToDiscrete(scaleType)) {\n return interpolateRange(rangeMin, rangeMax, defaultContinuousToDiscreteCount(scaleType, config, domain, channel));\n }\n else {\n return [rangeMin, rangeMax];\n }\n }\n case THETA:\n return [0, Math.PI * 2];\n case ANGLE:\n // TODO: add config.scale.min/maxAngleDegree (for point and text) and config.scale.min/maxAngleRadian (for arc) once we add arc marks.\n // (It's weird to add just config.scale.min/maxAngleDegree for now)\n return [0, 360];\n case RADIUS: {\n // max radius = half od min(width,height)\n return [\n 0,\n new SignalRefWrapper(() => {\n const w = model.getSignalName('width');\n const h = model.getSignalName('height');\n return `min(${w},${h})/2`;\n })\n ];\n }\n case STROKEWIDTH:\n // TODO: support custom rangeMin, rangeMax\n return [config.scale.minStrokeWidth, config.scale.maxStrokeWidth];\n case STROKEDASH:\n return [\n // TODO: add this to Vega's config.range?\n [1, 0],\n [4, 2],\n [2, 1],\n [1, 1],\n [1, 2, 4, 2]\n ];\n case SHAPE:\n return 'symbol';\n case COLOR:\n case FILL:\n case STROKE:\n if (scaleType === 'ordinal') {\n // Only nominal data uses ordinal scale by default\n return type === 'nominal' ? 'category' : 'ordinal';\n }\n else {\n if (domainMid !== undefined) {\n return 'diverging';\n }\n else {\n return mark === 'rect' || mark === 'geoshape' ? 'heatmap' : 'ramp';\n }\n }\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n // TODO: support custom rangeMin, rangeMax\n return [config.scale.minOpacity, config.scale.maxOpacity];\n }\n /* istanbul ignore next: should never reach here */\n throw new Error(`Scale range undefined for channel ${channel}`);\n}\nexport function defaultContinuousToDiscreteCount(scaleType, config, domain, channel) {\n switch (scaleType) {\n case 'quantile':\n return config.scale.quantileCount;\n case 'quantize':\n return config.scale.quantizeCount;\n case 'threshold':\n if (domain !== undefined && isArray(domain)) {\n return domain.length + 1;\n }\n else {\n log.warn(log.message.domainRequiredForThresholdScale(channel));\n // default threshold boundaries for threshold scale since domain has cardinality of 2\n return 3;\n }\n }\n}\n/**\n * Returns the linear interpolation of the range according to the cardinality\n *\n * @param rangeMin start of the range\n * @param rangeMax end of the range\n * @param cardinality number of values in the output range\n */\nexport function interpolateRange(rangeMin, rangeMax, cardinality) {\n // always return a signal since it's better to compute the sequence in Vega later\n const f = () => {\n const rMax = signalOrStringValue(rangeMax);\n const rMin = signalOrStringValue(rangeMin);\n const step = `(${rMax} - ${rMin}) / (${cardinality} - 1)`;\n return `sequence(${rMin}, ${rMax} + ${step}, ${step})`;\n };\n if (isSignalRef(rangeMax)) {\n return new SignalRefWrapper(f);\n }\n else {\n return { signal: f() };\n }\n}\nfunction sizeRangeMin(mark, zero, config) {\n if (zero) {\n if (isSignalRef(zero)) {\n return { signal: `${zero.signal} ? 0 : ${sizeRangeMin(mark, false, config)}` };\n }\n else {\n return 0;\n }\n }\n switch (mark) {\n case 'bar':\n case 'tick':\n return config.scale.minBandSize;\n case 'line':\n case 'trail':\n case 'rule':\n return config.scale.minStrokeWidth;\n case 'text':\n return config.scale.minFontSize;\n case 'point':\n case 'square':\n case 'circle':\n return config.scale.minSize;\n }\n /* istanbul ignore next: should never reach here */\n // sizeRangeMin not implemented for the mark\n throw new Error(log.message.incompatibleChannel('size', mark));\n}\nexport const MAX_SIZE_RANGE_STEP_RATIO = 0.95;\nfunction sizeRangeMax(mark, size, model, config) {\n const xyStepSignals = {\n x: getBinStepSignal(model, 'x'),\n y: getBinStepSignal(model, 'y')\n };\n switch (mark) {\n case 'bar':\n case 'tick': {\n if (config.scale.maxBandSize !== undefined) {\n return config.scale.maxBandSize;\n }\n const min = minXYStep(size, xyStepSignals, config.view);\n if (isNumber(min)) {\n return min - 1;\n }\n else {\n return new SignalRefWrapper(() => `${min.signal} - 1`);\n }\n }\n case 'line':\n case 'trail':\n case 'rule':\n return config.scale.maxStrokeWidth;\n case 'text':\n return config.scale.maxFontSize;\n case 'point':\n case 'square':\n case 'circle': {\n if (config.scale.maxSize) {\n return config.scale.maxSize;\n }\n const pointStep = minXYStep(size, xyStepSignals, config.view);\n if (isNumber(pointStep)) {\n return Math.pow(MAX_SIZE_RANGE_STEP_RATIO * pointStep, 2);\n }\n else {\n return new SignalRefWrapper(() => `pow(${MAX_SIZE_RANGE_STEP_RATIO} * ${pointStep.signal}, 2)`);\n }\n }\n }\n /* istanbul ignore next: should never reach here */\n // sizeRangeMax not implemented for the mark\n throw new Error(log.message.incompatibleChannel('size', mark));\n}\n/**\n * @returns {number} Range step of x or y or minimum between the two if both are ordinal scale.\n */\nfunction minXYStep(size, xyStepSignals, viewConfig) {\n const widthStep = isStep(size.width) ? size.width.step : getViewConfigDiscreteStep(viewConfig, 'width');\n const heightStep = isStep(size.height) ? size.height.step : getViewConfigDiscreteStep(viewConfig, 'height');\n if (xyStepSignals.x || xyStepSignals.y) {\n return new SignalRefWrapper(() => {\n const exprs = [\n xyStepSignals.x ? xyStepSignals.x.signal : widthStep,\n xyStepSignals.y ? xyStepSignals.y.signal : heightStep\n ];\n return `min(${exprs.join(', ')})`;\n });\n }\n return Math.min(widthStep, heightStep);\n}\n//# sourceMappingURL=range.js.map","import { isArray } from 'vega-util';\nimport { isBinned, isBinning, isBinParams } from '../../bin';\nimport { COLOR, FILL, POLAR_POSITION_SCALE_CHANNELS, POSITION_SCALE_CHANNELS, POSITION_SCALE_CHANNEL_INDEX, STROKE } from '../../channel';\nimport { getFieldDef, getFieldOrDatumDef, isFieldDef, valueExpr } from '../../channeldef';\nimport { isDateTime } from '../../datetime';\nimport * as log from '../../log';\nimport { channelScalePropertyIncompatability, hasContinuousDomain, isContinuousToContinuous, isContinuousToDiscrete, ScaleType, scaleTypeSupportProperty } from '../../scale';\nimport * as util from '../../util';\nimport { contains, getFirstDefined, keys } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { getBinSignalName } from '../data/bin';\nimport { isUnitModel } from '../model';\nimport { SignalRefWrapper } from '../signal';\nimport { mergeValuesWithExplicit, tieBreakByComparing } from '../split';\nimport { parseUnitScaleRange } from './range';\nexport function parseScaleProperty(model, property) {\n if (isUnitModel(model)) {\n parseUnitScaleProperty(model, property);\n }\n else {\n parseNonUnitScaleProperty(model, property);\n }\n}\nfunction parseUnitScaleProperty(model, property) {\n const localScaleComponents = model.component.scales;\n const { config, encoding, markDef, specifiedScales } = model;\n for (const channel of keys(localScaleComponents)) {\n const specifiedScale = specifiedScales[channel];\n const localScaleCmpt = localScaleComponents[channel];\n const mergedScaleCmpt = model.getScaleComponent(channel);\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n const specifiedValue = specifiedScale[property];\n const scaleType = mergedScaleCmpt.get('type');\n const scalePadding = mergedScaleCmpt.get('padding');\n const scalePaddingInner = mergedScaleCmpt.get('paddingInner');\n const supportedByScaleType = scaleTypeSupportProperty(scaleType, property);\n const channelIncompatability = channelScalePropertyIncompatability(channel, property);\n if (specifiedValue !== undefined) {\n // If there is a specified value, check if it is compatible with scale type and channel\n if (!supportedByScaleType) {\n log.warn(log.message.scalePropertyNotWorkWithScaleType(scaleType, property, channel));\n }\n else if (channelIncompatability) {\n // channel\n log.warn(channelIncompatability);\n }\n }\n if (supportedByScaleType && channelIncompatability === undefined) {\n if (specifiedValue !== undefined) {\n const timeUnit = fieldOrDatumDef['timeUnit'];\n const type = fieldOrDatumDef.type;\n switch (property) {\n // domainMax/Min to signal if the value is a datetime object\n case 'domainMax':\n case 'domainMin':\n if (isDateTime(specifiedScale[property]) || type === 'temporal' || timeUnit) {\n localScaleCmpt.set(property, { signal: valueExpr(specifiedScale[property], { type, timeUnit }) }, true);\n }\n else {\n localScaleCmpt.set(property, specifiedScale[property], true);\n }\n break;\n default:\n localScaleCmpt.copyKeyFromObject(property, specifiedScale);\n }\n }\n else {\n const value = property in scaleRules\n ? scaleRules[property]({\n model,\n channel,\n fieldOrDatumDef,\n scaleType,\n scalePadding,\n scalePaddingInner,\n domain: specifiedScale.domain,\n markDef,\n config\n })\n : config.scale[property];\n if (value !== undefined) {\n localScaleCmpt.set(property, value, false);\n }\n }\n }\n }\n}\nexport const scaleRules = {\n bins: ({ model, fieldOrDatumDef }) => (isFieldDef(fieldOrDatumDef) ? bins(model, fieldOrDatumDef) : undefined),\n interpolate: ({ channel, fieldOrDatumDef }) => interpolate(channel, fieldOrDatumDef.type),\n nice: ({ scaleType, channel, fieldOrDatumDef }) => nice(scaleType, channel, fieldOrDatumDef),\n padding: ({ channel, scaleType, fieldOrDatumDef, markDef, config }) => padding(channel, scaleType, config.scale, fieldOrDatumDef, markDef, config.bar),\n paddingInner: ({ scalePadding, channel, markDef, config }) => paddingInner(scalePadding, channel, markDef.type, config.scale),\n paddingOuter: ({ scalePadding, channel, scaleType, markDef, scalePaddingInner, config }) => paddingOuter(scalePadding, channel, scaleType, markDef.type, scalePaddingInner, config.scale),\n reverse: ({ fieldOrDatumDef, scaleType, channel, config }) => {\n const sort = isFieldDef(fieldOrDatumDef) ? fieldOrDatumDef.sort : undefined;\n return reverse(scaleType, sort, channel, config.scale);\n },\n zero: ({ channel, fieldOrDatumDef, domain, markDef, scaleType }) => zero(channel, fieldOrDatumDef, domain, markDef, scaleType)\n};\n// This method is here rather than in range.ts to avoid circular dependency.\nexport function parseScaleRange(model) {\n if (isUnitModel(model)) {\n parseUnitScaleRange(model);\n }\n else {\n parseNonUnitScaleProperty(model, 'range');\n }\n}\nexport function parseNonUnitScaleProperty(model, property) {\n const localScaleComponents = model.component.scales;\n for (const child of model.children) {\n if (property === 'range') {\n parseScaleRange(child);\n }\n else {\n parseScaleProperty(child, property);\n }\n }\n for (const channel of keys(localScaleComponents)) {\n let valueWithExplicit;\n for (const child of model.children) {\n const childComponent = child.component.scales[channel];\n if (childComponent) {\n const childValueWithExplicit = childComponent.getWithExplicit(property);\n valueWithExplicit = mergeValuesWithExplicit(valueWithExplicit, childValueWithExplicit, property, 'scale', tieBreakByComparing((v1, v2) => {\n switch (property) {\n case 'range':\n // For step, prefer larger step\n if (v1.step && v2.step) {\n return v1.step - v2.step;\n }\n return 0;\n // TODO: precedence rule for other properties\n }\n return 0;\n }));\n }\n }\n localScaleComponents[channel].setWithExplicit(property, valueWithExplicit);\n }\n}\nexport function bins(model, fieldDef) {\n const bin = fieldDef.bin;\n if (isBinning(bin)) {\n const binSignal = getBinSignalName(model, fieldDef.field, bin);\n return new SignalRefWrapper(() => {\n return model.getSignalName(binSignal);\n });\n }\n else if (isBinned(bin) && isBinParams(bin) && bin.step !== undefined) {\n // start and stop will be determined from the scale domain\n return {\n step: bin.step\n };\n }\n return undefined;\n}\nexport function interpolate(channel, type) {\n if (contains([COLOR, FILL, STROKE], channel) && type !== 'nominal') {\n return 'hcl';\n }\n return undefined;\n}\nexport function nice(scaleType, channel, fieldOrDatumDef) {\n var _a;\n if (((_a = getFieldDef(fieldOrDatumDef)) === null || _a === void 0 ? void 0 : _a.bin) || util.contains([ScaleType.TIME, ScaleType.UTC], scaleType)) {\n return undefined;\n }\n return channel in POSITION_SCALE_CHANNEL_INDEX ? true : undefined;\n}\nexport function padding(channel, scaleType, scaleConfig, fieldOrDatumDef, markDef, barConfig) {\n if (channel in POSITION_SCALE_CHANNEL_INDEX) {\n if (isContinuousToContinuous(scaleType)) {\n if (scaleConfig.continuousPadding !== undefined) {\n return scaleConfig.continuousPadding;\n }\n const { type, orient } = markDef;\n if (type === 'bar' && !(isFieldDef(fieldOrDatumDef) && (fieldOrDatumDef.bin || fieldOrDatumDef.timeUnit))) {\n if ((orient === 'vertical' && channel === 'x') || (orient === 'horizontal' && channel === 'y')) {\n return barConfig.continuousBandSize;\n }\n }\n }\n if (scaleType === ScaleType.POINT) {\n return scaleConfig.pointPadding;\n }\n }\n return undefined;\n}\nexport function paddingInner(paddingValue, channel, mark, scaleConfig) {\n if (paddingValue !== undefined) {\n // If user has already manually specified \"padding\", no need to add default paddingInner.\n return undefined;\n }\n if (channel in POSITION_SCALE_CHANNEL_INDEX) {\n // Padding is only set for X and Y by default.\n // Basically it doesn't make sense to add padding for color and size.\n // paddingOuter would only be called if it's a band scale, just return the default for bandScale.\n const { bandPaddingInner, barBandPaddingInner, rectBandPaddingInner } = scaleConfig;\n return getFirstDefined(bandPaddingInner, mark === 'bar' ? barBandPaddingInner : rectBandPaddingInner);\n }\n return undefined;\n}\nexport function paddingOuter(paddingValue, channel, scaleType, mark, paddingInnerValue, scaleConfig) {\n if (paddingValue !== undefined) {\n // If user has already manually specified \"padding\", no need to add default paddingOuter.\n return undefined;\n }\n if (channel in POSITION_SCALE_CHANNEL_INDEX) {\n // Padding is only set for X and Y by default.\n // Basically it doesn't make sense to add padding for color and size.\n if (scaleType === ScaleType.BAND) {\n const { bandPaddingOuter } = scaleConfig;\n return getFirstDefined(bandPaddingOuter, \n /* By default, paddingOuter is paddingInner / 2. The reason is that\n size (width/height) = step * (cardinality - paddingInner + 2 * paddingOuter).\n and we want the width/height to be integer by default.\n Note that step (by default) and cardinality are integers.) */\n isSignalRef(paddingInnerValue) ? { signal: `${paddingInnerValue.signal}/2` } : paddingInnerValue / 2);\n }\n }\n return undefined;\n}\nexport function reverse(scaleType, sort, channel, scaleConfig) {\n if (channel === 'x' && scaleConfig.xReverse !== undefined) {\n if (hasContinuousDomain(scaleType) && sort === 'descending') {\n if (isSignalRef(scaleConfig.xReverse)) {\n return { signal: `!${scaleConfig.xReverse.signal}` };\n }\n else {\n return !scaleConfig.xReverse;\n }\n }\n return scaleConfig.xReverse;\n }\n if (hasContinuousDomain(scaleType) && sort === 'descending') {\n // For continuous domain scales, Vega does not support domain sort.\n // Thus, we reverse range instead if sort is descending\n return true;\n }\n return undefined;\n}\nexport function zero(channel, fieldDef, specifiedDomain, markDef, scaleType) {\n // If users explicitly provide a domain range, we should not augment zero as that will be unexpected.\n const hasCustomDomain = !!specifiedDomain && specifiedDomain !== 'unaggregated';\n if (hasCustomDomain) {\n if (hasContinuousDomain(scaleType)) {\n if (isArray(specifiedDomain)) {\n const first = specifiedDomain[0];\n const last = specifiedDomain[specifiedDomain.length - 1];\n if (first <= 0 && last >= 0) {\n // if the domain includes zero, make zero remains true\n return true;\n }\n }\n return false;\n }\n }\n // If there is no custom domain, return true only for the following cases:\n // 1) using quantitative field with size\n // While this can be either ratio or interval fields, our assumption is that\n // ratio are more common. However, if the scaleType is discretizing scale, we want to return\n // false so that range doesn't start at zero\n if (channel === 'size' && fieldDef.type === 'quantitative' && !isContinuousToDiscrete(scaleType)) {\n return true;\n }\n // 2) non-binned, quantitative x-scale or y-scale\n // (For binning, we should not include zero by default because binning are calculated without zero.)\n if (!(isFieldDef(fieldDef) && fieldDef.bin) &&\n util.contains([...POSITION_SCALE_CHANNELS, ...POLAR_POSITION_SCALE_CHANNELS], channel)) {\n const { orient, type } = markDef;\n if (contains(['bar', 'area', 'line', 'trail'], type)) {\n if ((orient === 'horizontal' && channel === 'y') || (orient === 'vertical' && channel === 'x')) {\n return false;\n }\n }\n return true;\n }\n return false;\n}\n//# sourceMappingURL=properties.js.map","import { SCALE_CHANNELS, SHAPE } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { GEOSHAPE } from '../../mark';\nimport { NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES, scaleCompatible, scaleTypePrecedence } from '../../scale';\nimport { GEOJSON } from '../../type';\nimport { keys } from '../../util';\nimport { isUnitModel } from '../model';\nimport { defaultScaleResolve } from '../resolve';\nimport { mergeValuesWithExplicit, tieBreakByComparing } from '../split';\nimport { ScaleComponent } from './component';\nimport { parseScaleDomain } from './domain';\nimport { parseScaleProperty, parseScaleRange } from './properties';\nimport { scaleType } from './type';\nexport function parseScales(model, { ignoreRange } = {}) {\n parseScaleCore(model);\n parseScaleDomain(model);\n for (const prop of NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES) {\n parseScaleProperty(model, prop);\n }\n if (!ignoreRange) {\n // range depends on zero\n parseScaleRange(model);\n }\n}\nexport function parseScaleCore(model) {\n if (isUnitModel(model)) {\n model.component.scales = parseUnitScaleCore(model);\n }\n else {\n model.component.scales = parseNonUnitScaleCore(model);\n }\n}\n/**\n * Parse scales for all channels of a model.\n */\nfunction parseUnitScaleCore(model) {\n const { encoding, mark } = model;\n return SCALE_CHANNELS.reduce((scaleComponents, channel) => {\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]); // must be typed def to have scale\n // Don't generate scale for shape of geoshape\n if (fieldOrDatumDef && mark === GEOSHAPE && channel === SHAPE && fieldOrDatumDef.type === GEOJSON) {\n return scaleComponents;\n }\n let specifiedScale = fieldOrDatumDef && fieldOrDatumDef['scale'];\n if (fieldOrDatumDef && specifiedScale !== null && specifiedScale !== false) {\n specifiedScale = specifiedScale !== null && specifiedScale !== void 0 ? specifiedScale : {};\n const sType = scaleType(specifiedScale, channel, fieldOrDatumDef, mark);\n scaleComponents[channel] = new ScaleComponent(model.scaleName(channel + '', true), {\n value: sType,\n explicit: specifiedScale.type === sType\n });\n }\n return scaleComponents;\n }, {});\n}\nconst scaleTypeTieBreaker = tieBreakByComparing((st1, st2) => scaleTypePrecedence(st1) - scaleTypePrecedence(st2));\nfunction parseNonUnitScaleCore(model) {\n var _a;\n const scaleComponents = (model.component.scales = {});\n const scaleTypeWithExplicitIndex = {};\n const resolve = model.component.resolve;\n // Parse each child scale and determine if a particular channel can be merged.\n for (const child of model.children) {\n parseScaleCore(child);\n // Instead of always merging right away -- check if it is compatible to merge first!\n for (const channel of keys(child.component.scales)) {\n // if resolve is undefined, set default first\n resolve.scale[channel] = (_a = resolve.scale[channel]) !== null && _a !== void 0 ? _a : defaultScaleResolve(channel, model);\n if (resolve.scale[channel] === 'shared') {\n const explicitScaleType = scaleTypeWithExplicitIndex[channel];\n const childScaleType = child.component.scales[channel].getWithExplicit('type');\n if (explicitScaleType) {\n if (scaleCompatible(explicitScaleType.value, childScaleType.value)) {\n // merge scale component if type are compatible\n scaleTypeWithExplicitIndex[channel] = mergeValuesWithExplicit(explicitScaleType, childScaleType, 'type', 'scale', scaleTypeTieBreaker);\n }\n else {\n // Otherwise, update conflicting channel to be independent\n resolve.scale[channel] = 'independent';\n // Remove from the index so they don't get merged\n delete scaleTypeWithExplicitIndex[channel];\n }\n }\n else {\n scaleTypeWithExplicitIndex[channel] = childScaleType;\n }\n }\n }\n }\n // Merge each channel listed in the index\n for (const channel of keys(scaleTypeWithExplicitIndex)) {\n // Create new merged scale component\n const name = model.scaleName(channel, true);\n const typeWithExplicit = scaleTypeWithExplicitIndex[channel];\n scaleComponents[channel] = new ScaleComponent(name, typeWithExplicit);\n // rename each child and mark them as merged\n for (const child of model.children) {\n const childScale = child.component.scales[channel];\n if (childScale) {\n child.renameScale(childScale.get('name'), name);\n childScale.merged = true;\n }\n }\n }\n return scaleComponents;\n}\n//# sourceMappingURL=parse.js.map","import { isBinning } from '../../bin';\nimport { isColorChannel, isScaleChannel, rangeType } from '../../channel';\nimport { isFieldDef, isPositionFieldOrDatumDef } from '../../channeldef';\nimport * as log from '../../log';\nimport { channelSupportScaleType, scaleTypeSupportDataType } from '../../scale';\nimport { normalizeTimeUnit } from '../../timeunit';\nimport * as util from '../../util';\nimport { POLAR_POSITION_SCALE_CHANNEL_INDEX, POSITION_SCALE_CHANNEL_INDEX } from './../../channel';\n/**\n * Determine if there is a specified scale type and if it is appropriate,\n * or determine default type if type is unspecified or inappropriate.\n */\n// NOTE: CompassQL uses this method.\nexport function scaleType(specifiedScale, channel, fieldDef, mark) {\n const defaultScaleType = defaultType(channel, fieldDef, mark);\n const { type } = specifiedScale;\n if (!isScaleChannel(channel)) {\n // There is no scale for these channels\n return null;\n }\n if (type !== undefined) {\n // Check if explicitly specified scale type is supported by the channel\n if (!channelSupportScaleType(channel, type)) {\n log.warn(log.message.scaleTypeNotWorkWithChannel(channel, type, defaultScaleType));\n return defaultScaleType;\n }\n // Check if explicitly specified scale type is supported by the data type\n if (isFieldDef(fieldDef) && !scaleTypeSupportDataType(type, fieldDef.type)) {\n log.warn(log.message.scaleTypeNotWorkWithFieldDef(type, defaultScaleType));\n return defaultScaleType;\n }\n return type;\n }\n return defaultScaleType;\n}\n/**\n * Determine appropriate default scale type.\n */\n// NOTE: Voyager uses this method.\nfunction defaultType(channel, fieldDef, mark) {\n var _a;\n switch (fieldDef.type) {\n case 'nominal':\n case 'ordinal':\n if (isColorChannel(channel) || rangeType(channel) === 'discrete') {\n if (channel === 'shape' && fieldDef.type === 'ordinal') {\n log.warn(log.message.discreteChannelCannotEncode(channel, 'ordinal'));\n }\n return 'ordinal';\n }\n if (channel in POSITION_SCALE_CHANNEL_INDEX) {\n if (util.contains(['rect', 'bar', 'image', 'rule'], mark)) {\n // The rect/bar mark should fit into a band.\n // For rule, using band scale to make rule align with axis ticks better https://github.com/vega/vega-lite/issues/3429\n return 'band';\n }\n }\n else if (mark === 'arc' && channel in POLAR_POSITION_SCALE_CHANNEL_INDEX) {\n return 'band';\n }\n if (fieldDef.band !== undefined || (isPositionFieldOrDatumDef(fieldDef) && ((_a = fieldDef.axis) === null || _a === void 0 ? void 0 : _a.tickBand))) {\n return 'band';\n }\n // Otherwise, use ordinal point scale so we can easily get center positions of the marks.\n return 'point';\n case 'temporal':\n if (isColorChannel(channel)) {\n return 'time';\n }\n else if (rangeType(channel) === 'discrete') {\n log.warn(log.message.discreteChannelCannotEncode(channel, 'temporal'));\n // TODO: consider using quantize (equivalent to binning) once we have it\n return 'ordinal';\n }\n else if (isFieldDef(fieldDef) && fieldDef.timeUnit && normalizeTimeUnit(fieldDef.timeUnit).utc) {\n return 'utc';\n }\n return 'time';\n case 'quantitative':\n if (isColorChannel(channel)) {\n if (isFieldDef(fieldDef) && isBinning(fieldDef.bin)) {\n return 'bin-ordinal';\n }\n return 'linear';\n }\n else if (rangeType(channel) === 'discrete') {\n log.warn(log.message.discreteChannelCannotEncode(channel, 'quantitative'));\n // TODO: consider using quantize (equivalent to binning) once we have it\n return 'ordinal';\n }\n return 'linear';\n case 'geojson':\n return undefined;\n }\n /* istanbul ignore next: should never reach this */\n throw new Error(log.message.invalidFieldType(fieldDef.type));\n}\n//# sourceMappingURL=type.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { FACET_CHANNELS, getPositionScaleChannel, isChannel, isScaleChannel } from '../channel';\nimport { getFieldDef, vgField } from '../channeldef';\nimport { DataSourceType } from '../data';\nimport { forEach, reduce } from '../encoding';\nimport { replaceExprRefInIndex } from '../expr';\nimport * as log from '../log';\nimport { hasDiscreteDomain } from '../scale';\nimport { isFacetSpec } from '../spec';\nimport { extractCompositionLayout } from '../spec/base';\nimport { extractTitleConfig, isText } from '../title';\nimport { normalizeTransform } from '../transform';\nimport { contains, duplicate, isEmpty, keys, varName } from '../util';\nimport { isVgRangeStep } from '../vega.schema';\nimport { assembleAxes } from './axis/assemble';\nimport { signalOrValueRef, signalRefOrValue } from './common';\nimport { assembleHeaderGroups, assembleLayoutTitleBand, assembleTitleGroup } from './header/assemble';\nimport { HEADER_CHANNELS } from './header/component';\nimport { sizeExpr } from './layoutsize/assemble';\nimport { getSizeTypeFromLayoutSizeType } from './layoutsize/component';\nimport { assembleLegends } from './legend/assemble';\nimport { parseLegend } from './legend/parse';\nimport { assembleProjections } from './projection/assemble';\nimport { parseProjection } from './projection/parse';\nimport { assembleScales } from './scale/assemble';\nimport { assembleDomain, getFieldFromDomain } from './scale/domain';\nimport { parseScales } from './scale/parse';\nimport { Split } from './split';\nexport class NameMap {\n constructor() {\n this.nameMap = {};\n }\n rename(oldName, newName) {\n this.nameMap[oldName] = newName;\n }\n has(name) {\n return this.nameMap[name] !== undefined;\n }\n get(name) {\n // If the name appears in the _nameMap, we need to read its new name.\n // We have to loop over the dict just in case the new name also gets renamed.\n while (this.nameMap[name] && name !== this.nameMap[name]) {\n name = this.nameMap[name];\n }\n return name;\n }\n}\n/*\n We use type guards instead of `instanceof` as `instanceof` makes\n different parts of the compiler depend on the actual implementation of\n the model classes, which in turn depend on different parts of the compiler.\n Thus, `instanceof` leads to circular dependency problems.\n\n On the other hand, type guards only make different parts of the compiler\n depend on the type of the model classes, but not the actual implementation.\n*/\nexport function isUnitModel(model) {\n return (model === null || model === void 0 ? void 0 : model.type) === 'unit';\n}\nexport function isFacetModel(model) {\n return (model === null || model === void 0 ? void 0 : model.type) === 'facet';\n}\nexport function isConcatModel(model) {\n return (model === null || model === void 0 ? void 0 : model.type) === 'concat';\n}\nexport function isLayerModel(model) {\n return (model === null || model === void 0 ? void 0 : model.type) === 'layer';\n}\nexport class Model {\n constructor(spec, type, parent, parentGivenName, config, resolve, view) {\n var _a, _b;\n this.type = type;\n this.parent = parent;\n this.config = config;\n this.children = [];\n /**\n * Corrects the data references in marks after assemble.\n */\n this.correctDataNames = (mark) => {\n // TODO: make this correct\n // for normal data references\n if (mark.from && mark.from.data) {\n mark.from.data = this.lookupDataSource(mark.from.data);\n }\n // for access to facet data\n if (mark.from && mark.from.facet && mark.from.facet.data) {\n mark.from.facet.data = this.lookupDataSource(mark.from.facet.data);\n }\n return mark;\n };\n this.parent = parent;\n this.config = config;\n this.view = replaceExprRefInIndex(view);\n // If name is not provided, always use parent's givenName to avoid name conflicts.\n this.name = (_a = spec.name) !== null && _a !== void 0 ? _a : parentGivenName;\n this.title = isText(spec.title) ? { text: spec.title } : spec.title ? this.initTitle(spec.title) : undefined;\n // Shared name maps\n this.scaleNameMap = parent ? parent.scaleNameMap : new NameMap();\n this.projectionNameMap = parent ? parent.projectionNameMap : new NameMap();\n this.signalNameMap = parent ? parent.signalNameMap : new NameMap();\n this.data = spec.data;\n this.description = spec.description;\n this.transforms = normalizeTransform((_b = spec.transform) !== null && _b !== void 0 ? _b : []);\n this.layout = type === 'layer' || type === 'unit' ? {} : extractCompositionLayout(spec, type, config);\n this.component = {\n data: {\n sources: parent ? parent.component.data.sources : [],\n outputNodes: parent ? parent.component.data.outputNodes : {},\n outputNodeRefCounts: parent ? parent.component.data.outputNodeRefCounts : {},\n // data is faceted if the spec is a facet spec or the parent has faceted data and data is undefined\n isFaceted: isFacetSpec(spec) || (parent && parent.component.data.isFaceted && spec.data === undefined)\n },\n layoutSize: new Split(),\n layoutHeaders: { row: {}, column: {}, facet: {} },\n mark: null,\n resolve: Object.assign({ scale: {}, axis: {}, legend: {} }, (resolve ? duplicate(resolve) : {})),\n selection: null,\n scales: null,\n projection: null,\n axes: {},\n legends: {}\n };\n }\n initTitle(title) {\n const props = keys(title);\n const titleInternal = {\n text: signalRefOrValue(title.text)\n };\n for (const prop of props) {\n titleInternal[prop] = signalRefOrValue(title[prop]);\n }\n return titleInternal;\n }\n get width() {\n return this.getSizeSignalRef('width');\n }\n get height() {\n return this.getSizeSignalRef('height');\n }\n parse() {\n this.parseScale();\n this.parseLayoutSize(); // depends on scale\n this.renameTopLevelLayoutSizeSignal();\n this.parseSelections();\n this.parseProjection();\n this.parseData(); // (pathorder) depends on markDef; selection filters depend on parsed selections; depends on projection because some transforms require the finalized projection name.\n this.parseAxesAndHeaders(); // depends on scale and layout size\n this.parseLegends(); // depends on scale, markDef\n this.parseMarkGroup(); // depends on data name, scale, layout size, axisGroup, and children's scale, axis, legend and mark.\n }\n parseScale() {\n parseScales(this);\n }\n parseProjection() {\n parseProjection(this);\n }\n /**\n * Rename top-level spec's size to be just width / height, ignoring model name.\n * This essentially merges the top-level spec's width/height signals with the width/height signals\n * to help us reduce redundant signals declaration.\n */\n renameTopLevelLayoutSizeSignal() {\n if (this.getName('width') !== 'width') {\n this.renameSignal(this.getName('width'), 'width');\n }\n if (this.getName('height') !== 'height') {\n this.renameSignal(this.getName('height'), 'height');\n }\n }\n parseLegends() {\n parseLegend(this);\n }\n assembleGroupStyle() {\n var _a, _b;\n if (this.type === 'unit' || this.type === 'layer') {\n return (_b = (_a = this.view) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : 'cell';\n }\n return undefined;\n }\n assembleEncodeFromView(view) {\n // Exclude \"style\"\n const { style: _ } = view, baseView = __rest(view, [\"style\"]);\n const e = {};\n for (const property of keys(baseView)) {\n const value = baseView[property];\n if (value !== undefined) {\n e[property] = signalOrValueRef(value);\n }\n }\n return e;\n }\n assembleGroupEncodeEntry(isTopLevel) {\n let encodeEntry = {};\n if (this.view) {\n encodeEntry = this.assembleEncodeFromView(this.view);\n }\n if (!isTopLevel) {\n // Descriptions are already added to the top-level description so we only need to add them to the inner views.\n if (this.description) {\n encodeEntry['description'] = signalOrValueRef(this.description);\n }\n // For top-level spec, we can set the global width and height signal to adjust the group size.\n // For other child specs, we have to manually set width and height in the encode entry.\n if (this.type === 'unit' || this.type === 'layer') {\n return Object.assign({ width: this.getSizeSignalRef('width'), height: this.getSizeSignalRef('height') }, (encodeEntry !== null && encodeEntry !== void 0 ? encodeEntry : {}));\n }\n }\n return isEmpty(encodeEntry) ? undefined : encodeEntry;\n }\n assembleLayout() {\n if (!this.layout) {\n return undefined;\n }\n const _a = this.layout, { spacing } = _a, layout = __rest(_a, [\"spacing\"]);\n const { component, config } = this;\n const titleBand = assembleLayoutTitleBand(component.layoutHeaders, config);\n return Object.assign(Object.assign(Object.assign({ padding: spacing }, this.assembleDefaultLayout()), layout), (titleBand ? { titleBand } : {}));\n }\n assembleDefaultLayout() {\n return {};\n }\n assembleHeaderMarks() {\n const { layoutHeaders } = this.component;\n let headerMarks = [];\n for (const channel of FACET_CHANNELS) {\n if (layoutHeaders[channel].title) {\n headerMarks.push(assembleTitleGroup(this, channel));\n }\n }\n for (const channel of HEADER_CHANNELS) {\n headerMarks = headerMarks.concat(assembleHeaderGroups(this, channel));\n }\n return headerMarks;\n }\n assembleAxes() {\n return assembleAxes(this.component.axes, this.config);\n }\n assembleLegends() {\n return assembleLegends(this);\n }\n assembleProjections() {\n return assembleProjections(this);\n }\n assembleTitle() {\n var _a, _b, _c;\n const _d = (_a = this.title) !== null && _a !== void 0 ? _a : {}, { encoding } = _d, titleNoEncoding = __rest(_d, [\"encoding\"]);\n const title = Object.assign(Object.assign(Object.assign({}, extractTitleConfig(this.config.title).nonMark), titleNoEncoding), (encoding ? { encode: { update: encoding } } : {}));\n if (title.text) {\n if (contains(['unit', 'layer'], this.type)) {\n // Unit/Layer\n if (contains(['middle', undefined], title.anchor)) {\n title.frame = (_b = title.frame) !== null && _b !== void 0 ? _b : 'group';\n }\n }\n else {\n // composition with Vega layout\n // Set title = \"start\" by default for composition as \"middle\" does not look nice\n // https://github.com/vega/vega/issues/960#issuecomment-471360328\n title.anchor = (_c = title.anchor) !== null && _c !== void 0 ? _c : 'start';\n }\n return isEmpty(title) ? undefined : title;\n }\n return undefined;\n }\n /**\n * Assemble the mark group for this model. We accept optional `signals` so that we can include concat top-level signals with the top-level model's local signals.\n */\n assembleGroup(signals = []) {\n const group = {};\n signals = signals.concat(this.assembleSignals());\n if (signals.length > 0) {\n group.signals = signals;\n }\n const layout = this.assembleLayout();\n if (layout) {\n group.layout = layout;\n }\n group.marks = [].concat(this.assembleHeaderMarks(), this.assembleMarks());\n // Only include scales if this spec is top-level or if parent is facet.\n // (Otherwise, it will be merged with upper-level's scope.)\n const scales = !this.parent || isFacetModel(this.parent) ? assembleScales(this) : [];\n if (scales.length > 0) {\n group.scales = scales;\n }\n const axes = this.assembleAxes();\n if (axes.length > 0) {\n group.axes = axes;\n }\n const legends = this.assembleLegends();\n if (legends.length > 0) {\n group.legends = legends;\n }\n return group;\n }\n getName(text) {\n return varName((this.name ? this.name + '_' : '') + text);\n }\n getDataName(type) {\n return this.getName(DataSourceType[type].toLowerCase());\n }\n /**\n * Request a data source name for the given data source type and mark that data source as required.\n * This method should be called in parse, so that all used data source can be correctly instantiated in assembleData().\n * You can lookup the correct dataset name in assemble with `lookupDataSource`.\n */\n requestDataName(name) {\n const fullName = this.getDataName(name);\n // Increase ref count. This is critical because otherwise we won't create a data source.\n // We also increase the ref counts on OutputNode.getSource() calls.\n const refCounts = this.component.data.outputNodeRefCounts;\n refCounts[fullName] = (refCounts[fullName] || 0) + 1;\n return fullName;\n }\n getSizeSignalRef(layoutSizeType) {\n if (isFacetModel(this.parent)) {\n const sizeType = getSizeTypeFromLayoutSizeType(layoutSizeType);\n const channel = getPositionScaleChannel(sizeType);\n const scaleComponent = this.component.scales[channel];\n if (scaleComponent && !scaleComponent.merged) {\n // independent scale\n const type = scaleComponent.get('type');\n const range = scaleComponent.get('range');\n if (hasDiscreteDomain(type) && isVgRangeStep(range)) {\n const scaleName = scaleComponent.get('name');\n const domain = assembleDomain(this, channel);\n const field = getFieldFromDomain(domain);\n if (field) {\n const fieldRef = vgField({ aggregate: 'distinct', field }, { expr: 'datum' });\n return {\n signal: sizeExpr(scaleName, scaleComponent, fieldRef)\n };\n }\n else {\n log.warn(log.message.unknownField(channel));\n return null;\n }\n }\n }\n }\n return {\n signal: this.signalNameMap.get(this.getName(layoutSizeType))\n };\n }\n /**\n * Lookup the name of the datasource for an output node. You probably want to call this in assemble.\n */\n lookupDataSource(name) {\n const node = this.component.data.outputNodes[name];\n if (!node) {\n // Name not found in map so let's just return what we got.\n // This can happen if we already have the correct name.\n return name;\n }\n return node.getSource();\n }\n getSignalName(oldSignalName) {\n return this.signalNameMap.get(oldSignalName);\n }\n renameSignal(oldName, newName) {\n this.signalNameMap.rename(oldName, newName);\n }\n renameScale(oldName, newName) {\n this.scaleNameMap.rename(oldName, newName);\n }\n renameProjection(oldName, newName) {\n this.projectionNameMap.rename(oldName, newName);\n }\n /**\n * @return scale name for a given channel after the scale has been parsed and named.\n */\n scaleName(originalScaleName, parse) {\n if (parse) {\n // During the parse phase always return a value\n // No need to refer to rename map because a scale can't be renamed\n // before it has the original name.\n return this.getName(originalScaleName);\n }\n // If there is a scale for the channel, it should either\n // be in the scale component or exist in the name map\n if (\n // If there is a scale for the channel, there should be a local scale component for it\n (isChannel(originalScaleName) && isScaleChannel(originalScaleName) && this.component.scales[originalScaleName]) ||\n // in the scale name map (the scale get merged by its parent)\n this.scaleNameMap.has(this.getName(originalScaleName))) {\n return this.scaleNameMap.get(this.getName(originalScaleName));\n }\n return undefined;\n }\n /**\n * @return projection name after the projection has been parsed and named.\n */\n projectionName(parse) {\n if (parse) {\n // During the parse phase always return a value\n // No need to refer to rename map because a projection can't be renamed\n // before it has the original name.\n return this.getName('projection');\n }\n if ((this.component.projection && !this.component.projection.merged) ||\n this.projectionNameMap.has(this.getName('projection'))) {\n return this.projectionNameMap.get(this.getName('projection'));\n }\n return undefined;\n }\n /**\n * Traverse a model's hierarchy to get the scale component for a particular channel.\n */\n getScaleComponent(channel) {\n /* istanbul ignore next: This is warning for debugging test */\n if (!this.component.scales) {\n throw new Error('getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().');\n }\n const localScaleComponent = this.component.scales[channel];\n if (localScaleComponent && !localScaleComponent.merged) {\n return localScaleComponent;\n }\n return this.parent ? this.parent.getScaleComponent(channel) : undefined;\n }\n /**\n * Traverse a model's hierarchy to get a particular selection component.\n */\n getSelectionComponent(variableName, origName) {\n let sel = this.component.selection[variableName];\n if (!sel && this.parent) {\n sel = this.parent.getSelectionComponent(variableName, origName);\n }\n if (!sel) {\n throw new Error(log.message.selectionNotFound(origName));\n }\n return sel;\n }\n /**\n * Returns true if the model has a signalRef for an axis orient.\n */\n hasAxisOrientSignalRef() {\n var _a, _b;\n return (((_a = this.component.axes.x) === null || _a === void 0 ? void 0 : _a.some(a => a.hasOrientSignalRef())) || ((_b = this.component.axes.y) === null || _b === void 0 ? void 0 : _b.some(a => a.hasOrientSignalRef())));\n }\n}\n/** Abstract class for UnitModel and FacetModel. Both of which can contain fieldDefs as a part of its own specification. */\nexport class ModelWithField extends Model {\n /** Get \"field\" reference for Vega */\n vgField(channel, opt = {}) {\n const fieldDef = this.fieldDef(channel);\n if (!fieldDef) {\n return undefined;\n }\n return vgField(fieldDef, opt);\n }\n reduceFieldDef(f, init) {\n return reduce(this.getMapping(), (acc, cd, c) => {\n const fieldDef = getFieldDef(cd);\n if (fieldDef) {\n return f(acc, fieldDef, c);\n }\n return acc;\n }, init);\n }\n forEachFieldDef(f, t) {\n forEach(this.getMapping(), (cd, c) => {\n const fieldDef = getFieldDef(cd);\n if (fieldDef) {\n f(fieldDef, c);\n }\n }, t);\n }\n}\n//# sourceMappingURL=model.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for density transform nodes\n */\nexport class DensityTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : 'value', (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : 'density'];\n }\n clone() {\n return new DensityTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.density, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `DensityTransform ${hash(this.transform)}`;\n }\n assemble() {\n const _a = this.transform, { density } = _a, rest = __rest(_a, [\"density\"]);\n const result = Object.assign({ type: 'kde', field: density }, rest);\n return result;\n }\n}\n//# sourceMappingURL=density.js.map","import { isScaleChannel } from '../../channel';\nimport { vgField as fieldRef } from '../../channeldef';\nimport { isPathMark } from '../../mark';\nimport { hasContinuousDomain } from '../../scale';\nimport { hash, keys } from '../../util';\nimport { getMarkPropOrConfig } from '../common';\nimport { DataFlowNode } from './dataflow';\nexport class FilterInvalidNode extends DataFlowNode {\n constructor(parent, filter) {\n super(parent);\n this.filter = filter;\n }\n clone() {\n return new FilterInvalidNode(null, Object.assign({}, this.filter));\n }\n static make(parent, model) {\n const { config, mark, markDef } = model;\n const invalid = getMarkPropOrConfig('invalid', markDef, config);\n if (invalid !== 'filter') {\n return null;\n }\n const filter = model.reduceFieldDef((aggregator, fieldDef, channel) => {\n const scaleComponent = isScaleChannel(channel) && model.getScaleComponent(channel);\n if (scaleComponent) {\n const scaleType = scaleComponent.get('type');\n // While discrete domain scales can handle invalid values, continuous scales can't.\n // Thus, for non-path marks, we have to filter null for scales with continuous domains.\n // (For path marks, we will use \"defined\" property and skip these values instead.)\n if (hasContinuousDomain(scaleType) && fieldDef.aggregate !== 'count' && !isPathMark(mark)) {\n aggregator[fieldDef.field] = fieldDef; // we know that the fieldDef is a typed field def\n }\n }\n return aggregator;\n }, {});\n if (!keys(filter).length) {\n return null;\n }\n return new FilterInvalidNode(parent, filter);\n }\n dependentFields() {\n return new Set(keys(this.filter));\n }\n producedFields() {\n return new Set(); // filter does not produce any new fields\n }\n hash() {\n return `FilterInvalid ${hash(this.filter)}`;\n }\n /**\n * Create the VgTransforms for each of the filtered fields.\n */\n assemble() {\n const filters = keys(this.filter).reduce((vegaFilters, field) => {\n const fieldDef = this.filter[field];\n const ref = fieldRef(fieldDef, { expr: 'datum' });\n if (fieldDef !== null) {\n if (fieldDef.type === 'temporal') {\n vegaFilters.push(`(isDate(${ref}) || (isValid(${ref}) && isFinite(+${ref})))`);\n }\n else if (fieldDef.type === 'quantitative') {\n vegaFilters.push(`isValid(${ref})`);\n vegaFilters.push(`isFinite(+${ref})`);\n }\n else {\n // should never get here\n }\n }\n return vegaFilters;\n }, []);\n return filters.length > 0\n ? {\n type: 'filter',\n expr: filters.join(' && ')\n }\n : null;\n }\n}\n//# sourceMappingURL=filterinvalid.js.map","import { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for flatten transform nodes\n */\nexport class FlattenTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const { flatten, as = [] } = this.transform;\n this.transform.as = flatten.map((f, i) => { var _a; return (_a = as[i]) !== null && _a !== void 0 ? _a : f; });\n }\n clone() {\n return new FlattenTransformNode(this.parent, duplicate(this.transform));\n }\n dependentFields() {\n return new Set(this.transform.flatten);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `FlattenTransform ${hash(this.transform)}`;\n }\n assemble() {\n const { flatten: fields, as } = this.transform;\n const result = {\n type: 'flatten',\n fields,\n as\n };\n return result;\n }\n}\n//# sourceMappingURL=flatten.js.map","import { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for flatten transform nodes\n */\nexport class FoldTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : 'key', (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : 'value'];\n }\n clone() {\n return new FoldTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n return new Set(this.transform.fold);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `FoldTransform ${hash(this.transform)}`;\n }\n assemble() {\n const { fold, as } = this.transform;\n const result = {\n type: 'fold',\n fields: fold,\n as\n };\n return result;\n }\n}\n//# sourceMappingURL=fold.js.map","import { isString } from 'vega-util';\nimport { LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2, SHAPE } from '../../channel';\nimport { getFieldOrDatumDef, isDatumDef, isFieldDef, isValueDef } from '../../channeldef';\nimport { GEOJSON } from '../../type';\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class GeoJSONNode extends DataFlowNode {\n constructor(parent, fields, geojson, signal) {\n super(parent);\n this.fields = fields;\n this.geojson = geojson;\n this.signal = signal;\n }\n clone() {\n return new GeoJSONNode(null, duplicate(this.fields), this.geojson, this.signal);\n }\n static parseAll(parent, model) {\n if (model.component.projection && !model.component.projection.isFit) {\n return parent;\n }\n let geoJsonCounter = 0;\n for (const coordinates of [\n [LONGITUDE, LATITUDE],\n [LONGITUDE2, LATITUDE2]\n ]) {\n const pair = coordinates.map(channel => {\n const def = getFieldOrDatumDef(model.encoding[channel]);\n return isFieldDef(def)\n ? def.field\n : isDatumDef(def)\n ? { expr: `${def.datum}` }\n : isValueDef(def)\n ? { expr: `${def['value']}` }\n : undefined;\n });\n if (pair[0] || pair[1]) {\n parent = new GeoJSONNode(parent, pair, null, model.getName(`geojson_${geoJsonCounter++}`));\n }\n }\n if (model.channelHasField(SHAPE)) {\n const fieldDef = model.typedFieldDef(SHAPE);\n if (fieldDef.type === GEOJSON) {\n parent = new GeoJSONNode(parent, null, fieldDef.field, model.getName(`geojson_${geoJsonCounter++}`));\n }\n }\n return parent;\n }\n dependentFields() {\n var _a;\n const fields = ((_a = this.fields) !== null && _a !== void 0 ? _a : []).filter(isString);\n return new Set([...(this.geojson ? [this.geojson] : []), ...fields]);\n }\n producedFields() {\n return new Set();\n }\n hash() {\n return `GeoJSON ${this.geojson} ${this.signal} ${hash(this.fields)}`;\n }\n assemble() {\n return Object.assign(Object.assign(Object.assign({ type: 'geojson' }, (this.fields ? { fields: this.fields } : {})), (this.geojson ? { geojson: this.geojson } : {})), { signal: this.signal });\n }\n}\n//# sourceMappingURL=geojson.js.map","import { isString } from 'vega-util';\nimport { LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2 } from '../../channel';\nimport { getFieldOrDatumDef, isDatumDef, isFieldDef, isValueDef } from '../../channeldef';\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class GeoPointNode extends DataFlowNode {\n constructor(parent, projection, fields, as) {\n super(parent);\n this.projection = projection;\n this.fields = fields;\n this.as = as;\n }\n clone() {\n return new GeoPointNode(null, this.projection, duplicate(this.fields), duplicate(this.as));\n }\n static parseAll(parent, model) {\n if (!model.projectionName()) {\n return parent;\n }\n for (const coordinates of [\n [LONGITUDE, LATITUDE],\n [LONGITUDE2, LATITUDE2]\n ]) {\n const pair = coordinates.map(channel => {\n const def = getFieldOrDatumDef(model.encoding[channel]);\n return isFieldDef(def)\n ? def.field\n : isDatumDef(def)\n ? { expr: `${def.datum}` }\n : isValueDef(def)\n ? { expr: `${def['value']}` }\n : undefined;\n });\n const suffix = coordinates[0] === LONGITUDE2 ? '2' : '';\n if (pair[0] || pair[1]) {\n parent = new GeoPointNode(parent, model.projectionName(), pair, [\n model.getName('x' + suffix),\n model.getName('y' + suffix)\n ]);\n }\n }\n return parent;\n }\n dependentFields() {\n return new Set(this.fields.filter(isString));\n }\n producedFields() {\n return new Set(this.as);\n }\n hash() {\n return `Geopoint ${this.projection} ${hash(this.fields)} ${hash(this.as)}`;\n }\n assemble() {\n return {\n type: 'geopoint',\n projection: this.projection,\n fields: this.fields,\n as: this.as\n };\n }\n}\n//# sourceMappingURL=geopoint.js.map","import { isFieldDef } from '../../channeldef';\nimport { pathGroupingFields } from '../../encoding';\nimport { isImputeSequence } from '../../transform';\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class ImputeNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new ImputeNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.impute, this.transform.key, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set([this.transform.impute]);\n }\n processSequence(keyvals) {\n const { start = 0, stop, step } = keyvals;\n const result = [start, stop, ...(step ? [step] : [])].join(',');\n return { signal: `sequence(${result})` };\n }\n static makeFromTransform(parent, imputeTransform) {\n return new ImputeNode(parent, imputeTransform);\n }\n static makeFromEncoding(parent, model) {\n const encoding = model.encoding;\n const xDef = encoding.x;\n const yDef = encoding.y;\n if (isFieldDef(xDef) && isFieldDef(yDef)) {\n const imputedChannel = xDef.impute ? xDef : yDef.impute ? yDef : undefined;\n if (imputedChannel === undefined) {\n return undefined;\n }\n const keyChannel = xDef.impute ? yDef : yDef.impute ? xDef : undefined;\n const { method, value, frame, keyvals } = imputedChannel.impute;\n const groupbyFields = pathGroupingFields(model.mark, encoding);\n return new ImputeNode(parent, Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ impute: imputedChannel.field, key: keyChannel.field }, (method ? { method } : {})), (value !== undefined ? { value } : {})), (frame ? { frame } : {})), (keyvals !== undefined ? { keyvals } : {})), (groupbyFields.length ? { groupby: groupbyFields } : {})));\n }\n return null;\n }\n hash() {\n return `Impute ${hash(this.transform)}`;\n }\n assemble() {\n const { impute, key, keyvals, method, groupby, value, frame = [null, null] } = this.transform;\n const imputeTransform = Object.assign(Object.assign(Object.assign(Object.assign({ type: 'impute', field: impute, key }, (keyvals ? { keyvals: isImputeSequence(keyvals) ? this.processSequence(keyvals) : keyvals } : {})), { method: 'value' }), (groupby ? { groupby } : {})), { value: !method || method === 'value' ? value : null });\n if (method && method !== 'value') {\n const deriveNewField = Object.assign({ type: 'window', as: [`imputed_${impute}_value`], ops: [method], fields: [impute], frame, ignorePeers: false }, (groupby ? { groupby } : {}));\n const replaceOriginal = {\n type: 'formula',\n expr: `datum.${impute} === null ? datum.imputed_${impute}_value : datum.${impute}`,\n as: impute\n };\n return [imputeTransform, deriveNewField, replaceOriginal];\n }\n else {\n return [imputeTransform];\n }\n }\n}\n//# sourceMappingURL=impute.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for loess transform nodes\n */\nexport class LoessTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : transform.on, (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : transform.loess];\n }\n clone() {\n return new LoessTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.loess, this.transform.on, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `LoessTransform ${hash(this.transform)}`;\n }\n assemble() {\n const _a = this.transform, { loess, on } = _a, rest = __rest(_a, [\"loess\", \"on\"]);\n const result = Object.assign({ type: 'loess', x: on, y: loess }, rest);\n return result;\n }\n}\n//# sourceMappingURL=loess.js.map","import { array, isString } from 'vega-util';\nimport * as log from '../../log';\nimport { isLookupData, isLookupSelection } from '../../transform';\nimport { duplicate, hash, varName } from '../../util';\nimport { DataFlowNode, OutputNode } from './dataflow';\nimport { findSource } from './parse';\nimport { SourceNode } from './source';\nimport { DataSourceType } from '../../data';\nexport class LookupNode extends DataFlowNode {\n constructor(parent, transform, secondary) {\n super(parent);\n this.transform = transform;\n this.secondary = secondary;\n }\n clone() {\n return new LookupNode(null, duplicate(this.transform), this.secondary);\n }\n static make(parent, model, transform, counter) {\n const sources = model.component.data.sources;\n const { from } = transform;\n let fromOutputNode = null;\n if (isLookupData(from)) {\n let fromSource = findSource(from.data, sources);\n if (!fromSource) {\n fromSource = new SourceNode(from.data);\n sources.push(fromSource);\n }\n const fromOutputName = model.getName(`lookup_${counter}`);\n fromOutputNode = new OutputNode(fromSource, fromOutputName, DataSourceType.Lookup, model.component.data.outputNodeRefCounts);\n model.component.data.outputNodes[fromOutputName] = fromOutputNode;\n }\n else if (isLookupSelection(from)) {\n const selName = from.selection;\n transform = Object.assign({ as: selName }, transform);\n fromOutputNode = model.getSelectionComponent(varName(selName), selName).materialized;\n if (!fromOutputNode) {\n throw new Error(log.message.noSameUnitLookup(selName));\n }\n }\n return new LookupNode(parent, transform, fromOutputNode.getSource());\n }\n dependentFields() {\n return new Set([this.transform.lookup]);\n }\n producedFields() {\n return new Set(this.transform.as ? array(this.transform.as) : this.transform.from.fields);\n }\n hash() {\n return `Lookup ${hash({ transform: this.transform, secondary: this.secondary })}`;\n }\n assemble() {\n let foreign;\n if (this.transform.from.fields) {\n // lookup a few fields and add create a flat output\n foreign = Object.assign({ values: this.transform.from.fields }, (this.transform.as ? { as: array(this.transform.as) } : {}));\n }\n else {\n // lookup full record and nest it\n let asName = this.transform.as;\n if (!isString(asName)) {\n log.warn(log.message.NO_FIELDS_NEEDS_AS);\n asName = '_lookup';\n }\n foreign = {\n as: [asName]\n };\n }\n return Object.assign(Object.assign({ type: 'lookup', from: this.secondary, key: this.transform.from.key, fields: [this.transform.lookup] }, foreign), (this.transform.default ? { default: this.transform.default } : {}));\n }\n}\n//# sourceMappingURL=lookup.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for quantile transform nodes\n */\nexport class QuantileTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : 'prob', (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : 'value'];\n }\n clone() {\n return new QuantileTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.quantile, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `QuantileTransform ${hash(this.transform)}`;\n }\n assemble() {\n const _a = this.transform, { quantile } = _a, rest = __rest(_a, [\"quantile\"]);\n const result = Object.assign({ type: 'quantile', field: quantile }, rest);\n return result;\n }\n}\n//# sourceMappingURL=quantile.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for regression transform nodes\n */\nexport class RegressionTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : transform.on, (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : transform.regression];\n }\n clone() {\n return new RegressionTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.regression, this.transform.on, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `RegressionTransform ${hash(this.transform)}`;\n }\n assemble() {\n const _a = this.transform, { regression, on } = _a, rest = __rest(_a, [\"regression\", \"on\"]);\n const result = Object.assign({ type: 'regression', x: on, y: regression }, rest);\n return result;\n }\n}\n//# sourceMappingURL=regression.js.map","import { duplicate, hash, unique } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for pivot transform nodes.\n */\nexport class PivotTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new PivotTransformNode(null, duplicate(this.transform));\n }\n addDimensions(fields) {\n var _a;\n this.transform.groupby = unique(((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : []).concat(fields), d => d);\n }\n producedFields() {\n return undefined; // return undefined so that potentially everything can depend on the pivot\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.pivot, this.transform.value, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n hash() {\n return `PivotTransform ${hash(this.transform)}`;\n }\n assemble() {\n const { pivot, value, groupby, limit, op } = this.transform;\n return Object.assign(Object.assign(Object.assign({ type: 'pivot', field: pivot, value }, (limit !== undefined ? { limit } : {})), (op !== undefined ? { op } : {})), (groupby !== undefined ? { groupby } : {}));\n }\n}\n//# sourceMappingURL=pivot.js.map","import { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for the sample transform nodes\n */\nexport class SampleTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new SampleTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return new Set();\n }\n hash() {\n return `SampleTransform ${hash(this.transform)}`;\n }\n assemble() {\n return {\n type: 'sample',\n size: this.transform.sample\n };\n }\n}\n//# sourceMappingURL=sample.js.map","import { isUrlData } from '../../data';\nimport { AggregateNode } from './aggregate';\nimport { BinNode } from './bin';\nimport { CalculateNode } from './calculate';\nimport { OutputNode } from './dataflow';\nimport { DensityTransformNode } from './density';\nimport { FacetNode } from './facet';\nimport { FilterNode } from './filter';\nimport { FilterInvalidNode } from './filterinvalid';\nimport { FlattenTransformNode } from './flatten';\nimport { FoldTransformNode } from './fold';\nimport { ParseNode } from './formatparse';\nimport { GeoJSONNode } from './geojson';\nimport { GeoPointNode } from './geopoint';\nimport { GraticuleNode } from './graticule';\nimport { IdentifierNode } from './identifier';\nimport { ImputeNode } from './impute';\nimport { JoinAggregateTransformNode } from './joinaggregate';\nimport { LoessTransformNode } from './loess';\nimport { LookupNode } from './lookup';\nimport { QuantileTransformNode } from './quantile';\nimport { RegressionTransformNode } from './regression';\nimport { PivotTransformNode } from './pivot';\nimport { SampleTransformNode } from './sample';\nimport { SequenceNode } from './sequence';\nimport { SourceNode } from './source';\nimport { StackNode } from './stack';\nimport { TimeUnitNode } from './timeunit';\nimport { WindowTransformNode } from './window';\nfunction makeWalkTree(data) {\n // to name datasources\n let datasetIndex = 0;\n /**\n * Recursively walk down the tree.\n */\n function walkTree(node, dataSource) {\n var _a;\n if (node instanceof SourceNode) {\n // If the source is a named data source or a data source with values, we need\n // to put it in a different data source. Otherwise, Vega may override the data.\n if (!node.isGenerator && !isUrlData(node.data)) {\n data.push(dataSource);\n const newData = {\n name: null,\n source: dataSource.name,\n transform: []\n };\n dataSource = newData;\n }\n }\n if (node instanceof ParseNode) {\n if (node.parent instanceof SourceNode && !dataSource.source) {\n // If node's parent is a root source and the data source does not refer to another data source, use normal format parse\n dataSource.format = Object.assign(Object.assign({}, ((_a = dataSource.format) !== null && _a !== void 0 ? _a : {})), { parse: node.assembleFormatParse() });\n // add calculates for all nested fields\n dataSource.transform.push(...node.assembleTransforms(true));\n }\n else {\n // Otherwise use Vega expression to parse\n dataSource.transform.push(...node.assembleTransforms());\n }\n }\n if (node instanceof FacetNode) {\n if (!dataSource.name) {\n dataSource.name = `data_${datasetIndex++}`;\n }\n if (!dataSource.source || dataSource.transform.length > 0) {\n data.push(dataSource);\n node.data = dataSource.name;\n }\n else {\n node.data = dataSource.source;\n }\n for (const d of node.assemble()) {\n data.push(d);\n }\n // break here because the rest of the tree has to be taken care of by the facet.\n return;\n }\n if (node instanceof GraticuleNode ||\n node instanceof SequenceNode ||\n node instanceof FilterInvalidNode ||\n node instanceof FilterNode ||\n node instanceof CalculateNode ||\n node instanceof GeoPointNode ||\n node instanceof GeoJSONNode ||\n node instanceof AggregateNode ||\n node instanceof LookupNode ||\n node instanceof WindowTransformNode ||\n node instanceof JoinAggregateTransformNode ||\n node instanceof FoldTransformNode ||\n node instanceof FlattenTransformNode ||\n node instanceof DensityTransformNode ||\n node instanceof LoessTransformNode ||\n node instanceof QuantileTransformNode ||\n node instanceof RegressionTransformNode ||\n node instanceof IdentifierNode ||\n node instanceof SampleTransformNode ||\n node instanceof PivotTransformNode) {\n dataSource.transform.push(node.assemble());\n }\n if (node instanceof BinNode ||\n node instanceof TimeUnitNode ||\n node instanceof ImputeNode ||\n node instanceof StackNode) {\n dataSource.transform.push(...node.assemble());\n }\n if (node instanceof OutputNode) {\n if (dataSource.source && dataSource.transform.length === 0) {\n node.setSource(dataSource.source);\n }\n else if (node.parent instanceof OutputNode) {\n // Note that an output node may be required but we still do not assemble a\n // separate data source for it.\n node.setSource(dataSource.name);\n }\n else {\n if (!dataSource.name) {\n dataSource.name = `data_${datasetIndex++}`;\n }\n // Here we set the name of the datasource we generated. From now on\n // other assemblers can use it.\n node.setSource(dataSource.name);\n // if this node has more than one child, we will add a datasource automatically\n if (node.numChildren() === 1) {\n data.push(dataSource);\n const newData = {\n name: null,\n source: dataSource.name,\n transform: []\n };\n dataSource = newData;\n }\n }\n }\n switch (node.numChildren()) {\n case 0:\n // done\n if (node instanceof OutputNode && (!dataSource.source || dataSource.transform.length > 0)) {\n // do not push empty datasources that are simply references\n data.push(dataSource);\n }\n break;\n case 1:\n walkTree(node.children[0], dataSource);\n break;\n default: {\n if (!dataSource.name) {\n dataSource.name = `data_${datasetIndex++}`;\n }\n let source = dataSource.name;\n if (!dataSource.source || dataSource.transform.length > 0) {\n data.push(dataSource);\n }\n else {\n source = dataSource.source;\n }\n for (const child of node.children) {\n const newData = {\n name: null,\n source: source,\n transform: []\n };\n walkTree(child, newData);\n }\n break;\n }\n }\n }\n return walkTree;\n}\n/**\n * Assemble data sources that are derived from faceted data.\n */\nexport function assembleFacetData(root) {\n const data = [];\n const walkTree = makeWalkTree(data);\n for (const child of root.children) {\n walkTree(child, {\n source: root.name,\n name: null,\n transform: []\n });\n }\n return data;\n}\n/**\n * Create Vega data array from a given compiled model and append all of them to the given array\n *\n * @param model\n * @param data array\n * @return modified data array\n */\nexport function assembleRootData(dataComponent, datasets) {\n var _a, _b;\n const data = [];\n // dataComponent.sources.forEach(debug);\n // draw(dataComponent.sources);\n const walkTree = makeWalkTree(data);\n let sourceIndex = 0;\n for (const root of dataComponent.sources) {\n // assign a name if the source does not have a name yet\n if (!root.hasName()) {\n root.dataName = `source_${sourceIndex++}`;\n }\n const newData = root.assemble();\n walkTree(root, newData);\n }\n // remove empty transform arrays for cleaner output\n for (const d of data) {\n if (d.transform.length === 0) {\n delete d.transform;\n }\n }\n // move sources without transforms (the ones that are potentially used in lookups) to the beginning\n let whereTo = 0;\n for (const [i, d] of data.entries()) {\n if (((_a = d.transform) !== null && _a !== void 0 ? _a : []).length === 0 && !d.source) {\n data.splice(whereTo++, 0, data.splice(i, 1)[0]);\n }\n }\n // now fix the from references in lookup transforms\n for (const d of data) {\n for (const t of (_b = d.transform) !== null && _b !== void 0 ? _b : []) {\n if (t.type === 'lookup') {\n t.from = dataComponent.outputNodes[t.from].getSource();\n }\n }\n }\n // inline values for datasets that are in the datastore\n for (const d of data) {\n if (d.name in datasets) {\n d.values = datasets[d.name];\n }\n }\n return data;\n}\n//# sourceMappingURL=assemble.js.map","import { isArray } from 'vega-util';\nimport { FACET_CHANNELS } from '../../channel';\nimport { title as fieldDefTitle } from '../../channeldef';\nimport { contains, getFirstDefined } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { assembleAxis } from '../axis/assemble';\nimport { parseGuideResolve } from '../resolve';\nimport { getHeaderProperty } from './common';\nexport function getHeaderType(orient) {\n if (orient === 'top' || orient === 'left' || isSignalRef(orient)) {\n // we always use header for orient signal since we can't dynamically make header becomes footer\n return 'header';\n }\n return 'footer';\n}\nexport function parseFacetHeaders(model) {\n for (const channel of FACET_CHANNELS) {\n parseFacetHeader(model, channel);\n }\n mergeChildAxis(model, 'x');\n mergeChildAxis(model, 'y');\n}\nfunction parseFacetHeader(model, channel) {\n var _a;\n const { facet, config, child, component } = model;\n if (model.channelHasField(channel)) {\n const fieldDef = facet[channel];\n const titleConfig = getHeaderProperty('title', null, config, channel);\n let title = fieldDefTitle(fieldDef, config, {\n allowDisabling: true,\n includeDefault: titleConfig === undefined || !!titleConfig\n });\n if (child.component.layoutHeaders[channel].title) {\n // TODO: better handle multiline titles\n title = isArray(title) ? title.join(', ') : title;\n // merge title with child to produce \"Title / Subtitle / Sub-subtitle\"\n title += ' / ' + child.component.layoutHeaders[channel].title;\n child.component.layoutHeaders[channel].title = null;\n }\n const labelOrient = getHeaderProperty('labelOrient', fieldDef, config, channel);\n const header = (_a = fieldDef.header) !== null && _a !== void 0 ? _a : {};\n const labels = getFirstDefined(header.labels, config.header.labels, true);\n const headerType = contains(['bottom', 'right'], labelOrient) ? 'footer' : 'header';\n component.layoutHeaders[channel] = {\n title,\n facetFieldDef: fieldDef,\n [headerType]: channel === 'facet' ? [] : [makeHeaderComponent(model, channel, labels)]\n };\n }\n}\nfunction makeHeaderComponent(model, channel, labels) {\n const sizeType = channel === 'row' ? 'height' : 'width';\n return {\n labels,\n sizeSignal: model.child.component.layoutSize.get(sizeType) ? model.child.getSizeSignalRef(sizeType) : undefined,\n axes: []\n };\n}\nfunction mergeChildAxis(model, channel) {\n var _a;\n const { child } = model;\n if (child.component.axes[channel]) {\n const { layoutHeaders, resolve } = model.component;\n resolve.axis[channel] = parseGuideResolve(resolve, channel);\n if (resolve.axis[channel] === 'shared') {\n // For shared axis, move the axes to facet's header or footer\n const headerChannel = channel === 'x' ? 'column' : 'row';\n const layoutHeader = layoutHeaders[headerChannel];\n for (const axisComponent of child.component.axes[channel]) {\n const headerType = getHeaderType(axisComponent.get('orient'));\n layoutHeader[headerType] = (_a = layoutHeader[headerType]) !== null && _a !== void 0 ? _a : [makeHeaderComponent(model, headerChannel, false)];\n // FIXME: assemble shouldn't be called here, but we do it this way so we only extract the main part of the axes\n const mainAxis = assembleAxis(axisComponent, 'main', model.config, { header: true });\n if (mainAxis) {\n // LayoutHeader no longer keep track of property precedence, thus let's combine.\n layoutHeader[headerType][0].axes.push(mainAxis);\n }\n axisComponent.mainExtracted = true;\n }\n }\n else {\n // Otherwise do nothing for independent axes\n }\n }\n}\n//# sourceMappingURL=parse.js.map","import { getPositionScaleChannel, getSizeChannel, POSITION_SCALE_CHANNELS } from '../../channel';\nimport { getViewConfigContinuousSize, getViewConfigDiscreteSize } from '../../config';\nimport { hasDiscreteDomain } from '../../scale';\nimport { isStep } from '../../spec/base';\nimport { isVgRangeStep } from '../../vega.schema';\nimport { mergeValuesWithExplicit } from '../split';\nimport { getSizeTypeFromLayoutSizeType } from './component';\nexport function parseLayerLayoutSize(model) {\n parseChildrenLayoutSize(model);\n parseNonUnitLayoutSizeForChannel(model, 'width');\n parseNonUnitLayoutSizeForChannel(model, 'height');\n}\nexport const parseRepeatLayoutSize = parseConcatLayoutSize;\nexport function parseConcatLayoutSize(model) {\n parseChildrenLayoutSize(model);\n // for columns === 1 (vconcat), we can completely merge width. Otherwise, we can treat merged width as childWidth.\n const widthType = model.layout.columns === 1 ? 'width' : 'childWidth';\n // for columns === undefined (hconcat), we can completely merge height. Otherwise, we can treat merged height as childHeight.\n const heightType = model.layout.columns === undefined ? 'height' : 'childHeight';\n parseNonUnitLayoutSizeForChannel(model, widthType);\n parseNonUnitLayoutSizeForChannel(model, heightType);\n}\nexport function parseChildrenLayoutSize(model) {\n for (const child of model.children) {\n child.parseLayoutSize();\n }\n}\n/**\n * Merge child layout size (width or height).\n */\nfunction parseNonUnitLayoutSizeForChannel(model, layoutSizeType) {\n /*\n * For concat, the parent width or height might not be the same as the children's shared height.\n * For example, hconcat's subviews may share width, but the shared width is not the hconcat view's width.\n *\n * layoutSizeType represents the output of the view (could be childWidth/childHeight/width/height)\n * while the sizeType represents the properties of the child.\n */\n const sizeType = getSizeTypeFromLayoutSizeType(layoutSizeType);\n const channel = getPositionScaleChannel(sizeType);\n const resolve = model.component.resolve;\n const layoutSizeCmpt = model.component.layoutSize;\n let mergedSize;\n // Try to merge layout size\n for (const child of model.children) {\n const childSize = child.component.layoutSize.getWithExplicit(sizeType);\n const scaleResolve = resolve.scale[channel];\n if (scaleResolve === 'independent' && childSize.value === 'step') {\n // Do not merge independent scales with range-step as their size depends\n // on the scale domains, which can be different between scales.\n mergedSize = undefined;\n break;\n }\n if (mergedSize) {\n if (scaleResolve === 'independent' && mergedSize.value !== childSize.value) {\n // For independent scale, only merge if all the sizes are the same.\n // If the values are different, abandon the merge!\n mergedSize = undefined;\n break;\n }\n mergedSize = mergeValuesWithExplicit(mergedSize, childSize, sizeType, '');\n }\n else {\n mergedSize = childSize;\n }\n }\n if (mergedSize) {\n // If merged, rename size and set size of all children.\n for (const child of model.children) {\n model.renameSignal(child.getName(sizeType), model.getName(layoutSizeType));\n child.component.layoutSize.set(sizeType, 'merged', false);\n }\n layoutSizeCmpt.setWithExplicit(layoutSizeType, mergedSize);\n }\n else {\n layoutSizeCmpt.setWithExplicit(layoutSizeType, {\n explicit: false,\n value: undefined\n });\n }\n}\nexport function parseUnitLayoutSize(model) {\n const { size, component } = model;\n for (const channel of POSITION_SCALE_CHANNELS) {\n const sizeType = getSizeChannel(channel);\n if (size[sizeType]) {\n const specifiedSize = size[sizeType];\n component.layoutSize.set(sizeType, isStep(specifiedSize) ? 'step' : specifiedSize, true);\n }\n else {\n const defaultSize = defaultUnitSize(model, sizeType);\n component.layoutSize.set(sizeType, defaultSize, false);\n }\n }\n}\nfunction defaultUnitSize(model, sizeType) {\n const channel = sizeType === 'width' ? 'x' : 'y';\n const config = model.config;\n const scaleComponent = model.getScaleComponent(channel);\n if (scaleComponent) {\n const scaleType = scaleComponent.get('type');\n const range = scaleComponent.get('range');\n if (hasDiscreteDomain(scaleType)) {\n const size = getViewConfigDiscreteSize(config.view, sizeType);\n if (isVgRangeStep(range) || isStep(size)) {\n // For discrete domain with range.step, use dynamic width/height\n return 'step';\n }\n else {\n return size;\n }\n }\n else {\n return getViewConfigContinuousSize(config.view, sizeType);\n }\n }\n else if (model.hasProjection || model.mark === 'arc') {\n // arc should use continuous size by default otherwise the pie is extremely small\n return getViewConfigContinuousSize(config.view, sizeType);\n }\n else {\n const size = getViewConfigDiscreteSize(config.view, sizeType);\n return isStep(size) ? size.step : size;\n }\n}\n//# sourceMappingURL=parse.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray } from 'vega-util';\nimport { isBinning } from '../bin';\nimport { COLUMN, FACET_CHANNELS, POSITION_SCALE_CHANNELS, ROW } from '../channel';\nimport { initFieldDef, vgField } from '../channeldef';\nimport { replaceExprRefInIndex } from '../expr';\nimport * as log from '../log';\nimport { hasDiscreteDomain } from '../scale';\nimport { DEFAULT_SORT_OP, isSortField } from '../sort';\nimport { isFacetMapping } from '../spec/facet';\nimport { contains, keys } from '../util';\nimport { isVgRangeStep } from '../vega.schema';\nimport { buildModel } from './buildmodel';\nimport { assembleFacetData } from './data/assemble';\nimport { sortArrayIndexField } from './data/calculate';\nimport { parseData } from './data/parse';\nimport { assembleLabelTitle } from './header/assemble';\nimport { getHeaderChannel, getHeaderProperty } from './header/common';\nimport { HEADER_CHANNELS, HEADER_TYPES } from './header/component';\nimport { parseFacetHeaders } from './header/parse';\nimport { parseChildrenLayoutSize } from './layoutsize/parse';\nimport { ModelWithField } from './model';\nimport { assembleDomain, getFieldFromDomain } from './scale/domain';\nimport { assembleFacetSignals } from './selection/assemble';\nexport function facetSortFieldName(fieldDef, sort, opt) {\n return vgField(sort, Object.assign({ suffix: `by_${vgField(fieldDef)}` }, (opt !== null && opt !== void 0 ? opt : {})));\n}\nexport class FacetModel extends ModelWithField {\n constructor(spec, parent, parentGivenName, config) {\n super(spec, 'facet', parent, parentGivenName, config, spec.resolve);\n this.child = buildModel(spec.spec, this, this.getName('child'), undefined, config);\n this.children = [this.child];\n this.facet = this.initFacet(spec.facet);\n }\n initFacet(facet) {\n // clone to prevent side effect to the original spec\n if (!isFacetMapping(facet)) {\n return { facet: this.initFacetFieldDef(facet, 'facet') };\n }\n const channels = keys(facet);\n const normalizedFacet = {};\n for (const channel of channels) {\n if (!contains([ROW, COLUMN], channel)) {\n // Drop unsupported channel\n log.warn(log.message.incompatibleChannel(channel, 'facet'));\n break;\n }\n const fieldDef = facet[channel];\n if (fieldDef.field === undefined) {\n log.warn(log.message.emptyFieldDef(fieldDef, channel));\n break;\n }\n normalizedFacet[channel] = this.initFacetFieldDef(fieldDef, channel);\n }\n return normalizedFacet;\n }\n initFacetFieldDef(fieldDef, channel) {\n const { header } = fieldDef, rest = __rest(fieldDef, [\"header\"]);\n // Cast because we call initFieldDef, which assumes general FieldDef.\n // However, FacetFieldDef is a bit more constrained than the general FieldDef\n const facetFieldDef = initFieldDef(rest, channel);\n if (header) {\n facetFieldDef.header = replaceExprRefInIndex(header);\n }\n return facetFieldDef;\n }\n channelHasField(channel) {\n return !!this.facet[channel];\n }\n fieldDef(channel) {\n return this.facet[channel];\n }\n parseData() {\n this.component.data = parseData(this);\n this.child.parseData();\n }\n parseLayoutSize() {\n parseChildrenLayoutSize(this);\n }\n parseSelections() {\n // As a facet has a single child, the selection components are the same.\n // The child maintains its selections to assemble signals, which remain\n // within its unit.\n this.child.parseSelections();\n this.component.selection = this.child.component.selection;\n }\n parseMarkGroup() {\n this.child.parseMarkGroup();\n }\n parseAxesAndHeaders() {\n this.child.parseAxesAndHeaders();\n parseFacetHeaders(this);\n }\n assembleSelectionTopLevelSignals(signals) {\n return this.child.assembleSelectionTopLevelSignals(signals);\n }\n assembleSignals() {\n this.child.assembleSignals();\n return [];\n }\n assembleSelectionData(data) {\n return this.child.assembleSelectionData(data);\n }\n getHeaderLayoutMixins() {\n var _a, _b, _c;\n const layoutMixins = {};\n for (const channel of FACET_CHANNELS) {\n for (const headerType of HEADER_TYPES) {\n const layoutHeaderComponent = this.component.layoutHeaders[channel];\n const headerComponent = layoutHeaderComponent[headerType];\n const { facetFieldDef } = layoutHeaderComponent;\n if (facetFieldDef) {\n const titleOrient = getHeaderProperty('titleOrient', facetFieldDef.header, this.config, channel);\n if (contains(['right', 'bottom'], titleOrient)) {\n const headerChannel = getHeaderChannel(channel, titleOrient);\n layoutMixins.titleAnchor = (_a = layoutMixins.titleAnchor) !== null && _a !== void 0 ? _a : {};\n layoutMixins.titleAnchor[headerChannel] = 'end';\n }\n }\n if (headerComponent === null || headerComponent === void 0 ? void 0 : headerComponent[0]) {\n // set header/footerBand\n const sizeType = channel === 'row' ? 'height' : 'width';\n const bandType = headerType === 'header' ? 'headerBand' : 'footerBand';\n if (channel !== 'facet' && !this.child.component.layoutSize.get(sizeType)) {\n // If facet child does not have size signal, then apply headerBand\n layoutMixins[bandType] = (_b = layoutMixins[bandType]) !== null && _b !== void 0 ? _b : {};\n layoutMixins[bandType][channel] = 0.5;\n }\n if (layoutHeaderComponent.title) {\n layoutMixins.offset = (_c = layoutMixins.offset) !== null && _c !== void 0 ? _c : {};\n layoutMixins.offset[channel === 'row' ? 'rowTitle' : 'columnTitle'] = 10;\n }\n }\n }\n }\n return layoutMixins;\n }\n assembleDefaultLayout() {\n const { column, row } = this.facet;\n const columns = column ? this.columnDistinctSignal() : row ? 1 : undefined;\n let align = 'all';\n // Do not align the cells if the scale corresponding to the direction is indepent.\n // We always align when we facet into both row and column.\n if (!row && this.component.resolve.scale.x === 'independent') {\n align = 'none';\n }\n else if (!column && this.component.resolve.scale.y === 'independent') {\n align = 'none';\n }\n return Object.assign(Object.assign(Object.assign({}, this.getHeaderLayoutMixins()), (columns ? { columns } : {})), { bounds: 'full', align });\n }\n assembleLayoutSignals() {\n // FIXME(https://github.com/vega/vega-lite/issues/1193): this can be incorrect if we have independent scales.\n return this.child.assembleLayoutSignals();\n }\n columnDistinctSignal() {\n if (this.parent && this.parent instanceof FacetModel) {\n // For nested facet, we will add columns to group mark instead\n // See discussion in https://github.com/vega/vega/issues/952\n // and https://github.com/vega/vega-view/releases/tag/v1.2.6\n return undefined;\n }\n else {\n // In facetNode.assemble(), the name is always this.getName('column') + '_layout'.\n const facetLayoutDataName = this.getName('column_domain');\n return { signal: `length(data('${facetLayoutDataName}'))` };\n }\n }\n assembleGroup(signals) {\n if (this.parent && this.parent instanceof FacetModel) {\n // Provide number of columns for layout.\n // See discussion in https://github.com/vega/vega/issues/952\n // and https://github.com/vega/vega-view/releases/tag/v1.2.6\n return Object.assign(Object.assign({}, (this.channelHasField('column')\n ? {\n encode: {\n update: {\n // TODO(https://github.com/vega/vega-lite/issues/2759):\n // Correct the signal for facet of concat of facet_column\n columns: { field: vgField(this.facet.column, { prefix: 'distinct' }) }\n }\n }\n }\n : {})), super.assembleGroup(signals));\n }\n return super.assembleGroup(signals);\n }\n /**\n * Aggregate cardinality for calculating size\n */\n getCardinalityAggregateForChild() {\n const fields = [];\n const ops = [];\n const as = [];\n if (this.child instanceof FacetModel) {\n if (this.child.channelHasField('column')) {\n const field = vgField(this.child.facet.column);\n fields.push(field);\n ops.push('distinct');\n as.push(`distinct_${field}`);\n }\n }\n else {\n for (const channel of POSITION_SCALE_CHANNELS) {\n const childScaleComponent = this.child.component.scales[channel];\n if (childScaleComponent && !childScaleComponent.merged) {\n const type = childScaleComponent.get('type');\n const range = childScaleComponent.get('range');\n if (hasDiscreteDomain(type) && isVgRangeStep(range)) {\n const domain = assembleDomain(this.child, channel);\n const field = getFieldFromDomain(domain);\n if (field) {\n fields.push(field);\n ops.push('distinct');\n as.push(`distinct_${field}`);\n }\n else {\n log.warn(log.message.unknownField(channel));\n }\n }\n }\n }\n }\n return { fields, ops, as };\n }\n assembleFacet() {\n const { name, data } = this.component.data.facetRoot;\n const { row, column } = this.facet;\n const { fields, ops, as } = this.getCardinalityAggregateForChild();\n const groupby = [];\n for (const channel of FACET_CHANNELS) {\n const fieldDef = this.facet[channel];\n if (fieldDef) {\n groupby.push(vgField(fieldDef));\n const { bin, sort } = fieldDef;\n if (isBinning(bin)) {\n groupby.push(vgField(fieldDef, { binSuffix: 'end' }));\n }\n if (isSortField(sort)) {\n const { field, op = DEFAULT_SORT_OP } = sort;\n const outputName = facetSortFieldName(fieldDef, sort);\n if (row && column) {\n // For crossed facet, use pre-calculate field as it requires a different groupby\n // For each calculated field, apply max and assign them to the same name as\n // all values of the same group should be the same anyway.\n fields.push(outputName);\n ops.push('max');\n as.push(outputName);\n }\n else {\n fields.push(field);\n ops.push(op);\n as.push(outputName);\n }\n }\n else if (isArray(sort)) {\n const outputName = sortArrayIndexField(fieldDef, channel);\n fields.push(outputName);\n ops.push('max');\n as.push(outputName);\n }\n }\n }\n const cross = !!row && !!column;\n return Object.assign({ name,\n data,\n groupby }, (cross || fields.length > 0\n ? {\n aggregate: Object.assign(Object.assign({}, (cross ? { cross } : {})), (fields.length ? { fields, ops, as } : {}))\n }\n : {}));\n }\n facetSortFields(channel) {\n const { facet } = this;\n const fieldDef = facet[channel];\n if (fieldDef) {\n if (isSortField(fieldDef.sort)) {\n return [facetSortFieldName(fieldDef, fieldDef.sort, { expr: 'datum' })];\n }\n else if (isArray(fieldDef.sort)) {\n return [sortArrayIndexField(fieldDef, channel, { expr: 'datum' })];\n }\n return [vgField(fieldDef, { expr: 'datum' })];\n }\n return [];\n }\n facetSortOrder(channel) {\n const { facet } = this;\n const fieldDef = facet[channel];\n if (fieldDef) {\n const { sort } = fieldDef;\n const order = (isSortField(sort) ? sort.order : !isArray(sort) && sort) || 'ascending';\n return [order];\n }\n return [];\n }\n assembleLabelTitle() {\n var _a;\n const { facet, config } = this;\n if (facet.facet) {\n // Facet always uses title to display labels\n return assembleLabelTitle(facet.facet, 'facet', config);\n }\n const ORTHOGONAL_ORIENT = {\n row: ['top', 'bottom'],\n column: ['left', 'right']\n };\n for (const channel of HEADER_CHANNELS) {\n if (facet[channel]) {\n const labelOrient = getHeaderProperty('labelOrient', (_a = facet[channel]) === null || _a === void 0 ? void 0 : _a.header, config, channel);\n if (contains(ORTHOGONAL_ORIENT[channel], labelOrient)) {\n // Row/Column with orthogonal labelOrient must use title to display labels\n return assembleLabelTitle(facet[channel], channel, config);\n }\n }\n }\n return undefined;\n }\n assembleMarks() {\n const { child } = this;\n // If we facet by two dimensions, we need to add a cross operator to the aggregation\n // so that we create all groups\n const facetRoot = this.component.data.facetRoot;\n const data = assembleFacetData(facetRoot);\n const encodeEntry = child.assembleGroupEncodeEntry(false);\n const title = this.assembleLabelTitle() || child.assembleTitle();\n const style = child.assembleGroupStyle();\n const markGroup = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ name: this.getName('cell'), type: 'group' }, (title ? { title } : {})), (style ? { style } : {})), { from: {\n facet: this.assembleFacet()\n }, \n // TODO: move this to after data\n sort: {\n field: FACET_CHANNELS.map(c => this.facetSortFields(c)).flat(),\n order: FACET_CHANNELS.map(c => this.facetSortOrder(c)).flat()\n } }), (data.length > 0 ? { data: data } : {})), (encodeEntry ? { encode: { update: encodeEntry } } : {})), child.assembleGroup(assembleFacetSignals(this, [])));\n return [markGroup];\n }\n getMapping() {\n return this.facet;\n }\n}\n//# sourceMappingURL=facet.js.map","import { AncestorParse } from '.';\nimport { isGenerator, isGraticuleGenerator, isInlineData, isNamedData, isSequenceGenerator, isUrlData, DataSourceType } from '../../data';\nimport * as log from '../../log';\nimport { isAggregate, isBin, isCalculate, isDensity, isFilter, isFlatten, isFold, isImpute, isJoinAggregate, isLoess, isLookup, isPivot, isQuantile, isRegression, isSample, isStack, isTimeUnit, isWindow } from '../../transform';\nimport { deepEqual, mergeDeep } from '../../util';\nimport { isFacetModel, isLayerModel, isUnitModel } from '../model';\nimport { requiresSelectionId } from '../selection';\nimport { materializeSelections } from '../selection/parse';\nimport { AggregateNode } from './aggregate';\nimport { BinNode } from './bin';\nimport { CalculateNode } from './calculate';\nimport { OutputNode } from './dataflow';\nimport { DensityTransformNode } from './density';\nimport { FacetNode } from './facet';\nimport { FilterNode } from './filter';\nimport { FilterInvalidNode } from './filterinvalid';\nimport { FlattenTransformNode } from './flatten';\nimport { FoldTransformNode } from './fold';\nimport { getImplicitFromEncoding, getImplicitFromFilterTransform, getImplicitFromSelection, ParseNode } from './formatparse';\nimport { GeoJSONNode } from './geojson';\nimport { GeoPointNode } from './geopoint';\nimport { GraticuleNode } from './graticule';\nimport { IdentifierNode } from './identifier';\nimport { ImputeNode } from './impute';\nimport { JoinAggregateTransformNode } from './joinaggregate';\nimport { makeJoinAggregateFromFacet } from './joinaggregatefacet';\nimport { LoessTransformNode } from './loess';\nimport { LookupNode } from './lookup';\nimport { PivotTransformNode } from './pivot';\nimport { QuantileTransformNode } from './quantile';\nimport { RegressionTransformNode } from './regression';\nimport { SampleTransformNode } from './sample';\nimport { SequenceNode } from './sequence';\nimport { SourceNode } from './source';\nimport { StackNode } from './stack';\nimport { TimeUnitNode } from './timeunit';\nimport { WindowTransformNode } from './window';\nexport function findSource(data, sources) {\n var _a, _b, _c, _d;\n for (const other of sources) {\n const otherData = other.data;\n // if both datasets have a name defined, we cannot merge\n if (data.name && other.hasName() && data.name !== other.dataName) {\n continue;\n }\n const formatMesh = (_a = data['format']) === null || _a === void 0 ? void 0 : _a.mesh;\n const otherFeature = (_b = otherData.format) === null || _b === void 0 ? void 0 : _b.feature;\n // feature and mesh are mutually exclusive\n if (formatMesh && otherFeature) {\n continue;\n }\n // we have to extract the same feature or mesh\n const formatFeature = (_c = data['format']) === null || _c === void 0 ? void 0 : _c.feature;\n if ((formatFeature || otherFeature) && formatFeature !== otherFeature) {\n continue;\n }\n const otherMesh = (_d = otherData.format) === null || _d === void 0 ? void 0 : _d.mesh;\n if ((formatMesh || otherMesh) && formatMesh !== otherMesh) {\n continue;\n }\n if (isInlineData(data) && isInlineData(otherData)) {\n if (deepEqual(data.values, otherData.values)) {\n return other;\n }\n }\n else if (isUrlData(data) && isUrlData(otherData)) {\n if (data.url === otherData.url) {\n return other;\n }\n }\n else if (isNamedData(data)) {\n if (data.name === other.dataName) {\n return other;\n }\n }\n }\n return null;\n}\nfunction parseRoot(model, sources) {\n if (model.data || !model.parent) {\n // if the model defines a data source or is the root, create a source node\n if (model.data === null) {\n // data: null means we should ignore the parent's data so we just create a new data source\n const source = new SourceNode({ values: [] });\n sources.push(source);\n return source;\n }\n const existingSource = findSource(model.data, sources);\n if (existingSource) {\n if (!isGenerator(model.data)) {\n existingSource.data.format = mergeDeep({}, model.data.format, existingSource.data.format);\n }\n // if the new source has a name but the existing one does not, we can set it\n if (!existingSource.hasName() && model.data.name) {\n existingSource.dataName = model.data.name;\n }\n return existingSource;\n }\n else {\n const source = new SourceNode(model.data);\n sources.push(source);\n return source;\n }\n }\n else {\n // If we don't have a source defined (overriding parent's data), use the parent's facet root or main.\n return model.parent.component.data.facetRoot\n ? model.parent.component.data.facetRoot\n : model.parent.component.data.main;\n }\n}\n/**\n * Parses a transform array into a chain of connected dataflow nodes.\n */\nexport function parseTransformArray(head, model, ancestorParse) {\n var _a, _b;\n let lookupCounter = 0;\n for (const t of model.transforms) {\n let derivedType = undefined;\n let transformNode;\n if (isCalculate(t)) {\n transformNode = head = new CalculateNode(head, t);\n derivedType = 'derived';\n }\n else if (isFilter(t)) {\n const implicit = getImplicitFromFilterTransform(t);\n transformNode = head = (_a = ParseNode.makeWithAncestors(head, {}, implicit, ancestorParse)) !== null && _a !== void 0 ? _a : head;\n head = new FilterNode(head, model, t.filter);\n }\n else if (isBin(t)) {\n transformNode = head = BinNode.makeFromTransform(head, t, model);\n derivedType = 'number';\n }\n else if (isTimeUnit(t)) {\n derivedType = 'date';\n const parsedAs = ancestorParse.getWithExplicit(t.field);\n // Create parse node because the input to time unit is always date.\n if (parsedAs.value === undefined) {\n head = new ParseNode(head, { [t.field]: derivedType });\n ancestorParse.set(t.field, derivedType, false);\n }\n transformNode = head = TimeUnitNode.makeFromTransform(head, t);\n }\n else if (isAggregate(t)) {\n transformNode = head = AggregateNode.makeFromTransform(head, t);\n derivedType = 'number';\n if (requiresSelectionId(model)) {\n head = new IdentifierNode(head);\n }\n }\n else if (isLookup(t)) {\n transformNode = head = LookupNode.make(head, model, t, lookupCounter++);\n derivedType = 'derived';\n }\n else if (isWindow(t)) {\n transformNode = head = new WindowTransformNode(head, t);\n derivedType = 'number';\n }\n else if (isJoinAggregate(t)) {\n transformNode = head = new JoinAggregateTransformNode(head, t);\n derivedType = 'number';\n }\n else if (isStack(t)) {\n transformNode = head = StackNode.makeFromTransform(head, t);\n derivedType = 'derived';\n }\n else if (isFold(t)) {\n transformNode = head = new FoldTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isFlatten(t)) {\n transformNode = head = new FlattenTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isPivot(t)) {\n transformNode = head = new PivotTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isSample(t)) {\n head = new SampleTransformNode(head, t);\n }\n else if (isImpute(t)) {\n transformNode = head = ImputeNode.makeFromTransform(head, t);\n derivedType = 'derived';\n }\n else if (isDensity(t)) {\n transformNode = head = new DensityTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isQuantile(t)) {\n transformNode = head = new QuantileTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isRegression(t)) {\n transformNode = head = new RegressionTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isLoess(t)) {\n transformNode = head = new LoessTransformNode(head, t);\n derivedType = 'derived';\n }\n else {\n log.warn(log.message.invalidTransformIgnored(t));\n continue;\n }\n if (transformNode && derivedType !== undefined) {\n for (const field of (_b = transformNode.producedFields()) !== null && _b !== void 0 ? _b : []) {\n ancestorParse.set(field, derivedType, false);\n }\n }\n }\n return head;\n}\n/*\nDescription of the dataflow (http://asciiflow.com/):\n +--------+\n | Source |\n +---+----+\n |\n v\n FormatParse\n (explicit)\n |\n v\n Transforms\n(Filter, Calculate, Binning, TimeUnit, Aggregate, Window, ...)\n |\n v\n FormatParse\n (implicit)\n |\n v\n Binning (in `encoding`)\n |\n v\n Timeunit (in `encoding`)\n |\n v\nFormula From Sort Array\n |\n v\n +--+--+\n | Raw |\n +-----+\n |\n v\n Aggregate (in `encoding`)\n |\n v\n Stack (in `encoding`)\n |\n v\n Invalid Filter\n |\n v\n +----------+\n | Main |\n +----------+\n |\n v\n +-------+\n | Facet |----> \"column\", \"column-layout\", and \"row\"\n +-------+\n |\n v\n ...Child data...\n*/\nexport function parseData(model) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n let head = parseRoot(model, model.component.data.sources);\n const { outputNodes, outputNodeRefCounts } = model.component.data;\n const ancestorParse = model.parent ? model.parent.component.data.ancestorParse.clone() : new AncestorParse();\n const data = model.data;\n if (isGenerator(data)) {\n // insert generator transform\n if (isSequenceGenerator(data)) {\n head = new SequenceNode(head, data.sequence);\n }\n else if (isGraticuleGenerator(data)) {\n head = new GraticuleNode(head, data.graticule);\n }\n // no parsing necessary for generator\n ancestorParse.parseNothing = true;\n }\n else if (((_a = data === null || data === void 0 ? void 0 : data.format) === null || _a === void 0 ? void 0 : _a.parse) === null) {\n // format.parse: null means disable parsing\n ancestorParse.parseNothing = true;\n }\n head = (_b = ParseNode.makeExplicit(head, model, ancestorParse)) !== null && _b !== void 0 ? _b : head;\n // Default discrete selections require an identifer transform to\n // uniquely identify data points. Add this transform at the head of\n // the pipeline such that the identifier field is available for all\n // subsequent datasets. During optimization, we will remove this\n // transform if it proves to be unnecessary. Additional identifier\n // transforms will be necessary when new tuples are constructed\n // (e.g., post-aggregation).\n head = new IdentifierNode(head);\n // HACK: This is equivalent for merging bin extent for union scale.\n // FIXME(https://github.com/vega/vega-lite/issues/2270): Correctly merge extent / bin node for shared bin scale\n const parentIsLayer = model.parent && isLayerModel(model.parent);\n if (isUnitModel(model) || isFacetModel(model)) {\n if (parentIsLayer) {\n head = (_c = BinNode.makeFromEncoding(head, model)) !== null && _c !== void 0 ? _c : head;\n }\n }\n if (model.transforms.length > 0) {\n head = parseTransformArray(head, model, ancestorParse);\n }\n // create parse nodes for fields that need to be parsed (or flattened) implicitly\n const implicitSelection = getImplicitFromSelection(model);\n const implicitEncoding = getImplicitFromEncoding(model);\n head = (_d = ParseNode.makeWithAncestors(head, {}, Object.assign(Object.assign({}, implicitSelection), implicitEncoding), ancestorParse)) !== null && _d !== void 0 ? _d : head;\n if (isUnitModel(model)) {\n head = GeoJSONNode.parseAll(head, model);\n head = GeoPointNode.parseAll(head, model);\n }\n if (isUnitModel(model) || isFacetModel(model)) {\n if (!parentIsLayer) {\n head = (_e = BinNode.makeFromEncoding(head, model)) !== null && _e !== void 0 ? _e : head;\n }\n head = (_f = TimeUnitNode.makeFromEncoding(head, model)) !== null && _f !== void 0 ? _f : head;\n head = CalculateNode.parseAllForSortIndex(head, model);\n }\n // add an output node pre aggregation\n const rawName = model.getDataName(DataSourceType.Raw);\n const raw = new OutputNode(head, rawName, DataSourceType.Raw, outputNodeRefCounts);\n outputNodes[rawName] = raw;\n head = raw;\n if (isUnitModel(model)) {\n const agg = AggregateNode.makeFromEncoding(head, model);\n if (agg) {\n head = agg;\n if (requiresSelectionId(model)) {\n head = new IdentifierNode(head);\n }\n }\n head = (_g = ImputeNode.makeFromEncoding(head, model)) !== null && _g !== void 0 ? _g : head;\n head = (_h = StackNode.makeFromEncoding(head, model)) !== null && _h !== void 0 ? _h : head;\n }\n if (isUnitModel(model)) {\n head = (_j = FilterInvalidNode.make(head, model)) !== null && _j !== void 0 ? _j : head;\n }\n // output node for marks\n const mainName = model.getDataName(DataSourceType.Main);\n const main = new OutputNode(head, mainName, DataSourceType.Main, outputNodeRefCounts);\n outputNodes[mainName] = main;\n head = main;\n if (isUnitModel(model)) {\n materializeSelections(model, main);\n }\n // add facet marker\n let facetRoot = null;\n if (isFacetModel(model)) {\n const facetName = model.getName('facet');\n // Derive new aggregate for facet's sort field\n // augment data source with new fields for crossed facet\n head = (_k = makeJoinAggregateFromFacet(head, model.facet)) !== null && _k !== void 0 ? _k : head;\n facetRoot = new FacetNode(head, model, facetName, main.getSource());\n outputNodes[facetName] = facetRoot;\n }\n return Object.assign(Object.assign({}, model.component.data), { outputNodes,\n outputNodeRefCounts,\n raw,\n main,\n facetRoot,\n ancestorParse });\n}\n//# sourceMappingURL=parse.js.map","import { vgField } from '../../channeldef';\nimport { DEFAULT_SORT_OP, isSortField } from '../../sort';\nimport { facetSortFieldName } from '../facet';\nimport { JoinAggregateTransformNode } from './joinaggregate';\nexport function makeJoinAggregateFromFacet(parent, facet) {\n const { row, column } = facet;\n if (row && column) {\n let newParent = null;\n // only need to make one for crossed facet\n for (const fieldDef of [row, column]) {\n if (isSortField(fieldDef.sort)) {\n const { field, op = DEFAULT_SORT_OP } = fieldDef.sort;\n parent = newParent = new JoinAggregateTransformNode(parent, {\n joinaggregate: [\n {\n op,\n field,\n as: facetSortFieldName(fieldDef, fieldDef.sort, { forAs: true })\n }\n ],\n groupby: [vgField(fieldDef)]\n });\n }\n }\n return newParent;\n }\n return null;\n}\n//# sourceMappingURL=joinaggregatefacet.js.map","import * as log from '../log';\nimport { isHConcatSpec, isVConcatSpec } from '../spec';\nimport { keys } from '../util';\nimport { buildModel } from './buildmodel';\nimport { parseData } from './data/parse';\nimport { assembleLayoutSignals } from './layoutsize/assemble';\nimport { parseConcatLayoutSize } from './layoutsize/parse';\nimport { Model } from './model';\nexport class ConcatModel extends Model {\n constructor(spec, parent, parentGivenName, config) {\n var _a, _b, _c, _d;\n super(spec, 'concat', parent, parentGivenName, config, spec.resolve);\n if (((_b = (_a = spec.resolve) === null || _a === void 0 ? void 0 : _a.axis) === null || _b === void 0 ? void 0 : _b.x) === 'shared' || ((_d = (_c = spec.resolve) === null || _c === void 0 ? void 0 : _c.axis) === null || _d === void 0 ? void 0 : _d.y) === 'shared') {\n log.warn(log.message.CONCAT_CANNOT_SHARE_AXIS);\n }\n this.children = this.getChildren(spec).map((child, i) => {\n return buildModel(child, this, this.getName('concat_' + i), undefined, config);\n });\n }\n parseData() {\n this.component.data = parseData(this);\n for (const child of this.children) {\n child.parseData();\n }\n }\n parseSelections() {\n // Merge selections up the hierarchy so that they may be referenced\n // across unit specs. Persist their definitions within each child\n // to assemble signals which remain within output Vega unit groups.\n this.component.selection = {};\n for (const child of this.children) {\n child.parseSelections();\n for (const key of keys(child.component.selection)) {\n this.component.selection[key] = child.component.selection[key];\n }\n }\n }\n parseMarkGroup() {\n for (const child of this.children) {\n child.parseMarkGroup();\n }\n }\n parseAxesAndHeaders() {\n for (const child of this.children) {\n child.parseAxesAndHeaders();\n }\n // TODO(#2415): support shared axes\n }\n getChildren(spec) {\n if (isVConcatSpec(spec)) {\n return spec.vconcat;\n }\n else if (isHConcatSpec(spec)) {\n return spec.hconcat;\n }\n return spec.concat;\n }\n parseLayoutSize() {\n parseConcatLayoutSize(this);\n }\n parseAxisGroup() {\n return null;\n }\n assembleSelectionTopLevelSignals(signals) {\n return this.children.reduce((sg, child) => child.assembleSelectionTopLevelSignals(sg), signals);\n }\n assembleSignals() {\n this.children.forEach(child => child.assembleSignals());\n return [];\n }\n assembleLayoutSignals() {\n const layoutSignals = assembleLayoutSignals(this);\n for (const child of this.children) {\n layoutSignals.push(...child.assembleLayoutSignals());\n }\n return layoutSignals;\n }\n assembleSelectionData(data) {\n return this.children.reduce((db, child) => child.assembleSelectionData(db), data);\n }\n assembleMarks() {\n // only children have marks\n return this.children.map(child => {\n const title = child.assembleTitle();\n const style = child.assembleGroupStyle();\n const encodeEntry = child.assembleGroupEncodeEntry(false);\n return Object.assign(Object.assign(Object.assign(Object.assign({ type: 'group', name: child.getName('group') }, (title ? { title } : {})), (style ? { style } : {})), (encodeEntry ? { encode: { update: encodeEntry } } : {})), child.assembleGroup());\n });\n }\n assembleDefaultLayout() {\n const columns = this.layout.columns;\n return Object.assign(Object.assign({}, (columns != null ? { columns: columns } : {})), { bounds: 'full', \n // Use align each so it can work with multiple plots with different size\n align: 'each' });\n }\n}\n//# sourceMappingURL=concat.js.map","import { COMMON_AXIS_PROPERTIES_INDEX } from '../../axis';\nimport { duplicate, keys } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { Split } from '../split';\nfunction isFalseOrNull(v) {\n return v === false || v === null;\n}\nconst AXIS_COMPONENT_PROPERTIES_INDEX = Object.assign(Object.assign({ disable: 1, gridScale: 1, scale: 1 }, COMMON_AXIS_PROPERTIES_INDEX), { labelExpr: 1, encode: 1 });\nexport const AXIS_COMPONENT_PROPERTIES = keys(AXIS_COMPONENT_PROPERTIES_INDEX);\nexport class AxisComponent extends Split {\n constructor(explicit = {}, implicit = {}, mainExtracted = false) {\n super();\n this.explicit = explicit;\n this.implicit = implicit;\n this.mainExtracted = mainExtracted;\n }\n clone() {\n return new AxisComponent(duplicate(this.explicit), duplicate(this.implicit), this.mainExtracted);\n }\n hasAxisPart(part) {\n // FIXME(https://github.com/vega/vega-lite/issues/2552) this method can be wrong if users use a Vega theme.\n if (part === 'axis') {\n // always has the axis container part\n return true;\n }\n if (part === 'grid' || part === 'title') {\n return !!this.get(part);\n }\n // Other parts are enabled by default, so they should not be false or null.\n return !isFalseOrNull(this.get(part));\n }\n hasOrientSignalRef() {\n return isSignalRef(this.explicit.orient);\n }\n}\n//# sourceMappingURL=component.js.map","import { AXIS_PARTS, isAxisProperty, isConditionalAxisValue } from '../../axis';\nimport { POSITION_SCALE_CHANNELS } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { getFirstDefined, isEmpty, keys, normalizeAngle } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { mergeTitleComponent } from '../common';\nimport { guideEncodeEntry } from '../guide';\nimport { parseGuideResolve } from '../resolve';\nimport { defaultTieBreaker, mergeValuesWithExplicit } from '../split';\nimport { AxisComponent, AXIS_COMPONENT_PROPERTIES } from './component';\nimport { getAxisConfig, getAxisConfigs } from './config';\nimport * as encode from './encode';\nimport { axisRules, defaultOrient, getFieldDefTitle, getLabelAngle } from './properties';\nexport function parseUnitAxes(model) {\n return POSITION_SCALE_CHANNELS.reduce((axis, channel) => {\n if (model.component.scales[channel]) {\n axis[channel] = [parseAxis(channel, model)];\n }\n return axis;\n }, {});\n}\nconst OPPOSITE_ORIENT = {\n bottom: 'top',\n top: 'bottom',\n left: 'right',\n right: 'left'\n};\nexport function parseLayerAxes(model) {\n var _a;\n const { axes, resolve } = model.component;\n const axisCount = { top: 0, bottom: 0, right: 0, left: 0 };\n for (const child of model.children) {\n child.parseAxesAndHeaders();\n for (const channel of keys(child.component.axes)) {\n resolve.axis[channel] = parseGuideResolve(model.component.resolve, channel);\n if (resolve.axis[channel] === 'shared') {\n // If the resolve says shared (and has not been overridden)\n // We will try to merge and see if there is a conflict\n axes[channel] = mergeAxisComponents(axes[channel], child.component.axes[channel]);\n if (!axes[channel]) {\n // If merge returns nothing, there is a conflict so we cannot make the axis shared.\n // Thus, mark axis as independent and remove the axis component.\n resolve.axis[channel] = 'independent';\n delete axes[channel];\n }\n }\n }\n }\n // Move axes to layer's axis component and merge shared axes\n for (const channel of POSITION_SCALE_CHANNELS) {\n for (const child of model.children) {\n if (!child.component.axes[channel]) {\n // skip if the child does not have a particular axis\n continue;\n }\n if (resolve.axis[channel] === 'independent') {\n // If axes are independent, concat the axisComponent array.\n axes[channel] = ((_a = axes[channel]) !== null && _a !== void 0 ? _a : []).concat(child.component.axes[channel]);\n // Automatically adjust orient\n for (const axisComponent of child.component.axes[channel]) {\n const { value: orient, explicit } = axisComponent.getWithExplicit('orient');\n if (isSignalRef(orient)) {\n continue;\n }\n if (axisCount[orient] > 0 && !explicit) {\n // Change axis orient if the number do not match\n const oppositeOrient = OPPOSITE_ORIENT[orient];\n if (axisCount[orient] > axisCount[oppositeOrient]) {\n axisComponent.set('orient', oppositeOrient, false);\n }\n }\n axisCount[orient]++;\n // TODO(https://github.com/vega/vega-lite/issues/2634): automatically add extra offset?\n }\n }\n // After merging, make sure to remove axes from child\n delete child.component.axes[channel];\n }\n // Suppress grid lines for dual axis charts (https://github.com/vega/vega-lite/issues/4676)\n if (resolve.axis[channel] === 'independent' && axes[channel] && axes[channel].length > 1) {\n for (const axisCmpt of axes[channel]) {\n if (!!axisCmpt.get('grid') && !axisCmpt.explicit.grid) {\n axisCmpt.implicit.grid = false;\n }\n }\n }\n }\n}\nfunction mergeAxisComponents(mergedAxisCmpts, childAxisCmpts) {\n if (mergedAxisCmpts) {\n // FIXME: this is a bit wrong once we support multiple axes\n if (mergedAxisCmpts.length !== childAxisCmpts.length) {\n return undefined; // Cannot merge axis component with different number of axes.\n }\n const length = mergedAxisCmpts.length;\n for (let i = 0; i < length; i++) {\n const merged = mergedAxisCmpts[i];\n const child = childAxisCmpts[i];\n if (!!merged !== !!child) {\n return undefined;\n }\n else if (merged && child) {\n const mergedOrient = merged.getWithExplicit('orient');\n const childOrient = child.getWithExplicit('orient');\n if (mergedOrient.explicit && childOrient.explicit && mergedOrient.value !== childOrient.value) {\n // TODO: throw warning if resolve is explicit (We don't have info about explicit/implicit resolve yet.)\n // Cannot merge due to inconsistent orient\n return undefined;\n }\n else {\n mergedAxisCmpts[i] = mergeAxisComponent(merged, child);\n }\n }\n }\n }\n else {\n // For first one, return a copy of the child\n return childAxisCmpts.map(axisComponent => axisComponent.clone());\n }\n return mergedAxisCmpts;\n}\nfunction mergeAxisComponent(merged, child) {\n for (const prop of AXIS_COMPONENT_PROPERTIES) {\n const mergedValueWithExplicit = mergeValuesWithExplicit(merged.getWithExplicit(prop), child.getWithExplicit(prop), prop, 'axis', \n // Tie breaker function\n (v1, v2) => {\n switch (prop) {\n case 'title':\n return mergeTitleComponent(v1, v2);\n case 'gridScale':\n return {\n explicit: v1.explicit,\n value: getFirstDefined(v1.value, v2.value)\n };\n }\n return defaultTieBreaker(v1, v2, prop, 'axis');\n });\n merged.setWithExplicit(prop, mergedValueWithExplicit);\n }\n return merged;\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isExplicit(value, property, axis, model, channel) {\n if (property === 'disable') {\n return axis !== undefined; // if axis is specified or null/false, then it's enable/disable state is explicit\n }\n axis = axis || {};\n switch (property) {\n case 'titleAngle':\n case 'labelAngle':\n return value === (isSignalRef(axis.labelAngle) ? axis.labelAngle : normalizeAngle(axis.labelAngle));\n case 'values':\n return !!axis.values;\n // specified axis.values is already respected, but may get transformed.\n case 'encode':\n // both VL axis.encoding and axis.labelAngle affect VG axis.encode\n return !!axis.encoding || !!axis.labelAngle;\n case 'title':\n // title can be explicit if fieldDef.title is set\n if (value === getFieldDefTitle(model, channel)) {\n return true;\n }\n }\n // Otherwise, things are explicit if the returned value matches the specified property\n return value === axis[property];\n}\n/**\n * Properties to always include values from config\n */\nconst propsToAlwaysIncludeConfig = new Set([\n 'grid',\n 'translate',\n // the rest are not axis configs in Vega, but are in VL, so we need to set too.\n 'format',\n 'formatType',\n 'orient',\n 'labelExpr',\n 'tickCount',\n 'position',\n 'tickMinStep'\n]);\nfunction parseAxis(channel, model) {\n var _a, _b, _c;\n let axis = model.axis(channel);\n const axisComponent = new AxisComponent();\n const fieldOrDatumDef = getFieldOrDatumDef(model.encoding[channel]);\n const { mark, config } = model;\n const orient = (axis === null || axis === void 0 ? void 0 : axis.orient) || ((_a = config[channel === 'x' ? 'axisX' : 'axisY']) === null || _a === void 0 ? void 0 : _a.orient) || ((_b = config.axis) === null || _b === void 0 ? void 0 : _b.orient) ||\n defaultOrient(channel);\n const scaleType = model.getScaleComponent(channel).get('type');\n const axisConfigs = getAxisConfigs(channel, scaleType, orient, model.config);\n const disable = axis !== undefined ? !axis : getAxisConfig('disable', config.style, axis === null || axis === void 0 ? void 0 : axis.style, axisConfigs).configValue;\n axisComponent.set('disable', disable, axis !== undefined);\n if (disable) {\n return axisComponent;\n }\n axis = axis || {};\n const labelAngle = getLabelAngle(fieldOrDatumDef, axis, channel, config.style, axisConfigs);\n const ruleParams = {\n fieldOrDatumDef,\n axis,\n channel,\n model,\n scaleType,\n orient,\n labelAngle,\n mark,\n config\n };\n // 1.2. Add properties\n for (const property of AXIS_COMPONENT_PROPERTIES) {\n const value = property in axisRules ? axisRules[property](ruleParams) : isAxisProperty(property) ? axis[property] : undefined;\n const hasValue = value !== undefined;\n const explicit = isExplicit(value, property, axis, model, channel);\n if (hasValue && explicit) {\n axisComponent.set(property, value, explicit);\n }\n else {\n const { configValue = undefined, configFrom = undefined } = isAxisProperty(property) && property !== 'values'\n ? getAxisConfig(property, config.style, axis.style, axisConfigs)\n : {};\n const hasConfigValue = configValue !== undefined;\n if (hasValue && !hasConfigValue) {\n // only set property if it is explicitly set or has no config value (otherwise we will accidentally override config)\n axisComponent.set(property, value, explicit);\n }\n else if (\n // Cases need implicit values\n // 1. Axis config that aren't available in Vega\n !(configFrom === 'vgAxisConfig') ||\n // 2. Certain properties are always included (see `propsToAlwaysIncludeConfig`'s declaration for more details)\n (propsToAlwaysIncludeConfig.has(property) && hasConfigValue) ||\n // 3. Conditional axis values and signals\n isConditionalAxisValue(configValue) ||\n isSignalRef(configValue)) {\n // If a config is specified and is conditional, copy conditional value from axis config\n axisComponent.set(property, configValue, false);\n }\n }\n }\n // 2) Add guide encode definition groups\n const axisEncoding = (_c = axis.encoding) !== null && _c !== void 0 ? _c : {};\n const axisEncode = AXIS_PARTS.reduce((e, part) => {\n var _a;\n if (!axisComponent.hasAxisPart(part)) {\n // No need to create encode for a disabled part.\n return e;\n }\n const axisEncodingPart = guideEncodeEntry((_a = axisEncoding[part]) !== null && _a !== void 0 ? _a : {}, model);\n const value = part === 'labels' ? encode.labels(model, channel, axisEncodingPart) : axisEncodingPart;\n if (value !== undefined && !isEmpty(value)) {\n e[part] = { update: value };\n }\n return e;\n }, {});\n // FIXME: By having encode as one property, we won't have fine grained encode merging.\n if (!isEmpty(axisEncode)) {\n axisComponent.set('encode', axisEncode, !!axis.encoding || axis.labelAngle !== undefined);\n }\n return axisComponent;\n}\n//# sourceMappingURL=parse.js.map","import { getSecondaryRangeChannel } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { formatCustomType, isCustomFormatType } from '../format';\nexport function labels(model, channel, specifiedLabelsSpec) {\n var _a;\n const { encoding, config } = model;\n const fieldOrDatumDef = (_a = getFieldOrDatumDef(encoding[channel])) !== null && _a !== void 0 ? _a : getFieldOrDatumDef(encoding[getSecondaryRangeChannel(channel)]);\n const axis = model.axis(channel) || {};\n const { format, formatType } = axis;\n if (isCustomFormatType(formatType)) {\n return Object.assign({ text: formatCustomType({\n fieldOrDatumDef,\n field: 'datum.value',\n format,\n formatType,\n config\n }) }, specifiedLabelsSpec);\n }\n return specifiedLabelsSpec;\n}\n//# sourceMappingURL=encode.js.map","import * as encode from './encode';\nfunction encodeEntry(model, fixedShape) {\n const { config } = model;\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'include',\n orient: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.nonPosition('size', model)), encode.nonPosition('angle', model)), shapeMixins(model, config, fixedShape));\n}\nexport function shapeMixins(model, config, fixedShape) {\n if (fixedShape) {\n return { shape: { value: fixedShape } };\n }\n return encode.nonPosition('shape', model);\n}\nexport const point = {\n vgMark: 'symbol',\n encodeEntry: (model) => {\n return encodeEntry(model);\n }\n};\nexport const circle = {\n vgMark: 'symbol',\n encodeEntry: (model) => {\n return encodeEntry(model, 'circle');\n }\n};\nexport const square = {\n vgMark: 'symbol',\n encodeEntry: (model) => {\n return encodeEntry(model, 'square');\n }\n};\n//# sourceMappingURL=point.js.map","import { isNumber } from 'vega-util';\nimport { getViewConfigDiscreteStep } from '../../config';\nimport { isVgRangeStep } from '../../vega.schema';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../common';\nimport * as encode from './encode';\nexport const tick = {\n vgMark: 'rect',\n encodeEntry: (model) => {\n const { config, markDef } = model;\n const orient = markDef.orient;\n const vgSizeChannel = orient === 'horizontal' ? 'width' : 'height';\n const vgThicknessChannel = orient === 'horizontal' ? 'height' : 'width';\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid', vgChannel: 'xc' })), encode.pointPosition('y', model, { defaultPos: 'mid', vgChannel: 'yc' })), encode.nonPosition('size', model, {\n defaultValue: defaultSize(model),\n vgChannel: vgSizeChannel\n })), { [vgThicknessChannel]: signalOrValueRef(getMarkPropOrConfig('thickness', markDef, config)) });\n }\n};\nfunction defaultSize(model) {\n var _a;\n const { config, markDef } = model;\n const { orient } = markDef;\n const vgSizeChannel = orient === 'horizontal' ? 'width' : 'height';\n const scale = model.getScaleComponent(orient === 'horizontal' ? 'x' : 'y');\n const markPropOrConfig = (_a = getMarkPropOrConfig('size', markDef, config, { vgChannel: vgSizeChannel })) !== null && _a !== void 0 ? _a : config.tick.bandSize;\n if (markPropOrConfig !== undefined) {\n return markPropOrConfig;\n }\n else {\n const scaleRange = scale ? scale.get('range') : undefined;\n if (scaleRange && isVgRangeStep(scaleRange) && isNumber(scaleRange.step)) {\n return (scaleRange.step * 3) / 4;\n }\n const defaultViewStep = getViewConfigDiscreteStep(config.view, vgSizeChannel);\n return (defaultViewStep * 3) / 4;\n }\n}\n//# sourceMappingURL=tick.js.map","import { isArray } from 'vega-util';\nimport { isFieldDef, isValueDef, vgField } from '../../channeldef';\nimport { DataSourceType } from '../../data';\nimport { isAggregate, pathGroupingFields } from '../../encoding';\nimport { AREA, BAR, isPathMark, LINE, TRAIL } from '../../mark';\nimport { isSortByEncoding, isSortField } from '../../sort';\nimport { contains, getFirstDefined, isNullOrFalse, keys, omit, pick } from '../../util';\nimport { VG_CORNERRADIUS_CHANNELS } from '../../vega.schema';\nimport { getMarkConfig, getMarkPropOrConfig, getStyles, signalOrValueRef, sortParams } from '../common';\nimport { arc } from './arc';\nimport { area } from './area';\nimport { bar } from './bar';\nimport { geoshape } from './geoshape';\nimport { image } from './image';\nimport { line, trail } from './line';\nimport { circle, point, square } from './point';\nimport { rect } from './rect';\nimport { rule } from './rule';\nimport { text } from './text';\nimport { tick } from './tick';\nconst markCompiler = {\n arc,\n area,\n bar,\n circle,\n geoshape,\n image,\n line,\n point,\n rect,\n rule,\n square,\n text,\n tick,\n trail\n};\nexport function parseMarkGroups(model) {\n if (contains([LINE, AREA, TRAIL], model.mark)) {\n const details = pathGroupingFields(model.mark, model.encoding);\n if (details.length > 0) {\n return getPathGroups(model, details);\n }\n // otherwise use standard mark groups\n }\n else if (contains([BAR], model.mark)) {\n const hasCornerRadius = VG_CORNERRADIUS_CHANNELS.some(prop => getMarkPropOrConfig(prop, model.markDef, model.config));\n if (model.stack && !model.fieldDef('size') && hasCornerRadius) {\n return getGroupsForStackedBarWithCornerRadius(model);\n }\n }\n return getMarkGroup(model);\n}\nconst FACETED_PATH_PREFIX = 'faceted_path_';\nfunction getPathGroups(model, details) {\n // TODO: for non-stacked plot, map order to zindex. (Maybe rename order for layer to zindex?)\n return [\n {\n name: model.getName('pathgroup'),\n type: 'group',\n from: {\n facet: {\n name: FACETED_PATH_PREFIX + model.requestDataName(DataSourceType.Main),\n data: model.requestDataName(DataSourceType.Main),\n groupby: details\n }\n },\n encode: {\n update: {\n width: { field: { group: 'width' } },\n height: { field: { group: 'height' } }\n }\n },\n // With subfacet for line/area group, need to use faceted data from above.\n marks: getMarkGroup(model, { fromPrefix: FACETED_PATH_PREFIX })\n }\n ];\n}\nconst STACK_GROUP_PREFIX = 'stack_group_';\n/**\n * We need to put stacked bars into groups in order to enable cornerRadius for stacks.\n * If stack is used and the model doesn't have size encoding, we put the mark into groups,\n * and apply cornerRadius properties at the group.\n */\nfunction getGroupsForStackedBarWithCornerRadius(model) {\n // Generate the mark\n const [mark] = getMarkGroup(model, { fromPrefix: STACK_GROUP_PREFIX });\n // Get the scale for the stacked field\n const fieldScale = model.scaleName(model.stack.fieldChannel);\n const stackField = (opt = {}) => model.vgField(model.stack.fieldChannel, opt);\n // Find the min/max of the pixel value on the stacked direction\n const stackFieldGroup = (func, expr) => {\n const vgFieldMinMax = [\n stackField({ prefix: 'min', suffix: 'start', expr }),\n stackField({ prefix: 'max', suffix: 'start', expr }),\n stackField({ prefix: 'min', suffix: 'end', expr }),\n stackField({ prefix: 'max', suffix: 'end', expr })\n ];\n return `${func}(${vgFieldMinMax.map(field => `scale('${fieldScale}',${field})`).join(',')})`;\n };\n let groupUpdate;\n let innerGroupUpdate;\n // Build the encoding for group and an inner group\n if (model.stack.fieldChannel === 'x') {\n // Move cornerRadius, y/yc/y2/height properties to group\n // Group x/x2 should be the min/max of the marks within\n groupUpdate = Object.assign(Object.assign({}, pick(mark.encode.update, ['y', 'yc', 'y2', 'height', ...VG_CORNERRADIUS_CHANNELS])), { x: { signal: stackFieldGroup('min', 'datum') }, x2: { signal: stackFieldGroup('max', 'datum') }, clip: { value: true } });\n // Inner group should revert the x translation, and pass height through\n innerGroupUpdate = {\n x: { field: { group: 'x' }, mult: -1 },\n height: { field: { group: 'height' } }\n };\n // The marks should use the same height as group, without y/yc/y2 properties (because it's already done by group)\n // This is why size encoding is not supported yet\n mark.encode.update = Object.assign(Object.assign({}, omit(mark.encode.update, ['y', 'yc', 'y2'])), { height: { field: { group: 'height' } } });\n }\n else {\n groupUpdate = Object.assign(Object.assign({}, pick(mark.encode.update, ['x', 'xc', 'x2', 'width'])), { y: { signal: stackFieldGroup('min', 'datum') }, y2: { signal: stackFieldGroup('max', 'datum') }, clip: { value: true } });\n innerGroupUpdate = {\n y: { field: { group: 'y' }, mult: -1 },\n width: { field: { group: 'width' } }\n };\n mark.encode.update = Object.assign(Object.assign({}, omit(mark.encode.update, ['x', 'xc', 'x2'])), { width: { field: { group: 'width' } } });\n }\n // Deal with cornerRadius properties\n for (const key of VG_CORNERRADIUS_CHANNELS) {\n const configValue = getMarkConfig(key, model.markDef, model.config);\n // Move from mark to group\n if (mark.encode.update[key]) {\n groupUpdate[key] = mark.encode.update[key];\n delete mark.encode.update[key];\n }\n else if (configValue) {\n groupUpdate[key] = signalOrValueRef(configValue);\n }\n // Overwrite any cornerRadius on mark set by config --- they are already moved to the group\n if (configValue) {\n mark.encode.update[key] = { value: 0 };\n }\n }\n // For bin and time unit, we have to add bin/timeunit -end channels.\n const groupByField = model.fieldDef(model.stack.groupbyChannel);\n const groupby = vgField(groupByField) ? [vgField(groupByField)] : [];\n if ((groupByField === null || groupByField === void 0 ? void 0 : groupByField.bin) || (groupByField === null || groupByField === void 0 ? void 0 : groupByField.timeUnit)) {\n groupby.push(vgField(groupByField, { binSuffix: 'end' }));\n }\n const strokeProperties = [\n 'stroke',\n 'strokeWidth',\n 'strokeJoin',\n 'strokeCap',\n 'strokeDash',\n 'strokeDashOffset',\n 'strokeMiterLimit',\n 'strokeOpacity'\n ];\n // Generate stroke properties for the group\n groupUpdate = strokeProperties.reduce((encode, prop) => {\n if (mark.encode.update[prop]) {\n return Object.assign(Object.assign({}, encode), { [prop]: mark.encode.update[prop] });\n }\n else {\n const configValue = getMarkConfig(prop, model.markDef, model.config);\n if (configValue !== undefined) {\n return Object.assign(Object.assign({}, encode), { [prop]: signalOrValueRef(configValue) });\n }\n else {\n return encode;\n }\n }\n }, groupUpdate);\n // Apply strokeForeground and strokeOffset if stroke is used\n if (groupUpdate.stroke) {\n groupUpdate.strokeForeground = { value: true };\n groupUpdate.strokeOffset = { value: 0 };\n }\n return [\n {\n type: 'group',\n from: {\n facet: {\n data: model.requestDataName(DataSourceType.Main),\n name: STACK_GROUP_PREFIX + model.requestDataName(DataSourceType.Main),\n groupby,\n aggregate: {\n fields: [\n stackField({ suffix: 'start' }),\n stackField({ suffix: 'start' }),\n stackField({ suffix: 'end' }),\n stackField({ suffix: 'end' })\n ],\n ops: ['min', 'max', 'min', 'max']\n }\n }\n },\n encode: {\n update: groupUpdate\n },\n marks: [\n {\n type: 'group',\n encode: { update: innerGroupUpdate },\n marks: [mark]\n }\n ]\n }\n ];\n}\nexport function getSort(model) {\n const { encoding, stack, mark, markDef, config } = model;\n const order = encoding.order;\n if ((!isArray(order) && isValueDef(order) && isNullOrFalse(order.value)) ||\n (!order && isNullOrFalse(getMarkPropOrConfig('order', markDef, config)))) {\n return undefined;\n }\n else if ((isArray(order) || isFieldDef(order)) && !stack) {\n // Sort by the order field if it is specified and the field is not stacked. (For stacked field, order specify stack order.)\n return sortParams(order, { expr: 'datum' });\n }\n else if (isPathMark(mark)) {\n // For both line and area, we sort values based on dimension by default\n const dimensionChannel = markDef.orient === 'horizontal' ? 'y' : 'x';\n const dimensionChannelDef = encoding[dimensionChannel];\n if (isFieldDef(dimensionChannelDef)) {\n const s = dimensionChannelDef.sort;\n if (isArray(s)) {\n return {\n field: vgField(dimensionChannelDef, { prefix: dimensionChannel, suffix: 'sort_index', expr: 'datum' })\n };\n }\n else if (isSortField(s)) {\n return {\n field: vgField({\n // FIXME: this op might not already exist?\n // FIXME: what if dimensionChannel (x or y) contains custom domain?\n aggregate: isAggregate(model.encoding) ? s.op : undefined,\n field: s.field\n }, { expr: 'datum' })\n };\n }\n else if (isSortByEncoding(s)) {\n const fieldDefToSort = model.fieldDef(s.encoding);\n return {\n field: vgField(fieldDefToSort, { expr: 'datum' }),\n order: s.order\n };\n }\n else if (s === null) {\n return undefined;\n }\n else {\n return {\n field: vgField(dimensionChannelDef, {\n // For stack with imputation, we only have bin_mid\n binSuffix: model.stack && model.stack.impute ? 'mid' : undefined,\n expr: 'datum'\n })\n };\n }\n }\n return undefined;\n }\n return undefined;\n}\nfunction getMarkGroup(model, opt = { fromPrefix: '' }) {\n const { mark, markDef, encoding, config } = model;\n const clip = getFirstDefined(markDef.clip, scaleClip(model), projectionClip(model));\n const style = getStyles(markDef);\n const key = encoding.key;\n const sort = getSort(model);\n const interactive = interactiveFlag(model);\n const aria = getMarkPropOrConfig('aria', markDef, config);\n const postEncodingTransform = markCompiler[mark].postEncodingTransform\n ? markCompiler[mark].postEncodingTransform(model)\n : null;\n return [\n Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ name: model.getName('marks'), type: markCompiler[mark].vgMark }, (clip ? { clip: true } : {})), (style ? { style } : {})), (key ? { key: key.field } : {})), (sort ? { sort } : {})), (interactive ? interactive : {})), (aria === false ? { aria } : {})), { from: { data: opt.fromPrefix + model.requestDataName(DataSourceType.Main) }, encode: {\n update: markCompiler[mark].encodeEntry(model)\n } }), (postEncodingTransform\n ? {\n transform: postEncodingTransform\n }\n : {}))\n ];\n}\n/**\n * If scales are bound to interval selections, we want to automatically clip\n * marks to account for panning/zooming interactions. We identify bound scales\n * by the selectionExtent property, which gets added during scale parsing.\n */\nfunction scaleClip(model) {\n const xScale = model.getScaleComponent('x');\n const yScale = model.getScaleComponent('y');\n return (xScale && xScale.get('selectionExtent')) || (yScale && yScale.get('selectionExtent')) ? true : undefined;\n}\n/**\n * If we use a custom projection with auto-fitting to the geodata extent,\n * we need to clip to ensure the chart size doesn't explode.\n */\nfunction projectionClip(model) {\n const projection = model.component.projection;\n return projection && !projection.isFit ? true : undefined;\n}\n/**\n * Only output interactive flags if we have selections defined somewhere in our model hierarchy.\n */\nfunction interactiveFlag(model) {\n if (!model.component.selection)\n return null;\n const unitCount = keys(model.component.selection).length;\n let parentCount = unitCount;\n let parent = model.parent;\n while (parent && parentCount === 0) {\n parentCount = keys(parent.component.selection).length;\n parent = parent.parent;\n }\n return parentCount\n ? {\n interactive: unitCount > 0 || !!model.encoding.tooltip\n }\n : null;\n}\n//# sourceMappingURL=mark.js.map","import * as encode from './encode';\nexport const arc = {\n vgMark: 'arc',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'ignore',\n orient: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.rectPosition(model, 'radius', 'arc')), encode.rectPosition(model, 'theta', 'arc'));\n }\n};\n//# sourceMappingURL=arc.js.map","import * as encode from './encode';\nexport const area = {\n vgMark: 'area',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'include',\n size: 'ignore',\n theta: 'ignore'\n })), encode.pointOrRangePosition('x', model, {\n defaultPos: 'zeroOrMin',\n defaultPos2: 'zeroOrMin',\n range: model.markDef.orient === 'horizontal'\n })), encode.pointOrRangePosition('y', model, {\n defaultPos: 'zeroOrMin',\n defaultPos2: 'zeroOrMin',\n range: model.markDef.orient === 'vertical'\n })), encode.defined(model));\n }\n};\n//# sourceMappingURL=area.js.map","import * as encode from './encode';\nexport const bar = {\n vgMark: 'rect',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.rectPosition(model, 'x', 'bar')), encode.rectPosition(model, 'y', 'bar'));\n }\n};\n//# sourceMappingURL=bar.js.map","import { isFieldDef, vgField } from '../../channeldef';\nimport { GEOJSON } from '../../type';\nimport * as encode from './encode';\nexport const geoshape = {\n vgMark: 'shape',\n encodeEntry: (model) => {\n return Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'ignore',\n orient: 'ignore',\n theta: 'ignore'\n }));\n },\n postEncodingTransform: (model) => {\n const { encoding } = model;\n const shapeDef = encoding.shape;\n const transform = Object.assign({ type: 'geoshape', projection: model.projectionName() }, (shapeDef && isFieldDef(shapeDef) && shapeDef.type === GEOJSON\n ? { field: vgField(shapeDef, { expr: 'datum' }) }\n : {}));\n return [transform];\n }\n};\n//# sourceMappingURL=geoshape.js.map","import * as encode from './encode';\nexport const image = {\n vgMark: 'image',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'ignore',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.rectPosition(model, 'x', 'image')), encode.rectPosition(model, 'y', 'image')), encode.text(model, 'url'));\n }\n};\n//# sourceMappingURL=image.js.map","import * as encode from './encode';\nexport const line = {\n vgMark: 'line',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'ignore',\n orient: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.nonPosition('size', model, {\n vgChannel: 'strokeWidth' // VL's line size is strokeWidth\n })), encode.defined(model));\n }\n};\nexport const trail = {\n vgMark: 'trail',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'include',\n orient: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.nonPosition('size', model)), encode.defined(model));\n }\n};\n//# sourceMappingURL=line.js.map","import * as encode from './encode';\nexport const rect = {\n vgMark: 'rect',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.rectPosition(model, 'x', 'rect')), encode.rectPosition(model, 'y', 'rect'));\n }\n};\n//# sourceMappingURL=rect.js.map","import * as encode from './encode';\nexport const rule = {\n vgMark: 'rule',\n encodeEntry: (model) => {\n const { markDef } = model;\n const orient = markDef.orient;\n if (!model.encoding.x && !model.encoding.y && !model.encoding.latitude && !model.encoding.longitude) {\n // Show nothing if we have none of x, y, lat, and long.\n return {};\n }\n return Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.pointOrRangePosition('x', model, {\n defaultPos: orient === 'horizontal' ? 'zeroOrMax' : 'mid',\n defaultPos2: 'zeroOrMin',\n range: orient !== 'vertical' // include x2 for horizontal or line segment rule\n })), encode.pointOrRangePosition('y', model, {\n defaultPos: orient === 'vertical' ? 'zeroOrMax' : 'mid',\n defaultPos2: 'zeroOrMin',\n range: orient !== 'horizontal' // include y2 for vertical or line segment rule\n })), encode.nonPosition('size', model, {\n vgChannel: 'strokeWidth' // VL's rule size is strokeWidth\n }));\n }\n};\n//# sourceMappingURL=rule.js.map","import { getMarkPropOrConfig } from '../common';\nimport * as encode from './encode';\nexport const text = {\n vgMark: 'text',\n encodeEntry: (model) => {\n const { config, encoding } = model;\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'include',\n baseline: 'include',\n color: 'include',\n size: 'ignore',\n orient: 'ignore',\n theta: 'include'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.text(model)), encode.nonPosition('size', model, {\n vgChannel: 'fontSize' // VL's text size is fontSize\n })), encode.nonPosition('angle', model)), encode.valueIfDefined('align', align(model.markDef, encoding, config))), encode.valueIfDefined('baseline', baseline(model.markDef, encoding, config))), encode.pointPosition('radius', model, { defaultPos: null, isMidPoint: true })), encode.pointPosition('theta', model, { defaultPos: null, isMidPoint: true }));\n }\n};\nfunction align(markDef, encoding, config) {\n const a = getMarkPropOrConfig('align', markDef, config);\n if (a === undefined) {\n return 'center';\n }\n // If there is a config, Vega-parser will process this already.\n return undefined;\n}\nfunction baseline(markDef, encoding, config) {\n const b = getMarkPropOrConfig('baseline', markDef, config);\n if (b === undefined) {\n return 'middle';\n }\n // If there is a config, Vega-parser will process this already.\n return undefined;\n}\n//# sourceMappingURL=text.js.map","import { isArray } from 'vega-util';\nimport { isConditionalAxisValue } from '../axis';\nimport { GEOPOSITION_CHANNELS, NONPOSITION_SCALE_CHANNELS, POSITION_SCALE_CHANNELS, SCALE_CHANNELS, supportLegend, X, Y } from '../channel';\nimport { getFieldDef, getFieldOrDatumDef, isFieldOrDatumDef, isTypedFieldDef } from '../channeldef';\nimport { isGraticuleGenerator } from '../data';\nimport * as vlEncoding from '../encoding';\nimport { initEncoding } from '../encoding';\nimport { replaceExprRefInIndex } from '../expr';\nimport { GEOSHAPE, isMarkDef } from '../mark';\nimport { isFrameMixins } from '../spec/base';\nimport { stack } from '../stack';\nimport { keys } from '../util';\nimport { assembleAxisSignals } from './axis/assemble';\nimport { parseUnitAxes } from './axis/parse';\nimport { signalOrValueRefWithCondition, signalRefOrValue } from './common';\nimport { parseData } from './data/parse';\nimport { assembleLayoutSignals } from './layoutsize/assemble';\nimport { initLayoutSize } from './layoutsize/init';\nimport { parseUnitLayoutSize } from './layoutsize/parse';\nimport { defaultFilled, initMarkdef } from './mark/init';\nimport { parseMarkGroups } from './mark/mark';\nimport { isLayerModel, ModelWithField } from './model';\nimport { assembleTopLevelSignals, assembleUnitSelectionData, assembleUnitSelectionMarks, assembleUnitSelectionSignals } from './selection/assemble';\nimport { parseUnitSelection } from './selection/parse';\n/**\n * Internal model of Vega-Lite specification for the compiler.\n */\nexport class UnitModel extends ModelWithField {\n constructor(spec, parent, parentGivenName, parentGivenSize = {}, config) {\n super(spec, 'unit', parent, parentGivenName, config, undefined, isFrameMixins(spec) ? spec.view : undefined);\n this.specifiedScales = {};\n this.specifiedAxes = {};\n this.specifiedLegends = {};\n this.specifiedProjection = {};\n this.selection = {};\n this.children = [];\n const markDef = isMarkDef(spec.mark) ? Object.assign({}, spec.mark) : { type: spec.mark };\n const mark = markDef.type;\n // Need to init filled before other mark properties because encoding depends on filled but other mark properties depend on types inside encoding\n if (markDef.filled === undefined) {\n markDef.filled = defaultFilled(markDef, config, {\n graticule: spec.data && isGraticuleGenerator(spec.data)\n });\n }\n const encoding = (this.encoding = initEncoding(spec.encoding || {}, mark, markDef.filled, config));\n this.markDef = initMarkdef(markDef, encoding, config);\n this.size = initLayoutSize({\n encoding: encoding,\n size: isFrameMixins(spec)\n ? Object.assign(Object.assign(Object.assign({}, parentGivenSize), (spec.width ? { width: spec.width } : {})), (spec.height ? { height: spec.height } : {})) : parentGivenSize\n });\n // calculate stack properties\n this.stack = stack(mark, encoding);\n this.specifiedScales = this.initScales(mark, encoding);\n this.specifiedAxes = this.initAxes(encoding);\n this.specifiedLegends = this.initLegends(encoding);\n this.specifiedProjection = spec.projection;\n // Selections will be initialized upon parse.\n this.selection = spec.selection;\n }\n get hasProjection() {\n const { encoding } = this;\n const isGeoShapeMark = this.mark === GEOSHAPE;\n const hasGeoPosition = encoding && GEOPOSITION_CHANNELS.some(channel => isFieldOrDatumDef(encoding[channel]));\n return isGeoShapeMark || hasGeoPosition;\n }\n /**\n * Return specified Vega-Lite scale domain for a particular channel\n * @param channel\n */\n scaleDomain(channel) {\n const scale = this.specifiedScales[channel];\n return scale ? scale.domain : undefined;\n }\n axis(channel) {\n return this.specifiedAxes[channel];\n }\n legend(channel) {\n return this.specifiedLegends[channel];\n }\n initScales(mark, encoding) {\n return SCALE_CHANNELS.reduce((scales, channel) => {\n var _a;\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n if (fieldOrDatumDef) {\n scales[channel] = this.initScale((_a = fieldOrDatumDef.scale) !== null && _a !== void 0 ? _a : {});\n }\n return scales;\n }, {});\n }\n initScale(scale) {\n const { domain, range } = scale;\n const scaleInternal = replaceExprRefInIndex(scale);\n if (isArray(domain)) {\n scaleInternal.domain = domain.map(signalRefOrValue);\n }\n if (isArray(range)) {\n scaleInternal.range = range.map(signalRefOrValue);\n }\n return scaleInternal;\n }\n initAxes(encoding) {\n return POSITION_SCALE_CHANNELS.reduce((_axis, channel) => {\n // Position Axis\n // TODO: handle ConditionFieldDef\n const channelDef = encoding[channel];\n if (isFieldOrDatumDef(channelDef) ||\n (channel === X && isFieldOrDatumDef(encoding.x2)) ||\n (channel === Y && isFieldOrDatumDef(encoding.y2))) {\n const axisSpec = isFieldOrDatumDef(channelDef) ? channelDef.axis : undefined;\n _axis[channel] = axisSpec\n ? this.initAxis(Object.assign({}, axisSpec)) // convert truthy value to object\n : axisSpec;\n }\n return _axis;\n }, {});\n }\n initAxis(axis) {\n const props = keys(axis);\n const axisInternal = {};\n for (const prop of props) {\n const val = axis[prop];\n axisInternal[prop] = isConditionalAxisValue(val)\n ? signalOrValueRefWithCondition(val)\n : signalRefOrValue(val);\n }\n return axisInternal;\n }\n initLegends(encoding) {\n return NONPOSITION_SCALE_CHANNELS.reduce((_legend, channel) => {\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n if (fieldOrDatumDef && supportLegend(channel)) {\n const legend = fieldOrDatumDef.legend;\n _legend[channel] = legend\n ? replaceExprRefInIndex(legend) // convert truthy value to object\n : legend;\n }\n return _legend;\n }, {});\n }\n parseData() {\n this.component.data = parseData(this);\n }\n parseLayoutSize() {\n parseUnitLayoutSize(this);\n }\n parseSelections() {\n this.component.selection = parseUnitSelection(this, this.selection);\n }\n parseMarkGroup() {\n this.component.mark = parseMarkGroups(this);\n }\n parseAxesAndHeaders() {\n this.component.axes = parseUnitAxes(this);\n }\n assembleSelectionTopLevelSignals(signals) {\n return assembleTopLevelSignals(this, signals);\n }\n assembleSignals() {\n return [...assembleAxisSignals(this), ...assembleUnitSelectionSignals(this, [])];\n }\n assembleSelectionData(data) {\n return assembleUnitSelectionData(this, data);\n }\n assembleLayout() {\n return null;\n }\n assembleLayoutSignals() {\n return assembleLayoutSignals(this);\n }\n assembleMarks() {\n var _a;\n let marks = (_a = this.component.mark) !== null && _a !== void 0 ? _a : [];\n // If this unit is part of a layer, selections should augment\n // all in concert rather than each unit individually. This\n // ensures correct interleaving of clipping and brushed marks.\n if (!this.parent || !isLayerModel(this.parent)) {\n marks = assembleUnitSelectionMarks(this, marks);\n }\n return marks.map(this.correctDataNames);\n }\n getMapping() {\n return this.encoding;\n }\n get mark() {\n return this.markDef.type;\n }\n channelHasField(channel) {\n return vlEncoding.channelHasField(this.encoding, channel);\n }\n fieldDef(channel) {\n const channelDef = this.encoding[channel];\n return getFieldDef(channelDef);\n }\n typedFieldDef(channel) {\n const fieldDef = this.fieldDef(channel);\n if (isTypedFieldDef(fieldDef)) {\n return fieldDef;\n }\n return null;\n }\n}\n//# sourceMappingURL=unit.js.map","import { isBinned, isBinning } from '../../bin';\nimport { isContinuousFieldOrDatumDef, isFieldDef, isNumericDataDef } from '../../channeldef';\nimport { isAggregate } from '../../encoding';\nimport { replaceExprRefInIndex } from '../../expr';\nimport * as log from '../../log';\nimport { AREA, BAR, BAR_CORNER_RADIUS_INDEX as BAR_CORNER_RADIUS_END_INDEX, CIRCLE, IMAGE, LINE, POINT, RECT, RULE, SQUARE, TEXT, TICK } from '../../mark';\nimport { QUANTITATIVE, TEMPORAL } from '../../type';\nimport { contains, getFirstDefined } from '../../util';\nimport { getMarkConfig, getMarkPropOrConfig } from '../common';\nexport function initMarkdef(originalMarkDef, encoding, config) {\n const markDef = replaceExprRefInIndex(originalMarkDef);\n // set orient, which can be overridden by rules as sometimes the specified orient is invalid.\n const specifiedOrient = getMarkPropOrConfig('orient', markDef, config);\n markDef.orient = orient(markDef.type, encoding, specifiedOrient);\n if (specifiedOrient !== undefined && specifiedOrient !== markDef.orient) {\n log.warn(log.message.orientOverridden(markDef.orient, specifiedOrient));\n }\n if (markDef.type === 'bar' && markDef.orient) {\n const cornerRadiusEnd = getMarkPropOrConfig('cornerRadiusEnd', markDef, config);\n if (cornerRadiusEnd !== undefined) {\n const newProps = (markDef.orient === 'horizontal' && encoding.x2) || (markDef.orient === 'vertical' && encoding.y2)\n ? ['cornerRadius']\n : BAR_CORNER_RADIUS_END_INDEX[markDef.orient];\n for (const newProp of newProps) {\n markDef[newProp] = cornerRadiusEnd;\n }\n if (markDef.cornerRadiusEnd !== undefined) {\n delete markDef.cornerRadiusEnd; // no need to keep the original cap cornerRadius\n }\n }\n }\n // set opacity and filled if not specified in mark config\n const specifiedOpacity = getMarkPropOrConfig('opacity', markDef, config);\n if (specifiedOpacity === undefined) {\n markDef.opacity = opacity(markDef.type, encoding);\n }\n // set cursor, which should be pointer if href channel is present unless otherwise specified\n const specifiedCursor = getMarkPropOrConfig('cursor', markDef, config);\n if (specifiedCursor === undefined) {\n markDef.cursor = cursor(markDef, encoding, config);\n }\n return markDef;\n}\nfunction cursor(markDef, encoding, config) {\n if (encoding.href || markDef.href || getMarkPropOrConfig('href', markDef, config)) {\n return 'pointer';\n }\n return markDef.cursor;\n}\nfunction opacity(mark, encoding) {\n if (contains([POINT, TICK, CIRCLE, SQUARE], mark)) {\n // point-based marks\n if (!isAggregate(encoding)) {\n return 0.7;\n }\n }\n return undefined;\n}\nexport function defaultFilled(markDef, config, { graticule }) {\n if (graticule) {\n return false;\n }\n const filledConfig = getMarkConfig('filled', markDef, config);\n const mark = markDef.type;\n return getFirstDefined(filledConfig, mark !== POINT && mark !== LINE && mark !== RULE);\n}\nfunction orient(mark, encoding, specifiedOrient) {\n switch (mark) {\n case POINT:\n case CIRCLE:\n case SQUARE:\n case TEXT:\n case RECT:\n case IMAGE:\n // orient is meaningless for these marks.\n return undefined;\n }\n const { x, y, x2, y2 } = encoding;\n switch (mark) {\n case BAR:\n if (isFieldDef(x) && (isBinned(x.bin) || (isFieldDef(y) && y.aggregate && !x.aggregate))) {\n return 'vertical';\n }\n if (isFieldDef(y) && (isBinned(y.bin) || (isFieldDef(x) && x.aggregate && !y.aggregate))) {\n return 'horizontal';\n }\n if (y2 || x2) {\n // Ranged bar does not always have clear orientation, so we allow overriding\n if (specifiedOrient) {\n return specifiedOrient;\n }\n // If y is range and x is non-range, non-bin Q, y is likely a prebinned field\n if (!x2) {\n if ((isFieldDef(x) && x.type === QUANTITATIVE && !isBinning(x.bin)) || isNumericDataDef(x)) {\n return 'horizontal';\n }\n }\n // If x is range and y is non-range, non-bin Q, x is likely a prebinned field\n if (!y2) {\n if ((isFieldDef(y) && y.type === QUANTITATIVE && !isBinning(y.bin)) || isNumericDataDef(y)) {\n return 'vertical';\n }\n }\n }\n // falls through\n case RULE:\n // return undefined for line segment rule and bar with both axis ranged\n // we have to ignore the case that the data are already binned\n if (x2 && !(isFieldDef(x) && isBinned(x.bin)) && y2 && !(isFieldDef(y) && isBinned(y.bin))) {\n return undefined;\n }\n // falls through\n case AREA:\n // If there are range for both x and y, y (vertical) has higher precedence.\n if (y2) {\n if (isFieldDef(y) && isBinned(y.bin)) {\n return 'horizontal';\n }\n else {\n return 'vertical';\n }\n }\n else if (x2) {\n if (isFieldDef(x) && isBinned(x.bin)) {\n return 'vertical';\n }\n else {\n return 'horizontal';\n }\n }\n else if (mark === RULE) {\n if (x && !y) {\n return 'vertical';\n }\n else if (y && !x) {\n return 'horizontal';\n }\n }\n // falls through\n case LINE:\n case TICK: {\n // Tick is opposite to bar, line, area and never have ranged mark.\n const xIsContinuous = isContinuousFieldOrDatumDef(x);\n const yIsContinuous = isContinuousFieldOrDatumDef(y);\n if (xIsContinuous && !yIsContinuous) {\n return mark !== 'tick' ? 'horizontal' : 'vertical';\n }\n else if (!xIsContinuous && yIsContinuous) {\n return mark !== 'tick' ? 'vertical' : 'horizontal';\n }\n else if (xIsContinuous && yIsContinuous) {\n const xDef = x; // we can cast here since they are surely fieldDef\n const yDef = y;\n const xIsTemporal = xDef.type === TEMPORAL;\n const yIsTemporal = yDef.type === TEMPORAL;\n // temporal without timeUnit is considered continuous, but better serves as dimension\n if (xIsTemporal && !yIsTemporal) {\n return mark !== 'tick' ? 'vertical' : 'horizontal';\n }\n else if (!xIsTemporal && yIsTemporal) {\n return mark !== 'tick' ? 'horizontal' : 'vertical';\n }\n if (!xDef.aggregate && yDef.aggregate) {\n return mark !== 'tick' ? 'vertical' : 'horizontal';\n }\n else if (xDef.aggregate && !yDef.aggregate) {\n return mark !== 'tick' ? 'horizontal' : 'vertical';\n }\n if (specifiedOrient) {\n // When ambiguous, use user specified one.\n return specifiedOrient;\n }\n return 'vertical';\n }\n else {\n // Discrete x Discrete case\n if (specifiedOrient) {\n // When ambiguous, use user specified one.\n return specifiedOrient;\n }\n return undefined;\n }\n }\n }\n return 'vertical';\n}\n//# sourceMappingURL=init.js.map","import { getSizeChannel, POSITION_SCALE_CHANNELS } from '../../channel';\nimport { isContinuousFieldOrDatumDef } from '../../channeldef';\nimport * as log from '../../log';\nimport { isStep } from '../../spec/base';\nexport function initLayoutSize({ encoding, size }) {\n for (const channel of POSITION_SCALE_CHANNELS) {\n const sizeType = getSizeChannel(channel);\n if (isStep(size[sizeType])) {\n if (isContinuousFieldOrDatumDef(encoding[channel])) {\n delete size[sizeType];\n log.warn(log.message.stepDropped(sizeType));\n }\n }\n }\n return size;\n}\n//# sourceMappingURL=init.js.map","import * as log from '../log';\nimport { isLayerSpec, isUnitSpec } from '../spec';\nimport { keys } from '../util';\nimport { assembleAxisSignals } from './axis/assemble';\nimport { parseLayerAxes } from './axis/parse';\nimport { parseData } from './data/parse';\nimport { assembleLayoutSignals } from './layoutsize/assemble';\nimport { parseLayerLayoutSize } from './layoutsize/parse';\nimport { assembleLegends } from './legend/assemble';\nimport { Model } from './model';\nimport { assembleLayerSelectionMarks } from './selection/assemble';\nimport { UnitModel } from './unit';\nexport class LayerModel extends Model {\n constructor(spec, parent, parentGivenName, parentGivenSize, config) {\n super(spec, 'layer', parent, parentGivenName, config, spec.resolve, spec.view);\n const layoutSize = Object.assign(Object.assign(Object.assign({}, parentGivenSize), (spec.width ? { width: spec.width } : {})), (spec.height ? { height: spec.height } : {}));\n this.children = spec.layer.map((layer, i) => {\n if (isLayerSpec(layer)) {\n return new LayerModel(layer, this, this.getName('layer_' + i), layoutSize, config);\n }\n else if (isUnitSpec(layer)) {\n return new UnitModel(layer, this, this.getName('layer_' + i), layoutSize, config);\n }\n throw new Error(log.message.invalidSpec(layer));\n });\n }\n parseData() {\n this.component.data = parseData(this);\n for (const child of this.children) {\n child.parseData();\n }\n }\n parseLayoutSize() {\n parseLayerLayoutSize(this);\n }\n parseSelections() {\n // Merge selections up the hierarchy so that they may be referenced\n // across unit specs. Persist their definitions within each child\n // to assemble signals which remain within output Vega unit groups.\n this.component.selection = {};\n for (const child of this.children) {\n child.parseSelections();\n for (const key of keys(child.component.selection)) {\n this.component.selection[key] = child.component.selection[key];\n }\n }\n }\n parseMarkGroup() {\n for (const child of this.children) {\n child.parseMarkGroup();\n }\n }\n parseAxesAndHeaders() {\n parseLayerAxes(this);\n }\n assembleSelectionTopLevelSignals(signals) {\n return this.children.reduce((sg, child) => child.assembleSelectionTopLevelSignals(sg), signals);\n }\n // TODO: Support same named selections across children.\n assembleSignals() {\n return this.children.reduce((signals, child) => {\n return signals.concat(child.assembleSignals());\n }, assembleAxisSignals(this));\n }\n assembleLayoutSignals() {\n return this.children.reduce((signals, child) => {\n return signals.concat(child.assembleLayoutSignals());\n }, assembleLayoutSignals(this));\n }\n assembleSelectionData(data) {\n return this.children.reduce((db, child) => child.assembleSelectionData(db), data);\n }\n assembleTitle() {\n let title = super.assembleTitle();\n if (title) {\n return title;\n }\n // If title does not provide layer, look into children\n for (const child of this.children) {\n title = child.assembleTitle();\n if (title) {\n return title;\n }\n }\n return undefined;\n }\n assembleLayout() {\n return null;\n }\n assembleMarks() {\n return assembleLayerSelectionMarks(this, this.children.flatMap(child => {\n return child.assembleMarks();\n }));\n }\n assembleLegends() {\n return this.children.reduce((legends, child) => {\n return legends.concat(child.assembleLegends());\n }, assembleLegends(this));\n }\n}\n//# sourceMappingURL=layer.js.map","import * as log from '../log';\nimport { isAnyConcatSpec, isFacetSpec, isLayerSpec, isUnitSpec } from '../spec';\nimport { ConcatModel } from './concat';\nimport { FacetModel } from './facet';\nimport { LayerModel } from './layer';\nimport { UnitModel } from './unit';\nexport function buildModel(spec, parent, parentGivenName, unitSize, config) {\n if (isFacetSpec(spec)) {\n return new FacetModel(spec, parent, parentGivenName, config);\n }\n else if (isLayerSpec(spec)) {\n return new LayerModel(spec, parent, parentGivenName, unitSize, config);\n }\n else if (isUnitSpec(spec)) {\n return new UnitModel(spec, parent, parentGivenName, unitSize, config);\n }\n else if (isAnyConcatSpec(spec)) {\n return new ConcatModel(spec, parent, parentGivenName, config);\n }\n throw new Error(log.message.invalidSpec(spec));\n}\n//# sourceMappingURL=buildmodel.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isString, mergeConfig } from 'vega-util';\nimport { getPositionScaleChannel } from '../channel';\nimport * as vlFieldDef from '../channeldef';\nimport { initConfig, stripAndRedirectConfig } from '../config';\nimport * as log from '../log';\nimport { normalize } from '../normalize';\nimport { assembleParameterSignals } from '../parameter';\nimport { extractTopLevelProperties, getFitType, isFitType } from '../spec/toplevel';\nimport { keys } from '../util';\nimport { buildModel } from './buildmodel';\nimport { assembleRootData } from './data/assemble';\nimport { optimizeDataflow } from './data/optimize';\n/**\n * Vega-Lite's main function, for compiling Vega-Lite spec into Vega spec.\n *\n * At a high-level, we make the following transformations in different phases:\n *\n * Input spec\n * |\n * | (Normalization)\n * v\n * Normalized Spec (Row/Column channels in single-view specs becomes faceted specs, composite marks becomes layered specs.)\n * |\n * | (Build Model)\n * v\n * A model tree of the spec\n * |\n * | (Parse)\n * v\n * A model tree with parsed components (intermediate structure of visualization primitives in a format that can be easily merged)\n * |\n * | (Optimize)\n * v\n * A model tree with parsed components with the data component optimized\n * |\n * | (Assemble)\n * v\n * Vega spec\n *\n * @param inputSpec The Vega-Lite specification.\n * @param opt Optional arguments passed to the Vega-Lite compiler.\n * @returns An object containing the compiled Vega spec and normalized Vega-Lite spec.\n */\nexport function compile(inputSpec, opt = {}) {\n // 0. Augment opt with default opts\n if (opt.logger) {\n // set the singleton logger to the provided logger\n log.set(opt.logger);\n }\n if (opt.fieldTitle) {\n // set the singleton field title formatter\n vlFieldDef.setTitleFormatter(opt.fieldTitle);\n }\n try {\n // 1. Initialize config by deep merging default config with the config provided via option and the input spec.\n const config = initConfig(mergeConfig(opt.config, inputSpec.config));\n // 2. Normalize: Convert input spec -> normalized spec\n // - Decompose all extended unit specs into composition of unit spec. For example, a box plot get expanded into multiple layers of bars, ticks, and rules. The shorthand row/column channel is also expanded to a facet spec.\n // - Normalize autosize and width or height spec\n const spec = normalize(inputSpec, config);\n // 3. Build Model: normalized spec -> Model (a tree structure)\n // This phases instantiates the models with default config by doing a top-down traversal. This allows us to pass properties that child models derive from their parents via their constructors.\n // See the abstract `Model` class and its children (UnitModel, LayerModel, FacetModel, ConcatModel) for different types of models.\n const model = buildModel(spec, null, '', undefined, config);\n // 4 Parse: Model --> Model with components\n // Note that components = intermediate representations that are equivalent to Vega specs.\n // We need these intermediate representation because we need to merge many visualization \"components\" like projections, scales, axes, and legends.\n // We will later convert these components into actual Vega specs in the assemble phase.\n // In this phase, we do a bottom-up traversal over the whole tree to\n // parse for each type of components once (e.g., data, layout, mark, scale).\n // By doing bottom-up traversal, we start parsing components of unit specs and\n // then merge child components of parent composite specs.\n //\n // Please see inside model.parse() for order of different components parsed.\n model.parse();\n // drawDataflow(model.component.data.sources);\n // 5. Optimize the dataflow. This will modify the data component of the model.\n optimizeDataflow(model.component.data, model);\n // drawDataflow(model.component.data.sources);\n // 6. Assemble: convert model components --> Vega Spec.\n const vgSpec = assembleTopLevelModel(model, getTopLevelProperties(inputSpec, spec.autosize, config, model), inputSpec.datasets, inputSpec.usermeta);\n return {\n spec: vgSpec,\n normalized: spec\n };\n }\n finally {\n // Reset the singleton logger if a logger is provided\n if (opt.logger) {\n log.reset();\n }\n // Reset the singleton field title formatter if provided\n if (opt.fieldTitle) {\n vlFieldDef.resetTitleFormatter();\n }\n }\n}\nfunction getTopLevelProperties(inputSpec, autosize, config, model) {\n const width = model.component.layoutSize.get('width');\n const height = model.component.layoutSize.get('height');\n if (autosize === undefined) {\n autosize = { type: 'pad' };\n if (model.hasAxisOrientSignalRef()) {\n autosize.resize = true;\n }\n }\n else if (isString(autosize)) {\n autosize = { type: autosize };\n }\n if (width && height && isFitType(autosize.type)) {\n if (width === 'step' && height === 'step') {\n log.warn(log.message.droppingFit());\n autosize.type = 'pad';\n }\n else if (width === 'step' || height === 'step') {\n // effectively XOR, because else if\n // get step dimension\n const sizeType = width === 'step' ? 'width' : 'height';\n // log that we're dropping fit for respective channel\n log.warn(log.message.droppingFit(getPositionScaleChannel(sizeType)));\n // setting type to inverse fit (so if we dropped fit-x, type is now fit-y)\n const inverseSizeType = sizeType === 'width' ? 'height' : 'width';\n autosize.type = getFitType(inverseSizeType);\n }\n }\n return Object.assign(Object.assign(Object.assign({}, (keys(autosize).length === 1 && autosize.type\n ? autosize.type === 'pad'\n ? {}\n : { autosize: autosize.type }\n : { autosize })), extractTopLevelProperties(config, false)), extractTopLevelProperties(inputSpec, true));\n}\n/*\n * Assemble the top-level model to a Vega spec.\n *\n * Note: this couldn't be `model.assemble()` since the top-level model\n * needs some special treatment to generate top-level properties.\n */\nfunction assembleTopLevelModel(model, topLevelProperties, datasets = {}, usermeta) {\n // Config with Vega-Lite only config removed.\n const vgConfig = model.config ? stripAndRedirectConfig(model.config) : undefined;\n const data = [].concat(model.assembleSelectionData([]), \n // only assemble data in the root\n assembleRootData(model.component.data, datasets));\n const projections = model.assembleProjections();\n const title = model.assembleTitle();\n const style = model.assembleGroupStyle();\n const encodeEntry = model.assembleGroupEncodeEntry(true);\n let layoutSignals = model.assembleLayoutSignals();\n // move width and height signals with values to top level\n layoutSignals = layoutSignals.filter(signal => {\n if ((signal.name === 'width' || signal.name === 'height') && signal.value !== undefined) {\n topLevelProperties[signal.name] = +signal.value;\n return false;\n }\n return true;\n });\n const { params } = topLevelProperties, otherTopLevelProps = __rest(topLevelProperties, [\"params\"]);\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ $schema: 'https://vega.github.io/schema/vega/v5.json' }, (model.description ? { description: model.description } : {})), otherTopLevelProps), (title ? { title } : {})), (style ? { style } : {})), (encodeEntry ? { encode: { update: encodeEntry } } : {})), { data }), (projections.length > 0 ? { projections: projections } : {})), model.assembleGroup([\n ...layoutSignals,\n ...model.assembleSelectionTopLevelSignals([]),\n ...assembleParameterSignals(params)\n ])), (vgConfig ? { config: vgConfig } : {})), (usermeta ? { usermeta } : {}));\n}\n//# sourceMappingURL=compile.js.map","function accessor (fn, fields, name) {\n fn.fields = fields || [];\n fn.fname = name;\n return fn;\n}\nfunction accessorName(fn) {\n return fn == null ? null : fn.fname;\n}\nfunction accessorFields(fn) {\n return fn == null ? null : fn.fields;\n}\n\nfunction getter (path) {\n return path.length === 1 ? get1(path[0]) : getN(path);\n}\nconst get1 = field => function (obj) {\n return obj[field];\n};\nconst getN = path => {\n const len = path.length;\n return function (obj) {\n for (let i = 0; i < len; ++i) {\n obj = obj[path[i]];\n }\n return obj;\n };\n};\n\nfunction error (message) {\n throw Error(message);\n}\n\nfunction splitAccessPath (p) {\n const path = [],\n n = p.length;\n let q = null,\n b = 0,\n s = '',\n i,\n j,\n c;\n p = p + '';\n function push() {\n path.push(s + p.substring(i, j));\n s = '';\n i = j + 1;\n }\n for (i = j = 0; j < n; ++j) {\n c = p[j];\n if (c === '\\\\') {\n s += p.substring(i, j++);\n i = j;\n } else if (c === q) {\n push();\n q = null;\n b = -1;\n } else if (q) {\n continue;\n } else if (i === b && c === '\"') {\n i = j + 1;\n q = c;\n } else if (i === b && c === \"'\") {\n i = j + 1;\n q = c;\n } else if (c === '.' && !b) {\n if (j > i) {\n push();\n } else {\n i = j + 1;\n }\n } else if (c === '[') {\n if (j > i) push();\n b = i = j + 1;\n } else if (c === ']') {\n if (!b) error('Access path missing open bracket: ' + p);\n if (b > 0) push();\n b = 0;\n i = j + 1;\n }\n }\n if (b) error('Access path missing closing bracket: ' + p);\n if (q) error('Access path missing closing quote: ' + p);\n if (j > i) {\n j++;\n push();\n }\n return path;\n}\n\nfunction field (field, name, opt) {\n const path = splitAccessPath(field);\n field = path.length === 1 ? path[0] : field;\n return accessor((opt && opt.get || getter)(path), [field], name || field);\n}\n\nconst id = field('id');\nconst identity = accessor(_ => _, [], 'identity');\nconst zero = accessor(() => 0, [], 'zero');\nconst one = accessor(() => 1, [], 'one');\nconst truthy = accessor(() => true, [], 'true');\nconst falsy = accessor(() => false, [], 'false');\n\nfunction log$1(method, level, input) {\n const args = [level].concat([].slice.call(input));\n console[method].apply(console, args); // eslint-disable-line no-console\n}\n\nconst None = 0;\nconst Error$1 = 1;\nconst Warn = 2;\nconst Info = 3;\nconst Debug = 4;\nfunction logger (_, method) {\n let handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : log$1;\n let level = _ || None;\n return {\n level(_) {\n if (arguments.length) {\n level = +_;\n return this;\n } else {\n return level;\n }\n },\n error() {\n if (level >= Error$1) handler(method || 'error', 'ERROR', arguments);\n return this;\n },\n warn() {\n if (level >= Warn) handler(method || 'warn', 'WARN', arguments);\n return this;\n },\n info() {\n if (level >= Info) handler(method || 'log', 'INFO', arguments);\n return this;\n },\n debug() {\n if (level >= Debug) handler(method || 'log', 'DEBUG', arguments);\n return this;\n }\n };\n}\n\nvar isArray = Array.isArray;\n\nfunction isObject (_) {\n return _ === Object(_);\n}\n\nconst isLegalKey = key => key !== '__proto__';\nfunction mergeConfig() {\n for (var _len = arguments.length, configs = new Array(_len), _key = 0; _key < _len; _key++) {\n configs[_key] = arguments[_key];\n }\n return configs.reduce((out, source) => {\n for (const key in source) {\n if (key === 'signals') {\n // for signals, we merge the signals arrays\n // source signals take precedence over\n // existing signals with the same name\n out.signals = mergeNamed(out.signals, source.signals);\n } else {\n // otherwise, merge objects subject to recursion constraints\n // for legend block, recurse for the layout entry only\n // for style block, recurse for all properties\n // otherwise, no recursion: objects overwrite, no merging\n const r = key === 'legend' ? {\n layout: 1\n } : key === 'style' ? true : null;\n writeConfig(out, key, source[key], r);\n }\n }\n return out;\n }, {});\n}\nfunction writeConfig(output, key, value, recurse) {\n if (!isLegalKey(key)) return;\n let k, o;\n if (isObject(value) && !isArray(value)) {\n o = isObject(output[key]) ? output[key] : output[key] = {};\n for (k in value) {\n if (recurse && (recurse === true || recurse[k])) {\n writeConfig(o, k, value[k]);\n } else if (isLegalKey(k)) {\n o[k] = value[k];\n }\n }\n } else {\n output[key] = value;\n }\n}\nfunction mergeNamed(a, b) {\n if (a == null) return b;\n const map = {},\n out = [];\n function add(_) {\n if (!map[_.name]) {\n map[_.name] = 1;\n out.push(_);\n }\n }\n b.forEach(add);\n a.forEach(add);\n return out;\n}\n\nfunction peek (array) {\n return array[array.length - 1];\n}\n\nfunction toNumber (_) {\n return _ == null || _ === '' ? null : +_;\n}\n\nconst exp = sign => x => sign * Math.exp(x);\nconst log = sign => x => Math.log(sign * x);\nconst symlog = c => x => Math.sign(x) * Math.log1p(Math.abs(x / c));\nconst symexp = c => x => Math.sign(x) * Math.expm1(Math.abs(x)) * c;\nconst pow = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\nfunction pan(domain, delta, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n dd = (d1 - d0) * delta;\n return [ground(d0 - dd), ground(d1 - dd)];\n}\nfunction panLinear(domain, delta) {\n return pan(domain, delta, toNumber, identity);\n}\nfunction panLog(domain, delta) {\n var sign = Math.sign(domain[0]);\n return pan(domain, delta, log(sign), exp(sign));\n}\nfunction panPow(domain, delta, exponent) {\n return pan(domain, delta, pow(exponent), pow(1 / exponent));\n}\nfunction panSymlog(domain, delta, constant) {\n return pan(domain, delta, symlog(constant), symexp(constant));\n}\nfunction zoom(domain, anchor, scale, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n da = anchor != null ? lift(anchor) : (d0 + d1) / 2;\n return [ground(da + (d0 - da) * scale), ground(da + (d1 - da) * scale)];\n}\nfunction zoomLinear(domain, anchor, scale) {\n return zoom(domain, anchor, scale, toNumber, identity);\n}\nfunction zoomLog(domain, anchor, scale) {\n const sign = Math.sign(domain[0]);\n return zoom(domain, anchor, scale, log(sign), exp(sign));\n}\nfunction zoomPow(domain, anchor, scale, exponent) {\n return zoom(domain, anchor, scale, pow(exponent), pow(1 / exponent));\n}\nfunction zoomSymlog(domain, anchor, scale, constant) {\n return zoom(domain, anchor, scale, symlog(constant), symexp(constant));\n}\n\nfunction quarter(date) {\n return 1 + ~~(new Date(date).getMonth() / 3);\n}\nfunction utcquarter(date) {\n return 1 + ~~(new Date(date).getUTCMonth() / 3);\n}\n\nfunction array (_) {\n return _ != null ? isArray(_) ? _ : [_] : [];\n}\n\n/**\n * Span-preserving range clamp. If the span of the input range is less\n * than (max - min) and an endpoint exceeds either the min or max value,\n * the range is translated such that the span is preserved and one\n * endpoint touches the boundary of the min/max range.\n * If the span exceeds (max - min), the range [min, max] is returned.\n */\nfunction clampRange (range, min, max) {\n let lo = range[0],\n hi = range[1],\n span;\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n span = hi - lo;\n return span >= max - min ? [min, max] : [lo = Math.min(Math.max(lo, min), max - span), lo + span];\n}\n\nfunction isFunction (_) {\n return typeof _ === 'function';\n}\n\nconst DESCENDING = 'descending';\nfunction compare (fields, orders, opt) {\n opt = opt || {};\n orders = array(orders) || [];\n const ord = [],\n get = [],\n fmap = {},\n gen = opt.comparator || comparator;\n array(fields).forEach((f, i) => {\n if (f == null) return;\n ord.push(orders[i] === DESCENDING ? -1 : 1);\n get.push(f = isFunction(f) ? f : field(f, null, opt));\n (accessorFields(f) || []).forEach(_ => fmap[_] = 1);\n });\n return get.length === 0 ? null : accessor(gen(get, ord), Object.keys(fmap));\n}\nconst ascending = (u, v) => (u < v || u == null) && v != null ? -1 : (u > v || v == null) && u != null ? 1 : (v = v instanceof Date ? +v : v, u = u instanceof Date ? +u : u) !== u && v === v ? -1 : v !== v && u === u ? 1 : 0;\nconst comparator = (fields, orders) => fields.length === 1 ? compare1(fields[0], orders[0]) : compareN(fields, orders, fields.length);\nconst compare1 = (field, order) => function (a, b) {\n return ascending(field(a), field(b)) * order;\n};\nconst compareN = (fields, orders, n) => {\n orders.push(0); // pad zero for convenient lookup\n return function (a, b) {\n let f,\n c = 0,\n i = -1;\n while (c === 0 && ++i < n) {\n f = fields[i];\n c = ascending(f(a), f(b));\n }\n return c * orders[i];\n };\n};\n\nfunction constant (_) {\n return isFunction(_) ? _ : () => _;\n}\n\nfunction debounce (delay, handler) {\n let tid;\n return e => {\n if (tid) clearTimeout(tid);\n tid = setTimeout(() => (handler(e), tid = null), delay);\n };\n}\n\nfunction extend (_) {\n for (let x, k, i = 1, len = arguments.length; i < len; ++i) {\n x = arguments[i];\n for (k in x) {\n _[k] = x[k];\n }\n }\n return _;\n}\n\n/**\n * Return an array with minimum and maximum values, in the\n * form [min, max]. Ignores null, undefined, and NaN values.\n */\nfunction extent (array, f) {\n let i = 0,\n n,\n v,\n min,\n max;\n if (array && (n = array.length)) {\n if (f == null) {\n // find first valid value\n for (v = array[i]; i < n && (v == null || v !== v); v = array[++i]);\n min = max = v;\n\n // visit all other values\n for (; i < n; ++i) {\n v = array[i];\n // skip null/undefined; NaN will fail all comparisons\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n } else {\n // find first valid value\n for (v = f(array[i]); i < n && (v == null || v !== v); v = f(array[++i]));\n min = max = v;\n\n // visit all other values\n for (; i < n; ++i) {\n v = f(array[i]);\n // skip null/undefined; NaN will fail all comparisons\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n }\n }\n return [min, max];\n}\n\nfunction extentIndex (array, f) {\n const n = array.length;\n let i = -1,\n a,\n b,\n c,\n u,\n v;\n if (f == null) {\n while (++i < n) {\n b = array[i];\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n if (i === n) return [-1, -1];\n u = v = i;\n while (++i < n) {\n b = array[i];\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n } else {\n while (++i < n) {\n b = f(array[i], i, array);\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n if (i === n) return [-1, -1];\n u = v = i;\n while (++i < n) {\n b = f(array[i], i, array);\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n }\n return [u, v];\n}\n\nconst hop = Object.prototype.hasOwnProperty;\nfunction has (object, property) {\n return hop.call(object, property);\n}\n\nconst NULL = {};\nfunction fastmap (input) {\n let obj = {},\n test;\n function has$1(key) {\n return has(obj, key) && obj[key] !== NULL;\n }\n const map = {\n size: 0,\n empty: 0,\n object: obj,\n has: has$1,\n get(key) {\n return has$1(key) ? obj[key] : undefined;\n },\n set(key, value) {\n if (!has$1(key)) {\n ++map.size;\n if (obj[key] === NULL) --map.empty;\n }\n obj[key] = value;\n return this;\n },\n delete(key) {\n if (has$1(key)) {\n --map.size;\n ++map.empty;\n obj[key] = NULL;\n }\n return this;\n },\n clear() {\n map.size = map.empty = 0;\n map.object = obj = {};\n },\n test(_) {\n if (arguments.length) {\n test = _;\n return map;\n } else {\n return test;\n }\n },\n clean() {\n const next = {};\n let size = 0;\n for (const key in obj) {\n const value = obj[key];\n if (value !== NULL && (!test || !test(value))) {\n next[key] = value;\n ++size;\n }\n }\n map.size = size;\n map.empty = 0;\n map.object = obj = next;\n }\n };\n if (input) Object.keys(input).forEach(key => {\n map.set(key, input[key]);\n });\n return map;\n}\n\nfunction flush (range, value, threshold, left, right, center) {\n if (!threshold && threshold !== 0) return center;\n const t = +threshold;\n let a = range[0],\n b = peek(range),\n l;\n\n // swap endpoints if range is reversed\n if (b < a) {\n l = a;\n a = b;\n b = l;\n }\n\n // compare value to endpoints\n l = Math.abs(value - a);\n const r = Math.abs(b - value);\n\n // adjust if value is within threshold distance of endpoint\n return l < r && l <= t ? left : r <= t ? right : center;\n}\n\nfunction inherits (child, parent, members) {\n const proto = child.prototype = Object.create(parent.prototype);\n Object.defineProperty(proto, 'constructor', {\n value: child,\n writable: true,\n enumerable: true,\n configurable: true\n });\n return extend(proto, members);\n}\n\n/**\n * Predicate that returns true if the value lies within the span\n * of the given range. The left and right flags control the use\n * of inclusive (true) or exclusive (false) comparisons.\n */\nfunction inrange (value, range, left, right) {\n let r0 = range[0],\n r1 = range[range.length - 1],\n t;\n if (r0 > r1) {\n t = r0;\n r0 = r1;\n r1 = t;\n }\n left = left === undefined || left;\n right = right === undefined || right;\n return (left ? r0 <= value : r0 < value) && (right ? value <= r1 : value < r1);\n}\n\nfunction isBoolean (_) {\n return typeof _ === 'boolean';\n}\n\nfunction isDate (_) {\n return Object.prototype.toString.call(_) === '[object Date]';\n}\n\nfunction isIterable (_) {\n return _ && isFunction(_[Symbol.iterator]);\n}\n\nfunction isNumber (_) {\n return typeof _ === 'number';\n}\n\nfunction isRegExp (_) {\n return Object.prototype.toString.call(_) === '[object RegExp]';\n}\n\nfunction isString (_) {\n return typeof _ === 'string';\n}\n\nfunction key (fields, flat, opt) {\n if (fields) {\n fields = flat ? array(fields).map(f => f.replace(/\\\\(.)/g, '$1')) : array(fields);\n }\n const len = fields && fields.length,\n gen = opt && opt.get || getter,\n map = f => gen(flat ? [f] : splitAccessPath(f));\n let fn;\n if (!len) {\n fn = function () {\n return '';\n };\n } else if (len === 1) {\n const get = map(fields[0]);\n fn = function (_) {\n return '' + get(_);\n };\n } else {\n const get = fields.map(map);\n fn = function (_) {\n let s = '' + get[0](_),\n i = 0;\n while (++i < len) s += '|' + get[i](_);\n return s;\n };\n }\n return accessor(fn, fields, 'key');\n}\n\nfunction lerp (array, frac) {\n const lo = array[0],\n hi = peek(array),\n f = +frac;\n return !f ? lo : f === 1 ? hi : lo + f * (hi - lo);\n}\n\nconst DEFAULT_MAX_SIZE = 10000;\n\n// adapted from https://github.com/dominictarr/hashlru/ (MIT License)\nfunction lruCache (maxsize) {\n maxsize = +maxsize || DEFAULT_MAX_SIZE;\n let curr, prev, size;\n const clear = () => {\n curr = {};\n prev = {};\n size = 0;\n };\n const update = (key, value) => {\n if (++size > maxsize) {\n prev = curr;\n curr = {};\n size = 1;\n }\n return curr[key] = value;\n };\n clear();\n return {\n clear,\n has: key => has(curr, key) || has(prev, key),\n get: key => has(curr, key) ? curr[key] : has(prev, key) ? update(key, prev[key]) : undefined,\n set: (key, value) => has(curr, key) ? curr[key] = value : update(key, value)\n };\n}\n\nfunction merge (compare, array0, array1, output) {\n const n0 = array0.length,\n n1 = array1.length;\n if (!n1) return array0;\n if (!n0) return array1;\n const merged = output || new array0.constructor(n0 + n1);\n let i0 = 0,\n i1 = 0,\n i = 0;\n for (; i0 < n0 && i1 < n1; ++i) {\n merged[i] = compare(array0[i0], array1[i1]) > 0 ? array1[i1++] : array0[i0++];\n }\n for (; i0 < n0; ++i0, ++i) {\n merged[i] = array0[i0];\n }\n for (; i1 < n1; ++i1, ++i) {\n merged[i] = array1[i1];\n }\n return merged;\n}\n\nfunction repeat (str, reps) {\n let s = '';\n while (--reps >= 0) s += str;\n return s;\n}\n\nfunction pad (str, length, padchar, align) {\n const c = padchar || ' ',\n s = str + '',\n n = length - s.length;\n return n <= 0 ? s : align === 'left' ? repeat(c, n) + s : align === 'center' ? repeat(c, ~~(n / 2)) + s + repeat(c, Math.ceil(n / 2)) : s + repeat(c, n);\n}\n\n/**\n * Return the numerical span of an array: the difference between\n * the last and first values.\n */\nfunction span (array) {\n return array && peek(array) - array[0] || 0;\n}\n\nfunction $(x) {\n return isArray(x) ? '[' + x.map($) + ']' : isObject(x) || isString(x) ?\n // Output valid JSON and JS source strings.\n // See http://timelessrepo.com/json-isnt-a-javascript-subset\n JSON.stringify(x).replace('\\u2028', '\\\\u2028').replace('\\u2029', '\\\\u2029') : x;\n}\n\nfunction toBoolean (_) {\n return _ == null || _ === '' ? null : !_ || _ === 'false' || _ === '0' ? false : !!_;\n}\n\nconst defaultParser = _ => isNumber(_) ? _ : isDate(_) ? _ : Date.parse(_);\nfunction toDate (_, parser) {\n parser = parser || defaultParser;\n return _ == null || _ === '' ? null : parser(_);\n}\n\nfunction toString (_) {\n return _ == null || _ === '' ? null : _ + '';\n}\n\nfunction toSet (_) {\n const s = {},\n n = _.length;\n for (let i = 0; i < n; ++i) s[_[i]] = true;\n return s;\n}\n\nfunction truncate (str, length, align, ellipsis) {\n const e = ellipsis != null ? ellipsis : '\\u2026',\n s = str + '',\n n = s.length,\n l = Math.max(0, length - e.length);\n return n <= length ? s : align === 'left' ? e + s.slice(n - l) : align === 'center' ? s.slice(0, Math.ceil(l / 2)) + e + s.slice(n - ~~(l / 2)) : s.slice(0, l) + e;\n}\n\nfunction visitArray (array, filter, visitor) {\n if (array) {\n if (filter) {\n const n = array.length;\n for (let i = 0; i < n; ++i) {\n const t = filter(array[i]);\n if (t) visitor(t, i, array);\n }\n } else {\n array.forEach(visitor);\n }\n }\n}\n\nexport { Debug, Error$1 as Error, Info, None, Warn, accessor, accessorFields, accessorName, array, ascending, clampRange, compare, constant, debounce, error, extend, extent, extentIndex, falsy, fastmap, field, flush, has as hasOwnProperty, id, identity, inherits, inrange, isArray, isBoolean, isDate, isFunction, isIterable, isNumber, isObject, isRegExp, isString, key, lerp, logger, lruCache, merge, mergeConfig, one, pad, panLinear, panLog, panPow, panSymlog, peek, quarter, repeat, span, splitAccessPath, $ as stringValue, toBoolean, toDate, toNumber, toSet, toString, truncate, truthy, utcquarter, visitArray, writeConfig, zero, zoomLinear, zoomLog, zoomPow, zoomSymlog };\n","var EOL = {},\n EOF = {},\n QUOTE = 34,\n NEWLINE = 10,\n RETURN = 13;\n\nfunction objectConverter(columns) {\n return new Function(\"d\", \"return {\" + columns.map(function(name, i) {\n return JSON.stringify(name) + \": d[\" + i + \"] || \\\"\\\"\";\n }).join(\",\") + \"}\");\n}\n\nfunction customConverter(columns, f) {\n var object = objectConverter(columns);\n return function(row, i) {\n return f(object(row), i, columns);\n };\n}\n\n// Compute unique columns in order of discovery.\nfunction inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}\n\nfunction pad(value, width) {\n var s = value + \"\", length = s.length;\n return length < width ? new Array(width - length + 1).join(0) + s : s;\n}\n\nfunction formatYear(year) {\n return year < 0 ? \"-\" + pad(-year, 6)\n : year > 9999 ? \"+\" + pad(year, 6)\n : pad(year, 4);\n}\n\nfunction formatDate(date) {\n var hours = date.getUTCHours(),\n minutes = date.getUTCMinutes(),\n seconds = date.getUTCSeconds(),\n milliseconds = date.getUTCMilliseconds();\n return isNaN(date) ? \"Invalid Date\"\n : formatYear(date.getUTCFullYear(), 4) + \"-\" + pad(date.getUTCMonth() + 1, 2) + \"-\" + pad(date.getUTCDate(), 2)\n + (milliseconds ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \":\" + pad(seconds, 2) + \".\" + pad(milliseconds, 3) + \"Z\"\n : seconds ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \":\" + pad(seconds, 2) + \"Z\"\n : minutes || hours ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \"Z\"\n : \"\");\n}\n\nexport default function(delimiter) {\n var reFormat = new RegExp(\"[\\\"\" + delimiter + \"\\n\\r]\"),\n DELIMITER = delimiter.charCodeAt(0);\n\n function parse(text, f) {\n var convert, columns, rows = parseRows(text, function(row, i) {\n if (convert) return convert(row, i - 1);\n columns = row, convert = f ? customConverter(row, f) : objectConverter(row);\n });\n rows.columns = columns || [];\n return rows;\n }\n\n function parseRows(text, f) {\n var rows = [], // output rows\n N = text.length,\n I = 0, // current character index\n n = 0, // current line number\n t, // current token\n eof = N <= 0, // current token followed by EOF?\n eol = false; // current token followed by EOL?\n\n // Strip the trailing newline.\n if (text.charCodeAt(N - 1) === NEWLINE) --N;\n if (text.charCodeAt(N - 1) === RETURN) --N;\n\n function token() {\n if (eof) return EOF;\n if (eol) return eol = false, EOL;\n\n // Unescape quotes.\n var i, j = I, c;\n if (text.charCodeAt(j) === QUOTE) {\n while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE);\n if ((i = I) >= N) eof = true;\n else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true;\n else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }\n return text.slice(j + 1, i - 1).replace(/\"\"/g, \"\\\"\");\n }\n\n // Find next delimiter or newline.\n while (I < N) {\n if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true;\n else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }\n else if (c !== DELIMITER) continue;\n return text.slice(j, i);\n }\n\n // Return last token before EOF.\n return eof = true, text.slice(j, N);\n }\n\n while ((t = token()) !== EOF) {\n var row = [];\n while (t !== EOL && t !== EOF) row.push(t), t = token();\n if (f && (row = f(row, n++)) == null) continue;\n rows.push(row);\n }\n\n return rows;\n }\n\n function preformatBody(rows, columns) {\n return rows.map(function(row) {\n return columns.map(function(column) {\n return formatValue(row[column]);\n }).join(delimiter);\n });\n }\n\n function format(rows, columns) {\n if (columns == null) columns = inferColumns(rows);\n return [columns.map(formatValue).join(delimiter)].concat(preformatBody(rows, columns)).join(\"\\n\");\n }\n\n function formatBody(rows, columns) {\n if (columns == null) columns = inferColumns(rows);\n return preformatBody(rows, columns).join(\"\\n\");\n }\n\n function formatRows(rows) {\n return rows.map(formatRow).join(\"\\n\");\n }\n\n function formatRow(row) {\n return row.map(formatValue).join(delimiter);\n }\n\n function formatValue(value) {\n return value == null ? \"\"\n : value instanceof Date ? formatDate(value)\n : reFormat.test(value += \"\") ? \"\\\"\" + value.replace(/\"/g, \"\\\"\\\"\") + \"\\\"\"\n : value;\n }\n\n return {\n parse: parse,\n parseRows: parseRows,\n format: format,\n formatBody: formatBody,\n formatRows: formatRows,\n formatRow: formatRow,\n formatValue: formatValue\n };\n}\n","export default function(x) {\n return x;\n}\n","import reverse from \"./reverse.js\";\nimport transform from \"./transform.js\";\n\nexport default function(topology, o) {\n if (typeof o === \"string\") o = topology.objects[o];\n return o.type === \"GeometryCollection\"\n ? {type: \"FeatureCollection\", features: o.geometries.map(function(o) { return feature(topology, o); })}\n : feature(topology, o);\n}\n\nfunction feature(topology, o) {\n var id = o.id,\n bbox = o.bbox,\n properties = o.properties == null ? {} : o.properties,\n geometry = object(topology, o);\n return id == null && bbox == null ? {type: \"Feature\", properties: properties, geometry: geometry}\n : bbox == null ? {type: \"Feature\", id: id, properties: properties, geometry: geometry}\n : {type: \"Feature\", id: id, bbox: bbox, properties: properties, geometry: geometry};\n}\n\nexport function object(topology, o) {\n var transformPoint = transform(topology.transform),\n arcs = topology.arcs;\n\n function arc(i, points) {\n if (points.length) points.pop();\n for (var a = arcs[i < 0 ? ~i : i], k = 0, n = a.length; k < n; ++k) {\n points.push(transformPoint(a[k], k));\n }\n if (i < 0) reverse(points, n);\n }\n\n function point(p) {\n return transformPoint(p);\n }\n\n function line(arcs) {\n var points = [];\n for (var i = 0, n = arcs.length; i < n; ++i) arc(arcs[i], points);\n if (points.length < 2) points.push(points[0]); // This should never happen per the specification.\n return points;\n }\n\n function ring(arcs) {\n var points = line(arcs);\n while (points.length < 4) points.push(points[0]); // This may happen if an arc has only two points.\n return points;\n }\n\n function polygon(arcs) {\n return arcs.map(ring);\n }\n\n function geometry(o) {\n var type = o.type, coordinates;\n switch (type) {\n case \"GeometryCollection\": return {type: type, geometries: o.geometries.map(geometry)};\n case \"Point\": coordinates = point(o.coordinates); break;\n case \"MultiPoint\": coordinates = o.coordinates.map(point); break;\n case \"LineString\": coordinates = line(o.arcs); break;\n case \"MultiLineString\": coordinates = o.arcs.map(line); break;\n case \"Polygon\": coordinates = polygon(o.arcs); break;\n case \"MultiPolygon\": coordinates = o.arcs.map(polygon); break;\n default: return null;\n }\n return {type: type, coordinates: coordinates};\n }\n\n return geometry(o);\n}\n","import identity from \"./identity.js\";\n\nexport default function(transform) {\n if (transform == null) return identity;\n var x0,\n y0,\n kx = transform.scale[0],\n ky = transform.scale[1],\n dx = transform.translate[0],\n dy = transform.translate[1];\n return function(input, i) {\n if (!i) x0 = y0 = 0;\n var j = 2, n = input.length, output = new Array(n);\n output[0] = (x0 += input[0]) * kx + dx;\n output[1] = (y0 += input[1]) * ky + dy;\n while (j < n) output[j] = input[j], ++j;\n return output;\n };\n}\n","export default function(array, n) {\n var t, j = array.length, i = j - n;\n while (i < --j) t = array[i], array[i++] = array[j], array[j] = t;\n}\n","export default function(topology, arcs) {\n var stitchedArcs = {},\n fragmentByStart = {},\n fragmentByEnd = {},\n fragments = [],\n emptyIndex = -1;\n\n // Stitch empty arcs first, since they may be subsumed by other arcs.\n arcs.forEach(function(i, j) {\n var arc = topology.arcs[i < 0 ? ~i : i], t;\n if (arc.length < 3 && !arc[1][0] && !arc[1][1]) {\n t = arcs[++emptyIndex], arcs[emptyIndex] = i, arcs[j] = t;\n }\n });\n\n arcs.forEach(function(i) {\n var e = ends(i),\n start = e[0],\n end = e[1],\n f, g;\n\n if (f = fragmentByEnd[start]) {\n delete fragmentByEnd[f.end];\n f.push(i);\n f.end = end;\n if (g = fragmentByStart[end]) {\n delete fragmentByStart[g.start];\n var fg = g === f ? f : f.concat(g);\n fragmentByStart[fg.start = f.start] = fragmentByEnd[fg.end = g.end] = fg;\n } else {\n fragmentByStart[f.start] = fragmentByEnd[f.end] = f;\n }\n } else if (f = fragmentByStart[end]) {\n delete fragmentByStart[f.start];\n f.unshift(i);\n f.start = start;\n if (g = fragmentByEnd[start]) {\n delete fragmentByEnd[g.end];\n var gf = g === f ? f : g.concat(f);\n fragmentByStart[gf.start = g.start] = fragmentByEnd[gf.end = f.end] = gf;\n } else {\n fragmentByStart[f.start] = fragmentByEnd[f.end] = f;\n }\n } else {\n f = [i];\n fragmentByStart[f.start = start] = fragmentByEnd[f.end = end] = f;\n }\n });\n\n function ends(i) {\n var arc = topology.arcs[i < 0 ? ~i : i], p0 = arc[0], p1;\n if (topology.transform) p1 = [0, 0], arc.forEach(function(dp) { p1[0] += dp[0], p1[1] += dp[1]; });\n else p1 = arc[arc.length - 1];\n return i < 0 ? [p1, p0] : [p0, p1];\n }\n\n function flush(fragmentByEnd, fragmentByStart) {\n for (var k in fragmentByEnd) {\n var f = fragmentByEnd[k];\n delete fragmentByStart[f.start];\n delete f.start;\n delete f.end;\n f.forEach(function(i) { stitchedArcs[i < 0 ? ~i : i] = 1; });\n fragments.push(f);\n }\n }\n\n flush(fragmentByEnd, fragmentByStart);\n flush(fragmentByStart, fragmentByEnd);\n arcs.forEach(function(i) { if (!stitchedArcs[i < 0 ? ~i : i]) fragments.push([i]); });\n\n return fragments;\n}\n","import {object} from \"./feature.js\";\nimport stitch from \"./stitch.js\";\n\nexport default function(topology) {\n return object(topology, meshArcs.apply(this, arguments));\n}\n\nexport function meshArcs(topology, object, filter) {\n var arcs, i, n;\n if (arguments.length > 1) arcs = extractArcs(topology, object, filter);\n else for (i = 0, arcs = new Array(n = topology.arcs.length); i < n; ++i) arcs[i] = i;\n return {type: \"MultiLineString\", arcs: stitch(topology, arcs)};\n}\n\nfunction extractArcs(topology, object, filter) {\n var arcs = [],\n geomsByArc = [],\n geom;\n\n function extract0(i) {\n var j = i < 0 ? ~i : i;\n (geomsByArc[j] || (geomsByArc[j] = [])).push({i: i, g: geom});\n }\n\n function extract1(arcs) {\n arcs.forEach(extract0);\n }\n\n function extract2(arcs) {\n arcs.forEach(extract1);\n }\n\n function extract3(arcs) {\n arcs.forEach(extract2);\n }\n\n function geometry(o) {\n switch (geom = o, o.type) {\n case \"GeometryCollection\": o.geometries.forEach(geometry); break;\n case \"LineString\": extract1(o.arcs); break;\n case \"MultiLineString\": case \"Polygon\": extract2(o.arcs); break;\n case \"MultiPolygon\": extract3(o.arcs); break;\n }\n }\n\n geometry(object);\n\n geomsByArc.forEach(filter == null\n ? function(geoms) { arcs.push(geoms[0].i); }\n : function(geoms) { if (filter(geoms[0].g, geoms[geoms.length - 1].g)) arcs.push(geoms[0].i); });\n\n return arcs;\n}\n","const e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n const step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log10(step)),\n error = step / Math.pow(10, power),\n factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n let i1, i2, inc;\n if (power < 0) {\n inc = Math.pow(10, -power) / factor;\n i1 = Math.round(start * inc);\n i2 = Math.round(stop * inc);\n if (i1 / inc < start) ++i1;\n if (i2 / inc > stop) --i2;\n inc = -inc;\n } else {\n inc = Math.pow(10, power) * factor;\n i1 = Math.round(start / inc);\n i2 = Math.round(stop / inc);\n if (i1 * inc < start) ++i1;\n if (i2 * inc > stop) --i2;\n }\n if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n if (!(count > 0)) return [];\n if (start === stop) return [start];\n const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n if (!(i2 >= i1)) return [];\n const n = i2 - i1 + 1, ticks = new Array(n);\n if (reverse) {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n } else {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n }\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n","// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n","export default function(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n","import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": (x, p) => (x * 100).toFixed(p),\n \"b\": (x) => Math.round(x).toString(2),\n \"c\": (x) => x + \"\",\n \"d\": formatDecimal,\n \"e\": (x, p) => x.toExponential(p),\n \"f\": (x, p) => x.toFixed(p),\n \"g\": (x, p) => x.toPrecision(p),\n \"o\": (x) => Math.round(x).toString(8),\n \"p\": (x, p) => formatRounded(x * 100, p),\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n \"x\": (x) => Math.round(x).toString(16)\n};\n","export default function(x) {\n return x;\n}\n","import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"−\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n","export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n","export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n","// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n","const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = (date) => {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = (date) => {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = (date) => {\n const d0 = interval(date), d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = (date, step) => {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = (start, stop, step) => {\n const range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n let previous;\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = (test) => {\n return timeInterval((date) => {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, (date, step) => {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = (start, end) => {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = (step) => {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? (d) => field(d) % step === 0\n : (d) => interval.count(0, d) % step === 0);\n };\n }\n\n return interval;\n}\n","export const durationSecond = 1000;\nexport const durationMinute = durationSecond * 60;\nexport const durationHour = durationMinute * 60;\nexport const durationDay = durationHour * 24;\nexport const durationWeek = durationDay * 7;\nexport const durationMonth = durationDay * 30;\nexport const durationYear = durationDay * 365;\n","import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n return timeInterval((date) => {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setDate(date.getDate() + step * 7);\n }, (start, end) => {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n return timeInterval((date) => {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, (start, end) => {\n return (end - start) / durationWeek;\n });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n return end.getFullYear() - start.getFullYear();\n}, (date) => {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport const utcYears = utcYear.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n return (end - start) / durationSecond;\n}, (date) => {\n return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const millisecond = timeInterval(() => {\n // noop\n}, (date, step) => {\n date.setTime(+date + step);\n}, (start, end) => {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = (k) => {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return timeInterval((date) => {\n date.setTime(Math.floor(date / k) * k);\n }, (date, step) => {\n date.setTime(+date + step * k);\n }, (start, end) => {\n return (end - start) / k;\n });\n};\n\nexport const milliseconds = millisecond.range;\n","export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n","import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can’t do this\n // for a comparator (except for specific, known comparators) because we can’t\n // tell if the comparator is symmetric, and an asymmetric comparator can’t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n","import { array, error, hasOwnProperty, extend, peek, toSet, constant, zero, one, span } from 'vega-util';\nimport { timeDay, timeWeek, utcDay, utcWeek, timeYear, timeMonth, timeHour, timeMinute, timeSecond, timeMillisecond, utcYear, utcMonth, utcHour, utcMinute, utcSecond, utcMillisecond } from 'd3-time';\nimport { bisector, tickStep } from 'd3-array';\n\nconst YEAR = 'year';\nconst QUARTER = 'quarter';\nconst MONTH = 'month';\nconst WEEK = 'week';\nconst DATE = 'date';\nconst DAY = 'day';\nconst DAYOFYEAR = 'dayofyear';\nconst HOURS = 'hours';\nconst MINUTES = 'minutes';\nconst SECONDS = 'seconds';\nconst MILLISECONDS = 'milliseconds';\nconst TIME_UNITS = [YEAR, QUARTER, MONTH, WEEK, DATE, DAY, DAYOFYEAR, HOURS, MINUTES, SECONDS, MILLISECONDS];\nconst UNITS = TIME_UNITS.reduce((o, u, i) => (o[u] = 1 + i, o), {});\nfunction timeUnits(units) {\n const u = array(units).slice(),\n m = {};\n\n // check validity\n if (!u.length) error('Missing time unit.');\n u.forEach(unit => {\n if (hasOwnProperty(UNITS, unit)) {\n m[unit] = 1;\n } else {\n error(`Invalid time unit: ${unit}.`);\n }\n });\n const numTypes = (m[WEEK] || m[DAY] ? 1 : 0) + (m[QUARTER] || m[MONTH] || m[DATE] ? 1 : 0) + (m[DAYOFYEAR] ? 1 : 0);\n if (numTypes > 1) {\n error(`Incompatible time units: ${units}`);\n }\n\n // ensure proper sort order\n u.sort((a, b) => UNITS[a] - UNITS[b]);\n return u;\n}\nconst defaultSpecifiers = {\n [YEAR]: '%Y ',\n [QUARTER]: 'Q%q ',\n [MONTH]: '%b ',\n [DATE]: '%d ',\n [WEEK]: 'W%U ',\n [DAY]: '%a ',\n [DAYOFYEAR]: '%j ',\n [HOURS]: '%H:00',\n [MINUTES]: '00:%M',\n [SECONDS]: ':%S',\n [MILLISECONDS]: '.%L',\n [`${YEAR}-${MONTH}`]: '%Y-%m ',\n [`${YEAR}-${MONTH}-${DATE}`]: '%Y-%m-%d ',\n [`${HOURS}-${MINUTES}`]: '%H:%M'\n};\nfunction timeUnitSpecifier(units, specifiers) {\n const s = extend({}, defaultSpecifiers, specifiers),\n u = timeUnits(units),\n n = u.length;\n let fmt = '',\n start = 0,\n end,\n key;\n for (start = 0; start < n;) {\n for (end = u.length; end > start; --end) {\n key = u.slice(start, end).join('-');\n if (s[key] != null) {\n fmt += s[key];\n start = end;\n break;\n }\n }\n }\n return fmt.trim();\n}\n\nconst t0 = new Date();\nfunction localYear(y) {\n t0.setFullYear(y);\n t0.setMonth(0);\n t0.setDate(1);\n t0.setHours(0, 0, 0, 0);\n return t0;\n}\nfunction dayofyear(d) {\n return localDayOfYear(new Date(d));\n}\nfunction week(d) {\n return localWeekNum(new Date(d));\n}\nfunction localDayOfYear(d) {\n return timeDay.count(localYear(d.getFullYear()) - 1, d);\n}\nfunction localWeekNum(d) {\n return timeWeek.count(localYear(d.getFullYear()) - 1, d);\n}\nfunction localFirst(y) {\n return localYear(y).getDay();\n}\nfunction localDate(y, m, d, H, M, S, L) {\n if (0 <= y && y < 100) {\n const date = new Date(-1, m, d, H, M, S, L);\n date.setFullYear(y);\n return date;\n }\n return new Date(y, m, d, H, M, S, L);\n}\nfunction utcdayofyear(d) {\n return utcDayOfYear(new Date(d));\n}\nfunction utcweek(d) {\n return utcWeekNum(new Date(d));\n}\nfunction utcDayOfYear(d) {\n const y = Date.UTC(d.getUTCFullYear(), 0, 1);\n return utcDay.count(y - 1, d);\n}\nfunction utcWeekNum(d) {\n const y = Date.UTC(d.getUTCFullYear(), 0, 1);\n return utcWeek.count(y - 1, d);\n}\nfunction utcFirst(y) {\n t0.setTime(Date.UTC(y, 0, 1));\n return t0.getUTCDay();\n}\nfunction utcDate(y, m, d, H, M, S, L) {\n if (0 <= y && y < 100) {\n const date = new Date(Date.UTC(-1, m, d, H, M, S, L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(y, m, d, H, M, S, L));\n}\n\nfunction floor(units, step, get, inv, newDate) {\n const s = step || 1,\n b = peek(units),\n _ = (unit, p, key) => {\n key = key || unit;\n return getUnit(get[key], inv[key], unit === b && s, p);\n };\n const t = new Date(),\n u = toSet(units),\n y = u[YEAR] ? _(YEAR) : constant(2012),\n m = u[MONTH] ? _(MONTH) : u[QUARTER] ? _(QUARTER) : zero,\n d = u[WEEK] && u[DAY] ? _(DAY, 1, WEEK + DAY) : u[WEEK] ? _(WEEK, 1) : u[DAY] ? _(DAY, 1) : u[DATE] ? _(DATE, 1) : u[DAYOFYEAR] ? _(DAYOFYEAR, 1) : one,\n H = u[HOURS] ? _(HOURS) : zero,\n M = u[MINUTES] ? _(MINUTES) : zero,\n S = u[SECONDS] ? _(SECONDS) : zero,\n L = u[MILLISECONDS] ? _(MILLISECONDS) : zero;\n return function (v) {\n t.setTime(+v);\n const year = y(t);\n return newDate(year, m(t), d(t, year), H(t), M(t), S(t), L(t));\n };\n}\nfunction getUnit(f, inv, step, phase) {\n const u = step <= 1 ? f : phase ? (d, y) => phase + step * Math.floor((f(d, y) - phase) / step) : (d, y) => step * Math.floor(f(d, y) / step);\n return inv ? (d, y) => inv(u(d, y), y) : u;\n}\n\n// returns the day of the year based on week number, day of week,\n// and the day of the week for the first day of the year\nfunction weekday(week, day, firstDay) {\n return day + week * 7 - (firstDay + 6) % 7;\n}\n\n// -- LOCAL TIME --\n\nconst localGet = {\n [YEAR]: d => d.getFullYear(),\n [QUARTER]: d => Math.floor(d.getMonth() / 3),\n [MONTH]: d => d.getMonth(),\n [DATE]: d => d.getDate(),\n [HOURS]: d => d.getHours(),\n [MINUTES]: d => d.getMinutes(),\n [SECONDS]: d => d.getSeconds(),\n [MILLISECONDS]: d => d.getMilliseconds(),\n [DAYOFYEAR]: d => localDayOfYear(d),\n [WEEK]: d => localWeekNum(d),\n [WEEK + DAY]: (d, y) => weekday(localWeekNum(d), d.getDay(), localFirst(y)),\n [DAY]: (d, y) => weekday(1, d.getDay(), localFirst(y))\n};\nconst localInv = {\n [QUARTER]: q => 3 * q,\n [WEEK]: (w, y) => weekday(w, 0, localFirst(y))\n};\nfunction timeFloor(units, step) {\n return floor(units, step || 1, localGet, localInv, localDate);\n}\n\n// -- UTC TIME --\n\nconst utcGet = {\n [YEAR]: d => d.getUTCFullYear(),\n [QUARTER]: d => Math.floor(d.getUTCMonth() / 3),\n [MONTH]: d => d.getUTCMonth(),\n [DATE]: d => d.getUTCDate(),\n [HOURS]: d => d.getUTCHours(),\n [MINUTES]: d => d.getUTCMinutes(),\n [SECONDS]: d => d.getUTCSeconds(),\n [MILLISECONDS]: d => d.getUTCMilliseconds(),\n [DAYOFYEAR]: d => utcDayOfYear(d),\n [WEEK]: d => utcWeekNum(d),\n [DAY]: (d, y) => weekday(1, d.getUTCDay(), utcFirst(y)),\n [WEEK + DAY]: (d, y) => weekday(utcWeekNum(d), d.getUTCDay(), utcFirst(y))\n};\nconst utcInv = {\n [QUARTER]: q => 3 * q,\n [WEEK]: (w, y) => weekday(w, 0, utcFirst(y))\n};\nfunction utcFloor(units, step) {\n return floor(units, step || 1, utcGet, utcInv, utcDate);\n}\n\nconst timeIntervals = {\n [YEAR]: timeYear,\n [QUARTER]: timeMonth.every(3),\n [MONTH]: timeMonth,\n [WEEK]: timeWeek,\n [DATE]: timeDay,\n [DAY]: timeDay,\n [DAYOFYEAR]: timeDay,\n [HOURS]: timeHour,\n [MINUTES]: timeMinute,\n [SECONDS]: timeSecond,\n [MILLISECONDS]: timeMillisecond\n};\nconst utcIntervals = {\n [YEAR]: utcYear,\n [QUARTER]: utcMonth.every(3),\n [MONTH]: utcMonth,\n [WEEK]: utcWeek,\n [DATE]: utcDay,\n [DAY]: utcDay,\n [DAYOFYEAR]: utcDay,\n [HOURS]: utcHour,\n [MINUTES]: utcMinute,\n [SECONDS]: utcSecond,\n [MILLISECONDS]: utcMillisecond\n};\nfunction timeInterval(unit) {\n return timeIntervals[unit];\n}\nfunction utcInterval(unit) {\n return utcIntervals[unit];\n}\nfunction offset(ival, date, step) {\n return ival ? ival.offset(date, step) : undefined;\n}\nfunction timeOffset(unit, date, step) {\n return offset(timeInterval(unit), date, step);\n}\nfunction utcOffset(unit, date, step) {\n return offset(utcInterval(unit), date, step);\n}\nfunction sequence(ival, start, stop, step) {\n return ival ? ival.range(start, stop, step) : undefined;\n}\nfunction timeSequence(unit, start, stop, step) {\n return sequence(timeInterval(unit), start, stop, step);\n}\nfunction utcSequence(unit, start, stop, step) {\n return sequence(utcInterval(unit), start, stop, step);\n}\n\nconst durationSecond = 1000,\n durationMinute = durationSecond * 60,\n durationHour = durationMinute * 60,\n durationDay = durationHour * 24,\n durationWeek = durationDay * 7,\n durationMonth = durationDay * 30,\n durationYear = durationDay * 365;\nconst Milli = [YEAR, MONTH, DATE, HOURS, MINUTES, SECONDS, MILLISECONDS],\n Seconds = Milli.slice(0, -1),\n Minutes = Seconds.slice(0, -1),\n Hours = Minutes.slice(0, -1),\n Day = Hours.slice(0, -1),\n Week = [YEAR, WEEK],\n Month = [YEAR, MONTH],\n Year = [YEAR];\nconst intervals = [[Seconds, 1, durationSecond], [Seconds, 5, 5 * durationSecond], [Seconds, 15, 15 * durationSecond], [Seconds, 30, 30 * durationSecond], [Minutes, 1, durationMinute], [Minutes, 5, 5 * durationMinute], [Minutes, 15, 15 * durationMinute], [Minutes, 30, 30 * durationMinute], [Hours, 1, durationHour], [Hours, 3, 3 * durationHour], [Hours, 6, 6 * durationHour], [Hours, 12, 12 * durationHour], [Day, 1, durationDay], [Week, 1, durationWeek], [Month, 1, durationMonth], [Month, 3, 3 * durationMonth], [Year, 1, durationYear]];\nfunction bin (opt) {\n const ext = opt.extent,\n max = opt.maxbins || 40,\n target = Math.abs(span(ext)) / max;\n let i = bisector(i => i[2]).right(intervals, target),\n units,\n step;\n if (i === intervals.length) {\n units = Year, step = tickStep(ext[0] / durationYear, ext[1] / durationYear, max);\n } else if (i) {\n i = intervals[target / intervals[i - 1][2] < intervals[i][2] / target ? i - 1 : i];\n units = i[0];\n step = i[1];\n } else {\n units = Milli;\n step = Math.max(tickStep(ext[0], ext[1], max), 1);\n }\n return {\n units,\n step\n };\n}\n\nexport { DATE, DAY, DAYOFYEAR, HOURS, MILLISECONDS, MINUTES, MONTH, QUARTER, SECONDS, TIME_UNITS, WEEK, YEAR, dayofyear, bin as timeBin, timeFloor, timeInterval, timeOffset, timeSequence, timeUnitSpecifier, timeUnits, utcFloor, utcInterval, utcOffset, utcSequence, utcdayofyear, utcweek, week };\n","import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n return new Map(names.map((name, i) => [name.toLowerCase(), i]));\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n","import { tickStep } from 'd3-array';\nimport { formatLocale, formatSpecifier, precisionFixed, precisionRound, precisionPrefix, format, formatPrefix } from 'd3-format';\nimport { SECONDS, MINUTES, HOURS, DATE, WEEK, MONTH, QUARTER, YEAR, MILLISECONDS, DAY, timeInterval, utcInterval } from 'vega-time';\nimport { isString, isObject, error, extend } from 'vega-util';\nimport { timeFormatLocale as timeFormatLocale$1, timeFormat, timeParse, utcFormat, utcParse } from 'd3-time-format';\n\nfunction memoize (method) {\n const cache = {};\n return spec => cache[spec] || (cache[spec] = method(spec));\n}\n\nfunction trimZeroes(numberFormat, decimalChar) {\n return x => {\n const str = numberFormat(x),\n dec = str.indexOf(decimalChar);\n if (dec < 0) return str;\n let idx = rightmostDigit(str, dec);\n const end = idx < str.length ? str.slice(idx) : '';\n while (--idx > dec) if (str[idx] !== '0') {\n ++idx;\n break;\n }\n return str.slice(0, idx) + end;\n };\n}\nfunction rightmostDigit(str, dec) {\n let i = str.lastIndexOf('e'),\n c;\n if (i > 0) return i;\n for (i = str.length; --i > dec;) {\n c = str.charCodeAt(i);\n if (c >= 48 && c <= 57) return i + 1; // is digit\n }\n}\nfunction numberLocale(locale) {\n const format = memoize(locale.format),\n formatPrefix = locale.formatPrefix;\n return {\n format,\n formatPrefix,\n formatFloat(spec) {\n const s = formatSpecifier(spec || ',');\n if (s.precision == null) {\n s.precision = 12;\n switch (s.type) {\n case '%':\n s.precision -= 2;\n break;\n case 'e':\n s.precision -= 1;\n break;\n }\n return trimZeroes(format(s),\n // number format\n format('.1f')(1)[1] // decimal point character\n );\n } else {\n return format(s);\n }\n },\n formatSpan(start, stop, count, specifier) {\n specifier = formatSpecifier(specifier == null ? ',f' : specifier);\n const step = tickStep(start, stop, count),\n value = Math.max(Math.abs(start), Math.abs(stop));\n let precision;\n if (specifier.precision == null) {\n switch (specifier.type) {\n case 's':\n {\n if (!isNaN(precision = precisionPrefix(step, value))) {\n specifier.precision = precision;\n }\n return formatPrefix(specifier, value);\n }\n case '':\n case 'e':\n case 'g':\n case 'p':\n case 'r':\n {\n if (!isNaN(precision = precisionRound(step, value))) {\n specifier.precision = precision - (specifier.type === 'e');\n }\n break;\n }\n case 'f':\n case '%':\n {\n if (!isNaN(precision = precisionFixed(step))) {\n specifier.precision = precision - (specifier.type === '%') * 2;\n }\n break;\n }\n }\n }\n return format(specifier);\n }\n };\n}\nlet defaultNumberLocale;\nresetNumberFormatDefaultLocale();\nfunction resetNumberFormatDefaultLocale() {\n return defaultNumberLocale = numberLocale({\n format: format,\n formatPrefix: formatPrefix\n });\n}\nfunction numberFormatLocale(definition) {\n return numberLocale(formatLocale(definition));\n}\nfunction numberFormatDefaultLocale(definition) {\n return arguments.length ? defaultNumberLocale = numberFormatLocale(definition) : defaultNumberLocale;\n}\n\nfunction timeMultiFormat(format, interval, spec) {\n spec = spec || {};\n if (!isObject(spec)) {\n error(`Invalid time multi-format specifier: ${spec}`);\n }\n const second = interval(SECONDS),\n minute = interval(MINUTES),\n hour = interval(HOURS),\n day = interval(DATE),\n week = interval(WEEK),\n month = interval(MONTH),\n quarter = interval(QUARTER),\n year = interval(YEAR),\n L = format(spec[MILLISECONDS] || '.%L'),\n S = format(spec[SECONDS] || ':%S'),\n M = format(spec[MINUTES] || '%I:%M'),\n H = format(spec[HOURS] || '%I %p'),\n d = format(spec[DATE] || spec[DAY] || '%a %d'),\n w = format(spec[WEEK] || '%b %d'),\n m = format(spec[MONTH] || '%B'),\n q = format(spec[QUARTER] || '%B'),\n y = format(spec[YEAR] || '%Y');\n return date => (second(date) < date ? L : minute(date) < date ? S : hour(date) < date ? M : day(date) < date ? H : month(date) < date ? week(date) < date ? d : w : year(date) < date ? quarter(date) < date ? m : q : y)(date);\n}\nfunction timeLocale(locale) {\n const timeFormat = memoize(locale.format),\n utcFormat = memoize(locale.utcFormat);\n return {\n timeFormat: spec => isString(spec) ? timeFormat(spec) : timeMultiFormat(timeFormat, timeInterval, spec),\n utcFormat: spec => isString(spec) ? utcFormat(spec) : timeMultiFormat(utcFormat, utcInterval, spec),\n timeParse: memoize(locale.parse),\n utcParse: memoize(locale.utcParse)\n };\n}\nlet defaultTimeLocale;\nresetTimeFormatDefaultLocale();\nfunction resetTimeFormatDefaultLocale() {\n return defaultTimeLocale = timeLocale({\n format: timeFormat,\n parse: timeParse,\n utcFormat: utcFormat,\n utcParse: utcParse\n });\n}\nfunction timeFormatLocale(definition) {\n return timeLocale(timeFormatLocale$1(definition));\n}\nfunction timeFormatDefaultLocale(definition) {\n return arguments.length ? defaultTimeLocale = timeFormatLocale(definition) : defaultTimeLocale;\n}\n\nconst createLocale = (number, time) => extend({}, number, time);\nfunction locale(numberSpec, timeSpec) {\n const number = numberSpec ? numberFormatLocale(numberSpec) : numberFormatDefaultLocale();\n const time = timeSpec ? timeFormatLocale(timeSpec) : timeFormatDefaultLocale();\n return createLocale(number, time);\n}\nfunction defaultLocale(numberSpec, timeSpec) {\n const args = arguments.length;\n if (args && args !== 2) {\n error('defaultLocale expects either zero or two arguments.');\n }\n return args ? createLocale(numberFormatDefaultLocale(numberSpec), timeFormatDefaultLocale(timeSpec)) : createLocale(numberFormatDefaultLocale(), timeFormatDefaultLocale());\n}\nfunction resetDefaultLocale() {\n resetNumberFormatDefaultLocale();\n resetTimeFormatDefaultLocale();\n return defaultLocale();\n}\n\nexport { defaultLocale, locale, numberFormatDefaultLocale, numberFormatLocale, resetDefaultLocale, resetNumberFormatDefaultLocale, resetTimeFormatDefaultLocale, timeFormatDefaultLocale, timeFormatLocale };\n","import { extend, error, stringValue, isFunction, toBoolean, toNumber, toDate, toString, identity, field, isObject, isArray, isIterable, hasOwnProperty } from 'vega-util';\nimport { dsvFormat } from 'd3-dsv';\nimport { feature, mesh } from 'topojson-client';\nimport { timeFormatDefaultLocale } from 'vega-format';\n\n// Matches absolute URLs with optional protocol\n// https://... file://... //...\nconst protocol_re = /^(data:|([A-Za-z]+:)?\\/\\/)/;\n\n// Matches allowed URIs. From https://github.com/cure53/DOMPurify/blob/master/src/regexp.js with added file://\nconst allowed_re = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i; // eslint-disable-line no-useless-escape\nconst whitespace_re = /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205f\\u3000]/g; // eslint-disable-line no-control-regex\n\n// Special treatment in node.js for the file: protocol\nconst fileProtocol = 'file://';\n\n/**\n * Factory for a loader constructor that provides methods for requesting\n * files from either the network or disk, and for sanitizing request URIs.\n * @param {function} fetch - The Fetch API for HTTP network requests.\n * If null or undefined, HTTP loading will be disabled.\n * @param {object} fs - The file system interface for file loading.\n * If null or undefined, local file loading will be disabled.\n * @return {function} A loader constructor with the following signature:\n * param {object} [options] - Optional default loading options to use.\n * return {object} - A new loader instance.\n */\nfunction loaderFactory (fetch, fs) {\n return options => ({\n options: options || {},\n sanitize: sanitize,\n load: load,\n fileAccess: !!fs,\n file: fileLoader(fs),\n http: httpLoader(fetch)\n });\n}\n\n/**\n * Load an external resource, typically either from the web or from the local\n * filesystem. This function uses {@link sanitize} to first sanitize the uri,\n * then calls either {@link http} (for web requests) or {@link file} (for\n * filesystem loading).\n * @param {string} uri - The resource indicator (e.g., URL or filename).\n * @param {object} [options] - Optional loading options. These options will\n * override any existing default options.\n * @return {Promise} - A promise that resolves to the loaded content.\n */\nasync function load(uri, options) {\n const opt = await this.sanitize(uri, options),\n url = opt.href;\n return opt.localFile ? this.file(url) : this.http(url, options);\n}\n\n/**\n * URI sanitizer function.\n * @param {string} uri - The uri (url or filename) to check.\n * @param {object} options - An options hash.\n * @return {Promise} - A promise that resolves to an object containing\n * sanitized uri data, or rejects it the input uri is deemed invalid.\n * The properties of the resolved object are assumed to be\n * valid attributes for an HTML 'a' tag. The sanitized uri *must* be\n * provided by the 'href' property of the returned object.\n */\nasync function sanitize(uri, options) {\n options = extend({}, this.options, options);\n const fileAccess = this.fileAccess,\n result = {\n href: null\n };\n let isFile, loadFile, base;\n const isAllowed = allowed_re.test(uri.replace(whitespace_re, ''));\n if (uri == null || typeof uri !== 'string' || !isAllowed) {\n error('Sanitize failure, invalid URI: ' + stringValue(uri));\n }\n const hasProtocol = protocol_re.test(uri);\n\n // if relative url (no protocol/host), prepend baseURL\n if ((base = options.baseURL) && !hasProtocol) {\n // Ensure that there is a slash between the baseURL (e.g. hostname) and url\n if (!uri.startsWith('/') && !base.endsWith('/')) {\n uri = '/' + uri;\n }\n uri = base + uri;\n }\n\n // should we load from file system?\n loadFile = (isFile = uri.startsWith(fileProtocol)) || options.mode === 'file' || options.mode !== 'http' && !hasProtocol && fileAccess;\n if (isFile) {\n // strip file protocol\n uri = uri.slice(fileProtocol.length);\n } else if (uri.startsWith('//')) {\n if (options.defaultProtocol === 'file') {\n // if is file, strip protocol and set loadFile flag\n uri = uri.slice(2);\n loadFile = true;\n } else {\n // if relative protocol (starts with '//'), prepend default protocol\n uri = (options.defaultProtocol || 'http') + ':' + uri;\n }\n }\n\n // set non-enumerable mode flag to indicate local file load\n Object.defineProperty(result, 'localFile', {\n value: !!loadFile\n });\n\n // set uri\n result.href = uri;\n\n // set default result target, if specified\n if (options.target) {\n result.target = options.target + '';\n }\n\n // set default result rel, if specified (#1542)\n if (options.rel) {\n result.rel = options.rel + '';\n }\n\n // provide control over cross-origin image handling (#2238)\n // https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image\n if (options.context === 'image' && options.crossOrigin) {\n result.crossOrigin = options.crossOrigin + '';\n }\n\n // return\n return result;\n}\n\n/**\n * File system loader factory.\n * @param {object} fs - The file system interface.\n * @return {function} - A file loader with the following signature:\n * param {string} filename - The file system path to load.\n * param {string} filename - The file system path to load.\n * return {Promise} A promise that resolves to the file contents.\n */\nfunction fileLoader(fs) {\n return fs ? filename => new Promise((accept, reject) => {\n fs.readFile(filename, (error, data) => {\n if (error) reject(error);else accept(data);\n });\n }) : fileReject;\n}\n\n/**\n * Default file system loader that simply rejects.\n */\nasync function fileReject() {\n error('No file system access.');\n}\n\n/**\n * HTTP request handler factory.\n * @param {function} fetch - The Fetch API method.\n * @return {function} - An http loader with the following signature:\n * param {string} url - The url to request.\n * param {object} options - An options hash.\n * return {Promise} - A promise that resolves to the file contents.\n */\nfunction httpLoader(fetch) {\n return fetch ? async function (url, options) {\n const opt = extend({}, this.options.http, options),\n type = options && options.response,\n response = await fetch(url, opt);\n return !response.ok ? error(response.status + '' + response.statusText) : isFunction(response[type]) ? response[type]() : response.text();\n } : httpReject;\n}\n\n/**\n * Default http request handler that simply rejects.\n */\nasync function httpReject() {\n error('No HTTP fetch method available.');\n}\n\nconst isValid = _ => _ != null && _ === _;\nconst isBoolean = _ => _ === 'true' || _ === 'false' || _ === true || _ === false;\nconst isDate = _ => !Number.isNaN(Date.parse(_));\nconst isNumber = _ => !Number.isNaN(+_) && !(_ instanceof Date);\nconst isInteger = _ => isNumber(_) && Number.isInteger(+_);\nconst typeParsers = {\n boolean: toBoolean,\n integer: toNumber,\n number: toNumber,\n date: toDate,\n string: toString,\n unknown: identity\n};\nconst typeTests = [isBoolean, isInteger, isNumber, isDate];\nconst typeList = ['boolean', 'integer', 'number', 'date'];\nfunction inferType(values, field) {\n if (!values || !values.length) return 'unknown';\n const n = values.length,\n m = typeTests.length,\n a = typeTests.map((_, i) => i + 1);\n for (let i = 0, t = 0, j, value; i < n; ++i) {\n value = field ? values[i][field] : values[i];\n for (j = 0; j < m; ++j) {\n if (a[j] && isValid(value) && !typeTests[j](value)) {\n a[j] = 0;\n ++t;\n if (t === typeTests.length) return 'string';\n }\n }\n }\n return typeList[a.reduce((u, v) => u === 0 ? v : u, 0) - 1];\n}\nfunction inferTypes(data, fields) {\n return fields.reduce((types, field) => {\n types[field] = inferType(data, field);\n return types;\n }, {});\n}\n\nfunction delimitedFormat(delimiter) {\n const parse = function (data, format) {\n const delim = {\n delimiter: delimiter\n };\n return dsv(data, format ? extend(format, delim) : delim);\n };\n parse.responseType = 'text';\n return parse;\n}\nfunction dsv(data, format) {\n if (format.header) {\n data = format.header.map(stringValue).join(format.delimiter) + '\\n' + data;\n }\n return dsvFormat(format.delimiter).parse(data + '');\n}\ndsv.responseType = 'text';\n\nfunction isBuffer(_) {\n return typeof Buffer === 'function' && isFunction(Buffer.isBuffer) ? Buffer.isBuffer(_) : false;\n}\nfunction json(data, format) {\n const prop = format && format.property ? field(format.property) : identity;\n return isObject(data) && !isBuffer(data) ? parseJSON(prop(data), format) : prop(JSON.parse(data));\n}\njson.responseType = 'json';\nfunction parseJSON(data, format) {\n if (!isArray(data) && isIterable(data)) {\n data = [...data];\n }\n return format && format.copy ? JSON.parse(JSON.stringify(data)) : data;\n}\n\nconst filters = {\n interior: (a, b) => a !== b,\n exterior: (a, b) => a === b\n};\nfunction topojson(data, format) {\n let method, object, property, filter;\n data = json(data, format);\n if (format && format.feature) {\n method = feature;\n property = format.feature;\n } else if (format && format.mesh) {\n method = mesh;\n property = format.mesh;\n filter = filters[format.filter];\n } else {\n error('Missing TopoJSON feature or mesh parameter.');\n }\n object = (object = data.objects[property]) ? method(data, object, filter) : error('Invalid TopoJSON object: ' + property);\n return object && object.features || [object];\n}\ntopojson.responseType = 'json';\n\nconst format = {\n dsv: dsv,\n csv: delimitedFormat(','),\n tsv: delimitedFormat('\\t'),\n json: json,\n topojson: topojson\n};\nfunction formats(name, reader) {\n if (arguments.length > 1) {\n format[name] = reader;\n return this;\n } else {\n return hasOwnProperty(format, name) ? format[name] : null;\n }\n}\nfunction responseType(type) {\n const f = formats(type);\n return f && f.responseType || 'text';\n}\n\nfunction read (data, schema, timeParser, utcParser) {\n schema = schema || {};\n const reader = formats(schema.type || 'json');\n if (!reader) error('Unknown data format type: ' + schema.type);\n data = reader(data, schema);\n if (schema.parse) parse(data, schema.parse, timeParser, utcParser);\n if (hasOwnProperty(data, 'columns')) delete data.columns;\n return data;\n}\nfunction parse(data, types, timeParser, utcParser) {\n if (!data.length) return; // early exit for empty data\n\n const locale = timeFormatDefaultLocale();\n timeParser = timeParser || locale.timeParse;\n utcParser = utcParser || locale.utcParse;\n let fields = data.columns || Object.keys(data[0]),\n datum,\n field,\n i,\n j,\n n,\n m;\n if (types === 'auto') types = inferTypes(data, fields);\n fields = Object.keys(types);\n const parsers = fields.map(field => {\n const type = types[field];\n let parts, pattern;\n if (type && (type.startsWith('date:') || type.startsWith('utc:'))) {\n parts = type.split(/:(.+)?/, 2); // split on first :\n pattern = parts[1];\n if (pattern[0] === '\\'' && pattern[pattern.length - 1] === '\\'' || pattern[0] === '\"' && pattern[pattern.length - 1] === '\"') {\n pattern = pattern.slice(1, -1);\n }\n const parse = parts[0] === 'utc' ? utcParser : timeParser;\n return parse(pattern);\n }\n if (!typeParsers[type]) {\n throw Error('Illegal format pattern: ' + field + ':' + type);\n }\n return typeParsers[type];\n });\n for (i = 0, n = data.length, m = fields.length; i < n; ++i) {\n datum = data[i];\n for (j = 0; j < m; ++j) {\n field = fields[j];\n datum[field] = parsers[j](datum[field]);\n }\n }\n}\n\nconst loader = loaderFactory(typeof fetch !== 'undefined' && fetch,\n// use built-in fetch API\nnull // no file system access\n);\n\nexport { format, formats, inferType, inferTypes, loader, read, responseType, typeParsers };\n","import { identity, array, isFunction, constant, isArray, id, error, truthy, debounce, extend, visitArray, inherits, logger, Error, hasOwnProperty } from 'vega-util';\nimport { read, responseType, loader } from 'vega-loader';\nimport { defaultLocale } from 'vega-format';\n\nfunction UniqueList(idFunc) {\n const $ = idFunc || identity,\n list = [],\n ids = {};\n list.add = _ => {\n const id = $(_);\n if (!ids[id]) {\n ids[id] = 1;\n list.push(_);\n }\n return list;\n };\n list.remove = _ => {\n const id = $(_);\n if (ids[id]) {\n ids[id] = 0;\n const idx = list.indexOf(_);\n if (idx >= 0) list.splice(idx, 1);\n }\n return list;\n };\n return list;\n}\n\n/**\n * Invoke and await a potentially async callback function. If\n * an error occurs, trap it and route to Dataflow.error.\n * @param {Dataflow} df - The dataflow instance\n * @param {function} callback - A callback function to invoke\n * and then await. The dataflow will be passed as the single\n * argument to the function.\n */\nasync function asyncCallback (df, callback) {\n try {\n await callback(df);\n } catch (err) {\n df.error(err);\n }\n}\n\nconst TUPLE_ID_KEY = Symbol('vega_id');\nlet TUPLE_ID = 1;\n\n/**\n * Checks if an input value is a registered tuple.\n * @param {*} t - The value to check.\n * @return {boolean} True if the input is a tuple, false otherwise.\n */\nfunction isTuple(t) {\n return !!(t && tupleid(t));\n}\n\n/**\n * Returns the id of a tuple.\n * @param {object} t - The input tuple.\n * @return {*} the tuple id.\n */\nfunction tupleid(t) {\n return t[TUPLE_ID_KEY];\n}\n\n/**\n * Sets the id of a tuple.\n * @param {object} t - The input tuple.\n * @param {*} id - The id value to set.\n * @return {object} the input tuple.\n */\nfunction setid(t, id) {\n t[TUPLE_ID_KEY] = id;\n return t;\n}\n\n/**\n * Ingest an object or value as a data tuple.\n * If the input value is an object, an id field will be added to it. For\n * efficiency, the input object is modified directly. A copy is not made.\n * If the input value is a literal, it will be wrapped in a new object\n * instance, with the value accessible as the 'data' property.\n * @param datum - The value to ingest.\n * @return {object} The ingested data tuple.\n */\nfunction ingest$1(datum) {\n const t = datum === Object(datum) ? datum : {\n data: datum\n };\n return tupleid(t) ? t : setid(t, TUPLE_ID++);\n}\n\n/**\n * Given a source tuple, return a derived copy.\n * @param {object} t - The source tuple.\n * @return {object} The derived tuple.\n */\nfunction derive(t) {\n return rederive(t, ingest$1({}));\n}\n\n/**\n * Rederive a derived tuple by copying values from the source tuple.\n * @param {object} t - The source tuple.\n * @param {object} d - The derived tuple.\n * @return {object} The derived tuple.\n */\nfunction rederive(t, d) {\n for (const k in t) d[k] = t[k];\n return d;\n}\n\n/**\n * Replace an existing tuple with a new tuple.\n * @param {object} t - The existing data tuple.\n * @param {object} d - The new tuple that replaces the old.\n * @return {object} The new tuple.\n */\nfunction replace(t, d) {\n return setid(d, tupleid(t));\n}\n\n/**\n * Generate an augmented comparator function that provides stable\n * sorting by tuple id when the given comparator produces ties.\n * @param {function} cmp - The comparator to augment.\n * @param {function} [f] - Optional tuple accessor function.\n * @return {function} An augmented comparator function.\n */\nfunction stableCompare(cmp, f) {\n return !cmp ? null : f ? (a, b) => cmp(a, b) || tupleid(f(a)) - tupleid(f(b)) : (a, b) => cmp(a, b) || tupleid(a) - tupleid(b);\n}\n\nfunction isChangeSet(v) {\n return v && v.constructor === changeset;\n}\nfunction changeset() {\n const add = [],\n // insert tuples\n rem = [],\n // remove tuples\n mod = [],\n // modify tuples\n remp = [],\n // remove by predicate\n modp = []; // modify by predicate\n let clean = null,\n reflow = false;\n return {\n constructor: changeset,\n insert(t) {\n const d = array(t),\n n = d.length;\n for (let i = 0; i < n; ++i) add.push(d[i]);\n return this;\n },\n remove(t) {\n const a = isFunction(t) ? remp : rem,\n d = array(t),\n n = d.length;\n for (let i = 0; i < n; ++i) a.push(d[i]);\n return this;\n },\n modify(t, field, value) {\n const m = {\n field: field,\n value: constant(value)\n };\n if (isFunction(t)) {\n m.filter = t;\n modp.push(m);\n } else {\n m.tuple = t;\n mod.push(m);\n }\n return this;\n },\n encode(t, set) {\n if (isFunction(t)) modp.push({\n filter: t,\n field: set\n });else mod.push({\n tuple: t,\n field: set\n });\n return this;\n },\n clean(value) {\n clean = value;\n return this;\n },\n reflow() {\n reflow = true;\n return this;\n },\n pulse(pulse, tuples) {\n const cur = {},\n out = {};\n let i, n, m, f, t, id;\n\n // build lookup table of current tuples\n for (i = 0, n = tuples.length; i < n; ++i) {\n cur[tupleid(tuples[i])] = 1;\n }\n\n // process individual tuples to remove\n for (i = 0, n = rem.length; i < n; ++i) {\n t = rem[i];\n cur[tupleid(t)] = -1;\n }\n\n // process predicate-based removals\n for (i = 0, n = remp.length; i < n; ++i) {\n f = remp[i];\n tuples.forEach(t => {\n if (f(t)) cur[tupleid(t)] = -1;\n });\n }\n\n // process all add tuples\n for (i = 0, n = add.length; i < n; ++i) {\n t = add[i];\n id = tupleid(t);\n if (cur[id]) {\n // tuple already resides in dataset\n // if flagged for both add and remove, cancel\n cur[id] = 1;\n } else {\n // tuple does not reside in dataset, add\n pulse.add.push(ingest$1(add[i]));\n }\n }\n\n // populate pulse rem list\n for (i = 0, n = tuples.length; i < n; ++i) {\n t = tuples[i];\n if (cur[tupleid(t)] < 0) pulse.rem.push(t);\n }\n\n // modify helper method\n function modify(t, f, v) {\n if (v) {\n t[f] = v(t);\n } else {\n pulse.encode = f;\n }\n if (!reflow) out[tupleid(t)] = t;\n }\n\n // process individual tuples to modify\n for (i = 0, n = mod.length; i < n; ++i) {\n m = mod[i];\n t = m.tuple;\n f = m.field;\n id = cur[tupleid(t)];\n if (id > 0) {\n modify(t, f, m.value);\n pulse.modifies(f);\n }\n }\n\n // process predicate-based modifications\n for (i = 0, n = modp.length; i < n; ++i) {\n m = modp[i];\n f = m.filter;\n tuples.forEach(t => {\n if (f(t) && cur[tupleid(t)] > 0) {\n modify(t, m.field, m.value);\n }\n });\n pulse.modifies(m.field);\n }\n\n // upon reflow request, populate mod with all non-removed tuples\n // otherwise, populate mod with modified tuples only\n if (reflow) {\n pulse.mod = rem.length || remp.length ? tuples.filter(t => cur[tupleid(t)] > 0) : tuples.slice();\n } else {\n for (id in out) pulse.mod.push(out[id]);\n }\n\n // set pulse garbage collection request\n if (clean || clean == null && (rem.length || remp.length)) {\n pulse.clean(true);\n }\n return pulse;\n }\n };\n}\n\nconst CACHE = '_:mod:_';\n\n/**\n * Hash that tracks modifications to assigned values.\n * Callers *must* use the set method to update values.\n */\nfunction Parameters() {\n Object.defineProperty(this, CACHE, {\n writable: true,\n value: {}\n });\n}\nParameters.prototype = {\n /**\n * Set a parameter value. If the parameter value changes, the parameter\n * will be recorded as modified.\n * @param {string} name - The parameter name.\n * @param {number} index - The index into an array-value parameter. Ignored if\n * the argument is undefined, null or less than zero.\n * @param {*} value - The parameter value to set.\n * @param {boolean} [force=false] - If true, records the parameter as modified\n * even if the value is unchanged.\n * @return {Parameters} - This parameter object.\n */\n set(name, index, value, force) {\n const o = this,\n v = o[name],\n mod = o[CACHE];\n if (index != null && index >= 0) {\n if (v[index] !== value || force) {\n v[index] = value;\n mod[index + ':' + name] = -1;\n mod[name] = -1;\n }\n } else if (v !== value || force) {\n o[name] = value;\n mod[name] = isArray(value) ? 1 + value.length : -1;\n }\n return o;\n },\n /**\n * Tests if one or more parameters has been modified. If invoked with no\n * arguments, returns true if any parameter value has changed. If the first\n * argument is array, returns trues if any parameter name in the array has\n * changed. Otherwise, tests if the given name and optional array index has\n * changed.\n * @param {string} name - The parameter name to test.\n * @param {number} [index=undefined] - The parameter array index to test.\n * @return {boolean} - Returns true if a queried parameter was modified.\n */\n modified(name, index) {\n const mod = this[CACHE];\n if (!arguments.length) {\n for (const k in mod) {\n if (mod[k]) return true;\n }\n return false;\n } else if (isArray(name)) {\n for (let k = 0; k < name.length; ++k) {\n if (mod[name[k]]) return true;\n }\n return false;\n }\n return index != null && index >= 0 ? index + 1 < mod[name] || !!mod[index + ':' + name] : !!mod[name];\n },\n /**\n * Clears the modification records. After calling this method,\n * all parameters are considered unmodified.\n */\n clear() {\n this[CACHE] = {};\n return this;\n }\n};\n\nlet OP_ID = 0;\nconst PULSE = 'pulse',\n NO_PARAMS = new Parameters();\n\n// Boolean Flags\nconst SKIP$1 = 1,\n MODIFIED = 2;\n\n/**\n * An Operator is a processing node in a dataflow graph.\n * Each operator stores a value and an optional value update function.\n * Operators can accept a hash of named parameters. Parameter values can\n * either be direct (JavaScript literals, arrays, objects) or indirect\n * (other operators whose values will be pulled dynamically). Operators\n * included as parameters will have this operator added as a dependency.\n * @constructor\n * @param {*} [init] - The initial value for this operator.\n * @param {function(object, Pulse)} [update] - An update function. Upon\n * evaluation of this operator, the update function will be invoked and the\n * return value will be used as the new value of this operator.\n * @param {object} [params] - The parameters for this operator.\n * @param {boolean} [react=true] - Flag indicating if this operator should\n * listen for changes to upstream operators included as parameters.\n * @see parameters\n */\nfunction Operator(init, update, params, react) {\n this.id = ++OP_ID;\n this.value = init;\n this.stamp = -1;\n this.rank = -1;\n this.qrank = -1;\n this.flags = 0;\n if (update) {\n this._update = update;\n }\n if (params) this.parameters(params, react);\n}\nfunction flag(bit) {\n return function (state) {\n const f = this.flags;\n if (arguments.length === 0) return !!(f & bit);\n this.flags = state ? f | bit : f & ~bit;\n return this;\n };\n}\nOperator.prototype = {\n /**\n * Returns a list of target operators dependent on this operator.\n * If this list does not exist, it is created and then returned.\n * @return {UniqueList}\n */\n targets() {\n return this._targets || (this._targets = UniqueList(id));\n },\n /**\n * Sets the value of this operator.\n * @param {*} value - the value to set.\n * @return {Number} Returns 1 if the operator value has changed\n * according to strict equality, returns 0 otherwise.\n */\n set(value) {\n if (this.value !== value) {\n this.value = value;\n return 1;\n } else {\n return 0;\n }\n },\n /**\n * Indicates that operator evaluation should be skipped on the next pulse.\n * This operator will still propagate incoming pulses, but its update function\n * will not be invoked. The skip flag is reset after every pulse, so calling\n * this method will affect processing of the next pulse only.\n */\n skip: flag(SKIP$1),\n /**\n * Indicates that this operator's value has been modified on its most recent\n * pulse. Normally modification is checked via strict equality; however, in\n * some cases it is more efficient to update the internal state of an object.\n * In those cases, the modified flag can be used to trigger propagation. Once\n * set, the modification flag persists across pulses until unset. The flag can\n * be used with the last timestamp to test if a modification is recent.\n */\n modified: flag(MODIFIED),\n /**\n * Sets the parameters for this operator. The parameter values are analyzed for\n * operator instances. If found, this operator will be added as a dependency\n * of the parameterizing operator. Operator values are dynamically marshalled\n * from each operator parameter prior to evaluation. If a parameter value is\n * an array, the array will also be searched for Operator instances. However,\n * the search does not recurse into sub-arrays or object properties.\n * @param {object} params - A hash of operator parameters.\n * @param {boolean} [react=true] - A flag indicating if this operator should\n * automatically update (react) when parameter values change. In other words,\n * this flag determines if the operator registers itself as a listener on\n * any upstream operators included in the parameters.\n * @param {boolean} [initonly=false] - A flag indicating if this operator\n * should calculate an update only upon its initial evaluation, then\n * deregister dependencies and suppress all future update invocations.\n * @return {Operator[]} - An array of upstream dependencies.\n */\n parameters(params, react, initonly) {\n react = react !== false;\n const argval = this._argval = this._argval || new Parameters(),\n argops = this._argops = this._argops || [],\n deps = [];\n let name, value, n, i;\n const add = (name, index, value) => {\n if (value instanceof Operator) {\n if (value !== this) {\n if (react) value.targets().add(this);\n deps.push(value);\n }\n argops.push({\n op: value,\n name: name,\n index: index\n });\n } else {\n argval.set(name, index, value);\n }\n };\n for (name in params) {\n value = params[name];\n if (name === PULSE) {\n array(value).forEach(op => {\n if (!(op instanceof Operator)) {\n error('Pulse parameters must be operator instances.');\n } else if (op !== this) {\n op.targets().add(this);\n deps.push(op);\n }\n });\n this.source = value;\n } else if (isArray(value)) {\n argval.set(name, -1, Array(n = value.length));\n for (i = 0; i < n; ++i) add(name, i, value[i]);\n } else {\n add(name, -1, value);\n }\n }\n this.marshall().clear(); // initialize values\n if (initonly) argops.initonly = true;\n return deps;\n },\n /**\n * Internal method for marshalling parameter values.\n * Visits each operator dependency to pull the latest value.\n * @return {Parameters} A Parameters object to pass to the update function.\n */\n marshall(stamp) {\n const argval = this._argval || NO_PARAMS,\n argops = this._argops;\n let item, i, op, mod;\n if (argops) {\n const n = argops.length;\n for (i = 0; i < n; ++i) {\n item = argops[i];\n op = item.op;\n mod = op.modified() && op.stamp === stamp;\n argval.set(item.name, item.index, op.value, mod);\n }\n if (argops.initonly) {\n for (i = 0; i < n; ++i) {\n item = argops[i];\n item.op.targets().remove(this);\n }\n this._argops = null;\n this._update = null;\n }\n }\n return argval;\n },\n /**\n * Detach this operator from the dataflow.\n * Unregisters listeners on upstream dependencies.\n */\n detach() {\n const argops = this._argops;\n let i, n, item, op;\n if (argops) {\n for (i = 0, n = argops.length; i < n; ++i) {\n item = argops[i];\n op = item.op;\n if (op._targets) {\n op._targets.remove(this);\n }\n }\n }\n\n // remove references to the source and pulse object,\n // if present, to prevent memory leaks of old data.\n this.pulse = null;\n this.source = null;\n },\n /**\n * Delegate method to perform operator processing.\n * Subclasses can override this method to perform custom processing.\n * By default, it marshalls parameters and calls the update function\n * if that function is defined. If the update function does not\n * change the operator value then StopPropagation is returned.\n * If no update function is defined, this method does nothing.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return The output pulse or StopPropagation. A falsy return value\n * (including undefined) will let the input pulse pass through.\n */\n evaluate(pulse) {\n const update = this._update;\n if (update) {\n const params = this.marshall(pulse.stamp),\n v = update.call(this, params, pulse);\n params.clear();\n if (v !== this.value) {\n this.value = v;\n } else if (!this.modified()) {\n return pulse.StopPropagation;\n }\n }\n },\n /**\n * Run this operator for the current pulse. If this operator has already\n * been run at (or after) the pulse timestamp, returns StopPropagation.\n * Internally, this method calls {@link evaluate} to perform processing.\n * If {@link evaluate} returns a falsy value, the input pulse is returned.\n * This method should NOT be overridden, instead overrride {@link evaluate}.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return the output pulse for this operator (or StopPropagation)\n */\n run(pulse) {\n if (pulse.stamp < this.stamp) return pulse.StopPropagation;\n let rv;\n if (this.skip()) {\n this.skip(false);\n rv = 0;\n } else {\n rv = this.evaluate(pulse);\n }\n return this.pulse = rv || pulse;\n }\n};\n\n/**\n * Add an operator to the dataflow graph. This function accepts a\n * variety of input argument types. The basic signature supports an\n * initial value, update function and parameters. If the first parameter\n * is an Operator instance, it will be added directly. If it is a\n * constructor for an Operator subclass, a new instance will be instantiated.\n * Otherwise, if the first parameter is a function instance, it will be used\n * as the update function and a null initial value is assumed.\n * @param {*} init - One of: the operator to add, the initial value of\n * the operator, an operator class to instantiate, or an update function.\n * @param {function} [update] - The operator update function.\n * @param {object} [params] - The operator parameters.\n * @param {boolean} [react=true] - Flag indicating if this operator should\n * listen for changes to upstream operators included as parameters.\n * @return {Operator} - The added operator.\n */\nfunction add (init, update, params, react) {\n let shift = 1,\n op;\n if (init instanceof Operator) {\n op = init;\n } else if (init && init.prototype instanceof Operator) {\n op = new init();\n } else if (isFunction(init)) {\n op = new Operator(null, init);\n } else {\n shift = 0;\n op = new Operator(init, update);\n }\n this.rank(op);\n if (shift) {\n react = params;\n params = update;\n }\n if (params) this.connect(op, op.parameters(params, react));\n this.touch(op);\n return op;\n}\n\n/**\n * Connect a target operator as a dependent of source operators.\n * If necessary, this method will rerank the target operator and its\n * dependents to ensure propagation proceeds in a topologically sorted order.\n * @param {Operator} target - The target operator.\n * @param {Array} - The source operators that should propagate\n * to the target operator.\n */\nfunction connect (target, sources) {\n const targetRank = target.rank,\n n = sources.length;\n for (let i = 0; i < n; ++i) {\n if (targetRank < sources[i].rank) {\n this.rerank(target);\n return;\n }\n }\n}\n\nlet STREAM_ID = 0;\n\n/**\n * Models an event stream.\n * @constructor\n * @param {function(Object, number): boolean} [filter] - Filter predicate.\n * Events pass through when truthy, events are suppressed when falsy.\n * @param {function(Object): *} [apply] - Applied to input events to produce\n * new event values.\n * @param {function(Object)} [receive] - Event callback function to invoke\n * upon receipt of a new event. Use to override standard event processing.\n */\nfunction EventStream(filter, apply, receive) {\n this.id = ++STREAM_ID;\n this.value = null;\n if (receive) this.receive = receive;\n if (filter) this._filter = filter;\n if (apply) this._apply = apply;\n}\n\n/**\n * Creates a new event stream instance with the provided\n * (optional) filter, apply and receive functions.\n * @param {function(Object, number): boolean} [filter] - Filter predicate.\n * Events pass through when truthy, events are suppressed when falsy.\n * @param {function(Object): *} [apply] - Applied to input events to produce\n * new event values.\n * @see EventStream\n */\nfunction stream(filter, apply, receive) {\n return new EventStream(filter, apply, receive);\n}\nEventStream.prototype = {\n _filter: truthy,\n _apply: identity,\n targets() {\n return this._targets || (this._targets = UniqueList(id));\n },\n consume(_) {\n if (!arguments.length) return !!this._consume;\n this._consume = !!_;\n return this;\n },\n receive(evt) {\n if (this._filter(evt)) {\n const val = this.value = this._apply(evt),\n trg = this._targets,\n n = trg ? trg.length : 0;\n for (let i = 0; i < n; ++i) trg[i].receive(val);\n if (this._consume) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n }\n },\n filter(filter) {\n const s = stream(filter);\n this.targets().add(s);\n return s;\n },\n apply(apply) {\n const s = stream(null, apply);\n this.targets().add(s);\n return s;\n },\n merge() {\n const s = stream();\n this.targets().add(s);\n for (let i = 0, n = arguments.length; i < n; ++i) {\n arguments[i].targets().add(s);\n }\n return s;\n },\n throttle(pause) {\n let t = -1;\n return this.filter(() => {\n const now = Date.now();\n if (now - t > pause) {\n t = now;\n return 1;\n } else {\n return 0;\n }\n });\n },\n debounce(delay) {\n const s = stream();\n this.targets().add(stream(null, null, debounce(delay, e => {\n const df = e.dataflow;\n s.receive(e);\n if (df && df.run) df.run();\n })));\n return s;\n },\n between(a, b) {\n let active = false;\n a.targets().add(stream(null, null, () => active = true));\n b.targets().add(stream(null, null, () => active = false));\n return this.filter(() => active);\n },\n detach() {\n // ensures compatibility with operators (#2753)\n // remove references to other streams and filter functions that may\n // be bound to subcontexts that need to be garbage collected.\n this._filter = truthy;\n this._targets = null;\n }\n};\n\n/**\n * Create a new event stream from an event source.\n * @param {object} source - The event source to monitor. The input must\n * support the addEventListener method.\n * @param {string} type - The event type.\n * @param {function(object): boolean} [filter] - Event filter function.\n * @param {function(object): *} [apply] - Event application function.\n * If provided, this function will be invoked and the result will be\n * used as the downstream event value.\n * @return {EventStream}\n */\nfunction events (source, type, filter, apply) {\n const df = this,\n s = stream(filter, apply),\n send = function (e) {\n e.dataflow = df;\n try {\n s.receive(e);\n } catch (error) {\n df.error(error);\n } finally {\n df.run();\n }\n };\n let sources;\n if (typeof source === 'string' && typeof document !== 'undefined') {\n sources = document.querySelectorAll(source);\n } else {\n sources = array(source);\n }\n const n = sources.length;\n for (let i = 0; i < n; ++i) {\n sources[i].addEventListener(type, send);\n }\n return s;\n}\n\nfunction parse(data, format) {\n const locale = this.locale();\n return read(data, format, locale.timeParse, locale.utcParse);\n}\n\n/**\n * Ingests new data into the dataflow. First parses the data using the\n * vega-loader read method, then pulses a changeset to the target operator.\n * @param {Operator} target - The Operator to target with ingested data,\n * typically a Collect transform instance.\n * @param {*} data - The input data, prior to parsing. For JSON this may\n * be a string or an object. For CSV, TSV, etc should be a string.\n * @param {object} format - The data format description for parsing\n * loaded data. This object is passed to the vega-loader read method.\n * @returns {Dataflow}\n */\nfunction ingest(target, data, format) {\n data = this.parse(data, format);\n return this.pulse(target, this.changeset().insert(data));\n}\n\n/**\n * Request data from an external source, parse it, and return a Promise.\n * @param {string} url - The URL from which to load the data. This string\n * is passed to the vega-loader load method.\n * @param {object} [format] - The data format description for parsing\n * loaded data. This object is passed to the vega-loader read method.\n * @return {Promise} A Promise that resolves upon completion of the request.\n * The resolved object contains the following properties:\n * - data: an array of parsed data (or null upon error)\n * - status: a code for success (0), load fail (-1), or parse fail (-2)\n */\nasync function request(url, format) {\n const df = this;\n let status = 0,\n data;\n try {\n data = await df.loader().load(url, {\n context: 'dataflow',\n response: responseType(format && format.type)\n });\n try {\n data = df.parse(data, format);\n } catch (err) {\n status = -2;\n df.warn('Data ingestion failed', url, err);\n }\n } catch (err) {\n status = -1;\n df.warn('Loading failed', url, err);\n }\n return {\n data,\n status\n };\n}\nasync function preload(target, url, format) {\n const df = this,\n pending = df._pending || loadPending(df);\n pending.requests += 1;\n const res = await df.request(url, format);\n df.pulse(target, df.changeset().remove(truthy).insert(res.data || []));\n pending.done();\n return res;\n}\nfunction loadPending(df) {\n let accept;\n const pending = new Promise(a => accept = a);\n pending.requests = 0;\n pending.done = () => {\n if (--pending.requests === 0) {\n df._pending = null;\n accept(df);\n }\n };\n return df._pending = pending;\n}\n\nconst SKIP = {\n skip: true\n};\n\n/**\n * Perform operator updates in response to events. Applies an\n * update function to compute a new operator value. If the update function\n * returns a {@link ChangeSet}, the operator will be pulsed with those tuple\n * changes. Otherwise, the operator value will be updated to the return value.\n * @param {EventStream|Operator} source - The event source to react to.\n * This argument can be either an EventStream or an Operator.\n * @param {Operator|function(object):Operator} target - The operator to update.\n * This argument can either be an Operator instance or (if the source\n * argument is an EventStream), a function that accepts an event object as\n * input and returns an Operator to target.\n * @param {function(Parameters,Event): *} [update] - Optional update function\n * to compute the new operator value, or a literal value to set. Update\n * functions expect to receive a parameter object and event as arguments.\n * This function can either return a new operator value or (if the source\n * argument is an EventStream) a {@link ChangeSet} instance to pulse\n * the target operator with tuple changes.\n * @param {object} [params] - The update function parameters.\n * @param {object} [options] - Additional options hash. If not overridden,\n * updated operators will be skipped by default.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @param {boolean} [options.force] - If true, the operator will\n * be re-evaluated even if its value has not changed.\n * @return {Dataflow}\n */\nfunction on (source, target, update, params, options) {\n const fn = source instanceof Operator ? onOperator : onStream;\n fn(this, source, target, update, params, options);\n return this;\n}\nfunction onStream(df, stream, target, update, params, options) {\n const opt = extend({}, options, SKIP);\n let func, op;\n if (!isFunction(target)) target = constant(target);\n if (update === undefined) {\n func = e => df.touch(target(e));\n } else if (isFunction(update)) {\n op = new Operator(null, update, params, false);\n func = e => {\n op.evaluate(e);\n const t = target(e),\n v = op.value;\n isChangeSet(v) ? df.pulse(t, v, options) : df.update(t, v, opt);\n };\n } else {\n func = e => df.update(target(e), update, opt);\n }\n stream.apply(func);\n}\nfunction onOperator(df, source, target, update, params, options) {\n if (update === undefined) {\n source.targets().add(target);\n } else {\n const opt = options || {},\n op = new Operator(null, updater(target, update), params, false);\n op.modified(opt.force);\n op.rank = source.rank; // immediately follow source\n source.targets().add(op); // add dependency\n\n if (target) {\n op.skip(true); // skip first invocation\n op.value = target.value; // initialize value\n op.targets().add(target); // chain dependencies\n df.connect(target, [op]); // rerank as needed, #1672\n }\n }\n}\nfunction updater(target, update) {\n update = isFunction(update) ? update : constant(update);\n return target ? function (_, pulse) {\n const value = update(_, pulse);\n if (!target.skip()) {\n target.skip(value !== this.value).value = value;\n }\n return value;\n } : update;\n}\n\n/**\n * Assigns a rank to an operator. Ranks are assigned in increasing order\n * by incrementing an internal rank counter.\n * @param {Operator} op - The operator to assign a rank.\n */\nfunction rank(op) {\n op.rank = ++this._rank;\n}\n\n/**\n * Re-ranks an operator and all downstream target dependencies. This\n * is necessary when upstream dependencies of higher rank are added to\n * a target operator.\n * @param {Operator} op - The operator to re-rank.\n */\nfunction rerank(op) {\n const queue = [op];\n let cur, list, i;\n while (queue.length) {\n this.rank(cur = queue.pop());\n if (list = cur._targets) {\n for (i = list.length; --i >= 0;) {\n queue.push(cur = list[i]);\n if (cur === op) error('Cycle detected in dataflow graph.');\n }\n }\n }\n}\n\n/**\n * Sentinel value indicating pulse propagation should stop.\n */\nconst StopPropagation = {};\n\n// Pulse visit type flags\nconst ADD = 1 << 0,\n REM = 1 << 1,\n MOD = 1 << 2,\n ADD_REM = ADD | REM,\n ADD_MOD = ADD | MOD,\n ALL = ADD | REM | MOD,\n REFLOW = 1 << 3,\n SOURCE = 1 << 4,\n NO_SOURCE = 1 << 5,\n NO_FIELDS = 1 << 6;\n\n/**\n * A Pulse enables inter-operator communication during a run of the\n * dataflow graph. In addition to the current timestamp, a pulse may also\n * contain a change-set of added, removed or modified data tuples, as well as\n * a pointer to a full backing data source. Tuple change sets may not\n * be fully materialized; for example, to prevent needless array creation\n * a change set may include larger arrays and corresponding filter functions.\n * The pulse provides a {@link visit} method to enable proper and efficient\n * iteration over requested data tuples.\n *\n * In addition, each pulse can track modification flags for data tuple fields.\n * Responsible transform operators should call the {@link modifies} method to\n * indicate changes to data fields. The {@link modified} method enables\n * querying of this modification state.\n *\n * @constructor\n * @param {Dataflow} dataflow - The backing dataflow instance.\n * @param {number} stamp - The current propagation timestamp.\n * @param {string} [encode] - An optional encoding set name, which is then\n * accessible as Pulse.encode. Operators can respond to (or ignore) this\n * setting as appropriate. This parameter can be used in conjunction with\n * the Encode transform in the vega-encode module.\n */\nfunction Pulse(dataflow, stamp, encode) {\n this.dataflow = dataflow;\n this.stamp = stamp == null ? -1 : stamp;\n this.add = [];\n this.rem = [];\n this.mod = [];\n this.fields = null;\n this.encode = encode || null;\n}\nfunction materialize(data, filter) {\n const out = [];\n visitArray(data, filter, _ => out.push(_));\n return out;\n}\nfunction filter(pulse, flags) {\n const map = {};\n pulse.visit(flags, t => {\n map[tupleid(t)] = 1;\n });\n return t => map[tupleid(t)] ? null : t;\n}\nfunction addFilter(a, b) {\n return a ? (t, i) => a(t, i) && b(t, i) : b;\n}\nPulse.prototype = {\n /**\n * Sentinel value indicating pulse propagation should stop.\n */\n StopPropagation,\n /**\n * Boolean flag indicating ADD (added) tuples.\n */\n ADD,\n /**\n * Boolean flag indicating REM (removed) tuples.\n */\n REM,\n /**\n * Boolean flag indicating MOD (modified) tuples.\n */\n MOD,\n /**\n * Boolean flag indicating ADD (added) and REM (removed) tuples.\n */\n ADD_REM,\n /**\n * Boolean flag indicating ADD (added) and MOD (modified) tuples.\n */\n ADD_MOD,\n /**\n * Boolean flag indicating ADD, REM and MOD tuples.\n */\n ALL,\n /**\n * Boolean flag indicating all tuples in a data source\n * except for the ADD, REM and MOD tuples.\n */\n REFLOW,\n /**\n * Boolean flag indicating a 'pass-through' to a\n * backing data source, ignoring ADD, REM and MOD tuples.\n */\n SOURCE,\n /**\n * Boolean flag indicating that source data should be\n * suppressed when creating a forked pulse.\n */\n NO_SOURCE,\n /**\n * Boolean flag indicating that field modifications should be\n * suppressed when creating a forked pulse.\n */\n NO_FIELDS,\n /**\n * Creates a new pulse based on the values of this pulse.\n * The dataflow, time stamp and field modification values are copied over.\n * By default, new empty ADD, REM and MOD arrays are created.\n * @param {number} flags - Integer of boolean flags indicating which (if any)\n * tuple arrays should be copied to the new pulse. The supported flag values\n * are ADD, REM and MOD. Array references are copied directly: new array\n * instances are not created.\n * @return {Pulse} - The forked pulse instance.\n * @see init\n */\n fork(flags) {\n return new Pulse(this.dataflow).init(this, flags);\n },\n /**\n * Creates a copy of this pulse with new materialized array\n * instances for the ADD, REM, MOD, and SOURCE arrays.\n * The dataflow, time stamp and field modification values are copied over.\n * @return {Pulse} - The cloned pulse instance.\n * @see init\n */\n clone() {\n const p = this.fork(ALL);\n p.add = p.add.slice();\n p.rem = p.rem.slice();\n p.mod = p.mod.slice();\n if (p.source) p.source = p.source.slice();\n return p.materialize(ALL | SOURCE);\n },\n /**\n * Returns a pulse that adds all tuples from a backing source. This is\n * useful for cases where operators are added to a dataflow after an\n * upstream data pipeline has already been processed, ensuring that\n * new operators can observe all tuples within a stream.\n * @return {Pulse} - A pulse instance with all source tuples included\n * in the add array. If the current pulse already has all source\n * tuples in its add array, it is returned directly. If the current\n * pulse does not have a backing source, it is returned directly.\n */\n addAll() {\n let p = this;\n const reuse = !p.source || p.add === p.rem // special case for indexed set (e.g., crossfilter)\n || !p.rem.length && p.source.length === p.add.length;\n if (reuse) {\n return p;\n } else {\n p = new Pulse(this.dataflow).init(this);\n p.add = p.source;\n p.rem = []; // new operators can ignore rem #2769\n return p;\n }\n },\n /**\n * Initialize this pulse based on the values of another pulse. This method\n * is used internally by {@link fork} to initialize a new forked tuple.\n * The dataflow, time stamp and field modification values are copied over.\n * By default, new empty ADD, REM and MOD arrays are created.\n * @param {Pulse} src - The source pulse to copy from.\n * @param {number} flags - Integer of boolean flags indicating which (if any)\n * tuple arrays should be copied to the new pulse. The supported flag values\n * are ADD, REM and MOD. Array references are copied directly: new array\n * instances are not created. By default, source data arrays are copied\n * to the new pulse. Use the NO_SOURCE flag to enforce a null source.\n * @return {Pulse} - Returns this Pulse instance.\n */\n init(src, flags) {\n const p = this;\n p.stamp = src.stamp;\n p.encode = src.encode;\n if (src.fields && !(flags & NO_FIELDS)) {\n p.fields = src.fields;\n }\n if (flags & ADD) {\n p.addF = src.addF;\n p.add = src.add;\n } else {\n p.addF = null;\n p.add = [];\n }\n if (flags & REM) {\n p.remF = src.remF;\n p.rem = src.rem;\n } else {\n p.remF = null;\n p.rem = [];\n }\n if (flags & MOD) {\n p.modF = src.modF;\n p.mod = src.mod;\n } else {\n p.modF = null;\n p.mod = [];\n }\n if (flags & NO_SOURCE) {\n p.srcF = null;\n p.source = null;\n } else {\n p.srcF = src.srcF;\n p.source = src.source;\n if (src.cleans) p.cleans = src.cleans;\n }\n return p;\n },\n /**\n * Schedules a function to run after pulse propagation completes.\n * @param {function} func - The function to run.\n */\n runAfter(func) {\n this.dataflow.runAfter(func);\n },\n /**\n * Indicates if tuples have been added, removed or modified.\n * @param {number} [flags] - The tuple types (ADD, REM or MOD) to query.\n * Defaults to ALL, returning true if any tuple type has changed.\n * @return {boolean} - Returns true if one or more queried tuple types have\n * changed, false otherwise.\n */\n changed(flags) {\n const f = flags || ALL;\n return f & ADD && this.add.length || f & REM && this.rem.length || f & MOD && this.mod.length;\n },\n /**\n * Forces a \"reflow\" of tuple values, such that all tuples in the backing\n * source are added to the MOD set, unless already present in the ADD set.\n * @param {boolean} [fork=false] - If true, returns a forked copy of this\n * pulse, and invokes reflow on that derived pulse.\n * @return {Pulse} - The reflowed pulse instance.\n */\n reflow(fork) {\n if (fork) return this.fork(ALL).reflow();\n const len = this.add.length,\n src = this.source && this.source.length;\n if (src && src !== len) {\n this.mod = this.source;\n if (len) this.filter(MOD, filter(this, ADD));\n }\n return this;\n },\n /**\n * Get/set metadata to pulse requesting garbage collection\n * to reclaim currently unused resources.\n */\n clean(value) {\n if (arguments.length) {\n this.cleans = !!value;\n return this;\n } else {\n return this.cleans;\n }\n },\n /**\n * Marks one or more data field names as modified to assist dependency\n * tracking and incremental processing by transform operators.\n * @param {string|Array} _ - The field(s) to mark as modified.\n * @return {Pulse} - This pulse instance.\n */\n modifies(_) {\n const hash = this.fields || (this.fields = {});\n if (isArray(_)) {\n _.forEach(f => hash[f] = true);\n } else {\n hash[_] = true;\n }\n return this;\n },\n /**\n * Checks if one or more data fields have been modified during this pulse\n * propagation timestamp.\n * @param {string|Array} _ - The field(s) to check for modified.\n * @param {boolean} nomod - If true, will check the modified flag even if\n * no mod tuples exist. If false (default), mod tuples must be present.\n * @return {boolean} - Returns true if any of the provided fields has been\n * marked as modified, false otherwise.\n */\n modified(_, nomod) {\n const fields = this.fields;\n return !((nomod || this.mod.length) && fields) ? false : !arguments.length ? !!fields : isArray(_) ? _.some(f => fields[f]) : fields[_];\n },\n /**\n * Adds a filter function to one more tuple sets. Filters are applied to\n * backing tuple arrays, to determine the actual set of tuples considered\n * added, removed or modified. They can be used to delay materialization of\n * a tuple set in order to avoid expensive array copies. In addition, the\n * filter functions can serve as value transformers: unlike standard predicate\n * function (which return boolean values), Pulse filters should return the\n * actual tuple value to process. If a tuple set is already filtered, the\n * new filter function will be appended into a conjuntive ('and') query.\n * @param {number} flags - Flags indicating the tuple set(s) to filter.\n * @param {function(*):object} filter - Filter function that will be applied\n * to the tuple set array, and should return a data tuple if the value\n * should be included in the tuple set, and falsy (or null) otherwise.\n * @return {Pulse} - Returns this pulse instance.\n */\n filter(flags, filter) {\n const p = this;\n if (flags & ADD) p.addF = addFilter(p.addF, filter);\n if (flags & REM) p.remF = addFilter(p.remF, filter);\n if (flags & MOD) p.modF = addFilter(p.modF, filter);\n if (flags & SOURCE) p.srcF = addFilter(p.srcF, filter);\n return p;\n },\n /**\n * Materialize one or more tuple sets in this pulse. If the tuple set(s) have\n * a registered filter function, it will be applied and the tuple set(s) will\n * be replaced with materialized tuple arrays.\n * @param {number} flags - Flags indicating the tuple set(s) to materialize.\n * @return {Pulse} - Returns this pulse instance.\n */\n materialize(flags) {\n flags = flags || ALL;\n const p = this;\n if (flags & ADD && p.addF) {\n p.add = materialize(p.add, p.addF);\n p.addF = null;\n }\n if (flags & REM && p.remF) {\n p.rem = materialize(p.rem, p.remF);\n p.remF = null;\n }\n if (flags & MOD && p.modF) {\n p.mod = materialize(p.mod, p.modF);\n p.modF = null;\n }\n if (flags & SOURCE && p.srcF) {\n p.source = p.source.filter(p.srcF);\n p.srcF = null;\n }\n return p;\n },\n /**\n * Visit one or more tuple sets in this pulse.\n * @param {number} flags - Flags indicating the tuple set(s) to visit.\n * Legal values are ADD, REM, MOD and SOURCE (if a backing data source\n * has been set).\n * @param {function(object):*} - Visitor function invoked per-tuple.\n * @return {Pulse} - Returns this pulse instance.\n */\n visit(flags, visitor) {\n const p = this,\n v = visitor;\n if (flags & SOURCE) {\n visitArray(p.source, p.srcF, v);\n return p;\n }\n if (flags & ADD) visitArray(p.add, p.addF, v);\n if (flags & REM) visitArray(p.rem, p.remF, v);\n if (flags & MOD) visitArray(p.mod, p.modF, v);\n const src = p.source;\n if (flags & REFLOW && src) {\n const sum = p.add.length + p.mod.length;\n if (sum === src.length) ; else if (sum) {\n visitArray(src, filter(p, ADD_MOD), v);\n } else {\n // if no add/rem/mod tuples, visit source\n visitArray(src, p.srcF, v);\n }\n }\n return p;\n }\n};\n\n/**\n * Represents a set of multiple pulses. Used as input for operators\n * that accept multiple pulses at a time. Contained pulses are\n * accessible via the public \"pulses\" array property. This pulse doe\n * not carry added, removed or modified tuples directly. However,\n * the visit method can be used to traverse all such tuples contained\n * in sub-pulses with a timestamp matching this parent multi-pulse.\n * @constructor\n * @param {Dataflow} dataflow - The backing dataflow instance.\n * @param {number} stamp - The timestamp.\n * @param {Array} pulses - The sub-pulses for this multi-pulse.\n */\nfunction MultiPulse(dataflow, stamp, pulses, encode) {\n const p = this;\n let c = 0;\n this.dataflow = dataflow;\n this.stamp = stamp;\n this.fields = null;\n this.encode = encode || null;\n this.pulses = pulses;\n for (const pulse of pulses) {\n if (pulse.stamp !== stamp) continue;\n if (pulse.fields) {\n const hash = p.fields || (p.fields = {});\n for (const f in pulse.fields) {\n hash[f] = 1;\n }\n }\n if (pulse.changed(p.ADD)) c |= p.ADD;\n if (pulse.changed(p.REM)) c |= p.REM;\n if (pulse.changed(p.MOD)) c |= p.MOD;\n }\n this.changes = c;\n}\ninherits(MultiPulse, Pulse, {\n /**\n * Creates a new pulse based on the values of this pulse.\n * The dataflow, time stamp and field modification values are copied over.\n * @return {Pulse}\n */\n fork(flags) {\n const p = new Pulse(this.dataflow).init(this, flags & this.NO_FIELDS);\n if (flags !== undefined) {\n if (flags & p.ADD) this.visit(p.ADD, t => p.add.push(t));\n if (flags & p.REM) this.visit(p.REM, t => p.rem.push(t));\n if (flags & p.MOD) this.visit(p.MOD, t => p.mod.push(t));\n }\n return p;\n },\n changed(flags) {\n return this.changes & flags;\n },\n modified(_) {\n const p = this,\n fields = p.fields;\n return !(fields && p.changes & p.MOD) ? 0 : isArray(_) ? _.some(f => fields[f]) : fields[_];\n },\n filter() {\n error('MultiPulse does not support filtering.');\n },\n materialize() {\n error('MultiPulse does not support materialization.');\n },\n visit(flags, visitor) {\n const p = this,\n pulses = p.pulses,\n n = pulses.length;\n let i = 0;\n if (flags & p.SOURCE) {\n for (; i < n; ++i) {\n pulses[i].visit(flags, visitor);\n }\n } else {\n for (; i < n; ++i) {\n if (pulses[i].stamp === p.stamp) {\n pulses[i].visit(flags, visitor);\n }\n }\n }\n return p;\n }\n});\n\n/* eslint-disable require-atomic-updates */\n\n/**\n * Evaluates the dataflow and returns a Promise that resolves when pulse\n * propagation completes. This method will increment the current timestamp\n * and process all updated, pulsed and touched operators. When invoked for\n * the first time, all registered operators will be processed. This method\n * should not be invoked by third-party clients, use {@link runAsync} or\n * {@link run} instead.\n * @param {string} [encode] - The name of an encoding set to invoke during\n * propagation. This value is added to generated Pulse instances;\n * operators can then respond to (or ignore) this setting as appropriate.\n * This parameter can be used in conjunction with the Encode transform in\n * the vega-encode package.\n * @param {function} [prerun] - An optional callback function to invoke\n * immediately before dataflow evaluation commences.\n * @param {function} [postrun] - An optional callback function to invoke\n * after dataflow evaluation completes. The callback will be invoked\n * after those registered via {@link runAfter}.\n * @return {Promise} - A promise that resolves to this dataflow after\n * evaluation completes.\n */\nasync function evaluate(encode, prerun, postrun) {\n const df = this,\n async = [];\n\n // if the pulse value is set, this is a re-entrant call\n if (df._pulse) return reentrant(df);\n\n // wait for pending datasets to load\n if (df._pending) await df._pending;\n\n // invoke prerun function, if provided\n if (prerun) await asyncCallback(df, prerun);\n\n // exit early if there are no updates\n if (!df._touched.length) {\n df.debug('Dataflow invoked, but nothing to do.');\n return df;\n }\n\n // increment timestamp clock\n const stamp = ++df._clock;\n\n // set the current pulse\n df._pulse = new Pulse(df, stamp, encode);\n\n // initialize priority queue, reset touched operators\n df._touched.forEach(op => df._enqueue(op, true));\n df._touched = UniqueList(id);\n let count = 0,\n op,\n next,\n error;\n try {\n while (df._heap.size() > 0) {\n // dequeue operator with highest priority\n op = df._heap.pop();\n\n // re-queue if rank changed\n if (op.rank !== op.qrank) {\n df._enqueue(op, true);\n continue;\n }\n\n // otherwise, evaluate the operator\n next = op.run(df._getPulse(op, encode));\n if (next.then) {\n // await if operator returns a promise directly\n next = await next;\n } else if (next.async) {\n // queue parallel asynchronous execution\n async.push(next.async);\n next = StopPropagation;\n }\n\n // propagate evaluation, enqueue dependent operators\n if (next !== StopPropagation) {\n if (op._targets) op._targets.forEach(op => df._enqueue(op));\n }\n\n // increment visit counter\n ++count;\n }\n } catch (err) {\n df._heap.clear();\n error = err;\n }\n\n // reset pulse map\n df._input = {};\n df._pulse = null;\n df.debug(`Pulse ${stamp}: ${count} operators`);\n if (error) {\n df._postrun = [];\n df.error(error);\n }\n\n // invoke callbacks queued via runAfter\n if (df._postrun.length) {\n const pr = df._postrun.sort((a, b) => b.priority - a.priority);\n df._postrun = [];\n for (let i = 0; i < pr.length; ++i) {\n await asyncCallback(df, pr[i].callback);\n }\n }\n\n // invoke postrun function, if provided\n if (postrun) await asyncCallback(df, postrun);\n\n // handle non-blocking asynchronous callbacks\n if (async.length) {\n Promise.all(async).then(cb => df.runAsync(null, () => {\n cb.forEach(f => {\n try {\n f(df);\n } catch (err) {\n df.error(err);\n }\n });\n }));\n }\n return df;\n}\n\n/**\n * Queues dataflow evaluation to run once any other queued evaluations have\n * completed and returns a Promise that resolves when the queued pulse\n * propagation completes. If provided, a callback function will be invoked\n * immediately before evaluation commences. This method will ensure a\n * separate evaluation is invoked for each time it is called.\n * @param {string} [encode] - The name of an encoding set to invoke during\n * propagation. This value is added to generated Pulse instances;\n * operators can then respond to (or ignore) this setting as appropriate.\n * This parameter can be used in conjunction with the Encode transform in\n * the vega-encode package.\n * @param {function} [prerun] - An optional callback function to invoke\n * immediately before dataflow evaluation commences.\n * @param {function} [postrun] - An optional callback function to invoke\n * after dataflow evaluation completes. The callback will be invoked\n * after those registered via {@link runAfter}.\n * @return {Promise} - A promise that resolves to this dataflow after\n * evaluation completes.\n */\nasync function runAsync(encode, prerun, postrun) {\n // await previously queued functions\n while (this._running) await this._running;\n\n // run dataflow, manage running promise\n const clear = () => this._running = null;\n (this._running = this.evaluate(encode, prerun, postrun)).then(clear, clear);\n return this._running;\n}\n\n/**\n * Requests dataflow evaluation and the immediately returns this dataflow\n * instance. If there are pending data loading or other asynchronous\n * operations, the dataflow will evaluate asynchronously after this method\n * has been invoked. To track when dataflow evaluation completes, use the\n * {@link runAsync} method instead. This method will raise an error if\n * invoked while the dataflow is already in the midst of evaluation.\n * @param {string} [encode] - The name of an encoding set to invoke during\n * propagation. This value is added to generated Pulse instances;\n * operators can then respond to (or ignore) this setting as appropriate.\n * This parameter can be used in conjunction with the Encode transform in\n * the vega-encode module.\n * @param {function} [prerun] - An optional callback function to invoke\n * immediately before dataflow evaluation commences.\n * @param {function} [postrun] - An optional callback function to invoke\n * after dataflow evaluation completes. The callback will be invoked\n * after those registered via {@link runAfter}.\n * @return {Dataflow} - This dataflow instance.\n */\nfunction run(encode, prerun, postrun) {\n return this._pulse ? reentrant(this) : (this.evaluate(encode, prerun, postrun), this);\n}\n\n/**\n * Schedules a callback function to be invoked after the current pulse\n * propagation completes. If no propagation is currently occurring,\n * the function is invoked immediately. Callbacks scheduled via runAfter\n * are invoked immediately upon completion of the current cycle, before\n * any request queued via runAsync. This method is primarily intended for\n * internal use. Third-party callers using runAfter to schedule a callback\n * that invokes {@link run} or {@link runAsync} should not use this method,\n * but instead use {@link runAsync} with prerun or postrun arguments.\n * @param {function(Dataflow)} callback - The callback function to run.\n * The callback will be invoked with this Dataflow instance as its\n * sole argument.\n * @param {boolean} enqueue - A boolean flag indicating that the\n * callback should be queued up to run after the next propagation\n * cycle, suppressing immediate invocation when propagation is not\n * currently occurring.\n * @param {number} [priority] - A priority value used to sort registered\n * callbacks to determine execution order. This argument is intended\n * for internal Vega use only.\n */\nfunction runAfter(callback, enqueue, priority) {\n if (this._pulse || enqueue) {\n // pulse propagation is currently running, queue to run after\n this._postrun.push({\n priority: priority || 0,\n callback: callback\n });\n } else {\n // pulse propagation already complete, invoke immediately\n try {\n callback(this);\n } catch (err) {\n this.error(err);\n }\n }\n}\n\n/**\n * Raise an error for re-entrant dataflow evaluation.\n */\nfunction reentrant(df) {\n df.error('Dataflow already running. Use runAsync() to chain invocations.');\n return df;\n}\n\n/**\n * Enqueue an operator into the priority queue for evaluation. The operator\n * will be enqueued if it has no registered pulse for the current cycle, or if\n * the force argument is true. Upon enqueue, this method also sets the\n * operator's qrank to the current rank value.\n * @param {Operator} op - The operator to enqueue.\n * @param {boolean} [force] - A flag indicating if the operator should be\n * forceably added to the queue, even if it has already been previously\n * enqueued during the current pulse propagation. This is useful when the\n * dataflow graph is dynamically modified and the operator rank changes.\n */\nfunction enqueue(op, force) {\n const q = op.stamp < this._clock;\n if (q) op.stamp = this._clock;\n if (q || force) {\n op.qrank = op.rank;\n this._heap.push(op);\n }\n}\n\n/**\n * Provide a correct pulse for evaluating an operator. If the operator has an\n * explicit source operator, we will try to pull the pulse(s) from it.\n * If there is an array of source operators, we build a multi-pulse.\n * Otherwise, we return a current pulse with correct source data.\n * If the pulse is the pulse map has an explicit target set, we use that.\n * Else if the pulse on the upstream source operator is current, we use that.\n * Else we use the pulse from the pulse map, but copy the source tuple array.\n * @param {Operator} op - The operator for which to get an input pulse.\n * @param {string} [encode] - An (optional) encoding set name with which to\n * annotate the returned pulse. See {@link run} for more information.\n */\nfunction getPulse(op, encode) {\n const s = op.source,\n stamp = this._clock;\n return s && isArray(s) ? new MultiPulse(this, stamp, s.map(_ => _.pulse), encode) : this._input[op.id] || singlePulse(this._pulse, s && s.pulse);\n}\nfunction singlePulse(p, s) {\n if (s && s.stamp === p.stamp) {\n return s;\n }\n p = p.fork();\n if (s && s !== StopPropagation) {\n p.source = s.source;\n }\n return p;\n}\n\nconst NO_OPT = {\n skip: false,\n force: false\n};\n\n/**\n * Touches an operator, scheduling it to be evaluated. If invoked outside of\n * a pulse propagation, the operator will be evaluated the next time this\n * dataflow is run. If invoked in the midst of pulse propagation, the operator\n * will be queued for evaluation if and only if the operator has not yet been\n * evaluated on the current propagation timestamp.\n * @param {Operator} op - The operator to touch.\n * @param {object} [options] - Additional options hash.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @return {Dataflow}\n */\nfunction touch(op, options) {\n const opt = options || NO_OPT;\n if (this._pulse) {\n // if in midst of propagation, add to priority queue\n this._enqueue(op);\n } else {\n // otherwise, queue for next propagation\n this._touched.add(op);\n }\n if (opt.skip) op.skip(true);\n return this;\n}\n\n/**\n * Updates the value of the given operator.\n * @param {Operator} op - The operator to update.\n * @param {*} value - The value to set.\n * @param {object} [options] - Additional options hash.\n * @param {boolean} [options.force] - If true, the operator will\n * be re-evaluated even if its value has not changed.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @return {Dataflow}\n */\nfunction update(op, value, options) {\n const opt = options || NO_OPT;\n if (op.set(value) || opt.force) {\n this.touch(op, opt);\n }\n return this;\n}\n\n/**\n * Pulses an operator with a changeset of tuples. If invoked outside of\n * a pulse propagation, the pulse will be applied the next time this\n * dataflow is run. If invoked in the midst of pulse propagation, the pulse\n * will be added to the set of active pulses and will be applied if and\n * only if the target operator has not yet been evaluated on the current\n * propagation timestamp.\n * @param {Operator} op - The operator to pulse.\n * @param {ChangeSet} value - The tuple changeset to apply.\n * @param {object} [options] - Additional options hash.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @return {Dataflow}\n */\nfunction pulse(op, changeset, options) {\n this.touch(op, options || NO_OPT);\n const p = new Pulse(this, this._clock + (this._pulse ? 0 : 1)),\n t = op.pulse && op.pulse.source || [];\n p.target = op;\n this._input[op.id] = changeset.pulse(p, t);\n return this;\n}\n\nfunction Heap(cmp) {\n let nodes = [];\n return {\n clear: () => nodes = [],\n size: () => nodes.length,\n peek: () => nodes[0],\n push: x => {\n nodes.push(x);\n return siftdown(nodes, 0, nodes.length - 1, cmp);\n },\n pop: () => {\n const last = nodes.pop();\n let item;\n if (nodes.length) {\n item = nodes[0];\n nodes[0] = last;\n siftup(nodes, 0, cmp);\n } else {\n item = last;\n }\n return item;\n }\n };\n}\nfunction siftdown(array, start, idx, cmp) {\n let parent, pidx;\n const item = array[idx];\n while (idx > start) {\n pidx = idx - 1 >> 1;\n parent = array[pidx];\n if (cmp(item, parent) < 0) {\n array[idx] = parent;\n idx = pidx;\n continue;\n }\n break;\n }\n return array[idx] = item;\n}\nfunction siftup(array, idx, cmp) {\n const start = idx,\n end = array.length,\n item = array[idx];\n let cidx = (idx << 1) + 1,\n ridx;\n while (cidx < end) {\n ridx = cidx + 1;\n if (ridx < end && cmp(array[cidx], array[ridx]) >= 0) {\n cidx = ridx;\n }\n array[idx] = array[cidx];\n idx = cidx;\n cidx = (idx << 1) + 1;\n }\n array[idx] = item;\n return siftdown(array, start, idx, cmp);\n}\n\n/**\n * A dataflow graph for reactive processing of data streams.\n * @constructor\n */\nfunction Dataflow() {\n this.logger(logger());\n this.logLevel(Error);\n this._clock = 0;\n this._rank = 0;\n this._locale = defaultLocale();\n try {\n this._loader = loader();\n } catch (e) {\n // do nothing if loader module is unavailable\n }\n this._touched = UniqueList(id);\n this._input = {};\n this._pulse = null;\n this._heap = Heap((a, b) => a.qrank - b.qrank);\n this._postrun = [];\n}\nfunction logMethod(method) {\n return function () {\n return this._log[method].apply(this, arguments);\n };\n}\nDataflow.prototype = {\n /**\n * The current timestamp of this dataflow. This value reflects the\n * timestamp of the previous dataflow run. The dataflow is initialized\n * with a stamp value of 0. The initial run of the dataflow will have\n * a timestap of 1, and so on. This value will match the\n * {@link Pulse.stamp} property.\n * @return {number} - The current timestamp value.\n */\n stamp() {\n return this._clock;\n },\n /**\n * Gets or sets the loader instance to use for data file loading. A\n * loader object must provide a \"load\" method for loading files and a\n * \"sanitize\" method for checking URL/filename validity. Both methods\n * should accept a URI and options hash as arguments, and return a Promise\n * that resolves to the loaded file contents (load) or a hash containing\n * sanitized URI data with the sanitized url assigned to the \"href\" property\n * (sanitize).\n * @param {object} _ - The loader instance to use.\n * @return {object|Dataflow} - If no arguments are provided, returns\n * the current loader instance. Otherwise returns this Dataflow instance.\n */\n loader(_) {\n if (arguments.length) {\n this._loader = _;\n return this;\n } else {\n return this._loader;\n }\n },\n /**\n * Gets or sets the locale instance to use for formatting and parsing\n * string values. The locale object should be provided by the\n * vega-format library, and include methods such as format, timeFormat,\n * utcFormat, timeParse, and utcParse.\n * @param {object} _ - The locale instance to use.\n * @return {object|Dataflow} - If no arguments are provided, returns\n * the current locale instance. Otherwise returns this Dataflow instance.\n */\n locale(_) {\n if (arguments.length) {\n this._locale = _;\n return this;\n } else {\n return this._locale;\n }\n },\n /**\n * Get or set the logger instance used to log messages. If no arguments are\n * provided, returns the current logger instance. Otherwise, sets the logger\n * and return this Dataflow instance. Provided loggers must support the full\n * API of logger objects generated by the vega-util logger method. Note that\n * by default the log level of the new logger will be used; use the logLevel\n * method to adjust the log level as needed.\n */\n logger(logger) {\n if (arguments.length) {\n this._log = logger;\n return this;\n } else {\n return this._log;\n }\n },\n /**\n * Logs an error message. By default, logged messages are written to console\n * output. The message will only be logged if the current log level is high\n * enough to permit error messages.\n */\n error: logMethod('error'),\n /**\n * Logs a warning message. By default, logged messages are written to console\n * output. The message will only be logged if the current log level is high\n * enough to permit warning messages.\n */\n warn: logMethod('warn'),\n /**\n * Logs a information message. By default, logged messages are written to\n * console output. The message will only be logged if the current log level is\n * high enough to permit information messages.\n */\n info: logMethod('info'),\n /**\n * Logs a debug message. By default, logged messages are written to console\n * output. The message will only be logged if the current log level is high\n * enough to permit debug messages.\n */\n debug: logMethod('debug'),\n /**\n * Get or set the current log level. If an argument is provided, it\n * will be used as the new log level.\n * @param {number} [level] - Should be one of None, Warn, Info\n * @return {number} - The current log level.\n */\n logLevel: logMethod('level'),\n /**\n * Empty entry threshold for garbage cleaning. Map data structures will\n * perform cleaning once the number of empty entries exceeds this value.\n */\n cleanThreshold: 1e4,\n // OPERATOR REGISTRATION\n add,\n connect,\n rank,\n rerank,\n // OPERATOR UPDATES\n pulse,\n touch,\n update,\n changeset,\n // DATA LOADING\n ingest,\n parse,\n preload,\n request,\n // EVENT HANDLING\n events,\n on,\n // PULSE PROPAGATION\n evaluate,\n run,\n runAsync,\n runAfter,\n _enqueue: enqueue,\n _getPulse: getPulse\n};\n\n/**\n * Abstract class for operators that process data tuples.\n * Subclasses must provide a {@link transform} method for operator processing.\n * @constructor\n * @param {*} [init] - The initial value for this operator.\n * @param {object} [params] - The parameters for this operator.\n * @param {Operator} [source] - The operator from which to receive pulses.\n */\nfunction Transform(init, params) {\n Operator.call(this, init, null, params);\n}\ninherits(Transform, Operator, {\n /**\n * Overrides {@link Operator.evaluate} for transform operators.\n * Internally, this method calls {@link evaluate} to perform processing.\n * If {@link evaluate} returns a falsy value, the input pulse is returned.\n * This method should NOT be overridden, instead overrride {@link evaluate}.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return the output pulse for this operator (or StopPropagation)\n */\n run(pulse) {\n if (pulse.stamp < this.stamp) return pulse.StopPropagation;\n let rv;\n if (this.skip()) {\n this.skip(false);\n } else {\n rv = this.evaluate(pulse);\n }\n rv = rv || pulse;\n if (rv.then) {\n rv = rv.then(_ => this.pulse = _);\n } else if (rv !== pulse.StopPropagation) {\n this.pulse = rv;\n }\n return rv;\n },\n /**\n * Overrides {@link Operator.evaluate} for transform operators.\n * Marshalls parameter values and then invokes {@link transform}.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return {Pulse} The output pulse (or StopPropagation). A falsy return\n value (including undefined) will let the input pulse pass through.\n */\n evaluate(pulse) {\n const params = this.marshall(pulse.stamp),\n out = this.transform(params, pulse);\n params.clear();\n return out;\n },\n /**\n * Process incoming pulses.\n * Subclasses should override this method to implement transforms.\n * @param {Parameters} _ - The operator parameter values.\n * @param {Pulse} pulse - The current dataflow pulse.\n * @return {Pulse} The output pulse (or StopPropagation). A falsy return\n * value (including undefined) will let the input pulse pass through.\n */\n transform() {}\n});\n\nconst transforms = {};\nfunction definition(type) {\n const t = transform(type);\n return t && t.Definition || null;\n}\nfunction transform(type) {\n type = type && type.toLowerCase();\n return hasOwnProperty(transforms, type) ? transforms[type] : null;\n}\n\nexport { Dataflow, EventStream, MultiPulse, Operator, Parameters, Pulse, Transform, UniqueList, asyncCallback, changeset, definition, derive, ingest$1 as ingest, isChangeSet, isTuple, rederive, replace, stableCompare, transform, transforms, tupleid };\n","export default function max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n","export default function min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n","import ascending from \"./ascending.js\";\nimport permute from \"./permute.js\";\n\nexport default function sort(values, ...F) {\n if (typeof values[Symbol.iterator] !== \"function\") throw new TypeError(\"values is not iterable\");\n values = Array.from(values);\n let [f] = F;\n if ((f && f.length !== 2) || F.length > 1) {\n const index = Uint32Array.from(values, (d, i) => i);\n if (F.length > 1) {\n F = F.map(f => values.map(f));\n index.sort((i, j) => {\n for (const f of F) {\n const c = ascendingDefined(f[i], f[j]);\n if (c) return c;\n }\n });\n } else {\n f = values.map(f);\n index.sort((i, j) => ascendingDefined(f[i], f[j]));\n }\n return permute(values, index);\n }\n return values.sort(compareDefined(f));\n}\n\nexport function compareDefined(compare = ascending) {\n if (compare === ascending) return ascendingDefined;\n if (typeof compare !== \"function\") throw new TypeError(\"compare is not a function\");\n return (a, b) => {\n const x = compare(a, b);\n if (x || x === 0) return x;\n return (compare(b, b) === 0) - (compare(a, a) === 0);\n };\n}\n\nexport function ascendingDefined(a, b) {\n return (a == null || !(a >= a)) - (b == null || !(b >= b)) || (a < b ? -1 : a > b ? 1 : 0);\n}\n","import {ascendingDefined, compareDefined} from \"./sort.js\";\n\n// Based on https://github.com/mourner/quickselect\n// ISC license, Copyright 2018 Vladimir Agafonkin.\nexport default function quickselect(array, k, left = 0, right = Infinity, compare) {\n k = Math.floor(k);\n left = Math.floor(Math.max(0, left));\n right = Math.floor(Math.min(array.length - 1, right));\n\n if (!(left <= k && k <= right)) return array;\n\n compare = compare === undefined ? ascendingDefined : compareDefined(compare);\n\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n const t = array[k];\n let i = left;\n let j = right;\n\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);\n else ++j, swap(array, j, right);\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n\n return array;\n}\n\nfunction swap(array, i, j) {\n const t = array[i];\n array[i] = array[j];\n array[j] = t;\n}\n","export default function number(x) {\n return x === null ? NaN : +x;\n}\n\nexport function* numbers(values, valueof) {\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n","import max from \"./max.js\";\nimport maxIndex from \"./maxIndex.js\";\nimport min from \"./min.js\";\nimport minIndex from \"./minIndex.js\";\nimport quickselect from \"./quickselect.js\";\nimport number, {numbers} from \"./number.js\";\nimport {ascendingDefined} from \"./sort.js\";\nimport greatest from \"./greatest.js\";\n\nexport default function quantile(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return min(values);\n if (p >= 1) return max(values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = max(quickselect(values, i0).subarray(0, i0 + 1)),\n value1 = min(values.subarray(i0 + 1));\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileSorted(values, p, valueof = number) {\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileIndex(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return minIndex(values);\n if (p >= 1) return maxIndex(values);\n var n,\n i = Math.floor((n - 1) * p),\n order = (i, j) => ascendingDefined(values[i], values[j]),\n index = quickselect(Uint32Array.from(values, (_, i) => i), i, 0, n - 1, order);\n return greatest(index.subarray(0, i + 1), i => values[i]);\n}\n","import quantile, {quantileIndex} from \"./quantile.js\";\n\nexport default function median(values, valueof) {\n return quantile(values, 0.5, valueof);\n}\n\nexport function medianIndex(values, valueof) {\n return quantileIndex(values, 0.5, valueof);\n}\n","import { ascending, quantileSorted, deviation, quantile, median } from 'd3-array';\n\nfunction* numbers (values, valueof) {\n if (valueof == null) {\n for (let value of values) {\n if (value != null && value !== '' && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n value = valueof(value, ++index, values);\n if (value != null && value !== '' && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n\nfunction quantiles (array, p, f) {\n const values = Float64Array.from(numbers(array, f));\n\n // don't depend on return value from typed array sort call\n // protects against undefined sort results in Safari (vega/vega-lite#4964)\n values.sort(ascending);\n return p.map(_ => quantileSorted(values, _));\n}\n\nfunction quartiles (array, f) {\n return quantiles(array, [0.25, 0.50, 0.75], f);\n}\n\n// Scott, D. W. (1992) Multivariate Density Estimation:\n// Theory, Practice, and Visualization. Wiley.\nfunction estimateBandwidth (array, f) {\n const n = array.length,\n d = deviation(array, f),\n q = quartiles(array, f),\n h = (q[2] - q[0]) / 1.34,\n v = Math.min(d, h) || d || Math.abs(q[0]) || 1;\n return 1.06 * v * Math.pow(n, -0.2);\n}\n\nfunction bin (_) {\n // determine range\n const maxb = _.maxbins || 20,\n base = _.base || 10,\n logb = Math.log(base),\n div = _.divide || [5, 2];\n let min = _.extent[0],\n max = _.extent[1],\n step,\n level,\n minstep,\n v,\n i,\n n;\n const span = _.span || max - min || Math.abs(min) || 1;\n if (_.step) {\n // if step size is explicitly given, use that\n step = _.step;\n } else if (_.steps) {\n // if provided, limit choice to acceptable step sizes\n v = span / maxb;\n for (i = 0, n = _.steps.length; i < n && _.steps[i] < v; ++i);\n step = _.steps[Math.max(0, i - 1)];\n } else {\n // else use span to determine step size\n level = Math.ceil(Math.log(maxb) / logb);\n minstep = _.minstep || 0;\n step = Math.max(minstep, Math.pow(base, Math.round(Math.log(span) / logb) - level));\n\n // increase step size if too many bins\n while (Math.ceil(span / step) > maxb) {\n step *= base;\n }\n\n // decrease step size if allowed\n for (i = 0, n = div.length; i < n; ++i) {\n v = step / div[i];\n if (v >= minstep && span / v <= maxb) step = v;\n }\n }\n\n // update precision, min and max\n v = Math.log(step);\n const precision = v >= 0 ? 0 : ~~(-v / logb) + 1,\n eps = Math.pow(base, -precision - 1);\n if (_.nice || _.nice === undefined) {\n v = Math.floor(min / step + eps) * step;\n min = min < v ? v - step : v;\n max = Math.ceil(max / step) * step;\n }\n return {\n start: min,\n stop: max === min ? min + step : max,\n step: step\n };\n}\n\nvar random = Math.random;\nfunction setRandom(r) {\n random = r;\n}\n\nfunction bootstrapCI (array, samples, alpha, f) {\n if (!array.length) return [undefined, undefined];\n const values = Float64Array.from(numbers(array, f)),\n n = values.length,\n m = samples;\n let a, i, j, mu;\n for (j = 0, mu = Array(m); j < m; ++j) {\n for (a = 0, i = 0; i < n; ++i) {\n a += values[~~(random() * n)];\n }\n mu[j] = a / n;\n }\n mu.sort(ascending);\n return [quantile(mu, alpha / 2), quantile(mu, 1 - alpha / 2)];\n}\n\n// Dot density binning for dot plot construction.\n// Based on Leland Wilkinson, Dot Plots, The American Statistician, 1999.\n// https://www.cs.uic.edu/~wilkinson/Publications/dotplots.pdf\nfunction dotbin (array, step, smooth, f) {\n f = f || (_ => _);\n const n = array.length,\n v = new Float64Array(n);\n let i = 0,\n j = 1,\n a = f(array[0]),\n b = a,\n w = a + step,\n x;\n for (; j < n; ++j) {\n x = f(array[j]);\n if (x >= w) {\n b = (a + b) / 2;\n for (; i < j; ++i) v[i] = b;\n w = x + step;\n a = x;\n }\n b = x;\n }\n b = (a + b) / 2;\n for (; i < j; ++i) v[i] = b;\n return smooth ? smoothing(v, step + step / 4) : v;\n}\n\n// perform smoothing to reduce variance\n// swap points between \"adjacent\" stacks\n// Wilkinson defines adjacent as within step/4 units\nfunction smoothing(v, thresh) {\n const n = v.length;\n let a = 0,\n b = 1,\n c,\n d;\n\n // get left stack\n while (v[a] === v[b]) ++b;\n while (b < n) {\n // get right stack\n c = b + 1;\n while (v[b] === v[c]) ++c;\n\n // are stacks adjacent?\n // if so, compare sizes and swap as needed\n if (v[b] - v[b - 1] < thresh) {\n d = b + (a + c - b - b >> 1);\n while (d < b) v[d++] = v[b];\n while (d > b) v[d--] = v[a];\n }\n\n // update left stack indices\n a = b;\n b = c;\n }\n return v;\n}\n\nfunction lcg (seed) {\n // Random numbers using a Linear Congruential Generator with seed value\n // Uses glibc values from https://en.wikipedia.org/wiki/Linear_congruential_generator\n return function () {\n seed = (1103515245 * seed + 12345) % 2147483647;\n return seed / 2147483647;\n };\n}\n\nfunction integer (min, max) {\n if (max == null) {\n max = min;\n min = 0;\n }\n let a, b, d;\n const dist = {\n min(_) {\n if (arguments.length) {\n a = _ || 0;\n d = b - a;\n return dist;\n } else {\n return a;\n }\n },\n max(_) {\n if (arguments.length) {\n b = _ || 0;\n d = b - a;\n return dist;\n } else {\n return b;\n }\n },\n sample() {\n return a + Math.floor(d * random());\n },\n pdf(x) {\n return x === Math.floor(x) && x >= a && x < b ? 1 / d : 0;\n },\n cdf(x) {\n const v = Math.floor(x);\n return v < a ? 0 : v >= b ? 1 : (v - a + 1) / d;\n },\n icdf(p) {\n return p >= 0 && p <= 1 ? a - 1 + Math.floor(p * d) : NaN;\n }\n };\n return dist.min(min).max(max);\n}\n\nconst SQRT2PI = Math.sqrt(2 * Math.PI);\nconst SQRT2 = Math.SQRT2;\n\nlet nextSample = NaN;\nfunction sampleNormal(mean, stdev) {\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n let x = 0,\n y = 0,\n rds,\n c;\n if (nextSample === nextSample) {\n x = nextSample;\n nextSample = NaN;\n } else {\n do {\n x = random() * 2 - 1;\n y = random() * 2 - 1;\n rds = x * x + y * y;\n } while (rds === 0 || rds > 1);\n c = Math.sqrt(-2 * Math.log(rds) / rds); // Box-Muller transform\n x *= c;\n nextSample = y * c;\n }\n return mean + x * stdev;\n}\nfunction densityNormal(value, mean, stdev) {\n stdev = stdev == null ? 1 : stdev;\n const z = (value - (mean || 0)) / stdev;\n return Math.exp(-0.5 * z * z) / (stdev * SQRT2PI);\n}\n\n// Approximation from West (2009)\n// Better Approximations to Cumulative Normal Functions\nfunction cumulativeNormal(value, mean, stdev) {\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n const z = (value - mean) / stdev,\n Z = Math.abs(z);\n let cd;\n if (Z > 37) {\n cd = 0;\n } else {\n const exp = Math.exp(-Z * Z / 2);\n let sum;\n if (Z < 7.07106781186547) {\n sum = 3.52624965998911e-02 * Z + 0.700383064443688;\n sum = sum * Z + 6.37396220353165;\n sum = sum * Z + 33.912866078383;\n sum = sum * Z + 112.079291497871;\n sum = sum * Z + 221.213596169931;\n sum = sum * Z + 220.206867912376;\n cd = exp * sum;\n sum = 8.83883476483184e-02 * Z + 1.75566716318264;\n sum = sum * Z + 16.064177579207;\n sum = sum * Z + 86.7807322029461;\n sum = sum * Z + 296.564248779674;\n sum = sum * Z + 637.333633378831;\n sum = sum * Z + 793.826512519948;\n sum = sum * Z + 440.413735824752;\n cd = cd / sum;\n } else {\n sum = Z + 0.65;\n sum = Z + 4 / sum;\n sum = Z + 3 / sum;\n sum = Z + 2 / sum;\n sum = Z + 1 / sum;\n cd = exp / sum / 2.506628274631;\n }\n }\n return z > 0 ? 1 - cd : cd;\n}\n\n// Approximation of Probit function using inverse error function.\nfunction quantileNormal(p, mean, stdev) {\n if (p < 0 || p > 1) return NaN;\n return (mean || 0) + (stdev == null ? 1 : stdev) * SQRT2 * erfinv(2 * p - 1);\n}\n\n// Approximate inverse error function. Implementation from \"Approximating\n// the erfinv function\" by Mike Giles, GPU Computing Gems, volume 2, 2010.\n// Ported from Apache Commons Math, http://www.apache.org/licenses/LICENSE-2.0\nfunction erfinv(x) {\n // beware that the logarithm argument must be\n // commputed as (1.0 - x) * (1.0 + x),\n // it must NOT be simplified as 1.0 - x * x as this\n // would induce rounding errors near the boundaries +/-1\n let w = -Math.log((1 - x) * (1 + x)),\n p;\n if (w < 6.25) {\n w -= 3.125;\n p = -3.6444120640178196996e-21;\n p = -1.685059138182016589e-19 + p * w;\n p = 1.2858480715256400167e-18 + p * w;\n p = 1.115787767802518096e-17 + p * w;\n p = -1.333171662854620906e-16 + p * w;\n p = 2.0972767875968561637e-17 + p * w;\n p = 6.6376381343583238325e-15 + p * w;\n p = -4.0545662729752068639e-14 + p * w;\n p = -8.1519341976054721522e-14 + p * w;\n p = 2.6335093153082322977e-12 + p * w;\n p = -1.2975133253453532498e-11 + p * w;\n p = -5.4154120542946279317e-11 + p * w;\n p = 1.051212273321532285e-09 + p * w;\n p = -4.1126339803469836976e-09 + p * w;\n p = -2.9070369957882005086e-08 + p * w;\n p = 4.2347877827932403518e-07 + p * w;\n p = -1.3654692000834678645e-06 + p * w;\n p = -1.3882523362786468719e-05 + p * w;\n p = 0.0001867342080340571352 + p * w;\n p = -0.00074070253416626697512 + p * w;\n p = -0.0060336708714301490533 + p * w;\n p = 0.24015818242558961693 + p * w;\n p = 1.6536545626831027356 + p * w;\n } else if (w < 16.0) {\n w = Math.sqrt(w) - 3.25;\n p = 2.2137376921775787049e-09;\n p = 9.0756561938885390979e-08 + p * w;\n p = -2.7517406297064545428e-07 + p * w;\n p = 1.8239629214389227755e-08 + p * w;\n p = 1.5027403968909827627e-06 + p * w;\n p = -4.013867526981545969e-06 + p * w;\n p = 2.9234449089955446044e-06 + p * w;\n p = 1.2475304481671778723e-05 + p * w;\n p = -4.7318229009055733981e-05 + p * w;\n p = 6.8284851459573175448e-05 + p * w;\n p = 2.4031110387097893999e-05 + p * w;\n p = -0.0003550375203628474796 + p * w;\n p = 0.00095328937973738049703 + p * w;\n p = -0.0016882755560235047313 + p * w;\n p = 0.0024914420961078508066 + p * w;\n p = -0.0037512085075692412107 + p * w;\n p = 0.005370914553590063617 + p * w;\n p = 1.0052589676941592334 + p * w;\n p = 3.0838856104922207635 + p * w;\n } else if (Number.isFinite(w)) {\n w = Math.sqrt(w) - 5.0;\n p = -2.7109920616438573243e-11;\n p = -2.5556418169965252055e-10 + p * w;\n p = 1.5076572693500548083e-09 + p * w;\n p = -3.7894654401267369937e-09 + p * w;\n p = 7.6157012080783393804e-09 + p * w;\n p = -1.4960026627149240478e-08 + p * w;\n p = 2.9147953450901080826e-08 + p * w;\n p = -6.7711997758452339498e-08 + p * w;\n p = 2.2900482228026654717e-07 + p * w;\n p = -9.9298272942317002539e-07 + p * w;\n p = 4.5260625972231537039e-06 + p * w;\n p = -1.9681778105531670567e-05 + p * w;\n p = 7.5995277030017761139e-05 + p * w;\n p = -0.00021503011930044477347 + p * w;\n p = -0.00013871931833623122026 + p * w;\n p = 1.0103004648645343977 + p * w;\n p = 4.8499064014085844221 + p * w;\n } else {\n p = Infinity;\n }\n return p * x;\n}\nfunction gaussian (mean, stdev) {\n let mu, sigma;\n const dist = {\n mean(_) {\n if (arguments.length) {\n mu = _ || 0;\n return dist;\n } else {\n return mu;\n }\n },\n stdev(_) {\n if (arguments.length) {\n sigma = _ == null ? 1 : _;\n return dist;\n } else {\n return sigma;\n }\n },\n sample: () => sampleNormal(mu, sigma),\n pdf: value => densityNormal(value, mu, sigma),\n cdf: value => cumulativeNormal(value, mu, sigma),\n icdf: p => quantileNormal(p, mu, sigma)\n };\n return dist.mean(mean).stdev(stdev);\n}\n\nfunction kde (support, bandwidth) {\n const kernel = gaussian();\n let n = 0;\n const dist = {\n data(_) {\n if (arguments.length) {\n support = _;\n n = _ ? _.length : 0;\n return dist.bandwidth(bandwidth);\n } else {\n return support;\n }\n },\n bandwidth(_) {\n if (!arguments.length) return bandwidth;\n bandwidth = _;\n if (!bandwidth && support) bandwidth = estimateBandwidth(support);\n return dist;\n },\n sample() {\n return support[~~(random() * n)] + bandwidth * kernel.sample();\n },\n pdf(x) {\n let y = 0,\n i = 0;\n for (; i < n; ++i) {\n y += kernel.pdf((x - support[i]) / bandwidth);\n }\n return y / bandwidth / n;\n },\n cdf(x) {\n let y = 0,\n i = 0;\n for (; i < n; ++i) {\n y += kernel.cdf((x - support[i]) / bandwidth);\n }\n return y / n;\n },\n icdf() {\n throw Error('KDE icdf not supported.');\n }\n };\n return dist.data(support);\n}\n\nfunction sampleLogNormal(mean, stdev) {\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n return Math.exp(mean + sampleNormal() * stdev);\n}\nfunction densityLogNormal(value, mean, stdev) {\n if (value <= 0) return 0;\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n const z = (Math.log(value) - mean) / stdev;\n return Math.exp(-0.5 * z * z) / (stdev * SQRT2PI * value);\n}\nfunction cumulativeLogNormal(value, mean, stdev) {\n return cumulativeNormal(Math.log(value), mean, stdev);\n}\nfunction quantileLogNormal(p, mean, stdev) {\n return Math.exp(quantileNormal(p, mean, stdev));\n}\nfunction lognormal (mean, stdev) {\n let mu, sigma;\n const dist = {\n mean(_) {\n if (arguments.length) {\n mu = _ || 0;\n return dist;\n } else {\n return mu;\n }\n },\n stdev(_) {\n if (arguments.length) {\n sigma = _ == null ? 1 : _;\n return dist;\n } else {\n return sigma;\n }\n },\n sample: () => sampleLogNormal(mu, sigma),\n pdf: value => densityLogNormal(value, mu, sigma),\n cdf: value => cumulativeLogNormal(value, mu, sigma),\n icdf: p => quantileLogNormal(p, mu, sigma)\n };\n return dist.mean(mean).stdev(stdev);\n}\n\nfunction mixture (dists, weights) {\n let m = 0,\n w;\n function normalize(x) {\n const w = [];\n let sum = 0,\n i;\n for (i = 0; i < m; ++i) {\n sum += w[i] = x[i] == null ? 1 : +x[i];\n }\n for (i = 0; i < m; ++i) {\n w[i] /= sum;\n }\n return w;\n }\n const dist = {\n weights(_) {\n if (arguments.length) {\n w = normalize(weights = _ || []);\n return dist;\n }\n return weights;\n },\n distributions(_) {\n if (arguments.length) {\n if (_) {\n m = _.length;\n dists = _;\n } else {\n m = 0;\n dists = [];\n }\n return dist.weights(weights);\n }\n return dists;\n },\n sample() {\n const r = random();\n let d = dists[m - 1],\n v = w[0],\n i = 0;\n\n // first select distribution\n for (; i < m - 1; v += w[++i]) {\n if (r < v) {\n d = dists[i];\n break;\n }\n }\n // then sample from it\n return d.sample();\n },\n pdf(x) {\n let p = 0,\n i = 0;\n for (; i < m; ++i) {\n p += w[i] * dists[i].pdf(x);\n }\n return p;\n },\n cdf(x) {\n let p = 0,\n i = 0;\n for (; i < m; ++i) {\n p += w[i] * dists[i].cdf(x);\n }\n return p;\n },\n icdf() {\n throw Error('Mixture icdf not supported.');\n }\n };\n return dist.distributions(dists).weights(weights);\n}\n\nfunction sampleUniform(min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return min + (max - min) * random();\n}\nfunction densityUniform(value, min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return value >= min && value <= max ? 1 / (max - min) : 0;\n}\nfunction cumulativeUniform(value, min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return value < min ? 0 : value > max ? 1 : (value - min) / (max - min);\n}\nfunction quantileUniform(p, min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return p >= 0 && p <= 1 ? min + p * (max - min) : NaN;\n}\nfunction uniform (min, max) {\n let a, b;\n const dist = {\n min(_) {\n if (arguments.length) {\n a = _ || 0;\n return dist;\n } else {\n return a;\n }\n },\n max(_) {\n if (arguments.length) {\n b = _ == null ? 1 : _;\n return dist;\n } else {\n return b;\n }\n },\n sample: () => sampleUniform(a, b),\n pdf: value => densityUniform(value, a, b),\n cdf: value => cumulativeUniform(value, a, b),\n icdf: p => quantileUniform(p, a, b)\n };\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return dist.min(min).max(max);\n}\n\nfunction constant (data, x, y) {\n let mean = 0,\n n = 0;\n for (const d of data) {\n const val = y(d);\n if (x(d) == null || val == null || isNaN(val)) continue;\n mean += (val - mean) / ++n;\n }\n return {\n coef: [mean],\n predict: () => mean,\n rSquared: 0\n };\n}\n\n// Ordinary Least Squares\nfunction ols (uX, uY, uXY, uX2) {\n const delta = uX2 - uX * uX,\n slope = Math.abs(delta) < 1e-24 ? 0 : (uXY - uX * uY) / delta,\n intercept = uY - slope * uX;\n return [intercept, slope];\n}\n\nfunction points(data, x, y, sort) {\n data = data.filter(d => {\n let u = x(d),\n v = y(d);\n return u != null && (u = +u) >= u && v != null && (v = +v) >= v;\n });\n if (sort) {\n data.sort((a, b) => x(a) - x(b));\n }\n const n = data.length,\n X = new Float64Array(n),\n Y = new Float64Array(n);\n\n // extract values, calculate means\n let i = 0,\n ux = 0,\n uy = 0,\n xv,\n yv,\n d;\n for (d of data) {\n X[i] = xv = +x(d);\n Y[i] = yv = +y(d);\n ++i;\n ux += (xv - ux) / i;\n uy += (yv - uy) / i;\n }\n\n // mean center the data\n for (i = 0; i < n; ++i) {\n X[i] -= ux;\n Y[i] -= uy;\n }\n return [X, Y, ux, uy];\n}\nfunction visitPoints(data, x, y, callback) {\n let i = -1,\n u,\n v;\n for (const d of data) {\n u = x(d);\n v = y(d);\n if (u != null && (u = +u) >= u && v != null && (v = +v) >= v) {\n callback(u, v, ++i);\n }\n }\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\nfunction rSquared (data, x, y, uY, predict) {\n let SSE = 0,\n SST = 0;\n visitPoints(data, x, y, (dx, dy) => {\n const sse = dy - predict(dx),\n sst = dy - uY;\n SSE += sse * sse;\n SST += sst * sst;\n });\n return 1 - SSE / SST;\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\nfunction linear (data, x, y) {\n let X = 0,\n Y = 0,\n XY = 0,\n X2 = 0,\n n = 0;\n visitPoints(data, x, y, (dx, dy) => {\n ++n;\n X += (dx - X) / n;\n Y += (dy - Y) / n;\n XY += (dx * dy - XY) / n;\n X2 += (dx * dx - X2) / n;\n });\n const coef = ols(X, Y, XY, X2),\n predict = x => coef[0] + coef[1] * x;\n return {\n coef: coef,\n predict: predict,\n rSquared: rSquared(data, x, y, Y, predict)\n };\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\nfunction log (data, x, y) {\n let X = 0,\n Y = 0,\n XY = 0,\n X2 = 0,\n n = 0;\n visitPoints(data, x, y, (dx, dy) => {\n ++n;\n dx = Math.log(dx);\n X += (dx - X) / n;\n Y += (dy - Y) / n;\n XY += (dx * dy - XY) / n;\n X2 += (dx * dx - X2) / n;\n });\n const coef = ols(X, Y, XY, X2),\n predict = x => coef[0] + coef[1] * Math.log(x);\n return {\n coef: coef,\n predict: predict,\n rSquared: rSquared(data, x, y, Y, predict)\n };\n}\n\nfunction exp (data, x, y) {\n // eslint-disable-next-line no-unused-vars\n const [xv, yv, ux, uy] = points(data, x, y);\n let YL = 0,\n XY = 0,\n XYL = 0,\n X2Y = 0,\n n = 0,\n dx,\n ly,\n xy;\n visitPoints(data, x, y, (_, dy) => {\n dx = xv[n++];\n ly = Math.log(dy);\n xy = dx * dy;\n YL += (dy * ly - YL) / n;\n XY += (xy - XY) / n;\n XYL += (xy * ly - XYL) / n;\n X2Y += (dx * xy - X2Y) / n;\n });\n const [c0, c1] = ols(XY / uy, YL / uy, XYL / uy, X2Y / uy),\n predict = x => Math.exp(c0 + c1 * (x - ux));\n return {\n coef: [Math.exp(c0 - c1 * ux), c1],\n predict: predict,\n rSquared: rSquared(data, x, y, uy, predict)\n };\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\nfunction pow (data, x, y) {\n let X = 0,\n Y = 0,\n XY = 0,\n X2 = 0,\n YS = 0,\n n = 0;\n visitPoints(data, x, y, (dx, dy) => {\n const lx = Math.log(dx),\n ly = Math.log(dy);\n ++n;\n X += (lx - X) / n;\n Y += (ly - Y) / n;\n XY += (lx * ly - XY) / n;\n X2 += (lx * lx - X2) / n;\n YS += (dy - YS) / n;\n });\n const coef = ols(X, Y, XY, X2),\n predict = x => coef[0] * Math.pow(x, coef[1]);\n coef[0] = Math.exp(coef[0]);\n return {\n coef: coef,\n predict: predict,\n rSquared: rSquared(data, x, y, YS, predict)\n };\n}\n\nfunction quad (data, x, y) {\n const [xv, yv, ux, uy] = points(data, x, y),\n n = xv.length;\n let X2 = 0,\n X3 = 0,\n X4 = 0,\n XY = 0,\n X2Y = 0,\n i,\n dx,\n dy,\n x2;\n for (i = 0; i < n;) {\n dx = xv[i];\n dy = yv[i++];\n x2 = dx * dx;\n X2 += (x2 - X2) / i;\n X3 += (x2 * dx - X3) / i;\n X4 += (x2 * x2 - X4) / i;\n XY += (dx * dy - XY) / i;\n X2Y += (x2 * dy - X2Y) / i;\n }\n const X2X2 = X4 - X2 * X2,\n d = X2 * X2X2 - X3 * X3,\n a = (X2Y * X2 - XY * X3) / d,\n b = (XY * X2X2 - X2Y * X3) / d,\n c = -a * X2,\n predict = x => {\n x = x - ux;\n return a * x * x + b * x + c + uy;\n };\n\n // transform coefficients back from mean-centered space\n return {\n coef: [c - b * ux + a * ux * ux + uy, b - 2 * a * ux, a],\n predict: predict,\n rSquared: rSquared(data, x, y, uy, predict)\n };\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\n// ... which was adapted from regression-js by Tom Alexander\n// Source: https://github.com/Tom-Alexander/regression-js/blob/master/src/regression.js#L246\n// License: https://github.com/Tom-Alexander/regression-js/blob/master/LICENSE\nfunction poly (data, x, y, order) {\n // use more efficient methods for lower orders\n if (order === 0) return constant(data, x, y);\n if (order === 1) return linear(data, x, y);\n if (order === 2) return quad(data, x, y);\n const [xv, yv, ux, uy] = points(data, x, y),\n n = xv.length,\n lhs = [],\n rhs = [],\n k = order + 1;\n let i, j, l, v, c;\n for (i = 0; i < k; ++i) {\n for (l = 0, v = 0; l < n; ++l) {\n v += Math.pow(xv[l], i) * yv[l];\n }\n lhs.push(v);\n c = new Float64Array(k);\n for (j = 0; j < k; ++j) {\n for (l = 0, v = 0; l < n; ++l) {\n v += Math.pow(xv[l], i + j);\n }\n c[j] = v;\n }\n rhs.push(c);\n }\n rhs.push(lhs);\n const coef = gaussianElimination(rhs),\n predict = x => {\n x -= ux;\n let y = uy + coef[0] + coef[1] * x + coef[2] * x * x;\n for (i = 3; i < k; ++i) y += coef[i] * Math.pow(x, i);\n return y;\n };\n return {\n coef: uncenter(k, coef, -ux, uy),\n predict: predict,\n rSquared: rSquared(data, x, y, uy, predict)\n };\n}\nfunction uncenter(k, a, x, y) {\n const z = Array(k);\n let i, j, v, c;\n\n // initialize to zero\n for (i = 0; i < k; ++i) z[i] = 0;\n\n // polynomial expansion\n for (i = k - 1; i >= 0; --i) {\n v = a[i];\n c = 1;\n z[i] += v;\n for (j = 1; j <= i; ++j) {\n c *= (i + 1 - j) / j; // binomial coefficent\n z[i - j] += v * Math.pow(x, j) * c;\n }\n }\n\n // bias term\n z[0] += y;\n return z;\n}\n\n// Given an array for a two-dimensional matrix and the polynomial order,\n// solve A * x = b using Gaussian elimination.\nfunction gaussianElimination(matrix) {\n const n = matrix.length - 1,\n coef = [];\n let i, j, k, r, t;\n for (i = 0; i < n; ++i) {\n r = i; // max row\n for (j = i + 1; j < n; ++j) {\n if (Math.abs(matrix[i][j]) > Math.abs(matrix[i][r])) {\n r = j;\n }\n }\n for (k = i; k < n + 1; ++k) {\n t = matrix[k][i];\n matrix[k][i] = matrix[k][r];\n matrix[k][r] = t;\n }\n for (j = i + 1; j < n; ++j) {\n for (k = n; k >= i; k--) {\n matrix[k][j] -= matrix[k][i] * matrix[i][j] / matrix[i][i];\n }\n }\n }\n for (j = n - 1; j >= 0; --j) {\n t = 0;\n for (k = j + 1; k < n; ++k) {\n t += matrix[k][j] * coef[k];\n }\n coef[j] = (matrix[n][j] - t) / matrix[j][j];\n }\n return coef;\n}\n\nconst maxiters = 2,\n epsilon = 1e-12;\n\n// Adapted from science.js by Jason Davies\n// Source: https://github.com/jasondavies/science.js/blob/master/src/stats/loess.js\n// License: https://github.com/jasondavies/science.js/blob/master/LICENSE\nfunction loess (data, x, y, bandwidth) {\n const [xv, yv, ux, uy] = points(data, x, y, true),\n n = xv.length,\n bw = Math.max(2, ~~(bandwidth * n)),\n // # nearest neighbors\n yhat = new Float64Array(n),\n residuals = new Float64Array(n),\n robustWeights = new Float64Array(n).fill(1);\n for (let iter = -1; ++iter <= maxiters;) {\n const interval = [0, bw - 1];\n for (let i = 0; i < n; ++i) {\n const dx = xv[i],\n i0 = interval[0],\n i1 = interval[1],\n edge = dx - xv[i0] > xv[i1] - dx ? i0 : i1;\n let W = 0,\n X = 0,\n Y = 0,\n XY = 0,\n X2 = 0;\n const denom = 1 / Math.abs(xv[edge] - dx || 1); // avoid singularity!\n\n for (let k = i0; k <= i1; ++k) {\n const xk = xv[k],\n yk = yv[k],\n w = tricube(Math.abs(dx - xk) * denom) * robustWeights[k],\n xkw = xk * w;\n W += w;\n X += xkw;\n Y += yk * w;\n XY += yk * xkw;\n X2 += xk * xkw;\n }\n\n // linear regression fit\n const [a, b] = ols(X / W, Y / W, XY / W, X2 / W);\n yhat[i] = a + b * dx;\n residuals[i] = Math.abs(yv[i] - yhat[i]);\n updateInterval(xv, i + 1, interval);\n }\n if (iter === maxiters) {\n break;\n }\n const medianResidual = median(residuals);\n if (Math.abs(medianResidual) < epsilon) break;\n for (let i = 0, arg, w; i < n; ++i) {\n arg = residuals[i] / (6 * medianResidual);\n // default to epsilon (rather than zero) for large deviations\n // keeping weights tiny but non-zero prevents singularites\n robustWeights[i] = arg >= 1 ? epsilon : (w = 1 - arg * arg) * w;\n }\n }\n return output(xv, yhat, ux, uy);\n}\n\n// weighting kernel for local regression\nfunction tricube(x) {\n return (x = 1 - x * x * x) * x * x;\n}\n\n// advance sliding window interval of nearest neighbors\nfunction updateInterval(xv, i, interval) {\n const val = xv[i];\n let left = interval[0],\n right = interval[1] + 1;\n if (right >= xv.length) return;\n\n // step right if distance to new right edge is <= distance to old left edge\n // step when distance is equal to ensure movement over duplicate x values\n while (i > left && xv[right] - val <= val - xv[left]) {\n interval[0] = ++left;\n interval[1] = right;\n ++right;\n }\n}\n\n// generate smoothed output points\n// average points with repeated x values\nfunction output(xv, yhat, ux, uy) {\n const n = xv.length,\n out = [];\n let i = 0,\n cnt = 0,\n prev = [],\n v;\n for (; i < n; ++i) {\n v = xv[i] + ux;\n if (prev[0] === v) {\n // average output values via online update\n prev[1] += (yhat[i] - prev[1]) / ++cnt;\n } else {\n // add new output point\n cnt = 0;\n prev[1] += uy;\n prev = [v, yhat[i]];\n out.push(prev);\n }\n }\n prev[1] += uy;\n return out;\n}\n\n// subdivide up to accuracy of 0.5 degrees\nconst MIN_RADIANS = 0.5 * Math.PI / 180;\n\n// Adaptively sample an interpolated function over a domain extent\nfunction sampleCurve (f, extent, minSteps, maxSteps) {\n minSteps = minSteps || 25;\n maxSteps = Math.max(minSteps, maxSteps || 200);\n const point = x => [x, f(x)],\n minX = extent[0],\n maxX = extent[1],\n span = maxX - minX,\n stop = span / maxSteps,\n prev = [point(minX)],\n next = [];\n if (minSteps === maxSteps) {\n // no adaptation, sample uniform grid directly and return\n for (let i = 1; i < maxSteps; ++i) {\n prev.push(point(minX + i / minSteps * span));\n }\n prev.push(point(maxX));\n return prev;\n } else {\n // sample minimum points on uniform grid\n // then move on to perform adaptive refinement\n next.push(point(maxX));\n for (let i = minSteps; --i > 0;) {\n next.push(point(minX + i / minSteps * span));\n }\n }\n let p0 = prev[0];\n let p1 = next[next.length - 1];\n const sx = 1 / span;\n const sy = scaleY(p0[1], next);\n while (p1) {\n // midpoint for potential curve subdivision\n const pm = point((p0[0] + p1[0]) / 2);\n const dx = pm[0] - p0[0] >= stop;\n if (dx && angleDelta(p0, pm, p1, sx, sy) > MIN_RADIANS) {\n // maximum resolution has not yet been met, and\n // subdivision midpoint is sufficiently different from endpoint\n // save subdivision, push midpoint onto the visitation stack\n next.push(pm);\n } else {\n // subdivision midpoint sufficiently similar to endpoint\n // skip subdivision, store endpoint, move to next point on the stack\n p0 = p1;\n prev.push(p1);\n next.pop();\n }\n p1 = next[next.length - 1];\n }\n return prev;\n}\nfunction scaleY(init, points) {\n let ymin = init;\n let ymax = init;\n const n = points.length;\n for (let i = 0; i < n; ++i) {\n const y = points[i][1];\n if (y < ymin) ymin = y;\n if (y > ymax) ymax = y;\n }\n return 1 / (ymax - ymin);\n}\nfunction angleDelta(p, q, r, sx, sy) {\n const a0 = Math.atan2(sy * (r[1] - p[1]), sx * (r[0] - p[0])),\n a1 = Math.atan2(sy * (q[1] - p[1]), sx * (q[0] - p[0]));\n return Math.abs(a0 - a1);\n}\n\nexport { estimateBandwidth as bandwidthNRD, bin, bootstrapCI, cumulativeLogNormal, cumulativeNormal, cumulativeUniform, densityLogNormal, densityNormal, densityUniform, dotbin, quantileLogNormal, quantileNormal, quantileUniform, quantiles, quartiles, random, integer as randomInteger, kde as randomKDE, lcg as randomLCG, lognormal as randomLogNormal, mixture as randomMixture, gaussian as randomNormal, uniform as randomUniform, constant as regressionConstant, exp as regressionExp, linear as regressionLinear, loess as regressionLoess, log as regressionLog, poly as regressionPoly, pow as regressionPow, quad as regressionQuad, sampleCurve, sampleLogNormal, sampleNormal, sampleUniform, setRandom };\n","import variance from \"./variance.js\";\n\nexport default function deviation(values, valueof) {\n const v = variance(values, valueof);\n return v ? Math.sqrt(v) : v;\n}\n","export default function variance(values, valueof) {\n let count = 0;\n let delta;\n let mean = 0;\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n delta = value - mean;\n mean += delta / ++count;\n sum += delta * (value - mean);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n delta = value - mean;\n mean += delta / ++count;\n sum += delta * (value - mean);\n }\n }\n }\n if (count > 1) return sum / (count - 1);\n}\n","export default function range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","import { extend, identity, field, hasOwnProperty, extentIndex, inherits, array, accessorName, error, accessorFields, accessor, toNumber, merge, compare, truthy, extent, span, fastmap, isArray, key, ascending, peek, zero, constant } from 'vega-util';\nimport { tupleid, Transform, replace, ingest, stableCompare, Operator, derive, rederive } from 'vega-dataflow';\nimport { quartiles, bootstrapCI, bin, randomKDE, randomMixture, randomNormal, randomLogNormal, randomUniform, sampleCurve, dotbin, quantiles, random } from 'vega-statistics';\nimport { median, mean, min, max, range, bisector } from 'd3-array';\nimport { TIME_UNITS, utcInterval, timeInterval, timeBin, timeUnits, utcFloor, timeFloor } from 'vega-time';\n\nfunction multikey(f) {\n return x => {\n const n = f.length;\n let i = 1,\n k = String(f[0](x));\n for (; i < n; ++i) {\n k += '|' + f[i](x);\n }\n return k;\n };\n}\nfunction groupkey(fields) {\n return !fields || !fields.length ? function () {\n return '';\n } : fields.length === 1 ? fields[0] : multikey(fields);\n}\n\nfunction measureName(op, field, as) {\n return as || op + (!field ? '' : '_' + field);\n}\nconst noop = () => {};\nconst base_op = {\n init: noop,\n add: noop,\n rem: noop,\n idx: 0\n};\nconst AggregateOps = {\n values: {\n init: m => m.cell.store = true,\n value: m => m.cell.data.values(),\n idx: -1\n },\n count: {\n value: m => m.cell.num\n },\n __count__: {\n value: m => m.missing + m.valid\n },\n missing: {\n value: m => m.missing\n },\n valid: {\n value: m => m.valid\n },\n sum: {\n init: m => m.sum = 0,\n value: m => m.valid ? m.sum : undefined,\n add: (m, v) => m.sum += +v,\n rem: (m, v) => m.sum -= v\n },\n product: {\n init: m => m.product = 1,\n value: m => m.valid ? m.product : undefined,\n add: (m, v) => m.product *= v,\n rem: (m, v) => m.product /= v\n },\n mean: {\n init: m => m.mean = 0,\n value: m => m.valid ? m.mean : undefined,\n add: (m, v) => (m.mean_d = v - m.mean, m.mean += m.mean_d / m.valid),\n rem: (m, v) => (m.mean_d = v - m.mean, m.mean -= m.valid ? m.mean_d / m.valid : m.mean)\n },\n average: {\n value: m => m.valid ? m.mean : undefined,\n req: ['mean'],\n idx: 1\n },\n variance: {\n init: m => m.dev = 0,\n value: m => m.valid > 1 ? m.dev / (m.valid - 1) : undefined,\n add: (m, v) => m.dev += m.mean_d * (v - m.mean),\n rem: (m, v) => m.dev -= m.mean_d * (v - m.mean),\n req: ['mean'],\n idx: 1\n },\n variancep: {\n value: m => m.valid > 1 ? m.dev / m.valid : undefined,\n req: ['variance'],\n idx: 2\n },\n stdev: {\n value: m => m.valid > 1 ? Math.sqrt(m.dev / (m.valid - 1)) : undefined,\n req: ['variance'],\n idx: 2\n },\n stdevp: {\n value: m => m.valid > 1 ? Math.sqrt(m.dev / m.valid) : undefined,\n req: ['variance'],\n idx: 2\n },\n stderr: {\n value: m => m.valid > 1 ? Math.sqrt(m.dev / (m.valid * (m.valid - 1))) : undefined,\n req: ['variance'],\n idx: 2\n },\n distinct: {\n value: m => m.cell.data.distinct(m.get),\n req: ['values'],\n idx: 3\n },\n ci0: {\n value: m => m.cell.data.ci0(m.get),\n req: ['values'],\n idx: 3\n },\n ci1: {\n value: m => m.cell.data.ci1(m.get),\n req: ['values'],\n idx: 3\n },\n median: {\n value: m => m.cell.data.q2(m.get),\n req: ['values'],\n idx: 3\n },\n q1: {\n value: m => m.cell.data.q1(m.get),\n req: ['values'],\n idx: 3\n },\n q3: {\n value: m => m.cell.data.q3(m.get),\n req: ['values'],\n idx: 3\n },\n min: {\n init: m => m.min = undefined,\n value: m => m.min = Number.isNaN(m.min) ? m.cell.data.min(m.get) : m.min,\n add: (m, v) => {\n if (v < m.min || m.min === undefined) m.min = v;\n },\n rem: (m, v) => {\n if (v <= m.min) m.min = NaN;\n },\n req: ['values'],\n idx: 4\n },\n max: {\n init: m => m.max = undefined,\n value: m => m.max = Number.isNaN(m.max) ? m.cell.data.max(m.get) : m.max,\n add: (m, v) => {\n if (v > m.max || m.max === undefined) m.max = v;\n },\n rem: (m, v) => {\n if (v >= m.max) m.max = NaN;\n },\n req: ['values'],\n idx: 4\n },\n argmin: {\n init: m => m.argmin = undefined,\n value: m => m.argmin || m.cell.data.argmin(m.get),\n add: (m, v, t) => {\n if (v < m.min) m.argmin = t;\n },\n rem: (m, v) => {\n if (v <= m.min) m.argmin = undefined;\n },\n req: ['min', 'values'],\n idx: 3\n },\n argmax: {\n init: m => m.argmax = undefined,\n value: m => m.argmax || m.cell.data.argmax(m.get),\n add: (m, v, t) => {\n if (v > m.max) m.argmax = t;\n },\n rem: (m, v) => {\n if (v >= m.max) m.argmax = undefined;\n },\n req: ['max', 'values'],\n idx: 3\n },\n exponential: {\n init: (m, r) => {\n m.exp = 0;\n m.exp_r = r;\n },\n value: m => m.valid ? m.exp * (1 - m.exp_r) / (1 - m.exp_r ** m.valid) : undefined,\n add: (m, v) => m.exp = m.exp_r * m.exp + v,\n rem: (m, v) => m.exp = (m.exp - v / m.exp_r ** (m.valid - 1)) / m.exp_r\n },\n exponentialb: {\n value: m => m.valid ? m.exp * (1 - m.exp_r) : undefined,\n req: ['exponential'],\n idx: 1\n }\n};\nconst ValidAggregateOps = Object.keys(AggregateOps).filter(d => d !== '__count__');\nfunction measure(key, value) {\n return (out, aggregate_param) => extend({\n name: key,\n aggregate_param: aggregate_param,\n out: out || key\n }, base_op, value);\n}\n[...ValidAggregateOps, '__count__'].forEach(key => {\n AggregateOps[key] = measure(key, AggregateOps[key]);\n});\nfunction createMeasure(op, param, name) {\n return AggregateOps[op](name, param);\n}\nfunction compareIndex(a, b) {\n return a.idx - b.idx;\n}\nfunction resolve(agg) {\n const map = {};\n agg.forEach(a => map[a.name] = a);\n const getreqs = a => {\n if (!a.req) return;\n a.req.forEach(key => {\n if (!map[key]) getreqs(map[key] = AggregateOps[key]());\n });\n };\n agg.forEach(getreqs);\n return Object.values(map).sort(compareIndex);\n}\nfunction init() {\n this.valid = 0;\n this.missing = 0;\n this._ops.forEach(op => op.aggregate_param == null ? op.init(this) : op.init(this, op.aggregate_param));\n}\nfunction add(v, t) {\n if (v == null || v === '') {\n ++this.missing;\n return;\n }\n if (v !== v) return;\n ++this.valid;\n this._ops.forEach(op => op.add(this, v, t));\n}\nfunction rem(v, t) {\n if (v == null || v === '') {\n --this.missing;\n return;\n }\n if (v !== v) return;\n --this.valid;\n this._ops.forEach(op => op.rem(this, v, t));\n}\nfunction set(t) {\n this._out.forEach(op => t[op.out] = op.value(this));\n return t;\n}\nfunction compileMeasures(agg, field) {\n const get = field || identity,\n ops = resolve(agg),\n out = agg.slice().sort(compareIndex);\n function ctr(cell) {\n this._ops = ops;\n this._out = out;\n this.cell = cell;\n this.init();\n }\n ctr.prototype.init = init;\n ctr.prototype.add = add;\n ctr.prototype.rem = rem;\n ctr.prototype.set = set;\n ctr.prototype.get = get;\n ctr.fields = agg.map(op => op.out);\n return ctr;\n}\n\nfunction TupleStore(key) {\n this._key = key ? field(key) : tupleid;\n this.reset();\n}\nconst prototype$1 = TupleStore.prototype;\nprototype$1.reset = function () {\n this._add = [];\n this._rem = [];\n this._ext = null;\n this._get = null;\n this._q = null;\n};\nprototype$1.add = function (v) {\n this._add.push(v);\n};\nprototype$1.rem = function (v) {\n this._rem.push(v);\n};\nprototype$1.values = function () {\n this._get = null;\n if (this._rem.length === 0) return this._add;\n const a = this._add,\n r = this._rem,\n k = this._key,\n n = a.length,\n m = r.length,\n x = Array(n - m),\n map = {};\n let i, j, v;\n\n // use unique key field to clear removed values\n for (i = 0; i < m; ++i) {\n map[k(r[i])] = 1;\n }\n for (i = 0, j = 0; i < n; ++i) {\n if (map[k(v = a[i])]) {\n map[k(v)] = 0;\n } else {\n x[j++] = v;\n }\n }\n this._rem = [];\n return this._add = x;\n};\n\n// memoizing statistics methods\n\nprototype$1.distinct = function (get) {\n const v = this.values(),\n map = {};\n let n = v.length,\n count = 0,\n s;\n while (--n >= 0) {\n s = get(v[n]) + '';\n if (!hasOwnProperty(map, s)) {\n map[s] = 1;\n ++count;\n }\n }\n return count;\n};\nprototype$1.extent = function (get) {\n if (this._get !== get || !this._ext) {\n const v = this.values(),\n i = extentIndex(v, get);\n this._ext = [v[i[0]], v[i[1]]];\n this._get = get;\n }\n return this._ext;\n};\nprototype$1.argmin = function (get) {\n return this.extent(get)[0] || {};\n};\nprototype$1.argmax = function (get) {\n return this.extent(get)[1] || {};\n};\nprototype$1.min = function (get) {\n const m = this.extent(get)[0];\n return m != null ? get(m) : undefined;\n};\nprototype$1.max = function (get) {\n const m = this.extent(get)[1];\n return m != null ? get(m) : undefined;\n};\nprototype$1.quartile = function (get) {\n if (this._get !== get || !this._q) {\n this._q = quartiles(this.values(), get);\n this._get = get;\n }\n return this._q;\n};\nprototype$1.q1 = function (get) {\n return this.quartile(get)[0];\n};\nprototype$1.q2 = function (get) {\n return this.quartile(get)[1];\n};\nprototype$1.q3 = function (get) {\n return this.quartile(get)[2];\n};\nprototype$1.ci = function (get) {\n if (this._get !== get || !this._ci) {\n this._ci = bootstrapCI(this.values(), 1000, 0.05, get);\n this._get = get;\n }\n return this._ci;\n};\nprototype$1.ci0 = function (get) {\n return this.ci(get)[0];\n};\nprototype$1.ci1 = function (get) {\n return this.ci(get)[1];\n};\n\n/**\n * Group-by aggregation operator.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {Array} [params.fields] - An array of accessors to aggregate.\n * @param {Array} [params.ops] - An array of strings indicating aggregation operations.\n * @param {Array} [params.aggregate_params] - An optional array of parameters for aggregation operations.\n * @param {Array} [params.as] - An array of output field names for aggregated values.\n * @param {boolean} [params.cross=false] - A flag indicating that the full\n * cross-product of groupby values should be generated, including empty cells.\n * If true, the drop parameter is ignored and empty cells are retained.\n * @param {boolean} [params.drop=true] - A flag indicating if empty cells should be removed.\n */\nfunction Aggregate(params) {\n Transform.call(this, null, params);\n this._adds = []; // array of added output tuples\n this._mods = []; // array of modified output tuples\n this._alen = 0; // number of active added tuples\n this._mlen = 0; // number of active modified tuples\n this._drop = true; // should empty aggregation cells be removed\n this._cross = false; // produce full cross-product of group-by values\n\n this._dims = []; // group-by dimension accessors\n this._dnames = []; // group-by dimension names\n\n this._measures = []; // collection of aggregation monoids\n this._countOnly = false; // flag indicating only count aggregation\n this._counts = null; // collection of count fields\n this._prev = null; // previous aggregation cells\n\n this._inputs = null; // array of dependent input tuple field names\n this._outputs = null; // array of output tuple field names\n}\nAggregate.Definition = {\n 'type': 'Aggregate',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'ops',\n 'type': 'enum',\n 'array': true,\n 'values': ValidAggregateOps\n }, {\n 'name': 'aggregate_params',\n 'type': 'number',\n 'null': true,\n 'array': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'null': true,\n 'array': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }, {\n 'name': 'drop',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'cross',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'key',\n 'type': 'field'\n }]\n};\ninherits(Aggregate, Transform, {\n transform(_, pulse) {\n const aggr = this,\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n mod = _.modified();\n aggr.stamp = out.stamp;\n if (aggr.value && (mod || pulse.modified(aggr._inputs, true))) {\n aggr._prev = aggr.value;\n aggr.value = mod ? aggr.init(_) : Object.create(null);\n pulse.visit(pulse.SOURCE, t => aggr.add(t));\n } else {\n aggr.value = aggr.value || aggr.init(_);\n pulse.visit(pulse.REM, t => aggr.rem(t));\n pulse.visit(pulse.ADD, t => aggr.add(t));\n }\n\n // Indicate output fields and return aggregate tuples.\n out.modifies(aggr._outputs);\n\n // Should empty cells be dropped?\n aggr._drop = _.drop !== false;\n\n // If domain cross-product requested, generate empty cells as needed\n // and ensure that empty cells are not dropped\n if (_.cross && aggr._dims.length > 1) {\n aggr._drop = false;\n aggr.cross();\n }\n if (pulse.clean() && aggr._drop) {\n out.clean(true).runAfter(() => this.clean());\n }\n return aggr.changes(out);\n },\n cross() {\n const aggr = this,\n curr = aggr.value,\n dims = aggr._dnames,\n vals = dims.map(() => ({})),\n n = dims.length;\n\n // collect all group-by domain values\n function collect(cells) {\n let key, i, t, v;\n for (key in cells) {\n t = cells[key].tuple;\n for (i = 0; i < n; ++i) {\n vals[i][v = t[dims[i]]] = v;\n }\n }\n }\n collect(aggr._prev);\n collect(curr);\n\n // iterate over key cross-product, create cells as needed\n function generate(base, tuple, index) {\n const name = dims[index],\n v = vals[index++];\n for (const k in v) {\n const key = base ? base + '|' + k : k;\n tuple[name] = v[k];\n if (index < n) generate(key, tuple, index);else if (!curr[key]) aggr.cell(key, tuple);\n }\n }\n generate('', {}, 0);\n },\n init(_) {\n // initialize input and output fields\n const inputs = this._inputs = [],\n outputs = this._outputs = [],\n inputMap = {};\n function inputVisit(get) {\n const fields = array(accessorFields(get)),\n n = fields.length;\n let i = 0,\n f;\n for (; i < n; ++i) {\n if (!inputMap[f = fields[i]]) {\n inputMap[f] = 1;\n inputs.push(f);\n }\n }\n }\n\n // initialize group-by dimensions\n this._dims = array(_.groupby);\n this._dnames = this._dims.map(d => {\n const dname = accessorName(d);\n inputVisit(d);\n outputs.push(dname);\n return dname;\n });\n this.cellkey = _.key ? _.key : groupkey(this._dims);\n\n // initialize aggregate measures\n this._countOnly = true;\n this._counts = [];\n this._measures = [];\n const fields = _.fields || [null],\n ops = _.ops || ['count'],\n aggregate_params = _.aggregate_params || [null],\n as = _.as || [],\n n = fields.length,\n map = {};\n let field, op, aggregate_param, m, mname, outname, i;\n if (n !== ops.length) {\n error('Unmatched number of fields and aggregate ops.');\n }\n for (i = 0; i < n; ++i) {\n field = fields[i];\n op = ops[i];\n aggregate_param = aggregate_params[i] || null;\n if (field == null && op !== 'count') {\n error('Null aggregate field specified.');\n }\n mname = accessorName(field);\n outname = measureName(op, mname, as[i]);\n outputs.push(outname);\n if (op === 'count') {\n this._counts.push(outname);\n continue;\n }\n m = map[mname];\n if (!m) {\n inputVisit(field);\n m = map[mname] = [];\n m.field = field;\n this._measures.push(m);\n }\n if (op !== 'count') this._countOnly = false;\n m.push(createMeasure(op, aggregate_param, outname));\n }\n this._measures = this._measures.map(m => compileMeasures(m, m.field));\n return Object.create(null); // aggregation cells (this.value)\n },\n // -- Cell Management -----\n\n cellkey: groupkey(),\n cell(key, t) {\n let cell = this.value[key];\n if (!cell) {\n cell = this.value[key] = this.newcell(key, t);\n this._adds[this._alen++] = cell;\n } else if (cell.num === 0 && this._drop && cell.stamp < this.stamp) {\n cell.stamp = this.stamp;\n this._adds[this._alen++] = cell;\n } else if (cell.stamp < this.stamp) {\n cell.stamp = this.stamp;\n this._mods[this._mlen++] = cell;\n }\n return cell;\n },\n newcell(key, t) {\n const cell = {\n key: key,\n num: 0,\n agg: null,\n tuple: this.newtuple(t, this._prev && this._prev[key]),\n stamp: this.stamp,\n store: false\n };\n if (!this._countOnly) {\n const measures = this._measures,\n n = measures.length;\n cell.agg = Array(n);\n for (let i = 0; i < n; ++i) {\n cell.agg[i] = new measures[i](cell);\n }\n }\n if (cell.store) {\n cell.data = new TupleStore();\n }\n return cell;\n },\n newtuple(t, p) {\n const names = this._dnames,\n dims = this._dims,\n n = dims.length,\n x = {};\n for (let i = 0; i < n; ++i) {\n x[names[i]] = dims[i](t);\n }\n return p ? replace(p.tuple, x) : ingest(x);\n },\n clean() {\n const cells = this.value;\n for (const key in cells) {\n if (cells[key].num === 0) {\n delete cells[key];\n }\n }\n },\n // -- Process Tuples -----\n\n add(t) {\n const key = this.cellkey(t),\n cell = this.cell(key, t);\n cell.num += 1;\n if (this._countOnly) return;\n if (cell.store) cell.data.add(t);\n const agg = cell.agg;\n for (let i = 0, n = agg.length; i < n; ++i) {\n agg[i].add(agg[i].get(t), t);\n }\n },\n rem(t) {\n const key = this.cellkey(t),\n cell = this.cell(key, t);\n cell.num -= 1;\n if (this._countOnly) return;\n if (cell.store) cell.data.rem(t);\n const agg = cell.agg;\n for (let i = 0, n = agg.length; i < n; ++i) {\n agg[i].rem(agg[i].get(t), t);\n }\n },\n celltuple(cell) {\n const tuple = cell.tuple,\n counts = this._counts;\n\n // consolidate stored values\n if (cell.store) {\n cell.data.values();\n }\n\n // update tuple properties\n for (let i = 0, n = counts.length; i < n; ++i) {\n tuple[counts[i]] = cell.num;\n }\n if (!this._countOnly) {\n const agg = cell.agg;\n for (let i = 0, n = agg.length; i < n; ++i) {\n agg[i].set(tuple);\n }\n }\n return tuple;\n },\n changes(out) {\n const adds = this._adds,\n mods = this._mods,\n prev = this._prev,\n drop = this._drop,\n add = out.add,\n rem = out.rem,\n mod = out.mod;\n let cell, key, i, n;\n if (prev) for (key in prev) {\n cell = prev[key];\n if (!drop || cell.num) rem.push(cell.tuple);\n }\n for (i = 0, n = this._alen; i < n; ++i) {\n add.push(this.celltuple(adds[i]));\n adds[i] = null; // for garbage collection\n }\n for (i = 0, n = this._mlen; i < n; ++i) {\n cell = mods[i];\n (cell.num === 0 && drop ? rem : mod).push(this.celltuple(cell));\n mods[i] = null; // for garbage collection\n }\n this._alen = this._mlen = 0; // reset list of active cells\n this._prev = null;\n return out;\n }\n});\n\n// epsilon bias to offset floating point error (#1737)\nconst EPSILON$1 = 1e-14;\n\n/**\n * Generates a binning function for discretizing data.\n * @constructor\n * @param {object} params - The parameters for this operator. The\n * provided values should be valid options for the {@link bin} function.\n * @param {function(object): *} params.field - The data field to bin.\n */\nfunction Bin(params) {\n Transform.call(this, null, params);\n}\nBin.Definition = {\n 'type': 'Bin',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'interval',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'anchor',\n 'type': 'number'\n }, {\n 'name': 'maxbins',\n 'type': 'number',\n 'default': 20\n }, {\n 'name': 'base',\n 'type': 'number',\n 'default': 10\n }, {\n 'name': 'divide',\n 'type': 'number',\n 'array': true,\n 'default': [5, 2]\n }, {\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'required': true\n }, {\n 'name': 'span',\n 'type': 'number'\n }, {\n 'name': 'step',\n 'type': 'number'\n }, {\n 'name': 'steps',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'minstep',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'nice',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'name',\n 'type': 'string'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['bin0', 'bin1']\n }]\n};\ninherits(Bin, Transform, {\n transform(_, pulse) {\n const band = _.interval !== false,\n bins = this._bins(_),\n start = bins.start,\n step = bins.step,\n as = _.as || ['bin0', 'bin1'],\n b0 = as[0],\n b1 = as[1];\n let flag;\n if (_.modified()) {\n pulse = pulse.reflow(true);\n flag = pulse.SOURCE;\n } else {\n flag = pulse.modified(accessorFields(_.field)) ? pulse.ADD_MOD : pulse.ADD;\n }\n pulse.visit(flag, band ? t => {\n const v = bins(t);\n // minimum bin value (inclusive)\n t[b0] = v;\n // maximum bin value (exclusive)\n // use convoluted math for better floating point agreement\n // see https://github.com/vega/vega/issues/830\n // infinite values propagate through this formula! #2227\n t[b1] = v == null ? null : start + step * (1 + (v - start) / step);\n } : t => t[b0] = bins(t));\n return pulse.modifies(band ? as : b0);\n },\n _bins(_) {\n if (this.value && !_.modified()) {\n return this.value;\n }\n const field = _.field,\n bins = bin(_),\n step = bins.step;\n let start = bins.start,\n stop = start + Math.ceil((bins.stop - start) / step) * step,\n a,\n d;\n if ((a = _.anchor) != null) {\n d = a - (start + step * Math.floor((a - start) / step));\n start += d;\n stop += d;\n }\n const f = function (t) {\n let v = toNumber(field(t));\n return v == null ? null : v < start ? -Infinity : v > stop ? +Infinity : (v = Math.max(start, Math.min(v, stop - step)), start + step * Math.floor(EPSILON$1 + (v - start) / step));\n };\n f.start = start;\n f.stop = bins.stop;\n f.step = step;\n return this.value = accessor(f, accessorFields(field), _.name || 'bin_' + accessorName(field));\n }\n});\n\nfunction SortedList (idFunc, source, input) {\n const $ = idFunc;\n let data = source || [],\n add = input || [],\n rem = {},\n cnt = 0;\n return {\n add: t => add.push(t),\n remove: t => rem[$(t)] = ++cnt,\n size: () => data.length,\n data: (compare, resort) => {\n if (cnt) {\n data = data.filter(t => !rem[$(t)]);\n rem = {};\n cnt = 0;\n }\n if (resort && compare) {\n data.sort(compare);\n }\n if (add.length) {\n data = compare ? merge(compare, data, add.sort(compare)) : data.concat(add);\n add = [];\n }\n return data;\n }\n };\n}\n\n/**\n * Collects all data tuples that pass through this operator.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - An optional\n * comparator function for additionally sorting the collected tuples.\n */\nfunction Collect(params) {\n Transform.call(this, [], params);\n}\nCollect.Definition = {\n 'type': 'Collect',\n 'metadata': {\n 'source': true\n },\n 'params': [{\n 'name': 'sort',\n 'type': 'compare'\n }]\n};\ninherits(Collect, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.ALL),\n list = SortedList(tupleid, this.value, out.materialize(out.ADD).add),\n sort = _.sort,\n mod = pulse.changed() || sort && (_.modified('sort') || pulse.modified(sort.fields));\n out.visit(out.REM, list.remove);\n this.modified(mod);\n this.value = out.source = list.data(stableCompare(sort), mod);\n\n // propagate tree root if defined\n if (pulse.source && pulse.source.root) {\n this.value.root = pulse.source.root;\n }\n return out;\n }\n});\n\n/**\n * Generates a comparator function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - The fields to compare.\n * @param {Array} [params.orders] - The sort orders.\n * Each entry should be one of \"ascending\" (default) or \"descending\".\n */\nfunction Compare(params) {\n Operator.call(this, null, update$5, params);\n}\ninherits(Compare, Operator);\nfunction update$5(_) {\n return this.value && !_.modified() ? this.value : compare(_.fields, _.orders);\n}\n\n/**\n * Count regexp-defined pattern occurrences in a text field.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - An accessor for the text field.\n * @param {string} [params.pattern] - RegExp string defining the text pattern.\n * @param {string} [params.case] - One of 'lower', 'upper' or null (mixed) case.\n * @param {string} [params.stopwords] - RegExp string of words to ignore.\n */\nfunction CountPattern(params) {\n Transform.call(this, null, params);\n}\nCountPattern.Definition = {\n 'type': 'CountPattern',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'case',\n 'type': 'enum',\n 'values': ['upper', 'lower', 'mixed'],\n 'default': 'mixed'\n }, {\n 'name': 'pattern',\n 'type': 'string',\n 'default': '[\\\\w\"]+'\n }, {\n 'name': 'stopwords',\n 'type': 'string',\n 'default': ''\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['text', 'count']\n }]\n};\nfunction tokenize(text, tcase, match) {\n switch (tcase) {\n case 'upper':\n text = text.toUpperCase();\n break;\n case 'lower':\n text = text.toLowerCase();\n break;\n }\n return text.match(match);\n}\ninherits(CountPattern, Transform, {\n transform(_, pulse) {\n const process = update => tuple => {\n var tokens = tokenize(get(tuple), _.case, match) || [],\n t;\n for (var i = 0, n = tokens.length; i < n; ++i) {\n if (!stop.test(t = tokens[i])) update(t);\n }\n };\n const init = this._parameterCheck(_, pulse),\n counts = this._counts,\n match = this._match,\n stop = this._stop,\n get = _.field,\n as = _.as || ['text', 'count'],\n add = process(t => counts[t] = 1 + (counts[t] || 0)),\n rem = process(t => counts[t] -= 1);\n if (init) {\n pulse.visit(pulse.SOURCE, add);\n } else {\n pulse.visit(pulse.ADD, add);\n pulse.visit(pulse.REM, rem);\n }\n return this._finish(pulse, as); // generate output tuples\n },\n _parameterCheck(_, pulse) {\n let init = false;\n if (_.modified('stopwords') || !this._stop) {\n this._stop = new RegExp('^' + (_.stopwords || '') + '$', 'i');\n init = true;\n }\n if (_.modified('pattern') || !this._match) {\n this._match = new RegExp(_.pattern || '[\\\\w\\']+', 'g');\n init = true;\n }\n if (_.modified('field') || pulse.modified(_.field.fields)) {\n init = true;\n }\n if (init) this._counts = {};\n return init;\n },\n _finish(pulse, as) {\n const counts = this._counts,\n tuples = this._tuples || (this._tuples = {}),\n text = as[0],\n count = as[1],\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n let w, t, c;\n for (w in counts) {\n t = tuples[w];\n c = counts[w] || 0;\n if (!t && c) {\n tuples[w] = t = ingest({});\n t[text] = w;\n t[count] = c;\n out.add.push(t);\n } else if (c === 0) {\n if (t) out.rem.push(t);\n counts[w] = null;\n tuples[w] = null;\n } else if (t[count] !== c) {\n t[count] = c;\n out.mod.push(t);\n }\n }\n return out.modifies(as);\n }\n});\n\n/**\n * Perform a cross-product of a tuple stream with itself.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object):boolean} [params.filter] - An optional filter\n * function for selectively including tuples in the cross product.\n * @param {Array} [params.as] - The names of the output fields.\n */\nfunction Cross(params) {\n Transform.call(this, null, params);\n}\nCross.Definition = {\n 'type': 'Cross',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'filter',\n 'type': 'expr'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['a', 'b']\n }]\n};\ninherits(Cross, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n as = _.as || ['a', 'b'],\n a = as[0],\n b = as[1],\n reset = !this.value || pulse.changed(pulse.ADD_REM) || _.modified('as') || _.modified('filter');\n let data = this.value;\n if (reset) {\n if (data) out.rem = data;\n data = pulse.materialize(pulse.SOURCE).source;\n out.add = this.value = cross(data, a, b, _.filter || truthy);\n } else {\n out.mod = data;\n }\n out.source = this.value;\n return out.modifies(as);\n }\n});\nfunction cross(input, a, b, filter) {\n var data = [],\n t = {},\n n = input.length,\n i = 0,\n j,\n left;\n for (; i < n; ++i) {\n t[a] = left = input[i];\n for (j = 0; j < n; ++j) {\n t[b] = input[j];\n if (filter(t)) {\n data.push(ingest(t));\n t = {};\n t[a] = left;\n }\n }\n }\n return data;\n}\n\nconst Distributions = {\n kde: randomKDE,\n mixture: randomMixture,\n normal: randomNormal,\n lognormal: randomLogNormal,\n uniform: randomUniform\n};\nconst DISTRIBUTIONS = 'distributions',\n FUNCTION = 'function',\n FIELD = 'field';\n\n/**\n * Parse a parameter object for a probability distribution.\n * @param {object} def - The distribution parameter object.\n * @param {function():Array} - A method for requesting\n * source data. Used for distributions (such as KDE) that\n * require sample data points. This method will only be\n * invoked if the 'from' parameter for a target data source\n * is not provided. Typically this method returns backing\n * source data for a Pulse object.\n * @return {object} - The output distribution object.\n */\nfunction parse(def, data) {\n const func = def[FUNCTION];\n if (!hasOwnProperty(Distributions, func)) {\n error('Unknown distribution function: ' + func);\n }\n const d = Distributions[func]();\n for (const name in def) {\n // if data field, extract values\n if (name === FIELD) {\n d.data((def.from || data()).map(def[name]));\n }\n\n // if distribution mixture, recurse to parse each definition\n else if (name === DISTRIBUTIONS) {\n d[name](def[name].map(_ => parse(_, data)));\n }\n\n // otherwise, simply set the parameter\n else if (typeof d[name] === FUNCTION) {\n d[name](def[name]);\n }\n }\n return d;\n}\n\n/**\n * Grid sample points for a probability density. Given a distribution and\n * a sampling extent, will generate points suitable for plotting either\n * PDF (probability density function) or CDF (cumulative distribution\n * function) curves.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.distribution - The probability distribution. This\n * is an object parameter dependent on the distribution type.\n * @param {string} [params.method='pdf'] - The distribution method to sample.\n * One of 'pdf' or 'cdf'.\n * @param {Array} [params.extent] - The [min, max] extent over which\n * to sample the distribution. This argument is required in most cases, but\n * can be omitted if the distribution (e.g., 'kde') supports a 'data' method\n * that returns numerical sample points from which the extent can be deduced.\n * @param {number} [params.minsteps=25] - The minimum number of curve samples\n * for plotting the density.\n * @param {number} [params.maxsteps=200] - The maximum number of curve samples\n * for plotting the density.\n * @param {number} [params.steps] - The exact number of curve samples for\n * plotting the density. If specified, overrides both minsteps and maxsteps\n * to set an exact number of uniform samples. Useful in conjunction with\n * a fixed extent to ensure consistent sample points for stacked densities.\n */\nfunction Density(params) {\n Transform.call(this, null, params);\n}\nconst distributions = [{\n 'key': {\n 'function': 'normal'\n },\n 'params': [{\n 'name': 'mean',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'stdev',\n 'type': 'number',\n 'default': 1\n }]\n}, {\n 'key': {\n 'function': 'lognormal'\n },\n 'params': [{\n 'name': 'mean',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'stdev',\n 'type': 'number',\n 'default': 1\n }]\n}, {\n 'key': {\n 'function': 'uniform'\n },\n 'params': [{\n 'name': 'min',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'max',\n 'type': 'number',\n 'default': 1\n }]\n}, {\n 'key': {\n 'function': 'kde'\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'from',\n 'type': 'data'\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'default': 0\n }]\n}];\nconst mixture = {\n 'key': {\n 'function': 'mixture'\n },\n 'params': [{\n 'name': 'distributions',\n 'type': 'param',\n 'array': true,\n 'params': distributions\n }, {\n 'name': 'weights',\n 'type': 'number',\n 'array': true\n }]\n};\nDensity.Definition = {\n 'type': 'Density',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'steps',\n 'type': 'number'\n }, {\n 'name': 'minsteps',\n 'type': 'number',\n 'default': 25\n }, {\n 'name': 'maxsteps',\n 'type': 'number',\n 'default': 200\n }, {\n 'name': 'method',\n 'type': 'string',\n 'default': 'pdf',\n 'values': ['pdf', 'cdf']\n }, {\n 'name': 'distribution',\n 'type': 'param',\n 'params': distributions.concat(mixture)\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'default': ['value', 'density']\n }]\n};\ninherits(Density, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n if (!this.value || pulse.changed() || _.modified()) {\n const dist = parse(_.distribution, source(pulse)),\n minsteps = _.steps || _.minsteps || 25,\n maxsteps = _.steps || _.maxsteps || 200;\n let method = _.method || 'pdf';\n if (method !== 'pdf' && method !== 'cdf') {\n error('Invalid density method: ' + method);\n }\n if (!_.extent && !dist.data) {\n error('Missing density extent parameter.');\n }\n method = dist[method];\n const as = _.as || ['value', 'density'],\n domain = _.extent || extent(dist.data()),\n values = sampleCurve(method, domain, minsteps, maxsteps).map(v => {\n const tuple = {};\n tuple[as[0]] = v[0];\n tuple[as[1]] = v[1];\n return ingest(tuple);\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n return out;\n }\n});\nfunction source(pulse) {\n return () => pulse.materialize(pulse.SOURCE).source;\n}\n\n// use either provided alias or accessor field name\nfunction fieldNames(fields, as) {\n if (!fields) return null;\n return fields.map((f, i) => as[i] || accessorName(f));\n}\nfunction partition$1(data, groupby, field) {\n const groups = [],\n get = f => f(t);\n let map, i, n, t, k, g;\n\n // partition data points into groups\n if (groupby == null) {\n groups.push(data.map(field));\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n if (!g) {\n map[k] = g = [];\n g.dims = k;\n groups.push(g);\n }\n g.push(field(t));\n }\n }\n return groups;\n}\n\nconst Output = 'bin';\n\n/**\n * Dot density binning for dot plot construction.\n * Based on Leland Wilkinson, Dot Plots, The American Statistician, 1999.\n * https://www.cs.uic.edu/~wilkinson/Publications/dotplots.pdf\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to bin.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {number} [params.step] - The step size (bin width) within which dots should be\n * stacked. Defaults to 1/30 of the extent of the data *field*.\n * @param {boolean} [params.smooth=false] - A boolean flag indicating if dot density\n * stacks should be smoothed to reduce variance.\n */\nfunction DotBin(params) {\n Transform.call(this, null, params);\n}\nDotBin.Definition = {\n 'type': 'DotBin',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'step',\n 'type': 'number'\n }, {\n 'name': 'smooth',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': Output\n }]\n};\nconst autostep = (data, field) => span(extent(data, field)) / 30;\ninherits(DotBin, Transform, {\n transform(_, pulse) {\n if (this.value && !(_.modified() || pulse.changed())) {\n return pulse; // early exit\n }\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition$1(pulse.source, _.groupby, identity),\n smooth = _.smooth || false,\n field = _.field,\n step = _.step || autostep(source, field),\n sort = stableCompare((a, b) => field(a) - field(b)),\n as = _.as || Output,\n n = groups.length;\n\n // compute dotplot bins per group\n let min = Infinity,\n max = -Infinity,\n i = 0,\n j;\n for (; i < n; ++i) {\n const g = groups[i].sort(sort);\n j = -1;\n for (const v of dotbin(g, step, smooth, field)) {\n if (v < min) min = v;\n if (v > max) max = v;\n g[++j][as] = v;\n }\n }\n this.value = {\n start: min,\n stop: max,\n step: step\n };\n return pulse.reflow(true).modifies(as);\n }\n});\n\n/**\n * Wraps an expression function with access to external parameters.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function} params.expr - The expression function. The\n * function should accept both a datum and a parameter object.\n * This operator's value will be a new function that wraps the\n * expression function with access to this operator's parameters.\n */\nfunction Expression(params) {\n Operator.call(this, null, update$4, params);\n this.modified(true);\n}\ninherits(Expression, Operator);\nfunction update$4(_) {\n const expr = _.expr;\n return this.value && !_.modified('expr') ? this.value : accessor(datum => expr(datum, _), accessorFields(expr), accessorName(expr));\n}\n\n/**\n * Computes extents (min/max) for a data field.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The field over which to compute extends.\n */\nfunction Extent(params) {\n Transform.call(this, [undefined, undefined], params);\n}\nExtent.Definition = {\n 'type': 'Extent',\n 'metadata': {},\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }]\n};\ninherits(Extent, Transform, {\n transform(_, pulse) {\n const extent = this.value,\n field = _.field,\n mod = pulse.changed() || pulse.modified(field.fields) || _.modified('field');\n let min = extent[0],\n max = extent[1];\n if (mod || min == null) {\n min = +Infinity;\n max = -Infinity;\n }\n pulse.visit(mod ? pulse.SOURCE : pulse.ADD, t => {\n const v = toNumber(field(t));\n if (v != null) {\n // NaNs will fail all comparisons!\n if (v < min) min = v;\n if (v > max) max = v;\n }\n });\n if (!Number.isFinite(min) || !Number.isFinite(max)) {\n let name = accessorName(field);\n if (name) name = ` for field \"${name}\"`;\n pulse.dataflow.warn(`Infinite extent${name}: [${min}, ${max}]`);\n min = max = undefined;\n }\n this.value = [min, max];\n }\n});\n\n/**\n * Provides a bridge between a parent transform and a target subflow that\n * consumes only a subset of the tuples that pass through the parent.\n * @constructor\n * @param {Pulse} pulse - A pulse to use as the value of this operator.\n * @param {Transform} parent - The parent transform (typically a Facet instance).\n */\nfunction Subflow(pulse, parent) {\n Operator.call(this, pulse);\n this.parent = parent;\n this.count = 0;\n}\ninherits(Subflow, Operator, {\n /**\n * Routes pulses from this subflow to a target transform.\n * @param {Transform} target - A transform that receives the subflow of tuples.\n */\n connect(target) {\n this.detachSubflow = target.detachSubflow;\n this.targets().add(target);\n return target.source = this;\n },\n /**\n * Add an 'add' tuple to the subflow pulse.\n * @param {Tuple} t - The tuple being added.\n */\n add(t) {\n this.count += 1;\n this.value.add.push(t);\n },\n /**\n * Add a 'rem' tuple to the subflow pulse.\n * @param {Tuple} t - The tuple being removed.\n */\n rem(t) {\n this.count -= 1;\n this.value.rem.push(t);\n },\n /**\n * Add a 'mod' tuple to the subflow pulse.\n * @param {Tuple} t - The tuple being modified.\n */\n mod(t) {\n this.value.mod.push(t);\n },\n /**\n * Re-initialize this operator's pulse value.\n * @param {Pulse} pulse - The pulse to copy from.\n * @see Pulse.init\n */\n init(pulse) {\n this.value.init(pulse, pulse.NO_SOURCE);\n },\n /**\n * Evaluate this operator. This method overrides the\n * default behavior to simply return the contained pulse value.\n * @return {Pulse}\n */\n evaluate() {\n // assert: this.value.stamp === pulse.stamp\n return this.value;\n }\n});\n\n/**\n * Facets a dataflow into a set of subflows based on a key.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(Dataflow, string): Operator} params.subflow - A function\n * that generates a subflow of operators and returns its root operator.\n * @param {function(object): *} params.key - The key field to facet by.\n */\nfunction Facet(params) {\n Transform.call(this, {}, params);\n this._keys = fastmap(); // cache previously calculated key values\n\n // keep track of active subflows, use as targets array for listeners\n // this allows us to limit propagation to only updated subflows\n const a = this._targets = [];\n a.active = 0;\n a.forEach = f => {\n for (let i = 0, n = a.active; i < n; ++i) {\n f(a[i], i, a);\n }\n };\n}\ninherits(Facet, Transform, {\n activate(flow) {\n this._targets[this._targets.active++] = flow;\n },\n // parent argument provided by PreFacet subclass\n subflow(key, flow, pulse, parent) {\n const flows = this.value;\n let sf = hasOwnProperty(flows, key) && flows[key],\n df,\n p;\n if (!sf) {\n p = parent || (p = this._group[key]) && p.tuple;\n df = pulse.dataflow;\n sf = new Subflow(pulse.fork(pulse.NO_SOURCE), this);\n df.add(sf).connect(flow(df, key, p));\n flows[key] = sf;\n this.activate(sf);\n } else if (sf.value.stamp < pulse.stamp) {\n sf.init(pulse);\n this.activate(sf);\n }\n return sf;\n },\n clean() {\n const flows = this.value;\n let detached = 0;\n for (const key in flows) {\n if (flows[key].count === 0) {\n const detach = flows[key].detachSubflow;\n if (detach) detach();\n delete flows[key];\n ++detached;\n }\n }\n\n // remove inactive targets from the active targets array\n if (detached) {\n const active = this._targets.filter(sf => sf && sf.count > 0);\n this.initTargets(active);\n }\n },\n initTargets(act) {\n const a = this._targets,\n n = a.length,\n m = act ? act.length : 0;\n let i = 0;\n for (; i < m; ++i) {\n a[i] = act[i];\n }\n for (; i < n && a[i] != null; ++i) {\n a[i] = null; // ensure old flows can be garbage collected\n }\n a.active = m;\n },\n transform(_, pulse) {\n const df = pulse.dataflow,\n key = _.key,\n flow = _.subflow,\n cache = this._keys,\n rekey = _.modified('key'),\n subflow = key => this.subflow(key, flow, pulse);\n this._group = _.group || {};\n this.initTargets(); // reset list of active subflows\n\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t),\n k = cache.get(id);\n if (k !== undefined) {\n cache.delete(id);\n subflow(k).rem(t);\n }\n });\n pulse.visit(pulse.ADD, t => {\n const k = key(t);\n cache.set(tupleid(t), k);\n subflow(k).add(t);\n });\n if (rekey || pulse.modified(key.fields)) {\n pulse.visit(pulse.MOD, t => {\n const id = tupleid(t),\n k0 = cache.get(id),\n k1 = key(t);\n if (k0 === k1) {\n subflow(k1).mod(t);\n } else {\n cache.set(id, k1);\n subflow(k0).rem(t);\n subflow(k1).add(t);\n }\n });\n } else if (pulse.changed(pulse.MOD)) {\n pulse.visit(pulse.MOD, t => {\n subflow(cache.get(tupleid(t))).mod(t);\n });\n }\n if (rekey) {\n pulse.visit(pulse.REFLOW, t => {\n const id = tupleid(t),\n k0 = cache.get(id),\n k1 = key(t);\n if (k0 !== k1) {\n cache.set(id, k1);\n subflow(k0).rem(t);\n subflow(k1).add(t);\n }\n });\n }\n if (pulse.clean()) {\n df.runAfter(() => {\n this.clean();\n cache.clean();\n });\n } else if (cache.empty > df.cleanThreshold) {\n df.runAfter(cache.clean);\n }\n return pulse;\n }\n});\n\n/**\n * Generates one or more field accessor functions.\n * If the 'name' parameter is an array, an array of field accessors\n * will be created and the 'as' parameter will be ignored.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {string} params.name - The field name(s) to access.\n * @param {string} params.as - The accessor function name.\n */\nfunction Field(params) {\n Operator.call(this, null, update$3, params);\n}\ninherits(Field, Operator);\nfunction update$3(_) {\n return this.value && !_.modified() ? this.value : isArray(_.name) ? array(_.name).map(f => field(f)) : field(_.name, _.as);\n}\n\n/**\n * Filters data tuples according to a predicate function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.expr - The predicate expression function\n * that determines a tuple's filter status. Truthy values pass the filter.\n */\nfunction Filter(params) {\n Transform.call(this, fastmap(), params);\n}\nFilter.Definition = {\n 'type': 'Filter',\n 'metadata': {\n 'changes': true\n },\n 'params': [{\n 'name': 'expr',\n 'type': 'expr',\n 'required': true\n }]\n};\ninherits(Filter, Transform, {\n transform(_, pulse) {\n const df = pulse.dataflow,\n cache = this.value,\n // cache ids of filtered tuples\n output = pulse.fork(),\n add = output.add,\n rem = output.rem,\n mod = output.mod,\n test = _.expr;\n let isMod = true;\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n if (!cache.has(id)) rem.push(t);else cache.delete(id);\n });\n pulse.visit(pulse.ADD, t => {\n if (test(t, _)) add.push(t);else cache.set(tupleid(t), 1);\n });\n function revisit(t) {\n const id = tupleid(t),\n b = test(t, _),\n s = cache.get(id);\n if (b && s) {\n cache.delete(id);\n add.push(t);\n } else if (!b && !s) {\n cache.set(id, 1);\n rem.push(t);\n } else if (isMod && b && !s) {\n mod.push(t);\n }\n }\n pulse.visit(pulse.MOD, revisit);\n if (_.modified()) {\n isMod = false;\n pulse.visit(pulse.REFLOW, revisit);\n }\n if (cache.empty > df.cleanThreshold) df.runAfter(cache.clean);\n return output;\n }\n});\n\n/**\n * Flattens array-typed field values into new data objects.\n * If multiple fields are specified, they are treated as parallel arrays,\n * with output values included for each matching index (or null if missing).\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - An array of field\n * accessors for the tuple fields that should be flattened.\n * @param {string} [params.index] - Optional output field name for index\n * value. If unspecified, no index field is included in the output.\n * @param {Array} [params.as] - Output field names for flattened\n * array fields. Any unspecified fields will use the field name provided\n * by the fields accessors.\n */\nfunction Flatten(params) {\n Transform.call(this, [], params);\n}\nFlatten.Definition = {\n 'type': 'Flatten',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'index',\n 'type': 'string'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }]\n};\ninherits(Flatten, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n fields = _.fields,\n as = fieldNames(fields, _.as || []),\n index = _.index || null,\n m = as.length;\n\n // remove any previous results\n out.rem = this.value;\n\n // generate flattened tuples\n pulse.visit(pulse.SOURCE, t => {\n const arrays = fields.map(f => f(t)),\n maxlen = arrays.reduce((l, a) => Math.max(l, a.length), 0);\n let i = 0,\n j,\n d,\n v;\n for (; i < maxlen; ++i) {\n d = derive(t);\n for (j = 0; j < m; ++j) {\n d[as[j]] = (v = arrays[j][i]) == null ? null : v;\n }\n if (index) {\n d[index] = i;\n }\n out.add.push(d);\n }\n });\n this.value = out.source = out.add;\n if (index) out.modifies(index);\n return out.modifies(as);\n }\n});\n\n/**\n * Folds one more tuple fields into multiple tuples in which the field\n * name and values are available under new 'key' and 'value' fields.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.fields - An array of field accessors\n * for the tuple fields that should be folded.\n * @param {Array} [params.as] - Output field names for folded key\n * and value fields, defaults to ['key', 'value'].\n */\nfunction Fold(params) {\n Transform.call(this, [], params);\n}\nFold.Definition = {\n 'type': 'Fold',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['key', 'value']\n }]\n};\ninherits(Fold, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n fields = _.fields,\n fnames = fields.map(accessorName),\n as = _.as || ['key', 'value'],\n k = as[0],\n v = as[1],\n n = fields.length;\n out.rem = this.value;\n pulse.visit(pulse.SOURCE, t => {\n for (let i = 0, d; i < n; ++i) {\n d = derive(t);\n d[k] = fnames[i];\n d[v] = fields[i](t);\n out.add.push(d);\n }\n });\n this.value = out.source = out.add;\n return out.modifies(as);\n }\n});\n\n/**\n * Invokes a function for each data tuple and saves the results as a new field.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.expr - The formula function to invoke for each tuple.\n * @param {string} params.as - The field name under which to save the result.\n * @param {boolean} [params.initonly=false] - If true, the formula is applied to\n * added tuples only, and does not update in response to modifications.\n */\nfunction Formula(params) {\n Transform.call(this, null, params);\n}\nFormula.Definition = {\n 'type': 'Formula',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'expr',\n 'type': 'expr',\n 'required': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'required': true\n }, {\n 'name': 'initonly',\n 'type': 'boolean'\n }]\n};\ninherits(Formula, Transform, {\n transform(_, pulse) {\n const func = _.expr,\n as = _.as,\n mod = _.modified(),\n flag = _.initonly ? pulse.ADD : mod ? pulse.SOURCE : pulse.modified(func.fields) || pulse.modified(as) ? pulse.ADD_MOD : pulse.ADD;\n if (mod) {\n // parameters updated, need to reflow\n pulse = pulse.materialize().reflow(true);\n }\n if (!_.initonly) {\n pulse.modifies(as);\n }\n return pulse.visit(flag, t => t[as] = func(t, _));\n }\n});\n\n/**\n * Generates data tuples using a provided generator function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(Parameters): object} params.generator - A tuple generator\n * function. This function is given the operator parameters as input.\n * Changes to any additional parameters will not trigger re-calculation\n * of previously generated tuples. Only future tuples are affected.\n * @param {number} params.size - The number of tuples to produce.\n */\nfunction Generate(params) {\n Transform.call(this, [], params);\n}\ninherits(Generate, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.ALL),\n gen = _.generator;\n let data = this.value,\n num = _.size - data.length,\n add,\n rem,\n t;\n if (num > 0) {\n // need more tuples, generate and add\n for (add = []; --num >= 0;) {\n add.push(t = ingest(gen(_)));\n data.push(t);\n }\n out.add = out.add.length ? out.materialize(out.ADD).add.concat(add) : add;\n } else {\n // need fewer tuples, remove\n rem = data.slice(0, -num);\n out.rem = out.rem.length ? out.materialize(out.REM).rem.concat(rem) : rem;\n data = data.slice(-num);\n }\n out.source = this.value = data;\n return out;\n }\n});\n\nconst Methods = {\n value: 'value',\n median: median,\n mean: mean,\n min: min,\n max: max\n};\nconst Empty = [];\n\n/**\n * Impute missing values.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to impute.\n * @param {Array} [params.groupby] - An array of\n * accessors to determine series within which to perform imputation.\n * @param {function(object): *} params.key - An accessor for a key value.\n * Each key value should be unique within a group. New tuples will be\n * imputed for any key values that are not found within a group.\n * @param {Array<*>} [params.keyvals] - Optional array of required key\n * values. New tuples will be imputed for any key values that are not\n * found within a group. In addition, these values will be automatically\n * augmented with the key values observed in the input data.\n * @param {string} [method='value'] - The imputation method to use. One of\n * 'value', 'mean', 'median', 'max', 'min'.\n * @param {*} [value=0] - The constant value to use for imputation\n * when using method 'value'.\n */\nfunction Impute(params) {\n Transform.call(this, [], params);\n}\nImpute.Definition = {\n 'type': 'Impute',\n 'metadata': {\n 'changes': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'key',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'keyvals',\n 'array': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'method',\n 'type': 'enum',\n 'default': 'value',\n 'values': ['value', 'mean', 'median', 'max', 'min']\n }, {\n 'name': 'value',\n 'default': 0\n }]\n};\nfunction getValue(_) {\n var m = _.method || Methods.value,\n v;\n if (Methods[m] == null) {\n error('Unrecognized imputation method: ' + m);\n } else if (m === Methods.value) {\n v = _.value !== undefined ? _.value : 0;\n return () => v;\n } else {\n return Methods[m];\n }\n}\nfunction getField(_) {\n const f = _.field;\n return t => t ? f(t) : NaN;\n}\ninherits(Impute, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ALL),\n impute = getValue(_),\n field = getField(_),\n fName = accessorName(_.field),\n kName = accessorName(_.key),\n gNames = (_.groupby || []).map(accessorName),\n groups = partition(pulse.source, _.groupby, _.key, _.keyvals),\n curr = [],\n prev = this.value,\n m = groups.domain.length,\n group,\n value,\n gVals,\n kVal,\n g,\n i,\n j,\n l,\n n,\n t;\n for (g = 0, l = groups.length; g < l; ++g) {\n group = groups[g];\n gVals = group.values;\n value = NaN;\n\n // add tuples for missing values\n for (j = 0; j < m; ++j) {\n if (group[j] != null) continue;\n kVal = groups.domain[j];\n t = {\n _impute: true\n };\n for (i = 0, n = gVals.length; i < n; ++i) t[gNames[i]] = gVals[i];\n t[kName] = kVal;\n t[fName] = Number.isNaN(value) ? value = impute(group, field) : value;\n curr.push(ingest(t));\n }\n }\n\n // update pulse with imputed tuples\n if (curr.length) out.add = out.materialize(out.ADD).add.concat(curr);\n if (prev.length) out.rem = out.materialize(out.REM).rem.concat(prev);\n this.value = curr;\n return out;\n }\n});\nfunction partition(data, groupby, key, keyvals) {\n var get = f => f(t),\n groups = [],\n domain = keyvals ? keyvals.slice() : [],\n kMap = {},\n gMap = {},\n gVals,\n gKey,\n group,\n i,\n j,\n k,\n n,\n t;\n domain.forEach((k, i) => kMap[k] = i + 1);\n for (i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = key(t);\n j = kMap[k] || (kMap[k] = domain.push(k));\n gKey = (gVals = groupby ? groupby.map(get) : Empty) + '';\n if (!(group = gMap[gKey])) {\n group = gMap[gKey] = [];\n groups.push(group);\n group.values = gVals;\n }\n group[j - 1] = t;\n }\n groups.domain = domain;\n return groups;\n}\n\n/**\n * Extend input tuples with aggregate values.\n * Calcuates aggregate values and joins them with the input stream.\n * @constructor\n */\nfunction JoinAggregate(params) {\n Aggregate.call(this, params);\n}\nJoinAggregate.Definition = {\n 'type': 'JoinAggregate',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'null': true,\n 'array': true\n }, {\n 'name': 'ops',\n 'type': 'enum',\n 'array': true,\n 'values': ValidAggregateOps\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }, {\n 'name': 'key',\n 'type': 'field'\n }]\n};\ninherits(JoinAggregate, Aggregate, {\n transform(_, pulse) {\n const aggr = this,\n mod = _.modified();\n let cells;\n\n // process all input tuples to calculate aggregates\n if (aggr.value && (mod || pulse.modified(aggr._inputs, true))) {\n cells = aggr.value = mod ? aggr.init(_) : {};\n pulse.visit(pulse.SOURCE, t => aggr.add(t));\n } else {\n cells = aggr.value = aggr.value || this.init(_);\n pulse.visit(pulse.REM, t => aggr.rem(t));\n pulse.visit(pulse.ADD, t => aggr.add(t));\n }\n\n // update aggregation cells\n aggr.changes();\n\n // write aggregate values to input tuples\n pulse.visit(pulse.SOURCE, t => {\n extend(t, cells[aggr.cellkey(t)].tuple);\n });\n return pulse.reflow(mod).modifies(this._outputs);\n },\n changes() {\n const adds = this._adds,\n mods = this._mods;\n let i, n;\n for (i = 0, n = this._alen; i < n; ++i) {\n this.celltuple(adds[i]);\n adds[i] = null; // for garbage collection\n }\n for (i = 0, n = this._mlen; i < n; ++i) {\n this.celltuple(mods[i]);\n mods[i] = null; // for garbage collection\n }\n this._alen = this._mlen = 0; // reset list of active cells\n }\n});\n\n/**\n * Compute kernel density estimates (KDE) for one or more data groups.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby.\n * @param {function(object): *} params.field - An accessor for the data field\n * to estimate.\n * @param {number} [params.bandwidth=0] - The KDE kernel bandwidth.\n * If zero or unspecified, the bandwidth is automatically determined.\n * @param {boolean} [params.counts=false] - A boolean flag indicating if the\n * output values should be probability estimates (false, default) or\n * smoothed counts (true).\n * @param {string} [params.cumulative=false] - A boolean flag indicating if a\n * density (false) or cumulative distribution (true) should be generated.\n * @param {Array} [params.extent] - The domain extent over which to\n * plot the density. If unspecified, the [min, max] data extent is used.\n * @param {string} [params.resolve='independent'] - Indicates how parameters for\n * multiple densities should be resolved. If \"independent\" (the default), each\n * density may have its own domain extent and dynamic number of curve sample\n * steps. If \"shared\", the KDE transform will ensure that all densities are\n * defined over a shared domain and curve steps, enabling stacking.\n * @param {number} [params.minsteps=25] - The minimum number of curve samples\n * for plotting the density.\n * @param {number} [params.maxsteps=200] - The maximum number of curve samples\n * for plotting the density.\n * @param {number} [params.steps] - The exact number of curve samples for\n * plotting the density. If specified, overrides both minsteps and maxsteps\n * to set an exact number of uniform samples. Useful in conjunction with\n * a fixed extent to ensure consistent sample points for stacked densities.\n */\nfunction KDE(params) {\n Transform.call(this, null, params);\n}\nKDE.Definition = {\n 'type': 'KDE',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'cumulative',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'counts',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'resolve',\n 'type': 'enum',\n 'values': ['shared', 'independent'],\n 'default': 'independent'\n }, {\n 'name': 'steps',\n 'type': 'number'\n }, {\n 'name': 'minsteps',\n 'type': 'number',\n 'default': 25\n }, {\n 'name': 'maxsteps',\n 'type': 'number',\n 'default': 200\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'default': ['value', 'density']\n }]\n};\ninherits(KDE, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n if (!this.value || pulse.changed() || _.modified()) {\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition$1(source, _.groupby, _.field),\n names = (_.groupby || []).map(accessorName),\n bandwidth = _.bandwidth,\n method = _.cumulative ? 'cdf' : 'pdf',\n as = _.as || ['value', 'density'],\n values = [];\n let domain = _.extent,\n minsteps = _.steps || _.minsteps || 25,\n maxsteps = _.steps || _.maxsteps || 200;\n if (method !== 'pdf' && method !== 'cdf') {\n error('Invalid density method: ' + method);\n }\n if (_.resolve === 'shared') {\n if (!domain) domain = extent(source, _.field);\n minsteps = maxsteps = _.steps || maxsteps;\n }\n groups.forEach(g => {\n const density = randomKDE(g, bandwidth)[method],\n scale = _.counts ? g.length : 1,\n local = domain || extent(g);\n sampleCurve(density, local, minsteps, maxsteps).forEach(v => {\n const t = {};\n for (let i = 0; i < names.length; ++i) {\n t[names[i]] = g.dims[i];\n }\n t[as[0]] = v[0];\n t[as[1]] = v[1] * scale;\n values.push(ingest(t));\n });\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n return out;\n }\n});\n\n/**\n * Generates a key function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - The field name(s) for the key function.\n * @param {boolean} params.flat - A boolean flag indicating if the field names\n * should be treated as flat property names, side-stepping nested field\n * lookups normally indicated by dot or bracket notation.\n */\nfunction Key(params) {\n Operator.call(this, null, update$2, params);\n}\ninherits(Key, Operator);\nfunction update$2(_) {\n return this.value && !_.modified() ? this.value : key(_.fields, _.flat);\n}\n\n/**\n * Load and parse data from an external source. Marshalls parameter\n * values and then invokes the Dataflow request method.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {string} params.url - The URL to load from.\n * @param {object} params.format - The data format options.\n */\nfunction Load(params) {\n Transform.call(this, [], params);\n this._pending = null;\n}\ninherits(Load, Transform, {\n transform(_, pulse) {\n const df = pulse.dataflow;\n if (this._pending) {\n // update state and return pulse\n return output(this, pulse, this._pending);\n }\n if (stop(_)) return pulse.StopPropagation;\n if (_.values) {\n // parse and ingest values, return output pulse\n return output(this, pulse, df.parse(_.values, _.format));\n } else if (_.async) {\n // return promise for non-blocking async loading\n const p = df.request(_.url, _.format).then(res => {\n this._pending = array(res.data);\n return df => df.touch(this);\n });\n return {\n async: p\n };\n } else {\n // return promise for synchronous loading\n return df.request(_.url, _.format).then(res => output(this, pulse, array(res.data)));\n }\n }\n});\nfunction stop(_) {\n return _.modified('async') && !(_.modified('values') || _.modified('url') || _.modified('format'));\n}\nfunction output(op, pulse, data) {\n data.forEach(ingest);\n const out = pulse.fork(pulse.NO_FIELDS & pulse.NO_SOURCE);\n out.rem = op.value;\n op.value = out.source = out.add = data;\n op._pending = null;\n if (out.rem.length) out.clean(true);\n return out;\n}\n\n/**\n * Extend tuples by joining them with values from a lookup table.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Map} params.index - The lookup table map.\n * @param {Array} params.as - Output field names for each lookup value.\n * @param {*} [params.default] - A default value to use if lookup fails.\n */\nfunction Lookup(params) {\n Transform.call(this, {}, params);\n}\nLookup.Definition = {\n 'type': 'Lookup',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'index',\n 'type': 'index',\n 'params': [{\n 'name': 'from',\n 'type': 'data',\n 'required': true\n }, {\n 'name': 'key',\n 'type': 'field',\n 'required': true\n }]\n }, {\n 'name': 'values',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }, {\n 'name': 'default',\n 'default': null\n }]\n};\ninherits(Lookup, Transform, {\n transform(_, pulse) {\n const keys = _.fields,\n index = _.index,\n values = _.values,\n defaultValue = _.default == null ? null : _.default,\n reset = _.modified(),\n n = keys.length;\n let flag = reset ? pulse.SOURCE : pulse.ADD,\n out = pulse,\n as = _.as,\n set,\n m,\n mods;\n if (values) {\n m = values.length;\n if (n > 1 && !as) {\n error('Multi-field lookup requires explicit \"as\" parameter.');\n }\n if (as && as.length !== n * m) {\n error('The \"as\" parameter has too few output field names.');\n }\n as = as || values.map(accessorName);\n set = function (t) {\n for (var i = 0, k = 0, j, v; i < n; ++i) {\n v = index.get(keys[i](t));\n if (v == null) for (j = 0; j < m; ++j, ++k) t[as[k]] = defaultValue;else for (j = 0; j < m; ++j, ++k) t[as[k]] = values[j](v);\n }\n };\n } else {\n if (!as) {\n error('Missing output field names.');\n }\n set = function (t) {\n for (var i = 0, v; i < n; ++i) {\n v = index.get(keys[i](t));\n t[as[i]] = v == null ? defaultValue : v;\n }\n };\n }\n if (reset) {\n out = pulse.reflow(true);\n } else {\n mods = keys.some(k => pulse.modified(k.fields));\n flag |= mods ? pulse.MOD : 0;\n }\n pulse.visit(flag, set);\n return out.modifies(as);\n }\n});\n\n/**\n * Computes global min/max extents over a collection of extents.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array>} params.extents - The input extents.\n */\nfunction MultiExtent(params) {\n Operator.call(this, null, update$1, params);\n}\ninherits(MultiExtent, Operator);\nfunction update$1(_) {\n if (this.value && !_.modified()) {\n return this.value;\n }\n const ext = _.extents,\n n = ext.length;\n let min = +Infinity,\n max = -Infinity,\n i,\n e;\n for (i = 0; i < n; ++i) {\n e = ext[i];\n if (e[0] < min) min = e[0];\n if (e[1] > max) max = e[1];\n }\n return [min, max];\n}\n\n/**\n * Merge a collection of value arrays.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array>} params.values - The input value arrrays.\n */\nfunction MultiValues(params) {\n Operator.call(this, null, update, params);\n}\ninherits(MultiValues, Operator);\nfunction update(_) {\n return this.value && !_.modified() ? this.value : _.values.reduce((data, _) => data.concat(_), []);\n}\n\n/**\n * Operator whose value is simply its parameter hash. This operator is\n * useful for enabling reactive updates to values of nested objects.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction Params(params) {\n Transform.call(this, null, params);\n}\ninherits(Params, Transform, {\n transform(_, pulse) {\n this.modified(_.modified());\n this.value = _;\n return pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS); // do not pass tuples\n }\n});\n\n/**\n * Aggregate and pivot selected field values to become new fields.\n * This operator is useful to construction cross-tabulations.\n * @constructor\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby. These fields act just like groupby fields of an Aggregate transform.\n * @param {function(object): *} params.field - The field to pivot on. The unique\n * values of this field become new field names in the output stream.\n * @param {function(object): *} params.value - The field to populate pivoted fields.\n * The aggregate values of this field become the values of the new pivoted fields.\n * @param {string} [params.op] - The aggregation operation for the value field,\n * applied per cell in the output stream. The default is \"sum\".\n * @param {number} [params.limit] - An optional parameter indicating the maximum\n * number of pivoted fields to generate. The pivoted field names are sorted in\n * ascending order prior to enforcing the limit.\n */\nfunction Pivot(params) {\n Aggregate.call(this, params);\n}\nPivot.Definition = {\n 'type': 'Pivot',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'value',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'op',\n 'type': 'enum',\n 'values': ValidAggregateOps,\n 'default': 'sum'\n }, {\n 'name': 'limit',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'key',\n 'type': 'field'\n }]\n};\ninherits(Pivot, Aggregate, {\n _transform: Aggregate.prototype.transform,\n transform(_, pulse) {\n return this._transform(aggregateParams(_, pulse), pulse);\n }\n});\n\n// Shoehorn a pivot transform into an aggregate transform!\n// First collect all unique pivot field values.\n// Then generate aggregate fields for each output pivot field.\nfunction aggregateParams(_, pulse) {\n const key = _.field,\n value = _.value,\n op = (_.op === 'count' ? '__count__' : _.op) || 'sum',\n fields = accessorFields(key).concat(accessorFields(value)),\n keys = pivotKeys(key, _.limit || 0, pulse);\n\n // if data stream content changes, pivot fields may change\n // flag parameter modification to ensure re-initialization\n if (pulse.changed()) _.set('__pivot__', null, null, true);\n return {\n key: _.key,\n groupby: _.groupby,\n ops: keys.map(() => op),\n fields: keys.map(k => get(k, key, value, fields)),\n as: keys.map(k => k + ''),\n modified: _.modified.bind(_)\n };\n}\n\n// Generate aggregate field accessor.\n// Output NaN for non-existent values; aggregator will ignore!\nfunction get(k, key, value, fields) {\n return accessor(d => key(d) === k ? value(d) : NaN, fields, k + '');\n}\n\n// Collect (and optionally limit) all unique pivot values.\nfunction pivotKeys(key, limit, pulse) {\n const map = {},\n list = [];\n pulse.visit(pulse.SOURCE, t => {\n const k = key(t);\n if (!map[k]) {\n map[k] = 1;\n list.push(k);\n }\n });\n list.sort(ascending);\n return limit ? list.slice(0, limit) : list;\n}\n\n/**\n * Partitions pre-faceted data into tuple subflows.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(Dataflow, string): Operator} params.subflow - A function\n * that generates a subflow of operators and returns its root operator.\n * @param {function(object): Array} params.field - The field\n * accessor for an array of subflow tuple objects.\n */\nfunction PreFacet(params) {\n Facet.call(this, params);\n}\ninherits(PreFacet, Facet, {\n transform(_, pulse) {\n const flow = _.subflow,\n field = _.field,\n subflow = t => this.subflow(tupleid(t), flow, pulse, t);\n if (_.modified('field') || field && pulse.modified(accessorFields(field))) {\n error('PreFacet does not support field modification.');\n }\n this.initTargets(); // reset list of active subflows\n\n if (field) {\n pulse.visit(pulse.MOD, t => {\n const sf = subflow(t);\n field(t).forEach(_ => sf.mod(_));\n });\n pulse.visit(pulse.ADD, t => {\n const sf = subflow(t);\n field(t).forEach(_ => sf.add(ingest(_)));\n });\n pulse.visit(pulse.REM, t => {\n const sf = subflow(t);\n field(t).forEach(_ => sf.rem(_));\n });\n } else {\n pulse.visit(pulse.MOD, t => subflow(t).mod(t));\n pulse.visit(pulse.ADD, t => subflow(t).add(t));\n pulse.visit(pulse.REM, t => subflow(t).rem(t));\n }\n if (pulse.clean()) {\n pulse.runAfter(() => this.clean());\n }\n return pulse;\n }\n});\n\n/**\n * Performs a relational projection, copying selected fields from source\n * tuples to a new set of derived tuples.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.as] - Output field names for each projected\n * field. Any unspecified fields will use the field name provided by\n * the field accessor.\n */\nfunction Project(params) {\n Transform.call(this, null, params);\n}\nProject.Definition = {\n 'type': 'Project',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }]\n};\ninherits(Project, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n fields = _.fields,\n as = fieldNames(_.fields, _.as || []),\n derive = fields ? (s, t) => project(s, t, fields, as) : rederive;\n let lut;\n if (this.value) {\n lut = this.value;\n } else {\n pulse = pulse.addAll();\n lut = this.value = {};\n }\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n out.rem.push(lut[id]);\n lut[id] = null;\n });\n pulse.visit(pulse.ADD, t => {\n const dt = derive(t, ingest({}));\n lut[tupleid(t)] = dt;\n out.add.push(dt);\n });\n pulse.visit(pulse.MOD, t => {\n out.mod.push(derive(t, lut[tupleid(t)]));\n });\n return out;\n }\n});\nfunction project(s, t, fields, as) {\n for (let i = 0, n = fields.length; i < n; ++i) {\n t[as[i]] = fields[i](s);\n }\n return t;\n}\n\n/**\n * Proxy the value of another operator as a pure signal value.\n * Ensures no tuples are propagated.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {*} params.value - The value to proxy, becomes the value of this operator.\n */\nfunction Proxy(params) {\n Transform.call(this, null, params);\n}\ninherits(Proxy, Transform, {\n transform(_, pulse) {\n this.value = _.value;\n return _.modified('value') ? pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS) : pulse.StopPropagation;\n }\n});\n\n/**\n * Generates sample quantile values from an input data stream.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - An accessor for the data field\n * over which to calculate quantile values.\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby.\n * @param {Array} [params.probs] - An array of probabilities in\n * the range (0, 1) for which to compute quantile values. If not specified,\n * the *step* parameter will be used.\n * @param {Array} [params.step=0.01] - A probability step size for\n * sampling quantile values. All values from one-half the step size up to\n * 1 (exclusive) will be sampled. This parameter is only used if the\n * *quantiles* parameter is not provided.\n */\nfunction Quantile(params) {\n Transform.call(this, null, params);\n}\nQuantile.Definition = {\n 'type': 'Quantile',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'probs',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'step',\n 'type': 'number',\n 'default': 0.01\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'default': ['prob', 'value']\n }]\n};\nconst EPSILON = 1e-14;\ninherits(Quantile, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n as = _.as || ['prob', 'value'];\n if (this.value && !_.modified() && !pulse.changed()) {\n out.source = this.value;\n return out;\n }\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition$1(source, _.groupby, _.field),\n names = (_.groupby || []).map(accessorName),\n values = [],\n step = _.step || 0.01,\n p = _.probs || range(step / 2, 1 - EPSILON, step),\n n = p.length;\n groups.forEach(g => {\n const q = quantiles(g, p);\n for (let i = 0; i < n; ++i) {\n const t = {};\n for (let i = 0; i < names.length; ++i) {\n t[names[i]] = g.dims[i];\n }\n t[as[0]] = p[i];\n t[as[1]] = q[i];\n values.push(ingest(t));\n }\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n return out;\n }\n});\n\n/**\n * Relays a data stream between data processing pipelines.\n * If the derive parameter is set, this transform will create derived\n * copies of observed tuples. This provides derived data streams in which\n * modifications to the tuples do not pollute an upstream data source.\n * @param {object} params - The parameters for this operator.\n * @param {number} [params.derive=false] - Boolean flag indicating if\n * the transform should make derived copies of incoming tuples.\n * @constructor\n */\nfunction Relay(params) {\n Transform.call(this, null, params);\n}\ninherits(Relay, Transform, {\n transform(_, pulse) {\n let out, lut;\n if (this.value) {\n lut = this.value;\n } else {\n out = pulse = pulse.addAll();\n lut = this.value = {};\n }\n if (_.derive) {\n out = pulse.fork(pulse.NO_SOURCE);\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n out.rem.push(lut[id]);\n lut[id] = null;\n });\n pulse.visit(pulse.ADD, t => {\n const dt = derive(t);\n lut[tupleid(t)] = dt;\n out.add.push(dt);\n });\n pulse.visit(pulse.MOD, t => {\n const dt = lut[tupleid(t)];\n for (const k in t) {\n dt[k] = t[k];\n // down stream writes may overwrite re-derived tuples\n // conservatively mark all source fields as modified\n out.modifies(k);\n }\n out.mod.push(dt);\n });\n }\n return out;\n }\n});\n\n/**\n * Samples tuples passing through this operator.\n * Uses reservoir sampling to maintain a representative sample.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {number} [params.size=1000] - The maximum number of samples.\n */\nfunction Sample(params) {\n Transform.call(this, [], params);\n this.count = 0;\n}\nSample.Definition = {\n 'type': 'Sample',\n 'metadata': {},\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'default': 1000\n }]\n};\ninherits(Sample, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n mod = _.modified('size'),\n num = _.size,\n map = this.value.reduce((m, t) => (m[tupleid(t)] = 1, m), {});\n let res = this.value,\n cnt = this.count,\n cap = 0;\n\n // sample reservoir update function\n function update(t) {\n let p, idx;\n if (res.length < num) {\n res.push(t);\n } else {\n idx = ~~((cnt + 1) * random());\n if (idx < res.length && idx >= cap) {\n p = res[idx];\n if (map[tupleid(p)]) out.rem.push(p); // eviction\n res[idx] = t;\n }\n }\n ++cnt;\n }\n if (pulse.rem.length) {\n // find all tuples that should be removed, add to output\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n if (map[id]) {\n map[id] = -1;\n out.rem.push(t);\n }\n --cnt;\n });\n\n // filter removed tuples out of the sample reservoir\n res = res.filter(t => map[tupleid(t)] !== -1);\n }\n if ((pulse.rem.length || mod) && res.length < num && pulse.source) {\n // replenish sample if backing data source is available\n cap = cnt = res.length;\n pulse.visit(pulse.SOURCE, t => {\n // update, but skip previously sampled tuples\n if (!map[tupleid(t)]) update(t);\n });\n cap = -1;\n }\n if (mod && res.length > num) {\n const n = res.length - num;\n for (let i = 0; i < n; ++i) {\n map[tupleid(res[i])] = -1;\n out.rem.push(res[i]);\n }\n res = res.slice(n);\n }\n if (pulse.mod.length) {\n // propagate modified tuples in the sample reservoir\n pulse.visit(pulse.MOD, t => {\n if (map[tupleid(t)]) out.mod.push(t);\n });\n }\n if (pulse.add.length) {\n // update sample reservoir\n pulse.visit(pulse.ADD, update);\n }\n if (pulse.add.length || cap < 0) {\n // output newly added tuples\n out.add = res.filter(t => !map[tupleid(t)]);\n }\n this.count = cnt;\n this.value = out.source = res;\n return out;\n }\n});\n\n/**\n * Generates data tuples for a specified sequence range of numbers.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {number} params.start - The first number in the sequence.\n * @param {number} params.stop - The last number (exclusive) in the sequence.\n * @param {number} [params.step=1] - The step size between numbers in the sequence.\n */\nfunction Sequence(params) {\n Transform.call(this, null, params);\n}\nSequence.Definition = {\n 'type': 'Sequence',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'start',\n 'type': 'number',\n 'required': true\n }, {\n 'name': 'stop',\n 'type': 'number',\n 'required': true\n }, {\n 'name': 'step',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'data'\n }]\n};\ninherits(Sequence, Transform, {\n transform(_, pulse) {\n if (this.value && !_.modified()) return;\n const out = pulse.materialize().fork(pulse.MOD),\n as = _.as || 'data';\n out.rem = this.value ? pulse.rem.concat(this.value) : pulse.rem;\n this.value = range(_.start, _.stop, _.step || 1).map(v => {\n const t = {};\n t[as] = v;\n return ingest(t);\n });\n out.add = pulse.add.concat(this.value);\n return out;\n }\n});\n\n/**\n * Propagates a new pulse without any tuples so long as the input\n * pulse contains some added, removed or modified tuples.\n * @param {object} params - The parameters for this operator.\n * @constructor\n */\nfunction Sieve(params) {\n Transform.call(this, null, params);\n this.modified(true); // always treat as modified\n}\ninherits(Sieve, Transform, {\n transform(_, pulse) {\n this.value = pulse.source;\n return pulse.changed() ? pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS) : pulse.StopPropagation;\n }\n});\n\n/**\n * Discretize dates to specific time units.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The data field containing date/time values.\n */\nfunction TimeUnit(params) {\n Transform.call(this, null, params);\n}\nconst OUTPUT = ['unit0', 'unit1'];\nTimeUnit.Definition = {\n 'type': 'TimeUnit',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'interval',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'units',\n 'type': 'enum',\n 'values': TIME_UNITS,\n 'array': true\n }, {\n 'name': 'step',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'maxbins',\n 'type': 'number',\n 'default': 40\n }, {\n 'name': 'extent',\n 'type': 'date',\n 'array': true\n }, {\n 'name': 'timezone',\n 'type': 'enum',\n 'default': 'local',\n 'values': ['local', 'utc']\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': OUTPUT\n }]\n};\ninherits(TimeUnit, Transform, {\n transform(_, pulse) {\n const field = _.field,\n band = _.interval !== false,\n utc = _.timezone === 'utc',\n floor = this._floor(_, pulse),\n offset = (utc ? utcInterval : timeInterval)(floor.unit).offset,\n as = _.as || OUTPUT,\n u0 = as[0],\n u1 = as[1],\n step = floor.step;\n let min = floor.start || Infinity,\n max = floor.stop || -Infinity,\n flag = pulse.ADD;\n if (_.modified() || pulse.changed(pulse.REM) || pulse.modified(accessorFields(field))) {\n pulse = pulse.reflow(true);\n flag = pulse.SOURCE;\n min = Infinity;\n max = -Infinity;\n }\n pulse.visit(flag, t => {\n const v = field(t);\n let a, b;\n if (v == null) {\n t[u0] = null;\n if (band) t[u1] = null;\n } else {\n t[u0] = a = b = floor(v);\n if (band) t[u1] = b = offset(a, step);\n if (a < min) min = a;\n if (b > max) max = b;\n }\n });\n floor.start = min;\n floor.stop = max;\n return pulse.modifies(band ? as : u0);\n },\n _floor(_, pulse) {\n const utc = _.timezone === 'utc';\n\n // get parameters\n const {\n units,\n step\n } = _.units ? {\n units: _.units,\n step: _.step || 1\n } : timeBin({\n extent: _.extent || extent(pulse.materialize(pulse.SOURCE).source, _.field),\n maxbins: _.maxbins\n });\n\n // check / standardize time units\n const tunits = timeUnits(units),\n prev = this.value || {},\n floor = (utc ? utcFloor : timeFloor)(tunits, step);\n floor.unit = peek(tunits);\n floor.units = tunits;\n floor.step = step;\n floor.start = prev.start;\n floor.stop = prev.stop;\n return this.value = floor;\n }\n});\n\n/**\n * An index that maps from unique, string-coerced, field values to tuples.\n * Assumes that the field serves as a unique key with no duplicate values.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The field accessor to index.\n */\nfunction TupleIndex(params) {\n Transform.call(this, fastmap(), params);\n}\ninherits(TupleIndex, Transform, {\n transform(_, pulse) {\n const df = pulse.dataflow,\n field = _.field,\n index = this.value,\n set = t => index.set(field(t), t);\n let mod = true;\n if (_.modified('field') || pulse.modified(field.fields)) {\n index.clear();\n pulse.visit(pulse.SOURCE, set);\n } else if (pulse.changed()) {\n pulse.visit(pulse.REM, t => index.delete(field(t)));\n pulse.visit(pulse.ADD, set);\n } else {\n mod = false;\n }\n this.modified(mod);\n if (index.empty > df.cleanThreshold) df.runAfter(index.clean);\n return pulse.fork();\n }\n});\n\n/**\n * Extracts an array of values. Assumes the source data has already been\n * reduced as needed (e.g., by an upstream Aggregate transform).\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The domain field to extract.\n * @param {function(*,*): number} [params.sort] - An optional\n * comparator function for sorting the values. The comparator will be\n * applied to backing tuples prior to value extraction.\n */\nfunction Values(params) {\n Transform.call(this, null, params);\n}\ninherits(Values, Transform, {\n transform(_, pulse) {\n const run = !this.value || _.modified('field') || _.modified('sort') || pulse.changed() || _.sort && pulse.modified(_.sort.fields);\n if (run) {\n this.value = (_.sort ? pulse.source.slice().sort(stableCompare(_.sort)) : pulse.source).map(_.field);\n }\n }\n});\n\nfunction WindowOp(op, field, param, as) {\n const fn = WindowOps[op](field, param);\n return {\n init: fn.init || zero,\n update: function (w, t) {\n t[as] = fn.next(w);\n }\n };\n}\nconst WindowOps = {\n row_number: function () {\n return {\n next: w => w.index + 1\n };\n },\n rank: function () {\n let rank;\n return {\n init: () => rank = 1,\n next: w => {\n const i = w.index,\n data = w.data;\n return i && w.compare(data[i - 1], data[i]) ? rank = i + 1 : rank;\n }\n };\n },\n dense_rank: function () {\n let drank;\n return {\n init: () => drank = 1,\n next: w => {\n const i = w.index,\n d = w.data;\n return i && w.compare(d[i - 1], d[i]) ? ++drank : drank;\n }\n };\n },\n percent_rank: function () {\n const rank = WindowOps.rank(),\n next = rank.next;\n return {\n init: rank.init,\n next: w => (next(w) - 1) / (w.data.length - 1)\n };\n },\n cume_dist: function () {\n let cume;\n return {\n init: () => cume = 0,\n next: w => {\n const d = w.data,\n c = w.compare;\n let i = w.index;\n if (cume < i) {\n while (i + 1 < d.length && !c(d[i], d[i + 1])) ++i;\n cume = i;\n }\n return (1 + cume) / d.length;\n }\n };\n },\n ntile: function (field, num) {\n num = +num;\n if (!(num > 0)) error('ntile num must be greater than zero.');\n const cume = WindowOps.cume_dist(),\n next = cume.next;\n return {\n init: cume.init,\n next: w => Math.ceil(num * next(w))\n };\n },\n lag: function (field, offset) {\n offset = +offset || 1;\n return {\n next: w => {\n const i = w.index - offset;\n return i >= 0 ? field(w.data[i]) : null;\n }\n };\n },\n lead: function (field, offset) {\n offset = +offset || 1;\n return {\n next: w => {\n const i = w.index + offset,\n d = w.data;\n return i < d.length ? field(d[i]) : null;\n }\n };\n },\n first_value: function (field) {\n return {\n next: w => field(w.data[w.i0])\n };\n },\n last_value: function (field) {\n return {\n next: w => field(w.data[w.i1 - 1])\n };\n },\n nth_value: function (field, nth) {\n nth = +nth;\n if (!(nth > 0)) error('nth_value nth must be greater than zero.');\n return {\n next: w => {\n const i = w.i0 + (nth - 1);\n return i < w.i1 ? field(w.data[i]) : null;\n }\n };\n },\n prev_value: function (field) {\n let prev;\n return {\n init: () => prev = null,\n next: w => {\n const v = field(w.data[w.index]);\n return v != null ? prev = v : prev;\n }\n };\n },\n next_value: function (field) {\n let v, i;\n return {\n init: () => (v = null, i = -1),\n next: w => {\n const d = w.data;\n return w.index <= i ? v : (i = find(field, d, w.index)) < 0 ? (i = d.length, v = null) : v = field(d[i]);\n }\n };\n }\n};\nfunction find(field, data, index) {\n for (let n = data.length; index < n; ++index) {\n const v = field(data[index]);\n if (v != null) return index;\n }\n return -1;\n}\nconst ValidWindowOps = Object.keys(WindowOps);\n\nfunction WindowState(_) {\n const ops = array(_.ops),\n fields = array(_.fields),\n params = array(_.params),\n aggregate_params = array(_.aggregate_params),\n as = array(_.as),\n outputs = this.outputs = [],\n windows = this.windows = [],\n inputs = {},\n map = {},\n counts = [],\n measures = [];\n let countOnly = true;\n function visitInputs(f) {\n array(accessorFields(f)).forEach(_ => inputs[_] = 1);\n }\n visitInputs(_.sort);\n ops.forEach((op, i) => {\n const field = fields[i],\n param = params[i],\n aggregate_param = aggregate_params[i] || null,\n mname = accessorName(field),\n name = measureName(op, mname, as[i]);\n visitInputs(field);\n outputs.push(name);\n\n // Window operation\n if (hasOwnProperty(WindowOps, op)) {\n windows.push(WindowOp(op, field, param, name));\n }\n\n // Aggregate operation\n else {\n if (field == null && op !== 'count') {\n error('Null aggregate field specified.');\n }\n if (op === 'count') {\n counts.push(name);\n return;\n }\n countOnly = false;\n let m = map[mname];\n if (!m) {\n m = map[mname] = [];\n m.field = field;\n measures.push(m);\n }\n m.push(createMeasure(op, aggregate_param, name));\n }\n });\n if (counts.length || measures.length) {\n this.cell = cell(measures, counts, countOnly);\n }\n this.inputs = Object.keys(inputs);\n}\nconst prototype = WindowState.prototype;\nprototype.init = function () {\n this.windows.forEach(_ => _.init());\n if (this.cell) this.cell.init();\n};\nprototype.update = function (w, t) {\n const cell = this.cell,\n wind = this.windows,\n data = w.data,\n m = wind && wind.length;\n let j;\n if (cell) {\n for (j = w.p0; j < w.i0; ++j) cell.rem(data[j]);\n for (j = w.p1; j < w.i1; ++j) cell.add(data[j]);\n cell.set(t);\n }\n for (j = 0; j < m; ++j) wind[j].update(w, t);\n};\nfunction cell(measures, counts, countOnly) {\n measures = measures.map(m => compileMeasures(m, m.field));\n const cell = {\n num: 0,\n agg: null,\n store: false,\n count: counts\n };\n if (!countOnly) {\n var n = measures.length,\n a = cell.agg = Array(n),\n i = 0;\n for (; i < n; ++i) a[i] = new measures[i](cell);\n }\n if (cell.store) {\n var store = cell.data = new TupleStore();\n }\n cell.add = function (t) {\n cell.num += 1;\n if (countOnly) return;\n if (store) store.add(t);\n for (let i = 0; i < n; ++i) {\n a[i].add(a[i].get(t), t);\n }\n };\n cell.rem = function (t) {\n cell.num -= 1;\n if (countOnly) return;\n if (store) store.rem(t);\n for (let i = 0; i < n; ++i) {\n a[i].rem(a[i].get(t), t);\n }\n };\n cell.set = function (t) {\n let i, n;\n\n // consolidate stored values\n if (store) store.values();\n\n // update tuple properties\n for (i = 0, n = counts.length; i < n; ++i) t[counts[i]] = cell.num;\n if (!countOnly) for (i = 0, n = a.length; i < n; ++i) a[i].set(t);\n };\n cell.init = function () {\n cell.num = 0;\n if (store) store.reset();\n for (let i = 0; i < n; ++i) a[i].init();\n };\n return cell;\n}\n\n/**\n * Perform window calculations and write results to the input stream.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - A comparator function for sorting tuples within a window.\n * @param {Array} [params.groupby] - An array of accessors by which to partition tuples into separate windows.\n * @param {Array} params.ops - An array of strings indicating window operations to perform.\n * @param {Array} [params.fields] - An array of accessors\n * for data fields to use as inputs to window operations.\n * @param {Array<*>} [params.params] - An array of parameter values for window operations.\n * @param {Array} [params.aggregate_params] - An optional array of parameter values for aggregation operations.\n * @param {Array} [params.as] - An array of output field names for window operations.\n * @param {Array} [params.frame] - Window frame definition as two-element array.\n * @param {boolean} [params.ignorePeers=false] - If true, base window frame boundaries on row\n * number alone, ignoring peers with identical sort values. If false (default),\n * the window boundaries will be adjusted to include peer values.\n */\nfunction Window(params) {\n Transform.call(this, {}, params);\n this._mlen = 0;\n this._mods = [];\n}\nWindow.Definition = {\n 'type': 'Window',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'ops',\n 'type': 'enum',\n 'array': true,\n 'values': ValidWindowOps.concat(ValidAggregateOps)\n }, {\n 'name': 'params',\n 'type': 'number',\n 'null': true,\n 'array': true\n }, {\n 'name': 'aggregate_params',\n 'type': 'number',\n 'null': true,\n 'array': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'null': true,\n 'array': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }, {\n 'name': 'frame',\n 'type': 'number',\n 'null': true,\n 'array': true,\n 'length': 2,\n 'default': [null, 0]\n }, {\n 'name': 'ignorePeers',\n 'type': 'boolean',\n 'default': false\n }]\n};\ninherits(Window, Transform, {\n transform(_, pulse) {\n this.stamp = pulse.stamp;\n const mod = _.modified(),\n cmp = stableCompare(_.sort),\n key = groupkey(_.groupby),\n group = t => this.group(key(t));\n\n // initialize window state\n let state = this.state;\n if (!state || mod) {\n state = this.state = new WindowState(_);\n }\n\n // partition input tuples\n if (mod || pulse.modified(state.inputs)) {\n this.value = {};\n pulse.visit(pulse.SOURCE, t => group(t).add(t));\n } else {\n pulse.visit(pulse.REM, t => group(t).remove(t));\n pulse.visit(pulse.ADD, t => group(t).add(t));\n }\n\n // perform window calculations for each modified partition\n for (let i = 0, n = this._mlen; i < n; ++i) {\n processPartition(this._mods[i], state, cmp, _);\n }\n this._mlen = 0;\n this._mods = [];\n\n // TODO don't reflow everything?\n return pulse.reflow(mod).modifies(state.outputs);\n },\n group(key) {\n let group = this.value[key];\n if (!group) {\n group = this.value[key] = SortedList(tupleid);\n group.stamp = -1;\n }\n if (group.stamp < this.stamp) {\n group.stamp = this.stamp;\n this._mods[this._mlen++] = group;\n }\n return group;\n }\n});\nfunction processPartition(list, state, cmp, _) {\n const sort = _.sort,\n range = sort && !_.ignorePeers,\n frame = _.frame || [null, 0],\n data = list.data(cmp),\n // use cmp for stable sort\n n = data.length,\n b = range ? bisector(sort) : null,\n w = {\n i0: 0,\n i1: 0,\n p0: 0,\n p1: 0,\n index: 0,\n data: data,\n compare: sort || constant(-1)\n };\n state.init();\n for (let i = 0; i < n; ++i) {\n setWindow(w, frame, i, n);\n if (range) adjustRange(w, b);\n state.update(w, data[i]);\n }\n}\nfunction setWindow(w, f, i, n) {\n w.p0 = w.i0;\n w.p1 = w.i1;\n w.i0 = f[0] == null ? 0 : Math.max(0, i - Math.abs(f[0]));\n w.i1 = f[1] == null ? n : Math.min(n, i + Math.abs(f[1]) + 1);\n w.index = i;\n}\n\n// if frame type is 'range', adjust window for peer values\nfunction adjustRange(w, bisect) {\n const r0 = w.i0,\n r1 = w.i1 - 1,\n c = w.compare,\n d = w.data,\n n = d.length - 1;\n if (r0 > 0 && !c(d[r0], d[r0 - 1])) w.i0 = bisect.left(d, d[r0]);\n if (r1 < n && !c(d[r1], d[r1 + 1])) w.i1 = bisect.right(d, d[r1]);\n}\n\nexport { Aggregate as aggregate, Bin as bin, Collect as collect, Compare as compare, CountPattern as countpattern, Cross as cross, Density as density, DotBin as dotbin, Expression as expression, Extent as extent, Facet as facet, Field as field, Filter as filter, Flatten as flatten, Fold as fold, Formula as formula, Generate as generate, Impute as impute, JoinAggregate as joinaggregate, KDE as kde, Key as key, Load as load, Lookup as lookup, MultiExtent as multiextent, MultiValues as multivalues, Params as params, Pivot as pivot, PreFacet as prefacet, Project as project, Proxy as proxy, Quantile as quantile, Relay as relay, Sample as sample, Sequence as sequence, Sieve as sieve, Subflow as subflow, TimeUnit as timeunit, TupleIndex as tupleindex, Values as values, Window as window };\n","export default function mean(values, valueof) {\n let count = 0;\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n ++count, sum += value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n ++count, sum += value;\n }\n }\n }\n if (count) return sum / count;\n}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // falls through\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n","export default function() {}\n","import noop from \"../noop.js\";\nimport {point} from \"./basis.js\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n","import {point} from \"./basis.js\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n","import {Basis} from \"./basis.js\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {point} from \"./cardinal.js\";\n\nexport function CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalOpen(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import noop from \"../noop.js\";\nimport {point} from \"./cardinal.js\";\n\nexport function CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import {epsilon} from \"../math.js\";\nimport {Cardinal} from \"./cardinal.js\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalClosed} from \"./cardinalClosed.js\";\nimport noop from \"../noop.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalOpen} from \"./cardinalOpen.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","import noop from \"../noop.js\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction append(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n let d = Math.floor(digits);\n if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);\n if (d > 15) return append;\n const k = 10 ** d;\n return function(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n}\n\nexport class Path {\n constructor(digits) {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n this._append = digits == null ? append : appendRound(digits);\n }\n moveTo(x, y) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._append`Z`;\n }\n }\n lineTo(x, y) {\n this._append`L${this._x1 = +x},${this._y1 = +y}`;\n }\n quadraticCurveTo(x1, y1, x, y) {\n this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;\n }\n bezierCurveTo(x1, y1, x2, y2, x, y) {\n this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;\n }\n arcTo(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._append`M${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._append`L${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Otherwise, draw an arc!\n else {\n let x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;\n }\n\n this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;\n }\n }\n arc(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._append`M${x0},${y0}`;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._append`L${x0},${y0}`;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._append`A${r},${r},0,1,${cw},${x - dx},${y - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x + r * Math.cos(a1)},${this._y1 = y + r * Math.sin(a1)}`;\n }\n }\n rect(x, y, w, h) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;\n }\n toString() {\n return this._;\n }\n}\n\nexport function path() {\n return new Path;\n}\n\n// Allow instanceof d3.path\npath.prototype = Path.prototype;\n\nexport function pathRound(digits = 3) {\n return new Path(+digits);\n}\n","import {Path} from \"d3-path\";\n\nexport function withPath(shape) {\n let digits = 3;\n\n shape.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) {\n digits = null;\n } else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n return shape;\n };\n\n return () => new Path(digits);\n}\n","import constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\nimport {withPath} from \"./path.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null,\n path = withPath(arc);\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle. If this\n // intersection fails, it’s probably because the arc is too small, so\n // disable the corner radius entirely.\n if (da < pi) {\n if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n } else {\n rc0 = rc1 = 0;\n }\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n","export var slice = Array.prototype.slice;\n\nexport default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x, y) {\n var defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(line);\n\n x = typeof x === \"function\" ? x : (x === undefined) ? pointX : constant(x);\n y = typeof y === \"function\" ? y : (y === undefined) ? pointY : constant(y);\n\n function line(data) {\n var i,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x0, y0, y1) {\n var x1 = null,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(area);\n\n x0 = typeof x0 === \"function\" ? x0 : (x0 === undefined) ? pointX : constant(+x0);\n y0 = typeof y0 === \"function\" ? y0 : (y0 === undefined) ? constant(0) : constant(+y0);\n y1 = typeof y1 === \"function\" ? y1 : (y1 === undefined) ? pointY : constant(+y1);\n\n function area(data) {\n var i,\n j,\n k,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n","import {min, sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const r = sqrt(size + min(size / 28, 0.75)) * 0.59436;\n const t = r / 2;\n const u = t * sqrt3;\n context.moveTo(0, r);\n context.lineTo(0, -r);\n context.moveTo(-u, -t);\n context.lineTo(u, t);\n context.moveTo(-u, t);\n context.lineTo(u, -t);\n }\n};\n","import {pi, sqrt, tau} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst tan30 = sqrt(1 / 3);\nconst tan30_2 = tan30 * 2;\n\nexport default {\n draw(context, size) {\n const y = sqrt(size / tan30_2);\n const x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n","import {sin, cos, sqrt, pi, tau} from \"../math.js\";\n\nconst ka = 0.89081309152928522810;\nconst kr = sin(pi / 10) / sin(7 * pi / 10);\nconst kx = sin(tau / 10) * kr;\nconst ky = -cos(tau / 10) * kr;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size * ka);\n const x = kx * r;\n const y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (let i = 1; i < 5; ++i) {\n const a = tau * i / 5;\n const c = cos(a);\n const s = sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n","function domCanvas(w, h) {\n if (typeof document !== 'undefined' && document.createElement) {\n const c = document.createElement('canvas');\n if (c && c.getContext) {\n c.width = w;\n c.height = h;\n return c;\n }\n }\n return null;\n}\nconst domImage = () => typeof Image !== 'undefined' ? Image : null;\n\nexport { domCanvas as canvas, domCanvas, domImage as image };\n","import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const y = -sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const s = sqrt(size) * 0.6824;\n const t = s / 2;\n const u = (s * sqrt3) / 2; // cos(Math.PI / 6)\n context.moveTo(0, -s);\n context.lineTo(u, t);\n context.lineTo(-u, t);\n context.closePath();\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst c = -0.5;\nconst s = sqrt(3) / 2;\nconst k = 1 / sqrt(12);\nconst a = (k / 2 + 1) * 3;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / a);\n const x0 = r / 2, y0 = r * k;\n const x1 = x0, y1 = r * k + r;\n const x2 = -x1, y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n","import ascending from \"./ascending.js\";\nimport bisector from \"./bisector.js\";\nimport number from \"./number.js\";\n\nconst ascendingBisect = bisector(ascending);\nexport const bisectRight = ascendingBisect.right;\nexport const bisectLeft = ascendingBisect.left;\nexport const bisectCenter = bisector(number).center;\nexport default bisectRight;\n","export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHex8: color_formatHex8,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb() {\n return this;\n },\n clamp() {\n return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n },\n displayable() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatHex8: rgb_formatHex8,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n value = clampi(value);\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n clamp() {\n return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n },\n displayable() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n }\n}));\n\nfunction clamph(value) {\n value = (value || 0) % 360;\n return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","import {basis} from \"./basis.js\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","export default x => () => x;\n","import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n","import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n","export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n","import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n","export default function number(x) {\n return +x;\n}\n","import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateNumber, interpolateRound} from \"d3-interpolate\";\nimport constant from \"./constant.js\";\nimport number from \"./number.js\";\n\nvar unit = [0, 1];\n\nexport function identity(x) {\n return x;\n}\n\nfunction normalize(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n var t;\n if (a > b) t = a, a = b, b = t;\n return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = normalize(domain[i], domain[i + 1]);\n r[i] = interpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport function transformer() {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n transform,\n untransform,\n unknown,\n clamp = identity,\n piecewise,\n output,\n input;\n\n function rescale() {\n var n = Math.min(domain.length, range.length);\n if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);\n piecewise = n > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n }\n\n scale.invert = function(y) {\n return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = Array.from(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t, u) {\n transform = t, untransform = u;\n return rescale();\n };\n}\n\nexport default function continuous() {\n return transformer()(identity, identity);\n}\n","export default function constants(x) {\n return function() {\n return x;\n };\n}\n","export function initRange(domain, range) {\n switch (arguments.length) {\n case 0: break;\n case 1: this.range(domain); break;\n default: this.range(range).domain(domain); break;\n }\n return this;\n}\n\nexport function initInterpolator(domain, interpolator) {\n switch (arguments.length) {\n case 0: break;\n case 1: {\n if (typeof domain === \"function\") this.interpolator(domain);\n else this.range(domain);\n break;\n }\n default: {\n this.domain(domain);\n if (typeof interpolator === \"function\") this.interpolator(interpolator);\n else this.range(interpolator);\n break;\n }\n }\n return this;\n}\n","import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function tickFormat(start, stop, count, specifier) {\n var step = tickStep(start, stop, count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n","import {ticks, tickIncrement} from \"d3-array\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport tickFormat from \"./tickFormat.js\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n var d = domain();\n return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain();\n var i0 = 0;\n var i1 = d.length - 1;\n var start = d[i0];\n var stop = d[i1];\n var prestep;\n var step;\n var maxIter = 10;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n \n while (maxIter-- > 0) {\n step = tickIncrement(start, stop, count);\n if (step === prestep) {\n d[i0] = start\n d[i1] = stop\n return domain(d);\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n } else {\n break;\n }\n prestep = step;\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous();\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n","export default function nice(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n","import {ticks} from \"d3-array\";\nimport {format, formatSpecifier} from \"d3-format\";\nimport nice from \"./nice.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformLog(x) {\n return Math.log(x);\n}\n\nfunction transformExp(x) {\n return Math.exp(x);\n}\n\nfunction transformLogn(x) {\n return -Math.log(-x);\n}\n\nfunction transformExpn(x) {\n return -Math.exp(-x);\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : x => Math.pow(base, x);\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), x => Math.log(x) / base);\n}\n\nfunction reflect(f) {\n return (x, k) => -f(-x, k);\n}\n\nexport function loggish(transform) {\n const scale = transform(transformLog, transformExp);\n const domain = scale.domain;\n let base = 10;\n let logs;\n let pows;\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) {\n logs = reflect(logs), pows = reflect(pows);\n transform(transformLogn, transformExpn);\n } else {\n transform(transformLog, transformExp);\n }\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = count => {\n const d = domain();\n let u = d[0];\n let v = d[d.length - 1];\n const r = v < u;\n\n if (r) ([u, v] = [v, u]);\n\n let i = logs(u);\n let j = logs(v);\n let k;\n let t;\n const n = count == null ? 10 : +count;\n let z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.floor(i), j = Math.ceil(j);\n if (u > 0) for (; i <= j; ++i) {\n for (k = 1; k < base; ++k) {\n t = i < 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i <= j; ++i) {\n for (k = base - 1; k >= 1; --k) {\n t = i > 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n if (z.length * 2 < n) z = ticks(u, v, n);\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = (count, specifier) => {\n if (count == null) count = 10;\n if (specifier == null) specifier = base === 10 ? \"s\" : \",\";\n if (typeof specifier !== \"function\") {\n if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;\n specifier = format(specifier);\n }\n if (count === Infinity) return specifier;\n const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return d => {\n let i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = () => {\n return domain(nice(domain(), {\n floor: x => pows(Math.floor(logs(x))),\n ceil: x => pows(Math.ceil(logs(x)))\n }));\n };\n\n return scale;\n}\n\nexport default function log() {\n const scale = loggish(transformer()).domain([1, 10]);\n scale.copy = () => copy(scale, log()).base(scale.base());\n initRange.apply(scale, arguments);\n return scale;\n}\n","import {linearish} from \"./linear.js\";\nimport {copy, identity, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformPow(exponent) {\n return function(x) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n };\n}\n\nfunction transformSqrt(x) {\n return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);\n}\n\nfunction transformSquare(x) {\n return x < 0 ? -x * x : x * x;\n}\n\nexport function powish(transform) {\n var scale = transform(identity, identity),\n exponent = 1;\n\n function rescale() {\n return exponent === 1 ? transform(identity, identity)\n : exponent === 0.5 ? transform(transformSqrt, transformSquare)\n : transform(transformPow(exponent), transformPow(1 / exponent));\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, rescale()) : exponent;\n };\n\n return linearish(scale);\n}\n\nexport default function pow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, pow()).exponent(scale.exponent());\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n\nexport function sqrt() {\n return pow.apply(null, arguments).exponent(0.5);\n}\n","import {linearish} from \"./linear.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformSymlog(c) {\n return function(x) {\n return Math.sign(x) * Math.log1p(Math.abs(x / c));\n };\n}\n\nfunction transformSymexp(c) {\n return function(x) {\n return Math.sign(x) * Math.expm1(Math.abs(x)) * c;\n };\n}\n\nexport function symlogish(transform) {\n var c = 1, scale = transform(transformSymlog(c), transformSymexp(c));\n\n scale.constant = function(_) {\n return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c;\n };\n\n return linearish(scale);\n}\n\nexport default function symlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, symlog()).constant(scale.constant());\n };\n\n return initRange.apply(scale, arguments);\n}\n","import {bisector, tickStep} from \"d3-array\";\nimport {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from \"./duration.js\";\nimport {millisecond} from \"./millisecond.js\";\nimport {second} from \"./second.js\";\nimport {timeMinute, utcMinute} from \"./minute.js\";\nimport {timeHour, utcHour} from \"./hour.js\";\nimport {timeDay, unixDay} from \"./day.js\";\nimport {timeSunday, utcSunday} from \"./week.js\";\nimport {timeMonth, utcMonth} from \"./month.js\";\nimport {timeYear, utcYear} from \"./year.js\";\n\nfunction ticker(year, month, week, day, hour, minute) {\n\n const tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function ticks(start, stop, count) {\n const reverse = stop < start;\n if (reverse) [start, stop] = [stop, start];\n const interval = count && typeof count.range === \"function\" ? count : tickInterval(start, stop, count);\n const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop\n return reverse ? ticks.reverse() : ticks;\n }\n\n function tickInterval(start, stop, count) {\n const target = Math.abs(stop - start) / count;\n const i = bisector(([,, step]) => step).right(tickIntervals, target);\n if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));\n if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));\n const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n return t.every(step);\n }\n\n return [ticks, tickInterval];\n}\n\nconst [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);\n\nexport {utcTicks, utcTickInterval, timeTicks, timeTickInterval};\n","import {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeTicks, timeTickInterval} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport nice from \"./nice.js\";\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {\n var scale = continuous(),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(Array.from(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval) {\n var d = domain();\n if (!interval || typeof interval.range !== \"function\") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);\n return interval ? domain(nice(d, interval)) : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));\n };\n\n return scale;\n}\n\nexport default function time() {\n return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);\n}\n","import {interpolate, interpolateRound} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 1,\n t0,\n t1,\n k10,\n transform,\n interpolator = identity,\n clamp = false,\n unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1;\n return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0);\n return scale;\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .interpolator(source.interpolator())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport default function sequential() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, sequential());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialLog() {\n var scale = loggish(transformer()).domain([1, 10]);\n\n scale.copy = function() {\n return copy(scale, sequentialLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSqrt() {\n return sequentialPow.apply(null, arguments).exponent(0.5);\n}\n","import {default as value} from \"./value.js\";\n\nexport default function piecewise(interpolate, values) {\n if (values === undefined) values = interpolate, interpolate = value;\n var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);\n while (i < n) I[i] = interpolate(v, v = values[++i]);\n return function(t) {\n var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));\n return I[i](t - i);\n };\n}\n","import {interpolate, interpolateRound, piecewise} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {copy} from \"./sequential.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 0.5,\n x2 = 1,\n s = 1,\n t0,\n t1,\n t2,\n k10,\n k21,\n interpolator = identity,\n transform,\n clamp = false,\n unknown;\n\n function scale(x) {\n return isNaN(x = +x) ? unknown : (x = 0.5 + ((x = +transform(x)) - t1) * (s * x < s * t1 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1, x2] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1, scale) : [x0, x1, x2];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1, r2;\n return arguments.length ? ([r0, r1, r2] = _, interpolator = piecewise(interpolate, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), t2 = t(x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1;\n return scale;\n };\n}\n\nexport default function diverging() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, diverging());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingLog() {\n var scale = loggish(transformer()).domain([0.1, 1, 10]);\n\n scale.copy = function() {\n return copy(scale, divergingLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSqrt() {\n return divergingPow.apply(null, arguments).exponent(0.5);\n}\n","export class InternMap extends Map {\n constructor(entries, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (entries != null) for (const [key, value] of entries) this.set(key, value);\n }\n get(key) {\n return super.get(intern_get(this, key));\n }\n has(key) {\n return super.has(intern_get(this, key));\n }\n set(key, value) {\n return super.set(intern_set(this, key), value);\n }\n delete(key) {\n return super.delete(intern_delete(this, key));\n }\n}\n\nexport class InternSet extends Set {\n constructor(values, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (values != null) for (const value of values) this.add(value);\n }\n has(value) {\n return super.has(intern_get(this, value));\n }\n add(value) {\n return super.add(intern_set(this, value));\n }\n delete(value) {\n return super.delete(intern_delete(this, value));\n }\n}\n\nfunction intern_get({_intern, _key}, value) {\n const key = _key(value);\n return _intern.has(key) ? _intern.get(key) : value;\n}\n\nfunction intern_set({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) return _intern.get(key);\n _intern.set(key, value);\n return value;\n}\n\nfunction intern_delete({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) {\n value = _intern.get(key);\n _intern.delete(key);\n }\n return value;\n}\n\nfunction keyof(value) {\n return value !== null && typeof value === \"object\" ? value.valueOf() : value;\n}\n","import {InternMap} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport const implicit = Symbol(\"implicit\");\n\nexport default function ordinal() {\n var index = new InternMap(),\n domain = [],\n range = [],\n unknown = implicit;\n\n function scale(d) {\n let i = index.get(d);\n if (i === undefined) {\n if (unknown !== implicit) return unknown;\n index.set(d, i = domain.push(d) - 1);\n }\n return range[i % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = new InternMap();\n for (const value of _) {\n if (index.has(value)) continue;\n index.set(value, domain.push(value) - 1);\n }\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal(domain, range).unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n","export default function(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n","import {hue} from \"./color.js\";\n\nexport default function(a, b) {\n var i = hue(+a, +b);\n return function(t) {\n var x = i(t);\n return x - 360 * Math.floor(x / 360);\n };\n}\n","var degrees = 180 / Math.PI;\n\nexport var identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n","import decompose, {identity} from \"./decompose.js\";\n\nvar svgNode;\n\n/* eslint-disable no-undef */\nexport function parseCss(value) {\n const m = new (typeof DOMMatrix === \"function\" ? DOMMatrix : WebKitCSSMatrix)(value + \"\");\n return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);\n}\n\nexport function parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n","import number from \"../number.js\";\nimport {parseCss, parseSvg} from \"./parse.js\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n","var epsilon2 = 1e-12;\n\nfunction cosh(x) {\n return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\nexport default (function zoomRho(rho, rho2, rho4) {\n\n // p0 = [ux0, uy0, w0]\n // p1 = [ux1, uy1, w1]\n function zoom(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 ≅ u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000 * rho / Math.SQRT2;\n\n return i;\n }\n\n zoom.rho = function(_) {\n var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;\n return zoomRho(_1, _2, _4);\n };\n\n return zoom;\n})(Math.SQRT2, 2, 4);\n","import {hsl as colorHsl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hsl(hue) {\n return function(start, end) {\n var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hsl(hue);\nexport var hslLong = hsl(color);\n","export const radians = Math.PI / 180;\nexport const degrees = 180 / Math.PI;\n","import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\n// https://observablehq.com/@mbostock/lab-and-rgb\nconst K = 18,\n Xn = 0.96422,\n Yn = 1,\n Zn = 0.82521,\n t0 = 4 / 29,\n t1 = 6 / 29,\n t2 = 3 * t1 * t1,\n t3 = t1 * t1 * t1;\n\nfunction labConvert(o) {\n if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);\n if (o instanceof Hcl) return hcl2lab(o);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = rgb2lrgb(o.r),\n g = rgb2lrgb(o.g),\n b = rgb2lrgb(o.b),\n y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;\n if (r === g && g === b) x = z = y; else {\n x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);\n z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);\n }\n return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);\n}\n\nexport function gray(l, opacity) {\n return new Lab(l, 0, 0, opacity == null ? 1 : opacity);\n}\n\nexport default function lab(l, a, b, opacity) {\n return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);\n}\n\nexport function Lab(l, a, b, opacity) {\n this.l = +l;\n this.a = +a;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Lab, lab, extend(Color, {\n brighter(k) {\n return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n darker(k) {\n return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n rgb() {\n var y = (this.l + 16) / 116,\n x = isNaN(this.a) ? y : y + this.a / 500,\n z = isNaN(this.b) ? y : y - this.b / 200;\n x = Xn * lab2xyz(x);\n y = Yn * lab2xyz(y);\n z = Zn * lab2xyz(z);\n return new Rgb(\n lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),\n lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),\n lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),\n this.opacity\n );\n }\n}));\n\nfunction xyz2lab(t) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction lrgb2rgb(x) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2lrgb(x) {\n return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\nfunction hclConvert(o) {\n if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);\n if (!(o instanceof Lab)) o = labConvert(o);\n if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);\n var h = Math.atan2(o.b, o.a) * degrees;\n return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);\n}\n\nexport function lch(l, c, h, opacity) {\n return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function hcl(h, c, l, opacity) {\n return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function Hcl(h, c, l, opacity) {\n this.h = +h;\n this.c = +c;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nfunction hcl2lab(o) {\n if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);\n var h = o.h * radians;\n return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);\n}\n\ndefine(Hcl, hcl, extend(Color, {\n brighter(k) {\n return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);\n },\n darker(k) {\n return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);\n },\n rgb() {\n return hcl2lab(this).rgb();\n }\n}));\n","import {lab as colorLab} from \"d3-color\";\nimport color from \"./color.js\";\n\nexport default function lab(start, end) {\n var l = color((start = colorLab(start)).l, (end = colorLab(end)).l),\n a = color(start.a, end.a),\n b = color(start.b, end.b),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.l = l(t);\n start.a = a(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n}\n","import {hcl as colorHcl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hcl(hue) {\n return function(start, end) {\n var h = hue((start = colorHcl(start)).h, (end = colorHcl(end)).h),\n c = color(start.c, end.c),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.c = c(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hcl(hue);\nexport var hclLong = hcl(color);\n","import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb, darker, brighter} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * degrees - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nexport default function cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nexport function Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * radians,\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new Rgb(\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n","import {cubehelix as colorCubehelix} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\nexport default cubehelix(hue);\nexport var cubehelixLong = cubehelix(color);\n","export default function(interpolator, n) {\n var samples = new Array(n);\n for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));\n return samples;\n}\n","export default function(specifier) {\n var n = specifier.length / 6 | 0, colors = new Array(n), i = 0;\n while (i < n) colors[i] = \"#\" + specifier.slice(i * 6, ++i * 6);\n return colors;\n}\n","import colors from \"../colors.js\";\n\nexport default colors(\"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f\");\n","import { toNumber, peek, toSet, array, constant, isArray, isNumber, span, isObject, isString, error } from 'vega-util';\nimport { bisectRight, range, bisect } from 'd3-array';\nimport * as $ from 'd3-scale';\nimport { scaleOrdinal, tickFormat as tickFormat$1 } from 'd3-scale';\nexport { scaleImplicit } from 'd3-scale';\nimport * as $$1 from 'd3-interpolate';\nimport { schemeAccent, schemeCategory10, schemeDark2, schemeObservable10, schemePaired, schemePastel1, schemePastel2, schemeSet1, schemeSet2, schemeSet3 } from 'd3-scale-chromatic';\nimport { timeInterval, utcInterval } from 'vega-time';\n\nfunction bandSpace (count, paddingInner, paddingOuter) {\n const space = count - paddingInner + paddingOuter * 2;\n return count ? space > 0 ? space : 1 : 0;\n}\n\nconst Identity = 'identity';\nconst Linear = 'linear';\nconst Log = 'log';\nconst Pow = 'pow';\nconst Sqrt = 'sqrt';\nconst Symlog = 'symlog';\nconst Time = 'time';\nconst UTC = 'utc';\nconst Sequential = 'sequential';\nconst Diverging = 'diverging';\nconst Quantile = 'quantile';\nconst Quantize = 'quantize';\nconst Threshold = 'threshold';\nconst Ordinal = 'ordinal';\nconst Point = 'point';\nconst Band = 'band';\nconst BinOrdinal = 'bin-ordinal';\n\n// categories\nconst Continuous = 'continuous';\nconst Discrete = 'discrete';\nconst Discretizing = 'discretizing';\nconst Interpolating = 'interpolating';\nconst Temporal = 'temporal';\n\nfunction invertRange (scale) {\n return function (_) {\n let lo = _[0],\n hi = _[1],\n t;\n if (hi < lo) {\n t = lo;\n lo = hi;\n hi = t;\n }\n return [scale.invert(lo), scale.invert(hi)];\n };\n}\n\nfunction invertRangeExtent (scale) {\n return function (_) {\n const range = scale.range();\n let lo = _[0],\n hi = _[1],\n min = -1,\n max,\n t,\n i,\n n;\n if (hi < lo) {\n t = lo;\n lo = hi;\n hi = t;\n }\n for (i = 0, n = range.length; i < n; ++i) {\n if (range[i] >= lo && range[i] <= hi) {\n if (min < 0) min = i;\n max = i;\n }\n }\n if (min < 0) return undefined;\n lo = scale.invertExtent(range[min]);\n hi = scale.invertExtent(range[max]);\n return [lo[0] === undefined ? lo[1] : lo[0], hi[1] === undefined ? hi[0] : hi[1]];\n };\n}\n\nfunction band() {\n const scale = scaleOrdinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range;\n let range$1 = [0, 1],\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n delete scale.unknown;\n function rescale() {\n const n = domain().length,\n reverse = range$1[1] < range$1[0],\n stop = range$1[1 - reverse],\n space = bandSpace(n, paddingInner, paddingOuter);\n let start = range$1[reverse - 0];\n step = (stop - start) / (space || 1);\n if (round) {\n step = Math.floor(step);\n }\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) {\n start = Math.round(start);\n bandwidth = Math.round(bandwidth);\n }\n const values = range(n).map(i => start + step * i);\n return ordinalRange(reverse ? values.reverse() : values);\n }\n scale.domain = function (_) {\n if (arguments.length) {\n domain(_);\n return rescale();\n } else {\n return domain();\n }\n };\n scale.range = function (_) {\n if (arguments.length) {\n range$1 = [+_[0], +_[1]];\n return rescale();\n } else {\n return range$1.slice();\n }\n };\n scale.rangeRound = function (_) {\n range$1 = [+_[0], +_[1]];\n round = true;\n return rescale();\n };\n scale.bandwidth = function () {\n return bandwidth;\n };\n scale.step = function () {\n return step;\n };\n scale.round = function (_) {\n if (arguments.length) {\n round = !!_;\n return rescale();\n } else {\n return round;\n }\n };\n scale.padding = function (_) {\n if (arguments.length) {\n paddingOuter = Math.max(0, Math.min(1, _));\n paddingInner = paddingOuter;\n return rescale();\n } else {\n return paddingInner;\n }\n };\n scale.paddingInner = function (_) {\n if (arguments.length) {\n paddingInner = Math.max(0, Math.min(1, _));\n return rescale();\n } else {\n return paddingInner;\n }\n };\n scale.paddingOuter = function (_) {\n if (arguments.length) {\n paddingOuter = Math.max(0, Math.min(1, _));\n return rescale();\n } else {\n return paddingOuter;\n }\n };\n scale.align = function (_) {\n if (arguments.length) {\n align = Math.max(0, Math.min(1, _));\n return rescale();\n } else {\n return align;\n }\n };\n scale.invertRange = function (_) {\n // bail if range has null or undefined values\n if (_[0] == null || _[1] == null) return;\n const reverse = range$1[1] < range$1[0],\n values = reverse ? ordinalRange().reverse() : ordinalRange(),\n n = values.length - 1;\n let lo = +_[0],\n hi = +_[1],\n a,\n b,\n t;\n\n // bail if either range endpoint is invalid\n if (lo !== lo || hi !== hi) return;\n\n // order range inputs, bail if outside of scale range\n if (hi < lo) {\n t = lo;\n lo = hi;\n hi = t;\n }\n if (hi < values[0] || lo > range$1[1 - reverse]) return;\n\n // binary search to index into scale range\n a = Math.max(0, bisectRight(values, lo) - 1);\n b = lo === hi ? a : bisectRight(values, hi) - 1;\n\n // increment index a if lo is within padding gap\n if (lo - values[a] > bandwidth + 1e-10) ++a;\n if (reverse) {\n // map + swap\n t = a;\n a = n - b;\n b = n - t;\n }\n return a > b ? undefined : domain().slice(a, b + 1);\n };\n scale.invert = function (_) {\n const value = scale.invertRange([_, _]);\n return value ? value[0] : value;\n };\n scale.copy = function () {\n return band().domain(domain()).range(range$1).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);\n };\n return rescale();\n}\nfunction pointish(scale) {\n const copy = scale.copy;\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n scale.copy = function () {\n return pointish(copy());\n };\n return scale;\n}\nfunction point() {\n return pointish(band().paddingInner(1));\n}\n\nvar map = Array.prototype.map;\nfunction numbers(_) {\n return map.call(_, toNumber);\n}\n\nconst slice = Array.prototype.slice;\n\nfunction scaleBinOrdinal() {\n let domain = [],\n range = [];\n function scale(x) {\n return x == null || x !== x ? undefined : range[(bisect(domain, x) - 1) % range.length];\n }\n scale.domain = function (_) {\n if (arguments.length) {\n domain = numbers(_);\n return scale;\n } else {\n return domain.slice();\n }\n };\n scale.range = function (_) {\n if (arguments.length) {\n range = slice.call(_);\n return scale;\n } else {\n return range.slice();\n }\n };\n scale.tickFormat = function (count, specifier) {\n return tickFormat$1(domain[0], peek(domain), count == null ? 10 : count, specifier);\n };\n scale.copy = function () {\n return scaleBinOrdinal().domain(scale.domain()).range(scale.range());\n };\n return scale;\n}\n\n/** Private scale registry: should not be exported */\nconst scales = new Map();\nconst VEGA_SCALE = Symbol('vega_scale');\nfunction registerScale(scale) {\n scale[VEGA_SCALE] = true;\n return scale;\n}\n\n/**\n * Return true if object was created by a constructor from the vega-scale `scale` function.\n */\nfunction isRegisteredScale(scale) {\n return scale && scale[VEGA_SCALE] === true;\n}\n\n/**\n * Augment scales with their type and needed inverse methods.\n */\nfunction create(type, constructor, metadata) {\n const ctr = function scale() {\n const s = constructor();\n if (!s.invertRange) {\n s.invertRange = s.invert ? invertRange(s) : s.invertExtent ? invertRangeExtent(s) : undefined;\n }\n s.type = type;\n return registerScale(s);\n };\n ctr.metadata = toSet(array(metadata));\n return ctr;\n}\n\n/**\n * Registry function for adding and accessing scale constructor functions.\n * The *type* argument is a String indicating the name of the scale type.\n *\n * If the *scale* argument is not specified, this method returns the matching scale constructor in the registry, or `null` if not found.\n * If the *scale* argument is provided, it must be a scale constructor function to add to the registry under the given *type* name.\n * The *metadata* argument provides additional information to guide appropriate use of scales within Vega.\n *\n * *metadata* can be either a string or string array. The valid string values are:\n * - `\"continuous\"` - the scale is defined over a continuous-valued domain.\n * - `\"discrete\"` - the scale is defined over a discrete domain and range.\n * - `\"discretizing\"` - the scale discretizes a continuous domain to a discrete range.\n * - `\"interpolating\"` - the scale range is defined using a color interpolator.\n * - `\"log\"` - the scale performs a logarithmic transform of the continuous domain.\n * - `\"temporal\"` - the scale domain is defined over date-time values.\n */\nfunction scale(type, scale, metadata) {\n if (arguments.length > 1) {\n scales.set(type, create(type, scale, metadata));\n return this;\n } else {\n return isValidScaleType(type) ? scales.get(type) : undefined;\n }\n}\n\n// identity scale\nscale(Identity, $.scaleIdentity);\n\n// continuous scales\nscale(Linear, $.scaleLinear, Continuous);\nscale(Log, $.scaleLog, [Continuous, Log]);\nscale(Pow, $.scalePow, Continuous);\nscale(Sqrt, $.scaleSqrt, Continuous);\nscale(Symlog, $.scaleSymlog, Continuous);\nscale(Time, $.scaleTime, [Continuous, Temporal]);\nscale(UTC, $.scaleUtc, [Continuous, Temporal]);\n\n// sequential scales\nscale(Sequential, $.scaleSequential, [Continuous, Interpolating]); // backwards compat\nscale(`${Sequential}-${Linear}`, $.scaleSequential, [Continuous, Interpolating]);\nscale(`${Sequential}-${Log}`, $.scaleSequentialLog, [Continuous, Interpolating, Log]);\nscale(`${Sequential}-${Pow}`, $.scaleSequentialPow, [Continuous, Interpolating]);\nscale(`${Sequential}-${Sqrt}`, $.scaleSequentialSqrt, [Continuous, Interpolating]);\nscale(`${Sequential}-${Symlog}`, $.scaleSequentialSymlog, [Continuous, Interpolating]);\n\n// diverging scales\nscale(`${Diverging}-${Linear}`, $.scaleDiverging, [Continuous, Interpolating]);\nscale(`${Diverging}-${Log}`, $.scaleDivergingLog, [Continuous, Interpolating, Log]);\nscale(`${Diverging}-${Pow}`, $.scaleDivergingPow, [Continuous, Interpolating]);\nscale(`${Diverging}-${Sqrt}`, $.scaleDivergingSqrt, [Continuous, Interpolating]);\nscale(`${Diverging}-${Symlog}`, $.scaleDivergingSymlog, [Continuous, Interpolating]);\n\n// discretizing scales\nscale(Quantile, $.scaleQuantile, [Discretizing, Quantile]);\nscale(Quantize, $.scaleQuantize, Discretizing);\nscale(Threshold, $.scaleThreshold, Discretizing);\n\n// discrete scales\nscale(BinOrdinal, scaleBinOrdinal, [Discrete, Discretizing]);\nscale(Ordinal, $.scaleOrdinal, Discrete);\nscale(Band, band, Discrete);\nscale(Point, point, Discrete);\nfunction isValidScaleType(type) {\n return scales.has(type);\n}\nfunction hasType(key, type) {\n const s = scales.get(key);\n return s && s.metadata[type];\n}\nfunction isContinuous(key) {\n return hasType(key, Continuous);\n}\nfunction isDiscrete(key) {\n return hasType(key, Discrete);\n}\nfunction isDiscretizing(key) {\n return hasType(key, Discretizing);\n}\nfunction isLogarithmic(key) {\n return hasType(key, Log);\n}\nfunction isTemporal(key) {\n return hasType(key, Temporal);\n}\nfunction isInterpolating(key) {\n return hasType(key, Interpolating);\n}\nfunction isQuantile(key) {\n return hasType(key, Quantile);\n}\n\nconst scaleProps = ['clamp', 'base', 'constant', 'exponent'];\nfunction interpolateRange(interpolator, range) {\n const start = range[0],\n span = peek(range) - start;\n return function (i) {\n return interpolator(start + i * span);\n };\n}\nfunction interpolateColors(colors, type, gamma) {\n return $$1.piecewise(interpolate(type || 'rgb', gamma), colors);\n}\nfunction quantizeInterpolator(interpolator, count) {\n const samples = new Array(count),\n n = count + 1;\n for (let i = 0; i < count;) samples[i] = interpolator(++i / n);\n return samples;\n}\nfunction scaleCopy(scale) {\n const t = scale.type,\n s = scale.copy();\n s.type = t;\n return s;\n}\nfunction scaleFraction(scale$1, min, max) {\n const delta = max - min;\n let i, t, s;\n if (!delta || !Number.isFinite(delta)) {\n return constant(0.5);\n } else {\n i = (t = scale$1.type).indexOf('-');\n t = i < 0 ? t : t.slice(i + 1);\n s = scale(t)().domain([min, max]).range([0, 1]);\n scaleProps.forEach(m => scale$1[m] ? s[m](scale$1[m]()) : 0);\n return s;\n }\n}\nfunction interpolate(type, gamma) {\n const interp = $$1[method(type)];\n return gamma != null && interp && interp.gamma ? interp.gamma(gamma) : interp;\n}\nfunction method(type) {\n return 'interpolate' + type.toLowerCase().split('-').map(s => s[0].toUpperCase() + s.slice(1)).join('');\n}\n\nconst continuous = {\n blues: 'cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90',\n greens: 'd3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429',\n greys: 'e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e',\n oranges: 'fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303',\n purples: 'e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c',\n reds: 'fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13',\n blueGreen: 'd5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429',\n bluePurple: 'ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71',\n greenBlue: 'd3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1',\n orangeRed: 'fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403',\n purpleBlue: 'dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281',\n purpleBlueGreen: 'dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353',\n purpleRed: 'dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a',\n redPurple: 'fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174',\n yellowGreen: 'e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034',\n yellowOrangeBrown: 'feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204',\n yellowOrangeRed: 'fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225',\n blueOrange: '134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07',\n brownBlueGreen: '704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147',\n purpleGreen: '5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29',\n purpleOrange: '4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07',\n redBlue: '8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85',\n redGrey: '8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434',\n yellowGreenBlue: 'eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185',\n redYellowBlue: 'a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695',\n redYellowGreen: 'a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837',\n pinkYellowGreen: '8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419',\n spectral: '9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2',\n viridis: '440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725',\n magma: '0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf',\n inferno: '0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4',\n plasma: '0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921',\n cividis: '00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647',\n rainbow: '6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa',\n sinebow: 'ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040',\n turbo: '23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00',\n browns: 'eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632',\n tealBlues: 'bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985',\n teals: 'bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667',\n warmGreys: 'dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e',\n goldGreen: 'f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36',\n goldOrange: 'f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26',\n goldRed: 'f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e',\n lightGreyRed: 'efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b',\n lightGreyTeal: 'e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc',\n lightMulti: 'e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c',\n lightOrange: 'f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b',\n lightTealBlue: 'e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988',\n darkBlue: '3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff',\n darkGold: '3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff',\n darkGreen: '3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa',\n darkMulti: '3737371f5287197d8c29a86995ce3fffe800ffffff',\n darkRed: '3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c'\n};\nconst discrete = {\n accent: schemeAccent,\n category10: schemeCategory10,\n category20: '1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5',\n category20b: '393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6',\n category20c: '3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9',\n dark2: schemeDark2,\n observable10: schemeObservable10,\n paired: schemePaired,\n pastel1: schemePastel1,\n pastel2: schemePastel2,\n set1: schemeSet1,\n set2: schemeSet2,\n set3: schemeSet3,\n tableau10: '4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac',\n tableau20: '4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5'\n};\n\nfunction colors(palette) {\n if (isArray(palette)) return palette;\n const n = palette.length / 6 | 0,\n c = new Array(n);\n for (let i = 0; i < n;) {\n c[i] = '#' + palette.slice(i * 6, ++i * 6);\n }\n return c;\n}\nfunction apply(_, f) {\n for (const k in _) scheme(k, f(_[k]));\n}\nconst schemes = {};\napply(discrete, colors);\napply(continuous, _ => interpolateColors(colors(_)));\nfunction scheme(name, scheme) {\n name = name && name.toLowerCase();\n if (arguments.length > 1) {\n schemes[name] = scheme;\n return this;\n } else {\n return schemes[name];\n }\n}\n\nconst SymbolLegend = 'symbol';\nconst DiscreteLegend = 'discrete';\nconst GradientLegend = 'gradient';\n\nconst defaultFormatter = value => isArray(value) ? value.map(v => String(v)) : String(value);\nconst ascending = (a, b) => a[1] - b[1];\nconst descending = (a, b) => b[1] - a[1];\n\n/**\n * Determine the tick count or interval function.\n * @param {Scale} scale - The scale for which to generate tick values.\n * @param {*} count - The desired tick count or interval specifier.\n * @param {number} minStep - The desired minimum step between tick values.\n * @return {*} - The tick count or interval function.\n */\nfunction tickCount(scale, count, minStep) {\n let step;\n if (isNumber(count)) {\n if (scale.bins) {\n count = Math.max(count, scale.bins.length);\n }\n if (minStep != null) {\n count = Math.min(count, Math.floor(span(scale.domain()) / minStep || 1) + 1);\n }\n }\n if (isObject(count)) {\n step = count.step;\n count = count.interval;\n }\n if (isString(count)) {\n count = scale.type === Time ? timeInterval(count) : scale.type == UTC ? utcInterval(count) : error('Only time and utc scales accept interval strings.');\n if (step) count = count.every(step);\n }\n return count;\n}\n\n/**\n * Filter a set of candidate tick values, ensuring that only tick values\n * that lie within the scale range are included.\n * @param {Scale} scale - The scale for which to generate tick values.\n * @param {Array<*>} ticks - The candidate tick values.\n * @param {*} count - The tick count or interval function.\n * @return {Array<*>} - The filtered tick values.\n */\nfunction validTicks(scale, ticks, count) {\n let range = scale.range(),\n lo = range[0],\n hi = peek(range),\n cmp = ascending;\n if (lo > hi) {\n range = hi;\n hi = lo;\n lo = range;\n cmp = descending;\n }\n lo = Math.floor(lo);\n hi = Math.ceil(hi);\n\n // filter ticks to valid values within the range\n // additionally sort ticks in range order (#2579)\n ticks = ticks.map(v => [v, scale(v)]).filter(_ => lo <= _[1] && _[1] <= hi).sort(cmp).map(_ => _[0]);\n if (count > 0 && ticks.length > 1) {\n const endpoints = [ticks[0], peek(ticks)];\n while (ticks.length > count && ticks.length >= 3) {\n ticks = ticks.filter((_, i) => !(i % 2));\n }\n if (ticks.length < 3) {\n ticks = endpoints;\n }\n }\n return ticks;\n}\n\n/**\n * Generate tick values for the given scale and approximate tick count or\n * interval value. If the scale has a 'ticks' method, it will be used to\n * generate the ticks, with the count argument passed as a parameter. If the\n * scale lacks a 'ticks' method, the full scale domain will be returned.\n * @param {Scale} scale - The scale for which to generate tick values.\n * @param {*} [count] - The approximate number of desired ticks.\n * @return {Array<*>} - The generated tick values.\n */\nfunction tickValues(scale, count) {\n return scale.bins ? validTicks(scale, scale.bins, count) : scale.ticks ? scale.ticks(count) : scale.domain();\n}\n\n/**\n * Generate a label format function for a scale. If the scale has a\n * 'tickFormat' method, it will be used to generate the formatter, with the\n * count and specifier arguments passed as parameters. If the scale lacks a\n * 'tickFormat' method, the returned formatter performs simple string coercion.\n * If the input scale is a logarithmic scale and the format specifier does not\n * indicate a desired decimal precision, a special variable precision formatter\n * that automatically trims trailing zeroes will be generated.\n * @param {Scale} scale - The scale for which to generate the label formatter.\n * @param {*} [count] - The approximate number of desired ticks.\n * @param {string} [specifier] - The format specifier. Must be a legal d3\n * specifier string (see https://github.com/d3/d3-format#formatSpecifier) or\n * time multi-format specifier object.\n * @return {function(*):string} - The generated label formatter.\n */\nfunction tickFormat(locale, scale, count, specifier, formatType, noSkip) {\n const type = scale.type;\n let format = defaultFormatter;\n if (type === Time || formatType === Time) {\n format = locale.timeFormat(specifier);\n } else if (type === UTC || formatType === UTC) {\n format = locale.utcFormat(specifier);\n } else if (isLogarithmic(type)) {\n const varfmt = locale.formatFloat(specifier);\n if (noSkip || scale.bins) {\n format = varfmt;\n } else {\n const test = tickLog(scale, count, false);\n format = _ => test(_) ? varfmt(_) : '';\n }\n } else if (scale.tickFormat) {\n // if d3 scale has tickFormat, it must be continuous\n const d = scale.domain();\n format = locale.formatSpan(d[0], d[d.length - 1], count, specifier);\n } else if (specifier) {\n format = locale.format(specifier);\n }\n return format;\n}\nfunction tickLog(scale, count, values) {\n const ticks = tickValues(scale, count),\n base = scale.base(),\n logb = Math.log(base),\n k = Math.max(1, base * count / ticks.length);\n\n // apply d3-scale's log format filter criteria\n const test = d => {\n let i = d / Math.pow(base, Math.round(Math.log(d) / logb));\n if (i * base < base - 0.5) i *= base;\n return i <= k;\n };\n return values ? ticks.filter(test) : test;\n}\n\nconst symbols = {\n [Quantile]: 'quantiles',\n [Quantize]: 'thresholds',\n [Threshold]: 'domain'\n};\nconst formats = {\n [Quantile]: 'quantiles',\n [Quantize]: 'domain'\n};\nfunction labelValues(scale, count) {\n return scale.bins ? binValues(scale.bins) : scale.type === Log ? tickLog(scale, count, true) : symbols[scale.type] ? thresholdValues(scale[symbols[scale.type]]()) : tickValues(scale, count);\n}\nfunction thresholdFormat(locale, scale, specifier) {\n const _ = scale[formats[scale.type]](),\n n = _.length;\n let d = n > 1 ? _[1] - _[0] : _[0],\n i;\n for (i = 1; i < n; ++i) {\n d = Math.min(d, _[i] - _[i - 1]);\n }\n\n // tickCount = 3 ticks times 10 for increased resolution\n return locale.formatSpan(0, d, 3 * 10, specifier);\n}\nfunction thresholdValues(thresholds) {\n const values = [-Infinity].concat(thresholds);\n values.max = +Infinity;\n return values;\n}\nfunction binValues(bins) {\n const values = bins.slice(0, -1);\n values.max = peek(bins);\n return values;\n}\nconst isDiscreteRange = scale => symbols[scale.type] || scale.bins;\nfunction labelFormat(locale, scale, count, type, specifier, formatType, noSkip) {\n const format = formats[scale.type] && formatType !== Time && formatType !== UTC ? thresholdFormat(locale, scale, specifier) : tickFormat(locale, scale, count, specifier, formatType, noSkip);\n return type === SymbolLegend && isDiscreteRange(scale) ? formatRange(format) : type === DiscreteLegend ? formatDiscrete(format) : formatPoint(format);\n}\nconst formatRange = format => (value, index, array) => {\n const limit = get(array[index + 1], get(array.max, +Infinity)),\n lo = formatValue(value, format),\n hi = formatValue(limit, format);\n return lo && hi ? lo + ' \\u2013 ' + hi : hi ? '< ' + hi : '\\u2265 ' + lo;\n};\nconst get = (value, dflt) => value != null ? value : dflt;\nconst formatDiscrete = format => (value, index) => index ? format(value) : null;\nconst formatPoint = format => value => format(value);\nconst formatValue = (value, format) => Number.isFinite(value) ? format(value) : null;\nfunction labelFraction(scale) {\n const domain = scale.domain(),\n count = domain.length - 1;\n let lo = +domain[0],\n hi = +peek(domain),\n span = hi - lo;\n if (scale.type === Threshold) {\n const adjust = count ? span / count : 0.1;\n lo -= adjust;\n hi += adjust;\n span = hi - lo;\n }\n return value => (value - lo) / span;\n}\n\nfunction format(locale, scale, specifier, formatType) {\n const type = formatType || scale.type;\n\n // replace abbreviated time specifiers to improve screen reader experience\n if (isString(specifier) && isTemporal(type)) {\n specifier = specifier.replace(/%a/g, '%A').replace(/%b/g, '%B');\n }\n return !specifier && type === Time ? locale.timeFormat('%A, %d %B %Y, %X') : !specifier && type === UTC ? locale.utcFormat('%A, %d %B %Y, %X UTC') : labelFormat(locale, scale, 5, null, specifier, formatType, true);\n}\nfunction domainCaption(locale, scale, opt) {\n opt = opt || {};\n const max = Math.max(3, opt.maxlen || 7),\n fmt = format(locale, scale, opt.format, opt.formatType);\n\n // if scale breaks domain into bins, describe boundaries\n if (isDiscretizing(scale.type)) {\n const v = labelValues(scale).slice(1).map(fmt),\n n = v.length;\n return `${n} boundar${n === 1 ? 'y' : 'ies'}: ${v.join(', ')}`;\n }\n\n // if scale domain is discrete, list values\n else if (isDiscrete(scale.type)) {\n const d = scale.domain(),\n n = d.length,\n v = n > max ? d.slice(0, max - 2).map(fmt).join(', ') + ', ending with ' + d.slice(-1).map(fmt) : d.map(fmt).join(', ');\n return `${n} value${n === 1 ? '' : 's'}: ${v}`;\n }\n\n // if scale domain is continuous, describe value range\n else {\n const d = scale.domain();\n return `values from ${fmt(d[0])} to ${fmt(peek(d))}`;\n }\n}\n\nexport { Band, BinOrdinal, DiscreteLegend, Diverging, GradientLegend, Identity, Linear, Log, Ordinal, Point, Pow, Quantile, Quantize, Sequential, Sqrt, SymbolLegend, Symlog, Threshold, Time, UTC, bandSpace, domainCaption, interpolate, interpolateColors, interpolateRange, isContinuous, isDiscrete, isDiscretizing, isInterpolating, isLogarithmic, isQuantile, isRegisteredScale, isTemporal, isValidScaleType, labelFormat, labelFraction, labelValues, quantizeInterpolator, registerScale, scale, scaleCopy, scaleFraction, scheme, tickCount, tickFormat, tickValues, validTicks };\n","import {linearish} from \"./linear.js\";\nimport number from \"./number.js\";\n\nexport default function identity(domain) {\n var unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = Array.from(_, number), scale) : domain.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return identity(domain).unknown(unknown);\n };\n\n domain = arguments.length ? Array.from(domain, number) : [0, 1];\n\n return linearish(scale);\n}\n","import {utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcTicks, utcTickInterval} from \"d3-time\";\nimport {utcFormat} from \"d3-time-format\";\nimport {calendar} from \"./time.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function utcTime() {\n return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);\n}\n","import {ascending, bisect, quantileSorted as threshold} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantile() {\n var domain = [],\n range = [],\n thresholds = [],\n unknown;\n\n function rescale() {\n var i = 0, n = Math.max(1, range.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = threshold(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : range[bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n","import {bisect} from \"d3-array\";\nimport {linearish} from \"./linear.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1],\n unknown;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : scale;\n };\n\n scale.thresholds = function() {\n return domain.slice();\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(linearish(scale), arguments);\n}\n","import {bisect} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function threshold() {\n var domain = [0.5],\n range = [0, 1],\n unknown,\n n = 1;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n","import { hasOwnProperty, isFunction, inherits, truthy, lruCache, isArray, error, toSet, array, peek, extend, isNumber, isObject } from 'vega-util';\nimport { curveBasis, curveBasisClosed, curveBasisOpen, curveBundle, curveCardinal, curveCardinalOpen, curveCardinalClosed, curveCatmullRom, curveCatmullRomClosed, curveCatmullRomOpen, curveLinear, curveLinearClosed, curveMonotoneY, curveMonotoneX, curveNatural, curveStep, curveStepAfter, curveStepBefore, arc as arc$2, area as area$2, line as line$2, symbol as symbol$2 } from 'd3-shape';\nimport { path as path$3 } from 'd3-path';\nexport { path } from 'd3-path';\nimport { image as image$1, canvas } from 'vega-canvas';\nimport { loader } from 'vega-loader';\nimport { isDiscrete, domainCaption } from 'vega-scale';\n\nlet gradient_id = 0;\nfunction resetSVGGradientId() {\n gradient_id = 0;\n}\nconst patternPrefix = 'p_';\nfunction isGradient(value) {\n return value && value.gradient;\n}\nfunction gradientRef(g, defs, base) {\n const type = g.gradient;\n let id = g.id,\n prefix = type === 'radial' ? patternPrefix : '';\n\n // check id, assign default values as needed\n if (!id) {\n id = g.id = 'gradient_' + gradient_id++;\n if (type === 'radial') {\n g.x1 = get(g.x1, 0.5);\n g.y1 = get(g.y1, 0.5);\n g.r1 = get(g.r1, 0);\n g.x2 = get(g.x2, 0.5);\n g.y2 = get(g.y2, 0.5);\n g.r2 = get(g.r2, 0.5);\n prefix = patternPrefix;\n } else {\n g.x1 = get(g.x1, 0);\n g.y1 = get(g.y1, 0);\n g.x2 = get(g.x2, 1);\n g.y2 = get(g.y2, 0);\n }\n }\n\n // register definition\n defs[id] = g;\n\n // return url reference\n return 'url(' + (base || '') + '#' + prefix + id + ')';\n}\nfunction get(val, def) {\n return val != null ? val : def;\n}\nfunction Gradient (p0, p1) {\n var stops = [],\n gradient;\n return gradient = {\n gradient: 'linear',\n x1: p0 ? p0[0] : 0,\n y1: p0 ? p0[1] : 0,\n x2: p1 ? p1[0] : 1,\n y2: p1 ? p1[1] : 0,\n stops: stops,\n stop: function (offset, color) {\n stops.push({\n offset: offset,\n color: color\n });\n return gradient;\n }\n };\n}\n\nconst lookup = {\n 'basis': {\n curve: curveBasis\n },\n 'basis-closed': {\n curve: curveBasisClosed\n },\n 'basis-open': {\n curve: curveBasisOpen\n },\n 'bundle': {\n curve: curveBundle,\n tension: 'beta',\n value: 0.85\n },\n 'cardinal': {\n curve: curveCardinal,\n tension: 'tension',\n value: 0\n },\n 'cardinal-open': {\n curve: curveCardinalOpen,\n tension: 'tension',\n value: 0\n },\n 'cardinal-closed': {\n curve: curveCardinalClosed,\n tension: 'tension',\n value: 0\n },\n 'catmull-rom': {\n curve: curveCatmullRom,\n tension: 'alpha',\n value: 0.5\n },\n 'catmull-rom-closed': {\n curve: curveCatmullRomClosed,\n tension: 'alpha',\n value: 0.5\n },\n 'catmull-rom-open': {\n curve: curveCatmullRomOpen,\n tension: 'alpha',\n value: 0.5\n },\n 'linear': {\n curve: curveLinear\n },\n 'linear-closed': {\n curve: curveLinearClosed\n },\n 'monotone': {\n horizontal: curveMonotoneY,\n vertical: curveMonotoneX\n },\n 'natural': {\n curve: curveNatural\n },\n 'step': {\n curve: curveStep\n },\n 'step-after': {\n curve: curveStepAfter\n },\n 'step-before': {\n curve: curveStepBefore\n }\n};\nfunction curves(type, orientation, tension) {\n var entry = hasOwnProperty(lookup, type) && lookup[type],\n curve = null;\n if (entry) {\n curve = entry.curve || entry[orientation || 'vertical'];\n if (entry.tension && tension != null) {\n curve = curve[entry.tension](tension);\n }\n }\n return curve;\n}\n\nconst paramCounts = {\n m: 2,\n l: 2,\n h: 1,\n v: 1,\n z: 0,\n c: 6,\n s: 4,\n q: 4,\n t: 2,\n a: 7\n};\nconst commandPattern = /[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi;\nconst numberPattern = /^[+-]?(([0-9]*\\.[0-9]+)|([0-9]+\\.)|([0-9]+))([eE][+-]?[0-9]+)?/;\nconst spacePattern = /^((\\s+,?\\s*)|(,\\s*))/;\nconst flagPattern = /^[01]/;\nfunction parse(path) {\n const commands = [];\n const matches = path.match(commandPattern) || [];\n matches.forEach(str => {\n let cmd = str[0];\n const type = cmd.toLowerCase();\n\n // parse parameters\n const paramCount = paramCounts[type];\n const params = parseParams(type, paramCount, str.slice(1).trim());\n const count = params.length;\n\n // error checking based on parameter count\n if (count < paramCount || count && count % paramCount !== 0) {\n throw Error('Invalid SVG path, incorrect parameter count');\n }\n\n // register the command\n commands.push([cmd, ...params.slice(0, paramCount)]);\n\n // exit now if we're done, also handles zero-param 'z'\n if (count === paramCount) {\n return;\n }\n\n // handle implicit line-to\n if (type === 'm') {\n cmd = cmd === 'M' ? 'L' : 'l';\n }\n\n // repeat command when given extended param list\n for (let i = paramCount; i < count; i += paramCount) {\n commands.push([cmd, ...params.slice(i, i + paramCount)]);\n }\n });\n return commands;\n}\nfunction parseParams(type, paramCount, segment) {\n const params = [];\n for (let index = 0; paramCount && index < segment.length;) {\n for (let i = 0; i < paramCount; ++i) {\n const pattern = type === 'a' && (i === 3 || i === 4) ? flagPattern : numberPattern;\n const match = segment.slice(index).match(pattern);\n if (match === null) {\n throw Error('Invalid SVG path, incorrect parameter type');\n }\n index += match[0].length;\n params.push(+match[0]);\n const ws = segment.slice(index).match(spacePattern);\n if (ws !== null) {\n index += ws[0].length;\n }\n }\n }\n return params;\n}\n\nconst DegToRad = Math.PI / 180;\nconst Epsilon = 1e-14;\nconst HalfPi = Math.PI / 2;\nconst Tau = Math.PI * 2;\nconst HalfSqrt3 = Math.sqrt(3) / 2;\n\nvar segmentCache = {};\nvar bezierCache = {};\nvar join = [].join;\n\n// Copied from Inkscape svgtopdf, thanks!\nfunction segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {\n const key = join.call(arguments);\n if (segmentCache[key]) {\n return segmentCache[key];\n }\n const th = rotateX * DegToRad;\n const sin_th = Math.sin(th);\n const cos_th = Math.cos(th);\n rx = Math.abs(rx);\n ry = Math.abs(ry);\n const px = cos_th * (ox - x) * 0.5 + sin_th * (oy - y) * 0.5;\n const py = cos_th * (oy - y) * 0.5 - sin_th * (ox - x) * 0.5;\n let pl = px * px / (rx * rx) + py * py / (ry * ry);\n if (pl > 1) {\n pl = Math.sqrt(pl);\n rx *= pl;\n ry *= pl;\n }\n const a00 = cos_th / rx;\n const a01 = sin_th / rx;\n const a10 = -sin_th / ry;\n const a11 = cos_th / ry;\n const x0 = a00 * ox + a01 * oy;\n const y0 = a10 * ox + a11 * oy;\n const x1 = a00 * x + a01 * y;\n const y1 = a10 * x + a11 * y;\n const d = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0);\n let sfactor_sq = 1 / d - 0.25;\n if (sfactor_sq < 0) sfactor_sq = 0;\n let sfactor = Math.sqrt(sfactor_sq);\n if (sweep == large) sfactor = -sfactor;\n const xc = 0.5 * (x0 + x1) - sfactor * (y1 - y0);\n const yc = 0.5 * (y0 + y1) + sfactor * (x1 - x0);\n const th0 = Math.atan2(y0 - yc, x0 - xc);\n const th1 = Math.atan2(y1 - yc, x1 - xc);\n let th_arc = th1 - th0;\n if (th_arc < 0 && sweep === 1) {\n th_arc += Tau;\n } else if (th_arc > 0 && sweep === 0) {\n th_arc -= Tau;\n }\n const segs = Math.ceil(Math.abs(th_arc / (HalfPi + 0.001)));\n const result = [];\n for (let i = 0; i < segs; ++i) {\n const th2 = th0 + i * th_arc / segs;\n const th3 = th0 + (i + 1) * th_arc / segs;\n result[i] = [xc, yc, th2, th3, rx, ry, sin_th, cos_th];\n }\n return segmentCache[key] = result;\n}\nfunction bezier(params) {\n const key = join.call(params);\n if (bezierCache[key]) {\n return bezierCache[key];\n }\n var cx = params[0],\n cy = params[1],\n th0 = params[2],\n th1 = params[3],\n rx = params[4],\n ry = params[5],\n sin_th = params[6],\n cos_th = params[7];\n const a00 = cos_th * rx;\n const a01 = -sin_th * ry;\n const a10 = sin_th * rx;\n const a11 = cos_th * ry;\n const cos_th0 = Math.cos(th0);\n const sin_th0 = Math.sin(th0);\n const cos_th1 = Math.cos(th1);\n const sin_th1 = Math.sin(th1);\n const th_half = 0.5 * (th1 - th0);\n const sin_th_h2 = Math.sin(th_half * 0.5);\n const t = 8 / 3 * sin_th_h2 * sin_th_h2 / Math.sin(th_half);\n const x1 = cx + cos_th0 - t * sin_th0;\n const y1 = cy + sin_th0 + t * cos_th0;\n const x3 = cx + cos_th1;\n const y3 = cy + sin_th1;\n const x2 = x3 + t * sin_th1;\n const y2 = y3 - t * cos_th1;\n return bezierCache[key] = [a00 * x1 + a01 * y1, a10 * x1 + a11 * y1, a00 * x2 + a01 * y2, a10 * x2 + a11 * y2, a00 * x3 + a01 * y3, a10 * x3 + a11 * y3];\n}\n\nconst temp = ['l', 0, 0, 0, 0, 0, 0, 0];\nfunction scale$1(current, sX, sY) {\n const c = temp[0] = current[0];\n if (c === 'a' || c === 'A') {\n temp[1] = sX * current[1];\n temp[2] = sY * current[2];\n temp[3] = current[3];\n temp[4] = current[4];\n temp[5] = current[5];\n temp[6] = sX * current[6];\n temp[7] = sY * current[7];\n } else if (c === 'h' || c === 'H') {\n temp[1] = sX * current[1];\n } else if (c === 'v' || c === 'V') {\n temp[1] = sY * current[1];\n } else {\n for (var i = 1, n = current.length; i < n; ++i) {\n temp[i] = (i % 2 == 1 ? sX : sY) * current[i];\n }\n }\n return temp;\n}\nfunction pathRender (context, path, l, t, sX, sY) {\n var current,\n // current instruction\n previous = null,\n x = 0,\n // current x\n y = 0,\n // current y\n controlX = 0,\n // current control point x\n controlY = 0,\n // current control point y\n tempX,\n tempY,\n tempControlX,\n tempControlY,\n anchorX = 0,\n anchorY = 0;\n if (l == null) l = 0;\n if (t == null) t = 0;\n if (sX == null) sX = 1;\n if (sY == null) sY = sX;\n if (context.beginPath) context.beginPath();\n for (var i = 0, len = path.length; i < len; ++i) {\n current = path[i];\n if (sX !== 1 || sY !== 1) {\n current = scale$1(current, sX, sY);\n }\n switch (current[0]) {\n // first letter\n\n case 'l':\n // lineto, relative\n x += current[1];\n y += current[2];\n context.lineTo(x + l, y + t);\n break;\n case 'L':\n // lineto, absolute\n x = current[1];\n y = current[2];\n context.lineTo(x + l, y + t);\n break;\n case 'h':\n // horizontal lineto, relative\n x += current[1];\n context.lineTo(x + l, y + t);\n break;\n case 'H':\n // horizontal lineto, absolute\n x = current[1];\n context.lineTo(x + l, y + t);\n break;\n case 'v':\n // vertical lineto, relative\n y += current[1];\n context.lineTo(x + l, y + t);\n break;\n case 'V':\n // verical lineto, absolute\n y = current[1];\n context.lineTo(x + l, y + t);\n break;\n case 'm':\n // moveTo, relative\n x += current[1];\n y += current[2];\n anchorX = x;\n anchorY = y;\n context.moveTo(x + l, y + t);\n break;\n case 'M':\n // moveTo, absolute\n x = current[1];\n y = current[2];\n anchorX = x;\n anchorY = y;\n context.moveTo(x + l, y + t);\n break;\n case 'c':\n // bezierCurveTo, relative\n tempX = x + current[5];\n tempY = y + current[6];\n controlX = x + current[3];\n controlY = y + current[4];\n context.bezierCurveTo(x + current[1] + l,\n // x1\n y + current[2] + t,\n // y1\n controlX + l,\n // x2\n controlY + t,\n // y2\n tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n case 'C':\n // bezierCurveTo, absolute\n x = current[5];\n y = current[6];\n controlX = current[3];\n controlY = current[4];\n context.bezierCurveTo(current[1] + l, current[2] + t, controlX + l, controlY + t, x + l, y + t);\n break;\n case 's':\n // shorthand cubic bezierCurveTo, relative\n // transform to absolute x,y\n tempX = x + current[3];\n tempY = y + current[4];\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n context.bezierCurveTo(controlX + l, controlY + t, x + current[1] + l, y + current[2] + t, tempX + l, tempY + t);\n\n // set control point to 2nd one of this command\n // the first control point is assumed to be the reflection of\n // the second control point on the previous command relative\n // to the current point.\n controlX = x + current[1];\n controlY = y + current[2];\n x = tempX;\n y = tempY;\n break;\n case 'S':\n // shorthand cubic bezierCurveTo, absolute\n tempX = current[3];\n tempY = current[4];\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n context.bezierCurveTo(controlX + l, controlY + t, current[1] + l, current[2] + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n // set control point to 2nd one of this command\n // the first control point is assumed to be the reflection of\n // the second control point on the previous command relative\n // to the current point.\n controlX = current[1];\n controlY = current[2];\n break;\n case 'q':\n // quadraticCurveTo, relative\n // transform to absolute x,y\n tempX = x + current[3];\n tempY = y + current[4];\n controlX = x + current[1];\n controlY = y + current[2];\n context.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n case 'Q':\n // quadraticCurveTo, absolute\n tempX = current[3];\n tempY = current[4];\n context.quadraticCurveTo(current[1] + l, current[2] + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n controlX = current[1];\n controlY = current[2];\n break;\n case 't':\n // shorthand quadraticCurveTo, relative\n\n // transform to absolute x,y\n tempX = x + current[1];\n tempY = y + current[2];\n if (previous[0].match(/[QqTt]/) === null) {\n // If there is no previous command or if the previous command was not a Q, q, T or t,\n // assume the control point is coincident with the current point\n controlX = x;\n controlY = y;\n } else if (previous[0] === 't') {\n // calculate reflection of previous control points for t\n controlX = 2 * x - tempControlX;\n controlY = 2 * y - tempControlY;\n } else if (previous[0] === 'q') {\n // calculate reflection of previous control points for q\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n }\n tempControlX = controlX;\n tempControlY = controlY;\n context.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n controlX = x + current[1];\n controlY = y + current[2];\n break;\n case 'T':\n tempX = current[1];\n tempY = current[2];\n\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n context.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n case 'a':\n drawArc(context, x + l, y + t, [current[1], current[2], current[3], current[4], current[5], current[6] + x + l, current[7] + y + t]);\n x += current[6];\n y += current[7];\n break;\n case 'A':\n drawArc(context, x + l, y + t, [current[1], current[2], current[3], current[4], current[5], current[6] + l, current[7] + t]);\n x = current[6];\n y = current[7];\n break;\n case 'z':\n case 'Z':\n x = anchorX;\n y = anchorY;\n context.closePath();\n break;\n }\n previous = current;\n }\n}\nfunction drawArc(context, x, y, coords) {\n const seg = segments(coords[5],\n // end x\n coords[6],\n // end y\n coords[0],\n // radius x\n coords[1],\n // radius y\n coords[3],\n // large flag\n coords[4],\n // sweep flag\n coords[2],\n // rotation\n x, y);\n for (let i = 0; i < seg.length; ++i) {\n const bez = bezier(seg[i]);\n context.bezierCurveTo(bez[0], bez[1], bez[2], bez[3], bez[4], bez[5]);\n }\n}\n\nconst Tan30 = 0.5773502691896257;\nconst builtins = {\n 'circle': {\n draw: function (context, size) {\n const r = Math.sqrt(size) / 2;\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, Tau);\n }\n },\n 'cross': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n s = r / 2.5;\n context.moveTo(-r, -s);\n context.lineTo(-r, s);\n context.lineTo(-s, s);\n context.lineTo(-s, r);\n context.lineTo(s, r);\n context.lineTo(s, s);\n context.lineTo(r, s);\n context.lineTo(r, -s);\n context.lineTo(s, -s);\n context.lineTo(s, -r);\n context.lineTo(-s, -r);\n context.lineTo(-s, -s);\n context.closePath();\n }\n },\n 'diamond': {\n draw: function (context, size) {\n const r = Math.sqrt(size) / 2;\n context.moveTo(-r, 0);\n context.lineTo(0, -r);\n context.lineTo(r, 0);\n context.lineTo(0, r);\n context.closePath();\n }\n },\n 'square': {\n draw: function (context, size) {\n var w = Math.sqrt(size),\n x = -w / 2;\n context.rect(x, x, w, w);\n }\n },\n 'arrow': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n s = r / 7,\n t = r / 2.5,\n v = r / 8;\n context.moveTo(-s, r);\n context.lineTo(s, r);\n context.lineTo(s, -v);\n context.lineTo(t, -v);\n context.lineTo(0, -r);\n context.lineTo(-t, -v);\n context.lineTo(-s, -v);\n context.closePath();\n }\n },\n 'wedge': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r,\n o = h - r * Tan30,\n b = r / 4;\n context.moveTo(0, -h - o);\n context.lineTo(-b, h - o);\n context.lineTo(b, h - o);\n context.closePath();\n }\n },\n 'triangle': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r,\n o = h - r * Tan30;\n context.moveTo(0, -h - o);\n context.lineTo(-r, h - o);\n context.lineTo(r, h - o);\n context.closePath();\n }\n },\n 'triangle-up': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(0, -h);\n context.lineTo(-r, h);\n context.lineTo(r, h);\n context.closePath();\n }\n },\n 'triangle-down': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(0, h);\n context.lineTo(-r, -h);\n context.lineTo(r, -h);\n context.closePath();\n }\n },\n 'triangle-right': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(h, 0);\n context.lineTo(-h, -r);\n context.lineTo(-h, r);\n context.closePath();\n }\n },\n 'triangle-left': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(-h, 0);\n context.lineTo(h, -r);\n context.lineTo(h, r);\n context.closePath();\n }\n },\n 'stroke': {\n draw: function (context, size) {\n const r = Math.sqrt(size) / 2;\n context.moveTo(-r, 0);\n context.lineTo(r, 0);\n }\n }\n};\nfunction symbols(_) {\n return hasOwnProperty(builtins, _) ? builtins[_] : customSymbol(_);\n}\nvar custom = {};\nfunction customSymbol(path) {\n if (!hasOwnProperty(custom, path)) {\n const parsed = parse(path);\n custom[path] = {\n draw: function (context, size) {\n pathRender(context, parsed, 0, 0, Math.sqrt(size) / 2);\n }\n };\n }\n return custom[path];\n}\n\n// See http://spencermortensen.com/articles/bezier-circle/\nconst C = 0.448084975506; // C = 1 - c\n\nfunction rectangleX(d) {\n return d.x;\n}\nfunction rectangleY(d) {\n return d.y;\n}\nfunction rectangleWidth(d) {\n return d.width;\n}\nfunction rectangleHeight(d) {\n return d.height;\n}\nfunction number(_) {\n return typeof _ === 'function' ? _ : () => +_;\n}\nfunction clamp(value, min, max) {\n return Math.max(min, Math.min(value, max));\n}\nfunction vg_rect () {\n var x = rectangleX,\n y = rectangleY,\n width = rectangleWidth,\n height = rectangleHeight,\n crTL = number(0),\n crTR = crTL,\n crBL = crTL,\n crBR = crTL,\n context = null;\n function rectangle(_, x0, y0) {\n var buffer,\n x1 = x0 != null ? x0 : +x.call(this, _),\n y1 = y0 != null ? y0 : +y.call(this, _),\n w = +width.call(this, _),\n h = +height.call(this, _),\n s = Math.min(w, h) / 2,\n tl = clamp(+crTL.call(this, _), 0, s),\n tr = clamp(+crTR.call(this, _), 0, s),\n bl = clamp(+crBL.call(this, _), 0, s),\n br = clamp(+crBR.call(this, _), 0, s);\n if (!context) context = buffer = path$3();\n if (tl <= 0 && tr <= 0 && bl <= 0 && br <= 0) {\n context.rect(x1, y1, w, h);\n } else {\n var x2 = x1 + w,\n y2 = y1 + h;\n context.moveTo(x1 + tl, y1);\n context.lineTo(x2 - tr, y1);\n context.bezierCurveTo(x2 - C * tr, y1, x2, y1 + C * tr, x2, y1 + tr);\n context.lineTo(x2, y2 - br);\n context.bezierCurveTo(x2, y2 - C * br, x2 - C * br, y2, x2 - br, y2);\n context.lineTo(x1 + bl, y2);\n context.bezierCurveTo(x1 + C * bl, y2, x1, y2 - C * bl, x1, y2 - bl);\n context.lineTo(x1, y1 + tl);\n context.bezierCurveTo(x1, y1 + C * tl, x1 + C * tl, y1, x1 + tl, y1);\n context.closePath();\n }\n if (buffer) {\n context = null;\n return buffer + '' || null;\n }\n }\n rectangle.x = function (_) {\n if (arguments.length) {\n x = number(_);\n return rectangle;\n } else {\n return x;\n }\n };\n rectangle.y = function (_) {\n if (arguments.length) {\n y = number(_);\n return rectangle;\n } else {\n return y;\n }\n };\n rectangle.width = function (_) {\n if (arguments.length) {\n width = number(_);\n return rectangle;\n } else {\n return width;\n }\n };\n rectangle.height = function (_) {\n if (arguments.length) {\n height = number(_);\n return rectangle;\n } else {\n return height;\n }\n };\n rectangle.cornerRadius = function (tl, tr, br, bl) {\n if (arguments.length) {\n crTL = number(tl);\n crTR = tr != null ? number(tr) : crTL;\n crBR = br != null ? number(br) : crTL;\n crBL = bl != null ? number(bl) : crTR;\n return rectangle;\n } else {\n return crTL;\n }\n };\n rectangle.context = function (_) {\n if (arguments.length) {\n context = _ == null ? null : _;\n return rectangle;\n } else {\n return context;\n }\n };\n return rectangle;\n}\n\nfunction vg_trail () {\n var x,\n y,\n size,\n defined,\n context = null,\n ready,\n x1,\n y1,\n r1;\n function point(x2, y2, w2) {\n const r2 = w2 / 2;\n if (ready) {\n var ux = y1 - y2,\n uy = x2 - x1;\n if (ux || uy) {\n // get normal vector\n var ud = Math.hypot(ux, uy),\n rx = (ux /= ud) * r1,\n ry = (uy /= ud) * r1,\n t = Math.atan2(uy, ux);\n\n // draw segment\n context.moveTo(x1 - rx, y1 - ry);\n context.lineTo(x2 - ux * r2, y2 - uy * r2);\n context.arc(x2, y2, r2, t - Math.PI, t);\n context.lineTo(x1 + rx, y1 + ry);\n context.arc(x1, y1, r1, t, t + Math.PI);\n } else {\n context.arc(x2, y2, r2, 0, Tau);\n }\n context.closePath();\n } else {\n ready = 1;\n }\n x1 = x2;\n y1 = y2;\n r1 = r2;\n }\n function trail(data) {\n var i,\n n = data.length,\n d,\n defined0 = false,\n buffer;\n if (context == null) context = buffer = path$3();\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) ready = 0;\n }\n if (defined0) point(+x(d, i, data), +y(d, i, data), +size(d, i, data));\n }\n if (buffer) {\n context = null;\n return buffer + '' || null;\n }\n }\n trail.x = function (_) {\n if (arguments.length) {\n x = _;\n return trail;\n } else {\n return x;\n }\n };\n trail.y = function (_) {\n if (arguments.length) {\n y = _;\n return trail;\n } else {\n return y;\n }\n };\n trail.size = function (_) {\n if (arguments.length) {\n size = _;\n return trail;\n } else {\n return size;\n }\n };\n trail.defined = function (_) {\n if (arguments.length) {\n defined = _;\n return trail;\n } else {\n return defined;\n }\n };\n trail.context = function (_) {\n if (arguments.length) {\n if (_ == null) {\n context = null;\n } else {\n context = _;\n }\n return trail;\n } else {\n return context;\n }\n };\n return trail;\n}\n\nfunction value$1(a, b) {\n return a != null ? a : b;\n}\nconst x = item => item.x || 0,\n y = item => item.y || 0,\n w = item => item.width || 0,\n h = item => item.height || 0,\n xw = item => (item.x || 0) + (item.width || 0),\n yh = item => (item.y || 0) + (item.height || 0),\n sa = item => item.startAngle || 0,\n ea = item => item.endAngle || 0,\n pa = item => item.padAngle || 0,\n ir = item => item.innerRadius || 0,\n or = item => item.outerRadius || 0,\n cr = item => item.cornerRadius || 0,\n tl = item => value$1(item.cornerRadiusTopLeft, item.cornerRadius) || 0,\n tr = item => value$1(item.cornerRadiusTopRight, item.cornerRadius) || 0,\n br = item => value$1(item.cornerRadiusBottomRight, item.cornerRadius) || 0,\n bl = item => value$1(item.cornerRadiusBottomLeft, item.cornerRadius) || 0,\n sz = item => value$1(item.size, 64),\n ts = item => item.size || 1,\n def = item => !(item.defined === false),\n type = item => symbols(item.shape || 'circle');\nconst arcShape = arc$2().startAngle(sa).endAngle(ea).padAngle(pa).innerRadius(ir).outerRadius(or).cornerRadius(cr),\n areavShape = area$2().x(x).y1(y).y0(yh).defined(def),\n areahShape = area$2().y(y).x1(x).x0(xw).defined(def),\n lineShape = line$2().x(x).y(y).defined(def),\n rectShape = vg_rect().x(x).y(y).width(w).height(h).cornerRadius(tl, tr, br, bl),\n symbolShape = symbol$2().type(type).size(sz),\n trailShape = vg_trail().x(x).y(y).defined(def).size(ts);\nfunction hasCornerRadius(item) {\n return item.cornerRadius || item.cornerRadiusTopLeft || item.cornerRadiusTopRight || item.cornerRadiusBottomRight || item.cornerRadiusBottomLeft;\n}\nfunction arc$1(context, item) {\n return arcShape.context(context)(item);\n}\nfunction area$1(context, items) {\n const item = items[0],\n interp = item.interpolate || 'linear';\n return (item.orient === 'horizontal' ? areahShape : areavShape).curve(curves(interp, item.orient, item.tension)).context(context)(items);\n}\nfunction line$1(context, items) {\n const item = items[0],\n interp = item.interpolate || 'linear';\n return lineShape.curve(curves(interp, item.orient, item.tension)).context(context)(items);\n}\nfunction rectangle(context, item, x, y) {\n return rectShape.context(context)(item, x, y);\n}\nfunction shape$1(context, item) {\n return (item.mark.shape || item.shape).context(context)(item);\n}\nfunction symbol$1(context, item) {\n return symbolShape.context(context)(item);\n}\nfunction trail$1(context, items) {\n return trailShape.context(context)(items);\n}\n\nvar clip_id = 1;\nfunction resetSVGClipId() {\n clip_id = 1;\n}\nfunction clip$1 (renderer, item, size) {\n var clip = item.clip,\n defs = renderer._defs,\n id = item.clip_id || (item.clip_id = 'clip' + clip_id++),\n c = defs.clipping[id] || (defs.clipping[id] = {\n id: id\n });\n if (isFunction(clip)) {\n c.path = clip(null);\n } else if (hasCornerRadius(size)) {\n c.path = rectangle(null, size, 0, 0);\n } else {\n c.width = size.width || 0;\n c.height = size.height || 0;\n }\n return 'url(#' + id + ')';\n}\n\nfunction Bounds(b) {\n this.clear();\n if (b) this.union(b);\n}\nBounds.prototype = {\n clone() {\n return new Bounds(this);\n },\n clear() {\n this.x1 = +Number.MAX_VALUE;\n this.y1 = +Number.MAX_VALUE;\n this.x2 = -Number.MAX_VALUE;\n this.y2 = -Number.MAX_VALUE;\n return this;\n },\n empty() {\n return this.x1 === +Number.MAX_VALUE && this.y1 === +Number.MAX_VALUE && this.x2 === -Number.MAX_VALUE && this.y2 === -Number.MAX_VALUE;\n },\n equals(b) {\n return this.x1 === b.x1 && this.y1 === b.y1 && this.x2 === b.x2 && this.y2 === b.y2;\n },\n set(x1, y1, x2, y2) {\n if (x2 < x1) {\n this.x2 = x1;\n this.x1 = x2;\n } else {\n this.x1 = x1;\n this.x2 = x2;\n }\n if (y2 < y1) {\n this.y2 = y1;\n this.y1 = y2;\n } else {\n this.y1 = y1;\n this.y2 = y2;\n }\n return this;\n },\n add(x, y) {\n if (x < this.x1) this.x1 = x;\n if (y < this.y1) this.y1 = y;\n if (x > this.x2) this.x2 = x;\n if (y > this.y2) this.y2 = y;\n return this;\n },\n expand(d) {\n this.x1 -= d;\n this.y1 -= d;\n this.x2 += d;\n this.y2 += d;\n return this;\n },\n round() {\n this.x1 = Math.floor(this.x1);\n this.y1 = Math.floor(this.y1);\n this.x2 = Math.ceil(this.x2);\n this.y2 = Math.ceil(this.y2);\n return this;\n },\n scale(s) {\n this.x1 *= s;\n this.y1 *= s;\n this.x2 *= s;\n this.y2 *= s;\n return this;\n },\n translate(dx, dy) {\n this.x1 += dx;\n this.x2 += dx;\n this.y1 += dy;\n this.y2 += dy;\n return this;\n },\n rotate(angle, x, y) {\n const p = this.rotatedPoints(angle, x, y);\n return this.clear().add(p[0], p[1]).add(p[2], p[3]).add(p[4], p[5]).add(p[6], p[7]);\n },\n rotatedPoints(angle, x, y) {\n var {\n x1,\n y1,\n x2,\n y2\n } = this,\n cos = Math.cos(angle),\n sin = Math.sin(angle),\n cx = x - x * cos + y * sin,\n cy = y - x * sin - y * cos;\n return [cos * x1 - sin * y1 + cx, sin * x1 + cos * y1 + cy, cos * x1 - sin * y2 + cx, sin * x1 + cos * y2 + cy, cos * x2 - sin * y1 + cx, sin * x2 + cos * y1 + cy, cos * x2 - sin * y2 + cx, sin * x2 + cos * y2 + cy];\n },\n union(b) {\n if (b.x1 < this.x1) this.x1 = b.x1;\n if (b.y1 < this.y1) this.y1 = b.y1;\n if (b.x2 > this.x2) this.x2 = b.x2;\n if (b.y2 > this.y2) this.y2 = b.y2;\n return this;\n },\n intersect(b) {\n if (b.x1 > this.x1) this.x1 = b.x1;\n if (b.y1 > this.y1) this.y1 = b.y1;\n if (b.x2 < this.x2) this.x2 = b.x2;\n if (b.y2 < this.y2) this.y2 = b.y2;\n return this;\n },\n encloses(b) {\n return b && this.x1 <= b.x1 && this.x2 >= b.x2 && this.y1 <= b.y1 && this.y2 >= b.y2;\n },\n alignsWith(b) {\n return b && (this.x1 == b.x1 || this.x2 == b.x2 || this.y1 == b.y1 || this.y2 == b.y2);\n },\n intersects(b) {\n return b && !(this.x2 < b.x1 || this.x1 > b.x2 || this.y2 < b.y1 || this.y1 > b.y2);\n },\n contains(x, y) {\n return !(x < this.x1 || x > this.x2 || y < this.y1 || y > this.y2);\n },\n width() {\n return this.x2 - this.x1;\n },\n height() {\n return this.y2 - this.y1;\n }\n};\n\nfunction Item(mark) {\n this.mark = mark;\n this.bounds = this.bounds || new Bounds();\n}\n\nfunction GroupItem(mark) {\n Item.call(this, mark);\n this.items = this.items || [];\n}\ninherits(GroupItem, Item);\n\nclass ResourceLoader {\n constructor(customLoader) {\n this._pending = 0;\n this._loader = customLoader || loader();\n }\n pending() {\n return this._pending;\n }\n sanitizeURL(uri) {\n const loader = this;\n increment(loader);\n return loader._loader.sanitize(uri, {\n context: 'href'\n }).then(opt => {\n decrement(loader);\n return opt;\n }).catch(() => {\n decrement(loader);\n return null;\n });\n }\n loadImage(uri) {\n const loader = this,\n Image = image$1();\n increment(loader);\n return loader._loader.sanitize(uri, {\n context: 'image'\n }).then(opt => {\n const url = opt.href;\n if (!url || !Image) throw {\n url: url\n };\n const img = new Image();\n\n // set crossOrigin only if cors is defined; empty string sets anonymous mode\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/crossOrigin\n const cors = hasOwnProperty(opt, 'crossOrigin') ? opt.crossOrigin : 'anonymous';\n if (cors != null) img.crossOrigin = cors;\n\n // attempt to load image resource\n img.onload = () => decrement(loader);\n img.onerror = () => decrement(loader);\n img.src = url;\n return img;\n }).catch(e => {\n decrement(loader);\n return {\n complete: false,\n width: 0,\n height: 0,\n src: e && e.url || ''\n };\n });\n }\n ready() {\n const loader = this;\n return new Promise(accept => {\n function poll(value) {\n if (!loader.pending()) accept(value);else setTimeout(() => {\n poll(true);\n }, 10);\n }\n poll(false);\n });\n }\n}\nfunction increment(loader) {\n loader._pending += 1;\n}\nfunction decrement(loader) {\n loader._pending -= 1;\n}\n\nfunction boundStroke (bounds, item, miter) {\n if (item.stroke && item.opacity !== 0 && item.strokeOpacity !== 0) {\n const sw = item.strokeWidth != null ? +item.strokeWidth : 1;\n bounds.expand(sw + (miter ? miterAdjustment(item, sw) : 0));\n }\n return bounds;\n}\nfunction miterAdjustment(item, strokeWidth) {\n // TODO: more sophisticated adjustment? Or miter support in boundContext?\n return item.strokeJoin && item.strokeJoin !== 'miter' ? 0 : strokeWidth;\n}\n\nconst circleThreshold = Tau - 1e-8;\nlet bounds, lx, ly, rot, ma, mb, mc, md;\nconst add = (x, y) => bounds.add(x, y);\nconst addL = (x, y) => add(lx = x, ly = y);\nconst addX = x => add(x, bounds.y1);\nconst addY = y => add(bounds.x1, y);\nconst px = (x, y) => ma * x + mc * y;\nconst py = (x, y) => mb * x + md * y;\nconst addp = (x, y) => add(px(x, y), py(x, y));\nconst addpL = (x, y) => addL(px(x, y), py(x, y));\nfunction boundContext (_, deg) {\n bounds = _;\n if (deg) {\n rot = deg * DegToRad;\n ma = md = Math.cos(rot);\n mb = Math.sin(rot);\n mc = -mb;\n } else {\n ma = md = 1;\n rot = mb = mc = 0;\n }\n return context$1;\n}\nconst context$1 = {\n beginPath() {},\n closePath() {},\n moveTo: addpL,\n lineTo: addpL,\n rect(x, y, w, h) {\n if (rot) {\n addp(x + w, y);\n addp(x + w, y + h);\n addp(x, y + h);\n addpL(x, y);\n } else {\n add(x + w, y + h);\n addL(x, y);\n }\n },\n quadraticCurveTo(x1, y1, x2, y2) {\n const px1 = px(x1, y1),\n py1 = py(x1, y1),\n px2 = px(x2, y2),\n py2 = py(x2, y2);\n quadExtrema(lx, px1, px2, addX);\n quadExtrema(ly, py1, py2, addY);\n addL(px2, py2);\n },\n bezierCurveTo(x1, y1, x2, y2, x3, y3) {\n const px1 = px(x1, y1),\n py1 = py(x1, y1),\n px2 = px(x2, y2),\n py2 = py(x2, y2),\n px3 = px(x3, y3),\n py3 = py(x3, y3);\n cubicExtrema(lx, px1, px2, px3, addX);\n cubicExtrema(ly, py1, py2, py3, addY);\n addL(px3, py3);\n },\n arc(cx, cy, r, sa, ea, ccw) {\n sa += rot;\n ea += rot;\n\n // store last point on path\n lx = r * Math.cos(ea) + cx;\n ly = r * Math.sin(ea) + cy;\n if (Math.abs(ea - sa) > circleThreshold) {\n // treat as full circle\n add(cx - r, cy - r);\n add(cx + r, cy + r);\n } else {\n const update = a => add(r * Math.cos(a) + cx, r * Math.sin(a) + cy);\n let s, i;\n\n // sample end points\n update(sa);\n update(ea);\n\n // sample interior points aligned with 90 degrees\n if (ea !== sa) {\n sa = sa % Tau;\n if (sa < 0) sa += Tau;\n ea = ea % Tau;\n if (ea < 0) ea += Tau;\n if (ea < sa) {\n ccw = !ccw; // flip direction\n s = sa;\n sa = ea;\n ea = s; // swap end-points\n }\n if (ccw) {\n ea -= Tau;\n s = sa - sa % HalfPi;\n for (i = 0; i < 4 && s > ea; ++i, s -= HalfPi) update(s);\n } else {\n s = sa - sa % HalfPi + HalfPi;\n for (i = 0; i < 4 && s < ea; ++i, s = s + HalfPi) update(s);\n }\n }\n }\n }\n};\nfunction quadExtrema(x0, x1, x2, cb) {\n const t = (x0 - x1) / (x0 + x2 - 2 * x1);\n if (0 < t && t < 1) cb(x0 + (x1 - x0) * t);\n}\nfunction cubicExtrema(x0, x1, x2, x3, cb) {\n const a = x3 - x0 + 3 * x1 - 3 * x2,\n b = x0 + x2 - 2 * x1,\n c = x0 - x1;\n let t0 = 0,\n t1 = 0,\n r;\n\n // solve for parameter t\n if (Math.abs(a) > Epsilon) {\n // quadratic equation\n r = b * b + c * a;\n if (r >= 0) {\n r = Math.sqrt(r);\n t0 = (-b + r) / a;\n t1 = (-b - r) / a;\n }\n } else {\n // linear equation\n t0 = 0.5 * c / b;\n }\n\n // calculate position\n if (0 < t0 && t0 < 1) cb(cubic(t0, x0, x1, x2, x3));\n if (0 < t1 && t1 < 1) cb(cubic(t1, x0, x1, x2, x3));\n}\nfunction cubic(t, x0, x1, x2, x3) {\n const s = 1 - t,\n s2 = s * s,\n t2 = t * t;\n return s2 * s * x0 + 3 * s2 * t * x1 + 3 * s * t2 * x2 + t2 * t * x3;\n}\n\nvar context = (context = canvas(1, 1)) ? context.getContext('2d') : null;\n\nconst b = new Bounds();\nfunction intersectPath(draw) {\n return function (item, brush) {\n // rely on (inaccurate) bounds intersection if no context\n if (!context) return true;\n\n // add path to offscreen graphics context\n draw(context, item);\n\n // get bounds intersection region\n b.clear().union(item.bounds).intersect(brush).round();\n const {\n x1,\n y1,\n x2,\n y2\n } = b;\n\n // iterate over intersection region\n // perform fine grained inclusion test\n for (let y = y1; y <= y2; ++y) {\n for (let x = x1; x <= x2; ++x) {\n if (context.isPointInPath(x, y)) {\n return true;\n }\n }\n }\n\n // false if no hits in intersection region\n return false;\n };\n}\nfunction intersectPoint(item, box) {\n return box.contains(item.x || 0, item.y || 0);\n}\nfunction intersectRect(item, box) {\n const x = item.x || 0,\n y = item.y || 0,\n w = item.width || 0,\n h = item.height || 0;\n return box.intersects(b.set(x, y, x + w, y + h));\n}\nfunction intersectRule(item, box) {\n const x = item.x || 0,\n y = item.y || 0,\n x2 = item.x2 != null ? item.x2 : x,\n y2 = item.y2 != null ? item.y2 : y;\n return intersectBoxLine(box, x, y, x2, y2);\n}\nfunction intersectBoxLine(box, x, y, u, v) {\n const {\n x1,\n y1,\n x2,\n y2\n } = box,\n dx = u - x,\n dy = v - y;\n let t0 = 0,\n t1 = 1,\n p,\n q,\n r,\n e;\n for (e = 0; e < 4; ++e) {\n if (e === 0) {\n p = -dx;\n q = -(x1 - x);\n }\n if (e === 1) {\n p = dx;\n q = x2 - x;\n }\n if (e === 2) {\n p = -dy;\n q = -(y1 - y);\n }\n if (e === 3) {\n p = dy;\n q = y2 - y;\n }\n if (Math.abs(p) < 1e-10 && q < 0) return false;\n r = q / p;\n if (p < 0) {\n if (r > t1) return false;else if (r > t0) t0 = r;\n } else if (p > 0) {\n if (r < t0) return false;else if (r < t1) t1 = r;\n }\n }\n return true;\n}\n\nfunction blend (context, item) {\n context.globalCompositeOperation = item.blend || 'source-over';\n}\n\nfunction value (value, dflt) {\n return value == null ? dflt : value;\n}\n\nfunction addStops(gradient, stops) {\n const n = stops.length;\n for (let i = 0; i < n; ++i) {\n gradient.addColorStop(stops[i].offset, stops[i].color);\n }\n return gradient;\n}\nfunction gradient (context, spec, bounds) {\n const w = bounds.width(),\n h = bounds.height();\n let gradient;\n if (spec.gradient === 'radial') {\n gradient = context.createRadialGradient(bounds.x1 + value(spec.x1, 0.5) * w, bounds.y1 + value(spec.y1, 0.5) * h, Math.max(w, h) * value(spec.r1, 0), bounds.x1 + value(spec.x2, 0.5) * w, bounds.y1 + value(spec.y2, 0.5) * h, Math.max(w, h) * value(spec.r2, 0.5));\n } else {\n // linear gradient\n const x1 = value(spec.x1, 0),\n y1 = value(spec.y1, 0),\n x2 = value(spec.x2, 1),\n y2 = value(spec.y2, 0);\n if (x1 === x2 || y1 === y2 || w === h) {\n // axis aligned: use normal gradient\n gradient = context.createLinearGradient(bounds.x1 + x1 * w, bounds.y1 + y1 * h, bounds.x1 + x2 * w, bounds.y1 + y2 * h);\n } else {\n // not axis aligned: render gradient into a pattern (#2365)\n // this allows us to use normalized bounding box coordinates\n const image = canvas(Math.ceil(w), Math.ceil(h)),\n ictx = image.getContext('2d');\n ictx.scale(w, h);\n ictx.fillStyle = addStops(ictx.createLinearGradient(x1, y1, x2, y2), spec.stops);\n ictx.fillRect(0, 0, w, h);\n return context.createPattern(image, 'no-repeat');\n }\n }\n return addStops(gradient, spec.stops);\n}\n\nfunction color (context, item, value) {\n return isGradient(value) ? gradient(context, value, item.bounds) : value;\n}\n\nfunction fill (context, item, opacity) {\n opacity *= item.fillOpacity == null ? 1 : item.fillOpacity;\n if (opacity > 0) {\n context.globalAlpha = opacity;\n context.fillStyle = color(context, item, item.fill);\n return true;\n } else {\n return false;\n }\n}\n\nvar Empty = [];\nfunction stroke (context, item, opacity) {\n var lw = (lw = item.strokeWidth) != null ? lw : 1;\n if (lw <= 0) return false;\n opacity *= item.strokeOpacity == null ? 1 : item.strokeOpacity;\n if (opacity > 0) {\n context.globalAlpha = opacity;\n context.strokeStyle = color(context, item, item.stroke);\n context.lineWidth = lw;\n context.lineCap = item.strokeCap || 'butt';\n context.lineJoin = item.strokeJoin || 'miter';\n context.miterLimit = item.strokeMiterLimit || 10;\n if (context.setLineDash) {\n context.setLineDash(item.strokeDash || Empty);\n context.lineDashOffset = item.strokeDashOffset || 0;\n }\n return true;\n } else {\n return false;\n }\n}\n\nfunction compare(a, b) {\n return a.zindex - b.zindex || a.index - b.index;\n}\nfunction zorder(scene) {\n if (!scene.zdirty) return scene.zitems;\n var items = scene.items,\n output = [],\n item,\n i,\n n;\n for (i = 0, n = items.length; i < n; ++i) {\n item = items[i];\n item.index = i;\n if (item.zindex) output.push(item);\n }\n scene.zdirty = false;\n return scene.zitems = output.sort(compare);\n}\nfunction visit(scene, visitor) {\n var items = scene.items,\n i,\n n;\n if (!items || !items.length) return;\n const zitems = zorder(scene);\n if (zitems && zitems.length) {\n for (i = 0, n = items.length; i < n; ++i) {\n if (!items[i].zindex) visitor(items[i]);\n }\n items = zitems;\n }\n for (i = 0, n = items.length; i < n; ++i) {\n visitor(items[i]);\n }\n}\nfunction pickVisit(scene, visitor) {\n var items = scene.items,\n hit,\n i;\n if (!items || !items.length) return null;\n const zitems = zorder(scene);\n if (zitems && zitems.length) items = zitems;\n for (i = items.length; --i >= 0;) {\n if (hit = visitor(items[i])) return hit;\n }\n if (items === zitems) {\n for (items = scene.items, i = items.length; --i >= 0;) {\n if (!items[i].zindex) {\n if (hit = visitor(items[i])) return hit;\n }\n }\n }\n return null;\n}\n\nfunction drawAll(path) {\n return function (context, scene, bounds) {\n visit(scene, item => {\n if (!bounds || bounds.intersects(item.bounds)) {\n drawPath(path, context, item, item);\n }\n });\n };\n}\nfunction drawOne(path) {\n return function (context, scene, bounds) {\n if (scene.items.length && (!bounds || bounds.intersects(scene.bounds))) {\n drawPath(path, context, scene.items[0], scene.items);\n }\n };\n}\nfunction drawPath(path, context, item, items) {\n var opacity = item.opacity == null ? 1 : item.opacity;\n if (opacity === 0) return;\n if (path(context, items)) return;\n blend(context, item);\n if (item.fill && fill(context, item, opacity)) {\n context.fill();\n }\n if (item.stroke && stroke(context, item, opacity)) {\n context.stroke();\n }\n}\n\nfunction pick$1(test) {\n test = test || truthy;\n return function (context, scene, x, y, gx, gy) {\n x *= context.pixelRatio;\n y *= context.pixelRatio;\n return pickVisit(scene, item => {\n const b = item.bounds;\n // first hit test against bounding box\n if (b && !b.contains(gx, gy) || !b) return;\n // if in bounding box, perform more careful test\n if (test(context, item, x, y, gx, gy)) return item;\n });\n };\n}\nfunction hitPath(path, filled) {\n return function (context, o, x, y) {\n var item = Array.isArray(o) ? o[0] : o,\n fill = filled == null ? item.fill : filled,\n stroke = item.stroke && context.isPointInStroke,\n lw,\n lc;\n if (stroke) {\n lw = item.strokeWidth;\n lc = item.strokeCap;\n context.lineWidth = lw != null ? lw : 1;\n context.lineCap = lc != null ? lc : 'butt';\n }\n return path(context, o) ? false : fill && context.isPointInPath(x, y) || stroke && context.isPointInStroke(x, y);\n };\n}\nfunction pickPath(path) {\n return pick$1(hitPath(path));\n}\n\nfunction translate(x, y) {\n return 'translate(' + x + ',' + y + ')';\n}\nfunction rotate(a) {\n return 'rotate(' + a + ')';\n}\nfunction scale(scaleX, scaleY) {\n return 'scale(' + scaleX + ',' + scaleY + ')';\n}\nfunction translateItem(item) {\n return translate(item.x || 0, item.y || 0);\n}\nfunction rotateItem(item) {\n return translate(item.x || 0, item.y || 0) + (item.angle ? ' ' + rotate(item.angle) : '');\n}\nfunction transformItem(item) {\n return translate(item.x || 0, item.y || 0) + (item.angle ? ' ' + rotate(item.angle) : '') + (item.scaleX || item.scaleY ? ' ' + scale(item.scaleX || 1, item.scaleY || 1) : '');\n}\n\nfunction markItemPath (type, shape, isect) {\n function attr(emit, item) {\n emit('transform', rotateItem(item));\n emit('d', shape(null, item));\n }\n function bound(bounds, item) {\n shape(boundContext(bounds, item.angle), item);\n return boundStroke(bounds, item).translate(item.x || 0, item.y || 0);\n }\n function draw(context, item) {\n var x = item.x || 0,\n y = item.y || 0,\n a = item.angle || 0;\n context.translate(x, y);\n if (a) context.rotate(a *= DegToRad);\n context.beginPath();\n shape(context, item);\n if (a) context.rotate(-a);\n context.translate(-x, -y);\n }\n return {\n type: type,\n tag: 'path',\n nested: false,\n attr: attr,\n bound: bound,\n draw: drawAll(draw),\n pick: pickPath(draw),\n isect: isect || intersectPath(draw)\n };\n}\n\nvar arc = markItemPath('arc', arc$1);\n\nfunction pickArea(a, p) {\n var v = a[0].orient === 'horizontal' ? p[1] : p[0],\n z = a[0].orient === 'horizontal' ? 'y' : 'x',\n i = a.length,\n min = +Infinity,\n hit,\n d;\n while (--i >= 0) {\n if (a[i].defined === false) continue;\n d = Math.abs(a[i][z] - v);\n if (d < min) {\n min = d;\n hit = a[i];\n }\n }\n return hit;\n}\nfunction pickLine(a, p) {\n var t = Math.pow(a[0].strokeWidth || 1, 2),\n i = a.length,\n dx,\n dy,\n dd;\n while (--i >= 0) {\n if (a[i].defined === false) continue;\n dx = a[i].x - p[0];\n dy = a[i].y - p[1];\n dd = dx * dx + dy * dy;\n if (dd < t) return a[i];\n }\n return null;\n}\nfunction pickTrail(a, p) {\n var i = a.length,\n dx,\n dy,\n dd;\n while (--i >= 0) {\n if (a[i].defined === false) continue;\n dx = a[i].x - p[0];\n dy = a[i].y - p[1];\n dd = dx * dx + dy * dy;\n dx = a[i].size || 1;\n if (dd < dx * dx) return a[i];\n }\n return null;\n}\n\nfunction markMultiItemPath (type, shape, tip) {\n function attr(emit, item) {\n var items = item.mark.items;\n if (items.length) emit('d', shape(null, items));\n }\n function bound(bounds, mark) {\n var items = mark.items;\n if (items.length === 0) {\n return bounds;\n } else {\n shape(boundContext(bounds), items);\n return boundStroke(bounds, items[0]);\n }\n }\n function draw(context, items) {\n context.beginPath();\n shape(context, items);\n }\n const hit = hitPath(draw);\n function pick(context, scene, x, y, gx, gy) {\n var items = scene.items,\n b = scene.bounds;\n if (!items || !items.length || b && !b.contains(gx, gy)) {\n return null;\n }\n x *= context.pixelRatio;\n y *= context.pixelRatio;\n return hit(context, items, x, y) ? items[0] : null;\n }\n return {\n type: type,\n tag: 'path',\n nested: true,\n attr: attr,\n bound: bound,\n draw: drawOne(draw),\n pick: pick,\n isect: intersectPoint,\n tip: tip\n };\n}\n\nvar area = markMultiItemPath('area', area$1, pickArea);\n\nfunction clip (context, scene) {\n var clip = scene.clip;\n context.save();\n if (isFunction(clip)) {\n context.beginPath();\n clip(context);\n context.clip();\n } else {\n clipGroup(context, scene.group);\n }\n}\nfunction clipGroup(context, group) {\n context.beginPath();\n hasCornerRadius(group) ? rectangle(context, group, 0, 0) : context.rect(0, 0, group.width || 0, group.height || 0);\n context.clip();\n}\n\nfunction offset$1(item) {\n const sw = value(item.strokeWidth, 1);\n return item.strokeOffset != null ? item.strokeOffset : item.stroke && sw > 0.5 && sw < 1.5 ? 0.5 - Math.abs(sw - 1) : 0;\n}\nfunction attr$5(emit, item) {\n emit('transform', translateItem(item));\n}\nfunction emitRectangle(emit, item) {\n const off = offset$1(item);\n emit('d', rectangle(null, item, off, off));\n}\nfunction background(emit, item) {\n emit('class', 'background');\n emit('aria-hidden', true);\n emitRectangle(emit, item);\n}\nfunction foreground(emit, item) {\n emit('class', 'foreground');\n emit('aria-hidden', true);\n if (item.strokeForeground) {\n emitRectangle(emit, item);\n } else {\n emit('d', '');\n }\n}\nfunction content(emit, item, renderer) {\n const url = item.clip ? clip$1(renderer, item, item) : null;\n emit('clip-path', url);\n}\nfunction bound$5(bounds, group) {\n if (!group.clip && group.items) {\n const items = group.items,\n m = items.length;\n for (let j = 0; j < m; ++j) {\n bounds.union(items[j].bounds);\n }\n }\n if ((group.clip || group.width || group.height) && !group.noBound) {\n bounds.add(0, 0).add(group.width || 0, group.height || 0);\n }\n boundStroke(bounds, group);\n return bounds.translate(group.x || 0, group.y || 0);\n}\nfunction rectanglePath(context, group, x, y) {\n const off = offset$1(group);\n context.beginPath();\n rectangle(context, group, (x || 0) + off, (y || 0) + off);\n}\nconst hitBackground = hitPath(rectanglePath);\nconst hitForeground = hitPath(rectanglePath, false);\nconst hitCorner = hitPath(rectanglePath, true);\nfunction draw$4(context, scene, bounds, markTypes) {\n visit(scene, group => {\n const gx = group.x || 0,\n gy = group.y || 0,\n fore = group.strokeForeground,\n opacity = group.opacity == null ? 1 : group.opacity;\n\n // draw group background\n if ((group.stroke || group.fill) && opacity) {\n rectanglePath(context, group, gx, gy);\n blend(context, group);\n if (group.fill && fill(context, group, opacity)) {\n context.fill();\n }\n if (group.stroke && !fore && stroke(context, group, opacity)) {\n context.stroke();\n }\n }\n\n // setup graphics context, set clip and bounds\n context.save();\n context.translate(gx, gy);\n if (group.clip) clipGroup(context, group);\n if (bounds) bounds.translate(-gx, -gy);\n\n // draw group contents\n visit(group, item => {\n if (item.marktype === 'group' || markTypes == null || markTypes.includes(item.marktype)) {\n this.draw(context, item, bounds, markTypes);\n }\n });\n\n // restore graphics context\n if (bounds) bounds.translate(gx, gy);\n context.restore();\n\n // draw group foreground\n if (fore && group.stroke && opacity) {\n rectanglePath(context, group, gx, gy);\n blend(context, group);\n if (stroke(context, group, opacity)) {\n context.stroke();\n }\n }\n });\n}\nfunction pick(context, scene, x, y, gx, gy) {\n if (scene.bounds && !scene.bounds.contains(gx, gy) || !scene.items) {\n return null;\n }\n const cx = x * context.pixelRatio,\n cy = y * context.pixelRatio;\n return pickVisit(scene, group => {\n let hit, dx, dy;\n\n // first hit test bounding box\n const b = group.bounds;\n if (b && !b.contains(gx, gy)) return;\n\n // passed bounds check, test rectangular clip\n dx = group.x || 0;\n dy = group.y || 0;\n const dw = dx + (group.width || 0),\n dh = dy + (group.height || 0),\n c = group.clip;\n if (c && (gx < dx || gx > dw || gy < dy || gy > dh)) return;\n\n // adjust coordinate system\n context.save();\n context.translate(dx, dy);\n dx = gx - dx;\n dy = gy - dy;\n\n // test background for rounded corner clip\n if (c && hasCornerRadius(group) && !hitCorner(context, group, cx, cy)) {\n context.restore();\n return null;\n }\n const fore = group.strokeForeground,\n ix = scene.interactive !== false;\n\n // hit test against group foreground\n if (ix && fore && group.stroke && hitForeground(context, group, cx, cy)) {\n context.restore();\n return group;\n }\n\n // hit test against contained marks\n hit = pickVisit(group, mark => pickMark(mark, dx, dy) ? this.pick(mark, x, y, dx, dy) : null);\n\n // hit test against group background\n if (!hit && ix && (group.fill || !fore && group.stroke) && hitBackground(context, group, cx, cy)) {\n hit = group;\n }\n\n // restore state and return\n context.restore();\n return hit || null;\n });\n}\nfunction pickMark(mark, x, y) {\n return (mark.interactive !== false || mark.marktype === 'group') && mark.bounds && mark.bounds.contains(x, y);\n}\nvar group = {\n type: 'group',\n tag: 'g',\n nested: false,\n attr: attr$5,\n bound: bound$5,\n draw: draw$4,\n pick: pick,\n isect: intersectRect,\n content: content,\n background: background,\n foreground: foreground\n};\n\nvar metadata = {\n 'xmlns': 'http://www.w3.org/2000/svg',\n 'xmlns:xlink': 'http://www.w3.org/1999/xlink',\n 'version': '1.1'\n};\n\nfunction getImage(item, renderer) {\n var image = item.image;\n if (!image || item.url && item.url !== image.url) {\n image = {\n complete: false,\n width: 0,\n height: 0\n };\n renderer.loadImage(item.url).then(image => {\n item.image = image;\n item.image.url = item.url;\n });\n }\n return image;\n}\nfunction imageWidth(item, image) {\n return item.width != null ? item.width : !image || !image.width ? 0 : item.aspect !== false && item.height ? item.height * image.width / image.height : image.width;\n}\nfunction imageHeight(item, image) {\n return item.height != null ? item.height : !image || !image.height ? 0 : item.aspect !== false && item.width ? item.width * image.height / image.width : image.height;\n}\nfunction imageXOffset(align, w) {\n return align === 'center' ? w / 2 : align === 'right' ? w : 0;\n}\nfunction imageYOffset(baseline, h) {\n return baseline === 'middle' ? h / 2 : baseline === 'bottom' ? h : 0;\n}\nfunction attr$4(emit, item, renderer) {\n const img = getImage(item, renderer),\n w = imageWidth(item, img),\n h = imageHeight(item, img),\n x = (item.x || 0) - imageXOffset(item.align, w),\n y = (item.y || 0) - imageYOffset(item.baseline, h),\n i = !img.src && img.toDataURL ? img.toDataURL() : img.src || '';\n emit('href', i, metadata['xmlns:xlink'], 'xlink:href');\n emit('transform', translate(x, y));\n emit('width', w);\n emit('height', h);\n emit('preserveAspectRatio', item.aspect === false ? 'none' : 'xMidYMid');\n}\nfunction bound$4(bounds, item) {\n const img = item.image,\n w = imageWidth(item, img),\n h = imageHeight(item, img),\n x = (item.x || 0) - imageXOffset(item.align, w),\n y = (item.y || 0) - imageYOffset(item.baseline, h);\n return bounds.set(x, y, x + w, y + h);\n}\nfunction draw$3(context, scene, bounds) {\n visit(scene, item => {\n if (bounds && !bounds.intersects(item.bounds)) return; // bounds check\n\n const img = getImage(item, this);\n let w = imageWidth(item, img);\n let h = imageHeight(item, img);\n if (w === 0 || h === 0) return; // early exit\n\n let x = (item.x || 0) - imageXOffset(item.align, w),\n y = (item.y || 0) - imageYOffset(item.baseline, h),\n opacity,\n ar0,\n ar1,\n t;\n if (item.aspect !== false) {\n ar0 = img.width / img.height;\n ar1 = item.width / item.height;\n if (ar0 === ar0 && ar1 === ar1 && ar0 !== ar1) {\n if (ar1 < ar0) {\n t = w / ar0;\n y += (h - t) / 2;\n h = t;\n } else {\n t = h * ar0;\n x += (w - t) / 2;\n w = t;\n }\n }\n }\n if (img.complete || img.toDataURL) {\n blend(context, item);\n context.globalAlpha = (opacity = item.opacity) != null ? opacity : 1;\n context.imageSmoothingEnabled = item.smooth !== false;\n context.drawImage(img, x, y, w, h);\n }\n });\n}\nvar image = {\n type: 'image',\n tag: 'image',\n nested: false,\n attr: attr$4,\n bound: bound$4,\n draw: draw$3,\n pick: pick$1(),\n isect: truthy,\n // bounds check is sufficient\n get: getImage,\n xOffset: imageXOffset,\n yOffset: imageYOffset\n};\n\nvar line = markMultiItemPath('line', line$1, pickLine);\n\nfunction attr$3(emit, item) {\n var sx = item.scaleX || 1,\n sy = item.scaleY || 1;\n if (sx !== 1 || sy !== 1) {\n emit('vector-effect', 'non-scaling-stroke');\n }\n emit('transform', transformItem(item));\n emit('d', item.path);\n}\nfunction path$1(context, item) {\n var path = item.path;\n if (path == null) return true;\n var x = item.x || 0,\n y = item.y || 0,\n sx = item.scaleX || 1,\n sy = item.scaleY || 1,\n a = (item.angle || 0) * DegToRad,\n cache = item.pathCache;\n if (!cache || cache.path !== path) {\n (item.pathCache = cache = parse(path)).path = path;\n }\n if (a && context.rotate && context.translate) {\n context.translate(x, y);\n context.rotate(a);\n pathRender(context, cache, 0, 0, sx, sy);\n context.rotate(-a);\n context.translate(-x, -y);\n } else {\n pathRender(context, cache, x, y, sx, sy);\n }\n}\nfunction bound$3(bounds, item) {\n return path$1(boundContext(bounds, item.angle), item) ? bounds.set(0, 0, 0, 0) : boundStroke(bounds, item, true);\n}\nvar path$2 = {\n type: 'path',\n tag: 'path',\n nested: false,\n attr: attr$3,\n bound: bound$3,\n draw: drawAll(path$1),\n pick: pickPath(path$1),\n isect: intersectPath(path$1)\n};\n\nfunction attr$2(emit, item) {\n emit('d', rectangle(null, item));\n}\nfunction bound$2(bounds, item) {\n var x, y;\n return boundStroke(bounds.set(x = item.x || 0, y = item.y || 0, x + item.width || 0, y + item.height || 0), item);\n}\nfunction draw$2(context, item) {\n context.beginPath();\n rectangle(context, item);\n}\nvar rect = {\n type: 'rect',\n tag: 'path',\n nested: false,\n attr: attr$2,\n bound: bound$2,\n draw: drawAll(draw$2),\n pick: pickPath(draw$2),\n isect: intersectRect\n};\n\nfunction attr$1(emit, item) {\n emit('transform', translateItem(item));\n emit('x2', item.x2 != null ? item.x2 - (item.x || 0) : 0);\n emit('y2', item.y2 != null ? item.y2 - (item.y || 0) : 0);\n}\nfunction bound$1(bounds, item) {\n var x1, y1;\n return boundStroke(bounds.set(x1 = item.x || 0, y1 = item.y || 0, item.x2 != null ? item.x2 : x1, item.y2 != null ? item.y2 : y1), item);\n}\nfunction path(context, item, opacity) {\n var x1, y1, x2, y2;\n if (item.stroke && stroke(context, item, opacity)) {\n x1 = item.x || 0;\n y1 = item.y || 0;\n x2 = item.x2 != null ? item.x2 : x1;\n y2 = item.y2 != null ? item.y2 : y1;\n context.beginPath();\n context.moveTo(x1, y1);\n context.lineTo(x2, y2);\n return true;\n }\n return false;\n}\nfunction draw$1(context, scene, bounds) {\n visit(scene, item => {\n if (bounds && !bounds.intersects(item.bounds)) return; // bounds check\n var opacity = item.opacity == null ? 1 : item.opacity;\n if (opacity && path(context, item, opacity)) {\n blend(context, item);\n context.stroke();\n }\n });\n}\nfunction hit$1(context, item, x, y) {\n if (!context.isPointInStroke) return false;\n return path(context, item, 1) && context.isPointInStroke(x, y);\n}\nvar rule = {\n type: 'rule',\n tag: 'line',\n nested: false,\n attr: attr$1,\n bound: bound$1,\n draw: draw$1,\n pick: pick$1(hit$1),\n isect: intersectRule\n};\n\nvar shape = markItemPath('shape', shape$1);\n\nvar symbol = markItemPath('symbol', symbol$1, intersectPoint);\n\n// memoize text width measurement\nconst widthCache = lruCache();\nvar textMetrics = {\n height: fontSize,\n measureWidth: measureWidth,\n estimateWidth: estimateWidth,\n width: estimateWidth,\n canvas: useCanvas\n};\nuseCanvas(true);\nfunction useCanvas(use) {\n textMetrics.width = use && context ? measureWidth : estimateWidth;\n}\n\n// make simple estimate if no canvas is available\nfunction estimateWidth(item, text) {\n return _estimateWidth(textValue(item, text), fontSize(item));\n}\nfunction _estimateWidth(text, currentFontHeight) {\n return ~~(0.8 * text.length * currentFontHeight);\n}\n\n// measure text width if canvas is available\nfunction measureWidth(item, text) {\n return fontSize(item) <= 0 || !(text = textValue(item, text)) ? 0 : _measureWidth(text, font(item));\n}\nfunction _measureWidth(text, currentFont) {\n const key = `(${currentFont}) ${text}`;\n let width = widthCache.get(key);\n if (width === undefined) {\n context.font = currentFont;\n width = context.measureText(text).width;\n widthCache.set(key, width);\n }\n return width;\n}\nfunction fontSize(item) {\n return item.fontSize != null ? +item.fontSize || 0 : 11;\n}\nfunction lineHeight(item) {\n return item.lineHeight != null ? item.lineHeight : fontSize(item) + 2;\n}\nfunction lineArray(_) {\n return isArray(_) ? _.length > 1 ? _ : _[0] : _;\n}\nfunction textLines(item) {\n return lineArray(item.lineBreak && item.text && !isArray(item.text) ? item.text.split(item.lineBreak) : item.text);\n}\nfunction multiLineOffset(item) {\n const tl = textLines(item);\n return (isArray(tl) ? tl.length - 1 : 0) * lineHeight(item);\n}\nfunction textValue(item, line) {\n const text = line == null ? '' : (line + '').trim();\n return item.limit > 0 && text.length ? truncate(item, text) : text;\n}\nfunction widthGetter(item) {\n if (textMetrics.width === measureWidth) {\n // we are using canvas\n const currentFont = font(item);\n return text => _measureWidth(text, currentFont);\n } else if (textMetrics.width === estimateWidth) {\n // we are relying on estimates\n const currentFontHeight = fontSize(item);\n return text => _estimateWidth(text, currentFontHeight);\n } else {\n // User defined textMetrics.width function in use (e.g. vl-convert)\n return text => textMetrics.width(item, text);\n }\n}\nfunction truncate(item, text) {\n var limit = +item.limit,\n width = widthGetter(item);\n if (width(text) < limit) return text;\n var ellipsis = item.ellipsis || '\\u2026',\n rtl = item.dir === 'rtl',\n lo = 0,\n hi = text.length,\n mid;\n limit -= width(ellipsis);\n if (rtl) {\n while (lo < hi) {\n mid = lo + hi >>> 1;\n if (width(text.slice(mid)) > limit) lo = mid + 1;else hi = mid;\n }\n return ellipsis + text.slice(lo);\n } else {\n while (lo < hi) {\n mid = 1 + (lo + hi >>> 1);\n if (width(text.slice(0, mid)) < limit) lo = mid;else hi = mid - 1;\n }\n return text.slice(0, lo) + ellipsis;\n }\n}\nfunction fontFamily(item, quote) {\n var font = item.font;\n return (quote && font ? String(font).replace(/\"/g, '\\'') : font) || 'sans-serif';\n}\nfunction font(item, quote) {\n return '' + (item.fontStyle ? item.fontStyle + ' ' : '') + (item.fontVariant ? item.fontVariant + ' ' : '') + (item.fontWeight ? item.fontWeight + ' ' : '') + fontSize(item) + 'px ' + fontFamily(item, quote);\n}\nfunction offset(item) {\n // perform our own font baseline calculation\n // why? not all browsers support SVG 1.1 'alignment-baseline' :(\n // this also ensures consistent layout across renderers\n var baseline = item.baseline,\n h = fontSize(item);\n return Math.round(baseline === 'top' ? 0.79 * h : baseline === 'middle' ? 0.30 * h : baseline === 'bottom' ? -0.21 * h : baseline === 'line-top' ? 0.29 * h + 0.5 * lineHeight(item) : baseline === 'line-bottom' ? 0.29 * h - 0.5 * lineHeight(item) : 0);\n}\n\nconst textAlign = {\n 'left': 'start',\n 'center': 'middle',\n 'right': 'end'\n};\nconst tempBounds = new Bounds();\nfunction anchorPoint(item) {\n var x = item.x || 0,\n y = item.y || 0,\n r = item.radius || 0,\n t;\n if (r) {\n t = (item.theta || 0) - HalfPi;\n x += r * Math.cos(t);\n y += r * Math.sin(t);\n }\n tempBounds.x1 = x;\n tempBounds.y1 = y;\n return tempBounds;\n}\nfunction attr(emit, item) {\n var dx = item.dx || 0,\n dy = (item.dy || 0) + offset(item),\n p = anchorPoint(item),\n x = p.x1,\n y = p.y1,\n a = item.angle || 0,\n t;\n emit('text-anchor', textAlign[item.align] || 'start');\n if (a) {\n t = translate(x, y) + ' ' + rotate(a);\n if (dx || dy) t += ' ' + translate(dx, dy);\n } else {\n t = translate(x + dx, y + dy);\n }\n emit('transform', t);\n}\nfunction bound(bounds, item, mode) {\n var h = textMetrics.height(item),\n a = item.align,\n p = anchorPoint(item),\n x = p.x1,\n y = p.y1,\n dx = item.dx || 0,\n dy = (item.dy || 0) + offset(item) - Math.round(0.8 * h),\n // use 4/5 offset\n tl = textLines(item),\n w;\n\n // get dimensions\n if (isArray(tl)) {\n // multi-line text\n h += lineHeight(item) * (tl.length - 1);\n w = tl.reduce((w, t) => Math.max(w, textMetrics.width(item, t)), 0);\n } else {\n // single-line text\n w = textMetrics.width(item, tl);\n }\n\n // horizontal alignment\n if (a === 'center') {\n dx -= w / 2;\n } else if (a === 'right') {\n dx -= w;\n } else ;\n bounds.set(dx += x, dy += y, dx + w, dy + h);\n if (item.angle && !mode) {\n bounds.rotate(item.angle * DegToRad, x, y);\n } else if (mode === 2) {\n return bounds.rotatedPoints(item.angle * DegToRad, x, y);\n }\n return bounds;\n}\nfunction draw(context, scene, bounds) {\n visit(scene, item => {\n var opacity = item.opacity == null ? 1 : item.opacity,\n p,\n x,\n y,\n i,\n lh,\n tl,\n str;\n if (bounds && !bounds.intersects(item.bounds) ||\n // bounds check\n opacity === 0 || item.fontSize <= 0 || item.text == null || item.text.length === 0) return;\n context.font = font(item);\n context.textAlign = item.align || 'left';\n p = anchorPoint(item);\n x = p.x1, y = p.y1;\n if (item.angle) {\n context.save();\n context.translate(x, y);\n context.rotate(item.angle * DegToRad);\n x = y = 0; // reset x, y\n }\n x += item.dx || 0;\n y += (item.dy || 0) + offset(item);\n tl = textLines(item);\n blend(context, item);\n if (isArray(tl)) {\n lh = lineHeight(item);\n for (i = 0; i < tl.length; ++i) {\n str = textValue(item, tl[i]);\n if (item.fill && fill(context, item, opacity)) {\n context.fillText(str, x, y);\n }\n if (item.stroke && stroke(context, item, opacity)) {\n context.strokeText(str, x, y);\n }\n y += lh;\n }\n } else {\n str = textValue(item, tl);\n if (item.fill && fill(context, item, opacity)) {\n context.fillText(str, x, y);\n }\n if (item.stroke && stroke(context, item, opacity)) {\n context.strokeText(str, x, y);\n }\n }\n if (item.angle) context.restore();\n });\n}\nfunction hit(context, item, x, y, gx, gy) {\n if (item.fontSize <= 0) return false;\n if (!item.angle) return true; // bounds sufficient if no rotation\n\n // project point into space of unrotated bounds\n var p = anchorPoint(item),\n ax = p.x1,\n ay = p.y1,\n b = bound(tempBounds, item, 1),\n a = -item.angle * DegToRad,\n cos = Math.cos(a),\n sin = Math.sin(a),\n px = cos * gx - sin * gy + (ax - cos * ax + sin * ay),\n py = sin * gx + cos * gy + (ay - sin * ax - cos * ay);\n return b.contains(px, py);\n}\nfunction intersectText(item, box) {\n const p = bound(tempBounds, item, 2);\n return intersectBoxLine(box, p[0], p[1], p[2], p[3]) || intersectBoxLine(box, p[0], p[1], p[4], p[5]) || intersectBoxLine(box, p[4], p[5], p[6], p[7]) || intersectBoxLine(box, p[2], p[3], p[6], p[7]);\n}\nvar text = {\n type: 'text',\n tag: 'text',\n nested: false,\n attr: attr,\n bound: bound,\n draw: draw,\n pick: pick$1(hit),\n isect: intersectText\n};\n\nvar trail = markMultiItemPath('trail', trail$1, pickTrail);\n\nvar Marks = {\n arc: arc,\n area: area,\n group: group,\n image: image,\n line: line,\n path: path$2,\n rect: rect,\n rule: rule,\n shape: shape,\n symbol: symbol,\n text: text,\n trail: trail\n};\n\nfunction boundItem (item, func, opt) {\n var type = Marks[item.mark.marktype],\n bound = func || type.bound;\n if (type.nested) item = item.mark;\n return bound(item.bounds || (item.bounds = new Bounds()), item, opt);\n}\n\nvar DUMMY = {\n mark: null\n};\nfunction boundMark (mark, bounds, opt) {\n var type = Marks[mark.marktype],\n bound = type.bound,\n items = mark.items,\n hasItems = items && items.length,\n i,\n n,\n item,\n b;\n if (type.nested) {\n if (hasItems) {\n item = items[0];\n } else {\n // no items, fake it\n DUMMY.mark = mark;\n item = DUMMY;\n }\n b = boundItem(item, bound, opt);\n bounds = bounds && bounds.union(b) || b;\n return bounds;\n }\n bounds = bounds || mark.bounds && mark.bounds.clear() || new Bounds();\n if (hasItems) {\n for (i = 0, n = items.length; i < n; ++i) {\n bounds.union(boundItem(items[i], bound, opt));\n }\n }\n return mark.bounds = bounds;\n}\n\nconst keys = ['marktype', 'name', 'role', 'interactive', 'clip', 'items', 'zindex', 'x', 'y', 'width', 'height', 'align', 'baseline',\n// layout\n'fill', 'fillOpacity', 'opacity', 'blend',\n// fill\n'stroke', 'strokeOpacity', 'strokeWidth', 'strokeCap',\n// stroke\n'strokeDash', 'strokeDashOffset',\n// stroke dash\n'strokeForeground', 'strokeOffset',\n// group\n'startAngle', 'endAngle', 'innerRadius', 'outerRadius',\n// arc\n'cornerRadius', 'padAngle',\n// arc, rect\n'cornerRadiusTopLeft', 'cornerRadiusTopRight',\n// rect, group\n'cornerRadiusBottomLeft', 'cornerRadiusBottomRight', 'interpolate', 'tension', 'orient', 'defined',\n// area, line\n'url', 'aspect', 'smooth',\n// image\n'path', 'scaleX', 'scaleY',\n// path\n'x2', 'y2',\n// rule\n'size', 'shape',\n// symbol\n'text', 'angle', 'theta', 'radius', 'dir', 'dx', 'dy',\n// text\n'ellipsis', 'limit', 'lineBreak', 'lineHeight', 'font', 'fontSize', 'fontWeight', 'fontStyle', 'fontVariant',\n// font\n'description', 'aria', 'ariaRole', 'ariaRoleDescription' // aria\n];\nfunction sceneToJSON(scene, indent) {\n return JSON.stringify(scene, keys, indent);\n}\nfunction sceneFromJSON(json) {\n const scene = typeof json === 'string' ? JSON.parse(json) : json;\n return initialize(scene);\n}\nfunction initialize(scene) {\n var type = scene.marktype,\n items = scene.items,\n parent,\n i,\n n;\n if (items) {\n for (i = 0, n = items.length; i < n; ++i) {\n parent = type ? 'mark' : 'group';\n items[i][parent] = scene;\n if (items[i].zindex) items[i][parent].zdirty = true;\n if ('group' === (type || parent)) initialize(items[i]);\n }\n }\n if (type) boundMark(scene);\n return scene;\n}\n\nclass Scenegraph {\n constructor(scene) {\n if (arguments.length) {\n this.root = sceneFromJSON(scene);\n } else {\n this.root = createMark({\n marktype: 'group',\n name: 'root',\n role: 'frame'\n });\n this.root.items = [new GroupItem(this.root)];\n }\n }\n toJSON(indent) {\n return sceneToJSON(this.root, indent || 0);\n }\n mark(markdef, group, index) {\n group = group || this.root.items[0];\n const mark = createMark(markdef, group);\n group.items[index] = mark;\n if (mark.zindex) mark.group.zdirty = true;\n return mark;\n }\n}\nfunction createMark(def, group) {\n const mark = {\n bounds: new Bounds(),\n clip: !!def.clip,\n group: group,\n interactive: def.interactive === false ? false : true,\n items: [],\n marktype: def.marktype,\n name: def.name || undefined,\n role: def.role || undefined,\n zindex: def.zindex || 0\n };\n\n // add accessibility properties if defined\n if (def.aria != null) {\n mark.aria = def.aria;\n }\n if (def.description) {\n mark.description = def.description;\n }\n return mark;\n}\n\n// create a new DOM element\nfunction domCreate(doc, tag, ns) {\n if (!doc && typeof document !== 'undefined' && document.createElement) {\n doc = document;\n }\n return doc ? ns ? doc.createElementNS(ns, tag) : doc.createElement(tag) : null;\n}\n\n// find first child element with matching tag\nfunction domFind(el, tag) {\n tag = tag.toLowerCase();\n var nodes = el.childNodes,\n i = 0,\n n = nodes.length;\n for (; i < n; ++i) if (nodes[i].tagName.toLowerCase() === tag) {\n return nodes[i];\n }\n}\n\n// retrieve child element at given index\n// create & insert if doesn't exist or if tags do not match\nfunction domChild(el, index, tag, ns) {\n var a = el.childNodes[index],\n b;\n if (!a || a.tagName.toLowerCase() !== tag.toLowerCase()) {\n b = a || null;\n a = domCreate(el.ownerDocument, tag, ns);\n el.insertBefore(a, b);\n }\n return a;\n}\n\n// remove all child elements at or above the given index\nfunction domClear(el, index) {\n var nodes = el.childNodes,\n curr = nodes.length;\n while (curr > index) el.removeChild(nodes[--curr]);\n return el;\n}\n\n// generate css class name for mark\nfunction cssClass(mark) {\n return 'mark-' + mark.marktype + (mark.role ? ' role-' + mark.role : '') + (mark.name ? ' ' + mark.name : '');\n}\n\nfunction point (event, el) {\n const rect = el.getBoundingClientRect();\n return [event.clientX - rect.left - (el.clientLeft || 0), event.clientY - rect.top - (el.clientTop || 0)];\n}\n\nfunction resolveItem (item, event, el, origin) {\n var mark = item && item.mark,\n mdef,\n p;\n if (mark && (mdef = Marks[mark.marktype]).tip) {\n p = point(event, el);\n p[0] -= origin[0];\n p[1] -= origin[1];\n while (item = item.mark.group) {\n p[0] -= item.x || 0;\n p[1] -= item.y || 0;\n }\n item = mdef.tip(mark.items, p);\n }\n return item;\n}\n\nclass Handler {\n /**\n * Create a new Handler instance.\n * @param {object} [customLoader] - Optional loader instance for\n * href URL sanitization. If not specified, a standard loader\n * instance will be generated.\n * @param {function} [customTooltip] - Optional tooltip handler\n * function for custom tooltip display.\n * @constructor\n */\n constructor(customLoader, customTooltip) {\n this._active = null;\n this._handlers = {};\n this._loader = customLoader || loader();\n this._tooltip = customTooltip || defaultTooltip;\n }\n\n /**\n * Initialize a new Handler instance.\n * @param {DOMElement} el - The containing DOM element for the display.\n * @param {Array} origin - The origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {object} [obj] - Optional context object that should serve as\n * the \"this\" context for event callbacks.\n * @return {Handler} - This handler instance.\n */\n initialize(el, origin, obj) {\n this._el = el;\n this._obj = obj || null;\n return this.origin(origin);\n }\n\n /**\n * Returns the parent container element for a visualization.\n * @return {DOMElement} - The containing DOM element.\n */\n element() {\n return this._el;\n }\n\n /**\n * Returns the scene element (e.g., canvas or SVG) of the visualization\n * Subclasses must override if the first child is not the scene element.\n * @return {DOMElement} - The scene (e.g., canvas or SVG) element.\n */\n canvas() {\n return this._el && this._el.firstChild;\n }\n\n /**\n * Get / set the origin coordinates of the visualization.\n */\n origin(origin) {\n if (arguments.length) {\n this._origin = origin || [0, 0];\n return this;\n } else {\n return this._origin.slice();\n }\n }\n\n /**\n * Get / set the scenegraph root.\n */\n scene(scene) {\n if (!arguments.length) return this._scene;\n this._scene = scene;\n return this;\n }\n\n /**\n * Add an event handler. Subclasses should override this method.\n */\n on( /*type, handler*/) {}\n\n /**\n * Remove an event handler. Subclasses should override this method.\n */\n off( /*type, handler*/) {}\n\n /**\n * Utility method for finding the array index of an event handler.\n * @param {Array} h - An array of registered event handlers.\n * @param {string} type - The event type.\n * @param {function} handler - The event handler instance to find.\n * @return {number} - The handler's array index or -1 if not registered.\n */\n _handlerIndex(h, type, handler) {\n for (let i = h ? h.length : 0; --i >= 0;) {\n if (h[i].type === type && (!handler || h[i].handler === handler)) {\n return i;\n }\n }\n return -1;\n }\n\n /**\n * Returns an array with registered event handlers.\n * @param {string} [type] - The event type to query. Any annotations\n * are ignored; for example, for the argument \"click.foo\", \".foo\" will\n * be ignored and the method returns all \"click\" handlers. If type is\n * null or unspecified, this method returns handlers for all types.\n * @return {Array} - A new array containing all registered event handlers.\n */\n handlers(type) {\n const h = this._handlers,\n a = [];\n if (type) {\n a.push(...h[this.eventName(type)]);\n } else {\n for (const k in h) {\n a.push(...h[k]);\n }\n }\n return a;\n }\n\n /**\n * Parses an event name string to return the specific event type.\n * For example, given \"click.foo\" returns \"click\"\n * @param {string} name - The input event type string.\n * @return {string} - A string with the event type only.\n */\n eventName(name) {\n const i = name.indexOf('.');\n return i < 0 ? name : name.slice(0, i);\n }\n\n /**\n * Handle hyperlink navigation in response to an item.href value.\n * @param {Event} event - The event triggering hyperlink navigation.\n * @param {Item} item - The scenegraph item.\n * @param {string} href - The URL to navigate to.\n */\n handleHref(event, item, href) {\n this._loader.sanitize(href, {\n context: 'href'\n }).then(opt => {\n const e = new MouseEvent(event.type, event),\n a = domCreate(null, 'a');\n for (const name in opt) a.setAttribute(name, opt[name]);\n a.dispatchEvent(e);\n }).catch(() => {});\n }\n\n /**\n * Handle tooltip display in response to an item.tooltip value.\n * @param {Event} event - The event triggering tooltip display.\n * @param {Item} item - The scenegraph item.\n * @param {boolean} show - A boolean flag indicating whether\n * to show or hide a tooltip for the given item.\n */\n handleTooltip(event, item, show) {\n if (item && item.tooltip != null) {\n item = resolveItem(item, event, this.canvas(), this._origin);\n const value = show && item && item.tooltip || null;\n this._tooltip.call(this._obj, this, event, item, value);\n }\n }\n\n /**\n * Returns the size of a scenegraph item and its position relative\n * to the viewport.\n * @param {Item} item - The scenegraph item.\n * @return {object} - A bounding box object (compatible with the\n * DOMRect type) consisting of x, y, width, heigh, top, left,\n * right, and bottom properties.\n */\n getItemBoundingClientRect(item) {\n const el = this.canvas();\n if (!el) return;\n const rect = el.getBoundingClientRect(),\n origin = this._origin,\n bounds = item.bounds,\n width = bounds.width(),\n height = bounds.height();\n let x = bounds.x1 + origin[0] + rect.left,\n y = bounds.y1 + origin[1] + rect.top;\n\n // translate coordinate for each parent group\n while (item.mark && (item = item.mark.group)) {\n x += item.x || 0;\n y += item.y || 0;\n }\n\n // return DOMRect-compatible bounding box\n return {\n x,\n y,\n width,\n height,\n left: x,\n top: y,\n right: x + width,\n bottom: y + height\n };\n }\n}\n\n// The default tooltip display handler.\n// Sets the HTML title attribute on the visualization container.\nfunction defaultTooltip(handler, event, item, value) {\n handler.element().setAttribute('title', value || '');\n}\n\nclass Renderer {\n /**\n * Create a new Renderer instance.\n * @param {object} [loader] - Optional loader instance for\n * image and href URL sanitization. If not specified, a\n * standard loader instance will be generated.\n * @constructor\n */\n constructor(loader) {\n this._el = null;\n this._bgcolor = null;\n this._loader = new ResourceLoader(loader);\n }\n\n /**\n * Initialize a new Renderer instance.\n * @param {DOMElement} el - The containing DOM element for the display.\n * @param {number} width - The coordinate width of the display, in pixels.\n * @param {number} height - The coordinate height of the display, in pixels.\n * @param {Array} origin - The origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {Renderer} - This renderer instance.\n */\n initialize(el, width, height, origin, scaleFactor) {\n this._el = el;\n return this.resize(width, height, origin, scaleFactor);\n }\n\n /**\n * Returns the parent container element for a visualization.\n * @return {DOMElement} - The containing DOM element.\n */\n element() {\n return this._el;\n }\n\n /**\n * Returns the scene element (e.g., canvas or SVG) of the visualization\n * Subclasses must override if the first child is not the scene element.\n * @return {DOMElement} - The scene (e.g., canvas or SVG) element.\n */\n canvas() {\n return this._el && this._el.firstChild;\n }\n\n /**\n * Get / set the background color.\n */\n background(bgcolor) {\n if (arguments.length === 0) return this._bgcolor;\n this._bgcolor = bgcolor;\n return this;\n }\n\n /**\n * Resize the display.\n * @param {number} width - The new coordinate width of the display, in pixels.\n * @param {number} height - The new coordinate height of the display, in pixels.\n * @param {Array} origin - The new origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {Renderer} - This renderer instance;\n */\n resize(width, height, origin, scaleFactor) {\n this._width = width;\n this._height = height;\n this._origin = origin || [0, 0];\n this._scale = scaleFactor || 1;\n return this;\n }\n\n /**\n * Report a dirty item whose bounds should be redrawn.\n * This base class method does nothing. Subclasses that perform\n * incremental should implement this method.\n * @param {Item} item - The dirty item whose bounds should be redrawn.\n */\n dirty( /*item*/) {}\n\n /**\n * Render an input scenegraph, potentially with a set of dirty items.\n * This method will perform an immediate rendering with available resources.\n * The renderer may also need to perform image loading to perform a complete\n * render. This process can lead to asynchronous re-rendering of the scene\n * after this method returns. To receive notification when rendering is\n * complete, use the renderAsync method instead.\n * @param {object} scene - The root mark of a scenegraph to render.\n * @param {Array} markTypes - Array of the mark types to render.\n * If undefined, render all mark types\n * @return {Renderer} - This renderer instance.\n */\n render(scene, markTypes) {\n const r = this;\n\n // bind arguments into a render call, and cache it\n // this function may be subsequently called for async redraw\n r._call = function () {\n r._render(scene, markTypes);\n };\n\n // invoke the renderer\n r._call();\n\n // clear the cached call for garbage collection\n // async redraws will stash their own copy\n r._call = null;\n return r;\n }\n\n /**\n * Internal rendering method. Renderer subclasses should override this\n * method to actually perform rendering.\n * @param {object} scene - The root mark of a scenegraph to render.\n * @param {Array} markTypes - Array of the mark types to render.\n * If undefined, render all mark types\n */\n _render( /*scene, markTypes*/\n ) {\n // subclasses to override\n }\n\n /**\n * Asynchronous rendering method. Similar to render, but returns a Promise\n * that resolves when all rendering is completed. Sometimes a renderer must\n * perform image loading to get a complete rendering. The returned\n * Promise will not resolve until this process completes.\n * @param {object} scene - The root mark of a scenegraph to render.\n * @param {Array} markTypes - Array of the mark types to render.\n * If undefined, render all mark types\n * @return {Promise} - A Promise that resolves when rendering is complete.\n */\n renderAsync(scene, markTypes) {\n const r = this.render(scene, markTypes);\n return this._ready ? this._ready.then(() => r) : Promise.resolve(r);\n }\n\n /**\n * Internal method for asynchronous resource loading.\n * Proxies method calls to the ImageLoader, and tracks loading\n * progress to invoke a re-render once complete.\n * @param {string} method - The method name to invoke on the ImageLoader.\n * @param {string} uri - The URI for the requested resource.\n * @return {Promise} - A Promise that resolves to the requested resource.\n */\n _load(method, uri) {\n var r = this,\n p = r._loader[method](uri);\n if (!r._ready) {\n // re-render the scene when loading completes\n const call = r._call;\n r._ready = r._loader.ready().then(redraw => {\n if (redraw) call();\n r._ready = null;\n });\n }\n return p;\n }\n\n /**\n * Sanitize a URL to include as a hyperlink in the rendered scene.\n * This method proxies a call to ImageLoader.sanitizeURL, but also tracks\n * image loading progress and invokes a re-render once complete.\n * @param {string} uri - The URI string to sanitize.\n * @return {Promise} - A Promise that resolves to the sanitized URL.\n */\n sanitizeURL(uri) {\n return this._load('sanitizeURL', uri);\n }\n\n /**\n * Requests an image to include in the rendered scene.\n * This method proxies a call to ImageLoader.loadImage, but also tracks\n * image loading progress and invokes a re-render once complete.\n * @param {string} uri - The URI string of the image.\n * @return {Promise} - A Promise that resolves to the loaded Image.\n */\n loadImage(uri) {\n return this._load('loadImage', uri);\n }\n}\n\nconst KeyDownEvent = 'keydown';\nconst KeyPressEvent = 'keypress';\nconst KeyUpEvent = 'keyup';\nconst DragEnterEvent = 'dragenter';\nconst DragLeaveEvent = 'dragleave';\nconst DragOverEvent = 'dragover';\nconst PointerDownEvent = 'pointerdown';\nconst PointerUpEvent = 'pointerup';\nconst PointerMoveEvent = 'pointermove';\nconst PointerOutEvent = 'pointerout';\nconst PointerOverEvent = 'pointerover';\nconst MouseDownEvent = 'mousedown';\nconst MouseUpEvent = 'mouseup';\nconst MouseMoveEvent = 'mousemove';\nconst MouseOutEvent = 'mouseout';\nconst MouseOverEvent = 'mouseover';\nconst ClickEvent = 'click';\nconst DoubleClickEvent = 'dblclick';\nconst WheelEvent = 'wheel';\nconst MouseWheelEvent = 'mousewheel';\nconst TouchStartEvent = 'touchstart';\nconst TouchMoveEvent = 'touchmove';\nconst TouchEndEvent = 'touchend';\nconst Events = [KeyDownEvent, KeyPressEvent, KeyUpEvent, DragEnterEvent, DragLeaveEvent, DragOverEvent, PointerDownEvent, PointerUpEvent, PointerMoveEvent, PointerOutEvent, PointerOverEvent, MouseDownEvent, MouseUpEvent, MouseMoveEvent, MouseOutEvent, MouseOverEvent, ClickEvent, DoubleClickEvent, WheelEvent, MouseWheelEvent, TouchStartEvent, TouchMoveEvent, TouchEndEvent];\nconst TooltipShowEvent = PointerMoveEvent;\nconst TooltipHideEvent = MouseOutEvent;\nconst HrefEvent = ClickEvent;\n\nclass CanvasHandler extends Handler {\n constructor(loader, tooltip) {\n super(loader, tooltip);\n this._down = null;\n this._touch = null;\n this._first = true;\n this._events = {};\n\n // supported events\n this.events = Events;\n this.pointermove = move([PointerMoveEvent, MouseMoveEvent], [PointerOverEvent, MouseOverEvent], [PointerOutEvent, MouseOutEvent]);\n this.dragover = move([DragOverEvent], [DragEnterEvent], [DragLeaveEvent]), this.pointerout = inactive([PointerOutEvent, MouseOutEvent]);\n this.dragleave = inactive([DragLeaveEvent]);\n }\n initialize(el, origin, obj) {\n this._canvas = el && domFind(el, 'canvas');\n\n // add minimal events required for proper state management\n [ClickEvent, MouseDownEvent, PointerDownEvent, PointerMoveEvent, PointerOutEvent, DragLeaveEvent].forEach(type => eventListenerCheck(this, type));\n return super.initialize(el, origin, obj);\n }\n\n // return the backing canvas instance\n canvas() {\n return this._canvas;\n }\n\n // retrieve the current canvas context\n context() {\n return this._canvas.getContext('2d');\n }\n\n // to keep old versions of firefox happy\n DOMMouseScroll(evt) {\n this.fire(MouseWheelEvent, evt);\n }\n pointerdown(evt) {\n this._down = this._active;\n this.fire(PointerDownEvent, evt);\n }\n mousedown(evt) {\n this._down = this._active;\n this.fire(MouseDownEvent, evt);\n }\n click(evt) {\n if (this._down === this._active) {\n this.fire(ClickEvent, evt);\n this._down = null;\n }\n }\n touchstart(evt) {\n this._touch = this.pickEvent(evt.changedTouches[0]);\n if (this._first) {\n this._active = this._touch;\n this._first = false;\n }\n this.fire(TouchStartEvent, evt, true);\n }\n touchmove(evt) {\n this.fire(TouchMoveEvent, evt, true);\n }\n touchend(evt) {\n this.fire(TouchEndEvent, evt, true);\n this._touch = null;\n }\n\n // fire an event\n fire(type, evt, touch) {\n const a = touch ? this._touch : this._active,\n h = this._handlers[type];\n\n // set event type relative to scenegraph items\n evt.vegaType = type;\n\n // handle hyperlinks and tooltips first\n if (type === HrefEvent && a && a.href) {\n this.handleHref(evt, a, a.href);\n } else if (type === TooltipShowEvent || type === TooltipHideEvent) {\n this.handleTooltip(evt, a, type !== TooltipHideEvent);\n }\n\n // invoke all registered handlers\n if (h) {\n for (let i = 0, len = h.length; i < len; ++i) {\n h[i].handler.call(this._obj, evt, a);\n }\n }\n }\n\n // add an event handler\n on(type, handler) {\n const name = this.eventName(type),\n h = this._handlers,\n i = this._handlerIndex(h[name], type, handler);\n if (i < 0) {\n eventListenerCheck(this, type);\n (h[name] || (h[name] = [])).push({\n type: type,\n handler: handler\n });\n }\n return this;\n }\n\n // remove an event handler\n off(type, handler) {\n const name = this.eventName(type),\n h = this._handlers[name],\n i = this._handlerIndex(h, type, handler);\n if (i >= 0) {\n h.splice(i, 1);\n }\n return this;\n }\n pickEvent(evt) {\n const p = point(evt, this._canvas),\n o = this._origin;\n return this.pick(this._scene, p[0], p[1], p[0] - o[0], p[1] - o[1]);\n }\n\n // find the scenegraph item at the current pointer position\n // x, y -- the absolute x, y pointer coordinates on the canvas element\n // gx, gy -- the relative coordinates within the current group\n pick(scene, x, y, gx, gy) {\n const g = this.context(),\n mark = Marks[scene.marktype];\n return mark.pick.call(this, g, scene, x, y, gx, gy);\n }\n}\nconst eventBundle = type => type === TouchStartEvent || type === TouchMoveEvent || type === TouchEndEvent ? [TouchStartEvent, TouchMoveEvent, TouchEndEvent] : [type];\n\n// lazily add listeners to the canvas as needed\nfunction eventListenerCheck(handler, type) {\n eventBundle(type).forEach(_ => addEventListener(handler, _));\n}\nfunction addEventListener(handler, type) {\n const canvas = handler.canvas();\n if (canvas && !handler._events[type]) {\n handler._events[type] = 1;\n canvas.addEventListener(type, handler[type] ? evt => handler[type](evt) : evt => handler.fire(type, evt));\n }\n}\nfunction fireAll(handler, types, event) {\n types.forEach(type => handler.fire(type, event));\n}\nfunction move(moveEvents, overEvents, outEvents) {\n return function (evt) {\n const a = this._active,\n p = this.pickEvent(evt);\n if (p === a) {\n // active item and picked item are the same\n fireAll(this, moveEvents, evt); // fire move\n } else {\n // active item and picked item are different\n if (!a || !a.exit) {\n // fire out for prior active item\n // suppress if active item was removed from scene\n fireAll(this, outEvents, evt);\n }\n this._active = p; // set new active item\n fireAll(this, overEvents, evt); // fire over for new active item\n fireAll(this, moveEvents, evt); // fire move for new active item\n }\n };\n}\nfunction inactive(types) {\n return function (evt) {\n fireAll(this, types, evt);\n this._active = null;\n };\n}\n\nfunction devicePixelRatio() {\n return typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1;\n}\nfunction resize (canvas, width, height, origin, scaleFactor, opt) {\n const inDOM = typeof HTMLElement !== 'undefined' && canvas instanceof HTMLElement && canvas.parentNode != null,\n context = canvas.getContext('2d'),\n ratio = inDOM ? devicePixelRatio() : scaleFactor;\n canvas.width = width * ratio;\n canvas.height = height * ratio;\n for (const key in opt) {\n context[key] = opt[key];\n }\n if (inDOM && ratio !== 1) {\n canvas.style.width = width + 'px';\n canvas.style.height = height + 'px';\n }\n context.pixelRatio = ratio;\n context.setTransform(ratio, 0, 0, ratio, ratio * origin[0], ratio * origin[1]);\n return canvas;\n}\n\nclass CanvasRenderer extends Renderer {\n constructor(loader) {\n super(loader);\n this._options = {};\n this._redraw = false;\n this._dirty = new Bounds();\n this._tempb = new Bounds();\n }\n initialize(el, width, height, origin, scaleFactor, options) {\n this._options = options || {};\n this._canvas = this._options.externalContext ? null : canvas(1, 1, this._options.type); // instantiate a small canvas\n\n if (el && this._canvas) {\n domClear(el, 0).appendChild(this._canvas);\n this._canvas.setAttribute('class', 'marks');\n }\n\n // this method will invoke resize to size the canvas appropriately\n return super.initialize(el, width, height, origin, scaleFactor);\n }\n resize(width, height, origin, scaleFactor) {\n super.resize(width, height, origin, scaleFactor);\n if (this._canvas) {\n // configure canvas size and transform\n resize(this._canvas, this._width, this._height, this._origin, this._scale, this._options.context);\n } else {\n // external context needs to be scaled and positioned to origin\n const ctx = this._options.externalContext;\n if (!ctx) error('CanvasRenderer is missing a valid canvas or context');\n ctx.scale(this._scale, this._scale);\n ctx.translate(this._origin[0], this._origin[1]);\n }\n this._redraw = true;\n return this;\n }\n canvas() {\n return this._canvas;\n }\n context() {\n return this._options.externalContext || (this._canvas ? this._canvas.getContext('2d') : null);\n }\n dirty(item) {\n const b = this._tempb.clear().union(item.bounds);\n let g = item.mark.group;\n while (g) {\n b.translate(g.x || 0, g.y || 0);\n g = g.mark.group;\n }\n this._dirty.union(b);\n }\n _render(scene, markTypes) {\n const g = this.context(),\n o = this._origin,\n w = this._width,\n h = this._height,\n db = this._dirty,\n vb = viewBounds(o, w, h);\n\n // setup\n g.save();\n const b = this._redraw || db.empty() ? (this._redraw = false, vb.expand(1)) : clipToBounds(g, vb.intersect(db), o);\n this.clear(-o[0], -o[1], w, h);\n\n // render\n this.draw(g, scene, b, markTypes);\n\n // takedown\n g.restore();\n db.clear();\n return this;\n }\n draw(ctx, scene, bounds, markTypes) {\n if (scene.marktype !== 'group' && markTypes != null && !markTypes.includes(scene.marktype)) {\n return;\n }\n const mark = Marks[scene.marktype];\n if (scene.clip) clip(ctx, scene);\n mark.draw.call(this, ctx, scene, bounds, markTypes);\n if (scene.clip) ctx.restore();\n }\n clear(x, y, w, h) {\n const opt = this._options,\n g = this.context();\n if (opt.type !== 'pdf' && !opt.externalContext) {\n // calling clear rect voids vector output in pdf mode\n // and could remove external context content (#2615)\n g.clearRect(x, y, w, h);\n }\n if (this._bgcolor != null) {\n g.fillStyle = this._bgcolor;\n g.fillRect(x, y, w, h);\n }\n }\n}\nconst viewBounds = (origin, width, height) => new Bounds().set(0, 0, width, height).translate(-origin[0], -origin[1]);\nfunction clipToBounds(g, b, origin) {\n // expand bounds by 1 pixel, then round to pixel boundaries\n b.expand(1).round();\n\n // align to base pixel grid in case of non-integer scaling (#2425)\n if (g.pixelRatio % 1) {\n b.scale(g.pixelRatio).round().scale(1 / g.pixelRatio);\n }\n\n // to avoid artifacts translate if origin has fractional pixels\n b.translate(-(origin[0] % 1), -(origin[1] % 1));\n\n // set clip path\n g.beginPath();\n g.rect(b.x1, b.y1, b.width(), b.height());\n g.clip();\n return b;\n}\n\nclass SVGHandler extends Handler {\n constructor(loader, tooltip) {\n super(loader, tooltip);\n const h = this;\n h._hrefHandler = listener(h, (evt, item) => {\n if (item && item.href) h.handleHref(evt, item, item.href);\n });\n h._tooltipHandler = listener(h, (evt, item) => {\n h.handleTooltip(evt, item, evt.type !== TooltipHideEvent);\n });\n }\n initialize(el, origin, obj) {\n let svg = this._svg;\n if (svg) {\n svg.removeEventListener(HrefEvent, this._hrefHandler);\n svg.removeEventListener(TooltipShowEvent, this._tooltipHandler);\n svg.removeEventListener(TooltipHideEvent, this._tooltipHandler);\n }\n this._svg = svg = el && domFind(el, 'svg');\n if (svg) {\n svg.addEventListener(HrefEvent, this._hrefHandler);\n svg.addEventListener(TooltipShowEvent, this._tooltipHandler);\n svg.addEventListener(TooltipHideEvent, this._tooltipHandler);\n }\n return super.initialize(el, origin, obj);\n }\n canvas() {\n return this._svg;\n }\n\n // add an event handler\n on(type, handler) {\n const name = this.eventName(type),\n h = this._handlers,\n i = this._handlerIndex(h[name], type, handler);\n if (i < 0) {\n const x = {\n type,\n handler,\n listener: listener(this, handler)\n };\n (h[name] || (h[name] = [])).push(x);\n if (this._svg) {\n this._svg.addEventListener(name, x.listener);\n }\n }\n return this;\n }\n\n // remove an event handler\n off(type, handler) {\n const name = this.eventName(type),\n h = this._handlers[name],\n i = this._handlerIndex(h, type, handler);\n if (i >= 0) {\n if (this._svg) {\n this._svg.removeEventListener(name, h[i].listener);\n }\n h.splice(i, 1);\n }\n return this;\n }\n}\n\n// wrap an event listener for the SVG DOM\nconst listener = (context, handler) => evt => {\n let item = evt.target.__data__;\n item = Array.isArray(item) ? item[0] : item;\n evt.vegaType = evt.type;\n handler.call(context._obj, evt, item);\n};\n\nconst ARIA_HIDDEN = 'aria-hidden';\nconst ARIA_LABEL = 'aria-label';\nconst ARIA_ROLE = 'role';\nconst ARIA_ROLEDESCRIPTION = 'aria-roledescription';\nconst GRAPHICS_OBJECT = 'graphics-object';\nconst GRAPHICS_SYMBOL = 'graphics-symbol';\nconst bundle = (role, roledesc, label) => ({\n [ARIA_ROLE]: role,\n [ARIA_ROLEDESCRIPTION]: roledesc,\n [ARIA_LABEL]: label || undefined\n});\n\n// these roles are covered by related roles\n// we can ignore them, no need to generate attributes\nconst AriaIgnore = toSet(['axis-domain', 'axis-grid', 'axis-label', 'axis-tick', 'axis-title', 'legend-band', 'legend-entry', 'legend-gradient', 'legend-label', 'legend-title', 'legend-symbol', 'title']);\n\n// aria attribute generators for guide roles\nconst AriaGuides = {\n 'axis': {\n desc: 'axis',\n caption: axisCaption\n },\n 'legend': {\n desc: 'legend',\n caption: legendCaption\n },\n 'title-text': {\n desc: 'title',\n caption: item => `Title text '${titleCaption(item)}'`\n },\n 'title-subtitle': {\n desc: 'subtitle',\n caption: item => `Subtitle text '${titleCaption(item)}'`\n }\n};\n\n// aria properties generated for mark item encoding channels\nconst AriaEncode = {\n ariaRole: ARIA_ROLE,\n ariaRoleDescription: ARIA_ROLEDESCRIPTION,\n description: ARIA_LABEL\n};\nfunction ariaItemAttributes(emit, item) {\n const hide = item.aria === false;\n emit(ARIA_HIDDEN, hide || undefined);\n if (hide || item.description == null) {\n for (const prop in AriaEncode) {\n emit(AriaEncode[prop], undefined);\n }\n } else {\n const type = item.mark.marktype;\n emit(ARIA_LABEL, item.description);\n emit(ARIA_ROLE, item.ariaRole || (type === 'group' ? GRAPHICS_OBJECT : GRAPHICS_SYMBOL));\n emit(ARIA_ROLEDESCRIPTION, item.ariaRoleDescription || `${type} mark`);\n }\n}\nfunction ariaMarkAttributes(mark) {\n return mark.aria === false ? {\n [ARIA_HIDDEN]: true\n } : AriaIgnore[mark.role] ? null : AriaGuides[mark.role] ? ariaGuide(mark, AriaGuides[mark.role]) : ariaMark(mark);\n}\nfunction ariaMark(mark) {\n const type = mark.marktype;\n const recurse = type === 'group' || type === 'text' || mark.items.some(_ => _.description != null && _.aria !== false);\n return bundle(recurse ? GRAPHICS_OBJECT : GRAPHICS_SYMBOL, `${type} mark container`, mark.description);\n}\nfunction ariaGuide(mark, opt) {\n try {\n const item = mark.items[0],\n caption = opt.caption || (() => '');\n return bundle(opt.role || GRAPHICS_SYMBOL, opt.desc, item.description || caption(item));\n } catch (err) {\n return null;\n }\n}\nfunction titleCaption(item) {\n return array(item.text).join(' ');\n}\nfunction axisCaption(item) {\n const datum = item.datum,\n orient = item.orient,\n title = datum.title ? extractTitle(item) : null,\n ctx = item.context,\n scale = ctx.scales[datum.scale].value,\n locale = ctx.dataflow.locale(),\n type = scale.type,\n xy = orient === 'left' || orient === 'right' ? 'Y' : 'X';\n return `${xy}-axis` + (title ? ` titled '${title}'` : '') + ` for a ${isDiscrete(type) ? 'discrete' : type} scale` + ` with ${domainCaption(locale, scale, item)}`;\n}\nfunction legendCaption(item) {\n const datum = item.datum,\n title = datum.title ? extractTitle(item) : null,\n type = `${datum.type || ''} legend`.trim(),\n scales = datum.scales,\n props = Object.keys(scales),\n ctx = item.context,\n scale = ctx.scales[scales[props[0]]].value,\n locale = ctx.dataflow.locale();\n return capitalize(type) + (title ? ` titled '${title}'` : '') + ` for ${channelCaption(props)}` + ` with ${domainCaption(locale, scale, item)}`;\n}\nfunction extractTitle(item) {\n try {\n return array(peek(item.items).items[0].text).join(' ');\n } catch (err) {\n return null;\n }\n}\nfunction channelCaption(props) {\n props = props.map(p => p + (p === 'fill' || p === 'stroke' ? ' color' : ''));\n return props.length < 2 ? props[0] : props.slice(0, -1).join(', ') + ' and ' + peek(props);\n}\nfunction capitalize(s) {\n return s.length ? s[0].toUpperCase() + s.slice(1) : s;\n}\n\nconst innerText = val => (val + '').replace(/&/g, '&').replace(//g, '>');\nconst attrText = val => innerText(val).replace(/\"/g, '"').replace(/\\t/g, ' ').replace(/\\n/g, ' ').replace(/\\r/g, ' ');\nfunction markup() {\n let buf = '',\n outer = '',\n inner = '';\n const stack = [],\n clear = () => outer = inner = '',\n push = tag => {\n if (outer) {\n buf += `${outer}>${inner}`;\n clear();\n }\n stack.push(tag);\n },\n attr = (name, value) => {\n if (value != null) outer += ` ${name}=\"${attrText(value)}\"`;\n return m;\n },\n m = {\n open(tag) {\n push(tag);\n outer = '<' + tag;\n for (var _len = arguments.length, attrs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n attrs[_key - 1] = arguments[_key];\n }\n for (const set of attrs) {\n for (const key in set) attr(key, set[key]);\n }\n return m;\n },\n close() {\n const tag = stack.pop();\n if (outer) {\n buf += outer + (inner ? `>${inner}` : '/>');\n } else {\n buf += ``;\n }\n clear();\n return m;\n },\n attr,\n text: t => (inner += innerText(t), m),\n toString: () => buf\n };\n return m;\n}\nconst serializeXML = node => _serialize(markup(), node) + '';\nfunction _serialize(m, node) {\n m.open(node.tagName);\n if (node.hasAttributes()) {\n const attrs = node.attributes,\n n = attrs.length;\n for (let i = 0; i < n; ++i) {\n m.attr(attrs[i].name, attrs[i].value);\n }\n }\n if (node.hasChildNodes()) {\n const children = node.childNodes;\n for (const child of children) {\n child.nodeType === 3 // text node\n ? m.text(child.nodeValue) : _serialize(m, child);\n }\n }\n return m.close();\n}\n\nconst stylesAttr = {\n fill: 'fill',\n fillOpacity: 'fill-opacity',\n stroke: 'stroke',\n strokeOpacity: 'stroke-opacity',\n strokeWidth: 'stroke-width',\n strokeCap: 'stroke-linecap',\n strokeJoin: 'stroke-linejoin',\n strokeDash: 'stroke-dasharray',\n strokeDashOffset: 'stroke-dashoffset',\n strokeMiterLimit: 'stroke-miterlimit',\n opacity: 'opacity'\n};\nconst stylesCss = {\n blend: 'mix-blend-mode'\n};\n\n// ensure miter limit default is consistent with canvas (#2498)\nconst rootAttributes = {\n 'fill': 'none',\n 'stroke-miterlimit': 10\n};\n\nconst RootIndex = 0,\n xmlns = 'http://www.w3.org/2000/xmlns/',\n svgns = metadata.xmlns;\nclass SVGRenderer extends Renderer {\n constructor(loader) {\n super(loader);\n this._dirtyID = 0;\n this._dirty = [];\n this._svg = null;\n this._root = null;\n this._defs = null;\n }\n\n /**\n * Initialize a new SVGRenderer instance.\n * @param {DOMElement} el - The containing DOM element for the display.\n * @param {number} width - The coordinate width of the display, in pixels.\n * @param {number} height - The coordinate height of the display, in pixels.\n * @param {Array} origin - The origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {SVGRenderer} - This renderer instance.\n */\n initialize(el, width, height, origin, scaleFactor) {\n // create the svg definitions cache\n this._defs = {};\n this._clearDefs();\n if (el) {\n this._svg = domChild(el, 0, 'svg', svgns);\n this._svg.setAttributeNS(xmlns, 'xmlns', svgns);\n this._svg.setAttributeNS(xmlns, 'xmlns:xlink', metadata['xmlns:xlink']);\n this._svg.setAttribute('version', metadata['version']);\n this._svg.setAttribute('class', 'marks');\n domClear(el, 1);\n\n // set the svg root group\n this._root = domChild(this._svg, RootIndex, 'g', svgns);\n setAttributes(this._root, rootAttributes);\n\n // ensure no additional child elements\n domClear(this._svg, RootIndex + 1);\n }\n\n // set background color if defined\n this.background(this._bgcolor);\n return super.initialize(el, width, height, origin, scaleFactor);\n }\n\n /**\n * Get / set the background color.\n */\n background(bgcolor) {\n if (arguments.length && this._svg) {\n this._svg.style.setProperty('background-color', bgcolor);\n }\n return super.background(...arguments);\n }\n\n /**\n * Resize the display.\n * @param {number} width - The new coordinate width of the display, in pixels.\n * @param {number} height - The new coordinate height of the display, in pixels.\n * @param {Array} origin - The new origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {SVGRenderer} - This renderer instance;\n */\n resize(width, height, origin, scaleFactor) {\n super.resize(width, height, origin, scaleFactor);\n if (this._svg) {\n setAttributes(this._svg, {\n width: this._width * this._scale,\n height: this._height * this._scale,\n viewBox: `0 0 ${this._width} ${this._height}`\n });\n this._root.setAttribute('transform', `translate(${this._origin})`);\n }\n this._dirty = [];\n return this;\n }\n\n /**\n * Returns the SVG element of the visualization.\n * @return {DOMElement} - The SVG element.\n */\n canvas() {\n return this._svg;\n }\n\n /**\n * Returns an SVG text string for the rendered content,\n * or null if this renderer is currently headless.\n */\n svg() {\n const svg = this._svg,\n bg = this._bgcolor;\n if (!svg) return null;\n let node;\n if (bg) {\n svg.removeAttribute('style');\n node = domChild(svg, RootIndex, 'rect', svgns);\n setAttributes(node, {\n width: this._width,\n height: this._height,\n fill: bg\n });\n }\n const text = serializeXML(svg);\n if (bg) {\n svg.removeChild(node);\n this._svg.style.setProperty('background-color', bg);\n }\n return text;\n }\n\n /**\n * Internal rendering method.\n * @param {object} scene - The root mark of a scenegraph to render.\n * @param {Array} markTypes - Array of the mark types to render.\n * If undefined, render all mark types\n */\n _render(scene, markTypes) {\n // perform spot updates and re-render markup\n if (this._dirtyCheck()) {\n if (this._dirtyAll) this._clearDefs();\n this.mark(this._root, scene, undefined, markTypes);\n domClear(this._root, 1);\n }\n this.defs();\n this._dirty = [];\n ++this._dirtyID;\n return this;\n }\n\n // -- Manage rendering of items marked as dirty --\n\n /**\n * Flag a mark item as dirty.\n * @param {Item} item - The mark item.\n */\n dirty(item) {\n if (item.dirty !== this._dirtyID) {\n item.dirty = this._dirtyID;\n this._dirty.push(item);\n }\n }\n\n /**\n * Check if a mark item is considered dirty.\n * @param {Item} item - The mark item.\n */\n isDirty(item) {\n return this._dirtyAll || !item._svg || !item._svg.ownerSVGElement || item.dirty === this._dirtyID;\n }\n\n /**\n * Internal method to check dirty status and, if possible,\n * make targetted updates without a full rendering pass.\n */\n _dirtyCheck() {\n this._dirtyAll = true;\n const items = this._dirty;\n if (!items.length || !this._dirtyID) return true;\n const id = ++this._dirtyID;\n let item, mark, type, mdef, i, n, o;\n for (i = 0, n = items.length; i < n; ++i) {\n item = items[i];\n mark = item.mark;\n if (mark.marktype !== type) {\n // memoize mark instance lookup\n type = mark.marktype;\n mdef = Marks[type];\n }\n if (mark.zdirty && mark.dirty !== id) {\n this._dirtyAll = false;\n dirtyParents(item, id);\n mark.items.forEach(i => {\n i.dirty = id;\n });\n }\n if (mark.zdirty) continue; // handle in standard drawing pass\n\n if (item.exit) {\n // EXIT\n if (mdef.nested && mark.items.length) {\n // if nested mark with remaining points, update instead\n o = mark.items[0];\n if (o._svg) this._update(mdef, o._svg, o);\n } else if (item._svg) {\n // otherwise remove from DOM\n o = item._svg.parentNode;\n if (o) o.removeChild(item._svg);\n }\n item._svg = null;\n continue;\n }\n item = mdef.nested ? mark.items[0] : item;\n if (item._update === id) continue; // already visited\n\n if (!item._svg || !item._svg.ownerSVGElement) {\n // ENTER\n this._dirtyAll = false;\n dirtyParents(item, id);\n } else {\n // IN-PLACE UPDATE\n this._update(mdef, item._svg, item);\n }\n item._update = id;\n }\n return !this._dirtyAll;\n }\n\n // -- Construct & maintain scenegraph to SVG mapping ---\n\n /**\n * Render a set of mark items.\n * @param {SVGElement} el - The parent element in the SVG tree.\n * @param {object} scene - The mark parent to render.\n * @param {SVGElement} prev - The previous sibling in the SVG tree.\n * @param {Array} markTypes - Array of the mark types to render.\n * If undefined, render all mark types\n */\n mark(el, scene, prev, markTypes) {\n if (!this.isDirty(scene)) {\n return scene._svg;\n }\n const svg = this._svg,\n markType = scene.marktype,\n mdef = Marks[markType],\n events = scene.interactive === false ? 'none' : null,\n isGroup = mdef.tag === 'g';\n const parent = bind(scene, el, prev, 'g', svg);\n if (markType !== 'group' && markTypes != null && !markTypes.includes(markType)) {\n domClear(parent, 0);\n return scene._svg;\n }\n parent.setAttribute('class', cssClass(scene));\n\n // apply aria attributes to parent container element\n const aria = ariaMarkAttributes(scene);\n for (const key in aria) setAttribute(parent, key, aria[key]);\n if (!isGroup) {\n setAttribute(parent, 'pointer-events', events);\n }\n setAttribute(parent, 'clip-path', scene.clip ? clip$1(this, scene, scene.group) : null);\n let sibling = null,\n i = 0;\n const process = item => {\n const dirty = this.isDirty(item),\n node = bind(item, parent, sibling, mdef.tag, svg);\n if (dirty) {\n this._update(mdef, node, item);\n if (isGroup) recurse(this, node, item, markTypes);\n }\n sibling = node;\n ++i;\n };\n if (mdef.nested) {\n if (scene.items.length) process(scene.items[0]);\n } else {\n visit(scene, process);\n }\n domClear(parent, i);\n return parent;\n }\n\n /**\n * Update the attributes of an SVG element for a mark item.\n * @param {object} mdef - The mark definition object\n * @param {SVGElement} el - The SVG element.\n * @param {Item} item - The mark item.\n */\n _update(mdef, el, item) {\n // set dom element and values cache\n // provides access to emit method\n element = el;\n values = el.__values__;\n\n // apply aria-specific properties\n ariaItemAttributes(emit, item);\n\n // apply svg attributes\n mdef.attr(emit, item, this);\n\n // some marks need special treatment\n const extra = mark_extras[mdef.type];\n if (extra) extra.call(this, mdef, el, item);\n\n // apply svg style attributes\n // note: element state may have been modified by 'extra' method\n if (element) this.style(element, item);\n }\n\n /**\n * Update the presentation attributes of an SVG element for a mark item.\n * @param {SVGElement} el - The SVG element.\n * @param {Item} item - The mark item.\n */\n style(el, item) {\n if (item == null) return;\n for (const prop in stylesAttr) {\n let value = prop === 'font' ? fontFamily(item) : item[prop];\n if (value === values[prop]) continue;\n const name = stylesAttr[prop];\n if (value == null) {\n el.removeAttribute(name);\n } else {\n if (isGradient(value)) {\n value = gradientRef(value, this._defs.gradient, href());\n }\n el.setAttribute(name, value + '');\n }\n values[prop] = value;\n }\n for (const prop in stylesCss) {\n setStyle(el, stylesCss[prop], item[prop]);\n }\n }\n\n /**\n * Render SVG defs, as needed.\n * Must be called *after* marks have been processed to ensure the\n * collected state is current and accurate.\n */\n defs() {\n const svg = this._svg,\n defs = this._defs;\n let el = defs.el,\n index = 0;\n for (const id in defs.gradient) {\n if (!el) defs.el = el = domChild(svg, RootIndex + 1, 'defs', svgns);\n index = updateGradient(el, defs.gradient[id], index);\n }\n for (const id in defs.clipping) {\n if (!el) defs.el = el = domChild(svg, RootIndex + 1, 'defs', svgns);\n index = updateClipping(el, defs.clipping[id], index);\n }\n\n // clean-up\n if (el) {\n index === 0 ? (svg.removeChild(el), defs.el = null) : domClear(el, index);\n }\n }\n\n /**\n * Clear defs caches.\n */\n _clearDefs() {\n const def = this._defs;\n def.gradient = {};\n def.clipping = {};\n }\n}\n\n// mark ancestor chain with a dirty id\nfunction dirtyParents(item, id) {\n for (; item && item.dirty !== id; item = item.mark.group) {\n item.dirty = id;\n if (item.mark && item.mark.dirty !== id) {\n item.mark.dirty = id;\n } else return;\n }\n}\n\n// update gradient definitions\nfunction updateGradient(el, grad, index) {\n let i, n, stop;\n if (grad.gradient === 'radial') {\n // SVG radial gradients automatically transform to normalized bbox\n // coordinates, in a way that is cumbersome to replicate in canvas.\n // We wrap the radial gradient in a pattern element, allowing us to\n // maintain a circular gradient that matches what canvas provides.\n let pt = domChild(el, index++, 'pattern', svgns);\n setAttributes(pt, {\n id: patternPrefix + grad.id,\n viewBox: '0,0,1,1',\n width: '100%',\n height: '100%',\n preserveAspectRatio: 'xMidYMid slice'\n });\n pt = domChild(pt, 0, 'rect', svgns);\n setAttributes(pt, {\n width: 1,\n height: 1,\n fill: `url(${href()}#${grad.id})`\n });\n el = domChild(el, index++, 'radialGradient', svgns);\n setAttributes(el, {\n id: grad.id,\n fx: grad.x1,\n fy: grad.y1,\n fr: grad.r1,\n cx: grad.x2,\n cy: grad.y2,\n r: grad.r2\n });\n } else {\n el = domChild(el, index++, 'linearGradient', svgns);\n setAttributes(el, {\n id: grad.id,\n x1: grad.x1,\n x2: grad.x2,\n y1: grad.y1,\n y2: grad.y2\n });\n }\n for (i = 0, n = grad.stops.length; i < n; ++i) {\n stop = domChild(el, i, 'stop', svgns);\n stop.setAttribute('offset', grad.stops[i].offset);\n stop.setAttribute('stop-color', grad.stops[i].color);\n }\n domClear(el, i);\n return index;\n}\n\n// update clipping path definitions\nfunction updateClipping(el, clip, index) {\n let mask;\n el = domChild(el, index, 'clipPath', svgns);\n el.setAttribute('id', clip.id);\n if (clip.path) {\n mask = domChild(el, 0, 'path', svgns);\n mask.setAttribute('d', clip.path);\n } else {\n mask = domChild(el, 0, 'rect', svgns);\n setAttributes(mask, {\n x: 0,\n y: 0,\n width: clip.width,\n height: clip.height\n });\n }\n domClear(el, 1);\n return index + 1;\n}\n\n// Recursively process group contents.\nfunction recurse(renderer, el, group, markTypes) {\n // child 'g' element is second to last among children (path, g, path)\n // other children here are foreground and background path elements\n el = el.lastChild.previousSibling;\n let prev,\n idx = 0;\n visit(group, item => {\n prev = renderer.mark(el, item, prev, markTypes);\n ++idx;\n });\n\n // remove any extraneous DOM elements\n domClear(el, 1 + idx);\n}\n\n// Bind a scenegraph item to an SVG DOM element.\n// Create new SVG elements as needed.\nfunction bind(item, el, sibling, tag, svg) {\n let node = item._svg,\n doc;\n\n // create a new dom node if needed\n if (!node) {\n doc = el.ownerDocument;\n node = domCreate(doc, tag, svgns);\n item._svg = node;\n if (item.mark) {\n node.__data__ = item;\n node.__values__ = {\n fill: 'default'\n };\n\n // if group, create background, content, and foreground elements\n if (tag === 'g') {\n const bg = domCreate(doc, 'path', svgns);\n node.appendChild(bg);\n bg.__data__ = item;\n const cg = domCreate(doc, 'g', svgns);\n node.appendChild(cg);\n cg.__data__ = item;\n const fg = domCreate(doc, 'path', svgns);\n node.appendChild(fg);\n fg.__data__ = item;\n fg.__values__ = {\n fill: 'default'\n };\n }\n }\n }\n\n // (re-)insert if (a) not contained in SVG or (b) sibling order has changed\n if (node.ownerSVGElement !== svg || siblingCheck(node, sibling)) {\n el.insertBefore(node, sibling ? sibling.nextSibling : el.firstChild);\n }\n return node;\n}\n\n// check if two nodes are ordered siblings\nfunction siblingCheck(node, sibling) {\n return node.parentNode && node.parentNode.childNodes.length > 1 && node.previousSibling != sibling; // treat null/undefined the same\n}\n\n// -- Set attributes & styles on SVG elements ---\n\nlet element = null,\n // temp var for current SVG element\n values = null; // temp var for current values hash\n\n// Extra configuration for certain mark types\nconst mark_extras = {\n group(mdef, el, item) {\n const fg = element = el.childNodes[2];\n values = fg.__values__;\n mdef.foreground(emit, item, this);\n values = el.__values__; // use parent's values hash\n element = el.childNodes[1];\n mdef.content(emit, item, this);\n const bg = element = el.childNodes[0];\n mdef.background(emit, item, this);\n const value = item.mark.interactive === false ? 'none' : null;\n if (value !== values.events) {\n setAttribute(fg, 'pointer-events', value);\n setAttribute(bg, 'pointer-events', value);\n values.events = value;\n }\n if (item.strokeForeground && item.stroke) {\n const fill = item.fill;\n setAttribute(fg, 'display', null);\n\n // set style of background\n this.style(bg, item);\n setAttribute(bg, 'stroke', null);\n\n // set style of foreground\n if (fill) item.fill = null;\n values = fg.__values__;\n this.style(fg, item);\n if (fill) item.fill = fill;\n\n // leave element null to prevent downstream styling\n element = null;\n } else {\n // ensure foreground is ignored\n setAttribute(fg, 'display', 'none');\n }\n },\n image(mdef, el, item) {\n if (item.smooth === false) {\n setStyle(el, 'image-rendering', 'optimizeSpeed');\n setStyle(el, 'image-rendering', 'pixelated');\n } else {\n setStyle(el, 'image-rendering', null);\n }\n },\n text(mdef, el, item) {\n const tl = textLines(item);\n let key, value, doc, lh;\n if (isArray(tl)) {\n // multi-line text\n value = tl.map(_ => textValue(item, _));\n key = value.join('\\n'); // content cache key\n\n if (key !== values.text) {\n domClear(el, 0);\n doc = el.ownerDocument;\n lh = lineHeight(item);\n value.forEach((t, i) => {\n const ts = domCreate(doc, 'tspan', svgns);\n ts.__data__ = item; // data binding\n ts.textContent = t;\n if (i) {\n ts.setAttribute('x', 0);\n ts.setAttribute('dy', lh);\n }\n el.appendChild(ts);\n });\n values.text = key;\n }\n } else {\n // single-line text\n value = textValue(item, tl);\n if (value !== values.text) {\n el.textContent = value;\n values.text = value;\n }\n }\n setAttribute(el, 'font-family', fontFamily(item));\n setAttribute(el, 'font-size', fontSize(item) + 'px');\n setAttribute(el, 'font-style', item.fontStyle);\n setAttribute(el, 'font-variant', item.fontVariant);\n setAttribute(el, 'font-weight', item.fontWeight);\n }\n};\nfunction emit(name, value, ns) {\n // early exit if value is unchanged\n if (value === values[name]) return;\n\n // use appropriate method given namespace (ns)\n if (ns) {\n setAttributeNS(element, name, value, ns);\n } else {\n setAttribute(element, name, value);\n }\n\n // note current value for future comparison\n values[name] = value;\n}\nfunction setStyle(el, name, value) {\n if (value !== values[name]) {\n if (value == null) {\n el.style.removeProperty(name);\n } else {\n el.style.setProperty(name, value + '');\n }\n values[name] = value;\n }\n}\nfunction setAttributes(el, attrs) {\n for (const key in attrs) {\n setAttribute(el, key, attrs[key]);\n }\n}\nfunction setAttribute(el, name, value) {\n if (value != null) {\n // if value is provided, update DOM attribute\n el.setAttribute(name, value);\n } else {\n // else remove DOM attribute\n el.removeAttribute(name);\n }\n}\nfunction setAttributeNS(el, name, value, ns) {\n if (value != null) {\n // if value is provided, update DOM attribute\n el.setAttributeNS(ns, name, value);\n } else {\n // else remove DOM attribute\n el.removeAttributeNS(ns, name);\n }\n}\nfunction href() {\n let loc;\n return typeof window === 'undefined' ? '' : (loc = window.location).hash ? loc.href.slice(0, -loc.hash.length) : loc.href;\n}\n\nclass SVGStringRenderer extends Renderer {\n constructor(loader) {\n super(loader);\n this._text = null;\n this._defs = {\n gradient: {},\n clipping: {}\n };\n }\n\n /**\n * Returns the rendered SVG text string,\n * or null if rendering has not yet occurred.\n */\n svg() {\n return this._text;\n }\n\n /**\n * Internal rendering method.\n * @param {object} scene - The root mark of a scenegraph to render.\n */\n _render(scene) {\n const m = markup();\n\n // svg tag\n m.open('svg', extend({}, metadata, {\n class: 'marks',\n width: this._width * this._scale,\n height: this._height * this._scale,\n viewBox: `0 0 ${this._width} ${this._height}`\n }));\n\n // background, if defined\n const bg = this._bgcolor;\n if (bg && bg !== 'transparent' && bg !== 'none') {\n m.open('rect', {\n width: this._width,\n height: this._height,\n fill: bg\n }).close();\n }\n\n // root content group\n m.open('g', rootAttributes, {\n transform: 'translate(' + this._origin + ')'\n });\n this.mark(m, scene);\n m.close(); // \n\n // defs\n this.defs(m);\n\n // get SVG text string\n this._text = m.close() + '';\n return this;\n }\n\n /**\n * Render a set of mark items.\n * @param {object} m - The markup context.\n * @param {object} scene - The mark parent to render.\n */\n mark(m, scene) {\n const mdef = Marks[scene.marktype],\n tag = mdef.tag,\n attrList = [ariaItemAttributes, mdef.attr];\n\n // render opening group tag\n m.open('g', {\n 'class': cssClass(scene),\n 'clip-path': scene.clip ? clip$1(this, scene, scene.group) : null\n }, ariaMarkAttributes(scene), {\n 'pointer-events': tag !== 'g' && scene.interactive === false ? 'none' : null\n });\n\n // render contained elements\n const process = item => {\n const href = this.href(item);\n if (href) m.open('a', href);\n m.open(tag, this.attr(scene, item, attrList, tag !== 'g' ? tag : null));\n if (tag === 'text') {\n const tl = textLines(item);\n if (isArray(tl)) {\n // multi-line text\n const attrs = {\n x: 0,\n dy: lineHeight(item)\n };\n for (let i = 0; i < tl.length; ++i) {\n m.open('tspan', i ? attrs : null).text(textValue(item, tl[i])).close();\n }\n } else {\n // single-line text\n m.text(textValue(item, tl));\n }\n } else if (tag === 'g') {\n const fore = item.strokeForeground,\n fill = item.fill,\n stroke = item.stroke;\n if (fore && stroke) {\n item.stroke = null;\n }\n m.open('path', this.attr(scene, item, mdef.background, 'bgrect')).close();\n\n // recurse for group content\n m.open('g', this.attr(scene, item, mdef.content));\n visit(item, scene => this.mark(m, scene));\n m.close();\n if (fore && stroke) {\n if (fill) item.fill = null;\n item.stroke = stroke;\n m.open('path', this.attr(scene, item, mdef.foreground, 'bgrect')).close();\n if (fill) item.fill = fill;\n } else {\n m.open('path', this.attr(scene, item, mdef.foreground, 'bgfore')).close();\n }\n }\n m.close(); // \n if (href) m.close(); // \n };\n if (mdef.nested) {\n if (scene.items && scene.items.length) process(scene.items[0]);\n } else {\n visit(scene, process);\n }\n\n // render closing group tag\n return m.close(); // \n }\n\n /**\n * Get href attributes for a hyperlinked mark item.\n * @param {Item} item - The mark item.\n */\n href(item) {\n const href = item.href;\n let attr;\n if (href) {\n if (attr = this._hrefs && this._hrefs[href]) {\n return attr;\n } else {\n this.sanitizeURL(href).then(attr => {\n // rewrite to use xlink namespace\n attr['xlink:href'] = attr.href;\n attr.href = null;\n (this._hrefs || (this._hrefs = {}))[href] = attr;\n });\n }\n }\n return null;\n }\n\n /**\n * Get an object of SVG attributes for a mark item.\n * @param {object} scene - The mark parent.\n * @param {Item} item - The mark item.\n * @param {array|function} attrs - One or more attribute emitters.\n * @param {string} tag - The tag being rendered.\n */\n attr(scene, item, attrs, tag) {\n const object = {},\n emit = (name, value, ns, prefixed) => {\n object[prefixed || name] = value;\n };\n\n // apply mark specific attributes\n if (Array.isArray(attrs)) {\n attrs.forEach(fn => fn(emit, item, this));\n } else {\n attrs(emit, item, this);\n }\n\n // apply style attributes\n if (tag) {\n style(object, item, scene, tag, this._defs);\n }\n return object;\n }\n\n /**\n * Render SVG defs, as needed.\n * Must be called *after* marks have been processed to ensure the\n * collected state is current and accurate.\n * @param {object} m - The markup context.\n */\n defs(m) {\n const gradient = this._defs.gradient,\n clipping = this._defs.clipping,\n count = Object.keys(gradient).length + Object.keys(clipping).length;\n if (count === 0) return; // nothing to do\n\n m.open('defs');\n for (const id in gradient) {\n const def = gradient[id],\n stops = def.stops;\n if (def.gradient === 'radial') {\n // SVG radial gradients automatically transform to normalized bbox\n // coordinates, in a way that is cumbersome to replicate in canvas.\n // We wrap the radial gradient in a pattern element, allowing us to\n // maintain a circular gradient that matches what canvas provides.\n\n m.open('pattern', {\n id: patternPrefix + id,\n viewBox: '0,0,1,1',\n width: '100%',\n height: '100%',\n preserveAspectRatio: 'xMidYMid slice'\n });\n m.open('rect', {\n width: '1',\n height: '1',\n fill: 'url(#' + id + ')'\n }).close();\n m.close(); // \n\n m.open('radialGradient', {\n id: id,\n fx: def.x1,\n fy: def.y1,\n fr: def.r1,\n cx: def.x2,\n cy: def.y2,\n r: def.r2\n });\n } else {\n m.open('linearGradient', {\n id: id,\n x1: def.x1,\n x2: def.x2,\n y1: def.y1,\n y2: def.y2\n });\n }\n for (let i = 0; i < stops.length; ++i) {\n m.open('stop', {\n offset: stops[i].offset,\n 'stop-color': stops[i].color\n }).close();\n }\n m.close();\n }\n for (const id in clipping) {\n const def = clipping[id];\n m.open('clipPath', {\n id: id\n });\n if (def.path) {\n m.open('path', {\n d: def.path\n }).close();\n } else {\n m.open('rect', {\n x: 0,\n y: 0,\n width: def.width,\n height: def.height\n }).close();\n }\n m.close();\n }\n m.close();\n }\n}\n\n// Helper function for attr for style presentation attributes\nfunction style(s, item, scene, tag, defs) {\n let styleList;\n if (item == null) return s;\n if (tag === 'bgrect' && scene.interactive === false) {\n s['pointer-events'] = 'none';\n }\n if (tag === 'bgfore') {\n if (scene.interactive === false) {\n s['pointer-events'] = 'none';\n }\n s.display = 'none';\n if (item.fill !== null) return s;\n }\n if (tag === 'image' && item.smooth === false) {\n styleList = ['image-rendering: optimizeSpeed;', 'image-rendering: pixelated;'];\n }\n if (tag === 'text') {\n s['font-family'] = fontFamily(item);\n s['font-size'] = fontSize(item) + 'px';\n s['font-style'] = item.fontStyle;\n s['font-variant'] = item.fontVariant;\n s['font-weight'] = item.fontWeight;\n }\n for (const prop in stylesAttr) {\n let value = item[prop];\n const name = stylesAttr[prop];\n if (value === 'transparent' && (name === 'fill' || name === 'stroke')) ; else if (value != null) {\n if (isGradient(value)) {\n value = gradientRef(value, defs.gradient, '');\n }\n s[name] = value;\n }\n }\n for (const prop in stylesCss) {\n const value = item[prop];\n if (value != null) {\n styleList = styleList || [];\n styleList.push(`${stylesCss[prop]}: ${value};`);\n }\n }\n if (styleList) {\n s.style = styleList.join(' ');\n }\n return s;\n}\n\n/**\n * @typedef {Object} HybridRendererOptions\n *\n * @property {string[]} [svgMarkTypes=['text']] - An array of SVG mark types to render\n * in the SVG layer. All other mark types\n * will be rendered in the Canvas layer.\n * @property {boolean} [svgOnTop=true] - Flag to determine if SVG should be rendered on top.\n * @property {boolean} [debug=false] - Flag to enable or disable debugging mode. When true,\n * the top layer will be stacked below the bottom layer\n * rather than overlaid on top.\n */\n\n/** @type {HybridRendererOptions} */\nconst OPTS = {\n svgMarkTypes: ['text'],\n svgOnTop: true,\n debug: false\n};\n\n/**\n * Configure the HybridRenderer\n *\n * @param {HybridRendererOptions} options - HybridRenderer configuration options.\n */\nfunction setHybridRendererOptions(options) {\n OPTS['svgMarkTypes'] = options.svgMarkTypes ?? ['text'];\n OPTS['svgOnTop'] = options.svgOnTop ?? true;\n OPTS['debug'] = options.debug ?? false;\n}\nclass HybridRenderer extends Renderer {\n constructor(loader) {\n super(loader);\n this._svgRenderer = new SVGRenderer(loader);\n this._canvasRenderer = new CanvasRenderer(loader);\n }\n\n /**\n * Initialize a new HybridRenderer instance.\n * @param {DOMElement} el - The containing DOM element for the display.\n * @param {number} width - The coordinate width of the display, in pixels.\n * @param {number} height - The coordinate height of the display, in pixels.\n * @param {Array} origin - The origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {HybridRenderer} - This renderer instance.\n */\n initialize(el, width, height, origin, scaleFactor) {\n this._root_el = domChild(el, 0, 'div');\n const bottomEl = domChild(this._root_el, 0, 'div');\n const topEl = domChild(this._root_el, 1, 'div');\n this._root_el.style.position = 'relative';\n\n // Set position absolute to overlay svg on top of canvas\n if (!OPTS.debug) {\n bottomEl.style.height = '100%';\n topEl.style.position = 'absolute';\n topEl.style.top = '0';\n topEl.style.left = '0';\n topEl.style.height = '100%';\n topEl.style.width = '100%';\n }\n this._svgEl = OPTS.svgOnTop ? topEl : bottomEl;\n this._canvasEl = OPTS.svgOnTop ? bottomEl : topEl;\n\n // pointer-events to none on SVG layer so that canvas gets all events\n this._svgEl.style.pointerEvents = 'none';\n this._canvasRenderer.initialize(this._canvasEl, width, height, origin, scaleFactor);\n this._svgRenderer.initialize(this._svgEl, width, height, origin, scaleFactor);\n return super.initialize(el, width, height, origin, scaleFactor);\n }\n\n /**\n * Flag a mark item as dirty.\n * @param {Item} item - The mark item.\n */\n dirty(item) {\n if (OPTS.svgMarkTypes.includes(item.mark.marktype)) {\n this._svgRenderer.dirty(item);\n } else {\n this._canvasRenderer.dirty(item);\n }\n return this;\n }\n\n /**\n * Internal rendering method.\n * @param {object} scene - The root mark of a scenegraph to render.\n * @param {Array} markTypes - Array of the mark types to render.\n * If undefined, render all mark types\n */\n _render(scene, markTypes) {\n const allMarkTypes = markTypes ?? ['arc', 'area', 'image', 'line', 'path', 'rect', 'rule', 'shape', 'symbol', 'text', 'trail'];\n const canvasMarkTypes = allMarkTypes.filter(m => !OPTS.svgMarkTypes.includes(m));\n this._svgRenderer.render(scene, OPTS.svgMarkTypes);\n this._canvasRenderer.render(scene, canvasMarkTypes);\n }\n\n /**\n * Resize the display.\n * @param {number} width - The new coordinate width of the display, in pixels.\n * @param {number} height - The new coordinate height of the display, in pixels.\n * @param {Array} origin - The new origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {SVGRenderer} - This renderer instance;\n */\n resize(width, height, origin, scaleFactor) {\n super.resize(width, height, origin, scaleFactor);\n this._svgRenderer.resize(width, height, origin, scaleFactor);\n this._canvasRenderer.resize(width, height, origin, scaleFactor);\n return this;\n }\n background(bgcolor) {\n // Propagate background color to lower canvas renderer\n if (OPTS.svgOnTop) {\n this._canvasRenderer.background(bgcolor);\n } else {\n this._svgRenderer.background(bgcolor);\n }\n return this;\n }\n}\n\nclass HybridHandler extends CanvasHandler {\n constructor(loader, tooltip) {\n super(loader, tooltip);\n }\n initialize(el, origin, obj) {\n const canvas = domChild(domChild(el, 0, 'div'), OPTS.svgOnTop ? 0 : 1, 'div');\n return super.initialize(canvas, origin, obj);\n }\n}\n\nconst Canvas = 'canvas';\nconst Hybrid = 'hybrid';\nconst PNG = 'png';\nconst SVG = 'svg';\nconst None = 'none';\nconst RenderType = {\n Canvas: Canvas,\n PNG: PNG,\n SVG: SVG,\n Hybrid: Hybrid,\n None: None\n};\nconst modules = {};\nmodules[Canvas] = modules[PNG] = {\n renderer: CanvasRenderer,\n headless: CanvasRenderer,\n handler: CanvasHandler\n};\nmodules[SVG] = {\n renderer: SVGRenderer,\n headless: SVGStringRenderer,\n handler: SVGHandler\n};\nmodules[Hybrid] = {\n renderer: HybridRenderer,\n headless: HybridRenderer,\n handler: HybridHandler\n};\nmodules[None] = {};\nfunction renderModule(name, _) {\n name = String(name || '').toLowerCase();\n if (arguments.length > 1) {\n modules[name] = _;\n return this;\n } else {\n return modules[name];\n }\n}\n\nfunction intersect(scene, bounds, filter) {\n const hits = [],\n // intersection results\n box = new Bounds().union(bounds),\n // defensive copy\n type = scene.marktype;\n return type ? intersectMark(scene, box, filter, hits) : type === 'group' ? intersectGroup(scene, box, filter, hits) : error('Intersect scene must be mark node or group item.');\n}\nfunction intersectMark(mark, box, filter, hits) {\n if (visitMark(mark, box, filter)) {\n const items = mark.items,\n type = mark.marktype,\n n = items.length;\n let i = 0;\n if (type === 'group') {\n for (; i < n; ++i) {\n intersectGroup(items[i], box, filter, hits);\n }\n } else {\n for (const test = Marks[type].isect; i < n; ++i) {\n const item = items[i];\n if (intersectItem(item, box, test)) hits.push(item);\n }\n }\n }\n return hits;\n}\nfunction visitMark(mark, box, filter) {\n // process if bounds intersect and if\n // (1) mark is a group mark (so we must recurse), or\n // (2) mark is interactive and passes filter\n return mark.bounds && box.intersects(mark.bounds) && (mark.marktype === 'group' || mark.interactive !== false && (!filter || filter(mark)));\n}\nfunction intersectGroup(group, box, filter, hits) {\n // test intersect against group\n // skip groups by default unless filter says otherwise\n if (filter && filter(group.mark) && intersectItem(group, box, Marks.group.isect)) {\n hits.push(group);\n }\n\n // recursively test children marks\n // translate box to group coordinate space\n const marks = group.items,\n n = marks && marks.length;\n if (n) {\n const x = group.x || 0,\n y = group.y || 0;\n box.translate(-x, -y);\n for (let i = 0; i < n; ++i) {\n intersectMark(marks[i], box, filter, hits);\n }\n box.translate(x, y);\n }\n return hits;\n}\nfunction intersectItem(item, box, test) {\n // test bounds enclosure, bounds intersection, then detailed test\n const bounds = item.bounds;\n return box.encloses(bounds) || box.intersects(bounds) && test(item, box);\n}\n\nconst clipBounds = new Bounds();\nfunction boundClip (mark) {\n const clip = mark.clip;\n if (isFunction(clip)) {\n clip(boundContext(clipBounds.clear()));\n } else if (clip) {\n clipBounds.set(0, 0, mark.group.width, mark.group.height);\n } else return;\n mark.bounds.intersect(clipBounds);\n}\n\nconst TOLERANCE = 1e-9;\nfunction sceneEqual(a, b, key) {\n return a === b ? true : key === 'path' ? pathEqual(a, b) : a instanceof Date && b instanceof Date ? +a === +b : isNumber(a) && isNumber(b) ? Math.abs(a - b) <= TOLERANCE : !a || !b || !isObject(a) && !isObject(b) ? a == b : objectEqual(a, b);\n}\nfunction pathEqual(a, b) {\n return sceneEqual(parse(a), parse(b));\n}\nfunction objectEqual(a, b) {\n var ka = Object.keys(a),\n kb = Object.keys(b),\n key,\n i;\n if (ka.length !== kb.length) return false;\n ka.sort();\n kb.sort();\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i]) return false;\n }\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!sceneEqual(a[key], b[key], key)) return false;\n }\n return typeof a === typeof b;\n}\n\nfunction resetSVGDefIds() {\n resetSVGClipId();\n resetSVGGradientId();\n}\n\nexport { Bounds, CanvasHandler, CanvasRenderer, Gradient, GroupItem, Handler, HybridHandler, HybridRenderer, Item, Marks, RenderType, Renderer, ResourceLoader, SVGHandler, SVGRenderer, SVGStringRenderer, Scenegraph, boundClip, boundContext, boundItem, boundMark, boundStroke, domChild, domClear, domCreate, domFind, font, fontFamily, fontSize, intersect, intersectBoxLine, intersectPath, intersectPoint, intersectRule, lineHeight, markup, multiLineOffset, curves as pathCurves, pathEqual, parse as pathParse, vg_rect as pathRectangle, pathRender, symbols as pathSymbols, vg_trail as pathTrail, point, renderModule, resetSVGClipId, resetSVGDefIds, sceneEqual, sceneFromJSON, pickVisit as scenePickVisit, sceneToJSON, visit as sceneVisit, zorder as sceneZOrder, serializeXML, setHybridRendererOptions, textMetrics };\n","import constant from \"./constant.js\";\nimport {withPath} from \"./path.js\";\nimport asterisk from \"./symbol/asterisk.js\";\nimport circle from \"./symbol/circle.js\";\nimport cross from \"./symbol/cross.js\";\nimport diamond from \"./symbol/diamond.js\";\nimport diamond2 from \"./symbol/diamond2.js\";\nimport plus from \"./symbol/plus.js\";\nimport square from \"./symbol/square.js\";\nimport square2 from \"./symbol/square2.js\";\nimport star from \"./symbol/star.js\";\nimport triangle from \"./symbol/triangle.js\";\nimport triangle2 from \"./symbol/triangle2.js\";\nimport wye from \"./symbol/wye.js\";\nimport times from \"./symbol/times.js\";\n\n// These symbols are designed to be filled.\nexport const symbolsFill = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\n// These symbols are designed to be stroked (with a width of 1.5px and round caps).\nexport const symbolsStroke = [\n circle,\n plus,\n times,\n triangle2,\n asterisk,\n square2,\n diamond2\n];\n\nexport default function Symbol(type, size) {\n let context = null,\n path = withPath(symbol);\n\n type = typeof type === \"function\" ? type : constant(type || circle);\n size = typeof size === \"function\" ? size : constant(size === undefined ? 64 : +size);\n\n function symbol() {\n let buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n","import { Transform } from 'vega-dataflow';\nimport { Marks, boundClip, GroupItem, Item, Bounds, multiLineOffset, boundStroke } from 'vega-scenegraph';\nimport { inherits, peek, isObject } from 'vega-util';\n\nconst Top = 'top';\nconst Left = 'left';\nconst Right = 'right';\nconst Bottom = 'bottom';\nconst TopLeft = 'top-left';\nconst TopRight = 'top-right';\nconst BottomLeft = 'bottom-left';\nconst BottomRight = 'bottom-right';\nconst Start = 'start';\nconst Middle = 'middle';\nconst End = 'end';\nconst X = 'x';\nconst Y = 'y';\nconst Group = 'group';\nconst AxisRole = 'axis';\nconst TitleRole = 'title';\nconst FrameRole = 'frame';\nconst ScopeRole = 'scope';\nconst LegendRole = 'legend';\nconst RowHeader = 'row-header';\nconst RowFooter = 'row-footer';\nconst RowTitle = 'row-title';\nconst ColHeader = 'column-header';\nconst ColFooter = 'column-footer';\nconst ColTitle = 'column-title';\nconst Padding = 'padding';\nconst Symbols = 'symbol';\nconst Fit = 'fit';\nconst FitX = 'fit-x';\nconst FitY = 'fit-y';\nconst Pad = 'pad';\nconst None = 'none';\nconst All = 'all';\nconst Each = 'each';\nconst Flush = 'flush';\nconst Column = 'column';\nconst Row = 'row';\n\n/**\n * Calculate bounding boxes for scenegraph items.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.mark - The scenegraph mark instance to bound.\n */\nfunction Bound(params) {\n Transform.call(this, null, params);\n}\ninherits(Bound, Transform, {\n transform(_, pulse) {\n const view = pulse.dataflow,\n mark = _.mark,\n type = mark.marktype,\n entry = Marks[type],\n bound = entry.bound;\n let markBounds = mark.bounds,\n rebound;\n if (entry.nested) {\n // multi-item marks have a single bounds instance\n if (mark.items.length) view.dirty(mark.items[0]);\n markBounds = boundItem(mark, bound);\n mark.items.forEach(item => {\n item.bounds.clear().union(markBounds);\n });\n } else if (type === Group || _.modified()) {\n // operator parameters modified -> re-bound all items\n // updates group bounds in response to modified group content\n pulse.visit(pulse.MOD, item => view.dirty(item));\n markBounds.clear();\n mark.items.forEach(item => markBounds.union(boundItem(item, bound)));\n\n // force reflow for axes/legends/titles to propagate any layout changes\n switch (mark.role) {\n case AxisRole:\n case LegendRole:\n case TitleRole:\n pulse.reflow();\n }\n } else {\n // incrementally update bounds, re-bound mark as needed\n rebound = pulse.changed(pulse.REM);\n pulse.visit(pulse.ADD, item => {\n markBounds.union(boundItem(item, bound));\n });\n pulse.visit(pulse.MOD, item => {\n rebound = rebound || markBounds.alignsWith(item.bounds);\n view.dirty(item);\n markBounds.union(boundItem(item, bound));\n });\n if (rebound) {\n markBounds.clear();\n mark.items.forEach(item => markBounds.union(item.bounds));\n }\n }\n\n // ensure mark bounds do not exceed any clipping region\n boundClip(mark);\n return pulse.modifies('bounds');\n }\n});\nfunction boundItem(item, bound, opt) {\n return bound(item.bounds.clear(), item, opt);\n}\n\nconst COUNTER_NAME = ':vega_identifier:';\n\n/**\n * Adds a unique identifier to all added tuples.\n * This transform creates a new signal that serves as an id counter.\n * As a result, the id counter is shared across all instances of this\n * transform, generating unique ids across multiple data streams. In\n * addition, this signal value can be included in a snapshot of the\n * dataflow state, enabling correct resumption of id allocation.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {string} params.as - The field name for the generated identifier.\n */\nfunction Identifier(params) {\n Transform.call(this, 0, params);\n}\nIdentifier.Definition = {\n 'type': 'Identifier',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'as',\n 'type': 'string',\n 'required': true\n }]\n};\ninherits(Identifier, Transform, {\n transform(_, pulse) {\n const counter = getCounter(pulse.dataflow),\n as = _.as;\n let id = counter.value;\n pulse.visit(pulse.ADD, t => t[as] = t[as] || ++id);\n counter.set(this.value = id);\n return pulse;\n }\n});\nfunction getCounter(view) {\n return view._signals[COUNTER_NAME] || (view._signals[COUNTER_NAME] = view.add(0));\n}\n\n/**\n * Bind scenegraph items to a scenegraph mark instance.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.markdef - The mark definition for creating the mark.\n * This is an object of legal scenegraph mark properties which *must* include\n * the 'marktype' property.\n */\nfunction Mark(params) {\n Transform.call(this, null, params);\n}\ninherits(Mark, Transform, {\n transform(_, pulse) {\n let mark = this.value;\n\n // acquire mark on first invocation, bind context and group\n if (!mark) {\n mark = pulse.dataflow.scenegraph().mark(_.markdef, lookup$1(_), _.index);\n mark.group.context = _.context;\n if (!_.context.group) _.context.group = mark.group;\n mark.source = this.source; // point to upstream collector\n mark.clip = _.clip;\n mark.interactive = _.interactive;\n this.value = mark;\n }\n\n // initialize entering items\n const Init = mark.marktype === Group ? GroupItem : Item;\n pulse.visit(pulse.ADD, item => Init.call(item, mark));\n\n // update clipping and/or interactive status\n if (_.modified('clip') || _.modified('interactive')) {\n mark.clip = _.clip;\n mark.interactive = !!_.interactive;\n mark.zdirty = true; // force scenegraph re-eval\n pulse.reflow();\n }\n\n // bind items array to scenegraph mark\n mark.items = pulse.source;\n return pulse;\n }\n});\nfunction lookup$1(_) {\n const g = _.groups,\n p = _.parent;\n return g && g.size === 1 ? g.get(Object.keys(g.object)[0]) : g && p ? g.lookup(p) : null;\n}\n\n/**\n * Analyze items for overlap, changing opacity to hide items with\n * overlapping bounding boxes. This transform will preserve at least\n * two items (e.g., first and last) even if overlap persists.\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - A comparator\n * function for sorting items.\n * @param {object} [params.method] - The overlap removal method to apply.\n * One of 'parity' (default, hide every other item until there is no\n * more overlap) or 'greedy' (sequentially scan and hide and items that\n * overlap with the last visible item).\n * @param {object} [params.boundScale] - A scale whose range should be used\n * to bound the items. Items exceeding the bounds of the scale range\n * will be treated as overlapping. If null or undefined, no bounds check\n * will be applied.\n * @param {object} [params.boundOrient] - The orientation of the scale\n * (top, bottom, left, or right) used to bound items. This parameter is\n * ignored if boundScale is null or undefined.\n * @param {object} [params.boundTolerance] - The tolerance in pixels for\n * bound inclusion testing (default 1). This specifies by how many pixels\n * an item's bounds may exceed the scale range bounds and not be culled.\n * @constructor\n */\nfunction Overlap(params) {\n Transform.call(this, null, params);\n}\nconst methods = {\n parity: items => items.filter((item, i) => i % 2 ? item.opacity = 0 : 1),\n greedy: (items, sep) => {\n let a;\n return items.filter((b, i) => !i || !intersect(a.bounds, b.bounds, sep) ? (a = b, 1) : b.opacity = 0);\n }\n};\n\n// compute bounding box intersection\n// including padding pixels of separation\nconst intersect = (a, b, sep) => sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);\nconst hasOverlap = (items, pad) => {\n for (var i = 1, n = items.length, a = items[0].bounds, b; i < n; a = b, ++i) {\n if (intersect(a, b = items[i].bounds, pad)) return true;\n }\n};\nconst hasBounds = item => {\n const b = item.bounds;\n return b.width() > 1 && b.height() > 1;\n};\nconst boundTest = (scale, orient, tolerance) => {\n var range = scale.range(),\n b = new Bounds();\n if (orient === Top || orient === Bottom) {\n b.set(range[0], -Infinity, range[1], +Infinity);\n } else {\n b.set(-Infinity, range[0], +Infinity, range[1]);\n }\n b.expand(tolerance || 1);\n return item => b.encloses(item.bounds);\n};\n\n// reset all items to be fully opaque\nconst reset = source => {\n source.forEach(item => item.opacity = 1);\n return source;\n};\n\n// add all tuples to mod, fork pulse if parameters were modified\n// fork prevents cross-stream tuple pollution (e.g., pulse from scale)\nconst reflow = (pulse, _) => pulse.reflow(_.modified()).modifies('opacity');\ninherits(Overlap, Transform, {\n transform(_, pulse) {\n const reduce = methods[_.method] || methods.parity,\n sep = _.separation || 0;\n let source = pulse.materialize(pulse.SOURCE).source,\n items,\n test;\n if (!source || !source.length) return;\n if (!_.method) {\n // early exit if method is falsy\n if (_.modified('method')) {\n reset(source);\n pulse = reflow(pulse, _);\n }\n return pulse;\n }\n\n // skip labels with no content\n source = source.filter(hasBounds);\n\n // early exit, nothing to do\n if (!source.length) return;\n if (_.sort) {\n source = source.slice().sort(_.sort);\n }\n items = reset(source);\n pulse = reflow(pulse, _);\n if (items.length >= 3 && hasOverlap(items, sep)) {\n do {\n items = reduce(items, sep);\n } while (items.length >= 3 && hasOverlap(items, sep));\n if (items.length < 3 && !peek(source).opacity) {\n if (items.length > 1) peek(items).opacity = 0;\n peek(source).opacity = 1;\n }\n }\n if (_.boundScale && _.boundTolerance >= 0) {\n test = boundTest(_.boundScale, _.boundOrient, +_.boundTolerance);\n source.forEach(item => {\n if (!test(item)) item.opacity = 0;\n });\n }\n\n // re-calculate mark bounds\n const bounds = items[0].mark.bounds.clear();\n source.forEach(item => {\n if (item.opacity) bounds.union(item.bounds);\n });\n return pulse;\n }\n});\n\n/**\n * Queue modified scenegraph items for rendering.\n * @constructor\n */\nfunction Render(params) {\n Transform.call(this, null, params);\n}\ninherits(Render, Transform, {\n transform(_, pulse) {\n const view = pulse.dataflow;\n pulse.visit(pulse.ALL, item => view.dirty(item));\n\n // set z-index dirty flag as needed\n if (pulse.fields && pulse.fields['zindex']) {\n const item = pulse.source && pulse.source[0];\n if (item) item.mark.zdirty = true;\n }\n }\n});\n\nconst tempBounds = new Bounds();\nfunction set(item, property, value) {\n return item[property] === value ? 0 : (item[property] = value, 1);\n}\n\nfunction isYAxis(mark) {\n var orient = mark.items[0].orient;\n return orient === Left || orient === Right;\n}\nfunction axisIndices(datum) {\n let index = +datum.grid;\n return [datum.ticks ? index++ : -1,\n // ticks index\n datum.labels ? index++ : -1,\n // labels index\n index + +datum.domain // title index\n ];\n}\nfunction axisLayout(view, axis, width, height) {\n var item = axis.items[0],\n datum = item.datum,\n delta = item.translate != null ? item.translate : 0.5,\n orient = item.orient,\n indices = axisIndices(datum),\n range = item.range,\n offset = item.offset,\n position = item.position,\n minExtent = item.minExtent,\n maxExtent = item.maxExtent,\n title = datum.title && item.items[indices[2]].items[0],\n titlePadding = item.titlePadding,\n bounds = item.bounds,\n dl = title && multiLineOffset(title),\n x = 0,\n y = 0,\n i,\n s;\n tempBounds.clear().union(bounds);\n bounds.clear();\n if ((i = indices[0]) > -1) bounds.union(item.items[i].bounds);\n if ((i = indices[1]) > -1) bounds.union(item.items[i].bounds);\n\n // position axis group and title\n switch (orient) {\n case Top:\n x = position || 0;\n y = -offset;\n s = Math.max(minExtent, Math.min(maxExtent, -bounds.y1));\n bounds.add(0, -s).add(range, 0);\n if (title) axisTitleLayout(view, title, s, titlePadding, dl, 0, -1, bounds);\n break;\n case Left:\n x = -offset;\n y = position || 0;\n s = Math.max(minExtent, Math.min(maxExtent, -bounds.x1));\n bounds.add(-s, 0).add(0, range);\n if (title) axisTitleLayout(view, title, s, titlePadding, dl, 1, -1, bounds);\n break;\n case Right:\n x = width + offset;\n y = position || 0;\n s = Math.max(minExtent, Math.min(maxExtent, bounds.x2));\n bounds.add(0, 0).add(s, range);\n if (title) axisTitleLayout(view, title, s, titlePadding, dl, 1, 1, bounds);\n break;\n case Bottom:\n x = position || 0;\n y = height + offset;\n s = Math.max(minExtent, Math.min(maxExtent, bounds.y2));\n bounds.add(0, 0).add(range, s);\n if (title) axisTitleLayout(view, title, s, titlePadding, 0, 0, 1, bounds);\n break;\n default:\n x = item.x;\n y = item.y;\n }\n\n // update bounds\n boundStroke(bounds.translate(x, y), item);\n if (set(item, 'x', x + delta) | set(item, 'y', y + delta)) {\n item.bounds = tempBounds;\n view.dirty(item);\n item.bounds = bounds;\n view.dirty(item);\n }\n return item.mark.bounds.clear().union(bounds);\n}\nfunction axisTitleLayout(view, title, offset, pad, dl, isYAxis, sign, bounds) {\n const b = title.bounds;\n if (title.auto) {\n const v = sign * (offset + dl + pad);\n let dx = 0,\n dy = 0;\n view.dirty(title);\n isYAxis ? dx = (title.x || 0) - (title.x = v) : dy = (title.y || 0) - (title.y = v);\n title.mark.bounds.clear().union(b.translate(-dx, -dy));\n view.dirty(title);\n }\n bounds.union(b);\n}\n\n// aggregation functions for grid margin determination\nconst min = (a, b) => Math.floor(Math.min(a, b));\nconst max = (a, b) => Math.ceil(Math.max(a, b));\nfunction gridLayoutGroups(group) {\n var groups = group.items,\n n = groups.length,\n i = 0,\n mark,\n items;\n const views = {\n marks: [],\n rowheaders: [],\n rowfooters: [],\n colheaders: [],\n colfooters: [],\n rowtitle: null,\n coltitle: null\n };\n\n // layout axes, gather legends, collect bounds\n for (; i < n; ++i) {\n mark = groups[i];\n items = mark.items;\n if (mark.marktype === Group) {\n switch (mark.role) {\n case AxisRole:\n case LegendRole:\n case TitleRole:\n break;\n case RowHeader:\n views.rowheaders.push(...items);\n break;\n case RowFooter:\n views.rowfooters.push(...items);\n break;\n case ColHeader:\n views.colheaders.push(...items);\n break;\n case ColFooter:\n views.colfooters.push(...items);\n break;\n case RowTitle:\n views.rowtitle = items[0];\n break;\n case ColTitle:\n views.coltitle = items[0];\n break;\n default:\n views.marks.push(...items);\n }\n }\n }\n return views;\n}\nfunction bboxFlush(item) {\n return new Bounds().set(0, 0, item.width || 0, item.height || 0);\n}\nfunction bboxFull(item) {\n const b = item.bounds.clone();\n return b.empty() ? b.set(0, 0, 0, 0) : b.translate(-(item.x || 0), -(item.y || 0));\n}\nfunction get(opt, key, d) {\n const v = isObject(opt) ? opt[key] : opt;\n return v != null ? v : d !== undefined ? d : 0;\n}\nfunction offsetValue(v) {\n return v < 0 ? Math.ceil(-v) : 0;\n}\nfunction gridLayout(view, groups, opt) {\n var dirty = !opt.nodirty,\n bbox = opt.bounds === Flush ? bboxFlush : bboxFull,\n bounds = tempBounds.set(0, 0, 0, 0),\n alignCol = get(opt.align, Column),\n alignRow = get(opt.align, Row),\n padCol = get(opt.padding, Column),\n padRow = get(opt.padding, Row),\n ncols = opt.columns || groups.length,\n nrows = ncols <= 0 ? 1 : Math.ceil(groups.length / ncols),\n n = groups.length,\n xOffset = Array(n),\n xExtent = Array(ncols),\n xMax = 0,\n yOffset = Array(n),\n yExtent = Array(nrows),\n yMax = 0,\n dx = Array(n),\n dy = Array(n),\n boxes = Array(n),\n m,\n i,\n c,\n r,\n b,\n g,\n px,\n py,\n x,\n y,\n offset;\n for (i = 0; i < ncols; ++i) xExtent[i] = 0;\n for (i = 0; i < nrows; ++i) yExtent[i] = 0;\n\n // determine offsets for each group\n for (i = 0; i < n; ++i) {\n g = groups[i];\n b = boxes[i] = bbox(g);\n g.x = g.x || 0;\n dx[i] = 0;\n g.y = g.y || 0;\n dy[i] = 0;\n c = i % ncols;\n r = ~~(i / ncols);\n xMax = Math.max(xMax, px = Math.ceil(b.x2));\n yMax = Math.max(yMax, py = Math.ceil(b.y2));\n xExtent[c] = Math.max(xExtent[c], px);\n yExtent[r] = Math.max(yExtent[r], py);\n xOffset[i] = padCol + offsetValue(b.x1);\n yOffset[i] = padRow + offsetValue(b.y1);\n if (dirty) view.dirty(groups[i]);\n }\n\n // set initial alignment offsets\n for (i = 0; i < n; ++i) {\n if (i % ncols === 0) xOffset[i] = 0;\n if (i < ncols) yOffset[i] = 0;\n }\n\n // enforce column alignment constraints\n if (alignCol === Each) {\n for (c = 1; c < ncols; ++c) {\n for (offset = 0, i = c; i < n; i += ncols) {\n if (offset < xOffset[i]) offset = xOffset[i];\n }\n for (i = c; i < n; i += ncols) {\n xOffset[i] = offset + xExtent[c - 1];\n }\n }\n } else if (alignCol === All) {\n for (offset = 0, i = 0; i < n; ++i) {\n if (i % ncols && offset < xOffset[i]) offset = xOffset[i];\n }\n for (i = 0; i < n; ++i) {\n if (i % ncols) xOffset[i] = offset + xMax;\n }\n } else {\n for (alignCol = false, c = 1; c < ncols; ++c) {\n for (i = c; i < n; i += ncols) {\n xOffset[i] += xExtent[c - 1];\n }\n }\n }\n\n // enforce row alignment constraints\n if (alignRow === Each) {\n for (r = 1; r < nrows; ++r) {\n for (offset = 0, i = r * ncols, m = i + ncols; i < m; ++i) {\n if (offset < yOffset[i]) offset = yOffset[i];\n }\n for (i = r * ncols; i < m; ++i) {\n yOffset[i] = offset + yExtent[r - 1];\n }\n }\n } else if (alignRow === All) {\n for (offset = 0, i = ncols; i < n; ++i) {\n if (offset < yOffset[i]) offset = yOffset[i];\n }\n for (i = ncols; i < n; ++i) {\n yOffset[i] = offset + yMax;\n }\n } else {\n for (alignRow = false, r = 1; r < nrows; ++r) {\n for (i = r * ncols, m = i + ncols; i < m; ++i) {\n yOffset[i] += yExtent[r - 1];\n }\n }\n }\n\n // perform horizontal grid layout\n for (x = 0, i = 0; i < n; ++i) {\n x = xOffset[i] + (i % ncols ? x : 0);\n dx[i] += x - groups[i].x;\n }\n\n // perform vertical grid layout\n for (c = 0; c < ncols; ++c) {\n for (y = 0, i = c; i < n; i += ncols) {\n y += yOffset[i];\n dy[i] += y - groups[i].y;\n }\n }\n\n // perform horizontal centering\n if (alignCol && get(opt.center, Column) && nrows > 1) {\n for (i = 0; i < n; ++i) {\n b = alignCol === All ? xMax : xExtent[i % ncols];\n x = b - boxes[i].x2 - groups[i].x - dx[i];\n if (x > 0) dx[i] += x / 2;\n }\n }\n\n // perform vertical centering\n if (alignRow && get(opt.center, Row) && ncols !== 1) {\n for (i = 0; i < n; ++i) {\n b = alignRow === All ? yMax : yExtent[~~(i / ncols)];\n y = b - boxes[i].y2 - groups[i].y - dy[i];\n if (y > 0) dy[i] += y / 2;\n }\n }\n\n // position grid relative to anchor\n for (i = 0; i < n; ++i) {\n bounds.union(boxes[i].translate(dx[i], dy[i]));\n }\n x = get(opt.anchor, X);\n y = get(opt.anchor, Y);\n switch (get(opt.anchor, Column)) {\n case End:\n x -= bounds.width();\n break;\n case Middle:\n x -= bounds.width() / 2;\n }\n switch (get(opt.anchor, Row)) {\n case End:\n y -= bounds.height();\n break;\n case Middle:\n y -= bounds.height() / 2;\n }\n x = Math.round(x);\n y = Math.round(y);\n\n // update mark positions, bounds, dirty\n bounds.clear();\n for (i = 0; i < n; ++i) {\n groups[i].mark.bounds.clear();\n }\n for (i = 0; i < n; ++i) {\n g = groups[i];\n g.x += dx[i] += x;\n g.y += dy[i] += y;\n bounds.union(g.mark.bounds.union(g.bounds.translate(dx[i], dy[i])));\n if (dirty) view.dirty(g);\n }\n return bounds;\n}\nfunction trellisLayout(view, group, opt) {\n var views = gridLayoutGroups(group),\n groups = views.marks,\n bbox = opt.bounds === Flush ? boundFlush : boundFull,\n off = opt.offset,\n ncols = opt.columns || groups.length,\n nrows = ncols <= 0 ? 1 : Math.ceil(groups.length / ncols),\n cells = nrows * ncols,\n x,\n y,\n x2,\n y2,\n anchor,\n band,\n offset;\n\n // -- initial grid layout\n const bounds = gridLayout(view, groups, opt);\n if (bounds.empty()) bounds.set(0, 0, 0, 0); // empty grid\n\n // -- layout grid headers and footers --\n\n // perform row header layout\n if (views.rowheaders) {\n band = get(opt.headerBand, Row, null);\n x = layoutHeaders(view, views.rowheaders, groups, ncols, nrows, -get(off, 'rowHeader'), min, 0, bbox, 'x1', 0, ncols, 1, band);\n }\n\n // perform column header layout\n if (views.colheaders) {\n band = get(opt.headerBand, Column, null);\n y = layoutHeaders(view, views.colheaders, groups, ncols, ncols, -get(off, 'columnHeader'), min, 1, bbox, 'y1', 0, 1, ncols, band);\n }\n\n // perform row footer layout\n if (views.rowfooters) {\n band = get(opt.footerBand, Row, null);\n x2 = layoutHeaders(view, views.rowfooters, groups, ncols, nrows, get(off, 'rowFooter'), max, 0, bbox, 'x2', ncols - 1, ncols, 1, band);\n }\n\n // perform column footer layout\n if (views.colfooters) {\n band = get(opt.footerBand, Column, null);\n y2 = layoutHeaders(view, views.colfooters, groups, ncols, ncols, get(off, 'columnFooter'), max, 1, bbox, 'y2', cells - ncols, 1, ncols, band);\n }\n\n // perform row title layout\n if (views.rowtitle) {\n anchor = get(opt.titleAnchor, Row);\n offset = get(off, 'rowTitle');\n offset = anchor === End ? x2 + offset : x - offset;\n band = get(opt.titleBand, Row, 0.5);\n layoutTitle(view, views.rowtitle, offset, 0, bounds, band);\n }\n\n // perform column title layout\n if (views.coltitle) {\n anchor = get(opt.titleAnchor, Column);\n offset = get(off, 'columnTitle');\n offset = anchor === End ? y2 + offset : y - offset;\n band = get(opt.titleBand, Column, 0.5);\n layoutTitle(view, views.coltitle, offset, 1, bounds, band);\n }\n}\nfunction boundFlush(item, field) {\n return field === 'x1' ? item.x || 0 : field === 'y1' ? item.y || 0 : field === 'x2' ? (item.x || 0) + (item.width || 0) : field === 'y2' ? (item.y || 0) + (item.height || 0) : undefined;\n}\nfunction boundFull(item, field) {\n return item.bounds[field];\n}\nfunction layoutHeaders(view, headers, groups, ncols, limit, offset, agg, isX, bound, bf, start, stride, back, band) {\n var n = groups.length,\n init = 0,\n edge = 0,\n i,\n j,\n k,\n m,\n b,\n h,\n g,\n x,\n y;\n\n // if no groups, early exit and return 0\n if (!n) return init;\n\n // compute margin\n for (i = start; i < n; i += stride) {\n if (groups[i]) init = agg(init, bound(groups[i], bf));\n }\n\n // if no headers, return margin calculation\n if (!headers.length) return init;\n\n // check if number of headers exceeds number of rows or columns\n if (headers.length > limit) {\n view.warn('Grid headers exceed limit: ' + limit);\n headers = headers.slice(0, limit);\n }\n\n // apply offset\n init += offset;\n\n // clear mark bounds for all headers\n for (j = 0, m = headers.length; j < m; ++j) {\n view.dirty(headers[j]);\n headers[j].mark.bounds.clear();\n }\n\n // layout each header\n for (i = start, j = 0, m = headers.length; j < m; ++j, i += stride) {\n h = headers[j];\n b = h.mark.bounds;\n\n // search for nearest group to align to\n // necessary if table has empty cells\n for (k = i; k >= 0 && (g = groups[k]) == null; k -= back);\n\n // assign coordinates and update bounds\n if (isX) {\n x = band == null ? g.x : Math.round(g.bounds.x1 + band * g.bounds.width());\n y = init;\n } else {\n x = init;\n y = band == null ? g.y : Math.round(g.bounds.y1 + band * g.bounds.height());\n }\n b.union(h.bounds.translate(x - (h.x || 0), y - (h.y || 0)));\n h.x = x;\n h.y = y;\n view.dirty(h);\n\n // update current edge of layout bounds\n edge = agg(edge, b[bf]);\n }\n return edge;\n}\nfunction layoutTitle(view, g, offset, isX, bounds, band) {\n if (!g) return;\n view.dirty(g);\n\n // compute title coordinates\n var x = offset,\n y = offset;\n isX ? x = Math.round(bounds.x1 + band * bounds.width()) : y = Math.round(bounds.y1 + band * bounds.height());\n\n // assign coordinates and update bounds\n g.bounds.translate(x - (g.x || 0), y - (g.y || 0));\n g.mark.bounds.clear().union(g.bounds);\n g.x = x;\n g.y = y;\n\n // queue title for redraw\n view.dirty(g);\n}\n\n// utility for looking up legend layout configuration\nfunction lookup(config, orient) {\n const opt = config[orient] || {};\n return (key, d) => opt[key] != null ? opt[key] : config[key] != null ? config[key] : d;\n}\n\n// if legends specify offset directly, use the maximum specified value\nfunction offsets(legends, value) {\n let max = -Infinity;\n legends.forEach(item => {\n if (item.offset != null) max = Math.max(max, item.offset);\n });\n return max > -Infinity ? max : value;\n}\nfunction legendParams(g, orient, config, xb, yb, w, h) {\n const _ = lookup(config, orient),\n offset = offsets(g, _('offset', 0)),\n anchor = _('anchor', Start),\n mult = anchor === End ? 1 : anchor === Middle ? 0.5 : 0;\n const p = {\n align: Each,\n bounds: _('bounds', Flush),\n columns: _('direction') === 'vertical' ? 1 : g.length,\n padding: _('margin', 8),\n center: _('center'),\n nodirty: true\n };\n switch (orient) {\n case Left:\n p.anchor = {\n x: Math.floor(xb.x1) - offset,\n column: End,\n y: mult * (h || xb.height() + 2 * xb.y1),\n row: anchor\n };\n break;\n case Right:\n p.anchor = {\n x: Math.ceil(xb.x2) + offset,\n y: mult * (h || xb.height() + 2 * xb.y1),\n row: anchor\n };\n break;\n case Top:\n p.anchor = {\n y: Math.floor(yb.y1) - offset,\n row: End,\n x: mult * (w || yb.width() + 2 * yb.x1),\n column: anchor\n };\n break;\n case Bottom:\n p.anchor = {\n y: Math.ceil(yb.y2) + offset,\n x: mult * (w || yb.width() + 2 * yb.x1),\n column: anchor\n };\n break;\n case TopLeft:\n p.anchor = {\n x: offset,\n y: offset\n };\n break;\n case TopRight:\n p.anchor = {\n x: w - offset,\n y: offset,\n column: End\n };\n break;\n case BottomLeft:\n p.anchor = {\n x: offset,\n y: h - offset,\n row: End\n };\n break;\n case BottomRight:\n p.anchor = {\n x: w - offset,\n y: h - offset,\n column: End,\n row: End\n };\n break;\n }\n return p;\n}\nfunction legendLayout(view, legend) {\n var item = legend.items[0],\n datum = item.datum,\n orient = item.orient,\n bounds = item.bounds,\n x = item.x,\n y = item.y,\n w,\n h;\n\n // cache current bounds for later comparison\n item._bounds ? item._bounds.clear().union(bounds) : item._bounds = bounds.clone();\n bounds.clear();\n\n // adjust legend to accommodate padding and title\n legendGroupLayout(view, item, item.items[0].items[0]);\n\n // aggregate bounds to determine size, and include origin\n bounds = legendBounds(item, bounds);\n w = 2 * item.padding;\n h = 2 * item.padding;\n if (!bounds.empty()) {\n w = Math.ceil(bounds.width() + w);\n h = Math.ceil(bounds.height() + h);\n }\n if (datum.type === Symbols) {\n legendEntryLayout(item.items[0].items[0].items[0].items);\n }\n if (orient !== None) {\n item.x = x = 0;\n item.y = y = 0;\n }\n item.width = w;\n item.height = h;\n boundStroke(bounds.set(x, y, x + w, y + h), item);\n item.mark.bounds.clear().union(bounds);\n return item;\n}\nfunction legendBounds(item, b) {\n // aggregate item bounds\n item.items.forEach(_ => b.union(_.bounds));\n\n // anchor to legend origin\n b.x1 = item.padding;\n b.y1 = item.padding;\n return b;\n}\nfunction legendGroupLayout(view, item, entry) {\n var pad = item.padding,\n ex = pad - entry.x,\n ey = pad - entry.y;\n if (!item.datum.title) {\n if (ex || ey) translate(view, entry, ex, ey);\n } else {\n var title = item.items[1].items[0],\n anchor = title.anchor,\n tpad = item.titlePadding || 0,\n tx = pad - title.x,\n ty = pad - title.y;\n switch (title.orient) {\n case Left:\n ex += Math.ceil(title.bounds.width()) + tpad;\n break;\n case Right:\n case Bottom:\n break;\n default:\n ey += title.bounds.height() + tpad;\n }\n if (ex || ey) translate(view, entry, ex, ey);\n switch (title.orient) {\n case Left:\n ty += legendTitleOffset(item, entry, title, anchor, 1, 1);\n break;\n case Right:\n tx += legendTitleOffset(item, entry, title, End, 0, 0) + tpad;\n ty += legendTitleOffset(item, entry, title, anchor, 1, 1);\n break;\n case Bottom:\n tx += legendTitleOffset(item, entry, title, anchor, 0, 0);\n ty += legendTitleOffset(item, entry, title, End, -1, 0, 1) + tpad;\n break;\n default:\n tx += legendTitleOffset(item, entry, title, anchor, 0, 0);\n }\n if (tx || ty) translate(view, title, tx, ty);\n\n // translate legend if title pushes into negative coordinates\n if ((tx = Math.round(title.bounds.x1 - pad)) < 0) {\n translate(view, entry, -tx, 0);\n translate(view, title, -tx, 0);\n }\n }\n}\nfunction legendTitleOffset(item, entry, title, anchor, y, lr, noBar) {\n const grad = item.datum.type !== 'symbol',\n vgrad = title.datum.vgrad,\n e = grad && (lr || !vgrad) && !noBar ? entry.items[0] : entry,\n s = e.bounds[y ? 'y2' : 'x2'] - item.padding,\n u = vgrad && lr ? s : 0,\n v = vgrad && lr ? 0 : s,\n o = y <= 0 ? 0 : multiLineOffset(title);\n return Math.round(anchor === Start ? u : anchor === End ? v - o : 0.5 * (s - o));\n}\nfunction translate(view, item, dx, dy) {\n item.x += dx;\n item.y += dy;\n item.bounds.translate(dx, dy);\n item.mark.bounds.translate(dx, dy);\n view.dirty(item);\n}\nfunction legendEntryLayout(entries) {\n // get max widths for each column\n const widths = entries.reduce((w, g) => {\n w[g.column] = Math.max(g.bounds.x2 - g.x, w[g.column] || 0);\n return w;\n }, {});\n\n // set dimensions of legend entry groups\n entries.forEach(g => {\n g.width = widths[g.column];\n g.height = g.bounds.y2 - g.y;\n });\n}\n\nfunction titleLayout(view, mark, width, height, viewBounds) {\n var group = mark.items[0],\n frame = group.frame,\n orient = group.orient,\n anchor = group.anchor,\n offset = group.offset,\n padding = group.padding,\n title = group.items[0].items[0],\n subtitle = group.items[1] && group.items[1].items[0],\n end = orient === Left || orient === Right ? height : width,\n start = 0,\n x = 0,\n y = 0,\n sx = 0,\n sy = 0,\n pos;\n if (frame !== Group) {\n orient === Left ? (start = viewBounds.y2, end = viewBounds.y1) : orient === Right ? (start = viewBounds.y1, end = viewBounds.y2) : (start = viewBounds.x1, end = viewBounds.x2);\n } else if (orient === Left) {\n start = height, end = 0;\n }\n pos = anchor === Start ? start : anchor === End ? end : (start + end) / 2;\n if (subtitle && subtitle.text) {\n // position subtitle\n switch (orient) {\n case Top:\n case Bottom:\n sy = title.bounds.height() + padding;\n break;\n case Left:\n sx = title.bounds.width() + padding;\n break;\n case Right:\n sx = -title.bounds.width() - padding;\n break;\n }\n tempBounds.clear().union(subtitle.bounds);\n tempBounds.translate(sx - (subtitle.x || 0), sy - (subtitle.y || 0));\n if (set(subtitle, 'x', sx) | set(subtitle, 'y', sy)) {\n view.dirty(subtitle);\n subtitle.bounds.clear().union(tempBounds);\n subtitle.mark.bounds.clear().union(tempBounds);\n view.dirty(subtitle);\n }\n tempBounds.clear().union(subtitle.bounds);\n } else {\n tempBounds.clear();\n }\n tempBounds.union(title.bounds);\n\n // position title group\n switch (orient) {\n case Top:\n x = pos;\n y = viewBounds.y1 - tempBounds.height() - offset;\n break;\n case Left:\n x = viewBounds.x1 - tempBounds.width() - offset;\n y = pos;\n break;\n case Right:\n x = viewBounds.x2 + tempBounds.width() + offset;\n y = pos;\n break;\n case Bottom:\n x = pos;\n y = viewBounds.y2 + offset;\n break;\n default:\n x = group.x;\n y = group.y;\n }\n if (set(group, 'x', x) | set(group, 'y', y)) {\n tempBounds.translate(x, y);\n view.dirty(group);\n group.bounds.clear().union(tempBounds);\n mark.bounds.clear().union(tempBounds);\n view.dirty(group);\n }\n return group.bounds;\n}\n\n/**\n * Layout view elements such as axes and legends.\n * Also performs size adjustments.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.mark - Scenegraph mark of groups to layout.\n */\nfunction ViewLayout(params) {\n Transform.call(this, null, params);\n}\ninherits(ViewLayout, Transform, {\n transform(_, pulse) {\n const view = pulse.dataflow;\n _.mark.items.forEach(group => {\n if (_.layout) trellisLayout(view, group, _.layout);\n layoutGroup(view, group, _);\n });\n return shouldReflow(_.mark.group) ? pulse.reflow() : pulse;\n }\n});\nfunction shouldReflow(group) {\n // We typically should reflow if layout is invoked (#2568), as child items\n // may have resized and reflow ensures group bounds are re-calculated.\n // However, legend entries have a special exception to avoid instability.\n // For example, if a selected legend symbol gains a stroke on hover,\n // we don't want to re-position subsequent elements in the legend.\n return group && group.mark.role !== 'legend-entry';\n}\nfunction layoutGroup(view, group, _) {\n var items = group.items,\n width = Math.max(0, group.width || 0),\n height = Math.max(0, group.height || 0),\n viewBounds = new Bounds().set(0, 0, width, height),\n xBounds = viewBounds.clone(),\n yBounds = viewBounds.clone(),\n legends = [],\n title,\n mark,\n orient,\n b,\n i,\n n;\n\n // layout axes, gather legends, collect bounds\n for (i = 0, n = items.length; i < n; ++i) {\n mark = items[i];\n switch (mark.role) {\n case AxisRole:\n b = isYAxis(mark) ? xBounds : yBounds;\n b.union(axisLayout(view, mark, width, height));\n break;\n case TitleRole:\n title = mark;\n break;\n case LegendRole:\n legends.push(legendLayout(view, mark));\n break;\n case FrameRole:\n case ScopeRole:\n case RowHeader:\n case RowFooter:\n case RowTitle:\n case ColHeader:\n case ColFooter:\n case ColTitle:\n xBounds.union(mark.bounds);\n yBounds.union(mark.bounds);\n break;\n default:\n viewBounds.union(mark.bounds);\n }\n }\n\n // layout legends, adjust viewBounds\n if (legends.length) {\n // group legends by orient\n const l = {};\n legends.forEach(item => {\n orient = item.orient || Right;\n if (orient !== None) (l[orient] || (l[orient] = [])).push(item);\n });\n\n // perform grid layout for each orient group\n for (const orient in l) {\n const g = l[orient];\n gridLayout(view, g, legendParams(g, orient, _.legends, xBounds, yBounds, width, height));\n }\n\n // update view bounds\n legends.forEach(item => {\n const b = item.bounds;\n if (!b.equals(item._bounds)) {\n item.bounds = item._bounds;\n view.dirty(item); // dirty previous location\n item.bounds = b;\n view.dirty(item);\n }\n if (_.autosize && (_.autosize.type === Fit || _.autosize.type === FitX || _.autosize.type === FitY)) {\n // For autosize fit, incorporate the orthogonal dimension only.\n // Legends that overrun the chart area will then be clipped;\n // otherwise the chart area gets reduced to nothing!\n switch (item.orient) {\n case Left:\n case Right:\n viewBounds.add(b.x1, 0).add(b.x2, 0);\n break;\n case Top:\n case Bottom:\n viewBounds.add(0, b.y1).add(0, b.y2);\n }\n } else {\n viewBounds.union(b);\n }\n });\n }\n\n // combine bounding boxes\n viewBounds.union(xBounds).union(yBounds);\n\n // layout title, adjust bounds\n if (title) {\n viewBounds.union(titleLayout(view, title, width, height, viewBounds));\n }\n\n // override aggregated view bounds if content is clipped\n if (group.clip) {\n viewBounds.set(0, 0, group.width || 0, group.height || 0);\n }\n\n // perform size adjustment\n viewSizeLayout(view, group, viewBounds, _);\n}\nfunction viewSizeLayout(view, group, viewBounds, _) {\n const auto = _.autosize || {},\n type = auto.type;\n if (view._autosize < 1 || !type) return;\n let viewWidth = view._width,\n viewHeight = view._height,\n width = Math.max(0, group.width || 0),\n left = Math.max(0, Math.ceil(-viewBounds.x1)),\n height = Math.max(0, group.height || 0),\n top = Math.max(0, Math.ceil(-viewBounds.y1));\n const right = Math.max(0, Math.ceil(viewBounds.x2 - width)),\n bottom = Math.max(0, Math.ceil(viewBounds.y2 - height));\n if (auto.contains === Padding) {\n const padding = view.padding();\n viewWidth -= padding.left + padding.right;\n viewHeight -= padding.top + padding.bottom;\n }\n if (type === None) {\n left = 0;\n top = 0;\n width = viewWidth;\n height = viewHeight;\n } else if (type === Fit) {\n width = Math.max(0, viewWidth - left - right);\n height = Math.max(0, viewHeight - top - bottom);\n } else if (type === FitX) {\n width = Math.max(0, viewWidth - left - right);\n viewHeight = height + top + bottom;\n } else if (type === FitY) {\n viewWidth = width + left + right;\n height = Math.max(0, viewHeight - top - bottom);\n } else if (type === Pad) {\n viewWidth = width + left + right;\n viewHeight = height + top + bottom;\n }\n view._resizeView(viewWidth, viewHeight, width, height, [left, top], auto.resize);\n}\n\nexport { Bound as bound, Identifier as identifier, Mark as mark, Overlap as overlap, Render as render, ViewLayout as viewlayout };\n","export default function sum(values, valueof) {\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n sum += value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n sum += value;\n }\n }\n }\n return sum;\n}\n","import { Transform, ingest, tupleid, stableCompare } from 'vega-dataflow';\nimport { tickCount, tickFormat, validTicks, tickValues, SymbolLegend, labelFormat, labelValues, GradientLegend, scaleFraction, labelFraction, scale, Sequential, Linear, isContinuous, Time, UTC, Ordinal, scaleImplicit, Log, Sqrt, Pow, Symlog, isLogarithmic, BinOrdinal, isInterpolating, interpolateColors, interpolate, Band, Point, bandSpace, scheme, Threshold, Quantile, Quantize, quantizeInterpolator, interpolateRange, Diverging } from 'vega-scale';\nimport { inherits, isArray, error, fastmap, falsy, isFunction, constant, peek, one, toSet, isString, zoomLog, zoomPow, zoomSymlog, zoomLinear, stringValue } from 'vega-util';\nimport { sum, range } from 'd3-array';\nimport { interpolateRound, interpolate as interpolate$1 } from 'd3-interpolate';\n\n/**\n * Generates axis ticks for visualizing a spatial scale.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Scale} params.scale - The scale to generate ticks for.\n * @param {*} [params.count=10] - The approximate number of ticks, or\n * desired tick interval, to use.\n * @param {Array<*>} [params.values] - The exact tick values to use.\n * These must be legal domain values for the provided scale.\n * If provided, the count argument is ignored.\n * @param {function(*):string} [params.formatSpecifier] - A format specifier\n * to use in conjunction with scale.tickFormat. Legal values are\n * any valid d3 4.0 format specifier.\n * @param {function(*):string} [params.format] - The format function to use.\n * If provided, the formatSpecifier argument is ignored.\n */\nfunction AxisTicks(params) {\n Transform.call(this, null, params);\n}\ninherits(AxisTicks, Transform, {\n transform(_, pulse) {\n if (this.value && !_.modified()) {\n return pulse.StopPropagation;\n }\n var locale = pulse.dataflow.locale(),\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n ticks = this.value,\n scale = _.scale,\n tally = _.count == null ? _.values ? _.values.length : 10 : _.count,\n count = tickCount(scale, tally, _.minstep),\n format = _.format || tickFormat(locale, scale, count, _.formatSpecifier, _.formatType, !!_.values),\n values = _.values ? validTicks(scale, _.values, count) : tickValues(scale, count);\n if (ticks) out.rem = ticks;\n ticks = values.map((value, i) => ingest({\n index: i / (values.length - 1 || 1),\n value: value,\n label: format(value)\n }));\n if (_.extra && ticks.length) {\n // add an extra tick pegged to the initial domain value\n // this is used to generate axes with 'binned' domains\n ticks.push(ingest({\n index: -1,\n extra: {\n value: ticks[0].value\n },\n label: ''\n }));\n }\n out.source = ticks;\n out.add = ticks;\n this.value = ticks;\n return out;\n }\n});\n\n/**\n * Joins a set of data elements against a set of visual items.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): object} [params.item] - An item generator function.\n * @param {function(object): *} [params.key] - The key field associating data and visual items.\n */\nfunction DataJoin(params) {\n Transform.call(this, null, params);\n}\nfunction defaultItemCreate() {\n return ingest({});\n}\nfunction newMap(key) {\n const map = fastmap().test(t => t.exit);\n map.lookup = t => map.get(key(t));\n return map;\n}\ninherits(DataJoin, Transform, {\n transform(_, pulse) {\n var df = pulse.dataflow,\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n item = _.item || defaultItemCreate,\n key = _.key || tupleid,\n map = this.value;\n\n // prevent transient (e.g., hover) requests from\n // cascading across marks derived from marks\n if (isArray(out.encode)) {\n out.encode = null;\n }\n if (map && (_.modified('key') || pulse.modified(key))) {\n error('DataJoin does not support modified key function or fields.');\n }\n if (!map) {\n pulse = pulse.addAll();\n this.value = map = newMap(key);\n }\n pulse.visit(pulse.ADD, t => {\n const k = key(t);\n let x = map.get(k);\n if (x) {\n if (x.exit) {\n map.empty--;\n out.add.push(x);\n } else {\n out.mod.push(x);\n }\n } else {\n x = item(t);\n map.set(k, x);\n out.add.push(x);\n }\n x.datum = t;\n x.exit = false;\n });\n pulse.visit(pulse.MOD, t => {\n const k = key(t),\n x = map.get(k);\n if (x) {\n x.datum = t;\n out.mod.push(x);\n }\n });\n pulse.visit(pulse.REM, t => {\n const k = key(t),\n x = map.get(k);\n if (t === x.datum && !x.exit) {\n out.rem.push(x);\n x.exit = true;\n ++map.empty;\n }\n });\n if (pulse.changed(pulse.ADD_MOD)) out.modifies('datum');\n if (pulse.clean() || _.clean && map.empty > df.cleanThreshold) {\n df.runAfter(map.clean);\n }\n return out;\n }\n});\n\n/**\n * Invokes encoding functions for visual items.\n * @constructor\n * @param {object} params - The parameters to the encoding functions. This\n * parameter object will be passed through to all invoked encoding functions.\n * @param {object} [params.mod=false] - Flag indicating if tuples in the input\n * mod set that are unmodified by encoders should be included in the output.\n * @param {object} param.encoders - The encoding functions\n * @param {function(object, object): boolean} [param.encoders.update] - Update encoding set\n * @param {function(object, object): boolean} [param.encoders.enter] - Enter encoding set\n * @param {function(object, object): boolean} [param.encoders.exit] - Exit encoding set\n */\nfunction Encode(params) {\n Transform.call(this, null, params);\n}\ninherits(Encode, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ADD_REM),\n fmod = _.mod || false,\n encoders = _.encoders,\n encode = pulse.encode;\n\n // if an array, the encode directive includes additional sets\n // that must be defined in order for the primary set to be invoked\n // e.g., only run the update set if the hover set is defined\n if (isArray(encode)) {\n if (out.changed() || encode.every(e => encoders[e])) {\n encode = encode[0];\n out.encode = null; // consume targeted encode directive\n } else {\n return pulse.StopPropagation;\n }\n }\n\n // marshall encoder functions\n var reenter = encode === 'enter',\n update = encoders.update || falsy,\n enter = encoders.enter || falsy,\n exit = encoders.exit || falsy,\n set = (encode && !reenter ? encoders[encode] : update) || falsy;\n if (pulse.changed(pulse.ADD)) {\n pulse.visit(pulse.ADD, t => {\n enter(t, _);\n update(t, _);\n });\n out.modifies(enter.output);\n out.modifies(update.output);\n if (set !== falsy && set !== update) {\n pulse.visit(pulse.ADD, t => {\n set(t, _);\n });\n out.modifies(set.output);\n }\n }\n if (pulse.changed(pulse.REM) && exit !== falsy) {\n pulse.visit(pulse.REM, t => {\n exit(t, _);\n });\n out.modifies(exit.output);\n }\n if (reenter || set !== falsy) {\n const flag = pulse.MOD | (_.modified() ? pulse.REFLOW : 0);\n if (reenter) {\n pulse.visit(flag, t => {\n const mod = enter(t, _) || fmod;\n if (set(t, _) || mod) out.mod.push(t);\n });\n if (out.mod.length) out.modifies(enter.output);\n } else {\n pulse.visit(flag, t => {\n if (set(t, _) || fmod) out.mod.push(t);\n });\n }\n if (out.mod.length) out.modifies(set.output);\n }\n return out.changed() ? out : pulse.StopPropagation;\n }\n});\n\n/**\n * Generates legend entries for visualizing a scale.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Scale} params.scale - The scale to generate items for.\n * @param {*} [params.count=5] - The approximate number of items, or\n * desired tick interval, to use.\n * @param {*} [params.limit] - The maximum number of entries to\n * include in a symbol legend.\n * @param {Array<*>} [params.values] - The exact tick values to use.\n * These must be legal domain values for the provided scale.\n * If provided, the count argument is ignored.\n * @param {string} [params.formatSpecifier] - A format specifier\n * to use in conjunction with scale.tickFormat. Legal values are\n * any valid D3 format specifier string.\n * @param {function(*):string} [params.format] - The format function to use.\n * If provided, the formatSpecifier argument is ignored.\n */\nfunction LegendEntries(params) {\n Transform.call(this, [], params);\n}\ninherits(LegendEntries, Transform, {\n transform(_, pulse) {\n if (this.value != null && !_.modified()) {\n return pulse.StopPropagation;\n }\n var locale = pulse.dataflow.locale(),\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n items = this.value,\n type = _.type || SymbolLegend,\n scale = _.scale,\n limit = +_.limit,\n count = tickCount(scale, _.count == null ? 5 : _.count, _.minstep),\n lskip = !!_.values || type === SymbolLegend,\n format = _.format || labelFormat(locale, scale, count, type, _.formatSpecifier, _.formatType, lskip),\n values = _.values || labelValues(scale, count),\n domain,\n fraction,\n size,\n offset,\n ellipsis;\n if (items) out.rem = items;\n if (type === SymbolLegend) {\n if (limit && values.length > limit) {\n pulse.dataflow.warn('Symbol legend count exceeds limit, filtering items.');\n items = values.slice(0, limit - 1);\n ellipsis = true;\n } else {\n items = values;\n }\n if (isFunction(size = _.size)) {\n // if first value maps to size zero, remove from list (vega#717)\n if (!_.values && scale(items[0]) === 0) {\n items = items.slice(1);\n }\n // compute size offset for legend entries\n offset = items.reduce((max, value) => Math.max(max, size(value, _)), 0);\n } else {\n size = constant(offset = size || 8);\n }\n items = items.map((value, index) => ingest({\n index: index,\n label: format(value, index, items),\n value: value,\n offset: offset,\n size: size(value, _)\n }));\n if (ellipsis) {\n ellipsis = values[items.length];\n items.push(ingest({\n index: items.length,\n label: `\\u2026${values.length - items.length} entries`,\n value: ellipsis,\n offset: offset,\n size: size(ellipsis, _)\n }));\n }\n } else if (type === GradientLegend) {\n domain = scale.domain(), fraction = scaleFraction(scale, domain[0], peek(domain));\n\n // if automatic label generation produces 2 or fewer values,\n // use the domain end points instead (fixes vega/vega#1364)\n if (values.length < 3 && !_.values && domain[0] !== peek(domain)) {\n values = [domain[0], peek(domain)];\n }\n items = values.map((value, index) => ingest({\n index: index,\n label: format(value, index, values),\n value: value,\n perc: fraction(value)\n }));\n } else {\n size = values.length - 1;\n fraction = labelFraction(scale);\n items = values.map((value, index) => ingest({\n index: index,\n label: format(value, index, values),\n value: value,\n perc: index ? fraction(value) : 0,\n perc2: index === size ? 1 : fraction(values[index + 1])\n }));\n }\n out.source = items;\n out.add = items;\n this.value = items;\n return out;\n }\n});\n\nconst sourceX = t => t.source.x;\nconst sourceY = t => t.source.y;\nconst targetX = t => t.target.x;\nconst targetY = t => t.target.y;\n\n/**\n * Layout paths linking source and target elements.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction LinkPath(params) {\n Transform.call(this, {}, params);\n}\nLinkPath.Definition = {\n 'type': 'LinkPath',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'sourceX',\n 'type': 'field',\n 'default': 'source.x'\n }, {\n 'name': 'sourceY',\n 'type': 'field',\n 'default': 'source.y'\n }, {\n 'name': 'targetX',\n 'type': 'field',\n 'default': 'target.x'\n }, {\n 'name': 'targetY',\n 'type': 'field',\n 'default': 'target.y'\n }, {\n 'name': 'orient',\n 'type': 'enum',\n 'default': 'vertical',\n 'values': ['horizontal', 'vertical', 'radial']\n }, {\n 'name': 'shape',\n 'type': 'enum',\n 'default': 'line',\n 'values': ['line', 'arc', 'curve', 'diagonal', 'orthogonal']\n }, {\n 'name': 'require',\n 'type': 'signal'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'path'\n }]\n};\ninherits(LinkPath, Transform, {\n transform(_, pulse) {\n var sx = _.sourceX || sourceX,\n sy = _.sourceY || sourceY,\n tx = _.targetX || targetX,\n ty = _.targetY || targetY,\n as = _.as || 'path',\n orient = _.orient || 'vertical',\n shape = _.shape || 'line',\n path = Paths.get(shape + '-' + orient) || Paths.get(shape);\n if (!path) {\n error('LinkPath unsupported type: ' + _.shape + (_.orient ? '-' + _.orient : ''));\n }\n pulse.visit(pulse.SOURCE, t => {\n t[as] = path(sx(t), sy(t), tx(t), ty(t));\n });\n return pulse.reflow(_.modified()).modifies(as);\n }\n});\nconst line = (sx, sy, tx, ty) => 'M' + sx + ',' + sy + 'L' + tx + ',' + ty;\nconst lineR = (sa, sr, ta, tr) => line(sr * Math.cos(sa), sr * Math.sin(sa), tr * Math.cos(ta), tr * Math.sin(ta));\nconst arc = (sx, sy, tx, ty) => {\n var dx = tx - sx,\n dy = ty - sy,\n rr = Math.hypot(dx, dy) / 2,\n ra = 180 * Math.atan2(dy, dx) / Math.PI;\n return 'M' + sx + ',' + sy + 'A' + rr + ',' + rr + ' ' + ra + ' 0 1' + ' ' + tx + ',' + ty;\n};\nconst arcR = (sa, sr, ta, tr) => arc(sr * Math.cos(sa), sr * Math.sin(sa), tr * Math.cos(ta), tr * Math.sin(ta));\nconst curve = (sx, sy, tx, ty) => {\n const dx = tx - sx,\n dy = ty - sy,\n ix = 0.2 * (dx + dy),\n iy = 0.2 * (dy - dx);\n return 'M' + sx + ',' + sy + 'C' + (sx + ix) + ',' + (sy + iy) + ' ' + (tx + iy) + ',' + (ty - ix) + ' ' + tx + ',' + ty;\n};\nconst curveR = (sa, sr, ta, tr) => curve(sr * Math.cos(sa), sr * Math.sin(sa), tr * Math.cos(ta), tr * Math.sin(ta));\nconst orthoX = (sx, sy, tx, ty) => 'M' + sx + ',' + sy + 'V' + ty + 'H' + tx;\nconst orthoY = (sx, sy, tx, ty) => 'M' + sx + ',' + sy + 'H' + tx + 'V' + ty;\nconst orthoR = (sa, sr, ta, tr) => {\n const sc = Math.cos(sa),\n ss = Math.sin(sa),\n tc = Math.cos(ta),\n ts = Math.sin(ta),\n sf = Math.abs(ta - sa) > Math.PI ? ta <= sa : ta > sa;\n return 'M' + sr * sc + ',' + sr * ss + 'A' + sr + ',' + sr + ' 0 0,' + (sf ? 1 : 0) + ' ' + sr * tc + ',' + sr * ts + 'L' + tr * tc + ',' + tr * ts;\n};\nconst diagonalX = (sx, sy, tx, ty) => {\n const m = (sx + tx) / 2;\n return 'M' + sx + ',' + sy + 'C' + m + ',' + sy + ' ' + m + ',' + ty + ' ' + tx + ',' + ty;\n};\nconst diagonalY = (sx, sy, tx, ty) => {\n const m = (sy + ty) / 2;\n return 'M' + sx + ',' + sy + 'C' + sx + ',' + m + ' ' + tx + ',' + m + ' ' + tx + ',' + ty;\n};\nconst diagonalR = (sa, sr, ta, tr) => {\n const sc = Math.cos(sa),\n ss = Math.sin(sa),\n tc = Math.cos(ta),\n ts = Math.sin(ta),\n mr = (sr + tr) / 2;\n return 'M' + sr * sc + ',' + sr * ss + 'C' + mr * sc + ',' + mr * ss + ' ' + mr * tc + ',' + mr * ts + ' ' + tr * tc + ',' + tr * ts;\n};\nconst Paths = fastmap({\n 'line': line,\n 'line-radial': lineR,\n 'arc': arc,\n 'arc-radial': arcR,\n 'curve': curve,\n 'curve-radial': curveR,\n 'orthogonal-horizontal': orthoX,\n 'orthogonal-vertical': orthoY,\n 'orthogonal-radial': orthoR,\n 'diagonal-horizontal': diagonalX,\n 'diagonal-vertical': diagonalY,\n 'diagonal-radial': diagonalR\n});\n\n/**\n * Pie and donut chart layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size pie segments.\n * @param {number} [params.startAngle=0] - The start angle (in radians) of the layout.\n * @param {number} [params.endAngle=2π] - The end angle (in radians) of the layout.\n * @param {boolean} [params.sort] - Boolean flag for sorting sectors by value.\n */\nfunction Pie(params) {\n Transform.call(this, null, params);\n}\nPie.Definition = {\n 'type': 'Pie',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'startAngle',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'endAngle',\n 'type': 'number',\n 'default': 6.283185307179586\n }, {\n 'name': 'sort',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['startAngle', 'endAngle']\n }]\n};\ninherits(Pie, Transform, {\n transform(_, pulse) {\n var as = _.as || ['startAngle', 'endAngle'],\n startAngle = as[0],\n endAngle = as[1],\n field = _.field || one,\n start = _.startAngle || 0,\n stop = _.endAngle != null ? _.endAngle : 2 * Math.PI,\n data = pulse.source,\n values = data.map(field),\n n = values.length,\n a = start,\n k = (stop - start) / sum(values),\n index = range(n),\n i,\n t,\n v;\n if (_.sort) {\n index.sort((a, b) => values[a] - values[b]);\n }\n for (i = 0; i < n; ++i) {\n v = values[index[i]];\n t = data[index[i]];\n t[startAngle] = a;\n t[endAngle] = a += v * k;\n }\n this.value = values;\n return pulse.reflow(_.modified()).modifies(as);\n }\n});\n\nconst DEFAULT_COUNT = 5;\nfunction includeZero(scale) {\n const type = scale.type;\n return !scale.bins && (type === Linear || type === Pow || type === Sqrt);\n}\nfunction includePad(type) {\n return isContinuous(type) && type !== Sequential;\n}\nconst SKIP = toSet(['set', 'modified', 'clear', 'type', 'scheme', 'schemeExtent', 'schemeCount', 'domain', 'domainMin', 'domainMid', 'domainMax', 'domainRaw', 'domainImplicit', 'nice', 'zero', 'bins', 'range', 'rangeStep', 'round', 'reverse', 'interpolate', 'interpolateGamma']);\n\n/**\n * Maintains a scale function mapping data values to visual channels.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction Scale(params) {\n Transform.call(this, null, params);\n this.modified(true); // always treat as modified\n}\ninherits(Scale, Transform, {\n transform(_, pulse) {\n var df = pulse.dataflow,\n scale$1 = this.value,\n key = scaleKey(_);\n if (!scale$1 || key !== scale$1.type) {\n this.value = scale$1 = scale(key)();\n }\n for (key in _) if (!SKIP[key]) {\n // padding is a scale property for band/point but not others\n if (key === 'padding' && includePad(scale$1.type)) continue;\n // invoke scale property setter, raise warning if not found\n isFunction(scale$1[key]) ? scale$1[key](_[key]) : df.warn('Unsupported scale property: ' + key);\n }\n configureRange(scale$1, _, configureBins(scale$1, _, configureDomain(scale$1, _, df)));\n return pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n }\n});\nfunction scaleKey(_) {\n var t = _.type,\n d = '',\n n;\n\n // backwards compatibility pre Vega 5.\n if (t === Sequential) return Sequential + '-' + Linear;\n if (isContinuousColor(_)) {\n n = _.rawDomain ? _.rawDomain.length : _.domain ? _.domain.length + +(_.domainMid != null) : 0;\n d = n === 2 ? Sequential + '-' : n === 3 ? Diverging + '-' : '';\n }\n return (d + t || Linear).toLowerCase();\n}\nfunction isContinuousColor(_) {\n const t = _.type;\n return isContinuous(t) && t !== Time && t !== UTC && (_.scheme || _.range && _.range.length && _.range.every(isString));\n}\nfunction configureDomain(scale, _, df) {\n // check raw domain, if provided use that and exit early\n const raw = rawDomain(scale, _.domainRaw, df);\n if (raw > -1) return raw;\n var domain = _.domain,\n type = scale.type,\n zero = _.zero || _.zero === undefined && includeZero(scale),\n n,\n mid;\n if (!domain) return 0;\n\n // adjust domain based on zero, min, max settings\n if (zero || _.domainMin != null || _.domainMax != null || _.domainMid != null) {\n n = (domain = domain.slice()).length - 1 || 1;\n if (zero) {\n if (domain[0] > 0) domain[0] = 0;\n if (domain[n] < 0) domain[n] = 0;\n }\n if (_.domainMin != null) domain[0] = _.domainMin;\n if (_.domainMax != null) domain[n] = _.domainMax;\n if (_.domainMid != null) {\n mid = _.domainMid;\n const i = mid > domain[n] ? n + 1 : mid < domain[0] ? 0 : n;\n if (i !== n) df.warn('Scale domainMid exceeds domain min or max.', mid);\n domain.splice(i, 0, mid);\n }\n }\n\n // adjust continuous domain for minimum pixel padding\n if (includePad(type) && _.padding && domain[0] !== peek(domain)) {\n domain = padDomain(type, domain, _.range, _.padding, _.exponent, _.constant);\n }\n\n // set the scale domain\n scale.domain(domainCheck(type, domain, df));\n\n // if ordinal scale domain is defined, prevent implicit\n // domain construction as side-effect of scale lookup\n if (type === Ordinal) {\n scale.unknown(_.domainImplicit ? scaleImplicit : undefined);\n }\n\n // perform 'nice' adjustment as requested\n if (_.nice && scale.nice) {\n scale.nice(_.nice !== true && tickCount(scale, _.nice) || null);\n }\n\n // return the cardinality of the domain\n return domain.length;\n}\nfunction rawDomain(scale, raw, df) {\n if (raw) {\n scale.domain(domainCheck(scale.type, raw, df));\n return raw.length;\n } else {\n return -1;\n }\n}\nfunction padDomain(type, domain, range, pad, exponent, constant) {\n var span = Math.abs(peek(range) - range[0]),\n frac = span / (span - 2 * pad),\n d = type === Log ? zoomLog(domain, null, frac) : type === Sqrt ? zoomPow(domain, null, frac, 0.5) : type === Pow ? zoomPow(domain, null, frac, exponent || 1) : type === Symlog ? zoomSymlog(domain, null, frac, constant || 1) : zoomLinear(domain, null, frac);\n domain = domain.slice();\n domain[0] = d[0];\n domain[domain.length - 1] = d[1];\n return domain;\n}\nfunction domainCheck(type, domain, df) {\n if (isLogarithmic(type)) {\n // sum signs of domain values\n // if all pos or all neg, abs(sum) === domain.length\n var s = Math.abs(domain.reduce((s, v) => s + (v < 0 ? -1 : v > 0 ? 1 : 0), 0));\n if (s !== domain.length) {\n df.warn('Log scale domain includes zero: ' + stringValue(domain));\n }\n }\n return domain;\n}\nfunction configureBins(scale, _, count) {\n let bins = _.bins;\n if (bins && !isArray(bins)) {\n // generate bin boundary array\n const domain = scale.domain(),\n lo = domain[0],\n hi = peek(domain),\n step = bins.step;\n let start = bins.start == null ? lo : bins.start,\n stop = bins.stop == null ? hi : bins.stop;\n if (!step) error('Scale bins parameter missing step property.');\n if (start < lo) start = step * Math.ceil(lo / step);\n if (stop > hi) stop = step * Math.floor(hi / step);\n bins = range(start, stop + step / 2, step);\n }\n if (bins) {\n // assign bin boundaries to scale instance\n scale.bins = bins;\n } else if (scale.bins) {\n // no current bins, remove bins if previously set\n delete scale.bins;\n }\n\n // special handling for bin-ordinal scales\n if (scale.type === BinOrdinal) {\n if (!bins) {\n // the domain specifies the bins\n scale.bins = scale.domain();\n } else if (!_.domain && !_.domainRaw) {\n // the bins specify the domain\n scale.domain(bins);\n count = bins.length;\n }\n }\n\n // return domain cardinality\n return count;\n}\nfunction configureRange(scale, _, count) {\n var type = scale.type,\n round = _.round || false,\n range = _.range;\n\n // if range step specified, calculate full range extent\n if (_.rangeStep != null) {\n range = configureRangeStep(type, _, count);\n }\n\n // else if a range scheme is defined, use that\n else if (_.scheme) {\n range = configureScheme(type, _, count);\n if (isFunction(range)) {\n if (scale.interpolator) {\n return scale.interpolator(range);\n } else {\n error(`Scale type ${type} does not support interpolating color schemes.`);\n }\n }\n }\n\n // given a range array for an interpolating scale, convert to interpolator\n if (range && isInterpolating(type)) {\n return scale.interpolator(interpolateColors(flip(range, _.reverse), _.interpolate, _.interpolateGamma));\n }\n\n // configure rounding / interpolation\n if (range && _.interpolate && scale.interpolate) {\n scale.interpolate(interpolate(_.interpolate, _.interpolateGamma));\n } else if (isFunction(scale.round)) {\n scale.round(round);\n } else if (isFunction(scale.rangeRound)) {\n scale.interpolate(round ? interpolateRound : interpolate$1);\n }\n if (range) scale.range(flip(range, _.reverse));\n}\nfunction configureRangeStep(type, _, count) {\n if (type !== Band && type !== Point) {\n error('Only band and point scales support rangeStep.');\n }\n\n // calculate full range based on requested step size and padding\n var outer = (_.paddingOuter != null ? _.paddingOuter : _.padding) || 0,\n inner = type === Point ? 1 : (_.paddingInner != null ? _.paddingInner : _.padding) || 0;\n return [0, _.rangeStep * bandSpace(count, inner, outer)];\n}\nfunction configureScheme(type, _, count) {\n var extent = _.schemeExtent,\n name,\n scheme$1;\n if (isArray(_.scheme)) {\n scheme$1 = interpolateColors(_.scheme, _.interpolate, _.interpolateGamma);\n } else {\n name = _.scheme.toLowerCase();\n scheme$1 = scheme(name);\n if (!scheme$1) error(`Unrecognized scheme name: ${_.scheme}`);\n }\n\n // determine size for potential discrete range\n count = type === Threshold ? count + 1 : type === BinOrdinal ? count - 1 : type === Quantile || type === Quantize ? +_.schemeCount || DEFAULT_COUNT : count;\n\n // adjust and/or quantize scheme as appropriate\n return isInterpolating(type) ? adjustScheme(scheme$1, extent, _.reverse) : isFunction(scheme$1) ? quantizeInterpolator(adjustScheme(scheme$1, extent), count) : type === Ordinal ? scheme$1 : scheme$1.slice(0, count);\n}\nfunction adjustScheme(scheme, extent, reverse) {\n return isFunction(scheme) && (extent || reverse) ? interpolateRange(scheme, flip(extent || [0, 1], reverse)) : scheme;\n}\nfunction flip(array, reverse) {\n return reverse ? array.slice().reverse() : array;\n}\n\n/**\n * Sorts scenegraph items in the pulse source array.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - A comparator\n * function for sorting tuples.\n */\nfunction SortItems(params) {\n Transform.call(this, null, params);\n}\ninherits(SortItems, Transform, {\n transform(_, pulse) {\n const mod = _.modified('sort') || pulse.changed(pulse.ADD) || pulse.modified(_.sort.fields) || pulse.modified('datum');\n if (mod) pulse.source.sort(stableCompare(_.sort));\n this.modified(mod);\n return pulse;\n }\n});\n\nconst Zero = 'zero',\n Center = 'center',\n Normalize = 'normalize',\n DefOutput = ['y0', 'y1'];\n\n/**\n * Stack layout for visualization elements.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to stack.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {function(object,object): number} [params.sort] - A comparator for stack sorting.\n * @param {string} [offset='zero'] - Stack baseline offset. One of 'zero', 'center', 'normalize'.\n */\nfunction Stack(params) {\n Transform.call(this, null, params);\n}\nStack.Definition = {\n 'type': 'Stack',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'offset',\n 'type': 'enum',\n 'default': Zero,\n 'values': [Zero, Center, Normalize]\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': DefOutput\n }]\n};\ninherits(Stack, Transform, {\n transform(_, pulse) {\n var as = _.as || DefOutput,\n y0 = as[0],\n y1 = as[1],\n sort = stableCompare(_.sort),\n field = _.field || one,\n stack = _.offset === Center ? stackCenter : _.offset === Normalize ? stackNormalize : stackZero,\n groups,\n i,\n n,\n max;\n\n // partition, sum, and sort the stack groups\n groups = partition(pulse.source, _.groupby, sort, field);\n\n // compute stack layouts per group\n for (i = 0, n = groups.length, max = groups.max; i < n; ++i) {\n stack(groups[i], max, field, y0, y1);\n }\n return pulse.reflow(_.modified()).modifies(as);\n }\n});\nfunction stackCenter(group, max, field, y0, y1) {\n var last = (max - group.sum) / 2,\n m = group.length,\n j = 0,\n t;\n for (; j < m; ++j) {\n t = group[j];\n t[y0] = last;\n t[y1] = last += Math.abs(field(t));\n }\n}\nfunction stackNormalize(group, max, field, y0, y1) {\n var scale = 1 / group.sum,\n last = 0,\n m = group.length,\n j = 0,\n v = 0,\n t;\n for (; j < m; ++j) {\n t = group[j];\n t[y0] = last;\n t[y1] = last = scale * (v += Math.abs(field(t)));\n }\n}\nfunction stackZero(group, max, field, y0, y1) {\n var lastPos = 0,\n lastNeg = 0,\n m = group.length,\n j = 0,\n v,\n t;\n for (; j < m; ++j) {\n t = group[j];\n v = +field(t);\n if (v < 0) {\n t[y0] = lastNeg;\n t[y1] = lastNeg += v;\n } else {\n t[y0] = lastPos;\n t[y1] = lastPos += v;\n }\n }\n}\nfunction partition(data, groupby, sort, field) {\n var groups = [],\n get = f => f(t),\n map,\n i,\n n,\n m,\n t,\n k,\n g,\n s,\n max;\n\n // partition data points into stack groups\n if (groupby == null) {\n groups.push(data.slice());\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n if (!g) {\n map[k] = g = [];\n groups.push(g);\n }\n g.push(t);\n }\n }\n\n // compute sums of groups, sort groups as needed\n for (k = 0, max = 0, m = groups.length; k < m; ++k) {\n g = groups[k];\n for (i = 0, s = 0, n = g.length; i < n; ++i) {\n s += Math.abs(field(g[i]));\n }\n g.sum = s;\n if (s > max) max = s;\n if (sort) g.sort(sort);\n }\n groups.max = max;\n return groups;\n}\n\nexport { AxisTicks as axisticks, DataJoin as datajoin, Encode as encode, LegendEntries as legendentries, LinkPath as linkpath, Pie as pie, Scale as scale, SortItems as sortitems, Stack as stack };\n","export default x => x;\n","function streamGeometry(geometry, stream) {\n if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {\n streamGeometryType[geometry.type](geometry, stream);\n }\n}\n\nvar streamObjectType = {\n Feature: function(object, stream) {\n streamGeometry(object.geometry, stream);\n },\n FeatureCollection: function(object, stream) {\n var features = object.features, i = -1, n = features.length;\n while (++i < n) streamGeometry(features[i].geometry, stream);\n }\n};\n\nvar streamGeometryType = {\n Sphere: function(object, stream) {\n stream.sphere();\n },\n Point: function(object, stream) {\n object = object.coordinates;\n stream.point(object[0], object[1], object[2]);\n },\n MultiPoint: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]);\n },\n LineString: function(object, stream) {\n streamLine(object.coordinates, stream, 0);\n },\n MultiLineString: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamLine(coordinates[i], stream, 0);\n },\n Polygon: function(object, stream) {\n streamPolygon(object.coordinates, stream);\n },\n MultiPolygon: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamPolygon(coordinates[i], stream);\n },\n GeometryCollection: function(object, stream) {\n var geometries = object.geometries, i = -1, n = geometries.length;\n while (++i < n) streamGeometry(geometries[i], stream);\n }\n};\n\nfunction streamLine(coordinates, stream, closed) {\n var i = -1, n = coordinates.length - closed, coordinate;\n stream.lineStart();\n while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);\n stream.lineEnd();\n}\n\nfunction streamPolygon(coordinates, stream) {\n var i = -1, n = coordinates.length;\n stream.polygonStart();\n while (++i < n) streamLine(coordinates[i], stream, 1);\n stream.polygonEnd();\n}\n\nexport default function(object, stream) {\n if (object && streamObjectType.hasOwnProperty(object.type)) {\n streamObjectType[object.type](object, stream);\n } else {\n streamGeometry(object, stream);\n }\n}\n","// https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423\nexport class Adder {\n constructor() {\n this._partials = new Float64Array(32);\n this._n = 0;\n }\n add(x) {\n const p = this._partials;\n let i = 0;\n for (let j = 0; j < this._n && j < 32; j++) {\n const y = p[j],\n hi = x + y,\n lo = Math.abs(x) < Math.abs(y) ? x - (hi - y) : y - (hi - x);\n if (lo) p[i++] = lo;\n x = hi;\n }\n p[i] = x;\n this._n = i + 1;\n return this;\n }\n valueOf() {\n const p = this._partials;\n let n = this._n, x, y, lo, hi = 0;\n if (n > 0) {\n hi = p[--n];\n while (n > 0) {\n x = hi;\n y = p[--n];\n hi = x + y;\n lo = y - (hi - x);\n if (lo) break;\n }\n if (n > 0 && ((lo < 0 && p[n - 1] < 0) || (lo > 0 && p[n - 1] > 0))) {\n y = lo * 2;\n x = hi + y;\n if (y == x - hi) hi = x;\n }\n }\n return hi;\n }\n}\n\nexport function fsum(values, valueof) {\n const adder = new Adder();\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n adder.add(value);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n adder.add(value);\n }\n }\n }\n return +adder;\n}\n\nexport function fcumsum(values, valueof) {\n const adder = new Adder();\n let index = -1;\n return Float64Array.from(values, valueof === undefined\n ? v => adder.add(+v || 0)\n : v => adder.add(+valueof(v, ++index, values) || 0)\n );\n}\n","export var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var tau = pi * 2;\n\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var ceil = Math.ceil;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var hypot = Math.hypot;\nexport var log = Math.log;\nexport var pow = Math.pow;\nexport var sin = Math.sin;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sqrt = Math.sqrt;\nexport var tan = Math.tan;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);\n}\n\nexport function haversin(x) {\n return (x = sin(x / 2)) * x;\n}\n","export default function noop() {}\n","import {Adder} from \"d3-array\";\nimport {abs} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar areaSum = new Adder(),\n areaRingSum = new Adder(),\n x00,\n y00,\n x0,\n y0;\n\nvar areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n areaStream.lineStart = areaStream.lineEnd = areaStream.point = noop;\n areaSum.add(abs(areaRingSum));\n areaRingSum = new Adder();\n },\n result: function() {\n var area = areaSum / 2;\n areaSum = new Adder();\n return area;\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaPointFirst(x, y) {\n areaStream.point = areaPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction areaPoint(x, y) {\n areaRingSum.add(y0 * x - x0 * y);\n x0 = x, y0 = y;\n}\n\nfunction areaRingEnd() {\n areaPoint(x00, y00);\n}\n\nexport default areaStream;\n","import noop from \"../noop.js\";\n\nvar x0 = Infinity,\n y0 = x0,\n x1 = -x0,\n y1 = x1;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop,\n result: function() {\n var bounds = [[x0, y0], [x1, y1]];\n x1 = y1 = -(y0 = x0 = Infinity);\n return bounds;\n }\n};\n\nfunction boundsPoint(x, y) {\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n}\n\nexport default boundsStream;\n","import {sqrt} from \"../math.js\";\n\n// TODO Enforce positive area for exterior, negative area for interior?\n\nvar X0 = 0,\n Y0 = 0,\n Z0 = 0,\n X1 = 0,\n Y1 = 0,\n Z1 = 0,\n X2 = 0,\n Y2 = 0,\n Z2 = 0,\n x00,\n y00,\n x0,\n y0;\n\nvar centroidStream = {\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.point = centroidPoint;\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n },\n result: function() {\n var centroid = Z2 ? [X2 / Z2, Y2 / Z2]\n : Z1 ? [X1 / Z1, Y1 / Z1]\n : Z0 ? [X0 / Z0, Y0 / Z0]\n : [NaN, NaN];\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 =\n X2 = Y2 = Z2 = 0;\n return centroid;\n }\n};\n\nfunction centroidPoint(x, y) {\n X0 += x;\n Y0 += y;\n ++Z0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidPointFirstLine;\n}\n\nfunction centroidPointFirstLine(x, y) {\n centroidStream.point = centroidPointLine;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidPointLine(x, y) {\n var dx = x - x0, dy = y - y0, z = sqrt(dx * dx + dy * dy);\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingStart() {\n centroidStream.point = centroidPointFirstRing;\n}\n\nfunction centroidRingEnd() {\n centroidPointRing(x00, y00);\n}\n\nfunction centroidPointFirstRing(x, y) {\n centroidStream.point = centroidPointRing;\n centroidPoint(x00 = x0 = x, y00 = y0 = y);\n}\n\nfunction centroidPointRing(x, y) {\n var dx = x - x0,\n dy = y - y0,\n z = sqrt(dx * dx + dy * dy);\n\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n\n z = y0 * x - x0 * y;\n X2 += z * (x0 + x);\n Y2 += z * (y0 + y);\n Z2 += z * 3;\n centroidPoint(x0 = x, y0 = y);\n}\n\nexport default centroidStream;\n","import {tau} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nexport default function PathContext(context) {\n this._context = context;\n}\n\nPathContext.prototype = {\n _radius: 4.5,\n pointRadius: function(_) {\n return this._radius = _, this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._context.closePath();\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._context.moveTo(x, y);\n this._point = 1;\n break;\n }\n case 1: {\n this._context.lineTo(x, y);\n break;\n }\n default: {\n this._context.moveTo(x + this._radius, y);\n this._context.arc(x, y, this._radius, 0, tau);\n break;\n }\n }\n },\n result: noop\n};\n","import {Adder} from \"d3-array\";\nimport {sqrt} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar lengthSum = new Adder(),\n lengthRing,\n x00,\n y00,\n x0,\n y0;\n\nvar lengthStream = {\n point: noop,\n lineStart: function() {\n lengthStream.point = lengthPointFirst;\n },\n lineEnd: function() {\n if (lengthRing) lengthPoint(x00, y00);\n lengthStream.point = noop;\n },\n polygonStart: function() {\n lengthRing = true;\n },\n polygonEnd: function() {\n lengthRing = null;\n },\n result: function() {\n var length = +lengthSum;\n lengthSum = new Adder();\n return length;\n }\n};\n\nfunction lengthPointFirst(x, y) {\n lengthStream.point = lengthPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction lengthPoint(x, y) {\n x0 -= x, y0 -= y;\n lengthSum.add(sqrt(x0 * x0 + y0 * y0));\n x0 = x, y0 = y;\n}\n\nexport default lengthStream;\n","// Simple caching for constant-radius points.\nlet cacheDigits, cacheAppend, cacheRadius, cacheCircle;\n\nexport default class PathString {\n constructor(digits) {\n this._append = digits == null ? append : appendRound(digits);\n this._radius = 4.5;\n this._ = \"\";\n }\n pointRadius(_) {\n this._radius = +_;\n return this;\n }\n polygonStart() {\n this._line = 0;\n }\n polygonEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line === 0) this._ += \"Z\";\n this._point = NaN;\n }\n point(x, y) {\n switch (this._point) {\n case 0: {\n this._append`M${x},${y}`;\n this._point = 1;\n break;\n }\n case 1: {\n this._append`L${x},${y}`;\n break;\n }\n default: {\n this._append`M${x},${y}`;\n if (this._radius !== cacheRadius || this._append !== cacheAppend) {\n const r = this._radius;\n const s = this._;\n this._ = \"\"; // stash the old string so we can cache the circle path fragment\n this._append`m0,${r}a${r},${r} 0 1,1 0,${-2 * r}a${r},${r} 0 1,1 0,${2 * r}z`;\n cacheRadius = r;\n cacheAppend = this._append;\n cacheCircle = this._;\n this._ = s;\n }\n this._ += cacheCircle;\n break;\n }\n }\n }\n result() {\n const result = this._;\n this._ = \"\";\n return result.length ? result : null;\n }\n}\n\nfunction append(strings) {\n let i = 1;\n this._ += strings[0];\n for (const j = strings.length; i < j; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n const d = Math.floor(digits);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${digits}`);\n if (d > 15) return append;\n if (d !== cacheDigits) {\n const k = 10 ** d;\n cacheDigits = d;\n cacheAppend = function append(strings) {\n let i = 1;\n this._ += strings[0];\n for (const j = strings.length; i < j; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n }\n return cacheAppend;\n}\n","import identity from \"../identity.js\";\nimport stream from \"../stream.js\";\nimport pathArea from \"./area.js\";\nimport pathBounds from \"./bounds.js\";\nimport pathCentroid from \"./centroid.js\";\nimport PathContext from \"./context.js\";\nimport pathMeasure from \"./measure.js\";\nimport PathString from \"./string.js\";\n\nexport default function(projection, context) {\n let digits = 3,\n pointRadius = 4.5,\n projectionStream,\n contextStream;\n\n function path(object) {\n if (object) {\n if (typeof pointRadius === \"function\") contextStream.pointRadius(+pointRadius.apply(this, arguments));\n stream(object, projectionStream(contextStream));\n }\n return contextStream.result();\n }\n\n path.area = function(object) {\n stream(object, projectionStream(pathArea));\n return pathArea.result();\n };\n\n path.measure = function(object) {\n stream(object, projectionStream(pathMeasure));\n return pathMeasure.result();\n };\n\n path.bounds = function(object) {\n stream(object, projectionStream(pathBounds));\n return pathBounds.result();\n };\n\n path.centroid = function(object) {\n stream(object, projectionStream(pathCentroid));\n return pathCentroid.result();\n };\n\n path.projection = function(_) {\n if (!arguments.length) return projection;\n projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream;\n return path;\n };\n\n path.context = function(_) {\n if (!arguments.length) return context;\n contextStream = _ == null ? (context = null, new PathString(digits)) : new PathContext(context = _);\n if (typeof pointRadius !== \"function\") contextStream.pointRadius(pointRadius);\n return path;\n };\n\n path.pointRadius = function(_) {\n if (!arguments.length) return pointRadius;\n pointRadius = typeof _ === \"function\" ? _ : (contextStream.pointRadius(+_), +_);\n return path;\n };\n\n path.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) digits = null;\n else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n if (context === null) contextStream = new PathString(digits);\n return path;\n };\n\n return path.projection(projection).digits(digits).context(context);\n}\n","import noop from \"../noop.js\";\n\nexport default function() {\n var lines = [],\n line;\n return {\n point: function(x, y, m) {\n line.push([x, y, m]);\n },\n lineStart: function() {\n lines.push(line = []);\n },\n lineEnd: noop,\n rejoin: function() {\n if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));\n },\n result: function() {\n var result = lines;\n lines = [];\n line = null;\n return result;\n }\n };\n}\n","import {abs, epsilon} from \"./math.js\";\n\nexport default function(a, b) {\n return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;\n}\n","import pointEqual from \"../pointEqual.js\";\nimport {epsilon} from \"../math.js\";\n\nfunction Intersection(point, points, other, entry) {\n this.x = point;\n this.z = points;\n this.o = other; // another intersection\n this.e = entry; // is an entry?\n this.v = false; // visited\n this.n = this.p = null; // next & previous\n}\n\n// A generalized polygon clipping algorithm: given a polygon that has been cut\n// into its visible line segments, and rejoins the segments by interpolating\n// along the clip edge.\nexport default function(segments, compareIntersection, startInside, interpolate, stream) {\n var subject = [],\n clip = [],\n i,\n n;\n\n segments.forEach(function(segment) {\n if ((n = segment.length - 1) <= 0) return;\n var n, p0 = segment[0], p1 = segment[n], x;\n\n if (pointEqual(p0, p1)) {\n if (!p0[2] && !p1[2]) {\n stream.lineStart();\n for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);\n stream.lineEnd();\n return;\n }\n // handle degenerate cases by moving the point\n p1[0] += 2 * epsilon;\n }\n\n subject.push(x = new Intersection(p0, segment, null, true));\n clip.push(x.o = new Intersection(p0, null, x, false));\n subject.push(x = new Intersection(p1, segment, null, false));\n clip.push(x.o = new Intersection(p1, null, x, true));\n });\n\n if (!subject.length) return;\n\n clip.sort(compareIntersection);\n link(subject);\n link(clip);\n\n for (i = 0, n = clip.length; i < n; ++i) {\n clip[i].e = startInside = !startInside;\n }\n\n var start = subject[0],\n points,\n point;\n\n while (1) {\n // Find first unvisited intersection.\n var current = start,\n isSubject = true;\n while (current.v) if ((current = current.n) === start) return;\n points = current.z;\n stream.lineStart();\n do {\n current.v = current.o.v = true;\n if (current.e) {\n if (isSubject) {\n for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.n.x, 1, stream);\n }\n current = current.n;\n } else {\n if (isSubject) {\n points = current.p.z;\n for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.p.x, -1, stream);\n }\n current = current.p;\n }\n current = current.o;\n points = current.z;\n isSubject = !isSubject;\n } while (!current.v);\n stream.lineEnd();\n }\n}\n\nfunction link(array) {\n if (!(n = array.length)) return;\n var n,\n i = 0,\n a = array[0],\n b;\n while (++i < n) {\n a.n = b = array[i];\n b.p = a;\n a = b;\n }\n a.n = b = array[0];\n b.p = a;\n}\n","import {asin, atan2, cos, sin, sqrt} from \"./math.js\";\n\nexport function spherical(cartesian) {\n return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])];\n}\n\nexport function cartesian(spherical) {\n var lambda = spherical[0], phi = spherical[1], cosPhi = cos(phi);\n return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];\n}\n\nexport function cartesianDot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n\nexport function cartesianCross(a, b) {\n return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];\n}\n\n// TODO return a\nexport function cartesianAddInPlace(a, b) {\n a[0] += b[0], a[1] += b[1], a[2] += b[2];\n}\n\nexport function cartesianScale(vector, k) {\n return [vector[0] * k, vector[1] * k, vector[2] * k];\n}\n\n// TODO return d\nexport function cartesianNormalizeInPlace(d) {\n var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);\n d[0] /= l, d[1] /= l, d[2] /= l;\n}\n","import {Adder} from \"d3-array\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace} from \"./cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, epsilon2, halfPi, pi, quarterPi, sign, sin, tau} from \"./math.js\";\n\nfunction longitude(point) {\n return abs(point[0]) <= pi ? point[0] : sign(point[0]) * ((abs(point[0]) + pi) % tau - pi);\n}\n\nexport default function(polygon, point) {\n var lambda = longitude(point),\n phi = point[1],\n sinPhi = sin(phi),\n normal = [sin(lambda), -cos(lambda), 0],\n angle = 0,\n winding = 0;\n\n var sum = new Adder();\n\n if (sinPhi === 1) phi = halfPi + epsilon;\n else if (sinPhi === -1) phi = -halfPi - epsilon;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n if (!(m = (ring = polygon[i]).length)) continue;\n var ring,\n m,\n point0 = ring[m - 1],\n lambda0 = longitude(point0),\n phi0 = point0[1] / 2 + quarterPi,\n sinPhi0 = sin(phi0),\n cosPhi0 = cos(phi0);\n\n for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {\n var point1 = ring[j],\n lambda1 = longitude(point1),\n phi1 = point1[1] / 2 + quarterPi,\n sinPhi1 = sin(phi1),\n cosPhi1 = cos(phi1),\n delta = lambda1 - lambda0,\n sign = delta >= 0 ? 1 : -1,\n absDelta = sign * delta,\n antimeridian = absDelta > pi,\n k = sinPhi0 * sinPhi1;\n\n sum.add(atan2(k * sign * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta)));\n angle += antimeridian ? delta + sign * tau : delta;\n\n // Are the longitudes either side of the point’s meridian (lambda),\n // and are the latitudes smaller than the parallel (phi)?\n if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {\n var arc = cartesianCross(cartesian(point0), cartesian(point1));\n cartesianNormalizeInPlace(arc);\n var intersection = cartesianCross(normal, arc);\n cartesianNormalizeInPlace(intersection);\n var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);\n if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {\n winding += antimeridian ^ delta >= 0 ? 1 : -1;\n }\n }\n }\n }\n\n // First, determine whether the South pole is inside or outside:\n //\n // It is inside if:\n // * the polygon winds around it in a clockwise direction.\n // * the polygon does not (cumulatively) wind around it, but has a negative\n // (counter-clockwise) area.\n //\n // Second, count the (signed) number of times a segment crosses a lambda\n // from the point to the South pole. If it is zero, then the point is the\n // same side as the South pole.\n\n return (angle < -epsilon || angle < epsilon && sum < -epsilon2) ^ (winding & 1);\n}\n","function* flatten(arrays) {\n for (const array of arrays) {\n yield* array;\n }\n}\n\nexport default function merge(arrays) {\n return Array.from(flatten(arrays));\n}\n","import clipBuffer from \"./buffer.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {epsilon, halfPi} from \"../math.js\";\nimport polygonContains from \"../polygonContains.js\";\nimport {merge} from \"d3-array\";\n\nexport default function(pointVisible, clipLine, interpolate, start) {\n return function(sink) {\n var line = clipLine(sink),\n ringBuffer = clipBuffer(),\n ringSink = clipLine(ringBuffer),\n polygonStarted = false,\n polygon,\n segments,\n ring;\n\n var clip = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() {\n clip.point = pointRing;\n clip.lineStart = ringStart;\n clip.lineEnd = ringEnd;\n segments = [];\n polygon = [];\n },\n polygonEnd: function() {\n clip.point = point;\n clip.lineStart = lineStart;\n clip.lineEnd = lineEnd;\n segments = merge(segments);\n var startInside = polygonContains(polygon, start);\n if (segments.length) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n clipRejoin(segments, compareIntersection, startInside, interpolate, sink);\n } else if (startInside) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n }\n if (polygonStarted) sink.polygonEnd(), polygonStarted = false;\n segments = polygon = null;\n },\n sphere: function() {\n sink.polygonStart();\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n sink.polygonEnd();\n }\n };\n\n function point(lambda, phi) {\n if (pointVisible(lambda, phi)) sink.point(lambda, phi);\n }\n\n function pointLine(lambda, phi) {\n line.point(lambda, phi);\n }\n\n function lineStart() {\n clip.point = pointLine;\n line.lineStart();\n }\n\n function lineEnd() {\n clip.point = point;\n line.lineEnd();\n }\n\n function pointRing(lambda, phi) {\n ring.push([lambda, phi]);\n ringSink.point(lambda, phi);\n }\n\n function ringStart() {\n ringSink.lineStart();\n ring = [];\n }\n\n function ringEnd() {\n pointRing(ring[0][0], ring[0][1]);\n ringSink.lineEnd();\n\n var clean = ringSink.clean(),\n ringSegments = ringBuffer.result(),\n i, n = ringSegments.length, m,\n segment,\n point;\n\n ring.pop();\n polygon.push(ring);\n ring = null;\n\n if (!n) return;\n\n // No intersections.\n if (clean & 1) {\n segment = ringSegments[0];\n if ((m = segment.length - 1) > 0) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n for (i = 0; i < m; ++i) sink.point((point = segment[i])[0], point[1]);\n sink.lineEnd();\n }\n return;\n }\n\n // Rejoin connected segments.\n // TODO reuse ringBuffer.rejoin()?\n if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));\n\n segments.push(ringSegments.filter(validSegment));\n }\n\n return clip;\n };\n}\n\nfunction validSegment(segment) {\n return segment.length > 1;\n}\n\n// Intersections are sorted along the clip edge. For both antimeridian cutting\n// and circle clipping, the same comparison is used.\nfunction compareIntersection(a, b) {\n return ((a = a.x)[0] < 0 ? a[1] - halfPi - epsilon : halfPi - a[1])\n - ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon : halfPi - b[1]);\n}\n","import clip from \"./index.js\";\nimport {abs, atan, cos, epsilon, halfPi, pi, sin} from \"../math.js\";\n\nexport default clip(\n function() { return true; },\n clipAntimeridianLine,\n clipAntimeridianInterpolate,\n [-pi, -halfPi]\n);\n\n// Takes a line and cuts into visible segments. Return values: 0 - there were\n// intersections or the line was empty; 1 - no intersections; 2 - there were\n// intersections, and the first and last segments should be rejoined.\nfunction clipAntimeridianLine(stream) {\n var lambda0 = NaN,\n phi0 = NaN,\n sign0 = NaN,\n clean; // no intersections\n\n return {\n lineStart: function() {\n stream.lineStart();\n clean = 1;\n },\n point: function(lambda1, phi1) {\n var sign1 = lambda1 > 0 ? pi : -pi,\n delta = abs(lambda1 - lambda0);\n if (abs(delta - pi) < epsilon) { // line crosses a pole\n stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n stream.point(lambda1, phi0);\n clean = 0;\n } else if (sign0 !== sign1 && delta >= pi) { // line crosses antimeridian\n if (abs(lambda0 - sign0) < epsilon) lambda0 -= sign0 * epsilon; // handle degeneracies\n if (abs(lambda1 - sign1) < epsilon) lambda1 -= sign1 * epsilon;\n phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n clean = 0;\n }\n stream.point(lambda0 = lambda1, phi0 = phi1);\n sign0 = sign1;\n },\n lineEnd: function() {\n stream.lineEnd();\n lambda0 = phi0 = NaN;\n },\n clean: function() {\n return 2 - clean; // if intersections, rejoin first and last segments\n }\n };\n}\n\nfunction clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) {\n var cosPhi0,\n cosPhi1,\n sinLambda0Lambda1 = sin(lambda0 - lambda1);\n return abs(sinLambda0Lambda1) > epsilon\n ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1)\n - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0))\n / (cosPhi0 * cosPhi1 * sinLambda0Lambda1))\n : (phi0 + phi1) / 2;\n}\n\nfunction clipAntimeridianInterpolate(from, to, direction, stream) {\n var phi;\n if (from == null) {\n phi = direction * halfPi;\n stream.point(-pi, phi);\n stream.point(0, phi);\n stream.point(pi, phi);\n stream.point(pi, 0);\n stream.point(pi, -phi);\n stream.point(0, -phi);\n stream.point(-pi, -phi);\n stream.point(-pi, 0);\n stream.point(-pi, phi);\n } else if (abs(from[0] - to[0]) > epsilon) {\n var lambda = from[0] < to[0] ? pi : -pi;\n phi = direction * lambda / 2;\n stream.point(-lambda, phi);\n stream.point(0, phi);\n stream.point(lambda, phi);\n } else {\n stream.point(to[0], to[1]);\n }\n}\n","import {cartesian, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport constant from \"./constant.js\";\nimport {acos, cos, degrees, epsilon, radians, sin, tau} from \"./math.js\";\nimport {rotateRadians} from \"./rotation.js\";\n\n// Generates a circle centered at [0°, 0°], with a given radius and precision.\nexport function circleStream(stream, radius, delta, direction, t0, t1) {\n if (!delta) return;\n var cosRadius = cos(radius),\n sinRadius = sin(radius),\n step = direction * delta;\n if (t0 == null) {\n t0 = radius + direction * tau;\n t1 = radius - step / 2;\n } else {\n t0 = circleRadius(cosRadius, t0);\n t1 = circleRadius(cosRadius, t1);\n if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau;\n }\n for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) {\n point = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * sin(t)]);\n stream.point(point[0], point[1]);\n }\n}\n\n// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0].\nfunction circleRadius(cosRadius, point) {\n point = cartesian(point), point[0] -= cosRadius;\n cartesianNormalizeInPlace(point);\n var radius = acos(-point[1]);\n return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;\n}\n\nexport default function() {\n var center = constant([0, 0]),\n radius = constant(90),\n precision = constant(6),\n ring,\n rotate,\n stream = {point: point};\n\n function point(x, y) {\n ring.push(x = rotate(x, y));\n x[0] *= degrees, x[1] *= degrees;\n }\n\n function circle() {\n var c = center.apply(this, arguments),\n r = radius.apply(this, arguments) * radians,\n p = precision.apply(this, arguments) * radians;\n ring = [];\n rotate = rotateRadians(-c[0] * radians, -c[1] * radians, 0).invert;\n circleStream(stream, r, p, 1);\n c = {type: \"Polygon\", coordinates: [ring]};\n ring = rotate = null;\n return c;\n }\n\n circle.center = function(_) {\n return arguments.length ? (center = typeof _ === \"function\" ? _ : constant([+_[0], +_[1]]), circle) : center;\n };\n\n circle.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), circle) : radius;\n };\n\n circle.precision = function(_) {\n return arguments.length ? (precision = typeof _ === \"function\" ? _ : constant(+_), circle) : precision;\n };\n\n return circle;\n}\n","import {abs, epsilon} from \"../math.js\";\nimport clipBuffer from \"./buffer.js\";\nimport clipLine from \"./line.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {merge} from \"d3-array\";\n\nvar clipMax = 1e9, clipMin = -clipMax;\n\n// TODO Use d3-polygon’s polygonContains here for the ring check?\n// TODO Eliminate duplicate buffering in clipBuffer and polygon.push?\n\nexport default function clipRectangle(x0, y0, x1, y1) {\n\n function visible(x, y) {\n return x0 <= x && x <= x1 && y0 <= y && y <= y1;\n }\n\n function interpolate(from, to, direction, stream) {\n var a = 0, a1 = 0;\n if (from == null\n || (a = corner(from, direction)) !== (a1 = corner(to, direction))\n || comparePoint(from, to) < 0 ^ direction > 0) {\n do stream.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);\n while ((a = (a + direction + 4) % 4) !== a1);\n } else {\n stream.point(to[0], to[1]);\n }\n }\n\n function corner(p, direction) {\n return abs(p[0] - x0) < epsilon ? direction > 0 ? 0 : 3\n : abs(p[0] - x1) < epsilon ? direction > 0 ? 2 : 1\n : abs(p[1] - y0) < epsilon ? direction > 0 ? 1 : 0\n : direction > 0 ? 3 : 2; // abs(p[1] - y1) < epsilon\n }\n\n function compareIntersection(a, b) {\n return comparePoint(a.x, b.x);\n }\n\n function comparePoint(a, b) {\n var ca = corner(a, 1),\n cb = corner(b, 1);\n return ca !== cb ? ca - cb\n : ca === 0 ? b[1] - a[1]\n : ca === 1 ? a[0] - b[0]\n : ca === 2 ? a[1] - b[1]\n : b[0] - a[0];\n }\n\n return function(stream) {\n var activeStream = stream,\n bufferStream = clipBuffer(),\n segments,\n polygon,\n ring,\n x__, y__, v__, // first point\n x_, y_, v_, // previous point\n first,\n clean;\n\n var clipStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: polygonStart,\n polygonEnd: polygonEnd\n };\n\n function point(x, y) {\n if (visible(x, y)) activeStream.point(x, y);\n }\n\n function polygonInside() {\n var winding = 0;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n for (var ring = polygon[i], j = 1, m = ring.length, point = ring[0], a0, a1, b0 = point[0], b1 = point[1]; j < m; ++j) {\n a0 = b0, a1 = b1, point = ring[j], b0 = point[0], b1 = point[1];\n if (a1 <= y1) { if (b1 > y1 && (b0 - a0) * (y1 - a1) > (b1 - a1) * (x0 - a0)) ++winding; }\n else { if (b1 <= y1 && (b0 - a0) * (y1 - a1) < (b1 - a1) * (x0 - a0)) --winding; }\n }\n }\n\n return winding;\n }\n\n // Buffer geometry within a polygon and then clip it en masse.\n function polygonStart() {\n activeStream = bufferStream, segments = [], polygon = [], clean = true;\n }\n\n function polygonEnd() {\n var startInside = polygonInside(),\n cleanInside = clean && startInside,\n visible = (segments = merge(segments)).length;\n if (cleanInside || visible) {\n stream.polygonStart();\n if (cleanInside) {\n stream.lineStart();\n interpolate(null, null, 1, stream);\n stream.lineEnd();\n }\n if (visible) {\n clipRejoin(segments, compareIntersection, startInside, interpolate, stream);\n }\n stream.polygonEnd();\n }\n activeStream = stream, segments = polygon = ring = null;\n }\n\n function lineStart() {\n clipStream.point = linePoint;\n if (polygon) polygon.push(ring = []);\n first = true;\n v_ = false;\n x_ = y_ = NaN;\n }\n\n // TODO rather than special-case polygons, simply handle them separately.\n // Ideally, coincident intersection points should be jittered to avoid\n // clipping issues.\n function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }\n\n function linePoint(x, y) {\n var v = visible(x, y);\n if (polygon) ring.push([x, y]);\n if (first) {\n x__ = x, y__ = y, v__ = v;\n first = false;\n if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n }\n } else {\n if (v && v_) activeStream.point(x, y);\n else {\n var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))],\n b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))];\n if (clipLine(a, b, x0, y0, x1, y1)) {\n if (!v_) {\n activeStream.lineStart();\n activeStream.point(a[0], a[1]);\n }\n activeStream.point(b[0], b[1]);\n if (!v) activeStream.lineEnd();\n clean = false;\n } else if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n clean = false;\n }\n }\n }\n x_ = x, y_ = y, v_ = v;\n }\n\n return clipStream;\n };\n}\n","export default function(a, b, x0, y0, x1, y1) {\n var ax = a[0],\n ay = a[1],\n bx = b[0],\n by = b[1],\n t0 = 0,\n t1 = 1,\n dx = bx - ax,\n dy = by - ay,\n r;\n\n r = x0 - ax;\n if (!dx && r > 0) return;\n r /= dx;\n if (dx < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dx > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = x1 - ax;\n if (!dx && r < 0) return;\n r /= dx;\n if (dx < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dx > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n r = y0 - ay;\n if (!dy && r > 0) return;\n r /= dy;\n if (dy < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dy > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = y1 - ay;\n if (!dy && r < 0) return;\n r /= dy;\n if (dy < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dy > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy;\n if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy;\n return true;\n}\n","export default function(a, b) {\n\n function compose(x, y) {\n return x = a(x, y), b(x[0], x[1]);\n }\n\n if (a.invert && b.invert) compose.invert = function(x, y) {\n return x = b.invert(x, y), x && a.invert(x[0], x[1]);\n };\n\n return compose;\n}\n","import compose from \"./compose.js\";\nimport {abs, asin, atan2, cos, degrees, pi, radians, sin, tau} from \"./math.js\";\n\nfunction rotationIdentity(lambda, phi) {\n if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;\n return [lambda, phi];\n}\n\nrotationIdentity.invert = rotationIdentity;\n\nexport function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {\n return (deltaLambda %= tau) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma))\n : rotationLambda(deltaLambda))\n : (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma)\n : rotationIdentity);\n}\n\nfunction forwardRotationLambda(deltaLambda) {\n return function(lambda, phi) {\n lambda += deltaLambda;\n if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;\n return [lambda, phi];\n };\n}\n\nfunction rotationLambda(deltaLambda) {\n var rotation = forwardRotationLambda(deltaLambda);\n rotation.invert = forwardRotationLambda(-deltaLambda);\n return rotation;\n}\n\nfunction rotationPhiGamma(deltaPhi, deltaGamma) {\n var cosDeltaPhi = cos(deltaPhi),\n sinDeltaPhi = sin(deltaPhi),\n cosDeltaGamma = cos(deltaGamma),\n sinDeltaGamma = sin(deltaGamma);\n\n function rotation(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaPhi + x * sinDeltaPhi;\n return [\n atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),\n asin(k * cosDeltaGamma + y * sinDeltaGamma)\n ];\n }\n\n rotation.invert = function(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaGamma - y * sinDeltaGamma;\n return [\n atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),\n asin(k * cosDeltaPhi - x * sinDeltaPhi)\n ];\n };\n\n return rotation;\n}\n\nexport default function(rotate) {\n rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);\n\n function forward(coordinates) {\n coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n }\n\n forward.invert = function(coordinates) {\n coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n };\n\n return forward;\n}\n","export default function(methods) {\n return {\n stream: transformer(methods)\n };\n}\n\nexport function transformer(methods) {\n return function(stream) {\n var s = new TransformStream;\n for (var key in methods) s[key] = methods[key];\n s.stream = stream;\n return s;\n };\n}\n\nfunction TransformStream() {}\n\nTransformStream.prototype = {\n constructor: TransformStream,\n point: function(x, y) { this.stream.point(x, y); },\n sphere: function() { this.stream.sphere(); },\n lineStart: function() { this.stream.lineStart(); },\n lineEnd: function() { this.stream.lineEnd(); },\n polygonStart: function() { this.stream.polygonStart(); },\n polygonEnd: function() { this.stream.polygonEnd(); }\n};\n","import {default as geoStream} from \"../stream.js\";\nimport boundsStream from \"../path/bounds.js\";\n\nfunction fit(projection, fitBounds, object) {\n var clip = projection.clipExtent && projection.clipExtent();\n projection.scale(150).translate([0, 0]);\n if (clip != null) projection.clipExtent(null);\n geoStream(object, projection.stream(boundsStream));\n fitBounds(boundsStream.result());\n if (clip != null) projection.clipExtent(clip);\n return projection;\n}\n\nexport function fitExtent(projection, extent, object) {\n return fit(projection, function(b) {\n var w = extent[1][0] - extent[0][0],\n h = extent[1][1] - extent[0][1],\n k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])),\n x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2,\n y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitSize(projection, size, object) {\n return fitExtent(projection, [[0, 0], size], object);\n}\n\nexport function fitWidth(projection, width, object) {\n return fit(projection, function(b) {\n var w = +width,\n k = w / (b[1][0] - b[0][0]),\n x = (w - k * (b[1][0] + b[0][0])) / 2,\n y = -k * b[0][1];\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitHeight(projection, height, object) {\n return fit(projection, function(b) {\n var h = +height,\n k = h / (b[1][1] - b[0][1]),\n x = -k * b[0][0],\n y = (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n","import {cartesian} from \"../cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, radians, sqrt} from \"../math.js\";\nimport {transformer} from \"../transform.js\";\n\nvar maxDepth = 16, // maximum depth of subdivision\n cosMinDistance = cos(30 * radians); // cos(minimum angular distance)\n\nexport default function(project, delta2) {\n return +delta2 ? resample(project, delta2) : resampleNone(project);\n}\n\nfunction resampleNone(project) {\n return transformer({\n point: function(x, y) {\n x = project(x, y);\n this.stream.point(x[0], x[1]);\n }\n });\n}\n\nfunction resample(project, delta2) {\n\n function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) {\n var dx = x1 - x0,\n dy = y1 - y0,\n d2 = dx * dx + dy * dy;\n if (d2 > 4 * delta2 && depth--) {\n var a = a0 + a1,\n b = b0 + b1,\n c = c0 + c1,\n m = sqrt(a * a + b * b + c * c),\n phi2 = asin(c /= m),\n lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a),\n p = project(lambda2, phi2),\n x2 = p[0],\n y2 = p[1],\n dx2 = x2 - x0,\n dy2 = y2 - y0,\n dz = dy * dx2 - dx * dy2;\n if (dz * dz / d2 > delta2 // perpendicular projected distance\n || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end\n || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream);\n stream.point(x2, y2);\n resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream);\n }\n }\n }\n return function(stream) {\n var lambda00, x00, y00, a00, b00, c00, // first point\n lambda0, x0, y0, a0, b0, c0; // previous point\n\n var resampleStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; },\n polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; }\n };\n\n function point(x, y) {\n x = project(x, y);\n stream.point(x[0], x[1]);\n }\n\n function lineStart() {\n x0 = NaN;\n resampleStream.point = linePoint;\n stream.lineStart();\n }\n\n function linePoint(lambda, phi) {\n var c = cartesian([lambda, phi]), p = project(lambda, phi);\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);\n stream.point(x0, y0);\n }\n\n function lineEnd() {\n resampleStream.point = point;\n stream.lineEnd();\n }\n\n function ringStart() {\n lineStart();\n resampleStream.point = ringPoint;\n resampleStream.lineEnd = ringEnd;\n }\n\n function ringPoint(lambda, phi) {\n linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;\n resampleStream.point = linePoint;\n }\n\n function ringEnd() {\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream);\n resampleStream.lineEnd = lineEnd;\n lineEnd();\n }\n\n return resampleStream;\n };\n}\n","import clipAntimeridian from \"../clip/antimeridian.js\";\nimport clipCircle from \"../clip/circle.js\";\nimport clipRectangle from \"../clip/rectangle.js\";\nimport compose from \"../compose.js\";\nimport identity from \"../identity.js\";\nimport {cos, degrees, radians, sin, sqrt} from \"../math.js\";\nimport {rotateRadians} from \"../rotation.js\";\nimport {transformer} from \"../transform.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\nimport resample from \"./resample.js\";\n\nvar transformRadians = transformer({\n point: function(x, y) {\n this.stream.point(x * radians, y * radians);\n }\n});\n\nfunction transformRotate(rotate) {\n return transformer({\n point: function(x, y) {\n var r = rotate(x, y);\n return this.stream.point(r[0], r[1]);\n }\n });\n}\n\nfunction scaleTranslate(k, dx, dy, sx, sy) {\n function transform(x, y) {\n x *= sx; y *= sy;\n return [dx + k * x, dy - k * y];\n }\n transform.invert = function(x, y) {\n return [(x - dx) / k * sx, (dy - y) / k * sy];\n };\n return transform;\n}\n\nfunction scaleTranslateRotate(k, dx, dy, sx, sy, alpha) {\n if (!alpha) return scaleTranslate(k, dx, dy, sx, sy);\n var cosAlpha = cos(alpha),\n sinAlpha = sin(alpha),\n a = cosAlpha * k,\n b = sinAlpha * k,\n ai = cosAlpha / k,\n bi = sinAlpha / k,\n ci = (sinAlpha * dy - cosAlpha * dx) / k,\n fi = (sinAlpha * dx + cosAlpha * dy) / k;\n function transform(x, y) {\n x *= sx; y *= sy;\n return [a * x - b * y + dx, dy - b * x - a * y];\n }\n transform.invert = function(x, y) {\n return [sx * (ai * x - bi * y + ci), sy * (fi - bi * x - ai * y)];\n };\n return transform;\n}\n\nexport default function projection(project) {\n return projectionMutator(function() { return project; })();\n}\n\nexport function projectionMutator(projectAt) {\n var project,\n k = 150, // scale\n x = 480, y = 250, // translate\n lambda = 0, phi = 0, // center\n deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, // pre-rotate\n alpha = 0, // post-rotate angle\n sx = 1, // reflectX\n sy = 1, // reflectX\n theta = null, preclip = clipAntimeridian, // pre-clip angle\n x0 = null, y0, x1, y1, postclip = identity, // post-clip extent\n delta2 = 0.5, // precision\n projectResample,\n projectTransform,\n projectRotateTransform,\n cache,\n cacheStream;\n\n function projection(point) {\n return projectRotateTransform(point[0] * radians, point[1] * radians);\n }\n\n function invert(point) {\n point = projectRotateTransform.invert(point[0], point[1]);\n return point && [point[0] * degrees, point[1] * degrees];\n }\n\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));\n };\n\n projection.preclip = function(_) {\n return arguments.length ? (preclip = _, theta = undefined, reset()) : preclip;\n };\n\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\n };\n\n projection.clipAngle = function(_) {\n return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees;\n };\n\n projection.clipExtent = function(_) {\n return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n projection.scale = function(_) {\n return arguments.length ? (k = +_, recenter()) : k;\n };\n\n projection.translate = function(_) {\n return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y];\n };\n\n projection.center = function(_) {\n return arguments.length ? (lambda = _[0] % 360 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];\n };\n\n projection.rotate = function(_) {\n return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];\n };\n\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, recenter()) : alpha * degrees;\n };\n\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, recenter()) : sx < 0;\n };\n\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0;\n };\n\n projection.precision = function(_) {\n return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2);\n };\n\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n function recenter() {\n var center = scaleTranslateRotate(k, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)),\n transform = scaleTranslateRotate(k, x - center[0], y - center[1], sx, sy, alpha);\n rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma);\n projectTransform = compose(project, transform);\n projectRotateTransform = compose(rotate, projectTransform);\n projectResample = resample(projectTransform, delta2);\n return reset();\n }\n\n function reset() {\n cache = cacheStream = null;\n return projection;\n }\n\n return function() {\n project = projectAt.apply(this, arguments);\n projection.invert = project.invert && invert;\n return recenter();\n };\n}\n","import {cartesian, cartesianAddInPlace, cartesianCross, cartesianDot, cartesianScale, spherical} from \"../cartesian.js\";\nimport {circleStream} from \"../circle.js\";\nimport {abs, cos, epsilon, pi, radians, sqrt} from \"../math.js\";\nimport pointEqual from \"../pointEqual.js\";\nimport clip from \"./index.js\";\n\nexport default function(radius) {\n var cr = cos(radius),\n delta = 6 * radians,\n smallRadius = cr > 0,\n notHemisphere = abs(cr) > epsilon; // TODO optimise for this common case\n\n function interpolate(from, to, direction, stream) {\n circleStream(stream, radius, delta, direction, from, to);\n }\n\n function visible(lambda, phi) {\n return cos(lambda) * cos(phi) > cr;\n }\n\n // Takes a line and cuts into visible segments. Return values used for polygon\n // clipping: 0 - there were intersections or the line was empty; 1 - no\n // intersections 2 - there were intersections, and the first and last segments\n // should be rejoined.\n function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }\n\n // Intersects the great circle between a and b with the clip circle.\n function intersect(a, b, two) {\n var pa = cartesian(a),\n pb = cartesian(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = cartesianCross(pa, pb),\n n2n2 = cartesianDot(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = cartesianCross(n1, n2),\n A = cartesianScale(n1, c1),\n B = cartesianScale(n2, c2);\n cartesianAddInPlace(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = cartesianDot(A, u),\n uu = cartesianDot(u, u),\n t2 = w * w - uu * (cartesianDot(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = sqrt(t2),\n q = cartesianScale(u, (-w - t) / uu);\n cartesianAddInPlace(q, A);\n q = spherical(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = abs(delta - pi) < epsilon,\n meridian = polar || delta < epsilon;\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = cartesianScale(u, (-w + t) / uu);\n cartesianAddInPlace(q1, A);\n return [q, spherical(q1)];\n }\n }\n\n // Generates a 4-bit vector representing the location of a point relative to\n // the small circle's bounding box.\n function code(lambda, phi) {\n var r = smallRadius ? radius : pi - radius,\n code = 0;\n if (lambda < -r) code |= 1; // left\n else if (lambda > r) code |= 2; // right\n if (phi < -r) code |= 4; // below\n else if (phi > r) code |= 8; // above\n return code;\n }\n\n return clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);\n}\n","import {degrees, pi, radians} from \"../math.js\";\nimport {projectionMutator} from \"./index.js\";\n\nexport function conicProjection(projectAt) {\n var phi0 = 0,\n phi1 = pi / 3,\n m = projectionMutator(projectAt),\n p = m(phi0, phi1);\n\n p.parallels = function(_) {\n return arguments.length ? m(phi0 = _[0] * radians, phi1 = _[1] * radians) : [phi0 * degrees, phi1 * degrees];\n };\n\n return p;\n}\n","import {abs, asin, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {cylindricalEqualAreaRaw} from \"./cylindricalEqualArea.js\";\n\nexport function conicEqualAreaRaw(y0, y1) {\n var sy0 = sin(y0), n = (sy0 + sin(y1)) / 2;\n\n // Are the parallels symmetrical around the Equator?\n if (abs(n) < epsilon) return cylindricalEqualAreaRaw(y0);\n\n var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c) / n;\n\n function project(x, y) {\n var r = sqrt(c - 2 * n * sin(y)) / n;\n return [r * sin(x *= n), r0 - r * cos(x)];\n }\n\n project.invert = function(x, y) {\n var r0y = r0 - y,\n l = atan2(x, abs(r0y)) * sign(r0y);\n if (r0y * n < 0)\n l -= pi * sign(x) * sign(r0y);\n return [l / n, asin((c - (x * x + r0y * r0y) * n * n) / (2 * n))];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEqualAreaRaw)\n .scale(155.424)\n .center([0, 33.6442]);\n}\n","import {asin, cos, sin} from \"../math.js\";\n\nexport function cylindricalEqualAreaRaw(phi0) {\n var cosPhi0 = cos(phi0);\n\n function forward(lambda, phi) {\n return [lambda * cosPhi0, sin(phi) / cosPhi0];\n }\n\n forward.invert = function(x, y) {\n return [x / cosPhi0, asin(y * cosPhi0)];\n };\n\n return forward;\n}\n","import conicEqualArea from \"./conicEqualArea.js\";\n\nexport default function() {\n return conicEqualArea()\n .parallels([29.5, 45.5])\n .scale(1070)\n .translate([480, 250])\n .rotate([96, 0])\n .center([-0.6, 38.7]);\n}\n","import {asin, atan2, cos, sin, sqrt} from \"../math.js\";\n\nexport function azimuthalRaw(scale) {\n return function(x, y) {\n var cx = cos(x),\n cy = cos(y),\n k = scale(cx * cy);\n if (k === Infinity) return [2, 0];\n return [\n k * cy * sin(x),\n k * sin(y)\n ];\n }\n}\n\nexport function azimuthalInvert(angle) {\n return function(x, y) {\n var z = sqrt(x * x + y * y),\n c = angle(z),\n sc = sin(c),\n cc = cos(c);\n return [\n atan2(x * sc, z * cc),\n asin(z && y * sc / z)\n ];\n }\n}\n","import {asin, sqrt} from \"../math.js\";\nimport {azimuthalRaw, azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport var azimuthalEqualAreaRaw = azimuthalRaw(function(cxcy) {\n return sqrt(2 / (1 + cxcy));\n});\n\nazimuthalEqualAreaRaw.invert = azimuthalInvert(function(z) {\n return 2 * asin(z / 2);\n});\n\nexport default function() {\n return projection(azimuthalEqualAreaRaw)\n .scale(124.75)\n .clipAngle(180 - 1e-3);\n}\n","import {acos, sin} from \"../math.js\";\nimport {azimuthalRaw, azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport var azimuthalEquidistantRaw = azimuthalRaw(function(c) {\n return (c = acos(c)) && c / sin(c);\n});\n\nazimuthalEquidistantRaw.invert = azimuthalInvert(function(z) {\n return z;\n});\n\nexport default function() {\n return projection(azimuthalEquidistantRaw)\n .scale(79.4188)\n .clipAngle(180 - 1e-3);\n}\n","import {atan, exp, halfPi, log, pi, tan, tau} from \"../math.js\";\nimport rotation from \"../rotation.js\";\nimport projection from \"./index.js\";\n\nexport function mercatorRaw(lambda, phi) {\n return [lambda, log(tan((halfPi + phi) / 2))];\n}\n\nmercatorRaw.invert = function(x, y) {\n return [x, 2 * atan(exp(y)) - halfPi];\n};\n\nexport default function() {\n return mercatorProjection(mercatorRaw)\n .scale(961 / tau);\n}\n\nexport function mercatorProjection(project) {\n var m = projection(project),\n center = m.center,\n scale = m.scale,\n translate = m.translate,\n clipExtent = m.clipExtent,\n x0 = null, y0, x1, y1; // clip extent\n\n m.scale = function(_) {\n return arguments.length ? (scale(_), reclip()) : scale();\n };\n\n m.translate = function(_) {\n return arguments.length ? (translate(_), reclip()) : translate();\n };\n\n m.center = function(_) {\n return arguments.length ? (center(_), reclip()) : center();\n };\n\n m.clipExtent = function(_) {\n return arguments.length ? ((_ == null ? x0 = y0 = x1 = y1 = null : (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1])), reclip()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n function reclip() {\n var k = pi * scale(),\n t = m(rotation(m.rotate()).invert([0, 0]));\n return clipExtent(x0 == null\n ? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw\n ? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]]\n : [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]);\n }\n\n return reclip();\n}\n","import {abs, atan, atan2, cos, epsilon, halfPi, log, pi, pow, sign, sin, sqrt, tan} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {mercatorRaw} from \"./mercator.js\";\n\nfunction tany(y) {\n return tan((halfPi + y) / 2);\n}\n\nexport function conicConformalRaw(y0, y1) {\n var cy0 = cos(y0),\n n = y0 === y1 ? sin(y0) : log(cy0 / cos(y1)) / log(tany(y1) / tany(y0)),\n f = cy0 * pow(tany(y0), n) / n;\n\n if (!n) return mercatorRaw;\n\n function project(x, y) {\n if (f > 0) { if (y < -halfPi + epsilon) y = -halfPi + epsilon; }\n else { if (y > halfPi - epsilon) y = halfPi - epsilon; }\n var r = f / pow(tany(y), n);\n return [r * sin(n * x), f - r * cos(n * x)];\n }\n\n project.invert = function(x, y) {\n var fy = f - y, r = sign(n) * sqrt(x * x + fy * fy),\n l = atan2(x, abs(fy)) * sign(fy);\n if (fy * n < 0)\n l -= pi * sign(x) * sign(fy);\n return [l / n, 2 * atan(pow(f / r, 1 / n)) - halfPi];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicConformalRaw)\n .scale(109.5)\n .parallels([30, 30]);\n}\n","import projection from \"./index.js\";\n\nexport function equirectangularRaw(lambda, phi) {\n return [lambda, phi];\n}\n\nequirectangularRaw.invert = equirectangularRaw;\n\nexport default function() {\n return projection(equirectangularRaw)\n .scale(152.63);\n}\n","import {abs, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {equirectangularRaw} from \"./equirectangular.js\";\n\nexport function conicEquidistantRaw(y0, y1) {\n var cy0 = cos(y0),\n n = y0 === y1 ? sin(y0) : (cy0 - cos(y1)) / (y1 - y0),\n g = cy0 / n + y0;\n\n if (abs(n) < epsilon) return equirectangularRaw;\n\n function project(x, y) {\n var gy = g - y, nx = n * x;\n return [gy * sin(nx), g - gy * cos(nx)];\n }\n\n project.invert = function(x, y) {\n var gy = g - y,\n l = atan2(x, abs(gy)) * sign(gy);\n if (gy * n < 0)\n l -= pi * sign(x) * sign(gy);\n return [l / n, g - sign(n) * sqrt(x * x + gy * gy)];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEquidistantRaw)\n .scale(131.154)\n .center([0, 13.9389]);\n}\n","import projection from \"./index.js\";\nimport {abs, asin, cos, epsilon2, sin, sqrt} from \"../math.js\";\n\nvar A1 = 1.340264,\n A2 = -0.081106,\n A3 = 0.000893,\n A4 = 0.003796,\n M = sqrt(3) / 2,\n iterations = 12;\n\nexport function equalEarthRaw(lambda, phi) {\n var l = asin(M * sin(phi)), l2 = l * l, l6 = l2 * l2 * l2;\n return [\n lambda * cos(l) / (M * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2))),\n l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2))\n ];\n}\n\nequalEarthRaw.invert = function(x, y) {\n var l = y, l2 = l * l, l6 = l2 * l2 * l2;\n for (var i = 0, delta, fy, fpy; i < iterations; ++i) {\n fy = l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - y;\n fpy = A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2);\n l -= delta = fy / fpy, l2 = l * l, l6 = l2 * l2 * l2;\n if (abs(delta) < epsilon2) break;\n }\n return [\n M * x * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / cos(l),\n asin(sin(l) / M)\n ];\n};\n\nexport default function() {\n return projection(equalEarthRaw)\n .scale(177.158);\n}\n","import {atan, cos, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function gnomonicRaw(x, y) {\n var cy = cos(y), k = cos(x) * cy;\n return [cy * sin(x) / k, sin(y) / k];\n}\n\ngnomonicRaw.invert = azimuthalInvert(atan);\n\nexport default function() {\n return projection(gnomonicRaw)\n .scale(144.049)\n .clipAngle(60);\n}\n","import projection from \"./index.js\";\nimport {abs, epsilon} from \"../math.js\";\n\nexport function naturalEarth1Raw(lambda, phi) {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n return [\n lambda * (0.8707 - 0.131979 * phi2 + phi4 * (-0.013791 + phi4 * (0.003971 * phi2 - 0.001529 * phi4))),\n phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4)))\n ];\n}\n\nnaturalEarth1Raw.invert = function(x, y) {\n var phi = y, i = 25, delta;\n do {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n phi -= delta = (phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) - y) /\n (1.007226 + phi2 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi2 - 0.005916 * 11 * phi4)));\n } while (abs(delta) > epsilon && --i > 0);\n return [\n x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))),\n phi\n ];\n};\n\nexport default function() {\n return projection(naturalEarth1Raw)\n .scale(175.295);\n}\n","import {asin, cos, epsilon, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function orthographicRaw(x, y) {\n return [cos(y) * sin(x), sin(y)];\n}\n\northographicRaw.invert = azimuthalInvert(asin);\n\nexport default function() {\n return projection(orthographicRaw)\n .scale(249.5)\n .clipAngle(90 + epsilon);\n}\n","import {atan, cos, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function stereographicRaw(x, y) {\n var cy = cos(y), k = 1 + cos(x) * cy;\n return [cy * sin(x) / k, sin(y) / k];\n}\n\nstereographicRaw.invert = azimuthalInvert(function(z) {\n return 2 * atan(z);\n});\n\nexport default function() {\n return projection(stereographicRaw)\n .scale(250)\n .clipAngle(142);\n}\n","import {atan, exp, halfPi, log, tan} from \"../math.js\";\nimport {mercatorProjection} from \"./mercator.js\";\n\nexport function transverseMercatorRaw(lambda, phi) {\n return [log(tan((halfPi + phi) / 2)), -lambda];\n}\n\ntransverseMercatorRaw.invert = function(x, y) {\n return [-y, 2 * atan(exp(x)) - halfPi];\n};\n\nexport default function() {\n var m = mercatorProjection(transverseMercatorRaw),\n center = m.center,\n rotate = m.rotate;\n\n m.center = function(_) {\n return arguments.length ? center([-_[1], _[0]]) : (_ = center(), [_[1], -_[0]]);\n };\n\n m.rotate = function(_) {\n return arguments.length ? rotate([_[0], _[1], _.length > 2 ? _[2] + 90 : 90]) : (_ = rotate(), [_[0], _[1], _[2] - 90]);\n };\n\n return rotate([0, 0, 90])\n .scale(159.155);\n}\n","export var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var ceil = Math.ceil;\nexport var cos = Math.cos;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var log = Math.log;\nexport var max = Math.max;\nexport var min = Math.min;\nexport var pow = Math.pow;\nexport var round = Math.round;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sin = Math.sin;\nexport var tan = Math.tan;\n\nexport var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var sqrt1_2 = Math.SQRT1_2;\nexport var sqrt2 = sqrt(2);\nexport var sqrtPi = sqrt(pi);\nexport var tau = pi * 2;\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport function sinci(x) {\n return x ? x / Math.sin(x) : 1;\n}\n\nexport function asin(x) {\n return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);\n}\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function sqrt(x) {\n return x > 0 ? Math.sqrt(x) : 0;\n}\n\nexport function tanh(x) {\n x = exp(2 * x);\n return (x - 1) / (x + 1);\n}\n\nexport function sinh(x) {\n return (exp(x) - exp(-x)) / 2;\n}\n\nexport function cosh(x) {\n return (exp(x) + exp(-x)) / 2;\n}\n\nexport function arsinh(x) {\n return log(x + sqrt(x * x + 1));\n}\n\nexport function arcosh(x) {\n return log(x + sqrt(x * x - 1));\n}\n","import {geoProjection as projection} from \"d3-geo\";\nimport {abs, asin, cos, epsilon, halfPi, pi, sin, sqrt2} from \"./math.js\";\n\nexport function mollweideBromleyTheta(cp, phi) {\n var cpsinPhi = cp * sin(phi), i = 30, delta;\n do phi -= delta = (phi + sin(phi) - cpsinPhi) / (1 + cos(phi));\n while (abs(delta) > epsilon && --i > 0);\n return phi / 2;\n}\n\nexport function mollweideBromleyRaw(cx, cy, cp) {\n\n function forward(lambda, phi) {\n return [cx * lambda * cos(phi = mollweideBromleyTheta(cp, phi)), cy * sin(phi)];\n }\n\n forward.invert = function(x, y) {\n return y = asin(y / cy), [x / (cx * cos(y)), asin((2 * y + sin(2 * y)) / cp)];\n };\n\n return forward;\n}\n\nexport var mollweideRaw = mollweideBromleyRaw(sqrt2 / halfPi, sqrt2, pi);\n\nexport default function() {\n return projection(mollweideRaw)\n .scale(169.529);\n}\n","import { geoPath, geoAlbers, geoAlbersUsa, geoAzimuthalEqualArea, geoAzimuthalEquidistant, geoConicConformal, geoConicEqualArea, geoConicEquidistant, geoEqualEarth, geoEquirectangular, geoGnomonic, geoIdentity, geoMercator, geoNaturalEarth1, geoOrthographic, geoStereographic, geoTransverseMercator } from 'd3-geo';\nimport { geoMollweide } from 'd3-geo-projection';\nimport { registerScale } from 'vega-scale';\n\nconst defaultPath = geoPath();\nconst projectionProperties = [\n// standard properties in d3-geo\n'clipAngle', 'clipExtent', 'scale', 'translate', 'center', 'rotate', 'parallels', 'precision', 'reflectX', 'reflectY',\n// extended properties in d3-geo-projections\n'coefficient', 'distance', 'fraction', 'lobes', 'parallel', 'radius', 'ratio', 'spacing', 'tilt'];\n\n/**\n * Augment projections with their type and a copy method.\n */\nfunction create(type, constructor) {\n return function projection() {\n const p = constructor();\n p.type = type;\n p.path = geoPath().projection(p);\n p.copy = p.copy || function () {\n const c = projection();\n projectionProperties.forEach(prop => {\n if (p[prop]) c[prop](p[prop]());\n });\n c.path.pointRadius(p.path.pointRadius());\n return c;\n };\n return registerScale(p);\n };\n}\nfunction projection(type, proj) {\n if (!type || typeof type !== 'string') {\n throw new Error('Projection type must be a name string.');\n }\n type = type.toLowerCase();\n if (arguments.length > 1) {\n projections[type] = create(type, proj);\n return this;\n } else {\n return projections[type] || null;\n }\n}\nfunction getProjectionPath(proj) {\n return proj && proj.path || defaultPath;\n}\nconst projections = {\n // base d3-geo projection types\n albers: geoAlbers,\n albersusa: geoAlbersUsa,\n azimuthalequalarea: geoAzimuthalEqualArea,\n azimuthalequidistant: geoAzimuthalEquidistant,\n conicconformal: geoConicConformal,\n conicequalarea: geoConicEqualArea,\n conicequidistant: geoConicEquidistant,\n equalEarth: geoEqualEarth,\n equirectangular: geoEquirectangular,\n gnomonic: geoGnomonic,\n identity: geoIdentity,\n mercator: geoMercator,\n mollweide: geoMollweide,\n naturalEarth1: geoNaturalEarth1,\n orthographic: geoOrthographic,\n stereographic: geoStereographic,\n transversemercator: geoTransverseMercator\n};\nfor (const key in projections) {\n projection(key, projections[key]);\n}\n\nexport { getProjectionPath, projection, projectionProperties };\n","import {epsilon} from \"../math.js\";\nimport albers from \"./albers.js\";\nimport conicEqualArea from \"./conicEqualArea.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\n\n// The projections must have mutually exclusive clip regions on the sphere,\n// as this will avoid emitting interleaving lines and polygons.\nfunction multiplex(streams) {\n var n = streams.length;\n return {\n point: function(x, y) { var i = -1; while (++i < n) streams[i].point(x, y); },\n sphere: function() { var i = -1; while (++i < n) streams[i].sphere(); },\n lineStart: function() { var i = -1; while (++i < n) streams[i].lineStart(); },\n lineEnd: function() { var i = -1; while (++i < n) streams[i].lineEnd(); },\n polygonStart: function() { var i = -1; while (++i < n) streams[i].polygonStart(); },\n polygonEnd: function() { var i = -1; while (++i < n) streams[i].polygonEnd(); }\n };\n}\n\n// A composite projection for the United States, configured by default for\n// 960×500. The projection also works quite well at 960×600 if you change the\n// scale to 1285 and adjust the translate accordingly. The set of standard\n// parallels for each region comes from USGS, which is published here:\n// http://egsc.usgs.gov/isb/pubs/MapProjections/projections.html#albers\nexport default function() {\n var cache,\n cacheStream,\n lower48 = albers(), lower48Point,\n alaska = conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338\n hawaii = conicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), hawaiiPoint, // ESRI:102007\n point, pointStream = {point: function(x, y) { point = [x, y]; }};\n\n function albersUsa(coordinates) {\n var x = coordinates[0], y = coordinates[1];\n return point = null,\n (lower48Point.point(x, y), point)\n || (alaskaPoint.point(x, y), point)\n || (hawaiiPoint.point(x, y), point);\n }\n\n albersUsa.invert = function(coordinates) {\n var k = lower48.scale(),\n t = lower48.translate(),\n x = (coordinates[0] - t[0]) / k,\n y = (coordinates[1] - t[1]) / k;\n return (y >= 0.120 && y < 0.234 && x >= -0.425 && x < -0.214 ? alaska\n : y >= 0.166 && y < 0.234 && x >= -0.214 && x < -0.115 ? hawaii\n : lower48).invert(coordinates);\n };\n\n albersUsa.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = multiplex([lower48.stream(cacheStream = stream), alaska.stream(stream), hawaii.stream(stream)]);\n };\n\n albersUsa.precision = function(_) {\n if (!arguments.length) return lower48.precision();\n lower48.precision(_), alaska.precision(_), hawaii.precision(_);\n return reset();\n };\n\n albersUsa.scale = function(_) {\n if (!arguments.length) return lower48.scale();\n lower48.scale(_), alaska.scale(_ * 0.35), hawaii.scale(_);\n return albersUsa.translate(lower48.translate());\n };\n\n albersUsa.translate = function(_) {\n if (!arguments.length) return lower48.translate();\n var k = lower48.scale(), x = +_[0], y = +_[1];\n\n lower48Point = lower48\n .translate(_)\n .clipExtent([[x - 0.455 * k, y - 0.238 * k], [x + 0.455 * k, y + 0.238 * k]])\n .stream(pointStream);\n\n alaskaPoint = alaska\n .translate([x - 0.307 * k, y + 0.201 * k])\n .clipExtent([[x - 0.425 * k + epsilon, y + 0.120 * k + epsilon], [x - 0.214 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n hawaiiPoint = hawaii\n .translate([x - 0.205 * k, y + 0.212 * k])\n .clipExtent([[x - 0.214 * k + epsilon, y + 0.166 * k + epsilon], [x - 0.115 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n return reset();\n };\n\n albersUsa.fitExtent = function(extent, object) {\n return fitExtent(albersUsa, extent, object);\n };\n\n albersUsa.fitSize = function(size, object) {\n return fitSize(albersUsa, size, object);\n };\n\n albersUsa.fitWidth = function(width, object) {\n return fitWidth(albersUsa, width, object);\n };\n\n albersUsa.fitHeight = function(height, object) {\n return fitHeight(albersUsa, height, object);\n };\n\n function reset() {\n cache = cacheStream = null;\n return albersUsa;\n }\n\n return albersUsa.scale(1070);\n}\n","import clipRectangle from \"../clip/rectangle.js\";\nimport identity from \"../identity.js\";\nimport {transformer} from \"../transform.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\nimport {cos, degrees, radians, sin} from \"../math.js\";\n\nexport default function() {\n var k = 1, tx = 0, ty = 0, sx = 1, sy = 1, // scale, translate and reflect\n alpha = 0, ca, sa, // angle\n x0 = null, y0, x1, y1, // clip extent\n kx = 1, ky = 1,\n transform = transformer({\n point: function(x, y) {\n var p = projection([x, y])\n this.stream.point(p[0], p[1]);\n }\n }),\n postclip = identity,\n cache,\n cacheStream;\n\n function reset() {\n kx = k * sx;\n ky = k * sy;\n cache = cacheStream = null;\n return projection;\n }\n\n function projection (p) {\n var x = p[0] * kx, y = p[1] * ky;\n if (alpha) {\n var t = y * ca - x * sa;\n x = x * ca + y * sa;\n y = t;\n } \n return [x + tx, y + ty];\n }\n projection.invert = function(p) {\n var x = p[0] - tx, y = p[1] - ty;\n if (alpha) {\n var t = y * ca + x * sa;\n x = x * ca - y * sa;\n y = t;\n }\n return [x / kx, y / ky];\n };\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transform(postclip(cacheStream = stream));\n };\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\n };\n projection.clipExtent = function(_) {\n return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n projection.scale = function(_) {\n return arguments.length ? (k = +_, reset()) : k;\n };\n projection.translate = function(_) {\n return arguments.length ? (tx = +_[0], ty = +_[1], reset()) : [tx, ty];\n }\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, sa = sin(alpha), ca = cos(alpha), reset()) : alpha * degrees;\n };\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, reset()) : sx < 0;\n };\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, reset()) : sy < 0;\n };\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n return projection;\n}\n","import {range} from \"d3-array\";\nimport {abs, ceil, epsilon} from \"./math.js\";\n\nfunction graticuleX(y0, y1, dy) {\n var y = range(y0, y1 - epsilon, dy).concat(y1);\n return function(x) { return y.map(function(y) { return [x, y]; }); };\n}\n\nfunction graticuleY(x0, x1, dx) {\n var x = range(x0, x1 - epsilon, dx).concat(x1);\n return function(y) { return x.map(function(x) { return [x, y]; }); };\n}\n\nexport default function graticule() {\n var x1, x0, X1, X0,\n y1, y0, Y1, Y0,\n dx = 10, dy = dx, DX = 90, DY = 360,\n x, y, X, Y,\n precision = 2.5;\n\n function graticule() {\n return {type: \"MultiLineString\", coordinates: lines()};\n }\n\n function lines() {\n return range(ceil(X0 / DX) * DX, X1, DX).map(X)\n .concat(range(ceil(Y0 / DY) * DY, Y1, DY).map(Y))\n .concat(range(ceil(x0 / dx) * dx, x1, dx).filter(function(x) { return abs(x % DX) > epsilon; }).map(x))\n .concat(range(ceil(y0 / dy) * dy, y1, dy).filter(function(y) { return abs(y % DY) > epsilon; }).map(y));\n }\n\n graticule.lines = function() {\n return lines().map(function(coordinates) { return {type: \"LineString\", coordinates: coordinates}; });\n };\n\n graticule.outline = function() {\n return {\n type: \"Polygon\",\n coordinates: [\n X(X0).concat(\n Y(Y1).slice(1),\n X(X1).reverse().slice(1),\n Y(Y0).reverse().slice(1))\n ]\n };\n };\n\n graticule.extent = function(_) {\n if (!arguments.length) return graticule.extentMinor();\n return graticule.extentMajor(_).extentMinor(_);\n };\n\n graticule.extentMajor = function(_) {\n if (!arguments.length) return [[X0, Y0], [X1, Y1]];\n X0 = +_[0][0], X1 = +_[1][0];\n Y0 = +_[0][1], Y1 = +_[1][1];\n if (X0 > X1) _ = X0, X0 = X1, X1 = _;\n if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.extentMinor = function(_) {\n if (!arguments.length) return [[x0, y0], [x1, y1]];\n x0 = +_[0][0], x1 = +_[1][0];\n y0 = +_[0][1], y1 = +_[1][1];\n if (x0 > x1) _ = x0, x0 = x1, x1 = _;\n if (y0 > y1) _ = y0, y0 = y1, y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.step = function(_) {\n if (!arguments.length) return graticule.stepMinor();\n return graticule.stepMajor(_).stepMinor(_);\n };\n\n graticule.stepMajor = function(_) {\n if (!arguments.length) return [DX, DY];\n DX = +_[0], DY = +_[1];\n return graticule;\n };\n\n graticule.stepMinor = function(_) {\n if (!arguments.length) return [dx, dy];\n dx = +_[0], dy = +_[1];\n return graticule;\n };\n\n graticule.precision = function(_) {\n if (!arguments.length) return precision;\n precision = +_;\n x = graticuleX(y0, y1, 90);\n y = graticuleY(x0, x1, precision);\n X = graticuleX(Y0, Y1, 90);\n Y = graticuleY(X0, X1, precision);\n return graticule;\n };\n\n return graticule\n .extentMajor([[-180, -90 + epsilon], [180, 90 - epsilon]])\n .extentMinor([[-180, -80 - epsilon], [180, 80 + epsilon]]);\n}\n\nexport function graticule10() {\n return graticule()();\n}\n","import { Transform, rederive, ingest, replace } from 'vega-dataflow';\nimport { error, extent, inherits, identity, isArray, isFunction, isNumber, array, constant, one, accessorName, accessorFields, field, extend, toSet, zero } from 'vega-util';\nimport { tickStep, range, max, sum } from 'd3-array';\nimport { bandwidthNRD } from 'vega-statistics';\nimport { getProjectionPath, projectionProperties, projection } from 'vega-projection';\nimport { geoGraticule } from 'd3-geo';\nimport { rgb } from 'd3-color';\nimport { canvas } from 'vega-canvas';\n\nfunction noop() {}\nconst cases = [[], [[[1.0, 1.5], [0.5, 1.0]]], [[[1.5, 1.0], [1.0, 1.5]]], [[[1.5, 1.0], [0.5, 1.0]]], [[[1.0, 0.5], [1.5, 1.0]]], [[[1.0, 1.5], [0.5, 1.0]], [[1.0, 0.5], [1.5, 1.0]]], [[[1.0, 0.5], [1.0, 1.5]]], [[[1.0, 0.5], [0.5, 1.0]]], [[[0.5, 1.0], [1.0, 0.5]]], [[[1.0, 1.5], [1.0, 0.5]]], [[[0.5, 1.0], [1.0, 0.5]], [[1.5, 1.0], [1.0, 1.5]]], [[[1.5, 1.0], [1.0, 0.5]]], [[[0.5, 1.0], [1.5, 1.0]]], [[[1.0, 1.5], [1.5, 1.0]]], [[[0.5, 1.0], [1.0, 1.5]]], []];\n\n// Implementation adapted from d3/d3-contour. Thanks!\nfunction contours () {\n var dx = 1,\n dy = 1,\n smooth = smoothLinear;\n function contours(values, tz) {\n return tz.map(value => contour(values, value));\n }\n\n // Accumulate, smooth contour rings, assign holes to exterior rings.\n // Based on https://github.com/mbostock/shapefile/blob/v0.6.2/shp/polygon.js\n function contour(values, value) {\n var polygons = [],\n holes = [];\n isorings(values, value, ring => {\n smooth(ring, values, value);\n if (area(ring) > 0) polygons.push([ring]);else holes.push(ring);\n });\n holes.forEach(hole => {\n for (var i = 0, n = polygons.length, polygon; i < n; ++i) {\n if (contains((polygon = polygons[i])[0], hole) !== -1) {\n polygon.push(hole);\n return;\n }\n }\n });\n return {\n type: 'MultiPolygon',\n value: value,\n coordinates: polygons\n };\n }\n\n // Marching squares with isolines stitched into rings.\n // Based on https://github.com/topojson/topojson-client/blob/v3.0.0/src/stitch.js\n function isorings(values, value, callback) {\n var fragmentByStart = [],\n fragmentByEnd = [],\n x,\n y,\n t0,\n t1,\n t2,\n t3;\n\n // Special case for the first row (y = -1, t2 = t3 = 0).\n x = y = -1;\n t1 = values[0] >= value;\n cases[t1 << 1].forEach(stitch);\n while (++x < dx - 1) {\n t0 = t1, t1 = values[x + 1] >= value;\n cases[t0 | t1 << 1].forEach(stitch);\n }\n cases[t1 << 0].forEach(stitch);\n\n // General case for the intermediate rows.\n while (++y < dy - 1) {\n x = -1;\n t1 = values[y * dx + dx] >= value;\n t2 = values[y * dx] >= value;\n cases[t1 << 1 | t2 << 2].forEach(stitch);\n while (++x < dx - 1) {\n t0 = t1, t1 = values[y * dx + dx + x + 1] >= value;\n t3 = t2, t2 = values[y * dx + x + 1] >= value;\n cases[t0 | t1 << 1 | t2 << 2 | t3 << 3].forEach(stitch);\n }\n cases[t1 | t2 << 3].forEach(stitch);\n }\n\n // Special case for the last row (y = dy - 1, t0 = t1 = 0).\n x = -1;\n t2 = values[y * dx] >= value;\n cases[t2 << 2].forEach(stitch);\n while (++x < dx - 1) {\n t3 = t2, t2 = values[y * dx + x + 1] >= value;\n cases[t2 << 2 | t3 << 3].forEach(stitch);\n }\n cases[t2 << 3].forEach(stitch);\n function stitch(line) {\n var start = [line[0][0] + x, line[0][1] + y],\n end = [line[1][0] + x, line[1][1] + y],\n startIndex = index(start),\n endIndex = index(end),\n f,\n g;\n if (f = fragmentByEnd[startIndex]) {\n if (g = fragmentByStart[endIndex]) {\n delete fragmentByEnd[f.end];\n delete fragmentByStart[g.start];\n if (f === g) {\n f.ring.push(end);\n callback(f.ring);\n } else {\n fragmentByStart[f.start] = fragmentByEnd[g.end] = {\n start: f.start,\n end: g.end,\n ring: f.ring.concat(g.ring)\n };\n }\n } else {\n delete fragmentByEnd[f.end];\n f.ring.push(end);\n fragmentByEnd[f.end = endIndex] = f;\n }\n } else if (f = fragmentByStart[endIndex]) {\n if (g = fragmentByEnd[startIndex]) {\n delete fragmentByStart[f.start];\n delete fragmentByEnd[g.end];\n if (f === g) {\n f.ring.push(end);\n callback(f.ring);\n } else {\n fragmentByStart[g.start] = fragmentByEnd[f.end] = {\n start: g.start,\n end: f.end,\n ring: g.ring.concat(f.ring)\n };\n }\n } else {\n delete fragmentByStart[f.start];\n f.ring.unshift(start);\n fragmentByStart[f.start = startIndex] = f;\n }\n } else {\n fragmentByStart[startIndex] = fragmentByEnd[endIndex] = {\n start: startIndex,\n end: endIndex,\n ring: [start, end]\n };\n }\n }\n }\n function index(point) {\n return point[0] * 2 + point[1] * (dx + 1) * 4;\n }\n function smoothLinear(ring, values, value) {\n ring.forEach(point => {\n var x = point[0],\n y = point[1],\n xt = x | 0,\n yt = y | 0,\n v0,\n v1 = values[yt * dx + xt];\n if (x > 0 && x < dx && xt === x) {\n v0 = values[yt * dx + xt - 1];\n point[0] = x + (value - v0) / (v1 - v0) - 0.5;\n }\n if (y > 0 && y < dy && yt === y) {\n v0 = values[(yt - 1) * dx + xt];\n point[1] = y + (value - v0) / (v1 - v0) - 0.5;\n }\n });\n }\n contours.contour = contour;\n contours.size = function (_) {\n if (!arguments.length) return [dx, dy];\n var _0 = Math.floor(_[0]),\n _1 = Math.floor(_[1]);\n if (!(_0 >= 0 && _1 >= 0)) error('invalid size');\n return dx = _0, dy = _1, contours;\n };\n contours.smooth = function (_) {\n return arguments.length ? (smooth = _ ? smoothLinear : noop, contours) : smooth === smoothLinear;\n };\n return contours;\n}\nfunction area(ring) {\n var i = 0,\n n = ring.length,\n area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1];\n while (++i < n) area += ring[i - 1][1] * ring[i][0] - ring[i - 1][0] * ring[i][1];\n return area;\n}\nfunction contains(ring, hole) {\n var i = -1,\n n = hole.length,\n c;\n while (++i < n) if (c = ringContains(ring, hole[i])) return c;\n return 0;\n}\nfunction ringContains(ring, point) {\n var x = point[0],\n y = point[1],\n contains = -1;\n for (var i = 0, n = ring.length, j = n - 1; i < n; j = i++) {\n var pi = ring[i],\n xi = pi[0],\n yi = pi[1],\n pj = ring[j],\n xj = pj[0],\n yj = pj[1];\n if (segmentContains(pi, pj, point)) return 0;\n if (yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi) contains = -contains;\n }\n return contains;\n}\nfunction segmentContains(a, b, c) {\n var i;\n return collinear(a, b, c) && within(a[i = +(a[0] === b[0])], c[i], b[i]);\n}\nfunction collinear(a, b, c) {\n return (b[0] - a[0]) * (c[1] - a[1]) === (c[0] - a[0]) * (b[1] - a[1]);\n}\nfunction within(p, q, r) {\n return p <= q && q <= r || r <= q && q <= p;\n}\n\nfunction quantize (k, nice, zero) {\n return function (values) {\n var ex = extent(values),\n start = zero ? Math.min(ex[0], 0) : ex[0],\n stop = ex[1],\n span = stop - start,\n step = nice ? tickStep(start, stop, k) : span / (k + 1);\n return range(start + step, stop, step);\n };\n}\n\n/**\n * Generate isocontours (level sets) based on input raster grid data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} [params.field] - The field with raster grid\n * data. If unspecified, the tuple itself is interpreted as a raster grid.\n * @param {Array} [params.thresholds] - Contour threshold array. If\n * specified, the levels, nice, resolve, and zero parameters are ignored.\n * @param {number} [params.levels] - The desired number of contour levels.\n * @param {boolean} [params.nice] - Boolean flag indicating if the contour\n * threshold values should be automatically aligned to \"nice\"\n * human-friendly values. Setting this flag may cause the number of\n * thresholds to deviate from the specified levels.\n * @param {string} [params.resolve] - The method for resolving thresholds\n * across multiple input grids. If 'independent' (the default), threshold\n * calculation will be performed separately for each grid. If 'shared', a\n * single set of threshold values will be used for all input grids.\n * @param {boolean} [params.zero] - Boolean flag indicating if the contour\n * threshold values should include zero.\n * @param {boolean} [params.smooth] - Boolean flag indicating if the contour\n * polygons should be smoothed using linear interpolation. The default is\n * true. The parameter is ignored when using density estimation.\n * @param {boolean} [params.scale] - Optional numerical value by which to\n * scale the output isocontour coordinates. This parameter can be useful\n * to scale the contours to match a desired output resolution.\n * @param {string} [params.as='contour'] - The output field in which to store\n * the generated isocontour data (default 'contour').\n */\nfunction Isocontour(params) {\n Transform.call(this, null, params);\n}\nIsocontour.Definition = {\n 'type': 'Isocontour',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'thresholds',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'levels',\n 'type': 'number'\n }, {\n 'name': 'nice',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'resolve',\n 'type': 'enum',\n 'values': ['shared', 'independent'],\n 'default': 'independent'\n }, {\n 'name': 'zero',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'smooth',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'scale',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'translate',\n 'type': 'number',\n 'array': true,\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'default': 'contour'\n }]\n};\ninherits(Isocontour, Transform, {\n transform(_, pulse) {\n if (this.value && !pulse.changed() && !_.modified()) {\n return pulse.StopPropagation;\n }\n var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n source = pulse.materialize(pulse.SOURCE).source,\n field = _.field || identity,\n contour = contours().smooth(_.smooth !== false),\n tz = _.thresholds || levels(source, field, _),\n as = _.as === null ? null : _.as || 'contour',\n values = [];\n source.forEach(t => {\n const grid = field(t);\n\n // generate contour paths in GeoJSON format\n const paths = contour.size([grid.width, grid.height])(grid.values, isArray(tz) ? tz : tz(grid.values));\n\n // adjust contour path coordinates as needed\n transformPaths(paths, grid, t, _);\n\n // ingest; copy source data properties to output\n paths.forEach(p => {\n values.push(rederive(t, ingest(as != null ? {\n [as]: p\n } : p)));\n });\n });\n if (this.value) out.rem = this.value;\n this.value = out.source = out.add = values;\n return out;\n }\n});\nfunction levels(values, f, _) {\n const q = quantize(_.levels || 10, _.nice, _.zero !== false);\n return _.resolve !== 'shared' ? q : q(values.map(t => max(f(t).values)));\n}\nfunction transformPaths(paths, grid, datum, _) {\n let s = _.scale || grid.scale,\n t = _.translate || grid.translate;\n if (isFunction(s)) s = s(datum, _);\n if (isFunction(t)) t = t(datum, _);\n if ((s === 1 || s == null) && !t) return;\n const sx = (isNumber(s) ? s : s[0]) || 1,\n sy = (isNumber(s) ? s : s[1]) || 1,\n tx = t && t[0] || 0,\n ty = t && t[1] || 0;\n paths.forEach(transform(grid, sx, sy, tx, ty));\n}\nfunction transform(grid, sx, sy, tx, ty) {\n const x1 = grid.x1 || 0,\n y1 = grid.y1 || 0,\n flip = sx * sy < 0;\n function transformPolygon(coordinates) {\n coordinates.forEach(transformRing);\n }\n function transformRing(coordinates) {\n if (flip) coordinates.reverse(); // maintain winding order\n coordinates.forEach(transformPoint);\n }\n function transformPoint(coordinates) {\n coordinates[0] = (coordinates[0] - x1) * sx + tx;\n coordinates[1] = (coordinates[1] - y1) * sy + ty;\n }\n return function (geometry) {\n geometry.coordinates.forEach(transformPolygon);\n return geometry;\n };\n}\n\nfunction radius(bw, data, f) {\n const v = bw >= 0 ? bw : bandwidthNRD(data, f);\n return Math.round((Math.sqrt(4 * v * v + 1) - 1) / 2);\n}\nfunction number(_) {\n return isFunction(_) ? _ : constant(+_);\n}\n\n// Implementation adapted from d3/d3-contour. Thanks!\nfunction density2D () {\n var x = d => d[0],\n y = d => d[1],\n weight = one,\n bandwidth = [-1, -1],\n dx = 960,\n dy = 500,\n k = 2; // log2(cellSize)\n\n function density(data, counts) {\n const rx = radius(bandwidth[0], data, x) >> k,\n // blur x-radius\n ry = radius(bandwidth[1], data, y) >> k,\n // blur y-radius\n ox = rx ? rx + 2 : 0,\n // x-offset padding for blur\n oy = ry ? ry + 2 : 0,\n // y-offset padding for blur\n n = 2 * ox + (dx >> k),\n // grid width\n m = 2 * oy + (dy >> k),\n // grid height\n values0 = new Float32Array(n * m),\n values1 = new Float32Array(n * m);\n let values = values0;\n data.forEach(d => {\n const xi = ox + (+x(d) >> k),\n yi = oy + (+y(d) >> k);\n if (xi >= 0 && xi < n && yi >= 0 && yi < m) {\n values0[xi + yi * n] += +weight(d);\n }\n });\n if (rx > 0 && ry > 0) {\n blurX(n, m, values0, values1, rx);\n blurY(n, m, values1, values0, ry);\n blurX(n, m, values0, values1, rx);\n blurY(n, m, values1, values0, ry);\n blurX(n, m, values0, values1, rx);\n blurY(n, m, values1, values0, ry);\n } else if (rx > 0) {\n blurX(n, m, values0, values1, rx);\n blurX(n, m, values1, values0, rx);\n blurX(n, m, values0, values1, rx);\n values = values1;\n } else if (ry > 0) {\n blurY(n, m, values0, values1, ry);\n blurY(n, m, values1, values0, ry);\n blurY(n, m, values0, values1, ry);\n values = values1;\n }\n\n // scale density estimates\n // density in points per square pixel or probability density\n const s = counts ? Math.pow(2, -2 * k) : 1 / sum(values);\n for (let i = 0, sz = n * m; i < sz; ++i) values[i] *= s;\n return {\n values: values,\n scale: 1 << k,\n width: n,\n height: m,\n x1: ox,\n y1: oy,\n x2: ox + (dx >> k),\n y2: oy + (dy >> k)\n };\n }\n density.x = function (_) {\n return arguments.length ? (x = number(_), density) : x;\n };\n density.y = function (_) {\n return arguments.length ? (y = number(_), density) : y;\n };\n density.weight = function (_) {\n return arguments.length ? (weight = number(_), density) : weight;\n };\n density.size = function (_) {\n if (!arguments.length) return [dx, dy];\n var _0 = +_[0],\n _1 = +_[1];\n if (!(_0 >= 0 && _1 >= 0)) error('invalid size');\n return dx = _0, dy = _1, density;\n };\n density.cellSize = function (_) {\n if (!arguments.length) return 1 << k;\n if (!((_ = +_) >= 1)) error('invalid cell size');\n k = Math.floor(Math.log(_) / Math.LN2);\n return density;\n };\n density.bandwidth = function (_) {\n if (!arguments.length) return bandwidth;\n _ = array(_);\n if (_.length === 1) _ = [+_[0], +_[0]];\n if (_.length !== 2) error('invalid bandwidth');\n return bandwidth = _, density;\n };\n return density;\n}\nfunction blurX(n, m, source, target, r) {\n const w = (r << 1) + 1;\n for (let j = 0; j < m; ++j) {\n for (let i = 0, sr = 0; i < n + r; ++i) {\n if (i < n) {\n sr += source[i + j * n];\n }\n if (i >= r) {\n if (i >= w) {\n sr -= source[i - w + j * n];\n }\n target[i - r + j * n] = sr / Math.min(i + 1, n - 1 + w - i, w);\n }\n }\n }\n}\nfunction blurY(n, m, source, target, r) {\n const w = (r << 1) + 1;\n for (let i = 0; i < n; ++i) {\n for (let j = 0, sr = 0; j < m + r; ++j) {\n if (j < m) {\n sr += source[i + j * n];\n }\n if (j >= r) {\n if (j >= w) {\n sr -= source[i + (j - w) * n];\n }\n target[i + (j - r) * n] = sr / Math.min(j + 1, m - 1 + w - j, w);\n }\n }\n }\n}\n\n/**\n * Perform 2D kernel-density estimation of point data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.size - The [width, height] extent (in\n * units of input pixels) over which to perform density estimation.\n * @param {function(object): number} params.x - The x-coordinate accessor.\n * @param {function(object): number} params.y - The y-coordinate accessor.\n * @param {function(object): number} [params.weight] - The weight accessor.\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby.\n * @param {number} [params.cellSize] - Contour density calculation cell size.\n * This parameter determines the level of spatial approximation. For example,\n * the default value of 4 maps to 2x reductions in both x- and y- dimensions.\n * A value of 1 will result in an output raster grid whose dimensions exactly\n * matches the size parameter.\n * @param {Array} [params.bandwidth] - The KDE kernel bandwidths,\n * in pixels. The input can be a two-element array specifying separate\n * x and y bandwidths, or a single-element array specifying both. If the\n * bandwidth is unspecified or less than zero, the bandwidth will be\n * automatically determined.\n * @param {boolean} [params.counts=false] - A boolean flag indicating if the\n * output values should be probability estimates (false, default) or\n * smoothed counts (true).\n * @param {string} [params.as='grid'] - The output field in which to store\n * the generated raster grid (default 'grid').\n */\nfunction KDE2D(params) {\n Transform.call(this, null, params);\n}\nKDE2D.Definition = {\n 'type': 'KDE2D',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'required': true\n }, {\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'weight',\n 'type': 'field'\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'cellSize',\n 'type': 'number'\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'counts',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'grid'\n }]\n};\nconst PARAMS = ['x', 'y', 'weight', 'size', 'cellSize', 'bandwidth'];\nfunction params(obj, _) {\n PARAMS.forEach(param => _[param] != null ? obj[param](_[param]) : 0);\n return obj;\n}\ninherits(KDE2D, Transform, {\n transform(_, pulse) {\n if (this.value && !pulse.changed() && !_.modified()) return pulse.StopPropagation;\n var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n source = pulse.materialize(pulse.SOURCE).source,\n groups = partition(source, _.groupby),\n names = (_.groupby || []).map(accessorName),\n kde = params(density2D(), _),\n as = _.as || 'grid',\n values = [];\n function set(t, vals) {\n for (let i = 0; i < names.length; ++i) t[names[i]] = vals[i];\n return t;\n }\n\n // generate density raster grids\n values = groups.map(g => ingest(set({\n [as]: kde(g, _.counts)\n }, g.dims)));\n if (this.value) out.rem = this.value;\n this.value = out.source = out.add = values;\n return out;\n }\n});\nfunction partition(data, groupby) {\n var groups = [],\n get = f => f(t),\n map,\n i,\n n,\n t,\n k,\n g;\n\n // partition data points into groups\n if (groupby == null) {\n groups.push(data);\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n if (!g) {\n map[k] = g = [];\n g.dims = k;\n groups.push(g);\n }\n g.push(t);\n }\n }\n return groups;\n}\n\n/**\n * Generate contours based on kernel-density estimation of point data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.size - The dimensions [width, height] over which to compute contours.\n * If the values parameter is provided, this must be the dimensions of the input data.\n * If density estimation is performed, this is the output view dimensions in pixels.\n * @param {Array} [params.values] - An array of numeric values representing an\n * width x height grid of values over which to compute contours. If unspecified, this\n * transform will instead attempt to compute contours for the kernel density estimate\n * using values drawn from data tuples in the input pulse.\n * @param {function(object): number} [params.x] - The pixel x-coordinate accessor for density estimation.\n * @param {function(object): number} [params.y] - The pixel y-coordinate accessor for density estimation.\n * @param {function(object): number} [params.weight] - The data point weight accessor for density estimation.\n * @param {number} [params.cellSize] - Contour density calculation cell size.\n * @param {number} [params.bandwidth] - Kernel density estimation bandwidth.\n * @param {Array} [params.thresholds] - Contour threshold array. If\n * this parameter is set, the count and nice parameters will be ignored.\n * @param {number} [params.count] - The desired number of contours.\n * @param {boolean} [params.nice] - Boolean flag indicating if the contour\n * threshold values should be automatically aligned to \"nice\"\n * human-friendly values. Setting this flag may cause the number of\n * thresholds to deviate from the specified count.\n * @param {boolean} [params.smooth] - Boolean flag indicating if the contour\n * polygons should be smoothed using linear interpolation. The default is\n * true. The parameter is ignored when using density estimation.\n */\nfunction Contour(params) {\n Transform.call(this, null, params);\n}\nContour.Definition = {\n 'type': 'Contour',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'required': true\n }, {\n 'name': 'values',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'x',\n 'type': 'field'\n }, {\n 'name': 'y',\n 'type': 'field'\n }, {\n 'name': 'weight',\n 'type': 'field'\n }, {\n 'name': 'cellSize',\n 'type': 'number'\n }, {\n 'name': 'bandwidth',\n 'type': 'number'\n }, {\n 'name': 'count',\n 'type': 'number'\n }, {\n 'name': 'nice',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'thresholds',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'smooth',\n 'type': 'boolean',\n 'default': true\n }]\n};\ninherits(Contour, Transform, {\n transform(_, pulse) {\n if (this.value && !pulse.changed() && !_.modified()) {\n return pulse.StopPropagation;\n }\n var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n contour = contours().smooth(_.smooth !== false),\n values = _.values,\n thresh = _.thresholds || quantize(_.count || 10, _.nice, !!values),\n size = _.size,\n grid,\n post;\n if (!values) {\n values = pulse.materialize(pulse.SOURCE).source;\n grid = params(density2D(), _)(values, true);\n post = transform(grid, grid.scale || 1, grid.scale || 1, 0, 0);\n size = [grid.width, grid.height];\n values = grid.values;\n }\n thresh = isArray(thresh) ? thresh : thresh(values);\n values = contour.size(size)(values, thresh);\n if (post) values.forEach(post);\n if (this.value) out.rem = this.value;\n this.value = out.source = out.add = (values || []).map(ingest);\n return out;\n }\n});\n\nconst Feature = 'Feature';\nconst FeatureCollection = 'FeatureCollection';\nconst MultiPoint = 'MultiPoint';\n\n/**\n * Consolidate an array of [longitude, latitude] points or GeoJSON features\n * into a combined GeoJSON object. This transform is particularly useful for\n * combining geo data for a Projection's fit argument. The resulting GeoJSON\n * data is available as this transform's value. Input pulses are unchanged.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.fields] - A two-element array\n * of field accessors for the longitude and latitude values.\n * @param {function(object): *} params.geojson - A field accessor for\n * retrieving GeoJSON feature data.\n */\nfunction GeoJSON(params) {\n Transform.call(this, null, params);\n}\nGeoJSON.Definition = {\n 'type': 'GeoJSON',\n 'metadata': {},\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'geojson',\n 'type': 'field'\n }]\n};\ninherits(GeoJSON, Transform, {\n transform(_, pulse) {\n var features = this._features,\n points = this._points,\n fields = _.fields,\n lon = fields && fields[0],\n lat = fields && fields[1],\n geojson = _.geojson || !fields && identity,\n flag = pulse.ADD,\n mod;\n mod = _.modified() || pulse.changed(pulse.REM) || pulse.modified(accessorFields(geojson)) || lon && pulse.modified(accessorFields(lon)) || lat && pulse.modified(accessorFields(lat));\n if (!this.value || mod) {\n flag = pulse.SOURCE;\n this._features = features = [];\n this._points = points = [];\n }\n if (geojson) {\n pulse.visit(flag, t => features.push(geojson(t)));\n }\n if (lon && lat) {\n pulse.visit(flag, t => {\n var x = lon(t),\n y = lat(t);\n if (x != null && y != null && (x = +x) === x && (y = +y) === y) {\n points.push([x, y]);\n }\n });\n features = features.concat({\n type: Feature,\n geometry: {\n type: MultiPoint,\n coordinates: points\n }\n });\n }\n this.value = {\n type: FeatureCollection,\n features: features\n };\n }\n});\n\n/**\n * Map GeoJSON data to an SVG path string.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(number, number): *} params.projection - The cartographic\n * projection to apply.\n * @param {function(object): *} [params.field] - The field with GeoJSON data,\n * or null if the tuple itself is a GeoJSON feature.\n * @param {string} [params.as='path'] - The output field in which to store\n * the generated path data (default 'path').\n */\nfunction GeoPath(params) {\n Transform.call(this, null, params);\n}\nGeoPath.Definition = {\n 'type': 'GeoPath',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'projection',\n 'type': 'projection'\n }, {\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'pointRadius',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'path'\n }]\n};\ninherits(GeoPath, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ALL),\n path = this.value,\n field = _.field || identity,\n as = _.as || 'path',\n flag = out.SOURCE;\n if (!path || _.modified()) {\n // parameters updated, reset and reflow\n this.value = path = getProjectionPath(_.projection);\n out.materialize().reflow();\n } else {\n flag = field === identity || pulse.modified(field.fields) ? out.ADD_MOD : out.ADD;\n }\n const prev = initPath(path, _.pointRadius);\n out.visit(flag, t => t[as] = path(field(t)));\n path.pointRadius(prev);\n return out.modifies(as);\n }\n});\nfunction initPath(path, pointRadius) {\n const prev = path.pointRadius();\n path.context(null);\n if (pointRadius != null) {\n path.pointRadius(pointRadius);\n }\n return prev;\n}\n\n/**\n * Geo-code a longitude/latitude point to an x/y coordinate.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(number, number): *} params.projection - The cartographic\n * projection to apply.\n * @param {Array} params.fields - A two-element array of\n * field accessors for the longitude and latitude values.\n * @param {Array} [params.as] - A two-element array of field names\n * under which to store the result. Defaults to ['x','y'].\n */\nfunction GeoPoint(params) {\n Transform.call(this, null, params);\n}\nGeoPoint.Definition = {\n 'type': 'GeoPoint',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'projection',\n 'type': 'projection',\n 'required': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['x', 'y']\n }]\n};\ninherits(GeoPoint, Transform, {\n transform(_, pulse) {\n var proj = _.projection,\n lon = _.fields[0],\n lat = _.fields[1],\n as = _.as || ['x', 'y'],\n x = as[0],\n y = as[1],\n mod;\n function set(t) {\n const xy = proj([lon(t), lat(t)]);\n if (xy) {\n t[x] = xy[0];\n t[y] = xy[1];\n } else {\n t[x] = undefined;\n t[y] = undefined;\n }\n }\n if (_.modified()) {\n // parameters updated, reflow\n pulse = pulse.materialize().reflow(true).visit(pulse.SOURCE, set);\n } else {\n mod = pulse.modified(lon.fields) || pulse.modified(lat.fields);\n pulse.visit(mod ? pulse.ADD_MOD : pulse.ADD, set);\n }\n return pulse.modifies(as);\n }\n});\n\n/**\n * Annotate items with a geopath shape generator.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(number, number): *} params.projection - The cartographic\n * projection to apply.\n * @param {function(object): *} [params.field] - The field with GeoJSON data,\n * or null if the tuple itself is a GeoJSON feature.\n * @param {string} [params.as='shape'] - The output field in which to store\n * the generated path data (default 'shape').\n */\nfunction GeoShape(params) {\n Transform.call(this, null, params);\n}\nGeoShape.Definition = {\n 'type': 'GeoShape',\n 'metadata': {\n 'modifies': true,\n 'nomod': true\n },\n 'params': [{\n 'name': 'projection',\n 'type': 'projection'\n }, {\n 'name': 'field',\n 'type': 'field',\n 'default': 'datum'\n }, {\n 'name': 'pointRadius',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'shape'\n }]\n};\ninherits(GeoShape, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ALL),\n shape = this.value,\n as = _.as || 'shape',\n flag = out.ADD;\n if (!shape || _.modified()) {\n // parameters updated, reset and reflow\n this.value = shape = shapeGenerator(getProjectionPath(_.projection), _.field || field('datum'), _.pointRadius);\n out.materialize().reflow();\n flag = out.SOURCE;\n }\n out.visit(flag, t => t[as] = shape);\n return out.modifies(as);\n }\n});\nfunction shapeGenerator(path, field, pointRadius) {\n const shape = pointRadius == null ? _ => path(field(_)) : _ => {\n var prev = path.pointRadius(),\n value = path.pointRadius(pointRadius)(field(_));\n path.pointRadius(prev);\n return value;\n };\n shape.context = _ => {\n path.context(_);\n return shape;\n };\n return shape;\n}\n\n/**\n * GeoJSON feature generator for creating graticules.\n * @constructor\n */\nfunction Graticule(params) {\n Transform.call(this, [], params);\n this.generator = geoGraticule();\n}\nGraticule.Definition = {\n 'type': 'Graticule',\n 'metadata': {\n 'changes': true,\n 'generates': true\n },\n 'params': [{\n 'name': 'extent',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'extentMajor',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'extentMinor',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'step',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'stepMajor',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'default': [90, 360]\n }, {\n 'name': 'stepMinor',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'default': [10, 10]\n }, {\n 'name': 'precision',\n 'type': 'number',\n 'default': 2.5\n }]\n};\ninherits(Graticule, Transform, {\n transform(_, pulse) {\n var src = this.value,\n gen = this.generator,\n t;\n if (!src.length || _.modified()) {\n for (const prop in _) {\n if (isFunction(gen[prop])) {\n gen[prop](_[prop]);\n }\n }\n }\n t = gen();\n if (src.length) {\n pulse.mod.push(replace(src[0], t));\n } else {\n pulse.add.push(ingest(t));\n }\n src[0] = t;\n return pulse;\n }\n});\n\n/**\n * Render a heatmap image for input raster grid data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} [params.field] - The field with raster grid\n * data. If unspecified, the tuple itself is interpreted as a raster grid.\n * @param {string} [params.color] - A constant color value or function for\n * individual pixel color. If a function, it will be invoked with an input\n * object that includes $x, $y, $value, and $max fields for the grid.\n * @param {number} [params.opacity] - A constant opacity value or function for\n * individual pixel opacity. If a function, it will be invoked with an input\n * object that includes $x, $y, $value, and $max fields for the grid.\n * @param {string} [params.resolve] - The method for resolving maximum values\n * across multiple input grids. If 'independent' (the default), maximum\n * calculation will be performed separately for each grid. If 'shared',\n * a single global maximum will be used for all input grids.\n * @param {string} [params.as='image'] - The output field in which to store\n * the generated bitmap canvas images (default 'image').\n */\nfunction Heatmap(params) {\n Transform.call(this, null, params);\n}\nHeatmap.Definition = {\n 'type': 'heatmap',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'color',\n 'type': 'string',\n 'expr': true\n }, {\n 'name': 'opacity',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'resolve',\n 'type': 'enum',\n 'values': ['shared', 'independent'],\n 'default': 'independent'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'image'\n }]\n};\ninherits(Heatmap, Transform, {\n transform(_, pulse) {\n if (!pulse.changed() && !_.modified()) {\n return pulse.StopPropagation;\n }\n var source = pulse.materialize(pulse.SOURCE).source,\n shared = _.resolve === 'shared',\n field = _.field || identity,\n opacity = opacity_(_.opacity, _),\n color = color_(_.color, _),\n as = _.as || 'image',\n obj = {\n $x: 0,\n $y: 0,\n $value: 0,\n $max: shared ? max(source.map(t => max(field(t).values))) : 0\n };\n source.forEach(t => {\n const v = field(t);\n\n // build proxy data object\n const o = extend({}, t, obj);\n // set maximum value if not globally shared\n if (!shared) o.$max = max(v.values || []);\n\n // generate canvas image\n // optimize color/opacity if not pixel-dependent\n t[as] = toCanvas(v, o, color.dep ? color : constant(color(o)), opacity.dep ? opacity : constant(opacity(o)));\n });\n return pulse.reflow(true).modifies(as);\n }\n});\n\n// get image color function\nfunction color_(color, _) {\n let f;\n if (isFunction(color)) {\n f = obj => rgb(color(obj, _));\n f.dep = dependency(color);\n } else {\n // default to mid-grey\n f = constant(rgb(color || '#888'));\n }\n return f;\n}\n\n// get image opacity function\nfunction opacity_(opacity, _) {\n let f;\n if (isFunction(opacity)) {\n f = obj => opacity(obj, _);\n f.dep = dependency(opacity);\n } else if (opacity) {\n f = constant(opacity);\n } else {\n // default to [0, max] opacity gradient\n f = obj => obj.$value / obj.$max || 0;\n f.dep = true;\n }\n return f;\n}\n\n// check if function depends on individual pixel data\nfunction dependency(f) {\n if (!isFunction(f)) return false;\n const set = toSet(accessorFields(f));\n return set.$x || set.$y || set.$value || set.$max;\n}\n\n// render raster grid to canvas\nfunction toCanvas(grid, obj, color, opacity) {\n const n = grid.width,\n m = grid.height,\n x1 = grid.x1 || 0,\n y1 = grid.y1 || 0,\n x2 = grid.x2 || n,\n y2 = grid.y2 || m,\n val = grid.values,\n value = val ? i => val[i] : zero,\n can = canvas(x2 - x1, y2 - y1),\n ctx = can.getContext('2d'),\n img = ctx.getImageData(0, 0, x2 - x1, y2 - y1),\n pix = img.data;\n for (let j = y1, k = 0; j < y2; ++j) {\n obj.$y = j - y1;\n for (let i = x1, r = j * n; i < x2; ++i, k += 4) {\n obj.$x = i - x1;\n obj.$value = value(i + r);\n const v = color(obj);\n pix[k + 0] = v.r;\n pix[k + 1] = v.g;\n pix[k + 2] = v.b;\n pix[k + 3] = ~~(255 * opacity(obj));\n }\n }\n ctx.putImageData(img, 0, 0);\n return can;\n}\n\n/**\n * Maintains a cartographic projection.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction Projection(params) {\n Transform.call(this, null, params);\n this.modified(true); // always treat as modified\n}\ninherits(Projection, Transform, {\n transform(_, pulse) {\n let proj = this.value;\n if (!proj || _.modified('type')) {\n this.value = proj = create(_.type);\n projectionProperties.forEach(prop => {\n if (_[prop] != null) set(proj, prop, _[prop]);\n });\n } else {\n projectionProperties.forEach(prop => {\n if (_.modified(prop)) set(proj, prop, _[prop]);\n });\n }\n if (_.pointRadius != null) proj.path.pointRadius(_.pointRadius);\n if (_.fit) fit(proj, _);\n return pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n }\n});\nfunction fit(proj, _) {\n const data = collectGeoJSON(_.fit);\n _.extent ? proj.fitExtent(_.extent, data) : _.size ? proj.fitSize(_.size, data) : 0;\n}\nfunction create(type) {\n const constructor = projection((type || 'mercator').toLowerCase());\n if (!constructor) error('Unrecognized projection type: ' + type);\n return constructor();\n}\nfunction set(proj, key, value) {\n if (isFunction(proj[key])) proj[key](value);\n}\nfunction collectGeoJSON(data) {\n data = array(data);\n return data.length === 1 ? data[0] : {\n type: FeatureCollection,\n features: data.reduce((a, f) => a.concat(featurize(f)), [])\n };\n}\nfunction featurize(f) {\n return f.type === FeatureCollection ? f.features : array(f).filter(d => d != null).map(d => d.type === Feature ? d : {\n type: Feature,\n geometry: d\n });\n}\n\nexport { Contour as contour, GeoJSON as geojson, GeoPath as geopath, GeoPoint as geopoint, GeoShape as geoshape, Graticule as graticule, Heatmap as heatmap, Isocontour as isocontour, KDE2D as kde2d, Projection as projection };\n","export default function(d) {\n const x = +this._x.call(null, d),\n y = +this._y.call(null, d);\n return add(this.cover(x, y), x, y, d);\n}\n\nfunction add(tree, x, y, d) {\n if (isNaN(x) || isNaN(y)) return tree; // ignore invalid points\n\n var parent,\n node = tree._root,\n leaf = {data: d},\n x0 = tree._x0,\n y0 = tree._y0,\n x1 = tree._x1,\n y1 = tree._y1,\n xm,\n ym,\n xp,\n yp,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return tree._root = leaf, tree;\n\n // Find the existing leaf for the new point, or add it.\n while (node.length) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree;\n }\n\n // Is the new point is exactly coincident with the existing point?\n xp = +tree._x.call(null, node.data);\n yp = +tree._y.call(null, node.data);\n if (x === xp && y === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;\n\n // Otherwise, split the leaf node until the old and new point are separated.\n do {\n parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4);\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n } while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | (xp >= xm)));\n return parent[j] = node, parent[i] = leaf, tree;\n}\n\nexport function addAll(data) {\n var d, i, n = data.length,\n x,\n y,\n xz = new Array(n),\n yz = new Array(n),\n x0 = Infinity,\n y0 = Infinity,\n x1 = -Infinity,\n y1 = -Infinity;\n\n // Compute the points and their extent.\n for (i = 0; i < n; ++i) {\n if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d))) continue;\n xz[i] = x;\n yz[i] = y;\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n }\n\n // If there were no (valid) points, abort.\n if (x0 > x1 || y0 > y1) return this;\n\n // Expand the tree to cover the new points.\n this.cover(x0, y0).cover(x1, y1);\n\n // Add the new points.\n for (i = 0; i < n; ++i) {\n add(this, xz[i], yz[i], data[i]);\n }\n\n return this;\n}\n","export default function(node, x0, y0, x1, y1) {\n this.node = node;\n this.x0 = x0;\n this.y0 = y0;\n this.x1 = x1;\n this.y1 = y1;\n}\n","export function defaultX(d) {\n return d[0];\n}\n\nexport default function(_) {\n return arguments.length ? (this._x = _, this) : this._x;\n}\n","export function defaultY(d) {\n return d[1];\n}\n\nexport default function(_) {\n return arguments.length ? (this._y = _, this) : this._y;\n}\n","import tree_add, {addAll as tree_addAll} from \"./add.js\";\nimport tree_cover from \"./cover.js\";\nimport tree_data from \"./data.js\";\nimport tree_extent from \"./extent.js\";\nimport tree_find from \"./find.js\";\nimport tree_remove, {removeAll as tree_removeAll} from \"./remove.js\";\nimport tree_root from \"./root.js\";\nimport tree_size from \"./size.js\";\nimport tree_visit from \"./visit.js\";\nimport tree_visitAfter from \"./visitAfter.js\";\nimport tree_x, {defaultX} from \"./x.js\";\nimport tree_y, {defaultY} from \"./y.js\";\n\nexport default function quadtree(nodes, x, y) {\n var tree = new Quadtree(x == null ? defaultX : x, y == null ? defaultY : y, NaN, NaN, NaN, NaN);\n return nodes == null ? tree : tree.addAll(nodes);\n}\n\nfunction Quadtree(x, y, x0, y0, x1, y1) {\n this._x = x;\n this._y = y;\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n this._root = undefined;\n}\n\nfunction leaf_copy(leaf) {\n var copy = {data: leaf.data}, next = copy;\n while (leaf = leaf.next) next = next.next = {data: leaf.data};\n return copy;\n}\n\nvar treeProto = quadtree.prototype = Quadtree.prototype;\n\ntreeProto.copy = function() {\n var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1),\n node = this._root,\n nodes,\n child;\n\n if (!node) return copy;\n\n if (!node.length) return copy._root = leaf_copy(node), copy;\n\n nodes = [{source: node, target: copy._root = new Array(4)}];\n while (node = nodes.pop()) {\n for (var i = 0; i < 4; ++i) {\n if (child = node.source[i]) {\n if (child.length) nodes.push({source: child, target: node.target[i] = new Array(4)});\n else node.target[i] = leaf_copy(child);\n }\n }\n }\n\n return copy;\n};\n\ntreeProto.add = tree_add;\ntreeProto.addAll = tree_addAll;\ntreeProto.cover = tree_cover;\ntreeProto.data = tree_data;\ntreeProto.extent = tree_extent;\ntreeProto.find = tree_find;\ntreeProto.remove = tree_remove;\ntreeProto.removeAll = tree_removeAll;\ntreeProto.root = tree_root;\ntreeProto.size = tree_size;\ntreeProto.visit = tree_visit;\ntreeProto.visitAfter = tree_visitAfter;\ntreeProto.x = tree_x;\ntreeProto.y = tree_y;\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export default function(random) {\n return (random() - 0.5) * 1e-6;\n}\n","import {quadtree} from \"d3-quadtree\";\nimport constant from \"./constant.js\";\nimport jiggle from \"./jiggle.js\";\n\nfunction x(d) {\n return d.x + d.vx;\n}\n\nfunction y(d) {\n return d.y + d.vy;\n}\n\nexport default function(radius) {\n var nodes,\n radii,\n random,\n strength = 1,\n iterations = 1;\n\n if (typeof radius !== \"function\") radius = constant(radius == null ? 1 : +radius);\n\n function force() {\n var i, n = nodes.length,\n tree,\n node,\n xi,\n yi,\n ri,\n ri2;\n\n for (var k = 0; k < iterations; ++k) {\n tree = quadtree(nodes, x, y).visitAfter(prepare);\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n ri = radii[node.index], ri2 = ri * ri;\n xi = node.x + node.vx;\n yi = node.y + node.vy;\n tree.visit(apply);\n }\n }\n\n function apply(quad, x0, y0, x1, y1) {\n var data = quad.data, rj = quad.r, r = ri + rj;\n if (data) {\n if (data.index > node.index) {\n var x = xi - data.x - data.vx,\n y = yi - data.y - data.vy,\n l = x * x + y * y;\n if (l < r * r) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n l = (r - (l = Math.sqrt(l))) / l * strength;\n node.vx += (x *= l) * (r = (rj *= rj) / (ri2 + rj));\n node.vy += (y *= l) * r;\n data.vx -= x * (r = 1 - r);\n data.vy -= y * r;\n }\n }\n return;\n }\n return x0 > xi + r || x1 < xi - r || y0 > yi + r || y1 < yi - r;\n }\n }\n\n function prepare(quad) {\n if (quad.data) return quad.r = radii[quad.data.index];\n for (var i = quad.r = 0; i < 4; ++i) {\n if (quad[i] && quad[i].r > quad.r) {\n quad.r = quad[i].r;\n }\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length, node;\n radii = new Array(n);\n for (i = 0; i < n; ++i) node = nodes[i], radii[node.index] = +radius(node, i, nodes);\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.iterations = function(_) {\n return arguments.length ? (iterations = +_, force) : iterations;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = +_, force) : strength;\n };\n\n force.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : radius;\n };\n\n return force;\n}\n","export default function(x, y) {\n if (isNaN(x = +x) || isNaN(y = +y)) return this; // ignore invalid points\n\n var x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1;\n\n // If the quadtree has no extent, initialize them.\n // Integer extent are necessary so that if we later double the extent,\n // the existing quadrant boundaries don’t change due to floating point error!\n if (isNaN(x0)) {\n x1 = (x0 = Math.floor(x)) + 1;\n y1 = (y0 = Math.floor(y)) + 1;\n }\n\n // Otherwise, double repeatedly to cover.\n else {\n var z = x1 - x0 || 1,\n node = this._root,\n parent,\n i;\n\n while (x0 > x || x >= x1 || y0 > y || y >= y1) {\n i = (y < y0) << 1 | (x < x0);\n parent = new Array(4), parent[i] = node, node = parent, z *= 2;\n switch (i) {\n case 0: x1 = x0 + z, y1 = y0 + z; break;\n case 1: x0 = x1 - z, y1 = y0 + z; break;\n case 2: x1 = x0 + z, y0 = y1 - z; break;\n case 3: x0 = x1 - z, y0 = y1 - z; break;\n }\n }\n\n if (this._root && this._root.length) this._root = node;\n }\n\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n return this;\n}\n","export default function() {\n var data = [];\n this.visit(function(node) {\n if (!node.length) do data.push(node.data); while (node = node.next)\n });\n return data;\n}\n","export default function(_) {\n return arguments.length\n ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1])\n : isNaN(this._x0) ? undefined : [[this._x0, this._y0], [this._x1, this._y1]];\n}\n","import Quad from \"./quad.js\";\n\nexport default function(x, y, radius) {\n var data,\n x0 = this._x0,\n y0 = this._y0,\n x1,\n y1,\n x2,\n y2,\n x3 = this._x1,\n y3 = this._y1,\n quads = [],\n node = this._root,\n q,\n i;\n\n if (node) quads.push(new Quad(node, x0, y0, x3, y3));\n if (radius == null) radius = Infinity;\n else {\n x0 = x - radius, y0 = y - radius;\n x3 = x + radius, y3 = y + radius;\n radius *= radius;\n }\n\n while (q = quads.pop()) {\n\n // Stop searching if this quadrant can’t contain a closer node.\n if (!(node = q.node)\n || (x1 = q.x0) > x3\n || (y1 = q.y0) > y3\n || (x2 = q.x1) < x0\n || (y2 = q.y1) < y0) continue;\n\n // Bisect the current quadrant.\n if (node.length) {\n var xm = (x1 + x2) / 2,\n ym = (y1 + y2) / 2;\n\n quads.push(\n new Quad(node[3], xm, ym, x2, y2),\n new Quad(node[2], x1, ym, xm, y2),\n new Quad(node[1], xm, y1, x2, ym),\n new Quad(node[0], x1, y1, xm, ym)\n );\n\n // Visit the closest quadrant first.\n if (i = (y >= ym) << 1 | (x >= xm)) {\n q = quads[quads.length - 1];\n quads[quads.length - 1] = quads[quads.length - 1 - i];\n quads[quads.length - 1 - i] = q;\n }\n }\n\n // Visit this point. (Visiting coincident points isn’t necessary!)\n else {\n var dx = x - +this._x.call(null, node.data),\n dy = y - +this._y.call(null, node.data),\n d2 = dx * dx + dy * dy;\n if (d2 < radius) {\n var d = Math.sqrt(radius = d2);\n x0 = x - d, y0 = y - d;\n x3 = x + d, y3 = y + d;\n data = node.data;\n }\n }\n }\n\n return data;\n}\n","export default function(d) {\n if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d))) return this; // ignore invalid points\n\n var parent,\n node = this._root,\n retainer,\n previous,\n next,\n x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1,\n x,\n y,\n xm,\n ym,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return this;\n\n // Find the leaf node for the point.\n // While descending, also retain the deepest parent with a non-removed sibling.\n if (node.length) while (true) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (!(parent = node, node = node[i = bottom << 1 | right])) return this;\n if (!node.length) break;\n if (parent[(i + 1) & 3] || parent[(i + 2) & 3] || parent[(i + 3) & 3]) retainer = parent, j = i;\n }\n\n // Find the point to remove.\n while (node.data !== d) if (!(previous = node, node = node.next)) return this;\n if (next = node.next) delete node.next;\n\n // If there are multiple coincident points, remove just the point.\n if (previous) return (next ? previous.next = next : delete previous.next), this;\n\n // If this is the root point, remove it.\n if (!parent) return this._root = next, this;\n\n // Remove this leaf.\n next ? parent[i] = next : delete parent[i];\n\n // If the parent now contains exactly one leaf, collapse superfluous parents.\n if ((node = parent[0] || parent[1] || parent[2] || parent[3])\n && node === (parent[3] || parent[2] || parent[1] || parent[0])\n && !node.length) {\n if (retainer) retainer[j] = node;\n else this._root = node;\n }\n\n return this;\n}\n\nexport function removeAll(data) {\n for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);\n return this;\n}\n","export default function() {\n return this._root;\n}\n","export default function() {\n var size = 0;\n this.visit(function(node) {\n if (!node.length) do ++size; while (node = node.next)\n });\n return size;\n}\n","import Quad from \"./quad.js\";\n\nexport default function(callback) {\n var quads = [], q, node = this._root, child, x0, y0, x1, y1;\n if (node) quads.push(new Quad(node, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) {\n var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));\n if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));\n if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));\n if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));\n }\n }\n return this;\n}\n","import Quad from \"./quad.js\";\n\nexport default function(callback) {\n var quads = [], next = [], q;\n if (this._root) quads.push(new Quad(this._root, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n var node = q.node;\n if (node.length) {\n var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));\n if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));\n if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));\n if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));\n }\n next.push(q);\n }\n while (q = next.pop()) {\n callback(q.node, q.x0, q.y0, q.x1, q.y1);\n }\n return this;\n}\n","var noop = {value: () => {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n","var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n","// https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use\nconst a = 1664525;\nconst c = 1013904223;\nconst m = 4294967296; // 2^32\n\nexport default function() {\n let s = 1;\n return () => (s = (a * s + c) % m) / m;\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {timer} from \"d3-timer\";\nimport lcg from \"./lcg.js\";\n\nexport function x(d) {\n return d.x;\n}\n\nexport function y(d) {\n return d.y;\n}\n\nvar initialRadius = 10,\n initialAngle = Math.PI * (3 - Math.sqrt(5));\n\nexport default function(nodes) {\n var simulation,\n alpha = 1,\n alphaMin = 0.001,\n alphaDecay = 1 - Math.pow(alphaMin, 1 / 300),\n alphaTarget = 0,\n velocityDecay = 0.6,\n forces = new Map(),\n stepper = timer(step),\n event = dispatch(\"tick\", \"end\"),\n random = lcg();\n\n if (nodes == null) nodes = [];\n\n function step() {\n tick();\n event.call(\"tick\", simulation);\n if (alpha < alphaMin) {\n stepper.stop();\n event.call(\"end\", simulation);\n }\n }\n\n function tick(iterations) {\n var i, n = nodes.length, node;\n\n if (iterations === undefined) iterations = 1;\n\n for (var k = 0; k < iterations; ++k) {\n alpha += (alphaTarget - alpha) * alphaDecay;\n\n forces.forEach(function(force) {\n force(alpha);\n });\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n if (node.fx == null) node.x += node.vx *= velocityDecay;\n else node.x = node.fx, node.vx = 0;\n if (node.fy == null) node.y += node.vy *= velocityDecay;\n else node.y = node.fy, node.vy = 0;\n }\n }\n\n return simulation;\n }\n\n function initializeNodes() {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.index = i;\n if (node.fx != null) node.x = node.fx;\n if (node.fy != null) node.y = node.fy;\n if (isNaN(node.x) || isNaN(node.y)) {\n var radius = initialRadius * Math.sqrt(0.5 + i), angle = i * initialAngle;\n node.x = radius * Math.cos(angle);\n node.y = radius * Math.sin(angle);\n }\n if (isNaN(node.vx) || isNaN(node.vy)) {\n node.vx = node.vy = 0;\n }\n }\n }\n\n function initializeForce(force) {\n if (force.initialize) force.initialize(nodes, random);\n return force;\n }\n\n initializeNodes();\n\n return simulation = {\n tick: tick,\n\n restart: function() {\n return stepper.restart(step), simulation;\n },\n\n stop: function() {\n return stepper.stop(), simulation;\n },\n\n nodes: function(_) {\n return arguments.length ? (nodes = _, initializeNodes(), forces.forEach(initializeForce), simulation) : nodes;\n },\n\n alpha: function(_) {\n return arguments.length ? (alpha = +_, simulation) : alpha;\n },\n\n alphaMin: function(_) {\n return arguments.length ? (alphaMin = +_, simulation) : alphaMin;\n },\n\n alphaDecay: function(_) {\n return arguments.length ? (alphaDecay = +_, simulation) : +alphaDecay;\n },\n\n alphaTarget: function(_) {\n return arguments.length ? (alphaTarget = +_, simulation) : alphaTarget;\n },\n\n velocityDecay: function(_) {\n return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay;\n },\n\n randomSource: function(_) {\n return arguments.length ? (random = _, forces.forEach(initializeForce), simulation) : random;\n },\n\n force: function(name, _) {\n return arguments.length > 1 ? ((_ == null ? forces.delete(name) : forces.set(name, initializeForce(_))), simulation) : forces.get(name);\n },\n\n find: function(x, y, radius) {\n var i = 0,\n n = nodes.length,\n dx,\n dy,\n d2,\n node,\n closest;\n\n if (radius == null) radius = Infinity;\n else radius *= radius;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n dx = x - node.x;\n dy = y - node.y;\n d2 = dx * dx + dy * dy;\n if (d2 < radius) closest = node, radius = d2;\n }\n\n return closest;\n },\n\n on: function(name, _) {\n return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name);\n }\n };\n}\n","import constant from \"./constant.js\";\nimport jiggle from \"./jiggle.js\";\n\nfunction index(d) {\n return d.index;\n}\n\nfunction find(nodeById, nodeId) {\n var node = nodeById.get(nodeId);\n if (!node) throw new Error(\"node not found: \" + nodeId);\n return node;\n}\n\nexport default function(links) {\n var id = index,\n strength = defaultStrength,\n strengths,\n distance = constant(30),\n distances,\n nodes,\n count,\n bias,\n random,\n iterations = 1;\n\n if (links == null) links = [];\n\n function defaultStrength(link) {\n return 1 / Math.min(count[link.source.index], count[link.target.index]);\n }\n\n function force(alpha) {\n for (var k = 0, n = links.length; k < iterations; ++k) {\n for (var i = 0, link, source, target, x, y, l, b; i < n; ++i) {\n link = links[i], source = link.source, target = link.target;\n x = target.x + target.vx - source.x - source.vx || jiggle(random);\n y = target.y + target.vy - source.y - source.vy || jiggle(random);\n l = Math.sqrt(x * x + y * y);\n l = (l - distances[i]) / l * alpha * strengths[i];\n x *= l, y *= l;\n target.vx -= x * (b = bias[i]);\n target.vy -= y * b;\n source.vx += x * (b = 1 - b);\n source.vy += y * b;\n }\n }\n }\n\n function initialize() {\n if (!nodes) return;\n\n var i,\n n = nodes.length,\n m = links.length,\n nodeById = new Map(nodes.map((d, i) => [id(d, i, nodes), d])),\n link;\n\n for (i = 0, count = new Array(n); i < m; ++i) {\n link = links[i], link.index = i;\n if (typeof link.source !== \"object\") link.source = find(nodeById, link.source);\n if (typeof link.target !== \"object\") link.target = find(nodeById, link.target);\n count[link.source.index] = (count[link.source.index] || 0) + 1;\n count[link.target.index] = (count[link.target.index] || 0) + 1;\n }\n\n for (i = 0, bias = new Array(m); i < m; ++i) {\n link = links[i], bias[i] = count[link.source.index] / (count[link.source.index] + count[link.target.index]);\n }\n\n strengths = new Array(m), initializeStrength();\n distances = new Array(m), initializeDistance();\n }\n\n function initializeStrength() {\n if (!nodes) return;\n\n for (var i = 0, n = links.length; i < n; ++i) {\n strengths[i] = +strength(links[i], i, links);\n }\n }\n\n function initializeDistance() {\n if (!nodes) return;\n\n for (var i = 0, n = links.length; i < n; ++i) {\n distances[i] = +distance(links[i], i, links);\n }\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.links = function(_) {\n return arguments.length ? (links = _, initialize(), force) : links;\n };\n\n force.id = function(_) {\n return arguments.length ? (id = _, force) : id;\n };\n\n force.iterations = function(_) {\n return arguments.length ? (iterations = +_, force) : iterations;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initializeStrength(), force) : strength;\n };\n\n force.distance = function(_) {\n return arguments.length ? (distance = typeof _ === \"function\" ? _ : constant(+_), initializeDistance(), force) : distance;\n };\n\n return force;\n}\n","import { Transform } from 'vega-dataflow';\nimport { inherits, array, isFunction, accessorFields, hasOwnProperty, error } from 'vega-util';\nimport { forceSimulation, forceCenter, forceCollide, forceManyBody, forceLink, forceX, forceY } from 'd3-force';\n\nconst ForceMap = {\n center: forceCenter,\n collide: forceCollide,\n nbody: forceManyBody,\n link: forceLink,\n x: forceX,\n y: forceY\n};\nconst Forces = 'forces',\n ForceParams = ['alpha', 'alphaMin', 'alphaTarget', 'velocityDecay', 'forces'],\n ForceConfig = ['static', 'iterations'],\n ForceOutput = ['x', 'y', 'vx', 'vy'];\n\n/**\n * Force simulation layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.forces - The forces to apply.\n */\nfunction Force(params) {\n Transform.call(this, null, params);\n}\nForce.Definition = {\n 'type': 'Force',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'static',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'restart',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'iterations',\n 'type': 'number',\n 'default': 300\n }, {\n 'name': 'alpha',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'alphaMin',\n 'type': 'number',\n 'default': 0.001\n }, {\n 'name': 'alphaTarget',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'velocityDecay',\n 'type': 'number',\n 'default': 0.4\n }, {\n 'name': 'forces',\n 'type': 'param',\n 'array': true,\n 'params': [{\n 'key': {\n 'force': 'center'\n },\n 'params': [{\n 'name': 'x',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'y',\n 'type': 'number',\n 'default': 0\n }]\n }, {\n 'key': {\n 'force': 'collide'\n },\n 'params': [{\n 'name': 'radius',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'strength',\n 'type': 'number',\n 'default': 0.7\n }, {\n 'name': 'iterations',\n 'type': 'number',\n 'default': 1\n }]\n }, {\n 'key': {\n 'force': 'nbody'\n },\n 'params': [{\n 'name': 'strength',\n 'type': 'number',\n 'default': -30,\n 'expr': true\n }, {\n 'name': 'theta',\n 'type': 'number',\n 'default': 0.9\n }, {\n 'name': 'distanceMin',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'distanceMax',\n 'type': 'number'\n }]\n }, {\n 'key': {\n 'force': 'link'\n },\n 'params': [{\n 'name': 'links',\n 'type': 'data'\n }, {\n 'name': 'id',\n 'type': 'field'\n }, {\n 'name': 'distance',\n 'type': 'number',\n 'default': 30,\n 'expr': true\n }, {\n 'name': 'strength',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'iterations',\n 'type': 'number',\n 'default': 1\n }]\n }, {\n 'key': {\n 'force': 'x'\n },\n 'params': [{\n 'name': 'strength',\n 'type': 'number',\n 'default': 0.1\n }, {\n 'name': 'x',\n 'type': 'field'\n }]\n }, {\n 'key': {\n 'force': 'y'\n },\n 'params': [{\n 'name': 'strength',\n 'type': 'number',\n 'default': 0.1\n }, {\n 'name': 'y',\n 'type': 'field'\n }]\n }]\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'modify': false,\n 'default': ForceOutput\n }]\n};\ninherits(Force, Transform, {\n transform(_, pulse) {\n var sim = this.value,\n change = pulse.changed(pulse.ADD_REM),\n params = _.modified(ForceParams),\n iters = _.iterations || 300;\n\n // configure simulation\n if (!sim) {\n this.value = sim = simulation(pulse.source, _);\n sim.on('tick', rerun(pulse.dataflow, this));\n if (!_.static) {\n change = true;\n sim.tick(); // ensure we run on init\n }\n pulse.modifies('index');\n } else {\n if (change) {\n pulse.modifies('index');\n sim.nodes(pulse.source);\n }\n if (params || pulse.changed(pulse.MOD)) {\n setup(sim, _, 0, pulse);\n }\n }\n\n // run simulation\n if (params || change || _.modified(ForceConfig) || pulse.changed() && _.restart) {\n sim.alpha(Math.max(sim.alpha(), _.alpha || 1)).alphaDecay(1 - Math.pow(sim.alphaMin(), 1 / iters));\n if (_.static) {\n for (sim.stop(); --iters >= 0;) sim.tick();\n } else {\n if (sim.stopped()) sim.restart();\n if (!change) return pulse.StopPropagation; // defer to sim ticks\n }\n }\n return this.finish(_, pulse);\n },\n finish(_, pulse) {\n const dataflow = pulse.dataflow;\n\n // inspect dependencies, touch link source data\n for (let args = this._argops, j = 0, m = args.length, arg; j < m; ++j) {\n arg = args[j];\n if (arg.name !== Forces || arg.op._argval.force !== 'link') {\n continue;\n }\n for (var ops = arg.op._argops, i = 0, n = ops.length, op; i < n; ++i) {\n if (ops[i].name === 'links' && (op = ops[i].op.source)) {\n dataflow.pulse(op, dataflow.changeset().reflow());\n break;\n }\n }\n }\n\n // reflow all nodes\n return pulse.reflow(_.modified()).modifies(ForceOutput);\n }\n});\nfunction rerun(df, op) {\n return () => df.touch(op).run();\n}\nfunction simulation(nodes, _) {\n const sim = forceSimulation(nodes),\n stop = sim.stop,\n restart = sim.restart;\n let stopped = false;\n sim.stopped = () => stopped;\n sim.restart = () => (stopped = false, restart());\n sim.stop = () => (stopped = true, stop());\n return setup(sim, _, true).on('end', () => stopped = true);\n}\nfunction setup(sim, _, init, pulse) {\n var f = array(_.forces),\n i,\n n,\n p,\n name;\n for (i = 0, n = ForceParams.length; i < n; ++i) {\n p = ForceParams[i];\n if (p !== Forces && _.modified(p)) sim[p](_[p]);\n }\n for (i = 0, n = f.length; i < n; ++i) {\n name = Forces + i;\n p = init || _.modified(Forces, i) ? getForce(f[i]) : pulse && modified(f[i], pulse) ? sim.force(name) : null;\n if (p) sim.force(name, p);\n }\n for (n = sim.numForces || 0; i < n; ++i) {\n sim.force(Forces + i, null); // remove\n }\n sim.numForces = f.length;\n return sim;\n}\nfunction modified(f, pulse) {\n var k, v;\n for (k in f) {\n if (isFunction(v = f[k]) && pulse.modified(accessorFields(v))) return 1;\n }\n return 0;\n}\nfunction getForce(_) {\n var f, p;\n if (!hasOwnProperty(ForceMap, _.force)) {\n error('Unrecognized force: ' + _.force);\n }\n f = ForceMap[_.force]();\n for (p in _) {\n if (isFunction(f[p])) setForceParam(f[p], _[p], _);\n }\n return f;\n}\nfunction setForceParam(f, v, _) {\n f(isFunction(v) ? d => v(d, _) : v);\n}\n\nexport { Force as force };\n","export default function(x, y) {\n var nodes, strength = 1;\n\n if (x == null) x = 0;\n if (y == null) y = 0;\n\n function force() {\n var i,\n n = nodes.length,\n node,\n sx = 0,\n sy = 0;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i], sx += node.x, sy += node.y;\n }\n\n for (sx = (sx / n - x) * strength, sy = (sy / n - y) * strength, i = 0; i < n; ++i) {\n node = nodes[i], node.x -= sx, node.y -= sy;\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = +_, force) : x;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = +_, force) : y;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = +_, force) : strength;\n };\n\n return force;\n}\n","import {quadtree} from \"d3-quadtree\";\nimport constant from \"./constant.js\";\nimport jiggle from \"./jiggle.js\";\nimport {x, y} from \"./simulation.js\";\n\nexport default function() {\n var nodes,\n node,\n random,\n alpha,\n strength = constant(-30),\n strengths,\n distanceMin2 = 1,\n distanceMax2 = Infinity,\n theta2 = 0.81;\n\n function force(_) {\n var i, n = nodes.length, tree = quadtree(nodes, x, y).visitAfter(accumulate);\n for (alpha = _, i = 0; i < n; ++i) node = nodes[i], tree.visit(apply);\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length, node;\n strengths = new Array(n);\n for (i = 0; i < n; ++i) node = nodes[i], strengths[node.index] = +strength(node, i, nodes);\n }\n\n function accumulate(quad) {\n var strength = 0, q, c, weight = 0, x, y, i;\n\n // For internal nodes, accumulate forces from child quadrants.\n if (quad.length) {\n for (x = y = i = 0; i < 4; ++i) {\n if ((q = quad[i]) && (c = Math.abs(q.value))) {\n strength += q.value, weight += c, x += c * q.x, y += c * q.y;\n }\n }\n quad.x = x / weight;\n quad.y = y / weight;\n }\n\n // For leaf nodes, accumulate forces from coincident quadrants.\n else {\n q = quad;\n q.x = q.data.x;\n q.y = q.data.y;\n do strength += strengths[q.data.index];\n while (q = q.next);\n }\n\n quad.value = strength;\n }\n\n function apply(quad, x1, _, x2) {\n if (!quad.value) return true;\n\n var x = quad.x - node.x,\n y = quad.y - node.y,\n w = x2 - x1,\n l = x * x + y * y;\n\n // Apply the Barnes-Hut approximation if possible.\n // Limit forces for very close nodes; randomize direction if coincident.\n if (w * w / theta2 < l) {\n if (l < distanceMax2) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);\n node.vx += x * quad.value * alpha / l;\n node.vy += y * quad.value * alpha / l;\n }\n return true;\n }\n\n // Otherwise, process points directly.\n else if (quad.length || l >= distanceMax2) return;\n\n // Limit forces for very close nodes; randomize direction if coincident.\n if (quad.data !== node || quad.next) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);\n }\n\n do if (quad.data !== node) {\n w = strengths[quad.data.index] * alpha / l;\n node.vx += x * w;\n node.vy += y * w;\n } while (quad = quad.next);\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.distanceMin = function(_) {\n return arguments.length ? (distanceMin2 = _ * _, force) : Math.sqrt(distanceMin2);\n };\n\n force.distanceMax = function(_) {\n return arguments.length ? (distanceMax2 = _ * _, force) : Math.sqrt(distanceMax2);\n };\n\n force.theta = function(_) {\n return arguments.length ? (theta2 = _ * _, force) : Math.sqrt(theta2);\n };\n\n return force;\n}\n","import constant from \"./constant.js\";\n\nexport default function(x) {\n var strength = constant(0.1),\n nodes,\n strengths,\n xz;\n\n if (typeof x !== \"function\") x = constant(x == null ? 0 : +x);\n\n function force(alpha) {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.vx += (xz[i] - node.x) * strengths[i] * alpha;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n xz = new Array(n);\n for (i = 0; i < n; ++i) {\n strengths[i] = isNaN(xz[i] = +x(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : x;\n };\n\n return force;\n}\n","import constant from \"./constant.js\";\n\nexport default function(y) {\n var strength = constant(0.1),\n nodes,\n strengths,\n yz;\n\n if (typeof y !== \"function\") y = constant(y == null ? 0 : +y);\n\n function force(alpha) {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.vy += (yz[i] - node.y) * strengths[i] * alpha;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n yz = new Array(n);\n for (i = 0; i < n; ++i) {\n strengths[i] = isNaN(yz[i] = +y(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : y;\n };\n\n return force;\n}\n","function count(node) {\n var sum = 0,\n children = node.children,\n i = children && children.length;\n if (!i) sum = 1;\n else while (--i >= 0) sum += children[i].value;\n node.value = sum;\n}\n\nexport default function() {\n return this.eachAfter(count);\n}\n","import node_count from \"./count.js\";\nimport node_each from \"./each.js\";\nimport node_eachBefore from \"./eachBefore.js\";\nimport node_eachAfter from \"./eachAfter.js\";\nimport node_find from \"./find.js\";\nimport node_sum from \"./sum.js\";\nimport node_sort from \"./sort.js\";\nimport node_path from \"./path.js\";\nimport node_ancestors from \"./ancestors.js\";\nimport node_descendants from \"./descendants.js\";\nimport node_leaves from \"./leaves.js\";\nimport node_links from \"./links.js\";\nimport node_iterator from \"./iterator.js\";\n\nexport default function hierarchy(data, children) {\n if (data instanceof Map) {\n data = [undefined, data];\n if (children === undefined) children = mapChildren;\n } else if (children === undefined) {\n children = objectChildren;\n }\n\n var root = new Node(data),\n node,\n nodes = [root],\n child,\n childs,\n i,\n n;\n\n while (node = nodes.pop()) {\n if ((childs = children(node.data)) && (n = (childs = Array.from(childs)).length)) {\n node.children = childs;\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = childs[i] = new Node(childs[i]));\n child.parent = node;\n child.depth = node.depth + 1;\n }\n }\n }\n\n return root.eachBefore(computeHeight);\n}\n\nfunction node_copy() {\n return hierarchy(this).eachBefore(copyData);\n}\n\nfunction objectChildren(d) {\n return d.children;\n}\n\nfunction mapChildren(d) {\n return Array.isArray(d) ? d[1] : null;\n}\n\nfunction copyData(node) {\n if (node.data.value !== undefined) node.value = node.data.value;\n node.data = node.data.data;\n}\n\nexport function computeHeight(node) {\n var height = 0;\n do node.height = height;\n while ((node = node.parent) && (node.height < ++height));\n}\n\nexport function Node(data) {\n this.data = data;\n this.depth =\n this.height = 0;\n this.parent = null;\n}\n\nNode.prototype = hierarchy.prototype = {\n constructor: Node,\n count: node_count,\n each: node_each,\n eachAfter: node_eachAfter,\n eachBefore: node_eachBefore,\n find: node_find,\n sum: node_sum,\n sort: node_sort,\n path: node_path,\n ancestors: node_ancestors,\n descendants: node_descendants,\n leaves: node_leaves,\n links: node_links,\n copy: node_copy,\n [Symbol.iterator]: node_iterator\n};\n","export function optional(f) {\n return f == null ? null : required(f);\n}\n\nexport function required(f) {\n if (typeof f !== \"function\") throw new Error;\n return f;\n}\n","export function constantZero() {\n return 0;\n}\n\nexport default function(x) {\n return function() {\n return x;\n };\n}\n","export default function(callback, that) {\n let index = -1;\n for (const node of this) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n","export default function(callback, that) {\n var node = this, nodes = [node], next = [], children, i, n, index = -1;\n while (node = nodes.pop()) {\n next.push(node);\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n nodes.push(children[i]);\n }\n }\n }\n while (node = next.pop()) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n","export default function(callback, that) {\n var node = this, nodes = [node], children, i, index = -1;\n while (node = nodes.pop()) {\n callback.call(that, node, ++index, this);\n if (children = node.children) {\n for (i = children.length - 1; i >= 0; --i) {\n nodes.push(children[i]);\n }\n }\n }\n return this;\n}\n","export default function(callback, that) {\n let index = -1;\n for (const node of this) {\n if (callback.call(that, node, ++index, this)) {\n return node;\n }\n }\n}\n","export default function(value) {\n return this.eachAfter(function(node) {\n var sum = +value(node.data) || 0,\n children = node.children,\n i = children && children.length;\n while (--i >= 0) sum += children[i].value;\n node.value = sum;\n });\n}\n","export default function(compare) {\n return this.eachBefore(function(node) {\n if (node.children) {\n node.children.sort(compare);\n }\n });\n}\n","export default function(end) {\n var start = this,\n ancestor = leastCommonAncestor(start, end),\n nodes = [start];\n while (start !== ancestor) {\n start = start.parent;\n nodes.push(start);\n }\n var k = nodes.length;\n while (end !== ancestor) {\n nodes.splice(k, 0, end);\n end = end.parent;\n }\n return nodes;\n}\n\nfunction leastCommonAncestor(a, b) {\n if (a === b) return a;\n var aNodes = a.ancestors(),\n bNodes = b.ancestors(),\n c = null;\n a = aNodes.pop();\n b = bNodes.pop();\n while (a === b) {\n c = a;\n a = aNodes.pop();\n b = bNodes.pop();\n }\n return c;\n}\n","export default function() {\n var node = this, nodes = [node];\n while (node = node.parent) {\n nodes.push(node);\n }\n return nodes;\n}\n","export default function() {\n return Array.from(this);\n}\n","export default function() {\n var leaves = [];\n this.eachBefore(function(node) {\n if (!node.children) {\n leaves.push(node);\n }\n });\n return leaves;\n}\n","export default function() {\n var root = this, links = [];\n root.each(function(node) {\n if (node !== root) { // Don’t include the root’s parent, if any.\n links.push({source: node.parent, target: node});\n }\n });\n return links;\n}\n","export default function*() {\n var node = this, current, next = [node], children, i, n;\n do {\n current = next.reverse(), next = [];\n while (node = current.pop()) {\n yield node;\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n next.push(children[i]);\n }\n }\n }\n } while (next.length);\n}\n","// https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use\nconst a = 1664525;\nconst c = 1013904223;\nconst m = 4294967296; // 2^32\n\nexport default function() {\n let s = 1;\n return () => (s = (a * s + c) % m) / m;\n}\n","import {shuffle} from \"../array.js\";\nimport lcg from \"../lcg.js\";\n\nexport default function(circles) {\n return packEncloseRandom(circles, lcg());\n}\n\nexport function packEncloseRandom(circles, random) {\n var i = 0, n = (circles = shuffle(Array.from(circles), random)).length, B = [], p, e;\n\n while (i < n) {\n p = circles[i];\n if (e && enclosesWeak(e, p)) ++i;\n else e = encloseBasis(B = extendBasis(B, p)), i = 0;\n }\n\n return e;\n}\n\nfunction extendBasis(B, p) {\n var i, j;\n\n if (enclosesWeakAll(p, B)) return [p];\n\n // If we get here then B must have at least one element.\n for (i = 0; i < B.length; ++i) {\n if (enclosesNot(p, B[i])\n && enclosesWeakAll(encloseBasis2(B[i], p), B)) {\n return [B[i], p];\n }\n }\n\n // If we get here then B must have at least two elements.\n for (i = 0; i < B.length - 1; ++i) {\n for (j = i + 1; j < B.length; ++j) {\n if (enclosesNot(encloseBasis2(B[i], B[j]), p)\n && enclosesNot(encloseBasis2(B[i], p), B[j])\n && enclosesNot(encloseBasis2(B[j], p), B[i])\n && enclosesWeakAll(encloseBasis3(B[i], B[j], p), B)) {\n return [B[i], B[j], p];\n }\n }\n }\n\n // If we get here then something is very wrong.\n throw new Error;\n}\n\nfunction enclosesNot(a, b) {\n var dr = a.r - b.r, dx = b.x - a.x, dy = b.y - a.y;\n return dr < 0 || dr * dr < dx * dx + dy * dy;\n}\n\nfunction enclosesWeak(a, b) {\n var dr = a.r - b.r + Math.max(a.r, b.r, 1) * 1e-9, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction enclosesWeakAll(a, B) {\n for (var i = 0; i < B.length; ++i) {\n if (!enclosesWeak(a, B[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction encloseBasis(B) {\n switch (B.length) {\n case 1: return encloseBasis1(B[0]);\n case 2: return encloseBasis2(B[0], B[1]);\n case 3: return encloseBasis3(B[0], B[1], B[2]);\n }\n}\n\nfunction encloseBasis1(a) {\n return {\n x: a.x,\n y: a.y,\n r: a.r\n };\n}\n\nfunction encloseBasis2(a, b) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1,\n l = Math.sqrt(x21 * x21 + y21 * y21);\n return {\n x: (x1 + x2 + x21 / l * r21) / 2,\n y: (y1 + y2 + y21 / l * r21) / 2,\n r: (l + r1 + r2) / 2\n };\n}\n\nfunction encloseBasis3(a, b, c) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x3 = c.x, y3 = c.y, r3 = c.r,\n a2 = x1 - x2,\n a3 = x1 - x3,\n b2 = y1 - y2,\n b3 = y1 - y3,\n c2 = r2 - r1,\n c3 = r3 - r1,\n d1 = x1 * x1 + y1 * y1 - r1 * r1,\n d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2,\n d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3,\n ab = a3 * b2 - a2 * b3,\n xa = (b2 * d3 - b3 * d2) / (ab * 2) - x1,\n xb = (b3 * c2 - b2 * c3) / ab,\n ya = (a3 * d2 - a2 * d3) / (ab * 2) - y1,\n yb = (a2 * c3 - a3 * c2) / ab,\n A = xb * xb + yb * yb - 1,\n B = 2 * (r1 + xa * xb + ya * yb),\n C = xa * xa + ya * ya - r1 * r1,\n r = -(Math.abs(A) > 1e-6 ? (B + Math.sqrt(B * B - 4 * A * C)) / (2 * A) : C / B);\n return {\n x: x1 + xa + xb * r,\n y: y1 + ya + yb * r,\n r: r\n };\n}\n","import array from \"../array.js\";\nimport lcg from \"../lcg.js\";\nimport {packEncloseRandom} from \"./enclose.js\";\n\nfunction place(b, a, c) {\n var dx = b.x - a.x, x, a2,\n dy = b.y - a.y, y, b2,\n d2 = dx * dx + dy * dy;\n if (d2) {\n a2 = a.r + c.r, a2 *= a2;\n b2 = b.r + c.r, b2 *= b2;\n if (a2 > b2) {\n x = (d2 + b2 - a2) / (2 * d2);\n y = Math.sqrt(Math.max(0, b2 / d2 - x * x));\n c.x = b.x - x * dx - y * dy;\n c.y = b.y - x * dy + y * dx;\n } else {\n x = (d2 + a2 - b2) / (2 * d2);\n y = Math.sqrt(Math.max(0, a2 / d2 - x * x));\n c.x = a.x + x * dx - y * dy;\n c.y = a.y + x * dy + y * dx;\n }\n } else {\n c.x = a.x + c.r;\n c.y = a.y;\n }\n}\n\nfunction intersects(a, b) {\n var dr = a.r + b.r - 1e-6, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction score(node) {\n var a = node._,\n b = node.next._,\n ab = a.r + b.r,\n dx = (a.x * b.r + b.x * a.r) / ab,\n dy = (a.y * b.r + b.y * a.r) / ab;\n return dx * dx + dy * dy;\n}\n\nfunction Node(circle) {\n this._ = circle;\n this.next = null;\n this.previous = null;\n}\n\nexport function packSiblingsRandom(circles, random) {\n if (!(n = (circles = array(circles)).length)) return 0;\n\n var a, b, c, n, aa, ca, i, j, k, sj, sk;\n\n // Place the first circle.\n a = circles[0], a.x = 0, a.y = 0;\n if (!(n > 1)) return a.r;\n\n // Place the second circle.\n b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0;\n if (!(n > 2)) return a.r + b.r;\n\n // Place the third circle.\n place(b, a, c = circles[2]);\n\n // Initialize the front-chain using the first three circles a, b and c.\n a = new Node(a), b = new Node(b), c = new Node(c);\n a.next = c.previous = b;\n b.next = a.previous = c;\n c.next = b.previous = a;\n\n // Attempt to place each remaining circle…\n pack: for (i = 3; i < n; ++i) {\n place(a._, b._, c = circles[i]), c = new Node(c);\n\n // Find the closest intersecting circle on the front-chain, if any.\n // “Closeness” is determined by linear distance along the front-chain.\n // “Ahead” or “behind” is likewise determined by linear distance.\n j = b.next, k = a.previous, sj = b._.r, sk = a._.r;\n do {\n if (sj <= sk) {\n if (intersects(j._, c._)) {\n b = j, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sj += j._.r, j = j.next;\n } else {\n if (intersects(k._, c._)) {\n a = k, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sk += k._.r, k = k.previous;\n }\n } while (j !== k.next);\n\n // Success! Insert the new circle c between a and b.\n c.previous = a, c.next = b, a.next = b.previous = b = c;\n\n // Compute the new closest circle pair to the centroid.\n aa = score(a);\n while ((c = c.next) !== b) {\n if ((ca = score(c)) < aa) {\n a = c, aa = ca;\n }\n }\n b = a.next;\n }\n\n // Compute the enclosing circle of the front chain.\n a = [b._], c = b; while ((c = c.next) !== b) a.push(c._); c = packEncloseRandom(a, random);\n\n // Translate the circles to put the enclosing circle around the origin.\n for (i = 0; i < n; ++i) a = circles[i], a.x -= c.x, a.y -= c.y;\n\n return c.r;\n}\n\nexport default function(circles) {\n packSiblingsRandom(circles, lcg());\n return circles;\n}\n","export default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n\nexport function shuffle(array, random) {\n let m = array.length,\n t,\n i;\n\n while (m) {\n i = random() * m-- | 0;\n t = array[m];\n array[m] = array[i];\n array[i] = t;\n }\n\n return array;\n}\n","import {optional} from \"../accessors.js\";\nimport constant, {constantZero} from \"../constant.js\";\nimport lcg from \"../lcg.js\";\nimport {packSiblingsRandom} from \"./siblings.js\";\n\nfunction defaultRadius(d) {\n return Math.sqrt(d.value);\n}\n\nexport default function() {\n var radius = null,\n dx = 1,\n dy = 1,\n padding = constantZero;\n\n function pack(root) {\n const random = lcg();\n root.x = dx / 2, root.y = dy / 2;\n if (radius) {\n root.eachBefore(radiusLeaf(radius))\n .eachAfter(packChildrenRandom(padding, 0.5, random))\n .eachBefore(translateChild(1));\n } else {\n root.eachBefore(radiusLeaf(defaultRadius))\n .eachAfter(packChildrenRandom(constantZero, 1, random))\n .eachAfter(packChildrenRandom(padding, root.r / Math.min(dx, dy), random))\n .eachBefore(translateChild(Math.min(dx, dy) / (2 * root.r)));\n }\n return root;\n }\n\n pack.radius = function(x) {\n return arguments.length ? (radius = optional(x), pack) : radius;\n };\n\n pack.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], pack) : [dx, dy];\n };\n\n pack.padding = function(x) {\n return arguments.length ? (padding = typeof x === \"function\" ? x : constant(+x), pack) : padding;\n };\n\n return pack;\n}\n\nfunction radiusLeaf(radius) {\n return function(node) {\n if (!node.children) {\n node.r = Math.max(0, +radius(node) || 0);\n }\n };\n}\n\nfunction packChildrenRandom(padding, k, random) {\n return function(node) {\n if (children = node.children) {\n var children,\n i,\n n = children.length,\n r = padding(node) * k || 0,\n e;\n\n if (r) for (i = 0; i < n; ++i) children[i].r += r;\n e = packSiblingsRandom(children, random);\n if (r) for (i = 0; i < n; ++i) children[i].r -= r;\n node.r = e + r;\n }\n };\n}\n\nfunction translateChild(k) {\n return function(node) {\n var parent = node.parent;\n node.r *= k;\n if (parent) {\n node.x = parent.x + k * node.x;\n node.y = parent.y + k * node.y;\n }\n };\n}\n","export default function(node) {\n node.x0 = Math.round(node.x0);\n node.y0 = Math.round(node.y0);\n node.x1 = Math.round(node.x1);\n node.y1 = Math.round(node.y1);\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (x1 - x0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.y0 = y0, node.y1 = y1;\n node.x0 = x0, node.x1 = x0 += node.value * k;\n }\n}\n","import {optional} from \"./accessors.js\";\nimport {Node, computeHeight} from \"./hierarchy/index.js\";\n\nvar preroot = {depth: -1},\n ambiguous = {},\n imputed = {};\n\nfunction defaultId(d) {\n return d.id;\n}\n\nfunction defaultParentId(d) {\n return d.parentId;\n}\n\nexport default function() {\n var id = defaultId,\n parentId = defaultParentId,\n path;\n\n function stratify(data) {\n var nodes = Array.from(data),\n currentId = id,\n currentParentId = parentId,\n n,\n d,\n i,\n root,\n parent,\n node,\n nodeId,\n nodeKey,\n nodeByKey = new Map;\n\n if (path != null) {\n const I = nodes.map((d, i) => normalize(path(d, i, data)));\n const P = I.map(parentof);\n const S = new Set(I).add(\"\");\n for (const i of P) {\n if (!S.has(i)) {\n S.add(i);\n I.push(i);\n P.push(parentof(i));\n nodes.push(imputed);\n }\n }\n currentId = (_, i) => I[i];\n currentParentId = (_, i) => P[i];\n }\n\n for (i = 0, n = nodes.length; i < n; ++i) {\n d = nodes[i], node = nodes[i] = new Node(d);\n if ((nodeId = currentId(d, i, data)) != null && (nodeId += \"\")) {\n nodeKey = node.id = nodeId;\n nodeByKey.set(nodeKey, nodeByKey.has(nodeKey) ? ambiguous : node);\n }\n if ((nodeId = currentParentId(d, i, data)) != null && (nodeId += \"\")) {\n node.parent = nodeId;\n }\n }\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n if (nodeId = node.parent) {\n parent = nodeByKey.get(nodeId);\n if (!parent) throw new Error(\"missing: \" + nodeId);\n if (parent === ambiguous) throw new Error(\"ambiguous: \" + nodeId);\n if (parent.children) parent.children.push(node);\n else parent.children = [node];\n node.parent = parent;\n } else {\n if (root) throw new Error(\"multiple roots\");\n root = node;\n }\n }\n\n if (!root) throw new Error(\"no root\");\n\n // When imputing internal nodes, only introduce roots if needed.\n // Then replace the imputed marker data with null.\n if (path != null) {\n while (root.data === imputed && root.children.length === 1) {\n root = root.children[0], --n;\n }\n for (let i = nodes.length - 1; i >= 0; --i) {\n node = nodes[i];\n if (node.data !== imputed) break;\n node.data = null;\n }\n }\n\n root.parent = preroot;\n root.eachBefore(function(node) { node.depth = node.parent.depth + 1; --n; }).eachBefore(computeHeight);\n root.parent = null;\n if (n > 0) throw new Error(\"cycle\");\n\n return root;\n }\n\n stratify.id = function(x) {\n return arguments.length ? (id = optional(x), stratify) : id;\n };\n\n stratify.parentId = function(x) {\n return arguments.length ? (parentId = optional(x), stratify) : parentId;\n };\n\n stratify.path = function(x) {\n return arguments.length ? (path = optional(x), stratify) : path;\n };\n\n return stratify;\n}\n\n// To normalize a path, we coerce to a string, strip the trailing slash if any\n// (as long as the trailing slash is not immediately preceded by another slash),\n// and add leading slash if missing.\nfunction normalize(path) {\n path = `${path}`;\n let i = path.length;\n if (slash(path, i - 1) && !slash(path, i - 2)) path = path.slice(0, -1);\n return path[0] === \"/\" ? path : `/${path}`;\n}\n\n// Walk backwards to find the first slash that is not the leading slash, e.g.:\n// \"/foo/bar\" ⇥ \"/foo\", \"/foo\" ⇥ \"/\", \"/\" ↦ \"\". (The root is special-cased\n// because the id of the root must be a truthy value.)\nfunction parentof(path) {\n let i = path.length;\n if (i < 2) return \"\";\n while (--i > 1) if (slash(path, i)) break;\n return path.slice(0, i);\n}\n\n// Slashes can be escaped; to determine whether a slash is a path delimiter, we\n// count the number of preceding backslashes escaping the forward slash: an odd\n// number indicates an escaped forward slash.\nfunction slash(path, i) {\n if (path[i] === \"/\") {\n let k = 0;\n while (i > 0 && path[--i] === \"\\\\\") ++k;\n if ((k & 1) === 0) return true;\n }\n return false;\n}\n","import {Node} from \"./hierarchy/index.js\";\n\nfunction defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\n// function radialSeparation(a, b) {\n// return (a.parent === b.parent ? 1 : 2) / a.depth;\n// }\n\n// This function is used to traverse the left contour of a subtree (or\n// subforest). It returns the successor of v on this contour. This successor is\n// either given by the leftmost child of v or by the thread of v. The function\n// returns null if and only if v is on the highest level of its subtree.\nfunction nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n}\n\n// This function works analogously to nextLeft.\nfunction nextRight(v) {\n var children = v.children;\n return children ? children[children.length - 1] : v.t;\n}\n\n// Shifts the current subtree rooted at w+. This is done by increasing\n// prelim(w+) and mod(w+) by shift.\nfunction moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}\n\n// All other shifts, applied to the smaller subtrees between w- and w+, are\n// performed by this function. To prepare the shifts, we have to adjust\n// change(w+), shift(w+), and change(w-).\nfunction executeShifts(v) {\n var shift = 0,\n change = 0,\n children = v.children,\n i = children.length,\n w;\n while (--i >= 0) {\n w = children[i];\n w.z += shift;\n w.m += shift;\n shift += w.s + (change += w.c);\n }\n}\n\n// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise,\n// returns the specified (default) ancestor.\nfunction nextAncestor(vim, v, ancestor) {\n return vim.a.parent === v.parent ? vim.a : ancestor;\n}\n\nfunction TreeNode(node, i) {\n this._ = node;\n this.parent = null;\n this.children = null;\n this.A = null; // default ancestor\n this.a = this; // ancestor\n this.z = 0; // prelim\n this.m = 0; // mod\n this.c = 0; // change\n this.s = 0; // shift\n this.t = null; // thread\n this.i = i; // number\n}\n\nTreeNode.prototype = Object.create(Node.prototype);\n\nfunction treeRoot(root) {\n var tree = new TreeNode(root, 0),\n node,\n nodes = [tree],\n child,\n children,\n i,\n n;\n\n while (node = nodes.pop()) {\n if (children = node._.children) {\n node.children = new Array(n = children.length);\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = node.children[i] = new TreeNode(children[i], i));\n child.parent = node;\n }\n }\n }\n\n (tree.parent = new TreeNode(null, 0)).children = [tree];\n return tree;\n}\n\n// Node-link tree diagram using the Reingold-Tilford \"tidy\" algorithm\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}\n","function defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\nfunction meanX(children) {\n return children.reduce(meanXReduce, 0) / children.length;\n}\n\nfunction meanXReduce(x, c) {\n return x + c.x;\n}\n\nfunction maxY(children) {\n return 1 + children.reduce(maxYReduce, 0);\n}\n\nfunction maxYReduce(y, c) {\n return Math.max(y, c.y);\n}\n\nfunction leafLeft(node) {\n var children;\n while (children = node.children) node = children[0];\n return node;\n}\n\nfunction leafRight(node) {\n var children;\n while (children = node.children) node = children[children.length - 1];\n return node;\n}\n\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = false;\n\n function cluster(root) {\n var previousNode,\n x = 0;\n\n // First walk, computing the initial x & y values.\n root.eachAfter(function(node) {\n var children = node.children;\n if (children) {\n node.x = meanX(children);\n node.y = maxY(children);\n } else {\n node.x = previousNode ? x += separation(node, previousNode) : 0;\n node.y = 0;\n previousNode = node;\n }\n });\n\n var left = leafLeft(root),\n right = leafRight(root),\n x0 = left.x - separation(left, right) / 2,\n x1 = right.x + separation(right, left) / 2;\n\n // Second walk, normalizing x & y to the desired size.\n return root.eachAfter(nodeSize ? function(node) {\n node.x = (node.x - root.x) * dx;\n node.y = (root.y - node.y) * dy;\n } : function(node) {\n node.x = (node.x - x0) / (x1 - x0) * dx;\n node.y = (1 - (root.y ? node.y / root.y : 1)) * dy;\n });\n }\n\n cluster.separation = function(x) {\n return arguments.length ? (separation = x, cluster) : separation;\n };\n\n cluster.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? null : [dx, dy]);\n };\n\n cluster.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? [dx, dy] : null);\n };\n\n return cluster;\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (y1 - y0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.x0 = x0, node.x1 = x1;\n node.y0 = y0, node.y1 = y0 += node.value * k;\n }\n}\n","import treemapDice from \"./dice.js\";\nimport treemapSlice from \"./slice.js\";\n\nexport var phi = (1 + Math.sqrt(5)) / 2;\n\nexport function squarifyRatio(ratio, parent, x0, y0, x1, y1) {\n var rows = [],\n nodes = parent.children,\n row,\n nodeValue,\n i0 = 0,\n i1 = 0,\n n = nodes.length,\n dx, dy,\n value = parent.value,\n sumValue,\n minValue,\n maxValue,\n newRatio,\n minRatio,\n alpha,\n beta;\n\n while (i0 < n) {\n dx = x1 - x0, dy = y1 - y0;\n\n // Find the next non-empty node.\n do sumValue = nodes[i1++].value; while (!sumValue && i1 < n);\n minValue = maxValue = sumValue;\n alpha = Math.max(dy / dx, dx / dy) / (value * ratio);\n beta = sumValue * sumValue * alpha;\n minRatio = Math.max(maxValue / beta, beta / minValue);\n\n // Keep adding nodes while the aspect ratio maintains or improves.\n for (; i1 < n; ++i1) {\n sumValue += nodeValue = nodes[i1].value;\n if (nodeValue < minValue) minValue = nodeValue;\n if (nodeValue > maxValue) maxValue = nodeValue;\n beta = sumValue * sumValue * alpha;\n newRatio = Math.max(maxValue / beta, beta / minValue);\n if (newRatio > minRatio) { sumValue -= nodeValue; break; }\n minRatio = newRatio;\n }\n\n // Position and record the row orientation.\n rows.push(row = {value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1)});\n if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);\n else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);\n value -= sumValue, i0 = i1;\n }\n\n return rows;\n}\n\nexport default (function custom(ratio) {\n\n function squarify(parent, x0, y0, x1, y1) {\n squarifyRatio(ratio, parent, x0, y0, x1, y1);\n }\n\n squarify.ratio = function(x) {\n return custom((x = +x) > 1 ? x : 1);\n };\n\n return squarify;\n})(phi);\n","import treemapDice from \"./dice.js\";\nimport treemapSlice from \"./slice.js\";\nimport {phi, squarifyRatio} from \"./squarify.js\";\n\nexport default (function custom(ratio) {\n\n function resquarify(parent, x0, y0, x1, y1) {\n if ((rows = parent._squarify) && (rows.ratio === ratio)) {\n var rows,\n row,\n nodes,\n i,\n j = -1,\n n,\n m = rows.length,\n value = parent.value;\n\n while (++j < m) {\n row = rows[j], nodes = row.children;\n for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value;\n if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += (y1 - y0) * row.value / value : y1);\n else treemapSlice(row, x0, y0, value ? x0 += (x1 - x0) * row.value / value : x1, y1);\n value -= row.value;\n }\n } else {\n parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);\n rows.ratio = ratio;\n }\n }\n\n resquarify.ratio = function(x) {\n return custom((x = +x) > 1 ? x : 1);\n };\n\n return resquarify;\n})(phi);\n","import { Transform, isTuple, ingest, tupleid, stableCompare } from 'vega-dataflow';\nimport { inherits, error, array, one, truthy, hasOwnProperty } from 'vega-util';\nimport { hierarchy, pack, partition, stratify, tree, cluster, treemap, treemapBinary, treemapDice, treemapSlice, treemapSliceDice, treemapSquarify, treemapResquarify } from 'd3-hierarchy';\n\n// Build lookup table mapping tuple keys to tree node instances\nfunction lookup (tree, key, filter) {\n const map = {};\n tree.each(node => {\n const t = node.data;\n if (filter(t)) map[key(t)] = node;\n });\n tree.lookup = map;\n return tree;\n}\n\n/**\n * Nest tuples into a tree structure, grouped by key values.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.keys - The key fields to nest by, in order.\n * @param {boolean} [params.generate=false] - A boolean flag indicating if\n * non-leaf nodes generated by this transform should be included in the\n * output. The default (false) includes only the input data (leaf nodes)\n * in the data stream.\n */\nfunction Nest(params) {\n Transform.call(this, null, params);\n}\nNest.Definition = {\n 'type': 'Nest',\n 'metadata': {\n 'treesource': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'keys',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'generate',\n 'type': 'boolean'\n }]\n};\nconst children = n => n.values;\ninherits(Nest, Transform, {\n transform(_, pulse) {\n if (!pulse.source) {\n error('Nest transform requires an upstream data source.');\n }\n var gen = _.generate,\n mod = _.modified(),\n out = pulse.clone(),\n tree = this.value;\n if (!tree || mod || pulse.changed()) {\n // collect nodes to remove\n if (tree) {\n tree.each(node => {\n if (node.children && isTuple(node.data)) {\n out.rem.push(node.data);\n }\n });\n }\n\n // generate new tree structure\n this.value = tree = hierarchy({\n values: array(_.keys).reduce((n, k) => {\n n.key(k);\n return n;\n }, nest()).entries(out.source)\n }, children);\n\n // collect nodes to add\n if (gen) {\n tree.each(node => {\n if (node.children) {\n node = ingest(node.data);\n out.add.push(node);\n out.source.push(node);\n }\n });\n }\n\n // build lookup table\n lookup(tree, tupleid, tupleid);\n }\n out.source.root = tree;\n return out;\n }\n});\nfunction nest() {\n const keys = [],\n nest = {\n entries: array => entries(apply(array, 0), 0),\n key: d => (keys.push(d), nest)\n };\n function apply(array, depth) {\n if (depth >= keys.length) {\n return array;\n }\n const n = array.length,\n key = keys[depth++],\n valuesByKey = {},\n result = {};\n let i = -1,\n keyValue,\n value,\n values;\n while (++i < n) {\n keyValue = key(value = array[i]) + '';\n if (values = valuesByKey[keyValue]) {\n values.push(value);\n } else {\n valuesByKey[keyValue] = [value];\n }\n }\n for (keyValue in valuesByKey) {\n result[keyValue] = apply(valuesByKey[keyValue], depth);\n }\n return result;\n }\n function entries(map, depth) {\n if (++depth > keys.length) return map;\n const array = [];\n for (const key in map) {\n array.push({\n key,\n values: entries(map[key], depth)\n });\n }\n return array;\n }\n return nest;\n}\n\n/**\n * Abstract class for tree layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction HierarchyLayout(params) {\n Transform.call(this, null, params);\n}\nconst defaultSeparation = (a, b) => a.parent === b.parent ? 1 : 2;\ninherits(HierarchyLayout, Transform, {\n transform(_, pulse) {\n if (!pulse.source || !pulse.source.root) {\n error(this.constructor.name + ' transform requires a backing tree data source.');\n }\n const layout = this.layout(_.method),\n fields = this.fields,\n root = pulse.source.root,\n as = _.as || fields;\n if (_.field) root.sum(_.field);else root.count();\n if (_.sort) root.sort(stableCompare(_.sort, d => d.data));\n setParams(layout, this.params, _);\n if (layout.separation) {\n layout.separation(_.separation !== false ? defaultSeparation : one);\n }\n try {\n this.value = layout(root);\n } catch (err) {\n error(err);\n }\n root.each(node => setFields(node, fields, as));\n return pulse.reflow(_.modified()).modifies(as).modifies('leaf');\n }\n});\nfunction setParams(layout, params, _) {\n for (let p, i = 0, n = params.length; i < n; ++i) {\n p = params[i];\n if (p in _) layout[p](_[p]);\n }\n}\nfunction setFields(node, fields, as) {\n const t = node.data,\n n = fields.length - 1;\n for (let i = 0; i < n; ++i) {\n t[as[i]] = node[fields[i]];\n }\n t[as[n]] = node.children ? node.children.length : 0;\n}\n\nconst Output$3 = ['x', 'y', 'r', 'depth', 'children'];\n\n/**\n * Packed circle tree layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size nodes.\n */\nfunction Pack(params) {\n HierarchyLayout.call(this, params);\n}\nPack.Definition = {\n 'type': 'Pack',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'radius',\n 'type': 'field',\n 'default': null\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output$3.length,\n 'default': Output$3\n }]\n};\ninherits(Pack, HierarchyLayout, {\n layout: pack,\n params: ['radius', 'size', 'padding'],\n fields: Output$3\n});\n\nconst Output$2 = ['x0', 'y0', 'x1', 'y1', 'depth', 'children'];\n\n/**\n * Partition tree layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size nodes.\n */\nfunction Partition(params) {\n HierarchyLayout.call(this, params);\n}\nPartition.Definition = {\n 'type': 'Partition',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'round',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output$2.length,\n 'default': Output$2\n }]\n};\ninherits(Partition, HierarchyLayout, {\n layout: partition,\n params: ['size', 'round', 'padding'],\n fields: Output$2\n});\n\n/**\n * Stratify a collection of tuples into a tree structure based on\n * id and parent id fields.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.key - Unique key field for each tuple.\n * @param {function(object): *} params.parentKey - Field with key for parent tuple.\n */\nfunction Stratify(params) {\n Transform.call(this, null, params);\n}\nStratify.Definition = {\n 'type': 'Stratify',\n 'metadata': {\n 'treesource': true\n },\n 'params': [{\n 'name': 'key',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'parentKey',\n 'type': 'field',\n 'required': true\n }]\n};\ninherits(Stratify, Transform, {\n transform(_, pulse) {\n if (!pulse.source) {\n error('Stratify transform requires an upstream data source.');\n }\n let tree = this.value;\n const mod = _.modified(),\n out = pulse.fork(pulse.ALL).materialize(pulse.SOURCE),\n run = !tree || mod || pulse.changed(pulse.ADD_REM) || pulse.modified(_.key.fields) || pulse.modified(_.parentKey.fields);\n\n // prevent upstream source pollution\n out.source = out.source.slice();\n if (run) {\n tree = out.source.length ? lookup(stratify().id(_.key).parentId(_.parentKey)(out.source), _.key, truthy) : lookup(stratify()([{}]), _.key, _.key);\n }\n out.source.root = this.value = tree;\n return out;\n }\n});\n\nconst Layouts = {\n tidy: tree,\n cluster: cluster\n};\nconst Output$1 = ['x', 'y', 'depth', 'children'];\n\n/**\n * Tree layout. Depending on the method parameter, performs either\n * Reingold-Tilford 'tidy' layout or dendrogram 'cluster' layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction Tree(params) {\n HierarchyLayout.call(this, params);\n}\nTree.Definition = {\n 'type': 'Tree',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'method',\n 'type': 'enum',\n 'default': 'tidy',\n 'values': ['tidy', 'cluster']\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'nodeSize',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'separation',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output$1.length,\n 'default': Output$1\n }]\n};\ninherits(Tree, HierarchyLayout, {\n /**\n * Tree layout generator. Supports both 'tidy' and 'cluster' layouts.\n */\n layout(method) {\n const m = method || 'tidy';\n if (hasOwnProperty(Layouts, m)) return Layouts[m]();else error('Unrecognized Tree layout method: ' + m);\n },\n params: ['size', 'nodeSize'],\n fields: Output$1\n});\n\n/**\n * Generate tuples representing links between tree nodes.\n * The resulting tuples will contain 'source' and 'target' fields,\n * which point to parent and child node tuples, respectively.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction TreeLinks(params) {\n Transform.call(this, [], params);\n}\nTreeLinks.Definition = {\n 'type': 'TreeLinks',\n 'metadata': {\n 'tree': true,\n 'generates': true,\n 'changes': true\n },\n 'params': []\n};\ninherits(TreeLinks, Transform, {\n transform(_, pulse) {\n const links = this.value,\n tree = pulse.source && pulse.source.root,\n out = pulse.fork(pulse.NO_SOURCE),\n lut = {};\n if (!tree) error('TreeLinks transform requires a tree data source.');\n if (pulse.changed(pulse.ADD_REM)) {\n // remove previous links\n out.rem = links;\n\n // build lookup table of valid tuples\n pulse.visit(pulse.SOURCE, t => lut[tupleid(t)] = 1);\n\n // generate links for all edges incident on valid tuples\n tree.each(node => {\n const t = node.data,\n p = node.parent && node.parent.data;\n if (p && lut[tupleid(t)] && lut[tupleid(p)]) {\n out.add.push(ingest({\n source: p,\n target: t\n }));\n }\n });\n this.value = out.add;\n } else if (pulse.changed(pulse.MOD)) {\n // build lookup table of modified tuples\n pulse.visit(pulse.MOD, t => lut[tupleid(t)] = 1);\n\n // gather links incident on modified tuples\n links.forEach(link => {\n if (lut[tupleid(link.source)] || lut[tupleid(link.target)]) {\n out.mod.push(link);\n }\n });\n }\n return out;\n }\n});\n\nconst Tiles = {\n binary: treemapBinary,\n dice: treemapDice,\n slice: treemapSlice,\n slicedice: treemapSliceDice,\n squarify: treemapSquarify,\n resquarify: treemapResquarify\n};\nconst Output = ['x0', 'y0', 'x1', 'y1', 'depth', 'children'];\n\n/**\n * Treemap layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size nodes.\n */\nfunction Treemap(params) {\n HierarchyLayout.call(this, params);\n}\nTreemap.Definition = {\n 'type': 'Treemap',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'method',\n 'type': 'enum',\n 'default': 'squarify',\n 'values': ['squarify', 'resquarify', 'binary', 'dice', 'slice', 'slicedice']\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingInner',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingOuter',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingTop',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingRight',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingBottom',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingLeft',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'ratio',\n 'type': 'number',\n 'default': 1.618033988749895\n }, {\n 'name': 'round',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output.length,\n 'default': Output\n }]\n};\ninherits(Treemap, HierarchyLayout, {\n /**\n * Treemap layout generator. Adds 'method' and 'ratio' parameters\n * to configure the underlying tile method.\n */\n layout() {\n const x = treemap();\n x.ratio = _ => {\n const t = x.tile();\n if (t.ratio) x.tile(t.ratio(_));\n };\n x.method = _ => {\n if (hasOwnProperty(Tiles, _)) x.tile(Tiles[_]);else error('Unrecognized Treemap layout method: ' + _);\n };\n return x;\n },\n params: ['method', 'ratio', 'size', 'round', 'padding', 'paddingInner', 'paddingOuter', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n fields: Output\n});\n\nexport { Nest as nest, Pack as pack, Partition as partition, Stratify as stratify, Tree as tree, TreeLinks as treelinks, Treemap as treemap };\n","import roundNode from \"./treemap/round.js\";\nimport treemapDice from \"./treemap/dice.js\";\n\nexport default function() {\n var dx = 1,\n dy = 1,\n padding = 0,\n round = false;\n\n function partition(root) {\n var n = root.height + 1;\n root.x0 =\n root.y0 = padding;\n root.x1 = dx;\n root.y1 = dy / n;\n root.eachBefore(positionNode(dy, n));\n if (round) root.eachBefore(roundNode);\n return root;\n }\n\n function positionNode(dy, n) {\n return function(node) {\n if (node.children) {\n treemapDice(node, node.x0, dy * (node.depth + 1) / n, node.x1, dy * (node.depth + 2) / n);\n }\n var x0 = node.x0,\n y0 = node.y0,\n x1 = node.x1 - padding,\n y1 = node.y1 - padding;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n };\n }\n\n partition.round = function(x) {\n return arguments.length ? (round = !!x, partition) : round;\n };\n\n partition.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], partition) : [dx, dy];\n };\n\n partition.padding = function(x) {\n return arguments.length ? (padding = +x, partition) : padding;\n };\n\n return partition;\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n i, n = nodes.length,\n sum, sums = new Array(n + 1);\n\n for (sums[0] = sum = i = 0; i < n; ++i) {\n sums[i + 1] = sum += nodes[i].value;\n }\n\n partition(0, n, parent.value, x0, y0, x1, y1);\n\n function partition(i, j, value, x0, y0, x1, y1) {\n if (i >= j - 1) {\n var node = nodes[i];\n node.x0 = x0, node.y0 = y0;\n node.x1 = x1, node.y1 = y1;\n return;\n }\n\n var valueOffset = sums[i],\n valueTarget = (value / 2) + valueOffset,\n k = i + 1,\n hi = j - 1;\n\n while (k < hi) {\n var mid = k + hi >>> 1;\n if (sums[mid] < valueTarget) k = mid + 1;\n else hi = mid;\n }\n\n if ((valueTarget - sums[k - 1]) < (sums[k] - valueTarget) && i + 1 < k) --k;\n\n var valueLeft = sums[k] - valueOffset,\n valueRight = value - valueLeft;\n\n if ((x1 - x0) > (y1 - y0)) {\n var xk = value ? (x0 * valueRight + x1 * valueLeft) / value : x1;\n partition(i, k, valueLeft, x0, y0, xk, y1);\n partition(k, j, valueRight, xk, y0, x1, y1);\n } else {\n var yk = value ? (y0 * valueRight + y1 * valueLeft) / value : y1;\n partition(i, k, valueLeft, x0, y0, x1, yk);\n partition(k, j, valueRight, x0, yk, x1, y1);\n }\n }\n}\n","import dice from \"./dice.js\";\nimport slice from \"./slice.js\";\n\nexport default function(parent, x0, y0, x1, y1) {\n (parent.depth & 1 ? slice : dice)(parent, x0, y0, x1, y1);\n}\n","import roundNode from \"./round.js\";\nimport squarify from \"./squarify.js\";\nimport {required} from \"../accessors.js\";\nimport constant, {constantZero} from \"../constant.js\";\n\nexport default function() {\n var tile = squarify,\n round = false,\n dx = 1,\n dy = 1,\n paddingStack = [0],\n paddingInner = constantZero,\n paddingTop = constantZero,\n paddingRight = constantZero,\n paddingBottom = constantZero,\n paddingLeft = constantZero;\n\n function treemap(root) {\n root.x0 =\n root.y0 = 0;\n root.x1 = dx;\n root.y1 = dy;\n root.eachBefore(positionNode);\n paddingStack = [0];\n if (round) root.eachBefore(roundNode);\n return root;\n }\n\n function positionNode(node) {\n var p = paddingStack[node.depth],\n x0 = node.x0 + p,\n y0 = node.y0 + p,\n x1 = node.x1 - p,\n y1 = node.y1 - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n if (node.children) {\n p = paddingStack[node.depth + 1] = paddingInner(node) / 2;\n x0 += paddingLeft(node) - p;\n y0 += paddingTop(node) - p;\n x1 -= paddingRight(node) - p;\n y1 -= paddingBottom(node) - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n tile(node, x0, y0, x1, y1);\n }\n }\n\n treemap.round = function(x) {\n return arguments.length ? (round = !!x, treemap) : round;\n };\n\n treemap.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];\n };\n\n treemap.tile = function(x) {\n return arguments.length ? (tile = required(x), treemap) : tile;\n };\n\n treemap.padding = function(x) {\n return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();\n };\n\n treemap.paddingInner = function(x) {\n return arguments.length ? (paddingInner = typeof x === \"function\" ? x : constant(+x), treemap) : paddingInner;\n };\n\n treemap.paddingOuter = function(x) {\n return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();\n };\n\n treemap.paddingTop = function(x) {\n return arguments.length ? (paddingTop = typeof x === \"function\" ? x : constant(+x), treemap) : paddingTop;\n };\n\n treemap.paddingRight = function(x) {\n return arguments.length ? (paddingRight = typeof x === \"function\" ? x : constant(+x), treemap) : paddingRight;\n };\n\n treemap.paddingBottom = function(x) {\n return arguments.length ? (paddingBottom = typeof x === \"function\" ? x : constant(+x), treemap) : paddingBottom;\n };\n\n treemap.paddingLeft = function(x) {\n return arguments.length ? (paddingLeft = typeof x === \"function\" ? x : constant(+x), treemap) : paddingLeft;\n };\n\n return treemap;\n}\n","import { Marks, textMetrics } from 'vega-scenegraph';\nimport { canvas } from 'vega-canvas';\nimport { rederive, Transform } from 'vega-dataflow';\nimport { inherits, error, array, isFunction } from 'vega-util';\n\n// bit mask for getting first 2 bytes of alpha value\nconst ALPHA_MASK = 0xff000000;\nfunction baseBitmaps($, data) {\n const bitmap = $.bitmap();\n // when there is no base mark but data points are to be avoided\n (data || []).forEach(d => bitmap.set($(d.boundary[0]), $(d.boundary[3])));\n return [bitmap, undefined];\n}\nfunction markBitmaps($, baseMark, avoidMarks, labelInside, isGroupArea) {\n // create canvas\n const width = $.width,\n height = $.height,\n border = labelInside || isGroupArea,\n context = canvas(width, height).getContext('2d'),\n baseMarkContext = canvas(width, height).getContext('2d'),\n strokeContext = border && canvas(width, height).getContext('2d');\n\n // render all marks to be avoided into canvas\n avoidMarks.forEach(items => draw(context, items, false));\n draw(baseMarkContext, baseMark, false);\n if (border) {\n draw(strokeContext, baseMark, true);\n }\n\n // get canvas buffer, create bitmaps\n const buffer = getBuffer(context, width, height),\n baseMarkBuffer = getBuffer(baseMarkContext, width, height),\n strokeBuffer = border && getBuffer(strokeContext, width, height),\n layer1 = $.bitmap(),\n layer2 = border && $.bitmap();\n\n // populate bitmap layers\n let x, y, u, v, index, alpha, strokeAlpha, baseMarkAlpha;\n for (y = 0; y < height; ++y) {\n for (x = 0; x < width; ++x) {\n index = y * width + x;\n alpha = buffer[index] & ALPHA_MASK;\n baseMarkAlpha = baseMarkBuffer[index] & ALPHA_MASK;\n strokeAlpha = border && strokeBuffer[index] & ALPHA_MASK;\n if (alpha || strokeAlpha || baseMarkAlpha) {\n u = $(x);\n v = $(y);\n if (!isGroupArea && (alpha || baseMarkAlpha)) layer1.set(u, v); // update interior bitmap\n if (border && (alpha || strokeAlpha)) layer2.set(u, v); // update border bitmap\n }\n }\n }\n return [layer1, layer2];\n}\nfunction getBuffer(context, width, height) {\n return new Uint32Array(context.getImageData(0, 0, width, height).data.buffer);\n}\nfunction draw(context, items, interior) {\n if (!items.length) return;\n const type = items[0].mark.marktype;\n if (type === 'group') {\n items.forEach(group => {\n group.items.forEach(mark => draw(context, mark.items, interior));\n });\n } else {\n Marks[type].draw(context, {\n items: interior ? items.map(prepare) : items\n });\n }\n}\n\n/**\n * Prepare item before drawing into canvas (setting stroke and opacity)\n * @param {object} source item to be prepared\n * @returns prepared item\n */\nfunction prepare(source) {\n const item = rederive(source, {});\n if (item.stroke && item.strokeOpacity !== 0 || item.fill && item.fillOpacity !== 0) {\n return {\n ...item,\n strokeOpacity: 1,\n stroke: '#000',\n fillOpacity: 0\n };\n }\n return item;\n}\n\nconst DIV = 5,\n // bit shift from x, y index to bit vector array index\n MOD = 31,\n // bit mask for index lookup within a bit vector\n SIZE = 32,\n // individual bit vector size\n RIGHT0 = new Uint32Array(SIZE + 1),\n // left-anchored bit vectors, full -> 0\n RIGHT1 = new Uint32Array(SIZE + 1); // right-anchored bit vectors, 0 -> full\n\nRIGHT1[0] = 0;\nRIGHT0[0] = ~RIGHT1[0];\nfor (let i = 1; i <= SIZE; ++i) {\n RIGHT1[i] = RIGHT1[i - 1] << 1 | 1;\n RIGHT0[i] = ~RIGHT1[i];\n}\nfunction Bitmap (w, h) {\n const array = new Uint32Array(~~((w * h + SIZE) / SIZE));\n function _set(index, mask) {\n array[index] |= mask;\n }\n function _clear(index, mask) {\n array[index] &= mask;\n }\n return {\n array: array,\n get: (x, y) => {\n const index = y * w + x;\n return array[index >>> DIV] & 1 << (index & MOD);\n },\n set: (x, y) => {\n const index = y * w + x;\n _set(index >>> DIV, 1 << (index & MOD));\n },\n clear: (x, y) => {\n const index = y * w + x;\n _clear(index >>> DIV, ~(1 << (index & MOD)));\n },\n getRange: (x, y, x2, y2) => {\n let r = y2,\n start,\n end,\n indexStart,\n indexEnd;\n for (; r >= y; --r) {\n start = r * w + x;\n end = r * w + x2;\n indexStart = start >>> DIV;\n indexEnd = end >>> DIV;\n if (indexStart === indexEnd) {\n if (array[indexStart] & RIGHT0[start & MOD] & RIGHT1[(end & MOD) + 1]) {\n return true;\n }\n } else {\n if (array[indexStart] & RIGHT0[start & MOD]) return true;\n if (array[indexEnd] & RIGHT1[(end & MOD) + 1]) return true;\n for (let i = indexStart + 1; i < indexEnd; ++i) {\n if (array[i]) return true;\n }\n }\n }\n return false;\n },\n setRange: (x, y, x2, y2) => {\n let start, end, indexStart, indexEnd, i;\n for (; y <= y2; ++y) {\n start = y * w + x;\n end = y * w + x2;\n indexStart = start >>> DIV;\n indexEnd = end >>> DIV;\n if (indexStart === indexEnd) {\n _set(indexStart, RIGHT0[start & MOD] & RIGHT1[(end & MOD) + 1]);\n } else {\n _set(indexStart, RIGHT0[start & MOD]);\n _set(indexEnd, RIGHT1[(end & MOD) + 1]);\n for (i = indexStart + 1; i < indexEnd; ++i) _set(i, 0xffffffff);\n }\n }\n },\n clearRange: (x, y, x2, y2) => {\n let start, end, indexStart, indexEnd, i;\n for (; y <= y2; ++y) {\n start = y * w + x;\n end = y * w + x2;\n indexStart = start >>> DIV;\n indexEnd = end >>> DIV;\n if (indexStart === indexEnd) {\n _clear(indexStart, RIGHT1[start & MOD] | RIGHT0[(end & MOD) + 1]);\n } else {\n _clear(indexStart, RIGHT1[start & MOD]);\n _clear(indexEnd, RIGHT0[(end & MOD) + 1]);\n for (i = indexStart + 1; i < indexEnd; ++i) _clear(i, 0);\n }\n }\n },\n outOfBounds: (x, y, x2, y2) => x < 0 || y < 0 || y2 >= h || x2 >= w\n };\n}\n\nfunction scaler (width, height, padding) {\n const ratio = Math.max(1, Math.sqrt(width * height / 1e6)),\n w = ~~((width + 2 * padding + ratio) / ratio),\n h = ~~((height + 2 * padding + ratio) / ratio),\n scale = _ => ~~((_ + padding) / ratio);\n scale.invert = _ => _ * ratio - padding;\n scale.bitmap = () => Bitmap(w, h);\n scale.ratio = ratio;\n scale.padding = padding;\n scale.width = width;\n scale.height = height;\n return scale;\n}\n\nfunction placeAreaLabelNaive ($, bitmaps, avoidBaseMark, markIndex) {\n const width = $.width,\n height = $.height;\n\n // try to place a label within an input area mark\n return function (d) {\n const items = d.datum.datum.items[markIndex].items,\n // area points\n n = items.length,\n // number of points\n textHeight = d.datum.fontSize,\n // label width\n textWidth = textMetrics.width(d.datum, d.datum.text); // label height\n\n let maxAreaWidth = 0,\n x1,\n x2,\n y1,\n y2,\n x,\n y,\n areaWidth;\n\n // for each area sample point\n for (let i = 0; i < n; ++i) {\n x1 = items[i].x;\n y1 = items[i].y;\n x2 = items[i].x2 === undefined ? x1 : items[i].x2;\n y2 = items[i].y2 === undefined ? y1 : items[i].y2;\n x = (x1 + x2) / 2;\n y = (y1 + y2) / 2;\n areaWidth = Math.abs(x2 - x1 + y2 - y1);\n if (areaWidth >= maxAreaWidth) {\n maxAreaWidth = areaWidth;\n d.x = x;\n d.y = y;\n }\n }\n x = textWidth / 2;\n y = textHeight / 2;\n x1 = d.x - x;\n x2 = d.x + x;\n y1 = d.y - y;\n y2 = d.y + y;\n d.align = 'center';\n if (x1 < 0 && x2 <= width) {\n d.align = 'left';\n } else if (0 <= x1 && width < x2) {\n d.align = 'right';\n }\n d.baseline = 'middle';\n if (y1 < 0 && y2 <= height) {\n d.baseline = 'top';\n } else if (0 <= y1 && height < y2) {\n d.baseline = 'bottom';\n }\n return true;\n };\n}\n\nfunction outOfBounds(x, y, textWidth, textHeight, width, height) {\n let r = textWidth / 2;\n return x - r < 0 || x + r > width || y - (r = textHeight / 2) < 0 || y + r > height;\n}\nfunction collision($, x, y, textHeight, textWidth, h, bm0, bm1) {\n const w = textWidth * h / (textHeight * 2),\n x1 = $(x - w),\n x2 = $(x + w),\n y1 = $(y - (h = h / 2)),\n y2 = $(y + h);\n return bm0.outOfBounds(x1, y1, x2, y2) || bm0.getRange(x1, y1, x2, y2) || bm1 && bm1.getRange(x1, y1, x2, y2);\n}\n\nfunction placeAreaLabelReducedSearch ($, bitmaps, avoidBaseMark, markIndex) {\n const width = $.width,\n height = $.height,\n bm0 = bitmaps[0],\n // where labels have been placed\n bm1 = bitmaps[1]; // area outlines\n\n function tryLabel(_x, _y, maxSize, textWidth, textHeight) {\n const x = $.invert(_x),\n y = $.invert(_y);\n let lo = maxSize,\n hi = height,\n mid;\n if (!outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, lo, bm0, bm1) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n // if the label fits at the current sample point,\n // perform binary search to find the largest font size that fits\n while (hi - lo >= 1) {\n mid = (lo + hi) / 2;\n if (collision($, x, y, textHeight, textWidth, mid, bm0, bm1)) {\n hi = mid;\n } else {\n lo = mid;\n }\n }\n // place label if current lower bound exceeds prior max font size\n if (lo > maxSize) {\n return [x, y, lo, true];\n }\n }\n }\n\n // try to place a label within an input area mark\n return function (d) {\n const items = d.datum.datum.items[markIndex].items,\n // area points\n n = items.length,\n // number of points\n textHeight = d.datum.fontSize,\n // label width\n textWidth = textMetrics.width(d.datum, d.datum.text); // label height\n\n let maxSize = avoidBaseMark ? textHeight : 0,\n labelPlaced = false,\n labelPlaced2 = false,\n maxAreaWidth = 0,\n x1,\n x2,\n y1,\n y2,\n x,\n y,\n _x,\n _y,\n _x1,\n _xMid,\n _x2,\n _y1,\n _yMid,\n _y2,\n areaWidth,\n result,\n swapTmp;\n\n // for each area sample point\n for (let i = 0; i < n; ++i) {\n x1 = items[i].x;\n y1 = items[i].y;\n x2 = items[i].x2 === undefined ? x1 : items[i].x2;\n y2 = items[i].y2 === undefined ? y1 : items[i].y2;\n if (x1 > x2) {\n swapTmp = x1;\n x1 = x2;\n x2 = swapTmp;\n }\n if (y1 > y2) {\n swapTmp = y1;\n y1 = y2;\n y2 = swapTmp;\n }\n _x1 = $(x1);\n _x2 = $(x2);\n _xMid = ~~((_x1 + _x2) / 2);\n _y1 = $(y1);\n _y2 = $(y2);\n _yMid = ~~((_y1 + _y2) / 2);\n\n // search along the line from mid point between the 2 border to lower border\n for (_x = _xMid; _x >= _x1; --_x) {\n for (_y = _yMid; _y >= _y1; --_y) {\n result = tryLabel(_x, _y, maxSize, textWidth, textHeight);\n if (result) {\n [d.x, d.y, maxSize, labelPlaced] = result;\n }\n }\n }\n\n // search along the line from mid point between the 2 border to upper border\n for (_x = _xMid; _x <= _x2; ++_x) {\n for (_y = _yMid; _y <= _y2; ++_y) {\n result = tryLabel(_x, _y, maxSize, textWidth, textHeight);\n if (result) {\n [d.x, d.y, maxSize, labelPlaced] = result;\n }\n }\n }\n\n // place label at slice center if not placed through other means\n // and if we're not avoiding overlap with other areas\n if (!labelPlaced && !avoidBaseMark) {\n // one span is zero, hence we can add\n areaWidth = Math.abs(x2 - x1 + y2 - y1);\n x = (x1 + x2) / 2;\n y = (y1 + y2) / 2;\n\n // place label if it fits and improves the max area width\n if (areaWidth >= maxAreaWidth && !outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n maxAreaWidth = areaWidth;\n d.x = x;\n d.y = y;\n labelPlaced2 = true;\n }\n }\n }\n\n // record current label placement information, update label bitmap\n if (labelPlaced || labelPlaced2) {\n x = textWidth / 2;\n y = textHeight / 2;\n bm0.setRange($(d.x - x), $(d.y - y), $(d.x + x), $(d.y + y));\n d.align = 'center';\n d.baseline = 'middle';\n return true;\n } else {\n return false;\n }\n };\n}\n\n// pixel direction offsets for flood fill search\nconst X_DIR = [-1, -1, 1, 1];\nconst Y_DIR = [-1, 1, -1, 1];\nfunction placeAreaLabelFloodFill ($, bitmaps, avoidBaseMark, markIndex) {\n const width = $.width,\n height = $.height,\n bm0 = bitmaps[0],\n // where labels have been placed\n bm1 = bitmaps[1],\n // area outlines\n bm2 = $.bitmap(); // flood-fill visitations\n\n // try to place a label within an input area mark\n return function (d) {\n const items = d.datum.datum.items[markIndex].items,\n // area points\n n = items.length,\n // number of points\n textHeight = d.datum.fontSize,\n // label width\n textWidth = textMetrics.width(d.datum, d.datum.text),\n // label height\n stack = []; // flood fill stack\n\n let maxSize = avoidBaseMark ? textHeight : 0,\n labelPlaced = false,\n labelPlaced2 = false,\n maxAreaWidth = 0,\n x1,\n x2,\n y1,\n y2,\n x,\n y,\n _x,\n _y,\n lo,\n hi,\n mid,\n areaWidth;\n\n // for each area sample point\n for (let i = 0; i < n; ++i) {\n x1 = items[i].x;\n y1 = items[i].y;\n x2 = items[i].x2 === undefined ? x1 : items[i].x2;\n y2 = items[i].y2 === undefined ? y1 : items[i].y2;\n\n // add scaled center point to stack\n stack.push([$((x1 + x2) / 2), $((y1 + y2) / 2)]);\n\n // perform flood fill, visit points\n while (stack.length) {\n [_x, _y] = stack.pop();\n\n // exit if point already marked\n if (bm0.get(_x, _y) || bm1.get(_x, _y) || bm2.get(_x, _y)) continue;\n\n // mark point in flood fill bitmap\n // add search points for all (in bound) directions\n bm2.set(_x, _y);\n for (let j = 0; j < 4; ++j) {\n x = _x + X_DIR[j];\n y = _y + Y_DIR[j];\n if (!bm2.outOfBounds(x, y, x, y)) stack.push([x, y]);\n }\n\n // unscale point back to x, y space\n x = $.invert(_x);\n y = $.invert(_y);\n lo = maxSize;\n hi = height; // TODO: make this bound smaller\n\n if (!outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, lo, bm0, bm1) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n // if the label fits at the current sample point,\n // perform binary search to find the largest font size that fits\n while (hi - lo >= 1) {\n mid = (lo + hi) / 2;\n if (collision($, x, y, textHeight, textWidth, mid, bm0, bm1)) {\n hi = mid;\n } else {\n lo = mid;\n }\n }\n // place label if current lower bound exceeds prior max font size\n if (lo > maxSize) {\n d.x = x;\n d.y = y;\n maxSize = lo;\n labelPlaced = true;\n }\n }\n }\n\n // place label at slice center if not placed through other means\n // and if we're not avoiding overlap with other areas\n if (!labelPlaced && !avoidBaseMark) {\n // one span is zero, hence we can add\n areaWidth = Math.abs(x2 - x1 + y2 - y1);\n x = (x1 + x2) / 2;\n y = (y1 + y2) / 2;\n\n // place label if it fits and improves the max area width\n if (areaWidth >= maxAreaWidth && !outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n maxAreaWidth = areaWidth;\n d.x = x;\n d.y = y;\n labelPlaced2 = true;\n }\n }\n }\n\n // record current label placement information, update label bitmap\n if (labelPlaced || labelPlaced2) {\n x = textWidth / 2;\n y = textHeight / 2;\n bm0.setRange($(d.x - x), $(d.y - y), $(d.x + x), $(d.y + y));\n d.align = 'center';\n d.baseline = 'middle';\n return true;\n } else {\n return false;\n }\n };\n}\n\nconst Aligns = ['right', 'center', 'left'],\n Baselines = ['bottom', 'middle', 'top'];\nfunction placeMarkLabel ($, bitmaps, anchors, offsets) {\n const width = $.width,\n height = $.height,\n bm0 = bitmaps[0],\n bm1 = bitmaps[1],\n n = offsets.length;\n return function (d) {\n const boundary = d.boundary,\n textHeight = d.datum.fontSize;\n\n // can not be placed if the mark is not visible in the graph bound\n if (boundary[2] < 0 || boundary[5] < 0 || boundary[0] > width || boundary[3] > height) {\n return false;\n }\n let textWidth = d.textWidth ?? 0,\n dx,\n dy,\n isInside,\n sizeFactor,\n insideFactor,\n x1,\n x2,\n y1,\n y2,\n xc,\n yc,\n _x1,\n _x2,\n _y1,\n _y2;\n\n // for each anchor and offset\n for (let i = 0; i < n; ++i) {\n dx = (anchors[i] & 0x3) - 1;\n dy = (anchors[i] >>> 0x2 & 0x3) - 1;\n isInside = dx === 0 && dy === 0 || offsets[i] < 0;\n sizeFactor = dx && dy ? Math.SQRT1_2 : 1;\n insideFactor = offsets[i] < 0 ? -1 : 1;\n x1 = boundary[1 + dx] + offsets[i] * dx * sizeFactor;\n yc = boundary[4 + dy] + insideFactor * textHeight * dy / 2 + offsets[i] * dy * sizeFactor;\n y1 = yc - textHeight / 2;\n y2 = yc + textHeight / 2;\n _x1 = $(x1);\n _y1 = $(y1);\n _y2 = $(y2);\n if (!textWidth) {\n // to avoid finding width of text label,\n if (!test(_x1, _x1, _y1, _y2, bm0, bm1, x1, x1, y1, y2, boundary, isInside)) {\n // skip this anchor/offset option if we fail to place a label with 1px width\n continue;\n } else {\n // Otherwise, find the label width\n textWidth = textMetrics.width(d.datum, d.datum.text);\n }\n }\n xc = x1 + insideFactor * textWidth * dx / 2;\n x1 = xc - textWidth / 2;\n x2 = xc + textWidth / 2;\n _x1 = $(x1);\n _x2 = $(x2);\n if (test(_x1, _x2, _y1, _y2, bm0, bm1, x1, x2, y1, y2, boundary, isInside)) {\n // place label if the position is placeable\n d.x = !dx ? xc : dx * insideFactor < 0 ? x2 : x1;\n d.y = !dy ? yc : dy * insideFactor < 0 ? y2 : y1;\n d.align = Aligns[dx * insideFactor + 1];\n d.baseline = Baselines[dy * insideFactor + 1];\n bm0.setRange(_x1, _y1, _x2, _y2);\n return true;\n }\n }\n return false;\n };\n}\n\n// Test if a label with the given dimensions can be added without overlap\nfunction test(_x1, _x2, _y1, _y2, bm0, bm1, x1, x2, y1, y2, boundary, isInside) {\n return !(bm0.outOfBounds(_x1, _y1, _x2, _y2) || (isInside && bm1 || bm0).getRange(_x1, _y1, _x2, _y2));\n}\n\n// 8-bit representation of anchors\nconst TOP = 0x0,\n MIDDLE = 0x4,\n BOTTOM = 0x8,\n LEFT = 0x0,\n CENTER = 0x1,\n RIGHT = 0x2;\n\n// Mapping from text anchor to number representation\nconst anchorCode = {\n 'top-left': TOP + LEFT,\n 'top': TOP + CENTER,\n 'top-right': TOP + RIGHT,\n 'left': MIDDLE + LEFT,\n 'middle': MIDDLE + CENTER,\n 'right': MIDDLE + RIGHT,\n 'bottom-left': BOTTOM + LEFT,\n 'bottom': BOTTOM + CENTER,\n 'bottom-right': BOTTOM + RIGHT\n};\nconst placeAreaLabel = {\n 'naive': placeAreaLabelNaive,\n 'reduced-search': placeAreaLabelReducedSearch,\n 'floodfill': placeAreaLabelFloodFill\n};\nfunction labelLayout (texts, size, compare, offset, anchor, avoidMarks, avoidBaseMark, lineAnchor, markIndex, padding, method) {\n // early exit for empty data\n if (!texts.length) return texts;\n const positions = Math.max(offset.length, anchor.length),\n offsets = getOffsets(offset, positions),\n anchors = getAnchors(anchor, positions),\n marktype = markType(texts[0].datum),\n grouptype = marktype === 'group' && texts[0].datum.items[markIndex].marktype,\n isGroupArea = grouptype === 'area',\n boundary = markBoundary(marktype, grouptype, lineAnchor, markIndex),\n infPadding = padding === null || padding === Infinity,\n isNaiveGroupArea = isGroupArea && method === 'naive';\n let maxTextWidth = -1,\n maxTextHeight = -1;\n\n // prepare text mark data for placing\n const data = texts.map(d => {\n const textWidth = infPadding ? textMetrics.width(d, d.text) : undefined;\n maxTextWidth = Math.max(maxTextWidth, textWidth);\n maxTextHeight = Math.max(maxTextHeight, d.fontSize);\n return {\n datum: d,\n opacity: 0,\n x: undefined,\n y: undefined,\n align: undefined,\n baseline: undefined,\n boundary: boundary(d),\n textWidth\n };\n });\n padding = padding === null || padding === Infinity ? Math.max(maxTextWidth, maxTextHeight) + Math.max(...offset) : padding;\n const $ = scaler(size[0], size[1], padding);\n let bitmaps;\n if (!isNaiveGroupArea) {\n // sort labels in priority order, if comparator is provided\n if (compare) {\n data.sort((a, b) => compare(a.datum, b.datum));\n }\n\n // flag indicating if label can be placed inside its base mark\n let labelInside = false;\n for (let i = 0; i < anchors.length && !labelInside; ++i) {\n // label inside if anchor is at center\n // label inside if offset to be inside the mark bound\n labelInside = anchors[i] === 0x5 || offsets[i] < 0;\n }\n\n // extract data information from base mark when base mark is to be avoided\n // base mark is implicitly avoided if it is a group area\n const baseMark = (marktype && avoidBaseMark || isGroupArea) && texts.map(d => d.datum);\n\n // generate bitmaps for layout calculation\n bitmaps = avoidMarks.length || baseMark ? markBitmaps($, baseMark || [], avoidMarks, labelInside, isGroupArea) : baseBitmaps($, avoidBaseMark && data);\n }\n\n // generate label placement function\n const place = isGroupArea ? placeAreaLabel[method]($, bitmaps, avoidBaseMark, markIndex) : placeMarkLabel($, bitmaps, anchors, offsets);\n\n // place all labels\n data.forEach(d => d.opacity = +place(d));\n return data;\n}\nfunction getOffsets(_, count) {\n const offsets = new Float64Array(count),\n n = _.length;\n for (let i = 0; i < n; ++i) offsets[i] = _[i] || 0;\n for (let i = n; i < count; ++i) offsets[i] = offsets[n - 1];\n return offsets;\n}\nfunction getAnchors(_, count) {\n const anchors = new Int8Array(count),\n n = _.length;\n for (let i = 0; i < n; ++i) anchors[i] |= anchorCode[_[i]];\n for (let i = n; i < count; ++i) anchors[i] = anchors[n - 1];\n return anchors;\n}\nfunction markType(item) {\n return item && item.mark && item.mark.marktype;\n}\n\n/**\n * Factory function for function for getting base mark boundary, depending\n * on mark and group type. When mark type is undefined, line or area: boundary\n * is the coordinate of each data point. When base mark is grouped line,\n * boundary is either at the start or end of the line depending on the\n * value of lineAnchor. Otherwise, use bounds of base mark.\n */\nfunction markBoundary(marktype, grouptype, lineAnchor, markIndex) {\n const xy = d => [d.x, d.x, d.x, d.y, d.y, d.y];\n if (!marktype) {\n return xy; // no reactive geometry\n } else if (marktype === 'line' || marktype === 'area') {\n return d => xy(d.datum);\n } else if (grouptype === 'line') {\n return d => {\n const items = d.datum.items[markIndex].items;\n return xy(items.length ? items[lineAnchor === 'start' ? 0 : items.length - 1] : {\n x: NaN,\n y: NaN\n });\n };\n } else {\n return d => {\n const b = d.datum.bounds;\n return [b.x1, (b.x1 + b.x2) / 2, b.x2, b.y1, (b.y1 + b.y2) / 2, b.y2];\n };\n }\n}\n\nconst Output = ['x', 'y', 'opacity', 'align', 'baseline'];\nconst Anchors = ['top-left', 'left', 'bottom-left', 'top', 'bottom', 'top-right', 'right', 'bottom-right'];\n\n/**\n * Compute text label layout to annotate marks.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.size - The size of the layout, provided as a [width, height] array.\n * @param {function(*,*): number} [params.sort] - An optional\n * comparator function for sorting label data in priority order.\n * @param {Array} [params.anchor] - Label anchor points relative to the base mark bounding box.\n * The available options are 'top-left', 'left', 'bottom-left', 'top',\n * 'bottom', 'top-right', 'right', 'bottom-right', 'middle'.\n * @param {Array} [params.offset] - Label offsets (in pixels) from the base mark bounding box.\n * This parameter is parallel to the list of anchor points.\n * @param {number | null} [params.padding=0] - The amount (in pixels) that a label may exceed the layout size.\n * If this parameter is null, a label may exceed the layout size without any boundary.\n * @param {string} [params.lineAnchor='end'] - For group line mark labels only, indicates the anchor\n * position for labels. One of 'start' or 'end'.\n * @param {string} [params.markIndex=0] - For group mark labels only, an index indicating\n * which mark within the group should be labeled.\n * @param {Array} [params.avoidMarks] - A list of additional mark names for which the label\n * layout should avoid overlap.\n * @param {boolean} [params.avoidBaseMark=true] - Boolean flag indicating if labels should avoid\n * overlap with the underlying base mark being labeled.\n * @param {string} [params.method='naive'] - For area make labels only, a method for\n * place labels. One of 'naive', 'reduced-search', or 'floodfill'.\n * @param {Array} [params.as] - The output fields written by the transform.\n * The default is ['x', 'y', 'opacity', 'align', 'baseline'].\n */\nfunction Label(params) {\n Transform.call(this, null, params);\n}\nLabel.Definition = {\n type: 'Label',\n metadata: {\n modifies: true\n },\n params: [{\n name: 'size',\n type: 'number',\n array: true,\n length: 2,\n required: true\n }, {\n name: 'sort',\n type: 'compare'\n }, {\n name: 'anchor',\n type: 'string',\n array: true,\n default: Anchors\n }, {\n name: 'offset',\n type: 'number',\n array: true,\n default: [1]\n }, {\n name: 'padding',\n type: 'number',\n default: 0,\n null: true\n }, {\n name: 'lineAnchor',\n type: 'string',\n values: ['start', 'end'],\n default: 'end'\n }, {\n name: 'markIndex',\n type: 'number',\n default: 0\n }, {\n name: 'avoidBaseMark',\n type: 'boolean',\n default: true\n }, {\n name: 'avoidMarks',\n type: 'data',\n array: true\n }, {\n name: 'method',\n type: 'string',\n default: 'naive'\n }, {\n name: 'as',\n type: 'string',\n array: true,\n length: Output.length,\n default: Output\n }]\n};\ninherits(Label, Transform, {\n transform(_, pulse) {\n function modp(param) {\n const p = _[param];\n return isFunction(p) && pulse.modified(p.fields);\n }\n const mod = _.modified();\n if (!(mod || pulse.changed(pulse.ADD_REM) || modp('sort'))) return;\n if (!_.size || _.size.length !== 2) {\n error('Size parameter should be specified as a [width, height] array.');\n }\n const as = _.as || Output;\n\n // run label layout\n labelLayout(pulse.materialize(pulse.SOURCE).source || [], _.size, _.sort, array(_.offset == null ? 1 : _.offset), array(_.anchor || Anchors), _.avoidMarks || [], _.avoidBaseMark !== false, _.lineAnchor || 'end', _.markIndex || 0, _.padding === undefined ? 0 : _.padding, _.method || 'naive').forEach(l => {\n // write layout results to data stream\n const t = l.datum;\n t[as[0]] = l.x;\n t[as[1]] = l.y;\n t[as[2]] = l.opacity;\n t[as[3]] = l.align;\n t[as[4]] = l.baseline;\n });\n return pulse.reflow(mod).modifies(as);\n }\n});\n\nexport { Label as label };\n","import { regressionLoess, sampleCurve, regressionConstant, regressionLinear, regressionLog, regressionExp, regressionPow, regressionQuad, regressionPoly } from 'vega-statistics';\nimport { Transform, ingest } from 'vega-dataflow';\nimport { inherits, accessorName, hasOwnProperty, error, extent } from 'vega-util';\n\nfunction partition (data, groupby) {\n var groups = [],\n get = function (f) {\n return f(t);\n },\n map,\n i,\n n,\n t,\n k,\n g;\n\n // partition data points into stack groups\n if (groupby == null) {\n groups.push(data);\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n if (!g) {\n map[k] = g = [];\n g.dims = k;\n groups.push(g);\n }\n g.push(t);\n }\n }\n return groups;\n}\n\n/**\n * Compute locally-weighted regression fits for one or more data groups.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.x - An accessor for the predictor data field.\n * @param {function(object): *} params.y - An accessor for the predicted data field.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {number} [params.bandwidth=0.3] - The loess bandwidth.\n */\nfunction Loess(params) {\n Transform.call(this, null, params);\n}\nLoess.Definition = {\n 'type': 'Loess',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'default': 0.3\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }]\n};\ninherits(Loess, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n if (!this.value || pulse.changed() || _.modified()) {\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition(source, _.groupby),\n names = (_.groupby || []).map(accessorName),\n m = names.length,\n as = _.as || [accessorName(_.x), accessorName(_.y)],\n values = [];\n groups.forEach(g => {\n regressionLoess(g, _.x, _.y, _.bandwidth || 0.3).forEach(p => {\n const t = {};\n for (let i = 0; i < m; ++i) {\n t[names[i]] = g.dims[i];\n }\n t[as[0]] = p[0];\n t[as[1]] = p[1];\n values.push(ingest(t));\n });\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n return out;\n }\n});\n\nconst Methods = {\n constant: regressionConstant,\n linear: regressionLinear,\n log: regressionLog,\n exp: regressionExp,\n pow: regressionPow,\n quad: regressionQuad,\n poly: regressionPoly\n};\nconst degreesOfFreedom = (method, order) => method === 'poly' ? order : method === 'quad' ? 2 : 1;\n\n/**\n * Compute regression fits for one or more data groups.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.x - An accessor for the predictor data field.\n * @param {function(object): *} params.y - An accessor for the predicted data field.\n * @param {string} [params.method='linear'] - The regression method to apply.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {Array} [params.extent] - The domain extent over which to plot the regression line.\n * @param {number} [params.order=3] - The polynomial order. Only applies to the 'poly' method.\n */\nfunction Regression(params) {\n Transform.call(this, null, params);\n}\nRegression.Definition = {\n 'type': 'Regression',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'method',\n 'type': 'string',\n 'default': 'linear',\n 'values': Object.keys(Methods)\n }, {\n 'name': 'order',\n 'type': 'number',\n 'default': 3\n }, {\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'params',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }]\n};\ninherits(Regression, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n if (!this.value || pulse.changed() || _.modified()) {\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition(source, _.groupby),\n names = (_.groupby || []).map(accessorName),\n method = _.method || 'linear',\n order = _.order == null ? 3 : _.order,\n dof = degreesOfFreedom(method, order),\n as = _.as || [accessorName(_.x), accessorName(_.y)],\n fit = Methods[method],\n values = [];\n let domain = _.extent;\n if (!hasOwnProperty(Methods, method)) {\n error('Invalid regression method: ' + method);\n }\n if (domain != null) {\n if (method === 'log' && domain[0] <= 0) {\n pulse.dataflow.warn('Ignoring extent with values <= 0 for log regression.');\n domain = null;\n }\n }\n groups.forEach(g => {\n const n = g.length;\n if (n <= dof) {\n pulse.dataflow.warn('Skipping regression with more parameters than data points.');\n return;\n }\n const model = fit(g, _.x, _.y, order);\n if (_.params) {\n // if parameter vectors requested return those\n values.push(ingest({\n keys: g.dims,\n coef: model.coef,\n rSquared: model.rSquared\n }));\n return;\n }\n const dom = domain || extent(g, _.x),\n add = p => {\n const t = {};\n for (let i = 0; i < names.length; ++i) {\n t[names[i]] = g.dims[i];\n }\n t[as[0]] = p[0];\n t[as[1]] = p[1];\n values.push(ingest(t));\n };\n if (method === 'linear' || method === 'constant') {\n // for linear or constant regression we only need the end points\n dom.forEach(x => add([x, model.predict(x)]));\n } else {\n // otherwise return trend line sample points\n sampleCurve(model.predict, dom, 25, 200).forEach(add);\n }\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n return out;\n }\n});\n\nexport { Loess as loess, Regression as regression };\n","export const epsilon = 1.1102230246251565e-16;\nexport const splitter = 134217729;\nexport const resulterrbound = (3 + 8 * epsilon) * epsilon;\n\n// fast_expansion_sum_zeroelim routine from oritinal code\nexport function sum(elen, e, flen, f, h) {\n let Q, Qnew, hh, bvirt;\n let enow = e[0];\n let fnow = f[0];\n let eindex = 0;\n let findex = 0;\n if ((fnow > enow) === (fnow > -enow)) {\n Q = enow;\n enow = e[++eindex];\n } else {\n Q = fnow;\n fnow = f[++findex];\n }\n let hindex = 0;\n if (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = enow + Q;\n hh = Q - (Qnew - enow);\n enow = e[++eindex];\n } else {\n Qnew = fnow + Q;\n hh = Q - (Qnew - fnow);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n while (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n } else {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n }\n while (eindex < elen) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n while (findex < flen) {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nexport function sum_three(alen, a, blen, b, clen, c, tmp, out) {\n return sum(sum(alen, a, blen, b, tmp), tmp, clen, c, out);\n}\n\n// scale_expansion_zeroelim routine from oritinal code\nexport function scale(elen, e, b, h) {\n let Q, sum, hh, product1, product0;\n let bvirt, c, ahi, alo, bhi, blo;\n\n c = splitter * b;\n bhi = c - (c - b);\n blo = b - bhi;\n let enow = e[0];\n Q = enow * b;\n c = splitter * enow;\n ahi = c - (c - enow);\n alo = enow - ahi;\n hh = alo * blo - (Q - ahi * bhi - alo * bhi - ahi * blo);\n let hindex = 0;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n for (let i = 1; i < elen; i++) {\n enow = e[i];\n product1 = enow * b;\n c = splitter * enow;\n ahi = c - (c - enow);\n alo = enow - ahi;\n product0 = alo * blo - (product1 - ahi * bhi - alo * bhi - ahi * blo);\n sum = Q + product0;\n bvirt = sum - Q;\n hh = Q - (sum - bvirt) + (product0 - bvirt);\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n Q = product1 + sum;\n hh = sum - (Q - product1);\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nexport function negate(elen, e) {\n for (let i = 0; i < elen; i++) e[i] = -e[i];\n return elen;\n}\n\nexport function estimate(elen, e) {\n let Q = e[0];\n for (let i = 1; i < elen; i++) Q += e[i];\n return Q;\n}\n\nexport function vec(n) {\n return new Float64Array(n);\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum} from './util.js';\n\nconst ccwerrboundA = (3 + 16 * epsilon) * epsilon;\nconst ccwerrboundB = (2 + 12 * epsilon) * epsilon;\nconst ccwerrboundC = (9 + 64 * epsilon) * epsilon * epsilon;\n\nconst B = vec(4);\nconst C1 = vec(8);\nconst C2 = vec(12);\nconst D = vec(16);\nconst u = vec(4);\n\nfunction orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {\n let acxtail, acytail, bcxtail, bcytail;\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n const acx = ax - cx;\n const bcx = bx - cx;\n const acy = ay - cy;\n const bcy = by - cy;\n\n s1 = acx * bcy;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcx;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n B[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n B[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n B[2] = _j - (u3 - bvirt) + (_i - bvirt);\n B[3] = u3;\n\n let det = estimate(4, B);\n let errbound = ccwerrboundB * detsum;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - acx;\n acxtail = ax - (acx + bvirt) + (bvirt - cx);\n bvirt = bx - bcx;\n bcxtail = bx - (bcx + bvirt) + (bvirt - cx);\n bvirt = ay - acy;\n acytail = ay - (acy + bvirt) + (bvirt - cy);\n bvirt = by - bcy;\n bcytail = by - (bcy + bvirt) + (bvirt - cy);\n\n if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) {\n return det;\n }\n\n errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det);\n det += (acx * bcytail + bcy * acxtail) - (acy * bcxtail + bcx * acytail);\n if (det >= errbound || -det >= errbound) return det;\n\n s1 = acxtail * bcy;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcx;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const C1len = sum(4, B, 4, u, C1);\n\n s1 = acx * bcytail;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcxtail;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const C2len = sum(C1len, C1, 4, u, C2);\n\n s1 = acxtail * bcytail;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcxtail;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const Dlen = sum(C2len, C2, 4, u, D);\n\n return D[Dlen - 1];\n}\n\nexport function orient2d(ax, ay, bx, by, cx, cy) {\n const detleft = (ay - cy) * (bx - cx);\n const detright = (ax - cx) * (by - cy);\n const det = detleft - detright;\n\n if (detleft === 0 || detright === 0 || (detleft > 0) !== (detright > 0)) return det;\n\n const detsum = Math.abs(detleft + detright);\n if (Math.abs(det) >= ccwerrboundA * detsum) return det;\n\n return -orient2dadapt(ax, ay, bx, by, cx, cy, detsum);\n}\n\nexport function orient2dfast(ax, ay, bx, by, cx, cy) {\n return (ay - cy) * (bx - cx) - (ax - cx) * (by - cy);\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum, scale} from './util.js';\n\nconst o3derrboundA = (7 + 56 * epsilon) * epsilon;\nconst o3derrboundB = (3 + 28 * epsilon) * epsilon;\nconst o3derrboundC = (26 + 288 * epsilon) * epsilon * epsilon;\n\nconst bc = vec(4);\nconst ca = vec(4);\nconst ab = vec(4);\nconst at_b = vec(4);\nconst at_c = vec(4);\nconst bt_c = vec(4);\nconst bt_a = vec(4);\nconst ct_a = vec(4);\nconst ct_b = vec(4);\nconst bct = vec(8);\nconst cat = vec(8);\nconst abt = vec(8);\nconst u = vec(4);\n\nconst _8 = vec(8);\nconst _8b = vec(8);\nconst _16 = vec(8);\nconst _12 = vec(12);\n\nlet fin = vec(192);\nlet fin2 = vec(192);\n\nfunction finadd(finlen, alen, a) {\n finlen = sum(finlen, fin, alen, a, fin2);\n const tmp = fin; fin = fin2; fin2 = tmp;\n return finlen;\n}\n\nfunction tailinit(xtail, ytail, ax, ay, bx, by, a, b) {\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _k, _0, s1, s0, t1, t0, u3, negate;\n if (xtail === 0) {\n if (ytail === 0) {\n a[0] = 0;\n b[0] = 0;\n return 1;\n } else {\n negate = -ytail;\n s1 = negate * ax;\n c = splitter * negate;\n ahi = c - (c - negate);\n alo = negate - ahi;\n c = splitter * ax;\n bhi = c - (c - ax);\n blo = ax - bhi;\n a[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n a[1] = s1;\n s1 = ytail * bx;\n c = splitter * ytail;\n ahi = c - (c - ytail);\n alo = ytail - ahi;\n c = splitter * bx;\n bhi = c - (c - bx);\n blo = bx - bhi;\n b[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n b[1] = s1;\n return 2;\n }\n } else {\n if (ytail === 0) {\n s1 = xtail * ay;\n c = splitter * xtail;\n ahi = c - (c - xtail);\n alo = xtail - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n a[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n a[1] = s1;\n negate = -xtail;\n s1 = negate * by;\n c = splitter * negate;\n ahi = c - (c - negate);\n alo = negate - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n b[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n b[1] = s1;\n return 2;\n } else {\n s1 = xtail * ay;\n c = splitter * xtail;\n ahi = c - (c - xtail);\n alo = xtail - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ytail * ax;\n c = splitter * ytail;\n ahi = c - (c - ytail);\n alo = ytail - ahi;\n c = splitter * ax;\n bhi = c - (c - ax);\n blo = ax - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n a[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n a[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n a[2] = _j - (u3 - bvirt) + (_i - bvirt);\n a[3] = u3;\n s1 = ytail * bx;\n c = splitter * ytail;\n ahi = c - (c - ytail);\n alo = ytail - ahi;\n c = splitter * bx;\n bhi = c - (c - bx);\n blo = bx - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = xtail * by;\n c = splitter * xtail;\n ahi = c - (c - xtail);\n alo = xtail - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n b[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n b[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n b[2] = _j - (u3 - bvirt) + (_i - bvirt);\n b[3] = u3;\n return 4;\n }\n }\n}\n\nfunction tailadd(finlen, a, b, k, z) {\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _k, _0, s1, s0, u3;\n s1 = a * b;\n c = splitter * a;\n ahi = c - (c - a);\n alo = a - ahi;\n c = splitter * b;\n bhi = c - (c - b);\n blo = b - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n c = splitter * k;\n bhi = c - (c - k);\n blo = k - bhi;\n _i = s0 * k;\n c = splitter * s0;\n ahi = c - (c - s0);\n alo = s0 - ahi;\n u[0] = alo * blo - (_i - ahi * bhi - alo * bhi - ahi * blo);\n _j = s1 * k;\n c = splitter * s1;\n ahi = c - (c - s1);\n alo = s1 - ahi;\n _0 = alo * blo - (_j - ahi * bhi - alo * bhi - ahi * blo);\n _k = _i + _0;\n bvirt = _k - _i;\n u[1] = _i - (_k - bvirt) + (_0 - bvirt);\n u3 = _j + _k;\n u[2] = _k - (u3 - _j);\n u[3] = u3;\n finlen = finadd(finlen, 4, u);\n if (z !== 0) {\n c = splitter * z;\n bhi = c - (c - z);\n blo = z - bhi;\n _i = s0 * z;\n c = splitter * s0;\n ahi = c - (c - s0);\n alo = s0 - ahi;\n u[0] = alo * blo - (_i - ahi * bhi - alo * bhi - ahi * blo);\n _j = s1 * z;\n c = splitter * s1;\n ahi = c - (c - s1);\n alo = s1 - ahi;\n _0 = alo * blo - (_j - ahi * bhi - alo * bhi - ahi * blo);\n _k = _i + _0;\n bvirt = _k - _i;\n u[1] = _i - (_k - bvirt) + (_0 - bvirt);\n u3 = _j + _k;\n u[2] = _k - (u3 - _j);\n u[3] = u3;\n finlen = finadd(finlen, 4, u);\n }\n return finlen;\n}\n\nfunction orient3dadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, permanent) {\n let finlen;\n let adxtail, bdxtail, cdxtail;\n let adytail, bdytail, cdytail;\n let adztail, bdztail, cdztail;\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _k, _0, s1, s0, t1, t0, u3;\n\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n const adz = az - dz;\n const bdz = bz - dz;\n const cdz = cz - dz;\n\n s1 = bdx * cdy;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdx * bdy;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bc[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bc[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bc[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bc[3] = u3;\n s1 = cdx * ady;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adx * cdy;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ca[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ca[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ca[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ca[3] = u3;\n s1 = adx * bdy;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdx * ady;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ab[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ab[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ab[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ab[3] = u3;\n\n finlen = sum(\n sum(\n scale(4, bc, adz, _8), _8,\n scale(4, ca, bdz, _8b), _8b, _16), _16,\n scale(4, ab, cdz, _8), _8, fin);\n\n let det = estimate(finlen, fin);\n let errbound = o3derrboundB * permanent;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - adx;\n adxtail = ax - (adx + bvirt) + (bvirt - dx);\n bvirt = bx - bdx;\n bdxtail = bx - (bdx + bvirt) + (bvirt - dx);\n bvirt = cx - cdx;\n cdxtail = cx - (cdx + bvirt) + (bvirt - dx);\n bvirt = ay - ady;\n adytail = ay - (ady + bvirt) + (bvirt - dy);\n bvirt = by - bdy;\n bdytail = by - (bdy + bvirt) + (bvirt - dy);\n bvirt = cy - cdy;\n cdytail = cy - (cdy + bvirt) + (bvirt - dy);\n bvirt = az - adz;\n adztail = az - (adz + bvirt) + (bvirt - dz);\n bvirt = bz - bdz;\n bdztail = bz - (bdz + bvirt) + (bvirt - dz);\n bvirt = cz - cdz;\n cdztail = cz - (cdz + bvirt) + (bvirt - dz);\n\n if (adxtail === 0 && bdxtail === 0 && cdxtail === 0 &&\n adytail === 0 && bdytail === 0 && cdytail === 0 &&\n adztail === 0 && bdztail === 0 && cdztail === 0) {\n return det;\n }\n\n errbound = o3derrboundC * permanent + resulterrbound * Math.abs(det);\n det +=\n adz * (bdx * cdytail + cdy * bdxtail - (bdy * cdxtail + cdx * bdytail)) + adztail * (bdx * cdy - bdy * cdx) +\n bdz * (cdx * adytail + ady * cdxtail - (cdy * adxtail + adx * cdytail)) + bdztail * (cdx * ady - cdy * adx) +\n cdz * (adx * bdytail + bdy * adxtail - (ady * bdxtail + bdx * adytail)) + cdztail * (adx * bdy - ady * bdx);\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n const at_len = tailinit(adxtail, adytail, bdx, bdy, cdx, cdy, at_b, at_c);\n const bt_len = tailinit(bdxtail, bdytail, cdx, cdy, adx, ady, bt_c, bt_a);\n const ct_len = tailinit(cdxtail, cdytail, adx, ady, bdx, bdy, ct_a, ct_b);\n\n const bctlen = sum(bt_len, bt_c, ct_len, ct_b, bct);\n finlen = finadd(finlen, scale(bctlen, bct, adz, _16), _16);\n\n const catlen = sum(ct_len, ct_a, at_len, at_c, cat);\n finlen = finadd(finlen, scale(catlen, cat, bdz, _16), _16);\n\n const abtlen = sum(at_len, at_b, bt_len, bt_a, abt);\n finlen = finadd(finlen, scale(abtlen, abt, cdz, _16), _16);\n\n if (adztail !== 0) {\n finlen = finadd(finlen, scale(4, bc, adztail, _12), _12);\n finlen = finadd(finlen, scale(bctlen, bct, adztail, _16), _16);\n }\n if (bdztail !== 0) {\n finlen = finadd(finlen, scale(4, ca, bdztail, _12), _12);\n finlen = finadd(finlen, scale(catlen, cat, bdztail, _16), _16);\n }\n if (cdztail !== 0) {\n finlen = finadd(finlen, scale(4, ab, cdztail, _12), _12);\n finlen = finadd(finlen, scale(abtlen, abt, cdztail, _16), _16);\n }\n\n if (adxtail !== 0) {\n if (bdytail !== 0) {\n finlen = tailadd(finlen, adxtail, bdytail, cdz, cdztail);\n }\n if (cdytail !== 0) {\n finlen = tailadd(finlen, -adxtail, cdytail, bdz, bdztail);\n }\n }\n if (bdxtail !== 0) {\n if (cdytail !== 0) {\n finlen = tailadd(finlen, bdxtail, cdytail, adz, adztail);\n }\n if (adytail !== 0) {\n finlen = tailadd(finlen, -bdxtail, adytail, cdz, cdztail);\n }\n }\n if (cdxtail !== 0) {\n if (adytail !== 0) {\n finlen = tailadd(finlen, cdxtail, adytail, bdz, bdztail);\n }\n if (bdytail !== 0) {\n finlen = tailadd(finlen, -cdxtail, bdytail, adz, adztail);\n }\n }\n\n return fin[finlen - 1];\n}\n\nexport function orient3d(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz) {\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n const adz = az - dz;\n const bdz = bz - dz;\n const cdz = cz - dz;\n\n const bdxcdy = bdx * cdy;\n const cdxbdy = cdx * bdy;\n\n const cdxady = cdx * ady;\n const adxcdy = adx * cdy;\n\n const adxbdy = adx * bdy;\n const bdxady = bdx * ady;\n\n const det =\n adz * (bdxcdy - cdxbdy) +\n bdz * (cdxady - adxcdy) +\n cdz * (adxbdy - bdxady);\n\n const permanent =\n (Math.abs(bdxcdy) + Math.abs(cdxbdy)) * Math.abs(adz) +\n (Math.abs(cdxady) + Math.abs(adxcdy)) * Math.abs(bdz) +\n (Math.abs(adxbdy) + Math.abs(bdxady)) * Math.abs(cdz);\n\n const errbound = o3derrboundA * permanent;\n if (det > errbound || -det > errbound) {\n return det;\n }\n\n return orient3dadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, permanent);\n}\n\nexport function orient3dfast(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz) {\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n const adz = az - dz;\n const bdz = bz - dz;\n const cdz = cz - dz;\n\n return adx * (bdy * cdz - bdz * cdy) +\n bdx * (cdy * adz - cdz * ady) +\n cdx * (ady * bdz - adz * bdy);\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum, sum_three, scale} from './util.js';\n\nconst iccerrboundA = (10 + 96 * epsilon) * epsilon;\nconst iccerrboundB = (4 + 48 * epsilon) * epsilon;\nconst iccerrboundC = (44 + 576 * epsilon) * epsilon * epsilon;\n\nconst bc = vec(4);\nconst ca = vec(4);\nconst ab = vec(4);\nconst aa = vec(4);\nconst bb = vec(4);\nconst cc = vec(4);\nconst u = vec(4);\nconst v = vec(4);\nconst axtbc = vec(8);\nconst aytbc = vec(8);\nconst bxtca = vec(8);\nconst bytca = vec(8);\nconst cxtab = vec(8);\nconst cytab = vec(8);\nconst abt = vec(8);\nconst bct = vec(8);\nconst cat = vec(8);\nconst abtt = vec(4);\nconst bctt = vec(4);\nconst catt = vec(4);\n\nconst _8 = vec(8);\nconst _16 = vec(16);\nconst _16b = vec(16);\nconst _16c = vec(16);\nconst _32 = vec(32);\nconst _32b = vec(32);\nconst _48 = vec(48);\nconst _64 = vec(64);\n\nlet fin = vec(1152);\nlet fin2 = vec(1152);\n\nfunction finadd(finlen, a, alen) {\n finlen = sum(finlen, fin, a, alen, fin2);\n const tmp = fin; fin = fin2; fin2 = tmp;\n return finlen;\n}\n\nfunction incircleadapt(ax, ay, bx, by, cx, cy, dx, dy, permanent) {\n let finlen;\n let adxtail, bdxtail, cdxtail, adytail, bdytail, cdytail;\n let axtbclen, aytbclen, bxtcalen, bytcalen, cxtablen, cytablen;\n let abtlen, bctlen, catlen;\n let abttlen, bcttlen, cattlen;\n let n1, n0;\n\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n\n s1 = bdx * cdy;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdx * bdy;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bc[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bc[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bc[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bc[3] = u3;\n s1 = cdx * ady;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adx * cdy;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ca[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ca[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ca[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ca[3] = u3;\n s1 = adx * bdy;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdx * ady;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ab[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ab[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ab[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ab[3] = u3;\n\n finlen = sum(\n sum(\n sum(\n scale(scale(4, bc, adx, _8), _8, adx, _16), _16,\n scale(scale(4, bc, ady, _8), _8, ady, _16b), _16b, _32), _32,\n sum(\n scale(scale(4, ca, bdx, _8), _8, bdx, _16), _16,\n scale(scale(4, ca, bdy, _8), _8, bdy, _16b), _16b, _32b), _32b, _64), _64,\n sum(\n scale(scale(4, ab, cdx, _8), _8, cdx, _16), _16,\n scale(scale(4, ab, cdy, _8), _8, cdy, _16b), _16b, _32), _32, fin);\n\n let det = estimate(finlen, fin);\n let errbound = iccerrboundB * permanent;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - adx;\n adxtail = ax - (adx + bvirt) + (bvirt - dx);\n bvirt = ay - ady;\n adytail = ay - (ady + bvirt) + (bvirt - dy);\n bvirt = bx - bdx;\n bdxtail = bx - (bdx + bvirt) + (bvirt - dx);\n bvirt = by - bdy;\n bdytail = by - (bdy + bvirt) + (bvirt - dy);\n bvirt = cx - cdx;\n cdxtail = cx - (cdx + bvirt) + (bvirt - dx);\n bvirt = cy - cdy;\n cdytail = cy - (cdy + bvirt) + (bvirt - dy);\n if (adxtail === 0 && bdxtail === 0 && cdxtail === 0 && adytail === 0 && bdytail === 0 && cdytail === 0) {\n return det;\n }\n\n errbound = iccerrboundC * permanent + resulterrbound * Math.abs(det);\n det += ((adx * adx + ady * ady) * ((bdx * cdytail + cdy * bdxtail) - (bdy * cdxtail + cdx * bdytail)) +\n 2 * (adx * adxtail + ady * adytail) * (bdx * cdy - bdy * cdx)) +\n ((bdx * bdx + bdy * bdy) * ((cdx * adytail + ady * cdxtail) - (cdy * adxtail + adx * cdytail)) +\n 2 * (bdx * bdxtail + bdy * bdytail) * (cdx * ady - cdy * adx)) +\n ((cdx * cdx + cdy * cdy) * ((adx * bdytail + bdy * adxtail) - (ady * bdxtail + bdx * adytail)) +\n 2 * (cdx * cdxtail + cdy * cdytail) * (adx * bdy - ady * bdx));\n\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n if (bdxtail !== 0 || bdytail !== 0 || cdxtail !== 0 || cdytail !== 0) {\n s1 = adx * adx;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n s0 = alo * alo - (s1 - ahi * ahi - (ahi + ahi) * alo);\n t1 = ady * ady;\n c = splitter * ady;\n ahi = c - (c - ady);\n alo = ady - ahi;\n t0 = alo * alo - (t1 - ahi * ahi - (ahi + ahi) * alo);\n _i = s0 + t0;\n bvirt = _i - s0;\n aa[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n aa[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n aa[2] = _j - (u3 - bvirt) + (_i - bvirt);\n aa[3] = u3;\n }\n if (cdxtail !== 0 || cdytail !== 0 || adxtail !== 0 || adytail !== 0) {\n s1 = bdx * bdx;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n s0 = alo * alo - (s1 - ahi * ahi - (ahi + ahi) * alo);\n t1 = bdy * bdy;\n c = splitter * bdy;\n ahi = c - (c - bdy);\n alo = bdy - ahi;\n t0 = alo * alo - (t1 - ahi * ahi - (ahi + ahi) * alo);\n _i = s0 + t0;\n bvirt = _i - s0;\n bb[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n bb[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bb[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bb[3] = u3;\n }\n if (adxtail !== 0 || adytail !== 0 || bdxtail !== 0 || bdytail !== 0) {\n s1 = cdx * cdx;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n s0 = alo * alo - (s1 - ahi * ahi - (ahi + ahi) * alo);\n t1 = cdy * cdy;\n c = splitter * cdy;\n ahi = c - (c - cdy);\n alo = cdy - ahi;\n t0 = alo * alo - (t1 - ahi * ahi - (ahi + ahi) * alo);\n _i = s0 + t0;\n bvirt = _i - s0;\n cc[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n cc[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n cc[2] = _j - (u3 - bvirt) + (_i - bvirt);\n cc[3] = u3;\n }\n\n if (adxtail !== 0) {\n axtbclen = scale(4, bc, adxtail, axtbc);\n finlen = finadd(finlen, sum_three(\n scale(axtbclen, axtbc, 2 * adx, _16), _16,\n scale(scale(4, cc, adxtail, _8), _8, bdy, _16b), _16b,\n scale(scale(4, bb, adxtail, _8), _8, -cdy, _16c), _16c, _32, _48), _48);\n }\n if (adytail !== 0) {\n aytbclen = scale(4, bc, adytail, aytbc);\n finlen = finadd(finlen, sum_three(\n scale(aytbclen, aytbc, 2 * ady, _16), _16,\n scale(scale(4, bb, adytail, _8), _8, cdx, _16b), _16b,\n scale(scale(4, cc, adytail, _8), _8, -bdx, _16c), _16c, _32, _48), _48);\n }\n if (bdxtail !== 0) {\n bxtcalen = scale(4, ca, bdxtail, bxtca);\n finlen = finadd(finlen, sum_three(\n scale(bxtcalen, bxtca, 2 * bdx, _16), _16,\n scale(scale(4, aa, bdxtail, _8), _8, cdy, _16b), _16b,\n scale(scale(4, cc, bdxtail, _8), _8, -ady, _16c), _16c, _32, _48), _48);\n }\n if (bdytail !== 0) {\n bytcalen = scale(4, ca, bdytail, bytca);\n finlen = finadd(finlen, sum_three(\n scale(bytcalen, bytca, 2 * bdy, _16), _16,\n scale(scale(4, cc, bdytail, _8), _8, adx, _16b), _16b,\n scale(scale(4, aa, bdytail, _8), _8, -cdx, _16c), _16c, _32, _48), _48);\n }\n if (cdxtail !== 0) {\n cxtablen = scale(4, ab, cdxtail, cxtab);\n finlen = finadd(finlen, sum_three(\n scale(cxtablen, cxtab, 2 * cdx, _16), _16,\n scale(scale(4, bb, cdxtail, _8), _8, ady, _16b), _16b,\n scale(scale(4, aa, cdxtail, _8), _8, -bdy, _16c), _16c, _32, _48), _48);\n }\n if (cdytail !== 0) {\n cytablen = scale(4, ab, cdytail, cytab);\n finlen = finadd(finlen, sum_three(\n scale(cytablen, cytab, 2 * cdy, _16), _16,\n scale(scale(4, aa, cdytail, _8), _8, bdx, _16b), _16b,\n scale(scale(4, bb, cdytail, _8), _8, -adx, _16c), _16c, _32, _48), _48);\n }\n\n if (adxtail !== 0 || adytail !== 0) {\n if (bdxtail !== 0 || bdytail !== 0 || cdxtail !== 0 || cdytail !== 0) {\n s1 = bdxtail * cdy;\n c = splitter * bdxtail;\n ahi = c - (c - bdxtail);\n alo = bdxtail - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdx * cdytail;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * cdytail;\n bhi = c - (c - cdytail);\n blo = cdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n u[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n u[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n s1 = cdxtail * -bdy;\n c = splitter * cdxtail;\n ahi = c - (c - cdxtail);\n alo = cdxtail - ahi;\n c = splitter * -bdy;\n bhi = c - (c - -bdy);\n blo = -bdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdx * -bdytail;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * -bdytail;\n bhi = c - (c - -bdytail);\n blo = -bdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n v[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n v[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n v[2] = _j - (u3 - bvirt) + (_i - bvirt);\n v[3] = u3;\n bctlen = sum(4, u, 4, v, bct);\n s1 = bdxtail * cdytail;\n c = splitter * bdxtail;\n ahi = c - (c - bdxtail);\n alo = bdxtail - ahi;\n c = splitter * cdytail;\n bhi = c - (c - cdytail);\n blo = cdytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdxtail * bdytail;\n c = splitter * cdxtail;\n ahi = c - (c - cdxtail);\n alo = cdxtail - ahi;\n c = splitter * bdytail;\n bhi = c - (c - bdytail);\n blo = bdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bctt[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bctt[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bctt[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bctt[3] = u3;\n bcttlen = 4;\n } else {\n bct[0] = 0;\n bctlen = 1;\n bctt[0] = 0;\n bcttlen = 1;\n }\n if (adxtail !== 0) {\n const len = scale(bctlen, bct, adxtail, _16c);\n finlen = finadd(finlen, sum(\n scale(axtbclen, axtbc, adxtail, _16), _16,\n scale(len, _16c, 2 * adx, _32), _32, _48), _48);\n\n const len2 = scale(bcttlen, bctt, adxtail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * adx, _16), _16,\n scale(len2, _8, adxtail, _16b), _16b,\n scale(len, _16c, adxtail, _32), _32, _32b, _64), _64);\n\n if (bdytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, cc, adxtail, _8), _8, bdytail, _16), _16);\n }\n if (cdytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, bb, -adxtail, _8), _8, cdytail, _16), _16);\n }\n }\n if (adytail !== 0) {\n const len = scale(bctlen, bct, adytail, _16c);\n finlen = finadd(finlen, sum(\n scale(aytbclen, aytbc, adytail, _16), _16,\n scale(len, _16c, 2 * ady, _32), _32, _48), _48);\n\n const len2 = scale(bcttlen, bctt, adytail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * ady, _16), _16,\n scale(len2, _8, adytail, _16b), _16b,\n scale(len, _16c, adytail, _32), _32, _32b, _64), _64);\n }\n }\n if (bdxtail !== 0 || bdytail !== 0) {\n if (cdxtail !== 0 || cdytail !== 0 || adxtail !== 0 || adytail !== 0) {\n s1 = cdxtail * ady;\n c = splitter * cdxtail;\n ahi = c - (c - cdxtail);\n alo = cdxtail - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdx * adytail;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * adytail;\n bhi = c - (c - adytail);\n blo = adytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n u[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n u[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n n1 = -cdy;\n n0 = -cdytail;\n s1 = adxtail * n1;\n c = splitter * adxtail;\n ahi = c - (c - adxtail);\n alo = adxtail - ahi;\n c = splitter * n1;\n bhi = c - (c - n1);\n blo = n1 - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adx * n0;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * n0;\n bhi = c - (c - n0);\n blo = n0 - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n v[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n v[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n v[2] = _j - (u3 - bvirt) + (_i - bvirt);\n v[3] = u3;\n catlen = sum(4, u, 4, v, cat);\n s1 = cdxtail * adytail;\n c = splitter * cdxtail;\n ahi = c - (c - cdxtail);\n alo = cdxtail - ahi;\n c = splitter * adytail;\n bhi = c - (c - adytail);\n blo = adytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adxtail * cdytail;\n c = splitter * adxtail;\n ahi = c - (c - adxtail);\n alo = adxtail - ahi;\n c = splitter * cdytail;\n bhi = c - (c - cdytail);\n blo = cdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n catt[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n catt[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n catt[2] = _j - (u3 - bvirt) + (_i - bvirt);\n catt[3] = u3;\n cattlen = 4;\n } else {\n cat[0] = 0;\n catlen = 1;\n catt[0] = 0;\n cattlen = 1;\n }\n if (bdxtail !== 0) {\n const len = scale(catlen, cat, bdxtail, _16c);\n finlen = finadd(finlen, sum(\n scale(bxtcalen, bxtca, bdxtail, _16), _16,\n scale(len, _16c, 2 * bdx, _32), _32, _48), _48);\n\n const len2 = scale(cattlen, catt, bdxtail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * bdx, _16), _16,\n scale(len2, _8, bdxtail, _16b), _16b,\n scale(len, _16c, bdxtail, _32), _32, _32b, _64), _64);\n\n if (cdytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, aa, bdxtail, _8), _8, cdytail, _16), _16);\n }\n if (adytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, cc, -bdxtail, _8), _8, adytail, _16), _16);\n }\n }\n if (bdytail !== 0) {\n const len = scale(catlen, cat, bdytail, _16c);\n finlen = finadd(finlen, sum(\n scale(bytcalen, bytca, bdytail, _16), _16,\n scale(len, _16c, 2 * bdy, _32), _32, _48), _48);\n\n const len2 = scale(cattlen, catt, bdytail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * bdy, _16), _16,\n scale(len2, _8, bdytail, _16b), _16b,\n scale(len, _16c, bdytail, _32), _32, _32b, _64), _64);\n }\n }\n if (cdxtail !== 0 || cdytail !== 0) {\n if (adxtail !== 0 || adytail !== 0 || bdxtail !== 0 || bdytail !== 0) {\n s1 = adxtail * bdy;\n c = splitter * adxtail;\n ahi = c - (c - adxtail);\n alo = adxtail - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adx * bdytail;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * bdytail;\n bhi = c - (c - bdytail);\n blo = bdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n u[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n u[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n n1 = -ady;\n n0 = -adytail;\n s1 = bdxtail * n1;\n c = splitter * bdxtail;\n ahi = c - (c - bdxtail);\n alo = bdxtail - ahi;\n c = splitter * n1;\n bhi = c - (c - n1);\n blo = n1 - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdx * n0;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * n0;\n bhi = c - (c - n0);\n blo = n0 - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n v[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n v[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n v[2] = _j - (u3 - bvirt) + (_i - bvirt);\n v[3] = u3;\n abtlen = sum(4, u, 4, v, abt);\n s1 = adxtail * bdytail;\n c = splitter * adxtail;\n ahi = c - (c - adxtail);\n alo = adxtail - ahi;\n c = splitter * bdytail;\n bhi = c - (c - bdytail);\n blo = bdytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdxtail * adytail;\n c = splitter * bdxtail;\n ahi = c - (c - bdxtail);\n alo = bdxtail - ahi;\n c = splitter * adytail;\n bhi = c - (c - adytail);\n blo = adytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n abtt[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n abtt[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n abtt[2] = _j - (u3 - bvirt) + (_i - bvirt);\n abtt[3] = u3;\n abttlen = 4;\n } else {\n abt[0] = 0;\n abtlen = 1;\n abtt[0] = 0;\n abttlen = 1;\n }\n if (cdxtail !== 0) {\n const len = scale(abtlen, abt, cdxtail, _16c);\n finlen = finadd(finlen, sum(\n scale(cxtablen, cxtab, cdxtail, _16), _16,\n scale(len, _16c, 2 * cdx, _32), _32, _48), _48);\n\n const len2 = scale(abttlen, abtt, cdxtail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * cdx, _16), _16,\n scale(len2, _8, cdxtail, _16b), _16b,\n scale(len, _16c, cdxtail, _32), _32, _32b, _64), _64);\n\n if (adytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, bb, cdxtail, _8), _8, adytail, _16), _16);\n }\n if (bdytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, aa, -cdxtail, _8), _8, bdytail, _16), _16);\n }\n }\n if (cdytail !== 0) {\n const len = scale(abtlen, abt, cdytail, _16c);\n finlen = finadd(finlen, sum(\n scale(cytablen, cytab, cdytail, _16), _16,\n scale(len, _16c, 2 * cdy, _32), _32, _48), _48);\n\n const len2 = scale(abttlen, abtt, cdytail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * cdy, _16), _16,\n scale(len2, _8, cdytail, _16b), _16b,\n scale(len, _16c, cdytail, _32), _32, _32b, _64), _64);\n }\n }\n\n return fin[finlen - 1];\n}\n\nexport function incircle(ax, ay, bx, by, cx, cy, dx, dy) {\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n\n const bdxcdy = bdx * cdy;\n const cdxbdy = cdx * bdy;\n const alift = adx * adx + ady * ady;\n\n const cdxady = cdx * ady;\n const adxcdy = adx * cdy;\n const blift = bdx * bdx + bdy * bdy;\n\n const adxbdy = adx * bdy;\n const bdxady = bdx * ady;\n const clift = cdx * cdx + cdy * cdy;\n\n const det =\n alift * (bdxcdy - cdxbdy) +\n blift * (cdxady - adxcdy) +\n clift * (adxbdy - bdxady);\n\n const permanent =\n (Math.abs(bdxcdy) + Math.abs(cdxbdy)) * alift +\n (Math.abs(cdxady) + Math.abs(adxcdy)) * blift +\n (Math.abs(adxbdy) + Math.abs(bdxady)) * clift;\n\n const errbound = iccerrboundA * permanent;\n\n if (det > errbound || -det > errbound) {\n return det;\n }\n return incircleadapt(ax, ay, bx, by, cx, cy, dx, dy, permanent);\n}\n\nexport function incirclefast(ax, ay, bx, by, cx, cy, dx, dy) {\n const adx = ax - dx;\n const ady = ay - dy;\n const bdx = bx - dx;\n const bdy = by - dy;\n const cdx = cx - dx;\n const cdy = cy - dy;\n\n const abdet = adx * bdy - bdx * ady;\n const bcdet = bdx * cdy - cdx * bdy;\n const cadet = cdx * ady - adx * cdy;\n const alift = adx * adx + ady * ady;\n const blift = bdx * bdx + bdy * bdy;\n const clift = cdx * cdx + cdy * cdy;\n\n return alift * bcdet + blift * cadet + clift * abdet;\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum, sum_three, scale, negate} from './util.js';\n\nconst isperrboundA = (16 + 224 * epsilon) * epsilon;\nconst isperrboundB = (5 + 72 * epsilon) * epsilon;\nconst isperrboundC = (71 + 1408 * epsilon) * epsilon * epsilon;\n\nconst ab = vec(4);\nconst bc = vec(4);\nconst cd = vec(4);\nconst de = vec(4);\nconst ea = vec(4);\nconst ac = vec(4);\nconst bd = vec(4);\nconst ce = vec(4);\nconst da = vec(4);\nconst eb = vec(4);\n\nconst abc = vec(24);\nconst bcd = vec(24);\nconst cde = vec(24);\nconst dea = vec(24);\nconst eab = vec(24);\nconst abd = vec(24);\nconst bce = vec(24);\nconst cda = vec(24);\nconst deb = vec(24);\nconst eac = vec(24);\n\nconst adet = vec(1152);\nconst bdet = vec(1152);\nconst cdet = vec(1152);\nconst ddet = vec(1152);\nconst edet = vec(1152);\nconst abdet = vec(2304);\nconst cddet = vec(2304);\nconst cdedet = vec(3456);\nconst deter = vec(5760);\n\nconst _8 = vec(8);\nconst _8b = vec(8);\nconst _8c = vec(8);\nconst _16 = vec(16);\nconst _24 = vec(24);\nconst _48 = vec(48);\nconst _48b = vec(48);\nconst _96 = vec(96);\nconst _192 = vec(192);\nconst _384x = vec(384);\nconst _384y = vec(384);\nconst _384z = vec(384);\nconst _768 = vec(768);\n\nfunction sum_three_scale(a, b, c, az, bz, cz, out) {\n return sum_three(\n scale(4, a, az, _8), _8,\n scale(4, b, bz, _8b), _8b,\n scale(4, c, cz, _8c), _8c, _16, out);\n}\n\nfunction liftexact(alen, a, blen, b, clen, c, dlen, d, x, y, z, out) {\n const len = sum(\n sum(alen, a, blen, b, _48), _48,\n negate(sum(clen, c, dlen, d, _48b), _48b), _48b, _96);\n\n return sum_three(\n scale(scale(len, _96, x, _192), _192, x, _384x), _384x,\n scale(scale(len, _96, y, _192), _192, y, _384y), _384y,\n scale(scale(len, _96, z, _192), _192, z, _384z), _384z, _768, out);\n}\n\nfunction insphereexact(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez) {\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n s1 = ax * by;\n c = splitter * ax;\n ahi = c - (c - ax);\n alo = ax - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bx * ay;\n c = splitter * bx;\n ahi = c - (c - bx);\n alo = bx - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ab[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ab[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ab[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ab[3] = u3;\n s1 = bx * cy;\n c = splitter * bx;\n ahi = c - (c - bx);\n alo = bx - ahi;\n c = splitter * cy;\n bhi = c - (c - cy);\n blo = cy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cx * by;\n c = splitter * cx;\n ahi = c - (c - cx);\n alo = cx - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bc[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bc[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bc[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bc[3] = u3;\n s1 = cx * dy;\n c = splitter * cx;\n ahi = c - (c - cx);\n alo = cx - ahi;\n c = splitter * dy;\n bhi = c - (c - dy);\n blo = dy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = dx * cy;\n c = splitter * dx;\n ahi = c - (c - dx);\n alo = dx - ahi;\n c = splitter * cy;\n bhi = c - (c - cy);\n blo = cy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n cd[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n cd[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n cd[2] = _j - (u3 - bvirt) + (_i - bvirt);\n cd[3] = u3;\n s1 = dx * ey;\n c = splitter * dx;\n ahi = c - (c - dx);\n alo = dx - ahi;\n c = splitter * ey;\n bhi = c - (c - ey);\n blo = ey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ex * dy;\n c = splitter * ex;\n ahi = c - (c - ex);\n alo = ex - ahi;\n c = splitter * dy;\n bhi = c - (c - dy);\n blo = dy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n de[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n de[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n de[2] = _j - (u3 - bvirt) + (_i - bvirt);\n de[3] = u3;\n s1 = ex * ay;\n c = splitter * ex;\n ahi = c - (c - ex);\n alo = ex - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ax * ey;\n c = splitter * ax;\n ahi = c - (c - ax);\n alo = ax - ahi;\n c = splitter * ey;\n bhi = c - (c - ey);\n blo = ey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ea[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ea[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ea[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ea[3] = u3;\n s1 = ax * cy;\n c = splitter * ax;\n ahi = c - (c - ax);\n alo = ax - ahi;\n c = splitter * cy;\n bhi = c - (c - cy);\n blo = cy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cx * ay;\n c = splitter * cx;\n ahi = c - (c - cx);\n alo = cx - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ac[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ac[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ac[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ac[3] = u3;\n s1 = bx * dy;\n c = splitter * bx;\n ahi = c - (c - bx);\n alo = bx - ahi;\n c = splitter * dy;\n bhi = c - (c - dy);\n blo = dy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = dx * by;\n c = splitter * dx;\n ahi = c - (c - dx);\n alo = dx - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bd[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bd[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bd[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bd[3] = u3;\n s1 = cx * ey;\n c = splitter * cx;\n ahi = c - (c - cx);\n alo = cx - ahi;\n c = splitter * ey;\n bhi = c - (c - ey);\n blo = ey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ex * cy;\n c = splitter * ex;\n ahi = c - (c - ex);\n alo = ex - ahi;\n c = splitter * cy;\n bhi = c - (c - cy);\n blo = cy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ce[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ce[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ce[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ce[3] = u3;\n s1 = dx * ay;\n c = splitter * dx;\n ahi = c - (c - dx);\n alo = dx - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ax * dy;\n c = splitter * ax;\n ahi = c - (c - ax);\n alo = ax - ahi;\n c = splitter * dy;\n bhi = c - (c - dy);\n blo = dy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n da[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n da[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n da[2] = _j - (u3 - bvirt) + (_i - bvirt);\n da[3] = u3;\n s1 = ex * by;\n c = splitter * ex;\n ahi = c - (c - ex);\n alo = ex - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bx * ey;\n c = splitter * bx;\n ahi = c - (c - bx);\n alo = bx - ahi;\n c = splitter * ey;\n bhi = c - (c - ey);\n blo = ey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n eb[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n eb[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n eb[2] = _j - (u3 - bvirt) + (_i - bvirt);\n eb[3] = u3;\n\n const abclen = sum_three_scale(ab, bc, ac, cz, az, -bz, abc);\n const bcdlen = sum_three_scale(bc, cd, bd, dz, bz, -cz, bcd);\n const cdelen = sum_three_scale(cd, de, ce, ez, cz, -dz, cde);\n const dealen = sum_three_scale(de, ea, da, az, dz, -ez, dea);\n const eablen = sum_three_scale(ea, ab, eb, bz, ez, -az, eab);\n const abdlen = sum_three_scale(ab, bd, da, dz, az, bz, abd);\n const bcelen = sum_three_scale(bc, ce, eb, ez, bz, cz, bce);\n const cdalen = sum_three_scale(cd, da, ac, az, cz, dz, cda);\n const deblen = sum_three_scale(de, eb, bd, bz, dz, ez, deb);\n const eaclen = sum_three_scale(ea, ac, ce, cz, ez, az, eac);\n\n const deterlen = sum_three(\n liftexact(cdelen, cde, bcelen, bce, deblen, deb, bcdlen, bcd, ax, ay, az, adet), adet,\n liftexact(dealen, dea, cdalen, cda, eaclen, eac, cdelen, cde, bx, by, bz, bdet), bdet,\n sum_three(\n liftexact(eablen, eab, deblen, deb, abdlen, abd, dealen, dea, cx, cy, cz, cdet), cdet,\n liftexact(abclen, abc, eaclen, eac, bcelen, bce, eablen, eab, dx, dy, dz, ddet), ddet,\n liftexact(bcdlen, bcd, abdlen, abd, cdalen, cda, abclen, abc, ex, ey, ez, edet), edet, cddet, cdedet), cdedet, abdet, deter);\n\n return deter[deterlen - 1];\n}\n\nconst xdet = vec(96);\nconst ydet = vec(96);\nconst zdet = vec(96);\nconst fin = vec(1152);\n\nfunction liftadapt(a, b, c, az, bz, cz, x, y, z, out) {\n const len = sum_three_scale(a, b, c, az, bz, cz, _24);\n return sum_three(\n scale(scale(len, _24, x, _48), _48, x, xdet), xdet,\n scale(scale(len, _24, y, _48), _48, y, ydet), ydet,\n scale(scale(len, _24, z, _48), _48, z, zdet), zdet, _192, out);\n}\n\nfunction insphereadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez, permanent) {\n let ab3, bc3, cd3, da3, ac3, bd3;\n\n let aextail, bextail, cextail, dextail;\n let aeytail, beytail, ceytail, deytail;\n let aeztail, beztail, ceztail, deztail;\n\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0;\n\n const aex = ax - ex;\n const bex = bx - ex;\n const cex = cx - ex;\n const dex = dx - ex;\n const aey = ay - ey;\n const bey = by - ey;\n const cey = cy - ey;\n const dey = dy - ey;\n const aez = az - ez;\n const bez = bz - ez;\n const cez = cz - ez;\n const dez = dz - ez;\n\n s1 = aex * bey;\n c = splitter * aex;\n ahi = c - (c - aex);\n alo = aex - ahi;\n c = splitter * bey;\n bhi = c - (c - bey);\n blo = bey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bex * aey;\n c = splitter * bex;\n ahi = c - (c - bex);\n alo = bex - ahi;\n c = splitter * aey;\n bhi = c - (c - aey);\n blo = aey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ab[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ab[1] = _0 - (_i + bvirt) + (bvirt - t1);\n ab3 = _j + _i;\n bvirt = ab3 - _j;\n ab[2] = _j - (ab3 - bvirt) + (_i - bvirt);\n ab[3] = ab3;\n s1 = bex * cey;\n c = splitter * bex;\n ahi = c - (c - bex);\n alo = bex - ahi;\n c = splitter * cey;\n bhi = c - (c - cey);\n blo = cey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cex * bey;\n c = splitter * cex;\n ahi = c - (c - cex);\n alo = cex - ahi;\n c = splitter * bey;\n bhi = c - (c - bey);\n blo = bey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bc[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bc[1] = _0 - (_i + bvirt) + (bvirt - t1);\n bc3 = _j + _i;\n bvirt = bc3 - _j;\n bc[2] = _j - (bc3 - bvirt) + (_i - bvirt);\n bc[3] = bc3;\n s1 = cex * dey;\n c = splitter * cex;\n ahi = c - (c - cex);\n alo = cex - ahi;\n c = splitter * dey;\n bhi = c - (c - dey);\n blo = dey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = dex * cey;\n c = splitter * dex;\n ahi = c - (c - dex);\n alo = dex - ahi;\n c = splitter * cey;\n bhi = c - (c - cey);\n blo = cey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n cd[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n cd[1] = _0 - (_i + bvirt) + (bvirt - t1);\n cd3 = _j + _i;\n bvirt = cd3 - _j;\n cd[2] = _j - (cd3 - bvirt) + (_i - bvirt);\n cd[3] = cd3;\n s1 = dex * aey;\n c = splitter * dex;\n ahi = c - (c - dex);\n alo = dex - ahi;\n c = splitter * aey;\n bhi = c - (c - aey);\n blo = aey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = aex * dey;\n c = splitter * aex;\n ahi = c - (c - aex);\n alo = aex - ahi;\n c = splitter * dey;\n bhi = c - (c - dey);\n blo = dey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n da[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n da[1] = _0 - (_i + bvirt) + (bvirt - t1);\n da3 = _j + _i;\n bvirt = da3 - _j;\n da[2] = _j - (da3 - bvirt) + (_i - bvirt);\n da[3] = da3;\n s1 = aex * cey;\n c = splitter * aex;\n ahi = c - (c - aex);\n alo = aex - ahi;\n c = splitter * cey;\n bhi = c - (c - cey);\n blo = cey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cex * aey;\n c = splitter * cex;\n ahi = c - (c - cex);\n alo = cex - ahi;\n c = splitter * aey;\n bhi = c - (c - aey);\n blo = aey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ac[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ac[1] = _0 - (_i + bvirt) + (bvirt - t1);\n ac3 = _j + _i;\n bvirt = ac3 - _j;\n ac[2] = _j - (ac3 - bvirt) + (_i - bvirt);\n ac[3] = ac3;\n s1 = bex * dey;\n c = splitter * bex;\n ahi = c - (c - bex);\n alo = bex - ahi;\n c = splitter * dey;\n bhi = c - (c - dey);\n blo = dey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = dex * bey;\n c = splitter * dex;\n ahi = c - (c - dex);\n alo = dex - ahi;\n c = splitter * bey;\n bhi = c - (c - bey);\n blo = bey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bd[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bd[1] = _0 - (_i + bvirt) + (bvirt - t1);\n bd3 = _j + _i;\n bvirt = bd3 - _j;\n bd[2] = _j - (bd3 - bvirt) + (_i - bvirt);\n bd[3] = bd3;\n\n const finlen = sum(\n sum(\n negate(liftadapt(bc, cd, bd, dez, bez, -cez, aex, aey, aez, adet), adet), adet,\n liftadapt(cd, da, ac, aez, cez, dez, bex, bey, bez, bdet), bdet, abdet), abdet,\n sum(\n negate(liftadapt(da, ab, bd, bez, dez, aez, cex, cey, cez, cdet), cdet), cdet,\n liftadapt(ab, bc, ac, cez, aez, -bez, dex, dey, dez, ddet), ddet, cddet), cddet, fin);\n\n let det = estimate(finlen, fin);\n let errbound = isperrboundB * permanent;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - aex;\n aextail = ax - (aex + bvirt) + (bvirt - ex);\n bvirt = ay - aey;\n aeytail = ay - (aey + bvirt) + (bvirt - ey);\n bvirt = az - aez;\n aeztail = az - (aez + bvirt) + (bvirt - ez);\n bvirt = bx - bex;\n bextail = bx - (bex + bvirt) + (bvirt - ex);\n bvirt = by - bey;\n beytail = by - (bey + bvirt) + (bvirt - ey);\n bvirt = bz - bez;\n beztail = bz - (bez + bvirt) + (bvirt - ez);\n bvirt = cx - cex;\n cextail = cx - (cex + bvirt) + (bvirt - ex);\n bvirt = cy - cey;\n ceytail = cy - (cey + bvirt) + (bvirt - ey);\n bvirt = cz - cez;\n ceztail = cz - (cez + bvirt) + (bvirt - ez);\n bvirt = dx - dex;\n dextail = dx - (dex + bvirt) + (bvirt - ex);\n bvirt = dy - dey;\n deytail = dy - (dey + bvirt) + (bvirt - ey);\n bvirt = dz - dez;\n deztail = dz - (dez + bvirt) + (bvirt - ez);\n if (aextail === 0 && aeytail === 0 && aeztail === 0 &&\n bextail === 0 && beytail === 0 && beztail === 0 &&\n cextail === 0 && ceytail === 0 && ceztail === 0 &&\n dextail === 0 && deytail === 0 && deztail === 0) {\n return det;\n }\n\n errbound = isperrboundC * permanent + resulterrbound * Math.abs(det);\n\n const abeps = (aex * beytail + bey * aextail) - (aey * bextail + bex * aeytail);\n const bceps = (bex * ceytail + cey * bextail) - (bey * cextail + cex * beytail);\n const cdeps = (cex * deytail + dey * cextail) - (cey * dextail + dex * ceytail);\n const daeps = (dex * aeytail + aey * dextail) - (dey * aextail + aex * deytail);\n const aceps = (aex * ceytail + cey * aextail) - (aey * cextail + cex * aeytail);\n const bdeps = (bex * deytail + dey * bextail) - (bey * dextail + dex * beytail);\n det +=\n (((bex * bex + bey * bey + bez * bez) * ((cez * daeps + dez * aceps + aez * cdeps) +\n (ceztail * da3 + deztail * ac3 + aeztail * cd3)) + (dex * dex + dey * dey + dez * dez) *\n ((aez * bceps - bez * aceps + cez * abeps) + (aeztail * bc3 - beztail * ac3 + ceztail * ab3))) -\n ((aex * aex + aey * aey + aez * aez) * ((bez * cdeps - cez * bdeps + dez * bceps) +\n (beztail * cd3 - ceztail * bd3 + deztail * bc3)) + (cex * cex + cey * cey + cez * cez) *\n ((dez * abeps + aez * bdeps + bez * daeps) + (deztail * ab3 + aeztail * bd3 + beztail * da3)))) +\n 2 * (((bex * bextail + bey * beytail + bez * beztail) * (cez * da3 + dez * ac3 + aez * cd3) +\n (dex * dextail + dey * deytail + dez * deztail) * (aez * bc3 - bez * ac3 + cez * ab3)) -\n ((aex * aextail + aey * aeytail + aez * aeztail) * (bez * cd3 - cez * bd3 + dez * bc3) +\n (cex * cextail + cey * ceytail + cez * ceztail) * (dez * ab3 + aez * bd3 + bez * da3)));\n\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n return insphereexact(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez);\n}\n\nexport function insphere(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez) {\n const aex = ax - ex;\n const bex = bx - ex;\n const cex = cx - ex;\n const dex = dx - ex;\n const aey = ay - ey;\n const bey = by - ey;\n const cey = cy - ey;\n const dey = dy - ey;\n const aez = az - ez;\n const bez = bz - ez;\n const cez = cz - ez;\n const dez = dz - ez;\n\n const aexbey = aex * bey;\n const bexaey = bex * aey;\n const ab = aexbey - bexaey;\n const bexcey = bex * cey;\n const cexbey = cex * bey;\n const bc = bexcey - cexbey;\n const cexdey = cex * dey;\n const dexcey = dex * cey;\n const cd = cexdey - dexcey;\n const dexaey = dex * aey;\n const aexdey = aex * dey;\n const da = dexaey - aexdey;\n const aexcey = aex * cey;\n const cexaey = cex * aey;\n const ac = aexcey - cexaey;\n const bexdey = bex * dey;\n const dexbey = dex * bey;\n const bd = bexdey - dexbey;\n\n const abc = aez * bc - bez * ac + cez * ab;\n const bcd = bez * cd - cez * bd + dez * bc;\n const cda = cez * da + dez * ac + aez * cd;\n const dab = dez * ab + aez * bd + bez * da;\n\n const alift = aex * aex + aey * aey + aez * aez;\n const blift = bex * bex + bey * bey + bez * bez;\n const clift = cex * cex + cey * cey + cez * cez;\n const dlift = dex * dex + dey * dey + dez * dez;\n\n const det = (clift * dab - dlift * abc) + (alift * bcd - blift * cda);\n\n const aezplus = Math.abs(aez);\n const bezplus = Math.abs(bez);\n const cezplus = Math.abs(cez);\n const dezplus = Math.abs(dez);\n const aexbeyplus = Math.abs(aexbey);\n const bexaeyplus = Math.abs(bexaey);\n const bexceyplus = Math.abs(bexcey);\n const cexbeyplus = Math.abs(cexbey);\n const cexdeyplus = Math.abs(cexdey);\n const dexceyplus = Math.abs(dexcey);\n const dexaeyplus = Math.abs(dexaey);\n const aexdeyplus = Math.abs(aexdey);\n const aexceyplus = Math.abs(aexcey);\n const cexaeyplus = Math.abs(cexaey);\n const bexdeyplus = Math.abs(bexdey);\n const dexbeyplus = Math.abs(dexbey);\n const permanent =\n ((cexdeyplus + dexceyplus) * bezplus + (dexbeyplus + bexdeyplus) * cezplus + (bexceyplus + cexbeyplus) * dezplus) * alift +\n ((dexaeyplus + aexdeyplus) * cezplus + (aexceyplus + cexaeyplus) * dezplus + (cexdeyplus + dexceyplus) * aezplus) * blift +\n ((aexbeyplus + bexaeyplus) * dezplus + (bexdeyplus + dexbeyplus) * aezplus + (dexaeyplus + aexdeyplus) * bezplus) * clift +\n ((bexceyplus + cexbeyplus) * aezplus + (cexaeyplus + aexceyplus) * bezplus + (aexbeyplus + bexaeyplus) * cezplus) * dlift;\n\n const errbound = isperrboundA * permanent;\n if (det > errbound || -det > errbound) {\n return det;\n }\n return -insphereadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez, permanent);\n}\n\nexport function inspherefast(pax, pay, paz, pbx, pby, pbz, pcx, pcy, pcz, pdx, pdy, pdz, pex, pey, pez) {\n const aex = pax - pex;\n const bex = pbx - pex;\n const cex = pcx - pex;\n const dex = pdx - pex;\n const aey = pay - pey;\n const bey = pby - pey;\n const cey = pcy - pey;\n const dey = pdy - pey;\n const aez = paz - pez;\n const bez = pbz - pez;\n const cez = pcz - pez;\n const dez = pdz - pez;\n\n const ab = aex * bey - bex * aey;\n const bc = bex * cey - cex * bey;\n const cd = cex * dey - dex * cey;\n const da = dex * aey - aex * dey;\n const ac = aex * cey - cex * aey;\n const bd = bex * dey - dex * bey;\n\n const abc = aez * bc - bez * ac + cez * ab;\n const bcd = bez * cd - cez * bd + dez * bc;\n const cda = cez * da + dez * ac + aez * cd;\n const dab = dez * ab + aez * bd + bez * da;\n\n const alift = aex * aex + aey * aey + aez * aez;\n const blift = bex * bex + bey * bey + bez * bez;\n const clift = cex * cex + cey * cey + cez * cez;\n const dlift = dex * dex + dey * dey + dez * dez;\n\n return (clift * dab - dlift * abc) + (alift * bcd - blift * cda);\n}\n","\nconst EPSILON = Math.pow(2, -52);\nconst EDGE_STACK = new Uint32Array(512);\n\nimport {orient2d} from 'robust-predicates';\n\nexport default class Delaunator {\n\n static from(points, getX = defaultGetX, getY = defaultGetY) {\n const n = points.length;\n const coords = new Float64Array(n * 2);\n\n for (let i = 0; i < n; i++) {\n const p = points[i];\n coords[2 * i] = getX(p);\n coords[2 * i + 1] = getY(p);\n }\n\n return new Delaunator(coords);\n }\n\n constructor(coords) {\n const n = coords.length >> 1;\n if (n > 0 && typeof coords[0] !== 'number') throw new Error('Expected coords to contain numbers.');\n\n this.coords = coords;\n\n // arrays that will store the triangulation graph\n const maxTriangles = Math.max(2 * n - 5, 0);\n this._triangles = new Uint32Array(maxTriangles * 3);\n this._halfedges = new Int32Array(maxTriangles * 3);\n\n // temporary arrays for tracking the edges of the advancing convex hull\n this._hashSize = Math.ceil(Math.sqrt(n));\n this._hullPrev = new Uint32Array(n); // edge to prev edge\n this._hullNext = new Uint32Array(n); // edge to next edge\n this._hullTri = new Uint32Array(n); // edge to adjacent triangle\n this._hullHash = new Int32Array(this._hashSize).fill(-1); // angular edge hash\n\n // temporary arrays for sorting points\n this._ids = new Uint32Array(n);\n this._dists = new Float64Array(n);\n\n this.update();\n }\n\n update() {\n const {coords, _hullPrev: hullPrev, _hullNext: hullNext, _hullTri: hullTri, _hullHash: hullHash} = this;\n const n = coords.length >> 1;\n\n // populate an array of point indices; calculate input data bbox\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n\n for (let i = 0; i < n; i++) {\n const x = coords[2 * i];\n const y = coords[2 * i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n this._ids[i] = i;\n }\n const cx = (minX + maxX) / 2;\n const cy = (minY + maxY) / 2;\n\n let minDist = Infinity;\n let i0, i1, i2;\n\n // pick a seed point close to the center\n for (let i = 0; i < n; i++) {\n const d = dist(cx, cy, coords[2 * i], coords[2 * i + 1]);\n if (d < minDist) {\n i0 = i;\n minDist = d;\n }\n }\n const i0x = coords[2 * i0];\n const i0y = coords[2 * i0 + 1];\n\n minDist = Infinity;\n\n // find the point closest to the seed\n for (let i = 0; i < n; i++) {\n if (i === i0) continue;\n const d = dist(i0x, i0y, coords[2 * i], coords[2 * i + 1]);\n if (d < minDist && d > 0) {\n i1 = i;\n minDist = d;\n }\n }\n let i1x = coords[2 * i1];\n let i1y = coords[2 * i1 + 1];\n\n let minRadius = Infinity;\n\n // find the third point which forms the smallest circumcircle with the first two\n for (let i = 0; i < n; i++) {\n if (i === i0 || i === i1) continue;\n const r = circumradius(i0x, i0y, i1x, i1y, coords[2 * i], coords[2 * i + 1]);\n if (r < minRadius) {\n i2 = i;\n minRadius = r;\n }\n }\n let i2x = coords[2 * i2];\n let i2y = coords[2 * i2 + 1];\n\n if (minRadius === Infinity) {\n // order collinear points by dx (or dy if all x are identical)\n // and return the list as a hull\n for (let i = 0; i < n; i++) {\n this._dists[i] = (coords[2 * i] - coords[0]) || (coords[2 * i + 1] - coords[1]);\n }\n quicksort(this._ids, this._dists, 0, n - 1);\n const hull = new Uint32Array(n);\n let j = 0;\n for (let i = 0, d0 = -Infinity; i < n; i++) {\n const id = this._ids[i];\n if (this._dists[id] > d0) {\n hull[j++] = id;\n d0 = this._dists[id];\n }\n }\n this.hull = hull.subarray(0, j);\n this.triangles = new Uint32Array(0);\n this.halfedges = new Uint32Array(0);\n return;\n }\n\n // swap the order of the seed points for counter-clockwise orientation\n if (orient2d(i0x, i0y, i1x, i1y, i2x, i2y) < 0) {\n const i = i1;\n const x = i1x;\n const y = i1y;\n i1 = i2;\n i1x = i2x;\n i1y = i2y;\n i2 = i;\n i2x = x;\n i2y = y;\n }\n\n const center = circumcenter(i0x, i0y, i1x, i1y, i2x, i2y);\n this._cx = center.x;\n this._cy = center.y;\n\n for (let i = 0; i < n; i++) {\n this._dists[i] = dist(coords[2 * i], coords[2 * i + 1], center.x, center.y);\n }\n\n // sort the points by distance from the seed triangle circumcenter\n quicksort(this._ids, this._dists, 0, n - 1);\n\n // set up the seed triangle as the starting hull\n this._hullStart = i0;\n let hullSize = 3;\n\n hullNext[i0] = hullPrev[i2] = i1;\n hullNext[i1] = hullPrev[i0] = i2;\n hullNext[i2] = hullPrev[i1] = i0;\n\n hullTri[i0] = 0;\n hullTri[i1] = 1;\n hullTri[i2] = 2;\n\n hullHash.fill(-1);\n hullHash[this._hashKey(i0x, i0y)] = i0;\n hullHash[this._hashKey(i1x, i1y)] = i1;\n hullHash[this._hashKey(i2x, i2y)] = i2;\n\n this.trianglesLen = 0;\n this._addTriangle(i0, i1, i2, -1, -1, -1);\n\n for (let k = 0, xp, yp; k < this._ids.length; k++) {\n const i = this._ids[k];\n const x = coords[2 * i];\n const y = coords[2 * i + 1];\n\n // skip near-duplicate points\n if (k > 0 && Math.abs(x - xp) <= EPSILON && Math.abs(y - yp) <= EPSILON) continue;\n xp = x;\n yp = y;\n\n // skip seed triangle points\n if (i === i0 || i === i1 || i === i2) continue;\n\n // find a visible edge on the convex hull using edge hash\n let start = 0;\n for (let j = 0, key = this._hashKey(x, y); j < this._hashSize; j++) {\n start = hullHash[(key + j) % this._hashSize];\n if (start !== -1 && start !== hullNext[start]) break;\n }\n\n start = hullPrev[start];\n let e = start, q;\n while (q = hullNext[e], orient2d(x, y, coords[2 * e], coords[2 * e + 1], coords[2 * q], coords[2 * q + 1]) >= 0) {\n e = q;\n if (e === start) {\n e = -1;\n break;\n }\n }\n if (e === -1) continue; // likely a near-duplicate point; skip it\n\n // add the first triangle from the point\n let t = this._addTriangle(e, i, hullNext[e], -1, -1, hullTri[e]);\n\n // recursively flip triangles from the point until they satisfy the Delaunay condition\n hullTri[i] = this._legalize(t + 2);\n hullTri[e] = t; // keep track of boundary triangles on the hull\n hullSize++;\n\n // walk forward through the hull, adding more triangles and flipping recursively\n let n = hullNext[e];\n while (q = hullNext[n], orient2d(x, y, coords[2 * n], coords[2 * n + 1], coords[2 * q], coords[2 * q + 1]) < 0) {\n t = this._addTriangle(n, i, q, hullTri[i], -1, hullTri[n]);\n hullTri[i] = this._legalize(t + 2);\n hullNext[n] = n; // mark as removed\n hullSize--;\n n = q;\n }\n\n // walk backward from the other side, adding more triangles and flipping\n if (e === start) {\n while (q = hullPrev[e], orient2d(x, y, coords[2 * q], coords[2 * q + 1], coords[2 * e], coords[2 * e + 1]) < 0) {\n t = this._addTriangle(q, i, e, -1, hullTri[e], hullTri[q]);\n this._legalize(t + 2);\n hullTri[q] = t;\n hullNext[e] = e; // mark as removed\n hullSize--;\n e = q;\n }\n }\n\n // update the hull indices\n this._hullStart = hullPrev[i] = e;\n hullNext[e] = hullPrev[n] = i;\n hullNext[i] = n;\n\n // save the two new edges in the hash table\n hullHash[this._hashKey(x, y)] = i;\n hullHash[this._hashKey(coords[2 * e], coords[2 * e + 1])] = e;\n }\n\n this.hull = new Uint32Array(hullSize);\n for (let i = 0, e = this._hullStart; i < hullSize; i++) {\n this.hull[i] = e;\n e = hullNext[e];\n }\n\n // trim typed triangle mesh arrays\n this.triangles = this._triangles.subarray(0, this.trianglesLen);\n this.halfedges = this._halfedges.subarray(0, this.trianglesLen);\n }\n\n _hashKey(x, y) {\n return Math.floor(pseudoAngle(x - this._cx, y - this._cy) * this._hashSize) % this._hashSize;\n }\n\n _legalize(a) {\n const {_triangles: triangles, _halfedges: halfedges, coords} = this;\n\n let i = 0;\n let ar = 0;\n\n // recursion eliminated with a fixed-size stack\n while (true) {\n const b = halfedges[a];\n\n /* if the pair of triangles doesn't satisfy the Delaunay condition\n * (p1 is inside the circumcircle of [p0, pl, pr]), flip them,\n * then do the same check/flip recursively for the new pair of triangles\n *\n * pl pl\n * /||\\ / \\\n * al/ || \\bl al/ \\a\n * / || \\ / \\\n * / a||b \\ flip /___ar___\\\n * p0\\ || /p1 => p0\\---bl---/p1\n * \\ || / \\ /\n * ar\\ || /br b\\ /br\n * \\||/ \\ /\n * pr pr\n */\n const a0 = a - a % 3;\n ar = a0 + (a + 2) % 3;\n\n if (b === -1) { // convex hull edge\n if (i === 0) break;\n a = EDGE_STACK[--i];\n continue;\n }\n\n const b0 = b - b % 3;\n const al = a0 + (a + 1) % 3;\n const bl = b0 + (b + 2) % 3;\n\n const p0 = triangles[ar];\n const pr = triangles[a];\n const pl = triangles[al];\n const p1 = triangles[bl];\n\n const illegal = inCircle(\n coords[2 * p0], coords[2 * p0 + 1],\n coords[2 * pr], coords[2 * pr + 1],\n coords[2 * pl], coords[2 * pl + 1],\n coords[2 * p1], coords[2 * p1 + 1]);\n\n if (illegal) {\n triangles[a] = p1;\n triangles[b] = p0;\n\n const hbl = halfedges[bl];\n\n // edge swapped on the other side of the hull (rare); fix the halfedge reference\n if (hbl === -1) {\n let e = this._hullStart;\n do {\n if (this._hullTri[e] === bl) {\n this._hullTri[e] = a;\n break;\n }\n e = this._hullPrev[e];\n } while (e !== this._hullStart);\n }\n this._link(a, hbl);\n this._link(b, halfedges[ar]);\n this._link(ar, bl);\n\n const br = b0 + (b + 1) % 3;\n\n // don't worry about hitting the cap: it can only happen on extremely degenerate input\n if (i < EDGE_STACK.length) {\n EDGE_STACK[i++] = br;\n }\n } else {\n if (i === 0) break;\n a = EDGE_STACK[--i];\n }\n }\n\n return ar;\n }\n\n _link(a, b) {\n this._halfedges[a] = b;\n if (b !== -1) this._halfedges[b] = a;\n }\n\n // add a new triangle given vertex indices and adjacent half-edge ids\n _addTriangle(i0, i1, i2, a, b, c) {\n const t = this.trianglesLen;\n\n this._triangles[t] = i0;\n this._triangles[t + 1] = i1;\n this._triangles[t + 2] = i2;\n\n this._link(t, a);\n this._link(t + 1, b);\n this._link(t + 2, c);\n\n this.trianglesLen += 3;\n\n return t;\n }\n}\n\n// monotonically increases with real angle, but doesn't need expensive trigonometry\nfunction pseudoAngle(dx, dy) {\n const p = dx / (Math.abs(dx) + Math.abs(dy));\n return (dy > 0 ? 3 - p : 1 + p) / 4; // [0..1]\n}\n\nfunction dist(ax, ay, bx, by) {\n const dx = ax - bx;\n const dy = ay - by;\n return dx * dx + dy * dy;\n}\n\nfunction inCircle(ax, ay, bx, by, cx, cy, px, py) {\n const dx = ax - px;\n const dy = ay - py;\n const ex = bx - px;\n const ey = by - py;\n const fx = cx - px;\n const fy = cy - py;\n\n const ap = dx * dx + dy * dy;\n const bp = ex * ex + ey * ey;\n const cp = fx * fx + fy * fy;\n\n return dx * (ey * cp - bp * fy) -\n dy * (ex * cp - bp * fx) +\n ap * (ex * fy - ey * fx) < 0;\n}\n\nfunction circumradius(ax, ay, bx, by, cx, cy) {\n const dx = bx - ax;\n const dy = by - ay;\n const ex = cx - ax;\n const ey = cy - ay;\n\n const bl = dx * dx + dy * dy;\n const cl = ex * ex + ey * ey;\n const d = 0.5 / (dx * ey - dy * ex);\n\n const x = (ey * bl - dy * cl) * d;\n const y = (dx * cl - ex * bl) * d;\n\n return x * x + y * y;\n}\n\nfunction circumcenter(ax, ay, bx, by, cx, cy) {\n const dx = bx - ax;\n const dy = by - ay;\n const ex = cx - ax;\n const ey = cy - ay;\n\n const bl = dx * dx + dy * dy;\n const cl = ex * ex + ey * ey;\n const d = 0.5 / (dx * ey - dy * ex);\n\n const x = ax + (ey * bl - dy * cl) * d;\n const y = ay + (dx * cl - ex * bl) * d;\n\n return {x, y};\n}\n\nfunction quicksort(ids, dists, left, right) {\n if (right - left <= 20) {\n for (let i = left + 1; i <= right; i++) {\n const temp = ids[i];\n const tempDist = dists[temp];\n let j = i - 1;\n while (j >= left && dists[ids[j]] > tempDist) ids[j + 1] = ids[j--];\n ids[j + 1] = temp;\n }\n } else {\n const median = (left + right) >> 1;\n let i = left + 1;\n let j = right;\n swap(ids, median, i);\n if (dists[ids[left]] > dists[ids[right]]) swap(ids, left, right);\n if (dists[ids[i]] > dists[ids[right]]) swap(ids, i, right);\n if (dists[ids[left]] > dists[ids[i]]) swap(ids, left, i);\n\n const temp = ids[i];\n const tempDist = dists[temp];\n while (true) {\n do i++; while (dists[ids[i]] < tempDist);\n do j--; while (dists[ids[j]] > tempDist);\n if (j < i) break;\n swap(ids, i, j);\n }\n ids[left + 1] = ids[j];\n ids[j] = temp;\n\n if (right - i + 1 >= j - left) {\n quicksort(ids, dists, i, right);\n quicksort(ids, dists, left, j - 1);\n } else {\n quicksort(ids, dists, left, j - 1);\n quicksort(ids, dists, i, right);\n }\n }\n}\n\nfunction swap(arr, i, j) {\n const tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\nfunction defaultGetX(p) {\n return p[0];\n}\nfunction defaultGetY(p) {\n return p[1];\n}\n","const epsilon = 1e-6;\n\nexport default class Path {\n constructor() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n }\n moveTo(x, y) {\n this._ += `M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n }\n lineTo(x, y) {\n this._ += `L${this._x1 = +x},${this._y1 = +y}`;\n }\n arc(x, y, r) {\n x = +x, y = +y, r = +r;\n const x0 = x + r;\n const y0 = y;\n if (r < 0) throw new Error(\"negative radius\");\n if (this._x1 === null) this._ += `M${x0},${y0}`;\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) this._ += \"L\" + x0 + \",\" + y0;\n if (!r) return;\n this._ += `A${r},${r},0,1,1,${x - r},${y}A${r},${r},0,1,1,${this._x1 = x0},${this._y1 = y0}`;\n }\n rect(x, y, w, h) {\n this._ += `M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${+w}v${+h}h${-w}Z`;\n }\n value() {\n return this._ || null;\n }\n}\n","export default class Polygon {\n constructor() {\n this._ = [];\n }\n moveTo(x, y) {\n this._.push([x, y]);\n }\n closePath() {\n this._.push(this._[0].slice());\n }\n lineTo(x, y) {\n this._.push([x, y]);\n }\n value() {\n return this._.length ? this._ : null;\n }\n}\n","import Path from \"./path.js\";\nimport Polygon from \"./polygon.js\";\n\nexport default class Voronoi {\n constructor(delaunay, [xmin, ymin, xmax, ymax] = [0, 0, 960, 500]) {\n if (!((xmax = +xmax) >= (xmin = +xmin)) || !((ymax = +ymax) >= (ymin = +ymin))) throw new Error(\"invalid bounds\");\n this.delaunay = delaunay;\n this._circumcenters = new Float64Array(delaunay.points.length * 2);\n this.vectors = new Float64Array(delaunay.points.length * 2);\n this.xmax = xmax, this.xmin = xmin;\n this.ymax = ymax, this.ymin = ymin;\n this._init();\n }\n update() {\n this.delaunay.update();\n this._init();\n return this;\n }\n _init() {\n const {delaunay: {points, hull, triangles}, vectors} = this;\n let bx, by; // lazily computed barycenter of the hull\n\n // Compute circumcenters.\n const circumcenters = this.circumcenters = this._circumcenters.subarray(0, triangles.length / 3 * 2);\n for (let i = 0, j = 0, n = triangles.length, x, y; i < n; i += 3, j += 2) {\n const t1 = triangles[i] * 2;\n const t2 = triangles[i + 1] * 2;\n const t3 = triangles[i + 2] * 2;\n const x1 = points[t1];\n const y1 = points[t1 + 1];\n const x2 = points[t2];\n const y2 = points[t2 + 1];\n const x3 = points[t3];\n const y3 = points[t3 + 1];\n\n const dx = x2 - x1;\n const dy = y2 - y1;\n const ex = x3 - x1;\n const ey = y3 - y1;\n const ab = (dx * ey - dy * ex) * 2;\n\n if (Math.abs(ab) < 1e-9) {\n // For a degenerate triangle, the circumcenter is at the infinity, in a\n // direction orthogonal to the halfedge and away from the “center” of\n // the diagram , defined as the hull’s barycenter.\n if (bx === undefined) {\n bx = by = 0;\n for (const i of hull) bx += points[i * 2], by += points[i * 2 + 1];\n bx /= hull.length, by /= hull.length;\n }\n const a = 1e9 * Math.sign((bx - x1) * ey - (by - y1) * ex);\n x = (x1 + x3) / 2 - a * ey;\n y = (y1 + y3) / 2 + a * ex;\n } else {\n const d = 1 / ab;\n const bl = dx * dx + dy * dy;\n const cl = ex * ex + ey * ey;\n x = x1 + (ey * bl - dy * cl) * d;\n y = y1 + (dx * cl - ex * bl) * d;\n }\n circumcenters[j] = x;\n circumcenters[j + 1] = y;\n }\n\n // Compute exterior cell rays.\n let h = hull[hull.length - 1];\n let p0, p1 = h * 4;\n let x0, x1 = points[2 * h];\n let y0, y1 = points[2 * h + 1];\n vectors.fill(0);\n for (let i = 0; i < hull.length; ++i) {\n h = hull[i];\n p0 = p1, x0 = x1, y0 = y1;\n p1 = h * 4, x1 = points[2 * h], y1 = points[2 * h + 1];\n vectors[p0 + 2] = vectors[p1] = y0 - y1;\n vectors[p0 + 3] = vectors[p1 + 1] = x1 - x0;\n }\n }\n render(context) {\n const buffer = context == null ? context = new Path : undefined;\n const {delaunay: {halfedges, inedges, hull}, circumcenters, vectors} = this;\n if (hull.length <= 1) return null;\n for (let i = 0, n = halfedges.length; i < n; ++i) {\n const j = halfedges[i];\n if (j < i) continue;\n const ti = Math.floor(i / 3) * 2;\n const tj = Math.floor(j / 3) * 2;\n const xi = circumcenters[ti];\n const yi = circumcenters[ti + 1];\n const xj = circumcenters[tj];\n const yj = circumcenters[tj + 1];\n this._renderSegment(xi, yi, xj, yj, context);\n }\n let h0, h1 = hull[hull.length - 1];\n for (let i = 0; i < hull.length; ++i) {\n h0 = h1, h1 = hull[i];\n const t = Math.floor(inedges[h1] / 3) * 2;\n const x = circumcenters[t];\n const y = circumcenters[t + 1];\n const v = h0 * 4;\n const p = this._project(x, y, vectors[v + 2], vectors[v + 3]);\n if (p) this._renderSegment(x, y, p[0], p[1], context);\n }\n return buffer && buffer.value();\n }\n renderBounds(context) {\n const buffer = context == null ? context = new Path : undefined;\n context.rect(this.xmin, this.ymin, this.xmax - this.xmin, this.ymax - this.ymin);\n return buffer && buffer.value();\n }\n renderCell(i, context) {\n const buffer = context == null ? context = new Path : undefined;\n const points = this._clip(i);\n if (points === null || !points.length) return;\n context.moveTo(points[0], points[1]);\n let n = points.length;\n while (points[0] === points[n-2] && points[1] === points[n-1] && n > 1) n -= 2;\n for (let i = 2; i < n; i += 2) {\n if (points[i] !== points[i-2] || points[i+1] !== points[i-1])\n context.lineTo(points[i], points[i + 1]);\n }\n context.closePath();\n return buffer && buffer.value();\n }\n *cellPolygons() {\n const {delaunay: {points}} = this;\n for (let i = 0, n = points.length / 2; i < n; ++i) {\n const cell = this.cellPolygon(i);\n if (cell) cell.index = i, yield cell;\n }\n }\n cellPolygon(i) {\n const polygon = new Polygon;\n this.renderCell(i, polygon);\n return polygon.value();\n }\n _renderSegment(x0, y0, x1, y1, context) {\n let S;\n const c0 = this._regioncode(x0, y0);\n const c1 = this._regioncode(x1, y1);\n if (c0 === 0 && c1 === 0) {\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n } else if (S = this._clipSegment(x0, y0, x1, y1, c0, c1)) {\n context.moveTo(S[0], S[1]);\n context.lineTo(S[2], S[3]);\n }\n }\n contains(i, x, y) {\n if ((x = +x, x !== x) || (y = +y, y !== y)) return false;\n return this.delaunay._step(i, x, y) === i;\n }\n *neighbors(i) {\n const ci = this._clip(i);\n if (ci) for (const j of this.delaunay.neighbors(i)) {\n const cj = this._clip(j);\n // find the common edge\n if (cj) loop: for (let ai = 0, li = ci.length; ai < li; ai += 2) {\n for (let aj = 0, lj = cj.length; aj < lj; aj += 2) {\n if (ci[ai] === cj[aj]\n && ci[ai + 1] === cj[aj + 1]\n && ci[(ai + 2) % li] === cj[(aj + lj - 2) % lj]\n && ci[(ai + 3) % li] === cj[(aj + lj - 1) % lj]) {\n yield j;\n break loop;\n }\n }\n }\n }\n }\n _cell(i) {\n const {circumcenters, delaunay: {inedges, halfedges, triangles}} = this;\n const e0 = inedges[i];\n if (e0 === -1) return null; // coincident point\n const points = [];\n let e = e0;\n do {\n const t = Math.floor(e / 3);\n points.push(circumcenters[t * 2], circumcenters[t * 2 + 1]);\n e = e % 3 === 2 ? e - 2 : e + 1;\n if (triangles[e] !== i) break; // bad triangulation\n e = halfedges[e];\n } while (e !== e0 && e !== -1);\n return points;\n }\n _clip(i) {\n // degenerate case (1 valid point: return the box)\n if (i === 0 && this.delaunay.hull.length === 1) {\n return [this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax, this.xmin, this.ymin];\n }\n const points = this._cell(i);\n if (points === null) return null;\n const {vectors: V} = this;\n const v = i * 4;\n return this._simplify(V[v] || V[v + 1]\n ? this._clipInfinite(i, points, V[v], V[v + 1], V[v + 2], V[v + 3])\n : this._clipFinite(i, points));\n }\n _clipFinite(i, points) {\n const n = points.length;\n let P = null;\n let x0, y0, x1 = points[n - 2], y1 = points[n - 1];\n let c0, c1 = this._regioncode(x1, y1);\n let e0, e1 = 0;\n for (let j = 0; j < n; j += 2) {\n x0 = x1, y0 = y1, x1 = points[j], y1 = points[j + 1];\n c0 = c1, c1 = this._regioncode(x1, y1);\n if (c0 === 0 && c1 === 0) {\n e0 = e1, e1 = 0;\n if (P) P.push(x1, y1);\n else P = [x1, y1];\n } else {\n let S, sx0, sy0, sx1, sy1;\n if (c0 === 0) {\n if ((S = this._clipSegment(x0, y0, x1, y1, c0, c1)) === null) continue;\n [sx0, sy0, sx1, sy1] = S;\n } else {\n if ((S = this._clipSegment(x1, y1, x0, y0, c1, c0)) === null) continue;\n [sx1, sy1, sx0, sy0] = S;\n e0 = e1, e1 = this._edgecode(sx0, sy0);\n if (e0 && e1) this._edge(i, e0, e1, P, P.length);\n if (P) P.push(sx0, sy0);\n else P = [sx0, sy0];\n }\n e0 = e1, e1 = this._edgecode(sx1, sy1);\n if (e0 && e1) this._edge(i, e0, e1, P, P.length);\n if (P) P.push(sx1, sy1);\n else P = [sx1, sy1];\n }\n }\n if (P) {\n e0 = e1, e1 = this._edgecode(P[0], P[1]);\n if (e0 && e1) this._edge(i, e0, e1, P, P.length);\n } else if (this.contains(i, (this.xmin + this.xmax) / 2, (this.ymin + this.ymax) / 2)) {\n return [this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax, this.xmin, this.ymin];\n }\n return P;\n }\n _clipSegment(x0, y0, x1, y1, c0, c1) {\n // for more robustness, always consider the segment in the same order\n const flip = c0 < c1;\n if (flip) [x0, y0, x1, y1, c0, c1] = [x1, y1, x0, y0, c1, c0];\n while (true) {\n if (c0 === 0 && c1 === 0) return flip ? [x1, y1, x0, y0] : [x0, y0, x1, y1];\n if (c0 & c1) return null;\n let x, y, c = c0 || c1;\n if (c & 0b1000) x = x0 + (x1 - x0) * (this.ymax - y0) / (y1 - y0), y = this.ymax;\n else if (c & 0b0100) x = x0 + (x1 - x0) * (this.ymin - y0) / (y1 - y0), y = this.ymin;\n else if (c & 0b0010) y = y0 + (y1 - y0) * (this.xmax - x0) / (x1 - x0), x = this.xmax;\n else y = y0 + (y1 - y0) * (this.xmin - x0) / (x1 - x0), x = this.xmin;\n if (c0) x0 = x, y0 = y, c0 = this._regioncode(x0, y0);\n else x1 = x, y1 = y, c1 = this._regioncode(x1, y1);\n }\n }\n _clipInfinite(i, points, vx0, vy0, vxn, vyn) {\n let P = Array.from(points), p;\n if (p = this._project(P[0], P[1], vx0, vy0)) P.unshift(p[0], p[1]);\n if (p = this._project(P[P.length - 2], P[P.length - 1], vxn, vyn)) P.push(p[0], p[1]);\n if (P = this._clipFinite(i, P)) {\n for (let j = 0, n = P.length, c0, c1 = this._edgecode(P[n - 2], P[n - 1]); j < n; j += 2) {\n c0 = c1, c1 = this._edgecode(P[j], P[j + 1]);\n if (c0 && c1) j = this._edge(i, c0, c1, P, j), n = P.length;\n }\n } else if (this.contains(i, (this.xmin + this.xmax) / 2, (this.ymin + this.ymax) / 2)) {\n P = [this.xmin, this.ymin, this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax];\n }\n return P;\n }\n _edge(i, e0, e1, P, j) {\n while (e0 !== e1) {\n let x, y;\n switch (e0) {\n case 0b0101: e0 = 0b0100; continue; // top-left\n case 0b0100: e0 = 0b0110, x = this.xmax, y = this.ymin; break; // top\n case 0b0110: e0 = 0b0010; continue; // top-right\n case 0b0010: e0 = 0b1010, x = this.xmax, y = this.ymax; break; // right\n case 0b1010: e0 = 0b1000; continue; // bottom-right\n case 0b1000: e0 = 0b1001, x = this.xmin, y = this.ymax; break; // bottom\n case 0b1001: e0 = 0b0001; continue; // bottom-left\n case 0b0001: e0 = 0b0101, x = this.xmin, y = this.ymin; break; // left\n }\n // Note: this implicitly checks for out of bounds: if P[j] or P[j+1] are\n // undefined, the conditional statement will be executed.\n if ((P[j] !== x || P[j + 1] !== y) && this.contains(i, x, y)) {\n P.splice(j, 0, x, y), j += 2;\n }\n }\n return j;\n }\n _project(x0, y0, vx, vy) {\n let t = Infinity, c, x, y;\n if (vy < 0) { // top\n if (y0 <= this.ymin) return null;\n if ((c = (this.ymin - y0) / vy) < t) y = this.ymin, x = x0 + (t = c) * vx;\n } else if (vy > 0) { // bottom\n if (y0 >= this.ymax) return null;\n if ((c = (this.ymax - y0) / vy) < t) y = this.ymax, x = x0 + (t = c) * vx;\n }\n if (vx > 0) { // right\n if (x0 >= this.xmax) return null;\n if ((c = (this.xmax - x0) / vx) < t) x = this.xmax, y = y0 + (t = c) * vy;\n } else if (vx < 0) { // left\n if (x0 <= this.xmin) return null;\n if ((c = (this.xmin - x0) / vx) < t) x = this.xmin, y = y0 + (t = c) * vy;\n }\n return [x, y];\n }\n _edgecode(x, y) {\n return (x === this.xmin ? 0b0001\n : x === this.xmax ? 0b0010 : 0b0000)\n | (y === this.ymin ? 0b0100\n : y === this.ymax ? 0b1000 : 0b0000);\n }\n _regioncode(x, y) {\n return (x < this.xmin ? 0b0001\n : x > this.xmax ? 0b0010 : 0b0000)\n | (y < this.ymin ? 0b0100\n : y > this.ymax ? 0b1000 : 0b0000);\n }\n _simplify(P) {\n if (P && P.length > 4) {\n for (let i = 0; i < P.length; i+= 2) {\n const j = (i + 2) % P.length, k = (i + 4) % P.length;\n if (P[i] === P[j] && P[j] === P[k] || P[i + 1] === P[j + 1] && P[j + 1] === P[k + 1]) {\n P.splice(j, 2), i -= 2;\n }\n }\n if (!P.length) P = null;\n }\n return P;\n }\n}\n","import Delaunator from \"delaunator\";\nimport Path from \"./path.js\";\nimport Polygon from \"./polygon.js\";\nimport Voronoi from \"./voronoi.js\";\n\nconst tau = 2 * Math.PI, pow = Math.pow;\n\nfunction pointX(p) {\n return p[0];\n}\n\nfunction pointY(p) {\n return p[1];\n}\n\n// A triangulation is collinear if all its triangles have a non-null area\nfunction collinear(d) {\n const {triangles, coords} = d;\n for (let i = 0; i < triangles.length; i += 3) {\n const a = 2 * triangles[i],\n b = 2 * triangles[i + 1],\n c = 2 * triangles[i + 2],\n cross = (coords[c] - coords[a]) * (coords[b + 1] - coords[a + 1])\n - (coords[b] - coords[a]) * (coords[c + 1] - coords[a + 1]);\n if (cross > 1e-10) return false;\n }\n return true;\n}\n\nfunction jitter(x, y, r) {\n return [x + Math.sin(x + y) * r, y + Math.cos(x - y) * r];\n}\n\nexport default class Delaunay {\n static from(points, fx = pointX, fy = pointY, that) {\n return new Delaunay(\"length\" in points\n ? flatArray(points, fx, fy, that)\n : Float64Array.from(flatIterable(points, fx, fy, that)));\n }\n constructor(points) {\n this._delaunator = new Delaunator(points);\n this.inedges = new Int32Array(points.length / 2);\n this._hullIndex = new Int32Array(points.length / 2);\n this.points = this._delaunator.coords;\n this._init();\n }\n update() {\n this._delaunator.update();\n this._init();\n return this;\n }\n _init() {\n const d = this._delaunator, points = this.points;\n\n // check for collinear\n if (d.hull && d.hull.length > 2 && collinear(d)) {\n this.collinear = Int32Array.from({length: points.length/2}, (_,i) => i)\n .sort((i, j) => points[2 * i] - points[2 * j] || points[2 * i + 1] - points[2 * j + 1]); // for exact neighbors\n const e = this.collinear[0], f = this.collinear[this.collinear.length - 1],\n bounds = [ points[2 * e], points[2 * e + 1], points[2 * f], points[2 * f + 1] ],\n r = 1e-8 * Math.hypot(bounds[3] - bounds[1], bounds[2] - bounds[0]);\n for (let i = 0, n = points.length / 2; i < n; ++i) {\n const p = jitter(points[2 * i], points[2 * i + 1], r);\n points[2 * i] = p[0];\n points[2 * i + 1] = p[1];\n }\n this._delaunator = new Delaunator(points);\n } else {\n delete this.collinear;\n }\n\n const halfedges = this.halfedges = this._delaunator.halfedges;\n const hull = this.hull = this._delaunator.hull;\n const triangles = this.triangles = this._delaunator.triangles;\n const inedges = this.inedges.fill(-1);\n const hullIndex = this._hullIndex.fill(-1);\n\n // Compute an index from each point to an (arbitrary) incoming halfedge\n // Used to give the first neighbor of each point; for this reason,\n // on the hull we give priority to exterior halfedges\n for (let e = 0, n = halfedges.length; e < n; ++e) {\n const p = triangles[e % 3 === 2 ? e - 2 : e + 1];\n if (halfedges[e] === -1 || inedges[p] === -1) inedges[p] = e;\n }\n for (let i = 0, n = hull.length; i < n; ++i) {\n hullIndex[hull[i]] = i;\n }\n\n // degenerate case: 1 or 2 (distinct) points\n if (hull.length <= 2 && hull.length > 0) {\n this.triangles = new Int32Array(3).fill(-1);\n this.halfedges = new Int32Array(3).fill(-1);\n this.triangles[0] = hull[0];\n inedges[hull[0]] = 1;\n if (hull.length === 2) {\n inedges[hull[1]] = 0;\n this.triangles[1] = hull[1];\n this.triangles[2] = hull[1];\n }\n }\n }\n voronoi(bounds) {\n return new Voronoi(this, bounds);\n }\n *neighbors(i) {\n const {inedges, hull, _hullIndex, halfedges, triangles, collinear} = this;\n\n // degenerate case with several collinear points\n if (collinear) {\n const l = collinear.indexOf(i);\n if (l > 0) yield collinear[l - 1];\n if (l < collinear.length - 1) yield collinear[l + 1];\n return;\n }\n\n const e0 = inedges[i];\n if (e0 === -1) return; // coincident point\n let e = e0, p0 = -1;\n do {\n yield p0 = triangles[e];\n e = e % 3 === 2 ? e - 2 : e + 1;\n if (triangles[e] !== i) return; // bad triangulation\n e = halfedges[e];\n if (e === -1) {\n const p = hull[(_hullIndex[i] + 1) % hull.length];\n if (p !== p0) yield p;\n return;\n }\n } while (e !== e0);\n }\n find(x, y, i = 0) {\n if ((x = +x, x !== x) || (y = +y, y !== y)) return -1;\n const i0 = i;\n let c;\n while ((c = this._step(i, x, y)) >= 0 && c !== i && c !== i0) i = c;\n return c;\n }\n _step(i, x, y) {\n const {inedges, hull, _hullIndex, halfedges, triangles, points} = this;\n if (inedges[i] === -1 || !points.length) return (i + 1) % (points.length >> 1);\n let c = i;\n let dc = pow(x - points[i * 2], 2) + pow(y - points[i * 2 + 1], 2);\n const e0 = inedges[i];\n let e = e0;\n do {\n let t = triangles[e];\n const dt = pow(x - points[t * 2], 2) + pow(y - points[t * 2 + 1], 2);\n if (dt < dc) dc = dt, c = t;\n e = e % 3 === 2 ? e - 2 : e + 1;\n if (triangles[e] !== i) break; // bad triangulation\n e = halfedges[e];\n if (e === -1) {\n e = hull[(_hullIndex[i] + 1) % hull.length];\n if (e !== t) {\n if (pow(x - points[e * 2], 2) + pow(y - points[e * 2 + 1], 2) < dc) return e;\n }\n break;\n }\n } while (e !== e0);\n return c;\n }\n render(context) {\n const buffer = context == null ? context = new Path : undefined;\n const {points, halfedges, triangles} = this;\n for (let i = 0, n = halfedges.length; i < n; ++i) {\n const j = halfedges[i];\n if (j < i) continue;\n const ti = triangles[i] * 2;\n const tj = triangles[j] * 2;\n context.moveTo(points[ti], points[ti + 1]);\n context.lineTo(points[tj], points[tj + 1]);\n }\n this.renderHull(context);\n return buffer && buffer.value();\n }\n renderPoints(context, r) {\n if (r === undefined && (!context || typeof context.moveTo !== \"function\")) r = context, context = null;\n r = r == undefined ? 2 : +r;\n const buffer = context == null ? context = new Path : undefined;\n const {points} = this;\n for (let i = 0, n = points.length; i < n; i += 2) {\n const x = points[i], y = points[i + 1];\n context.moveTo(x + r, y);\n context.arc(x, y, r, 0, tau);\n }\n return buffer && buffer.value();\n }\n renderHull(context) {\n const buffer = context == null ? context = new Path : undefined;\n const {hull, points} = this;\n const h = hull[0] * 2, n = hull.length;\n context.moveTo(points[h], points[h + 1]);\n for (let i = 1; i < n; ++i) {\n const h = 2 * hull[i];\n context.lineTo(points[h], points[h + 1]);\n }\n context.closePath();\n return buffer && buffer.value();\n }\n hullPolygon() {\n const polygon = new Polygon;\n this.renderHull(polygon);\n return polygon.value();\n }\n renderTriangle(i, context) {\n const buffer = context == null ? context = new Path : undefined;\n const {points, triangles} = this;\n const t0 = triangles[i *= 3] * 2;\n const t1 = triangles[i + 1] * 2;\n const t2 = triangles[i + 2] * 2;\n context.moveTo(points[t0], points[t0 + 1]);\n context.lineTo(points[t1], points[t1 + 1]);\n context.lineTo(points[t2], points[t2 + 1]);\n context.closePath();\n return buffer && buffer.value();\n }\n *trianglePolygons() {\n const {triangles} = this;\n for (let i = 0, n = triangles.length / 3; i < n; ++i) {\n yield this.trianglePolygon(i);\n }\n }\n trianglePolygon(i) {\n const polygon = new Polygon;\n this.renderTriangle(i, polygon);\n return polygon.value();\n }\n}\n\nfunction flatArray(points, fx, fy, that) {\n const n = points.length;\n const array = new Float64Array(n * 2);\n for (let i = 0; i < n; ++i) {\n const p = points[i];\n array[i * 2] = fx.call(that, p, i, points);\n array[i * 2 + 1] = fy.call(that, p, i, points);\n }\n return array;\n}\n\nfunction* flatIterable(points, fx, fy, that) {\n let i = 0;\n for (const p of points) {\n yield fx.call(that, p, i, points);\n yield fy.call(that, p, i, points);\n ++i;\n }\n}\n","import { Transform } from 'vega-dataflow';\nimport { inherits } from 'vega-util';\nimport { Delaunay } from 'd3-delaunay';\n\nfunction Voronoi(params) {\n Transform.call(this, null, params);\n}\nVoronoi.Definition = {\n 'type': 'Voronoi',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'extent',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'default': [[-1e5, -1e5], [1e5, 1e5]],\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'path'\n }]\n};\nconst defaultExtent = [-1e5, -1e5, 1e5, 1e5];\ninherits(Voronoi, Transform, {\n transform(_, pulse) {\n const as = _.as || 'path',\n data = pulse.source;\n\n // nothing to do if no data\n if (!data || !data.length) return pulse;\n\n // configure and construct voronoi diagram\n let s = _.size;\n s = s ? [0, 0, s[0], s[1]] : (s = _.extent) ? [s[0][0], s[0][1], s[1][0], s[1][1]] : defaultExtent;\n const voronoi = this.value = Delaunay.from(data, _.x, _.y).voronoi(s);\n\n // map polygons to paths\n for (let i = 0, n = data.length; i < n; ++i) {\n const polygon = voronoi.cellPolygon(i);\n data[i][as] = polygon && !isPoint(polygon) ? toPathString(polygon) : null;\n }\n return pulse.reflow(_.modified()).modifies(as);\n }\n});\n\n// suppress duplicated end point vertices\nfunction toPathString(p) {\n const x = p[0][0],\n y = p[0][1];\n let n = p.length - 1;\n for (; p[n][0] === x && p[n][1] === y; --n);\n return 'M' + p.slice(0, n + 1).join('L') + 'Z';\n}\nfunction isPoint(p) {\n return p.length === 2 && p[0][0] === p[1][0] && p[0][1] === p[1][1];\n}\n\nexport { Voronoi as voronoi };\n","import { canvas } from 'vega-canvas';\nimport { Transform } from 'vega-dataflow';\nimport { inherits, error, isFunction, constant, extent } from 'vega-util';\nimport { scale } from 'vega-scale';\nimport { random } from 'vega-statistics';\n\n/*\nCopyright (c) 2013, Jason Davies.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n * The name Jason Davies may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL JASON DAVIES BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\nOR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\nADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n// Word cloud layout by Jason Davies, https://www.jasondavies.com/wordcloud/\n// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf\n\nvar cloudRadians = Math.PI / 180,\n cw = 1 << 11 >> 5,\n ch = 1 << 11;\nfunction cloud () {\n var size = [256, 256],\n text,\n font,\n fontSize,\n fontStyle,\n fontWeight,\n rotate,\n padding,\n spiral = archimedeanSpiral,\n words = [],\n random = Math.random,\n cloud = {};\n cloud.layout = function () {\n var contextAndRatio = getContext(canvas()),\n board = zeroArray((size[0] >> 5) * size[1]),\n bounds = null,\n n = words.length,\n i = -1,\n tags = [],\n data = words.map(d => ({\n text: text(d),\n font: font(d),\n style: fontStyle(d),\n weight: fontWeight(d),\n rotate: rotate(d),\n size: ~~(fontSize(d) + 1e-14),\n padding: padding(d),\n xoff: 0,\n yoff: 0,\n x1: 0,\n y1: 0,\n x0: 0,\n y0: 0,\n hasText: false,\n sprite: null,\n datum: d\n })).sort((a, b) => b.size - a.size);\n while (++i < n) {\n var d = data[i];\n d.x = size[0] * (random() + .5) >> 1;\n d.y = size[1] * (random() + .5) >> 1;\n cloudSprite(contextAndRatio, d, data, i);\n if (d.hasText && place(board, d, bounds)) {\n tags.push(d);\n if (bounds) cloudBounds(bounds, d);else bounds = [{\n x: d.x + d.x0,\n y: d.y + d.y0\n }, {\n x: d.x + d.x1,\n y: d.y + d.y1\n }];\n // Temporary hack\n d.x -= size[0] >> 1;\n d.y -= size[1] >> 1;\n }\n }\n return tags;\n };\n function getContext(canvas) {\n canvas.width = canvas.height = 1;\n var ratio = Math.sqrt(canvas.getContext('2d').getImageData(0, 0, 1, 1).data.length >> 2);\n canvas.width = (cw << 5) / ratio;\n canvas.height = ch / ratio;\n var context = canvas.getContext('2d');\n context.fillStyle = context.strokeStyle = 'red';\n context.textAlign = 'center';\n return {\n context: context,\n ratio: ratio\n };\n }\n function place(board, tag, bounds) {\n var startX = tag.x,\n startY = tag.y,\n maxDelta = Math.hypot(size[0], size[1]),\n s = spiral(size),\n dt = random() < .5 ? 1 : -1,\n t = -dt,\n dxdy,\n dx,\n dy;\n while (dxdy = s(t += dt)) {\n dx = ~~dxdy[0];\n dy = ~~dxdy[1];\n if (Math.min(Math.abs(dx), Math.abs(dy)) >= maxDelta) break;\n tag.x = startX + dx;\n tag.y = startY + dy;\n if (tag.x + tag.x0 < 0 || tag.y + tag.y0 < 0 || tag.x + tag.x1 > size[0] || tag.y + tag.y1 > size[1]) continue;\n // TODO only check for collisions within current bounds.\n if (!bounds || !cloudCollide(tag, board, size[0])) {\n if (!bounds || collideRects(tag, bounds)) {\n var sprite = tag.sprite,\n w = tag.width >> 5,\n sw = size[0] >> 5,\n lx = tag.x - (w << 4),\n sx = lx & 0x7f,\n msx = 32 - sx,\n h = tag.y1 - tag.y0,\n x = (tag.y + tag.y0) * sw + (lx >> 5),\n last;\n for (var j = 0; j < h; j++) {\n last = 0;\n for (var i = 0; i <= w; i++) {\n board[x + i] |= last << msx | (i < w ? (last = sprite[j * w + i]) >>> sx : 0);\n }\n x += sw;\n }\n tag.sprite = null;\n return true;\n }\n }\n }\n return false;\n }\n cloud.words = function (_) {\n if (arguments.length) {\n words = _;\n return cloud;\n } else {\n return words;\n }\n };\n cloud.size = function (_) {\n if (arguments.length) {\n size = [+_[0], +_[1]];\n return cloud;\n } else {\n return size;\n }\n };\n cloud.font = function (_) {\n if (arguments.length) {\n font = functor(_);\n return cloud;\n } else {\n return font;\n }\n };\n cloud.fontStyle = function (_) {\n if (arguments.length) {\n fontStyle = functor(_);\n return cloud;\n } else {\n return fontStyle;\n }\n };\n cloud.fontWeight = function (_) {\n if (arguments.length) {\n fontWeight = functor(_);\n return cloud;\n } else {\n return fontWeight;\n }\n };\n cloud.rotate = function (_) {\n if (arguments.length) {\n rotate = functor(_);\n return cloud;\n } else {\n return rotate;\n }\n };\n cloud.text = function (_) {\n if (arguments.length) {\n text = functor(_);\n return cloud;\n } else {\n return text;\n }\n };\n cloud.spiral = function (_) {\n if (arguments.length) {\n spiral = spirals[_] || _;\n return cloud;\n } else {\n return spiral;\n }\n };\n cloud.fontSize = function (_) {\n if (arguments.length) {\n fontSize = functor(_);\n return cloud;\n } else {\n return fontSize;\n }\n };\n cloud.padding = function (_) {\n if (arguments.length) {\n padding = functor(_);\n return cloud;\n } else {\n return padding;\n }\n };\n cloud.random = function (_) {\n if (arguments.length) {\n random = _;\n return cloud;\n } else {\n return random;\n }\n };\n return cloud;\n}\n\n// Fetches a monochrome sprite bitmap for the specified text.\n// Load in batches for speed.\nfunction cloudSprite(contextAndRatio, d, data, di) {\n if (d.sprite) return;\n var c = contextAndRatio.context,\n ratio = contextAndRatio.ratio;\n c.clearRect(0, 0, (cw << 5) / ratio, ch / ratio);\n var x = 0,\n y = 0,\n maxh = 0,\n n = data.length,\n w,\n w32,\n h,\n i,\n j;\n --di;\n while (++di < n) {\n d = data[di];\n c.save();\n c.font = d.style + ' ' + d.weight + ' ' + ~~((d.size + 1) / ratio) + 'px ' + d.font;\n w = c.measureText(d.text + 'm').width * ratio;\n h = d.size << 1;\n if (d.rotate) {\n var sr = Math.sin(d.rotate * cloudRadians),\n cr = Math.cos(d.rotate * cloudRadians),\n wcr = w * cr,\n wsr = w * sr,\n hcr = h * cr,\n hsr = h * sr;\n w = Math.max(Math.abs(wcr + hsr), Math.abs(wcr - hsr)) + 0x1f >> 5 << 5;\n h = ~~Math.max(Math.abs(wsr + hcr), Math.abs(wsr - hcr));\n } else {\n w = w + 0x1f >> 5 << 5;\n }\n if (h > maxh) maxh = h;\n if (x + w >= cw << 5) {\n x = 0;\n y += maxh;\n maxh = 0;\n }\n if (y + h >= ch) break;\n c.translate((x + (w >> 1)) / ratio, (y + (h >> 1)) / ratio);\n if (d.rotate) c.rotate(d.rotate * cloudRadians);\n c.fillText(d.text, 0, 0);\n if (d.padding) {\n c.lineWidth = 2 * d.padding;\n c.strokeText(d.text, 0, 0);\n }\n c.restore();\n d.width = w;\n d.height = h;\n d.xoff = x;\n d.yoff = y;\n d.x1 = w >> 1;\n d.y1 = h >> 1;\n d.x0 = -d.x1;\n d.y0 = -d.y1;\n d.hasText = true;\n x += w;\n }\n var pixels = c.getImageData(0, 0, (cw << 5) / ratio, ch / ratio).data,\n sprite = [];\n while (--di >= 0) {\n d = data[di];\n if (!d.hasText) continue;\n w = d.width;\n w32 = w >> 5;\n h = d.y1 - d.y0;\n // Zero the buffer\n for (i = 0; i < h * w32; i++) sprite[i] = 0;\n x = d.xoff;\n if (x == null) return;\n y = d.yoff;\n var seen = 0,\n seenRow = -1;\n for (j = 0; j < h; j++) {\n for (i = 0; i < w; i++) {\n var k = w32 * j + (i >> 5),\n m = pixels[(y + j) * (cw << 5) + (x + i) << 2] ? 1 << 31 - i % 32 : 0;\n sprite[k] |= m;\n seen |= m;\n }\n if (seen) seenRow = j;else {\n d.y0++;\n h--;\n j--;\n y++;\n }\n }\n d.y1 = d.y0 + seenRow;\n d.sprite = sprite.slice(0, (d.y1 - d.y0) * w32);\n }\n}\n\n// Use mask-based collision detection.\nfunction cloudCollide(tag, board, sw) {\n sw >>= 5;\n var sprite = tag.sprite,\n w = tag.width >> 5,\n lx = tag.x - (w << 4),\n sx = lx & 0x7f,\n msx = 32 - sx,\n h = tag.y1 - tag.y0,\n x = (tag.y + tag.y0) * sw + (lx >> 5),\n last;\n for (var j = 0; j < h; j++) {\n last = 0;\n for (var i = 0; i <= w; i++) {\n if ((last << msx | (i < w ? (last = sprite[j * w + i]) >>> sx : 0)) & board[x + i]) return true;\n }\n x += sw;\n }\n return false;\n}\nfunction cloudBounds(bounds, d) {\n var b0 = bounds[0],\n b1 = bounds[1];\n if (d.x + d.x0 < b0.x) b0.x = d.x + d.x0;\n if (d.y + d.y0 < b0.y) b0.y = d.y + d.y0;\n if (d.x + d.x1 > b1.x) b1.x = d.x + d.x1;\n if (d.y + d.y1 > b1.y) b1.y = d.y + d.y1;\n}\nfunction collideRects(a, b) {\n return a.x + a.x1 > b[0].x && a.x + a.x0 < b[1].x && a.y + a.y1 > b[0].y && a.y + a.y0 < b[1].y;\n}\nfunction archimedeanSpiral(size) {\n var e = size[0] / size[1];\n return function (t) {\n return [e * (t *= .1) * Math.cos(t), t * Math.sin(t)];\n };\n}\nfunction rectangularSpiral(size) {\n var dy = 4,\n dx = dy * size[0] / size[1],\n x = 0,\n y = 0;\n return function (t) {\n var sign = t < 0 ? -1 : 1;\n // See triangular numbers: T_n = n * (n + 1) / 2.\n switch (Math.sqrt(1 + 4 * sign * t) - sign & 3) {\n case 0:\n x += dx;\n break;\n case 1:\n y += dy;\n break;\n case 2:\n x -= dx;\n break;\n default:\n y -= dy;\n break;\n }\n return [x, y];\n };\n}\n\n// TODO reuse arrays?\nfunction zeroArray(n) {\n var a = [],\n i = -1;\n while (++i < n) a[i] = 0;\n return a;\n}\nfunction functor(d) {\n return typeof d === 'function' ? d : function () {\n return d;\n };\n}\nvar spirals = {\n archimedean: archimedeanSpiral,\n rectangular: rectangularSpiral\n};\n\nconst Output = ['x', 'y', 'font', 'fontSize', 'fontStyle', 'fontWeight', 'angle'];\nconst Params = ['text', 'font', 'rotate', 'fontSize', 'fontStyle', 'fontWeight'];\nfunction Wordcloud(params) {\n Transform.call(this, cloud(), params);\n}\nWordcloud.Definition = {\n 'type': 'Wordcloud',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'font',\n 'type': 'string',\n 'expr': true,\n 'default': 'sans-serif'\n }, {\n 'name': 'fontStyle',\n 'type': 'string',\n 'expr': true,\n 'default': 'normal'\n }, {\n 'name': 'fontWeight',\n 'type': 'string',\n 'expr': true,\n 'default': 'normal'\n }, {\n 'name': 'fontSize',\n 'type': 'number',\n 'expr': true,\n 'default': 14\n }, {\n 'name': 'fontSizeRange',\n 'type': 'number',\n 'array': 'nullable',\n 'default': [10, 50]\n }, {\n 'name': 'rotate',\n 'type': 'number',\n 'expr': true,\n 'default': 0\n }, {\n 'name': 'text',\n 'type': 'field'\n }, {\n 'name': 'spiral',\n 'type': 'string',\n 'values': ['archimedean', 'rectangular']\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 7,\n 'default': Output\n }]\n};\ninherits(Wordcloud, Transform, {\n transform(_, pulse) {\n if (_.size && !(_.size[0] && _.size[1])) {\n error('Wordcloud size dimensions must be non-zero.');\n }\n function modp(param) {\n const p = _[param];\n return isFunction(p) && pulse.modified(p.fields);\n }\n const mod = _.modified();\n if (!(mod || pulse.changed(pulse.ADD_REM) || Params.some(modp))) return;\n const data = pulse.materialize(pulse.SOURCE).source,\n layout = this.value,\n as = _.as || Output;\n let fontSize = _.fontSize || 14,\n range;\n isFunction(fontSize) ? range = _.fontSizeRange : fontSize = constant(fontSize);\n\n // create font size scaling function as needed\n if (range) {\n const fsize = fontSize,\n sizeScale = scale('sqrt')().domain(extent(data, fsize)).range(range);\n fontSize = x => sizeScale(fsize(x));\n }\n data.forEach(t => {\n t[as[0]] = NaN;\n t[as[1]] = NaN;\n t[as[3]] = 0;\n });\n\n // configure layout\n const words = layout.words(data).text(_.text).size(_.size || [500, 500]).padding(_.padding || 1).spiral(_.spiral || 'archimedean').rotate(_.rotate || 0).font(_.font || 'sans-serif').fontStyle(_.fontStyle || 'normal').fontWeight(_.fontWeight || 'normal').fontSize(fontSize).random(random).layout();\n const size = layout.size(),\n dx = size[0] >> 1,\n dy = size[1] >> 1,\n n = words.length;\n for (let i = 0, w, t; i < n; ++i) {\n w = words[i];\n t = w.datum;\n t[as[0]] = w.x + dx;\n t[as[1]] = w.y + dy;\n t[as[2]] = w.font;\n t[as[3]] = w.size;\n t[as[4]] = w.style;\n t[as[5]] = w.weight;\n t[as[6]] = w.rotate;\n }\n return pulse.reflow(mod).modifies(as);\n }\n});\n\nexport { Wordcloud as wordcloud };\n","import { bisectLeft, bisectRight, permute } from 'd3-array';\nimport { Transform } from 'vega-dataflow';\nimport { inherits } from 'vega-util';\n\nconst array8 = n => new Uint8Array(n);\nconst array16 = n => new Uint16Array(n);\nconst array32 = n => new Uint32Array(n);\n\n/**\n * Maintains CrossFilter state.\n */\nfunction Bitmaps() {\n let width = 8,\n data = [],\n seen = array32(0),\n curr = array(0, width),\n prev = array(0, width);\n return {\n data: () => data,\n seen: () => seen = lengthen(seen, data.length),\n add(array) {\n for (let i = 0, j = data.length, n = array.length, t; i < n; ++i) {\n t = array[i];\n t._index = j++;\n data.push(t);\n }\n },\n remove(num, map) {\n // map: index -> boolean (true => remove)\n const n = data.length,\n copy = Array(n - num),\n reindex = data; // reuse old data array for index map\n let t, i, j;\n\n // seek forward to first removal\n for (i = 0; !map[i] && i < n; ++i) {\n copy[i] = data[i];\n reindex[i] = i;\n }\n\n // condense arrays\n for (j = i; i < n; ++i) {\n t = data[i];\n if (!map[i]) {\n reindex[i] = j;\n curr[j] = curr[i];\n prev[j] = prev[i];\n copy[j] = t;\n t._index = j++;\n } else {\n reindex[i] = -1;\n }\n curr[i] = 0; // clear unused bits\n }\n data = copy;\n return reindex;\n },\n size: () => data.length,\n curr: () => curr,\n prev: () => prev,\n reset: k => prev[k] = curr[k],\n all: () => width < 0x101 ? 0xff : width < 0x10001 ? 0xffff : 0xffffffff,\n set(k, one) {\n curr[k] |= one;\n },\n clear(k, one) {\n curr[k] &= ~one;\n },\n resize(n, m) {\n const k = curr.length;\n if (n > k || m > width) {\n width = Math.max(m, width);\n curr = array(n, width, curr);\n prev = array(n, width);\n }\n }\n };\n}\nfunction lengthen(array, length, copy) {\n if (array.length >= length) return array;\n copy = copy || new array.constructor(length);\n copy.set(array);\n return copy;\n}\nfunction array(n, m, array) {\n const copy = (m < 0x101 ? array8 : m < 0x10001 ? array16 : array32)(n);\n if (array) copy.set(array);\n return copy;\n}\n\nfunction Dimension (index, i, query) {\n const bit = 1 << i;\n return {\n one: bit,\n zero: ~bit,\n range: query.slice(),\n bisect: index.bisect,\n index: index.index,\n size: index.size,\n onAdd(added, curr) {\n const dim = this,\n range = dim.bisect(dim.range, added.value),\n idx = added.index,\n lo = range[0],\n hi = range[1],\n n1 = idx.length;\n let i;\n for (i = 0; i < lo; ++i) curr[idx[i]] |= bit;\n for (i = hi; i < n1; ++i) curr[idx[i]] |= bit;\n return dim;\n }\n };\n}\n\n/**\n * Maintains a list of values, sorted by key.\n */\nfunction SortedIndex() {\n let index = array32(0),\n value = [],\n size = 0;\n function insert(key, data, base) {\n if (!data.length) return [];\n const n0 = size,\n n1 = data.length,\n addi = array32(n1);\n let addv = Array(n1),\n oldv,\n oldi,\n i;\n for (i = 0; i < n1; ++i) {\n addv[i] = key(data[i]);\n addi[i] = i;\n }\n addv = sort(addv, addi);\n if (n0) {\n oldv = value;\n oldi = index;\n value = Array(n0 + n1);\n index = array32(n0 + n1);\n merge(base, oldv, oldi, n0, addv, addi, n1, value, index);\n } else {\n if (base > 0) for (i = 0; i < n1; ++i) {\n addi[i] += base;\n }\n value = addv;\n index = addi;\n }\n size = n0 + n1;\n return {\n index: addi,\n value: addv\n };\n }\n function remove(num, map) {\n // map: index -> remove\n const n = size;\n let idx, i, j;\n\n // seek forward to first removal\n for (i = 0; !map[index[i]] && i < n; ++i);\n\n // condense index and value arrays\n for (j = i; i < n; ++i) {\n if (!map[idx = index[i]]) {\n index[j] = idx;\n value[j] = value[i];\n ++j;\n }\n }\n size = n - num;\n }\n function reindex(map) {\n for (let i = 0, n = size; i < n; ++i) {\n index[i] = map[index[i]];\n }\n }\n function bisect(range, array) {\n let n;\n if (array) {\n n = array.length;\n } else {\n array = value;\n n = size;\n }\n return [bisectLeft(array, range[0], 0, n), bisectRight(array, range[1], 0, n)];\n }\n return {\n insert: insert,\n remove: remove,\n bisect: bisect,\n reindex: reindex,\n index: () => index,\n size: () => size\n };\n}\nfunction sort(values, index) {\n values.sort.call(index, (a, b) => {\n const x = values[a],\n y = values[b];\n return x < y ? -1 : x > y ? 1 : 0;\n });\n return permute(values, index);\n}\nfunction merge(base, value0, index0, n0, value1, index1, n1, value, index) {\n let i0 = 0,\n i1 = 0,\n i;\n for (i = 0; i0 < n0 && i1 < n1; ++i) {\n if (value0[i0] < value1[i1]) {\n value[i] = value0[i0];\n index[i] = index0[i0++];\n } else {\n value[i] = value1[i1];\n index[i] = index1[i1++] + base;\n }\n }\n for (; i0 < n0; ++i0, ++i) {\n value[i] = value0[i0];\n index[i] = index0[i0];\n }\n for (; i1 < n1; ++i1, ++i) {\n value[i] = value1[i1];\n index[i] = index1[i1] + base;\n }\n}\n\n/**\n * An indexed multi-dimensional filter.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - An array of dimension accessors to filter.\n * @param {Array} params.query - An array of per-dimension range queries.\n */\nfunction CrossFilter(params) {\n Transform.call(this, Bitmaps(), params);\n this._indices = null;\n this._dims = null;\n}\nCrossFilter.Definition = {\n 'type': 'CrossFilter',\n 'metadata': {},\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'query',\n 'type': 'array',\n 'array': true,\n 'required': true,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }]\n};\ninherits(CrossFilter, Transform, {\n transform(_, pulse) {\n if (!this._dims) {\n return this.init(_, pulse);\n } else {\n var init = _.modified('fields') || _.fields.some(f => pulse.modified(f.fields));\n return init ? this.reinit(_, pulse) : this.eval(_, pulse);\n }\n },\n init(_, pulse) {\n const fields = _.fields,\n query = _.query,\n indices = this._indices = {},\n dims = this._dims = [],\n m = query.length;\n let i = 0,\n key,\n index;\n\n // instantiate indices and dimensions\n for (; i < m; ++i) {\n key = fields[i].fname;\n index = indices[key] || (indices[key] = SortedIndex());\n dims.push(Dimension(index, i, query[i]));\n }\n return this.eval(_, pulse);\n },\n reinit(_, pulse) {\n const output = pulse.materialize().fork(),\n fields = _.fields,\n query = _.query,\n indices = this._indices,\n dims = this._dims,\n bits = this.value,\n curr = bits.curr(),\n prev = bits.prev(),\n all = bits.all(),\n out = output.rem = output.add,\n mod = output.mod,\n m = query.length,\n adds = {};\n let add, index, key, mods, remMap, modMap, i, n, f;\n\n // set prev to current state\n prev.set(curr);\n\n // if pulse has remove tuples, process them first\n if (pulse.rem.length) {\n remMap = this.remove(_, pulse, output);\n }\n\n // if pulse has added tuples, add them to state\n if (pulse.add.length) {\n bits.add(pulse.add);\n }\n\n // if pulse has modified tuples, create an index map\n if (pulse.mod.length) {\n modMap = {};\n for (mods = pulse.mod, i = 0, n = mods.length; i < n; ++i) {\n modMap[mods[i]._index] = 1;\n }\n }\n\n // re-initialize indices as needed, update curr bitmap\n for (i = 0; i < m; ++i) {\n f = fields[i];\n if (!dims[i] || _.modified('fields', i) || pulse.modified(f.fields)) {\n key = f.fname;\n if (!(add = adds[key])) {\n indices[key] = index = SortedIndex();\n adds[key] = add = index.insert(f, pulse.source, 0);\n }\n dims[i] = Dimension(index, i, query[i]).onAdd(add, curr);\n }\n }\n\n // visit each tuple\n // if filter state changed, push index to add/rem\n // else if in mod and passes a filter, push index to mod\n for (i = 0, n = bits.data().length; i < n; ++i) {\n if (remMap[i]) {\n // skip if removed tuple\n continue;\n } else if (prev[i] !== curr[i]) {\n // add if state changed\n out.push(i);\n } else if (modMap[i] && curr[i] !== all) {\n // otherwise, pass mods through\n mod.push(i);\n }\n }\n bits.mask = (1 << m) - 1;\n return output;\n },\n eval(_, pulse) {\n const output = pulse.materialize().fork(),\n m = this._dims.length;\n let mask = 0;\n if (pulse.rem.length) {\n this.remove(_, pulse, output);\n mask |= (1 << m) - 1;\n }\n if (_.modified('query') && !_.modified('fields')) {\n mask |= this.update(_, pulse, output);\n }\n if (pulse.add.length) {\n this.insert(_, pulse, output);\n mask |= (1 << m) - 1;\n }\n if (pulse.mod.length) {\n this.modify(pulse, output);\n mask |= (1 << m) - 1;\n }\n this.value.mask = mask;\n return output;\n },\n insert(_, pulse, output) {\n const tuples = pulse.add,\n bits = this.value,\n dims = this._dims,\n indices = this._indices,\n fields = _.fields,\n adds = {},\n out = output.add,\n n = bits.size() + tuples.length,\n m = dims.length;\n let k = bits.size(),\n j,\n key,\n add;\n\n // resize bitmaps and add tuples as needed\n bits.resize(n, m);\n bits.add(tuples);\n const curr = bits.curr(),\n prev = bits.prev(),\n all = bits.all();\n\n // add to dimensional indices\n for (j = 0; j < m; ++j) {\n key = fields[j].fname;\n add = adds[key] || (adds[key] = indices[key].insert(fields[j], tuples, k));\n dims[j].onAdd(add, curr);\n }\n\n // set previous filters, output if passes at least one filter\n for (; k < n; ++k) {\n prev[k] = all;\n if (curr[k] !== all) out.push(k);\n }\n },\n modify(pulse, output) {\n const out = output.mod,\n bits = this.value,\n curr = bits.curr(),\n all = bits.all(),\n tuples = pulse.mod;\n let i, n, k;\n for (i = 0, n = tuples.length; i < n; ++i) {\n k = tuples[i]._index;\n if (curr[k] !== all) out.push(k);\n }\n },\n remove(_, pulse, output) {\n const indices = this._indices,\n bits = this.value,\n curr = bits.curr(),\n prev = bits.prev(),\n all = bits.all(),\n map = {},\n out = output.rem,\n tuples = pulse.rem;\n let i, n, k, f;\n\n // process tuples, output if passes at least one filter\n for (i = 0, n = tuples.length; i < n; ++i) {\n k = tuples[i]._index;\n map[k] = 1; // build index map\n prev[k] = f = curr[k];\n curr[k] = all;\n if (f !== all) out.push(k);\n }\n\n // remove from dimensional indices\n for (k in indices) {\n indices[k].remove(n, map);\n }\n this.reindex(pulse, n, map);\n return map;\n },\n // reindex filters and indices after propagation completes\n reindex(pulse, num, map) {\n const indices = this._indices,\n bits = this.value;\n pulse.runAfter(() => {\n const indexMap = bits.remove(num, map);\n for (const key in indices) indices[key].reindex(indexMap);\n });\n },\n update(_, pulse, output) {\n const dims = this._dims,\n query = _.query,\n stamp = pulse.stamp,\n m = dims.length;\n let mask = 0,\n i,\n q;\n\n // survey how many queries have changed\n output.filters = 0;\n for (q = 0; q < m; ++q) {\n if (_.modified('query', q)) {\n i = q;\n ++mask;\n }\n }\n if (mask === 1) {\n // only one query changed, use more efficient update\n mask = dims[i].one;\n this.incrementOne(dims[i], query[i], output.add, output.rem);\n } else {\n // multiple queries changed, perform full record keeping\n for (q = 0, mask = 0; q < m; ++q) {\n if (!_.modified('query', q)) continue;\n mask |= dims[q].one;\n this.incrementAll(dims[q], query[q], stamp, output.add);\n output.rem = output.add; // duplicate add/rem for downstream resolve\n }\n }\n return mask;\n },\n incrementAll(dim, query, stamp, out) {\n const bits = this.value,\n seen = bits.seen(),\n curr = bits.curr(),\n prev = bits.prev(),\n index = dim.index(),\n old = dim.bisect(dim.range),\n range = dim.bisect(query),\n lo1 = range[0],\n hi1 = range[1],\n lo0 = old[0],\n hi0 = old[1],\n one = dim.one;\n let i, j, k;\n\n // Fast incremental update based on previous lo index.\n if (lo1 < lo0) {\n for (i = lo1, j = Math.min(lo0, hi1); i < j; ++i) {\n k = index[i];\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n curr[k] ^= one;\n }\n } else if (lo1 > lo0) {\n for (i = lo0, j = Math.min(lo1, hi0); i < j; ++i) {\n k = index[i];\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n curr[k] ^= one;\n }\n }\n\n // Fast incremental update based on previous hi index.\n if (hi1 > hi0) {\n for (i = Math.max(lo1, hi0), j = hi1; i < j; ++i) {\n k = index[i];\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n curr[k] ^= one;\n }\n } else if (hi1 < hi0) {\n for (i = Math.max(lo0, hi1), j = hi0; i < j; ++i) {\n k = index[i];\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n curr[k] ^= one;\n }\n }\n dim.range = query.slice();\n },\n incrementOne(dim, query, add, rem) {\n const bits = this.value,\n curr = bits.curr(),\n index = dim.index(),\n old = dim.bisect(dim.range),\n range = dim.bisect(query),\n lo1 = range[0],\n hi1 = range[1],\n lo0 = old[0],\n hi0 = old[1],\n one = dim.one;\n let i, j, k;\n\n // Fast incremental update based on previous lo index.\n if (lo1 < lo0) {\n for (i = lo1, j = Math.min(lo0, hi1); i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n add.push(k);\n }\n } else if (lo1 > lo0) {\n for (i = lo0, j = Math.min(lo1, hi0); i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n rem.push(k);\n }\n }\n\n // Fast incremental update based on previous hi index.\n if (hi1 > hi0) {\n for (i = Math.max(lo1, hi0), j = hi1; i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n add.push(k);\n }\n } else if (hi1 < hi0) {\n for (i = Math.max(lo0, hi1), j = hi0; i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n rem.push(k);\n }\n }\n dim.range = query.slice();\n }\n});\n\n/**\n * Selectively filters tuples by resolving against a filter bitmap.\n * Useful for processing the output of a cross-filter transform.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.ignore - A bit mask indicating which filters to ignore.\n * @param {object} params.filter - The per-tuple filter bitmaps. Typically this\n * parameter value is a reference to a {@link CrossFilter} transform.\n */\nfunction ResolveFilter(params) {\n Transform.call(this, null, params);\n}\nResolveFilter.Definition = {\n 'type': 'ResolveFilter',\n 'metadata': {},\n 'params': [{\n 'name': 'ignore',\n 'type': 'number',\n 'required': true,\n 'description': 'A bit mask indicating which filters to ignore.'\n }, {\n 'name': 'filter',\n 'type': 'object',\n 'required': true,\n 'description': 'Per-tuple filter bitmaps from a CrossFilter transform.'\n }]\n};\ninherits(ResolveFilter, Transform, {\n transform(_, pulse) {\n const ignore = ~(_.ignore || 0),\n // bit mask where zeros -> dims to ignore\n bitmap = _.filter,\n mask = bitmap.mask;\n\n // exit early if no relevant filter changes\n if ((mask & ignore) === 0) return pulse.StopPropagation;\n const output = pulse.fork(pulse.ALL),\n data = bitmap.data(),\n curr = bitmap.curr(),\n prev = bitmap.prev(),\n pass = k => !(curr[k] & ignore) ? data[k] : null;\n\n // propagate all mod tuples that pass the filter\n output.filter(output.MOD, pass);\n\n // determine add & rem tuples via filter functions\n // for efficiency, we do *not* populate new arrays,\n // instead we add filter functions applied downstream\n\n if (!(mask & mask - 1)) {\n // only one filter changed\n output.filter(output.ADD, pass);\n output.filter(output.REM, k => (curr[k] & ignore) === mask ? data[k] : null);\n } else {\n // multiple filters changed\n output.filter(output.ADD, k => {\n const c = curr[k] & ignore,\n f = !c && c ^ prev[k] & ignore;\n return f ? data[k] : null;\n });\n output.filter(output.REM, k => {\n const c = curr[k] & ignore,\n f = c && !(c ^ (c ^ prev[k] & ignore));\n return f ? data[k] : null;\n });\n }\n\n // add filter to source data in case of reflow...\n return output.filter(output.SOURCE, t => pass(t._index));\n }\n});\n\nexport { CrossFilter as crossfilter, ResolveFilter as resolvefilter };\n","export default function permute(source, keys) {\n return Array.from(keys, key => source[key]);\n}\n","import { error, toSet, isFunction, isString, hasOwnProperty } from 'vega-util';\n\nconst RawCode = 'RawCode';\nconst Literal = 'Literal';\nconst Property = 'Property';\nconst Identifier = 'Identifier';\nconst ArrayExpression = 'ArrayExpression';\nconst BinaryExpression = 'BinaryExpression';\nconst CallExpression = 'CallExpression';\nconst ConditionalExpression = 'ConditionalExpression';\nconst LogicalExpression = 'LogicalExpression';\nconst MemberExpression = 'MemberExpression';\nconst ObjectExpression = 'ObjectExpression';\nconst UnaryExpression = 'UnaryExpression';\nfunction ASTNode(type) {\n this.type = type;\n}\nASTNode.prototype.visit = function (visitor) {\n let c, i, n;\n if (visitor(this)) return 1;\n for (c = children(this), i = 0, n = c.length; i < n; ++i) {\n if (c[i].visit(visitor)) return 1;\n }\n};\nfunction children(node) {\n switch (node.type) {\n case ArrayExpression:\n return node.elements;\n case BinaryExpression:\n case LogicalExpression:\n return [node.left, node.right];\n case CallExpression:\n return [node.callee].concat(node.arguments);\n case ConditionalExpression:\n return [node.test, node.consequent, node.alternate];\n case MemberExpression:\n return [node.object, node.property];\n case ObjectExpression:\n return node.properties;\n case Property:\n return [node.key, node.value];\n case UnaryExpression:\n return [node.argument];\n case Identifier:\n case Literal:\n case RawCode:\n default:\n return [];\n }\n}\n\n/*\n The following expression parser is based on Esprima (http://esprima.org/).\n Original header comment and license for Esprima is included here:\n\n Copyright (C) 2013 Ariya Hidayat \n Copyright (C) 2013 Thaddee Tyl \n Copyright (C) 2013 Mathias Bynens \n Copyright (C) 2012 Ariya Hidayat \n Copyright (C) 2012 Mathias Bynens \n Copyright (C) 2012 Joost-Wim Boekesteijn \n Copyright (C) 2012 Kris Kowal \n Copyright (C) 2012 Yusuke Suzuki \n Copyright (C) 2012 Arpad Borsos \n Copyright (C) 2011 Ariya Hidayat \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\nvar TokenName, source, index, length, lookahead;\nvar TokenBooleanLiteral = 1,\n TokenEOF = 2,\n TokenIdentifier = 3,\n TokenKeyword = 4,\n TokenNullLiteral = 5,\n TokenNumericLiteral = 6,\n TokenPunctuator = 7,\n TokenStringLiteral = 8,\n TokenRegularExpression = 9;\nTokenName = {};\nTokenName[TokenBooleanLiteral] = 'Boolean';\nTokenName[TokenEOF] = '';\nTokenName[TokenIdentifier] = 'Identifier';\nTokenName[TokenKeyword] = 'Keyword';\nTokenName[TokenNullLiteral] = 'Null';\nTokenName[TokenNumericLiteral] = 'Numeric';\nTokenName[TokenPunctuator] = 'Punctuator';\nTokenName[TokenStringLiteral] = 'String';\nTokenName[TokenRegularExpression] = 'RegularExpression';\nvar SyntaxArrayExpression = 'ArrayExpression',\n SyntaxBinaryExpression = 'BinaryExpression',\n SyntaxCallExpression = 'CallExpression',\n SyntaxConditionalExpression = 'ConditionalExpression',\n SyntaxIdentifier = 'Identifier',\n SyntaxLiteral = 'Literal',\n SyntaxLogicalExpression = 'LogicalExpression',\n SyntaxMemberExpression = 'MemberExpression',\n SyntaxObjectExpression = 'ObjectExpression',\n SyntaxProperty = 'Property',\n SyntaxUnaryExpression = 'UnaryExpression';\n\n// Error messages should be identical to V8.\nvar MessageUnexpectedToken = 'Unexpected token %0',\n MessageUnexpectedNumber = 'Unexpected number',\n MessageUnexpectedString = 'Unexpected string',\n MessageUnexpectedIdentifier = 'Unexpected identifier',\n MessageUnexpectedReserved = 'Unexpected reserved word',\n MessageUnexpectedEOS = 'Unexpected end of input',\n MessageInvalidRegExp = 'Invalid regular expression',\n MessageUnterminatedRegExp = 'Invalid regular expression: missing /',\n MessageStrictOctalLiteral = 'Octal literals are not allowed in strict mode.',\n MessageStrictDuplicateProperty = 'Duplicate data property in object literal not allowed in strict mode';\nvar ILLEGAL = 'ILLEGAL',\n DISABLED = 'Disabled.';\n\n// See also tools/generate-unicode-regex.py.\nvar RegexNonAsciiIdentifierStart = new RegExp('[\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0370-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0620-\\\\u064A\\\\u066E\\\\u066F\\\\u0671-\\\\u06D3\\\\u06D5\\\\u06E5\\\\u06E6\\\\u06EE\\\\u06EF\\\\u06FA-\\\\u06FC\\\\u06FF\\\\u0710\\\\u0712-\\\\u072F\\\\u074D-\\\\u07A5\\\\u07B1\\\\u07CA-\\\\u07EA\\\\u07F4\\\\u07F5\\\\u07FA\\\\u0800-\\\\u0815\\\\u081A\\\\u0824\\\\u0828\\\\u0840-\\\\u0858\\\\u08A0-\\\\u08B2\\\\u0904-\\\\u0939\\\\u093D\\\\u0950\\\\u0958-\\\\u0961\\\\u0971-\\\\u0980\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BD\\\\u09CE\\\\u09DC\\\\u09DD\\\\u09DF-\\\\u09E1\\\\u09F0\\\\u09F1\\\\u0A05-\\\\u0A0A\\\\u0A0F\\\\u0A10\\\\u0A13-\\\\u0A28\\\\u0A2A-\\\\u0A30\\\\u0A32\\\\u0A33\\\\u0A35\\\\u0A36\\\\u0A38\\\\u0A39\\\\u0A59-\\\\u0A5C\\\\u0A5E\\\\u0A72-\\\\u0A74\\\\u0A85-\\\\u0A8D\\\\u0A8F-\\\\u0A91\\\\u0A93-\\\\u0AA8\\\\u0AAA-\\\\u0AB0\\\\u0AB2\\\\u0AB3\\\\u0AB5-\\\\u0AB9\\\\u0ABD\\\\u0AD0\\\\u0AE0\\\\u0AE1\\\\u0B05-\\\\u0B0C\\\\u0B0F\\\\u0B10\\\\u0B13-\\\\u0B28\\\\u0B2A-\\\\u0B30\\\\u0B32\\\\u0B33\\\\u0B35-\\\\u0B39\\\\u0B3D\\\\u0B5C\\\\u0B5D\\\\u0B5F-\\\\u0B61\\\\u0B71\\\\u0B83\\\\u0B85-\\\\u0B8A\\\\u0B8E-\\\\u0B90\\\\u0B92-\\\\u0B95\\\\u0B99\\\\u0B9A\\\\u0B9C\\\\u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\u10D0-\\\\u10FA\\\\u10FC-\\\\u1248\\\\u124A-\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1711\\\\u1720-\\\\u1731\\\\u1740-\\\\u1751\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1780-\\\\u17B3\\\\u17D7\\\\u17DC\\\\u1820-\\\\u1877\\\\u1880-\\\\u18A8\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1950-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19C1-\\\\u19C7\\\\u1A00-\\\\u1A16\\\\u1A20-\\\\u1A54\\\\u1AA7\\\\u1B05-\\\\u1B33\\\\u1B45-\\\\u1B4B\\\\u1B83-\\\\u1BA0\\\\u1BAE\\\\u1BAF\\\\u1BBA-\\\\u1BE5\\\\u1C00-\\\\u1C23\\\\u1C4D-\\\\u1C4F\\\\u1C5A-\\\\u1C7D\\\\u1CE9-\\\\u1CEC\\\\u1CEE-\\\\u1CF1\\\\u1CF5\\\\u1CF6\\\\u1D00-\\\\u1DBF\\\\u1E00-\\\\u1F15\\\\u1F18-\\\\u1F1D\\\\u1F20-\\\\u1F45\\\\u1F48-\\\\u1F4D\\\\u1F50-\\\\u1F57\\\\u1F59\\\\u1F5B\\\\u1F5D\\\\u1F5F-\\\\u1F7D\\\\u1F80-\\\\u1FB4\\\\u1FB6-\\\\u1FBC\\\\u1FBE\\\\u1FC2-\\\\u1FC4\\\\u1FC6-\\\\u1FCC\\\\u1FD0-\\\\u1FD3\\\\u1FD6-\\\\u1FDB\\\\u1FE0-\\\\u1FEC\\\\u1FF2-\\\\u1FF4\\\\u1FF6-\\\\u1FFC\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u2102\\\\u2107\\\\u210A-\\\\u2113\\\\u2115\\\\u2119-\\\\u211D\\\\u2124\\\\u2126\\\\u2128\\\\u212A-\\\\u212D\\\\u212F-\\\\u2139\\\\u213C-\\\\u213F\\\\u2145-\\\\u2149\\\\u214E\\\\u2160-\\\\u2188\\\\u2C00-\\\\u2C2E\\\\u2C30-\\\\u2C5E\\\\u2C60-\\\\u2CE4\\\\u2CEB-\\\\u2CEE\\\\u2CF2\\\\u2CF3\\\\u2D00-\\\\u2D25\\\\u2D27\\\\u2D2D\\\\u2D30-\\\\u2D67\\\\u2D6F\\\\u2D80-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2E2F\\\\u3005-\\\\u3007\\\\u3021-\\\\u3029\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FCC\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA61F\\\\uA62A\\\\uA62B\\\\uA640-\\\\uA66E\\\\uA67F-\\\\uA69D\\\\uA6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\\\uFDF0-\\\\uFDFB\\\\uFE70-\\\\uFE74\\\\uFE76-\\\\uFEFC\\\\uFF21-\\\\uFF3A\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]'),\n // eslint-disable-next-line no-misleading-character-class\n RegexNonAsciiIdentifierPart = new RegExp('[\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0300-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u0483-\\\\u0487\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u0591-\\\\u05BD\\\\u05BF\\\\u05C1\\\\u05C2\\\\u05C4\\\\u05C5\\\\u05C7\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0610-\\\\u061A\\\\u0620-\\\\u0669\\\\u066E-\\\\u06D3\\\\u06D5-\\\\u06DC\\\\u06DF-\\\\u06E8\\\\u06EA-\\\\u06FC\\\\u06FF\\\\u0710-\\\\u074A\\\\u074D-\\\\u07B1\\\\u07C0-\\\\u07F5\\\\u07FA\\\\u0800-\\\\u082D\\\\u0840-\\\\u085B\\\\u08A0-\\\\u08B2\\\\u08E4-\\\\u0963\\\\u0966-\\\\u096F\\\\u0971-\\\\u0983\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BC-\\\\u09C4\\\\u09C7\\\\u09C8\\\\u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\\\u0EA1-\\\\u0EA3\\\\u0EA5\\\\u0EA7\\\\u0EAA\\\\u0EAB\\\\u0EAD-\\\\u0EB9\\\\u0EBB-\\\\u0EBD\\\\u0EC0-\\\\u0EC4\\\\u0EC6\\\\u0EC8-\\\\u0ECD\\\\u0ED0-\\\\u0ED9\\\\u0EDC-\\\\u0EDF\\\\u0F00\\\\u0F18\\\\u0F19\\\\u0F20-\\\\u0F29\\\\u0F35\\\\u0F37\\\\u0F39\\\\u0F3E-\\\\u0F47\\\\u0F49-\\\\u0F6C\\\\u0F71-\\\\u0F84\\\\u0F86-\\\\u0F97\\\\u0F99-\\\\u0FBC\\\\u0FC6\\\\u1000-\\\\u1049\\\\u1050-\\\\u109D\\\\u10A0-\\\\u10C5\\\\u10C7\\\\u10CD\\\\u10D0-\\\\u10FA\\\\u10FC-\\\\u1248\\\\u124A-\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u135D-\\\\u135F\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1714\\\\u1720-\\\\u1734\\\\u1740-\\\\u1753\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1772\\\\u1773\\\\u1780-\\\\u17D3\\\\u17D7\\\\u17DC\\\\u17DD\\\\u17E0-\\\\u17E9\\\\u180B-\\\\u180D\\\\u1810-\\\\u1819\\\\u1820-\\\\u1877\\\\u1880-\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1920-\\\\u192B\\\\u1930-\\\\u193B\\\\u1946-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19B0-\\\\u19C9\\\\u19D0-\\\\u19D9\\\\u1A00-\\\\u1A1B\\\\u1A20-\\\\u1A5E\\\\u1A60-\\\\u1A7C\\\\u1A7F-\\\\u1A89\\\\u1A90-\\\\u1A99\\\\u1AA7\\\\u1AB0-\\\\u1ABD\\\\u1B00-\\\\u1B4B\\\\u1B50-\\\\u1B59\\\\u1B6B-\\\\u1B73\\\\u1B80-\\\\u1BF3\\\\u1C00-\\\\u1C37\\\\u1C40-\\\\u1C49\\\\u1C4D-\\\\u1C7D\\\\u1CD0-\\\\u1CD2\\\\u1CD4-\\\\u1CF6\\\\u1CF8\\\\u1CF9\\\\u1D00-\\\\u1DF5\\\\u1DFC-\\\\u1F15\\\\u1F18-\\\\u1F1D\\\\u1F20-\\\\u1F45\\\\u1F48-\\\\u1F4D\\\\u1F50-\\\\u1F57\\\\u1F59\\\\u1F5B\\\\u1F5D\\\\u1F5F-\\\\u1F7D\\\\u1F80-\\\\u1FB4\\\\u1FB6-\\\\u1FBC\\\\u1FBE\\\\u1FC2-\\\\u1FC4\\\\u1FC6-\\\\u1FCC\\\\u1FD0-\\\\u1FD3\\\\u1FD6-\\\\u1FDB\\\\u1FE0-\\\\u1FEC\\\\u1FF2-\\\\u1FF4\\\\u1FF6-\\\\u1FFC\\\\u200C\\\\u200D\\\\u203F\\\\u2040\\\\u2054\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u20D0-\\\\u20DC\\\\u20E1\\\\u20E5-\\\\u20F0\\\\u2102\\\\u2107\\\\u210A-\\\\u2113\\\\u2115\\\\u2119-\\\\u211D\\\\u2124\\\\u2126\\\\u2128\\\\u212A-\\\\u212D\\\\u212F-\\\\u2139\\\\u213C-\\\\u213F\\\\u2145-\\\\u2149\\\\u214E\\\\u2160-\\\\u2188\\\\u2C00-\\\\u2C2E\\\\u2C30-\\\\u2C5E\\\\u2C60-\\\\u2CE4\\\\u2CEB-\\\\u2CF3\\\\u2D00-\\\\u2D25\\\\u2D27\\\\u2D2D\\\\u2D30-\\\\u2D67\\\\u2D6F\\\\u2D7F-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2DE0-\\\\u2DFF\\\\u2E2F\\\\u3005-\\\\u3007\\\\u3021-\\\\u302F\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u3099\\\\u309A\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FCC\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA62B\\\\uA640-\\\\uA66F\\\\uA674-\\\\uA67D\\\\uA67F-\\\\uA69D\\\\uA69F-\\\\uA6F1\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B-\\\\uA78E\\\\uA790-\\\\uA7AD\\\\uA7B0\\\\uA7B1\\\\uA7F7-\\\\uA827\\\\uA840-\\\\uA873\\\\uA880-\\\\uA8C4\\\\uA8D0-\\\\uA8D9\\\\uA8E0-\\\\uA8F7\\\\uA8FB\\\\uA900-\\\\uA92D\\\\uA930-\\\\uA953\\\\uA960-\\\\uA97C\\\\uA980-\\\\uA9C0\\\\uA9CF-\\\\uA9D9\\\\uA9E0-\\\\uA9FE\\\\uAA00-\\\\uAA36\\\\uAA40-\\\\uAA4D\\\\uAA50-\\\\uAA59\\\\uAA60-\\\\uAA76\\\\uAA7A-\\\\uAAC2\\\\uAADB-\\\\uAADD\\\\uAAE0-\\\\uAAEF\\\\uAAF2-\\\\uAAF6\\\\uAB01-\\\\uAB06\\\\uAB09-\\\\uAB0E\\\\uAB11-\\\\uAB16\\\\uAB20-\\\\uAB26\\\\uAB28-\\\\uAB2E\\\\uAB30-\\\\uAB5A\\\\uAB5C-\\\\uAB5F\\\\uAB64\\\\uAB65\\\\uABC0-\\\\uABEA\\\\uABEC\\\\uABED\\\\uABF0-\\\\uABF9\\\\uAC00-\\\\uD7A3\\\\uD7B0-\\\\uD7C6\\\\uD7CB-\\\\uD7FB\\\\uF900-\\\\uFA6D\\\\uFA70-\\\\uFAD9\\\\uFB00-\\\\uFB06\\\\uFB13-\\\\uFB17\\\\uFB1D-\\\\uFB28\\\\uFB2A-\\\\uFB36\\\\uFB38-\\\\uFB3C\\\\uFB3E\\\\uFB40\\\\uFB41\\\\uFB43\\\\uFB44\\\\uFB46-\\\\uFBB1\\\\uFBD3-\\\\uFD3D\\\\uFD50-\\\\uFD8F\\\\uFD92-\\\\uFDC7\\\\uFDF0-\\\\uFDFB\\\\uFE00-\\\\uFE0F\\\\uFE20-\\\\uFE2D\\\\uFE33\\\\uFE34\\\\uFE4D-\\\\uFE4F\\\\uFE70-\\\\uFE74\\\\uFE76-\\\\uFEFC\\\\uFF10-\\\\uFF19\\\\uFF21-\\\\uFF3A\\\\uFF3F\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]');\n\n// Ensure the condition is true, otherwise throw an error.\n// This is only to have a better contract semantic, i.e. another safety net\n// to catch a logic error. The condition shall be fulfilled in normal case.\n// Do NOT use this to enforce a certain condition on any user input.\n\nfunction assert(condition, message) {\n /* istanbul ignore next */\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n}\nfunction isDecimalDigit(ch) {\n return ch >= 0x30 && ch <= 0x39; // 0..9\n}\nfunction isHexDigit(ch) {\n return '0123456789abcdefABCDEF'.includes(ch);\n}\nfunction isOctalDigit(ch) {\n return '01234567'.includes(ch);\n}\n\n// 7.2 White Space\n\nfunction isWhiteSpace(ch) {\n return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].includes(ch);\n}\n\n// 7.3 Line Terminators\n\nfunction isLineTerminator(ch) {\n return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;\n}\n\n// 7.6 Identifier Names and Identifiers\n\nfunction isIdentifierStart(ch) {\n return ch === 0x24 || ch === 0x5F ||\n // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A ||\n // A..Z\n ch >= 0x61 && ch <= 0x7A ||\n // a..z\n ch === 0x5C ||\n // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierStart.test(String.fromCharCode(ch));\n}\nfunction isIdentifierPart(ch) {\n return ch === 0x24 || ch === 0x5F ||\n // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A ||\n // A..Z\n ch >= 0x61 && ch <= 0x7A ||\n // a..z\n ch >= 0x30 && ch <= 0x39 ||\n // 0..9\n ch === 0x5C ||\n // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierPart.test(String.fromCharCode(ch));\n}\n\n// 7.6.1.1 Keywords\n\nconst keywords = {\n 'if': 1,\n 'in': 1,\n 'do': 1,\n 'var': 1,\n 'for': 1,\n 'new': 1,\n 'try': 1,\n 'let': 1,\n 'this': 1,\n 'else': 1,\n 'case': 1,\n 'void': 1,\n 'with': 1,\n 'enum': 1,\n 'while': 1,\n 'break': 1,\n 'catch': 1,\n 'throw': 1,\n 'const': 1,\n 'yield': 1,\n 'class': 1,\n 'super': 1,\n 'return': 1,\n 'typeof': 1,\n 'delete': 1,\n 'switch': 1,\n 'export': 1,\n 'import': 1,\n 'public': 1,\n 'static': 1,\n 'default': 1,\n 'finally': 1,\n 'extends': 1,\n 'package': 1,\n 'private': 1,\n 'function': 1,\n 'continue': 1,\n 'debugger': 1,\n 'interface': 1,\n 'protected': 1,\n 'instanceof': 1,\n 'implements': 1\n};\nfunction skipComment() {\n while (index < length) {\n const ch = source.charCodeAt(index);\n if (isWhiteSpace(ch) || isLineTerminator(ch)) {\n ++index;\n } else {\n break;\n }\n }\n}\nfunction scanHexEscape(prefix) {\n var i,\n len,\n ch,\n code = 0;\n len = prefix === 'u' ? 4 : 2;\n for (i = 0; i < len; ++i) {\n if (index < length && isHexDigit(source[index])) {\n ch = source[index++];\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n } else {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n return String.fromCharCode(code);\n}\nfunction scanUnicodeCodePointEscape() {\n var ch, code, cu1, cu2;\n ch = source[index];\n code = 0;\n\n // At least, one hex digit is required.\n if (ch === '}') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n while (index < length) {\n ch = source[index++];\n if (!isHexDigit(ch)) {\n break;\n }\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n }\n if (code > 0x10FFFF || ch !== '}') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n // UTF-16 Encoding\n if (code <= 0xFFFF) {\n return String.fromCharCode(code);\n }\n cu1 = (code - 0x10000 >> 10) + 0xD800;\n cu2 = (code - 0x10000 & 1023) + 0xDC00;\n return String.fromCharCode(cu1, cu2);\n}\nfunction getEscapedIdentifier() {\n var ch, id;\n ch = source.charCodeAt(index++);\n id = String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierStart(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n id = ch;\n }\n while (index < length) {\n ch = source.charCodeAt(index);\n if (!isIdentifierPart(ch)) {\n break;\n }\n ++index;\n id += String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n id = id.substr(0, id.length - 1);\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierPart(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n id += ch;\n }\n }\n return id;\n}\nfunction getIdentifier() {\n var start, ch;\n start = index++;\n while (index < length) {\n ch = source.charCodeAt(index);\n if (ch === 0x5C) {\n // Blackslash (U+005C) marks Unicode escape sequence.\n index = start;\n return getEscapedIdentifier();\n }\n if (isIdentifierPart(ch)) {\n ++index;\n } else {\n break;\n }\n }\n return source.slice(start, index);\n}\nfunction scanIdentifier() {\n var start, id, type;\n start = index;\n\n // Backslash (U+005C) starts an escaped character.\n id = source.charCodeAt(index) === 0x5C ? getEscapedIdentifier() : getIdentifier();\n\n // There is no keyword or literal with only one character.\n // Thus, it must be an identifier.\n if (id.length === 1) {\n type = TokenIdentifier;\n } else if (keywords.hasOwnProperty(id)) {\n // eslint-disable-line no-prototype-builtins\n type = TokenKeyword;\n } else if (id === 'null') {\n type = TokenNullLiteral;\n } else if (id === 'true' || id === 'false') {\n type = TokenBooleanLiteral;\n } else {\n type = TokenIdentifier;\n }\n return {\n type: type,\n value: id,\n start: start,\n end: index\n };\n}\n\n// 7.7 Punctuators\n\nfunction scanPunctuator() {\n var start = index,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2,\n ch3,\n ch4;\n switch (code) {\n // Check for most common single-character punctuators.\n case 0x2E: // . dot\n case 0x28: // ( open bracket\n case 0x29: // ) close bracket\n case 0x3B: // ; semicolon\n case 0x2C: // , comma\n case 0x7B: // { open curly brace\n case 0x7D: // } close curly brace\n case 0x5B: // [\n case 0x5D: // ]\n case 0x3A: // :\n case 0x3F: // ?\n case 0x7E:\n // ~\n ++index;\n return {\n type: TokenPunctuator,\n value: String.fromCharCode(code),\n start: start,\n end: index\n };\n default:\n code2 = source.charCodeAt(index + 1);\n\n // '=' (U+003D) marks an assignment or comparison operator.\n if (code2 === 0x3D) {\n switch (code) {\n case 0x2B: // +\n case 0x2D: // -\n case 0x2F: // /\n case 0x3C: // <\n case 0x3E: // >\n case 0x5E: // ^\n case 0x7C: // |\n case 0x25: // %\n case 0x26: // &\n case 0x2A:\n // *\n index += 2;\n return {\n type: TokenPunctuator,\n value: String.fromCharCode(code) + String.fromCharCode(code2),\n start: start,\n end: index\n };\n case 0x21: // !\n case 0x3D:\n // =\n index += 2;\n\n // !== and ===\n if (source.charCodeAt(index) === 0x3D) {\n ++index;\n }\n return {\n type: TokenPunctuator,\n value: source.slice(start, index),\n start: start,\n end: index\n };\n }\n }\n }\n\n // 4-character punctuator: >>>=\n\n ch4 = source.substr(index, 4);\n if (ch4 === '>>>=') {\n index += 4;\n return {\n type: TokenPunctuator,\n value: ch4,\n start: start,\n end: index\n };\n }\n\n // 3-character punctuators: === !== >>> <<= >>=\n\n ch3 = ch4.substr(0, 3);\n if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {\n index += 3;\n return {\n type: TokenPunctuator,\n value: ch3,\n start: start,\n end: index\n };\n }\n\n // Other 2-character punctuators: ++ -- << >> && ||\n ch2 = ch3.substr(0, 2);\n if (ch1 === ch2[1] && '+-<>&|'.includes(ch1) || ch2 === '=>') {\n index += 2;\n return {\n type: TokenPunctuator,\n value: ch2,\n start: start,\n end: index\n };\n }\n if (ch2 === '//') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n // 1-character punctuators: < > = ! + - * % & | ^ /\n\n if ('<>=!+-*%&|^/'.includes(ch1)) {\n ++index;\n return {\n type: TokenPunctuator,\n value: ch1,\n start: start,\n end: index\n };\n }\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n}\n\n// 7.8.3 Numeric Literals\n\nfunction scanHexLiteral(start) {\n let number = '';\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n if (number.length === 0) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n return {\n type: TokenNumericLiteral,\n value: parseInt('0x' + number, 16),\n start: start,\n end: index\n };\n}\nfunction scanOctalLiteral(start) {\n let number = '0' + source[index++];\n while (index < length) {\n if (!isOctalDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n return {\n type: TokenNumericLiteral,\n value: parseInt(number, 8),\n octal: true,\n start: start,\n end: index\n };\n}\nfunction scanNumericLiteral() {\n var number, start, ch;\n ch = source[index];\n assert(isDecimalDigit(ch.charCodeAt(0)) || ch === '.', 'Numeric literal must start with a decimal digit or a decimal point');\n start = index;\n number = '';\n if (ch !== '.') {\n number = source[index++];\n ch = source[index];\n\n // Hex number starts with '0x'.\n // Octal number starts with '0'.\n if (number === '0') {\n if (ch === 'x' || ch === 'X') {\n ++index;\n return scanHexLiteral(start);\n }\n if (isOctalDigit(ch)) {\n return scanOctalLiteral(start);\n }\n\n // decimal number starts with '0' such as '09' is illegal.\n if (ch && isDecimalDigit(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n if (ch === '.') {\n number += source[index++];\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n if (ch === 'e' || ch === 'E') {\n number += source[index++];\n ch = source[index];\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n if (isDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n return {\n type: TokenNumericLiteral,\n value: parseFloat(number),\n start: start,\n end: index\n };\n}\n\n// 7.8.4 String Literals\n\nfunction scanStringLiteral() {\n var str = '',\n quote,\n start,\n ch,\n code,\n octal = false;\n quote = source[index];\n assert(quote === '\\'' || quote === '\"', 'String literal must starts with a quote');\n start = index;\n ++index;\n while (index < length) {\n ch = source[index++];\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'u':\n case 'x':\n if (source[index] === '{') {\n ++index;\n str += scanUnicodeCodePointEscape();\n } else {\n str += scanHexEscape(ch);\n }\n break;\n case 'n':\n str += '\\n';\n break;\n case 'r':\n str += '\\r';\n break;\n case 't':\n str += '\\t';\n break;\n case 'b':\n str += '\\b';\n break;\n case 'f':\n str += '\\f';\n break;\n case 'v':\n str += '\\x0B';\n break;\n default:\n if (isOctalDigit(ch)) {\n code = '01234567'.indexOf(ch);\n\n // \\0 is not octal escape sequence\n if (code !== 0) {\n octal = true;\n }\n if (index < length && isOctalDigit(source[index])) {\n octal = true;\n code = code * 8 + '01234567'.indexOf(source[index++]);\n\n // 3 digits are only allowed when string starts\n // with 0, 1, 2, 3\n if ('0123'.includes(ch) && index < length && isOctalDigit(source[index])) {\n code = code * 8 + '01234567'.indexOf(source[index++]);\n }\n }\n str += String.fromCharCode(code);\n } else {\n str += ch;\n }\n break;\n }\n } else {\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n if (quote !== '') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n return {\n type: TokenStringLiteral,\n value: str,\n octal: octal,\n start: start,\n end: index\n };\n}\nfunction testRegExp(pattern, flags) {\n let tmp = pattern;\n if (flags.includes('u')) {\n // Replace each astral symbol and every Unicode code point\n // escape sequence with a single ASCII symbol to avoid throwing on\n // regular expressions that are only valid in combination with the\n // `/u` flag.\n // Note: replacing with the ASCII symbol `x` might cause false\n // negatives in unlikely scenarios. For example, `[\\u{61}-b]` is a\n // perfectly valid pattern that is equivalent to `[a-b]`, but it\n // would be replaced by `[x-b]` which throws an error.\n tmp = tmp.replace(/\\\\u\\{([0-9a-fA-F]+)\\}/g, ($0, $1) => {\n if (parseInt($1, 16) <= 0x10FFFF) {\n return 'x';\n }\n throwError({}, MessageInvalidRegExp);\n }).replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g, 'x');\n }\n\n // First, detect invalid regular expressions.\n try {\n new RegExp(tmp);\n } catch (e) {\n throwError({}, MessageInvalidRegExp);\n }\n\n // Return a regular expression object for this pattern-flag pair, or\n // `null` in case the current environment doesn't support the flags it\n // uses.\n try {\n return new RegExp(pattern, flags);\n } catch (exception) {\n return null;\n }\n}\nfunction scanRegExpBody() {\n var ch, str, classMarker, terminated, body;\n ch = source[index];\n assert(ch === '/', 'Regular expression literal must start with a slash');\n str = source[index++];\n classMarker = false;\n terminated = false;\n while (index < length) {\n ch = source[index++];\n str += ch;\n if (ch === '\\\\') {\n ch = source[index++];\n // ECMA-262 7.8.5\n if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, MessageUnterminatedRegExp);\n }\n str += ch;\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, MessageUnterminatedRegExp);\n } else if (classMarker) {\n if (ch === ']') {\n classMarker = false;\n }\n } else {\n if (ch === '/') {\n terminated = true;\n break;\n } else if (ch === '[') {\n classMarker = true;\n }\n }\n }\n if (!terminated) {\n throwError({}, MessageUnterminatedRegExp);\n }\n\n // Exclude leading and trailing slash.\n body = str.substr(1, str.length - 2);\n return {\n value: body,\n literal: str\n };\n}\nfunction scanRegExpFlags() {\n var ch, str, flags;\n str = '';\n flags = '';\n while (index < length) {\n ch = source[index];\n if (!isIdentifierPart(ch.charCodeAt(0))) {\n break;\n }\n ++index;\n if (ch === '\\\\' && index < length) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } else {\n flags += ch;\n str += ch;\n }\n }\n if (flags.search(/[^gimuy]/g) >= 0) {\n throwError({}, MessageInvalidRegExp, flags);\n }\n return {\n value: flags,\n literal: str\n };\n}\nfunction scanRegExp() {\n var start, body, flags, value;\n lookahead = null;\n skipComment();\n start = index;\n body = scanRegExpBody();\n flags = scanRegExpFlags();\n value = testRegExp(body.value, flags.value);\n return {\n literal: body.literal + flags.literal,\n value: value,\n regex: {\n pattern: body.value,\n flags: flags.value\n },\n start: start,\n end: index\n };\n}\nfunction isIdentifierName(token) {\n return token.type === TokenIdentifier || token.type === TokenKeyword || token.type === TokenBooleanLiteral || token.type === TokenNullLiteral;\n}\nfunction advance() {\n skipComment();\n if (index >= length) {\n return {\n type: TokenEOF,\n start: index,\n end: index\n };\n }\n const ch = source.charCodeAt(index);\n if (isIdentifierStart(ch)) {\n return scanIdentifier();\n }\n\n // Very common: ( and ) and ;\n if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {\n return scanPunctuator();\n }\n\n // String literal starts with single quote (U+0027) or double quote (U+0022).\n if (ch === 0x27 || ch === 0x22) {\n return scanStringLiteral();\n }\n\n // Dot (.) U+002E can also start a floating-point number, hence the need\n // to check the next character.\n if (ch === 0x2E) {\n if (isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNumericLiteral();\n }\n return scanPunctuator();\n }\n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n return scanPunctuator();\n}\nfunction lex() {\n const token = lookahead;\n index = token.end;\n lookahead = advance();\n index = token.end;\n return token;\n}\nfunction peek() {\n const pos = index;\n lookahead = advance();\n index = pos;\n}\nfunction finishArrayExpression(elements) {\n const node = new ASTNode(SyntaxArrayExpression);\n node.elements = elements;\n return node;\n}\nfunction finishBinaryExpression(operator, left, right) {\n const node = new ASTNode(operator === '||' || operator === '&&' ? SyntaxLogicalExpression : SyntaxBinaryExpression);\n node.operator = operator;\n node.left = left;\n node.right = right;\n return node;\n}\nfunction finishCallExpression(callee, args) {\n const node = new ASTNode(SyntaxCallExpression);\n node.callee = callee;\n node.arguments = args;\n return node;\n}\nfunction finishConditionalExpression(test, consequent, alternate) {\n const node = new ASTNode(SyntaxConditionalExpression);\n node.test = test;\n node.consequent = consequent;\n node.alternate = alternate;\n return node;\n}\nfunction finishIdentifier(name) {\n const node = new ASTNode(SyntaxIdentifier);\n node.name = name;\n return node;\n}\nfunction finishLiteral(token) {\n const node = new ASTNode(SyntaxLiteral);\n node.value = token.value;\n node.raw = source.slice(token.start, token.end);\n if (token.regex) {\n if (node.raw === '//') {\n node.raw = '/(?:)/';\n }\n node.regex = token.regex;\n }\n return node;\n}\nfunction finishMemberExpression(accessor, object, property) {\n const node = new ASTNode(SyntaxMemberExpression);\n node.computed = accessor === '[';\n node.object = object;\n node.property = property;\n if (!node.computed) property.member = true;\n return node;\n}\nfunction finishObjectExpression(properties) {\n const node = new ASTNode(SyntaxObjectExpression);\n node.properties = properties;\n return node;\n}\nfunction finishProperty(kind, key, value) {\n const node = new ASTNode(SyntaxProperty);\n node.key = key;\n node.value = value;\n node.kind = kind;\n return node;\n}\nfunction finishUnaryExpression(operator, argument) {\n const node = new ASTNode(SyntaxUnaryExpression);\n node.operator = operator;\n node.argument = argument;\n node.prefix = true;\n return node;\n}\n\n// Throw an exception\n\nfunction throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(/%(\\d)/g, (whole, index) => {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n });\n error = new Error(msg);\n error.index = index;\n error.description = msg;\n throw error;\n}\n\n// Throw an exception because of the token.\n\nfunction throwUnexpected(token) {\n if (token.type === TokenEOF) {\n throwError(token, MessageUnexpectedEOS);\n }\n if (token.type === TokenNumericLiteral) {\n throwError(token, MessageUnexpectedNumber);\n }\n if (token.type === TokenStringLiteral) {\n throwError(token, MessageUnexpectedString);\n }\n if (token.type === TokenIdentifier) {\n throwError(token, MessageUnexpectedIdentifier);\n }\n if (token.type === TokenKeyword) {\n throwError(token, MessageUnexpectedReserved);\n }\n\n // BooleanLiteral, NullLiteral, or Punctuator.\n throwError(token, MessageUnexpectedToken, token.value);\n}\n\n// Expect the next token to match the specified punctuator.\n// If not, an exception will be thrown.\n\nfunction expect(value) {\n const token = lex();\n if (token.type !== TokenPunctuator || token.value !== value) {\n throwUnexpected(token);\n }\n}\n\n// Return true if the next token matches the specified punctuator.\n\nfunction match(value) {\n return lookahead.type === TokenPunctuator && lookahead.value === value;\n}\n\n// Return true if the next token matches the specified keyword\n\nfunction matchKeyword(keyword) {\n return lookahead.type === TokenKeyword && lookahead.value === keyword;\n}\n\n// 11.1.4 Array Initialiser\n\nfunction parseArrayInitialiser() {\n const elements = [];\n index = lookahead.start;\n expect('[');\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elements.push(parseConditionalExpression());\n if (!match(']')) {\n expect(',');\n }\n }\n }\n lex();\n return finishArrayExpression(elements);\n}\n\n// 11.1.5 Object Initialiser\n\nfunction parseObjectPropertyKey() {\n index = lookahead.start;\n const token = lex();\n\n // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n\n if (token.type === TokenStringLiteral || token.type === TokenNumericLiteral) {\n if (token.octal) {\n throwError(token, MessageStrictOctalLiteral);\n }\n return finishLiteral(token);\n }\n return finishIdentifier(token.value);\n}\nfunction parseObjectProperty() {\n var token, key, id, value;\n index = lookahead.start;\n token = lookahead;\n if (token.type === TokenIdentifier) {\n id = parseObjectPropertyKey();\n expect(':');\n value = parseConditionalExpression();\n return finishProperty('init', id, value);\n }\n if (token.type === TokenEOF || token.type === TokenPunctuator) {\n throwUnexpected(token);\n } else {\n key = parseObjectPropertyKey();\n expect(':');\n value = parseConditionalExpression();\n return finishProperty('init', key, value);\n }\n}\nfunction parseObjectInitialiser() {\n var properties = [],\n property,\n name,\n key,\n map = {},\n toString = String;\n index = lookahead.start;\n expect('{');\n while (!match('}')) {\n property = parseObjectProperty();\n if (property.key.type === SyntaxIdentifier) {\n name = property.key.name;\n } else {\n name = toString(property.key.value);\n }\n key = '$' + name;\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n throwError({}, MessageStrictDuplicateProperty);\n } else {\n map[key] = true;\n }\n properties.push(property);\n if (!match('}')) {\n expect(',');\n }\n }\n expect('}');\n return finishObjectExpression(properties);\n}\n\n// 11.1.6 The Grouping Operator\n\nfunction parseGroupExpression() {\n expect('(');\n const expr = parseExpression();\n expect(')');\n return expr;\n}\n\n// 11.1 Primary Expressions\n\nconst legalKeywords = {\n 'if': 1\n};\nfunction parsePrimaryExpression() {\n var type, token, expr;\n if (match('(')) {\n return parseGroupExpression();\n }\n if (match('[')) {\n return parseArrayInitialiser();\n }\n if (match('{')) {\n return parseObjectInitialiser();\n }\n type = lookahead.type;\n index = lookahead.start;\n if (type === TokenIdentifier || legalKeywords[lookahead.value]) {\n expr = finishIdentifier(lex().value);\n } else if (type === TokenStringLiteral || type === TokenNumericLiteral) {\n if (lookahead.octal) {\n throwError(lookahead, MessageStrictOctalLiteral);\n }\n expr = finishLiteral(lex());\n } else if (type === TokenKeyword) {\n throw new Error(DISABLED);\n } else if (type === TokenBooleanLiteral) {\n token = lex();\n token.value = token.value === 'true';\n expr = finishLiteral(token);\n } else if (type === TokenNullLiteral) {\n token = lex();\n token.value = null;\n expr = finishLiteral(token);\n } else if (match('/') || match('/=')) {\n expr = finishLiteral(scanRegExp());\n peek();\n } else {\n throwUnexpected(lex());\n }\n return expr;\n}\n\n// 11.2 Left-Hand-Side Expressions\n\nfunction parseArguments() {\n const args = [];\n expect('(');\n if (!match(')')) {\n while (index < length) {\n args.push(parseConditionalExpression());\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n expect(')');\n return args;\n}\nfunction parseNonComputedProperty() {\n index = lookahead.start;\n const token = lex();\n if (!isIdentifierName(token)) {\n throwUnexpected(token);\n }\n return finishIdentifier(token.value);\n}\nfunction parseNonComputedMember() {\n expect('.');\n return parseNonComputedProperty();\n}\nfunction parseComputedMember() {\n expect('[');\n const expr = parseExpression();\n expect(']');\n return expr;\n}\nfunction parseLeftHandSideExpressionAllowCall() {\n var expr, args, property;\n expr = parsePrimaryExpression();\n for (;;) {\n if (match('.')) {\n property = parseNonComputedMember();\n expr = finishMemberExpression('.', expr, property);\n } else if (match('(')) {\n args = parseArguments();\n expr = finishCallExpression(expr, args);\n } else if (match('[')) {\n property = parseComputedMember();\n expr = finishMemberExpression('[', expr, property);\n } else {\n break;\n }\n }\n return expr;\n}\n\n// 11.3 Postfix Expressions\n\nfunction parsePostfixExpression() {\n const expr = parseLeftHandSideExpressionAllowCall();\n if (lookahead.type === TokenPunctuator) {\n if (match('++') || match('--')) {\n throw new Error(DISABLED);\n }\n }\n return expr;\n}\n\n// 11.4 Unary Operators\n\nfunction parseUnaryExpression() {\n var token, expr;\n if (lookahead.type !== TokenPunctuator && lookahead.type !== TokenKeyword) {\n expr = parsePostfixExpression();\n } else if (match('++') || match('--')) {\n throw new Error(DISABLED);\n } else if (match('+') || match('-') || match('~') || match('!')) {\n token = lex();\n expr = parseUnaryExpression();\n expr = finishUnaryExpression(token.value, expr);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n throw new Error(DISABLED);\n } else {\n expr = parsePostfixExpression();\n }\n return expr;\n}\nfunction binaryPrecedence(token) {\n let prec = 0;\n if (token.type !== TokenPunctuator && token.type !== TokenKeyword) {\n return 0;\n }\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n case '&&':\n prec = 2;\n break;\n case '|':\n prec = 3;\n break;\n case '^':\n prec = 4;\n break;\n case '&':\n prec = 5;\n break;\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n case 'in':\n prec = 7;\n break;\n case '<<':\n case '>>':\n case '>>>':\n prec = 8;\n break;\n case '+':\n case '-':\n prec = 9;\n break;\n case '*':\n case '/':\n case '%':\n prec = 11;\n break;\n }\n return prec;\n}\n\n// 11.5 Multiplicative Operators\n// 11.6 Additive Operators\n// 11.7 Bitwise Shift Operators\n// 11.8 Relational Operators\n// 11.9 Equality Operators\n// 11.10 Binary Bitwise Operators\n// 11.11 Binary Logical Operators\n\nfunction parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n marker = lookahead;\n left = parseUnaryExpression();\n token = lookahead;\n prec = binaryPrecedence(token);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n stack = [left, token, right];\n while ((prec = binaryPrecedence(lookahead)) > 0) {\n // Reduce: make a binary expression from the three topmost entries.\n while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = finishBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n markers.pop();\n expr = finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n return expr;\n}\n\n// 11.12 Conditional Operator\n\nfunction parseConditionalExpression() {\n var expr, consequent, alternate;\n expr = parseBinaryExpression();\n if (match('?')) {\n lex();\n consequent = parseConditionalExpression();\n expect(':');\n alternate = parseConditionalExpression();\n expr = finishConditionalExpression(expr, consequent, alternate);\n }\n return expr;\n}\n\n// 11.14 Comma Operator\n\nfunction parseExpression() {\n const expr = parseConditionalExpression();\n if (match(',')) {\n throw new Error(DISABLED); // no sequence expressions\n }\n return expr;\n}\nfunction parser (code) {\n source = code;\n index = 0;\n length = source.length;\n lookahead = null;\n peek();\n const expr = parseExpression();\n if (lookahead.type !== TokenEOF) {\n throw new Error('Unexpect token after expression.');\n }\n return expr;\n}\n\nvar Constants = {\n NaN: 'NaN',\n E: 'Math.E',\n LN2: 'Math.LN2',\n LN10: 'Math.LN10',\n LOG2E: 'Math.LOG2E',\n LOG10E: 'Math.LOG10E',\n PI: 'Math.PI',\n SQRT1_2: 'Math.SQRT1_2',\n SQRT2: 'Math.SQRT2',\n MIN_VALUE: 'Number.MIN_VALUE',\n MAX_VALUE: 'Number.MAX_VALUE'\n};\n\nfunction Functions (codegen) {\n function fncall(name, args, cast, type) {\n let obj = codegen(args[0]);\n if (cast) {\n obj = cast + '(' + obj + ')';\n if (cast.lastIndexOf('new ', 0) === 0) obj = '(' + obj + ')';\n }\n return obj + '.' + name + (type < 0 ? '' : type === 0 ? '()' : '(' + args.slice(1).map(codegen).join(',') + ')');\n }\n function fn(name, cast, type) {\n return args => fncall(name, args, cast, type);\n }\n const DATE = 'new Date',\n STRING = 'String',\n REGEXP = 'RegExp';\n return {\n // MATH functions\n isNaN: 'Number.isNaN',\n isFinite: 'Number.isFinite',\n abs: 'Math.abs',\n acos: 'Math.acos',\n asin: 'Math.asin',\n atan: 'Math.atan',\n atan2: 'Math.atan2',\n ceil: 'Math.ceil',\n cos: 'Math.cos',\n exp: 'Math.exp',\n floor: 'Math.floor',\n hypot: 'Math.hypot',\n log: 'Math.log',\n max: 'Math.max',\n min: 'Math.min',\n pow: 'Math.pow',\n random: 'Math.random',\n round: 'Math.round',\n sin: 'Math.sin',\n sqrt: 'Math.sqrt',\n tan: 'Math.tan',\n clamp: function (args) {\n if (args.length < 3) error('Missing arguments to clamp function.');\n if (args.length > 3) error('Too many arguments to clamp function.');\n const a = args.map(codegen);\n return 'Math.max(' + a[1] + ', Math.min(' + a[2] + ',' + a[0] + '))';\n },\n // DATE functions\n now: 'Date.now',\n utc: 'Date.UTC',\n datetime: DATE,\n date: fn('getDate', DATE, 0),\n day: fn('getDay', DATE, 0),\n year: fn('getFullYear', DATE, 0),\n month: fn('getMonth', DATE, 0),\n hours: fn('getHours', DATE, 0),\n minutes: fn('getMinutes', DATE, 0),\n seconds: fn('getSeconds', DATE, 0),\n milliseconds: fn('getMilliseconds', DATE, 0),\n time: fn('getTime', DATE, 0),\n timezoneoffset: fn('getTimezoneOffset', DATE, 0),\n utcdate: fn('getUTCDate', DATE, 0),\n utcday: fn('getUTCDay', DATE, 0),\n utcyear: fn('getUTCFullYear', DATE, 0),\n utcmonth: fn('getUTCMonth', DATE, 0),\n utchours: fn('getUTCHours', DATE, 0),\n utcminutes: fn('getUTCMinutes', DATE, 0),\n utcseconds: fn('getUTCSeconds', DATE, 0),\n utcmilliseconds: fn('getUTCMilliseconds', DATE, 0),\n // sequence functions\n length: fn('length', null, -1),\n // STRING functions\n parseFloat: 'parseFloat',\n parseInt: 'parseInt',\n upper: fn('toUpperCase', STRING, 0),\n lower: fn('toLowerCase', STRING, 0),\n substring: fn('substring', STRING),\n split: fn('split', STRING),\n trim: fn('trim', STRING, 0),\n // REGEXP functions\n regexp: REGEXP,\n test: fn('test', REGEXP),\n // Control Flow functions\n if: function (args) {\n if (args.length < 3) error('Missing arguments to if function.');\n if (args.length > 3) error('Too many arguments to if function.');\n const a = args.map(codegen);\n return '(' + a[0] + '?' + a[1] + ':' + a[2] + ')';\n }\n };\n}\n\nfunction stripQuotes(s) {\n const n = s && s.length - 1;\n return n && (s[0] === '\"' && s[n] === '\"' || s[0] === '\\'' && s[n] === '\\'') ? s.slice(1, -1) : s;\n}\nfunction codegen (opt) {\n opt = opt || {};\n const allowed = opt.allowed ? toSet(opt.allowed) : {},\n forbidden = opt.forbidden ? toSet(opt.forbidden) : {},\n constants = opt.constants || Constants,\n functions = (opt.functions || Functions)(visit),\n globalvar = opt.globalvar,\n fieldvar = opt.fieldvar,\n outputGlobal = isFunction(globalvar) ? globalvar : id => `${globalvar}[\"${id}\"]`;\n let globals = {},\n fields = {},\n memberDepth = 0;\n function visit(ast) {\n if (isString(ast)) return ast;\n const generator = Generators[ast.type];\n if (generator == null) error('Unsupported type: ' + ast.type);\n return generator(ast);\n }\n const Generators = {\n Literal: n => n.raw,\n Identifier: n => {\n const id = n.name;\n if (memberDepth > 0) {\n return id;\n } else if (hasOwnProperty(forbidden, id)) {\n return error('Illegal identifier: ' + id);\n } else if (hasOwnProperty(constants, id)) {\n return constants[id];\n } else if (hasOwnProperty(allowed, id)) {\n return id;\n } else {\n globals[id] = 1;\n return outputGlobal(id);\n }\n },\n MemberExpression: n => {\n const d = !n.computed,\n o = visit(n.object);\n if (d) memberDepth += 1;\n const p = visit(n.property);\n if (o === fieldvar) {\n // strip quotes to sanitize field name (#1653)\n fields[stripQuotes(p)] = 1;\n }\n if (d) memberDepth -= 1;\n return o + (d ? '.' + p : '[' + p + ']');\n },\n CallExpression: n => {\n if (n.callee.type !== 'Identifier') {\n error('Illegal callee type: ' + n.callee.type);\n }\n const callee = n.callee.name,\n args = n.arguments,\n fn = hasOwnProperty(functions, callee) && functions[callee];\n if (!fn) error('Unrecognized function: ' + callee);\n return isFunction(fn) ? fn(args) : fn + '(' + args.map(visit).join(',') + ')';\n },\n ArrayExpression: n => '[' + n.elements.map(visit).join(',') + ']',\n BinaryExpression: n => '(' + visit(n.left) + ' ' + n.operator + ' ' + visit(n.right) + ')',\n UnaryExpression: n => '(' + n.operator + visit(n.argument) + ')',\n ConditionalExpression: n => '(' + visit(n.test) + '?' + visit(n.consequent) + ':' + visit(n.alternate) + ')',\n LogicalExpression: n => '(' + visit(n.left) + n.operator + visit(n.right) + ')',\n ObjectExpression: n => '{' + n.properties.map(visit).join(',') + '}',\n Property: n => {\n memberDepth += 1;\n const k = visit(n.key);\n memberDepth -= 1;\n return k + ':' + visit(n.value);\n }\n };\n function codegen(ast) {\n const result = {\n code: visit(ast),\n globals: Object.keys(globals),\n fields: Object.keys(fields)\n };\n globals = {};\n fields = {};\n return result;\n }\n codegen.functions = functions;\n codegen.constants = constants;\n return codegen;\n}\n\nexport { ASTNode, ArrayExpression, BinaryExpression, CallExpression, ConditionalExpression, Identifier, Literal, LogicalExpression, MemberExpression, ObjectExpression, Property, RawCode, UnaryExpression, codegen as codegenExpression, Constants as constants, Functions as functions, parser as parseExpression };\n","import {Adder} from \"d3-array\";\nimport {atan2, cos, quarterPi, radians, sin, tau} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nexport var areaRingSum = new Adder();\n\n// hello?\n\nvar areaSum = new Adder(),\n lambda00,\n phi00,\n lambda0,\n cosPhi0,\n sinPhi0;\n\nexport var areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaRingSum = new Adder();\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n var areaRing = +areaRingSum;\n areaSum.add(areaRing < 0 ? tau + areaRing : areaRing);\n this.lineStart = this.lineEnd = this.point = noop;\n },\n sphere: function() {\n areaSum.add(tau);\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaRingEnd() {\n areaPoint(lambda00, phi00);\n}\n\nfunction areaPointFirst(lambda, phi) {\n areaStream.point = areaPoint;\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi);\n}\n\nfunction areaPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n phi = phi / 2 + quarterPi; // half the angular distance from south pole\n\n // Spherical excess E for a spherical triangle with vertices: south pole,\n // previous point, current point. Uses a formula derived from Cagnoli’s\n // theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2).\n var dLambda = lambda - lambda0,\n sdLambda = dLambda >= 0 ? 1 : -1,\n adLambda = sdLambda * dLambda,\n cosPhi = cos(phi),\n sinPhi = sin(phi),\n k = sinPhi0 * sinPhi,\n u = cosPhi0 * cosPhi + k * cos(adLambda),\n v = k * sdLambda * sin(adLambda);\n areaRingSum.add(atan2(v, u));\n\n // Advance the previous points.\n lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;\n}\n\nexport default function(object) {\n areaSum = new Adder();\n stream(object, areaStream);\n return areaSum * 2;\n}\n","import {Adder} from \"d3-array\";\nimport {areaStream, areaRingSum} from \"./area.js\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport {abs, degrees, epsilon, radians} from \"./math.js\";\nimport stream from \"./stream.js\";\n\nvar lambda0, phi0, lambda1, phi1, // bounds\n lambda2, // previous lambda-coordinate\n lambda00, phi00, // first point\n p0, // previous 3D point\n deltaSum,\n ranges,\n range;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: boundsLineStart,\n lineEnd: boundsLineEnd,\n polygonStart: function() {\n boundsStream.point = boundsRingPoint;\n boundsStream.lineStart = boundsRingStart;\n boundsStream.lineEnd = boundsRingEnd;\n deltaSum = new Adder();\n areaStream.polygonStart();\n },\n polygonEnd: function() {\n areaStream.polygonEnd();\n boundsStream.point = boundsPoint;\n boundsStream.lineStart = boundsLineStart;\n boundsStream.lineEnd = boundsLineEnd;\n if (areaRingSum < 0) lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n else if (deltaSum > epsilon) phi1 = 90;\n else if (deltaSum < -epsilon) phi0 = -90;\n range[0] = lambda0, range[1] = lambda1;\n },\n sphere: function() {\n lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n }\n};\n\nfunction boundsPoint(lambda, phi) {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n}\n\nfunction linePoint(lambda, phi) {\n var p = cartesian([lambda * radians, phi * radians]);\n if (p0) {\n var normal = cartesianCross(p0, p),\n equatorial = [normal[1], -normal[0], 0],\n inflection = cartesianCross(equatorial, normal);\n cartesianNormalizeInPlace(inflection);\n inflection = spherical(inflection);\n var delta = lambda - lambda2,\n sign = delta > 0 ? 1 : -1,\n lambdai = inflection[0] * degrees * sign,\n phii,\n antimeridian = abs(delta) > 180;\n if (antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = inflection[1] * degrees;\n if (phii > phi1) phi1 = phii;\n } else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = -inflection[1] * degrees;\n if (phii < phi0) phi0 = phii;\n } else {\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n }\n if (antimeridian) {\n if (lambda < lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n } else {\n if (lambda1 >= lambda0) {\n if (lambda < lambda0) lambda0 = lambda;\n if (lambda > lambda1) lambda1 = lambda;\n } else {\n if (lambda > lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n }\n }\n } else {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n }\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n p0 = p, lambda2 = lambda;\n}\n\nfunction boundsLineStart() {\n boundsStream.point = linePoint;\n}\n\nfunction boundsLineEnd() {\n range[0] = lambda0, range[1] = lambda1;\n boundsStream.point = boundsPoint;\n p0 = null;\n}\n\nfunction boundsRingPoint(lambda, phi) {\n if (p0) {\n var delta = lambda - lambda2;\n deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);\n } else {\n lambda00 = lambda, phi00 = phi;\n }\n areaStream.point(lambda, phi);\n linePoint(lambda, phi);\n}\n\nfunction boundsRingStart() {\n areaStream.lineStart();\n}\n\nfunction boundsRingEnd() {\n boundsRingPoint(lambda00, phi00);\n areaStream.lineEnd();\n if (abs(deltaSum) > epsilon) lambda0 = -(lambda1 = 180);\n range[0] = lambda0, range[1] = lambda1;\n p0 = null;\n}\n\n// Finds the left-right distance between two longitudes.\n// This is almost the same as (lambda1 - lambda0 + 360°) % 360°, except that we want\n// the distance between ±180° to be 360°.\nfunction angle(lambda0, lambda1) {\n return (lambda1 -= lambda0) < 0 ? lambda1 + 360 : lambda1;\n}\n\nfunction rangeCompare(a, b) {\n return a[0] - b[0];\n}\n\nfunction rangeContains(range, x) {\n return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;\n}\n\nexport default function(feature) {\n var i, n, a, b, merged, deltaMax, delta;\n\n phi1 = lambda1 = -(lambda0 = phi0 = Infinity);\n ranges = [];\n stream(feature, boundsStream);\n\n // First, sort ranges by their minimum longitudes.\n if (n = ranges.length) {\n ranges.sort(rangeCompare);\n\n // Then, merge any ranges that overlap.\n for (i = 1, a = ranges[0], merged = [a]; i < n; ++i) {\n b = ranges[i];\n if (rangeContains(a, b[0]) || rangeContains(a, b[1])) {\n if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];\n if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];\n } else {\n merged.push(a = b);\n }\n }\n\n // Finally, find the largest gap between the merged ranges.\n // The final bounding box will be the inverse of this gap.\n for (deltaMax = -Infinity, n = merged.length - 1, i = 0, a = merged[n]; i <= n; a = b, ++i) {\n b = merged[i];\n if ((delta = angle(a[1], b[0])) > deltaMax) deltaMax = delta, lambda0 = b[0], lambda1 = a[1];\n }\n }\n\n ranges = range = null;\n\n return lambda0 === Infinity || phi0 === Infinity\n ? [[NaN, NaN], [NaN, NaN]]\n : [[lambda0, phi0], [lambda1, phi1]];\n}\n","import {Adder} from \"d3-array\";\nimport {asin, atan2, cos, degrees, epsilon, epsilon2, hypot, radians, sin, sqrt} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nvar W0, W1,\n X0, Y0, Z0,\n X1, Y1, Z1,\n X2, Y2, Z2,\n lambda00, phi00, // first point\n x0, y0, z0; // previous point\n\nvar centroidStream = {\n sphere: noop,\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n }\n};\n\n// Arithmetic mean of Cartesian vectors.\nfunction centroidPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n centroidPointCartesian(cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi));\n}\n\nfunction centroidPointCartesian(x, y, z) {\n ++W0;\n X0 += (x - X0) / W0;\n Y0 += (y - Y0) / W0;\n Z0 += (z - Z0) / W0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidLinePointFirst;\n}\n\nfunction centroidLinePointFirst(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidStream.point = centroidLinePoint;\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLinePoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n w = atan2(sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\n// See J. E. Brock, The Inertia Tensor for a Spherical Triangle,\n// J. Applied Mechanics 42, 239 (1975).\nfunction centroidRingStart() {\n centroidStream.point = centroidRingPointFirst;\n}\n\nfunction centroidRingEnd() {\n centroidRingPoint(lambda00, phi00);\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingPointFirst(lambda, phi) {\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n centroidStream.point = centroidRingPoint;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidRingPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n cx = y0 * z - z0 * y,\n cy = z0 * x - x0 * z,\n cz = x0 * y - y0 * x,\n m = hypot(cx, cy, cz),\n w = asin(m), // line weight = angle\n v = m && -w / m; // area weight multiplier\n X2.add(v * cx);\n Y2.add(v * cy);\n Z2.add(v * cz);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nexport default function(object) {\n W0 = W1 =\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 = 0;\n X2 = new Adder();\n Y2 = new Adder();\n Z2 = new Adder();\n stream(object, centroidStream);\n\n var x = +X2,\n y = +Y2,\n z = +Z2,\n m = hypot(x, y, z);\n\n // If the area-weighted ccentroid is undefined, fall back to length-weighted ccentroid.\n if (m < epsilon2) {\n x = X1, y = Y1, z = Z1;\n // If the feature has zero length, fall back to arithmetic mean of point vectors.\n if (W1 < epsilon) x = X0, y = Y0, z = Z0;\n m = hypot(x, y, z);\n // If the feature still has an undefined ccentroid, then return.\n if (m < epsilon2) return [NaN, NaN];\n }\n\n return [atan2(y, x) * degrees, asin(z / m) * degrees];\n}\n","export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n","import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can’t do this\n // for a comparator (except for specific, known comparators) because we can’t\n // tell if the comparator is symmetric, and an asymmetric comparator can’t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n","import {InternSet} from \"internmap\";\n\nexport default function intersection(values, ...others) {\n values = new InternSet(values);\n others = others.map(set);\n out: for (const value of values) {\n for (const other of others) {\n if (!other.has(value)) {\n values.delete(value);\n continue out;\n }\n }\n }\n return values;\n}\n\nfunction set(values) {\n return values instanceof InternSet ? values : new InternSet(values);\n}\n","import { bisector, union, intersection } from 'd3-array';\nimport { field, isDate, toNumber, isArray, inrange, extend, array, error, peek, hasOwnProperty } from 'vega-util';\nimport { Literal } from 'vega-expression';\n\n// Registers vega-util field accessors to protect against XSS attacks\nconst SELECTION_GETTER = Symbol('vega_selection_getter');\nfunction getter(f) {\n if (!f.getter || !f.getter[SELECTION_GETTER]) {\n f.getter = field(f.field);\n f.getter[SELECTION_GETTER] = true;\n }\n return f.getter;\n}\nconst Intersect = 'intersect';\nconst Union = 'union';\nconst VlMulti = 'vlMulti';\nconst VlPoint = 'vlPoint';\nconst Or = 'or';\nconst And = 'and';\nconst SelectionId = '_vgsid_';\nconst $selectionId = field(SelectionId);\n\nconst TYPE_ENUM = 'E',\n TYPE_RANGE_INC = 'R',\n TYPE_RANGE_EXC = 'R-E',\n TYPE_RANGE_LE = 'R-LE',\n TYPE_RANGE_RE = 'R-RE',\n UNIT_INDEX = 'index:unit';\n\n// TODO: revisit date coercion?\nfunction testPoint(datum, entry) {\n var fields = entry.fields,\n values = entry.values,\n n = fields.length,\n i = 0,\n dval,\n f;\n for (; i < n; ++i) {\n f = fields[i];\n dval = getter(f)(datum);\n if (isDate(dval)) dval = toNumber(dval);\n if (isDate(values[i])) values[i] = toNumber(values[i]);\n if (isArray(values[i]) && isDate(values[i][0])) values[i] = values[i].map(toNumber);\n if (f.type === TYPE_ENUM) {\n // Enumerated fields can either specify individual values (single/multi selections)\n // or an array of values (interval selections).\n if (isArray(values[i]) ? values[i].indexOf(dval) < 0 : dval !== values[i]) {\n return false;\n }\n } else {\n if (f.type === TYPE_RANGE_INC) {\n if (!inrange(dval, values[i])) return false;\n } else if (f.type === TYPE_RANGE_RE) {\n // Discrete selection of bins test within the range [bin_start, bin_end).\n if (!inrange(dval, values[i], true, false)) return false;\n } else if (f.type === TYPE_RANGE_EXC) {\n // 'R-E'/'R-LE' included for completeness.\n if (!inrange(dval, values[i], false, false)) return false;\n } else if (f.type === TYPE_RANGE_LE) {\n if (!inrange(dval, values[i], false, true)) return false;\n }\n }\n }\n return true;\n}\n\n/**\n * Tests if a tuple is contained within an interactive selection.\n * @param {string} name - The name of the data set representing the selection.\n * Tuples in the dataset are of the form\n * {unit: string, fields: array, values: array<*>}.\n * Fielddef is of the form\n * {field: string, channel: string, type: 'E' | 'R'} where\n * 'type' identifies whether tuples in the dataset enumerate\n * values for the field, or specify a continuous range.\n * @param {object} datum - The tuple to test for inclusion.\n * @param {string} op - The set operation for combining selections.\n * One of 'intersect' or 'union' (default).\n * @return {boolean} - True if the datum is in the selection, false otherwise.\n */\nfunction selectionTest(name, datum, op) {\n var data = this.context.data[name],\n entries = data ? data.values.value : [],\n unitIdx = data ? data[UNIT_INDEX] && data[UNIT_INDEX].value : undefined,\n intersect = op === Intersect,\n n = entries.length,\n i = 0,\n entry,\n miss,\n count,\n unit,\n b;\n for (; i < n; ++i) {\n entry = entries[i];\n if (unitIdx && intersect) {\n // multi selections union within the same unit and intersect across units.\n miss = miss || {};\n count = miss[unit = entry.unit] || 0;\n\n // if we've already matched this unit, skip.\n if (count === -1) continue;\n b = testPoint(datum, entry);\n miss[unit] = b ? -1 : ++count;\n\n // if we match and there are no other units return true\n // if we've missed against all tuples in this unit return false\n if (b && unitIdx.size === 1) return true;\n if (!b && count === unitIdx.get(unit).count) return false;\n } else {\n b = testPoint(datum, entry);\n\n // if we find a miss and we do require intersection return false\n // if we find a match and we don't require intersection return true\n if (intersect ^ b) return b;\n }\n }\n\n // if intersecting and we made it here, then we saw no misses\n // if not intersecting, then we saw no matches\n // if no active selections, return false\n return n && intersect;\n}\nconst bisect = bisector($selectionId),\n bisectLeft = bisect.left,\n bisectRight = bisect.right;\nfunction selectionIdTest(name, datum, op) {\n const data = this.context.data[name],\n entries = data ? data.values.value : [],\n unitIdx = data ? data[UNIT_INDEX] && data[UNIT_INDEX].value : undefined,\n intersect = op === Intersect,\n value = $selectionId(datum),\n index = bisectLeft(entries, value);\n if (index === entries.length) return false;\n if ($selectionId(entries[index]) !== value) return false;\n if (unitIdx && intersect) {\n if (unitIdx.size === 1) return true;\n if (bisectRight(entries, value) - index < unitIdx.size) return false;\n }\n return true;\n}\n\n/**\n * Maps an array of scene graph items to an array of selection tuples.\n * @param {string} name - The name of the dataset representing the selection.\n * @param {string} base - The base object that generated tuples extend.\n *\n * @returns {array} An array of selection entries for the given unit.\n */\nfunction selectionTuples(array, base) {\n return array.map(x => extend(base.fields ? {\n values: base.fields.map(f => getter(f)(x.datum))\n } : {\n [SelectionId]: $selectionId(x.datum)\n }, base));\n}\n\n/**\n * Resolves selection for use as a scale domain or reads via the API.\n * @param {string} name - The name of the dataset representing the selection\n * @param {string} [op='union'] - The set operation for combining selections.\n * One of 'intersect' or 'union' (default).\n * @param {boolean} isMulti - Identifies a \"multi\" selection to perform more\n * expensive resolution computation.\n * @param {boolean} vl5 - With Vega-Lite v5, \"multi\" selections are now called \"point\"\n * selections, and thus the resolved tuple should reflect this name.\n * This parameter allows us to reflect this change without triggering\n * a major version bump for Vega.\n * @returns {object} An object of selected fields and values.\n */\nfunction selectionResolve(name, op, isMulti, vl5) {\n var data = this.context.data[name],\n entries = data ? data.values.value : [],\n resolved = {},\n multiRes = {},\n types = {},\n entry,\n fields,\n values,\n unit,\n field,\n value,\n res,\n resUnit,\n type,\n union,\n n = entries.length,\n i = 0,\n j,\n m;\n\n // First union all entries within the same unit.\n for (; i < n; ++i) {\n entry = entries[i];\n unit = entry.unit;\n fields = entry.fields;\n values = entry.values;\n if (fields && values) {\n // Intentional selection stores\n for (j = 0, m = fields.length; j < m; ++j) {\n field = fields[j];\n res = resolved[field.field] || (resolved[field.field] = {});\n resUnit = res[unit] || (res[unit] = []);\n types[field.field] = type = field.type.charAt(0);\n union = ops[`${type}_union`];\n res[unit] = union(resUnit, array(values[j]));\n }\n\n // If the same multi-selection is repeated over views and projected over\n // an encoding, it may operate over different fields making it especially\n // tricky to reliably resolve it. At best, we can de-dupe identical entries\n // but doing so may be more computationally expensive than it is worth.\n // Instead, for now, we simply transform our store representation into\n // a more human-friendly one.\n if (isMulti) {\n resUnit = multiRes[unit] || (multiRes[unit] = []);\n resUnit.push(array(values).reduce((obj, curr, j) => (obj[fields[j].field] = curr, obj), {}));\n }\n } else {\n // Short circuit extensional selectionId stores which hold sorted IDs unique to each unit.\n field = SelectionId;\n value = $selectionId(entry);\n res = resolved[field] || (resolved[field] = {});\n resUnit = res[unit] || (res[unit] = []);\n resUnit.push(value);\n if (isMulti) {\n resUnit = multiRes[unit] || (multiRes[unit] = []);\n resUnit.push({\n [SelectionId]: value\n });\n }\n }\n }\n\n // Then resolve fields across units as per the op.\n op = op || Union;\n if (resolved[SelectionId]) {\n resolved[SelectionId] = ops[`${SelectionId}_${op}`](...Object.values(resolved[SelectionId]));\n } else {\n Object.keys(resolved).forEach(field => {\n resolved[field] = Object.keys(resolved[field]).map(unit => resolved[field][unit]).reduce((acc, curr) => acc === undefined ? curr : ops[`${types[field]}_${op}`](acc, curr));\n });\n }\n entries = Object.keys(multiRes);\n if (isMulti && entries.length) {\n const key = vl5 ? VlPoint : VlMulti;\n resolved[key] = op === Union ? {\n [Or]: entries.reduce((acc, k) => (acc.push(...multiRes[k]), acc), [])\n } : {\n [And]: entries.map(k => ({\n [Or]: multiRes[k]\n }))\n };\n }\n return resolved;\n}\nvar ops = {\n [`${SelectionId}_union`]: union,\n [`${SelectionId}_intersect`]: intersection,\n E_union: function (base, value) {\n if (!base.length) return value;\n var i = 0,\n n = value.length;\n for (; i < n; ++i) if (base.indexOf(value[i]) < 0) base.push(value[i]);\n return base;\n },\n E_intersect: function (base, value) {\n return !base.length ? value : base.filter(v => value.indexOf(v) >= 0);\n },\n R_union: function (base, value) {\n var lo = toNumber(value[0]),\n hi = toNumber(value[1]);\n if (lo > hi) {\n lo = value[1];\n hi = value[0];\n }\n if (!base.length) return [lo, hi];\n if (base[0] > lo) base[0] = lo;\n if (base[1] < hi) base[1] = hi;\n return base;\n },\n R_intersect: function (base, value) {\n var lo = toNumber(value[0]),\n hi = toNumber(value[1]);\n if (lo > hi) {\n lo = value[1];\n hi = value[0];\n }\n if (!base.length) return [lo, hi];\n if (hi < base[0] || base[1] < lo) {\n return [];\n } else {\n if (base[0] < lo) base[0] = lo;\n if (base[1] > hi) base[1] = hi;\n }\n return base;\n }\n};\n\nconst DataPrefix = ':',\n IndexPrefix = '@';\nfunction selectionVisitor(name, args, scope, params) {\n if (args[0].type !== Literal) error('First argument to selection functions must be a string literal.');\n const data = args[0].value,\n op = args.length >= 2 && peek(args).value,\n field = 'unit',\n indexName = IndexPrefix + field,\n dataName = DataPrefix + data;\n\n // eslint-disable-next-line no-prototype-builtins\n if (op === Intersect && !hasOwnProperty(params, indexName)) {\n params[indexName] = scope.getData(data).indataRef(scope, field);\n }\n\n // eslint-disable-next-line no-prototype-builtins\n if (!hasOwnProperty(params, dataName)) {\n params[dataName] = scope.getData(data).tuplesRef();\n }\n}\n\nexport { selectionIdTest, selectionResolve, selectionTest, selectionTuples, selectionVisitor };\n","import {InternSet} from \"internmap\";\n\nexport default function union(...others) {\n const set = new InternSet();\n for (const other of others) {\n for (const o of other) {\n set.add(o);\n }\n }\n return set;\n}\n","import { truthy, error, hasOwnProperty, isFunction, isString, stringValue, extend, isArray, isObject, field, peek, identity, array as array$1, isBoolean, isDate, isNumber, isRegExp, toBoolean, toDate, toNumber, toString, flush, lerp, pad, span, inrange, truncate, quarter, utcquarter, extent, clampRange, panLinear, panLog, panPow, panSymlog, zoomLinear, zoomLog, zoomPow, zoomSymlog } from 'vega-util';\nimport { Literal, codegenExpression, constants, functions, parseExpression, CallExpression } from 'vega-expression';\nimport { isRegisteredScale, bandSpace, scale as scale$1, scaleFraction } from 'vega-scale';\nimport { geoArea as geoArea$1, geoBounds as geoBounds$1, geoCentroid as geoCentroid$1 } from 'd3-geo';\nimport { rgb, lab, hcl, hsl } from 'd3-color';\nimport { isTuple } from 'vega-dataflow';\nimport { Gradient, pathRender, pathParse, Bounds, intersect as intersect$1 } from 'vega-scenegraph';\nimport { selectionVisitor, selectionTest, selectionIdTest, selectionResolve, selectionTuples } from 'vega-selections';\nimport { random, cumulativeNormal, cumulativeLogNormal, cumulativeUniform, densityNormal, densityLogNormal, densityUniform, quantileNormal, quantileLogNormal, quantileUniform, sampleNormal, sampleLogNormal, sampleUniform } from 'vega-statistics';\nimport { utcOffset, utcSequence, timeOffset, timeSequence, timeUnitSpecifier, week, utcweek, dayofyear, utcdayofyear } from 'vega-time';\nimport { range as range$1 } from 'd3-array';\n\nfunction data(name) {\n const data = this.context.data[name];\n return data ? data.values.value : [];\n}\nfunction indata(name, field, value) {\n const index = this.context.data[name]['index:' + field],\n entry = index ? index.value.get(value) : undefined;\n return entry ? entry.count : entry;\n}\nfunction setdata(name, tuples) {\n const df = this.context.dataflow,\n data = this.context.data[name],\n input = data.input;\n df.pulse(input, df.changeset().remove(truthy).insert(tuples));\n return 1;\n}\n\nfunction encode (item, name, retval) {\n if (item) {\n const df = this.context.dataflow,\n target = item.mark.source;\n df.pulse(target, df.changeset().encode(item, name));\n }\n return retval !== undefined ? retval : item;\n}\n\nconst wrap = method => function (value, spec) {\n const locale = this.context.dataflow.locale();\n return value === null ? 'null' : locale[method](spec)(value);\n};\nconst format = wrap('format');\nconst timeFormat = wrap('timeFormat');\nconst utcFormat = wrap('utcFormat');\nconst timeParse = wrap('timeParse');\nconst utcParse = wrap('utcParse');\nconst dateObj = new Date(2000, 0, 1);\nfunction time(month, day, specifier) {\n if (!Number.isInteger(month) || !Number.isInteger(day)) return '';\n dateObj.setYear(2000);\n dateObj.setMonth(month);\n dateObj.setDate(day);\n return timeFormat.call(this, dateObj, specifier);\n}\nfunction monthFormat(month) {\n return time.call(this, month, 1, '%B');\n}\nfunction monthAbbrevFormat(month) {\n return time.call(this, month, 1, '%b');\n}\nfunction dayFormat(day) {\n return time.call(this, 0, 2 + day, '%A');\n}\nfunction dayAbbrevFormat(day) {\n return time.call(this, 0, 2 + day, '%a');\n}\n\nconst DataPrefix = ':';\nconst IndexPrefix = '@';\nconst ScalePrefix = '%';\nconst SignalPrefix = '$';\n\nfunction dataVisitor(name, args, scope, params) {\n if (args[0].type !== Literal) {\n error('First argument to data functions must be a string literal.');\n }\n const data = args[0].value,\n dataName = DataPrefix + data;\n if (!hasOwnProperty(dataName, params)) {\n try {\n params[dataName] = scope.getData(data).tuplesRef();\n } catch (err) {\n // if data set does not exist, there's nothing to track\n }\n }\n}\nfunction indataVisitor(name, args, scope, params) {\n if (args[0].type !== Literal) error('First argument to indata must be a string literal.');\n if (args[1].type !== Literal) error('Second argument to indata must be a string literal.');\n const data = args[0].value,\n field = args[1].value,\n indexName = IndexPrefix + field;\n if (!hasOwnProperty(indexName, params)) {\n params[indexName] = scope.getData(data).indataRef(scope, field);\n }\n}\nfunction scaleVisitor(name, args, scope, params) {\n if (args[0].type === Literal) {\n // add scale dependency\n addScaleDependency(scope, params, args[0].value);\n } else {\n // indirect scale lookup; add all scales as parameters\n for (name in scope.scales) {\n addScaleDependency(scope, params, name);\n }\n }\n}\nfunction addScaleDependency(scope, params, name) {\n const scaleName = ScalePrefix + name;\n if (!hasOwnProperty(params, scaleName)) {\n try {\n params[scaleName] = scope.scaleRef(name);\n } catch (err) {\n // TODO: error handling? warning?\n }\n }\n}\n\nfunction getScale(nameOrFunction, ctx) {\n if (isFunction(nameOrFunction)) {\n return nameOrFunction;\n }\n if (isString(nameOrFunction)) {\n const maybeScale = ctx.scales[nameOrFunction];\n return maybeScale && isRegisteredScale(maybeScale.value) ? maybeScale.value : undefined;\n }\n return undefined;\n}\nfunction internalScaleFunctions(codegen, fnctx, visitors) {\n // add helper method to the 'this' expression function context\n fnctx.__bandwidth = s => s && s.bandwidth ? s.bandwidth() : 0;\n\n // register AST visitors for internal scale functions\n visitors._bandwidth = scaleVisitor;\n visitors._range = scaleVisitor;\n visitors._scale = scaleVisitor;\n\n // resolve scale reference directly to the signal hash argument\n const ref = arg => '_[' + (arg.type === Literal ? stringValue(ScalePrefix + arg.value) : stringValue(ScalePrefix) + '+' + codegen(arg)) + ']';\n\n // define and return internal scale function code generators\n // these internal functions are called by mark encoders\n return {\n _bandwidth: args => `this.__bandwidth(${ref(args[0])})`,\n _range: args => `${ref(args[0])}.range()`,\n _scale: args => `${ref(args[0])}(${codegen(args[1])})`\n };\n}\n\nfunction geoMethod(methodName, globalMethod) {\n return function (projection, geojson, group) {\n if (projection) {\n // projection defined, use it\n const p = getScale(projection, (group || this).context);\n return p && p.path[methodName](geojson);\n } else {\n // projection undefined, use global method\n return globalMethod(geojson);\n }\n };\n}\nconst geoArea = geoMethod('area', geoArea$1);\nconst geoBounds = geoMethod('bounds', geoBounds$1);\nconst geoCentroid = geoMethod('centroid', geoCentroid$1);\nfunction geoScale(projection, group) {\n const p = getScale(projection, (group || this).context);\n return p && p.scale();\n}\n\nfunction inScope (item) {\n const group = this.context.group;\n let value = false;\n if (group) while (item) {\n if (item === group) {\n value = true;\n break;\n }\n item = item.mark.group;\n }\n return value;\n}\n\nfunction log(df, method, args) {\n try {\n df[method].apply(df, ['EXPRESSION'].concat([].slice.call(args)));\n } catch (err) {\n df.warn(err);\n }\n return args[args.length - 1];\n}\nfunction warn() {\n return log(this.context.dataflow, 'warn', arguments);\n}\nfunction info() {\n return log(this.context.dataflow, 'info', arguments);\n}\nfunction debug() {\n return log(this.context.dataflow, 'debug', arguments);\n}\n\n// https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\nfunction channel_luminance_value(channelValue) {\n const val = channelValue / 255;\n if (val <= 0.03928) {\n return val / 12.92;\n }\n return Math.pow((val + 0.055) / 1.055, 2.4);\n}\nfunction luminance(color) {\n const c = rgb(color),\n r = channel_luminance_value(c.r),\n g = channel_luminance_value(c.g),\n b = channel_luminance_value(c.b);\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n}\n\n// https://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef\nfunction contrast(color1, color2) {\n const lum1 = luminance(color1),\n lum2 = luminance(color2),\n lumL = Math.max(lum1, lum2),\n lumD = Math.min(lum1, lum2);\n return (lumL + 0.05) / (lumD + 0.05);\n}\n\nfunction merge () {\n const args = [].slice.call(arguments);\n args.unshift({});\n return extend(...args);\n}\n\nfunction equal(a, b) {\n return a === b || a !== a && b !== b ? true : isArray(a) ? isArray(b) && a.length === b.length ? equalArray(a, b) : false : isObject(a) && isObject(b) ? equalObject(a, b) : false;\n}\nfunction equalArray(a, b) {\n for (let i = 0, n = a.length; i < n; ++i) {\n if (!equal(a[i], b[i])) return false;\n }\n return true;\n}\nfunction equalObject(a, b) {\n for (const key in a) {\n if (!equal(a[key], b[key])) return false;\n }\n return true;\n}\nfunction removePredicate(props) {\n return _ => equalObject(props, _);\n}\nfunction modify (name, insert, remove, toggle, modify, values) {\n const df = this.context.dataflow,\n data = this.context.data[name],\n input = data.input,\n stamp = df.stamp();\n let changes = data.changes,\n predicate,\n key;\n if (df._trigger === false || !(input.value.length || insert || toggle)) {\n // nothing to do!\n return 0;\n }\n if (!changes || changes.stamp < stamp) {\n data.changes = changes = df.changeset();\n changes.stamp = stamp;\n df.runAfter(() => {\n data.modified = true;\n df.pulse(input, changes).run();\n }, true, 1);\n }\n if (remove) {\n predicate = remove === true ? truthy : isArray(remove) || isTuple(remove) ? remove : removePredicate(remove);\n changes.remove(predicate);\n }\n if (insert) {\n changes.insert(insert);\n }\n if (toggle) {\n predicate = removePredicate(toggle);\n if (input.value.some(predicate)) {\n changes.remove(predicate);\n } else {\n changes.insert(toggle);\n }\n }\n if (modify) {\n for (key in values) {\n changes.modify(modify, key, values[key]);\n }\n }\n return 1;\n}\n\nfunction pinchDistance(event) {\n const t = event.touches,\n dx = t[0].clientX - t[1].clientX,\n dy = t[0].clientY - t[1].clientY;\n return Math.hypot(dx, dy);\n}\nfunction pinchAngle(event) {\n const t = event.touches;\n return Math.atan2(t[0].clientY - t[1].clientY, t[0].clientX - t[1].clientX);\n}\n\n// memoize accessor functions\nconst accessors = {};\nfunction pluck (data, name) {\n const accessor = accessors[name] || (accessors[name] = field(name));\n return isArray(data) ? data.map(accessor) : accessor(data);\n}\n\nfunction array(seq) {\n return isArray(seq) || ArrayBuffer.isView(seq) ? seq : null;\n}\nfunction sequence(seq) {\n return array(seq) || (isString(seq) ? seq : null);\n}\nfunction join(seq) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return array(seq).join(...args);\n}\nfunction indexof(seq) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n return sequence(seq).indexOf(...args);\n}\nfunction lastindexof(seq) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n return sequence(seq).lastIndexOf(...args);\n}\nfunction slice(seq) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n return sequence(seq).slice(...args);\n}\nfunction replace(str, pattern, repl) {\n if (isFunction(repl)) error('Function argument passed to replace.');\n return String(str).replace(pattern, repl);\n}\nfunction reverse(seq) {\n return array(seq).slice().reverse();\n}\n\nfunction bandspace(count, paddingInner, paddingOuter) {\n return bandSpace(count || 0, paddingInner || 0, paddingOuter || 0);\n}\nfunction bandwidth(name, group) {\n const s = getScale(name, (group || this).context);\n return s && s.bandwidth ? s.bandwidth() : 0;\n}\nfunction copy(name, group) {\n const s = getScale(name, (group || this).context);\n return s ? s.copy() : undefined;\n}\nfunction domain(name, group) {\n const s = getScale(name, (group || this).context);\n return s ? s.domain() : [];\n}\nfunction invert(name, range, group) {\n const s = getScale(name, (group || this).context);\n return !s ? undefined : isArray(range) ? (s.invertRange || s.invert)(range) : (s.invert || s.invertExtent)(range);\n}\nfunction range(name, group) {\n const s = getScale(name, (group || this).context);\n return s && s.range ? s.range() : [];\n}\nfunction scale(name, value, group) {\n const s = getScale(name, (group || this).context);\n return s ? s(value) : undefined;\n}\n\nfunction scaleGradient (scale, p0, p1, count, group) {\n scale = getScale(scale, (group || this).context);\n const gradient = Gradient(p0, p1);\n let stops = scale.domain(),\n min = stops[0],\n max = peek(stops),\n fraction = identity;\n if (!(max - min)) {\n // expand scale if domain has zero span, fix #1479\n scale = (scale.interpolator ? scale$1('sequential')().interpolator(scale.interpolator()) : scale$1('linear')().interpolate(scale.interpolate()).range(scale.range())).domain([min = 0, max = 1]);\n } else {\n fraction = scaleFraction(scale, min, max);\n }\n if (scale.ticks) {\n stops = scale.ticks(+count || 15);\n if (min !== stops[0]) stops.unshift(min);\n if (max !== peek(stops)) stops.push(max);\n }\n stops.forEach(_ => gradient.stop(fraction(_), scale(_)));\n return gradient;\n}\n\nfunction geoShape(projection, geojson, group) {\n const p = getScale(projection, (group || this).context);\n return function (context) {\n return p ? p.path.context(context)(geojson) : '';\n };\n}\nfunction pathShape(path) {\n let p = null;\n return function (context) {\n return context ? pathRender(context, p = p || pathParse(path)) : path;\n };\n}\n\nconst datum = d => d.data;\nfunction treeNodes(name, context) {\n const tree = data.call(context, name);\n return tree.root && tree.root.lookup || {};\n}\nfunction treePath(name, source, target) {\n const nodes = treeNodes(name, this),\n s = nodes[source],\n t = nodes[target];\n return s && t ? s.path(t).map(datum) : undefined;\n}\nfunction treeAncestors(name, node) {\n const n = treeNodes(name, this)[node];\n return n ? n.ancestors().map(datum) : undefined;\n}\n\nconst _window = () => typeof window !== 'undefined' && window || null;\nfunction screen() {\n const w = _window();\n return w ? w.screen : {};\n}\nfunction windowSize() {\n const w = _window();\n return w ? [w.innerWidth, w.innerHeight] : [undefined, undefined];\n}\nfunction containerSize() {\n const view = this.context.dataflow,\n el = view.container && view.container();\n return el ? [el.clientWidth, el.clientHeight] : [undefined, undefined];\n}\n\nfunction intersect (b, opt, group) {\n if (!b) return [];\n const [u, v] = b,\n box = new Bounds().set(u[0], u[1], v[0], v[1]),\n scene = group || this.context.dataflow.scenegraph().root;\n return intersect$1(scene, box, filter(opt));\n}\nfunction filter(opt) {\n let p = null;\n if (opt) {\n const types = array$1(opt.marktype),\n names = array$1(opt.markname);\n p = _ => (!types.length || types.some(t => _.marktype === t)) && (!names.length || names.some(s => _.name === s));\n }\n return p;\n}\n\n/**\n * Appends a new point to the lasso\n *\n * @param {*} lasso the lasso in pixel space\n * @param {*} x the x coordinate in pixel space\n * @param {*} y the y coordinate in pixel space\n * @param {*} minDist the minimum distance, in pixels, that thenew point needs to be apart from the last point\n * @returns a new array containing the lasso with the new point\n */\nfunction lassoAppend(lasso, x, y) {\n let minDist = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 5;\n lasso = array$1(lasso);\n const last = lasso[lasso.length - 1];\n\n // Add point to lasso if its the first point or distance to last point exceed minDist\n return last === undefined || Math.hypot(last[0] - x, last[1] - y) > minDist ? [...lasso, [x, y]] : lasso;\n}\n\n/**\n * Generates a svg path command which draws a lasso\n *\n * @param {*} lasso the lasso in pixel space in the form [[x,y], [x,y], ...]\n * @returns the svg path command that draws the lasso\n */\nfunction lassoPath(lasso) {\n return array$1(lasso).reduce((svg, _ref, i) => {\n let [x, y] = _ref;\n return svg += i == 0 ? `M ${x},${y} ` : i === lasso.length - 1 ? ' Z' : `L ${x},${y} `;\n }, '');\n}\n\n/**\n * Inverts the lasso from pixel space to an array of vega scenegraph tuples\n *\n * @param {*} data the dataset\n * @param {*} pixelLasso the lasso in pixel space, [[x,y], [x,y], ...]\n * @param {*} unit the unit where the lasso is defined\n *\n * @returns an array of vega scenegraph tuples\n */\nfunction intersectLasso(markname, pixelLasso, unit) {\n const {\n x,\n y,\n mark\n } = unit;\n const bb = new Bounds().set(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER);\n\n // Get bounding box around lasso\n for (const [px, py] of pixelLasso) {\n if (px < bb.x1) bb.x1 = px;\n if (px > bb.x2) bb.x2 = px;\n if (py < bb.y1) bb.y1 = py;\n if (py > bb.y2) bb.y2 = py;\n }\n\n // Translate bb against unit coordinates\n bb.translate(x, y);\n const intersection = intersect([[bb.x1, bb.y1], [bb.x2, bb.y2]], markname, mark);\n\n // Check every point against the lasso\n return intersection.filter(tuple => pointInPolygon(tuple.x, tuple.y, pixelLasso));\n}\n\n/**\n * Performs a test if a point is inside a polygon based on the idea from\n * https://wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html\n *\n * This method will not need the same start/end point since it wraps around the edges of the array\n *\n * @param {*} test a point to test against\n * @param {*} polygon a polygon in the form [[x,y], [x,y], ...]\n * @returns true if the point lies inside the polygon, false otherwise\n */\nfunction pointInPolygon(testx, testy, polygon) {\n let intersections = 0;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const [prevX, prevY] = polygon[j];\n const [x, y] = polygon[i];\n\n // count intersections\n if (y > testy != prevY > testy && testx < (prevX - x) * (testy - y) / (prevY - y) + x) {\n intersections++;\n }\n }\n\n // point is in polygon if intersection count is odd\n return intersections & 1;\n}\n\n// Expression function context object\nconst functionContext = {\n random() {\n return random();\n },\n // override default\n cumulativeNormal,\n cumulativeLogNormal,\n cumulativeUniform,\n densityNormal,\n densityLogNormal,\n densityUniform,\n quantileNormal,\n quantileLogNormal,\n quantileUniform,\n sampleNormal,\n sampleLogNormal,\n sampleUniform,\n isArray,\n isBoolean,\n isDate,\n isDefined(_) {\n return _ !== undefined;\n },\n isNumber,\n isObject,\n isRegExp,\n isString,\n isTuple,\n isValid(_) {\n return _ != null && _ === _;\n },\n toBoolean,\n toDate(_) {\n return toDate(_);\n },\n // suppress extra arguments\n toNumber,\n toString,\n indexof,\n join,\n lastindexof,\n replace,\n reverse,\n slice,\n flush,\n lerp,\n merge,\n pad,\n peek,\n pluck,\n span,\n inrange,\n truncate,\n rgb,\n lab,\n hcl,\n hsl,\n luminance,\n contrast,\n sequence: range$1,\n format,\n utcFormat,\n utcParse,\n utcOffset,\n utcSequence,\n timeFormat,\n timeParse,\n timeOffset,\n timeSequence,\n timeUnitSpecifier,\n monthFormat,\n monthAbbrevFormat,\n dayFormat,\n dayAbbrevFormat,\n quarter,\n utcquarter,\n week,\n utcweek,\n dayofyear,\n utcdayofyear,\n warn,\n info,\n debug,\n extent(_) {\n return extent(_);\n },\n // suppress extra arguments\n inScope,\n intersect,\n clampRange,\n pinchDistance,\n pinchAngle,\n screen,\n containerSize,\n windowSize,\n bandspace,\n setdata,\n pathShape,\n panLinear,\n panLog,\n panPow,\n panSymlog,\n zoomLinear,\n zoomLog,\n zoomPow,\n zoomSymlog,\n encode,\n modify,\n lassoAppend,\n lassoPath,\n intersectLasso\n};\nconst eventFunctions = ['view', 'item', 'group', 'xy', 'x', 'y'],\n // event functions\n eventPrefix = 'event.vega.',\n // event function prefix\n thisPrefix = 'this.',\n // function context prefix\n astVisitors = {}; // AST visitors for dependency analysis\n\n// export code generator parameters\nconst codegenParams = {\n forbidden: ['_'],\n allowed: ['datum', 'event', 'item'],\n fieldvar: 'datum',\n globalvar: id => `_[${stringValue(SignalPrefix + id)}]`,\n functions: buildFunctions,\n constants: constants,\n visitors: astVisitors\n};\n\n// export code generator\nconst codeGenerator = codegenExpression(codegenParams);\n\n// Build expression function registry\nfunction buildFunctions(codegen) {\n const fn = functions(codegen);\n eventFunctions.forEach(name => fn[name] = eventPrefix + name);\n for (const name in functionContext) {\n fn[name] = thisPrefix + name;\n }\n extend(fn, internalScaleFunctions(codegen, functionContext, astVisitors));\n return fn;\n}\n\n// Register an expression function\nfunction expressionFunction(name, fn, visitor) {\n if (arguments.length === 1) {\n return functionContext[name];\n }\n\n // register with the functionContext\n functionContext[name] = fn;\n\n // if there is an astVisitor register that, too\n if (visitor) astVisitors[name] = visitor;\n\n // if the code generator has already been initialized,\n // we need to also register the function with it\n if (codeGenerator) codeGenerator.functions[name] = thisPrefix + name;\n return this;\n}\n\n// register expression functions with ast visitors\nexpressionFunction('bandwidth', bandwidth, scaleVisitor);\nexpressionFunction('copy', copy, scaleVisitor);\nexpressionFunction('domain', domain, scaleVisitor);\nexpressionFunction('range', range, scaleVisitor);\nexpressionFunction('invert', invert, scaleVisitor);\nexpressionFunction('scale', scale, scaleVisitor);\nexpressionFunction('gradient', scaleGradient, scaleVisitor);\nexpressionFunction('geoArea', geoArea, scaleVisitor);\nexpressionFunction('geoBounds', geoBounds, scaleVisitor);\nexpressionFunction('geoCentroid', geoCentroid, scaleVisitor);\nexpressionFunction('geoShape', geoShape, scaleVisitor);\nexpressionFunction('geoScale', geoScale, scaleVisitor);\nexpressionFunction('indata', indata, indataVisitor);\nexpressionFunction('data', data, dataVisitor);\nexpressionFunction('treePath', treePath, dataVisitor);\nexpressionFunction('treeAncestors', treeAncestors, dataVisitor);\n\n// register Vega-Lite selection functions\nexpressionFunction('vlSelectionTest', selectionTest, selectionVisitor);\nexpressionFunction('vlSelectionIdTest', selectionIdTest, selectionVisitor);\nexpressionFunction('vlSelectionResolve', selectionResolve, selectionVisitor);\nexpressionFunction('vlSelectionTuples', selectionTuples);\n\nfunction parser (expr, scope) {\n const params = {};\n\n // parse the expression to an abstract syntax tree (ast)\n let ast;\n try {\n expr = isString(expr) ? expr : stringValue(expr) + '';\n ast = parseExpression(expr);\n } catch (err) {\n error('Expression parse error: ' + expr);\n }\n\n // analyze ast function calls for dependencies\n ast.visit(node => {\n if (node.type !== CallExpression) return;\n const name = node.callee.name,\n visit = codegenParams.visitors[name];\n if (visit) visit(name, node.arguments, scope, params);\n });\n\n // perform code generation\n const gen = codeGenerator(ast);\n\n // collect signal dependencies\n gen.globals.forEach(name => {\n const signalName = SignalPrefix + name;\n if (!hasOwnProperty(params, signalName) && scope.getSignal(name)) {\n params[signalName] = scope.signalRef(name);\n }\n });\n\n // return generated expression code and dependencies\n return {\n $expr: extend({\n code: gen.code\n }, scope.options.ast ? {\n ast\n } : null),\n $fields: gen.fields,\n $params: params\n };\n}\n\nexport { DataPrefix, IndexPrefix, ScalePrefix, SignalPrefix, bandspace, bandwidth, codeGenerator, codegenParams, containerSize, contrast, copy, data, dataVisitor, dayAbbrevFormat, dayFormat, debug, domain, encode, expressionFunction, format, functionContext, geoArea, geoBounds, geoCentroid, geoScale, geoShape, inScope, indata, indataVisitor, indexof, info, invert, join, lastindexof, luminance, merge, modify, monthAbbrevFormat, monthFormat, parser as parseExpression, pathShape, pinchAngle, pinchDistance, pluck, range, replace, reverse, scale, scaleGradient, scaleVisitor, screen, setdata, slice, timeFormat, timeParse, treeAncestors, treePath, utcFormat, utcParse, warn, windowSize };\n","import { toSet, stringValue, error, isArray, isObject, hasOwnProperty, accessor, key, field, array, compare, truthy } from 'vega-util';\nimport { tupleid } from 'vega-dataflow';\n\n/**\n * Parse a serialized dataflow specification.\n */\nfunction parse (spec) {\n const ctx = this,\n operators = spec.operators || [];\n\n // parse background\n if (spec.background) {\n ctx.background = spec.background;\n }\n\n // parse event configuration\n if (spec.eventConfig) {\n ctx.eventConfig = spec.eventConfig;\n }\n\n // parse locale configuration\n if (spec.locale) {\n ctx.locale = spec.locale;\n }\n\n // parse operators\n operators.forEach(entry => ctx.parseOperator(entry));\n\n // parse operator parameters\n operators.forEach(entry => ctx.parseOperatorParameters(entry));\n\n // parse streams\n (spec.streams || []).forEach(entry => ctx.parseStream(entry));\n\n // parse updates\n (spec.updates || []).forEach(entry => ctx.parseUpdate(entry));\n return ctx.resolve();\n}\n\nconst Skip = toSet(['rule']),\n Swap = toSet(['group', 'image', 'rect']);\nfunction adjustSpatial(encode, marktype) {\n let code = '';\n if (Skip[marktype]) return code;\n if (encode.x2) {\n if (encode.x) {\n if (Swap[marktype]) {\n code += 'if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;';\n }\n code += 'o.width=o.x2-o.x;';\n } else {\n code += 'o.x=o.x2-(o.width||0);';\n }\n }\n if (encode.xc) {\n code += 'o.x=o.xc-(o.width||0)/2;';\n }\n if (encode.y2) {\n if (encode.y) {\n if (Swap[marktype]) {\n code += 'if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;';\n }\n code += 'o.height=o.y2-o.y;';\n } else {\n code += 'o.y=o.y2-(o.height||0);';\n }\n }\n if (encode.yc) {\n code += 'o.y=o.yc-(o.height||0)/2;';\n }\n return code;\n}\nfunction canonicalType(type) {\n return (type + '').toLowerCase();\n}\nfunction isOperator(type) {\n return canonicalType(type) === 'operator';\n}\nfunction isCollect(type) {\n return canonicalType(type) === 'collect';\n}\n\nfunction expression(ctx, args, code) {\n // wrap code in return statement if expression does not terminate\n if (!code.endsWith(';')) {\n code = 'return(' + code + ');';\n }\n const fn = Function(...args.concat(code));\n return ctx && ctx.functions ? fn.bind(ctx.functions) : fn;\n}\n\n// generate code for comparing a single field\nfunction _compare(u, v, lt, gt) {\n return `((u = ${u}) < (v = ${v}) || u == null) && v != null ? ${lt}\n : (u > v || v == null) && u != null ? ${gt}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${lt}\n : v !== v && u === u ? ${gt} : `;\n}\nvar expressionCodegen = {\n /**\n * Parse an expression used to update an operator value.\n */\n operator: (ctx, expr) => expression(ctx, ['_'], expr.code),\n /**\n * Parse an expression provided as an operator parameter value.\n */\n parameter: (ctx, expr) => expression(ctx, ['datum', '_'], expr.code),\n /**\n * Parse an expression applied to an event stream.\n */\n event: (ctx, expr) => expression(ctx, ['event'], expr.code),\n /**\n * Parse an expression used to handle an event-driven operator update.\n */\n handler: (ctx, expr) => {\n const code = `var datum=event.item&&event.item.datum;return ${expr.code};`;\n return expression(ctx, ['_', 'event'], code);\n },\n /**\n * Parse an expression that performs visual encoding.\n */\n encode: (ctx, encode) => {\n const {\n marktype,\n channels\n } = encode;\n let code = 'var o=item,datum=o.datum,m=0,$;';\n for (const name in channels) {\n const o = 'o[' + stringValue(name) + ']';\n code += `$=${channels[name].code};if(${o}!==$)${o}=$,m=1;`;\n }\n code += adjustSpatial(channels, marktype);\n code += 'return m;';\n return expression(ctx, ['item', '_'], code);\n },\n /**\n * Optimized code generators for access and comparison.\n */\n codegen: {\n get(path) {\n const ref = `[${path.map(stringValue).join('][')}]`;\n const get = Function('_', `return _${ref};`);\n get.path = ref;\n return get;\n },\n comparator(fields, orders) {\n let t;\n const map = (f, i) => {\n const o = orders[i];\n let u, v;\n if (f.path) {\n u = `a${f.path}`;\n v = `b${f.path}`;\n } else {\n (t = t || {})['f' + i] = f;\n u = `this.f${i}(a)`;\n v = `this.f${i}(b)`;\n }\n return _compare(u, v, -o, o);\n };\n const fn = Function('a', 'b', 'var u, v; return ' + fields.map(map).join('') + '0;');\n return t ? fn.bind(t) : fn;\n }\n }\n};\n\n/**\n * Parse a dataflow operator.\n */\nfunction parseOperator(spec) {\n const ctx = this;\n if (isOperator(spec.type) || !spec.type) {\n ctx.operator(spec, spec.update ? ctx.operatorExpression(spec.update) : null);\n } else {\n ctx.transform(spec, spec.type);\n }\n}\n\n/**\n * Parse and assign operator parameters.\n */\nfunction parseOperatorParameters(spec) {\n const ctx = this;\n if (spec.params) {\n const op = ctx.get(spec.id);\n if (!op) error('Invalid operator id: ' + spec.id);\n ctx.dataflow.connect(op, op.parameters(ctx.parseParameters(spec.params), spec.react, spec.initonly));\n }\n}\n\n/**\n * Parse a set of operator parameters.\n */\nfunction parseParameters(spec, params) {\n params = params || {};\n const ctx = this;\n for (const key in spec) {\n const value = spec[key];\n params[key] = isArray(value) ? value.map(v => parseParameter(v, ctx, params)) : parseParameter(value, ctx, params);\n }\n return params;\n}\n\n/**\n * Parse a single parameter.\n */\nfunction parseParameter(spec, ctx, params) {\n if (!spec || !isObject(spec)) return spec;\n for (let i = 0, n = PARSERS.length, p; i < n; ++i) {\n p = PARSERS[i];\n if (hasOwnProperty(spec, p.key)) {\n return p.parse(spec, ctx, params);\n }\n }\n return spec;\n}\n\n/** Reference parsers. */\nvar PARSERS = [{\n key: '$ref',\n parse: getOperator\n}, {\n key: '$key',\n parse: getKey\n}, {\n key: '$expr',\n parse: getExpression\n}, {\n key: '$field',\n parse: getField\n}, {\n key: '$encode',\n parse: getEncode\n}, {\n key: '$compare',\n parse: getCompare\n}, {\n key: '$context',\n parse: getContext\n}, {\n key: '$subflow',\n parse: getSubflow\n}, {\n key: '$tupleid',\n parse: getTupleId\n}];\n\n/**\n * Resolve an operator reference.\n */\nfunction getOperator(_, ctx) {\n return ctx.get(_.$ref) || error('Operator not defined: ' + _.$ref);\n}\n\n/**\n * Resolve an expression reference.\n */\nfunction getExpression(_, ctx, params) {\n if (_.$params) {\n // parse expression parameters\n ctx.parseParameters(_.$params, params);\n }\n const k = 'e:' + _.$expr.code;\n return ctx.fn[k] || (ctx.fn[k] = accessor(ctx.parameterExpression(_.$expr), _.$fields));\n}\n\n/**\n * Resolve a key accessor reference.\n */\nfunction getKey(_, ctx) {\n const k = 'k:' + _.$key + '_' + !!_.$flat;\n return ctx.fn[k] || (ctx.fn[k] = key(_.$key, _.$flat, ctx.expr.codegen));\n}\n\n/**\n * Resolve a field accessor reference.\n */\nfunction getField(_, ctx) {\n if (!_.$field) return null;\n const k = 'f:' + _.$field + '_' + _.$name;\n return ctx.fn[k] || (ctx.fn[k] = field(_.$field, _.$name, ctx.expr.codegen));\n}\n\n/**\n * Resolve a comparator function reference.\n */\nfunction getCompare(_, ctx) {\n // As of Vega 5.5.3, $tupleid sort is no longer used.\n // Keep here for now for backwards compatibility.\n const k = 'c:' + _.$compare + '_' + _.$order,\n c = array(_.$compare).map(_ => _ && _.$tupleid ? tupleid : _);\n return ctx.fn[k] || (ctx.fn[k] = compare(c, _.$order, ctx.expr.codegen));\n}\n\n/**\n * Resolve an encode operator reference.\n */\nfunction getEncode(_, ctx) {\n const spec = _.$encode,\n encode = {};\n for (const name in spec) {\n const enc = spec[name];\n encode[name] = accessor(ctx.encodeExpression(enc.$expr), enc.$fields);\n encode[name].output = enc.$output;\n }\n return encode;\n}\n\n/**\n * Resolve a context reference.\n */\nfunction getContext(_, ctx) {\n return ctx;\n}\n\n/**\n * Resolve a recursive subflow specification.\n */\nfunction getSubflow(_, ctx) {\n const spec = _.$subflow;\n return function (dataflow, key, parent) {\n const subctx = ctx.fork().parse(spec),\n op = subctx.get(spec.operators[0].id),\n p = subctx.signals.parent;\n if (p) p.set(parent);\n op.detachSubflow = () => ctx.detach(subctx);\n return op;\n };\n}\n\n/**\n * Resolve a tuple id reference.\n */\nfunction getTupleId() {\n return tupleid;\n}\n\n/**\n * Parse an event stream specification.\n */\nfunction parseStream (spec) {\n var ctx = this,\n filter = spec.filter != null ? ctx.eventExpression(spec.filter) : undefined,\n stream = spec.stream != null ? ctx.get(spec.stream) : undefined,\n args;\n if (spec.source) {\n stream = ctx.events(spec.source, spec.type, filter);\n } else if (spec.merge) {\n args = spec.merge.map(_ => ctx.get(_));\n stream = args[0].merge.apply(args[0], args.slice(1));\n }\n if (spec.between) {\n args = spec.between.map(_ => ctx.get(_));\n stream = stream.between(args[0], args[1]);\n }\n if (spec.filter) {\n stream = stream.filter(filter);\n }\n if (spec.throttle != null) {\n stream = stream.throttle(+spec.throttle);\n }\n if (spec.debounce != null) {\n stream = stream.debounce(+spec.debounce);\n }\n if (stream == null) {\n error('Invalid stream definition: ' + JSON.stringify(spec));\n }\n if (spec.consume) stream.consume(true);\n ctx.stream(spec, stream);\n}\n\n/**\n * Parse an event-driven operator update.\n */\nfunction parseUpdate (spec) {\n var ctx = this,\n srcid = isObject(srcid = spec.source) ? srcid.$ref : srcid,\n source = ctx.get(srcid),\n target = null,\n update = spec.update,\n params = undefined;\n if (!source) error('Source not defined: ' + spec.source);\n target = spec.target && spec.target.$expr ? ctx.eventExpression(spec.target.$expr) : ctx.get(spec.target);\n if (update && update.$expr) {\n if (update.$params) {\n params = ctx.parseParameters(update.$params);\n }\n update = ctx.handlerExpression(update.$expr);\n }\n ctx.update(spec, source, target, update, params);\n}\n\nconst SKIP = {\n skip: true\n};\nfunction getState(options) {\n var ctx = this,\n state = {};\n if (options.signals) {\n var signals = state.signals = {};\n Object.keys(ctx.signals).forEach(key => {\n const op = ctx.signals[key];\n if (options.signals(key, op)) {\n signals[key] = op.value;\n }\n });\n }\n if (options.data) {\n var data = state.data = {};\n Object.keys(ctx.data).forEach(key => {\n const dataset = ctx.data[key];\n if (options.data(key, dataset)) {\n data[key] = dataset.input.value;\n }\n });\n }\n if (ctx.subcontext && options.recurse !== false) {\n state.subcontext = ctx.subcontext.map(ctx => ctx.getState(options));\n }\n return state;\n}\nfunction setState(state) {\n var ctx = this,\n df = ctx.dataflow,\n data = state.data,\n signals = state.signals;\n Object.keys(signals || {}).forEach(key => {\n df.update(ctx.signals[key], signals[key], SKIP);\n });\n Object.keys(data || {}).forEach(key => {\n df.pulse(ctx.data[key].input, df.changeset().remove(truthy).insert(data[key]));\n });\n (state.subcontext || []).forEach((substate, i) => {\n const subctx = ctx.subcontext[i];\n if (subctx) subctx.setState(substate);\n });\n}\n\n/**\n * Context objects store the current parse state.\n * Enables lookup of parsed operators, event streams, accessors, etc.\n * Provides a 'fork' method for creating child contexts for subflows.\n */\nfunction context (df, transforms, functions, expr) {\n return new Context(df, transforms, functions, expr);\n}\nfunction Context(df, transforms, functions, expr) {\n this.dataflow = df;\n this.transforms = transforms;\n this.events = df.events.bind(df);\n this.expr = expr || expressionCodegen, this.signals = {};\n this.scales = {};\n this.nodes = {};\n this.data = {};\n this.fn = {};\n if (functions) {\n this.functions = Object.create(functions);\n this.functions.context = this;\n }\n}\nfunction Subcontext(ctx) {\n this.dataflow = ctx.dataflow;\n this.transforms = ctx.transforms;\n this.events = ctx.events;\n this.expr = ctx.expr;\n this.signals = Object.create(ctx.signals);\n this.scales = Object.create(ctx.scales);\n this.nodes = Object.create(ctx.nodes);\n this.data = Object.create(ctx.data);\n this.fn = Object.create(ctx.fn);\n if (ctx.functions) {\n this.functions = Object.create(ctx.functions);\n this.functions.context = this;\n }\n}\nContext.prototype = Subcontext.prototype = {\n fork() {\n const ctx = new Subcontext(this);\n (this.subcontext || (this.subcontext = [])).push(ctx);\n return ctx;\n },\n detach(ctx) {\n this.subcontext = this.subcontext.filter(c => c !== ctx);\n\n // disconnect all nodes in the subcontext\n // wipe out targets first for better efficiency\n const keys = Object.keys(ctx.nodes);\n for (const key of keys) ctx.nodes[key]._targets = null;\n for (const key of keys) ctx.nodes[key].detach();\n ctx.nodes = null;\n },\n get(id) {\n return this.nodes[id];\n },\n set(id, node) {\n return this.nodes[id] = node;\n },\n add(spec, op) {\n const ctx = this,\n df = ctx.dataflow,\n data = spec.value;\n ctx.set(spec.id, op);\n if (isCollect(spec.type) && data) {\n if (data.$ingest) {\n df.ingest(op, data.$ingest, data.$format);\n } else if (data.$request) {\n df.preload(op, data.$request, data.$format);\n } else {\n df.pulse(op, df.changeset().insert(data));\n }\n }\n if (spec.root) {\n ctx.root = op;\n }\n if (spec.parent) {\n let p = ctx.get(spec.parent.$ref);\n if (p) {\n df.connect(p, [op]);\n op.targets().add(p);\n } else {\n (ctx.unresolved = ctx.unresolved || []).push(() => {\n p = ctx.get(spec.parent.$ref);\n df.connect(p, [op]);\n op.targets().add(p);\n });\n }\n }\n if (spec.signal) {\n ctx.signals[spec.signal] = op;\n }\n if (spec.scale) {\n ctx.scales[spec.scale] = op;\n }\n if (spec.data) {\n for (const name in spec.data) {\n const data = ctx.data[name] || (ctx.data[name] = {});\n spec.data[name].forEach(role => data[role] = op);\n }\n }\n },\n resolve() {\n (this.unresolved || []).forEach(fn => fn());\n delete this.unresolved;\n return this;\n },\n operator(spec, update) {\n this.add(spec, this.dataflow.add(spec.value, update));\n },\n transform(spec, type) {\n this.add(spec, this.dataflow.add(this.transforms[canonicalType(type)]));\n },\n stream(spec, stream) {\n this.set(spec.id, stream);\n },\n update(spec, stream, target, update, params) {\n this.dataflow.on(stream, target, update, params, spec.options);\n },\n // expression parsing\n operatorExpression(expr) {\n return this.expr.operator(this, expr);\n },\n parameterExpression(expr) {\n return this.expr.parameter(this, expr);\n },\n eventExpression(expr) {\n return this.expr.event(this, expr);\n },\n handlerExpression(expr) {\n return this.expr.handler(this, expr);\n },\n encodeExpression(encode) {\n return this.expr.encode(this, encode);\n },\n // parse methods\n parse,\n parseOperator,\n parseOperatorParameters,\n parseParameters,\n parseStream,\n parseUpdate,\n // state methods\n getState,\n setState\n};\n\nexport { context };\n","import { isString, hasOwnProperty, error, truthy, constant, extend, array, isObject, isArray, toSet, debounce, isDate, inherits, stringValue } from 'vega-util';\nimport { changeset, isChangeSet, EventStream, transforms, Dataflow, asyncCallback } from 'vega-dataflow';\nimport { point, renderModule, CanvasHandler, RenderType, Scenegraph } from 'vega-scenegraph';\nimport { tickStep } from 'd3-array';\nimport { functionContext } from 'vega-functions';\nimport { context } from 'vega-runtime';\nimport { interval } from 'd3-timer';\nimport { locale } from 'vega-format';\n\n// initialize aria role and label attributes\nfunction initializeAria(view) {\n const el = view.container();\n if (el) {\n el.setAttribute('role', 'graphics-document');\n el.setAttribute('aria-roleDescription', 'visualization');\n ariaLabel(el, view.description());\n }\n}\n\n// update aria-label if we have a DOM container element\nfunction ariaLabel(el, desc) {\n if (el) desc == null ? el.removeAttribute('aria-label') : el.setAttribute('aria-label', desc);\n}\n\nfunction background (view) {\n // respond to background signal\n view.add(null, _ => {\n view._background = _.bg;\n view._resize = 1;\n return _.bg;\n }, {\n bg: view._signals.background\n });\n}\n\nconst Default = 'default';\nfunction cursor (view) {\n // get cursor signal, add to dataflow if needed\n const cursor = view._signals.cursor || (view._signals.cursor = view.add({\n user: Default,\n item: null\n }));\n\n // evaluate cursor on each pointermove event\n view.on(view.events('view', 'pointermove'), cursor, (_, event) => {\n const value = cursor.value,\n user = value ? isString(value) ? value : value.user : Default,\n item = event.item && event.item.cursor || null;\n return value && user === value.user && item == value.item ? value : {\n user: user,\n item: item\n };\n });\n\n // when cursor signal updates, set visible cursor\n view.add(null, function (_) {\n let user = _.cursor,\n item = this.value;\n if (!isString(user)) {\n item = user.item;\n user = user.user;\n }\n setCursor(view, user && user !== Default ? user : item || user);\n return item;\n }, {\n cursor: cursor\n });\n}\nfunction setCursor(view, cursor) {\n const el = view.globalCursor() ? typeof document !== 'undefined' && document.body : view.container();\n if (el) {\n return cursor == null ? el.style.removeProperty('cursor') : el.style.cursor = cursor;\n }\n}\n\nfunction dataref(view, name) {\n var data = view._runtime.data;\n if (!hasOwnProperty(data, name)) {\n error('Unrecognized data set: ' + name);\n }\n return data[name];\n}\nfunction data(name, values) {\n return arguments.length < 2 ? dataref(this, name).values.value : change.call(this, name, changeset().remove(truthy).insert(values));\n}\nfunction change(name, changes) {\n if (!isChangeSet(changes)) {\n error('Second argument to changes must be a changeset.');\n }\n const dataset = dataref(this, name);\n dataset.modified = true;\n return this.pulse(dataset.input, changes);\n}\nfunction insert(name, _) {\n return change.call(this, name, changeset().insert(_));\n}\nfunction remove(name, _) {\n return change.call(this, name, changeset().remove(_));\n}\n\nfunction width(view) {\n var padding = view.padding();\n return Math.max(0, view._viewWidth + padding.left + padding.right);\n}\nfunction height(view) {\n var padding = view.padding();\n return Math.max(0, view._viewHeight + padding.top + padding.bottom);\n}\nfunction offset(view) {\n var padding = view.padding(),\n origin = view._origin;\n return [padding.left + origin[0], padding.top + origin[1]];\n}\nfunction resizeRenderer(view) {\n var origin = offset(view),\n w = width(view),\n h = height(view);\n view._renderer.background(view.background());\n view._renderer.resize(w, h, origin);\n view._handler.origin(origin);\n view._resizeListeners.forEach(handler => {\n try {\n handler(w, h);\n } catch (error) {\n view.error(error);\n }\n });\n}\n\n/**\n * Extend an event with additional view-specific methods.\n * Adds a new property ('vega') to an event that provides a number\n * of methods for querying information about the current interaction.\n * The vega object provides the following methods:\n * view - Returns the backing View instance.\n * item - Returns the currently active scenegraph item (if any).\n * group - Returns the currently active scenegraph group (if any).\n * This method accepts a single string-typed argument indicating the name\n * of the desired parent group. The scenegraph will be traversed from\n * the item up towards the root to search for a matching group. If no\n * argument is provided the enclosing group for the active item is\n * returned, unless the item it itself a group, in which case it is\n * returned directly.\n * xy - Returns a two-element array containing the x and y coordinates for\n * mouse or touch events. For touch events, this is based on the first\n * elements in the changedTouches array. This method accepts a single\n * argument: either an item instance or mark name that should serve as\n * the reference coordinate system. If no argument is provided the\n * top-level view coordinate system is assumed.\n * x - Returns the current x-coordinate, accepts the same arguments as xy.\n * y - Returns the current y-coordinate, accepts the same arguments as xy.\n * @param {Event} event - The input event to extend.\n * @param {Item} item - The currently active scenegraph item (if any).\n * @return {Event} - The extended input event.\n */\nfunction eventExtend (view, event, item) {\n var r = view._renderer,\n el = r && r.canvas(),\n p,\n e,\n translate;\n if (el) {\n translate = offset(view);\n e = event.changedTouches ? event.changedTouches[0] : event;\n p = point(e, el);\n p[0] -= translate[0];\n p[1] -= translate[1];\n }\n event.dataflow = view;\n event.item = item;\n event.vega = extension(view, item, p);\n return event;\n}\nfunction extension(view, item, point) {\n const itemGroup = item ? item.mark.marktype === 'group' ? item : item.mark.group : null;\n function group(name) {\n var g = itemGroup,\n i;\n if (name) for (i = item; i; i = i.mark.group) {\n if (i.mark.name === name) {\n g = i;\n break;\n }\n }\n return g && g.mark && g.mark.interactive ? g : {};\n }\n function xy(item) {\n if (!item) return point;\n if (isString(item)) item = group(item);\n const p = point.slice();\n while (item) {\n p[0] -= item.x || 0;\n p[1] -= item.y || 0;\n item = item.mark && item.mark.group;\n }\n return p;\n }\n return {\n view: constant(view),\n item: constant(item || {}),\n group: group,\n xy: xy,\n x: item => xy(item)[0],\n y: item => xy(item)[1]\n };\n}\n\nconst VIEW = 'view',\n TIMER = 'timer',\n WINDOW = 'window',\n NO_TRAP = {\n trap: false\n };\n\n/**\n * Initialize event handling configuration.\n * @param {object} config - The configuration settings.\n * @return {object}\n */\nfunction initializeEventConfig(config) {\n const events = extend({\n defaults: {}\n }, config);\n const unpack = (obj, keys) => {\n keys.forEach(k => {\n if (isArray(obj[k])) obj[k] = toSet(obj[k]);\n });\n };\n unpack(events.defaults, ['prevent', 'allow']);\n unpack(events, ['view', 'window', 'selector']);\n return events;\n}\nfunction trackEventListener(view, sources, type, handler) {\n view._eventListeners.push({\n type: type,\n sources: array(sources),\n handler: handler\n });\n}\nfunction prevent(view, type) {\n var def = view._eventConfig.defaults,\n prevent = def.prevent,\n allow = def.allow;\n return prevent === false || allow === true ? false : prevent === true || allow === false ? true : prevent ? prevent[type] : allow ? !allow[type] : view.preventDefault();\n}\nfunction permit(view, key, type) {\n const rule = view._eventConfig && view._eventConfig[key];\n if (rule === false || isObject(rule) && !rule[type]) {\n view.warn(`Blocked ${key} ${type} event listener.`);\n return false;\n }\n return true;\n}\n\n/**\n * Create a new event stream from an event source.\n * @param {object} source - The event source to monitor.\n * @param {string} type - The event type.\n * @param {function(object): boolean} [filter] - Event filter function.\n * @return {EventStream}\n */\nfunction events(source, type, filter) {\n var view = this,\n s = new EventStream(filter),\n send = function (e, item) {\n view.runAsync(null, () => {\n if (source === VIEW && prevent(view, type)) {\n e.preventDefault();\n }\n s.receive(eventExtend(view, e, item));\n });\n },\n sources;\n if (source === TIMER) {\n if (permit(view, 'timer', type)) {\n view.timer(send, type);\n }\n } else if (source === VIEW) {\n if (permit(view, 'view', type)) {\n // send traps errors, so use {trap: false} option\n view.addEventListener(type, send, NO_TRAP);\n }\n } else {\n if (source === WINDOW) {\n if (permit(view, 'window', type) && typeof window !== 'undefined') {\n sources = [window];\n }\n } else if (typeof document !== 'undefined') {\n if (permit(view, 'selector', type)) {\n sources = Array.from(document.querySelectorAll(source));\n }\n }\n if (!sources) {\n view.warn('Can not resolve event source: ' + source);\n } else {\n for (var i = 0, n = sources.length; i < n; ++i) {\n sources[i].addEventListener(type, send);\n }\n trackEventListener(view, sources, type, send);\n }\n }\n return s;\n}\n\nfunction itemFilter(event) {\n return event.item;\n}\nfunction markTarget(event) {\n // grab upstream collector feeding the mark operator\n return event.item.mark.source;\n}\nfunction invoke(name) {\n return function (_, event) {\n return event.vega.view().changeset().encode(event.item, name);\n };\n}\nfunction hover (hoverSet, leaveSet) {\n hoverSet = [hoverSet || 'hover'];\n leaveSet = [leaveSet || 'update', hoverSet[0]];\n\n // invoke hover set upon pointerover\n this.on(this.events('view', 'pointerover', itemFilter), markTarget, invoke(hoverSet));\n\n // invoke leave set upon pointerout\n this.on(this.events('view', 'pointerout', itemFilter), markTarget, invoke(leaveSet));\n return this;\n}\n\n/**\n * Finalize a View instance that is being removed.\n * Cancel any running timers.\n * Remove all external event listeners.\n * Remove any currently displayed tooltip.\n */\nfunction finalize () {\n var tooltip = this._tooltip,\n timers = this._timers,\n handlers = this._handler.handlers(),\n listeners = this._eventListeners,\n n,\n m,\n e,\n h,\n t;\n n = timers.length;\n while (--n >= 0) {\n timers[n].stop();\n }\n n = listeners.length;\n while (--n >= 0) {\n e = listeners[n];\n m = e.sources.length;\n while (--m >= 0) {\n e.sources[m].removeEventListener(e.type, e.handler);\n }\n }\n if (tooltip) {\n tooltip.call(this, this._handler, null, null, null);\n }\n\n // turn off all registered handlers\n n = handlers.length;\n while (--n >= 0) {\n t = handlers[n].type;\n h = handlers[n].handler;\n this._handler.off(t, h);\n }\n return this;\n}\n\nfunction element (tag, attr, text) {\n const el = document.createElement(tag);\n for (const key in attr) el.setAttribute(key, attr[key]);\n if (text != null) el.textContent = text;\n return el;\n}\n\nconst BindClass = 'vega-bind',\n NameClass = 'vega-bind-name',\n RadioClass = 'vega-bind-radio';\n\n/**\n * Bind a signal to an external HTML input element. The resulting two-way\n * binding will propagate input changes to signals, and propagate signal\n * changes to the input element state. If this view instance has no parent\n * element, we assume the view is headless and no bindings are created.\n * @param {Element|string} el - The parent DOM element to which the input\n * element should be appended as a child. If string-valued, this argument\n * will be treated as a CSS selector. If null or undefined, the parent\n * element of this view will be used as the element.\n * @param {object} param - The binding parameters which specify the signal\n * to bind to, the input element type, and type-specific configuration.\n * @return {View} - This view instance.\n */\nfunction bind (view, el, binding) {\n if (!el) return;\n const param = binding.param;\n let bind = binding.state;\n if (!bind) {\n bind = binding.state = {\n elements: null,\n active: false,\n set: null,\n update: value => {\n if (value != view.signal(param.signal)) {\n view.runAsync(null, () => {\n bind.source = true;\n view.signal(param.signal, value);\n });\n }\n }\n };\n if (param.debounce) {\n bind.update = debounce(param.debounce, bind.update);\n }\n }\n const create = param.input == null && param.element ? target : generate;\n create(bind, el, param, view);\n if (!bind.active) {\n view.on(view._signals[param.signal], null, () => {\n bind.source ? bind.source = false : bind.set(view.signal(param.signal));\n });\n bind.active = true;\n }\n return bind;\n}\n\n/**\n * Bind the signal to an external EventTarget.\n */\nfunction target(bind, node, param, view) {\n const type = param.event || 'input';\n const handler = () => bind.update(node.value);\n\n // initialize signal value to external input value\n view.signal(param.signal, node.value);\n\n // listen for changes on the element\n node.addEventListener(type, handler);\n\n // register with view, so we can remove it upon finalization\n trackEventListener(view, node, type, handler);\n\n // propagate change to element\n bind.set = value => {\n node.value = value;\n node.dispatchEvent(event(type));\n };\n}\nfunction event(type) {\n return typeof Event !== 'undefined' ? new Event(type) : {\n type\n };\n}\n\n/**\n * Generate an HTML input form element and bind it to a signal.\n */\nfunction generate(bind, el, param, view) {\n const value = view.signal(param.signal);\n const div = element('div', {\n 'class': BindClass\n });\n const wrapper = param.input === 'radio' ? div : div.appendChild(element('label'));\n wrapper.appendChild(element('span', {\n 'class': NameClass\n }, param.name || param.signal));\n el.appendChild(div);\n let input = form;\n switch (param.input) {\n case 'checkbox':\n input = checkbox;\n break;\n case 'select':\n input = select;\n break;\n case 'radio':\n input = radio;\n break;\n case 'range':\n input = range;\n break;\n }\n input(bind, wrapper, param, value);\n}\n\n/**\n * Generates an arbitrary input form element.\n * The input type is controlled via user-provided parameters.\n */\nfunction form(bind, el, param, value) {\n const node = element('input');\n for (const key in param) {\n if (key !== 'signal' && key !== 'element') {\n node.setAttribute(key === 'input' ? 'type' : key, param[key]);\n }\n }\n node.setAttribute('name', param.signal);\n node.value = value;\n el.appendChild(node);\n node.addEventListener('input', () => bind.update(node.value));\n bind.elements = [node];\n bind.set = value => node.value = value;\n}\n\n/**\n * Generates a checkbox input element.\n */\nfunction checkbox(bind, el, param, value) {\n const attr = {\n type: 'checkbox',\n name: param.signal\n };\n if (value) attr.checked = true;\n const node = element('input', attr);\n el.appendChild(node);\n node.addEventListener('change', () => bind.update(node.checked));\n bind.elements = [node];\n bind.set = value => node.checked = !!value || null;\n}\n\n/**\n * Generates a selection list input element.\n */\nfunction select(bind, el, param, value) {\n const node = element('select', {\n name: param.signal\n }),\n labels = param.labels || [];\n param.options.forEach((option, i) => {\n const attr = {\n value: option\n };\n if (valuesEqual(option, value)) attr.selected = true;\n node.appendChild(element('option', attr, (labels[i] || option) + ''));\n });\n el.appendChild(node);\n node.addEventListener('change', () => {\n bind.update(param.options[node.selectedIndex]);\n });\n bind.elements = [node];\n bind.set = value => {\n for (let i = 0, n = param.options.length; i < n; ++i) {\n if (valuesEqual(param.options[i], value)) {\n node.selectedIndex = i;\n return;\n }\n }\n };\n}\n\n/**\n * Generates a radio button group.\n */\nfunction radio(bind, el, param, value) {\n const group = element('span', {\n 'class': RadioClass\n }),\n labels = param.labels || [];\n el.appendChild(group);\n bind.elements = param.options.map((option, i) => {\n const attr = {\n type: 'radio',\n name: param.signal,\n value: option\n };\n if (valuesEqual(option, value)) attr.checked = true;\n const input = element('input', attr);\n input.addEventListener('change', () => bind.update(option));\n const label = element('label', {}, (labels[i] || option) + '');\n label.prepend(input);\n group.appendChild(label);\n return input;\n });\n bind.set = value => {\n const nodes = bind.elements,\n n = nodes.length;\n for (let i = 0; i < n; ++i) {\n if (valuesEqual(nodes[i].value, value)) nodes[i].checked = true;\n }\n };\n}\n\n/**\n * Generates a slider input element.\n */\nfunction range(bind, el, param, value) {\n value = value !== undefined ? value : (+param.max + +param.min) / 2;\n const max = param.max != null ? param.max : Math.max(100, +value) || 100,\n min = param.min || Math.min(0, max, +value) || 0,\n step = param.step || tickStep(min, max, 100);\n const node = element('input', {\n type: 'range',\n name: param.signal,\n min: min,\n max: max,\n step: step\n });\n node.value = value;\n const span = element('span', {}, +value);\n el.appendChild(node);\n el.appendChild(span);\n const update = () => {\n span.textContent = node.value;\n bind.update(+node.value);\n };\n\n // subscribe to both input and change\n node.addEventListener('input', update);\n node.addEventListener('change', update);\n bind.elements = [node];\n bind.set = value => {\n node.value = value;\n span.textContent = value;\n };\n}\nfunction valuesEqual(a, b) {\n return a === b || a + '' === b + '';\n}\n\nfunction initializeRenderer (view, r, el, constructor, scaleFactor, opt) {\n r = r || new constructor(view.loader());\n return r.initialize(el, width(view), height(view), offset(view), scaleFactor, opt).background(view.background());\n}\n\nfunction trap (view, fn) {\n return !fn ? null : function () {\n try {\n fn.apply(this, arguments);\n } catch (error) {\n view.error(error);\n }\n };\n}\n\nfunction initializeHandler (view, prevHandler, el, constructor) {\n // instantiate scenegraph handler\n const handler = new constructor(view.loader(), trap(view, view.tooltip())).scene(view.scenegraph().root).initialize(el, offset(view), view);\n\n // transfer event handlers\n if (prevHandler) {\n prevHandler.handlers().forEach(h => {\n handler.on(h.type, h.handler);\n });\n }\n return handler;\n}\n\nfunction initialize (el, elBind) {\n const view = this,\n type = view._renderType,\n config = view._eventConfig.bind,\n module = renderModule(type);\n\n // containing dom element\n el = view._el = el ? lookup(view, el, true) : null;\n\n // initialize aria attributes\n initializeAria(view);\n\n // select appropriate renderer & handler\n if (!module) view.error('Unrecognized renderer type: ' + type);\n const Handler = module.handler || CanvasHandler,\n Renderer = el ? module.renderer : module.headless;\n\n // initialize renderer and input handler\n view._renderer = !Renderer ? null : initializeRenderer(view, view._renderer, el, Renderer);\n view._handler = initializeHandler(view, view._handler, el, Handler);\n view._redraw = true;\n\n // initialize signal bindings\n if (el && config !== 'none') {\n elBind = elBind ? view._elBind = lookup(view, elBind, true) : el.appendChild(element('form', {\n 'class': 'vega-bindings'\n }));\n view._bind.forEach(_ => {\n if (_.param.element && config !== 'container') {\n _.element = lookup(view, _.param.element, !!_.param.input);\n }\n });\n view._bind.forEach(_ => {\n bind(view, _.element || elBind, _);\n });\n }\n return view;\n}\nfunction lookup(view, el, clear) {\n if (typeof el === 'string') {\n if (typeof document !== 'undefined') {\n el = document.querySelector(el);\n if (!el) {\n view.error('Signal bind element not found: ' + el);\n return null;\n }\n } else {\n view.error('DOM document instance not found.');\n return null;\n }\n }\n if (el && clear) {\n try {\n el.textContent = '';\n } catch (e) {\n el = null;\n view.error(e);\n }\n }\n return el;\n}\n\nconst number = _ => +_ || 0;\nconst paddingObject = _ => ({\n top: _,\n bottom: _,\n left: _,\n right: _\n});\nfunction padding (_) {\n return isObject(_) ? {\n top: number(_.top),\n bottom: number(_.bottom),\n left: number(_.left),\n right: number(_.right)\n } : paddingObject(number(_));\n}\n\n/**\n * Render the current scene in a headless fashion.\n * This method is asynchronous, returning a Promise instance.\n * @return {Promise} - A Promise that resolves to a renderer.\n */\nasync function renderHeadless (view, type, scaleFactor, opt) {\n const module = renderModule(type),\n ctr = module && module.headless;\n if (!ctr) error('Unrecognized renderer type: ' + type);\n await view.runAsync();\n return initializeRenderer(view, null, null, ctr, scaleFactor, opt).renderAsync(view._scenegraph.root);\n}\n\n/**\n * Produce an image URL for the visualization. Depending on the type\n * parameter, the generated URL contains data for either a PNG or SVG image.\n * The URL can be used (for example) to download images of the visualization.\n * This method is asynchronous, returning a Promise instance.\n * @param {string} type - The image type. One of 'svg', 'png' or 'canvas'.\n * The 'canvas' and 'png' types are synonyms for a PNG image.\n * @return {Promise} - A promise that resolves to an image URL.\n */\nasync function renderToImageURL (type, scaleFactor) {\n if (type !== RenderType.Canvas && type !== RenderType.SVG && type !== RenderType.PNG) {\n error('Unrecognized image type: ' + type);\n }\n const r = await renderHeadless(this, type, scaleFactor);\n return type === RenderType.SVG ? toBlobURL(r.svg(), 'image/svg+xml') : r.canvas().toDataURL('image/png');\n}\nfunction toBlobURL(data, mime) {\n const blob = new Blob([data], {\n type: mime\n });\n return window.URL.createObjectURL(blob);\n}\n\n/**\n * Produce a Canvas instance containing a rendered visualization.\n * This method is asynchronous, returning a Promise instance.\n * @return {Promise} - A promise that resolves to a Canvas instance.\n */\nasync function renderToCanvas (scaleFactor, opt) {\n const r = await renderHeadless(this, RenderType.Canvas, scaleFactor, opt);\n return r.canvas();\n}\n\n/**\n * Produce a rendered SVG string of the visualization.\n * This method is asynchronous, returning a Promise instance.\n * @return {Promise} - A promise that resolves to an SVG string.\n */\nasync function renderToSVG (scaleFactor) {\n const r = await renderHeadless(this, RenderType.SVG, scaleFactor);\n return r.svg();\n}\n\nfunction runtime (view, spec, expr) {\n return context(view, transforms, functionContext, expr).parse(spec);\n}\n\nfunction scale(name) {\n var scales = this._runtime.scales;\n if (!hasOwnProperty(scales, name)) {\n error('Unrecognized scale or projection: ' + name);\n }\n return scales[name].value;\n}\n\nvar Width = 'width',\n Height = 'height',\n Padding = 'padding',\n Skip = {\n skip: true\n };\nfunction viewWidth(view, width) {\n var a = view.autosize(),\n p = view.padding();\n return width - (a && a.contains === Padding ? p.left + p.right : 0);\n}\nfunction viewHeight(view, height) {\n var a = view.autosize(),\n p = view.padding();\n return height - (a && a.contains === Padding ? p.top + p.bottom : 0);\n}\nfunction initializeResize(view) {\n var s = view._signals,\n w = s[Width],\n h = s[Height],\n p = s[Padding];\n function resetSize() {\n view._autosize = view._resize = 1;\n }\n\n // respond to width signal\n view._resizeWidth = view.add(null, _ => {\n view._width = _.size;\n view._viewWidth = viewWidth(view, _.size);\n resetSize();\n }, {\n size: w\n });\n\n // respond to height signal\n view._resizeHeight = view.add(null, _ => {\n view._height = _.size;\n view._viewHeight = viewHeight(view, _.size);\n resetSize();\n }, {\n size: h\n });\n\n // respond to padding signal\n const resizePadding = view.add(null, resetSize, {\n pad: p\n });\n\n // set rank to run immediately after source signal\n view._resizeWidth.rank = w.rank + 1;\n view._resizeHeight.rank = h.rank + 1;\n resizePadding.rank = p.rank + 1;\n}\nfunction resizeView(viewWidth, viewHeight, width, height, origin, auto) {\n this.runAfter(view => {\n let rerun = 0;\n\n // reset autosize flag\n view._autosize = 0;\n\n // width value changed: update signal, skip resize op\n if (view.width() !== width) {\n rerun = 1;\n view.signal(Width, width, Skip); // set width, skip update calc\n view._resizeWidth.skip(true); // skip width resize handler\n }\n\n // height value changed: update signal, skip resize op\n if (view.height() !== height) {\n rerun = 1;\n view.signal(Height, height, Skip); // set height, skip update calc\n view._resizeHeight.skip(true); // skip height resize handler\n }\n\n // view width changed: update view property, set resize flag\n if (view._viewWidth !== viewWidth) {\n view._resize = 1;\n view._viewWidth = viewWidth;\n }\n\n // view height changed: update view property, set resize flag\n if (view._viewHeight !== viewHeight) {\n view._resize = 1;\n view._viewHeight = viewHeight;\n }\n\n // origin changed: update view property, set resize flag\n if (view._origin[0] !== origin[0] || view._origin[1] !== origin[1]) {\n view._resize = 1;\n view._origin = origin;\n }\n\n // run dataflow on width/height signal change\n if (rerun) view.run('enter');\n if (auto) view.runAfter(v => v.resize());\n }, false, 1);\n}\n\n/**\n * Get the current view state, consisting of signal values and/or data sets.\n * @param {object} [options] - Options flags indicating which state to export.\n * If unspecified, all signals and data sets will be exported.\n * @param {function(string, Operator):boolean} [options.signals] - Optional\n * predicate function for testing if a signal should be included in the\n * exported state. If unspecified, all signals will be included, except for\n * those named 'parent' or those which refer to a Transform value.\n * @param {function(string, object):boolean} [options.data] - Optional\n * predicate function for testing if a data set's input should be included\n * in the exported state. If unspecified, all data sets that have been\n * explicitly modified will be included.\n * @param {boolean} [options.recurse=true] - Flag indicating if the exported\n * state should recursively include state from group mark sub-contexts.\n * @return {object} - An object containing the exported state values.\n */\nfunction getState(options) {\n return this._runtime.getState(options || {\n data: dataTest,\n signals: signalTest,\n recurse: true\n });\n}\nfunction dataTest(name, data) {\n return data.modified && isArray(data.input.value) && !name.startsWith('_:vega:_');\n}\nfunction signalTest(name, op) {\n return !(name === 'parent' || op instanceof transforms.proxy);\n}\n\n/**\n * Sets the current view state and updates the view by invoking run.\n * @param {object} state - A state object containing signal and/or\n * data set values, following the format used by the getState method.\n * @return {View} - This view instance.\n */\nfunction setState(state) {\n this.runAsync(null, v => {\n v._trigger = false;\n v._runtime.setState(state);\n }, v => {\n v._trigger = true;\n });\n return this;\n}\n\nfunction timer (callback, delay) {\n function tick(elapsed) {\n callback({\n timestamp: Date.now(),\n elapsed: elapsed\n });\n }\n this._timers.push(interval(tick, delay));\n}\n\nfunction defaultTooltip (handler, event, item, value) {\n const el = handler.element();\n if (el) el.setAttribute('title', formatTooltip(value));\n}\nfunction formatTooltip(value) {\n return value == null ? '' : isArray(value) ? formatArray(value) : isObject(value) && !isDate(value) ? formatObject(value) : value + '';\n}\nfunction formatObject(obj) {\n return Object.keys(obj).map(key => {\n const v = obj[key];\n return key + ': ' + (isArray(v) ? formatArray(v) : formatValue(v));\n }).join('\\n');\n}\nfunction formatArray(value) {\n return '[' + value.map(formatValue).join(', ') + ']';\n}\nfunction formatValue(value) {\n return isArray(value) ? '[\\u2026]' : isObject(value) && !isDate(value) ? '{\\u2026}' : value;\n}\n\nfunction watchPixelRatio () {\n // based on https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio#monitoring_screen_resolution_or_zoom_level_changes\n if (this.renderer() === 'canvas' && this._renderer._canvas) {\n let remove = null;\n const updatePixelRatio = () => {\n if (remove != null) {\n remove();\n }\n const media = matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);\n media.addEventListener('change', updatePixelRatio);\n remove = () => {\n media.removeEventListener('change', updatePixelRatio);\n };\n this._renderer._canvas.getContext('2d').pixelRatio = window.devicePixelRatio || 1;\n this._redraw = true;\n this._resize = 1;\n this.resize().runAsync();\n };\n updatePixelRatio();\n }\n}\n\n/**\n * Create a new View instance from a Vega dataflow runtime specification.\n * The generated View will not immediately be ready for display. Callers\n * should also invoke the initialize method (e.g., to set the parent\n * DOM element in browser-based deployment) and then invoke the run\n * method to evaluate the dataflow graph. Rendering will automatically\n * be performed upon dataflow runs.\n * @constructor\n * @param {object} spec - The Vega dataflow runtime specification.\n */\nfunction View(spec, options) {\n const view = this;\n options = options || {};\n Dataflow.call(view);\n if (options.loader) view.loader(options.loader);\n if (options.logger) view.logger(options.logger);\n if (options.logLevel != null) view.logLevel(options.logLevel);\n if (options.locale || spec.locale) {\n const loc = extend({}, spec.locale, options.locale);\n view.locale(locale(loc.number, loc.time));\n }\n view._el = null;\n view._elBind = null;\n view._renderType = options.renderer || RenderType.Canvas;\n view._scenegraph = new Scenegraph();\n const root = view._scenegraph.root;\n\n // initialize renderer, handler and event management\n view._renderer = null;\n view._tooltip = options.tooltip || defaultTooltip, view._redraw = true;\n view._handler = new CanvasHandler().scene(root);\n view._globalCursor = false;\n view._preventDefault = false;\n view._timers = [];\n view._eventListeners = [];\n view._resizeListeners = [];\n\n // initialize event configuration\n view._eventConfig = initializeEventConfig(spec.eventConfig);\n view.globalCursor(view._eventConfig.globalCursor);\n\n // initialize dataflow graph\n const ctx = runtime(view, spec, options.expr);\n view._runtime = ctx;\n view._signals = ctx.signals;\n view._bind = (spec.bindings || []).map(_ => ({\n state: null,\n param: extend({}, _)\n }));\n\n // initialize scenegraph\n if (ctx.root) ctx.root.set(root);\n root.source = ctx.data.root.input;\n view.pulse(ctx.data.root.input, view.changeset().insert(root.items));\n\n // initialize view size\n view._width = view.width();\n view._height = view.height();\n view._viewWidth = viewWidth(view, view._width);\n view._viewHeight = viewHeight(view, view._height);\n view._origin = [0, 0];\n view._resize = 0;\n view._autosize = 1;\n initializeResize(view);\n\n // initialize background color\n background(view);\n\n // initialize cursor\n cursor(view);\n\n // initialize view description\n view.description(spec.description);\n\n // initialize hover proessing, if requested\n if (options.hover) view.hover();\n\n // initialize DOM container(s) and renderer\n if (options.container) view.initialize(options.container, options.bind);\n if (options.watchPixelRatio) view._watchPixelRatio();\n}\nfunction lookupSignal(view, name) {\n return hasOwnProperty(view._signals, name) ? view._signals[name] : error('Unrecognized signal name: ' + stringValue(name));\n}\nfunction findOperatorHandler(op, handler) {\n const h = (op._targets || []).filter(op => op._update && op._update.handler === handler);\n return h.length ? h[0] : null;\n}\nfunction addOperatorListener(view, name, op, handler) {\n let h = findOperatorHandler(op, handler);\n if (!h) {\n h = trap(view, () => handler(name, op.value));\n h.handler = handler;\n view.on(op, null, h);\n }\n return view;\n}\nfunction removeOperatorListener(view, op, handler) {\n const h = findOperatorHandler(op, handler);\n if (h) op._targets.remove(h);\n return view;\n}\ninherits(View, Dataflow, {\n // -- DATAFLOW / RENDERING ----\n\n async evaluate(encode, prerun, postrun) {\n // evaluate dataflow and prerun\n await Dataflow.prototype.evaluate.call(this, encode, prerun);\n\n // render as needed\n if (this._redraw || this._resize) {\n try {\n if (this._renderer) {\n if (this._resize) {\n this._resize = 0;\n resizeRenderer(this);\n }\n await this._renderer.renderAsync(this._scenegraph.root);\n }\n this._redraw = false;\n } catch (e) {\n this.error(e);\n }\n }\n\n // evaluate postrun\n if (postrun) asyncCallback(this, postrun);\n return this;\n },\n dirty(item) {\n this._redraw = true;\n this._renderer && this._renderer.dirty(item);\n },\n // -- GET / SET ----\n\n description(text) {\n if (arguments.length) {\n const desc = text != null ? text + '' : null;\n if (desc !== this._desc) ariaLabel(this._el, this._desc = desc);\n return this;\n }\n return this._desc;\n },\n container() {\n return this._el;\n },\n scenegraph() {\n return this._scenegraph;\n },\n origin() {\n return this._origin.slice();\n },\n signal(name, value, options) {\n const op = lookupSignal(this, name);\n return arguments.length === 1 ? op.value : this.update(op, value, options);\n },\n width(_) {\n return arguments.length ? this.signal('width', _) : this.signal('width');\n },\n height(_) {\n return arguments.length ? this.signal('height', _) : this.signal('height');\n },\n padding(_) {\n return arguments.length ? this.signal('padding', padding(_)) : padding(this.signal('padding'));\n },\n autosize(_) {\n return arguments.length ? this.signal('autosize', _) : this.signal('autosize');\n },\n background(_) {\n return arguments.length ? this.signal('background', _) : this.signal('background');\n },\n renderer(type) {\n if (!arguments.length) return this._renderType;\n if (!renderModule(type)) error('Unrecognized renderer type: ' + type);\n if (type !== this._renderType) {\n this._renderType = type;\n this._resetRenderer();\n }\n return this;\n },\n tooltip(handler) {\n if (!arguments.length) return this._tooltip;\n if (handler !== this._tooltip) {\n this._tooltip = handler;\n this._resetRenderer();\n }\n return this;\n },\n loader(loader) {\n if (!arguments.length) return this._loader;\n if (loader !== this._loader) {\n Dataflow.prototype.loader.call(this, loader);\n this._resetRenderer();\n }\n return this;\n },\n resize() {\n // set flag to perform autosize\n this._autosize = 1;\n // touch autosize signal to ensure top-level ViewLayout runs\n return this.touch(lookupSignal(this, 'autosize'));\n },\n _resetRenderer() {\n if (this._renderer) {\n this._renderer = null;\n this.initialize(this._el, this._elBind);\n }\n },\n // -- SIZING ----\n _resizeView: resizeView,\n // -- EVENT HANDLING ----\n\n addEventListener(type, handler, options) {\n let callback = handler;\n if (!(options && options.trap === false)) {\n // wrap callback in error handler\n callback = trap(this, handler);\n callback.raw = handler;\n }\n this._handler.on(type, callback);\n return this;\n },\n removeEventListener(type, handler) {\n var handlers = this._handler.handlers(type),\n i = handlers.length,\n h,\n t;\n\n // search registered handlers, remove if match found\n while (--i >= 0) {\n t = handlers[i].type;\n h = handlers[i].handler;\n if (type === t && (handler === h || handler === h.raw)) {\n this._handler.off(t, h);\n break;\n }\n }\n return this;\n },\n addResizeListener(handler) {\n const l = this._resizeListeners;\n if (!l.includes(handler)) {\n // add handler if it isn't already registered\n // note: error trapping handled elsewhere, so\n // no need to wrap handlers here\n l.push(handler);\n }\n return this;\n },\n removeResizeListener(handler) {\n var l = this._resizeListeners,\n i = l.indexOf(handler);\n if (i >= 0) {\n l.splice(i, 1);\n }\n return this;\n },\n addSignalListener(name, handler) {\n return addOperatorListener(this, name, lookupSignal(this, name), handler);\n },\n removeSignalListener(name, handler) {\n return removeOperatorListener(this, lookupSignal(this, name), handler);\n },\n addDataListener(name, handler) {\n return addOperatorListener(this, name, dataref(this, name).values, handler);\n },\n removeDataListener(name, handler) {\n return removeOperatorListener(this, dataref(this, name).values, handler);\n },\n globalCursor(_) {\n if (arguments.length) {\n if (this._globalCursor !== !!_) {\n const prev = setCursor(this, null); // clear previous cursor\n this._globalCursor = !!_;\n if (prev) setCursor(this, prev); // swap cursor\n }\n return this;\n } else {\n return this._globalCursor;\n }\n },\n preventDefault(_) {\n if (arguments.length) {\n this._preventDefault = _;\n return this;\n } else {\n return this._preventDefault;\n }\n },\n timer,\n events,\n finalize,\n hover,\n // -- DATA ----\n data,\n change,\n insert,\n remove,\n // -- SCALES --\n scale,\n // -- INITIALIZATION ----\n initialize,\n // -- HEADLESS RENDERING ----\n toImageURL: renderToImageURL,\n toCanvas: renderToCanvas,\n toSVG: renderToSVG,\n // -- SAVE / RESTORE STATE ----\n getState,\n setState,\n // RE-RENDER ON ZOOM\n _watchPixelRatio: watchPixelRatio\n});\n\nexport { View };\n","import {Timer, now} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n var t = new Timer, total = delay;\n if (delay == null) return t.restart(callback, delay, time), t;\n t._restart = t.restart;\n t.restart = function(callback, delay, time) {\n delay = +delay, time = time == null ? now() : +time;\n t._restart(function tick(elapsed) {\n elapsed += total;\n t._restart(tick, total += delay, time);\n callback(elapsed);\n }, delay, time);\n }\n t.restart(callback, delay, time);\n return t;\n}\n","const VIEW = 'view',\n LBRACK = '[',\n RBRACK = ']',\n LBRACE = '{',\n RBRACE = '}',\n COLON = ':',\n COMMA = ',',\n NAME = '@',\n GT = '>',\n ILLEGAL = /[[\\]{}]/,\n DEFAULT_MARKS = {\n '*': 1,\n arc: 1,\n area: 1,\n group: 1,\n image: 1,\n line: 1,\n path: 1,\n rect: 1,\n rule: 1,\n shape: 1,\n symbol: 1,\n text: 1,\n trail: 1\n };\nlet DEFAULT_SOURCE, MARKS;\n\n/**\n * Parse an event selector string.\n * Returns an array of event stream definitions.\n */\nfunction eventSelector (selector, source, marks) {\n DEFAULT_SOURCE = source || VIEW;\n MARKS = marks || DEFAULT_MARKS;\n return parseMerge(selector.trim()).map(parseSelector);\n}\nfunction isMarkType(type) {\n return MARKS[type];\n}\nfunction find(s, i, endChar, pushChar, popChar) {\n const n = s.length;\n let count = 0,\n c;\n for (; i < n; ++i) {\n c = s[i];\n if (!count && c === endChar) return i;else if (popChar && popChar.indexOf(c) >= 0) --count;else if (pushChar && pushChar.indexOf(c) >= 0) ++count;\n }\n return i;\n}\nfunction parseMerge(s) {\n const output = [],\n n = s.length;\n let start = 0,\n i = 0;\n while (i < n) {\n i = find(s, i, COMMA, LBRACK + LBRACE, RBRACK + RBRACE);\n output.push(s.substring(start, i).trim());\n start = ++i;\n }\n if (output.length === 0) {\n throw 'Empty event selector: ' + s;\n }\n return output;\n}\nfunction parseSelector(s) {\n return s[0] === '[' ? parseBetween(s) : parseStream(s);\n}\nfunction parseBetween(s) {\n const n = s.length;\n let i = 1,\n b;\n i = find(s, i, RBRACK, LBRACK, RBRACK);\n if (i === n) {\n throw 'Empty between selector: ' + s;\n }\n b = parseMerge(s.substring(1, i));\n if (b.length !== 2) {\n throw 'Between selector must have two elements: ' + s;\n }\n s = s.slice(i + 1).trim();\n if (s[0] !== GT) {\n throw 'Expected \\'>\\' after between selector: ' + s;\n }\n b = b.map(parseSelector);\n const stream = parseSelector(s.slice(1).trim());\n if (stream.between) {\n return {\n between: b,\n stream: stream\n };\n } else {\n stream.between = b;\n }\n return stream;\n}\nfunction parseStream(s) {\n const stream = {\n source: DEFAULT_SOURCE\n },\n source = [];\n let throttle = [0, 0],\n markname = 0,\n start = 0,\n n = s.length,\n i = 0,\n j,\n filter;\n\n // extract throttle from end\n if (s[n - 1] === RBRACE) {\n i = s.lastIndexOf(LBRACE);\n if (i >= 0) {\n try {\n throttle = parseThrottle(s.substring(i + 1, n - 1));\n } catch (e) {\n throw 'Invalid throttle specification: ' + s;\n }\n s = s.slice(0, i).trim();\n n = s.length;\n } else throw 'Unmatched right brace: ' + s;\n i = 0;\n }\n if (!n) throw s;\n\n // set name flag based on first char\n if (s[0] === NAME) markname = ++i;\n\n // extract first part of multi-part stream selector\n j = find(s, i, COLON);\n if (j < n) {\n source.push(s.substring(start, j).trim());\n start = i = ++j;\n }\n\n // extract remaining part of stream selector\n i = find(s, i, LBRACK);\n if (i === n) {\n source.push(s.substring(start, n).trim());\n } else {\n source.push(s.substring(start, i).trim());\n filter = [];\n start = ++i;\n if (start === n) throw 'Unmatched left bracket: ' + s;\n }\n\n // extract filters\n while (i < n) {\n i = find(s, i, RBRACK);\n if (i === n) throw 'Unmatched left bracket: ' + s;\n filter.push(s.substring(start, i).trim());\n if (i < n - 1 && s[++i] !== LBRACK) throw 'Expected left bracket: ' + s;\n start = ++i;\n }\n\n // marshall event stream specification\n if (!(n = source.length) || ILLEGAL.test(source[n - 1])) {\n throw 'Invalid event selector: ' + s;\n }\n if (n > 1) {\n stream.type = source[1];\n if (markname) {\n stream.markname = source[0].slice(1);\n } else if (isMarkType(source[0])) {\n stream.marktype = source[0];\n } else {\n stream.source = source[0];\n }\n } else {\n stream.type = source[0];\n }\n if (stream.type.slice(-1) === '!') {\n stream.consume = true;\n stream.type = stream.type.slice(0, -1);\n }\n if (filter != null) stream.filter = filter;\n if (throttle[0]) stream.throttle = throttle[0];\n if (throttle[1]) stream.debounce = throttle[1];\n return stream;\n}\nfunction parseThrottle(s) {\n const a = s.split(COMMA);\n if (!s.length || a.length > 2) throw s;\n return a.map(_ => {\n const x = +_;\n if (x !== x) throw s;\n return x;\n });\n}\n\nexport { eventSelector as parseSelector };\n","import { isObject, isArray, extend, hasOwnProperty, array, stringValue, peek, error, isString, splitAccessPath, mergeConfig } from 'vega-util';\nimport { parseExpression } from 'vega-functions';\nimport { parseSelector } from 'vega-event-selector';\nimport { isValidScaleType, isDiscrete, isQuantile, isContinuous, isDiscretizing } from 'vega-scale';\nimport { definition as definition$1 } from 'vega-dataflow';\n\nfunction parseAutosize (spec) {\n return isObject(spec) ? spec : {\n type: spec || 'pad'\n };\n}\n\nconst number = _ => +_ || 0;\nconst paddingObject = _ => ({\n top: _,\n bottom: _,\n left: _,\n right: _\n});\nfunction parsePadding (spec) {\n return !isObject(spec) ? paddingObject(number(spec)) : spec.signal ? spec : {\n top: number(spec.top),\n bottom: number(spec.bottom),\n left: number(spec.left),\n right: number(spec.right)\n };\n}\n\nconst encoder = _ => isObject(_) && !isArray(_) ? extend({}, _) : {\n value: _\n};\nfunction addEncode(object, name, value, set) {\n if (value != null) {\n const isEncoder = isObject(value) && !isArray(value) || isArray(value) && value.length && isObject(value[0]);\n\n // Always assign signal to update, even if the signal is from the enter block\n if (isEncoder) {\n object.update[name] = value;\n } else {\n object[set || 'enter'][name] = {\n value: value\n };\n }\n return 1;\n } else {\n return 0;\n }\n}\nfunction addEncoders(object, enter, update) {\n for (const name in enter) {\n addEncode(object, name, enter[name]);\n }\n for (const name in update) {\n addEncode(object, name, update[name], 'update');\n }\n}\nfunction extendEncode(encode, extra, skip) {\n for (const name in extra) {\n if (skip && hasOwnProperty(skip, name)) continue;\n encode[name] = extend(encode[name] || {}, extra[name]);\n }\n return encode;\n}\nfunction has(key, encode) {\n return encode && (encode.enter && encode.enter[key] || encode.update && encode.update[key]);\n}\n\nconst MarkRole = 'mark';\nconst FrameRole = 'frame';\nconst ScopeRole = 'scope';\nconst AxisRole = 'axis';\nconst AxisDomainRole = 'axis-domain';\nconst AxisGridRole = 'axis-grid';\nconst AxisLabelRole = 'axis-label';\nconst AxisTickRole = 'axis-tick';\nconst AxisTitleRole = 'axis-title';\nconst LegendRole = 'legend';\nconst LegendBandRole = 'legend-band';\nconst LegendEntryRole = 'legend-entry';\nconst LegendGradientRole = 'legend-gradient';\nconst LegendLabelRole = 'legend-label';\nconst LegendSymbolRole = 'legend-symbol';\nconst LegendTitleRole = 'legend-title';\nconst TitleRole = 'title';\nconst TitleTextRole = 'title-text';\nconst TitleSubtitleRole = 'title-subtitle';\n\nfunction applyDefaults (encode, type, role, style, config) {\n const defaults = {},\n enter = {};\n let update, key, skip, props;\n\n // if text mark, apply global lineBreak settings (#2370)\n key = 'lineBreak';\n if (type === 'text' && config[key] != null && !has(key, encode)) {\n applyDefault(defaults, key, config[key]);\n }\n\n // ignore legend and axis roles\n if (role == 'legend' || String(role).startsWith('axis')) {\n role = null;\n }\n\n // resolve mark config\n props = role === FrameRole ? config.group : role === MarkRole ? extend({}, config.mark, config[type]) : null;\n for (key in props) {\n // do not apply defaults if relevant fields are defined\n skip = has(key, encode) || (key === 'fill' || key === 'stroke') && (has('fill', encode) || has('stroke', encode));\n if (!skip) applyDefault(defaults, key, props[key]);\n }\n\n // resolve styles, apply with increasing precedence\n array(style).forEach(name => {\n const props = config.style && config.style[name];\n for (const key in props) {\n if (!has(key, encode)) {\n applyDefault(defaults, key, props[key]);\n }\n }\n });\n encode = extend({}, encode); // defensive copy\n for (key in defaults) {\n props = defaults[key];\n if (props.signal) {\n (update = update || {})[key] = props;\n } else {\n enter[key] = props;\n }\n }\n encode.enter = extend(enter, encode.enter);\n if (update) encode.update = extend(update, encode.update);\n return encode;\n}\nfunction applyDefault(defaults, key, value) {\n defaults[key] = value && value.signal ? {\n signal: value.signal\n } : {\n value: value\n };\n}\n\nconst scaleRef = scale => isString(scale) ? stringValue(scale) : scale.signal ? `(${scale.signal})` : field(scale);\nfunction entry$1(enc) {\n if (enc.gradient != null) {\n return gradient(enc);\n }\n let value = enc.signal ? `(${enc.signal})` : enc.color ? color(enc.color) : enc.field != null ? field(enc.field) : enc.value !== undefined ? stringValue(enc.value) : undefined;\n if (enc.scale != null) {\n value = scale(enc, value);\n }\n if (value === undefined) {\n value = null;\n }\n if (enc.exponent != null) {\n value = `pow(${value},${property(enc.exponent)})`;\n }\n if (enc.mult != null) {\n value += `*${property(enc.mult)}`;\n }\n if (enc.offset != null) {\n value += `+${property(enc.offset)}`;\n }\n if (enc.round) {\n value = `round(${value})`;\n }\n return value;\n}\nconst _color = (type, x, y, z) => `(${type}(${[x, y, z].map(entry$1).join(',')})+'')`;\nfunction color(enc) {\n return enc.c ? _color('hcl', enc.h, enc.c, enc.l) : enc.h || enc.s ? _color('hsl', enc.h, enc.s, enc.l) : enc.l || enc.a ? _color('lab', enc.l, enc.a, enc.b) : enc.r || enc.g || enc.b ? _color('rgb', enc.r, enc.g, enc.b) : null;\n}\nfunction gradient(enc) {\n // map undefined to null; expression lang does not allow undefined\n const args = [enc.start, enc.stop, enc.count].map(_ => _ == null ? null : stringValue(_));\n\n // trim null inputs from the end\n while (args.length && peek(args) == null) args.pop();\n args.unshift(scaleRef(enc.gradient));\n return `gradient(${args.join(',')})`;\n}\nfunction property(property) {\n return isObject(property) ? '(' + entry$1(property) + ')' : property;\n}\nfunction field(ref) {\n return resolveField(isObject(ref) ? ref : {\n datum: ref\n });\n}\nfunction resolveField(ref) {\n let object, level, field;\n if (ref.signal) {\n object = 'datum';\n field = ref.signal;\n } else if (ref.group || ref.parent) {\n level = Math.max(1, ref.level || 1);\n object = 'item';\n while (level-- > 0) {\n object += '.mark.group';\n }\n if (ref.parent) {\n field = ref.parent;\n object += '.datum';\n } else {\n field = ref.group;\n }\n } else if (ref.datum) {\n object = 'datum';\n field = ref.datum;\n } else {\n error('Invalid field reference: ' + stringValue(ref));\n }\n if (!ref.signal) {\n field = isString(field) ? splitAccessPath(field).map(stringValue).join('][') : resolveField(field);\n }\n return object + '[' + field + ']';\n}\nfunction scale(enc, value) {\n const scale = scaleRef(enc.scale);\n if (enc.range != null) {\n // pull value from scale range\n value = `lerp(_range(${scale}), ${+enc.range})`;\n } else {\n // run value through scale and/or pull scale bandwidth\n if (value !== undefined) value = `_scale(${scale}, ${value})`;\n if (enc.band) {\n value = (value ? value + '+' : '') + `_bandwidth(${scale})` + (+enc.band === 1 ? '' : '*' + property(enc.band));\n if (enc.extra) {\n // include logic to handle extraneous elements\n value = `(datum.extra ? _scale(${scale}, datum.extra.value) : ${value})`;\n }\n }\n if (value == null) value = '0';\n }\n return value;\n}\n\nfunction rule (enc) {\n let code = '';\n enc.forEach(rule => {\n const value = entry$1(rule);\n code += rule.test ? `(${rule.test})?${value}:` : value;\n });\n\n // if no else clause, terminate with null (#1366)\n if (peek(code) === ':') {\n code += 'null';\n }\n return code;\n}\n\nfunction parseEncode (encode, type, role, style, scope, params) {\n const enc = {};\n params = params || {};\n params.encoders = {\n $encode: enc\n };\n encode = applyDefaults(encode, type, role, style, scope.config);\n for (const key in encode) {\n enc[key] = parseBlock(encode[key], type, params, scope);\n }\n return params;\n}\nfunction parseBlock(block, marktype, params, scope) {\n const channels = {},\n fields = {};\n for (const name in block) {\n if (block[name] != null) {\n // skip any null entries\n channels[name] = parse$1(expr(block[name]), scope, params, fields);\n }\n }\n return {\n $expr: {\n marktype,\n channels\n },\n $fields: Object.keys(fields),\n $output: Object.keys(block)\n };\n}\nfunction expr(enc) {\n return isArray(enc) ? rule(enc) : entry$1(enc);\n}\nfunction parse$1(code, scope, params, fields) {\n const expr = parseExpression(code, scope);\n expr.$fields.forEach(name => fields[name] = 1);\n extend(params, expr.$params);\n return expr.$expr;\n}\n\nconst OUTER = 'outer',\n OUTER_INVALID = ['value', 'update', 'init', 'react', 'bind'];\nfunction outerError(prefix, name) {\n error(prefix + ' for \"outer\" push: ' + stringValue(name));\n}\nfunction parseSignal (signal, scope) {\n const name = signal.name;\n if (signal.push === OUTER) {\n // signal must already be defined, raise error if not\n if (!scope.signals[name]) outerError('No prior signal definition', name);\n // signal push must not use properties reserved for standard definition\n OUTER_INVALID.forEach(prop => {\n if (signal[prop] !== undefined) outerError('Invalid property ', prop);\n });\n } else {\n // define a new signal in the current scope\n const op = scope.addSignal(name, signal.value);\n if (signal.react === false) op.react = false;\n if (signal.bind) scope.addBinding(name, signal.bind);\n }\n}\n\nfunction Entry(type, value, params, parent) {\n this.id = -1;\n this.type = type;\n this.value = value;\n this.params = params;\n if (parent) this.parent = parent;\n}\nfunction entry(type, value, params, parent) {\n return new Entry(type, value, params, parent);\n}\nfunction operator(value, params) {\n return entry('operator', value, params);\n}\n\n// -----\n\nfunction ref(op) {\n const ref = {\n $ref: op.id\n };\n // if operator not yet registered, cache ref to resolve later\n if (op.id < 0) (op.refs = op.refs || []).push(ref);\n return ref;\n}\nfunction fieldRef$1(field, name) {\n return name ? {\n $field: field,\n $name: name\n } : {\n $field: field\n };\n}\nconst keyFieldRef = fieldRef$1('key');\nfunction compareRef(fields, orders) {\n return {\n $compare: fields,\n $order: orders\n };\n}\nfunction keyRef(fields, flat) {\n const ref = {\n $key: fields\n };\n if (flat) ref.$flat = true;\n return ref;\n}\n\n// -----\n\nconst Ascending = 'ascending';\nconst Descending = 'descending';\nfunction sortKey(sort) {\n return !isObject(sort) ? '' : (sort.order === Descending ? '-' : '+') + aggrField(sort.op, sort.field);\n}\nfunction aggrField(op, field) {\n return (op && op.signal ? '$' + op.signal : op || '') + (op && field ? '_' : '') + (field && field.signal ? '$' + field.signal : field || '');\n}\n\n// -----\n\nconst Scope$1 = 'scope';\nconst View = 'view';\nfunction isSignal(_) {\n return _ && _.signal;\n}\nfunction isExpr$1(_) {\n return _ && _.expr;\n}\nfunction hasSignal(_) {\n if (isSignal(_)) return true;\n if (isObject(_)) for (const key in _) {\n if (hasSignal(_[key])) return true;\n }\n return false;\n}\nfunction value(specValue, defaultValue) {\n return specValue != null ? specValue : defaultValue;\n}\nfunction deref(v) {\n return v && v.signal || v;\n}\n\nconst Timer = 'timer';\nfunction parseStream(stream, scope) {\n const method = stream.merge ? mergeStream : stream.stream ? nestedStream : stream.type ? eventStream : error('Invalid stream specification: ' + stringValue(stream));\n return method(stream, scope);\n}\nfunction eventSource(source) {\n return source === Scope$1 ? View : source || View;\n}\nfunction mergeStream(stream, scope) {\n const list = stream.merge.map(s => parseStream(s, scope)),\n entry = streamParameters({\n merge: list\n }, stream, scope);\n return scope.addStream(entry).id;\n}\nfunction nestedStream(stream, scope) {\n const id = parseStream(stream.stream, scope),\n entry = streamParameters({\n stream: id\n }, stream, scope);\n return scope.addStream(entry).id;\n}\nfunction eventStream(stream, scope) {\n let id;\n if (stream.type === Timer) {\n id = scope.event(Timer, stream.throttle);\n stream = {\n between: stream.between,\n filter: stream.filter\n };\n } else {\n id = scope.event(eventSource(stream.source), stream.type);\n }\n const entry = streamParameters({\n stream: id\n }, stream, scope);\n return Object.keys(entry).length === 1 ? id : scope.addStream(entry).id;\n}\nfunction streamParameters(entry, stream, scope) {\n let param = stream.between;\n if (param) {\n if (param.length !== 2) {\n error('Stream \"between\" parameter must have 2 entries: ' + stringValue(stream));\n }\n entry.between = [parseStream(param[0], scope), parseStream(param[1], scope)];\n }\n param = stream.filter ? [].concat(stream.filter) : [];\n if (stream.marktype || stream.markname || stream.markrole) {\n // add filter for mark type, name and/or role\n param.push(filterMark(stream.marktype, stream.markname, stream.markrole));\n }\n if (stream.source === Scope$1) {\n // add filter to limit events from sub-scope only\n param.push('inScope(event.item)');\n }\n if (param.length) {\n entry.filter = parseExpression('(' + param.join(')&&(') + ')', scope).$expr;\n }\n if ((param = stream.throttle) != null) {\n entry.throttle = +param;\n }\n if ((param = stream.debounce) != null) {\n entry.debounce = +param;\n }\n if (stream.consume) {\n entry.consume = true;\n }\n return entry;\n}\nfunction filterMark(type, name, role) {\n const item = 'event.item';\n return item + (type && type !== '*' ? '&&' + item + '.mark.marktype===\\'' + type + '\\'' : '') + (role ? '&&' + item + '.mark.role===\\'' + role + '\\'' : '') + (name ? '&&' + item + '.mark.name===\\'' + name + '\\'' : '');\n}\n\n// bypass expression parser for internal operator references\nconst OP_VALUE_EXPR = {\n code: '_.$value',\n ast: {\n type: 'Identifier',\n value: 'value'\n }\n};\nfunction parseUpdate (spec, scope, target) {\n const encode = spec.encode,\n entry = {\n target: target\n };\n let events = spec.events,\n update = spec.update,\n sources = [];\n if (!events) {\n error('Signal update missing events specification.');\n }\n\n // interpret as an event selector string\n if (isString(events)) {\n events = parseSelector(events, scope.isSubscope() ? Scope$1 : View);\n }\n\n // separate event streams from signal updates\n events = array(events).filter(s => s.signal || s.scale ? (sources.push(s), 0) : 1);\n\n // merge internal operator listeners\n if (sources.length > 1) {\n sources = [mergeSources(sources)];\n }\n\n // merge event streams, include as source\n if (events.length) {\n sources.push(events.length > 1 ? {\n merge: events\n } : events[0]);\n }\n if (encode != null) {\n if (update) error('Signal encode and update are mutually exclusive.');\n update = 'encode(item(),' + stringValue(encode) + ')';\n }\n\n // resolve update value\n entry.update = isString(update) ? parseExpression(update, scope) : update.expr != null ? parseExpression(update.expr, scope) : update.value != null ? update.value : update.signal != null ? {\n $expr: OP_VALUE_EXPR,\n $params: {\n $value: scope.signalRef(update.signal)\n }\n } : error('Invalid signal update specification.');\n if (spec.force) {\n entry.options = {\n force: true\n };\n }\n sources.forEach(source => scope.addUpdate(extend(streamSource(source, scope), entry)));\n}\nfunction streamSource(stream, scope) {\n return {\n source: stream.signal ? scope.signalRef(stream.signal) : stream.scale ? scope.scaleRef(stream.scale) : parseStream(stream, scope)\n };\n}\nfunction mergeSources(sources) {\n return {\n signal: '[' + sources.map(s => s.scale ? 'scale(\"' + s.scale + '\")' : s.signal) + ']'\n };\n}\n\nfunction parseSignalUpdates (signal, scope) {\n const op = scope.getSignal(signal.name);\n let expr = signal.update;\n if (signal.init) {\n if (expr) {\n error('Signals can not include both init and update expressions.');\n } else {\n expr = signal.init;\n op.initonly = true;\n }\n }\n if (expr) {\n expr = parseExpression(expr, scope);\n op.update = expr.$expr;\n op.params = expr.$params;\n }\n if (signal.on) {\n signal.on.forEach(_ => parseUpdate(_, scope, op.id));\n }\n}\n\nconst transform = name => (params, value, parent) => entry(name, value, params || undefined, parent);\nconst Aggregate = transform('aggregate');\nconst AxisTicks = transform('axisticks');\nconst Bound = transform('bound');\nconst Collect = transform('collect');\nconst Compare = transform('compare');\nconst DataJoin = transform('datajoin');\nconst Encode = transform('encode');\nconst Expression = transform('expression');\nconst Facet = transform('facet');\nconst Field = transform('field');\nconst Key = transform('key');\nconst LegendEntries = transform('legendentries');\nconst Load = transform('load');\nconst Mark = transform('mark');\nconst MultiExtent = transform('multiextent');\nconst MultiValues = transform('multivalues');\nconst Overlap = transform('overlap');\nconst Params = transform('params');\nconst PreFacet = transform('prefacet');\nconst Projection = transform('projection');\nconst Proxy = transform('proxy');\nconst Relay = transform('relay');\nconst Render = transform('render');\nconst Scale = transform('scale');\nconst Sieve = transform('sieve');\nconst SortItems = transform('sortitems');\nconst ViewLayout = transform('viewlayout');\nconst Values = transform('values');\n\nlet FIELD_REF_ID = 0;\nconst MULTIDOMAIN_SORT_OPS = {\n min: 'min',\n max: 'max',\n count: 'sum'\n};\nfunction initScale(spec, scope) {\n const type = spec.type || 'linear';\n if (!isValidScaleType(type)) {\n error('Unrecognized scale type: ' + stringValue(type));\n }\n scope.addScale(spec.name, {\n type,\n domain: undefined\n });\n}\nfunction parseScale(spec, scope) {\n const params = scope.getScale(spec.name).params;\n let key;\n params.domain = parseScaleDomain(spec.domain, spec, scope);\n if (spec.range != null) {\n params.range = parseScaleRange(spec, scope, params);\n }\n if (spec.interpolate != null) {\n parseScaleInterpolate(spec.interpolate, params);\n }\n if (spec.nice != null) {\n params.nice = parseScaleNice(spec.nice, scope);\n }\n if (spec.bins != null) {\n params.bins = parseScaleBins(spec.bins, scope);\n }\n for (key in spec) {\n if (hasOwnProperty(params, key) || key === 'name') continue;\n params[key] = parseLiteral(spec[key], scope);\n }\n}\nfunction parseLiteral(v, scope) {\n return !isObject(v) ? v : v.signal ? scope.signalRef(v.signal) : error('Unsupported object: ' + stringValue(v));\n}\nfunction parseArray(v, scope) {\n return v.signal ? scope.signalRef(v.signal) : v.map(v => parseLiteral(v, scope));\n}\nfunction dataLookupError(name) {\n error('Can not find data set: ' + stringValue(name));\n}\n\n// -- SCALE DOMAIN ----\n\nfunction parseScaleDomain(domain, spec, scope) {\n if (!domain) {\n if (spec.domainMin != null || spec.domainMax != null) {\n error('No scale domain defined for domainMin/domainMax to override.');\n }\n return; // default domain\n }\n return domain.signal ? scope.signalRef(domain.signal) : (isArray(domain) ? explicitDomain : domain.fields ? multipleDomain : singularDomain)(domain, spec, scope);\n}\nfunction explicitDomain(domain, spec, scope) {\n return domain.map(v => parseLiteral(v, scope));\n}\nfunction singularDomain(domain, spec, scope) {\n const data = scope.getData(domain.data);\n if (!data) dataLookupError(domain.data);\n return isDiscrete(spec.type) ? data.valuesRef(scope, domain.field, parseSort(domain.sort, false)) : isQuantile(spec.type) ? data.domainRef(scope, domain.field) : data.extentRef(scope, domain.field);\n}\nfunction multipleDomain(domain, spec, scope) {\n const data = domain.data,\n fields = domain.fields.reduce((dom, d) => {\n d = isString(d) ? {\n data: data,\n field: d\n } : isArray(d) || d.signal ? fieldRef(d, scope) : d;\n dom.push(d);\n return dom;\n }, []);\n return (isDiscrete(spec.type) ? ordinalMultipleDomain : isQuantile(spec.type) ? quantileMultipleDomain : numericMultipleDomain)(domain, scope, fields);\n}\nfunction fieldRef(data, scope) {\n const name = '_:vega:_' + FIELD_REF_ID++,\n coll = Collect({});\n if (isArray(data)) {\n coll.value = {\n $ingest: data\n };\n } else if (data.signal) {\n const code = 'setdata(' + stringValue(name) + ',' + data.signal + ')';\n coll.params.input = scope.signalRef(code);\n }\n scope.addDataPipeline(name, [coll, Sieve({})]);\n return {\n data: name,\n field: 'data'\n };\n}\nfunction ordinalMultipleDomain(domain, scope, fields) {\n const sort = parseSort(domain.sort, true);\n let a, v;\n\n // get value counts for each domain field\n const counts = fields.map(f => {\n const data = scope.getData(f.data);\n if (!data) dataLookupError(f.data);\n return data.countsRef(scope, f.field, sort);\n });\n\n // aggregate the results from each domain field\n const p = {\n groupby: keyFieldRef,\n pulse: counts\n };\n if (sort) {\n a = sort.op || 'count';\n v = sort.field ? aggrField(a, sort.field) : 'count';\n p.ops = [MULTIDOMAIN_SORT_OPS[a]];\n p.fields = [scope.fieldRef(v)];\n p.as = [v];\n }\n a = scope.add(Aggregate(p));\n\n // collect aggregate output\n const c = scope.add(Collect({\n pulse: ref(a)\n }));\n\n // extract values for combined domain\n v = scope.add(Values({\n field: keyFieldRef,\n sort: scope.sortRef(sort),\n pulse: ref(c)\n }));\n return ref(v);\n}\nfunction parseSort(sort, multidomain) {\n if (sort) {\n if (!sort.field && !sort.op) {\n if (isObject(sort)) sort.field = 'key';else sort = {\n field: 'key'\n };\n } else if (!sort.field && sort.op !== 'count') {\n error('No field provided for sort aggregate op: ' + sort.op);\n } else if (multidomain && sort.field) {\n if (sort.op && !MULTIDOMAIN_SORT_OPS[sort.op]) {\n error('Multiple domain scales can not be sorted using ' + sort.op);\n }\n }\n }\n return sort;\n}\nfunction quantileMultipleDomain(domain, scope, fields) {\n // get value arrays for each domain field\n const values = fields.map(f => {\n const data = scope.getData(f.data);\n if (!data) dataLookupError(f.data);\n return data.domainRef(scope, f.field);\n });\n\n // combine value arrays\n return ref(scope.add(MultiValues({\n values: values\n })));\n}\nfunction numericMultipleDomain(domain, scope, fields) {\n // get extents for each domain field\n const extents = fields.map(f => {\n const data = scope.getData(f.data);\n if (!data) dataLookupError(f.data);\n return data.extentRef(scope, f.field);\n });\n\n // combine extents\n return ref(scope.add(MultiExtent({\n extents: extents\n })));\n}\n\n// -- SCALE BINS -----\n\nfunction parseScaleBins(v, scope) {\n return v.signal || isArray(v) ? parseArray(v, scope) : scope.objectProperty(v);\n}\n\n// -- SCALE NICE -----\n\nfunction parseScaleNice(nice, scope) {\n return nice.signal ? scope.signalRef(nice.signal) : isObject(nice) ? {\n interval: parseLiteral(nice.interval),\n step: parseLiteral(nice.step)\n } : parseLiteral(nice);\n}\n\n// -- SCALE INTERPOLATION -----\n\nfunction parseScaleInterpolate(interpolate, params) {\n params.interpolate = parseLiteral(interpolate.type || interpolate);\n if (interpolate.gamma != null) {\n params.interpolateGamma = parseLiteral(interpolate.gamma);\n }\n}\n\n// -- SCALE RANGE -----\n\nfunction parseScaleRange(spec, scope, params) {\n const config = scope.config.range;\n let range = spec.range;\n if (range.signal) {\n return scope.signalRef(range.signal);\n } else if (isString(range)) {\n if (config && hasOwnProperty(config, range)) {\n spec = extend({}, spec, {\n range: config[range]\n });\n return parseScaleRange(spec, scope, params);\n } else if (range === 'width') {\n range = [0, {\n signal: 'width'\n }];\n } else if (range === 'height') {\n range = isDiscrete(spec.type) ? [0, {\n signal: 'height'\n }] : [{\n signal: 'height'\n }, 0];\n } else {\n error('Unrecognized scale range value: ' + stringValue(range));\n }\n } else if (range.scheme) {\n params.scheme = isArray(range.scheme) ? parseArray(range.scheme, scope) : parseLiteral(range.scheme, scope);\n if (range.extent) params.schemeExtent = parseArray(range.extent, scope);\n if (range.count) params.schemeCount = parseLiteral(range.count, scope);\n return;\n } else if (range.step) {\n params.rangeStep = parseLiteral(range.step, scope);\n return;\n } else if (isDiscrete(spec.type) && !isArray(range)) {\n return parseScaleDomain(range, spec, scope);\n } else if (!isArray(range)) {\n error('Unsupported range type: ' + stringValue(range));\n }\n return range.map(v => (isArray(v) ? parseArray : parseLiteral)(v, scope));\n}\n\nfunction parseProjection (proj, scope) {\n const config = scope.config.projection || {},\n params = {};\n for (const name in proj) {\n if (name === 'name') continue;\n params[name] = parseParameter$1(proj[name], name, scope);\n }\n\n // apply projection defaults from config\n for (const name in config) {\n if (params[name] == null) {\n params[name] = parseParameter$1(config[name], name, scope);\n }\n }\n scope.addProjection(proj.name, params);\n}\nfunction parseParameter$1(_, name, scope) {\n return isArray(_) ? _.map(_ => parseParameter$1(_, name, scope)) : !isObject(_) ? _ : _.signal ? scope.signalRef(_.signal) : name === 'fit' ? _ : error('Unsupported parameter object: ' + stringValue(_));\n}\n\nconst Top = 'top';\nconst Left = 'left';\nconst Right = 'right';\nconst Bottom = 'bottom';\nconst Center = 'center';\nconst Vertical = 'vertical';\nconst Start = 'start';\nconst Middle = 'middle';\nconst End = 'end';\nconst Index = 'index';\nconst Label = 'label';\nconst Offset = 'offset';\nconst Perc = 'perc';\nconst Perc2 = 'perc2';\nconst Value = 'value';\nconst GuideLabelStyle = 'guide-label';\nconst GuideTitleStyle = 'guide-title';\nconst GroupTitleStyle = 'group-title';\nconst GroupSubtitleStyle = 'group-subtitle';\nconst Symbols = 'symbol';\nconst Gradient = 'gradient';\nconst Discrete = 'discrete';\nconst Size = 'size';\nconst Shape = 'shape';\nconst Fill = 'fill';\nconst Stroke = 'stroke';\nconst StrokeWidth = 'strokeWidth';\nconst StrokeDash = 'strokeDash';\nconst Opacity = 'opacity';\n\n// Encoding channels supported by legends\n// In priority order of 'canonical' scale\nconst LegendScales = [Size, Shape, Fill, Stroke, StrokeWidth, StrokeDash, Opacity];\nconst Skip = {\n name: 1,\n style: 1,\n interactive: 1\n};\nconst zero = {\n value: 0\n};\nconst one = {\n value: 1\n};\n\nconst GroupMark = 'group';\nconst RectMark = 'rect';\nconst RuleMark = 'rule';\nconst SymbolMark = 'symbol';\nconst TextMark = 'text';\n\nfunction guideGroup (mark) {\n mark.type = GroupMark;\n mark.interactive = mark.interactive || false;\n return mark;\n}\n\nfunction lookup(spec, config) {\n const _ = (name, dflt) => value(spec[name], value(config[name], dflt));\n _.isVertical = s => Vertical === value(spec.direction, config.direction || (s ? config.symbolDirection : config.gradientDirection));\n _.gradientLength = () => value(spec.gradientLength, config.gradientLength || config.gradientWidth);\n _.gradientThickness = () => value(spec.gradientThickness, config.gradientThickness || config.gradientHeight);\n _.entryColumns = () => value(spec.columns, value(config.columns, +_.isVertical(true)));\n return _;\n}\nfunction getEncoding(name, encode) {\n const v = encode && (encode.update && encode.update[name] || encode.enter && encode.enter[name]);\n return v && v.signal ? v : v ? v.value : null;\n}\nfunction getStyle(name, scope, style) {\n const s = scope.config.style[style];\n return s && s[name];\n}\nfunction anchorExpr(s, e, m) {\n return `item.anchor === '${Start}' ? ${s} : item.anchor === '${End}' ? ${e} : ${m}`;\n}\nconst alignExpr$1 = anchorExpr(stringValue(Left), stringValue(Right), stringValue(Center));\nfunction tickBand(_) {\n const v = _('tickBand');\n let offset = _('tickOffset'),\n band,\n extra;\n if (!v) {\n // if no tick band entry, fall back on other properties\n band = _('bandPosition');\n extra = _('tickExtra');\n } else if (v.signal) {\n // if signal, augment code to interpret values\n band = {\n signal: `(${v.signal}) === 'extent' ? 1 : 0.5`\n };\n extra = {\n signal: `(${v.signal}) === 'extent'`\n };\n if (!isObject(offset)) {\n offset = {\n signal: `(${v.signal}) === 'extent' ? 0 : ${offset}`\n };\n }\n } else if (v === 'extent') {\n // if constant, simply set values\n band = 1;\n extra = true;\n offset = 0;\n } else {\n band = 0.5;\n extra = false;\n }\n return {\n extra,\n band,\n offset\n };\n}\nfunction extendOffset(value, offset) {\n return !offset ? value : !value ? offset : !isObject(value) ? {\n value,\n offset\n } : Object.assign({}, value, {\n offset: extendOffset(value.offset, offset)\n });\n}\n\nfunction guideMark (mark, extras) {\n if (extras) {\n mark.name = extras.name;\n mark.style = extras.style || mark.style;\n mark.interactive = !!extras.interactive;\n mark.encode = extendEncode(mark.encode, extras, Skip);\n } else {\n mark.interactive = false;\n }\n return mark;\n}\n\nfunction legendGradient (spec, scale, config, userEncode) {\n const _ = lookup(spec, config),\n vertical = _.isVertical(),\n thickness = _.gradientThickness(),\n length = _.gradientLength();\n let enter, start, stop, width, height;\n if (vertical) {\n start = [0, 1];\n stop = [0, 0];\n width = thickness;\n height = length;\n } else {\n start = [0, 0];\n stop = [1, 0];\n width = length;\n height = thickness;\n }\n const encode = {\n enter: enter = {\n opacity: zero,\n x: zero,\n y: zero,\n width: encoder(width),\n height: encoder(height)\n },\n update: extend({}, enter, {\n opacity: one,\n fill: {\n gradient: scale,\n start: start,\n stop: stop\n }\n }),\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('gradientStrokeColor'),\n strokeWidth: _('gradientStrokeWidth')\n }, {\n // update\n opacity: _('gradientOpacity')\n });\n return guideMark({\n type: RectMark,\n role: LegendGradientRole,\n encode\n }, userEncode);\n}\n\nfunction legendGradientDiscrete (spec, scale, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n vertical = _.isVertical(),\n thickness = _.gradientThickness(),\n length = _.gradientLength();\n let u,\n v,\n uu,\n vv,\n adjust = '';\n vertical ? (u = 'y', uu = 'y2', v = 'x', vv = 'width', adjust = '1-') : (u = 'x', uu = 'x2', v = 'y', vv = 'height');\n const enter = {\n opacity: zero,\n fill: {\n scale: scale,\n field: Value\n }\n };\n enter[u] = {\n signal: adjust + 'datum.' + Perc,\n mult: length\n };\n enter[v] = zero;\n enter[uu] = {\n signal: adjust + 'datum.' + Perc2,\n mult: length\n };\n enter[vv] = encoder(thickness);\n const encode = {\n enter: enter,\n update: extend({}, enter, {\n opacity: one\n }),\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('gradientStrokeColor'),\n strokeWidth: _('gradientStrokeWidth')\n }, {\n // update\n opacity: _('gradientOpacity')\n });\n return guideMark({\n type: RectMark,\n role: LegendBandRole,\n key: Value,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nconst alignExpr = `datum.${Perc}<=0?\"${Left}\":datum.${Perc}>=1?\"${Right}\":\"${Center}\"`,\n baselineExpr = `datum.${Perc}<=0?\"${Bottom}\":datum.${Perc}>=1?\"${Top}\":\"${Middle}\"`;\nfunction legendGradientLabels (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n vertical = _.isVertical(),\n thickness = encoder(_.gradientThickness()),\n length = _.gradientLength();\n let overlap = _('labelOverlap'),\n enter,\n update,\n u,\n v,\n adjust = '';\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one,\n text: {\n field: Label\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n fill: _('labelColor'),\n fillOpacity: _('labelOpacity'),\n font: _('labelFont'),\n fontSize: _('labelFontSize'),\n fontStyle: _('labelFontStyle'),\n fontWeight: _('labelFontWeight'),\n limit: value(spec.labelLimit, config.gradientLabelLimit)\n });\n if (vertical) {\n enter.align = {\n value: 'left'\n };\n enter.baseline = update.baseline = {\n signal: baselineExpr\n };\n u = 'y';\n v = 'x';\n adjust = '1-';\n } else {\n enter.align = update.align = {\n signal: alignExpr\n };\n enter.baseline = {\n value: 'top'\n };\n u = 'x';\n v = 'y';\n }\n enter[u] = update[u] = {\n signal: adjust + 'datum.' + Perc,\n mult: length\n };\n enter[v] = update[v] = thickness;\n thickness.offset = value(spec.labelOffset, config.gradientLabelOffset) || 0;\n overlap = overlap ? {\n separation: _('labelSeparation'),\n method: overlap,\n order: 'datum.' + Index\n } : undefined;\n\n // type, role, style, key, dataRef, encode, extras\n return guideMark({\n type: TextMark,\n role: LegendLabelRole,\n style: GuideLabelStyle,\n key: Value,\n from: dataRef,\n encode,\n overlap\n }, userEncode);\n}\n\n// userEncode is top-level, includes entries, symbols, labels\nfunction legendSymbolGroups (spec, config, userEncode, dataRef, columns) {\n const _ = lookup(spec, config),\n entries = userEncode.entries,\n interactive = !!(entries && entries.interactive),\n name = entries ? entries.name : undefined,\n height = _('clipHeight'),\n symbolOffset = _('symbolOffset'),\n valueRef = {\n data: 'value'\n },\n xSignal = `(${columns}) ? datum.${Offset} : datum.${Size}`,\n yEncode = height ? encoder(height) : {\n field: Size\n },\n index = `datum.${Index}`,\n ncols = `max(1, ${columns})`;\n let encode, enter, update, nrows, sort;\n yEncode.mult = 0.5;\n\n // -- LEGEND SYMBOLS --\n encode = {\n enter: enter = {\n opacity: zero,\n x: {\n signal: xSignal,\n mult: 0.5,\n offset: symbolOffset\n },\n y: yEncode\n },\n update: update = {\n opacity: one,\n x: enter.x,\n y: enter.y\n },\n exit: {\n opacity: zero\n }\n };\n let baseFill = null,\n baseStroke = null;\n if (!spec.fill) {\n baseFill = config.symbolBaseFillColor;\n baseStroke = config.symbolBaseStrokeColor;\n }\n addEncoders(encode, {\n fill: _('symbolFillColor', baseFill),\n shape: _('symbolType'),\n size: _('symbolSize'),\n stroke: _('symbolStrokeColor', baseStroke),\n strokeDash: _('symbolDash'),\n strokeDashOffset: _('symbolDashOffset'),\n strokeWidth: _('symbolStrokeWidth')\n }, {\n // update\n opacity: _('symbolOpacity')\n });\n LegendScales.forEach(scale => {\n if (spec[scale]) {\n update[scale] = enter[scale] = {\n scale: spec[scale],\n field: Value\n };\n }\n });\n const symbols = guideMark({\n type: SymbolMark,\n role: LegendSymbolRole,\n key: Value,\n from: valueRef,\n clip: height ? true : undefined,\n encode\n }, userEncode.symbols);\n\n // -- LEGEND LABELS --\n const labelOffset = encoder(symbolOffset);\n labelOffset.offset = _('labelOffset');\n encode = {\n enter: enter = {\n opacity: zero,\n x: {\n signal: xSignal,\n offset: labelOffset\n },\n y: yEncode\n },\n update: update = {\n opacity: one,\n text: {\n field: Label\n },\n x: enter.x,\n y: enter.y\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n align: _('labelAlign'),\n baseline: _('labelBaseline'),\n fill: _('labelColor'),\n fillOpacity: _('labelOpacity'),\n font: _('labelFont'),\n fontSize: _('labelFontSize'),\n fontStyle: _('labelFontStyle'),\n fontWeight: _('labelFontWeight'),\n limit: _('labelLimit')\n });\n const labels = guideMark({\n type: TextMark,\n role: LegendLabelRole,\n style: GuideLabelStyle,\n key: Value,\n from: valueRef,\n encode\n }, userEncode.labels);\n\n // -- LEGEND ENTRY GROUPS --\n encode = {\n enter: {\n noBound: {\n value: !height\n },\n // ignore width/height in bounds calc\n width: zero,\n height: height ? encoder(height) : zero,\n opacity: zero\n },\n exit: {\n opacity: zero\n },\n update: update = {\n opacity: one,\n row: {\n signal: null\n },\n column: {\n signal: null\n }\n }\n };\n\n // annotate and sort groups to ensure correct ordering\n if (_.isVertical(true)) {\n nrows = `ceil(item.mark.items.length / ${ncols})`;\n update.row.signal = `${index}%${nrows}`;\n update.column.signal = `floor(${index} / ${nrows})`;\n sort = {\n field: ['row', index]\n };\n } else {\n update.row.signal = `floor(${index} / ${ncols})`;\n update.column.signal = `${index} % ${ncols}`;\n sort = {\n field: index\n };\n }\n // handle zero column case (implies infinite columns)\n update.column.signal = `(${columns})?${update.column.signal}:${index}`;\n\n // facet legend entries into sub-groups\n dataRef = {\n facet: {\n data: dataRef,\n name: 'value',\n groupby: Index\n }\n };\n return guideGroup({\n role: ScopeRole,\n from: dataRef,\n encode: extendEncode(encode, entries, Skip),\n marks: [symbols, labels],\n name,\n interactive,\n sort\n });\n}\nfunction legendSymbolLayout(spec, config) {\n const _ = lookup(spec, config);\n\n // layout parameters for legend entries\n return {\n align: _('gridAlign'),\n columns: _.entryColumns(),\n center: {\n row: true,\n column: false\n },\n padding: {\n row: _('rowPadding'),\n column: _('columnPadding')\n }\n };\n}\n\n// expression logic for align, anchor, angle, and baseline calculation\nconst isL = 'item.orient === \"left\"',\n isR = 'item.orient === \"right\"',\n isLR = `(${isL} || ${isR})`,\n isVG = `datum.vgrad && ${isLR}`,\n baseline = anchorExpr('\"top\"', '\"bottom\"', '\"middle\"'),\n alignFlip = anchorExpr('\"right\"', '\"left\"', '\"center\"'),\n exprAlign = `datum.vgrad && ${isR} ? (${alignFlip}) : (${isLR} && !(datum.vgrad && ${isL})) ? \"left\" : ${alignExpr$1}`,\n exprAnchor = `item._anchor || (${isLR} ? \"middle\" : \"start\")`,\n exprAngle = `${isVG} ? (${isL} ? -90 : 90) : 0`,\n exprBaseline = `${isLR} ? (datum.vgrad ? (${isR} ? \"bottom\" : \"top\") : ${baseline}) : \"top\"`;\nfunction legendTitle (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config);\n const encode = {\n enter: {\n opacity: zero\n },\n update: {\n opacity: one,\n x: {\n field: {\n group: 'padding'\n }\n },\n y: {\n field: {\n group: 'padding'\n }\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n orient: _('titleOrient'),\n _anchor: _('titleAnchor'),\n anchor: {\n signal: exprAnchor\n },\n angle: {\n signal: exprAngle\n },\n align: {\n signal: exprAlign\n },\n baseline: {\n signal: exprBaseline\n },\n text: spec.title,\n fill: _('titleColor'),\n fillOpacity: _('titleOpacity'),\n font: _('titleFont'),\n fontSize: _('titleFontSize'),\n fontStyle: _('titleFontStyle'),\n fontWeight: _('titleFontWeight'),\n limit: _('titleLimit'),\n lineHeight: _('titleLineHeight')\n }, {\n // require update\n align: _('titleAlign'),\n baseline: _('titleBaseline')\n });\n return guideMark({\n type: TextMark,\n role: LegendTitleRole,\n style: GuideTitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction clip (clip, scope) {\n let expr;\n if (isObject(clip)) {\n if (clip.signal) {\n expr = clip.signal;\n } else if (clip.path) {\n expr = 'pathShape(' + param(clip.path) + ')';\n } else if (clip.sphere) {\n expr = 'geoShape(' + param(clip.sphere) + ', {type: \"Sphere\"})';\n }\n }\n return expr ? scope.signalRef(expr) : !!clip;\n}\nfunction param(value) {\n return isObject(value) && value.signal ? value.signal : stringValue(value);\n}\n\nfunction getRole (spec) {\n const role = spec.role || '';\n return role.startsWith('axis') || role.startsWith('legend') || role.startsWith('title') ? role : spec.type === GroupMark ? ScopeRole : role || MarkRole;\n}\n\nfunction definition (spec) {\n return {\n marktype: spec.type,\n name: spec.name || undefined,\n role: spec.role || getRole(spec),\n zindex: +spec.zindex || undefined,\n aria: spec.aria,\n description: spec.description\n };\n}\n\nfunction interactive (spec, scope) {\n return spec && spec.signal ? scope.signalRef(spec.signal) : spec === false ? false : true;\n}\n\n/**\n * Parse a data transform specification.\n */\nfunction parseTransform (spec, scope) {\n const def = definition$1(spec.type);\n if (!def) error('Unrecognized transform type: ' + stringValue(spec.type));\n const t = entry(def.type.toLowerCase(), null, parseParameters(def, spec, scope));\n if (spec.signal) scope.addSignal(spec.signal, scope.proxy(t));\n t.metadata = def.metadata || {};\n return t;\n}\n\n/**\n * Parse all parameters of a data transform.\n */\nfunction parseParameters(def, spec, scope) {\n const params = {},\n n = def.params.length;\n for (let i = 0; i < n; ++i) {\n const pdef = def.params[i];\n params[pdef.name] = parseParameter(pdef, spec, scope);\n }\n return params;\n}\n\n/**\n * Parse a data transform parameter.\n */\nfunction parseParameter(def, spec, scope) {\n const type = def.type,\n value = spec[def.name];\n if (type === 'index') {\n return parseIndexParameter(def, spec, scope);\n } else if (value === undefined) {\n if (def.required) {\n error('Missing required ' + stringValue(spec.type) + ' parameter: ' + stringValue(def.name));\n }\n return;\n } else if (type === 'param') {\n return parseSubParameters(def, spec, scope);\n } else if (type === 'projection') {\n return scope.projectionRef(spec[def.name]);\n }\n return def.array && !isSignal(value) ? value.map(v => parameterValue(def, v, scope)) : parameterValue(def, value, scope);\n}\n\n/**\n * Parse a single parameter value.\n */\nfunction parameterValue(def, value, scope) {\n const type = def.type;\n if (isSignal(value)) {\n return isExpr(type) ? error('Expression references can not be signals.') : isField(type) ? scope.fieldRef(value) : isCompare(type) ? scope.compareRef(value) : scope.signalRef(value.signal);\n } else {\n const expr = def.expr || isField(type);\n return expr && outerExpr(value) ? scope.exprRef(value.expr, value.as) : expr && outerField(value) ? fieldRef$1(value.field, value.as) : isExpr(type) ? parseExpression(value, scope) : isData(type) ? ref(scope.getData(value).values) : isField(type) ? fieldRef$1(value) : isCompare(type) ? scope.compareRef(value) : value;\n }\n}\n\n/**\n * Parse parameter for accessing an index of another data set.\n */\nfunction parseIndexParameter(def, spec, scope) {\n if (!isString(spec.from)) {\n error('Lookup \"from\" parameter must be a string literal.');\n }\n return scope.getData(spec.from).lookupRef(scope, spec.key);\n}\n\n/**\n * Parse a parameter that contains one or more sub-parameter objects.\n */\nfunction parseSubParameters(def, spec, scope) {\n const value = spec[def.name];\n if (def.array) {\n if (!isArray(value)) {\n // signals not allowed!\n error('Expected an array of sub-parameters. Instead: ' + stringValue(value));\n }\n return value.map(v => parseSubParameter(def, v, scope));\n } else {\n return parseSubParameter(def, value, scope);\n }\n}\n\n/**\n * Parse a sub-parameter object.\n */\nfunction parseSubParameter(def, value, scope) {\n const n = def.params.length;\n let pdef;\n\n // loop over defs to find matching key\n for (let i = 0; i < n; ++i) {\n pdef = def.params[i];\n for (const k in pdef.key) {\n if (pdef.key[k] !== value[k]) {\n pdef = null;\n break;\n }\n }\n if (pdef) break;\n }\n // raise error if matching key not found\n if (!pdef) error('Unsupported parameter: ' + stringValue(value));\n\n // parse params, create Params transform, return ref\n const params = extend(parseParameters(pdef, value, scope), pdef.key);\n return ref(scope.add(Params(params)));\n}\n\n// -- Utilities -----\n\nconst outerExpr = _ => _ && _.expr;\nconst outerField = _ => _ && _.field;\nconst isData = _ => _ === 'data';\nconst isExpr = _ => _ === 'expr';\nconst isField = _ => _ === 'field';\nconst isCompare = _ => _ === 'compare';\n\nfunction parseData$1 (from, group, scope) {\n let facet, key, op, dataRef, parent;\n\n // if no source data, generate singleton datum\n if (!from) {\n dataRef = ref(scope.add(Collect(null, [{}])));\n }\n\n // if faceted, process facet specification\n else if (facet = from.facet) {\n if (!group) error('Only group marks can be faceted.');\n\n // use pre-faceted source data, if available\n if (facet.field != null) {\n dataRef = parent = getDataRef(facet, scope);\n } else {\n // generate facet aggregates if no direct data specification\n if (!from.data) {\n op = parseTransform(extend({\n type: 'aggregate',\n groupby: array(facet.groupby)\n }, facet.aggregate), scope);\n op.params.key = scope.keyRef(facet.groupby);\n op.params.pulse = getDataRef(facet, scope);\n dataRef = parent = ref(scope.add(op));\n } else {\n parent = ref(scope.getData(from.data).aggregate);\n }\n key = scope.keyRef(facet.groupby, true);\n }\n }\n\n // if not yet defined, get source data reference\n if (!dataRef) {\n dataRef = getDataRef(from, scope);\n }\n return {\n key: key,\n pulse: dataRef,\n parent: parent\n };\n}\nfunction getDataRef(from, scope) {\n return from.$ref ? from : from.data && from.data.$ref ? from.data : ref(scope.getData(from.data).output);\n}\n\nfunction DataScope(scope, input, output, values, aggr) {\n this.scope = scope; // parent scope object\n this.input = input; // first operator in pipeline (tuple input)\n this.output = output; // last operator in pipeline (tuple output)\n this.values = values; // operator for accessing tuples (but not tuple flow)\n\n // last aggregate in transform pipeline\n this.aggregate = aggr;\n\n // lookup table of field indices\n this.index = {};\n}\nDataScope.fromEntries = function (scope, entries) {\n const n = entries.length,\n values = entries[n - 1],\n output = entries[n - 2];\n let input = entries[0],\n aggr = null,\n i = 1;\n if (input && input.type === 'load') {\n input = entries[1];\n }\n\n // add operator entries to this scope, wire up pulse chain\n scope.add(entries[0]);\n for (; i < n; ++i) {\n entries[i].params.pulse = ref(entries[i - 1]);\n scope.add(entries[i]);\n if (entries[i].type === 'aggregate') aggr = entries[i];\n }\n return new DataScope(scope, input, output, values, aggr);\n};\nfunction fieldKey(field) {\n return isString(field) ? field : null;\n}\nfunction addSortField(scope, p, sort) {\n const as = aggrField(sort.op, sort.field);\n let s;\n if (p.ops) {\n for (let i = 0, n = p.as.length; i < n; ++i) {\n if (p.as[i] === as) return;\n }\n } else {\n p.ops = ['count'];\n p.fields = [null];\n p.as = ['count'];\n }\n if (sort.op) {\n p.ops.push((s = sort.op.signal) ? scope.signalRef(s) : sort.op);\n p.fields.push(scope.fieldRef(sort.field));\n p.as.push(as);\n }\n}\nfunction cache(scope, ds, name, optype, field, counts, index) {\n const cache = ds[name] || (ds[name] = {}),\n sort = sortKey(counts);\n let k = fieldKey(field),\n v,\n op;\n if (k != null) {\n scope = ds.scope;\n k = k + (sort ? '|' + sort : '');\n v = cache[k];\n }\n if (!v) {\n const params = counts ? {\n field: keyFieldRef,\n pulse: ds.countsRef(scope, field, counts)\n } : {\n field: scope.fieldRef(field),\n pulse: ref(ds.output)\n };\n if (sort) params.sort = scope.sortRef(counts);\n op = scope.add(entry(optype, undefined, params));\n if (index) ds.index[field] = op;\n v = ref(op);\n if (k != null) cache[k] = v;\n }\n return v;\n}\nDataScope.prototype = {\n countsRef(scope, field, sort) {\n const ds = this,\n cache = ds.counts || (ds.counts = {}),\n k = fieldKey(field);\n let v, a, p;\n if (k != null) {\n scope = ds.scope;\n v = cache[k];\n }\n if (!v) {\n p = {\n groupby: scope.fieldRef(field, 'key'),\n pulse: ref(ds.output)\n };\n if (sort && sort.field) addSortField(scope, p, sort);\n a = scope.add(Aggregate(p));\n v = scope.add(Collect({\n pulse: ref(a)\n }));\n v = {\n agg: a,\n ref: ref(v)\n };\n if (k != null) cache[k] = v;\n } else if (sort && sort.field) {\n addSortField(scope, v.agg.params, sort);\n }\n return v.ref;\n },\n tuplesRef() {\n return ref(this.values);\n },\n extentRef(scope, field) {\n return cache(scope, this, 'extent', 'extent', field, false);\n },\n domainRef(scope, field) {\n return cache(scope, this, 'domain', 'values', field, false);\n },\n valuesRef(scope, field, sort) {\n return cache(scope, this, 'vals', 'values', field, sort || true);\n },\n lookupRef(scope, field) {\n return cache(scope, this, 'lookup', 'tupleindex', field, false);\n },\n indataRef(scope, field) {\n return cache(scope, this, 'indata', 'tupleindex', field, true, true);\n }\n};\n\nfunction parseFacet (spec, scope, group) {\n const facet = spec.from.facet,\n name = facet.name,\n data = getDataRef(facet, scope);\n let op;\n if (!facet.name) {\n error('Facet must have a name: ' + stringValue(facet));\n }\n if (!facet.data) {\n error('Facet must reference a data set: ' + stringValue(facet));\n }\n if (facet.field) {\n op = scope.add(PreFacet({\n field: scope.fieldRef(facet.field),\n pulse: data\n }));\n } else if (facet.groupby) {\n op = scope.add(Facet({\n key: scope.keyRef(facet.groupby),\n group: ref(scope.proxy(group.parent)),\n pulse: data\n }));\n } else {\n error('Facet must specify groupby or field: ' + stringValue(facet));\n }\n\n // initialize facet subscope\n const subscope = scope.fork(),\n source = subscope.add(Collect()),\n values = subscope.add(Sieve({\n pulse: ref(source)\n }));\n subscope.addData(name, new DataScope(subscope, source, source, values));\n subscope.addSignal('parent', null);\n\n // parse faceted subflow\n op.params.subflow = {\n $subflow: subscope.parse(spec).toRuntime()\n };\n}\n\nfunction parseSubflow (spec, scope, input) {\n const op = scope.add(PreFacet({\n pulse: input.pulse\n })),\n subscope = scope.fork();\n subscope.add(Sieve());\n subscope.addSignal('parent', null);\n\n // parse group mark subflow\n op.params.subflow = {\n $subflow: subscope.parse(spec).toRuntime()\n };\n}\n\nfunction parseTrigger (spec, scope, name) {\n const remove = spec.remove,\n insert = spec.insert,\n toggle = spec.toggle,\n modify = spec.modify,\n values = spec.values,\n op = scope.add(operator());\n const update = 'if(' + spec.trigger + ',modify(\"' + name + '\",' + [insert, remove, toggle, modify, values].map(_ => _ == null ? 'null' : _).join(',') + '),0)';\n const expr = parseExpression(update, scope);\n op.update = expr.$expr;\n op.params = expr.$params;\n}\n\nfunction parseMark (spec, scope) {\n const role = getRole(spec),\n group = spec.type === GroupMark,\n facet = spec.from && spec.from.facet,\n overlap = spec.overlap;\n let layout = spec.layout || role === ScopeRole || role === FrameRole,\n ops,\n op,\n store,\n enc,\n name,\n layoutRef,\n boundRef;\n const nested = role === MarkRole || layout || facet;\n\n // resolve input data\n const input = parseData$1(spec.from, group, scope);\n\n // data join to map tuples to visual items\n op = scope.add(DataJoin({\n key: input.key || (spec.key ? fieldRef$1(spec.key) : undefined),\n pulse: input.pulse,\n clean: !group\n }));\n const joinRef = ref(op);\n\n // collect visual items\n op = store = scope.add(Collect({\n pulse: joinRef\n }));\n\n // connect visual items to scenegraph\n op = scope.add(Mark({\n markdef: definition(spec),\n interactive: interactive(spec.interactive, scope),\n clip: clip(spec.clip, scope),\n context: {\n $context: true\n },\n groups: scope.lookup(),\n parent: scope.signals.parent ? scope.signalRef('parent') : null,\n index: scope.markpath(),\n pulse: ref(op)\n }));\n const markRef = ref(op);\n\n // add visual encoders\n op = enc = scope.add(Encode(parseEncode(spec.encode, spec.type, role, spec.style, scope, {\n mod: false,\n pulse: markRef\n })));\n\n // monitor parent marks to propagate changes\n op.params.parent = scope.encode();\n\n // add post-encoding transforms, if defined\n if (spec.transform) {\n spec.transform.forEach(_ => {\n const tx = parseTransform(_, scope),\n md = tx.metadata;\n if (md.generates || md.changes) {\n error('Mark transforms should not generate new data.');\n }\n if (!md.nomod) enc.params.mod = true; // update encode mod handling\n tx.params.pulse = ref(op);\n scope.add(op = tx);\n });\n }\n\n // if item sort specified, perform post-encoding\n if (spec.sort) {\n op = scope.add(SortItems({\n sort: scope.compareRef(spec.sort),\n pulse: ref(op)\n }));\n }\n const encodeRef = ref(op);\n\n // add view layout operator if needed\n if (facet || layout) {\n layout = scope.add(ViewLayout({\n layout: scope.objectProperty(spec.layout),\n legends: scope.legends,\n mark: markRef,\n pulse: encodeRef\n }));\n layoutRef = ref(layout);\n }\n\n // compute bounding boxes\n const bound = scope.add(Bound({\n mark: markRef,\n pulse: layoutRef || encodeRef\n }));\n boundRef = ref(bound);\n\n // if group mark, recurse to parse nested content\n if (group) {\n // juggle layout & bounds to ensure they run *after* any faceting transforms\n if (nested) {\n ops = scope.operators;\n ops.pop();\n if (layout) ops.pop();\n }\n scope.pushState(encodeRef, layoutRef || boundRef, joinRef);\n facet ? parseFacet(spec, scope, input) // explicit facet\n : nested ? parseSubflow(spec, scope, input) // standard mark group\n : scope.parse(spec); // guide group, we can avoid nested scopes\n scope.popState();\n if (nested) {\n if (layout) ops.push(layout);\n ops.push(bound);\n }\n }\n\n // if requested, add overlap removal transform\n if (overlap) {\n boundRef = parseOverlap(overlap, boundRef, scope);\n }\n\n // render / sieve items\n const render = scope.add(Render({\n pulse: boundRef\n })),\n sieve = scope.add(Sieve({\n pulse: ref(render)\n }, undefined, scope.parent()));\n\n // if mark is named, make accessible as reactive geometry\n // add trigger updates if defined\n if (spec.name != null) {\n name = spec.name;\n scope.addData(name, new DataScope(scope, store, render, sieve));\n if (spec.on) spec.on.forEach(on => {\n if (on.insert || on.remove || on.toggle) {\n error('Marks only support modify triggers.');\n }\n parseTrigger(on, scope, name);\n });\n }\n}\nfunction parseOverlap(overlap, source, scope) {\n const method = overlap.method,\n bound = overlap.bound,\n sep = overlap.separation;\n const params = {\n separation: isSignal(sep) ? scope.signalRef(sep.signal) : sep,\n method: isSignal(method) ? scope.signalRef(method.signal) : method,\n pulse: source\n };\n if (overlap.order) {\n params.sort = scope.compareRef({\n field: overlap.order\n });\n }\n if (bound) {\n const tol = bound.tolerance;\n params.boundTolerance = isSignal(tol) ? scope.signalRef(tol.signal) : +tol;\n params.boundScale = scope.scaleRef(bound.scale);\n params.boundOrient = bound.orient;\n }\n return ref(scope.add(Overlap(params)));\n}\n\nfunction parseLegend (spec, scope) {\n const config = scope.config.legend,\n encode = spec.encode || {},\n _ = lookup(spec, config),\n legendEncode = encode.legend || {},\n name = legendEncode.name || undefined,\n interactive = legendEncode.interactive,\n style = legendEncode.style,\n scales = {};\n let scale = 0,\n entryLayout,\n params,\n children;\n\n // resolve scales and 'canonical' scale name\n LegendScales.forEach(s => spec[s] ? (scales[s] = spec[s], scale = scale || spec[s]) : 0);\n if (!scale) error('Missing valid scale for legend.');\n\n // resolve legend type (symbol, gradient, or discrete gradient)\n const type = legendType(spec, scope.scaleType(scale));\n\n // single-element data source for legend group\n const datum = {\n title: spec.title != null,\n scales: scales,\n type: type,\n vgrad: type !== 'symbol' && _.isVertical()\n };\n const dataRef = ref(scope.add(Collect(null, [datum])));\n\n // encoding properties for legend entry sub-group\n const entryEncode = {\n enter: {\n x: {\n value: 0\n },\n y: {\n value: 0\n }\n }\n };\n\n // data source for legend values\n const entryRef = ref(scope.add(LegendEntries(params = {\n type: type,\n scale: scope.scaleRef(scale),\n count: scope.objectProperty(_('tickCount')),\n limit: scope.property(_('symbolLimit')),\n values: scope.objectProperty(spec.values),\n minstep: scope.property(spec.tickMinStep),\n formatType: scope.property(spec.formatType),\n formatSpecifier: scope.property(spec.format)\n })));\n\n // continuous gradient legend\n if (type === Gradient) {\n children = [legendGradient(spec, scale, config, encode.gradient), legendGradientLabels(spec, config, encode.labels, entryRef)];\n // adjust default tick count based on the gradient length\n params.count = params.count || scope.signalRef(`max(2,2*floor((${deref(_.gradientLength())})/100))`);\n }\n\n // discrete gradient legend\n else if (type === Discrete) {\n children = [legendGradientDiscrete(spec, scale, config, encode.gradient, entryRef), legendGradientLabels(spec, config, encode.labels, entryRef)];\n }\n\n // symbol legend\n else {\n // determine legend symbol group layout\n entryLayout = legendSymbolLayout(spec, config);\n children = [legendSymbolGroups(spec, config, encode, entryRef, deref(entryLayout.columns))];\n // pass symbol size information to legend entry generator\n params.size = sizeExpression(spec, scope, children[0].marks);\n }\n\n // generate legend marks\n children = [guideGroup({\n role: LegendEntryRole,\n from: dataRef,\n encode: entryEncode,\n marks: children,\n layout: entryLayout,\n interactive\n })];\n\n // include legend title if defined\n if (datum.title) {\n children.push(legendTitle(spec, config, encode.title, dataRef));\n }\n\n // parse legend specification\n return parseMark(guideGroup({\n role: LegendRole,\n from: dataRef,\n encode: extendEncode(buildLegendEncode(_, spec, config), legendEncode, Skip),\n marks: children,\n aria: _('aria'),\n description: _('description'),\n zindex: _('zindex'),\n name,\n interactive,\n style\n }), scope);\n}\nfunction legendType(spec, scaleType) {\n let type = spec.type || Symbols;\n if (!spec.type && scaleCount(spec) === 1 && (spec.fill || spec.stroke)) {\n type = isContinuous(scaleType) ? Gradient : isDiscretizing(scaleType) ? Discrete : Symbols;\n }\n return type !== Gradient ? type : isDiscretizing(scaleType) ? Discrete : Gradient;\n}\nfunction scaleCount(spec) {\n return LegendScales.reduce((count, type) => count + (spec[type] ? 1 : 0), 0);\n}\nfunction buildLegendEncode(_, spec, config) {\n const encode = {\n enter: {},\n update: {}\n };\n addEncoders(encode, {\n orient: _('orient'),\n offset: _('offset'),\n padding: _('padding'),\n titlePadding: _('titlePadding'),\n cornerRadius: _('cornerRadius'),\n fill: _('fillColor'),\n stroke: _('strokeColor'),\n strokeWidth: config.strokeWidth,\n strokeDash: config.strokeDash,\n x: _('legendX'),\n y: _('legendY'),\n // accessibility support\n format: spec.format,\n formatType: spec.formatType\n });\n return encode;\n}\nfunction sizeExpression(spec, scope, marks) {\n const size = deref(getChannel('size', spec, marks)),\n strokeWidth = deref(getChannel('strokeWidth', spec, marks)),\n fontSize = deref(getFontSize(marks[1].encode, scope, GuideLabelStyle));\n return parseExpression(`max(ceil(sqrt(${size})+${strokeWidth}),${fontSize})`, scope);\n}\nfunction getChannel(name, spec, marks) {\n return spec[name] ? `scale(\"${spec[name]}\",datum)` : getEncoding(name, marks[0].encode);\n}\nfunction getFontSize(encode, scope, style) {\n return getEncoding('fontSize', encode) || getStyle('fontSize', scope, style);\n}\n\nconst angleExpr = `item.orient===\"${Left}\"?-90:item.orient===\"${Right}\"?90:0`;\nfunction parseTitle (spec, scope) {\n spec = isString(spec) ? {\n text: spec\n } : spec;\n const _ = lookup(spec, scope.config.title),\n encode = spec.encode || {},\n userEncode = encode.group || {},\n name = userEncode.name || undefined,\n interactive = userEncode.interactive,\n style = userEncode.style,\n children = [];\n\n // single-element data source for group title\n const datum = {},\n dataRef = ref(scope.add(Collect(null, [datum])));\n\n // include title text\n children.push(buildTitle(spec, _, titleEncode(spec), dataRef));\n\n // include subtitle text\n if (spec.subtitle) {\n children.push(buildSubTitle(spec, _, encode.subtitle, dataRef));\n }\n\n // parse title specification\n return parseMark(guideGroup({\n role: TitleRole,\n from: dataRef,\n encode: groupEncode(_, userEncode),\n marks: children,\n aria: _('aria'),\n description: _('description'),\n zindex: _('zindex'),\n name,\n interactive,\n style\n }), scope);\n}\n\n// provide backwards-compatibility for title custom encode;\n// the top-level encode block has been *deprecated*.\nfunction titleEncode(spec) {\n const encode = spec.encode;\n return encode && encode.title || extend({\n name: spec.name,\n interactive: spec.interactive,\n style: spec.style\n }, encode);\n}\nfunction groupEncode(_, userEncode) {\n const encode = {\n enter: {},\n update: {}\n };\n addEncoders(encode, {\n orient: _('orient'),\n anchor: _('anchor'),\n align: {\n signal: alignExpr$1\n },\n angle: {\n signal: angleExpr\n },\n limit: _('limit'),\n frame: _('frame'),\n offset: _('offset') || 0,\n padding: _('subtitlePadding')\n });\n return extendEncode(encode, userEncode, Skip);\n}\nfunction buildTitle(spec, _, userEncode, dataRef) {\n const zero = {\n value: 0\n },\n text = spec.text,\n encode = {\n enter: {\n opacity: zero\n },\n update: {\n opacity: {\n value: 1\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n text: text,\n align: {\n signal: 'item.mark.group.align'\n },\n angle: {\n signal: 'item.mark.group.angle'\n },\n limit: {\n signal: 'item.mark.group.limit'\n },\n baseline: 'top',\n dx: _('dx'),\n dy: _('dy'),\n fill: _('color'),\n font: _('font'),\n fontSize: _('fontSize'),\n fontStyle: _('fontStyle'),\n fontWeight: _('fontWeight'),\n lineHeight: _('lineHeight')\n }, {\n // update\n align: _('align'),\n angle: _('angle'),\n baseline: _('baseline')\n });\n return guideMark({\n type: TextMark,\n role: TitleTextRole,\n style: GroupTitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\nfunction buildSubTitle(spec, _, userEncode, dataRef) {\n const zero = {\n value: 0\n },\n text = spec.subtitle,\n encode = {\n enter: {\n opacity: zero\n },\n update: {\n opacity: {\n value: 1\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n text: text,\n align: {\n signal: 'item.mark.group.align'\n },\n angle: {\n signal: 'item.mark.group.angle'\n },\n limit: {\n signal: 'item.mark.group.limit'\n },\n baseline: 'top',\n dx: _('dx'),\n dy: _('dy'),\n fill: _('subtitleColor'),\n font: _('subtitleFont'),\n fontSize: _('subtitleFontSize'),\n fontStyle: _('subtitleFontStyle'),\n fontWeight: _('subtitleFontWeight'),\n lineHeight: _('subtitleLineHeight')\n }, {\n // update\n align: _('align'),\n angle: _('angle'),\n baseline: _('baseline')\n });\n return guideMark({\n type: TextMark,\n role: TitleSubtitleRole,\n style: GroupSubtitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction parseData(data, scope) {\n const transforms = [];\n if (data.transform) {\n data.transform.forEach(tx => {\n transforms.push(parseTransform(tx, scope));\n });\n }\n if (data.on) {\n data.on.forEach(on => {\n parseTrigger(on, scope, data.name);\n });\n }\n scope.addDataPipeline(data.name, analyze(data, scope, transforms));\n}\n\n/**\n * Analyze a data pipeline, add needed operators.\n */\nfunction analyze(data, scope, ops) {\n const output = [];\n let source = null,\n modify = false,\n generate = false,\n upstream,\n i,\n n,\n t,\n m;\n if (data.values) {\n // hard-wired input data set\n if (isSignal(data.values) || hasSignal(data.format)) {\n // if either values is signal or format has signal, use dynamic loader\n output.push(load(scope, data));\n output.push(source = collect());\n } else {\n // otherwise, ingest upon dataflow init\n output.push(source = collect({\n $ingest: data.values,\n $format: data.format\n }));\n }\n } else if (data.url) {\n // load data from external source\n if (hasSignal(data.url) || hasSignal(data.format)) {\n // if either url or format has signal, use dynamic loader\n output.push(load(scope, data));\n output.push(source = collect());\n } else {\n // otherwise, request load upon dataflow init\n output.push(source = collect({\n $request: data.url,\n $format: data.format\n }));\n }\n } else if (data.source) {\n // derives from one or more other data sets\n source = upstream = array(data.source).map(d => ref(scope.getData(d).output));\n output.push(null); // populate later\n }\n\n // scan data transforms, add collectors as needed\n for (i = 0, n = ops.length; i < n; ++i) {\n t = ops[i];\n m = t.metadata;\n if (!source && !m.source) {\n output.push(source = collect());\n }\n output.push(t);\n if (m.generates) generate = true;\n if (m.modifies && !generate) modify = true;\n if (m.source) source = t;else if (m.changes) source = null;\n }\n if (upstream) {\n n = upstream.length - 1;\n output[0] = Relay({\n derive: modify,\n pulse: n ? upstream : upstream[0]\n });\n if (modify || n) {\n // collect derived and multi-pulse tuples\n output.splice(1, 0, collect());\n }\n }\n if (!source) output.push(collect());\n output.push(Sieve({}));\n return output;\n}\nfunction collect(values) {\n const s = Collect({}, values);\n s.metadata = {\n source: true\n };\n return s;\n}\nfunction load(scope, data) {\n return Load({\n url: data.url ? scope.property(data.url) : undefined,\n async: data.async ? scope.property(data.async) : undefined,\n values: data.values ? scope.property(data.values) : undefined,\n format: scope.objectProperty(data.format)\n });\n}\n\nconst isX = orient => orient === Bottom || orient === Top;\n\n// get sign coefficient based on axis orient\nconst getSign = (orient, a, b) => isSignal(orient) ? ifLeftTopExpr(orient.signal, a, b) : orient === Left || orient === Top ? a : b;\n\n// condition on axis x-direction\nconst ifX = (orient, a, b) => isSignal(orient) ? ifXEnc(orient.signal, a, b) : isX(orient) ? a : b;\n\n// condition on axis y-direction\nconst ifY = (orient, a, b) => isSignal(orient) ? ifYEnc(orient.signal, a, b) : isX(orient) ? b : a;\nconst ifTop = (orient, a, b) => isSignal(orient) ? ifTopExpr(orient.signal, a, b) : orient === Top ? {\n value: a\n} : {\n value: b\n};\nconst ifRight = (orient, a, b) => isSignal(orient) ? ifRightExpr(orient.signal, a, b) : orient === Right ? {\n value: a\n} : {\n value: b\n};\nconst ifXEnc = ($orient, a, b) => ifEnc(`${$orient} === '${Top}' || ${$orient} === '${Bottom}'`, a, b);\nconst ifYEnc = ($orient, a, b) => ifEnc(`${$orient} !== '${Top}' && ${$orient} !== '${Bottom}'`, a, b);\nconst ifLeftTopExpr = ($orient, a, b) => ifExpr(`${$orient} === '${Left}' || ${$orient} === '${Top}'`, a, b);\nconst ifTopExpr = ($orient, a, b) => ifExpr(`${$orient} === '${Top}'`, a, b);\nconst ifRightExpr = ($orient, a, b) => ifExpr(`${$orient} === '${Right}'`, a, b);\nconst ifEnc = (test, a, b) => {\n // ensure inputs are encoder objects (or null)\n a = a != null ? encoder(a) : a;\n b = b != null ? encoder(b) : b;\n if (isSimple(a) && isSimple(b)) {\n // if possible generate simple signal expression\n a = a ? a.signal || stringValue(a.value) : null;\n b = b ? b.signal || stringValue(b.value) : null;\n return {\n signal: `${test} ? (${a}) : (${b})`\n };\n } else {\n // otherwise generate rule set\n return [extend({\n test\n }, a)].concat(b || []);\n }\n};\nconst isSimple = enc => enc == null || Object.keys(enc).length === 1;\nconst ifExpr = (test, a, b) => ({\n signal: `${test} ? (${toExpr(a)}) : (${toExpr(b)})`\n});\nconst ifOrient = ($orient, t, b, l, r) => ({\n signal: (l != null ? `${$orient} === '${Left}' ? (${toExpr(l)}) : ` : '') + (b != null ? `${$orient} === '${Bottom}' ? (${toExpr(b)}) : ` : '') + (r != null ? `${$orient} === '${Right}' ? (${toExpr(r)}) : ` : '') + (t != null ? `${$orient} === '${Top}' ? (${toExpr(t)}) : ` : '') + '(null)'\n});\nconst toExpr = v => isSignal(v) ? v.signal : v == null ? null : stringValue(v);\nconst mult = (sign, value) => value === 0 ? 0 : isSignal(sign) ? {\n signal: `(${sign.signal}) * ${value}`\n} : {\n value: sign * value\n};\nconst patch = (value, base) => {\n const s = value.signal;\n return s && s.endsWith('(null)') ? {\n signal: s.slice(0, -6) + base.signal\n } : value;\n};\n\nfunction fallback(prop, config, axisConfig, style) {\n let styleProp;\n if (config && hasOwnProperty(config, prop)) {\n return config[prop];\n } else if (hasOwnProperty(axisConfig, prop)) {\n return axisConfig[prop];\n } else if (prop.startsWith('title')) {\n switch (prop) {\n case 'titleColor':\n styleProp = 'fill';\n break;\n case 'titleFont':\n case 'titleFontSize':\n case 'titleFontWeight':\n styleProp = prop[5].toLowerCase() + prop.slice(6);\n }\n return style[GuideTitleStyle][styleProp];\n } else if (prop.startsWith('label')) {\n switch (prop) {\n case 'labelColor':\n styleProp = 'fill';\n break;\n case 'labelFont':\n case 'labelFontSize':\n styleProp = prop[5].toLowerCase() + prop.slice(6);\n }\n return style[GuideLabelStyle][styleProp];\n }\n return null;\n}\nfunction keys(objects) {\n const map = {};\n for (const obj of objects) {\n if (!obj) continue;\n for (const key in obj) map[key] = 1;\n }\n return Object.keys(map);\n}\nfunction axisConfig (spec, scope) {\n var config = scope.config,\n style = config.style,\n axis = config.axis,\n band = scope.scaleType(spec.scale) === 'band' && config.axisBand,\n orient = spec.orient,\n xy,\n or,\n key;\n if (isSignal(orient)) {\n const xyKeys = keys([config.axisX, config.axisY]),\n orientKeys = keys([config.axisTop, config.axisBottom, config.axisLeft, config.axisRight]);\n xy = {};\n for (key of xyKeys) {\n xy[key] = ifX(orient, fallback(key, config.axisX, axis, style), fallback(key, config.axisY, axis, style));\n }\n or = {};\n for (key of orientKeys) {\n or[key] = ifOrient(orient.signal, fallback(key, config.axisTop, axis, style), fallback(key, config.axisBottom, axis, style), fallback(key, config.axisLeft, axis, style), fallback(key, config.axisRight, axis, style));\n }\n } else {\n xy = orient === Top || orient === Bottom ? config.axisX : config.axisY;\n or = config['axis' + orient[0].toUpperCase() + orient.slice(1)];\n }\n const result = xy || or || band ? extend({}, axis, xy, or, band) : axis;\n return result;\n}\n\nfunction axisDomain (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n orient = spec.orient;\n let enter, update;\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('domainColor'),\n strokeCap: _('domainCap'),\n strokeDash: _('domainDash'),\n strokeDashOffset: _('domainDashOffset'),\n strokeWidth: _('domainWidth'),\n strokeOpacity: _('domainOpacity')\n });\n const pos0 = position(spec, 0);\n const pos1 = position(spec, 1);\n enter.x = update.x = ifX(orient, pos0, zero);\n enter.x2 = update.x2 = ifX(orient, pos1);\n enter.y = update.y = ifY(orient, pos0, zero);\n enter.y2 = update.y2 = ifY(orient, pos1);\n return guideMark({\n type: RuleMark,\n role: AxisDomainRole,\n from: dataRef,\n encode\n }, userEncode);\n}\nfunction position(spec, pos) {\n return {\n scale: spec.scale,\n range: pos\n };\n}\n\nfunction axisGrid (spec, config, userEncode, dataRef, band) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n vscale = spec.gridScale,\n sign = getSign(orient, 1, -1),\n offset = offsetValue(spec.offset, sign);\n let enter, exit, update;\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one\n },\n exit: exit = {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('gridColor'),\n strokeCap: _('gridCap'),\n strokeDash: _('gridDash'),\n strokeDashOffset: _('gridDashOffset'),\n strokeOpacity: _('gridOpacity'),\n strokeWidth: _('gridWidth')\n });\n const tickPos = {\n scale: spec.scale,\n field: Value,\n band: band.band,\n extra: band.extra,\n offset: band.offset,\n round: _('tickRound')\n };\n const sz = ifX(orient, {\n signal: 'height'\n }, {\n signal: 'width'\n });\n const gridStart = vscale ? {\n scale: vscale,\n range: 0,\n mult: sign,\n offset: offset\n } : {\n value: 0,\n offset: offset\n };\n const gridEnd = vscale ? {\n scale: vscale,\n range: 1,\n mult: sign,\n offset: offset\n } : extend(sz, {\n mult: sign,\n offset: offset\n });\n enter.x = update.x = ifX(orient, tickPos, gridStart);\n enter.y = update.y = ifY(orient, tickPos, gridStart);\n enter.x2 = update.x2 = ifY(orient, gridEnd);\n enter.y2 = update.y2 = ifX(orient, gridEnd);\n exit.x = ifX(orient, tickPos);\n exit.y = ifY(orient, tickPos);\n return guideMark({\n type: RuleMark,\n role: AxisGridRole,\n key: Value,\n from: dataRef,\n encode\n }, userEncode);\n}\nfunction offsetValue(offset, sign) {\n if (sign === 1) ; else if (!isObject(offset)) {\n offset = isSignal(sign) ? {\n signal: `(${sign.signal}) * (${offset || 0})`\n } : sign * (offset || 0);\n } else {\n let entry = offset = extend({}, offset);\n while (entry.mult != null) {\n if (!isObject(entry.mult)) {\n entry.mult = isSignal(sign) // no offset if sign === 1\n ? {\n signal: `(${entry.mult}) * (${sign.signal})`\n } : entry.mult * sign;\n return offset;\n } else {\n entry = entry.mult = extend({}, entry.mult);\n }\n }\n entry.mult = sign;\n }\n return offset;\n}\n\nfunction axisTicks (spec, config, userEncode, dataRef, size, band) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n sign = getSign(orient, -1, 1);\n let enter, exit, update;\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one\n },\n exit: exit = {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('tickColor'),\n strokeCap: _('tickCap'),\n strokeDash: _('tickDash'),\n strokeDashOffset: _('tickDashOffset'),\n strokeOpacity: _('tickOpacity'),\n strokeWidth: _('tickWidth')\n });\n const tickSize = encoder(size);\n tickSize.mult = sign;\n const tickPos = {\n scale: spec.scale,\n field: Value,\n band: band.band,\n extra: band.extra,\n offset: band.offset,\n round: _('tickRound')\n };\n update.y = enter.y = ifX(orient, zero, tickPos);\n update.y2 = enter.y2 = ifX(orient, tickSize);\n exit.x = ifX(orient, tickPos);\n update.x = enter.x = ifY(orient, zero, tickPos);\n update.x2 = enter.x2 = ifY(orient, tickSize);\n exit.y = ifY(orient, tickPos);\n return guideMark({\n type: RuleMark,\n role: AxisTickRole,\n key: Value,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction flushExpr(scale, threshold, a, b, c) {\n return {\n signal: 'flush(range(\"' + scale + '\"), ' + 'scale(\"' + scale + '\", datum.value), ' + threshold + ',' + a + ',' + b + ',' + c + ')'\n };\n}\nfunction axisLabels (spec, config, userEncode, dataRef, size, band) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n scale = spec.scale,\n sign = getSign(orient, -1, 1),\n flush = deref(_('labelFlush')),\n flushOffset = deref(_('labelFlushOffset')),\n labelAlign = _('labelAlign'),\n labelBaseline = _('labelBaseline');\n let flushOn = flush === 0 || !!flush,\n update;\n const tickSize = encoder(size);\n tickSize.mult = sign;\n tickSize.offset = encoder(_('labelPadding') || 0);\n tickSize.offset.mult = sign;\n const tickPos = {\n scale: scale,\n field: Value,\n band: 0.5,\n offset: extendOffset(band.offset, _('labelOffset'))\n };\n const align = ifX(orient, flushOn ? flushExpr(scale, flush, '\"left\"', '\"right\"', '\"center\"') : {\n value: 'center'\n }, ifRight(orient, 'left', 'right'));\n const baseline = ifX(orient, ifTop(orient, 'bottom', 'top'), flushOn ? flushExpr(scale, flush, '\"top\"', '\"bottom\"', '\"middle\"') : {\n value: 'middle'\n });\n const offsetExpr = flushExpr(scale, flush, `-(${flushOffset})`, flushOffset, 0);\n flushOn = flushOn && flushOffset;\n const enter = {\n opacity: zero,\n x: ifX(orient, tickPos, tickSize),\n y: ifY(orient, tickPos, tickSize)\n };\n const encode = {\n enter: enter,\n update: update = {\n opacity: one,\n text: {\n field: Label\n },\n x: enter.x,\n y: enter.y,\n align,\n baseline\n },\n exit: {\n opacity: zero,\n x: enter.x,\n y: enter.y\n }\n };\n addEncoders(encode, {\n dx: !labelAlign && flushOn ? ifX(orient, offsetExpr) : null,\n dy: !labelBaseline && flushOn ? ifY(orient, offsetExpr) : null\n });\n addEncoders(encode, {\n angle: _('labelAngle'),\n fill: _('labelColor'),\n fillOpacity: _('labelOpacity'),\n font: _('labelFont'),\n fontSize: _('labelFontSize'),\n fontWeight: _('labelFontWeight'),\n fontStyle: _('labelFontStyle'),\n limit: _('labelLimit'),\n lineHeight: _('labelLineHeight')\n }, {\n align: labelAlign,\n baseline: labelBaseline\n });\n const bound = _('labelBound');\n let overlap = _('labelOverlap');\n\n // if overlap method or bound defined, request label overlap removal\n overlap = overlap || bound ? {\n separation: _('labelSeparation'),\n method: overlap,\n order: 'datum.index',\n bound: bound ? {\n scale,\n orient,\n tolerance: bound\n } : null\n } : undefined;\n if (update.align !== align) {\n update.align = patch(update.align, align);\n }\n if (update.baseline !== baseline) {\n update.baseline = patch(update.baseline, baseline);\n }\n return guideMark({\n type: TextMark,\n role: AxisLabelRole,\n style: GuideLabelStyle,\n key: Value,\n from: dataRef,\n encode,\n overlap\n }, userEncode);\n}\n\nfunction axisTitle (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n sign = getSign(orient, -1, 1);\n let enter, update;\n const encode = {\n enter: enter = {\n opacity: zero,\n anchor: encoder(_('titleAnchor', null)),\n align: {\n signal: alignExpr$1\n }\n },\n update: update = extend({}, enter, {\n opacity: one,\n text: encoder(spec.title)\n }),\n exit: {\n opacity: zero\n }\n };\n const titlePos = {\n signal: `lerp(range(\"${spec.scale}\"), ${anchorExpr(0, 1, 0.5)})`\n };\n update.x = ifX(orient, titlePos);\n update.y = ifY(orient, titlePos);\n enter.angle = ifX(orient, zero, mult(sign, 90));\n enter.baseline = ifX(orient, ifTop(orient, Bottom, Top), {\n value: Bottom\n });\n update.angle = enter.angle;\n update.baseline = enter.baseline;\n addEncoders(encode, {\n fill: _('titleColor'),\n fillOpacity: _('titleOpacity'),\n font: _('titleFont'),\n fontSize: _('titleFontSize'),\n fontStyle: _('titleFontStyle'),\n fontWeight: _('titleFontWeight'),\n limit: _('titleLimit'),\n lineHeight: _('titleLineHeight')\n }, {\n // require update\n align: _('titleAlign'),\n angle: _('titleAngle'),\n baseline: _('titleBaseline')\n });\n autoLayout(_, orient, encode, userEncode);\n encode.update.align = patch(encode.update.align, enter.align);\n encode.update.angle = patch(encode.update.angle, enter.angle);\n encode.update.baseline = patch(encode.update.baseline, enter.baseline);\n return guideMark({\n type: TextMark,\n role: AxisTitleRole,\n style: GuideTitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\nfunction autoLayout(_, orient, encode, userEncode) {\n const auto = (value, dim) => value != null ? (encode.update[dim] = patch(encoder(value), encode.update[dim]), false) : !has(dim, userEncode) ? true : false;\n const autoY = auto(_('titleX'), 'x'),\n autoX = auto(_('titleY'), 'y');\n encode.enter.auto = autoX === autoY ? encoder(autoX) : ifX(orient, encoder(autoX), encoder(autoY));\n}\n\nfunction parseAxis (spec, scope) {\n const config = axisConfig(spec, scope),\n encode = spec.encode || {},\n axisEncode = encode.axis || {},\n name = axisEncode.name || undefined,\n interactive = axisEncode.interactive,\n style = axisEncode.style,\n _ = lookup(spec, config),\n band = tickBand(_);\n\n // single-element data source for axis group\n const datum = {\n scale: spec.scale,\n ticks: !!_('ticks'),\n labels: !!_('labels'),\n grid: !!_('grid'),\n domain: !!_('domain'),\n title: spec.title != null\n };\n const dataRef = ref(scope.add(Collect({}, [datum])));\n\n // data source for axis ticks\n const ticksRef = ref(scope.add(AxisTicks({\n scale: scope.scaleRef(spec.scale),\n extra: scope.property(band.extra),\n count: scope.objectProperty(spec.tickCount),\n values: scope.objectProperty(spec.values),\n minstep: scope.property(spec.tickMinStep),\n formatType: scope.property(spec.formatType),\n formatSpecifier: scope.property(spec.format)\n })));\n\n // generate axis marks\n const children = [];\n let size;\n\n // include axis gridlines if requested\n if (datum.grid) {\n children.push(axisGrid(spec, config, encode.grid, ticksRef, band));\n }\n\n // include axis ticks if requested\n if (datum.ticks) {\n size = _('tickSize');\n children.push(axisTicks(spec, config, encode.ticks, ticksRef, size, band));\n }\n\n // include axis labels if requested\n if (datum.labels) {\n size = datum.ticks ? size : 0;\n children.push(axisLabels(spec, config, encode.labels, ticksRef, size, band));\n }\n\n // include axis domain path if requested\n if (datum.domain) {\n children.push(axisDomain(spec, config, encode.domain, dataRef));\n }\n\n // include axis title if defined\n if (datum.title) {\n children.push(axisTitle(spec, config, encode.title, dataRef));\n }\n\n // parse axis specification\n return parseMark(guideGroup({\n role: AxisRole,\n from: dataRef,\n encode: extendEncode(buildAxisEncode(_, spec), axisEncode, Skip),\n marks: children,\n aria: _('aria'),\n description: _('description'),\n zindex: _('zindex'),\n name,\n interactive,\n style\n }), scope);\n}\nfunction buildAxisEncode(_, spec) {\n const encode = {\n enter: {},\n update: {}\n };\n addEncoders(encode, {\n orient: _('orient'),\n offset: _('offset') || 0,\n position: value(spec.position, 0),\n titlePadding: _('titlePadding'),\n minExtent: _('minExtent'),\n maxExtent: _('maxExtent'),\n range: {\n signal: `abs(span(range(\"${spec.scale}\")))`\n },\n translate: _('translate'),\n // accessibility support\n format: spec.format,\n formatType: spec.formatType\n });\n return encode;\n}\n\nfunction parseScope (spec, scope, preprocessed) {\n const signals = array(spec.signals),\n scales = array(spec.scales);\n\n // parse signal definitions, if not already preprocessed\n if (!preprocessed) signals.forEach(_ => parseSignal(_, scope));\n\n // parse cartographic projection definitions\n array(spec.projections).forEach(_ => parseProjection(_, scope));\n\n // initialize scale references\n scales.forEach(_ => initScale(_, scope));\n\n // parse data sources\n array(spec.data).forEach(_ => parseData(_, scope));\n\n // parse scale definitions\n scales.forEach(_ => parseScale(_, scope));\n\n // parse signal updates\n (preprocessed || signals).forEach(_ => parseSignalUpdates(_, scope));\n\n // parse axis definitions\n array(spec.axes).forEach(_ => parseAxis(_, scope));\n\n // parse mark definitions\n array(spec.marks).forEach(_ => parseMark(_, scope));\n\n // parse legend definitions\n array(spec.legends).forEach(_ => parseLegend(_, scope));\n\n // parse title, if defined\n if (spec.title) parseTitle(spec.title, scope);\n\n // parse collected lambda (anonymous) expressions\n scope.parseLambdas();\n return scope;\n}\n\nconst rootEncode = spec => extendEncode({\n enter: {\n x: {\n value: 0\n },\n y: {\n value: 0\n }\n },\n update: {\n width: {\n signal: 'width'\n },\n height: {\n signal: 'height'\n }\n }\n}, spec);\nfunction parseView(spec, scope) {\n const config = scope.config;\n\n // add scenegraph root\n const root = ref(scope.root = scope.add(operator()));\n\n // parse top-level signal definitions\n const signals = collectSignals(spec, config);\n signals.forEach(_ => parseSignal(_, scope));\n\n // assign description, event, legend, and locale configuration\n scope.description = spec.description || config.description;\n scope.eventConfig = config.events;\n scope.legends = scope.objectProperty(config.legend && config.legend.layout);\n scope.locale = config.locale;\n\n // store root group item\n const input = scope.add(Collect());\n\n // encode root group item\n const encode = scope.add(Encode(parseEncode(rootEncode(spec.encode), GroupMark, FrameRole, spec.style, scope, {\n pulse: ref(input)\n })));\n\n // perform view layout\n const parent = scope.add(ViewLayout({\n layout: scope.objectProperty(spec.layout),\n legends: scope.legends,\n autosize: scope.signalRef('autosize'),\n mark: root,\n pulse: ref(encode)\n }));\n scope.operators.pop();\n\n // parse remainder of specification\n scope.pushState(ref(encode), ref(parent), null);\n parseScope(spec, scope, signals);\n scope.operators.push(parent);\n\n // bound / render / sieve root item\n let op = scope.add(Bound({\n mark: root,\n pulse: ref(parent)\n }));\n op = scope.add(Render({\n pulse: ref(op)\n }));\n op = scope.add(Sieve({\n pulse: ref(op)\n }));\n\n // track metadata for root item\n scope.addData('root', new DataScope(scope, input, input, op));\n return scope;\n}\nfunction signalObject(name, value) {\n return value && value.signal ? {\n name,\n update: value.signal\n } : {\n name,\n value\n };\n}\n\n/**\n * Collect top-level signals, merging values as needed. Signals\n * defined in the config signals arrays are added only if that\n * signal is not explicitly defined in the specification.\n * Built-in signals (autosize, background, padding, width, height)\n * receive special treatment. They are initialized using the\n * top-level spec property, or, if undefined in the spec, using\n * the corresponding top-level config property. If this property\n * is a signal reference object, the signal expression maps to the\n * signal 'update' property. If the spec's top-level signal array\n * contains an entry that matches a built-in signal, that entry\n * will be merged with the built-in specification, potentially\n * overwriting existing 'value' or 'update' properties.\n */\nfunction collectSignals(spec, config) {\n const _ = name => value(spec[name], config[name]),\n signals = [signalObject('background', _('background')), signalObject('autosize', parseAutosize(_('autosize'))), signalObject('padding', parsePadding(_('padding'))), signalObject('width', _('width') || 0), signalObject('height', _('height') || 0)],\n pre = signals.reduce((p, s) => (p[s.name] = s, p), {}),\n map = {};\n\n // add spec signal array\n array(spec.signals).forEach(s => {\n if (hasOwnProperty(pre, s.name)) {\n // merge if built-in signal\n s = extend(pre[s.name], s);\n } else {\n // otherwise add to signal list\n signals.push(s);\n }\n map[s.name] = s;\n });\n\n // add config signal array\n array(config.signals).forEach(s => {\n if (!hasOwnProperty(map, s.name) && !hasOwnProperty(pre, s.name)) {\n // add to signal list if not already defined\n signals.push(s);\n }\n });\n return signals;\n}\n\nfunction Scope(config, options) {\n this.config = config || {};\n this.options = options || {};\n this.bindings = [];\n this.field = {};\n this.signals = {};\n this.lambdas = {};\n this.scales = {};\n this.events = {};\n this.data = {};\n this.streams = [];\n this.updates = [];\n this.operators = [];\n this.eventConfig = null;\n this.locale = null;\n this._id = 0;\n this._subid = 0;\n this._nextsub = [0];\n this._parent = [];\n this._encode = [];\n this._lookup = [];\n this._markpath = [];\n}\nfunction Subscope(scope) {\n this.config = scope.config;\n this.options = scope.options;\n this.legends = scope.legends;\n this.field = Object.create(scope.field);\n this.signals = Object.create(scope.signals);\n this.lambdas = Object.create(scope.lambdas);\n this.scales = Object.create(scope.scales);\n this.events = Object.create(scope.events);\n this.data = Object.create(scope.data);\n this.streams = [];\n this.updates = [];\n this.operators = [];\n this._id = 0;\n this._subid = ++scope._nextsub[0];\n this._nextsub = scope._nextsub;\n this._parent = scope._parent.slice();\n this._encode = scope._encode.slice();\n this._lookup = scope._lookup.slice();\n this._markpath = scope._markpath;\n}\nScope.prototype = Subscope.prototype = {\n parse(spec) {\n return parseScope(spec, this);\n },\n fork() {\n return new Subscope(this);\n },\n isSubscope() {\n return this._subid > 0;\n },\n toRuntime() {\n this.finish();\n return {\n description: this.description,\n operators: this.operators,\n streams: this.streams,\n updates: this.updates,\n bindings: this.bindings,\n eventConfig: this.eventConfig,\n locale: this.locale\n };\n },\n id() {\n return (this._subid ? this._subid + ':' : 0) + this._id++;\n },\n add(op) {\n this.operators.push(op);\n op.id = this.id();\n // if pre-registration references exist, resolve them now\n if (op.refs) {\n op.refs.forEach(ref => {\n ref.$ref = op.id;\n });\n op.refs = null;\n }\n return op;\n },\n proxy(op) {\n const vref = op instanceof Entry ? ref(op) : op;\n return this.add(Proxy({\n value: vref\n }));\n },\n addStream(stream) {\n this.streams.push(stream);\n stream.id = this.id();\n return stream;\n },\n addUpdate(update) {\n this.updates.push(update);\n return update;\n },\n // Apply metadata\n finish() {\n let name, ds;\n\n // annotate root\n if (this.root) this.root.root = true;\n\n // annotate signals\n for (name in this.signals) {\n this.signals[name].signal = name;\n }\n\n // annotate scales\n for (name in this.scales) {\n this.scales[name].scale = name;\n }\n\n // annotate data sets\n function annotate(op, name, type) {\n let data, list;\n if (op) {\n data = op.data || (op.data = {});\n list = data[name] || (data[name] = []);\n list.push(type);\n }\n }\n for (name in this.data) {\n ds = this.data[name];\n annotate(ds.input, name, 'input');\n annotate(ds.output, name, 'output');\n annotate(ds.values, name, 'values');\n for (const field in ds.index) {\n annotate(ds.index[field], name, 'index:' + field);\n }\n }\n return this;\n },\n // ----\n\n pushState(encode, parent, lookup) {\n this._encode.push(ref(this.add(Sieve({\n pulse: encode\n }))));\n this._parent.push(parent);\n this._lookup.push(lookup ? ref(this.proxy(lookup)) : null);\n this._markpath.push(-1);\n },\n popState() {\n this._encode.pop();\n this._parent.pop();\n this._lookup.pop();\n this._markpath.pop();\n },\n parent() {\n return peek(this._parent);\n },\n encode() {\n return peek(this._encode);\n },\n lookup() {\n return peek(this._lookup);\n },\n markpath() {\n const p = this._markpath;\n return ++p[p.length - 1];\n },\n // ----\n\n fieldRef(field, name) {\n if (isString(field)) return fieldRef$1(field, name);\n if (!field.signal) {\n error('Unsupported field reference: ' + stringValue(field));\n }\n const s = field.signal;\n let f = this.field[s];\n if (!f) {\n const params = {\n name: this.signalRef(s)\n };\n if (name) params.as = name;\n this.field[s] = f = ref(this.add(Field(params)));\n }\n return f;\n },\n compareRef(cmp) {\n let signal = false;\n const check = _ => isSignal(_) ? (signal = true, this.signalRef(_.signal)) : isExpr$1(_) ? (signal = true, this.exprRef(_.expr)) : _;\n const fields = array(cmp.field).map(check),\n orders = array(cmp.order).map(check);\n return signal ? ref(this.add(Compare({\n fields: fields,\n orders: orders\n }))) : compareRef(fields, orders);\n },\n keyRef(fields, flat) {\n let signal = false;\n const check = _ => isSignal(_) ? (signal = true, ref(sig[_.signal])) : _;\n const sig = this.signals;\n fields = array(fields).map(check);\n return signal ? ref(this.add(Key({\n fields: fields,\n flat: flat\n }))) : keyRef(fields, flat);\n },\n sortRef(sort) {\n if (!sort) return sort;\n\n // including id ensures stable sorting\n const a = aggrField(sort.op, sort.field),\n o = sort.order || Ascending;\n return o.signal ? ref(this.add(Compare({\n fields: a,\n orders: this.signalRef(o.signal)\n }))) : compareRef(a, o);\n },\n // ----\n\n event(source, type) {\n const key = source + ':' + type;\n if (!this.events[key]) {\n const id = this.id();\n this.streams.push({\n id: id,\n source: source,\n type: type\n });\n this.events[key] = id;\n }\n return this.events[key];\n },\n // ----\n\n hasOwnSignal(name) {\n return hasOwnProperty(this.signals, name);\n },\n addSignal(name, value) {\n if (this.hasOwnSignal(name)) {\n error('Duplicate signal name: ' + stringValue(name));\n }\n const op = value instanceof Entry ? value : this.add(operator(value));\n return this.signals[name] = op;\n },\n getSignal(name) {\n if (!this.signals[name]) {\n error('Unrecognized signal name: ' + stringValue(name));\n }\n return this.signals[name];\n },\n signalRef(s) {\n if (this.signals[s]) {\n return ref(this.signals[s]);\n } else if (!hasOwnProperty(this.lambdas, s)) {\n this.lambdas[s] = this.add(operator(null));\n }\n return ref(this.lambdas[s]);\n },\n parseLambdas() {\n const code = Object.keys(this.lambdas);\n for (let i = 0, n = code.length; i < n; ++i) {\n const s = code[i],\n e = parseExpression(s, this),\n op = this.lambdas[s];\n op.params = e.$params;\n op.update = e.$expr;\n }\n },\n property(spec) {\n return spec && spec.signal ? this.signalRef(spec.signal) : spec;\n },\n objectProperty(spec) {\n return !spec || !isObject(spec) ? spec : this.signalRef(spec.signal || propertyLambda(spec));\n },\n exprRef(code, name) {\n const params = {\n expr: parseExpression(code, this)\n };\n if (name) params.expr.$name = name;\n return ref(this.add(Expression(params)));\n },\n addBinding(name, bind) {\n if (!this.bindings) {\n error('Nested signals do not support binding: ' + stringValue(name));\n }\n this.bindings.push(extend({\n signal: name\n }, bind));\n },\n // ----\n\n addScaleProj(name, transform) {\n if (hasOwnProperty(this.scales, name)) {\n error('Duplicate scale or projection name: ' + stringValue(name));\n }\n this.scales[name] = this.add(transform);\n },\n addScale(name, params) {\n this.addScaleProj(name, Scale(params));\n },\n addProjection(name, params) {\n this.addScaleProj(name, Projection(params));\n },\n getScale(name) {\n if (!this.scales[name]) {\n error('Unrecognized scale name: ' + stringValue(name));\n }\n return this.scales[name];\n },\n scaleRef(name) {\n return ref(this.getScale(name));\n },\n scaleType(name) {\n return this.getScale(name).params.type;\n },\n projectionRef(name) {\n return this.scaleRef(name);\n },\n projectionType(name) {\n return this.scaleType(name);\n },\n // ----\n\n addData(name, dataScope) {\n if (hasOwnProperty(this.data, name)) {\n error('Duplicate data set name: ' + stringValue(name));\n }\n return this.data[name] = dataScope;\n },\n getData(name) {\n if (!this.data[name]) {\n error('Undefined data set name: ' + stringValue(name));\n }\n return this.data[name];\n },\n addDataPipeline(name, entries) {\n if (hasOwnProperty(this.data, name)) {\n error('Duplicate data set name: ' + stringValue(name));\n }\n return this.addData(name, DataScope.fromEntries(this, entries));\n }\n};\nfunction propertyLambda(spec) {\n return (isArray(spec) ? arrayLambda : objectLambda)(spec);\n}\nfunction arrayLambda(array) {\n const n = array.length;\n let code = '[';\n for (let i = 0; i < n; ++i) {\n const value = array[i];\n code += (i > 0 ? ',' : '') + (isObject(value) ? value.signal || propertyLambda(value) : stringValue(value));\n }\n return code + ']';\n}\nfunction objectLambda(obj) {\n let code = '{',\n i = 0,\n key,\n value;\n for (key in obj) {\n value = obj[key];\n code += (++i > 1 ? ',' : '') + stringValue(key) + ':' + (isObject(value) ? value.signal || propertyLambda(value) : stringValue(value));\n }\n return code + '}';\n}\n\n/**\n * Standard configuration defaults for Vega specification parsing.\n * Users can provide their own (sub-)set of these default values\n * by passing in a config object to the top-level parse method.\n */\nfunction defaults () {\n const defaultFont = 'sans-serif',\n defaultSymbolSize = 30,\n defaultStrokeWidth = 2,\n defaultColor = '#4c78a8',\n black = '#000',\n gray = '#888',\n lightGray = '#ddd';\n return {\n // default visualization description\n description: 'Vega visualization',\n // default padding around visualization\n padding: 0,\n // default for automatic sizing; options: 'none', 'pad', 'fit'\n // or provide an object (e.g., {'type': 'pad', 'resize': true})\n autosize: 'pad',\n // default view background color\n // covers the entire view component\n background: null,\n // default event handling configuration\n // preventDefault for view-sourced event types except 'wheel'\n events: {\n defaults: {\n allow: ['wheel']\n }\n },\n // defaults for top-level group marks\n // accepts mark properties (fill, stroke, etc)\n // covers the data rectangle within group width/height\n group: null,\n // defaults for basic mark types\n // each subset accepts mark properties (fill, stroke, etc)\n mark: null,\n arc: {\n fill: defaultColor\n },\n area: {\n fill: defaultColor\n },\n image: null,\n line: {\n stroke: defaultColor,\n strokeWidth: defaultStrokeWidth\n },\n path: {\n stroke: defaultColor\n },\n rect: {\n fill: defaultColor\n },\n rule: {\n stroke: black\n },\n shape: {\n stroke: defaultColor\n },\n symbol: {\n fill: defaultColor,\n size: 64\n },\n text: {\n fill: black,\n font: defaultFont,\n fontSize: 11\n },\n trail: {\n fill: defaultColor,\n size: defaultStrokeWidth\n },\n // style definitions\n style: {\n // axis & legend labels\n 'guide-label': {\n fill: black,\n font: defaultFont,\n fontSize: 10\n },\n // axis & legend titles\n 'guide-title': {\n fill: black,\n font: defaultFont,\n fontSize: 11,\n fontWeight: 'bold'\n },\n // headers, including chart title\n 'group-title': {\n fill: black,\n font: defaultFont,\n fontSize: 13,\n fontWeight: 'bold'\n },\n // chart subtitle\n 'group-subtitle': {\n fill: black,\n font: defaultFont,\n fontSize: 12\n },\n // defaults for styled point marks in Vega-Lite\n point: {\n size: defaultSymbolSize,\n strokeWidth: defaultStrokeWidth,\n shape: 'circle'\n },\n circle: {\n size: defaultSymbolSize,\n strokeWidth: defaultStrokeWidth\n },\n square: {\n size: defaultSymbolSize,\n strokeWidth: defaultStrokeWidth,\n shape: 'square'\n },\n // defaults for styled group marks in Vega-Lite\n cell: {\n fill: 'transparent',\n stroke: lightGray\n },\n view: {\n fill: 'transparent'\n }\n },\n // defaults for title\n title: {\n orient: 'top',\n anchor: 'middle',\n offset: 4,\n subtitlePadding: 3\n },\n // defaults for axes\n axis: {\n minExtent: 0,\n maxExtent: 200,\n bandPosition: 0.5,\n domain: true,\n domainWidth: 1,\n domainColor: gray,\n grid: false,\n gridWidth: 1,\n gridColor: lightGray,\n labels: true,\n labelAngle: 0,\n labelLimit: 180,\n labelOffset: 0,\n labelPadding: 2,\n ticks: true,\n tickColor: gray,\n tickOffset: 0,\n tickRound: true,\n tickSize: 5,\n tickWidth: 1,\n titlePadding: 4\n },\n // correction for centering bias\n axisBand: {\n tickOffset: -0.5\n },\n // defaults for cartographic projection\n projection: {\n type: 'mercator'\n },\n // defaults for legends\n legend: {\n orient: 'right',\n padding: 0,\n gridAlign: 'each',\n columnPadding: 10,\n rowPadding: 2,\n symbolDirection: 'vertical',\n gradientDirection: 'vertical',\n gradientLength: 200,\n gradientThickness: 16,\n gradientStrokeColor: lightGray,\n gradientStrokeWidth: 0,\n gradientLabelOffset: 2,\n labelAlign: 'left',\n labelBaseline: 'middle',\n labelLimit: 160,\n labelOffset: 4,\n labelOverlap: true,\n symbolLimit: 30,\n symbolType: 'circle',\n symbolSize: 100,\n symbolOffset: 0,\n symbolStrokeWidth: 1.5,\n symbolBaseFillColor: 'transparent',\n symbolBaseStrokeColor: gray,\n titleLimit: 180,\n titleOrient: 'top',\n titlePadding: 5,\n layout: {\n offset: 18,\n direction: 'horizontal',\n left: {\n direction: 'vertical'\n },\n right: {\n direction: 'vertical'\n }\n }\n },\n // defaults for scale ranges\n range: {\n category: {\n scheme: 'tableau10'\n },\n ordinal: {\n scheme: 'blues'\n },\n heatmap: {\n scheme: 'yellowgreenblue'\n },\n ramp: {\n scheme: 'blues'\n },\n diverging: {\n scheme: 'blueorange',\n extent: [1, 0]\n },\n symbol: ['circle', 'square', 'triangle-up', 'cross', 'diamond', 'triangle-right', 'triangle-down', 'triangle-left']\n }\n };\n}\n\nfunction parse (spec, config, options) {\n if (!isObject(spec)) {\n error('Input Vega specification must be an object.');\n }\n config = mergeConfig(defaults(), config, spec.config);\n return parseView(spec, new Scope(config, options)).toRuntime();\n}\n\nexport { AxisDomainRole, AxisGridRole, AxisLabelRole, AxisRole, AxisTickRole, AxisTitleRole, DataScope, FrameRole, LegendEntryRole, LegendLabelRole, LegendRole, LegendSymbolRole, LegendTitleRole, MarkRole, Scope, ScopeRole, defaults as config, parse, parseSignal as signal, parseSignalUpdates as signalUpdates, parseStream as stream };\n","import { extend } from 'vega-util';\nexport * from 'vega-util';\nimport { transforms } from 'vega-dataflow';\nexport { Dataflow, EventStream, MultiPulse, Operator, Parameters, Pulse, Transform, changeset, definition, ingest, isTuple, transform, transforms, tupleid } from 'vega-dataflow';\nimport * as tx from 'vega-transforms';\nimport * as vtx from 'vega-view-transforms';\nimport * as encode from 'vega-encode';\nimport * as geo from 'vega-geo';\nimport * as force from 'vega-force';\nimport * as tree from 'vega-hierarchy';\nimport * as label from 'vega-label';\nimport * as reg from 'vega-regression';\nimport * as voronoi from 'vega-voronoi';\nimport * as wordcloud from 'vega-wordcloud';\nimport * as xf from 'vega-crossfilter';\nexport * from 'vega-statistics';\nexport * from 'vega-time';\nexport * from 'vega-loader';\nexport * from 'vega-scenegraph';\nexport { interpolate, interpolateColors, interpolateRange, quantizeInterpolator, scale, scheme } from 'vega-scale';\nexport { projection } from 'vega-projection';\nexport { View } from 'vega-view';\nexport { defaultLocale, numberFormatDefaultLocale as formatLocale, locale, resetDefaultLocale, timeFormatDefaultLocale as timeFormatLocale } from 'vega-format';\nexport { expressionFunction } from 'vega-functions';\nexport { parse } from 'vega-parser';\nexport { context as runtimeContext } from 'vega-runtime';\nexport { codegenExpression, parseExpression } from 'vega-expression';\nexport { parseSelector } from 'vega-event-selector';\n\nvar version = \"5.30.0\";\n\n// -- Transforms -----\n\nextend(transforms, tx, vtx, encode, geo, force, label, tree, reg, voronoi, wordcloud, xf);\n\nexport { version };\n","module.exports = __WEBPACK_EXTERNAL_MODULE__55__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(156);\n"],"names":["clone","_instanceof","obj","type","nativeMap","nativeSet","nativePromise","Map","_","Set","Promise","parent","circular","depth","prototype","includeNonEnumerable","allParents","allChildren","useBuffer","Buffer","Infinity","_clone","child","proto","resolve","reject","then","value","err","__isArray","__isRegExp","RegExp","source","__getRegExpFlags","lastIndex","__isDate","Date","getTime","isBuffer","allocUnsafe","length","copy","Error","Object","create","getPrototypeOf","index","indexOf","push","i","forEach","key","keyChild","valueChild","set","entryChild","add","attrs","getOwnPropertyDescriptor","getOwnPropertySymbols","symbols","symbol","descriptor","enumerable","defineProperty","allPropertyNames","getOwnPropertyNames","propertyName","__objToStr","o","toString","call","re","flags","global","ignoreCase","multiline","clonePrototype","c","module","exports","createThunk","Procedure","this","argTypes","shimArgs","arrayArgs","arrayBlockIndices","scalarArgs","offsetArgs","offsetArgIndex","indexArgs","shapeArgs","funcName","pre","body","post","debug","user_args","proc","proc_args","args","slice","arg_type","blockIndices","count","lvalue","offset","array","printCode","blockSize","uniq","innerFill","order","j","dimension","nargs","has_index","code","vars","idx","pidx","join","processBlock","block","dtypes","carg","name","ptrStr","arrNum","offArgIndex","localStr","arrStr","replace","reStrArr","ptrStrArr","Math","abs","trim","typeSummary","summary","Array","allEqual","t","digits","match","charAt","typesig","orders","blockBegin","blockEnd","loopBegin","loopEnd","loopOrders","newOrder","arglist","zeros","off_arg","init_string","thisVars","concat","matched","countMatches","indexStr","outerFill","console","log","loopName","Function","f","compile","thunkName","string_typesig","max","shapeLengthConditions","shapeConditions","thunk","bind","undefined","esprima","PREFIX_COUNTER","CompiledArgument","rvalue","CompiledRoutine","localVars","func","src","ast","parse","range","prefix","argNames","params","expression","callee","names","getArgNames","compiledArgs","exploded","n","node","rewrite","nstr","lo","hi","visit","computed","object","property","argNo","usage","left","operator","LVALUE","getUsage","identifier","window","g","self","isGlobal","id","createLocal","keys","REQUIRED_FIELDS","OPTIONAL_FIELDS","warn","dupe_array","result","dupe_number","Token","TokenName","FnExprTokens","Syntax","PropertyKind","Messages","Regex","SyntaxTreeDelegate","strict","lineNumber","lineStart","delegate","lookahead","state","extra","assert","condition","message","isDecimalDigit","ch","isHexDigit","isOctalDigit","isWhiteSpace","isLineTerminator","isIdentifierStart","NonAsciiIdentifierStart","test","String","fromCharCode","isIdentifierPart","NonAsciiIdentifierPart","isStrictModeReservedWord","isRestrictedWord","isKeyword","addComment","start","end","loc","comment","lastCommentStart","comments","attachComment","leadingComments","trailingComments","skipSingleLineComment","line","column","charCodeAt","skipMultiLineComment","throwError","UnexpectedToken","skipComment","scanHexEscape","len","toLowerCase","getEscapedIdentifier","substr","getIdentifier","scanPunctuator","code2","ch2","ch3","ch4","ch1","tokenize","openParenToken","tokens","openCurlyToken","Punctuator","scanNumericLiteral","number","NumericLiteral","parseInt","scanHexLiteral","isImplicitOctalLiteral","octal","scanOctalLiteral","parseFloat","scanRegExp","str","classMarker","terminated","UnterminatedRegExp","literal","scanRegExpBody","restore","throwErrorTolerant","scanRegExpFlags","pattern","e","InvalidRegExp","testRegExp","RegularExpression","collectRegex","pos","regex","token","pop","advance","EOF","Identifier","Keyword","NullLiteral","BooleanLiteral","quote","unescaped","startLineNumber","startLineStart","StringLiteral","scanStringLiteral","prevToken","checkToken","advanceSlash","collectToken","lex","peek","Position","SourceLocation","startLine","startColumn","peekLineTerminator","found","messageFormat","error","arguments","msg","whole","description","apply","errors","throwUnexpected","UnexpectedEOS","UnexpectedNumber","UnexpectedString","UnexpectedIdentifier","isFutureReservedWord","UnexpectedReserved","StrictReservedWord","expect","expectKeyword","keyword","matchKeyword","consumeSemicolon","oldIndex","oldLineNumber","oldLineStart","oldLookahead","isLeftHandSide","expr","MemberExpression","parsePropertyFunction","param","first","previousStrict","startToken","parseFunctionSourceElements","StrictParamName","markEnd","createFunctionExpression","parseObjectPropertyKey","StrictOctalLiteral","createLiteral","createIdentifier","parseObjectProperty","parseAssignmentExpression","createProperty","parseVariableIdentifier","parsePrimaryExpression","parseExpression","parseGroupExpression","elements","createArrayExpression","parseArrayInitialiser","kind","properties","map","Data","Get","hasOwnProperty","StrictDuplicateProperty","AccessorDataProperty","AccessorGetSet","createObjectExpression","parseObjectInitialiser","stricted","firstRestricted","tmp","StrictFunctionName","parseParams","parseFunctionExpression","createThisExpression","parseArguments","parseNonComputedProperty","isIdentifierName","parseNonComputedMember","parseComputedMember","parseNewExpression","allowIn","createMemberExpression","parseLeftHandSideExpression","createNewExpression","parsePostfixExpression","previousAllowIn","createCallExpression","parseLeftHandSideExpressionAllowCall","StrictLHSPostfix","InvalidLHSInAssignment","createPostfixExpression","parseUnaryExpression","StrictLHSPrefix","createUnaryExpression","argument","StrictDelete","binaryPrecedence","prec","parseConditionalExpression","consequent","alternate","marker","markers","stack","right","createBinaryExpression","parseBinaryExpression","createConditionalExpression","op","StrictLHSAssignment","createAssignmentExpression","createSequenceExpression","expressions","parseBlock","statement","list","parseSourceElement","parseStatementList","createBlockStatement","parseVariableDeclaration","init","StrictVarName","createVariableDeclarator","parseVariableDeclarationList","parseForStatement","update","oldInIteration","declarations","createVariableDeclaration","InvalidLHSInForIn","inIteration","parseStatement","createForStatement","createForInStatement","parseSwitchCase","createSwitchCase","parseTryStatement","handlers","finalizer","StrictCatchVariable","createCatchClause","NoCatchOrFinally","createTryStatement","labeledBody","createEmptyStatement","createExpressionStatement","parseExpressionStatement","label","inSwitch","IllegalBreak","createBreakStatement","labelSet","UnknownLabel","parseBreakStatement","IllegalContinue","createContinueStatement","parseContinueStatement","createDebuggerStatement","createDoWhileStatement","parseFunctionDeclaration","createIfStatement","parseIfStatement","inFunctionBody","IllegalReturn","createReturnStatement","discriminant","cases","clause","oldInSwitch","defaultFound","createSwitchStatement","MultipleDefaultsInSwitch","parseSwitchStatement","NewlineAfterThrow","createThrowStatement","parseThrowStatement","createWhileStatement","parseWhileStatement","StrictModeWith","createWithStatement","parseWithStatement","Redeclaration","createLabeledStatement","sourceElement","oldLabelSet","oldInFunctionBody","sourceElements","Literal","paramSet","StrictParamDupe","createFunctionDeclaration","parseProgram","parseSourceElements","createProgram","filterTokenLocation","entry","AssignmentExpression","ArrayExpression","BlockStatement","BinaryExpression","BreakStatement","CallExpression","CatchClause","ConditionalExpression","ContinueStatement","DoWhileStatement","DebuggerStatement","EmptyStatement","ExpressionStatement","ForStatement","ForInStatement","FunctionDeclaration","FunctionExpression","IfStatement","LabeledStatement","LogicalExpression","NewExpression","ObjectExpression","Program","Property","ReturnStatement","SequenceExpression","SwitchStatement","SwitchCase","ThisExpression","ThrowStatement","TryStatement","UnaryExpression","UpdateExpression","VariableDeclaration","VariableDeclarator","WhileStatement","WithStatement","processComment","lastChild","bottomRightStack","postProcess","each","defaults","rest","generator","raw","accessor","guardedHandlers","version","options","tolerant","lexError","program","types","freeze","equal","a","b","constructor","isArray","valueOf","data","opts","cmp","cycles","aobj","bobj","seen","stringify","toJSON","isFinite","JSON","out","TypeError","seenIndex","sort","splice","readFloatLE","isSlowBuffer","_isBuffer","decompress","pako","lz4","zlib","input","inflate","Uint8Array","buffer","rowProxy","table_serialization","EchoTableWidgetView","EchoTableWidgetModel","TableWidgetModel","widgets_1","get","serializers_1","compression_1","tableToJSON","JSONToTable","ndarray","dtypeToArray","int8","Int8Array","int16","Int16Array","int32","Int32Array","uint8","uint16","Uint16Array","uint32","Uint32Array","float32","Float32Array","float64","Float64Array","RowIndex","Symbol","manager","size","decoder","TextDecoder","col","val","entries","compression","valBuffer","dtype","u8buf","strcol","decode","lstr","shape","min","columns","widget","table","fields","arraycolumn","stringcolumn","v","isNaN","r","deserialize","serialize","__awaiter","thisArg","_arguments","P","fulfilled","step","next","rejected","done","base_1","ndarray_unpack","DOMWidgetModel","assign","_model_name","_view_name","_model_module","_view_module","_model_module_version","_view_module_version","_table","_columns","serializers","echo","unpack_models","DOMWidgetView","render","that","model","res","touch","xxhash","util","hashSize","blockBuf","makeBuffer","hashTable","makeHashTable","magicNum","bsUncompressed","bsMap","buf","sliceArray","arraySlice","compressBound","decompressBound","sIndex","readU32","useBlockSum","useContentSize","bsIdx","maxBlockSize","readU64","maxSize","decompressBlock","dst","sLength","dIndex","mLength","mOffset","sEnd","literalCount","compressBlock","mIndex","mAnchor","searchMatchCount","seq","hash","hashU32","decompressFrame","useContentSum","compSize","compressFrame","writeU32","bsDefault","remaining","clearHashTable","z","compress","x","imul","al","bl","prime1","prime2","prime3","prime5","rotl32","rotmul32","h","m","shiftxor32","s","xxhapply","m0","m1","xxh1","xxh4","xxh16","seed","l","dup","do_unpack","cwise","arr","iota","hasTypedArrays","compare1st","stride","terms","compileConstructor","className","useGetters","procedure","CACHED_CONSTRUCTORS","indices","index_str","shapeArg","strideArg","a_vars","c_vars","tShape","tStride","ctor","d","sz","arrayDType","ctor_list","Deflate","deflate","deflateRaw","gzip","Inflate","inflateRaw","ungzip","constants","zlib_deflate","utils","strings","ZStream","Z_NO_FLUSH","Z_SYNC_FLUSH","Z_FULL_FLUSH","Z_FINISH","Z_OK","Z_STREAM_END","Z_DEFAULT_COMPRESSION","Z_DEFAULT_STRATEGY","Z_DEFLATED","level","method","chunkSize","windowBits","memLevel","strategy","opt","ended","chunks","strm","avail_out","status","deflateInit2","header","deflateSetHeader","dictionary","dict","string2buf","deflateSetDictionary","_dict_set","deflator","flush_mode","_flush_mode","next_in","avail_in","output","next_out","onData","subarray","deflateEnd","onEnd","chunk","flattenChunks","zlib_inflate","GZheader","Z_NEED_DICT","Z_STREAM_ERROR","Z_DATA_ERROR","Z_MEM_ERROR","to","inflateInit2","inflateGetHeader","inflateSetDictionary","inflator","last_avail_out","wrap","inflateReset","next_out_utf8","utf8border","tail","utf8str","buf2string","inflateEnd","_has","sources","shift","p","STR_APPLY_UIA_OK","__","_utf8len","q","TextEncoder","encode","c2","m_pos","str_len","buf_len","utf16buf","c_len","buf2binstring","adler","s1","s2","Z_PARTIAL_FLUSH","Z_BLOCK","Z_TREES","Z_ERRNO","Z_BUF_ERROR","Z_NO_COMPRESSION","Z_BEST_SPEED","Z_BEST_COMPRESSION","Z_FILTERED","Z_HUFFMAN_ONLY","Z_RLE","Z_FIXED","Z_BINARY","Z_TEXT","Z_UNKNOWN","crcTable","k","makeTable","crc","_tr_init","_tr_stored_block","_tr_flush_block","_tr_tally","_tr_align","adler32","crc32","MAX_MATCH","MIN_LOOKAHEAD","INIT_STATE","BUSY_STATE","FINISH_STATE","errorCode","rank","zero","slide_hash","wsize","w_size","hash_size","head","prev","HASH","hash_shift","hash_mask","flush_pending","pending","pending_buf","pending_out","total_out","flush_block_only","last","block_start","strstart","put_byte","putShortMSB","read_buf","total_in","longest_match","cur_match","chain_length","max_chain_length","scan","best_len","prev_length","nice_match","limit","_win","wmask","w_mask","strend","scan_end1","scan_end","good_match","match_start","fill_window","_w_size","more","window_size","insert","ins_h","deflate_stored","flush","have","min_block","pending_buf_size","used","bi_valid","matches","high_water","deflate_fast","hash_head","bflush","match_length","max_lazy_match","MIN_MATCH","sym_next","deflate_slow","max_insert","prev_match","match_available","Config","good_length","max_lazy","nice_length","max_chain","configuration_table","DeflateState","gzhead","gzindex","last_flush","w_bits","hash_bits","dyn_ltree","HEAP_SIZE","dyn_dtree","bl_tree","l_desc","d_desc","bl_desc","bl_count","MAX_BITS","heap","heap_len","heap_max","sym_buf","lit_bufsize","sym_end","opt_len","static_len","bi_buf","deflateStateCheck","deflateResetKeep","data_type","deflateReset","ret","deflateInit","old_flush","level_flags","text","hcrc","time","os","beg","gzhead_extra","bstate","deflate_huff","deflate_rle","dictLength","tmpDict","avail","deflateInfo","xflags","extra_len","BAD","_in","_out","dmax","whave","wnext","s_window","hold","bits","lcode","dcode","lmask","dmask","here","dist","from","from_source","lencode","distcode","lenbits","distbits","top","dolen","mode","sane","inflate_fast","inflate_table","HEAD","DICT","TYPE","TYPEDO","COPY_","LEN_","LEN","CHECK","MEM","zswap32","InflateState","havedict","check","total","wbits","ncode","nlen","ndist","lens","work","lendyn","distdyn","back","was","inflateStateCheck","inflateResetKeep","inflateReset2","lenfix","distfix","virgin","fixedtables","sym","updatewindow","inflateInit","put","here_bits","here_op","here_val","last_bits","last_op","last_val","hbuf","inf_leave","dictid","inflateInfo","lbase","lext","dbase","dext","lens_index","codes","table_index","incr","fill","low","mask","root","curr","drop","huff","base","MAXBITS","offs","extra_lbits","extra_dbits","extra_blbits","bl_order","static_ltree","static_dtree","D_CODES","_dist_code","_length_code","base_length","base_dist","StaticTreeDesc","static_tree","extra_bits","extra_base","elems","max_length","has_stree","static_l_desc","static_d_desc","static_bl_desc","TreeDesc","dyn_tree","stat_desc","max_code","d_code","put_short","w","send_bits","send_code","tree","bi_reverse","gen_codes","next_code","init_block","LITERALS","END_BLOCK","bi_windup","smaller","_n2","_m2","pqdownheap","compress_block","ltree","dtree","lc","sx","build_tree","desc","stree","xbits","overflow","gen_bitlen","scan_tree","curlen","prevlen","nextlen","max_count","min_count","REP_3_6","REPZ_3_10","REPZ_11_138","send_tree","static_init_done","stored_len","LENGTH_CODES","L_CODES","tr_static_init","opt_lenb","static_lenb","max_blindex","block_mask","detect_data_type","BL_CODES","build_bl_tree","lcodes","dcodes","blcodes","send_all_trees","STATIC_TREES","bi_flush","selector","spec","output_area","imgIndex","outputs","item","metadata","imageIndex","jsIndex","javascriptIndex","el","document","getElementById","substring","loader","http","credentials","view","toImageURL","imageData","split","output_type","catch","showError","default","innerHTML","VegaWidgetModel","VegaWidget","pkg","MODULE_VERSION","MODULE_NAME","viewInstance","_spec_source","_opt_source","_df","_img_url","imgURL","mgr","viewElement","hasBeenUpdated","id_","crypto","randomUUID","canvas","querySelector","width","style","height","url","toDataURL","model_name","model_module","model_module_version","view_name","view_module","view_module_version","createElement","errorElement","appendChild","color","reembed","imgJson","imgElement","vegaEmbed","finalize","send","applyUpdate","resize","filter","remove","newValues","updateDataFrame","updateArray2D","changeSet","changeset","change","runAsync","applyUpdates","updates","on","ev","checkWidgetUpdate","textContent","proxy","rows","fancyCol","cols","row","compare","sorted","ptr","unique_pred","unique_eq","vegaImport","vegaLiteImport","_interopNamespaceDefault","extendStatics","vegaImport__namespace","vegaLiteImport__namespace","__extends","setPrototypeOf","__proto__","_hasOwnProperty","_objectKeys","keys_1","_deepClone","isInteger","charCode","escapePathComponent","path","unescapePathComponent","hasUndefined","i_1","objKeys","objKeysLength","patchErrorMessageFormatter","messageParts","PatchError","_super","operation","_newTarget","_this","JsonPatchError","deepClone","objOps","newDocument","removed","move","getValueByPointer","originalValue","applyOperation","valueToCopy","_areEquals","_get","arrOps","pointer","getOriginalDestination","validateOperation","mutateDocument","banPrototypeModifications","validator","returnValue","existingPathFragment","validateFunction","applyPatch","patch","results","length_1","pathLen","existingPathLen","validate","sequence","externalValidator","arrA","arrB","core","applyReducer","operationResult","beforeDict","WeakMap","Mirror","observers","ObserverInfo","callback","observer","generate","invertible","mirror","_generate","patches","temp","newKeys","oldKeys","deleted","oldVal","newVal","duplex","tree1","tree2","observe","getMirror","observerInfo","getObserverFromMirror","dirtyCheck","fastCheck","clearTimeout","setTimeout","addEventListener","unobserve","delete","removeObserverFromMirror","removeEventListener","getDefaultExportFromCjs","__esModule","stringOrChar","stringify$1","passedObj","indent","maxLength","replacer","_stringify","currentIndent","reserved","items","keyPart","nextIndent","prettified","string","stringLiteral","lrucache","firstKey","looseOption","loose","emptyOpts","parseOptions_1","re$1","MAX_LENGTH","MAX_SAFE_COMPONENT_LENGTH","MAX_SAFE_BUILD_LENGTH","MAX_LENGTH$1","MAX_SAFE_INTEGER","Number","RELEASE_TYPES","SEMVER_SPEC_VERSION","FLAG_INCLUDE_PRERELEASE","FLAG_LOOSE","debug_1","process","env","NODE_DEBUG","safeRe","R","LETTERDASHNUMBER","safeRegexReplacements","createToken","safe","makeSafeRegex","NUMERICIDENTIFIER","NUMERICIDENTIFIERLOOSE","NONNUMERICIDENTIFIER","PRERELEASEIDENTIFIER","PRERELEASEIDENTIFIERLOOSE","BUILDIDENTIFIER","MAINVERSION","PRERELEASE","BUILD","FULLPLAIN","MAINVERSIONLOOSE","PRERELEASELOOSE","LOOSEPLAIN","XRANGEIDENTIFIER","XRANGEIDENTIFIERLOOSE","GTLT","XRANGEPLAIN","XRANGEPLAINLOOSE","COERCEPLAIN","COERCE","COERCEFULL","LONETILDE","tildeTrimReplace","LONECARET","caretTrimReplace","comparatorTrimReplace","reExports","numeric","compareIdentifiers$1","anum","bnum","identifiers","compareIdentifiers","rcompareIdentifiers","parseOptions","semver","SemVer","includePrerelease","LOOSE","FULL","major","minor","prerelease","num","build","format","other","compareMain","comparePre","compareBuild","inc","release","identifierBase","compare$6","compare$5","compare$4","compare$3","compare$2","compare$1","comparator","hasRequiredComparator","hasRequiredRange","cmp_1","eq","neq","gt","gte","lt","lte","requireRange","Range","Comparator","parseRange","isNullSet","isAny","comps","memoKey","cached","cache","hr","HYPHENRANGELOOSE","HYPHENRANGE","hyphenReplace","COMPARATORTRIM","TILDETRIM","CARETTRIM","rangeList","comp","parseComparator","replaceGTE0","COMPARATORLOOSE","rangeMap","comparators","has","values","intersects","some","thisComparators","isSatisfiable","rangeComparators","every","thisComparator","rangeComparator","er","testSet","ANY","COMPARATOR","startsWith","includes","requireComparator","remainingComparators","testComparator","otherComparator","replaceCarets","replaceTildes","replaceXRanges","replaceStars","isX","replaceTilde","TILDELOOSE","TILDE","M","pr","replaceCaret","CARETLOOSE","CARET","replaceXRange","XRANGELOOSE","XRANGE","gtlt","xM","xm","xp","anyX","STAR","GTE0PRE","GTE0","incPr","$0","fM","fm","fp","fpr","fb","tM","tm","tp","tpr","allowed","satisfies$1","Constants","NaN","E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2","MIN_VALUE","MAX_VALUE","Ops","Unary","cast","Functions","acos","asin","atan","atan2","ceil","cos","exp","floor","pow","random","round","sin","sqrt","tan","clamp","now","utc","UTC","datetime","y","H","S","ms","date","getDate","day","getDay","year","getFullYear","month","getMonth","hours","getHours","minutes","getMinutes","seconds","getSeconds","milliseconds","getMilliseconds","timezoneoffset","getTimezoneOffset","utcdate","getUTCDate","utcday","getUTCDay","utcyear","getUTCFullYear","utcmonth","getUTCMonth","utchours","getUTCHours","utcminutes","getUTCMinutes","utcseconds","getUTCSeconds","utcmilliseconds","getUTCMilliseconds","indexof","lastindexof","reverse","upper","toUpperCase","lower","regexp","EventFunctions","DisallowedMethods","eval","setInterval","setImmediate","Visitors","$","memberDepth","datum","event","fn","reduce","interpret","vega","ctx","functions","parameter","handler","marktype","channels","swap","x2","xc","y2","yc","adjustSpatial","exec","library","lightColor","medColor","darkTheme","background","stroke","title","subtitleColor","axis","domainColor","gridColor","tickColor","markColor$7","excelTheme","arc","area","strokeWidth","rect","bandPosition","grid","gridOpacity","gridWidth","labelPadding","tickSize","tickWidth","axisBand","tickExtra","legend","labelBaseline","labelFontSize","symbolSize","symbolType","category","markColor$6","axisColor$2","backgroundColor$2","blackTitle","fiveThirtyEightTheme","labelColor","titleColor","titleFontSize","titlePadding","group","padding","diverging","heatmap","point","filled","bar","binSpacing","anchor","fontSize","fontWeight","markColor$5","ggplot2Theme","domain","titleFontWeight","labelFont$1","markColor$4","titleFont","colorSchemes$1","latimesTheme","font","labelFont","labelFontWeight","axisX","labelAngle","axisY","maxExtent","minExtent","titleAlign","titleAngle","titleX","titleY","ordinal","ramp","markColor$3","axisColor$1","quartzTheme","domainWidth","markColor$2","voxTheme","gridDash","markColor$1","axisColor","colorSchemes","urbanInstituteTheme","ticks","orient","trail","align","markColor","defaultFont$1","googlechartsTheme","circle","bottom","dy","ptToPx","fontSmallPx","legendFontPx","fontLargePx","fontStandard","fontTitle","firstLevelElementColor","secondLevelElementColor","backgroundColor","paletteColor1","divergentColorMin","divergentPalette","powerbiTheme","axisQuantitative","tickCount","labelFlush","strokeCap","strokeJoin","opacity","defaultFont","TOKENS","textPrimary","g90","g100","white","g10","textSecondary","layerAccent01","gridBg","darkCategories","lightCategories","genCarbonConfig","theme","viewbg","textColor","carbonwhite","carbong10","carbong90","carbong100","themes","dark","excel","fivethirtyeight","ggplot2","googlecharts","latimes","powerbi","quartz","urbaninstitute","vox","fname","get1","field","getN","splitAccessPath","isObject","maxDepth","EL_ID","DEFAULT_OPTIONS","offsetX","offsetY","styleId","disableDefaultStyle","sanitize","formatTooltip","valueToHtml","baseURL","content","image","URL","location","href","Handler","elementId","tooltipHandler","setAttribute","createDefaultStyle","childNodes","insertBefore","classList","fullscreenElement","tooltipBox","clientX","innerWidth","clientY","innerHeight","calculatePosition","getBoundingClientRect","embedStyle","mergeDeep","dest","deepMerge_","writeConfig","vegaLite","vl","DEFAULT_ACTIONS","export","svg","png","compiled","editor","I18N","CLICK_TO_VIEW_ACTIONS","COMPILED_ACTION","EDITOR_ACTION","PNG_ACTION","SOURCE_ACTION","SVG_ACTION","NAMES","VERSION","PREPROCESSOR","vgSpec","vlSpec","config","SVG_CIRCLES","CHART_WRAPPER_CLASS","viewSource","sourceHeader","sourceFooter","footer","win","open","write","isLoader","createLoader","async","embed","parsedSpec","isString","load","loadedEmbedOptions","usermeta","embedOptions","defaultStyle","embedOptionsFromUsermeta","usermetaLoader","usermetaOpts","loadOpts","parsedOpts","mergedOpts","mergeConfig","actions","isBoolean","i18n","renderer","logLevel","Warn","downloadFileName","element","ID","rootContainer","possibleRoot","getRootNode","ShadowRoot","getRoot","providedMode","$schema","parsed","guessMode","container","chartWrapper","formatLocale","timeFormatLocale","expressionFunctions","expressionFunction","runtime","viewClass","View","expressionInterpreter","addSignalListener","autosize","tooltip","loader_","documentClickHandler","hover","hoverSet","updateSet","initialize","wrapper","forceActionsMenu","details","append","contains","target","removeAttribute","ctrl","ext","i18nExportAction","exportLink","scaleFactor","download","preventDefault","viewSourceLink","compileLink","editorUrl","editorLink","origin","listen","evt","postMessage","_embed","div","HTMLElement","factory","getter","identity","log$1","isLegalKey","configs","signals","mergeNamed","layout","recurse","hop","isNumber","flat","configurable","writable","flatMap","isLogicalOr","or","isLogicalAnd","and","isLogicalNot","not","forEachLeaf","subop","normalizeLogicalComposition","normalizer","deepEqual","duplicate","pick","props","prop","omit","isNullOrFalse","unique","u","isEqual","dictKeys","otherKeys","setEqual","hasIntersection","prefixGenerator","prefixes","wrappedWithAccessors","computedPrefixes","fieldIntersection","isEmpty","vals","varName","alphanumericS","logicalExpr","cb","deleteNestedProperty","orderedProps","titleCase","accessPathWithDatum","pieces","flatAccessWithDatum","escapePathAccess","replacePathInField","replaceAll","find","replacement","removePathFromField","accessPathDepth","getFirstDefined","arg","idCounter","uniqueId","resetIdCounter","internalField","isInternalField","normalizeAngle","angle","isNumeric","CONDITIONAL_AXIS_PROP_INDEX","labelAlign","part","vgProp","labelFontStyle","labelOpacity","labelOffset","gridDashOffset","tickDash","tickDashOffset","tickOpacity","isConditionalAxisValue","AXIS_PARTS","AXIS_PROPERTY_TYPE","gridCap","gridScale","aria","domainCap","domainDash","domainDashOffset","domainOpacity","formatType","labelBound","labelFlushOffset","labelLimit","labelLineHeight","labelOverlap","labels","labelSeparation","position","tickCap","tickMinStep","tickOffset","tickRound","titleAnchor","titleBaseline","titleFontStyle","titleLimit","titleLineHeight","titleOpacity","scale","tickBand","translate","zindex","COMMON_AXIS_PROPERTIES_INDEX","AXIS_PROPERTIES_INDEX","labelExpr","encoding","isAxisProperty","AXIS_CONFIGS","axisBottom","axisDiscrete","axisLeft","axisPoint","axisRight","axisTemporal","axisTop","axisXBand","axisXDiscrete","axisXPoint","axisXQuantitative","axisXTemporal","axisYBand","axisYDiscrete","axisYPoint","axisYQuantitative","axisYTemporal","AGGREGATE_OP_INDEX","argmax","argmin","average","distinct","product","mean","median","missing","q1","q3","ci0","ci1","stderr","stdev","stdevp","sum","valid","variance","variancep","MULTIDOMAIN_SORT_OP_INDEX","isArgminDef","isArgmaxDef","isAggregateOp","COUNTING_OPS","isCountingAggregateOp","aggregate","SUM_OPS","SHARED_DOMAIN_OP_INDEX","__rest","propertyIsEnumerable","ROW","COLUMN","FACET","X","Y","X2","Y2","RADIUS","RADIUS2","THETA","THETA2","LATITUDE","LONGITUDE","LATITUDE2","LONGITUDE2","COLOR","FILL","STROKE","SHAPE","SIZE","ANGLE","OPACITY","FILLOPACITY","STROKEOPACITY","STROKEWIDTH","STROKEDASH","TEXT","ORDER","DETAIL","KEY","TOOLTIP","HREF","DESCRIPTION","POLAR_POSITION_CHANNEL_INDEX","theta","theta2","radius","radius2","isPolarPositionChannel","GEO_POSIITON_CHANNEL_INDEX","longitude","longitude2","latitude","latitude2","GEOPOSITION_CHANNELS","UNIT_CHANNEL_INDEX","fillOpacity","strokeOpacity","strokeDash","detail","isColorChannel","channel","FACET_CHANNEL_INDEX","facet","FACET_CHANNELS","CHANNEL_INDEX","CHANNELS","_o","_d","_tt1","SINGLE_DEF_CHANNEL_INDEX","_r","_c","_f","SINGLE_DEF_UNIT_CHANNEL_INDEX","isChannel","SECONDARY_RANGE_CHANNEL","isSecondaryRangeChannel","getMainRangeChannel","getVgPositionChannel","getSecondaryRangeChannel","getSizeChannel","_x","_y","_x2","_y2","_latitude","_longitude","_latitude2","_longitude2","_theta","_theta2","_radius","_radius2","NONPOSITION_CHANNEL_INDEX","NONPOSITION_CHANNELS","POSITION_SCALE_CHANNEL_INDEX","POSITION_SCALE_CHANNELS","isXorY","POLAR_POSITION_SCALE_CHANNEL_INDEX","POLAR_POSITION_SCALE_CHANNELS","getPositionScaleChannel","sizeType","_t","_tt","_hr","_u","_al","_dd","_k","_oo","NONPOSITION_SCALE_CHANNEL_INDEX","NONPOSITION_SCALE_CHANNELS","SCALE_CHANNEL_INDEX","SCALE_CHANNELS","isScaleChannel","ALL_MARKS","geoshape","rule","square","tick","_g","ALL_MARKS_EXCEPT_GEOSHAPE","rangeType","binToString","bin","normalizeBin","isSelectionExtent","isBinning","isBinParams","binned","isBinned","extent","autoMaxBins","invalidSpec","FIT_NON_SINGLE","containerSizeNonSingle","containerSizeNotCompatibleWithAutosize","droppingFit","unknownField","cannotProjectOnChannelWithoutField","cannotProjectAggregate","selectionNotSupported","mark","columnsNotSupportByRowCol","differentParse","local","ancestor","customFormatTypeNotAllowed","invalidFieldType","droppingColor","emptyFieldDef","fieldDef","incompatibleChannel","markOrFacet","when","facetChannelShouldBeDiscrete","discreteChannelCannotEncode","unaggregateDomainHasNoEffectForRawField","unaggregateDomainWithNonSharedDomainOp","unaggregatedDomainWithLogScale","scalePropertyNotWorkWithScaleType","scaleType","propName","stepDropped","MORE_THAN_ONE_SORT","invalidTimeUnit","unitName","errorBand1DNotSupport","channelRequiredForBinned","main","info","logger","current","isDateTime","TIMEUNIT_PARTS","MONTHS","SHORT_MONTHS","DAYS","SHORT_DAYS","dateTimeParts","normalize","parts","lowerM","monthIndex","shortM","shortMonthIndex","normalizeMonth","quarter","normalizeQuarter","lowerD","dayIndex","shortD","shortDayIndex","normalizeDay","timeUnit","unit","dateTimeToExpr","LOCAL_SINGLE_TIMEUNIT_INDEX","week","dayofyear","isUTCTimeUnit","VEGALITE_TIMEFORMAT","getTimeUnitParts","containsTimeUnit","fullTimeUnit","timeUnitSpecifierExpression","timeUnitParts","normalizeTimeUnit","isVgRangeStep","isDataRefDomain","VG_MARK_CONFIGS","ariaRole","ariaRoleDescription","blend","strokeDashOffset","strokeOffset","strokeMiterLimit","startAngle","endAngle","padAngle","innerRadius","outerRadius","interpolate","tension","baseline","dir","dx","ellipsis","fontStyle","lineBreak","lineHeight","cursor","cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","aspect","smooth","VG_MARK_INDEX","VG_CORNERRADIUS_CHANNELS","isFieldEqualPredicate","predicate","isFieldLTPredicate","isFieldLTEPredicate","isFieldGTPredicate","isFieldGTEPredicate","isFieldRangePredicate","isFieldOneOfPredicate","oneOf","in","isFieldPredicate","predicateValueExpr","valueExpr","wrapTime","fieldFilterExpression","useInRange","_a","fieldExpr","fieldRef","lastTimeUnit","dateExpr","dateTimeExprToExpr","vgField","predicateValuesExpr","isFieldValidPredicate","fieldValidPredicate","signal","exprs","normalizePredicate","Type","quantitative","temporal","nominal","geojson","QUANTITATIVE","ORDINAL","TEMPORAL","NOMINAL","GEOJSON","ScaleType","LINEAR","LOG","POW","SQRT","SYMLOG","IDENTITY","SEQUENTIAL","TIME","QUANTILE","QUANTIZE","THRESHOLD","BIN_ORDINAL","POINT","BAND","SCALE_CATEGORY_INDEX","linear","symlog","sequential","band","quantile","quantize","threshold","scaleCompatible","scaleType1","scaleType2","scaleCategory1","scaleCategory2","SCALE_PRECEDENCE_INDEX","scaleTypePrecedence","CONTINUOUS_TO_CONTINUOUS_SCALES","CONTINUOUS_TO_CONTINUOUS_INDEX","QUANTITATIVE_SCALES_INDEX","CONTINUOUS_TO_DISCRETE_INDEX","CONTINUOUS_DOMAIN_INDEX","DISCRETE_DOMAIN_INDEX","hasDiscreteDomain","hasContinuousDomain","isContinuousToContinuous","isContinuousToDiscrete","isSelectionDomain","SCALE_PROPERTY_INDEX","domainMax","domainMin","domainMid","rangeMax","rangeMin","scheme","bins","nice","exponent","constant","paddingInner","paddingOuter","NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTY_INDEX","NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES","scaleTypeSupportProperty","channelScalePropertyIncompatability","isExprRef","replaceExprRefInIndex","newIndex","signalRefOrValue","Mark","ARC","AREA","BAR","IMAGE","LINE","RECT","RULE","TICK","TRAIL","CIRCLE","SQUARE","GEOSHAPE","isPathMark","isRectBasedMark","PRIMITIVE_MARKS","isMarkDef","FILL_STROKE_CONFIG","VL_ONLY_MARK_CONFIG_PROPERTIES","invalid","timeUnitBand","timeUnitBandPosition","MARK_CONFIGS","BAR_CORNER_RADIUS_INDEX","horizontal","vertical","midPointRefWithPositionInvalidTest","channelDef","markDef","ref","midPoint","isFieldDef","wrapPositionInvalidTest","getMarkPropOrConfig","fieldInvalidTestValueRef","fieldInvalidPredicate","zeroValueRef","valueRefForFieldOrDatumDef","scaleName","isDatumDef","interpolatedSignalRef","fieldOrDatumDef","fieldOrDatumDef2","startSuffix","suffix","channel2Def","defaultRef","isFieldOrDatumDef","isTypedFieldDef","getBand","fieldDef2","isMidPoint","impute","binSuffix","binRequiresRange","isValueDef","offsetMixins","widthHeightValueOrSignalRef","signalOrValueRef","isCustomFormatType","customFormatExpr","BIN_RANGE_DELIMITER","formatSignalRef","normalizeStack","_b","formatCustomType","fieldToFormat","isFieldOrDatumDefForTimeFormat","rawTimeFormat","isUTCScale","formatExpression","timeFormatExpression","timeFormat","isScaleFieldDef","numberFormat","channelDefType","binFormatExpression","formatExpr","datumDef","datumDefToExpr","guideFormat","omitTimeFormatConfig","specifiedFormat","guideFormatType","binNumberFormatExpr","startField","endField","DEFAULT_SORT_OP","SORT_BY_CHANNEL_INDEX","isSortByChannel","isSortByEncoding","isSortField","isSortArray","isFacetMapping","isFacetFieldDef","isFacetSpec","toFieldDefBase","isSortableFieldDef","getMarkConfig","fieldChannel","hasBand","isConditionalDef","hasConditionalFieldDef","hasConditionalFieldOrDatumDef","isContinuousFieldOrDatumDef","cd","isContinuous","isNumericDataDef","isPositionFieldOrDatumDef","isMarkPropFieldOrDatumDef","isStringFieldOrDatumDef","toStringFieldDef","argAccessor","isCount","nofn","isOpFieldDef","tu","timeUnitToString","forAs","isDiscrete","def","defaultTitleFormatter","fieldTitle","timeUnitParams","maxbins","functionalTitleFormatter","countTitle","verbalTitleFormatter","titleFormatter","setTitleFormatter","formatter","allowDisabling","includeDefault","guideTitle","getGuide","defaultTitle","getFormatMixins","guide","getFieldDef","getFieldOrDatumDef","initChannelDef","initFieldOrDatumDef","fd","customFormatTypes","guideType","newGuide","initFieldDef","initDatumDef","compositeMark","fullType","getFullName","newType","defaultType","compatible","warning","COMPATIBLE","channelCompatibility","sub","labelOrient","titleOrient","undefinedIfExprNotRequired","isTime","isLocalSingleTimeUnit","valueArray","extractTitleConfig","titleConfig","frame","subtitleFont","subtitleFontSize","subtitleFontStyle","subtitleFontWeight","subtitleLineHeight","subtitlePadding","titleMarkConfig","nonMark","subtitle","subtitleMarkConfig","isText","signalOrValueRefWithCondition","conditionalSignalRefOrValue","exprFromValueOrSignalRef","signalOrStringValue","getStyles","vgChannel","ignoreVgConfig","getMarkStyleConfig","styleConfigIndex","getStyleConfig","styles","styleConfig","sortParams","orderDef","fieldRefOption","orderChannelDef","mergeTitleFieldDefs","f1","f2","merged","fdToMerge","fieldDef1","mergeTitle","title1","title2","mergeTitleComponent","v1","v2","v1Val","v2Val","explicit","isUnitSpec","CompositeMarkNormalizer","run","hasMatchingType","channelHasField","isAggregate","extractTransformsFromEncoding","oldEncoding","groupby","timeUnits","aggOp","isTitleDefined","newField","newFieldDef","aggregateEntry","as","secondaryChannel","isNonPositionScaleChannel","initEncoding","normalizedEncoding","markSupported","getSupportedMark","supportMark","primaryFieldDef","markChannelCompatible","defs","normalizeEncoding","newChannelDef","mapping","pathGroupingFields","getCompositeMarkTooltip","tooltipSummary","continuousAxisChannelDef","encodingWithoutContinuousAxis","withFieldName","fieldPrefix","titlePrefix","mainTitle","getTitle","escape","channelDefArray","fieldDefs","makeCompositeAggregatePartFactory","compositeMarkDef","continuousAxis","sharedEncoding","compositeMarkConfig","partName","positionPrefix","endPositionPrefix","extraEncoding","partLayerMixins","partBaseSpec","clip","compositeMarkContinuousAxis","continuousAxisChannelDef2","continuousAxisChannelDefError","continuousAxisChannelDefError2","filterAggregateFromChannelDef","continuousAxisWithoutAggregate","compositeMarkOrient","xAggregate","yAggregate","BOXPLOT","boxPlotNormalizer","normalizeBoxPlot","getBoxPlotType","_encoding","selection","projection","_p","outerSpec","boxplot","sizeValue","boxPlotType","transform","ticksOrient","boxOrient","customTooltipWithoutAggregatedField","continuousFieldName","boxplotSpecificAggregate","boxParamsQuartiles","postAggregateCalculates","calculate","oldEncodingWithoutContinuousAxis","filteredEncoding","customTooltipWithAggregatedField","filterTooltipWithAggregatedField","boxParams","encodingWithoutSizeColorAndContinuousAxis","makeBoxPlotPart","makeBoxPlotExtent","makeBoxPlotBox","makeBoxPlotMidTick","fiveSummaryTooltipEncoding","endTick","whiskerTooltipEncoding","whiskerLayers","boxLayers","layer","lowerBoxExpr","upperBoxExpr","iqrExpr","lowerWhiskerExpr","upperWhiskerExpr","joinaggregateTransform","joinaggregate","filteredWhiskerSpec","encodingWithoutSizeColorContinuousAxisAndTooltip","axisWithoutTitle","outlierLayersMixins","filteredLayersMixins","filteredLayersMixinsTransforms","unshift","continousAxisField","ERRORBAR","errorBarNormalizer","normalizeErrorBar","tooltipEncoding","errorBarParams","makeErrorBarPart","errorbar","thickness","inputType","xError","xError2","yError","yError2","errorBarIsInputTypeRaw","isTypeAggregatedUpperLower","errorBarIsInputTypeAggregatedUpperLower","isTypeAggregatedError","errorBarIsInputTypeAggregatedError","errorBarOrientAndInputType","errorBarSpecificAggregate","tooltipTitleWithFieldName","center","getTitlePrefix","centerOp","lowerExtentOp","upperExtentOp","postAggregateCalculate","errorBarAggregationAndCalculation","_e","oldAggregate","oldGroupBy","ERRORBAND","errorBandNormalizer","normalizeErrorBand","errorBandDef","makeErrorBandPart","errorband","is2D","bandMark","bordersMark","compositeMarkRegistry","VL_ONLY_LEGEND_CONFIG","HEADER_TITLE_PROPERTIES_MAP","HEADER_LABEL_PROPERTIES_MAP","labelAnchor","HEADER_TITLE_PROPERTIES","HEADER_LABEL_PROPERTIES","HEADER_CONFIGS","headerRow","headerColumn","headerFacet","LEGEND_SCALE_CHANNELS","COMMON_LEGEND_PROPERTY_INDEX","clipHeight","columnPadding","direction","fillColor","gradientLength","gradientOpacity","gradientStrokeColor","gradientStrokeWidth","gradientThickness","gridAlign","legendX","legendY","rowPadding","strokeColor","symbolDash","symbolDashOffset","symbolFillColor","symbolLimit","symbolOffset","symbolOpacity","symbolStrokeColor","symbolStrokeWidth","assembleParameterSignals","SELECTION_ID","defaultConfig","single","empty","clear","multi","toggle","interval","encodings","zoom","isLegendBinding","isLegendStreamBinding","isConcatSpec","isVConcatSpec","isHConcatSpec","isStep","isFrameMixins","COMPOSITION_LAYOUT_PROPERTIES","bounds","spacing","getViewConfigContinuousSize","viewConfig","getViewConfigDiscreteStep","getViewConfigDiscreteSize","DEFAULT_STEP","continuousWidth","continuousHeight","continuousBandSize","box","outliers","borders","pointPadding","barBandPaddingInner","rectBandPaddingInner","minBandSize","minFontSize","maxFontSize","minOpacity","maxOpacity","minSize","minStrokeWidth","maxStrokeWidth","quantileCount","quantizeCount","gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity","tab10","DEFAULT_FONT_SIZE","guideLabel","groupTitle","groupSubtitle","DEFAULT_COLOR","blue","orange","red","teal","green","yellow","purple","pink","brown","gray0","gray1","gray2","gray3","gray4","gray5","gray6","gray7","gray8","gray9","gray10","gray11","gray12","gray13","gray14","gray15","getAxisConfigInternal","axisConfig","axisConfigInternal","configPropsWithExpr","initConfig","specifiedConfig","restConfig","mergedConfig","fontConfig","cell","colorSignalConfig","fontSizeSignalConfig","outputConfig","markConfigType","axisConfigType","headerConfigType","styleConfigInternal","getStyleConfigInternal","MARK_STYLES","VL_ONLY_CONFIG_PROPERTIES","VL_ONLY_ALL_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX","redirectConfigToStyleConfig","toProp","compositeMarkPart","propConfig","isLayerSpec","SpecMapper","mapFacet","isRepeatSpec","mapRepeat","mapHConcat","mapVConcat","mapConcat","mapLayerOrUnit","mapLayer","mapUnit","subspec","hconcat","vconcat","STACK_OFFSET_INDEX","STACKABLE_MARKS","STACK_BY_DEFAULT_MARKS","potentialStackedChannel","xDef","yDef","xScale","yScale","stackedFieldDef","stackedField","dimensionChannel","getDimensionChannel","dimensionDef","dimensionField","stackBy","sc","cDef","disallowNonLinearStack","groupbyChannel","groupbyField","dropLineAndPoint","_point","_line","dropLineAndPointFromConfig","getPointOverlay","markConfig","getLineOverlay","PathOverlayNormalizer","pointOverlay","lineOverlay","stackProps","overlayEncoding","stackFieldChannel","RangeStepNormalizer","sizeMixins","defWithoutScale","rangeStep","scaleWithoutRangeStep","replaceRepeaterInFacet","repeater","replaceRepeaterInMapping","replaceRepeaterInFieldDef","replaceRepeaterInEncoding","replaceRepeatInProp","isRepeatRef","repeat","replaceRepeaterInFieldOrDatumDef","replaceRepeaterInChannelDef","RuleForRangedLineNormalizer","mainChannelDef","hasX2","hasY2","mergeEncoding","parentEncoding","parentChannelDef","mergedChannelDef","mergeProjection","parentProjection","normalizedSpec","normalizeGenericSpec","sizeInfo","isFitCompatible","autosizeDefault","_normalizeAutoSize","normalizeAutoSize","super","nonFacetUnitNormalizers","hasRow","hasColumn","hasFacet","mapFacetedUnit","specWithReplacedEncoding","mapUnitWithParentEncodingOrProjection","normalizeLayerOrUnit","unitNormalizer","isLayerRepeatSpec","mapLayerRepeat","mapNonLayerRepeat","childSpec","repeaterPrefix","layerValue","childRepeater","childName","remainingProperties","repeatValues","repeatValue","rowValue","columnValue","mergedProjection","mergedEncoding","facetMapping","getFacetMappingAndLayout","newEncoding","facets","defWithoutLayout","otherParams","TOP_LEVEL_PROPERTIES","extractTopLevelProperties","includeParams","Split","implicit","combine","getWithExplicit","setWithExplicit","copyKeyFromSplit","copyKeyFromObject","copyAll","makeExplicit","makeImplicit","tieBreakByComparing","propertyOf","diff","defaultTieBreaker","mergeValuesWithExplicit","tieBreaker","AncestorParse","parseNothing","isUrlData","isInlineData","isNamedData","isGenerator","isSequenceGenerator","isSphereGenerator","isGraticuleGenerator","DataSourceType","isFilter","isLookup","isPivot","isDensity","isQuantile","isRegression","isLoess","isSample","isWindow","isJoinAggregate","isFlatten","isCalculate","isBin","isImpute","isTimeUnit","isStack","isFold","LBRACK","RBRACK","LBRACE","RBRACE","COLON","COMMA","NAME","GT","ILLEGAL","DEFAULT_MARKS","DEFAULT_SOURCE","MARKS","eventSelector","marks","parseMerge","parseSelector","endChar","pushChar","popChar","stream","between","parseBetween","throttle","markname","lastIndexOf","parseThrottle","isMarkType","consume","debounce","parseStream","wrapCondition","refFn","valueRef","vgConditions","conditionValueRef","isConditionalSelection","parseSelectionPredicate","textRef","tooltipRefForEncoding","reactiveGeom","tooltipRefFromChannelDef","markTooltip","tooltipData","toSkip","tuples","fDef","mainChannel","channel2","keyValues","nonPosition","defaultValue","getScaleComponent","markType","transparentIfNeeded","defaultFill","defaultStroke","colorVgChannel","fillStrokeMarkDefAndConfig","getOffset","offsetChannel","getOffsetChannel","markDefOffsetValue","pointPosition","defaultPos","pointPositionDefaultRef","getName","positionRef","definedValueOrConfig","domainDefinitelyIncludesZero","sizeRef","mult","ALIGNED_X_CHANNEL","BASELINED_Y_CHANNEL","middle","vgAlignedPositionChannel","defaultAlign","alignChannel","alignExcludingSignal","pointOrRangePosition","defaultPos2","rangePosition","sizeChannel","pos2Mixins","baseChannel","position2Ref","position2orSize","pointPosition2OrSize","rectPosition","channelDef2","hasSizeDef","isBarBand","component","axes","axisTranslate","vgChannel2","rectBinRef","getBinSpacing","startRef","rectBinPosition","vgSizeChannel","useVlSizeChannel","sizeFromMarkOrConfig","defaultSizeRef","posRef","sizeOffset","positionAndSize","discreteBandSize","scaleRange","spacingOffset","reverseExpr","offsetExpr","translateExpr","ALWAYS_IGNORE","baseEncodeEntry","ignore","markDefProperties","wrapAllFieldsInvalid","enableAria","ariaRoleDesc","descriptionValue","filterIndex","aggregator","scaleComponent","allFieldsInvalidPredicate","defined","valueIfDefined","VORONOI","nearest","selCmpt","events","project","hasChannel","cellDef","interactive","isVoronoi","getSizeSignalRef","exists","DataFlowNode","debugName","_children","_parent","addChild","children","numChildren","removeChild","oldChild","insertAsParentOf","swapWithParent","newParent","OutputNode","refCounts","_source","_name","cloneObj","dependentFields","producedFields","_hash","getSource","isRequired","setSource","TimeUnitNode","formula","makeFromEncoding","reduceFieldDef","timeUnitComponent","isUnitModel","makeFromTransform","normalizedTimeUnit","merge","removeFormulas","newFormula","assemble","transforms","units","timezone","TUPLE_FIELDS","SelectionProjectionComponent","hasField","selDef","proj","signalName","sg","counter","cfg","parseInit","allSignals","hasLegend","origDef","topLevelSignals","sgname","assembleInit","TUPLE","TOGGLE","modifyExpr","tpl","findIndex","addClear","vIdx","visual","tIdx","scaleBindings","bound","scales","isTopLevelLayer","namedSg","VL_SELECTION_RESOLVE","isLayerModel","legendBindings","projLen","legendFilter","selName","markName","ds","sgName","force","tuple","ANCHOR","DELTA","hasScales","onDelta","delta","sizeSg","scaleCmpt","sy","compilers","inputs","forEachTransform","isExpr","assembled","dateTimeToTimestamp","assembleUnitSelectionMarks","forEachSelection","selCompiler","txCompiler","cleanupEmptyOnArray","BRUSH","SCALE_TRIGGER","fieldsSg","dataSignals","scaleTriggers","filterExpr","filters","cs","vname","dname","scaled","coord","channelSignals","toNum","xvname","yvname","store","STORE","vgStroke","enter","singleOrMultiSignals","selections","sel","facetModel","isFacetModel","getFacetModel","requiresSelectionId","ASTNode","visitor","TokenBooleanLiteral","TokenEOF","TokenIdentifier","TokenKeyword","TokenNullLiteral","TokenNumericLiteral","TokenPunctuator","TokenStringLiteral","SyntaxArrayExpression","SyntaxBinaryExpression","SyntaxCallExpression","SyntaxConditionalExpression","SyntaxIdentifier","SyntaxLiteral","SyntaxLogicalExpression","SyntaxMemberExpression","SyntaxObjectExpression","SyntaxProperty","SyntaxUnaryExpression","MessageUnexpectedToken","MessageUnexpectedNumber","MessageUnexpectedString","MessageUnexpectedIdentifier","MessageUnexpectedReserved","MessageUnexpectedEOS","MessageInvalidRegExp","MessageUnterminatedRegExp","MessageStrictOctalLiteral","MessageStrictDuplicateProperty","DISABLED","RegexNonAsciiIdentifierStart","RegexNonAsciiIdentifierPart","keywords","scanUnicodeCodePointEscape","cu1","cu2","finishBinaryExpression","finishCallExpression","finishIdentifier","finishLiteral","finishMemberExpression","member","finishProperty","legalKeywords","finishArrayExpression","finishObjectExpression","search","$1","exception","finishUnaryExpression","finishConditionalExpression","startsWithDatum","getDependentFields","dependents","FilterNode","_dependentFields","dfnode","stores","predicateStr","getSelectionComponent","tunode","parseSelectionBinExtent","filterOp","isSelectionPredicate","setAxisEncode","vgRef","assembleAxis","axisCmpt","disable","propType","propValue","valueOrSignalRef","conditions","propIndex","valueOrSignalCRef","signalRef","mainExtracted","hasAxisPart","titleString","assembleTitle","assembleAxisSignals","getAxisConfigFromConfigTypes","configTypes","configType","orient1","orientConfig1","orientConfig2","conditionalOrientAxisConfig","getAxisConfigStyle","axisConfigTypes","toMerge","getAxisConfig","axisConfigs","configFrom","configValue","axisRules","defaultGrid","gridChannel","defaultLabelAlign","defaultLabelBaseline","defaultLabelFlush","hasTimeUnit","defaultLabelOverlap","defaultTickCount","fieldDefTitle","getFieldDefTitle","typedFieldDef","defaultZindex","normalizeAngleExpr","alwaysIncludeMiddle","mainOrient","CalculateNode","parseAllForSortIndex","forEachFieldDef","sortValue","sortArrayIndexField","getHeaderChannel","getHeaderProperty","headerSpecificConfig","getHeaderProperties","HEADER_CHANNELS","HEADER_TYPES","assembleTitleGroup","layoutHeaders","facetFieldDef","ta","headerChannel","role","defaultHeaderGuideBaseline","defaultHeaderGuideAlign","assembleHeaderProperties","assembleHeaderGroups","layoutHeader","groups","headerType","headerComponent","assembleHeaderGroup","getSort","assembleLabelTitle","titleTextExpr","isFacetWithoutRowCol","hasAxes","sizeSignal","LAYOUT_TITLE_BAND","getLayoutTitleBand","propertiesMap","assembleLayoutSignals","sizeSignals","layoutSize","stepSignal","sizeExpr","isWidth","endsWith","safeExpr","cardinality","getSizeTypeFromLayoutSizeType","layoutSizeType","guideEncodeEntry","valueDef","defaultScaleResolve","isConcatModel","parseGuideResolve","channelScaleResolve","LEGEND_COMPONENT_PROPERTY_INDEX","LEGEND_COMPONENT_PROPERTIES","LegendComponent","legendEncodeRules","symbolsSpec","legendCmpt","legendType","_h","propsList","applyMarkConfig","getMaxValue","symbolBaseFillColor","getFirstConditionValue","selectedCondition","gradient","gradientSpec","specifiedlabelsSpec","labelsSpec","entriesSpec","getConditionValue","conditionalDef","reducer","hasConditionalValueDef","legendRules","legendConfig","gradientLengthSignal","defaultGradientLength","shapeChannelDef","markShape","defaultSymbolType","getDirection","defaultDirection","parseLegend","legendComponent","parseLegendForChannel","parseUnitLegend","legends","mergeLegendComponent","parseNonUnitLegend","isExplicit","getLegendDefWithScale","legendSelections","parseInteractiveLegend","getLegendType","ruleParams","legendEncoding","legendEncode","legendEncodeParams","legendEncodingPart","mergedLegend","childLegend","mergedOrient","childOrient","typeMerged","mergedValueWithExplicit","st1","st2","assembleLegends","legendComponentIndex","legendByDomain","domainHash","mergedLegendComponent","setLegendEncode","assembleLegend","assembleProjectionForModel","fits","lookupDataSource","fit","PROJECTION_PROPERTIES","ProjectionComponent","specifiedProjection","isFit","parseProjection","hasProjection","posssiblePair","requestDataName","Main","gatherFitData","projectionName","parseUnitProjection","nonUnitProjection","mergable","second","allPropertiesShared","mergeIfNoConflict","modelProjection","renameProjection","parseNonUnitProjections","binKey","getBinSignalName","createBinComponent","span","isBinTransform","normalizedBin","extentSignal","getSignalsFromModel","binComponent","BinNode","binComponentIndex","formulaAs","rangeFormula","renameSignal","binAs","remainingAs","binTrans","AggregateNode","dimensions","measures","groupBy","meas","dims","argField","scaleDomain","posChannel","getPositionChannelFromLatLong","addDimension","parentMeasures","childMeasures","ops","mergeMeasures","addDimensions","alias","FacetNode","sortField","sortIndexField","childModel","depFields","getChildIndependentFieldsWithStep","childIndependentFieldsWithStep","childScaleComponent","getFieldFromDomain","assembleDomain","assembleRowColumnHeaderData","crossedDataName","childChannel","assembleFacetHeaderData","hasSharedAxis","headers","stop","facetData","unquote","getImplicitFromFilterTransform","ParseNode","_parse","ancestorParse","makeWithAncestors","parsedAs","assembleFormatParse","formatParse","assembleTransforms","onlyNested","IdentifierNode","GraticuleNode","SequenceNode","SourceNode","_data","defaultExtension","_generator","hasName","dataName","_modified","receiver","privateMap","isDataSourceNode","Optimizer","setModified","modifiedFlag","BottomUpOptimizer","getNodeDepths","depths","optimize","topologicalSort","TopDownOptimizer","MergeIdenticalNodes","mergeNodes","nodes","mergedNode","hashes","buckets","RemoveUnnecessaryIdentifierNodes","RemoveDuplicateTimeUnits","timeUnitFields","RemoveUnnecessaryOutputNodes","MoveParseUp","MergeParse","originalChildren","parseChildren","commonParse","conflictingParse","parseNode","mergedParseNode","childNode","RemoveUnusedSubtrees","MergeTimeUnits","timeUnitChildren","combination","MergeAggregates","aggChildren","groupedAggregates","agg","groupBys","mergeableAggs","mergedAggs","MergeBins","moveBinsUp","promotableBins","remainingBins","promotedBin","remainingBin","MergeOutputs","otherChildren","mainOutput","lastOutput","theChild","JoinAggregateTransformNode","getDefaultName","joinAggregateFieldDef","StackNode","_stack","stackTransform","sortFields","sortOrder","normalizedAs","isValidAsArray","stackField","facetby","stackProperties","dimensionFieldDef","stackby","by","_field","getStackByFields","getGroupbyFields","WindowTransformNode","windowFieldDef","ignorePeers","moveFacetDown","facetMain","moveMainDownToFacet","cloner","newName","FACET_SCALE_PREFIX","outputNodes","MAX_OPTIMIZATION_RUNS","checkLinks","runOptimizer","optimizer","modified","optimizationDataflowHelper","dataComponent","firstPass","roots","SignalRefWrapper","exprGenerator","fromName","rename","parseScaleDomain","localScaleComponents","domains","parseDomainForChannel","parseSelectionDomain","isFaceted","facetParent","parseUnitScaleDomain","selectionExtent","childComponent","domainsTieBreaker","se","parseNonUnitScaleDomain","scaleConfig","reason","canUseUnaggregatedDomain","useUnaggregatedDomain","normalizeUnaggregatedDomain","specifiedScales","parseSingleChannelDomain","convertDomainIfItIsDateTime","mapDomainToDataSignal","isDomainUnionWith","defaultDomain","unionWith","stackDimensions","normalizeSortField","fieldDefToSortBy","isStackedMeasure","domainSort","Raw","binSignal","getSignalName","isDataRefUnionedDomain","nonUnionDomain","isFieldRefUnionDomain","uniqueDomains","_s","sorts","unionDomainSorts","allData","mergeDomains","assembleScales","assembleScalesForModel","otherScaleProps","assembleScaleRange","domainRaw","assembleSelectionScaleDomain","ScaleComponent","typeWithExplicit","RANGE_PROPERTIES","getBinStepSignal","updatedName","binCount","parseRangeForChannel","specifiedScale","supportedByScaleType","channelIncompatability","parseScheme","sizeRangeMin","xyStepSignals","maxBandSize","minXYStep","pointStep","MAX_SIZE_RANGE_STEP_RATIO","sizeRangeMax","rMax","rMin","interpolateRange","defaultContinuousToDiscreteCount","defaultRange","isExtendedScheme","widthStep","heightStep","parseScaleProperty","localScaleCmpt","mergedScaleCmpt","specifiedValue","scalePadding","scalePaddingInner","scaleRules","parseUnitScaleProperty","parseNonUnitScaleProperty","barConfig","continuousPadding","paddingValue","bandPaddingInner","paddingInnerValue","bandPaddingOuter","xReverse","specifiedDomain","parseScaleRange","rangeWithExplicit","parseUnitScaleRange","valueWithExplicit","parseScaleCore","scaleComponents","sType","defaultScaleType","channelSupportScaleType","specifiedType","fieldDefType","parseUnitScaleCore","scaleTypeWithExplicitIndex","explicitScaleType","childScaleType","scaleTypeTieBreaker","childScale","renameScale","parseNonUnitScaleCore","NameMap","nameMap","oldName","Model","parentGivenName","correctDataNames","initTitle","scaleNameMap","projectionNameMap","signalNameMap","specType","compositionConfig","spacingConfig","extractCompositionLayout","outputNodeRefCounts","titleInternal","parseScale","parseLayoutSize","renameTopLevelLayoutSizeSignal","parseSelections","parseData","parseAxesAndHeaders","parseLegends","parseMarkGroup","ignoreRange","parseScales","assembleGroupStyle","assembleEncodeFromView","baseView","assembleGroupEncodeEntry","isTopLevel","encodeEntry","assembleLayout","titleBand","headerComponentIndex","assembleLayoutTitleBand","assembleDefaultLayout","assembleHeaderMarks","headerMarks","assembleAxes","axisComponents","assembleProjections","projections","assembleProjectionsForModelAndChildren","titleNoEncoding","assembleGroup","assembleSignals","assembleMarks","getDataName","fullName","oldSignalName","originalScaleName","localScaleComponent","variableName","origName","hasAxisOrientSignalRef","hasOrientSignalRef","ModelWithField","r1","getMapping","acc","DensityTransformNode","specifiedAs","density","FilterInvalidNode","make","vegaFilters","FlattenTransformNode","flatten","FoldTransformNode","fold","GeoJSONNode","parseAll","geoJsonCounter","coordinates","pair","GeoPointNode","ImputeNode","processSequence","keyvals","imputeTransform","imputedChannel","keyChannel","groupbyFields","LoessTransformNode","loess","LookupNode","secondary","fromOutputNode","isLookupData","fromSource","findSource","fromOutputName","Lookup","isLookupSelection","materialized","lookup","foreign","asName","QuantileTransformNode","RegressionTransformNode","regression","PivotTransformNode","pivot","SampleTransformNode","sample","makeWalkTree","datasetIndex","walkTree","dataSource","parseFacetHeader","makeHeaderComponent","mergeChildAxis","axisComponent","mainAxis","parseChildrenLayoutSize","parseNonUnitLayoutSizeForChannel","layoutSizeCmpt","mergedSize","childSize","scaleResolve","defaultUnitSize","facetSortFieldName","FacetModel","buildModel","initFacet","initFacetFieldDef","normalizedFacet","parseFacetHeaders","assembleSelectionTopLevelSignals","assembleSelectionData","getHeaderLayoutMixins","layoutMixins","layoutHeaderComponent","bandType","columnDistinctSignal","getCardinalityAggregateForChild","assembleFacet","facetRoot","outputName","cross","facetSortFields","facetSortOrder","ORTHOGONAL_ORIENT","assembleFacetData","assembleFacetSignals","otherData","formatMesh","mesh","otherFeature","feature","formatFeature","otherMesh","_j","existingSource","parseRoot","graticule","parentIsLayer","lookupCounter","derivedType","transformNode","parseTransformArray","implicitSelection","getImplicitFromSelection","implicitEncoding","mainFieldDef","dimensionChannelDef","getImplicitFromEncoding","rawName","mainName","lookupName","materializeSelections","facetName","makeJoinAggregateFromFacet","ConcatModel","getChildren","widthType","heightType","parseConcatLayoutSize","parseAxisGroup","layoutSignals","db","AXIS_COMPONENT_PROPERTIES_INDEX","AXIS_COMPONENT_PROPERTIES","AxisComponent","OPPOSITE_ORIENT","mergeAxisComponents","mergedAxisCmpts","childAxisCmpts","mergeAxisComponent","propsToAlwaysIncludeConfig","parseAxis","defaultOrient","typeBasedConfigTypes","isQuantitative","axisChannel","axisOrient","vlOnlyConfigTypes","vgConfigTypes","vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle","getAxisConfigs","getLabelAngle","hasValue","hasConfigValue","axisEncoding","axisEncode","axisEncodingPart","specifiedLabelsSpec","fixedShape","shapeMixins","defaultSize","markPropOrConfig","bandSize","markCompiler","vgMark","postEncodingTransform","shapeDef","vgThicknessChannel","FACETED_PATH_PREFIX","STACK_GROUP_PREFIX","getMarkGroup","fromPrefix","scaleClip","projectionClip","unitCount","parentCount","interactiveFlag","UnitModel","parentGivenSize","specifiedAxes","specifiedLegends","filledConfig","defaultFilled","originalMarkDef","specifiedOrient","xIsContinuous","yIsContinuous","xIsTemporal","yIsTemporal","cornerRadiusEnd","newProps","newProp","initMarkdef","initLayoutSize","initScales","initAxes","initLegends","isGeoShapeMark","hasGeoPosition","initScale","scaleInternal","_axis","axisSpec","initAxis","axisInternal","_legend","supportLegend","specifiedSize","parseUnitLayoutSize","selDefs","selCmpts","selectionConfig","safeName","parseUnitSelection","getPathGroups","hasCornerRadius","fieldScale","stackFieldGroup","groupUpdate","innerGroupUpdate","groupByField","strokeForeground","getGroupsForStackedBarWithCornerRadius","parseMarkGroups","hasSelections","isMulti","assembleTopLevelSignals","dataCopy","assembleUnitSelectionData","LayerModel","axisCount","oppositeOrient","parseLayerAxes","assembleLayerSelectionMarks","unitSize","isAnyConcatSpec","inputSpec","newLogger","firstPassCounter","secondPassCounter","optimizeDataflow","topLevelProperties","datasets","vgConfig","vlOnlyMarkSpecificConfigs","redirectTitleConfig","stripAndRedirectConfig","sourceIndex","newData","whereTo","assembleRootData","otherTopLevelProps","assembleTopLevelModel","autoSizeType","inverseSizeType","getFitType","getTopLevelProperties","normalized","accessorName","accessorFields","one","truthy","falsy","None","Error$1","Info","Debug","_len","_key","toNumber","sign","log1p","symexp","expm1","pan","lift","ground","d0","d1","dd","panLinear","panLog","panPow","panSymlog","da","zoomLinear","zoomLog","zoomPow","zoomSymlog","utcquarter","clampRange","isFunction","DESCENDING","ord","fmap","gen","ascending","compare1","compareN","delay","tid","extend","extentIndex","NULL","fastmap","has$1","clean","inherits","members","inrange","r0","isDate","isIterable","iterator","isRegExp","lerp","frac","DEFAULT_MAX_SIZE","lruCache","maxsize","array0","array1","n0","n1","i0","i1","reps","pad","padchar","toBoolean","defaultParser","toDate","parser","toSet","truncate","visitArray","EOL","QUOTE","NEWLINE","RETURN","objectConverter","inferColumns","columnSet","delimiter","reFormat","DELIMITER","parseRows","N","I","eof","eol","preformatBody","formatValue","formatRow","formatDate","convert","customConverter","formatBody","formatRows","topology","objects","features","geometries","bbox","geometry","transformPoint","x0","y0","kx","ky","arcs","points","ring","polygon","stitchedArcs","fragmentByStart","fragmentByEnd","fragments","emptyIndex","p1","p0","dp","ends","fg","gf","meshArcs","geom","geomsByArc","extract0","extract1","extract2","extract3","geoms","extractArcs","stitch","e10","e5","e2","tickSpec","power","log10","factor","i2","tickIncrement","tickStep","prefixExponent","formatSpecifier","specifier","FormatSpecifier","comma","precision","formatDecimalParts","toExponential","coefficient","toFixed","toLocaleString","toPrecision","formatRounded","formatPrefix","locale","grouping","thousands","currencyPrefix","currency","currencySuffix","decimal","numerals","formatNumerals","percent","minus","nan","newFormat","formatTypes","maybeSuffix","valuePrefix","valueSuffix","valueNegative","formatTrim","t0","t1","timeInterval","floori","offseti","previous","setTime","durationSecond","durationMinute","durationHour","durationDay","durationWeek","durationYear","timeDay","setHours","setDate","utcDay","setUTCHours","setUTCDate","unixDay","timeWeekday","timeSunday","timeMonday","timeTuesday","timeWednesday","timeThursday","timeFriday","timeSaturday","utcWeekday","utcSunday","utcMonday","utcTuesday","utcWednesday","utcThursday","utcFriday","utcSaturday","timeYear","setMonth","setFullYear","utcYear","setUTCMonth","setUTCFullYear","timeMonth","utcMonth","timeHour","utcHour","setUTCMinutes","timeMinute","utcMinute","setUTCSeconds","millisecond","descending","bisector","compare2","mid","YEAR","QUARTER","MONTH","WEEK","DATE","DAY","DAYOFYEAR","HOURS","MINUTES","SECONDS","MILLISECONDS","TIME_UNITS","UNITS","defaultSpecifiers","timeUnitSpecifier","specifiers","fmt","localYear","localDayOfYear","localWeekNum","localFirst","localDate","L","utcdayofyear","utcDayOfYear","utcweek","utcWeekNum","utcFirst","utcDate","inv","newDate","phase","getUnit","weekday","firstDay","localGet","localInv","timeFloor","utcGet","utcInv","utcFloor","timeIntervals","utcIntervals","utcInterval","ival","timeOffset","utcOffset","timeSequence","utcSequence","Milli","Seconds","Minutes","Hours","Day","Month","Year","intervals","locale_dateTime","dateTime","locale_date","locale_time","locale_periods","periods","locale_weekdays","days","locale_shortWeekdays","shortDays","locale_months","months","locale_shortMonths","shortMonths","periodRe","formatRe","periodLookup","formatLookup","weekdayRe","weekdayLookup","shortWeekdayRe","shortWeekdayLookup","monthRe","monthLookup","shortMonthRe","shortMonthLookup","formats","formatDayOfMonth","formatMicroseconds","formatYearISO","formatFullYearISO","formatHour24","formatHour12","formatDayOfYear","formatMilliseconds","formatMonthNumber","formatMinutes","formatUnixTimestamp","formatUnixTimestampSeconds","formatSeconds","formatWeekdayNumberMonday","formatWeekNumberSunday","formatWeekNumberISO","formatWeekdayNumberSunday","formatWeekNumberMonday","formatFullYear","formatZone","formatLiteralPercent","utcFormats","formatUTCDayOfMonth","formatUTCMicroseconds","formatUTCYearISO","formatUTCFullYearISO","formatUTCHour24","formatUTCHour12","formatUTCDayOfYear","formatUTCMilliseconds","formatUTCMonthNumber","formatUTCMinutes","formatUTCSeconds","formatUTCWeekdayNumberMonday","formatUTCWeekNumberSunday","formatUTCWeekNumberISO","formatUTCWeekdayNumberSunday","formatUTCWeekNumberMonday","formatUTCYear","formatUTCFullYear","formatUTCZone","parses","parseSpecifier","parseDayOfMonth","parseMicroseconds","parseYear","parseFullYear","parseHour24","parseDayOfYear","parseMilliseconds","parseMonthNumber","parseMinutes","parseQuarter","parseUnixTimestamp","parseUnixTimestampSeconds","parseSeconds","parseWeekdayNumberMonday","parseWeekNumberSunday","parseWeekNumberISO","parseWeekdayNumberSunday","parseWeekNumberMonday","parseZone","parseLiteralPercent","pads","newParse","Z","Q","V","W","U","utcFormat","utcParse","timeParse","numberRe","percentRe","requoteRe","requote","dISO","dow","UTCdISO","memoize","numberLocale","formatFloat","decimalChar","dec","rightmostDigit","formatSpan","precisionPrefix","precisionRound","precisionFixed","defaultNumberLocale","defaultTimeLocale","resetNumberFormatDefaultLocale","numberFormatLocale","definition","numberFormatDefaultLocale","timeMultiFormat","minute","hour","timeLocale","resetTimeFormatDefaultLocale","timeFormatDefaultLocale","createLocale","numberSpec","timeSpec","resetDefaultLocale","protocol_re","allowed_re","whitespace_re","fileProtocol","uri","localFile","file","fileAccess","isFile","loadFile","isAllowed","hasProtocol","defaultProtocol","rel","context","crossOrigin","fileLoader","fs","filename","accept","readFile","fileReject","httpLoader","fetch","response","ok","statusText","httpReject","isValid","typeParsers","boolean","integer","unknown","typeTests","typeList","inferType","inferTypes","delimitedFormat","delim","responseType","dsv","json","parseJSON","interior","exterior","topojson","csv","tsv","reader","read","schema","timeParser","utcParser","parsers","loaderFactory","UniqueList","idFunc","ids","asyncCallback","df","TUPLE_ID_KEY","TUPLE_ID","isTuple","tupleid","setid","ingest$1","derive","rederive","stableCompare","isChangeSet","rem","mod","remp","modp","reflow","modify","pulse","cur","modifies","CACHE","Parameters","OP_ID","NO_PARAMS","Operator","react","stamp","qrank","_update","parameters","flag","bit","targets","_targets","skip","initonly","argval","_argval","argops","_argops","deps","marshall","detach","evaluate","StopPropagation","rv","STREAM_ID","EventStream","receive","_filter","_apply","_consume","trg","stopPropagation","pause","dataflow","active","SKIP","onStream","onOperator","updater","connect","Pulse","materialize","addFilter","MultiPulse","pulses","changed","ADD","REM","MOD","changes","reentrant","ADD_REM","ADD_MOD","ALL","REFLOW","SOURCE","NO_SOURCE","NO_FIELDS","fork","addAll","addF","remF","modF","srcF","cleans","runAfter","nomod","NO_OPT","siftdown","Dataflow","_clock","_rank","_locale","_loader","_touched","_input","_pulse","_heap","ridx","cidx","siftup","Heap","_postrun","logMethod","_log","Transform","cleanThreshold","targetRank","rerank","queue","_enqueue","ingest","preload","_pending","requests","loadPending","request","querySelectorAll","prerun","postrun","_getPulse","priority","all","_running","enqueue","singlePulse","Definition","valueof","compareDefined","sd","value0","quantileSorted","quantiles","quartiles","estimateBandwidth","deviation","maxb","logb","divide","minstep","steps","eps","setRandom","bootstrapCI","samples","alpha","mu","dotbin","thresh","smoothing","pdf","cdf","icdf","SQRT2PI","nextSample","sampleNormal","rds","densityNormal","cumulativeNormal","quantileNormal","erfinv","gaussian","sigma","kde","support","bandwidth","kernel","sampleLogNormal","densityLogNormal","cumulativeLogNormal","quantileLogNormal","lognormal","mixture","dists","weights","distributions","sampleUniform","densityUniform","cumulativeUniform","quantileUniform","uniform","coef","predict","rSquared","ols","uX","uY","uXY","uX2","slope","xv","yv","ux","uy","visitPoints","SSE","SST","sse","sst","XY","ly","xy","YL","XYL","X2Y","c0","c1","YS","lx","quad","X3","X4","X2X2","poly","lhs","rhs","matrix","gaussianElimination","uncenter","maxiters","epsilon","bw","yhat","residuals","robustWeights","iter","edge","denom","xk","yk","tricube","xkw","updateInterval","medianResidual","cnt","MIN_RADIANS","sampleCurve","minSteps","maxSteps","minX","maxX","ymin","ymax","scaleY","pm","angleDelta","a0","a1","groupkey","measureName","noop","base_op","AggregateOps","__count__","mean_d","req","dev","q2","exponential","exp_r","exponentialb","ValidAggregateOps","createMeasure","compareIndex","_ops","aggregate_param","compileMeasures","getreqs","ctr","TupleStore","reset","measure","prototype$1","Aggregate","_adds","_mods","_alen","_mlen","_drop","_cross","_dims","_dnames","_measures","_countOnly","_counts","_prev","_inputs","_outputs","Bin","SortedList","resort","Collect","Compare","update$5","CountPattern","Cross","_add","_rem","_ext","_q","quartile","ci","_ci","aggr","collect","cells","inputMap","inputVisit","cellkey","aggregate_params","mname","outname","newcell","newtuple","celltuple","counts","adds","mods","_bins","b0","b1","tcase","case","_parameterCheck","_match","_stop","_finish","stopwords","_tuples","Distributions","normal","FUNCTION","Density","fieldNames","partition$1","DotBin","Expression","update$4","Extent","Subflow","Facet","_keys","Field","update$3","Filter","Flatten","Fold","Formula","Generate","distribution","minsteps","maxsteps","autostep","detachSubflow","activate","flow","subflow","flows","sf","_group","detached","initTargets","act","rekey","k0","k1","isMod","revisit","arrays","maxlen","fnames","Methods","Empty","Impute","JoinAggregate","KDE","Key","update$2","Load","MultiExtent","update$1","extents","MultiValues","Params","Pivot","PreFacet","Project","Proxy","Quantile","Relay","Sample","Sequence","Sieve","TimeUnit","gVals","kVal","getValue","getField","fName","kName","gNames","gKey","kMap","gMap","partition","_impute","cumulative","_transform","pivotKeys","aggregateParams","lut","dt","probs","cap","OUTPUT","TupleIndex","Values","_floor","u0","u1","tunits","WindowOps","row_number","dense_rank","drank","percent_rank","cume_dist","cume","ntile","lag","lead","first_value","last_value","nth_value","nth","prev_value","next_value","ValidWindowOps","WindowState","windows","countOnly","visitInputs","WindowOp","Window","processPartition","setWindow","adjustRange","bisect","_context","bezierCurveTo","_x0","_x1","_y0","_y1","Basis","BasisClosed","BasisOpen","Bundle","beta","_basis","_beta","wind","areaStart","areaEnd","lineEnd","lineTo","closePath","moveTo","_x3","_x4","_y3","_y4","custom","bundle","Cardinal","cardinal","CardinalOpen","CardinalClosed","_x5","_y5","pi","halfPi","tau","x1","y1","_l01_a","_l01_2a","_l12_a","_l12_2a","_l23_a","_l23_2a","CatmullRom","_alpha","x23","y23","catmullRom","CatmullRomClosed","CatmullRomOpen","Linear","LinearClosed","slope3","h0","h1","s0","slope2","MonotoneX","MonotoneY","ReflectContext","Natural","controlPoints","Step","_t0","px","py","tauEpsilon","Path","_append","appendRound","quadraticCurveTo","arcTo","x21","y21","x01","y01","l01_2","x20","y20","l21_2","l20_2","l21","l01","t01","t21","ccw","cw","withPath","RangeError","arcInnerRadius","arcOuterRadius","arcStartAngle","arcEndAngle","arcPadAngle","cornerTangents","rc","ox","oy","x11","y11","x10","y10","x00","y00","d2","D","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","cx","cy","curve","defined0","x0z","y0z","arealine","lineX0","lineY0","lineY1","lineX1","draw","domCanvas","getContext","domImage","Image","ascendingBisect","bisectRight","bisectLeft","Color","darker","brighter","reI","reN","reP","reHex","reRgbInteger","reRgbPercent","reRgbaInteger","reRgbaPercent","reHslPercent","reHslaPercent","named","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blueviolet","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","plum","powderblue","rebeccapurple","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen","color_formatHex","rgb","formatHex","color_formatRgb","formatRgb","rgbn","Rgb","rgba","hsla","rgbConvert","rgb_formatHex","hex","rgb_formatRgb","clampa","clampi","Hsl","hslConvert","hsl","clamph","clampt","hsl2rgb","m2","v0","v3","t2","t3","displayable","formatHex8","formatHsl","hue","nogamma","rgbGamma","gamma","rgbSpline","spline","colors","rgbBasis","rgbBasisClosed","isNumberArray","ArrayBuffer","isView","DataView","numberArray","genericArray","nb","na","reA","reB","am","bm","bs","bi","bimap","polymap","transformer","untransform","piecewise","rescale","clamper","invert","rangeRound","continuous","initRange","initInterpolator","interpolator","tickFormat","linearish","prestep","maxIter","transformLog","transformExp","transformLogn","transformExpn","pow10","reflect","loggish","logs","pows","log2","logp","powp","transformPow","transformSqrt","transformSquare","powish","transformSymlog","transformSymexp","symlogish","ticker","tickIntervals","tickInterval","utcTicks","utcTickInterval","timeTicks","timeTickInterval","calendar","formatMillisecond","formatSecond","formatMinute","formatHour","formatDay","formatWeek","formatMonth","formatYear","k10","sequentialPow","k21","r2","divergingPow","InternMap","keyof","defineProperties","_intern","intern_get","intern_set","intern_delete","InternSet","svgNode","translateX","translateY","rotate","skewX","scaleX","interpolateTransform","pxComma","pxParen","degParen","xa","ya","xb","yb","interpolateTransformCss","DOMMatrix","WebKitCSSMatrix","isIdentity","decompose","interpolateTransformSvg","createElementNS","baseVal","consolidate","cosh","zoomRho","rho","rho2","rho4","ux0","uy0","w0","ux1","uy1","w1","coshr0","tanh","sinh","duration","_1","_2","hslLong","Xn","Yn","Zn","labConvert","Lab","Hcl","hcl2lab","rgb2lrgb","xyz2lab","lab","lab2xyz","lrgb2rgb","hcl","hclConvert","hclLong","A","B","C","ED","EB","BC_DA","Cubehelix","cubehelixConvert","cubehelix","cubehelixGamma","cubehelixLong","bandSpace","space","Log","Pow","Sqrt","Symlog","Time","Sequential","Diverging","Quantize","Threshold","Ordinal","Point","Band","BinOrdinal","Continuous","Discrete","Discretizing","Interpolating","Temporal","ordinalRange","range$1","invertRange","pointish","VEGA_SCALE","registerScale","invertExtent","invertRangeExtent","isValidScaleType","hasType","isDiscretizing","isLogarithmic","isInterpolating","sequentialLog","sequentialSymlog","divergingLog","divergingSymlog","thresholds","scaleBinOrdinal","scaleProps","interpolateColors","quantizeInterpolator","scaleFraction","scale$1","interp","palette","schemes","accent","category10","category20","category20b","category20c","dark2","observable10","paired","pastel1","pastel2","set1","set2","set3","tableau10","tableau20","blues","greens","greys","oranges","purples","reds","blueGreen","bluePurple","greenBlue","orangeRed","purpleBlue","purpleBlueGreen","purpleRed","redPurple","yellowGreen","yellowOrangeBrown","yellowOrangeRed","blueOrange","brownBlueGreen","purpleGreen","purpleOrange","redBlue","redGrey","yellowGreenBlue","redYellowBlue","redYellowGreen","pinkYellowGreen","spectral","viridis","magma","inferno","plasma","cividis","rainbow","sinebow","turbo","browns","tealBlues","teals","warmGreys","goldGreen","goldOrange","goldRed","lightGreyRed","lightGreyTeal","lightMulti","lightOrange","lightTealBlue","darkBlue","darkGold","darkGreen","darkMulti","darkRed","SymbolLegend","DiscreteLegend","defaultFormatter","minStep","validTicks","endpoints","tickValues","noSkip","varfmt","tickLog","labelValues","binValues","thresholdValues","isDiscreteRange","labelFormat","thresholdFormat","formatRange","formatDiscrete","formatPoint","dflt","domainCaption","isTemporal","gradient_id","patternPrefix","isGradient","gradientRef","Gradient","stops","curves","orientation","paramCounts","commandPattern","numberPattern","spacePattern","flagPattern","commands","cmd","paramCount","segment","ws","DegToRad","HalfPi","Tau","HalfSqrt3","segmentCache","bezierCache","bezier","th0","th1","rx","ry","sin_th","cos_th","a00","a01","a10","a11","cos_th0","sin_th0","cos_th1","sin_th1","th_half","sin_th_h2","x3","y3","sX","sY","pathRender","tempX","tempY","tempControlX","tempControlY","controlX","controlY","anchorX","anchorY","beginPath","drawArc","coords","seg","large","sweep","rotateX","th","pl","sfactor_sq","sfactor","th_arc","segs","th2","th3","segments","bez","Tan30","builtins","customSymbol","rectangleX","rectangleY","rectangleWidth","rectangleHeight","vg_rect","crTL","crTR","crBL","crBR","rectangle","tl","tr","br","vg_trail","ready","w2","ud","hypot","value$1","arcShape","padRadius","da0","da1","ap","rp","rc0","rc1","oc","x32","y32","intersect","ax","ay","bx","kc","centroid","areavShape","areahShape","lineShape","rectShape","symbolShape","trailShape","clip_id","resetSVGClipId","clip$1","_defs","clipping","Bounds","union","Item","GroupItem","equals","expand","rotatedPoints","encloses","alignsWith","ResourceLoader","customLoader","sanitizeURL","increment","decrement","loadImage","img","cors","onload","onerror","complete","poll","boundStroke","miter","sw","miterAdjustment","circleThreshold","rot","ma","mb","mc","md","addL","addX","addY","addp","addpL","boundContext","deg","context$1","px1","py1","px2","py2","quadExtrema","px3","py3","cubicExtrema","sa","ea","cubic","intersectPath","brush","isPointInPath","intersectPoint","intersectRect","intersectRule","intersectBoxLine","globalCompositeOperation","addStops","addColorStop","createRadialGradient","ictx","fillStyle","createLinearGradient","fillRect","createPattern","globalAlpha","lw","strokeStyle","lineWidth","lineCap","lineJoin","miterLimit","setLineDash","lineDashOffset","zorder","scene","zdirty","zitems","pickVisit","hit","drawAll","drawPath","drawOne","pick$1","gx","gy","pixelRatio","hitPath","isPointInStroke","pickPath","translateItem","markItemPath","isect","tag","nested","attr","emit","rotateItem","markMultiItemPath","tip","clipGroup","offset$1","emitRectangle","off","rectanglePath","hitBackground","hitForeground","hitCorner","noBound","markTypes","fore","save","dw","dh","ix","pickMark","foreground","getImage","imageWidth","imageHeight","imageXOffset","imageYOffset","ar0","ar1","imageSmoothingEnabled","drawImage","xOffset","yOffset","path$1","pathCache","path$2","transformItem","draw$2","widthCache","textMetrics","measureWidth","estimateWidth","useCanvas","use","_estimateWidth","textValue","currentFontHeight","_measureWidth","currentFont","measureText","textLines","multiLineOffset","widthGetter","rtl","fontFamily","fontVariant","textAlign","tempBounds","anchorPoint","lh","fillText","strokeText","Marks","boundItem","DUMMY","boundMark","hasItems","sceneToJSON","sceneFromJSON","Scenegraph","createMark","markdef","domCreate","doc","ns","domFind","tagName","domChild","ownerDocument","domClear","cssClass","clientLeft","clientTop","customTooltip","_active","_handlers","_tooltip","defaultTooltip","_el","_obj","firstChild","_origin","_scene","_handlerIndex","eventName","handleHref","MouseEvent","dispatchEvent","handleTooltip","show","mdef","resolveItem","getItemBoundingClientRect","Renderer","_bgcolor","bgcolor","_width","_height","_scale","dirty","_call","_render","renderAsync","_ready","_load","redraw","DragEnterEvent","DragLeaveEvent","DragOverEvent","PointerDownEvent","PointerMoveEvent","PointerOutEvent","PointerOverEvent","MouseDownEvent","MouseMoveEvent","MouseOutEvent","MouseOverEvent","ClickEvent","MouseWheelEvent","TouchStartEvent","TouchMoveEvent","TouchEndEvent","Events","TooltipShowEvent","TooltipHideEvent","HrefEvent","CanvasHandler","_down","_touch","_first","_events","pointermove","dragover","pointerout","inactive","dragleave","_canvas","eventListenerCheck","DOMMouseScroll","fire","pointerdown","mousedown","click","touchstart","pickEvent","changedTouches","touchmove","touchend","vegaType","eventBundle","fireAll","moveEvents","overEvents","outEvents","exit","CanvasRenderer","_options","_redraw","_dirty","_tempb","externalContext","inDOM","parentNode","ratio","devicePixelRatio","setTransform","vb","viewBounds","clipToBounds","clearRect","SVGHandler","_hrefHandler","listener","_tooltipHandler","_svg","__data__","ARIA_HIDDEN","ARIA_LABEL","ARIA_ROLE","ARIA_ROLEDESCRIPTION","GRAPHICS_OBJECT","GRAPHICS_SYMBOL","roledesc","AriaIgnore","AriaGuides","caption","extractTitle","channelCaption","titleCaption","AriaEncode","ariaItemAttributes","hide","ariaMarkAttributes","ariaGuide","ariaMark","innerText","attrText","markup","outer","inner","close","serializeXML","_serialize","hasAttributes","attributes","hasChildNodes","nodeType","nodeValue","stylesAttr","stylesCss","rootAttributes","xmlns","svgns","SVGRenderer","_dirtyID","_root","_clearDefs","setAttributeNS","setAttributes","RootIndex","setProperty","viewBox","bg","_dirtyCheck","_dirtyAll","isDirty","ownerSVGElement","dirtyParents","isGroup","sibling","previousSibling","__values__","mark_extras","setStyle","updateGradient","updateClipping","grad","pt","preserveAspectRatio","fx","fy","fr","cg","siblingCheck","nextSibling","ts","removeAttributeNS","removeProperty","SVGStringRenderer","_text","class","attrList","_hrefs","prefixed","styleList","display","OPTS","svgMarkTypes","svgOnTop","setHybridRendererOptions","HybridRenderer","_svgRenderer","_canvasRenderer","_root_el","bottomEl","topEl","_svgEl","_canvasEl","pointerEvents","canvasMarkTypes","HybridHandler","Canvas","Hybrid","RenderType","PNG","SVG","modules","renderModule","hits","intersectMark","intersectGroup","visitMark","intersectItem","headless","clipBounds","boundClip","TOLERANCE","sceneEqual","pathEqual","ka","kb","objectEqual","resetSVGDefIds","Top","Left","Right","Bottom","Start","Middle","End","Group","AxisRole","TitleRole","LegendRole","RowHeader","RowFooter","RowTitle","ColHeader","ColFooter","ColTitle","FitX","FitY","All","Each","Flush","Column","Row","Bound","rebound","markBounds","COUNTER_NAME","Overlap","_signals","scenegraph","lookup$1","Init","methods","parity","greedy","sep","hasOverlap","hasBounds","Render","separation","boundScale","boundTolerance","tolerance","boundTest","boundOrient","isYAxis","axisLayout","axisIndices","dl","axisTitleLayout","auto","bboxFlush","bboxFull","offsetValue","gridLayout","nodirty","alignCol","alignRow","padCol","padRow","ncols","nrows","xExtent","xMax","yExtent","yMax","boxes","boundFlush","boundFull","bf","layoutTitle","legendParams","offsets","legendLayout","_bounds","ex","ey","tpad","tx","ty","legendTitleOffset","legendGroupLayout","legendBounds","widths","legendEntryLayout","lr","noBar","vgrad","ViewLayout","AxisTicks","DataJoin","defaultItemCreate","Encode","LegendEntries","views","rowheaders","rowfooters","colheaders","colfooters","rowtitle","coltitle","gridLayoutGroups","headerBand","footerBand","trellisLayout","xBounds","yBounds","titleLayout","_autosize","viewWidth","viewHeight","_resizeView","viewSizeLayout","layoutGroup","shouldReflow","newMap","fmod","encoders","reenter","fraction","lskip","perc","adjust","labelFraction","perc2","sourceX","sourceY","targetX","targetY","LinkPath","Paths","rr","iy","sr","ss","tc","mr","Pie","includePad","Scale","domainCheck","adjustScheme","flip","SortItems","isContinuousColor","rawDomain","scaleKey","configureRangeStep","scheme$1","schemeExtent","interpolateGamma","schemeCount","configureScheme","configureRange","configureBins","includeZero","padDomain","domainImplicit","configureDomain","Zero","Center","Normalize","DefOutput","Stack","stackCenter","stackNormalize","stackZero","lastPos","lastNeg","streamGeometry","streamGeometryType","streamObjectType","Feature","FeatureCollection","Sphere","sphere","MultiPoint","LineString","streamLine","MultiLineString","Polygon","streamPolygon","MultiPolygon","GeometryCollection","closed","coordinate","polygonStart","polygonEnd","Adder","_partials","_n","quarterPi","areaSum","areaRingSum","areaStream","areaRingStart","areaRingEnd","areaPointFirst","areaPoint","boundsStream","X0","Y0","Z0","X1","Y1","Z1","Z2","centroidStream","centroidPoint","centroidLineStart","centroidLineEnd","centroidRingStart","centroidRingEnd","centroidPointFirstLine","centroidPointLine","centroidPointFirstRing","centroidPointRing","PathContext","pointRadius","lengthRing","lengthSum","lengthStream","lengthPointFirst","lengthPoint","cacheDigits","cacheAppend","cacheRadius","cacheCircle","PathString","projectionStream","contextStream","lines","rejoin","Intersection","compareIntersection","startInside","subject","pointEqual","isSubject","spherical","cartesian","lambda","phi","cosPhi","cartesianDot","cartesianCross","cartesianAddInPlace","cartesianScale","vector","cartesianNormalizeInPlace","pointVisible","clipLine","sink","ringBuffer","ringSink","polygonStarted","pointRing","ringStart","ringEnd","sinPhi","winding","point0","lambda0","phi0","sinPhi0","cosPhi0","lambda1","sinPhi1","cosPhi1","point1","phi1","absDelta","antimeridian","intersection","phiArc","polygonContains","pointLine","ringSegments","validSegment","sign0","sign1","sinLambda0Lambda1","clipAntimeridianIntersect","circleRadius","cosRadius","clipMax","clipMin","clipRectangle","visible","corner","comparePoint","ca","x__","y__","v__","x_","y_","v_","activeStream","bufferStream","clipStream","linePoint","polygonInside","cleanInside","compose","rotationIdentity","deltaLambda","deltaPhi","deltaGamma","rotationLambda","rotationPhiGamma","forwardRotationLambda","rotation","cosDeltaPhi","sinDeltaPhi","cosDeltaGamma","sinDeltaGamma","TransformStream","fitBounds","clipExtent","fitExtent","fitSize","fitWidth","fitHeight","cosMinDistance","delta2","resampleLineTo","phi2","lambda2","dx2","dy2","dz","lambda00","b00","c00","resampleStream","ringPoint","resampleNone","transformRadians","scaleTranslateRotate","scaleTranslate","cosAlpha","sinAlpha","ai","fi","projectionMutator","projectAt","projectResample","projectTransform","projectRotateTransform","cacheStream","preclip","postclip","recenter","resample","transformRotate","clipAngle","cr","smallRadius","notHemisphere","two","n2","n2n2","n1n2","determinant","n1xn2","uu","polar","v00","point2","sinRadius","circleStream","reflectX","reflectY","conicProjection","parallels","conicEqualAreaRaw","sy0","forward","cylindricalEqualAreaRaw","r0y","conicEqualArea","azimuthalRaw","azimuthalInvert","cc","azimuthalEqualAreaRaw","cxcy","azimuthalEquidistantRaw","mercatorRaw","mercatorProjection","reclip","tany","conicConformalRaw","equirectangularRaw","conicEquidistantRaw","nx","A1","A2","A3","A4","equalEarthRaw","l2","l6","gnomonicRaw","naturalEarth1Raw","phi4","orthographicRaw","stereographicRaw","transverseMercatorRaw","sqrt2","mollweideBromleyTheta","cp","cpsinPhi","mollweideRaw","mollweideBromleyRaw","defaultPath","projectionProperties","getProjectionPath","albers","albersusa","lower48Point","alaskaPoint","hawaiiPoint","lower48","alaska","hawaii","pointStream","albersUsa","streams","azimuthalequalarea","azimuthalequidistant","conicconformal","conicequalarea","conicequidistant","equalEarth","equirectangular","gnomonic","mercator","mollweide","naturalEarth1","orthographic","stereographic","transversemercator","graticuleX","graticuleY","contours","smoothLinear","tz","contour","polygons","holes","startIndex","endIndex","isorings","hole","xt","yt","_0","ringContains","xi","yi","pj","xj","yj","segmentContains","collinear","Isocontour","transformPolygon","transformRing","density2D","weight","values0","values1","blurX","blurY","cellSize","KDE2D","levels","paths","transformPaths","PARAMS","Contour","GeoJSON","GeoPath","GeoPoint","GeoShape","Graticule","DX","DY","outline","extentMajor","extentMinor","stepMajor","stepMinor","Heatmap","dependency","$x","$y","$value","$max","Projection","ym","yp","leaf","defaultX","defaultY","quadtree","Quadtree","leaf_copy","_features","_points","lon","lat","initPath","shapeGenerator","shared","dep","opacity_","color_","can","getImageData","pix","putImageData","toCanvas","featurize","collectGeoJSON","treeProto","vx","vy","cover","xz","yz","quads","retainer","removeAll","visitAfter","dispatch","Dispatch","typename","T","taskHead","taskTail","timeout","pokeDelay","clockLast","clockNow","clockSkew","clock","performance","setFrame","requestAnimationFrame","clearNow","Timer","_time","_next","timer","restart","wake","timerFlush","sleep","nap","poke","clearInterval","initialAngle","nodeById","nodeId","ForceMap","strength","collide","radii","iterations","ri","ri2","prepare","rj","jiggle","_nodes","_random","nbody","strengths","distanceMin2","distanceMax2","accumulate","distanceMin","distanceMax","link","links","distances","bias","distance","initializeStrength","initializeDistance","Forces","ForceParams","ForceConfig","ForceOutput","Force","setup","sim","forces","getForce","numForces","setForceParam","hierarchy","mapChildren","objectChildren","childs","Node","eachBefore","computeHeight","copyData","optional","required","constantZero","iters","simulation","alphaMin","alphaDecay","alphaTarget","velocityDecay","stepper","initializeNodes","initializeForce","randomSource","closest","stopped","static","finish","eachAfter","aNodes","ancestors","bNodes","leastCommonAncestor","descendants","leaves","extendBasis","enclosesWeakAll","enclosesNot","encloseBasis2","encloseBasis3","dr","enclosesWeak","encloseBasis","r21","r3","a2","a3","b2","b3","c3","d3","ab","place","score","packSiblingsRandom","circles","aa","sj","sk","pack","shuffle","packEncloseRandom","defaultRadius","radiusLeaf","packChildrenRandom","translateChild","preroot","ambiguous","imputed","defaultId","defaultParentId","parentId","stratify","nodeKey","currentId","currentParentId","nodeByKey","slash","parentof","defaultSeparation","nextLeft","nextRight","moveSubtree","wm","wp","nextAncestor","vim","TreeNode","meanXReduce","maxYReduce","squarifyRatio","sumValue","minValue","maxValue","newRatio","minRatio","dice","squarify","resquarify","_squarify","Nest","nest","valuesByKey","keyValue","HierarchyLayout","setParams","setFields","Output$3","Pack","Output$2","Partition","Stratify","positionNode","parentKey","Layouts","tidy","nodeSize","treeRoot","firstWalk","secondWalk","sizeNode","siblings","executeShifts","midpoint","vip","vop","vom","sip","sop","som","apportion","cluster","previousNode","meanX","maxY","leafLeft","leafRight","Output$1","Tree","TreeLinks","Tiles","binary","sums","valueOffset","valueTarget","valueLeft","valueRight","slicedice","Treemap","tile","paddingStack","paddingTop","paddingRight","paddingBottom","paddingLeft","treemap","ALPHA_MASK","getBuffer","DIV","RIGHT0","RIGHT1","outOfBounds","textWidth","textHeight","collision","bm0","bm1","getRange","X_DIR","Y_DIR","Aligns","Baselines","boundary","isInside","anchorCode","TOP","MIDDLE","BOTTOM","placeAreaLabel","bitmaps","avoidBaseMark","markIndex","areaWidth","maxAreaWidth","tryLabel","_xMid","_yMid","swapTmp","labelPlaced","labelPlaced2","setRange","bm2","bitmap","labelLayout","texts","avoidMarks","lineAnchor","positions","getOffsets","anchors","getAnchors","grouptype","isGroupArea","markBoundary","infPadding","isNaiveGroupArea","maxTextWidth","maxTextHeight","_set","_clear","indexStart","indexEnd","clearRange","Bitmap","scaler","labelInside","baseMark","border","baseMarkContext","strokeContext","baseMarkBuffer","strokeBuffer","layer1","layer2","strokeAlpha","baseMarkAlpha","markBitmaps","baseBitmaps","sizeFactor","insideFactor","placeMarkLabel","Anchors","Label","Loess","null","Regression","dof","degreesOfFreedom","dom","elen","flen","Qnew","hh","bvirt","enow","fnow","eindex","findex","hindex","vec","C1","C2","orient2d","detleft","detright","det","detsum","acxtail","acytail","bcxtail","bcytail","ahi","alo","bhi","blo","_i","u3","acx","bcx","acy","bcy","errbound","C1len","C2len","Dlen","orient2dadapt","EDGE_STACK","Delaunator","getX","defaultGetX","getY","defaultGetY","maxTriangles","_triangles","_halfedges","_hashSize","_hullPrev","_hullNext","_hullTri","_hullHash","_ids","_dists","hullPrev","hullNext","hullTri","hullHash","minY","minDist","i0x","i0y","i1x","i1y","minRadius","circumradius","i2x","i2y","quicksort","hull","triangles","halfedges","cl","circumcenter","_cx","_cy","_hullStart","hullSize","_hashKey","trianglesLen","_addTriangle","_legalize","pseudoAngle","ar","inCircle","hbl","_link","bp","tempDist","Voronoi","delaunay","xmin","xmax","_circumcenters","vectors","_init","circumcenters","inedges","ti","tj","_renderSegment","_project","renderBounds","renderCell","_clip","cellPolygons","cellPolygon","_regioncode","_clipSegment","_step","neighbors","cj","loop","li","aj","lj","_cell","e0","_simplify","_clipInfinite","_clipFinite","e1","sx0","sx1","sy1","_edgecode","_edge","vx0","vy0","vxn","vyn","pointX","pointY","jitter","Delaunay","flatArray","flatIterable","_delaunator","_hullIndex","hullIndex","voronoi","dc","renderHull","renderPoints","hullPolygon","renderTriangle","trianglePolygons","trianglePolygon","defaultExtent","toPathString","cloudRadians","cloudSprite","contextAndRatio","di","sprite","w32","maxh","wcr","wsr","hcr","hsr","xoff","yoff","hasText","pixels","seenRow","cloudCollide","board","msx","cloudBounds","collideRects","archimedeanSpiral","functor","spirals","archimedean","rectangular","Wordcloud","spiral","words","cloud","dxdy","startX","startY","maxDelta","zeroArray","tags","fontSizeRange","fsize","sizeScale","array8","array16","array32","Dimension","query","onAdd","added","dim","SortedIndex","addi","oldv","oldi","addv","index0","value1","index1","reindex","CrossFilter","lengthen","_index","Bitmaps","_indices","ResolveFilter","reinit","remMap","modMap","indexMap","incrementOne","incrementAll","old","lo1","hi1","lo0","hi0","pass","scanIdentifier","codegen","fncall","STRING","REGEXP","if","forbidden","globalvar","fieldvar","outputGlobal","globals","Generators","stripQuotes","phi00","deltaSum","ranges","areaRing","dLambda","sdLambda","adLambda","W0","W1","z0","boundsLineStart","boundsLineEnd","boundsRingPoint","boundsRingStart","boundsRingEnd","inflection","phii","lambdai","rangeCompare","rangeContains","centroidPointCartesian","centroidLinePointFirst","centroidLinePoint","centroidRingPointFirst","centroidRingPoint","cz","SELECTION_GETTER","Intersect","Union","Or","And","SelectionId","$selectionId","UNIT_INDEX","testPoint","dval","others","E_union","E_intersect","R_union","R_intersect","selectionVisitor","scope","indexName","getData","indataRef","tuplesRef","dateObj","setYear","ScalePrefix","SignalPrefix","dataVisitor","scaleVisitor","addScaleDependency","scaleRef","getScale","nameOrFunction","maybeScale","geoMethod","methodName","globalMethod","geoArea","geoBounds","deltaMax","geoCentroid","channel_luminance_value","channelValue","luminance","equalArray","equalObject","removePredicate","accessors","treeNodes","_window","functionContext","isDefined","_len2","_key2","_len3","_key3","repl","_len4","_key4","pluck","contrast","color1","color2","lum1","lum2","monthFormat","monthAbbrevFormat","dayFormat","dayAbbrevFormat","inScope","pinchDistance","touches","pinchAngle","screen","containerSize","clientWidth","clientHeight","windowSize","bandspace","setdata","pathShape","retval","_trigger","lassoAppend","lasso","lassoPath","_ref","intersectLasso","pixelLasso","bb","MIN_SAFE_INTEGER","testx","testy","intersections","prevX","prevY","pointInPolygon","eventFunctions","thisPrefix","astVisitors","codegenParams","fnctx","visitors","__bandwidth","_bandwidth","_range","internalScaleFunctions","codeGenerator","getSignal","$expr","$fields","$params","miss","unitIdx","vl5","resUnit","resolved","multiRes","Skip","Swap","canonicalType","expressionCodegen","_compare","parseParameter","PARSERS","$ref","$key","$flat","parseParameters","parameterExpression","$field","$name","$encode","enc","encodeExpression","$output","$compare","$order","$tupleid","$subflow","subctx","operators","Context","Subcontext","ariaLabel","subcontext","$ingest","$format","$request","unresolved","operatorExpression","eventExpression","handlerExpression","eventConfig","parseOperator","parseOperatorParameters","parseUpdate","srcid","getState","dataset","setState","substate","Default","setCursor","globalCursor","dataref","_runtime","_viewWidth","_viewHeight","VIEW","NO_TRAP","trap","trackEventListener","_eventListeners","permit","_eventConfig","itemFilter","markTarget","invoke","RadioClass","Event","checked","option","valuesEqual","selected","selectedIndex","prepend","initializeRenderer","paddingObject","renderHeadless","_scenegraph","Width","Height","dataTest","signalTest","formatArray","_elBind","_renderType","_renderer","_handler","_globalCursor","_preventDefault","_timers","_resizeListeners","unpack","initializeEventConfig","_bind","bindings","_resize","resetSize","_resizeWidth","_resizeHeight","resizePadding","initializeResize","_background","user","watchPixelRatio","_watchPixelRatio","lookupSignal","findOperatorHandler","addOperatorListener","removeOperatorListener","_desc","_resetRenderer","rerun","addResizeListener","removeResizeListener","removeSignalListener","addDataListener","removeDataListener","_restart","elapsed","timestamp","prevent","allow","itemGroup","extension","eventExtend","timers","listeners","leaveSet","elBind","initializeAria","prevHandler","initializeHandler","binding","blob","Blob","createObjectURL","toBlobURL","toSVG","updatePixelRatio","media","matchMedia","parseAutosize","parsePadding","encoder","addEncode","addEncoders","extendEncode","MarkRole","AxisDomainRole","AxisGridRole","AxisLabelRole","AxisTickRole","AxisTitleRole","LegendBandRole","LegendEntryRole","LegendGradientRole","LegendLabelRole","LegendSymbolRole","LegendTitleRole","TitleTextRole","TitleSubtitleRole","applyDefault","entry$1","_color","resolveField","parseEncode","applyDefaults","parse$1","OUTER","OUTER_INVALID","outerError","parseSignal","addSignal","addBinding","Entry","refs","fieldRef$1","keyFieldRef","compareRef","aggrField","Scope$1","isSignal","hasSignal","specValue","deref","mergeStream","nestedStream","eventStream","streamParameters","addStream","markrole","filterMark","OP_VALUE_EXPR","mergeSources","FIELD_REF_ID","MULTIDOMAIN_SORT_OPS","parseLiteral","parseScaleInterpolate","parseScaleNice","parseArray","objectProperty","parseScaleBins","dataLookupError","explicitDomain","multipleDomain","singularDomain","valuesRef","parseSort","domainRef","extentRef","coll","addDataPipeline","ordinalMultipleDomain","quantileMultipleDomain","numericMultipleDomain","countsRef","sortRef","multidomain","parseParameter$1","Vertical","Index","Offset","Perc","Perc2","Value","GuideLabelStyle","GuideTitleStyle","GroupTitleStyle","GroupSubtitleStyle","Size","LegendScales","GroupMark","RectMark","RuleMark","SymbolMark","TextMark","guideGroup","isVertical","symbolDirection","gradientDirection","gradientWidth","gradientHeight","entryColumns","getEncoding","anchorExpr","alignExpr$1","extendOffset","guideMark","extras","legendGradient","userEncode","legendGradientDiscrete","dataRef","vv","alignExpr","baselineExpr","legendGradientLabels","overlap","gradientLabelLimit","gradientLabelOffset","legendSymbolGroups","xSignal","yEncode","baseFill","baseStroke","symbolBaseStrokeColor","isL","isR","isLR","isVG","exprAlign","exprAnchor","exprAngle","exprBaseline","getRole","parseTransform","pdef","lookupRef","parseIndexParameter","parseSubParameter","parseSubParameters","projectionRef","parameterValue","isField","isCompare","outerExpr","exprRef","outerField","isData","getDataRef","DataScope","fieldKey","addSortField","optype","sortKey","parseTrigger","trigger","parseMark","layoutRef","boundRef","keyRef","parseData$1","joinRef","$context","markpath","markRef","generates","encodeRef","pushState","subscope","addData","toRuntime","parseFacet","parseSubflow","popState","tol","parseOverlap","sieve","buildLegendEncode","getChannel","fromEntries","angleExpr","groupEncode","getSign","ifLeftTopExpr","ifX","ifXEnc","ifY","ifYEnc","ifTop","ifTopExpr","ifRight","ifRightExpr","$orient","ifEnc","ifExpr","isSimple","toExpr","ifOrient","fallback","styleProp","flushExpr","xyKeys","orientKeys","ticksRef","vscale","tickPos","gridStart","gridEnd","axisGrid","axisTicks","flushOffset","flushOn","axisLabels","pos0","pos1","axisDomain","titlePos","autoY","autoX","autoLayout","axisTitle","buildAxisEncode","parseScope","preprocessed","addProjection","addScale","upstream","analyze","isSubscope","addUpdate","streamSource","parseSignalUpdates","entryLayout","scaleCount","entryRef","legendSymbolLayout","getStyle","getFontSize","sizeExpression","_anchor","legendTitle","buildTitle","titleEncode","buildSubTitle","parseTitle","parseLambdas","rootEncode","signalObject","Scope","lambdas","_id","_subid","_nextsub","_encode","_lookup","_markpath","Subscope","propertyLambda","arrayLambda","objectLambda","collectSignals","parseView","defaultColor","lightGray","vref","annotate","isExpr$1","sig","hasOwnSignal","addScaleProj","projectionType","dataScope","__WEBPACK_EXTERNAL_MODULE__55__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","globalThis","toStringTag"],"sourceRoot":""} \ No newline at end of file diff --git a/vega/static/labplugin.js b/vega/static/labplugin.js index 7e4d8ce9..dd908e5c 100644 --- a/vega/static/labplugin.js +++ b/vega/static/labplugin.js @@ -1,3 +1,3 @@ /*! For license information please see labplugin.js.LICENSE.txt */ -define(["@jupyter-widgets/base"],(e=>(()=>{var t={313:e=>{var t=function(){"use strict";function e(e,t){return null!=t&&e instanceof t}var t,n,r;try{t=Map}catch(e){t=function(){}}try{n=Set}catch(e){n=function(){}}try{r=Promise}catch(e){r=function(){}}function i(o,s,u,l,c){"object"==typeof s&&(u=s.depth,l=s.prototype,c=s.includeNonEnumerable,s=s.circular);var f=[],d=[],h="undefined"!=typeof Buffer;return void 0===s&&(s=!0),void 0===u&&(u=1/0),function o(u,p){if(null===u)return null;if(0===p)return u;var g,m;if("object"!=typeof u)return u;if(e(u,t))g=new t;else if(e(u,n))g=new n;else if(e(u,r))g=new r((function(e,t){u.then((function(t){e(o(t,p-1))}),(function(e){t(o(e,p-1))}))}));else if(i.__isArray(u))g=[];else if(i.__isRegExp(u))g=new RegExp(u.source,a(u)),u.lastIndex&&(g.lastIndex=u.lastIndex);else if(i.__isDate(u))g=new Date(u.getTime());else{if(h&&Buffer.isBuffer(u))return g=Buffer.allocUnsafe?Buffer.allocUnsafe(u.length):new Buffer(u.length),u.copy(g),g;e(u,Error)?g=Object.create(u):void 0===l?(m=Object.getPrototypeOf(u),g=Object.create(m)):(g=Object.create(l),m=l)}if(s){var y=f.indexOf(u);if(-1!=y)return d[y];f.push(u),d.push(g)}for(var v in e(u,t)&&u.forEach((function(e,t){var n=o(t,p-1),r=o(e,p-1);g.set(n,r)})),e(u,n)&&u.forEach((function(e){var t=o(e,p-1);g.add(t)})),u){var b;m&&(b=Object.getOwnPropertyDescriptor(m,v)),b&&null==b.set||(g[v]=o(u[v],p-1))}if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(u);for(v=0;v{"use strict";var r=n(81);function i(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}e.exports=function(e){var t=new i;t.pre=e.pre,t.body=e.body,t.post=e.post;var n=e.args.slice(0);t.argTypes=n;for(var o=0;o0)throw new Error("cwise: pre() block may not reference array args");if(o0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===a)t.scalarArgs.push(o),t.shimArgs.push("scalar"+o);else if("index"===a){if(t.indexArgs.push(o),o0)throw new Error("cwise: pre() block may not reference array index");if(o0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===a){if(t.shapeArgs.push(o),on.length)throw new Error("cwise: Too many arguments in pre() block");if(t.body.args.length>n.length)throw new Error("cwise: Too many arguments in body() block");if(t.post.args.length>n.length)throw new Error("cwise: Too many arguments in post() block");return t.debug=!!e.printCode||!!e.debug,t.funcName=e.funcName||"cwise",t.blockSize=e.blockSize||64,r(t)}},984:(e,t,n)=>{"use strict";var r=n(706);function i(e,t,n){var r,i,o=e.length,a=t.arrayArgs.length,s=t.indexArgs.length>0,u=[],l=[],c=0,f=0;for(r=0;r0&&u.push("var "+l.join(",")),r=o-1;r>=0;--r)c=e[r],u.push(["for(i",r,"=0;i",r,"0&&u.push(["index[",f,"]-=s",f].join("")),u.push(["++index[",c,"]"].join(""))),u.push("}")}return u.join("\n")}function o(e,t,n){for(var r=e.body,i=[],o=[],a=0;a0&&(n=n&&t[r]===t[r-1])}return n?t[0]:t.join("")}e.exports=function(e,t){for(var n=t[1].length-Math.abs(e.arrayBlockIndices[0])|0,s=new Array(e.arrayArgs.length),u=new Array(e.arrayArgs.length),l=0;l0&&b.push("shape=SS.slice(0)"),e.indexArgs.length>0){var x=new Array(n);for(l=0;l0&&v.push("var "+b.join(",")),l=0;l3&&v.push(o(e.pre,e,u));var A=o(e.body,e,u),E=function(e){for(var t=0,n=e[0].length;t0,l=[],c=0;c0;){"].join("")),l.push(["if(j",c,"<",s,"){"].join("")),l.push(["s",t[c],"=j",c].join("")),l.push(["j",c,"=0"].join("")),l.push(["}else{s",t[c],"=",s].join("")),l.push(["j",c,"-=",s,"}"].join("")),u&&l.push(["index[",t[c],"]=j",c].join(""));for(c=0;c3&&v.push(o(e.post,e,u)),e.debug&&console.log("-----Generated cwise routine for ",t,":\n"+v.join("\n")+"\n----------");var O=[e.funcName||"unnamed","_cwise_loop_",s[0].join("s"),"m",E,a(u)].join("");return new Function(["function ",O,"(",y.join(","),"){",v.join("\n"),"} return ",O].join(""))()}},81:(e,t,n)=>{"use strict";var r=n(984);e.exports=function(e){var t=["'use strict'","var CACHED={}"],n=[],i=e.funcName+"_cwise_thunk";t.push(["return function ",i,"(",e.shimArgs.join(","),"){"].join(""));for(var o=[],a=[],s=[["array",e.arrayArgs[0],".shape.slice(",Math.max(0,e.arrayBlockIndices[0]),e.arrayBlockIndices[0]<0?","+e.arrayBlockIndices[0]+")":")"].join("")],u=[],l=[],c=0;c0&&(u.push("array"+e.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(e.arrayBlockIndices[0])-Math.abs(e.arrayBlockIndices[c]))),l.push("array"+e.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[c])+"]"))}for(e.arrayArgs.length>1&&(t.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),t.push("for(var shapeIndex=array"+e.arrayArgs[0]+".shape.length-"+Math.abs(e.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),t.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),t.push("}")),c=0;c{"use strict";var r=n(987),i=n(706),o=0;function a(e,t,n){this.name=e,this.lvalue=t,this.rvalue=n,this.count=0}function s(e,t,n,r){this.body=e,this.args=t,this.thisVars=n,this.localVars=r}e.exports=function(e){for(var t=["(",e,")()"].join(""),u=r.parse(t,{range:!0}),l="_inline_"+o+++"_",c=function(e){for(var t=e.body[0].expression.callee.params,n=new Array(t.length),r=0;r=0){var a=f[o],s=function(e){return"AssignmentExpression"===e.parent.type&&e.parent.left===e?"="===e.parent.operator?1:3:"UpdateExpression"===e.parent.type?3:2}(t);1&s&&(a.lvalue=!0),2&s&&(a.rvalue=!0),++a.count,y(t,a.name)}else(function(e){if("eval"===e)throw new Error("cwise-parser: eval() not allowed");return"undefined"!=typeof window?e in window:void 0!==n.g?e in n.g:"undefined"!=typeof self&&e in self})(i)||y(t,function(e){var t=l+e.replace(/\_/g,"__");return g.push(t),t}(i))}else if("Literal"===t.type)"string"==typeof t.value&&y(t,"'"+t.value.replace(/\_/g,"\\_").replace(/\'/g,"'")+"'");else{if("WithStatement"===t.type)throw new Error("cwise-parser: with() statements not allowed");for(var u=Object.keys(t),d=0,h=u.length;d{"use strict";var r=n(615),i=n(239),o=["args","body"],a=["pre","post","printCode","funcName","blockSize"];e.exports=function(e){for(var t in e)o.indexOf(t)<0&&a.indexOf(t)<0&&console.warn("cwise: Unknown argument '"+t+"' passed to expression compiler");for(var n=0;n{"use strict";function t(e,n,r){var i=0|e[r];if(i<=0)return[];var o,a=new Array(i);if(r===e.length-1)for(o=0;o0)return function(e,t){var n,r;for(n=new Array(e),r=0;r=48&&e<=57}function _(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function w(e){return"01234567".indexOf(e)>=0}function k(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function A(e){return 10===e||13===e||8232===e||8233===e}function E(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&s.NonAsciiIdentifierStart.test(String.fromCharCode(e))}function O(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&s.NonAsciiIdentifierPart.test(String.fromCharCode(e))}function D(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function S(e){return"eval"===e||"arguments"===e}function C(e){if(c&&D(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function F(e,t,n,r,i){var o;b("number"==typeof n,"Comment must have valid position"),y.lastCommentStart>=n||(y.lastCommentStart=n,o={type:e,value:t},v.range&&(o.range=[n,r]),v.loc&&(o.loc=i),v.comments.push(o),v.attachComment&&(v.leadingComments.push(o),v.trailingComments.push(o)))}function j(e){var t,n,r,i;for(t=f-e,n={start:{line:d,column:f-h-e}};f=p&&Y({},a.UnexpectedToken,"ILLEGAL");else if(42===n){if(47===l.charCodeAt(f+1))return++f,++f,void(v.comments&&(r=l.slice(e+2,f-2),t.end={line:d,column:f-h},F("Block",r,e,f,t)));++f}else++f;Y({},a.UnexpectedToken,"ILLEGAL")}function $(){var e,t;for(t=0===f;f>>="===(i=l.substr(f,4))?(f+=4,{type:t.Punctuator,value:i,lineNumber:d,lineStart:h,start:o,end:f}):">>>"===(r=i.substr(0,3))||"<<="===r||">>="===r?(f+=3,{type:t.Punctuator,value:r,lineNumber:d,lineStart:h,start:o,end:f}):u===(n=r.substr(0,2))[1]&&"+-<>&|".indexOf(u)>=0||"=>"===n?(f+=2,{type:t.Punctuator,value:n,lineNumber:d,lineStart:h,start:o,end:f}):"<>=!+-*%&|^/".indexOf(u)>=0?(++f,{type:t.Punctuator,value:u,lineNumber:d,lineStart:h,start:o,end:f}):void Y({},a.UnexpectedToken,"ILLEGAL")}function R(){var e,n,r;if(b(x((r=l[f]).charCodeAt(0))||"."===r,"Numeric literal must start with a decimal digit or a decimal point"),n=f,e="","."!==r){if(e=l[f++],r=l[f],"0"===e){if("x"===r||"X"===r)return++f,function(e){for(var n="";f0&&(r=v.tokens[v.tokens.length-1]).range[0]===e&&"Punctuator"===r.type&&("/"!==r.value&&"/="!==r.value||v.tokens.pop()),v.tokens.push({type:"RegularExpression",value:n.literal,range:[e,f],loc:t})),n}function I(){var e,n,i;return $(),f>=p?{type:t.EOF,lineNumber:d,lineStart:h,start:f,end:f}:E(e=l.charCodeAt(f))?(n=f,{type:1===(i=92===l.charCodeAt(f)?B():T()).length?t.Identifier:C(i)?t.Keyword:"null"===i?t.NullLiteral:"true"===i||"false"===i?t.BooleanLiteral:t.Identifier,value:i,lineNumber:d,lineStart:h,start:n,end:f}):40===e||41===e||59===e?z():39===e||34===e?function(){var e,n,r,i,o,s,u,c,g="",m=!1;for(u=d,c=h,b("'"===(e=l[f])||'"'===e,"String literal must starts with a quote"),n=f,++f;f=0&&f=0?z():L()}return L()}return"Keyword"===e.type&&"this"!==e.value?L():z()}():z()}function U(){var e,r,i;return $(),e={start:{line:d,column:f-h}},r=I(),e.end={line:d,column:f-h},r.type!==t.EOF&&(i=l.slice(r.start,r.end),v.tokens.push({type:n[r.type],value:i,range:[r.start,r.end],loc:e})),r}function q(){var e;return f=(e=m).end,d=e.lineNumber,h=e.lineStart,m=void 0!==v.tokens?U():I(),f=e.end,d=e.lineNumber,h=e.lineStart,e}function W(){var e,t,n;e=f,t=d,n=h,m=void 0!==v.tokens?U():I(),f=e,d=t,h=n}function H(e,t){this.line=e,this.column=t}function G(e,t,n,r){this.start=new H(e,t),this.end=new H(n,r)}function V(){var e,t,n,r;return e=f,t=d,n=h,$(),r=d!==t,f=e,d=t,h=n,r}function Y(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(function(e,t){return b(t":case"<=":case">=":case"instanceof":r=7;break;case"in":r=n?7:0;break;case"<<":case">>":case">>>":r=8;break;case"+":case"-":r=9;break;case"*":case"/":case"%":r=11}return r}function ge(){var e,t,n,r,i;return i=m,e=function(){var e,t,n,r,i,o,a,s,u,l;if(e=m,u=he(),0===(i=pe(r=m,y.allowIn)))return u;for(r.prec=i,q(),t=[e,m],o=[u,r,a=he()];(i=pe(m,y.allowIn))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),n=g.createBinaryExpression(s,u,a),t.pop(),e=t[t.length-1],g.markEnd(n,e),o.push(n);(r=q()).prec=i,o.push(r),t.push(m),n=he(),o.push(n)}for(n=o[l=o.length-1],t.pop();l>1;)n=g.createBinaryExpression(o[l-1].value,o[l-2],n),l-=2,e=t.pop(),g.markEnd(n,e);return n}(),Q("?")&&(q(),t=y.allowIn,y.allowIn=!0,n=me(),y.allowIn=t,J(":"),r=me(),e=g.createConditionalExpression(e,n,r),g.markEnd(e,i)),e}function me(){var e,n,r,o,s,u;return e=m,s=m,o=n=ge(),m.type===t.Punctuator&&("="===(u=m.value)||"*="===u||"/="===u||"%="===u||"+="===u||"-="===u||"<<="===u||">>="===u||">>>="===u||"&="===u||"^="===u||"|="===u)&&(ne(n)||X({},a.InvalidLHSInAssignment),c&&n.type===i.Identifier&&S(n.name)&&X(e,a.StrictLHSAssignment),e=q(),r=me(),o=g.markEnd(g.createAssignmentExpression(e.value,n,r),s)),o}function ye(){var e,t=m;if(e=me(),Q(",")){for(e=g.createSequenceExpression([e]);f",n[t.Identifier]="Identifier",n[t.Keyword]="Keyword",n[t.NullLiteral]="Null",n[t.NumericLiteral]="Numeric",n[t.Punctuator]="Punctuator",n[t.StringLiteral]="String",n[t.RegularExpression]="RegularExpression",r=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],i={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},o={Data:1,Get:2,Set:4},a={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},s={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},u={name:"SyntaxTree",processComment:function(e){var t,n;if(!(e.type===i.Program&&e.body.length>0)){for(v.trailingComments.length>0?v.trailingComments[0].range[0]>=e.range[1]?(n=v.trailingComments,v.trailingComments=[]):v.trailingComments.length=0:v.bottomRightStack.length>0&&v.bottomRightStack[v.bottomRightStack.length-1].trailingComments&&v.bottomRightStack[v.bottomRightStack.length-1].trailingComments[0].range[0]>=e.range[1]&&(n=v.bottomRightStack[v.bottomRightStack.length-1].trailingComments,delete v.bottomRightStack[v.bottomRightStack.length-1].trailingComments);v.bottomRightStack.length>0&&v.bottomRightStack[v.bottomRightStack.length-1].range[0]>=e.range[0];)t=v.bottomRightStack.pop();t?t.leadingComments&&t.leadingComments[t.leadingComments.length-1].range[1]<=e.range[0]&&(e.leadingComments=t.leadingComments,delete t.leadingComments):v.leadingComments.length>0&&v.leadingComments[v.leadingComments.length-1].range[1]<=e.range[0]&&(e.leadingComments=v.leadingComments,v.leadingComments=[]),n&&(e.trailingComments=n),v.bottomRightStack.push(e)}},markEnd:function(e,t){return v.range&&(e.range=[t.start,f]),v.loc&&(e.loc=new G(void 0===t.startLineNumber?t.lineNumber:t.startLineNumber,t.start-(void 0===t.startLineStart?t.lineStart:t.startLineStart),d,f-h),this.postProcess(e)),v.attachComment&&this.processComment(e),e},postProcess:function(e){return v.source&&(e.loc.source=v.source),e},createArrayExpression:function(e){return{type:i.ArrayExpression,elements:e}},createAssignmentExpression:function(e,t,n){return{type:i.AssignmentExpression,operator:e,left:t,right:n}},createBinaryExpression:function(e,t,n){return{type:"||"===e||"&&"===e?i.LogicalExpression:i.BinaryExpression,operator:e,left:t,right:n}},createBlockStatement:function(e){return{type:i.BlockStatement,body:e}},createBreakStatement:function(e){return{type:i.BreakStatement,label:e}},createCallExpression:function(e,t){return{type:i.CallExpression,callee:e,arguments:t}},createCatchClause:function(e,t){return{type:i.CatchClause,param:e,body:t}},createConditionalExpression:function(e,t,n){return{type:i.ConditionalExpression,test:e,consequent:t,alternate:n}},createContinueStatement:function(e){return{type:i.ContinueStatement,label:e}},createDebuggerStatement:function(){return{type:i.DebuggerStatement}},createDoWhileStatement:function(e,t){return{type:i.DoWhileStatement,body:e,test:t}},createEmptyStatement:function(){return{type:i.EmptyStatement}},createExpressionStatement:function(e){return{type:i.ExpressionStatement,expression:e}},createForStatement:function(e,t,n,r){return{type:i.ForStatement,init:e,test:t,update:n,body:r}},createForInStatement:function(e,t,n){return{type:i.ForInStatement,left:e,right:t,body:n,each:!1}},createFunctionDeclaration:function(e,t,n,r){return{type:i.FunctionDeclaration,id:e,params:t,defaults:n,body:r,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(e,t,n,r){return{type:i.FunctionExpression,id:e,params:t,defaults:n,body:r,rest:null,generator:!1,expression:!1}},createIdentifier:function(e){return{type:i.Identifier,name:e}},createIfStatement:function(e,t,n){return{type:i.IfStatement,test:e,consequent:t,alternate:n}},createLabeledStatement:function(e,t){return{type:i.LabeledStatement,label:e,body:t}},createLiteral:function(e){return{type:i.Literal,value:e.value,raw:l.slice(e.start,e.end)}},createMemberExpression:function(e,t,n){return{type:i.MemberExpression,computed:"["===e,object:t,property:n}},createNewExpression:function(e,t){return{type:i.NewExpression,callee:e,arguments:t}},createObjectExpression:function(e){return{type:i.ObjectExpression,properties:e}},createPostfixExpression:function(e,t){return{type:i.UpdateExpression,operator:e,argument:t,prefix:!1}},createProgram:function(e){return{type:i.Program,body:e}},createProperty:function(e,t,n){return{type:i.Property,key:t,value:n,kind:e}},createReturnStatement:function(e){return{type:i.ReturnStatement,argument:e}},createSequenceExpression:function(e){return{type:i.SequenceExpression,expressions:e}},createSwitchCase:function(e,t){return{type:i.SwitchCase,test:e,consequent:t}},createSwitchStatement:function(e,t){return{type:i.SwitchStatement,discriminant:e,cases:t}},createThisExpression:function(){return{type:i.ThisExpression}},createThrowStatement:function(e){return{type:i.ThrowStatement,argument:e}},createTryStatement:function(e,t,n,r){return{type:i.TryStatement,block:e,guardedHandlers:t,handlers:n,finalizer:r}},createUnaryExpression:function(e,t){return"++"===e||"--"===e?{type:i.UpdateExpression,operator:e,argument:t,prefix:!0}:{type:i.UnaryExpression,operator:e,argument:t,prefix:!0}},createVariableDeclaration:function(e,t){return{type:i.VariableDeclaration,declarations:e,kind:t}},createVariableDeclarator:function(e,t){return{type:i.VariableDeclarator,id:e,init:t}},createWhileStatement:function(e,t){return{type:i.WhileStatement,test:e,body:t}},createWithStatement:function(e,t){return{type:i.WithStatement,object:e,body:t}}},e.version="1.2.5",e.tokenize=function(e,n){var r;"string"==typeof e||e instanceof String||(e=String(e)),g=u,f=0,d=(l=e).length>0?1:0,h=0,p=l.length,m=null,y={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},v={},(n=n||{}).tokens=!0,v.tokens=[],v.tokenize=!0,v.openParenToken=-1,v.openCurlyToken=-1,v.range="boolean"==typeof n.range&&n.range,v.loc="boolean"==typeof n.loc&&n.loc,"boolean"==typeof n.comment&&n.comment&&(v.comments=[]),"boolean"==typeof n.tolerant&&n.tolerant&&(v.errors=[]);try{if(W(),m.type===t.EOF)return v.tokens;for(q();m.type!==t.EOF;)try{q()}catch(e){if(v.errors){v.errors.push(e);break}throw e}je(),r=v.tokens,void 0!==v.comments&&(r.comments=v.comments),void 0!==v.errors&&(r.errors=v.errors)}catch(e){throw e}finally{v={}}return r},e.parse=function(e,t){var n,r;r=String,"string"==typeof e||e instanceof String||(e=r(e)),g=u,f=0,d=(l=e).length>0?1:0,h=0,p=l.length,m=null,y={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},v={},void 0!==t&&(v.range="boolean"==typeof t.range&&t.range,v.loc="boolean"==typeof t.loc&&t.loc,v.attachComment="boolean"==typeof t.attachComment&&t.attachComment,v.loc&&null!==t.source&&void 0!==t.source&&(v.source=r(t.source)),"boolean"==typeof t.tokens&&t.tokens&&(v.tokens=[]),"boolean"==typeof t.comment&&t.comment&&(v.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(v.errors=[]),v.attachComment&&(v.range=!0,v.comments=[],v.bottomRightStack=[],v.trailingComments=[],v.leadingComments=[]));try{n=Fe(),void 0!==v.comments&&(n.comments=v.comments),void 0!==v.tokens&&(je(),n.tokens=v.tokens),void 0!==v.errors&&(n.errors=v.errors)}catch(e){throw e}finally{v={}}return n},e.Syntax=function(){var e,t={};for(e in"function"==typeof Object.create&&(t=Object.create(null)),i)i.hasOwnProperty(e)&&(t[e]=i[e]);return"function"==typeof Object.freeze&&Object.freeze(t),t}()},void 0===(r=n.apply(t,[t]))||(e.exports=r)}()},63:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){var a=o[i];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}},35:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n,r="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(n=t.cmp,function(e){return function(t,r){var i={key:t,value:e[t]},o={key:r,value:e[r]};return n(i,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var n,a;if(Array.isArray(t)){for(a="[",n=0;n{"use strict";e.exports=function(e){for(var t=new Array(e),n=0;n{function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},474:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decompress=void 0;const r=n(591),i=n(51);t.decompress={zlib:e=>r.inflate(new Uint8Array(e)).buffer,lz4:e=>i.decompress(new Uint8Array(e)).buffer}},200:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=t.decompress=t.rowProxy=t.table_serialization=t.EchoTableWidgetView=t.EchoTableWidgetModel=t.TableWidgetModel=void 0;var r=n(811);Object.defineProperty(t,"TableWidgetModel",{enumerable:!0,get:function(){return r.TableWidgetModel}}),Object.defineProperty(t,"EchoTableWidgetModel",{enumerable:!0,get:function(){return r.EchoTableWidgetModel}}),Object.defineProperty(t,"EchoTableWidgetView",{enumerable:!0,get:function(){return r.EchoTableWidgetView}});var i=n(944);Object.defineProperty(t,"table_serialization",{enumerable:!0,get:function(){return i.table_serialization}}),Object.defineProperty(t,"rowProxy",{enumerable:!0,get:function(){return i.rowProxy}});var o=n(474);Object.defineProperty(t,"decompress",{enumerable:!0,get:function(){return o.decompress}}),t.version=n(485).version},944:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.table_serialization=t.tableToJSON=t.rowProxy=t.JSONToTable=void 0;const r=n(861),i=n(474),o={bool:Uint8Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,float32:Float32Array,float64:Float64Array,str:Array},a=Symbol("rowIndex");function s(e,t){if(null===e)return null;var n={},a=1/0;let s,u=new TextDecoder("utf-8");for(const[t,l]of Object.entries(e.data))if(void 0!==l.compression){let e=l.buffer;if(s=i.decompress[l.compression](e.buffer),"str"===l.dtype){let e=s,r=u.decode(e),i=JSON.parse(r);n[t]=i}else n[t]=r(new o[l.dtype](s),l.shape),a=Math.min(a,l.shape[0])}else if("str"===l.dtype){let e=l.buffer;n[t]=e,a=Math.min(a,e.length)}else{let e=l.buffer;n[t]=r(new o[l.dtype](e.buffer),l.shape),a=Math.min(a,l.shape[0])}return{columns:e.columns,data:n,size:a}}function u(e,t){return null}t.JSONToTable=s,t.rowProxy=function(e){if(null===e)return null;var t=e.columns,n={};return t.forEach((t=>{const r=e.data[t],i=r,o=r;n.hasOwnProperty(t)||(void 0===i.shape?Object.defineProperty(n,t,{get:function(){const e=this[a];return o[e]},set:function(){throw Error("Arrow field values can not be overwritten.")},enumerable:!0}):Object.defineProperty(n,t,{get:function(){const e=this[a],t=i.get(e);return isNaN(t)?null:t},set:function(){throw Error("Arrow field values can not be overwritten.")},enumerable:!0}))})),e=>{var t=Object.create(n);return t[a]=e,t}},t.tableToJSON=u,t.table_serialization={deserialize:s,serialize:u}},811:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.EchoTableWidgetView=t.EchoTableWidgetModel=t.TableWidgetModel=void 0;const i=n(146),o=n(861),a=n(149),s=n(944);let u=n(485).version;class l extends i.DOMWidgetModel{defaults(){return Object.assign(Object.assign({},i.DOMWidgetModel.prototype.defaults()),{_model_name:"TableWidgetModel",_view_name:null,_model_module:"jupyter-tablewidgets",_view_module:null,_model_module_version:u,_view_module_version:"",_table:o([]),_columns:[]})}}t.TableWidgetModel=l,l.serializers=Object.assign(Object.assign({},i.DOMWidgetModel.serializers),{_table:s.table_serialization});class c extends i.DOMWidgetModel{defaults(){return Object.assign(Object.assign({},i.DOMWidgetModel.prototype.defaults()),{_model_name:"EchoTableWidgetModel",_view_name:"EchoTableWidgetView",_model_module:"jupyter-tablewidgets",_view_module:"jupyter-tablewidgets",_model_module_version:u,_view_module_version:u,data:[],echo:[]})}}t.EchoTableWidgetModel=c,c.serializers=Object.assign(Object.assign({},i.DOMWidgetModel.serializers),{data:{deserialize:i.unpack_models}});class f extends i.DOMWidgetView{render(){return r(this,void 0,void 0,(function*(){let e=this.model,t=e.get("data").get("_table"),n={columns:t.columns,data:{}};for(const[e,r]of Object.entries(t.data)){let t=r;void 0!==t.dtype?n.data[e]=a(t):n.data[e]=t}e.set("echo",n),this.touch()}))}}t.EchoTableWidgetView=f},51:(e,t,n)=>{var r=n(887),i=n(325),o=65536,a=f(5<<20),s=function(){try{return new Uint32Array(o)}catch(n){for(var e=new Array(o),t=0;t>4&7;if(void 0===c[a])throw new Error("invalid block size "+a);var s=c[a];if(o)return i.readU64(e,t);t++;for(var f=0;;){var d=i.readU32(e,t);if(t+=4,f+=d&l?d&=2147483647:s,0===d)return f;r&&(t+=4),t+=d}},t.makeBuffer=f,t.decompressBlock=function(e,t,n,r,i){var o,a,s,u,l;for(s=n+r;n>4;if(f>0){if(15===f)for(;f+=e[n],255===e[n++];);for(u=n+f;n=s)break;if(o=15&c,a=e[n++]|e[n++]<<8,15===o)for(;o+=e[n],255===e[n++];);for(u=(l=i-a)+(o+=4);l=13)for(var p=67;n+4>>0;if(a=o[m=(m>>16^m)>>>0&65535]-1,o[m]=n+1,a<0||n-a>>>16>0||i.readU32(e,a)!==g)n+=p++>>6;else{for(p=67,c=n-s,l=n-a,a+=4,u=n+=4;n=15){for(t[f++]=240+y,h=c-15;h>=255;h-=255)t[f++]=255;t[f++]=h}else t[f++]=(c<<4)+y;for(var v=0;v>8,u>=15){for(h=u-15;h>=255;h-=255)t[f++]=255;t[f++]=h}s=n}}if(0===s)return 0;if((c=d-s)>=15){for(t[f++]=240,h=c-15;h>=255;h-=255)t[f++]=255;t[f++]=h}else t[f++]=c<<4;for(n=s;n>4&7;if(void 0===c[h])throw new Error("invalid block size");for(a&&(f+=8),f++;;){var p;if(p=i.readU32(e,f),f+=4,0===p)break;if(r&&(f+=4),0!=(p&l)){p&=2147483647;for(var g=0;g>8,l++;var f=c[7],d=e.length,h=0;for(function(e){for(var t=0;t0;){var p,g=d>f?f:d;if((p=t.compressBlock(e,a,h,g,s))>g||0===p){i.writeU32(n,l,2147483648|g),l+=4;for(var m=h+g;h{t.hashU32=function(e){return-1252372727^(e=(e=(e=374761393+(e=-949894596^(e=2127912214+(e|=0)+(e<<12)|0)^e>>>19)+(e<<5)|0)-744332180^e<<9)-42973499+(e<<3)|0)^e>>>16|0},t.readU64=function(e,t){var n=0;return n|=e[t++]<<0,n|=e[t++]<<8,n|=e[t++]<<16,n|=e[t++]<<24,n|=e[t++]<<32,n|=e[t++]<<40,(n|=e[t++]<<48)|e[t++]<<56},t.readU32=function(e,t){var n=0;return n|=e[t++]<<0,n|=e[t++]<<8,(n|=e[t++]<<16)|e[t++]<<24},t.writeU32=function(e,t,n){e[t++]=n>>0&255,e[t++]=n>>8&255,e[t++]=n>>16&255,e[t++]=n>>24&255},t.imul=function(e,t){var n=65535&e,r=65535&t;return n*r+((e>>>16)*r+n*(t>>>16)<<16)|0}},887:(e,t,n)=>{var r=n(325),i=2654435761,o=2246822519,a=3266489917,s=374761393;function u(e,t){return(e|=0)>>>(32-(t|=0)|0)|e<>>(32-t|0)|e<>>(t|=0)^e|0}function f(e,t,n,i,o){return l(r.imul(t,n)+e,i,o)}function d(e,t,n){return l(e+r.imul(t[n],s),11,i)}function h(e,t,n){return f(e,r.readU32(t,n),a,17,668265263)}function p(e,t,n){return[f(e[0],r.readU32(t,n+0),o,13,i),f(e[1],r.readU32(t,n+4),o,13,i),f(e[2],r.readU32(t,n+8),o,13,i),f(e[3],r.readU32(t,n+12),o,13,i)]}t.hash=function(e,t,n,l){var f,g;if(g=l,l>=16){for(f=[e+i+o,e+o,e,e-i];l>=16;)f=p(f,t,n),n+=16,l-=16;f=u(f[0],1)+u(f[1],7)+u(f[2],12)+u(f[3],18)+g}else f=e+s+l>>>0;for(;l>=4;)f=h(f,t,n),n+=4,l-=4;for(;l>0;)f=d(f,t,n),n++,l--;return(f=c(r.imul(c(r.imul(c(f,15),o),13),a),16))>>>0}},149:(e,t,n)=>{"use strict";var r=n(841),i=n(780)({args:["array","scalar","index"],body:function(e,t,n){var r,i=t;for(r=0;r{var r=n(907),i=n(738),o="undefined"!=typeof Float64Array;function a(e,t){return e[0]-t[0]}function s(){var e,t=this.stride,n=new Array(t.length);for(e=0;eMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===t&&o.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push("proto.set=function "+n+"_set("+u.join(",")+",v){"),i?o.push("return this.data.set("+c+",v)}"):o.push("return this.data["+c+"]=v}"),o.push("proto.get=function "+n+"_get("+u.join(",")+"){"),i?o.push("return this.data.get("+c+")}"):o.push("return this.data["+c+"]}"),o.push("proto.index=function "+n+"_index(",u.join(),"){return "+c+"}"),o.push("proto.hi=function "+n+"_hi("+u.join(",")+"){return new "+n+"(this.data,"+a.map((function(e){return["(typeof i",e,"!=='number'||i",e,"<0)?this.shape[",e,"]:i",e,"|0"].join("")})).join(",")+","+a.map((function(e){return"this.stride["+e+"]"})).join(",")+",this.offset)}");var h=a.map((function(e){return"a"+e+"=this.shape["+e+"]"})),p=a.map((function(e){return"c"+e+"=this.stride["+e+"]"}));o.push("proto.lo=function "+n+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+h.join(",")+","+p.join(","));for(var g=0;g=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");for(o.push("return new "+n+"(this.data,"+a.map((function(e){return"a"+e})).join(",")+","+a.map((function(e){return"c"+e})).join(",")+",b)}"),o.push("proto.step=function "+n+"_step("+u.join(",")+"){var "+a.map((function(e){return"a"+e+"=this.shape["+e+"]"})).join(",")+","+a.map((function(e){return"b"+e+"=this.stride["+e+"]"})).join(",")+",c=this.offset,d=0,ceil=Math.ceil"),g=0;g=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");return o.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),o.push("return function construct_"+n+"(data,shape,stride,offset){return new "+n+"(data,"+a.map((function(e){return"shape["+e+"]"})).join(",")+","+a.map((function(e){return"stride["+e+"]"})).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",o.join("\n"))(l[e],s)}var l={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};e.exports=function(e,t,n,r){if(void 0===e)return(0,l.array[0])([]);"number"==typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var a=t.length;if(void 0===n){n=new Array(a);for(var s=a-1,c=1;s>=0;--s)n[s]=c,c*=t[s]}if(void 0===r)for(r=0,s=0;s{"use strict";const{Deflate:r,deflate:i,deflateRaw:o,gzip:a}=n(555),{Inflate:s,inflate:u,inflateRaw:l,ungzip:c}=n(843),f=n(619);e.exports.Deflate=r,e.exports.deflate=i,e.exports.deflateRaw=o,e.exports.gzip=a,e.exports.Inflate=s,e.exports.inflate=u,e.exports.inflateRaw=l,e.exports.ungzip=c,e.exports.constants=f},555:(e,t,n)=>{"use strict";const r=n(405),i=n(236),o=n(373),a=n(898),s=n(292),u=Object.prototype.toString,{Z_NO_FLUSH:l,Z_SYNC_FLUSH:c,Z_FULL_FLUSH:f,Z_FINISH:d,Z_OK:h,Z_STREAM_END:p,Z_DEFAULT_COMPRESSION:g,Z_DEFAULT_STRATEGY:m,Z_DEFLATED:y}=n(619);function v(e){this.options=i.assign({level:g,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:m},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;let n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==h)throw new Error(a[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,n=r.deflateSetDictionary(this.strm,e),n!==h)throw new Error(a[n]);this._dict_set=!0}}function b(e,t){const n=new v(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}v.prototype.push=function(e,t){const n=this.strm,i=this.options.chunkSize;let a,s;if(this.ended)return!1;for(s=t===~~t?t:!0===t?d:l,"string"==typeof e?n.input=o.string2buf(e):"[object ArrayBuffer]"===u.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),(s===c||s===f)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(a=r.deflate(n,s),a===p)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),a=r.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===h;if(0!==n.avail_out){if(s>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},v.prototype.onData=function(e){this.chunks.push(e)},v.prototype.onEnd=function(e){e===h&&(this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},e.exports.Deflate=v,e.exports.deflate=b,e.exports.deflateRaw=function(e,t){return(t=t||{}).raw=!0,b(e,t)},e.exports.gzip=function(e,t){return(t=t||{}).gzip=!0,b(e,t)},e.exports.constants=n(619)},843:(e,t,n)=>{"use strict";const r=n(948),i=n(236),o=n(373),a=n(898),s=n(292),u=n(401),l=Object.prototype.toString,{Z_NO_FLUSH:c,Z_FINISH:f,Z_OK:d,Z_STREAM_END:h,Z_NEED_DICT:p,Z_STREAM_ERROR:g,Z_DATA_ERROR:m,Z_MEM_ERROR:y}=n(619);function v(e){this.options=i.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;let n=r.inflateInit2(this.strm,t.windowBits);if(n!==d)throw new Error(a[n]);if(this.header=new u,r.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=r.inflateSetDictionary(this.strm,t.dictionary),n!==d)))throw new Error(a[n])}function b(e,t){const n=new v(t);if(n.push(e),n.err)throw n.msg||a[n.err];return n.result}v.prototype.push=function(e,t){const n=this.strm,i=this.options.chunkSize,a=this.options.dictionary;let s,u,v;if(this.ended)return!1;for(u=t===~~t?t:!0===t?f:c,"[object ArrayBuffer]"===l.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),s=r.inflate(n,u),s===p&&a&&(s=r.inflateSetDictionary(n,a),s===d?s=r.inflate(n,u):s===m&&(s=p));n.avail_in>0&&s===h&&n.state.wrap>0&&0!==e[n.next_in];)r.inflateReset(n),s=r.inflate(n,u);switch(s){case g:case m:case p:case y:return this.onEnd(s),this.ended=!0,!1}if(v=n.avail_out,n.next_out&&(0===n.avail_out||s===h))if("string"===this.options.to){let e=o.utf8border(n.output,n.next_out),t=n.next_out-e,r=o.buf2string(n.output,e);n.next_out=t,n.avail_out=i-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(r)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(s!==d||0!==v){if(s===h)return s=r.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},v.prototype.onData=function(e){this.chunks.push(e)},v.prototype.onEnd=function(e){e===d&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},e.exports.Inflate=v,e.exports.inflate=b,e.exports.inflateRaw=function(e,t){return(t=t||{}).raw=!0,b(e,t)},e.exports.ungzip=b,e.exports.constants=n(619)},236:e=>{"use strict";const t=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);e.exports.assign=function(e){const n=Array.prototype.slice.call(arguments,1);for(;n.length;){const r=n.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const n in r)t(r,n)&&(e[n]=r[n])}}return e},e.exports.flattenChunks=e=>{let t=0;for(let n=0,r=e.length;n{"use strict";let t=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){t=!1}const n=new Uint8Array(256);for(let e=0;e<256;e++)n[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;n[254]=n[254]=1,e.exports.string2buf=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,r,i,o,a=e.length,s=0;for(i=0;i>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},e.exports.buf2string=(e,r)=>{const i=r||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,r));let o,a;const s=new Array(2*i);for(a=0,o=0;o4)s[a++]=65533,o+=r-1;else{for(t&=2===r?31:3===r?15:7;r>1&&o1?s[a++]=65533:t<65536?s[a++]=t:(t-=65536,s[a++]=55296|t>>10&1023,s[a++]=56320|1023&t)}}return((e,n)=>{if(n<65534&&e.subarray&&t)return String.fromCharCode.apply(null,e.length===n?e:e.subarray(0,n));let r="";for(let t=0;t{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+n[e[r]]>t?r:t}},69:e=>{"use strict";e.exports=(e,t,n,r)=>{let i=65535&e|0,o=e>>>16&65535|0,a=0;for(;0!==n;){a=n>2e3?2e3:n,n-=a;do{i=i+t[r++]|0,o=o+i|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},619:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},869:e=>{"use strict";const t=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());e.exports=(e,n,r,i)=>{const o=t,a=i+r;e^=-1;for(let t=i;t>>8^o[255&(e^n[t])];return-1^e}},405:(e,t,n)=>{"use strict";const{_tr_init:r,_tr_stored_block:i,_tr_flush_block:o,_tr_tally:a,_tr_align:s}=n(342),u=n(69),l=n(869),c=n(898),{Z_NO_FLUSH:f,Z_PARTIAL_FLUSH:d,Z_FULL_FLUSH:h,Z_FINISH:p,Z_BLOCK:g,Z_OK:m,Z_STREAM_END:y,Z_STREAM_ERROR:v,Z_DATA_ERROR:b,Z_BUF_ERROR:x,Z_DEFAULT_COMPRESSION:_,Z_FILTERED:w,Z_HUFFMAN_ONLY:k,Z_RLE:A,Z_FIXED:E,Z_DEFAULT_STRATEGY:O,Z_UNKNOWN:D,Z_DEFLATED:S}=n(619),C=258,F=262,j=42,M=113,$=666,N=(e,t)=>(e.msg=c[t],t),B=e=>2*e-(e>4?9:0),T=e=>{let t=e.length;for(;--t>=0;)e[t]=0},z=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do{n=e.head[--r],e.head[r]=n>=i?n-i:0}while(--t);t=i,r=t;do{n=e.prev[--r],e.prev[r]=n>=i?n-i:0}while(--t)};let R=(e,t,n)=>(t<{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))},L=(e,t)=>{o(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,P(e.strm)},I=(e,t)=>{e.pending_buf[e.pending++]=t},U=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},q=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),1===e.state.wrap?e.adler=u(e.adler,t,i,n):2===e.state.wrap&&(e.adler=l(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},W=(e,t)=>{let n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match;const u=e.strstart>e.w_size-F?e.strstart-(e.w_size-F):0,l=e.window,c=e.w_mask,f=e.prev,d=e.strstart+C;let h=l[o+a-1],p=l[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(n=t,l[n+a]===p&&l[n+a-1]===h&&l[n]===l[o]&&l[++n]===l[o+1]){o+=2,n++;do{}while(l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&oa){if(e.match_start=t,a=r,r>=s)break;h=l[o+a-1],p=l[o+a]}}}while((t=f[t&c])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead},H=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-F)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),z(e),r+=t),0===e.strm.avail_in)break;if(n=q(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=R(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=R(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead{let n,r,o,a=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,u=e.strm.avail_in;do{if(n=65535,o=e.bi_valid+42>>3,e.strm.avail_outr+e.strm.avail_in&&(n=r+e.strm.avail_in),n>o&&(n=o),n>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,P(e.strm),r&&(r>n&&(r=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,n-=r),n&&(q(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(0===s);return u-=e.strm.avail_in,u&&(u>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=u&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-u,e.strm.next_in),e.strstart),e.strstart+=u,e.insert+=u>e.w_size-e.insert?e.w_size-e.insert:u),e.block_start=e.strstart),e.high_watero&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(q(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,a=o>e.w_size?e.w_size:o,r=e.strstart-e.block_start,(r>=a||(r||t===p)&&t!==f&&0===e.strm.avail_in&&r<=o)&&(n=r>o?o:r,s=t===p&&0===e.strm.avail_in&&n===r?1:0,i(e,e.block_start,n,s),e.block_start+=n,P(e.strm)),s?3:1)},V=(e,t)=>{let n,r;for(;;){if(e.lookahead=3&&(e.ins_h=R(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-F&&(e.match_length=W(e,n)),e.match_length>=3)if(r=a(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=R(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=R(e,e.ins_h,e.window[e.strstart+1]);else r=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(L(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===p?(L(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(L(e,!1),0===e.strm.avail_out)?1:2},Y=(e,t)=>{let n,r,i;for(;;){if(e.lookahead=3&&(e.ins_h=R(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,r=a(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=R(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(L(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=a(e,0,e.window[e.strstart-1]),r&&L(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=a(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===p?(L(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(L(e,!1),0===e.strm.avail_out)?1:2};function X(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const Z=[new X(0,0,0,0,G),new X(4,4,8,4,V),new X(4,5,16,8,V),new X(4,6,32,32,V),new X(4,4,16,16,Y),new X(8,16,32,32,Y),new X(8,16,128,128,Y),new X(8,32,128,256,Y),new X(32,128,258,1024,Y),new X(32,258,258,4096,Y)];function J(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=S,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),T(this.dyn_ltree),T(this.dyn_dtree),T(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),T(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),T(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const K=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==j&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==M&&t.status!==$?1:0},Q=e=>{if(K(e))return N(e,v);e.total_in=e.total_out=0,e.data_type=D;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?j:M,e.adler=2===t.wrap?0:1,t.last_flush=-2,r(t),m},ee=e=>{const t=Q(e);var n;return t===m&&((n=e.state).window_size=2*n.w_size,T(n.head),n.max_lazy_match=Z[n.level].max_lazy,n.good_match=Z[n.level].good_length,n.nice_match=Z[n.level].nice_length,n.max_chain_length=Z[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),t},te=(e,t,n,r,i,o)=>{if(!e)return v;let a=1;if(t===_&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>9||n!==S||r<8||r>15||t<0||t>9||o<0||o>E||8===r&&1!==a)return N(e,v);8===r&&(r=9);const s=new J;return e.state=s,s.strm=e,s.status=j,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<te(e,t,S,15,8,O),e.exports.deflateInit2=te,e.exports.deflateReset=ee,e.exports.deflateResetKeep=Q,e.exports.deflateSetHeader=(e,t)=>K(e)||2!==e.state.wrap?v:(e.state.gzhead=t,m),e.exports.deflate=(e,t)=>{if(K(e)||t>g||t<0)return e?N(e,v):v;const n=e.state;if(!e.output||0!==e.avail_in&&!e.input||n.status===$&&t!==p)return N(e,0===e.avail_out?x:v);const r=n.last_flush;if(n.last_flush=t,0!==n.pending){if(P(e),0===e.avail_out)return n.last_flush=-1,m}else if(0===e.avail_in&&B(t)<=B(r)&&t!==p)return N(e,x);if(n.status===$&&0!==e.avail_in)return N(e,x);if(n.status===j&&0===n.wrap&&(n.status=M),n.status===j){let t=S+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=k||n.level<2?0:n.level<6?1:6===n.level?2:3,t|=r<<6,0!==n.strstart&&(t|=32),t+=31-t%31,U(n,t),0!==n.strstart&&(U(n,e.adler>>>16),U(n,65535&e.adler)),e.adler=1,n.status=M,P(e),0!==n.pending)return n.last_flush=-1,m}if(57===n.status)if(e.adler=0,I(n,31),I(n,139),I(n,8),n.gzhead)I(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),I(n,255&n.gzhead.time),I(n,n.gzhead.time>>8&255),I(n,n.gzhead.time>>16&255),I(n,n.gzhead.time>>24&255),I(n,9===n.level?2:n.strategy>=k||n.level<2?4:0),I(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(I(n,255&n.gzhead.extra.length),I(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=l(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(I(n,0),I(n,0),I(n,0),I(n,0),I(n,0),I(n,9===n.level?2:n.strategy>=k||n.level<2?4:0),I(n,3),n.status=M,P(e),0!==n.pending)return n.last_flush=-1,m;if(69===n.status){if(n.gzhead.extra){let t=n.pending,r=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=l(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,P(e),0!==n.pending)return n.last_flush=-1,m;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=l(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=l(e.adler,n.pending_buf,n.pending-r,r)),P(e),0!==n.pending)return n.last_flush=-1,m;r=0}t=n.gzindexr&&(e.adler=l(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=l(e.adler,n.pending_buf,n.pending-r,r)),P(e),0!==n.pending)return n.last_flush=-1,m;r=0}t=n.gzindexr&&(e.adler=l(e.adler,n.pending_buf,n.pending-r,r))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(P(e),0!==n.pending))return n.last_flush=-1,m;I(n,255&e.adler),I(n,e.adler>>8&255),e.adler=0}if(n.status=M,P(e),0!==n.pending)return n.last_flush=-1,m}if(0!==e.avail_in||0!==n.lookahead||t!==f&&n.status!==$){let r=0===n.level?G(n,t):n.strategy===k?((e,t)=>{let n;for(;;){if(0===e.lookahead&&(H(e),0===e.lookahead)){if(t===f)return 1;break}if(e.match_length=0,n=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(L(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===p?(L(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(L(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===A?((e,t)=>{let n,r,i,o;const s=e.window;for(;;){if(e.lookahead<=C){if(H(e),e.lookahead<=C&&t===f)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,r=s[i],r===s[++i]&&r===s[++i]&&r===s[++i])){o=e.strstart+C;do{}while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=a(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(L(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===p?(L(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(L(e,!1),0===e.strm.avail_out)?1:2})(n,t):Z[n.level].func(n,t);if(3!==r&&4!==r||(n.status=$),1===r||3===r)return 0===e.avail_out&&(n.last_flush=-1),m;if(2===r&&(t===d?s(n):t!==g&&(i(n,0,0,!1),t===h&&(T(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),P(e),0===e.avail_out))return n.last_flush=-1,m}return t!==p?m:n.wrap<=0?y:(2===n.wrap?(I(n,255&e.adler),I(n,e.adler>>8&255),I(n,e.adler>>16&255),I(n,e.adler>>24&255),I(n,255&e.total_in),I(n,e.total_in>>8&255),I(n,e.total_in>>16&255),I(n,e.total_in>>24&255)):(U(n,e.adler>>>16),U(n,65535&e.adler)),P(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?m:y)},e.exports.deflateEnd=e=>{if(K(e))return v;const t=e.state.status;return e.state=null,t===M?N(e,b):m},e.exports.deflateSetDictionary=(e,t)=>{let n=t.length;if(K(e))return v;const r=e.state,i=r.wrap;if(2===i||1===i&&r.status!==j||r.lookahead)return v;if(1===i&&(e.adler=u(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){0===i&&(T(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,H(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=R(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,H(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,r.wrap=i,m},e.exports.deflateInfo="pako deflate (from Nodeca project)"},401:e=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},264:e=>{"use strict";const t=16209;e.exports=function(e,n){let r,i,o,a,s,u,l,c,f,d,h,p,g,m,y,v,b,x,_,w,k,A,E,O;const D=e.state;r=e.next_in,E=e.input,i=r+(e.avail_in-5),o=e.next_out,O=e.output,a=o-(n-e.avail_out),s=o+(e.avail_out-257),u=D.dmax,l=D.wsize,c=D.whave,f=D.wnext,d=D.window,h=D.hold,p=D.bits,g=D.lencode,m=D.distcode,y=(1<>>24,h>>>=x,p-=x,x=b>>>16&255,0===x)O[o++]=65535&b;else{if(!(16&x)){if(0==(64&x)){b=g[(65535&b)+(h&(1<>>=x,p-=x),p<15&&(h+=E[r++]<>>24,h>>>=x,p-=x,x=b>>>16&255,!(16&x)){if(0==(64&x)){b=m[(65535&b)+(h&(1<u){e.msg="invalid distance too far back",D.mode=t;break e}if(h>>>=x,p-=x,x=o-a,w>x){if(x=w-x,x>c&&D.sane){e.msg="invalid distance too far back",D.mode=t;break e}if(k=0,A=d,0===f){if(k+=l-x,x<_){_-=x;do{O[o++]=d[k++]}while(--x);k=o-w,A=O}}else if(f2;)O[o++]=A[k++],O[o++]=A[k++],O[o++]=A[k++],_-=3;_&&(O[o++]=A[k++],_>1&&(O[o++]=A[k++]))}else{k=o-w;do{O[o++]=O[k++],O[o++]=O[k++],O[o++]=O[k++],_-=3}while(_>2);_&&(O[o++]=O[k++],_>1&&(O[o++]=O[k++]))}break}}break}}while(r>3,r-=_,p-=_<<3,h&=(1<{"use strict";const r=n(69),i=n(869),o=n(264),a=n(241),{Z_FINISH:s,Z_BLOCK:u,Z_TREES:l,Z_OK:c,Z_STREAM_END:f,Z_NEED_DICT:d,Z_STREAM_ERROR:h,Z_DATA_ERROR:p,Z_MEM_ERROR:g,Z_BUF_ERROR:m,Z_DEFLATED:y}=n(619),v=16180,b=16190,x=16191,_=16192,w=16194,k=16199,A=16200,E=16206,O=16209,D=16210,S=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function C(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const F=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode16211?1:0},j=e=>{if(F(e))return h;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=v,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,c},M=e=>{if(F(e))return h;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,j(e)},$=(e,t)=>{let n;if(F(e))return h;const r=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?h:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,M(e))},N=(e,t)=>{if(!e)return h;const n=new C;e.state=n,n.strm=e,n.window=null,n.mode=v;const r=$(e,t);return r!==c&&(e.state=null),r};let B,T,z=!0;const R=e=>{if(z){B=new Int32Array(512),T=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(1,e.lens,0,288,B,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(2,e.lens,0,32,T,0,e.work,{bits:5}),z=!1}e.lencode=B,e.lenbits=9,e.distcode=T,e.distbits=5},P=(e,t,n,r)=>{let i;const o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),o.window.set(t.subarray(n-r,n-r+i),o.wnext),(r-=i)?(o.window.set(t.subarray(n-r,n),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whaveN(e,15),e.exports.inflateInit2=N,e.exports.inflate=(e,t)=>{let n,C,j,M,$,N,B,T,z,L,I,U,q,W,H,G,V,Y,X,Z,J,K,Q=0;const ee=new Uint8Array(4);let te,ne;const re=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(F(e)||!e.output||!e.input&&0!==e.avail_in)return h;n=e.state,n.mode===x&&(n.mode=_),$=e.next_out,j=e.output,B=e.avail_out,M=e.next_in,C=e.input,N=e.avail_in,T=n.hold,z=n.bits,L=N,I=B,K=c;e:for(;;)switch(n.mode){case v:if(0===n.wrap){n.mode=_;break}for(;z<16;){if(0===N)break e;N--,T+=C[M++]<>>8&255,n.check=i(n.check,ee,2,0),T=0,z=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&T)<<8)+(T>>8))%31){e.msg="incorrect header check",n.mode=O;break}if((15&T)!==y){e.msg="unknown compression method",n.mode=O;break}if(T>>>=4,z-=4,J=8+(15&T),0===n.wbits&&(n.wbits=J),J>15||J>n.wbits){e.msg="invalid window size",n.mode=O;break}n.dmax=1<>8&1),512&n.flags&&4&n.wrap&&(ee[0]=255&T,ee[1]=T>>>8&255,n.check=i(n.check,ee,2,0)),T=0,z=0,n.mode=16182;case 16182:for(;z<32;){if(0===N)break e;N--,T+=C[M++]<>>8&255,ee[2]=T>>>16&255,ee[3]=T>>>24&255,n.check=i(n.check,ee,4,0)),T=0,z=0,n.mode=16183;case 16183:for(;z<16;){if(0===N)break e;N--,T+=C[M++]<>8),512&n.flags&&4&n.wrap&&(ee[0]=255&T,ee[1]=T>>>8&255,n.check=i(n.check,ee,2,0)),T=0,z=0,n.mode=16184;case 16184:if(1024&n.flags){for(;z<16;){if(0===N)break e;N--,T+=C[M++]<>>8&255,n.check=i(n.check,ee,2,0)),T=0,z=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(U=n.length,U>N&&(U=N),U&&(n.head&&(J=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(C.subarray(M,M+U),J)),512&n.flags&&4&n.wrap&&(n.check=i(n.check,C,U,M)),N-=U,M+=U,n.length-=U),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===N)break e;U=0;do{J=C[M+U++],n.head&&J&&n.length<65536&&(n.head.name+=String.fromCharCode(J))}while(J&&U>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=x;break;case 16189:for(;z<32;){if(0===N)break e;N--,T+=C[M++]<>>=7&z,z-=7&z,n.mode=E;break}for(;z<3;){if(0===N)break e;N--,T+=C[M++]<>>=1,z-=1,3&T){case 0:n.mode=16193;break;case 1:if(R(n),n.mode=k,t===l){T>>>=2,z-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=O}T>>>=2,z-=2;break;case 16193:for(T>>>=7&z,z-=7&z;z<32;){if(0===N)break e;N--,T+=C[M++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=O;break}if(n.length=65535&T,T=0,z=0,n.mode=w,t===l)break e;case w:n.mode=16195;case 16195:if(U=n.length,U){if(U>N&&(U=N),U>B&&(U=B),0===U)break e;j.set(C.subarray(M,M+U),$),N-=U,M+=U,B-=U,$+=U,n.length-=U;break}n.mode=x;break;case 16196:for(;z<14;){if(0===N)break e;N--,T+=C[M++]<>>=5,z-=5,n.ndist=1+(31&T),T>>>=5,z-=5,n.ncode=4+(15&T),T>>>=4,z-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=O;break}n.have=0,n.mode=16197;case 16197:for(;n.have>>=3,z-=3}for(;n.have<19;)n.lens[re[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,te={bits:n.lenbits},K=a(0,n.lens,0,19,n.lencode,0,n.work,te),n.lenbits=te.bits,K){e.msg="invalid code lengths set",n.mode=O;break}n.have=0,n.mode=16198;case 16198:for(;n.have>>24,G=Q>>>16&255,V=65535&Q,!(H<=z);){if(0===N)break e;N--,T+=C[M++]<>>=H,z-=H,n.lens[n.have++]=V;else{if(16===V){for(ne=H+2;z>>=H,z-=H,0===n.have){e.msg="invalid bit length repeat",n.mode=O;break}J=n.lens[n.have-1],U=3+(3&T),T>>>=2,z-=2}else if(17===V){for(ne=H+3;z>>=H,z-=H,J=0,U=3+(7&T),T>>>=3,z-=3}else{for(ne=H+7;z>>=H,z-=H,J=0,U=11+(127&T),T>>>=7,z-=7}if(n.have+U>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=O;break}for(;U--;)n.lens[n.have++]=J}}if(n.mode===O)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=O;break}if(n.lenbits=9,te={bits:n.lenbits},K=a(1,n.lens,0,n.nlen,n.lencode,0,n.work,te),n.lenbits=te.bits,K){e.msg="invalid literal/lengths set",n.mode=O;break}if(n.distbits=6,n.distcode=n.distdyn,te={bits:n.distbits},K=a(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,te),n.distbits=te.bits,K){e.msg="invalid distances set",n.mode=O;break}if(n.mode=k,t===l)break e;case k:n.mode=A;case A:if(N>=6&&B>=258){e.next_out=$,e.avail_out=B,e.next_in=M,e.avail_in=N,n.hold=T,n.bits=z,o(e,I),$=e.next_out,j=e.output,B=e.avail_out,M=e.next_in,C=e.input,N=e.avail_in,T=n.hold,z=n.bits,n.mode===x&&(n.back=-1);break}for(n.back=0;Q=n.lencode[T&(1<>>24,G=Q>>>16&255,V=65535&Q,!(H<=z);){if(0===N)break e;N--,T+=C[M++]<>Y)],H=Q>>>24,G=Q>>>16&255,V=65535&Q,!(Y+H<=z);){if(0===N)break e;N--,T+=C[M++]<>>=Y,z-=Y,n.back+=Y}if(T>>>=H,z-=H,n.back+=H,n.length=V,0===G){n.mode=16205;break}if(32&G){n.back=-1,n.mode=x;break}if(64&G){e.msg="invalid literal/length code",n.mode=O;break}n.extra=15&G,n.mode=16201;case 16201:if(n.extra){for(ne=n.extra;z>>=n.extra,z-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;Q=n.distcode[T&(1<>>24,G=Q>>>16&255,V=65535&Q,!(H<=z);){if(0===N)break e;N--,T+=C[M++]<>Y)],H=Q>>>24,G=Q>>>16&255,V=65535&Q,!(Y+H<=z);){if(0===N)break e;N--,T+=C[M++]<>>=Y,z-=Y,n.back+=Y}if(T>>>=H,z-=H,n.back+=H,64&G){e.msg="invalid distance code",n.mode=O;break}n.offset=V,n.extra=15&G,n.mode=16203;case 16203:if(n.extra){for(ne=n.extra;z>>=n.extra,z-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=O;break}n.mode=16204;case 16204:if(0===B)break e;if(U=I-B,n.offset>U){if(U=n.offset-U,U>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=O;break}U>n.wnext?(U-=n.wnext,q=n.wsize-U):q=n.wnext-U,U>n.length&&(U=n.length),W=n.window}else W=j,q=$-n.offset,U=n.length;U>B&&(U=B),B-=U,n.length-=U;do{j[$++]=W[q++]}while(--U);0===n.length&&(n.mode=A);break;case 16205:if(0===B)break e;j[$++]=n.length,B--,n.mode=A;break;case E:if(n.wrap){for(;z<32;){if(0===N)break e;N--,T|=C[M++]<{if(F(e))return h;let t=e.state;return t.window&&(t.window=null),e.state=null,c},e.exports.inflateGetHeader=(e,t)=>{if(F(e))return h;const n=e.state;return 0==(2&n.wrap)?h:(n.head=t,t.done=!1,c)},e.exports.inflateSetDictionary=(e,t)=>{const n=t.length;let i,o,a;return F(e)?h:(i=e.state,0!==i.wrap&&i.mode!==b?h:i.mode===b&&(o=1,o=r(o,t,n,0),o!==i.check)?p:(a=P(e,t,n,n),a?(i.mode=D,g):(i.havedict=1,c)))},e.exports.inflateInfo="pako inflate (from Nodeca project)"},241:e=>{"use strict";const t=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),n=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),r=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),i=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);e.exports=(e,o,a,s,u,l,c,f)=>{const d=f.bits;let h,p,g,m,y,v,b=0,x=0,_=0,w=0,k=0,A=0,E=0,O=0,D=0,S=0,C=null;const F=new Uint16Array(16),j=new Uint16Array(16);let M,$,N,B=null;for(b=0;b<=15;b++)F[b]=0;for(x=0;x=1&&0===F[w];w--);if(k>w&&(k=w),0===w)return u[l++]=20971520,u[l++]=20971520,f.bits=1,0;for(_=1;_0&&(0===e||1!==w))return-1;for(j[1]=0,b=1;b<15;b++)j[b+1]=j[b]+F[b];for(x=0;x852||2===e&&D>592)return 1;for(;;){M=b-E,c[x]+1=v?($=B[c[x]-v],N=C[c[x]-v]):($=96,N=0),h=1<>E)+p]=M<<24|$<<16|N|0}while(0!==p);for(h=1<>=1;if(0!==h?(S&=h-1,S+=h):S=0,x++,0==--F[b]){if(b===w)break;b=o[a+c[x]]}if(b>k&&(S&m)!==g){for(0===E&&(E=k),y+=_,A=b-E,O=1<852||2===e&&D>592)return 1;g=S&m,u[g]=k<<24|A<<16|y-l|0}}return 0!==S&&(u[y+S]=b-E<<24|64<<16|0),f.bits=k,0}},898:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},342:e=>{"use strict";function t(e){let t=e.length;for(;--t>=0;)e[t]=0}const n=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),r=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),o=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=new Array(576);t(a);const s=new Array(60);t(s);const u=new Array(512);t(u);const l=new Array(256);t(l);const c=new Array(29);t(c);const f=new Array(30);function d(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let h,p,g;function m(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}t(f);const y=e=>e<256?u[e]:u[256+(e>>>7)],v=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},b=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<{b(e,n[2*t],n[2*t+1])},_=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},w=(e,t,n)=>{const r=new Array(16);let i,o,a=0;for(i=1;i<=15;i++)a=a+n[i-1]<<1,r[i]=a;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=_(r[t]++,t))}},k=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},A=e=>{e.bi_valid>8?v(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},E=(e,t,n,r)=>{const i=2*t,o=2*n;return e[i]{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i{let o,a,s,u,d=0;if(0!==e.sym_next)do{o=255&e.pending_buf[e.sym_buf+d++],o+=(255&e.pending_buf[e.sym_buf+d++])<<8,a=e.pending_buf[e.sym_buf+d++],0===o?x(e,a,t):(s=l[a],x(e,s+256+1,t),u=n[s],0!==u&&(a-=c[s],b(e,a,u)),o--,s=y(o),x(e,s,i),u=r[s],0!==u&&(o-=f[s],b(e,o,u)))}while(d{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,s,u,l=-1;for(e.heap_len=0,e.heap_max=573,a=0;a>1;a>=1;a--)O(e,n,a);u=o;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],O(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,n[2*u]=n[2*a]+n[2*s],e.depth[u]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,n[2*a+1]=n[2*s+1]=u,e.heap[1]=u++,O(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length;let l,c,f,d,h,p,g=0;for(d=0;d<=15;d++)e.bl_count[d]=0;for(n[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],d=n[2*n[2*c+1]+1]+1,d>u&&(d=u,g++),n[2*c+1]=d,c>r||(e.bl_count[d]++,h=0,c>=s&&(h=a[c-s]),p=n[2*c],e.opt_len+=p*(d+h),o&&(e.static_len+=p*(i[2*c+1]+h)));if(0!==g){do{for(d=u-1;0===e.bl_count[d];)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(d=u;0!==d;d--)for(c=e.bl_count[d];0!==c;)f=e.heap[--l],f>r||(n[2*f+1]!==d&&(e.opt_len+=(d-n[2*f+1])*n[2*f],n[2*f+1]=d),c--)}})(e,t),w(n,l,e.bl_count)},C=(e,t,n)=>{let r,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s{let r,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s{b(e,0+(r?1:0),3),A(e),v(e,n),v(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n};e.exports._tr_init=e=>{j||((()=>{let e,t,o,m,y;const v=new Array(16);for(o=0,m=0;m<28;m++)for(c[m]=o,e=0;e<1<>=7;m<30;m++)for(f[m]=y<<7,e=0;e<1<{let i,u,l=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),S(e,e.l_desc),S(e,e.d_desc),l=(e=>{let t;for(C(e,e.dyn_ltree,e.l_desc.max_code),C(e,e.dyn_dtree,e.d_desc.max_code),S(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*o[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,u=e.static_len+3+7>>>3,u<=i&&(i=u)):i=u=n+5,n+4<=i&&-1!==t?M(e,t,n,r):4===e.strategy||u===i?(b(e,2+(r?1:0),3),D(e,a,s)):(b(e,4+(r?1:0),3),((e,t,n,r)=>{let i;for(b(e,t-257,5),b(e,n-1,5),b(e,r-4,4),i=0;i(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(l[n]+256+1)]++,e.dyn_dtree[2*y(t)]++),e.sym_next===e.sym_end),e.exports._tr_align=e=>{b(e,2,3),x(e,256,a),(e=>{16===e.bi_valid?(v(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}},292:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},607:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.render=t.version=t.VegaWidget=t.VegaWidgetModel=t.vegaEmbed=void 0;const o=n(225);var a=n(225);Object.defineProperty(t,"vegaEmbed",{enumerable:!0,get:function(){return a.default}});var s=n(891);function u(e,t){throw e.innerHTML=`
\n

Javascript Error: ${t.message}

\n

This usually means there's a typo in your chart specification.\n See the JavaScript console for the full traceback.

\n
`,t}Object.defineProperty(t,"VegaWidgetModel",{enumerable:!0,get:function(){return s.VegaWidgetModel}}),Object.defineProperty(t,"VegaWidget",{enumerable:!0,get:function(){return s.VegaWidget}}),t.version=n(147).version,t.render=function(e,t,n,r,i){const a=function(e,t){for(let n=0;n-1&&s>-1)return;const l=document.getElementById(e.substring(1));(0,o.default)(l,t,Object.assign(Object.assign({loader:{http:{credentials:"same-origin"}}},r),{mode:n})).then((t=>{t.view.toImageURL("png").then((t=>{if(void 0!==i){const n={data:{"image/png":t.split(",")[1]},metadata:{"jupyter-vega":e},output_type:"display_data"};i.outputs.push(n)}})).catch((e=>u(l,e)))})).catch((e=>u(l,e)))},i(n(891),t)},959:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(607),i=n(146);e.exports={id:"jupyter-vega",requires:[i.IJupyterWidgetRegistry],activate:(e,t)=>{t.registerWidget({name:"jupyter-vega",version:r.version,exports:r})},autoStart:!0}},412:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MODULE_NAME=t.MODULE_VERSION=void 0;const r=n(147);t.MODULE_VERSION=r.version,t.MODULE_NAME=r.name},891:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.VegaWidget=t.VegaWidgetModel=void 0;const i=n(146),o=n(412),a=n(607),s=n(861),u=n(200);class l extends i.DOMWidgetModel{constructor(){super(...arguments),this.viewInstance=null}defaults(){return Object.assign(Object.assign({},i.DOMWidgetModel.prototype.defaults()),{_model_name:"VegaWidgetModel",_view_name:"VegaWidget",_spec_source:"",_opt_source:"",_df:s([]),_img_url:"",_columns:[]})}}l.serializers=Object.assign(Object.assign({},i.DOMWidgetModel.serializers),{_img_url:{serialize:function(e,t){if(null===t.viewInstance||void 0===t.viewInstance.viewElement||!1===t.viewInstance.hasBeenUpdated)return e;let n=t.viewInstance.viewElement.id;""!==n&&void 0!==n||(n="VEGA_ID_"+crypto.randomUUID(),t.viewInstance.viewElement.id=n);let r=document.querySelector(`#${n} canvas`);return null===r?e:JSON.stringify({width:r.style.width||r.width,height:r.style.height||r.height,url:r.toDataURL()})}},_df:u.table_serialization}),l.model_name="VegaWidgetModel",l.model_module=o.MODULE_NAME,l.model_module_version=o.MODULE_VERSION,l.view_name="VegaWidget",l.view_module=o.MODULE_NAME,l.view_module_version=o.MODULE_VERSION,t.VegaWidgetModel=l;class c extends i.DOMWidgetView{constructor(){super(...arguments),this.hasBeenUpdated=!1,this.viewElement=document.createElement("div"),this.errorElement=document.createElement("div")}render(){return r(this,void 0,void 0,(function*(){this.el.appendChild(this.viewElement),this.errorElement.style.color="red",this.el.appendChild(this.errorElement),this.model.viewInstance=this;const e=()=>r(this,void 0,void 0,(function*(){const e=JSON.parse(this.model.get("_spec_source")),t=JSON.parse(this.model.get("_opt_source")||"{}"),n=this.model.get("_img_url");if(""!==n&&"null"!==n){let e=JSON.parse(n),t=document.createElement("img");t.src=e.url;let r=parseInt(e.height);r>0&&(t.height=r);let i=parseInt(e.width);return i>0&&(t.width=i),this.viewElement.appendChild(t),void this.model.set("_img_url","null")}if(null!=e)try{const n=yield(0,a.vegaEmbed)(this.viewElement,e,Object.assign({loader:{http:{credentials:"same-origin"}}},t));this.result&&this.result.finalize(),this.result=n,this.send({type:"display"})}catch(e){this.result&&this.result.finalize(),console.error(e)}})),t=(e,t)=>r(this,void 0,void 0,(function*(){const n=this.result;if(null==n)throw new Error("Internal error: no view attached to widget");const r=new Function("datum",`return (${e.remove||"false"})`);let i=e.insert||[];switch(i){case"@dataframe":i=this.updateDataFrame();break;case"@array2d":i=this.updateArray2D()}const o=n.view.changeset().remove(r).insert(i),a=n.view.change(e.key,o);t&&a.resize(),yield a.runAsync()})),n=e=>r(this,void 0,void 0,(function*(){this.hasBeenUpdated=!0;for(const n of e.updates)yield t(n,e.resize)}));this.model.on("change:_spec_source",e),this.model.on("change:_opt_source",e),this.model.on("msg:custom",(e=>{const t=function(e){return"update"!=e.type?null:e}(e);null!=t&&n(t).catch((e=>{this.errorElement.textContent=String(e),console.error(e)}))})),yield e()}))}updateDataFrame(){const e=this.model.get("_df"),t=(0,u.rowProxy)(e),n=Array(e.size);for(let e=0;e{"use strict";e.exports=function(e,t,n){return 0===e.length?e:t?(n||e.sort(t),function(e,t){for(var n=1,r=e.length,i=e[0],o=e[0],a=1;a{"use strict";n.r(t),n.d(t,{DEFAULT_ACTIONS:()=>J5,default:()=>u6,guessMode:()=>o6,vega:()=>Y5,vegaLite:()=>X5,version:()=>V5});var r={};n.r(r),n.d(r,{JsonPatchError:()=>M,_areEquals:()=>U,applyOperation:()=>z,applyPatch:()=>R,applyReducer:()=>P,deepClone:()=>$,getValueByPointer:()=>T,validate:()=>I,validator:()=>L});var i={};n.r(i),n.d(i,{compare:()=>Z,generate:()=>Y,observe:()=>V,unobserve:()=>G});var o={};n.r(o),n.d(o,{aggregate:()=>Lu,bin:()=>Iu,collect:()=>qu,compare:()=>Wu,countpattern:()=>Gu,cross:()=>Vu,density:()=>Ju,dotbin:()=>nl,expression:()=>rl,extent:()=>ol,facet:()=>sl,field:()=>ul,filter:()=>cl,flatten:()=>fl,fold:()=>dl,formula:()=>hl,generate:()=>pl,impute:()=>yl,joinaggregate:()=>vl,kde:()=>bl,key:()=>xl,load:()=>wl,lookup:()=>Al,multiextent:()=>El,multivalues:()=>Dl,params:()=>Cl,pivot:()=>Fl,prefacet:()=>jl,project:()=>Ml,proxy:()=>$l,quantile:()=>Nl,relay:()=>Bl,sample:()=>Tl,sequence:()=>zl,sieve:()=>Rl,subflow:()=>al,timeunit:()=>Pl,tupleindex:()=>Il,values:()=>Ul,window:()=>Vl});var a={};n.r(a),n.d(a,{interpolate:()=>xd,interpolateArray:()=>dd,interpolateBasis:()=>ed,interpolateBasisClosed:()=>td,interpolateCubehelix:()=>pp,interpolateCubehelixLong:()=>gp,interpolateDate:()=>pd,interpolateDiscrete:()=>xh,interpolateHcl:()=>tp,interpolateHclLong:()=>np,interpolateHsl:()=>Mh,interpolateHslLong:()=>$h,interpolateHue:()=>_h,interpolateLab:()=>Qh,interpolateNumber:()=>gd,interpolateNumberArray:()=>cd,interpolateObject:()=>md,interpolateRgb:()=>ad,interpolateRgbBasis:()=>ud,interpolateRgbBasisClosed:()=>ld,interpolateRound:()=>_d,interpolateString:()=>bd,interpolateTransformCss:()=>Dh,interpolateTransformSvg:()=>Sh,interpolateZoom:()=>Fh,piecewise:()=>lh,quantize:()=>mp});var s={};n.r(s),n.d(s,{bound:()=>Gx,identifier:()=>Xx,mark:()=>Zx,overlap:()=>Jx,render:()=>i_,viewlayout:()=>E_});var u={};n.r(u),n.d(u,{axisticks:()=>D_,datajoin:()=>S_,encode:()=>F_,legendentries:()=>j_,linkpath:()=>T_,pie:()=>I_,scale:()=>W_,sortitems:()=>Y_,stack:()=>Q_});var l={};n.r(l),n.d(l,{contour:()=>BE,geojson:()=>RE,geopath:()=>PE,geopoint:()=>LE,geoshape:()=>IE,graticule:()=>UE,heatmap:()=>qE,isocontour:()=>EE,kde2d:()=>ME,projection:()=>HE});var c={};n.r(c),n.d(c,{force:()=>LO});var f={};n.r(f),n.d(f,{nest:()=>WD,pack:()=>ZD,partition:()=>KD,stratify:()=>QD,tree:()=>nS,treelinks:()=>rS,treemap:()=>aS});var d={};n.r(d),n.d(d,{label:()=>SS});var h={};n.r(h),n.d(h,{loess:()=>FS,regression:()=>MS});var p={};n.r(p),n.d(p,{voronoi:()=>uC});var g={};n.r(g),n.d(g,{wordcloud:()=>kC});var m={};n.r(m),n.d(m,{crossfilter:()=>FC,resolvefilter:()=>jC});var y={};n.r(y),n.d(y,{Bounds:()=>$m,CanvasHandler:()=>cb,CanvasRenderer:()=>gb,DATE:()=>mr,DAY:()=>yr,DAYOFYEAR:()=>vr,Dataflow:()=>hs,Debug:()=>be,Error:()=>me,EventStream:()=>Qa,Gradient:()=>zg,GroupItem:()=>Bm,HOURS:()=>br,Handler:()=>Gv,Info:()=>ve,Item:()=>Nm,MILLISECONDS:()=>wr,MINUTES:()=>xr,MONTH:()=>pr,Marks:()=>Fv,MultiPulse:()=>ls,None:()=>ge,Operator:()=>Za,Parameters:()=>Va,Pulse:()=>os,QUARTER:()=>hr,RenderType:()=>ax,Renderer:()=>Yv,ResourceLoader:()=>Tm,SECONDS:()=>_r,SVGHandler:()=>yb,SVGRenderer:()=>qb,SVGStringRenderer:()=>rx,Scenegraph:()=>Rv,TIME_UNITS:()=>kr,Transform:()=>gs,View:()=>yN,WEEK:()=>gr,Warn:()=>ye,YEAR:()=>dr,accessor:()=>Q,accessorFields:()=>te,accessorName:()=>ee,array:()=>Ge,ascending:()=>Je,bandwidthNRD:()=>js,bin:()=>Ms,bootstrapCI:()=>Bs,boundClip:()=>px,boundContext:()=>ry,boundItem:()=>jv,boundMark:()=>$v,boundStroke:()=>Pm,changeset:()=>Ha,clampRange:()=>Ve,codegenExpression:()=>lj,compare:()=>Ze,constant:()=>tt,cumulativeLogNormal:()=>Zs,cumulativeNormal:()=>Ws,cumulativeUniform:()=>nu,dayofyear:()=>Fr,debounce:()=>nt,defaultLocale:()=>ra,definition:()=>ys,densityLogNormal:()=>Xs,densityNormal:()=>qs,densityUniform:()=>tu,domChild:()=>Uv,domClear:()=>qv,domCreate:()=>Lv,domFind:()=>Iv,dotbin:()=>Ts,error:()=>oe,expressionFunction:()=>m$,extend:()=>rt,extent:()=>it,extentIndex:()=>ot,falsy:()=>he,fastmap:()=>lt,field:()=>se,flush:()=>ct,font:()=>wv,fontFamily:()=>_v,fontSize:()=>mv,format:()=>Da,formatLocale:()=>Xo,formats:()=>Sa,hasOwnProperty:()=>st,id:()=>ue,identity:()=>le,inferType:()=>xa,inferTypes:()=>_a,ingest:()=>Pa,inherits:()=>ft,inrange:()=>dt,interpolate:()=>ag,interpolateColors:()=>rg,interpolateRange:()=>ng,intersect:()=>lx,intersectBoxLine:()=>py,intersectPath:()=>cy,intersectPoint:()=>fy,intersectRule:()=>hy,isArray:()=>_e,isBoolean:()=>ht,isDate:()=>pt,isFunction:()=>Ye,isIterable:()=>gt,isNumber:()=>mt,isObject:()=>we,isRegExp:()=>yt,isString:()=>vt,isTuple:()=>Ta,key:()=>bt,lerp:()=>xt,lineHeight:()=>yv,loader:()=>ja,locale:()=>na,logger:()=>xe,lruCache:()=>wt,markup:()=>Bb,merge:()=>kt,mergeConfig:()=>Ae,multiLineOffset:()=>bv,one:()=>fe,pad:()=>Et,panLinear:()=>Be,panLog:()=>Te,panPow:()=>ze,panSymlog:()=>Re,parse:()=>GR,parseExpression:()=>aj,parseSelector:()=>BN,path:()=>Zc,pathCurves:()=>Pg,pathEqual:()=>yx,pathParse:()=>Hg,pathRectangle:()=>gm,pathRender:()=>nm,pathSymbols:()=>am,pathTrail:()=>mm,peek:()=>De,point:()=>Hv,projection:()=>hE,quantileLogNormal:()=>Js,quantileNormal:()=>Hs,quantileUniform:()=>ru,quantiles:()=>Cs,quantizeInterpolator:()=>ig,quarter:()=>We,quartiles:()=>Fs,random:()=>$s,randomInteger:()=>Rs,randomKDE:()=>Vs,randomLCG:()=>zs,randomLogNormal:()=>Ks,randomMixture:()=>Qs,randomNormal:()=>Gs,randomUniform:()=>iu,read:()=>Fa,regressionExp:()=>fu,regressionLinear:()=>lu,regressionLoess:()=>vu,regressionLog:()=>cu,regressionPoly:()=>pu,regressionPow:()=>du,regressionQuad:()=>hu,renderModule:()=>ux,repeat:()=>At,resetDefaultLocale:()=>ia,resetSVGClipId:()=>jm,resetSVGDefIds:()=>vx,responseType:()=>Ca,runtimeContext:()=>O$,sampleCurve:()=>wu,sampleLogNormal:()=>Ys,sampleNormal:()=>Us,sampleUniform:()=>eu,scale:()=>Gp,sceneEqual:()=>mx,sceneFromJSON:()=>Tv,scenePickVisit:()=>Ey,sceneToJSON:()=>Bv,sceneVisit:()=>Ay,sceneZOrder:()=>ky,scheme:()=>cg,serializeXML:()=>Tb,setRandom:()=>Ns,span:()=>Ot,splitAccessPath:()=>ae,stringValue:()=>Dt,textMetrics:()=>cv,timeBin:()=>gi,timeFloor:()=>Gr,timeFormatLocale:()=>ea,timeInterval:()=>Kr,timeOffset:()=>ti,timeSequence:()=>ii,timeUnitSpecifier:()=>Dr,timeUnits:()=>Er,toBoolean:()=>St,toDate:()=>Ft,toNumber:()=>Se,toSet:()=>Mt,toString:()=>jt,transform:()=>vs,transforms:()=>ms,truncate:()=>$t,truthy:()=>de,tupleid:()=>za,typeParsers:()=>ya,utcFloor:()=>Xr,utcInterval:()=>Qr,utcOffset:()=>ni,utcSequence:()=>oi,utcdayofyear:()=>Tr,utcquarter:()=>He,utcweek:()=>zr,version:()=>VR,visitArray:()=>Nt,week:()=>jr,writeConfig:()=>Ee,zero:()=>ce,zoomLinear:()=>Le,zoomLog:()=>Ie,zoomPow:()=>Ue,zoomSymlog:()=>qe});var v={};n.r(v),n.d(v,{accessPathDepth:()=>vL,accessPathWithDatum:()=>dL,compile:()=>V1,contains:()=>GP,deepEqual:()=>PP,deleteNestedProperty:()=>cL,duplicate:()=>LP,entries:()=>aL,every:()=>YP,fieldIntersection:()=>nL,flatAccessWithDatum:()=>hL,getFirstDefined:()=>bL,hasIntersection:()=>eL,hash:()=>WP,internalField:()=>kL,isBoolean:()=>sL,isEmpty:()=>rL,isEqual:()=>KP,isInternalField:()=>AL,isNullOrFalse:()=>HP,isNumeric:()=>OL,keys:()=>iL,logicalExpr:()=>lL,mergeDeep:()=>XP,normalize:()=>EY,normalizeAngle:()=>EL,omit:()=>UP,pick:()=>IP,prefixGenerator:()=>tL,removePathFromField:()=>yL,replaceAll:()=>mL,replacePathInField:()=>gL,resetIdCounter:()=>wL,setEqual:()=>QP,some:()=>VP,stringify:()=>qP,titleCase:()=>fL,unique:()=>JP,uniqueId:()=>_L,vals:()=>oL,varName:()=>uL,version:()=>oP.i8});var b={};n.r(b),n.d(b,{dark:()=>J1,excel:()=>Q1,fivethirtyeight:()=>i2,ggplot2:()=>a2,googlecharts:()=>D2,latimes:()=>d2,powerbi:()=>L2,quartz:()=>g2,urbaninstitute:()=>k2,version:()=>I2,vox:()=>y2});var x,_=(x=function(e,t){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},x(e,t)},function(e,t){function n(){this.constructor=e}x(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),w=Object.prototype.hasOwnProperty;function k(e,t){return w.call(e,t)}function A(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n=48&&t<=57))return!1;n++}return!0}function D(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function S(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function C(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,n=e.length;t0&&"constructor"==s[l-1]))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&void 0===f&&(void 0===u[d]?f=s.slice(0,l).join("/"):l==c-1&&(f=t.path),void 0!==f&&h(t,0,e,f)),l++,Array.isArray(u)){if("-"===d)d=u.length;else{if(n&&!O(d))throw new M("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);O(d)&&(d=~~d)}if(l>=c){if(n&&"add"===t.op&&d>u.length)throw new M("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);if(!1===(a=B[t.op].call(t,u,d,e)).test)throw new M("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(l>=c){if(!1===(a=N[t.op].call(t,u,d,e)).test)throw new M("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}if(u=u[d],n&&l0)throw new M('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new M("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new M("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&C(e.value))throw new M("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n)if("add"==e.op){var i=e.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new M("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==r)throw new M("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if("move"===e.op||"copy"===e.op){var a=I([{op:"_get",path:e.from,value:void 0}],n);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new M("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}function I(e,t,n){try{if(!Array.isArray(e))throw new M("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)R(E(t),E(e),n||!0);else{n=n||L;for(var r=0;r0&&(e.patches=[],e.callback&&e.callback(r)),r}function X(e,t,n,r,i){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var o=A(t),a=A(e),s=!1,u=a.length-1;u>=0;u--){var l=e[f=a[u]];if(!k(t,f)||void 0===t[f]&&void 0!==l&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:"test",path:r+"/"+D(f),value:E(l)}),n.push({op:"remove",path:r+"/"+D(f)}),s=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}));else{var c=t[f];"object"==typeof l&&null!=l&&"object"==typeof c&&null!=c&&Array.isArray(l)===Array.isArray(c)?X(l,c,n,r+"/"+D(f),i):l!==c&&(i&&n.push({op:"test",path:r+"/"+D(f),value:E(l)}),n.push({op:"replace",path:r+"/"+D(f),value:E(c)}))}}if(s||o.length!=a.length)for(u=0;ufunction(t){return t[e]},ie=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),s=r=i+1):"]"===o&&(s||oe("Access path missing open bracket: "+e),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&oe("Access path missing closing bracket: "+e),a&&oe("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function se(e,t,n){const r=ae(e);return e=1===r.length?r[0]:e,Q((n&&n.get||ne)(r),[e],t||e)}const ue=se("id"),le=Q((e=>e),[],"identity"),ce=Q((()=>0),[],"zero"),fe=Q((()=>1),[],"one"),de=Q((()=>!0),[],"true"),he=Q((()=>!1),[],"false");function pe(e,t,n){const r=[t].concat([].slice.call(n));console[e].apply(console,r)}const ge=0,me=1,ye=2,ve=3,be=4;function xe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pe,r=e||ge;return{level(e){return arguments.length?(r=+e,this):r},error(){return r>=me&&n(t||"error","ERROR",arguments),this},warn(){return r>=ye&&n(t||"warn","WARN",arguments),this},info(){return r>=ve&&n(t||"log","INFO",arguments),this},debug(){return r>=be&&n(t||"log","DEBUG",arguments),this}}}var _e=Array.isArray;function we(e){return e===Object(e)}const ke=e=>"__proto__"!==e;function Ae(){for(var e=arguments.length,t=new Array(e),n=0;n{for(const n in t)if("signals"===n)e.signals=Oe(e.signals,t.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;Ee(e,n,t[n],r)}return e}),{})}function Ee(e,t,n,r){if(!ke(t))return;let i,o;if(we(n)&&!_e(n))for(i in o=we(e[t])?e[t]:e[t]={},n)r&&(!0===r||r[i])?Ee(o,i,n[i]):ke(i)&&(o[i]=n[i]);else e[t]=n}function Oe(e,t){if(null==e)return t;const n={},r=[];function i(e){n[e.name]||(n[e.name]=1,r.push(e))}return t.forEach(i),e.forEach(i),r}function De(e){return e[e.length-1]}function Se(e){return null==e||""===e?null:+e}const Ce=e=>t=>e*Math.exp(t),Fe=e=>t=>Math.log(e*t),je=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),Me=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,$e=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function Ne(e,t,n,r){const i=n(e[0]),o=n(De(e)),a=(o-i)*t;return[r(i-a),r(o-a)]}function Be(e,t){return Ne(e,t,Se,le)}function Te(e,t){var n=Math.sign(e[0]);return Ne(e,t,Fe(n),Ce(n))}function ze(e,t,n){return Ne(e,t,$e(n),$e(1/n))}function Re(e,t,n){return Ne(e,t,je(n),Me(n))}function Pe(e,t,n,r,i){const o=r(e[0]),a=r(De(e)),s=null!=t?r(t):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function Le(e,t,n){return Pe(e,t,n,Se,le)}function Ie(e,t,n){const r=Math.sign(e[0]);return Pe(e,t,n,Fe(r),Ce(r))}function Ue(e,t,n,r){return Pe(e,t,n,$e(r),$e(1/r))}function qe(e,t,n,r){return Pe(e,t,n,je(r),Me(r))}function We(e){return 1+~~(new Date(e).getMonth()/3)}function He(e){return 1+~~(new Date(e).getUTCMonth()/3)}function Ge(e){return null!=e?_e(e)?e:[e]:[]}function Ve(e,t,n){let r,i=e[0],o=e[1];return o=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-r),i+r]}function Ye(e){return"function"==typeof e}const Xe="descending";function Ze(e,t,n){n=n||{},t=Ge(t)||[];const r=[],i=[],o={},a=n.comparator||Ke;return Ge(e).forEach(((e,a)=>{null!=e&&(r.push(t[a]===Xe?-1:1),i.push(e=Ye(e)?e:se(e,null,n)),(te(e)||[]).forEach((e=>o[e]=1)))})),0===i.length?null:Q(a(i,r),Object.keys(o))}const Je=(e,t)=>(et||null==t)&&null!=e?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t==t?-1:t!=t&&e==e?1:0),Ke=(e,t)=>1===e.length?Qe(e[0],t[0]):et(e,t,e.length),Qe=(e,t)=>function(n,r){return Je(e(n),e(r))*t},et=(e,t,n)=>(t.push(0),function(r,i){let o,a=0,s=-1;for(;0===a&&++se}function nt(e,t){let n;return r=>{n&&clearTimeout(n),n=setTimeout((()=>(t(r),n=null)),e)}}function rt(e){for(let t,n,r=1,i=arguments.length;ro&&(o=r))}else{for(r=t(e[a]);ao&&(o=r))}return[i,o]}function ot(e,t){const n=e.length;let r,i,o,a,s,u=-1;if(null==t){for(;++u=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++ui&&(r=i,a=u),o=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++ui&&(r=i,a=u),or(e)?n[e]:void 0,set(e,t){return r(e)||(++i.size,n[e]===ut&&--i.empty),n[e]=t,this},delete(e){return r(e)&&(--i.size,++i.empty,n[e]=ut),this},clear(){i.size=i.empty=0,i.object=n={}},test(e){return arguments.length?(t=e,i):t},clean(){const e={};let r=0;for(const i in n){const o=n[i];o===ut||t&&t(o)||(e[i]=o,++r)}i.size=r,i.empty=0,i.object=n=e}};return e&&Object.keys(e).forEach((t=>{i.set(t,e[t])})),i}function ct(e,t,n,r,i,o){if(!n&&0!==n)return o;const a=+n;let s,u=e[0],l=De(e);la&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=e:oe.replace(/\\(.)/g,"$1"))):Ge(e));const r=e&&e.length,i=n&&n.get||ne,o=e=>i(t?[e]:ae(e));let a;if(r)if(1===r){const t=o(e[0]);a=function(e){return""+t(e)}}else{const t=e.map(o);a=function(e){let n=""+t[0](e),i=0;for(;++i{t={},n={},r=0},o=(i,o)=>(++r>e&&(n=t,t={},r=1),t[i]=o);return i(),{clear:i,has:e=>st(t,e)||st(n,e),get:e=>st(t,e)?t[e]:st(n,e)?o(e,n[e]):void 0,set:(e,n)=>st(t,e)?t[e]=n:o(e,n)}}function kt(e,t,n,r){const i=t.length,o=n.length;if(!o)return t;if(!i)return n;const a=r||new t.constructor(i+o);let s=0,u=0,l=0;for(;s0?n[u++]:t[s++];for(;s=0;)n+=e;return n}function Et(e,t,n,r){const i=n||" ",o=e+"",a=t-o.length;return a<=0?o:"left"===r?At(i,a)+o:"center"===r?At(i,~~(a/2))+o+At(i,Math.ceil(a/2)):o+At(i,a)}function Ot(e){return e&&De(e)-e[0]||0}function Dt(e){return _e(e)?"["+e.map(Dt)+"]":we(e)||vt(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function St(e){return null==e||""===e?null:!(!e||"false"===e||"0"===e||!e)}const Ct=e=>mt(e)||pt(e)?e:Date.parse(e);function Ft(e,t){return t=t||Ct,null==e||""===e?null:t(e)}function jt(e){return null==e||""===e?null:e+""}function Mt(e){const t={},n=e.length;for(let r=0;r=o?u=!0:(r=e.charCodeAt(a++))===Rt?l=!0:r===Pt&&(l=!0,e.charCodeAt(a)===Rt&&++a),e.slice(i+1,t-1).replace(/""/g,'"')}for(;a9999?"+"+Ut(t,6):Ut(t,4))+"-"+Ut(e.getUTCMonth()+1,2)+"-"+Ut(e.getUTCDate(),2)+(o?"T"+Ut(n,2)+":"+Ut(r,2)+":"+Ut(i,2)+"."+Ut(o,3)+"Z":i?"T"+Ut(n,2)+":"+Ut(r,2)+":"+Ut(i,2)+"Z":r||n?"T"+Ut(n,2)+":"+Ut(r,2)+"Z":"")}(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function(e,t){var n,i,o=r(e,(function(e,r){if(n)return n(e,r-1);i=e,n=t?function(e,t){var n=Lt(e);return function(r,i){return t(n(r),i,e)}}(e,t):Lt(e)}));return o.columns=i||[],o},parseRows:r,format:function(t,n){return null==n&&(n=It(t)),[n.map(a).join(e)].concat(i(t,n)).join("\n")},formatBody:function(e,t){return null==t&&(t=It(e)),i(e,t).join("\n")},formatRows:function(e){return e.map(o).join("\n")},formatRow:o,formatValue:a}}function Wt(e){return e}function Ht(e,t){return"string"==typeof t&&(t=e.objects[t]),"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map((function(t){return Gt(e,t)}))}:Gt(e,t)}function Gt(e,t){var n=t.id,r=t.bbox,i=null==t.properties?{}:t.properties,o=Vt(e,t);return null==n&&null==r?{type:"Feature",properties:i,geometry:o}:null==r?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}function Vt(e,t){var n=function(e){if(null==e)return Wt;var t,n,r=e.scale[0],i=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=n=0);var u=2,l=e.length,c=new Array(l);for(c[0]=(t+=e[0])*r+o,c[1]=(n+=e[1])*i+a;u1)r=function(e,t,n){var r,i=[],o=[];function a(e){var t=e<0?~e:e;(o[t]||(o[t]=[])).push({i:e,g:r})}function s(e){e.forEach(a)}function u(e){e.forEach(s)}return function e(t){switch(r=t,t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"LineString":s(t.arcs);break;case"MultiLineString":case"Polygon":u(t.arcs);break;case"MultiPolygon":!function(e){e.forEach(u)}(t.arcs)}}(t),o.forEach(null==n?function(e){i.push(e[0].i)}:function(e){n(e[0].g,e[e.length-1].g)&&i.push(e[0].i)}),i}(0,t,n);else for(i=0,r=new Array(o=e.arcs.length);i=Jt?10:o>=Kt?5:o>=Qt?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(e*l),u=Math.round(t*l),s/lt&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(e/l),u=Math.round(t/l),s*lt&&--u),u0))return[];if((e=+e)==(t=+t))return[e];const r=t=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let e=0;e=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function sn(e){if(!(t=an.exec(e)))throw new Error("invalid format: "+e);var t;return new un({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function un(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function ln(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function cn(e){return(e=ln(Math.abs(e)))?e[1]:NaN}function fn(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(cn(t)/3)))-cn(Math.abs(e)))}function dn(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,cn(t)-cn(e))+1}function hn(e){return Math.max(0,-cn(Math.abs(e)))}function pn(e,t){var n=ln(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}sn.prototype=un.prototype,un.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const gn={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>pn(100*e,t),r:pn,s:function(e,t){var n=ln(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(on=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ln(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function mn(e){return e}var yn,vn,bn,xn=Array.prototype.map,_n=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function wn(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?mn:(t=xn.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(e.substring(i-=s,i+s)),!((u+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?mn:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(xn.call(e.numerals,String)),u=void 0===e.percent?"%":e.percent+"",l=void 0===e.minus?"−":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function f(e){var t=(e=sn(e)).fill,n=e.align,f=e.sign,d=e.symbol,h=e.zero,p=e.width,g=e.comma,m=e.precision,y=e.trim,v=e.type;"n"===v?(g=!0,v="g"):gn[v]||(void 0===m&&(m=12),y=!0,v="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var b="$"===d?i:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===d?o:/[%p]/.test(v)?u:"",_=gn[v],w=/[defgprs%]/.test(v);function k(e){var i,o,u,d=b,k=x;if("c"===v)k=_(e)+k,e="";else{var A=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:_(Math.abs(e),m),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),A&&0==+e&&"+"!==f&&(A=!1),d=(A?"("===f?f:l:"-"===f||"("===f?"":f)+d,k=("s"===v?_n[8+on/3]:"")+k+(A&&"("===f?")":""),w)for(i=-1,o=e.length;++i(u=e.charCodeAt(i))||u>57){k=(46===u?a+e.slice(i+1):e.slice(i))+k,e=e.slice(0,i);break}}g&&!h&&(e=r(e,1/0));var E=d.length+e.length+k.length,O=E>1)+d+e+k+O.slice(E);break;default:e=O+d+e+k}return s(e)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),k.toString=function(){return e+""},k}return{format:f,formatPrefix:function(e,t){var n=f(((e=sn(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(cn(t)/3))),i=Math.pow(10,-r),o=_n[8+r/3];return function(e){return n(i*e)+o}}}}yn=wn({thousands:",",grouping:[3],currency:["$",""]}),vn=yn.format,bn=yn.formatPrefix;const kn=new Date,An=new Date;function En(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(sEn((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})),n&&(i.count=(t,r)=>(kn.setTime(+t),An.setTime(+r),e(kn),e(An),Math.floor(n(kn,An))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e==0:t=>i.count(0,t)%e==0):i:null)),i}const On=1e3,Dn=6e4,Sn=60*Dn,Cn=24*Sn,Fn=7*Cn,jn=30*Cn,Mn=365*Cn,$n=En((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Dn)/Cn),(e=>e.getDate()-1)),Nn=($n.range,En((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/Cn),(e=>e.getUTCDate()-1))),Bn=(Nn.range,En((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/Cn),(e=>Math.floor(e/Cn))));function Tn(e){return En((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Dn)/Fn))}Bn.range;const zn=Tn(0),Rn=Tn(1),Pn=Tn(2),Ln=Tn(3),In=Tn(4),Un=Tn(5),qn=Tn(6);function Wn(e){return En((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/Fn))}zn.range,Rn.range,Pn.range,Ln.range,In.range,Un.range,qn.range;const Hn=Wn(0),Gn=Wn(1),Vn=Wn(2),Yn=Wn(3),Xn=Wn(4),Zn=Wn(5),Jn=Wn(6),Kn=(Hn.range,Gn.range,Vn.range,Yn.range,Xn.range,Zn.range,Jn.range,En((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear())));Kn.every=e=>isFinite(e=Math.floor(e))&&e>0?En((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,Kn.range;const Qn=En((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));Qn.every=e=>isFinite(e=Math.floor(e))&&e>0?En((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,Qn.range;const er=En((e=>{e.setDate(1),e.setHours(0,0,0,0)}),((e,t)=>{e.setMonth(e.getMonth()+t)}),((e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())),(e=>e.getMonth())),tr=(er.range,En((e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)}),((e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())),(e=>e.getUTCMonth()))),nr=(tr.range,En((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*On-e.getMinutes()*Dn)}),((e,t)=>{e.setTime(+e+t*Sn)}),((e,t)=>(t-e)/Sn),(e=>e.getHours()))),rr=(nr.range,En((e=>{e.setUTCMinutes(0,0,0)}),((e,t)=>{e.setTime(+e+t*Sn)}),((e,t)=>(t-e)/Sn),(e=>e.getUTCHours()))),ir=(rr.range,En((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*On)}),((e,t)=>{e.setTime(+e+t*Dn)}),((e,t)=>(t-e)/Dn),(e=>e.getMinutes()))),or=(ir.range,En((e=>{e.setUTCSeconds(0,0)}),((e,t)=>{e.setTime(+e+t*Dn)}),((e,t)=>(t-e)/Dn),(e=>e.getUTCMinutes()))),ar=(or.range,En((e=>{e.setTime(e-e.getMilliseconds())}),((e,t)=>{e.setTime(+e+t*On)}),((e,t)=>(t-e)/On),(e=>e.getUTCSeconds()))),sr=(ar.range,En((()=>{}),((e,t)=>{e.setTime(+e+t)}),((e,t)=>t-e)));function ur(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function lr(e,t){return null==e||null==t?NaN:te?1:t>=e?0:NaN}function cr(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i>>1;n(e[t],r)<0?i=t+1:o=t}while(iur(e(t),n),r=(t,n)=>e(t)-n):(t=e===ur||e===lr?e:fr,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i>>1;n(e[t],r)<=0?i=t+1:o=t}while(i(e=Math.floor(e),isFinite(e)&&e>0?e>1?En((t=>{t.setTime(Math.floor(t/e)*e)}),((t,n)=>{t.setTime(+t+n*e)}),((t,n)=>(n-t)/e)):sr:null),sr.range;const dr="year",hr="quarter",pr="month",gr="week",mr="date",yr="day",vr="dayofyear",br="hours",xr="minutes",_r="seconds",wr="milliseconds",kr=[dr,hr,pr,gr,mr,yr,vr,br,xr,_r,wr],Ar=kr.reduce(((e,t,n)=>(e[t]=1+n,e)),{});function Er(e){const t=Ge(e).slice(),n={};return t.length||oe("Missing time unit."),t.forEach((e=>{st(Ar,e)?n[e]=1:oe(`Invalid time unit: ${e}.`)})),(n[gr]||n[yr]?1:0)+(n[hr]||n[pr]||n[mr]?1:0)+(n[vr]?1:0)>1&&oe(`Incompatible time units: ${e}`),t.sort(((e,t)=>Ar[e]-Ar[t])),t}const Or={[dr]:"%Y ",[hr]:"Q%q ",[pr]:"%b ",[mr]:"%d ",[gr]:"W%U ",[yr]:"%a ",[vr]:"%j ",[br]:"%H:00",[xr]:"00:%M",[_r]:":%S",[wr]:".%L",[`${dr}-${pr}`]:"%Y-%m ",[`${dr}-${pr}-${mr}`]:"%Y-%m-%d ",[`${br}-${xr}`]:"%H:%M"};function Dr(e,t){const n=rt({},Or,t),r=Er(e),i=r.length;let o,a,s="",u=0;for(u=0;uu;--o)if(a=r.slice(u,o).join("-"),null!=n[a]){s+=n[a],u=o;break}return s.trim()}const Sr=new Date;function Cr(e){return Sr.setFullYear(e),Sr.setMonth(0),Sr.setDate(1),Sr.setHours(0,0,0,0),Sr}function Fr(e){return Mr(new Date(e))}function jr(e){return $r(new Date(e))}function Mr(e){return $n.count(Cr(e.getFullYear())-1,e)}function $r(e){return zn.count(Cr(e.getFullYear())-1,e)}function Nr(e){return Cr(e).getDay()}function Br(e,t,n,r,i,o,a){if(0<=e&&e<100){const s=new Date(-1,t,n,r,i,o,a);return s.setFullYear(e),s}return new Date(e,t,n,r,i,o,a)}function Tr(e){return Rr(new Date(e))}function zr(e){return Pr(new Date(e))}function Rr(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Nn.count(t-1,e)}function Pr(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Hn.count(t-1,e)}function Lr(e){return Sr.setTime(Date.UTC(e,0,1)),Sr.getUTCDay()}function Ir(e,t,n,r,i,o,a){if(0<=e&&e<100){const e=new Date(Date.UTC(-1,t,n,r,i,o,a));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(e,t,n,r,i,o,a))}function Ur(e,t,n,r,i){const o=t||1,a=De(e),s=(e,t,i)=>function(e,t,n,r){const i=n<=1?e:r?(t,i)=>r+n*Math.floor((e(t,i)-r)/n):(t,r)=>n*Math.floor(e(t,r)/n);return t?(e,n)=>t(i(e,n),n):i}(n[i=i||e],r[i],e===a&&o,t),u=new Date,l=Mt(e),c=l[dr]?s(dr):tt(2012),f=l[pr]?s(pr):l[hr]?s(hr):ce,d=l[gr]&&l[yr]?s(yr,1,gr+yr):l[gr]?s(gr,1):l[yr]?s(yr,1):l[mr]?s(mr,1):l[vr]?s(vr,1):fe,h=l[br]?s(br):ce,p=l[xr]?s(xr):ce,g=l[_r]?s(_r):ce,m=l[wr]?s(wr):ce;return function(e){u.setTime(+e);const t=c(u);return i(t,f(u),d(u,t),h(u),p(u),g(u),m(u))}}function qr(e,t,n){return t+7*e-(n+6)%7}const Wr={[dr]:e=>e.getFullYear(),[hr]:e=>Math.floor(e.getMonth()/3),[pr]:e=>e.getMonth(),[mr]:e=>e.getDate(),[br]:e=>e.getHours(),[xr]:e=>e.getMinutes(),[_r]:e=>e.getSeconds(),[wr]:e=>e.getMilliseconds(),[vr]:e=>Mr(e),[gr]:e=>$r(e),[gr+yr]:(e,t)=>qr($r(e),e.getDay(),Nr(t)),[yr]:(e,t)=>qr(1,e.getDay(),Nr(t))},Hr={[hr]:e=>3*e,[gr]:(e,t)=>qr(e,0,Nr(t))};function Gr(e,t){return Ur(e,t||1,Wr,Hr,Br)}const Vr={[dr]:e=>e.getUTCFullYear(),[hr]:e=>Math.floor(e.getUTCMonth()/3),[pr]:e=>e.getUTCMonth(),[mr]:e=>e.getUTCDate(),[br]:e=>e.getUTCHours(),[xr]:e=>e.getUTCMinutes(),[_r]:e=>e.getUTCSeconds(),[wr]:e=>e.getUTCMilliseconds(),[vr]:e=>Rr(e),[gr]:e=>Pr(e),[yr]:(e,t)=>qr(1,e.getUTCDay(),Lr(t)),[gr+yr]:(e,t)=>qr(Pr(e),e.getUTCDay(),Lr(t))},Yr={[hr]:e=>3*e,[gr]:(e,t)=>qr(e,0,Lr(t))};function Xr(e,t){return Ur(e,t||1,Vr,Yr,Ir)}const Zr={[dr]:Kn,[hr]:er.every(3),[pr]:er,[gr]:zn,[mr]:$n,[yr]:$n,[vr]:$n,[br]:nr,[xr]:ir,[_r]:ar,[wr]:sr},Jr={[dr]:Qn,[hr]:tr.every(3),[pr]:tr,[gr]:Hn,[mr]:Nn,[yr]:Nn,[vr]:Nn,[br]:rr,[xr]:or,[_r]:ar,[wr]:sr};function Kr(e){return Zr[e]}function Qr(e){return Jr[e]}function ei(e,t,n){return e?e.offset(t,n):void 0}function ti(e,t,n){return ei(Kr(e),t,n)}function ni(e,t,n){return ei(Qr(e),t,n)}function ri(e,t,n,r){return e?e.range(t,n,r):void 0}function ii(e,t,n,r){return ri(Kr(e),t,n,r)}function oi(e,t,n,r){return ri(Qr(e),t,n,r)}const ai=31536e6,si=[dr,pr,mr,br,xr,_r,wr],ui=si.slice(0,-1),li=ui.slice(0,-1),ci=li.slice(0,-1),fi=ci.slice(0,-1),di=[dr,pr],hi=[dr],pi=[[ui,1,1e3],[ui,5,5e3],[ui,15,15e3],[ui,30,3e4],[li,1,6e4],[li,5,3e5],[li,15,9e5],[li,30,18e5],[ci,1,36e5],[ci,3,108e5],[ci,6,216e5],[ci,12,432e5],[fi,1,864e5],[[dr,gr],1,6048e5],[di,1,2592e6],[di,3,7776e6],[hi,1,ai]];function gi(e){const t=e.extent,n=e.maxbins||40,r=Math.abs(Ot(t))/n;let i,o,a=cr((e=>e[2])).right(pi,r);return a===pi.length?(i=hi,o=rn(t[0]/ai,t[1]/ai,n)):a?(a=pi[r/pi[a-1][2]=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Io,s:Uo,S:so,u:uo,U:lo,V:fo,w:ho,W:po,x:null,X:null,y:go,Y:yo,Z:bo,"%":Lo},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return u[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:xo,e:xo,f:Eo,g:To,G:Ro,H:_o,I:wo,j:ko,L:Ao,m:Oo,M:Do,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Io,s:Uo,S:So,u:Co,U:Fo,V:Mo,w:$o,W:No,x:null,X:null,y:Bo,Y:zo,Z:Po,"%":Lo},_={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=g.exec(t.slice(n));return r?(e.m=m.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return A(e,t,n,r)},d:qi,e:qi,f:Xi,g:Pi,G:Ri,H:Hi,I:Hi,j:Wi,L:Yi,m:Ui,M:Gi,p:function(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=c.get(r[0].toLowerCase()),n+r[0].length):-1},q:Ii,Q:Ji,s:Ki,S:Vi,u:Ni,U:Bi,V:Ti,w:$i,W:zi,x:function(e,t,r){return A(e,n,t,r)},X:function(e,t,n){return A(e,r,t,n)},y:Pi,Y:Ri,Z:Li,"%":Zi};function w(e,t){return function(n){var r,i,o,a=[],s=-1,u=0,l=e.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=yi(vi(o.y,0,1))).getUTCDay(),r=i>4||0===i?Gn.ceil(r):Gn(r),r=Nn.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=mi(vi(o.y,0,1))).getDay(),r=i>4||0===i?Rn.ceil(r):Rn(r),r=$n.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?yi(vi(o.y,0,1)).getUTCDay():mi(vi(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,yi(o)):mi(o)}}function A(e,t,n,r){for(var i,o,a=0,s=t.length,u=n.length;a=u)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=_[i in Ei?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=w(n,b),b.X=w(r,b),b.c=w(t,b),x.x=w(n,x),x.X=w(r,x),x.c=w(t,x),{format:function(e){var t=w(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=k(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=w(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=k(e+="",!0);return t.toString=function(){return e},t}}}var xi,_i,wi,ki,Ai,Ei={"-":"",_:" ",0:"0"},Oi=/^\s*\d+/,Di=/^%/,Si=/[\\^$*+?|[\]().{}]/g;function Ci(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o[e.toLowerCase(),t])))}function $i(e,t,n){var r=Oi.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ni(e,t,n){var r=Oi.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Bi(e,t,n){var r=Oi.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Ti(e,t,n){var r=Oi.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function zi(e,t,n){var r=Oi.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Ri(e,t,n){var r=Oi.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Pi(e,t,n){var r=Oi.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Li(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Ii(e,t,n){var r=Oi.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function Ui(e,t,n){var r=Oi.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function qi(e,t,n){var r=Oi.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Wi(e,t,n){var r=Oi.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Hi(e,t,n){var r=Oi.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Gi(e,t,n){var r=Oi.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Vi(e,t,n){var r=Oi.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Yi(e,t,n){var r=Oi.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Xi(e,t,n){var r=Oi.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Zi(e,t,n){var r=Di.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Ji(e,t,n){var r=Oi.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Ki(e,t,n){var r=Oi.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Qi(e,t){return Ci(e.getDate(),t,2)}function eo(e,t){return Ci(e.getHours(),t,2)}function to(e,t){return Ci(e.getHours()%12||12,t,2)}function no(e,t){return Ci(1+$n.count(Kn(e),e),t,3)}function ro(e,t){return Ci(e.getMilliseconds(),t,3)}function io(e,t){return ro(e,t)+"000"}function oo(e,t){return Ci(e.getMonth()+1,t,2)}function ao(e,t){return Ci(e.getMinutes(),t,2)}function so(e,t){return Ci(e.getSeconds(),t,2)}function uo(e){var t=e.getDay();return 0===t?7:t}function lo(e,t){return Ci(zn.count(Kn(e)-1,e),t,2)}function co(e){var t=e.getDay();return t>=4||0===t?In(e):In.ceil(e)}function fo(e,t){return e=co(e),Ci(In.count(Kn(e),e)+(4===Kn(e).getDay()),t,2)}function ho(e){return e.getDay()}function po(e,t){return Ci(Rn.count(Kn(e)-1,e),t,2)}function go(e,t){return Ci(e.getFullYear()%100,t,2)}function mo(e,t){return Ci((e=co(e)).getFullYear()%100,t,2)}function yo(e,t){return Ci(e.getFullYear()%1e4,t,4)}function vo(e,t){var n=e.getDay();return Ci((e=n>=4||0===n?In(e):In.ceil(e)).getFullYear()%1e4,t,4)}function bo(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ci(t/60|0,"0",2)+Ci(t%60,"0",2)}function xo(e,t){return Ci(e.getUTCDate(),t,2)}function _o(e,t){return Ci(e.getUTCHours(),t,2)}function wo(e,t){return Ci(e.getUTCHours()%12||12,t,2)}function ko(e,t){return Ci(1+Nn.count(Qn(e),e),t,3)}function Ao(e,t){return Ci(e.getUTCMilliseconds(),t,3)}function Eo(e,t){return Ao(e,t)+"000"}function Oo(e,t){return Ci(e.getUTCMonth()+1,t,2)}function Do(e,t){return Ci(e.getUTCMinutes(),t,2)}function So(e,t){return Ci(e.getUTCSeconds(),t,2)}function Co(e){var t=e.getUTCDay();return 0===t?7:t}function Fo(e,t){return Ci(Hn.count(Qn(e)-1,e),t,2)}function jo(e){var t=e.getUTCDay();return t>=4||0===t?Xn(e):Xn.ceil(e)}function Mo(e,t){return e=jo(e),Ci(Xn.count(Qn(e),e)+(4===Qn(e).getUTCDay()),t,2)}function $o(e){return e.getUTCDay()}function No(e,t){return Ci(Gn.count(Qn(e)-1,e),t,2)}function Bo(e,t){return Ci(e.getUTCFullYear()%100,t,2)}function To(e,t){return Ci((e=jo(e)).getUTCFullYear()%100,t,2)}function zo(e,t){return Ci(e.getUTCFullYear()%1e4,t,4)}function Ro(e,t){var n=e.getUTCDay();return Ci((e=n>=4||0===n?Xn(e):Xn.ceil(e)).getUTCFullYear()%1e4,t,4)}function Po(){return"+0000"}function Lo(){return"%"}function Io(e){return+e}function Uo(e){return Math.floor(+e/1e3)}function qo(e){const t={};return n=>t[n]||(t[n]=e(n))}function Wo(e){const t=qo(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(e){const n=sn(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return function(e,t){return n=>{const r=e(n),i=r.indexOf(t);if(i<0)return r;let o=function(e,t){let n,r=e.lastIndexOf("e");if(r>0)return r;for(r=e.length;--r>t;)if(n=e.charCodeAt(r),n>=48&&n<=57)return r+1}(r,i);const a=oi;)if("0"!==r[o]){++o;break}return r.slice(0,o)+a}}(t(n),t(".1f")(1)[1])}return t(n)},formatSpan(e,r,i,o){o=sn(null==o?",f":o);const a=rn(e,r,i),s=Math.max(Math.abs(e),Math.abs(r));let u;if(null==o.precision)switch(o.type){case"s":return isNaN(u=fn(a,s))||(o.precision=u),n(o,s);case"":case"e":case"g":case"p":case"r":isNaN(u=dn(a,s))||(o.precision=u-("e"===o.type));break;case"f":case"%":isNaN(u=hn(a))||(o.precision=u-2*("%"===o.type))}return t(o)}}}let Ho,Go;function Vo(){return Ho=Wo({format:vn,formatPrefix:bn})}function Yo(e){return Wo(wn(e))}function Xo(e){return arguments.length?Ho=Yo(e):Ho}function Zo(e,t,n){we(n=n||{})||oe(`Invalid time multi-format specifier: ${n}`);const r=t(_r),i=t(xr),o=t(br),a=t(mr),s=t(gr),u=t(pr),l=t(hr),c=t(dr),f=e(n[wr]||".%L"),d=e(n[_r]||":%S"),h=e(n[xr]||"%I:%M"),p=e(n[br]||"%I %p"),g=e(n[mr]||n[yr]||"%a %d"),m=e(n[gr]||"%b %d"),y=e(n[pr]||"%B"),v=e(n[hr]||"%B"),b=e(n[dr]||"%Y");return e=>(r(e)vt(e)?t(e):Zo(t,Kr,e),utcFormat:e=>vt(e)?n(e):Zo(n,Qr,e),timeParse:qo(e.parse),utcParse:qo(e.utcParse)}}function Ko(){return Go=Jo({format:_i,parse:wi,utcFormat:ki,utcParse:Ai})}function Qo(e){return Jo(bi(e))}function ea(e){return arguments.length?Go=Qo(e):Go}xi=bi({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"]}),_i=xi.format,wi=xi.parse,ki=xi.utcFormat,Ai=xi.utcParse,Vo(),Ko();const ta=(e,t)=>rt({},e,t);function na(e,t){const n=e?Yo(e):Xo(),r=t?Qo(t):ea();return ta(n,r)}function ra(e,t){const n=arguments.length;return n&&2!==n&&oe("defaultLocale expects either zero or two arguments."),n?ta(Xo(e),ea(t)):ta(Xo(),ea())}function ia(){return Vo(),Ko(),ra()}const oa=/^(data:|([A-Za-z]+:)?\/\/)/,aa=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,sa=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,ua="file://";async function la(e,t){const n=await this.sanitize(e,t),r=n.href;return n.localFile?this.file(r):this.http(r,t)}async function ca(e,t){t=rt({},this.options,t);const n=this.fileAccess,r={href:null};let i,o,a;const s=aa.test(e.replace(sa,""));null!=e&&"string"==typeof e&&s||oe("Sanitize failure, invalid URI: "+Dt(e));const u=oa.test(e);return(a=t.baseURL)&&!u&&(e.startsWith("/")||a.endsWith("/")||(e="/"+e),e=a+e),o=(i=e.startsWith(ua))||"file"===t.mode||"http"!==t.mode&&!u&&n,i?e=e.slice(ua.length):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(r,"localFile",{value:!!o}),r.href=e,t.target&&(r.target=t.target+""),t.rel&&(r.rel=t.rel+""),"image"===t.context&&t.crossOrigin&&(r.crossOrigin=t.crossOrigin+""),r}function fa(e){return e?t=>new Promise(((n,r)=>{e.readFile(t,((e,t)=>{e?r(e):n(t)}))})):da}async function da(){oe("No file system access.")}function ha(e){return e?async function(t,n){const r=rt({},this.options.http,n),i=n&&n.response,o=await e(t,r);return o.ok?Ye(o[i])?o[i]():o.text():oe(o.status+""+o.statusText)}:pa}async function pa(){oe("No HTTP fetch method available.")}const ga=e=>null!=e&&e==e,ma=e=>!(Number.isNaN(+e)||e instanceof Date),ya={boolean:St,integer:Se,number:Se,date:Ft,string:jt,unknown:le},va=[e=>"true"===e||"false"===e||!0===e||!1===e,e=>ma(e)&&Number.isInteger(+e),ma,e=>!Number.isNaN(Date.parse(e))],ba=["boolean","integer","number","date"];function xa(e,t){if(!e||!e.length)return"unknown";const n=e.length,r=va.length,i=va.map(((e,t)=>t+1));for(let o,a,s=0,u=0;s0===e?t:e),0)-1]}function _a(e,t){return t.reduce(((t,n)=>(t[n]=xa(e,n),t)),{})}function wa(e){const t=function(t,n){const r={delimiter:e};return ka(t,n?rt(n,r):r)};return t.responseType="text",t}function ka(e,t){return t.header&&(e=t.header.map(Dt).join(t.delimiter)+"\n"+e),qt(t.delimiter).parse(e+"")}function Aa(e,t){const n=t&&t.property?se(t.property):le;return!we(e)||(r=e,"function"==typeof Buffer&&Ye(Buffer.isBuffer)&&Buffer.isBuffer(r))?n(JSON.parse(e)):function(e,t){return!_e(e)&>(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}(n(e),t);var r}ka.responseType="text",Aa.responseType="json";const Ea={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function Oa(e,t){let n,r,i,o;return e=Aa(e,t),t&&t.feature?(n=Ht,i=t.feature):t&&t.mesh?(n=Xt,i=t.mesh,o=Ea[t.filter]):oe("Missing TopoJSON feature or mesh parameter."),r=(r=e.objects[i])?n(e,r,o):oe("Invalid TopoJSON object: "+i),r&&r.features||[r]}Oa.responseType="json";const Da={dsv:ka,csv:wa(","),tsv:wa("\t"),json:Aa,topojson:Oa};function Sa(e,t){return arguments.length>1?(Da[e]=t,this):st(Da,e)?Da[e]:null}function Ca(e){const t=Sa(e);return t&&t.responseType||"text"}function Fa(e,t,n,r){const i=Sa((t=t||{}).type||"json");return i||oe("Unknown data format type: "+t.type),e=i(e,t),t.parse&&function(e,t,n,r){if(!e.length)return;const i=ea();n=n||i.timeParse,r=r||i.utcParse;let o,a,s,u,l,c,f=e.columns||Object.keys(e[0]);"auto"===t&&(t=_a(e,f)),f=Object.keys(t);const d=f.map((e=>{const i=t[e];let o,a;if(i&&(i.startsWith("date:")||i.startsWith("utc:")))return o=i.split(/:(.+)?/,2),a=o[1],("'"===a[0]&&"'"===a[a.length-1]||'"'===a[0]&&'"'===a[a.length-1])&&(a=a.slice(1,-1)),("utc"===o[0]?r:n)(a);if(!ya[i])throw Error("Illegal format pattern: "+e+":"+i);return ya[i]}));for(s=0,l=e.length,c=f.length;s({options:t||{},sanitize:ca,load:la,fileAccess:!1,file:fa(null),http:ha(e)})}("undefined"!=typeof fetch&&fetch);function Ma(e){const t=e||le,n=[],r={};return n.add=e=>{const i=t(e);return r[i]||(r[i]=1,n.push(e)),n},n.remove=e=>{const i=t(e);if(r[i]){r[i]=0;const t=n.indexOf(e);t>=0&&n.splice(t,1)}return n},n}async function $a(e,t){try{await t(e)}catch(t){e.error(t)}}const Na=Symbol("vega_id");let Ba=1;function Ta(e){return!(!e||!za(e))}function za(e){return e[Na]}function Ra(e,t){return e[Na]=t,e}function Pa(e){const t=e===Object(e)?e:{data:e};return za(t)?t:Ra(t,Ba++)}function La(e){return Ia(e,Pa({}))}function Ia(e,t){for(const n in e)t[n]=e[n];return t}function Ua(e,t){return Ra(t,za(e))}function qa(e,t){return e?t?(n,r)=>e(n,r)||za(t(n))-za(t(r)):(t,n)=>e(t,n)||za(t)-za(n):null}function Wa(e){return e&&e.constructor===Ha}function Ha(){const e=[],t=[],n=[],r=[],i=[];let o=null,a=!1;return{constructor:Ha,insert(t){const n=Ge(t),r=n.length;for(let t=0;t{p(e)&&(l[za(e)]=-1)}));for(f=0,d=e.length;f0&&(y(g,p,h.value),s.modifies(p));for(f=0,d=i.length;f{p(e)&&l[za(e)]>0&&y(e,h.field,h.value)})),s.modifies(h.field);if(a)s.mod=t.length||r.length?u.filter((e=>l[za(e)]>0)):u.slice();else for(m in c)s.mod.push(c[m]);return(o||null==o&&(t.length||r.length))&&s.clean(!0),s}}}const Ga="_:mod:_";function Va(){Object.defineProperty(this,Ga,{writable:!0,value:{}})}Va.prototype={set(e,t,n,r){const i=this,o=i[e],a=i[Ga];return null!=t&&t>=0?(o[t]!==n||r)&&(o[t]=n,a[t+":"+e]=-1,a[e]=-1):(o!==n||r)&&(i[e]=n,a[e]=_e(n)?1+n.length:-1),i},modified(e,t){const n=this[Ga];if(!arguments.length){for(const e in n)if(n[e])return!0;return!1}if(_e(e)){for(let t=0;t=0?t+1{a instanceof Za?(a!==this&&(t&&a.targets().add(this),o.push(a)),i.push({op:a,name:e,index:n})):r.set(e,n,a)};for(a in e)if(s=e[a],"pulse"===a)Ge(s).forEach((e=>{e instanceof Za?e!==this&&(e.targets().add(this),o.push(e)):oe("Pulse parameters must be operator instances.")})),this.source=s;else if(_e(s))for(r.set(a,-1,Array(u=s.length)),l=0;l{const n=Date.now();return n-t>e?(t=n,1):0}))},debounce(e){const t=es();return this.targets().add(es(null,null,nt(e,(e=>{const n=e.dataflow;t.receive(e),n&&n.run&&n.run()})))),t},between(e,t){let n=!1;return e.targets().add(es(null,null,(()=>n=!0))),t.targets().add(es(null,null,(()=>n=!1))),this.filter((()=>n))},detach(){this._filter=de,this._targets=null}};const ts={skip:!0};function ns(e,t,n,r,i,o){const a=rt({},o,ts);let s,u;Ye(n)||(n=tt(n)),void 0===r?s=t=>e.touch(n(t)):Ye(r)?(u=new Za(null,r,i,!1),s=t=>{u.evaluate(t);const r=n(t),i=u.value;Wa(i)?e.pulse(r,i,o):e.update(r,i,a)}):s=t=>e.update(n(t),r,a),t.apply(s)}function rs(e,t,n,r,i,o){if(void 0===r)t.targets().add(n);else{const a=o||{},s=new Za(null,function(e,t){return t=Ye(t)?t:tt(t),e?function(n,r){const i=t(n,r);return e.skip()||(e.skip(i!==this.value).value=i),i}:t}(n,r),i,!1);s.modified(a.force),s.rank=t.rank,t.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),e.connect(n,[s]))}}const is={};function os(e,t,n){this.dataflow=e,this.stamp=null==t?-1:t,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function as(e,t){const n=[];return Nt(e,t,(e=>n.push(e))),n}function ss(e,t){const n={};return e.visit(t,(e=>{n[za(e)]=1})),e=>n[za(e)]?null:e}function us(e,t){return e?(n,r)=>e(n,r)&&t(n,r):t}function ls(e,t,n,r){const i=this;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=r||null,this.pulses=n;for(const e of n)if(e.stamp===t){if(e.fields){const t=i.fields||(i.fields={});for(const n in e.fields)t[n]=1}e.changed(i.ADD)&&(o|=i.ADD),e.changed(i.REM)&&(o|=i.REM),e.changed(i.MOD)&&(o|=i.MOD)}this.changes=o}function cs(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}os.prototype={StopPropagation:is,ADD:1,REM:2,MOD:4,ADD_REM:3,ADD_MOD:5,ALL:7,REFLOW:8,SOURCE:16,NO_SOURCE:32,NO_FIELDS:64,fork(e){return new os(this.dataflow).init(this,e)},clone(){const e=this.fork(7);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(23)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new os(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,!e.fields||64&t||(n.fields=e.fields),1&t?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),2&t?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),4&t?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),32&t?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||7;return 1&t&&this.add.length||2&t&&this.rem.length||4&t&&this.mod.length},reflow(e){if(e)return this.fork(7).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(4,ss(this,1))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return _e(e)?e.forEach((e=>t[e]=!0)):t[e]=!0,this},modified(e,t){const n=this.fields;return!(!t&&!this.mod.length||!n)&&(arguments.length?_e(e)?e.some((e=>n[e])):n[e]:!!n)},filter(e,t){const n=this;return 1&e&&(n.addF=us(n.addF,t)),2&e&&(n.remF=us(n.remF,t)),4&e&&(n.modF=us(n.modF,t)),16&e&&(n.srcF=us(n.srcF,t)),n},materialize(e){const t=this;return 1&(e=e||7)&&t.addF&&(t.add=as(t.add,t.addF),t.addF=null),2&e&&t.remF&&(t.rem=as(t.rem,t.remF),t.remF=null),4&e&&t.modF&&(t.mod=as(t.mod,t.modF),t.modF=null),16&e&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,r=t;if(16&e)return Nt(n.source,n.srcF,r),n;1&e&&Nt(n.add,n.addF,r),2&e&&Nt(n.rem,n.remF,r),4&e&&Nt(n.mod,n.modF,r);const i=n.source;if(8&e&&i){const e=n.add.length+n.mod.length;e===i.length||Nt(i,e?ss(n,5):n.srcF,r)}return n}},ft(ls,os,{fork(e){const t=new os(this.dataflow).init(this,e&this.NO_FIELDS);return void 0!==e&&(e&t.ADD&&this.visit(t.ADD,(e=>t.add.push(e))),e&t.REM&&this.visit(t.REM,(e=>t.rem.push(e))),e&t.MOD&&this.visit(t.MOD,(e=>t.mod.push(e)))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?_e(e)?e.some((e=>n[e])):n[e]:0},filter(){oe("MultiPulse does not support filtering.")},materialize(){oe("MultiPulse does not support materialization.")},visit(e,t){const n=this,r=n.pulses,i=r.length;let o=0;if(e&n.SOURCE)for(;ot&&(o=n-1>>1,i=e[o],r(a,i)<0);)e[n]=i,n=o;return e[n]=a}function hs(){this.logger(xe()),this.logLevel(me),this._clock=0,this._rank=0,this._locale=ra();try{this._loader=ja()}catch(e){}this._touched=Ma(ue),this._input={},this._pulse=null,this._heap=function(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),ds(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let r;return t.length?(r=t[0],t[0]=n,function(e,t,n){const r=t,i=e.length,o=e[t];let a,s=1+(t<<1);for(;s=0&&(s=a),e[t]=e[s],s=1+((t=s)<<1);e[t]=o,ds(e,r,t,n)}(t,0,e)):r=n,r}}}(((e,t)=>e.qrank-t.qrank)),this._postrun=[]}function ps(e){return function(){return this._log[e].apply(this,arguments)}}function gs(e,t){Za.call(this,e,null,t)}hs.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:ps("error"),warn:ps("warn"),info:ps("info"),debug:ps("debug"),logLevel:ps("level"),cleanThreshold:1e4,add:function(e,t,n,r){let i,o=1;return e instanceof Za?i=e:e&&e.prototype instanceof Za?i=new e:Ye(e)?i=new Za(null,e):(o=0,i=new Za(e,t)),this.rank(i),o&&(r=n,n=t),n&&this.connect(i,i.parameters(n,r)),this.touch(i),i},connect:function(e,t){const n=e.rank,r=t.length;for(let i=0;i=0;)t.push(n=r[i]),n===e&&oe("Cycle detected in dataflow graph.")},pulse:function(e,t,n){this.touch(e,n||fs);const r=new os(this,this._clock+(this._pulse?0:1)),i=e.pulse&&e.pulse.source||[];return r.target=e,this._input[e.id]=t.pulse(r,i),this},touch:function(e,t){const n=t||fs;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this},update:function(e,t,n){const r=n||fs;return(e.set(t)||r.force)&&this.touch(e,r),this},changeset:Ha,ingest:function(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))},parse:function(e,t){const n=this.locale();return Fa(e,t,n.timeParse,n.utcParse)},preload:async function(e,t,n){const r=this,i=r._pending||function(e){let t;const n=new Promise((e=>t=e));return n.requests=0,n.done=()=>{0==--n.requests&&(e._pending=null,t(e))},e._pending=n}(r);i.requests+=1;const o=await r.request(t,n);return r.pulse(e,r.changeset().remove(de).insert(o.data||[])),i.done(),o},request:async function(e,t){const n=this;let r,i=0;try{r=await n.loader().load(e,{context:"dataflow",response:Ca(t&&t.type)});try{r=n.parse(r,t)}catch(t){i=-2,n.warn("Data ingestion failed",e,t)}}catch(t){i=-1,n.warn("Loading failed",e,t)}return{data:r,status:i}},events:function(e,t,n,r){const i=this,o=es(n,r),a=function(e){e.dataflow=i;try{o.receive(e)}catch(e){i.error(e)}finally{i.run()}};let s;s="string"==typeof e&&"undefined"!=typeof document?document.querySelectorAll(e):Ge(e);const u=s.length;for(let e=0;er._enqueue(e,!0))),r._touched=Ma(ue);let a,s,u,l=0;try{for(;r._heap.size()>0;)a=r._heap.pop(),a.rank===a.qrank?(s=a.run(r._getPulse(a,e)),s.then?s=await s:s.async&&(i.push(s.async),s=is),s!==is&&a._targets&&a._targets.forEach((e=>r._enqueue(e))),++l):r._enqueue(a,!0)}catch(e){r._heap.clear(),u=e}if(r._input={},r._pulse=null,r.debug(`Pulse ${o}: ${l} operators`),u&&(r._postrun=[],r.error(u)),r._postrun.length){const e=r._postrun.sort(((e,t)=>t.priority-e.priority));r._postrun=[];for(let t=0;tr.runAsync(null,(()=>{e.forEach((e=>{try{e(r)}catch(e){r.error(e)}}))})))),r},run:function(e,t,n){return this._pulse?cs(this):(this.evaluate(e,t,n),this)},runAsync:async function(e,t,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(r,r),this._running},runAfter:function(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(e){this.error(e)}},_enqueue:function(e,t){const n=e.stampe.pulse)),t):this._input[e.id]||function(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==is&&(e.source=t.source),e)}(this._pulse,n&&n.pulse)}},ft(gs,Za,{run(e){if(e.stampthis.pulse=e)):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const ms={};function ys(e){const t=vs(e);return t&&t.Definition||null}function vs(e){return e=e&&e.toLowerCase(),st(ms,e)?ms[e]:null}function bs(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n=i)&&(n=i)}return n}function xs(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function _s(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(et?1:0)}function ws(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=void 0===i?_s:function(e=ur){if(e===ur)return _s;if("function"!=typeof e)throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||0===r?r:(0===e(n,n))-(0===e(t,t))}}(i);r>n;){if(r-n>600){const o=r-n+1,a=t-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*u*(o-u)/o)*(a-o/2<0?-1:1);ws(e,t,Math.max(n,Math.floor(t-a*u/o+l)),Math.min(r,Math.floor(t+(o-a)*u/o+l)),i)}const o=e[t];let a=n,s=r;for(ks(e,n,t),i(e[r],o)>0&&ks(e,n,r);a0;)--s}0===i(e[n],o)?ks(e,n,s):(++s,ks(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function ks(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function As(e){return null===e?NaN:+e}function Es(e,t,n){if(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r=+r)>=r&&(yield r)}}(e,n)),(r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return xs(e);if(t>=1)return bs(e);var r,i=(r-1)*t,o=Math.floor(i),a=bs(ws(e,o).subarray(0,o+1));return a+(xs(e.subarray(o+1))-a)*(i-o)}}function Os(e,t,n=As){if((r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),a=+n(e[o],o,e);return a+(+n(e[o+1],o+1,e)-a)*(i-o)}}function Ds(e,t){return Es(e,.5,t)}function*Ss(e,t){if(null==t)for(let t of e)null!=t&&""!==t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)r=t(r,++n,e),null!=r&&""!==r&&(r=+r)>=r&&(yield r)}}function Cs(e,t,n){const r=Float64Array.from(Ss(e,n));return r.sort(ur),t.map((e=>Os(r,e)))}function Fs(e,t){return Cs(e,[.25,.5,.75],t)}function js(e,t){const n=e.length,r=function(e,t){const n=function(e,t){let n,r=0,i=0,o=0;if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(n=t-i,i+=n/++r,o+=n*(t-i));else{let a=-1;for(let s of e)null!=(s=t(s,++a,e))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(e,t);return n?Math.sqrt(n):n}(e,t),i=Fs(e,t),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function Ms(e){const t=e.maxbins||20,n=e.base||10,r=Math.log(n),i=e.divide||[5,2];let o,a,s,u,l,c,f=e.extent[0],d=e.extent[1];const h=e.span||d-f||Math.abs(f)||1;if(e.step)o=e.step;else if(e.steps){for(u=h/t,l=0,c=e.steps.length;lt;)o*=n;for(l=0,c=i.length;l=s&&h/u<=t&&(o=u)}u=Math.log(o);const p=u>=0?0:1+~~(-u/r),g=Math.pow(n,-p-1);return(e.nice||void 0===e.nice)&&(u=Math.floor(f/o+g)*o,f=fe);const i=e.length,o=new Float64Array(i);let a,s=0,u=1,l=r(e[0]),c=l,f=l+t;for(;u=f){for(c=(l+c)/2;s>1);ia;)e[i--]=e[o]}o=a,a=r}return e}(o,t+t/4):o}function zs(e){return function(){return(e=(1103515245*e+12345)%2147483647)/2147483647}}function Rs(e,t){let n,r,i;null==t&&(t=e,e=0);const o={min(e){return arguments.length?(n=e||0,i=r-n,o):n},max(e){return arguments.length?(r=e||0,i=r-n,o):r},sample:()=>n+Math.floor(i*$s()),pdf:e=>e===Math.floor(e)&&e>=n&&e=r?1:(t-n+1)/i},icdf:e=>e>=0&&e<=1?n-1+Math.floor(e*i):NaN};return o.min(e).max(t)}const Ps=Math.sqrt(2*Math.PI),Ls=Math.SQRT2;let Is=NaN;function Us(e,t){e=e||0,t=null==t?1:t;let n,r,i=0,o=0;if(Is==Is)i=Is,Is=NaN;else{do{i=2*$s()-1,o=2*$s()-1,n=i*i+o*o}while(0===n||n>1);r=Math.sqrt(-2*Math.log(n)/n),i*=r,Is=o*r}return e+i*t}function qs(e,t,n){const r=(e-(t||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*Ps)}function Ws(e,t,n){const r=(e-(t=t||0))/(n=null==n?1:n),i=Math.abs(r);let o;if(i>37)o=0;else{const e=Math.exp(-i*i/2);let t;i<7.07106781186547?(t=.0352624965998911*i+.700383064443688,t=t*i+6.37396220353165,t=t*i+33.912866078383,t=t*i+112.079291497871,t=t*i+221.213596169931,t=t*i+220.206867912376,o=e*t,t=.0883883476483184*i+1.75566716318264,t=t*i+16.064177579207,t=t*i+86.7807322029461,t=t*i+296.564248779674,t=t*i+637.333633378831,t=t*i+793.826512519948,t=t*i+440.413735824752,o/=t):(t=i+.65,t=i+4/t,t=i+3/t,t=i+2/t,t=i+1/t,o=e/t/2.506628274631)}return r>0?1-o:o}function Hs(e,t,n){return e<0||e>1?NaN:(t||0)+(null==n?1:n)*Ls*function(e){let t,n=-Math.log((1-e)*(1+e));return n<6.25?(n-=3.125,t=-364441206401782e-35,t=t*n-16850591381820166e-35,t=128584807152564e-32+t*n,t=11157877678025181e-33+t*n,t=t*n-1333171662854621e-31,t=20972767875968562e-33+t*n,t=6637638134358324e-30+t*n,t=t*n-4054566272975207e-29,t=t*n-8151934197605472e-29,t=26335093153082323e-28+t*n,t=t*n-12975133253453532e-27,t=t*n-5415412054294628e-26,t=1.0512122733215323e-9+t*n,t=t*n-4.112633980346984e-9,t=t*n-2.9070369957882005e-8,t=4.2347877827932404e-7+t*n,t=t*n-13654692000834679e-22,t=t*n-13882523362786469e-21,t=.00018673420803405714+t*n,t=t*n-.000740702534166267,t=t*n-.006033670871430149,t=.24015818242558962+t*n,t=1.6536545626831027+t*n):n<16?(n=Math.sqrt(n)-3.25,t=2.2137376921775787e-9,t=9.075656193888539e-8+t*n,t=t*n-2.7517406297064545e-7,t=1.8239629214389228e-8+t*n,t=15027403968909828e-22+t*n,t=t*n-4013867526981546e-21,t=29234449089955446e-22+t*n,t=12475304481671779e-21+t*n,t=t*n-47318229009055734e-21,t=6828485145957318e-20+t*n,t=24031110387097894e-21+t*n,t=t*n-.0003550375203628475,t=.0009532893797373805+t*n,t=t*n-.0016882755560235047,t=.002491442096107851+t*n,t=t*n-.003751208507569241,t=.005370914553590064+t*n,t=1.0052589676941592+t*n,t=3.0838856104922208+t*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,t=-27109920616438573e-27,t=t*n-2.555641816996525e-10,t=1.5076572693500548e-9+t*n,t=t*n-3.789465440126737e-9,t=7.61570120807834e-9+t*n,t=t*n-1.496002662714924e-8,t=2.914795345090108e-8+t*n,t=t*n-6.771199775845234e-8,t=2.2900482228026655e-7+t*n,t=t*n-9.9298272942317e-7,t=4526062597223154e-21+t*n,t=t*n-1968177810553167e-20,t=7599527703001776e-20+t*n,t=t*n-.00021503011930044477,t=t*n-.00013871931833623122,t=1.0103004648645344+t*n,t=4.849906401408584+t*n):t=1/0,t*e}(2*e-1)}function Gs(e,t){let n,r;const i={mean(e){return arguments.length?(n=e||0,i):n},stdev(e){return arguments.length?(r=null==e?1:e,i):r},sample:()=>Us(n,r),pdf:e=>qs(e,n,r),cdf:e=>Ws(e,n,r),icdf:e=>Hs(e,n,r)};return i.mean(e).stdev(t)}function Vs(e,t){const n=Gs();let r=0;const i={data(n){return arguments.length?(e=n,r=n?n.length:0,i.bandwidth(t)):e},bandwidth(n){return arguments.length?(!(t=n)&&e&&(t=js(e)),i):t},sample:()=>e[~~($s()*r)]+t*n.sample(),pdf(i){let o=0,a=0;for(;aYs(n,r),pdf:e=>Xs(e,n,r),cdf:e=>Zs(e,n,r),icdf:e=>Js(e,n,r)};return i.mean(e).stdev(t)}function Qs(e,t){let n,r=0;const i={weights(e){return arguments.length?(n=function(e){const t=[];let n,i=0;for(n=0;n=t&&e<=n?1/(n-t):0}function nu(e,t,n){return null==n&&(n=null==t?1:t,t=0),en?1:(e-t)/(n-t)}function ru(e,t,n){return null==n&&(n=null==t?1:t,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function iu(e,t){let n,r;const i={min(e){return arguments.length?(n=e||0,i):n},max(e){return arguments.length?(r=null==e?1:e,i):r},sample:()=>eu(n,r),pdf:e=>tu(e,n,r),cdf:e=>nu(e,n,r),icdf:e=>ru(e,n,r)};return null==t&&(t=null==e?1:e,e=0),i.min(e).max(t)}function ou(e,t,n,r){const i=r-e*e,o=Math.abs(i)<1e-24?0:(n-e*t)/i;return[t-o*e,o]}function au(e,t,n,r){e=e.filter((e=>{let r=t(e),i=n(e);return null!=r&&(r=+r)>=r&&null!=i&&(i=+i)>=i})),r&&e.sort(((e,n)=>t(e)-t(n)));const i=e.length,o=new Float64Array(i),a=new Float64Array(i);let s,u,l,c=0,f=0,d=0;for(l of e)o[c]=s=+t(l),a[c]=u=+n(l),++c,f+=(s-f)/c,d+=(u-d)/c;for(c=0;c=i&&null!=o&&(o=+o)>=o&&r(i,o,++a)}function uu(e,t,n,r,i){let o=0,a=0;return su(e,t,n,((e,t)=>{const n=t-i(e),s=t-r;o+=n*n,a+=s*s})),1-o/a}function lu(e,t,n){let r=0,i=0,o=0,a=0,s=0;su(e,t,n,((e,t)=>{++s,r+=(e-r)/s,i+=(t-i)/s,o+=(e*t-o)/s,a+=(e*e-a)/s}));const u=ou(r,i,o,a),l=e=>u[0]+u[1]*e;return{coef:u,predict:l,rSquared:uu(e,t,n,i,l)}}function cu(e,t,n){let r=0,i=0,o=0,a=0,s=0;su(e,t,n,((e,t)=>{++s,e=Math.log(e),r+=(e-r)/s,i+=(t-i)/s,o+=(e*t-o)/s,a+=(e*e-a)/s}));const u=ou(r,i,o,a),l=e=>u[0]+u[1]*Math.log(e);return{coef:u,predict:l,rSquared:uu(e,t,n,i,l)}}function fu(e,t,n){const[r,i,o,a]=au(e,t,n);let s,u,l,c=0,f=0,d=0,h=0,p=0;su(e,t,n,((e,t)=>{s=r[p++],u=Math.log(t),l=s*t,c+=(t*u-c)/p,f+=(l-f)/p,d+=(l*u-d)/p,h+=(s*l-h)/p}));const[g,m]=ou(f/a,c/a,d/a,h/a),y=e=>Math.exp(g+m*(e-o));return{coef:[Math.exp(g-m*o),m],predict:y,rSquared:uu(e,t,n,a,y)}}function du(e,t,n){let r=0,i=0,o=0,a=0,s=0,u=0;su(e,t,n,((e,t)=>{const n=Math.log(e),l=Math.log(t);++u,r+=(n-r)/u,i+=(l-i)/u,o+=(n*l-o)/u,a+=(n*n-a)/u,s+=(t-s)/u}));const l=ou(r,i,o,a),c=e=>l[0]*Math.pow(e,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:uu(e,t,n,s,c)}}function hu(e,t,n){const[r,i,o,a]=au(e,t,n),s=r.length;let u,l,c,f,d=0,h=0,p=0,g=0,m=0;for(u=0;ub*(e-=o)*e+x*e+_+a;return{coef:[_-x*o+b*o*o+a,x-2*b*o,b],predict:w,rSquared:uu(e,t,n,a,w)}}function pu(e,t,n,r){if(1===r)return lu(e,t,n);if(2===r)return hu(e,t,n);const[i,o,a,s]=au(e,t,n),u=i.length,l=[],c=[],f=r+1;let d,h,p,g,m;for(d=0;dMath.abs(e[r][a])&&(a=i);for(o=r;o=r;o--)e[o][i]-=e[o][r]*e[r][i]/e[r][r]}for(i=t-1;i>=0;--i){for(s=0,o=i+1;o{e-=a;let t=s+y[0]+y[1]*e+y[2]*e*e;for(d=3;d=0;--o)for(s=t[o],u=1,i[o]+=s,a=1;a<=o;++a)u*=(o+1-a)/a,i[o-a]+=s*Math.pow(n,a)*u;return i[0]+=r,i}const mu=2,yu=1e-12;function vu(e,t,n,r){const[i,o,a,s]=au(e,t,n,!0),u=i.length,l=Math.max(2,~~(r*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let e=-1;++e<=mu;){const t=[0,l-1];for(let e=0;ei[a]-n?r:a;let u=0,l=0,h=0,p=0,g=0;const m=1/Math.abs(i[s]-n||1);for(let e=r;e<=a;++e){const t=i[e],r=o[e],a=bu(Math.abs(n-t)*m)*d[e],s=t*a;u+=a,l+=s,h+=r*a,p+=r*s,g+=t*s}const[y,v]=ou(l/u,h/u,p/u,g/u);c[e]=y+v*n,f[e]=Math.abs(o[e]-c[e]),xu(i,e+1,t)}if(e===mu)break;const n=Ds(f);if(Math.abs(n)=1?yu:(t=1-e*e)*t}return function(e,t,n,r){const i=e.length,o=[];let a,s=0,u=0,l=[];for(;s=e.length))for(;t>i&&e[o]-r<=r-e[i];)n[0]=++i,n[1]=o,++o}const _u=.5*Math.PI/180;function wu(e,t,n,r){n=n||25,r=Math.max(n,r||200);const i=t=>[t,e(t)],o=t[0],a=t[1],s=a-o,u=s/r,l=[i(o)],c=[];if(n===r){for(let e=1;e0;)c.push(i(o+e/n*s));let f=l[0],d=c[c.length-1];const h=1/s,p=function(e,t){let n=e,r=e;const i=t.length;for(let e=0;er&&(r=i)}return 1/(r-n)}(f[1],c);for(;d;){const e=i((f[0]+d[0])/2);e[0]-f[0]>=u&&ku(f,e,d,h,p)>_u?c.push(e):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function ku(e,t,n,r,i){const o=Math.atan2(i*(n[1]-e[1]),r*(n[0]-e[0])),a=Math.atan2(i*(t[1]-e[1]),r*(t[0]-e[0]));return Math.abs(o-a)}function Au(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r{const n=t.length;let r=1,i=String(t[0](e));for(;r{},Su={init:Du,add:Du,rem:Du,idx:0},Cu={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.sum,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||void 0===e.max)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3}},Fu=Object.keys(Cu).filter((e=>"__count__"!==e));function ju(e,t){return Cu[e](t)}function Mu(e,t){return e.idx-t.idx}function $u(){this.valid=0,this.missing=0,this._ops.forEach((e=>e.init(this)))}function Nu(e,t){null!=e&&""!==e?e==e&&(++this.valid,this._ops.forEach((n=>n.add(this,e,t)))):++this.missing}function Bu(e,t){null!=e&&""!==e?e==e&&(--this.valid,this._ops.forEach((n=>n.rem(this,e,t)))):--this.missing}function Tu(e){return this._out.forEach((t=>e[t.out]=t.value(this))),e}function zu(e,t){const n=t||le,r=function(e){const t={};e.forEach((e=>t[e.name]=e));const n=e=>{e.req&&e.req.forEach((e=>{t[e]||n(t[e]=Cu[e]())}))};return e.forEach(n),Object.values(t).sort(Mu)}(e),i=e.slice().sort(Mu);function o(e){this._ops=r,this._out=i,this.cell=e,this.init()}return o.prototype.init=$u,o.prototype.add=Nu,o.prototype.rem=Bu,o.prototype.set=Tu,o.prototype.get=n,o.fields=e.map((e=>e.out)),o}function Ru(e){this._key=e?se(e):za,this.reset()}[...Fu,"__count__"].forEach((e=>{Cu[e]=function(e,t){return n=>rt({name:e,out:n||e},Su,t)}(e,Cu[e])}));const Pu=Ru.prototype;function Lu(e){gs.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}function Iu(e){gs.call(this,null,e)}function Uu(e,t,n){const r=e;let i=t||[],o=n||[],a={},s=0;return{add:e=>o.push(e),remove:e=>a[r(e)]=++s,size:()=>i.length,data:(e,t)=>(s&&(i=i.filter((e=>!a[r(e)])),a={},s=0),t&&e&&i.sort(e),o.length&&(i=e?kt(e,i,o.sort(e)):i.concat(o),o=[]),i)}}function qu(e){gs.call(this,[],e)}function Wu(e){Za.call(this,null,Hu,e)}function Hu(e){return this.value&&!e.modified()?this.value:Ze(e.fields,e.orders)}function Gu(e){gs.call(this,null,e)}function Vu(e){gs.call(this,null,e)}Pu.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},Pu.add=function(e){this._add.push(e)},Pu.rem=function(e){this._rem.push(e)},Pu.values=function(){if(this._get=null,0===this._rem.length)return this._add;const e=this._add,t=this._rem,n=this._key,r=e.length,i=t.length,o=Array(r-i),a={};let s,u,l;for(s=0;s=0;)r=e(t[i])+"",st(n,r)||(n[r]=1,++o);return o},Pu.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=ot(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},Pu.argmin=function(e){return this.extent(e)[0]||{}},Pu.argmax=function(e){return this.extent(e)[1]||{}},Pu.min=function(e){const t=this.extent(e)[0];return null!=t?e(t):void 0},Pu.max=function(e){const t=this.extent(e)[1];return null!=t?e(t):void 0},Pu.quartile=function(e){return this._get===e&&this._q||(this._q=Fs(this.values(),e),this._get=e),this._q},Pu.q1=function(e){return this.quartile(e)[0]},Pu.q2=function(e){return this.quartile(e)[1]},Pu.q3=function(e){return this.quartile(e)[2]},Pu.ci=function(e){return this._get===e&&this._ci||(this._ci=Bs(this.values(),1e3,.05,e),this._get=e),this._ci},Pu.ci0=function(e){return this.ci(e)[0]},Pu.ci1=function(e){return this.ci(e)[1]},Lu.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Fu},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},ft(Lu,gs,{transform(e,t){const n=this,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.modified();return n.stamp=r.stamp,n.value&&(i||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(e):{},t.visit(t.SOURCE,(e=>n.add(e)))):(n.value=n.value||n.init(e),t.visit(t.REM,(e=>n.rem(e))),t.visit(t.ADD,(e=>n.add(e)))),r.modifies(n._outputs),n._drop=!1!==e.drop,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&r.clean(!0).runAfter((()=>this.clean())),n.changes(r)},cross(){const e=this,t=e.value,n=e._dnames,r=n.map((()=>({}))),i=n.length;function o(e){let t,o,a,s;for(t in e)for(a=e[t].tuple,o=0;o{const t=ee(e);return i(e),n.push(t),t})),this.cellkey=e.key?e.key:Eu(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],a=e.ops||["count"],s=e.as||[],u=o.length,l={};let c,f,d,h,p,g;for(u!==a.length&&oe("Unmatched number of fields and aggregate ops."),g=0;gzu(e,e.field))),{}},cellkey:Eu(),cell(e,t){let n=this.value[e];return n?0===n.num&&this._drop&&n.stamp{const t=r(e);e[s]=t,e[u]=null==t?null:i+o*(1+(t-i)/o)}:e=>e[s]=r(e)),t.modifies(n?a:s)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=Ms(e),r=n.step;let i,o,a=n.start,s=a+Math.ceil((n.stop-a)/r)*r;null!=(i=e.anchor)&&(o=i-(a+r*Math.floor((i-a)/r)),a+=o,s+=o);const u=function(e){let n=Se(t(e));return null==n?null:ns?1/0:(n=Math.max(a,Math.min(n,s-r)),a+r*Math.floor(1e-14+(n-a)/r))};return u.start=a,u.stop=n.stop,u.step=r,this.value=Q(u,te(t),e.name||"bin_"+ee(t))}}),qu.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},ft(qu,gs,{transform(e,t){const n=t.fork(t.ALL),r=Uu(za,this.value,n.materialize(n.ADD).add),i=e.sort,o=t.changed()||i&&(e.modified("sort")||t.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(qa(i),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}}),ft(Wu,Za),Gu.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]},ft(Gu,gs,{transform(e,t){const n=t=>n=>{for(var r,i=function(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase()}return e.match(n)}(s(n),e.case,o)||[],u=0,l=i.length;ui[e]=1+(i[e]||0))),c=n((e=>i[e]-=1));return r?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return!e.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),!e.modified("pattern")&&this._match||(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,r=this._tuples||(this._tuples={}),i=t[0],o=t[1],a=e.fork(e.NO_SOURCE|e.NO_FIELDS);let s,u,l;for(s in n)u=r[s],l=n[s]||0,!u&&l?(r[s]=u=Pa({}),u[i]=s,u[o]=l,a.add.push(u)):0===l?(u&&a.rem.push(u),n[s]=null,r[s]=null):u[o]!==l&&(u[o]=l,a.mod.push(u));return a.modifies(t)}}),Vu.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},ft(Vu,gs,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.as||["a","b"],i=r[0],o=r[1],a=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let s=this.value;return a?(s&&(n.rem=s),s=t.materialize(t.SOURCE).source,n.add=this.value=function(e,t,n,r){for(var i,o,a=[],s={},u=e.length,l=0;lZu(e,t)))):typeof r[n]===Xu&&r[n](e[n]);return r}function Ju(e){gs.call(this,null,e)}const Ku=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],Qu={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:Ku},{name:"weights",type:"number",array:!0}]};function el(e,t){return e?e.map(((e,n)=>t[n]||ee(e))):null}function tl(e,t,n){const r=[],i=e=>e(u);let o,a,s,u,l,c;if(null==t)r.push(e.map(n));else for(o={},a=0,s=e.length;at(n,e)),te(t),ee(t))}function ol(e){gs.call(this,[void 0,void 0],e)}function al(e,t){Za.call(this,e),this.parent=t,this.count=0}function sl(e){gs.call(this,{},e),this._keys=lt();const t=this._targets=[];t.active=0,t.forEach=e=>{for(let n=0,r=t.active;nse(e))):se(e.name,e.as)}function cl(e){gs.call(this,lt(),e)}function fl(e){gs.call(this,[],e)}function dl(e){gs.call(this,[],e)}function hl(e){gs.call(this,null,e)}function pl(e){gs.call(this,[],e)}Ju.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:Ku.concat(Qu)},{name:"as",type:"string",array:!0,default:["value","density"]}]},ft(Ju,gs,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=Zu(e.distribution,function(e){return()=>e.materialize(e.SOURCE).source}(t)),i=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let a=e.method||"pdf";"pdf"!==a&&"cdf"!==a&&oe("Invalid density method: "+a),e.extent||r.data||oe("Missing density extent parameter."),a=r[a];const s=e.as||["value","density"],u=wu(a,e.extent||it(r.data()),i,o).map((e=>{const t={};return t[s[0]]=e[0],t[s[1]]=e[1],Pa(t)}));this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}}),nl.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]},ft(nl,gs,{transform(e,t){if(this.value&&!e.modified()&&!t.changed())return t;const n=t.materialize(t.SOURCE).source,r=tl(t.source,e.groupby,le),i=e.smooth||!1,o=e.field,a=e.step||((e,t)=>Ot(it(e,t))/30)(n,o),s=qa(((e,t)=>o(e)-o(t))),u=e.as||"bin",l=r.length;let c,f=1/0,d=-1/0,h=0;for(;hd&&(d=t),e[++c][u]=t}return this.value={start:f,stop:d,step:a},t.reflow(!0).modifies(u)}}),ft(rl,Za),ol.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},ft(ol,gs,{transform(e,t){const n=this.value,r=e.field,i=t.changed()||t.modified(r.fields)||e.modified("field");let o=n[0],a=n[1];if((i||null==o)&&(o=1/0,a=-1/0),t.visit(i?t.SOURCE:t.ADD,(e=>{const t=Se(r(e));null!=t&&(ta&&(a=t))})),!Number.isFinite(o)||!Number.isFinite(a)){let e=ee(r);e&&(e=` for field "${e}"`),t.dataflow.warn(`Infinite extent${e}: [${o}, ${a}]`),o=a=void 0}this.value=[o,a]}}),ft(al,Za,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}}),ft(sl,gs,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,r){const i=this.value;let o,a,s=st(i,e)&&i[e];return s?s.value.stampe&&e.count>0));this.initTargets(e)}},initTargets(e){const t=this._targets,n=t.length,r=e?e.length:0;let i=0;for(;ithis.subflow(e,i,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,(e=>{const t=za(e),n=o.get(t);void 0!==n&&(o.delete(t),s(n).rem(e))})),t.visit(t.ADD,(e=>{const t=r(e);o.set(za(e),t),s(t).add(e)})),a||t.modified(r.fields)?t.visit(t.MOD,(e=>{const t=za(e),n=o.get(t),i=r(e);n===i?s(i).mod(e):(o.set(t,i),s(n).rem(e),s(i).add(e))})):t.changed(t.MOD)&&t.visit(t.MOD,(e=>{s(o.get(za(e))).mod(e)})),a&&t.visit(t.REFLOW,(e=>{const t=za(e),n=o.get(t),i=r(e);n!==i&&(o.set(t,i),s(n).rem(e),s(i).add(e))})),t.clean()?n.runAfter((()=>{this.clean(),o.clean()})):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}}),ft(ul,Za),cl.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},ft(cl,gs,{transform(e,t){const n=t.dataflow,r=this.value,i=t.fork(),o=i.add,a=i.rem,s=i.mod,u=e.expr;let l=!0;function c(t){const n=za(t),i=u(t,e),c=r.get(n);i&&c?(r.delete(n),o.push(t)):i||c?l&&i&&!c&&s.push(t):(r.set(n,1),a.push(t))}return t.visit(t.REM,(e=>{const t=za(e);r.has(t)?r.delete(t):a.push(e)})),t.visit(t.ADD,(t=>{u(t,e)?o.push(t):r.set(za(t),1)})),t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}}),fl.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},ft(fl,gs,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=el(r,e.as||[]),o=e.index||null,a=i.length;return n.rem=this.value,t.visit(t.SOURCE,(e=>{const t=r.map((t=>t(e))),s=t.reduce(((e,t)=>Math.max(e,t.length)),0);let u,l,c,f=0;for(;f{for(let t,o=0;ot[r]=n(t,e)))}}),ft(pl,gs,{transform(e,t){const n=t.fork(t.ALL),r=e.generator;let i,o,a,s=this.value,u=e.size-s.length;if(u>0){for(i=[];--u>=0;)i.push(a=Pa(r(e))),s.push(a);n.add=n.add.length?n.materialize(n.ADD).add.concat(i):i}else o=s.slice(0,-u),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,s=s.slice(-u);return n.source=this.value=s,n}});const gl={value:"value",median:Ds,mean:function(e,t){let n=0,r=0;if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(++n,r+=t);else{let i=-1;for(let o of e)null!=(o=t(o,++i,e))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n},min:xs,max:bs},ml=[];function yl(e){gs.call(this,[],e)}function vl(e){Lu.call(this,e)}function bl(e){gs.call(this,null,e)}function xl(e){Za.call(this,null,_l,e)}function _l(e){return this.value&&!e.modified()?this.value:bt(e.fields,e.flat)}function wl(e){gs.call(this,[],e),this._pending=null}function kl(e,t,n){n.forEach(Pa);const r=t.fork(t.NO_FIELDS&t.NO_SOURCE);return r.rem=e.value,e.value=r.source=r.add=n,e._pending=null,r.rem.length&&r.clean(!0),r}function Al(e){gs.call(this,{},e)}function El(e){Za.call(this,null,Ol,e)}function Ol(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let r,i,o=1/0,a=-1/0;for(r=0;ra&&(a=i[1]);return[o,a]}function Dl(e){Za.call(this,null,Sl,e)}function Sl(e){return this.value&&!e.modified()?this.value:e.values.reduce(((e,t)=>e.concat(t)),[])}function Cl(e){gs.call(this,null,e)}function Fl(e){Lu.call(this,e)}function jl(e){sl.call(this,e)}function Ml(e){gs.call(this,null,e)}function $l(e){gs.call(this,null,e)}function Nl(e){gs.call(this,null,e)}function Bl(e){gs.call(this,null,e)}function Tl(e){gs.call(this,[],e),this.count=0}function zl(e){gs.call(this,null,e)}function Rl(e){gs.call(this,null,e),this.modified(!0)}function Pl(e){gs.call(this,null,e)}yl.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},ft(yl,gs,{transform(e,t){var n,r,i,o,a,s,u,l,c,f,d=t.fork(t.ALL),h=function(e){var t,n=e.method||gl.value;if(null!=gl[n])return n===gl.value?(t=void 0!==e.value?e.value:0,()=>t):gl[n];oe("Unrecognized imputation method: "+n)}(e),p=function(e){const t=e.field;return e=>e?t(e):NaN}(e),g=ee(e.field),m=ee(e.key),y=(e.groupby||[]).map(ee),v=function(e,t,n,r){var i,o,a,s,u,l,c,f,d=e=>e(f),h=[],p=r?r.slice():[],g={},m={};for(p.forEach(((e,t)=>g[e]=t+1)),s=0,c=e.length;sn.add(e)))):(i=n.value=n.value||this.init(e),t.visit(t.REM,(e=>n.rem(e))),t.visit(t.ADD,(e=>n.add(e)))),n.changes(),t.visit(t.SOURCE,(e=>{rt(e,i[n.cellkey(e)].tuple)})),t.reflow(r).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,r;for(n=0,r=this._alen;n{const n=Vs(t,a)[s],r=e.counts?t.length:1;wu(n,c||it(t),f,d).forEach((e=>{const n={};for(let e=0;e(this._pending=Ge(e.data),e=>e.touch(this))));return{async:t}}return n.request(e.url,e.format).then((e=>kl(this,t,Ge(e.data))))}}),Al.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},ft(Al,gs,{transform(e,t){const n=e.fields,r=e.index,i=e.values,o=null==e.default?null:e.default,a=e.modified(),s=n.length;let u,l,c,f=a?t.SOURCE:t.ADD,d=t,h=e.as;return i?(l=i.length,s>1&&!h&&oe('Multi-field lookup requires explicit "as" parameter.'),h&&h.length!==s*l&&oe('The "as" parameter has too few output field names.'),h=h||i.map(ee),u=function(e){for(var t,a,u=0,c=0;ut.modified(e.fields))),f|=c?t.MOD:0),t.visit(f,u),d.modifies(h)}}),ft(El,Za),ft(Dl,Za),ft(Cl,gs,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),Fl.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Fu,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},ft(Fl,Lu,{_transform:Lu.prototype.transform,transform(e,t){return this._transform(function(e,t){const n=e.field,r=e.value,i=("count"===e.op?"__count__":e.op)||"sum",o=te(n).concat(te(r)),a=function(e,t,n){const r={},i=[];return n.visit(n.SOURCE,(t=>{const n=e(t);r[n]||(r[n]=1,i.push(n))})),i.sort(Je),t?i.slice(0,t):i}(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:a.map((()=>i)),fields:a.map((e=>function(e,t,n,r){return Q((r=>t(r)===e?n(r):NaN),r,e+"")}(e,n,r,o))),as:a.map((e=>e+"")),modified:e.modified.bind(e)}}(e,t),t)}}),ft(jl,sl,{transform(e,t){const n=e.subflow,r=e.field,i=e=>this.subflow(za(e),n,t,e);return(e.modified("field")||r&&t.modified(te(r)))&&oe("PreFacet does not support field modification."),this.initTargets(),r?(t.visit(t.MOD,(e=>{const t=i(e);r(e).forEach((e=>t.mod(e)))})),t.visit(t.ADD,(e=>{const t=i(e);r(e).forEach((e=>t.add(Pa(e))))})),t.visit(t.REM,(e=>{const t=i(e);r(e).forEach((e=>t.rem(e)))}))):(t.visit(t.MOD,(e=>i(e).mod(e))),t.visit(t.ADD,(e=>i(e).add(e))),t.visit(t.REM,(e=>i(e).rem(e)))),t.clean()&&t.runAfter((()=>this.clean())),t}}),Ml.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},ft(Ml,gs,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=el(e.fields,e.as||[]),o=r?(e,t)=>function(e,t,n,r){for(let i=0,o=n.length;i{const t=za(e);n.rem.push(a[t]),a[t]=null})),t.visit(t.ADD,(e=>{const t=o(e,Pa({}));a[za(e)]=t,n.add.push(t)})),t.visit(t.MOD,(e=>{n.mod.push(o(e,a[za(e)]))})),n}}),ft($l,gs,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}}),Nl.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]},ft(Nl,gs,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const i=tl(t.materialize(t.SOURCE).source,e.groupby,e.field),o=(e.groupby||[]).map(ee),a=[],s=e.step||.01,u=e.probs||Au(s/2,1-1e-14,s),l=u.length;return i.forEach((e=>{const t=Cs(e,u);for(let n=0;n{const t=za(e);n.rem.push(r[t]),r[t]=null})),t.visit(t.ADD,(e=>{const t=La(e);r[za(e)]=t,n.add.push(t)})),t.visit(t.MOD,(e=>{const t=r[za(e)];for(const r in e)t[r]=e[r],n.modifies(r);n.mod.push(t)}))),n}}),Tl.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},ft(Tl,gs,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.modified("size"),i=e.size,o=this.value.reduce(((e,t)=>(e[za(t)]=1,e)),{});let a=this.value,s=this.count,u=0;function l(e){let t,r;a.length=u&&(t=a[r],o[za(t)]&&n.rem.push(t),a[r]=e)),++s}if(t.rem.length&&(t.visit(t.REM,(e=>{const t=za(e);o[t]&&(o[t]=-1,n.rem.push(e)),--s})),a=a.filter((e=>-1!==o[za(e)]))),(t.rem.length||r)&&a.length{o[za(e)]||l(e)})),u=-1),r&&a.length>i){const e=a.length-i;for(let t=0;t{o[za(e)]&&n.mod.push(e)})),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=a.filter((e=>!o[za(e)]))),this.count=s,this.value=n.source=a,n}}),zl.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},ft(zl,gs,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),r=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Au(e.start,e.stop,e.step||1).map((e=>{const t={};return t[r]=e,Pa(t)})),n.add=t.add.concat(this.value),n}}),ft(Rl,gs,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});const Ll=["unit0","unit1"];function Il(e){gs.call(this,lt(),e)}function Ul(e){gs.call(this,null,e)}Pl.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:kr,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:Ll}]},ft(Pl,gs,{transform(e,t){const n=e.field,r=!1!==e.interval,i="utc"===e.timezone,o=this._floor(e,t),a=(i?Qr:Kr)(o.unit).offset,s=e.as||Ll,u=s[0],l=s[1],c=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(te(n)))&&(h=(t=t.reflow(!0)).SOURCE,f=1/0,d=-1/0),t.visit(h,(e=>{const t=n(e);let i,s;null==t?(e[u]=null,r&&(e[l]=null)):(e[u]=i=s=o(t),r&&(e[l]=s=a(i,c)),id&&(d=s))})),o.start=f,o.stop=d,t.modifies(r?s:u)},_floor(e,t){const n="utc"===e.timezone,{units:r,step:i}=e.units?{units:e.units,step:e.step||1}:gi({extent:e.extent||it(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=Er(r),a=this.value||{},s=(n?Xr:Gr)(o,i);return s.unit=De(o),s.units=o,s.step=i,s.start=a.start,s.stop=a.stop,this.value=s}}),ft(Il,gs,{transform(e,t){const n=t.dataflow,r=e.field,i=this.value,o=e=>i.set(r(e),e);let a=!0;return e.modified("field")||t.modified(r.fields)?(i.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,(e=>i.delete(r(e)))),t.visit(t.ADD,o)):a=!1,this.modified(a),i.empty>n.cleanThreshold&&n.runAfter(i.clean),t.fork()}}),ft(Ul,gs,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(qa(e.sort)):t.source).map(e.field))}});const ql={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?++e:e}}},percent_rank:function(){const e=ql.rank(),t=e.next;return{init:e.init,next:e=>(t(e)-1)/(e.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,r=t.compare;let i=t.index;if(e0||oe("ntile num must be greater than zero.");const n=ql.cume_dist(),r=n.next;return{init:n.init,next:e=>Math.ceil(t*r(e))}},lag:function(e,t){return t=+t||1,{next:n=>{const r=n.index-t;return r>=0?e(n.data[r]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const r=n.index+t,i=n.data;return re(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return(t=+t)>0||oe("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(t-1);return rt=null,next:n=>{const r=e(n.data[n.index]);return null!=r?t=r:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:r=>{const i=r.data;return r.index<=n?t:(n=function(e,t,n){for(let r=t.length;ns[e]=1))}d(e.sort),t.forEach(((e,t)=>{const s=n[t],h=ee(s),p=Ou(e,h,i[t]);if(d(s),o.push(p),st(ql,e))a.push(function(e,t,n,r){const i=ql[e](t,n);return{init:i.init||ce,update:function(e,t){t[r]=i.next(e)}}}(e,n[t],r[t],p));else{if(null==s&&"count"!==e&&oe("Null aggregate field specified."),"count"===e)return void l.push(p);f=!1;let t=u[h];t||(t=u[h]=[],t.field=s,c.push(t)),t.push(ju(e,p))}})),(l.length||c.length)&&(this.cell=function(e,t,n){e=e.map((e=>zu(e,e.field)));const r={num:0,agg:null,store:!1,count:t};if(!n)for(var i=e.length,o=r.agg=Array(i),a=0;a0&&!i(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),re.init())),this.cell&&this.cell.init()},Gl.update=function(e,t){const n=this.cell,r=this.windows,i=e.data,o=r&&r.length;let a;if(n){for(a=e.p0;athis.group(i(e));let a=this.state;a&&!n||(a=this.state=new Hl(e)),n||t.modified(a.inputs)?(this.value={},t.visit(t.SOURCE,(e=>o(e).add(e)))):(t.visit(t.REM,(e=>o(e).remove(e))),t.visit(t.ADD,(e=>o(e).add(e))));for(let t=0,n=this._mlen;t0)for(var r,i=e[0],o=t[0],a=e[n]-i,s=t[n]-o,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*e[u]+(1-this._beta)*(i+r*a),this._beta*t[u]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const rc=function e(t){function n(e){return 1===t?new Kl(e):new nc(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function ic(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function oc(e,t){this._context=e,this._k=(1-t)/6}oc.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:ic(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:ic(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const ac=function e(t){function n(e){return new oc(e,t)}return n.tension=function(t){return e(+t)},n}(0);function sc(e,t){this._context=e,this._k=(1-t)/6}sc.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(e,t){switch(e=+e,t=+t,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:ic(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const uc=function e(t){function n(e){return new sc(e,t)}return n.tension=function(t){return e(+t)},n}(0);function lc(e,t){this._context=e,this._k=(1-t)/6}lc.prototype={areaStart:Ql,areaEnd:Ql,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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:ic(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const cc=function e(t){function n(e){return new lc(e,t)}return n.tension=function(t){return e(+t)},n}(0),fc=Math.abs,dc=Math.atan2,hc=Math.cos,pc=Math.max,gc=Math.min,mc=Math.sin,yc=Math.sqrt,vc=1e-12,bc=Math.PI,xc=bc/2,_c=2*bc;function wc(e){return e>=1?xc:e<=-1?-xc:Math.asin(e)}function kc(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>vc){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>vc){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*l+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}function Ac(e,t){this._context=e,this._alpha=t}Ac.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:kc(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Ec=function e(t){function n(e){return t?new Ac(e,t):new oc(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Oc(e,t){this._context=e,this._alpha=t}Oc.prototype={areaStart:Ql,areaEnd:Ql,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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:kc(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Dc=function e(t){function n(e){return t?new Oc(e,t):new lc(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Sc(e,t){this._context=e,this._alpha=t}Sc.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:kc(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Cc=function e(t){function n(e){return t?new Sc(e,t):new sc(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Fc(e){this._context=e}function jc(e){return new Fc(e)}function Mc(e){this._context=e}function $c(e){return e<0?-1:1}function Nc(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return($c(o)+$c(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Bc(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Tc(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function zc(e){this._context=e}function Rc(e){this._context=new Pc(e)}function Pc(e){this._context=e}function Lc(e){this._context=e}function Ic(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};const Wc=Math.PI,Hc=2*Wc,Gc=1e-6,Vc=Hc-Gc;function Yc(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Yc;const n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;tGc)if(Math.abs(c*s-u*l)>Gc&&i){let d=n-o,h=r-a,p=s*s+u*u,g=d*d+h*h,m=Math.sqrt(p),y=Math.sqrt(f),v=i*Math.tan((Wc-Math.acos((p+f-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>Gc&&this._append`L${e+b*l},${t+b*c}`,this._append`A${i},${i},0,0,${+(c*d>l*h)},${this._x1=e+x*s},${this._y1=t+x*u}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,n,r,i,o){if(e=+e,t=+t,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),u=e+a,l=t+s,c=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${u},${l}`:(Math.abs(this._x1-u)>Gc||Math.abs(this._y1-l)>Gc)&&this._append`L${u},${l}`,n&&(f<0&&(f=f%Hc+Hc),f>Vc?this._append`A${n},${n},0,1,${c},${e-a},${t-s}A${n},${n},0,1,${c},${this._x1=u},${this._y1=l}`:f>Gc&&this._append`A${n},${n},0,${+(f>=Wc)},${c},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function Zc(){return new Xc}function Jc(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Xc(t)}function Kc(e){return e.innerRadius}function Qc(e){return e.outerRadius}function ef(e){return e.startAngle}function tf(e){return e.endAngle}function nf(e){return e&&e.padAngle}function rf(e,t,n,r,i,o,a){var s=e-n,u=t-r,l=(a?o:-o)/yc(s*s+u*u),c=l*u,f=-l*s,d=e+c,h=t+f,p=n+c,g=r+f,m=(d+p)/2,y=(h+g)/2,v=p-d,b=g-h,x=v*v+b*b,_=i-o,w=d*g-p*h,k=(b<0?-1:1)*yc(pc(0,_*_*x-w*w)),A=(w*b-v*k)/x,E=(-w*v-b*k)/x,O=(w*b+v*k)/x,D=(-w*v+b*k)/x,S=A-m,C=E-y,F=O-m,j=D-y;return S*S+C*C>F*F+j*j&&(A=O,E=D),{cx:A,cy:E,x01:-c,y01:-f,x11:A*(i/_-1),y11:E*(i/_-1)}}function of(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function af(e){return e[0]}function sf(e){return e[1]}function uf(e,t){var n=qc(!0),r=null,i=jc,o=null,a=Jc(s);function s(s){var u,l,c,f=(s=of(s)).length,d=!1;for(null==r&&(o=i(c=a())),u=0;u<=f;++u)!(u=f;--d)s.point(y[d],v[d]);s.lineEnd(),s.areaEnd()}m&&(y[c]=+e(h,c,l),v[c]=+t(h,c,l),s.point(r?+r(h,c,l):y[c],n?+n(h,c,l):v[c]))}if(p)return s=null,p+""||null}function c(){return uf().defined(i).curve(a).context(o)}return e="function"==typeof e?e:void 0===e?af:qc(+e),t="function"==typeof t?t:qc(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?sf:qc(+n),l.x=function(t){return arguments.length?(e="function"==typeof t?t:qc(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:qc(+t),l):e},l.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:qc(+e),l):r},l.y=function(e){return arguments.length?(t="function"==typeof e?e:qc(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t="function"==typeof e?e:qc(+e),l):t},l.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:qc(+e),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(r).y(t)},l.defined=function(e){return arguments.length?(i="function"==typeof e?e:qc(!!e),l):i},l.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),l):a},l.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),l):o},l}Zc.prototype=Xc.prototype,Array.prototype.slice,yc(3);const cf={draw(e,t){const n=yc(t/bc);e.moveTo(n,0),e.arc(0,0,n,0,_c)}};yc(1/3),mc(bc/10),mc(7*bc/10);function ff(e,t){if("undefined"!=typeof document&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}mc(_c/10),hc(_c/10),yc(3),yc(3),yc(3),yc(12);const df=()=>"undefined"!=typeof Image?Image:null,hf=cr(ur),pf=hf.right,gf=hf.left,mf=(cr(As).center,pf);function yf(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function vf(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function bf(){}var xf=.7,_f=1/xf,wf="\\s*([+-]?\\d+)\\s*",kf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Af="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ef=/^#([0-9a-f]{3,8})$/,Of=new RegExp(`^rgb\\(${wf},${wf},${wf}\\)$`),Df=new RegExp(`^rgb\\(${Af},${Af},${Af}\\)$`),Sf=new RegExp(`^rgba\\(${wf},${wf},${wf},${kf}\\)$`),Cf=new RegExp(`^rgba\\(${Af},${Af},${Af},${kf}\\)$`),Ff=new RegExp(`^hsl\\(${kf},${Af},${Af}\\)$`),jf=new RegExp(`^hsla\\(${kf},${Af},${Af},${kf}\\)$`),Mf={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};function $f(){return this.rgb().formatHex()}function Nf(){return this.rgb().formatRgb()}function Bf(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ef.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Tf(t):3===n?new Lf(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?zf(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?zf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Of.exec(e))?new Lf(t[1],t[2],t[3],1):(t=Df.exec(e))?new Lf(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Sf.exec(e))?zf(t[1],t[2],t[3],t[4]):(t=Cf.exec(e))?zf(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Ff.exec(e))?Gf(t[1],t[2]/100,t[3]/100,1):(t=jf.exec(e))?Gf(t[1],t[2]/100,t[3]/100,t[4]):Mf.hasOwnProperty(e)?Tf(Mf[e]):"transparent"===e?new Lf(NaN,NaN,NaN,0):null}function Tf(e){return new Lf(e>>16&255,e>>8&255,255&e,1)}function zf(e,t,n,r){return r<=0&&(e=t=n=NaN),new Lf(e,t,n,r)}function Rf(e){return e instanceof bf||(e=Bf(e)),e?new Lf((e=e.rgb()).r,e.g,e.b,e.opacity):new Lf}function Pf(e,t,n,r){return 1===arguments.length?Rf(e):new Lf(e,t,n,null==r?1:r)}function Lf(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function If(){return`#${Hf(this.r)}${Hf(this.g)}${Hf(this.b)}`}function Uf(){const e=qf(this.opacity);return`${1===e?"rgb(":"rgba("}${Wf(this.r)}, ${Wf(this.g)}, ${Wf(this.b)}${1===e?")":`, ${e})`}`}function qf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Wf(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Hf(e){return((e=Wf(e))<16?"0":"")+e.toString(16)}function Gf(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Xf(e,t,n,r)}function Vf(e){if(e instanceof Xf)return new Xf(e.h,e.s,e.l,e.opacity);if(e instanceof bf||(e=Bf(e)),!e)return new Xf;if(e instanceof Xf)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n0&&u<1?0:a,new Xf(a,s,u,e.opacity)}function Yf(e,t,n,r){return 1===arguments.length?Vf(e):new Xf(e,t,n,null==r?1:r)}function Xf(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Zf(e){return(e=(e||0)%360)<0?e+360:e}function Jf(e){return Math.max(0,Math.min(1,e||0))}function Kf(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function Qf(e,t,n,r,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*n+(1+3*e+3*o-3*a)*r+a*i)/6}function ed(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],a=r>0?e[r-1]:2*i-o,s=r=240?e-240:e+120,i,r),Kf(e,i,r),Kf(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Xf(Zf(this.h),Jf(this.s),Jf(this.l),qf(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=qf(this.opacity);return`${1===e?"hsl(":"hsla("}${Zf(this.h)}, ${100*Jf(this.s)}%, ${100*Jf(this.l)}%${1===e?")":`, ${e})`}`}}));const nd=e=>()=>e;function rd(e,t){return function(n){return e+n*t}}function id(e,t){var n=t-e;return n?rd(e,n>180||n<-180?n-360*Math.round(n/360):n):nd(isNaN(e)?t:e)}function od(e,t){var n=t-e;return n?rd(e,n):nd(isNaN(e)?t:e)}const ad=function e(t){var n=function(e){return 1==(e=+e)?od:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):nd(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Pf(e)).r,(t=Pf(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=od(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function sd(e){return function(t){var n,r,i=t.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;no&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:gd(n,r)})),o=vd.lastIndex;return ot&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?Dd:Od,i=o=null,f}function f(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),s,u)))(e(l(t)))}return f.invert=function(n){return l(t((o||(o=r(s,a.map(e),gd)))(n)))},f.domain=function(e){return arguments.length?(a=Array.from(e,wd),c()):a.slice()},f.range=function(e){return arguments.length?(s=Array.from(e),c()):s.slice()},f.rangeRound=function(e){return s=Array.from(e),u=_d,c()},f.clamp=function(e){return arguments.length?(l=!!e||Ad,c()):l!==Ad},f.interpolate=function(e){return arguments.length?(u=e,c()):u},f.unknown=function(e){return arguments.length?(n=e,f):n},function(n,r){return e=n,t=r,c()}}function Fd(){return Cd()(Ad,Ad)}function jd(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Md(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}function $d(e,t,n,r){var i,o=rn(e,t,n);switch((r=sn(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=fn(o,a))||(r.precision=i),bn(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=dn(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=hn(o))||(r.precision=i-2*("%"===r.type))}return vn(r)}function Nd(e){var t=e.domain;return e.ticks=function(e){var n=t();return tn(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return $d(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,s=o.length-1,u=o[a],l=o[s],c=10;for(l0;){if((i=nn(u,l,n))===r)return o[a]=u,o[s]=l,t(o);if(i>0)u=Math.floor(u/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;u=Math.ceil(u*i)/i,l=Math.floor(l*i)/i}r=i}return e},e}function Bd(e,t){var n,r=0,i=(e=e.slice()).length-1,o=e[r],a=e[i];return a-e(-t,n)}function Ud(e){const t=e(Td,zd),n=t.domain;let r,i,o=10;function a(){return r=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(o),i=function(e){return 10===e?Ld:e===Math.E?Math.exp:t=>Math.pow(e,t)}(o),n()[0]<0?(r=Id(r),i=Id(i),e(Rd,Pd)):e(Td,zd),t}return t.base=function(e){return arguments.length?(o=+e,a()):o},t.domain=function(e){return arguments.length?(n(e),a()):n()},t.ticks=e=>{const t=n();let a=t[0],s=t[t.length-1];const u=s0){for(;f<=d;++f)for(l=1;ls)break;p.push(c)}}else for(;f<=d;++f)for(l=o-1;l>=1;--l)if(c=f>0?l/i(-f):l*i(f),!(cs)break;p.push(c)}2*p.length{if(null==e&&(e=10),null==n&&(n=10===o?"s":","),"function"!=typeof n&&(o%1||null!=(n=sn(n)).precision||(n.trim=!0),n=vn(n)),e===1/0)return n;const a=Math.max(1,o*e/t.ticks().length);return e=>{let t=e/i(Math.round(r(e)));return t*on(Bd(n(),{floor:e=>i(Math.floor(r(e))),ceil:e=>i(Math.ceil(r(e)))})),t}function qd(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Wd(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Hd(e){return e<0?-e*e:e*e}function Gd(e){var t=e(Ad,Ad),n=1;return t.exponent=function(t){return arguments.length?1==(n=+t)?e(Ad,Ad):.5===n?e(Wd,Hd):e(qd(n),qd(1/n)):n},Nd(t)}function Vd(){var e=Gd(Cd());return e.copy=function(){return Sd(e,Vd()).exponent(e.exponent())},jd.apply(e,arguments),e}function Yd(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Xd(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Zd(e){var t=1,n=e(Yd(t),Xd(t));return n.constant=function(n){return arguments.length?e(Yd(t=+n),Xd(t)):t},Nd(n)}function Jd(e,t,n,r,i,o){const a=[[ar,1,On],[ar,5,5e3],[ar,15,15e3],[ar,30,3e4],[o,1,Dn],[o,5,5*Dn],[o,15,15*Dn],[o,30,30*Dn],[i,1,Sn],[i,3,3*Sn],[i,6,6*Sn],[i,12,12*Sn],[r,1,Cn],[r,2,2*Cn],[n,1,Fn],[t,1,jn],[t,3,3*jn],[e,1,Mn]];function s(t,n,r){const i=Math.abs(n-t)/r,o=cr((([,,e])=>e)).right(a,i);if(o===a.length)return e.every(rn(t/Mn,n/Mn,r));if(0===o)return sr.every(Math.max(rn(t,n,r),1));const[s,u]=a[i/a[o-1][2]180?t+=360:t-e>180&&(e+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:gd(e,t)})):t&&n.push(i(n)+"rotate("+t+r)}(o.rotate,a.rotate,s,u),function(e,t,n,o){e!==t?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:gd(e,t)}):t&&n.push(i(n)+"skewX("+t+r)}(o.skewX,a.skewX,s,u),function(e,t,n,r,o,a){if(e!==n||t!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:gd(e,n)},{i:s-2,x:gd(t,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(e){for(var t,n=-1,r=u.length;++nUh?Math.pow(e,1/3):e/Ih+Ph}function Vh(e){return e>Lh?e*e*e:Ih*(e-Ph)}function Yh(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Xh(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Zh(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Jh)return new Jh(e.h,e.c,e.l,e.opacity);if(e instanceof Hh||(e=qh(e)),0===e.a&&0===e.b)return new Jh(NaN,00?r:1:0}const vp="linear",bp="log",xp="pow",_p="sqrt",wp="symlog",kp="time",Ap="utc",Ep="sequential",Op="diverging",Dp="quantile",Sp="quantize",Cp="threshold",Fp="ordinal",jp="point",Mp="band",$p="bin-ordinal",Np="continuous",Bp="discrete",Tp="discretizing",zp="interpolating",Rp="temporal";function Pp(){const e=bh().unknown(void 0),t=e.domain,n=e.range;let r,i,o=[0,1],a=!1,s=0,u=0,l=.5;function c(){const e=t().length,c=o[1]h+r*e));return n(c?p.reverse():p)}return delete e.unknown,e.domain=function(e){return arguments.length?(t(e),c()):t()},e.range=function(e){return arguments.length?(o=[+e[0],+e[1]],c()):o.slice()},e.rangeRound=function(e){return o=[+e[0],+e[1]],a=!0,c()},e.bandwidth=function(){return i},e.step=function(){return r},e.round=function(e){return arguments.length?(a=!!e,c()):a},e.padding=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),s=u,c()):s},e.paddingInner=function(e){return arguments.length?(s=Math.max(0,Math.min(1,e)),c()):s},e.paddingOuter=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),c()):u},e.align=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),c()):l},e.invertRange=function(e){if(null==e[0]||null==e[1])return;const r=o[1]o[1-r])?void 0:(u=Math.max(0,pf(a,f)-1),l=f===d?u:pf(a,d)-1,f-a[u]>i+1e-10&&++u,r&&(c=u,u=s-l,l=s-c),u>l?void 0:t().slice(u,l+1))},e.invert=function(t){const n=e.invertRange([t,t]);return n?n[0]:n},e.copy=function(){return Pp().domain(t()).range(o).round(a).paddingInner(s).paddingOuter(u).align(l)},c()}function Lp(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return Lp(t())},e}var Ip=Array.prototype.map;const Up=Array.prototype.slice,qp=new Map,Wp=Symbol("vega_scale");function Hp(e){return e[Wp]=!0,e}function Gp(e,t,n){return arguments.length>1?(qp.set(e,function(e,t,n){const r=function(){const n=t();return n.invertRange||(n.invertRange=n.invert?function(e){return function(t){let n,r=t[0],i=t[1];return i=s&&n[o]<=u&&(l<0&&(l=o),r=o);if(!(l<0))return s=e.invertExtent(n[l]),u=e.invertExtent(n[r]),[void 0===s[0]?s[1]:s[0],void 0===u[1]?u[0]:u[1]]}}(n):void 0),n.type=e,Hp(n)};return r.metadata=Mt(Ge(n)),r}(e,t,n)),this):Vp(e)?qp.get(e):void 0}function Vp(e){return qp.has(e)}function Yp(e,t){const n=qp.get(e);return n&&n.metadata[t]}function Xp(e){return Yp(e,Np)}function Zp(e){return Yp(e,Bp)}function Jp(e){return Yp(e,Tp)}function Kp(e){return Yp(e,bp)}function Qp(e){return Yp(e,zp)}function eg(e){return Yp(e,Dp)}Gp("identity",(function e(t){var n;function r(e){return null==e||isNaN(e=+e)?n:e}return r.invert=r,r.domain=r.range=function(e){return arguments.length?(t=Array.from(e,wd),r):t.slice()},r.unknown=function(e){return arguments.length?(n=e,r):n},r.copy=function(){return e(t).unknown(n)},t=arguments.length?Array.from(t,wd):[0,1],Nd(r)})),Gp(vp,(function e(){var t=Fd();return t.copy=function(){return Sd(t,e())},jd.apply(t,arguments),Nd(t)}),Np),Gp(bp,(function e(){const t=Ud(Cd()).domain([1,10]);return t.copy=()=>Sd(t,e()).base(t.base()),jd.apply(t,arguments),t}),[Np,bp]),Gp(xp,Vd,Np),Gp(_p,(function(){return Vd.apply(null,arguments).exponent(.5)}),Np),Gp(wp,(function e(){var t=Zd(Cd());return t.copy=function(){return Sd(t,e()).constant(t.constant())},jd.apply(t,arguments)}),Np),Gp(kp,(function(){return jd.apply(ih(eh,th,Kn,er,zn,$n,nr,ir,ar,_i).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[Np,Rp]),Gp(Ap,(function(){return jd.apply(ih(Kd,Qd,Qn,tr,Hn,Nn,rr,or,ar,ki).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[Np,Rp]),Gp(Ep,sh,[Np,zp]),Gp(`${Ep}-${vp}`,sh,[Np,zp]),Gp(`${Ep}-${bp}`,(function e(){var t=Ud(oh()).domain([1,10]);return t.copy=function(){return ah(t,e()).base(t.base())},Md.apply(t,arguments)}),[Np,zp,bp]),Gp(`${Ep}-${xp}`,uh,[Np,zp]),Gp(`${Ep}-${_p}`,(function(){return uh.apply(null,arguments).exponent(.5)}),[Np,zp]),Gp(`${Ep}-${wp}`,(function e(){var t=Zd(oh());return t.copy=function(){return ah(t,e()).constant(t.constant())},Md.apply(t,arguments)}),[Np,zp]),Gp(`${Op}-${vp}`,(function e(){var t=Nd(ch()(Ad));return t.copy=function(){return ah(t,e())},Md.apply(t,arguments)}),[Np,zp]),Gp(`${Op}-${bp}`,(function e(){var t=Ud(ch()).domain([.1,1,10]);return t.copy=function(){return ah(t,e()).base(t.base())},Md.apply(t,arguments)}),[Np,zp,bp]),Gp(`${Op}-${xp}`,fh,[Np,zp]),Gp(`${Op}-${_p}`,(function(){return fh.apply(null,arguments).exponent(.5)}),[Np,zp]),Gp(`${Op}-${wp}`,(function e(){var t=Zd(ch());return t.copy=function(){return ah(t,e()).constant(t.constant())},Md.apply(t,arguments)}),[Np,zp]),Gp(Dp,(function e(){var t,n=[],r=[],i=[];function o(){var e=0,t=Math.max(1,r.length);for(i=new Array(t-1);++e0?i[t-1]:n[0],t=i?[o[i-1],r]:[o[t-1],o[t]]},s.unknown=function(e){return arguments.length?(t=e,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return e().domain([n,r]).range(a).unknown(t)},jd.apply(Nd(s),arguments)}),Tp),Gp(Cp,(function e(){var t,n=[.5],r=[0,1],i=1;function o(e){return null!=e&&e<=e?r[mf(n,e,0,i)]:t}return o.domain=function(e){return arguments.length?(n=Array.from(e),i=Math.min(n.length,r.length-1),o):n.slice()},o.range=function(e){return arguments.length?(r=Array.from(e),i=Math.min(n.length,r.length-1),o):r.slice()},o.invertExtent=function(e){var t=r.indexOf(e);return[n[t-1],n[t]]},o.unknown=function(e){return arguments.length?(t=e,o):t},o.copy=function(){return e().domain(n).range(r).unknown(t)},jd.apply(o,arguments)}),Tp),Gp($p,(function e(){let t=[],n=[];function r(e){return null==e||e!=e?void 0:n[(mf(t,e)-1)%n.length]}return r.domain=function(e){return arguments.length?(t=function(e){return Ip.call(e,Se)}(e),r):t.slice()},r.range=function(e){return arguments.length?(n=Up.call(e),r):n.slice()},r.tickFormat=function(e,n){return $d(t[0],De(t),null==e?10:e,n)},r.copy=function(){return e().domain(r.domain()).range(r.range())},r}),[Bp,Tp]),Gp(Fp,bh,Bp),Gp(Mp,Pp,Bp),Gp(jp,(function(){return Lp(Pp().paddingInner(1))}),Bp);const tg=["clamp","base","constant","exponent"];function ng(e,t){const n=t[0],r=De(t)-n;return function(t){return e(n+t*r)}}function rg(e,t,n){return lh(ag(t||"rgb",n),e)}function ig(e,t){const n=new Array(t),r=t+1;for(let i=0;ie[t]?a[t](e[t]()):0)),a):tt(.5)}function ag(e,t){const n=a[function(e){return"interpolate"+e.toLowerCase().split("-").map((e=>e[0].toUpperCase()+e.slice(1))).join("")}(e)];return null!=t&&n&&n.gamma?n.gamma(t):n}function sg(e){const t=e.length/6|0,n=new Array(t);for(let r=0;r1?(lg[e]=t,this):lg[e]}ug({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},sg),ug({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},(e=>rg(sg(e))));const fg="symbol",dg="discrete",hg=e=>_e(e)?e.map((e=>String(e))):String(e),pg=(e,t)=>e[1]-t[1],gg=(e,t)=>t[1]-e[1];function mg(e,t,n){let r;return mt(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),null!=n&&(t=Math.min(t,Math.floor(Ot(e.domain())/n||1)))),we(t)&&(r=t.step,t=t.interval),vt(t)&&(t=e.type===kp?Kr(t):e.type==Ap?Qr(t):oe("Only time and utc scales accept interval strings."),r&&(t=t.every(r))),t}function yg(e,t,n){let r=e.range(),i=r[0],o=De(r),a=pg;if(i>o&&(r=o,o=i,i=r,a=gg),i=Math.floor(i),o=Math.ceil(o),t=t.map((t=>[t,e(t)])).filter((e=>i<=e[1]&&e[1]<=o)).sort(a).map((e=>e[0])),n>0&&t.length>1){const e=[t[0],De(t)];for(;t.length>n&&t.length>=3;)t=t.filter(((e,t)=>!(t%2)));t.length<3&&(t=e)}return t}function vg(e,t){return e.bins?yg(e,e.bins):e.ticks?e.ticks(t):e.domain()}function bg(e,t,n,r,i,o){const a=t.type;let s=hg;if(a===kp||i===kp)s=e.timeFormat(r);else if(a===Ap||i===Ap)s=e.utcFormat(r);else if(Kp(a)){const i=e.formatFloat(r);if(o||t.bins)s=i;else{const e=xg(t,n,!1);s=t=>e(t)?i(t):""}}else if(t.tickFormat){const i=t.domain();s=e.formatSpan(i[0],i[i.length-1],n,r)}else r&&(s=e.format(r));return s}function xg(e,t,n){const r=vg(e,t),i=e.base(),o=Math.log(i),a=Math.max(1,i*t/r.length),s=e=>{let t=e/Math.pow(i,Math.round(Math.log(e)/o));return t*i_g[e.type]||e.bins;function Eg(e,t,n,r,i,o,a){const s=wg[t.type]&&o!==kp&&o!==Ap?function(e,t,n){const r=t[wg[t.type]](),i=r.length;let o,a=i>1?r[1]-r[0]:r[0];for(o=1;o(t,n,r)=>{const i=Dg(r[n+1],Dg(r.max,1/0)),o=Fg(t,e),a=Fg(i,e);return o&&a?o+" – "+a:a?"< "+a:"≥ "+o},Dg=(e,t)=>null!=e?e:t,Sg=e=>(t,n)=>n?e(t):null,Cg=e=>t=>e(t),Fg=(e,t)=>Number.isFinite(e)?t(e):null;function jg(e,t,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=function(e,t,n,r){const i=r||t.type;return vt(n)&&function(e){return Yp(e,Rp)}(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||i!==kp?n||i!==Ap?Eg(e,t,5,null,n,r,!0):e.utcFormat("%A, %d %B %Y, %X UTC"):e.timeFormat("%A, %d %B %Y, %X")}(e,t,n.format,n.formatType);if(Jp(t.type)){const e=kg(t).slice(1).map(i),n=e.length;return`${n} boundar${1===n?"y":"ies"}: ${e.join(", ")}`}if(Zp(t.type)){const e=t.domain(),n=e.length;return`${n} value${1===n?"":"s"}: ${n>r?e.slice(0,r-2).map(i).join(", ")+", ending with "+e.slice(-1).map(i):e.map(i).join(", ")}`}{const e=t.domain();return`values from ${i(e[0])} to ${i(De(e))}`}}let Mg=0;const $g="p_";function Ng(e){return e&&e.gradient}function Bg(e,t,n){const r=e.gradient;let i=e.id,o="radial"===r?$g:"";return i||(i=e.id="gradient_"+Mg++,"radial"===r?(e.x1=Tg(e.x1,.5),e.y1=Tg(e.y1,.5),e.r1=Tg(e.r1,0),e.x2=Tg(e.x2,.5),e.y2=Tg(e.y2,.5),e.r2=Tg(e.r2,.5),o=$g):(e.x1=Tg(e.x1,0),e.y1=Tg(e.y1,0),e.x2=Tg(e.x2,1),e.y2=Tg(e.y2,0))),t[i]=e,"url("+(n||"")+"#"+o+i+")"}function Tg(e,t){return null!=e?e:t}function zg(e,t){var n,r=[];return n={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:r,stop:function(e,t){return r.push({offset:e,color:t}),n}}}const Rg={basis:{curve:function(e){return new Kl(e)}},"basis-closed":{curve:function(e){return new ec(e)}},"basis-open":{curve:function(e){return new tc(e)}},bundle:{curve:rc,tension:"beta",value:.85},cardinal:{curve:ac,tension:"tension",value:0},"cardinal-open":{curve:uc,tension:"tension",value:0},"cardinal-closed":{curve:cc,tension:"tension",value:0},"catmull-rom":{curve:Ec,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Dc,tension:"alpha",value:.5},"catmull-rom-open":{curve:Cc,tension:"alpha",value:.5},linear:{curve:jc},"linear-closed":{curve:function(e){return new Mc(e)}},monotone:{horizontal:function(e){return new Rc(e)},vertical:function(e){return new zc(e)}},natural:{curve:function(e){return new Lc(e)}},step:{curve:function(e){return new Uc(e,.5)}},"step-after":{curve:function(e){return new Uc(e,1)}},"step-before":{curve:function(e){return new Uc(e,0)}}};function Pg(e,t,n){var r=st(Rg,e)&&Rg[e],i=null;return r&&(i=r.curve||r[t||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}const Lg={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},Ig=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,Ug=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,qg=/^((\s+,?\s*)|(,\s*))/,Wg=/^[01]/;function Hg(e){const t=[];return(e.match(Ig)||[]).forEach((e=>{let n=e[0];const r=n.toLowerCase(),i=Lg[r],o=function(e,t,n){const r=[];for(let i=0;t&&i1&&(g=Math.sqrt(g),n*=g,r*=g);const m=d/n,y=f/n,v=-f/r,b=d/r,x=m*s+y*u,_=v*s+b*u,w=m*e+y*t,k=v*e+b*t;let A=1/((w-x)*(w-x)+(k-_)*(k-_))-.25;A<0&&(A=0);let E=Math.sqrt(A);o==i&&(E=-E);const O=.5*(x+w)-E*(k-_),D=.5*(_+k)+E*(w-x),S=Math.atan2(_-D,x-O);let C=Math.atan2(k-D,w-O)-S;C<0&&1===o?C+=Yg:C>0&&0===o&&(C-=Yg);const F=Math.ceil(Math.abs(C/(Vg+.001))),j=[];for(let e=0;e+e}function pm(e,t,n){return Math.max(t,Math.min(e,n))}function gm(){var e=lm,t=cm,n=fm,r=dm,i=hm(0),o=i,a=i,s=i,u=null;function l(l,c,f){var d,h=null!=c?c:+e.call(this,l),p=null!=f?f:+t.call(this,l),g=+n.call(this,l),m=+r.call(this,l),y=Math.min(g,m)/2,v=pm(+i.call(this,l),0,y),b=pm(+o.call(this,l),0,y),x=pm(+a.call(this,l),0,y),_=pm(+s.call(this,l),0,y);if(u||(u=d=Zc()),v<=0&&b<=0&&x<=0&&_<=0)u.rect(h,p,g,m);else{var w=h+g,k=p+m;u.moveTo(h+v,p),u.lineTo(w-b,p),u.bezierCurveTo(w-um*b,p,w,p+um*b,w,p+b),u.lineTo(w,k-_),u.bezierCurveTo(w,k-um*_,w-um*_,k,w-_,k),u.lineTo(h+x,k),u.bezierCurveTo(h+um*x,k,h,k-um*x,h,k-x),u.lineTo(h,p+v),u.bezierCurveTo(h,p+um*v,h+um*v,p,h+v,p),u.closePath()}if(d)return u=null,d+""||null}return l.x=function(t){return arguments.length?(e=hm(t),l):e},l.y=function(e){return arguments.length?(t=hm(e),l):t},l.width=function(e){return arguments.length?(n=hm(e),l):n},l.height=function(e){return arguments.length?(r=hm(e),l):r},l.cornerRadius=function(e,t,n,r){return arguments.length?(i=hm(e),o=null!=t?hm(t):i,s=null!=n?hm(n):i,a=null!=r?hm(r):o,l):i},l.context=function(e){return arguments.length?(u=null==e?null:e,l):u},l}function mm(){var e,t,n,r,i,o,a,s,u=null;function l(e,t,n){const r=n/2;if(i){var l=a-t,c=e-o;if(l||c){var f=Math.sqrt(l*l+c*c),d=(l/=f)*s,h=(c/=f)*s,p=Math.atan2(c,l);u.moveTo(o-d,a-h),u.lineTo(e-l*r,t-c*r),u.arc(e,t,r,p-Math.PI,p),u.lineTo(o+d,a+h),u.arc(o,a,s,p,p+Math.PI)}else u.arc(e,t,r,0,Yg);u.closePath()}else i=1;o=e,a=t,s=r}function c(o){var a,s,c,f=o.length,d=!1;for(null==u&&(u=c=Zc()),a=0;a<=f;++a)!(ae.x||0,bm=e=>e.y||0,xm=e=>!(!1===e.defined),_m=function(){var e=Kc,t=Qc,n=qc(0),r=null,i=ef,o=tf,a=nf,s=null,u=Jc(l);function l(){var l,c,f=+e.apply(this,arguments),d=+t.apply(this,arguments),h=i.apply(this,arguments)-xc,p=o.apply(this,arguments)-xc,g=fc(p-h),m=p>h;if(s||(s=l=u()),dvc)if(g>_c-vc)s.moveTo(d*hc(h),d*mc(h)),s.arc(0,0,d,h,p,!m),f>vc&&(s.moveTo(f*hc(p),f*mc(p)),s.arc(0,0,f,p,h,m));else{var y,v,b=h,x=p,_=h,w=p,k=g,A=g,E=a.apply(this,arguments)/2,O=E>vc&&(r?+r.apply(this,arguments):yc(f*f+d*d)),D=gc(fc(d-f)/2,+n.apply(this,arguments)),S=D,C=D;if(O>vc){var F=wc(O/f*mc(E)),j=wc(O/d*mc(E));(k-=2*F)>vc?(_+=F*=m?1:-1,w-=F):(k=0,_=w=(h+p)/2),(A-=2*j)>vc?(b+=j*=m?1:-1,x-=j):(A=0,b=x=(h+p)/2)}var M=d*hc(b),$=d*mc(b),N=f*hc(w),B=f*mc(w);if(D>vc){var T,z=d*hc(x),R=d*mc(x),P=f*hc(_),L=f*mc(_);if(g1?0:e<-1?bc:Math.acos(e)}((I*q+U*W)/(yc(I*I+U*U)*yc(q*q+W*W)))/2),G=yc(T[0]*T[0]+T[1]*T[1]);S=gc(D,(f-G)/(H-1)),C=gc(D,(d-G)/(H+1))}else S=C=0}A>vc?C>vc?(y=rf(P,L,M,$,d,C,m),v=rf(z,R,N,B,d,C,m),s.moveTo(y.cx+y.x01,y.cy+y.y01),Cvc&&k>vc?S>vc?(y=rf(N,B,z,R,f,-S,m),v=rf(M,$,P,L,f,-S,m),s.lineTo(y.cx+y.x01,y.cy+y.y01),Se.startAngle||0)).endAngle((e=>e.endAngle||0)).padAngle((e=>e.padAngle||0)).innerRadius((e=>e.innerRadius||0)).outerRadius((e=>e.outerRadius||0)).cornerRadius((e=>e.cornerRadius||0)),wm=lf().x(vm).y1(bm).y0((e=>(e.y||0)+(e.height||0))).defined(xm),km=lf().y(bm).x1(vm).x0((e=>(e.x||0)+(e.width||0))).defined(xm),Am=uf().x(vm).y(bm).defined(xm),Em=gm().x(vm).y(bm).width((e=>e.width||0)).height((e=>e.height||0)).cornerRadius((e=>ym(e.cornerRadiusTopLeft,e.cornerRadius)||0),(e=>ym(e.cornerRadiusTopRight,e.cornerRadius)||0),(e=>ym(e.cornerRadiusBottomRight,e.cornerRadius)||0),(e=>ym(e.cornerRadiusBottomLeft,e.cornerRadius)||0)),Om=function(e,t){let n=null,r=Jc(i);function i(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return e="function"==typeof e?e:qc(e||cf),t="function"==typeof t?t:qc(void 0===t?64:+t),i.type=function(t){return arguments.length?(e="function"==typeof t?t:qc(t),i):e},i.size=function(e){return arguments.length?(t="function"==typeof e?e:qc(+e),i):t},i.context=function(e){return arguments.length?(n=null==e?null:e,i):n},i}().type((e=>am(e.shape||"circle"))).size((e=>ym(e.size,64))),Dm=mm().x(vm).y(bm).defined(xm).size((e=>e.size||1));function Sm(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function Cm(e,t,n,r){return Em.context(e)(t,n,r)}var Fm=1;function jm(){Fm=1}function Mm(e,t,n){var r=t.clip,i=e._defs,o=t.clip_id||(t.clip_id="clip"+Fm++),a=i.clipping[o]||(i.clipping[o]={id:o});return Ye(r)?a.path=r(null):Sm(n)?a.path=Cm(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function $m(e){this.clear(),e&&this.union(e)}function Nm(e){this.mark=e,this.bounds=this.bounds||new $m}function Bm(e){Nm.call(this,e),this.items=this.items||[]}function Tm(e){this._pending=0,this._loader=e||ja()}function zm(e){e._pending+=1}function Rm(e){e._pending-=1}function Pm(e,t,n){if(t.stroke&&0!==t.opacity&&0!==t.strokeOpacity){const r=null!=t.strokeWidth?+t.strokeWidth:1;e.expand(r+(n?function(e,t){return e.strokeJoin&&"miter"!==e.strokeJoin?0:t}(t,r):0))}return e}$m.prototype={clone(){return new $m(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,r){return nthis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const r=this.rotatedPoints(e,t,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(e,t,n){var{x1:r,y1:i,x2:o,y2:a}=this,s=Math.cos(e),u=Math.sin(e),l=t-t*s+n*u,c=n-t*u-n*s;return[s*r-u*i+l,u*r+s*i+c,s*r-u*a+l,u*r+s*a+c,s*o-u*i+l,u*o+s*i+c,s*o-u*a+l,u*o+s*a+c]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},ft(Bm,Nm),Tm.prototype={pending(){return this._pending},sanitizeURL(e){const t=this;return zm(t),t._loader.sanitize(e,{context:"href"}).then((e=>(Rm(t),e))).catch((()=>(Rm(t),null)))},loadImage(e){const t=this,n=df();return zm(t),t._loader.sanitize(e,{context:"image"}).then((e=>{const r=e.href;if(!r||!n)throw{url:r};const i=new n,o=st(e,"crossOrigin")?e.crossOrigin:"anonymous";return null!=o&&(i.crossOrigin=o),i.onload=()=>Rm(t),i.onerror=()=>Rm(t),i.src=r,i})).catch((e=>(Rm(t),{complete:!1,width:0,height:0,src:e&&e.url||""})))},ready(){const e=this;return new Promise((t=>{!function n(r){e.pending()?setTimeout((()=>{n(!0)}),10):t(r)}(!1)}))}};const Lm=Yg-1e-8;let Im,Um,qm,Wm,Hm,Gm,Vm,Ym;const Xm=(e,t)=>Im.add(e,t),Zm=(e,t)=>Xm(Um=e,qm=t),Jm=e=>Xm(e,Im.y1),Km=e=>Xm(Im.x1,e),Qm=(e,t)=>Hm*e+Vm*t,ey=(e,t)=>Gm*e+Ym*t,ty=(e,t)=>Xm(Qm(e,t),ey(e,t)),ny=(e,t)=>Zm(Qm(e,t),ey(e,t));function ry(e,t){return Im=e,t?(Wm=t*Gg,Hm=Ym=Math.cos(Wm),Gm=Math.sin(Wm),Vm=-Gm):(Hm=Ym=1,Wm=Gm=Vm=0),iy}const iy={beginPath(){},closePath(){},moveTo:ny,lineTo:ny,rect(e,t,n,r){Wm?(ty(e+n,t),ty(e+n,t+r),ty(e,t+r),ny(e,t)):(Xm(e+n,t+r),Zm(e,t))},quadraticCurveTo(e,t,n,r){const i=Qm(e,t),o=ey(e,t),a=Qm(n,r),s=ey(n,r);oy(Um,i,a,Jm),oy(qm,o,s,Km),Zm(a,s)},bezierCurveTo(e,t,n,r,i,o){const a=Qm(e,t),s=ey(e,t),u=Qm(n,r),l=ey(n,r),c=Qm(i,o),f=ey(i,o);ay(Um,a,u,c,Jm),ay(qm,s,l,f,Km),Zm(c,f)},arc(e,t,n,r,i,o){if(r+=Wm,i+=Wm,Um=n*Math.cos(i)+e,qm=n*Math.sin(i)+t,Math.abs(i-r)>Lm)Xm(e-n,t-n),Xm(e+n,t+n);else{const a=r=>Xm(n*Math.cos(r)+e,n*Math.sin(r)+t);let s,u;if(a(r),a(i),i!==r)if((r%=Yg)<0&&(r+=Yg),(i%=Yg)<0&&(i+=Yg),ii;++u,s-=Vg)a(s);else for(s=r-r%Vg+Vg,u=0;u<4&&s1e-14?(u=a*a+s*o,u>=0&&(u=Math.sqrt(u),l=(-a+u)/o,c=(-a-u)/o)):l=.5*s/a,0m)return!1;h>g&&(g=h)}else if(f>0){if(h0&&(e.globalAlpha=n,e.fillStyle=vy(e,t,t.fill),!0)}var xy=[];function _y(e,t,n){var r=null!=(r=t.strokeWidth)?r:1;return!(r<=0)&&(n*=null==t.strokeOpacity?1:t.strokeOpacity)>0&&(e.globalAlpha=n,e.strokeStyle=vy(e,t,t.stroke),e.lineWidth=r,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||xy),e.lineDashOffset=t.strokeDashOffset||0),!0)}function wy(e,t){return e.zindex-t.zindex||e.index-t.index}function ky(e){if(!e.zdirty)return e.zitems;var t,n,r,i=e.items,o=[];for(n=0,r=i.length;n=0;)if(n=t(i[r]))return n;if(i===o)for(r=(i=e.items).length;--r>=0;)if(!i[r].zindex&&(n=t(i[r])))return n;return null}function Oy(e){return function(t,n,r){Ay(n,(n=>{r&&!r.intersects(n.bounds)||Sy(e,t,n,n)}))}}function Dy(e){return function(t,n,r){!n.items.length||r&&!r.intersects(n.bounds)||Sy(e,t,n.items[0],n.items)}}function Sy(e,t,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(e(t,r)||(gy(t,n),n.fill&&by(t,n,i)&&t.fill(),n.stroke&&_y(t,n,i)&&t.stroke()))}function Cy(e){return e=e||de,function(t,n,r,i,o,a){return r*=t.pixelRatio,i*=t.pixelRatio,Ey(n,(n=>{const s=n.bounds;if((!s||s.contains(o,a))&&s)return e(t,n,r,i,o,a)?n:void 0}))}}function Fy(e,t){return function(n,r,i,o){var a,s,u=Array.isArray(r)?r[0]:r,l=null==t?u.fill:t,c=u.stroke&&n.isPointInStroke;return c&&(a=u.strokeWidth,s=u.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=s?s:"butt"),!e(n,r)&&(l&&n.isPointInPath(i,o)||c&&n.isPointInStroke(i,o))}}function jy(e){return Cy(Fy(e))}function My(e,t){return"translate("+e+","+t+")"}function $y(e){return"rotate("+e+")"}function Ny(e){return My(e.x||0,e.y||0)}function By(e,t,n){function r(e,n){var r=n.x||0,i=n.y||0,o=n.angle||0;e.translate(r,i),o&&e.rotate(o*=Gg),e.beginPath(),t(e,n),o&&e.rotate(-o),e.translate(-r,-i)}return{type:e,tag:"path",nested:!1,attr:function(e,n){e("transform",function(e){return My(e.x||0,e.y||0)+(e.angle?" "+$y(e.angle):"")}(n)),e("d",t(null,n))},bound:function(e,n){return t(ry(e,n.angle),n),Pm(e,n).translate(n.x||0,n.y||0)},draw:Oy(r),pick:jy(r),isect:n||cy(r)}}var Ty=By("arc",(function(e,t){return _m.context(e)(t)}));function zy(e,t,n){function r(e,n){e.beginPath(),t(e,n)}const i=Fy(r);return{type:e,tag:"path",nested:!0,attr:function(e,n){var r=n.mark.items;r.length&&e("d",t(null,r))},bound:function(e,n){var r=n.items;return 0===r.length?e:(t(ry(e),r),Pm(e,r[0]))},draw:Dy(r),pick:function(e,t,n,r,o,a){var s=t.items,u=t.bounds;return!s||!s.length||u&&!u.contains(o,a)?null:(n*=e.pixelRatio,r*=e.pixelRatio,i(e,s,n,r)?s[0]:null)},isect:fy,tip:n}}var Ry=zy("area",(function(e,t){const n=t[0],r=n.interpolate||"linear";return("horizontal"===n.orient?km:wm).curve(Pg(r,n.orient,n.tension)).context(e)(t)}),(function(e,t){for(var n,r,i="horizontal"===e[0].orient?t[1]:t[0],o="horizontal"===e[0].orient?"y":"x",a=e.length,s=1/0;--a>=0;)!1!==e[a].defined&&(r=Math.abs(e[a][o]-i)).5&&t<1.5?.5-Math.abs(t-1):0}function Iy(e,t){const n=Ly(t);e("d",Cm(null,t,n,n))}function Uy(e,t,n,r){const i=Ly(t);e.beginPath(),Cm(e,t,(n||0)+i,(r||0)+i)}const qy=Fy(Uy),Wy=Fy(Uy,!1),Hy=Fy(Uy,!0);var Gy={type:"group",tag:"g",nested:!1,attr:function(e,t){e("transform",Ny(t))},bound:function(e,t){if(!t.clip&&t.items){const n=t.items,r=n.length;for(let t=0;t{const r=t.x||0,i=t.y||0,o=t.strokeForeground,a=null==t.opacity?1:t.opacity;(t.stroke||t.fill)&&a&&(Uy(e,t,r,i),gy(e,t),t.fill&&by(e,t,a)&&e.fill(),t.stroke&&!o&&_y(e,t,a)&&e.stroke()),e.save(),e.translate(r,i),t.clip&&Py(e,t),n&&n.translate(-r,-i),Ay(t,(t=>{this.draw(e,t,n)})),n&&n.translate(r,i),e.restore(),o&&t.stroke&&a&&(Uy(e,t,r,i),gy(e,t),_y(e,t,a)&&e.stroke())}))},pick:function(e,t,n,r,i,o){if(t.bounds&&!t.bounds.contains(i,o)||!t.items)return null;const a=n*e.pixelRatio,s=r*e.pixelRatio;return Ey(t,(u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(i,o))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(ih||op))return;if(e.save(),e.translate(c,f),c=i-c,f=o-f,g&&Sm(u)&&!Hy(e,u,a,s))return e.restore(),null;const m=u.strokeForeground,y=!1!==t.interactive;return y&&m&&u.stroke&&Wy(e,u,a,s)?(e.restore(),u):(l=Ey(u,(e=>function(e,t,n){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,n)}(e,c,f)?this.pick(e,n,r,c,f):null)),!l&&y&&(u.fill||!m&&u.stroke)&&qy(e,u,a,s)&&(l=u),e.restore(),l||null)}))},isect:dy,content:function(e,t,n){e("clip-path",t.clip?Mm(n,t,t):null)},background:function(e,t){e("class","background"),e("aria-hidden",!0),Iy(e,t)},foreground:function(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?Iy(e,t):e("d","")}},Vy={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Yy(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then((t=>{e.image=t,e.image.url=e.url}))),n}function Xy(e,t){return null!=e.width?e.width:t&&t.width?!1!==e.aspect&&e.height?e.height*t.width/t.height:t.width:0}function Zy(e,t){return null!=e.height?e.height:t&&t.height?!1!==e.aspect&&e.width?e.width*t.height/t.width:t.height:0}function Jy(e,t){return"center"===e?t/2:"right"===e?t:0}function Ky(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var Qy={type:"image",tag:"image",nested:!1,attr:function(e,t,n){const r=Yy(t,n),i=Xy(t,r),o=Zy(t,r),a=(t.x||0)-Jy(t.align,i),s=(t.y||0)-Ky(t.baseline,o);e("href",!r.src&&r.toDataURL?r.toDataURL():r.src||"",Vy["xmlns:xlink"],"xlink:href"),e("transform",My(a,s)),e("width",i),e("height",o),e("preserveAspectRatio",!1===t.aspect?"none":"xMidYMid")},bound:function(e,t){const n=t.image,r=Xy(t,n),i=Zy(t,n),o=(t.x||0)-Jy(t.align,r),a=(t.y||0)-Ky(t.baseline,i);return e.set(o,a,o+r,a+i)},draw:function(e,t,n){Ay(t,(t=>{if(n&&!n.intersects(t.bounds))return;const r=Yy(t,this);let i=Xy(t,r),o=Zy(t,r);if(0===i||0===o)return;let a,s,u,l,c=(t.x||0)-Jy(t.align,i),f=(t.y||0)-Ky(t.baseline,o);!1!==t.aspect&&(s=r.width/r.height,u=t.width/t.height,s==s&&u==u&&s!==u&&(u=0;)if(!1!==e[o].defined&&(n=e[o].x-t[0])*n+(r=e[o].y-t[1])*r{if(!n||n.intersects(t.bounds)){var r=null==t.opacity?1:t.opacity;r&&ov(e,t,r)&&(gy(e,t),e.stroke())}}))},pick:Cy((function(e,t,n,r){return!!e.isPointInStroke&&ov(e,t,1)&&e.isPointInStroke(n,r)})),isect:hy},sv=By("shape",(function(e,t){return(t.mark.shape||t.shape).context(e)(t)})),uv=By("symbol",(function(e,t){return Om.context(e)(t)}),fy);const lv=wt();var cv={height:mv,measureWidth:pv,estimateWidth:dv,width:dv,canvas:fv};function fv(e){cv.width=e&&uy?pv:dv}function dv(e,t){return hv(xv(e,t),mv(e))}function hv(e,t){return~~(.8*e.length*t)}function pv(e,t){return mv(e)<=0||!(t=xv(e,t))?0:gv(t,wv(e))}function gv(e,t){const n=`(${t}) ${e}`;let r=lv.get(n);return void 0===r&&(uy.font=t,r=uy.measureText(e).width,lv.set(n,r)),r}function mv(e){return null!=e.fontSize?+e.fontSize||0:11}function yv(e){return null!=e.lineHeight?e.lineHeight:mv(e)+2}function vv(e){return t=e.lineBreak&&e.text&&!_e(e.text)?e.text.split(e.lineBreak):e.text,_e(t)?t.length>1?t:t[0]:t;var t}function bv(e){const t=vv(e);return(_e(t)?t.length-1:0)*yv(e)}function xv(e,t){const n=null==t?"":(t+"").trim();return e.limit>0&&n.length?function(e,t){var n=+e.limit,r=function(e){if(cv.width===pv){const t=wv(e);return e=>gv(e,t)}{const t=mv(e);return e=>hv(e,t)}}(e);if(r(t)>>1,r(t.slice(i))>n?s=i+1:u=i;return o+t.slice(s)}for(;s>>1),r(t.slice(0,i))Math.max(e,cv.width(t,n))),0)):r=cv.width(t,f),"center"===o?l-=r/2:"right"===o&&(l-=r),e.set(l+=s,c+=u,l+r,c+i),t.angle&&!n)e.rotate(t.angle*Gg,s,u);else if(2===n)return e.rotatedPoints(t.angle*Gg,s,u);return e}var Sv={type:"text",tag:"text",nested:!1,attr:function(e,t){var n,r=t.dx||0,i=(t.dy||0)+kv(t),o=Ov(t),a=o.x1,s=o.y1,u=t.angle||0;e("text-anchor",Av[t.align]||"start"),u?(n=My(a,s)+" "+$y(u),(r||i)&&(n+=" "+My(r,i))):n=My(a+r,s+i),e("transform",n)},bound:Dv,draw:function(e,t,n){Ay(t,(t=>{var r,i,o,a,s,u,l,c=null==t.opacity?1:t.opacity;if(!(n&&!n.intersects(t.bounds)||0===c||t.fontSize<=0||null==t.text||0===t.text.length)){if(e.font=wv(t),e.textAlign=t.align||"left",i=(r=Ov(t)).x1,o=r.y1,t.angle&&(e.save(),e.translate(i,o),e.rotate(t.angle*Gg),i=o=0),i+=t.dx||0,o+=(t.dy||0)+kv(t),u=vv(t),gy(e,t),_e(u))for(s=yv(t),a=0;a=0;)if(!1!==e[i].defined&&(n=e[i].x-t[0])*n+(r=e[i].y-t[1])*r<(n=e[i].size||1)*n)return e[i];return null})),Fv={arc:Ty,area:Ry,group:Gy,image:Qy,line:ev,path:nv,rect:iv,rule:av,shape:sv,symbol:uv,text:Sv,trail:Cv};function jv(e,t,n){var r=Fv[e.mark.marktype],i=t||r.bound;return r.nested&&(e=e.mark),i(e.bounds||(e.bounds=new $m),e,n)}var Mv={mark:null};function $v(e,t,n){var r,i,o,a,s=Fv[e.marktype],u=s.bound,l=e.items,c=l&&l.length;if(s.nested)return c?o=l[0]:(Mv.mark=e,o=Mv),a=jv(o,u,n),t&&t.union(a)||a;if(t=t||e.bounds&&e.bounds.clear()||new $m,c)for(r=0,i=l.length;rt;)e.removeChild(n[--r]);return e}function Wv(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function Hv(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function Gv(e,t){this._active=null,this._handlers={},this._loader=e||ja(),this._tooltip=t||Vv}function Vv(e,t,n,r){e.element().setAttribute("title",r||"")}function Yv(e){this._el=null,this._bgcolor=null,this._loader=new Tm(e)}Rv.prototype={toJSON(e){return Bv(this.root,e||0)},mark(e,t,n){const r=Pv(e,t=t||this.root.items[0]);return t.items[n]=r,r.zindex&&(r.group.zdirty=!0),r}},Gv.prototype={initialize(e,t,n){return this._el=e,this._obj=n||null,this.origin(t)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()},scene(e){return arguments.length?(this._scene=e,this):this._scene},on(){},off(){},_handlerIndex(e,t,n){for(let r=e?e.length:0;--r>=0;)if(e[r].type===t&&(!n||e[r].handler===n))return r;return-1},handlers(e){const t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(const e in t)n.push(...t[e]);return n},eventName(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)},handleHref(e,t,n){this._loader.sanitize(n,{context:"href"}).then((t=>{const n=new MouseEvent(e.type,e),r=Lv(null,"a");for(const e in t)r.setAttribute(e,t[e]);r.dispatchEvent(n)})).catch((()=>{}))},handleTooltip(e,t,n){if(t&&null!=t.tooltip){t=function(e,t,n,r){var i,o,a=e&&e.mark;if(a&&(i=Fv[a.marktype]).tip){for((o=Hv(t,n))[0]-=r[0],o[1]-=r[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=i.tip(a.items,o)}return e}(t,e,this.canvas(),this._origin);const r=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,r)}},getItemBoundingClientRect(e){const t=this.canvas();if(!t)return;const n=t.getBoundingClientRect(),r=this._origin,i=e.bounds,o=i.width(),a=i.height();let s=i.x1+r[0]+n.left,u=i.y1+r[1]+n.top;for(;e.mark&&(e=e.mark.group);)s+=e.x||0,u+=e.y||0;return{x:s,y:u,width:o,height:a,left:s,top:u,right:s+o,bottom:u+a}}},Yv.prototype={initialize(e,t,n,r,i){return this._el=e,this.resize(t,n,r,i)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(e){return 0===arguments.length?this._bgcolor:(this._bgcolor=e,this)},resize(e,t,n,r){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=r||1,this},dirty(){},render(e){const t=this;return t._call=function(){t._render(e)},t._call(),t._call=null,t},_render(){},renderAsync(e){const t=this.render(e);return this._ready?this._ready.then((()=>t)):Promise.resolve(t)},_load(e,t){var n=this,r=n._loader[e](t);if(!n._ready){const e=n._call;n._ready=n._loader.ready().then((t=>{t&&e(),n._ready=null}))}return r},sanitizeURL(e){return this._load("sanitizeURL",e)},loadImage(e){return this._load("loadImage",e)}};const Xv="dragenter",Zv="dragleave",Jv="dragover",Kv="mousedown",Qv="mousemove",eb="mouseout",tb="mouseover",nb="click",rb="mousewheel",ib="touchstart",ob="touchmove",ab="touchend",sb=Qv,ub=eb,lb=nb;function cb(e,t){Gv.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}function fb(e,t){(e=>e===ib||e===ob||e===ab?[ib,ob,ab]:[e])(t).forEach((t=>function(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?n=>e[t](n):n=>e.fire(t,n)))}(e,t)))}function db(e,t,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i||(i&&i.exit||this.fire(n,r),this._active=o,this.fire(t,r)),this.fire(e,r)}}function hb(e){return function(t){this.fire(e,t),this._active=null}}ft(cb,Gv,{initialize(e,t,n){return this._canvas=e&&Iv(e,"canvas"),[nb,Kv,Qv,eb,Zv].forEach((e=>fb(this,e))),Gv.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:["keydown","keypress","keyup",Xv,Zv,Jv,Kv,"mouseup",Qv,eb,tb,nb,"dblclick","wheel",rb,ib,ob,ab],DOMMouseScroll(e){this.fire(rb,e)},mousemove:db(Qv,tb,eb),dragover:db(Jv,Xv,Zv),mouseout:hb(eb),dragleave:hb(Zv),mousedown(e){this._down=this._active,this.fire(Kv,e)},click(e){this._down===this._active&&(this.fire(nb,e),this._down=null)},touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(ib,e,!0)},touchmove(e){this.fire(ob,e,!0)},touchend(e){this.fire(ab,e,!0),this._touch=null},fire(e,t,n){const r=n?this._touch:this._active,i=this._handlers[e];if(t.vegaType=e,e===lb&&r&&r.href?this.handleHref(t,r,r.href):e!==sb&&e!==ub||this.handleTooltip(t,r,e!==ub),i)for(let e=0,n=i.length;e=0&&r.splice(i,1),this},pickEvent(e){const t=Hv(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])},pick(e,t,n,r,i){const o=this.context();return Fv[e.marktype].pick.call(this,o,e,t,n,r,i)}});var pb="undefined"!=typeof window&&window.devicePixelRatio||1;function gb(e){Yv.call(this,e),this._options={},this._redraw=!1,this._dirty=new $m,this._tempb=new $m}const mb=Yv.prototype;function yb(e,t){Gv.call(this,e,t);const n=this;n._hrefHandler=vb(n,((e,t)=>{t&&t.href&&n.handleHref(e,t,t.href)})),n._tooltipHandler=vb(n,((e,t)=>{n.handleTooltip(e,t,e.type!==ub)}))}ft(gb,Yv,{initialize(e,t,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:ff(1,1,this._options.type),e&&this._canvas&&(qv(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),mb.initialize.call(this,e,t,n,r,i)},resize(e,t,n,r){if(mb.resize.call(this,e,t,n,r),this._canvas)!function(e,t,n,r,i,o){const a="undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,s=e.getContext("2d"),u=a?pb:i;e.width=t*u,e.height=n*u;for(const e in o)s[e]=o[e];a&&1!==u&&(e.style.width=t+"px",e.style.height=n+"px"),s.pixelRatio=u,s.setTransform(u,0,0,u,u*r[0],u*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const e=this._options.externalContext;e||oe("CanvasRenderer is missing a valid canvas or context"),e.scale(this._scale,this._scale),e.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)},_render(e){const t=this.context(),n=this._origin,r=this._width,i=this._height,o=this._dirty,a=((e,t,n)=>(new $m).set(0,0,t,n).translate(-e[0],-e[1]))(n,r,i);t.save();const s=this._redraw||o.empty()?(this._redraw=!1,a.expand(1)):function(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-n[0]%1,-n[1]%1),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}(t,a.intersect(o),n);return this.clear(-n[0],-n[1],r,i),this.draw(t,e,s),t.restore(),o.clear(),this},draw(e,t,n){const r=Fv[t.marktype];t.clip&&function(e,t){var n=t.clip;e.save(),Ye(n)?(e.beginPath(),n(e),e.clip()):Py(e,t.group)}(e,t),r.draw.call(this,e,t,n),t.clip&&e.restore()},clear(e,t,n,r){const i=this._options,o=this.context();"pdf"===i.type||i.externalContext||o.clearRect(e,t,n,r),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(e,t,n,r))}});const vb=(e,t)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,t.call(e._obj,n,r)};ft(yb,Gv,{initialize(e,t,n){let r=this._svg;return r&&(r.removeEventListener(lb,this._hrefHandler),r.removeEventListener(sb,this._tooltipHandler),r.removeEventListener(ub,this._tooltipHandler)),this._svg=r=e&&Iv(e,"svg"),r&&(r.addEventListener(lb,this._hrefHandler),r.addEventListener(sb,this._tooltipHandler),r.addEventListener(ub,this._tooltipHandler)),Gv.prototype.initialize.call(this,e,t,n)},canvas(){return this._svg},on(e,t){const n=this.eventName(e),r=this._handlers;if(this._handlerIndex(r[n],e,t)<0){const i={type:e,handler:t,listener:vb(this,t)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this},off(e,t){const n=this.eventName(e),r=this._handlers[n],i=this._handlerIndex(r,e,t);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}});const bb="aria-hidden",xb="aria-label",_b="role",wb="aria-roledescription",kb="graphics-object",Ab="graphics-symbol",Eb=(e,t,n)=>({[_b]:e,[wb]:t,[xb]:n||void 0}),Ob=Mt(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),Db={axis:{desc:"axis",caption:function(e){const t=e.datum,n=e.orient,r=t.title?Mb(e):null,i=e.context,o=i.scales[t.scale].value,a=i.dataflow.locale(),s=o.type;return`${"left"===n||"right"===n?"Y":"X"}-axis`+(r?` titled '${r}'`:"")+` for a ${Zp(s)?"discrete":s} scale`+` with ${jg(a,o,e)}`}},legend:{desc:"legend",caption:function(e){const t=e.datum,n=t.title?Mb(e):null,r=`${t.type||""} legend`.trim(),i=t.scales,o=Object.keys(i),a=e.context,s=a.scales[i[o[0]]].value,u=a.dataflow.locale();return((l=r).length?l[0].toUpperCase()+l.slice(1):l)+(n?` titled '${n}'`:"")+` for ${function(e){return(e=e.map((e=>e+("fill"===e||"stroke"===e?" color":"")))).length<2?e[0]:e.slice(0,-1).join(", ")+" and "+De(e)}(o)}`+` with ${jg(u,s,e)}`;var l}},"title-text":{desc:"title",caption:e=>`Title text '${jb(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${jb(e)}'`}},Sb={ariaRole:_b,ariaRoleDescription:wb,description:xb};function Cb(e,t){const n=!1===t.aria;if(e(bb,n||void 0),n||null==t.description)for(const t in Sb)e(Sb[t],void 0);else{const n=t.mark.marktype;e(xb,t.description),e(_b,t.ariaRole||("group"===n?kb:Ab)),e(wb,t.ariaRoleDescription||`${n} mark`)}}function Fb(e){return!1===e.aria?{[bb]:!0}:Ob[e.role]?null:Db[e.role]?function(e,t){try{const n=e.items[0],r=t.caption||(()=>"");return Eb(t.role||Ab,t.desc,n.description||r(n))}catch(e){return null}}(e,Db[e.role]):function(e){const t=e.marktype,n="group"===t||"text"===t||e.items.some((e=>null!=e.description&&!1!==e.aria));return Eb(n?kb:Ab,`${t} mark container`,e.description)}(e)}function jb(e){return Ge(e.text).join(" ")}function Mb(e){try{return Ge(De(e.items).items[0].text).join(" ")}catch(e){return null}}const $b=e=>(e+"").replace(/&/g,"&").replace(//g,">"),Nb=e=>$b(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function Bb(){let e="",t="",n="";const r=[],i=()=>t=n="",o=(e,n)=>(null!=n&&(t+=` ${e}="${Nb(n)}"`),a),a={open(s){(o=>{t&&(e+=`${t}>${n}`,i()),r.push(o)})(s),t="<"+s;for(var u=arguments.length,l=new Array(u>1?u-1:0),c=1;c${n}`:"/>"):``,i(),a},attr:o,text:e=>(n+=$b(e),a),toString:()=>e};return a}const Tb=e=>zb(Bb(),e)+"";function zb(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,r=n.length;for(let t=0;t1&&e.previousSibling!=t}(a,n))&&t.insertBefore(a,n?n.nextSibling:t.firstChild),a}ft(qb,Yv,{initialize(e,t,n,r,i){return this._defs={},this._clearDefs(),e&&(this._svg=Uv(e,0,"svg",Ub),this._svg.setAttributeNS(Ib,"xmlns",Ub),this._svg.setAttributeNS(Ib,"xmlns:xlink",Vy["xmlns:xlink"]),this._svg.setAttribute("version",Vy.version),this._svg.setAttribute("class","marks"),qv(e,1),this._root=Uv(this._svg,0,"g",Ub),ex(this._root,Lb),qv(this._svg,1)),this.background(this._bgcolor),Wb.initialize.call(this,e,t,n,r,i)},background(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),Wb.background.apply(this,arguments)},resize(e,t,n,r){return Wb.resize.call(this,e,t,n,r),this._svg&&(ex(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this},canvas(){return this._svg},svg(){const e=this._svg,t=this._bgcolor;if(!e)return null;let n;t&&(e.removeAttribute("style"),n=Uv(e,0,"rect",Ub),ex(n,{width:this._width,height:this._height,fill:t}));const r=Tb(e);return t&&(e.removeChild(n),this._svg.style.setProperty("background-color",t)),r},_render(e){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,e),qv(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty(e){e.dirty!==this._dirtyID&&(e.dirty=this._dirtyID,this._dirty.push(e))},isDirty(e){return this._dirtyAll||!e._svg||!e._svg.ownerSVGElement||e.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const e=this._dirty;if(!e.length||!this._dirtyID)return!0;const t=++this._dirtyID;let n,r,i,o,a,s,u;for(a=0,s=e.length;a{e.dirty=t}))),r.zdirty||(n.exit?(o.nested&&r.items.length?(u=r.items[0],u._svg&&this._update(o,u._svg,u)):n._svg&&(u=n._svg.parentNode,u&&u.removeChild(n._svg)),n._svg=null):(n=o.nested?r.items[0]:n,n._update!==t&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,Hb(n,t)),n._update=t)));return!this._dirtyAll},mark(e,t,n){if(!this.isDirty(t))return t._svg;const r=this._svg,i=Fv[t.marktype],o=!1===t.interactive?"none":null,a="g"===i.tag,s=Yb(t,e,n,"g",r);s.setAttribute("class",Wv(t));const u=Fb(t);for(const e in u)tx(s,e,u[e]);a||tx(s,"pointer-events",o),tx(s,"clip-path",t.clip?Mm(this,t,t.group):null);let l=null,c=0;const f=e=>{const t=this.isDirty(e),n=Yb(e,s,l,i.tag,r);t&&(this._update(i,n,e),a&&function(e,t,n){t=t.lastChild.previousSibling;let r,i=0;Ay(n,(n=>{r=e.mark(t,n,r),++i})),qv(t,1+i)}(this,n,e)),l=n,++c};return i.nested?t.items.length&&f(t.items[0]):Ay(t,f),qv(s,c),s},_update(e,t,n){Xb=t,Zb=t.__values__,Cb(Kb,n),e.attr(Kb,n,this);const r=Jb[e.type];r&&r.call(this,e,t,n),Xb&&this.style(Xb,n)},style(e,t){if(null!=t){for(const n in Rb){let r="font"===n?_v(t):t[n];if(r===Zb[n])continue;const i=Rb[n];null==r?e.removeAttribute(i):(Ng(r)&&(r=Bg(r,this._defs.gradient,nx())),e.setAttribute(i,r+"")),Zb[n]=r}for(const n in Pb)Qb(e,Pb[n],t[n])}},defs(){const e=this._svg,t=this._defs;let n=t.el,r=0;for(const i in t.gradient)n||(t.el=n=Uv(e,1,"defs",Ub)),r=Gb(n,t.gradient[i],r);for(const i in t.clipping)n||(t.el=n=Uv(e,1,"defs",Ub)),r=Vb(n,t.clipping[i],r);n&&(0===r?(e.removeChild(n),t.el=null):qv(n,r))},_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}});let Xb=null,Zb=null;const Jb={group(e,t,n){const r=Xb=t.childNodes[2];Zb=r.__values__,e.foreground(Kb,n,this),Zb=t.__values__,Xb=t.childNodes[1],e.content(Kb,n,this);const i=Xb=t.childNodes[0];e.background(Kb,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==Zb.events&&(tx(r,"pointer-events",o),tx(i,"pointer-events",o),Zb.events=o),n.strokeForeground&&n.stroke){const e=n.fill;tx(r,"display",null),this.style(i,n),tx(i,"stroke",null),e&&(n.fill=null),Zb=r.__values__,this.style(r,n),e&&(n.fill=e),Xb=null}else tx(r,"display","none")},image(e,t,n){!1===n.smooth?(Qb(t,"image-rendering","optimizeSpeed"),Qb(t,"image-rendering","pixelated")):Qb(t,"image-rendering",null)},text(e,t,n){const r=vv(n);let i,o,a,s;_e(r)?(o=r.map((e=>xv(n,e))),i=o.join("\n"),i!==Zb.text&&(qv(t,0),a=t.ownerDocument,s=yv(n),o.forEach(((e,r)=>{const i=Lv(a,"tspan",Ub);i.__data__=n,i.textContent=e,r&&(i.setAttribute("x",0),i.setAttribute("dy",s)),t.appendChild(i)})),Zb.text=i)):(o=xv(n,r),o!==Zb.text&&(t.textContent=o,Zb.text=o)),tx(t,"font-family",_v(n)),tx(t,"font-size",mv(n)+"px"),tx(t,"font-style",n.fontStyle),tx(t,"font-variant",n.fontVariant),tx(t,"font-weight",n.fontWeight)}};function Kb(e,t,n){t!==Zb[e]&&(n?function(e,t,n,r){null!=n?e.setAttributeNS(r,t,n):e.removeAttributeNS(r,t)}(Xb,e,t,n):tx(Xb,e,t),Zb[e]=t)}function Qb(e,t,n){n!==Zb[t]&&(null==n?e.style.removeProperty(t):e.style.setProperty(t,n+""),Zb[t]=n)}function ex(e,t){for(const n in t)tx(e,n,t[n])}function tx(e,t,n){null!=n?e.setAttribute(t,n):e.removeAttribute(t)}function nx(){let e;return"undefined"==typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function rx(e){Yv.call(this,e),this._text=null,this._defs={gradient:{},clipping:{}}}ft(rx,Yv,{svg(){return this._text},_render(e){const t=Bb();t.open("svg",rt({},Vy,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",Lb,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this},mark(e,t){const n=Fv[t.marktype],r=n.tag,i=[Cb,n.attr];e.open("g",{class:Wv(t),"clip-path":t.clip?Mm(this,t,t.group):null},Fb(t),{"pointer-events":"g"!==r&&!1===t.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&e.open("a",a),e.open(r,this.attr(t,o,i,"g"!==r?r:null)),"text"===r){const t=vv(o);if(_e(t)){const n={x:0,dy:yv(o)};for(let r=0;rthis.mark(e,t))),e.close(),r&&a?(i&&(o.fill=null),o.stroke=a,e.open("path",this.attr(t,o,n.foreground,"bgrect")).close(),i&&(o.fill=i)):e.open("path",this.attr(t,o,n.foreground,"bgfore")).close()}e.close(),a&&e.close()};return n.nested?t.items&&t.items.length&&o(t.items[0]):Ay(t,o),e.close()},href(e){const t=e.href;let n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then((e=>{e["xlink:href"]=e.href,e.href=null,(this._hrefs||(this._hrefs={}))[t]=e}))}return null},attr(e,t,n,r){const i={},o=(e,t,n,r)=>{i[r||e]=t};return Array.isArray(n)?n.forEach((e=>e(o,t,this))):n(o,t,this),r&&function(e,t,n,r,i){let o;if(null==t)return e;if("bgrect"===r&&!1===n.interactive&&(e["pointer-events"]="none"),"bgfore"===r&&(!1===n.interactive&&(e["pointer-events"]="none"),e.display="none",null!==t.fill))return e;"image"===r&&!1===t.smooth&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),"text"===r&&(e["font-family"]=_v(t),e["font-size"]=mv(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const n in Rb){let r=t[n];const o=Rb[n];("transparent"!==r||"fill"!==o&&"stroke"!==o)&&null!=r&&(Ng(r)&&(r=Bg(r,i.gradient,"")),e[o]=r)}for(const e in Pb){const n=t[e];null!=n&&(o=o||[],o.push(`${Pb[e]}: ${n};`))}o&&(e.style=o.join(" "))}(i,t,e,r,this._defs),i},defs(e){const t=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(t).length+Object.keys(n).length){e.open("defs");for(const n in t){const r=t[n],i=r.stops;"radial"===r.gradient?(e.open("pattern",{id:$g+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),e.close(),e.open("radialGradient",{id:n,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):e.open("linearGradient",{id:n,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2});for(let t=0;t1?(sx[e]=t,this):sx[e]}function lx(e,t,n){const r=[],i=(new $m).union(t),o=e.marktype;return o?cx(e,i,n,r):"group"===o?fx(e,i,n,r):oe("Intersect scene must be mark node or group item.")}function cx(e,t,n,r){if(function(e,t,n){return e.bounds&&t.intersects(e.bounds)&&("group"===e.marktype||!1!==e.interactive&&(!n||n(e)))}(e,t,n)){const i=e.items,o=e.marktype,a=i.length;let s=0;if("group"===o)for(;s=0;r--)if(i[r]!=o[r])return!1;for(r=i.length-1;r>=0;r--)if(!mx(e[n=i[r]],t[n],n))return!1;return typeof e==typeof t}(e,t):e==t)}function yx(e,t){return mx(Hg(e),Hg(t))}function vx(){jm(),Mg=0}const bx="top",xx="left",_x="right",wx="bottom",kx="start",Ax="middle",Ex="end",Ox="x",Dx="y",Sx="group",Cx="axis",Fx="title",jx="legend",Mx="row-header",$x="row-footer",Nx="row-title",Bx="column-header",Tx="column-footer",zx="column-title",Rx="fit-x",Px="fit-y",Lx="none",Ix="all",Ux="each",qx="flush",Wx="column",Hx="row";function Gx(e){gs.call(this,null,e)}function Vx(e,t,n){return t(e.bounds.clear(),e,n)}ft(Gx,gs,{transform(e,t){const n=t.dataflow,r=e.mark,i=r.marktype,o=Fv[i],a=o.bound;let s,u=r.bounds;if(o.nested)r.items.length&&n.dirty(r.items[0]),u=Vx(r,a),r.items.forEach((e=>{e.bounds.clear().union(u)}));else if(i===Sx||e.modified())switch(t.visit(t.MOD,(e=>n.dirty(e))),u.clear(),r.items.forEach((e=>u.union(Vx(e,a)))),r.role){case Cx:case jx:case Fx:t.reflow()}else s=t.changed(t.REM),t.visit(t.ADD,(e=>{u.union(Vx(e,a))})),t.visit(t.MOD,(e=>{s=s||u.alignsWith(e.bounds),n.dirty(e),u.union(Vx(e,a))})),s&&(u.clear(),r.items.forEach((e=>u.union(e.bounds))));return px(r),t.modifies("bounds")}});const Yx=":vega_identifier:";function Xx(e){gs.call(this,0,e)}function Zx(e){gs.call(this,null,e)}function Jx(e){gs.call(this,null,e)}Xx.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},ft(Xx,gs,{transform(e,t){const n=(i=t.dataflow)._signals[Yx]||(i._signals[Yx]=i.add(0)),r=e.as;var i;let o=n.value;return t.visit(t.ADD,(e=>e[r]=e[r]||++o)),n.set(this.value=o),t}}),ft(Zx,gs,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,function(e){const t=e.groups,n=e.parent;return t&&1===t.size?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const r=n.marktype===Sx?Bm:Nm;return t.visit(t.ADD,(e=>r.call(e,n))),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});const Kx={parity:e=>e.filter(((e,t)=>t%2?e.opacity=0:1)),greedy:(e,t)=>{let n;return e.filter(((e,r)=>r&&Qx(n.bounds,e.bounds,t)?e.opacity=0:(n=e,1)))}},Qx=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),e_=(e,t)=>{for(var n,r=1,i=e.length,o=e[0].bounds;r{const t=e.bounds;return t.width()>1&&t.height()>1},n_=e=>(e.forEach((e=>e.opacity=1)),e),r_=(e,t)=>e.reflow(t.modified()).modifies("opacity");function i_(e){gs.call(this,null,e)}ft(Jx,gs,{transform(e,t){const n=Kx[e.method]||Kx.parity,r=e.separation||0;let i,o,a=t.materialize(t.SOURCE).source;if(!a||!a.length)return;if(!e.method)return e.modified("method")&&(n_(a),t=r_(t,e)),t;if(a=a.filter(t_),!a.length)return;if(e.sort&&(a=a.slice().sort(e.sort)),i=n_(a),t=r_(t,e),i.length>=3&&e_(i,r)){do{i=n(i,r)}while(i.length>=3&&e_(i,r));i.length<3&&!De(a).opacity&&(i.length>1&&(De(i).opacity=0),De(a).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=((e,t,n)=>{var r=e.range(),i=new $m;return t===bx||t===wx?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),e=>i.encloses(e.bounds)})(e.boundScale,e.boundOrient,+e.boundTolerance),a.forEach((e=>{o(e)||(e.opacity=0)})));const s=i[0].mark.bounds.clear();return a.forEach((e=>{e.opacity&&s.union(e.bounds)})),t}}),ft(i_,gs,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,(e=>n.dirty(e))),t.fields&&t.fields.zindex){const e=t.source&&t.source[0];e&&(e.mark.zdirty=!0)}}});const o_=new $m;function a_(e,t,n){return e[t]===n?0:(e[t]=n,1)}function s_(e){var t=e.items[0].orient;return t===xx||t===_x}function u_(e,t,n,r){var i,o,a=t.items[0],s=a.datum,u=null!=a.translate?a.translate:.5,l=a.orient,c=function(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}(s),f=a.range,d=a.offset,h=a.position,p=a.minExtent,g=a.maxExtent,m=s.title&&a.items[c[2]].items[0],y=a.titlePadding,v=a.bounds,b=m&&bv(m),x=0,_=0;switch(o_.clear().union(v),v.clear(),(i=c[0])>-1&&v.union(a.items[i].bounds),(i=c[1])>-1&&v.union(a.items[i].bounds),l){case bx:x=h||0,_=-d,o=Math.max(p,Math.min(g,-v.y1)),v.add(0,-o).add(f,0),m&&l_(e,m,o,y,b,0,-1,v);break;case xx:x=-d,_=h||0,o=Math.max(p,Math.min(g,-v.x1)),v.add(-o,0).add(0,f),m&&l_(e,m,o,y,b,1,-1,v);break;case _x:x=n+d,_=h||0,o=Math.max(p,Math.min(g,v.x2)),v.add(0,0).add(o,f),m&&l_(e,m,o,y,b,1,1,v);break;case wx:x=h||0,_=r+d,o=Math.max(p,Math.min(g,v.y2)),v.add(0,0).add(f,o),m&&l_(e,m,o,y,0,0,1,v);break;default:x=a.x,_=a.y}return Pm(v.translate(x,_),a),a_(a,"x",x+u)|a_(a,"y",_+u)&&(a.bounds=o_,e.dirty(a),a.bounds=v,e.dirty(a)),a.mark.bounds.clear().union(v)}function l_(e,t,n,r,i,o,a,s){const u=t.bounds;if(t.auto){const s=a*(n+i+r);let l=0,c=0;e.dirty(t),o?l=(t.x||0)-(t.x=s):c=(t.y||0)-(t.y=s),t.mark.bounds.clear().union(u.translate(-l,-c)),e.dirty(t)}s.union(u)}const c_=(e,t)=>Math.floor(Math.min(e,t)),f_=(e,t)=>Math.ceil(Math.max(e,t));function d_(e){return(new $m).set(0,0,e.width||0,e.height||0)}function h_(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function p_(e,t,n){const r=we(e)?e[t]:e;return null!=r?r:void 0!==n?n:0}function g_(e){return e<0?Math.ceil(-e):0}function m_(e,t,n){var r,i,o,a,s,u,l,c,f,d,h,p=!n.nodirty,g=n.bounds===qx?d_:h_,m=o_.set(0,0,0,0),y=p_(n.align,Wx),v=p_(n.align,Hx),b=p_(n.padding,Wx),x=p_(n.padding,Hx),_=n.columns||t.length,w=_<=0?1:Math.ceil(t.length/_),k=t.length,A=Array(k),E=Array(_),O=0,D=Array(k),S=Array(w),C=0,F=Array(k),j=Array(k),M=Array(k);for(i=0;i<_;++i)E[i]=0;for(i=0;i1)for(i=0;i0&&(F[i]+=f/2);if(v&&p_(n.center,Hx)&&1!==_)for(i=0;i0&&(j[i]+=d/2);for(i=0;ii&&(e.warn("Grid headers exceed limit: "+i),t=t.slice(0,i)),A+=o,g=0,y=t.length;g=0&&null==(x=n[m]);m-=d);s?(_=null==h?x.x:Math.round(x.bounds.x1+h*x.bounds.width()),w=A):(_=A,w=null==h?x.y:Math.round(x.bounds.y1+h*x.bounds.height())),v.union(b.bounds.translate(_-(b.x||0),w-(b.y||0))),b.x=_,b.y=w,e.dirty(b),E=a(E,v[l])}return E}function x_(e,t,n,r,i,o){if(t){e.dirty(t);var a=n,s=n;r?a=Math.round(i.x1+o*i.width()):s=Math.round(i.y1+o*i.height()),t.bounds.translate(a-(t.x||0),s-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=a,t.y=s,e.dirty(t)}}function __(e,t,n,r,i,o,a){const s=function(e,t){const n=e[t]||{};return(t,r)=>null!=n[t]?n[t]:null!=e[t]?e[t]:r}(n,t),u=function(e,t){let n=-1/0;return e.forEach((e=>{null!=e.offset&&(n=Math.max(n,e.offset))})),n>-1/0?n:t}(e,s("offset",0)),l=s("anchor",kx),c=l===Ex?1:l===Ax?.5:0,f={align:Ux,bounds:s("bounds",qx),columns:"vertical"===s("direction")?1:e.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(t){case xx:f.anchor={x:Math.floor(r.x1)-u,column:Ex,y:c*(a||r.height()+2*r.y1),row:l};break;case _x:f.anchor={x:Math.ceil(r.x2)+u,y:c*(a||r.height()+2*r.y1),row:l};break;case bx:f.anchor={y:Math.floor(i.y1)-u,row:Ex,x:c*(o||i.width()+2*i.x1),column:l};break;case wx:f.anchor={y:Math.ceil(i.y2)+u,x:c*(o||i.width()+2*i.x1),column:l};break;case"top-left":f.anchor={x:u,y:u};break;case"top-right":f.anchor={x:o-u,y:u,column:Ex};break;case"bottom-left":f.anchor={x:u,y:a-u,row:Ex};break;case"bottom-right":f.anchor={x:o-u,y:a-u,column:Ex,row:Ex}}return f}function w_(e,t){var n,r,i=t.items[0],o=i.datum,a=i.orient,s=i.bounds,u=i.x,l=i.y;return i._bounds?i._bounds.clear().union(s):i._bounds=s.clone(),s.clear(),function(e,t,n){var r=t.padding,i=r-n.x,o=r-n.y;if(t.datum.title){var a=t.items[1].items[0],s=a.anchor,u=t.titlePadding||0,l=r-a.x,c=r-a.y;switch(a.orient){case xx:i+=Math.ceil(a.bounds.width())+u;break;case _x:case wx:break;default:o+=a.bounds.height()+u}switch((i||o)&&A_(e,n,i,o),a.orient){case xx:c+=k_(t,n,a,s,1,1);break;case _x:l+=k_(t,n,a,Ex,0,0)+u,c+=k_(t,n,a,s,1,1);break;case wx:l+=k_(t,n,a,s,0,0),c+=k_(t,n,a,Ex,-1,0,1)+u;break;default:l+=k_(t,n,a,s,0,0)}(l||c)&&A_(e,a,l,c),(l=Math.round(a.bounds.x1-r))<0&&(A_(e,n,-l,0),A_(e,a,-l,0))}else(i||o)&&A_(e,n,i,o)}(e,i,i.items[0].items[0]),s=function(e,t){return e.items.forEach((e=>t.union(e.bounds))),t.x1=e.padding,t.y1=e.padding,t}(i,s),n=2*i.padding,r=2*i.padding,s.empty()||(n=Math.ceil(s.width()+n),r=Math.ceil(s.height()+r)),"symbol"===o.type&&function(e){const t=e.reduce(((e,t)=>(e[t.column]=Math.max(t.bounds.x2-t.x,e[t.column]||0),e)),{});e.forEach((e=>{e.width=t[e.column],e.height=e.bounds.y2-e.y}))}(i.items[0].items[0].items[0].items),a!==Lx&&(i.x=u=0,i.y=l=0),i.width=n,i.height=r,Pm(s.set(u,l,u+n,l+r),i),i.mark.bounds.clear().union(s),i}function k_(e,t,n,r,i,o,a){const s="symbol"!==e.datum.type,u=n.datum.vgrad,l=(!s||!o&&u||a?t:t.items[0]).bounds[i?"y2":"x2"]-e.padding,c=u&&o?l:0,f=u&&o?0:l,d=i<=0?0:bv(n);return Math.round(r===kx?c:r===Ex?f-d:.5*(l-d))}function A_(e,t,n,r){t.x+=n,t.y+=r,t.bounds.translate(n,r),t.mark.bounds.translate(n,r),e.dirty(t)}function E_(e){gs.call(this,null,e)}function O_(e,t){let n=0;if(void 0===t)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function D_(e){gs.call(this,null,e)}function S_(e){gs.call(this,null,e)}function C_(){return Pa({})}function F_(e){gs.call(this,null,e)}function j_(e){gs.call(this,[],e)}ft(E_,gs,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach((t=>{e.layout&&function(e,t,n){var r,i,o,a,s,u,l,c=function(e){var t,n,r=e.items,i=r.length,o=0;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;o{(o=e.orient||_x)!==Lx&&(t[o]||(t[o]=[])).push(e)}));for(const r in t){const i=t[r];m_(e,i,__(i,r,n.legends,d,h,l,c))}p.forEach((t=>{const r=t.bounds;if(r.equals(t._bounds)||(t.bounds=t._bounds,e.dirty(t),t.bounds=r,e.dirty(t)),!n.autosize||"fit"!==n.autosize.type&&n.autosize.type!==Rx&&n.autosize.type!==Px)f.union(r);else switch(t.orient){case xx:case _x:f.add(r.x1,0).add(r.x2,0);break;case bx:case wx:f.add(0,r.y1).add(0,r.y2)}}))}f.union(d).union(h),r&&f.union(function(e,t,n,r,i){var o,a=t.items[0],s=a.frame,u=a.orient,l=a.anchor,c=a.offset,f=a.padding,d=a.items[0].items[0],h=a.items[1]&&a.items[1].items[0],p=u===xx||u===_x?r:n,g=0,m=0,y=0,v=0,b=0;if(s!==Sx?u===xx?(g=i.y2,p=i.y1):u===_x?(g=i.y1,p=i.y2):(g=i.x1,p=i.x2):u===xx&&(g=r,p=0),o=l===kx?g:l===Ex?p:(g+p)/2,h&&h.text){switch(u){case bx:case wx:b=d.bounds.height()+f;break;case xx:v=d.bounds.width()+f;break;case _x:v=-d.bounds.width()-f}o_.clear().union(h.bounds),o_.translate(v-(h.x||0),b-(h.y||0)),a_(h,"x",v)|a_(h,"y",b)&&(e.dirty(h),h.bounds.clear().union(o_),h.mark.bounds.clear().union(o_),e.dirty(h)),o_.clear().union(h.bounds)}else o_.clear();switch(o_.union(d.bounds),u){case bx:m=o,y=i.y1-o_.height()-c;break;case xx:m=i.x1-o_.width()-c,y=o;break;case _x:m=i.x2+o_.width()+c,y=o;break;case wx:m=o,y=i.y2+c;break;default:m=a.x,y=a.y}return a_(a,"x",m)|a_(a,"y",y)&&(o_.translate(m,y),e.dirty(a),a.bounds.clear().union(o_),t.bounds.clear().union(o_),e.dirty(a)),a.bounds}(e,r,l,c,f)),t.clip&&f.set(0,0,t.width||0,t.height||0),function(e,t,n,r){const i=r.autosize||{},o=i.type;if(e._autosize<1||!o)return;let a=e._width,s=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if("padding"===i.contains){const t=e.padding();a-=t.left+t.right,s-=t.top+t.bottom}o===Lx?(l=0,f=0,u=a,c=s):"fit"===o?(u=Math.max(0,a-l-d),c=Math.max(0,s-f-h)):o===Rx?(u=Math.max(0,a-l-d),s=c+f+h):o===Px?(a=u+l+d,c=Math.max(0,s-f-h)):"pad"===o&&(a=u+l+d,s=c+f+h),e._resizeView(a,s,u,c,[l,f],i.resize)}(e,t,f,n)}(n,t,e)})),function(e){return e&&"legend-entry"!==e.mark.role}(e.mark.group)?t.reflow():t}}),ft(D_,gs,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,o=e.scale,a=mg(o,null==e.count?e.values?e.values.length:10:e.count,e.minstep),s=e.format||bg(n,o,a,e.formatSpecifier,e.formatType,!!e.values),u=e.values?yg(o,e.values,a):vg(o,a);return i&&(r.rem=i),i=u.map(((e,t)=>Pa({index:t/(u.length-1||1),value:e,label:s(e)}))),e.extra&&i.length&&i.push(Pa({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}}),ft(S_,gs,{transform(e,t){var n=t.dataflow,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||C_,o=e.key||za,a=this.value;return _e(r.encode)&&(r.encode=null),a&&(e.modified("key")||t.modified(o))&&oe("DataJoin does not support modified key function or fields."),a||(t=t.addAll(),this.value=a=function(e){const t=lt().test((e=>e.exit));return t.lookup=n=>t.get(e(n)),t}(o)),t.visit(t.ADD,(e=>{const t=o(e);let n=a.get(t);n?n.exit?(a.empty--,r.add.push(n)):r.mod.push(n):(n=i(e),a.set(t,n),r.add.push(n)),n.datum=e,n.exit=!1})),t.visit(t.MOD,(e=>{const t=o(e),n=a.get(t);n&&(n.datum=e,r.mod.push(n))})),t.visit(t.REM,(e=>{const t=o(e),n=a.get(t);e!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++a.empty)})),t.changed(t.ADD_MOD)&&r.modifies("datum"),(t.clean()||e.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),r}}),ft(F_,gs,{transform(e,t){var n=t.fork(t.ADD_REM),r=e.mod||!1,i=e.encoders,o=t.encode;if(_e(o)){if(!n.changed()&&!o.every((e=>i[e])))return t.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,s=i.update||he,u=i.enter||he,l=i.exit||he,c=(o&&!a?i[o]:s)||he;if(t.changed(t.ADD)&&(t.visit(t.ADD,(t=>{u(t,e),s(t,e)})),n.modifies(u.output),n.modifies(s.output),c!==he&&c!==s&&(t.visit(t.ADD,(t=>{c(t,e)})),n.modifies(c.output))),t.changed(t.REM)&&l!==he&&(t.visit(t.REM,(t=>{l(t,e)})),n.modifies(l.output)),a||c!==he){const i=t.MOD|(e.modified()?t.REFLOW:0);a?(t.visit(i,(t=>{const i=u(t,e)||r;(c(t,e)||i)&&n.mod.push(t)})),n.mod.length&&n.modifies(u.output)):t.visit(i,(t=>{(c(t,e)||r)&&n.mod.push(t)})),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}}),ft(j_,gs,{transform(e,t){if(null!=this.value&&!e.modified())return t.StopPropagation;var n,r,i,o,a,s=t.dataflow.locale(),u=t.fork(t.NO_SOURCE|t.NO_FIELDS),l=this.value,c=e.type||fg,f=e.scale,d=+e.limit,h=mg(f,null==e.count?5:e.count,e.minstep),p=!!e.values||c===fg,g=e.format||Eg(s,f,h,c,e.formatSpecifier,e.formatType,p),m=e.values||kg(f,h);return l&&(u.rem=l),c===fg?(d&&m.length>d?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),l=m.slice(0,d-1),a=!0):l=m,Ye(i=e.size)?(e.values||0!==f(l[0])||(l=l.slice(1)),o=l.reduce(((t,n)=>Math.max(t,i(n,e))),0)):i=tt(o=i||8),l=l.map(((t,n)=>Pa({index:n,label:g(t,n,l),value:t,offset:o,size:i(t,e)}))),a&&(a=m[l.length],l.push(Pa({index:l.length,label:`…${m.length-l.length} entries`,value:a,offset:o,size:i(a,e)})))):"gradient"===c?(n=f.domain(),r=og(f,n[0],De(n)),m.length<3&&!e.values&&n[0]!==De(n)&&(m=[n[0],De(n)]),l=m.map(((e,t)=>Pa({index:t,label:g(e,t,m),value:e,perc:r(e)})))):(i=m.length-1,r=function(e){const t=e.domain(),n=t.length-1;let r=+t[0],i=+De(t),o=i-r;if(e.type===Cp){const e=n?o/n:.1;r-=e,i+=e,o=i-r}return e=>(e-r)/o}(f),l=m.map(((e,t)=>Pa({index:t,label:g(e,t,m),value:e,perc:t?r(e):0,perc2:t===i?1:r(m[t+1])})))),u.source=l,u.add=l,this.value=l,u}});const M_=e=>e.source.x,$_=e=>e.source.y,N_=e=>e.target.x,B_=e=>e.target.y;function T_(e){gs.call(this,{},e)}T_.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},ft(T_,gs,{transform(e,t){var n=e.sourceX||M_,r=e.sourceY||$_,i=e.targetX||N_,o=e.targetY||B_,a=e.as||"path",s=e.orient||"vertical",u=e.shape||"line",l=L_.get(u+"-"+s)||L_.get(u);return l||oe("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,(e=>{e[a]=l(n(e),r(e),i(e),o(e))})),t.reflow(e.modified()).modifies(a)}});const z_=(e,t,n,r)=>"M"+e+","+t+"L"+n+","+r,R_=(e,t,n,r)=>{var i=n-e,o=r-t,a=Math.sqrt(i*i+o*o)/2;return"M"+e+","+t+"A"+a+","+a+" "+180*Math.atan2(o,i)/Math.PI+" 0 1 "+n+","+r},P_=(e,t,n,r)=>{const i=n-e,o=r-t,a=.2*(i+o),s=.2*(o-i);return"M"+e+","+t+"C"+(e+a)+","+(t+s)+" "+(n+s)+","+(r-a)+" "+n+","+r},L_=lt({line:z_,"line-radial":(e,t,n,r)=>z_(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),arc:R_,"arc-radial":(e,t,n,r)=>R_(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),curve:P_,"curve-radial":(e,t,n,r)=>P_(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),"orthogonal-horizontal":(e,t,n,r)=>"M"+e+","+t+"V"+r+"H"+n,"orthogonal-vertical":(e,t,n,r)=>"M"+e+","+t+"H"+n+"V"+r,"orthogonal-radial":(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n);return"M"+t*i+","+t*o+"A"+t+","+t+" 0 0,"+((Math.abs(n-e)>Math.PI?n<=e:n>e)?1:0)+" "+t*a+","+t*s+"L"+r*a+","+r*s},"diagonal-horizontal":(e,t,n,r)=>{const i=(e+n)/2;return"M"+e+","+t+"C"+i+","+t+" "+i+","+r+" "+n+","+r},"diagonal-vertical":(e,t,n,r)=>{const i=(t+r)/2;return"M"+e+","+t+"C"+e+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n),u=(t+r)/2;return"M"+t*i+","+t*o+"C"+u*i+","+u*o+" "+u*a+","+u*s+" "+r*a+","+r*s}});function I_(e){gs.call(this,null,e)}I_.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},ft(I_,gs,{transform(e,t){var n,r,i,o=e.as||["startAngle","endAngle"],a=o[0],s=o[1],u=e.field||fe,l=e.startAngle||0,c=null!=e.endAngle?e.endAngle:2*Math.PI,f=t.source,d=f.map(u),h=d.length,p=l,g=(c-l)/O_(d),m=Au(h);for(e.sort&&m.sort(((e,t)=>d[e]-d[t])),n=0;ne+(t<0?-1:t>0?1:0)),0))!==t.length&&n.warn("Log scale domain includes zero: "+Dt(t)));return t}function G_(e,t,n){return Ye(e)&&(t||n)?ng(e,V_(t||[0,1],n)):e}function V_(e,t){return t?e.slice().reverse():e}function Y_(e){gs.call(this,null,e)}ft(W_,gs,{transform(e,t){var n=t.dataflow,r=this.value,i=function(e){var t,n=e.type,r="";return n===Ep?Ep+"-"+vp:(function(e){const t=e.type;return Xp(t)&&t!==kp&&t!==Ap&&(e.scheme||e.range&&e.range.length&&e.range.every(vt))}(e)&&(r=2===(t=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(null!=e.domainMid):0)?Ep+"-":3===t?Op+"-":""),(r+n||vp).toLowerCase())}(e);for(i in r&&i===r.type||(this.value=r=Gp(i)()),e)if(!q_[i]){if("padding"===i&&U_(r.type))continue;Ye(r[i])?r[i](e[i]):n.warn("Unsupported scale property: "+i)}return function(e,t,n){var r=e.type,i=t.round||!1,o=t.range;if(null!=t.rangeStep)o=function(e,t,n){e!==Mp&&e!==jp&&oe("Only band and point scales support rangeStep.");var r=(null!=t.paddingOuter?t.paddingOuter:t.padding)||0,i=e===jp?1:(null!=t.paddingInner?t.paddingInner:t.padding)||0;return[0,t.rangeStep*yp(n,i,r)]}(r,t,n);else if(t.scheme&&(o=function(e,t,n){var r,i=t.schemeExtent;return _e(t.scheme)?r=rg(t.scheme,t.interpolate,t.interpolateGamma):(r=cg(t.scheme.toLowerCase()))||oe(`Unrecognized scheme name: ${t.scheme}`),n=e===Cp?n+1:e===$p?n-1:e===Dp||e===Sp?+t.schemeCount||5:n,Qp(e)?G_(r,i,t.reverse):Ye(r)?ig(G_(r,i),n):e===Fp?r:r.slice(0,n)}(r,t,n),Ye(o))){if(e.interpolator)return e.interpolator(o);oe(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&Qp(r))return e.interpolator(rg(V_(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(ag(t.interpolate,t.interpolateGamma)):Ye(e.round)?e.round(i):Ye(e.rangeRound)&&e.interpolate(i?_d:xd),o&&e.range(V_(o,t.reverse))}(r,e,function(e,t,n){let r=t.bins;if(r&&!_e(r)){const t=e.domain(),n=t[0],i=De(t),o=r.step;let a=null==r.start?n:r.start,s=null==r.stop?i:r.stop;o||oe("Scale bins parameter missing step property."),ai&&(s=o*Math.floor(i/o)),r=Au(a,s+o/2,o)}return r?e.bins=r:e.bins&&delete e.bins,e.type===$p&&(r?t.domain||t.domainRaw||(e.domain(r),n=r.length):e.bins=e.domain()),n}(r,e,function(e,t,n){const r=function(e,t,n){return t?(e.domain(H_(e.type,t,n)),t.length):-1}(e,t.domainRaw,n);if(r>-1)return r;var i,o,a=t.domain,s=e.type,u=t.zero||void 0===t.zero&&function(e){const t=e.type;return!e.bins&&(t===vp||t===xp||t===_p)}(e);if(!a)return 0;if(U_(s)&&t.padding&&a[0]!==De(a)&&(a=function(e,t,n,r,i,o){var a=Math.abs(De(n)-n[0]),s=a/(a-2*r),u=e===bp?Ie(t,null,s):e===_p?Ue(t,null,s,.5):e===xp?Ue(t,null,s,i||1):e===wp?qe(t,null,s,o||1):Le(t,null,s);return(t=t.slice())[0]=u[0],t[t.length-1]=u[1],t}(s,a,t.range,t.padding,t.exponent,t.constant)),(u||null!=t.domainMin||null!=t.domainMax||null!=t.domainMid)&&(i=(a=a.slice()).length-1||1,u&&(a[0]>0&&(a[0]=0),a[i]<0&&(a[i]=0)),null!=t.domainMin&&(a[0]=t.domainMin),null!=t.domainMax&&(a[i]=t.domainMax),null!=t.domainMid)){const e=(o=t.domainMid)>a[i]?i+1:oe(u);if(null==t)h.push(e.slice());else for(i={},o=0,a=e.length;od&&(d=f),n&&c.sort(n)}return h.max=d,h}(t.source,e.groupby,l,c),r=0,i=n.length,o=n.max;re;function iw(e,t){e&&aw.hasOwnProperty(e.type)&&aw[e.type](e,t)}var ow={Feature:function(e,t){iw(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r0){for(o=e[--i];i>0&&(t=o,n=e[--i],o=t+n,r=n-(o-t),!r););i>0&&(r<0&&e[i-1]<0||r>0&&e[i-1]>0)&&(n=2*r,t=o+n,n==t-o&&(o=t))}return o}}var fw=1e-6,dw=1e-12,hw=Math.PI,pw=hw/2,gw=hw/4,mw=2*hw,yw=180/hw,vw=hw/180,bw=Math.abs,xw=Math.atan,_w=Math.atan2,ww=Math.cos,kw=Math.ceil,Aw=Math.exp,Ew=(Math.floor,Math.hypot),Ow=Math.log,Dw=Math.pow,Sw=Math.sin,Cw=Math.sign||function(e){return e>0?1:e<0?-1:0},Fw=Math.sqrt,jw=Math.tan;function Mw(e){return e>1?0:e<-1?hw:Math.acos(e)}function $w(e){return e>1?pw:e<-1?-pw:Math.asin(e)}function Nw(){}var Bw,Tw,zw,Rw,Pw=new cw,Lw=new cw,Iw={point:Nw,lineStart:Nw,lineEnd:Nw,polygonStart:function(){Iw.lineStart=Uw,Iw.lineEnd=Hw},polygonEnd:function(){Iw.lineStart=Iw.lineEnd=Iw.point=Nw,Pw.add(bw(Lw)),Lw=new cw},result:function(){var e=Pw/2;return Pw=new cw,e}};function Uw(){Iw.point=qw}function qw(e,t){Iw.point=Ww,Bw=zw=e,Tw=Rw=t}function Ww(e,t){Lw.add(Rw*e-zw*t),zw=e,Rw=t}function Hw(){Ww(Bw,Tw)}const Gw=Iw;var Vw=1/0,Yw=Vw,Xw=-Vw,Zw=Xw,Jw={point:function(e,t){eXw&&(Xw=e),tZw&&(Zw=t)},lineStart:Nw,lineEnd:Nw,polygonStart:Nw,polygonEnd:Nw,result:function(){var e=[[Vw,Yw],[Xw,Zw]];return Xw=Zw=-(Yw=Vw=1/0),e}};const Kw=Jw;var Qw,ek,tk,nk,rk=0,ik=0,ok=0,ak=0,sk=0,uk=0,lk=0,ck=0,fk=0,dk={point:hk,lineStart:pk,lineEnd:yk,polygonStart:function(){dk.lineStart=vk,dk.lineEnd=bk},polygonEnd:function(){dk.point=hk,dk.lineStart=pk,dk.lineEnd=yk},result:function(){var e=fk?[lk/fk,ck/fk]:uk?[ak/uk,sk/uk]:ok?[rk/ok,ik/ok]:[NaN,NaN];return rk=ik=ok=ak=sk=uk=lk=ck=fk=0,e}};function hk(e,t){rk+=e,ik+=t,++ok}function pk(){dk.point=gk}function gk(e,t){dk.point=mk,hk(tk=e,nk=t)}function mk(e,t){var n=e-tk,r=t-nk,i=Fw(n*n+r*r);ak+=i*(tk+e)/2,sk+=i*(nk+t)/2,uk+=i,hk(tk=e,nk=t)}function yk(){dk.point=hk}function vk(){dk.point=xk}function bk(){_k(Qw,ek)}function xk(e,t){dk.point=_k,hk(Qw=tk=e,ek=nk=t)}function _k(e,t){var n=e-tk,r=t-nk,i=Fw(n*n+r*r);ak+=i*(tk+e)/2,sk+=i*(nk+t)/2,uk+=i,lk+=(i=nk*e-tk*t)*(tk+e),ck+=i*(nk+t),fk+=3*i,hk(tk=e,nk=t)}const wk=dk;function kk(e){this._context=e}kk.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,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(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,mw)}},result:Nw};var Ak,Ek,Ok,Dk,Sk,Ck=new cw,Fk={point:Nw,lineStart:function(){Fk.point=jk},lineEnd:function(){Ak&&Mk(Ek,Ok),Fk.point=Nw},polygonStart:function(){Ak=!0},polygonEnd:function(){Ak=null},result:function(){var e=+Ck;return Ck=new cw,e}};function jk(e,t){Fk.point=Mk,Ek=Dk=e,Ok=Sk=t}function Mk(e,t){Dk-=e,Sk-=t,Ck.add(Fw(Dk*Dk+Sk*Sk)),Dk=e,Sk=t}const $k=Fk;let Nk,Bk,Tk,zk;class Rk{constructor(e){this._append=null==e?Pk:function(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Pk;if(t!==Nk){const e=10**t;Nk=t,Bk=function(t){let n=1;this._+=t[0];for(const r=t.length;n=0))throw new RangeError(`invalid digits: ${e}`);i=t}return null===t&&(r=new Rk(i)),a},a.projection(e).digits(i).context(t)}function Ik(){var e,t=[];return{point:function(t,n,r){e.push([t,n,r])},lineStart:function(){t.push(e=[])},lineEnd:Nw,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function Uk(e,t){return bw(e[0]-t[0])=0;--o)i.point((c=l[o])[0],c[1]);else r(d.x,d.p.x,-1,i);d=d.p}l=(d=d.o).z,h=!h}while(!d.v);i.lineEnd()}}}function Hk(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r=0?1:-1,O=E*A,D=O>hw,S=m*w;if(u.add(_w(S*E*Sw(O),y*k+S*ww(O))),a+=D?A+E*mw:A,D^p>=n^x>=n){var C=Xk(Vk(h),Vk(b));Kk(C);var F=Xk(o,C);Kk(F);var j=(D^A>=0?-1:1)*$w(F[2]);(r>j||r===j&&(C[0]||C[1]))&&(s+=D^A>=0?1:-1)}}return(a<-fw||a0){for(f||(i.polygonStart(),f=!0),i.lineStart(),e=0;e1&&2&u&&d.push(d.pop().concat(d.shift())),a.push(d.filter(nA))}return d}}function nA(e){return e.length>1}function rA(e,t){return((e=e.x)[0]<0?e[1]-pw-fw:pw-e[1])-((t=t.x)[0]<0?t[1]-pw-fw:pw-t[1])}const iA=tA((function(){return!0}),(function(e){var t,n=NaN,r=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,a){var s=o>0?hw:-hw,u=bw(o-n);bw(u-hw)0?pw:-pw),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(o,r),t=0):i!==s&&u>=hw&&(bw(n-i)fw?xw((Sw(t)*(o=ww(r))*Sw(n)-Sw(r)*(i=ww(t))*Sw(e))/(i*o*a)):(t+r)/2}(n,r,o,a),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),t=0),e.point(n=o,r=a),i=s},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}}),(function(e,t,n,r){var i;if(null==e)i=n*pw,r.point(-hw,i),r.point(0,i),r.point(hw,i),r.point(hw,0),r.point(hw,-i),r.point(0,-i),r.point(-hw,-i),r.point(-hw,0),r.point(-hw,i);else if(bw(e[0]-t[0])>fw){var o=e[0]0)do{l.point(0===c||3===c?e:n,c>1?r:t)}while((c=(c+s+4)%4)!==f);else l.point(o[0],o[1])}function a(r,i){return bw(r[0]-e)0?0:3:bw(r[0]-n)0?2:1:bw(r[1]-t)0?1:0:i>0?3:2}function s(e,t){return u(e.x,t.x)}function u(e,t){var n=a(e,1),r=a(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(a){var u,l,c,f,d,h,p,g,m,y,v,b=a,x=Ik(),_={point:w,lineStart:function(){_.point=k,l&&l.push(c=[]),y=!0,m=!1,p=g=NaN},lineEnd:function(){u&&(k(f,d),h&&m&&x.rejoin(),u.push(x.result())),_.point=w,m&&b.lineEnd()},polygonStart:function(){b=x,u=[],l=[],v=!0},polygonEnd:function(){var t=function(){for(var t=0,n=0,i=l.length;nr&&(d-o)*(r-a)>(h-a)*(e-o)&&++t:h<=r&&(d-o)*(r-a)<(h-a)*(e-o)&&--t;return t}(),n=v&&t,i=(u=eA(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Wk(u,s,t,o,a),a.polygonEnd()),b=a,u=l=c=null}};function w(e,t){i(e,t)&&b.point(e,t)}function k(o,a){var s=i(o,a);if(l&&c.push([o,a]),y)f=o,d=a,h=s,y=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&m)b.point(o,a);else{var u=[p=Math.max(sA,Math.min(aA,p)),g=Math.max(sA,Math.min(aA,g))],x=[o=Math.max(sA,Math.min(aA,o)),a=Math.max(sA,Math.min(aA,a))];!function(e,t,n,r,i,o){var a,s=e[0],u=e[1],l=0,c=1,f=t[0]-s,d=t[1]-u;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>c)return;a>l&&(l=a)}else if(f>0){if(a0)){if(a/=d,d<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=o-u,d||!(a<0)){if(a/=d,d<0){if(a>c)return;a>l&&(l=a)}else if(d>0){if(a0&&(e[0]=s+l*f,e[1]=u+l*d),c<1&&(t[0]=s+c*f,t[1]=u+c*d),!0}}}}}(u,x,e,t,n,r)?s&&(b.lineStart(),b.point(o,a),v=!1):(m||(b.lineStart(),b.point(u[0],u[1])),b.point(x[0],x[1]),s||b.lineEnd(),v=!1)}p=o,g=a,m=s}return _}}function lA(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return(n=t.invert(n,r))&&e.invert(n[0],n[1])}),n}function cA(e,t){return bw(e)>hw&&(e-=Math.round(e/mw)*mw),[e,t]}function fA(e,t,n){return(e%=mw)?t||n?lA(hA(e),pA(t,n)):hA(e):t||n?pA(t,n):cA}function dA(e){return function(t,n){return bw(t+=e)>hw&&(t-=Math.round(t/mw)*mw),[t,n]}}function hA(e){var t=dA(e);return t.invert=dA(-e),t}function pA(e,t){var n=ww(e),r=Sw(e),i=ww(t),o=Sw(t);function a(e,t){var a=ww(t),s=ww(e)*a,u=Sw(e)*a,l=Sw(t),c=l*n+s*r;return[_w(u*i-c*o,s*n-l*r),$w(c*i+u*o)]}return a.invert=function(e,t){var a=ww(t),s=ww(e)*a,u=Sw(e)*a,l=Sw(t),c=l*i-u*o;return[_w(u*i+l*o,s*n+c*r),$w(c*n-s*r)]},a}function gA(e){return function(t){var n=new mA;for(var r in e)n[r]=e[r];return n.stream=t,n}}function mA(){}function yA(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),lw(n,e.stream(Kw)),t(Kw.result()),null!=r&&e.clipExtent(r),e}function vA(e,t,n){return yA(e,(function(n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+t[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+t[0][1]+(i-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([a,s])}),n)}function bA(e,t,n){return vA(e,[[0,0],t],n)}function xA(e,t,n){return yA(e,(function(n){var r=+t,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];e.scale(150*i).translate([o,a])}),n)}function _A(e,t,n){return yA(e,(function(n){var r=+t,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;e.scale(150*i).translate([o,a])}),n)}cA.invert=cA,mA.prototype={constructor:mA,point:function(e,t){this.stream.point(e,t)},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 wA=16,kA=ww(30*vw);function AA(e,t){return+t?function(e,t){function n(r,i,o,a,s,u,l,c,f,d,h,p,g,m){var y=l-r,v=c-i,b=y*y+v*v;if(b>4*t&&g--){var x=a+d,_=s+h,w=u+p,k=Fw(x*x+_*_+w*w),A=$w(w/=k),E=bw(bw(w)-1)t||bw((y*C+v*F)/b-.5)>.3||a*d+s*h+u*p0,i=bw(t)>fw;function o(e,n){return ww(e)*ww(n)>t}function a(e,n,r){var i=[1,0,0],o=Xk(Vk(e),Vk(n)),a=Yk(o,o),s=o[0],u=a-s*s;if(!u)return!r&&e;var l=t*a/u,c=-t*s/u,f=Xk(i,o),d=Jk(i,l);Zk(d,Jk(o,c));var h=f,p=Yk(d,h),g=Yk(h,h),m=p*p-g*(Yk(d,d)-1);if(!(m<0)){var y=Fw(m),v=Jk(h,(-p-y)/g);if(Zk(v,d),v=Gk(v),!r)return v;var b,x=e[0],_=n[0],w=e[1],k=n[1];_0^v[1]<(bw(v[0]-x)hw^(x<=v[0]&&v[0]<=_)){var O=Jk(h,(-p+y)/g);return Zk(O,d),[v,Gk(O)]}}}function s(t,n){var i=r?e:hw-e,o=0;return t<-i?o|=1:t>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return tA(o,(function(e){var t,n,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(f,d){var h,p=[f,d],g=o(f,d),m=r?g?0:s(f,d):g?s(f+(f<0?hw:-hw),d):0;if(!t&&(l=u=g)&&e.lineStart(),g!==u&&(!(h=a(t,p))||Uk(t,h)||Uk(p,h))&&(p[2]=1),g!==u)c=0,g?(e.lineStart(),h=a(p,t),e.point(h[0],h[1])):(h=a(t,p),e.point(h[0],h[1],2),e.lineEnd()),t=h;else if(i&&t&&r^g){var y;m&n||!(y=a(p,t,!0))||(c=0,r?(e.lineStart(),e.point(y[0][0],y[0][1]),e.point(y[1][0],y[1][1]),e.lineEnd()):(e.point(y[1][0],y[1][1]),e.lineEnd(),e.lineStart(),e.point(y[0][0],y[0][1],3)))}!g||t&&Uk(t,p)||e.point(p[0],p[1]),t=p,u=g,n=m},lineEnd:function(){u&&e.lineEnd(),t=null},clean:function(){return c|(l&&u)<<1}}}),(function(t,r,i,o){!function(e,t,n,r,i,o){if(n){var a=ww(t),s=Sw(t),u=r*n;null==i?(i=t+r*mw,o=t-u/2):(i=oA(a,i),o=oA(a,o),(r>0?io)&&(i+=r*mw));for(var l,c=i;r>0?c>o:c2?e[2]%360*vw:0,C()):[m*yw,y*yw,v*yw]},D.angle=function(e){return arguments.length?(b=e%360*vw,C()):b*yw},D.reflectX=function(e){return arguments.length?(x=e?-1:1,C()):x<0},D.reflectY=function(e){return arguments.length?(_=e?-1:1,C()):_<0},D.precision=function(e){return arguments.length?(a=AA(s,O=e*e),F()):Fw(O)},D.fitExtent=function(e,t){return vA(D,e,t)},D.fitSize=function(e,t){return bA(D,e,t)},D.fitWidth=function(e,t){return xA(D,e,t)},D.fitHeight=function(e,t){return _A(D,e,t)},function(){return t=e.apply(this,arguments),D.invert=t.invert&&S,C()}}function CA(e){var t=0,n=hw/3,r=SA(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*vw,n=e[1]*vw):[t*yw,n*yw]},i}function FA(e,t){var n=Sw(e),r=(n+Sw(t))/2;if(bw(r)2?e[2]*vw:0),t.invert=function(t){return(t=e.invert(t[0]*vw,t[1]*vw))[0]*=yw,t[1]*=yw,t},t}(i.rotate()).invert([0,0]));return u(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:e===zA?[[Math.max(s[0]-o,l),t],[Math.min(s[0]+o,n),r]]:[[l,Math.max(s[1]-o,t)],[n,Math.min(s[1]+o,r)]])}return i.scale=function(e){return arguments.length?(a(e),c()):a()},i.translate=function(e){return arguments.length?(s(e),c()):s()},i.center=function(e){return arguments.length?(o(e),c()):o()},i.clipExtent=function(e){return arguments.length?(null==e?l=t=n=r=null:(l=+e[0][0],t=+e[0][1],n=+e[1][0],r=+e[1][1]),c()):null==l?null:[[l,t],[n,r]]},c()}function PA(e){return jw((pw+e)/2)}function LA(e,t){var n=ww(e),r=e===t?Sw(e):Ow(n/ww(t))/Ow(PA(t)/PA(e)),i=n*Dw(PA(e),r)/r;if(!r)return zA;function o(e,t){i>0?t<-pw+fw&&(t=-pw+fw):t>pw-fw&&(t=pw-fw);var n=i/Dw(PA(t),r);return[n*Sw(r*e),i-n*ww(r*e)]}return o.invert=function(e,t){var n=i-t,o=Cw(r)*Fw(e*e+n*n),a=_w(e,bw(n))*Cw(n);return n*r<0&&(a-=hw*Cw(e)*Cw(n)),[a/r,2*xw(Dw(i/o,1/r))-pw]},o}function IA(e,t){return[e,t]}function UA(e,t){var n=ww(e),r=e===t?Sw(e):(n-ww(t))/(t-e),i=n/r+e;if(bw(r)fw&&--i>0);return[e/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},JA.invert=NA($w),KA.invert=NA((function(e){return 2*xw(e)})),QA.invert=function(e,t){return[-t,2*xw(Aw(e))-pw]};var eE=Math.abs,tE=(Math.atan,Math.atan2,Math.ceil,Math.cos),nE=(Math.exp,Math.floor,Math.log,Math.max,Math.min,Math.pow,Math.round,Math.sign,Math.sin),rE=(Math.tan,1e-6),iE=Math.PI,oE=iE/2,aE=(Math.SQRT1_2,uE(2));function sE(e){return e>1?oE:e<-1?-oE:Math.asin(e)}function uE(e){return e>0?Math.sqrt(e):0}function lE(e,t){var n,r=e*nE(t),i=30;do{t-=n=(t+nE(t)-r)/(1+tE(t))}while(eE(n)>rE&&--i>0);return t/2}uE(iE);var cE=function(e,t,n){function r(r,i){return[e*r*tE(i=lE(n,i)),t*nE(i)]}return r.invert=function(r,i){return i=sE(i/t),[r/(e*tE(i)),sE((2*i+nE(2*i))/n)]},r}(aE/oE,aE,iE);const fE=Lk(),dE=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function hE(e,t){if(!e||"string"!=typeof e)throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(gE[e]=function(e,t){return function n(){const r=t();return r.type=e,r.path=Lk().projection(r),r.copy=r.copy||function(){const e=n();return dE.forEach((t=>{r[t]&&e[t](r[t]())})),e.path.pointRadius(r.path.pointRadius()),e},Hp(r)}}(e,t),this):gE[e]||null}function pE(e){return e&&e.path||fE}const gE={albers:MA,albersusa:function(){var e,t,n,r,i,o,a=MA(),s=jA().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=jA().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(e,t){o=[e,t]}};function c(e){var t=e[0],a=e[1];return o=null,n.point(t,a),o||(r.point(t,a),o)||(i.point(t,a),o)}function f(){return e=t=null,c}return c.invert=function(e){var t=a.scale(),n=a.translate(),r=(e[0]-n[0])/t,i=(e[1]-n[1])/t;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:a).invert(e)},c.stream=function(n){return e&&t===n?e:(r=[a.stream(t=n),s.stream(n),u.stream(n)],i=r.length,e={point:function(e,t){for(var n=-1;++n2?e[2]+90:90]):[(e=n())[0],e[1],e[2]-90]},n([0,0,90]).scale(159.155)}};for(const e in gE)hE(e,gE[e]);function mE(e,t,n){var r=Au(e,t-fw,n).concat(t);return function(e){return r.map((function(t){return[e,t]}))}}function yE(e,t,n){var r=Au(e,t-fw,n).concat(t);return function(e){return r.map((function(t){return[t,e]}))}}function vE(){}const bE=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function xE(){var e=1,t=1,n=a;function r(e,t){return t.map((t=>i(e,t)))}function i(r,i){var a=[],s=[];return function(n,r,i){var a,s,u,l,c,f,d=new Array,h=new Array;for(a=s=-1,l=n[0]>=r,bE[l<<1].forEach(p);++a=r,bE[u|l<<1].forEach(p);for(bE[l<<0].forEach(p);++s=r,c=n[s*e]>=r,bE[l<<1|c<<2].forEach(p);++a=r,f=c,c=n[s*e+a+1]>=r,bE[u|l<<1|c<<2|f<<3].forEach(p);bE[l|c<<3].forEach(p)}for(a=-1,c=n[s*e]>=r,bE[c<<2].forEach(p);++a=r,bE[c<<2|f<<3].forEach(p);function p(e){var t,n,r=[e[0][0]+a,e[0][1]+s],u=[e[1][0]+a,e[1][1]+s],l=o(r),c=o(u);(t=h[l])?(n=d[c])?(delete h[t.end],delete d[n.start],t===n?(t.ring.push(u),i(t.ring)):d[t.start]=h[n.end]={start:t.start,end:n.end,ring:t.ring.concat(n.ring)}):(delete h[t.end],t.ring.push(u),h[t.end=c]=t):(t=d[c])?(n=h[l])?(delete d[t.start],delete h[n.end],t===n?(t.ring.push(u),i(t.ring)):d[n.start]=h[t.end]={start:n.start,end:t.end,ring:n.ring.concat(t.ring)}):(delete d[t.start],t.ring.unshift(r),d[t.start=l]=t):d[l]=h[c]={start:l,end:c,ring:[r,u]}}bE[c<<3].forEach(p)}(r,i,(e=>{n(e,r,i),function(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t0?a.push([e]):s.push(e)})),s.forEach((e=>{for(var t,n=0,r=a.length;n{var o,a=n[0],s=n[1],u=0|a,l=0|s,c=r[l*e+u];a>0&&a0&&s=0&&o>=0||oe("invalid size"),e=i,t=o,r},r.smooth=function(e){return arguments.length?(n=e?a:vE,r):n===a},r}function _E(e,t){for(var n,r=-1,i=t.length;++rr!=h>r&&n<(d-l)*(r-c)/(h-c)+l&&(i=-i)}return i}function kE(e,t,n){var r,i,o,a;return function(e,t,n){return(t[0]-e[0])*(n[1]-e[1])==(n[0]-e[0])*(t[1]-e[1])}(e,t,n)&&(i=e[r=+(e[0]===t[0])],o=n[r],a=t[r],i<=o&&o<=a||a<=o&&o<=i)}function AE(e,t,n){return function(r){var i=it(r),o=n?Math.min(i[0],0):i[0],a=i[1],s=a-o,u=t?rn(o,a,e):s/(e+1);return Au(o+u,a,u)}}function EE(e){gs.call(this,null,e)}function OE(e,t,n,r,i){const o=e.x1||0,a=e.y1||0,s=t*n<0;function u(e){e.forEach(l)}function l(e){s&&e.reverse(),e.forEach(c)}function c(e){e[0]=(e[0]-o)*t+r,e[1]=(e[1]-a)*n+i}return function(e){return e.coordinates.forEach(u),e}}function DE(e,t,n){const r=e>=0?e:js(t,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function SE(e){return Ye(e)?e:tt(+e)}function CE(){var e=e=>e[0],t=e=>e[1],n=fe,r=[-1,-1],i=960,o=500,a=2;function s(s,u){const l=DE(r[0],s,e)>>a,c=DE(r[1],s,t)>>a,f=l?l+2:0,d=c?c+2:0,h=2*f+(i>>a),p=2*d+(o>>a),g=new Float32Array(h*p),m=new Float32Array(h*p);let y=g;s.forEach((r=>{const i=f+(+e(r)>>a),o=d+(+t(r)>>a);i>=0&&i=0&&o0&&c>0?(FE(h,p,g,m,l),jE(h,p,m,g,c),FE(h,p,g,m,l),jE(h,p,m,g,c),FE(h,p,g,m,l),jE(h,p,m,g,c)):l>0?(FE(h,p,g,m,l),FE(h,p,m,g,l),FE(h,p,g,m,l),y=m):c>0&&(jE(h,p,g,m,c),jE(h,p,m,g,c),jE(h,p,g,m,c),y=m);const v=u?Math.pow(2,-2*a):1/O_(y);for(let e=0,t=h*p;e>a),y2:d+(o>>a)}}return s.x=function(t){return arguments.length?(e=SE(t),s):e},s.y=function(e){return arguments.length?(t=SE(e),s):t},s.weight=function(e){return arguments.length?(n=SE(e),s):n},s.size=function(e){if(!arguments.length)return[i,o];var t=+e[0],n=+e[1];return t>=0&&n>=0||oe("invalid size"),i=t,o=n,s},s.cellSize=function(e){return arguments.length?((e=+e)>=1||oe("invalid cell size"),a=Math.floor(Math.log(e)/Math.LN2),s):1<=i&&(t>=o&&(s-=n[t-o+a*e]),r[t-i+a*e]=s/Math.min(t+1,e-1+o-t,o))}function jE(e,t,n,r,i){const o=1+(i<<1);for(let a=0;a=i&&(s>=o&&(u-=n[a+(s-o)*e]),r[a+(s-i)*e]=u/Math.min(s+1,t-1+o-s,o))}function ME(e){gs.call(this,null,e)}EE.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},ft(EE,gs,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=e.field||le,o=xE().smooth(!1!==e.smooth),a=e.thresholds||function(e,t,n){const r=AE(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(e.map((e=>bs(t(e).values))))}(r,i,e),s=null===e.as?null:e.as||"contour",u=[];return r.forEach((t=>{const n=i(t),r=o.size([n.width,n.height])(n.values,_e(a)?a:a(n.values));!function(e,t,n,r){let i=r.scale||t.scale,o=r.translate||t.translate;if(Ye(i)&&(i=i(n,r)),Ye(o)&&(o=o(n,r)),(1===i||null==i)&&!o)return;const a=(mt(i)?i:i[0])||1,s=(mt(i)?i:i[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;e.forEach(OE(t,a,s,u,l))}(r,n,t,e),r.forEach((e=>{u.push(Ia(t,Pa(null!=s?{[s]:e}:e)))}))})),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}}),ME.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const $E=["x","y","weight","size","cellSize","bandwidth"];function NE(e,t){return $E.forEach((n=>null!=t[n]?e[n](t[n]):0)),e}function BE(e){gs.call(this,null,e)}ft(ME,gs,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=function(e,t){var n,r,i,o,a,s,u=[],l=e=>e(o);if(null==t)u.push(e);else for(n={},r=0,i=e.length;rPa(function(e,t){for(let n=0;nfw})).map(u)).concat(Au(kw(o/h)*h,i,h).filter((function(e){return bw(e%g)>fw})).map(l))}return y.lines=function(){return v().map((function(e){return{type:"LineString",coordinates:e}}))},y.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(f(a).slice(1),c(n).reverse().slice(1),f(s).reverse().slice(1))]}},y.extent=function(e){return arguments.length?y.extentMajor(e).extentMinor(e):y.extentMinor()},y.extentMajor=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],s=+e[0][1],a=+e[1][1],r>n&&(e=r,r=n,n=e),s>a&&(e=s,s=a,a=e),y.precision(m)):[[r,s],[n,a]]},y.extentMinor=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],o=+n[0][1],i=+n[1][1],t>e&&(n=t,t=e,e=n),o>i&&(n=o,o=i,i=n),y.precision(m)):[[t,o],[e,i]]},y.step=function(e){return arguments.length?y.stepMajor(e).stepMinor(e):y.stepMinor()},y.stepMajor=function(e){return arguments.length?(p=+e[0],g=+e[1],y):[p,g]},y.stepMinor=function(e){return arguments.length?(d=+e[0],h=+e[1],y):[d,h]},y.precision=function(d){return arguments.length?(m=+d,u=mE(o,i,90),l=yE(t,e,m),c=mE(s,a,90),f=yE(r,n,m),y):m},y.extentMajor([[-180,-90+fw],[180,90-fw]]).extentMinor([[-180,-80-fw],[180,80+fw]])}()}function qE(e){gs.call(this,null,e)}function WE(e){if(!Ye(e))return!1;const t=Mt(te(e));return t.$x||t.$y||t.$value||t.$max}function HE(e){gs.call(this,null,e),this.modified(!0)}function GE(e,t,n){Ye(e[t])&&e[t](n)}function VE(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,o,a,s,u,l,c,f,d,h=e._root,p={data:r},g=e._x0,m=e._y0,y=e._x1,v=e._y1;if(!h)return e._root=p,e;for(;h.length;)if((l=t>=(o=(g+y)/2))?g=o:y=o,(c=n>=(a=(m+v)/2))?m=a:v=a,i=h,!(h=h[f=c<<1|l]))return i[f]=p,e;if(s=+e._x.call(null,h.data),u=+e._y.call(null,h.data),t===s&&n===u)return p.next=h,i?i[f]=p:e._root=p,e;do{i=i?i[f]=new Array(4):e._root=new Array(4),(l=t>=(o=(g+y)/2))?g=o:y=o,(c=n>=(a=(m+v)/2))?m=a:v=a}while((f=c<<1|l)==(d=(u>=a)<<1|s>=o));return i[d]=h,i[f]=p,e}function YE(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function XE(e){return e[0]}function ZE(e){return e[1]}function JE(e,t,n){var r=new KE(null==t?XE:t,null==n?ZE:n,NaN,NaN,NaN,NaN);return null==e?r:r.addAll(e)}function KE(e,t,n,r,i,o){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function QE(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}RE.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},ft(RE,gs,{transform(e,t){var n,r=this._features,i=this._points,o=e.fields,a=o&&o[0],s=o&&o[1],u=e.geojson||!o&&le,l=t.ADD;n=e.modified()||t.changed(t.REM)||t.modified(te(u))||a&&t.modified(te(a))||s&&t.modified(te(s)),this.value&&!n||(l=t.SOURCE,this._features=r=[],this._points=i=[]),u&&t.visit(l,(e=>r.push(u(e)))),a&&s&&(t.visit(l,(e=>{var t=a(e),n=s(e);null!=t&&null!=n&&(t=+t)===t&&(n=+n)===n&&i.push([t,n])})),r=r.concat({type:TE,geometry:{type:"MultiPoint",coordinates:i}})),this.value={type:zE,features:r}}}),PE.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},ft(PE,gs,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.field||le,o=e.as||"path",a=n.SOURCE;!r||e.modified()?(this.value=r=pE(e.projection),n.materialize().reflow()):a=i===le||t.modified(i.fields)?n.ADD_MOD:n.ADD;const s=function(e,t){const n=e.pointRadius();return e.context(null),null!=t&&e.pointRadius(t),n}(r,e.pointRadius);return n.visit(a,(e=>e[o]=r(i(e)))),r.pointRadius(s),n.modifies(o)}}),LE.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},ft(LE,gs,{transform(e,t){var n,r=e.projection,i=e.fields[0],o=e.fields[1],a=e.as||["x","y"],s=a[0],u=a[1];function l(e){const t=r([i(e),o(e)]);t?(e[s]=t[0],e[u]=t[1]):(e[s]=void 0,e[u]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(n=t.modified(i.fields)||t.modified(o.fields),t.visit(n?t.ADD_MOD:t.ADD,l)),t.modifies(a)}}),IE.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},ft(IE,gs,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.as||"shape",o=n.ADD;return r&&!e.modified()||(this.value=r=function(e,t,n){const r=null==n?n=>e(t(n)):r=>{var i=e.pointRadius(),o=e.pointRadius(n)(t(r));return e.pointRadius(i),o};return r.context=t=>(e.context(t),r),r}(pE(e.projection),e.field||se("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,(e=>e[i]=r)),n.modifies(i)}}),UE.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},ft(UE,gs,{transform(e,t){var n,r=this.value,i=this.generator;if(!r.length||e.modified())for(const t in e)Ye(i[t])&&i[t](e[t]);return n=i(),r.length?t.mod.push(Ua(r[0],n)):t.add.push(Pa(n)),r[0]=n,t}}),qE.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},ft(qE,gs,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,r="shared"===e.resolve,i=e.field||le,o=function(e,t){let n;return Ye(e)?(n=n=>e(n,t),n.dep=WE(e)):e?n=tt(e):(n=e=>e.$value/e.$max||0,n.dep=!0),n}(e.opacity,e),a=function(e,t){let n;return Ye(e)?(n=n=>Pf(e(n,t)),n.dep=WE(e)):n=tt(Pf(e||"#888")),n}(e.color,e),s=e.as||"image",u={$x:0,$y:0,$value:0,$max:r?bs(n.map((e=>bs(i(e).values)))):0};return n.forEach((e=>{const t=i(e),n=rt({},e,u);r||(n.$max=bs(t.values||[])),e[s]=function(e,t,n,r){const i=e.width,o=e.height,a=e.x1||0,s=e.y1||0,u=e.x2||i,l=e.y2||o,c=e.values,f=c?e=>c[e]:ce,d=ff(u-a,l-s),h=d.getContext("2d"),p=h.getImageData(0,0,u-a,l-s),g=p.data;for(let e=s,o=0;e{null!=e[t]&&GE(n,t,e[t])}))):dE.forEach((t=>{e.modified(t)&&GE(n,t,e[t])})),null!=e.pointRadius&&n.path.pointRadius(e.pointRadius),e.fit&&function(e,t){const n=function(e){return 1===(e=Ge(e)).length?e[0]:{type:zE,features:e.reduce(((e,t)=>e.concat(function(e){return e.type===zE?e.features:Ge(e).filter((e=>null!=e)).map((e=>e.type===TE?e:{type:TE,geometry:e}))}(t))),[])}}(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});var eO=JE.prototype=KE.prototype;function tO(e){return function(){return e}}function nO(e){return 1e-6*(e()-.5)}function rO(e){return e.x+e.vx}function iO(e){return e.y+e.vy}eO.copy=function(){var e,t,n=new KE(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=QE(r),n;for(e=[{source:r,target:n._root=new Array(4)}];r=e.pop();)for(var i=0;i<4;++i)(t=r.source[i])&&(t.length?e.push({source:t,target:r.target[i]=new Array(4)}):r.target[i]=QE(t));return n},eO.add=function(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return VE(this.cover(t,n),t,n,e)},eO.addAll=function(e){var t,n,r,i,o=e.length,a=new Array(o),s=new Array(o),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=r),if&&(f=i));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;ne||e>=i||r>t||t>=o;)switch(s=(td||(o=u.y0)>h||(a=u.x1)=y)<<1|e>=m)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=u)}else{var v=e-+this._x.call(null,g.data),b=t-+this._y.call(null,g.data),x=v*v+b*b;if(x=(s=(p+m)/2))?p=s:m=s,(c=a>=(u=(g+y)/2))?g=u:y=u,t=h,!(h=h[f=c<<1|l]))return this;if(!h.length)break;(t[f+1&3]||t[f+2&3]||t[f+3&3])&&(n=t,d=f)}for(;h.data!==e;)if(r=h,!(h=h.next))return this;return(i=h.next)&&delete h.next,r?(i?r.next=i:delete r.next,this):t?(i?t[f]=i:delete t[f],(h=t[0]||t[1]||t[2]||t[3])&&h===(t[3]||t[2]||t[1]||t[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=i,this)},eO.removeAll=function(e){for(var t=0,n=e.length;t{}};function aO(){for(var e,t=0,n=arguments.length,r={};t=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++a0)for(var n,r,i=new Array(n),o=0;o=0&&t._call.call(void 0,e),t=t._next;--hO}()}finally{hO=0,function(){for(var e,t,n=fO,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:fO=t);dO=e,SO(r)}(),vO=0}}function DO(){var e=xO.now(),t=e-yO;t>mO&&(bO-=t,yO=e)}function SO(e){hO||(pO&&(pO=clearTimeout(pO)),e-vO>24?(e<1/0&&(pO=setTimeout(OO,e-xO.now()-bO)),gO&&(gO=clearInterval(gO))):(gO||(yO=xO.now(),gO=setInterval(DO,mO)),hO=1,_O(OO)))}AO.prototype=EO.prototype={constructor:AO,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?wO():+n)+(null==t?0:+t),this._next||dO===this||(dO?dO._next=this:fO=this,dO=this),this._call=e,this._time=n,SO()},stop:function(){this._call&&(this._call=null,this._time=1/0,SO())}};const CO=4294967296;function FO(e){return e.x}function jO(e){return e.y}var MO=Math.PI*(3-Math.sqrt(5));function $O(e){return e.index}function NO(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}const BO={center:function(e,t){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;il+p||oc+p||au.index){var g=l-s.x-s.vx,m=c-s.y-s.vy,y=g*g+m*m;ye.r&&(e.r=e[t].r)}function u(){if(t){var r,i,o=t.length;for(n=new Array(o),r=0;r=s)){(e.data!==t||e.next)&&(0===f&&(p+=(f=nO(n))*f),0===d&&(p+=(d=nO(n))*d),p[s(e,t,r),e])));for(a=0,i=new Array(l);at(e,n):t)}function HO(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function GO(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=YO)):void 0===t&&(t=VO);for(var n,r,i,o,a,s=new JO(e),u=[s];n=u.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)u.push(r=i[o]=new JO(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(ZO)}function VO(e){return e.children}function YO(e){return Array.isArray(e)?e[1]:null}function XO(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function ZO(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function JO(e){this.data=e,this.depth=this.height=0,this.parent=null}function KO(e){return null==e?null:QO(e)}function QO(e){if("function"!=typeof e)throw new Error;return e}function eD(){return 0}function tD(e){return function(){return e}}LO.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:PO}]},ft(LO,gs,{transform(e,t){var n,r,i=this.value,o=t.changed(t.ADD_REM),a=e.modified(zO),s=e.iterations||300;if(i?(o&&(t.modifies("index"),i.nodes(t.source)),(a||t.changed(t.MOD))&&IO(i,e,0,t)):(this.value=i=function(e,t){const n=function(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=EO(f),l=cO("tick","end"),c=function(){let e=1;return()=>(e=(1664525*e+1013904223)%CO)/CO}();function f(){d(),l.call("tick",t),n1?(null==n?s.delete(e):s.set(e,p(n)),t):s.get(e)},find:function(t,n,r){var i,o,a,s,u,l=0,c=e.length;for(null==r?r=1/0:r*=r,l=0;l1?(l.on(e,n),t):l.on(e)}}}(e),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),IO(n,t,!0).on("end",(()=>o=!0))}(t.source,e),i.on("tick",(n=t.dataflow,r=this,()=>n.touch(r).run())),e.static||(o=!0,i.tick()),t.modifies("index")),a||o||e.modified(RO)||t.changed()&&e.restart)if(i.alpha(Math.max(i.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(i.alphaMin(),1/s)),e.static)for(i.stop();--s>=0;)i.tick();else if(i.stopped()&&i.restart(),!o)return t.StopPropagation;return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let e,t=this._argops,s=0,u=t.length;s=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return GO(this).eachBefore(XO)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n0&&n*n>r*r+i*i}function aD(e,t){for(var n=0;n1e-6?(D+Math.sqrt(D*D-4*O*S))/(2*O):S/D);return{x:r+w+k*C,y:i+A+E*C,r:C}}function cD(e,t,n){var r,i,o,a,s=e.x-t.x,u=e.y-t.y,l=s*s+u*u;l?(i=t.r+n.r,i*=i,a=e.r+n.r,i>(a*=a)?(r=(l+a-i)/(2*l),o=Math.sqrt(Math.max(0,a/l-r*r)),n.x=e.x-r*s-o*u,n.y=e.y-r*u+o*s):(r=(l+i-a)/(2*l),o=Math.sqrt(Math.max(0,i/l-r*r)),n.x=t.x+r*s-o*u,n.y=t.y+r*u+o*s)):(n.x=t.x+n.r,n.y=t.y)}function fD(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function dD(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,o=(t.y*n.r+n.y*t.r)/r;return i*i+o*o}function hD(e){this._=e,this.next=null,this.previous=null}function pD(e,t){if(!(o=(e=function(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}(e)).length))return 0;var n,r,i,o,a,s,u,l,c,f,d;if((n=e[0]).x=0,n.y=0,!(o>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;cD(r,n,i=e[2]),n=new hD(n),r=new hD(r),i=new hD(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(u=3;ufunction(e){let t=(e=`${e}`).length;return SD(e,t-1)&&!SD(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r)))),n=t.map(DD),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(DD(e)),d.push(kD));h=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,i=d.length;a=0&&(l=d[e]).data===kD;--e)l.data=null}if(s.parent=_D,s.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(ZO),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=KO(e),r):t},r.parentId=function(e){return arguments.length?(n=KO(e),r):n},r.path=function(t){return arguments.length?(e=KO(t),r):e},r}function DD(e){let t=e.length;if(t<2)return"";for(;--t>1&&!SD(e,t););return e.slice(0,t)}function SD(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0==(1&n))return!0}return!1}function CD(e,t){return e.parent===t.parent?1:2}function FD(e){var t=e.children;return t?t[0]:e.t}function jD(e){var t=e.children;return t?t[t.length-1]:e.t}function MD(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function $D(e,t,n){return e.a.parent===t.parent?e.a:n}function ND(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}function BD(e,t){return e.parent===t.parent?1:2}function TD(e,t){return e+t.x}function zD(e,t){return Math.max(e,t.y)}function RD(e,t,n,r,i){for(var o,a=e.children,s=-1,u=a.length,l=e.value&&(i-n)/e.value;++sd&&(d=s),m=c*c*g,(h=Math.max(d/m,m/f))>p){c-=s;break}p=h}y.push(a={value:c,dice:u1?t:1)},n}(PD),UD=function e(t){function n(e,n,r,i,o){if((a=e._squarify)&&a.ratio===t)for(var a,s,u,l,c,f=-1,d=a.length,h=e.value;++f1?t:1)},n}(PD);function qD(e,t,n){const r={};return e.each((e=>{const i=e.data;n(i)&&(r[t(i)]=e)})),e.lookup=r,e}function WD(e){gs.call(this,null,e)}WD.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const HD=e=>e.values;function GD(){const e=[],t={entries:e=>r(n(e,0),0),key:n=>(e.push(n),t)};function n(t,r){if(r>=e.length)return t;const i=t.length,o=e[r++],a={},s={};let u,l,c,f=-1;for(;++fe.length)return t;const i=[];for(const e in t)i.push({key:e,values:r(t[e],n)});return i}return t}function VD(e){gs.call(this,null,e)}ft(WD,gs,{transform(e,t){t.source||oe("Nest transform requires an upstream data source.");var n=e.generate,r=e.modified(),i=t.clone(),o=this.value;return(!o||r||t.changed())&&(o&&o.each((e=>{e.children&&Ta(e.data)&&i.rem.push(e.data)})),this.value=o=GO({values:Ge(e.keys).reduce(((e,t)=>(e.key(t),e)),GD()).entries(i.source)},HD),n&&o.each((e=>{e.children&&(e=Pa(e.data),i.add.push(e),i.source.push(e))})),qD(o,za,za)),i.source.root=o,i}});const YD=(e,t)=>e.parent===t.parent?1:2;ft(VD,gs,{transform(e,t){t.source&&t.source.root||oe(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),r=this.fields,i=t.source.root,o=e.as||r;e.field?i.sum(e.field):i.count(),e.sort&&i.sort(qa(e.sort,(e=>e.data))),function(e,t,n){for(let r,i=0,o=t.length;ifunction(e,t,n){const r=e.data,i=t.length-1;for(let o=0;o(e=(1664525*e+1013904223)%nD)/nD}();return i.x=t/2,i.y=n/2,e?i.eachBefore(mD(e)).eachAfter(yD(r,.5,o)).eachBefore(vD(1)):i.eachBefore(mD(gD)).eachAfter(yD(eD,1,o)).eachAfter(yD(r,i.r/Math.min(t,n),o)).eachBefore(vD(Math.min(t,n)/(2*i.r))),i}return i.radius=function(t){return arguments.length?(e=KO(t),i):e},i.size=function(e){return arguments.length?(t=+e[0],n=+e[1],i):[t,n]},i.padding=function(e){return arguments.length?(r="function"==typeof e?e:tD(+e),i):r},i},params:["radius","size","padding"],fields:XD});const JD=["x0","y0","x1","y1","depth","children"];function KD(e){VD.call(this,e)}function QD(e){gs.call(this,null,e)}KD.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:JD.length,default:JD}]},ft(KD,VD,{layout:function(){var e=1,t=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=e,i.y1=t/o,i.eachBefore(function(e,t){return function(r){r.children&&xD(r,r.x0,e*(r.depth+1)/t,r.x1,e*(r.depth+2)/t);var i=r.x0,o=r.y0,a=r.x1-n,s=r.y1-n;a=0;--i)s.push(n=t.children[i]=new ND(r[i],i)),n.parent=t;return(a.parent=new ND(null,0)).children=[a],a}(i);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(a),r)i.eachBefore(s);else{var l=i,c=i,f=i;i.eachBefore((function(e){e.xc.x&&(c=e),e.depth>f.depth&&(f=e)}));var d=l===c?1:e(l,c)/2,h=d-l.x,p=t/(c.x+d+h),g=n/(f.depth||1);i.eachBefore((function(e){e.x=(e.x+h)*p,e.y=e.depth*g}))}return i}function o(t){var n=t.children,r=t.parent.children,i=t.i?r[t.i-1]:null;if(n){!function(e){for(var t,n=0,r=0,i=e.children,o=i.length;--o>=0;)(t=i[o]).z+=n,t.m+=n,n+=t.s+(r+=t.c)}(t);var o=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-o):t.z=o}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function(t,n,r){if(n){for(var i,o=t,a=t,s=n,u=o.parent.children[0],l=o.m,c=a.m,f=s.m,d=u.m;s=jD(s),o=FD(o),s&&o;)u=FD(u),(a=jD(a)).a=t,(i=s.z+f-o.z-l+e(s._,o._))>0&&(MD($D(s,t,r),t,i),l+=i,c+=i),f+=s.m,l+=o.m,d+=u.m,c+=a.m;s&&!jD(a)&&(a.t=s,a.m+=f-c),o&&!FD(u)&&(u.t=o,u.m+=l-d,r=t)}return r}(t,i,t.parent.A||r[0])}function a(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*n}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i},cluster:function(){var e=BD,t=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(t){var n=t.children;n?(t.x=function(e){return e.reduce(TD,0)/e.length}(n),t.y=function(e){return 1+e.reduce(zD,0)}(n)):(t.x=o?a+=e(t,o):0,t.y=0,o=t)}));var s=function(e){for(var t;t=e.children;)e=t[0];return e}(i),u=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(i),l=s.x-e(s,u)/2,c=u.x+e(u,s)/2;return i.eachAfter(r?function(e){e.x=(e.x-i.x)*t,e.y=(i.y-e.y)*n}:function(e){e.x=(e.x-l)/(c-l)*t,e.y=(1-(i.y?e.y/i.y:1))*n})}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i}},tS=["x","y","depth","children"];function nS(e){VD.call(this,e)}function rS(e){gs.call(this,[],e)}nS.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:tS.length,default:tS}]},ft(nS,VD,{layout(e){const t=e||"tidy";if(st(eS,t))return eS[t]();oe("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:tS}),rS.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},ft(rS,gs,{transform(e,t){const n=this.value,r=t.source&&t.source.root,i=t.fork(t.NO_SOURCE),o={};return r||oe("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(i.rem=n,t.visit(t.SOURCE,(e=>o[za(e)]=1)),r.each((e=>{const t=e.data,n=e.parent&&e.parent.data;n&&o[za(t)]&&o[za(n)]&&i.add.push(Pa({source:n,target:t}))})),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,(e=>o[za(e)]=1)),n.forEach((e=>{(o[za(e.source)]||o[za(e.target)])&&i.mod.push(e)}))),i}});const iS={binary:function(e,t,n,r,i){var o,a,s=e.children,u=s.length,l=new Array(u+1);for(l[0]=a=o=0;o=n-1){var c=s[t];return c.x0=i,c.y0=o,c.x1=a,void(c.y1=u)}for(var f=l[t],d=r/2+f,h=t+1,p=n-1;h>>1;l[g]u-o){var v=r?(i*y+a*m)/r:a;e(t,h,m,i,o,v,u),e(h,n,y,v,o,a,u)}else{var b=r?(o*y+u*m)/r:u;e(t,h,m,i,o,a,b),e(h,n,y,i,b,a,u)}}(0,u,e.value,t,n,r,i)},dice:xD,slice:RD,slicedice:function(e,t,n,r,i){(1&e.depth?RD:xD)(e,t,n,r,i)},squarify:ID,resquarify:UD},oS=["x0","y0","x1","y1","depth","children"];function aS(e){VD.call(this,e)}aS.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:oS.length,default:oS}]},ft(aS,VD,{layout(){const e=function(){var e=ID,t=!1,n=1,r=1,i=[0],o=eD,a=eD,s=eD,u=eD,l=eD;function c(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(f),i=[0],t&&e.eachBefore(bD),e}function f(t){var n=i[t.depth],r=t.x0+n,c=t.y0+n,f=t.x1-n,d=t.y1-n;f{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{st(iS,t)?e.tile(iS[t]):oe("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:oS});const sS=4278190080;function uS(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function lS(e,t,n){if(!t.length)return;const r=t[0].mark.marktype;"group"===r?t.forEach((t=>{t.items.forEach((t=>lS(e,t.items,n)))})):Fv[r].draw(e,{items:n?t.map(cS):t})}function cS(e){const t=Ia(e,{});return t.stroke&&0!==t.strokeOpacity||t.fill&&0!==t.fillOpacity?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const fS=5,dS=31,hS=32,pS=new Uint32Array(hS+1),gS=new Uint32Array(hS+1);gS[0]=0,pS[0]=~gS[0];for(let e=1;e<=hS;++e)gS[e]=gS[e-1]<<1|1,pS[e]=~gS[e];function mS(e,t,n,r,i,o){let a=n/2;return e-a<0||e+a>i||t-(a=r/2)<0||t+a>o}function yS(e,t,n,r,i,o,a,s){const u=i*o/(2*r),l=e(t-u),c=e(t+u),f=e(n-(o/=2)),d=e(n+o);return a.outOfBounds(l,f,c,d)||a.getRange(l,f,c,d)||s&&s.getRange(l,f,c,d)}const vS=[-1,-1,1,1],bS=[-1,1,-1,1],xS=["right","center","left"],_S=["bottom","middle","top"];function wS(e,t,n,r,i,o,a,s,u,l,c,f){return!(i.outOfBounds(e,n,t,r)||(f&&o||i).getRange(e,n,t,r))}const kS={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},AS={naive:function(e,t,n,r){const i=e.width,o=e.height;return function(e){const t=e.datum.datum.items[r].items,n=t.length,a=e.datum.fontSize,s=cv.width(e.datum,e.datum.text);let u,l,c,f,d,h,p,g=0;for(let r=0;r=g&&(g=p,e.x=d,e.y=h);return d=s/2,h=a/2,u=e.x-d,l=e.x+d,c=e.y-h,f=e.y+h,e.align="center",u<0&&l<=i?e.align="left":0<=u&&i=1;)d=(h+p)/2,yS(e,c,f,l,u,d,a,s)?p=d:h=d;if(h>r)return[c,f,h,!0]}}return function(t){const s=t.datum.datum.items[r].items,l=s.length,c=t.datum.fontSize,f=cv.width(t.datum,t.datum.text);let d,h,p,g,m,y,v,b,x,_,w,k,A,E,O,D,S,C=n?c:0,F=!1,j=!1,M=0;for(let r=0;rh&&(S=d,d=h,h=S),p>g&&(S=p,p=g,g=S),x=e(d),w=e(h),_=~~((x+w)/2),k=e(p),E=e(g),A=~~((k+E)/2),v=_;v>=x;--v)for(b=A;b>=k;--b)D=u(v,b,C,f,c),D&&([t.x,t.y,C,F]=D);for(v=_;v<=w;++v)for(b=A;b<=E;++b)D=u(v,b,C,f,c),D&&([t.x,t.y,C,F]=D);F||n||(O=Math.abs(h-d+g-p),m=(d+h)/2,y=(p+g)/2,O>=M&&!mS(m,y,f,c,i,o)&&!yS(e,m,y,c,f,c,a,null)&&(M=O,t.x=m,t.y=y,j=!0))}return!(!F&&!j||(m=f/2,y=c/2,a.setRange(e(t.x-m),e(t.y-y),e(t.x+m),e(t.y+y)),t.align="center",t.baseline="middle",0))}},floodfill:function(e,t,n,r){const i=e.width,o=e.height,a=t[0],s=t[1],u=e.bitmap();return function(t){const l=t.datum.datum.items[r].items,c=l.length,f=t.datum.fontSize,d=cv.width(t.datum,t.datum.text),h=[];let p,g,m,y,v,b,x,_,w,k,A,E,O=n?f:0,D=!1,S=!1,C=0;for(let r=0;r=1;)A=(w+k)/2,yS(e,v,b,f,d,A,a,s)?k=A:w=A;w>O&&(t.x=v,t.y=b,O=w,D=!0)}}D||n||(E=Math.abs(g-p+y-m),v=(p+g)/2,b=(m+y)/2,E>=C&&!mS(v,b,d,f,i,o)&&!yS(e,v,b,f,d,f,a,null)&&(C=E,t.x=v,t.y=b,S=!0))}return!(!D&&!S||(v=d/2,b=f/2,a.setRange(e(t.x-v),e(t.y-b),e(t.x+v),e(t.y+b)),t.align="center",t.baseline="middle",0))}}};function ES(e,t,n,r,i,o,a,s,u,l,c){if(!e.length)return e;const f=Math.max(r.length,i.length),d=function(e,t){const n=new Float64Array(t),r=e.length;for(let t=0;t[e.x,e.x,e.x,e.y,e.y,e.y];return e?"line"===e||"area"===e?e=>i(e.datum):"line"===t?e=>{const t=e.datum.items[r].items;return i(t.length?t["start"===n?0:t.length-1]:{x:NaN,y:NaN})}:e=>{const t=e.datum.bounds;return[t.x1,(t.x1+t.x2)/2,t.x2,t.y1,(t.y1+t.y2)/2,t.y2]}:i}(p,g,s,u),v=null===l||l===1/0,b=m&&"naive"===c;var x;let _=-1,w=-1;const k=e.map((e=>{const t=v?cv.width(e,e.text):void 0;return _=Math.max(_,t),w=Math.max(w,e.fontSize),{datum:e,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(e),textWidth:t}}));l=null===l||l===1/0?Math.max(_,w)+Math.max(...r):l;const A=function(e,t,n){const r=Math.max(1,Math.sqrt(e*t/1e6)),i=~~((e+2*n+r)/r),o=~~((t+2*n+r)/r),a=e=>~~((e+n)/r);return a.invert=e=>e*r-n,a.bitmap=()=>function(e,t){const n=new Uint32Array(~~((e*t+hS)/hS));function r(e,t){n[e]|=t}function i(e,t){n[e]&=t}return{array:n,get:(t,r)=>{const i=r*e+t;return n[i>>>fS]&1<<(i&dS)},set:(t,n)=>{const i=n*e+t;r(i>>>fS,1<<(i&dS))},clear:(t,n)=>{const r=n*e+t;i(r>>>fS,~(1<<(r&dS)))},getRange:(t,r,i,o)=>{let a,s,u,l,c=o;for(;c>=r;--c)if(a=c*e+t,s=c*e+i,u=a>>>fS,l=s>>>fS,u===l){if(n[u]&pS[a&dS]&gS[1+(s&dS)])return!0}else{if(n[u]&pS[a&dS])return!0;if(n[l]&gS[1+(s&dS)])return!0;for(let e=u+1;e{let a,s,u,l,c;for(;n<=o;++n)if(a=n*e+t,s=n*e+i,u=a>>>fS,l=s>>>fS,u===l)r(u,pS[a&dS]&gS[1+(s&dS)]);else for(r(u,pS[a&dS]),r(l,gS[1+(s&dS)]),c=u+1;c{let a,s,u,l,c;for(;n<=o;++n)if(a=n*e+t,s=n*e+r,u=a>>>fS,l=s>>>fS,u===l)i(u,gS[a&dS]|pS[1+(s&dS)]);else for(i(u,gS[a&dS]),i(l,pS[1+(s&dS)]),c=u+1;cn<0||r<0||o>=t||i>=e}}(i,o),a.ratio=r,a.padding=n,a.width=e,a.height=t,a}(t[0],t[1],l);let E;if(!b){n&&k.sort(((e,t)=>n(e.datum,t.datum)));let t=!1;for(let e=0;ee.datum));E=o.length||r?function(e,t,n,r,i){const o=e.width,a=e.height,s=r||i,u=ff(o,a).getContext("2d"),l=ff(o,a).getContext("2d"),c=s&&ff(o,a).getContext("2d");n.forEach((e=>lS(u,e,!1))),lS(l,t,!1),s&&lS(c,t,!0);const f=uS(u,o,a),d=uS(l,o,a),h=s&&uS(c,o,a),p=e.bitmap(),g=s&&e.bitmap();let m,y,v,b,x,_,w,k;for(y=0;yn.set(e(t.boundary[0]),e(t.boundary[3])))),[n,void 0]}(A,a&&k)}const O=m?AS[c](A,E,a,u):function(e,t,n,r){const i=e.width,o=e.height,a=t[0],s=t[1],u=r.length;return function(t){const l=t.boundary,c=t.datum.fontSize;if(l[2]<0||l[5]<0||l[0]>i||l[3]>o)return!1;let f,d,h,p,g,m,y,v,b,x,_,w,k,A,E,O=t.textWidth??0;for(let i=0;i>>2&3)-1,h=0===f&&0===d||r[i]<0,p=f&&d?Math.SQRT1_2:1,g=r[i]<0?-1:1,m=l[1+f]+r[i]*f*p,_=l[4+d]+g*c*d/2+r[i]*d*p,v=_-c/2,b=_+c/2,w=e(m),A=e(v),E=e(b),!O){if(!wS(w,w,A,E,a,s,0,0,0,0,0,h))continue;O=cv.width(t.datum,t.datum.text)}if(x=m+g*O*f/2,m=x-O/2,y=x+O/2,w=e(m),k=e(y),wS(w,k,A,E,a,s,0,0,0,0,0,h))return t.x=f?f*g<0?y:m:x,t.y=d?d*g<0?b:v:_,t.align=xS[f*g+1],t.baseline=_S[d*g+1],a.setRange(w,A,k,E),!0}return!1}}(A,E,h,d);return k.forEach((e=>e.opacity=+O(e))),k}const OS=["x","y","opacity","align","baseline"],DS=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function SS(e){gs.call(this,null,e)}function CS(e,t){var n,r,i,o,a,s,u=[],l=function(e){return e(o)};if(null==t)u.push(e);else for(n={},r=0,i=e.length;r{const t=e.datum;t[r[0]]=e.x,t[r[1]]=e.y,t[r[2]]=e.opacity,t[r[3]]=e.align,t[r[4]]=e.baseline})),t.reflow(n).modifies(r)}}),FS.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},ft(FS,gs,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=CS(t.materialize(t.SOURCE).source,e.groupby),i=(e.groupby||[]).map(ee),o=i.length,a=e.as||[ee(e.x),ee(e.y)],s=[];r.forEach((t=>{vu(t,e.x,e.y,e.bandwidth||.3).forEach((e=>{const n={};for(let e=0;e"poly"===e?t:"quad"===e?2:1)(o,a),u=e.as||[ee(e.x),ee(e.y)],l=jS[o],c=[];let f=e.extent;st(jS,o)||oe("Invalid regression method: "+o),null!=f&&"log"===o&&f[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),f=null),r.forEach((n=>{if(n.length<=s)return void t.dataflow.warn("Skipping regression with more parameters than data points.");const r=l(n,e.x,e.y,a);if(e.params)return void c.push(Pa({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));const d=f||it(n,e.x),h=e=>{const t={};for(let e=0;eh([e,r.predict(e)]))):wu(r.predict,d,25,200).forEach(h)})),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});const $S=134217729;function NS(e,t,n,r,i){let o,a,s,u,l=t[0],c=r[0],f=0,d=0;c>l==c>-l?(o=l,l=t[++f]):(o=c,c=r[++d]);let h=0;if(fl==c>-l?(a=l+o,s=o-(a-l),l=t[++f]):(a=c+o,s=o-(a-c),c=r[++d]),o=a,0!==s&&(i[h++]=s);fl==c>-l?(a=o+l,u=a-o,s=o-(a-u)+(l-u),l=t[++f]):(a=o+c,u=a-o,s=o-(a-u)+(c-u),c=r[++d]),o=a,0!==s&&(i[h++]=s);for(;f0!=s>0)return u;const l=Math.abs(a+s);return Math.abs(u)>=33306690738754716e-32*l?u:-function(e,t,n,r,i,o,a){let s,u,l,c,f,d,h,p,g,m,y,v,b,x,_,w,k,A;const E=e-i,O=n-i,D=t-o,S=r-o;x=E*S,d=$S*E,h=d-(d-E),p=E-h,d=$S*S,g=d-(d-S),m=S-g,_=p*m-(x-h*g-p*g-h*m),w=D*O,d=$S*D,h=d-(d-D),p=D-h,d=$S*O,g=d-(d-O),m=O-g,k=p*m-(w-h*g-p*g-h*m),y=_-k,f=_-y,TS[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,TS[1]=b-(y+f)+(f-w),A=v+y,f=A-v,TS[2]=v-(A-f)+(y-f),TS[3]=A;let C=function(e,t){let n=t[0];for(let e=1;e<4;e++)n+=t[e];return n}(0,TS),F=22204460492503146e-32*a;if(C>=F||-C>=F)return C;if(f=e-E,s=e-(E+f)+(f-i),f=n-O,l=n-(O+f)+(f-i),f=t-D,u=t-(D+f)+(f-o),f=r-S,c=r-(S+f)+(f-o),0===s&&0===u&&0===l&&0===c)return C;if(F=11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),BS(8),BS(8),BS(12),BS(192),BS(192),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(8),BS(8),BS(8),BS(8),BS(8),BS(8),BS(8),BS(8),BS(8),BS(4),BS(4),BS(4),BS(8),BS(16),BS(16),BS(16),BS(32),BS(32),BS(48),BS(64),BS(1152),BS(1152),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(4),BS(24),BS(24),BS(24),BS(24),BS(24),BS(24),BS(24),BS(24),BS(24),BS(24),BS(1152),BS(1152),BS(1152),BS(1152),BS(1152),BS(2304),BS(2304),BS(3456),BS(5760),BS(8),BS(8),BS(8),BS(16),BS(24),BS(48),BS(48),BS(96),BS(192),BS(384),BS(384),BS(384),BS(768),BS(96),BS(96),BS(96),BS(1152);const US=Math.pow(2,-52),qS=new Uint32Array(512);class WS{static from(e,t=ZS,n=JS){const r=e.length,i=new Float64Array(2*r);for(let o=0;o>1;if(t>0&&"number"!=typeof e[0])throw new Error("Expected coords to contain numbers.");this.coords=e;const n=Math.max(2*t-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=e.length>>1;let a=1/0,s=1/0,u=-1/0,l=-1/0;for(let t=0;tu&&(u=n),r>l&&(l=r),this._ids[t]=t}const c=(a+u)/2,f=(s+l)/2;let d,h,p,g=1/0;for(let t=0;t0&&(h=t,g=n)}let v=e[2*h],b=e[2*h+1],x=1/0;for(let t=0;tr&&(t[n++]=i,r=this._dists[i])}return this.hull=t.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(IS(m,y,v,b,_,w)<0){const e=h,t=v,n=b;h=p,v=_,b=w,p=e,_=t,w=n}const k=function(e,t,n,r,i,o){const a=n-e,s=r-t,u=i-e,l=o-t,c=a*a+s*s,f=u*u+l*l,d=.5/(a*l-s*u);return{x:e+(l*c-s*f)*d,y:t+(a*f-u*c)*d}}(m,y,v,b,_,w);this._cx=k.x,this._cy=k.y;for(let t=0;t0&&Math.abs(l-o)<=US&&Math.abs(c-a)<=US)continue;if(o=l,a=c,u===d||u===h||u===p)continue;let f=0;for(let e=0,t=this._hashKey(l,c);e=0;)if(m=g,m===f){m=-1;break}if(-1===m)continue;let y=this._addTriangle(m,u,n[m],-1,-1,r[m]);r[u]=this._legalize(y+2),r[m]=y,A++;let v=n[m];for(;g=n[v],IS(l,c,e[2*v],e[2*v+1],e[2*g],e[2*g+1])<0;)y=this._addTriangle(v,u,g,r[u],-1,r[v]),r[u]=this._legalize(y+2),n[v]=v,A--,v=g;if(m===f)for(;g=t[m],IS(l,c,e[2*g],e[2*g+1],e[2*m],e[2*m+1])<0;)y=this._addTriangle(g,u,m,-1,r[m],r[g]),this._legalize(y+2),r[g]=y,n[m]=m,A--,m=g;this._hullStart=t[u]=m,n[m]=t[v]=u,n[u]=v,i[this._hashKey(l,c)]=u,i[this._hashKey(e[2*m],e[2*m+1])]=m}this.hull=new Uint32Array(A);for(let e=0,t=this._hullStart;e0?3-n:1+n)/4}(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:t,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[e],s=e-e%3;if(o=s+(e+2)%3,-1===a){if(0===i)break;e=qS[--i];continue}const u=a-a%3,l=s+(e+1)%3,c=u+(a+2)%3,f=t[o],d=t[e],h=t[l],p=t[c];if(GS(r[2*f],r[2*f+1],r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1])){t[e]=p,t[a]=f;const r=n[c];if(-1===r){let t=this._hullStart;do{if(this._hullTri[t]===c){this._hullTri[t]=e;break}t=this._hullPrev[t]}while(t!==this._hullStart)}this._link(e,r),this._link(a,n[o]),this._link(o,c);const s=u+(a+1)%3;i=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=r}else{let i=n+1,o=r;XS(e,n+r>>1,i),t[e[n]]>t[e[r]]&&XS(e,n,r),t[e[i]]>t[e[r]]&&XS(e,i,r),t[e[n]]>t[e[i]]&&XS(e,n,i);const a=e[i],s=t[a];for(;;){do{i++}while(t[e[i]]s);if(o=o-n?(YS(e,t,i,r),YS(e,t,n,o-1)):(YS(e,t,n,o-1),YS(e,t,i,r))}}function XS(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function ZS(e){return e[0]}function JS(e){return e[1]}const KS=1e-6;class QS{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,t){this._+=`L${this._x1=+e},${this._y1=+t}`}arc(e,t,n){const r=(e=+e)+(n=+n),i=t=+t;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>KS||Math.abs(this._y1-i)>KS)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${e-n},${t}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(e,t,n,r){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class eC{constructor(){this._=[]}moveTo(e,t){this._.push([e,t])}closePath(){this._.push(this._[0].slice())}lineTo(e,t){this._.push([e,t])}value(){return this._.length?this._:null}}class tC{constructor(e,[t,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(t=+t)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=r,this.xmin=t,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:t,triangles:n},vectors:r}=this;let i,o;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let r,s,u=0,l=0,c=n.length;u1;)i-=2;for(let e=2;e0){if(t>=this.ymax)return null;(i=(this.ymax-t)/r)0){if(e>=this.xmax)return null;(i=(this.xmax-e)/n)this.xmax?2:0)|(tthis.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let t=0;t2&&function(e){const{triangles:t,coords:n}=e;for(let e=0;e1e-10)return!1}return!0}(e)){this.collinear=Int32Array.from({length:t.length/2},((e,t)=>t)).sort(((e,n)=>t[2*e]-t[2*n]||t[2*e+1]-t[2*n+1]));const e=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[t[2*e],t[2*e+1],t[2*n],t[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let e=0,n=t.length/2;e0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,2===r.length&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(e){return new tC(this,e)}*neighbors(e){const{inedges:t,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const t=a.indexOf(e);return t>0&&(yield a[t-1]),void(t=0&&i!==n&&i!==r;)n=i;return i}_step(e,t,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:u}=this;if(-1===r[e]||!u.length)return(e+1)%(u.length>>1);let l=e,c=rC(t-u[2*e],2)+rC(n-u[2*e+1],2);const f=r[e];let d=f;do{let r=s[d];const f=rC(t-u[2*r],2)+rC(n-u[2*r+1],2);if(f>5<<5,u=~~Math.max(Math.abs(v+b),Math.abs(v-b))}else a=a+31>>5<<5;if(u>h&&(h=u),f+a>=dC<<5&&(f=0,d+=h,h=0),d+u>=hC)break;i.translate((f+(a>>1))/o,(d+(u>>1))/o),t.rotate&&i.rotate(t.rotate*fC),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=a,t.height=u,t.xoff=f,t.yoff=d,t.x1=a>>1,t.y1=u>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,f+=a}for(var _=i.getImageData(0,0,(dC<<5)/o,hC/o).data,w=[];--r>=0;)if((t=n[r]).hasText){for(s=(a=t.width)>>5,u=t.y1-t.y0,l=0;l>5),O=_[(d+c)*(dC<<5)+(f+l)<<2]?1<<31-l%32:0;w[E]|=O,k|=O}k?A=c:(t.y0++,u--,c--,d++)}t.y1=t.y0+A,t.sprite=w.slice(0,(t.y1-t.y0)*s)}}}function gC(e,t,n){n>>=5;for(var r,i=e.sprite,o=e.width>>5,a=e.x-(o<<4),s=127&a,u=32-s,l=e.y1-e.y0,c=(e.y+e.y0)*n+(a>>5),f=0;f>>s:0))&t[c+d])return!0;c+=n}return!1}function mC(e,t){var n=e[0],r=e[1];t.x+t.x0r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function yC(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0=f));)if(t.x=a+i,t.y=l+o,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>s[0]||t.y+t.y1>s[1])&&(!n||!gC(t,e,s[0]))&&(!n||yC(t,n))){for(var g,m=t.sprite,y=t.width>>5,v=s[0]>>5,b=t.x-(y<<4),x=127&b,_=32-x,w=t.y1-t.y0,k=(t.y+t.y0)*v+(b>>5),A=0;A>>x:0);k+=v}return t.sprite=null,!0}return!1}return f.layout=function(){for(var u=function(e){e.width=e.height=1;var t=Math.sqrt(e.getContext("2d").getImageData(0,0,1,1).data.length>>2);e.width=(dC<<5)/t,e.height=hC/t;var n=e.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:t}}(ff()),f=function(e){for(var t=[],n=-1;++n>5)*s[1]),h=null,p=l.length,g=-1,m=[],y=l.map((s=>({text:e(s),font:t(s),style:r(s),weight:i(s),rotate:o(s),size:~~(n(s)+1e-14),padding:a(s),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:s}))).sort(((e,t)=>t.size-e.size));++g>1,v.y=s[1]*(c()+.5)>>1,pC(u,v,y,g),v.hasText&&d(f,v,h)&&(m.push(v),h?mC(h,v):h=[{x:v.x+v.x0,y:v.y+v.y0},{x:v.x+v.x1,y:v.y+v.y1}],v.x-=s[0]>>1,v.y-=s[1]>>1)}return m},f.words=function(e){return arguments.length?(l=e,f):l},f.size=function(e){return arguments.length?(s=[+e[0],+e[1]],f):s},f.font=function(e){return arguments.length?(t=bC(e),f):t},f.fontStyle=function(e){return arguments.length?(r=bC(e),f):r},f.fontWeight=function(e){return arguments.length?(i=bC(e),f):i},f.rotate=function(e){return arguments.length?(o=bC(e),f):o},f.text=function(t){return arguments.length?(e=bC(t),f):e},f.spiral=function(e){return arguments.length?(u=xC[e]||e,f):u},f.fontSize=function(e){return arguments.length?(n=bC(e),f):n},f.padding=function(e){return arguments.length?(a=bC(e),f):a},f.random=function(e){return arguments.length?(c=e,f):c},f}(),e)}kC.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:_C}]},ft(kC,gs,{transform(e,t){!e.size||e.size[0]&&e.size[1]||oe("Wordcloud size dimensions must be non-zero.");const n=e.modified();if(!(n||t.changed(t.ADD_REM)||wC.some((function(n){const r=e[n];return Ye(r)&&t.modified(r.fields)}))))return;const r=t.materialize(t.SOURCE).source,i=this.value,o=e.as||_C;let a,s=e.fontSize||14;if(Ye(s)?a=e.fontSizeRange:s=tt(s),a){const e=s,t=Gp("sqrt")().domain(it(r,e)).range(a);s=n=>t(e(n))}r.forEach((e=>{e[o[0]]=NaN,e[o[1]]=NaN,e[o[3]]=0}));const u=i.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(s).random($s).layout(),l=i.size(),c=l[0]>>1,f=l[1]>>1,d=u.length;for(let e,t,n=0;nnew Uint8Array(e),EC=e=>new Uint16Array(e),OC=e=>new Uint32Array(e);function DC(e,t,n){const r=(t<257?AC:t<65537?EC:OC)(e);return n&&r.set(n),r}function SC(e,t,n){const r=1<{const r=e[t],i=e[n];return ri?1:0})),function(e,t){return Array.from(t,(t=>e[t]))}(e,t)}(d,u),a)l=t,c=e,t=Array(a+s),e=OC(a+s),function(e,t,n,r,i,o,a,s,u){let l,c=0,f=0;for(l=0;c0)for(f=0;fe,size:()=>n}}function FC(e){gs.call(this,function(){let e=8,t=[],n=OC(0),r=DC(0,e),i=DC(0,e);return{data:()=>t,seen:()=>n=function(e,t,n){return e.length>=t?e:((n=n||new e.constructor(t)).set(e),n)}(n,t.length),add(e){for(let n,r=0,i=t.length,o=e.length;rt.length,curr:()=>r,prev:()=>i,reset:e=>i[e]=r[e],all:()=>e<257?255:e<65537?65535:4294967295,set(e,t){r[e]|=t},clear(e,t){r[e]&=~t},resize(t,n){(t>r.length||n>e)&&(e=Math.max(n,e),r=DC(t,e,r),i=DC(t,e))}}}(),e),this._indices=null,this._dims=null}function jC(e){gs.call(this,null,e)}FC.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]},ft(FC,gs,{transform(e,t){return this._dims?e.modified("fields")||e.fields.some((e=>t.modified(e.fields)))?this.reinit(e,t):this.eval(e,t):this.init(e,t)},init(e,t){const n=e.fields,r=e.query,i=this._indices={},o=this._dims=[],a=r.length;let s,u,l=0;for(;l{const e=i.remove(t,n);for(const t in r)r[t].reindex(e)}))},update(e,t,n){const r=this._dims,i=e.query,o=t.stamp,a=r.length;let s,u,l=0;for(n.filters=0,u=0;uh)for(m=h,y=Math.min(f,p);mp)for(m=Math.max(f,p),y=d;mc)for(h=c,p=Math.min(u,f);hf)for(h=Math.max(u,f),p=l;hs[e]&n?null:a[e];return o.filter(o.MOD,l),i&i-1?(o.filter(o.ADD,(e=>{const t=s[e]&n;return!t&&t^u[e]&n?a[e]:null})),o.filter(o.REM,(e=>{const t=s[e]&n;return!t||t^t^u[e]&n?null:a[e]}))):(o.filter(o.ADD,l),o.filter(o.REM,(e=>(s[e]&n)===i?a[e]:null))),o.filter(o.SOURCE,(e=>l(e._index)))}});const MC="Literal",$C="CallExpression";function NC(e){this.type=e}var BC,TC,zC,RC,PC;NC.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=function(e){switch(e.type){case"ArrayExpression":return e.elements;case"BinaryExpression":case"LogicalExpression":return[e.left,e.right];case $C:return[e.callee].concat(e.arguments);case"ConditionalExpression":return[e.test,e.consequent,e.alternate];case"MemberExpression":return[e.object,e.property];case"ObjectExpression":return e.properties;case"Property":return[e.key,e.value];case"UnaryExpression":return[e.argument];default:return[]}}(this),n=0,r=t.length;n",BC[UC]="Identifier",BC[qC]="Keyword",BC[WC]="Null",BC[HC]="Numeric",BC[GC]="Punctuator",BC[VC]="String",BC[9]="RegularExpression";var YC="ArrayExpression",XC="BinaryExpression",ZC="CallExpression",JC="ConditionalExpression",KC="Identifier",QC="Literal",eF="LogicalExpression",tF="MemberExpression",nF="ObjectExpression",rF="Property",iF="UnaryExpression",oF="Unexpected token %0",aF="Unexpected number",sF="Unexpected string",uF="Unexpected identifier",lF="Unexpected reserved word",cF="Unexpected end of input",fF="Invalid regular expression",dF="Invalid regular expression: missing /",hF="Octal literals are not allowed in strict mode.",pF="Duplicate data property in object literal not allowed in strict mode",gF="ILLEGAL",mF="Disabled.",yF=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),vF=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-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\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function bF(e,t){if(!e)throw new Error("ASSERT: "+t)}function xF(e){return e>=48&&e<=57}function _F(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function wF(e){return"01234567".indexOf(e)>=0}function kF(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function AF(e){return 10===e||13===e||8232===e||8233===e}function EF(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&yF.test(String.fromCharCode(e))}function OF(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&vF.test(String.fromCharCode(e))}const DF={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function SF(){for(;zC1114111||"}"!==e)&&qF({},oF,gF),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),r=56320+(t-65536&1023),String.fromCharCode(n,r))}function jF(){var e,t;for(e=TC.charCodeAt(zC++),t=String.fromCharCode(e),92===e&&(117!==TC.charCodeAt(zC)&&qF({},oF,gF),++zC,(e=CF("u"))&&"\\"!==e&&EF(e.charCodeAt(0))||qF({},oF,gF),t=e);zC>>="===(r=TC.substr(zC,4))?{type:GC,value:r,start:i,end:zC+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:GC,value:n,start:i,end:zC+=3}:a===(t=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t?{type:GC,value:t,start:i,end:zC+=2}:("//"===t&&qF({},oF,gF),"<>=!+-*%&|^/".indexOf(a)>=0?(++zC,{type:GC,value:a,start:i,end:zC}):void qF({},oF,gF))}function $F(){var e,t,n;if(bF(xF((n=TC[zC]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=zC,e="","."!==n){if(e=TC[zC++],n=TC[zC],"0"===e){if("x"===n||"X"===n)return++zC,function(e){let t="";for(;zC=RC)return{type:IC,start:zC,end:zC};const e=TC.charCodeAt(zC);return EF(e)?function(){var e,t;return e=zC,t=92===TC.charCodeAt(zC)?jF():function(){var e,t;for(e=zC++;zC=0&&zC(bF(t=0&&qF({},fF,n),{value:n,literal:t}}(),r=function(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((e,t)=>{if(parseInt(t,16)<=1114111)return"x";qF({},fF)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){qF({},fF)}try{return new RegExp(e,t)}catch(e){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:zC}}()),TF()):WF(BF())}return n}function KF(){const e=[];if(HF("("),!GF(")"))for(;zC":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function ij(){var e,t;return e=function(){var e,t,n,r,i,o,a,s,u,l;if(e=PC,u=nj(),0===(i=rj(r=PC)))return u;for(r.prec=i,BF(),t=[e,PC],o=[u,r,a=nj()];(i=rj(PC))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),t.pop(),n=zF(s,u,a),o.push(n);(r=BF()).prec=i,o.push(r),t.push(PC),n=nj(),o.push(n)}for(n=o[l=o.length-1],t.pop();l>1;)t.pop(),n=zF(o[l-1].value,o[l-2],n),l-=2;return n}(),GF("?")&&(BF(),t=ij(),HF(":"),e=function(e,t,n){const r=new NC(JC);return r.test=e,r.consequent=t,r.alternate=n,r}(e,t,ij())),e}function oj(){const e=ij();if(GF(","))throw new Error(mF);return e}function aj(e){zC=0,RC=(TC=e).length,PC=null,TF();const t=oj();if(PC.type!==IC)throw new Error("Unexpect token after expression.");return t}var sj={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function uj(e){function t(t,n,r){return i=>function(t,n,r,i){let o=e(n[0]);return r&&(o=r+"("+o+")",0===r.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+t+(i<0?"":0===i?"()":"("+n.slice(1).map(e).join(",")+")")}(t,i,n,r)}const n="new Date",r="String",i="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(t){t.length<3&&oe("Missing arguments to clamp function."),t.length>3&&oe("Too many arguments to clamp function.");const n=t.map(e);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:t("getDate",n,0),day:t("getDay",n,0),year:t("getFullYear",n,0),month:t("getMonth",n,0),hours:t("getHours",n,0),minutes:t("getMinutes",n,0),seconds:t("getSeconds",n,0),milliseconds:t("getMilliseconds",n,0),time:t("getTime",n,0),timezoneoffset:t("getTimezoneOffset",n,0),utcdate:t("getUTCDate",n,0),utcday:t("getUTCDay",n,0),utcyear:t("getUTCFullYear",n,0),utcmonth:t("getUTCMonth",n,0),utchours:t("getUTCHours",n,0),utcminutes:t("getUTCMinutes",n,0),utcseconds:t("getUTCSeconds",n,0),utcmilliseconds:t("getUTCMilliseconds",n,0),length:t("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase",r,0),lower:t("toLowerCase",r,0),substring:t("substring",r),split:t("split",r),trim:t("trim",r,0),regexp:i,test:t("test",i),if:function(t){t.length<3&&oe("Missing arguments to if function."),t.length>3&&oe("Too many arguments to if function.");const n=t.map(e);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function lj(e){const t=(e=e||{}).allowed?Mt(e.allowed):{},n=e.forbidden?Mt(e.forbidden):{},r=e.constants||sj,i=(e.functions||uj)(f),o=e.globalvar,a=e.fieldvar,s=Ye(o)?o:e=>`${o}["${e}"]`;let u={},l={},c=0;function f(e){if(vt(e))return e;const t=d[e.type];return null==t&&oe("Unsupported type: "+e.type),t(e)}const d={Literal:e=>e.raw,Identifier:e=>{const i=e.name;return c>0?i:st(n,i)?oe("Illegal identifier: "+i):st(r,i)?r[i]:st(t,i)?i:(u[i]=1,s(i))},MemberExpression:e=>{const t=!e.computed,n=f(e.object);t&&(c+=1);const r=f(e.property);return n===a&&(l[function(e){const t=e&&e.length-1;return t&&('"'===e[0]&&'"'===e[t]||"'"===e[0]&&"'"===e[t])?e.slice(1,-1):e}(r)]=1),t&&(c-=1),n+(t?"."+r:"["+r+"]")},CallExpression:e=>{"Identifier"!==e.callee.type&&oe("Illegal callee type: "+e.callee.type);const t=e.callee.name,n=e.arguments,r=st(i,t)&&i[t];return r||oe("Unrecognized function: "+t),Ye(r)?r(n):r+"("+n.map(f).join(",")+")"},ArrayExpression:e=>"["+e.elements.map(f).join(",")+"]",BinaryExpression:e=>"("+f(e.left)+" "+e.operator+" "+f(e.right)+")",UnaryExpression:e=>"("+e.operator+f(e.argument)+")",ConditionalExpression:e=>"("+f(e.test)+"?"+f(e.consequent)+":"+f(e.alternate)+")",LogicalExpression:e=>"("+f(e.left)+e.operator+f(e.right)+")",ObjectExpression:e=>"{"+e.properties.map(f).join(",")+"}",Property:e=>{c+=1;const t=f(e.key);return c-=1,t+":"+f(e.value)}};function h(e){const t={code:f(e),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},t}return h.functions=i,h.constants=r,h}var cj,fj,dj,hj,pj,gj,mj,yj,vj,bj,xj,_j,wj,kj,Aj,Ej,Oj=new cw,Dj=new cw,Sj={point:Nw,lineStart:Nw,lineEnd:Nw,polygonStart:function(){Oj=new cw,Sj.lineStart=Cj,Sj.lineEnd=Fj},polygonEnd:function(){var e=+Oj;Dj.add(e<0?mw+e:e),this.lineStart=this.lineEnd=this.point=Nw},sphere:function(){Dj.add(mw)}};function Cj(){Sj.point=jj}function Fj(){Mj(cj,fj)}function jj(e,t){Sj.point=Mj,cj=e,fj=t,dj=e*=vw,hj=ww(t=(t*=vw)/2+gw),pj=Sw(t)}function Mj(e,t){var n=(e*=vw)-dj,r=n>=0?1:-1,i=r*n,o=ww(t=(t*=vw)/2+gw),a=Sw(t),s=pj*a,u=hj*o+s*ww(i),l=s*r*Sw(i);Oj.add(_w(l,u)),dj=e,hj=o,pj=a}var $j,Nj,Bj,Tj,zj,Rj,Pj,Lj,Ij,Uj,qj,Wj,Hj,Gj,Vj,Yj,Xj={point:Zj,lineStart:Kj,lineEnd:Qj,polygonStart:function(){Xj.point=eM,Xj.lineStart=tM,Xj.lineEnd=nM,kj=new cw,Sj.polygonStart()},polygonEnd:function(){Sj.polygonEnd(),Xj.point=Zj,Xj.lineStart=Kj,Xj.lineEnd=Qj,Oj<0?(gj=-(yj=180),mj=-(vj=90)):kj>fw?vj=90:kj<-fw&&(mj=-90),Ej[0]=gj,Ej[1]=yj},sphere:function(){gj=-(yj=180),mj=-(vj=90)}};function Zj(e,t){Aj.push(Ej=[gj=e,yj=e]),tvj&&(vj=t)}function Jj(e,t){var n=Vk([e*vw,t*vw]);if(wj){var r=Xk(wj,n),i=Xk([r[1],-r[0],0],r);Kk(i),i=Gk(i);var o,a=e-bj,s=a>0?1:-1,u=i[0]*yw*s,l=bw(a)>180;l^(s*bjvj&&(vj=o):l^(s*bj<(u=(u+360)%360-180)&&uvj&&(vj=t)),l?erM(gj,yj)&&(yj=e):rM(e,yj)>rM(gj,yj)&&(gj=e):yj>=gj?(eyj&&(yj=e)):e>bj?rM(gj,e)>rM(gj,yj)&&(yj=e):rM(e,yj)>rM(gj,yj)&&(gj=e)}else Aj.push(Ej=[gj=e,yj=e]);tvj&&(vj=t),wj=n,bj=e}function Kj(){Xj.point=Jj}function Qj(){Ej[0]=gj,Ej[1]=yj,Xj.point=Zj,wj=null}function eM(e,t){if(wj){var n=e-bj;kj.add(bw(n)>180?n+(n>0?360:-360):n)}else xj=e,_j=t;Sj.point(e,t),Jj(e,t)}function tM(){Sj.lineStart()}function nM(){eM(xj,_j),Sj.lineEnd(),bw(kj)>fw&&(gj=-(yj=180)),Ej[0]=gj,Ej[1]=yj,wj=null}function rM(e,t){return(t-=e)<0?t+360:t}function iM(e,t){return e[0]-t[0]}function oM(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tt?1:e>=t?0:NaN}function vM(e,t){return null==e||null==t?NaN:te?1:t>=e?0:NaN}function bM(){return 0}function xM(e){return e instanceof hh?e:new hh(e)}const _M="intersect",wM="union",kM="_vgsid_",AM=se(kM),EM="index:unit";function OM(e,t){for(var n,r,i=t.fields,o=t.values,a=i.length,s=0;s>>1;n(e[t],r)<0?i=t+1:o=t}while(iyM(e(t),n),r=(t,n)=>e(t)-n):(t=e===yM||e===vM?e:bM,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i>>1;n(e[t],r)<=0?i=t+1:o=t}while(it.indexOf(e)>=0)):t},R_union:function(e,t){var n=Se(t[0]),r=Se(t[1]);return n>r&&(n=t[1],r=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]r&&(n=t[1],r=t[0]),e.length?rr&&(e[1]=r),e):[n,r]}};function jM(e,t,n,r){t[0].type!==MC&&oe("First argument to selection functions must be a string literal.");const i=t[0].value,o="unit",a="@"+o,s=":"+i;(t.length>=2&&De(t).value)!==_M||st(r,a)||(r[a]=n.getData(i).indataRef(n,o)),st(r,s)||(r[s]=n.getData(i).tuplesRef())}function MM(e){const t=this.context.data[e];return t?t.values.value:[]}const $M=e=>function(t,n){return this.context.dataflow.locale()[e](n)(t)},NM=$M("format"),BM=$M("timeFormat"),TM=$M("utcFormat"),zM=$M("timeParse"),RM=$M("utcParse"),PM=new Date(2e3,0,1);function LM(e,t,n){return Number.isInteger(e)&&Number.isInteger(t)?(PM.setYear(2e3),PM.setMonth(e),PM.setDate(t),BM.call(this,PM,n)):""}const IM="%",UM="$";function qM(e,t,n,r){t[0].type!==MC&&oe("First argument to data functions must be a string literal.");const i=t[0].value,o=":"+i;if(!st(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(e){}}function WM(e,t,n,r){if(t[0].type===MC)HM(n,r,t[0].value);else for(e in n.scales)HM(n,r,e)}function HM(e,t,n){const r=IM+n;if(!st(t,r))try{t[r]=e.scaleRef(n)}catch(e){}}function GM(e,t){if(Ye(e))return e;if(vt(e)){const r=t.scales[e];return r&&((n=r.value)&&!0===n[Wp])?r.value:void 0}var n}function VM(e,t){return function(n,r,i){if(n){const t=GM(n,(i||this).context);return t&&t.path[e](r)}return t(r)}}const YM=VM("area",(function(e){return Dj=new cw,lw(e,Sj),2*Dj})),XM=VM("bounds",(function(e){var t,n,r,i,o,a,s;if(vj=yj=-(gj=mj=1/0),Aj=[],lw(e,Xj),n=Aj.length){for(Aj.sort(iM),t=1,o=[r=Aj[0]];trM(r[0],r[1])&&(r[1]=i[1]),rM(i[0],r[1])>rM(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,t=0,r=o[n=o.length-1];t<=n;r=i,++t)i=o[t],(s=rM(r[1],i[0]))>a&&(a=s,gj=i[0],yj=r[1])}return Aj=Ej=null,gj===1/0||mj===1/0?[[NaN,NaN],[NaN,NaN]]:[[gj,mj],[yj,vj]]})),ZM=VM("centroid",(function(e){$j=Nj=Bj=Tj=zj=Rj=Pj=Lj=0,Ij=new cw,Uj=new cw,qj=new cw,lw(e,aM);var t=+Ij,n=+Uj,r=+qj,i=Ew(t,n,r);return it$(e,t)}const r$={};function i$(e){return _e(e)||ArrayBuffer.isView(e)?e:null}function o$(e){return i$(e)||(vt(e)?e:null)}const a$=e=>e.data;function s$(e,t){const n=MM.call(t,e);return n.root&&n.root.lookup||{}}const u$=()=>"undefined"!=typeof window&&window||null;function l$(e,t,n){if(!e)return[];const[r,i]=e,o=(new $m).set(r[0],r[1],i[0],i[1]);return lx(n||this.context.dataflow.scenegraph().root,o,function(e){let t=null;if(e){const n=Ge(e.marktype),r=Ge(e.markname);t=e=>(!n.length||n.some((t=>e.marktype===t)))&&(!r.length||r.some((t=>e.name===t)))}return t}(t))}const c$={random:()=>$s(),cumulativeNormal:Ws,cumulativeLogNormal:Zs,cumulativeUniform:nu,densityNormal:qs,densityLogNormal:Xs,densityUniform:tu,quantileNormal:Hs,quantileLogNormal:Js,quantileUniform:ru,sampleNormal:Us,sampleLogNormal:Ys,sampleUniform:eu,isArray:_e,isBoolean:ht,isDate:pt,isDefined:e=>void 0!==e,isNumber:mt,isObject:we,isRegExp:yt,isString:vt,isTuple:Ta,isValid:e=>null!=e&&e==e,toBoolean:St,toDate:e=>Ft(e),toNumber:Se,toString:jt,indexof:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;rit(e),inScope:function(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n},intersect:l$,clampRange:Ve,pinchDistance:function(e){const t=e.touches,n=t[0].clientX-t[1].clientX,r=t[0].clientY-t[1].clientY;return Math.sqrt(n*n+r*r)},pinchAngle:function(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)},screen:function(){const e=u$();return e?e.screen:{}},containerSize:function(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]},windowSize:function(){const e=u$();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]},bandspace:function(e,t,n){return yp(e||0,t||0,n||0)},setdata:function(e,t){const n=this.context.dataflow,r=this.context.data[e].input;return n.pulse(r,n.changeset().remove(de).insert(t)),1},pathShape:function(e){let t=null;return function(n){return n?nm(n,t=t||Hg(e)):e}},panLinear:Be,panLog:Te,panPow:ze,panSymlog:Re,zoomLinear:Le,zoomLog:Ie,zoomPow:Ue,zoomSymlog:qe,encode:function(e,t,n){if(e){const n=this.context.dataflow,r=e.mark.source;n.pulse(r,n.changeset().encode(e,t))}return void 0!==n?n:e},modify:function(e,t,n,r,i,o){const a=this.context.dataflow,s=this.context.data[e],u=s.input,l=a.stamp();let c,f,d=s.changes;if(!1===a._trigger||!(u.value.length||t||r))return 0;if((!d||d.stamp{s.modified=!0,a.pulse(u,d).run()}),!0,1)),n&&(c=!0===n?de:_e(n)||Ta(n)?n:n$(n),d.remove(c)),t&&d.insert(t),r&&(c=n$(r),u.value.some(c)?d.remove(c):d.insert(r)),i)for(f in o)d.modify(i,f,o[f]);return 1},lassoAppend:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;const i=(e=Ge(e))[e.length-1];return void 0===i||Math.sqrt((i[0]-t)**2+(i[1]-n)**2)>r?[...e,[t,n]]:e},lassoPath:function(e){return Ge(e).reduce(((t,n,r)=>{let[i,o]=n;return t+(0==r?`M ${i},${o} `:r===e.length-1?" Z":`L ${i},${o} `)}),"")},intersectLasso:function(e,t,n){const{x:r,y:i,mark:o}=n,a=(new $m).set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[e,n]of t)ea.x2&&(a.x2=e),na.y2&&(a.y2=n);return a.translate(r,i),l$([[a.x1,a.y1],[a.x2,a.y2]],e,o).filter((e=>function(e,t,n){let r=0;for(let i=0,o=n.length-1;it!=s>t&&e<(a-u)*(t-l)/(s-l)+u&&r++}return 1&r}(e.x,e.y,t)))}},f$=["view","item","group","xy","x","y"],d$="this.",h$={},p$={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${Dt(UM+e)}]`,functions:function(e){const t=uj(e);f$.forEach((e=>t[e]="event.vega."+e));for(const e in c$)t[e]=d$+e;return rt(t,function(e,t,n){t.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0,n._bandwidth=WM,n._range=WM,n._scale=WM;const r=t=>"_["+(t.type===MC?Dt(IM+t.value):Dt(IM)+"+"+e(t))+"]";return{_bandwidth:e=>`this.__bandwidth(${r(e[0])})`,_range:e=>`${r(e[0])}.range()`,_scale:t=>`${r(t[0])}(${e(t[1])})`}}(e,c$,h$)),t},constants:sj,visitors:h$},g$=lj(p$);function m$(e,t,n){return 1===arguments.length?c$[e]:(c$[e]=t,n&&(h$[e]=n),g$&&(g$.functions[e]=d$+e),this)}function y$(e,t){const n={};let r;try{r=aj(e=vt(e)?e:Dt(e)+"")}catch(t){oe("Expression parse error: "+e)}r.visit((e=>{if(e.type!==$C)return;const r=e.callee.name,i=p$.visitors[r];i&&i(r,e.arguments,t,n)}));const i=g$(r);return i.globals.forEach((e=>{const r=UM+e;!st(n,r)&&t.getSignal(e)&&(n[r]=t.signalRef(e))})),{$expr:rt({code:i.code},t.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}m$("bandwidth",(function(e,t){const n=GM(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}),WM),m$("copy",(function(e,t){const n=GM(e,(t||this).context);return n?n.copy():void 0}),WM),m$("domain",(function(e,t){const n=GM(e,(t||this).context);return n?n.domain():[]}),WM),m$("range",(function(e,t){const n=GM(e,(t||this).context);return n&&n.range?n.range():[]}),WM),m$("invert",(function(e,t,n){const r=GM(e,(n||this).context);return r?_e(t)?(r.invertRange||r.invert)(t):(r.invert||r.invertExtent)(t):void 0}),WM),m$("scale",(function(e,t,n){const r=GM(e,(n||this).context);return r?r(t):void 0}),WM),m$("gradient",(function(e,t,n,r,i){e=GM(e,(i||this).context);const o=zg(t,n);let a=e.domain(),s=a[0],u=De(a),l=le;return u-s?l=og(e,s,u):e=(e.interpolator?Gp("sequential")().interpolator(e.interpolator()):Gp("linear")().interpolate(e.interpolate()).range(e.range())).domain([s=0,u=1]),e.ticks&&(a=e.ticks(+r||15),s!==a[0]&&a.unshift(s),u!==De(a)&&a.push(u)),a.forEach((t=>o.stop(l(t),e(t)))),o}),WM),m$("geoArea",YM,WM),m$("geoBounds",XM,WM),m$("geoCentroid",ZM,WM),m$("geoShape",(function(e,t,n){const r=GM(e,(n||this).context);return function(e){return r?r.path.context(e)(t):""}}),WM),m$("indata",(function(e,t,n){const r=this.context.data[e]["index:"+t],i=r?r.value.get(n):void 0;return i?i.count:i}),(function(e,t,n,r){t[0].type!==MC&&oe("First argument to indata must be a string literal."),t[1].type!==MC&&oe("Second argument to indata must be a string literal.");const i=t[0].value,o=t[1].value,a="@"+o;st(a,r)||(r[a]=n.getData(i).indataRef(n,o))})),m$("data",MM,qM),m$("treePath",(function(e,t,n){const r=s$(e,this),i=r[t],o=r[n];return i&&o?i.path(o).map(a$):void 0}),qM),m$("treeAncestors",(function(e,t){const n=s$(e,this)[t];return n?n.ancestors().map(a$):void 0}),qM),m$("vlSelectionTest",(function(e,t,n){for(var r,i,o,a,s,u=this.context.data[e],l=u?u.values.value:[],c=u?u[EM]&&u[EM].value:void 0,f=n===_M,d=l.length,h=0;h(e[o[n].field]=t,e)),{}))}else u=kM,l=AM(i),(f=(c=v[u]||(v[u]={}))[s]||(c[s]=[])).push(l),n&&(f=b[s]||(b[s]=[])).push({[kM]:l});return t=t||wM,v[kM]?v[kM]=FM[`${kM}_${t}`](...Object.values(v[kM])):Object.keys(v).forEach((e=>{v[e]=Object.keys(v[e]).map((t=>v[e][t])).reduce(((n,r)=>void 0===n?r:FM[`${x[e]}_${t}`](n,r)))})),y=Object.keys(b),n&&y.length&&(v[r?"vlPoint":"vlMulti"]=t===wM?{or:y.reduce(((e,t)=>(e.push(...b[t]),e)),[])}:{and:y.map((e=>({or:b[e]})))}),v}),jM),m$("vlSelectionTuples",(function(e,t){return e.map((e=>rt(t.fields?{values:t.fields.map((t=>(t.getter||(t.getter=se(t.field)))(e.datum)))}:{[kM]:AM(e.datum)},t)))}));const v$=Mt(["rule"]),b$=Mt(["group","image","rect"]);function x$(e){return(e+"").toLowerCase()}function _$(e,t,n){n.endsWith(";")||(n="return("+n+");");const r=Function(...t.concat(n));return e&&e.functions?r.bind(e.functions):r}var w$={operator:(e,t)=>_$(e,["_"],t.code),parameter:(e,t)=>_$(e,["datum","_"],t.code),event:(e,t)=>_$(e,["event"],t.code),handler:(e,t)=>_$(e,["_","event"],`var datum=event.item&&event.item.datum;return ${t.code};`),encode:(e,t)=>{const{marktype:n,channels:r}=t;let i="var o=item,datum=o.datum,m=0,$;";for(const e in r){const t="o["+Dt(e)+"]";i+=`$=${r[e].code};if(${t}!==$)${t}=$,m=1;`}return i+=function(e,t){let n="";return v$[t]||(e.x2&&(e.x?(b$[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(b$[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(r,n),i+="return m;",_$(e,["item","_"],i)},codegen:{get(e){const t=`[${e.map(Dt).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const r=Function("a","b","var u, v; return "+e.map(((e,r)=>{const i=t[r];let o,a;return e.path?(o=`a${e.path}`,a=`b${e.path}`):((n=n||{})["f"+r]=e,o=`this.f${r}(a)`,a=`this.f${r}(b)`),function(e,t,n,r){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}\n : (u > v || v == null) && u != null ? ${r}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}\n : v !== v && u === u ? ${r} : `}(o,a,-i,i)})).join("")+"0;");return n?r.bind(n):r}}};function k$(e,t,n){if(!e||!we(e))return e;for(let r,i=0,o=A$.length;ie&&e.$tupleid?za:e));return t.fn[n]||(t.fn[n]=Ze(r,e.$order,t.expr.codegen))}},{key:"$context",parse:function(e,t){return t}},{key:"$subflow",parse:function(e,t){const n=e.$subflow;return function(e,r,i){const o=t.fork().parse(n),a=o.get(n.operators[0].id),s=o.signals.parent;return s&&s.set(i),a.detachSubflow=()=>t.detach(o),a}}},{key:"$tupleid",parse:function(){return za}}];const E$={skip:!0};function O$(e,t,n,r){return new D$(e,t,n,r)}function D$(e,t,n,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=r||w$,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function S$(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}function C$(e,t){e&&(null==t?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}D$.prototype=S$.prototype={fork(){const e=new S$(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter((t=>t!==e));const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,r=n.dataflow,i=e.value;if(n.set(e.id,t),"collect"===x$(e.type)&&i&&(i.$ingest?r.ingest(t,i.$ingest,i.$format):i.$request?r.preload(t,i.$request,i.$format):r.pulse(t,r.changeset().insert(i))),e.root&&(n.root=t),e.parent){let i=n.get(e.parent.$ref);i?(r.connect(i,[t]),t.targets().add(i)):(n.unresolved=n.unresolved||[]).push((()=>{i=n.get(e.parent.$ref),r.connect(i,[t]),t.targets().add(i)}))}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const r in e.data){const i=n.data[r]||(n.data[r]={});e.data[r].forEach((e=>i[e]=t))}},resolve(){return(this.unresolved||[]).forEach((e=>e())),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[x$(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,r,i){this.dataflow.on(t,n,r,i,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:function(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach((e=>t.parseOperator(e))),n.forEach((e=>t.parseOperatorParameters(e))),(e.streams||[]).forEach((e=>t.parseStream(e))),(e.updates||[]).forEach((e=>t.parseUpdate(e))),t.resolve()},parseOperator:function(e){const t=this;"operator"!==x$(e.type)&&e.type?t.transform(e,e.type):t.operator(e,e.update?t.operatorExpression(e.update):null)},parseOperatorParameters:function(e){const t=this;if(e.params){const n=t.get(e.id);n||oe("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}},parseParameters:function(e,t){t=t||{};const n=this;for(const r in e){const i=e[r];t[r]=_e(i)?i.map((e=>k$(e,n,t))):k$(i,n,t)}return t},parseStream:function(e){var t,n=this,r=null!=e.filter?n.eventExpression(e.filter):void 0,i=null!=e.stream?n.get(e.stream):void 0;e.source?i=n.events(e.source,e.type,r):e.merge&&(i=(t=e.merge.map((e=>n.get(e))))[0].merge.apply(t[0],t.slice(1))),e.between&&(t=e.between.map((e=>n.get(e))),i=i.between(t[0],t[1])),e.filter&&(i=i.filter(r)),null!=e.throttle&&(i=i.throttle(+e.throttle)),null!=e.debounce&&(i=i.debounce(+e.debounce)),null==i&&oe("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),n.stream(e,i)},parseUpdate:function(e){var t,n=this,r=we(r=e.source)?r.$ref:r,i=n.get(r),o=e.update,a=void 0;i||oe("Source not defined: "+e.source),t=e.target&&e.target.$expr?n.eventExpression(e.target.$expr):n.get(e.target),o&&o.$expr&&(o.$params&&(a=n.parseParameters(o.$params)),o=n.handlerExpression(o.$expr)),n.update(e,i,t,o,a)},getState:function(e){var t=this,n={};if(e.signals){var r=n.signals={};Object.keys(t.signals).forEach((n=>{const i=t.signals[n];e.signals(n,i)&&(r[n]=i.value)}))}if(e.data){var i=n.data={};Object.keys(t.data).forEach((n=>{const r=t.data[n];e.data(n,r)&&(i[n]=r.input.value)}))}return t.subcontext&&!1!==e.recurse&&(n.subcontext=t.subcontext.map((t=>t.getState(e)))),n},setState:function(e){var t=this,n=t.dataflow,r=e.data,i=e.signals;Object.keys(i||{}).forEach((e=>{n.update(t.signals[e],i[e],E$)})),Object.keys(r||{}).forEach((e=>{n.pulse(t.data[e].input,n.changeset().remove(de).insert(r[e]))})),(e.subcontext||[]).forEach(((e,n)=>{const r=t.subcontext[n];r&&r.setState(e)}))}};const F$="default";function j$(e,t){const n=e.globalCursor()?"undefined"!=typeof document&&document.body:e.container();if(n)return null==t?n.style.removeProperty("cursor"):n.style.cursor=t}function M$(e,t){var n=e._runtime.data;return st(n,t)||oe("Unrecognized data set: "+t),n[t]}function $$(e,t){Wa(t)||oe("Second argument to changes must be a changeset.");const n=M$(this,e);return n.modified=!0,this.pulse(n.input,t)}function N$(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function B$(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function T$(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}const z$="view",R$={trap:!1};function P$(e,t,n,r){e._eventListeners.push({type:n,sources:Ge(t),handler:r})}function L$(e,t,n){const r=e._eventConfig&&e._eventConfig[t];return!(!1===r||we(r)&&!r[n])||(e.warn(`Blocked ${t} ${n} event listener.`),!1)}function I$(e){return e.item}function U$(e){return e.item.mark.source}function q$(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function W$(e,t,n){const r=document.createElement(e);for(const e in t)r.setAttribute(e,t[e]);return null!=n&&(r.textContent=n),r}const H$="vega-bind-radio";function G$(e,t,n,r){const i=n.event||"input",o=()=>e.update(t.value);r.signal(n.signal,t.value),t.addEventListener(i,o),P$(r,t,i,o),e.set=e=>{t.value=e,t.dispatchEvent(function(e){return"undefined"!=typeof Event?new Event(e):{type:e}}(i))}}function V$(e,t,n,r){const i=r.signal(n.signal),o=W$("div",{class:"vega-bind"}),a="radio"===n.input?o:o.appendChild(W$("label"));a.appendChild(W$("span",{class:"vega-bind-name"},n.name||n.signal)),t.appendChild(o);let s=Y$;switch(n.input){case"checkbox":s=X$;break;case"select":s=Z$;break;case"radio":s=J$;break;case"range":s=K$}s(e,a,n,i)}function Y$(e,t,n,r){const i=W$("input");for(const e in n)"signal"!==e&&"element"!==e&&i.setAttribute("input"===e?"type":e,n[e]);i.setAttribute("name",n.signal),i.value=r,t.appendChild(i),i.addEventListener("input",(()=>e.update(i.value))),e.elements=[i],e.set=e=>i.value=e}function X$(e,t,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=W$("input",i);t.appendChild(o),o.addEventListener("change",(()=>e.update(o.checked))),e.elements=[o],e.set=e=>o.checked=!!e||null}function Z$(e,t,n,r){const i=W$("select",{name:n.signal}),o=n.labels||[];n.options.forEach(((e,t)=>{const n={value:e};Q$(e,r)&&(n.selected=!0),i.appendChild(W$("option",n,(o[t]||e)+""))})),t.appendChild(i),i.addEventListener("change",(()=>{e.update(n.options[i.selectedIndex])})),e.elements=[i],e.set=e=>{for(let t=0,r=n.options.length;t{const s={type:"radio",name:n.signal,value:t};Q$(t,r)&&(s.checked=!0);const u=W$("input",s);u.addEventListener("change",(()=>e.update(t)));const l=W$("label",{},(o[a]||t)+"");return l.prepend(u),i.appendChild(l),u})),e.set=t=>{const n=e.elements,r=n.length;for(let e=0;e{u.textContent=s.value,e.update(+s.value)};s.addEventListener("input",l),s.addEventListener("change",l),e.elements=[s],e.set=e=>{s.value=e,u.textContent=e}}function Q$(e,t){return e===t||e+""==t+""}function eN(e,t,n,r,i,o){return(t=t||new r(e.loader())).initialize(n,N$(e),B$(e),T$(e),i,o).background(e.background())}function tN(e,t){return t?function(){try{t.apply(this,arguments)}catch(t){e.error(t)}}:null}function nN(e,t,n){if("string"==typeof t){if("undefined"==typeof document)return e.error("DOM document instance not found."),null;if(!(t=document.querySelector(t)))return e.error("Signal bind element not found: "+t),null}if(t&&n)try{t.textContent=""}catch(n){t=null,e.error(n)}return t}const rN=e=>+e||0;function iN(e){return we(e)?{top:rN(e.top),bottom:rN(e.bottom),left:rN(e.left),right:rN(e.right)}:(e=>({top:e,bottom:e,left:e,right:e}))(rN(e))}async function oN(e,t,n,r){const i=ux(t),o=i&&i.headless;return o||oe("Unrecognized renderer type: "+t),await e.runAsync(),eN(e,null,null,o,n,r).renderAsync(e._scenegraph.root)}var aN="width",sN="height",uN="padding",lN={skip:!0};function cN(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===uN?r.left+r.right:0)}function fN(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===uN?r.top+r.bottom:0)}function dN(e,t){return t.modified&&_e(t.input.value)&&e.indexOf("_:vega:_")}function hN(e,t){return!("parent"===e||t instanceof ms.proxy)}function pN(e,t,n,r){const i=e.element();i&&i.setAttribute("title",function(e){return null==e?"":_e(e)?gN(e):we(e)&&!pt(e)?(t=e,Object.keys(t).map((e=>{const n=t[e];return e+": "+(_e(n)?gN(n):mN(n))})).join("\n")):e+"";var t}(r))}function gN(e){return"["+e.map(mN).join(", ")+"]"}function mN(e){return _e(e)?"[…]":we(e)&&!pt(e)?"{…}":e}function yN(e,t){const n=this;if(t=t||{},hs.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),null!=t.logLevel&&n.logLevel(t.logLevel),t.locale||e.locale){const r=rt({},e.locale,t.locale);n.locale(na(r.number,r.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||ax.Canvas,n._scenegraph=new Rv;const r=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||pN,n._redraw=!0,n._handler=(new cb).scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(e){const t=rt({defaults:{}},e),n=(e,t)=>{t.forEach((t=>{_e(e[t])&&(e[t]=Mt(e[t]))}))};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=function(e,t,n){return O$(e,ms,c$,n).parse(t)}(n,e,t.expr);n._runtime=i,n._signals=i.signals,n._bind=(e.bindings||[]).map((e=>({state:null,param:rt({},e)}))),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=cN(n,n._width),n._viewHeight=fN(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(e){var t=e._signals,n=t[aN],r=t[sN],i=t[uN];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,(t=>{e._width=t.size,e._viewWidth=cN(e,t.size),o()}),{size:n}),e._resizeHeight=e.add(null,(t=>{e._height=t.size,e._viewHeight=fN(e,t.size),o()}),{size:r});const a=e.add(null,o,{pad:i});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=r.rank+1,a.rank=i.rank+1}(n),function(e){e.add(null,(t=>(e._background=t.bg,e._resize=1,t.bg)),{bg:e._signals.background})}(n),function(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:F$,item:null}));e.on(e.events("view","mousemove"),t,((e,n)=>{const r=t.value,i=r?vt(r)?r:r.user:F$,o=n.item&&n.item.cursor||null;return r&&i===r.user&&o==r.item?r:{user:i,item:o}})),e.add(null,(function(t){let n=t.cursor,r=this.value;return vt(n)||(r=n.item,n=n.user),j$(e,n&&n!==F$?n:r||n),r}),{cursor:t})}(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind)}function vN(e,t){return st(e._signals,t)?e._signals[t]:oe("Unrecognized signal name: "+Dt(t))}function bN(e,t){const n=(e._targets||[]).filter((e=>e._update&&e._update.handler===t));return n.length?n[0]:null}function xN(e,t,n,r){let i=bN(n,r);return i||(i=tN(e,(()=>r(t,n.value))),i.handler=r,e.on(n,null,i)),e}function _N(e,t,n){const r=bN(t,n);return r&&t._targets.remove(r),e}ft(yN,hs,{async evaluate(e,t,n){if(await hs.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,i=T$(r=this),o=N$(r),a=B$(r),r._renderer.background(r.background()),r._renderer.resize(o,a,i),r._handler.origin(i),r._resizeListeners.forEach((e=>{try{e(o,a)}catch(e){r.error(e)}}))),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(e){this.error(e)}var r,i,o,a;return n&&$a(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=null!=e?e+"":null;return t!==this._desc&&C$(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const r=vN(this,e);return 1===arguments.length?r.value:this.update(r,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",iN(e)):iN(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(ux(e)||oe("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(hs.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(vN(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function(e,t,n,r,i,o){this.runAfter((a=>{let s=0;a._autosize=0,a.width()!==n&&(s=1,a.signal(aN,n,lN),a._resizeWidth.skip(!0)),a.height()!==r&&(s=1,a.signal(sN,r,lN),a._resizeHeight.skip(!0)),a._viewWidth!==e&&(a._resize=1,a._viewWidth=e),a._viewHeight!==t&&(a._resize=1,a._viewHeight=t),a._origin[0]===i[0]&&a._origin[1]===i[1]||(a._resize=1,a._origin=i),s&&a.run("enter"),o&&a.runAfter((e=>e.resize()))}),!1,1)},addEventListener(e,t,n){let r=t;return n&&!1===n.trap||(r=tN(this,t),r.raw=t),this._handler.on(e,r),this},removeEventListener(e,t){for(var n,r,i=this._handler.handlers(e),o=i.length;--o>=0;)if(r=i[o].type,n=i[o].handler,e===r&&(t===n||t===n.raw)){this._handler.off(r,n);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.indexOf(e)<0&&t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return xN(this,e,vN(this,e),t)},removeSignalListener(e,t){return _N(this,vN(this,e),t)},addDataListener(e,t){return xN(this,e,M$(this,e).values,t)},removeDataListener(e,t){return _N(this,M$(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=j$(this,null);this._globalCursor=!!e,t&&j$(this,t)}return this}return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:function(e,t){this._timers.push(function(e,t,n){var r=new AO,i=t;return null==t?(r.restart(e,t,n),r):(r._restart=r.restart,r.restart=function(e,t,n){t=+t,n=null==n?wO():+n,r._restart((function o(a){a+=i,r._restart(o,i+=t,n),e(a)}),t,n)},r.restart(e,t,n),r)}((function(t){e({timestamp:Date.now(),elapsed:t})}),t))},events:function(e,t,n){var r,i=this,o=new Qa(n),a=function(n,r){i.runAsync(null,(()=>{e===z$&&function(e,t){var n=e._eventConfig.defaults,r=n.prevent,i=n.allow;return!1!==r&&!0!==i&&(!0===r||!1===i||(r?r[t]:i?!i[t]:e.preventDefault()))}(i,t)&&n.preventDefault(),o.receive(function(e,t,n){var r,i,o=e._renderer,a=o&&o.canvas();return a&&(i=T$(e),(r=Hv(t.changedTouches?t.changedTouches[0]:t,a))[0]-=i[0],r[1]-=i[1]),t.dataflow=e,t.item=n,t.vega=function(e,t,n){const r=t?"group"===t.mark.marktype?t:t.mark.group:null;function i(e){var n,i=r;if(e)for(n=t;n;n=n.mark.group)if(n.mark.name===e){i=n;break}return i&&i.mark&&i.mark.interactive?i:{}}function o(e){if(!e)return n;vt(e)&&(e=i(e));const t=n.slice();for(;e;)t[0]-=e.x||0,t[1]-=e.y||0,e=e.mark&&e.mark.group;return t}return{view:tt(e),item:tt(t||{}),group:i,xy:o,x:e=>o(e)[0],y:e=>o(e)[1]}}(e,n,r),t}(i,n,r))}))};if("timer"===e)L$(i,"timer",t)&&i.timer(a,t);else if(e===z$)L$(i,"view",t)&&i.addEventListener(t,a,R$);else if("window"===e?L$(i,"window",t)&&"undefined"!=typeof window&&(r=[window]):"undefined"!=typeof document&&L$(i,"selector",t)&&(r=Array.from(document.querySelectorAll(e))),r){for(var s=0,u=r.length;s=0;)i[e].stop();for(e=o.length;--e>=0;)for(t=(n=o[e]).sources.length;--t>=0;)n.sources[t].removeEventListener(n.type,n.handler);return r&&r.call(this,this._handler,null,null,null),this},hover:function(e,t){return t=[t||"update",(e=[e||"hover"])[0]],this.on(this.events("view","mouseover",I$),U$,q$(e)),this.on(this.events("view","mouseout",I$),U$,q$(t)),this},data:function(e,t){return arguments.length<2?M$(this,e).values.value:$$.call(this,e,Ha().remove(de).insert(t))},change:$$,insert:function(e,t){return $$.call(this,e,Ha().insert(t))},remove:function(e,t){return $$.call(this,e,Ha().remove(t))},scale:function(e){var t=this._runtime.scales;return st(t,e)||oe("Unrecognized scale or projection: "+e),t[e].value},initialize:function(e,t){const n=this,r=n._renderType,i=n._eventConfig.bind,o=ux(r);e=n._el=e?nN(n,e,!0):null,function(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),C$(t,e.description()))}(n),o||n.error("Unrecognized renderer type: "+r);const a=o.handler||cb,s=e?o.renderer:o.headless;return n._renderer=s?eN(n,n._renderer,e,s):null,n._handler=function(e,t,n,r){const i=new r(e.loader(),tN(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,T$(e),e);return t&&t.handlers().forEach((e=>{i.on(e.type,e.handler)})),i}(n,n._handler,e,a),n._redraw=!0,e&&"none"!==i&&(t=t?n._elBind=nN(n,t,!0):e.appendChild(W$("form",{class:"vega-bindings"})),n._bind.forEach((e=>{e.param.element&&"container"!==i&&(e.element=nN(n,e.param.element,!!e.param.input))})),n._bind.forEach((e=>{!function(e,t,n){if(!t)return;const r=n.param;let i=n.state;i||(i=n.state={elements:null,active:!1,set:null,update:t=>{t!=e.signal(r.signal)&&e.runAsync(null,(()=>{i.source=!0,e.signal(r.signal,t)}))}},r.debounce&&(i.update=nt(r.debounce,i.update))),(null==r.input&&r.element?G$:V$)(i,t,r,e),i.active||(e.on(e._signals[r.signal],null,(()=>{i.source?i.source=!1:i.set(e.signal(r.signal))})),i.active=!0)}(n,e.element||t,e)}))),n},toImageURL:async function(e,t){e!==ax.Canvas&&e!==ax.SVG&&e!==ax.PNG&&oe("Unrecognized image type: "+e);const n=await oN(this,e,t);return e===ax.SVG?function(e,t){const n=new Blob([e],{type:"image/svg+xml"});return window.URL.createObjectURL(n)}(n.svg()):n.canvas().toDataURL("image/png")},toCanvas:async function(e,t){return(await oN(this,ax.Canvas,e,t)).canvas()},toSVG:async function(e){return(await oN(this,ax.SVG,e)).svg()},getState:function(e){return this._runtime.getState(e||{data:dN,signals:hN,recurse:!0})},setState:function(e){return this.runAsync(null,(t=>{t._trigger=!1,t._runtime.setState(e)}),(e=>{e._trigger=!0})),this}});const wN="view",kN="[",AN="]",EN="{",ON="}",DN=":",SN=",",CN="@",FN=">",jN=/[[\]{}]/,MN={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let $N,NN;function BN(e,t,n){return $N=t||wN,NN=n||MN,zN(e.trim()).map(RN)}function TN(e,t,n,r,i){const o=e.length;let a,s=0;for(;t=0?--s:r&&r.indexOf(a)>=0&&++s}return t}function zN(e){const t=[],n=e.length;let r=0,i=0;for(;i' after between selector: "+e;n=n.map(RN);const i=RN(e.slice(1).trim());return i.between?{between:n,stream:i}:(i.between=n,i)}(e):function(e){const t={source:$N},n=[];let r,i,o=[0,0],a=0,s=0,u=e.length,l=0;if(e[u-1]===ON){if(l=e.lastIndexOf(EN),!(l>=0))throw"Unmatched right brace: "+e;try{o=function(e){const t=e.split(SN);if(!e.length||t.length>2)throw e;return t.map((t=>{const n=+t;if(n!=n)throw e;return n}))}(e.substring(l+1,u-1))}catch(t){throw"Invalid throttle specification: "+e}u=(e=e.slice(0,l).trim()).length,l=0}if(!u)throw e;if(e[0]===CN&&(a=++l),r=TN(e,l,DN),r1?(t.type=n[1],a?t.markname=n[0].slice(1):(c=n[0],NN[c]?t.marktype=n[0]:t.source=n[0])):t.type=n[0],"!"===t.type.slice(-1)&&(t.consume=!0,t.type=t.type.slice(0,-1)),null!=i&&(t.filter=i),o[0]&&(t.throttle=o[0]),o[1]&&(t.debounce=o[1]),t}(e)}function PN(e){return we(e)?e:{type:e||"pad"}}const LN=e=>+e||0,IN=e=>({top:e,bottom:e,left:e,right:e});function UN(e){return we(e)?e.signal?e:{top:LN(e.top),bottom:LN(e.bottom),left:LN(e.left),right:LN(e.right)}:IN(LN(e))}const qN=e=>we(e)&&!_e(e)?rt({},e):{value:e};function WN(e,t,n,r){return null!=n?(we(n)&&!_e(n)||_e(n)&&n.length&&we(n[0])?e.update[t]=n:e[r||"enter"][t]={value:n},1):0}function HN(e,t,n){for(const n in t)WN(e,n,t[n]);for(const t in n)WN(e,t,n[t],"update")}function GN(e,t,n){for(const r in t)n&&st(n,r)||(e[r]=rt(e[r]||{},t[r]));return e}function VN(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const YN="mark",XN="frame",ZN="scope",JN="axis",KN="axis-domain",QN="axis-grid",eB="axis-label",tB="axis-tick",nB="axis-title",rB="legend",iB="legend-band",oB="legend-entry",aB="legend-gradient",sB="legend-label",uB="legend-symbol",lB="legend-title",cB="title",fB="title-text",dB="title-subtitle";function hB(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const pB=e=>vt(e)?Dt(e):e.signal?`(${e.signal})`:vB(e);function gB(e){if(null!=e.gradient)return function(e){const t=[e.start,e.stop,e.count].map((e=>null==e?null:Dt(e)));for(;t.length&&null==De(t);)t.pop();return t.unshift(pB(e.gradient)),`gradient(${t.join(",")})`}(e);let t=e.signal?`(${e.signal})`:e.color?function(e){return e.c?mB("hcl",e.h,e.c,e.l):e.h||e.s?mB("hsl",e.h,e.s,e.l):e.l||e.a?mB("lab",e.l,e.a,e.b):e.r||e.g||e.b?mB("rgb",e.r,e.g,e.b):null}(e.color):null!=e.field?vB(e.field):void 0!==e.value?Dt(e.value):void 0;return null!=e.scale&&(t=function(e,t){const n=pB(e.scale);return null!=e.range?t=`lerp(_range(${n}), ${+e.range})`:(void 0!==t&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(1==+e.band?"":"*"+yB(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),null==t&&(t="0")),t}(e,t)),void 0===t&&(t=null),null!=e.exponent&&(t=`pow(${t},${yB(e.exponent)})`),null!=e.mult&&(t+=`*${yB(e.mult)}`),null!=e.offset&&(t+=`+${yB(e.offset)}`),e.round&&(t=`round(${t})`),t}const mB=(e,t,n,r)=>`(${e}(${[t,n,r].map(gB).join(",")})+'')`;function yB(e){return we(e)?"("+gB(e)+")":e}function vB(e){return bB(we(e)?e:{datum:e})}function bB(e){let t,n,r;if(e.signal)t="datum",r=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(r=e.parent,t+=".datum"):r=e.group}else e.datum?(t="datum",r=e.datum):oe("Invalid field reference: "+Dt(e));return e.signal||(r=vt(r)?ae(r).map(Dt).join("]["):bB(r)),t+"["+r+"]"}function xB(e,t,n,r,i,o){const a={};(o=o||{}).encoders={$encode:a},e=function(e,t,n,r,i){const o={},a={};let s,u,l,c;for(u in u="lineBreak","text"!==t||null==i[u]||VN(u,e)||hB(o,u,i[u]),("legend"==n||String(n).startsWith("axis"))&&(n=null),c=n===XN?i.group:n===YN?rt({},i.mark,i[t]):null,c)l=VN(u,e)||("fill"===u||"stroke"===u)&&(VN("fill",e)||VN("stroke",e)),l||hB(o,u,c[u]);for(u in Ge(r).forEach((t=>{const n=i.style&&i.style[t];for(const t in n)VN(t,e)||hB(o,t,n[t])})),e=rt({},e),o)c=o[u],c.signal?(s=s||{})[u]=c:a[u]=c;return e.enter=rt(a,e.enter),s&&(e.update=rt(s,e.update)),e}(e,t,n,r,i.config);for(const n in e)a[n]=_B(e[n],t,o,i);return o}function _B(e,t,n,r){const i={},o={};for(const t in e)null!=e[t]&&(i[t]=wB((a=e[t],_e(a)?function(e){let t="";return e.forEach((e=>{const n=gB(e);t+=e.test?`(${e.test})?${n}:`:n})),":"===De(t)&&(t+="null"),t}(a):gB(a)),r,n,o));var a;return{$expr:{marktype:t,channels:i},$fields:Object.keys(o),$output:Object.keys(e)}}function wB(e,t,n,r){const i=y$(e,t);return i.$fields.forEach((e=>r[e]=1)),rt(n,i.$params),i.$expr}const kB="outer",AB=["value","update","init","react","bind"];function EB(e,t){oe(e+' for "outer" push: '+Dt(t))}function OB(e,t){const n=e.name;if(e.push===kB)t.signals[n]||EB("No prior signal definition",n),AB.forEach((t=>{void 0!==e[t]&&EB("Invalid property ",t)}));else{const r=t.addSignal(n,e.value);!1===e.react&&(r.react=!1),e.bind&&t.addBinding(n,e.bind)}}function DB(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function SB(e,t,n,r){return new DB(e,t,n,r)}function CB(e,t){return SB("operator",e,t)}function FB(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function jB(e,t){return t?{$field:e,$name:t}:{$field:e}}const MB=jB("key");function $B(e,t){return{$compare:e,$order:t}}function NB(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const BB="scope",TB="view";function zB(e){return e&&e.signal}function RB(e){if(zB(e))return!0;if(we(e))for(const t in e)if(RB(e[t]))return!0;return!1}function PB(e,t){return null!=e?e:t}function LB(e){return e&&e.signal||e}const IB="timer";function UB(e,t){return(e.merge?qB:e.stream?WB:e.type?HB:oe("Invalid stream specification: "+Dt(e)))(e,t)}function qB(e,t){const n=GB({merge:e.merge.map((e=>UB(e,t)))},e,t);return t.addStream(n).id}function WB(e,t){const n=GB({stream:UB(e.stream,t)},e,t);return t.addStream(n).id}function HB(e,t){let n;var r;e.type===IB?(n=t.event(IB,e.throttle),e={between:e.between,filter:e.filter}):n=t.event((r=e.source)===BB?TB:r||TB,e.type);const i=GB({stream:n},e,t);return 1===Object.keys(i).length?n:t.addStream(i).id}function GB(e,t,n){let r=t.between;return r&&(2!==r.length&&oe('Stream "between" parameter must have 2 entries: '+Dt(t)),e.between=[UB(r[0],n),UB(r[1],n)]),r=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&r.push(function(e,t,n){const r="event.item";return r+(e&&"*"!==e?"&&"+r+".mark.marktype==='"+e+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(t?"&&"+r+".mark.name==='"+t+"'":"")}(t.marktype,t.markname,t.markrole)),t.source===BB&&r.push("inScope(event.item)"),r.length&&(e.filter=y$("("+r.join(")&&(")+")",n).$expr),null!=(r=t.throttle)&&(e.throttle=+r),null!=(r=t.debounce)&&(e.debounce=+r),t.consume&&(e.consume=!0),e}const VB={code:"_.$value",ast:{type:"Identifier",value:"value"}};function YB(e){return{signal:"["+e.map((e=>e.scale?'scale("'+e.scale+'")':e.signal))+"]"}}const XB=e=>(t,n,r)=>SB(e,n,t||void 0,r),ZB=XB("aggregate"),JB=XB("axisticks"),KB=XB("bound"),QB=XB("collect"),eT=XB("compare"),tT=XB("datajoin"),nT=XB("encode"),rT=XB("expression"),iT=XB("facet"),oT=XB("field"),aT=XB("key"),sT=XB("legendentries"),uT=XB("load"),lT=XB("mark"),cT=XB("multiextent"),fT=XB("multivalues"),dT=XB("overlap"),hT=XB("params"),pT=XB("prefacet"),gT=XB("projection"),mT=XB("proxy"),yT=XB("relay"),vT=XB("render"),bT=XB("scale"),xT=XB("sieve"),_T=XB("sortitems"),wT=XB("viewlayout"),kT=XB("values");let AT=0;const ET={min:"min",max:"max",count:"sum"};function OT(e,t){const n=t.getScale(e.name).params;let r;for(r in n.domain=FT(e.domain,e,t),null!=e.range&&(n.range=RT(e,t,n)),null!=e.interpolate&&function(e,t){t.interpolate=DT(e.type||e),null!=e.gamma&&(t.interpolateGamma=DT(e.gamma))}(e.interpolate,n),null!=e.nice&&(n.nice=function(e){return we(e)?{interval:DT(e.interval),step:DT(e.step)}:DT(e)}(e.nice)),null!=e.bins&&(n.bins=function(e,t){return e.signal||_e(e)?ST(e,t):t.objectProperty(e)}(e.bins,t)),e)st(n,r)||"name"===r||(n[r]=DT(e[r],t))}function DT(e,t){return we(e)?e.signal?t.signalRef(e.signal):oe("Unsupported object: "+Dt(e)):e}function ST(e,t){return e.signal?t.signalRef(e.signal):e.map((e=>DT(e,t)))}function CT(e){oe("Can not find data set: "+Dt(e))}function FT(e,t,n){if(e)return e.signal?n.signalRef(e.signal):(_e(e)?jT:e.fields?$T:MT)(e,t,n);null==t.domainMin&&null==t.domainMax||oe("No scale domain defined for domainMin/domainMax to override.")}function jT(e,t,n){return e.map((e=>DT(e,n)))}function MT(e,t,n){const r=n.getData(e.data);return r||CT(e.data),Zp(t.type)?r.valuesRef(n,e.field,BT(e.sort,!1)):eg(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function $T(e,t,n){const r=e.data,i=e.fields.reduce(((e,t)=>(t=vt(t)?{data:r,field:t}:_e(t)||t.signal?function(e,t){const n="_:vega:_"+AT++,r=QB({});if(_e(e))r.value={$ingest:e};else if(e.signal){const i="setdata("+Dt(n)+","+e.signal+")";r.params.input=t.signalRef(i)}return t.addDataPipeline(n,[r,xT({})]),{data:n,field:"data"}}(t,n):t,e.push(t),e)),[]);return(Zp(t.type)?NT:eg(t.type)?TT:zT)(e,n,i)}function NT(e,t,n){const r=BT(e.sort,!0);let i,o;const a=n.map((e=>{const n=t.getData(e.data);return n||CT(e.data),n.countsRef(t,e.field,r)})),s={groupby:MB,pulse:a};r&&(i=r.op||"count",o=r.field?NB(i,r.field):"count",s.ops=[ET[i]],s.fields=[t.fieldRef(o)],s.as=[o]),i=t.add(ZB(s));const u=t.add(QB({pulse:FB(i)}));return o=t.add(kT({field:MB,sort:t.sortRef(r),pulse:FB(u)})),FB(o)}function BT(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field&&e.op&&!ET[e.op]&&oe("Multiple domain scales can not be sorted using "+e.op):oe("No field provided for sort aggregate op: "+e.op):we(e)?e.field="key":e={field:"key"}),e}function TT(e,t,n){const r=n.map((e=>{const n=t.getData(e.data);return n||CT(e.data),n.domainRef(t,e.field)}));return FB(t.add(fT({values:r})))}function zT(e,t,n){const r=n.map((e=>{const n=t.getData(e.data);return n||CT(e.data),n.extentRef(t,e.field)}));return FB(t.add(cT({extents:r})))}function RT(e,t,n){const r=t.config.range;let i=e.range;if(i.signal)return t.signalRef(i.signal);if(vt(i)){if(r&&st(r,i))return RT(e=rt({},e,{range:r[i]}),t,n);"width"===i?i=[0,{signal:"width"}]:"height"===i?i=Zp(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:oe("Unrecognized scale range value: "+Dt(i))}else{if(i.scheme)return n.scheme=_e(i.scheme)?ST(i.scheme,t):DT(i.scheme,t),i.extent&&(n.schemeExtent=ST(i.extent,t)),void(i.count&&(n.schemeCount=DT(i.count,t)));if(i.step)return void(n.rangeStep=DT(i.step,t));if(Zp(e.type)&&!_e(i))return FT(i,e,t);_e(i)||oe("Unsupported range type: "+Dt(i))}return i.map((e=>(_e(e)?ST:DT)(e,t)))}function PT(e,t,n){return _e(e)?e.map((e=>PT(e,t,n))):we(e)?e.signal?n.signalRef(e.signal):"fit"===t?e:oe("Unsupported parameter object: "+Dt(e)):e}const LT="top",IT="left",UT="right",qT="bottom",WT="center",HT="vertical",GT="start",VT="end",YT="index",XT="label",ZT="offset",JT="perc",KT="perc2",QT="value",ez="guide-label",tz="guide-title",nz="group-title",rz="group-subtitle",iz="symbol",oz="gradient",az="discrete",sz="size",uz=[sz,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],lz={name:1,style:1,interactive:1},cz={value:0},fz={value:1},dz="group",hz="rect",pz="rule",gz="symbol",mz="text";function yz(e){return e.type=dz,e.interactive=e.interactive||!1,e}function vz(e,t){const n=(n,r)=>PB(e[n],PB(t[n],r));return n.isVertical=n=>HT===PB(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>PB(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>PB(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>PB(e.columns,PB(t.columns,+n.isVertical(!0))),n}function bz(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function xz(e,t,n){return`item.anchor === '${GT}' ? ${e} : item.anchor === '${VT}' ? ${t} : ${n}`}const _z=xz(Dt(IT),Dt(UT),Dt(WT));function wz(e,t){return t?e?we(e)?Object.assign({},e,{offset:wz(e.offset,t)}):{value:e,offset:t}:t:e}function kz(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=GN(e.encode,t,lz)):e.interactive=!1,e}function Az(e,t,n,r){const i=vz(e,n),o=i.isVertical(),a=i.gradientThickness(),s=i.gradientLength();let u,l,c,f,d;o?(l=[0,1],c=[0,0],f=a,d=s):(l=[0,0],c=[1,0],f=s,d=a);const h={enter:u={opacity:cz,x:cz,y:cz,width:qN(f),height:qN(d)},update:rt({},u,{opacity:fz,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:cz}};return HN(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),kz({type:hz,role:aB,encode:h},r)}function Ez(e,t,n,r,i){const o=vz(e,n),a=o.isVertical(),s=o.gradientThickness(),u=o.gradientLength();let l,c,f,d,h="";a?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const p={opacity:cz,fill:{scale:t,field:QT}};p[l]={signal:h+"datum."+JT,mult:u},p[c]=cz,p[f]={signal:h+"datum."+KT,mult:u},p[d]=qN(s);const g={enter:p,update:rt({},p,{opacity:fz}),exit:{opacity:cz}};return HN(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),kz({type:hz,role:iB,key:QT,from:i,encode:g},r)}const Oz=`datum.${JT}<=0?"${IT}":datum.${JT}>=1?"${UT}":"${WT}"`,Dz=`datum.${JT}<=0?"${qT}":datum.${JT}>=1?"${LT}":"middle"`;function Sz(e,t,n,r){const i=vz(e,t),o=i.isVertical(),a=qN(i.gradientThickness()),s=i.gradientLength();let u,l,c,f,d=i("labelOverlap"),h="";const p={enter:u={opacity:cz},update:l={opacity:fz,text:{field:XT}},exit:{opacity:cz}};return HN(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:PB(e.labelLimit,t.gradientLabelLimit)}),o?(u.align={value:"left"},u.baseline=l.baseline={signal:Dz},c="y",f="x",h="1-"):(u.align=l.align={signal:Oz},u.baseline={value:"top"},c="x",f="y"),u[c]=l[c]={signal:h+"datum."+JT,mult:s},u[f]=l[f]=a,a.offset=PB(e.labelOffset,t.gradientLabelOffset)||0,d=d?{separation:i("labelSeparation"),method:d,order:"datum."+YT}:void 0,kz({type:mz,role:sB,style:ez,key:QT,from:r,encode:p,overlap:d},n)}function Cz(e,t,n,r,i){const o=vz(e,t),a=n.entries,s=!(!a||!a.interactive),u=a?a.name:void 0,l=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},d=`(${i}) ? datum.${ZT} : datum.${sz}`,h=l?qN(l):{field:sz},p=`datum.${YT}`,g=`max(1, ${i})`;let m,y,v,b,x;h.mult=.5,m={enter:y={opacity:cz,x:{signal:d,mult:.5,offset:c},y:h},update:v={opacity:fz,x:y.x,y:y.y},exit:{opacity:cz}};let _=null,w=null;e.fill||(_=t.symbolBaseFillColor,w=t.symbolBaseStrokeColor),HN(m,{fill:o("symbolFillColor",_),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",w),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),uz.forEach((t=>{e[t]&&(v[t]=y[t]={scale:e[t],field:QT})}));const k=kz({type:gz,role:uB,key:QT,from:f,clip:!!l||void 0,encode:m},n.symbols),A=qN(c);A.offset=o("labelOffset"),m={enter:y={opacity:cz,x:{signal:d,offset:A},y:h},update:v={opacity:fz,text:{field:XT},x:y.x,y:y.y},exit:{opacity:cz}},HN(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const E=kz({type:mz,role:sB,style:ez,key:QT,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:cz,height:l?qN(l):cz,opacity:cz},exit:{opacity:cz},update:v={opacity:fz,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(b=`ceil(item.mark.items.length / ${g})`,v.row.signal=`${p}%${b}`,v.column.signal=`floor(${p} / ${b})`,x={field:["row",p]}):(v.row.signal=`floor(${p} / ${g})`,v.column.signal=`${p} % ${g}`,x={field:p}),v.column.signal=`(${i})?${v.column.signal}:${p}`,yz({role:ZN,from:r={facet:{data:r,name:"value",groupby:YT}},encode:GN(m,a,lz),marks:[k,E],name:u,interactive:s,sort:x})}const Fz='item.orient === "left"',jz='item.orient === "right"',Mz=`(${Fz} || ${jz})`,$z=`datum.vgrad && ${Mz}`,Nz=xz('"top"','"bottom"','"middle"'),Bz=`datum.vgrad && ${jz} ? (${xz('"right"','"left"','"center"')}) : (${Mz} && !(datum.vgrad && ${Fz})) ? "left" : ${_z}`,Tz=`item._anchor || (${Mz} ? "middle" : "start")`,zz=`${$z} ? (${Fz} ? -90 : 90) : 0`,Rz=`${Mz} ? (datum.vgrad ? (${jz} ? "bottom" : "top") : ${Nz}) : "top"`;function Pz(e,t){let n;return we(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+Lz(e.path)+")":e.sphere&&(n="geoShape("+Lz(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function Lz(e){return we(e)&&e.signal?e.signal:Dt(e)}function Iz(e){const t=e.role||"";return t.indexOf("axis")&&t.indexOf("legend")&&t.indexOf("title")?e.type===dz?ZN:t||YN:t}function Uz(e){return{marktype:e.type,name:e.name||void 0,role:e.role||Iz(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function qz(e,t){return e&&e.signal?t.signalRef(e.signal):!1!==e}function Wz(e,t){const n=ys(e.type);n||oe("Unrecognized transform type: "+Dt(e.type));const r=SB(n.type.toLowerCase(),null,Hz(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(r)),r.metadata=n.metadata||{},r}function Hz(e,t,n){const r={},i=e.params.length;for(let o=0;oYz(e,t,n)))):Yz(e,r,n)}(e,t,n):"projection"===r?n.projectionRef(t[e.name]):e.array&&!zB(i)?i.map((t=>Vz(e,t,n))):Vz(e,i,n):void(e.required&&oe("Missing required "+Dt(t.type)+" parameter: "+Dt(e.name)))}function Vz(e,t,n){const r=e.type;if(zB(t))return Kz(r)?oe("Expression references can not be signals."):Qz(r)?n.fieldRef(t):eR(r)?n.compareRef(t):n.signalRef(t.signal);{const i=e.expr||Qz(r);return i&&Xz(t)?n.exprRef(t.expr,t.as):i&&Zz(t)?jB(t.field,t.as):Kz(r)?y$(t,n):Jz(r)?FB(n.getData(t).values):Qz(r)?jB(t):eR(r)?n.compareRef(t):t}}function Yz(e,t,n){const r=e.params.length;let i;for(let n=0;ne&&e.expr,Zz=e=>e&&e.field,Jz=e=>"data"===e,Kz=e=>"expr"===e,Qz=e=>"field"===e,eR=e=>"compare"===e;function tR(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:FB(t.getData(e.data).output)}function nR(e,t,n,r,i){this.scope=e,this.input=t,this.output=n,this.values=r,this.aggregate=i,this.index={}}function rR(e){return vt(e)?e:null}function iR(e,t,n){const r=NB(n.op,n.field);let i;if(t.ops){for(let e=0,n=t.as.length;enull==e?"null":e)).join(",")+"),0)",t);u.update=l.$expr,u.params=l.$params}function sR(e,t){const n=Iz(e),r=e.type===dz,i=e.from&&e.from.facet,o=e.overlap;let a,s,u,l,c,f,d,h=e.layout||n===ZN||n===XN;const p=n===YN||h||i,g=function(e,t,n){let r,i,o,a,s;return e?(r=e.facet)&&(t||oe("Only group marks can be faceted."),null!=r.field?a=s=tR(r,n):(e.data?s=FB(n.getData(e.data).aggregate):(o=Wz(rt({type:"aggregate",groupby:Ge(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=tR(r,n),a=s=FB(n.add(o))),i=n.keyRef(r.groupby,!0))):a=FB(n.add(QB(null,[{}]))),a||(a=tR(e,n)),{key:i,pulse:a,parent:s}}(e.from,r,t);s=t.add(tT({key:g.key||(e.key?jB(e.key):void 0),pulse:g.pulse,clean:!r}));const m=FB(s);s=u=t.add(QB({pulse:m})),s=t.add(lT({markdef:Uz(e),interactive:qz(e.interactive,t),clip:Pz(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:FB(s)}));const y=FB(s);s=l=t.add(nT(xB(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),s.params.parent=t.encode(),e.transform&&e.transform.forEach((e=>{const n=Wz(e,t),r=n.metadata;(r.generates||r.changes)&&oe("Mark transforms should not generate new data."),r.nomod||(l.params.mod=!0),n.params.pulse=FB(s),t.add(s=n)})),e.sort&&(s=t.add(_T({sort:t.compareRef(e.sort),pulse:FB(s)})));const v=FB(s);(i||h)&&(h=t.add(wT({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:v})),f=FB(h));const b=t.add(KB({mark:y,pulse:f||v}));d=FB(b),r&&(p&&(a=t.operators,a.pop(),h&&a.pop()),t.pushState(v,f||d,m),i?function(e,t,n){const r=e.from.facet,i=r.name,o=tR(r,t);let a;r.name||oe("Facet must have a name: "+Dt(r)),r.data||oe("Facet must reference a data set: "+Dt(r)),r.field?a=t.add(pT({field:t.fieldRef(r.field),pulse:o})):r.groupby?a=t.add(iT({key:t.keyRef(r.groupby),group:FB(t.proxy(n.parent)),pulse:o})):oe("Facet must specify groupby or field: "+Dt(r));const s=t.fork(),u=s.add(QB()),l=s.add(xT({pulse:FB(u)}));s.addData(i,new nR(s,u,u,l)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(e).toRuntime()}}(e,t,g):p?function(e,t,n){const r=t.add(pT({pulse:n.pulse})),i=t.fork();i.add(xT()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(e).toRuntime()}}(e,t,g):t.parse(e),t.popState(),p&&(h&&a.push(h),a.push(b))),o&&(d=function(e,t,n){const r=e.method,i=e.bound,o=e.separation,a={separation:zB(o)?n.signalRef(o.signal):o,method:zB(r)?n.signalRef(r.signal):r,pulse:t};if(e.order&&(a.sort=n.compareRef({field:e.order})),i){const e=i.tolerance;a.boundTolerance=zB(e)?n.signalRef(e.signal):+e,a.boundScale=n.scaleRef(i.scale),a.boundOrient=i.orient}return FB(n.add(dT(a)))}(o,d,t));const x=t.add(vT({pulse:d})),_=t.add(xT({pulse:FB(x)},void 0,t.parent()));null!=e.name&&(c=e.name,t.addData(c,new nR(t,u,x,_)),e.on&&e.on.forEach((e=>{(e.insert||e.remove||e.toggle)&&oe("Marks only support modify triggers."),aR(e,t,c)})))}function uR(e,t,n){const r={enter:{},update:{}};return HN(r,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),r}function lR(e,t,n){return t[e]?`scale("${t[e]}",datum)`:bz(e,n[0].encode)}nR.fromEntries=function(e,t){const n=t.length,r=t[n-1],i=t[n-2];let o=t[0],a=null,s=1;for(o&&"load"===o.type&&(o=t[1]),e.add(t[0]);se===qT||e===LT,gR=(e,t,n)=>zB(e)?wR(e.signal,t,n):e===IT||e===LT?t:n,mR=(e,t,n)=>zB(e)?xR(e.signal,t,n):pR(e)?t:n,yR=(e,t,n)=>zB(e)?_R(e.signal,t,n):pR(e)?n:t,vR=(e,t,n)=>zB(e)?kR(e.signal,t,n):e===LT?{value:t}:{value:n},bR=(e,t,n)=>zB(e)?AR(e.signal,t,n):e===UT?{value:t}:{value:n},xR=(e,t,n)=>ER(`${e} === '${LT}' || ${e} === '${qT}'`,t,n),_R=(e,t,n)=>ER(`${e} !== '${LT}' && ${e} !== '${qT}'`,t,n),wR=(e,t,n)=>DR(`${e} === '${IT}' || ${e} === '${LT}'`,t,n),kR=(e,t,n)=>DR(`${e} === '${LT}'`,t,n),AR=(e,t,n)=>DR(`${e} === '${UT}'`,t,n),ER=(e,t,n)=>(t=null!=t?qN(t):t,n=null!=n?qN(n):n,OR(t)&&OR(n)?{signal:`${e} ? (${t=t?t.signal||Dt(t.value):null}) : (${n=n?n.signal||Dt(n.value):null})`}:[rt({test:e},t)].concat(n||[])),OR=e=>null==e||1===Object.keys(e).length,DR=(e,t,n)=>({signal:`${e} ? (${CR(t)}) : (${CR(n)})`}),SR=(e,t,n,r,i)=>({signal:(null!=r?`${e} === '${IT}' ? (${CR(r)}) : `:"")+(null!=n?`${e} === '${qT}' ? (${CR(n)}) : `:"")+(null!=i?`${e} === '${UT}' ? (${CR(i)}) : `:"")+(null!=t?`${e} === '${LT}' ? (${CR(t)}) : `:"")+"(null)"}),CR=e=>zB(e)?e.signal:null==e?null:Dt(e),FR=(e,t)=>0===t?0:zB(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},jR=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function MR(e,t,n,r){let i;if(t&&st(t,e))return t[e];if(st(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=e[5].toLowerCase()+e.slice(6)}return r[tz][i]}if(e.startsWith("label")){switch(e){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=e[5].toLowerCase()+e.slice(6)}return r[ez][i]}return null}function $R(e){const t={};for(const n of e)if(n)for(const e in n)t[e]=1;return Object.keys(t)}function NR(e,t){return{scale:e.scale,range:t}}function BR(e,t,n,r,i){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+r+","+i+")"}}function TR(e,t){const n=function(e,t){var n,r,i,o=t.config,a=o.style,s=o.axis,u="band"===t.scaleType(e.scale)&&o.axisBand,l=e.orient;if(zB(l)){const e=$R([o.axisX,o.axisY]),t=$R([o.axisTop,o.axisBottom,o.axisLeft,o.axisRight]);for(i of(n={},e))n[i]=mR(l,MR(i,o.axisX,s,a),MR(i,o.axisY,s,a));for(i of(r={},t))r[i]=SR(l.signal,MR(i,o.axisTop,s,a),MR(i,o.axisBottom,s,a),MR(i,o.axisLeft,s,a),MR(i,o.axisRight,s,a))}else n=l===LT||l===qT?o.axisX:o.axisY,r=o["axis"+l[0].toUpperCase()+l.slice(1)];return n||r||u?rt({},s,n,r,u):s}(e,t),r=e.encode||{},i=r.axis||{},o=i.name||void 0,a=i.interactive,s=i.style,u=vz(e,n),l=function(e){const t=e("tickBand");let n,r,i=e("tickOffset");return t?t.signal?(n={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},we(i)||(i={signal:`(${t.signal}) === 'extent' ? 0 : ${i}`})):"extent"===t?(n=1,r=!0,i=0):(n=.5,r=!1):(n=e("bandPosition"),r=e("tickExtra")),{extra:r,band:n,offset:i}}(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:null!=e.title},f=FB(t.add(QB({},[c]))),d=FB(t.add(JB({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(function(e,t,n,r,i){const o=vz(e,t),a=e.orient,s=e.gridScale,u=gR(a,1,-1),l=function(e,t){if(1===t);else if(we(e)){let n=e=rt({},e);for(;null!=n.mult;){if(!we(n.mult))return n.mult=zB(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n=n.mult=rt({},n.mult)}n.mult=t}else e=zB(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);return e}(e.offset,u);let c,f,d;const h={enter:c={opacity:cz},update:d={opacity:fz},exit:f={opacity:cz}};HN(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:e.scale,field:QT,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=mR(a,{signal:"height"},{signal:"width"}),m=s?{scale:s,range:0,mult:u,offset:l}:{value:0,offset:l},y=s?{scale:s,range:1,mult:u,offset:l}:rt(g,{mult:u,offset:l});return c.x=d.x=mR(a,p,m),c.y=d.y=yR(a,p,m),c.x2=d.x2=yR(a,y),c.y2=d.y2=mR(a,y),f.x=mR(a,p),f.y=yR(a,p),kz({type:pz,role:QN,key:QT,from:r,encode:h},n)}(e,n,r.grid,d,l)),c.ticks&&(p=u("tickSize"),h.push(function(e,t,n,r,i,o){const a=vz(e,t),s=e.orient,u=gR(s,-1,1);let l,c,f;const d={enter:l={opacity:cz},update:f={opacity:fz},exit:c={opacity:cz}};HN(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=qN(i);h.mult=u;const p={scale:e.scale,field:QT,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=l.y=mR(s,cz,p),f.y2=l.y2=mR(s,h),c.x=mR(s,p),f.x=l.x=yR(s,cz,p),f.x2=l.x2=yR(s,h),c.y=yR(s,p),kz({type:pz,role:tB,key:QT,from:r,encode:d},n)}(e,n,r.ticks,d,p,l))),c.labels&&(p=c.ticks?p:0,h.push(function(e,t,n,r,i,o){const a=vz(e,t),s=e.orient,u=e.scale,l=gR(s,-1,1),c=LB(a("labelFlush")),f=LB(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let p,g=0===c||!!c;const m=qN(i);m.mult=l,m.offset=qN(a("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:QT,band:.5,offset:wz(o.offset,a("labelOffset"))},v=mR(s,g?BR(u,c,'"left"','"right"','"center"'):{value:"center"},bR(s,"left","right")),b=mR(s,vR(s,"bottom","top"),g?BR(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=BR(u,c,`-(${f})`,f,0);g=g&&f;const _={opacity:cz,x:mR(s,y,m),y:yR(s,y,m)},w={enter:_,update:p={opacity:fz,text:{field:XT},x:_.x,y:_.y,align:v,baseline:b},exit:{opacity:cz,x:_.x,y:_.y}};HN(w,{dx:!d&&g?mR(s,x):null,dy:!h&&g?yR(s,x):null}),HN(w,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:d,baseline:h});const k=a("labelBound");let A=a("labelOverlap");return A=A||k?{separation:a("labelSeparation"),method:A,order:"datum.index",bound:k?{scale:u,orient:s,tolerance:k}:null}:void 0,p.align!==v&&(p.align=jR(p.align,v)),p.baseline!==b&&(p.baseline=jR(p.baseline,b)),kz({type:mz,role:eB,style:ez,key:QT,from:r,encode:w,overlap:A},n)}(e,n,r.labels,d,p,l))),c.domain&&h.push(function(e,t,n,r){const i=vz(e,t),o=e.orient;let a,s;const u={enter:a={opacity:cz},update:s={opacity:fz},exit:{opacity:cz}};HN(u,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const l=NR(e,0),c=NR(e,1);return a.x=s.x=mR(o,l,cz),a.x2=s.x2=mR(o,c),a.y=s.y=yR(o,l,cz),a.y2=s.y2=yR(o,c),kz({type:pz,role:KN,from:r,encode:u},n)}(e,n,r.domain,f)),c.title&&h.push(function(e,t,n,r){const i=vz(e,t),o=e.orient,a=gR(o,-1,1);let s,u;const l={enter:s={opacity:cz,anchor:qN(i("titleAnchor",null)),align:{signal:_z}},update:u=rt({},s,{opacity:fz,text:qN(e.title)}),exit:{opacity:cz}},c={signal:`lerp(range("${e.scale}"), ${xz(0,1,.5)})`};return u.x=mR(o,c),u.y=yR(o,c),s.angle=mR(o,cz,FR(a,90)),s.baseline=mR(o,vR(o,qT,LT),{value:qT}),u.angle=s.angle,u.baseline=s.baseline,HN(l,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),function(e,t,n,r){const i=(e,t)=>null!=e?(n.update[t]=jR(qN(e),n.update[t]),!1):!VN(t,r),o=i(e("titleX"),"x"),a=i(e("titleY"),"y");n.enter.auto=a===o?qN(a):mR(t,qN(a),qN(o))}(i,o,l,n),l.update.align=jR(l.update.align,s.align),l.update.angle=jR(l.update.angle,s.angle),l.update.baseline=jR(l.update.baseline,s.baseline),kz({type:mz,role:nB,style:tz,from:r,encode:l},n)}(e,n,r.title,f)),sR(yz({role:JN,from:f,encode:GN(zR(u,e),i,lz),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:a,style:s}),t)}function zR(e,t){const n={enter:{},update:{}};return HN(n,{orient:e("orient"),offset:e("offset")||0,position:PB(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function RR(e,t,n){const r=Ge(e.signals),i=Ge(e.scales);return n||r.forEach((e=>OB(e,t))),Ge(e.projections).forEach((e=>function(e,t){const n=t.config.projection||{},r={};for(const n in e)"name"!==n&&(r[n]=PT(e[n],n,t));for(const e in n)null==r[e]&&(r[e]=PT(n[e],e,t));t.addProjection(e.name,r)}(e,t))),i.forEach((e=>function(e,t){const n=e.type||"linear";Vp(n)||oe("Unrecognized scale type: "+Dt(n)),t.addScale(e.name,{type:n,domain:void 0})}(e,t))),Ge(e.data).forEach((e=>function(e,t){const n=[];e.transform&&e.transform.forEach((e=>{n.push(Wz(e,t))})),e.on&&e.on.forEach((n=>{aR(n,t,e.name)})),t.addDataPipeline(e.name,function(e,t,n){const r=[];let i,o,a,s,u,l=null,c=!1,f=!1;for(e.values?zB(e.values)||RB(e.format)?(r.push(hR(t,e)),r.push(l=dR())):r.push(l=dR({$ingest:e.values,$format:e.format})):e.url?RB(e.url)||RB(e.format)?(r.push(hR(t,e)),r.push(l=dR())):r.push(l=dR({$request:e.url,$format:e.format})):e.source&&(l=i=Ge(e.source).map((e=>FB(t.getData(e).output))),r.push(null)),o=0,a=n.length;oOT(e,t))),(n||r).forEach((e=>function(e,t){const n=t.getSignal(e.name);let r=e.update;e.init&&(r?oe("Signals can not include both init and update expressions."):(r=e.init,n.initonly=!0)),r&&(r=y$(r,t),n.update=r.$expr,n.params=r.$params),e.on&&e.on.forEach((e=>function(e,t,n){const r=e.encode,i={target:n};let o=e.events,a=e.update,s=[];o||oe("Signal update missing events specification."),vt(o)&&(o=BN(o,t.isSubscope()?BB:TB)),o=Ge(o).filter((e=>e.signal||e.scale?(s.push(e),0):1)),s.length>1&&(s=[YB(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),null!=r&&(a&&oe("Signal encode and update are mutually exclusive."),a="encode(item(),"+Dt(r)+")"),i.update=vt(a)?y$(a,t):null!=a.expr?y$(a.expr,t):null!=a.value?a.value:null!=a.signal?{$expr:VB,$params:{$value:t.signalRef(a.signal)}}:oe("Invalid signal update specification."),e.force&&(i.options={force:!0}),s.forEach((e=>t.addUpdate(rt(function(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):UB(e,t)}}(e,t),i))))}(e,t,n.id)))}(e,t))),Ge(e.axes).forEach((e=>TR(e,t))),Ge(e.marks).forEach((e=>sR(e,t))),Ge(e.legends).forEach((e=>function(e,t){const n=t.config.legend,r=e.encode||{},i=vz(e,n),o=r.legend||{},a=o.name||void 0,s=o.interactive,u=o.style,l={};let c,f,d,h=0;uz.forEach((t=>e[t]?(l[t]=e[t],h=h||e[t]):0)),h||oe("Missing valid scale for legend.");const p=function(e,t){let n=e.type||iz;return e.type||1!==function(e){return uz.reduce(((t,n)=>t+(e[n]?1:0)),0)}(e)||!e.fill&&!e.stroke||(n=Xp(t)?oz:Jp(t)?az:iz),n!==oz?n:Jp(t)?az:oz}(e,t.scaleType(h)),g={title:null!=e.title,scales:l,type:p,vgrad:"symbol"!==p&&i.isVertical()},m=FB(t.add(QB(null,[g]))),y=FB(t.add(sT(f={type:p,scale:t.scaleRef(h),count:t.objectProperty(i("tickCount")),limit:t.property(i("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===oz?(d=[Az(e,h,n,r.gradient),Sz(e,n,r.labels,y)],f.count=f.count||t.signalRef(`max(2,2*floor((${LB(i.gradientLength())})/100))`)):p===az?d=[Ez(e,h,n,r.gradient,y),Sz(e,n,r.labels,y)]:(c=function(e,t){const n=vz(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(e,n),d=[Cz(e,n,r,y,LB(c.columns))],f.size=function(e,t,n){const r=LB(lR("size",e,n)),i=LB(lR("strokeWidth",e,n)),o=LB(function(e,t,n){return bz("fontSize",e)||function(e,t,n){const r=t.config.style[n];return r&&r.fontSize}(0,t,n)}(n[1].encode,t,ez));return y$(`max(ceil(sqrt(${r})+${i}),${o})`,t)}(e,t,d[0].marks)),d=[yz({role:oB,from:m,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:c,interactive:s})],g.title&&d.push(function(e,t,n,r){const i=vz(e,t),o={enter:{opacity:cz},update:{opacity:fz,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:cz}};return HN(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:Tz},angle:{signal:zz},align:{signal:Bz},baseline:{signal:Rz},text:e.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),kz({type:mz,role:lB,style:tz,from:r,encode:o},n)}(e,n,r.title,m)),sR(yz({role:rB,from:m,encode:GN(uR(i,e,n),o,lz),marks:d,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:a,interactive:s,style:u}),t)}(e,t))),e.title&&function(e,t){const n=vz(e=vt(e)?{text:e}:e,t.config.title),r=e.encode||{},i=r.group||{},o=i.name||void 0,a=i.interactive,s=i.style,u=[],l=FB(t.add(QB(null,[{}])));u.push(function(e,t,n,r){const i={value:0},o={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return HN(o,{text:e.text,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),kz({type:mz,role:fB,style:nz,from:r,encode:o},n)}(e,n,function(e){const t=e.encode;return t&&t.title||rt({name:e.name,interactive:e.interactive,style:e.style},t)}(e),l)),e.subtitle&&u.push(function(e,t,n,r){const i={value:0},o={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return HN(o,{text:e.subtitle,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),kz({type:mz,role:dB,style:rz,from:r,encode:o},n)}(e,n,r.subtitle,l)),sR(yz({role:cB,from:l,encode:fR(n,i),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:a,style:s}),t)}(e.title,t),t.parseLambdas(),t}const PR=e=>GN({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function LR(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function IR(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function UR(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}function qR(e){return(_e(e)?WR:HR)(e)}function WR(e){const t=e.length;let n="[";for(let r=0;r0?",":"")+(we(t)?t.signal||qR(t):Dt(t))}return n+"]"}function HR(e){let t,n,r="{",i=0;for(t in e)n=e[t],r+=(++i>1?",":"")+Dt(t)+":"+(we(n)?n.signal||qR(n):Dt(n));return r+"}"}function GR(e,t,n){return we(e)||oe("Input Vega specification must be an object."),t=Ae(function(){const e="sans-serif",t="#4c78a8",n="#000",r="#888",i="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:t},area:{fill:t},image:null,line:{stroke:t,strokeWidth:2},path:{stroke:t},rect:{fill:t},rule:{stroke:n},shape:{stroke:t},symbol:{fill:t,size:64},text:{fill:n,font:e,fontSize:11},trail:{fill:t,size:2},style:{"guide-label":{fill:n,font:e,fontSize:10},"guide-title":{fill:n,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:n,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:n,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:i},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:r,grid:!1,gridWidth:1,gridColor:i,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:r,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:i,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:r,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}(),t,e.config),function(e,t){const n=t.config,r=FB(t.root=t.add(CB())),i=function(e,t){const n=n=>PB(e[n],t[n]),r=[LR("background",n("background")),LR("autosize",PN(n("autosize"))),LR("padding",UN(n("padding"))),LR("width",n("width")||0),LR("height",n("height")||0)],i=r.reduce(((e,t)=>(e[t.name]=t,e)),{}),o={};return Ge(e.signals).forEach((e=>{st(i,e.name)?e=rt(i[e.name],e):r.push(e),o[e.name]=e})),Ge(t.signals).forEach((e=>{st(o,e.name)||st(i,e.name)||r.push(e)})),r}(e,n);i.forEach((e=>OB(e,t))),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const o=t.add(QB()),a=t.add(nT(xB(PR(e.encode),dz,XN,e.style,t,{pulse:FB(o)}))),s=t.add(wT({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:r,pulse:FB(a)}));t.operators.pop(),t.pushState(FB(a),FB(s),null),RR(e,t,i),t.operators.push(s);let u=t.add(KB({mark:r,pulse:FB(s)}));return u=t.add(vT({pulse:FB(u)})),u=t.add(xT({pulse:FB(u)})),t.addData("root",new nR(t,o,o,u)),t}(e,new IR(t,n)).toRuntime()}IR.prototype=UR.prototype={parse(e){return RR(e,this)},fork(){return new UR(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach((t=>{t.$ref=e.id})),e.refs=null),e},proxy(e){const t=e instanceof DB?FB(e):e;return this.add(mT({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;for(e in this.root&&(this.root.root=!0),this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(e,t,n){let r,i;e&&(r=e.data||(e.data={}),i=r[t]||(r[t]=[]),i.push(n))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const r in t.index)n(t.index[r],e,"index:"+r)}return this},pushState(e,t,n){this._encode.push(FB(this.add(xT({pulse:e})))),this._parent.push(t),this._lookup.push(n?FB(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return De(this._parent)},encode(){return De(this._encode)},lookup(){return De(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(vt(e))return jB(e,t);e.signal||oe("Unsupported field reference: "+Dt(e));const n=e.signal;let r=this.field[n];if(!r){const e={name:this.signalRef(n)};t&&(e.as=t),this.field[n]=r=FB(this.add(oT(e)))}return r},compareRef(e){let t=!1;const n=e=>zB(e)?(t=!0,this.signalRef(e.signal)):function(e){return e&&e.expr}(e)?(t=!0,this.exprRef(e.expr)):e,r=Ge(e.field).map(n),i=Ge(e.order).map(n);return t?FB(this.add(eT({fields:r,orders:i}))):$B(r,i)},keyRef(e,t){let n=!1;const r=this.signals;return e=Ge(e).map((e=>zB(e)?(n=!0,FB(r[e.signal])):e)),n?FB(this.add(aT({fields:e,flat:t}))):function(e,t){const n={$key:e};return t&&(n.$flat=!0),n}(e,t)},sortRef(e){if(!e)return e;const t=NB(e.op,e.field),n=e.order||"ascending";return n.signal?FB(this.add(eT({fields:t,orders:this.signalRef(n.signal)}))):$B(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:e,type:t}),this.events[n]=r}return this.events[n]},hasOwnSignal(e){return st(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&oe("Duplicate signal name: "+Dt(e));const n=t instanceof DB?t:this.add(CB(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||oe("Unrecognized signal name: "+Dt(e)),this.signals[e]},signalRef(e){return this.signals[e]?FB(this.signals[e]):(st(this.lambdas,e)||(this.lambdas[e]=this.add(CB(null))),FB(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;te*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>ee<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},ZR={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const JR=Array.prototype.slice,KR=(e,t,n)=>{const r=n?n(t[0]):t[0];return r[e].apply(r,JR.call(t,1))};var QR={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:(e,t,n,r,i,o,a)=>new Date(e,t||0,null!=n?n:1,r||0,i||0,o||0,a||0),date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return KR("join",arguments)},indexof:function(){return KR("indexOf",arguments)},lastindexof:function(){return KR("lastIndexOf",arguments)},slice:function(){return KR("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return KR("substring",arguments,String)},split:function(){return KR("split",arguments,String)},replace:function(){return KR("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const eP=["view","item","group","xy","x","y"],tP=new Set([Function,eval,setTimeout,setInterval]);"function"==typeof setImmediate&&tP.add(setImmediate);const nP={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:"datum"===n?e.datum:"event"===n?e.event:"item"===n?e.item:YR[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,r=e(t.object);n&&(e.memberDepth+=1);const i=e(t.property);if(n&&(e.memberDepth-=1),!tP.has(r[i]))return r[i];console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`)},CallExpression:(e,t)=>{const n=t.arguments;let r=t.callee.name;return r.startsWith("_")&&(r=r.slice(1)),"if"===r?e(n[0])?e(n[1]):e(n[2]):(e.fn[r]||QR[r]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>XR[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>ZR[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>"&&"===t.operator?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce(((t,n)=>{e.memberDepth+=1;const r=e(n.key);return e.memberDepth-=1,tP.has(e(n.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):t[r]=e(n.value),t}),{})};function rP(e,t,n,r,i,o){const a=e=>nP[e.type](a,e);return a.memberDepth=0,a.fn=Object.create(t),a.params=n,a.datum=r,a.event=i,a.item=o,eP.forEach((e=>a.fn[e]=function(){return i.vega[e](...arguments)})),a(e)}var iP={operator(e,t){const n=t.ast,r=e.functions;return e=>rP(n,r,e)},parameter(e,t){const n=t.ast,r=e.functions;return(e,t)=>rP(n,r,t,e)},event(e,t){const n=t.ast,r=e.functions;return e=>rP(n,r,void 0,void 0,e)},handler(e,t){const n=t.ast,r=e.functions;return(e,t)=>{const i=t.item&&t.item.datum;return rP(n,r,e,i,t)}},encode(e,t){const{marktype:n,channels:r}=t,i=e.functions,o="group"===n||"image"===n||"rect"===n;return(e,t)=>{const a=e.datum;let s,u=0;for(const n in r)s=rP(r[n].ast,i,t,a,void 0,e),e[n]!==s&&(e[n]=s,u=1);return"rule"!==n&&function(e,t,n){let r;t.x2&&(t.x?(n&&e.x>e.x2&&(r=e.x,e.x=e.x2,e.x2=r),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(r=e.y,e.y=e.y2,e.y2=r),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}(e,r,o),u}}};const oP={i8:"4.17.0"};function aP(e,t,n){return e.fields=t||[],e.fname=n,e}function sP(e){return 1===e.length?uP(e[0]):lP(e)}const uP=e=>function(t){return t[e]},lP=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),s=r=i+1):"]"===o&&(s||cP("Access path missing open bracket: "+e),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&cP("Access path missing closing bracket: "+e),a&&cP("Access path missing closing quote: "+e),i>r&&(i++,l()),t}!function(e,t,n){const r=fP(e);e=1===r.length?r[0]:e,aP((n&&n.get||sP)(r),[e],t||e)}("id");const dP=aP((e=>e),[],"identity");function hP(e,t,n){const r=[t].concat([].slice.call(n));console[e].apply(console,r)}aP((()=>0),[],"zero"),aP((()=>1),[],"one"),aP((()=>!0),[],"true"),aP((()=>!1),[],"false");var pP=Array.isArray;function gP(e){return e===Object(e)}const mP=e=>"__proto__"!==e;function yP(...e){return e.reduce(((e,t)=>{for(const n in t)if("signals"===n)e.signals=bP(e.signals,t.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;vP(e,n,t[n],r)}return e}),{})}function vP(e,t,n,r){if(!mP(t))return;let i,o;if(gP(n)&&!pP(n))for(i in o=gP(e[t])?e[t]:e[t]={},n)r&&(!0===r||r[i])?vP(o,i,n[i]):mP(i)&&(o[i]=n[i]);else e[t]=n}function bP(e,t){if(null==e)return t;const n={},r=[];function i(e){n[e.name]||(n[e.name]=1,r.push(e))}return t.forEach(i),e.forEach(i),r}function xP(e){return null!=e?pP(e)?e:[e]:[]}const _P=Object.prototype.hasOwnProperty;function wP(e,t){return _P.call(e,t)}function kP(e){return"boolean"==typeof e}function AP(e){return"number"==typeof e}function EP(e){return"string"==typeof e}function OP(e){return pP(e)?"["+e.map(OP)+"]":gP(e)||EP(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function DP(e){const t={},n=e.length;for(let r=0;rRP(e,t)))}:NP(e)?{or:e.or.map((e=>RP(e,t)))}:t(e)}const PP=jP(),LP=CP();function IP(e,t){const n={};for(const r of t)wP(e,r)&&(n[r]=e[r]);return n}function UP(e,t){const n=Object.assign({},e);for(const e of t)delete n[e];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map((e=>$P()(e))).join(",")})`};const qP=$P();function WP(e){if(AP(e))return e;const t=EP(e)?e:$P()(e);if(t.length<250)return t;let n=0;for(let e=0;e-1}function VP(e,t){let n=0;for(const[r,i]of e.entries())if(t(i,r,n++))return!0;return!1}function YP(e,t){let n=0;for(const[r,i]of e.entries())if(!t(i,r,n++))return!1;return!0}function XP(e,...t){for(const n of t)ZP(e,null!=n?n:{});return e}function ZP(e,t){for(const n of iL(t))vP(e,n,t[n],!0)}function JP(e,t){const n=[],r={};let i;for(const o of e)i=t(o),i in r||(r[i]=1,n.push(o));return n}function KP(e,t){const n=iL(e),r=iL(t);if(n.length!==r.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function QP(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function eL(e,t){for(const n of e)if(t.has(n))return!0;return!1}function tL(e){const t=new Set;for(const n of e){const e=fP(n).map(((e,t)=>0===t?e:`[${e}]`)),r=e.map(((t,n)=>e.slice(0,n+1).join("")));for(const e of r)t.add(e)}return t}function nL(e,t){return void 0===e||void 0===t||eL(tL(e),tL(t))}function rL(e){return 0===iL(e).length}const iL=Object.keys,oL=Object.values,aL=Object.entries;function sL(e){return!0===e||!1===e}function uL(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function lL(e,t){return TP(e)?"!("+lL(e.not,t)+")":BP(e)?"("+e.and.map((e=>lL(e,t))).join(") && (")+")":NP(e)?"("+e.or.map((e=>lL(e,t))).join(") || (")+")":t(e)}function cL(e,t){if(0===t.length)return!0;const n=t.shift();return n in e&&cL(e[n],t)&&delete e[n],rL(e)}function fL(e){return e.charAt(0).toUpperCase()+e.substr(1)}function dL(e,t="datum"){const n=fP(e),r=[];for(let e=1;e<=n.length;e++){const i=`[${n.slice(0,e).map(OP).join("][")}]`;r.push(`${t}${i}`)}return r.join(" && ")}function hL(e,t="datum"){return`${t}[${OP(fP(e).join("."))}]`}function pL(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function gL(e){return`${fP(e).map(pL).join("\\.")}`}function mL(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function yL(e){return`${fP(e).join(".")}`}function vL(e){return e?fP(e).length:0}function bL(...e){for(const t of e)if(void 0!==t)return t}let xL=42;function _L(e){const t=++xL;return e?String(e)+t:t}function wL(){xL=42}function kL(e){return AL(e)?e:`__${e}`}function AL(e){return 0===e.indexOf("__")}function EL(e){if(void 0!==e)return(e%360+360)%360}function OL(e){return!!AP(e)||!isNaN(e)&&!isNaN(parseFloat(e))}const DL={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function SL(e){return e&&e.condition}const CL=["domain","grid","labels","ticks","title"],FL={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"main",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},jL={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},ML=Object.assign(Object.assign({},jL),{style:1,labelExpr:1,encoding:1});function $L(e){return!!ML[e]}iL(ML);const NL=iL({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1}),BL={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},TL={count:1,min:1,max:1};function zL(e){return!!e&&!!e.argmin}function RL(e){return!!e&&!!e.argmax}function PL(e){return EP(e)&&!!BL[e]}iL(BL);const LL=["count","valid","missing","distinct"];function IL(e){return EP(e)&&GP(LL,e)}const UL=["count","sum","distinct","valid","missing"],qL=DP(["mean","average","median","q1","q3","min","max"]);var WL=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);izU(e[t])?uL(`_${t}_${aL(e[t])}`):uL(`_${t}_${e[t]}`))).join("")}function NU(e){return!0===e||TU(e)&&!e.binned}function BU(e){return"binned"===e||TU(e)&&!0===e.binned}function TU(e){return gP(e)}function zU(e){return null==e?void 0:e.selection}function RU(e){switch(e){case HL:case GL:case cI:case aI:case sI:case uI:case gI:case dI:case hI:case pI:case lI:return 6;case mI:return 4;default:return 10}}function PU(e){return`Invalid specification ${JSON.stringify(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const LU='Autosize "fit" only works for single views and layered views.';function IU(e){return("width"==e?"Width":"Height")+' "container" only works for single views and layered views.'}function UU(e){return`${"width"==e?"Width":"Height"} "container" only works well with autosize "fit" or "fit-${"width"==e?"x":"y"}".`}function qU(e){return e?`Dropping "fit-${e}" because spec has discrete ${XI(e)}.`:'Dropping "fit" because spec has discrete size.'}function WU(e){return`Unknown field for ${e}. Cannot calculate view size.`}function HU(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function GU(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function VU(e){return`Selection not supported for ${e} yet.`}function YU(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}function XU(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}function ZU(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function JU(e){return`Invalid field type "${e}".`}function KU(e,t){const{fill:n,stroke:r}=t;return`Dropping color ${e} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function QU(e,t){return`Dropping ${qP(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}function eq(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function tq(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function nq(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${"ordinal"===t?"order":"magnitude"}.`}function rq(e){return`Using unaggregated domain with raw field has no effect (${qP(e)}).`}function iq(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function oq(e){return`Unaggregated domain is currently unsupported for log scale (${qP(e)}).`}function aq(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function sq(e){return`The step for "${e}" is dropped because the ${"width"===e?"x":"y"} is continuous.`}const uq="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";function lq(e,t){return`Invalid ${e}: ${qP(t)}.`}function cq(e){return`1D error band does not support ${e}.`}function fq(e){return`Channel ${e} is required for "binned" bin.`}const dq=function(e,t){let n=2;return{level(e){return arguments.length?(n=+e,this):n},error(){return n>=1&&hP("error","ERROR",arguments),this},warn(){return n>=2&&hP("warn","WARN",arguments),this},info(){return n>=3&&hP("log","INFO",arguments),this},debug(){return n>=4&&hP("log","DEBUG",arguments),this}}}();let hq=dq;function pq(...e){hq.warn(...e)}function gq(e){if(e&&gP(e))for(const t of Aq)if(t in e)return!0;return!1}new WeakMap;const mq=["january","february","march","april","may","june","july","august","september","october","november","december"],yq=mq.map((e=>e.substr(0,3))),vq=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],bq=vq.map((e=>e.substr(0,3)));function xq(e,t){const n=[];if(t&&void 0!==e.day&&iL(e).length>1&&(pq(function(e){return`Dropping day from datetime ${qP(e)} as day cannot be combined with other units.`}(e)),delete(e=LP(e)).day),void 0!==e.year?n.push(e.year):n.push(2012),void 0!==e.month){const r=t?function(e){if(OL(e)&&(e=+e),AP(e))return e-1;{const t=e.toLowerCase(),n=mq.indexOf(t);if(-1!==n)return n;const r=t.substr(0,3),i=yq.indexOf(r);if(-1!==i)return i;throw new Error(lq("month",e))}}(e.month):e.month;n.push(r)}else if(void 0!==e.quarter){const r=t?function(e){if(OL(e)&&(e=+e),AP(e))return e>4&&pq(lq("quarter",e)),e-1;throw new Error(lq("quarter",e))}(e.quarter):e.quarter;n.push(AP(r)?3*r:r+"*3")}else n.push(0);if(void 0!==e.date)n.push(e.date);else if(void 0!==e.day){const r=t?function(e){if(OL(e)&&(e=+e),AP(e))return e%7;{const t=e.toLowerCase(),n=vq.indexOf(t);if(-1!==n)return n;const r=t.substr(0,3),i=bq.indexOf(r);if(-1!==i)return i;throw new Error(lq("day",e))}}(e.day):e.day;n.push(AP(r)?r+1:r+"+1")}else n.push(1);for(const t of["hours","minutes","seconds","milliseconds"]){const r=e[t];n.push(void 0===r?0:r)}return n}function _q(e){const t=xq(e,!0).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}var wq=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0&&"seconds"===t&&"i"===e.charAt(n-1)||e.length>n+3&&"day"===t&&"o"===e.charAt(n+3)||n>0&&"year"===t&&"f"===e.charAt(n-1))}function Cq(e){if(!e)return;const t=Dq(e);return`timeUnitSpecifier(${$P()(t)}, ${$P()(Oq)})`}function Fq(e){if(!e)return;let t;return EP(e)?t={unit:e}:gP(e)&&(t=Object.assign(Object.assign({},e),e.unit?{unit:e.unit}:{})),Eq(t.unit)&&(t.utc=!0,t.unit=function(e){return e.substr(3)}(t.unit)),t}function jq(e){return e&&!!e.signal}function Mq(e){return!!e.step}function $q(e){return!pP(e)&&"field"in e&&"data"in e}const Nq=iL({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),Bq={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},Tq=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function zq(e){return e&&!!e.field&&void 0!==e.equal}function Rq(e){return e&&!!e.field&&void 0!==e.lt}function Pq(e){return e&&!!e.field&&void 0!==e.lte}function Lq(e){return e&&!!e.field&&void 0!==e.gt}function Iq(e){return e&&!!e.field&&void 0!==e.gte}function Uq(e){if(e&&e.field){if(pP(e.range)&&2===e.range.length)return!0;if(jq(e.range))return!0}return!1}function qq(e){return e&&!!e.field&&(pP(e.oneOf)||pP(e.in))}function Wq(e){return qq(e)||zq(e)||Uq(e)||Rq(e)||Lq(e)||Pq(e)||Iq(e)}function Hq(e,t){return hG(e,{timeUnit:t,wrapTime:!0})}function Gq(e,t=!0){var n;const{field:r}=e,i=null===(n=Fq(e.timeUnit))||void 0===n?void 0:n.unit,o=i?"time("+function(e,t,{end:n}={end:!1}){const r=dL(t),i=Eq(e)?"utc":"";let o;const a={};for(const t of Aq)Sq(e,t)&&(a[t]="quarter"===(s=t)?`(${i}quarter(${r})-1)`:`${i}${s}(${r})`,o=t);var s;return n&&(a[o]+="+1"),function(e){const t=xq(e,!1).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}(a)}(i,r)+")":XH(e,{expr:"datum"});if(zq(e))return o+"==="+Hq(e.equal,i);if(Rq(e))return`${o}<${Hq(e.lt,i)}`;if(Lq(e))return`${o}>${Hq(e.gt,i)}`;if(Pq(e))return`${o}<=${Hq(e.lte,i)}`;if(Iq(e))return`${o}>=${Hq(e.gte,i)}`;if(qq(e))return`indexof([${function(e,t){return e.map((e=>Hq(e,t)))}(e.oneOf,i).join(",")}], ${o}) !== -1`;if(function(e){return e&&!!e.field&&void 0!==e.valid}(e))return Vq(o,e.valid);if(Uq(e)){const{range:n}=e,r=jq(n)?{signal:`${n.signal}[0]`}:n[0],a=jq(n)?{signal:`${n.signal}[1]`}:n[1];if(null!==r&&null!==a&&t)return"inrange("+o+", ["+Hq(r,i)+", "+Hq(a,i)+"])";const s=[];return null!==r&&s.push(`${o} >= ${Hq(r,i)}`),null!==a&&s.push(`${o} <= ${Hq(a,i)}`),s.length>0?s.join(" && "):"true"}throw new Error(`Invalid field predicate: ${JSON.stringify(e)}`)}function Vq(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Yq(e){var t;return Wq(e)&&e.timeUnit?Object.assign(Object.assign({},e),{timeUnit:null===(t=Fq(e.timeUnit))||void 0===t?void 0:t.unit}):e}const Xq={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"},Zq=Xq.quantitative,Jq=Xq.ordinal,Kq=Xq.temporal,Qq=Xq.nominal,eW=Xq.geojson;iL(Xq);const tW={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},nW={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function rW(e,t){const n=nW[e],r=nW[t];return n===r||"ordinal-position"===n&&"time"===r||"ordinal-position"===r&&"time"===n}iL(nW);const iW={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function oW(e){return iW[e]}const aW=["linear","log","pow","sqrt","symlog","time","utc"],sW=DP(aW),uW=DP(["linear","log","pow","sqrt","symlog"]),lW=DP(["quantile","quantize","threshold"]),cW=DP(aW.concat(["quantile","quantize","threshold","sequential","identity"])),fW=DP(["ordinal","bin-ordinal","point","band"]);function dW(e){return e in fW}function hW(e){return e in cW}function pW(e){return e in sW}function gW(e){return e in lW}function mW(e){return null==e?void 0:e.selection}const yW={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:vW,domain:bW,range:xW,rangeMax:_W,rangeMin:wW,scheme:kW}=(iL(yW),yW),AW=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);iuL(`${"unit"===e?"":`_${e}_`}${r[e]}`))).join(""):(n?"utc":"")+"timeunit"+iL(r).map((e=>uL(`_${e}_${r[e]}`))).join("")}(f),s=(!GP(["range","mid"],t.binSuffix)&&t.binSuffix||"")+(null!==(i=t.suffix)&&void 0!==i?i:""))}a&&(o=o?`${a}_${o}`:a)}return s&&(o=`${o}_${s}`),a&&(o=`${a}_${o}`),t.forAs?yL(o):t.expr?hL(o,t.expr)+u:gL(o)+u}function ZH(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return TH(e)&&!!e.bin;case"temporal":return!1}throw new Error(JU(e.type))}function JH(e){return!ZH(e)}const KH=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return function(e){const{aggregate:t,bin:n,timeUnit:r,field:i}=e;if(RL(t))return`${i} for argmax(${t.argmax})`;if(zL(t))return`${i} for argmin(${t.argmin})`;const o=Fq(r),a=t||(null==o?void 0:o.unit)||(null==o?void 0:o.maxbins)&&"timeunit"||NU(n)&&"bin";return a?a.toUpperCase()+"("+i+")":i}(e);default:return function(e,t){var n;const{field:r,bin:i,timeUnit:o,aggregate:a}=e;if("count"===a)return t.countTitle;if(NU(i))return`${r} (binned)`;if(o){const e=null===(n=Fq(o))||void 0===n?void 0:n.unit;if(e)return`${r} (${Dq(e).join("-")})`}else if(a)return RL(a)?`${r} for max ${a.argmax}`:zL(a)?`${r} for min ${a.argmin}`:`${fL(a)} of ${r}`;return r}(e,t)}};let QH=KH;function eG(e){QH=e}function tG(e,t,{allowDisabling:n,includeDefault:r=!0}){var i,o;const a=null===(i=nG(e))||void 0===i?void 0:i.title;if(!TH(e))return a;const s=e,u=r?rG(s,t):void 0;return n?bL(a,s.title,u):null!==(o=null!=a?a:s.title)&&void 0!==o?o:u}function nG(e){return HH(e)&&e.axis?e.axis:GH(e)&&e.legend?e.legend:OH(e)&&e.header?e.header:void 0}function rG(e,t){return QH(e,t)}function iG(e){var t;if(VH(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}{const n=null!==(t=nG(e))&&void 0!==t?t:{},{format:r,formatType:i}=n;return{format:r,formatType:i}}}function oG(e){return TH(e)?e:NH(e)?e.condition:void 0}function aG(e){return IH(e)?e:BH(e)?e.condition:void 0}function sG(e,t,n,r={}){return EP(e)||AP(e)||kP(e)?(pq(function(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${qP(n)}}.`}(t,EP(e)?"string":AP(e)?"number":"boolean",e)),{value:e}):IH(e)?uG(e,t,n,r):BH(e)?Object.assign(Object.assign({},e),{condition:uG(e.condition,t,n,r)}):e}function uG(e,t,n,r){if(VH(e)){const{format:i,formatType:o}=e,a=SH(e,["format","formatType"]);if(sH(o)&&!n.customFormatTypes)return pq(ZU(t)),uG(a,t,n,r)}else{const i=HH(e)?"axis":GH(e)?"legend":OH(e)?"header":null;if(i&&e[i]){const o=e[i],{format:a,formatType:s}=o,u=SH(o,["format","formatType"]);if(sH(s)&&!n.customFormatTypes)return pq(ZU(t)),uG(Object.assign(Object.assign({},e),{[i]:u}),t,n,r)}}return TH(e)?lG(e,t,r):function(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=AP(n)?"quantitative":EP(n)?"nominal":gq(n)?"temporal":void 0,Object.assign(Object.assign({},e),{type:t})}(e)}function lG(e,t,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:a}=e,s=Object.assign({},e);if(n||!r||PL(r)||RL(r)||zL(r)||(pq(function(e){return`Invalid aggregation operator "${e}".`}(r)),delete s.aggregate),i&&(s.timeUnit=Fq(i)),a&&(s.field=`${a}`),NU(o)&&(s.bin=cG(o,t)),BU(o)&&!dU(t)&&pq(function(e){return`Channel ${e} should not be used with "binned" bin.`}(t)),UH(s)){const{type:e}=s,t=function(e){if(e)switch(e=e.toLowerCase()){case"q":case Zq:return"quantitative";case"t":case Kq:return"temporal";case"o":case Jq:return"ordinal";case"n":case Qq:return"nominal";case eW:return"geojson"}}(e);e!==t&&(s.type=t),"quantitative"!==e&&IL(r)&&(pq(function(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}(e,r)),s.type="quantitative")}else if(!HI(t)){const e=function(e,t){var n;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(FH(e)&&pP(e.sort))return"ordinal";const{aggregate:r,bin:i,timeUnit:o}=e;if(o)return"temporal";if(i||r&&!RL(r)&&!zL(r))return"quantitative";if(WH(e)&&(null===(n=e.scale)||void 0===n?void 0:n.type))switch(nW[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(s,t);s.type=e}if(UH(s)){const{compatible:e,warning:n}=function(e,t){const n=e.type;if("geojson"===n&&"shape"!==t)return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case HL:case GL:case VL:return JH(e)?{compatible:!1,warning:tq(t)}:fG;case YL:case XL:case aI:case sI:case uI:case yI:case bI:case xI:case _I:case wI:case kI:case fI:case eI:case KL:case AI:return fG;case rI:case oI:case nI:case iI:return n!==Zq?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:fG;case dI:case hI:case pI:case gI:case cI:case tI:case QL:case ZL:case JL:return"nominal"!==n||e.sort?fG:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case mI:return GP(["ordinal","nominal"],e.type)?fG:{compatible:!1,warning:"StrokeDash channel should be used with only discrete data."};case lI:return GP(["ordinal","nominal","geojson"],e.type)?fG:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case vI:return"nominal"!==e.type||"sort"in e?fG:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(s,t)||{};!1===e&&pq(n)}if(FH(s)&&EP(s.sort)){const{sort:e}=s;if(_H(e))return Object.assign(Object.assign({},s),{sort:{encoding:e}});const t=e.substr(1);if("-"===e.charAt(0)&&_H(t))return Object.assign(Object.assign({},s),{sort:{encoding:t,order:"descending"}})}if(OH(s)){const{header:e}=s,{orient:t}=e,n=SH(e,["orient"]);if(t)return Object.assign(Object.assign({},s),{header:Object.assign(Object.assign({},n),{labelOrient:e.labelOrient||t,titleOrient:e.titleOrient||t})})}return s}function cG(e,t){return kP(e)?{maxbins:RU(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:Object.assign(Object.assign({},e),{maxbins:RU(t)})}const fG={compatible:!0};function dG(e){const{formatType:t}=iG(e);return"time"===t||!t&&function(e){return e&&("temporal"===e.type||TH(e)&&!!e.timeUnit)}(e)}function hG(e,{timeUnit:t,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){var o;const a=t&&(null===(o=Fq(t))||void 0===o?void 0:o.unit);let s,u=a||"temporal"===n;return SW(e)?s=e.expr:jq(e)?s=e.signal:gq(e)?(u=!0,s=_q(e)):(EP(e)||AP(e))&&u&&(s=`datetime(${JSON.stringify(e)})`,function(e){return!!kq[e]}(a)&&(AP(e)&&e<1e4||EP(e)&&isNaN(Date.parse(e)))&&(s=_q({[a]:e}))),s?r&&u?`time(${s})`:s:i?void 0:JSON.stringify(e)}function pG(e,t){const{type:n}=e;return t.map((t=>{const r=hG(t,{timeUnit:TH(e)?e.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==r?{signal:r}:t}))}function gG(e,t){return NU(e.bin)?SU(t)&&GP(["ordinal","nominal"],e.type):(console.warn("Only call this method for binned field defs."),!1)}var mG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var r;return e.field.push(XH(n,t)),e.order.push(null!==(r=n.sort)&&void 0!==r?r:"ascending"),e}),{field:[],order:[]})}function MG(e,t){const n=[...e];return t.forEach((e=>{for(const t of n)if(PP(t,e))return;n.push(e)})),n}function $G(e,t){return PP(e,t)||!t?e:e?[...xP(e),...xP(t)].join(", "):t}function NG(e,t){const n=e.value,r=t.value;if(null==n||null===r)return{explicit:e.explicit,value:null};if((vG(n)||jq(n))&&(vG(r)||jq(r)))return{explicit:e.explicit,value:$G(n,r)};if(vG(n)||jq(n))return{explicit:e.explicit,value:n};if(vG(r)||jq(r))return{explicit:e.explicit,value:r};if(!(vG(n)||jq(n)||vG(r)||jq(r)))return{explicit:e.explicit,value:MG(n,r)};throw new Error("It should never reach here")}function BG(e){return"mark"in e}class TG{constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return!!BG(e)&&function(e){return YW(e)?e.type:e}(e.mark)===this.name}}var zG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i!!e.field)):TH(n)||NH(n))}function PG(e){return VP(NI,(t=>{if(RG(e,t)){const n=e[t];if(pP(n))return VP(n,(e=>!!e.aggregate));{const e=oG(n);return e&&!!e.aggregate}}return!1}))}function LG(e,t){const n=[],r=[],i=[],o=[],a={};return qG(e,((s,u)=>{if(TH(s)){const{field:l,aggregate:c,bin:f,timeUnit:d}=s,h=zG(s,["field","aggregate","bin","timeUnit"]);if(c||d||f){const e=nG(s),p=e&&e.title;let g=XH(s,{forAs:!0});const m=Object.assign(Object.assign(Object.assign({},p?[]:{title:tG(s,t,{allowDisabling:!0})}),h),{field:g});if(c){let e;if(RL(c)?(e="argmax",g=XH({op:"argmax",field:c.argmax},{forAs:!0}),m.field=`${g}.${l}`):zL(c)?(e="argmin",g=XH({op:"argmin",field:c.argmin},{forAs:!0}),m.field=`${g}.${l}`):"boxplot"!==c&&"errorbar"!==c&&"errorband"!==c&&(e=c),e){const t={op:e,as:g};l&&(t.field=l),o.push(t)}}else if(n.push(g),UH(s)&&NU(f)){if(r.push({bin:f,field:l,as:g}),n.push(XH(s,{binSuffix:"end"})),gG(s,u)&&n.push(XH(s,{binSuffix:"range"})),dU(u)){const e={field:g+"_end"};a[u+"2"]=e}m.bin="binned",HI(u)||(m.type=Zq)}else if(d){i.push({timeUnit:d,field:l,as:g});const e=UH(s)&&s.type!==Kq&&"time";e&&(u===yI||u===_I?m.formatType=e:function(e){return!!uU[e]}(u)?m.legend=Object.assign({formatType:e},m.legend):dU(u)&&(m.axis=Object.assign({formatType:e},m.axis)))}a[u]=m}else n.push(l),a[u]=e[u]}else a[u]=e[u]})),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:a}}function IG(e,t,n,r){return iL(e).reduce(((i,o)=>{if(!qI(o))return pq(function(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}(o)),i;const a=e[o];if("angle"!==o||"arc"!==t||e.theta||(pq("Arc marks uses theta channel rather than angle, replacing angle with theta."),o=eI),!function(e,t,n){const r=function(e,t){return function(e){switch(e){case aI:case sI:case uI:case AI:case bI:case xI:case _I:case wI:case vI:case dI:case hI:case pI:case gI:case VL:case HL:case GL:return CU;case YL:case XL:case nI:case rI:return jU;case ZL:case JL:case iI:case oI:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case cI:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case mI:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case lI:return{point:"always",geoshape:"always"};case yI:return{text:"always"};case fI:return{point:"always",square:"always",text:"always"};case kI:return{image:"always"};case eI:case KL:return{text:"always",arc:"always"};case tI:case QL:return{arc:"always"}}}(e)[t]}(t,n);if(!r)return!1;if("binned"===r){const n=e[t===ZL?YL:XL];return!!(TH(n)&&TH(e[t])&&BU(n.bin))}return!0}(e,o,t))return pq(eq(o,t)),i;if(o===cI&&"line"===t){const t=oG(e[o]);if(null==t?void 0:t.aggregate)return pq("Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead."),i}if(o===aI&&(n?"fill"in e:"stroke"in e))return pq(KU("encoding",{fill:"fill"in e,stroke:"stroke"in e})),i;if(o===bI||o===vI&&!pP(a)&&!qH(a)||o===_I&&pP(a))a&&(i[o]=xP(a).reduce(((e,t)=>(TH(t)?e.push(lG(t,o)):pq(QU(t,o)),e)),[]));else{if(o===_I&&null===a)i[o]=null;else if(!(TH(a)||RH(a)||qH(a)||$H(a)||jq(a)))return pq(QU(a,o)),i;i[o]=sG(a,o,r)}return i}),{})}function UG(e,t){const n={};for(const r of iL(e)){const i=sG(e[r],r,t,{compositeMark:!0});n[r]=i}return n}function qG(e,t,n){if(e)for(const r of iL(e)){const i=e[r];if(pP(i))for(const e of i)t.call(n,e,r);else t.call(n,i,r)}}function WG(e,t){return iL(t).reduce(((n,r)=>{switch(r){case YL:case XL:case wI:case AI:case kI:case ZL:case JL:case eI:case tI:case KL:case QL:case nI:case rI:case iI:case oI:case yI:case lI:case fI:case _I:return n;case vI:if("line"===e||"trail"===e)return n;case bI:case xI:{const e=t[r];if(pP(e)||TH(e))for(const t of xP(e))t.aggregate||n.push(XH(t,{}));return n}case cI:if("trail"===e)return n;case aI:case sI:case uI:case dI:case hI:case pI:case mI:case gI:{const e=oG(t[r]);return e&&!e.aggregate&&n.push(XH(e,{})),n}}}),[])}var HG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const i=r?` of ${VG(t)}`:"";return{field:e+t.field,type:t.type,title:jq(n)?{signal:n+`"${escape(i)}"`}:n+i}})),o=function(e){const t=[];for(const n of iL(e))if(RG(e,n)){const r=xP(e[n]);for(const e of r)TH(e)?t.push(e):NH(e)&&t.push(e.condition)}return t}(n).map(YH);return{tooltip:[...i,...JP(o,WP)]}}function VG(e){const{title:t,field:n}=e;return bL(t,n)}function YG(e,t,n,r,i){const{scale:o,axis:a}=n;return({partName:s,mark:u,positionPrefix:l,endPositionPrefix:c,extraEncoding:f={}})=>{const d=VG(n);return XG(e,s,i,{mark:u,encoding:Object.assign(Object.assign(Object.assign({[t]:Object.assign(Object.assign(Object.assign({field:l+"_"+n.field,type:n.type},void 0!==d?{title:d}:{}),void 0!==o?{scale:o}:{}),void 0!==a?{axis:a}:{})},EP(c)?{[t+"2"]:{field:c+"_"+n.field}}:{}),r),f)})}}function XG(e,t,n,r){const{clip:i,color:o,opacity:a}=e,s=e.type;return e[t]||void 0===e[t]&&n[t]?[Object.assign(Object.assign({},r),{mark:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n[t]),i?{clip:i}:{}),o?{color:o}:{}),a?{opacity:a}:{}),YW(r.mark)?r.mark:{type:r.mark}),{style:`${s}-${t}`}),kP(e[t])?{}:e[t])})]:[]}function ZG(e,t,n){const{encoding:r}=e,i="vertical"===t?"y":"x",o=r[i],a=r[i+"2"],s=r[i+"Error"],u=r[i+"Error2"];return{continuousAxisChannelDef:JG(o,n),continuousAxisChannelDef2:JG(a,n),continuousAxisChannelDefError:JG(s,n),continuousAxisChannelDefError2:JG(u,n),continuousAxis:i}}function JG(e,t){if(e&&e.aggregate){const{aggregate:n}=e,r=HG(e,["aggregate"]);return n!==t&&pq(function(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}(n,t)),r}return e}function KG(e,t){const{mark:n,encoding:r}=e,{x:i,y:o}=r;if(YW(n)&&n.orient)return n.orient;if(PH(i)){if(PH(o)){const e=TH(i)&&i.aggregate,n=TH(o)&&o.aggregate;if(e||n!==t){if(n||e!==t){if(e===t&&n===t)throw new Error("Both x and y cannot have aggregate");return dG(o)&&!dG(i)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(PH(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}var QG=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);iYG(l,y,m,e,t.boxplot),S=D(O),C=D(x),F=D(Object.assign(Object.assign({},O),E?{size:E}:{})),j=GG([{fieldPrefix:"min-max"===d?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===d?"lower_whisker_":"min_",titlePrefix:"Min"}],m,x),M={type:"tick",color:"black",opacity:1,orient:_,invalid:null,aria:!1},$="min-max"===d?j:GG([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],m,x),N=[...S({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:$}),...S({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:$}),...S({partName:"ticks",mark:M,positionPrefix:"lower_whisker",extraEncoding:$}),...S({partName:"ticks",mark:M,positionPrefix:"upper_whisker",extraEncoding:$})],B=[..."tukey"!==d?N:[],...C({partName:"box",mark:Object.assign(Object.assign({type:"bar"},f?{size:f}:{}),{orient:w,invalid:null,ariaRoleDescription:"box"}),positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:j}),...F({partName:"median",mark:Object.assign(Object.assign(Object.assign({type:"tick",invalid:null},gP(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{}),f?{size:f}:{}),{orient:_,aria:!1}),positionPrefix:"mid_box",extraEncoding:j})];if("min-max"===d)return Object.assign(Object.assign({},u),{transform:(null!==(r=u.transform)&&void 0!==r?r:[]).concat(g),layer:B});const T=`datum["lower_box_${m.field}"]`,z=`datum["upper_box_${m.field}"]`,R=`(${z} - ${T})`,P=`${T} - ${c} * ${R}`,L=`${z} + ${c} * ${R}`,I=`datum["${m.field}"]`,U={joinaggregate:iV(m.field),groupby:v},q={transform:[{filter:`(${P} <= ${I}) && (${I} <= ${L})`},{aggregate:[{op:"min",field:m.field,as:"lower_whisker_"+m.field},{op:"max",field:m.field,as:"upper_whisker_"+m.field},{op:"min",field:"lower_box_"+m.field,as:"lower_box_"+m.field},{op:"max",field:"upper_box_"+m.field,as:"upper_box_"+m.field},...b],groupby:v}],layer:N},{tooltip:W}=O,H=QG(O,["tooltip"]),{scale:G,axis:V}=m,Y=VG(m),X=UP(V,["title"]),Z=XG(l,"outliers",t.boxplot,{transform:[{filter:`(${I} < ${P}) || (${I} > ${L})`}],mark:"point",encoding:Object.assign(Object.assign(Object.assign({[y]:Object.assign(Object.assign(Object.assign({field:m.field,type:m.type},void 0!==Y?{title:Y}:{}),void 0!==G?{scale:G}:{}),rL(X)?{}:{axis:X})},H),A?{color:A}:{}),k?{tooltip:k}:{})})[0];let J;const K=[...h,...p,U];return Z?J={transform:K,layer:[Z,q]}:(J=q,J.transform.unshift(...K)),Object.assign(Object.assign({},u),{layer:[J,{transform:g,layer:B}]})}function iV(e){return[{op:"q1",field:e,as:"lower_box_"+e},{op:"q3",field:e,as:"upper_box_"+e}]}var oV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i1?{layer:p}:Object.assign({},p[0]))}function lV(e,t,n){var r;const{mark:i,encoding:o,selection:a,projection:s}=e,u=oV(e,["mark","encoding","selection","projection"]),l=YW(i)?i:{type:i};a&&pq(VU(t));const{orient:c,inputType:f}=function(e,t){const{encoding:n}=e;if(function(e){return(IH(e.x)||IH(e.y))&&!IH(e.x2)&&!IH(e.y2)&&!IH(e.xError)&&!IH(e.xError2)&&!IH(e.yError)&&!IH(e.yError2)}(n))return{orient:KG(e,t),inputType:"raw"};const r=function(e){return IH(e.x2)||IH(e.y2)}(n),i=function(e){return IH(e.xError)||IH(e.xError2)||IH(e.yError)||IH(e.yError2)}(n),o=n.x,a=n.y;if(r){if(i)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const e=n.x2,r=n.y2;if(IH(e)&&IH(r))throw new Error(`${t} cannot have both x2 and y2`);if(IH(e)){if(PH(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}if(IH(r)){if(PH(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}{const e=n.xError,r=n.xError2,i=n.yError,s=n.yError2;if(IH(r)&&!IH(e))throw new Error(`${t} cannot have xError2 without xError`);if(IH(s)&&!IH(i))throw new Error(`${t} cannot have yError2 without yError`);if(IH(e)&&IH(i))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(IH(e)){if(PH(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(IH(i)){if(PH(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}(e,t),{continuousAxisChannelDef:d,continuousAxisChannelDef2:h,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:g,continuousAxis:m}=ZG(e,c,t),{errorBarSpecificAggregate:y,postAggregateCalculates:v,tooltipSummary:b,tooltipTitleWithFieldName:x}=function(e,t,n,r,i,o,a,s){let u=[],l=[];const c=t.field;let f,d=!1;if("raw"===o){const t=e.center?e.center:e.extent?"iqr"===e.extent?"median":"mean":s.errorbar.center,n=e.extent?e.extent:"mean"===t?"stderr":"iqr";if("median"===t!=("iqr"===n)&&pq(function(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}(t,n,a)),"stderr"===n||"stdev"===n)u=[{op:n,field:c,as:"extent_"+c},{op:t,field:c,as:"center_"+c}],l=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:"upper_"+c},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:"lower_"+c}],f=[{fieldPrefix:"center_",titlePrefix:fL(t)},{fieldPrefix:"upper_",titlePrefix:cV(t,n,"+")},{fieldPrefix:"lower_",titlePrefix:cV(t,n,"-")}],d=!0;else{let e,t,r;"ci"===n?(e="mean",t="ci0",r="ci1"):(e="median",t="q1",r="q3"),u=[{op:t,field:c,as:"lower_"+c},{op:r,field:c,as:"upper_"+c},{op:e,field:c,as:"center_"+c}],f=[{fieldPrefix:"upper_",titlePrefix:tG({field:c,aggregate:r,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:tG({field:c,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:tG({field:c,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&pq(function(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}(e.center,e.extent)),"aggregated-upper-lower"===o?(f=[],l=[{calculate:`datum["${n.field}"]`,as:"upper_"+c},{calculate:`datum["${c}"]`,as:"lower_"+c}]):"aggregated-error"===o&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`datum["${c}"] + datum["${r.field}"]`,as:"upper_"+c}],i?l.push({calculate:`datum["${c}"] + datum["${i.field}"]`,as:"lower_"+c}):l.push({calculate:`datum["${c}"] - datum["${r.field}"]`,as:"lower_"+c}));for(const e of l)f.push({fieldPrefix:e.as.substring(0,6),titlePrefix:mL(mL(e.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}(l,d,h,p,g,f,t,n),_=o,w=m,k=(_[w],"x"===m?"x2":"y2"),A=(_[k],"x"===m?"xError":"yError"),E=(_[A],"x"===m?"xError2":"yError2"),O=(_[E],oV(_,["symbol"==typeof w?w:w+"","symbol"==typeof k?k:k+"","symbol"==typeof A?A:A+"","symbol"==typeof E?E:E+""])),{bins:D,timeUnits:S,aggregate:C,groupby:F,encoding:j}=LG(O,n),M=[...C,...y],$="raw"!==f?[]:F,N=GG(b,d,j,x);return{transform:[...null!==(r=u.transform)&&void 0!==r?r:[],...D,...S,...0===M.length?[]:[{aggregate:M,groupby:$}],...v],groupby:$,continuousAxisChannelDef:d,continuousAxis:m,encodingWithoutContinuousAxis:j,ticksOrient:"vertical"===c?"horizontal":"vertical",markDef:l,outerSpec:u,tooltipEncoding:N}}function cV(e,t,n){return fL(e)+" "+n+" "+t}const fV="errorband",dV=new TG(fV,hV);function hV(e,{config:t}){e=Object.assign(Object.assign({},e),{encoding:UG(e.encoding,t)});const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:a,outerSpec:s,tooltipEncoding:u}=lV(e,fV,t),l=a,c=YG(l,i,r,o,t.errorband),f=void 0!==e.encoding.x&&void 0!==e.encoding.y;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p=Object.assign(Object.assign({},l.interpolate?{interpolate:l.interpolate}:{}),l.tension&&l.interpolate?{tension:l.tension}:{});return f?(d=Object.assign(Object.assign(Object.assign({},d),p),{ariaRoleDescription:"errorband"}),h=Object.assign(Object.assign(Object.assign({},h),p),{aria:!1})):l.interpolate?pq(cq("interpolate")):l.tension&&pq(cq("tension")),Object.assign(Object.assign({},s),{transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]})}const pV={};function gV(e,t,n){const r=new TG(e,t);pV[e]={normalizer:r,parts:n}}gV(eV,rV,["box","median","outliers","rule","ticks"]),gV(aV,uV,["ticks","rule"]),gV(fV,hV,["band","borders"]);const mV=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],yV={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},vV={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},bV=iL(yV),xV=iL(vV),_V=iL({header:1,headerRow:1,headerColumn:1,headerFacet:1}),wV=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],kV={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1};iL(kV);var AV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function SV(e){return!(!e||"legend"!==e&&!e.legend)}function CV(e){return SV(e)&&gP(e)}function FV(e){return"concat"in e}function jV(e){return"vconcat"in e}function MV(e){return"hconcat"in e}function $V(e){return gP(e)&&void 0!==e.step}function NV(e){return e.view||e.width||e.height}const BV=iL({align:1,bounds:1,center:1,columns:1,spacing:1});var TV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ithis.mapLayerOrUnit(e,t)))})}mapHConcat(e,t){return Object.assign(Object.assign({},e),{hconcat:e.hconcat.map((e=>this.map(e,t)))})}mapVConcat(e,t){return Object.assign(Object.assign({},e),{vconcat:e.vconcat.map((e=>this.map(e,t)))})}mapConcat(e,t){const{concat:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ithis.map(e,t)))})}mapFacet(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}mapRepeat(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}}const eY={zero:1,center:1,normalize:1},tY=new Set([jW,$W,MW,RW,TW,UW,qW,BW,PW,LW]),nY=new Set([$W,MW,jW]);function rY(e,t){var n,r;const i="x"===t?"y":"radius",o=e[t],a=e[i];if(TH(o)&&TH(a))if("quantitative"===zH(o)&&"quantitative"===zH(a)){if(o.stack)return t;if(a.stack)return i;const e=TH(o)&&!!o.aggregate;if(e!==(TH(a)&&!!a.aggregate))return e?t:i;{const e=null===(n=o.scale)||void 0===n?void 0:n.type,s=null===(r=a.scale)||void 0===r?void 0:r.type;if(e&&"linear"!==e)return i;if(s&&"linear"!==s)return t}}else{if("quantitative"===zH(o))return t;if("quantitative"===zH(a))return i}else{if("quantitative"===zH(o))return t;if("quantitative"===zH(a))return i}}function iY(e,t,n={}){const r=YW(e)?e.type:e;if(!tY.has(r))return null;const i=rY(t,"x")||rY(t,"theta");if(!i)return null;const o=t[i],a=TH(o)?XH(o,{}):void 0;let s=function(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(i),u=t[s],l=TH(u)?XH(u,{}):void 0;l===a&&(l=void 0,u=void 0,s=void 0);const c=lU.reduce(((e,n)=>{if("tooltip"!==n&&RG(t,n)){const r=t[n];for(const t of xP(r)){const r=oG(t);if(r.aggregate)continue;const i=XH(r,{});i&&i===l||e.push({channel:n,fieldDef:r})}}return e}),[]);let f;if(void 0!==o.stack?f=kP(o.stack)?o.stack?"zero":null:o.stack:c.length>0&&nY.has(r)&&(f="zero"),!f||!(f in eY))return null;var d;if(PG(t)&&0===c.length)return null;if(o.scale&&o.scale.type&&o.scale.type!==tW.LINEAR){if(n.disallowNonLinearStack)return null;pq(function(e){return`Cannot stack non-linear scale (${e}).`}(o.scale.type))}return IH(t[YI(i)])?(void 0!==o.stack&&pq(`Cannot stack "${d=i}" if there is already "${d}2".`),null):(TH(o)&&o.aggregate&&!GP(UL,o.aggregate)&&pq(`Stacking is applied even though the aggregate function is non-summative ("${o.aggregate}").`),{groupbyChannel:u?s:void 0,groupbyField:l,fieldChannel:i,impute:null!==o.impute&&HW(r),stackBy:c,offset:f})}var oY=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i1?r:r.type}function sY(e){for(const t of["line","area","rule","trail"])e[t]&&(e=Object.assign(Object.assign({},e),{[t]:UP(e[t],["point","line"])}));return e}function uY(e,t={},n){return"transparent"===e.point?{opacity:0}:e.point?gP(e.point)?e.point:{}:void 0!==e.point?null:t.point||n.shape?gP(t.point)?t.point:{}:void 0}function lY(e,t={}){return e.line?!0===e.line?{}:e.line:void 0!==e.line?null:t.line?!0===t.line?{}:t.line:void 0}class cY{constructor(){this.name="path-overlay"}hasMatchingType(e,t){if(BG(e)){const{mark:n,encoding:r}=e,i=YW(n)?n:{type:n};switch(i.type){case"line":case"rule":case"trail":return!!uY(i,t[i.type],r);case"area":return!!uY(i,t[i.type],r)||!!lY(i,t[i.type])}}return!1}run(e,t,n){const{config:r}=t,{selection:i,projection:o,mark:a,encoding:s}=e,u=oY(e,["selection","projection","mark","encoding"]),l=UG(s,r),c=YW(a)?a:{type:a},f=uY(c,r[c.type],l),d="area"===c.type&&lY(c,r[c.type]),h=[Object.assign(Object.assign({},i?{selection:i}:{}),{mark:aY(Object.assign(Object.assign({},"area"===c.type&&void 0===c.opacity&&void 0===c.fillOpacity?{opacity:.7}:{}),c)),encoding:UP(l,["shape"])})],p=iY(c,l);let g=l;if(p){const{fieldChannel:e,offset:t}=p;g=Object.assign(Object.assign({},l),{[e]:Object.assign(Object.assign({},l[e]),t?{stack:t}:{})})}return d&&h.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"line"},IP(c,["clip","interpolate","tension","tooltip"])),d),encoding:g})),f&&h.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"point",opacity:1,filled:!0},IP(c,["clip","tooltip"])),f),encoding:g})),n(Object.assign(Object.assign({},u),{layer:h}),Object.assign(Object.assign({},t),{config:sY(r)}))}}var fY=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ibY(e,t))).filter((e=>e));else{const e=bY(i,t);void 0!==e&&(n[r]=e)}}return n}class _Y{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if(BG(e)){const{encoding:t,mark:n}=e;if("line"===n)for(const e of WI){const n=t[GI(e)];if(t[e]&&(TH(n)&&!BU(n.bin)||RH(n)))return!0}}return!1}run(e,t,n){const{encoding:r}=e;var i,o;return pq((i=!!r.x2,o=!!r.y2,`Line mark is for continuous lines and thus cannot be used with ${i&&o?"x2 and y2":i?"x2":"y2"}. We will use the rule mark (line segments) instead.`)),n(Object.assign(Object.assign({},e),{mark:"rule"}),t)}}var wY=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const n=Object.assign(Object.assign({},u),{layer:e}),i=(r.name||"")+l+`child__layer_${uL(e)}`,o=this.mapLayerOrUnit(r,Object.assign(Object.assign({},t),{repeater:n,repeaterPrefix:i}));return o.name=i,o}))})}mapNonLayerRepeat(e,t){var n;const{repeat:r,spec:i,data:o}=e,a=wY(e,["repeat","spec","data"]);!pP(r)&&e.columns&&(e=UP(e,["columns"]),pq(YU("repeat")));const s=[],{repeater:u={},repeaterPrefix:l=""}=t,c=!pP(r)&&r.row||[u?u.row:null],f=!pP(r)&&r.column||[u?u.column:null],d=pP(r)&&r||[u?u.repeat:null];for(const e of d)for(const n of c)for(const o of f){const a={repeat:e,row:n,column:o,layer:u.layer},c=(i.name||"")+l+"child__"+(pP(r)?`${uL(e)}`:(r.row?`row_${uL(n)}`:"")+(r.column?`column_${uL(o)}`:"")),f=this.map(i,Object.assign(Object.assign({},t),{repeater:a,repeaterPrefix:c}));f.name=c,s.push(UP(f,["data"]))}const h=pP(r)?e.columns:r.column?r.column.length:1;return Object.assign(Object.assign({data:null!==(n=i.data)&&void 0!==n?n:o,align:"all"},a),{columns:h,concat:s})}mapFacet(e,t){const{facet:n}=e;return EH(n)&&e.columns&&(e=UP(e,["columns"]),pq(YU("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){const{encoding:n,projection:r}=e,{parentEncoding:i,parentProjection:o,config:a}=t,s=AY({parentProjection:o,projection:r}),u=kY({parentEncoding:i,encoding:gY(n,t.repeater)});return this.mapUnit(Object.assign(Object.assign(Object.assign({},e),s?{projection:s}:{}),u?{encoding:u}:{}),{config:a})}mapFacetedUnit(e,t){const n=e.encoding,{row:r,column:i,facet:o}=n,a=wY(n,["row","column","facet"]),{mark:s,width:u,projection:l,height:c,view:f,selection:d,encoding:h}=e,p=wY(e,["mark","width","projection","height","view","selection","encoding"]),{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},t),y=gY(a,t.repeater);return this.mapFacet(Object.assign(Object.assign(Object.assign({},p),m),{facet:g,spec:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},u?{width:u}:{}),c?{height:c}:{}),f?{view:f}:{}),l?{projection:l}:{}),{mark:s,encoding:y}),d?{selection:d}:{})}),t)}getFacetMappingAndLayout(e,t){var n;const{row:r,column:i,facet:o}=e;if(r||i){o&&pq(`Facet encoding dropped as ${(a=[...r?[HL]:[],...i?[GL]:[]]).join(" and ")} ${a.length>1?"are":"is"} also specified.`);const t={},s={};for(const r of[HL,GL]){const i=e[r];if(i){const{align:e,center:o,spacing:a,columns:u}=i,l=wY(i,["align","center","spacing","columns"]);t[r]=l;for(const e of["align","center","spacing"])void 0!==i[e]&&(s[e]=null!==(n=s[e])&&void 0!==n?n:{},s[e][r]=i[e])}}return{facetMapping:t,layout:s}}{const{align:e,center:n,spacing:r,columns:i}=o;return{facetMapping:pY(wY(o,["align","center","spacing","columns"]),t.repeater),layout:Object.assign(Object.assign(Object.assign(Object.assign({},e?{align:e}:{}),n?{center:n}:{}),r?{spacing:r}:{}),i?{columns:i}:{})}}var a}mapLayer(e,t){var{parentEncoding:n,parentProjection:r}=t,i=wY(t,["parentEncoding","parentProjection"]);const{encoding:o,projection:a}=e,s=wY(e,["encoding","projection"]),u=Object.assign(Object.assign({},i),{parentEncoding:kY({parentEncoding:n,encoding:o,layer:!0}),parentProjection:AY({parentProjection:r,projection:a})});return super.mapLayer(s,u)}};function DY(e){return EP(e)?{type:e}:null!=e?e:{}}const SY=["background","padding"];function CY(e,t){const n={};for(const t of SY)e&&void 0!==e[t]&&(n[t]=_G(e[t]));return t&&(n.params=e.params),n}class FY{constructor(e={},t={}){this.explicit=e,this.implicit=t}clone(){return new FY(LP(this.explicit),LP(this.implicit))}combine(){return Object.assign(Object.assign({},this.explicit),this.implicit)}get(e){return bL(this.explicit[e],this.implicit[e])}getWithExplicit(e){return void 0!==this.explicit[e]?{explicit:!0,value:this.explicit[e]}:void 0!==this.implicit[e]?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,t){void 0!==t.value&&this.set(e,t.value,t.explicit)}set(e,t,n){return delete this[n?"implicit":"explicit"][e],this[n?"explicit":"implicit"][e]=t,this}copyKeyFromSplit(e,t){void 0!==t.explicit[e]?this.set(e,t.explicit[e],!0):void 0!==t.implicit[e]&&this.set(e,t.implicit[e],!1)}copyKeyFromObject(e,t){void 0!==t[e]&&this.set(e,t[e],!0)}copyAll(e){for(const t of iL(e.combine())){const n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}}function jY(e){return{explicit:!0,value:e}}function MY(e){return{explicit:!1,value:e}}function $Y(e){return(t,n,r,i)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:NY(t,n,r,i)}}function NY(e,t,n,r){return e.explicit&&t.explicit&&pq(function(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${qP(n)} and ${qP(r)}). Using ${qP(n)}.`}(n,r,e.value,t.value)),e}function BY(e,t,n,r,i=NY){return void 0===e||void 0===e.value?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:PP(e.value,t.value)?e:i(e,t,n,r)}class TY extends FY{constructor(e={},t={},n=!1){super(e,t),this.explicit=e,this.implicit=t,this.parseNothing=n}clone(){const e=super.clone();return e.parseNothing=this.parseNothing,e}}function zY(e){return"url"in e}function RY(e){return"values"in e}function PY(e){return"name"in e&&!zY(e)&&!RY(e)&&!LY(e)}function LY(e){return e&&(IY(e)||UY(e)||qY(e))}function IY(e){return"sequence"in e}function UY(e){return"sphere"in e}function qY(e){return"graticule"in e}var WY;function HY(e){return"filter"in e}function GY(e){return void 0!==(null==e?void 0:e.stop)}function VY(e){return"lookup"in e}function YY(e){return"pivot"in e}function XY(e){return"density"in e}function ZY(e){return"quantile"in e}function JY(e){return"regression"in e}function KY(e){return"loess"in e}function QY(e){return"sample"in e}function eX(e){return"window"in e}function tX(e){return"joinaggregate"in e}function nX(e){return"flatten"in e}function rX(e){return"calculate"in e}function iX(e){return"bin"in e}function oX(e){return"impute"in e}function aX(e){return"timeUnit"in e}function sX(e){return"aggregate"in e}function uX(e){return"stack"in e}function lX(e){return"fold"in e}!function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup"}(WY||(WY={}));const cX="[",fX="]",dX="{",hX="}",pX=":",gX=",",mX="@",yX=">",vX=/[[\]{}]/,bX={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let xX,_X;function wX(e,t,n){return xX=t||"view",_X=n||bX,AX(e.trim()).map(EX)}function kX(e,t,n,r,i){const o=e.length;let a,s=0;for(;t=0?--s:r&&r.indexOf(a)>=0&&++s}return t}function AX(e){const t=[],n=e.length;let r=0,i=0;for(;i' after between selector: "+e;n=n.map(EX);const i=EX(e.slice(1).trim());return i.between?{between:n,stream:i}:(i.between=n,i)}(e):function(e){const t={source:xX},n=[];let r,i,o=[0,0],a=0,s=0,u=e.length,l=0;if(e[u-1]===hX){if(l=e.lastIndexOf(dX),!(l>=0))throw"Unmatched right brace: "+e;try{o=function(e){const t=e.split(gX);if(!e.length||t.length>2)throw e;return t.map((t=>{const n=+t;if(n!=n)throw e;return n}))}(e.substring(l+1,u-1))}catch(t){throw"Invalid throttle specification: "+e}u=(e=e.slice(0,l).trim()).length,l=0}if(!u)throw e;if(e[0]===mX&&(a=++l),r=kX(e,l,pX),r1?(t.type=n[1],a?t.markname=n[0].slice(1):(c=n[0],_X[c]?t.marktype=n[0]:t.source=n[0])):t.type=n[0],"!"===t.type.slice(-1)&&(t.consume=!0,t.type=t.type.slice(0,-1)),null!=i&&(t.filter=i),o[0]&&(t.throttle=o[0]),o[1]&&(t.debounce=o[1]),t}(e)}function OX(e,t,n,r){const i=$H(t)&&t.condition,o=r(t);if(i){const t=xP(i).map((t=>{const n=r(t),i=function(e){return e.selection}(t)?DK(e,t.selection):CK(e,t.test);return Object.assign({test:i},n)}));return{[n]:[...t,...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function DX(e,t="text"){const n=e.encoding[t];return OX(e,n,t,(t=>SX(t,e.config)))}function SX(e,t,n="datum"){if(e){if(qH(e))return kG(e.value);if(IH(e)){const{format:r,formatType:i}=iG(e);return cH({fieldOrDatumDef:e,format:r,formatType:i,expr:n,config:t})}}}function CX(e,t={}){const{encoding:n,markDef:r,config:i,stack:o}=e,a=n.tooltip;if(pP(a))return{tooltip:jX({tooltip:a},o,i,t)};{const s=t.reactiveGeom?"datum.datum":"datum";return OX(e,a,"tooltip",(e=>{const a=SX(e,i,s);if(a)return a;if(null===e)return;let u=DG("tooltip",r,i);return!0===u&&(u={content:"encoding"}),EP(u)?{value:u}:gP(u)?jq(u)?u:"encoding"===u.content?jX(n,o,i,t):{signal:s}:void 0}))}}function FX(e,t,n,{reactiveGeom:r}={}){const i={},o=r?"datum.datum":"datum",a=[];function s(r,s){const u=GI(s),l=UH(r)?r:Object.assign(Object.assign({},r),{type:e[u].type}),c=xP(l.title||rG(l,n)).join(", ");let f;if(dU(s)){const r="x"===s?"x2":"y2",a=oG(e[r]);if(BU(l.bin)&&a){const e=XH(l,{expr:o}),t=XH(a,{expr:o}),{format:s,formatType:u}=iG(l);f=vH(e,t,s,u,n),i[r]=!0}else if(t&&t.fieldChannel===s&&"normalize"===t.offset){const{format:e,formatType:t}=iG(l);f=cH({fieldOrDatumDef:l,format:e,formatType:t,expr:o,config:n,normalizeStack:!0}).signal}}f=null!=f?f:SX(l,n,o).signal,a.push({channel:s,key:c,value:f})}qG(e,((e,t)=>{TH(e)?s(e,t):NH(e)&&s(e.condition,t)}));const u={};for(const{channel:e,key:t,value:n}of a)i[e]||u[t]||(u[t]=n);return u}function jX(e,t,n,{reactiveGeom:r}={}){const i=FX(e,t,n,{reactiveGeom:r}),o=aL(i).map((([e,t])=>`"${e}": ${t}`));return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function MX(e,t,n={}){const{markDef:r,encoding:i,config:o}=t,{vgChannel:a}=n;let{defaultRef:s,defaultValue:u}=n;void 0===s&&(u=null!=u?u:DG(e,r,o,{vgChannel:a,ignoreVgConfig:!0}),void 0!==u&&(s=kG(u)));const l=i[e];return OX(t,l,null!=a?a:e,(n=>oH({channel:e,channelDef:n,markDef:r,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:s})))}function $X(e,t={filled:void 0}){var n,r,i,o;const{markDef:a,encoding:s,config:u}=e,{type:l}=a,c=null!==(n=t.filled)&&void 0!==n?n:DG("filled",a,u),f=GP(["bar","point","circle","square","geoshape"],l)?"transparent":void 0,d=null!==(i=null!==(r=DG(!0===c?"color":void 0,a,u,{vgChannel:"fill"}))&&void 0!==r?r:u.mark[!0===c&&"color"])&&void 0!==i?i:f,h=null!==(o=DG(!1===c?"color":void 0,a,u,{vgChannel:"stroke"}))&&void 0!==o?o:u.mark[!1===c&&"color"],p=c?"fill":"stroke",g=Object.assign(Object.assign({},d?{fill:kG(d)}:{}),h?{stroke:kG(h)}:{});return a.color&&(c?a.fill:a.stroke)&&pq(KU("property",{fill:"fill"in a,stroke:"stroke"in a})),Object.assign(Object.assign(Object.assign(Object.assign({},g),MX("color",e,{vgChannel:p,defaultValue:c?d:h})),MX("fill",e,{defaultValue:s.fill?d:void 0})),MX("stroke",e,{defaultValue:s.stroke?h:void 0}))}function NX(e,t){const n=function(e){switch(e){case YL:return"xOffset";case XL:return"yOffset";case ZL:return"x2Offset";case JL:return"y2Offset";case eI:return"thetaOffset";case KL:return"radiusOffset";case tI:return"theta2Offset";case QL:return"radius2Offset"}}(e),r=t[n];if(r)return r}function BX(e,t,{defaultPos:n,vgChannel:r,isMidPoint:i}){const{encoding:o,markDef:a,config:s,stack:u}=t,l=o[e],c=o[YI(e)],f=t.scaleName(e),d=t.getScaleComponent(e),h=NX(e,a),p=TX({model:t,defaultPos:n,channel:e,scaleName:f,scale:d}),g=!l&&dU(e)&&(o.latitude||o.longitude)?{field:t.getName(e)}:function(e){const{channel:t,channelDef:n,isMidPoint:r,scaleName:i,stack:o,offset:a,markDef:s,config:u}=e;if(IH(n)&&o&&t===o.fieldChannel){if(TH(n)){const e=jH({channel:t,fieldDef:n,isMidPoint:r,markDef:s,stack:o,config:u});if(void 0!==e)return iH({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",band:e,offset:a})}return rH(n,i,{suffix:"end"},{offset:a})}return QW(e)}({channel:e,channelDef:l,channel2Def:c,markDef:a,config:s,isMidPoint:i,scaleName:f,scale:d,stack:u,offset:h,defaultRef:p});return g?{[r||e]:g}:void 0}function TX({model:e,defaultPos:t,channel:n,scaleName:r,scale:i}){const{markDef:o,config:a}=e;return()=>{const s=GI(n),u=VI(n),l=DG(n,o,a,{vgChannel:u});if(void 0!==l)return aH(n,l);switch(t){case"zeroOrMin":case"zeroOrMax":if(r){const e=i.get("type");if(GP([tW.LOG,tW.TIME,tW.UTC],e));else if(i.domainDefinitelyIncludesZero())return{scale:r,value:0}}if("zeroOrMin"===t)return"y"===s?{field:{group:"height"}}:{value:0};switch(s){case"radius":return{signal:`min(${e.width.signal},${e.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":{const t=e[XI(n)];return Object.assign(Object.assign({},t),{mult:.5})}}}}const zX={left:"x",center:"xc",right:"x2"},RX={top:"y",middle:"yc",bottom:"y2"};function PX(e,t,n,r="middle"){if("radius"===e||"theta"===e)return VI(e);const i="x"===e?"align":"baseline",o=DG(i,t,n);let a;return jq(o)?(pq(function(e){return`The ${e} for range marks cannot be an expression`}(i)),a=void 0):a=o,"x"===e?zX[a||("top"===r?"left":"center")]:RX[a||r]}function LX(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?IX(e,t,{defaultPos:n,defaultPos2:r}):BX(e,t,{defaultPos:n})}function IX(e,t,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=t,a=YI(e),s=XI(e),u=function(e,t,n){const{encoding:r,mark:i,markDef:o,stack:a,config:s}=e,u=GI(n),l=XI(n),c=VI(n),f=r[u],d=e.scaleName(u),h=e.getScaleComponent(u),p=NX(n in r||n in o?n:u,e.markDef);if(!f&&("x2"===n||"y2"===n)&&(r.latitude||r.longitude))return{[c]:{field:e.getName(n)}};const g=function({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:o,scale:a,stack:s,offset:u,defaultRef:l}){return IH(t)&&s&&e.charAt(0)===s.fieldChannel.charAt(0)?rH(t,o,{suffix:"start"},{offset:u}):QW({channel:e,channelDef:n,scaleName:o,scale:a,stack:s,markDef:r,config:i,offset:u,defaultRef:l})}({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:s,scaleName:d,scale:h,stack:a,offset:p,defaultRef:void 0});return void 0!==g?{[c]:g}:UX(n,o)||UX(n,{[n]:CG(n,o,s.style),[l]:CG(l,o,s.style)})||UX(n,s[i])||UX(n,s.mark)||{[c]:TX({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}(t,r,a),l=u[s]?PX(e,i,o):VI(e);return Object.assign(Object.assign({},BX(e,t,{defaultPos:n,vgChannel:l})),u)}function UX(e,t){const n=XI(e),r=VI(e);return void 0!==t[r]?{[r]:aH(e,t[r])}:void 0!==t[e]?{[r]:aH(e,t[e])}:t[n]?{[n]:aH(e,t[n])}:void 0}function qX(e,t,n){var r,i,o,a;const{config:s,encoding:u,markDef:l,stack:c}=e,f=YI(t),d=XI(t),h=u[t],p=u[f],g=e.getScaleComponent(t),m=g?g.get("type"):void 0,y=e.scaleName(t),v=l.orient,b=null!==(i=null!==(r=u[d])&&void 0!==r?r:u.size)&&void 0!==i?i:DG("size",l,s,{vgChannel:d}),x="bar"===n&&("x"===t?"vertical"===v:"horizontal"===v);if(TH(h)&&(NU(h.bin)||BU(h.bin)||h.timeUnit&&!p)&&!b&&!dW(m)){const n=jH({channel:t,fieldDef:h,stack:c,markDef:l,config:s}),r=null===(o=e.component.axes[t])||void 0===o?void 0:o[0];return function({fieldDef:e,fieldDef2:t,channel:n,band:r,scaleName:i,markDef:o,spacing:a=0,axisTranslate:s,reverse:u,config:l}){const c=YI(n),f=VI(n),d=VI(c),h=NX(n,o);if(NU(e.bin)||e.timeUnit)return{[d]:GX({channel:n,fieldDef:e,scaleName:i,markDef:o,band:(1-r)/2,offset:HX(c,a,u,s,h),config:l}),[f]:GX({channel:n,fieldDef:e,scaleName:i,markDef:o,band:1-(1-r)/2,offset:HX(n,a,u,s,h),config:l})};if(BU(e.bin)){const r=rH(e,i,{},{offset:HX(c,a,u,s,h)});if(TH(t))return{[d]:r,[f]:rH(t,i,{},{offset:HX(n,a,u,s,h)})};if(TU(e.bin)&&e.bin.step)return{[d]:r,[f]:{signal:`scale("${i}", ${XH(e,{expr:"datum"})} + ${e.bin.step})`,offset:HX(n,a,u,s,h)}}}pq(fq(c))}({fieldDef:h,fieldDef2:p,channel:t,markDef:l,scaleName:y,band:n,axisTranslate:null!==(a=null==r?void 0:r.get("translate"))&&void 0!==a?a:.5,spacing:dU(t)?DG("binSpacing",l,s):void 0,reverse:g.get("reverse"),config:s})}return(IH(h)&&dW(m)||x)&&!p?function(e,t,n,r){var i;const{markDef:o,encoding:a,config:s,stack:u}=r,l=o.orient,c=r.scaleName(n),f=r.getScaleComponent(n),d=XI(n),h=YI(n),p="horizontal"===l&&"y"===n||"vertical"===l&&"x"===n,g=DG(p?"size":d,o,s,{vgChannel:d});let m;(a.size||void 0!==g)&&(p?m=MX("size",r,{vgChannel:d,defaultValue:g}):pq(function(e){return`Cannot apply size to non-oriented mark "${e}".`}(o.type)));const y=null!==(i=IH(t)?jH({channel:n,fieldDef:t,markDef:o,stack:u,config:s}):void 0)&&void 0!==i?i:1;m=m||{[d]:WX(e,d,c,f,s,y)};const v="band"!==(null==f?void 0:f.get("type"))||!("band"in m[d]),b=PX(n,o,s,v?"middle":"top"),x=NX(n,o),_=QW({channel:n,channelDef:t,markDef:o,config:s,scaleName:c,scale:f,stack:u,offset:x,defaultRef:TX({model:r,defaultPos:"mid",channel:n,scaleName:c,scale:f}),band:v?.5:(1-y)/2});if(d)return Object.assign({[b]:_},m);{const e=VI(h),t=m[d],n=x?Object.assign(Object.assign({},t),{offset:x}):t;return{[b]:_,[e]:pP(_)?[_[0],Object.assign(Object.assign({},_[1]),{offset:n})]:Object.assign(Object.assign({},_),{offset:n})}}}(n,h,t,e):IX(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function WX(e,t,n,r,i,o){if(r){const t=r.get("type");if("point"===t||"band"===t){if(void 0!==i[e].discreteBandSize)return{value:i[e].discreteBandSize};if(t===tW.POINT){const e=r.get("range");return Mq(e)&&AP(e.step)?{value:e.step-2}:{value:LV-2}}return{scale:n,band:o}}return{value:i[e].continuousBandSize}}const a=RV(i.view,t),s=bL(i[e].discreteBandSize,a-2);return void 0!==s?{value:s}:void 0}function HX(e,t,n,r,i){if(OI(e))return 0;const o="x"===e||"y2"===e?-t/2:t/2;if(jq(n)||jq(i)||jq(r)){const e=EG(n),t=EG(i),a=EG(r);return{signal:(a?`${a} + `:"")+(e?`(${e} ? -1 : 1) * `:"")+(t?`(${t} + ${o})`:o)}}return i=i||0,r+(n?-i-o:+i+o)}function GX({channel:e,fieldDef:t,scaleName:n,markDef:r,band:i,offset:o,config:a}){return eH({fieldDef:t,channel:e,markDef:r,ref:iH({scaleName:n,fieldOrDatumDef:t,band:i,offset:o}),config:a})}const VX=new Set(["aria"]);function YX(e,t){const{fill:n,stroke:r}="include"===t.color?$X(e):{};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},function(e,t){return Nq.reduce(((n,r)=>(VX.has(r)||void 0===e[r]||"ignore"===t[r]||(n[r]=kG(e[r])),n)),{})}(e.markDef,t)),XX(e,"fill",n)),XX(e,"stroke",r)),MX("opacity",e)),MX("fillOpacity",e)),MX("strokeOpacity",e)),MX("strokeWidth",e)),MX("strokeDash",e)),function(e){const{encoding:t,mark:n}=e,r=t.order;return!HW(n)&&qH(r)?OX(e,r,"zindex",(e=>kG(e.value))):{}}(e)),CX(e)),DX(e,"href")),function(e){const{markDef:t,config:n}=e,r=DG("aria",t,n);return!1===r?{}:Object.assign(Object.assign(Object.assign({},r?{aria:r}:{}),function(e){const{mark:t,markDef:n,config:r}=e;if(!1===r.aria)return{};const i=DG("ariaRoleDescription",n,r);return null!=i?{ariaRoleDescription:{value:i}}:t in Bq?{}:{ariaRoleDescription:{value:t}}}(e)),function(e){const{encoding:t,markDef:n,config:r,stack:i}=e,o=t.description;if(o)return OX(e,o,"description",(t=>SX(t,e.config)));const a=DG("description",n,r);if(null!=a)return{description:kG(a)};if(!1===r.aria)return{};const s=FX(t,i,r);return rL(s)?void 0:{description:{signal:aL(s).map((([e,t],n)=>`"${n>0?"; ":""}${e}: " + (${t})`)).join(" + ")}}}(e))}(e))}function XX(e,t,n){const{config:r,mark:i,markDef:o}=e;if("hide"===DG("invalid",o,r)&&n&&!HW(i)){const r=function(e,{invalid:t=!1,channels:n}){const r=n.reduce(((t,n)=>{const r=e.getScaleComponent(n);if(r){const i=r.get("type"),o=e.vgField(n,{expr:"datum"});o&&hW(i)&&(t[o]=!0)}return t}),{}),i=iL(r);if(i.length>0){const e=t?"||":"&&";return i.map((e=>nH(e,t))).join(` ${e} `)}}(e,{invalid:!0,channels:DU});if(r)return{[t]:[{test:r,value:null},...xP(n)]}}return n?{[t]:n}:{}}function ZX(e){const{config:t,markDef:n}=e;if(DG("invalid",n,t)){const t=function(e,{invalid:t=!1,channels:n}){const r=n.reduce(((t,n)=>{const r=e.getScaleComponent(n);if(r){const i=r.get("type"),o=e.vgField(n,{expr:"datum"});o&&hW(i)&&(t[o]=!0)}return t}),{}),i=iL(r);if(i.length>0){const e=t?"||":"&&";return i.map((e=>nH(e,t))).join(` ${e} `)}}(e,{channels:fU});if(t)return{defined:{signal:t}}}return{}}function JX(e,t){if(void 0!==t)return{[e]:kG(t)}}const KX="voronoi",QX={has:e=>"interval"!==e.type&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(KX)},marks:(e,t,n)=>{const{x:r,y:i}=t.project.hasChannel,o=e.mark;if(HW(o))return pq(`The "nearest" transform is not supported for ${o} marks.`),n;const a={name:e.getName(KX),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:Object.assign({fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0}},CX(e,{reactiveGeom:!0}))},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let s=0,u=!1;return n.forEach(((t,n)=>{var r;const i=null!==(r=t.name)&&void 0!==r?r:"";i===e.component.mark[0].name?s=n:i.indexOf(KX)>=0&&(u=!0)})),u||n.splice(s+1,0,a),n}},eZ=QX;class tZ{constructor(e,t){this.debugName=t,this._children=[],this._parent=null,e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e,e&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,t){this._children.indexOf(e)>-1?pq("Attempt to add the same child twice."):void 0!==t?this._children.splice(t,0,e):this._children.push(e)}removeChild(e){const t=this._children.indexOf(e);return this._children.splice(t,1),t}remove(){let e=this._parent.removeChild(this);for(const t of this._children)t._parent=this._parent,this._parent.addChild(t,e++)}insertAsParentOf(e){const t=e.parent;t.removeChild(this),this.parent=t,e.parent=this}swapWithParent(){const e=this._parent,t=e.parent;for(const t of this._children)t.parent=e;this._children=[],e.removeChild(this),e.parent.removeChild(e),this.parent=t,e.parent=this}}class nZ extends tZ{constructor(e,t,n,r){super(e,t),this.type=n,this.refCounts=r,this._source=this._name=t,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}clone(){const e=new this.constructor;return e.debugName="clone_"+this.debugName,e._source=this._source,e._name="clone_"+this._name,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}dependentFields(){return new Set}producedFields(){return new Set}hash(){return void 0===this._hash&&(this._hash=`Output ${_L()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}var rZ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{field:i,timeUnit:o}=n,a=J0(t)?t.encoding[YI(r)]:void 0,s=J0(t)&&MH(r,n,a,t.stack,t.markDef,t.config);if(o){const t=XH(n,{forAs:!0});e[WP({as:t,field:i,timeUnit:o})]=Object.assign({as:t,field:i,timeUnit:o},s?{band:!0}:{})}return e}),{});return rL(n)?null:new iZ(e,n)}static makeFromTransform(e,t){const n=Object.assign({},t),{timeUnit:r}=n,i=rZ(n,["timeUnit"]),o=Fq(r),a=Object.assign(Object.assign({},i),{timeUnit:o});return new iZ(e,{[WP(a)]:a})}merge(e){this.formula=Object.assign({},this.formula);for(const t in e.formula)this.formula[t]&&!e.formula[t].band||(this.formula[t]=e.formula[t]);for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}removeFormulas(e){const t={};for(const[n,r]of aL(this.formula))e.has(r.as)||(t[n]=r);this.formula=t}producedFields(){return new Set(oL(this.formula).map((e=>e.as)))}dependentFields(){return new Set(oL(this.formula).map((e=>e.field)))}hash(){return`TimeUnit ${WP(this.formula)}`}assemble(){const e=[];for(const t of oL(this.formula)){const{field:n,as:r,timeUnit:i}=t,o=Fq(i),{unit:a,utc:s}=o,u=rZ(o,["unit","utc"]);e.push(Object.assign(Object.assign(Object.assign(Object.assign({field:gL(n),type:"timeunit"},a?{units:Dq(a)}:{}),s?{timezone:"utc"}:{}),u),{as:[r,`${r}_end`]}))}return e}}const oZ="_tuple_fields";class aZ{constructor(...e){this.items=e,this.hasChannel={},this.hasField={}}}const sZ={has:()=>!0,parse:(e,t,n)=>{var r,i,o;const a=t.name,s=null!==(r=t.project)&&void 0!==r?r:t.project=new aZ,u={},l={},c=new Set,f=(e,t)=>{const n="visual"===t?e.channel:e.field;let r=uL(`${a}_${n}`);for(let e=1;c.has(r);e++)r=uL(`${a}_${n}_${e}`);return c.add(r),{[t]:r}};if(!n.fields&&!n.encodings){const t=e.config.selection[n.type];if(n.init)for(const e of xP(n.init))for(const r of iL(e))UI[r]?(n.encodings||(n.encodings=[])).push(r):"interval"===n.type?(pq('Interval selections should be initialized using "x" and/or "y" keys.'),n.encodings=t.encodings):(n.fields||(n.fields=[])).push(r);else n.encodings=t.encodings,n.fields=t.fields}for(const e of null!==(i=n.fields)&&void 0!==i?i:[]){const t={type:"E",field:e};t.signals=Object.assign({},f(t,"data")),s.items.push(t),s.hasField[e]=t}for(const r of null!==(o=n.encodings)&&void 0!==o?o:[]){const n=e.fieldDef(r);if(n){let i=n.field;if(n.aggregate){pq(GU(r,n.aggregate));continue}if(!i){pq(HU(r));continue}if(n.timeUnit){i=e.vgField(r);const t={timeUnit:n.timeUnit,as:i,field:n.field};l[WP(t)]=t}if(!u[i]){let o="E";"interval"===t.type?hW(e.getScaleComponent(r).get("type"))&&(o="R"):n.bin&&(o="R-RE");const a={field:i,channel:r,type:o};a.signals=Object.assign(Object.assign({},f(a,"data")),f(a,"visual")),s.items.push(u[i]=a),s.hasField[i]=s.hasChannel[r]=u[i]}}else pq(HU(r))}if(n.init){const e=e=>s.items.map((t=>void 0!==e[t.channel]?e[t.channel]:e[t.field]));if("interval"===n.type)t.init=e(n.init);else{const r=xP(n.init);t.init=r.map(e)}}rL(l)||(s.timeUnit=new iZ(null,l))},signals:(e,t,n)=>{const r=t.name+oZ;return n.filter((e=>e.name===r)).length>0?n:n.concat({name:r,value:t.project.items.map((e=>{const{signals:t,hasLegend:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i"single"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind&&!SV(e.bind),parse:(e,t,n,r)=>{r.on||delete t.events,r.clear||delete t.clear},topLevelSignals:(e,t,n)=>{const r=t.name,i=t.project,o=t.bind,a=t.init&&t.init[0],s=eZ.has(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach(((e,i)=>{var u,l;const c=uL(`${r}_${e.field}`);n.filter((e=>e.name===c)).length||n.unshift(Object.assign(Object.assign({name:c},a?{init:SZ(a[i])}:{value:null}),{on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${s}[${OP(e.field)}] : null`}]:[],bind:null!==(l=null!==(u=o[e.field])&&void 0!==u?u:o[e.channel])&&void 0!==l?l:o}))})),n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.filter((e=>e.name===r+PZ))[0],a=r+oZ,s=i.items.map((e=>uL(`${r}_${e.field}`))),u=s.map((e=>`${e} !== null`)).join(" && ");return s.length&&(o.update=`${u} ? {fields: ${a}, values: [${s.join(", ")}]} : null`),delete o.value,delete o.on,n}},lZ=uZ,cZ="_toggle",fZ={has:e=>"multi"===e.type&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+cZ,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+PZ,r=t.name+cZ;return`${r} ? null : ${n}, `+("global"===t.resolve?`${r} ? null : true, `:`${r} ? null : {unit: ${qZ(e)}}, `)+`${r} ? ${n} : null`}},dZ={has:e=>void 0!==e.clear&&!1!==e.clear,parse:(e,t,n)=>{n.clear&&(t.clear=EP(n.clear)?wX(n.clear,"scope"):n.clear)},topLevelSignals:(e,t,n)=>{if(lZ.has(t))for(const e of t.project.items){const r=n.findIndex((n=>n.name===uL(`${t.name}_${e.field}`)));-1!==r&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function r(e,r){-1!==e&&n[e].on&&n[e].on.push({events:t.clear,update:r})}if("interval"===t.type)for(const e of t.project.items){const t=n.findIndex((t=>t.name===e.signals.visual));r(t,"[0, 0]"),-1===t&&r(n.findIndex((t=>t.name===e.signals.data)),"null")}else{let e=n.findIndex((e=>e.name===t.name+PZ));r(e,"null"),fZ.has(t)&&(e=n.findIndex((e=>e.name===t.name+cZ)),r(e,"false"))}return n}},hZ={has:e=>"interval"===e.type&&"global"===e.resolve&&e.bind&&"scales"===e.bind,parse:(e,t)=>{const n=t.scales=[];for(const r of t.project.items){const i=r.channel;if(!SU(i))continue;const o=e.getScaleComponent(i),a=o?o.get("type"):void 0;if(!o||!hW(a)){pq("Scale bindings are currently only supported for scales with unbinned, continuous domains.");continue}const s={selection:t.name,field:r.field};o.set("selectionExtent",s,!0),n.push(r)}},topLevelSignals:(e,t,n)=>{const r=t.scales.filter((e=>0===n.filter((t=>t.name===e.signals.data)).length));if(!e.parent||mZ(e)||0===r.length)return n;const i=n.filter((e=>e.name===t.name))[0];let o=i.update;if(o.indexOf(LZ)>=0)i.update=`{${r.map((e=>`${OP(e.field)}: ${e.signals.data}`)).join(", ")}}`;else{for(const e of r){const t=`${OP(e.field)}: ${e.signals.data}`;o.indexOf(t)<0&&(o=`${o.substring(0,o.length-1)}, ${t}}`)}i.update=o}return n.concat(r.map((e=>({name:e.signals.data}))))},signals:(e,t,n)=>{if(e.parent&&!mZ(e))for(const e of t.scales){const t=n.filter((t=>t.name===e.signals.data))[0];t.push="outer",delete t.value,delete t.update}return n}},pZ=hZ;function gZ(e,t){return`domain(${OP(e.scaleName(t))})`}function mZ(e){var t;return e.parent&&e1(e.parent)&&(null!==(t=!e.parent.parent)&&void 0!==t?t:mZ(e.parent.parent))}const yZ={has:e=>{const t="global"===e.resolve&&e.bind&&SV(e.bind),n=1===e.project.items.length&&e.project.items[0].field!==OV;return t&&!n&&pq("Legend bindings are only supported for selections over an individual field or encoding channel."),t&&n},parse:(e,t,n,r)=>{var i;if(r.on||delete t.events,r.clear||delete t.clear,r.on||r.clear){const e='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of t.events)n.filter=xP(null!==(i=n.filter)&&void 0!==i?i:[]),n.filter.indexOf(e)<0&&n.filter.push(e)}const o=CV(t.bind)?t.bind.legend:"click",a=EP(o)?wX(o,"view"):xP(o);t.bind={legend:{merge:a}}},topLevelSignals:(e,t,n)=>{const r=t.name,i=CV(t.bind)&&t.bind.legend,o=e=>t=>{const n=LP(t);return n.markname=e,n};for(const e of t.project.items){if(!e.hasLegend)continue;const a=`${uL(e.field)}_legend`,s=`${r}_${a}`;if(0===n.filter((e=>e.name===s)).length){const e=i.merge.map(o(`${a}_symbols`)).concat(i.merge.map(o(`${a}_labels`))).concat(i.merge.map(o(`${a}_entries`)));n.unshift(Object.assign(Object.assign({name:s},t.init?{}:{value:null}),{on:[{events:e,update:"datum.value || item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${s}`,force:!0}]}))}}return n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.find((e=>e.name===r+PZ)),a=r+oZ,s=i.items.filter((e=>e.hasLegend)).map((e=>uL(`${r}_${uL(e.field)}_legend`))),u=`${s.map((e=>`${e} !== null`)).join(" && ")} ? {fields: ${a}, values: [${s.join(", ")}]} : null`;t.events&&s.length>0?o.on.push({events:s.map((e=>({signal:e}))),update:u}):s.length>0&&(o.update=u,delete o.value,delete o.on);const l=n.find((e=>e.name===r+cZ)),c=CV(t.bind)&&t.bind.legend;return l&&(t.events?l.on.push(Object.assign(Object.assign({},l.on[0]),{events:c})):l.on[0].events=c),n}},vZ="_translate_anchor",bZ="_translate_delta",xZ={has:e=>"interval"===e.type&&e.translate,signals:(e,t,n)=>{const r=t.name,i=pZ.has(t),o=r+vZ,{x:a,y:s}=t.project.hasChannel;let u=wX(t.translate,"scope");return i||(u=u.map((e=>(e.between[0].markname=r+jZ,e)))),n.push({name:o,value:{},on:[{events:u.map((e=>e.between[0])),update:"{x: x(unit), y: y(unit)"+(void 0!==a?", extent_x: "+(i?gZ(e,YL):`slice(${a.signals.visual})`):"")+(void 0!==s?", extent_y: "+(i?gZ(e,XL):`slice(${s.signals.visual})`):"")+"}"}]},{name:r+bZ,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==a&&_Z(e,t,a,"width",n),void 0!==s&&_Z(e,t,s,"height",n),n}};function _Z(e,t,n,r,i){var o;const a=t.name,s=a+vZ,u=a+bZ,l=n.channel,c=pZ.has(t),f=i.filter((e=>e.name===n.signals[c?"data":"visual"]))[0],d=e.getSizeSignalRef(r).signal,h=e.getScaleComponent(l),p=h.get("type"),g=`${s}.extent_${l}`,m=`${c?"log"===p?"panLog":"pow"===p?"panPow":"panLinear":"panLinear"}(${g}, ${`${c&&l===YL?"-":""}${u}.${l} / `+(c?`${d}`:`span(${g})`)}`+(c&&"pow"===p?`, ${null!==(o=h.get("exponent"))&&void 0!==o?o:1}`:"")+")";f.on.push({events:{signal:u},update:c?m:`clampRange(${m}, 0, ${d})`})}const wZ="_zoom_anchor",kZ="_zoom_delta",AZ={has:e=>"interval"===e.type&&e.zoom,signals:(e,t,n)=>{const r=t.name,i=pZ.has(t),o=r+kZ,{x:a,y:s}=t.project.hasChannel,u=OP(e.scaleName(YL)),l=OP(e.scaleName(XL));let c=wX(t.zoom,"scope");return i||(c=c.map((e=>(e.markname=r+jZ,e)))),n.push({name:r+wZ,on:[{events:c,update:i?"{"+[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter((e=>!!e)).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==a&&EZ(e,t,a,"width",n),void 0!==s&&EZ(e,t,s,"height",n),n}};function EZ(e,t,n,r,i){var o;const a=t.name,s=n.channel,u=pZ.has(t),l=i.filter((e=>e.name===n.signals[u?"data":"visual"]))[0],c=e.getSizeSignalRef(r).signal,f=e.getScaleComponent(s),d=f.get("type"),h=u?gZ(e,s):l.name,p=a+kZ,g=`${u?"log"===d?"zoomLog":"pow"===d?"zoomPow":"zoomLinear":"zoomLinear"}(${h}, ${a}${wZ}.${s}, ${p}`+(u&&"pow"===d?`, ${null!==(o=f.get("exponent"))&&void 0!==o?o:1}`:"")+")";l.on.push({events:{signal:p},update:u?g:`clampRange(${g}, 0, ${c})`})}const OZ=[sZ,fZ,pZ,yZ,xZ,AZ,lZ,eZ,dZ];function DZ(e,t){for(const n of OZ)n.has(e)&&t(n)}function SZ(e,t=!0,n=dP){if(pP(e)){const r=e.map((e=>SZ(e,t,n)));return t?`[${r.join(", ")}]`:r}return gq(e)?n(t?_q(e):function(e){const t=xq(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}(e)):t?n(JSON.stringify(e)):e}function CZ(e,t){return UZ(e,((n,r)=>{t=r.marks?r.marks(e,n,t):t,DZ(n,(r=>{r.marks&&(t=r.marks(e,n,t))}))})),t}function FZ(e){return e.map((e=>(e.on&&!e.on.length&&delete e.on,e)))}const jZ="_brush",MZ="_scale_trigger",$Z={signals:(e,t)=>{const n=t.name,r=n+oZ,i=pZ.has(t),o=[],a=[],s=[];if(t.translate&&!i){const e=`!event.item || event.item.mark.name !== ${OP(n+jZ)}`;NZ(t,((t,n)=>{var r;const i=xP(null!==(r=n.between[0].filter)&&void 0!==r?r:n.between[0].filter=[]);return i.indexOf(e)<0&&i.push(e),t}))}t.project.items.forEach(((n,r)=>{const i=n.channel;if(i!==YL&&i!==XL)return void pq("Interval selections only support x and y encoding channels.");const u=t.init?t.init[r]:null,l=function(e,t,n,r){const i=n.channel,o=n.signals.visual,a=n.signals.data,s=pZ.has(t),u=OP(e.scaleName(i)),l=e.getScaleComponent(i),c=l?l.get("type"):void 0,f=e=>`scale(${u}, ${e})`,d=e.getSizeSignalRef(i===YL?"width":"height").signal,h=`${i}(unit)`,p=NZ(t,((e,t)=>[...e,{events:t.between[0],update:`[${h}, ${h}]`},{events:t,update:`[${o}[0], clamp(${h}, 0, ${d})]`}]));return p.push({events:{signal:t.name+MZ},update:hW(c)?`[${f(`${a}[0]`)}, ${f(`${a}[1]`)}]`:"[0, 0]"}),s?[{name:a,on:[]}]:[Object.assign(Object.assign({name:o},r?{init:SZ(r,!0,f)}:{value:[]}),{on:p}),Object.assign(Object.assign({name:a},r?{init:SZ(r)}:{}),{on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${u}, ${o})`}]})]}(e,t,n,u),c=n.signals.data,f=n.signals.visual,d=OP(e.scaleName(i)),h=hW(e.getScaleComponent(i).get("type"))?"+":"";o.push(...l),a.push(c),s.push({scaleName:e.scaleName(i),expr:`(!isArray(${c}) || (${h}invert(${d}, ${f})[0] === ${h}${c}[0] && ${h}invert(${d}, ${f})[1] === ${h}${c}[1]))`})})),i||o.push({name:n+MZ,value:{},on:[{events:s.map((e=>({scale:e.scaleName}))),update:s.map((e=>e.expr)).join(" && ")+` ? ${n+MZ} : {}`}]});const u=t.init,l=`unit: ${qZ(e)}, fields: ${r}, values`;return o.concat(Object.assign(Object.assign({name:n+PZ},u?{init:`{${l}: ${SZ(u)}}`}:{}),{on:[{events:[{signal:a.join(" || ")}],update:a.join(" && ")+` ? {${l}: [${a}]} : null`}]}))},modifyExpr:(e,t)=>t.name+PZ+", "+("global"===t.resolve?"true":`{unit: ${qZ(e)}}`),marks:(e,t,n)=>{const r=t.name,{x:i,y:o}=t.project.hasChannel,a=i&&i.signals.visual,s=o&&o.signals.visual,u=`data(${OP(t.name+RZ)})`;if(pZ.has(t))return n;const l={x:void 0!==i?{signal:`${a}[0]`}:{value:0},y:void 0!==o?{signal:`${s}[0]`}:{value:0},x2:void 0!==i?{signal:`${a}[1]`}:{field:{group:"width"}},y2:void 0!==o?{signal:`${s}[1]`}:{field:{group:"height"}}};if("global"===t.resolve)for(const t of iL(l))l[t]=[Object.assign({test:`${u}.length && ${u}[0].unit === ${qZ(e)}`},l[t]),{value:0}];const c=t.mark,{fill:f,fillOpacity:d,cursor:h}=c,p=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i(e[t]=[{test:[void 0!==i&&`${a}[0] !== ${a}[1]`,void 0!==o&&`${s}[0] !== ${s}[1]`].filter((e=>e)).join(" && "),value:p[t]},{value:null}],e)),{});return[{name:r+jZ+"_bg",type:"rect",clip:!0,encode:{enter:{fill:{value:f},fillOpacity:{value:d}},update:l}},...n,{name:r+jZ,type:"rect",clip:!0,encode:{enter:Object.assign(Object.assign({},h?{cursor:{value:h}}:{}),{fill:{value:"transparent"}}),update:Object.assign(Object.assign({},l),g)}}]}};function NZ(e,t){return e.events.reduce(((e,n)=>n.between?t(e,n):(pq(`${n} is not an ordered event stream for interval selections.`),e)),[])}function BZ(e,t){const n=t.name,r=n+oZ,i=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=i.items.map((t=>{const n=e.fieldDef(t.channel);return n&&n.bin?`[${o}[${OP(e.vgField(t.channel,{}))}], ${o}[${OP(e.vgField(t.channel,{binSuffix:"end"}))}]]`:`${o}[${OP(t.field)}]`})).join(", "),s=`unit: ${qZ(e)}, fields: ${r}, values`,u=t.events;return[{name:n+PZ,on:u?[{events:u,update:`datum && item().mark.marktype !== 'group' ? {${s}: [${a}]} : null`,force:!0}]:[]}]}const TZ={signals:BZ,modifyExpr:(e,t)=>t.name+PZ+", "+("global"===t.resolve?"null":`{unit: ${qZ(e)}}`)},zZ={signals:BZ,modifyExpr:(e,t)=>t.name+PZ+", "+("global"===t.resolve?"true":`{unit: ${qZ(e)}}`)},RZ="_store",PZ="_tuple",LZ="vlSelectionResolve",IZ={single:zZ,multi:TZ,interval:$Z};function UZ(e,t){const n=e.component.selection;if(n)for(const e of oL(n))if(!0===t(e,IZ[e.type]))break}function qZ(e,{escape:t}={escape:!0}){let n=t?OP(e.name):e.name;const r=function(e){let t=e.parent;for(;t&&!K0(t);)t=t.parent;return t}(e);if(r){const{facet:e}=r;for(const t of MI)e[t]&&(n+=` + '__facet_${t}_' + (facet[${OP(r.vgField(t))}])`)}return n}function WZ(e){let t=!1;return UZ(e,(e=>{t=t||e.project.items.some((e=>e.field===OV))})),t}function HZ(e,t,n){return e.fields=t||[],e.fname=n,e}function GZ(e){return 1===e.length?VZ(e[0]):YZ(e)}const VZ=e=>function(t){return t[e]},YZ=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),s=r=i+1):"]"===o&&(s||XZ("Access path missing open bracket: "+e),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&XZ("Access path missing closing bracket: "+e),a&&XZ("Access path missing closing quote: "+e),i>r&&(i++,l()),t}(e);e=1===r.length?r[0]:e,HZ((n&&n.get||GZ)(r),[e],t||e)})("id"),HZ((e=>e),[],"identity"),HZ((()=>0),[],"zero"),HZ((()=>1),[],"one"),HZ((()=>!0),[],"true"),HZ((()=>!1),[],"false"),Array.isArray,Object.prototype.hasOwnProperty;function ZZ(e){this.type=e}var JZ,KZ,QZ,eJ,tJ;ZZ.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=function(e){switch(e.type){case"ArrayExpression":return e.elements;case"BinaryExpression":case"LogicalExpression":return[e.left,e.right];case"CallExpression":return[e.callee].concat(e.arguments);case"ConditionalExpression":return[e.test,e.consequent,e.alternate];case"MemberExpression":return[e.object,e.property];case"ObjectExpression":return e.properties;case"Property":return[e.key,e.value];case"UnaryExpression":return[e.argument];default:return[]}}(this),n=0,r=t.length;n",JZ[iJ]="Identifier",JZ[oJ]="Keyword",JZ[aJ]="Null",JZ[sJ]="Numeric",JZ[uJ]="Punctuator",JZ[lJ]="String",JZ[9]="RegularExpression";var cJ="ArrayExpression",fJ="BinaryExpression",dJ="CallExpression",hJ="ConditionalExpression",pJ="Identifier",gJ="Literal",mJ="LogicalExpression",yJ="MemberExpression",vJ="ObjectExpression",bJ="Property",xJ="UnaryExpression",_J="Unexpected token %0",wJ="Unexpected number",kJ="Unexpected string",AJ="Unexpected identifier",EJ="Unexpected reserved word",OJ="Unexpected end of input",DJ="Invalid regular expression",SJ="Invalid regular expression: missing /",CJ="Octal literals are not allowed in strict mode.",FJ="Duplicate data property in object literal not allowed in strict mode",jJ="ILLEGAL",MJ="Disabled.",$J=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\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\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),NJ=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0B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\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function BJ(e,t){if(!e)throw new Error("ASSERT: "+t)}function TJ(e){return e>=48&&e<=57}function zJ(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function RJ(e){return"01234567".indexOf(e)>=0}function PJ(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function LJ(e){return 10===e||13===e||8232===e||8233===e}function IJ(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&$J.test(String.fromCharCode(e))}function UJ(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&NJ.test(String.fromCharCode(e))}const qJ={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function WJ(){for(;QZ1114111||"}"!==e)&&oK({},_J,jJ),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),r=56320+(t-65536&1023),String.fromCharCode(n,r))}function VJ(){var e,t;for(e=KZ.charCodeAt(QZ++),t=String.fromCharCode(e),92===e&&(117!==KZ.charCodeAt(QZ)&&oK({},_J,jJ),++QZ,(e=HJ("u"))&&"\\"!==e&&IJ(e.charCodeAt(0))||oK({},_J,jJ),t=e);QZ>>="===(r=KZ.substr(QZ,4))?{type:uJ,value:r,start:i,end:QZ+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:uJ,value:n,start:i,end:QZ+=3}:a===(t=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t?{type:uJ,value:t,start:i,end:QZ+=2}:("//"===t&&oK({},_J,jJ),"<>=!+-*%&|^/".indexOf(a)>=0?(++QZ,{type:uJ,value:a,start:i,end:QZ}):void oK({},_J,jJ))}function XJ(){var e,t,n;if(BJ(TJ((n=KZ[QZ]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=QZ,e="","."!==n){if(e=KZ[QZ++],n=KZ[QZ],"0"===e){if("x"===n||"X"===n)return++QZ,function(e){let t="";for(;QZ=eJ)return{type:rJ,start:QZ,end:QZ};const e=KZ.charCodeAt(QZ);return IJ(e)?function(){var e,t;return e=QZ,t=92===KZ.charCodeAt(QZ)?VJ():function(){var e,t;for(e=QZ++;QZ=0&&QZ(BJ(t=0&&oK({},DJ,n),{value:n,literal:t}}(),r=function(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((e,t)=>{if(parseInt(t,16)<=1114111)return"x";oK({},DJ)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){oK({},DJ)}try{return new RegExp(e,t)}catch(e){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:QZ}}()),KJ()):aK(JJ())}return n}function pK(){const e=[];if(sK("("),!uK(")"))for(;QZ":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function xK(){var e,t;return e=function(){var e,t,n,r,i,o,a,s,u,l;if(e=tJ,u=vK(),0===(i=bK(r=tJ)))return u;for(r.prec=i,JJ(),t=[e,tJ],o=[u,r,a=vK()];(i=bK(tJ))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),t.pop(),n=QJ(s,u,a),o.push(n);(r=JJ()).prec=i,o.push(r),t.push(tJ),n=vK(),o.push(n)}for(n=o[l=o.length-1],t.pop();l>1;)t.pop(),n=QJ(o[l-1].value,o[l-2],n),l-=2;return n}(),uK("?")&&(JJ(),t=xK(),sK(":"),e=function(e,t,n){const r=new ZZ(hJ);return r.test=e,r.consequent=t,r.alternate=n,r}(e,t,xK())),e}function _K(){const e=xK();if(uK(","))throw new Error(MJ);return e}function wK(e){const t=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(t.push(...wK(e.object)),t.push(...wK(e.property))),t)}function kK(e){return"MemberExpression"===e.object.type?kK(e.object):"datum"===e.object.name}function AK(e){const t=function(e){QZ=0,eJ=(KZ=e).length,tJ=null,KJ();const t=_K();if(tJ.type!==rJ)throw new Error("Unexpect token after expression.");return t}(e),n=new Set;return t.visit((e=>{"MemberExpression"===e.type&&kK(e)&&n.add(wK(e).slice(1).join("."))})),n}class EK extends tZ{constructor(e,t,n){super(e),this.model=t,this.filter=n,this.expr=CK(this.model,this.filter,this),this._dependentFields=AK(this.expr)}clone(){return new EK(null,this.model,LP(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}var OK=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i`length(data(${e}))`)).join(" || ")+") || ":"")+`(${o})`}function SK(e,t){const n=t.encoding;let r=t.field;if(n||r){if(n&&!r){const i=e.project.items.filter((e=>e.channel===n));!i.length||i.length>1?(r=e.project.items[0].field,pq((i.length?"Multiple ":"No ")+`matching ${OP(n)} encoding found for selection ${OP(t.selection)}. `+`Using "field": ${OP(r)}.`)):r=i[0].field}}else r=e.project.items[0].field,e.project.items.length>1&&pq(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${OP(r)}.`);return`${e.name}[${OP(r)}]`}function CK(e,t,n){return lL(t,(t=>EP(t)?t:function(e){return null==e?void 0:e.selection}(t)?DK(e,t.selection,n):Gq(t)))}var FK=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{test:t}=e,n=FK(e,["test"]);return Object.assign({test:CK(null,t)},n)})),n];jK(h,r,t,a),delete h[e]}else if(null===o){const t={signal:i.map((e=>{const{test:t}=e,n=FK(e,["test"]);return`${CK(null,t)} ? ${AG(n)} : `})).join("")+AG(n)};h[e]=t}}else if(jq(r)){const t=DL[e];if(t){const{vgProp:n,part:i}=t;jK(h,i,n,r),delete h[e]}}}if("grid"===t){if(!h.grid)return;if(h.encode){const{grid:e}=h.encode;h.encode=Object.assign({},e?{grid:e}:{}),rL(h.encode)&&delete h.encode}return Object.assign(Object.assign({scale:l,orient:u},h),{domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:bL(d,0)})}{if(!r.header&&e.mainExtracted)return;if(void 0!==c){let e=c;(null===(o=null===(i=h.encode)||void 0===i?void 0:i.labels)||void 0===o?void 0:o.update)&&jq(h.encode.labels.update.text)&&(e=mL(c,"datum.label",h.encode.labels.update.text.signal)),jK(h,"labels","text",{signal:e})}if(null===h.labelAlign&&delete h.labelAlign,h.encode){for(const t of CL)e.hasAxisPart(t)||delete h.encode[t];rL(h.encode)&&delete h.encode}const t=function(e,t){if(e)return pP(e)&&!vG(e)?e.map((e=>rG(e,t))).join(", "):e}(f,n);return Object.assign(Object.assign(Object.assign(Object.assign({scale:l,orient:u,grid:!1},t?{title:t}:{}),h),!1===n.aria?{aria:!1}:{}),{zindex:bL(d,0)})}}}function $K(e){const{axes:t}=e.component,n=[];for(const r of fU)if(t[r])for(const i of t[r])if(!i.get("disable")&&!i.get("gridScale")){const t="x"===r?"height":"width",i=e.getSizeSignalRef(t).signal;t!==i&&n.push({name:t,update:i})}return n}function NK(e,t,n,r){return Object.assign.apply(null,[{},...e.map((e=>{if("axisOrient"===e){const e="x"===n?"bottom":"left",i=t["x"===n?"axisBottom":"axisLeft"]||{},o=t["x"===n?"axisTop":"axisRight"]||{},a=new Set([...iL(i),...iL(o)]),s={};for(const t of a.values())s[t]={signal:`${r.signal} === "${e}" ? ${EG(i[t])} : ${EG(o[t])}`};return s}return t[e]}))])}function BK(e,t){var n;const r=[{}];for(const i of e){let e=null===(n=t[i])||void 0===n?void 0:n.style;if(e){e=xP(e);for(const n of e)r.push(t.style[n])}}return Object.assign.apply(null,r)}function TK(e,t,n,r={}){var i;const o=FG(e,n,t);if(void 0!==o)return{configFrom:"style",configValue:o};for(const t of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(void 0!==(null===(i=r[t])||void 0===i?void 0:i[e]))return{configFrom:t,configValue:r[t][e]};return{}}const zK={scale:({model:e,channel:t})=>e.scaleName(t),format:({fieldOrDatumDef:e,config:t,axis:n})=>{const{format:r,formatType:i}=n;return hH(e,e.type,r,i,t,!0)},formatType:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return pH(r,t,n)},grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>{var r;return(!TH(e)||!BU(e.bin))&&(null!==(r=t.grid)&&void 0!==r?r:function(e,t){return!dW(e)&&TH(t)&&!NU(null==t?void 0:t.bin)}(n,e))},gridScale:({model:e,channel:t})=>function(e,t){const n="x"===t?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelAlign||LK(t,n,r),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelBaseline||PK(t,n,r),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>{var r;return null!==(r=e.labelFlush)&&void 0!==r?r:function(e,t){if("x"===t&&GP(["quantitative","temporal"],e))return!0}(t.type,n)},labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{var r;return null!==(r=e.labelOverlap)&&void 0!==r?r:function(e,t,n,r){if(n&&!gP(r)||"nominal"!==e&&"ordinal"!==e)return"log"!==t&&"symlog"!==t||"greedy"}(t.type,n,TH(t)&&!!t.timeUnit,TH(t)?t.sort:void 0)},orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:r,scaleType:i})=>{var o;const a="x"===e?"width":"y"===e?"height":void 0,s=a?t.getSizeSignalRef(a):void 0;return null!==(o=n.tickCount)&&void 0!==o?o:function({fieldOrDatumDef:e,scaleType:t,size:n,values:r}){var i;if(!r&&!dW(t)&&"log"!==t){if(TH(e)){if(NU(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&GP(["month","hours","day","quarter"],null===(i=Fq(e.timeUnit))||void 0===i?void 0:i.unit))return}return{signal:`ceil(${n.signal}/40)`}}}({fieldOrDatumDef:r,scaleType:i,size:s,values:n.values})},title:({axis:e,model:t,channel:n})=>{if(void 0!==e.title)return e.title;const r=IK(t,n);if(void 0!==r)return r;const i=t.typedFieldDef(n),o="x"===n?"x2":"y2",a=t.fieldDef(o);return MG(i?[CH(i)]:[],TH(a)?[CH(a)]:[])},values:({axis:e,fieldOrDatumDef:t})=>function(e,t){const n=e.values;return pP(n)?pG(t,n):jq(n)?n:void 0}(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>{var r;return null!==(r=e.zindex)&&void 0!==r?r:function(e,t){return"rect"===e&&ZH(t)?1:0}(n,t)}};function RK(e){return`(((${e.signal} % 360) + 360) % 360)`}function PK(e,t,n,r){if(void 0!==e){if("x"===n){if(jq(e)){const n=RK(e);return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${jq(t)?`(${t.signal} === "top")`:"top"===t} ? "bottom" : "top"`}}if(45{if(WH(t)&&AH(t.sort)){const{field:r,timeUnit:i}=t,o=t.sort,a=o.map(((e,t)=>`${Gq({field:r,timeUnit:i,equal:e})} ? ${t} : `)).join("")+o.length;e=new UK(e,{calculate:a,as:qK(t,n,{forAs:!0})})}})),e}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${WP(this.transform)}`}}function qK(e,t,n){return XH(e,Object.assign({prefix:t,suffix:"sort_index"},null!=n?n:{}))}function WK(e,t){return GP(["top","bottom"],t)?"column":GP(["left","right"],t)||"row"===e?"row":"column"}function HK(e,t,n,r){const i="row"===r?n.headerRow:"column"===r?n.headerColumn:n.headerFacet;return bL((t||{})[e],i[e],n.header[e])}function GK(e,t,n,r){const i={};for(const o of e){const e=HK(o,t||{},n,r);void 0!==e&&(i[o]=e)}return i}const VK=["row","column"],YK=["header","footer"];function XK(e,t){const n=e.component.layoutHeaders[t].title,r=e.config?e.config:void 0,i=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:a,titleOrient:s}=GK(["titleAnchor","titleAngle","titleOrient"],i.header,r,t),u=WK(t,s),l=EL(a);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:n},"row"===t?{orient:"left"}:{}),{style:"guide-title"}),JK(l,u)),ZK(u,l,o)),iQ(r,i,t,bV,yV))}}function ZK(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=LK(t,"row"===e?"left":"top","row"===e?"y":"x");return r?{align:r}:{}}function JK(e,t){const n=PK(e,"row"===t?"left":"top","row"===t?"y":"x",!0);return n?{baseline:n}:{}}function KK(e,t){const n=e.component.layoutHeaders[t],r=[];for(const i of YK)if(n[i])for(const o of n[i]){const a=tQ(e,t,i,n,o);null!=a&&r.push(a)}return r}function QK(e,t){var n;const{sort:r}=e;return kH(r)?{field:XH(r,{expr:"datum"}),order:null!==(n=r.order)&&void 0!==n?n:"ascending"}:pP(r)?{field:qK(e,t,{expr:"datum"}),order:"ascending"}:{field:XH(e,{expr:"datum"}),order:null!=r?r:"ascending"}}function eQ(e,t,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:u}=GK(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=cH({fieldOrDatumDef:e,format:r,formatType:i,expr:"parent",config:n}).signal,c=WK(t,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:{signal:u?mL(mL(u,"datum.label",l),"datum.value",XH(e,{expr:"parent"})):l}},"row"===t?{orient:"left"}:{}),{style:"guide-label",frame:"group"}),JK(o,c)),ZK(c,o,a)),iQ(n,e,t,xV,vV))}function tQ(e,t,n,r,i){if(i){let o=null;const{facetFieldDef:a}=r,s=e.config?e.config:void 0;if(a&&i.labels){const{labelOrient:e}=GK(["labelOrient"],a.header,s,t);("row"===t&&!GP(["top","bottom"],e)||"column"===t&&!GP(["left","right"],e))&&(o=eQ(a,t,s))}const u=K0(e)&&!EH(e.facet),l=i.axes,c=(null==l?void 0:l.length)>0;if(o||c){const s="row"===t?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`},r.facetFieldDef?{from:{data:e.getName(t+"_domain")},sort:QK(a,t)}:{}),c&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{}),o?{title:o}:{}),i.sizeSignal?{encode:{update:{[s]:i.sizeSignal}}}:{}),c?{axes:l}:{})}}return null}const nQ={column:{start:0,end:1},row:{start:1,end:0}};function rQ(e,t){return nQ[t][e]}function iQ(e,t,n,r,i){const o={};for(const a of r){if(!i[a])continue;const r=HK(a,null==t?void 0:t.header,e,n);void 0!==r&&(o[i[a]]=r)}return o}function oQ(e){return[...aQ(e,"width"),...aQ(e,"height"),...aQ(e,"childWidth"),...aQ(e,"childHeight")]}function aQ(e,t){const n="width"===t?"x":"y",r=e.component.layoutSize.get(t);if(!r||"merged"===r)return[];const i=e.getSizeSignalRef(t).signal;if("step"===r){const t=e.getScaleComponent(n);if(t){const r=t.get("type"),o=t.get("range");if(dW(r)&&Mq(o)){const r=e.scaleName(n);return K0(e.parent)&&"independent"===e.parent.component.resolve.scale[n]?[sQ(r,o)]:[sQ(r,o),{name:i,update:uQ(r,t,`domain('${r}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==r){const t=i.endsWith("width"),n=t?"containerSize()[0]":"containerSize()[1]",r=`isFinite(${n}) ? ${n} : ${zV(e.config.view,t?"width":"height")}`;return[{name:i,init:r,on:[{update:r,events:"window:resize"}]}]}return[{name:i,value:r}]}function sQ(e,t){return{name:e+"_step",value:t.step}}function uQ(e,t,n){const r=t.get("type"),i=t.get("padding"),o=bL(t.get("paddingOuter"),i);let a=t.get("paddingInner");return a="band"===r?void 0!==a?a:i:1,`bandspace(${n}, ${EG(a)}, ${EG(o)}) * ${e}_step`}function lQ(e){return"childWidth"===e?"width":"childHeight"===e?"height":e}function cQ(e,t){return iL(e).reduce(((n,r)=>{const i=e[r];return Object.assign(Object.assign({},n),OX(t,i,r,(e=>kG(e.value))))}),{})}function fQ(e,t){if(e1(t)||K0(t))return"shared";if(Q0(t))return dU(e)?"independent":"shared";throw new Error("invalid model type for resolve")}function dQ(e,t){const n=e.scale[t],r=dU(t)?"axis":"legend";return"independent"===n?("shared"===e[r][t]&&pq(function(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}(t)),"independent"):e[r][t]||"shared"}const hQ=Object.assign(Object.assign({},kV),{disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1}),pQ=iL(hQ);class gQ extends FY{}const mQ={symbols:function(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i,legendType:o}){var a,s,u,l,c,f,d,h;if("symbol"!==o)return;const{markDef:p,encoding:g,config:m,mark:y}=n,v=p.filled&&"trail"!==y;let b=Object.assign(Object.assign({},function(e,t,n){for(const r of n){const n=SG(r,t.markDef,t.config);void 0!==n&&(e[r]=kG(n))}return e}({},n,XW)),$X(n,{filled:v}));const x=null!==(a=i.get("symbolOpacity"))&&void 0!==a?a:m.legend.symbolOpacity,_=null!==(s=i.get("symbolFillColor"))&&void 0!==s?s:m.legend.symbolFillColor,w=null!==(u=i.get("symbolStrokeColor"))&&void 0!==u?u:m.legend.symbolStrokeColor,k=void 0===x?null!==(l=yQ(g.opacity))&&void 0!==l?l:p.opacity:void 0;if(b.fill)if("fill"===r||v&&r===aI)delete b.fill;else if(b.fill.field)_?delete b.fill:(b.fill=kG(null!==(c=m.legend.symbolBaseFillColor)&&void 0!==c?c:"black"),b.fillOpacity=kG(null!=k?k:1));else if(pP(b.fill)){const e=null!==(h=null!==(d=vQ(null!==(f=g.fill)&&void 0!==f?f:g.color))&&void 0!==d?d:p.fill)&&void 0!==h?h:v&&p.color;e&&(b.fill=kG(e))}if(b.stroke)if("stroke"===r||!v&&r===aI)delete b.stroke;else if(b.stroke.field||w)delete b.stroke;else if(pP(b.stroke)){const e=bL(vQ(g.stroke||g.color),p.stroke,v?p.color:void 0);e&&(b.stroke={value:e})}if(r!==dI){const e=TH(t)&&xQ(0,i,t);e?b.opacity=[Object.assign({test:e},kG(null!=k?k:1)),kG(m.legend.unselectedOpacity)]:k&&(b.opacity=kG(k))}return b=Object.assign(Object.assign({},b),e),rL(b)?void 0:b},gradient:function(e,{model:t,legendType:n,legendCmpt:r}){var i;if("gradient"!==n)return;const{config:o,markDef:a,encoding:s}=t;let u={};const l=void 0===(null!==(i=r.get("gradientOpacity"))&&void 0!==i?i:o.legend.gradientOpacity)?yQ(s.opacity)||a.opacity:void 0;return l&&(u.opacity=kG(l)),u=Object.assign(Object.assign({},u),e),rL(u)?void 0:u},labels:function(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},a=n.config,s=TH(t)?xQ(0,i,t):void 0,u=s?[{test:s,value:1},{value:a.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=o,f=sH(c)?dH({fieldOrDatumDef:t,field:"datum.value",format:l,formatType:c,config:a}):void 0,d=Object.assign(Object.assign(Object.assign({},u?{opacity:u}:{}),f?{text:f}:{}),e);return rL(d)?void 0:d},entries:function(e,{legendCmpt:t}){const n=t.get("selections");return(null==n?void 0:n.length)?Object.assign(Object.assign({},e),{fill:{value:"transparent"}}):e}};function yQ(e){return bQ(e,((e,t)=>Math.max(e,t.value)))}function vQ(e){return bQ(e,((e,t)=>bL(e,t.value)))}function bQ(e,t){return function(e){const t=e&&e.condition;return!!t&&(pP(t)||qH(t))}(e)?xP(e.condition).reduce(t,e.value):qH(e)?e.value:void 0}function xQ(e,t,n){const r=t.get("selections");if(!(null==r?void 0:r.length))return;const i=OP(n.field);return r.map((e=>`(!length(data(${OP(uL(e)+RZ)})) || (${e}[${i}] && indexof(${e}[${i}], datum.value) >= 0))`)).join(" || ")}const _Q={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:r,formatType:i}=t;return hH(e,e.type,r,i,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return pH(r,t,n)},gradientLength:e=>{var t,n;const{legend:r,legendConfig:i}=e;return null!==(n=null!==(t=r.gradientLength)&&void 0!==t?t:i.gradientLength)&&void 0!==n?n:function({legendConfig:e,model:t,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:a,gradientVerticalMaxLength:s,gradientVerticalMinLength:u}=e;if(pW(i))return"horizontal"===n?"top"===r||"bottom"===r?kQ(t,"width",a,o):a:kQ(t,"height",u,s)}(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>{var r,i;return null!==(i=null!==(r=e.labelOverlap)&&void 0!==r?r:t.labelOverlap)&&void 0!==i?i:function(e){if(GP(["quantile","threshold","log","symlog"],e))return"greedy"}(n)},symbolType:({legend:e,markDef:t,channel:n,encoding:r})=>{var i;return null!==(i=e.symbolType)&&void 0!==i?i:function(e,t,n,r){var i;if("shape"!==t){const e=null!==(i=vQ(n))&&void 0!==i?i:r;if(e)return e}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(t.type,n,r.shape,t.shape)},title:({fieldOrDatumDef:e,config:t})=>tG(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(FI(n)&&pW(t)){if("gradient"===e)return}else if("symbol"===e)return;return e},values:({fieldOrDatumDef:e,legend:t})=>function(e,t){const n=e.values;return pP(n)?pG(t,n):jq(n)?n:void 0}(t,e)};function wQ({legendConfig:e,legendType:t,orient:n,legend:r}){var i,o;return null!==(o=null!==(i=r.direction)&&void 0!==i?i:e[t?"gradientDirection":"symbolDirection"])&&void 0!==o?o:function(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===t?"horizontal":void 0}}(n,t)}function kQ(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function AQ(e){const t=J0(e)?function(e){const{encoding:t}=e,n={};for(const r of[aI,...wV]){const i=aG(t[r]);i&&e.getScaleComponent(r)&&(r===lI&&TH(i)&&i.type===eW||(n[r]=OQ(e,r)))}return n}(e):function(e){const{legends:t,resolve:n}=e.component;for(const r of e.children){AQ(r);for(const i of iL(r.component.legends))n.legend[i]=dQ(e.component.resolve,i),"shared"===n.legend[i]&&(t[i]=DQ(t[i],r.component.legends[i]),t[i]||(n.legend[i]="independent",delete t[i]))}for(const r of iL(t))for(const t of e.children)t.component.legends[r]&&"shared"===n.legend[r]&&delete t.component.legends[r];return t}(e);return e.component.legends=t,t}function EQ(e,t,n,r){switch(t){case"disable":return void 0!==n;case"values":return!!(null==n?void 0:n.values);case"title":if("title"===t&&e===(null==r?void 0:r.title))return!0}return e===(n||{})[t]}function OQ(e,t){var n,r,i;let o=e.legend(t);const{markDef:a,encoding:s,config:u}=e,l=u.legend,c=new gQ({},function(e,t){const n=e.scaleName(t);if("trail"===e.mark){if("color"===t)return{stroke:n};if("size"===t)return{strokeWidth:n}}return"color"===t?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}(e,t));!function(e,t,n){var r;const i=null===(r=e.fieldDef(t))||void 0===r?void 0:r.field;UZ(e,(e=>{var r,o;const a=null!==(r=e.project.hasField[i])&&void 0!==r?r:e.project.hasChannel[t];if(a&&yZ.has(e)){const t=null!==(o=n.get("selections"))&&void 0!==o?o:[];t.push(e.name),n.set("selections",t,!1),a.hasLegend=!0}}))}(e,t,c);const f=void 0!==o?!o:l.disable;if(c.set("disable",f,void 0!==o),f)return c;o=o||{};const d=e.getScaleComponent(t).get("type"),h=aG(s[t]),p=TH(h)?null===(n=Fq(h.timeUnit))||void 0===n?void 0:n.unit:void 0,g=o.orient||u.legend.orient||"right",m=function(e){const{legend:t}=e;return bL(t.type,function({channel:e,timeUnit:t,scaleType:n}){if(FI(e)){if(GP(["quarter","month","day"],t))return"symbol";if(pW(n))return"gradient"}return"symbol"}(e))}({legend:o,channel:t,timeUnit:p,scaleType:d}),y={legend:o,channel:t,model:e,markDef:a,encoding:s,fieldOrDatumDef:h,legendConfig:l,config:u,scaleType:d,orient:g,legendType:m,direction:wQ({legend:o,legendType:m,orient:g,legendConfig:l})};for(const n of pQ){if("gradient"===m&&n.startsWith("symbol")||"symbol"===m&&n.startsWith("gradient"))continue;const r=n in _Q?_Q[n](y):o[n];if(void 0!==r){const i=EQ(r,n,o,e.fieldDef(t));(i||void 0===u.legend[n])&&c.set(n,r,i)}}const v=null!==(r=null==o?void 0:o.encoding)&&void 0!==r?r:{},b=c.get("selections"),x={},_={fieldOrDatumDef:h,model:e,channel:t,legendCmpt:c,legendType:m};for(const t of["labels","legend","title","symbols","gradient","entries"]){const n=cQ(null!==(i=v[t])&&void 0!==i?i:{},e),r=t in mQ?mQ[t](n,_):n;void 0===r||rL(r)||(x[t]=Object.assign(Object.assign(Object.assign({},(null==b?void 0:b.length)&&TH(h)?{name:`${uL(h.field)}_legend_${t}`}:{}),(null==b?void 0:b.length)?{interactive:!!b}:{}),{update:r}))}return rL(x)||c.set("encode",x,!!(null==o?void 0:o.encoding)),c}function DQ(e,t){var n,r,i,o;if(!e)return t.clone();const a=e.getWithExplicit("orient"),s=t.getWithExplicit("orient");if(a.explicit&&s.explicit&&a.value!==s.value)return;let u=!1;for(const n of pQ){const r=BY(e.getWithExplicit(n),t.getWithExplicit(n),n,"legend",((e,t)=>{switch(n){case"symbolType":return r=e,"circle"===(i=t).value?i:r;case"title":return NG(e,t);case"type":return u=!0,MY("symbol")}var r,i;return NY(e,t,n,"legend")}));e.setWithExplicit(n,r)}return u&&((null===(r=null===(n=e.implicit)||void 0===n?void 0:n.encode)||void 0===r?void 0:r.gradient)&&cL(e.implicit,["encode","gradient"]),(null===(o=null===(i=e.explicit)||void 0===i?void 0:i.encode)||void 0===o?void 0:o.gradient)&&cL(e.explicit,["encode","gradient"])),e}function SQ(e){const t=e.component.legends,n={};for(const r of iL(t)){const i=e.getScaleComponent(r),o=qP(i.get("domains"));if(n[o])for(const e of n[o])DQ(e,t[r])||n[o].push(t[r]);else n[o]=[t[r].clone()]}const r=oL(n).flat().map((t=>function(e,t){var n,r,i;const o=e.combine(),{disable:a,labelExpr:s,selections:u}=o,l=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ivoid 0!==e));return r}function CQ(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:r}=n;if(t.data){const i={signal:`[${t.size.map((e=>e.signal)).join(", ")}]`},o=t.data.reduce(((t,n)=>{const r=jq(n)?n.signal:`data('${e.lookupDataSource(n)}')`;return GP(t,r)||t.push(r),t}),[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[Object.assign({name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]}},n)]}return[Object.assign(Object.assign({name:r},{translate:{signal:"[width / 2, height / 2]"}}),n)]}const FQ=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class jQ extends FY{constructor(e,t,n,r){super(Object.assign({},t),{name:e}),this.specifiedProjection=t,this.size=n,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function MQ(e){e.component.projection=J0(e)?function(e){var t;if(e.hasProjection){const n=e.specifiedProjection,r=!(n&&(null!=n.scale||null!=n.translate)),i=r?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,o=r?function(e){const t=[],{encoding:n}=e;for(const r of[[rI,nI],[oI,iI]])(aG(n[r[0]])||aG(n[r[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(lI)&&e.typedFieldDef(lI).type===eW&&t.push({signal:e.getName(`geojson_${t.length}`)}),0===t.length&&t.push(e.requestDataName(WY.Main)),t}(e):void 0;return new jQ(e.projectionName(!0),Object.assign(Object.assign({},null!==(t=e.config.projection)&&void 0!==t?t:{}),null!=n?n:{}),i,o)}}(e):function(e){if(0===e.children.length)return;let t;for(const t of e.children)MQ(t);const n=YP(e.children,(e=>{const n=e.component.projection;if(n){if(t){const e=function(e,t){const n=YP(FQ,(n=>!wP(e.explicit,n)&&!wP(t.explicit,n)||!(!wP(e.explicit,n)||!wP(t.explicit,n)||qP(e.get(n))!==qP(t.get(n)))));if(qP(e.size)===qP(t.size)){if(n)return e;if(qP(e.explicit)===qP({}))return t;if(qP(t.explicit)===qP({}))return e}return null}(t,n);return e&&(t=e),!!e}return t=n,!0}return!0}));if(t&&n){const n=e.projectionName(!0),r=new jQ(n,t.specifiedProjection,t.size,LP(t.data));for(const t of e.children){const e=t.component.projection;e&&(e.isFit&&r.data.push(...t.component.projection.data),t.renameProjection(e.get("name"),n),e.merged=!0)}return r}}(e)}function $Q(e,t){return`${$U(e)}_${t}`}function NQ(e,t,n){var r;const i=$Q(null!==(r=cG(n,void 0))&&void 0!==r?r:{},t);return e.getName(`${i}_bins`)}function BQ(e,t,n){let r,i;r=function(e){return"as"in e}(e)?EP(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:[XH(e,{forAs:!0}),XH(e,{binSuffix:"end",forAs:!0})];const o=Object.assign({},cG(t,void 0)),a=$Q(o,e.field),{signal:s,extentSignal:u}=function(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}(n,a);if(zU(o.extent)){const e=o.extent,t=e.selection;i=SK(n.getSelectionComponent(uL(t),t),e),delete o.extent}return{key:a,binComponent:Object.assign(Object.assign(Object.assign({bin:o,field:e.field,as:[r]},s?{signal:s}:{}),u?{extentSignal:u}:{}),i?{span:i}:{})}}class TQ extends tZ{constructor(e,t){super(e),this.bins=t}clone(){return new TQ(null,LP(this.bins))}static makeFromEncoding(e,t){const n=t.reduceFieldDef(((e,n,r)=>{if(UH(n)&&NU(n.bin)){const{key:i,binComponent:o}=BQ(n,n.bin,t);e[i]=Object.assign(Object.assign(Object.assign({},o),e[i]),function(e,t,n,r){var i,o;if(gG(t,n)){const a=J0(e)&&null!==(o=null!==(i=e.axis(n))&&void 0!==i?i:e.legend(n))&&void 0!==o?o:{},s=XH(t,{expr:"datum"}),u=XH(t,{expr:"datum",binSuffix:"end"});return{formulaAs:XH(t,{binSuffix:"range",forAs:!0}),formula:vH(s,u,a.format,a.formatType,r)}}return{}}(t,n,r,t.config))}return e}),{});return rL(n)?null:new TQ(e,n)}static makeFromTransform(e,t,n){const{key:r,binComponent:i}=BQ(t,t.bin,n);return new TQ(e,{[r]:i})}merge(e,t){for(const n of iL(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=JP([...this.bins[n].as,...e.bins[n].as],WP)):this.bins[n]=e.bins[n];for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}producedFields(){return new Set(oL(this.bins).map((e=>e.as)).flat(2))}dependentFields(){return new Set(oL(this.bins).map((e=>e.field)))}hash(){return`Bin ${WP(this.bins)}`}assemble(){return oL(this.bins).flatMap((e=>{const t=[],[n,...r]=e.as,i=e.bin,{extent:o}=i,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{e.aggregate&&(n=!0)}));const r={},i=new Set;return n?(t.forEachFieldDef(((e,n)=>{var o,a,s,u;const{aggregate:l,field:c}=e;if(l)if("count"===l)r["*"]=null!==(o=r["*"])&&void 0!==o?o:{},r["*"].count=new Set([XH(e,{forAs:!0})]);else{if(zL(l)||RL(l)){const e=zL(l)?"argmin":"argmax",t=l[e];r[t]=null!==(a=r[t])&&void 0!==a?a:{},r[t][e]=new Set([XH({op:e,field:t},{forAs:!0})])}else r[c]=null!==(s=r[c])&&void 0!==s?s:{},r[c][l]=new Set([XH(e,{forAs:!0})]);SU(n)&&"unaggregated"===t.scaleDomain(n)&&(r[c]=null!==(u=r[c])&&void 0!==u?u:{},r[c].min=new Set([XH({field:c,aggregate:"min"},{forAs:!0})]),r[c].max=new Set([XH({field:c,aggregate:"max"},{forAs:!0})]))}else!function(e,t,n,r){const i=J0(r)?r.encoding[YI(t)]:void 0;if(UH(n)&&J0(r)&&MH(t,n,i,r.stack,r.markDef,r.config))e.add(XH(n,{})),e.add(XH(n,{suffix:"end"})),n.bin&&gG(n,t)&&e.add(XH(n,{binSuffix:"range"}));else if(t in DI){const n=function(e){switch(e){case nI:return"y";case iI:return"y2";case rI:return"x";case oI:return"x2"}}(t);e.add(r.getName(n))}else e.add(XH(n))}(i,n,e,t)})),i.size+iL(r).length===0?null:new zQ(e,i,r)):null}static makeFromTransform(e,t){var n,r,i;const o=new Set,a={};for(const e of t.aggregate){const{op:t,field:i,as:o}=e;t&&("count"===t?(a["*"]=null!==(n=a["*"])&&void 0!==n?n:{},a["*"].count=new Set([o||XH(e,{forAs:!0})])):(a[i]=null!==(r=a[i])&&void 0!==r?r:{},a[i][t]=new Set([o||XH(e,{forAs:!0})])))}for(const e of null!==(i=t.groupby)&&void 0!==i?i:[])o.add(e);return o.size+iL(a).length===0?null:new zQ(e,o,a)}merge(e){return QP(this.dimensions,e.dimensions)?(function(e,t){var n;for(const r of iL(t)){const i=t[r];for(const t of iL(i))r in e?e[r][t]=new Set([...null!==(n=e[r][t])&&void 0!==n?n:[],...i[t]]):e[r]={[t]:i[t]}}}(this.measures,e.measures),!0):(function(...e){hq.debug(...e)}("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...iL(this.measures)])}producedFields(){const e=new Set;for(const t of iL(this.measures))for(const n of iL(this.measures[t])){const r=this.measures[t][n];0===r.size?e.add(`${n}_${t}`):r.forEach(e.add,e)}return e}hash(){return`Aggregate ${WP({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const e=[],t=[],n=[];for(const r of iL(this.measures))for(const i of iL(this.measures[r]))for(const o of this.measures[r][i])n.push(o),e.push(i),t.push("*"===r?null:gL(r));return{type:"aggregate",groupby:[...this.dimensions].map(gL),ops:e,fields:t,as:n}}}class RQ extends tZ{constructor(e,t,n,r){super(e),this.model=t,this.name=n,this.data=r;for(const e of MI){const n=t.facet[e];if(n){const{bin:r,sort:i}=n;this[e]=Object.assign({name:t.getName(`${e}_domain`),fields:[XH(n),...NU(r)?[XH(n,{binSuffix:"end"})]:[]]},kH(i)?{sortField:i}:pP(i)?{sortIndexField:qK(n,e)}:{})}}this.childModel=t.child}hash(){let e="Facet";for(const t of MI)this[t]&&(e+=` ${t.charAt(0)}:${WP(this[t])}`);return e}get fields(){var e;const t=[];for(const n of MI)(null===(e=this[n])||void 0===e?void 0:e.fields)&&t.push(...this[n].fields);return t}dependentFields(){const e=new Set(this.fields);for(const t of MI)this[t]&&(this[t].sortField&&e.add(this[t].sortField.field),this[t].sortIndexField&&e.add(this[t].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const t of fU){const n=this.childModel.component.scales[t];if(n&&!n.merged){const r=n.get("type"),i=n.get("range");if(dW(r)&&Mq(i)){const n=C0(F0(this.childModel,t));n?e[t]=n:pq(WU(t))}}}return e}assembleRowColumnHeaderData(e,t,n){const r={row:"y",column:"x"}[e],i=[],o=[],a=[];n&&n[r]&&(t?(i.push(`distinct_${n[r]}`),o.push("max")):(i.push(n[r]),o.push("distinct")),a.push(`distinct_${n[r]}`));const{sortField:s,sortIndexField:u}=this[e];if(s){const{op:e=bH,field:t}=s;i.push(t),o.push(e),a.push(XH(s,{forAs:!0}))}else u&&(i.push(u),o.push("max"),a.push(u));return{name:this[e].name,source:null!=t?t:this.data,transform:[Object.assign({type:"aggregate",groupby:this[e].fields},i.length?{fields:i,ops:o,as:a}:{})]}}assembleFacetHeaderData(e){var t,n;const{columns:r}=this.model.layout,{layoutHeaders:i}=this.model.component,o=[],a={};for(const e of VK){for(const r of YK){const o=null!==(t=i[e]&&i[e][r])&&void 0!==t?t:[];for(const t of o)if((null===(n=t.axes)||void 0===n?void 0:n.length)>0){a[e]=!0;break}}if(a[e]){const t=`length(data("${this.facet.name}"))`,n="row"===e?r?{signal:`ceil(${t} / ${r})`}:1:r?{signal:`min(${t}, ${r})`}:{signal:t};o.push({name:`${this.facet.name}_${e}`,transform:[{type:"sequence",start:0,stop:n}]})}}const{row:s,column:u}=a;return(s||u)&&o.unshift(this.assembleRowColumnHeaderData("facet",null,e)),o}assemble(){var e,t;const n=[];let r=null;const i=this.getChildIndependentFieldsWithStep(),{column:o,row:a,facet:s}=this;if(o&&a&&(i.x||i.y)){r=`cross_${this.column.name}_${this.row.name}`;const o=[].concat(null!==(e=i.x)&&void 0!==e?e:[],null!==(t=i.y)&&void 0!==t?t:[]),a=o.map((()=>"distinct"));n.push({name:r,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:o,ops:a}]})}for(const e of[GL,HL])this[e]&&n.push(this.assembleRowColumnHeaderData(e,r,i));if(s){const e=this.assembleFacetHeaderData(i);e&&n.push(...e)}return n}}function PQ(e){return"'"===e[0]&&"'"===e[e.length-1]||'"'===e[0]&&'"'===e[e.length-1]?e.slice(1,-1):e}function LQ(e){const t={};return zP(e.filter,(e=>{var n;if(Wq(e)){let r=null;zq(e)?r=_G(e.equal):Pq(e)?r=_G(e.lte):Rq(e)?r=_G(e.lt):Lq(e)?r=_G(e.gt):Iq(e)?r=_G(e.gte):Uq(e)?r=e.range[0]:qq(e)&&(r=(null!==(n=e.oneOf)&&void 0!==n?n:e.in)[0]),r&&(gq(r)?t[e.field]="date":AP(r)?t[e.field]="number":EP(r)&&(t[e.field]="string")),e.timeUnit&&(t[e.field]="date")}})),t}class IQ extends tZ{constructor(e,t){super(e),this._parse=t}clone(){return new IQ(null,LP(this._parse))}hash(){return`Parse ${WP(this._parse)}`}static makeExplicit(e,t,n){let r={};const i=t.data;return!LY(i)&&i&&i.format&&i.format.parse&&(r=i.format.parse),this.makeWithAncestors(e,r,{},n)}static makeWithAncestors(e,t,n,r){for(const e of iL(n)){const t=r.getWithExplicit(e);void 0!==t.value&&(t.explicit||t.value===n[e]||"derived"===t.value||"flatten"===n[e]?delete n[e]:pq(XU(e,n[e],t.value)))}for(const e of iL(t)){const n=r.get(e);void 0!==n&&(n===t[e]?delete t[e]:pq(XU(e,t[e],n)))}const i=new FY(t,n);r.copyAll(i);const o={};for(const e of iL(i.combine())){const t=i.get(e);null!==t&&(o[e]=t)}return 0===iL(o).length||r.parseNothing?null:new IQ(e,o)}get parse(){return this._parse}merge(e){this._parse=Object.assign(Object.assign({},this._parse),e.parse),e.remove()}assembleFormatParse(){const e={};for(const t of iL(this._parse)){const n=this._parse[t];1===vL(t)&&(e[t]=n)}return e}producedFields(){return new Set(iL(this._parse))}dependentFields(){return new Set(iL(this._parse))}assembleTransforms(e=!1){return iL(this._parse).filter((t=>!e||vL(t)>1)).map((e=>{const t=function(e,t){const n=dL(e);return"number"===t?`toNumber(${n})`:"boolean"===t?`toBoolean(${n})`:"string"===t?`toString(${n})`:"date"===t?`toDate(${n})`:"flatten"===t?n:0===t.indexOf("date:")?`timeParse(${n},'${PQ(t.slice(5,t.length))}')`:0===t.indexOf("utc:")?`utcParse(${n},'${PQ(t.slice(4,t.length))}')`:(pq(`Unrecognized parse "${t}".`),null)}(e,this._parse[e]);return t?{type:"formula",expr:t,as:yL(e)}:null})).filter((e=>null!==e))}}class UQ extends tZ{clone(){return new UQ(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([OV])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:OV}}}class qQ extends tZ{constructor(e,t){super(e),this.params=t}clone(){return new qQ(null,this.params)}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${WP(this.params)}`}assemble(){return Object.assign({type:"graticule"},!0===this.params?{}:this.params)}}class WQ extends tZ{constructor(e,t){super(e),this.params=t}clone(){return new WQ(null,this.params)}dependentFields(){return new Set}producedFields(){var e;return new Set([null!==(e=this.params.as)&&void 0!==e?e:"data"])}hash(){return`Hash ${WP(this.params)}`}assemble(){return Object.assign({type:"sequence"},this.params)}}class HQ extends tZ{constructor(e){let t;if(super(null),LY(e=null!=e?e:{name:"source"})||(t=e.format?Object.assign({},UP(e.format,["parse"])):{}),RY(e))this._data={values:e.values};else if(zY(e)){if(this._data={url:e.url},!t.type){let n=/(?:\.([^.]+))?$/.exec(e.url)[1];GP(["json","csv","tsv","dsv","topojson"],n)||(n="json"),t.type=n}}else UY(e)?this._data={values:[{type:"Sphere"}]}:(PY(e)||LY(e))&&(this._data={});this._generator=LY(e),e.name&&(this._name=e.name),t&&!rL(t)&&(this._data.format=t)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return Object.assign(Object.assign({name:this._name},this._data),{transform:[]})}}var GQ,VQ=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n};function YQ(e){return e instanceof HQ||e instanceof qQ||e instanceof WQ}class XQ{constructor(){GQ.set(this,void 0),VQ(this,GQ,!1)}setModified(){VQ(this,GQ,!0)}get modifiedFlag(){return function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}(this,GQ)}}GQ=new WeakMap;class ZQ extends XQ{getNodeDepths(e,t,n){n.set(e,t);for(const r of e.children)this.getNodeDepths(r,t+1,n);return n}optimize(e){const t=[...this.getNodeDepths(e,0,new Map).entries()].sort(((e,t)=>t[1]-e[1]));for(const e of t)this.run(e[0]);return this.modifiedFlag}}class JQ extends XQ{optimize(e){this.run(e);for(const t of e.children)this.optimize(t);return this.modifiedFlag}}class KQ extends JQ{mergeNodes(e,t){const n=t.shift();for(const r of t)e.removeChild(r),r.parent=n,r.remove()}run(e){const t=e.children.map((e=>e.hash())),n={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(e,n[t]))}}class QQ extends JQ{constructor(e){super(),this.requiresSelectionId=e&&WZ(e)}run(e){e instanceof UQ&&(this.requiresSelectionId&&(YQ(e.parent)||e.parent instanceof zQ||e.parent instanceof IQ)||(this.setModified(),e.remove()))}}class e0 extends XQ{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,t){let n=new Set;e instanceof iZ&&(n=e.producedFields(),eL(n,t)&&(this.setModified(),e.removeFormulas(t),0===e.producedFields.length&&e.remove()));for(const r of e.children)this.run(r,new Set([...t,...n]))}}class t0 extends JQ{constructor(){super()}run(e){e instanceof nZ&&!e.isRequired()&&(this.setModified(),e.remove())}}class n0 extends ZQ{run(e){if(!(YQ(e)||e.numChildren()>1))for(const t of e.children)if(t instanceof IQ)if(e instanceof IQ)this.setModified(),e.merge(t);else{if(nL(e.producedFields(),t.dependentFields()))continue;this.setModified(),t.swapWithParent()}}}class r0 extends ZQ{run(e){const t=[...e.children],n=e.children.filter((e=>e instanceof IQ));if(e.numChildren()>1&&n.length>=1){const r={},i=new Set;for(const e of n){const t=e.parse;for(const e of iL(t))e in r?r[e]!==t[e]&&i.add(e):r[e]=t[e]}for(const e of i)delete r[e];if(!rL(r)){this.setModified();const n=new IQ(e,r);for(const i of t){if(i instanceof IQ)for(const e of iL(r))delete i.parse[e];e.removeChild(i),i.parent=n,i instanceof IQ&&0===iL(i.parse).length&&i.remove()}}}}}class i0 extends ZQ{run(e){e instanceof nZ||e.numChildren()>0||e instanceof RQ||e instanceof HQ||(this.setModified(),e.remove())}}class o0 extends ZQ{run(e){const t=e.children.filter((e=>e instanceof iZ)),n=t.pop();for(const e of t)this.setModified(),n.merge(e)}}class a0 extends ZQ{run(e){const t=e.children.filter((e=>e instanceof zQ)),n={};for(const e of t){const t=WP(e.groupBy);t in n||(n[t]=[]),n[t].push(e)}for(const t of iL(n)){const r=n[t];if(r.length>1){const t=r.pop();for(const n of r)t.merge(n)&&(e.removeChild(n),n.parent=t,n.remove(),this.setModified())}}}}class s0 extends ZQ{constructor(e){super(),this.model=e}run(e){const t=!(YQ(e)||e instanceof EK||e instanceof IQ||e instanceof UQ),n=[],r=[];for(const i of e.children)i instanceof TQ&&(t&&!nL(e.producedFields(),i.dependentFields())?n.push(i):r.push(i));if(n.length>0){const t=n.pop();for(const e of n)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified(),e instanceof TQ?e.merge(t,this.model.renameSignal.bind(this.model)):t.swapWithParent()}if(r.length>1){const e=r.pop();for(const t of r)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified()}}}class u0 extends ZQ{run(e){const t=[...e.children];if(!VP(t,(e=>e instanceof nZ))||e.numChildren()<=1)return;const n=[];let r;for(const i of t)if(i instanceof nZ){let t=i;for(;1===t.numChildren();){const[e]=t.children;if(!(e instanceof nZ))break;t=e}n.push(...t.children),r?(e.removeChild(i),i.parent=r.parent,r.parent.removeChild(r),r.parent=t,this.setModified()):r=t}else n.push(i);if(n.length){this.setModified();for(const e of n)e.parent.removeChild(e),e.parent=r}}}class l0 extends tZ{constructor(e,t){super(e),this.transform=t}clone(){return new l0(null,LP(this.transform))}addDimensions(e){this.transform.groupby=JP(this.transform.groupby.concat(e),(e=>e))}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map((e=>e.field)).filter((e=>void 0!==e)).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){var t;return null!==(t=e.as)&&void 0!==t?t:XH(e)}hash(){return`JoinAggregateTransform ${WP(this.transform)}`}assemble(){const e=[],t=[],n=[];for(const r of this.transform.joinaggregate)t.push(r.op),n.push(this.getDefaultName(r)),e.push(void 0===r.field?null:r.field);const r=this.transform.groupby;return Object.assign({type:"joinaggregate",as:n,ops:t,fields:e},void 0!==r?{groupby:r}:{})}}class c0 extends tZ{constructor(e,t){super(e),this._stack=t}clone(){return new c0(null,LP(this._stack))}static makeFromTransform(e,t){const{stack:n,groupby:r,as:i,offset:o="zero"}=t,a=[],s=[];if(void 0!==t.sort)for(const e of t.sort)a.push(e.field),s.push(bL(e.order,"ascending"));const u={field:a,order:s};let l;return l=function(e){return pP(e)&&e.every((e=>EP(e)))&&e.length>1}(i)?i:EP(i)?[i,i+"_end"]:[t.stack+"_start",t.stack+"_end"],new c0(e,{stackField:n,groupby:r,offset:o,sort:u,facetby:[],as:l})}static makeFromEncoding(e,t){const n=t.stack,{encoding:r}=t;if(!n)return null;const{groupbyChannel:i,fieldChannel:o,offset:a,impute:s}=n;let u;i&&(u=oG(r[i]));const l=function(e){return e.stack.stackBy.reduce(((e,t)=>{const n=XH(t.fieldDef);return n&&e.push(n),e}),[])}(t),c=t.encoding.order;let f;return f=pP(c)||TH(c)?jG(c):l.reduce(((e,t)=>(e.field.push(t),e.order.push("y"===o?"descending":"ascending"),e)),{field:[],order:[]}),new c0(e,{dimensionFieldDef:u,stackField:t.vgField(o),facetby:[],stackby:l,sort:f,offset:a,impute:s,as:[t.vgField(o,{suffix:"start",forAs:!0}),t.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${WP(this._stack)}`}getGroupbyFields(){const{dimensionFieldDef:e,impute:t,groupby:n}=this._stack;return e?e.bin?t?[XH(e,{binSuffix:"mid"})]:[XH(e,{}),XH(e,{binSuffix:"end"})]:[XH(e)]:null!=n?n:[]}assemble(){const e=[],{facetby:t,dimensionFieldDef:n,stackField:r,stackby:i,sort:o,offset:a,impute:s,as:u}=this._stack;if(s&&n){const{band:o=.5,bin:a}=n;a&&e.push({type:"formula",expr:`${o}*`+XH(n,{expr:"datum"})+`+${1-o}*`+XH(n,{expr:"datum",binSuffix:"end"}),as:XH(n,{binSuffix:"mid",forAs:!0})}),e.push({type:"impute",field:r,groupby:[...i,...t],key:XH(n,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...t],field:r,sort:o,as:u,offset:a}),e}}class f0 extends tZ{constructor(e,t){super(e),this.transform=t}clone(){return new f0(null,LP(this.transform))}addDimensions(e){this.transform.groupby=JP(this.transform.groupby.concat(e),(e=>e))}dependentFields(){var e,t;const n=new Set;return(null!==(e=this.transform.groupby)&&void 0!==e?e:[]).forEach(n.add,n),(null!==(t=this.transform.sort)&&void 0!==t?t:[]).forEach((e=>n.add(e.field))),this.transform.window.map((e=>e.field)).filter((e=>void 0!==e)).forEach(n.add,n),n}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){var t;return null!==(t=e.as)&&void 0!==t?t:XH(e)}hash(){return`WindowTransform ${WP(this.transform)}`}assemble(){var e;const t=[],n=[],r=[],i=[];for(const e of this.transform.window)n.push(e.op),r.push(this.getDefaultName(e)),i.push(void 0===e.param?null:e.param),t.push(void 0===e.field?null:e.field);const o=this.transform.frame,a=this.transform.groupby;if(o&&null===o[0]&&null===o[1]&&n.every((e=>PL(e))))return Object.assign({type:"joinaggregate",as:r,ops:n,fields:t},void 0!==a?{groupby:a}:{});const s=[],u=[];if(void 0!==this.transform.sort)for(const t of this.transform.sort)s.push(t.field),u.push(null!==(e=t.order)&&void 0!==e?e:"ascending");const l={field:s,order:u},c=this.transform.ignorePeers;return Object.assign(Object.assign(Object.assign({type:"window",params:i,as:r,ops:n,fields:t,sort:l},void 0!==c?{ignorePeers:c}:{}),void 0!==a?{groupby:a}:{}),void 0!==o?{frame:o}:{})}}function d0(e){if(e instanceof RQ)if(1!==e.numChildren()||e.children[0]instanceof nZ){const n=e.model.component.data.main;h0(n);const r=(t=e,function e(n){if(!(n instanceof RQ)){const r=n.clone();if(r instanceof nZ){const e=p0+r.getSource();r.setSource(e),t.model.component.data.outputNodes[e]=r}else(r instanceof zQ||r instanceof c0||r instanceof f0||r instanceof l0)&&r.addDimensions(t.fields);for(const t of n.children.flatMap(e))t.parent=r;return[r]}return n.children.flatMap(e)}),i=e.children.map(r).flat();for(const e of i)e.parent=n}else{const t=e.children[0];(t instanceof zQ||t instanceof c0||t instanceof f0||t instanceof l0)&&t.addDimensions(e.fields),t.swapWithParent(),d0(e)}else e.children.map(d0);var t}function h0(e){if(e instanceof nZ&&e.type===WY.Main&&1===e.numChildren()){const t=e.children[0];t instanceof RQ||(t.swapWithParent(),h0(e))}}const p0="scale_",g0=5;function m0(e){for(const t of e){for(const e of t.children)if(e.parent!==t)return!1;if(!m0(t.children))return!1}return!0}function y0(e,t){let n=!1;for(const r of t)n=e.optimize(r)||n;return n}function v0(e,t,n){let r=e.sources,i=!1;return i=y0(new t0,r)||i,i=y0(new QQ(t),r)||i,r=r.filter((e=>e.numChildren()>0)),i=y0(new i0,r)||i,r=r.filter((e=>e.numChildren()>0)),n||(i=y0(new n0,r)||i,i=y0(new s0(t),r)||i,i=y0(new e0,r)||i,i=y0(new r0,r)||i,i=y0(new a0,r)||i,i=y0(new o0,r)||i,i=y0(new KQ,r)||i,i=y0(new u0,r)||i),e.sources=r,i}class b0{constructor(e){Object.defineProperty(this,"signal",{enumerable:!0,get:e})}static fromName(e,t){return new b0((()=>e(t)))}}var x0=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i({signal:`{data: ${hG(e,{timeUnit:n,type:t})}}`})))}(e,t,i):[e]}function A0(e,t,n,r){const{encoding:i}=n,o=aG(i[r]),{type:a}=o,s=o.timeUnit;if(function(e){return e&&e.unionWith}(t)){const i=A0(e,void 0,n,r),o=k0(t.unionWith,a,s);return jY([...i.value,...o])}if(jq(t))return jY([t]);if(t&&"unaggregated"!==t&&!mW(t))return jY(k0(t,a,s));const u=n.stack;if(u&&r===u.fieldChannel){if("normalize"===u.offset)return MY([[0,1]]);const e=n.requestDataName(WY.Main);return MY([{data:e,field:n.vgField(r,{suffix:"start"})},{data:e,field:n.vgField(r,{suffix:"end"})}])}const l=SU(r)&&TH(o)?function(e,t,n){if(!dW(n))return;const r=e.fieldDef(t),i=r.sort;if(AH(i))return{op:"min",field:qK(r,t),order:"ascending"};const{stack:o}=e,a=o?[...o.groupbyField?[o.groupbyField]:[],...o.stackBy.map((e=>e.fieldDef.field))]:void 0;if(kH(i))return E0(i,o&&!GP(a,i.field));if(wH(i)){const{encoding:t,order:n}=i,r=e.fieldDef(t),{aggregate:s,field:u}=r,l=o&&!GP(a,u);if(zL(s)||RL(s))return E0({field:XH(r),order:n},l);if(PL(s)||!s)return E0({op:s,field:u,order:n},l)}else{if("descending"===i)return{op:"min",field:e.vgField(t),order:"descending"};if(GP(["ascending",void 0],i))return!0}}(n,r,e):void 0;if(RH(o))return MY(k0([o.datum],a,s));const c=o;if("unaggregated"===t){const e=n.requestDataName(WY.Main),{field:t}=o;return MY([{data:e,field:XH({field:t,aggregate:"min"})},{data:e,field:XH({field:t,aggregate:"max"})}])}if(NU(c.bin)){if(dW(e))return MY("bin-ordinal"===e?[]:[{data:sL(l)?n.requestDataName(WY.Main):n.requestDataName(WY.Raw),field:n.vgField(r,gG(c,r)?{binSuffix:"range"}:{}),sort:!0!==l&&gP(l)?l:{field:n.vgField(r,{}),op:"min"}}]);{const{bin:e}=c;if(NU(e)){const t=NQ(n,c.field,e);return MY([new b0((()=>{const e=n.getSignalName(t);return`[${e}.start, ${e}.stop]`}))])}return MY([{data:n.requestDataName(WY.Main),field:n.vgField(r,{})}])}}if(c.timeUnit&&GP(["time","utc"],e)&&MH(r,c,J0(n)?n.encoding[YI(r)]:void 0,n.stack,n.markDef,n.config)){const e=n.requestDataName(WY.Main);return MY([{data:e,field:n.vgField(r)},{data:e,field:n.vgField(r,{suffix:"end"})}])}return MY(l?[{data:sL(l)?n.requestDataName(WY.Main):n.requestDataName(WY.Raw),field:n.vgField(r),sort:l}]:[{data:n.requestDataName(WY.Main),field:n.vgField(r)}])}function E0(e,t){const{op:n,field:r,order:i}=e;return Object.assign(Object.assign({op:null!=n?n:t?"sum":bH},r?{field:gL(r)}:{}),i?{order:i}:{})}function O0(e,t){var n;const r=e.component.scales[t],i=e.specifiedScales[t].domain,o=null===(n=e.fieldDef(t))||void 0===n?void 0:n.bin,a=mW(i)&&i,s=TU(o)&&zU(o.extent)&&o.extent;(a||s)&&r.set("selectionExtent",null!=a?a:s,!0)}function D0(e,t){const{aggregate:n,type:r}=e;return n?EP(n)&&!qL[n]?{valid:!1,reason:iq(n)}:"quantitative"===r&&"log"===t?{valid:!1,reason:oq(e)}:{valid:!0}:{valid:!1,reason:rq(e)}}function S0(e,t,n,r){return e.explicit&&t.explicit&&pq(function(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${qP(n)} and ${qP(r)}). Using the union of the two domains.`}(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function C0(e){if($q(e)&&EP(e.field))return e.field;if(function(e){return!pP(e)&&"fields"in e&&!("data"in e)}(e)){let t;for(const n of e.fields)if($q(n)&&EP(n.field))if(t){if(t!==n.field)return pq("Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect."),t}else t=n.field;return pq("Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect."),t}if(function(e){return!pP(e)&&"fields"in e&&"data"in e}(e)){pq("Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.");const t=e.fields[0];return EP(t)?t:void 0}}function F0(e,t){return function(e){const t=JP(e.map((e=>{if($q(e)){const{sort:t}=e;return x0(e,["sort"])}return e})),WP),n=JP(e.map((e=>{if($q(e)){const t=e.sort;return void 0===t||sL(t)||("op"in t&&"count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}})).filter((e=>void 0!==e)),WP);if(0===t.length)return;if(1===t.length){const t=e[0];if($q(t)&&n.length>0){let e=n[0];if(n.length>1)pq(uq),e=!0;else if(gP(e)&&"field"in e){const n=e.field;t.field===n&&(e=!e.order||{order:e.order})}return Object.assign(Object.assign({},t),{sort:e})}return t}const r=JP(n.map((e=>sL(e)||!("op"in e)||EP(e.op)&&e.op in TL?e:(pq(function(e){return`Dropping sort property ${qP(e)} as unioned domains only support boolean or op "count", "min", and "max".`}(e)),!0))),WP);let i;1===r.length?i=r[0]:r.length>1&&(pq(uq),i=!0);const o=JP(e.map((e=>$q(e)?e.data:null)),(e=>e));return 1===o.length&&null!==o[0]?Object.assign({data:o[0],fields:t.map((e=>e.field))},i?{sort:i}:{}):Object.assign({fields:t},i?{sort:i}:{})}(e.component.scales[t].get("domains").map((t=>($q(t)&&(t.data=e.lookupDataSource(t.data)),t))))}var j0=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ie.concat(M0(t))),$0(e)):$0(e)}function $0(e){return iL(e.component.scales).reduce(((t,n)=>{const r=e.component.scales[n];if(r.merged)return t;const i=r.combine(),{name:o,type:a,selectionExtent:s,domains:u,range:l,reverse:c}=i,f=j0(i,["name","type","selectionExtent","domains","range","reverse"]),d=function(e,t,n,r){if(dU(n)){if(Mq(e))return{step:{signal:t+"_step"}}}else if(gP(e)&&$q(e))return Object.assign(Object.assign({},e),{data:r.lookupDataSource(e.data)});return e}(i.range,o,n,e);let h;s&&(h=function(e,t){const n=t.selection;return{signal:SK(e.getSelectionComponent(n,uL(n)),t)}}(e,s));const p=F0(e,n);return t.push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:o,type:a},p?{domain:p}:{}),h?{domainRaw:h}:{}),{range:d}),void 0!==c?{reverse:c}:{}),f)),t}),[])}class N0 extends FY{constructor(e,t){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",t)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||VP(this.get("domains"),(e=>pP(e)&&2===e.length&&e[0]<=0&&e[1]>=0))}}const B0=["range","scheme"];function T0(e){return"x"===e?"width":"y"===e?"height":void 0}function z0(e,t){const n=e.fieldDef(t);if(n&&n.bin&&NU(n.bin)){const r=NQ(e,n.field,n.bin),i=T0(t),o=e.getName(i);return new b0((()=>{const t=e.getSignalName(r),n=`(${t}.stop - ${t}.start) / ${t}.step`;return`${e.getSignalName(o)} / (${n})`}))}}function R0(e,t){const n=t.specifiedScales[e],{size:r}=t,i=t.getScaleComponent(e).get("type");for(const r of B0)if(void 0!==n[r]){const o=OW(i,r),a=DW(e,r);if(o)if(a)pq(a);else switch(r){case"range":{const r=n.range;if(pP(r)){if(dU(e))return jY(r.map((e=>{if("width"===e||"height"===e){const n=t.getName(e),r=t.getSignalName.bind(t);return b0.fromName(r,n)}return e})))}else if(gP(r))return jY({data:t.requestDataName(WY.Main),field:r.field,sort:{op:"min",field:t.vgField(e)}});return jY(r)}case"scheme":return jY(P0(n[r]))}else pq(aq(i,r,e))}if(e===YL||e===XL){const t=e===YL?"width":"height",n=r[t];if($V(n)){if(dW(i))return jY({step:n.step});pq(sq(t))}}const{rangeMin:o,rangeMax:a}=n,s=function(e,t){const{size:n,config:r,mark:i,encoding:o}=t,a=t.getSignalName.bind(t),{type:s}=aG(o[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case YL:case XL:{if(GP(["point","band"],u))if(e!==YL||n.width){if(e===XL&&!n.height){const e=PV(r.view,"height");if($V(e))return e}}else{const e=PV(r.view,"width");if($V(e))return e}const i=T0(e),o=t.getName(i);return e===XL&&hW(u)?[b0.fromName(a,o),0]:[0,b0.fromName(a,o)]}case cI:{const o=L0(i,t.component.scales[e].get("zero"),r),a=function(e,t,n,r){const i={x:z0(n,"x"),y:z0(n,"y")};switch(e){case"bar":case"tick":{if(void 0!==r.scale.maxBandSize)return r.scale.maxBandSize;const e=U0(t,i,r.view);return AP(e)?e-1:new b0((()=>`${e.signal} - 1`))}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const e=U0(t,i,r.view);return AP(e)?Math.pow(I0*e,2):new b0((()=>`pow(${I0} * ${e.signal}, 2)`))}}throw new Error(eq("size",e))}(i,n,t,r);return gW(u)?function(e,t,n){const r=()=>{const r=EG(t),i=EG(e),o=`(${r} - ${i}) / (${n} - 1)`;return`sequence(${i}, ${r} + ${o}, ${o})`};return jq(t)?new b0(r):{signal:r()}}(o,a,function(e,t,n,r){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return void 0!==n&&pP(n)?n.length+1:(pq(function(e){return`Domain for ${e} is required for threshold scale.`}(r)),3)}}(u,r,l,e)):[o,a]}case eI:return[0,2*Math.PI];case fI:return[0,360];case KL:return[0,new b0((()=>`min(${t.getSignalName("width")},${t.getSignalName("height")})/2`))];case gI:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case mI:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case lI:return"symbol";case aI:case sI:case uI:return"ordinal"===u?"nominal"===s?"category":"ordinal":void 0!==c?"diverging":"rect"===i||"geoshape"===i?"heatmap":"ramp";case dI:case hI:case pI:return[r.scale.minOpacity,r.scale.maxOpacity]}throw new Error(`Scale range undefined for channel ${e}`)}(e,t);return(void 0!==o||void 0!==a)&&OW(i,"rangeMin")&&pP(s)&&2===s.length?jY([null!=o?o:s[0],null!=a?a:s[1]]):MY(s)}function P0(e){return function(e){return!EP(e)&&!!e.name}(e)?Object.assign({scheme:e.name},UP(e,["name"])):{scheme:e}}function L0(e,t,n){if(t)return jq(t)?{signal:`${t.signal} ? 0 : ${L0(e,!1,n)}`}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(eq("size",e))}const I0=.95;function U0(e,t,n){const r=$V(e.width)?e.width.step:RV(n,"width"),i=$V(e.height)?e.height.step:RV(n,"height");return t.x||t.y?new b0((()=>`min(${[t.x?t.x.signal:r,t.y?t.y.signal:i].join(", ")})`)):Math.min(r,i)}function q0(e,t){J0(e)?function(e,t){const n=e.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:a}=e;for(const s of iL(n)){const u=a[s],l=n[s],c=e.getScaleComponent(s),f=aG(i[s]),d=u[t],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=OW(h,t),y=DW(s,t);if(void 0!==d&&(m?y&&pq(y):pq(aq(h,t,s))),m&&void 0===y)if(void 0!==d){const e=f.timeUnit,n=f.type;switch(t){case"domainMax":case"domainMin":gq(u[t])||"temporal"===n||e?l.set(t,{signal:hG(u[t],{type:n,timeUnit:e})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const n=t in W0?W0[t]({model:e,channel:s,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:u.domain,markDef:o,config:r}):r.scale[t];void 0!==n&&l.set(t,n,!1)}}}(e,t):G0(e,t)}const W0={bins:({model:e,fieldOrDatumDef:t})=>TH(t)?function(e,t){const n=t.bin;if(NU(n)){const r=NQ(e,t.field,n);return new b0((()=>e.getSignalName(r)))}if(BU(n)&&TU(n)&&void 0!==n.step)return{step:n.step}}(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>function(e,t){if(GP([aI,sI,uI],e)&&"nominal"!==t)return"hcl"}(e,t.type),nice:({scaleType:e,channel:t,fieldOrDatumDef:n})=>function(e,t,n){var r;if(!(null===(r=oG(n))||void 0===r?void 0:r.bin)&&!GP([tW.TIME,tW.UTC],e))return t in cU||void 0}(e,t,n),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:r,config:i})=>function(e,t,n,r,i,o){if(e in cU){if(pW(t)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:t,orient:a}=i;if("bar"===t&&(!TH(r)||!r.bin&&!r.timeUnit)&&("vertical"===a&&"x"===e||"horizontal"===a&&"y"===e))return o.continuousBandSize}if(t===tW.POINT)return n.pointPadding}}(e,t,i.scale,n,r,i.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,config:r})=>function(e,t,n,r){if(void 0===e&&t in cU){const{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:i}=r;return bL(e,"bar"===n?t:i)}}(e,t,n.type,r.scale),paddingOuter:({scalePadding:e,channel:t,scaleType:n,markDef:r,scalePaddingInner:i,config:o})=>function(e,t,n,r,i,o){if(void 0===e&&t in cU&&n===tW.BAND){const{bandPaddingOuter:e}=o;return bL(e,jq(i)?{signal:`${i.signal}/2`}:i/2)}}(e,t,n,r.type,i,o.scale),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:r})=>function(e,t,n,r){return"x"===n&&void 0!==r.xReverse?hW(e)&&"descending"===t?jq(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse:!(!hW(e)||"descending"!==t)||void 0}(t,TH(e)?e.sort:void 0,n,r.scale),zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:r,scaleType:i})=>function(e,t,n,r,i){if(n&&"unaggregated"!==n&&hW(i)){if(pP(n)){const e=n[0],t=n[n.length-1];if(e<=0&&t>=0)return!0}return!1}if("size"===e&&"quantitative"===t.type&&!gW(i))return!0;if((!TH(t)||!t.bin)&&GP([...fU,...pU],e)){const{orient:t,type:n}=r;return!GP(["bar","area","line","trail"],n)||!("horizontal"===t&&"y"===e||"vertical"===t&&"x"===e)}return!1}(e,t,n,r,i)};function H0(e){J0(e)?function(e){const t=e.component.scales;for(const n of DU){const r=t[n];if(!r)continue;const i=R0(n,e);r.setWithExplicit("range",i)}}(e):G0(e,"range")}function G0(e,t){const n=e.component.scales;for(const n of e.children)"range"===t?H0(n):q0(n,t);for(const r of iL(n)){let i;for(const n of e.children){const e=n.component.scales[r];e&&(i=BY(i,e.getWithExplicit(t),t,"scale",$Y(((e,n)=>"range"===t&&e.step&&n.step?e.step-n.step:0))))}n[r].setWithExplicit(t,i)}}function V0(e){J0(e)?e.component.scales=function(e){const{encoding:t,mark:n}=e;return DU.reduce(((r,i)=>{const o=aG(t[i]);if(o&&n===WW&&i===lI&&o.type===eW)return r;let a=o&&o.scale;if(o&&null!==a&&!1!==a){a=null!=a?a:{};const t=function(e,t,n,r){const i=function(e,t,n){var r;switch(t.type){case"nominal":case"ordinal":if(FI(e)||"discrete"===MU(e))return"shape"===e&&"ordinal"===t.type&&pq(nq(e,"ordinal")),"ordinal";if(e in cU){if(GP(["rect","bar","image","rule"],n))return"band"}else if("arc"===n&&e in hU)return"band";return void 0!==t.band||HH(t)&&(null===(r=t.axis)||void 0===r?void 0:r.tickBand)?"band":"point";case"temporal":return FI(e)?"time":"discrete"===MU(e)?(pq(nq(e,"temporal")),"ordinal"):TH(t)&&t.timeUnit&&Fq(t.timeUnit).utc?"utc":"time";case"quantitative":return FI(e)?TH(t)&&NU(t.bin)?"bin-ordinal":"linear":"discrete"===MU(e)?(pq(nq(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(JU(t.type))}(t,n,r),{type:o}=e;return SU(t)?void 0!==o?function(e,t){if(!SU(e))return!1;switch(e){case YL:case XL:case eI:case KL:return pW(t)||GP(["band","point"],t);case cI:case gI:case dI:case hI:case pI:case fI:return pW(t)||gW(t)||GP(["band","point","ordinal"],t);case aI:case sI:case uI:return"band"!==t;case mI:return"ordinal"===t||gW(t);case lI:return"ordinal"===t}}(t,o)?TH(n)&&(a=o,s=n.type,!(GP([Jq,Qq],s)?void 0===a||dW(a):s===Kq?GP([tW.TIME,tW.UTC,void 0],a):s!==Zq||GP([tW.LOG,tW.POW,tW.SQRT,tW.SYMLOG,tW.QUANTILE,tW.QUANTIZE,tW.THRESHOLD,tW.LINEAR,void 0],a)))?(pq(function(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}(o,i)),i):o:(pq(function(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}(t,o,i)),i):i:null;var a,s}(a,i,o,n);r[i]=new N0(e.scaleName(i+"",!0),{value:t,explicit:a.type===t})}return r}),{})}(e):e.component.scales=function(e){var t;const n=e.component.scales={},r={},i=e.component.resolve;for(const n of e.children){V0(n);for(const o of iL(n.component.scales))if(i.scale[o]=null!==(t=i.scale[o])&&void 0!==t?t:fQ(o,e),"shared"===i.scale[o]){const e=r[o],t=n.component.scales[o].getWithExplicit("type");e?rW(e.value,t.value)?r[o]=BY(e,t,"type","scale",Y0):(i.scale[o]="independent",delete r[o]):r[o]=t}}for(const t of iL(r)){const i=e.scaleName(t,!0),o=r[t];n[t]=new N0(i,o);for(const n of e.children){const e=n.component.scales[t];e&&(n.renameScale(e.get("name"),i),e.merged=!0)}}return n}(e)}const Y0=$Y(((e,t)=>oW(e)-oW(t)));var X0=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i(e.from&&e.from.data&&(e.from.data=this.lookupDataSource(e.from.data)),e.from&&e.from.facet&&e.from.facet.data&&(e.from.facet.data=this.lookupDataSource(e.from.facet.data)),e),this.parent=n,this.config=i,this.view=CW(a),this.name=null!==(s=e.name)&&void 0!==s?s:r,this.title=vG(e.title)?{text:e.title}:e.title?this.initTitle(e.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new Z0,this.projectionNameMap=n?n.projectionNameMap:new Z0,this.signalNameMap=n?n.signalNameMap:new Z0,this.data=e.data,this.description=e.description,this.transforms=(null!==(u=e.transform)&&void 0!==u?u:[]).map((e=>HY(e)?{filter:RP(e.filter,Yq)}:e)),this.layout="layer"===t||"unit"===t?{}:function(e,t,n){var r,i;const o=n[t],a={},{spacing:s,columns:u}=o;void 0!==s&&(a.spacing=s),void 0!==u&&(DH(e)&&!EH(e.facet)||FV(e))&&(a.columns=u),jV(e)&&(a.columns=1);for(const t of BV)if(void 0!==e[t])if("spacing"===t){const n=e[t];a[t]=AP(n)?n:{row:null!==(r=n.row)&&void 0!==r?r:s,column:null!==(i=n.column)&&void 0!==i?i:s}}else a[t]=e[t];return a}(e,t,i),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:DH(e)||n&&n.component.data.isFaceted&&void 0===e.data},layoutSize:new FY,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:Object.assign({scale:{},axis:{},legend:{}},o?LP(o):{}),selection:null,scales:null,projection:null,axes:{},legends:{}}}initTitle(e){const t=iL(e),n={text:_G(e.text)};for(const r of t)n[r]=_G(e[r]);return n}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){!function(e,{ignoreRange:t}={}){V0(e),_0(e);for(const t of EW)q0(e,t);t||H0(e)}(this)}parseProjection(){MQ(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){AQ(this)}assembleGroupStyle(){var e,t;if("unit"===this.type||"layer"===this.type)return null!==(t=null===(e=this.view)||void 0===e?void 0:e.style)&&void 0!==t?t:"cell"}assembleEncodeFromView(e){const{style:t}=e,n=X0(e,["style"]),r={};for(const e of iL(n)){const t=n[e];void 0!==t&&(r[e]=kG(t))}return r}assembleGroupEncodeEntry(e){let t={};return this.view&&(t=this.assembleEncodeFromView(this.view)),e||(this.description&&(t.description=kG(this.description)),"unit"!==this.type&&"layer"!==this.type)?rL(t)?void 0:t:Object.assign({width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height")},null!=t?t:{})}assembleLayout(){if(!this.layout)return;const e=this.layout,{spacing:t}=e,n=X0(e,["spacing"]),{component:r,config:i}=this,o=function(e,t){const n={};for(const r of MI){const i=e[r];if(null==i?void 0:i.facetFieldDef){const{titleAnchor:e,titleOrient:o}=GK(["titleAnchor","titleOrient"],i.facetFieldDef.header,t,r),a=WK(r,o),s=rQ(e,a);void 0!==s&&(n[a]=s)}}return rL(n)?void 0:n}(r.layoutHeaders,i);return Object.assign(Object.assign(Object.assign({padding:t},this.assembleDefaultLayout()),n),o?{titleBand:o}:{})}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let t=[];for(const n of MI)e[n].title&&t.push(XK(this,n));for(const e of VK)t=t.concat(KK(this,e));return t}assembleAxes(){return function(e,t){const{x:n=[],y:r=[]}=e;return[...n.map((e=>MK(e,"grid",t))),...r.map((e=>MK(e,"grid",t))),...n.map((e=>MK(e,"main",t))),...r.map((e=>MK(e,"main",t)))].filter((e=>e))}(this.component.axes,this.config)}assembleLegends(){return SQ(this)}assembleProjections(){return e1(e=this)||Q0(e)?function(e){return e.children.reduce(((e,t)=>e.concat(t.assembleProjections())),CQ(e))}(e):CQ(e);var e}assembleTitle(){var e,t,n;const r=null!==(e=this.title)&&void 0!==e?e:{},{encoding:i}=r,o=X0(r,["encoding"]),a=Object.assign(Object.assign(Object.assign({},yG(this.config.title).nonMark),o),i?{encode:{update:i}}:{});if(a.text)return GP(["unit","layer"],this.type)?GP(["middle",void 0],a.anchor)&&(a.frame=null!==(t=a.frame)&&void 0!==t?t:"group"):a.anchor=null!==(n=a.anchor)&&void 0!==n?n:"start",rL(a)?void 0:a}assembleGroup(e=[]){const t={};(e=e.concat(this.assembleSignals())).length>0&&(t.signals=e);const n=this.assembleLayout();n&&(t.layout=n),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||K0(this.parent)?M0(this):[];r.length>0&&(t.scales=r);const i=this.assembleAxes();i.length>0&&(t.axes=i);const o=this.assembleLegends();return o.length>0&&(t.legends=o),t}getName(e){return uL((this.name?this.name+"_":"")+e)}getDataName(e){return this.getName(WY[e].toLowerCase())}requestDataName(e){const t=this.getDataName(e),n=this.component.data.outputNodeRefCounts;return n[t]=(n[t]||0)+1,t}getSizeSignalRef(e){if(K0(this.parent)){const t=gU(lQ(e)),n=this.component.scales[t];if(n&&!n.merged){const e=n.get("type"),r=n.get("range");if(dW(e)&&Mq(r)){const e=n.get("name"),r=C0(F0(this,t));return r?{signal:uQ(e,n,XH({aggregate:"distinct",field:r},{expr:"datum"}))}:(pq(WU(t)),null)}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const t=this.component.data.outputNodes[e];return t?t.getSource():e}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,t){this.signalNameMap.rename(e,t)}renameScale(e,t){this.scaleNameMap.rename(e,t)}renameProjection(e,t){this.projectionNameMap.rename(e,t)}scaleName(e,t){return t?this.getName(e):qI(e)&&SU(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e))?this.scaleNameMap.get(this.getName(e)):void 0}projectionName(e){return e?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const t=this.component.scales[e];return t&&!t.merged?t:this.parent?this.parent.getScaleComponent(e):void 0}getSelectionComponent(e,t){let n=this.component.selection[e];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(e,t)),!n)throw new Error(`Cannot find a selection named "${t}".`);return n}hasAxisOrientSignalRef(){var e,t;return(null===(e=this.component.axes.x)||void 0===e?void 0:e.some((e=>e.hasOrientSignalRef())))||(null===(t=this.component.axes.y)||void 0===t?void 0:t.some((e=>e.hasOrientSignalRef())))}}class n1 extends t1{vgField(e,t={}){const n=this.fieldDef(e);if(n)return XH(n,t)}reduceFieldDef(e,t){return function(e,t,n,r){return e?iL(e).reduce(((n,i)=>{const o=e[i];return pP(o)?o.reduce(((e,n)=>t.call(r,e,n,i)),n):t.call(r,n,o,i)}),n):n}(this.getMapping(),((t,n,r)=>{const i=oG(n);return i?e(t,i,r):t}),t)}forEachFieldDef(e,t){qG(this.getMapping(),((t,n)=>{const r=oG(t);r&&e(r,n)}),t)}}class r1 extends tZ{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=LP(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:"value",null!==(i=o[1])&&void 0!==i?i:"density"]}clone(){return new r1(null,LP(this.transform))}dependentFields(){var e;return new Set([this.transform.density,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${WP(this.transform)}`}assemble(){const e=this.transform,{density:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const o=SU(i)&&t.getScaleComponent(i);return o&&hW(o.get("type"))&&"count"!==n.aggregate&&!HW(r)&&(e[n.field]=n),e}),{});return iL(o).length?new i1(e,o):null}dependentFields(){return new Set(iL(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${WP(this.filter)}`}assemble(){const e=iL(this.filter).reduce(((e,t)=>{const n=this.filter[t],r=XH(n,{expr:"datum"});return null!==n&&("temporal"===n.type?e.push(`(isDate(${r}) || (isValid(${r}) && isFinite(+${r})))`):"quantitative"===n.type&&(e.push(`isValid(${r})`),e.push(`isFinite(+${r})`))),e}),[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}class o1 extends tZ{constructor(e,t){super(e),this.transform=t,this.transform=LP(t);const{flatten:n,as:r=[]}=this.transform;this.transform.as=n.map(((e,t)=>{var n;return null!==(n=r[t])&&void 0!==n?n:e}))}clone(){return new o1(this.parent,LP(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${WP(this.transform)}`}assemble(){const{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}class a1 extends tZ{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=LP(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:"key",null!==(i=o[1])&&void 0!==i?i:"value"]}clone(){return new a1(null,LP(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${WP(this.transform)}`}assemble(){const{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}class s1 extends tZ{constructor(e,t,n,r){super(e),this.fields=t,this.geojson=n,this.signal=r}clone(){return new s1(null,LP(this.fields),this.geojson,this.signal)}static parseAll(e,t){if(t.component.projection&&!t.component.projection.isFit)return e;let n=0;for(const r of[[rI,nI],[oI,iI]]){const i=r.map((e=>{const n=aG(t.encoding[e]);return TH(n)?n.field:RH(n)?{expr:`${n.datum}`}:qH(n)?{expr:`${n.value}`}:void 0}));(i[0]||i[1])&&(e=new s1(e,i,null,t.getName("geojson_"+n++)))}if(t.channelHasField(lI)){const r=t.typedFieldDef(lI);r.type===eW&&(e=new s1(e,null,r.field,t.getName("geojson_"+n++)))}return e}dependentFields(){var e;const t=(null!==(e=this.fields)&&void 0!==e?e:[]).filter(EP);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${WP(this.fields)}`}assemble(){return Object.assign(Object.assign(Object.assign({type:"geojson"},this.fields?{fields:this.fields}:{}),this.geojson?{geojson:this.geojson}:{}),{signal:this.signal})}}class u1 extends tZ{constructor(e,t,n,r){super(e),this.projection=t,this.fields=n,this.as=r}clone(){return new u1(null,this.projection,LP(this.fields),LP(this.as))}static parseAll(e,t){if(!t.projectionName())return e;for(const n of[[rI,nI],[oI,iI]]){const r=n.map((e=>{const n=aG(t.encoding[e]);return TH(n)?n.field:RH(n)?{expr:`${n.datum}`}:qH(n)?{expr:`${n.value}`}:void 0})),i=n[0]===oI?"2":"";(r[0]||r[1])&&(e=new u1(e,t.projectionName(),r,[t.getName("x"+i),t.getName("y"+i)]))}return e}dependentFields(){return new Set(this.fields.filter(EP))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${WP(this.fields)} ${WP(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class l1 extends tZ{constructor(e,t){super(e),this.transform=t}clone(){return new l1(null,LP(this.transform))}dependentFields(){var e;return new Set([this.transform.impute,this.transform.key,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:t=0,stop:n,step:r}=e;return{signal:`sequence(${[t,n,...r?[r]:[]].join(",")})`}}static makeFromTransform(e,t){return new l1(e,t)}static makeFromEncoding(e,t){const n=t.encoding,r=n.x,i=n.y;if(TH(r)&&TH(i)){const o=r.impute?r:i.impute?i:void 0;if(void 0===o)return;const a=r.impute?i:i.impute?r:void 0,{method:s,value:u,frame:l,keyvals:c}=o.impute,f=WG(t.mark,n);return new l1(e,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({impute:o.field,key:a.field},s?{method:s}:{}),void 0!==u?{value:u}:{}),l?{frame:l}:{}),void 0!==c?{keyvals:c}:{}),f.length?{groupby:f}:{}))}return null}hash(){return`Impute ${WP(this.transform)}`}assemble(){const{impute:e,key:t,keyvals:n,method:r,groupby:i,value:o,frame:a=[null,null]}=this.transform,s=Object.assign(Object.assign(Object.assign(Object.assign({type:"impute",field:e,key:t},n?{keyvals:GY(n)?this.processSequence(n):n}:{}),{method:"value"}),i?{groupby:i}:{}),{value:r&&"value"!==r?null:o});return r&&"value"!==r?[s,Object.assign({type:"window",as:[`imputed_${e}_value`],ops:[r],fields:[e],frame:a,ignorePeers:!1},i?{groupby:i}:{}),{type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e}]:[s]}}class c1 extends tZ{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=LP(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:t.on,null!==(i=o[1])&&void 0!==i?i:t.loess]}clone(){return new c1(null,LP(this.transform))}dependentFields(){var e;return new Set([this.transform.loess,this.transform.on,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${WP(this.transform)}`}assemble(){const e=this.transform,{loess:t,on:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ie))}producedFields(){}dependentFields(){var e;return new Set([this.transform.pivot,this.transform.value,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}hash(){return`PivotTransform ${WP(this.transform)}`}assemble(){const{pivot:e,value:t,groupby:n,limit:r,op:i}=this.transform;return Object.assign(Object.assign(Object.assign({type:"pivot",field:e,value:t},void 0!==r?{limit:r}:{}),void 0!==i?{op:i}:{}),void 0!==n?{groupby:n}:{})}}class g1 extends tZ{constructor(e,t){super(e),this.transform=t}clone(){return new g1(null,LP(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${WP(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function m1(e){let t=0;return function n(r,i){var o;if(r instanceof HQ&&!r.isGenerator&&!zY(r.data)&&(e.push(i),i={name:null,source:i.name,transform:[]}),r instanceof IQ&&(r.parent instanceof HQ&&!i.source?(i.format=Object.assign(Object.assign({},null!==(o=i.format)&&void 0!==o?o:{}),{parse:r.assembleFormatParse()}),i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof RQ){i.name||(i.name="data_"+t++),!i.source||i.transform.length>0?(e.push(i),r.data=i.name):r.data=i.source;for(const t of r.assemble())e.push(t)}else switch((r instanceof qQ||r instanceof WQ||r instanceof i1||r instanceof EK||r instanceof UK||r instanceof u1||r instanceof s1||r instanceof zQ||r instanceof f1||r instanceof f0||r instanceof l0||r instanceof a1||r instanceof o1||r instanceof r1||r instanceof c1||r instanceof d1||r instanceof h1||r instanceof UQ||r instanceof g1||r instanceof p1)&&i.transform.push(r.assemble()),(r instanceof TQ||r instanceof iZ||r instanceof l1||r instanceof c0)&&i.transform.push(...r.assemble()),r instanceof nZ&&(i.source&&0===i.transform.length?r.setSource(i.source):r.parent instanceof nZ?r.setSource(i.name):(i.name||(i.name="data_"+t++),r.setSource(i.name),1===r.numChildren()&&(e.push(i),i={name:null,source:i.name,transform:[]}))),r.numChildren()){case 0:r instanceof nZ&&(!i.source||i.transform.length>0)&&e.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name="data_"+t++);let o=i.name;!i.source||i.transform.length>0?e.push(i):o=i.source;for(const e of r.children)n(e,{name:null,source:o,transform:[]});break}}}}function y1(e,t){var n;const{facet:r,config:i,child:o,component:a}=e;if(e.channelHasField(t)){const s=r[t],u=HK("title",null,i,t);let l=tG(s,i,{allowDisabling:!0,includeDefault:void 0===u||!!u});o.component.layoutHeaders[t].title&&(l=pP(l)?l.join(", "):l,l+=" / "+o.component.layoutHeaders[t].title,o.component.layoutHeaders[t].title=null);const c=HK("labelOrient",s,i,t),f=bL((null!==(n=s.header)&&void 0!==n?n:{}).labels,i.header.labels,!0),d=GP(["bottom","right"],c)?"footer":"header";a.layoutHeaders[t]={title:l,facetFieldDef:s,[d]:"facet"===t?[]:[v1(e,t,f)]}}}function v1(e,t,n){const r="row"===t?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(r)?e.child.getSizeSignalRef(r):void 0,axes:[]}}function b1(e,t){var n;const{child:r}=e;if(r.component.axes[t]){const{layoutHeaders:o,resolve:a}=e.component;if(a.axis[t]=dQ(a,t),"shared"===a.axis[t]){const a="x"===t?"column":"row",s=o[a];for(const o of r.component.axes[t]){const t="top"===(i=o.get("orient"))||"left"===i||jq(i)?"header":"footer";s[t]=null!==(n=s[t])&&void 0!==n?n:[v1(e,a,!1)];const r=MK(o,"main",e.config,{header:!0});r&&s[t][0].axes.push(r),o.mainExtracted=!0}}}var i}function x1(e){for(const t of e.children)t.parseLayoutSize()}function _1(e,t){const n=lQ(t),r=gU(n),i=e.component.resolve,o=e.component.layoutSize;let a;for(const t of e.children){const e=t.component.layoutSize.getWithExplicit(n),o=i.scale[r];if("independent"===o&&"step"===e.value){a=void 0;break}if(a){if("independent"===o&&a.value!==e.value){a=void 0;break}a=BY(a,e,n,"")}else a=e}if(a){for(const r of e.children)e.renameSignal(r.getName(n),e.getName(t)),r.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,a)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function w1(e,t){const n="width"===t?"x":"y",r=e.config,i=e.getScaleComponent(n);if(i){const e=i.get("type"),n=i.get("range");if(dW(e)){const e=PV(r.view,t);return Mq(n)||$V(e)?"step":e}return zV(r.view,t)}if(e.hasProjection||"arc"===e.mark)return zV(r.view,t);{const e=PV(r.view,t);return $V(e)?e.step:e}}function k1(e,t,n){return XH(t,Object.assign({suffix:`by_${XH(e)}`},null!=n?n:{}))}class A1 extends n1{constructor(e,t,n,r){super(e,"facet",t,n,r,e.resolve),this.child=H1(e.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!EH(e))return{facet:this.initFacetFieldDef(e,"facet")};const t=iL(e),n={};for(const r of t){if(!GP([HL,GL],r)){pq(eq(r,"facet"));break}const t=e[r];if(void 0===t.field){pq(QU(t,r));break}n[r]=this.initFacetFieldDef(t,r)}return n}initFacetFieldDef(e,t){const{header:n}=e,r=lG(function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0?{aggregate:Object.assign(Object.assign({},u?{cross:u}:{}),i.length?{fields:i,ops:o,as:a}:{})}:{})}facetSortFields(e){const{facet:t}=this,n=t[e];return n?kH(n.sort)?[k1(n,n.sort,{expr:"datum"})]:pP(n.sort)?[qK(n,e,{expr:"datum"})]:[XH(n,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:t}=this,n=t[e];if(n){const{sort:e}=n;return[(kH(e)?e.order:!pP(e)&&e)||"ascending"]}return[]}assembleLabelTitle(){var e;const{facet:t,config:n}=this;if(t.facet)return eQ(t.facet,"facet",n);const r={row:["top","bottom"],column:["left","right"]};for(const i of VK)if(t[i]){const o=HK("labelOrient",null===(e=t[i])||void 0===e?void 0:e.header,n,i);if(GP(r[i],o))return eQ(t[i],i,n)}}assembleMarks(){const{child:e}=this,t=function(e){const t=[],n=m1(t);for(const t of e.children)n(t,{source:e.name,name:null,transform:[]});return t}(this.component.data.facetRoot),n=e.assembleGroupEncodeEntry(!1),r=this.assembleLabelTitle()||e.assembleTitle(),i=e.assembleGroupStyle();return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:this.getName("cell"),type:"group"},r?{title:r}:{}),i?{style:i}:{}),{from:{facet:this.assembleFacet()},sort:{field:MI.map((e=>this.facetSortFields(e))).flat(),order:MI.map((e=>this.facetSortOrder(e))).flat()}}),t.length>0?{data:t}:{}),n?{encode:{update:n}}:{}),e.assembleGroup(function(e,t){if(e.component.selection&&iL(e.component.selection).length){const n=OP(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:wX("mousemove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return FZ(t)}(this,[])))]}getMapping(){return this.facet}}function E1(e,t){var n,r,i,o;for(const a of t){const t=a.data;if(e.name&&a.hasName()&&e.name!==a.dataName)continue;const s=null===(n=e.format)||void 0===n?void 0:n.mesh,u=null===(r=t.format)||void 0===r?void 0:r.feature;if(s&&u)continue;const l=null===(i=e.format)||void 0===i?void 0:i.feature;if((l||u)&&l!==u)continue;const c=null===(o=t.format)||void 0===o?void 0:o.mesh;if(!s&&!c||s===c)if(RY(e)&&RY(t)){if(PP(e.values,t.values))return a}else if(zY(e)&&zY(t)){if(e.url===t.url)return a}else if(PY(e)&&e.name===a.dataName)return a}return null}function O1(e){var t,n,r,i,o,a,s,u,l,c;let f=function(e,t){if(e.data||!e.parent){if(null===e.data){const e=new HQ({values:[]});return t.push(e),e}const n=E1(e.data,t);if(n)return LY(e.data)||(n.data.format=XP({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const n=new HQ(e.data);return t.push(n),n}}return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}(e,e.component.data.sources);const{outputNodes:d,outputNodeRefCounts:h}=e.component.data,p=e.parent?e.parent.component.data.ancestorParse.clone():new TY,g=e.data;LY(g)?(IY(g)?f=new WQ(f,g.sequence):qY(g)&&(f=new qQ(f,g.graticule)),p.parseNothing=!0):null===(null===(t=null==g?void 0:g.format)||void 0===t?void 0:t.parse)&&(p.parseNothing=!0),f=null!==(n=IQ.makeExplicit(f,e,p))&&void 0!==n?n:f,f=new UQ(f);const m=e.parent&&e1(e.parent);(J0(e)||K0(e))&&m&&(f=null!==(r=TQ.makeFromEncoding(f,e))&&void 0!==r?r:f),e.transforms.length>0&&(f=function(e,t,n){var r,i;let o=0;for(const a of t.transforms){let s,u;if(rX(a))u=e=new UK(e,a),s="derived";else if(HY(a)){const i=LQ(a);u=e=null!==(r=IQ.makeWithAncestors(e,{},i,n))&&void 0!==r?r:e,e=new EK(e,t,a.filter)}else if(iX(a))u=e=TQ.makeFromTransform(e,a,t),s="number";else if(aX(a))s="date",void 0===n.getWithExplicit(a.field).value&&(e=new IQ(e,{[a.field]:s}),n.set(a.field,s,!1)),u=e=iZ.makeFromTransform(e,a);else if(sX(a))u=e=zQ.makeFromTransform(e,a),s="number",WZ(t)&&(e=new UQ(e));else if(VY(a))u=e=f1.make(e,t,a,o++),s="derived";else if(eX(a))u=e=new f0(e,a),s="number";else if(tX(a))u=e=new l0(e,a),s="number";else if(uX(a))u=e=c0.makeFromTransform(e,a),s="derived";else if(lX(a))u=e=new a1(e,a),s="derived";else if(nX(a))u=e=new o1(e,a),s="derived";else if(YY(a))u=e=new p1(e,a),s="derived";else if(QY(a))e=new g1(e,a);else if(oX(a))u=e=l1.makeFromTransform(e,a),s="derived";else if(XY(a))u=e=new r1(e,a),s="derived";else if(ZY(a))u=e=new d1(e,a),s="derived";else if(JY(a))u=e=new h1(e,a),s="derived";else{if(!KY(a)){pq(`Ignoring an invalid transform: ${qP(a)}.`);continue}u=e=new c1(e,a),s="derived"}if(u&&void 0!==s)for(const e of null!==(i=u.producedFields())&&void 0!==i?i:[])n.set(e,s,!1)}return e}(f,e,p));const y=function(e){const t={};if(J0(e)&&e.component.selection)for(const n of iL(e.component.selection)){const r=e.component.selection[n];for(const e of r.project.items)!e.channel&&vL(e.field)>1&&(t[e.field]="flatten")}return t}(e),v=function(e){const t={};function n(e){var n;dG(e)?t[e.field]="date":"quantitative"===e.type&&EP(n=e.aggregate)&&GP(["min","max"],n)?t[e.field]="number":vL(e.field)>1?e.field in t||(t[e.field]="flatten"):WH(e)&&kH(e.sort)&&vL(e.sort.field)>1&&(e.sort.field in t||(t[e.sort.field]="flatten"))}if((J0(e)||K0(e))&&e.forEachFieldDef(((t,r)=>{if(UH(t))n(t);else{const i=GI(r),o=e.fieldDef(i);n(Object.assign(Object.assign({},t),{type:o.type}))}})),J0(e)){const{mark:n,markDef:r,encoding:i}=e;if(HW(n)&&!e.encoding.order){const e=i["horizontal"===r.orient?"y":"x"];TH(e)&&"quantitative"===e.type&&!(e.field in t)&&(t[e.field]="number")}}return t}(e);f=null!==(i=IQ.makeWithAncestors(f,{},Object.assign(Object.assign({},y),v),p))&&void 0!==i?i:f,J0(e)&&(f=s1.parseAll(f,e),f=u1.parseAll(f,e)),(J0(e)||K0(e))&&(m||(f=null!==(o=TQ.makeFromEncoding(f,e))&&void 0!==o?o:f),f=null!==(a=iZ.makeFromEncoding(f,e))&&void 0!==a?a:f,f=UK.parseAllForSortIndex(f,e));const b=e.getDataName(WY.Raw),x=new nZ(f,b,WY.Raw,h);if(d[b]=x,f=x,J0(e)){const t=zQ.makeFromEncoding(f,e);t&&(f=t,WZ(e)&&(f=new UQ(f))),f=null!==(s=l1.makeFromEncoding(f,e))&&void 0!==s?s:f,f=null!==(u=c0.makeFromEncoding(f,e))&&void 0!==u?u:f}J0(e)&&(f=null!==(l=i1.make(f,e))&&void 0!==l?l:f);const _=e.getDataName(WY.Main),w=new nZ(f,_,WY.Main,h);d[_]=w,f=w,J0(e)&&function(e,t){UZ(e,(n=>{const r=n.name,i=e.getName(`lookup_${r}`);e.component.data.outputNodes[i]=n.materialized=new nZ(new EK(t,e,{selection:r}),i,WY.Lookup,e.component.data.outputNodeRefCounts)}))}(e,w);let k=null;if(K0(e)){const t=e.getName("facet");f=null!==(c=function(e,t){const{row:n,column:r}=t;if(n&&r){let t=null;for(const i of[n,r])if(kH(i.sort)){const{field:n,op:r=bH}=i.sort;e=t=new l0(e,{joinaggregate:[{op:r,field:n,as:k1(i,i.sort,{forAs:!0})}],groupby:[XH(i)]})}return t}return null}(f,e.facet))&&void 0!==c?c:f,k=new RQ(f,e,t,w.getSource()),d[t]=k}return Object.assign(Object.assign({},e.component.data),{outputNodes:d,outputNodeRefCounts:h,raw:x,main:w,facetRoot:k,ancestorParse:p})}class D1 extends t1{constructor(e,t,n,r){var i,o,a,s;super(e,"concat",t,n,r,e.resolve),"shared"!==(null===(o=null===(i=e.resolve)||void 0===i?void 0:i.axis)||void 0===o?void 0:o.x)&&"shared"!==(null===(s=null===(a=e.resolve)||void 0===a?void 0:a.axis)||void 0===s?void 0:s.y)||pq("Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415)."),this.children=this.getChildren(e).map(((e,t)=>H1(e,this,this.getName("concat_"+t),void 0,r)))}parseData(){this.component.data=O1(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of iL(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return jV(e)?e.vconcat:MV(e)?e.hconcat:e.concat}parseLayoutSize(){!function(e){x1(e);const t=1===e.layout.columns?"width":"childWidth",n=void 0===e.layout.columns?"height":"childHeight";_1(e,t),_1(e,n)}(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.forEach((e=>e.assembleSignals())),[]}assembleLayoutSignals(){const e=oQ(this);for(const t of this.children)e.push(...t.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleMarks(){return this.children.map((e=>{const t=e.assembleTitle(),n=e.assembleGroupStyle(),r=e.assembleGroupEncodeEntry(!1);return Object.assign(Object.assign(Object.assign(Object.assign({type:"group",name:e.getName("group")},t?{title:t}:{}),n?{style:n}:{}),r?{encode:{update:r}}:{}),e.assembleGroup())}))}assembleDefaultLayout(){const e=this.layout.columns;return Object.assign(Object.assign({},null!=e?{columns:e}:{}),{bounds:"full",align:"each"})}}const S1=Object.assign(Object.assign({disable:1,gridScale:1,scale:1},jL),{labelExpr:1,encode:1}),C1=iL(S1);class F1 extends FY{constructor(e={},t={},n=!1){super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new F1(LP(this.explicit),LP(this.implicit),this.mainExtracted)}hasAxisPart(e){return!("axis"!==e&&("grid"===e||"title"===e?!this.get(e):(t=this.get(e),!1===t||null===t)));var t}hasOrientSignalRef(){return jq(this.explicit.orient)}}const j1={bottom:"top",top:"bottom",left:"right",right:"left"};function M1(e,t){if(!e)return t.map((e=>e.clone()));{if(e.length!==t.length)return;const n=e.length;for(let r=0;r{switch(n){case"title":return NG(e,t);case"gridScale":return{explicit:e.explicit,value:bL(e.value,t.value)}}return NY(e,t,n,"axis")}));e.setWithExplicit(n,r)}return e}function N1(e,t,n,r,i){if("disable"===t)return void 0!==n;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(jq(n.labelAngle)?n.labelAngle:EL(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===IK(r,i))return!0}return e===n[t]}const B1=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function T1(e,t){var n,r,i;let o=t.axis(e);const a=new F1,s=aG(t.encoding[e]),{mark:u,config:l}=t,c=(null==o?void 0:o.orient)||(null===(n=l["x"===e?"axisX":"axisY"])||void 0===n?void 0:n.orient)||(null===(r=l.axis)||void 0===r?void 0:r.orient)||function(e){return"x"===e?"bottom":"left"}(e),f=t.getScaleComponent(e).get("type"),d=function(e,t,n,r){const i="band"===t?["axisDiscrete","axisBand"]:"point"===t?["axisDiscrete","axisPoint"]:t in uW?["axisQuantitative"]:"time"===t||"utc"===t?["axisTemporal"]:[],o="x"===e?"axisX":"axisY",a=jq(n)?"axisOrient":"axis"+fL(n),s=[...i,...i.map((e=>o+e.substr(4)))],u=["axis",a,o];return{vlOnlyAxisConfig:NK(s,r,e,n),vgAxisConfig:NK(u,r,e,n),axisConfigStyle:BK([...u,...s],r)}}(e,f,c,t.config),h=void 0!==o?!o:TK("disable",l.style,null==o?void 0:o.style,d).configValue;if(a.set("disable",h,void 0!==o),h)return a;o=o||{};const p=function(e,t,n,r,i){const o=null==t?void 0:t.labelAngle;if(void 0!==o)return jq(o)?o:EL(o);{const{configValue:o}=TK("labelAngle",r,null==t?void 0:t.style,i);return void 0!==o?EL(o):n!==YL||!GP([Qq,Jq],e.type)||TH(e)&&e.timeUnit?void 0:270}}(s,o,e,l.style,d),g={fieldOrDatumDef:s,axis:o,channel:e,model:t,scaleType:f,orient:c,labelAngle:p,mark:u,config:l};for(const n of C1){const r=n in zK?zK[n](g):$L(n)?o[n]:void 0,i=void 0!==r,s=N1(r,n,o,t,e);if(i&&s)a.set(n,r,s);else{const{configValue:e,configFrom:t}=$L(n)&&"values"!==n?TK(n,l.style,o.style,d):{},u=void 0!==e;i&&!u?a.set(n,r,s):("vgAxisConfig"!==t||B1.has(n)&&u||SL(e)||jq(e))&&a.set(n,e,!1)}}const m=null!==(i=o.encoding)&&void 0!==i?i:{},y=CL.reduce(((n,r)=>{var i;if(!a.hasAxisPart(r))return n;const o=cQ(null!==(i=m[r])&&void 0!==i?i:{},t),s="labels"===r?function(e,t,n){var r;const{encoding:i,config:o}=e,a=null!==(r=aG(i[t]))&&void 0!==r?r:aG(i[YI(t)]),s=e.axis(t)||{},{format:u,formatType:l}=s;return sH(l)?Object.assign({text:dH({fieldOrDatumDef:a,field:"datum.value",format:u,formatType:l,config:o})},n):n}(t,e,o):o;return void 0===s||rL(s)||(n[r]={update:s}),n}),{});return rL(y)||a.set("encode",y,!!o.encoding||void 0!==o.labelAngle),a}function z1(e,t){const{config:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),BX("x",e,{defaultPos:"mid"})),BX("y",e,{defaultPos:"mid"})),MX("size",e)),MX("angle",e)),function(e,t,n){return n?{shape:{value:n}}:MX("shape",e)}(e,0,t))}function R1(e){var t;const{config:n,markDef:r}=e,{orient:i}=r,o="horizontal"===i?"width":"height",a=e.getScaleComponent("horizontal"===i?"x":"y"),s=null!==(t=DG("size",r,n,{vgChannel:o}))&&void 0!==t?t:n.tick.bandSize;if(void 0!==s)return s;{const e=a?a.get("range"):void 0;return e&&Mq(e)&&AP(e.step)?3*e.step/4:3*RV(n.view,o)/4}}const P1={arc:{vgMark:"arc",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),BX("x",e,{defaultPos:"mid"})),BX("y",e,{defaultPos:"mid"})),qX(e,"radius","arc")),qX(e,"theta","arc"))},area:{vgMark:"area",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"})),LX("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===e.markDef.orient})),LX("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===e.markDef.orient})),ZX(e))},bar:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),qX(e,"x","bar")),qX(e,"y","bar"))},circle:{vgMark:"symbol",encodeEntry:e=>z1(e,"circle")},geoshape:{vgMark:"shape",encodeEntry:e=>Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[Object.assign({type:"geoshape",projection:e.projectionName()},n&&TH(n)&&n.type===eW?{field:XH(n,{expr:"datum"})}:{})]}},image:{vgMark:"image",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"})),qX(e,"x","image")),qX(e,"y","image")),DX(e,"url"))},line:{vgMark:"line",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),BX("x",e,{defaultPos:"mid"})),BX("y",e,{defaultPos:"mid"})),MX("size",e,{vgChannel:"strokeWidth"})),ZX(e))},point:{vgMark:"symbol",encodeEntry:e=>z1(e)},rect:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),qX(e,"x","rect")),qX(e,"y","rect"))},rule:{vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return e.encoding.x||e.encoding.y||e.encoding.latitude||e.encoding.longitude?Object.assign(Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),LX("x",e,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n})),LX("y",e,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n})),MX("size",e,{vgChannel:"strokeWidth"})):{}}},square:{vgMark:"symbol",encodeEntry:e=>z1(e,"square")},text:{vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},YX(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"})),BX("x",e,{defaultPos:"mid"})),BX("y",e,{defaultPos:"mid"})),DX(e)),MX("size",e,{vgChannel:"fontSize"})),MX("angle",e)),JX("align",function(e,t,n){if(void 0===DG("align",e,n))return"center"}(e.markDef,0,t))),JX("baseline",function(e,t,n){if(void 0===DG("baseline",e,n))return"middle"}(e.markDef,0,t))),BX("radius",e,{defaultPos:null,isMidPoint:!0})),BX("theta",e,{defaultPos:null,isMidPoint:!0}))}},tick:{vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,r=n.orient,i="horizontal"===r?"width":"height",o="horizontal"===r?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),BX("x",e,{defaultPos:"mid",vgChannel:"xc"})),BX("y",e,{defaultPos:"mid",vgChannel:"yc"})),MX("size",e,{defaultValue:R1(e),vgChannel:i})),{[o]:kG(DG("thickness",n,t))})}},trail:{vgMark:"trail",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},YX(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),BX("x",e,{defaultPos:"mid"})),BX("y",e,{defaultPos:"mid"})),MX("size",e)),ZX(e))}};const L1="faceted_path_",I1="stack_group_";function U1(e,t={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=e,a=bL(r.clip,function(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return!!(t&&t.get("selectionExtent")||n&&n.get("selectionExtent"))||void 0}(e),function(e){const t=e.component.projection;return!(!t||t.isFit)||void 0}(e)),s=OG(r),u=i.key,l=function(e){const{encoding:t,stack:n,mark:r,markDef:i,config:o}=e,a=t.order;if(!(!pP(a)&&qH(a)&&HP(a.value)||!a&&HP(DG("order",i,o)))){if((pP(a)||TH(a))&&!n)return jG(a,{expr:"datum"});if(HW(r)){const n="horizontal"===i.orient?"y":"x",r=t[n];if(TH(r)){const t=r.sort;return pP(t)?{field:XH(r,{prefix:n,suffix:"sort_index",expr:"datum"})}:kH(t)?{field:XH({aggregate:PG(e.encoding)?t.op:void 0,field:t.field},{expr:"datum"})}:wH(t)?{field:XH(e.fieldDef(t.encoding),{expr:"datum"}),order:t.order}:null===t?void 0:{field:XH(r,{binSuffix:e.stack&&e.stack.impute?"mid":void 0,expr:"datum"})}}}}}(e),c=function(e){if(!e.component.selection)return null;const t=iL(e.component.selection).length;let n=t,r=e.parent;for(;r&&0===n;)n=iL(r.component.selection).length,r=r.parent;return n?{interactive:t>0||!!e.encoding.tooltip}:null}(e),f=DG("aria",r,o),d=P1[n].postEncodingTransform?P1[n].postEncodingTransform(e):null;return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:e.getName("marks"),type:P1[n].vgMark},a?{clip:!0}:{}),s?{style:s}:{}),u?{key:u.field}:{}),l?{sort:l}:{}),c||{}),!1===f?{aria:f}:{}),{from:{data:t.fromPrefix+e.requestDataName(WY.Main)},encode:{update:P1[n].encodeEntry(e)}}),d?{transform:d}:{})]}class q1 extends n1{constructor(e,t,n,r={},i){super(e,"unit",t,n,i,void 0,NV(e)?e.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection={},this.children=[];const o=YW(e.mark)?Object.assign({},e.mark):{type:e.mark},a=o.type;void 0===o.filled&&(o.filled=function(e,t,{graticule:n}){if(n)return!1;const r=SG("filled",e,t),i=e.type;return bL(r,i!==TW&&i!==BW&&i!==RW)}(o,i,{graticule:e.data&&qY(e.data)}));const s=this.encoding=IG(e.encoding||{},a,o.filled,i);this.markDef=function(e,t,n){const r=CW(e),i=DG("orient",r,n);if(r.orient=function(e,t,n){switch(e){case TW:case UW:case qW:case PW:case zW:case NW:return}const{x:r,y:i,x2:o,y2:a}=t;switch(e){case $W:if(TH(r)&&(BU(r.bin)||TH(i)&&i.aggregate&&!r.aggregate))return"vertical";if(TH(i)&&(BU(i.bin)||TH(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o&&(TH(r)&&r.type===Zq&&!NU(r.bin)||LH(r)))return"horizontal";if(!a&&(TH(i)&&i.type===Zq&&!NU(i.bin)||LH(i)))return"vertical"}case RW:if(o&&(!TH(r)||!BU(r.bin))&&a&&(!TH(i)||!BU(i.bin)))return;case MW:if(a)return TH(i)&&BU(i.bin)?"horizontal":"vertical";if(o)return TH(r)&&BU(r.bin)?"vertical":"horizontal";if(e===RW){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case BW:case LW:{const t=PH(r),o=PH(i);if(t&&!o)return"tick"!==e?"horizontal":"vertical";if(!t&&o)return"tick"!==e?"vertical":"horizontal";if(t&&o){const t=r,o=i,a=t.type===Kq,s=o.type===Kq;return a&&!s?"tick"!==e?"vertical":"horizontal":!a&&s?"tick"!==e?"horizontal":"vertical":!t.aggregate&&o.aggregate?"tick"!==e?"vertical":"horizontal":t.aggregate&&!o.aggregate?"tick"!==e?"horizontal":"vertical":n||"vertical"}return n||void 0}}return"vertical"}(r.type,t,i),void 0!==i&&i!==r.orient&&pq(`Specified orient "${r.orient}" overridden with "${i}".`),"bar"===r.type&&r.orient){const e=DG("cornerRadiusEnd",r,n);if(void 0!==e){const n="horizontal"===r.orient&&t.x2||"vertical"===r.orient&&t.y2?["cornerRadius"]:KW[r.orient];for(const t of n)r[t]=e;void 0!==r.cornerRadiusEnd&&delete r.cornerRadiusEnd}}return void 0===DG("opacity",r,n)&&(r.opacity=function(e,t){if(GP([TW,LW,UW,qW],e)&&!PG(t))return.7}(r.type,t)),void 0===DG("cursor",r,n)&&(r.cursor=function(e,t,n){return t.href||e.href||DG("href",e,n)?"pointer":e.cursor}(r,t,n)),r}(o,s,i),this.size=function({encoding:e,size:t}){for(const n of fU){const r=XI(n);$V(t[r])&&PH(e[n])&&(delete t[r],pq(sq(r)))}return t}({encoding:s,size:NV(e)?Object.assign(Object.assign(Object.assign({},r),e.width?{width:e.width}:{}),e.height?{height:e.height}:{}):r}),this.stack=iY(a,s),this.specifiedScales=this.initScales(a,s),this.specifiedAxes=this.initAxes(s),this.specifiedLegends=this.initLegends(s),this.specifiedProjection=e.projection,this.selection=e.selection}get hasProjection(){const{encoding:e}=this,t=this.mark===WW,n=e&&SI.some((t=>IH(e[t])));return t||n}scaleDomain(e){const t=this.specifiedScales[e];return t?t.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,t){return DU.reduce(((e,n)=>{var r;const i=aG(t[n]);return i&&(e[n]=this.initScale(null!==(r=i.scale)&&void 0!==r?r:{})),e}),{})}initScale(e){const{domain:t,range:n}=e,r=CW(e);return pP(t)&&(r.domain=t.map(_G)),pP(n)&&(r.range=n.map(_G)),r}initAxes(e){return fU.reduce(((t,n)=>{const r=e[n];if(IH(r)||n===YL&&IH(e.x2)||n===XL&&IH(e.y2)){const e=IH(r)?r.axis:void 0;t[n]=e?this.initAxis(Object.assign({},e)):e}return t}),{})}initAxis(e){const t=iL(e),n={};for(const r of t){const t=e[r];n[r]=SL(t)?xG(t):_G(t)}return n}initLegends(e){return EU.reduce(((t,n)=>{const r=aG(e[n]);if(r&&function(e){switch(e){case aI:case sI:case uI:case cI:case lI:case dI:case gI:case mI:return!0;case hI:case pI:case fI:return!1}}(n)){const e=r.legend;t[n]=e?CW(e):e}return t}),{})}parseData(){this.component.data=O1(this)}parseLayoutSize(){!function(e){const{size:t,component:n}=e;for(const r of fU){const i=XI(r);if(t[i]){const e=t[i];n.layoutSize.set(i,$V(e)?"step":e,!0)}else{const t=w1(e,i);n.layoutSize.set(i,t,!1)}}}(this)}parseSelections(){this.component.selection=function(e,t){var n;const r={},i=e.config.selection;for(const o of iL(null!=t?t:{})){const a=LP(t[o]),s=i[a.type],{fields:u,encodings:l}=s,c=OK(s,["fields","encodings"]);for(const e in c)"encodings"===e&&a.fields||"fields"===e&&a.encodings||("mark"===e&&(a[e]=Object.assign(Object.assign({},c[e]),a[e])),void 0!==a[e]&&!0!==a[e]||(a[e]=null!==(n=c[e])&&void 0!==n?n:a[e]));const f=uL(o),d=r[f]=Object.assign(Object.assign({},a),{name:f,events:EP(a.on)?wX(a.on,"scope"):LP(a.on)});DZ(d,(n=>{n.has(d)&&n.parse&&n.parse(e,d,a,t[o])}))}return r}(this,this.selection)}parseMarkGroup(){this.component.mark=function(e){if(GP([BW,MW,IW],e.mark)){const t=WG(e.mark,e.encoding);if(t.length>0)return function(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:L1+e.requestDataName(WY.Main),data:e.requestDataName(WY.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:U1(e,{fromPrefix:L1})}]}(e,t)}else if(GP([$W],e.mark)){const t=Tq.some((t=>DG(t,e.markDef,e.config)));if(e.stack&&!e.fieldDef("size")&&t)return function(e){const[t]=U1(e,{fromPrefix:I1}),n=e.scaleName(e.stack.fieldChannel),r=(t={})=>e.vgField(e.stack.fieldChannel,t),i=(e,t)=>`${e}(${[r({prefix:"min",suffix:"start",expr:t}),r({prefix:"max",suffix:"start",expr:t}),r({prefix:"min",suffix:"end",expr:t}),r({prefix:"max",suffix:"end",expr:t})].map((e=>`scale('${n}',${e})`)).join(",")})`;let o,a;"x"===e.stack.fieldChannel?(o=Object.assign(Object.assign({},IP(t.encode.update,["y","yc","y2","height",...Tq])),{x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}}),a={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update=Object.assign(Object.assign({},UP(t.encode.update,["y","yc","y2"])),{height:{field:{group:"height"}}})):(o=Object.assign(Object.assign({},IP(t.encode.update,["x","xc","x2","width"])),{y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}}),a={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update=Object.assign(Object.assign({},UP(t.encode.update,["x","xc","x2"])),{width:{field:{group:"width"}}}));for(const n of Tq){const r=SG(n,e.markDef,e.config);t.encode.update[n]?(o[n]=t.encode.update[n],delete t.encode.update[n]):r&&(o[n]=kG(r)),r&&(t.encode.update[n]={value:0})}const s=e.fieldDef(e.stack.groupbyChannel),u=XH(s)?[XH(s)]:[];return((null==s?void 0:s.bin)||(null==s?void 0:s.timeUnit))&&u.push(XH(s,{binSuffix:"end"})),o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce(((n,r)=>{if(t.encode.update[r])return Object.assign(Object.assign({},n),{[r]:t.encode.update[r]});{const t=SG(r,e.markDef,e.config);return void 0!==t?Object.assign(Object.assign({},n),{[r]:kG(t)}):n}}),o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(WY.Main),name:I1+e.requestDataName(WY.Main),groupby:u,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:a},marks:[t]}]}]}(e)}return U1(e)}(this)}parseAxesAndHeaders(){var e;this.component.axes=(e=this,fU.reduce(((t,n)=>(e.component.scales[n]&&(t[n]=[T1(n,e)]),t)),{}))}assembleSelectionTopLevelSignals(e){return function(e,t){let n=!1;if(UZ(e,((r,i)=>{const o=r.name,a=OP(o+RZ);if(0===t.filter((e=>e.name===o)).length){const e="global"===r.resolve?"union":r.resolve,n="multi"===r.type?", true)":")";t.push({name:r.name,update:`${LZ}(${a}, ${OP(e)}${n}`})}n=!0,i.topLevelSignals&&(t=i.topLevelSignals(e,r,t)),DZ(r,(n=>{n.topLevelSignals&&(t=n.topLevelSignals(e,r,t))}))})),n){0===t.filter((e=>"unit"===e.name)).length&&t.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]})}return FZ(t)}(this,e)}assembleSignals(){return[...$K(this),...(e=this,t=[],UZ(e,((n,r)=>{const i=n.name;let o=r.modifyExpr(e,n);t.push(...r.signals(e,n)),DZ(n,(r=>{r.signals&&(t=r.signals(e,n,t)),r.modifyExpr&&(o=r.modifyExpr(e,n,o))})),t.push({name:i+"_modify",on:[{events:{signal:n.name+PZ},update:`modify(${OP(n.name+RZ)}, ${o})`}]})})),FZ(t))];var e,t}assembleSelectionData(e){return function(e,t){const n=[...t];return UZ(e,(t=>{const r={name:t.name+RZ};if(t.init){const n=t.project.items.map((e=>{const{signals:t}=e;return function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);iSZ(e,!1)));r.values="interval"===t.type?[{unit:qZ(e,{escape:!1}),fields:n,values:i}]:i.map((t=>({unit:qZ(e,{escape:!1}),fields:n,values:t})))}n.filter((e=>e.name===t.name+RZ)).length||n.push(r)})),n}(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return oQ(this)}assembleMarks(){var e;let t=null!==(e=this.component.mark)&&void 0!==e?e:[];return this.parent&&e1(this.parent)||(t=CZ(this,t)),t.map(this.correctDataNames)}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return RG(this.encoding,e)}fieldDef(e){return oG(this.encoding[e])}typedFieldDef(e){const t=this.fieldDef(e);return UH(t)?t:null}}class W1 extends t1{constructor(e,t,n,r,i){super(e,"layer",t,n,i,e.resolve,e.view);const o=Object.assign(Object.assign(Object.assign({},r),e.width?{width:e.width}:{}),e.height?{height:e.height}:{});this.children=e.layer.map(((e,t)=>{if(KV(e))return new W1(e,this,this.getName("layer_"+t),o,i);if(BG(e))return new q1(e,this,this.getName("layer_"+t),o,i);throw new Error(PU(e))}))}parseData(){this.component.data=O1(this);for(const e of this.children)e.parseData()}parseLayoutSize(){x1(this),_1(this,"width"),_1(this,"height")}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of iL(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){!function(e){var t;const{axes:n,resolve:r}=e.component,i={top:0,bottom:0,right:0,left:0};for(const t of e.children){t.parseAxesAndHeaders();for(const i of iL(t.component.axes))r.axis[i]=dQ(e.component.resolve,i),"shared"===r.axis[i]&&(n[i]=M1(n[i],t.component.axes[i]),n[i]||(r.axis[i]="independent",delete n[i]))}for(const o of fU){for(const a of e.children)if(a.component.axes[o]){if("independent"===r.axis[o]){n[o]=(null!==(t=n[o])&&void 0!==t?t:[]).concat(a.component.axes[o]);for(const e of a.component.axes[o]){const{value:t,explicit:n}=e.getWithExplicit("orient");if(!jq(t)){if(i[t]>0&&!n){const n=j1[t];i[t]>i[n]&&e.set("orient",n,!1)}i[t]++}}}delete a.component.axes[o]}if("independent"===r.axis[o]&&n[o]&&n[o].length>1)for(const e of n[o])e.get("grid")&&!e.explicit.grid&&(e.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleSignals())),$K(this))}assembleLayoutSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleLayoutSignals())),oQ(this))}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const t of this.children)if(e=t.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return function(e,t){for(const n of e.children)J0(n)&&(t=CZ(n,t));return t}(this,this.children.flatMap((e=>e.assembleMarks())))}assembleLegends(){return this.children.reduce(((e,t)=>e.concat(t.assembleLegends())),SQ(this))}}function H1(e,t,n,r,i){if(DH(e))return new A1(e,t,n,i);if(KV(e))return new W1(e,t,n,r,i);if(BG(e))return new q1(e,t,n,r,i);if(function(e){return jV(e)||MV(e)||FV(e)}(e))return new D1(e,t,n,i);throw new Error(PU(e))}var G1=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1)));const{params:f}=t,d=G1(t,["params"]);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({$schema:"https://vega.github.io/schema/vega/v5.json"},e.description?{description:e.description}:{}),d),s?{title:s}:{}),u?{style:u}:{}),l?{encode:{update:l}}:{}),{data:o}),a.length>0?{projections:a}:{}),e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([]),...EV(f)])),i?{config:i}:{}),r?{usermeta:r}:{})}(i,function(e,t,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");if(void 0===t?(t={type:"pad"},r.hasAxisOrientSignalRef()&&(t.resize=!0)):EP(t)&&(t={type:t}),i&&o&&("fit"===(a=t.type)||"fit-x"===a||"fit-y"===a))if("step"===i&&"step"===o)pq(qU()),t.type="pad";else if("step"===i||"step"===o){const e="step"===i?"width":"height";pq(qU(gU(e)));const n="width"===e?"height":"width";t.type=function(e){return e?`fit-${gU(e)}`:"fit"}(n)}var a;return Object.assign(Object.assign(Object.assign({},1===iL(t).length&&t.type?"pad"===t.type?{}:{autosize:t.type}:{autosize:t}),CY(n,!1)),CY(e,!0))}(e,r.autosize,n,i),e.datasets,e.usermeta);return{spec:o,normalized:r}}finally{t.logger&&(hq=dq),t.fieldTitle&&eG(KH)}}const Y1=function(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}};const X1="#fff",Z1="#888",J1={background:"#333",view:{stroke:Z1},title:{color:X1,subtitleColor:X1},style:{"guide-label":{fill:X1},"guide-title":{fill:X1}},axis:{domainColor:X1,gridColor:Z1,tickColor:X1}},K1="#4572a7",Q1={background:"#fff",arc:{fill:K1},area:{fill:K1},line:{stroke:K1,strokeWidth:2},path:{stroke:K1},rect:{fill:K1},shape:{stroke:K1},symbol:{fill:K1,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},e2="#30a2da",t2="#cbcbcb",n2="#f0f0f0",r2="#333",i2={arc:{fill:e2},area:{fill:e2},axis:{domainColor:t2,grid:!0,gridColor:t2,gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:t2,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:n2,group:{fill:n2},legend:{labelColor:r2,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:r2,titleFontSize:14,titlePadding:10},line:{stroke:e2,strokeWidth:2},path:{stroke:e2,strokeWidth:.5},rect:{fill:e2},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:e2},bar:{binSpacing:2,fill:e2,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},o2="#000",a2={group:{fill:"#e5e5e5"},arc:{fill:o2},area:{fill:o2},line:{stroke:o2},path:{stroke:o2},rect:{fill:o2},shape:{stroke:o2},symbol:{fill:o2,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},s2="Benton Gothic, sans-serif",u2="#82c6df",l2="Benton Gothic Bold, sans-serif",c2="normal",f2={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},d2={background:"#ffffff",title:{anchor:"start",color:"#000000",font:l2,fontSize:22,fontWeight:"normal"},arc:{fill:u2},area:{fill:u2},line:{stroke:u2,strokeWidth:2},path:{stroke:u2},rect:{fill:u2},shape:{stroke:u2},symbol:{fill:u2,size:30},axis:{labelFont:s2,labelFontSize:11.5,labelFontWeight:"normal",titleFont:l2,titleFontSize:13,titleFontWeight:c2},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:s2,labelFontSize:11.5,symbolType:"square",titleFont:l2,titleFontSize:13,titleFontWeight:c2},range:{category:f2["category-6"],diverging:f2["fireandice-6"],heatmap:f2["fire-7"],ordinal:f2["fire-7"],ramp:f2["fire-7"]}},h2="#ab5787",p2="#979797",g2={background:"#f9f9f9",arc:{fill:h2},area:{fill:h2},line:{stroke:h2},path:{stroke:h2},rect:{fill:h2},shape:{stroke:h2},symbol:{fill:h2,size:30},axis:{domainColor:p2,domainWidth:.5,gridWidth:.2,labelColor:p2,tickColor:p2,tickWidth:.2,titleColor:p2},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},m2="#3e5c69",y2={background:"#fff",arc:{fill:m2},area:{fill:m2},line:{stroke:m2},path:{stroke:m2},rect:{fill:m2},shape:{stroke:m2},symbol:{fill:m2},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},v2="#1696d2",b2="#000000",x2="Lato",_2="Lato",w2={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},k2={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:x2},axisX:{domain:!0,domainColor:b2,domainWidth:1,grid:!1,labelFontSize:12,labelFont:_2,labelAngle:0,tickColor:b2,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:x2},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:_2,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:x2,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:_2,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:x2,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:w2["six-groups-cat-1"],diverging:w2["diverging-colors"],heatmap:w2["diverging-colors"],ordinal:w2["six-groups-seq"],ramp:w2["shades-blue"]},area:{fill:v2},rect:{fill:v2},line:{color:v2,stroke:v2,strokeWidth:5},trail:{color:v2,stroke:v2,strokeWidth:0,size:1},path:{stroke:v2,strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:v2,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:v2,stroke:null}},arc:{fill:v2},shape:{stroke:v2},symbol:{fill:v2,size:30}},A2="#3366CC",E2="#ccc",O2="Arial, sans-serif",D2={arc:{fill:A2},area:{fill:A2},path:{stroke:A2},rect:{fill:A2},shape:{stroke:A2},symbol:{stroke:A2},circle:{fill:A2},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:O2,fontSize:12},"guide-title":{font:O2,fontSize:12},"group-title":{font:O2,fontSize:12}},title:{font:O2,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:E2,tickColor:E2,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},S2=e=>e*(1/3+1),C2=S2(9),F2=S2(10),j2=S2(12),M2="Segoe UI",$2="wf_standard-font, helvetica, arial, sans-serif",N2="#252423",B2="#605E5C",T2="transparent",z2="#118DFF",R2="#DEEFFF",P2=[R2,z2],L2={view:{stroke:T2},background:T2,font:M2,header:{titleFont:$2,titleFontSize:j2,titleColor:N2,labelFont:M2,labelFontSize:F2,labelColor:B2},axis:{ticks:!1,grid:!1,domain:!1,labelColor:B2,labelFontSize:C2,titleFont:$2,titleColor:N2,titleFontSize:j2,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:"#C8C6C4",gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:z2},line:{stroke:z2,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:M2,fontSize:C2,fill:B2},arc:{fill:z2},area:{fill:z2,line:!0,opacity:.6},path:{stroke:z2},rect:{fill:z2},point:{fill:z2,filled:!0,size:75},shape:{stroke:z2},symbol:{fill:z2,strokeWidth:1.5,size:50},legend:{titleFont:M2,titleFontWeight:"bold",titleColor:B2,labelFont:M2,labelFontSize:F2,labelColor:B2,symbolType:"circle",symbolSize:75},range:{category:[z2,"#12239E","#E66C37","#6B007B","#E044A7","#744EC2","#D9B300","#D64550"],diverging:P2,heatmap:P2,ordinal:[R2,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",z2]}},I2="2.12.1";function U2(e,t){return JSON.stringify(e,function(e){const t=[];return function(n,r){if("object"!=typeof r||null===r)return r;const i=t.indexOf(this)+1;return t.length=i,t.length>e?"[Object]":t.indexOf(r)>=0?"[Circular]":(t.push(r),r)}}(t))}const q2="vg-tooltip-element",W2={offsetX:10,offsetY:10,id:q2,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(e){return String(e).replace(/&/g,"&").replace(/t(vt(e)?e:U2(e,n)))).join(", ")}]`;if(we(e)){let r="";const i=e,{title:o,image:a}=i,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i${t(o)}`),a&&(r+=``);const u=Object.keys(s);if(u.length>0){r+="";for(const e of u){let i=s[e];void 0!==i&&(we(i)&&(i=U2(i,n)),r+=``)}r+="
${t(e)}:${t(i)}
"}return r||"{}"}return t(e)}};class H2{constructor(e){this.options=Object.assign(Object.assign({},W2),e);const t=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const e=document.createElement("style");e.setAttribute("id",this.options.styleId),e.innerHTML=function(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return"#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black;\n}\n#vg-tooltip-element.visible {\n visibility: visible;\n}\n#vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px;\n}\n#vg-tooltip-element img {\n max-width: 200px;\n max-height: 200px;\n}\n#vg-tooltip-element table {\n border-spacing: 0;\n}\n#vg-tooltip-element table tr {\n border: none;\n}\n#vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px;\n}\n#vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px;\n}\n#vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left;\n}\n#vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white;\n}\n#vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf;\n}\n".toString().replace(q2,e)}(t);const n=document.head;n.childNodes.length>0?n.insertBefore(e,n.childNodes[0]):n.appendChild(e)}}tooltipHandler(e,t,n,r){var i;if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(null!==(i=document.fullscreenElement)&&void 0!==i?i:document.body).appendChild(this.el)),null==r||""===r)return void this.el.classList.remove("visible",`${this.options.theme}-theme`);this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:o,y:a}=function(e,t,n,r){let i=e.clientX+n;i+t.width>window.innerWidth&&(i=+e.clientX-n-t.width);let o=e.clientY+r;return o+t.height>window.innerHeight&&(o=+e.clientY-r-t.height),{x:i,y:o}}(t,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${a}px`,this.el.style.left=`${o}px`}}function G2(e){return G2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},G2(e)}function V2(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==G2(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==G2(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===G2(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y2(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function X2(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Y2(o,r,i,a,s,"next",e)}function s(e){Y2(o,r,i,a,s,"throw",e)}a(void 0)}))}}var Z2,J2=Object.prototype,K2=J2.hasOwnProperty,Q2="function"==typeof Symbol?Symbol:{},e3=Q2.iterator||"@@iterator",t3=Q2.asyncIterator||"@@asyncIterator",n3=Q2.toStringTag||"@@toStringTag";function r3(e,t,n,r){var i=t&&t.prototype instanceof c3?t:c3,o=Object.create(i.prototype),a=new k3(r||[]);return o._invoke=function(e,t,n){var r=o3;return function(i,o){if(r===s3)throw new Error("Generator is already running");if(r===u3){if("throw"===i)throw o;return E3()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=x3(a,n);if(s){if(s===l3)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===o3)throw r=u3,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=s3;var u=i3(e,t,n);if("normal"===u.type){if(r=n.done?u3:a3,u.arg===l3)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=u3,n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function i3(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}var o3="suspendedStart",a3="suspendedYield",s3="executing",u3="completed",l3={};function c3(){}function f3(){}function d3(){}var h3={};h3[e3]=function(){return this};var p3=Object.getPrototypeOf,g3=p3&&p3(p3(A3([])));g3&&g3!==J2&&K2.call(g3,e3)&&(h3=g3);var m3=d3.prototype=c3.prototype=Object.create(h3);function y3(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function v3(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f3||"GeneratorFunction"===(t.displayName||t.name))}function b3(e,t){function n(r,i,o,a){var s=i3(e[r],e,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&K2.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,o,a)}),(function(e){n("throw",e,o,a)})):t.resolve(l).then((function(e){u.value=e,o(u)}),(function(e){return n("throw",e,o,a)}))}a(s.arg)}var r;this._invoke=function(e,i){function o(){return new t((function(t,r){n(e,i,t,r)}))}return r=r?r.then(o,o):o()}}function x3(e,t){var n=e.iterator[t.method];if(n===Z2){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=Z2,x3(e,t),"throw"===t.method))return l3;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l3}var r=i3(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l3;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=Z2),t.delegate=null,l3):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l3)}function _3(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w3(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k3(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_3,this),this.reset(!0)}function A3(e){if(e){var t=e[e3];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=K2.call(i,"catchLoc"),s=K2.call(i,"finallyLoc");if(a&&s){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&K2.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w3(n),l3}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;w3(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:A3(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=Z2),l3}};var O3,D3,S3={wrap:r3,isGeneratorFunction:v3,AsyncIterator:b3,mark:function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d3):(e.__proto__=d3,n3 in e||(e[n3]="GeneratorFunction")),e.prototype=Object.create(m3),e},awrap:function(e){return{__await:e}},async:function(e,t,n,r,i){void 0===i&&(i=Promise);var o=new b3(r3(e,t,n,r),i);return v3(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},keys:function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},values:A3},C3=F3;function F3(e){var t=this;if(t instanceof F3||(t=new F3),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},F3.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},F3.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},F3.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},F3.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new F3;if(tthis.length&&(t=this.length);for(var r=0,i=this.head;null!==i&&rthis.length&&(t=this.length);for(var r=this.length,i=this.tail;null!==i&&r>t;r--)i=i.prev;for(;null!==i&&r>e;r--,i=i.prev)n.push(i.value);return n},F3.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,r=this.head;null!==r&&n1,V3=(e,t,n)=>{var r=e[W3].get(t);if(r){var i=r.value;if(Y3(e,i)){if(Z3(e,r),!e[P3])return}else n&&(e[H3]&&(r.value.now=Date.now()),e[q3].unshiftNode(r));return i.value}},Y3=(e,t)=>{if(!t||!t.maxAge&&!e[L3])return!1;var n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[L3]&&n>e[L3]},X3=e=>{if(e[z3]>e[T3])for(var t=e[q3].tail;e[z3]>e[T3]&&null!==t;){var n=t.prev;Z3(e,t),t=n}},Z3=(e,t)=>{if(t){var n=t.value;e[I3]&&e[I3](n.key,n.value),e[z3]-=n.length,e[W3].delete(n.key),e[q3].removeNode(t)}};class J3{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}var K3=(e,t,n,r)=>{var i=n.value;Y3(e,i)&&(Z3(e,n),e[P3]||(i=void 0)),i&&t.call(r,i.value,i.key,e)},Q3=["includePrerelease","loose","rtl"],e5=e=>e?"object"!=typeof e?{loose:!0}:Q3.filter((t=>e[t])).reduce(((e,t)=>(e[t]=!0,e)),{}):{},t5={},n5={get exports(){return t5},set exports(e){t5=e}},r5={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16},i5="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){for(var e=arguments.length,t=new Array(e),n=0;n{};!function(e,t){var n=r5.MAX_SAFE_COMPONENT_LENGTH,r=i5,i=(t=e.exports={}).re=[],o=t.src=[],a=t.t={},s=0,u=(e,t,n)=>{var u=s++;r(e,u,t),a[e]=u,o[u]=t,i[u]=new RegExp(t,n?"g":void 0)};u("NUMERICIDENTIFIER","0|[1-9]\\d*"),u("NUMERICIDENTIFIERLOOSE","[0-9]+"),u("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),u("MAINVERSION","(".concat(o[a.NUMERICIDENTIFIER],")\\.")+"(".concat(o[a.NUMERICIDENTIFIER],")\\.")+"(".concat(o[a.NUMERICIDENTIFIER],")")),u("MAINVERSIONLOOSE","(".concat(o[a.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(o[a.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(o[a.NUMERICIDENTIFIERLOOSE],")")),u("PRERELEASEIDENTIFIER","(?:".concat(o[a.NUMERICIDENTIFIER],"|").concat(o[a.NONNUMERICIDENTIFIER],")")),u("PRERELEASEIDENTIFIERLOOSE","(?:".concat(o[a.NUMERICIDENTIFIERLOOSE],"|").concat(o[a.NONNUMERICIDENTIFIER],")")),u("PRERELEASE","(?:-(".concat(o[a.PRERELEASEIDENTIFIER],"(?:\\.").concat(o[a.PRERELEASEIDENTIFIER],")*))")),u("PRERELEASELOOSE","(?:-?(".concat(o[a.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(o[a.PRERELEASEIDENTIFIERLOOSE],")*))")),u("BUILDIDENTIFIER","[0-9A-Za-z-]+"),u("BUILD","(?:\\+(".concat(o[a.BUILDIDENTIFIER],"(?:\\.").concat(o[a.BUILDIDENTIFIER],")*))")),u("FULLPLAIN","v?".concat(o[a.MAINVERSION]).concat(o[a.PRERELEASE],"?").concat(o[a.BUILD],"?")),u("FULL","^".concat(o[a.FULLPLAIN],"$")),u("LOOSEPLAIN","[v=\\s]*".concat(o[a.MAINVERSIONLOOSE]).concat(o[a.PRERELEASELOOSE],"?").concat(o[a.BUILD],"?")),u("LOOSE","^".concat(o[a.LOOSEPLAIN],"$")),u("GTLT","((?:<|>)?=?)"),u("XRANGEIDENTIFIERLOOSE","".concat(o[a.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),u("XRANGEIDENTIFIER","".concat(o[a.NUMERICIDENTIFIER],"|x|X|\\*")),u("XRANGEPLAIN","[v=\\s]*(".concat(o[a.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(o[a.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(o[a.XRANGEIDENTIFIER],")")+"(?:".concat(o[a.PRERELEASE],")?").concat(o[a.BUILD],"?")+")?)?"),u("XRANGEPLAINLOOSE","[v=\\s]*(".concat(o[a.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(o[a.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(o[a.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(o[a.PRERELEASELOOSE],")?").concat(o[a.BUILD],"?")+")?)?"),u("XRANGE","^".concat(o[a.GTLT],"\\s*").concat(o[a.XRANGEPLAIN],"$")),u("XRANGELOOSE","^".concat(o[a.GTLT],"\\s*").concat(o[a.XRANGEPLAINLOOSE],"$")),u("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:$|[^\\d])"),u("COERCERTL",o[a.COERCE],!0),u("LONETILDE","(?:~>?)"),u("TILDETRIM","(\\s*)".concat(o[a.LONETILDE],"\\s+"),!0),t.tildeTrimReplace="$1~",u("TILDE","^".concat(o[a.LONETILDE]).concat(o[a.XRANGEPLAIN],"$")),u("TILDELOOSE","^".concat(o[a.LONETILDE]).concat(o[a.XRANGEPLAINLOOSE],"$")),u("LONECARET","(?:\\^)"),u("CARETTRIM","(\\s*)".concat(o[a.LONECARET],"\\s+"),!0),t.caretTrimReplace="$1^",u("CARET","^".concat(o[a.LONECARET]).concat(o[a.XRANGEPLAIN],"$")),u("CARETLOOSE","^".concat(o[a.LONECARET]).concat(o[a.XRANGEPLAINLOOSE],"$")),u("COMPARATORLOOSE","^".concat(o[a.GTLT],"\\s*(").concat(o[a.LOOSEPLAIN],")$|^$")),u("COMPARATOR","^".concat(o[a.GTLT],"\\s*(").concat(o[a.FULLPLAIN],")$|^$")),u("COMPARATORTRIM","(\\s*)".concat(o[a.GTLT],"\\s*(").concat(o[a.LOOSEPLAIN],"|").concat(o[a.XRANGEPLAIN],")"),!0),t.comparatorTrimReplace="$1$2$3",u("HYPHENRANGE","^\\s*(".concat(o[a.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(o[a.XRANGEPLAIN],")")+"\\s*$"),u("HYPHENRANGELOOSE","^\\s*(".concat(o[a.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(o[a.XRANGEPLAINLOOSE],")")+"\\s*$"),u("STAR","(<|>)?=?\\s*\\*"),u("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),u("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(n5,t5);var o5,a5,s5,u5,l5=/^[0-9]+$/,c5=(e,t)=>{var n=l5.test(e),r=l5.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:ed5)throw new TypeError("version is longer than ".concat(d5," characters"));f5("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var r=t.trim().match(n.loose?p5[g5.LOOSE]:p5[g5.FULL]);if(!r)throw new TypeError("Invalid Version: ".concat(t));if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>h5||this.major<0)throw new TypeError("Invalid major version");if(this.minor>h5||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>h5||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(0===y5(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: ".concat(e))}return this.format(),this.raw=this.version,this}},b5=v5,x5=(e,t,n)=>new b5(e,n).compare(new b5(t,n)),_5=x5,w5=x5,k5=x5,A5=x5,E5=x5,O5=x5,D5=(e,t,n)=>0===_5(e,t,n),S5=(e,t,n)=>0!==w5(e,t,n),C5=(e,t,n)=>k5(e,t,n)>0,F5=(e,t,n)=>A5(e,t,n)>=0,j5=(e,t,n)=>E5(e,t,n)<0,M5=(e,t,n)=>O5(e,t,n)<=0,$5=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return D5(e,n,r);case"!=":return S5(e,n,r);case">":return C5(e,n,r);case">=":return F5(e,n,r);case"<":return j5(e,n,r);case"<=":return M5(e,n,r);default:throw new TypeError("Invalid operator: ".concat(t))}};function N5(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return B5(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?B5(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function B5(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nthis.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(e));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((e=>!d(e[0]))),0===this.set.length)this.set=[o];else if(this.set.length>1){var a,s=N5(this.set);try{for(s.s();!(a=s.n()).done;){var u=a.value;if(1===u.length&&h(u[0])){this.set=[u];break}}}catch(e){s.e(e)}finally{s.f()}}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();var t=Object.keys(this.options).join(","),r="parseRange:".concat(t,":").concat(e),a=n.get(r);if(a)return a;var h=this.options.loose,p=h?s[u.HYPHENRANGELOOSE]:s[u.HYPHENRANGE];e=e.replace(p,E(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(s[u.COMPARATORTRIM],l),o("comparator trim",e);var m=(e=(e=(e=e.replace(s[u.TILDETRIM],c)).replace(s[u.CARETTRIM],f)).split(/\s+/).join(" ")).split(" ").map((e=>g(e,this.options))).join(" ").split(/\s+/).map((e=>A(e,this.options)));h&&(m=m.filter((e=>(o("loose invalid filter",e,this.options),!!e.match(s[u.COMPARATORLOOSE]))))),o("range list",m);var y,v=new Map,b=m.map((e=>new i(e,this.options))),x=N5(b);try{for(x.s();!(y=x.n()).done;){var _=y.value;if(d(_))return[_];v.set(_.value,_)}}catch(e){x.e(e)}finally{x.f()}v.size>1&&v.has("")&&v.delete("");var w=[...v.values()];return n.set(r,w),w}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((t=>p(t,n)&&e.set.some((e=>p(e,n)&&t.every((t=>e.every((e=>t.intersects(e,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new a(e,this.options)}catch(e){return!1}for(var t=0;t{e.length=this[R3](e.value,e.key),this[z3]+=e.length}))),X3(this)}get lengthCalculator(){return this[R3]}get length(){return this[z3]}get itemCount(){return this[q3].length}rforEach(e,t){t=t||this;for(var n=this[q3].tail;null!==n;){var r=n.prev;K3(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(var n=this[q3].head;null!==n;){var r=n.next;K3(this,e,n,t),n=r}}keys(){return this[q3].toArray().map((e=>e.key))}values(){return this[q3].toArray().map((e=>e.value))}reset(){this[I3]&&this[q3]&&this[q3].length&&this[q3].forEach((e=>this[I3](e.key,e.value))),this[W3]=new Map,this[q3]=new B3,this[z3]=0}dump(){return this[q3].map((e=>!Y3(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[q3]}set(e,t,n){if((n=n||this[L3])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");var r=n?Date.now():0,i=this[R3](t,e);if(this[W3].has(e)){if(i>this[T3])return Z3(this,this[W3].get(e)),!1;var o=this[W3].get(e).value;return this[I3]&&(this[U3]||this[I3](e,o.value)),o.now=r,o.maxAge=n,o.value=t,this[z3]+=i-o.length,o.length=i,this.get(e),X3(this),!0}var a=new J3(e,t,i,r,n);return a.length>this[T3]?(this[I3]&&this[I3](e,t),!1):(this[z3]+=a.length,this[q3].unshift(a),this[W3].set(e,this[q3].head),X3(this),!0)}has(e){if(!this[W3].has(e))return!1;var t=this[W3].get(e).value;return!Y3(this,t)}get(e){return V3(this,e,!0)}peek(e){return V3(this,e,!1)}pop(){var e=this[q3].tail;return e?(Z3(this,e),e.value):null}del(e){Z3(this,this[W3].get(e))}load(e){this.reset();for(var t=Date.now(),n=e.length-1;n>=0;n--){var r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var o=i-t;o>0&&this.set(r.k,r.v,o)}}}prune(){this[W3].forEach(((e,t)=>V3(this,t,!1)))}}({max:1e3}),r=e5,i=function(){if(a5)return o5;a5=1;var t=Symbol("SemVer ANY");class n{static get ANY(){return t}constructor(e,i){if(i=r(i),e instanceof n){if(e.loose===!!i.loose)return e;e=e.value}s("comparator",e,i),this.options=i,this.loose=!!i.loose,this.parse(e),this.semver===t?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(e){var n=this.options.loose?i[o.COMPARATORLOOSE]:i[o.COMPARATOR],r=e.match(n);if(!r)throw new TypeError("Invalid comparator: ".concat(e));this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=t}toString(){return this.value}test(e){if(s("Comparator.test",e,this.options.loose),this.semver===t||e===t)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return a(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new l(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new l(this.value,t).test(e.semver);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),u=a(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=a(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||i||o&&s||u||c}}o5=n;var r=e5,i=t5.re,o=t5.t,a=$5,s=i5,u=v5,l=e();return o5}(),o=i5,a=v5,s=t5.re,u=t5.t,l=t5.comparatorTrimReplace,c=t5.tildeTrimReplace,f=t5.caretTrimReplace,d=e=>"<0.0.0-0"===e.value,h=e=>""===e.value,p=(e,t)=>{for(var n=!0,r=e.slice(),i=r.pop();n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},g=(e,t)=>(o("comp",e,t),e=b(e,t),o("caret",e),e=y(e,t),o("tildes",e),e=_(e,t),o("xrange",e),e=k(e,t),o("stars",e),e),m=e=>!e||"x"===e.toLowerCase()||"*"===e,y=(e,t)=>e.trim().split(/\s+/).map((e=>v(e,t))).join(" "),v=(e,t)=>{var n=t.loose?s[u.TILDELOOSE]:s[u.TILDE];return e.replace(n,((t,n,r,i,a)=>{var s;return o("tilde",e,t,n,r,i,a),m(n)?s="":m(r)?s=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):m(i)?s=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):a?(o("replaceTilde pr",a),s=">=".concat(n,".").concat(r,".").concat(i,"-").concat(a," <").concat(n,".").concat(+r+1,".0-0")):s=">=".concat(n,".").concat(r,".").concat(i," <").concat(n,".").concat(+r+1,".0-0"),o("tilde return",s),s}))},b=(e,t)=>e.trim().split(/\s+/).map((e=>x(e,t))).join(" "),x=(e,t)=>{o("caret",e,t);var n=t.loose?s[u.CARETLOOSE]:s[u.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,a,s)=>{var u;return o("caret",e,t,n,i,a,s),m(n)?u="":m(i)?u=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):m(a)?u="0"===n?">=".concat(n,".").concat(i,".0").concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".0").concat(r," <").concat(+n+1,".0.0-0"):s?(o("replaceCaret pr",s),u="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(a,"-").concat(s," <").concat(n,".").concat(i,".").concat(+a+1,"-0"):">=".concat(n,".").concat(i,".").concat(a,"-").concat(s," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(a,"-").concat(s," <").concat(+n+1,".0.0-0")):(o("no pr"),u="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(a).concat(r," <").concat(n,".").concat(i,".").concat(+a+1,"-0"):">=".concat(n,".").concat(i,".").concat(a).concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(a," <").concat(+n+1,".0.0-0")),o("caret return",u),u}))},_=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>w(e,t))).join(" ")),w=(e,t)=>{e=e.trim();var n=t.loose?s[u.XRANGELOOSE]:s[u.XRANGE];return e.replace(n,((n,r,i,a,s,u)=>{o("xRange",e,n,r,i,a,s,u);var l=m(i),c=l||m(a),f=c||m(s),d=f;return"="===r&&d&&(r=""),u=t.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(c&&(a=0),s=0,">"===r?(r=">=",c?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):"<="===r&&(r="<",c?i=+i+1:a=+a+1),"<"===r&&(u="-0"),n="".concat(r+i,".").concat(a,".").concat(s).concat(u)):c?n=">=".concat(i,".0.0").concat(u," <").concat(+i+1,".0.0-0"):f&&(n=">=".concat(i,".").concat(a,".0").concat(u," <").concat(i,".").concat(+a+1,".0-0")),o("xRange return",n),n}))},k=(e,t)=>(o("replaceStars",e,t),e.trim().replace(s[u.STAR],"")),A=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(s[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),E=e=>(t,n,r,i,o,a,s,u,l,c,f,d,h)=>(n=m(r)?"":m(i)?">=".concat(r,".0.0").concat(e?"-0":""):m(o)?">=".concat(r,".").concat(i,".0").concat(e?"-0":""):a?">=".concat(n):">=".concat(n).concat(e?"-0":""),u=m(l)?"":m(c)?"<".concat(+l+1,".0.0-0"):m(f)?"<".concat(l,".").concat(+c+1,".0-0"):d?"<=".concat(l,".").concat(c,".").concat(f,"-").concat(d):e?"<".concat(l,".").concat(c,".").concat(+f+1,"-0"):"<=".concat(u),"".concat(n," ").concat(u).trim()),O=(e,t,n)=>{for(var r=0;r0){var s=e[a].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0};return s5}(),z5=(e,t,n)=>{try{t=new T5(t,n)}catch(e){return!1}return t.test(e)};function R5(e,t,n){var r=e.open(t),i=new URL(t).origin,o=40;e.addEventListener("message",(function t(n){n.source===r&&(o=0,e.removeEventListener("message",t,!1))}),!1),setTimeout((function e(){o<=0||(r.postMessage(n,i),setTimeout(e,250),o-=1)}),250)}var P5,L5='.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box;\n}\n.vega-embed.has-actions {\n padding-right: 38px;\n}\n.vega-embed details:not([open]) > :not(summary) {\n display: none !important;\n}\n.vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n cursor: pointer;\n line-height: 0px;\n}\n.vega-embed summary::-webkit-details-marker {\n display: none;\n}\n.vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset;\n}\n.vega-embed summary svg {\n width: 14px;\n height: 14px;\n}\n.vega-embed details[open] summary {\n opacity: 0.7;\n}\n.vega-embed:hover summary, .vega-embed:focus-within summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease;\n}\n.vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left;\n}\n.vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none;\n}\n.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {\n background-color: #f7f7f9;\n color: black;\n}\n.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute;\n}\n.vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid rgba(0, 0, 0, 0);\n border-bottom-color: #d9d9d9;\n}\n.vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid rgba(0, 0, 0, 0);\n border-bottom-color: #fff;\n}\n.vega-embed .chart-wrapper.fit-x {\n width: 100%;\n}\n.vega-embed .chart-wrapper.fit-y {\n height: 100%;\n}\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: auto;\n padding-right: 14px;\n}\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n';function I5(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function W5(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne,"vega-lite":(e,t)=>X5.compile(e,{config:t}).spec},n6='\n\n \n \n \n',r6="chart-wrapper";function i6(e,t,n,r){var i="".concat(t,'
'),o="
".concat(n,""),a=window.open("");a.document.write(i+e+o),a.document.title="".concat(Q5[r]," JSON Source")}function o6(e,t){if(e.$schema){var n,r=Y1(e.$schema);t&&t!==r.library&&console.warn("The given visualization spec is written in ".concat(Q5[r.library],", but mode argument sets ").concat(null!==(n=Q5[t])&&void 0!==n?n:t,"."));var i=r.library;return z5(e6[i],"^".concat(r.version.slice(1)))||console.warn("The input spec uses ".concat(Q5[i]," ").concat(r.version,", but the current version of ").concat(Q5[i]," is v").concat(e6[i],".")),i}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":null!=t?t:"vega"}function a6(e){return(t=e)&&"load"in t?e:Y5.loader(e);var t}function s6(e){var t,n,r=null!==(t=null===(n=e.usermeta)||void 0===n?void 0:n.embedOptions)&&void 0!==t?t:{};return vt(r.defaultStyle)&&(r.defaultStyle=!1),r}function u6(e,t){return l6.apply(this,arguments)}function l6(){return l6=X2(S3.mark((function e(t,n){var r,i,o,a,s,u,l,c,f,d,h,p=arguments;return S3.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=p.length>2&&void 0!==p[2]?p[2]:{},!vt(n)){e.next=10;break}return s=a6(o.loader),e.t0=JSON,e.next=6,s.load(n);case 6:e.t1=e.sent,a=e.t0.parse.call(e.t0,e.t1),e.next=11;break;case 10:a=n;case 11:return u=s6(a),l=u.loader,s&&!l||(s=a6(null!==(c=o.loader)&&void 0!==c?c:l)),e.next=16,c6(u,s);case 16:return f=e.sent,e.next=19,c6(o,s);case 19:return d=e.sent,h=G5(G5({},I5(d,f)),{},{config:Ae(null!==(r=d.config)&&void 0!==r?r:{},null!==(i=f.config)&&void 0!==i?i:{})}),e.next=23,h6(t,a,h,s);case 23:return e.abrupt("return",e.sent);case 24:case"end":return e.stop()}}),e)}))),l6.apply(this,arguments)}function c6(e,t){return f6.apply(this,arguments)}function f6(){return f6=X2(S3.mark((function e(t,n){var r,i,o;return S3.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!vt(t.config)){e.next=8;break}return e.t1=JSON,e.next=4,n.load(t.config);case 4:e.t2=e.sent,e.t0=e.t1.parse.call(e.t1,e.t2),e.next=9;break;case 8:e.t0=null!==(r=t.config)&&void 0!==r?r:{};case 9:if(i=e.t0,!vt(t.patch)){e.next=18;break}return e.t4=JSON,e.next=14,n.load(t.patch);case 14:e.t5=e.sent,e.t3=e.t4.parse.call(e.t4,e.t5),e.next=19;break;case 18:e.t3=t.patch;case 19:return o=e.t3,e.abrupt("return",G5(G5(G5({},t),o?{patch:o}:{}),i?{config:i}:{}));case 21:case"end":return e.stop()}}),e)}))),f6.apply(this,arguments)}function d6(e){var t,n=e.getRootNode?e.getRootNode():document;return n instanceof ShadowRoot?{root:n,rootContainer:n}:{root:document,rootContainer:null!==(t=document.head)&&void 0!==t?t:document.body}}function h6(e,t){return p6.apply(this,arguments)}function p6(){return p6=X2(S3.mark((function e(t,n){var r,i,o,a,s,u,l,c,f,d,h,p,g,m,y,v,x,_,w,k,A,E,O,D,S,C,F,j,M,$,N,B,T,z,P,L,I,U,q,W,H,G,V,Y,X,Z,J,Q,ee,te,ne,re=arguments;return S3.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ne=function(){U&&document.removeEventListener("click",U),B.finalize()},f=re.length>3?re[3]:void 0,d=(c=re.length>2&&void 0!==re[2]?re[2]:{}).theme?Ae(b[c.theme],null!==(r=c.config)&&void 0!==r?r:{}):c.config,h=ht(c.actions)?c.actions:I5({},J5,null!==(i=c.actions)&&void 0!==i?i:{}),p=G5(G5({},K5),c.i18n),g=null!==(o=c.renderer)&&void 0!==o?o:"canvas",m=null!==(a=c.logLevel)&&void 0!==a?a:Y5.Warn,y=null!==(s=c.downloadFileName)&&void 0!==s?s:"visualization",v="string"==typeof t?document.querySelector(t):t){e.next=12;break}throw new Error("".concat(t," does not exist"));case 12:if(!1!==c.defaultStyle&&(x="vega-embed-style",_=d6(v),w=_.root,k=_.rootContainer,w.getElementById(x)||((A=document.createElement("style")).id=x,A.innerHTML=void 0===c.defaultStyle||!0===c.defaultStyle?L5.toString():c.defaultStyle,k.appendChild(A))),E=o6(n,c.mode),O=t6[E](n,d),"vega-lite"===E&&O.$schema&&(D=Y1(O.$schema),z5(e6.vega,"^".concat(D.version.slice(1)))||console.warn("The compiled spec uses Vega ".concat(D.version,", but current version is v").concat(e6.vega,"."))),v.classList.add("vega-embed"),h&&v.classList.add("has-actions"),v.innerHTML="",S=v,h&&((C=document.createElement("div")).classList.add(r6),v.appendChild(C),S=C),(F=c.patch)&&(O=F instanceof Function?F(O):R(O,F,!0,!1).newDocument),c.formatLocale&&Y5.formatLocale(c.formatLocale),c.timeFormatLocale&&Y5.timeFormatLocale(c.timeFormatLocale),c.expressionFunctions)for(j in c.expressionFunctions)"fn"in(M=c.expressionFunctions[j])?Y5.expressionFunction(j,M.fn,M.visitor):M instanceof Function&&Y5.expressionFunction(j,M);return $=c.ast,N=Y5.parse(O,"vega-lite"===E?{}:d,{ast:$}),(B=new(c.viewClass||Y5.View)(N,G5({loader:f,logLevel:m,renderer:g},$?{expr:null!==(u=null!==(l=Y5.expressionInterpreter)&&void 0!==l?l:c.expr)&&void 0!==u?u:iP}:{}))).addSignalListener("autosize",((e,t)=>{var n=t.type;"fit-x"==n?(S.classList.add("fit-x"),S.classList.remove("fit-y")):"fit-y"==n?(S.classList.remove("fit-x"),S.classList.add("fit-y")):"fit"==n?S.classList.add("fit-x","fit-y"):S.classList.remove("fit-x","fit-y")})),!1!==c.tooltip&&(ie=c.tooltip,T="function"==typeof ie?c.tooltip:new H2(!0===c.tooltip?{}:c.tooltip).call,B.tooltip(T)),void 0===(z=c.hover)&&(z="vega"===E),z&&(L=(P="boolean"==typeof z?{}:z).hoverSet,I=P.updateSet,B.hover(L,I)),c&&(null!=c.width&&B.width(c.width),null!=c.height&&B.height(c.height),null!=c.padding&&B.padding(c.padding)),e.next=37,B.initialize(S,c.bind).runAsync();case 37:if(!1===h){e.next=63;break}if(q=v,!1!==c.defaultStyle&&((W=document.createElement("details")).title=p.CLICK_TO_VIEW_ACTIONS,v.append(W),q=W,(H=document.createElement("summary")).innerHTML=n6,W.append(H),U=e=>{W.contains(e.target)||W.removeAttribute("open")},document.addEventListener("click",U)),G=document.createElement("div"),q.append(G),G.classList.add("vega-actions"),!0!==h&&!1===h.export){e.next=60;break}V=q5(["svg","png"]),e.prev=45,X=S3.mark((function e(){var t,n,r,i;return S3.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=Y.value,(!0===h||!0===h.export||h.export[t])&&(n=p["".concat(t.toUpperCase(),"_ACTION")],r=document.createElement("a"),i=we(c.scaleFactor)?c.scaleFactor[t]:c.scaleFactor,r.text=n,r.href="#",r.target="_blank",r.download="".concat(y,".").concat(t),r.addEventListener("mousedown",function(){var e=X2(S3.mark((function e(n){var r;return S3.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.preventDefault(),e.next=3,B.toImageURL(t,i);case 3:r=e.sent,this.href=r;case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()),G.append(r));case 2:case"end":return e.stop()}}),e)})),V.s();case 48:if((Y=V.n()).done){e.next=52;break}return e.delegateYield(X(),"t0",50);case 50:e.next=48;break;case 52:e.next=57;break;case 54:e.prev=54,e.t1=e.catch(45),V.e(e.t1);case 57:return e.prev=57,V.f(),e.finish(57);case 60:!0!==h&&!1===h.source||((Z=document.createElement("a")).text=p.SOURCE_ACTION,Z.href="#",Z.addEventListener("click",(function(e){var t,r;i6(K()(n),null!==(t=c.sourceHeader)&&void 0!==t?t:"",null!==(r=c.sourceFooter)&&void 0!==r?r:"",E),e.preventDefault()})),G.append(Z)),"vega-lite"!==E||!0!==h&&!1===h.compiled||((J=document.createElement("a")).text=p.COMPILED_ACTION,J.href="#",J.addEventListener("click",(function(e){var t,n;i6(K()(O),null!==(t=c.sourceHeader)&&void 0!==t?t:"",null!==(n=c.sourceFooter)&&void 0!==n?n:"","vega"),e.preventDefault()})),G.append(J)),!0!==h&&!1===h.editor||(ee=null!==(Q=c.editorUrl)&&void 0!==Q?Q:"https://vega.github.io/editor/",(te=document.createElement("a")).text=p.EDITOR_ACTION,te.href="#",te.addEventListener("click",(function(e){R5(window,ee,{config:d,mode:E,renderer:g,spec:K()(n)}),e.preventDefault()})),G.append(te));case 63:return e.abrupt("return",{view:B,spec:n,vgSpec:O,finalize:ne,embedOptions:c});case 64:case"end":return e.stop()}var ie}),e,null,[[45,54,57,60]])}))),p6.apply(this,arguments)}},146:t=>{"use strict";t.exports=e},801:e=>{"use strict";var t=/("(?:[^\\"]|\\.)*")|[:,]/g;e.exports=function(e,n){var r,i,o;return n=n||{},r=JSON.stringify([1],void 0,void 0===n.indent?2:n.indent).slice(2,-3),i=""===r?1/0:void 0===n.maxLength?80:n.maxLength,o=n.replacer,function e(n,a,s){var u,l,c,f,d,h,p,g,m,y,v,b;if(n&&"function"==typeof n.toJSON&&(n=n.toJSON()),void 0===(v=JSON.stringify(n,o)))return v;if(p=i-a.length-s,v.length<=p&&(m=v.replace(t,(function(e,t){return t||e+" "}))).length<=p)return m;if(null!=o&&(n=JSON.parse(v),o=void 0),"object"==typeof n&&null!==n){if(g=a+r,c=[],l=0,Array.isArray(n))for(y="[",u="]",p=n.length;l0)return[y,r+c.join(",\n"+g),u].join("\n"+a)}return v}(e,"",0)}},485:e=>{"use strict";e.exports={version:"0.3.0"}},147:e=>{"use strict";e.exports=JSON.parse('{"name":"jupyter-vega","version":"4.0.0","description":"IPython/Jupyter notebook module for [Vega](https://vega.github.io/vega), and [Vega-Lite](https://vega.github.io/vega-lite).","repository":{"type":"git","url":"git+https://github.com/vega/ipyvega.git"},"author":"","license":"BSD-3-Clause","bugs":{"url":"https://github.com/vega/ipyvega/issues"},"homepage":"https://github.com/vega/ipyvega#readme","scripts":{"format":"prettier --write \'src/*.ts\'","lint":"prettier --check \'src/*.ts\'","build":"webpack --mode production","watch":"webpack --mode development --watch"},"dependencies":{"jupyter-tablewidgets":"^0.3.0","vega":"5.24.0","vega-lite":"4.17.0","vega-embed":"^6.21.3","@jupyter-widgets/base":"6.0.4","@types/webpack-env":"*"},"devDependencies":{"@types/webpack-env":"*","@types/ndarray":"^1.0.11","filemanager-webpack-plugin":"^8.0.0","prettier":"^2.8.7","ts-loader":"^9.4.2","typescript":"^5.0.4","webpack":"^5.78.0","webpack-cli":"^5.0.1"},"files":["dist","src","package.json","tsconfig.json","webpack.config.js","yarn.lock","vega/static/"],"jupyterlab":{"extension":"vega/static/labplugin","sharedPackages":{"@jupyter-widgets/base":{"bundled":false,"singleton":true}}}}')}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var o=n[e]={exports:{}};return t[e].call(o.exports,o,o.exports,r),o.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(959)})())); +define(["@jupyter-widgets/base"],(e=>(()=>{var t={779:e=>{var t=function(){"use strict";function e(e,t){return null!=t&&e instanceof t}var t,n,r;try{t=Map}catch(e){t=function(){}}try{n=Set}catch(e){n=function(){}}try{r=Promise}catch(e){r=function(){}}function i(o,s,u,l,c){"object"==typeof s&&(u=s.depth,l=s.prototype,c=s.includeNonEnumerable,s=s.circular);var f=[],d=[],h="undefined"!=typeof Buffer;return void 0===s&&(s=!0),void 0===u&&(u=1/0),function o(u,p){if(null===u)return null;if(0===p)return u;var g,m;if("object"!=typeof u)return u;if(e(u,t))g=new t;else if(e(u,n))g=new n;else if(e(u,r))g=new r((function(e,t){u.then((function(t){e(o(t,p-1))}),(function(e){t(o(e,p-1))}))}));else if(i.__isArray(u))g=[];else if(i.__isRegExp(u))g=new RegExp(u.source,a(u)),u.lastIndex&&(g.lastIndex=u.lastIndex);else if(i.__isDate(u))g=new Date(u.getTime());else{if(h&&Buffer.isBuffer(u))return g=Buffer.allocUnsafe?Buffer.allocUnsafe(u.length):new Buffer(u.length),u.copy(g),g;e(u,Error)?g=Object.create(u):void 0===l?(m=Object.getPrototypeOf(u),g=Object.create(m)):(g=Object.create(l),m=l)}if(s){var y=f.indexOf(u);if(-1!=y)return d[y];f.push(u),d.push(g)}for(var v in e(u,t)&&u.forEach((function(e,t){var n=o(t,p-1),r=o(e,p-1);g.set(n,r)})),e(u,n)&&u.forEach((function(e){var t=o(e,p-1);g.add(t)})),u){var b;m&&(b=Object.getOwnPropertyDescriptor(m,v)),b&&null==b.set||(g[v]=o(u[v],p-1))}if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(u);for(v=0;v{"use strict";var r=n(644);function i(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}e.exports=function(e){var t=new i;t.pre=e.pre,t.body=e.body,t.post=e.post;var n=e.args.slice(0);t.argTypes=n;for(var o=0;o0)throw new Error("cwise: pre() block may not reference array args");if(o0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===a)t.scalarArgs.push(o),t.shimArgs.push("scalar"+o);else if("index"===a){if(t.indexArgs.push(o),o0)throw new Error("cwise: pre() block may not reference array index");if(o0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===a){if(t.shapeArgs.push(o),on.length)throw new Error("cwise: Too many arguments in pre() block");if(t.body.args.length>n.length)throw new Error("cwise: Too many arguments in body() block");if(t.post.args.length>n.length)throw new Error("cwise: Too many arguments in post() block");return t.debug=!!e.printCode||!!e.debug,t.funcName=e.funcName||"cwise",t.blockSize=e.blockSize||64,r(t)}},121:(e,t,n)=>{"use strict";var r=n(887);function i(e,t,n){var r,i,o=e.length,a=t.arrayArgs.length,s=t.indexArgs.length>0,u=[],l=[],c=0,f=0;for(r=0;r0&&u.push("var "+l.join(",")),r=o-1;r>=0;--r)c=e[r],u.push(["for(i",r,"=0;i",r,"0&&u.push(["index[",f,"]-=s",f].join("")),u.push(["++index[",c,"]"].join(""))),u.push("}")}return u.join("\n")}function o(e,t,n){for(var r=e.body,i=[],o=[],a=0;a0&&(n=n&&t[r]===t[r-1])}return n?t[0]:t.join("")}e.exports=function(e,t){for(var n=t[1].length-Math.abs(e.arrayBlockIndices[0])|0,s=new Array(e.arrayArgs.length),u=new Array(e.arrayArgs.length),l=0;l0&&b.push("shape=SS.slice(0)"),e.indexArgs.length>0){var x=new Array(n);for(l=0;l0&&v.push("var "+b.join(",")),l=0;l3&&v.push(o(e.pre,e,u));var A=o(e.body,e,u),E=function(e){for(var t=0,n=e[0].length;t0,l=[],c=0;c0;){"].join("")),l.push(["if(j",c,"<",s,"){"].join("")),l.push(["s",t[c],"=j",c].join("")),l.push(["j",c,"=0"].join("")),l.push(["}else{s",t[c],"=",s].join("")),l.push(["j",c,"-=",s,"}"].join("")),u&&l.push(["index[",t[c],"]=j",c].join(""));for(c=0;c3&&v.push(o(e.post,e,u)),e.debug&&console.log("-----Generated cwise routine for ",t,":\n"+v.join("\n")+"\n----------");var O=[e.funcName||"unnamed","_cwise_loop_",s[0].join("s"),"m",E,a(u)].join("");return new Function(["function ",O,"(",y.join(","),"){",v.join("\n"),"} return ",O].join(""))()}},644:(e,t,n)=>{"use strict";var r=n(121);e.exports=function(e){var t=["'use strict'","var CACHED={}"],n=[],i=e.funcName+"_cwise_thunk";t.push(["return function ",i,"(",e.shimArgs.join(","),"){"].join(""));for(var o=[],a=[],s=[["array",e.arrayArgs[0],".shape.slice(",Math.max(0,e.arrayBlockIndices[0]),e.arrayBlockIndices[0]<0?","+e.arrayBlockIndices[0]+")":")"].join("")],u=[],l=[],c=0;c0&&(u.push("array"+e.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(e.arrayBlockIndices[0])-Math.abs(e.arrayBlockIndices[c]))),l.push("array"+e.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[c])+"]"))}for(e.arrayArgs.length>1&&(t.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),t.push("for(var shapeIndex=array"+e.arrayArgs[0]+".shape.length-"+Math.abs(e.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),t.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),t.push("}")),c=0;c{"use strict";var r=n(263),i=n(887),o=0;function a(e,t,n){this.name=e,this.lvalue=t,this.rvalue=n,this.count=0}function s(e,t,n,r){this.body=e,this.args=t,this.thisVars=n,this.localVars=r}e.exports=function(e){for(var t=["(",e,")()"].join(""),u=r.parse(t,{range:!0}),l="_inline_"+o+++"_",c=function(e){for(var t=e.body[0].expression.callee.params,n=new Array(t.length),r=0;r=0){var a=f[o],s=function(e){return"AssignmentExpression"===e.parent.type&&e.parent.left===e?"="===e.parent.operator?1:3:"UpdateExpression"===e.parent.type?3:2}(t);1&s&&(a.lvalue=!0),2&s&&(a.rvalue=!0),++a.count,v(t,a.name)}else(function(e){if("eval"===e)throw new Error("cwise-parser: eval() not allowed");return"undefined"!=typeof window?e in window:void 0!==n.g?e in n.g:"undefined"!=typeof self&&e in self})(i)||v(t,function(e){var t=l+e.replace(/\_/g,"__");return m.push(t),t}(i))}else if("Literal"===t.type)"string"==typeof t.value&&v(t,"'"+t.value.replace(/\_/g,"\\_").replace(/\'/g,"'")+"'");else{if("WithStatement"===t.type)throw new Error("cwise-parser: with() statements not allowed");for(var u=Object.keys(t),d=0,h=u.length;d{"use strict";var r=n(86),i=n(543),o=["args","body"],a=["pre","post","printCode","funcName","blockSize"];e.exports=function(e){for(var t in e)o.indexOf(t)<0&&a.indexOf(t)<0&&console.warn("cwise: Unknown argument '"+t+"' passed to expression compiler");for(var n=0;n{"use strict";function t(e,n,r){var i=0|e[r];if(i<=0)return[];var o,a=new Array(i);if(r===e.length-1)for(o=0;o0)return function(e,t){var n,r;for(n=new Array(e),r=0;r=48&&e<=57}function _(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function w(e){return"01234567".indexOf(e)>=0}function k(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function A(e){return 10===e||13===e||8232===e||8233===e}function E(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&s.NonAsciiIdentifierStart.test(String.fromCharCode(e))}function O(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&s.NonAsciiIdentifierPart.test(String.fromCharCode(e))}function D(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function C(e){return"eval"===e||"arguments"===e}function S(e){if(c&&D(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function F(e,t,n,r,i){var o;b("number"==typeof n,"Comment must have valid position"),y.lastCommentStart>=n||(y.lastCommentStart=n,o={type:e,value:t},v.range&&(o.range=[n,r]),v.loc&&(o.loc=i),v.comments.push(o),v.attachComment&&(v.leadingComments.push(o),v.trailingComments.push(o)))}function M(e){var t,n,r,i;for(t=f-e,n={start:{line:d,column:f-h-e}};f=p&&Y({},a.UnexpectedToken,"ILLEGAL");else if(42===n){if(47===l.charCodeAt(f+1))return++f,++f,void(v.comments&&(r=l.slice(e+2,f-2),t.end={line:d,column:f-h},F("Block",r,e,f,t)));++f}else++f;Y({},a.UnexpectedToken,"ILLEGAL")}function $(){var e,t;for(t=0===f;f>>="===(i=l.substr(f,4))?(f+=4,{type:t.Punctuator,value:i,lineNumber:d,lineStart:h,start:o,end:f}):">>>"===(r=i.substr(0,3))||"<<="===r||">>="===r?(f+=3,{type:t.Punctuator,value:r,lineNumber:d,lineStart:h,start:o,end:f}):u===(n=r.substr(0,2))[1]&&"+-<>&|".indexOf(u)>=0||"=>"===n?(f+=2,{type:t.Punctuator,value:n,lineNumber:d,lineStart:h,start:o,end:f}):"<>=!+-*%&|^/".indexOf(u)>=0?(++f,{type:t.Punctuator,value:u,lineNumber:d,lineStart:h,start:o,end:f}):void Y({},a.UnexpectedToken,"ILLEGAL")}function R(){var e,n,r;if(b(x((r=l[f]).charCodeAt(0))||"."===r,"Numeric literal must start with a decimal digit or a decimal point"),n=f,e="","."!==r){if(e=l[f++],r=l[f],"0"===e){if("x"===r||"X"===r)return++f,function(e){for(var n="";f0&&(r=v.tokens[v.tokens.length-1]).range[0]===e&&"Punctuator"===r.type&&("/"!==r.value&&"/="!==r.value||v.tokens.pop()),v.tokens.push({type:"RegularExpression",value:n.literal,range:[e,f],loc:t})),n}function I(){var e,n,i;return $(),f>=p?{type:t.EOF,lineNumber:d,lineStart:h,start:f,end:f}:E(e=l.charCodeAt(f))?(n=f,{type:1===(i=92===l.charCodeAt(f)?B():T()).length?t.Identifier:S(i)?t.Keyword:"null"===i?t.NullLiteral:"true"===i||"false"===i?t.BooleanLiteral:t.Identifier,value:i,lineNumber:d,lineStart:h,start:n,end:f}):40===e||41===e||59===e?z():39===e||34===e?function(){var e,n,r,i,o,s,u,c,g="",m=!1;for(u=d,c=h,b("'"===(e=l[f])||'"'===e,"String literal must starts with a quote"),n=f,++f;f=0&&f=0?z():L()}return L()}return"Keyword"===e.type&&"this"!==e.value?L():z()}():z()}function U(){var e,r,i;return $(),e={start:{line:d,column:f-h}},r=I(),e.end={line:d,column:f-h},r.type!==t.EOF&&(i=l.slice(r.start,r.end),v.tokens.push({type:n[r.type],value:i,range:[r.start,r.end],loc:e})),r}function q(){var e;return f=(e=m).end,d=e.lineNumber,h=e.lineStart,m=void 0!==v.tokens?U():I(),f=e.end,d=e.lineNumber,h=e.lineStart,e}function W(){var e,t,n;e=f,t=d,n=h,m=void 0!==v.tokens?U():I(),f=e,d=t,h=n}function H(e,t){this.line=e,this.column=t}function G(e,t,n,r){this.start=new H(e,t),this.end=new H(n,r)}function V(){var e,t,n,r;return e=f,t=d,n=h,$(),r=d!==t,f=e,d=t,h=n,r}function Y(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(function(e,t){return b(t":case"<=":case">=":case"instanceof":r=7;break;case"in":r=n?7:0;break;case"<<":case">>":case">>>":r=8;break;case"+":case"-":r=9;break;case"*":case"/":case"%":r=11}return r}function ge(){var e,t,n,r,i;return i=m,e=function(){var e,t,n,r,i,o,a,s,u,l;if(e=m,u=he(),0===(i=pe(r=m,y.allowIn)))return u;for(r.prec=i,q(),t=[e,m],o=[u,r,a=he()];(i=pe(m,y.allowIn))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),n=g.createBinaryExpression(s,u,a),t.pop(),e=t[t.length-1],g.markEnd(n,e),o.push(n);(r=q()).prec=i,o.push(r),t.push(m),n=he(),o.push(n)}for(n=o[l=o.length-1],t.pop();l>1;)n=g.createBinaryExpression(o[l-1].value,o[l-2],n),l-=2,e=t.pop(),g.markEnd(n,e);return n}(),Q("?")&&(q(),t=y.allowIn,y.allowIn=!0,n=me(),y.allowIn=t,J(":"),r=me(),e=g.createConditionalExpression(e,n,r),g.markEnd(e,i)),e}function me(){var e,n,r,o,s,u;return e=m,s=m,o=n=ge(),m.type===t.Punctuator&&("="===(u=m.value)||"*="===u||"/="===u||"%="===u||"+="===u||"-="===u||"<<="===u||">>="===u||">>>="===u||"&="===u||"^="===u||"|="===u)&&(ne(n)||X({},a.InvalidLHSInAssignment),c&&n.type===i.Identifier&&C(n.name)&&X(e,a.StrictLHSAssignment),e=q(),r=me(),o=g.markEnd(g.createAssignmentExpression(e.value,n,r),s)),o}function ye(){var e,t=m;if(e=me(),Q(",")){for(e=g.createSequenceExpression([e]);f",n[t.Identifier]="Identifier",n[t.Keyword]="Keyword",n[t.NullLiteral]="Null",n[t.NumericLiteral]="Numeric",n[t.Punctuator]="Punctuator",n[t.StringLiteral]="String",n[t.RegularExpression]="RegularExpression",r=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],i={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},o={Data:1,Get:2,Set:4},a={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},s={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},u={name:"SyntaxTree",processComment:function(e){var t,n;if(!(e.type===i.Program&&e.body.length>0)){for(v.trailingComments.length>0?v.trailingComments[0].range[0]>=e.range[1]?(n=v.trailingComments,v.trailingComments=[]):v.trailingComments.length=0:v.bottomRightStack.length>0&&v.bottomRightStack[v.bottomRightStack.length-1].trailingComments&&v.bottomRightStack[v.bottomRightStack.length-1].trailingComments[0].range[0]>=e.range[1]&&(n=v.bottomRightStack[v.bottomRightStack.length-1].trailingComments,delete v.bottomRightStack[v.bottomRightStack.length-1].trailingComments);v.bottomRightStack.length>0&&v.bottomRightStack[v.bottomRightStack.length-1].range[0]>=e.range[0];)t=v.bottomRightStack.pop();t?t.leadingComments&&t.leadingComments[t.leadingComments.length-1].range[1]<=e.range[0]&&(e.leadingComments=t.leadingComments,delete t.leadingComments):v.leadingComments.length>0&&v.leadingComments[v.leadingComments.length-1].range[1]<=e.range[0]&&(e.leadingComments=v.leadingComments,v.leadingComments=[]),n&&(e.trailingComments=n),v.bottomRightStack.push(e)}},markEnd:function(e,t){return v.range&&(e.range=[t.start,f]),v.loc&&(e.loc=new G(void 0===t.startLineNumber?t.lineNumber:t.startLineNumber,t.start-(void 0===t.startLineStart?t.lineStart:t.startLineStart),d,f-h),this.postProcess(e)),v.attachComment&&this.processComment(e),e},postProcess:function(e){return v.source&&(e.loc.source=v.source),e},createArrayExpression:function(e){return{type:i.ArrayExpression,elements:e}},createAssignmentExpression:function(e,t,n){return{type:i.AssignmentExpression,operator:e,left:t,right:n}},createBinaryExpression:function(e,t,n){return{type:"||"===e||"&&"===e?i.LogicalExpression:i.BinaryExpression,operator:e,left:t,right:n}},createBlockStatement:function(e){return{type:i.BlockStatement,body:e}},createBreakStatement:function(e){return{type:i.BreakStatement,label:e}},createCallExpression:function(e,t){return{type:i.CallExpression,callee:e,arguments:t}},createCatchClause:function(e,t){return{type:i.CatchClause,param:e,body:t}},createConditionalExpression:function(e,t,n){return{type:i.ConditionalExpression,test:e,consequent:t,alternate:n}},createContinueStatement:function(e){return{type:i.ContinueStatement,label:e}},createDebuggerStatement:function(){return{type:i.DebuggerStatement}},createDoWhileStatement:function(e,t){return{type:i.DoWhileStatement,body:e,test:t}},createEmptyStatement:function(){return{type:i.EmptyStatement}},createExpressionStatement:function(e){return{type:i.ExpressionStatement,expression:e}},createForStatement:function(e,t,n,r){return{type:i.ForStatement,init:e,test:t,update:n,body:r}},createForInStatement:function(e,t,n){return{type:i.ForInStatement,left:e,right:t,body:n,each:!1}},createFunctionDeclaration:function(e,t,n,r){return{type:i.FunctionDeclaration,id:e,params:t,defaults:n,body:r,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(e,t,n,r){return{type:i.FunctionExpression,id:e,params:t,defaults:n,body:r,rest:null,generator:!1,expression:!1}},createIdentifier:function(e){return{type:i.Identifier,name:e}},createIfStatement:function(e,t,n){return{type:i.IfStatement,test:e,consequent:t,alternate:n}},createLabeledStatement:function(e,t){return{type:i.LabeledStatement,label:e,body:t}},createLiteral:function(e){return{type:i.Literal,value:e.value,raw:l.slice(e.start,e.end)}},createMemberExpression:function(e,t,n){return{type:i.MemberExpression,computed:"["===e,object:t,property:n}},createNewExpression:function(e,t){return{type:i.NewExpression,callee:e,arguments:t}},createObjectExpression:function(e){return{type:i.ObjectExpression,properties:e}},createPostfixExpression:function(e,t){return{type:i.UpdateExpression,operator:e,argument:t,prefix:!1}},createProgram:function(e){return{type:i.Program,body:e}},createProperty:function(e,t,n){return{type:i.Property,key:t,value:n,kind:e}},createReturnStatement:function(e){return{type:i.ReturnStatement,argument:e}},createSequenceExpression:function(e){return{type:i.SequenceExpression,expressions:e}},createSwitchCase:function(e,t){return{type:i.SwitchCase,test:e,consequent:t}},createSwitchStatement:function(e,t){return{type:i.SwitchStatement,discriminant:e,cases:t}},createThisExpression:function(){return{type:i.ThisExpression}},createThrowStatement:function(e){return{type:i.ThrowStatement,argument:e}},createTryStatement:function(e,t,n,r){return{type:i.TryStatement,block:e,guardedHandlers:t,handlers:n,finalizer:r}},createUnaryExpression:function(e,t){return"++"===e||"--"===e?{type:i.UpdateExpression,operator:e,argument:t,prefix:!0}:{type:i.UnaryExpression,operator:e,argument:t,prefix:!0}},createVariableDeclaration:function(e,t){return{type:i.VariableDeclaration,declarations:e,kind:t}},createVariableDeclarator:function(e,t){return{type:i.VariableDeclarator,id:e,init:t}},createWhileStatement:function(e,t){return{type:i.WhileStatement,test:e,body:t}},createWithStatement:function(e,t){return{type:i.WithStatement,object:e,body:t}}},e.version="1.2.5",e.tokenize=function(e,n){var r;"string"==typeof e||e instanceof String||(e=String(e)),g=u,f=0,d=(l=e).length>0?1:0,h=0,p=l.length,m=null,y={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},v={},(n=n||{}).tokens=!0,v.tokens=[],v.tokenize=!0,v.openParenToken=-1,v.openCurlyToken=-1,v.range="boolean"==typeof n.range&&n.range,v.loc="boolean"==typeof n.loc&&n.loc,"boolean"==typeof n.comment&&n.comment&&(v.comments=[]),"boolean"==typeof n.tolerant&&n.tolerant&&(v.errors=[]);try{if(W(),m.type===t.EOF)return v.tokens;for(q();m.type!==t.EOF;)try{q()}catch(e){if(v.errors){v.errors.push(e);break}throw e}Me(),r=v.tokens,void 0!==v.comments&&(r.comments=v.comments),void 0!==v.errors&&(r.errors=v.errors)}catch(e){throw e}finally{v={}}return r},e.parse=function(e,t){var n,r;r=String,"string"==typeof e||e instanceof String||(e=r(e)),g=u,f=0,d=(l=e).length>0?1:0,h=0,p=l.length,m=null,y={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},v={},void 0!==t&&(v.range="boolean"==typeof t.range&&t.range,v.loc="boolean"==typeof t.loc&&t.loc,v.attachComment="boolean"==typeof t.attachComment&&t.attachComment,v.loc&&null!==t.source&&void 0!==t.source&&(v.source=r(t.source)),"boolean"==typeof t.tokens&&t.tokens&&(v.tokens=[]),"boolean"==typeof t.comment&&t.comment&&(v.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(v.errors=[]),v.attachComment&&(v.range=!0,v.comments=[],v.bottomRightStack=[],v.trailingComments=[],v.leadingComments=[]));try{n=Fe(),void 0!==v.comments&&(n.comments=v.comments),void 0!==v.tokens&&(Me(),n.tokens=v.tokens),void 0!==v.errors&&(n.errors=v.errors)}catch(e){throw e}finally{v={}}return n},e.Syntax=function(){var e,t={};for(e in"function"==typeof Object.create&&(t=Object.create(null)),i)i.hasOwnProperty(e)&&(t[e]=i[e]);return"function"==typeof Object.freeze&&Object.freeze(t),t}()},void 0===(r=n.apply(t,[t]))||(e.exports=r)}()},17:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){var a=o[i];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}},492:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n,r="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(n=t.cmp,function(e){return function(t,r){var i={key:t,value:e[t]},o={key:r,value:e[r]};return n(i,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var n,a;if(Array.isArray(t)){for(a="[",n=0;n{"use strict";e.exports=function(e){for(var t=new Array(e),n=0;n{function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},402:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decompress=void 0;const r=n(668),i=n(404);t.decompress={zlib:e=>r.inflate(new Uint8Array(e)).buffer,lz4:e=>i.decompress(new Uint8Array(e)).buffer}},452:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=t.decompress=t.rowProxy=t.table_serialization=t.EchoTableWidgetView=t.EchoTableWidgetModel=t.TableWidgetModel=void 0;var r=n(873);Object.defineProperty(t,"TableWidgetModel",{enumerable:!0,get:function(){return r.TableWidgetModel}}),Object.defineProperty(t,"EchoTableWidgetModel",{enumerable:!0,get:function(){return r.EchoTableWidgetModel}}),Object.defineProperty(t,"EchoTableWidgetView",{enumerable:!0,get:function(){return r.EchoTableWidgetView}});var i=n(773);Object.defineProperty(t,"table_serialization",{enumerable:!0,get:function(){return i.table_serialization}}),Object.defineProperty(t,"rowProxy",{enumerable:!0,get:function(){return i.rowProxy}});var o=n(402);Object.defineProperty(t,"decompress",{enumerable:!0,get:function(){return o.decompress}}),t.version=n(51).version},773:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.table_serialization=t.tableToJSON=t.rowProxy=t.JSONToTable=void 0;const r=n(655),i=n(402),o={bool:Uint8Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,float32:Float32Array,float64:Float64Array,str:Array},a=Symbol("rowIndex");function s(e,t){if(null===e)return null;var n={},a=1/0;let s,u=new TextDecoder("utf-8");for(const[t,l]of Object.entries(e.data))if(void 0!==l.compression){let e=l.buffer;if(s=i.decompress[l.compression](e.buffer),"str"===l.dtype){let e=s,r=u.decode(e),i=JSON.parse(r);n[t]=i}else n[t]=r(new o[l.dtype](s),l.shape),a=Math.min(a,l.shape[0])}else if("str"===l.dtype){let e=l.buffer;n[t]=e,a=Math.min(a,e.length)}else{let e=l.buffer;n[t]=r(new o[l.dtype](e.buffer),l.shape),a=Math.min(a,l.shape[0])}return{columns:e.columns,data:n,size:a}}function u(e,t){return null}t.JSONToTable=s,t.rowProxy=function(e){if(null===e)return null;var t=e.columns,n={};return t.forEach((t=>{const r=e.data[t],i=r,o=r;n.hasOwnProperty(t)||(void 0===i.shape?Object.defineProperty(n,t,{get:function(){const e=this[a];return o[e]},set:function(){throw Error("Arrow field values can not be overwritten.")},enumerable:!0}):Object.defineProperty(n,t,{get:function(){const e=this[a],t=i.get(e);return isNaN(t)?null:t},set:function(){throw Error("Arrow field values can not be overwritten.")},enumerable:!0}))})),e=>{var t=Object.create(n);return t[a]=e,t}},t.tableToJSON=u,t.table_serialization={deserialize:s,serialize:u}},873:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.EchoTableWidgetView=t.EchoTableWidgetModel=t.TableWidgetModel=void 0;const i=n(55),o=n(655),a=n(799),s=n(773);let u=n(51).version;class l extends i.DOMWidgetModel{defaults(){return Object.assign(Object.assign({},i.DOMWidgetModel.prototype.defaults()),{_model_name:"TableWidgetModel",_view_name:null,_model_module:"jupyter-tablewidgets",_view_module:null,_model_module_version:u,_view_module_version:"",_table:o([]),_columns:[]})}}t.TableWidgetModel=l,l.serializers=Object.assign(Object.assign({},i.DOMWidgetModel.serializers),{_table:s.table_serialization});class c extends i.DOMWidgetModel{defaults(){return Object.assign(Object.assign({},i.DOMWidgetModel.prototype.defaults()),{_model_name:"EchoTableWidgetModel",_view_name:"EchoTableWidgetView",_model_module:"jupyter-tablewidgets",_view_module:"jupyter-tablewidgets",_model_module_version:u,_view_module_version:u,data:[],echo:[]})}}t.EchoTableWidgetModel=c,c.serializers=Object.assign(Object.assign({},i.DOMWidgetModel.serializers),{data:{deserialize:i.unpack_models}});class f extends i.DOMWidgetView{render(){return r(this,void 0,void 0,(function*(){let e=this.model,t=e.get("data").get("_table"),n={columns:t.columns,data:{}};for(const[e,r]of Object.entries(t.data)){let t=r;void 0!==t.dtype?n.data[e]=a(t):n.data[e]=t}e.set("echo",n),this.touch()}))}}t.EchoTableWidgetView=f},404:(e,t,n)=>{var r=n(255),i=n(144),o=65536,a=f(5<<20),s=function(){try{return new Uint32Array(o)}catch(n){for(var e=new Array(o),t=0;t>4&7;if(void 0===c[a])throw new Error("invalid block size "+a);var s=c[a];if(o)return i.readU64(e,t);t++;for(var f=0;;){var d=i.readU32(e,t);if(t+=4,f+=d&l?d&=2147483647:s,0===d)return f;r&&(t+=4),t+=d}},t.makeBuffer=f,t.decompressBlock=function(e,t,n,r,i){var o,a,s,u,l;for(s=n+r;n>4;if(f>0){if(15===f)for(;f+=e[n],255===e[n++];);for(u=n+f;n=s)break;if(o=15&c,a=e[n++]|e[n++]<<8,15===o)for(;o+=e[n],255===e[n++];);for(u=(l=i-a)+(o+=4);l=13)for(var p=67;n+4>>0;if(a=o[m=(m>>16^m)>>>0&65535]-1,o[m]=n+1,a<0||n-a>>>16>0||i.readU32(e,a)!==g)n+=p++>>6;else{for(p=67,c=n-s,l=n-a,a+=4,u=n+=4;n=15){for(t[f++]=240+y,h=c-15;h>=255;h-=255)t[f++]=255;t[f++]=h}else t[f++]=(c<<4)+y;for(var v=0;v>8,u>=15){for(h=u-15;h>=255;h-=255)t[f++]=255;t[f++]=h}s=n}}if(0===s)return 0;if((c=d-s)>=15){for(t[f++]=240,h=c-15;h>=255;h-=255)t[f++]=255;t[f++]=h}else t[f++]=c<<4;for(n=s;n>4&7;if(void 0===c[h])throw new Error("invalid block size");for(a&&(f+=8),f++;;){var p;if(p=i.readU32(e,f),f+=4,0===p)break;if(r&&(f+=4),p&l){p&=2147483647;for(var g=0;g>8,l++;var f=c[7],d=e.length,h=0;for(function(){for(var e=0;e0;){var p,g=d>f?f:d;if((p=t.compressBlock(e,a,h,g,s))>g||0===p){i.writeU32(n,l,2147483648|g),l+=4;for(var m=h+g;h{t.hashU32=function(e){return-1252372727^(e=(e=(e=374761393+(e=-949894596^(e=2127912214+(e|=0)+(e<<12)|0)^e>>>19)+(e<<5)|0)-744332180^e<<9)-42973499+(e<<3)|0)^e>>>16},t.readU64=function(e,t){var n=0;return n|=0|e[t++],n|=e[t++]<<8,n|=e[t++]<<16,n|=e[t++]<<24,n|=e[t++]<<32,n|=e[t++]<<40,(n|=e[t++]<<48)|e[t++]<<56},t.readU32=function(e,t){var n=0;return n|=0|e[t++],n|=e[t++]<<8,(n|=e[t++]<<16)|e[t++]<<24},t.writeU32=function(e,t,n){e[t++]=255&n,e[t++]=n>>8&255,e[t++]=n>>16&255,e[t++]=n>>24&255},t.imul=function(e,t){var n=65535&e,r=65535&t;return n*r+((e>>>16)*r+n*(t>>>16)<<16)|0}},255:(e,t,n)=>{var r=n(144),i=2654435761,o=2246822519,a=3266489917,s=374761393;function u(e,t){return(e|=0)>>>(32-(t|=0)|0)|e<>>(32-t|0)|e<>>(t|=0)^e}function f(e,t,n,i,o){return l(r.imul(t,n)+e,i,o)}function d(e,t,n){return l(e+r.imul(t[n],s),11,i)}function h(e,t,n){return f(e,r.readU32(t,n),a,17,668265263)}function p(e,t,n){return[f(e[0],r.readU32(t,n+0),o,13,i),f(e[1],r.readU32(t,n+4),o,13,i),f(e[2],r.readU32(t,n+8),o,13,i),f(e[3],r.readU32(t,n+12),o,13,i)]}t.hash=function(e,t,n,l){var f,g;if(g=l,l>=16){for(f=[e+i+o,e+o,e,e-i];l>=16;)f=p(f,t,n),n+=16,l-=16;f=u(f[0],1)+u(f[1],7)+u(f[2],12)+u(f[3],18)+g}else f=e+s+l>>>0;for(;l>=4;)f=h(f,t,n),n+=4,l-=4;for(;l>0;)f=d(f,t,n),n++,l--;return(f=c(r.imul(c(r.imul(c(f,15),o),13),a),16))>>>0}},799:(e,t,n)=>{"use strict";var r=n(343),i=n(713)({args:["array","scalar","index"],body:function(e,t,n){var r,i=t;for(r=0;r{var r=n(219),i=n(206),o="undefined"!=typeof Float64Array;function a(e,t){return e[0]-t[0]}function s(){var e,t=this.stride,n=new Array(t.length);for(e=0;eMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===t&&o.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push("proto.set=function "+n+"_set("+u.join(",")+",v){"),i?o.push("return this.data.set("+c+",v)}"):o.push("return this.data["+c+"]=v}"),o.push("proto.get=function "+n+"_get("+u.join(",")+"){"),i?o.push("return this.data.get("+c+")}"):o.push("return this.data["+c+"]}"),o.push("proto.index=function "+n+"_index(",u.join(),"){return "+c+"}"),o.push("proto.hi=function "+n+"_hi("+u.join(",")+"){return new "+n+"(this.data,"+a.map((function(e){return["(typeof i",e,"!=='number'||i",e,"<0)?this.shape[",e,"]:i",e,"|0"].join("")})).join(",")+","+a.map((function(e){return"this.stride["+e+"]"})).join(",")+",this.offset)}");var h=a.map((function(e){return"a"+e+"=this.shape["+e+"]"})),p=a.map((function(e){return"c"+e+"=this.stride["+e+"]"}));o.push("proto.lo=function "+n+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+h.join(",")+","+p.join(","));for(var g=0;g=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");for(o.push("return new "+n+"(this.data,"+a.map((function(e){return"a"+e})).join(",")+","+a.map((function(e){return"c"+e})).join(",")+",b)}"),o.push("proto.step=function "+n+"_step("+u.join(",")+"){var "+a.map((function(e){return"a"+e+"=this.shape["+e+"]"})).join(",")+","+a.map((function(e){return"b"+e+"=this.stride["+e+"]"})).join(",")+",c=this.offset,d=0,ceil=Math.ceil"),g=0;g=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");return o.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),o.push("return function construct_"+n+"(data,shape,stride,offset){return new "+n+"(data,"+a.map((function(e){return"shape["+e+"]"})).join(",")+","+a.map((function(e){return"stride["+e+"]"})).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",o.join("\n"))(l[e],s)}var l={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};e.exports=function(e,t,n,r){if(void 0===e)return(0,l.array[0])([]);"number"==typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var a=t.length;if(void 0===n){n=new Array(a);for(var s=a-1,c=1;s>=0;--s)n[s]=c,c*=t[s]}if(void 0===r)for(r=0,s=0;s{"use strict";const{Deflate:r,deflate:i,deflateRaw:o,gzip:a}=n(303),{Inflate:s,inflate:u,inflateRaw:l,ungzip:c}=n(83),f=n(681);e.exports.Deflate=r,e.exports.deflate=i,e.exports.deflateRaw=o,e.exports.gzip=a,e.exports.Inflate=s,e.exports.inflate=u,e.exports.inflateRaw=l,e.exports.ungzip=c,e.exports.constants=f},303:(e,t,n)=>{"use strict";const r=n(411),i=n(805),o=n(996),a=n(674),s=n(442),u=Object.prototype.toString,{Z_NO_FLUSH:l,Z_SYNC_FLUSH:c,Z_FULL_FLUSH:f,Z_FINISH:d,Z_OK:h,Z_STREAM_END:p,Z_DEFAULT_COMPRESSION:g,Z_DEFAULT_STRATEGY:m,Z_DEFLATED:y}=n(681);function v(e){this.options=i.assign({level:g,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:m},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;let n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==h)throw new Error(a[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,n=r.deflateSetDictionary(this.strm,e),n!==h)throw new Error(a[n]);this._dict_set=!0}}function b(e,t){const n=new v(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}v.prototype.push=function(e,t){const n=this.strm,i=this.options.chunkSize;let a,s;if(this.ended)return!1;for(s=t===~~t?t:!0===t?d:l,"string"==typeof e?n.input=o.string2buf(e):"[object ArrayBuffer]"===u.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),(s===c||s===f)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(a=r.deflate(n,s),a===p)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),a=r.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===h;if(0!==n.avail_out){if(s>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},v.prototype.onData=function(e){this.chunks.push(e)},v.prototype.onEnd=function(e){e===h&&(this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},e.exports.Deflate=v,e.exports.deflate=b,e.exports.deflateRaw=function(e,t){return(t=t||{}).raw=!0,b(e,t)},e.exports.gzip=function(e,t){return(t=t||{}).gzip=!0,b(e,t)},e.exports.constants=n(681)},83:(e,t,n)=>{"use strict";const r=n(447),i=n(805),o=n(996),a=n(674),s=n(442),u=n(414),l=Object.prototype.toString,{Z_NO_FLUSH:c,Z_FINISH:f,Z_OK:d,Z_STREAM_END:h,Z_NEED_DICT:p,Z_STREAM_ERROR:g,Z_DATA_ERROR:m,Z_MEM_ERROR:y}=n(681);function v(e){this.options=i.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;let n=r.inflateInit2(this.strm,t.windowBits);if(n!==d)throw new Error(a[n]);if(this.header=new u,r.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=r.inflateSetDictionary(this.strm,t.dictionary),n!==d)))throw new Error(a[n])}function b(e,t){const n=new v(t);if(n.push(e),n.err)throw n.msg||a[n.err];return n.result}v.prototype.push=function(e,t){const n=this.strm,i=this.options.chunkSize,a=this.options.dictionary;let s,u,v;if(this.ended)return!1;for(u=t===~~t?t:!0===t?f:c,"[object ArrayBuffer]"===l.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),s=r.inflate(n,u),s===p&&a&&(s=r.inflateSetDictionary(n,a),s===d?s=r.inflate(n,u):s===m&&(s=p));n.avail_in>0&&s===h&&n.state.wrap>0&&0!==e[n.next_in];)r.inflateReset(n),s=r.inflate(n,u);switch(s){case g:case m:case p:case y:return this.onEnd(s),this.ended=!0,!1}if(v=n.avail_out,n.next_out&&(0===n.avail_out||s===h))if("string"===this.options.to){let e=o.utf8border(n.output,n.next_out),t=n.next_out-e,r=o.buf2string(n.output,e);n.next_out=t,n.avail_out=i-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(r)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(s!==d||0!==v){if(s===h)return s=r.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},v.prototype.onData=function(e){this.chunks.push(e)},v.prototype.onEnd=function(e){e===d&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},e.exports.Inflate=v,e.exports.inflate=b,e.exports.inflateRaw=function(e,t){return(t=t||{}).raw=!0,b(e,t)},e.exports.ungzip=b,e.exports.constants=n(681)},805:e=>{"use strict";const t=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);e.exports.assign=function(e){const n=Array.prototype.slice.call(arguments,1);for(;n.length;){const r=n.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const n in r)t(r,n)&&(e[n]=r[n])}}return e},e.exports.flattenChunks=e=>{let t=0;for(let n=0,r=e.length;n{"use strict";let t=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){t=!1}const n=new Uint8Array(256);for(let e=0;e<256;e++)n[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;n[254]=n[254]=1,e.exports.string2buf=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,r,i,o,a=e.length,s=0;for(i=0;i>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},e.exports.buf2string=(e,r)=>{const i=r||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,r));let o,a;const s=new Array(2*i);for(a=0,o=0;o4)s[a++]=65533,o+=r-1;else{for(t&=2===r?31:3===r?15:7;r>1&&o1?s[a++]=65533:t<65536?s[a++]=t:(t-=65536,s[a++]=55296|t>>10&1023,s[a++]=56320|1023&t)}}return((e,n)=>{if(n<65534&&e.subarray&&t)return String.fromCharCode.apply(null,e.length===n?e:e.subarray(0,n));let r="";for(let t=0;t{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+n[e[r]]>t?r:t}},269:e=>{"use strict";e.exports=(e,t,n,r)=>{let i=65535&e,o=e>>>16&65535,a=0;for(;0!==n;){a=n>2e3?2e3:n,n-=a;do{i=i+t[r++]|0,o=o+i|0}while(--a);i%=65521,o%=65521}return i|o<<16}},681:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},823:e=>{"use strict";const t=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());e.exports=(e,n,r,i)=>{const o=t,a=i+r;e^=-1;for(let t=i;t>>8^o[255&(e^n[t])];return~e}},411:(e,t,n)=>{"use strict";const{_tr_init:r,_tr_stored_block:i,_tr_flush_block:o,_tr_tally:a,_tr_align:s}=n(665),u=n(269),l=n(823),c=n(674),{Z_NO_FLUSH:f,Z_PARTIAL_FLUSH:d,Z_FULL_FLUSH:h,Z_FINISH:p,Z_BLOCK:g,Z_OK:m,Z_STREAM_END:y,Z_STREAM_ERROR:v,Z_DATA_ERROR:b,Z_BUF_ERROR:x,Z_DEFAULT_COMPRESSION:_,Z_FILTERED:w,Z_HUFFMAN_ONLY:k,Z_RLE:A,Z_FIXED:E,Z_DEFAULT_STRATEGY:O,Z_UNKNOWN:D,Z_DEFLATED:C}=n(681),S=258,F=262,M=42,j=113,$=666,N=(e,t)=>(e.msg=c[t],t),B=e=>2*e-(e>4?9:0),T=e=>{let t=e.length;for(;--t>=0;)e[t]=0},z=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do{n=e.head[--r],e.head[r]=n>=i?n-i:0}while(--t);t=i,r=t;do{n=e.prev[--r],e.prev[r]=n>=i?n-i:0}while(--t)};let R=(e,t,n)=>(t<{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))},L=(e,t)=>{o(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,P(e.strm)},I=(e,t)=>{e.pending_buf[e.pending++]=t},U=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},q=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),1===e.state.wrap?e.adler=u(e.adler,t,i,n):2===e.state.wrap&&(e.adler=l(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},W=(e,t)=>{let n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match;const u=e.strstart>e.w_size-F?e.strstart-(e.w_size-F):0,l=e.window,c=e.w_mask,f=e.prev,d=e.strstart+S;let h=l[o+a-1],p=l[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(n=t,l[n+a]===p&&l[n+a-1]===h&&l[n]===l[o]&&l[++n]===l[o+1]){o+=2,n++;do{}while(l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&oa){if(e.match_start=t,a=r,r>=s)break;h=l[o+a-1],p=l[o+a]}}}while((t=f[t&c])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead},H=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-F)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),z(e),r+=t),0===e.strm.avail_in)break;if(n=q(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=R(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=R(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead{let n,r,o,a=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,u=e.strm.avail_in;do{if(n=65535,o=e.bi_valid+42>>3,e.strm.avail_outr+e.strm.avail_in&&(n=r+e.strm.avail_in),n>o&&(n=o),n>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,P(e.strm),r&&(r>n&&(r=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,n-=r),n&&(q(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(0===s);return u-=e.strm.avail_in,u&&(u>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=u&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-u,e.strm.next_in),e.strstart),e.strstart+=u,e.insert+=u>e.w_size-e.insert?e.w_size-e.insert:u),e.block_start=e.strstart),e.high_watero&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(q(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,a=o>e.w_size?e.w_size:o,r=e.strstart-e.block_start,(r>=a||(r||t===p)&&t!==f&&0===e.strm.avail_in&&r<=o)&&(n=r>o?o:r,s=t===p&&0===e.strm.avail_in&&n===r?1:0,i(e,e.block_start,n,s),e.block_start+=n,P(e.strm)),s?3:1)},V=(e,t)=>{let n,r;for(;;){if(e.lookahead=3&&(e.ins_h=R(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-F&&(e.match_length=W(e,n)),e.match_length>=3)if(r=a(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=R(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=R(e,e.ins_h,e.window[e.strstart+1]);else r=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(L(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===p?(L(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(L(e,!1),0===e.strm.avail_out)?1:2},Y=(e,t)=>{let n,r,i;for(;;){if(e.lookahead=3&&(e.ins_h=R(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,r=a(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=R(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(L(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=a(e,0,e.window[e.strstart-1]),r&&L(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=a(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===p?(L(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(L(e,!1),0===e.strm.avail_out)?1:2};function X(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const Z=[new X(0,0,0,0,G),new X(4,4,8,4,V),new X(4,5,16,8,V),new X(4,6,32,32,V),new X(4,4,16,16,Y),new X(8,16,32,32,Y),new X(8,16,128,128,Y),new X(8,32,128,256,Y),new X(32,128,258,1024,Y),new X(32,258,258,4096,Y)];function J(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=C,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),T(this.dyn_ltree),T(this.dyn_dtree),T(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),T(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),T(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const K=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==M&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==j&&t.status!==$?1:0},Q=e=>{if(K(e))return N(e,v);e.total_in=e.total_out=0,e.data_type=D;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?M:j,e.adler=2===t.wrap?0:1,t.last_flush=-2,r(t),m},ee=e=>{const t=Q(e);var n;return t===m&&((n=e.state).window_size=2*n.w_size,T(n.head),n.max_lazy_match=Z[n.level].max_lazy,n.good_match=Z[n.level].good_length,n.nice_match=Z[n.level].nice_length,n.max_chain_length=Z[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),t},te=(e,t,n,r,i,o)=>{if(!e)return v;let a=1;if(t===_&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>9||n!==C||r<8||r>15||t<0||t>9||o<0||o>E||8===r&&1!==a)return N(e,v);8===r&&(r=9);const s=new J;return e.state=s,s.strm=e,s.status=M,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<te(e,t,C,15,8,O),e.exports.deflateInit2=te,e.exports.deflateReset=ee,e.exports.deflateResetKeep=Q,e.exports.deflateSetHeader=(e,t)=>K(e)||2!==e.state.wrap?v:(e.state.gzhead=t,m),e.exports.deflate=(e,t)=>{if(K(e)||t>g||t<0)return e?N(e,v):v;const n=e.state;if(!e.output||0!==e.avail_in&&!e.input||n.status===$&&t!==p)return N(e,0===e.avail_out?x:v);const r=n.last_flush;if(n.last_flush=t,0!==n.pending){if(P(e),0===e.avail_out)return n.last_flush=-1,m}else if(0===e.avail_in&&B(t)<=B(r)&&t!==p)return N(e,x);if(n.status===$&&0!==e.avail_in)return N(e,x);if(n.status===M&&0===n.wrap&&(n.status=j),n.status===M){let t=C+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=k||n.level<2?0:n.level<6?1:6===n.level?2:3,t|=r<<6,0!==n.strstart&&(t|=32),t+=31-t%31,U(n,t),0!==n.strstart&&(U(n,e.adler>>>16),U(n,65535&e.adler)),e.adler=1,n.status=j,P(e),0!==n.pending)return n.last_flush=-1,m}if(57===n.status)if(e.adler=0,I(n,31),I(n,139),I(n,8),n.gzhead)I(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),I(n,255&n.gzhead.time),I(n,n.gzhead.time>>8&255),I(n,n.gzhead.time>>16&255),I(n,n.gzhead.time>>24&255),I(n,9===n.level?2:n.strategy>=k||n.level<2?4:0),I(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(I(n,255&n.gzhead.extra.length),I(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=l(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(I(n,0),I(n,0),I(n,0),I(n,0),I(n,0),I(n,9===n.level?2:n.strategy>=k||n.level<2?4:0),I(n,3),n.status=j,P(e),0!==n.pending)return n.last_flush=-1,m;if(69===n.status){if(n.gzhead.extra){let t=n.pending,r=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=l(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,P(e),0!==n.pending)return n.last_flush=-1,m;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=l(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=l(e.adler,n.pending_buf,n.pending-r,r)),P(e),0!==n.pending)return n.last_flush=-1,m;r=0}t=n.gzindexr&&(e.adler=l(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=l(e.adler,n.pending_buf,n.pending-r,r)),P(e),0!==n.pending)return n.last_flush=-1,m;r=0}t=n.gzindexr&&(e.adler=l(e.adler,n.pending_buf,n.pending-r,r))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(P(e),0!==n.pending))return n.last_flush=-1,m;I(n,255&e.adler),I(n,e.adler>>8&255),e.adler=0}if(n.status=j,P(e),0!==n.pending)return n.last_flush=-1,m}if(0!==e.avail_in||0!==n.lookahead||t!==f&&n.status!==$){let r=0===n.level?G(n,t):n.strategy===k?((e,t)=>{let n;for(;;){if(0===e.lookahead&&(H(e),0===e.lookahead)){if(t===f)return 1;break}if(e.match_length=0,n=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(L(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===p?(L(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(L(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===A?((e,t)=>{let n,r,i,o;const s=e.window;for(;;){if(e.lookahead<=S){if(H(e),e.lookahead<=S&&t===f)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,r=s[i],r===s[++i]&&r===s[++i]&&r===s[++i])){o=e.strstart+S;do{}while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=a(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(L(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===p?(L(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(L(e,!1),0===e.strm.avail_out)?1:2})(n,t):Z[n.level].func(n,t);if(3!==r&&4!==r||(n.status=$),1===r||3===r)return 0===e.avail_out&&(n.last_flush=-1),m;if(2===r&&(t===d?s(n):t!==g&&(i(n,0,0,!1),t===h&&(T(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),P(e),0===e.avail_out))return n.last_flush=-1,m}return t!==p?m:n.wrap<=0?y:(2===n.wrap?(I(n,255&e.adler),I(n,e.adler>>8&255),I(n,e.adler>>16&255),I(n,e.adler>>24&255),I(n,255&e.total_in),I(n,e.total_in>>8&255),I(n,e.total_in>>16&255),I(n,e.total_in>>24&255)):(U(n,e.adler>>>16),U(n,65535&e.adler)),P(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?m:y)},e.exports.deflateEnd=e=>{if(K(e))return v;const t=e.state.status;return e.state=null,t===j?N(e,b):m},e.exports.deflateSetDictionary=(e,t)=>{let n=t.length;if(K(e))return v;const r=e.state,i=r.wrap;if(2===i||1===i&&r.status!==M||r.lookahead)return v;if(1===i&&(e.adler=u(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){0===i&&(T(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,H(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=R(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,H(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,r.wrap=i,m},e.exports.deflateInfo="pako deflate (from Nodeca project)"},414:e=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},293:e=>{"use strict";const t=16209;e.exports=function(e,n){let r,i,o,a,s,u,l,c,f,d,h,p,g,m,y,v,b,x,_,w,k,A,E,O;const D=e.state;r=e.next_in,E=e.input,i=r+(e.avail_in-5),o=e.next_out,O=e.output,a=o-(n-e.avail_out),s=o+(e.avail_out-257),u=D.dmax,l=D.wsize,c=D.whave,f=D.wnext,d=D.window,h=D.hold,p=D.bits,g=D.lencode,m=D.distcode,y=(1<>>24,h>>>=x,p-=x,x=b>>>16&255,0===x)O[o++]=65535&b;else{if(!(16&x)){if(64&x){if(32&x){D.mode=16191;break e}e.msg="invalid literal/length code",D.mode=t;break e}b=g[(65535&b)+(h&(1<>>=x,p-=x),p<15&&(h+=E[r++]<>>24,h>>>=x,p-=x,x=b>>>16&255,16&x){if(w=65535&b,x&=15,pu){e.msg="invalid distance too far back",D.mode=t;break e}if(h>>>=x,p-=x,x=o-a,w>x){if(x=w-x,x>c&&D.sane){e.msg="invalid distance too far back",D.mode=t;break e}if(k=0,A=d,0===f){if(k+=l-x,x<_){_-=x;do{O[o++]=d[k++]}while(--x);k=o-w,A=O}}else if(f2;)O[o++]=A[k++],O[o++]=A[k++],O[o++]=A[k++],_-=3;_&&(O[o++]=A[k++],_>1&&(O[o++]=A[k++]))}else{k=o-w;do{O[o++]=O[k++],O[o++]=O[k++],O[o++]=O[k++],_-=3}while(_>2);_&&(O[o++]=O[k++],_>1&&(O[o++]=O[k++]))}break}if(64&x){e.msg="invalid distance code",D.mode=t;break e}b=m[(65535&b)+(h&(1<>3,r-=_,p-=_<<3,h&=(1<{"use strict";const r=n(269),i=n(823),o=n(293),a=n(998),{Z_FINISH:s,Z_BLOCK:u,Z_TREES:l,Z_OK:c,Z_STREAM_END:f,Z_NEED_DICT:d,Z_STREAM_ERROR:h,Z_DATA_ERROR:p,Z_MEM_ERROR:g,Z_BUF_ERROR:m,Z_DEFLATED:y}=n(681),v=16180,b=16190,x=16191,_=16192,w=16194,k=16199,A=16200,E=16206,O=16209,D=16210,C=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function S(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const F=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode16211?1:0},M=e=>{if(F(e))return h;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=v,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,c},j=e=>{if(F(e))return h;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,M(e)},$=(e,t)=>{let n;if(F(e))return h;const r=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?h:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,j(e))},N=(e,t)=>{if(!e)return h;const n=new S;e.state=n,n.strm=e,n.window=null,n.mode=v;const r=$(e,t);return r!==c&&(e.state=null),r};let B,T,z=!0;const R=e=>{if(z){B=new Int32Array(512),T=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(1,e.lens,0,288,B,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(2,e.lens,0,32,T,0,e.work,{bits:5}),z=!1}e.lencode=B,e.lenbits=9,e.distcode=T,e.distbits=5},P=(e,t,n,r)=>{let i;const o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),o.window.set(t.subarray(n-r,n-r+i),o.wnext),(r-=i)?(o.window.set(t.subarray(n-r,n),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whaveN(e,15),e.exports.inflateInit2=N,e.exports.inflate=(e,t)=>{let n,S,M,j,$,N,B,T,z,L,I,U,q,W,H,G,V,Y,X,Z,J,K,Q=0;const ee=new Uint8Array(4);let te,ne;const re=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(F(e)||!e.output||!e.input&&0!==e.avail_in)return h;n=e.state,n.mode===x&&(n.mode=_),$=e.next_out,M=e.output,B=e.avail_out,j=e.next_in,S=e.input,N=e.avail_in,T=n.hold,z=n.bits,L=N,I=B,K=c;e:for(;;)switch(n.mode){case v:if(0===n.wrap){n.mode=_;break}for(;z<16;){if(0===N)break e;N--,T+=S[j++]<>>8&255,n.check=i(n.check,ee,2,0),T=0,z=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&T)<<8)+(T>>8))%31){e.msg="incorrect header check",n.mode=O;break}if((15&T)!==y){e.msg="unknown compression method",n.mode=O;break}if(T>>>=4,z-=4,J=8+(15&T),0===n.wbits&&(n.wbits=J),J>15||J>n.wbits){e.msg="invalid window size",n.mode=O;break}n.dmax=1<>8&1),512&n.flags&&4&n.wrap&&(ee[0]=255&T,ee[1]=T>>>8&255,n.check=i(n.check,ee,2,0)),T=0,z=0,n.mode=16182;case 16182:for(;z<32;){if(0===N)break e;N--,T+=S[j++]<>>8&255,ee[2]=T>>>16&255,ee[3]=T>>>24&255,n.check=i(n.check,ee,4,0)),T=0,z=0,n.mode=16183;case 16183:for(;z<16;){if(0===N)break e;N--,T+=S[j++]<>8),512&n.flags&&4&n.wrap&&(ee[0]=255&T,ee[1]=T>>>8&255,n.check=i(n.check,ee,2,0)),T=0,z=0,n.mode=16184;case 16184:if(1024&n.flags){for(;z<16;){if(0===N)break e;N--,T+=S[j++]<>>8&255,n.check=i(n.check,ee,2,0)),T=0,z=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(U=n.length,U>N&&(U=N),U&&(n.head&&(J=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(S.subarray(j,j+U),J)),512&n.flags&&4&n.wrap&&(n.check=i(n.check,S,U,j)),N-=U,j+=U,n.length-=U),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===N)break e;U=0;do{J=S[j+U++],n.head&&J&&n.length<65536&&(n.head.name+=String.fromCharCode(J))}while(J&&U>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=x;break;case 16189:for(;z<32;){if(0===N)break e;N--,T+=S[j++]<>>=7&z,z-=7&z,n.mode=E;break}for(;z<3;){if(0===N)break e;N--,T+=S[j++]<>>=1,z-=1,3&T){case 0:n.mode=16193;break;case 1:if(R(n),n.mode=k,t===l){T>>>=2,z-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=O}T>>>=2,z-=2;break;case 16193:for(T>>>=7&z,z-=7&z;z<32;){if(0===N)break e;N--,T+=S[j++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=O;break}if(n.length=65535&T,T=0,z=0,n.mode=w,t===l)break e;case w:n.mode=16195;case 16195:if(U=n.length,U){if(U>N&&(U=N),U>B&&(U=B),0===U)break e;M.set(S.subarray(j,j+U),$),N-=U,j+=U,B-=U,$+=U,n.length-=U;break}n.mode=x;break;case 16196:for(;z<14;){if(0===N)break e;N--,T+=S[j++]<>>=5,z-=5,n.ndist=1+(31&T),T>>>=5,z-=5,n.ncode=4+(15&T),T>>>=4,z-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=O;break}n.have=0,n.mode=16197;case 16197:for(;n.have>>=3,z-=3}for(;n.have<19;)n.lens[re[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,te={bits:n.lenbits},K=a(0,n.lens,0,19,n.lencode,0,n.work,te),n.lenbits=te.bits,K){e.msg="invalid code lengths set",n.mode=O;break}n.have=0,n.mode=16198;case 16198:for(;n.have>>24,G=Q>>>16&255,V=65535&Q,!(H<=z);){if(0===N)break e;N--,T+=S[j++]<>>=H,z-=H,n.lens[n.have++]=V;else{if(16===V){for(ne=H+2;z>>=H,z-=H,0===n.have){e.msg="invalid bit length repeat",n.mode=O;break}J=n.lens[n.have-1],U=3+(3&T),T>>>=2,z-=2}else if(17===V){for(ne=H+3;z>>=H,z-=H,J=0,U=3+(7&T),T>>>=3,z-=3}else{for(ne=H+7;z>>=H,z-=H,J=0,U=11+(127&T),T>>>=7,z-=7}if(n.have+U>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=O;break}for(;U--;)n.lens[n.have++]=J}}if(n.mode===O)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=O;break}if(n.lenbits=9,te={bits:n.lenbits},K=a(1,n.lens,0,n.nlen,n.lencode,0,n.work,te),n.lenbits=te.bits,K){e.msg="invalid literal/lengths set",n.mode=O;break}if(n.distbits=6,n.distcode=n.distdyn,te={bits:n.distbits},K=a(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,te),n.distbits=te.bits,K){e.msg="invalid distances set",n.mode=O;break}if(n.mode=k,t===l)break e;case k:n.mode=A;case A:if(N>=6&&B>=258){e.next_out=$,e.avail_out=B,e.next_in=j,e.avail_in=N,n.hold=T,n.bits=z,o(e,I),$=e.next_out,M=e.output,B=e.avail_out,j=e.next_in,S=e.input,N=e.avail_in,T=n.hold,z=n.bits,n.mode===x&&(n.back=-1);break}for(n.back=0;Q=n.lencode[T&(1<>>24,G=Q>>>16&255,V=65535&Q,!(H<=z);){if(0===N)break e;N--,T+=S[j++]<>Y)],H=Q>>>24,G=Q>>>16&255,V=65535&Q,!(Y+H<=z);){if(0===N)break e;N--,T+=S[j++]<>>=Y,z-=Y,n.back+=Y}if(T>>>=H,z-=H,n.back+=H,n.length=V,0===G){n.mode=16205;break}if(32&G){n.back=-1,n.mode=x;break}if(64&G){e.msg="invalid literal/length code",n.mode=O;break}n.extra=15&G,n.mode=16201;case 16201:if(n.extra){for(ne=n.extra;z>>=n.extra,z-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;Q=n.distcode[T&(1<>>24,G=Q>>>16&255,V=65535&Q,!(H<=z);){if(0===N)break e;N--,T+=S[j++]<>Y)],H=Q>>>24,G=Q>>>16&255,V=65535&Q,!(Y+H<=z);){if(0===N)break e;N--,T+=S[j++]<>>=Y,z-=Y,n.back+=Y}if(T>>>=H,z-=H,n.back+=H,64&G){e.msg="invalid distance code",n.mode=O;break}n.offset=V,n.extra=15&G,n.mode=16203;case 16203:if(n.extra){for(ne=n.extra;z>>=n.extra,z-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=O;break}n.mode=16204;case 16204:if(0===B)break e;if(U=I-B,n.offset>U){if(U=n.offset-U,U>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=O;break}U>n.wnext?(U-=n.wnext,q=n.wsize-U):q=n.wnext-U,U>n.length&&(U=n.length),W=n.window}else W=M,q=$-n.offset,U=n.length;U>B&&(U=B),B-=U,n.length-=U;do{M[$++]=W[q++]}while(--U);0===n.length&&(n.mode=A);break;case 16205:if(0===B)break e;M[$++]=n.length,B--,n.mode=A;break;case E:if(n.wrap){for(;z<32;){if(0===N)break e;N--,T|=S[j++]<{if(F(e))return h;let t=e.state;return t.window&&(t.window=null),e.state=null,c},e.exports.inflateGetHeader=(e,t)=>{if(F(e))return h;const n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,c):h},e.exports.inflateSetDictionary=(e,t)=>{const n=t.length;let i,o,a;return F(e)?h:(i=e.state,0!==i.wrap&&i.mode!==b?h:i.mode===b&&(o=1,o=r(o,t,n,0),o!==i.check)?p:(a=P(e,t,n,n),a?(i.mode=D,g):(i.havedict=1,c)))},e.exports.inflateInfo="pako inflate (from Nodeca project)"},998:e=>{"use strict";const t=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),n=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),r=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),i=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);e.exports=(e,o,a,s,u,l,c,f)=>{const d=f.bits;let h,p,g,m,y,v,b=0,x=0,_=0,w=0,k=0,A=0,E=0,O=0,D=0,C=0,S=null;const F=new Uint16Array(16),M=new Uint16Array(16);let j,$,N,B=null;for(b=0;b<=15;b++)F[b]=0;for(x=0;x=1&&0===F[w];w--);if(k>w&&(k=w),0===w)return u[l++]=20971520,u[l++]=20971520,f.bits=1,0;for(_=1;_0&&(0===e||1!==w))return-1;for(M[1]=0,b=1;b<15;b++)M[b+1]=M[b]+F[b];for(x=0;x852||2===e&&D>592)return 1;for(;;){j=b-E,c[x]+1=v?($=B[c[x]-v],N=S[c[x]-v]):($=96,N=0),h=1<>E)+p]=j<<24|$<<16|N}while(0!==p);for(h=1<>=1;if(0!==h?(C&=h-1,C+=h):C=0,x++,0==--F[b]){if(b===w)break;b=o[a+c[x]]}if(b>k&&(C&m)!==g){for(0===E&&(E=k),y+=_,A=b-E,O=1<852||2===e&&D>592)return 1;g=C&m,u[g]=k<<24|A<<16|y-l}}return 0!==C&&(u[y+C]=b-E<<24|64<<16),f.bits=k,0}},674:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},665:e=>{"use strict";function t(e){let t=e.length;for(;--t>=0;)e[t]=0}const n=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),r=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),o=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=new Array(576);t(a);const s=new Array(60);t(s);const u=new Array(512);t(u);const l=new Array(256);t(l);const c=new Array(29);t(c);const f=new Array(30);function d(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let h,p,g;function m(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}t(f);const y=e=>e<256?u[e]:u[256+(e>>>7)],v=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},b=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<{b(e,n[2*t],n[2*t+1])},_=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},w=(e,t,n)=>{const r=new Array(16);let i,o,a=0;for(i=1;i<=15;i++)a=a+n[i-1]<<1,r[i]=a;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=_(r[t]++,t))}},k=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},A=e=>{e.bi_valid>8?v(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},E=(e,t,n,r)=>{const i=2*t,o=2*n;return e[i]{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i{let o,a,s,u,d=0;if(0!==e.sym_next)do{o=255&e.pending_buf[e.sym_buf+d++],o+=(255&e.pending_buf[e.sym_buf+d++])<<8,a=e.pending_buf[e.sym_buf+d++],0===o?x(e,a,t):(s=l[a],x(e,s+256+1,t),u=n[s],0!==u&&(a-=c[s],b(e,a,u)),o--,s=y(o),x(e,s,i),u=r[s],0!==u&&(o-=f[s],b(e,o,u)))}while(d{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,s,u,l=-1;for(e.heap_len=0,e.heap_max=573,a=0;a>1;a>=1;a--)O(e,n,a);u=o;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],O(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,n[2*u]=n[2*a]+n[2*s],e.depth[u]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,n[2*a+1]=n[2*s+1]=u,e.heap[1]=u++,O(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length;let l,c,f,d,h,p,g=0;for(d=0;d<=15;d++)e.bl_count[d]=0;for(n[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],d=n[2*n[2*c+1]+1]+1,d>u&&(d=u,g++),n[2*c+1]=d,c>r||(e.bl_count[d]++,h=0,c>=s&&(h=a[c-s]),p=n[2*c],e.opt_len+=p*(d+h),o&&(e.static_len+=p*(i[2*c+1]+h)));if(0!==g){do{for(d=u-1;0===e.bl_count[d];)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(d=u;0!==d;d--)for(c=e.bl_count[d];0!==c;)f=e.heap[--l],f>r||(n[2*f+1]!==d&&(e.opt_len+=(d-n[2*f+1])*n[2*f],n[2*f+1]=d),c--)}})(e,t),w(n,l,e.bl_count)},S=(e,t,n)=>{let r,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s{let r,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s{b(e,0+(r?1:0),3),A(e),v(e,n),v(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n};e.exports._tr_init=e=>{M||((()=>{let e,t,o,m,y;const v=new Array(16);for(o=0,m=0;m<28;m++)for(c[m]=o,e=0;e<1<>=7;m<30;m++)for(f[m]=y<<7,e=0;e<1<{let i,u,l=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),C(e,e.l_desc),C(e,e.d_desc),l=(e=>{let t;for(S(e,e.dyn_ltree,e.l_desc.max_code),S(e,e.dyn_dtree,e.d_desc.max_code),C(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*o[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,u=e.static_len+3+7>>>3,u<=i&&(i=u)):i=u=n+5,n+4<=i&&-1!==t?j(e,t,n,r):4===e.strategy||u===i?(b(e,2+(r?1:0),3),D(e,a,s)):(b(e,4+(r?1:0),3),((e,t,n,r)=>{let i;for(b(e,t-257,5),b(e,n-1,5),b(e,r-4,4),i=0;i(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(l[n]+256+1)]++,e.dyn_dtree[2*y(t)]++),e.sym_next===e.sym_end),e.exports._tr_align=e=>{b(e,2,3),x(e,256,a),(e=>{16===e.bi_valid?(v(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}},442:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},156:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.version=t.VegaWidget=t.VegaWidgetModel=t.vegaEmbed=void 0,t.render=function(e,t,n,r,i){const a=function(e,t){for(let n=0;n-1&&s>-1)return;const l=document.getElementById(e.substring(1));(0,o.default)(l,t,Object.assign(Object.assign({loader:{http:{credentials:"same-origin"}}},r),{mode:n})).then((t=>{t.view.toImageURL("png").then((t=>{if(void 0!==i){const n={data:{"image/png":t.split(",")[1]},metadata:{"jupyter-vega":e},output_type:"display_data"};i.outputs.push(n)}})).catch((e=>u(l,e)))})).catch((e=>u(l,e)))};const o=n(690);var a=n(690);Object.defineProperty(t,"vegaEmbed",{enumerable:!0,get:function(){return a.default}});var s=n(110);function u(e,t){throw e.innerHTML=`
\n

Javascript Error: ${t.message}

\n

This usually means there's a typo in your chart specification.\n See the JavaScript console for the full traceback.

\n
`,t}Object.defineProperty(t,"VegaWidgetModel",{enumerable:!0,get:function(){return s.VegaWidgetModel}}),Object.defineProperty(t,"VegaWidget",{enumerable:!0,get:function(){return s.VegaWidget}}),t.version=n(330).version,i(n(110),t)},728:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(156),i=n(55);e.exports={id:"jupyter-vega",requires:[i.IJupyterWidgetRegistry],activate:(e,t)=>{t.registerWidget({name:"jupyter-vega",version:r.version,exports:r})},autoStart:!0}},672:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MODULE_NAME=t.MODULE_VERSION=void 0;const r=n(330);t.MODULE_VERSION=r.version,t.MODULE_NAME=r.name},110:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.VegaWidget=t.VegaWidgetModel=void 0;const i=n(55),o=n(672),a=n(156),s=n(655),u=n(452);class l extends i.DOMWidgetModel{constructor(){super(...arguments),this.viewInstance=null}defaults(){return Object.assign(Object.assign({},i.DOMWidgetModel.prototype.defaults()),{_model_name:"VegaWidgetModel",_view_name:"VegaWidget",_spec_source:"",_opt_source:"",_df:s([]),_img_url:"",_columns:[]})}}t.VegaWidgetModel=l,l.serializers=Object.assign(Object.assign({},i.DOMWidgetModel.serializers),{_img_url:{serialize:function(e,t){if(null===t.viewInstance||void 0===t.viewInstance.viewElement||!1===t.viewInstance.hasBeenUpdated)return e;let n=t.viewInstance.viewElement.id;""!==n&&void 0!==n||(n="VEGA_ID_"+crypto.randomUUID(),t.viewInstance.viewElement.id=n);let r=document.querySelector(`#${n} canvas`);return null===r?e:JSON.stringify({width:r.style.width||r.width,height:r.style.height||r.height,url:r.toDataURL()})}},_df:u.table_serialization}),l.model_name="VegaWidgetModel",l.model_module=o.MODULE_NAME,l.model_module_version=o.MODULE_VERSION,l.view_name="VegaWidget",l.view_module=o.MODULE_NAME,l.view_module_version=o.MODULE_VERSION;class c extends i.DOMWidgetView{constructor(){super(...arguments),this.hasBeenUpdated=!1,this.viewElement=document.createElement("div"),this.errorElement=document.createElement("div")}render(){return r(this,void 0,void 0,(function*(){this.el.appendChild(this.viewElement),this.errorElement.style.color="red",this.el.appendChild(this.errorElement),this.model.viewInstance=this;const e=()=>r(this,void 0,void 0,(function*(){const e=JSON.parse(this.model.get("_spec_source")),t=JSON.parse(this.model.get("_opt_source")||"{}"),n=this.model.get("_img_url");if(""!==n&&"null"!==n){let e=JSON.parse(n),t=document.createElement("img");t.src=e.url;let r=parseInt(e.height);r>0&&(t.height=r);let i=parseInt(e.width);return i>0&&(t.width=i),this.viewElement.appendChild(t),void this.model.set("_img_url","null")}if(null!=e)try{const n=yield(0,a.vegaEmbed)(this.viewElement,e,Object.assign({loader:{http:{credentials:"same-origin"}}},t));this.result&&this.result.finalize(),this.result=n,this.send({type:"display"})}catch(e){this.result&&this.result.finalize(),console.error(e)}})),t=(e,t)=>r(this,void 0,void 0,(function*(){const n=this.result;if(null==n)throw new Error("Internal error: no view attached to widget");const r=new Function("datum",`return (${e.remove||"false"})`);let i=e.insert||[];switch(i){case"@dataframe":i=this.updateDataFrame();break;case"@array2d":i=this.updateArray2D()}const o=n.view.changeset().remove(r).insert(i),a=n.view.change(e.key,o);t&&a.resize(),yield a.runAsync()})),n=e=>r(this,void 0,void 0,(function*(){this.hasBeenUpdated=!0;for(const n of e.updates)yield t(n,e.resize)}));this.model.on("change:_spec_source",e),this.model.on("change:_opt_source",e),this.model.on("msg:custom",(e=>{const t=function(e){return"update"!=e.type?null:e}(e);null!=t&&n(t).catch((e=>{this.errorElement.textContent=String(e),console.error(e)}))})),yield e()}))}updateDataFrame(){const e=this.model.get("_df"),t=(0,u.rowProxy)(e),n=Array(e.size);for(let e=0;e{"use strict";e.exports=function(e,t,n){return 0===e.length?e:t?(n||e.sort(t),function(e,t){for(var n=1,r=e.length,i=e[0],o=e[0],a=1;a=48&&t<=57))return!1;n++}return!0}function d(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function h(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function p(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,n=e.length;t0&&"constructor"==s[l-1]))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&void 0===p&&(void 0===u[g]?p=s.slice(0,l).join("/"):l==d-1&&(p=t.path),void 0!==p&&m(t,0,e,p)),l++,Array.isArray(u)){if("-"===g)g=u.length;else{if(n&&!f(g))throw new y("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);f(g)&&(g=~~g)}if(l>=d){if(n&&"add"===t.op&&g>u.length)throw new y("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);if(!1===(a=x[t.op].call(t,u,g,e)).test)throw new y("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(l>=d){if(!1===(a=b[t.op].call(t,u,g,e)).test)throw new y("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}if(u=u[g],n&&l0)throw new y('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new y("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new y("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&p(e.value))throw new y("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n)if("add"==e.op){var i=e.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new y("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==r)throw new y("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if("move"===e.op||"copy"===e.op){var a=E([{op:"_get",path:e.from,value:void 0}],n);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new y("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}function E(e,t,n){try{if(!Array.isArray(e))throw new y("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)k(c(t),c(e),n||!0);else{n=n||A;for(var r=0;r0&&(e.patches=[],e.callback&&e.callback(r)),r}function j(e,t,n,r,i){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var o=l(t),a=l(e),s=!1,f=a.length-1;f>=0;f--){var h=e[g=a[f]];if(!u(t,g)||void 0===t[g]&&void 0!==h&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:"test",path:r+"/"+d(g),value:c(h)}),n.push({op:"remove",path:r+"/"+d(g)}),s=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}));else{var p=t[g];"object"==typeof h&&null!=h&&"object"==typeof p&&null!=p&&Array.isArray(h)===Array.isArray(p)?j(h,p,n,r+"/"+d(g),i):h!==p&&(i&&n.push({op:"test",path:r+"/"+d(g),value:c(h)}),n.push({op:"replace",path:r+"/"+d(g),value:c(p)}))}}if(s||o.length!=a.length)for(f=0;f0)return[m,n+l.join(",\n"+p),s].join("\n"+o)}return y}(e,"",0)}));var z=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}};const R=Object.freeze({loose:!0}),P=Object.freeze({});var L=e=>e?"object"!=typeof e?R:e:P,I={exports:{}};var U={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},q="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=U,o=q,a=(t=e.exports={}).re=[],s=t.safeRe=[],u=t.src=[],l=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",i],[f,r]],h=(e,t,n)=>{const r=(e=>{for(const[t,n]of d)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),i=c++;o(e,i,t),l[e]=i,u[i]=t,a[i]=new RegExp(t,n?"g":void 0),s[i]=new RegExp(r,n?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),h("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${f}+`),h("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),h("FULL",`^${u[l.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),h("LOOSE",`^${u[l.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),h("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?`+`(?:${u[l.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",u[l.COERCE],!0),h("COERCERTLFULL",u[l.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",h("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",h("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(I,I.exports);var W=I.exports;const H=/^[0-9]+$/,G=(e,t)=>{const n=H.test(e),r=H.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:eG(t,e)};const Y=q,{MAX_LENGTH:X,MAX_SAFE_INTEGER:Z}=U,{safeRe:J,t:K}=W,Q=L,{compareIdentifiers:ee}=V;var te=class e{constructor(t,n){if(n=Q(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>X)throw new TypeError(`version is longer than ${X} characters`);Y("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=t.trim().match(n.loose?J[K.LOOSE]:J[K.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Z||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Z||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Z||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===ee(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const ne=te,re=(e,t,n)=>new ne(e,n).compare(new ne(t,n)),ie=re,oe=re,ae=re,se=re,ue=re,le=re;var ce,fe,de,he,pe=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return((e,t,n)=>0===ie(e,t,n))(e,n,r);case"!=":return((e,t,n)=>0!==oe(e,t,n))(e,n,r);case">":return((e,t,n)=>ae(e,t,n)>0)(e,n,r);case">=":return((e,t,n)=>se(e,t,n)>=0)(e,n,r);case"<":return((e,t,n)=>ue(e,t,n)<0)(e,n,r);case"<=":return((e,t,n)=>le(e,t,n)<=0)(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};function ge(){if(he)return de;he=1;class e{constructor(t,i){if(i=n(i),t instanceof e)return t.loose===!!i.loose&&t.includePrerelease===!!i.includePrerelease?t:new e(t.raw,i);if(t instanceof r)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!h(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&p(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const n=((this.options.includePrerelease&&f)|(this.options.loose&&d))+":"+e,o=t.get(n);if(o)return o;const p=this.options.loose,g=p?a[s.HYPHENRANGELOOSE]:a[s.HYPHENRANGE];e=e.replace(g,O(this.options.includePrerelease)),i("hyphen replace",e),e=e.replace(a[s.COMPARATORTRIM],u),i("comparator trim",e),e=e.replace(a[s.TILDETRIM],l),i("tilde trim",e),e=e.replace(a[s.CARETTRIM],c),i("caret trim",e);let y=e.split(" ").map((e=>m(e,this.options))).join(" ").split(/\s+/).map((e=>E(e,this.options)));p&&(y=y.filter((e=>(i("loose invalid filter",e,this.options),!!e.match(a[s.COMPARATORLOOSE]))))),i("range list",y);const v=new Map,b=y.map((e=>new r(e,this.options)));for(const e of b){if(h(e))return[e];v.set(e.value,e)}v.size>1&&v.has("")&&v.delete("");const x=[...v.values()];return t.set(n,x),x}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>g(e,n)&&t.set.some((t=>g(t,n)&&e.every((e=>t.every((t=>e.intersects(t,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new o(e,this.options)}catch(e){return!1}for(let t=0;t")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(o(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(o(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}ce=t;const n=L,{safeRe:r,t:i}=W,o=pe,a=q,s=te,u=ge();return ce}(),i=q,o=te,{safeRe:a,t:s,comparatorTrimReplace:u,tildeTrimReplace:l,caretTrimReplace:c}=W,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:d}=U,h=e=>"<0.0.0-0"===e.value,p=e=>""===e.value,g=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},m=(e,t)=>(i("comp",e,t),e=x(e,t),i("caret",e),e=v(e,t),i("tildes",e),e=w(e,t),i("xrange",e),e=A(e,t),i("stars",e),e),y=e=>!e||"x"===e.toLowerCase()||"*"===e,v=(e,t)=>e.trim().split(/\s+/).map((e=>b(e,t))).join(" "),b=(e,t)=>{const n=t.loose?a[s.TILDELOOSE]:a[s.TILDE];return e.replace(n,((t,n,r,o,a)=>{let s;return i("tilde",e,t,n,r,o,a),y(n)?s="":y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(o)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(i("replaceTilde pr",a),s=`>=${n}.${r}.${o}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${o} <${n}.${+r+1}.0-0`,i("tilde return",s),s}))},x=(e,t)=>e.trim().split(/\s+/).map((e=>_(e,t))).join(" "),_=(e,t)=>{i("caret",e,t);const n=t.loose?a[s.CARETLOOSE]:a[s.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,o,a,s)=>{let u;return i("caret",e,t,n,o,a,s),y(n)?u="":y(o)?u=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(a)?u="0"===n?`>=${n}.${o}.0${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.0${r} <${+n+1}.0.0-0`:s?(i("replaceCaret pr",s),u="0"===n?"0"===o?`>=${n}.${o}.${a}-${s} <${n}.${o}.${+a+1}-0`:`>=${n}.${o}.${a}-${s} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${a}-${s} <${+n+1}.0.0-0`):(i("no pr"),u="0"===n?"0"===o?`>=${n}.${o}.${a}${r} <${n}.${o}.${+a+1}-0`:`>=${n}.${o}.${a}${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${a} <${+n+1}.0.0-0`),i("caret return",u),u}))},w=(e,t)=>(i("replaceXRanges",e,t),e.split(/\s+/).map((e=>k(e,t))).join(" ")),k=(e,t)=>{e=e.trim();const n=t.loose?a[s.XRANGELOOSE]:a[s.XRANGE];return e.replace(n,((n,r,o,a,s,u)=>{i("xRange",e,n,r,o,a,s,u);const l=y(o),c=l||y(a),f=c||y(s),d=f;return"="===r&&d&&(r=""),u=t.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(c&&(a=0),s=0,">"===r?(r=">=",c?(o=+o+1,a=0,s=0):(a=+a+1,s=0)):"<="===r&&(r="<",c?o=+o+1:a=+a+1),"<"===r&&(u="-0"),n=`${r+o}.${a}.${s}${u}`):c?n=`>=${o}.0.0${u} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${a}.0${u} <${o}.${+a+1}.0-0`),i("xRange return",n),n}))},A=(e,t)=>(i("replaceStars",e,t),e.trim().replace(a[s.STAR],"")),E=(e,t)=>(i("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?s.GTE0PRE:s.GTE0],"")),O=e=>(t,n,r,i,o,a,s,u,l,c,f,d)=>`${n=y(r)?"":y(i)?`>=${r}.0.0${e?"-0":""}`:y(o)?`>=${r}.${i}.0${e?"-0":""}`:a?`>=${n}`:`>=${n}${e?"-0":""}`} ${u=y(l)?"":y(c)?`<${+l+1}.0.0-0`:y(f)?`<${l}.${+c+1}.0-0`:d?`<=${l}.${c}.${f}-${d}`:e?`<${l}.${c}.${+f+1}-0`:`<=${u}`}`.trim(),D=(e,t,n)=>{for(let n=0;n0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return de}const me=ge();var ye=N(((e,t,n)=>{try{t=new me(t,n)}catch(e){return!1}return t.test(e)}));var ve={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},be={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>ee<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},xe={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const _e=Array.prototype.slice,we=(e,t,n)=>{const r=n?n(t[0]):t[0];return r[e].apply(r,_e.call(t,1))};var ke={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:(e,t,n,r,i,o,a)=>new Date(e,t||0,null!=n?n:1,r||0,i||0,o||0,a||0),date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return we("join",arguments)},indexof:function(){return we("indexOf",arguments)},lastindexof:function(){return we("lastIndexOf",arguments)},slice:function(){return we("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return we("substring",arguments,String)},split:function(){return we("split",arguments,String)},replace:function(){return we("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const Ae=["view","item","group","xy","x","y"],Ee=new Set([Function,eval,setTimeout,setInterval]);"function"==typeof setImmediate&&Ee.add(setImmediate);const Oe={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:"datum"===n?e.datum:"event"===n?e.event:"item"===n?e.item:ve[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,r=e(t.object);n&&(e.memberDepth+=1);const i=e(t.property);if(n&&(e.memberDepth-=1),!Ee.has(r[i]))return r[i];console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`)},CallExpression:(e,t)=>{const n=t.arguments;let r=t.callee.name;return r.startsWith("_")&&(r=r.slice(1)),"if"===r?e(n[0])?e(n[1]):e(n[2]):(e.fn[r]||ke[r]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>be[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>xe[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>"&&"===t.operator?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce(((t,n)=>{e.memberDepth+=1;const r=e(n.key);return e.memberDepth-=1,Ee.has(e(n.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):t[r]=e(n.value),t}),{})};function De(e,t,n,r,i,o){const a=e=>Oe[e.type](a,e);return a.memberDepth=0,a.fn=Object.create(t),a.params=n,a.datum=r,a.event=i,a.item=o,Ae.forEach((e=>a.fn[e]=function(){return i.vega[e](...arguments)})),a(e)}var Ce={operator(e,t){const n=t.ast,r=e.functions;return e=>De(n,r,e)},parameter(e,t){const n=t.ast,r=e.functions;return(e,t)=>De(n,r,t,e)},event(e,t){const n=t.ast,r=e.functions;return e=>De(n,r,void 0,void 0,e)},handler(e,t){const n=t.ast,r=e.functions;return(e,t)=>{const i=t.item&&t.item.datum;return De(n,r,e,i,t)}},encode(e,t){const{marktype:n,channels:r}=t,i=e.functions,o="group"===n||"image"===n||"rect"===n;return(e,t)=>{const a=e.datum;let s,u=0;for(const n in r)s=De(r[n].ast,i,t,a,void 0,e),e[n]!==s&&(e[n]=s,u=1);return"rule"!==n&&function(e,t,n){let r;t.x2&&(t.x?(n&&e.x>e.x2&&(r=e.x,e.x=e.x2,e.x2=r),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(r=e.y,e.y=e.y2,e.y2=r),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}(e,r,o),u}}};function Se(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}const Fe="#fff",Me="#888",je={background:"#333",view:{stroke:Me},title:{color:Fe,subtitleColor:Fe},style:{"guide-label":{fill:Fe},"guide-title":{fill:Fe}},axis:{domainColor:Fe,gridColor:Me,tickColor:Fe}},$e="#4572a7",Ne={background:"#fff",arc:{fill:$e},area:{fill:$e},line:{stroke:$e,strokeWidth:2},path:{stroke:$e},rect:{fill:$e},shape:{stroke:$e},symbol:{fill:$e,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},Be="#30a2da",Te="#cbcbcb",ze="#f0f0f0",Re="#333",Pe={arc:{fill:Be},area:{fill:Be},axis:{domainColor:Te,grid:!0,gridColor:Te,gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:Te,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:ze,group:{fill:ze},legend:{labelColor:Re,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:Re,titleFontSize:14,titlePadding:10},line:{stroke:Be,strokeWidth:2},path:{stroke:Be,strokeWidth:.5},rect:{fill:Be},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:Be},bar:{binSpacing:2,fill:Be,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Le="#000",Ie={group:{fill:"#e5e5e5"},arc:{fill:Le},area:{fill:Le},line:{stroke:Le},path:{stroke:Le},rect:{fill:Le},shape:{stroke:Le},symbol:{fill:Le,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},Ue="Benton Gothic, sans-serif",qe="#82c6df",We="Benton Gothic Bold, sans-serif",He="normal",Ge={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},Ve={background:"#ffffff",title:{anchor:"start",color:"#000000",font:We,fontSize:22,fontWeight:"normal"},arc:{fill:qe},area:{fill:qe},line:{stroke:qe,strokeWidth:2},path:{stroke:qe},rect:{fill:qe},shape:{stroke:qe},symbol:{fill:qe,size:30},axis:{labelFont:Ue,labelFontSize:11.5,labelFontWeight:"normal",titleFont:We,titleFontSize:13,titleFontWeight:He},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:Ue,labelFontSize:11.5,symbolType:"square",titleFont:We,titleFontSize:13,titleFontWeight:He},range:{category:Ge["category-6"],diverging:Ge["fireandice-6"],heatmap:Ge["fire-7"],ordinal:Ge["fire-7"],ramp:Ge["fire-7"]}},Ye="#ab5787",Xe="#979797",Ze={background:"#f9f9f9",arc:{fill:Ye},area:{fill:Ye},line:{stroke:Ye},path:{stroke:Ye},rect:{fill:Ye},shape:{stroke:Ye},symbol:{fill:Ye,size:30},axis:{domainColor:Xe,domainWidth:.5,gridWidth:.2,labelColor:Xe,tickColor:Xe,tickWidth:.2,titleColor:Xe},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},Je="#3e5c69",Ke={background:"#fff",arc:{fill:Je},area:{fill:Je},line:{stroke:Je},path:{stroke:Je},rect:{fill:Je},shape:{stroke:Je},symbol:{fill:Je},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},Qe="#1696d2",et="#000000",tt="Lato",nt="Lato",rt={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},it={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:tt},axisX:{domain:!0,domainColor:et,domainWidth:1,grid:!1,labelFontSize:12,labelFont:nt,labelAngle:0,tickColor:et,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:tt},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:nt,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:tt,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:nt,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:tt,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:rt["six-groups-cat-1"],diverging:rt["diverging-colors"],heatmap:rt["diverging-colors"],ordinal:rt["six-groups-seq"],ramp:rt["shades-blue"]},area:{fill:Qe},rect:{fill:Qe},line:{color:Qe,stroke:Qe,strokeWidth:5},trail:{color:Qe,stroke:Qe,strokeWidth:0,size:1},path:{stroke:Qe,strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:Qe,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:Qe,stroke:null}},arc:{fill:Qe},shape:{stroke:Qe},symbol:{fill:Qe,size:30}},ot="#3366CC",at="#ccc",st="Arial, sans-serif",ut={arc:{fill:ot},area:{fill:ot},path:{stroke:ot},rect:{fill:ot},shape:{stroke:ot},symbol:{stroke:ot},circle:{fill:ot},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:st,fontSize:12},"guide-title":{font:st,fontSize:12},"group-title":{font:st,fontSize:12}},title:{font:st,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:at,tickColor:at,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},lt=e=>e*(1/3+1),ct=lt(9),ft=lt(10),dt=lt(12),ht="Segoe UI",pt="wf_standard-font, helvetica, arial, sans-serif",gt="#252423",mt="#605E5C",yt="transparent",vt="#118DFF",bt="#DEEFFF",xt=[bt,vt],_t={view:{stroke:yt},background:yt,font:ht,header:{titleFont:pt,titleFontSize:dt,titleColor:gt,labelFont:ht,labelFontSize:ft,labelColor:mt},axis:{ticks:!1,grid:!1,domain:!1,labelColor:mt,labelFontSize:ct,titleFont:pt,titleColor:gt,titleFontSize:dt,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:"#C8C6C4",gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:vt},line:{stroke:vt,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:ht,fontSize:ct,fill:mt},arc:{fill:vt},area:{fill:vt,line:!0,opacity:.6},path:{stroke:vt},rect:{fill:vt},point:{fill:vt,filled:!0,size:75},shape:{stroke:vt},symbol:{fill:vt,strokeWidth:1.5,size:50},legend:{titleFont:ht,titleFontWeight:"bold",titleColor:mt,labelFont:ht,labelFontSize:ft,labelColor:mt,symbolType:"circle",symbolSize:75},range:{category:[vt,"#12239E","#E66C37","#6B007B","#E044A7","#744EC2","#D9B300","#D64550"],diverging:xt,heatmap:xt,ordinal:[bt,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",vt]}},wt='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',kt={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},At=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],Et=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function Ot({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",r=kt.gridBg[e],i=kt.textPrimary[e],o=kt.textSecondary[e],a="dark"===n?At:Et,s="dark"===n?"#d4bbff":"#6929c4";return{background:t,arc:{fill:s},area:{fill:s},path:{stroke:s},rect:{fill:s},shape:{stroke:s},symbol:{stroke:s},circle:{fill:s},view:{fill:r,stroke:r},group:{fill:r},title:{color:i,anchor:"start",dy:-15,fontSize:16,font:wt,fontWeight:600},axis:{labelColor:o,labelFontSize:12,labelFont:'IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',labelFontWeight:400,titleColor:i,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:kt.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:wt,fill:o,fontWeight:400},"guide-title":{font:wt,fill:o,fontWeight:400}},range:{category:a,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const Dt=Ot({theme:"white",background:"#ffffff"}),Ct=Ot({theme:"g10",background:"#f4f4f4"}),St=Ot({theme:"g90",background:"#262626"}),Ft=Ot({theme:"g100",background:"#161616"});var Mt=Object.freeze({__proto__:null,carbong10:Ct,carbong100:Ft,carbong90:St,carbonwhite:Dt,dark:je,excel:Ne,fivethirtyeight:Pe,ggplot2:Ie,googlecharts:ut,latimes:Ve,powerbi:_t,quartz:Ze,urbaninstitute:it,version:"2.15.0",vox:Ke});function jt(e,t,n){return e.fields=t||[],e.fname=n,e}const $t=e=>function(t){return t[e]},Nt=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),s=r=i+1):"]"===o&&(s||Bt("Access path missing open bracket: "+e),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&Bt("Access path missing closing bracket: "+e),a&&Bt("Access path missing closing quote: "+e),i>r&&(i++,l()),t}(e);e=1===t.length?t[0]:e,jt(function(e){return 1===e.length?$t(e[0]):Nt(e)}(t),[e],e)})("id"),jt((e=>e),[],"identity"),jt((()=>0),[],"zero"),jt((()=>1),[],"one"),jt((()=>!0),[],"true"),jt((()=>!1),[],"false");var Tt=Array.isArray;function zt(e){return e===Object(e)}function Rt(e,t){return JSON.stringify(e,function(e){const t=[];return function(n,r){if("object"!=typeof r||null===r)return r;const i=t.indexOf(this)+1;return t.length=i,t.length>e?"[Object]":t.indexOf(r)>=0?"[Circular]":(t.push(r),r)}}(t))}const Pt="vg-tooltip-element",Lt={offsetX:10,offsetY:10,id:Pt,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(e){return String(e).replace(/&/g,"&").replace(/t("string"==typeof e?e:Rt(e,n)))).join(", ")}]`;if(zt(e)){let i="";const{title:o,image:a,...s}=e;o&&(i+=`

${t(o)}

`),a&&(i+=``);const u=Object.keys(s);if(u.length>0){i+="";for(const e of u){let r=s[e];void 0!==r&&(zt(r)&&(r=Rt(r,n)),i+=``)}i+="
${t(e)}${t(r)}
"}return i||"{}"}return t(e)},baseURL:""};class It{constructor(e){this.options={...Lt,...e};const t=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const e=document.createElement("style");e.setAttribute("id",this.options.styleId),e.innerHTML=function(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return"#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black;\n}\n#vg-tooltip-element.visible {\n visibility: visible;\n}\n#vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px;\n}\n#vg-tooltip-element table {\n border-spacing: 0;\n}\n#vg-tooltip-element table tr {\n border: none;\n}\n#vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px;\n}\n#vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px;\n}\n#vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left;\n}\n#vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white;\n}\n#vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf;\n}\n".toString().replace(Pt,e)}(t);const n=document.head;n.childNodes.length>0?n.insertBefore(e,n.childNodes[0]):n.appendChild(e)}}tooltipHandler(e,t,n,r){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),null==r||""===r)return void this.el.classList.remove("visible",`${this.options.theme}-theme`);this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:i,y:o}=function(e,t,n,r){let i=e.clientX+n;i+t.width>window.innerWidth&&(i=+e.clientX-n-t.width);let o=e.clientY+r;return o+t.height>window.innerHeight&&(o=+e.clientY-r-t.height),{x:i,y:o}}(t,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${o}px`,this.el.style.left=`${i}px`}}var Ut='.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box;\n}\n.vega-embed.has-actions {\n padding-right: 38px;\n}\n.vega-embed details:not([open]) > :not(summary) {\n display: none !important;\n}\n.vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n cursor: pointer;\n line-height: 0px;\n}\n.vega-embed summary::-webkit-details-marker {\n display: none;\n}\n.vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset;\n}\n.vega-embed summary svg {\n width: 14px;\n height: 14px;\n}\n.vega-embed details[open] summary {\n opacity: 0.7;\n}\n.vega-embed:hover summary, .vega-embed:focus-within summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease;\n}\n.vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left;\n}\n.vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none;\n}\n.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {\n background-color: #f7f7f9;\n color: black;\n}\n.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute;\n}\n.vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid rgba(0, 0, 0, 0);\n border-bottom-color: #d9d9d9;\n}\n.vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid rgba(0, 0, 0, 0);\n border-bottom-color: #fff;\n}\n.vega-embed .chart-wrapper.fit-x {\n width: 100%;\n}\n.vega-embed .chart-wrapper.fit-y {\n height: 100%;\n}\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: auto;\n padding-right: 14px;\n}\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n';function qt(e,...t){for(const n of t)Wt(e,n);return e}function Wt(t,n){for(const r of Object.keys(n))e.writeConfig(t,r,n[r],!0)}const Ht="6.26.0",Gt=i;let Vt=o;const Yt="undefined"!=typeof window?window:void 0;void 0===Vt&&Yt?.vl?.compile&&(Vt=Yt.vl);const Xt={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},Zt={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},Jt={vega:"Vega","vega-lite":"Vega-Lite"},Kt={vega:Gt.version,"vega-lite":Vt?Vt.version:"not available"},Qt={vega:e=>e,"vega-lite":(e,t)=>Vt.compile(e,{config:t}).spec},en='\n\n \n \n \n',tn="chart-wrapper";function nn(e,t,n,r){const i=`${t}
`,o=`
${n}`,a=window.open("");a.document.write(i+e+o),a.document.title=`${Jt[r]} JSON Source`}function rn(e){return!(!e||!("load"in e))}function on(e){return rn(e)?e:Gt.loader(e)}async function an(t,n,r={}){let i,o;e.isString(n)?(o=on(r.loader),i=JSON.parse(await o.load(n))):i=n;const a=function(t){const n=t.usermeta?.embedOptions??{};return e.isString(n.defaultStyle)&&(n.defaultStyle=!1),n}(i),s=a.loader;o&&!s||(o=on(r.loader??s));const u=await sn(a,o),l=await sn(r,o),c={...qt(l,u),config:e.mergeConfig(l.config??{},u.config??{})};return await async function(t,n,r={},i){const o=r.theme?e.mergeConfig(Mt[r.theme],r.config??{}):r.config,a=e.isBoolean(r.actions)?r.actions:qt({},Xt,r.actions??{}),s={...Zt,...r.i18n},u=r.renderer??"canvas",l=r.logLevel??Gt.Warn,c=r.downloadFileName??"visualization",f="string"==typeof t?document.querySelector(t):t;if(!f)throw new Error(`${t} does not exist`);if(!1!==r.defaultStyle){const e="vega-embed-style",{root:t,rootContainer:n}=function(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}(f);if(!t.getElementById(e)){const t=document.createElement("style");t.id=e,t.innerHTML=void 0===r.defaultStyle||!0===r.defaultStyle?Ut.toString():r.defaultStyle,n.appendChild(t)}}const d=function(e,t){if(e.$schema){const n=Se(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${Jt[n.library]}, but mode argument sets ${Jt[t]??t}.`);const r=n.library;return ye(Kt[r],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${Jt[r]} ${n.version}, but the current version of ${Jt[r]} is v${Kt[r]}.`),r}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t??"vega"}(n,r.mode);let h=Qt[d](n,o);if("vega-lite"===d&&h.$schema){const e=Se(h.$schema);ye(Kt.vega,`^${e.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${e.version}, but current version is v${Kt.vega}.`)}f.classList.add("vega-embed"),a&&f.classList.add("has-actions"),f.innerHTML="";let p=f;if(a){const e=document.createElement("div");e.classList.add(tn),f.appendChild(e),p=e}const g=r.patch;if(g&&(h=g instanceof Function?g(h):k(h,g,!0,!1).newDocument),r.formatLocale&&Gt.formatLocale(r.formatLocale),r.timeFormatLocale&&Gt.timeFormatLocale(r.timeFormatLocale),r.expressionFunctions)for(const e in r.expressionFunctions){const t=r.expressionFunctions[e];"fn"in t?Gt.expressionFunction(e,t.fn,t.visitor):t instanceof Function&&Gt.expressionFunction(e,t)}const{ast:m}=r,y=Gt.parse(h,"vega-lite"===d?{}:o,{ast:m}),v=new(r.viewClass||Gt.View)(y,{loader:i,logLevel:l,renderer:u,...m?{expr:Gt.expressionInterpreter??r.expr??Ce}:{}});if(v.addSignalListener("autosize",((e,t)=>{const{type:n}=t;"fit-x"==n?(p.classList.add("fit-x"),p.classList.remove("fit-y")):"fit-y"==n?(p.classList.remove("fit-x"),p.classList.add("fit-y")):"fit"==n?p.classList.add("fit-x","fit-y"):p.classList.remove("fit-x","fit-y")})),!1!==r.tooltip){const{loader:e,tooltip:t}=r,n=e&&!rn(e)?e?.baseURL:void 0,i="function"==typeof t?t:new It({baseURL:n,...!0===t?{}:t}).call;v.tooltip(i)}let b,{hover:x}=r;if(void 0===x&&(x="vega"===d),x){const{hoverSet:e,updateSet:t}="boolean"==typeof x?{}:x;v.hover(e,t)}if(r&&(null!=r.width&&v.width(r.width),null!=r.height&&v.height(r.height),null!=r.padding&&v.padding(r.padding)),await v.initialize(p,r.bind).runAsync(),!1!==a){let t=f;if(!1!==r.defaultStyle||r.forceActionsMenu){const e=document.createElement("details");e.title=s.CLICK_TO_VIEW_ACTIONS,f.append(e),t=e;const n=document.createElement("summary");n.innerHTML=en,e.append(n),b=t=>{e.contains(t.target)||e.removeAttribute("open")},document.addEventListener("click",b)}const i=document.createElement("div");if(t.append(i),i.classList.add("vega-actions"),!0===a||!1!==a.export)for(const t of["svg","png"])if(!0===a||!0===a.export||a.export[t]){const n=s[`${t.toUpperCase()}_ACTION`],o=document.createElement("a"),a=e.isObject(r.scaleFactor)?r.scaleFactor[t]:r.scaleFactor;o.text=n,o.href="#",o.target="_blank",o.download=`${c}.${t}`,o.addEventListener("mousedown",(async function(e){e.preventDefault();const n=await v.toImageURL(t,a);this.href=n})),i.append(o)}if(!0===a||!1!==a.source){const e=document.createElement("a");e.text=s.SOURCE_ACTION,e.href="#",e.addEventListener("click",(function(e){nn(T(n),r.sourceHeader??"",r.sourceFooter??"",d),e.preventDefault()})),i.append(e)}if("vega-lite"===d&&(!0===a||!1!==a.compiled)){const e=document.createElement("a");e.text=s.COMPILED_ACTION,e.href="#",e.addEventListener("click",(function(e){nn(T(h),r.sourceHeader??"",r.sourceFooter??"","vega"),e.preventDefault()})),i.append(e)}if(!0===a||!1!==a.editor){const e=r.editorUrl??"https://vega.github.io/editor/",t=document.createElement("a");t.text=s.EDITOR_ACTION,t.href="#",t.addEventListener("click",(function(t){(function(e,t,n){const r=e.open(t),{origin:i}=new URL(t);let o=40;e.addEventListener("message",(function t(n){n.source===r&&(o=0,e.removeEventListener("message",t,!1))}),!1),setTimeout((function e(){o<=0||(r.postMessage(n,i),setTimeout(e,250),o-=1)}),250)})(window,e,{config:o,mode:g?"vega":d,renderer:u,spec:T(g?h:n)}),t.preventDefault()})),i.append(t)}}function _(){b&&document.removeEventListener("click",b),v.finalize()}return{view:v,spec:n,vgSpec:h,finalize:_,embedOptions:r}}(t,i,c,o)}async function sn(t,n){const r=e.isString(t.config)?JSON.parse(await n.load(t.config)):t.config??{},i=e.isString(t.patch)?JSON.parse(await n.load(t.patch)):t.patch;return{...t,...i?{patch:i}:{},...r?{config:r}:{}}}async function un(e,t={}){const n=document.createElement("div");n.classList.add("vega-embed-wrapper");const r=document.createElement("div");n.appendChild(r);const i=!0===t.actions||!1===t.actions?t.actions:{export:!0,source:!1,compiled:!0,editor:!0,...t.actions},o=await an(r,e,{actions:i,...t});return n.value=o.view,n}const ln=(...t)=>{return t.length>1&&(e.isString(t[0])&&!((n=t[0]).startsWith("http://")||n.startsWith("https://")||n.startsWith("//"))||t[0]instanceof HTMLElement||3===t.length)?an(t[0],t[1],t[2]):un(t[0],t[1]);var n};return ln.vegaLite=Vt,ln.vl=Vt,ln.container=un,ln.embed=an,ln.vega=Gt,ln.default=an,ln.version=Ht,ln}(n(190),n(208))},208:(e,t,n)=>{"use strict";n.r(t),n.d(t,{accessPathDepth:()=>me,accessPathWithDatum:()=>ce,compile:()=>Gg,contains:()=>W,deepEqual:()=>z,deleteNestedProperty:()=>ue,duplicate:()=>R,entries:()=>ie,every:()=>G,fieldIntersection:()=>ee,flatAccessWithDatum:()=>fe,getFirstDefined:()=>ye,hasIntersection:()=>K,hash:()=>U,internalField:()=>_e,isBoolean:()=>oe,isEmpty:()=>te,isEqual:()=>Z,isInternalField:()=>we,isNullOrFalse:()=>q,isNumeric:()=>Ae,keys:()=>ne,logicalExpr:()=>se,mergeDeep:()=>V,normalize:()=>Eu,normalizeAngle:()=>ke,omit:()=>L,pick:()=>P,prefixGenerator:()=>Q,removePathFromField:()=>ge,replaceAll:()=>pe,replacePathInField:()=>he,resetIdCounter:()=>xe,setEqual:()=>J,some:()=>H,stringify:()=>I,titleCase:()=>le,unique:()=>X,uniqueId:()=>be,vals:()=>re,varName:()=>ae,version:()=>r.rE});const r={rE:"4.17.0"};function i(e,t,n){return e.fields=t||[],e.fname=n,e}function o(e){return 1===e.length?a(e[0]):s(e)}const a=e=>function(t){return t[e]},s=e=>{const t=e.length;return function(n){for(let r=0;rr&&c(),s=r=i+1):"]"===o&&(s||u("Access path missing open bracket: "+e),s>0&&c(),s=0,r=i+1):i>r?c():r=i+1}return s&&u("Access path missing closing bracket: "+e),a&&u("Access path missing closing quote: "+e),i>r&&(i++,c()),t}!function(e,t,n){const r=l(e);e=1===r.length?r[0]:e,i((n&&n.get||o)(r),[e],t||e)}("id");const c=i((e=>e),[],"identity");function f(e,t,n){const r=[t].concat([].slice.call(n));console[e].apply(console,r)}i((()=>0),[],"zero"),i((()=>1),[],"one"),i((()=>!0),[],"true"),i((()=>!1),[],"false");var d=Array.isArray;function h(e){return e===Object(e)}const p=e=>"__proto__"!==e;function g(...e){return e.reduce(((e,t)=>{for(const n in t)if("signals"===n)e.signals=y(e.signals,t.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;m(e,n,t[n],r)}return e}),{})}function m(e,t,n,r){if(!p(t))return;let i,o;if(h(n)&&!d(n))for(i in o=h(e[t])?e[t]:e[t]={},n)r&&(!0===r||r[i])?m(o,i,n[i]):p(i)&&(o[i]=n[i]);else e[t]=n}function y(e,t){if(null==e)return t;const n={},r=[];function i(e){n[e.name]||(n[e.name]=1,r.push(e))}return t.forEach(i),e.forEach(i),r}function v(e){return null!=e?d(e)?e:[e]:[]}const b=Object.prototype.hasOwnProperty;function x(e,t){return b.call(e,t)}function _(e){return"boolean"==typeof e}function w(e){return"number"==typeof e}function k(e){return"string"==typeof e}function A(e){return d(e)?"["+e.map(A)+"]":h(e)||k(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function E(e){const t={},n=e.length;for(let r=0;rT(e,t)))}:j(e)?{or:e.or.map((e=>T(e,t)))}:t(e)}const z=S(),R=D();function P(e,t){const n={};for(const r of t)x(e,r)&&(n[r]=e[r]);return n}function L(e,t){const n=Object.assign({},e);for(const e of t)delete n[e];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map((e=>M()(e))).join(",")})`};const I=M();function U(e){if(w(e))return e;const t=k(e)?e:M()(e);if(t.length<250)return t;let n=0;for(let e=0;e-1}function H(e,t){let n=0;for(const[r,i]of e.entries())if(t(i,r,n++))return!0;return!1}function G(e,t){let n=0;for(const[r,i]of e.entries())if(!t(i,r,n++))return!1;return!0}function V(e,...t){for(const n of t)Y(e,null!=n?n:{});return e}function Y(e,t){for(const n of ne(t))m(e,n,t[n],!0)}function X(e,t){const n=[],r={};let i;for(const o of e)i=t(o),i in r||(r[i]=1,n.push(o));return n}function Z(e,t){const n=ne(e),r=ne(t);if(n.length!==r.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function J(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function K(e,t){for(const n of e)if(t.has(n))return!0;return!1}function Q(e){const t=new Set;for(const n of e){const e=l(n).map(((e,t)=>0===t?e:`[${e}]`)),r=e.map(((t,n)=>e.slice(0,n+1).join("")));for(const e of r)t.add(e)}return t}function ee(e,t){return void 0===e||void 0===t||K(Q(e),Q(t))}function te(e){return 0===ne(e).length}const ne=Object.keys,re=Object.values,ie=Object.entries;function oe(e){return!0===e||!1===e}function ae(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function se(e,t){return N(e)?"!("+se(e.not,t)+")":$(e)?"("+e.and.map((e=>se(e,t))).join(") && (")+")":j(e)?"("+e.or.map((e=>se(e,t))).join(") || (")+")":t(e)}function ue(e,t){if(0===t.length)return!0;const n=t.shift();return n in e&&ue(e[n],t)&&delete e[n],te(e)}function le(e){return e.charAt(0).toUpperCase()+e.substr(1)}function ce(e,t="datum"){const n=l(e),r=[];for(let e=1;e<=n.length;e++){const i=`[${n.slice(0,e).map(A).join("][")}]`;r.push(`${t}${i}`)}return r.join(" && ")}function fe(e,t="datum"){return`${t}[${A(l(e).join("."))}]`}function de(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function he(e){return`${l(e).map(de).join("\\.")}`}function pe(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function ge(e){return`${l(e).join(".")}`}function me(e){return e?l(e).length:0}function ye(...e){for(const t of e)if(void 0!==t)return t}let ve=42;function be(e){const t=++ve;return e?String(e)+t:t}function xe(){ve=42}function _e(e){return we(e)?e:`__${e}`}function we(e){return 0===e.indexOf("__")}function ke(e){if(void 0!==e)return(e%360+360)%360}function Ae(e){return!!w(e)||!isNaN(e)&&!isNaN(parseFloat(e))}const Ee={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function Oe(e){return e&&e.condition}const De=["domain","grid","labels","ticks","title"],Ce={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"main",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},Se={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},Fe=Object.assign(Object.assign({},Se),{style:1,labelExpr:1,encoding:1});function Me(e){return!!Fe[e]}ne(Fe);const je=ne({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1}),$e={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},Ne={count:1,min:1,max:1};function Be(e){return!!e&&!!e.argmin}function Te(e){return!!e&&!!e.argmax}function ze(e){return k(e)&&!!$e[e]}ne($e);const Re=["count","valid","missing","distinct"];function Pe(e){return k(e)&&W(Re,e)}const Le=["count","sum","distinct","valid","missing"],Ie=E(["mean","average","median","q1","q3","min","max"]);var Ue=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);iTn(e[t])?ae(`_${t}_${ie(e[t])}`):ae(`_${t}_${e[t]}`))).join("")}function $n(e){return!0===e||Bn(e)&&!e.binned}function Nn(e){return"binned"===e||Bn(e)&&!0===e.binned}function Bn(e){return h(e)}function Tn(e){return null==e?void 0:e.selection}function zn(e){switch(e){case qe:case We:case ut:case it:case ot:case at:case ht:case ct:case ft:case dt:case st:return 6;case pt:return 4;default:return 10}}function Rn(e){return`Invalid specification ${JSON.stringify(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Pn='Autosize "fit" only works for single views and layered views.';function Ln(e){return("width"==e?"Width":"Height")+' "container" only works for single views and layered views.'}function In(e){return`${"width"==e?"Width":"Height"} "container" only works well with autosize "fit" or "fit-${"width"==e?"x":"y"}".`}function Un(e){return e?`Dropping "fit-${e}" because spec has discrete ${Vt(e)}.`:'Dropping "fit" because spec has discrete size.'}function qn(e){return`Unknown field for ${e}. Cannot calculate view size.`}function Wn(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function Hn(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Gn(e){return`Selection not supported for ${e} yet.`}function Vn(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}function Yn(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}function Xn(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Zn(e){return`Invalid field type "${e}".`}function Jn(e,t){const{fill:n,stroke:r}=t;return`Dropping color ${e} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function Kn(e,t){return`Dropping ${I(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}function Qn(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function er(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function tr(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${"ordinal"===t?"order":"magnitude"}.`}function nr(e){return`Using unaggregated domain with raw field has no effect (${I(e)}).`}function rr(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function ir(e){return`Unaggregated domain is currently unsupported for log scale (${I(e)}).`}function or(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function ar(e){return`The step for "${e}" is dropped because the ${"width"===e?"x":"y"} is continuous.`}const sr="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";function ur(e,t){return`Invalid ${e}: ${I(t)}.`}function lr(e){return`1D error band does not support ${e}.`}function cr(e){return`Channel ${e} is required for "binned" bin.`}const fr=function(){let e=2;return{level(t){return arguments.length?(e=+t,this):e},error(){return e>=1&&f("error","ERROR",arguments),this},warn(){return e>=2&&f("warn","WARN",arguments),this},info(){return e>=3&&f("log","INFO",arguments),this},debug(){return e>=4&&f("log","DEBUG",arguments),this}}}();let dr=fr;function hr(...e){dr.warn(...e)}function pr(e){if(e&&h(e))for(const t of kr)if(t in e)return!0;return!1}new WeakMap;const gr=["january","february","march","april","may","june","july","august","september","october","november","december"],mr=gr.map((e=>e.substr(0,3))),yr=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],vr=yr.map((e=>e.substr(0,3)));function br(e,t){const n=[];if(t&&void 0!==e.day&&ne(e).length>1&&(hr(function(e){return`Dropping day from datetime ${I(e)} as day cannot be combined with other units.`}(e)),delete(e=R(e)).day),void 0!==e.year?n.push(e.year):n.push(2012),void 0!==e.month){const r=t?function(e){if(Ae(e)&&(e=+e),w(e))return e-1;{const t=e.toLowerCase(),n=gr.indexOf(t);if(-1!==n)return n;const r=t.substr(0,3),i=mr.indexOf(r);if(-1!==i)return i;throw new Error(ur("month",e))}}(e.month):e.month;n.push(r)}else if(void 0!==e.quarter){const r=t?function(e){if(Ae(e)&&(e=+e),w(e))return e>4&&hr(ur("quarter",e)),e-1;throw new Error(ur("quarter",e))}(e.quarter):e.quarter;n.push(w(r)?3*r:r+"*3")}else n.push(0);if(void 0!==e.date)n.push(e.date);else if(void 0!==e.day){const r=t?function(e){if(Ae(e)&&(e=+e),w(e))return e%7;{const t=e.toLowerCase(),n=yr.indexOf(t);if(-1!==n)return n;const r=t.substr(0,3),i=vr.indexOf(r);if(-1!==i)return i;throw new Error(ur("day",e))}}(e.day):e.day;n.push(w(r)?r+1:r+"+1")}else n.push(1);for(const t of["hours","minutes","seconds","milliseconds"]){const r=e[t];n.push(void 0===r?0:r)}return n}function xr(e){const t=br(e,!0).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}var _r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0&&"seconds"===t&&"i"===e.charAt(n-1)||e.length>n+3&&"day"===t&&"o"===e.charAt(n+3)||n>0&&"year"===t&&"f"===e.charAt(n-1))}function Cr(e){if(!e)return;const t=Or(e);return`timeUnitSpecifier(${M()(t)}, ${M()(Er)})`}function Sr(e){if(!e)return;let t;return k(e)?t={unit:e}:h(e)&&(t=Object.assign(Object.assign({},e),e.unit?{unit:e.unit}:{})),Ar(t.unit)&&(t.utc=!0,t.unit=t.unit.substr(3)),t}function Fr(e){return e&&!!e.signal}function Mr(e){return!!e.step}function jr(e){return!d(e)&&"field"in e&&"data"in e}const $r=ne({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),Nr={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},Br=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function Tr(e){return e&&!!e.field&&void 0!==e.equal}function zr(e){return e&&!!e.field&&void 0!==e.lt}function Rr(e){return e&&!!e.field&&void 0!==e.lte}function Pr(e){return e&&!!e.field&&void 0!==e.gt}function Lr(e){return e&&!!e.field&&void 0!==e.gte}function Ir(e){if(e&&e.field){if(d(e.range)&&2===e.range.length)return!0;if(Fr(e.range))return!0}return!1}function Ur(e){return e&&!!e.field&&(d(e.oneOf)||d(e.in))}function qr(e){return Ur(e)||Tr(e)||Ir(e)||zr(e)||Pr(e)||Rr(e)||Lr(e)}function Wr(e,t){return ha(e,{timeUnit:t,wrapTime:!0})}function Hr(e,t=!0){var n;const{field:r}=e,i=null===(n=Sr(e.timeUnit))||void 0===n?void 0:n.unit,o=i?"time("+function(e,t,{end:n}={end:!1}){const r=ce(t),i=Ar(e)?"utc":"";let o;const a={};for(const t of kr)Dr(e,t)&&(a[t]="quarter"===(s=t)?`(${i}quarter(${r})-1)`:`${i}${s}(${r})`,o=t);var s;return n&&(a[o]+="+1"),function(e){const t=br(e,!1).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}(a)}(i,r)+")":Xo(e,{expr:"datum"});if(Tr(e))return o+"==="+Wr(e.equal,i);if(zr(e))return`${o}<${Wr(e.lt,i)}`;if(Pr(e))return`${o}>${Wr(e.gt,i)}`;if(Rr(e))return`${o}<=${Wr(e.lte,i)}`;if(Lr(e))return`${o}>=${Wr(e.gte,i)}`;if(Ur(e))return`indexof([${function(e,t){return e.map((e=>Wr(e,t)))}(e.oneOf,i).join(",")}], ${o}) !== -1`;if(function(e){return e&&!!e.field&&void 0!==e.valid}(e))return Gr(o,e.valid);if(Ir(e)){const{range:n}=e,r=Fr(n)?{signal:`${n.signal}[0]`}:n[0],a=Fr(n)?{signal:`${n.signal}[1]`}:n[1];if(null!==r&&null!==a&&t)return"inrange("+o+", ["+Wr(r,i)+", "+Wr(a,i)+"])";const s=[];return null!==r&&s.push(`${o} >= ${Wr(r,i)}`),null!==a&&s.push(`${o} <= ${Wr(a,i)}`),s.length>0?s.join(" && "):"true"}throw new Error(`Invalid field predicate: ${JSON.stringify(e)}`)}function Gr(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Vr(e){var t;return qr(e)&&e.timeUnit?Object.assign(Object.assign({},e),{timeUnit:null===(t=Sr(e.timeUnit))||void 0===t?void 0:t.unit}):e}const Yr={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"},Xr=Yr.quantitative,Zr=Yr.ordinal,Jr=Yr.temporal,Kr=Yr.nominal,Qr=Yr.geojson;ne(Yr);const ei={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},ti={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function ni(e,t){const n=ti[e],r=ti[t];return n===r||"ordinal-position"===n&&"time"===r||"ordinal-position"===r&&"time"===n}ne(ti);const ri={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function ii(e){return ri[e]}const oi=["linear","log","pow","sqrt","symlog","time","utc"],ai=E(oi),si=E(["linear","log","pow","sqrt","symlog"]),ui=E(["quantile","quantize","threshold"]),li=E(oi.concat(["quantile","quantize","threshold","sequential","identity"])),ci=E(["ordinal","bin-ordinal","point","band"]);function fi(e){return e in ci}function di(e){return e in li}function hi(e){return e in ai}function pi(e){return e in ui}function gi(e){return null==e?void 0:e.selection}const mi={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:yi,domain:vi,range:bi,rangeMax:xi,rangeMin:_i,scheme:wi}=(ne(mi),mi),ki=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);iae(`${"unit"===e?"":`_${e}_`}${r[e]}`))).join(""):(n?"utc":"")+"timeunit"+ne(r).map((e=>ae(`_${e}_${r[e]}`))).join("")}(f),s=(!W(["range","mid"],t.binSuffix)&&t.binSuffix||"")+(null!==(i=t.suffix)&&void 0!==i?i:""))}a&&(o=o?`${a}_${o}`:a)}return s&&(o=`${o}_${s}`),a&&(o=`${a}_${o}`),t.forAs?ge(o):t.expr?fe(o,t.expr)+u:he(o)+u}function Zo(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return To(e)&&!!e.bin;case"temporal":return!1}throw new Error(Zn(e.type))}function Jo(e){return!Zo(e)}const Ko=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return function(e){const{aggregate:t,bin:n,timeUnit:r,field:i}=e;if(Te(t))return`${i} for argmax(${t.argmax})`;if(Be(t))return`${i} for argmin(${t.argmin})`;const o=Sr(r),a=t||(null==o?void 0:o.unit)||(null==o?void 0:o.maxbins)&&"timeunit"||$n(n)&&"bin";return a?a.toUpperCase()+"("+i+")":i}(e);default:return function(e,t){var n;const{field:r,bin:i,timeUnit:o,aggregate:a}=e;if("count"===a)return t.countTitle;if($n(i))return`${r} (binned)`;if(o){const e=null===(n=Sr(o))||void 0===n?void 0:n.unit;if(e)return`${r} (${Or(e).join("-")})`}else if(a)return Te(a)?`${r} for max ${a.argmax}`:Be(a)?`${r} for min ${a.argmin}`:`${le(a)} of ${r}`;return r}(e,t)}};let Qo=Ko;function ea(e){Qo=e}function ta(e,t,{allowDisabling:n,includeDefault:r=!0}){var i,o;const a=null===(i=na(e))||void 0===i?void 0:i.title;if(!To(e))return a;const s=e,u=r?ra(s,t):void 0;return n?ye(a,s.title,u):null!==(o=null!=a?a:s.title)&&void 0!==o?o:u}function na(e){return Ho(e)&&e.axis?e.axis:Go(e)&&e.legend?e.legend:Oo(e)&&e.header?e.header:void 0}function ra(e,t){return Qo(e,t)}function ia(e){var t;if(Vo(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}{const n=null!==(t=na(e))&&void 0!==t?t:{},{format:r,formatType:i}=n;return{format:r,formatType:i}}}function oa(e){return To(e)?e:No(e)?e.condition:void 0}function aa(e){return Io(e)?e:Bo(e)?e.condition:void 0}function sa(e,t,n,r={}){return k(e)||w(e)||_(e)?(hr(function(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${I(n)}}.`}(t,k(e)?"string":w(e)?"number":"boolean",e)),{value:e}):Io(e)?ua(e,t,n,r):Bo(e)?Object.assign(Object.assign({},e),{condition:ua(e.condition,t,n,r)}):e}function ua(e,t,n,r){if(Vo(e)){const{format:i,formatType:o}=e,a=Co(e,["format","formatType"]);if(ao(o)&&!n.customFormatTypes)return hr(Xn(t)),ua(a,t,n,r)}else{const i=Ho(e)?"axis":Go(e)?"legend":Oo(e)?"header":null;if(i&&e[i]){const o=e[i],{format:a,formatType:s}=o,u=Co(o,["format","formatType"]);if(ao(s)&&!n.customFormatTypes)return hr(Xn(t)),ua(Object.assign(Object.assign({},e),{[i]:u}),t,n,r)}}return To(e)?la(e,t,r):function(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=w(n)?"quantitative":k(n)?"nominal":pr(n)?"temporal":void 0,Object.assign(Object.assign({},e),{type:t})}(e)}function la(e,t,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:a}=e,s=Object.assign({},e);if(n||!r||ze(r)||Te(r)||Be(r)||(hr(function(e){return`Invalid aggregation operator "${e}".`}(r)),delete s.aggregate),i&&(s.timeUnit=Sr(i)),a&&(s.field=`${a}`),$n(o)&&(s.bin=ca(o,t)),Nn(o)&&!fn(t)&&hr(function(e){return`Channel ${e} should not be used with "binned" bin.`}(t)),Uo(s)){const{type:e}=s,t=function(e){if(e)switch(e=e.toLowerCase()){case"q":case Xr:return"quantitative";case"t":case Jr:return"temporal";case"o":case Zr:return"ordinal";case"n":case Kr:return"nominal";case Qr:return"geojson"}}(e);e!==t&&(s.type=t),"quantitative"!==e&&Pe(r)&&(hr(function(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}(e,r)),s.type="quantitative")}else if(!qt(t)){const e=function(e,t){var n;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Fo(e)&&d(e.sort))return"ordinal";const{aggregate:r,bin:i,timeUnit:o}=e;if(o)return"temporal";if(i||r&&!Te(r)&&!Be(r))return"quantitative";if(Wo(e)&&(null===(n=e.scale)||void 0===n?void 0:n.type))switch(ti[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(s,t);s.type=e}if(Uo(s)){const{compatible:e,warning:n}=function(e,t){const n=e.type;if("geojson"===n&&"shape"!==t)return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case qe:case We:case He:return Jo(e)?{compatible:!1,warning:er(t)}:fa;case Ge:case Ve:case it:case ot:case at:case gt:case yt:case vt:case bt:case xt:case _t:case lt:case Ke:case Ze:case wt:return fa;case tt:case rt:case et:case nt:return n!==Xr?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:fa;case ct:case ft:case dt:case ht:case ut:case Qe:case Je:case Ye:case Xe:return"nominal"!==n||e.sort?fa:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case pt:return W(["ordinal","nominal"],e.type)?fa:{compatible:!1,warning:"StrokeDash channel should be used with only discrete data."};case st:return W(["ordinal","nominal","geojson"],e.type)?fa:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case mt:return"nominal"!==e.type||"sort"in e?fa:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(s,t)||{};!1===e&&hr(n)}if(Fo(s)&&k(s.sort)){const{sort:e}=s;if(_o(e))return Object.assign(Object.assign({},s),{sort:{encoding:e}});const t=e.substr(1);if("-"===e.charAt(0)&&_o(t))return Object.assign(Object.assign({},s),{sort:{encoding:t,order:"descending"}})}if(Oo(s)){const{header:e}=s,{orient:t}=e,n=Co(e,["orient"]);if(t)return Object.assign(Object.assign({},s),{header:Object.assign(Object.assign({},n),{labelOrient:e.labelOrient||t,titleOrient:e.titleOrient||t})})}return s}function ca(e,t){return _(e)?{maxbins:zn(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:Object.assign(Object.assign({},e),{maxbins:zn(t)})}const fa={compatible:!0};function da(e){const{formatType:t}=ia(e);return"time"===t||!t&&(n=e)&&("temporal"===n.type||To(n)&&!!n.timeUnit);var n}function ha(e,{timeUnit:t,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){var o;const a=t&&(null===(o=Sr(t))||void 0===o?void 0:o.unit);let s,u=a||"temporal"===n;return Di(e)?s=e.expr:Fr(e)?s=e.signal:pr(e)?(u=!0,s=xr(e)):(k(e)||w(e))&&u&&(s=`datetime(${JSON.stringify(e)})`,function(e){return!!wr[e]}(a)&&(w(e)&&e<1e4||k(e)&&isNaN(Date.parse(e)))&&(s=xr({[a]:e}))),s?r&&u?`time(${s})`:s:i?void 0:JSON.stringify(e)}function pa(e,t){const{type:n}=e;return t.map((t=>{const r=ha(t,{timeUnit:To(e)?e.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==r?{signal:r}:t}))}function ga(e,t){return $n(e.bin)?Dn(t)&&W(["ordinal","nominal"],e.type):(console.warn("Only call this method for binned field defs."),!1)}var ma=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var r;return e.field.push(Xo(n,t)),e.order.push(null!==(r=n.sort)&&void 0!==r?r:"ascending"),e}),{field:[],order:[]})}function ja(e,t){const n=[...e];return t.forEach((e=>{for(const t of n)if(z(t,e))return;n.push(e)})),n}function $a(e,t){return z(e,t)||!t?e:e?[...v(e),...v(t)].join(", "):t}function Na(e,t){const n=e.value,r=t.value;if(null==n||null===r)return{explicit:e.explicit,value:null};if((va(n)||Fr(n))&&(va(r)||Fr(r)))return{explicit:e.explicit,value:$a(n,r)};if(va(n)||Fr(n))return{explicit:e.explicit,value:n};if(va(r)||Fr(r))return{explicit:e.explicit,value:r};if(!(va(n)||Fr(n)||va(r)||Fr(r)))return{explicit:e.explicit,value:ja(n,r)};throw new Error("It should never reach here")}function Ba(e){return"mark"in e}class Ta{constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return!!Ba(e)&&(Vi(t=e.mark)?t.type:t)===this.name;var t}}var za=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i!!e.field)):To(n)||No(n))}function Pa(e){return H(jt,(t=>{if(Ra(e,t)){const n=e[t];if(d(n))return H(n,(e=>!!e.aggregate));{const e=oa(n);return e&&!!e.aggregate}}return!1}))}function La(e,t){const n=[],r=[],i=[],o=[],a={};return qa(e,((s,u)=>{if(To(s)){const{field:l,aggregate:c,bin:f,timeUnit:d}=s,h=za(s,["field","aggregate","bin","timeUnit"]);if(c||d||f){const e=na(s),p=e&&e.title;let g=Xo(s,{forAs:!0});const m=Object.assign(Object.assign(Object.assign({},p?[]:{title:ta(s,t,{allowDisabling:!0})}),h),{field:g});if(c){let e;if(Te(c)?(e="argmax",g=Xo({op:"argmax",field:c.argmax},{forAs:!0}),m.field=`${g}.${l}`):Be(c)?(e="argmin",g=Xo({op:"argmin",field:c.argmin},{forAs:!0}),m.field=`${g}.${l}`):"boxplot"!==c&&"errorbar"!==c&&"errorband"!==c&&(e=c),e){const t={op:e,as:g};l&&(t.field=l),o.push(t)}}else if(n.push(g),Uo(s)&&$n(f)){if(r.push({bin:f,field:l,as:g}),n.push(Xo(s,{binSuffix:"end"})),ga(s,u)&&n.push(Xo(s,{binSuffix:"range"})),fn(u)){const e={field:g+"_end"};a[u+"2"]=e}m.bin="binned",qt(u)||(m.type=Xr)}else if(d){i.push({timeUnit:d,field:l,as:g});const e=Uo(s)&&s.type!==Jr&&"time";e&&(u===gt||u===bt?m.formatType=e:function(e){return!!sn[e]}(u)?m.legend=Object.assign({formatType:e},m.legend):fn(u)&&(m.axis=Object.assign({formatType:e},m.axis)))}a[u]=m}else n.push(l),a[u]=e[u]}else a[u]=e[u]})),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:a}}function Ia(e,t,n,r){return ne(e).reduce(((i,o)=>{if(!It(o))return hr(function(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}(o)),i;const a=e[o];if("angle"!==o||"arc"!==t||e.theta||(hr("Arc marks uses theta channel rather than angle, replacing angle with theta."),o=Ke),!function(e,t,n){const r=function(e,t){return function(e){switch(e){case it:case ot:case at:case wt:case yt:case vt:case bt:case xt:case mt:case ct:case ft:case dt:case ht:case He:case qe:case We:return Cn;case Ge:case Ve:case et:case tt:return Fn;case Ye:case Xe:case nt:case rt:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case ut:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case pt:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case st:return{point:"always",geoshape:"always"};case gt:return{text:"always"};case lt:return{point:"always",square:"always",text:"always"};case _t:return{image:"always"};case Ke:case Ze:return{text:"always",arc:"always"};case Qe:case Je:return{arc:"always"}}}(e)[t]}(t,n);if(!r)return!1;if("binned"===r){const n=e[t===Ye?Ge:Ve];return!!(To(n)&&To(e[t])&&Nn(n.bin))}return!0}(e,o,t))return hr(Qn(o,t)),i;if(o===ut&&"line"===t){const t=oa(e[o]);if(null==t?void 0:t.aggregate)return hr("Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead."),i}if(o===it&&(n?"fill"in e:"stroke"in e))return hr(Jn("encoding",{fill:"fill"in e,stroke:"stroke"in e})),i;if(o===yt||o===mt&&!d(a)&&!qo(a)||o===bt&&d(a))a&&(i[o]=v(a).reduce(((e,t)=>(To(t)?e.push(la(t,o)):hr(Kn(t,o)),e)),[]));else{if(o===bt&&null===a)i[o]=null;else if(!(To(a)||Ro(a)||qo(a)||$o(a)||Fr(a)))return hr(Kn(a,o)),i;i[o]=sa(a,o,r)}return i}),{})}function Ua(e,t){const n={};for(const r of ne(e)){const i=sa(e[r],r,t,{compositeMark:!0});n[r]=i}return n}function qa(e,t,n){if(e)for(const r of ne(e)){const i=e[r];if(d(i))for(const e of i)t.call(n,e,r);else t.call(n,i,r)}}function Wa(e,t){return ne(t).reduce(((n,r)=>{switch(r){case Ge:case Ve:case xt:case wt:case _t:case Ye:case Xe:case Ke:case Qe:case Ze:case Je:case et:case tt:case nt:case rt:case gt:case st:case lt:case bt:return n;case mt:if("line"===e||"trail"===e)return n;case yt:case vt:{const e=t[r];if(d(e)||To(e))for(const t of v(e))t.aggregate||n.push(Xo(t,{}));return n}case ut:if("trail"===e)return n;case it:case ot:case at:case ct:case ft:case dt:case pt:case ht:{const e=oa(t[r]);return e&&!e.aggregate&&n.push(Xo(e,{})),n}}}),[])}var Ha=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const i=r?` of ${Va(t)}`:"";return{field:e+t.field,type:t.type,title:Fr(n)?{signal:n+`"${escape(i)}"`}:n+i}})),...X(function(e){const t=[];for(const n of ne(e))if(Ra(e,n)){const r=v(e[n]);for(const e of r)To(e)?t.push(e):No(e)&&t.push(e.condition)}return t}(n).map(Yo),U)]}}function Va(e){const{title:t,field:n}=e;return ye(t,n)}function Ya(e,t,n,r,i){const{scale:o,axis:a}=n;return({partName:s,mark:u,positionPrefix:l,endPositionPrefix:c,extraEncoding:f={}})=>{const d=Va(n);return Xa(e,s,i,{mark:u,encoding:Object.assign(Object.assign(Object.assign({[t]:Object.assign(Object.assign(Object.assign({field:l+"_"+n.field,type:n.type},void 0!==d?{title:d}:{}),void 0!==o?{scale:o}:{}),void 0!==a?{axis:a}:{})},k(c)?{[t+"2"]:{field:c+"_"+n.field}}:{}),r),f)})}}function Xa(e,t,n,r){const{clip:i,color:o,opacity:a}=e,s=e.type;return e[t]||void 0===e[t]&&n[t]?[Object.assign(Object.assign({},r),{mark:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n[t]),i?{clip:i}:{}),o?{color:o}:{}),a?{opacity:a}:{}),Vi(r.mark)?r.mark:{type:r.mark}),{style:`${s}-${t}`}),_(e[t])?{}:e[t])})]:[]}function Za(e,t,n){const{encoding:r}=e,i="vertical"===t?"y":"x",o=r[i],a=r[i+"2"],s=r[i+"Error"],u=r[i+"Error2"];return{continuousAxisChannelDef:Ja(o,n),continuousAxisChannelDef2:Ja(a,n),continuousAxisChannelDefError:Ja(s,n),continuousAxisChannelDefError2:Ja(u,n),continuousAxis:i}}function Ja(e,t){if(e&&e.aggregate){const{aggregate:n}=e,r=Ha(e,["aggregate"]);return n!==t&&hr(function(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}(n,t)),r}return e}function Ka(e,t){const{mark:n,encoding:r}=e,{x:i,y:o}=r;if(Vi(n)&&n.orient)return n.orient;if(Po(i)){if(Po(o)){const e=To(i)&&i.aggregate,n=To(o)&&o.aggregate;if(e||n!==t){if(n||e!==t){if(e===t&&n===t)throw new Error("Both x and y cannot have aggregate");return da(o)&&!da(i)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(Po(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}var Qa=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);iYa(l,b,v,e,t.boxplot),F=S(C),M=S(w),j=S(Object.assign(Object.assign({},C),D?{size:D}:{})),$=Ga([{fieldPrefix:"min-max"===p?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===p?"lower_whisker_":"min_",titlePrefix:"Min"}],v,w),N={type:"tick",color:"black",opacity:1,orient:k,invalid:null,aria:!1},B="min-max"===p?$:Ga([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],v,w),T=[...F({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:B}),...F({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:B}),...F({partName:"ticks",mark:N,positionPrefix:"lower_whisker",extraEncoding:B}),...F({partName:"ticks",mark:N,positionPrefix:"upper_whisker",extraEncoding:B})],z=[..."tukey"!==p?T:[],...M({partName:"box",mark:Object.assign(Object.assign({type:"bar"},f?{size:f}:{}),{orient:A,invalid:null,ariaRoleDescription:"box"}),positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:$}),...j({partName:"median",mark:Object.assign(Object.assign(Object.assign({type:"tick",invalid:null},h(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{}),f?{size:f}:{}),{orient:k,aria:!1}),positionPrefix:"mid_box",extraEncoding:$})];if("min-max"===p)return Object.assign(Object.assign({},u),{transform:(null!==(r=u.transform)&&void 0!==r?r:[]).concat(y),layer:z});const R=`datum["lower_box_${v.field}"]`,P=`datum["upper_box_${v.field}"]`,I=`(${P} - ${R})`,U=`${R} - ${c} * ${I}`,q=`${P} + ${c} * ${I}`,W=`datum["${v.field}"]`,H={joinaggregate:is(v.field),groupby:x},G={transform:[{filter:`(${U} <= ${W}) && (${W} <= ${q})`},{aggregate:[{op:"min",field:v.field,as:"lower_whisker_"+v.field},{op:"max",field:v.field,as:"upper_whisker_"+v.field},{op:"min",field:"lower_box_"+v.field,as:"lower_box_"+v.field},{op:"max",field:"upper_box_"+v.field,as:"upper_box_"+v.field},..._],groupby:x}],layer:T},{tooltip:V}=C,Y=Qa(C,["tooltip"]),{scale:X,axis:Z}=v,J=Va(v),K=L(Z,["title"]),Q=Xa(l,"outliers",t.boxplot,{transform:[{filter:`(${W} < ${U}) || (${W} > ${q})`}],mark:"point",encoding:Object.assign(Object.assign(Object.assign({[b]:Object.assign(Object.assign(Object.assign({field:v.field,type:v.type},void 0!==J?{title:J}:{}),void 0!==X?{scale:X}:{}),te(K)?{}:{axis:K})},Y),O?{color:O}:{}),E?{tooltip:E}:{})})[0];let ee;const ne=[...g,...m,H];return Q?ee={transform:ne,layer:[Q,G]}:(ee=G,ee.transform.unshift(...ne)),Object.assign(Object.assign({},u),{layer:[ee,{transform:y,layer:z}]})}function is(e){return[{op:"q1",field:e,as:"lower_box_"+e},{op:"q3",field:e,as:"upper_box_"+e}]}var os=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i1?{layer:p}:Object.assign({},p[0]))}function ls(e,t,n){var r;const{mark:i,encoding:o,selection:a,projection:s}=e,u=os(e,["mark","encoding","selection","projection"]),l=Vi(i)?i:{type:i};a&&hr(Gn(t));const{orient:c,inputType:f}=function(e,t){const{encoding:n}=e;if(function(e){return(Io(e.x)||Io(e.y))&&!Io(e.x2)&&!Io(e.y2)&&!Io(e.xError)&&!Io(e.xError2)&&!Io(e.yError)&&!Io(e.yError2)}(n))return{orient:Ka(e,t),inputType:"raw"};const r=function(e){return Io(e.x2)||Io(e.y2)}(n),i=function(e){return Io(e.xError)||Io(e.xError2)||Io(e.yError)||Io(e.yError2)}(n),o=n.x,a=n.y;if(r){if(i)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const e=n.x2,r=n.y2;if(Io(e)&&Io(r))throw new Error(`${t} cannot have both x2 and y2`);if(Io(e)){if(Po(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}if(Io(r)){if(Po(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}{const e=n.xError,r=n.xError2,i=n.yError,s=n.yError2;if(Io(r)&&!Io(e))throw new Error(`${t} cannot have xError2 without xError`);if(Io(s)&&!Io(i))throw new Error(`${t} cannot have yError2 without yError`);if(Io(e)&&Io(i))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(Io(e)){if(Po(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(Io(i)){if(Po(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}(e,t),{continuousAxisChannelDef:d,continuousAxisChannelDef2:h,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:g,continuousAxis:m}=Za(e,c,t),{errorBarSpecificAggregate:y,postAggregateCalculates:v,tooltipSummary:b,tooltipTitleWithFieldName:x}=function(e,t,n,r,i,o,a,s){let u=[],l=[];const c=t.field;let f,d=!1;if("raw"===o){const t=e.center?e.center:e.extent?"iqr"===e.extent?"median":"mean":s.errorbar.center,n=e.extent?e.extent:"mean"===t?"stderr":"iqr";if("median"===t!=("iqr"===n)&&hr(function(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}(t,n,a)),"stderr"===n||"stdev"===n)u=[{op:n,field:c,as:"extent_"+c},{op:t,field:c,as:"center_"+c}],l=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:"upper_"+c},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:"lower_"+c}],f=[{fieldPrefix:"center_",titlePrefix:le(t)},{fieldPrefix:"upper_",titlePrefix:cs(t,n,"+")},{fieldPrefix:"lower_",titlePrefix:cs(t,n,"-")}],d=!0;else{let e,t,r;"ci"===n?(e="mean",t="ci0",r="ci1"):(e="median",t="q1",r="q3"),u=[{op:t,field:c,as:"lower_"+c},{op:r,field:c,as:"upper_"+c},{op:e,field:c,as:"center_"+c}],f=[{fieldPrefix:"upper_",titlePrefix:ta({field:c,aggregate:r,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:ta({field:c,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:ta({field:c,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&hr((h=e.center,`${(p=e.extent)?"extent ":""}${p&&h?"and ":""}${h?"center ":""}${p&&h?"are ":"is "}not needed when data are aggregated.`)),"aggregated-upper-lower"===o?(f=[],l=[{calculate:`datum["${n.field}"]`,as:"upper_"+c},{calculate:`datum["${c}"]`,as:"lower_"+c}]):"aggregated-error"===o&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`datum["${c}"] + datum["${r.field}"]`,as:"upper_"+c}],i?l.push({calculate:`datum["${c}"] + datum["${i.field}"]`,as:"lower_"+c}):l.push({calculate:`datum["${c}"] - datum["${r.field}"]`,as:"lower_"+c}));for(const e of l)f.push({fieldPrefix:e.as.substring(0,6),titlePrefix:pe(pe(e.calculate,'datum["',""),'"]',"")})}var h,p;return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}(l,d,h,p,g,f,t,n),_=o,w=m,k=(_[w],"x"===m?"x2":"y2"),A=(_[k],"x"===m?"xError":"yError"),E=(_[A],"x"===m?"xError2":"yError2"),O=(_[E],os(_,["symbol"==typeof w?w:w+"","symbol"==typeof k?k:k+"","symbol"==typeof A?A:A+"","symbol"==typeof E?E:E+""])),{bins:D,timeUnits:C,aggregate:S,groupby:F,encoding:M}=La(O,n),j=[...S,...y],$="raw"!==f?[]:F,N=Ga(b,d,M,x);return{transform:[...null!==(r=u.transform)&&void 0!==r?r:[],...D,...C,...0===j.length?[]:[{aggregate:j,groupby:$}],...v],groupby:$,continuousAxisChannelDef:d,continuousAxis:m,encodingWithoutContinuousAxis:M,ticksOrient:"vertical"===c?"horizontal":"vertical",markDef:l,outerSpec:u,tooltipEncoding:N}}function cs(e,t,n){return le(e)+" "+n+" "+t}const fs="errorband",ds=new Ta(fs,hs);function hs(e,{config:t}){e=Object.assign(Object.assign({},e),{encoding:Ua(e.encoding,t)});const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:a,outerSpec:s,tooltipEncoding:u}=ls(e,fs,t),l=a,c=Ya(l,i,r,o,t.errorband),f=void 0!==e.encoding.x&&void 0!==e.encoding.y;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p=Object.assign(Object.assign({},l.interpolate?{interpolate:l.interpolate}:{}),l.tension&&l.interpolate?{tension:l.tension}:{});return f?(d=Object.assign(Object.assign(Object.assign({},d),p),{ariaRoleDescription:"errorband"}),h=Object.assign(Object.assign(Object.assign({},h),p),{aria:!1})):l.interpolate?hr(lr("interpolate")):l.tension&&hr(lr("tension")),Object.assign(Object.assign({},s),{transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]})}const ps={};function gs(e,t,n){const r=new Ta(e,t);ps[e]={normalizer:r,parts:n}}gs(es,rs,["box","median","outliers","rule","ticks"]),gs(as,us,["ticks","rule"]),gs(fs,hs,["band","borders"]);const ms=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],ys={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},vs={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},bs=ne(ys),xs=ne(vs),_s=ne({header:1,headerRow:1,headerColumn:1,headerFacet:1}),ws=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],ks={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1};ne(ks);var As=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function Cs(e){return!(!e||"legend"!==e&&!e.legend)}function Ss(e){return Cs(e)&&h(e)}function Fs(e){return"concat"in e}function Ms(e){return"vconcat"in e}function js(e){return"hconcat"in e}function $s(e){return h(e)&&void 0!==e.step}function Ns(e){return e.view||e.width||e.height}const Bs=ne({align:1,bounds:1,center:1,columns:1,spacing:1});var Ts=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ithis.mapLayerOrUnit(e,t)))})}mapHConcat(e,t){return Object.assign(Object.assign({},e),{hconcat:e.hconcat.map((e=>this.map(e,t)))})}mapVConcat(e,t){return Object.assign(Object.assign({},e),{vconcat:e.vconcat.map((e=>this.map(e,t)))})}mapConcat(e,t){const{concat:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ithis.map(e,t)))})}mapFacet(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}mapRepeat(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}}const eu={zero:1,center:1,normalize:1},tu=new Set([Fi,ji,Mi,zi,Bi,Ii,Ui,Ni,Ri,Pi]),nu=new Set([ji,Mi,Fi]);function ru(e,t){var n,r;const i="x"===t?"y":"radius",o=e[t],a=e[i];if(To(o)&&To(a))if("quantitative"===zo(o)&&"quantitative"===zo(a)){if(o.stack)return t;if(a.stack)return i;const e=To(o)&&!!o.aggregate;if(e!==(To(a)&&!!a.aggregate))return e?t:i;{const e=null===(n=o.scale)||void 0===n?void 0:n.type,s=null===(r=a.scale)||void 0===r?void 0:r.type;if(e&&"linear"!==e)return i;if(s&&"linear"!==s)return t}}else{if("quantitative"===zo(o))return t;if("quantitative"===zo(a))return i}else{if("quantitative"===zo(o))return t;if("quantitative"===zo(a))return i}}function iu(e,t,n={}){const r=Vi(e)?e.type:e;if(!tu.has(r))return null;const i=ru(t,"x")||ru(t,"theta");if(!i)return null;const o=t[i],a=To(o)?Xo(o,{}):void 0;let s=function(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(i),u=t[s],l=To(u)?Xo(u,{}):void 0;l===a&&(l=void 0,u=void 0,s=void 0);const c=un.reduce(((e,n)=>{if("tooltip"!==n&&Ra(t,n)){const r=t[n];for(const t of v(r)){const r=oa(t);if(r.aggregate)continue;const i=Xo(r,{});i&&i===l||e.push({channel:n,fieldDef:r})}}return e}),[]);let f;if(void 0!==o.stack?f=_(o.stack)?o.stack?"zero":null:o.stack:c.length>0&&nu.has(r)&&(f="zero"),!f||!(f in eu))return null;var d;if(Pa(t)&&0===c.length)return null;if(o.scale&&o.scale.type&&o.scale.type!==ei.LINEAR){if(n.disallowNonLinearStack)return null;hr(function(e){return`Cannot stack non-linear scale (${e}).`}(o.scale.type))}return Io(t[Gt(i)])?(void 0!==o.stack&&hr(`Cannot stack "${d=i}" if there is already "${d}2".`),null):(To(o)&&o.aggregate&&!W(Le,o.aggregate)&&hr(`Stacking is applied even though the aggregate function is non-summative ("${o.aggregate}").`),{groupbyChannel:u?s:void 0,groupbyField:l,fieldChannel:i,impute:null!==o.impute&&Wi(r),stackBy:c,offset:f})}var ou=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i1?r:r.type}function su(e){for(const t of["line","area","rule","trail"])e[t]&&(e=Object.assign(Object.assign({},e),{[t]:L(e[t],["point","line"])}));return e}function uu(e,t={},n){return"transparent"===e.point?{opacity:0}:e.point?h(e.point)?e.point:{}:void 0!==e.point?null:t.point||n.shape?h(t.point)?t.point:{}:void 0}function lu(e,t={}){return e.line?!0===e.line?{}:e.line:void 0!==e.line?null:t.line?!0===t.line?{}:t.line:void 0}class cu{constructor(){this.name="path-overlay"}hasMatchingType(e,t){if(Ba(e)){const{mark:n,encoding:r}=e,i=Vi(n)?n:{type:n};switch(i.type){case"line":case"rule":case"trail":return!!uu(i,t[i.type],r);case"area":return!!uu(i,t[i.type],r)||!!lu(i,t[i.type])}}return!1}run(e,t,n){const{config:r}=t,{selection:i,projection:o,mark:a,encoding:s}=e,u=ou(e,["selection","projection","mark","encoding"]),l=Ua(s,r),c=Vi(a)?a:{type:a},f=uu(c,r[c.type],l),d="area"===c.type&&lu(c,r[c.type]),h=[Object.assign(Object.assign({},i?{selection:i}:{}),{mark:au(Object.assign(Object.assign({},"area"===c.type&&void 0===c.opacity&&void 0===c.fillOpacity?{opacity:.7}:{}),c)),encoding:L(l,["shape"])})],p=iu(c,l);let g=l;if(p){const{fieldChannel:e,offset:t}=p;g=Object.assign(Object.assign({},l),{[e]:Object.assign(Object.assign({},l[e]),t?{stack:t}:{})})}return d&&h.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"line"},P(c,["clip","interpolate","tension","tooltip"])),d),encoding:g})),f&&h.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"point",opacity:1,filled:!0},P(c,["clip","tooltip"])),f),encoding:g})),n(Object.assign(Object.assign({},u),{layer:h}),Object.assign(Object.assign({},t),{config:su(r)}))}}var fu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ibu(e,t))).filter((e=>e));else{const e=bu(i,t);void 0!==e&&(n[r]=e)}}return n}class _u{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if(Ba(e)){const{encoding:t,mark:n}=e;if("line"===n)for(const e of Ut){const n=t[Wt(e)];if(t[e]&&(To(n)&&!Nn(n.bin)||Ro(n)))return!0}}return!1}run(e,t,n){const{encoding:r}=e;var i,o;return hr((i=!!r.x2,o=!!r.y2,`Line mark is for continuous lines and thus cannot be used with ${i&&o?"x2 and y2":i?"x2":"y2"}. We will use the rule mark (line segments) instead.`)),n(Object.assign(Object.assign({},e),{mark:"rule"}),t)}}var wu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const n=Object.assign(Object.assign({},u),{layer:e}),i=(r.name||"")+l+`child__layer_${ae(e)}`,o=this.mapLayerOrUnit(r,Object.assign(Object.assign({},t),{repeater:n,repeaterPrefix:i}));return o.name=i,o}))})}mapNonLayerRepeat(e,t){var n;const{repeat:r,spec:i,data:o}=e,a=wu(e,["repeat","spec","data"]);!d(r)&&e.columns&&(e=L(e,["columns"]),hr(Vn("repeat")));const s=[],{repeater:u={},repeaterPrefix:l=""}=t,c=!d(r)&&r.row||[u?u.row:null],f=!d(r)&&r.column||[u?u.column:null],h=d(r)&&r||[u?u.repeat:null];for(const e of h)for(const n of c)for(const o of f){const a={repeat:e,row:n,column:o,layer:u.layer},c=(i.name||"")+l+"child__"+(d(r)?`${ae(e)}`:(r.row?`row_${ae(n)}`:"")+(r.column?`column_${ae(o)}`:"")),f=this.map(i,Object.assign(Object.assign({},t),{repeater:a,repeaterPrefix:c}));f.name=c,s.push(L(f,["data"]))}const p=d(r)?e.columns:r.column?r.column.length:1;return Object.assign(Object.assign({data:null!==(n=i.data)&&void 0!==n?n:o,align:"all"},a),{columns:p,concat:s})}mapFacet(e,t){const{facet:n}=e;return Eo(n)&&e.columns&&(e=L(e,["columns"]),hr(Vn("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){const{encoding:n,projection:r}=e,{parentEncoding:i,parentProjection:o,config:a}=t,s=Au({parentProjection:o,projection:r}),u=ku({parentEncoding:i,encoding:gu(n,t.repeater)});return this.mapUnit(Object.assign(Object.assign(Object.assign({},e),s?{projection:s}:{}),u?{encoding:u}:{}),{config:a})}mapFacetedUnit(e,t){const n=e.encoding,{row:r,column:i,facet:o}=n,a=wu(n,["row","column","facet"]),{mark:s,width:u,projection:l,height:c,view:f,selection:d,encoding:h}=e,p=wu(e,["mark","width","projection","height","view","selection","encoding"]),{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},t),y=gu(a,t.repeater);return this.mapFacet(Object.assign(Object.assign(Object.assign({},p),m),{facet:g,spec:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},u?{width:u}:{}),c?{height:c}:{}),f?{view:f}:{}),l?{projection:l}:{}),{mark:s,encoding:y}),d?{selection:d}:{})}),t)}getFacetMappingAndLayout(e,t){var n;const{row:r,column:i,facet:o}=e;if(r||i){o&&hr(`Facet encoding dropped as ${(a=[...r?[qe]:[],...i?[We]:[]]).join(" and ")} ${a.length>1?"are":"is"} also specified.`);const t={},s={};for(const r of[qe,We]){const i=e[r];if(i){const{align:e,center:o,spacing:a,columns:u}=i,l=wu(i,["align","center","spacing","columns"]);t[r]=l;for(const e of["align","center","spacing"])void 0!==i[e]&&(s[e]=null!==(n=s[e])&&void 0!==n?n:{},s[e][r]=i[e])}}return{facetMapping:t,layout:s}}{const{align:e,center:n,spacing:r,columns:i}=o;return{facetMapping:pu(wu(o,["align","center","spacing","columns"]),t.repeater),layout:Object.assign(Object.assign(Object.assign(Object.assign({},e?{align:e}:{}),n?{center:n}:{}),r?{spacing:r}:{}),i?{columns:i}:{})}}var a}mapLayer(e,t){var{parentEncoding:n,parentProjection:r}=t,i=wu(t,["parentEncoding","parentProjection"]);const{encoding:o,projection:a}=e,s=wu(e,["encoding","projection"]),u=Object.assign(Object.assign({},i),{parentEncoding:ku({parentEncoding:n,encoding:o,layer:!0}),parentProjection:Au({parentProjection:r,projection:a})});return super.mapLayer(s,u)}};function Du(e){return k(e)?{type:e}:null!=e?e:{}}const Cu=["background","padding"];function Su(e,t){const n={};for(const t of Cu)e&&void 0!==e[t]&&(n[t]=_a(e[t]));return t&&(n.params=e.params),n}class Fu{constructor(e={},t={}){this.explicit=e,this.implicit=t}clone(){return new Fu(R(this.explicit),R(this.implicit))}combine(){return Object.assign(Object.assign({},this.explicit),this.implicit)}get(e){return ye(this.explicit[e],this.implicit[e])}getWithExplicit(e){return void 0!==this.explicit[e]?{explicit:!0,value:this.explicit[e]}:void 0!==this.implicit[e]?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,t){void 0!==t.value&&this.set(e,t.value,t.explicit)}set(e,t,n){return delete this[n?"implicit":"explicit"][e],this[n?"explicit":"implicit"][e]=t,this}copyKeyFromSplit(e,t){void 0!==t.explicit[e]?this.set(e,t.explicit[e],!0):void 0!==t.implicit[e]&&this.set(e,t.implicit[e],!1)}copyKeyFromObject(e,t){void 0!==t[e]&&this.set(e,t[e],!0)}copyAll(e){for(const t of ne(e.combine())){const n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}}function Mu(e){return{explicit:!0,value:e}}function ju(e){return{explicit:!1,value:e}}function $u(e){return(t,n,r,i)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:Nu(t,n,r,i)}}function Nu(e,t,n,r){return e.explicit&&t.explicit&&hr(function(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${I(n)} and ${I(r)}). Using ${I(n)}.`}(n,r,e.value,t.value)),e}function Bu(e,t,n,r,i=Nu){return void 0===e||void 0===e.value?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:z(e.value,t.value)?e:i(e,t,n,r)}class Tu extends Fu{constructor(e={},t={},n=!1){super(e,t),this.explicit=e,this.implicit=t,this.parseNothing=n}clone(){const e=super.clone();return e.parseNothing=this.parseNothing,e}}function zu(e){return"url"in e}function Ru(e){return"values"in e}function Pu(e){return"name"in e&&!zu(e)&&!Ru(e)&&!Lu(e)}function Lu(e){return e&&(Iu(e)||Uu(e)||qu(e))}function Iu(e){return"sequence"in e}function Uu(e){return"sphere"in e}function qu(e){return"graticule"in e}var Wu;function Hu(e){return"filter"in e}function Gu(e){return"lookup"in e}function Vu(e){return"pivot"in e}function Yu(e){return"density"in e}function Xu(e){return"quantile"in e}function Zu(e){return"regression"in e}function Ju(e){return"loess"in e}function Ku(e){return"sample"in e}function Qu(e){return"window"in e}function el(e){return"joinaggregate"in e}function tl(e){return"flatten"in e}function nl(e){return"calculate"in e}function rl(e){return"bin"in e}function il(e){return"impute"in e}function ol(e){return"timeUnit"in e}function al(e){return"aggregate"in e}function sl(e){return"stack"in e}function ul(e){return"fold"in e}!function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup"}(Wu||(Wu={}));const ll="[",cl="]",fl="{",dl="}",hl=":",pl=",",gl="@",ml=">",yl=/[[\]{}]/,vl={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let bl,xl;function _l(e,t,n){return bl=t||"view",xl=n||vl,kl(e.trim()).map(Al)}function wl(e,t,n,r,i){const o=e.length;let a,s=0;for(;t=0?--s:r&&r.indexOf(a)>=0&&++s}return t}function kl(e){const t=[],n=e.length;let r=0,i=0;for(;i' after between selector: "+e;n=n.map(Al);const i=Al(e.slice(1).trim());return i.between?{between:n,stream:i}:(i.between=n,i)}(e):function(e){const t={source:bl},n=[];let r,i,o=[0,0],a=0,s=0,u=e.length,l=0;if(e[u-1]===dl){if(l=e.lastIndexOf(fl),!(l>=0))throw"Unmatched right brace: "+e;try{o=function(e){const t=e.split(pl);if(!e.length||t.length>2)throw e;return t.map((t=>{const n=+t;if(n!=n)throw e;return n}))}(e.substring(l+1,u-1))}catch(t){throw"Invalid throttle specification: "+e}u=(e=e.slice(0,l).trim()).length,l=0}if(!u)throw e;if(e[0]===gl&&(a=++l),r=wl(e,l,hl),r1?(t.type=n[1],a?t.markname=n[0].slice(1):function(e){return xl[e]}(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],"!"===t.type.slice(-1)&&(t.consume=!0,t.type=t.type.slice(0,-1)),null!=i&&(t.filter=i),o[0]&&(t.throttle=o[0]),o[1]&&(t.debounce=o[1]),t}(e)}function El(e,t,n,r){const i=$o(t)&&t.condition,o=r(t);if(i){const t=v(i).map((t=>{const n=r(t),i=function(e){return e.selection}(t)?Od(e,t.selection):Cd(e,t.test);return Object.assign({test:i},n)}));return{[n]:[...t,...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function Ol(e,t="text"){const n=e.encoding[t];return El(e,n,t,(t=>Dl(t,e.config)))}function Dl(e,t,n="datum"){if(e){if(qo(e))return ka(e.value);if(Io(e)){const{format:r,formatType:i}=ia(e);return lo({fieldOrDatumDef:e,format:r,formatType:i,expr:n,config:t})}}}function Cl(e,t={}){const{encoding:n,markDef:r,config:i,stack:o}=e,a=n.tooltip;if(d(a))return{tooltip:Fl({tooltip:a},o,i,t)};{const s=t.reactiveGeom?"datum.datum":"datum";return El(e,a,"tooltip",(e=>{const a=Dl(e,i,s);if(a)return a;if(null===e)return;let u=Da("tooltip",r,i);return!0===u&&(u={content:"encoding"}),k(u)?{value:u}:h(u)?Fr(u)?u:"encoding"===u.content?Fl(n,o,i,t):{signal:s}:void 0}))}}function Sl(e,t,n,{reactiveGeom:r}={}){const i={},o=r?"datum.datum":"datum",a=[];function s(r,s){const u=Wt(s),l=Uo(r)?r:Object.assign(Object.assign({},r),{type:e[u].type}),c=v(l.title||ra(l,n)).join(", ");let f;if(fn(s)){const r="x"===s?"x2":"y2",a=oa(e[r]);if(Nn(l.bin)&&a){const e=Xo(l,{expr:o}),t=Xo(a,{expr:o}),{format:s,formatType:u}=ia(l);f=vo(e,t,s,u,n),i[r]=!0}else if(t&&t.fieldChannel===s&&"normalize"===t.offset){const{format:e,formatType:t}=ia(l);f=lo({fieldOrDatumDef:l,format:e,formatType:t,expr:o,config:n,normalizeStack:!0}).signal}}f=null!=f?f:Dl(l,n,o).signal,a.push({channel:s,key:c,value:f})}qa(e,((e,t)=>{To(e)?s(e,t):No(e)&&s(e.condition,t)}));const u={};for(const{channel:e,key:t,value:n}of a)i[e]||u[t]||(u[t]=n);return u}function Fl(e,t,n,{reactiveGeom:r}={}){const i=Sl(e,t,n,{reactiveGeom:r}),o=ie(i).map((([e,t])=>`"${e}": ${t}`));return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function Ml(e,t,n={}){const{markDef:r,encoding:i,config:o}=t,{vgChannel:a}=n;let{defaultRef:s,defaultValue:u}=n;void 0===s&&(u=null!=u?u:Da(e,r,o,{vgChannel:a,ignoreVgConfig:!0}),void 0!==u&&(s=ka(u)));const l=i[e];return El(t,l,null!=a?a:e,(n=>io({channel:e,channelDef:n,markDef:r,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:s})))}function jl(e,t={filled:void 0}){var n,r,i,o;const{markDef:a,encoding:s,config:u}=e,{type:l}=a,c=null!==(n=t.filled)&&void 0!==n?n:Da("filled",a,u),f=W(["bar","point","circle","square","geoshape"],l)?"transparent":void 0,d=null!==(i=null!==(r=Da(!0===c?"color":void 0,a,u,{vgChannel:"fill"}))&&void 0!==r?r:u.mark[!0===c&&"color"])&&void 0!==i?i:f,h=null!==(o=Da(!1===c?"color":void 0,a,u,{vgChannel:"stroke"}))&&void 0!==o?o:u.mark[!1===c&&"color"],p=c?"fill":"stroke",g=Object.assign(Object.assign({},d?{fill:ka(d)}:{}),h?{stroke:ka(h)}:{});return a.color&&(c?a.fill:a.stroke)&&hr(Jn("property",{fill:"fill"in a,stroke:"stroke"in a})),Object.assign(Object.assign(Object.assign(Object.assign({},g),Ml("color",e,{vgChannel:p,defaultValue:c?d:h})),Ml("fill",e,{defaultValue:s.fill?d:void 0})),Ml("stroke",e,{defaultValue:s.stroke?h:void 0}))}function $l(e,t){const n=function(e){switch(e){case Ge:return"xOffset";case Ve:return"yOffset";case Ye:return"x2Offset";case Xe:return"y2Offset";case Ke:return"thetaOffset";case Ze:return"radiusOffset";case Qe:return"theta2Offset";case Je:return"radius2Offset"}}(e),r=t[n];if(r)return r}function Nl(e,t,{defaultPos:n,vgChannel:r,isMidPoint:i}){const{encoding:o,markDef:a,config:s,stack:u}=t,l=o[e],c=o[Gt(e)],f=t.scaleName(e),d=t.getScaleComponent(e),h=$l(e,a),p=Bl({model:t,defaultPos:n,channel:e,scaleName:f,scale:d}),g=!l&&fn(e)&&(o.latitude||o.longitude)?{field:t.getName(e)}:function(e){const{channel:t,channelDef:n,isMidPoint:r,scaleName:i,stack:o,offset:a,markDef:s,config:u}=e;if(Io(n)&&o&&t===o.fieldChannel){if(To(n)){const e=Mo({channel:t,fieldDef:n,isMidPoint:r,markDef:s,stack:o,config:u});if(void 0!==e)return ro({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",band:e,offset:a})}return no(n,i,{suffix:"end"},{offset:a})}return Ki(e)}({channel:e,channelDef:l,channel2Def:c,markDef:a,config:s,isMidPoint:i,scaleName:f,scale:d,stack:u,offset:h,defaultRef:p});return g?{[r||e]:g}:void 0}function Bl({model:e,defaultPos:t,channel:n,scaleName:r,scale:i}){const{markDef:o,config:a}=e;return()=>{const s=Wt(n),u=Ht(n),l=Da(n,o,a,{vgChannel:u});if(void 0!==l)return oo(n,l);switch(t){case"zeroOrMin":case"zeroOrMax":if(r){const e=i.get("type");if(W([ei.LOG,ei.TIME,ei.UTC],e));else if(i.domainDefinitelyIncludesZero())return{scale:r,value:0}}if("zeroOrMin"===t)return"y"===s?{field:{group:"height"}}:{value:0};switch(s){case"radius":return{signal:`min(${e.width.signal},${e.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":{const t=e[Vt(n)];return Object.assign(Object.assign({},t),{mult:.5})}}}}const Tl={left:"x",center:"xc",right:"x2"},zl={top:"y",middle:"yc",bottom:"y2"};function Rl(e,t,n,r="middle"){if("radius"===e||"theta"===e)return Ht(e);const i="x"===e?"align":"baseline",o=Da(i,t,n);let a;return Fr(o)?(hr(function(e){return`The ${e} for range marks cannot be an expression`}(i)),a=void 0):a=o,"x"===e?Tl[a||("top"===r?"left":"center")]:zl[a||r]}function Pl(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?Ll(e,t,{defaultPos:n,defaultPos2:r}):Nl(e,t,{defaultPos:n})}function Ll(e,t,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=t,a=Gt(e),s=Vt(e),u=function(e,t,n){const{encoding:r,mark:i,markDef:o,stack:a,config:s}=e,u=Wt(n),l=Vt(n),c=Ht(n),f=r[u],d=e.scaleName(u),h=e.getScaleComponent(u),p=$l(n in r||n in o?n:u,e.markDef);if(!f&&("x2"===n||"y2"===n)&&(r.latitude||r.longitude))return{[c]:{field:e.getName(n)}};const g=function({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:o,scale:a,stack:s,offset:u,defaultRef:l}){return Io(t)&&s&&e.charAt(0)===s.fieldChannel.charAt(0)?no(t,o,{suffix:"start"},{offset:u}):Ki({channel:e,channelDef:n,scaleName:o,scale:a,stack:s,markDef:r,config:i,offset:u,defaultRef:l})}({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:s,scaleName:d,scale:h,stack:a,offset:p,defaultRef:void 0});return void 0!==g?{[c]:g}:Il(n,o)||Il(n,{[n]:Sa(n,o,s.style),[l]:Sa(l,o,s.style)})||Il(n,s[i])||Il(n,s.mark)||{[c]:Bl({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}(t,r,a),l=u[s]?Rl(e,i,o):Ht(e);return Object.assign(Object.assign({},Nl(e,t,{defaultPos:n,vgChannel:l})),u)}function Il(e,t){const n=Vt(e),r=Ht(e);return void 0!==t[r]?{[r]:oo(e,t[r])}:void 0!==t[e]?{[r]:oo(e,t[e])}:t[n]?{[n]:oo(e,t[n])}:void 0}function Ul(e,t,n){var r,i,o,a;const{config:s,encoding:u,markDef:l,stack:c}=e,f=Gt(t),h=Vt(t),p=u[t],g=u[f],m=e.getScaleComponent(t),y=m?m.get("type"):void 0,v=e.scaleName(t),b=l.orient,x=null!==(i=null!==(r=u[h])&&void 0!==r?r:u.size)&&void 0!==i?i:Da("size",l,s,{vgChannel:h}),_="bar"===n&&("x"===t?"vertical"===b:"horizontal"===b);if(To(p)&&($n(p.bin)||Nn(p.bin)||p.timeUnit&&!g)&&!x&&!fi(y)){const n=Mo({channel:t,fieldDef:p,stack:c,markDef:l,config:s}),r=null===(o=e.component.axes[t])||void 0===o?void 0:o[0];return function({fieldDef:e,fieldDef2:t,channel:n,band:r,scaleName:i,markDef:o,spacing:a=0,axisTranslate:s,reverse:u,config:l}){const c=Gt(n),f=Ht(n),d=Ht(c),h=$l(n,o);if($n(e.bin)||e.timeUnit)return{[d]:Hl({channel:n,fieldDef:e,scaleName:i,markDef:o,band:(1-r)/2,offset:Wl(c,a,u,s,h),config:l}),[f]:Hl({channel:n,fieldDef:e,scaleName:i,markDef:o,band:1-(1-r)/2,offset:Wl(n,a,u,s,h),config:l})};if(Nn(e.bin)){const r=no(e,i,{},{offset:Wl(c,a,u,s,h)});if(To(t))return{[d]:r,[f]:no(t,i,{},{offset:Wl(n,a,u,s,h)})};if(Bn(e.bin)&&e.bin.step)return{[d]:r,[f]:{signal:`scale("${i}", ${Xo(e,{expr:"datum"})} + ${e.bin.step})`,offset:Wl(n,a,u,s,h)}}}hr(cr(c))}({fieldDef:p,fieldDef2:g,channel:t,markDef:l,scaleName:v,band:n,axisTranslate:null!==(a=null==r?void 0:r.get("translate"))&&void 0!==a?a:.5,spacing:fn(t)?Da("binSpacing",l,s):void 0,reverse:m.get("reverse"),config:s})}return(Io(p)&&fi(y)||_)&&!g?function(e,t,n,r){var i;const{markDef:o,encoding:a,config:s,stack:u}=r,l=o.orient,c=r.scaleName(n),f=r.getScaleComponent(n),h=Vt(n),p=Gt(n),g="horizontal"===l&&"y"===n||"vertical"===l&&"x"===n,m=Da(g?"size":h,o,s,{vgChannel:h});let y;(a.size||void 0!==m)&&(g?y=Ml("size",r,{vgChannel:h,defaultValue:m}):hr(function(e){return`Cannot apply size to non-oriented mark "${e}".`}(o.type)));const v=null!==(i=Io(t)?Mo({channel:n,fieldDef:t,markDef:o,stack:u,config:s}):void 0)&&void 0!==i?i:1;y=y||{[h]:ql(e,h,c,f,s,v)};const b="band"!==(null==f?void 0:f.get("type"))||!("band"in y[h]),x=Rl(n,o,s,b?"middle":"top"),_=$l(n,o),w=Ki({channel:n,channelDef:t,markDef:o,config:s,scaleName:c,scale:f,stack:u,offset:_,defaultRef:Bl({model:r,defaultPos:"mid",channel:n,scaleName:c,scale:f}),band:b?.5:(1-v)/2});if(h)return Object.assign({[x]:w},y);{const e=Ht(p),t=y[h],n=_?Object.assign(Object.assign({},t),{offset:_}):t;return{[x]:w,[e]:d(w)?[w[0],Object.assign(Object.assign({},w[1]),{offset:n})]:Object.assign(Object.assign({},w),{offset:n})}}}(n,p,t,e):Ll(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function ql(e,t,n,r,i,o){if(r){const t=r.get("type");if("point"===t||"band"===t){if(void 0!==i[e].discreteBandSize)return{value:i[e].discreteBandSize};if(t===ei.POINT){const e=r.get("range");return Mr(e)&&w(e.step)?{value:e.step-2}:{value:Ls-2}}return{scale:n,band:o}}return{value:i[e].continuousBandSize}}const a=Rs(i.view,t),s=ye(i[e].discreteBandSize,a-2);return void 0!==s?{value:s}:void 0}function Wl(e,t,n,r,i){if(At(e))return 0;const o="x"===e||"y2"===e?-t/2:t/2;if(Fr(n)||Fr(i)||Fr(r)){const e=Ea(n),t=Ea(i),a=Ea(r);return{signal:(a?`${a} + `:"")+(e?`(${e} ? -1 : 1) * `:"")+(t?`(${t} + ${o})`:o)}}return i=i||0,r+(n?-i-o:+i+o)}function Hl({channel:e,fieldDef:t,scaleName:n,markDef:r,band:i,offset:o,config:a}){return Qi({fieldDef:t,channel:e,markDef:r,ref:ro({scaleName:n,fieldOrDatumDef:t,band:i,offset:o}),config:a})}const Gl=new Set(["aria"]);function Vl(e,t){const{fill:n,stroke:r}="include"===t.color?jl(e):{};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},function(e,t){return $r.reduce(((n,r)=>(Gl.has(r)||void 0===e[r]||"ignore"===t[r]||(n[r]=ka(e[r])),n)),{})}(e.markDef,t)),Yl(e,"fill",n)),Yl(e,"stroke",r)),Ml("opacity",e)),Ml("fillOpacity",e)),Ml("strokeOpacity",e)),Ml("strokeWidth",e)),Ml("strokeDash",e)),function(e){const{encoding:t,mark:n}=e,r=t.order;return!Wi(n)&&qo(r)?El(e,r,"zindex",(e=>ka(e.value))):{}}(e)),Cl(e)),Ol(e,"href")),function(e){const{markDef:t,config:n}=e,r=Da("aria",t,n);return!1===r?{}:Object.assign(Object.assign(Object.assign({},r?{aria:r}:{}),function(e){const{mark:t,markDef:n,config:r}=e;if(!1===r.aria)return{};const i=Da("ariaRoleDescription",n,r);return null!=i?{ariaRoleDescription:{value:i}}:t in Nr?{}:{ariaRoleDescription:{value:t}}}(e)),function(e){const{encoding:t,markDef:n,config:r,stack:i}=e,o=t.description;if(o)return El(e,o,"description",(t=>Dl(t,e.config)));const a=Da("description",n,r);if(null!=a)return{description:ka(a)};if(!1===r.aria)return{};const s=Sl(t,i,r);return te(s)?void 0:{description:{signal:ie(s).map((([e,t],n)=>`"${n>0?"; ":""}${e}: " + (${t})`)).join(" + ")}}}(e))}(e))}function Yl(e,t,n){const{config:r,mark:i,markDef:o}=e;if("hide"===Da("invalid",o,r)&&n&&!Wi(i)){const r=function(e,{invalid:t=!1,channels:n}){const r=n.reduce(((t,n)=>{const r=e.getScaleComponent(n);if(r){const i=r.get("type"),o=e.vgField(n,{expr:"datum"});o&&di(i)&&(t[o]=!0)}return t}),{}),i=ne(r);if(i.length>0){const e=t?"||":"&&";return i.map((e=>to(e,t))).join(` ${e} `)}}(e,{invalid:!0,channels:On});if(r)return{[t]:[{test:r,value:null},...v(n)]}}return n?{[t]:n}:{}}function Xl(e){const{config:t,markDef:n}=e;if(Da("invalid",n,t)){const t=function(e,{invalid:t=!1,channels:n}){const r=n.reduce(((t,n)=>{const r=e.getScaleComponent(n);if(r){const i=r.get("type"),o=e.vgField(n,{expr:"datum"});o&&di(i)&&(t[o]=!0)}return t}),{}),i=ne(r);if(i.length>0){const e=t?"||":"&&";return i.map((e=>to(e,t))).join(` ${e} `)}}(e,{channels:cn});if(t)return{defined:{signal:t}}}return{}}function Zl(e,t){if(void 0!==t)return{[e]:ka(t)}}const Jl="voronoi",Kl={has:e=>"interval"!==e.type&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(Jl)},marks:(e,t,n)=>{const{x:r,y:i}=t.project.hasChannel,o=e.mark;if(Wi(o))return hr(`The "nearest" transform is not supported for ${o} marks.`),n;const a={name:e.getName(Jl),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:Object.assign({fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0}},Cl(e,{reactiveGeom:!0}))},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let s=0,u=!1;return n.forEach(((t,n)=>{var r;const i=null!==(r=t.name)&&void 0!==r?r:"";i===e.component.mark[0].name?s=n:i.indexOf(Jl)>=0&&(u=!0)})),u||n.splice(s+1,0,a),n}},Ql=Kl;class ec{constructor(e,t){this.debugName=t,this._children=[],this._parent=null,e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e,e&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,t){this._children.indexOf(e)>-1?hr("Attempt to add the same child twice."):void 0!==t?this._children.splice(t,0,e):this._children.push(e)}removeChild(e){const t=this._children.indexOf(e);return this._children.splice(t,1),t}remove(){let e=this._parent.removeChild(this);for(const t of this._children)t._parent=this._parent,this._parent.addChild(t,e++)}insertAsParentOf(e){const t=e.parent;t.removeChild(this),this.parent=t,e.parent=this}swapWithParent(){const e=this._parent,t=e.parent;for(const t of this._children)t.parent=e;this._children=[],e.removeChild(this),e.parent.removeChild(e),this.parent=t,e.parent=this}}class tc extends ec{constructor(e,t,n,r){super(e,t),this.type=n,this.refCounts=r,this._source=this._name=t,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}clone(){const e=new this.constructor;return e.debugName="clone_"+this.debugName,e._source=this._source,e._name="clone_"+this._name,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}dependentFields(){return new Set}producedFields(){return new Set}hash(){return void 0===this._hash&&(this._hash=`Output ${be()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}var nc=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{field:i,timeUnit:o}=n,a=Zp(t)?t.encoding[Gt(r)]:void 0,s=Zp(t)&&jo(r,n,a,t.stack,t.markDef,t.config);if(o){const t=Xo(n,{forAs:!0});e[U({as:t,field:i,timeUnit:o})]=Object.assign({as:t,field:i,timeUnit:o},s?{band:!0}:{})}return e}),{});return te(n)?null:new rc(e,n)}static makeFromTransform(e,t){const n=Object.assign({},t),{timeUnit:r}=n,i=nc(n,["timeUnit"]),o=Sr(r),a=Object.assign(Object.assign({},i),{timeUnit:o});return new rc(e,{[U(a)]:a})}merge(e){this.formula=Object.assign({},this.formula);for(const t in e.formula)this.formula[t]&&!e.formula[t].band||(this.formula[t]=e.formula[t]);for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}removeFormulas(e){const t={};for(const[n,r]of ie(this.formula))e.has(r.as)||(t[n]=r);this.formula=t}producedFields(){return new Set(re(this.formula).map((e=>e.as)))}dependentFields(){return new Set(re(this.formula).map((e=>e.field)))}hash(){return`TimeUnit ${U(this.formula)}`}assemble(){const e=[];for(const t of re(this.formula)){const{field:n,as:r,timeUnit:i}=t,o=Sr(i),{unit:a,utc:s}=o,u=nc(o,["unit","utc"]);e.push(Object.assign(Object.assign(Object.assign(Object.assign({field:he(n),type:"timeunit"},a?{units:Or(a)}:{}),s?{timezone:"utc"}:{}),u),{as:[r,`${r}_end`]}))}return e}}const ic="_tuple_fields";class oc{constructor(...e){this.items=e,this.hasChannel={},this.hasField={}}}const ac={has:()=>!0,parse:(e,t,n)=>{var r,i,o;const a=t.name,s=null!==(r=t.project)&&void 0!==r?r:t.project=new oc,u={},l={},c=new Set,f=(e,t)=>{const n="visual"===t?e.channel:e.field;let r=ae(`${a}_${n}`);for(let e=1;c.has(r);e++)r=ae(`${a}_${n}_${e}`);return c.add(r),{[t]:r}};if(!n.fields&&!n.encodings){const t=e.config.selection[n.type];if(n.init)for(const e of v(n.init))for(const r of ne(e))Lt[r]?(n.encodings||(n.encodings=[])).push(r):"interval"===n.type?(hr('Interval selections should be initialized using "x" and/or "y" keys.'),n.encodings=t.encodings):(n.fields||(n.fields=[])).push(r);else n.encodings=t.encodings,n.fields=t.fields}for(const e of null!==(i=n.fields)&&void 0!==i?i:[]){const t={type:"E",field:e};t.signals=Object.assign({},f(t,"data")),s.items.push(t),s.hasField[e]=t}for(const r of null!==(o=n.encodings)&&void 0!==o?o:[]){const n=e.fieldDef(r);if(n){let i=n.field;if(n.aggregate){hr(Hn(r,n.aggregate));continue}if(!i){hr(Wn(r));continue}if(n.timeUnit){i=e.vgField(r);const t={timeUnit:n.timeUnit,as:i,field:n.field};l[U(t)]=t}if(!u[i]){let o="E";"interval"===t.type?di(e.getScaleComponent(r).get("type"))&&(o="R"):n.bin&&(o="R-RE");const a={field:i,channel:r,type:o};a.signals=Object.assign(Object.assign({},f(a,"data")),f(a,"visual")),s.items.push(u[i]=a),s.hasField[i]=s.hasChannel[r]=u[i]}}else hr(Wn(r))}if(n.init){const e=e=>s.items.map((t=>void 0!==e[t.channel]?e[t.channel]:e[t.field]));if("interval"===n.type)t.init=e(n.init);else{const r=v(n.init);t.init=r.map(e)}}te(l)||(s.timeUnit=new rc(null,l))},signals:(e,t,n)=>{const r=t.name+ic;return n.filter((e=>e.name===r)).length>0?n:n.concat({name:r,value:t.project.items.map((e=>{const{signals:t,hasLegend:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i"single"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind&&!Cs(e.bind),parse:(e,t,n,r)=>{r.on||delete t.events,r.clear||delete t.clear},topLevelSignals:(e,t,n)=>{const r=t.name,i=t.project,o=t.bind,a=t.init&&t.init[0],s=Ql.has(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach(((e,i)=>{var u,l;const c=ae(`${r}_${e.field}`);n.filter((e=>e.name===c)).length||n.unshift(Object.assign(Object.assign({name:c},a?{init:Oc(a[i])}:{value:null}),{on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${s}[${A(e.field)}] : null`}]:[],bind:null!==(l=null!==(u=o[e.field])&&void 0!==u?u:o[e.channel])&&void 0!==l?l:o}))})),n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.filter((e=>e.name===r+zc))[0],a=r+ic,s=i.items.map((e=>ae(`${r}_${e.field}`))),u=s.map((e=>`${e} !== null`)).join(" && ");return s.length&&(o.update=`${u} ? {fields: ${a}, values: [${s.join(", ")}]} : null`),delete o.value,delete o.on,n}},uc="_toggle",lc={has:e=>"multi"===e.type&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+uc,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+zc,r=t.name+uc;return`${r} ? null : ${n}, `+("global"===t.resolve?`${r} ? null : true, `:`${r} ? null : {unit: ${Ic(e)}}, `)+`${r} ? ${n} : null`}},cc={has:e=>void 0!==e.clear&&!1!==e.clear,parse:(e,t,n)=>{n.clear&&(t.clear=k(n.clear)?_l(n.clear,"scope"):n.clear)},topLevelSignals:(e,t,n)=>{if(sc.has(t))for(const e of t.project.items){const r=n.findIndex((n=>n.name===ae(`${t.name}_${e.field}`)));-1!==r&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function r(e,r){-1!==e&&n[e].on&&n[e].on.push({events:t.clear,update:r})}if("interval"===t.type)for(const e of t.project.items){const t=n.findIndex((t=>t.name===e.signals.visual));r(t,"[0, 0]"),-1===t&&r(n.findIndex((t=>t.name===e.signals.data)),"null")}else{let e=n.findIndex((e=>e.name===t.name+zc));r(e,"null"),lc.has(t)&&(e=n.findIndex((e=>e.name===t.name+uc)),r(e,"false"))}return n}},fc={has:e=>"interval"===e.type&&"global"===e.resolve&&e.bind&&"scales"===e.bind,parse:(e,t)=>{const n=t.scales=[];for(const r of t.project.items){const i=r.channel;if(!Dn(i))continue;const o=e.getScaleComponent(i),a=o?o.get("type"):void 0;if(!o||!di(a)){hr("Scale bindings are currently only supported for scales with unbinned, continuous domains.");continue}const s={selection:t.name,field:r.field};o.set("selectionExtent",s,!0),n.push(r)}},topLevelSignals:(e,t,n)=>{const r=t.scales.filter((e=>0===n.filter((t=>t.name===e.signals.data)).length));if(!e.parent||pc(e)||0===r.length)return n;const i=n.filter((e=>e.name===t.name))[0];let o=i.update;if(o.indexOf(Rc)>=0)i.update=`{${r.map((e=>`${A(e.field)}: ${e.signals.data}`)).join(", ")}}`;else{for(const e of r){const t=`${A(e.field)}: ${e.signals.data}`;o.indexOf(t)<0&&(o=`${o.substring(0,o.length-1)}, ${t}}`)}i.update=o}return n.concat(r.map((e=>({name:e.signals.data}))))},signals:(e,t,n)=>{if(e.parent&&!pc(e))for(const e of t.scales){const t=n.filter((t=>t.name===e.signals.data))[0];t.push="outer",delete t.value,delete t.update}return n}},dc=fc;function hc(e,t){return`domain(${A(e.scaleName(t))})`}function pc(e){var t;return e.parent&&Qp(e.parent)&&(null!==(t=!e.parent.parent)&&void 0!==t?t:pc(e.parent.parent))}const gc={has:e=>{const t="global"===e.resolve&&e.bind&&Cs(e.bind),n=1===e.project.items.length&&e.project.items[0].field!==Os;return t&&!n&&hr("Legend bindings are only supported for selections over an individual field or encoding channel."),t&&n},parse:(e,t,n,r)=>{var i;if(r.on||delete t.events,r.clear||delete t.clear,r.on||r.clear){const e='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of t.events)n.filter=v(null!==(i=n.filter)&&void 0!==i?i:[]),n.filter.indexOf(e)<0&&n.filter.push(e)}const o=Ss(t.bind)?t.bind.legend:"click",a=k(o)?_l(o,"view"):v(o);t.bind={legend:{merge:a}}},topLevelSignals:(e,t,n)=>{const r=t.name,i=Ss(t.bind)&&t.bind.legend,o=e=>t=>{const n=R(t);return n.markname=e,n};for(const e of t.project.items){if(!e.hasLegend)continue;const a=`${ae(e.field)}_legend`,s=`${r}_${a}`;if(0===n.filter((e=>e.name===s)).length){const e=i.merge.map(o(`${a}_symbols`)).concat(i.merge.map(o(`${a}_labels`))).concat(i.merge.map(o(`${a}_entries`)));n.unshift(Object.assign(Object.assign({name:s},t.init?{}:{value:null}),{on:[{events:e,update:"datum.value || item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${s}`,force:!0}]}))}}return n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.find((e=>e.name===r+zc)),a=r+ic,s=i.items.filter((e=>e.hasLegend)).map((e=>ae(`${r}_${ae(e.field)}_legend`))),u=`${s.map((e=>`${e} !== null`)).join(" && ")} ? {fields: ${a}, values: [${s.join(", ")}]} : null`;t.events&&s.length>0?o.on.push({events:s.map((e=>({signal:e}))),update:u}):s.length>0&&(o.update=u,delete o.value,delete o.on);const l=n.find((e=>e.name===r+uc)),c=Ss(t.bind)&&t.bind.legend;return l&&(t.events?l.on.push(Object.assign(Object.assign({},l.on[0]),{events:c})):l.on[0].events=c),n}},mc="_translate_anchor",yc="_translate_delta",vc={has:e=>"interval"===e.type&&e.translate,signals:(e,t,n)=>{const r=t.name,i=dc.has(t),o=r+mc,{x:a,y:s}=t.project.hasChannel;let u=_l(t.translate,"scope");return i||(u=u.map((e=>(e.between[0].markname=r+Sc,e)))),n.push({name:o,value:{},on:[{events:u.map((e=>e.between[0])),update:"{x: x(unit), y: y(unit)"+(void 0!==a?", extent_x: "+(i?hc(e,Ge):`slice(${a.signals.visual})`):"")+(void 0!==s?", extent_y: "+(i?hc(e,Ve):`slice(${s.signals.visual})`):"")+"}"}]},{name:r+yc,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==a&&bc(e,t,a,"width",n),void 0!==s&&bc(e,t,s,"height",n),n}};function bc(e,t,n,r,i){var o;const a=t.name,s=a+mc,u=a+yc,l=n.channel,c=dc.has(t),f=i.filter((e=>e.name===n.signals[c?"data":"visual"]))[0],d=e.getSizeSignalRef(r).signal,h=e.getScaleComponent(l),p=h.get("type"),g=`${s}.extent_${l}`,m=`${c?"log"===p?"panLog":"pow"===p?"panPow":"panLinear":"panLinear"}(${g}, ${`${c&&l===Ge?"-":""}${u}.${l} / `+(c?`${d}`:`span(${g})`)}`+(c&&"pow"===p?`, ${null!==(o=h.get("exponent"))&&void 0!==o?o:1}`:"")+")";f.on.push({events:{signal:u},update:c?m:`clampRange(${m}, 0, ${d})`})}const xc="_zoom_anchor",_c="_zoom_delta",wc={has:e=>"interval"===e.type&&e.zoom,signals:(e,t,n)=>{const r=t.name,i=dc.has(t),o=r+_c,{x:a,y:s}=t.project.hasChannel,u=A(e.scaleName(Ge)),l=A(e.scaleName(Ve));let c=_l(t.zoom,"scope");return i||(c=c.map((e=>(e.markname=r+Sc,e)))),n.push({name:r+xc,on:[{events:c,update:i?"{"+[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter((e=>!!e)).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==a&&kc(e,t,a,"width",n),void 0!==s&&kc(e,t,s,"height",n),n}};function kc(e,t,n,r,i){var o;const a=t.name,s=n.channel,u=dc.has(t),l=i.filter((e=>e.name===n.signals[u?"data":"visual"]))[0],c=e.getSizeSignalRef(r).signal,f=e.getScaleComponent(s),d=f.get("type"),h=u?hc(e,s):l.name,p=a+_c,g=`${u?"log"===d?"zoomLog":"pow"===d?"zoomPow":"zoomLinear":"zoomLinear"}(${h}, ${a}${xc}.${s}, ${p}`+(u&&"pow"===d?`, ${null!==(o=f.get("exponent"))&&void 0!==o?o:1}`:"")+")";l.on.push({events:{signal:p},update:u?g:`clampRange(${g}, 0, ${c})`})}const Ac=[ac,lc,dc,gc,vc,wc,sc,Ql,cc];function Ec(e,t){for(const n of Ac)n.has(e)&&t(n)}function Oc(e,t=!0,n=c){if(d(e)){const r=e.map((e=>Oc(e,t,n)));return t?`[${r.join(", ")}]`:r}return pr(e)?n(t?xr(e):function(e){const t=br(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}(e)):t?n(JSON.stringify(e)):e}function Dc(e,t){return Lc(e,((n,r)=>{t=r.marks?r.marks(e,n,t):t,Ec(n,(r=>{r.marks&&(t=r.marks(e,n,t))}))})),t}function Cc(e){return e.map((e=>(e.on&&!e.on.length&&delete e.on,e)))}const Sc="_brush",Fc="_scale_trigger",Mc={signals:(e,t)=>{const n=t.name,r=n+ic,i=dc.has(t),o=[],a=[],s=[];if(t.translate&&!i){const e=`!event.item || event.item.mark.name !== ${A(n+Sc)}`;jc(t,((t,n)=>{var r;const i=v(null!==(r=n.between[0].filter)&&void 0!==r?r:n.between[0].filter=[]);return i.indexOf(e)<0&&i.push(e),t}))}t.project.items.forEach(((n,r)=>{const i=n.channel;if(i!==Ge&&i!==Ve)return void hr("Interval selections only support x and y encoding channels.");const u=t.init?t.init[r]:null,l=function(e,t,n,r){const i=n.channel,o=n.signals.visual,a=n.signals.data,s=dc.has(t),u=A(e.scaleName(i)),l=e.getScaleComponent(i),c=l?l.get("type"):void 0,f=e=>`scale(${u}, ${e})`,d=e.getSizeSignalRef(i===Ge?"width":"height").signal,h=`${i}(unit)`,p=jc(t,((e,t)=>[...e,{events:t.between[0],update:`[${h}, ${h}]`},{events:t,update:`[${o}[0], clamp(${h}, 0, ${d})]`}]));return p.push({events:{signal:t.name+Fc},update:di(c)?`[${f(`${a}[0]`)}, ${f(`${a}[1]`)}]`:"[0, 0]"}),s?[{name:a,on:[]}]:[Object.assign(Object.assign({name:o},r?{init:Oc(r,!0,f)}:{value:[]}),{on:p}),Object.assign(Object.assign({name:a},r?{init:Oc(r)}:{}),{on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${u}, ${o})`}]})]}(e,t,n,u),c=n.signals.data,f=n.signals.visual,d=A(e.scaleName(i)),h=di(e.getScaleComponent(i).get("type"))?"+":"";o.push(...l),a.push(c),s.push({scaleName:e.scaleName(i),expr:`(!isArray(${c}) || (${h}invert(${d}, ${f})[0] === ${h}${c}[0] && ${h}invert(${d}, ${f})[1] === ${h}${c}[1]))`})})),i||o.push({name:n+Fc,value:{},on:[{events:s.map((e=>({scale:e.scaleName}))),update:s.map((e=>e.expr)).join(" && ")+` ? ${n+Fc} : {}`}]});const u=t.init,l=`unit: ${Ic(e)}, fields: ${r}, values`;return o.concat(Object.assign(Object.assign({name:n+zc},u?{init:`{${l}: ${Oc(u)}}`}:{}),{on:[{events:[{signal:a.join(" || ")}],update:a.join(" && ")+` ? {${l}: [${a}]} : null`}]}))},modifyExpr:(e,t)=>t.name+zc+", "+("global"===t.resolve?"true":`{unit: ${Ic(e)}}`),marks:(e,t,n)=>{const r=t.name,{x:i,y:o}=t.project.hasChannel,a=i&&i.signals.visual,s=o&&o.signals.visual,u=`data(${A(t.name+Tc)})`;if(dc.has(t))return n;const l={x:void 0!==i?{signal:`${a}[0]`}:{value:0},y:void 0!==o?{signal:`${s}[0]`}:{value:0},x2:void 0!==i?{signal:`${a}[1]`}:{field:{group:"width"}},y2:void 0!==o?{signal:`${s}[1]`}:{field:{group:"height"}}};if("global"===t.resolve)for(const t of ne(l))l[t]=[Object.assign({test:`${u}.length && ${u}[0].unit === ${Ic(e)}`},l[t]),{value:0}];const c=t.mark,{fill:f,fillOpacity:d,cursor:h}=c,p=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i(e[t]=[{test:[void 0!==i&&`${a}[0] !== ${a}[1]`,void 0!==o&&`${s}[0] !== ${s}[1]`].filter((e=>e)).join(" && "),value:p[t]},{value:null}],e)),{});return[{name:r+Sc+"_bg",type:"rect",clip:!0,encode:{enter:{fill:{value:f},fillOpacity:{value:d}},update:l}},...n,{name:r+Sc,type:"rect",clip:!0,encode:{enter:Object.assign(Object.assign({},h?{cursor:{value:h}}:{}),{fill:{value:"transparent"}}),update:Object.assign(Object.assign({},l),g)}}]}};function jc(e,t){return e.events.reduce(((e,n)=>n.between?t(e,n):(hr(`${n} is not an ordered event stream for interval selections.`),e)),[])}function $c(e,t){const n=t.name,r=n+ic,i=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=i.items.map((t=>{const n=e.fieldDef(t.channel);return n&&n.bin?`[${o}[${A(e.vgField(t.channel,{}))}], ${o}[${A(e.vgField(t.channel,{binSuffix:"end"}))}]]`:`${o}[${A(t.field)}]`})).join(", "),s=`unit: ${Ic(e)}, fields: ${r}, values`,u=t.events;return[{name:n+zc,on:u?[{events:u,update:`datum && item().mark.marktype !== 'group' ? {${s}: [${a}]} : null`,force:!0}]:[]}]}const Nc={signals:$c,modifyExpr:(e,t)=>t.name+zc+", "+("global"===t.resolve?"null":`{unit: ${Ic(e)}}`)},Bc={signals:$c,modifyExpr:(e,t)=>t.name+zc+", "+("global"===t.resolve?"true":`{unit: ${Ic(e)}}`)},Tc="_store",zc="_tuple",Rc="vlSelectionResolve",Pc={single:Bc,multi:Nc,interval:Mc};function Lc(e,t){const n=e.component.selection;if(n)for(const e of re(n))if(!0===t(e,Pc[e.type]))break}function Ic(e,{escape:t}={escape:!0}){let n=t?A(e.name):e.name;const r=function(e){let t=e.parent;for(;t&&!Jp(t);)t=t.parent;return t}(e);if(r){const{facet:e}=r;for(const t of Ft)e[t]&&(n+=` + '__facet_${t}_' + (facet[${A(r.vgField(t))}])`)}return n}function Uc(e){let t=!1;return Lc(e,(e=>{t=t||e.project.items.some((e=>e.field===Os))})),t}function qc(e,t,n){return e.fields=t||[],e.fname=n,e}function Wc(e){return 1===e.length?Hc(e[0]):Gc(e)}const Hc=e=>function(t){return t[e]},Gc=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),s=r=i+1):"]"===o&&(s||Vc("Access path missing open bracket: "+e),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&Vc("Access path missing closing bracket: "+e),a&&Vc("Access path missing closing quote: "+e),i>r&&(i++,l()),t}(e);e=1===r.length?r[0]:e,qc((n&&n.get||Wc)(r),[e],t||e)})("id"),qc((e=>e),[],"identity"),qc((()=>0),[],"zero"),qc((()=>1),[],"one"),qc((()=>!0),[],"true"),qc((()=>!1),[],"false"),Array.isArray,Object.prototype.hasOwnProperty;function Yc(e){this.type=e}var Xc,Zc,Jc,Kc,Qc;Yc.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=function(e){switch(e.type){case"ArrayExpression":return e.elements;case"BinaryExpression":case"LogicalExpression":return[e.left,e.right];case"CallExpression":return[e.callee].concat(e.arguments);case"ConditionalExpression":return[e.test,e.consequent,e.alternate];case"MemberExpression":return[e.object,e.property];case"ObjectExpression":return e.properties;case"Property":return[e.key,e.value];case"UnaryExpression":return[e.argument];default:return[]}}(this),n=0,r=t.length;n",Xc[nf]="Identifier",Xc[rf]="Keyword",Xc[of]="Null",Xc[af]="Numeric",Xc[sf]="Punctuator",Xc[uf]="String",Xc[9]="RegularExpression";var lf="ArrayExpression",cf="BinaryExpression",ff="CallExpression",df="ConditionalExpression",hf="Identifier",pf="Literal",gf="LogicalExpression",mf="MemberExpression",yf="ObjectExpression",vf="Property",bf="UnaryExpression",xf="Unexpected token %0",_f="Unexpected number",wf="Unexpected string",kf="Unexpected identifier",Af="Unexpected reserved word",Ef="Unexpected end of input",Of="Invalid regular expression",Df="Invalid regular expression: missing /",Cf="Octal literals are not allowed in strict mode.",Sf="Duplicate data property in object literal not allowed in strict mode",Ff="ILLEGAL",Mf="Disabled.",jf=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),$f=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0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\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function Nf(e,t){if(!e)throw new Error("ASSERT: "+t)}function Bf(e){return e>=48&&e<=57}function Tf(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function zf(e){return"01234567".indexOf(e)>=0}function Rf(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function Pf(e){return 10===e||13===e||8232===e||8233===e}function Lf(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&jf.test(String.fromCharCode(e))}function If(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&$f.test(String.fromCharCode(e))}const Uf={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function qf(){for(;Jc1114111||"}"!==e)&&id({},xf,Ff),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),r=56320+(t-65536&1023),String.fromCharCode(n,r))}function Gf(){var e,t;for(e=Zc.charCodeAt(Jc++),t=String.fromCharCode(e),92===e&&(117!==Zc.charCodeAt(Jc)&&id({},xf,Ff),++Jc,(e=Wf("u"))&&"\\"!==e&&Lf(e.charCodeAt(0))||id({},xf,Ff),t=e);Jc>>="===(r=Zc.substr(Jc,4))?{type:sf,value:r,start:i,end:Jc+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:sf,value:n,start:i,end:Jc+=3}:a===(t=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t?{type:sf,value:t,start:i,end:Jc+=2}:("//"===t&&id({},xf,Ff),"<>=!+-*%&|^/".indexOf(a)>=0?(++Jc,{type:sf,value:a,start:i,end:Jc}):void id({},xf,Ff))}function Yf(){var e,t,n;if(Nf(Bf((n=Zc[Jc]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=Jc,e="","."!==n){if(e=Zc[Jc++],n=Zc[Jc],"0"===e){if("x"===n||"X"===n)return++Jc,function(e){let t="";for(;Jc=Kc)return{type:tf,start:Jc,end:Jc};const e=Zc.charCodeAt(Jc);return Lf(e)?(t=Jc,n=92===Zc.charCodeAt(Jc)?Gf():function(){var e,t;for(e=Jc++;Jc=0&&Jc(Nf(t=0&&id({},Of,n),{value:n,literal:t}}(),a=function(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((e,t)=>{if(parseInt(t,16)<=1114111)return"x";id({},Of)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){id({},Of)}try{return new RegExp(e,t)}catch(e){return null}}(i.value,o.value),{literal:i.literal+o.literal,value:a,regex:{pattern:i.value,flags:o.value},start:r,end:Jc})),Jf()):od(Zf())}return n}function hd(){const e=[];if(ad("("),!sd(")"))for(;Jc":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function bd(){var e,t;return e=function(){var e,t,n,r,i,o,a,s,u,l;if(e=Qc,u=yd(),0===(i=vd(r=Qc)))return u;for(r.prec=i,Zf(),t=[e,Qc],o=[u,r,a=yd()];(i=vd(Qc))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),t.pop(),n=Kf(s,u,a),o.push(n);(r=Zf()).prec=i,o.push(r),t.push(Qc),n=yd(),o.push(n)}for(n=o[l=o.length-1],t.pop();l>1;)t.pop(),n=Kf(o[l-1].value,o[l-2],n),l-=2;return n}(),sd("?")&&(Zf(),t=bd(),ad(":"),e=function(e,t,n){const r=new Yc(df);return r.test=e,r.consequent=t,r.alternate=n,r}(e,t,bd())),e}function xd(){const e=bd();if(sd(","))throw new Error(Mf);return e}function _d(e){const t=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(t.push(..._d(e.object)),t.push(..._d(e.property))),t)}function wd(e){return"MemberExpression"===e.object.type?wd(e.object):"datum"===e.object.name}function kd(e){const t=function(e){Jc=0,Kc=(Zc=e).length,Qc=null,Jf();const t=xd();if(Qc.type!==tf)throw new Error("Unexpect token after expression.");return t}(e),n=new Set;return t.visit((e=>{"MemberExpression"===e.type&&wd(e)&&n.add(_d(e).slice(1).join("."))})),n}class Ad extends ec{constructor(e,t,n){super(e),this.model=t,this.filter=n,this.expr=Cd(this.model,this.filter,this),this._dependentFields=kd(this.expr)}clone(){return new Ad(null,this.model,R(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}var Ed=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i`length(data(${e}))`)).join(" || ")+") || ":"")+`(${o})`}function Dd(e,t){const n=t.encoding;let r=t.field;if(n||r){if(n&&!r){const i=e.project.items.filter((e=>e.channel===n));!i.length||i.length>1?(r=e.project.items[0].field,hr((i.length?"Multiple ":"No ")+`matching ${A(n)} encoding found for selection ${A(t.selection)}. `+`Using "field": ${A(r)}.`)):r=i[0].field}}else r=e.project.items[0].field,e.project.items.length>1&&hr(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${A(r)}.`);return`${e.name}[${A(r)}]`}function Cd(e,t,n){return se(t,(t=>k(t)?t:function(e){return null==e?void 0:e.selection}(t)?Od(e,t.selection,n):Hr(t)))}var Sd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const{test:t}=e,n=Sd(e,["test"]);return Object.assign({test:Cd(null,t)},n)})),n]),delete p[e]}else if(null===o){const t={signal:i.map((e=>{const{test:t}=e,n=Sd(e,["test"]);return`${Cd(null,t)} ? ${Aa(n)} : `})).join("")+Aa(n)};p[e]=t}}else if(Fr(r)){const t=Ee[e];if(t){const{vgProp:n,part:i}=t;Fd(p,i,n,r),delete p[e]}}}if("grid"===t){if(!p.grid)return;if(p.encode){const{grid:e}=p.encode;p.encode=Object.assign({},e?{grid:e}:{}),te(p.encode)&&delete p.encode}return Object.assign(Object.assign({scale:l,orient:u},p),{domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:ye(h,0)})}{if(!r.header&&e.mainExtracted)return;if(void 0!==c){let e=c;(null===(o=null===(i=p.encode)||void 0===i?void 0:i.labels)||void 0===o?void 0:o.update)&&Fr(p.encode.labels.update.text)&&(e=pe(c,"datum.label",p.encode.labels.update.text.signal)),Fd(p,"labels","text",{signal:e})}if(null===p.labelAlign&&delete p.labelAlign,p.encode){for(const t of De)e.hasAxisPart(t)||delete p.encode[t];te(p.encode)&&delete p.encode}const t=function(e,t){if(e)return d(e)&&!va(e)?e.map((e=>ra(e,t))).join(", "):e}(f,n);return Object.assign(Object.assign(Object.assign(Object.assign({scale:l,orient:u,grid:!1},t?{title:t}:{}),p),!1===n.aria?{aria:!1}:{}),{zindex:ye(h,0)})}}}function jd(e){const{axes:t}=e.component,n=[];for(const r of cn)if(t[r])for(const i of t[r])if(!i.get("disable")&&!i.get("gridScale")){const t="x"===r?"height":"width",i=e.getSizeSignalRef(t).signal;t!==i&&n.push({name:t,update:i})}return n}function $d(e,t,n,r){return Object.assign.apply(null,[{},...e.map((e=>{if("axisOrient"===e){const e="x"===n?"bottom":"left",i=t["x"===n?"axisBottom":"axisLeft"]||{},o=t["x"===n?"axisTop":"axisRight"]||{},a=new Set([...ne(i),...ne(o)]),s={};for(const t of a.values())s[t]={signal:`${r.signal} === "${e}" ? ${Ea(i[t])} : ${Ea(o[t])}`};return s}return t[e]}))])}function Nd(e,t){var n;const r=[{}];for(const i of e){let e=null===(n=t[i])||void 0===n?void 0:n.style;if(e){e=v(e);for(const n of e)r.push(t.style[n])}}return Object.assign.apply(null,r)}function Bd(e,t,n,r={}){var i;const o=Fa(e,n,t);if(void 0!==o)return{configFrom:"style",configValue:o};for(const t of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(void 0!==(null===(i=r[t])||void 0===i?void 0:i[e]))return{configFrom:t,configValue:r[t][e]};return{}}const Td={scale:({model:e,channel:t})=>e.scaleName(t),format:({fieldOrDatumDef:e,config:t,axis:n})=>{const{format:r,formatType:i}=n;return ho(e,e.type,r,i,t,!0)},formatType:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return po(r,t,n)},grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>{var r;return(!To(e)||!Nn(e.bin))&&(null!==(r=t.grid)&&void 0!==r?r:function(e,t){return!fi(e)&&To(t)&&!$n(null==t?void 0:t.bin)}(n,e))},gridScale:({model:e,channel:t})=>function(e,t){const n="x"===t?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelAlign||Pd(t,n,r),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelBaseline||Rd(t,n,r),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>{var r;return null!==(r=e.labelFlush)&&void 0!==r?r:function(e,t){if("x"===t&&W(["quantitative","temporal"],e))return!0}(t.type,n)},labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{var r;return null!==(r=e.labelOverlap)&&void 0!==r?r:function(e,t,n,r){if(n&&!h(r)||"nominal"!==e&&"ordinal"!==e)return"log"!==t&&"symlog"!==t||"greedy"}(t.type,n,To(t)&&!!t.timeUnit,To(t)?t.sort:void 0)},orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:r,scaleType:i})=>{var o;const a="x"===e?"width":"y"===e?"height":void 0,s=a?t.getSizeSignalRef(a):void 0;return null!==(o=n.tickCount)&&void 0!==o?o:function({fieldOrDatumDef:e,scaleType:t,size:n,values:r}){var i;if(!r&&!fi(t)&&"log"!==t){if(To(e)){if($n(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&W(["month","hours","day","quarter"],null===(i=Sr(e.timeUnit))||void 0===i?void 0:i.unit))return}return{signal:`ceil(${n.signal}/40)`}}}({fieldOrDatumDef:r,scaleType:i,size:s,values:n.values})},title:({axis:e,model:t,channel:n})=>{if(void 0!==e.title)return e.title;const r=Ld(t,n);if(void 0!==r)return r;const i=t.typedFieldDef(n),o="x"===n?"x2":"y2",a=t.fieldDef(o);return ja(i?[So(i)]:[],To(a)?[So(a)]:[])},values:({axis:e,fieldOrDatumDef:t})=>function(e,t){const n=e.values;return d(n)?pa(t,n):Fr(n)?n:void 0}(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>{var r;return null!==(r=e.zindex)&&void 0!==r?r:function(e,t){return"rect"===e&&Zo(t)?1:0}(n,t)}};function zd(e){return`(((${e.signal} % 360) + 360) % 360)`}function Rd(e,t,n,r){if(void 0!==e){if("x"===n){if(Fr(e)){const n=zd(e);return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${Fr(t)?`(${t.signal} === "top")`:"top"===t} ? "bottom" : "top"`}}if(45{if(Wo(t)&&Ao(t.sort)){const{field:r,timeUnit:i}=t,o=t.sort,a=o.map(((e,t)=>`${Hr({field:r,timeUnit:i,equal:e})} ? ${t} : `)).join("")+o.length;e=new Id(e,{calculate:a,as:Ud(t,n,{forAs:!0})})}})),e}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${U(this.transform)}`}}function Ud(e,t,n){return Xo(e,Object.assign({prefix:t,suffix:"sort_index"},null!=n?n:{}))}function qd(e,t){return W(["top","bottom"],t)?"column":W(["left","right"],t)||"row"===e?"row":"column"}function Wd(e,t,n,r){const i="row"===r?n.headerRow:"column"===r?n.headerColumn:n.headerFacet;return ye((t||{})[e],i[e],n.header[e])}function Hd(e,t,n,r){const i={};for(const o of e){const e=Wd(o,t||{},n,r);void 0!==e&&(i[o]=e)}return i}const Gd=["row","column"],Vd=["header","footer"];function Yd(e,t){const n=e.component.layoutHeaders[t].title,r=e.config?e.config:void 0,i=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:a,titleOrient:s}=Hd(["titleAnchor","titleAngle","titleOrient"],i.header,r,t),u=qd(t,s),l=ke(a);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:n},"row"===t?{orient:"left"}:{}),{style:"guide-title"}),Zd(l,u)),Xd(u,l,o)),rh(r,i,t,bs,ys))}}function Xd(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=Pd(t,"row"===e?"left":"top","row"===e?"y":"x");return r?{align:r}:{}}function Zd(e,t){const n=Rd(e,"row"===t?"left":"top","row"===t?"y":"x",!0);return n?{baseline:n}:{}}function Jd(e,t){const n=e.component.layoutHeaders[t],r=[];for(const i of Vd)if(n[i])for(const o of n[i]){const a=eh(e,t,i,n,o);null!=a&&r.push(a)}return r}function Kd(e,t){var n;const{sort:r}=e;return ko(r)?{field:Xo(r,{expr:"datum"}),order:null!==(n=r.order)&&void 0!==n?n:"ascending"}:d(r)?{field:Ud(e,t,{expr:"datum"}),order:"ascending"}:{field:Xo(e,{expr:"datum"}),order:null!=r?r:"ascending"}}function Qd(e,t,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:u}=Hd(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=lo({fieldOrDatumDef:e,format:r,formatType:i,expr:"parent",config:n}).signal,c=qd(t,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:{signal:u?pe(pe(u,"datum.label",l),"datum.value",Xo(e,{expr:"parent"})):l}},"row"===t?{orient:"left"}:{}),{style:"guide-label",frame:"group"}),Zd(o,c)),Xd(c,o,a)),rh(n,e,t,xs,vs))}function eh(e,t,n,r,i){if(i){let o=null;const{facetFieldDef:a}=r,s=e.config?e.config:void 0;if(a&&i.labels){const{labelOrient:e}=Hd(["labelOrient"],a.header,s,t);("row"===t&&!W(["top","bottom"],e)||"column"===t&&!W(["left","right"],e))&&(o=Qd(a,t,s))}const u=Jp(e)&&!Eo(e.facet),l=i.axes,c=(null==l?void 0:l.length)>0;if(o||c){const s="row"===t?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`},r.facetFieldDef?{from:{data:e.getName(t+"_domain")},sort:Kd(a,t)}:{}),c&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{}),o?{title:o}:{}),i.sizeSignal?{encode:{update:{[s]:i.sizeSignal}}}:{}),c?{axes:l}:{})}}return null}const th={column:{start:0,end:1},row:{start:1,end:0}};function nh(e,t){return th[t][e]}function rh(e,t,n,r,i){const o={};for(const a of r){if(!i[a])continue;const r=Wd(a,null==t?void 0:t.header,e,n);void 0!==r&&(o[i[a]]=r)}return o}function ih(e){return[...oh(e,"width"),...oh(e,"height"),...oh(e,"childWidth"),...oh(e,"childHeight")]}function oh(e,t){const n="width"===t?"x":"y",r=e.component.layoutSize.get(t);if(!r||"merged"===r)return[];const i=e.getSizeSignalRef(t).signal;if("step"===r){const t=e.getScaleComponent(n);if(t){const r=t.get("type"),o=t.get("range");if(fi(r)&&Mr(o)){const r=e.scaleName(n);return Jp(e.parent)&&"independent"===e.parent.component.resolve.scale[n]?[ah(r,o)]:[ah(r,o),{name:i,update:sh(r,t,`domain('${r}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==r){const t=i.endsWith("width"),n=t?"containerSize()[0]":"containerSize()[1]",r=`isFinite(${n}) ? ${n} : ${zs(e.config.view,t?"width":"height")}`;return[{name:i,init:r,on:[{update:r,events:"window:resize"}]}]}return[{name:i,value:r}]}function ah(e,t){return{name:e+"_step",value:t.step}}function sh(e,t,n){const r=t.get("type"),i=t.get("padding"),o=ye(t.get("paddingOuter"),i);let a=t.get("paddingInner");return a="band"===r?void 0!==a?a:i:1,`bandspace(${n}, ${Ea(a)}, ${Ea(o)}) * ${e}_step`}function uh(e){return"childWidth"===e?"width":"childHeight"===e?"height":e}function lh(e,t){return ne(e).reduce(((n,r)=>{const i=e[r];return Object.assign(Object.assign({},n),El(t,i,r,(e=>ka(e.value))))}),{})}function ch(e,t){if(Qp(t)||Jp(t))return"shared";if(Kp(t))return fn(e)?"independent":"shared";throw new Error("invalid model type for resolve")}function fh(e,t){const n=e.scale[t],r=fn(t)?"axis":"legend";return"independent"===n?("shared"===e[r][t]&&hr(function(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}(t)),"independent"):e[r][t]||"shared"}const dh=Object.assign(Object.assign({},ks),{disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1}),hh=ne(dh);class ph extends Fu{}const gh={symbols:function(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i,legendType:o}){var a,s,u,l,c,f,h,p;if("symbol"!==o)return;const{markDef:g,encoding:m,config:y,mark:v}=n,b=g.filled&&"trail"!==v;let x=Object.assign(Object.assign({},function(e,t,n){for(const r of n){const n=Ca(r,t.markDef,t.config);void 0!==n&&(e[r]=ka(n))}return e}({},n,Yi)),jl(n,{filled:b}));const _=null!==(a=i.get("symbolOpacity"))&&void 0!==a?a:y.legend.symbolOpacity,w=null!==(s=i.get("symbolFillColor"))&&void 0!==s?s:y.legend.symbolFillColor,k=null!==(u=i.get("symbolStrokeColor"))&&void 0!==u?u:y.legend.symbolStrokeColor,A=void 0===_?null!==(l=mh(m.opacity))&&void 0!==l?l:g.opacity:void 0;if(x.fill)if("fill"===r||b&&r===it)delete x.fill;else if(x.fill.field)w?delete x.fill:(x.fill=ka(null!==(c=y.legend.symbolBaseFillColor)&&void 0!==c?c:"black"),x.fillOpacity=ka(null!=A?A:1));else if(d(x.fill)){const e=null!==(p=null!==(h=yh(null!==(f=m.fill)&&void 0!==f?f:m.color))&&void 0!==h?h:g.fill)&&void 0!==p?p:b&&g.color;e&&(x.fill=ka(e))}if(x.stroke)if("stroke"===r||!b&&r===it)delete x.stroke;else if(x.stroke.field||k)delete x.stroke;else if(d(x.stroke)){const e=ye(yh(m.stroke||m.color),g.stroke,b?g.color:void 0);e&&(x.stroke={value:e})}if(r!==ct){const e=To(t)&&bh(0,i,t);e?x.opacity=[Object.assign({test:e},ka(null!=A?A:1)),ka(y.legend.unselectedOpacity)]:A&&(x.opacity=ka(A))}return x=Object.assign(Object.assign({},x),e),te(x)?void 0:x},gradient:function(e,{model:t,legendType:n,legendCmpt:r}){var i;if("gradient"!==n)return;const{config:o,markDef:a,encoding:s}=t;let u={};const l=void 0===(null!==(i=r.get("gradientOpacity"))&&void 0!==i?i:o.legend.gradientOpacity)?mh(s.opacity)||a.opacity:void 0;return l&&(u.opacity=ka(l)),u=Object.assign(Object.assign({},u),e),te(u)?void 0:u},labels:function(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},a=n.config,s=To(t)?bh(0,i,t):void 0,u=s?[{test:s,value:1},{value:a.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=o,f=ao(c)?fo({fieldOrDatumDef:t,field:"datum.value",format:l,formatType:c,config:a}):void 0,d=Object.assign(Object.assign(Object.assign({},u?{opacity:u}:{}),f?{text:f}:{}),e);return te(d)?void 0:d},entries:function(e,{legendCmpt:t}){const n=t.get("selections");return(null==n?void 0:n.length)?Object.assign(Object.assign({},e),{fill:{value:"transparent"}}):e}};function mh(e){return vh(e,((e,t)=>Math.max(e,t.value)))}function yh(e){return vh(e,((e,t)=>ye(e,t.value)))}function vh(e,t){return function(e){const t=e&&e.condition;return!!t&&(d(t)||qo(t))}(e)?v(e.condition).reduce(t,e.value):qo(e)?e.value:void 0}function bh(e,t,n){const r=t.get("selections");if(!(null==r?void 0:r.length))return;const i=A(n.field);return r.map((e=>`(!length(data(${A(ae(e)+Tc)})) || (${e}[${i}] && indexof(${e}[${i}], datum.value) >= 0))`)).join(" || ")}const xh={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:r,formatType:i}=t;return ho(e,e.type,r,i,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return po(r,t,n)},gradientLength:e=>{var t,n;const{legend:r,legendConfig:i}=e;return null!==(n=null!==(t=r.gradientLength)&&void 0!==t?t:i.gradientLength)&&void 0!==n?n:function({legendConfig:e,model:t,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:a,gradientVerticalMaxLength:s,gradientVerticalMinLength:u}=e;if(hi(i))return"horizontal"===n?"top"===r||"bottom"===r?wh(t,"width",a,o):a:wh(t,"height",u,s)}(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>{var r,i;return null!==(i=null!==(r=e.labelOverlap)&&void 0!==r?r:t.labelOverlap)&&void 0!==i?i:function(e){if(W(["quantile","threshold","log","symlog"],e))return"greedy"}(n)},symbolType:({legend:e,markDef:t,channel:n,encoding:r})=>{var i;return null!==(i=e.symbolType)&&void 0!==i?i:function(e,t,n,r){var i;if("shape"!==t){const e=null!==(i=yh(n))&&void 0!==i?i:r;if(e)return e}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(t.type,n,r.shape,t.shape)},title:({fieldOrDatumDef:e,config:t})=>ta(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(Ct(n)&&hi(t)){if("gradient"===e)return}else if("symbol"===e)return;return e},values:({fieldOrDatumDef:e,legend:t})=>function(e,t){const n=e.values;return d(n)?pa(t,n):Fr(n)?n:void 0}(t,e)};function _h({legendConfig:e,legendType:t,orient:n,legend:r}){var i,o;return null!==(o=null!==(i=r.direction)&&void 0!==i?i:e[t?"gradientDirection":"symbolDirection"])&&void 0!==o?o:function(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===t?"horizontal":void 0}}(n,t)}function wh(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function kh(e){const t=Zp(e)?function(e){const{encoding:t}=e,n={};for(const r of[it,...ws]){const i=aa(t[r]);i&&e.getScaleComponent(r)&&(r===st&&To(i)&&i.type===Qr||(n[r]=Eh(e,r)))}return n}(e):function(e){const{legends:t,resolve:n}=e.component;for(const r of e.children){kh(r);for(const i of ne(r.component.legends))n.legend[i]=fh(e.component.resolve,i),"shared"===n.legend[i]&&(t[i]=Oh(t[i],r.component.legends[i]),t[i]||(n.legend[i]="independent",delete t[i]))}for(const r of ne(t))for(const t of e.children)t.component.legends[r]&&"shared"===n.legend[r]&&delete t.component.legends[r];return t}(e);return e.component.legends=t,t}function Ah(e,t,n,r){switch(t){case"disable":return void 0!==n;case"values":return!!(null==n?void 0:n.values);case"title":if("title"===t&&e===(null==r?void 0:r.title))return!0}return e===(n||{})[t]}function Eh(e,t){var n,r,i;let o=e.legend(t);const{markDef:a,encoding:s,config:u}=e,l=u.legend,c=new ph({},function(e,t){const n=e.scaleName(t);if("trail"===e.mark){if("color"===t)return{stroke:n};if("size"===t)return{strokeWidth:n}}return"color"===t?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}(e,t));!function(e,t,n){var r;const i=null===(r=e.fieldDef(t))||void 0===r?void 0:r.field;Lc(e,(e=>{var r,o;const a=null!==(r=e.project.hasField[i])&&void 0!==r?r:e.project.hasChannel[t];if(a&&gc.has(e)){const t=null!==(o=n.get("selections"))&&void 0!==o?o:[];t.push(e.name),n.set("selections",t,!1),a.hasLegend=!0}}))}(e,t,c);const f=void 0!==o?!o:l.disable;if(c.set("disable",f,void 0!==o),f)return c;o=o||{};const d=e.getScaleComponent(t).get("type"),h=aa(s[t]),p=To(h)?null===(n=Sr(h.timeUnit))||void 0===n?void 0:n.unit:void 0,g=o.orient||u.legend.orient||"right",m=function(e){const{legend:t}=e;return ye(t.type,function({channel:e,timeUnit:t,scaleType:n}){if(Ct(e)){if(W(["quarter","month","day"],t))return"symbol";if(hi(n))return"gradient"}return"symbol"}(e))}({legend:o,channel:t,timeUnit:p,scaleType:d}),y={legend:o,channel:t,model:e,markDef:a,encoding:s,fieldOrDatumDef:h,legendConfig:l,config:u,scaleType:d,orient:g,legendType:m,direction:_h({legend:o,legendType:m,orient:g,legendConfig:l})};for(const n of hh){if("gradient"===m&&n.startsWith("symbol")||"symbol"===m&&n.startsWith("gradient"))continue;const r=n in xh?xh[n](y):o[n];if(void 0!==r){const i=Ah(r,n,o,e.fieldDef(t));(i||void 0===u.legend[n])&&c.set(n,r,i)}}const v=null!==(r=null==o?void 0:o.encoding)&&void 0!==r?r:{},b=c.get("selections"),x={},_={fieldOrDatumDef:h,model:e,channel:t,legendCmpt:c,legendType:m};for(const t of["labels","legend","title","symbols","gradient","entries"]){const n=lh(null!==(i=v[t])&&void 0!==i?i:{},e),r=t in gh?gh[t](n,_):n;void 0===r||te(r)||(x[t]=Object.assign(Object.assign(Object.assign({},(null==b?void 0:b.length)&&To(h)?{name:`${ae(h.field)}_legend_${t}`}:{}),(null==b?void 0:b.length)?{interactive:!!b}:{}),{update:r}))}return te(x)||c.set("encode",x,!!(null==o?void 0:o.encoding)),c}function Oh(e,t){var n,r,i,o;if(!e)return t.clone();const a=e.getWithExplicit("orient"),s=t.getWithExplicit("orient");if(a.explicit&&s.explicit&&a.value!==s.value)return;let u=!1;for(const n of hh){const r=Bu(e.getWithExplicit(n),t.getWithExplicit(n),n,"legend",((e,t)=>{switch(n){case"symbolType":return r=e,"circle"===(i=t).value?i:r;case"title":return Na(e,t);case"type":return u=!0,ju("symbol")}var r,i;return Nu(e,t,n,"legend")}));e.setWithExplicit(n,r)}return u&&((null===(r=null===(n=e.implicit)||void 0===n?void 0:n.encode)||void 0===r?void 0:r.gradient)&&ue(e.implicit,["encode","gradient"]),(null===(o=null===(i=e.explicit)||void 0===i?void 0:i.encode)||void 0===o?void 0:o.gradient)&&ue(e.explicit,["encode","gradient"])),e}function Dh(e){const t=e.component.legends,n={};for(const r of ne(t)){const i=e.getScaleComponent(r),o=I(i.get("domains"));if(n[o])for(const e of n[o])Oh(e,t[r])||n[o].push(t[r]);else n[o]=[t[r].clone()]}const r=re(n).flat().map((t=>function(e,t){var n,r,i;const o=e.combine(),{disable:a,labelExpr:s,selections:u}=o,l=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ivoid 0!==e));return r}function Ch(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:r}=n;if(t.data){const i={signal:`[${t.size.map((e=>e.signal)).join(", ")}]`},o=t.data.reduce(((t,n)=>{const r=Fr(n)?n.signal:`data('${e.lookupDataSource(n)}')`;return W(t,r)||t.push(r),t}),[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[Object.assign({name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]}},n)]}return[Object.assign(Object.assign({name:r},{translate:{signal:"[width / 2, height / 2]"}}),n)]}const Sh=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class Fh extends Fu{constructor(e,t,n,r){super(Object.assign({},t),{name:e}),this.specifiedProjection=t,this.size=n,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function Mh(e){e.component.projection=Zp(e)?function(e){var t;if(e.hasProjection){const n=e.specifiedProjection,r=!(n&&(null!=n.scale||null!=n.translate)),i=r?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,o=r?function(e){const t=[],{encoding:n}=e;for(const r of[[tt,et],[rt,nt]])(aa(n[r[0]])||aa(n[r[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(st)&&e.typedFieldDef(st).type===Qr&&t.push({signal:e.getName(`geojson_${t.length}`)}),0===t.length&&t.push(e.requestDataName(Wu.Main)),t}(e):void 0;return new Fh(e.projectionName(!0),Object.assign(Object.assign({},null!==(t=e.config.projection)&&void 0!==t?t:{}),null!=n?n:{}),i,o)}}(e):function(e){if(0===e.children.length)return;let t;for(const t of e.children)Mh(t);const n=G(e.children,(e=>{const n=e.component.projection;if(n){if(t){const e=function(e,t){const n=G(Sh,(n=>!x(e.explicit,n)&&!x(t.explicit,n)||!(!x(e.explicit,n)||!x(t.explicit,n)||I(e.get(n))!==I(t.get(n)))));if(I(e.size)===I(t.size)){if(n)return e;if(I(e.explicit)===I({}))return t;if(I(t.explicit)===I({}))return e}return null}(t,n);return e&&(t=e),!!e}return t=n,!0}return!0}));if(t&&n){const n=e.projectionName(!0),r=new Fh(n,t.specifiedProjection,t.size,R(t.data));for(const t of e.children){const e=t.component.projection;e&&(e.isFit&&r.data.push(...t.component.projection.data),t.renameProjection(e.get("name"),n),e.merged=!0)}return r}}(e)}function jh(e,t){return`${jn(e)}_${t}`}function $h(e,t,n){var r;const i=jh(null!==(r=ca(n,void 0))&&void 0!==r?r:{},t);return e.getName(`${i}_bins`)}function Nh(e,t,n){let r,i;r=function(e){return"as"in e}(e)?k(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:[Xo(e,{forAs:!0}),Xo(e,{binSuffix:"end",forAs:!0})];const o=Object.assign({},ca(t,void 0)),a=jh(o,e.field),{signal:s,extentSignal:u}=function(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}(n,a);if(Tn(o.extent)){const e=o.extent,t=e.selection;i=Dd(n.getSelectionComponent(ae(t),t),e),delete o.extent}return{key:a,binComponent:Object.assign(Object.assign(Object.assign({bin:o,field:e.field,as:[r]},s?{signal:s}:{}),u?{extentSignal:u}:{}),i?{span:i}:{})}}class Bh extends ec{constructor(e,t){super(e),this.bins=t}clone(){return new Bh(null,R(this.bins))}static makeFromEncoding(e,t){const n=t.reduceFieldDef(((e,n,r)=>{if(Uo(n)&&$n(n.bin)){const{key:i,binComponent:o}=Nh(n,n.bin,t);e[i]=Object.assign(Object.assign(Object.assign({},o),e[i]),function(e,t,n,r){var i,o;if(ga(t,n)){const a=Zp(e)&&null!==(o=null!==(i=e.axis(n))&&void 0!==i?i:e.legend(n))&&void 0!==o?o:{},s=Xo(t,{expr:"datum"}),u=Xo(t,{expr:"datum",binSuffix:"end"});return{formulaAs:Xo(t,{binSuffix:"range",forAs:!0}),formula:vo(s,u,a.format,a.formatType,r)}}return{}}(t,n,r,t.config))}return e}),{});return te(n)?null:new Bh(e,n)}static makeFromTransform(e,t,n){const{key:r,binComponent:i}=Nh(t,t.bin,n);return new Bh(e,{[r]:i})}merge(e,t){for(const n of ne(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=X([...this.bins[n].as,...e.bins[n].as],U)):this.bins[n]=e.bins[n];for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}producedFields(){return new Set(re(this.bins).map((e=>e.as)).flat(2))}dependentFields(){return new Set(re(this.bins).map((e=>e.field)))}hash(){return`Bin ${U(this.bins)}`}assemble(){return re(this.bins).flatMap((e=>{const t=[],[n,...r]=e.as,i=e.bin,{extent:o}=i,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{e.aggregate&&(n=!0)}));const r={},i=new Set;return n?(t.forEachFieldDef(((e,n)=>{var o,a,s,u;const{aggregate:l,field:c}=e;if(l)if("count"===l)r["*"]=null!==(o=r["*"])&&void 0!==o?o:{},r["*"].count=new Set([Xo(e,{forAs:!0})]);else{if(Be(l)||Te(l)){const e=Be(l)?"argmin":"argmax",t=l[e];r[t]=null!==(a=r[t])&&void 0!==a?a:{},r[t][e]=new Set([Xo({op:e,field:t},{forAs:!0})])}else r[c]=null!==(s=r[c])&&void 0!==s?s:{},r[c][l]=new Set([Xo(e,{forAs:!0})]);Dn(n)&&"unaggregated"===t.scaleDomain(n)&&(r[c]=null!==(u=r[c])&&void 0!==u?u:{},r[c].min=new Set([Xo({field:c,aggregate:"min"},{forAs:!0})]),r[c].max=new Set([Xo({field:c,aggregate:"max"},{forAs:!0})]))}else!function(e,t,n,r){const i=Zp(r)?r.encoding[Gt(t)]:void 0;if(Uo(n)&&Zp(r)&&jo(t,n,i,r.stack,r.markDef,r.config))e.add(Xo(n,{})),e.add(Xo(n,{suffix:"end"})),n.bin&&ga(n,t)&&e.add(Xo(n,{binSuffix:"range"}));else if(t in Et){const n=function(e){switch(e){case et:return"y";case nt:return"y2";case tt:return"x";case rt:return"x2"}}(t);e.add(r.getName(n))}else e.add(Xo(n))}(i,n,e,t)})),i.size+ne(r).length===0?null:new Th(e,i,r)):null}static makeFromTransform(e,t){var n,r,i;const o=new Set,a={};for(const e of t.aggregate){const{op:t,field:i,as:o}=e;t&&("count"===t?(a["*"]=null!==(n=a["*"])&&void 0!==n?n:{},a["*"].count=new Set([o||Xo(e,{forAs:!0})])):(a[i]=null!==(r=a[i])&&void 0!==r?r:{},a[i][t]=new Set([o||Xo(e,{forAs:!0})])))}for(const e of null!==(i=t.groupby)&&void 0!==i?i:[])o.add(e);return o.size+ne(a).length===0?null:new Th(e,o,a)}merge(e){return J(this.dimensions,e.dimensions)?(function(e,t){var n;for(const r of ne(t)){const i=t[r];for(const t of ne(i))r in e?e[r][t]=new Set([...null!==(n=e[r][t])&&void 0!==n?n:[],...i[t]]):e[r]={[t]:i[t]}}}(this.measures,e.measures),!0):(function(...e){dr.debug(...e)}("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...ne(this.measures)])}producedFields(){const e=new Set;for(const t of ne(this.measures))for(const n of ne(this.measures[t])){const r=this.measures[t][n];0===r.size?e.add(`${n}_${t}`):r.forEach(e.add,e)}return e}hash(){return`Aggregate ${U({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const e=[],t=[],n=[];for(const r of ne(this.measures))for(const i of ne(this.measures[r]))for(const o of this.measures[r][i])n.push(o),e.push(i),t.push("*"===r?null:he(r));return{type:"aggregate",groupby:[...this.dimensions].map(he),ops:e,fields:t,as:n}}}class zh extends ec{constructor(e,t,n,r){super(e),this.model=t,this.name=n,this.data=r;for(const e of Ft){const n=t.facet[e];if(n){const{bin:r,sort:i}=n;this[e]=Object.assign({name:t.getName(`${e}_domain`),fields:[Xo(n),...$n(r)?[Xo(n,{binSuffix:"end"})]:[]]},ko(i)?{sortField:i}:d(i)?{sortIndexField:Ud(n,e)}:{})}}this.childModel=t.child}hash(){let e="Facet";for(const t of Ft)this[t]&&(e+=` ${t.charAt(0)}:${U(this[t])}`);return e}get fields(){var e;const t=[];for(const n of Ft)(null===(e=this[n])||void 0===e?void 0:e.fields)&&t.push(...this[n].fields);return t}dependentFields(){const e=new Set(this.fields);for(const t of Ft)this[t]&&(this[t].sortField&&e.add(this[t].sortField.field),this[t].sortIndexField&&e.add(this[t].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const t of cn){const n=this.childModel.component.scales[t];if(n&&!n.merged){const r=n.get("type"),i=n.get("range");if(fi(r)&&Mr(i)){const n=Cp(Sp(this.childModel,t));n?e[t]=n:hr(qn(t))}}}return e}assembleRowColumnHeaderData(e,t,n){const r={row:"y",column:"x"}[e],i=[],o=[],a=[];n&&n[r]&&(t?(i.push(`distinct_${n[r]}`),o.push("max")):(i.push(n[r]),o.push("distinct")),a.push(`distinct_${n[r]}`));const{sortField:s,sortIndexField:u}=this[e];if(s){const{op:e=bo,field:t}=s;i.push(t),o.push(e),a.push(Xo(s,{forAs:!0}))}else u&&(i.push(u),o.push("max"),a.push(u));return{name:this[e].name,source:null!=t?t:this.data,transform:[Object.assign({type:"aggregate",groupby:this[e].fields},i.length?{fields:i,ops:o,as:a}:{})]}}assembleFacetHeaderData(e){var t,n;const{columns:r}=this.model.layout,{layoutHeaders:i}=this.model.component,o=[],a={};for(const e of Gd){for(const r of Vd){const o=null!==(t=i[e]&&i[e][r])&&void 0!==t?t:[];for(const t of o)if((null===(n=t.axes)||void 0===n?void 0:n.length)>0){a[e]=!0;break}}if(a[e]){const t=`length(data("${this.facet.name}"))`,n="row"===e?r?{signal:`ceil(${t} / ${r})`}:1:r?{signal:`min(${t}, ${r})`}:{signal:t};o.push({name:`${this.facet.name}_${e}`,transform:[{type:"sequence",start:0,stop:n}]})}}const{row:s,column:u}=a;return(s||u)&&o.unshift(this.assembleRowColumnHeaderData("facet",null,e)),o}assemble(){var e,t;const n=[];let r=null;const i=this.getChildIndependentFieldsWithStep(),{column:o,row:a,facet:s}=this;if(o&&a&&(i.x||i.y)){r=`cross_${this.column.name}_${this.row.name}`;const o=[].concat(null!==(e=i.x)&&void 0!==e?e:[],null!==(t=i.y)&&void 0!==t?t:[]),a=o.map((()=>"distinct"));n.push({name:r,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:o,ops:a}]})}for(const e of[We,qe])this[e]&&n.push(this.assembleRowColumnHeaderData(e,r,i));if(s){const e=this.assembleFacetHeaderData(i);e&&n.push(...e)}return n}}function Rh(e){return"'"===e[0]&&"'"===e[e.length-1]||'"'===e[0]&&'"'===e[e.length-1]?e.slice(1,-1):e}function Ph(e){const t={};return B(e.filter,(e=>{var n;if(qr(e)){let r=null;Tr(e)?r=_a(e.equal):Rr(e)?r=_a(e.lte):zr(e)?r=_a(e.lt):Pr(e)?r=_a(e.gt):Lr(e)?r=_a(e.gte):Ir(e)?r=e.range[0]:Ur(e)&&(r=(null!==(n=e.oneOf)&&void 0!==n?n:e.in)[0]),r&&(pr(r)?t[e.field]="date":w(r)?t[e.field]="number":k(r)&&(t[e.field]="string")),e.timeUnit&&(t[e.field]="date")}})),t}class Lh extends ec{constructor(e,t){super(e),this._parse=t}clone(){return new Lh(null,R(this._parse))}hash(){return`Parse ${U(this._parse)}`}static makeExplicit(e,t,n){let r={};const i=t.data;return!Lu(i)&&i&&i.format&&i.format.parse&&(r=i.format.parse),this.makeWithAncestors(e,r,{},n)}static makeWithAncestors(e,t,n,r){for(const e of ne(n)){const t=r.getWithExplicit(e);void 0!==t.value&&(t.explicit||t.value===n[e]||"derived"===t.value||"flatten"===n[e]?delete n[e]:hr(Yn(e,n[e],t.value)))}for(const e of ne(t)){const n=r.get(e);void 0!==n&&(n===t[e]?delete t[e]:hr(Yn(e,t[e],n)))}const i=new Fu(t,n);r.copyAll(i);const o={};for(const e of ne(i.combine())){const t=i.get(e);null!==t&&(o[e]=t)}return 0===ne(o).length||r.parseNothing?null:new Lh(e,o)}get parse(){return this._parse}merge(e){this._parse=Object.assign(Object.assign({},this._parse),e.parse),e.remove()}assembleFormatParse(){const e={};for(const t of ne(this._parse)){const n=this._parse[t];1===me(t)&&(e[t]=n)}return e}producedFields(){return new Set(ne(this._parse))}dependentFields(){return new Set(ne(this._parse))}assembleTransforms(e=!1){return ne(this._parse).filter((t=>!e||me(t)>1)).map((e=>{const t=function(e,t){const n=ce(e);return"number"===t?`toNumber(${n})`:"boolean"===t?`toBoolean(${n})`:"string"===t?`toString(${n})`:"date"===t?`toDate(${n})`:"flatten"===t?n:0===t.indexOf("date:")?`timeParse(${n},'${Rh(t.slice(5,t.length))}')`:0===t.indexOf("utc:")?`utcParse(${n},'${Rh(t.slice(4,t.length))}')`:(hr(`Unrecognized parse "${t}".`),null)}(e,this._parse[e]);return t?{type:"formula",expr:t,as:ge(e)}:null})).filter((e=>null!==e))}}class Ih extends ec{clone(){return new Ih(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([Os])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Os}}}class Uh extends ec{constructor(e,t){super(e),this.params=t}clone(){return new Uh(null,this.params)}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${U(this.params)}`}assemble(){return Object.assign({type:"graticule"},!0===this.params?{}:this.params)}}class qh extends ec{constructor(e,t){super(e),this.params=t}clone(){return new qh(null,this.params)}dependentFields(){return new Set}producedFields(){var e;return new Set([null!==(e=this.params.as)&&void 0!==e?e:"data"])}hash(){return`Hash ${U(this.params)}`}assemble(){return Object.assign({type:"sequence"},this.params)}}class Wh extends ec{constructor(e){let t;if(super(null),Lu(e=null!=e?e:{name:"source"})||(t=e.format?Object.assign({},L(e.format,["parse"])):{}),Ru(e))this._data={values:e.values};else if(zu(e)){if(this._data={url:e.url},!t.type){let n=/(?:\.([^.]+))?$/.exec(e.url)[1];W(["json","csv","tsv","dsv","topojson"],n)||(n="json"),t.type=n}}else Uu(e)?this._data={values:[{type:"Sphere"}]}:(Pu(e)||Lu(e))&&(this._data={});this._generator=Lu(e),e.name&&(this._name=e.name),t&&!te(t)&&(this._data.format=t)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return Object.assign(Object.assign({name:this._name},this._data),{transform:[]})}}var Hh,Gh=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n};function Vh(e){return e instanceof Wh||e instanceof Uh||e instanceof qh}class Yh{constructor(){Hh.set(this,void 0),Gh(this,Hh,!1)}setModified(){Gh(this,Hh,!0)}get modifiedFlag(){return function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}(this,Hh)}}Hh=new WeakMap;class Xh extends Yh{getNodeDepths(e,t,n){n.set(e,t);for(const r of e.children)this.getNodeDepths(r,t+1,n);return n}optimize(e){const t=[...this.getNodeDepths(e,0,new Map).entries()].sort(((e,t)=>t[1]-e[1]));for(const e of t)this.run(e[0]);return this.modifiedFlag}}class Zh extends Yh{optimize(e){this.run(e);for(const t of e.children)this.optimize(t);return this.modifiedFlag}}class Jh extends Zh{mergeNodes(e,t){const n=t.shift();for(const r of t)e.removeChild(r),r.parent=n,r.remove()}run(e){const t=e.children.map((e=>e.hash())),n={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(e,n[t]))}}class Kh extends Zh{constructor(e){super(),this.requiresSelectionId=e&&Uc(e)}run(e){e instanceof Ih&&(this.requiresSelectionId&&(Vh(e.parent)||e.parent instanceof Th||e.parent instanceof Lh)||(this.setModified(),e.remove()))}}class Qh extends Yh{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,t){let n=new Set;e instanceof rc&&(n=e.producedFields(),K(n,t)&&(this.setModified(),e.removeFormulas(t),0===e.producedFields.length&&e.remove()));for(const r of e.children)this.run(r,new Set([...t,...n]))}}class ep extends Zh{constructor(){super()}run(e){e instanceof tc&&!e.isRequired()&&(this.setModified(),e.remove())}}class tp extends Xh{run(e){if(!(Vh(e)||e.numChildren()>1))for(const t of e.children)if(t instanceof Lh)if(e instanceof Lh)this.setModified(),e.merge(t);else{if(ee(e.producedFields(),t.dependentFields()))continue;this.setModified(),t.swapWithParent()}}}class np extends Xh{run(e){const t=[...e.children],n=e.children.filter((e=>e instanceof Lh));if(e.numChildren()>1&&n.length>=1){const r={},i=new Set;for(const e of n){const t=e.parse;for(const e of ne(t))e in r?r[e]!==t[e]&&i.add(e):r[e]=t[e]}for(const e of i)delete r[e];if(!te(r)){this.setModified();const n=new Lh(e,r);for(const i of t){if(i instanceof Lh)for(const e of ne(r))delete i.parse[e];e.removeChild(i),i.parent=n,i instanceof Lh&&0===ne(i.parse).length&&i.remove()}}}}}class rp extends Xh{run(e){e instanceof tc||e.numChildren()>0||e instanceof zh||e instanceof Wh||(this.setModified(),e.remove())}}class ip extends Xh{run(e){const t=e.children.filter((e=>e instanceof rc)),n=t.pop();for(const e of t)this.setModified(),n.merge(e)}}class op extends Xh{run(e){const t=e.children.filter((e=>e instanceof Th)),n={};for(const e of t){const t=U(e.groupBy);t in n||(n[t]=[]),n[t].push(e)}for(const t of ne(n)){const r=n[t];if(r.length>1){const t=r.pop();for(const n of r)t.merge(n)&&(e.removeChild(n),n.parent=t,n.remove(),this.setModified())}}}}class ap extends Xh{constructor(e){super(),this.model=e}run(e){const t=!(Vh(e)||e instanceof Ad||e instanceof Lh||e instanceof Ih),n=[],r=[];for(const i of e.children)i instanceof Bh&&(t&&!ee(e.producedFields(),i.dependentFields())?n.push(i):r.push(i));if(n.length>0){const t=n.pop();for(const e of n)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified(),e instanceof Bh?e.merge(t,this.model.renameSignal.bind(this.model)):t.swapWithParent()}if(r.length>1){const e=r.pop();for(const t of r)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified()}}}class sp extends Xh{run(e){const t=[...e.children];if(!H(t,(e=>e instanceof tc))||e.numChildren()<=1)return;const n=[];let r;for(const i of t)if(i instanceof tc){let t=i;for(;1===t.numChildren();){const[e]=t.children;if(!(e instanceof tc))break;t=e}n.push(...t.children),r?(e.removeChild(i),i.parent=r.parent,r.parent.removeChild(r),r.parent=t,this.setModified()):r=t}else n.push(i);if(n.length){this.setModified();for(const e of n)e.parent.removeChild(e),e.parent=r}}}class up extends ec{constructor(e,t){super(e),this.transform=t}clone(){return new up(null,R(this.transform))}addDimensions(e){this.transform.groupby=X(this.transform.groupby.concat(e),(e=>e))}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map((e=>e.field)).filter((e=>void 0!==e)).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){var t;return null!==(t=e.as)&&void 0!==t?t:Xo(e)}hash(){return`JoinAggregateTransform ${U(this.transform)}`}assemble(){const e=[],t=[],n=[];for(const r of this.transform.joinaggregate)t.push(r.op),n.push(this.getDefaultName(r)),e.push(void 0===r.field?null:r.field);const r=this.transform.groupby;return Object.assign({type:"joinaggregate",as:n,ops:t,fields:e},void 0!==r?{groupby:r}:{})}}class lp extends ec{constructor(e,t){super(e),this._stack=t}clone(){return new lp(null,R(this._stack))}static makeFromTransform(e,t){const{stack:n,groupby:r,as:i,offset:o="zero"}=t,a=[],s=[];if(void 0!==t.sort)for(const e of t.sort)a.push(e.field),s.push(ye(e.order,"ascending"));const u={field:a,order:s};let l;return l=function(e){return d(e)&&e.every((e=>k(e)))&&e.length>1}(i)?i:k(i)?[i,i+"_end"]:[t.stack+"_start",t.stack+"_end"],new lp(e,{stackField:n,groupby:r,offset:o,sort:u,facetby:[],as:l})}static makeFromEncoding(e,t){const n=t.stack,{encoding:r}=t;if(!n)return null;const{groupbyChannel:i,fieldChannel:o,offset:a,impute:s}=n;let u;i&&(u=oa(r[i]));const l=function(e){return e.stack.stackBy.reduce(((e,t)=>{const n=Xo(t.fieldDef);return n&&e.push(n),e}),[])}(t),c=t.encoding.order;let f;return f=d(c)||To(c)?Ma(c):l.reduce(((e,t)=>(e.field.push(t),e.order.push("y"===o?"descending":"ascending"),e)),{field:[],order:[]}),new lp(e,{dimensionFieldDef:u,stackField:t.vgField(o),facetby:[],stackby:l,sort:f,offset:a,impute:s,as:[t.vgField(o,{suffix:"start",forAs:!0}),t.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${U(this._stack)}`}getGroupbyFields(){const{dimensionFieldDef:e,impute:t,groupby:n}=this._stack;return e?e.bin?t?[Xo(e,{binSuffix:"mid"})]:[Xo(e,{}),Xo(e,{binSuffix:"end"})]:[Xo(e)]:null!=n?n:[]}assemble(){const e=[],{facetby:t,dimensionFieldDef:n,stackField:r,stackby:i,sort:o,offset:a,impute:s,as:u}=this._stack;if(s&&n){const{band:o=.5,bin:a}=n;a&&e.push({type:"formula",expr:`${o}*`+Xo(n,{expr:"datum"})+`+${1-o}*`+Xo(n,{expr:"datum",binSuffix:"end"}),as:Xo(n,{binSuffix:"mid",forAs:!0})}),e.push({type:"impute",field:r,groupby:[...i,...t],key:Xo(n,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...t],field:r,sort:o,as:u,offset:a}),e}}class cp extends ec{constructor(e,t){super(e),this.transform=t}clone(){return new cp(null,R(this.transform))}addDimensions(e){this.transform.groupby=X(this.transform.groupby.concat(e),(e=>e))}dependentFields(){var e,t;const n=new Set;return(null!==(e=this.transform.groupby)&&void 0!==e?e:[]).forEach(n.add,n),(null!==(t=this.transform.sort)&&void 0!==t?t:[]).forEach((e=>n.add(e.field))),this.transform.window.map((e=>e.field)).filter((e=>void 0!==e)).forEach(n.add,n),n}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){var t;return null!==(t=e.as)&&void 0!==t?t:Xo(e)}hash(){return`WindowTransform ${U(this.transform)}`}assemble(){var e;const t=[],n=[],r=[],i=[];for(const e of this.transform.window)n.push(e.op),r.push(this.getDefaultName(e)),i.push(void 0===e.param?null:e.param),t.push(void 0===e.field?null:e.field);const o=this.transform.frame,a=this.transform.groupby;if(o&&null===o[0]&&null===o[1]&&n.every((e=>ze(e))))return Object.assign({type:"joinaggregate",as:r,ops:n,fields:t},void 0!==a?{groupby:a}:{});const s=[],u=[];if(void 0!==this.transform.sort)for(const t of this.transform.sort)s.push(t.field),u.push(null!==(e=t.order)&&void 0!==e?e:"ascending");const l={field:s,order:u},c=this.transform.ignorePeers;return Object.assign(Object.assign(Object.assign({type:"window",params:i,as:r,ops:n,fields:t,sort:l},void 0!==c?{ignorePeers:c}:{}),void 0!==a?{groupby:a}:{}),void 0!==o?{frame:o}:{})}}function fp(e){if(e instanceof zh)if(1!==e.numChildren()||e.children[0]instanceof tc){const n=e.model.component.data.main;dp(n);const r=(t=e,function e(n){if(!(n instanceof zh)){const r=n.clone();if(r instanceof tc){const e=hp+r.getSource();r.setSource(e),t.model.component.data.outputNodes[e]=r}else(r instanceof Th||r instanceof lp||r instanceof cp||r instanceof up)&&r.addDimensions(t.fields);for(const t of n.children.flatMap(e))t.parent=r;return[r]}return n.children.flatMap(e)}),i=e.children.map(r).flat();for(const e of i)e.parent=n}else{const t=e.children[0];(t instanceof Th||t instanceof lp||t instanceof cp||t instanceof up)&&t.addDimensions(e.fields),t.swapWithParent(),fp(e)}else e.children.map(fp);var t}function dp(e){if(e instanceof tc&&e.type===Wu.Main&&1===e.numChildren()){const t=e.children[0];t instanceof zh||(t.swapWithParent(),dp(e))}}const hp="scale_",pp=5;function gp(e){for(const t of e){for(const e of t.children)if(e.parent!==t)return!1;if(!gp(t.children))return!1}return!0}function mp(e,t){let n=!1;for(const r of t)n=e.optimize(r)||n;return n}function yp(e,t,n){let r=e.sources,i=!1;return i=mp(new ep,r)||i,i=mp(new Kh(t),r)||i,r=r.filter((e=>e.numChildren()>0)),i=mp(new rp,r)||i,r=r.filter((e=>e.numChildren()>0)),n||(i=mp(new tp,r)||i,i=mp(new ap(t),r)||i,i=mp(new Qh,r)||i,i=mp(new np,r)||i,i=mp(new op,r)||i,i=mp(new ip,r)||i,i=mp(new Jh,r)||i,i=mp(new sp,r)||i),e.sources=r,i}class vp{constructor(e){Object.defineProperty(this,"signal",{enumerable:!0,get:e})}static fromName(e,t){return new vp((()=>e(t)))}}var bp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i({signal:`{data: ${ha(e,{timeUnit:n,type:t})}}`})))}(e,t,i):[e]}function kp(e,t,n,r){const{encoding:i}=n,o=aa(i[r]),{type:a}=o,s=o.timeUnit;if(function(e){return e&&e.unionWith}(t)){const i=kp(e,void 0,n,r),o=wp(t.unionWith,a,s);return Mu([...i.value,...o])}if(Fr(t))return Mu([t]);if(t&&"unaggregated"!==t&&!gi(t))return Mu(wp(t,a,s));const u=n.stack;if(u&&r===u.fieldChannel){if("normalize"===u.offset)return ju([[0,1]]);const e=n.requestDataName(Wu.Main);return ju([{data:e,field:n.vgField(r,{suffix:"start"})},{data:e,field:n.vgField(r,{suffix:"end"})}])}const l=Dn(r)&&To(o)?function(e,t,n){if(!fi(n))return;const r=e.fieldDef(t),i=r.sort;if(Ao(i))return{op:"min",field:Ud(r,t),order:"ascending"};const{stack:o}=e,a=o?[...o.groupbyField?[o.groupbyField]:[],...o.stackBy.map((e=>e.fieldDef.field))]:void 0;if(ko(i))return Ap(i,o&&!W(a,i.field));if(wo(i)){const{encoding:t,order:n}=i,r=e.fieldDef(t),{aggregate:s,field:u}=r,l=o&&!W(a,u);if(Be(s)||Te(s))return Ap({field:Xo(r),order:n},l);if(ze(s)||!s)return Ap({op:s,field:u,order:n},l)}else{if("descending"===i)return{op:"min",field:e.vgField(t),order:"descending"};if(W(["ascending",void 0],i))return!0}}(n,r,e):void 0;if(Ro(o))return ju(wp([o.datum],a,s));const c=o;if("unaggregated"===t){const e=n.requestDataName(Wu.Main),{field:t}=o;return ju([{data:e,field:Xo({field:t,aggregate:"min"})},{data:e,field:Xo({field:t,aggregate:"max"})}])}if($n(c.bin)){if(fi(e))return ju("bin-ordinal"===e?[]:[{data:oe(l)?n.requestDataName(Wu.Main):n.requestDataName(Wu.Raw),field:n.vgField(r,ga(c,r)?{binSuffix:"range"}:{}),sort:!0!==l&&h(l)?l:{field:n.vgField(r,{}),op:"min"}}]);{const{bin:e}=c;if($n(e)){const t=$h(n,c.field,e);return ju([new vp((()=>{const e=n.getSignalName(t);return`[${e}.start, ${e}.stop]`}))])}return ju([{data:n.requestDataName(Wu.Main),field:n.vgField(r,{})}])}}if(c.timeUnit&&W(["time","utc"],e)&&jo(r,c,Zp(n)?n.encoding[Gt(r)]:void 0,n.stack,n.markDef,n.config)){const e=n.requestDataName(Wu.Main);return ju([{data:e,field:n.vgField(r)},{data:e,field:n.vgField(r,{suffix:"end"})}])}return ju(l?[{data:oe(l)?n.requestDataName(Wu.Main):n.requestDataName(Wu.Raw),field:n.vgField(r),sort:l}]:[{data:n.requestDataName(Wu.Main),field:n.vgField(r)}])}function Ap(e,t){const{op:n,field:r,order:i}=e;return Object.assign(Object.assign({op:null!=n?n:t?"sum":bo},r?{field:he(r)}:{}),i?{order:i}:{})}function Ep(e,t){var n;const r=e.component.scales[t],i=e.specifiedScales[t].domain,o=null===(n=e.fieldDef(t))||void 0===n?void 0:n.bin,a=gi(i)&&i,s=Bn(o)&&Tn(o.extent)&&o.extent;(a||s)&&r.set("selectionExtent",null!=a?a:s,!0)}function Op(e,t){const{aggregate:n,type:r}=e;return n?k(n)&&!Ie[n]?{valid:!1,reason:rr(n)}:"quantitative"===r&&"log"===t?{valid:!1,reason:ir(e)}:{valid:!0}:{valid:!1,reason:nr(e)}}function Dp(e,t,n,r){return e.explicit&&t.explicit&&hr(function(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${I(n)} and ${I(r)}). Using the union of the two domains.`}(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function Cp(e){if(jr(e)&&k(e.field))return e.field;if(function(e){return!d(e)&&"fields"in e&&!("data"in e)}(e)){let t;for(const n of e.fields)if(jr(n)&&k(n.field))if(t){if(t!==n.field)return hr("Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect."),t}else t=n.field;return hr("Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect."),t}if(function(e){return!d(e)&&"fields"in e&&"data"in e}(e)){hr("Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.");const t=e.fields[0];return k(t)?t:void 0}}function Sp(e,t){const n=e.component.scales[t].get("domains").map((t=>(jr(t)&&(t.data=e.lookupDataSource(t.data)),t)));return function(e){const t=X(e.map((e=>{if(jr(e)){const{sort:t}=e;return bp(e,["sort"])}return e})),U),n=X(e.map((e=>{if(jr(e)){const t=e.sort;return void 0===t||oe(t)||("op"in t&&"count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}})).filter((e=>void 0!==e)),U);if(0===t.length)return;if(1===t.length){const t=e[0];if(jr(t)&&n.length>0){let e=n[0];if(n.length>1)hr(sr),e=!0;else if(h(e)&&"field"in e){const n=e.field;t.field===n&&(e=!e.order||{order:e.order})}return Object.assign(Object.assign({},t),{sort:e})}return t}const r=X(n.map((e=>oe(e)||!("op"in e)||k(e.op)&&e.op in Ne?e:(hr(function(e){return`Dropping sort property ${I(e)} as unioned domains only support boolean or op "count", "min", and "max".`}(e)),!0))),U);let i;1===r.length?i=r[0]:r.length>1&&(hr(sr),i=!0);const o=X(e.map((e=>jr(e)?e.data:null)),(e=>e));return 1===o.length&&null!==o[0]?Object.assign({data:o[0],fields:t.map((e=>e.field))},i?{sort:i}:{}):Object.assign({fields:t},i?{sort:i}:{})}(n)}var Fp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ie.concat(Mp(t))),jp(e)):jp(e)}function jp(e){return ne(e.component.scales).reduce(((t,n)=>{const r=e.component.scales[n];if(r.merged)return t;const i=r.combine(),{name:o,type:a,selectionExtent:s,domains:u,range:l,reverse:c}=i,f=Fp(i,["name","type","selectionExtent","domains","range","reverse"]),d=function(e,t,n,r){if(fn(n)){if(Mr(e))return{step:{signal:t+"_step"}}}else if(h(e)&&jr(e))return Object.assign(Object.assign({},e),{data:r.lookupDataSource(e.data)});return e}(i.range,o,n,e);let p;s&&(p=function(e,t){const n=t.selection;return{signal:Dd(e.getSelectionComponent(n,ae(n)),t)}}(e,s));const g=Sp(e,n);return t.push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:o,type:a},g?{domain:g}:{}),p?{domainRaw:p}:{}),{range:d}),void 0!==c?{reverse:c}:{}),f)),t}),[])}class $p extends Fu{constructor(e,t){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",t)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||H(this.get("domains"),(e=>d(e)&&2===e.length&&e[0]<=0&&e[1]>=0))}}const Np=["range","scheme"];function Bp(e){return"x"===e?"width":"y"===e?"height":void 0}function Tp(e,t){const n=e.fieldDef(t);if(n&&n.bin&&$n(n.bin)){const r=$h(e,n.field,n.bin),i=Bp(t),o=e.getName(i);return new vp((()=>{const t=e.getSignalName(r),n=`(${t}.stop - ${t}.start) / ${t}.step`;return`${e.getSignalName(o)} / (${n})`}))}}function zp(e,t){const n=t.specifiedScales[e],{size:r}=t,i=t.getScaleComponent(e).get("type");for(const r of Np)if(void 0!==n[r]){const o=Ei(i,r),a=Oi(e,r);if(o)if(a)hr(a);else switch(r){case"range":{const r=n.range;if(d(r)){if(fn(e))return Mu(r.map((e=>{if("width"===e||"height"===e){const n=t.getName(e),r=t.getSignalName.bind(t);return vp.fromName(r,n)}return e})))}else if(h(r))return Mu({data:t.requestDataName(Wu.Main),field:r.field,sort:{op:"min",field:t.vgField(e)}});return Mu(r)}case"scheme":return Mu(Rp(n[r]))}else hr(or(i,r,e))}if(e===Ge||e===Ve){const t=e===Ge?"width":"height",n=r[t];if($s(n)){if(fi(i))return Mu({step:n.step});hr(ar(t))}}const{rangeMin:o,rangeMax:a}=n,s=function(e,t){const{size:n,config:r,mark:i,encoding:o}=t,a=t.getSignalName.bind(t),{type:s}=aa(o[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case Ge:case Ve:{if(W(["point","band"],u))if(e!==Ge||n.width){if(e===Ve&&!n.height){const e=Ps(r.view,"height");if($s(e))return e}}else{const e=Ps(r.view,"width");if($s(e))return e}const i=Bp(e),o=t.getName(i);return e===Ve&&di(u)?[vp.fromName(a,o),0]:[0,vp.fromName(a,o)]}case ut:{const o=Pp(i,t.component.scales[e].get("zero"),r),a=function(e,t,n,r){const i={x:Tp(n,"x"),y:Tp(n,"y")};switch(e){case"bar":case"tick":{if(void 0!==r.scale.maxBandSize)return r.scale.maxBandSize;const e=Ip(t,i,r.view);return w(e)?e-1:new vp((()=>`${e.signal} - 1`))}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const e=Ip(t,i,r.view);return w(e)?Math.pow(Lp*e,2):new vp((()=>`pow(${Lp} * ${e.signal}, 2)`))}}throw new Error(Qn("size",e))}(i,n,t,r);return pi(u)?function(e,t,n){const r=()=>{const r=Ea(t),i=Ea(e),o=`(${r} - ${i}) / (${n} - 1)`;return`sequence(${i}, ${r} + ${o}, ${o})`};return Fr(t)?new vp(r):{signal:r()}}(o,a,function(e,t,n,r){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return void 0!==n&&d(n)?n.length+1:(hr(function(e){return`Domain for ${e} is required for threshold scale.`}(r)),3)}}(u,r,l,e)):[o,a]}case Ke:return[0,2*Math.PI];case lt:return[0,360];case Ze:return[0,new vp((()=>`min(${t.getSignalName("width")},${t.getSignalName("height")})/2`))];case ht:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case pt:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case st:return"symbol";case it:case ot:case at:return"ordinal"===u?"nominal"===s?"category":"ordinal":void 0!==c?"diverging":"rect"===i||"geoshape"===i?"heatmap":"ramp";case ct:case ft:case dt:return[r.scale.minOpacity,r.scale.maxOpacity]}throw new Error(`Scale range undefined for channel ${e}`)}(e,t);return(void 0!==o||void 0!==a)&&Ei(i,"rangeMin")&&d(s)&&2===s.length?Mu([null!=o?o:s[0],null!=a?a:s[1]]):ju(s)}function Rp(e){return function(e){return!k(e)&&!!e.name}(e)?Object.assign({scheme:e.name},L(e,["name"])):{scheme:e}}function Pp(e,t,n){if(t)return Fr(t)?{signal:`${t.signal} ? 0 : ${Pp(e,!1,n)}`}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(Qn("size",e))}const Lp=.95;function Ip(e,t,n){const r=$s(e.width)?e.width.step:Rs(n,"width"),i=$s(e.height)?e.height.step:Rs(n,"height");return t.x||t.y?new vp((()=>`min(${[t.x?t.x.signal:r,t.y?t.y.signal:i].join(", ")})`)):Math.min(r,i)}function Up(e,t){Zp(e)?function(e,t){const n=e.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:a}=e;for(const s of ne(n)){const u=a[s],l=n[s],c=e.getScaleComponent(s),f=aa(i[s]),d=u[t],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=Ei(h,t),y=Oi(s,t);if(void 0!==d&&(m?y&&hr(y):hr(or(h,t,s))),m&&void 0===y)if(void 0!==d){const e=f.timeUnit,n=f.type;switch(t){case"domainMax":case"domainMin":pr(u[t])||"temporal"===n||e?l.set(t,{signal:ha(u[t],{type:n,timeUnit:e})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const n=t in qp?qp[t]({model:e,channel:s,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:u.domain,markDef:o,config:r}):r.scale[t];void 0!==n&&l.set(t,n,!1)}}}(e,t):Hp(e,t)}const qp={bins:({model:e,fieldOrDatumDef:t})=>To(t)?function(e,t){const n=t.bin;if($n(n)){const r=$h(e,t.field,n);return new vp((()=>e.getSignalName(r)))}if(Nn(n)&&Bn(n)&&void 0!==n.step)return{step:n.step}}(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>function(e,t){if(W([it,ot,at],e)&&"nominal"!==t)return"hcl"}(e,t.type),nice:({scaleType:e,channel:t,fieldOrDatumDef:n})=>function(e,t,n){var r;if(!(null===(r=oa(n))||void 0===r?void 0:r.bin)&&!W([ei.TIME,ei.UTC],e))return t in ln||void 0}(e,t,n),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:r,config:i})=>function(e,t,n,r,i,o){if(e in ln){if(hi(t)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:t,orient:a}=i;if("bar"===t&&(!To(r)||!r.bin&&!r.timeUnit)&&("vertical"===a&&"x"===e||"horizontal"===a&&"y"===e))return o.continuousBandSize}if(t===ei.POINT)return n.pointPadding}}(e,t,i.scale,n,r,i.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,config:r})=>function(e,t,n,r){if(void 0===e&&t in ln){const{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:i}=r;return ye(e,"bar"===n?t:i)}}(e,t,n.type,r.scale),paddingOuter:({scalePadding:e,channel:t,scaleType:n,markDef:r,scalePaddingInner:i,config:o})=>function(e,t,n,r,i,o){if(void 0===e&&t in ln&&n===ei.BAND){const{bandPaddingOuter:e}=o;return ye(e,Fr(i)?{signal:`${i.signal}/2`}:i/2)}}(e,t,n,r.type,i,o.scale),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:r})=>function(e,t,n,r){return"x"===n&&void 0!==r.xReverse?di(e)&&"descending"===t?Fr(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse:!(!di(e)||"descending"!==t)||void 0}(t,To(e)?e.sort:void 0,n,r.scale),zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:r,scaleType:i})=>function(e,t,n,r,i){if(n&&"unaggregated"!==n&&di(i)){if(d(n)){const e=n[0],t=n[n.length-1];if(e<=0&&t>=0)return!0}return!1}if("size"===e&&"quantitative"===t.type&&!pi(i))return!0;if((!To(t)||!t.bin)&&W([...cn,...hn],e)){const{orient:t,type:n}=r;return!W(["bar","area","line","trail"],n)||!("horizontal"===t&&"y"===e||"vertical"===t&&"x"===e)}return!1}(e,t,n,r,i)};function Wp(e){Zp(e)?function(e){const t=e.component.scales;for(const n of On){const r=t[n];if(!r)continue;const i=zp(n,e);r.setWithExplicit("range",i)}}(e):Hp(e,"range")}function Hp(e,t){const n=e.component.scales;for(const n of e.children)"range"===t?Wp(n):Up(n,t);for(const r of ne(n)){let i;for(const n of e.children){const e=n.component.scales[r];e&&(i=Bu(i,e.getWithExplicit(t),t,"scale",$u(((e,n)=>"range"===t&&e.step&&n.step?e.step-n.step:0))))}n[r].setWithExplicit(t,i)}}function Gp(e){Zp(e)?e.component.scales=function(e){const{encoding:t,mark:n}=e;return On.reduce(((r,i)=>{const o=aa(t[i]);if(o&&n===qi&&i===st&&o.type===Qr)return r;let a=o&&o.scale;if(o&&null!==a&&!1!==a){a=null!=a?a:{};const t=function(e,t,n,r){const i=function(e,t,n){var r;switch(t.type){case"nominal":case"ordinal":if(Ct(e)||"discrete"===Mn(e))return"shape"===e&&"ordinal"===t.type&&hr(tr(e,"ordinal")),"ordinal";if(e in ln){if(W(["rect","bar","image","rule"],n))return"band"}else if("arc"===n&&e in dn)return"band";return void 0!==t.band||Ho(t)&&(null===(r=t.axis)||void 0===r?void 0:r.tickBand)?"band":"point";case"temporal":return Ct(e)?"time":"discrete"===Mn(e)?(hr(tr(e,"temporal")),"ordinal"):To(t)&&t.timeUnit&&Sr(t.timeUnit).utc?"utc":"time";case"quantitative":return Ct(e)?To(t)&&$n(t.bin)?"bin-ordinal":"linear":"discrete"===Mn(e)?(hr(tr(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(Zn(t.type))}(t,n,r),{type:o}=e;return Dn(t)?void 0!==o?function(e,t){if(!Dn(e))return!1;switch(e){case Ge:case Ve:case Ke:case Ze:return hi(t)||W(["band","point"],t);case ut:case ht:case ct:case ft:case dt:case lt:return hi(t)||pi(t)||W(["band","point","ordinal"],t);case it:case ot:case at:return"band"!==t;case pt:return"ordinal"===t||pi(t);case st:return"ordinal"===t}}(t,o)?To(n)&&(a=o,s=n.type,!(W([Zr,Kr],s)?void 0===a||fi(a):s===Jr?W([ei.TIME,ei.UTC,void 0],a):s!==Xr||W([ei.LOG,ei.POW,ei.SQRT,ei.SYMLOG,ei.QUANTILE,ei.QUANTIZE,ei.THRESHOLD,ei.LINEAR,void 0],a)))?(hr(function(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}(o,i)),i):o:(hr(function(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}(t,o,i)),i):i:null;var a,s}(a,i,o,n);r[i]=new $p(e.scaleName(i+"",!0),{value:t,explicit:a.type===t})}return r}),{})}(e):e.component.scales=function(e){var t;const n=e.component.scales={},r={},i=e.component.resolve;for(const n of e.children){Gp(n);for(const o of ne(n.component.scales))if(i.scale[o]=null!==(t=i.scale[o])&&void 0!==t?t:ch(o,e),"shared"===i.scale[o]){const e=r[o],t=n.component.scales[o].getWithExplicit("type");e?ni(e.value,t.value)?r[o]=Bu(e,t,"type","scale",Vp):(i.scale[o]="independent",delete r[o]):r[o]=t}}for(const t of ne(r)){const i=e.scaleName(t,!0),o=r[t];n[t]=new $p(i,o);for(const n of e.children){const e=n.component.scales[t];e&&(n.renameScale(e.get("name"),i),e.merged=!0)}}return n}(e)}const Vp=$u(((e,t)=>ii(e)-ii(t)));var Yp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i(e.from&&e.from.data&&(e.from.data=this.lookupDataSource(e.from.data)),e.from&&e.from.facet&&e.from.facet.data&&(e.from.facet.data=this.lookupDataSource(e.from.facet.data)),e),this.parent=n,this.config=i,this.view=Ci(a),this.name=null!==(s=e.name)&&void 0!==s?s:r,this.title=va(e.title)?{text:e.title}:e.title?this.initTitle(e.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new Xp,this.projectionNameMap=n?n.projectionNameMap:new Xp,this.signalNameMap=n?n.signalNameMap:new Xp,this.data=e.data,this.description=e.description,this.transforms=(null!==(u=e.transform)&&void 0!==u?u:[]).map((e=>Hu(e)?{filter:T(e.filter,Vr)}:e)),this.layout="layer"===t||"unit"===t?{}:function(e,t,n){var r,i;const o=n[t],a={},{spacing:s,columns:u}=o;void 0!==s&&(a.spacing=s),void 0!==u&&(Do(e)&&!Eo(e.facet)||Fs(e))&&(a.columns=u),Ms(e)&&(a.columns=1);for(const t of Bs)if(void 0!==e[t])if("spacing"===t){const n=e[t];a[t]=w(n)?n:{row:null!==(r=n.row)&&void 0!==r?r:s,column:null!==(i=n.column)&&void 0!==i?i:s}}else a[t]=e[t];return a}(e,t,i),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:Do(e)||n&&n.component.data.isFaceted&&void 0===e.data},layoutSize:new Fu,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:Object.assign({scale:{},axis:{},legend:{}},o?R(o):{}),selection:null,scales:null,projection:null,axes:{},legends:{}}}initTitle(e){const t=ne(e),n={text:_a(e.text)};for(const r of t)n[r]=_a(e[r]);return n}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){!function(e,{ignoreRange:t}={}){Gp(e),xp(e);for(const t of Ai)Up(e,t);t||Wp(e)}(this)}parseProjection(){Mh(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){kh(this)}assembleGroupStyle(){var e,t;if("unit"===this.type||"layer"===this.type)return null!==(t=null===(e=this.view)||void 0===e?void 0:e.style)&&void 0!==t?t:"cell"}assembleEncodeFromView(e){const{style:t}=e,n=Yp(e,["style"]),r={};for(const e of ne(n)){const t=n[e];void 0!==t&&(r[e]=ka(t))}return r}assembleGroupEncodeEntry(e){let t={};return this.view&&(t=this.assembleEncodeFromView(this.view)),e||(this.description&&(t.description=ka(this.description)),"unit"!==this.type&&"layer"!==this.type)?te(t)?void 0:t:Object.assign({width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height")},null!=t?t:{})}assembleLayout(){if(!this.layout)return;const e=this.layout,{spacing:t}=e,n=Yp(e,["spacing"]),{component:r,config:i}=this,o=function(e,t){const n={};for(const r of Ft){const i=e[r];if(null==i?void 0:i.facetFieldDef){const{titleAnchor:e,titleOrient:o}=Hd(["titleAnchor","titleOrient"],i.facetFieldDef.header,t,r),a=qd(r,o),s=nh(e,a);void 0!==s&&(n[a]=s)}}return te(n)?void 0:n}(r.layoutHeaders,i);return Object.assign(Object.assign(Object.assign({padding:t},this.assembleDefaultLayout()),n),o?{titleBand:o}:{})}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let t=[];for(const n of Ft)e[n].title&&t.push(Yd(this,n));for(const e of Gd)t=t.concat(Jd(this,e));return t}assembleAxes(){return function(e,t){const{x:n=[],y:r=[]}=e;return[...n.map((e=>Md(e,"grid",t))),...r.map((e=>Md(e,"grid",t))),...n.map((e=>Md(e,"main",t))),...r.map((e=>Md(e,"main",t)))].filter((e=>e))}(this.component.axes,this.config)}assembleLegends(){return Dh(this)}assembleProjections(){return Qp(e=this)||Kp(e)?function(e){return e.children.reduce(((e,t)=>e.concat(t.assembleProjections())),Ch(e))}(e):Ch(e);var e}assembleTitle(){var e,t,n;const r=null!==(e=this.title)&&void 0!==e?e:{},{encoding:i}=r,o=Yp(r,["encoding"]),a=Object.assign(Object.assign(Object.assign({},ya(this.config.title).nonMark),o),i?{encode:{update:i}}:{});if(a.text)return W(["unit","layer"],this.type)?W(["middle",void 0],a.anchor)&&(a.frame=null!==(t=a.frame)&&void 0!==t?t:"group"):a.anchor=null!==(n=a.anchor)&&void 0!==n?n:"start",te(a)?void 0:a}assembleGroup(e=[]){const t={};(e=e.concat(this.assembleSignals())).length>0&&(t.signals=e);const n=this.assembleLayout();n&&(t.layout=n),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||Jp(this.parent)?Mp(this):[];r.length>0&&(t.scales=r);const i=this.assembleAxes();i.length>0&&(t.axes=i);const o=this.assembleLegends();return o.length>0&&(t.legends=o),t}getName(e){return ae((this.name?this.name+"_":"")+e)}getDataName(e){return this.getName(Wu[e].toLowerCase())}requestDataName(e){const t=this.getDataName(e),n=this.component.data.outputNodeRefCounts;return n[t]=(n[t]||0)+1,t}getSizeSignalRef(e){if(Jp(this.parent)){const t=pn(uh(e)),n=this.component.scales[t];if(n&&!n.merged){const e=n.get("type"),r=n.get("range");if(fi(e)&&Mr(r)){const e=n.get("name"),r=Cp(Sp(this,t));return r?{signal:sh(e,n,Xo({aggregate:"distinct",field:r},{expr:"datum"}))}:(hr(qn(t)),null)}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const t=this.component.data.outputNodes[e];return t?t.getSource():e}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,t){this.signalNameMap.rename(e,t)}renameScale(e,t){this.scaleNameMap.rename(e,t)}renameProjection(e,t){this.projectionNameMap.rename(e,t)}scaleName(e,t){return t?this.getName(e):It(e)&&Dn(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e))?this.scaleNameMap.get(this.getName(e)):void 0}projectionName(e){return e?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const t=this.component.scales[e];return t&&!t.merged?t:this.parent?this.parent.getScaleComponent(e):void 0}getSelectionComponent(e,t){let n=this.component.selection[e];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(e,t)),!n)throw new Error(`Cannot find a selection named "${t}".`);return n}hasAxisOrientSignalRef(){var e,t;return(null===(e=this.component.axes.x)||void 0===e?void 0:e.some((e=>e.hasOrientSignalRef())))||(null===(t=this.component.axes.y)||void 0===t?void 0:t.some((e=>e.hasOrientSignalRef())))}}class tg extends eg{vgField(e,t={}){const n=this.fieldDef(e);if(n)return Xo(n,t)}reduceFieldDef(e,t){return function(e,t,n,r){return e?ne(e).reduce(((n,i)=>{const o=e[i];return d(o)?o.reduce(((e,n)=>t.call(r,e,n,i)),n):t.call(r,n,o,i)}),n):n}(this.getMapping(),((t,n,r)=>{const i=oa(n);return i?e(t,i,r):t}),t)}forEachFieldDef(e,t){qa(this.getMapping(),((t,n)=>{const r=oa(t);r&&e(r,n)}),t)}}class ng extends ec{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=R(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:"value",null!==(i=o[1])&&void 0!==i?i:"density"]}clone(){return new ng(null,R(this.transform))}dependentFields(){var e;return new Set([this.transform.density,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${U(this.transform)}`}assemble(){const e=this.transform,{density:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{const o=Dn(i)&&t.getScaleComponent(i);return o&&di(o.get("type"))&&"count"!==n.aggregate&&!Wi(r)&&(e[n.field]=n),e}),{});return ne(o).length?new rg(e,o):null}dependentFields(){return new Set(ne(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${U(this.filter)}`}assemble(){const e=ne(this.filter).reduce(((e,t)=>{const n=this.filter[t],r=Xo(n,{expr:"datum"});return null!==n&&("temporal"===n.type?e.push(`(isDate(${r}) || (isValid(${r}) && isFinite(+${r})))`):"quantitative"===n.type&&(e.push(`isValid(${r})`),e.push(`isFinite(+${r})`))),e}),[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}class ig extends ec{constructor(e,t){super(e),this.transform=t,this.transform=R(t);const{flatten:n,as:r=[]}=this.transform;this.transform.as=n.map(((e,t)=>{var n;return null!==(n=r[t])&&void 0!==n?n:e}))}clone(){return new ig(this.parent,R(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${U(this.transform)}`}assemble(){const{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}class og extends ec{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=R(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:"key",null!==(i=o[1])&&void 0!==i?i:"value"]}clone(){return new og(null,R(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${U(this.transform)}`}assemble(){const{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}class ag extends ec{constructor(e,t,n,r){super(e),this.fields=t,this.geojson=n,this.signal=r}clone(){return new ag(null,R(this.fields),this.geojson,this.signal)}static parseAll(e,t){if(t.component.projection&&!t.component.projection.isFit)return e;let n=0;for(const r of[[tt,et],[rt,nt]]){const i=r.map((e=>{const n=aa(t.encoding[e]);return To(n)?n.field:Ro(n)?{expr:`${n.datum}`}:qo(n)?{expr:`${n.value}`}:void 0}));(i[0]||i[1])&&(e=new ag(e,i,null,t.getName("geojson_"+n++)))}if(t.channelHasField(st)){const r=t.typedFieldDef(st);r.type===Qr&&(e=new ag(e,null,r.field,t.getName("geojson_"+n++)))}return e}dependentFields(){var e;const t=(null!==(e=this.fields)&&void 0!==e?e:[]).filter(k);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${U(this.fields)}`}assemble(){return Object.assign(Object.assign(Object.assign({type:"geojson"},this.fields?{fields:this.fields}:{}),this.geojson?{geojson:this.geojson}:{}),{signal:this.signal})}}class sg extends ec{constructor(e,t,n,r){super(e),this.projection=t,this.fields=n,this.as=r}clone(){return new sg(null,this.projection,R(this.fields),R(this.as))}static parseAll(e,t){if(!t.projectionName())return e;for(const n of[[tt,et],[rt,nt]]){const r=n.map((e=>{const n=aa(t.encoding[e]);return To(n)?n.field:Ro(n)?{expr:`${n.datum}`}:qo(n)?{expr:`${n.value}`}:void 0})),i=n[0]===rt?"2":"";(r[0]||r[1])&&(e=new sg(e,t.projectionName(),r,[t.getName("x"+i),t.getName("y"+i)]))}return e}dependentFields(){return new Set(this.fields.filter(k))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${U(this.fields)} ${U(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class ug extends ec{constructor(e,t){super(e),this.transform=t}clone(){return new ug(null,R(this.transform))}dependentFields(){var e;return new Set([this.transform.impute,this.transform.key,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:t=0,stop:n,step:r}=e;return{signal:`sequence(${[t,n,...r?[r]:[]].join(",")})`}}static makeFromTransform(e,t){return new ug(e,t)}static makeFromEncoding(e,t){const n=t.encoding,r=n.x,i=n.y;if(To(r)&&To(i)){const o=r.impute?r:i.impute?i:void 0;if(void 0===o)return;const a=r.impute?i:i.impute?r:void 0,{method:s,value:u,frame:l,keyvals:c}=o.impute,f=Wa(t.mark,n);return new ug(e,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({impute:o.field,key:a.field},s?{method:s}:{}),void 0!==u?{value:u}:{}),l?{frame:l}:{}),void 0!==c?{keyvals:c}:{}),f.length?{groupby:f}:{}))}return null}hash(){return`Impute ${U(this.transform)}`}assemble(){const{impute:e,key:t,keyvals:n,method:r,groupby:i,value:o,frame:a=[null,null]}=this.transform,s=Object.assign(Object.assign(Object.assign(Object.assign({type:"impute",field:e,key:t},n?{keyvals:(u=n,void 0!==(null==u?void 0:u.stop)?this.processSequence(n):n)}:{}),{method:"value"}),i?{groupby:i}:{}),{value:r&&"value"!==r?null:o});var u;return r&&"value"!==r?[s,Object.assign({type:"window",as:[`imputed_${e}_value`],ops:[r],fields:[e],frame:a,ignorePeers:!1},i?{groupby:i}:{}),{type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e}]:[s]}}class lg extends ec{constructor(e,t){var n,r,i;super(e),this.transform=t,this.transform=R(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(r=o[0])&&void 0!==r?r:t.on,null!==(i=o[1])&&void 0!==i?i:t.loess]}clone(){return new lg(null,R(this.transform))}dependentFields(){var e;return new Set([this.transform.loess,this.transform.on,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${U(this.transform)}`}assemble(){const e=this.transform,{loess:t,on:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ie))}producedFields(){}dependentFields(){var e;return new Set([this.transform.pivot,this.transform.value,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}hash(){return`PivotTransform ${U(this.transform)}`}assemble(){const{pivot:e,value:t,groupby:n,limit:r,op:i}=this.transform;return Object.assign(Object.assign(Object.assign({type:"pivot",field:e,value:t},void 0!==r?{limit:r}:{}),void 0!==i?{op:i}:{}),void 0!==n?{groupby:n}:{})}}class pg extends ec{constructor(e,t){super(e),this.transform=t}clone(){return new pg(null,R(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${U(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function gg(e){let t=0;return function n(r,i){var o;if(r instanceof Wh&&!r.isGenerator&&!zu(r.data)&&(e.push(i),i={name:null,source:i.name,transform:[]}),r instanceof Lh&&(r.parent instanceof Wh&&!i.source?(i.format=Object.assign(Object.assign({},null!==(o=i.format)&&void 0!==o?o:{}),{parse:r.assembleFormatParse()}),i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof zh){i.name||(i.name="data_"+t++),!i.source||i.transform.length>0?(e.push(i),r.data=i.name):r.data=i.source;for(const t of r.assemble())e.push(t)}else switch((r instanceof Uh||r instanceof qh||r instanceof rg||r instanceof Ad||r instanceof Id||r instanceof sg||r instanceof ag||r instanceof Th||r instanceof cg||r instanceof cp||r instanceof up||r instanceof og||r instanceof ig||r instanceof ng||r instanceof lg||r instanceof fg||r instanceof dg||r instanceof Ih||r instanceof pg||r instanceof hg)&&i.transform.push(r.assemble()),(r instanceof Bh||r instanceof rc||r instanceof ug||r instanceof lp)&&i.transform.push(...r.assemble()),r instanceof tc&&(i.source&&0===i.transform.length?r.setSource(i.source):r.parent instanceof tc?r.setSource(i.name):(i.name||(i.name="data_"+t++),r.setSource(i.name),1===r.numChildren()&&(e.push(i),i={name:null,source:i.name,transform:[]}))),r.numChildren()){case 0:r instanceof tc&&(!i.source||i.transform.length>0)&&e.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name="data_"+t++);let o=i.name;!i.source||i.transform.length>0?e.push(i):o=i.source;for(const e of r.children)n(e,{name:null,source:o,transform:[]});break}}}}function mg(e,t){var n;const{facet:r,config:i,child:o,component:a}=e;if(e.channelHasField(t)){const s=r[t],u=Wd("title",null,i,t);let l=ta(s,i,{allowDisabling:!0,includeDefault:void 0===u||!!u});o.component.layoutHeaders[t].title&&(l=d(l)?l.join(", "):l,l+=" / "+o.component.layoutHeaders[t].title,o.component.layoutHeaders[t].title=null);const c=Wd("labelOrient",s,i,t),f=ye((null!==(n=s.header)&&void 0!==n?n:{}).labels,i.header.labels,!0),h=W(["bottom","right"],c)?"footer":"header";a.layoutHeaders[t]={title:l,facetFieldDef:s,[h]:"facet"===t?[]:[yg(e,t,f)]}}}function yg(e,t,n){const r="row"===t?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(r)?e.child.getSizeSignalRef(r):void 0,axes:[]}}function vg(e,t){var n;const{child:r}=e;if(r.component.axes[t]){const{layoutHeaders:o,resolve:a}=e.component;if(a.axis[t]=fh(a,t),"shared"===a.axis[t]){const a="x"===t?"column":"row",s=o[a];for(const o of r.component.axes[t]){const t="top"===(i=o.get("orient"))||"left"===i||Fr(i)?"header":"footer";s[t]=null!==(n=s[t])&&void 0!==n?n:[yg(e,a,!1)];const r=Md(o,"main",e.config,{header:!0});r&&s[t][0].axes.push(r),o.mainExtracted=!0}}}var i}function bg(e){for(const t of e.children)t.parseLayoutSize()}function xg(e,t){const n=uh(t),r=pn(n),i=e.component.resolve,o=e.component.layoutSize;let a;for(const t of e.children){const e=t.component.layoutSize.getWithExplicit(n),o=i.scale[r];if("independent"===o&&"step"===e.value){a=void 0;break}if(a){if("independent"===o&&a.value!==e.value){a=void 0;break}a=Bu(a,e,n,"")}else a=e}if(a){for(const r of e.children)e.renameSignal(r.getName(n),e.getName(t)),r.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,a)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function _g(e,t){const n="width"===t?"x":"y",r=e.config,i=e.getScaleComponent(n);if(i){const e=i.get("type"),n=i.get("range");if(fi(e)){const e=Ps(r.view,t);return Mr(n)||$s(e)?"step":e}return zs(r.view,t)}if(e.hasProjection||"arc"===e.mark)return zs(r.view,t);{const e=Ps(r.view,t);return $s(e)?e.step:e}}function wg(e,t,n){return Xo(t,Object.assign({suffix:`by_${Xo(e)}`},null!=n?n:{}))}class kg extends tg{constructor(e,t,n,r){super(e,"facet",t,n,r,e.resolve),this.child=Wg(e.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!Eo(e))return{facet:this.initFacetFieldDef(e,"facet")};const t=ne(e),n={};for(const r of t){if(!W([qe,We],r)){hr(Qn(r,"facet"));break}const t=e[r];if(void 0===t.field){hr(Kn(t,r));break}n[r]=this.initFacetFieldDef(t,r)}return n}initFacetFieldDef(e,t){const{header:n}=e,r=la(function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0?{aggregate:Object.assign(Object.assign({},u?{cross:u}:{}),i.length?{fields:i,ops:o,as:a}:{})}:{})}facetSortFields(e){const{facet:t}=this,n=t[e];return n?ko(n.sort)?[wg(n,n.sort,{expr:"datum"})]:d(n.sort)?[Ud(n,e,{expr:"datum"})]:[Xo(n,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:t}=this,n=t[e];if(n){const{sort:e}=n;return[(ko(e)?e.order:!d(e)&&e)||"ascending"]}return[]}assembleLabelTitle(){var e;const{facet:t,config:n}=this;if(t.facet)return Qd(t.facet,"facet",n);const r={row:["top","bottom"],column:["left","right"]};for(const i of Gd)if(t[i]){const o=Wd("labelOrient",null===(e=t[i])||void 0===e?void 0:e.header,n,i);if(W(r[i],o))return Qd(t[i],i,n)}}assembleMarks(){const{child:e}=this,t=function(e){const t=[],n=gg(t);for(const t of e.children)n(t,{source:e.name,name:null,transform:[]});return t}(this.component.data.facetRoot),n=e.assembleGroupEncodeEntry(!1),r=this.assembleLabelTitle()||e.assembleTitle(),i=e.assembleGroupStyle();return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:this.getName("cell"),type:"group"},r?{title:r}:{}),i?{style:i}:{}),{from:{facet:this.assembleFacet()},sort:{field:Ft.map((e=>this.facetSortFields(e))).flat(),order:Ft.map((e=>this.facetSortOrder(e))).flat()}}),t.length>0?{data:t}:{}),n?{encode:{update:n}}:{}),e.assembleGroup(function(e,t){if(e.component.selection&&ne(e.component.selection).length){const n=A(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:_l("mousemove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return Cc(t)}(this,[])))]}getMapping(){return this.facet}}function Ag(e,t){var n,r,i,o;for(const a of t){const t=a.data;if(e.name&&a.hasName()&&e.name!==a.dataName)continue;const s=null===(n=e.format)||void 0===n?void 0:n.mesh,u=null===(r=t.format)||void 0===r?void 0:r.feature;if(s&&u)continue;const l=null===(i=e.format)||void 0===i?void 0:i.feature;if((l||u)&&l!==u)continue;const c=null===(o=t.format)||void 0===o?void 0:o.mesh;if(!s&&!c||s===c)if(Ru(e)&&Ru(t)){if(z(e.values,t.values))return a}else if(zu(e)&&zu(t)){if(e.url===t.url)return a}else if(Pu(e)&&e.name===a.dataName)return a}return null}function Eg(e){var t,n,r,i,o,a,s,u,l,c;let f=function(e,t){if(e.data||!e.parent){if(null===e.data){const e=new Wh({values:[]});return t.push(e),e}const n=Ag(e.data,t);if(n)return Lu(e.data)||(n.data.format=V({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const n=new Wh(e.data);return t.push(n),n}}return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}(e,e.component.data.sources);const{outputNodes:d,outputNodeRefCounts:h}=e.component.data,p=e.parent?e.parent.component.data.ancestorParse.clone():new Tu,g=e.data;Lu(g)?(Iu(g)?f=new qh(f,g.sequence):qu(g)&&(f=new Uh(f,g.graticule)),p.parseNothing=!0):null===(null===(t=null==g?void 0:g.format)||void 0===t?void 0:t.parse)&&(p.parseNothing=!0),f=null!==(n=Lh.makeExplicit(f,e,p))&&void 0!==n?n:f,f=new Ih(f);const m=e.parent&&Qp(e.parent);(Zp(e)||Jp(e))&&m&&(f=null!==(r=Bh.makeFromEncoding(f,e))&&void 0!==r?r:f),e.transforms.length>0&&(f=function(e,t,n){var r,i;let o=0;for(const a of t.transforms){let s,u;if(nl(a))u=e=new Id(e,a),s="derived";else if(Hu(a)){const i=Ph(a);u=e=null!==(r=Lh.makeWithAncestors(e,{},i,n))&&void 0!==r?r:e,e=new Ad(e,t,a.filter)}else if(rl(a))u=e=Bh.makeFromTransform(e,a,t),s="number";else if(ol(a))s="date",void 0===n.getWithExplicit(a.field).value&&(e=new Lh(e,{[a.field]:s}),n.set(a.field,s,!1)),u=e=rc.makeFromTransform(e,a);else if(al(a))u=e=Th.makeFromTransform(e,a),s="number",Uc(t)&&(e=new Ih(e));else if(Gu(a))u=e=cg.make(e,t,a,o++),s="derived";else if(Qu(a))u=e=new cp(e,a),s="number";else if(el(a))u=e=new up(e,a),s="number";else if(sl(a))u=e=lp.makeFromTransform(e,a),s="derived";else if(ul(a))u=e=new og(e,a),s="derived";else if(tl(a))u=e=new ig(e,a),s="derived";else if(Vu(a))u=e=new hg(e,a),s="derived";else if(Ku(a))e=new pg(e,a);else if(il(a))u=e=ug.makeFromTransform(e,a),s="derived";else if(Yu(a))u=e=new ng(e,a),s="derived";else if(Xu(a))u=e=new fg(e,a),s="derived";else if(Zu(a))u=e=new dg(e,a),s="derived";else{if(!Ju(a)){hr(`Ignoring an invalid transform: ${I(a)}.`);continue}u=e=new lg(e,a),s="derived"}if(u&&void 0!==s)for(const e of null!==(i=u.producedFields())&&void 0!==i?i:[])n.set(e,s,!1)}return e}(f,e,p));const y=function(e){const t={};if(Zp(e)&&e.component.selection)for(const n of ne(e.component.selection)){const r=e.component.selection[n];for(const e of r.project.items)!e.channel&&me(e.field)>1&&(t[e.field]="flatten")}return t}(e),v=function(e){const t={};function n(e){var n;da(e)?t[e.field]="date":"quantitative"===e.type&&k(n=e.aggregate)&&W(["min","max"],n)?t[e.field]="number":me(e.field)>1?e.field in t||(t[e.field]="flatten"):Wo(e)&&ko(e.sort)&&me(e.sort.field)>1&&(e.sort.field in t||(t[e.sort.field]="flatten"))}if((Zp(e)||Jp(e))&&e.forEachFieldDef(((t,r)=>{if(Uo(t))n(t);else{const i=Wt(r),o=e.fieldDef(i);n(Object.assign(Object.assign({},t),{type:o.type}))}})),Zp(e)){const{mark:n,markDef:r,encoding:i}=e;if(Wi(n)&&!e.encoding.order){const e=i["horizontal"===r.orient?"y":"x"];To(e)&&"quantitative"===e.type&&!(e.field in t)&&(t[e.field]="number")}}return t}(e);f=null!==(i=Lh.makeWithAncestors(f,{},Object.assign(Object.assign({},y),v),p))&&void 0!==i?i:f,Zp(e)&&(f=ag.parseAll(f,e),f=sg.parseAll(f,e)),(Zp(e)||Jp(e))&&(m||(f=null!==(o=Bh.makeFromEncoding(f,e))&&void 0!==o?o:f),f=null!==(a=rc.makeFromEncoding(f,e))&&void 0!==a?a:f,f=Id.parseAllForSortIndex(f,e));const b=e.getDataName(Wu.Raw),x=new tc(f,b,Wu.Raw,h);if(d[b]=x,f=x,Zp(e)){const t=Th.makeFromEncoding(f,e);t&&(f=t,Uc(e)&&(f=new Ih(f))),f=null!==(s=ug.makeFromEncoding(f,e))&&void 0!==s?s:f,f=null!==(u=lp.makeFromEncoding(f,e))&&void 0!==u?u:f}Zp(e)&&(f=null!==(l=rg.make(f,e))&&void 0!==l?l:f);const _=e.getDataName(Wu.Main),w=new tc(f,_,Wu.Main,h);d[_]=w,f=w,Zp(e)&&function(e,t){Lc(e,(n=>{const r=n.name,i=e.getName(`lookup_${r}`);e.component.data.outputNodes[i]=n.materialized=new tc(new Ad(t,e,{selection:r}),i,Wu.Lookup,e.component.data.outputNodeRefCounts)}))}(e,w);let A=null;if(Jp(e)){const t=e.getName("facet");f=null!==(c=function(e,t){const{row:n,column:r}=t;if(n&&r){let t=null;for(const i of[n,r])if(ko(i.sort)){const{field:n,op:r=bo}=i.sort;e=t=new up(e,{joinaggregate:[{op:r,field:n,as:wg(i,i.sort,{forAs:!0})}],groupby:[Xo(i)]})}return t}return null}(f,e.facet))&&void 0!==c?c:f,A=new zh(f,e,t,w.getSource()),d[t]=A}return Object.assign(Object.assign({},e.component.data),{outputNodes:d,outputNodeRefCounts:h,raw:x,main:w,facetRoot:A,ancestorParse:p})}class Og extends eg{constructor(e,t,n,r){var i,o,a,s;super(e,"concat",t,n,r,e.resolve),"shared"!==(null===(o=null===(i=e.resolve)||void 0===i?void 0:i.axis)||void 0===o?void 0:o.x)&&"shared"!==(null===(s=null===(a=e.resolve)||void 0===a?void 0:a.axis)||void 0===s?void 0:s.y)||hr("Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415)."),this.children=this.getChildren(e).map(((e,t)=>Wg(e,this,this.getName("concat_"+t),void 0,r)))}parseData(){this.component.data=Eg(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of ne(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return Ms(e)?e.vconcat:js(e)?e.hconcat:e.concat}parseLayoutSize(){!function(e){bg(e);const t=1===e.layout.columns?"width":"childWidth",n=void 0===e.layout.columns?"height":"childHeight";xg(e,t),xg(e,n)}(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.forEach((e=>e.assembleSignals())),[]}assembleLayoutSignals(){const e=ih(this);for(const t of this.children)e.push(...t.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleMarks(){return this.children.map((e=>{const t=e.assembleTitle(),n=e.assembleGroupStyle(),r=e.assembleGroupEncodeEntry(!1);return Object.assign(Object.assign(Object.assign(Object.assign({type:"group",name:e.getName("group")},t?{title:t}:{}),n?{style:n}:{}),r?{encode:{update:r}}:{}),e.assembleGroup())}))}assembleDefaultLayout(){const e=this.layout.columns;return Object.assign(Object.assign({},null!=e?{columns:e}:{}),{bounds:"full",align:"each"})}}const Dg=Object.assign(Object.assign({disable:1,gridScale:1,scale:1},Se),{labelExpr:1,encode:1}),Cg=ne(Dg);class Sg extends Fu{constructor(e={},t={},n=!1){super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new Sg(R(this.explicit),R(this.implicit),this.mainExtracted)}hasAxisPart(e){return!("axis"!==e&&("grid"===e||"title"===e?!this.get(e):!1===(t=this.get(e))||null===t));var t}hasOrientSignalRef(){return Fr(this.explicit.orient)}}const Fg={bottom:"top",top:"bottom",left:"right",right:"left"};function Mg(e,t){if(!e)return t.map((e=>e.clone()));{if(e.length!==t.length)return;const n=e.length;for(let r=0;r{switch(n){case"title":return Na(e,t);case"gridScale":return{explicit:e.explicit,value:ye(e.value,t.value)}}return Nu(e,t,n,"axis")}));e.setWithExplicit(n,r)}return e}function $g(e,t,n,r,i){if("disable"===t)return void 0!==n;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(Fr(n.labelAngle)?n.labelAngle:ke(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===Ld(r,i))return!0}return e===n[t]}const Ng=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function Bg(e,t){var n,r,i;let o=t.axis(e);const a=new Sg,s=aa(t.encoding[e]),{mark:u,config:l}=t,c=(null==o?void 0:o.orient)||(null===(n=l["x"===e?"axisX":"axisY"])||void 0===n?void 0:n.orient)||(null===(r=l.axis)||void 0===r?void 0:r.orient)||function(e){return"x"===e?"bottom":"left"}(e),f=t.getScaleComponent(e).get("type"),d=function(e,t,n,r){const i="band"===t?["axisDiscrete","axisBand"]:"point"===t?["axisDiscrete","axisPoint"]:function(e){return e in si}(t)?["axisQuantitative"]:"time"===t||"utc"===t?["axisTemporal"]:[],o="x"===e?"axisX":"axisY",a=Fr(n)?"axisOrient":"axis"+le(n),s=[...i,...i.map((e=>o+e.substr(4)))],u=["axis",a,o];return{vlOnlyAxisConfig:$d(s,r,e,n),vgAxisConfig:$d(u,r,e,n),axisConfigStyle:Nd([...u,...s],r)}}(e,f,c,t.config),h=void 0!==o?!o:Bd("disable",l.style,null==o?void 0:o.style,d).configValue;if(a.set("disable",h,void 0!==o),h)return a;o=o||{};const p=function(e,t,n,r,i){const o=null==t?void 0:t.labelAngle;if(void 0!==o)return Fr(o)?o:ke(o);{const{configValue:o}=Bd("labelAngle",r,null==t?void 0:t.style,i);return void 0!==o?ke(o):n!==Ge||!W([Kr,Zr],e.type)||To(e)&&e.timeUnit?void 0:270}}(s,o,e,l.style,d),g={fieldOrDatumDef:s,axis:o,channel:e,model:t,scaleType:f,orient:c,labelAngle:p,mark:u,config:l};for(const n of Cg){const r=n in Td?Td[n](g):Me(n)?o[n]:void 0,i=void 0!==r,s=$g(r,n,o,t,e);if(i&&s)a.set(n,r,s);else{const{configValue:e,configFrom:t}=Me(n)&&"values"!==n?Bd(n,l.style,o.style,d):{},u=void 0!==e;i&&!u?a.set(n,r,s):("vgAxisConfig"!==t||Ng.has(n)&&u||Oe(e)||Fr(e))&&a.set(n,e,!1)}}const m=null!==(i=o.encoding)&&void 0!==i?i:{},y=De.reduce(((n,r)=>{var i;if(!a.hasAxisPart(r))return n;const o=lh(null!==(i=m[r])&&void 0!==i?i:{},t),s="labels"===r?function(e,t,n){var r;const{encoding:i,config:o}=e,a=null!==(r=aa(i[t]))&&void 0!==r?r:aa(i[Gt(t)]),s=e.axis(t)||{},{format:u,formatType:l}=s;return ao(l)?Object.assign({text:fo({fieldOrDatumDef:a,field:"datum.value",format:u,formatType:l,config:o})},n):n}(t,e,o):o;return void 0===s||te(s)||(n[r]={update:s}),n}),{});return te(y)||a.set("encode",y,!!o.encoding||void 0!==o.labelAngle),a}function Tg(e,t){const{config:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),Nl("x",e,{defaultPos:"mid"})),Nl("y",e,{defaultPos:"mid"})),Ml("size",e)),Ml("angle",e)),function(e,t,n){return n?{shape:{value:n}}:Ml("shape",e)}(e,0,t))}function zg(e){var t;const{config:n,markDef:r}=e,{orient:i}=r,o="horizontal"===i?"width":"height",a=e.getScaleComponent("horizontal"===i?"x":"y"),s=null!==(t=Da("size",r,n,{vgChannel:o}))&&void 0!==t?t:n.tick.bandSize;if(void 0!==s)return s;{const e=a?a.get("range"):void 0;return e&&Mr(e)&&w(e.step)?3*e.step/4:3*Rs(n.view,o)/4}}const Rg={arc:{vgMark:"arc",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),Nl("x",e,{defaultPos:"mid"})),Nl("y",e,{defaultPos:"mid"})),Ul(e,"radius","arc")),Ul(e,"theta","arc"))},area:{vgMark:"area",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"})),Pl("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===e.markDef.orient})),Pl("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===e.markDef.orient})),Xl(e))},bar:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),Ul(e,"x","bar")),Ul(e,"y","bar"))},circle:{vgMark:"symbol",encodeEntry:e=>Tg(e,"circle")},geoshape:{vgMark:"shape",encodeEntry:e=>Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[Object.assign({type:"geoshape",projection:e.projectionName()},n&&To(n)&&n.type===Qr?{field:Xo(n,{expr:"datum"})}:{})]}},image:{vgMark:"image",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"})),Ul(e,"x","image")),Ul(e,"y","image")),Ol(e,"url"))},line:{vgMark:"line",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),Nl("x",e,{defaultPos:"mid"})),Nl("y",e,{defaultPos:"mid"})),Ml("size",e,{vgChannel:"strokeWidth"})),Xl(e))},point:{vgMark:"symbol",encodeEntry:e=>Tg(e)},rect:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),Ul(e,"x","rect")),Ul(e,"y","rect"))},rule:{vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return e.encoding.x||e.encoding.y||e.encoding.latitude||e.encoding.longitude?Object.assign(Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),Pl("x",e,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n})),Pl("y",e,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n})),Ml("size",e,{vgChannel:"strokeWidth"})):{}}},square:{vgMark:"symbol",encodeEntry:e=>Tg(e,"square")},text:{vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vl(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"})),Nl("x",e,{defaultPos:"mid"})),Nl("y",e,{defaultPos:"mid"})),Ol(e)),Ml("size",e,{vgChannel:"fontSize"})),Ml("angle",e)),Zl("align",function(e,t,n){if(void 0===Da("align",e,n))return"center"}(e.markDef,0,t))),Zl("baseline",function(e,t,n){if(void 0===Da("baseline",e,n))return"middle"}(e.markDef,0,t))),Nl("radius",e,{defaultPos:null,isMidPoint:!0})),Nl("theta",e,{defaultPos:null,isMidPoint:!0}))}},tick:{vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,r=n.orient,i="horizontal"===r?"width":"height",o="horizontal"===r?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),Nl("x",e,{defaultPos:"mid",vgChannel:"xc"})),Nl("y",e,{defaultPos:"mid",vgChannel:"yc"})),Ml("size",e,{defaultValue:zg(e),vgChannel:i})),{[o]:ka(Da("thickness",n,t))})}},trail:{vgMark:"trail",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vl(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),Nl("x",e,{defaultPos:"mid"})),Nl("y",e,{defaultPos:"mid"})),Ml("size",e)),Xl(e))}};const Pg="faceted_path_",Lg="stack_group_";function Ig(e,t={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=e,a=ye(r.clip,function(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return!!(t&&t.get("selectionExtent")||n&&n.get("selectionExtent"))||void 0}(e),function(e){const t=e.component.projection;return!(!t||t.isFit)||void 0}(e)),s=Oa(r),u=i.key,l=function(e){const{encoding:t,stack:n,mark:r,markDef:i,config:o}=e,a=t.order;if(!(!d(a)&&qo(a)&&q(a.value)||!a&&q(Da("order",i,o)))){if((d(a)||To(a))&&!n)return Ma(a,{expr:"datum"});if(Wi(r)){const n="horizontal"===i.orient?"y":"x",r=t[n];if(To(r)){const t=r.sort;return d(t)?{field:Xo(r,{prefix:n,suffix:"sort_index",expr:"datum"})}:ko(t)?{field:Xo({aggregate:Pa(e.encoding)?t.op:void 0,field:t.field},{expr:"datum"})}:wo(t)?{field:Xo(e.fieldDef(t.encoding),{expr:"datum"}),order:t.order}:null===t?void 0:{field:Xo(r,{binSuffix:e.stack&&e.stack.impute?"mid":void 0,expr:"datum"})}}}}}(e),c=function(e){if(!e.component.selection)return null;const t=ne(e.component.selection).length;let n=t,r=e.parent;for(;r&&0===n;)n=ne(r.component.selection).length,r=r.parent;return n?{interactive:t>0||!!e.encoding.tooltip}:null}(e),f=Da("aria",r,o),h=Rg[n].postEncodingTransform?Rg[n].postEncodingTransform(e):null;return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:e.getName("marks"),type:Rg[n].vgMark},a?{clip:!0}:{}),s?{style:s}:{}),u?{key:u.field}:{}),l?{sort:l}:{}),c||{}),!1===f?{aria:f}:{}),{from:{data:t.fromPrefix+e.requestDataName(Wu.Main)},encode:{update:Rg[n].encodeEntry(e)}}),h?{transform:h}:{})]}class Ug extends tg{constructor(e,t,n,r={},i){super(e,"unit",t,n,i,void 0,Ns(e)?e.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection={},this.children=[];const o=Vi(e.mark)?Object.assign({},e.mark):{type:e.mark},a=o.type;void 0===o.filled&&(o.filled=function(e,t,{graticule:n}){if(n)return!1;const r=Ca("filled",e,t),i=e.type;return ye(r,i!==Bi&&i!==Ni&&i!==zi)}(o,i,{graticule:e.data&&qu(e.data)}));const s=this.encoding=Ia(e.encoding||{},a,o.filled,i);this.markDef=function(e,t,n){const r=Ci(e),i=Da("orient",r,n);if(r.orient=function(e,t,n){switch(e){case Bi:case Ii:case Ui:case Ri:case Ti:case $i:return}const{x:r,y:i,x2:o,y2:a}=t;switch(e){case ji:if(To(r)&&(Nn(r.bin)||To(i)&&i.aggregate&&!r.aggregate))return"vertical";if(To(i)&&(Nn(i.bin)||To(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o&&(To(r)&&r.type===Xr&&!$n(r.bin)||Lo(r)))return"horizontal";if(!a&&(To(i)&&i.type===Xr&&!$n(i.bin)||Lo(i)))return"vertical"}case zi:if(o&&(!To(r)||!Nn(r.bin))&&a&&(!To(i)||!Nn(i.bin)))return;case Mi:if(a)return To(i)&&Nn(i.bin)?"horizontal":"vertical";if(o)return To(r)&&Nn(r.bin)?"vertical":"horizontal";if(e===zi){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case Ni:case Pi:{const t=Po(r),o=Po(i);if(t&&!o)return"tick"!==e?"horizontal":"vertical";if(!t&&o)return"tick"!==e?"vertical":"horizontal";if(t&&o){const t=r,o=i,a=t.type===Jr,s=o.type===Jr;return a&&!s?"tick"!==e?"vertical":"horizontal":!a&&s?"tick"!==e?"horizontal":"vertical":!t.aggregate&&o.aggregate?"tick"!==e?"vertical":"horizontal":t.aggregate&&!o.aggregate?"tick"!==e?"horizontal":"vertical":n||"vertical"}return n||void 0}}return"vertical"}(r.type,t,i),void 0!==i&&i!==r.orient&&hr(`Specified orient "${r.orient}" overridden with "${i}".`),"bar"===r.type&&r.orient){const e=Da("cornerRadiusEnd",r,n);if(void 0!==e){const n="horizontal"===r.orient&&t.x2||"vertical"===r.orient&&t.y2?["cornerRadius"]:Ji[r.orient];for(const t of n)r[t]=e;void 0!==r.cornerRadiusEnd&&delete r.cornerRadiusEnd}}return void 0===Da("opacity",r,n)&&(r.opacity=function(e,t){if(W([Bi,Pi,Ii,Ui],e)&&!Pa(t))return.7}(r.type,t)),void 0===Da("cursor",r,n)&&(r.cursor=function(e,t,n){return t.href||e.href||Da("href",e,n)?"pointer":e.cursor}(r,t,n)),r}(o,s,i),this.size=function({encoding:e,size:t}){for(const n of cn){const r=Vt(n);$s(t[r])&&Po(e[n])&&(delete t[r],hr(ar(r)))}return t}({encoding:s,size:Ns(e)?Object.assign(Object.assign(Object.assign({},r),e.width?{width:e.width}:{}),e.height?{height:e.height}:{}):r}),this.stack=iu(a,s),this.specifiedScales=this.initScales(a,s),this.specifiedAxes=this.initAxes(s),this.specifiedLegends=this.initLegends(s),this.specifiedProjection=e.projection,this.selection=e.selection}get hasProjection(){const{encoding:e}=this,t=this.mark===qi,n=e&&Ot.some((t=>Io(e[t])));return t||n}scaleDomain(e){const t=this.specifiedScales[e];return t?t.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,t){return On.reduce(((e,n)=>{var r;const i=aa(t[n]);return i&&(e[n]=this.initScale(null!==(r=i.scale)&&void 0!==r?r:{})),e}),{})}initScale(e){const{domain:t,range:n}=e,r=Ci(e);return d(t)&&(r.domain=t.map(_a)),d(n)&&(r.range=n.map(_a)),r}initAxes(e){return cn.reduce(((t,n)=>{const r=e[n];if(Io(r)||n===Ge&&Io(e.x2)||n===Ve&&Io(e.y2)){const e=Io(r)?r.axis:void 0;t[n]=e?this.initAxis(Object.assign({},e)):e}return t}),{})}initAxis(e){const t=ne(e),n={};for(const r of t){const t=e[r];n[r]=Oe(t)?xa(t):_a(t)}return n}initLegends(e){return An.reduce(((t,n)=>{const r=aa(e[n]);if(r&&function(e){switch(e){case it:case ot:case at:case ut:case st:case ct:case ht:case pt:return!0;case ft:case dt:case lt:return!1}}(n)){const e=r.legend;t[n]=e?Ci(e):e}return t}),{})}parseData(){this.component.data=Eg(this)}parseLayoutSize(){!function(e){const{size:t,component:n}=e;for(const r of cn){const i=Vt(r);if(t[i]){const e=t[i];n.layoutSize.set(i,$s(e)?"step":e,!0)}else{const t=_g(e,i);n.layoutSize.set(i,t,!1)}}}(this)}parseSelections(){this.component.selection=function(e,t){var n;const r={},i=e.config.selection;for(const o of ne(null!=t?t:{})){const a=R(t[o]),s=i[a.type],{fields:u,encodings:l}=s,c=Ed(s,["fields","encodings"]);for(const e in c)"encodings"===e&&a.fields||"fields"===e&&a.encodings||("mark"===e&&(a[e]=Object.assign(Object.assign({},c[e]),a[e])),void 0!==a[e]&&!0!==a[e]||(a[e]=null!==(n=c[e])&&void 0!==n?n:a[e]));const f=ae(o),d=r[f]=Object.assign(Object.assign({},a),{name:f,events:k(a.on)?_l(a.on,"scope"):R(a.on)});Ec(d,(n=>{n.has(d)&&n.parse&&n.parse(e,d,a,t[o])}))}return r}(this,this.selection)}parseMarkGroup(){this.component.mark=function(e){if(W([Ni,Mi,Li],e.mark)){const t=Wa(e.mark,e.encoding);if(t.length>0)return function(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:Pg+e.requestDataName(Wu.Main),data:e.requestDataName(Wu.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:Ig(e,{fromPrefix:Pg})}]}(e,t)}else if(W([ji],e.mark)){const t=Br.some((t=>Da(t,e.markDef,e.config)));if(e.stack&&!e.fieldDef("size")&&t)return function(e){const[t]=Ig(e,{fromPrefix:Lg}),n=e.scaleName(e.stack.fieldChannel),r=(t={})=>e.vgField(e.stack.fieldChannel,t),i=(e,t)=>`${e}(${[r({prefix:"min",suffix:"start",expr:t}),r({prefix:"max",suffix:"start",expr:t}),r({prefix:"min",suffix:"end",expr:t}),r({prefix:"max",suffix:"end",expr:t})].map((e=>`scale('${n}',${e})`)).join(",")})`;let o,a;"x"===e.stack.fieldChannel?(o=Object.assign(Object.assign({},P(t.encode.update,["y","yc","y2","height",...Br])),{x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}}),a={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update=Object.assign(Object.assign({},L(t.encode.update,["y","yc","y2"])),{height:{field:{group:"height"}}})):(o=Object.assign(Object.assign({},P(t.encode.update,["x","xc","x2","width"])),{y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}}),a={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update=Object.assign(Object.assign({},L(t.encode.update,["x","xc","x2"])),{width:{field:{group:"width"}}}));for(const n of Br){const r=Ca(n,e.markDef,e.config);t.encode.update[n]?(o[n]=t.encode.update[n],delete t.encode.update[n]):r&&(o[n]=ka(r)),r&&(t.encode.update[n]={value:0})}const s=e.fieldDef(e.stack.groupbyChannel),u=Xo(s)?[Xo(s)]:[];return((null==s?void 0:s.bin)||(null==s?void 0:s.timeUnit))&&u.push(Xo(s,{binSuffix:"end"})),o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce(((n,r)=>{if(t.encode.update[r])return Object.assign(Object.assign({},n),{[r]:t.encode.update[r]});{const t=Ca(r,e.markDef,e.config);return void 0!==t?Object.assign(Object.assign({},n),{[r]:ka(t)}):n}}),o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Wu.Main),name:Lg+e.requestDataName(Wu.Main),groupby:u,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:a},marks:[t]}]}]}(e)}return Ig(e)}(this)}parseAxesAndHeaders(){var e;this.component.axes=(e=this,cn.reduce(((t,n)=>(e.component.scales[n]&&(t[n]=[Bg(n,e)]),t)),{}))}assembleSelectionTopLevelSignals(e){return function(e,t){let n=!1;return Lc(e,((r,i)=>{const o=r.name,a=A(o+Tc);if(0===t.filter((e=>e.name===o)).length){const e="global"===r.resolve?"union":r.resolve,n="multi"===r.type?", true)":")";t.push({name:r.name,update:`${Rc}(${a}, ${A(e)}${n}`})}n=!0,i.topLevelSignals&&(t=i.topLevelSignals(e,r,t)),Ec(r,(n=>{n.topLevelSignals&&(t=n.topLevelSignals(e,r,t))}))})),n&&0===t.filter((e=>"unit"===e.name)).length&&t.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]}),Cc(t)}(this,e)}assembleSignals(){return[...jd(this),...(e=this,t=[],Lc(e,((n,r)=>{const i=n.name;let o=r.modifyExpr(e,n);t.push(...r.signals(e,n)),Ec(n,(r=>{r.signals&&(t=r.signals(e,n,t)),r.modifyExpr&&(o=r.modifyExpr(e,n,o))})),t.push({name:i+"_modify",on:[{events:{signal:n.name+zc},update:`modify(${A(n.name+Tc)}, ${o})`}]})})),Cc(t))];var e,t}assembleSelectionData(e){return function(e,t){const n=[...t];return Lc(e,(t=>{const r={name:t.name+Tc};if(t.init){const n=t.project.items.map((e=>{const{signals:t}=e;return function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);iOc(e,!1)));r.values="interval"===t.type?[{unit:Ic(e,{escape:!1}),fields:n,values:i}]:i.map((t=>({unit:Ic(e,{escape:!1}),fields:n,values:t})))}n.filter((e=>e.name===t.name+Tc)).length||n.push(r)})),n}(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return ih(this)}assembleMarks(){var e;let t=null!==(e=this.component.mark)&&void 0!==e?e:[];return this.parent&&Qp(this.parent)||(t=Dc(this,t)),t.map(this.correctDataNames)}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return Ra(this.encoding,e)}fieldDef(e){return oa(this.encoding[e])}typedFieldDef(e){const t=this.fieldDef(e);return Uo(t)?t:null}}class qg extends eg{constructor(e,t,n,r,i){super(e,"layer",t,n,i,e.resolve,e.view);const o=Object.assign(Object.assign(Object.assign({},r),e.width?{width:e.width}:{}),e.height?{height:e.height}:{});this.children=e.layer.map(((e,t)=>{if(Ks(e))return new qg(e,this,this.getName("layer_"+t),o,i);if(Ba(e))return new Ug(e,this,this.getName("layer_"+t),o,i);throw new Error(Rn(e))}))}parseData(){this.component.data=Eg(this);for(const e of this.children)e.parseData()}parseLayoutSize(){bg(this),xg(this,"width"),xg(this,"height")}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of ne(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){!function(e){var t;const{axes:n,resolve:r}=e.component,i={top:0,bottom:0,right:0,left:0};for(const t of e.children){t.parseAxesAndHeaders();for(const i of ne(t.component.axes))r.axis[i]=fh(e.component.resolve,i),"shared"===r.axis[i]&&(n[i]=Mg(n[i],t.component.axes[i]),n[i]||(r.axis[i]="independent",delete n[i]))}for(const o of cn){for(const a of e.children)if(a.component.axes[o]){if("independent"===r.axis[o]){n[o]=(null!==(t=n[o])&&void 0!==t?t:[]).concat(a.component.axes[o]);for(const e of a.component.axes[o]){const{value:t,explicit:n}=e.getWithExplicit("orient");if(!Fr(t)){if(i[t]>0&&!n){const n=Fg[t];i[t]>i[n]&&e.set("orient",n,!1)}i[t]++}}}delete a.component.axes[o]}if("independent"===r.axis[o]&&n[o]&&n[o].length>1)for(const e of n[o])e.get("grid")&&!e.explicit.grid&&(e.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleSignals())),jd(this))}assembleLayoutSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleLayoutSignals())),ih(this))}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const t of this.children)if(e=t.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return function(e,t){for(const n of e.children)Zp(n)&&(t=Dc(n,t));return t}(this,this.children.flatMap((e=>e.assembleMarks())))}assembleLegends(){return this.children.reduce(((e,t)=>e.concat(t.assembleLegends())),Dh(this))}}function Wg(e,t,n,r,i){if(Do(e))return new kg(e,t,n,i);if(Ks(e))return new qg(e,t,n,r,i);if(Ba(e))return new Ug(e,t,n,r,i);if(function(e){return Ms(e)||js(e)||Fs(e)}(e))return new Og(e,t,n,i);throw new Error(Rn(e))}var Hg=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1)));const{params:f}=t,d=Hg(t,["params"]);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({$schema:"https://vega.github.io/schema/vega/v5.json"},e.description?{description:e.description}:{}),d),s?{title:s}:{}),u?{style:u}:{}),l?{encode:{update:l}}:{}),{data:o}),a.length>0?{projections:a}:{}),e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([]),...Es(f)])),i?{config:i}:{}),r?{usermeta:r}:{})}(i,function(e,t,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");if(void 0===t?(t={type:"pad"},r.hasAxisOrientSignalRef()&&(t.resize=!0)):k(t)&&(t={type:t}),i&&o&&("fit"===(a=t.type)||"fit-x"===a||"fit-y"===a))if("step"===i&&"step"===o)hr(Un()),t.type="pad";else if("step"===i||"step"===o){const e="step"===i?"width":"height";hr(Un(pn(e)));const n="width"===e?"height":"width";t.type=function(e){return e?`fit-${pn(e)}`:"fit"}(n)}var a;return Object.assign(Object.assign(Object.assign({},1===ne(t).length&&t.type?"pad"===t.type?{}:{autosize:t.type}:{autosize:t}),Su(n,!1)),Su(e,!0))}(e,r.autosize,n,i),e.datasets,e.usermeta);return{spec:o,normalized:r}}finally{t.logger&&(dr=fr),t.fieldTitle&&ea(Ko)}}},190:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Bounds:()=>am,CanvasHandler:()=>Uv,CanvasRenderer:()=>Yv,DATE:()=>Mn,DAY:()=>jn,DAYOFYEAR:()=>$n,Dataflow:()=>Ca,Debug:()=>B,Error:()=>j,EventStream:()=>pa,Gradient:()=>cg,GroupItem:()=>um,HOURS:()=>Nn,Handler:()=>bv,HybridHandler:()=>Pb,HybridRenderer:()=>Rb,Info:()=>N,Item:()=>sm,MILLISECONDS:()=>zn,MINUTES:()=>Bn,MONTH:()=>Sn,Marks:()=>rv,MultiPulse:()=>Aa,None:()=>M,Operator:()=>fa,Parameters:()=>ua,Pulse:()=>xa,QUARTER:()=>Cn,RenderType:()=>qb,Renderer:()=>_v,ResourceLoader:()=>lm,SECONDS:()=>Tn,SVGHandler:()=>Zv,SVGRenderer:()=>wb,SVGStringRenderer:()=>Bb,Scenegraph:()=>fv,TIME_UNITS:()=>Rn,Transform:()=>Fa,View:()=>iN,WEEK:()=>Fn,Warn:()=>$,YEAR:()=>Dn,accessor:()=>g,accessorFields:()=>y,accessorName:()=>m,array:()=>ue,ascending:()=>he,bandwidthNRD:()=>Ga,bin:()=>Va,bootstrapCI:()=>Za,boundClip:()=>Jb,boundContext:()=>Fm,boundItem:()=>iv,boundMark:()=>av,boundStroke:()=>dm,changeset:()=>aa,clampRange:()=>le,codegenExpression:()=>GF,compare:()=>de,constant:()=>ye,cumulativeLogNormal:()=>fs,cumulativeNormal:()=>os,cumulativeUniform:()=>ys,dayofyear:()=>Hn,debounce:()=>ve,defaultLocale:()=>vo,definition:()=>ja,densityLogNormal:()=>cs,densityNormal:()=>is,densityUniform:()=>ms,domChild:()=>gv,domClear:()=>mv,domCreate:()=>hv,domFind:()=>pv,dotbin:()=>Ja,error:()=>_,expressionFunction:()=>r$,extend:()=>be,extent:()=>xe,extentIndex:()=>_e,falsy:()=>S,fastmap:()=>Ee,field:()=>k,flush:()=>Oe,font:()=>Xy,fontFamily:()=>Yy,fontSize:()=>qy,format:()=>Uo,formatLocale:()=>lo,formats:()=>qo,hasOwnProperty:()=>ke,id:()=>A,identity:()=>E,inferType:()=>Bo,inferTypes:()=>To,ingest:()=>ea,inherits:()=>De,inrange:()=>Ce,interpolate:()=>$p,interpolateColors:()=>Fp,interpolateRange:()=>Sp,intersect:()=>Gb,intersectBoxLine:()=>Im,intersectPath:()=>zm,intersectPoint:()=>Rm,intersectRule:()=>Lm,isArray:()=>z,isBoolean:()=>Se,isDate:()=>Fe,isFunction:()=>ce,isIterable:()=>Me,isNumber:()=>je,isObject:()=>R,isRegExp:()=>$e,isString:()=>Ne,isTuple:()=>Jo,key:()=>Be,lerp:()=>Te,lineHeight:()=>Wy,loader:()=>Go,locale:()=>yo,logger:()=>T,lruCache:()=>Re,markup:()=>pb,merge:()=>Pe,mergeConfig:()=>L,multiLineOffset:()=>Gy,one:()=>D,pad:()=>Ie,panLinear:()=>J,panLog:()=>K,panPow:()=>Q,panSymlog:()=>ee,parse:()=>$R,parseExpression:()=>qF,parseSelector:()=>wN,path:()=>dc,pathCurves:()=>dg,pathEqual:()=>ex,pathParse:()=>vg,pathRectangle:()=>Ug,pathRender:()=>Sg,pathSymbols:()=>$g,pathTrail:()=>qg,peek:()=>q,point:()=>vv,projection:()=>ZA,quantileLogNormal:()=>ds,quantileNormal:()=>as,quantileUniform:()=>vs,quantiles:()=>Wa,quantizeInterpolator:()=>Mp,quarter:()=>ae,quartiles:()=>Ha,random:()=>Ya,randomInteger:()=>Qa,randomKDE:()=>us,randomLCG:()=>Ka,randomLogNormal:()=>hs,randomMixture:()=>ps,randomNormal:()=>ss,randomUniform:()=>bs,read:()=>Ho,regressionConstant:()=>xs,regressionExp:()=>Ds,regressionLinear:()=>Es,regressionLoess:()=>Ns,regressionLog:()=>Os,regressionPoly:()=>Fs,regressionPow:()=>Cs,regressionQuad:()=>Ss,renderModule:()=>Hb,repeat:()=>Le,resetDefaultLocale:()=>bo,resetSVGClipId:()=>im,resetSVGDefIds:()=>tx,responseType:()=>Wo,runtimeContext:()=>h$,sampleCurve:()=>Rs,sampleLogNormal:()=>ls,sampleNormal:()=>rs,sampleUniform:()=>gs,scale:()=>bp,sceneEqual:()=>Qb,sceneFromJSON:()=>lv,scenePickVisit:()=>Km,sceneToJSON:()=>uv,sceneVisit:()=>Jm,sceneZOrder:()=>Zm,scheme:()=>zp,serializeXML:()=>gb,setHybridRendererOptions:()=>zb,setRandom:()=>Xa,span:()=>Ue,splitAccessPath:()=>w,stringValue:()=>qe,textMetrics:()=>zy,timeBin:()=>Fr,timeFloor:()=>sr,timeFormatLocale:()=>go,timeInterval:()=>hr,timeOffset:()=>mr,timeSequence:()=>br,timeUnitSpecifier:()=>Un,timeUnits:()=>Ln,toBoolean:()=>We,toDate:()=>Ge,toNumber:()=>W,toSet:()=>Ye,toString:()=>Ve,transform:()=>$a,transforms:()=>Ma,truncate:()=>Xe,truthy:()=>C,tupleid:()=>Ko,typeParsers:()=>jo,utcFloor:()=>cr,utcInterval:()=>pr,utcOffset:()=>yr,utcSequence:()=>xr,utcdayofyear:()=>Jn,utcquarter:()=>se,utcweek:()=>Kn,version:()=>NR,visitArray:()=>Ze,week:()=>Gn,writeConfig:()=>I,zero:()=>O,zoomLinear:()=>ne,zoomLog:()=>re,zoomPow:()=>ie,zoomSymlog:()=>oe});var r={};n.r(r),n.d(r,{aggregate:()=>nu,bin:()=>ru,collect:()=>ou,compare:()=>au,countpattern:()=>uu,cross:()=>lu,density:()=>hu,dotbin:()=>vu,expression:()=>bu,extent:()=>_u,facet:()=>ku,field:()=>Au,filter:()=>Ou,flatten:()=>Du,fold:()=>Cu,formula:()=>Su,generate:()=>Fu,impute:()=>$u,joinaggregate:()=>Nu,kde:()=>Bu,key:()=>Tu,load:()=>Ru,lookup:()=>Lu,multiextent:()=>Iu,multivalues:()=>qu,params:()=>Hu,pivot:()=>Gu,prefacet:()=>Vu,project:()=>Yu,proxy:()=>Xu,quantile:()=>Zu,relay:()=>Ju,sample:()=>Ku,sequence:()=>Qu,sieve:()=>el,subflow:()=>wu,timeunit:()=>tl,tupleindex:()=>rl,values:()=>il,window:()=>ll});var i={};n.r(i),n.d(i,{interpolate:()=>Tf,interpolateArray:()=>Cf,interpolateBasis:()=>mf,interpolateBasisClosed:()=>yf,interpolateCubehelix:()=>Fh,interpolateCubehelixLong:()=>Mh,interpolateDate:()=>Ff,interpolateDiscrete:()=>Td,interpolateHcl:()=>yh,interpolateHclLong:()=>vh,interpolateHsl:()=>Yd,interpolateHslLong:()=>Xd,interpolateHue:()=>zd,interpolateLab:()=>gh,interpolateNumber:()=>Mf,interpolateNumberArray:()=>Of,interpolateObject:()=>jf,interpolateRgb:()=>wf,interpolateRgbBasis:()=>Af,interpolateRgbBasisClosed:()=>Ef,interpolateRound:()=>zf,interpolateString:()=>Bf,interpolateTransformCss:()=>qd,interpolateTransformSvg:()=>Wd,interpolateZoom:()=>Gd,piecewise:()=>Ed,quantize:()=>jh});var o={};n.r(o),n.d(o,{bound:()=>Sx,identifier:()=>jx,mark:()=>$x,overlap:()=>Nx,render:()=>Ix,viewlayout:()=>u_});var a={};n.r(a),n.d(a,{axisticks:()=>c_,datajoin:()=>f_,encode:()=>h_,legendentries:()=>p_,linkpath:()=>b_,pie:()=>A_,scale:()=>D_,sortitems:()=>M_,stack:()=>T_});var s={};n.r(s),n.d(s,{contour:()=>vE,geojson:()=>_E,geopath:()=>wE,geopoint:()=>kE,geoshape:()=>AE,graticule:()=>EE,heatmap:()=>OE,isocontour:()=>uE,kde2d:()=>gE,projection:()=>CE});var u={};n.r(u),n.d(u,{force:()=>kO});var l={};n.r(l),n.d(l,{nest:()=>DD,pack:()=>$D,partition:()=>BD,stratify:()=>TD,tree:()=>PD,treelinks:()=>LD,treemap:()=>qD});var c={};n.r(c),n.d(c,{label:()=>fC});var f={};n.r(f),n.d(f,{loess:()=>hC,regression:()=>gC});var d={};n.r(d),n.d(d,{voronoi:()=>HC});var h={};n.r(h),n.d(h,{wordcloud:()=>aS});var p={};function g(e,t,n){return e.fields=t||[],e.fname=n,e}function m(e){return null==e?null:e.fname}function y(e){return null==e?null:e.fields}function v(e){return 1===e.length?b(e[0]):x(e)}n.r(p),n.d(p,{crossfilter:()=>hS,resolvefilter:()=>pS});const b=e=>function(t){return t[e]},x=e=>{const t=e.length;return function(n){for(let r=0;rr&&l(),s=r=i+1):"]"===o&&(s||_("Access path missing open bracket: "+e),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&_("Access path missing closing bracket: "+e),a&&_("Access path missing closing quote: "+e),i>r&&(i++,l()),t}function k(e,t,n){const r=w(e);return e=1===r.length?r[0]:e,g((n&&n.get||v)(r),[e],t||e)}const A=k("id"),E=g((e=>e),[],"identity"),O=g((()=>0),[],"zero"),D=g((()=>1),[],"one"),C=g((()=>!0),[],"true"),S=g((()=>!1),[],"false");function F(e,t,n){const r=[t].concat([].slice.call(n));console[e].apply(console,r)}const M=0,j=1,$=2,N=3,B=4;function T(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:F,r=e||M;return{level(e){return arguments.length?(r=+e,this):r},error(){return r>=j&&n(t||"error","ERROR",arguments),this},warn(){return r>=$&&n(t||"warn","WARN",arguments),this},info(){return r>=N&&n(t||"log","INFO",arguments),this},debug(){return r>=B&&n(t||"log","DEBUG",arguments),this}}}var z=Array.isArray;function R(e){return e===Object(e)}const P=e=>"__proto__"!==e;function L(){for(var e=arguments.length,t=new Array(e),n=0;n{for(const n in t)if("signals"===n)e.signals=U(e.signals,t.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;I(e,n,t[n],r)}return e}),{})}function I(e,t,n,r){if(!P(t))return;let i,o;if(R(n)&&!z(n))for(i in o=R(e[t])?e[t]:e[t]={},n)r&&(!0===r||r[i])?I(o,i,n[i]):P(i)&&(o[i]=n[i]);else e[t]=n}function U(e,t){if(null==e)return t;const n={},r=[];function i(e){n[e.name]||(n[e.name]=1,r.push(e))}return t.forEach(i),e.forEach(i),r}function q(e){return e[e.length-1]}function W(e){return null==e||""===e?null:+e}const H=e=>t=>e*Math.exp(t),G=e=>t=>Math.log(e*t),V=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),Y=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,X=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function Z(e,t,n,r){const i=n(e[0]),o=n(q(e)),a=(o-i)*t;return[r(i-a),r(o-a)]}function J(e,t){return Z(e,t,W,E)}function K(e,t){var n=Math.sign(e[0]);return Z(e,t,G(n),H(n))}function Q(e,t,n){return Z(e,t,X(n),X(1/n))}function ee(e,t,n){return Z(e,t,V(n),Y(n))}function te(e,t,n,r,i){const o=r(e[0]),a=r(q(e)),s=null!=t?r(t):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function ne(e,t,n){return te(e,t,n,W,E)}function re(e,t,n){const r=Math.sign(e[0]);return te(e,t,n,G(r),H(r))}function ie(e,t,n,r){return te(e,t,n,X(r),X(1/r))}function oe(e,t,n,r){return te(e,t,n,V(r),Y(r))}function ae(e){return 1+~~(new Date(e).getMonth()/3)}function se(e){return 1+~~(new Date(e).getUTCMonth()/3)}function ue(e){return null!=e?z(e)?e:[e]:[]}function le(e,t,n){let r,i=e[0],o=e[1];return o=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-r),i+r]}function ce(e){return"function"==typeof e}const fe="descending";function de(e,t,n){n=n||{},t=ue(t)||[];const r=[],i=[],o={},a=n.comparator||pe;return ue(e).forEach(((e,a)=>{null!=e&&(r.push(t[a]===fe?-1:1),i.push(e=ce(e)?e:k(e,null,n)),(y(e)||[]).forEach((e=>o[e]=1)))})),0===i.length?null:g(a(i,r),Object.keys(o))}const he=(e,t)=>(et||null==t)&&null!=e?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t==t?-1:t!=t&&e==e?1:0),pe=(e,t)=>1===e.length?ge(e[0],t[0]):me(e,t,e.length),ge=(e,t)=>function(n,r){return he(e(n),e(r))*t},me=(e,t,n)=>(t.push(0),function(r,i){let o,a=0,s=-1;for(;0===a&&++se}function ve(e,t){let n;return r=>{n&&clearTimeout(n),n=setTimeout((()=>(t(r),n=null)),e)}}function be(e){for(let t,n,r=1,i=arguments.length;ro&&(o=r))}else{for(r=t(e[a]);ao&&(o=r))}return[i,o]}function _e(e,t){const n=e.length;let r,i,o,a,s,u=-1;if(null==t){for(;++u=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++ui&&(r=i,a=u),o=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++ui&&(r=i,a=u),or(e)?n[e]:void 0,set(e,t){return r(e)||(++i.size,n[e]===Ae&&--i.empty),n[e]=t,this},delete(e){return r(e)&&(--i.size,++i.empty,n[e]=Ae),this},clear(){i.size=i.empty=0,i.object=n={}},test(e){return arguments.length?(t=e,i):t},clean(){const e={};let r=0;for(const i in n){const o=n[i];o===Ae||t&&t(o)||(e[i]=o,++r)}i.size=r,i.empty=0,i.object=n=e}};return e&&Object.keys(e).forEach((t=>{i.set(t,e[t])})),i}function Oe(e,t,n,r,i,o){if(!n&&0!==n)return o;const a=+n;let s,u=e[0],l=q(e);la&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=e:oe.replace(/\\(.)/g,"$1"))):ue(e));const r=e&&e.length,i=n&&n.get||v,o=e=>i(t?[e]:w(e));let a;if(r)if(1===r){const t=o(e[0]);a=function(e){return""+t(e)}}else{const t=e.map(o);a=function(e){let n=""+t[0](e),i=0;for(;++i{t={},n={},r=0},o=(i,o)=>(++r>e&&(n=t,t={},r=1),t[i]=o);return i(),{clear:i,has:e=>ke(t,e)||ke(n,e),get:e=>ke(t,e)?t[e]:ke(n,e)?o(e,n[e]):void 0,set:(e,n)=>ke(t,e)?t[e]=n:o(e,n)}}function Pe(e,t,n,r){const i=t.length,o=n.length;if(!o)return t;if(!i)return n;const a=r||new t.constructor(i+o);let s=0,u=0,l=0;for(;s0?n[u++]:t[s++];for(;s=0;)n+=e;return n}function Ie(e,t,n,r){const i=n||" ",o=e+"",a=t-o.length;return a<=0?o:"left"===r?Le(i,a)+o:"center"===r?Le(i,~~(a/2))+o+Le(i,Math.ceil(a/2)):o+Le(i,a)}function Ue(e){return e&&q(e)-e[0]||0}function qe(e){return z(e)?"["+e.map(qe)+"]":R(e)||Ne(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function We(e){return null==e||""===e?null:!(!e||"false"===e||"0"===e||!e)}const He=e=>je(e)||Fe(e)?e:Date.parse(e);function Ge(e,t){return t=t||He,null==e||""===e?null:t(e)}function Ve(e){return null==e||""===e?null:e+""}function Ye(e){const t={},n=e.length;for(let r=0;r=o?u=!0:(r=e.charCodeAt(a++))===et?l=!0:r===tt&&(l=!0,e.charCodeAt(a)===et&&++a),e.slice(i+1,t-1).replace(/""/g,'"')}for(;a9999?"+"+it(t,6):it(t,4))+"-"+it(e.getUTCMonth()+1,2)+"-"+it(e.getUTCDate(),2)+(o?"T"+it(n,2)+":"+it(r,2)+":"+it(i,2)+"."+it(o,3)+"Z":i?"T"+it(n,2)+":"+it(r,2)+":"+it(i,2)+"Z":r||n?"T"+it(n,2)+":"+it(r,2)+"Z":"")}(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function(e,t){var n,i,o=r(e,(function(e,r){if(n)return n(e,r-1);i=e,n=t?function(e,t){var n=nt(e);return function(r,i){return t(n(r),i,e)}}(e,t):nt(e)}));return o.columns=i||[],o},parseRows:r,format:function(t,n){return null==n&&(n=rt(t)),[n.map(a).join(e)].concat(i(t,n)).join("\n")},formatBody:function(e,t){return null==t&&(t=rt(e)),i(e,t).join("\n")},formatRows:function(e){return e.map(o).join("\n")},formatRow:o,formatValue:a}}function at(e){return e}function st(e,t){return"string"==typeof t&&(t=e.objects[t]),"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map((function(t){return ut(e,t)}))}:ut(e,t)}function ut(e,t){var n=t.id,r=t.bbox,i=null==t.properties?{}:t.properties,o=lt(e,t);return null==n&&null==r?{type:"Feature",properties:i,geometry:o}:null==r?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}function lt(e,t){var n=function(e){if(null==e)return at;var t,n,r=e.scale[0],i=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=n=0);var u=2,l=e.length,c=new Array(l);for(c[0]=(t+=e[0])*r+o,c[1]=(n+=e[1])*i+a;u1)r=function(e,t,n){var r,i=[],o=[];function a(e){var t=e<0?~e:e;(o[t]||(o[t]=[])).push({i:e,g:r})}function s(e){e.forEach(a)}function u(e){e.forEach(s)}return function e(t){switch(r=t,t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"LineString":s(t.arcs);break;case"MultiLineString":case"Polygon":u(t.arcs);break;case"MultiPolygon":!function(e){e.forEach(u)}(t.arcs)}}(t),o.forEach(null==n?function(e){i.push(e[0].i)}:function(e){n(e[0].g,e[e.length-1].g)&&i.push(e[0].i)}),i}(0,t,n);else for(i=0,r=new Array(o=e.arcs.length);i=ht?10:o>=pt?5:o>=gt?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(e*l),u=Math.round(t*l),s/lt&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(e/l),u=Math.round(t/l),s*lt&&--u),u0))return[];if((e=+e)==(t=+t))return[e];const r=t=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let e=0;e=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function wt(e){if(!(t=_t.exec(e)))throw new Error("invalid format: "+e);var t;return new kt({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function kt(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function At(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Et(e){return(e=At(Math.abs(e)))?e[1]:NaN}function Ot(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Et(t)/3)))-Et(Math.abs(e)))}function Dt(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Et(t)-Et(e))+1}function Ct(e){return Math.max(0,-Et(Math.abs(e)))}function St(e,t){var n=At(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}wt.prototype=kt.prototype,kt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Ft={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>St(100*e,t),r:St,s:function(e,t){var n=At(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(xt=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+At(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Mt(e){return e}var jt,$t,Nt,Bt=Array.prototype.map,Tt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function zt(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?Mt:(t=Bt.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(e.substring(i-=s,i+s)),!((u+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?Mt:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(Bt.call(e.numerals,String)),u=void 0===e.percent?"%":e.percent+"",l=void 0===e.minus?"−":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function f(e){var t=(e=wt(e)).fill,n=e.align,f=e.sign,d=e.symbol,h=e.zero,p=e.width,g=e.comma,m=e.precision,y=e.trim,v=e.type;"n"===v?(g=!0,v="g"):Ft[v]||(void 0===m&&(m=12),y=!0,v="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var b="$"===d?i:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===d?o:/[%p]/.test(v)?u:"",_=Ft[v],w=/[defgprs%]/.test(v);function k(e){var i,o,u,d=b,k=x;if("c"===v)k=_(e)+k,e="";else{var A=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:_(Math.abs(e),m),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),A&&0==+e&&"+"!==f&&(A=!1),d=(A?"("===f?f:l:"-"===f||"("===f?"":f)+d,k=("s"===v?Tt[8+xt/3]:"")+k+(A&&"("===f?")":""),w)for(i=-1,o=e.length;++i(u=e.charCodeAt(i))||u>57){k=(46===u?a+e.slice(i+1):e.slice(i))+k,e=e.slice(0,i);break}}g&&!h&&(e=r(e,1/0));var E=d.length+e.length+k.length,O=E>1)+d+e+k+O.slice(E);break;default:e=O+d+e+k}return s(e)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),k.toString=function(){return e+""},k}return{format:f,formatPrefix:function(e,t){var n=f(((e=wt(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(Et(t)/3))),i=Math.pow(10,-r),o=Tt[8+r/3];return function(e){return n(i*e)+o}}}}jt=zt({thousands:",",grouping:[3],currency:["$",""]}),$t=jt.format,Nt=jt.formatPrefix;const Rt=new Date,Pt=new Date;function Lt(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(sLt((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})),n&&(i.count=(t,r)=>(Rt.setTime(+t),Pt.setTime(+r),e(Rt),e(Pt),Math.floor(n(Rt,Pt))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e==0:t=>i.count(0,t)%e==0):i:null)),i}const It=1e3,Ut=6e4,qt=36e5,Wt=864e5,Ht=6048e5,Gt=31536e6,Vt=Lt((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ut)/Wt),(e=>e.getDate()-1)),Yt=(Vt.range,Lt((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/Wt),(e=>e.getUTCDate()-1))),Xt=(Yt.range,Lt((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/Wt),(e=>Math.floor(e/Wt))));function Zt(e){return Lt((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ut)/Ht))}Xt.range;const Jt=Zt(0),Kt=Zt(1),Qt=Zt(2),en=Zt(3),tn=Zt(4),nn=Zt(5),rn=Zt(6);function on(e){return Lt((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/Ht))}Jt.range,Kt.range,Qt.range,en.range,tn.range,nn.range,rn.range;const an=on(0),sn=on(1),un=on(2),ln=on(3),cn=on(4),fn=on(5),dn=on(6),hn=(an.range,sn.range,un.range,ln.range,cn.range,fn.range,dn.range,Lt((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear())));hn.every=e=>isFinite(e=Math.floor(e))&&e>0?Lt((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,hn.range;const pn=Lt((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));pn.every=e=>isFinite(e=Math.floor(e))&&e>0?Lt((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,pn.range;const gn=Lt((e=>{e.setDate(1),e.setHours(0,0,0,0)}),((e,t)=>{e.setMonth(e.getMonth()+t)}),((e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())),(e=>e.getMonth())),mn=(gn.range,Lt((e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)}),((e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())),(e=>e.getUTCMonth()))),yn=(mn.range,Lt((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*It-e.getMinutes()*Ut)}),((e,t)=>{e.setTime(+e+t*qt)}),((e,t)=>(t-e)/qt),(e=>e.getHours()))),vn=(yn.range,Lt((e=>{e.setUTCMinutes(0,0,0)}),((e,t)=>{e.setTime(+e+t*qt)}),((e,t)=>(t-e)/qt),(e=>e.getUTCHours()))),bn=(vn.range,Lt((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*It)}),((e,t)=>{e.setTime(+e+t*Ut)}),((e,t)=>(t-e)/Ut),(e=>e.getMinutes()))),xn=(bn.range,Lt((e=>{e.setUTCSeconds(0,0)}),((e,t)=>{e.setTime(+e+t*Ut)}),((e,t)=>(t-e)/Ut),(e=>e.getUTCMinutes()))),_n=(xn.range,Lt((e=>{e.setTime(e-e.getMilliseconds())}),((e,t)=>{e.setTime(+e+t*It)}),((e,t)=>(t-e)/It),(e=>e.getUTCSeconds()))),wn=(_n.range,Lt((()=>{}),((e,t)=>{e.setTime(+e+t)}),((e,t)=>t-e)));function kn(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function An(e,t){return null==e||null==t?NaN:te?1:t>=e?0:NaN}function En(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i>>1;n(e[t],r)<0?i=t+1:o=t}while(ikn(e(t),n),r=(t,n)=>e(t)-n):(t=e===kn||e===An?e:On,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i>>1;n(e[t],r)<=0?i=t+1:o=t}while(i(e=Math.floor(e),isFinite(e)&&e>0?e>1?Lt((t=>{t.setTime(Math.floor(t/e)*e)}),((t,n)=>{t.setTime(+t+n*e)}),((t,n)=>(n-t)/e)):wn:null),wn.range;const Dn="year",Cn="quarter",Sn="month",Fn="week",Mn="date",jn="day",$n="dayofyear",Nn="hours",Bn="minutes",Tn="seconds",zn="milliseconds",Rn=[Dn,Cn,Sn,Fn,Mn,jn,$n,Nn,Bn,Tn,zn],Pn=Rn.reduce(((e,t,n)=>(e[t]=1+n,e)),{});function Ln(e){const t=ue(e).slice(),n={};return t.length||_("Missing time unit."),t.forEach((e=>{ke(Pn,e)?n[e]=1:_(`Invalid time unit: ${e}.`)})),(n[Fn]||n[jn]?1:0)+(n[Cn]||n[Sn]||n[Mn]?1:0)+(n[$n]?1:0)>1&&_(`Incompatible time units: ${e}`),t.sort(((e,t)=>Pn[e]-Pn[t])),t}const In={[Dn]:"%Y ",[Cn]:"Q%q ",[Sn]:"%b ",[Mn]:"%d ",[Fn]:"W%U ",[jn]:"%a ",[$n]:"%j ",[Nn]:"%H:00",[Bn]:"00:%M",[Tn]:":%S",[zn]:".%L",[`${Dn}-${Sn}`]:"%Y-%m ",[`${Dn}-${Sn}-${Mn}`]:"%Y-%m-%d ",[`${Nn}-${Bn}`]:"%H:%M"};function Un(e,t){const n=be({},In,t),r=Ln(e),i=r.length;let o,a,s="",u=0;for(u=0;uu;--o)if(a=r.slice(u,o).join("-"),null!=n[a]){s+=n[a],u=o;break}return s.trim()}const qn=new Date;function Wn(e){return qn.setFullYear(e),qn.setMonth(0),qn.setDate(1),qn.setHours(0,0,0,0),qn}function Hn(e){return Vn(new Date(e))}function Gn(e){return Yn(new Date(e))}function Vn(e){return Vt.count(Wn(e.getFullYear())-1,e)}function Yn(e){return Jt.count(Wn(e.getFullYear())-1,e)}function Xn(e){return Wn(e).getDay()}function Zn(e,t,n,r,i,o,a){if(0<=e&&e<100){const s=new Date(-1,t,n,r,i,o,a);return s.setFullYear(e),s}return new Date(e,t,n,r,i,o,a)}function Jn(e){return Qn(new Date(e))}function Kn(e){return er(new Date(e))}function Qn(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Yt.count(t-1,e)}function er(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return an.count(t-1,e)}function tr(e){return qn.setTime(Date.UTC(e,0,1)),qn.getUTCDay()}function nr(e,t,n,r,i,o,a){if(0<=e&&e<100){const e=new Date(Date.UTC(-1,t,n,r,i,o,a));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(e,t,n,r,i,o,a))}function rr(e,t,n,r,i){const o=t||1,a=q(e),s=(e,t,i)=>function(e,t,n,r){const i=n<=1?e:r?(t,i)=>r+n*Math.floor((e(t,i)-r)/n):(t,r)=>n*Math.floor(e(t,r)/n);return t?(e,n)=>t(i(e,n),n):i}(n[i=i||e],r[i],e===a&&o,t),u=new Date,l=Ye(e),c=l[Dn]?s(Dn):ye(2012),f=l[Sn]?s(Sn):l[Cn]?s(Cn):O,d=l[Fn]&&l[jn]?s(jn,1,Fn+jn):l[Fn]?s(Fn,1):l[jn]?s(jn,1):l[Mn]?s(Mn,1):l[$n]?s($n,1):D,h=l[Nn]?s(Nn):O,p=l[Bn]?s(Bn):O,g=l[Tn]?s(Tn):O,m=l[zn]?s(zn):O;return function(e){u.setTime(+e);const t=c(u);return i(t,f(u),d(u,t),h(u),p(u),g(u),m(u))}}function ir(e,t,n){return t+7*e-(n+6)%7}const or={[Dn]:e=>e.getFullYear(),[Cn]:e=>Math.floor(e.getMonth()/3),[Sn]:e=>e.getMonth(),[Mn]:e=>e.getDate(),[Nn]:e=>e.getHours(),[Bn]:e=>e.getMinutes(),[Tn]:e=>e.getSeconds(),[zn]:e=>e.getMilliseconds(),[$n]:e=>Vn(e),[Fn]:e=>Yn(e),[Fn+jn]:(e,t)=>ir(Yn(e),e.getDay(),Xn(t)),[jn]:(e,t)=>ir(1,e.getDay(),Xn(t))},ar={[Cn]:e=>3*e,[Fn]:(e,t)=>ir(e,0,Xn(t))};function sr(e,t){return rr(e,t||1,or,ar,Zn)}const ur={[Dn]:e=>e.getUTCFullYear(),[Cn]:e=>Math.floor(e.getUTCMonth()/3),[Sn]:e=>e.getUTCMonth(),[Mn]:e=>e.getUTCDate(),[Nn]:e=>e.getUTCHours(),[Bn]:e=>e.getUTCMinutes(),[Tn]:e=>e.getUTCSeconds(),[zn]:e=>e.getUTCMilliseconds(),[$n]:e=>Qn(e),[Fn]:e=>er(e),[jn]:(e,t)=>ir(1,e.getUTCDay(),tr(t)),[Fn+jn]:(e,t)=>ir(er(e),e.getUTCDay(),tr(t))},lr={[Cn]:e=>3*e,[Fn]:(e,t)=>ir(e,0,tr(t))};function cr(e,t){return rr(e,t||1,ur,lr,nr)}const fr={[Dn]:hn,[Cn]:gn.every(3),[Sn]:gn,[Fn]:Jt,[Mn]:Vt,[jn]:Vt,[$n]:Vt,[Nn]:yn,[Bn]:bn,[Tn]:_n,[zn]:wn},dr={[Dn]:pn,[Cn]:mn.every(3),[Sn]:mn,[Fn]:an,[Mn]:Yt,[jn]:Yt,[$n]:Yt,[Nn]:vn,[Bn]:xn,[Tn]:_n,[zn]:wn};function hr(e){return fr[e]}function pr(e){return dr[e]}function gr(e,t,n){return e?e.offset(t,n):void 0}function mr(e,t,n){return gr(hr(e),t,n)}function yr(e,t,n){return gr(pr(e),t,n)}function vr(e,t,n,r){return e?e.range(t,n,r):void 0}function br(e,t,n,r){return vr(hr(e),t,n,r)}function xr(e,t,n,r){return vr(pr(e),t,n,r)}const _r=31536e6,wr=[Dn,Sn,Mn,Nn,Bn,Tn,zn],kr=wr.slice(0,-1),Ar=kr.slice(0,-1),Er=Ar.slice(0,-1),Or=Er.slice(0,-1),Dr=[Dn,Sn],Cr=[Dn],Sr=[[kr,1,1e3],[kr,5,5e3],[kr,15,15e3],[kr,30,3e4],[Ar,1,6e4],[Ar,5,3e5],[Ar,15,9e5],[Ar,30,18e5],[Er,1,36e5],[Er,3,108e5],[Er,6,216e5],[Er,12,432e5],[Or,1,864e5],[[Dn,Fn],1,6048e5],[Dr,1,2592e6],[Dr,3,7776e6],[Cr,1,_r]];function Fr(e){const t=e.extent,n=e.maxbins||40,r=Math.abs(Ue(t))/n;let i,o,a=En((e=>e[2])).right(Sr,r);return a===Sr.length?(i=Cr,o=bt(t[0]/_r,t[1]/_r,n)):a?(a=Sr[r/Sr[a-1][2]=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:to,s:no,S:wi,u:ki,U:Ai,V:Oi,w:Di,W:Ci,x:null,X:null,y:Si,Y:Mi,Z:$i,"%":eo},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return u[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:Ni,e:Ni,f:Pi,g:Zi,G:Ki,H:Bi,I:Ti,j:zi,L:Ri,m:Li,M:Ii,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:to,s:no,S:Ui,u:qi,U:Wi,V:Gi,w:Vi,W:Yi,x:null,X:null,y:Xi,Y:Ji,Z:Qi,"%":eo},_={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=g.exec(t.slice(n));return r?(e.m=m.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return A(e,t,n,r)},d:ii,e:ii,f:ci,g:ei,G:Qr,H:ai,I:ai,j:oi,L:li,m:ri,M:si,p:function(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=c.get(r[0].toLowerCase()),n+r[0].length):-1},q:ni,Q:di,s:hi,S:ui,u:Xr,U:Zr,V:Jr,w:Yr,W:Kr,x:function(e,t,r){return A(e,n,t,r)},X:function(e,t,n){return A(e,r,t,n)},y:ei,Y:Qr,Z:ti,"%":fi};function w(e,t){return function(n){var r,i,o,a=[],s=-1,u=0,l=e.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=jr($r(o.y,0,1))).getUTCDay(),r=i>4||0===i?sn.ceil(r):sn(r),r=Yt.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=Mr($r(o.y,0,1))).getDay(),r=i>4||0===i?Kt.ceil(r):Kt(r),r=Vt.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?jr($r(o.y,0,1)).getUTCDay():Mr($r(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,jr(o)):Mr(o)}}function A(e,t,n,r){for(var i,o,a=0,s=t.length,u=n.length;a=u)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=_[i in Lr?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=w(n,b),b.X=w(r,b),b.c=w(t,b),x.x=w(n,x),x.X=w(r,x),x.c=w(t,x),{format:function(e){var t=w(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=k(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=w(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=k(e+="",!0);return t.toString=function(){return e},t}}}var Br,Tr,zr,Rr,Pr,Lr={"-":"",_:" ",0:"0"},Ir=/^\s*\d+/,Ur=/^%/,qr=/[\\^$*+?|[\]().{}]/g;function Wr(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o[e.toLowerCase(),t])))}function Yr(e,t,n){var r=Ir.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Xr(e,t,n){var r=Ir.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Zr(e,t,n){var r=Ir.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Jr(e,t,n){var r=Ir.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Kr(e,t,n){var r=Ir.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Qr(e,t,n){var r=Ir.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function ei(e,t,n){var r=Ir.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ti(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function ni(e,t,n){var r=Ir.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function ri(e,t,n){var r=Ir.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function ii(e,t,n){var r=Ir.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function oi(e,t,n){var r=Ir.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ai(e,t,n){var r=Ir.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function si(e,t,n){var r=Ir.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function ui(e,t,n){var r=Ir.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function li(e,t,n){var r=Ir.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function ci(e,t,n){var r=Ir.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function fi(e,t,n){var r=Ur.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function di(e,t,n){var r=Ir.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function hi(e,t,n){var r=Ir.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function pi(e,t){return Wr(e.getDate(),t,2)}function gi(e,t){return Wr(e.getHours(),t,2)}function mi(e,t){return Wr(e.getHours()%12||12,t,2)}function yi(e,t){return Wr(1+Vt.count(hn(e),e),t,3)}function vi(e,t){return Wr(e.getMilliseconds(),t,3)}function bi(e,t){return vi(e,t)+"000"}function xi(e,t){return Wr(e.getMonth()+1,t,2)}function _i(e,t){return Wr(e.getMinutes(),t,2)}function wi(e,t){return Wr(e.getSeconds(),t,2)}function ki(e){var t=e.getDay();return 0===t?7:t}function Ai(e,t){return Wr(Jt.count(hn(e)-1,e),t,2)}function Ei(e){var t=e.getDay();return t>=4||0===t?tn(e):tn.ceil(e)}function Oi(e,t){return e=Ei(e),Wr(tn.count(hn(e),e)+(4===hn(e).getDay()),t,2)}function Di(e){return e.getDay()}function Ci(e,t){return Wr(Kt.count(hn(e)-1,e),t,2)}function Si(e,t){return Wr(e.getFullYear()%100,t,2)}function Fi(e,t){return Wr((e=Ei(e)).getFullYear()%100,t,2)}function Mi(e,t){return Wr(e.getFullYear()%1e4,t,4)}function ji(e,t){var n=e.getDay();return Wr((e=n>=4||0===n?tn(e):tn.ceil(e)).getFullYear()%1e4,t,4)}function $i(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Wr(t/60|0,"0",2)+Wr(t%60,"0",2)}function Ni(e,t){return Wr(e.getUTCDate(),t,2)}function Bi(e,t){return Wr(e.getUTCHours(),t,2)}function Ti(e,t){return Wr(e.getUTCHours()%12||12,t,2)}function zi(e,t){return Wr(1+Yt.count(pn(e),e),t,3)}function Ri(e,t){return Wr(e.getUTCMilliseconds(),t,3)}function Pi(e,t){return Ri(e,t)+"000"}function Li(e,t){return Wr(e.getUTCMonth()+1,t,2)}function Ii(e,t){return Wr(e.getUTCMinutes(),t,2)}function Ui(e,t){return Wr(e.getUTCSeconds(),t,2)}function qi(e){var t=e.getUTCDay();return 0===t?7:t}function Wi(e,t){return Wr(an.count(pn(e)-1,e),t,2)}function Hi(e){var t=e.getUTCDay();return t>=4||0===t?cn(e):cn.ceil(e)}function Gi(e,t){return e=Hi(e),Wr(cn.count(pn(e),e)+(4===pn(e).getUTCDay()),t,2)}function Vi(e){return e.getUTCDay()}function Yi(e,t){return Wr(sn.count(pn(e)-1,e),t,2)}function Xi(e,t){return Wr(e.getUTCFullYear()%100,t,2)}function Zi(e,t){return Wr((e=Hi(e)).getUTCFullYear()%100,t,2)}function Ji(e,t){return Wr(e.getUTCFullYear()%1e4,t,4)}function Ki(e,t){var n=e.getUTCDay();return Wr((e=n>=4||0===n?cn(e):cn.ceil(e)).getUTCFullYear()%1e4,t,4)}function Qi(){return"+0000"}function eo(){return"%"}function to(e){return+e}function no(e){return Math.floor(+e/1e3)}function ro(e){const t={};return n=>t[n]||(t[n]=e(n))}function io(e){const t=ro(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(e){const n=wt(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return r=t(n),i=t(".1f")(1)[1],e=>{const t=r(e),n=t.indexOf(i);if(n<0)return t;let o=function(e,t){let n,r=e.lastIndexOf("e");if(r>0)return r;for(r=e.length;--r>t;)if(n=e.charCodeAt(r),n>=48&&n<=57)return r+1}(t,n);const a=on;)if("0"!==t[o]){++o;break}return t.slice(0,o)+a}}return t(n);var r,i},formatSpan(e,r,i,o){o=wt(null==o?",f":o);const a=bt(e,r,i),s=Math.max(Math.abs(e),Math.abs(r));let u;if(null==o.precision)switch(o.type){case"s":return isNaN(u=Ot(a,s))||(o.precision=u),n(o,s);case"":case"e":case"g":case"p":case"r":isNaN(u=Dt(a,s))||(o.precision=u-("e"===o.type));break;case"f":case"%":isNaN(u=Ct(a))||(o.precision=u-2*("%"===o.type))}return t(o)}}}let oo,ao;function so(){return oo=io({format:$t,formatPrefix:Nt})}function uo(e){return io(zt(e))}function lo(e){return arguments.length?oo=uo(e):oo}function co(e,t,n){R(n=n||{})||_(`Invalid time multi-format specifier: ${n}`);const r=t(Tn),i=t(Bn),o=t(Nn),a=t(Mn),s=t(Fn),u=t(Sn),l=t(Cn),c=t(Dn),f=e(n[zn]||".%L"),d=e(n[Tn]||":%S"),h=e(n[Bn]||"%I:%M"),p=e(n[Nn]||"%I %p"),g=e(n[Mn]||n[jn]||"%a %d"),m=e(n[Fn]||"%b %d"),y=e(n[Sn]||"%B"),v=e(n[Cn]||"%B"),b=e(n[Dn]||"%Y");return e=>(r(e)Ne(e)?t(e):co(t,hr,e),utcFormat:e=>Ne(e)?n(e):co(n,pr,e),timeParse:ro(e.parse),utcParse:ro(e.utcParse)}}function ho(){return ao=fo({format:Tr,parse:zr,utcFormat:Rr,utcParse:Pr})}function po(e){return fo(Nr(e))}function go(e){return arguments.length?ao=po(e):ao}Br=Nr({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"]}),Tr=Br.format,zr=Br.parse,Rr=Br.utcFormat,Pr=Br.utcParse,so(),ho();const mo=(e,t)=>be({},e,t);function yo(e,t){const n=e?uo(e):lo(),r=t?po(t):go();return mo(n,r)}function vo(e,t){const n=arguments.length;return n&&2!==n&&_("defaultLocale expects either zero or two arguments."),n?mo(lo(e),go(t)):mo(lo(),go())}function bo(){return so(),ho(),vo()}const xo=/^(data:|([A-Za-z]+:)?\/\/)/,_o=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,wo=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,ko="file://";async function Ao(e,t){const n=await this.sanitize(e,t),r=n.href;return n.localFile?this.file(r):this.http(r,t)}async function Eo(e,t){t=be({},this.options,t);const n=this.fileAccess,r={href:null};let i,o,a;const s=_o.test(e.replace(wo,""));null!=e&&"string"==typeof e&&s||_("Sanitize failure, invalid URI: "+qe(e));const u=xo.test(e);return(a=t.baseURL)&&!u&&(e.startsWith("/")||a.endsWith("/")||(e="/"+e),e=a+e),o=(i=e.startsWith(ko))||"file"===t.mode||"http"!==t.mode&&!u&&n,i?e=e.slice(7):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(r,"localFile",{value:!!o}),r.href=e,t.target&&(r.target=t.target+""),t.rel&&(r.rel=t.rel+""),"image"===t.context&&t.crossOrigin&&(r.crossOrigin=t.crossOrigin+""),r}function Oo(e){return e?t=>new Promise(((n,r)=>{e.readFile(t,((e,t)=>{e?r(e):n(t)}))})):Do}async function Do(){_("No file system access.")}function Co(e){return e?async function(t,n){const r=be({},this.options.http,n),i=n&&n.response,o=await e(t,r);return o.ok?ce(o[i])?o[i]():o.text():_(o.status+""+o.statusText)}:So}async function So(){_("No HTTP fetch method available.")}const Fo=e=>null!=e&&e==e,Mo=e=>!(Number.isNaN(+e)||e instanceof Date),jo={boolean:We,integer:W,number:W,date:Ge,string:Ve,unknown:E},$o=[e=>"true"===e||"false"===e||!0===e||!1===e,e=>Mo(e)&&Number.isInteger(+e),Mo,e=>!Number.isNaN(Date.parse(e))],No=["boolean","integer","number","date"];function Bo(e,t){if(!e||!e.length)return"unknown";const n=e.length,r=$o.length,i=$o.map(((e,t)=>t+1));for(let o,a,s=0,u=0;s0===e?t:e),0)-1]}function To(e,t){return t.reduce(((t,n)=>(t[n]=Bo(e,n),t)),{})}function zo(e){const t=function(t,n){const r={delimiter:e};return Ro(t,n?be(n,r):r)};return t.responseType="text",t}function Ro(e,t){return t.header&&(e=t.header.map(qe).join(t.delimiter)+"\n"+e),ot(t.delimiter).parse(e+"")}function Po(e,t){const n=t&&t.property?k(t.property):E;return!R(e)||(r=e,"function"==typeof Buffer&&ce(Buffer.isBuffer)&&Buffer.isBuffer(r))?n(JSON.parse(e)):function(e,t){return!z(e)&&Me(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}(n(e),t);var r}Ro.responseType="text",Po.responseType="json";const Lo={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function Io(e,t){let n,r,i,o;return e=Po(e,t),t&&t.feature?(n=st,i=t.feature):t&&t.mesh?(n=ft,i=t.mesh,o=Lo[t.filter]):_("Missing TopoJSON feature or mesh parameter."),r=(r=e.objects[i])?n(e,r,o):_("Invalid TopoJSON object: "+i),r&&r.features||[r]}Io.responseType="json";const Uo={dsv:Ro,csv:zo(","),tsv:zo("\t"),json:Po,topojson:Io};function qo(e,t){return arguments.length>1?(Uo[e]=t,this):ke(Uo,e)?Uo[e]:null}function Wo(e){const t=qo(e);return t&&t.responseType||"text"}function Ho(e,t,n,r){const i=qo((t=t||{}).type||"json");return i||_("Unknown data format type: "+t.type),e=i(e,t),t.parse&&function(e,t,n,r){if(!e.length)return;const i=go();n=n||i.timeParse,r=r||i.utcParse;let o,a,s,u,l,c,f=e.columns||Object.keys(e[0]);"auto"===t&&(t=To(e,f)),f=Object.keys(t);const d=f.map((e=>{const i=t[e];let o,a;if(i&&(i.startsWith("date:")||i.startsWith("utc:")))return o=i.split(/:(.+)?/,2),a=o[1],("'"===a[0]&&"'"===a[a.length-1]||'"'===a[0]&&'"'===a[a.length-1])&&(a=a.slice(1,-1)),("utc"===o[0]?r:n)(a);if(!jo[i])throw Error("Illegal format pattern: "+e+":"+i);return jo[i]}));for(s=0,l=e.length,c=f.length;s({options:t||{},sanitize:Eo,load:Ao,fileAccess:!1,file:Oo(null),http:Co(e)})}("undefined"!=typeof fetch&&fetch);function Vo(e){const t=e||E,n=[],r={};return n.add=e=>{const i=t(e);return r[i]||(r[i]=1,n.push(e)),n},n.remove=e=>{const i=t(e);if(r[i]){r[i]=0;const t=n.indexOf(e);t>=0&&n.splice(t,1)}return n},n}async function Yo(e,t){try{await t(e)}catch(t){e.error(t)}}const Xo=Symbol("vega_id");let Zo=1;function Jo(e){return!(!e||!Ko(e))}function Ko(e){return e[Xo]}function Qo(e,t){return e[Xo]=t,e}function ea(e){const t=e===Object(e)?e:{data:e};return Ko(t)?t:Qo(t,Zo++)}function ta(e){return na(e,ea({}))}function na(e,t){for(const n in e)t[n]=e[n];return t}function ra(e,t){return Qo(t,Ko(e))}function ia(e,t){return e?t?(n,r)=>e(n,r)||Ko(t(n))-Ko(t(r)):(t,n)=>e(t,n)||Ko(t)-Ko(n):null}function oa(e){return e&&e.constructor===aa}function aa(){const e=[],t=[],n=[],r=[],i=[];let o=null,a=!1;return{constructor:aa,insert(t){const n=ue(t),r=n.length;for(let t=0;t{p(e)&&(l[Ko(e)]=-1)}));for(f=0,d=e.length;f0&&(y(g,p,h.value),s.modifies(p));for(f=0,d=i.length;f{p(e)&&l[Ko(e)]>0&&y(e,h.field,h.value)})),s.modifies(h.field);if(a)s.mod=t.length||r.length?u.filter((e=>l[Ko(e)]>0)):u.slice();else for(m in c)s.mod.push(c[m]);return(o||null==o&&(t.length||r.length))&&s.clean(!0),s}}}const sa="_:mod:_";function ua(){Object.defineProperty(this,sa,{writable:!0,value:{}})}ua.prototype={set(e,t,n,r){const i=this,o=i[e],a=i[sa];return null!=t&&t>=0?(o[t]!==n||r)&&(o[t]=n,a[t+":"+e]=-1,a[e]=-1):(o!==n||r)&&(i[e]=n,a[e]=z(n)?1+n.length:-1),i},modified(e,t){const n=this[sa];if(!arguments.length){for(const e in n)if(n[e])return!0;return!1}if(z(e)){for(let t=0;t=0?t+1{a instanceof fa?(a!==this&&(t&&a.targets().add(this),o.push(a)),i.push({op:a,name:e,index:n})):r.set(e,n,a)};for(a in e)if(s=e[a],"pulse"===a)ue(s).forEach((e=>{e instanceof fa?e!==this&&(e.targets().add(this),o.push(e)):_("Pulse parameters must be operator instances.")})),this.source=s;else if(z(s))for(r.set(a,-1,Array(u=s.length)),l=0;l{const n=Date.now();return n-t>e?(t=n,1):0}))},debounce(e){const t=ga();return this.targets().add(ga(null,null,ve(e,(e=>{const n=e.dataflow;t.receive(e),n&&n.run&&n.run()})))),t},between(e,t){let n=!1;return e.targets().add(ga(null,null,(()=>n=!0))),t.targets().add(ga(null,null,(()=>n=!1))),this.filter((()=>n))},detach(){this._filter=C,this._targets=null}};const ma={skip:!0};function ya(e,t,n,r,i,o){const a=be({},o,ma);let s,u;ce(n)||(n=ye(n)),void 0===r?s=t=>e.touch(n(t)):ce(r)?(u=new fa(null,r,i,!1),s=t=>{u.evaluate(t);const r=n(t),i=u.value;oa(i)?e.pulse(r,i,o):e.update(r,i,a)}):s=t=>e.update(n(t),r,a),t.apply(s)}function va(e,t,n,r,i,o){if(void 0===r)t.targets().add(n);else{const a=o||{},s=new fa(null,function(e,t){return t=ce(t)?t:ye(t),e?function(n,r){const i=t(n,r);return e.skip()||(e.skip(i!==this.value).value=i),i}:t}(n,r),i,!1);s.modified(a.force),s.rank=t.rank,t.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),e.connect(n,[s]))}}const ba={};function xa(e,t,n){this.dataflow=e,this.stamp=null==t?-1:t,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function _a(e,t){const n=[];return Ze(e,t,(e=>n.push(e))),n}function wa(e,t){const n={};return e.visit(t,(e=>{n[Ko(e)]=1})),e=>n[Ko(e)]?null:e}function ka(e,t){return e?(n,r)=>e(n,r)&&t(n,r):t}function Aa(e,t,n,r){const i=this;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=r||null,this.pulses=n;for(const e of n)if(e.stamp===t){if(e.fields){const t=i.fields||(i.fields={});for(const n in e.fields)t[n]=1}e.changed(i.ADD)&&(o|=i.ADD),e.changed(i.REM)&&(o|=i.REM),e.changed(i.MOD)&&(o|=i.MOD)}this.changes=o}function Ea(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}xa.prototype={StopPropagation:ba,ADD:1,REM:2,MOD:4,ADD_REM:3,ADD_MOD:5,ALL:7,REFLOW:8,SOURCE:16,NO_SOURCE:32,NO_FIELDS:64,fork(e){return new xa(this.dataflow).init(this,e)},clone(){const e=this.fork(7);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(23)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new xa(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,!e.fields||64&t||(n.fields=e.fields),1&t?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),2&t?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),4&t?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),32&t?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||7;return 1&t&&this.add.length||2&t&&this.rem.length||4&t&&this.mod.length},reflow(e){if(e)return this.fork(7).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(4,wa(this,1))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return z(e)?e.forEach((e=>t[e]=!0)):t[e]=!0,this},modified(e,t){const n=this.fields;return!(!t&&!this.mod.length||!n)&&(arguments.length?z(e)?e.some((e=>n[e])):n[e]:!!n)},filter(e,t){const n=this;return 1&e&&(n.addF=ka(n.addF,t)),2&e&&(n.remF=ka(n.remF,t)),4&e&&(n.modF=ka(n.modF,t)),16&e&&(n.srcF=ka(n.srcF,t)),n},materialize(e){const t=this;return 1&(e=e||7)&&t.addF&&(t.add=_a(t.add,t.addF),t.addF=null),2&e&&t.remF&&(t.rem=_a(t.rem,t.remF),t.remF=null),4&e&&t.modF&&(t.mod=_a(t.mod,t.modF),t.modF=null),16&e&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,r=t;if(16&e)return Ze(n.source,n.srcF,r),n;1&e&&Ze(n.add,n.addF,r),2&e&&Ze(n.rem,n.remF,r),4&e&&Ze(n.mod,n.modF,r);const i=n.source;if(8&e&&i){const e=n.add.length+n.mod.length;e===i.length||Ze(i,e?wa(n,5):n.srcF,r)}return n}},De(Aa,xa,{fork(e){const t=new xa(this.dataflow).init(this,e&this.NO_FIELDS);return void 0!==e&&(e&t.ADD&&this.visit(t.ADD,(e=>t.add.push(e))),e&t.REM&&this.visit(t.REM,(e=>t.rem.push(e))),e&t.MOD&&this.visit(t.MOD,(e=>t.mod.push(e)))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?z(e)?e.some((e=>n[e])):n[e]:0},filter(){_("MultiPulse does not support filtering.")},materialize(){_("MultiPulse does not support materialization.")},visit(e,t){const n=this,r=n.pulses,i=r.length;let o=0;if(e&n.SOURCE)for(;ot&&(o=n-1>>1,i=e[o],r(a,i)<0);)e[n]=i,n=o;return e[n]=a}function Ca(){this.logger(T()),this.logLevel(j),this._clock=0,this._rank=0,this._locale=vo();try{this._loader=Go()}catch(e){}this._touched=Vo(A),this._input={},this._pulse=null,this._heap=function(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),Da(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let r;return t.length?(r=t[0],t[0]=n,function(e,t,n){const r=t,i=e.length,o=e[t];let a,s=1+(t<<1);for(;s=0&&(s=a),e[t]=e[s],s=1+((t=s)<<1);e[t]=o,Da(e,r,t,n)}(t,0,e)):r=n,r}}}(((e,t)=>e.qrank-t.qrank)),this._postrun=[]}function Sa(e){return function(){return this._log[e].apply(this,arguments)}}function Fa(e,t){fa.call(this,e,null,t)}Ca.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:Sa("error"),warn:Sa("warn"),info:Sa("info"),debug:Sa("debug"),logLevel:Sa("level"),cleanThreshold:1e4,add:function(e,t,n,r){let i,o=1;return e instanceof fa?i=e:e&&e.prototype instanceof fa?i=new e:ce(e)?i=new fa(null,e):(o=0,i=new fa(e,t)),this.rank(i),o&&(r=n,n=t),n&&this.connect(i,i.parameters(n,r)),this.touch(i),i},connect:function(e,t){const n=e.rank,r=t.length;for(let i=0;i=0;)t.push(n=r[i]),n===e&&_("Cycle detected in dataflow graph.")},pulse:function(e,t,n){this.touch(e,n||Oa);const r=new xa(this,this._clock+(this._pulse?0:1)),i=e.pulse&&e.pulse.source||[];return r.target=e,this._input[e.id]=t.pulse(r,i),this},touch:function(e,t){const n=t||Oa;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this},update:function(e,t,n){const r=n||Oa;return(e.set(t)||r.force)&&this.touch(e,r),this},changeset:aa,ingest:function(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))},parse:function(e,t){const n=this.locale();return Ho(e,t,n.timeParse,n.utcParse)},preload:async function(e,t,n){const r=this,i=r._pending||function(e){let t;const n=new Promise((e=>t=e));return n.requests=0,n.done=()=>{0==--n.requests&&(e._pending=null,t(e))},e._pending=n}(r);i.requests+=1;const o=await r.request(t,n);return r.pulse(e,r.changeset().remove(C).insert(o.data||[])),i.done(),o},request:async function(e,t){const n=this;let r,i=0;try{r=await n.loader().load(e,{context:"dataflow",response:Wo(t&&t.type)});try{r=n.parse(r,t)}catch(t){i=-2,n.warn("Data ingestion failed",e,t)}}catch(t){i=-1,n.warn("Loading failed",e,t)}return{data:r,status:i}},events:function(e,t,n,r){const i=this,o=ga(n,r),a=function(e){e.dataflow=i;try{o.receive(e)}catch(e){i.error(e)}finally{i.run()}};let s;s="string"==typeof e&&"undefined"!=typeof document?document.querySelectorAll(e):ue(e);const u=s.length;for(let e=0;er._enqueue(e,!0))),r._touched=Vo(A);let a,s,u,l=0;try{for(;r._heap.size()>0;)a=r._heap.pop(),a.rank===a.qrank?(s=a.run(r._getPulse(a,e)),s.then?s=await s:s.async&&(i.push(s.async),s=ba),s!==ba&&a._targets&&a._targets.forEach((e=>r._enqueue(e))),++l):r._enqueue(a,!0)}catch(e){r._heap.clear(),u=e}if(r._input={},r._pulse=null,r.debug(`Pulse ${o}: ${l} operators`),u&&(r._postrun=[],r.error(u)),r._postrun.length){const e=r._postrun.sort(((e,t)=>t.priority-e.priority));r._postrun=[];for(let t=0;tr.runAsync(null,(()=>{e.forEach((e=>{try{e(r)}catch(e){r.error(e)}}))})))),r},run:function(e,t,n){return this._pulse?Ea(this):(this.evaluate(e,t,n),this)},runAsync:async function(e,t,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(r,r),this._running},runAfter:function(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(e){this.error(e)}},_enqueue:function(e,t){const n=e.stampe.pulse)),t):this._input[e.id]||function(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==ba&&(e.source=t.source),e)}(this._pulse,n&&n.pulse)}},De(Fa,fa,{run(e){if(e.stampthis.pulse=e)):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const Ma={};function ja(e){const t=$a(e);return t&&t.Definition||null}function $a(e){return e=e&&e.toLowerCase(),ke(Ma,e)?Ma[e]:null}function Na(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n=i)&&(n=i)}return n}function Ba(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function Ta(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(et?1:0)}function za(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=void 0===i?Ta:function(e=kn){if(e===kn)return Ta;if("function"!=typeof e)throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||0===r?r:(0===e(n,n))-(0===e(t,t))}}(i);r>n;){if(r-n>600){const o=r-n+1,a=t-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*u*(o-u)/o)*(a-o/2<0?-1:1);za(e,t,Math.max(n,Math.floor(t-a*u/o+l)),Math.min(r,Math.floor(t+(o-a)*u/o+l)),i)}const o=e[t];let a=n,s=r;for(Ra(e,n,t),i(e[r],o)>0&&Ra(e,n,r);a0;)--s}0===i(e[n],o)?Ra(e,n,s):(++s,Ra(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function Ra(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Pa(e){return null===e?NaN:+e}function La(e,t,n){if(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r=+r)>=r&&(yield r)}}(e,n)),(r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return Ba(e);if(t>=1)return Na(e);var r,i=(r-1)*t,o=Math.floor(i),a=Na(za(e,o).subarray(0,o+1));return a+(Ba(e.subarray(o+1))-a)*(i-o)}}function Ia(e,t,n=Pa){if((r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),a=+n(e[o],o,e);return a+(+n(e[o+1],o+1,e)-a)*(i-o)}}function Ua(e,t){return La(e,.5,t)}function*qa(e,t){if(null==t)for(let t of e)null!=t&&""!==t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)r=t(r,++n,e),null!=r&&""!==r&&(r=+r)>=r&&(yield r)}}function Wa(e,t,n){const r=Float64Array.from(qa(e,n));return r.sort(kn),t.map((e=>Ia(r,e)))}function Ha(e,t){return Wa(e,[.25,.5,.75],t)}function Ga(e,t){const n=e.length,r=function(e,t){const n=function(e,t){let n,r=0,i=0,o=0;if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(n=t-i,i+=n/++r,o+=n*(t-i));else{let a=-1;for(let s of e)null!=(s=t(s,++a,e))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(e,t);return n?Math.sqrt(n):n}(e,t),i=Ha(e,t),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function Va(e){const t=e.maxbins||20,n=e.base||10,r=Math.log(n),i=e.divide||[5,2];let o,a,s,u,l,c,f=e.extent[0],d=e.extent[1];const h=e.span||d-f||Math.abs(f)||1;if(e.step)o=e.step;else if(e.steps){for(u=h/t,l=0,c=e.steps.length;lt;)o*=n;for(l=0,c=i.length;l=s&&h/u<=t&&(o=u)}u=Math.log(o);const p=u>=0?0:1+~~(-u/r),g=Math.pow(n,-p-1);return(e.nice||void 0===e.nice)&&(u=Math.floor(f/o+g)*o,f=fe);const i=e.length,o=new Float64Array(i);let a,s=0,u=1,l=r(e[0]),c=l,f=l+t;for(;u=f){for(c=(l+c)/2;s>1);ia;)e[i--]=e[o]}o=a,a=r}return e}(o,t+t/4):o}function Ka(e){return function(){return(e=(1103515245*e+12345)%2147483647)/2147483647}}function Qa(e,t){let n,r,i;null==t&&(t=e,e=0);const o={min(e){return arguments.length?(n=e||0,i=r-n,o):n},max(e){return arguments.length?(r=e||0,i=r-n,o):r},sample:()=>n+Math.floor(i*Ya()),pdf:e=>e===Math.floor(e)&&e>=n&&e=r?1:(t-n+1)/i},icdf:e=>e>=0&&e<=1?n-1+Math.floor(e*i):NaN};return o.min(e).max(t)}const es=Math.sqrt(2*Math.PI),ts=Math.SQRT2;let ns=NaN;function rs(e,t){e=e||0,t=null==t?1:t;let n,r,i=0,o=0;if(ns==ns)i=ns,ns=NaN;else{do{i=2*Ya()-1,o=2*Ya()-1,n=i*i+o*o}while(0===n||n>1);r=Math.sqrt(-2*Math.log(n)/n),i*=r,ns=o*r}return e+i*t}function is(e,t,n){const r=(e-(t||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*es)}function os(e,t,n){const r=(e-(t=t||0))/(n=null==n?1:n),i=Math.abs(r);let o;if(i>37)o=0;else{const e=Math.exp(-i*i/2);let t;i<7.07106781186547?(t=.0352624965998911*i+.700383064443688,t=t*i+6.37396220353165,t=t*i+33.912866078383,t=t*i+112.079291497871,t=t*i+221.213596169931,t=t*i+220.206867912376,o=e*t,t=.0883883476483184*i+1.75566716318264,t=t*i+16.064177579207,t=t*i+86.7807322029461,t=t*i+296.564248779674,t=t*i+637.333633378831,t=t*i+793.826512519948,t=t*i+440.413735824752,o/=t):(t=i+.65,t=i+4/t,t=i+3/t,t=i+2/t,t=i+1/t,o=e/t/2.506628274631)}return r>0?1-o:o}function as(e,t,n){return e<0||e>1?NaN:(t||0)+(null==n?1:n)*ts*function(e){let t,n=-Math.log((1-e)*(1+e));return n<6.25?(n-=3.125,t=-364441206401782e-35,t=t*n-16850591381820166e-35,t=128584807152564e-32+t*n,t=11157877678025181e-33+t*n,t=t*n-1333171662854621e-31,t=20972767875968562e-33+t*n,t=6637638134358324e-30+t*n,t=t*n-4054566272975207e-29,t=t*n-8151934197605472e-29,t=26335093153082323e-28+t*n,t=t*n-12975133253453532e-27,t=t*n-5415412054294628e-26,t=1.0512122733215323e-9+t*n,t=t*n-4.112633980346984e-9,t=t*n-2.9070369957882005e-8,t=4.2347877827932404e-7+t*n,t=t*n-13654692000834679e-22,t=t*n-13882523362786469e-21,t=.00018673420803405714+t*n,t=t*n-.000740702534166267,t=t*n-.006033670871430149,t=.24015818242558962+t*n,t=1.6536545626831027+t*n):n<16?(n=Math.sqrt(n)-3.25,t=2.2137376921775787e-9,t=9.075656193888539e-8+t*n,t=t*n-2.7517406297064545e-7,t=1.8239629214389228e-8+t*n,t=15027403968909828e-22+t*n,t=t*n-4013867526981546e-21,t=29234449089955446e-22+t*n,t=12475304481671779e-21+t*n,t=t*n-47318229009055734e-21,t=6828485145957318e-20+t*n,t=24031110387097894e-21+t*n,t=t*n-.0003550375203628475,t=.0009532893797373805+t*n,t=t*n-.0016882755560235047,t=.002491442096107851+t*n,t=t*n-.003751208507569241,t=.005370914553590064+t*n,t=1.0052589676941592+t*n,t=3.0838856104922208+t*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,t=-27109920616438573e-27,t=t*n-2.555641816996525e-10,t=1.5076572693500548e-9+t*n,t=t*n-3.789465440126737e-9,t=7.61570120807834e-9+t*n,t=t*n-1.496002662714924e-8,t=2.914795345090108e-8+t*n,t=t*n-6.771199775845234e-8,t=2.2900482228026655e-7+t*n,t=t*n-9.9298272942317e-7,t=4526062597223154e-21+t*n,t=t*n-1968177810553167e-20,t=7599527703001776e-20+t*n,t=t*n-.00021503011930044477,t=t*n-.00013871931833623122,t=1.0103004648645344+t*n,t=4.849906401408584+t*n):t=1/0,t*e}(2*e-1)}function ss(e,t){let n,r;const i={mean(e){return arguments.length?(n=e||0,i):n},stdev(e){return arguments.length?(r=null==e?1:e,i):r},sample:()=>rs(n,r),pdf:e=>is(e,n,r),cdf:e=>os(e,n,r),icdf:e=>as(e,n,r)};return i.mean(e).stdev(t)}function us(e,t){const n=ss();let r=0;const i={data(n){return arguments.length?(e=n,r=n?n.length:0,i.bandwidth(t)):e},bandwidth(n){return arguments.length?(!(t=n)&&e&&(t=Ga(e)),i):t},sample:()=>e[~~(Ya()*r)]+t*n.sample(),pdf(i){let o=0,a=0;for(;als(n,r),pdf:e=>cs(e,n,r),cdf:e=>fs(e,n,r),icdf:e=>ds(e,n,r)};return i.mean(e).stdev(t)}function ps(e,t){let n,r=0;const i={weights(e){return arguments.length?(n=function(e){const t=[];let n,i=0;for(n=0;n=t&&e<=n?1/(n-t):0}function ys(e,t,n){return null==n&&(n=null==t?1:t,t=0),en?1:(e-t)/(n-t)}function vs(e,t,n){return null==n&&(n=null==t?1:t,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function bs(e,t){let n,r;const i={min(e){return arguments.length?(n=e||0,i):n},max(e){return arguments.length?(r=null==e?1:e,i):r},sample:()=>gs(n,r),pdf:e=>ms(e,n,r),cdf:e=>ys(e,n,r),icdf:e=>vs(e,n,r)};return null==t&&(t=null==e?1:e,e=0),i.min(e).max(t)}function xs(e,t,n){let r=0,i=0;for(const o of e){const e=n(o);null==t(o)||null==e||isNaN(e)||(r+=(e-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function _s(e,t,n,r){const i=r-e*e,o=Math.abs(i)<1e-24?0:(n-e*t)/i;return[t-o*e,o]}function ws(e,t,n,r){e=e.filter((e=>{let r=t(e),i=n(e);return null!=r&&(r=+r)>=r&&null!=i&&(i=+i)>=i})),r&&e.sort(((e,n)=>t(e)-t(n)));const i=e.length,o=new Float64Array(i),a=new Float64Array(i);let s,u,l,c=0,f=0,d=0;for(l of e)o[c]=s=+t(l),a[c]=u=+n(l),++c,f+=(s-f)/c,d+=(u-d)/c;for(c=0;c=i&&null!=o&&(o=+o)>=o&&r(i,o,++a)}function As(e,t,n,r,i){let o=0,a=0;return ks(e,t,n,((e,t)=>{const n=t-i(e),s=t-r;o+=n*n,a+=s*s})),1-o/a}function Es(e,t,n){let r=0,i=0,o=0,a=0,s=0;ks(e,t,n,((e,t)=>{++s,r+=(e-r)/s,i+=(t-i)/s,o+=(e*t-o)/s,a+=(e*e-a)/s}));const u=_s(r,i,o,a),l=e=>u[0]+u[1]*e;return{coef:u,predict:l,rSquared:As(e,t,n,i,l)}}function Os(e,t,n){let r=0,i=0,o=0,a=0,s=0;ks(e,t,n,((e,t)=>{++s,e=Math.log(e),r+=(e-r)/s,i+=(t-i)/s,o+=(e*t-o)/s,a+=(e*e-a)/s}));const u=_s(r,i,o,a),l=e=>u[0]+u[1]*Math.log(e);return{coef:u,predict:l,rSquared:As(e,t,n,i,l)}}function Ds(e,t,n){const[r,i,o,a]=ws(e,t,n);let s,u,l,c=0,f=0,d=0,h=0,p=0;ks(e,t,n,((e,t)=>{s=r[p++],u=Math.log(t),l=s*t,c+=(t*u-c)/p,f+=(l-f)/p,d+=(l*u-d)/p,h+=(s*l-h)/p}));const[g,m]=_s(f/a,c/a,d/a,h/a),y=e=>Math.exp(g+m*(e-o));return{coef:[Math.exp(g-m*o),m],predict:y,rSquared:As(e,t,n,a,y)}}function Cs(e,t,n){let r=0,i=0,o=0,a=0,s=0,u=0;ks(e,t,n,((e,t)=>{const n=Math.log(e),l=Math.log(t);++u,r+=(n-r)/u,i+=(l-i)/u,o+=(n*l-o)/u,a+=(n*n-a)/u,s+=(t-s)/u}));const l=_s(r,i,o,a),c=e=>l[0]*Math.pow(e,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:As(e,t,n,s,c)}}function Ss(e,t,n){const[r,i,o,a]=ws(e,t,n),s=r.length;let u,l,c,f,d=0,h=0,p=0,g=0,m=0;for(u=0;ub*(e-=o)*e+x*e+_+a;return{coef:[_-x*o+b*o*o+a,x-2*b*o,b],predict:w,rSquared:As(e,t,n,a,w)}}function Fs(e,t,n,r){if(0===r)return xs(e,t,n);if(1===r)return Es(e,t,n);if(2===r)return Ss(e,t,n);const[i,o,a,s]=ws(e,t,n),u=i.length,l=[],c=[],f=r+1;let d,h,p,g,m;for(d=0;dMath.abs(e[r][a])&&(a=i);for(o=r;o=r;o--)e[o][i]-=e[o][r]*e[r][i]/e[r][r]}for(i=t-1;i>=0;--i){for(s=0,o=i+1;o{e-=a;let t=s+y[0]+y[1]*e+y[2]*e*e;for(d=3;d=0;--o)for(s=t[o],u=1,i[o]+=s,a=1;a<=o;++a)u*=(o+1-a)/a,i[o-a]+=s*Math.pow(n,a)*u;return i[0]+=r,i}const js=2,$s=1e-12;function Ns(e,t,n,r){const[i,o,a,s]=ws(e,t,n,!0),u=i.length,l=Math.max(2,~~(r*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let e=-1;++e<=js;){const t=[0,l-1];for(let e=0;ei[a]-n?r:a;let u=0,l=0,h=0,p=0,g=0;const m=1/Math.abs(i[s]-n||1);for(let e=r;e<=a;++e){const t=i[e],r=o[e],a=Bs(Math.abs(n-t)*m)*d[e],s=t*a;u+=a,l+=s,h+=r*a,p+=r*s,g+=t*s}const[y,v]=_s(l/u,h/u,p/u,g/u);c[e]=y+v*n,f[e]=Math.abs(o[e]-c[e]),Ts(i,e+1,t)}if(e===js)break;const n=Ua(f);if(Math.abs(n)<$s)break;for(let e,t,r=0;r=1?$s:(t=1-e*e)*t}return function(e,t,n,r){const i=e.length,o=[];let a,s=0,u=0,l=[];for(;s=e.length))for(;t>i&&e[o]-r<=r-e[i];)n[0]=++i,n[1]=o,++o}const zs=.5*Math.PI/180;function Rs(e,t,n,r){n=n||25,r=Math.max(n,r||200);const i=t=>[t,e(t)],o=t[0],a=t[1],s=a-o,u=s/r,l=[i(o)],c=[];if(n===r){for(let e=1;e0;)c.push(i(o+e/n*s));let f=l[0],d=c[c.length-1];const h=1/s,p=function(e,t){let n=e,r=e;const i=t.length;for(let e=0;er&&(r=i)}return 1/(r-n)}(f[1],c);for(;d;){const e=i((f[0]+d[0])/2);e[0]-f[0]>=u&&Ps(f,e,d,h,p)>zs?c.push(e):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function Ps(e,t,n,r,i){const o=Math.atan2(i*(n[1]-e[1]),r*(n[0]-e[0])),a=Math.atan2(i*(t[1]-e[1]),r*(t[0]-e[0]));return Math.abs(o-a)}function Ls(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r{const n=t.length;let r=1,i=String(t[0](e));for(;r{},Ws={init:qs,add:qs,rem:qs,idx:0},Hs={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||void 0===e.max)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},Gs=Object.keys(Hs).filter((e=>"__count__"!==e));function Vs(e,t,n){return Hs[e](n,t)}function Ys(e,t){return e.idx-t.idx}function Xs(){this.valid=0,this.missing=0,this._ops.forEach((e=>null==e.aggregate_param?e.init(this):e.init(this,e.aggregate_param)))}function Zs(e,t){null!=e&&""!==e?e==e&&(++this.valid,this._ops.forEach((n=>n.add(this,e,t)))):++this.missing}function Js(e,t){null!=e&&""!==e?e==e&&(--this.valid,this._ops.forEach((n=>n.rem(this,e,t)))):--this.missing}function Ks(e){return this._out.forEach((t=>e[t.out]=t.value(this))),e}function Qs(e,t){const n=t||E,r=function(e){const t={};e.forEach((e=>t[e.name]=e));const n=e=>{e.req&&e.req.forEach((e=>{t[e]||n(t[e]=Hs[e]())}))};return e.forEach(n),Object.values(t).sort(Ys)}(e),i=e.slice().sort(Ys);function o(e){this._ops=r,this._out=i,this.cell=e,this.init()}return o.prototype.init=Xs,o.prototype.add=Zs,o.prototype.rem=Js,o.prototype.set=Ks,o.prototype.get=n,o.fields=e.map((e=>e.out)),o}function eu(e){this._key=e?k(e):Ko,this.reset()}[...Gs,"__count__"].forEach((e=>{Hs[e]=function(e,t){return(n,r)=>be({name:e,aggregate_param:r,out:n||e},Ws,t)}(e,Hs[e])}));const tu=eu.prototype;function nu(e){Fa.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}function ru(e){Fa.call(this,null,e)}function iu(e,t,n){const r=e;let i=t||[],o=n||[],a={},s=0;return{add:e=>o.push(e),remove:e=>a[r(e)]=++s,size:()=>i.length,data:(e,t)=>(s&&(i=i.filter((e=>!a[r(e)])),a={},s=0),t&&e&&i.sort(e),o.length&&(i=e?Pe(e,i,o.sort(e)):i.concat(o),o=[]),i)}}function ou(e){Fa.call(this,[],e)}function au(e){fa.call(this,null,su,e)}function su(e){return this.value&&!e.modified()?this.value:de(e.fields,e.orders)}function uu(e){Fa.call(this,null,e)}function lu(e){Fa.call(this,null,e)}tu.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},tu.add=function(e){this._add.push(e)},tu.rem=function(e){this._rem.push(e)},tu.values=function(){if(this._get=null,0===this._rem.length)return this._add;const e=this._add,t=this._rem,n=this._key,r=e.length,i=t.length,o=Array(r-i),a={};let s,u,l;for(s=0;s=0;)r=e(t[i])+"",ke(n,r)||(n[r]=1,++o);return o},tu.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=_e(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},tu.argmin=function(e){return this.extent(e)[0]||{}},tu.argmax=function(e){return this.extent(e)[1]||{}},tu.min=function(e){const t=this.extent(e)[0];return null!=t?e(t):void 0},tu.max=function(e){const t=this.extent(e)[1];return null!=t?e(t):void 0},tu.quartile=function(e){return this._get===e&&this._q||(this._q=Ha(this.values(),e),this._get=e),this._q},tu.q1=function(e){return this.quartile(e)[0]},tu.q2=function(e){return this.quartile(e)[1]},tu.q3=function(e){return this.quartile(e)[2]},tu.ci=function(e){return this._get===e&&this._ci||(this._ci=Za(this.values(),1e3,.05,e),this._get=e),this._ci},tu.ci0=function(e){return this.ci(e)[0]},tu.ci1=function(e){return this.ci(e)[1]},nu.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Gs},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},De(nu,Fa,{transform(e,t){const n=this,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.modified();return n.stamp=r.stamp,n.value&&(i||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(e):Object.create(null),t.visit(t.SOURCE,(e=>n.add(e)))):(n.value=n.value||n.init(e),t.visit(t.REM,(e=>n.rem(e))),t.visit(t.ADD,(e=>n.add(e)))),r.modifies(n._outputs),n._drop=!1!==e.drop,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&r.clean(!0).runAfter((()=>this.clean())),n.changes(r)},cross(){const e=this,t=e.value,n=e._dnames,r=n.map((()=>({}))),i=n.length;function o(e){let t,o,a,s;for(t in e)for(a=e[t].tuple,o=0;o{const t=m(e);return i(e),n.push(t),t})),this.cellkey=e.key?e.key:Is(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],a=e.ops||["count"],s=e.aggregate_params||[null],u=e.as||[],l=o.length,c={};let f,d,h,p,g,v,b;for(l!==a.length&&_("Unmatched number of fields and aggregate ops."),b=0;bQs(e,e.field))),Object.create(null)},cellkey:Is(),cell(e,t){let n=this.value[e];return n?0===n.num&&this._drop&&n.stamp{const t=r(e);e[s]=t,e[u]=null==t?null:i+o*(1+(t-i)/o)}:e=>e[s]=r(e)),t.modifies(n?a:s)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=Va(e),r=n.step;let i,o,a=n.start,s=a+Math.ceil((n.stop-a)/r)*r;null!=(i=e.anchor)&&(o=i-(a+r*Math.floor((i-a)/r)),a+=o,s+=o);const u=function(e){let n=W(t(e));return null==n?null:ns?1/0:(n=Math.max(a,Math.min(n,s-r)),a+r*Math.floor(1e-14+(n-a)/r))};return u.start=a,u.stop=n.stop,u.step=r,this.value=g(u,y(t),e.name||"bin_"+m(t))}}),ou.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},De(ou,Fa,{transform(e,t){const n=t.fork(t.ALL),r=iu(Ko,this.value,n.materialize(n.ADD).add),i=e.sort,o=t.changed()||i&&(e.modified("sort")||t.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(ia(i),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}}),De(au,fa),uu.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]},De(uu,Fa,{transform(e,t){const n=t=>n=>{for(var r,i=function(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase()}return e.match(n)}(s(n),e.case,o)||[],u=0,l=i.length;ui[e]=1+(i[e]||0))),c=n((e=>i[e]-=1));return r?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return!e.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),!e.modified("pattern")&&this._match||(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,r=this._tuples||(this._tuples={}),i=t[0],o=t[1],a=e.fork(e.NO_SOURCE|e.NO_FIELDS);let s,u,l;for(s in n)u=r[s],l=n[s]||0,!u&&l?(r[s]=u=ea({}),u[i]=s,u[o]=l,a.add.push(u)):0===l?(u&&a.rem.push(u),n[s]=null,r[s]=null):u[o]!==l&&(u[o]=l,a.mod.push(u));return a.modifies(t)}}),lu.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},De(lu,Fa,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.as||["a","b"],i=r[0],o=r[1],a=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let s=this.value;return a?(s&&(n.rem=s),s=t.materialize(t.SOURCE).source,n.add=this.value=function(e,t,n,r){for(var i,o,a=[],s={},u=e.length,l=0;ldu(e,t)))):typeof r[n]===fu&&r[n](e[n]);return r}function hu(e){Fa.call(this,null,e)}const pu=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],gu={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:pu},{name:"weights",type:"number",array:!0}]};function mu(e,t){return e?e.map(((e,n)=>t[n]||m(e))):null}function yu(e,t,n){const r=[],i=e=>e(u);let o,a,s,u,l,c;if(null==t)r.push(e.map(n));else for(o={},a=0,s=e.length;at(n,e)),y(t),m(t))}function _u(e){Fa.call(this,[void 0,void 0],e)}function wu(e,t){fa.call(this,e),this.parent=t,this.count=0}function ku(e){Fa.call(this,{},e),this._keys=Ee();const t=this._targets=[];t.active=0,t.forEach=e=>{for(let n=0,r=t.active;nk(e))):k(e.name,e.as)}function Ou(e){Fa.call(this,Ee(),e)}function Du(e){Fa.call(this,[],e)}function Cu(e){Fa.call(this,[],e)}function Su(e){Fa.call(this,null,e)}function Fu(e){Fa.call(this,[],e)}hu.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:pu.concat(gu)},{name:"as",type:"string",array:!0,default:["value","density"]}]},De(hu,Fa,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=du(e.distribution,function(e){return()=>e.materialize(e.SOURCE).source}(t)),i=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let a=e.method||"pdf";"pdf"!==a&&"cdf"!==a&&_("Invalid density method: "+a),e.extent||r.data||_("Missing density extent parameter."),a=r[a];const s=e.as||["value","density"],u=Rs(a,e.extent||xe(r.data()),i,o).map((e=>{const t={};return t[s[0]]=e[0],t[s[1]]=e[1],ea(t)}));this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}}),vu.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]},De(vu,Fa,{transform(e,t){if(this.value&&!e.modified()&&!t.changed())return t;const n=t.materialize(t.SOURCE).source,r=yu(t.source,e.groupby,E),i=e.smooth||!1,o=e.field,a=e.step||((e,t)=>Ue(xe(e,t))/30)(n,o),s=ia(((e,t)=>o(e)-o(t))),u=e.as||"bin",l=r.length;let c,f=1/0,d=-1/0,h=0;for(;hd&&(d=t),e[++c][u]=t}return this.value={start:f,stop:d,step:a},t.reflow(!0).modifies(u)}}),De(bu,fa),_u.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},De(_u,Fa,{transform(e,t){const n=this.value,r=e.field,i=t.changed()||t.modified(r.fields)||e.modified("field");let o=n[0],a=n[1];if((i||null==o)&&(o=1/0,a=-1/0),t.visit(i?t.SOURCE:t.ADD,(e=>{const t=W(r(e));null!=t&&(ta&&(a=t))})),!Number.isFinite(o)||!Number.isFinite(a)){let e=m(r);e&&(e=` for field "${e}"`),t.dataflow.warn(`Infinite extent${e}: [${o}, ${a}]`),o=a=void 0}this.value=[o,a]}}),De(wu,fa,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}}),De(ku,Fa,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,r){const i=this.value;let o,a,s=ke(i,e)&&i[e];return s?s.value.stampe&&e.count>0));this.initTargets(e)}},initTargets(e){const t=this._targets,n=t.length,r=e?e.length:0;let i=0;for(;ithis.subflow(e,i,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,(e=>{const t=Ko(e),n=o.get(t);void 0!==n&&(o.delete(t),s(n).rem(e))})),t.visit(t.ADD,(e=>{const t=r(e);o.set(Ko(e),t),s(t).add(e)})),a||t.modified(r.fields)?t.visit(t.MOD,(e=>{const t=Ko(e),n=o.get(t),i=r(e);n===i?s(i).mod(e):(o.set(t,i),s(n).rem(e),s(i).add(e))})):t.changed(t.MOD)&&t.visit(t.MOD,(e=>{s(o.get(Ko(e))).mod(e)})),a&&t.visit(t.REFLOW,(e=>{const t=Ko(e),n=o.get(t),i=r(e);n!==i&&(o.set(t,i),s(n).rem(e),s(i).add(e))})),t.clean()?n.runAfter((()=>{this.clean(),o.clean()})):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}}),De(Au,fa),Ou.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},De(Ou,Fa,{transform(e,t){const n=t.dataflow,r=this.value,i=t.fork(),o=i.add,a=i.rem,s=i.mod,u=e.expr;let l=!0;function c(t){const n=Ko(t),i=u(t,e),c=r.get(n);i&&c?(r.delete(n),o.push(t)):i||c?l&&i&&!c&&s.push(t):(r.set(n,1),a.push(t))}return t.visit(t.REM,(e=>{const t=Ko(e);r.has(t)?r.delete(t):a.push(e)})),t.visit(t.ADD,(t=>{u(t,e)?o.push(t):r.set(Ko(t),1)})),t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}}),Du.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},De(Du,Fa,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=mu(r,e.as||[]),o=e.index||null,a=i.length;return n.rem=this.value,t.visit(t.SOURCE,(e=>{const t=r.map((t=>t(e))),s=t.reduce(((e,t)=>Math.max(e,t.length)),0);let u,l,c,f=0;for(;f{for(let t,o=0;ot[r]=n(t,e)))}}),De(Fu,Fa,{transform(e,t){const n=t.fork(t.ALL),r=e.generator;let i,o,a,s=this.value,u=e.size-s.length;if(u>0){for(i=[];--u>=0;)i.push(a=ea(r(e))),s.push(a);n.add=n.add.length?n.materialize(n.ADD).add.concat(i):i}else o=s.slice(0,-u),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,s=s.slice(-u);return n.source=this.value=s,n}});const Mu={value:"value",median:Ua,mean:function(e,t){let n=0,r=0;if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(++n,r+=t);else{let i=-1;for(let o of e)null!=(o=t(o,++i,e))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n},min:Ba,max:Na},ju=[];function $u(e){Fa.call(this,[],e)}function Nu(e){nu.call(this,e)}function Bu(e){Fa.call(this,null,e)}function Tu(e){fa.call(this,null,zu,e)}function zu(e){return this.value&&!e.modified()?this.value:Be(e.fields,e.flat)}function Ru(e){Fa.call(this,[],e),this._pending=null}function Pu(e,t,n){n.forEach(ea);const r=t.fork(t.NO_FIELDS&t.NO_SOURCE);return r.rem=e.value,e.value=r.source=r.add=n,e._pending=null,r.rem.length&&r.clean(!0),r}function Lu(e){Fa.call(this,{},e)}function Iu(e){fa.call(this,null,Uu,e)}function Uu(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let r,i,o=1/0,a=-1/0;for(r=0;ra&&(a=i[1]);return[o,a]}function qu(e){fa.call(this,null,Wu,e)}function Wu(e){return this.value&&!e.modified()?this.value:e.values.reduce(((e,t)=>e.concat(t)),[])}function Hu(e){Fa.call(this,null,e)}function Gu(e){nu.call(this,e)}function Vu(e){ku.call(this,e)}function Yu(e){Fa.call(this,null,e)}function Xu(e){Fa.call(this,null,e)}function Zu(e){Fa.call(this,null,e)}function Ju(e){Fa.call(this,null,e)}function Ku(e){Fa.call(this,[],e),this.count=0}function Qu(e){Fa.call(this,null,e)}function el(e){Fa.call(this,null,e),this.modified(!0)}function tl(e){Fa.call(this,null,e)}$u.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},De($u,Fa,{transform(e,t){var n,r,i,o,a,s,u,l,c,f,d=t.fork(t.ALL),h=function(e){var t,n=e.method||Mu.value;if(null!=Mu[n])return n===Mu.value?(t=void 0!==e.value?e.value:0,()=>t):Mu[n];_("Unrecognized imputation method: "+n)}(e),p=function(e){const t=e.field;return e=>e?t(e):NaN}(e),g=m(e.field),y=m(e.key),v=(e.groupby||[]).map(m),b=function(e,t,n,r){var i,o,a,s,u,l,c,f,d=e=>e(f),h=[],p=r?r.slice():[],g={},m={};for(p.forEach(((e,t)=>g[e]=t+1)),s=0,c=e.length;sn.add(e)))):(i=n.value=n.value||this.init(e),t.visit(t.REM,(e=>n.rem(e))),t.visit(t.ADD,(e=>n.add(e)))),n.changes(),t.visit(t.SOURCE,(e=>{be(e,i[n.cellkey(e)].tuple)})),t.reflow(r).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,r;for(n=0,r=this._alen;n{const n=us(t,a)[s],r=e.counts?t.length:1;Rs(n,c||xe(t),f,d).forEach((e=>{const n={};for(let e=0;e(this._pending=ue(e.data),e=>e.touch(this))));return{async:t}}return n.request(e.url,e.format).then((e=>Pu(this,t,ue(e.data))))}}),Lu.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},De(Lu,Fa,{transform(e,t){const n=e.fields,r=e.index,i=e.values,o=null==e.default?null:e.default,a=e.modified(),s=n.length;let u,l,c,f=a?t.SOURCE:t.ADD,d=t,h=e.as;return i?(l=i.length,s>1&&!h&&_('Multi-field lookup requires explicit "as" parameter.'),h&&h.length!==s*l&&_('The "as" parameter has too few output field names.'),h=h||i.map(m),u=function(e){for(var t,a,u=0,c=0;ut.modified(e.fields))),f|=c?t.MOD:0),t.visit(f,u),d.modifies(h)}}),De(Iu,fa),De(qu,fa),De(Hu,Fa,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),Gu.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Gs,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},De(Gu,nu,{_transform:nu.prototype.transform,transform(e,t){return this._transform(function(e,t){const n=e.field,r=e.value,i=("count"===e.op?"__count__":e.op)||"sum",o=y(n).concat(y(r)),a=function(e,t,n){const r={},i=[];return n.visit(n.SOURCE,(t=>{const n=e(t);r[n]||(r[n]=1,i.push(n))})),i.sort(he),t?i.slice(0,t):i}(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:a.map((()=>i)),fields:a.map((e=>function(e,t,n,r){return g((r=>t(r)===e?n(r):NaN),r,e+"")}(e,n,r,o))),as:a.map((e=>e+"")),modified:e.modified.bind(e)}}(e,t),t)}}),De(Vu,ku,{transform(e,t){const n=e.subflow,r=e.field,i=e=>this.subflow(Ko(e),n,t,e);return(e.modified("field")||r&&t.modified(y(r)))&&_("PreFacet does not support field modification."),this.initTargets(),r?(t.visit(t.MOD,(e=>{const t=i(e);r(e).forEach((e=>t.mod(e)))})),t.visit(t.ADD,(e=>{const t=i(e);r(e).forEach((e=>t.add(ea(e))))})),t.visit(t.REM,(e=>{const t=i(e);r(e).forEach((e=>t.rem(e)))}))):(t.visit(t.MOD,(e=>i(e).mod(e))),t.visit(t.ADD,(e=>i(e).add(e))),t.visit(t.REM,(e=>i(e).rem(e)))),t.clean()&&t.runAfter((()=>this.clean())),t}}),Yu.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},De(Yu,Fa,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=mu(e.fields,e.as||[]),o=r?(e,t)=>function(e,t,n,r){for(let i=0,o=n.length;i{const t=Ko(e);n.rem.push(a[t]),a[t]=null})),t.visit(t.ADD,(e=>{const t=o(e,ea({}));a[Ko(e)]=t,n.add.push(t)})),t.visit(t.MOD,(e=>{n.mod.push(o(e,a[Ko(e)]))})),n}}),De(Xu,Fa,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}}),Zu.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]},De(Zu,Fa,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const i=yu(t.materialize(t.SOURCE).source,e.groupby,e.field),o=(e.groupby||[]).map(m),a=[],s=e.step||.01,u=e.probs||Ls(s/2,1-1e-14,s),l=u.length;return i.forEach((e=>{const t=Wa(e,u);for(let n=0;n{const t=Ko(e);n.rem.push(r[t]),r[t]=null})),t.visit(t.ADD,(e=>{const t=ta(e);r[Ko(e)]=t,n.add.push(t)})),t.visit(t.MOD,(e=>{const t=r[Ko(e)];for(const r in e)t[r]=e[r],n.modifies(r);n.mod.push(t)}))),n}}),Ku.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},De(Ku,Fa,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.modified("size"),i=e.size,o=this.value.reduce(((e,t)=>(e[Ko(t)]=1,e)),{});let a=this.value,s=this.count,u=0;function l(e){let t,r;a.length=u&&(t=a[r],o[Ko(t)]&&n.rem.push(t),a[r]=e)),++s}if(t.rem.length&&(t.visit(t.REM,(e=>{const t=Ko(e);o[t]&&(o[t]=-1,n.rem.push(e)),--s})),a=a.filter((e=>-1!==o[Ko(e)]))),(t.rem.length||r)&&a.length{o[Ko(e)]||l(e)})),u=-1),r&&a.length>i){const e=a.length-i;for(let t=0;t{o[Ko(e)]&&n.mod.push(e)})),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=a.filter((e=>!o[Ko(e)]))),this.count=s,this.value=n.source=a,n}}),Qu.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},De(Qu,Fa,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),r=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Ls(e.start,e.stop,e.step||1).map((e=>{const t={};return t[r]=e,ea(t)})),n.add=t.add.concat(this.value),n}}),De(el,Fa,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});const nl=["unit0","unit1"];function rl(e){Fa.call(this,Ee(),e)}function il(e){Fa.call(this,null,e)}tl.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:Rn,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:nl}]},De(tl,Fa,{transform(e,t){const n=e.field,r=!1!==e.interval,i="utc"===e.timezone,o=this._floor(e,t),a=(i?pr:hr)(o.unit).offset,s=e.as||nl,u=s[0],l=s[1],c=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(y(n)))&&(h=(t=t.reflow(!0)).SOURCE,f=1/0,d=-1/0),t.visit(h,(e=>{const t=n(e);let i,s;null==t?(e[u]=null,r&&(e[l]=null)):(e[u]=i=s=o(t),r&&(e[l]=s=a(i,c)),id&&(d=s))})),o.start=f,o.stop=d,t.modifies(r?s:u)},_floor(e,t){const n="utc"===e.timezone,{units:r,step:i}=e.units?{units:e.units,step:e.step||1}:Fr({extent:e.extent||xe(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=Ln(r),a=this.value||{},s=(n?cr:sr)(o,i);return s.unit=q(o),s.units=o,s.step=i,s.start=a.start,s.stop=a.stop,this.value=s}}),De(rl,Fa,{transform(e,t){const n=t.dataflow,r=e.field,i=this.value,o=e=>i.set(r(e),e);let a=!0;return e.modified("field")||t.modified(r.fields)?(i.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,(e=>i.delete(r(e)))),t.visit(t.ADD,o)):a=!1,this.modified(a),i.empty>n.cleanThreshold&&n.runAfter(i.clean),t.fork()}}),De(il,Fa,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(ia(e.sort)):t.source).map(e.field))}});const ol={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?++e:e}}},percent_rank:function(){const e=ol.rank(),t=e.next;return{init:e.init,next:e=>(t(e)-1)/(e.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,r=t.compare;let i=t.index;if(e0||_("ntile num must be greater than zero.");const n=ol.cume_dist(),r=n.next;return{init:n.init,next:e=>Math.ceil(t*r(e))}},lag:function(e,t){return t=+t||1,{next:n=>{const r=n.index-t;return r>=0?e(n.data[r]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const r=n.index+t,i=n.data;return re(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return(t=+t)>0||_("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(t-1);return rt=null,next:n=>{const r=e(n.data[n.index]);return null!=r?t=r:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:r=>{const i=r.data;return r.index<=n?t:(n=function(e,t,n){for(let r=t.length;nu[e]=1))}h(e.sort),t.forEach(((e,t)=>{const u=n[t],p=r[t],g=i[t]||null,y=m(u),v=Us(e,y,o[t]);if(h(u),a.push(v),ke(ol,e))s.push(function(e,t,n,r){const i=ol[e](t,n);return{init:i.init||O,update:function(e,t){t[r]=i.next(e)}}}(e,u,p,v));else{if(null==u&&"count"!==e&&_("Null aggregate field specified."),"count"===e)return void c.push(v);d=!1;let t=l[y];t||(t=l[y]=[],t.field=u,f.push(t)),t.push(Vs(e,g,v))}})),(c.length||f.length)&&(this.cell=function(e,t,n){e=e.map((e=>Qs(e,e.field)));const r={num:0,agg:null,store:!1,count:t};if(!n)for(var i=e.length,o=r.agg=Array(i),a=0;a0&&!i(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),re.init())),this.cell&&this.cell.init()},ul.update=function(e,t){const n=this.cell,r=this.windows,i=e.data,o=r&&r.length;let a;if(n){for(a=e.p0;athis.group(i(e));let a=this.state;a&&!n||(a=this.state=new sl(e)),n||t.modified(a.inputs)?(this.value={},t.visit(t.SOURCE,(e=>o(e).add(e)))):(t.visit(t.REM,(e=>o(e).remove(e))),t.visit(t.ADD,(e=>o(e).add(e))));for(let t=0,n=this._mlen;t0)for(var r,i=e[0],o=t[0],a=e[n]-i,s=t[n]-o,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*e[u]+(1-this._beta)*(i+r*a),this._beta*t[u]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const bl=function e(t){function n(e){return 1===t?new pl(e):new vl(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function xl(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function _l(e,t){this._context=e,this._k=(1-t)/6}_l.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:xl(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:xl(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const wl=function e(t){function n(e){return new _l(e,t)}return n.tension=function(t){return e(+t)},n}(0);function kl(e,t){this._context=e,this._k=(1-t)/6}kl.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(e,t){switch(e=+e,t=+t,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:xl(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Al=function e(t){function n(e){return new kl(e,t)}return n.tension=function(t){return e(+t)},n}(0);function El(e,t){this._context=e,this._k=(1-t)/6}El.prototype={areaStart:gl,areaEnd:gl,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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:xl(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Ol=function e(t){function n(e){return new El(e,t)}return n.tension=function(t){return e(+t)},n}(0),Dl=Math.abs,Cl=Math.atan2,Sl=Math.cos,Fl=Math.max,Ml=Math.min,jl=Math.sin,$l=Math.sqrt,Nl=1e-12,Bl=Math.PI,Tl=Bl/2,zl=2*Bl;function Rl(e){return e>=1?Tl:e<=-1?-Tl:Math.asin(e)}function Pl(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>Nl){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>Nl){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*l+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}function Ll(e,t){this._context=e,this._alpha=t}Ll.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Pl(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Il=function e(t){function n(e){return t?new Ll(e,t):new _l(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Ul(e,t){this._context=e,this._alpha=t}Ul.prototype={areaStart:gl,areaEnd:gl,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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Pl(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const ql=function e(t){function n(e){return t?new Ul(e,t):new El(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Wl(e,t){this._context=e,this._alpha=t}Wl.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Pl(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Hl=function e(t){function n(e){return t?new Wl(e,t):new kl(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Gl(e){this._context=e}function Vl(e){return new Gl(e)}function Yl(e){this._context=e}function Xl(e){return e<0?-1:1}function Zl(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Xl(o)+Xl(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Jl(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Kl(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function Ql(e){this._context=e}function ec(e){this._context=new tc(e)}function tc(e){this._context=e}function nc(e){this._context=e}function rc(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};const ac=Math.PI,sc=2*ac,uc=1e-6,lc=sc-uc;function cc(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return cc;const n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;tuc)if(Math.abs(c*s-u*l)>uc&&i){let d=n-o,h=r-a,p=s*s+u*u,g=d*d+h*h,m=Math.sqrt(p),y=Math.sqrt(f),v=i*Math.tan((ac-Math.acos((p+f-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>uc&&this._append`L${e+b*l},${t+b*c}`,this._append`A${i},${i},0,0,${+(c*d>l*h)},${this._x1=e+x*s},${this._y1=t+x*u}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,n,r,i,o){if(e=+e,t=+t,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),u=e+a,l=t+s,c=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${u},${l}`:(Math.abs(this._x1-u)>uc||Math.abs(this._y1-l)>uc)&&this._append`L${u},${l}`,n&&(f<0&&(f=f%sc+sc),f>lc?this._append`A${n},${n},0,1,${c},${e-a},${t-s}A${n},${n},0,1,${c},${this._x1=u},${this._y1=l}`:f>uc&&this._append`A${n},${n},0,${+(f>=ac)},${c},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function dc(){return new fc}function hc(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new fc(t)}function pc(e){return e.innerRadius}function gc(e){return e.outerRadius}function mc(e){return e.startAngle}function yc(e){return e.endAngle}function vc(e){return e&&e.padAngle}function bc(e,t,n,r,i,o,a){var s=e-n,u=t-r,l=(a?o:-o)/$l(s*s+u*u),c=l*u,f=-l*s,d=e+c,h=t+f,p=n+c,g=r+f,m=(d+p)/2,y=(h+g)/2,v=p-d,b=g-h,x=v*v+b*b,_=i-o,w=d*g-p*h,k=(b<0?-1:1)*$l(Fl(0,_*_*x-w*w)),A=(w*b-v*k)/x,E=(-w*v-b*k)/x,O=(w*b+v*k)/x,D=(-w*v+b*k)/x,C=A-m,S=E-y,F=O-m,M=D-y;return C*C+S*S>F*F+M*M&&(A=O,E=D),{cx:A,cy:E,x01:-c,y01:-f,x11:A*(i/_-1),y11:E*(i/_-1)}}function xc(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function _c(e){return e[0]}function wc(e){return e[1]}function kc(e,t){var n=oc(!0),r=null,i=Vl,o=null,a=hc(s);function s(s){var u,l,c,f=(s=xc(s)).length,d=!1;for(null==r&&(o=i(c=a())),u=0;u<=f;++u)!(u=f;--d)s.point(y[d],v[d]);s.lineEnd(),s.areaEnd()}m&&(y[c]=+e(h,c,l),v[c]=+t(h,c,l),s.point(r?+r(h,c,l):y[c],n?+n(h,c,l):v[c]))}if(p)return s=null,p+""||null}function c(){return kc().defined(i).curve(a).context(o)}return e="function"==typeof e?e:void 0===e?_c:oc(+e),t="function"==typeof t?t:oc(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?wc:oc(+n),l.x=function(t){return arguments.length?(e="function"==typeof t?t:oc(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:oc(+t),l):e},l.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:oc(+e),l):r},l.y=function(e){return arguments.length?(t="function"==typeof e?e:oc(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t="function"==typeof e?e:oc(+e),l):t},l.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:oc(+e),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(r).y(t)},l.defined=function(e){return arguments.length?(i="function"==typeof e?e:oc(!!e),l):i},l.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),l):a},l.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),l):o},l}dc.prototype=fc.prototype,Array.prototype.slice,$l(3);const Ec={draw(e,t){const n=$l(t/Bl);e.moveTo(n,0),e.arc(0,0,n,0,zl)}};$l(1/3),jl(Bl/10),jl(7*Bl/10);function Oc(e,t){if("undefined"!=typeof document&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}jl(zl/10),Sl(zl/10),$l(3),$l(3),$l(3),$l(12);const Dc=()=>"undefined"!=typeof Image?Image:null,Cc=En(kn),Sc=Cc.right,Fc=Cc.left,Mc=(En(Pa).center,Sc);function jc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function $c(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Nc(){}var Bc=.7,Tc=1/Bc,zc="\\s*([+-]?\\d+)\\s*",Rc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Pc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Lc=/^#([0-9a-f]{3,8})$/,Ic=new RegExp(`^rgb\\(${zc},${zc},${zc}\\)$`),Uc=new RegExp(`^rgb\\(${Pc},${Pc},${Pc}\\)$`),qc=new RegExp(`^rgba\\(${zc},${zc},${zc},${Rc}\\)$`),Wc=new RegExp(`^rgba\\(${Pc},${Pc},${Pc},${Rc}\\)$`),Hc=new RegExp(`^hsl\\(${Rc},${Pc},${Pc}\\)$`),Gc=new RegExp(`^hsla\\(${Rc},${Pc},${Pc},${Rc}\\)$`),Vc={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};function Yc(){return this.rgb().formatHex()}function Xc(){return this.rgb().formatRgb()}function Zc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Lc.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Jc(t):3===n?new tf(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Kc(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Kc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Ic.exec(e))?new tf(t[1],t[2],t[3],1):(t=Uc.exec(e))?new tf(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=qc.exec(e))?Kc(t[1],t[2],t[3],t[4]):(t=Wc.exec(e))?Kc(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Hc.exec(e))?uf(t[1],t[2]/100,t[3]/100,1):(t=Gc.exec(e))?uf(t[1],t[2]/100,t[3]/100,t[4]):Vc.hasOwnProperty(e)?Jc(Vc[e]):"transparent"===e?new tf(NaN,NaN,NaN,0):null}function Jc(e){return new tf(e>>16&255,e>>8&255,255&e,1)}function Kc(e,t,n,r){return r<=0&&(e=t=n=NaN),new tf(e,t,n,r)}function Qc(e){return e instanceof Nc||(e=Zc(e)),e?new tf((e=e.rgb()).r,e.g,e.b,e.opacity):new tf}function ef(e,t,n,r){return 1===arguments.length?Qc(e):new tf(e,t,n,null==r?1:r)}function tf(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function nf(){return`#${sf(this.r)}${sf(this.g)}${sf(this.b)}`}function rf(){const e=of(this.opacity);return`${1===e?"rgb(":"rgba("}${af(this.r)}, ${af(this.g)}, ${af(this.b)}${1===e?")":`, ${e})`}`}function of(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function af(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function sf(e){return((e=af(e))<16?"0":"")+e.toString(16)}function uf(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ff(e,t,n,r)}function lf(e){if(e instanceof ff)return new ff(e.h,e.s,e.l,e.opacity);if(e instanceof Nc||(e=Zc(e)),!e)return new ff;if(e instanceof ff)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n0&&u<1?0:a,new ff(a,s,u,e.opacity)}function cf(e,t,n,r){return 1===arguments.length?lf(e):new ff(e,t,n,null==r?1:r)}function ff(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function df(e){return(e=(e||0)%360)<0?e+360:e}function hf(e){return Math.max(0,Math.min(1,e||0))}function pf(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function gf(e,t,n,r,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*n+(1+3*e+3*o-3*a)*r+a*i)/6}function mf(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],a=r>0?e[r-1]:2*i-o,s=r=240?e-240:e+120,i,r),pf(e,i,r),pf(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ff(df(this.h),hf(this.s),hf(this.l),of(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=of(this.opacity);return`${1===e?"hsl(":"hsla("}${df(this.h)}, ${100*hf(this.s)}%, ${100*hf(this.l)}%${1===e?")":`, ${e})`}`}}));const vf=e=>()=>e;function bf(e,t){return function(n){return e+n*t}}function xf(e,t){var n=t-e;return n?bf(e,n>180||n<-180?n-360*Math.round(n/360):n):vf(isNaN(e)?t:e)}function _f(e,t){var n=t-e;return n?bf(e,n):vf(isNaN(e)?t:e)}const wf=function e(t){var n=function(e){return 1==(e=+e)?_f:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):vf(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=ef(e)).r,(t=ef(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=_f(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function kf(e){return function(t){var n,r,i=t.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;no&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Mf(n,r)})),o=Nf.lastIndex;return ot&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?qf:Uf,i=o=null,f}function f(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),s,u)))(e(l(t)))}return f.invert=function(n){return l(t((o||(o=r(s,a.map(e),Mf)))(n)))},f.domain=function(e){return arguments.length?(a=Array.from(e,Rf),c()):a.slice()},f.range=function(e){return arguments.length?(s=Array.from(e),c()):s.slice()},f.rangeRound=function(e){return s=Array.from(e),u=zf,c()},f.clamp=function(e){return arguments.length?(l=!!e||Lf,c()):l!==Lf},f.interpolate=function(e){return arguments.length?(u=e,c()):u},f.unknown=function(e){return arguments.length?(n=e,f):n},function(n,r){return e=n,t=r,c()}}function Gf(){return Hf()(Lf,Lf)}function Vf(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Yf(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}function Xf(e,t,n,r){var i,o=bt(e,t,n);switch((r=wt(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=Ot(o,a))||(r.precision=i),Nt(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=Dt(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=Ct(o))||(r.precision=i-2*("%"===r.type))}return $t(r)}function Zf(e){var t=e.domain;return e.ticks=function(e){var n=t();return yt(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return Xf(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,s=o.length-1,u=o[a],l=o[s],c=10;for(l0;){if((i=vt(u,l,n))===r)return o[a]=u,o[s]=l,t(o);if(i>0)u=Math.floor(u/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;u=Math.ceil(u*i)/i,l=Math.floor(l*i)/i}r=i}return e},e}function Jf(e,t){var n,r=0,i=(e=e.slice()).length-1,o=e[r],a=e[i];return a-e(-t,n)}function id(e){const t=e(Kf,Qf),n=t.domain;let r,i,o=10;function a(){return r=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(o),i=function(e){return 10===e?nd:e===Math.E?Math.exp:t=>Math.pow(e,t)}(o),n()[0]<0?(r=rd(r),i=rd(i),e(ed,td)):e(Kf,Qf),t}return t.base=function(e){return arguments.length?(o=+e,a()):o},t.domain=function(e){return arguments.length?(n(e),a()):n()},t.ticks=e=>{const t=n();let a=t[0],s=t[t.length-1];const u=s0){for(;f<=d;++f)for(l=1;ls)break;p.push(c)}}else for(;f<=d;++f)for(l=o-1;l>=1;--l)if(c=f>0?l/i(-f):l*i(f),!(cs)break;p.push(c)}2*p.length{if(null==e&&(e=10),null==n&&(n=10===o?"s":","),"function"!=typeof n&&(o%1||null!=(n=wt(n)).precision||(n.trim=!0),n=$t(n)),e===1/0)return n;const a=Math.max(1,o*e/t.ticks().length);return e=>{let t=e/i(Math.round(r(e)));return t*on(Jf(n(),{floor:e=>i(Math.floor(r(e))),ceil:e=>i(Math.ceil(r(e)))})),t}function od(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function ad(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function sd(e){return e<0?-e*e:e*e}function ud(e){var t=e(Lf,Lf),n=1;return t.exponent=function(t){return arguments.length?1==(n=+t)?e(Lf,Lf):.5===n?e(ad,sd):e(od(n),od(1/n)):n},Zf(t)}function ld(){var e=ud(Hf());return e.copy=function(){return Wf(e,ld()).exponent(e.exponent())},Vf.apply(e,arguments),e}function cd(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function fd(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function dd(e){var t=1,n=e(cd(t),fd(t));return n.constant=function(n){return arguments.length?e(cd(t=+n),fd(t)):t},Zf(n)}function hd(e,t,n,r,i,o){const a=[[_n,1,It],[_n,5,5e3],[_n,15,15e3],[_n,30,3e4],[o,1,Ut],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,qt],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,Wt],[r,2,1728e5],[n,1,Ht],[t,1,2592e6],[t,3,7776e6],[e,1,Gt]];function s(t,n,r){const i=Math.abs(n-t)/r,o=En((([,,e])=>e)).right(a,i);if(o===a.length)return e.every(bt(t/Gt,n/Gt,r));if(0===o)return wn.every(Math.max(bt(t,n,r),1));const[s,u]=a[i/a[o-1][2]180?t+=360:t-e>180&&(e+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Mf(e,t)})):t&&n.push(i(n)+"rotate("+t+r)}(o.rotate,a.rotate,s,u),function(e,t,n,o){e!==t?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Mf(e,t)}):t&&n.push(i(n)+"skewX("+t+r)}(o.skewX,a.skewX,s,u),function(e,t,n,r,o,a){if(e!==n||t!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:Mf(e,n)},{i:s-2,x:Mf(t,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(e){for(var t,n=-1,r=u.length;++nih?Math.pow(e,1/3):e/rh+th}function lh(e){return e>nh?e*e*e:rh*(e-th)}function ch(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function fh(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function dh(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof hh)return new hh(e.h,e.c,e.l,e.opacity);if(e instanceof sh||(e=oh(e)),0===e.a&&0===e.b)return new hh(NaN,00?r:1:0}const Hh="linear",Gh="log",Vh="pow",Yh="sqrt",Xh="symlog",Zh="time",Jh="utc",Kh="sequential",Qh="diverging",ep="quantile",tp="quantize",np="threshold",rp="ordinal",ip="point",op="band",ap="bin-ordinal",sp="continuous",up="discrete",lp="discretizing",cp="interpolating",fp="temporal";function dp(){const e=Bd().unknown(void 0),t=e.domain,n=e.range;let r,i,o=[0,1],a=!1,s=0,u=0,l=.5;function c(){const e=t().length,c=o[1]h+r*e));return n(c?p.reverse():p)}return delete e.unknown,e.domain=function(e){return arguments.length?(t(e),c()):t()},e.range=function(e){return arguments.length?(o=[+e[0],+e[1]],c()):o.slice()},e.rangeRound=function(e){return o=[+e[0],+e[1]],a=!0,c()},e.bandwidth=function(){return i},e.step=function(){return r},e.round=function(e){return arguments.length?(a=!!e,c()):a},e.padding=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),s=u,c()):s},e.paddingInner=function(e){return arguments.length?(s=Math.max(0,Math.min(1,e)),c()):s},e.paddingOuter=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),c()):u},e.align=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),c()):l},e.invertRange=function(e){if(null==e[0]||null==e[1])return;const r=o[1]o[1-r])?void 0:(u=Math.max(0,Sc(a,f)-1),l=f===d?u:Sc(a,d)-1,f-a[u]>i+1e-10&&++u,r&&(c=u,u=s-l,l=s-c),u>l?void 0:t().slice(u,l+1))},e.invert=function(t){const n=e.invertRange([t,t]);return n?n[0]:n},e.copy=function(){return dp().domain(t()).range(o).round(a).paddingInner(s).paddingOuter(u).align(l)},c()}function hp(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return hp(t())},e}var pp=Array.prototype.map;const gp=Array.prototype.slice,mp=new Map,yp=Symbol("vega_scale");function vp(e){return e[yp]=!0,e}function bp(e,t,n){return arguments.length>1?(mp.set(e,function(e,t,n){const r=function(){const n=t();return n.invertRange||(n.invertRange=n.invert?function(e){return function(t){let n,r=t[0],i=t[1];return i=s&&n[o]<=u&&(l<0&&(l=o),r=o);if(!(l<0))return s=e.invertExtent(n[l]),u=e.invertExtent(n[r]),[void 0===s[0]?s[1]:s[0],void 0===u[1]?u[0]:u[1]]}}(n):void 0),n.type=e,vp(n)};return r.metadata=Ye(ue(n)),r}(e,t,n)),this):xp(e)?mp.get(e):void 0}function xp(e){return mp.has(e)}function _p(e,t){const n=mp.get(e);return n&&n.metadata[t]}function wp(e){return _p(e,sp)}function kp(e){return _p(e,up)}function Ap(e){return _p(e,lp)}function Ep(e){return _p(e,Gh)}function Op(e){return _p(e,cp)}function Dp(e){return _p(e,ep)}bp("identity",(function e(t){var n;function r(e){return null==e||isNaN(e=+e)?n:e}return r.invert=r,r.domain=r.range=function(e){return arguments.length?(t=Array.from(e,Rf),r):t.slice()},r.unknown=function(e){return arguments.length?(n=e,r):n},r.copy=function(){return e(t).unknown(n)},t=arguments.length?Array.from(t,Rf):[0,1],Zf(r)})),bp(Hh,(function e(){var t=Gf();return t.copy=function(){return Wf(t,e())},Vf.apply(t,arguments),Zf(t)}),sp),bp(Gh,(function e(){const t=id(Hf()).domain([1,10]);return t.copy=()=>Wf(t,e()).base(t.base()),Vf.apply(t,arguments),t}),[sp,Gh]),bp(Vh,ld,sp),bp(Yh,(function(){return ld.apply(null,arguments).exponent(.5)}),sp),bp(Xh,(function e(){var t=dd(Hf());return t.copy=function(){return Wf(t,e()).constant(t.constant())},Vf.apply(t,arguments)}),sp),bp(Zh,(function(){return Vf.apply(xd(md,yd,hn,gn,Jt,Vt,yn,bn,_n,Tr).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[sp,fp]),bp(Jh,(function(){return Vf.apply(xd(pd,gd,pn,mn,an,Yt,vn,xn,_n,Rr).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[sp,fp]),bp(Kh,kd,[sp,cp]),bp(`${Kh}-${Hh}`,kd,[sp,cp]),bp(`${Kh}-${Gh}`,(function e(){var t=id(_d()).domain([1,10]);return t.copy=function(){return wd(t,e()).base(t.base())},Yf.apply(t,arguments)}),[sp,cp,Gh]),bp(`${Kh}-${Vh}`,Ad,[sp,cp]),bp(`${Kh}-${Yh}`,(function(){return Ad.apply(null,arguments).exponent(.5)}),[sp,cp]),bp(`${Kh}-${Xh}`,(function e(){var t=dd(_d());return t.copy=function(){return wd(t,e()).constant(t.constant())},Yf.apply(t,arguments)}),[sp,cp]),bp(`${Qh}-${Hh}`,(function e(){var t=Zf(Od()(Lf));return t.copy=function(){return wd(t,e())},Yf.apply(t,arguments)}),[sp,cp]),bp(`${Qh}-${Gh}`,(function e(){var t=id(Od()).domain([.1,1,10]);return t.copy=function(){return wd(t,e()).base(t.base())},Yf.apply(t,arguments)}),[sp,cp,Gh]),bp(`${Qh}-${Vh}`,Dd,[sp,cp]),bp(`${Qh}-${Yh}`,(function(){return Dd.apply(null,arguments).exponent(.5)}),[sp,cp]),bp(`${Qh}-${Xh}`,(function e(){var t=dd(Od());return t.copy=function(){return wd(t,e()).constant(t.constant())},Yf.apply(t,arguments)}),[sp,cp]),bp(ep,(function e(){var t,n=[],r=[],i=[];function o(){var e=0,t=Math.max(1,r.length);for(i=new Array(t-1);++e0?i[t-1]:n[0],t=i?[o[i-1],r]:[o[t-1],o[t]]},s.unknown=function(e){return arguments.length?(t=e,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return e().domain([n,r]).range(a).unknown(t)},Vf.apply(Zf(s),arguments)}),lp),bp(np,(function e(){var t,n=[.5],r=[0,1],i=1;function o(e){return null!=e&&e<=e?r[Mc(n,e,0,i)]:t}return o.domain=function(e){return arguments.length?(n=Array.from(e),i=Math.min(n.length,r.length-1),o):n.slice()},o.range=function(e){return arguments.length?(r=Array.from(e),i=Math.min(n.length,r.length-1),o):r.slice()},o.invertExtent=function(e){var t=r.indexOf(e);return[n[t-1],n[t]]},o.unknown=function(e){return arguments.length?(t=e,o):t},o.copy=function(){return e().domain(n).range(r).unknown(t)},Vf.apply(o,arguments)}),lp),bp(ap,(function e(){let t=[],n=[];function r(e){return null==e||e!=e?void 0:n[(Mc(t,e)-1)%n.length]}return r.domain=function(e){return arguments.length?(t=function(e){return pp.call(e,W)}(e),r):t.slice()},r.range=function(e){return arguments.length?(n=gp.call(e),r):n.slice()},r.tickFormat=function(e,n){return Xf(t[0],q(t),null==e?10:e,n)},r.copy=function(){return e().domain(r.domain()).range(r.range())},r}),[up,lp]),bp(rp,Bd,up),bp(op,dp,up),bp(ip,(function(){return hp(dp().paddingInner(1))}),up);const Cp=["clamp","base","constant","exponent"];function Sp(e,t){const n=t[0],r=q(t)-n;return function(t){return e(n+t*r)}}function Fp(e,t,n){return Ed($p(t||"rgb",n),e)}function Mp(e,t){const n=new Array(t),r=t+1;for(let i=0;ie[t]?a[t](e[t]()):0)),a):ye(.5)}function $p(e,t){const n=i[function(e){return"interpolate"+e.toLowerCase().split("-").map((e=>e[0].toUpperCase()+e.slice(1))).join("")}(e)];return null!=t&&n&&n.gamma?n.gamma(t):n}function Np(e){if(z(e))return e;const t=e.length/6|0,n=new Array(t);for(let r=0;r1?(Tp[e]=t,this):Tp[e]}Bp({accent:Nh,category10:Bh,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:Th,observable10:zh,paired:Rh,pastel1:Ph,pastel2:Lh,set1:Ih,set2:Uh,set3:qh,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"},Np),Bp({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},(e=>Fp(Np(e))));const Rp="symbol",Pp="discrete",Lp=e=>z(e)?e.map((e=>String(e))):String(e),Ip=(e,t)=>e[1]-t[1],Up=(e,t)=>t[1]-e[1];function qp(e,t,n){let r;return je(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),null!=n&&(t=Math.min(t,Math.floor(Ue(e.domain())/n||1)+1))),R(t)&&(r=t.step,t=t.interval),Ne(t)&&(t=e.type===Zh?hr(t):e.type==Jh?pr(t):_("Only time and utc scales accept interval strings."),r&&(t=t.every(r))),t}function Wp(e,t,n){let r=e.range(),i=r[0],o=q(r),a=Ip;if(i>o&&(r=o,o=i,i=r,a=Up),i=Math.floor(i),o=Math.ceil(o),t=t.map((t=>[t,e(t)])).filter((e=>i<=e[1]&&e[1]<=o)).sort(a).map((e=>e[0])),n>0&&t.length>1){const e=[t[0],q(t)];for(;t.length>n&&t.length>=3;)t=t.filter(((e,t)=>!(t%2)));t.length<3&&(t=e)}return t}function Hp(e,t){return e.bins?Wp(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function Gp(e,t,n,r,i,o){const a=t.type;let s=Lp;if(a===Zh||i===Zh)s=e.timeFormat(r);else if(a===Jh||i===Jh)s=e.utcFormat(r);else if(Ep(a)){const i=e.formatFloat(r);if(o||t.bins)s=i;else{const e=Vp(t,n,!1);s=t=>e(t)?i(t):""}}else if(t.tickFormat){const i=t.domain();s=e.formatSpan(i[0],i[i.length-1],n,r)}else r&&(s=e.format(r));return s}function Vp(e,t,n){const r=Hp(e,t),i=e.base(),o=Math.log(i),a=Math.max(1,i*t/r.length),s=e=>{let t=e/Math.pow(i,Math.round(Math.log(e)/o));return t*iYp[e.type]||e.bins;function Kp(e,t,n,r,i,o,a){const s=Xp[t.type]&&o!==Zh&&o!==Jh?function(e,t,n){const r=t[Xp[t.type]](),i=r.length;let o,a=i>1?r[1]-r[0]:r[0];for(o=1;o(t,n,r)=>{const i=eg(r[n+1],eg(r.max,1/0)),o=rg(t,e),a=rg(i,e);return o&&a?o+" – "+a:a?"< "+a:"≥ "+o},eg=(e,t)=>null!=e?e:t,tg=e=>(t,n)=>n?e(t):null,ng=e=>t=>e(t),rg=(e,t)=>Number.isFinite(e)?t(e):null;function ig(e,t,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=function(e,t,n,r){const i=r||t.type;return Ne(n)&&function(e){return _p(e,fp)}(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||i!==Zh?n||i!==Jh?Kp(e,t,5,null,n,r,!0):e.utcFormat("%A, %d %B %Y, %X UTC"):e.timeFormat("%A, %d %B %Y, %X")}(e,t,n.format,n.formatType);if(Ap(t.type)){const e=Zp(t).slice(1).map(i),n=e.length;return`${n} boundar${1===n?"y":"ies"}: ${e.join(", ")}`}if(kp(t.type)){const e=t.domain(),n=e.length;return`${n} value${1===n?"":"s"}: ${n>r?e.slice(0,r-2).map(i).join(", ")+", ending with "+e.slice(-1).map(i):e.map(i).join(", ")}`}{const e=t.domain();return`values from ${i(e[0])} to ${i(q(e))}`}}let og=0;const ag="p_";function sg(e){return e&&e.gradient}function ug(e,t,n){const r=e.gradient;let i=e.id,o="radial"===r?ag:"";return i||(i=e.id="gradient_"+og++,"radial"===r?(e.x1=lg(e.x1,.5),e.y1=lg(e.y1,.5),e.r1=lg(e.r1,0),e.x2=lg(e.x2,.5),e.y2=lg(e.y2,.5),e.r2=lg(e.r2,.5),o=ag):(e.x1=lg(e.x1,0),e.y1=lg(e.y1,0),e.x2=lg(e.x2,1),e.y2=lg(e.y2,0))),t[i]=e,"url("+(n||"")+"#"+o+i+")"}function lg(e,t){return null!=e?e:t}function cg(e,t){var n,r=[];return n={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:r,stop:function(e,t){return r.push({offset:e,color:t}),n}}}const fg={basis:{curve:function(e){return new pl(e)}},"basis-closed":{curve:function(e){return new ml(e)}},"basis-open":{curve:function(e){return new yl(e)}},bundle:{curve:bl,tension:"beta",value:.85},cardinal:{curve:wl,tension:"tension",value:0},"cardinal-open":{curve:Al,tension:"tension",value:0},"cardinal-closed":{curve:Ol,tension:"tension",value:0},"catmull-rom":{curve:Il,tension:"alpha",value:.5},"catmull-rom-closed":{curve:ql,tension:"alpha",value:.5},"catmull-rom-open":{curve:Hl,tension:"alpha",value:.5},linear:{curve:Vl},"linear-closed":{curve:function(e){return new Yl(e)}},monotone:{horizontal:function(e){return new ec(e)},vertical:function(e){return new Ql(e)}},natural:{curve:function(e){return new nc(e)}},step:{curve:function(e){return new ic(e,.5)}},"step-after":{curve:function(e){return new ic(e,1)}},"step-before":{curve:function(e){return new ic(e,0)}}};function dg(e,t,n){var r=ke(fg,e)&&fg[e],i=null;return r&&(i=r.curve||r[t||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}const hg={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},pg=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,gg=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,mg=/^((\s+,?\s*)|(,\s*))/,yg=/^[01]/;function vg(e){const t=[];return(e.match(pg)||[]).forEach((e=>{let n=e[0];const r=n.toLowerCase(),i=hg[r],o=function(e,t,n){const r=[];for(let i=0;t&&i1&&(g=Math.sqrt(g),n*=g,r*=g);const m=d/n,y=f/n,v=-f/r,b=d/r,x=m*s+y*u,_=v*s+b*u,w=m*e+y*t,k=v*e+b*t;let A=1/((w-x)*(w-x)+(k-_)*(k-_))-.25;A<0&&(A=0);let E=Math.sqrt(A);o==i&&(E=-E);const O=.5*(x+w)-E*(k-_),D=.5*(_+k)+E*(w-x),C=Math.atan2(_-D,x-O);let S=Math.atan2(k-D,w-O)-C;S<0&&1===o?S+=_g:S>0&&0===o&&(S-=_g);const F=Math.ceil(Math.abs(S/(xg+.001))),M=[];for(let e=0;e+e}function Ig(e,t,n){return Math.max(t,Math.min(e,n))}function Ug(){var e=Tg,t=zg,n=Rg,r=Pg,i=Lg(0),o=i,a=i,s=i,u=null;function l(l,c,f){var d,h=null!=c?c:+e.call(this,l),p=null!=f?f:+t.call(this,l),g=+n.call(this,l),m=+r.call(this,l),y=Math.min(g,m)/2,v=Ig(+i.call(this,l),0,y),b=Ig(+o.call(this,l),0,y),x=Ig(+a.call(this,l),0,y),_=Ig(+s.call(this,l),0,y);if(u||(u=d=dc()),v<=0&&b<=0&&x<=0&&_<=0)u.rect(h,p,g,m);else{var w=h+g,k=p+m;u.moveTo(h+v,p),u.lineTo(w-b,p),u.bezierCurveTo(w-Bg*b,p,w,p+Bg*b,w,p+b),u.lineTo(w,k-_),u.bezierCurveTo(w,k-Bg*_,w-Bg*_,k,w-_,k),u.lineTo(h+x,k),u.bezierCurveTo(h+Bg*x,k,h,k-Bg*x,h,k-x),u.lineTo(h,p+v),u.bezierCurveTo(h,p+Bg*v,h+Bg*v,p,h+v,p),u.closePath()}if(d)return u=null,d+""||null}return l.x=function(t){return arguments.length?(e=Lg(t),l):e},l.y=function(e){return arguments.length?(t=Lg(e),l):t},l.width=function(e){return arguments.length?(n=Lg(e),l):n},l.height=function(e){return arguments.length?(r=Lg(e),l):r},l.cornerRadius=function(e,t,n,r){return arguments.length?(i=Lg(e),o=null!=t?Lg(t):i,s=null!=n?Lg(n):i,a=null!=r?Lg(r):o,l):i},l.context=function(e){return arguments.length?(u=null==e?null:e,l):u},l}function qg(){var e,t,n,r,i,o,a,s,u=null;function l(e,t,n){const r=n/2;if(i){var l=a-t,c=e-o;if(l||c){var f=Math.hypot(l,c),d=(l/=f)*s,h=(c/=f)*s,p=Math.atan2(c,l);u.moveTo(o-d,a-h),u.lineTo(e-l*r,t-c*r),u.arc(e,t,r,p-Math.PI,p),u.lineTo(o+d,a+h),u.arc(o,a,s,p,p+Math.PI)}else u.arc(e,t,r,0,_g);u.closePath()}else i=1;o=e,a=t,s=r}function c(o){var a,s,c,f=o.length,d=!1;for(null==u&&(u=c=dc()),a=0;a<=f;++a)!(ae.x||0,Gg=e=>e.y||0,Vg=e=>!(!1===e.defined),Yg=function(){var e=pc,t=gc,n=oc(0),r=null,i=mc,o=yc,a=vc,s=null,u=hc(l);function l(){var l,c,f=+e.apply(this,arguments),d=+t.apply(this,arguments),h=i.apply(this,arguments)-Tl,p=o.apply(this,arguments)-Tl,g=Dl(p-h),m=p>h;if(s||(s=l=u()),dNl)if(g>zl-Nl)s.moveTo(d*Sl(h),d*jl(h)),s.arc(0,0,d,h,p,!m),f>Nl&&(s.moveTo(f*Sl(p),f*jl(p)),s.arc(0,0,f,p,h,m));else{var y,v,b=h,x=p,_=h,w=p,k=g,A=g,E=a.apply(this,arguments)/2,O=E>Nl&&(r?+r.apply(this,arguments):$l(f*f+d*d)),D=Ml(Dl(d-f)/2,+n.apply(this,arguments)),C=D,S=D;if(O>Nl){var F=Rl(O/f*jl(E)),M=Rl(O/d*jl(E));(k-=2*F)>Nl?(_+=F*=m?1:-1,w-=F):(k=0,_=w=(h+p)/2),(A-=2*M)>Nl?(b+=M*=m?1:-1,x-=M):(A=0,b=x=(h+p)/2)}var j=d*Sl(b),$=d*jl(b),N=f*Sl(w),B=f*jl(w);if(D>Nl){var T,z=d*Sl(x),R=d*jl(x),P=f*Sl(_),L=f*jl(_);if(g1?0:e<-1?Bl:Math.acos(e)}((I*q+U*W)/($l(I*I+U*U)*$l(q*q+W*W)))/2),G=$l(T[0]*T[0]+T[1]*T[1]);C=Ml(D,(f-G)/(H-1)),S=Ml(D,(d-G)/(H+1))}else C=S=0}A>Nl?S>Nl?(y=bc(P,L,j,$,d,S,m),v=bc(z,R,N,B,d,S,m),s.moveTo(y.cx+y.x01,y.cy+y.y01),SNl&&k>Nl?C>Nl?(y=bc(N,B,z,R,f,-C,m),v=bc(j,$,P,L,f,-C,m),s.lineTo(y.cx+y.x01,y.cy+y.y01),Ce.startAngle||0)).endAngle((e=>e.endAngle||0)).padAngle((e=>e.padAngle||0)).innerRadius((e=>e.innerRadius||0)).outerRadius((e=>e.outerRadius||0)).cornerRadius((e=>e.cornerRadius||0)),Xg=Ac().x(Hg).y1(Gg).y0((e=>(e.y||0)+(e.height||0))).defined(Vg),Zg=Ac().y(Gg).x1(Hg).x0((e=>(e.x||0)+(e.width||0))).defined(Vg),Jg=kc().x(Hg).y(Gg).defined(Vg),Kg=Ug().x(Hg).y(Gg).width((e=>e.width||0)).height((e=>e.height||0)).cornerRadius((e=>Wg(e.cornerRadiusTopLeft,e.cornerRadius)||0),(e=>Wg(e.cornerRadiusTopRight,e.cornerRadius)||0),(e=>Wg(e.cornerRadiusBottomRight,e.cornerRadius)||0),(e=>Wg(e.cornerRadiusBottomLeft,e.cornerRadius)||0)),Qg=function(e,t){let n=null,r=hc(i);function i(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return e="function"==typeof e?e:oc(e||Ec),t="function"==typeof t?t:oc(void 0===t?64:+t),i.type=function(t){return arguments.length?(e="function"==typeof t?t:oc(t),i):e},i.size=function(e){return arguments.length?(t="function"==typeof e?e:oc(+e),i):t},i.context=function(e){return arguments.length?(n=null==e?null:e,i):n},i}().type((e=>$g(e.shape||"circle"))).size((e=>Wg(e.size,64))),em=qg().x(Hg).y(Gg).defined(Vg).size((e=>e.size||1));function tm(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function nm(e,t,n,r){return Kg.context(e)(t,n,r)}var rm=1;function im(){rm=1}function om(e,t,n){var r=t.clip,i=e._defs,o=t.clip_id||(t.clip_id="clip"+rm++),a=i.clipping[o]||(i.clipping[o]={id:o});return ce(r)?a.path=r(null):tm(n)?a.path=nm(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function am(e){this.clear(),e&&this.union(e)}function sm(e){this.mark=e,this.bounds=this.bounds||new am}function um(e){sm.call(this,e),this.items=this.items||[]}am.prototype={clone(){return new am(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,r){return nthis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const r=this.rotatedPoints(e,t,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(e,t,n){var{x1:r,y1:i,x2:o,y2:a}=this,s=Math.cos(e),u=Math.sin(e),l=t-t*s+n*u,c=n-t*u-n*s;return[s*r-u*i+l,u*r+s*i+c,s*r-u*a+l,u*r+s*a+c,s*o-u*i+l,u*o+s*i+c,s*o-u*a+l,u*o+s*a+c]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},De(um,sm);class lm{constructor(e){this._pending=0,this._loader=e||Go()}pending(){return this._pending}sanitizeURL(e){const t=this;return cm(t),t._loader.sanitize(e,{context:"href"}).then((e=>(fm(t),e))).catch((()=>(fm(t),null)))}loadImage(e){const t=this,n=Dc();return cm(t),t._loader.sanitize(e,{context:"image"}).then((e=>{const r=e.href;if(!r||!n)throw{url:r};const i=new n,o=ke(e,"crossOrigin")?e.crossOrigin:"anonymous";return null!=o&&(i.crossOrigin=o),i.onload=()=>fm(t),i.onerror=()=>fm(t),i.src=r,i})).catch((e=>(fm(t),{complete:!1,width:0,height:0,src:e&&e.url||""})))}ready(){const e=this;return new Promise((t=>{!function n(r){e.pending()?setTimeout((()=>{n(!0)}),10):t(r)}(!1)}))}}function cm(e){e._pending+=1}function fm(e){e._pending-=1}function dm(e,t,n){if(t.stroke&&0!==t.opacity&&0!==t.strokeOpacity){const r=null!=t.strokeWidth?+t.strokeWidth:1;e.expand(r+(n?function(e,t){return e.strokeJoin&&"miter"!==e.strokeJoin?0:t}(t,r):0))}return e}const hm=_g-1e-8;let pm,gm,mm,ym,vm,bm,xm,_m;const wm=(e,t)=>pm.add(e,t),km=(e,t)=>wm(gm=e,mm=t),Am=e=>wm(e,pm.y1),Em=e=>wm(pm.x1,e),Om=(e,t)=>vm*e+xm*t,Dm=(e,t)=>bm*e+_m*t,Cm=(e,t)=>wm(Om(e,t),Dm(e,t)),Sm=(e,t)=>km(Om(e,t),Dm(e,t));function Fm(e,t){return pm=e,t?(ym=t*bg,vm=_m=Math.cos(ym),bm=Math.sin(ym),xm=-bm):(vm=_m=1,ym=bm=xm=0),Mm}const Mm={beginPath(){},closePath(){},moveTo:Sm,lineTo:Sm,rect(e,t,n,r){ym?(Cm(e+n,t),Cm(e+n,t+r),Cm(e,t+r),Sm(e,t)):(wm(e+n,t+r),km(e,t))},quadraticCurveTo(e,t,n,r){const i=Om(e,t),o=Dm(e,t),a=Om(n,r),s=Dm(n,r);jm(gm,i,a,Am),jm(mm,o,s,Em),km(a,s)},bezierCurveTo(e,t,n,r,i,o){const a=Om(e,t),s=Dm(e,t),u=Om(n,r),l=Dm(n,r),c=Om(i,o),f=Dm(i,o);$m(gm,a,u,c,Am),$m(mm,s,l,f,Em),km(c,f)},arc(e,t,n,r,i,o){if(r+=ym,i+=ym,gm=n*Math.cos(i)+e,mm=n*Math.sin(i)+t,Math.abs(i-r)>hm)wm(e-n,t-n),wm(e+n,t+n);else{const a=r=>wm(n*Math.cos(r)+e,n*Math.sin(r)+t);let s,u;if(a(r),a(i),i!==r)if((r%=_g)<0&&(r+=_g),(i%=_g)<0&&(i+=_g),ii;++u,s-=xg)a(s);else for(s=r-r%xg+xg,u=0;u<4&&s1e-14?(u=a*a+s*o,u>=0&&(u=Math.sqrt(u),l=(-a+u)/o,c=(-a-u)/o)):l=.5*s/a,0m)return!1;h>g&&(g=h)}else if(f>0){if(h0&&(e.globalAlpha=n,e.fillStyle=Hm(e,t,t.fill),!0)}var Vm=[];function Ym(e,t,n){var r=null!=(r=t.strokeWidth)?r:1;return!(r<=0)&&(n*=null==t.strokeOpacity?1:t.strokeOpacity)>0&&(e.globalAlpha=n,e.strokeStyle=Hm(e,t,t.stroke),e.lineWidth=r,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||Vm),e.lineDashOffset=t.strokeDashOffset||0),!0)}function Xm(e,t){return e.zindex-t.zindex||e.index-t.index}function Zm(e){if(!e.zdirty)return e.zitems;var t,n,r,i=e.items,o=[];for(n=0,r=i.length;n=0;)if(n=t(i[r]))return n;if(i===o)for(r=(i=e.items).length;--r>=0;)if(!i[r].zindex&&(n=t(i[r])))return n;return null}function Qm(e){return function(t,n,r){Jm(n,(n=>{r&&!r.intersects(n.bounds)||ty(e,t,n,n)}))}}function ey(e){return function(t,n,r){!n.items.length||r&&!r.intersects(n.bounds)||ty(e,t,n.items[0],n.items)}}function ty(e,t,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(e(t,r)||(Um(t,n),n.fill&&Gm(t,n,i)&&t.fill(),n.stroke&&Ym(t,n,i)&&t.stroke()))}function ny(e){return e=e||C,function(t,n,r,i,o,a){return r*=t.pixelRatio,i*=t.pixelRatio,Km(n,(n=>{const s=n.bounds;if((!s||s.contains(o,a))&&s)return e(t,n,r,i,o,a)?n:void 0}))}}function ry(e,t){return function(n,r,i,o){var a,s,u=Array.isArray(r)?r[0]:r,l=null==t?u.fill:t,c=u.stroke&&n.isPointInStroke;return c&&(a=u.strokeWidth,s=u.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=s?s:"butt"),!e(n,r)&&(l&&n.isPointInPath(i,o)||c&&n.isPointInStroke(i,o))}}function iy(e){return ny(ry(e))}function oy(e,t){return"translate("+e+","+t+")"}function ay(e){return"rotate("+e+")"}function sy(e){return oy(e.x||0,e.y||0)}function uy(e,t,n){function r(e,n){var r=n.x||0,i=n.y||0,o=n.angle||0;e.translate(r,i),o&&e.rotate(o*=bg),e.beginPath(),t(e,n),o&&e.rotate(-o),e.translate(-r,-i)}return{type:e,tag:"path",nested:!1,attr:function(e,n){e("transform",function(e){return oy(e.x||0,e.y||0)+(e.angle?" "+ay(e.angle):"")}(n)),e("d",t(null,n))},bound:function(e,n){return t(Fm(e,n.angle),n),dm(e,n).translate(n.x||0,n.y||0)},draw:Qm(r),pick:iy(r),isect:n||zm(r)}}var ly=uy("arc",(function(e,t){return Yg.context(e)(t)}));function cy(e,t,n){function r(e,n){e.beginPath(),t(e,n)}const i=ry(r);return{type:e,tag:"path",nested:!0,attr:function(e,n){var r=n.mark.items;r.length&&e("d",t(null,r))},bound:function(e,n){var r=n.items;return 0===r.length?e:(t(Fm(e),r),dm(e,r[0]))},draw:ey(r),pick:function(e,t,n,r,o,a){var s=t.items,u=t.bounds;return!s||!s.length||u&&!u.contains(o,a)?null:(n*=e.pixelRatio,r*=e.pixelRatio,i(e,s,n,r)?s[0]:null)},isect:Rm,tip:n}}var fy=cy("area",(function(e,t){const n=t[0],r=n.interpolate||"linear";return("horizontal"===n.orient?Zg:Xg).curve(dg(r,n.orient,n.tension)).context(e)(t)}),(function(e,t){for(var n,r,i="horizontal"===e[0].orient?t[1]:t[0],o="horizontal"===e[0].orient?"y":"x",a=e.length,s=1/0;--a>=0;)!1!==e[a].defined&&(r=Math.abs(e[a][o]-i)).5&&t<1.5?.5-Math.abs(t-1):0}function py(e,t){const n=hy(t);e("d",nm(null,t,n,n))}function gy(e,t,n,r){const i=hy(t);e.beginPath(),nm(e,t,(n||0)+i,(r||0)+i)}const my=ry(gy),yy=ry(gy,!1),vy=ry(gy,!0);var by={type:"group",tag:"g",nested:!1,attr:function(e,t){e("transform",sy(t))},bound:function(e,t){if(!t.clip&&t.items){const n=t.items,r=n.length;for(let t=0;t{const i=t.x||0,o=t.y||0,a=t.strokeForeground,s=null==t.opacity?1:t.opacity;(t.stroke||t.fill)&&s&&(gy(e,t,i,o),Um(e,t),t.fill&&Gm(e,t,s)&&e.fill(),t.stroke&&!a&&Ym(e,t,s)&&e.stroke()),e.save(),e.translate(i,o),t.clip&&dy(e,t),n&&n.translate(-i,-o),Jm(t,(t=>{("group"===t.marktype||null==r||r.includes(t.marktype))&&this.draw(e,t,n,r)})),n&&n.translate(i,o),e.restore(),a&&t.stroke&&s&&(gy(e,t,i,o),Um(e,t),Ym(e,t,s)&&e.stroke())}))},pick:function(e,t,n,r,i,o){if(t.bounds&&!t.bounds.contains(i,o)||!t.items)return null;const a=n*e.pixelRatio,s=r*e.pixelRatio;return Km(t,(u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(i,o))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(ih||op))return;if(e.save(),e.translate(c,f),c=i-c,f=o-f,g&&tm(u)&&!vy(e,u,a,s))return e.restore(),null;const m=u.strokeForeground,y=!1!==t.interactive;return y&&m&&u.stroke&&yy(e,u,a,s)?(e.restore(),u):(l=Km(u,(e=>function(e,t,n){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,n)}(e,c,f)?this.pick(e,n,r,c,f):null)),!l&&y&&(u.fill||!m&&u.stroke)&&my(e,u,a,s)&&(l=u),e.restore(),l||null)}))},isect:Pm,content:function(e,t,n){e("clip-path",t.clip?om(n,t,t):null)},background:function(e,t){e("class","background"),e("aria-hidden",!0),py(e,t)},foreground:function(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?py(e,t):e("d","")}},xy={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function _y(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then((t=>{e.image=t,e.image.url=e.url}))),n}function wy(e,t){return null!=e.width?e.width:t&&t.width?!1!==e.aspect&&e.height?e.height*t.width/t.height:t.width:0}function ky(e,t){return null!=e.height?e.height:t&&t.height?!1!==e.aspect&&e.width?e.width*t.height/t.width:t.height:0}function Ay(e,t){return"center"===e?t/2:"right"===e?t:0}function Ey(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var Oy={type:"image",tag:"image",nested:!1,attr:function(e,t,n){const r=_y(t,n),i=wy(t,r),o=ky(t,r),a=(t.x||0)-Ay(t.align,i),s=(t.y||0)-Ey(t.baseline,o);e("href",!r.src&&r.toDataURL?r.toDataURL():r.src||"",xy["xmlns:xlink"],"xlink:href"),e("transform",oy(a,s)),e("width",i),e("height",o),e("preserveAspectRatio",!1===t.aspect?"none":"xMidYMid")},bound:function(e,t){const n=t.image,r=wy(t,n),i=ky(t,n),o=(t.x||0)-Ay(t.align,r),a=(t.y||0)-Ey(t.baseline,i);return e.set(o,a,o+r,a+i)},draw:function(e,t,n){Jm(t,(t=>{if(n&&!n.intersects(t.bounds))return;const r=_y(t,this);let i=wy(t,r),o=ky(t,r);if(0===i||0===o)return;let a,s,u,l,c=(t.x||0)-Ay(t.align,i),f=(t.y||0)-Ey(t.baseline,o);!1!==t.aspect&&(s=r.width/r.height,u=t.width/t.height,s==s&&u==u&&s!==u&&(u=0;)if(!1!==e[o].defined&&(n=e[o].x-t[0])*n+(r=e[o].y-t[1])*r{if(!n||n.intersects(t.bounds)){var r=null==t.opacity?1:t.opacity;r&&jy(e,t,r)&&(Um(e,t),e.stroke())}}))},pick:ny((function(e,t,n,r){return!!e.isPointInStroke&&jy(e,t,1)&&e.isPointInStroke(n,r)})),isect:Lm},Ny=uy("shape",(function(e,t){return(t.mark.shape||t.shape).context(e)(t)})),By=uy("symbol",(function(e,t){return Qg.context(e)(t)}),Rm);const Ty=Re();var zy={height:qy,measureWidth:Iy,estimateWidth:Py,width:Py,canvas:Ry};function Ry(e){zy.width=e&&Bm?Iy:Py}function Py(e,t){return Ly(Vy(e,t),qy(e))}function Ly(e,t){return~~(.8*e.length*t)}function Iy(e,t){return qy(e)<=0||!(t=Vy(e,t))?0:Uy(t,Xy(e))}function Uy(e,t){const n=`(${t}) ${e}`;let r=Ty.get(n);return void 0===r&&(Bm.font=t,r=Bm.measureText(e).width,Ty.set(n,r)),r}function qy(e){return null!=e.fontSize?+e.fontSize||0:11}function Wy(e){return null!=e.lineHeight?e.lineHeight:qy(e)+2}function Hy(e){return t=e.lineBreak&&e.text&&!z(e.text)?e.text.split(e.lineBreak):e.text,z(t)?t.length>1?t:t[0]:t;var t}function Gy(e){const t=Hy(e);return(z(t)?t.length-1:0)*Wy(e)}function Vy(e,t){const n=null==t?"":(t+"").trim();return e.limit>0&&n.length?function(e,t){var n=+e.limit,r=function(e){if(zy.width===Iy){const t=Xy(e);return e=>Uy(e,t)}if(zy.width===Py){const t=qy(e);return e=>Ly(e,t)}return t=>zy.width(e,t)}(e);if(r(t)>>1,r(t.slice(i))>n?s=i+1:u=i;return o+t.slice(s)}for(;s>>1),r(t.slice(0,i))Math.max(e,zy.width(t,n))),0)):r=zy.width(t,f),"center"===o?l-=r/2:"right"===o&&(l-=r),e.set(l+=s,c+=u,l+r,c+i),t.angle&&!n)e.rotate(t.angle*bg,s,u);else if(2===n)return e.rotatedPoints(t.angle*bg,s,u);return e}var tv={type:"text",tag:"text",nested:!1,attr:function(e,t){var n,r=t.dx||0,i=(t.dy||0)+Zy(t),o=Qy(t),a=o.x1,s=o.y1,u=t.angle||0;e("text-anchor",Jy[t.align]||"start"),u?(n=oy(a,s)+" "+ay(u),(r||i)&&(n+=" "+oy(r,i))):n=oy(a+r,s+i),e("transform",n)},bound:ev,draw:function(e,t,n){Jm(t,(t=>{var r,i,o,a,s,u,l,c=null==t.opacity?1:t.opacity;if(!(n&&!n.intersects(t.bounds)||0===c||t.fontSize<=0||null==t.text||0===t.text.length)){if(e.font=Xy(t),e.textAlign=t.align||"left",i=(r=Qy(t)).x1,o=r.y1,t.angle&&(e.save(),e.translate(i,o),e.rotate(t.angle*bg),i=o=0),i+=t.dx||0,o+=(t.dy||0)+Zy(t),u=Hy(t),Um(e,t),z(u))for(s=Wy(t),a=0;a=0;)if(!1!==e[i].defined&&(n=e[i].x-t[0])*n+(r=e[i].y-t[1])*r<(n=e[i].size||1)*n)return e[i];return null})),rv={arc:ly,area:fy,group:by,image:Oy,line:Dy,path:Sy,rect:My,rule:$y,shape:Ny,symbol:By,text:tv,trail:nv};function iv(e,t,n){var r=rv[e.mark.marktype],i=t||r.bound;return r.nested&&(e=e.mark),i(e.bounds||(e.bounds=new am),e,n)}var ov={mark:null};function av(e,t,n){var r,i,o,a,s=rv[e.marktype],u=s.bound,l=e.items,c=l&&l.length;if(s.nested)return c?o=l[0]:(ov.mark=e,o=ov),a=iv(o,u,n),t&&t.union(a)||a;if(t=t||e.bounds&&e.bounds.clear()||new am,c)for(r=0,i=l.length;rt;)e.removeChild(n[--r]);return e}function yv(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function vv(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}class bv{constructor(e,t){this._active=null,this._handlers={},this._loader=e||Go(),this._tooltip=t||xv}initialize(e,t,n){return this._el=e,this._obj=n||null,this.origin(t)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()}scene(e){return arguments.length?(this._scene=e,this):this._scene}on(){}off(){}_handlerIndex(e,t,n){for(let r=e?e.length:0;--r>=0;)if(e[r].type===t&&(!n||e[r].handler===n))return r;return-1}handlers(e){const t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(const e in t)n.push(...t[e]);return n}eventName(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)}handleHref(e,t,n){this._loader.sanitize(n,{context:"href"}).then((t=>{const n=new MouseEvent(e.type,e),r=hv(null,"a");for(const e in t)r.setAttribute(e,t[e]);r.dispatchEvent(n)})).catch((()=>{}))}handleTooltip(e,t,n){if(t&&null!=t.tooltip){t=function(e,t,n,r){var i,o,a=e&&e.mark;if(a&&(i=rv[a.marktype]).tip){for((o=vv(t,n))[0]-=r[0],o[1]-=r[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=i.tip(a.items,o)}return e}(t,e,this.canvas(),this._origin);const r=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,r)}}getItemBoundingClientRect(e){const t=this.canvas();if(!t)return;const n=t.getBoundingClientRect(),r=this._origin,i=e.bounds,o=i.width(),a=i.height();let s=i.x1+r[0]+n.left,u=i.y1+r[1]+n.top;for(;e.mark&&(e=e.mark.group);)s+=e.x||0,u+=e.y||0;return{x:s,y:u,width:o,height:a,left:s,top:u,right:s+o,bottom:u+a}}}function xv(e,t,n,r){e.element().setAttribute("title",r||"")}class _v{constructor(e){this._el=null,this._bgcolor=null,this._loader=new lm(e)}initialize(e,t,n,r,i){return this._el=e,this.resize(t,n,r,i)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(e){return 0===arguments.length?this._bgcolor:(this._bgcolor=e,this)}resize(e,t,n,r){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=r||1,this}dirty(){}render(e,t){const n=this;return n._call=function(){n._render(e,t)},n._call(),n._call=null,n}_render(){}renderAsync(e,t){const n=this.render(e,t);return this._ready?this._ready.then((()=>n)):Promise.resolve(n)}_load(e,t){var n=this,r=n._loader[e](t);if(!n._ready){const e=n._call;n._ready=n._loader.ready().then((t=>{t&&e(),n._ready=null}))}return r}sanitizeURL(e){return this._load("sanitizeURL",e)}loadImage(e){return this._load("loadImage",e)}}const wv="dragenter",kv="dragleave",Av="dragover",Ev="pointerdown",Ov="pointermove",Dv="pointerout",Cv="pointerover",Sv="mousedown",Fv="mousemove",Mv="mouseout",jv="mouseover",$v="click",Nv="mousewheel",Bv="touchstart",Tv="touchmove",zv="touchend",Rv=["keydown","keypress","keyup",wv,kv,Av,Ev,"pointerup",Ov,Dv,Cv,Sv,"mouseup",Fv,Mv,jv,$v,"dblclick","wheel",Nv,Bv,Tv,zv],Pv=Ov,Lv=Mv,Iv=$v;class Uv extends bv{constructor(e,t){super(e,t),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=Rv,this.pointermove=Gv([Ov,Fv],[Cv,jv],[Dv,Mv]),this.dragover=Gv([Av],[wv],[kv]),this.pointerout=Vv([Dv,Mv]),this.dragleave=Vv([kv])}initialize(e,t,n){return this._canvas=e&&pv(e,"canvas"),[$v,Sv,Ev,Ov,Dv,kv].forEach((e=>Wv(this,e))),super.initialize(e,t,n)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(e){this.fire(Nv,e)}pointerdown(e){this._down=this._active,this.fire(Ev,e)}mousedown(e){this._down=this._active,this.fire(Sv,e)}click(e){this._down===this._active&&(this.fire($v,e),this._down=null)}touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Bv,e,!0)}touchmove(e){this.fire(Tv,e,!0)}touchend(e){this.fire(zv,e,!0),this._touch=null}fire(e,t,n){const r=n?this._touch:this._active,i=this._handlers[e];if(t.vegaType=e,e===Iv&&r&&r.href?this.handleHref(t,r,r.href):e!==Pv&&e!==Lv||this.handleTooltip(t,r,e!==Lv),i)for(let e=0,n=i.length;e=0&&r.splice(i,1),this}pickEvent(e){const t=vv(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])}pick(e,t,n,r,i){const o=this.context();return rv[e.marktype].pick.call(this,o,e,t,n,r,i)}}const qv=e=>e===Bv||e===Tv||e===zv?[Bv,Tv,zv]:[e];function Wv(e,t){qv(t).forEach((t=>function(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?n=>e[t](n):n=>e.fire(t,n)))}(e,t)))}function Hv(e,t,n){t.forEach((t=>e.fire(t,n)))}function Gv(e,t,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i||(i&&i.exit||Hv(this,n,r),this._active=o,Hv(this,t,r)),Hv(this,e,r)}}function Vv(e){return function(t){Hv(this,e,t),this._active=null}}class Yv extends _v{constructor(e){super(e),this._options={},this._redraw=!1,this._dirty=new am,this._tempb=new am}initialize(e,t,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:Oc(1,1,this._options.type),e&&this._canvas&&(mv(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(e,t,n,r,i)}resize(e,t,n,r){if(super.resize(e,t,n,r),this._canvas)!function(e,t,n,r,i,o){const a="undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,s=e.getContext("2d"),u=a?"undefined"!=typeof window&&window.devicePixelRatio||1:i;e.width=t*u,e.height=n*u;for(const e in o)s[e]=o[e];a&&1!==u&&(e.style.width=t+"px",e.style.height=n+"px"),s.pixelRatio=u,s.setTransform(u,0,0,u,u*r[0],u*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const e=this._options.externalContext;e||_("CanvasRenderer is missing a valid canvas or context"),e.scale(this._scale,this._scale),e.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)}_render(e,t){const n=this.context(),r=this._origin,i=this._width,o=this._height,a=this._dirty,s=Xv(r,i,o);n.save();const u=this._redraw||a.empty()?(this._redraw=!1,s.expand(1)):function(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-n[0]%1,-n[1]%1),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}(n,s.intersect(a),r);return this.clear(-r[0],-r[1],i,o),this.draw(n,e,u,t),n.restore(),a.clear(),this}draw(e,t,n,r){if("group"!==t.marktype&&null!=r&&!r.includes(t.marktype))return;const i=rv[t.marktype];t.clip&&function(e,t){var n=t.clip;e.save(),ce(n)?(e.beginPath(),n(e),e.clip()):dy(e,t.group)}(e,t),i.draw.call(this,e,t,n,r),t.clip&&e.restore()}clear(e,t,n,r){const i=this._options,o=this.context();"pdf"===i.type||i.externalContext||o.clearRect(e,t,n,r),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(e,t,n,r))}}const Xv=(e,t,n)=>(new am).set(0,0,t,n).translate(-e[0],-e[1]);class Zv extends bv{constructor(e,t){super(e,t);const n=this;n._hrefHandler=Jv(n,((e,t)=>{t&&t.href&&n.handleHref(e,t,t.href)})),n._tooltipHandler=Jv(n,((e,t)=>{n.handleTooltip(e,t,e.type!==Lv)}))}initialize(e,t,n){let r=this._svg;return r&&(r.removeEventListener(Iv,this._hrefHandler),r.removeEventListener(Pv,this._tooltipHandler),r.removeEventListener(Lv,this._tooltipHandler)),this._svg=r=e&&pv(e,"svg"),r&&(r.addEventListener(Iv,this._hrefHandler),r.addEventListener(Pv,this._tooltipHandler),r.addEventListener(Lv,this._tooltipHandler)),super.initialize(e,t,n)}canvas(){return this._svg}on(e,t){const n=this.eventName(e),r=this._handlers;if(this._handlerIndex(r[n],e,t)<0){const i={type:e,handler:t,listener:Jv(this,t)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this}off(e,t){const n=this.eventName(e),r=this._handlers[n],i=this._handlerIndex(r,e,t);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}}const Jv=(e,t)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,t.call(e._obj,n,r)},Kv="aria-hidden",Qv="aria-label",eb="role",tb="aria-roledescription",nb="graphics-object",rb="graphics-symbol",ib=(e,t,n)=>({[eb]:e,[tb]:t,[Qv]:n||void 0}),ob=Ye(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),ab={axis:{desc:"axis",caption:function(e){const t=e.datum,n=e.orient,r=t.title?fb(e):null,i=e.context,o=i.scales[t.scale].value,a=i.dataflow.locale(),s=o.type;return("left"===n||"right"===n?"Y":"X")+"-axis"+(r?` titled '${r}'`:"")+` for a ${kp(s)?"discrete":s} scale`+` with ${ig(a,o,e)}`}},legend:{desc:"legend",caption:function(e){const t=e.datum,n=t.title?fb(e):null,r=`${t.type||""} legend`.trim(),i=t.scales,o=Object.keys(i),a=e.context,s=a.scales[i[o[0]]].value,u=a.dataflow.locale();return((l=r).length?l[0].toUpperCase()+l.slice(1):l)+(n?` titled '${n}'`:"")+` for ${function(e){return(e=e.map((e=>e+("fill"===e||"stroke"===e?" color":"")))).length<2?e[0]:e.slice(0,-1).join(", ")+" and "+q(e)}(o)}`+` with ${ig(u,s,e)}`;var l}},"title-text":{desc:"title",caption:e=>`Title text '${cb(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${cb(e)}'`}},sb={ariaRole:eb,ariaRoleDescription:tb,description:Qv};function ub(e,t){const n=!1===t.aria;if(e(Kv,n||void 0),n||null==t.description)for(const t in sb)e(sb[t],void 0);else{const n=t.mark.marktype;e(Qv,t.description),e(eb,t.ariaRole||("group"===n?nb:rb)),e(tb,t.ariaRoleDescription||`${n} mark`)}}function lb(e){return!1===e.aria?{[Kv]:!0}:ob[e.role]?null:ab[e.role]?function(e,t){try{const n=e.items[0],r=t.caption||(()=>"");return ib(t.role||rb,t.desc,n.description||r(n))}catch(e){return null}}(e,ab[e.role]):function(e){const t=e.marktype,n="group"===t||"text"===t||e.items.some((e=>null!=e.description&&!1!==e.aria));return ib(n?nb:rb,`${t} mark container`,e.description)}(e)}function cb(e){return ue(e.text).join(" ")}function fb(e){try{return ue(q(e.items).items[0].text).join(" ")}catch(e){return null}}const db=e=>(e+"").replace(/&/g,"&").replace(//g,">"),hb=e=>db(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function pb(){let e="",t="",n="";const r=[],i=()=>t=n="",o=(e,n)=>(null!=n&&(t+=` ${e}="${hb(n)}"`),a),a={open(s){(o=>{t&&(e+=`${t}>${n}`,i()),r.push(o)})(s),t="<"+s;for(var u=arguments.length,l=new Array(u>1?u-1:0),c=1;c${n}`:"/>"):``,i(),a},attr:o,text:e=>(n+=db(e),a),toString:()=>e};return a}const gb=e=>mb(pb(),e)+"";function mb(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,r=n.length;for(let t=0;t{e.dirty=t}))),r.zdirty||(n.exit?(o.nested&&r.items.length?(u=r.items[0],u._svg&&this._update(o,u._svg,u)):n._svg&&(u=n._svg.parentNode,u&&u.removeChild(n._svg)),n._svg=null):(n=o.nested?r.items[0]:n,n._update!==t&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,kb(n,t)),n._update=t)));return!this._dirtyAll}mark(e,t,n,r){if(!this.isDirty(t))return t._svg;const i=this._svg,o=t.marktype,a=rv[o],s=!1===t.interactive?"none":null,u="g"===a.tag,l=Ob(t,e,n,"g",i);if("group"!==o&&null!=r&&!r.includes(o))return mv(l,0),t._svg;l.setAttribute("class",yv(t));const c=lb(t);for(const e in c)$b(l,e,c[e]);u||$b(l,"pointer-events",s),$b(l,"clip-path",t.clip?om(this,t,t.group):null);let f=null,d=0;const h=e=>{const t=this.isDirty(e),n=Ob(e,l,f,a.tag,i);t&&(this._update(a,n,e),u&&function(e,t,n,r){t=t.lastChild.previousSibling;let i,o=0;Jm(n,(n=>{i=e.mark(t,n,i,r),++o})),mv(t,1+o)}(this,n,e,r)),f=n,++d};return a.nested?t.items.length&&h(t.items[0]):Jm(t,h),mv(l,d),l}_update(e,t,n){Db=t,Cb=t.__values__,ub(Fb,n),e.attr(Fb,n,this);const r=Sb[e.type];r&&r.call(this,e,t,n),Db&&this.style(Db,n)}style(e,t){if(null!=t){for(const n in yb){let r="font"===n?Yy(t):t[n];if(r===Cb[n])continue;const i=yb[n];null==r?e.removeAttribute(i):(sg(r)&&(r=ug(r,this._defs.gradient,Nb())),e.setAttribute(i,r+"")),Cb[n]=r}for(const n in vb)Mb(e,vb[n],t[n])}}defs(){const e=this._svg,t=this._defs;let n=t.el,r=0;for(const i in t.gradient)n||(t.el=n=gv(e,1,"defs",_b)),r=Ab(n,t.gradient[i],r);for(const i in t.clipping)n||(t.el=n=gv(e,1,"defs",_b)),r=Eb(n,t.clipping[i],r);n&&(0===r?(e.removeChild(n),t.el=null):mv(n,r))}_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}}function kb(e,t){for(;e&&e.dirty!==t;e=e.mark.group){if(e.dirty=t,!e.mark||e.mark.dirty===t)return;e.mark.dirty=t}}function Ab(e,t,n){let r,i,o;if("radial"===t.gradient){let r=gv(e,n++,"pattern",_b);jb(r,{id:ag+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),r=gv(r,0,"rect",_b),jb(r,{width:1,height:1,fill:`url(${Nb()}#${t.id})`}),jb(e=gv(e,n++,"radialGradient",_b),{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else jb(e=gv(e,n++,"linearGradient",_b),{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(r=0,i=t.stops.length;r1&&e.previousSibling!=t}(a,n))&&t.insertBefore(a,n?n.nextSibling:t.firstChild),a}let Db=null,Cb=null;const Sb={group(e,t,n){const r=Db=t.childNodes[2];Cb=r.__values__,e.foreground(Fb,n,this),Cb=t.__values__,Db=t.childNodes[1],e.content(Fb,n,this);const i=Db=t.childNodes[0];e.background(Fb,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==Cb.events&&($b(r,"pointer-events",o),$b(i,"pointer-events",o),Cb.events=o),n.strokeForeground&&n.stroke){const e=n.fill;$b(r,"display",null),this.style(i,n),$b(i,"stroke",null),e&&(n.fill=null),Cb=r.__values__,this.style(r,n),e&&(n.fill=e),Db=null}else $b(r,"display","none")},image(e,t,n){!1===n.smooth?(Mb(t,"image-rendering","optimizeSpeed"),Mb(t,"image-rendering","pixelated")):Mb(t,"image-rendering",null)},text(e,t,n){const r=Hy(n);let i,o,a,s;z(r)?(o=r.map((e=>Vy(n,e))),i=o.join("\n"),i!==Cb.text&&(mv(t,0),a=t.ownerDocument,s=Wy(n),o.forEach(((e,r)=>{const i=hv(a,"tspan",_b);i.__data__=n,i.textContent=e,r&&(i.setAttribute("x",0),i.setAttribute("dy",s)),t.appendChild(i)})),Cb.text=i)):(o=Vy(n,r),o!==Cb.text&&(t.textContent=o,Cb.text=o)),$b(t,"font-family",Yy(n)),$b(t,"font-size",qy(n)+"px"),$b(t,"font-style",n.fontStyle),$b(t,"font-variant",n.fontVariant),$b(t,"font-weight",n.fontWeight)}};function Fb(e,t,n){t!==Cb[e]&&(n?function(e,t,n,r){null!=n?e.setAttributeNS(r,t,n):e.removeAttributeNS(r,t)}(Db,e,t,n):$b(Db,e,t),Cb[e]=t)}function Mb(e,t,n){n!==Cb[t]&&(null==n?e.style.removeProperty(t):e.style.setProperty(t,n+""),Cb[t]=n)}function jb(e,t){for(const n in t)$b(e,n,t[n])}function $b(e,t,n){null!=n?e.setAttribute(t,n):e.removeAttribute(t)}function Nb(){let e;return"undefined"==typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class Bb extends _v{constructor(e){super(e),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(e){const t=pb();t.open("svg",be({},xy,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",bb,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this}mark(e,t){const n=rv[t.marktype],r=n.tag,i=[ub,n.attr];e.open("g",{class:yv(t),"clip-path":t.clip?om(this,t,t.group):null},lb(t),{"pointer-events":"g"!==r&&!1===t.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&e.open("a",a),e.open(r,this.attr(t,o,i,"g"!==r?r:null)),"text"===r){const t=Hy(o);if(z(t)){const n={x:0,dy:Wy(o)};for(let r=0;rthis.mark(e,t))),e.close(),r&&a?(i&&(o.fill=null),o.stroke=a,e.open("path",this.attr(t,o,n.foreground,"bgrect")).close(),i&&(o.fill=i)):e.open("path",this.attr(t,o,n.foreground,"bgfore")).close()}e.close(),a&&e.close()};return n.nested?t.items&&t.items.length&&o(t.items[0]):Jm(t,o),e.close()}href(e){const t=e.href;let n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then((e=>{e["xlink:href"]=e.href,e.href=null,(this._hrefs||(this._hrefs={}))[t]=e}))}return null}attr(e,t,n,r){const i={},o=(e,t,n,r)=>{i[r||e]=t};return Array.isArray(n)?n.forEach((e=>e(o,t,this))):n(o,t,this),r&&function(e,t,n,r,i){let o;if(null==t)return e;if("bgrect"===r&&!1===n.interactive&&(e["pointer-events"]="none"),"bgfore"===r&&(!1===n.interactive&&(e["pointer-events"]="none"),e.display="none",null!==t.fill))return e;"image"===r&&!1===t.smooth&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),"text"===r&&(e["font-family"]=Yy(t),e["font-size"]=qy(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const n in yb){let r=t[n];const o=yb[n];("transparent"!==r||"fill"!==o&&"stroke"!==o)&&null!=r&&(sg(r)&&(r=ug(r,i.gradient,"")),e[o]=r)}for(const e in vb){const n=t[e];null!=n&&(o=o||[],o.push(`${vb[e]}: ${n};`))}o&&(e.style=o.join(" "))}(i,t,e,r,this._defs),i}defs(e){const t=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(t).length+Object.keys(n).length){e.open("defs");for(const n in t){const r=t[n],i=r.stops;"radial"===r.gradient?(e.open("pattern",{id:ag+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),e.close(),e.open("radialGradient",{id:n,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):e.open("linearGradient",{id:n,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2});for(let t=0;t!Tb.svgMarkTypes.includes(e)));this._svgRenderer.render(e,Tb.svgMarkTypes),this._canvasRenderer.render(e,n)}resize(e,t,n,r){return super.resize(e,t,n,r),this._svgRenderer.resize(e,t,n,r),this._canvasRenderer.resize(e,t,n,r),this}background(e){return Tb.svgOnTop?this._canvasRenderer.background(e):this._svgRenderer.background(e),this}}class Pb extends Uv{constructor(e,t){super(e,t)}initialize(e,t,n){const r=gv(gv(e,0,"div"),Tb.svgOnTop?0:1,"div");return super.initialize(r,t,n)}}const Lb="canvas",Ib="hybrid",Ub="none",qb={Canvas:Lb,PNG:"png",SVG:"svg",Hybrid:Ib,None:Ub},Wb={};function Hb(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Wb[e]=t,this):Wb[e]}function Gb(e,t,n){const r=[],i=(new am).union(t),o=e.marktype;return o?Vb(e,i,n,r):"group"===o?Yb(e,i,n,r):_("Intersect scene must be mark node or group item.")}function Vb(e,t,n,r){if(function(e,t,n){return e.bounds&&t.intersects(e.bounds)&&("group"===e.marktype||!1!==e.interactive&&(!n||n(e)))}(e,t,n)){const i=e.items,o=e.marktype,a=i.length;let s=0;if("group"===o)for(;s=0;r--)if(i[r]!=o[r])return!1;for(r=i.length-1;r>=0;r--)if(!Qb(e[n=i[r]],t[n],n))return!1;return typeof e==typeof t}(e,t):e==t)}function ex(e,t){return Qb(vg(e),vg(t))}function tx(){im(),og=0}const nx="top",rx="left",ix="right",ox="bottom",ax="start",sx="middle",ux="end",lx="x",cx="y",fx="group",dx="axis",hx="title",px="legend",gx="row-header",mx="row-footer",yx="row-title",vx="column-header",bx="column-footer",xx="column-title",_x="fit-x",wx="fit-y",kx="none",Ax="all",Ex="each",Ox="flush",Dx="column",Cx="row";function Sx(e){Fa.call(this,null,e)}function Fx(e,t,n){return t(e.bounds.clear(),e,n)}De(Sx,Fa,{transform(e,t){const n=t.dataflow,r=e.mark,i=r.marktype,o=rv[i],a=o.bound;let s,u=r.bounds;if(o.nested)r.items.length&&n.dirty(r.items[0]),u=Fx(r,a),r.items.forEach((e=>{e.bounds.clear().union(u)}));else if(i===fx||e.modified())switch(t.visit(t.MOD,(e=>n.dirty(e))),u.clear(),r.items.forEach((e=>u.union(Fx(e,a)))),r.role){case dx:case px:case hx:t.reflow()}else s=t.changed(t.REM),t.visit(t.ADD,(e=>{u.union(Fx(e,a))})),t.visit(t.MOD,(e=>{s=s||u.alignsWith(e.bounds),n.dirty(e),u.union(Fx(e,a))})),s&&(u.clear(),r.items.forEach((e=>u.union(e.bounds))));return Jb(r),t.modifies("bounds")}});const Mx=":vega_identifier:";function jx(e){Fa.call(this,0,e)}function $x(e){Fa.call(this,null,e)}function Nx(e){Fa.call(this,null,e)}jx.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},De(jx,Fa,{transform(e,t){const n=(i=t.dataflow)._signals[Mx]||(i._signals[Mx]=i.add(0)),r=e.as;var i;let o=n.value;return t.visit(t.ADD,(e=>e[r]=e[r]||++o)),n.set(this.value=o),t}}),De($x,Fa,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,function(e){const t=e.groups,n=e.parent;return t&&1===t.size?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const r=n.marktype===fx?um:sm;return t.visit(t.ADD,(e=>r.call(e,n))),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});const Bx={parity:e=>e.filter(((e,t)=>t%2?e.opacity=0:1)),greedy:(e,t)=>{let n;return e.filter(((e,r)=>r&&Tx(n.bounds,e.bounds,t)?e.opacity=0:(n=e,1)))}},Tx=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),zx=(e,t)=>{for(var n,r=1,i=e.length,o=e[0].bounds;r{const t=e.bounds;return t.width()>1&&t.height()>1},Px=e=>(e.forEach((e=>e.opacity=1)),e),Lx=(e,t)=>e.reflow(t.modified()).modifies("opacity");function Ix(e){Fa.call(this,null,e)}De(Nx,Fa,{transform(e,t){const n=Bx[e.method]||Bx.parity,r=e.separation||0;let i,o,a=t.materialize(t.SOURCE).source;if(!a||!a.length)return;if(!e.method)return e.modified("method")&&(Px(a),t=Lx(t,e)),t;if(a=a.filter(Rx),!a.length)return;if(e.sort&&(a=a.slice().sort(e.sort)),i=Px(a),t=Lx(t,e),i.length>=3&&zx(i,r)){do{i=n(i,r)}while(i.length>=3&&zx(i,r));i.length<3&&!q(a).opacity&&(i.length>1&&(q(i).opacity=0),q(a).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=((e,t,n)=>{var r=e.range(),i=new am;return t===nx||t===ox?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),e=>i.encloses(e.bounds)})(e.boundScale,e.boundOrient,+e.boundTolerance),a.forEach((e=>{o(e)||(e.opacity=0)})));const s=i[0].mark.bounds.clear();return a.forEach((e=>{e.opacity&&s.union(e.bounds)})),t}}),De(Ix,Fa,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,(e=>n.dirty(e))),t.fields&&t.fields.zindex){const e=t.source&&t.source[0];e&&(e.mark.zdirty=!0)}}});const Ux=new am;function qx(e,t,n){return e[t]===n?0:(e[t]=n,1)}function Wx(e){var t=e.items[0].orient;return t===rx||t===ix}function Hx(e,t,n,r){var i,o,a=t.items[0],s=a.datum,u=null!=a.translate?a.translate:.5,l=a.orient,c=function(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}(s),f=a.range,d=a.offset,h=a.position,p=a.minExtent,g=a.maxExtent,m=s.title&&a.items[c[2]].items[0],y=a.titlePadding,v=a.bounds,b=m&&Gy(m),x=0,_=0;switch(Ux.clear().union(v),v.clear(),(i=c[0])>-1&&v.union(a.items[i].bounds),(i=c[1])>-1&&v.union(a.items[i].bounds),l){case nx:x=h||0,_=-d,o=Math.max(p,Math.min(g,-v.y1)),v.add(0,-o).add(f,0),m&&Gx(e,m,o,y,b,0,-1,v);break;case rx:x=-d,_=h||0,o=Math.max(p,Math.min(g,-v.x1)),v.add(-o,0).add(0,f),m&&Gx(e,m,o,y,b,1,-1,v);break;case ix:x=n+d,_=h||0,o=Math.max(p,Math.min(g,v.x2)),v.add(0,0).add(o,f),m&&Gx(e,m,o,y,b,1,1,v);break;case ox:x=h||0,_=r+d,o=Math.max(p,Math.min(g,v.y2)),v.add(0,0).add(f,o),m&&Gx(e,m,o,y,0,0,1,v);break;default:x=a.x,_=a.y}return dm(v.translate(x,_),a),qx(a,"x",x+u)|qx(a,"y",_+u)&&(a.bounds=Ux,e.dirty(a),a.bounds=v,e.dirty(a)),a.mark.bounds.clear().union(v)}function Gx(e,t,n,r,i,o,a,s){const u=t.bounds;if(t.auto){const s=a*(n+i+r);let l=0,c=0;e.dirty(t),o?l=(t.x||0)-(t.x=s):c=(t.y||0)-(t.y=s),t.mark.bounds.clear().union(u.translate(-l,-c)),e.dirty(t)}s.union(u)}const Vx=(e,t)=>Math.floor(Math.min(e,t)),Yx=(e,t)=>Math.ceil(Math.max(e,t));function Xx(e){return(new am).set(0,0,e.width||0,e.height||0)}function Zx(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function Jx(e,t,n){const r=R(e)?e[t]:e;return null!=r?r:void 0!==n?n:0}function Kx(e){return e<0?Math.ceil(-e):0}function Qx(e,t,n){var r,i,o,a,s,u,l,c,f,d,h,p=!n.nodirty,g=n.bounds===Ox?Xx:Zx,m=Ux.set(0,0,0,0),y=Jx(n.align,Dx),v=Jx(n.align,Cx),b=Jx(n.padding,Dx),x=Jx(n.padding,Cx),_=n.columns||t.length,w=_<=0?1:Math.ceil(t.length/_),k=t.length,A=Array(k),E=Array(_),O=0,D=Array(k),C=Array(w),S=0,F=Array(k),M=Array(k),j=Array(k);for(i=0;i<_;++i)E[i]=0;for(i=0;i1)for(i=0;i0&&(F[i]+=f/2);if(v&&Jx(n.center,Cx)&&1!==_)for(i=0;i0&&(M[i]+=d/2);for(i=0;ii&&(e.warn("Grid headers exceed limit: "+i),t=t.slice(0,i)),A+=o,g=0,y=t.length;g=0&&null==(x=n[m]);m-=d);s?(_=null==h?x.x:Math.round(x.bounds.x1+h*x.bounds.width()),w=A):(_=A,w=null==h?x.y:Math.round(x.bounds.y1+h*x.bounds.height())),v.union(b.bounds.translate(_-(b.x||0),w-(b.y||0))),b.x=_,b.y=w,e.dirty(b),E=a(E,v[l])}return E}function r_(e,t,n,r,i,o){if(t){e.dirty(t);var a=n,s=n;r?a=Math.round(i.x1+o*i.width()):s=Math.round(i.y1+o*i.height()),t.bounds.translate(a-(t.x||0),s-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=a,t.y=s,e.dirty(t)}}function i_(e,t,n,r,i,o,a){const s=function(e,t){const n=e[t]||{};return(t,r)=>null!=n[t]?n[t]:null!=e[t]?e[t]:r}(n,t),u=function(e,t){let n=-1/0;return e.forEach((e=>{null!=e.offset&&(n=Math.max(n,e.offset))})),n>-1/0?n:t}(e,s("offset",0)),l=s("anchor",ax),c=l===ux?1:l===sx?.5:0,f={align:Ex,bounds:s("bounds",Ox),columns:"vertical"===s("direction")?1:e.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(t){case rx:f.anchor={x:Math.floor(r.x1)-u,column:ux,y:c*(a||r.height()+2*r.y1),row:l};break;case ix:f.anchor={x:Math.ceil(r.x2)+u,y:c*(a||r.height()+2*r.y1),row:l};break;case nx:f.anchor={y:Math.floor(i.y1)-u,row:ux,x:c*(o||i.width()+2*i.x1),column:l};break;case ox:f.anchor={y:Math.ceil(i.y2)+u,x:c*(o||i.width()+2*i.x1),column:l};break;case"top-left":f.anchor={x:u,y:u};break;case"top-right":f.anchor={x:o-u,y:u,column:ux};break;case"bottom-left":f.anchor={x:u,y:a-u,row:ux};break;case"bottom-right":f.anchor={x:o-u,y:a-u,column:ux,row:ux}}return f}function o_(e,t){var n,r,i=t.items[0],o=i.datum,a=i.orient,s=i.bounds,u=i.x,l=i.y;return i._bounds?i._bounds.clear().union(s):i._bounds=s.clone(),s.clear(),function(e,t,n){var r=t.padding,i=r-n.x,o=r-n.y;if(t.datum.title){var a=t.items[1].items[0],s=a.anchor,u=t.titlePadding||0,l=r-a.x,c=r-a.y;switch(a.orient){case rx:i+=Math.ceil(a.bounds.width())+u;break;case ix:case ox:break;default:o+=a.bounds.height()+u}switch((i||o)&&s_(e,n,i,o),a.orient){case rx:c+=a_(t,n,a,s,1,1);break;case ix:l+=a_(t,n,a,ux,0,0)+u,c+=a_(t,n,a,s,1,1);break;case ox:l+=a_(t,n,a,s,0,0),c+=a_(t,n,a,ux,-1,0,1)+u;break;default:l+=a_(t,n,a,s,0,0)}(l||c)&&s_(e,a,l,c),(l=Math.round(a.bounds.x1-r))<0&&(s_(e,n,-l,0),s_(e,a,-l,0))}else(i||o)&&s_(e,n,i,o)}(e,i,i.items[0].items[0]),s=function(e,t){return e.items.forEach((e=>t.union(e.bounds))),t.x1=e.padding,t.y1=e.padding,t}(i,s),n=2*i.padding,r=2*i.padding,s.empty()||(n=Math.ceil(s.width()+n),r=Math.ceil(s.height()+r)),"symbol"===o.type&&function(e){const t=e.reduce(((e,t)=>(e[t.column]=Math.max(t.bounds.x2-t.x,e[t.column]||0),e)),{});e.forEach((e=>{e.width=t[e.column],e.height=e.bounds.y2-e.y}))}(i.items[0].items[0].items[0].items),a!==kx&&(i.x=u=0,i.y=l=0),i.width=n,i.height=r,dm(s.set(u,l,u+n,l+r),i),i.mark.bounds.clear().union(s),i}function a_(e,t,n,r,i,o,a){const s="symbol"!==e.datum.type,u=n.datum.vgrad,l=(!s||!o&&u||a?t:t.items[0]).bounds[i?"y2":"x2"]-e.padding,c=u&&o?l:0,f=u&&o?0:l,d=i<=0?0:Gy(n);return Math.round(r===ax?c:r===ux?f-d:.5*(l-d))}function s_(e,t,n,r){t.x+=n,t.y+=r,t.bounds.translate(n,r),t.mark.bounds.translate(n,r),e.dirty(t)}function u_(e){Fa.call(this,null,e)}function l_(e,t){let n=0;if(void 0===t)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function c_(e){Fa.call(this,null,e)}function f_(e){Fa.call(this,null,e)}function d_(){return ea({})}function h_(e){Fa.call(this,null,e)}function p_(e){Fa.call(this,[],e)}De(u_,Fa,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach((t=>{e.layout&&function(e,t,n){var r,i,o,a,s,u,l,c=function(e){var t,n,r=e.items,i=r.length,o=0;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;o{(o=e.orient||ix)!==kx&&(t[o]||(t[o]=[])).push(e)}));for(const r in t){const i=t[r];Qx(e,i,i_(i,r,n.legends,d,h,l,c))}p.forEach((t=>{const r=t.bounds;if(r.equals(t._bounds)||(t.bounds=t._bounds,e.dirty(t),t.bounds=r,e.dirty(t)),!n.autosize||"fit"!==n.autosize.type&&n.autosize.type!==_x&&n.autosize.type!==wx)f.union(r);else switch(t.orient){case rx:case ix:f.add(r.x1,0).add(r.x2,0);break;case nx:case ox:f.add(0,r.y1).add(0,r.y2)}}))}f.union(d).union(h),r&&f.union(function(e,t,n,r,i){var o,a=t.items[0],s=a.frame,u=a.orient,l=a.anchor,c=a.offset,f=a.padding,d=a.items[0].items[0],h=a.items[1]&&a.items[1].items[0],p=u===rx||u===ix?r:n,g=0,m=0,y=0,v=0,b=0;if(s!==fx?u===rx?(g=i.y2,p=i.y1):u===ix?(g=i.y1,p=i.y2):(g=i.x1,p=i.x2):u===rx&&(g=r,p=0),o=l===ax?g:l===ux?p:(g+p)/2,h&&h.text){switch(u){case nx:case ox:b=d.bounds.height()+f;break;case rx:v=d.bounds.width()+f;break;case ix:v=-d.bounds.width()-f}Ux.clear().union(h.bounds),Ux.translate(v-(h.x||0),b-(h.y||0)),qx(h,"x",v)|qx(h,"y",b)&&(e.dirty(h),h.bounds.clear().union(Ux),h.mark.bounds.clear().union(Ux),e.dirty(h)),Ux.clear().union(h.bounds)}else Ux.clear();switch(Ux.union(d.bounds),u){case nx:m=o,y=i.y1-Ux.height()-c;break;case rx:m=i.x1-Ux.width()-c,y=o;break;case ix:m=i.x2+Ux.width()+c,y=o;break;case ox:m=o,y=i.y2+c;break;default:m=a.x,y=a.y}return qx(a,"x",m)|qx(a,"y",y)&&(Ux.translate(m,y),e.dirty(a),a.bounds.clear().union(Ux),t.bounds.clear().union(Ux),e.dirty(a)),a.bounds}(e,r,l,c,f)),t.clip&&f.set(0,0,t.width||0,t.height||0),function(e,t,n,r){const i=r.autosize||{},o=i.type;if(e._autosize<1||!o)return;let a=e._width,s=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if("padding"===i.contains){const t=e.padding();a-=t.left+t.right,s-=t.top+t.bottom}o===kx?(l=0,f=0,u=a,c=s):"fit"===o?(u=Math.max(0,a-l-d),c=Math.max(0,s-f-h)):o===_x?(u=Math.max(0,a-l-d),s=c+f+h):o===wx?(a=u+l+d,c=Math.max(0,s-f-h)):"pad"===o&&(a=u+l+d,s=c+f+h),e._resizeView(a,s,u,c,[l,f],i.resize)}(e,t,f,n)}(n,t,e)})),function(e){return e&&"legend-entry"!==e.mark.role}(e.mark.group)?t.reflow():t}}),De(c_,Fa,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,o=e.scale,a=qp(o,null==e.count?e.values?e.values.length:10:e.count,e.minstep),s=e.format||Gp(n,o,a,e.formatSpecifier,e.formatType,!!e.values),u=e.values?Wp(o,e.values,a):Hp(o,a);return i&&(r.rem=i),i=u.map(((e,t)=>ea({index:t/(u.length-1||1),value:e,label:s(e)}))),e.extra&&i.length&&i.push(ea({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}}),De(f_,Fa,{transform(e,t){var n=t.dataflow,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||d_,o=e.key||Ko,a=this.value;return z(r.encode)&&(r.encode=null),a&&(e.modified("key")||t.modified(o))&&_("DataJoin does not support modified key function or fields."),a||(t=t.addAll(),this.value=a=function(e){const t=Ee().test((e=>e.exit));return t.lookup=n=>t.get(e(n)),t}(o)),t.visit(t.ADD,(e=>{const t=o(e);let n=a.get(t);n?n.exit?(a.empty--,r.add.push(n)):r.mod.push(n):(n=i(e),a.set(t,n),r.add.push(n)),n.datum=e,n.exit=!1})),t.visit(t.MOD,(e=>{const t=o(e),n=a.get(t);n&&(n.datum=e,r.mod.push(n))})),t.visit(t.REM,(e=>{const t=o(e),n=a.get(t);e!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++a.empty)})),t.changed(t.ADD_MOD)&&r.modifies("datum"),(t.clean()||e.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),r}}),De(h_,Fa,{transform(e,t){var n=t.fork(t.ADD_REM),r=e.mod||!1,i=e.encoders,o=t.encode;if(z(o)){if(!n.changed()&&!o.every((e=>i[e])))return t.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,s=i.update||S,u=i.enter||S,l=i.exit||S,c=(o&&!a?i[o]:s)||S;if(t.changed(t.ADD)&&(t.visit(t.ADD,(t=>{u(t,e),s(t,e)})),n.modifies(u.output),n.modifies(s.output),c!==S&&c!==s&&(t.visit(t.ADD,(t=>{c(t,e)})),n.modifies(c.output))),t.changed(t.REM)&&l!==S&&(t.visit(t.REM,(t=>{l(t,e)})),n.modifies(l.output)),a||c!==S){const i=t.MOD|(e.modified()?t.REFLOW:0);a?(t.visit(i,(t=>{const i=u(t,e)||r;(c(t,e)||i)&&n.mod.push(t)})),n.mod.length&&n.modifies(u.output)):t.visit(i,(t=>{(c(t,e)||r)&&n.mod.push(t)})),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}}),De(p_,Fa,{transform(e,t){if(null!=this.value&&!e.modified())return t.StopPropagation;var n,r,i,o,a,s=t.dataflow.locale(),u=t.fork(t.NO_SOURCE|t.NO_FIELDS),l=this.value,c=e.type||Rp,f=e.scale,d=+e.limit,h=qp(f,null==e.count?5:e.count,e.minstep),p=!!e.values||c===Rp,g=e.format||Kp(s,f,h,c,e.formatSpecifier,e.formatType,p),m=e.values||Zp(f,h);return l&&(u.rem=l),c===Rp?(d&&m.length>d?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),l=m.slice(0,d-1),a=!0):l=m,ce(i=e.size)?(e.values||0!==f(l[0])||(l=l.slice(1)),o=l.reduce(((t,n)=>Math.max(t,i(n,e))),0)):i=ye(o=i||8),l=l.map(((t,n)=>ea({index:n,label:g(t,n,l),value:t,offset:o,size:i(t,e)}))),a&&(a=m[l.length],l.push(ea({index:l.length,label:`…${m.length-l.length} entries`,value:a,offset:o,size:i(a,e)})))):"gradient"===c?(n=f.domain(),r=jp(f,n[0],q(n)),m.length<3&&!e.values&&n[0]!==q(n)&&(m=[n[0],q(n)]),l=m.map(((e,t)=>ea({index:t,label:g(e,t,m),value:e,perc:r(e)})))):(i=m.length-1,r=function(e){const t=e.domain(),n=t.length-1;let r=+t[0],i=+q(t),o=i-r;if(e.type===np){const e=n?o/n:.1;r-=e,i+=e,o=i-r}return e=>(e-r)/o}(f),l=m.map(((e,t)=>ea({index:t,label:g(e,t,m),value:e,perc:t?r(e):0,perc2:t===i?1:r(m[t+1])})))),u.source=l,u.add=l,this.value=l,u}});const g_=e=>e.source.x,m_=e=>e.source.y,y_=e=>e.target.x,v_=e=>e.target.y;function b_(e){Fa.call(this,{},e)}b_.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},De(b_,Fa,{transform(e,t){var n=e.sourceX||g_,r=e.sourceY||m_,i=e.targetX||y_,o=e.targetY||v_,a=e.as||"path",s=e.orient||"vertical",u=e.shape||"line",l=k_.get(u+"-"+s)||k_.get(u);return l||_("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,(e=>{e[a]=l(n(e),r(e),i(e),o(e))})),t.reflow(e.modified()).modifies(a)}});const x_=(e,t,n,r)=>"M"+e+","+t+"L"+n+","+r,__=(e,t,n,r)=>{var i=n-e,o=r-t,a=Math.hypot(i,o)/2;return"M"+e+","+t+"A"+a+","+a+" "+180*Math.atan2(o,i)/Math.PI+" 0 1 "+n+","+r},w_=(e,t,n,r)=>{const i=n-e,o=r-t,a=.2*(i+o),s=.2*(o-i);return"M"+e+","+t+"C"+(e+a)+","+(t+s)+" "+(n+s)+","+(r-a)+" "+n+","+r},k_=Ee({line:x_,"line-radial":(e,t,n,r)=>x_(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),arc:__,"arc-radial":(e,t,n,r)=>__(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),curve:w_,"curve-radial":(e,t,n,r)=>w_(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),"orthogonal-horizontal":(e,t,n,r)=>"M"+e+","+t+"V"+r+"H"+n,"orthogonal-vertical":(e,t,n,r)=>"M"+e+","+t+"H"+n+"V"+r,"orthogonal-radial":(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n);return"M"+t*i+","+t*o+"A"+t+","+t+" 0 0,"+((Math.abs(n-e)>Math.PI?n<=e:n>e)?1:0)+" "+t*a+","+t*s+"L"+r*a+","+r*s},"diagonal-horizontal":(e,t,n,r)=>{const i=(e+n)/2;return"M"+e+","+t+"C"+i+","+t+" "+i+","+r+" "+n+","+r},"diagonal-vertical":(e,t,n,r)=>{const i=(t+r)/2;return"M"+e+","+t+"C"+e+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n),u=(t+r)/2;return"M"+t*i+","+t*o+"C"+u*i+","+u*o+" "+u*a+","+u*s+" "+r*a+","+r*s}});function A_(e){Fa.call(this,null,e)}A_.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},De(A_,Fa,{transform(e,t){var n,r,i,o=e.as||["startAngle","endAngle"],a=o[0],s=o[1],u=e.field||D,l=e.startAngle||0,c=null!=e.endAngle?e.endAngle:2*Math.PI,f=t.source,d=f.map(u),h=d.length,p=l,g=(c-l)/l_(d),m=Ls(h);for(e.sort&&m.sort(((e,t)=>d[e]-d[t])),n=0;ne+(t<0?-1:t>0?1:0)),0))!==t.length&&n.warn("Log scale domain includes zero: "+qe(t)));return t}function S_(e,t,n){return ce(e)&&(t||n)?Sp(e,F_(t||[0,1],n)):e}function F_(e,t){return t?e.slice().reverse():e}function M_(e){Fa.call(this,null,e)}De(D_,Fa,{transform(e,t){var n=t.dataflow,r=this.value,i=function(e){var t,n=e.type,r="";return n===Kh?Kh+"-"+Hh:(function(e){const t=e.type;return wp(t)&&t!==Zh&&t!==Jh&&(e.scheme||e.range&&e.range.length&&e.range.every(Ne))}(e)&&(r=2===(t=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(null!=e.domainMid):0)?Kh+"-":3===t?Qh+"-":""),(r+n||Hh).toLowerCase())}(e);for(i in r&&i===r.type||(this.value=r=bp(i)()),e)if(!O_[i]){if("padding"===i&&E_(r.type))continue;ce(r[i])?r[i](e[i]):n.warn("Unsupported scale property: "+i)}return function(e,t,n){var r=e.type,i=t.round||!1,o=t.range;if(null!=t.rangeStep)o=function(e,t,n){e!==op&&e!==ip&&_("Only band and point scales support rangeStep.");var r=(null!=t.paddingOuter?t.paddingOuter:t.padding)||0,i=e===ip?1:(null!=t.paddingInner?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Wh(n,i,r)]}(r,t,n);else if(t.scheme&&(o=function(e,t,n){var r,i=t.schemeExtent;return z(t.scheme)?r=Fp(t.scheme,t.interpolate,t.interpolateGamma):(r=zp(t.scheme.toLowerCase()))||_(`Unrecognized scheme name: ${t.scheme}`),n=e===np?n+1:e===ap?n-1:e===ep||e===tp?+t.schemeCount||5:n,Op(e)?S_(r,i,t.reverse):ce(r)?Mp(S_(r,i),n):e===rp?r:r.slice(0,n)}(r,t,n),ce(o))){if(e.interpolator)return e.interpolator(o);_(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&Op(r))return e.interpolator(Fp(F_(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate($p(t.interpolate,t.interpolateGamma)):ce(e.round)?e.round(i):ce(e.rangeRound)&&e.interpolate(i?zf:Tf),o&&e.range(F_(o,t.reverse))}(r,e,function(e,t,n){let r=t.bins;if(r&&!z(r)){const t=e.domain(),n=t[0],i=q(t),o=r.step;let a=null==r.start?n:r.start,s=null==r.stop?i:r.stop;o||_("Scale bins parameter missing step property."),ai&&(s=o*Math.floor(i/o)),r=Ls(a,s+o/2,o)}return r?e.bins=r:e.bins&&delete e.bins,e.type===ap&&(r?t.domain||t.domainRaw||(e.domain(r),n=r.length):e.bins=e.domain()),n}(r,e,function(e,t,n){const r=function(e,t,n){return t?(e.domain(C_(e.type,t,n)),t.length):-1}(e,t.domainRaw,n);if(r>-1)return r;var i,o,a=t.domain,s=e.type,u=t.zero||void 0===t.zero&&function(e){const t=e.type;return!e.bins&&(t===Hh||t===Vh||t===Yh)}(e);if(!a)return 0;if((u||null!=t.domainMin||null!=t.domainMax||null!=t.domainMid)&&(i=(a=a.slice()).length-1||1,u&&(a[0]>0&&(a[0]=0),a[i]<0&&(a[i]=0)),null!=t.domainMin&&(a[0]=t.domainMin),null!=t.domainMax&&(a[i]=t.domainMax),null!=t.domainMid)){const e=(o=t.domainMid)>a[i]?i+1:oe(u);if(null==t)h.push(e.slice());else for(i={},o=0,a=e.length;od&&(d=f),n&&c.sort(n)}return h.max=d,h}(t.source,e.groupby,l,c),r=0,i=n.length,o=n.max;re;function I_(e,t){e&&q_.hasOwnProperty(e.type)&&q_[e.type](e,t)}var U_={Feature:function(e,t){I_(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r0){for(o=e[--i];i>0&&(t=o,n=e[--i],o=t+n,r=n-(o-t),!r););i>0&&(r<0&&e[i-1]<0||r>0&&e[i-1]>0)&&(n=2*r,t=o+n,n==t-o&&(o=t))}return o}}var Y_=1e-6,X_=1e-12,Z_=Math.PI,J_=Z_/2,K_=Z_/4,Q_=2*Z_,ew=180/Z_,tw=Z_/180,nw=Math.abs,rw=Math.atan,iw=Math.atan2,ow=Math.cos,aw=Math.ceil,sw=Math.exp,uw=(Math.floor,Math.hypot),lw=Math.log,cw=Math.pow,fw=Math.sin,dw=Math.sign||function(e){return e>0?1:e<0?-1:0},hw=Math.sqrt,pw=Math.tan;function gw(e){return e>1?0:e<-1?Z_:Math.acos(e)}function mw(e){return e>1?J_:e<-1?-J_:Math.asin(e)}function yw(){}var vw,bw,xw,_w,ww=new V_,kw=new V_,Aw={point:yw,lineStart:yw,lineEnd:yw,polygonStart:function(){Aw.lineStart=Ew,Aw.lineEnd=Cw},polygonEnd:function(){Aw.lineStart=Aw.lineEnd=Aw.point=yw,ww.add(nw(kw)),kw=new V_},result:function(){var e=ww/2;return ww=new V_,e}};function Ew(){Aw.point=Ow}function Ow(e,t){Aw.point=Dw,vw=xw=e,bw=_w=t}function Dw(e,t){kw.add(_w*e-xw*t),xw=e,_w=t}function Cw(){Dw(vw,bw)}const Sw=Aw;var Fw=1/0,Mw=Fw,jw=-Fw,$w=jw,Nw={point:function(e,t){ejw&&(jw=e),t$w&&($w=t)},lineStart:yw,lineEnd:yw,polygonStart:yw,polygonEnd:yw,result:function(){var e=[[Fw,Mw],[jw,$w]];return jw=$w=-(Mw=Fw=1/0),e}};const Bw=Nw;var Tw,zw,Rw,Pw,Lw=0,Iw=0,Uw=0,qw=0,Ww=0,Hw=0,Gw=0,Vw=0,Yw=0,Xw={point:Zw,lineStart:Jw,lineEnd:ek,polygonStart:function(){Xw.lineStart=tk,Xw.lineEnd=nk},polygonEnd:function(){Xw.point=Zw,Xw.lineStart=Jw,Xw.lineEnd=ek},result:function(){var e=Yw?[Gw/Yw,Vw/Yw]:Hw?[qw/Hw,Ww/Hw]:Uw?[Lw/Uw,Iw/Uw]:[NaN,NaN];return Lw=Iw=Uw=qw=Ww=Hw=Gw=Vw=Yw=0,e}};function Zw(e,t){Lw+=e,Iw+=t,++Uw}function Jw(){Xw.point=Kw}function Kw(e,t){Xw.point=Qw,Zw(Rw=e,Pw=t)}function Qw(e,t){var n=e-Rw,r=t-Pw,i=hw(n*n+r*r);qw+=i*(Rw+e)/2,Ww+=i*(Pw+t)/2,Hw+=i,Zw(Rw=e,Pw=t)}function ek(){Xw.point=Zw}function tk(){Xw.point=rk}function nk(){ik(Tw,zw)}function rk(e,t){Xw.point=ik,Zw(Tw=Rw=e,zw=Pw=t)}function ik(e,t){var n=e-Rw,r=t-Pw,i=hw(n*n+r*r);qw+=i*(Rw+e)/2,Ww+=i*(Pw+t)/2,Hw+=i,Gw+=(i=Pw*e-Rw*t)*(Rw+e),Vw+=i*(Pw+t),Yw+=3*i,Zw(Rw=e,Pw=t)}const ok=Xw;function ak(e){this._context=e}ak.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,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(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Q_)}},result:yw};var sk,uk,lk,ck,fk,dk=new V_,hk={point:yw,lineStart:function(){hk.point=pk},lineEnd:function(){sk&&gk(uk,lk),hk.point=yw},polygonStart:function(){sk=!0},polygonEnd:function(){sk=null},result:function(){var e=+dk;return dk=new V_,e}};function pk(e,t){hk.point=gk,uk=ck=e,lk=fk=t}function gk(e,t){ck-=e,fk-=t,dk.add(hw(ck*ck+fk*fk)),ck=e,fk=t}const mk=hk;let yk,vk,bk,xk;class _k{constructor(e){this._append=null==e?wk:function(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return wk;if(t!==yk){const e=10**t;yk=t,vk=function(t){let n=1;this._+=t[0];for(const r=t.length;n=0))throw new RangeError(`invalid digits: ${e}`);i=t}return null===t&&(r=new _k(i)),a},a.projection(e).digits(i).context(t)}function Ak(){var e,t=[];return{point:function(t,n,r){e.push([t,n,r])},lineStart:function(){t.push(e=[])},lineEnd:yw,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function Ek(e,t){return nw(e[0]-t[0])=0;--o)i.point((c=l[o])[0],c[1]);else r(d.x,d.p.x,-1,i);d=d.p}l=(d=d.o).z,h=!h}while(!d.v);i.lineEnd()}}}function Ck(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r=0?1:-1,O=E*A,D=O>Z_,C=m*w;if(u.add(iw(C*E*fw(O),y*k+C*ow(O))),a+=D?A+E*Q_:A,D^p>=n^x>=n){var S=jk(Fk(h),Fk(b));Bk(S);var F=jk(o,S);Bk(F);var M=(D^A>=0?-1:1)*mw(F[2]);(r>M||r===M&&(S[0]||S[1]))&&(s+=D^A>=0?1:-1)}}return(a<-Y_||a0){for(f||(i.polygonStart(),f=!0),i.lineStart(),e=0;e1&&2&u&&d.push(d.pop().concat(d.shift())),a.push(d.filter(Pk))}return d}}function Pk(e){return e.length>1}function Lk(e,t){return((e=e.x)[0]<0?e[1]-J_-Y_:J_-e[1])-((t=t.x)[0]<0?t[1]-J_-Y_:J_-t[1])}const Ik=Rk((function(){return!0}),(function(e){var t,n=NaN,r=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,a){var s=o>0?Z_:-Z_,u=nw(o-n);nw(u-Z_)0?J_:-J_),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(o,r),t=0):i!==s&&u>=Z_&&(nw(n-i)Y_?rw((fw(t)*(o=ow(r))*fw(n)-fw(r)*(i=ow(t))*fw(e))/(i*o*a)):(t+r)/2}(n,r,o,a),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),t=0),e.point(n=o,r=a),i=s},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}}),(function(e,t,n,r){var i;if(null==e)i=n*J_,r.point(-Z_,i),r.point(0,i),r.point(Z_,i),r.point(Z_,0),r.point(Z_,-i),r.point(0,-i),r.point(-Z_,-i),r.point(-Z_,0),r.point(-Z_,i);else if(nw(e[0]-t[0])>Y_){var o=e[0]0)do{l.point(0===c||3===c?e:n,c>1?r:t)}while((c=(c+s+4)%4)!==f);else l.point(o[0],o[1])}function a(r,i){return nw(r[0]-e)0?0:3:nw(r[0]-n)0?2:1:nw(r[1]-t)0?1:0:i>0?3:2}function s(e,t){return u(e.x,t.x)}function u(e,t){var n=a(e,1),r=a(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(a){var u,l,c,f,d,h,p,g,m,y,v,b=a,x=Ak(),_={point:w,lineStart:function(){_.point=k,l&&l.push(c=[]),y=!0,m=!1,p=g=NaN},lineEnd:function(){u&&(k(f,d),h&&m&&x.rejoin(),u.push(x.result())),_.point=w,m&&b.lineEnd()},polygonStart:function(){b=x,u=[],l=[],v=!0},polygonEnd:function(){var t=function(){for(var t=0,n=0,i=l.length;nr&&(d-o)*(r-a)>(h-a)*(e-o)&&++t:h<=r&&(d-o)*(r-a)<(h-a)*(e-o)&&--t;return t}(),n=v&&t,i=(u=zk(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Dk(u,s,t,o,a),a.polygonEnd()),b=a,u=l=c=null}};function w(e,t){i(e,t)&&b.point(e,t)}function k(o,a){var s=i(o,a);if(l&&c.push([o,a]),y)f=o,d=a,h=s,y=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&m)b.point(o,a);else{var u=[p=Math.max(Wk,Math.min(qk,p)),g=Math.max(Wk,Math.min(qk,g))],x=[o=Math.max(Wk,Math.min(qk,o)),a=Math.max(Wk,Math.min(qk,a))];!function(e,t,n,r,i,o){var a,s=e[0],u=e[1],l=0,c=1,f=t[0]-s,d=t[1]-u;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>c)return;a>l&&(l=a)}else if(f>0){if(a0)){if(a/=d,d<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=o-u,d||!(a<0)){if(a/=d,d<0){if(a>c)return;a>l&&(l=a)}else if(d>0){if(a0&&(e[0]=s+l*f,e[1]=u+l*d),c<1&&(t[0]=s+c*f,t[1]=u+c*d),!0}}}}}(u,x,e,t,n,r)?s&&(b.lineStart(),b.point(o,a),v=!1):(m||(b.lineStart(),b.point(u[0],u[1])),b.point(x[0],x[1]),s||b.lineEnd(),v=!1)}p=o,g=a,m=s}return _}}function Gk(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return(n=t.invert(n,r))&&e.invert(n[0],n[1])}),n}function Vk(e,t){return nw(e)>Z_&&(e-=Math.round(e/Q_)*Q_),[e,t]}function Yk(e,t,n){return(e%=Q_)?t||n?Gk(Zk(e),Jk(t,n)):Zk(e):t||n?Jk(t,n):Vk}function Xk(e){return function(t,n){return nw(t+=e)>Z_&&(t-=Math.round(t/Q_)*Q_),[t,n]}}function Zk(e){var t=Xk(e);return t.invert=Xk(-e),t}function Jk(e,t){var n=ow(e),r=fw(e),i=ow(t),o=fw(t);function a(e,t){var a=ow(t),s=ow(e)*a,u=fw(e)*a,l=fw(t),c=l*n+s*r;return[iw(u*i-c*o,s*n-l*r),mw(c*i+u*o)]}return a.invert=function(e,t){var a=ow(t),s=ow(e)*a,u=fw(e)*a,l=fw(t),c=l*i-u*o;return[iw(u*i+l*o,s*n+c*r),mw(c*n-s*r)]},a}function Kk(e){return function(t){var n=new Qk;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Qk(){}function eA(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),G_(n,e.stream(Bw)),t(Bw.result()),null!=r&&e.clipExtent(r),e}function tA(e,t,n){return eA(e,(function(n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+t[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+t[0][1]+(i-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([a,s])}),n)}function nA(e,t,n){return tA(e,[[0,0],t],n)}function rA(e,t,n){return eA(e,(function(n){var r=+t,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];e.scale(150*i).translate([o,a])}),n)}function iA(e,t,n){return eA(e,(function(n){var r=+t,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;e.scale(150*i).translate([o,a])}),n)}Vk.invert=Vk,Qk.prototype={constructor:Qk,point:function(e,t){this.stream.point(e,t)},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 oA=16,aA=ow(30*tw);function sA(e,t){return+t?function(e,t){function n(r,i,o,a,s,u,l,c,f,d,h,p,g,m){var y=l-r,v=c-i,b=y*y+v*v;if(b>4*t&&g--){var x=a+d,_=s+h,w=u+p,k=hw(x*x+_*_+w*w),A=mw(w/=k),E=nw(nw(w)-1)t||nw((y*S+v*F)/b-.5)>.3||a*d+s*h+u*p0,i=nw(t)>Y_;function o(e,n){return ow(e)*ow(n)>t}function a(e,n,r){var i=[1,0,0],o=jk(Fk(e),Fk(n)),a=Mk(o,o),s=o[0],u=a-s*s;if(!u)return!r&&e;var l=t*a/u,c=-t*s/u,f=jk(i,o),d=Nk(i,l);$k(d,Nk(o,c));var h=f,p=Mk(d,h),g=Mk(h,h),m=p*p-g*(Mk(d,d)-1);if(!(m<0)){var y=hw(m),v=Nk(h,(-p-y)/g);if($k(v,d),v=Sk(v),!r)return v;var b,x=e[0],_=n[0],w=e[1],k=n[1];_0^v[1]<(nw(v[0]-x)Z_^(x<=v[0]&&v[0]<=_)){var O=Nk(h,(-p+y)/g);return $k(O,d),[v,Sk(O)]}}}function s(t,n){var i=r?e:Z_-e,o=0;return t<-i?o|=1:t>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Rk(o,(function(e){var t,n,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(f,d){var h,p=[f,d],g=o(f,d),m=r?g?0:s(f,d):g?s(f+(f<0?Z_:-Z_),d):0;if(!t&&(l=u=g)&&e.lineStart(),g!==u&&(!(h=a(t,p))||Ek(t,h)||Ek(p,h))&&(p[2]=1),g!==u)c=0,g?(e.lineStart(),h=a(p,t),e.point(h[0],h[1])):(h=a(t,p),e.point(h[0],h[1],2),e.lineEnd()),t=h;else if(i&&t&&r^g){var y;m&n||!(y=a(p,t,!0))||(c=0,r?(e.lineStart(),e.point(y[0][0],y[0][1]),e.point(y[1][0],y[1][1]),e.lineEnd()):(e.point(y[1][0],y[1][1]),e.lineEnd(),e.lineStart(),e.point(y[0][0],y[0][1],3)))}!g||t&&Ek(t,p)||e.point(p[0],p[1]),t=p,u=g,n=m},lineEnd:function(){u&&e.lineEnd(),t=null},clean:function(){return c|(l&&u)<<1}}}),(function(t,r,i,o){!function(e,t,n,r,i,o){if(n){var a=ow(t),s=fw(t),u=r*n;null==i?(i=t+r*Q_,o=t-u/2):(i=Uk(a,i),o=Uk(a,o),(r>0?io)&&(i+=r*Q_));for(var l,c=i;r>0?c>o:c2?e[2]%360*tw:0,S()):[m*ew,y*ew,v*ew]},D.angle=function(e){return arguments.length?(b=e%360*tw,S()):b*ew},D.reflectX=function(e){return arguments.length?(x=e?-1:1,S()):x<0},D.reflectY=function(e){return arguments.length?(_=e?-1:1,S()):_<0},D.precision=function(e){return arguments.length?(a=sA(s,O=e*e),F()):hw(O)},D.fitExtent=function(e,t){return tA(D,e,t)},D.fitSize=function(e,t){return nA(D,e,t)},D.fitWidth=function(e,t){return rA(D,e,t)},D.fitHeight=function(e,t){return iA(D,e,t)},function(){return t=e.apply(this,arguments),D.invert=t.invert&&C,S()}}function dA(e){var t=0,n=Z_/3,r=fA(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*tw,n=e[1]*tw):[t*ew,n*ew]},i}function hA(e,t){var n=fw(e),r=(n+fw(t))/2;if(nw(r)2?e[2]*tw:0),t.invert=function(t){return(t=e.invert(t[0]*tw,t[1]*tw))[0]*=ew,t[1]*=ew,t},t}(i.rotate()).invert([0,0]));return u(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:e===xA?[[Math.max(s[0]-o,l),t],[Math.min(s[0]+o,n),r]]:[[l,Math.max(s[1]-o,t)],[n,Math.min(s[1]+o,r)]])}return i.scale=function(e){return arguments.length?(a(e),c()):a()},i.translate=function(e){return arguments.length?(s(e),c()):s()},i.center=function(e){return arguments.length?(o(e),c()):o()},i.clipExtent=function(e){return arguments.length?(null==e?l=t=n=r=null:(l=+e[0][0],t=+e[0][1],n=+e[1][0],r=+e[1][1]),c()):null==l?null:[[l,t],[n,r]]},c()}function wA(e){return pw((J_+e)/2)}function kA(e,t){var n=ow(e),r=e===t?fw(e):lw(n/ow(t))/lw(wA(t)/wA(e)),i=n*cw(wA(e),r)/r;if(!r)return xA;function o(e,t){i>0?t<-J_+Y_&&(t=-J_+Y_):t>J_-Y_&&(t=J_-Y_);var n=i/cw(wA(t),r);return[n*fw(r*e),i-n*ow(r*e)]}return o.invert=function(e,t){var n=i-t,o=dw(r)*hw(e*e+n*n),a=iw(e,nw(n))*dw(n);return n*r<0&&(a-=Z_*dw(e)*dw(n)),[a/r,2*rw(cw(i/o,1/r))-J_]},o}function AA(e,t){return[e,t]}function EA(e,t){var n=ow(e),r=e===t?fw(e):(n-ow(t))/(t-e),i=n/r+e;if(nw(r)Y_&&--i>0);return[e/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},NA.invert=yA(mw),BA.invert=yA((function(e){return 2*rw(e)})),TA.invert=function(e,t){return[-t,2*rw(sw(e))-J_]};var zA=Math.abs,RA=(Math.atan,Math.atan2,Math.ceil,Math.cos),PA=(Math.exp,Math.floor,Math.log,Math.max,Math.min,Math.pow,Math.round,Math.sign,Math.sin),LA=(Math.tan,1e-6),IA=Math.PI,UA=IA/2,qA=(Math.SQRT1_2,HA(2));function WA(e){return e>1?UA:e<-1?-UA:Math.asin(e)}function HA(e){return e>0?Math.sqrt(e):0}function GA(e,t){var n,r=e*PA(t),i=30;do{t-=n=(t+PA(t)-r)/(1+RA(t))}while(zA(n)>LA&&--i>0);return t/2}HA(IA);var VA=function(e,t,n){function r(r,i){return[e*r*RA(i=GA(n,i)),t*PA(i)]}return r.invert=function(r,i){return i=WA(i/t),[r/(e*RA(i)),WA((2*i+PA(2*i))/n)]},r}(qA/UA,qA,IA);const YA=kk(),XA=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function ZA(e,t){if(!e||"string"!=typeof e)throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(KA[e]=function(e,t){return function n(){const r=t();return r.type=e,r.path=kk().projection(r),r.copy=r.copy||function(){const e=n();return XA.forEach((t=>{r[t]&&e[t](r[t]())})),e.path.pointRadius(r.path.pointRadius()),e},vp(r)}}(e,t),this):KA[e]||null}function JA(e){return e&&e.path||YA}const KA={albers:gA,albersusa:function(){var e,t,n,r,i,o,a=gA(),s=pA().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=pA().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(e,t){o=[e,t]}};function c(e){var t=e[0],a=e[1];return o=null,n.point(t,a),o||(r.point(t,a),o)||(i.point(t,a),o)}function f(){return e=t=null,c}return c.invert=function(e){var t=a.scale(),n=a.translate(),r=(e[0]-n[0])/t,i=(e[1]-n[1])/t;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:a).invert(e)},c.stream=function(n){return e&&t===n?e:(r=[a.stream(t=n),s.stream(n),u.stream(n)],i=r.length,e={point:function(e,t){for(var n=-1;++n2?e[2]+90:90]):[(e=n())[0],e[1],e[2]-90]},n([0,0,90]).scale(159.155)}};for(const e in KA)ZA(e,KA[e]);function QA(e,t,n){var r=Ls(e,t-Y_,n).concat(t);return function(e){return r.map((function(t){return[e,t]}))}}function eE(e,t,n){var r=Ls(e,t-Y_,n).concat(t);return function(e){return r.map((function(t){return[t,e]}))}}function tE(){}const nE=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function rE(){var e=1,t=1,n=a;function r(e,t){return t.map((t=>i(e,t)))}function i(r,i){var a=[],s=[];return function(n,r,i){var a,s,u,l,c,f,d=[],h=[];for(a=s=-1,l=n[0]>=r,nE[l<<1].forEach(p);++a=r,nE[u|l<<1].forEach(p);for(nE[0|l].forEach(p);++s=r,c=n[s*e]>=r,nE[l<<1|c<<2].forEach(p);++a=r,f=c,c=n[s*e+a+1]>=r,nE[u|l<<1|c<<2|f<<3].forEach(p);nE[l|c<<3].forEach(p)}for(a=-1,c=n[s*e]>=r,nE[c<<2].forEach(p);++a=r,nE[c<<2|f<<3].forEach(p);function p(e){var t,n,r=[e[0][0]+a,e[0][1]+s],u=[e[1][0]+a,e[1][1]+s],l=o(r),c=o(u);(t=h[l])?(n=d[c])?(delete h[t.end],delete d[n.start],t===n?(t.ring.push(u),i(t.ring)):d[t.start]=h[n.end]={start:t.start,end:n.end,ring:t.ring.concat(n.ring)}):(delete h[t.end],t.ring.push(u),h[t.end=c]=t):(t=d[c])?(n=h[l])?(delete d[t.start],delete h[n.end],t===n?(t.ring.push(u),i(t.ring)):d[n.start]=h[t.end]={start:n.start,end:t.end,ring:n.ring.concat(t.ring)}):(delete d[t.start],t.ring.unshift(r),d[t.start=l]=t):d[l]=h[c]={start:l,end:c,ring:[r,u]}}nE[c<<3].forEach(p)}(r,i,(e=>{n(e,r,i),function(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t0?a.push([e]):s.push(e)})),s.forEach((e=>{for(var t,n=0,r=a.length;n{var o,a=n[0],s=n[1],u=0|a,l=0|s,c=r[l*e+u];a>0&&a0&&s=0&&o>=0||_("invalid size"),e=i,t=o,r},r.smooth=function(e){return arguments.length?(n=e?a:tE,r):n===a},r}function iE(e,t){for(var n,r=-1,i=t.length;++rr!=h>r&&n<(d-l)*(r-c)/(h-c)+l&&(i=-i)}return i}function aE(e,t,n){var r,i,o,a;return function(e,t,n){return(t[0]-e[0])*(n[1]-e[1])==(n[0]-e[0])*(t[1]-e[1])}(e,t,n)&&(i=e[r=+(e[0]===t[0])],o=n[r],a=t[r],i<=o&&o<=a||a<=o&&o<=i)}function sE(e,t,n){return function(r){var i=xe(r),o=n?Math.min(i[0],0):i[0],a=i[1],s=a-o,u=t?bt(o,a,e):s/(e+1);return Ls(o+u,a,u)}}function uE(e){Fa.call(this,null,e)}function lE(e,t,n,r,i){const o=e.x1||0,a=e.y1||0,s=t*n<0;function u(e){e.forEach(l)}function l(e){s&&e.reverse(),e.forEach(c)}function c(e){e[0]=(e[0]-o)*t+r,e[1]=(e[1]-a)*n+i}return function(e){return e.coordinates.forEach(u),e}}function cE(e,t,n){const r=e>=0?e:Ga(t,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function fE(e){return ce(e)?e:ye(+e)}function dE(){var e=e=>e[0],t=e=>e[1],n=D,r=[-1,-1],i=960,o=500,a=2;function s(s,u){const l=cE(r[0],s,e)>>a,c=cE(r[1],s,t)>>a,f=l?l+2:0,d=c?c+2:0,h=2*f+(i>>a),p=2*d+(o>>a),g=new Float32Array(h*p),m=new Float32Array(h*p);let y=g;s.forEach((r=>{const i=f+(+e(r)>>a),o=d+(+t(r)>>a);i>=0&&i=0&&o0&&c>0?(hE(h,p,g,m,l),pE(h,p,m,g,c),hE(h,p,g,m,l),pE(h,p,m,g,c),hE(h,p,g,m,l),pE(h,p,m,g,c)):l>0?(hE(h,p,g,m,l),hE(h,p,m,g,l),hE(h,p,g,m,l),y=m):c>0&&(pE(h,p,g,m,c),pE(h,p,m,g,c),pE(h,p,g,m,c),y=m);const v=u?Math.pow(2,-2*a):1/l_(y);for(let e=0,t=h*p;e>a),y2:d+(o>>a)}}return s.x=function(t){return arguments.length?(e=fE(t),s):e},s.y=function(e){return arguments.length?(t=fE(e),s):t},s.weight=function(e){return arguments.length?(n=fE(e),s):n},s.size=function(e){if(!arguments.length)return[i,o];var t=+e[0],n=+e[1];return t>=0&&n>=0||_("invalid size"),i=t,o=n,s},s.cellSize=function(e){return arguments.length?((e=+e)>=1||_("invalid cell size"),a=Math.floor(Math.log(e)/Math.LN2),s):1<=i&&(t>=o&&(s-=n[t-o+a*e]),r[t-i+a*e]=s/Math.min(t+1,e-1+o-t,o))}function pE(e,t,n,r,i){const o=1+(i<<1);for(let a=0;a=i&&(s>=o&&(u-=n[a+(s-o)*e]),r[a+(s-i)*e]=u/Math.min(s+1,t-1+o-s,o))}function gE(e){Fa.call(this,null,e)}uE.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},De(uE,Fa,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=e.field||E,o=rE().smooth(!1!==e.smooth),a=e.thresholds||function(e,t,n){const r=sE(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(e.map((e=>Na(t(e).values))))}(r,i,e),s=null===e.as?null:e.as||"contour",u=[];return r.forEach((t=>{const n=i(t),r=o.size([n.width,n.height])(n.values,z(a)?a:a(n.values));!function(e,t,n,r){let i=r.scale||t.scale,o=r.translate||t.translate;if(ce(i)&&(i=i(n,r)),ce(o)&&(o=o(n,r)),(1===i||null==i)&&!o)return;const a=(je(i)?i:i[0])||1,s=(je(i)?i:i[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;e.forEach(lE(t,a,s,u,l))}(r,n,t,e),r.forEach((e=>{u.push(na(t,ea(null!=s?{[s]:e}:e)))}))})),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}}),gE.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const mE=["x","y","weight","size","cellSize","bandwidth"];function yE(e,t){return mE.forEach((n=>null!=t[n]?e[n](t[n]):0)),e}function vE(e){Fa.call(this,null,e)}De(gE,Fa,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=function(e,t){var n,r,i,o,a,s,u=[],l=e=>e(o);if(null==t)u.push(e);else for(n={},r=0,i=e.length;rea(function(e,t){for(let n=0;nY_})).map(u)).concat(Ls(aw(o/h)*h,i,h).filter((function(e){return nw(e%g)>Y_})).map(l))}return y.lines=function(){return v().map((function(e){return{type:"LineString",coordinates:e}}))},y.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(f(a).slice(1),c(n).reverse().slice(1),f(s).reverse().slice(1))]}},y.extent=function(e){return arguments.length?y.extentMajor(e).extentMinor(e):y.extentMinor()},y.extentMajor=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],s=+e[0][1],a=+e[1][1],r>n&&(e=r,r=n,n=e),s>a&&(e=s,s=a,a=e),y.precision(m)):[[r,s],[n,a]]},y.extentMinor=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],o=+n[0][1],i=+n[1][1],t>e&&(n=t,t=e,e=n),o>i&&(n=o,o=i,i=n),y.precision(m)):[[t,o],[e,i]]},y.step=function(e){return arguments.length?y.stepMajor(e).stepMinor(e):y.stepMinor()},y.stepMajor=function(e){return arguments.length?(p=+e[0],g=+e[1],y):[p,g]},y.stepMinor=function(e){return arguments.length?(d=+e[0],h=+e[1],y):[d,h]},y.precision=function(d){return arguments.length?(m=+d,u=QA(o,i,90),l=eE(t,e,m),c=QA(s,a,90),f=eE(r,n,m),y):m},y.extentMajor([[-180,-90+Y_],[180,90-Y_]]).extentMinor([[-180,-80-Y_],[180,80+Y_]])}()}function OE(e){Fa.call(this,null,e)}function DE(e){if(!ce(e))return!1;const t=Ye(y(e));return t.$x||t.$y||t.$value||t.$max}function CE(e){Fa.call(this,null,e),this.modified(!0)}function SE(e,t,n){ce(e[t])&&e[t](n)}function FE(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,o,a,s,u,l,c,f,d,h=e._root,p={data:r},g=e._x0,m=e._y0,y=e._x1,v=e._y1;if(!h)return e._root=p,e;for(;h.length;)if((l=t>=(o=(g+y)/2))?g=o:y=o,(c=n>=(a=(m+v)/2))?m=a:v=a,i=h,!(h=h[f=c<<1|l]))return i[f]=p,e;if(s=+e._x.call(null,h.data),u=+e._y.call(null,h.data),t===s&&n===u)return p.next=h,i?i[f]=p:e._root=p,e;do{i=i?i[f]=new Array(4):e._root=new Array(4),(l=t>=(o=(g+y)/2))?g=o:y=o,(c=n>=(a=(m+v)/2))?m=a:v=a}while((f=c<<1|l)==(d=(u>=a)<<1|s>=o));return i[d]=h,i[f]=p,e}function ME(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function jE(e){return e[0]}function $E(e){return e[1]}function NE(e,t,n){var r=new BE(null==t?jE:t,null==n?$E:n,NaN,NaN,NaN,NaN);return null==e?r:r.addAll(e)}function BE(e,t,n,r,i,o){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function TE(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}_E.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},De(_E,Fa,{transform(e,t){var n,r=this._features,i=this._points,o=e.fields,a=o&&o[0],s=o&&o[1],u=e.geojson||!o&&E,l=t.ADD;n=e.modified()||t.changed(t.REM)||t.modified(y(u))||a&&t.modified(y(a))||s&&t.modified(y(s)),this.value&&!n||(l=t.SOURCE,this._features=r=[],this._points=i=[]),u&&t.visit(l,(e=>r.push(u(e)))),a&&s&&(t.visit(l,(e=>{var t=a(e),n=s(e);null!=t&&null!=n&&(t=+t)===t&&(n=+n)===n&&i.push([t,n])})),r=r.concat({type:bE,geometry:{type:"MultiPoint",coordinates:i}})),this.value={type:xE,features:r}}}),wE.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},De(wE,Fa,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.field||E,o=e.as||"path",a=n.SOURCE;!r||e.modified()?(this.value=r=JA(e.projection),n.materialize().reflow()):a=i===E||t.modified(i.fields)?n.ADD_MOD:n.ADD;const s=function(e,t){const n=e.pointRadius();return e.context(null),null!=t&&e.pointRadius(t),n}(r,e.pointRadius);return n.visit(a,(e=>e[o]=r(i(e)))),r.pointRadius(s),n.modifies(o)}}),kE.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},De(kE,Fa,{transform(e,t){var n,r=e.projection,i=e.fields[0],o=e.fields[1],a=e.as||["x","y"],s=a[0],u=a[1];function l(e){const t=r([i(e),o(e)]);t?(e[s]=t[0],e[u]=t[1]):(e[s]=void 0,e[u]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(n=t.modified(i.fields)||t.modified(o.fields),t.visit(n?t.ADD_MOD:t.ADD,l)),t.modifies(a)}}),AE.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},De(AE,Fa,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.as||"shape",o=n.ADD;return r&&!e.modified()||(this.value=r=function(e,t,n){const r=null==n?n=>e(t(n)):r=>{var i=e.pointRadius(),o=e.pointRadius(n)(t(r));return e.pointRadius(i),o};return r.context=t=>(e.context(t),r),r}(JA(e.projection),e.field||k("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,(e=>e[i]=r)),n.modifies(i)}}),EE.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},De(EE,Fa,{transform(e,t){var n,r=this.value,i=this.generator;if(!r.length||e.modified())for(const t in e)ce(i[t])&&i[t](e[t]);return n=i(),r.length?t.mod.push(ra(r[0],n)):t.add.push(ea(n)),r[0]=n,t}}),OE.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},De(OE,Fa,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,r="shared"===e.resolve,i=e.field||E,o=function(e,t){let n;return ce(e)?(n=n=>e(n,t),n.dep=DE(e)):e?n=ye(e):(n=e=>e.$value/e.$max||0,n.dep=!0),n}(e.opacity,e),a=function(e,t){let n;return ce(e)?(n=n=>ef(e(n,t)),n.dep=DE(e)):n=ye(ef(e||"#888")),n}(e.color,e),s=e.as||"image",u={$x:0,$y:0,$value:0,$max:r?Na(n.map((e=>Na(i(e).values)))):0};return n.forEach((e=>{const t=i(e),n=be({},e,u);r||(n.$max=Na(t.values||[])),e[s]=function(e,t,n,r){const i=e.width,o=e.height,a=e.x1||0,s=e.y1||0,u=e.x2||i,l=e.y2||o,c=e.values,f=c?e=>c[e]:O,d=Oc(u-a,l-s),h=d.getContext("2d"),p=h.getImageData(0,0,u-a,l-s),g=p.data;for(let e=s,o=0;e{null!=e[t]&&SE(n,t,e[t])}))):XA.forEach((t=>{e.modified(t)&&SE(n,t,e[t])})),null!=e.pointRadius&&n.path.pointRadius(e.pointRadius),e.fit&&function(e,t){const n=function(e){return 1===(e=ue(e)).length?e[0]:{type:xE,features:e.reduce(((e,t)=>e.concat(function(e){return e.type===xE?e.features:ue(e).filter((e=>null!=e)).map((e=>e.type===bE?e:{type:bE,geometry:e}))}(t))),[])}}(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});var zE=NE.prototype=BE.prototype;function RE(e){return function(){return e}}function PE(e){return 1e-6*(e()-.5)}function LE(e){return e.x+e.vx}function IE(e){return e.y+e.vy}zE.copy=function(){var e,t,n=new BE(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=TE(r),n;for(e=[{source:r,target:n._root=new Array(4)}];r=e.pop();)for(var i=0;i<4;++i)(t=r.source[i])&&(t.length?e.push({source:t,target:r.target[i]=new Array(4)}):r.target[i]=TE(t));return n},zE.add=function(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return FE(this.cover(t,n),t,n,e)},zE.addAll=function(e){var t,n,r,i,o=e.length,a=new Array(o),s=new Array(o),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=r),if&&(f=i));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;ne||e>=i||r>t||t>=o;)switch(s=(td||(o=u.y0)>h||(a=u.x1)=y)<<1|e>=m)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=u)}else{var v=e-+this._x.call(null,g.data),b=t-+this._y.call(null,g.data),x=v*v+b*b;if(x=(s=(p+m)/2))?p=s:m=s,(c=a>=(u=(g+y)/2))?g=u:y=u,t=h,!(h=h[f=c<<1|l]))return this;if(!h.length)break;(t[f+1&3]||t[f+2&3]||t[f+3&3])&&(n=t,d=f)}for(;h.data!==e;)if(r=h,!(h=h.next))return this;return(i=h.next)&&delete h.next,r?(i?r.next=i:delete r.next,this):t?(i?t[f]=i:delete t[f],(h=t[0]||t[1]||t[2]||t[3])&&h===(t[3]||t[2]||t[1]||t[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=i,this)},zE.removeAll=function(e){for(var t=0,n=e.length;t{}};function qE(){for(var e,t=0,n=arguments.length,r={};t=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++a0)for(var n,r,i=new Array(n),o=0;o=0&&t._call.call(void 0,e),t=t._next;--ZE}()}finally{ZE=0,function(){for(var e,t,n=YE,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:YE=t);XE=e,fO(r)}(),tO=0}}function cO(){var e=rO.now(),t=e-eO;t>QE&&(nO-=t,eO=e)}function fO(e){ZE||(JE&&(JE=clearTimeout(JE)),e-tO>24?(e<1/0&&(JE=setTimeout(lO,e-rO.now()-nO)),KE&&(KE=clearInterval(KE))):(KE||(eO=rO.now(),KE=setInterval(cO,QE)),ZE=1,iO(lO)))}sO.prototype=uO.prototype={constructor:sO,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?oO():+n)+(null==t?0:+t),this._next||XE===this||(XE?XE._next=this:YE=this,XE=this),this._call=e,this._time=n,fO()},stop:function(){this._call&&(this._call=null,this._time=1/0,fO())}};const dO=4294967296;function hO(e){return e.x}function pO(e){return e.y}var gO=Math.PI*(3-Math.sqrt(5));function mO(e){return e.index}function yO(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}const vO={center:function(e,t){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;il+p||oc+p||au.index){var g=l-s.x-s.vx,m=c-s.y-s.vy,y=g*g+m*m;ye.r&&(e.r=e[t].r)}function u(){if(t){var r,i,o=t.length;for(n=new Array(o),r=0;r=s)){(e.data!==t||e.next)&&(0===f&&(p+=(f=PE(n))*f),0===d&&(p+=(d=PE(n))*d),p[s(e,t,r),e])));for(a=0,i=new Array(l);at(e,n):t)}function CO(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function SO(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=MO)):void 0===t&&(t=FO);for(var n,r,i,o,a,s=new NO(e),u=[s];n=u.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)u.push(r=i[o]=new NO(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore($O)}function FO(e){return e.children}function MO(e){return Array.isArray(e)?e[1]:null}function jO(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function $O(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function NO(e){this.data=e,this.depth=this.height=0,this.parent=null}function BO(e){return null==e?null:TO(e)}function TO(e){if("function"!=typeof e)throw new Error;return e}function zO(){return 0}function RO(e){return function(){return e}}kO.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:wO}]},De(kO,Fa,{transform(e,t){var n,r,i=this.value,o=t.changed(t.ADD_REM),a=e.modified(xO),s=e.iterations||300;if(i?(o&&(t.modifies("index"),i.nodes(t.source)),(a||t.changed(t.MOD))&&AO(i,e,0,t)):(this.value=i=function(e,t){const n=function(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=uO(f),l=VE("tick","end"),c=function(){let e=1;return()=>(e=(1664525*e+1013904223)%dO)/dO}();function f(){d(),l.call("tick",t),n1?(null==n?s.delete(e):s.set(e,p(n)),t):s.get(e)},find:function(t,n,r){var i,o,a,s,u,l=0,c=e.length;for(null==r?r=1/0:r*=r,l=0;l1?(l.on(e,n),t):l.on(e)}}}(e),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),AO(n,t,!0).on("end",(()=>o=!0))}(t.source,e),i.on("tick",(n=t.dataflow,r=this,()=>n.touch(r).run())),e.static||(o=!0,i.tick()),t.modifies("index")),a||o||e.modified(_O)||t.changed()&&e.restart)if(i.alpha(Math.max(i.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(i.alphaMin(),1/s)),e.static)for(i.stop();--s>=0;)i.tick();else if(i.stopped()&&i.restart(),!o)return t.StopPropagation;return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let e,t=this._argops,s=0,u=t.length;s=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return SO(this).eachBefore(jO)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n0&&n*n>r*r+i*i}function qO(e,t){for(var n=0;n1e-6?(D+Math.sqrt(D*D-4*O*C))/(2*O):C/D);return{x:r+w+k*S,y:i+A+E*S,r:S}}function VO(e,t,n){var r,i,o,a,s=e.x-t.x,u=e.y-t.y,l=s*s+u*u;l?(i=t.r+n.r,i*=i,a=e.r+n.r,i>(a*=a)?(r=(l+a-i)/(2*l),o=Math.sqrt(Math.max(0,a/l-r*r)),n.x=e.x-r*s-o*u,n.y=e.y-r*u+o*s):(r=(l+i-a)/(2*l),o=Math.sqrt(Math.max(0,i/l-r*r)),n.x=t.x+r*s-o*u,n.y=t.y+r*u+o*s)):(n.x=t.x+n.r,n.y=t.y)}function YO(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function XO(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,o=(t.y*n.r+n.y*t.r)/r;return i*i+o*o}function ZO(e){this._=e,this.next=null,this.previous=null}function JO(e,t){if(!(o=(e=function(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}(e)).length))return 0;var n,r,i,o,a,s,u,l,c,f,d;if((n=e[0]).x=0,n.y=0,!(o>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;VO(r,n,i=e[2]),n=new ZO(n),r=new ZO(r),i=new ZO(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(u=3;ufunction(e){let t=(e=`${e}`).length;return fD(e,t-1)&&!fD(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r)))),n=t.map(cD),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(cD(e)),d.push(aD));h=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,i=d.length;a=0&&(l=d[e]).data===aD;--e)l.data=null}if(s.parent=iD,s.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore($O),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=BO(e),r):t},r.parentId=function(e){return arguments.length?(n=BO(e),r):n},r.path=function(t){return arguments.length?(e=BO(t),r):e},r}function cD(e){let t=e.length;if(t<2)return"";for(;--t>1&&!fD(e,t););return e.slice(0,t)}function fD(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function dD(e,t){return e.parent===t.parent?1:2}function hD(e){var t=e.children;return t?t[0]:e.t}function pD(e){var t=e.children;return t?t[t.length-1]:e.t}function gD(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function mD(e,t,n){return e.a.parent===t.parent?e.a:n}function yD(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}function vD(e,t){return e.parent===t.parent?1:2}function bD(e,t){return e+t.x}function xD(e,t){return Math.max(e,t.y)}function _D(e,t,n,r,i){for(var o,a=e.children,s=-1,u=a.length,l=e.value&&(i-n)/e.value;++sd&&(d=s),m=c*c*g,(h=Math.max(d/m,m/f))>p){c-=s;break}p=h}y.push(a={value:c,dice:u1?t:1)},n}(wD),ED=function e(t){function n(e,n,r,i,o){if((a=e._squarify)&&a.ratio===t)for(var a,s,u,l,c,f=-1,d=a.length,h=e.value;++f1?t:1)},n}(wD);function OD(e,t,n){const r={};return e.each((e=>{const i=e.data;n(i)&&(r[t(i)]=e)})),e.lookup=r,e}function DD(e){Fa.call(this,null,e)}DD.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const CD=e=>e.values;function SD(){const e=[],t={entries:e=>r(n(e,0),0),key:n=>(e.push(n),t)};function n(t,r){if(r>=e.length)return t;const i=t.length,o=e[r++],a={},s={};let u,l,c,f=-1;for(;++fe.length)return t;const i=[];for(const e in t)i.push({key:e,values:r(t[e],n)});return i}return t}function FD(e){Fa.call(this,null,e)}De(DD,Fa,{transform(e,t){t.source||_("Nest transform requires an upstream data source.");var n=e.generate,r=e.modified(),i=t.clone(),o=this.value;return(!o||r||t.changed())&&(o&&o.each((e=>{e.children&&Jo(e.data)&&i.rem.push(e.data)})),this.value=o=SO({values:ue(e.keys).reduce(((e,t)=>(e.key(t),e)),SD()).entries(i.source)},CD),n&&o.each((e=>{e.children&&(e=ea(e.data),i.add.push(e),i.source.push(e))})),OD(o,Ko,Ko)),i.source.root=o,i}});const MD=(e,t)=>e.parent===t.parent?1:2;De(FD,Fa,{transform(e,t){t.source&&t.source.root||_(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),r=this.fields,i=t.source.root,o=e.as||r;e.field?i.sum(e.field):i.count(),e.sort&&i.sort(ia(e.sort,(e=>e.data))),function(e,t,n){for(let r,i=0,o=t.length;ifunction(e,t,n){const r=e.data,i=t.length-1;for(let o=0;o(e=(1664525*e+1013904223)%PO)/PO}();return i.x=t/2,i.y=n/2,e?i.eachBefore(QO(e)).eachAfter(eD(r,.5,o)).eachBefore(tD(1)):i.eachBefore(QO(KO)).eachAfter(eD(zO,1,o)).eachAfter(eD(r,i.r/Math.min(t,n),o)).eachBefore(tD(Math.min(t,n)/(2*i.r))),i}return i.radius=function(t){return arguments.length?(e=BO(t),i):e},i.size=function(e){return arguments.length?(t=+e[0],n=+e[1],i):[t,n]},i.padding=function(e){return arguments.length?(r="function"==typeof e?e:RO(+e),i):r},i},params:["radius","size","padding"],fields:jD});const ND=["x0","y0","x1","y1","depth","children"];function BD(e){FD.call(this,e)}function TD(e){Fa.call(this,null,e)}BD.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ND.length,default:ND}]},De(BD,FD,{layout:function(){var e=1,t=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=e,i.y1=t/o,i.eachBefore(function(e,t){return function(r){r.children&&rD(r,r.x0,e*(r.depth+1)/t,r.x1,e*(r.depth+2)/t);var i=r.x0,o=r.y0,a=r.x1-n,s=r.y1-n;a=0;--i)s.push(n=t.children[i]=new yD(r[i],i)),n.parent=t;return(a.parent=new yD(null,0)).children=[a],a}(i);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(a),r)i.eachBefore(s);else{var l=i,c=i,f=i;i.eachBefore((function(e){e.xc.x&&(c=e),e.depth>f.depth&&(f=e)}));var d=l===c?1:e(l,c)/2,h=d-l.x,p=t/(c.x+d+h),g=n/(f.depth||1);i.eachBefore((function(e){e.x=(e.x+h)*p,e.y=e.depth*g}))}return i}function o(t){var n=t.children,r=t.parent.children,i=t.i?r[t.i-1]:null;if(n){!function(e){for(var t,n=0,r=0,i=e.children,o=i.length;--o>=0;)(t=i[o]).z+=n,t.m+=n,n+=t.s+(r+=t.c)}(t);var o=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-o):t.z=o}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function(t,n,r){if(n){for(var i,o=t,a=t,s=n,u=o.parent.children[0],l=o.m,c=a.m,f=s.m,d=u.m;s=pD(s),o=hD(o),s&&o;)u=hD(u),(a=pD(a)).a=t,(i=s.z+f-o.z-l+e(s._,o._))>0&&(gD(mD(s,t,r),t,i),l+=i,c+=i),f+=s.m,l+=o.m,d+=u.m,c+=a.m;s&&!pD(a)&&(a.t=s,a.m+=f-c),o&&!hD(u)&&(u.t=o,u.m+=l-d,r=t)}return r}(t,i,t.parent.A||r[0])}function a(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*n}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i},cluster:function(){var e=vD,t=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(t){var n=t.children;n?(t.x=function(e){return e.reduce(bD,0)/e.length}(n),t.y=function(e){return 1+e.reduce(xD,0)}(n)):(t.x=o?a+=e(t,o):0,t.y=0,o=t)}));var s=function(e){for(var t;t=e.children;)e=t[0];return e}(i),u=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(i),l=s.x-e(s,u)/2,c=u.x+e(u,s)/2;return i.eachAfter(r?function(e){e.x=(e.x-i.x)*t,e.y=(i.y-e.y)*n}:function(e){e.x=(e.x-l)/(c-l)*t,e.y=(1-(i.y?e.y/i.y:1))*n})}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i}},RD=["x","y","depth","children"];function PD(e){FD.call(this,e)}function LD(e){Fa.call(this,[],e)}PD.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:RD.length,default:RD}]},De(PD,FD,{layout(e){const t=e||"tidy";if(ke(zD,t))return zD[t]();_("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:RD}),LD.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},De(LD,Fa,{transform(e,t){const n=this.value,r=t.source&&t.source.root,i=t.fork(t.NO_SOURCE),o={};return r||_("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(i.rem=n,t.visit(t.SOURCE,(e=>o[Ko(e)]=1)),r.each((e=>{const t=e.data,n=e.parent&&e.parent.data;n&&o[Ko(t)]&&o[Ko(n)]&&i.add.push(ea({source:n,target:t}))})),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,(e=>o[Ko(e)]=1)),n.forEach((e=>{(o[Ko(e.source)]||o[Ko(e.target)])&&i.mod.push(e)}))),i}});const ID={binary:function(e,t,n,r,i){var o,a,s=e.children,u=s.length,l=new Array(u+1);for(l[0]=a=o=0;o=n-1){var c=s[t];return c.x0=i,c.y0=o,c.x1=a,void(c.y1=u)}for(var f=l[t],d=r/2+f,h=t+1,p=n-1;h>>1;l[g]u-o){var v=r?(i*y+a*m)/r:a;e(t,h,m,i,o,v,u),e(h,n,y,v,o,a,u)}else{var b=r?(o*y+u*m)/r:u;e(t,h,m,i,o,a,b),e(h,n,y,i,b,a,u)}}(0,u,e.value,t,n,r,i)},dice:rD,slice:_D,slicedice:function(e,t,n,r,i){(1&e.depth?_D:rD)(e,t,n,r,i)},squarify:AD,resquarify:ED},UD=["x0","y0","x1","y1","depth","children"];function qD(e){FD.call(this,e)}qD.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:UD.length,default:UD}]},De(qD,FD,{layout(){const e=function(){var e=AD,t=!1,n=1,r=1,i=[0],o=zO,a=zO,s=zO,u=zO,l=zO;function c(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(f),i=[0],t&&e.eachBefore(nD),e}function f(t){var n=i[t.depth],r=t.x0+n,c=t.y0+n,f=t.x1-n,d=t.y1-n;f{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{ke(ID,t)?e.tile(ID[t]):_("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:UD});const WD=4278190080;function HD(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function GD(e,t,n){if(!t.length)return;const r=t[0].mark.marktype;"group"===r?t.forEach((t=>{t.items.forEach((t=>GD(e,t.items,n)))})):rv[r].draw(e,{items:n?t.map(VD):t})}function VD(e){const t=na(e,{});return t.stroke&&0!==t.strokeOpacity||t.fill&&0!==t.fillOpacity?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const YD=5,XD=31,ZD=32,JD=new Uint32Array(ZD+1),KD=new Uint32Array(ZD+1);KD[0]=0,JD[0]=~KD[0];for(let e=1;e<=ZD;++e)KD[e]=KD[e-1]<<1|1,JD[e]=~KD[e];function QD(e,t,n,r,i,o){let a=n/2;return e-a<0||e+a>i||t-(a=r/2)<0||t+a>o}function eC(e,t,n,r,i,o,a,s){const u=i*o/(2*r),l=e(t-u),c=e(t+u),f=e(n-(o/=2)),d=e(n+o);return a.outOfBounds(l,f,c,d)||a.getRange(l,f,c,d)||s&&s.getRange(l,f,c,d)}const tC=[-1,-1,1,1],nC=[-1,1,-1,1],rC=["right","center","left"],iC=["bottom","middle","top"];function oC(e,t,n,r,i,o,a,s,u,l,c,f){return!(i.outOfBounds(e,n,t,r)||(f&&o||i).getRange(e,n,t,r))}const aC={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},sC={naive:function(e,t,n,r){const i=e.width,o=e.height;return function(e){const t=e.datum.datum.items[r].items,n=t.length,a=e.datum.fontSize,s=zy.width(e.datum,e.datum.text);let u,l,c,f,d,h,p,g=0;for(let r=0;r=g&&(g=p,e.x=d,e.y=h);return d=s/2,h=a/2,u=e.x-d,l=e.x+d,c=e.y-h,f=e.y+h,e.align="center",u<0&&l<=i?e.align="left":0<=u&&i=1;)d=(h+p)/2,eC(e,c,f,l,u,d,a,s)?p=d:h=d;if(h>r)return[c,f,h,!0]}}return function(t){const s=t.datum.datum.items[r].items,l=s.length,c=t.datum.fontSize,f=zy.width(t.datum,t.datum.text);let d,h,p,g,m,y,v,b,x,_,w,k,A,E,O,D,C,S=n?c:0,F=!1,M=!1,j=0;for(let r=0;rh&&(C=d,d=h,h=C),p>g&&(C=p,p=g,g=C),x=e(d),w=e(h),_=~~((x+w)/2),k=e(p),E=e(g),A=~~((k+E)/2),v=_;v>=x;--v)for(b=A;b>=k;--b)D=u(v,b,S,f,c),D&&([t.x,t.y,S,F]=D);for(v=_;v<=w;++v)for(b=A;b<=E;++b)D=u(v,b,S,f,c),D&&([t.x,t.y,S,F]=D);F||n||(O=Math.abs(h-d+g-p),m=(d+h)/2,y=(p+g)/2,O>=j&&!QD(m,y,f,c,i,o)&&!eC(e,m,y,c,f,c,a,null)&&(j=O,t.x=m,t.y=y,M=!0))}return!(!F&&!M||(m=f/2,y=c/2,a.setRange(e(t.x-m),e(t.y-y),e(t.x+m),e(t.y+y)),t.align="center",t.baseline="middle",0))}},floodfill:function(e,t,n,r){const i=e.width,o=e.height,a=t[0],s=t[1],u=e.bitmap();return function(t){const l=t.datum.datum.items[r].items,c=l.length,f=t.datum.fontSize,d=zy.width(t.datum,t.datum.text),h=[];let p,g,m,y,v,b,x,_,w,k,A,E,O=n?f:0,D=!1,C=!1,S=0;for(let r=0;r=1;)A=(w+k)/2,eC(e,v,b,f,d,A,a,s)?k=A:w=A;w>O&&(t.x=v,t.y=b,O=w,D=!0)}}D||n||(E=Math.abs(g-p+y-m),v=(p+g)/2,b=(m+y)/2,E>=S&&!QD(v,b,d,f,i,o)&&!eC(e,v,b,f,d,f,a,null)&&(S=E,t.x=v,t.y=b,C=!0))}return!(!D&&!C||(v=d/2,b=f/2,a.setRange(e(t.x-v),e(t.y-b),e(t.x+v),e(t.y+b)),t.align="center",t.baseline="middle",0))}}};function uC(e,t,n,r,i,o,a,s,u,l,c){if(!e.length)return e;const f=Math.max(r.length,i.length),d=function(e,t){const n=new Float64Array(t),r=e.length;for(let t=0;t[e.x,e.x,e.x,e.y,e.y,e.y];return e?"line"===e||"area"===e?e=>i(e.datum):"line"===t?e=>{const t=e.datum.items[r].items;return i(t.length?t["start"===n?0:t.length-1]:{x:NaN,y:NaN})}:e=>{const t=e.datum.bounds;return[t.x1,(t.x1+t.x2)/2,t.x2,t.y1,(t.y1+t.y2)/2,t.y2]}:i}(p,g,s,u),v=null===l||l===1/0,b=m&&"naive"===c;var x;let _=-1,w=-1;const k=e.map((e=>{const t=v?zy.width(e,e.text):void 0;return _=Math.max(_,t),w=Math.max(w,e.fontSize),{datum:e,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(e),textWidth:t}}));l=null===l||l===1/0?Math.max(_,w)+Math.max(...r):l;const A=function(e,t,n){const r=Math.max(1,Math.sqrt(e*t/1e6)),i=~~((e+2*n+r)/r),o=~~((t+2*n+r)/r),a=e=>~~((e+n)/r);return a.invert=e=>e*r-n,a.bitmap=()=>function(e,t){const n=new Uint32Array(~~((e*t+ZD)/ZD));function r(e,t){n[e]|=t}function i(e,t){n[e]&=t}return{array:n,get:(t,r)=>{const i=r*e+t;return n[i>>>YD]&1<<(i&XD)},set:(t,n)=>{const i=n*e+t;r(i>>>YD,1<<(i&XD))},clear:(t,n)=>{const r=n*e+t;i(r>>>YD,~(1<<(r&XD)))},getRange:(t,r,i,o)=>{let a,s,u,l,c=o;for(;c>=r;--c)if(a=c*e+t,s=c*e+i,u=a>>>YD,l=s>>>YD,u===l){if(n[u]&JD[a&XD]&KD[1+(s&XD)])return!0}else{if(n[u]&JD[a&XD])return!0;if(n[l]&KD[1+(s&XD)])return!0;for(let e=u+1;e{let a,s,u,l,c;for(;n<=o;++n)if(a=n*e+t,s=n*e+i,u=a>>>YD,l=s>>>YD,u===l)r(u,JD[a&XD]&KD[1+(s&XD)]);else for(r(u,JD[a&XD]),r(l,KD[1+(s&XD)]),c=u+1;c{let a,s,u,l,c;for(;n<=o;++n)if(a=n*e+t,s=n*e+r,u=a>>>YD,l=s>>>YD,u===l)i(u,KD[a&XD]|JD[1+(s&XD)]);else for(i(u,KD[a&XD]),i(l,JD[1+(s&XD)]),c=u+1;cn<0||r<0||o>=t||i>=e}}(i,o),a.ratio=r,a.padding=n,a.width=e,a.height=t,a}(t[0],t[1],l);let E;if(!b){n&&k.sort(((e,t)=>n(e.datum,t.datum)));let t=!1;for(let e=0;ee.datum));E=o.length||r?function(e,t,n,r,i){const o=e.width,a=e.height,s=r||i,u=Oc(o,a).getContext("2d"),l=Oc(o,a).getContext("2d"),c=s&&Oc(o,a).getContext("2d");n.forEach((e=>GD(u,e,!1))),GD(l,t,!1),s&&GD(c,t,!0);const f=HD(u,o,a),d=HD(l,o,a),h=s&&HD(c,o,a),p=e.bitmap(),g=s&&e.bitmap();let m,y,v,b,x,_,w,k;for(y=0;yn.set(e(t.boundary[0]),e(t.boundary[3])))),[n,void 0]}(A,a&&k)}const O=m?sC[c](A,E,a,u):function(e,t,n,r){const i=e.width,o=e.height,a=t[0],s=t[1],u=r.length;return function(t){const l=t.boundary,c=t.datum.fontSize;if(l[2]<0||l[5]<0||l[0]>i||l[3]>o)return!1;let f,d,h,p,g,m,y,v,b,x,_,w,k,A,E,O=t.textWidth??0;for(let i=0;i>>2&3)-1,h=0===f&&0===d||r[i]<0,p=f&&d?Math.SQRT1_2:1,g=r[i]<0?-1:1,m=l[1+f]+r[i]*f*p,_=l[4+d]+g*c*d/2+r[i]*d*p,v=_-c/2,b=_+c/2,w=e(m),A=e(v),E=e(b),!O){if(!oC(w,w,A,E,a,s,0,0,0,0,0,h))continue;O=zy.width(t.datum,t.datum.text)}if(x=m+g*O*f/2,m=x-O/2,y=x+O/2,w=e(m),k=e(y),oC(w,k,A,E,a,s,0,0,0,0,0,h))return t.x=f?f*g<0?y:m:x,t.y=d?d*g<0?b:v:_,t.align=rC[f*g+1],t.baseline=iC[d*g+1],a.setRange(w,A,k,E),!0}return!1}}(A,E,h,d);return k.forEach((e=>e.opacity=+O(e))),k}const lC=["x","y","opacity","align","baseline"],cC=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function fC(e){Fa.call(this,null,e)}function dC(e,t){var n,r,i,o,a,s,u=[],l=function(e){return e(o)};if(null==t)u.push(e);else for(n={},r=0,i=e.length;r{const t=e.datum;t[r[0]]=e.x,t[r[1]]=e.y,t[r[2]]=e.opacity,t[r[3]]=e.align,t[r[4]]=e.baseline})),t.reflow(n).modifies(r)}}),hC.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},De(hC,Fa,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=dC(t.materialize(t.SOURCE).source,e.groupby),i=(e.groupby||[]).map(m),o=i.length,a=e.as||[m(e.x),m(e.y)],s=[];r.forEach((t=>{Ns(t,e.x,e.y,e.bandwidth||.3).forEach((e=>{const n={};for(let e=0;e"poly"===e?t:"quad"===e?2:1)(o,a),u=e.as||[m(e.x),m(e.y)],l=pC[o],c=[];let f=e.extent;ke(pC,o)||_("Invalid regression method: "+o),null!=f&&"log"===o&&f[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),f=null),r.forEach((n=>{if(n.length<=s)return void t.dataflow.warn("Skipping regression with more parameters than data points.");const r=l(n,e.x,e.y,a);if(e.params)return void c.push(ea({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));const d=f||xe(n,e.x),h=e=>{const t={};for(let e=0;eh([e,r.predict(e)]))):Rs(r.predict,d,25,200).forEach(h)})),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});const mC=134217729;function yC(e,t,n,r,i){let o,a,s,u,l=t[0],c=r[0],f=0,d=0;c>l==c>-l?(o=l,l=t[++f]):(o=c,c=r[++d]);let h=0;if(fl==c>-l?(a=l+o,s=o-(a-l),l=t[++f]):(a=c+o,s=o-(a-c),c=r[++d]),o=a,0!==s&&(i[h++]=s);fl==c>-l?(a=o+l,u=a-o,s=o-(a-u)+(l-u),l=t[++f]):(a=o+c,u=a-o,s=o-(a-u)+(c-u),c=r[++d]),o=a,0!==s&&(i[h++]=s);for(;f0!=s>0)return u;const l=Math.abs(a+s);return Math.abs(u)>=33306690738754716e-32*l?u:-function(e,t,n,r,i,o,a){let s,u,l,c,f,d,h,p,g,m,y,v,b,x,_,w,k,A;const E=e-i,O=n-i,D=t-o,C=r-o;x=E*C,d=mC*E,h=d-(d-E),p=E-h,d=mC*C,g=d-(d-C),m=C-g,_=p*m-(x-h*g-p*g-h*m),w=D*O,d=mC*D,h=d-(d-D),p=D-h,d=mC*O,g=d-(d-O),m=O-g,k=p*m-(w-h*g-p*g-h*m),y=_-k,f=_-y,bC[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,bC[1]=b-(y+f)+(f-w),A=v+y,f=A-v,bC[2]=v-(A-f)+(y-f),bC[3]=A;let S=function(e,t){let n=t[0];for(let e=1;e<4;e++)n+=t[e];return n}(0,bC),F=22204460492503146e-32*a;if(S>=F||-S>=F)return S;if(f=e-E,s=e-(E+f)+(f-i),f=n-O,l=n-(O+f)+(f-i),f=t-D,u=t-(D+f)+(f-o),f=r-C,c=r-(C+f)+(f-o),0===s&&0===u&&0===l&&0===c)return S;if(F=11093356479670487e-47*a+33306690738754706e-32*Math.abs(S),S+=E*c+C*s-(D*l+O*u),S>=F||-S>=F)return S;x=s*C,d=mC*s,h=d-(d-s),p=s-h,d=mC*C,g=d-(d-C),m=C-g,_=p*m-(x-h*g-p*g-h*m),w=u*O,d=mC*u,h=d-(d-u),p=u-h,d=mC*O,g=d-(d-O),m=O-g,k=p*m-(w-h*g-p*g-h*m),y=_-k,f=_-y,kC[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,kC[1]=b-(y+f)+(f-w),A=v+y,f=A-v,kC[2]=v-(A-f)+(y-f),kC[3]=A;const M=yC(4,bC,4,kC,xC);x=E*c,d=mC*E,h=d-(d-E),p=E-h,d=mC*c,g=d-(d-c),m=c-g,_=p*m-(x-h*g-p*g-h*m),w=D*l,d=mC*D,h=d-(d-D),p=D-h,d=mC*l,g=d-(d-l),m=l-g,k=p*m-(w-h*g-p*g-h*m),y=_-k,f=_-y,kC[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,kC[1]=b-(y+f)+(f-w),A=v+y,f=A-v,kC[2]=v-(A-f)+(y-f),kC[3]=A;const j=yC(M,xC,4,kC,_C);x=s*c,d=mC*s,h=d-(d-s),p=s-h,d=mC*c,g=d-(d-c),m=c-g,_=p*m-(x-h*g-p*g-h*m),w=u*l,d=mC*u,h=d-(d-u),p=u-h,d=mC*l,g=d-(d-l),m=l-g,k=p*m-(w-h*g-p*g-h*m),y=_-k,f=_-y,kC[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,kC[1]=b-(y+f)+(f-w),A=v+y,f=A-v,kC[2]=v-(A-f)+(y-f),kC[3]=A;const $=yC(j,_C,4,kC,wC);return wC[$-1]}(e,t,n,r,i,o,l)}vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(8),vC(8),vC(8),vC(4),vC(8),vC(8),vC(8),vC(12),vC(192),vC(192),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(8),vC(8),vC(8),vC(8),vC(8),vC(8),vC(8),vC(8),vC(8),vC(4),vC(4),vC(4),vC(8),vC(16),vC(16),vC(16),vC(32),vC(32),vC(48),vC(64),vC(1152),vC(1152),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(4),vC(24),vC(24),vC(24),vC(24),vC(24),vC(24),vC(24),vC(24),vC(24),vC(24),vC(1152),vC(1152),vC(1152),vC(1152),vC(1152),vC(2304),vC(2304),vC(3456),vC(5760),vC(8),vC(8),vC(8),vC(16),vC(24),vC(48),vC(48),vC(96),vC(192),vC(384),vC(384),vC(384),vC(768),vC(96),vC(96),vC(96),vC(1152);const EC=Math.pow(2,-52),OC=new Uint32Array(512);class DC{static from(e,t=$C,n=NC){const r=e.length,i=new Float64Array(2*r);for(let o=0;o>1;if(t>0&&"number"!=typeof e[0])throw new Error("Expected coords to contain numbers.");this.coords=e;const n=Math.max(2*t-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=e.length>>1;let a=1/0,s=1/0,u=-1/0,l=-1/0;for(let t=0;tu&&(u=n),r>l&&(l=r),this._ids[t]=t}const c=(a+u)/2,f=(s+l)/2;let d,h,p,g=1/0;for(let t=0;t0&&(h=t,g=n)}let v=e[2*h],b=e[2*h+1],x=1/0;for(let t=0;tr&&(t[n++]=i,r=this._dists[i])}return this.hull=t.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(AC(m,y,v,b,_,w)<0){const e=h,t=v,n=b;h=p,v=_,b=w,p=e,_=t,w=n}const k=function(e,t,n,r,i,o){const a=n-e,s=r-t,u=i-e,l=o-t,c=a*a+s*s,f=u*u+l*l,d=.5/(a*l-s*u);return{x:e+(l*c-s*f)*d,y:t+(a*f-u*c)*d}}(m,y,v,b,_,w);this._cx=k.x,this._cy=k.y;for(let t=0;t0&&Math.abs(l-o)<=EC&&Math.abs(c-a)<=EC)continue;if(o=l,a=c,u===d||u===h||u===p)continue;let f=0;for(let e=0,t=this._hashKey(l,c);e=0;)if(m=g,m===f){m=-1;break}if(-1===m)continue;let y=this._addTriangle(m,u,n[m],-1,-1,r[m]);r[u]=this._legalize(y+2),r[m]=y,A++;let v=n[m];for(;g=n[v],AC(l,c,e[2*v],e[2*v+1],e[2*g],e[2*g+1])<0;)y=this._addTriangle(v,u,g,r[u],-1,r[v]),r[u]=this._legalize(y+2),n[v]=v,A--,v=g;if(m===f)for(;g=t[m],AC(l,c,e[2*g],e[2*g+1],e[2*m],e[2*m+1])<0;)y=this._addTriangle(g,u,m,-1,r[m],r[g]),this._legalize(y+2),r[g]=y,n[m]=m,A--,m=g;this._hullStart=t[u]=m,n[m]=t[v]=u,n[u]=v,i[this._hashKey(l,c)]=u,i[this._hashKey(e[2*m],e[2*m+1])]=m}this.hull=new Uint32Array(A);for(let e=0,t=this._hullStart;e0?3-n:1+n)/4}(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:t,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[e],s=e-e%3;if(o=s+(e+2)%3,-1===a){if(0===i)break;e=OC[--i];continue}const u=a-a%3,l=s+(e+1)%3,c=u+(a+2)%3,f=t[o],d=t[e],h=t[l],p=t[c];if(SC(r[2*f],r[2*f+1],r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1])){t[e]=p,t[a]=f;const r=n[c];if(-1===r){let t=this._hullStart;do{if(this._hullTri[t]===c){this._hullTri[t]=e;break}t=this._hullPrev[t]}while(t!==this._hullStart)}this._link(e,r),this._link(a,n[o]),this._link(o,c);const s=u+(a+1)%3;i=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=r}else{let i=n+1,o=r;jC(e,n+r>>1,i),t[e[n]]>t[e[r]]&&jC(e,n,r),t[e[i]]>t[e[r]]&&jC(e,i,r),t[e[n]]>t[e[i]]&&jC(e,n,i);const a=e[i],s=t[a];for(;;){do{i++}while(t[e[i]]s);if(o=o-n?(MC(e,t,i,r),MC(e,t,n,o-1)):(MC(e,t,n,o-1),MC(e,t,i,r))}}function jC(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function $C(e){return e[0]}function NC(e){return e[1]}const BC=1e-6;class TC{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,t){this._+=`L${this._x1=+e},${this._y1=+t}`}arc(e,t,n){const r=(e=+e)+(n=+n),i=t=+t;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>BC||Math.abs(this._y1-i)>BC)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${e-n},${t}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(e,t,n,r){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class zC{constructor(){this._=[]}moveTo(e,t){this._.push([e,t])}closePath(){this._.push(this._[0].slice())}lineTo(e,t){this._.push([e,t])}value(){return this._.length?this._:null}}class RC{constructor(e,[t,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(t=+t)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=r,this.xmin=t,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:t,triangles:n},vectors:r}=this;let i,o;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let r,s,u=0,l=0,c=n.length;u1;)i-=2;for(let e=2;e0){if(t>=this.ymax)return null;(i=(this.ymax-t)/r)0){if(e>=this.xmax)return null;(i=(this.xmax-e)/n)this.xmax?2:0)|(tthis.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let t=0;t2&&function(e){const{triangles:t,coords:n}=e;for(let e=0;e1e-10)return!1}return!0}(e)){this.collinear=Int32Array.from({length:t.length/2},((e,t)=>t)).sort(((e,n)=>t[2*e]-t[2*n]||t[2*e+1]-t[2*n+1]));const e=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[t[2*e],t[2*e+1],t[2*n],t[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let e=0,n=t.length/2;e0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,2===r.length&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(e){return new RC(this,e)}*neighbors(e){const{inedges:t,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const t=a.indexOf(e);return t>0&&(yield a[t-1]),void(t=0&&i!==n&&i!==r;)n=i;return i}_step(e,t,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:u}=this;if(-1===r[e]||!u.length)return(e+1)%(u.length>>1);let l=e,c=LC(t-u[2*e],2)+LC(n-u[2*e+1],2);const f=r[e];let d=f;do{let r=s[d];const f=LC(t-u[2*r],2)+LC(n-u[2*r+1],2);if(f>5<<5,u=~~Math.max(Math.abs(v+b),Math.abs(v-b))}else a=a+31>>5<<5;if(u>h&&(h=u),f+a>=XC<<5&&(f=0,d+=h,h=0),d+u>=ZC)break;i.translate((f+(a>>1))/o,(d+(u>>1))/o),t.rotate&&i.rotate(t.rotate*YC),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=a,t.height=u,t.xoff=f,t.yoff=d,t.x1=a>>1,t.y1=u>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,f+=a}for(var _=i.getImageData(0,0,(XC<<5)/o,ZC/o).data,w=[];--r>=0;)if((t=n[r]).hasText){for(s=(a=t.width)>>5,u=t.y1-t.y0,l=0;l>5),O=_[(d+c)*(XC<<5)+(f+l)<<2]?1<<31-l%32:0;w[E]|=O,k|=O}k?A=c:(t.y0++,u--,c--,d++)}t.y1=t.y0+A,t.sprite=w.slice(0,(t.y1-t.y0)*s)}}}function KC(e,t,n){n>>=5;for(var r,i=e.sprite,o=e.width>>5,a=e.x-(o<<4),s=127&a,u=32-s,l=e.y1-e.y0,c=(e.y+e.y0)*n+(a>>5),f=0;f>>s:0))&t[c+d])return!0;c+=n}return!1}function QC(e,t){var n=e[0],r=e[1];t.x+t.x0r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function eS(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0=f));)if(t.x=a+i,t.y=l+o,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>s[0]||t.y+t.y1>s[1])&&(!n||!KC(t,e,s[0]))&&(!n||eS(t,n))){for(var g,m=t.sprite,y=t.width>>5,v=s[0]>>5,b=t.x-(y<<4),x=127&b,_=32-x,w=t.y1-t.y0,k=(t.y+t.y0)*v+(b>>5),A=0;A>>x:0);k+=v}return t.sprite=null,!0}return!1}return f.layout=function(){for(var u=function(e){e.width=e.height=1;var t=Math.sqrt(e.getContext("2d").getImageData(0,0,1,1).data.length>>2);e.width=(XC<<5)/t,e.height=ZC/t;var n=e.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:t}}(Oc()),f=function(e){for(var t=[],n=-1;++n>5)*s[1]),h=null,p=l.length,g=-1,m=[],y=l.map((s=>({text:e(s),font:t(s),style:r(s),weight:i(s),rotate:o(s),size:~~(n(s)+1e-14),padding:a(s),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:s}))).sort(((e,t)=>t.size-e.size));++g>1,v.y=s[1]*(c()+.5)>>1,JC(u,v,y,g),v.hasText&&d(f,v,h)&&(m.push(v),h?QC(h,v):h=[{x:v.x+v.x0,y:v.y+v.y0},{x:v.x+v.x1,y:v.y+v.y1}],v.x-=s[0]>>1,v.y-=s[1]>>1)}return m},f.words=function(e){return arguments.length?(l=e,f):l},f.size=function(e){return arguments.length?(s=[+e[0],+e[1]],f):s},f.font=function(e){return arguments.length?(t=nS(e),f):t},f.fontStyle=function(e){return arguments.length?(r=nS(e),f):r},f.fontWeight=function(e){return arguments.length?(i=nS(e),f):i},f.rotate=function(e){return arguments.length?(o=nS(e),f):o},f.text=function(t){return arguments.length?(e=nS(t),f):e},f.spiral=function(e){return arguments.length?(u=rS[e]||e,f):u},f.fontSize=function(e){return arguments.length?(n=nS(e),f):n},f.padding=function(e){return arguments.length?(a=nS(e),f):a},f.random=function(e){return arguments.length?(c=e,f):c},f}(),e)}aS.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:iS}]},De(aS,Fa,{transform(e,t){!e.size||e.size[0]&&e.size[1]||_("Wordcloud size dimensions must be non-zero.");const n=e.modified();if(!(n||t.changed(t.ADD_REM)||oS.some((function(n){const r=e[n];return ce(r)&&t.modified(r.fields)}))))return;const r=t.materialize(t.SOURCE).source,i=this.value,o=e.as||iS;let a,s=e.fontSize||14;if(ce(s)?a=e.fontSizeRange:s=ye(s),a){const e=s,t=bp("sqrt")().domain(xe(r,e)).range(a);s=n=>t(e(n))}r.forEach((e=>{e[o[0]]=NaN,e[o[1]]=NaN,e[o[3]]=0}));const u=i.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(s).random(Ya).layout(),l=i.size(),c=l[0]>>1,f=l[1]>>1,d=u.length;for(let e,t,n=0;nnew Uint8Array(e),uS=e=>new Uint16Array(e),lS=e=>new Uint32Array(e);function cS(e,t,n){const r=(t<257?sS:t<65537?uS:lS)(e);return n&&r.set(n),r}function fS(e,t,n){const r=1<{const r=e[t],i=e[n];return ri?1:0})),function(e,t){return Array.from(t,(t=>e[t]))}(e,t)}(d,u),a)l=t,c=e,t=Array(a+s),e=lS(a+s),function(e,t,n,r,i,o,a,s,u){let l,c=0,f=0;for(l=0;c0)for(f=0;fe,size:()=>n}}function hS(e){Fa.call(this,function(){let e=8,t=[],n=lS(0),r=cS(0,e),i=cS(0,e);return{data:()=>t,seen:()=>n=function(e,t,n){return e.length>=t?e:((n=n||new e.constructor(t)).set(e),n)}(n,t.length),add(e){for(let n,r=0,i=t.length,o=e.length;rt.length,curr:()=>r,prev:()=>i,reset:e=>i[e]=r[e],all:()=>e<257?255:e<65537?65535:4294967295,set(e,t){r[e]|=t},clear(e,t){r[e]&=~t},resize(t,n){(t>r.length||n>e)&&(e=Math.max(n,e),r=cS(t,e,r),i=cS(t,e))}}}(),e),this._indices=null,this._dims=null}function pS(e){Fa.call(this,null,e)}hS.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]},De(hS,Fa,{transform(e,t){return this._dims?e.modified("fields")||e.fields.some((e=>t.modified(e.fields)))?this.reinit(e,t):this.eval(e,t):this.init(e,t)},init(e,t){const n=e.fields,r=e.query,i=this._indices={},o=this._dims=[],a=r.length;let s,u,l=0;for(;l{const e=i.remove(t,n);for(const t in r)r[t].reindex(e)}))},update(e,t,n){const r=this._dims,i=e.query,o=t.stamp,a=r.length;let s,u,l=0;for(n.filters=0,u=0;uh)for(m=h,y=Math.min(f,p);mp)for(m=Math.max(f,p),y=d;mc)for(h=c,p=Math.min(u,f);hf)for(h=Math.max(u,f),p=l;hs[e]&n?null:a[e];return o.filter(o.MOD,l),i&i-1?(o.filter(o.ADD,(e=>{const t=s[e]&n;return!t&&t^u[e]&n?a[e]:null})),o.filter(o.REM,(e=>!(s[e]&n)||u[e]&n?null:a[e]))):(o.filter(o.ADD,l),o.filter(o.REM,(e=>(s[e]&n)===i?a[e]:null))),o.filter(o.SOURCE,(e=>l(e._index)))}});const gS="Literal",mS="CallExpression";function yS(e){this.type=e}var vS,bS,xS,_S,wS;yS.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=function(e){switch(e.type){case"ArrayExpression":return e.elements;case"BinaryExpression":case"LogicalExpression":return[e.left,e.right];case mS:return[e.callee].concat(e.arguments);case"ConditionalExpression":return[e.test,e.consequent,e.alternate];case"MemberExpression":return[e.object,e.property];case"ObjectExpression":return e.properties;case"Property":return[e.key,e.value];case"UnaryExpression":return[e.argument];default:return[]}}(this),n=0,r=t.length;n",vS[ES]="Identifier",vS[OS]="Keyword",vS[DS]="Null",vS[CS]="Numeric",vS[SS]="Punctuator",vS[FS]="String",vS[9]="RegularExpression";var MS="ArrayExpression",jS="BinaryExpression",$S="CallExpression",NS="ConditionalExpression",BS="Identifier",TS="Literal",zS="LogicalExpression",RS="MemberExpression",PS="ObjectExpression",LS="Property",IS="UnaryExpression",US="Unexpected token %0",qS="Unexpected number",WS="Unexpected string",HS="Unexpected identifier",GS="Unexpected reserved word",VS="Unexpected end of input",YS="Invalid regular expression",XS="Invalid regular expression: missing /",ZS="Octal literals are not allowed in strict mode.",JS="Duplicate data property in object literal not allowed in strict mode",KS="ILLEGAL",QS="Disabled.",eF=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09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\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),tF=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA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\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function nF(e,t){if(!e)throw new Error("ASSERT: "+t)}function rF(e){return e>=48&&e<=57}function iF(e){return"0123456789abcdefABCDEF".includes(e)}function oF(e){return"01234567".includes(e)}function aF(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function sF(e){return 10===e||13===e||8232===e||8233===e}function uF(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&eF.test(String.fromCharCode(e))}function lF(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&tF.test(String.fromCharCode(e))}const cF={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function fF(){for(;xS<_S;){const e=bS.charCodeAt(xS);if(!aF(e)&&!sF(e))break;++xS}}function dF(e){var t,n,r,i=0;for(n="u"===e?4:2,t=0;t1114111||"}"!==e)&&OF({},US,KS),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),r=56320+(t-65536&1023),String.fromCharCode(n,r))}function pF(){var e,t;for(e=bS.charCodeAt(xS++),t=String.fromCharCode(e),92===e&&(117!==bS.charCodeAt(xS)&&OF({},US,KS),++xS,(e=dF("u"))&&"\\"!==e&&uF(e.charCodeAt(0))||OF({},US,KS),t=e);xS<_S&&lF(e=bS.charCodeAt(xS));)++xS,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==bS.charCodeAt(xS)&&OF({},US,KS),++xS,(e=dF("u"))&&"\\"!==e&&lF(e.charCodeAt(0))||OF({},US,KS),t+=e);return t}function gF(){var e,t,n,r,i=xS,o=bS.charCodeAt(xS),a=bS[xS];switch(o){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++xS,{type:SS,value:String.fromCharCode(o),start:i,end:xS};default:if(61===(e=bS.charCodeAt(xS+1)))switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return xS+=2,{type:SS,value:String.fromCharCode(o)+String.fromCharCode(e),start:i,end:xS};case 33:case 61:return xS+=2,61===bS.charCodeAt(xS)&&++xS,{type:SS,value:bS.slice(i,xS),start:i,end:xS}}}return">>>="===(r=bS.substr(xS,4))?{type:SS,value:r,start:i,end:xS+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:SS,value:n,start:i,end:xS+=3}:a===(t=n.substr(0,2))[1]&&"+-<>&|".includes(a)||"=>"===t?{type:SS,value:t,start:i,end:xS+=2}:("//"===t&&OF({},US,KS),"<>=!+-*%&|^/".includes(a)?(++xS,{type:SS,value:a,start:i,end:xS}):void OF({},US,KS))}function mF(){var e,t,n;if(nF(rF((n=bS[xS]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=xS,e="","."!==n){if(e=bS[xS++],n=bS[xS],"0"===e){if("x"===n||"X"===n)return++xS,function(e){let t="";for(;xS<_S&&iF(bS[xS]);)t+=bS[xS++];return 0===t.length&&OF({},US,KS),uF(bS.charCodeAt(xS))&&OF({},US,KS),{type:CS,value:parseInt("0x"+t,16),start:e,end:xS}}(t);if(oF(n))return function(e){let t="0"+bS[xS++];for(;xS<_S&&oF(bS[xS]);)t+=bS[xS++];return(uF(bS.charCodeAt(xS))||rF(bS.charCodeAt(xS)))&&OF({},US,KS),{type:CS,value:parseInt(t,8),octal:!0,start:e,end:xS}}(t);n&&rF(n.charCodeAt(0))&&OF({},US,KS)}for(;rF(bS.charCodeAt(xS));)e+=bS[xS++];n=bS[xS]}if("."===n){for(e+=bS[xS++];rF(bS.charCodeAt(xS));)e+=bS[xS++];n=bS[xS]}if("e"===n||"E"===n)if(e+=bS[xS++],"+"!==(n=bS[xS])&&"-"!==n||(e+=bS[xS++]),rF(bS.charCodeAt(xS)))for(;rF(bS.charCodeAt(xS));)e+=bS[xS++];else OF({},US,KS);return uF(bS.charCodeAt(xS))&&OF({},US,KS),{type:CS,value:parseFloat(e),start:t,end:xS}}function yF(){if(fF(),xS>=_S)return{type:AS,start:xS,end:xS};const e=bS.charCodeAt(xS);return uF(e)?function(){var e,t;return e=xS,t=92===bS.charCodeAt(xS)?pF():function(){var e,t;for(e=xS++;xS<_S;){if(92===(t=bS.charCodeAt(xS)))return xS=e,pF();if(!lF(t))break;++xS}return bS.slice(e,xS)}(),{type:1===t.length?ES:cF.hasOwnProperty(t)?OS:"null"===t?DS:"true"===t||"false"===t?kS:ES,value:t,start:e,end:xS}}():40===e||41===e||59===e?gF():39===e||34===e?function(){var e,t,n,r,i="",o=!1;for(nF("'"===(e=bS[xS])||'"'===e,"String literal must starts with a quote"),t=xS,++xS;xS<_S;){if((n=bS[xS++])===e){e="";break}if("\\"===n)if((n=bS[xS++])&&sF(n.charCodeAt(0)))"\r"===n&&"\n"===bS[xS]&&++xS;else switch(n){case"u":case"x":"{"===bS[xS]?(++xS,i+=hF()):i+=dF(n);break;case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;default:oF(n)?(0!==(r="01234567".indexOf(n))&&(o=!0),xS<_S&&oF(bS[xS])&&(o=!0,r=8*r+"01234567".indexOf(bS[xS++]),"0123".includes(n)&&xS<_S&&oF(bS[xS])&&(r=8*r+"01234567".indexOf(bS[xS++]))),i+=String.fromCharCode(r)):i+=n}else{if(sF(n.charCodeAt(0)))break;i+=n}}return""!==e&&OF({},US,KS),{type:FS,value:i,octal:o,start:t,end:xS}}():46===e?rF(bS.charCodeAt(xS+1))?mF():gF():rF(e)?mF():gF()}function vF(){const e=wS;return xS=e.end,wS=yF(),xS=e.end,e}function bF(){const e=xS;wS=yF(),xS=e}function xF(e,t,n){const r=new yS("||"===e||"&&"===e?zS:jS);return r.operator=e,r.left=t,r.right=n,r}function _F(e,t){const n=new yS($S);return n.callee=e,n.arguments=t,n}function wF(e){const t=new yS(BS);return t.name=e,t}function kF(e){const t=new yS(TS);return t.value=e.value,t.raw=bS.slice(e.start,e.end),e.regex&&("//"===t.raw&&(t.raw="/(?:)/"),t.regex=e.regex),t}function AF(e,t,n){const r=new yS(RS);return r.computed="["===e,r.object=t,r.property=n,r.computed||(n.member=!0),r}function EF(e,t,n){const r=new yS(LS);return r.key=t,r.value=n,r.kind=e,r}function OF(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,((e,t)=>(nF(t=0&&OF({},YS,n),{value:n,literal:t}}(),r=function(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((e,t)=>{if(parseInt(t,16)<=1114111)return"x";OF({},YS)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){OF({},YS)}try{return new RegExp(e,t)}catch(e){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:xS}}()),bF()):DF(vF())}return n}function BF(){const e=[];if(CF("("),!SF(")"))for(;xS<_S&&(e.push(IF()),!SF(")"));)CF(",");return CF(")"),e}function TF(){xS=wS.start;const e=vF();return function(e){return e.type===ES||e.type===OS||e.type===kS||e.type===DS}(e)||DF(e),wF(e.value)}function zF(){CF("[");const e=UF();return CF("]"),e}function RF(){const e=function(){var e;for(e=NF();;)if(SF("."))CF("."),e=AF(".",e,TF());else if(SF("("))e=_F(e,BF());else{if(!SF("["))break;e=AF("[",e,zF())}return e}();if(wS.type===SS&&(SF("++")||SF("--")))throw new Error(QS);return e}function PF(){var e,t;if(wS.type!==SS&&wS.type!==OS)t=RF();else{if(SF("++")||SF("--"))throw new Error(QS);if(SF("+")||SF("-")||SF("~")||SF("!"))e=vF(),t=PF(),t=function(e,t){const n=new yS(IS);return n.operator=e,n.argument=t,n.prefix=!0,n}(e.value,t);else{if(FF("delete")||FF("void")||FF("typeof"))throw new Error(QS);t=RF()}}return t}function LF(e){let t=0;if(e.type!==SS&&e.type!==OS)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function IF(){var e,t;return e=function(){var e,t,n,r,i,o,a,s,u,l;if(e=wS,u=PF(),0===(i=LF(r=wS)))return u;for(r.prec=i,vF(),t=[e,wS],o=[u,r,a=PF()];(i=LF(wS))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),t.pop(),n=xF(s,u,a),o.push(n);(r=vF()).prec=i,o.push(r),t.push(wS),n=PF(),o.push(n)}for(n=o[l=o.length-1],t.pop();l>1;)t.pop(),n=xF(o[l-1].value,o[l-2],n),l-=2;return n}(),SF("?")&&(vF(),t=IF(),CF(":"),e=function(e,t,n){const r=new yS(NS);return r.test=e,r.consequent=t,r.alternate=n,r}(e,t,IF())),e}function UF(){const e=IF();if(SF(","))throw new Error(QS);return e}function qF(e){xS=0,_S=(bS=e).length,wS=null,bF();const t=UF();if(wS.type!==AS)throw new Error("Unexpect token after expression.");return t}var WF={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function HF(e){function t(t,n,r){return i=>function(t,n,r,i){let o=e(n[0]);return r&&(o=r+"("+o+")",0===r.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+t+(i<0?"":0===i?"()":"("+n.slice(1).map(e).join(",")+")")}(t,i,n,r)}const n="new Date",r="String",i="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(t){t.length<3&&_("Missing arguments to clamp function."),t.length>3&&_("Too many arguments to clamp function.");const n=t.map(e);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:t("getDate",n,0),day:t("getDay",n,0),year:t("getFullYear",n,0),month:t("getMonth",n,0),hours:t("getHours",n,0),minutes:t("getMinutes",n,0),seconds:t("getSeconds",n,0),milliseconds:t("getMilliseconds",n,0),time:t("getTime",n,0),timezoneoffset:t("getTimezoneOffset",n,0),utcdate:t("getUTCDate",n,0),utcday:t("getUTCDay",n,0),utcyear:t("getUTCFullYear",n,0),utcmonth:t("getUTCMonth",n,0),utchours:t("getUTCHours",n,0),utcminutes:t("getUTCMinutes",n,0),utcseconds:t("getUTCSeconds",n,0),utcmilliseconds:t("getUTCMilliseconds",n,0),length:t("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase",r,0),lower:t("toLowerCase",r,0),substring:t("substring",r),split:t("split",r),trim:t("trim",r,0),regexp:i,test:t("test",i),if:function(t){t.length<3&&_("Missing arguments to if function."),t.length>3&&_("Too many arguments to if function.");const n=t.map(e);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function GF(e){const t=(e=e||{}).allowed?Ye(e.allowed):{},n=e.forbidden?Ye(e.forbidden):{},r=e.constants||WF,i=(e.functions||HF)(f),o=e.globalvar,a=e.fieldvar,s=ce(o)?o:e=>`${o}["${e}"]`;let u={},l={},c=0;function f(e){if(Ne(e))return e;const t=d[e.type];return null==t&&_("Unsupported type: "+e.type),t(e)}const d={Literal:e=>e.raw,Identifier:e=>{const i=e.name;return c>0?i:ke(n,i)?_("Illegal identifier: "+i):ke(r,i)?r[i]:ke(t,i)?i:(u[i]=1,s(i))},MemberExpression:e=>{const t=!e.computed,n=f(e.object);t&&(c+=1);const r=f(e.property);return n===a&&(l[function(e){const t=e&&e.length-1;return t&&('"'===e[0]&&'"'===e[t]||"'"===e[0]&&"'"===e[t])?e.slice(1,-1):e}(r)]=1),t&&(c-=1),n+(t?"."+r:"["+r+"]")},CallExpression:e=>{"Identifier"!==e.callee.type&&_("Illegal callee type: "+e.callee.type);const t=e.callee.name,n=e.arguments,r=ke(i,t)&&i[t];return r||_("Unrecognized function: "+t),ce(r)?r(n):r+"("+n.map(f).join(",")+")"},ArrayExpression:e=>"["+e.elements.map(f).join(",")+"]",BinaryExpression:e=>"("+f(e.left)+" "+e.operator+" "+f(e.right)+")",UnaryExpression:e=>"("+e.operator+f(e.argument)+")",ConditionalExpression:e=>"("+f(e.test)+"?"+f(e.consequent)+":"+f(e.alternate)+")",LogicalExpression:e=>"("+f(e.left)+e.operator+f(e.right)+")",ObjectExpression:e=>"{"+e.properties.map(f).join(",")+"}",Property:e=>{c+=1;const t=f(e.key);return c-=1,t+":"+f(e.value)}};function h(e){const t={code:f(e),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},t}return h.functions=i,h.constants=r,h}var VF,YF,XF,ZF,JF,KF,QF,eM,tM,nM,rM,iM,oM,aM,sM,uM,lM=new V_,cM=new V_,fM={point:yw,lineStart:yw,lineEnd:yw,polygonStart:function(){lM=new V_,fM.lineStart=dM,fM.lineEnd=hM},polygonEnd:function(){var e=+lM;cM.add(e<0?Q_+e:e),this.lineStart=this.lineEnd=this.point=yw},sphere:function(){cM.add(Q_)}};function dM(){fM.point=pM}function hM(){gM(VF,YF)}function pM(e,t){fM.point=gM,VF=e,YF=t,XF=e*=tw,ZF=ow(t=(t*=tw)/2+K_),JF=fw(t)}function gM(e,t){var n=(e*=tw)-XF,r=n>=0?1:-1,i=r*n,o=ow(t=(t*=tw)/2+K_),a=fw(t),s=JF*a,u=ZF*o+s*ow(i),l=s*r*fw(i);lM.add(iw(l,u)),XF=e,ZF=o,JF=a}var mM,yM,vM,bM,xM,_M,wM,kM,AM,EM,OM,DM,CM,SM,FM,MM,jM={point:$M,lineStart:BM,lineEnd:TM,polygonStart:function(){jM.point=zM,jM.lineStart=RM,jM.lineEnd=PM,aM=new V_,fM.polygonStart()},polygonEnd:function(){fM.polygonEnd(),jM.point=$M,jM.lineStart=BM,jM.lineEnd=TM,lM<0?(KF=-(eM=180),QF=-(tM=90)):aM>Y_?tM=90:aM<-Y_&&(QF=-90),uM[0]=KF,uM[1]=eM},sphere:function(){KF=-(eM=180),QF=-(tM=90)}};function $M(e,t){sM.push(uM=[KF=e,eM=e]),ttM&&(tM=t)}function NM(e,t){var n=Fk([e*tw,t*tw]);if(oM){var r=jk(oM,n),i=jk([r[1],-r[0],0],r);Bk(i),i=Sk(i);var o,a=e-nM,s=a>0?1:-1,u=i[0]*ew*s,l=nw(a)>180;l^(s*nMtM&&(tM=o):l^(s*nM<(u=(u+360)%360-180)&&utM&&(tM=t)),l?eLM(KF,eM)&&(eM=e):LM(e,eM)>LM(KF,eM)&&(KF=e):eM>=KF?(eeM&&(eM=e)):e>nM?LM(KF,e)>LM(KF,eM)&&(eM=e):LM(e,eM)>LM(KF,eM)&&(KF=e)}else sM.push(uM=[KF=e,eM=e]);ttM&&(tM=t),oM=n,nM=e}function BM(){jM.point=NM}function TM(){uM[0]=KF,uM[1]=eM,jM.point=$M,oM=null}function zM(e,t){if(oM){var n=e-nM;aM.add(nw(n)>180?n+(n>0?360:-360):n)}else rM=e,iM=t;fM.point(e,t),NM(e,t)}function RM(){fM.lineStart()}function PM(){zM(rM,iM),fM.lineEnd(),nw(aM)>Y_&&(KF=-(eM=180)),uM[0]=KF,uM[1]=eM,oM=null}function LM(e,t){return(t-=e)<0?t+360:t}function IM(e,t){return e[0]-t[0]}function UM(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tt?1:e>=t?0:NaN}function tj(e,t){return null==e||null==t?NaN:te?1:t>=e?0:NaN}function nj(){return 0}function rj(e){return e instanceof Sd?e:new Sd(e)}const ij=Symbol("vega_selection_getter");function oj(e){return e.getter&&e.getter[ij]||(e.getter=k(e.field),e.getter[ij]=!0),e.getter}const aj="intersect",sj="union",uj="or",lj="and",cj="_vgsid_",fj=k(cj),dj="index:unit";function hj(e,t){for(var n,r,i=t.fields,o=t.values,a=i.length,s=0;s>>1;n(e[t],r)<0?i=t+1:o=t}while(iej(e(t),n),r=(t,n)=>e(t)-n):(t=e===ej||e===tj?e:nj,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i>>1;n(e[t],r)<=0?i=t+1:o=t}while(it.indexOf(e)>=0)):t},R_union:function(e,t){var n=W(t[0]),r=W(t[1]);return n>r&&(n=t[1],r=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]r&&(n=t[1],r=t[0]),e.length?rr&&(e[1]=r),e):[n,r]}};function vj(e,t,n,r){t[0].type!==gS&&_("First argument to selection functions must be a string literal.");const i=t[0].value,o="unit",a="@"+o,s=":"+i;(t.length>=2&&q(t).value)!==aj||ke(r,a)||(r[a]=n.getData(i).indataRef(n,o)),ke(r,s)||(r[s]=n.getData(i).tuplesRef())}function bj(e){const t=this.context.data[e];return t?t.values.value:[]}const xj=e=>function(t,n){const r=this.context.dataflow.locale();return null===t?"null":r[e](n)(t)},_j=xj("format"),wj=xj("timeFormat"),kj=xj("utcFormat"),Aj=xj("timeParse"),Ej=xj("utcParse"),Oj=new Date(2e3,0,1);function Dj(e,t,n){return Number.isInteger(e)&&Number.isInteger(t)?(Oj.setYear(2e3),Oj.setMonth(e),Oj.setDate(t),wj.call(this,Oj,n)):""}const Cj="%",Sj="$";function Fj(e,t,n,r){t[0].type!==gS&&_("First argument to data functions must be a string literal.");const i=t[0].value,o=":"+i;if(!ke(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(e){}}function Mj(e,t,n,r){if(t[0].type===gS)jj(n,r,t[0].value);else for(e in n.scales)jj(n,r,e)}function jj(e,t,n){const r=Cj+n;if(!ke(t,r))try{t[r]=e.scaleRef(n)}catch(e){}}function $j(e,t){if(ce(e))return e;if(Ne(e)){const r=t.scales[e];return r&&((n=r.value)&&!0===n[yp])?r.value:void 0}var n}function Nj(e,t){return function(n,r,i){if(n){const t=$j(n,(i||this).context);return t&&t.path[e](r)}return t(r)}}const Bj=Nj("area",(function(e){return cM=new V_,G_(e,fM),2*cM})),Tj=Nj("bounds",(function(e){var t,n,r,i,o,a,s;if(tM=eM=-(KF=QF=1/0),sM=[],G_(e,jM),n=sM.length){for(sM.sort(IM),t=1,o=[r=sM[0]];tLM(r[0],r[1])&&(r[1]=i[1]),LM(i[0],r[1])>LM(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,t=0,r=o[n=o.length-1];t<=n;r=i,++t)i=o[t],(s=LM(r[1],i[0]))>a&&(a=s,KF=i[0],eM=r[1])}return sM=uM=null,KF===1/0||QF===1/0?[[NaN,NaN],[NaN,NaN]]:[[KF,QF],[eM,tM]]})),zj=Nj("centroid",(function(e){mM=yM=vM=bM=xM=_M=wM=kM=0,AM=new V_,EM=new V_,OM=new V_,G_(e,qM);var t=+AM,n=+EM,r=+OM,i=uw(t,n,r);return iUj(e,t)}const Wj={};function Hj(e){return z(e)||ArrayBuffer.isView(e)?e:null}function Gj(e){return Hj(e)||(Ne(e)?e:null)}const Vj=e=>e.data;function Yj(e,t){const n=bj.call(t,e);return n.root&&n.root.lookup||{}}const Xj=()=>"undefined"!=typeof window&&window||null;function Zj(e,t,n){if(!e)return[];const[r,i]=e,o=(new am).set(r[0],r[1],i[0],i[1]);return Gb(n||this.context.dataflow.scenegraph().root,o,function(e){let t=null;if(e){const n=ue(e.marktype),r=ue(e.markname);t=e=>(!n.length||n.some((t=>e.marktype===t)))&&(!r.length||r.some((t=>e.name===t)))}return t}(t))}const Jj={random:()=>Ya(),cumulativeNormal:os,cumulativeLogNormal:fs,cumulativeUniform:ys,densityNormal:is,densityLogNormal:cs,densityUniform:ms,quantileNormal:as,quantileLogNormal:ds,quantileUniform:vs,sampleNormal:rs,sampleLogNormal:ls,sampleUniform:gs,isArray:z,isBoolean:Se,isDate:Fe,isDefined:e=>void 0!==e,isNumber:je,isObject:R,isRegExp:$e,isString:Ne,isTuple:Jo,isValid:e=>null!=e&&e==e,toBoolean:We,toDate:e=>Ge(e),toNumber:W,toString:Ve,indexof:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;rxe(e),inScope:function(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n},intersect:Zj,clampRange:le,pinchDistance:function(e){const t=e.touches,n=t[0].clientX-t[1].clientX,r=t[0].clientY-t[1].clientY;return Math.hypot(n,r)},pinchAngle:function(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)},screen:function(){const e=Xj();return e?e.screen:{}},containerSize:function(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]},windowSize:function(){const e=Xj();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]},bandspace:function(e,t,n){return Wh(e||0,t||0,n||0)},setdata:function(e,t){const n=this.context.dataflow,r=this.context.data[e].input;return n.pulse(r,n.changeset().remove(C).insert(t)),1},pathShape:function(e){let t=null;return function(n){return n?Sg(n,t=t||vg(e)):e}},panLinear:J,panLog:K,panPow:Q,panSymlog:ee,zoomLinear:ne,zoomLog:re,zoomPow:ie,zoomSymlog:oe,encode:function(e,t,n){if(e){const n=this.context.dataflow,r=e.mark.source;n.pulse(r,n.changeset().encode(e,t))}return void 0!==n?n:e},modify:function(e,t,n,r,i,o){const a=this.context.dataflow,s=this.context.data[e],u=s.input,l=a.stamp();let c,f,d=s.changes;if(!1===a._trigger||!(u.value.length||t||r))return 0;if((!d||d.stamp{s.modified=!0,a.pulse(u,d).run()}),!0,1)),n&&(c=!0===n?C:z(n)||Jo(n)?n:qj(n),d.remove(c)),t&&d.insert(t),r&&(c=qj(r),u.value.some(c)?d.remove(c):d.insert(r)),i)for(f in o)d.modify(i,f,o[f]);return 1},lassoAppend:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;const i=(e=ue(e))[e.length-1];return void 0===i||Math.hypot(i[0]-t,i[1]-n)>r?[...e,[t,n]]:e},lassoPath:function(e){return ue(e).reduce(((t,n,r)=>{let[i,o]=n;return t+(0==r?`M ${i},${o} `:r===e.length-1?" Z":`L ${i},${o} `)}),"")},intersectLasso:function(e,t,n){const{x:r,y:i,mark:o}=n,a=(new am).set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[e,n]of t)ea.x2&&(a.x2=e),na.y2&&(a.y2=n);return a.translate(r,i),Zj([[a.x1,a.y1],[a.x2,a.y2]],e,o).filter((e=>function(e,t,n){let r=0;for(let i=0,o=n.length-1;it!=s>t&&e<(a-u)*(t-l)/(s-l)+u&&r++}return 1&r}(e.x,e.y,t)))}},Kj=["view","item","group","xy","x","y"],Qj="this.",e$={},t$={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${qe(Sj+e)}]`,functions:function(e){const t=HF(e);Kj.forEach((e=>t[e]="event.vega."+e));for(const e in Jj)t[e]=Qj+e;return be(t,function(e,t,n){t.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0,n._bandwidth=Mj,n._range=Mj,n._scale=Mj;const r=t=>"_["+(t.type===gS?qe(Cj+t.value):qe(Cj)+"+"+e(t))+"]";return{_bandwidth:e=>`this.__bandwidth(${r(e[0])})`,_range:e=>`${r(e[0])}.range()`,_scale:t=>`${r(t[0])}(${e(t[1])})`}}(e,Jj,e$)),t},constants:WF,visitors:e$},n$=GF(t$);function r$(e,t,n){return 1===arguments.length?Jj[e]:(Jj[e]=t,n&&(e$[e]=n),n$&&(n$.functions[e]=Qj+e),this)}function i$(e,t){const n={};let r;try{r=qF(e=Ne(e)?e:qe(e)+"")}catch(t){_("Expression parse error: "+e)}r.visit((e=>{if(e.type!==mS)return;const r=e.callee.name,i=t$.visitors[r];i&&i(r,e.arguments,t,n)}));const i=n$(r);return i.globals.forEach((e=>{const r=Sj+e;!ke(n,r)&&t.getSignal(e)&&(n[r]=t.signalRef(e))})),{$expr:be({code:i.code},t.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}r$("bandwidth",(function(e,t){const n=$j(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}),Mj),r$("copy",(function(e,t){const n=$j(e,(t||this).context);return n?n.copy():void 0}),Mj),r$("domain",(function(e,t){const n=$j(e,(t||this).context);return n?n.domain():[]}),Mj),r$("range",(function(e,t){const n=$j(e,(t||this).context);return n&&n.range?n.range():[]}),Mj),r$("invert",(function(e,t,n){const r=$j(e,(n||this).context);return r?z(t)?(r.invertRange||r.invert)(t):(r.invert||r.invertExtent)(t):void 0}),Mj),r$("scale",(function(e,t,n){const r=$j(e,(n||this).context);return r?r(t):void 0}),Mj),r$("gradient",(function(e,t,n,r,i){e=$j(e,(i||this).context);const o=cg(t,n);let a=e.domain(),s=a[0],u=q(a),l=E;return u-s?l=jp(e,s,u):e=(e.interpolator?bp("sequential")().interpolator(e.interpolator()):bp("linear")().interpolate(e.interpolate()).range(e.range())).domain([s=0,u=1]),e.ticks&&(a=e.ticks(+r||15),s!==a[0]&&a.unshift(s),u!==q(a)&&a.push(u)),a.forEach((t=>o.stop(l(t),e(t)))),o}),Mj),r$("geoArea",Bj,Mj),r$("geoBounds",Tj,Mj),r$("geoCentroid",zj,Mj),r$("geoShape",(function(e,t,n){const r=$j(e,(n||this).context);return function(e){return r?r.path.context(e)(t):""}}),Mj),r$("geoScale",(function(e,t){const n=$j(e,(t||this).context);return n&&n.scale()}),Mj),r$("indata",(function(e,t,n){const r=this.context.data[e]["index:"+t],i=r?r.value.get(n):void 0;return i?i.count:i}),(function(e,t,n,r){t[0].type!==gS&&_("First argument to indata must be a string literal."),t[1].type!==gS&&_("Second argument to indata must be a string literal.");const i=t[0].value,o=t[1].value,a="@"+o;ke(a,r)||(r[a]=n.getData(i).indataRef(n,o))})),r$("data",bj,Fj),r$("treePath",(function(e,t,n){const r=Yj(e,this),i=r[t],o=r[n];return i&&o?i.path(o).map(Vj):void 0}),Fj),r$("treeAncestors",(function(e,t){const n=Yj(e,this)[t];return n?n.ancestors().map(Vj):void 0}),Fj),r$("vlSelectionTest",(function(e,t,n){for(var r,i,o,a,s,u=this.context.data[e],l=u?u.values.value:[],c=u?u[dj]&&u[dj].value:void 0,f=n===aj,d=l.length,h=0;h(e[o[n].field]=t,e)),{}))}else u=cj,l=fj(i),(f=(c=v[u]||(v[u]={}))[s]||(c[s]=[])).push(l),n&&(f=b[s]||(b[s]=[])).push({[cj]:l});return t=t||sj,v[cj]?v[cj]=yj[`${cj}_${t}`](...Object.values(v[cj])):Object.keys(v).forEach((e=>{v[e]=Object.keys(v[e]).map((t=>v[e][t])).reduce(((n,r)=>void 0===n?r:yj[`${x[e]}_${t}`](n,r)))})),y=Object.keys(b),n&&y.length&&(v[r?"vlPoint":"vlMulti"]=t===sj?{[uj]:y.reduce(((e,t)=>(e.push(...b[t]),e)),[])}:{[lj]:y.map((e=>({[uj]:b[e]})))}),v}),vj),r$("vlSelectionTuples",(function(e,t){return e.map((e=>be(t.fields?{values:t.fields.map((t=>oj(t)(e.datum)))}:{[cj]:fj(e.datum)},t)))}));const o$=Ye(["rule"]),a$=Ye(["group","image","rect"]);function s$(e){return(e+"").toLowerCase()}function u$(e,t,n){n.endsWith(";")||(n="return("+n+");");const r=Function(...t.concat(n));return e&&e.functions?r.bind(e.functions):r}var l$={operator:(e,t)=>u$(e,["_"],t.code),parameter:(e,t)=>u$(e,["datum","_"],t.code),event:(e,t)=>u$(e,["event"],t.code),handler:(e,t)=>u$(e,["_","event"],`var datum=event.item&&event.item.datum;return ${t.code};`),encode:(e,t)=>{const{marktype:n,channels:r}=t;let i="var o=item,datum=o.datum,m=0,$;";for(const e in r){const t="o["+qe(e)+"]";i+=`$=${r[e].code};if(${t}!==$)${t}=$,m=1;`}return i+=function(e,t){let n="";return o$[t]||(e.x2&&(e.x?(a$[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(a$[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(r,n),i+="return m;",u$(e,["item","_"],i)},codegen:{get(e){const t=`[${e.map(qe).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const r=Function("a","b","var u, v; return "+e.map(((e,r)=>{const i=t[r];let o,a;return e.path?(o=`a${e.path}`,a=`b${e.path}`):((n=n||{})["f"+r]=e,o=`this.f${r}(a)`,a=`this.f${r}(b)`),function(e,t,n,r){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}\n : (u > v || v == null) && u != null ? ${r}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}\n : v !== v && u === u ? ${r} : `}(o,a,-i,i)})).join("")+"0;");return n?r.bind(n):r}}};function c$(e,t,n){if(!e||!R(e))return e;for(let r,i=0,o=f$.length;ie&&e.$tupleid?Ko:e));return t.fn[n]||(t.fn[n]=de(r,e.$order,t.expr.codegen))}},{key:"$context",parse:function(e,t){return t}},{key:"$subflow",parse:function(e,t){const n=e.$subflow;return function(e,r,i){const o=t.fork().parse(n),a=o.get(n.operators[0].id),s=o.signals.parent;return s&&s.set(i),a.detachSubflow=()=>t.detach(o),a}}},{key:"$tupleid",parse:function(){return Ko}}];const d$={skip:!0};function h$(e,t,n,r){return new p$(e,t,n,r)}function p$(e,t,n,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=r||l$,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function g$(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}function m$(e,t){e&&(null==t?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}p$.prototype=g$.prototype={fork(){const e=new g$(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter((t=>t!==e));const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,r=n.dataflow,i=e.value;if(n.set(e.id,t),"collect"===s$(e.type)&&i&&(i.$ingest?r.ingest(t,i.$ingest,i.$format):i.$request?r.preload(t,i.$request,i.$format):r.pulse(t,r.changeset().insert(i))),e.root&&(n.root=t),e.parent){let i=n.get(e.parent.$ref);i?(r.connect(i,[t]),t.targets().add(i)):(n.unresolved=n.unresolved||[]).push((()=>{i=n.get(e.parent.$ref),r.connect(i,[t]),t.targets().add(i)}))}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const r in e.data){const i=n.data[r]||(n.data[r]={});e.data[r].forEach((e=>i[e]=t))}},resolve(){return(this.unresolved||[]).forEach((e=>e())),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[s$(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,r,i){this.dataflow.on(t,n,r,i,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:function(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach((e=>t.parseOperator(e))),n.forEach((e=>t.parseOperatorParameters(e))),(e.streams||[]).forEach((e=>t.parseStream(e))),(e.updates||[]).forEach((e=>t.parseUpdate(e))),t.resolve()},parseOperator:function(e){const t=this;"operator"!==s$(e.type)&&e.type?t.transform(e,e.type):t.operator(e,e.update?t.operatorExpression(e.update):null)},parseOperatorParameters:function(e){const t=this;if(e.params){const n=t.get(e.id);n||_("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}},parseParameters:function(e,t){t=t||{};const n=this;for(const r in e){const i=e[r];t[r]=z(i)?i.map((e=>c$(e,n,t))):c$(i,n,t)}return t},parseStream:function(e){var t,n=this,r=null!=e.filter?n.eventExpression(e.filter):void 0,i=null!=e.stream?n.get(e.stream):void 0;e.source?i=n.events(e.source,e.type,r):e.merge&&(i=(t=e.merge.map((e=>n.get(e))))[0].merge.apply(t[0],t.slice(1))),e.between&&(t=e.between.map((e=>n.get(e))),i=i.between(t[0],t[1])),e.filter&&(i=i.filter(r)),null!=e.throttle&&(i=i.throttle(+e.throttle)),null!=e.debounce&&(i=i.debounce(+e.debounce)),null==i&&_("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),n.stream(e,i)},parseUpdate:function(e){var t,n=this,r=R(r=e.source)?r.$ref:r,i=n.get(r),o=e.update,a=void 0;i||_("Source not defined: "+e.source),t=e.target&&e.target.$expr?n.eventExpression(e.target.$expr):n.get(e.target),o&&o.$expr&&(o.$params&&(a=n.parseParameters(o.$params)),o=n.handlerExpression(o.$expr)),n.update(e,i,t,o,a)},getState:function(e){var t=this,n={};if(e.signals){var r=n.signals={};Object.keys(t.signals).forEach((n=>{const i=t.signals[n];e.signals(n,i)&&(r[n]=i.value)}))}if(e.data){var i=n.data={};Object.keys(t.data).forEach((n=>{const r=t.data[n];e.data(n,r)&&(i[n]=r.input.value)}))}return t.subcontext&&!1!==e.recurse&&(n.subcontext=t.subcontext.map((t=>t.getState(e)))),n},setState:function(e){var t=this,n=t.dataflow,r=e.data,i=e.signals;Object.keys(i||{}).forEach((e=>{n.update(t.signals[e],i[e],d$)})),Object.keys(r||{}).forEach((e=>{n.pulse(t.data[e].input,n.changeset().remove(C).insert(r[e]))})),(e.subcontext||[]).forEach(((e,n)=>{const r=t.subcontext[n];r&&r.setState(e)}))}};const y$="default";function v$(e,t){const n=e.globalCursor()?"undefined"!=typeof document&&document.body:e.container();if(n)return null==t?n.style.removeProperty("cursor"):n.style.cursor=t}function b$(e,t){var n=e._runtime.data;return ke(n,t)||_("Unrecognized data set: "+t),n[t]}function x$(e,t){oa(t)||_("Second argument to changes must be a changeset.");const n=b$(this,e);return n.modified=!0,this.pulse(n.input,t)}function _$(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function w$(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function k$(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}const A$="view",E$={trap:!1};function O$(e,t,n,r){e._eventListeners.push({type:n,sources:ue(t),handler:r})}function D$(e,t,n){const r=e._eventConfig&&e._eventConfig[t];return!(!1===r||R(r)&&!r[n])||(e.warn(`Blocked ${t} ${n} event listener.`),!1)}function C$(e){return e.item}function S$(e){return e.item.mark.source}function F$(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function M$(e,t,n){const r=document.createElement(e);for(const e in t)r.setAttribute(e,t[e]);return null!=n&&(r.textContent=n),r}const j$="vega-bind-radio";function $$(e,t,n,r){const i=n.event||"input",o=()=>e.update(t.value);r.signal(n.signal,t.value),t.addEventListener(i,o),O$(r,t,i,o),e.set=e=>{t.value=e,t.dispatchEvent(function(e){return"undefined"!=typeof Event?new Event(e):{type:e}}(i))}}function N$(e,t,n,r){const i=r.signal(n.signal),o=M$("div",{class:"vega-bind"}),a="radio"===n.input?o:o.appendChild(M$("label"));a.appendChild(M$("span",{class:"vega-bind-name"},n.name||n.signal)),t.appendChild(o);let s=B$;switch(n.input){case"checkbox":s=T$;break;case"select":s=z$;break;case"radio":s=R$;break;case"range":s=P$}s(e,a,n,i)}function B$(e,t,n,r){const i=M$("input");for(const e in n)"signal"!==e&&"element"!==e&&i.setAttribute("input"===e?"type":e,n[e]);i.setAttribute("name",n.signal),i.value=r,t.appendChild(i),i.addEventListener("input",(()=>e.update(i.value))),e.elements=[i],e.set=e=>i.value=e}function T$(e,t,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=M$("input",i);t.appendChild(o),o.addEventListener("change",(()=>e.update(o.checked))),e.elements=[o],e.set=e=>o.checked=!!e||null}function z$(e,t,n,r){const i=M$("select",{name:n.signal}),o=n.labels||[];n.options.forEach(((e,t)=>{const n={value:e};L$(e,r)&&(n.selected=!0),i.appendChild(M$("option",n,(o[t]||e)+""))})),t.appendChild(i),i.addEventListener("change",(()=>{e.update(n.options[i.selectedIndex])})),e.elements=[i],e.set=e=>{for(let t=0,r=n.options.length;t{const s={type:"radio",name:n.signal,value:t};L$(t,r)&&(s.checked=!0);const u=M$("input",s);u.addEventListener("change",(()=>e.update(t)));const l=M$("label",{},(o[a]||t)+"");return l.prepend(u),i.appendChild(l),u})),e.set=t=>{const n=e.elements,r=n.length;for(let e=0;e{u.textContent=s.value,e.update(+s.value)};s.addEventListener("input",l),s.addEventListener("change",l),e.elements=[s],e.set=e=>{s.value=e,u.textContent=e}}function L$(e,t){return e===t||e+""==t+""}function I$(e,t,n,r,i,o){return(t=t||new r(e.loader())).initialize(n,_$(e),w$(e),k$(e),i,o).background(e.background())}function U$(e,t){return t?function(){try{t.apply(this,arguments)}catch(t){e.error(t)}}:null}function q$(e,t,n){if("string"==typeof t){if("undefined"==typeof document)return e.error("DOM document instance not found."),null;if(!(t=document.querySelector(t)))return e.error("Signal bind element not found: "+t),null}if(t&&n)try{t.textContent=""}catch(n){t=null,e.error(n)}return t}const W$=e=>+e||0;function H$(e){return R(e)?{top:W$(e.top),bottom:W$(e.bottom),left:W$(e.left),right:W$(e.right)}:(e=>({top:e,bottom:e,left:e,right:e}))(W$(e))}async function G$(e,t,n,r){const i=Hb(t),o=i&&i.headless;return o||_("Unrecognized renderer type: "+t),await e.runAsync(),I$(e,null,null,o,n,r).renderAsync(e._scenegraph.root)}var V$="width",Y$="height",X$="padding",Z$={skip:!0};function J$(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===X$?r.left+r.right:0)}function K$(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===X$?r.top+r.bottom:0)}function Q$(e,t){return t.modified&&z(t.input.value)&&!e.startsWith("_:vega:_")}function eN(e,t){return!("parent"===e||t instanceof Ma.proxy)}function tN(e,t,n,r){const i=e.element();i&&i.setAttribute("title",function(e){return null==e?"":z(e)?nN(e):R(e)&&!Fe(e)?(t=e,Object.keys(t).map((e=>{const n=t[e];return e+": "+(z(n)?nN(n):rN(n))})).join("\n")):e+"";var t}(r))}function nN(e){return"["+e.map(rN).join(", ")+"]"}function rN(e){return z(e)?"[…]":R(e)&&!Fe(e)?"{…}":e}function iN(e,t){const n=this;if(t=t||{},Ca.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),null!=t.logLevel&&n.logLevel(t.logLevel),t.locale||e.locale){const r=be({},e.locale,t.locale);n.locale(yo(r.number,r.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||qb.Canvas,n._scenegraph=new fv;const r=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||tN,n._redraw=!0,n._handler=(new Uv).scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(e){const t=be({defaults:{}},e),n=(e,t)=>{t.forEach((t=>{z(e[t])&&(e[t]=Ye(e[t]))}))};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=function(e,t,n){return h$(e,Ma,Jj,n).parse(t)}(n,e,t.expr);n._runtime=i,n._signals=i.signals,n._bind=(e.bindings||[]).map((e=>({state:null,param:be({},e)}))),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=J$(n,n._width),n._viewHeight=K$(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(e){var t=e._signals,n=t[V$],r=t[Y$],i=t[X$];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,(t=>{e._width=t.size,e._viewWidth=J$(e,t.size),o()}),{size:n}),e._resizeHeight=e.add(null,(t=>{e._height=t.size,e._viewHeight=K$(e,t.size),o()}),{size:r});const a=e.add(null,o,{pad:i});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=r.rank+1,a.rank=i.rank+1}(n),function(e){e.add(null,(t=>(e._background=t.bg,e._resize=1,t.bg)),{bg:e._signals.background})}(n),function(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:y$,item:null}));e.on(e.events("view","pointermove"),t,((e,n)=>{const r=t.value,i=r?Ne(r)?r:r.user:y$,o=n.item&&n.item.cursor||null;return r&&i===r.user&&o==r.item?r:{user:i,item:o}})),e.add(null,(function(t){let n=t.cursor,r=this.value;return Ne(n)||(r=n.item,n=n.user),v$(e,n&&n!==y$?n:r||n),r}),{cursor:t})}(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function oN(e,t){return ke(e._signals,t)?e._signals[t]:_("Unrecognized signal name: "+qe(t))}function aN(e,t){const n=(e._targets||[]).filter((e=>e._update&&e._update.handler===t));return n.length?n[0]:null}function sN(e,t,n,r){let i=aN(n,r);return i||(i=U$(e,(()=>r(t,n.value))),i.handler=r,e.on(n,null,i)),e}function uN(e,t,n){const r=aN(t,n);return r&&t._targets.remove(r),e}De(iN,Ca,{async evaluate(e,t,n){if(await Ca.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,i=k$(r=this),o=_$(r),a=w$(r),r._renderer.background(r.background()),r._renderer.resize(o,a,i),r._handler.origin(i),r._resizeListeners.forEach((e=>{try{e(o,a)}catch(e){r.error(e)}}))),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(e){this.error(e)}var r,i,o,a;return n&&Yo(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=null!=e?e+"":null;return t!==this._desc&&m$(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const r=oN(this,e);return 1===arguments.length?r.value:this.update(r,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",H$(e)):H$(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(Hb(e)||_("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(Ca.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(oN(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function(e,t,n,r,i,o){this.runAfter((a=>{let s=0;a._autosize=0,a.width()!==n&&(s=1,a.signal(V$,n,Z$),a._resizeWidth.skip(!0)),a.height()!==r&&(s=1,a.signal(Y$,r,Z$),a._resizeHeight.skip(!0)),a._viewWidth!==e&&(a._resize=1,a._viewWidth=e),a._viewHeight!==t&&(a._resize=1,a._viewHeight=t),a._origin[0]===i[0]&&a._origin[1]===i[1]||(a._resize=1,a._origin=i),s&&a.run("enter"),o&&a.runAfter((e=>e.resize()))}),!1,1)},addEventListener(e,t,n){let r=t;return n&&!1===n.trap||(r=U$(this,t),r.raw=t),this._handler.on(e,r),this},removeEventListener(e,t){for(var n,r,i=this._handler.handlers(e),o=i.length;--o>=0;)if(r=i[o].type,n=i[o].handler,e===r&&(t===n||t===n.raw)){this._handler.off(r,n);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.includes(e)||t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return sN(this,e,oN(this,e),t)},removeSignalListener(e,t){return uN(this,oN(this,e),t)},addDataListener(e,t){return sN(this,e,b$(this,e).values,t)},removeDataListener(e,t){return uN(this,b$(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=v$(this,null);this._globalCursor=!!e,t&&v$(this,t)}return this}return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:function(e,t){this._timers.push(function(e,t,n){var r=new sO,i=t;return null==t?(r.restart(e,t,n),r):(r._restart=r.restart,r.restart=function(e,t,n){t=+t,n=null==n?oO():+n,r._restart((function o(a){a+=i,r._restart(o,i+=t,n),e(a)}),t,n)},r.restart(e,t,n),r)}((function(t){e({timestamp:Date.now(),elapsed:t})}),t))},events:function(e,t,n){var r,i=this,o=new pa(n),a=function(n,r){i.runAsync(null,(()=>{e===A$&&function(e,t){var n=e._eventConfig.defaults,r=n.prevent,i=n.allow;return!1!==r&&!0!==i&&(!0===r||!1===i||(r?r[t]:i?!i[t]:e.preventDefault()))}(i,t)&&n.preventDefault(),o.receive(function(e,t,n){var r,i,o=e._renderer,a=o&&o.canvas();return a&&(i=k$(e),(r=vv(t.changedTouches?t.changedTouches[0]:t,a))[0]-=i[0],r[1]-=i[1]),t.dataflow=e,t.item=n,t.vega=function(e,t,n){const r=t?"group"===t.mark.marktype?t:t.mark.group:null;function i(e){var n,i=r;if(e)for(n=t;n;n=n.mark.group)if(n.mark.name===e){i=n;break}return i&&i.mark&&i.mark.interactive?i:{}}function o(e){if(!e)return n;Ne(e)&&(e=i(e));const t=n.slice();for(;e;)t[0]-=e.x||0,t[1]-=e.y||0,e=e.mark&&e.mark.group;return t}return{view:ye(e),item:ye(t||{}),group:i,xy:o,x:e=>o(e)[0],y:e=>o(e)[1]}}(e,n,r),t}(i,n,r))}))};if("timer"===e)D$(i,"timer",t)&&i.timer(a,t);else if(e===A$)D$(i,"view",t)&&i.addEventListener(t,a,E$);else if("window"===e?D$(i,"window",t)&&"undefined"!=typeof window&&(r=[window]):"undefined"!=typeof document&&D$(i,"selector",t)&&(r=Array.from(document.querySelectorAll(e))),r){for(var s=0,u=r.length;s=0;)a[e].stop();for(e=u.length;--e>=0;)for(t=(n=u[e]).sources.length;--t>=0;)n.sources[t].removeEventListener(n.type,n.handler);for(o&&o.call(this,this._handler,null,null,null),e=s.length;--e>=0;)i=s[e].type,r=s[e].handler,this._handler.off(i,r);return this},hover:function(e,t){return t=[t||"update",(e=[e||"hover"])[0]],this.on(this.events("view","pointerover",C$),S$,F$(e)),this.on(this.events("view","pointerout",C$),S$,F$(t)),this},data:function(e,t){return arguments.length<2?b$(this,e).values.value:x$.call(this,e,aa().remove(C).insert(t))},change:x$,insert:function(e,t){return x$.call(this,e,aa().insert(t))},remove:function(e,t){return x$.call(this,e,aa().remove(t))},scale:function(e){var t=this._runtime.scales;return ke(t,e)||_("Unrecognized scale or projection: "+e),t[e].value},initialize:function(e,t){const n=this,r=n._renderType,i=n._eventConfig.bind,o=Hb(r);e=n._el=e?q$(n,e,!0):null,function(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),m$(t,e.description()))}(n),o||n.error("Unrecognized renderer type: "+r);const a=o.handler||Uv,s=e?o.renderer:o.headless;return n._renderer=s?I$(n,n._renderer,e,s):null,n._handler=function(e,t,n,r){const i=new r(e.loader(),U$(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,k$(e),e);return t&&t.handlers().forEach((e=>{i.on(e.type,e.handler)})),i}(n,n._handler,e,a),n._redraw=!0,e&&"none"!==i&&(t=t?n._elBind=q$(n,t,!0):e.appendChild(M$("form",{class:"vega-bindings"})),n._bind.forEach((e=>{e.param.element&&"container"!==i&&(e.element=q$(n,e.param.element,!!e.param.input))})),n._bind.forEach((e=>{!function(e,t,n){if(!t)return;const r=n.param;let i=n.state;i||(i=n.state={elements:null,active:!1,set:null,update:t=>{t!=e.signal(r.signal)&&e.runAsync(null,(()=>{i.source=!0,e.signal(r.signal,t)}))}},r.debounce&&(i.update=ve(r.debounce,i.update))),(null==r.input&&r.element?$$:N$)(i,t,r,e),i.active||(e.on(e._signals[r.signal],null,(()=>{i.source?i.source=!1:i.set(e.signal(r.signal))})),i.active=!0)}(n,e.element||t,e)}))),n},toImageURL:async function(e,t){e!==qb.Canvas&&e!==qb.SVG&&e!==qb.PNG&&_("Unrecognized image type: "+e);const n=await G$(this,e,t);return e===qb.SVG?function(e){const t=new Blob([e],{type:"image/svg+xml"});return window.URL.createObjectURL(t)}(n.svg()):n.canvas().toDataURL("image/png")},toCanvas:async function(e,t){return(await G$(this,qb.Canvas,e,t)).canvas()},toSVG:async function(e){return(await G$(this,qb.SVG,e)).svg()},getState:function(e){return this._runtime.getState(e||{data:Q$,signals:eN,recurse:!0})},setState:function(e){return this.runAsync(null,(t=>{t._trigger=!1,t._runtime.setState(e)}),(e=>{e._trigger=!0})),this},_watchPixelRatio:function(){if("canvas"===this.renderer()&&this._renderer._canvas){let e=null;const t=()=>{null!=e&&e();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}});const lN="view",cN="[",fN="]",dN="{",hN="}",pN=":",gN=",",mN="@",yN=">",vN=/[[\]{}]/,bN={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let xN,_N;function wN(e,t,n){return xN=t||lN,_N=n||bN,AN(e.trim()).map(EN)}function kN(e,t,n,r,i){const o=e.length;let a,s=0;for(;t=0?--s:r&&r.indexOf(a)>=0&&++s}return t}function AN(e){const t=[],n=e.length;let r=0,i=0;for(;i' after between selector: "+e;n=n.map(EN);const i=EN(e.slice(1).trim());return i.between?{between:n,stream:i}:(i.between=n,i)}(e):function(e){const t={source:xN},n=[];let r,i,o=[0,0],a=0,s=0,u=e.length,l=0;if(e[u-1]===hN){if(l=e.lastIndexOf(dN),!(l>=0))throw"Unmatched right brace: "+e;try{o=function(e){const t=e.split(gN);if(!e.length||t.length>2)throw e;return t.map((t=>{const n=+t;if(n!=n)throw e;return n}))}(e.substring(l+1,u-1))}catch(t){throw"Invalid throttle specification: "+e}u=(e=e.slice(0,l).trim()).length,l=0}if(!u)throw e;if(e[0]===mN&&(a=++l),r=kN(e,l,pN),r1?(t.type=n[1],a?t.markname=n[0].slice(1):(c=n[0],_N[c]?t.marktype=n[0]:t.source=n[0])):t.type=n[0],"!"===t.type.slice(-1)&&(t.consume=!0,t.type=t.type.slice(0,-1)),null!=i&&(t.filter=i),o[0]&&(t.throttle=o[0]),o[1]&&(t.debounce=o[1]),t}(e)}function ON(e){return R(e)?e:{type:e||"pad"}}const DN=e=>+e||0,CN=e=>({top:e,bottom:e,left:e,right:e});function SN(e){return R(e)?e.signal?e:{top:DN(e.top),bottom:DN(e.bottom),left:DN(e.left),right:DN(e.right)}:CN(DN(e))}const FN=e=>R(e)&&!z(e)?be({},e):{value:e};function MN(e,t,n,r){return null!=n?(R(n)&&!z(n)||z(n)&&n.length&&R(n[0])?e.update[t]=n:e[r||"enter"][t]={value:n},1):0}function jN(e,t,n){for(const n in t)MN(e,n,t[n]);for(const t in n)MN(e,t,n[t],"update")}function $N(e,t,n){for(const r in t)n&&ke(n,r)||(e[r]=be(e[r]||{},t[r]));return e}function NN(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const BN="mark",TN="frame",zN="scope",RN="axis",PN="axis-domain",LN="axis-grid",IN="axis-label",UN="axis-tick",qN="axis-title",WN="legend",HN="legend-band",GN="legend-entry",VN="legend-gradient",YN="legend-label",XN="legend-symbol",ZN="legend-title",JN="title",KN="title-text",QN="title-subtitle";function eB(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const tB=e=>Ne(e)?qe(e):e.signal?`(${e.signal})`:oB(e);function nB(e){if(null!=e.gradient)return function(e){const t=[e.start,e.stop,e.count].map((e=>null==e?null:qe(e)));for(;t.length&&null==q(t);)t.pop();return t.unshift(tB(e.gradient)),`gradient(${t.join(",")})`}(e);let t=e.signal?`(${e.signal})`:e.color?function(e){return e.c?rB("hcl",e.h,e.c,e.l):e.h||e.s?rB("hsl",e.h,e.s,e.l):e.l||e.a?rB("lab",e.l,e.a,e.b):e.r||e.g||e.b?rB("rgb",e.r,e.g,e.b):null}(e.color):null!=e.field?oB(e.field):void 0!==e.value?qe(e.value):void 0;return null!=e.scale&&(t=function(e,t){const n=tB(e.scale);return null!=e.range?t=`lerp(_range(${n}), ${+e.range})`:(void 0!==t&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(1==+e.band?"":"*"+iB(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),null==t&&(t="0")),t}(e,t)),void 0===t&&(t=null),null!=e.exponent&&(t=`pow(${t},${iB(e.exponent)})`),null!=e.mult&&(t+=`*${iB(e.mult)}`),null!=e.offset&&(t+=`+${iB(e.offset)}`),e.round&&(t=`round(${t})`),t}const rB=(e,t,n,r)=>`(${e}(${[t,n,r].map(nB).join(",")})+'')`;function iB(e){return R(e)?"("+nB(e)+")":e}function oB(e){return aB(R(e)?e:{datum:e})}function aB(e){let t,n,r;if(e.signal)t="datum",r=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(r=e.parent,t+=".datum"):r=e.group}else e.datum?(t="datum",r=e.datum):_("Invalid field reference: "+qe(e));return e.signal||(r=Ne(r)?w(r).map(qe).join("]["):aB(r)),t+"["+r+"]"}function sB(e,t,n,r,i,o){const a={};(o=o||{}).encoders={$encode:a},e=function(e,t,n,r,i){const o={},a={};let s,u,l,c;for(u in u="lineBreak","text"!==t||null==i[u]||NN(u,e)||eB(o,u,i[u]),("legend"==n||String(n).startsWith("axis"))&&(n=null),c=n===TN?i.group:n===BN?be({},i.mark,i[t]):null,c)l=NN(u,e)||("fill"===u||"stroke"===u)&&(NN("fill",e)||NN("stroke",e)),l||eB(o,u,c[u]);for(u in ue(r).forEach((t=>{const n=i.style&&i.style[t];for(const t in n)NN(t,e)||eB(o,t,n[t])})),e=be({},e),o)c=o[u],c.signal?(s=s||{})[u]=c:a[u]=c;return e.enter=be(a,e.enter),s&&(e.update=be(s,e.update)),e}(e,t,n,r,i.config);for(const n in e)a[n]=uB(e[n],t,o,i);return o}function uB(e,t,n,r){const i={},o={};for(const t in e)null!=e[t]&&(i[t]=lB((a=e[t],z(a)?function(e){let t="";return e.forEach((e=>{const n=nB(e);t+=e.test?`(${e.test})?${n}:`:n})),":"===q(t)&&(t+="null"),t}(a):nB(a)),r,n,o));var a;return{$expr:{marktype:t,channels:i},$fields:Object.keys(o),$output:Object.keys(e)}}function lB(e,t,n,r){const i=i$(e,t);return i.$fields.forEach((e=>r[e]=1)),be(n,i.$params),i.$expr}const cB="outer",fB=["value","update","init","react","bind"];function dB(e,t){_(e+' for "outer" push: '+qe(t))}function hB(e,t){const n=e.name;if(e.push===cB)t.signals[n]||dB("No prior signal definition",n),fB.forEach((t=>{void 0!==e[t]&&dB("Invalid property ",t)}));else{const r=t.addSignal(n,e.value);!1===e.react&&(r.react=!1),e.bind&&t.addBinding(n,e.bind)}}function pB(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function gB(e,t,n,r){return new pB(e,t,n,r)}function mB(e,t){return gB("operator",e,t)}function yB(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function vB(e,t){return t?{$field:e,$name:t}:{$field:e}}const bB=vB("key");function xB(e,t){return{$compare:e,$order:t}}function _B(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const wB="scope",kB="view";function AB(e){return e&&e.signal}function EB(e){if(AB(e))return!0;if(R(e))for(const t in e)if(EB(e[t]))return!0;return!1}function OB(e,t){return null!=e?e:t}function DB(e){return e&&e.signal||e}const CB="timer";function SB(e,t){return(e.merge?FB:e.stream?MB:e.type?jB:_("Invalid stream specification: "+qe(e)))(e,t)}function FB(e,t){const n=$B({merge:e.merge.map((e=>SB(e,t)))},e,t);return t.addStream(n).id}function MB(e,t){const n=$B({stream:SB(e.stream,t)},e,t);return t.addStream(n).id}function jB(e,t){let n;var r;e.type===CB?(n=t.event(CB,e.throttle),e={between:e.between,filter:e.filter}):n=t.event((r=e.source)===wB?kB:r||kB,e.type);const i=$B({stream:n},e,t);return 1===Object.keys(i).length?n:t.addStream(i).id}function $B(e,t,n){let r=t.between;return r&&(2!==r.length&&_('Stream "between" parameter must have 2 entries: '+qe(t)),e.between=[SB(r[0],n),SB(r[1],n)]),r=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&r.push(function(e,t,n){const r="event.item";return r+(e&&"*"!==e?"&&"+r+".mark.marktype==='"+e+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(t?"&&"+r+".mark.name==='"+t+"'":"")}(t.marktype,t.markname,t.markrole)),t.source===wB&&r.push("inScope(event.item)"),r.length&&(e.filter=i$("("+r.join(")&&(")+")",n).$expr),null!=(r=t.throttle)&&(e.throttle=+r),null!=(r=t.debounce)&&(e.debounce=+r),t.consume&&(e.consume=!0),e}const NB={code:"_.$value",ast:{type:"Identifier",value:"value"}};function BB(e){return{signal:"["+e.map((e=>e.scale?'scale("'+e.scale+'")':e.signal))+"]"}}const TB=e=>(t,n,r)=>gB(e,n,t||void 0,r),zB=TB("aggregate"),RB=TB("axisticks"),PB=TB("bound"),LB=TB("collect"),IB=TB("compare"),UB=TB("datajoin"),qB=TB("encode"),WB=TB("expression"),HB=TB("facet"),GB=TB("field"),VB=TB("key"),YB=TB("legendentries"),XB=TB("load"),ZB=TB("mark"),JB=TB("multiextent"),KB=TB("multivalues"),QB=TB("overlap"),eT=TB("params"),tT=TB("prefacet"),nT=TB("projection"),rT=TB("proxy"),iT=TB("relay"),oT=TB("render"),aT=TB("scale"),sT=TB("sieve"),uT=TB("sortitems"),lT=TB("viewlayout"),cT=TB("values");let fT=0;const dT={min:"min",max:"max",count:"sum"};function hT(e,t){const n=t.getScale(e.name).params;let r;for(r in n.domain=yT(e.domain,e,t),null!=e.range&&(n.range=ET(e,t,n)),null!=e.interpolate&&function(e,t){t.interpolate=pT(e.type||e),null!=e.gamma&&(t.interpolateGamma=pT(e.gamma))}(e.interpolate,n),null!=e.nice&&(n.nice=function(e,t){return e.signal?t.signalRef(e.signal):R(e)?{interval:pT(e.interval),step:pT(e.step)}:pT(e)}(e.nice,t)),null!=e.bins&&(n.bins=function(e,t){return e.signal||z(e)?gT(e,t):t.objectProperty(e)}(e.bins,t)),e)ke(n,r)||"name"===r||(n[r]=pT(e[r],t))}function pT(e,t){return R(e)?e.signal?t.signalRef(e.signal):_("Unsupported object: "+qe(e)):e}function gT(e,t){return e.signal?t.signalRef(e.signal):e.map((e=>pT(e,t)))}function mT(e){_("Can not find data set: "+qe(e))}function yT(e,t,n){if(e)return e.signal?n.signalRef(e.signal):(z(e)?vT:e.fields?xT:bT)(e,t,n);null==t.domainMin&&null==t.domainMax||_("No scale domain defined for domainMin/domainMax to override.")}function vT(e,t,n){return e.map((e=>pT(e,n)))}function bT(e,t,n){const r=n.getData(e.data);return r||mT(e.data),kp(t.type)?r.valuesRef(n,e.field,wT(e.sort,!1)):Dp(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function xT(e,t,n){const r=e.data,i=e.fields.reduce(((e,t)=>(t=Ne(t)?{data:r,field:t}:z(t)||t.signal?function(e,t){const n="_:vega:_"+fT++,r=LB({});if(z(e))r.value={$ingest:e};else if(e.signal){const i="setdata("+qe(n)+","+e.signal+")";r.params.input=t.signalRef(i)}return t.addDataPipeline(n,[r,sT({})]),{data:n,field:"data"}}(t,n):t,e.push(t),e)),[]);return(kp(t.type)?_T:Dp(t.type)?kT:AT)(e,n,i)}function _T(e,t,n){const r=wT(e.sort,!0);let i,o;const a=n.map((e=>{const n=t.getData(e.data);return n||mT(e.data),n.countsRef(t,e.field,r)})),s={groupby:bB,pulse:a};r&&(i=r.op||"count",o=r.field?_B(i,r.field):"count",s.ops=[dT[i]],s.fields=[t.fieldRef(o)],s.as=[o]),i=t.add(zB(s));const u=t.add(LB({pulse:yB(i)}));return o=t.add(cT({field:bB,sort:t.sortRef(r),pulse:yB(u)})),yB(o)}function wT(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field&&e.op&&!dT[e.op]&&_("Multiple domain scales can not be sorted using "+e.op):_("No field provided for sort aggregate op: "+e.op):R(e)?e.field="key":e={field:"key"}),e}function kT(e,t,n){const r=n.map((e=>{const n=t.getData(e.data);return n||mT(e.data),n.domainRef(t,e.field)}));return yB(t.add(KB({values:r})))}function AT(e,t,n){const r=n.map((e=>{const n=t.getData(e.data);return n||mT(e.data),n.extentRef(t,e.field)}));return yB(t.add(JB({extents:r})))}function ET(e,t,n){const r=t.config.range;let i=e.range;if(i.signal)return t.signalRef(i.signal);if(Ne(i)){if(r&&ke(r,i))return ET(e=be({},e,{range:r[i]}),t,n);"width"===i?i=[0,{signal:"width"}]:"height"===i?i=kp(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:_("Unrecognized scale range value: "+qe(i))}else{if(i.scheme)return n.scheme=z(i.scheme)?gT(i.scheme,t):pT(i.scheme,t),i.extent&&(n.schemeExtent=gT(i.extent,t)),void(i.count&&(n.schemeCount=pT(i.count,t)));if(i.step)return void(n.rangeStep=pT(i.step,t));if(kp(e.type)&&!z(i))return yT(i,e,t);z(i)||_("Unsupported range type: "+qe(i))}return i.map((e=>(z(e)?gT:pT)(e,t)))}function OT(e,t,n){return z(e)?e.map((e=>OT(e,t,n))):R(e)?e.signal?n.signalRef(e.signal):"fit"===t?e:_("Unsupported parameter object: "+qe(e)):e}const DT="top",CT="left",ST="right",FT="bottom",MT="center",jT="vertical",$T="start",NT="end",BT="index",TT="label",zT="offset",RT="perc",PT="perc2",LT="value",IT="guide-label",UT="guide-title",qT="group-title",WT="group-subtitle",HT="symbol",GT="gradient",VT="discrete",YT="size",XT=[YT,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],ZT={name:1,style:1,interactive:1},JT={value:0},KT={value:1},QT="group",ez="rect",tz="rule",nz="symbol",rz="text";function iz(e){return e.type=QT,e.interactive=e.interactive||!1,e}function oz(e,t){const n=(n,r)=>OB(e[n],OB(t[n],r));return n.isVertical=n=>jT===OB(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>OB(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>OB(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>OB(e.columns,OB(t.columns,+n.isVertical(!0))),n}function az(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function sz(e,t,n){return`item.anchor === '${$T}' ? ${e} : item.anchor === '${NT}' ? ${t} : ${n}`}const uz=sz(qe(CT),qe(ST),qe(MT));function lz(e,t){return t?e?R(e)?Object.assign({},e,{offset:lz(e.offset,t)}):{value:e,offset:t}:t:e}function cz(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=$N(e.encode,t,ZT)):e.interactive=!1,e}function fz(e,t,n,r){const i=oz(e,n),o=i.isVertical(),a=i.gradientThickness(),s=i.gradientLength();let u,l,c,f,d;o?(l=[0,1],c=[0,0],f=a,d=s):(l=[0,0],c=[1,0],f=s,d=a);const h={enter:u={opacity:JT,x:JT,y:JT,width:FN(f),height:FN(d)},update:be({},u,{opacity:KT,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:JT}};return jN(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),cz({type:ez,role:VN,encode:h},r)}function dz(e,t,n,r,i){const o=oz(e,n),a=o.isVertical(),s=o.gradientThickness(),u=o.gradientLength();let l,c,f,d,h="";a?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const p={opacity:JT,fill:{scale:t,field:LT}};p[l]={signal:h+"datum."+RT,mult:u},p[c]=JT,p[f]={signal:h+"datum."+PT,mult:u},p[d]=FN(s);const g={enter:p,update:be({},p,{opacity:KT}),exit:{opacity:JT}};return jN(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),cz({type:ez,role:HN,key:LT,from:i,encode:g},r)}const hz=`datum.${RT}<=0?"${CT}":datum.${RT}>=1?"${ST}":"${MT}"`,pz=`datum.${RT}<=0?"${FT}":datum.${RT}>=1?"${DT}":"middle"`;function gz(e,t,n,r){const i=oz(e,t),o=i.isVertical(),a=FN(i.gradientThickness()),s=i.gradientLength();let u,l,c,f,d=i("labelOverlap"),h="";const p={enter:u={opacity:JT},update:l={opacity:KT,text:{field:TT}},exit:{opacity:JT}};return jN(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:OB(e.labelLimit,t.gradientLabelLimit)}),o?(u.align={value:"left"},u.baseline=l.baseline={signal:pz},c="y",f="x",h="1-"):(u.align=l.align={signal:hz},u.baseline={value:"top"},c="x",f="y"),u[c]=l[c]={signal:h+"datum."+RT,mult:s},u[f]=l[f]=a,a.offset=OB(e.labelOffset,t.gradientLabelOffset)||0,d=d?{separation:i("labelSeparation"),method:d,order:"datum."+BT}:void 0,cz({type:rz,role:YN,style:IT,key:LT,from:r,encode:p,overlap:d},n)}function mz(e,t,n,r,i){const o=oz(e,t),a=n.entries,s=!(!a||!a.interactive),u=a?a.name:void 0,l=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},d=`(${i}) ? datum.${zT} : datum.${YT}`,h=l?FN(l):{field:YT},p=`datum.${BT}`,g=`max(1, ${i})`;let m,y,v,b,x;h.mult=.5,m={enter:y={opacity:JT,x:{signal:d,mult:.5,offset:c},y:h},update:v={opacity:KT,x:y.x,y:y.y},exit:{opacity:JT}};let _=null,w=null;e.fill||(_=t.symbolBaseFillColor,w=t.symbolBaseStrokeColor),jN(m,{fill:o("symbolFillColor",_),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",w),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),XT.forEach((t=>{e[t]&&(v[t]=y[t]={scale:e[t],field:LT})}));const k=cz({type:nz,role:XN,key:LT,from:f,clip:!!l||void 0,encode:m},n.symbols),A=FN(c);A.offset=o("labelOffset"),m={enter:y={opacity:JT,x:{signal:d,offset:A},y:h},update:v={opacity:KT,text:{field:TT},x:y.x,y:y.y},exit:{opacity:JT}},jN(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const E=cz({type:rz,role:YN,style:IT,key:LT,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:JT,height:l?FN(l):JT,opacity:JT},exit:{opacity:JT},update:v={opacity:KT,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(b=`ceil(item.mark.items.length / ${g})`,v.row.signal=`${p}%${b}`,v.column.signal=`floor(${p} / ${b})`,x={field:["row",p]}):(v.row.signal=`floor(${p} / ${g})`,v.column.signal=`${p} % ${g}`,x={field:p}),v.column.signal=`(${i})?${v.column.signal}:${p}`,iz({role:zN,from:r={facet:{data:r,name:"value",groupby:BT}},encode:$N(m,a,ZT),marks:[k,E],name:u,interactive:s,sort:x})}const yz='item.orient === "left"',vz='item.orient === "right"',bz=`(${yz} || ${vz})`,xz=`datum.vgrad && ${bz}`,_z=sz('"top"','"bottom"','"middle"'),wz=`datum.vgrad && ${vz} ? (${sz('"right"','"left"','"center"')}) : (${bz} && !(datum.vgrad && ${yz})) ? "left" : ${uz}`,kz=`item._anchor || (${bz} ? "middle" : "start")`,Az=`${xz} ? (${yz} ? -90 : 90) : 0`,Ez=`${bz} ? (datum.vgrad ? (${vz} ? "bottom" : "top") : ${_z}) : "top"`;function Oz(e,t){let n;return R(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+Dz(e.path)+")":e.sphere&&(n="geoShape("+Dz(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function Dz(e){return R(e)&&e.signal?e.signal:qe(e)}function Cz(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===QT?zN:t||BN}function Sz(e){return{marktype:e.type,name:e.name||void 0,role:e.role||Cz(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function Fz(e,t){return e&&e.signal?t.signalRef(e.signal):!1!==e}function Mz(e,t){const n=ja(e.type);n||_("Unrecognized transform type: "+qe(e.type));const r=gB(n.type.toLowerCase(),null,jz(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(r)),r.metadata=n.metadata||{},r}function jz(e,t,n){const r={},i=e.params.length;for(let o=0;oBz(e,t,n)))):Bz(e,r,n)}(e,t,n):"projection"===r?n.projectionRef(t[e.name]):e.array&&!AB(i)?i.map((t=>Nz(e,t,n))):Nz(e,i,n):void(e.required&&_("Missing required "+qe(t.type)+" parameter: "+qe(e.name)))}function Nz(e,t,n){const r=e.type;if(AB(t))return Pz(r)?_("Expression references can not be signals."):Lz(r)?n.fieldRef(t):Iz(r)?n.compareRef(t):n.signalRef(t.signal);{const i=e.expr||Lz(r);return i&&Tz(t)?n.exprRef(t.expr,t.as):i&&zz(t)?vB(t.field,t.as):Pz(r)?i$(t,n):Rz(r)?yB(n.getData(t).values):Lz(r)?vB(t):Iz(r)?n.compareRef(t):t}}function Bz(e,t,n){const r=e.params.length;let i;for(let n=0;ne&&e.expr,zz=e=>e&&e.field,Rz=e=>"data"===e,Pz=e=>"expr"===e,Lz=e=>"field"===e,Iz=e=>"compare"===e;function Uz(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:yB(t.getData(e.data).output)}function qz(e,t,n,r,i){this.scope=e,this.input=t,this.output=n,this.values=r,this.aggregate=i,this.index={}}function Wz(e){return Ne(e)?e:null}function Hz(e,t,n){const r=_B(n.op,n.field);let i;if(t.ops){for(let e=0,n=t.as.length;enull==e?"null":e)).join(",")+"),0)",t);u.update=l.$expr,u.params=l.$params}function Yz(e,t){const n=Cz(e),r=e.type===QT,i=e.from&&e.from.facet,o=e.overlap;let a,s,u,l,c,f,d,h=e.layout||n===zN||n===TN;const p=n===BN||h||i,g=function(e,t,n){let r,i,o,a,s;return e?(r=e.facet)&&(t||_("Only group marks can be faceted."),null!=r.field?a=s=Uz(r,n):(e.data?s=yB(n.getData(e.data).aggregate):(o=Mz(be({type:"aggregate",groupby:ue(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=Uz(r,n),a=s=yB(n.add(o))),i=n.keyRef(r.groupby,!0))):a=yB(n.add(LB(null,[{}]))),a||(a=Uz(e,n)),{key:i,pulse:a,parent:s}}(e.from,r,t);s=t.add(UB({key:g.key||(e.key?vB(e.key):void 0),pulse:g.pulse,clean:!r}));const m=yB(s);s=u=t.add(LB({pulse:m})),s=t.add(ZB({markdef:Sz(e),interactive:Fz(e.interactive,t),clip:Oz(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:yB(s)}));const y=yB(s);s=l=t.add(qB(sB(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),s.params.parent=t.encode(),e.transform&&e.transform.forEach((e=>{const n=Mz(e,t),r=n.metadata;(r.generates||r.changes)&&_("Mark transforms should not generate new data."),r.nomod||(l.params.mod=!0),n.params.pulse=yB(s),t.add(s=n)})),e.sort&&(s=t.add(uT({sort:t.compareRef(e.sort),pulse:yB(s)})));const v=yB(s);(i||h)&&(h=t.add(lT({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:v})),f=yB(h));const b=t.add(PB({mark:y,pulse:f||v}));d=yB(b),r&&(p&&(a=t.operators,a.pop(),h&&a.pop()),t.pushState(v,f||d,m),i?function(e,t,n){const r=e.from.facet,i=r.name,o=Uz(r,t);let a;r.name||_("Facet must have a name: "+qe(r)),r.data||_("Facet must reference a data set: "+qe(r)),r.field?a=t.add(tT({field:t.fieldRef(r.field),pulse:o})):r.groupby?a=t.add(HB({key:t.keyRef(r.groupby),group:yB(t.proxy(n.parent)),pulse:o})):_("Facet must specify groupby or field: "+qe(r));const s=t.fork(),u=s.add(LB()),l=s.add(sT({pulse:yB(u)}));s.addData(i,new qz(s,u,u,l)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(e).toRuntime()}}(e,t,g):p?function(e,t,n){const r=t.add(tT({pulse:n.pulse})),i=t.fork();i.add(sT()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(e).toRuntime()}}(e,t,g):t.parse(e),t.popState(),p&&(h&&a.push(h),a.push(b))),o&&(d=function(e,t,n){const r=e.method,i=e.bound,o=e.separation,a={separation:AB(o)?n.signalRef(o.signal):o,method:AB(r)?n.signalRef(r.signal):r,pulse:t};if(e.order&&(a.sort=n.compareRef({field:e.order})),i){const e=i.tolerance;a.boundTolerance=AB(e)?n.signalRef(e.signal):+e,a.boundScale=n.scaleRef(i.scale),a.boundOrient=i.orient}return yB(n.add(QB(a)))}(o,d,t));const x=t.add(oT({pulse:d})),w=t.add(sT({pulse:yB(x)},void 0,t.parent()));null!=e.name&&(c=e.name,t.addData(c,new qz(t,u,x,w)),e.on&&e.on.forEach((e=>{(e.insert||e.remove||e.toggle)&&_("Marks only support modify triggers."),Vz(e,t,c)})))}function Xz(e,t,n){const r={enter:{},update:{}};return jN(r,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),r}function Zz(e,t,n){return t[e]?`scale("${t[e]}",datum)`:az(e,n[0].encode)}qz.fromEntries=function(e,t){const n=t.length,r=t[n-1],i=t[n-2];let o=t[0],a=null,s=1;for(o&&"load"===o.type&&(o=t[1]),e.add(t[0]);se===FT||e===DT,nR=(e,t,n)=>AB(e)?lR(e.signal,t,n):e===CT||e===DT?t:n,rR=(e,t,n)=>AB(e)?sR(e.signal,t,n):tR(e)?t:n,iR=(e,t,n)=>AB(e)?uR(e.signal,t,n):tR(e)?n:t,oR=(e,t,n)=>AB(e)?cR(e.signal,t,n):e===DT?{value:t}:{value:n},aR=(e,t,n)=>AB(e)?fR(e.signal,t,n):e===ST?{value:t}:{value:n},sR=(e,t,n)=>dR(`${e} === '${DT}' || ${e} === '${FT}'`,t,n),uR=(e,t,n)=>dR(`${e} !== '${DT}' && ${e} !== '${FT}'`,t,n),lR=(e,t,n)=>pR(`${e} === '${CT}' || ${e} === '${DT}'`,t,n),cR=(e,t,n)=>pR(`${e} === '${DT}'`,t,n),fR=(e,t,n)=>pR(`${e} === '${ST}'`,t,n),dR=(e,t,n)=>(t=null!=t?FN(t):t,n=null!=n?FN(n):n,hR(t)&&hR(n)?{signal:`${e} ? (${t=t?t.signal||qe(t.value):null}) : (${n=n?n.signal||qe(n.value):null})`}:[be({test:e},t)].concat(n||[])),hR=e=>null==e||1===Object.keys(e).length,pR=(e,t,n)=>({signal:`${e} ? (${mR(t)}) : (${mR(n)})`}),gR=(e,t,n,r,i)=>({signal:(null!=r?`${e} === '${CT}' ? (${mR(r)}) : `:"")+(null!=n?`${e} === '${FT}' ? (${mR(n)}) : `:"")+(null!=i?`${e} === '${ST}' ? (${mR(i)}) : `:"")+(null!=t?`${e} === '${DT}' ? (${mR(t)}) : `:"")+"(null)"}),mR=e=>AB(e)?e.signal:null==e?null:qe(e),yR=(e,t)=>0===t?0:AB(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},vR=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function bR(e,t,n,r){let i;if(t&&ke(t,e))return t[e];if(ke(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=e[5].toLowerCase()+e.slice(6)}return r[UT][i]}if(e.startsWith("label")){switch(e){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=e[5].toLowerCase()+e.slice(6)}return r[IT][i]}return null}function xR(e){const t={};for(const n of e)if(n)for(const e in n)t[e]=1;return Object.keys(t)}function _R(e,t){return{scale:e.scale,range:t}}function wR(e,t,n,r,i){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+r+","+i+")"}}function kR(e,t){const n=function(e,t){var n,r,i,o=t.config,a=o.style,s=o.axis,u="band"===t.scaleType(e.scale)&&o.axisBand,l=e.orient;if(AB(l)){const e=xR([o.axisX,o.axisY]),t=xR([o.axisTop,o.axisBottom,o.axisLeft,o.axisRight]);for(i of(n={},e))n[i]=rR(l,bR(i,o.axisX,s,a),bR(i,o.axisY,s,a));for(i of(r={},t))r[i]=gR(l.signal,bR(i,o.axisTop,s,a),bR(i,o.axisBottom,s,a),bR(i,o.axisLeft,s,a),bR(i,o.axisRight,s,a))}else n=l===DT||l===FT?o.axisX:o.axisY,r=o["axis"+l[0].toUpperCase()+l.slice(1)];return n||r||u?be({},s,n,r,u):s}(e,t),r=e.encode||{},i=r.axis||{},o=i.name||void 0,a=i.interactive,s=i.style,u=oz(e,n),l=function(e){const t=e("tickBand");let n,r,i=e("tickOffset");return t?t.signal?(n={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},R(i)||(i={signal:`(${t.signal}) === 'extent' ? 0 : ${i}`})):"extent"===t?(n=1,r=!0,i=0):(n=.5,r=!1):(n=e("bandPosition"),r=e("tickExtra")),{extra:r,band:n,offset:i}}(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:null!=e.title},f=yB(t.add(LB({},[c]))),d=yB(t.add(RB({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(function(e,t,n,r,i){const o=oz(e,t),a=e.orient,s=e.gridScale,u=nR(a,1,-1),l=function(e,t){if(1===t);else if(R(e)){let n=e=be({},e);for(;null!=n.mult;){if(!R(n.mult))return n.mult=AB(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n=n.mult=be({},n.mult)}n.mult=t}else e=AB(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);return e}(e.offset,u);let c,f,d;const h={enter:c={opacity:JT},update:d={opacity:KT},exit:f={opacity:JT}};jN(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:e.scale,field:LT,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=rR(a,{signal:"height"},{signal:"width"}),m=s?{scale:s,range:0,mult:u,offset:l}:{value:0,offset:l},y=s?{scale:s,range:1,mult:u,offset:l}:be(g,{mult:u,offset:l});return c.x=d.x=rR(a,p,m),c.y=d.y=iR(a,p,m),c.x2=d.x2=iR(a,y),c.y2=d.y2=rR(a,y),f.x=rR(a,p),f.y=iR(a,p),cz({type:tz,role:LN,key:LT,from:r,encode:h},n)}(e,n,r.grid,d,l)),c.ticks&&(p=u("tickSize"),h.push(function(e,t,n,r,i,o){const a=oz(e,t),s=e.orient,u=nR(s,-1,1);let l,c,f;const d={enter:l={opacity:JT},update:f={opacity:KT},exit:c={opacity:JT}};jN(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=FN(i);h.mult=u;const p={scale:e.scale,field:LT,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=l.y=rR(s,JT,p),f.y2=l.y2=rR(s,h),c.x=rR(s,p),f.x=l.x=iR(s,JT,p),f.x2=l.x2=iR(s,h),c.y=iR(s,p),cz({type:tz,role:UN,key:LT,from:r,encode:d},n)}(e,n,r.ticks,d,p,l))),c.labels&&(p=c.ticks?p:0,h.push(function(e,t,n,r,i,o){const a=oz(e,t),s=e.orient,u=e.scale,l=nR(s,-1,1),c=DB(a("labelFlush")),f=DB(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let p,g=0===c||!!c;const m=FN(i);m.mult=l,m.offset=FN(a("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:LT,band:.5,offset:lz(o.offset,a("labelOffset"))},v=rR(s,g?wR(u,c,'"left"','"right"','"center"'):{value:"center"},aR(s,"left","right")),b=rR(s,oR(s,"bottom","top"),g?wR(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=wR(u,c,`-(${f})`,f,0);g=g&&f;const _={opacity:JT,x:rR(s,y,m),y:iR(s,y,m)},w={enter:_,update:p={opacity:KT,text:{field:TT},x:_.x,y:_.y,align:v,baseline:b},exit:{opacity:JT,x:_.x,y:_.y}};jN(w,{dx:!d&&g?rR(s,x):null,dy:!h&&g?iR(s,x):null}),jN(w,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:d,baseline:h});const k=a("labelBound");let A=a("labelOverlap");return A=A||k?{separation:a("labelSeparation"),method:A,order:"datum.index",bound:k?{scale:u,orient:s,tolerance:k}:null}:void 0,p.align!==v&&(p.align=vR(p.align,v)),p.baseline!==b&&(p.baseline=vR(p.baseline,b)),cz({type:rz,role:IN,style:IT,key:LT,from:r,encode:w,overlap:A},n)}(e,n,r.labels,d,p,l))),c.domain&&h.push(function(e,t,n,r){const i=oz(e,t),o=e.orient;let a,s;const u={enter:a={opacity:JT},update:s={opacity:KT},exit:{opacity:JT}};jN(u,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const l=_R(e,0),c=_R(e,1);return a.x=s.x=rR(o,l,JT),a.x2=s.x2=rR(o,c),a.y=s.y=iR(o,l,JT),a.y2=s.y2=iR(o,c),cz({type:tz,role:PN,from:r,encode:u},n)}(e,n,r.domain,f)),c.title&&h.push(function(e,t,n,r){const i=oz(e,t),o=e.orient,a=nR(o,-1,1);let s,u;const l={enter:s={opacity:JT,anchor:FN(i("titleAnchor",null)),align:{signal:uz}},update:u=be({},s,{opacity:KT,text:FN(e.title)}),exit:{opacity:JT}},c={signal:`lerp(range("${e.scale}"), ${sz(0,1,.5)})`};return u.x=rR(o,c),u.y=iR(o,c),s.angle=rR(o,JT,yR(a,90)),s.baseline=rR(o,oR(o,FT,DT),{value:FT}),u.angle=s.angle,u.baseline=s.baseline,jN(l,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),function(e,t,n,r){const i=(e,t)=>null!=e?(n.update[t]=vR(FN(e),n.update[t]),!1):!NN(t,r),o=i(e("titleX"),"x"),a=i(e("titleY"),"y");n.enter.auto=a===o?FN(a):rR(t,FN(a),FN(o))}(i,o,l,n),l.update.align=vR(l.update.align,s.align),l.update.angle=vR(l.update.angle,s.angle),l.update.baseline=vR(l.update.baseline,s.baseline),cz({type:rz,role:qN,style:UT,from:r,encode:l},n)}(e,n,r.title,f)),Yz(iz({role:RN,from:f,encode:$N(AR(u,e),i,ZT),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:a,style:s}),t)}function AR(e,t){const n={enter:{},update:{}};return jN(n,{orient:e("orient"),offset:e("offset")||0,position:OB(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function ER(e,t,n){const r=ue(e.signals),i=ue(e.scales);return n||r.forEach((e=>hB(e,t))),ue(e.projections).forEach((e=>function(e,t){const n=t.config.projection||{},r={};for(const n in e)"name"!==n&&(r[n]=OT(e[n],n,t));for(const e in n)null==r[e]&&(r[e]=OT(n[e],e,t));t.addProjection(e.name,r)}(e,t))),i.forEach((e=>function(e,t){const n=e.type||"linear";xp(n)||_("Unrecognized scale type: "+qe(n)),t.addScale(e.name,{type:n,domain:void 0})}(e,t))),ue(e.data).forEach((e=>function(e,t){const n=[];e.transform&&e.transform.forEach((e=>{n.push(Mz(e,t))})),e.on&&e.on.forEach((n=>{Vz(n,t,e.name)})),t.addDataPipeline(e.name,function(e,t,n){const r=[];let i,o,a,s,u,l=null,c=!1,f=!1;for(e.values?AB(e.values)||EB(e.format)?(r.push(eR(t,e)),r.push(l=Qz())):r.push(l=Qz({$ingest:e.values,$format:e.format})):e.url?EB(e.url)||EB(e.format)?(r.push(eR(t,e)),r.push(l=Qz())):r.push(l=Qz({$request:e.url,$format:e.format})):e.source&&(l=i=ue(e.source).map((e=>yB(t.getData(e).output))),r.push(null)),o=0,a=n.length;ohT(e,t))),(n||r).forEach((e=>function(e,t){const n=t.getSignal(e.name);let r=e.update;e.init&&(r?_("Signals can not include both init and update expressions."):(r=e.init,n.initonly=!0)),r&&(r=i$(r,t),n.update=r.$expr,n.params=r.$params),e.on&&e.on.forEach((e=>function(e,t,n){const r=e.encode,i={target:n};let o=e.events,a=e.update,s=[];o||_("Signal update missing events specification."),Ne(o)&&(o=wN(o,t.isSubscope()?wB:kB)),o=ue(o).filter((e=>e.signal||e.scale?(s.push(e),0):1)),s.length>1&&(s=[BB(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),null!=r&&(a&&_("Signal encode and update are mutually exclusive."),a="encode(item(),"+qe(r)+")"),i.update=Ne(a)?i$(a,t):null!=a.expr?i$(a.expr,t):null!=a.value?a.value:null!=a.signal?{$expr:NB,$params:{$value:t.signalRef(a.signal)}}:_("Invalid signal update specification."),e.force&&(i.options={force:!0}),s.forEach((e=>t.addUpdate(be(function(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):SB(e,t)}}(e,t),i))))}(e,t,n.id)))}(e,t))),ue(e.axes).forEach((e=>kR(e,t))),ue(e.marks).forEach((e=>Yz(e,t))),ue(e.legends).forEach((e=>function(e,t){const n=t.config.legend,r=e.encode||{},i=oz(e,n),o=r.legend||{},a=o.name||void 0,s=o.interactive,u=o.style,l={};let c,f,d,h=0;XT.forEach((t=>e[t]?(l[t]=e[t],h=h||e[t]):0)),h||_("Missing valid scale for legend.");const p=function(e,t){let n=e.type||HT;return e.type||1!==function(e){return XT.reduce(((t,n)=>t+(e[n]?1:0)),0)}(e)||!e.fill&&!e.stroke||(n=wp(t)?GT:Ap(t)?VT:HT),n!==GT?n:Ap(t)?VT:GT}(e,t.scaleType(h)),g={title:null!=e.title,scales:l,type:p,vgrad:"symbol"!==p&&i.isVertical()},m=yB(t.add(LB(null,[g]))),y=yB(t.add(YB(f={type:p,scale:t.scaleRef(h),count:t.objectProperty(i("tickCount")),limit:t.property(i("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===GT?(d=[fz(e,h,n,r.gradient),gz(e,n,r.labels,y)],f.count=f.count||t.signalRef(`max(2,2*floor((${DB(i.gradientLength())})/100))`)):p===VT?d=[dz(e,h,n,r.gradient,y),gz(e,n,r.labels,y)]:(c=function(e,t){const n=oz(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(e,n),d=[mz(e,n,r,y,DB(c.columns))],f.size=function(e,t,n){const r=DB(Zz("size",e,n)),i=DB(Zz("strokeWidth",e,n)),o=DB(function(e,t,n){return az("fontSize",e)||function(e,t,n){const r=t.config.style[n];return r&&r.fontSize}(0,t,n)}(n[1].encode,t,IT));return i$(`max(ceil(sqrt(${r})+${i}),${o})`,t)}(e,t,d[0].marks)),d=[iz({role:GN,from:m,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:c,interactive:s})],g.title&&d.push(function(e,t,n,r){const i=oz(e,t),o={enter:{opacity:JT},update:{opacity:KT,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:JT}};return jN(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:kz},angle:{signal:Az},align:{signal:wz},baseline:{signal:Ez},text:e.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),cz({type:rz,role:ZN,style:UT,from:r,encode:o},n)}(e,n,r.title,m)),Yz(iz({role:WN,from:m,encode:$N(Xz(i,e,n),o,ZT),marks:d,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:a,interactive:s,style:u}),t)}(e,t))),e.title&&function(e,t){const n=oz(e=Ne(e)?{text:e}:e,t.config.title),r=e.encode||{},i=r.group||{},o=i.name||void 0,a=i.interactive,s=i.style,u=[],l=yB(t.add(LB(null,[{}])));u.push(function(e,t,n,r){const i={value:0},o={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return jN(o,{text:e.text,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),cz({type:rz,role:KN,style:qT,from:r,encode:o},n)}(e,n,function(e){const t=e.encode;return t&&t.title||be({name:e.name,interactive:e.interactive,style:e.style},t)}(e),l)),e.subtitle&&u.push(function(e,t,n,r){const i={value:0},o={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return jN(o,{text:e.subtitle,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),cz({type:rz,role:QN,style:WT,from:r,encode:o},n)}(e,n,r.subtitle,l)),Yz(iz({role:JN,from:l,encode:Kz(n,i),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:a,style:s}),t)}(e.title,t),t.parseLambdas(),t}const OR=e=>$N({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function DR(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function CR(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function SR(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}function FR(e){return(z(e)?MR:jR)(e)}function MR(e){const t=e.length;let n="[";for(let r=0;r0?",":"")+(R(t)?t.signal||FR(t):qe(t))}return n+"]"}function jR(e){let t,n,r="{",i=0;for(t in e)n=e[t],r+=(++i>1?",":"")+qe(t)+":"+(R(n)?n.signal||FR(n):qe(n));return r+"}"}function $R(e,t,n){return R(e)||_("Input Vega specification must be an object."),function(e,t){const n=t.config,r=yB(t.root=t.add(mB())),i=function(e,t){const n=n=>OB(e[n],t[n]),r=[DR("background",n("background")),DR("autosize",ON(n("autosize"))),DR("padding",SN(n("padding"))),DR("width",n("width")||0),DR("height",n("height")||0)],i=r.reduce(((e,t)=>(e[t.name]=t,e)),{}),o={};return ue(e.signals).forEach((e=>{ke(i,e.name)?e=be(i[e.name],e):r.push(e),o[e.name]=e})),ue(t.signals).forEach((e=>{ke(o,e.name)||ke(i,e.name)||r.push(e)})),r}(e,n);i.forEach((e=>hB(e,t))),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const o=t.add(LB()),a=t.add(qB(sB(OR(e.encode),QT,TN,e.style,t,{pulse:yB(o)}))),s=t.add(lT({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:r,pulse:yB(a)}));t.operators.pop(),t.pushState(yB(a),yB(s),null),ER(e,t,i),t.operators.push(s);let u=t.add(PB({mark:r,pulse:yB(s)}));return u=t.add(oT({pulse:yB(u)})),u=t.add(sT({pulse:yB(u)})),t.addData("root",new qz(t,o,o,u)),t}(e,new CR(t=L(function(){const e="sans-serif",t="#4c78a8",n="#000",r="#888",i="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:t},area:{fill:t},image:null,line:{stroke:t,strokeWidth:2},path:{stroke:t},rect:{fill:t},rule:{stroke:n},shape:{stroke:t},symbol:{fill:t,size:64},text:{fill:n,font:e,fontSize:11},trail:{fill:t,size:2},style:{"guide-label":{fill:n,font:e,fontSize:10},"guide-title":{fill:n,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:n,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:n,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:i},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:r,grid:!1,gridWidth:1,gridColor:i,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:r,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:i,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:r,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}(),t,e.config),n)).toRuntime()}CR.prototype=SR.prototype={parse(e){return ER(e,this)},fork(){return new SR(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach((t=>{t.$ref=e.id})),e.refs=null),e},proxy(e){const t=e instanceof pB?yB(e):e;return this.add(rT({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;for(e in this.root&&(this.root.root=!0),this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(e,t,n){let r,i;e&&(r=e.data||(e.data={}),i=r[t]||(r[t]=[]),i.push(n))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const r in t.index)n(t.index[r],e,"index:"+r)}return this},pushState(e,t,n){this._encode.push(yB(this.add(sT({pulse:e})))),this._parent.push(t),this._lookup.push(n?yB(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return q(this._parent)},encode(){return q(this._encode)},lookup(){return q(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(Ne(e))return vB(e,t);e.signal||_("Unsupported field reference: "+qe(e));const n=e.signal;let r=this.field[n];if(!r){const e={name:this.signalRef(n)};t&&(e.as=t),this.field[n]=r=yB(this.add(GB(e)))}return r},compareRef(e){let t=!1;const n=e=>AB(e)?(t=!0,this.signalRef(e.signal)):function(e){return e&&e.expr}(e)?(t=!0,this.exprRef(e.expr)):e,r=ue(e.field).map(n),i=ue(e.order).map(n);return t?yB(this.add(IB({fields:r,orders:i}))):xB(r,i)},keyRef(e,t){let n=!1;const r=this.signals;return e=ue(e).map((e=>AB(e)?(n=!0,yB(r[e.signal])):e)),n?yB(this.add(VB({fields:e,flat:t}))):function(e,t){const n={$key:e};return t&&(n.$flat=!0),n}(e,t)},sortRef(e){if(!e)return e;const t=_B(e.op,e.field),n=e.order||"ascending";return n.signal?yB(this.add(IB({fields:t,orders:this.signalRef(n.signal)}))):xB(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:e,type:t}),this.events[n]=r}return this.events[n]},hasOwnSignal(e){return ke(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&_("Duplicate signal name: "+qe(e));const n=t instanceof pB?t:this.add(mB(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||_("Unrecognized signal name: "+qe(e)),this.signals[e]},signalRef(e){return this.signals[e]?yB(this.signals[e]):(ke(this.lambdas,e)||(this.lambdas[e]=this.add(mB(null))),yB(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t{"use strict";t.exports=e},51:e=>{"use strict";e.exports={version:"0.3.1"}},330:e=>{"use strict";e.exports=JSON.parse('{"name":"jupyter-vega","version":"4.1.0","description":"IPython/Jupyter notebook module for [Vega](https://vega.github.io/vega), and [Vega-Lite](https://vega.github.io/vega-lite).","repository":{"type":"git","url":"git+https://github.com/vega/ipyvega.git"},"author":"","license":"BSD-3-Clause","bugs":{"url":"https://github.com/vega/ipyvega/issues"},"homepage":"https://github.com/vega/ipyvega#readme","scripts":{"format":"prettier --write \'src/*.ts\'","lint":"prettier --check \'src/*.ts\'","build":"webpack --mode production","watch":"webpack --mode development --watch"},"dependencies":{"jupyter-tablewidgets":"^0.3.0","vega":"5.30.0","vega-lite":"4.17.0","vega-embed":"^6.26.0","@jupyter-widgets/base":"6.0.10","@types/webpack-env":"*"},"devDependencies":{"@types/webpack-env":"*","@types/ndarray":"^1.0.14","filemanager-webpack-plugin":"^8.0.0","prettier":"^3.3.3","ts-loader":"^9.5.1","typescript":"^5.0.4","webpack":"^5.94.0","webpack-cli":"^5.1.4"},"files":["dist","src","package.json","tsconfig.json","webpack.config.js","yarn.lock","vega/static/"],"jupyterlab":{"extension":"vega/static/labplugin","sharedPackages":{"@jupyter-widgets/base":{"bundled":false,"singleton":true}}}}')}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var o=n[e]={exports:{}};return t[e].call(o.exports,o,o.exports,r),o.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(728)})())); //# sourceMappingURL=labplugin.js.map \ No newline at end of file diff --git a/vega/static/labplugin.js.LICENSE.txt b/vega/static/labplugin.js.LICENSE.txt index a24b9663..324568c0 100644 --- a/vega/static/labplugin.js.LICENSE.txt +++ b/vega/static/labplugin.js.LICENSE.txt @@ -1,18 +1,12 @@ +/*! + * https://github.com/Starcounter-Jack/JSON-Patch + * (c) 2017-2021 Joachim Wester + * MIT license + */ + /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ - -/*! - * https://github.com/Starcounter-Jack/JSON-Patch - * (c) 2017-2021 Joachim Wester - * MIT license - */ - -/*! - * https://github.com/Starcounter-Jack/JSON-Patch - * (c) 2017-2022 Joachim Wester - * MIT licensed - */ diff --git a/vega/static/labplugin.js.map b/vega/static/labplugin.js.map index f2ced143..58a84f89 100644 --- a/vega/static/labplugin.js.map +++ b/vega/static/labplugin.js.map @@ -1 +1 @@ -{"version":3,"file":"labplugin.js","mappings":";0DAAA,IAAIA,EAAQ,WACZ,aAEA,SAASC,EAAYC,EAAKC,GACxB,OAAe,MAARA,GAAgBD,aAAeC,CACxC,CAEA,IAAIC,EASAC,EAOAC,EAfJ,IACEF,EAAYG,GACd,CAAE,MAAMC,GAGNJ,EAAY,WAAY,CAC1B,CAGA,IACEC,EAAYI,GACd,CAAE,MAAMD,GACNH,EAAY,WAAY,CAC1B,CAGA,IACEC,EAAgBI,OAClB,CAAE,MAAMF,GACNF,EAAgB,WAAY,CAC9B,CAuBA,SAASN,EAAMW,EAAQC,EAAUC,EAAOC,EAAWC,GACzB,iBAAbH,IACTC,EAAQD,EAASC,MACjBC,EAAYF,EAASE,UACrBC,EAAuBH,EAASG,qBAChCH,EAAWA,EAASA,UAItB,IAAII,EAAa,GACbC,EAAc,GAEdC,EAA6B,oBAAVC,OA0IvB,YAxIuB,IAAZP,IACTA,GAAW,QAEO,IAATC,IACTA,EAAQO,KAGV,SAASC,EAAOV,EAAQE,GAEtB,GAAe,OAAXF,EACF,OAAO,KAET,GAAc,IAAVE,EACF,OAAOF,EAET,IAAIW,EACAC,EACJ,GAAqB,iBAAVZ,EACT,OAAOA,EAGT,GAAIV,EAAYU,EAAQP,GACtBkB,EAAQ,IAAIlB,OACP,GAAIH,EAAYU,EAA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C,GAOX,OAHAm1P,EAAoBF,GAAU11P,KAAKQ,EAAOC,QAASD,EAAQA,EAAOC,QAASg1P,GAGpEj1P,EAAOC,OACf,QCrBAg1P,EAAoBztP,EAAKxH,IACxB,IAAIu0C,EAASv0C,GAAUA,EAAOq1P,WAC7B,IAAOr1P,EAAiB,QACxB,IAAM,EAEP,OADAi1P,EAAoBpnO,EAAE0mB,EAAQ,CAAE9zB,EAAG8zB,IAC5BA,CAAM,ECLd0gN,EAAoBpnO,EAAI,CAAC5tB,EAASg2D,KACjC,IAAI,IAAI73D,KAAO63D,EACXg/L,EAAoB31P,EAAE22D,EAAY73D,KAAS62P,EAAoB31P,EAAEW,EAAS7B,IAC5ER,OAAOqB,eAAegB,EAAS7B,EAAK,CAAEY,YAAY,EAAM+jB,IAAKkzC,EAAW73D,IAE1E,ECND62P,EAAoBvsP,EAAI,WACvB,GAA0B,iBAAf4sP,WAAyB,OAAOA,WAC3C,IACC,OAAOl1P,MAAQ,IAAIqF,SAAS,cAAb,EAChB,CAAE,MAAOwJ,GACR,GAAsB,iBAAXxG,OAAqB,OAAOA,MACxC,CACA,CAPuB,GCAxBwsP,EAAoB31P,EAAI,CAACnE,EAAK8+D,IAAUr8D,OAAO7B,UAAU2Y,eAAelV,KAAKrE,EAAK8+D,GCClFg7L,EAAoBlvO,EAAK9lB,IACH,oBAAXqkB,QAA0BA,OAAO83N,aAC1Cx+O,OAAOqB,eAAegB,EAASqkB,OAAO83N,YAAa,CAAEx/O,MAAO,WAE7DgB,OAAOqB,eAAegB,EAAS,aAAc,CAAErD,OAAO,GAAO,ECFpCq4P,EAAoB","sources":["webpack://jupyter-vega/./node_modules/clone/clone.js","webpack://jupyter-vega/./node_modules/cwise-compiler/compiler.js","webpack://jupyter-vega/./node_modules/cwise-compiler/lib/compile.js","webpack://jupyter-vega/./node_modules/cwise-compiler/lib/thunk.js","webpack://jupyter-vega/./node_modules/cwise-parser/index.js","webpack://jupyter-vega/./node_modules/cwise/lib/cwise-esprima.js","webpack://jupyter-vega/./node_modules/dup/dup.js","webpack://jupyter-vega/./node_modules/esprima/esprima.js","webpack://jupyter-vega/./node_modules/fast-deep-equal/index.js","webpack://jupyter-vega/./node_modules/fast-json-stable-stringify/index.js","webpack://jupyter-vega/./node_modules/iota-array/iota.js","webpack://jupyter-vega/./node_modules/is-buffer/index.js","webpack://jupyter-vega/./node_modules/jupyter-tablewidgets/lib/compression.js","webpack://jupyter-vega/./node_modules/jupyter-tablewidgets/lib/index.js","webpack://jupyter-vega/./node_modules/jupyter-tablewidgets/lib/serializers.js","webpack://jupyter-vega/./node_modules/jupyter-tablewidgets/lib/widgets.js","webpack://jupyter-vega/./node_modules/lz4js/lz4.js","webpack://jupyter-vega/./node_modules/lz4js/util.js","webpack://jupyter-vega/./node_modules/lz4js/xxh32.js","webpack://jupyter-vega/./node_modules/ndarray-unpack/unpack.js","webpack://jupyter-vega/./node_modules/ndarray/ndarray.js","webpack://jupyter-vega/./node_modules/pako/index.js","webpack://jupyter-vega/./node_modules/pako/lib/deflate.js","webpack://jupyter-vega/./node_modules/pako/lib/inflate.js","webpack://jupyter-vega/./node_modules/pako/lib/utils/common.js","webpack://jupyter-vega/./node_modules/pako/lib/utils/strings.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/adler32.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/constants.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/crc32.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/deflate.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/gzheader.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/inffast.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/inflate.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/inftrees.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/messages.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/trees.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/zstream.js","webpack://jupyter-vega/./src/index.ts","webpack://jupyter-vega/./src/labplugin.ts","webpack://jupyter-vega/./src/version.ts","webpack://jupyter-vega/./src/widget.ts","webpack://jupyter-vega/./node_modules/uniq/uniq.js","webpack://jupyter-vega/./node_modules/fast-json-patch/module/helpers.mjs","webpack://jupyter-vega/./node_modules/fast-json-patch/module/core.mjs","webpack://jupyter-vega/./node_modules/fast-json-patch/module/duplex.mjs","webpack://jupyter-vega/./node_modules/fast-json-patch/index.mjs","webpack://jupyter-vega/./node_modules/vega-util/build/vega-util.module.js","webpack://jupyter-vega/./node_modules/d3-dsv/src/dsv.js","webpack://jupyter-vega/./node_modules/topojson-client/src/identity.js","webpack://jupyter-vega/./node_modules/topojson-client/src/feature.js","webpack://jupyter-vega/./node_modules/topojson-client/src/transform.js","webpack://jupyter-vega/./node_modules/topojson-client/src/reverse.js","webpack://jupyter-vega/./node_modules/topojson-client/src/stitch.js","webpack://jupyter-vega/./node_modules/topojson-client/src/mesh.js","webpack://jupyter-vega/./node_modules/d3-array/src/ticks.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatSpecifier.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatPrefixAuto.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatDecimal.js","webpack://jupyter-vega/./node_modules/d3-format/src/exponent.js","webpack://jupyter-vega/./node_modules/d3-format/src/precisionPrefix.js","webpack://jupyter-vega/./node_modules/d3-format/src/precisionRound.js","webpack://jupyter-vega/./node_modules/d3-format/src/precisionFixed.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatRounded.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatTypes.js","webpack://jupyter-vega/./node_modules/d3-format/src/identity.js","webpack://jupyter-vega/./node_modules/d3-format/src/locale.js","webpack://jupyter-vega/./node_modules/d3-format/src/defaultLocale.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatGroup.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatNumerals.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatTrim.js","webpack://jupyter-vega/./node_modules/d3-time/src/interval.js","webpack://jupyter-vega/./node_modules/d3-time/src/duration.js","webpack://jupyter-vega/./node_modules/d3-time/src/day.js","webpack://jupyter-vega/./node_modules/d3-time/src/week.js","webpack://jupyter-vega/./node_modules/d3-time/src/year.js","webpack://jupyter-vega/./node_modules/d3-time/src/month.js","webpack://jupyter-vega/./node_modules/d3-time/src/hour.js","webpack://jupyter-vega/./node_modules/d3-time/src/minute.js","webpack://jupyter-vega/./node_modules/d3-time/src/second.js","webpack://jupyter-vega/./node_modules/d3-time/src/millisecond.js","webpack://jupyter-vega/./node_modules/d3-array/src/ascending.js","webpack://jupyter-vega/./node_modules/d3-array/src/descending.js","webpack://jupyter-vega/./node_modules/d3-array/src/bisector.js","webpack://jupyter-vega/./node_modules/vega-time/build/vega-time.module.js","webpack://jupyter-vega/./node_modules/d3-time-format/src/locale.js","webpack://jupyter-vega/./node_modules/d3-time-format/src/defaultLocale.js","webpack://jupyter-vega/./node_modules/vega-format/build/vega-format.module.js","webpack://jupyter-vega/./node_modules/vega-loader/build/vega-loader.browser.module.js","webpack://jupyter-vega/./node_modules/vega-dataflow/build/vega-dataflow.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/max.js","webpack://jupyter-vega/./node_modules/d3-array/src/min.js","webpack://jupyter-vega/./node_modules/d3-array/src/sort.js","webpack://jupyter-vega/./node_modules/d3-array/src/quickselect.js","webpack://jupyter-vega/./node_modules/d3-array/src/number.js","webpack://jupyter-vega/./node_modules/d3-array/src/quantile.js","webpack://jupyter-vega/./node_modules/d3-array/src/median.js","webpack://jupyter-vega/./node_modules/vega-statistics/build/vega-statistics.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/deviation.js","webpack://jupyter-vega/./node_modules/d3-array/src/variance.js","webpack://jupyter-vega/./node_modules/d3-array/src/range.js","webpack://jupyter-vega/./node_modules/vega-transforms/build/vega-transforms.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/mean.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/basis.js","webpack://jupyter-vega/./node_modules/d3-shape/src/noop.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/basisClosed.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/basisOpen.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/bundle.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/cardinal.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/cardinalOpen.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/cardinalClosed.js","webpack://jupyter-vega/./node_modules/d3-shape/src/math.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/catmullRom.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/catmullRomClosed.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/catmullRomOpen.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/linear.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/linearClosed.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/monotone.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/natural.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/step.js","webpack://jupyter-vega/./node_modules/d3-shape/src/constant.js","webpack://jupyter-vega/./node_modules/d3-path/src/path.js","webpack://jupyter-vega/./node_modules/d3-shape/src/path.js","webpack://jupyter-vega/./node_modules/d3-shape/src/arc.js","webpack://jupyter-vega/./node_modules/d3-shape/src/array.js","webpack://jupyter-vega/./node_modules/d3-shape/src/point.js","webpack://jupyter-vega/./node_modules/d3-shape/src/line.js","webpack://jupyter-vega/./node_modules/d3-shape/src/area.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/asterisk.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/circle.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/diamond.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/star.js","webpack://jupyter-vega/./node_modules/vega-canvas/build/vega-canvas.browser.module.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/triangle.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/triangle2.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/wye.js","webpack://jupyter-vega/./node_modules/d3-array/src/bisect.js","webpack://jupyter-vega/./node_modules/d3-color/src/define.js","webpack://jupyter-vega/./node_modules/d3-color/src/color.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/basis.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/basisClosed.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/constant.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/color.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/rgb.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/numberArray.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/array.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/date.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/number.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/object.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/string.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/value.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/round.js","webpack://jupyter-vega/./node_modules/d3-scale/src/number.js","webpack://jupyter-vega/./node_modules/d3-scale/src/continuous.js","webpack://jupyter-vega/./node_modules/d3-scale/src/constant.js","webpack://jupyter-vega/./node_modules/d3-scale/src/init.js","webpack://jupyter-vega/./node_modules/d3-scale/src/tickFormat.js","webpack://jupyter-vega/./node_modules/d3-scale/src/linear.js","webpack://jupyter-vega/./node_modules/d3-scale/src/nice.js","webpack://jupyter-vega/./node_modules/d3-scale/src/log.js","webpack://jupyter-vega/./node_modules/d3-scale/src/pow.js","webpack://jupyter-vega/./node_modules/d3-scale/src/symlog.js","webpack://jupyter-vega/./node_modules/d3-time/src/ticks.js","webpack://jupyter-vega/./node_modules/d3-scale/src/time.js","webpack://jupyter-vega/./node_modules/d3-scale/src/sequential.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/piecewise.js","webpack://jupyter-vega/./node_modules/d3-scale/src/diverging.js","webpack://jupyter-vega/./node_modules/internmap/src/index.js","webpack://jupyter-vega/./node_modules/d3-scale/src/ordinal.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/discrete.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/hue.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/transform/decompose.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/transform/parse.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/transform/index.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/zoom.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/hsl.js","webpack://jupyter-vega/./node_modules/d3-color/src/math.js","webpack://jupyter-vega/./node_modules/d3-color/src/lab.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/lab.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/hcl.js","webpack://jupyter-vega/./node_modules/d3-color/src/cubehelix.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/cubehelix.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/quantize.js","webpack://jupyter-vega/./node_modules/vega-scale/build/vega-scale.module.js","webpack://jupyter-vega/./node_modules/d3-scale/src/identity.js","webpack://jupyter-vega/./node_modules/d3-scale/src/utcTime.js","webpack://jupyter-vega/./node_modules/d3-scale/src/quantile.js","webpack://jupyter-vega/./node_modules/d3-scale/src/quantize.js","webpack://jupyter-vega/./node_modules/d3-scale/src/threshold.js","webpack://jupyter-vega/./node_modules/vega-scenegraph/build/vega-scenegraph.module.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol.js","webpack://jupyter-vega/./node_modules/vega-view-transforms/build/vega-view-transforms.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/sum.js","webpack://jupyter-vega/./node_modules/vega-encode/build/vega-encode.module.js","webpack://jupyter-vega/./node_modules/d3-geo/src/identity.js","webpack://jupyter-vega/./node_modules/d3-geo/src/stream.js","webpack://jupyter-vega/./node_modules/d3-array/src/fsum.js","webpack://jupyter-vega/./node_modules/d3-geo/src/math.js","webpack://jupyter-vega/./node_modules/d3-geo/src/noop.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/area.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/bounds.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/centroid.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/context.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/measure.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/string.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/index.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/buffer.js","webpack://jupyter-vega/./node_modules/d3-geo/src/pointEqual.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/rejoin.js","webpack://jupyter-vega/./node_modules/d3-geo/src/cartesian.js","webpack://jupyter-vega/./node_modules/d3-geo/src/polygonContains.js","webpack://jupyter-vega/./node_modules/d3-array/src/merge.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/index.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/antimeridian.js","webpack://jupyter-vega/./node_modules/d3-geo/src/circle.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/rectangle.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/line.js","webpack://jupyter-vega/./node_modules/d3-geo/src/compose.js","webpack://jupyter-vega/./node_modules/d3-geo/src/rotation.js","webpack://jupyter-vega/./node_modules/d3-geo/src/transform.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/fit.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/resample.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/index.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/circle.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/conic.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/conicEqualArea.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/cylindricalEqualArea.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/albers.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/azimuthal.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/azimuthalEqualArea.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/azimuthalEquidistant.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/mercator.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/conicConformal.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/equirectangular.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/conicEquidistant.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/equalEarth.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/gnomonic.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/naturalEarth1.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/orthographic.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/stereographic.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/transverseMercator.js","webpack://jupyter-vega/./node_modules/d3-geo-projection/src/math.js","webpack://jupyter-vega/./node_modules/d3-geo-projection/src/mollweide.js","webpack://jupyter-vega/./node_modules/vega-projection/build/vega-projection.module.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/albersUsa.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/identity.js","webpack://jupyter-vega/./node_modules/d3-geo/src/graticule.js","webpack://jupyter-vega/./node_modules/vega-geo/build/vega-geo.module.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/add.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/quad.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/x.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/y.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/quadtree.js","webpack://jupyter-vega/./node_modules/d3-force/src/constant.js","webpack://jupyter-vega/./node_modules/d3-force/src/jiggle.js","webpack://jupyter-vega/./node_modules/d3-force/src/collide.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/cover.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/data.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/extent.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/find.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/remove.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/root.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/size.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/visit.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/visitAfter.js","webpack://jupyter-vega/./node_modules/d3-dispatch/src/dispatch.js","webpack://jupyter-vega/./node_modules/d3-timer/src/timer.js","webpack://jupyter-vega/./node_modules/d3-force/src/lcg.js","webpack://jupyter-vega/./node_modules/d3-force/src/simulation.js","webpack://jupyter-vega/./node_modules/d3-force/src/link.js","webpack://jupyter-vega/./node_modules/vega-force/build/vega-force.module.js","webpack://jupyter-vega/./node_modules/d3-force/src/center.js","webpack://jupyter-vega/./node_modules/d3-force/src/manyBody.js","webpack://jupyter-vega/./node_modules/d3-force/src/x.js","webpack://jupyter-vega/./node_modules/d3-force/src/y.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/count.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/index.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/accessors.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/constant.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/each.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/eachAfter.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/eachBefore.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/find.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/sum.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/sort.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/path.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/ancestors.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/descendants.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/leaves.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/links.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/iterator.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/lcg.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/pack/enclose.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/pack/siblings.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/array.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/pack/index.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/round.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/dice.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/stratify.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/tree.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/cluster.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/slice.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/squarify.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/resquarify.js","webpack://jupyter-vega/./node_modules/vega-hierarchy/build/vega-hierarchy.module.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/partition.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/binary.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/sliceDice.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/index.js","webpack://jupyter-vega/./node_modules/vega-label/build/vega-label.module.js","webpack://jupyter-vega/./node_modules/vega-regression/build/vega-regression.module.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/util.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/orient2d.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/orient3d.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/incircle.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/insphere.js","webpack://jupyter-vega/./node_modules/delaunator/index.js","webpack://jupyter-vega/./node_modules/d3-delaunay/src/path.js","webpack://jupyter-vega/./node_modules/d3-delaunay/src/polygon.js","webpack://jupyter-vega/./node_modules/d3-delaunay/src/voronoi.js","webpack://jupyter-vega/./node_modules/d3-delaunay/src/delaunay.js","webpack://jupyter-vega/./node_modules/vega-voronoi/build/vega-voronoi.module.js","webpack://jupyter-vega/./node_modules/vega-wordcloud/build/vega-wordcloud.module.js","webpack://jupyter-vega/./node_modules/vega-crossfilter/build/vega-crossfilter.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/permute.js","webpack://jupyter-vega/./node_modules/vega-expression/build/vega-expression.module.js","webpack://jupyter-vega/./node_modules/d3-geo/src/area.js","webpack://jupyter-vega/./node_modules/d3-geo/src/bounds.js","webpack://jupyter-vega/./node_modules/d3-geo/src/centroid.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/ascending.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/descending.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/bisector.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/intersection.js","webpack://jupyter-vega/./node_modules/vega-selections/build/vega-selection.module.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/union.js","webpack://jupyter-vega/./node_modules/vega-functions/build/vega-functions.module.js","webpack://jupyter-vega/./node_modules/vega-runtime/build/vega-runtime.module.js","webpack://jupyter-vega/./node_modules/vega-view/build/vega-view.module.js","webpack://jupyter-vega/./node_modules/d3-timer/src/interval.js","webpack://jupyter-vega/./node_modules/vega-event-selector/build/vega-event-selector.module.js","webpack://jupyter-vega/./node_modules/vega-parser/build/vega-parser.module.js","webpack://jupyter-vega/./node_modules/vega/build/vega.module.js","webpack://jupyter-vega/./node_modules/vega-interpreter/build/vega-interpreter.module.js","webpack://jupyter-vega/./node_modules/vega-lite/node_modules/vega-util/build/vega-util.module.js","webpack://jupyter-vega/./node_modules/array-flat-polyfill/index.mjs","webpack://jupyter-vega/./node_modules/vega-lite/build/src/logical.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/util.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/axis.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/aggregate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/channel.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/bin.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/log/message.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/log/index.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/datetime.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/timeunit.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/vega.schema.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/predicate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/type.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/scale.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/expr.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/mark.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/valueref.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/format.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/sort.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/facet.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/channeldef.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/title.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/common.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/unit.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/base.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/encoding.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/common.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/boxplot.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/errorbar.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/errorband.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/index.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/guide.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/header.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/legend.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/parameter.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/selection.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/concat.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/base.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/config.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/layer.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/map.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/repeat.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/stack.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/pathoverlay.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/rangestep.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/repeater.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/ruleforrangedline.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/core.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/index.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/toplevel.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/split.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/index.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/data.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/transform.js","webpack://jupyter-vega/./node_modules/vega-lite/node_modules/vega-event-selector/build/vega-event-selector.module.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/conditional.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/text.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/tooltip.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/nonposition.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/color.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/offset.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/position-point.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/position-align.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/position-range.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/position-rect.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/base.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/zindex.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/aria.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/defined.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/nearest.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/dataflow.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/timeunit.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/project.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/inputs.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/toggle.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/clear.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/scales.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/legends.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/translate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/zoom.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/transforms.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/interval.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/multi.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/single.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/index.js","webpack://jupyter-vega/./node_modules/vega-lite/node_modules/vega-expression/node_modules/vega-util/build/vega-util.module.js","webpack://jupyter-vega/./node_modules/vega-lite/node_modules/vega-expression/build/vega-expression.module.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/expressions.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/filter.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/predicate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/config.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/properties.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/calculate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/header/common.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/header/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/header/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layoutsize/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layoutsize/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/guide.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/resolve.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/encode.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/properties.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/projection/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/projection.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/projection/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/projection/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/bin.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/aggregate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/facet.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/formatparse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/identifier.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/graticule.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/sequence.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/source.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/optimizer.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/optimizers.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/joinaggregate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/stack.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/window.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/subtree.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/optimize.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/signal.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/domain.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/range.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/properties.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/type.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/model.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/density.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/filterinvalid.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/flatten.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/fold.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/geojson.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/geopoint.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/impute.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/loess.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/lookup.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/quantile.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/regression.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/pivot.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/sample.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/header/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layoutsize/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/facet.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/joinaggregatefacet.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/concat.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/encode.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/point.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/tick.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/mark.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/arc.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/area.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/bar.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/geoshape.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/image.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/line.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/rect.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/rule.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/text.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/unit.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/init.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layoutsize/init.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layer.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/buildmodel.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/compile.js","webpack://jupyter-vega/./node_modules/vega-schema-url-parser/dist/parser.module.js","webpack://jupyter-vega/./node_modules/vega-themes/build/vega-themes.module.js","webpack://jupyter-vega/./node_modules/vega-tooltip/build/vega-tooltip.module.js","webpack://jupyter-vega/./node_modules/vega-embed/build/vega-embed.module.js","webpack://jupyter-vega/external amd \"@jupyter-widgets/base\"","webpack://jupyter-vega/./node_modules/json-stringify-pretty-compact/index.js","webpack://jupyter-vega/webpack/bootstrap","webpack://jupyter-vega/webpack/runtime/compat get default export","webpack://jupyter-vega/webpack/runtime/define property getters","webpack://jupyter-vega/webpack/runtime/global","webpack://jupyter-vega/webpack/runtime/hasOwnProperty shorthand","webpack://jupyter-vega/webpack/runtime/make namespace object","webpack://jupyter-vega/webpack/startup"],"sourcesContent":["var clone = (function() {\n'use strict';\n\nfunction _instanceof(obj, type) {\n return type != null && obj instanceof type;\n}\n\nvar nativeMap;\ntry {\n nativeMap = Map;\n} catch(_) {\n // maybe a reference error because no `Map`. Give it a dummy value that no\n // value will ever be an instanceof.\n nativeMap = function() {};\n}\n\nvar nativeSet;\ntry {\n nativeSet = Set;\n} catch(_) {\n nativeSet = function() {};\n}\n\nvar nativePromise;\ntry {\n nativePromise = Promise;\n} catch(_) {\n nativePromise = function() {};\n}\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n * @param `includeNonEnumerable` - set to true if the non-enumerable properties\n * should be cloned as well. Non-enumerable properties on the prototype\n * chain will be ignored. (optional - false by default)\n*/\nfunction clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n}\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n}\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n}\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n}\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n}\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif (typeof module === 'object' && module.exports) {\n module.exports = clone;\n}\n","\"use strict\"\n\nvar createThunk = require(\"./lib/thunk.js\")\n\nfunction Procedure() {\n this.argTypes = []\n this.shimArgs = []\n this.arrayArgs = []\n this.arrayBlockIndices = []\n this.scalarArgs = []\n this.offsetArgs = []\n this.offsetArgIndex = []\n this.indexArgs = []\n this.shapeArgs = []\n this.funcName = \"\"\n this.pre = null\n this.body = null\n this.post = null\n this.debug = false\n}\n\nfunction compileCwise(user_args) {\n //Create procedure\n var proc = new Procedure()\n \n //Parse blocks\n proc.pre = user_args.pre\n proc.body = user_args.body\n proc.post = user_args.post\n\n //Parse arguments\n var proc_args = user_args.args.slice(0)\n proc.argTypes = proc_args\n for(var i=0; i0) {\n throw new Error(\"cwise: pre() block may not reference array args\")\n }\n if(i < proc.post.args.length && proc.post.args[i].count>0) {\n throw new Error(\"cwise: post() block may not reference array args\")\n }\n } else if(arg_type === \"scalar\") {\n proc.scalarArgs.push(i)\n proc.shimArgs.push(\"scalar\" + i)\n } else if(arg_type === \"index\") {\n proc.indexArgs.push(i)\n if(i < proc.pre.args.length && proc.pre.args[i].count > 0) {\n throw new Error(\"cwise: pre() block may not reference array index\")\n }\n if(i < proc.body.args.length && proc.body.args[i].lvalue) {\n throw new Error(\"cwise: body() block may not write to array index\")\n }\n if(i < proc.post.args.length && proc.post.args[i].count > 0) {\n throw new Error(\"cwise: post() block may not reference array index\")\n }\n } else if(arg_type === \"shape\") {\n proc.shapeArgs.push(i)\n if(i < proc.pre.args.length && proc.pre.args[i].lvalue) {\n throw new Error(\"cwise: pre() block may not write to array shape\")\n }\n if(i < proc.body.args.length && proc.body.args[i].lvalue) {\n throw new Error(\"cwise: body() block may not write to array shape\")\n }\n if(i < proc.post.args.length && proc.post.args[i].lvalue) {\n throw new Error(\"cwise: post() block may not write to array shape\")\n }\n } else if(typeof arg_type === \"object\" && arg_type.offset) {\n proc.argTypes[i] = \"offset\"\n proc.offsetArgs.push({ array: arg_type.array, offset:arg_type.offset })\n proc.offsetArgIndex.push(i)\n } else {\n throw new Error(\"cwise: Unknown argument type \" + proc_args[i])\n }\n }\n \n //Make sure at least one array argument was specified\n if(proc.arrayArgs.length <= 0) {\n throw new Error(\"cwise: No array arguments specified\")\n }\n \n //Make sure arguments are correct\n if(proc.pre.args.length > proc_args.length) {\n throw new Error(\"cwise: Too many arguments in pre() block\")\n }\n if(proc.body.args.length > proc_args.length) {\n throw new Error(\"cwise: Too many arguments in body() block\")\n }\n if(proc.post.args.length > proc_args.length) {\n throw new Error(\"cwise: Too many arguments in post() block\")\n }\n\n //Check debug flag\n proc.debug = !!user_args.printCode || !!user_args.debug\n \n //Retrieve name\n proc.funcName = user_args.funcName || \"cwise\"\n \n //Read in block size\n proc.blockSize = user_args.blockSize || 64\n\n return createThunk(proc)\n}\n\nmodule.exports = compileCwise\n","\"use strict\"\n\nvar uniq = require(\"uniq\")\n\n// This function generates very simple loops analogous to how you typically traverse arrays (the outermost loop corresponds to the slowest changing index, the innermost loop to the fastest changing index)\n// TODO: If two arrays have the same strides (and offsets) there is potential for decreasing the number of \"pointers\" and related variables. The drawback is that the type signature would become more specific and that there would thus be less potential for caching, but it might still be worth it, especially when dealing with large numbers of arguments.\nfunction innerFill(order, proc, body) {\n var dimension = order.length\n , nargs = proc.arrayArgs.length\n , has_index = proc.indexArgs.length>0\n , code = []\n , vars = []\n , idx=0, pidx=0, i, j\n for(i=0; i 0) {\n code.push(\"var \" + vars.join(\",\"))\n } \n //Scan loop\n for(i=dimension-1; i>=0; --i) { // Start at largest stride and work your way inwards\n idx = order[i]\n code.push([\"for(i\",i,\"=0;i\",i,\" 0) {\n code.push([\"index[\",pidx,\"]-=s\",pidx].join(\"\"))\n }\n code.push([\"++index[\",idx,\"]\"].join(\"\"))\n }\n code.push(\"}\")\n }\n return code.join(\"\\n\")\n}\n\n// Generate \"outer\" loops that loop over blocks of data, applying \"inner\" loops to the blocks by manipulating the local variables in such a way that the inner loop only \"sees\" the current block.\n// TODO: If this is used, then the previous declaration (done by generateCwiseOp) of s* is essentially unnecessary.\n// I believe the s* are not used elsewhere (in particular, I don't think they're used in the pre/post parts and \"shape\" is defined independently), so it would be possible to make defining the s* dependent on what loop method is being used.\nfunction outerFill(matched, order, proc, body) {\n var dimension = order.length\n , nargs = proc.arrayArgs.length\n , blockSize = proc.blockSize\n , has_index = proc.indexArgs.length > 0\n , code = []\n for(var i=0; i0;){\"].join(\"\")) // Iterate back to front\n code.push([\"if(j\",i,\"<\",blockSize,\"){\"].join(\"\")) // Either decrease j by blockSize (s = blockSize), or set it to zero (after setting s = j).\n code.push([\"s\",order[i],\"=j\",i].join(\"\"))\n code.push([\"j\",i,\"=0\"].join(\"\"))\n code.push([\"}else{s\",order[i],\"=\",blockSize].join(\"\"))\n code.push([\"j\",i,\"-=\",blockSize,\"}\"].join(\"\"))\n if(has_index) {\n code.push([\"index[\",order[i],\"]=j\",i].join(\"\"))\n }\n }\n for(var i=0; i 0) {\n allEqual = allEqual && summary[i] === summary[i-1]\n }\n }\n if(allEqual) {\n return summary[0]\n }\n return summary.join(\"\")\n}\n\n//Generates a cwise operator\nfunction generateCWiseOp(proc, typesig) {\n\n //Compute dimension\n // Arrays get put first in typesig, and there are two entries per array (dtype and order), so this gets the number of dimensions in the first array arg.\n var dimension = (typesig[1].length - Math.abs(proc.arrayBlockIndices[0]))|0\n var orders = new Array(proc.arrayArgs.length)\n var dtypes = new Array(proc.arrayArgs.length)\n for(var i=0; i 0) {\n vars.push(\"shape=SS.slice(0)\") // Makes the shape over which we iterate available to the user defined functions (so you can use width/height for example)\n }\n if(proc.indexArgs.length > 0) {\n // Prepare an array to keep track of the (logical) indices, initialized to dimension zeroes.\n var zeros = new Array(dimension)\n for(var i=0; i 0) {\n code.push(\"var \" + vars.join(\",\"))\n }\n for(var i=0; i 3) {\n code.push(processBlock(proc.pre, proc, dtypes))\n }\n\n //Process body\n var body = processBlock(proc.body, proc, dtypes)\n var matched = countMatches(loopOrders)\n if(matched < dimension) {\n code.push(outerFill(matched, loopOrders[0], proc, body)) // TODO: Rather than passing loopOrders[0], it might be interesting to look at passing an order that represents the majority of the arguments for example.\n } else {\n code.push(innerFill(loopOrders[0], proc, body))\n }\n\n //Inline epilog\n if(proc.post.body.length > 3) {\n code.push(processBlock(proc.post, proc, dtypes))\n }\n \n if(proc.debug) {\n console.log(\"-----Generated cwise routine for \", typesig, \":\\n\" + code.join(\"\\n\") + \"\\n----------\")\n }\n \n var loopName = [(proc.funcName||\"unnamed\"), \"_cwise_loop_\", orders[0].join(\"s\"),\"m\",matched,typeSummary(dtypes)].join(\"\")\n var f = new Function([\"function \",loopName,\"(\", arglist.join(\",\"),\"){\", code.join(\"\\n\"),\"} return \", loopName].join(\"\"))\n return f()\n}\nmodule.exports = generateCWiseOp\n","\"use strict\"\n\n// The function below is called when constructing a cwise function object, and does the following:\n// A function object is constructed which accepts as argument a compilation function and returns another function.\n// It is this other function that is eventually returned by createThunk, and this function is the one that actually\n// checks whether a certain pattern of arguments has already been used before and compiles new loops as needed.\n// The compilation passed to the first function object is used for compiling new functions.\n// Once this function object is created, it is called with compile as argument, where the first argument of compile\n// is bound to \"proc\" (essentially containing a preprocessed version of the user arguments to cwise).\n// So createThunk roughly works like this:\n// function createThunk(proc) {\n// var thunk = function(compileBound) {\n// var CACHED = {}\n// return function(arrays and scalars) {\n// if (dtype and order of arrays in CACHED) {\n// var func = CACHED[dtype and order of arrays]\n// } else {\n// var func = CACHED[dtype and order of arrays] = compileBound(dtype and order of arrays)\n// }\n// return func(arrays and scalars)\n// }\n// }\n// return thunk(compile.bind1(proc))\n// }\n\nvar compile = require(\"./compile.js\")\n\nfunction createThunk(proc) {\n var code = [\"'use strict'\", \"var CACHED={}\"]\n var vars = []\n var thunkName = proc.funcName + \"_cwise_thunk\"\n \n //Build thunk\n code.push([\"return function \", thunkName, \"(\", proc.shimArgs.join(\",\"), \"){\"].join(\"\"))\n var typesig = []\n var string_typesig = []\n var proc_args = [[\"array\",proc.arrayArgs[0],\".shape.slice(\", // Slice shape so that we only retain the shape over which we iterate (which gets passed to the cwise operator as SS).\n Math.max(0,proc.arrayBlockIndices[0]),proc.arrayBlockIndices[0]<0?(\",\"+proc.arrayBlockIndices[0]+\")\"):\")\"].join(\"\")]\n var shapeLengthConditions = [], shapeConditions = []\n // Process array arguments\n for(var i=0; i0) { // Gather conditions to check for shape equality (ignoring block indices)\n shapeLengthConditions.push(\"array\" + proc.arrayArgs[0] + \".shape.length===array\" + j + \".shape.length+\" + (Math.abs(proc.arrayBlockIndices[0])-Math.abs(proc.arrayBlockIndices[i])))\n shapeConditions.push(\"array\" + proc.arrayArgs[0] + \".shape[shapeIndex+\" + Math.max(0,proc.arrayBlockIndices[0]) + \"]===array\" + j + \".shape[shapeIndex+\" + Math.max(0,proc.arrayBlockIndices[i]) + \"]\")\n }\n }\n // Check for shape equality\n if (proc.arrayArgs.length > 1) {\n code.push(\"if (!(\" + shapeLengthConditions.join(\" && \") + \")) throw new Error('cwise: Arrays do not all have the same dimensionality!')\")\n code.push(\"for(var shapeIndex=array\" + proc.arrayArgs[0] + \".shape.length-\" + Math.abs(proc.arrayBlockIndices[0]) + \"; shapeIndex-->0;) {\")\n code.push(\"if (!(\" + shapeConditions.join(\" && \") + \")) throw new Error('cwise: Arrays do not all have the same shape!')\")\n code.push(\"}\")\n }\n // Process scalar arguments\n for(var i=0; i= 0) {\n var carg = compiledArgs[argNo]\n var usage = getUsage(node)\n if(usage & LVALUE) {\n carg.lvalue = true\n }\n if(usage & RVALUE) {\n carg.rvalue = true\n }\n ++carg.count\n rewrite(node, carg.name)\n } else if(isGlobal(name)) {\n //Don't rewrite globals\n } else {\n rewrite(node, createLocal(name))\n }\n } else if(node.type === \"Literal\") {\n if(typeof node.value === \"string\") {\n rewrite(node, escapeString(node.value))\n }\n } else if(node.type === \"WithStatement\") {\n throw new Error(\"cwise-parser: with() statements not allowed\")\n } else {\n //Visit all children\n var keys = Object.keys(node)\n for(var i=0, n=keys.length; i 0) {\n return dupe_number(count|0, value)\n }\n break\n case \"object\":\n if(typeof (count.length) === \"number\") {\n return dupe_array(count, value, 0)\n }\n break\n }\n return []\n}\n\nmodule.exports = dupe","/*\n Copyright (C) 2013 Ariya Hidayat \n Copyright (C) 2013 Thaddee Tyl \n Copyright (C) 2013 Mathias Bynens \n Copyright (C) 2012 Ariya Hidayat \n Copyright (C) 2012 Mathias Bynens \n Copyright (C) 2012 Joost-Wim Boekesteijn \n Copyright (C) 2012 Kris Kowal \n Copyright (C) 2012 Yusuke Suzuki \n Copyright (C) 2012 Arpad Borsos \n Copyright (C) 2011 Ariya Hidayat \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n/*jslint bitwise:true plusplus:true */\n/*global esprima:true, define:true, exports:true, window: true,\nthrowErrorTolerant: true,\nthrowError: true, generateStatement: true, peek: true,\nparseAssignmentExpression: true, parseBlock: true, parseExpression: true,\nparseFunctionDeclaration: true, parseFunctionExpression: true,\nparseFunctionSourceElements: true, parseVariableIdentifier: true,\nparseLeftHandSideExpression: true,\nparseUnaryExpression: true,\nparseStatement: true, parseSourceElement: true */\n\n(function (root, factory) {\n 'use strict';\n\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js,\n // Rhino, and plain browser loading.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define(['exports'], factory);\n } else if (typeof exports !== 'undefined') {\n factory(exports);\n } else {\n factory((root.esprima = {}));\n }\n}(this, function (exports) {\n 'use strict';\n\n var Token,\n TokenName,\n FnExprTokens,\n Syntax,\n PropertyKind,\n Messages,\n Regex,\n SyntaxTreeDelegate,\n source,\n strict,\n index,\n lineNumber,\n lineStart,\n length,\n delegate,\n lookahead,\n state,\n extra;\n\n Token = {\n BooleanLiteral: 1,\n EOF: 2,\n Identifier: 3,\n Keyword: 4,\n NullLiteral: 5,\n NumericLiteral: 6,\n Punctuator: 7,\n StringLiteral: 8,\n RegularExpression: 9\n };\n\n TokenName = {};\n TokenName[Token.BooleanLiteral] = 'Boolean';\n TokenName[Token.EOF] = '';\n TokenName[Token.Identifier] = 'Identifier';\n TokenName[Token.Keyword] = 'Keyword';\n TokenName[Token.NullLiteral] = 'Null';\n TokenName[Token.NumericLiteral] = 'Numeric';\n TokenName[Token.Punctuator] = 'Punctuator';\n TokenName[Token.StringLiteral] = 'String';\n TokenName[Token.RegularExpression] = 'RegularExpression';\n\n // A function following one of those tokens is an expression.\n FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new',\n 'return', 'case', 'delete', 'throw', 'void',\n // assignment operators\n '=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=',\n '&=', '|=', '^=', ',',\n // binary/unary operators\n '+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&',\n '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=',\n '<=', '<', '>', '!=', '!=='];\n\n Syntax = {\n AssignmentExpression: 'AssignmentExpression',\n ArrayExpression: 'ArrayExpression',\n BlockStatement: 'BlockStatement',\n BinaryExpression: 'BinaryExpression',\n BreakStatement: 'BreakStatement',\n CallExpression: 'CallExpression',\n CatchClause: 'CatchClause',\n ConditionalExpression: 'ConditionalExpression',\n ContinueStatement: 'ContinueStatement',\n DoWhileStatement: 'DoWhileStatement',\n DebuggerStatement: 'DebuggerStatement',\n EmptyStatement: 'EmptyStatement',\n ExpressionStatement: 'ExpressionStatement',\n ForStatement: 'ForStatement',\n ForInStatement: 'ForInStatement',\n FunctionDeclaration: 'FunctionDeclaration',\n FunctionExpression: 'FunctionExpression',\n Identifier: 'Identifier',\n IfStatement: 'IfStatement',\n Literal: 'Literal',\n LabeledStatement: 'LabeledStatement',\n LogicalExpression: 'LogicalExpression',\n MemberExpression: 'MemberExpression',\n NewExpression: 'NewExpression',\n ObjectExpression: 'ObjectExpression',\n Program: 'Program',\n Property: 'Property',\n ReturnStatement: 'ReturnStatement',\n SequenceExpression: 'SequenceExpression',\n SwitchStatement: 'SwitchStatement',\n SwitchCase: 'SwitchCase',\n ThisExpression: 'ThisExpression',\n ThrowStatement: 'ThrowStatement',\n TryStatement: 'TryStatement',\n UnaryExpression: 'UnaryExpression',\n UpdateExpression: 'UpdateExpression',\n VariableDeclaration: 'VariableDeclaration',\n VariableDeclarator: 'VariableDeclarator',\n WhileStatement: 'WhileStatement',\n WithStatement: 'WithStatement'\n };\n\n PropertyKind = {\n Data: 1,\n Get: 2,\n Set: 4\n };\n\n // Error messages should be identical to V8.\n Messages = {\n UnexpectedToken: 'Unexpected token %0',\n UnexpectedNumber: 'Unexpected number',\n UnexpectedString: 'Unexpected string',\n UnexpectedIdentifier: 'Unexpected identifier',\n UnexpectedReserved: 'Unexpected reserved word',\n UnexpectedEOS: 'Unexpected end of input',\n NewlineAfterThrow: 'Illegal newline after throw',\n InvalidRegExp: 'Invalid regular expression',\n UnterminatedRegExp: 'Invalid regular expression: missing /',\n InvalidLHSInAssignment: 'Invalid left-hand side in assignment',\n InvalidLHSInForIn: 'Invalid left-hand side in for-in',\n MultipleDefaultsInSwitch: 'More than one default clause in switch statement',\n NoCatchOrFinally: 'Missing catch or finally after try',\n UnknownLabel: 'Undefined label \\'%0\\'',\n Redeclaration: '%0 \\'%1\\' has already been declared',\n IllegalContinue: 'Illegal continue statement',\n IllegalBreak: 'Illegal break statement',\n IllegalReturn: 'Illegal return statement',\n StrictModeWith: 'Strict mode code may not include a with statement',\n StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',\n StrictVarName: 'Variable name may not be eval or arguments in strict mode',\n StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',\n StrictParamDupe: 'Strict mode function may not have duplicate parameter names',\n StrictFunctionName: 'Function name may not be eval or arguments in strict mode',\n StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',\n StrictDelete: 'Delete of an unqualified identifier in strict mode.',\n StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode',\n AccessorDataProperty: 'Object literal may not have data and accessor property with the same name',\n AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name',\n StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',\n StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',\n StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',\n StrictReservedWord: 'Use of future reserved word in strict mode'\n };\n\n // See also tools/generate-unicode-regex.py.\n Regex = {\n NonAsciiIdentifierStart: new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]'),\n NonAsciiIdentifierPart: new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0\\u08A2-\\u08AC\\u08E4-\\u08FE\\u0900-\\u0963\\u0966-\\u096F\\u0971-\\u0977\\u0979-\\u097F\\u0981-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u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0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1D00-\\u1DE6\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA697\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A\\uAA7B\\uAA80-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE26\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]')\n };\n\n // Ensure the condition is true, otherwise throw an error.\n // This is only to have a better contract semantic, i.e. another safety net\n // to catch a logic error. The condition shall be fulfilled in normal case.\n // Do NOT use this to enforce a certain condition on any user input.\n\n function assert(condition, message) {\n /* istanbul ignore if */\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }\n\n function isDecimalDigit(ch) {\n return (ch >= 48 && ch <= 57); // 0..9\n }\n\n function isHexDigit(ch) {\n return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;\n }\n\n function isOctalDigit(ch) {\n return '01234567'.indexOf(ch) >= 0;\n }\n\n\n // 7.2 White Space\n\n function isWhiteSpace(ch) {\n return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||\n (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);\n }\n\n // 7.3 Line Terminators\n\n function isLineTerminator(ch) {\n return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029);\n }\n\n // 7.6 Identifier Names and Identifiers\n\n function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }\n\n function isIdentifierPart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch >= 0x30 && ch <= 0x39) || // 0..9\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch)));\n }\n\n // 7.6.1.2 Future Reserved Words\n\n function isFutureReservedWord(id) {\n switch (id) {\n case 'class':\n case 'enum':\n case 'export':\n case 'extends':\n case 'import':\n case 'super':\n return true;\n default:\n return false;\n }\n }\n\n function isStrictModeReservedWord(id) {\n switch (id) {\n case 'implements':\n case 'interface':\n case 'package':\n case 'private':\n case 'protected':\n case 'public':\n case 'static':\n case 'yield':\n case 'let':\n return true;\n default:\n return false;\n }\n }\n\n function isRestrictedWord(id) {\n return id === 'eval' || id === 'arguments';\n }\n\n // 7.6.1.1 Keywords\n\n function isKeyword(id) {\n if (strict && isStrictModeReservedWord(id)) {\n return true;\n }\n\n // 'const' is specialized as Keyword in V8.\n // 'yield' and 'let' are for compatiblity with SpiderMonkey and ES.next.\n // Some others are from future reserved words.\n\n switch (id.length) {\n case 2:\n return (id === 'if') || (id === 'in') || (id === 'do');\n case 3:\n return (id === 'var') || (id === 'for') || (id === 'new') ||\n (id === 'try') || (id === 'let');\n case 4:\n return (id === 'this') || (id === 'else') || (id === 'case') ||\n (id === 'void') || (id === 'with') || (id === 'enum');\n case 5:\n return (id === 'while') || (id === 'break') || (id === 'catch') ||\n (id === 'throw') || (id === 'const') || (id === 'yield') ||\n (id === 'class') || (id === 'super');\n case 6:\n return (id === 'return') || (id === 'typeof') || (id === 'delete') ||\n (id === 'switch') || (id === 'export') || (id === 'import');\n case 7:\n return (id === 'default') || (id === 'finally') || (id === 'extends');\n case 8:\n return (id === 'function') || (id === 'continue') || (id === 'debugger');\n case 10:\n return (id === 'instanceof');\n default:\n return false;\n }\n }\n\n // 7.4 Comments\n\n function addComment(type, value, start, end, loc) {\n var comment, attacher;\n\n assert(typeof start === 'number', 'Comment must have valid position');\n\n // Because the way the actual token is scanned, often the comments\n // (if any) are skipped twice during the lexical analysis.\n // Thus, we need to skip adding a comment if the comment array already\n // handled it.\n if (state.lastCommentStart >= start) {\n return;\n }\n state.lastCommentStart = start;\n\n comment = {\n type: type,\n value: value\n };\n if (extra.range) {\n comment.range = [start, end];\n }\n if (extra.loc) {\n comment.loc = loc;\n }\n extra.comments.push(comment);\n if (extra.attachComment) {\n extra.leadingComments.push(comment);\n extra.trailingComments.push(comment);\n }\n }\n\n function skipSingleLineComment(offset) {\n var start, loc, ch, comment;\n\n start = index - offset;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart - offset\n }\n };\n\n while (index < length) {\n ch = source.charCodeAt(index);\n ++index;\n if (isLineTerminator(ch)) {\n if (extra.comments) {\n comment = source.slice(start + offset, index - 1);\n loc.end = {\n line: lineNumber,\n column: index - lineStart - 1\n };\n addComment('Line', comment, start, index - 1, loc);\n }\n if (ch === 13 && source.charCodeAt(index) === 10) {\n ++index;\n }\n ++lineNumber;\n lineStart = index;\n return;\n }\n }\n\n if (extra.comments) {\n comment = source.slice(start + offset, index);\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n addComment('Line', comment, start, index, loc);\n }\n }\n\n function skipMultiLineComment() {\n var start, loc, ch, comment;\n\n if (extra.comments) {\n start = index - 2;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart - 2\n }\n };\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n if (isLineTerminator(ch)) {\n if (ch === 0x0D && source.charCodeAt(index + 1) === 0x0A) {\n ++index;\n }\n ++lineNumber;\n ++index;\n lineStart = index;\n if (index >= length) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n } else if (ch === 0x2A) {\n // Block comment ends with '*/'.\n if (source.charCodeAt(index + 1) === 0x2F) {\n ++index;\n ++index;\n if (extra.comments) {\n comment = source.slice(start + 2, index - 2);\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n addComment('Block', comment, start, index, loc);\n }\n return;\n }\n ++index;\n } else {\n ++index;\n }\n }\n\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n function skipComment() {\n var ch, start;\n\n start = (index === 0);\n while (index < length) {\n ch = source.charCodeAt(index);\n\n if (isWhiteSpace(ch)) {\n ++index;\n } else if (isLineTerminator(ch)) {\n ++index;\n if (ch === 0x0D && source.charCodeAt(index) === 0x0A) {\n ++index;\n }\n ++lineNumber;\n lineStart = index;\n start = true;\n } else if (ch === 0x2F) { // U+002F is '/'\n ch = source.charCodeAt(index + 1);\n if (ch === 0x2F) {\n ++index;\n ++index;\n skipSingleLineComment(2);\n start = true;\n } else if (ch === 0x2A) { // U+002A is '*'\n ++index;\n ++index;\n skipMultiLineComment();\n } else {\n break;\n }\n } else if (start && ch === 0x2D) { // U+002D is '-'\n // U+003E is '>'\n if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) {\n // '-->' is a single-line comment\n index += 3;\n skipSingleLineComment(3);\n } else {\n break;\n }\n } else if (ch === 0x3C) { // U+003C is '<'\n if (source.slice(index + 1, index + 4) === '!--') {\n ++index; // `<`\n ++index; // `!`\n ++index; // `-`\n ++index; // `-`\n skipSingleLineComment(4);\n } else {\n break;\n }\n } else {\n break;\n }\n }\n }\n\n function scanHexEscape(prefix) {\n var i, len, ch, code = 0;\n\n len = (prefix === 'u') ? 4 : 2;\n for (i = 0; i < len; ++i) {\n if (index < length && isHexDigit(source[index])) {\n ch = source[index++];\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n } else {\n return '';\n }\n }\n return String.fromCharCode(code);\n }\n\n function getEscapedIdentifier() {\n var ch, id;\n\n ch = source.charCodeAt(index++);\n id = String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierStart(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n id = ch;\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n if (!isIdentifierPart(ch)) {\n break;\n }\n ++index;\n id += String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n id = id.substr(0, id.length - 1);\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierPart(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n id += ch;\n }\n }\n\n return id;\n }\n\n function getIdentifier() {\n var start, ch;\n\n start = index++;\n while (index < length) {\n ch = source.charCodeAt(index);\n if (ch === 0x5C) {\n // Blackslash (U+005C) marks Unicode escape sequence.\n index = start;\n return getEscapedIdentifier();\n }\n if (isIdentifierPart(ch)) {\n ++index;\n } else {\n break;\n }\n }\n\n return source.slice(start, index);\n }\n\n function scanIdentifier() {\n var start, id, type;\n\n start = index;\n\n // Backslash (U+005C) starts an escaped character.\n id = (source.charCodeAt(index) === 0x5C) ? getEscapedIdentifier() : getIdentifier();\n\n // There is no keyword or literal with only one character.\n // Thus, it must be an identifier.\n if (id.length === 1) {\n type = Token.Identifier;\n } else if (isKeyword(id)) {\n type = Token.Keyword;\n } else if (id === 'null') {\n type = Token.NullLiteral;\n } else if (id === 'true' || id === 'false') {\n type = Token.BooleanLiteral;\n } else {\n type = Token.Identifier;\n }\n\n return {\n type: type,\n value: id,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n\n // 7.7 Punctuators\n\n function scanPunctuator() {\n var start = index,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2,\n ch3,\n ch4;\n\n switch (code) {\n\n // Check for most common single-character punctuators.\n case 0x2E: // . dot\n case 0x28: // ( open bracket\n case 0x29: // ) close bracket\n case 0x3B: // ; semicolon\n case 0x2C: // , comma\n case 0x7B: // { open curly brace\n case 0x7D: // } close curly brace\n case 0x5B: // [\n case 0x5D: // ]\n case 0x3A: // :\n case 0x3F: // ?\n case 0x7E: // ~\n ++index;\n if (extra.tokenize) {\n if (code === 0x28) {\n extra.openParenToken = extra.tokens.length;\n } else if (code === 0x7B) {\n extra.openCurlyToken = extra.tokens.length;\n }\n }\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n\n default:\n code2 = source.charCodeAt(index + 1);\n\n // '=' (U+003D) marks an assignment or comparison operator.\n if (code2 === 0x3D) {\n switch (code) {\n case 0x2B: // +\n case 0x2D: // -\n case 0x2F: // /\n case 0x3C: // <\n case 0x3E: // >\n case 0x5E: // ^\n case 0x7C: // |\n case 0x25: // %\n case 0x26: // &\n case 0x2A: // *\n index += 2;\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code) + String.fromCharCode(code2),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n\n case 0x21: // !\n case 0x3D: // =\n index += 2;\n\n // !== and ===\n if (source.charCodeAt(index) === 0x3D) {\n ++index;\n }\n return {\n type: Token.Punctuator,\n value: source.slice(start, index),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n }\n }\n\n // 4-character punctuator: >>>=\n\n ch4 = source.substr(index, 4);\n\n if (ch4 === '>>>=') {\n index += 4;\n return {\n type: Token.Punctuator,\n value: ch4,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 3-character punctuators: === !== >>> <<= >>=\n\n ch3 = ch4.substr(0, 3);\n\n if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {\n index += 3;\n return {\n type: Token.Punctuator,\n value: ch3,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // Other 2-character punctuators: ++ -- << >> && ||\n ch2 = ch3.substr(0, 2);\n\n if ((ch1 === ch2[1] && ('+-<>&|'.indexOf(ch1) >= 0)) || ch2 === '=>') {\n index += 2;\n return {\n type: Token.Punctuator,\n value: ch2,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 1-character punctuators: < > = ! + - * % & | ^ /\n if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n ++index;\n return {\n type: Token.Punctuator,\n value: ch1,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n // 7.8.3 Numeric Literals\n\n function scanHexLiteral(start) {\n var number = '';\n\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (number.length === 0) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt('0x' + number, 16),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function scanOctalLiteral(start) {\n var number = '0' + source[index++];\n while (index < length) {\n if (!isOctalDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt(number, 8),\n octal: true,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function isImplicitOctalLiteral() {\n var i, ch;\n\n // Implicit octal, unless there is a non-octal digit.\n // (Annex B.1.1 on Numeric Literals)\n for (i = index + 1; i < length; ++i) {\n ch = source[i];\n if (ch === '8' || ch === '9') {\n return false;\n }\n if (!isOctalDigit(ch)) {\n return true;\n }\n }\n\n return true;\n }\n\n function scanNumericLiteral() {\n var number, start, ch;\n\n ch = source[index];\n assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),\n 'Numeric literal must start with a decimal digit or a decimal point');\n\n start = index;\n number = '';\n if (ch !== '.') {\n number = source[index++];\n ch = source[index];\n\n // Hex number starts with '0x'.\n // Octal number starts with '0'.\n if (number === '0') {\n if (ch === 'x' || ch === 'X') {\n ++index;\n return scanHexLiteral(start);\n }\n if (isOctalDigit(ch)) {\n if (isImplicitOctalLiteral()) {\n return scanOctalLiteral(start);\n }\n }\n }\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === '.') {\n number += source[index++];\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === 'e' || ch === 'E') {\n number += source[index++];\n\n ch = source[index];\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n if (isDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseFloat(number),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 7.8.4 String Literals\n\n function scanStringLiteral() {\n var str = '', quote, start, ch, code, unescaped, restore, octal = false, startLineNumber, startLineStart;\n startLineNumber = lineNumber;\n startLineStart = lineStart;\n\n quote = source[index];\n assert((quote === '\\'' || quote === '\"'),\n 'String literal must starts with a quote');\n\n start = index;\n ++index;\n\n while (index < length) {\n ch = source[index++];\n\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'u':\n case 'x':\n restore = index;\n unescaped = scanHexEscape(ch);\n if (unescaped) {\n str += unescaped;\n } else {\n index = restore;\n str += ch;\n }\n break;\n case 'n':\n str += '\\n';\n break;\n case 'r':\n str += '\\r';\n break;\n case 't':\n str += '\\t';\n break;\n case 'b':\n str += '\\b';\n break;\n case 'f':\n str += '\\f';\n break;\n case 'v':\n str += '\\x0B';\n break;\n\n default:\n if (isOctalDigit(ch)) {\n code = '01234567'.indexOf(ch);\n\n // \\0 is not octal escape sequence\n if (code !== 0) {\n octal = true;\n }\n\n if (index < length && isOctalDigit(source[index])) {\n octal = true;\n code = code * 8 + '01234567'.indexOf(source[index++]);\n\n // 3 digits are only allowed when string starts\n // with 0, 1, 2, 3\n if ('0123'.indexOf(ch) >= 0 &&\n index < length &&\n isOctalDigit(source[index])) {\n code = code * 8 + '01234567'.indexOf(source[index++]);\n }\n }\n str += String.fromCharCode(code);\n } else {\n str += ch;\n }\n break;\n }\n } else {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n\n if (quote !== '') {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.StringLiteral,\n value: str,\n octal: octal,\n startLineNumber: startLineNumber,\n startLineStart: startLineStart,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function testRegExp(pattern, flags) {\n var value;\n try {\n value = new RegExp(pattern, flags);\n } catch (e) {\n throwError({}, Messages.InvalidRegExp);\n }\n return value;\n }\n\n function scanRegExpBody() {\n var ch, str, classMarker, terminated, body;\n\n ch = source[index];\n assert(ch === '/', 'Regular expression literal must start with a slash');\n str = source[index++];\n\n classMarker = false;\n terminated = false;\n while (index < length) {\n ch = source[index++];\n str += ch;\n if (ch === '\\\\') {\n ch = source[index++];\n // ECMA-262 7.8.5\n if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, Messages.UnterminatedRegExp);\n }\n str += ch;\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, Messages.UnterminatedRegExp);\n } else if (classMarker) {\n if (ch === ']') {\n classMarker = false;\n }\n } else {\n if (ch === '/') {\n terminated = true;\n break;\n } else if (ch === '[') {\n classMarker = true;\n }\n }\n }\n\n if (!terminated) {\n throwError({}, Messages.UnterminatedRegExp);\n }\n\n // Exclude leading and trailing slash.\n body = str.substr(1, str.length - 2);\n return {\n value: body,\n literal: str\n };\n }\n\n function scanRegExpFlags() {\n var ch, str, flags, restore;\n\n str = '';\n flags = '';\n while (index < length) {\n ch = source[index];\n if (!isIdentifierPart(ch.charCodeAt(0))) {\n break;\n }\n\n ++index;\n if (ch === '\\\\' && index < length) {\n ch = source[index];\n if (ch === 'u') {\n ++index;\n restore = index;\n ch = scanHexEscape('u');\n if (ch) {\n flags += ch;\n for (str += '\\\\u'; restore < index; ++restore) {\n str += source[restore];\n }\n } else {\n index = restore;\n flags += 'u';\n str += '\\\\u';\n }\n throwErrorTolerant({}, Messages.UnexpectedToken, 'ILLEGAL');\n } else {\n str += '\\\\';\n throwErrorTolerant({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n } else {\n flags += ch;\n str += ch;\n }\n }\n\n return {\n value: flags,\n literal: str\n };\n }\n\n function scanRegExp() {\n var start, body, flags, pattern, value;\n\n lookahead = null;\n skipComment();\n start = index;\n\n body = scanRegExpBody();\n flags = scanRegExpFlags();\n value = testRegExp(body.value, flags.value);\n\n if (extra.tokenize) {\n return {\n type: Token.RegularExpression,\n value: value,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n return {\n literal: body.literal + flags.literal,\n value: value,\n start: start,\n end: index\n };\n }\n\n function collectRegex() {\n var pos, loc, regex, token;\n\n skipComment();\n\n pos = index;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart\n }\n };\n\n regex = scanRegExp();\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n\n /* istanbul ignore next */\n if (!extra.tokenize) {\n // Pop the previous token, which is likely '/' or '/='\n if (extra.tokens.length > 0) {\n token = extra.tokens[extra.tokens.length - 1];\n if (token.range[0] === pos && token.type === 'Punctuator') {\n if (token.value === '/' || token.value === '/=') {\n extra.tokens.pop();\n }\n }\n }\n\n extra.tokens.push({\n type: 'RegularExpression',\n value: regex.literal,\n range: [pos, index],\n loc: loc\n });\n }\n\n return regex;\n }\n\n function isIdentifierName(token) {\n return token.type === Token.Identifier ||\n token.type === Token.Keyword ||\n token.type === Token.BooleanLiteral ||\n token.type === Token.NullLiteral;\n }\n\n function advanceSlash() {\n var prevToken,\n checkToken;\n // Using the following algorithm:\n // https://github.com/mozilla/sweet.js/wiki/design\n prevToken = extra.tokens[extra.tokens.length - 1];\n if (!prevToken) {\n // Nothing before that: it cannot be a division.\n return collectRegex();\n }\n if (prevToken.type === 'Punctuator') {\n if (prevToken.value === ']') {\n return scanPunctuator();\n }\n if (prevToken.value === ')') {\n checkToken = extra.tokens[extra.openParenToken - 1];\n if (checkToken &&\n checkToken.type === 'Keyword' &&\n (checkToken.value === 'if' ||\n checkToken.value === 'while' ||\n checkToken.value === 'for' ||\n checkToken.value === 'with')) {\n return collectRegex();\n }\n return scanPunctuator();\n }\n if (prevToken.value === '}') {\n // Dividing a function by anything makes little sense,\n // but we have to check for that.\n if (extra.tokens[extra.openCurlyToken - 3] &&\n extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') {\n // Anonymous function.\n checkToken = extra.tokens[extra.openCurlyToken - 4];\n if (!checkToken) {\n return scanPunctuator();\n }\n } else if (extra.tokens[extra.openCurlyToken - 4] &&\n extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') {\n // Named function.\n checkToken = extra.tokens[extra.openCurlyToken - 5];\n if (!checkToken) {\n return collectRegex();\n }\n } else {\n return scanPunctuator();\n }\n // checkToken determines whether the function is\n // a declaration or an expression.\n if (FnExprTokens.indexOf(checkToken.value) >= 0) {\n // It is an expression.\n return scanPunctuator();\n }\n // It is a declaration.\n return collectRegex();\n }\n return collectRegex();\n }\n if (prevToken.type === 'Keyword' && prevToken.value !== 'this') {\n return collectRegex();\n }\n return scanPunctuator();\n }\n\n function advance() {\n var ch;\n\n skipComment();\n\n if (index >= length) {\n return {\n type: Token.EOF,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: index,\n end: index\n };\n }\n\n ch = source.charCodeAt(index);\n\n if (isIdentifierStart(ch)) {\n return scanIdentifier();\n }\n\n // Very common: ( and ) and ;\n if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {\n return scanPunctuator();\n }\n\n // String literal starts with single quote (U+0027) or double quote (U+0022).\n if (ch === 0x27 || ch === 0x22) {\n return scanStringLiteral();\n }\n\n\n // Dot (.) U+002E can also start a floating-point number, hence the need\n // to check the next character.\n if (ch === 0x2E) {\n if (isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNumericLiteral();\n }\n return scanPunctuator();\n }\n\n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n\n // Slash (/) U+002F can also start a regex.\n if (extra.tokenize && ch === 0x2F) {\n return advanceSlash();\n }\n\n return scanPunctuator();\n }\n\n function collectToken() {\n var loc, token, range, value;\n\n skipComment();\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart\n }\n };\n\n token = advance();\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n\n if (token.type !== Token.EOF) {\n value = source.slice(token.start, token.end);\n extra.tokens.push({\n type: TokenName[token.type],\n value: value,\n range: [token.start, token.end],\n loc: loc\n });\n }\n\n return token;\n }\n\n function lex() {\n var token;\n\n token = lookahead;\n index = token.end;\n lineNumber = token.lineNumber;\n lineStart = token.lineStart;\n\n lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();\n\n index = token.end;\n lineNumber = token.lineNumber;\n lineStart = token.lineStart;\n\n return token;\n }\n\n function peek() {\n var pos, line, start;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();\n index = pos;\n lineNumber = line;\n lineStart = start;\n }\n\n function Position(line, column) {\n this.line = line;\n this.column = column;\n }\n\n function SourceLocation(startLine, startColumn, line, column) {\n this.start = new Position(startLine, startColumn);\n this.end = new Position(line, column);\n }\n\n SyntaxTreeDelegate = {\n\n name: 'SyntaxTree',\n\n processComment: function (node) {\n var lastChild, trailingComments;\n\n if (node.type === Syntax.Program) {\n if (node.body.length > 0) {\n return;\n }\n }\n\n if (extra.trailingComments.length > 0) {\n if (extra.trailingComments[0].range[0] >= node.range[1]) {\n trailingComments = extra.trailingComments;\n extra.trailingComments = [];\n } else {\n extra.trailingComments.length = 0;\n }\n } else {\n if (extra.bottomRightStack.length > 0 &&\n extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments &&\n extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments[0].range[0] >= node.range[1]) {\n trailingComments = extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments;\n delete extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments;\n }\n }\n\n // Eating the stack.\n while (extra.bottomRightStack.length > 0 && extra.bottomRightStack[extra.bottomRightStack.length - 1].range[0] >= node.range[0]) {\n lastChild = extra.bottomRightStack.pop();\n }\n\n if (lastChild) {\n if (lastChild.leadingComments && lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= node.range[0]) {\n node.leadingComments = lastChild.leadingComments;\n delete lastChild.leadingComments;\n }\n } else if (extra.leadingComments.length > 0 && extra.leadingComments[extra.leadingComments.length - 1].range[1] <= node.range[0]) {\n node.leadingComments = extra.leadingComments;\n extra.leadingComments = [];\n }\n\n\n if (trailingComments) {\n node.trailingComments = trailingComments;\n }\n\n extra.bottomRightStack.push(node);\n },\n\n markEnd: function (node, startToken) {\n if (extra.range) {\n node.range = [startToken.start, index];\n }\n if (extra.loc) {\n node.loc = new SourceLocation(\n startToken.startLineNumber === undefined ? startToken.lineNumber : startToken.startLineNumber,\n startToken.start - (startToken.startLineStart === undefined ? startToken.lineStart : startToken.startLineStart),\n lineNumber,\n index - lineStart\n );\n this.postProcess(node);\n }\n\n if (extra.attachComment) {\n this.processComment(node);\n }\n return node;\n },\n\n postProcess: function (node) {\n if (extra.source) {\n node.loc.source = extra.source;\n }\n return node;\n },\n\n createArrayExpression: function (elements) {\n return {\n type: Syntax.ArrayExpression,\n elements: elements\n };\n },\n\n createAssignmentExpression: function (operator, left, right) {\n return {\n type: Syntax.AssignmentExpression,\n operator: operator,\n left: left,\n right: right\n };\n },\n\n createBinaryExpression: function (operator, left, right) {\n var type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression :\n Syntax.BinaryExpression;\n return {\n type: type,\n operator: operator,\n left: left,\n right: right\n };\n },\n\n createBlockStatement: function (body) {\n return {\n type: Syntax.BlockStatement,\n body: body\n };\n },\n\n createBreakStatement: function (label) {\n return {\n type: Syntax.BreakStatement,\n label: label\n };\n },\n\n createCallExpression: function (callee, args) {\n return {\n type: Syntax.CallExpression,\n callee: callee,\n 'arguments': args\n };\n },\n\n createCatchClause: function (param, body) {\n return {\n type: Syntax.CatchClause,\n param: param,\n body: body\n };\n },\n\n createConditionalExpression: function (test, consequent, alternate) {\n return {\n type: Syntax.ConditionalExpression,\n test: test,\n consequent: consequent,\n alternate: alternate\n };\n },\n\n createContinueStatement: function (label) {\n return {\n type: Syntax.ContinueStatement,\n label: label\n };\n },\n\n createDebuggerStatement: function () {\n return {\n type: Syntax.DebuggerStatement\n };\n },\n\n createDoWhileStatement: function (body, test) {\n return {\n type: Syntax.DoWhileStatement,\n body: body,\n test: test\n };\n },\n\n createEmptyStatement: function () {\n return {\n type: Syntax.EmptyStatement\n };\n },\n\n createExpressionStatement: function (expression) {\n return {\n type: Syntax.ExpressionStatement,\n expression: expression\n };\n },\n\n createForStatement: function (init, test, update, body) {\n return {\n type: Syntax.ForStatement,\n init: init,\n test: test,\n update: update,\n body: body\n };\n },\n\n createForInStatement: function (left, right, body) {\n return {\n type: Syntax.ForInStatement,\n left: left,\n right: right,\n body: body,\n each: false\n };\n },\n\n createFunctionDeclaration: function (id, params, defaults, body) {\n return {\n type: Syntax.FunctionDeclaration,\n id: id,\n params: params,\n defaults: defaults,\n body: body,\n rest: null,\n generator: false,\n expression: false\n };\n },\n\n createFunctionExpression: function (id, params, defaults, body) {\n return {\n type: Syntax.FunctionExpression,\n id: id,\n params: params,\n defaults: defaults,\n body: body,\n rest: null,\n generator: false,\n expression: false\n };\n },\n\n createIdentifier: function (name) {\n return {\n type: Syntax.Identifier,\n name: name\n };\n },\n\n createIfStatement: function (test, consequent, alternate) {\n return {\n type: Syntax.IfStatement,\n test: test,\n consequent: consequent,\n alternate: alternate\n };\n },\n\n createLabeledStatement: function (label, body) {\n return {\n type: Syntax.LabeledStatement,\n label: label,\n body: body\n };\n },\n\n createLiteral: function (token) {\n return {\n type: Syntax.Literal,\n value: token.value,\n raw: source.slice(token.start, token.end)\n };\n },\n\n createMemberExpression: function (accessor, object, property) {\n return {\n type: Syntax.MemberExpression,\n computed: accessor === '[',\n object: object,\n property: property\n };\n },\n\n createNewExpression: function (callee, args) {\n return {\n type: Syntax.NewExpression,\n callee: callee,\n 'arguments': args\n };\n },\n\n createObjectExpression: function (properties) {\n return {\n type: Syntax.ObjectExpression,\n properties: properties\n };\n },\n\n createPostfixExpression: function (operator, argument) {\n return {\n type: Syntax.UpdateExpression,\n operator: operator,\n argument: argument,\n prefix: false\n };\n },\n\n createProgram: function (body) {\n return {\n type: Syntax.Program,\n body: body\n };\n },\n\n createProperty: function (kind, key, value) {\n return {\n type: Syntax.Property,\n key: key,\n value: value,\n kind: kind\n };\n },\n\n createReturnStatement: function (argument) {\n return {\n type: Syntax.ReturnStatement,\n argument: argument\n };\n },\n\n createSequenceExpression: function (expressions) {\n return {\n type: Syntax.SequenceExpression,\n expressions: expressions\n };\n },\n\n createSwitchCase: function (test, consequent) {\n return {\n type: Syntax.SwitchCase,\n test: test,\n consequent: consequent\n };\n },\n\n createSwitchStatement: function (discriminant, cases) {\n return {\n type: Syntax.SwitchStatement,\n discriminant: discriminant,\n cases: cases\n };\n },\n\n createThisExpression: function () {\n return {\n type: Syntax.ThisExpression\n };\n },\n\n createThrowStatement: function (argument) {\n return {\n type: Syntax.ThrowStatement,\n argument: argument\n };\n },\n\n createTryStatement: function (block, guardedHandlers, handlers, finalizer) {\n return {\n type: Syntax.TryStatement,\n block: block,\n guardedHandlers: guardedHandlers,\n handlers: handlers,\n finalizer: finalizer\n };\n },\n\n createUnaryExpression: function (operator, argument) {\n if (operator === '++' || operator === '--') {\n return {\n type: Syntax.UpdateExpression,\n operator: operator,\n argument: argument,\n prefix: true\n };\n }\n return {\n type: Syntax.UnaryExpression,\n operator: operator,\n argument: argument,\n prefix: true\n };\n },\n\n createVariableDeclaration: function (declarations, kind) {\n return {\n type: Syntax.VariableDeclaration,\n declarations: declarations,\n kind: kind\n };\n },\n\n createVariableDeclarator: function (id, init) {\n return {\n type: Syntax.VariableDeclarator,\n id: id,\n init: init\n };\n },\n\n createWhileStatement: function (test, body) {\n return {\n type: Syntax.WhileStatement,\n test: test,\n body: body\n };\n },\n\n createWithStatement: function (object, body) {\n return {\n type: Syntax.WithStatement,\n object: object,\n body: body\n };\n }\n };\n\n // Return true if there is a line terminator before the next token.\n\n function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }\n\n // Throw an exception\n\n function throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(\n /%(\\d)/g,\n function (whole, index) {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n }\n );\n\n if (typeof token.lineNumber === 'number') {\n error = new Error('Line ' + token.lineNumber + ': ' + msg);\n error.index = token.start;\n error.lineNumber = token.lineNumber;\n error.column = token.start - lineStart + 1;\n } else {\n error = new Error('Line ' + lineNumber + ': ' + msg);\n error.index = index;\n error.lineNumber = lineNumber;\n error.column = index - lineStart + 1;\n }\n\n error.description = msg;\n throw error;\n }\n\n function throwErrorTolerant() {\n try {\n throwError.apply(null, arguments);\n } catch (e) {\n if (extra.errors) {\n extra.errors.push(e);\n } else {\n throw e;\n }\n }\n }\n\n\n // Throw an exception because of the token.\n\n function throwUnexpected(token) {\n if (token.type === Token.EOF) {\n throwError(token, Messages.UnexpectedEOS);\n }\n\n if (token.type === Token.NumericLiteral) {\n throwError(token, Messages.UnexpectedNumber);\n }\n\n if (token.type === Token.StringLiteral) {\n throwError(token, Messages.UnexpectedString);\n }\n\n if (token.type === Token.Identifier) {\n throwError(token, Messages.UnexpectedIdentifier);\n }\n\n if (token.type === Token.Keyword) {\n if (isFutureReservedWord(token.value)) {\n throwError(token, Messages.UnexpectedReserved);\n } else if (strict && isStrictModeReservedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictReservedWord);\n return;\n }\n throwError(token, Messages.UnexpectedToken, token.value);\n }\n\n // BooleanLiteral, NullLiteral, or Punctuator.\n throwError(token, Messages.UnexpectedToken, token.value);\n }\n\n // Expect the next token to match the specified punctuator.\n // If not, an exception will be thrown.\n\n function expect(value) {\n var token = lex();\n if (token.type !== Token.Punctuator || token.value !== value) {\n throwUnexpected(token);\n }\n }\n\n // Expect the next token to match the specified keyword.\n // If not, an exception will be thrown.\n\n function expectKeyword(keyword) {\n var token = lex();\n if (token.type !== Token.Keyword || token.value !== keyword) {\n throwUnexpected(token);\n }\n }\n\n // Return true if the next token matches the specified punctuator.\n\n function match(value) {\n return lookahead.type === Token.Punctuator && lookahead.value === value;\n }\n\n // Return true if the next token matches the specified keyword\n\n function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }\n\n // Return true if the next token is an assignment operator\n\n function matchAssign() {\n var op;\n\n if (lookahead.type !== Token.Punctuator) {\n return false;\n }\n op = lookahead.value;\n return op === '=' ||\n op === '*=' ||\n op === '/=' ||\n op === '%=' ||\n op === '+=' ||\n op === '-=' ||\n op === '<<=' ||\n op === '>>=' ||\n op === '>>>=' ||\n op === '&=' ||\n op === '^=' ||\n op === '|=';\n }\n\n function consumeSemicolon() {\n var line, oldIndex = index, oldLineNumber = lineNumber,\n oldLineStart = lineStart, oldLookahead = lookahead;\n\n // Catch the very common case first: immediately a semicolon (U+003B).\n if (source.charCodeAt(index) === 0x3B || match(';')) {\n lex();\n return;\n }\n\n line = lineNumber;\n skipComment();\n if (lineNumber !== line) {\n index = oldIndex;\n lineNumber = oldLineNumber;\n lineStart = oldLineStart;\n lookahead = oldLookahead;\n return;\n }\n\n if (lookahead.type !== Token.EOF && !match('}')) {\n throwUnexpected(lookahead);\n }\n }\n\n // Return true if provided expression is LeftHandSideExpression\n\n function isLeftHandSide(expr) {\n return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression;\n }\n\n // 11.1.4 Array Initialiser\n\n function parseArrayInitialiser() {\n var elements = [], startToken;\n\n startToken = lookahead;\n expect('[');\n\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elements.push(parseAssignmentExpression());\n\n if (!match(']')) {\n expect(',');\n }\n }\n }\n\n lex();\n\n return delegate.markEnd(delegate.createArrayExpression(elements), startToken);\n }\n\n // 11.1.5 Object Initialiser\n\n function parsePropertyFunction(param, first) {\n var previousStrict, body, startToken;\n\n previousStrict = strict;\n startToken = lookahead;\n body = parseFunctionSourceElements();\n if (first && strict && isRestrictedWord(param[0].name)) {\n throwErrorTolerant(first, Messages.StrictParamName);\n }\n strict = previousStrict;\n return delegate.markEnd(delegate.createFunctionExpression(null, param, [], body), startToken);\n }\n\n function parseObjectPropertyKey() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n\n if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) {\n if (strict && token.octal) {\n throwErrorTolerant(token, Messages.StrictOctalLiteral);\n }\n return delegate.markEnd(delegate.createLiteral(token), startToken);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseObjectProperty() {\n var token, key, id, value, param, startToken;\n\n token = lookahead;\n startToken = lookahead;\n\n if (token.type === Token.Identifier) {\n\n id = parseObjectPropertyKey();\n\n // Property Assignment: Getter and Setter.\n\n if (token.value === 'get' && !match(':')) {\n key = parseObjectPropertyKey();\n expect('(');\n expect(')');\n value = parsePropertyFunction([]);\n return delegate.markEnd(delegate.createProperty('get', key, value), startToken);\n }\n if (token.value === 'set' && !match(':')) {\n key = parseObjectPropertyKey();\n expect('(');\n token = lookahead;\n if (token.type !== Token.Identifier) {\n expect(')');\n throwErrorTolerant(token, Messages.UnexpectedToken, token.value);\n value = parsePropertyFunction([]);\n } else {\n param = [ parseVariableIdentifier() ];\n expect(')');\n value = parsePropertyFunction(param, token);\n }\n return delegate.markEnd(delegate.createProperty('set', key, value), startToken);\n }\n expect(':');\n value = parseAssignmentExpression();\n return delegate.markEnd(delegate.createProperty('init', id, value), startToken);\n }\n if (token.type === Token.EOF || token.type === Token.Punctuator) {\n throwUnexpected(token);\n } else {\n key = parseObjectPropertyKey();\n expect(':');\n value = parseAssignmentExpression();\n return delegate.markEnd(delegate.createProperty('init', key, value), startToken);\n }\n }\n\n function parseObjectInitialiser() {\n var properties = [], property, name, key, kind, map = {}, toString = String, startToken;\n\n startToken = lookahead;\n\n expect('{');\n\n while (!match('}')) {\n property = parseObjectProperty();\n\n if (property.key.type === Syntax.Identifier) {\n name = property.key.name;\n } else {\n name = toString(property.key.value);\n }\n kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set;\n\n key = '$' + name;\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n if (map[key] === PropertyKind.Data) {\n if (strict && kind === PropertyKind.Data) {\n throwErrorTolerant({}, Messages.StrictDuplicateProperty);\n } else if (kind !== PropertyKind.Data) {\n throwErrorTolerant({}, Messages.AccessorDataProperty);\n }\n } else {\n if (kind === PropertyKind.Data) {\n throwErrorTolerant({}, Messages.AccessorDataProperty);\n } else if (map[key] & kind) {\n throwErrorTolerant({}, Messages.AccessorGetSet);\n }\n }\n map[key] |= kind;\n } else {\n map[key] = kind;\n }\n\n properties.push(property);\n\n if (!match('}')) {\n expect(',');\n }\n }\n\n expect('}');\n\n return delegate.markEnd(delegate.createObjectExpression(properties), startToken);\n }\n\n // 11.1.6 The Grouping Operator\n\n function parseGroupExpression() {\n var expr;\n\n expect('(');\n\n expr = parseExpression();\n\n expect(')');\n\n return expr;\n }\n\n\n // 11.1 Primary Expressions\n\n function parsePrimaryExpression() {\n var type, token, expr, startToken;\n\n if (match('(')) {\n return parseGroupExpression();\n }\n\n if (match('[')) {\n return parseArrayInitialiser();\n }\n\n if (match('{')) {\n return parseObjectInitialiser();\n }\n\n type = lookahead.type;\n startToken = lookahead;\n\n if (type === Token.Identifier) {\n expr = delegate.createIdentifier(lex().value);\n } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {\n if (strict && lookahead.octal) {\n throwErrorTolerant(lookahead, Messages.StrictOctalLiteral);\n }\n expr = delegate.createLiteral(lex());\n } else if (type === Token.Keyword) {\n if (matchKeyword('function')) {\n return parseFunctionExpression();\n }\n if (matchKeyword('this')) {\n lex();\n expr = delegate.createThisExpression();\n } else {\n throwUnexpected(lex());\n }\n } else if (type === Token.BooleanLiteral) {\n token = lex();\n token.value = (token.value === 'true');\n expr = delegate.createLiteral(token);\n } else if (type === Token.NullLiteral) {\n token = lex();\n token.value = null;\n expr = delegate.createLiteral(token);\n } else if (match('/') || match('/=')) {\n if (typeof extra.tokens !== 'undefined') {\n expr = delegate.createLiteral(collectRegex());\n } else {\n expr = delegate.createLiteral(scanRegExp());\n }\n peek();\n } else {\n throwUnexpected(lex());\n }\n\n return delegate.markEnd(expr, startToken);\n }\n\n // 11.2 Left-Hand-Side Expressions\n\n function parseArguments() {\n var args = [];\n\n expect('(');\n\n if (!match(')')) {\n while (index < length) {\n args.push(parseAssignmentExpression());\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return args;\n }\n\n function parseNonComputedProperty() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n if (!isIdentifierName(token)) {\n throwUnexpected(token);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseNonComputedMember() {\n expect('.');\n\n return parseNonComputedProperty();\n }\n\n function parseComputedMember() {\n var expr;\n\n expect('[');\n\n expr = parseExpression();\n\n expect(']');\n\n return expr;\n }\n\n function parseNewExpression() {\n var callee, args, startToken;\n\n startToken = lookahead;\n expectKeyword('new');\n callee = parseLeftHandSideExpression();\n args = match('(') ? parseArguments() : [];\n\n return delegate.markEnd(delegate.createNewExpression(callee, args), startToken);\n }\n\n function parseLeftHandSideExpressionAllowCall() {\n var expr, args, property, startToken, previousAllowIn = state.allowIn;\n\n startToken = lookahead;\n state.allowIn = true;\n expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n\n for (;;) {\n if (match('.')) {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n } else if (match('(')) {\n args = parseArguments();\n expr = delegate.createCallExpression(expr, args);\n } else if (match('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else {\n break;\n }\n delegate.markEnd(expr, startToken);\n }\n state.allowIn = previousAllowIn;\n\n return expr;\n }\n\n function parseLeftHandSideExpression() {\n var expr, property, startToken;\n assert(state.allowIn, 'callee of new expression always allow in keyword.');\n\n startToken = lookahead;\n\n expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n\n while (match('.') || match('[')) {\n if (match('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n }\n delegate.markEnd(expr, startToken);\n }\n return expr;\n }\n\n // 11.3 Postfix Expressions\n\n function parsePostfixExpression() {\n var expr, token, startToken = lookahead;\n\n expr = parseLeftHandSideExpressionAllowCall();\n\n if (lookahead.type === Token.Punctuator) {\n if ((match('++') || match('--')) && !peekLineTerminator()) {\n // 11.3.1, 11.3.2\n if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n throwErrorTolerant({}, Messages.StrictLHSPostfix);\n }\n\n if (!isLeftHandSide(expr)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n token = lex();\n expr = delegate.markEnd(delegate.createPostfixExpression(token.value, expr), startToken);\n }\n }\n\n return expr;\n }\n\n // 11.4 Unary Operators\n\n function parseUnaryExpression() {\n var token, expr, startToken;\n\n if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {\n expr = parsePostfixExpression();\n } else if (match('++') || match('--')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n // 11.4.4, 11.4.5\n if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n throwErrorTolerant({}, Messages.StrictLHSPrefix);\n }\n\n if (!isLeftHandSide(expr)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n } else if (match('+') || match('-') || match('~') || match('!')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) {\n throwErrorTolerant({}, Messages.StrictDelete);\n }\n } else {\n expr = parsePostfixExpression();\n }\n\n return expr;\n }\n\n function binaryPrecedence(token, allowIn) {\n var prec = 0;\n\n if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {\n return 0;\n }\n\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n\n case '&&':\n prec = 2;\n break;\n\n case '|':\n prec = 3;\n break;\n\n case '^':\n prec = 4;\n break;\n\n case '&':\n prec = 5;\n break;\n\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n prec = 7;\n break;\n\n case 'in':\n prec = allowIn ? 7 : 0;\n break;\n\n case '<<':\n case '>>':\n case '>>>':\n prec = 8;\n break;\n\n case '+':\n case '-':\n prec = 9;\n break;\n\n case '*':\n case '/':\n case '%':\n prec = 11;\n break;\n\n default:\n break;\n }\n\n return prec;\n }\n\n // 11.5 Multiplicative Operators\n // 11.6 Additive Operators\n // 11.7 Bitwise Shift Operators\n // 11.8 Relational Operators\n // 11.9 Equality Operators\n // 11.10 Binary Bitwise Operators\n // 11.11 Binary Logical Operators\n\n function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers[markers.length - 1];\n delegate.markEnd(expr, marker);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n delegate.markEnd(expr, marker);\n }\n\n return expr;\n }\n\n\n // 11.12 Conditional Operator\n\n function parseConditionalExpression() {\n var expr, previousAllowIn, consequent, alternate, startToken;\n\n startToken = lookahead;\n\n expr = parseBinaryExpression();\n\n if (match('?')) {\n lex();\n previousAllowIn = state.allowIn;\n state.allowIn = true;\n consequent = parseAssignmentExpression();\n state.allowIn = previousAllowIn;\n expect(':');\n alternate = parseAssignmentExpression();\n\n expr = delegate.createConditionalExpression(expr, consequent, alternate);\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 11.13 Assignment Operators\n\n function parseAssignmentExpression() {\n var token, left, right, node, startToken;\n\n token = lookahead;\n startToken = lookahead;\n\n node = left = parseConditionalExpression();\n\n if (matchAssign()) {\n // LeftHandSideExpression\n if (!isLeftHandSide(left)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n // 11.13.1\n if (strict && left.type === Syntax.Identifier && isRestrictedWord(left.name)) {\n throwErrorTolerant(token, Messages.StrictLHSAssignment);\n }\n\n token = lex();\n right = parseAssignmentExpression();\n node = delegate.markEnd(delegate.createAssignmentExpression(token.value, left, right), startToken);\n }\n\n return node;\n }\n\n // 11.14 Comma Operator\n\n function parseExpression() {\n var expr, startToken = lookahead;\n\n expr = parseAssignmentExpression();\n\n if (match(',')) {\n expr = delegate.createSequenceExpression([ expr ]);\n\n while (index < length) {\n if (!match(',')) {\n break;\n }\n lex();\n expr.expressions.push(parseAssignmentExpression());\n }\n\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 12.1 Block\n\n function parseStatementList() {\n var list = [],\n statement;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n statement = parseSourceElement();\n if (typeof statement === 'undefined') {\n break;\n }\n list.push(statement);\n }\n\n return list;\n }\n\n function parseBlock() {\n var block, startToken;\n\n startToken = lookahead;\n expect('{');\n\n block = parseStatementList();\n\n expect('}');\n\n return delegate.markEnd(delegate.createBlockStatement(block), startToken);\n }\n\n // 12.2 Variable Statement\n\n function parseVariableIdentifier() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n if (token.type !== Token.Identifier) {\n throwUnexpected(token);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseVariableDeclaration(kind) {\n var init = null, id, startToken;\n\n startToken = lookahead;\n id = parseVariableIdentifier();\n\n // 12.2.1\n if (strict && isRestrictedWord(id.name)) {\n throwErrorTolerant({}, Messages.StrictVarName);\n }\n\n if (kind === 'const') {\n expect('=');\n init = parseAssignmentExpression();\n } else if (match('=')) {\n lex();\n init = parseAssignmentExpression();\n }\n\n return delegate.markEnd(delegate.createVariableDeclarator(id, init), startToken);\n }\n\n function parseVariableDeclarationList(kind) {\n var list = [];\n\n do {\n list.push(parseVariableDeclaration(kind));\n if (!match(',')) {\n break;\n }\n lex();\n } while (index < length);\n\n return list;\n }\n\n function parseVariableStatement() {\n var declarations;\n\n expectKeyword('var');\n\n declarations = parseVariableDeclarationList();\n\n consumeSemicolon();\n\n return delegate.createVariableDeclaration(declarations, 'var');\n }\n\n // kind may be `const` or `let`\n // Both are experimental and not in the specification yet.\n // see http://wiki.ecmascript.org/doku.php?id=harmony:const\n // and http://wiki.ecmascript.org/doku.php?id=harmony:let\n function parseConstLetDeclaration(kind) {\n var declarations, startToken;\n\n startToken = lookahead;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken);\n }\n\n // 12.3 Empty Statement\n\n function parseEmptyStatement() {\n expect(';');\n return delegate.createEmptyStatement();\n }\n\n // 12.4 Expression Statement\n\n function parseExpressionStatement() {\n var expr = parseExpression();\n consumeSemicolon();\n return delegate.createExpressionStatement(expr);\n }\n\n // 12.5 If statement\n\n function parseIfStatement() {\n var test, consequent, alternate;\n\n expectKeyword('if');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n consequent = parseStatement();\n\n if (matchKeyword('else')) {\n lex();\n alternate = parseStatement();\n } else {\n alternate = null;\n }\n\n return delegate.createIfStatement(test, consequent, alternate);\n }\n\n // 12.6 Iteration Statements\n\n function parseDoWhileStatement() {\n var body, test, oldInIteration;\n\n expectKeyword('do');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n expectKeyword('while');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n if (match(';')) {\n lex();\n }\n\n return delegate.createDoWhileStatement(body, test);\n }\n\n function parseWhileStatement() {\n var test, body, oldInIteration;\n\n expectKeyword('while');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n return delegate.createWhileStatement(test, body);\n }\n\n function parseForVariableDeclaration() {\n var token, declarations, startToken;\n\n startToken = lookahead;\n token = lex();\n declarations = parseVariableDeclarationList();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, token.value), startToken);\n }\n\n function parseForStatement() {\n var init, test, update, left, right, body, oldInIteration, previousAllowIn = state.allowIn;\n\n init = test = update = null;\n\n expectKeyword('for');\n\n expect('(');\n\n if (match(';')) {\n lex();\n } else {\n if (matchKeyword('var') || matchKeyword('let')) {\n state.allowIn = false;\n init = parseForVariableDeclaration();\n state.allowIn = previousAllowIn;\n\n if (init.declarations.length === 1 && matchKeyword('in')) {\n lex();\n left = init;\n right = parseExpression();\n init = null;\n }\n } else {\n state.allowIn = false;\n init = parseExpression();\n state.allowIn = previousAllowIn;\n\n if (matchKeyword('in')) {\n // LeftHandSideExpression\n if (!isLeftHandSide(init)) {\n throwErrorTolerant({}, Messages.InvalidLHSInForIn);\n }\n\n lex();\n left = init;\n right = parseExpression();\n init = null;\n }\n }\n\n if (typeof left === 'undefined') {\n expect(';');\n }\n }\n\n if (typeof left === 'undefined') {\n\n if (!match(';')) {\n test = parseExpression();\n }\n expect(';');\n\n if (!match(')')) {\n update = parseExpression();\n }\n }\n\n expect(')');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n return (typeof left === 'undefined') ?\n delegate.createForStatement(init, test, update, body) :\n delegate.createForInStatement(left, right, body);\n }\n\n // 12.7 The continue statement\n\n function parseContinueStatement() {\n var label = null, key;\n\n expectKeyword('continue');\n\n // Optimize the most common form: 'continue;'.\n if (source.charCodeAt(index) === 0x3B) {\n lex();\n\n if (!state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(null);\n }\n\n if (peekLineTerminator()) {\n if (!state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(null);\n }\n\n if (lookahead.type === Token.Identifier) {\n label = parseVariableIdentifier();\n\n key = '$' + label.name;\n if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.UnknownLabel, label.name);\n }\n }\n\n consumeSemicolon();\n\n if (label === null && !state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(label);\n }\n\n // 12.8 The break statement\n\n function parseBreakStatement() {\n var label = null, key;\n\n expectKeyword('break');\n\n // Catch the very common case first: immediately a semicolon (U+003B).\n if (source.charCodeAt(index) === 0x3B) {\n lex();\n\n if (!(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(null);\n }\n\n if (peekLineTerminator()) {\n if (!(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(null);\n }\n\n if (lookahead.type === Token.Identifier) {\n label = parseVariableIdentifier();\n\n key = '$' + label.name;\n if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.UnknownLabel, label.name);\n }\n }\n\n consumeSemicolon();\n\n if (label === null && !(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(label);\n }\n\n // 12.9 The return statement\n\n function parseReturnStatement() {\n var argument = null;\n\n expectKeyword('return');\n\n if (!state.inFunctionBody) {\n throwErrorTolerant({}, Messages.IllegalReturn);\n }\n\n // 'return' followed by a space and an identifier is very common.\n if (source.charCodeAt(index) === 0x20) {\n if (isIdentifierStart(source.charCodeAt(index + 1))) {\n argument = parseExpression();\n consumeSemicolon();\n return delegate.createReturnStatement(argument);\n }\n }\n\n if (peekLineTerminator()) {\n return delegate.createReturnStatement(null);\n }\n\n if (!match(';')) {\n if (!match('}') && lookahead.type !== Token.EOF) {\n argument = parseExpression();\n }\n }\n\n consumeSemicolon();\n\n return delegate.createReturnStatement(argument);\n }\n\n // 12.10 The with statement\n\n function parseWithStatement() {\n var object, body;\n\n if (strict) {\n // TODO(ikarienator): Should we update the test cases instead?\n skipComment();\n throwErrorTolerant({}, Messages.StrictModeWith);\n }\n\n expectKeyword('with');\n\n expect('(');\n\n object = parseExpression();\n\n expect(')');\n\n body = parseStatement();\n\n return delegate.createWithStatement(object, body);\n }\n\n // 12.10 The swith statement\n\n function parseSwitchCase() {\n var test, consequent = [], statement, startToken;\n\n startToken = lookahead;\n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n\n while (index < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n statement = parseStatement();\n consequent.push(statement);\n }\n\n return delegate.markEnd(delegate.createSwitchCase(test, consequent), startToken);\n }\n\n function parseSwitchStatement() {\n var discriminant, cases, clause, oldInSwitch, defaultFound;\n\n expectKeyword('switch');\n\n expect('(');\n\n discriminant = parseExpression();\n\n expect(')');\n\n expect('{');\n\n cases = [];\n\n if (match('}')) {\n lex();\n return delegate.createSwitchStatement(discriminant, cases);\n }\n\n oldInSwitch = state.inSwitch;\n state.inSwitch = true;\n defaultFound = false;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n clause = parseSwitchCase();\n if (clause.test === null) {\n if (defaultFound) {\n throwError({}, Messages.MultipleDefaultsInSwitch);\n }\n defaultFound = true;\n }\n cases.push(clause);\n }\n\n state.inSwitch = oldInSwitch;\n\n expect('}');\n\n return delegate.createSwitchStatement(discriminant, cases);\n }\n\n // 12.13 The throw statement\n\n function parseThrowStatement() {\n var argument;\n\n expectKeyword('throw');\n\n if (peekLineTerminator()) {\n throwError({}, Messages.NewlineAfterThrow);\n }\n\n argument = parseExpression();\n\n consumeSemicolon();\n\n return delegate.createThrowStatement(argument);\n }\n\n // 12.14 The try statement\n\n function parseCatchClause() {\n var param, body, startToken;\n\n startToken = lookahead;\n expectKeyword('catch');\n\n expect('(');\n if (match(')')) {\n throwUnexpected(lookahead);\n }\n\n param = parseVariableIdentifier();\n // 12.14.1\n if (strict && isRestrictedWord(param.name)) {\n throwErrorTolerant({}, Messages.StrictCatchVariable);\n }\n\n expect(')');\n body = parseBlock();\n return delegate.markEnd(delegate.createCatchClause(param, body), startToken);\n }\n\n function parseTryStatement() {\n var block, handlers = [], finalizer = null;\n\n expectKeyword('try');\n\n block = parseBlock();\n\n if (matchKeyword('catch')) {\n handlers.push(parseCatchClause());\n }\n\n if (matchKeyword('finally')) {\n lex();\n finalizer = parseBlock();\n }\n\n if (handlers.length === 0 && !finalizer) {\n throwError({}, Messages.NoCatchOrFinally);\n }\n\n return delegate.createTryStatement(block, [], handlers, finalizer);\n }\n\n // 12.15 The debugger statement\n\n function parseDebuggerStatement() {\n expectKeyword('debugger');\n\n consumeSemicolon();\n\n return delegate.createDebuggerStatement();\n }\n\n // 12 Statements\n\n function parseStatement() {\n var type = lookahead.type,\n expr,\n labeledBody,\n key,\n startToken;\n\n if (type === Token.EOF) {\n throwUnexpected(lookahead);\n }\n\n if (type === Token.Punctuator && lookahead.value === '{') {\n return parseBlock();\n }\n\n startToken = lookahead;\n\n if (type === Token.Punctuator) {\n switch (lookahead.value) {\n case ';':\n return delegate.markEnd(parseEmptyStatement(), startToken);\n case '(':\n return delegate.markEnd(parseExpressionStatement(), startToken);\n default:\n break;\n }\n }\n\n if (type === Token.Keyword) {\n switch (lookahead.value) {\n case 'break':\n return delegate.markEnd(parseBreakStatement(), startToken);\n case 'continue':\n return delegate.markEnd(parseContinueStatement(), startToken);\n case 'debugger':\n return delegate.markEnd(parseDebuggerStatement(), startToken);\n case 'do':\n return delegate.markEnd(parseDoWhileStatement(), startToken);\n case 'for':\n return delegate.markEnd(parseForStatement(), startToken);\n case 'function':\n return delegate.markEnd(parseFunctionDeclaration(), startToken);\n case 'if':\n return delegate.markEnd(parseIfStatement(), startToken);\n case 'return':\n return delegate.markEnd(parseReturnStatement(), startToken);\n case 'switch':\n return delegate.markEnd(parseSwitchStatement(), startToken);\n case 'throw':\n return delegate.markEnd(parseThrowStatement(), startToken);\n case 'try':\n return delegate.markEnd(parseTryStatement(), startToken);\n case 'var':\n return delegate.markEnd(parseVariableStatement(), startToken);\n case 'while':\n return delegate.markEnd(parseWhileStatement(), startToken);\n case 'with':\n return delegate.markEnd(parseWithStatement(), startToken);\n default:\n break;\n }\n }\n\n expr = parseExpression();\n\n // 12.12 Labelled Statements\n if ((expr.type === Syntax.Identifier) && match(':')) {\n lex();\n\n key = '$' + expr.name;\n if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.Redeclaration, 'Label', expr.name);\n }\n\n state.labelSet[key] = true;\n labeledBody = parseStatement();\n delete state.labelSet[key];\n return delegate.markEnd(delegate.createLabeledStatement(expr, labeledBody), startToken);\n }\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createExpressionStatement(expr), startToken);\n }\n\n // 13 Function Definition\n\n function parseFunctionSourceElements() {\n var sourceElement, sourceElements = [], token, directive, firstRestricted,\n oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, startToken;\n\n startToken = lookahead;\n expect('{');\n\n while (index < length) {\n if (lookahead.type !== Token.StringLiteral) {\n break;\n }\n token = lookahead;\n\n sourceElement = parseSourceElement();\n sourceElements.push(sourceElement);\n if (sourceElement.expression.type !== Syntax.Literal) {\n // this is not directive\n break;\n }\n directive = source.slice(token.start + 1, token.end - 1);\n if (directive === 'use strict') {\n strict = true;\n if (firstRestricted) {\n throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);\n }\n } else {\n if (!firstRestricted && token.octal) {\n firstRestricted = token;\n }\n }\n }\n\n oldLabelSet = state.labelSet;\n oldInIteration = state.inIteration;\n oldInSwitch = state.inSwitch;\n oldInFunctionBody = state.inFunctionBody;\n\n state.labelSet = {};\n state.inIteration = false;\n state.inSwitch = false;\n state.inFunctionBody = true;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n sourceElement = parseSourceElement();\n if (typeof sourceElement === 'undefined') {\n break;\n }\n sourceElements.push(sourceElement);\n }\n\n expect('}');\n\n state.labelSet = oldLabelSet;\n state.inIteration = oldInIteration;\n state.inSwitch = oldInSwitch;\n state.inFunctionBody = oldInFunctionBody;\n\n return delegate.markEnd(delegate.createBlockStatement(sourceElements), startToken);\n }\n\n function parseParams(firstRestricted) {\n var param, params = [], token, stricted, paramSet, key, message;\n expect('(');\n\n if (!match(')')) {\n paramSet = {};\n while (index < length) {\n token = lookahead;\n param = parseVariableIdentifier();\n key = '$' + token.value;\n if (strict) {\n if (isRestrictedWord(token.value)) {\n stricted = token;\n message = Messages.StrictParamName;\n }\n if (Object.prototype.hasOwnProperty.call(paramSet, key)) {\n stricted = token;\n message = Messages.StrictParamDupe;\n }\n } else if (!firstRestricted) {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictParamName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n } else if (Object.prototype.hasOwnProperty.call(paramSet, key)) {\n firstRestricted = token;\n message = Messages.StrictParamDupe;\n }\n }\n params.push(param);\n paramSet[key] = true;\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return {\n params: params,\n stricted: stricted,\n firstRestricted: firstRestricted,\n message: message\n };\n }\n\n function parseFunctionDeclaration() {\n var id, params = [], body, token, stricted, tmp, firstRestricted, message, previousStrict, startToken;\n\n startToken = lookahead;\n\n expectKeyword('function');\n token = lookahead;\n id = parseVariableIdentifier();\n if (strict) {\n if (isRestrictedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictFunctionName);\n }\n } else {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictFunctionName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n }\n }\n\n tmp = parseParams(firstRestricted);\n params = tmp.params;\n stricted = tmp.stricted;\n firstRestricted = tmp.firstRestricted;\n if (tmp.message) {\n message = tmp.message;\n }\n\n previousStrict = strict;\n body = parseFunctionSourceElements();\n if (strict && firstRestricted) {\n throwError(firstRestricted, message);\n }\n if (strict && stricted) {\n throwErrorTolerant(stricted, message);\n }\n strict = previousStrict;\n\n return delegate.markEnd(delegate.createFunctionDeclaration(id, params, [], body), startToken);\n }\n\n function parseFunctionExpression() {\n var token, id = null, stricted, firstRestricted, message, tmp, params = [], body, previousStrict, startToken;\n\n startToken = lookahead;\n expectKeyword('function');\n\n if (!match('(')) {\n token = lookahead;\n id = parseVariableIdentifier();\n if (strict) {\n if (isRestrictedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictFunctionName);\n }\n } else {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictFunctionName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n }\n }\n }\n\n tmp = parseParams(firstRestricted);\n params = tmp.params;\n stricted = tmp.stricted;\n firstRestricted = tmp.firstRestricted;\n if (tmp.message) {\n message = tmp.message;\n }\n\n previousStrict = strict;\n body = parseFunctionSourceElements();\n if (strict && firstRestricted) {\n throwError(firstRestricted, message);\n }\n if (strict && stricted) {\n throwErrorTolerant(stricted, message);\n }\n strict = previousStrict;\n\n return delegate.markEnd(delegate.createFunctionExpression(id, params, [], body), startToken);\n }\n\n // 14 Program\n\n function parseSourceElement() {\n if (lookahead.type === Token.Keyword) {\n switch (lookahead.value) {\n case 'const':\n case 'let':\n return parseConstLetDeclaration(lookahead.value);\n case 'function':\n return parseFunctionDeclaration();\n default:\n return parseStatement();\n }\n }\n\n if (lookahead.type !== Token.EOF) {\n return parseStatement();\n }\n }\n\n function parseSourceElements() {\n var sourceElement, sourceElements = [], token, directive, firstRestricted;\n\n while (index < length) {\n token = lookahead;\n if (token.type !== Token.StringLiteral) {\n break;\n }\n\n sourceElement = parseSourceElement();\n sourceElements.push(sourceElement);\n if (sourceElement.expression.type !== Syntax.Literal) {\n // this is not directive\n break;\n }\n directive = source.slice(token.start + 1, token.end - 1);\n if (directive === 'use strict') {\n strict = true;\n if (firstRestricted) {\n throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);\n }\n } else {\n if (!firstRestricted && token.octal) {\n firstRestricted = token;\n }\n }\n }\n\n while (index < length) {\n sourceElement = parseSourceElement();\n /* istanbul ignore if */\n if (typeof sourceElement === 'undefined') {\n break;\n }\n sourceElements.push(sourceElement);\n }\n return sourceElements;\n }\n\n function parseProgram() {\n var body, startToken;\n\n skipComment();\n peek();\n startToken = lookahead;\n strict = false;\n\n body = parseSourceElements();\n return delegate.markEnd(delegate.createProgram(body), startToken);\n }\n\n function filterTokenLocation() {\n var i, entry, token, tokens = [];\n\n for (i = 0; i < extra.tokens.length; ++i) {\n entry = extra.tokens[i];\n token = {\n type: entry.type,\n value: entry.value\n };\n if (extra.range) {\n token.range = entry.range;\n }\n if (extra.loc) {\n token.loc = entry.loc;\n }\n tokens.push(token);\n }\n\n extra.tokens = tokens;\n }\n\n function tokenize(code, options) {\n var toString,\n token,\n tokens;\n\n toString = String;\n if (typeof code !== 'string' && !(code instanceof String)) {\n code = toString(code);\n }\n\n delegate = SyntaxTreeDelegate;\n source = code;\n index = 0;\n lineNumber = (source.length > 0) ? 1 : 0;\n lineStart = 0;\n length = source.length;\n lookahead = null;\n state = {\n allowIn: true,\n labelSet: {},\n inFunctionBody: false,\n inIteration: false,\n inSwitch: false,\n lastCommentStart: -1\n };\n\n extra = {};\n\n // Options matching.\n options = options || {};\n\n // Of course we collect tokens here.\n options.tokens = true;\n extra.tokens = [];\n extra.tokenize = true;\n // The following two fields are necessary to compute the Regex tokens.\n extra.openParenToken = -1;\n extra.openCurlyToken = -1;\n\n extra.range = (typeof options.range === 'boolean') && options.range;\n extra.loc = (typeof options.loc === 'boolean') && options.loc;\n\n if (typeof options.comment === 'boolean' && options.comment) {\n extra.comments = [];\n }\n if (typeof options.tolerant === 'boolean' && options.tolerant) {\n extra.errors = [];\n }\n\n try {\n peek();\n if (lookahead.type === Token.EOF) {\n return extra.tokens;\n }\n\n token = lex();\n while (lookahead.type !== Token.EOF) {\n try {\n token = lex();\n } catch (lexError) {\n token = lookahead;\n if (extra.errors) {\n extra.errors.push(lexError);\n // We have to break on the first error\n // to avoid infinite loops.\n break;\n } else {\n throw lexError;\n }\n }\n }\n\n filterTokenLocation();\n tokens = extra.tokens;\n if (typeof extra.comments !== 'undefined') {\n tokens.comments = extra.comments;\n }\n if (typeof extra.errors !== 'undefined') {\n tokens.errors = extra.errors;\n }\n } catch (e) {\n throw e;\n } finally {\n extra = {};\n }\n return tokens;\n }\n\n function parse(code, options) {\n var program, toString;\n\n toString = String;\n if (typeof code !== 'string' && !(code instanceof String)) {\n code = toString(code);\n }\n\n delegate = SyntaxTreeDelegate;\n source = code;\n index = 0;\n lineNumber = (source.length > 0) ? 1 : 0;\n lineStart = 0;\n length = source.length;\n lookahead = null;\n state = {\n allowIn: true,\n labelSet: {},\n inFunctionBody: false,\n inIteration: false,\n inSwitch: false,\n lastCommentStart: -1\n };\n\n extra = {};\n if (typeof options !== 'undefined') {\n extra.range = (typeof options.range === 'boolean') && options.range;\n extra.loc = (typeof options.loc === 'boolean') && options.loc;\n extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment;\n\n if (extra.loc && options.source !== null && options.source !== undefined) {\n extra.source = toString(options.source);\n }\n\n if (typeof options.tokens === 'boolean' && options.tokens) {\n extra.tokens = [];\n }\n if (typeof options.comment === 'boolean' && options.comment) {\n extra.comments = [];\n }\n if (typeof options.tolerant === 'boolean' && options.tolerant) {\n extra.errors = [];\n }\n if (extra.attachComment) {\n extra.range = true;\n extra.comments = [];\n extra.bottomRightStack = [];\n extra.trailingComments = [];\n extra.leadingComments = [];\n }\n }\n\n try {\n program = parseProgram();\n if (typeof extra.comments !== 'undefined') {\n program.comments = extra.comments;\n }\n if (typeof extra.tokens !== 'undefined') {\n filterTokenLocation();\n program.tokens = extra.tokens;\n }\n if (typeof extra.errors !== 'undefined') {\n program.errors = extra.errors;\n }\n } catch (e) {\n throw e;\n } finally {\n extra = {};\n }\n\n return program;\n }\n\n // Sync with *.json manifests.\n exports.version = '1.2.5';\n\n exports.tokenize = tokenize;\n\n exports.parse = parse;\n\n // Deep copy.\n /* istanbul ignore next */\n exports.Syntax = (function () {\n var name, types = {};\n\n if (typeof Object.create === 'function') {\n types = Object.create(null);\n }\n\n for (name in Syntax) {\n if (Syntax.hasOwnProperty(name)) {\n types[name] = Syntax[name];\n }\n }\n\n if (typeof Object.freeze === 'function') {\n Object.freeze(types);\n }\n\n return types;\n }());\n\n}));\n/* vim: set sw=4 ts=4 et tw=80 : */\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","'use strict';\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n","\"use strict\"\n\nfunction iota(n) {\n var result = new Array(n)\n for(var i=0; i\n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","\"use strict\";\n// Initial software, Jean-Daniel Fekete, Christian Poli, Copyright (c) Inria, BSD 3-Clause License, 2021\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.decompress = void 0;\nconst pako = require(\"pako\");\nconst lz4 = require(\"lz4js\");\nexports.decompress = {\n zlib: (input) => {\n return pako.inflate(new Uint8Array(input)).buffer;\n },\n lz4: (input) => {\n return lz4.decompress(new Uint8Array(input)).buffer;\n },\n};\n//# sourceMappingURL=compression.js.map","\"use strict\";\n// Initial software, Jean-Daniel Fekete, Christian Poli, Copyright (c) Inria, BSD 3-Clause License, 2021\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = exports.decompress = exports.rowProxy = exports.table_serialization = exports.EchoTableWidgetView = exports.EchoTableWidgetModel = exports.TableWidgetModel = void 0;\nvar widgets_1 = require(\"./widgets\");\nObject.defineProperty(exports, \"TableWidgetModel\", { enumerable: true, get: function () { return widgets_1.TableWidgetModel; } });\nObject.defineProperty(exports, \"EchoTableWidgetModel\", { enumerable: true, get: function () { return widgets_1.EchoTableWidgetModel; } });\nObject.defineProperty(exports, \"EchoTableWidgetView\", { enumerable: true, get: function () { return widgets_1.EchoTableWidgetView; } });\nvar serializers_1 = require(\"./serializers\");\nObject.defineProperty(exports, \"table_serialization\", { enumerable: true, get: function () { return serializers_1.table_serialization; } });\nObject.defineProperty(exports, \"rowProxy\", { enumerable: true, get: function () { return serializers_1.rowProxy; } });\nvar compression_1 = require(\"./compression\");\nObject.defineProperty(exports, \"decompress\", { enumerable: true, get: function () { return compression_1.decompress; } });\nexports.version = require('../package.json').version;\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Initial software, Jean-Daniel Fekete, Christian Poli, Copyright (c) Inria, BSD 3-Clause License, 2021\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.table_serialization = exports.tableToJSON = exports.rowProxy = exports.JSONToTable = void 0;\nconst ndarray = require(\"ndarray\");\nconst compression_1 = require(\"./compression\");\nconst dtypeToArray = {\n \"bool\": Uint8Array,\n int8: Int8Array,\n int16: Int16Array,\n int32: Int32Array,\n uint8: Uint8Array,\n uint16: Uint16Array,\n uint32: Uint32Array,\n float32: Float32Array,\n float64: Float64Array,\n str: Array\n};\nconst RowIndex = Symbol('rowIndex');\nfunction JSONToTable(obj, manager) {\n if (obj === null) {\n return null;\n }\n var data = {};\n var size = Infinity;\n let decoder = new TextDecoder(\"utf-8\");\n let buffer;\n for (const [col, val] of Object.entries(obj.data)) {\n // console.log(col, val);\n if (val.compression !== undefined) {\n let valBuffer = val.buffer;\n buffer = compression_1.decompress[val.compression](valBuffer.buffer);\n if (val.dtype === \"str\") {\n let u8buf = buffer;\n let strcol = decoder.decode(u8buf);\n let lstr = JSON.parse(strcol);\n data[col] = lstr;\n }\n else { //numeric\n data[col] = ndarray(new dtypeToArray[val.dtype](buffer), val.shape);\n size = Math.min(size, val.shape[0]);\n }\n }\n else { // no compression\n if (val.dtype === \"str\") {\n let lstr = val.buffer;\n data[col] = lstr;\n size = Math.min(size, lstr.length);\n }\n else { //numeric\n let valBuffer = val.buffer;\n data[col] = ndarray(new dtypeToArray[val.dtype](valBuffer.buffer), val.shape);\n size = Math.min(size, val.shape[0]);\n }\n }\n }\n var result = { columns: obj.columns, data: data, size: size };\n // console.log(\"result\", result);\n //let objFoo = obj.data.foo;\n return result;\n}\nexports.JSONToTable = JSONToTable;\nfunction rowProxy(table) {\n if (table === null) {\n return null;\n }\n var fields = table.columns;\n var proto = {};\n fields.forEach((name) => {\n const column = table.data[name];\n const arraycolumn = column;\n const stringcolumn = column;\n // skip columns with duplicate names\n if (proto.hasOwnProperty(name))\n return;\n if (arraycolumn.shape === undefined) {\n Object.defineProperty(proto, name, {\n get: function () {\n const i = this[RowIndex];\n return stringcolumn[i];\n },\n set: function () {\n throw Error('Arrow field values can not be overwritten.');\n },\n enumerable: true\n });\n }\n else {\n Object.defineProperty(proto, name, {\n get: function () {\n const i = this[RowIndex];\n const v = arraycolumn.get(i);\n return isNaN(v) ? null : v;\n },\n set: function () {\n throw Error('Arrow field values can not be overwritten.');\n },\n enumerable: true\n });\n }\n });\n return (i) => {\n var r = Object.create(proto);\n r[RowIndex] = i;\n return r;\n };\n}\nexports.rowProxy = rowProxy;\nfunction tableToJSON(obj, widget) {\n return null; // TODO: implement or remove ...\n}\nexports.tableToJSON = tableToJSON;\n/**\n * Serializers for to/from tables/dataframes\n */\nexports.table_serialization = { deserialize: JSONToTable, serialize: tableToJSON };\n//# sourceMappingURL=serializers.js.map","\"use strict\";\n// Initial software, Jean-Daniel Fekete, Christian Poli, Copyright (c) Inria, BSD 3-Clause License, 2021\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EchoTableWidgetView = exports.EchoTableWidgetModel = exports.TableWidgetModel = void 0;\nconst base_1 = require(\"@jupyter-widgets/base\");\nconst ndarray = require(\"ndarray\");\nconst ndarray_unpack = require(\"ndarray-unpack\");\nconst serializers_1 = require(\"./serializers\");\nlet version = require('../package.json').version;\nclass TableWidgetModel extends base_1.DOMWidgetModel {\n defaults() {\n return Object.assign(Object.assign({}, base_1.DOMWidgetModel.prototype.defaults()), { _model_name: \"TableWidgetModel\", _view_name: null, _model_module: 'jupyter-tablewidgets', _view_module: null, _model_module_version: version, _view_module_version: '', _table: ndarray([]), _columns: [] });\n }\n ;\n}\nexports.TableWidgetModel = TableWidgetModel;\nTableWidgetModel.serializers = Object.assign(Object.assign({}, base_1.DOMWidgetModel.serializers), { _table: serializers_1.table_serialization });\n// https://gist.github.com/pbugnion/63cf43b41ec0eed2d0b7e7426d1c67d2\nclass EchoTableWidgetModel extends base_1.DOMWidgetModel {\n defaults() {\n return Object.assign(Object.assign({}, base_1.DOMWidgetModel.prototype.defaults()), { _model_name: \"EchoTableWidgetModel\", _view_name: \"EchoTableWidgetView\", _model_module: 'jupyter-tablewidgets', _view_module: 'jupyter-tablewidgets', _model_module_version: version, _view_module_version: version, data: [], echo: [] });\n }\n ;\n}\nexports.EchoTableWidgetModel = EchoTableWidgetModel;\nEchoTableWidgetModel.serializers = Object.assign(Object.assign({}, base_1.DOMWidgetModel.serializers), { data: { deserialize: base_1.unpack_models } });\nclass EchoTableWidgetView extends base_1.DOMWidgetView {\n render() {\n return __awaiter(this, void 0, void 0, function* () {\n let that = this.model;\n let subwg = that.get(\"data\");\n let table = subwg.get(\"_table\");\n let res = { 'columns': table.columns, 'data': {} };\n for (const [col, v] of Object.entries(table.data)) {\n let val = v;\n if (val.dtype !== undefined) {\n res.data[col] = ndarray_unpack(val);\n }\n else {\n res.data[col] = val;\n }\n }\n that.set(\"echo\", res);\n this.touch();\n });\n }\n ;\n}\nexports.EchoTableWidgetView = EchoTableWidgetView;\n//# sourceMappingURL=widgets.js.map","// lz4.js - An implementation of Lz4 in plain JavaScript.\n//\n// TODO:\n// - Unify header parsing/writing.\n// - Support options (block size, checksums)\n// - Support streams\n// - Better error handling (handle bad offset, etc.)\n// - HC support (better search algorithm)\n// - Tests/benchmarking\n\nvar xxhash = require('./xxh32.js');\nvar util = require('./util.js');\n\n// Constants\n// --\n\n// Compression format parameters/constants.\nvar minMatch = 4;\nvar minLength = 13;\nvar searchLimit = 5;\nvar skipTrigger = 6;\nvar hashSize = 1 << 16;\n\n// Token constants.\nvar mlBits = 4;\nvar mlMask = (1 << mlBits) - 1;\nvar runBits = 4;\nvar runMask = (1 << runBits) - 1;\n\n// Shared buffers\nvar blockBuf = makeBuffer(5 << 20);\nvar hashTable = makeHashTable();\n\n// Frame constants.\nvar magicNum = 0x184D2204;\n\n// Frame descriptor flags.\nvar fdContentChksum = 0x4;\nvar fdContentSize = 0x8;\nvar fdBlockChksum = 0x10;\n// var fdBlockIndep = 0x20;\nvar fdVersion = 0x40;\nvar fdVersionMask = 0xC0;\n\n// Block sizes.\nvar bsUncompressed = 0x80000000;\nvar bsDefault = 7;\nvar bsShift = 4;\nvar bsMask = 7;\nvar bsMap = {\n 4: 0x10000,\n 5: 0x40000,\n 6: 0x100000,\n 7: 0x400000\n};\n\n// Utility functions/primitives\n// --\n\n// Makes our hashtable. On older browsers, may return a plain array.\nfunction makeHashTable () {\n try {\n return new Uint32Array(hashSize);\n } catch (error) {\n var hashTable = new Array(hashSize);\n\n for (var i = 0; i < hashSize; i++) {\n hashTable[i] = 0;\n }\n\n return hashTable;\n }\n}\n\n// Clear hashtable.\nfunction clearHashTable (table) {\n for (var i = 0; i < hashSize; i++) {\n hashTable[i] = 0;\n }\n}\n\n// Makes a byte buffer. On older browsers, may return a plain array.\nfunction makeBuffer (size) {\n try {\n return new Uint8Array(size);\n } catch (error) {\n var buf = new Array(size);\n\n for (var i = 0; i < size; i++) {\n buf[i] = 0;\n }\n\n return buf;\n }\n}\n\nfunction sliceArray (array, start, end) {\n if (typeof array.buffer !== undefined) {\n if (Uint8Array.prototype.slice) {\n return array.slice(start, end);\n } else {\n // Uint8Array#slice polyfill.\n var len = array.length;\n\n // Calculate start.\n start = start | 0;\n start = (start < 0) ? Math.max(len + start, 0) : Math.min(start, len);\n\n // Calculate end.\n end = (end === undefined) ? len : end | 0;\n end = (end < 0) ? Math.max(len + end, 0) : Math.min(end, len);\n\n // Copy into new array.\n var arraySlice = new Uint8Array(end - start);\n for (var i = start, n = 0; i < end;) {\n arraySlice[n++] = array[i++];\n }\n\n return arraySlice;\n }\n } else {\n // Assume normal array.\n return array.slice(start, end);\n }\n}\n\n// Implementation\n// --\n\n// Calculates an upper bound for lz4 compression.\nexports.compressBound = function compressBound (n) {\n return (n + (n / 255) + 16) | 0;\n};\n\n// Calculates an upper bound for lz4 decompression, by reading the data.\nexports.decompressBound = function decompressBound (src) {\n var sIndex = 0;\n\n // Read magic number\n if (util.readU32(src, sIndex) !== magicNum) {\n throw new Error('invalid magic number');\n }\n\n sIndex += 4;\n\n // Read descriptor\n var descriptor = src[sIndex++];\n\n // Check version\n if ((descriptor & fdVersionMask) !== fdVersion) {\n throw new Error('incompatible descriptor version ' + (descriptor & fdVersionMask));\n }\n\n // Read flags\n var useBlockSum = (descriptor & fdBlockChksum) !== 0;\n var useContentSize = (descriptor & fdContentSize) !== 0;\n\n // Read block size\n var bsIdx = (src[sIndex++] >> bsShift) & bsMask;\n\n if (bsMap[bsIdx] === undefined) {\n throw new Error('invalid block size ' + bsIdx);\n }\n\n var maxBlockSize = bsMap[bsIdx];\n\n // Get content size\n if (useContentSize) {\n return util.readU64(src, sIndex);\n }\n\n // Checksum\n sIndex++;\n\n // Read blocks.\n var maxSize = 0;\n while (true) {\n var blockSize = util.readU32(src, sIndex);\n sIndex += 4;\n\n if (blockSize & bsUncompressed) {\n blockSize &= ~bsUncompressed;\n maxSize += blockSize;\n } else {\n maxSize += maxBlockSize;\n }\n\n if (blockSize === 0) {\n return maxSize;\n }\n\n if (useBlockSum) {\n sIndex += 4;\n }\n\n sIndex += blockSize;\n }\n};\n\n// Creates a buffer of a given byte-size, falling back to plain arrays.\nexports.makeBuffer = makeBuffer;\n\n// Decompresses a block of Lz4.\nexports.decompressBlock = function decompressBlock (src, dst, sIndex, sLength, dIndex) {\n var mLength, mOffset, sEnd, n, i;\n\n // Setup initial state.\n sEnd = sIndex + sLength;\n\n // Consume entire input block.\n while (sIndex < sEnd) {\n var token = src[sIndex++];\n\n // Copy literals.\n var literalCount = (token >> 4);\n if (literalCount > 0) {\n // Parse length.\n if (literalCount === 0xf) {\n while (true) {\n literalCount += src[sIndex];\n if (src[sIndex++] !== 0xff) {\n break;\n }\n }\n }\n\n // Copy literals\n for (n = sIndex + literalCount; sIndex < n;) {\n dst[dIndex++] = src[sIndex++];\n }\n }\n\n if (sIndex >= sEnd) {\n break;\n }\n\n // Copy match.\n mLength = (token & 0xf);\n\n // Parse offset.\n mOffset = src[sIndex++] | (src[sIndex++] << 8);\n\n // Parse length.\n if (mLength === 0xf) {\n while (true) {\n mLength += src[sIndex];\n if (src[sIndex++] !== 0xff) {\n break;\n }\n }\n }\n\n mLength += minMatch;\n\n // Copy match.\n for (i = dIndex - mOffset, n = i + mLength; i < n;) {\n dst[dIndex++] = dst[i++] | 0;\n }\n }\n\n return dIndex;\n};\n\n// Compresses a block with Lz4.\nexports.compressBlock = function compressBlock (src, dst, sIndex, sLength, hashTable) {\n var mIndex, mAnchor, mLength, mOffset, mStep;\n var literalCount, dIndex, sEnd, n;\n\n // Setup initial state.\n dIndex = 0;\n sEnd = sLength + sIndex;\n mAnchor = sIndex;\n\n // Process only if block is large enough.\n if (sLength >= minLength) {\n var searchMatchCount = (1 << skipTrigger) + 3;\n\n // Consume until last n literals (Lz4 spec limitation.)\n while (sIndex + minMatch < sEnd - searchLimit) {\n var seq = util.readU32(src, sIndex);\n var hash = util.hashU32(seq) >>> 0;\n\n // Crush hash to 16 bits.\n hash = ((hash >> 16) ^ hash) >>> 0 & 0xffff;\n\n // Look for a match in the hashtable. NOTE: remove one; see below.\n mIndex = hashTable[hash] - 1;\n\n // Put pos in hash table. NOTE: add one so that zero = invalid.\n hashTable[hash] = sIndex + 1;\n\n // Determine if there is a match (within range.)\n if (mIndex < 0 || ((sIndex - mIndex) >>> 16) > 0 || util.readU32(src, mIndex) !== seq) {\n mStep = searchMatchCount++ >> skipTrigger;\n sIndex += mStep;\n continue;\n }\n\n searchMatchCount = (1 << skipTrigger) + 3;\n\n // Calculate literal count and offset.\n literalCount = sIndex - mAnchor;\n mOffset = sIndex - mIndex;\n\n // We've already matched one word, so get that out of the way.\n sIndex += minMatch;\n mIndex += minMatch;\n\n // Determine match length.\n // N.B.: mLength does not include minMatch, Lz4 adds it back\n // in decoding.\n mLength = sIndex;\n while (sIndex < sEnd - searchLimit && src[sIndex] === src[mIndex]) {\n sIndex++;\n mIndex++;\n }\n mLength = sIndex - mLength;\n\n // Write token + literal count.\n var token = mLength < mlMask ? mLength : mlMask;\n if (literalCount >= runMask) {\n dst[dIndex++] = (runMask << mlBits) + token;\n for (n = literalCount - runMask; n >= 0xff; n -= 0xff) {\n dst[dIndex++] = 0xff;\n }\n dst[dIndex++] = n;\n } else {\n dst[dIndex++] = (literalCount << mlBits) + token;\n }\n\n // Write literals.\n for (var i = 0; i < literalCount; i++) {\n dst[dIndex++] = src[mAnchor + i];\n }\n\n // Write offset.\n dst[dIndex++] = mOffset;\n dst[dIndex++] = (mOffset >> 8);\n\n // Write match length.\n if (mLength >= mlMask) {\n for (n = mLength - mlMask; n >= 0xff; n -= 0xff) {\n dst[dIndex++] = 0xff;\n }\n dst[dIndex++] = n;\n }\n\n // Move the anchor.\n mAnchor = sIndex;\n }\n }\n\n // Nothing was encoded.\n if (mAnchor === 0) {\n return 0;\n }\n\n // Write remaining literals.\n // Write literal token+count.\n literalCount = sEnd - mAnchor;\n if (literalCount >= runMask) {\n dst[dIndex++] = (runMask << mlBits);\n for (n = literalCount - runMask; n >= 0xff; n -= 0xff) {\n dst[dIndex++] = 0xff;\n }\n dst[dIndex++] = n;\n } else {\n dst[dIndex++] = (literalCount << mlBits);\n }\n\n // Write literals.\n sIndex = mAnchor;\n while (sIndex < sEnd) {\n dst[dIndex++] = src[sIndex++];\n }\n\n return dIndex;\n};\n\n// Decompresses a frame of Lz4 data.\nexports.decompressFrame = function decompressFrame (src, dst) {\n var useBlockSum, useContentSum, useContentSize, descriptor;\n var sIndex = 0;\n var dIndex = 0;\n\n // Read magic number\n if (util.readU32(src, sIndex) !== magicNum) {\n throw new Error('invalid magic number');\n }\n\n sIndex += 4;\n\n // Read descriptor\n descriptor = src[sIndex++];\n\n // Check version\n if ((descriptor & fdVersionMask) !== fdVersion) {\n throw new Error('incompatible descriptor version');\n }\n\n // Read flags\n useBlockSum = (descriptor & fdBlockChksum) !== 0;\n useContentSum = (descriptor & fdContentChksum) !== 0;\n useContentSize = (descriptor & fdContentSize) !== 0;\n\n // Read block size\n var bsIdx = (src[sIndex++] >> bsShift) & bsMask;\n\n if (bsMap[bsIdx] === undefined) {\n throw new Error('invalid block size');\n }\n\n if (useContentSize) {\n // TODO: read content size\n sIndex += 8;\n }\n\n sIndex++;\n\n // Read blocks.\n while (true) {\n var compSize;\n\n compSize = util.readU32(src, sIndex);\n sIndex += 4;\n\n if (compSize === 0) {\n break;\n }\n\n if (useBlockSum) {\n // TODO: read block checksum\n sIndex += 4;\n }\n\n // Check if block is compressed\n if ((compSize & bsUncompressed) !== 0) {\n // Mask off the 'uncompressed' bit\n compSize &= ~bsUncompressed;\n\n // Copy uncompressed data into destination buffer.\n for (var j = 0; j < compSize; j++) {\n dst[dIndex++] = src[sIndex++];\n }\n } else {\n // Decompress into blockBuf\n dIndex = exports.decompressBlock(src, dst, sIndex, compSize, dIndex);\n sIndex += compSize;\n }\n }\n\n if (useContentSum) {\n // TODO: read content checksum\n sIndex += 4;\n }\n\n return dIndex;\n};\n\n// Compresses data to an Lz4 frame.\nexports.compressFrame = function compressFrame (src, dst) {\n var dIndex = 0;\n\n // Write magic number.\n util.writeU32(dst, dIndex, magicNum);\n dIndex += 4;\n\n // Descriptor flags.\n dst[dIndex++] = fdVersion;\n dst[dIndex++] = bsDefault << bsShift;\n\n // Descriptor checksum.\n dst[dIndex] = xxhash.hash(0, dst, 4, dIndex - 4) >> 8;\n dIndex++;\n\n // Write blocks.\n var maxBlockSize = bsMap[bsDefault];\n var remaining = src.length;\n var sIndex = 0;\n\n // Clear the hashtable.\n clearHashTable(hashTable);\n\n // Split input into blocks and write.\n while (remaining > 0) {\n var compSize = 0;\n var blockSize = remaining > maxBlockSize ? maxBlockSize : remaining;\n\n compSize = exports.compressBlock(src, blockBuf, sIndex, blockSize, hashTable);\n\n if (compSize > blockSize || compSize === 0) {\n // Output uncompressed.\n util.writeU32(dst, dIndex, 0x80000000 | blockSize);\n dIndex += 4;\n\n for (var z = sIndex + blockSize; sIndex < z;) {\n dst[dIndex++] = src[sIndex++];\n }\n\n remaining -= blockSize;\n } else {\n // Output compressed.\n util.writeU32(dst, dIndex, compSize);\n dIndex += 4;\n\n for (var j = 0; j < compSize;) {\n dst[dIndex++] = blockBuf[j++];\n }\n\n sIndex += blockSize;\n remaining -= blockSize;\n }\n }\n\n // Write blank end block.\n util.writeU32(dst, dIndex, 0);\n dIndex += 4;\n\n return dIndex;\n};\n\n// Decompresses a buffer containing an Lz4 frame. maxSize is optional; if not\n// provided, a maximum size will be determined by examining the data. The\n// buffer returned will always be perfectly-sized.\nexports.decompress = function decompress (src, maxSize) {\n var dst, size;\n\n if (maxSize === undefined) {\n maxSize = exports.decompressBound(src);\n }\n\n dst = exports.makeBuffer(maxSize);\n size = exports.decompressFrame(src, dst);\n\n if (size !== maxSize) {\n dst = sliceArray(dst, 0, size);\n }\n\n return dst;\n};\n\n// Compresses a buffer to an Lz4 frame. maxSize is optional; if not provided,\n// a buffer will be created based on the theoretical worst output size for a\n// given input size. The buffer returned will always be perfectly-sized.\nexports.compress = function compress (src, maxSize) {\n var dst, size;\n\n if (maxSize === undefined) {\n maxSize = exports.compressBound(src.length);\n }\n\n dst = exports.makeBuffer(maxSize);\n size = exports.compressFrame(src, dst);\n\n if (size !== maxSize) {\n dst = sliceArray(dst, 0, size);\n }\n\n return dst;\n};\n","// Simple hash function, from: http://burtleburtle.net/bob/hash/integer.html.\n// Chosen because it doesn't use multiply and achieves full avalanche.\nexports.hashU32 = function hashU32 (a) {\n a = a | 0;\n a = a + 2127912214 + (a << 12) | 0;\n a = a ^ -949894596 ^ a >>> 19;\n a = a + 374761393 + (a << 5) | 0;\n a = a + -744332180 ^ a << 9;\n a = a + -42973499 + (a << 3) | 0;\n return a ^ -1252372727 ^ a >>> 16 | 0;\n};\n\n// Reads a 64-bit little-endian integer from an array.\nexports.readU64 = function readU64 (b, n) {\n var x = 0;\n x |= b[n++] << 0;\n x |= b[n++] << 8;\n x |= b[n++] << 16;\n x |= b[n++] << 24;\n x |= b[n++] << 32;\n x |= b[n++] << 40;\n x |= b[n++] << 48;\n x |= b[n++] << 56;\n return x;\n};\n\n// Reads a 32-bit little-endian integer from an array.\nexports.readU32 = function readU32 (b, n) {\n var x = 0;\n x |= b[n++] << 0;\n x |= b[n++] << 8;\n x |= b[n++] << 16;\n x |= b[n++] << 24;\n return x;\n};\n\n// Writes a 32-bit little-endian integer from an array.\nexports.writeU32 = function writeU32 (b, n, x) {\n b[n++] = (x >> 0) & 0xff;\n b[n++] = (x >> 8) & 0xff;\n b[n++] = (x >> 16) & 0xff;\n b[n++] = (x >> 24) & 0xff;\n};\n\n// Multiplies two numbers using 32-bit integer multiplication.\n// Algorithm from Emscripten.\nexports.imul = function imul (a, b) {\n var ah = a >>> 16;\n var al = a & 65535;\n var bh = b >>> 16;\n var bl = b & 65535;\n\n return al * bl + (ah * bl + al * bh << 16) | 0;\n};\n","// xxh32.js - implementation of xxhash32 in plain JavaScript\nvar util = require('./util.js');\n\n// xxhash32 primes\nvar prime1 = 0x9e3779b1;\nvar prime2 = 0x85ebca77;\nvar prime3 = 0xc2b2ae3d;\nvar prime4 = 0x27d4eb2f;\nvar prime5 = 0x165667b1;\n\n// Utility functions/primitives\n// --\n\nfunction rotl32 (x, r) {\n x = x | 0;\n r = r | 0;\n\n return x >>> (32 - r | 0) | x << r | 0;\n}\n\nfunction rotmul32 (h, r, m) {\n h = h | 0;\n r = r | 0;\n m = m | 0;\n\n return util.imul(h >>> (32 - r | 0) | h << r, m) | 0;\n}\n\nfunction shiftxor32 (h, s) {\n h = h | 0;\n s = s | 0;\n\n return h >>> s ^ h | 0;\n}\n\n// Implementation\n// --\n\nfunction xxhapply (h, src, m0, s, m1) {\n return rotmul32(util.imul(src, m0) + h, s, m1);\n}\n\nfunction xxh1 (h, src, index) {\n return rotmul32((h + util.imul(src[index], prime5)), 11, prime1);\n}\n\nfunction xxh4 (h, src, index) {\n return xxhapply(h, util.readU32(src, index), prime3, 17, prime4);\n}\n\nfunction xxh16 (h, src, index) {\n return [\n xxhapply(h[0], util.readU32(src, index + 0), prime2, 13, prime1),\n xxhapply(h[1], util.readU32(src, index + 4), prime2, 13, prime1),\n xxhapply(h[2], util.readU32(src, index + 8), prime2, 13, prime1),\n xxhapply(h[3], util.readU32(src, index + 12), prime2, 13, prime1)\n ];\n}\n\nfunction xxh32 (seed, src, index, len) {\n var h, l;\n l = len;\n if (len >= 16) {\n h = [\n seed + prime1 + prime2,\n seed + prime2,\n seed,\n seed - prime1\n ];\n\n while (len >= 16) {\n h = xxh16(h, src, index);\n\n index += 16;\n len -= 16;\n }\n\n h = rotl32(h[0], 1) + rotl32(h[1], 7) + rotl32(h[2], 12) + rotl32(h[3], 18) + l;\n } else {\n h = (seed + prime5 + len) >>> 0;\n }\n\n while (len >= 4) {\n h = xxh4(h, src, index);\n\n index += 4;\n len -= 4;\n }\n\n while (len > 0) {\n h = xxh1(h, src, index);\n\n index++;\n len--;\n }\n\n h = shiftxor32(util.imul(shiftxor32(util.imul(shiftxor32(h, 15), prime2), 13), prime3), 16);\n\n return h >>> 0;\n}\n\nexports.hash = xxh32;\n","\"use strict\"\n\nvar dup = require(\"dup\")\nvar cwise = require(\"cwise\")\n\nvar do_unpack = cwise({ \n args: [\"array\", \"scalar\", \"index\"],\n body: function unpackCwise(arr, a, idx) {\n var v = a, i\n for(i=0;iMath.abs(this.stride[1]))?[1,0]:[0,1]}})\")\n } else if(dimension === 3) {\n code.push(\n\"var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);\\\nif(s0>s1){\\\nif(s1>s2){\\\nreturn [2,1,0];\\\n}else if(s0>s2){\\\nreturn [1,2,0];\\\n}else{\\\nreturn [1,0,2];\\\n}\\\n}else if(s0>s2){\\\nreturn [2,0,1];\\\n}else if(s2>s1){\\\nreturn [0,1,2];\\\n}else{\\\nreturn [0,2,1];\\\n}}})\")\n }\n } else {\n code.push(\"ORDER})\")\n }\n }\n\n //view.set(i0, ..., v):\n code.push(\n\"proto.set=function \"+className+\"_set(\"+args.join(\",\")+\",v){\")\n if(useGetters) {\n code.push(\"return this.data.set(\"+index_str+\",v)}\")\n } else {\n code.push(\"return this.data[\"+index_str+\"]=v}\")\n }\n\n //view.get(i0, ...):\n code.push(\"proto.get=function \"+className+\"_get(\"+args.join(\",\")+\"){\")\n if(useGetters) {\n code.push(\"return this.data.get(\"+index_str+\")}\")\n } else {\n code.push(\"return this.data[\"+index_str+\"]}\")\n }\n\n //view.index:\n code.push(\n \"proto.index=function \"+className+\"_index(\", args.join(), \"){return \"+index_str+\"}\")\n\n //view.hi():\n code.push(\"proto.hi=function \"+className+\"_hi(\"+args.join(\",\")+\"){return new \"+className+\"(this.data,\"+\n indices.map(function(i) {\n return [\"(typeof i\",i,\"!=='number'||i\",i,\"<0)?this.shape[\", i, \"]:i\", i,\"|0\"].join(\"\")\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"this.stride[\"+i + \"]\"\n }).join(\",\")+\",this.offset)}\")\n\n //view.lo():\n var a_vars = indices.map(function(i) { return \"a\"+i+\"=this.shape[\"+i+\"]\" })\n var c_vars = indices.map(function(i) { return \"c\"+i+\"=this.stride[\"+i+\"]\" })\n code.push(\"proto.lo=function \"+className+\"_lo(\"+args.join(\",\")+\"){var b=this.offset,d=0,\"+a_vars.join(\",\")+\",\"+c_vars.join(\",\"))\n for(var i=0; i=0){\\\nd=i\"+i+\"|0;\\\nb+=c\"+i+\"*d;\\\na\"+i+\"-=d}\")\n }\n code.push(\"return new \"+className+\"(this.data,\"+\n indices.map(function(i) {\n return \"a\"+i\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"c\"+i\n }).join(\",\")+\",b)}\")\n\n //view.step():\n code.push(\"proto.step=function \"+className+\"_step(\"+args.join(\",\")+\"){var \"+\n indices.map(function(i) {\n return \"a\"+i+\"=this.shape[\"+i+\"]\"\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"b\"+i+\"=this.stride[\"+i+\"]\"\n }).join(\",\")+\",c=this.offset,d=0,ceil=Math.ceil\")\n for(var i=0; i=0){c=(c+this.stride[\"+i+\"]*i\"+i+\")|0}else{a.push(this.shape[\"+i+\"]);b.push(this.stride[\"+i+\"])}\")\n }\n code.push(\"var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}\")\n\n //Add return statement\n code.push(\"return function construct_\"+className+\"(data,shape,stride,offset){return new \"+className+\"(data,\"+\n indices.map(function(i) {\n return \"shape[\"+i+\"]\"\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"stride[\"+i+\"]\"\n }).join(\",\")+\",offset)}\")\n\n //Compile procedure\n var procedure = new Function(\"CTOR_LIST\", \"ORDER\", code.join(\"\\n\"))\n return procedure(CACHED_CONSTRUCTORS[dtype], order)\n}\n\nfunction arrayDType(data) {\n if(isBuffer(data)) {\n return \"buffer\"\n }\n if(hasTypedArrays) {\n switch(Object.prototype.toString.call(data)) {\n case \"[object Float64Array]\":\n return \"float64\"\n case \"[object Float32Array]\":\n return \"float32\"\n case \"[object Int8Array]\":\n return \"int8\"\n case \"[object Int16Array]\":\n return \"int16\"\n case \"[object Int32Array]\":\n return \"int32\"\n case \"[object Uint8Array]\":\n return \"uint8\"\n case \"[object Uint16Array]\":\n return \"uint16\"\n case \"[object Uint32Array]\":\n return \"uint32\"\n case \"[object Uint8ClampedArray]\":\n return \"uint8_clamped\"\n case \"[object BigInt64Array]\":\n return \"bigint64\"\n case \"[object BigUint64Array]\":\n return \"biguint64\"\n }\n }\n if(Array.isArray(data)) {\n return \"array\"\n }\n return \"generic\"\n}\n\nvar CACHED_CONSTRUCTORS = {\n \"float32\":[],\n \"float64\":[],\n \"int8\":[],\n \"int16\":[],\n \"int32\":[],\n \"uint8\":[],\n \"uint16\":[],\n \"uint32\":[],\n \"array\":[],\n \"uint8_clamped\":[],\n \"bigint64\": [],\n \"biguint64\": [],\n \"buffer\":[],\n \"generic\":[]\n}\n\n;(function() {\n for(var id in CACHED_CONSTRUCTORS) {\n CACHED_CONSTRUCTORS[id].push(compileConstructor(id, -1))\n }\n});\n\nfunction wrappedNDArrayCtor(data, shape, stride, offset) {\n if(data === undefined) {\n var ctor = CACHED_CONSTRUCTORS.array[0]\n return ctor([])\n } else if(typeof data === \"number\") {\n data = [data]\n }\n if(shape === undefined) {\n shape = [ data.length ]\n }\n var d = shape.length\n if(stride === undefined) {\n stride = new Array(d)\n for(var i=d-1, sz=1; i>=0; --i) {\n stride[i] = sz\n sz *= shape[i]\n }\n }\n if(offset === undefined) {\n offset = 0\n for(var i=0; i Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param).\n **/\n\n/**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n **/\n\n/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\n\n/**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw deflate\n * - `gzip` (Boolean) - create gzip wrapper\n * - `header` (Object) - custom header for gzip\n * - `text` (Boolean) - true if compressed data believed to be text\n * - `time` (Number) - modification time, unix timestamp\n * - `os` (Number) - operation system code\n * - `extra` (Array) - array of bytes with extra data (max 65536)\n * - `name` (String) - file name (binary string)\n * - `comment` (String) - comment (binary string)\n * - `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * , chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true); // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n **/\nfunction Deflate(options) {\n this.options = utils.assign({\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY\n }, options || {});\n\n let opt = this.options;\n\n if (opt.raw && (opt.windowBits > 0)) {\n opt.windowBits = -opt.windowBits;\n }\n\n else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n opt.windowBits += 16;\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n let status = zlib_deflate.deflateInit2(\n this.strm,\n opt.level,\n opt.method,\n opt.windowBits,\n opt.memLevel,\n opt.strategy\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n if (opt.header) {\n zlib_deflate.deflateSetHeader(this.strm, opt.header);\n }\n\n if (opt.dictionary) {\n let dict;\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n // If we need to compress text, change encoding to utf8.\n dict = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(opt.dictionary);\n } else {\n dict = opt.dictionary;\n }\n\n status = zlib_deflate.deflateSetDictionary(this.strm, dict);\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this._dict_set = true;\n }\n}\n\n/**\n * Deflate#push(data[, flush_mode]) -> Boolean\n * - data (Uint8Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with\n * new compressed chunks. Returns `true` on success. The last data block must\n * have `flush_mode` Z_FINISH (or `true`). That will flush internal pending\n * buffers and call [[Deflate#onEnd]].\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nDeflate.prototype.push = function (data, flush_mode) {\n const strm = this.strm;\n const chunkSize = this.options.chunkSize;\n let status, _flush_mode;\n\n if (this.ended) { return false; }\n\n if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;\n else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH;\n\n // Convert data if needed\n if (typeof data === 'string') {\n // If we need to compress text, change encoding to utf8.\n strm.input = strings.string2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n for (;;) {\n if (strm.avail_out === 0) {\n strm.output = new Uint8Array(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n // Make sure avail_out > 6 to avoid repeating markers\n if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH) && strm.avail_out <= 6) {\n this.onData(strm.output.subarray(0, strm.next_out));\n strm.avail_out = 0;\n continue;\n }\n\n status = zlib_deflate.deflate(strm, _flush_mode);\n\n // Ended => flush and finish\n if (status === Z_STREAM_END) {\n if (strm.next_out > 0) {\n this.onData(strm.output.subarray(0, strm.next_out));\n }\n status = zlib_deflate.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK;\n }\n\n // Flush if out buffer full\n if (strm.avail_out === 0) {\n this.onData(strm.output);\n continue;\n }\n\n // Flush if requested and has data\n if (_flush_mode > 0 && strm.next_out > 0) {\n this.onData(strm.output.subarray(0, strm.next_out));\n strm.avail_out = 0;\n continue;\n }\n\n if (strm.avail_in === 0) break;\n }\n\n return true;\n};\n\n\n/**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array): output data.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nDeflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Deflate#onEnd(status) -> Void\n * - status (Number): deflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called once after you tell deflate that the input stream is\n * complete (Z_FINISH). By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nDeflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n this.result = utils.flattenChunks(this.chunks);\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * deflate(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\n *\n * - level\n * - windowBits\n * - memLevel\n * - strategy\n * - dictionary\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * const data = new Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate(input, options) {\n const deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}\n\n\nmodule.exports.Deflate = Deflate;\nmodule.exports.deflate = deflate;\nmodule.exports.deflateRaw = deflateRaw;\nmodule.exports.gzip = gzip;\nmodule.exports.constants = require('./zlib/constants');\n","'use strict';\n\n\nconst zlib_inflate = require('./zlib/inflate');\nconst utils = require('./utils/common');\nconst strings = require('./utils/strings');\nconst msg = require('./zlib/messages');\nconst ZStream = require('./zlib/zstream');\nconst GZheader = require('./zlib/gzheader');\n\nconst toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH, Z_FINISH,\n Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR\n} = require('./zlib/constants');\n\n/* ===========================================================================*/\n\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * const chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * const chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate(options) {\n this.options = utils.assign({\n chunkSize: 1024 * 64,\n windowBits: 15,\n to: ''\n }, options || {});\n\n const opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n let status = zlib_inflate.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this.header = new GZheader();\n\n zlib_inflate.inflateGetHeader(this.strm, this.header);\n\n // Setup dictionary\n if (opt.dictionary) {\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n opt.dictionary = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n opt.dictionary = new Uint8Array(opt.dictionary);\n }\n if (opt.raw) { //In raw mode we need to set the dictionary early\n status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n }\n }\n}\n\n/**\n * Inflate#push(data[, flush_mode]) -> Boolean\n * - data (Uint8Array|ArrayBuffer): input data\n * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE\n * flush modes. See constants. Skipped or `false` means Z_NO_FLUSH,\n * `true` means Z_FINISH.\n *\n * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. If end of stream detected,\n * [[Inflate#onEnd]] will be called.\n *\n * `flush_mode` is not needed for normal operation, because end of stream\n * detected automatically. You may try to use it for advanced things, but\n * this functionality was not tested.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nInflate.prototype.push = function (data, flush_mode) {\n const strm = this.strm;\n const chunkSize = this.options.chunkSize;\n const dictionary = this.options.dictionary;\n let status, _flush_mode, last_avail_out;\n\n if (this.ended) return false;\n\n if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;\n else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH;\n\n // Convert data if needed\n if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n for (;;) {\n if (strm.avail_out === 0) {\n strm.output = new Uint8Array(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = zlib_inflate.inflate(strm, _flush_mode);\n\n if (status === Z_NEED_DICT && dictionary) {\n status = zlib_inflate.inflateSetDictionary(strm, dictionary);\n\n if (status === Z_OK) {\n status = zlib_inflate.inflate(strm, _flush_mode);\n } else if (status === Z_DATA_ERROR) {\n // Replace code with more verbose\n status = Z_NEED_DICT;\n }\n }\n\n // Skip snyc markers if more data follows and not raw mode\n while (strm.avail_in > 0 &&\n status === Z_STREAM_END &&\n strm.state.wrap > 0 &&\n data[strm.next_in] !== 0)\n {\n zlib_inflate.inflateReset(strm);\n status = zlib_inflate.inflate(strm, _flush_mode);\n }\n\n switch (status) {\n case Z_STREAM_ERROR:\n case Z_DATA_ERROR:\n case Z_NEED_DICT:\n case Z_MEM_ERROR:\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n // Remember real `avail_out` value, because we may patch out buffer content\n // to align utf8 strings boundaries.\n last_avail_out = strm.avail_out;\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === Z_STREAM_END) {\n\n if (this.options.to === 'string') {\n\n let next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n let tail = strm.next_out - next_out_utf8;\n let utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail & realign counters\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) strm.output.set(strm.output.subarray(next_out_utf8, next_out_utf8 + tail), 0);\n\n this.onData(utf8str);\n\n } else {\n this.onData(strm.output.length === strm.next_out ? strm.output : strm.output.subarray(0, strm.next_out));\n }\n }\n }\n\n // Must repeat iteration if out buffer is full\n if (status === Z_OK && last_avail_out === 0) continue;\n\n // Finalize if end of stream reached.\n if (status === Z_STREAM_END) {\n status = zlib_inflate.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return true;\n }\n\n if (strm.avail_in === 0) break;\n }\n\n return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|String): output data. When string output requested,\n * each chunk will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nInflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH). By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako');\n * const input = pako.deflate(new Uint8Array([1,2,3,4,5,6,7,8,9]));\n * let output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err) {\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate(input, options) {\n const inflator = new Inflate(options);\n\n inflator.push(input);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) throw inflator.msg || msg[inflator.err];\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nmodule.exports.Inflate = Inflate;\nmodule.exports.inflate = inflate;\nmodule.exports.inflateRaw = inflateRaw;\nmodule.exports.ungzip = inflate;\nmodule.exports.constants = require('./zlib/constants');\n","'use strict';\n\n\nconst _has = (obj, key) => {\n return Object.prototype.hasOwnProperty.call(obj, key);\n};\n\nmodule.exports.assign = function (obj /*from1, from2, from3, ...*/) {\n const sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n const source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (const p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// Join array of chunks to single array.\nmodule.exports.flattenChunks = (chunks) => {\n // calculate data length\n let len = 0;\n\n for (let i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n const result = new Uint8Array(len);\n\n for (let i = 0, pos = 0, l = chunks.length; i < l; i++) {\n let chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n};\n","// String encode/decode helpers\n'use strict';\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nlet STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nconst _utf8len = new Uint8Array(256);\nfor (let q = 0; q < 256; q++) {\n _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nmodule.exports.string2buf = (str) => {\n if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) {\n return new TextEncoder().encode(str);\n }\n\n let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n buf = new Uint8Array(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n};\n\n// Helper\nconst buf2binstring = (buf, len) => {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if (buf.subarray && STR_APPLY_UIA_OK) {\n return String.fromCharCode.apply(null, buf.length === len ? buf : buf.subarray(0, len));\n }\n }\n\n let result = '';\n for (let i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n};\n\n\n// convert array to string\nmodule.exports.buf2string = (buf, max) => {\n const len = max || buf.length;\n\n if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) {\n return new TextDecoder().decode(buf.subarray(0, max));\n }\n\n let i, out;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n const utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n let c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n let c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nmodule.exports.utf8border = (buf, max) => {\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n let pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n","'use strict';\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst adler32 = (adler, buf, len, pos) => {\n let s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n};\n\n\nmodule.exports = adler32;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n","'use strict';\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nconst makeTable = () => {\n let c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n};\n\n// Create table on load. Just 255 signed longs. Not a problem.\nconst crcTable = new Uint32Array(makeTable());\n\n\nconst crc32 = (crc, buf, len, pos) => {\n const t = crcTable;\n const end = pos + len;\n\n crc ^= -1;\n\n for (let i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n};\n\n\nmodule.exports = crc32;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst { _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align } = require('./trees');\nconst adler32 = require('./adler32');\nconst crc32 = require('./crc32');\nconst msg = require('./messages');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH, Z_PARTIAL_FLUSH, Z_FULL_FLUSH, Z_FINISH, Z_BLOCK,\n Z_OK, Z_STREAM_END, Z_STREAM_ERROR, Z_DATA_ERROR, Z_BUF_ERROR,\n Z_DEFAULT_COMPRESSION,\n Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED, Z_DEFAULT_STRATEGY,\n Z_UNKNOWN,\n Z_DEFLATED\n} = require('./constants');\n\n/*============================================================================*/\n\n\nconst MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nconst MAX_WBITS = 15;\n/* 32K LZ77 window */\nconst DEF_MEM_LEVEL = 8;\n\n\nconst LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nconst LITERALS = 256;\n/* number of literal bytes 0..255 */\nconst L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nconst D_CODES = 30;\n/* number of distance codes */\nconst BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nconst HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nconst MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\nconst MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nconst PRESET_DICT = 0x20;\n\nconst INIT_STATE = 42; /* zlib header -> BUSY_STATE */\n//#ifdef GZIP\nconst GZIP_STATE = 57; /* gzip header -> BUSY_STATE | EXTRA_STATE */\n//#endif\nconst EXTRA_STATE = 69; /* gzip extra block -> NAME_STATE */\nconst NAME_STATE = 73; /* gzip file name -> COMMENT_STATE */\nconst COMMENT_STATE = 91; /* gzip comment -> HCRC_STATE */\nconst HCRC_STATE = 103; /* gzip header CRC -> BUSY_STATE */\nconst BUSY_STATE = 113; /* deflate -> FINISH_STATE */\nconst FINISH_STATE = 666; /* stream complete */\n\nconst BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nconst BS_BLOCK_DONE = 2; /* block flush performed */\nconst BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nconst BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nconst OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nconst err = (strm, errorCode) => {\n strm.msg = msg[errorCode];\n return errorCode;\n};\n\nconst rank = (f) => {\n return ((f) * 2) - ((f) > 4 ? 9 : 0);\n};\n\nconst zero = (buf) => {\n let len = buf.length; while (--len >= 0) { buf[len] = 0; }\n};\n\n/* ===========================================================================\n * Slide the hash table when sliding the window down (could be avoided with 32\n * bit values at the expense of memory usage). We slide even when level == 0 to\n * keep the hash table consistent if we switch back to level > 0 later.\n */\nconst slide_hash = (s) => {\n let n, m;\n let p;\n let wsize = s.w_size;\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= wsize ? m - wsize : 0);\n } while (--n);\n n = wsize;\n//#ifndef FASTEST\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= wsize ? m - wsize : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n//#endif\n};\n\n/* eslint-disable new-cap */\nlet HASH_ZLIB = (s, prev, data) => ((prev << s.hash_shift) ^ data) & s.hash_mask;\n// This hash causes less collisions, https://github.com/nodeca/pako/issues/135\n// But breaks binary compatibility\n//let HASH_FAST = (s, prev, data) => ((prev << 8) + (prev >> 8) + (data << 4)) & s.hash_mask;\nlet HASH = HASH_ZLIB;\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output, except for\n * some deflate_stored() output, goes through this function so some\n * applications may wish to modify it to avoid allocating a large\n * strm->next_out buffer and copying into it. (See also read_buf()).\n */\nconst flush_pending = (strm) => {\n const s = strm.state;\n\n //_tr_flush_bits(s);\n let len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n strm.output.set(s.pending_buf.subarray(s.pending_out, s.pending_out + len), strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n};\n\n\nconst flush_block_only = (s, last) => {\n _tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n};\n\n\nconst put_byte = (s, b) => {\n s.pending_buf[s.pending++] = b;\n};\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nconst putShortMSB = (s, b) => {\n\n // put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n};\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nconst read_buf = (strm, buf, start, size) => {\n\n let len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n buf.set(strm.input.subarray(strm.next_in, strm.next_in + len), start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n};\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nconst longest_match = (s, cur_match) => {\n\n let chain_length = s.max_chain_length; /* max hash chain length */\n let scan = s.strstart; /* current string */\n let match; /* matched string */\n let len; /* length of current match */\n let best_len = s.prev_length; /* best match length so far */\n let nice_match = s.nice_match; /* stop if match long enough */\n const limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n const _win = s.window; // shortcut\n\n const wmask = s.w_mask;\n const prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n const strend = s.strstart + MAX_MATCH;\n let scan_end1 = _win[scan + best_len - 1];\n let scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n};\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nconst fill_window = (s) => {\n\n const _w_size = s.w_size;\n let n, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n s.window.set(s.window.subarray(_w_size, _w_size + _w_size - more), 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n slide_hash(s);\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + 1]);\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]);\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// const curr = s.strstart + s.lookahead;\n// let init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n};\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n *\n * In case deflateParams() is used to later switch to a non-zero compression\n * level, s->matches (otherwise unused when storing) keeps track of the number\n * of hash table slides to perform. If s->matches is 1, then one hash table\n * slide will be done when switching. If s->matches is 2, the maximum value\n * allowed here, then the hash table will be cleared, since two or more slides\n * is the same as a clear.\n *\n * deflate_stored() is written to minimize the number of times an input byte is\n * copied. It is most efficient with large input and output buffers, which\n * maximizes the opportunites to have a single copy from next_in to next_out.\n */\nconst deflate_stored = (s, flush) => {\n\n /* Smallest worthy block size when not flushing or finishing. By default\n * this is 32K. This can be as small as 507 bytes for memLevel == 1. For\n * large input and output buffers, the stored block size will be larger.\n */\n let min_block = s.pending_buf_size - 5 > s.w_size ? s.w_size : s.pending_buf_size - 5;\n\n /* Copy as many min_block or larger stored blocks directly to next_out as\n * possible. If flushing, copy the remaining available input to next_out as\n * stored blocks, if there is enough space.\n */\n let len, left, have, last = 0;\n let used = s.strm.avail_in;\n do {\n /* Set len to the maximum size block that we can copy directly with the\n * available input data and output space. Set left to how much of that\n * would be copied from what's left in the window.\n */\n len = 65535/* MAX_STORED */; /* maximum deflate stored block length */\n have = (s.bi_valid + 42) >> 3; /* number of header bytes */\n if (s.strm.avail_out < have) { /* need room for header */\n break;\n }\n /* maximum stored block length that will fit in avail_out: */\n have = s.strm.avail_out - have;\n left = s.strstart - s.block_start; /* bytes left in window */\n if (len > left + s.strm.avail_in) {\n len = left + s.strm.avail_in; /* limit len to the input */\n }\n if (len > have) {\n len = have; /* limit len to the output */\n }\n\n /* If the stored block would be less than min_block in length, or if\n * unable to copy all of the available input when flushing, then try\n * copying to the window and the pending buffer instead. Also don't\n * write an empty block when flushing -- deflate() does that.\n */\n if (len < min_block && ((len === 0 && flush !== Z_FINISH) ||\n flush === Z_NO_FLUSH ||\n len !== left + s.strm.avail_in)) {\n break;\n }\n\n /* Make a dummy stored block in pending to get the header bytes,\n * including any pending bits. This also updates the debugging counts.\n */\n last = flush === Z_FINISH && len === left + s.strm.avail_in ? 1 : 0;\n _tr_stored_block(s, 0, 0, last);\n\n /* Replace the lengths in the dummy stored block with len. */\n s.pending_buf[s.pending - 4] = len;\n s.pending_buf[s.pending - 3] = len >> 8;\n s.pending_buf[s.pending - 2] = ~len;\n s.pending_buf[s.pending - 1] = ~len >> 8;\n\n /* Write the stored block header bytes. */\n flush_pending(s.strm);\n\n//#ifdef ZLIB_DEBUG\n// /* Update debugging counts for the data about to be copied. */\n// s->compressed_len += len << 3;\n// s->bits_sent += len << 3;\n//#endif\n\n /* Copy uncompressed bytes from the window to next_out. */\n if (left) {\n if (left > len) {\n left = len;\n }\n //zmemcpy(s->strm->next_out, s->window + s->block_start, left);\n s.strm.output.set(s.window.subarray(s.block_start, s.block_start + left), s.strm.next_out);\n s.strm.next_out += left;\n s.strm.avail_out -= left;\n s.strm.total_out += left;\n s.block_start += left;\n len -= left;\n }\n\n /* Copy uncompressed bytes directly from next_in to next_out, updating\n * the check value.\n */\n if (len) {\n read_buf(s.strm, s.strm.output, s.strm.next_out, len);\n s.strm.next_out += len;\n s.strm.avail_out -= len;\n s.strm.total_out += len;\n }\n } while (last === 0);\n\n /* Update the sliding window with the last s->w_size bytes of the copied\n * data, or append all of the copied data to the existing window if less\n * than s->w_size bytes were copied. Also update the number of bytes to\n * insert in the hash tables, in the event that deflateParams() switches to\n * a non-zero compression level.\n */\n used -= s.strm.avail_in; /* number of input bytes directly copied */\n if (used) {\n /* If any input was used, then no unused input remains in the window,\n * therefore s->block_start == s->strstart.\n */\n if (used >= s.w_size) { /* supplant the previous history */\n s.matches = 2; /* clear hash */\n //zmemcpy(s->window, s->strm->next_in - s->w_size, s->w_size);\n s.window.set(s.strm.input.subarray(s.strm.next_in - s.w_size, s.strm.next_in), 0);\n s.strstart = s.w_size;\n s.insert = s.strstart;\n }\n else {\n if (s.window_size - s.strstart <= used) {\n /* Slide the window down. */\n s.strstart -= s.w_size;\n //zmemcpy(s->window, s->window + s->w_size, s->strstart);\n s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0);\n if (s.matches < 2) {\n s.matches++; /* add a pending slide_hash() */\n }\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n }\n //zmemcpy(s->window + s->strstart, s->strm->next_in - used, used);\n s.window.set(s.strm.input.subarray(s.strm.next_in - used, s.strm.next_in), s.strstart);\n s.strstart += used;\n s.insert += used > s.w_size - s.insert ? s.w_size - s.insert : used;\n }\n s.block_start = s.strstart;\n }\n if (s.high_water < s.strstart) {\n s.high_water = s.strstart;\n }\n\n /* If the last block was written to next_out, then done. */\n if (last) {\n return BS_FINISH_DONE;\n }\n\n /* If flushing and all input has been consumed, then done. */\n if (flush !== Z_NO_FLUSH && flush !== Z_FINISH &&\n s.strm.avail_in === 0 && s.strstart === s.block_start) {\n return BS_BLOCK_DONE;\n }\n\n /* Fill the window with any remaining input. */\n have = s.window_size - s.strstart;\n if (s.strm.avail_in > have && s.block_start >= s.w_size) {\n /* Slide the window down. */\n s.block_start -= s.w_size;\n s.strstart -= s.w_size;\n //zmemcpy(s->window, s->window + s->w_size, s->strstart);\n s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0);\n if (s.matches < 2) {\n s.matches++; /* add a pending slide_hash() */\n }\n have += s.w_size; /* more space now */\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n }\n if (have > s.strm.avail_in) {\n have = s.strm.avail_in;\n }\n if (have) {\n read_buf(s.strm, s.window, s.strstart, have);\n s.strstart += have;\n s.insert += have > s.w_size - s.insert ? s.w_size - s.insert : have;\n }\n if (s.high_water < s.strstart) {\n s.high_water = s.strstart;\n }\n\n /* There was not enough avail_out to write a complete worthy or flushed\n * stored block to next_out. Write a stored block to pending instead, if we\n * have enough input for a worthy block, or if flushing and there is enough\n * room for the remaining input as a stored block in the pending buffer.\n */\n have = (s.bi_valid + 42) >> 3; /* number of header bytes */\n /* maximum stored block length that will fit in pending: */\n have = s.pending_buf_size - have > 65535/* MAX_STORED */ ? 65535/* MAX_STORED */ : s.pending_buf_size - have;\n min_block = have > s.w_size ? s.w_size : have;\n left = s.strstart - s.block_start;\n if (left >= min_block ||\n ((left || flush === Z_FINISH) && flush !== Z_NO_FLUSH &&\n s.strm.avail_in === 0 && left <= have)) {\n len = left > have ? have : left;\n last = flush === Z_FINISH && s.strm.avail_in === 0 &&\n len === left ? 1 : 0;\n _tr_stored_block(s, s.block_start, len, last);\n s.block_start += len;\n flush_pending(s.strm);\n }\n\n /* We've done all we can with the available input and output. */\n return last ? BS_FINISH_STARTED : BS_NEED_MORE;\n};\n\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nconst deflate_fast = (s, flush) => {\n\n let hash_head; /* head of the hash chain */\n let bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + 1]);\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nconst deflate_slow = (s, flush) => {\n\n let hash_head; /* head of hash chain */\n let bflush; /* set if current block must be flushed */\n\n let max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n};\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nconst deflate_rle = (s, flush) => {\n\n let bflush; /* set if current block must be flushed */\n let prev; /* byte at distance one to match */\n let scan, strend; /* scan goes up to strend for length of run */\n\n const _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nconst deflate_huff = (s, flush) => {\n\n let bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n break; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}\n\nconst configuration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nconst lm_init = (s) => {\n\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n};\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new Uint16Array(HEAP_SIZE * 2);\n this.dyn_dtree = new Uint16Array((2 * D_CODES + 1) * 2);\n this.bl_tree = new Uint16Array((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new Uint16Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new Uint16Array(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new Uint16Array(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.sym_buf = 0; /* buffer for distances and literals/lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.sym_next = 0; /* running index in sym_buf */\n this.sym_end = 0; /* symbol table full when sym_next reaches this */\n\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n}\n\n\n/* =========================================================================\n * Check for a valid deflate stream state. Return 0 if ok, 1 if not.\n */\nconst deflateStateCheck = (strm) => {\n\n if (!strm) {\n return 1;\n }\n const s = strm.state;\n if (!s || s.strm !== strm || (s.status !== INIT_STATE &&\n//#ifdef GZIP\n s.status !== GZIP_STATE &&\n//#endif\n s.status !== EXTRA_STATE &&\n s.status !== NAME_STATE &&\n s.status !== COMMENT_STATE &&\n s.status !== HCRC_STATE &&\n s.status !== BUSY_STATE &&\n s.status !== FINISH_STATE)) {\n return 1;\n }\n return 0;\n};\n\n\nconst deflateResetKeep = (strm) => {\n\n if (deflateStateCheck(strm)) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n const s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status =\n//#ifdef GZIP\n s.wrap === 2 ? GZIP_STATE :\n//#endif\n s.wrap ? INIT_STATE : BUSY_STATE;\n strm.adler = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = -2;\n _tr_init(s);\n return Z_OK;\n};\n\n\nconst deflateReset = (strm) => {\n\n const ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n};\n\n\nconst deflateSetHeader = (strm, head) => {\n\n if (deflateStateCheck(strm) || strm.state.wrap !== 2) {\n return Z_STREAM_ERROR;\n }\n strm.state.gzhead = head;\n return Z_OK;\n};\n\n\nconst deflateInit2 = (strm, level, method, windowBits, memLevel, strategy) => {\n\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR;\n }\n let wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED || (windowBits === 8 && wrap !== 1)) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n const s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n s.status = INIT_STATE; /* to pass state test in deflateReset() */\n\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n s.window = new Uint8Array(s.w_size * 2);\n s.head = new Uint16Array(s.hash_size);\n s.prev = new Uint16Array(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n /* We overlay pending_buf and sym_buf. This works since the average size\n * for length/distance pairs over any compressed block is assured to be 31\n * bits or less.\n *\n * Analysis: The longest fixed codes are a length code of 8 bits plus 5\n * extra bits, for lengths 131 to 257. The longest fixed distance codes are\n * 5 bits plus 13 extra bits, for distances 16385 to 32768. The longest\n * possible fixed-codes length/distance pair is then 31 bits total.\n *\n * sym_buf starts one-fourth of the way into pending_buf. So there are\n * three bytes in sym_buf for every four bytes in pending_buf. Each symbol\n * in sym_buf is three bytes -- two for the distance and one for the\n * literal/length. As each symbol is consumed, the pointer to the next\n * sym_buf value to read moves forward three bytes. From that symbol, up to\n * 31 bits are written to pending_buf. The closest the written pending_buf\n * bits gets to the next sym_buf symbol to read is just before the last\n * code is written. At that time, 31*(n-2) bits have been written, just\n * after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at\n * 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1\n * symbols are written.) The closest the writing gets to what is unread is\n * then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and\n * can range from 128 to 32768.\n *\n * Therefore, at a minimum, there are 142 bits of space between what is\n * written and what is read in the overlain buffers, so the symbols cannot\n * be overwritten by the compressed data. That space is actually 139 bits,\n * due to the three-bit fixed-code block header.\n *\n * That covers the case where either Z_FIXED is specified, forcing fixed\n * codes, or when the use of fixed codes is chosen, because that choice\n * results in a smaller compressed block than dynamic codes. That latter\n * condition then assures that the above analysis also covers all dynamic\n * blocks. A dynamic-code block will only be chosen to be emitted if it has\n * fewer bits than a fixed-code block would for the same set of symbols.\n * Therefore its average symbol length is assured to be less than 31. So\n * the compressed data for a dynamic block also cannot overwrite the\n * symbols from which it is being constructed.\n */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n s.pending_buf = new Uint8Array(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->sym_buf = s->pending_buf + s->lit_bufsize;\n s.sym_buf = s.lit_bufsize;\n\n //s->sym_end = (s->lit_bufsize - 1) * 3;\n s.sym_end = (s.lit_bufsize - 1) * 3;\n /* We avoid equality with lit_bufsize*3 because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n};\n\nconst deflateInit = (strm, level) => {\n\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n};\n\n\n/* ========================================================================= */\nconst deflate = (strm, flush) => {\n\n if (deflateStateCheck(strm) || flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n\n const s = strm.state;\n\n if (!strm.output ||\n (strm.avail_in !== 0 && !strm.input) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n\n const old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK;\n }\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* Write the header */\n if (s.status === INIT_STATE && s.wrap === 0) {\n s.status = BUSY_STATE;\n }\n if (s.status === INIT_STATE) {\n /* zlib header */\n let header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n let level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n putShortMSB(s, header);\n\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n }\n//#ifdef GZIP\n if (s.status === GZIP_STATE) {\n /* gzip header */\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) { // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n }\n else {\n put_byte(s, (s.gzhead.text ? 1 : 0) +\n (s.gzhead.hcrc ? 2 : 0) +\n (!s.gzhead.extra ? 0 : 4) +\n (!s.gzhead.name ? 0 : 8) +\n (!s.gzhead.comment ? 0 : 16)\n );\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, (s.gzhead.time >> 8) & 0xff);\n put_byte(s, (s.gzhead.time >> 16) & 0xff);\n put_byte(s, (s.gzhead.time >> 24) & 0xff);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let left = (s.gzhead.extra.length & 0xffff) - s.gzindex;\n while (s.pending + left > s.pending_buf_size) {\n let copy = s.pending_buf_size - s.pending;\n // zmemcpy(s.pending_buf + s.pending,\n // s.gzhead.extra + s.gzindex, copy);\n s.pending_buf.set(s.gzhead.extra.subarray(s.gzindex, s.gzindex + copy), s.pending);\n s.pending = s.pending_buf_size;\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex += copy;\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n beg = 0;\n left -= copy;\n }\n // JS specific: s.gzhead.extra may be TypedArray or Array for backward compatibility\n // TypedArray.slice and TypedArray.from don't exist in IE10-IE11\n let gzhead_extra = new Uint8Array(s.gzhead.extra);\n // zmemcpy(s->pending_buf + s->pending,\n // s->gzhead->extra + s->gzindex, left);\n s.pending_buf.set(gzhead_extra.subarray(s.gzindex, s.gzindex + left), s.pending);\n s.pending += left;\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex = 0;\n }\n s.status = NAME_STATE;\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let val;\n do {\n if (s.pending === s.pending_buf_size) {\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n beg = 0;\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex = 0;\n }\n s.status = COMMENT_STATE;\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let val;\n do {\n if (s.pending === s.pending_buf_size) {\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n beg = 0;\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n }\n s.status = HCRC_STATE;\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n }\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n }\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n }\n//#endif\n\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n let bstate = s.level === 0 ? deflate_stored(s, flush) :\n s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :\n s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush);\n\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n _tr_align(s);\n }\n else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n _tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH) {\n /*** CLEAR_HASH(s); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n }\n\n if (flush !== Z_FINISH) { return Z_OK; }\n if (s.wrap <= 0) { return Z_STREAM_END; }\n\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n put_byte(s, (strm.adler >> 16) & 0xff);\n put_byte(s, (strm.adler >> 24) & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, (strm.total_in >> 8) & 0xff);\n put_byte(s, (strm.total_in >> 16) & 0xff);\n put_byte(s, (strm.total_in >> 24) & 0xff);\n }\n else\n {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n};\n\n\nconst deflateEnd = (strm) => {\n\n if (deflateStateCheck(strm)) {\n return Z_STREAM_ERROR;\n }\n\n const status = strm.state.status;\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n};\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nconst deflateSetDictionary = (strm, dictionary) => {\n\n let dictLength = dictionary.length;\n\n if (deflateStateCheck(strm)) {\n return Z_STREAM_ERROR;\n }\n\n const s = strm.state;\n const wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR;\n }\n\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n let tmpDict = new Uint8Array(s.w_size);\n tmpDict.set(dictionary.subarray(dictLength - s.w_size, dictLength), 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n const avail = strm.avail_in;\n const next = strm.next_in;\n const input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n let str = s.strstart;\n let n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]);\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK;\n};\n\n\nmodule.exports.deflateInit = deflateInit;\nmodule.exports.deflateInit2 = deflateInit2;\nmodule.exports.deflateReset = deflateReset;\nmodule.exports.deflateResetKeep = deflateResetKeep;\nmodule.exports.deflateSetHeader = deflateSetHeader;\nmodule.exports.deflate = deflate;\nmodule.exports.deflateEnd = deflateEnd;\nmodule.exports.deflateSetDictionary = deflateSetDictionary;\nmodule.exports.deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nmodule.exports.deflateBound = deflateBound;\nmodule.exports.deflateCopy = deflateCopy;\nmodule.exports.deflateGetDictionary = deflateGetDictionary;\nmodule.exports.deflateParams = deflateParams;\nmodule.exports.deflatePending = deflatePending;\nmodule.exports.deflatePrime = deflatePrime;\nmodule.exports.deflateTune = deflateTune;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nmodule.exports = GZheader;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nconst BAD = 16209; /* got a data error -- remain here until reset */\nconst TYPE = 16191; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n let _in; /* local strm.input */\n let last; /* have enough input while in < last */\n let _out; /* local strm.output */\n let beg; /* inflate()'s initial strm.output */\n let end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n let dmax; /* maximum distance from zlib header */\n//#endif\n let wsize; /* window size or zero if not using window */\n let whave; /* valid bytes in the window */\n let wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n let s_window; /* allocated sliding window, if wsize != 0 */\n let hold; /* local strm.hold */\n let bits; /* local strm.bits */\n let lcode; /* local strm.lencode */\n let dcode; /* local strm.distcode */\n let lmask; /* mask for first level of length codes */\n let dmask; /* mask for first level of distance codes */\n let here; /* retrieved table entry */\n let op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n let len; /* match length, unused bytes */\n let dist; /* match distance */\n let from; /* where to copy match from */\n let from_source;\n\n\n let input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n const state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst adler32 = require('./adler32');\nconst crc32 = require('./crc32');\nconst inflate_fast = require('./inffast');\nconst inflate_table = require('./inftrees');\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_FINISH, Z_BLOCK, Z_TREES,\n Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR, Z_BUF_ERROR,\n Z_DEFLATED\n} = require('./constants');\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nconst HEAD = 16180; /* i: waiting for magic header */\nconst FLAGS = 16181; /* i: waiting for method and flags (gzip) */\nconst TIME = 16182; /* i: waiting for modification time (gzip) */\nconst OS = 16183; /* i: waiting for extra flags and operating system (gzip) */\nconst EXLEN = 16184; /* i: waiting for extra length (gzip) */\nconst EXTRA = 16185; /* i: waiting for extra bytes (gzip) */\nconst NAME = 16186; /* i: waiting for end of file name (gzip) */\nconst COMMENT = 16187; /* i: waiting for end of comment (gzip) */\nconst HCRC = 16188; /* i: waiting for header crc (gzip) */\nconst DICTID = 16189; /* i: waiting for dictionary check value */\nconst DICT = 16190; /* waiting for inflateSetDictionary() call */\nconst TYPE = 16191; /* i: waiting for type bits, including last-flag bit */\nconst TYPEDO = 16192; /* i: same, but skip check to exit inflate on new block */\nconst STORED = 16193; /* i: waiting for stored size (length and complement) */\nconst COPY_ = 16194; /* i/o: same as COPY below, but only first time in */\nconst COPY = 16195; /* i/o: waiting for input or output to copy stored block */\nconst TABLE = 16196; /* i: waiting for dynamic block table lengths */\nconst LENLENS = 16197; /* i: waiting for code length code lengths */\nconst CODELENS = 16198; /* i: waiting for length/lit and distance code lengths */\nconst LEN_ = 16199; /* i: same as LEN below, but only first time in */\nconst LEN = 16200; /* i: waiting for length/lit/eob code */\nconst LENEXT = 16201; /* i: waiting for length extra bits */\nconst DIST = 16202; /* i: waiting for distance code */\nconst DISTEXT = 16203; /* i: waiting for distance extra bits */\nconst MATCH = 16204; /* o: waiting for output space to copy string */\nconst LIT = 16205; /* o: waiting for output space to write literal */\nconst CHECK = 16206; /* i: waiting for 32-bit check value */\nconst LENGTH = 16207; /* i: waiting for 32-bit length (gzip) */\nconst DONE = 16208; /* finished check, done -- remain here until reset */\nconst BAD = 16209; /* got a data error -- remain here until reset */\nconst MEM = 16210; /* got an inflate() memory error -- remain here until reset */\nconst SYNC = 16211; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nconst ENOUGH_LENS = 852;\nconst ENOUGH_DISTS = 592;\n//const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst MAX_WBITS = 15;\n/* 32K LZ77 window */\nconst DEF_WBITS = MAX_WBITS;\n\n\nconst zswap32 = (q) => {\n\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n};\n\n\nfunction InflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip,\n bit 2 true to validate check value */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib), or\n -1 if raw or no header yet */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new Uint16Array(320); /* temporary storage for code lengths */\n this.work = new Uint16Array(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new Int32Array(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\n\nconst inflateStateCheck = (strm) => {\n\n if (!strm) {\n return 1;\n }\n const state = strm.state;\n if (!state || state.strm !== strm ||\n state.mode < HEAD || state.mode > SYNC) {\n return 1;\n }\n return 0;\n};\n\n\nconst inflateResetKeep = (strm) => {\n\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.flags = -1;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS);\n state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n};\n\n\nconst inflateReset = (strm) => {\n\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n};\n\n\nconst inflateReset2 = (strm, windowBits) => {\n let wrap;\n\n /* get the state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 5;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n};\n\n\nconst inflateInit2 = (strm, windowBits) => {\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n const state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.strm = strm;\n state.window = null/*Z_NULL*/;\n state.mode = HEAD; /* to pass state test in inflateReset2() */\n const ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n};\n\n\nconst inflateInit = (strm) => {\n\n return inflateInit2(strm, DEF_WBITS);\n};\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nlet virgin = true;\n\nlet lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\n\nconst fixedtables = (state) => {\n\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n lenfix = new Int32Array(512);\n distfix = new Int32Array(32);\n\n /* literal/length table */\n let sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n};\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nconst updatewindow = (strm, src, end, copy) => {\n\n let dist;\n const state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new Uint8Array(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n state.window.set(src.subarray(end - state.wsize, end), 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n state.window.set(src.subarray(end - copy, end - copy + dist), state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n state.window.set(src.subarray(end - copy, end), 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n};\n\n\nconst inflate = (strm, flush) => {\n\n let state;\n let input, output; // input/output buffers\n let next; /* next input INDEX */\n let put; /* next output INDEX */\n let have, left; /* available input and output */\n let hold; /* bit buffer */\n let bits; /* bits in bit buffer */\n let _in, _out; /* save starting available input and output */\n let copy; /* number of stored or match bytes to copy */\n let from; /* where to copy match bytes from */\n let from_source;\n let here = 0; /* current decoding table entry */\n let here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //let last; /* parent table entry */\n let last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n let len; /* length to copy for repeats, bits to drop */\n let ret; /* return code */\n const hbuf = new Uint8Array(4); /* buffer for gzip header crc calculation */\n let opts;\n\n let n; // temporary variable for NEED_BITS\n\n const order = /* permutation of code lengths */\n new Uint8Array([ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]);\n\n\n if (inflateStateCheck(strm) || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n if (state.wbits === 0) {\n state.wbits = 15;\n }\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n if (len > 15 || len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n\n // !!! pako patch. Force use `options.windowBits` if passed.\n // Required to always use max window size by default.\n state.dmax = 1 << state.wbits;\n //state.dmax = 1 << len;\n\n state.flags = 0; /* indicate zlib header */\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Uint8Array(state.head.extra_len);\n }\n state.head.extra.set(\n input.subarray(\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n next + copy\n ),\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 4) && hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n output.set(input.subarray(next, next + copy), put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if ((state.wrap & 4) && _out) {\n strm.adler = state.check =\n /*UPDATE_CHECK(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.wrap & 4) && (state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 4) && hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if ((state.wrap & 4) && _out) {\n strm.adler = state.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n};\n\n\nconst inflateEnd = (strm) => {\n\n if (inflateStateCheck(strm)) {\n return Z_STREAM_ERROR;\n }\n\n let state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n};\n\n\nconst inflateGetHeader = (strm, head) => {\n\n /* check state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n};\n\n\nconst inflateSetDictionary = (strm, dictionary) => {\n const dictLength = dictionary.length;\n\n let state;\n let dictid;\n let ret;\n\n /* check state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n};\n\n\nmodule.exports.inflateReset = inflateReset;\nmodule.exports.inflateReset2 = inflateReset2;\nmodule.exports.inflateResetKeep = inflateResetKeep;\nmodule.exports.inflateInit = inflateInit;\nmodule.exports.inflateInit2 = inflateInit2;\nmodule.exports.inflate = inflate;\nmodule.exports.inflateEnd = inflateEnd;\nmodule.exports.inflateGetHeader = inflateGetHeader;\nmodule.exports.inflateSetDictionary = inflateSetDictionary;\nmodule.exports.inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nmodule.exports.inflateCodesUsed = inflateCodesUsed;\nmodule.exports.inflateCopy = inflateCopy;\nmodule.exports.inflateGetDictionary = inflateGetDictionary;\nmodule.exports.inflateMark = inflateMark;\nmodule.exports.inflatePrime = inflatePrime;\nmodule.exports.inflateSync = inflateSync;\nmodule.exports.inflateSyncPoint = inflateSyncPoint;\nmodule.exports.inflateUndermine = inflateUndermine;\nmodule.exports.inflateValidate = inflateValidate;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst MAXBITS = 15;\nconst ENOUGH_LENS = 852;\nconst ENOUGH_DISTS = 592;\n//const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\nconst lbase = new Uint16Array([ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n]);\n\nconst lext = new Uint8Array([ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n]);\n\nconst dbase = new Uint16Array([ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n]);\n\nconst dext = new Uint8Array([ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n]);\n\nconst inflate_table = (type, lens, lens_index, codes, table, table_index, work, opts) =>\n{\n const bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n let len = 0; /* a code's length in bits */\n let sym = 0; /* index of code symbols */\n let min = 0, max = 0; /* minimum and maximum code lengths */\n let root = 0; /* number of index bits for root table */\n let curr = 0; /* number of index bits for current table */\n let drop = 0; /* code bits to drop for sub-table */\n let left = 0; /* number of prefix codes available */\n let used = 0; /* code entries in table used */\n let huff = 0; /* Huffman code */\n let incr; /* for incrementing code, index */\n let fill; /* index for replicating entries */\n let low; /* low bits for current root entry */\n let mask; /* mask for low root bits */\n let next; /* next available space in table */\n let base = null; /* base value table to use */\n// let shoextra; /* extra bits table to use */\n let match; /* use base and extra for symbol >= match */\n const count = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n const offs = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n let extra = null;\n\n let here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n match = 20;\n\n } else if (type === LENS) {\n base = lbase;\n extra = lext;\n match = 257;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n match = 0;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] + 1 < match) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] >= match) {\n here_op = extra[work[sym] - match];\n here_val = base[work[sym] - match];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n\n\nmodule.exports = inflate_table;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* eslint-disable space-unary-ops */\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//const Z_FILTERED = 1;\n//const Z_HUFFMAN_ONLY = 2;\n//const Z_RLE = 3;\nconst Z_FIXED = 4;\n//const Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nconst Z_BINARY = 0;\nconst Z_TEXT = 1;\n//const Z_ASCII = 1; // = Z_TEXT\nconst Z_UNKNOWN = 2;\n\n/*============================================================================*/\n\n\nfunction zero(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nconst STORED_BLOCK = 0;\nconst STATIC_TREES = 1;\nconst DYN_TREES = 2;\n/* The three kinds of block type */\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nconst LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nconst LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nconst L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nconst D_CODES = 30;\n/* number of distance codes */\n\nconst BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nconst HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nconst MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nconst MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nconst END_BLOCK = 256;\n/* end of block literal code */\n\nconst REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nconst REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nconst REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nconst extra_lbits = /* extra bits for each length code */\n new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]);\n\nconst extra_dbits = /* extra bits for each distance code */\n new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]);\n\nconst extra_blbits = /* extra bits for each bit length code */\n new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]);\n\nconst bl_order =\n new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nconst DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nconst static_ltree = new Array((L_CODES + 2) * 2);\nzero(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nconst static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nconst _dist_code = new Array(DIST_CODE_LEN);\nzero(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nconst _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nconst base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nconst base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nlet static_l_desc;\nlet static_d_desc;\nlet static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nconst d_code = (dist) => {\n\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n};\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nconst put_short = (s, w) => {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n};\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nconst send_bits = (s, value, length) => {\n\n if (s.bi_valid > (Buf_size - length)) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n};\n\n\nconst send_code = (s, c, tree) => {\n\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n};\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nconst bi_reverse = (code, len) => {\n\n let res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n};\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nconst bi_flush = (s) => {\n\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n};\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nconst gen_bitlen = (s, desc) => {\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n\n const tree = desc.dyn_tree;\n const max_code = desc.max_code;\n const stree = desc.stat_desc.static_tree;\n const has_stree = desc.stat_desc.has_stree;\n const extra = desc.stat_desc.extra_bits;\n const base = desc.stat_desc.extra_base;\n const max_length = desc.stat_desc.max_length;\n let h; /* heap index */\n let n, m; /* iterate over the tree elements */\n let bits; /* bit length */\n let xbits; /* extra bits */\n let f; /* frequency */\n let overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Tracev((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Tracev((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n};\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nconst gen_codes = (tree, max_code, bl_count) => {\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n\n const next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n let code = 0; /* running code value */\n let bits; /* bit index */\n let n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n code = (code + bl_count[bits - 1]) << 1;\n next_code[bits] = code;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1< {\n\n let n; /* iterates over tree elements */\n let bits; /* bit counter */\n let length; /* length value */\n let code; /* code value */\n let dist; /* distance index */\n const bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n};\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nconst init_block = (s) => {\n\n let n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.sym_next = s.matches = 0;\n};\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nconst bi_windup = (s) =>\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n};\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nconst smaller = (tree, n, m, depth) => {\n\n const _n2 = n * 2;\n const _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n};\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nconst pqdownheap = (s, tree, k) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n\n const v = s.heap[k];\n let j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n};\n\n\n// inlined manually\n// const SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nconst compress_block = (s, ltree, dtree) => {\n// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n\n let dist; /* distance of matched string */\n let lc; /* match length or unmatched char (if dist == 0) */\n let sx = 0; /* running index in sym_buf */\n let code; /* the code to send */\n let extra; /* number of extra bits to send */\n\n if (s.sym_next !== 0) {\n do {\n dist = s.pending_buf[s.sym_buf + sx++] & 0xff;\n dist += (s.pending_buf[s.sym_buf + sx++] & 0xff) << 8;\n lc = s.pending_buf[s.sym_buf + sx++];\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and sym_buf is ok: */\n //Assert(s->pending < s->lit_bufsize + sx, \"pendingBuf overflow\");\n\n } while (sx < s.sym_next);\n }\n\n send_code(s, END_BLOCK, ltree);\n};\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nconst build_tree = (s, desc) => {\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n\n const tree = desc.dyn_tree;\n const stree = desc.stat_desc.static_tree;\n const has_stree = desc.stat_desc.has_stree;\n const elems = desc.stat_desc.elems;\n let n, m; /* iterate over heap elements */\n let max_code = -1; /* largest code with non zero frequency */\n let node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE;\n\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);\n tree[node * 2]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n /*** pqremove ***/\n n = s.heap[1/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n};\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nconst scan_tree = (s, tree, max_code) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n};\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nconst send_tree = (s, tree, max_code) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n};\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nconst build_bl_tree = (s) => {\n\n let max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n};\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nconst send_all_trees = (s, lcodes, dcodes, blcodes) => {\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n\n let rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n};\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"block list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"allow list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nconst detect_data_type = (s) => {\n /* block_mask is the bit mask of block-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n let block_mask = 0xf3ffc07f;\n let n;\n\n /* Check for non-textual (\"block-listed\") bytes. */\n for (n = 0; n <= 31; n++, block_mask >>>= 1) {\n if ((block_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"allow-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n }\n\n /* There are no \"block-listed\" or \"allow-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n};\n\n\nlet static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nconst _tr_init = (s) =>\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n};\n\n\n/* ===========================================================================\n * Send a stored block\n */\nconst _tr_stored_block = (s, buf, stored_len, last) => {\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n bi_windup(s); /* align on byte boundary */\n put_short(s, stored_len);\n put_short(s, ~stored_len);\n if (stored_len) {\n s.pending_buf.set(s.window.subarray(buf, buf + stored_len), s.pending);\n }\n s.pending += stored_len;\n};\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nconst _tr_align = (s) => {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n};\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and write out the encoded block.\n */\nconst _tr_flush_block = (s, buf, stored_len, last) => {\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n\n let opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n let max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->sym_next / 3));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n};\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nconst _tr_tally = (s, dist, lc) => {\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n\n s.pending_buf[s.sym_buf + s.sym_next++] = dist;\n s.pending_buf[s.sym_buf + s.sym_next++] = dist >> 8;\n s.pending_buf[s.sym_buf + s.sym_next++] = lc;\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n return (s.sym_next === s.sym_end);\n};\n\nmodule.exports._tr_init = _tr_init;\nmodule.exports._tr_stored_block = _tr_stored_block;\nmodule.exports._tr_flush_block = _tr_flush_block;\nmodule.exports._tr_tally = _tr_tally;\nmodule.exports._tr_align = _tr_align;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nmodule.exports = ZStream;\n","import { Spec } from \"vega\";\nimport vegaEmbed, { EmbedOptions, Mode } from \"vega-embed\";\nimport { TopLevelSpec } from \"vega-lite\";\n\nexport { default as vegaEmbed } from \"vega-embed\";\nexport { VegaWidgetModel, VegaWidget } from \"./widget\";\nexport const version = require(\"../package.json\").version;\n\nfunction javascriptIndex(selector: string, outputs: any) {\n // Return the index in the output array of the JS repr of this viz\n for (let i = 0; i < outputs.length; i++) {\n const item = outputs[i];\n if (\n item.metadata &&\n item.metadata[\"jupyter-vega\"] === selector &&\n item.data[\"application/javascript\"] !== undefined\n ) {\n return i;\n }\n }\n return -1;\n}\n\nfunction imageIndex(selector: string, outputs: any) {\n // Return the index in the output array of the PNG repr of this viz\n for (let i = 0; i < outputs.length; i++) {\n const item = outputs[i];\n if (\n item.metadata &&\n item.metadata[\"jupyter-vega\"] === selector &&\n item.data[\"image/png\"] !== undefined\n ) {\n return i;\n }\n }\n return -1;\n}\n\nfunction showError(el: HTMLElement, error: Error) {\n el.innerHTML = `
\n

Javascript Error: ${error.message}

\n

This usually means there's a typo in your chart specification.\n See the JavaScript console for the full traceback.

\n
`;\n\n throw error;\n}\n\nexport function render(\n selector: string,\n spec: Spec | TopLevelSpec,\n type: Mode,\n opt: EmbedOptions,\n output_area: any\n) {\n // Find the indices of this visualizations JS and PNG\n // representation.\n const imgIndex = imageIndex(selector, output_area.outputs);\n const jsIndex = javascriptIndex(selector, output_area.outputs);\n\n // If we have already rendered a static image, don't render\n // the JS version or append a new PNG version\n if (imgIndex > -1 && jsIndex > -1) {\n return;\n }\n\n // Never been rendered, so render JS and append the PNG to the\n // outputs for the cell\n const el = document.getElementById(selector.substring(1))!;\n vegaEmbed(el, spec, {\n loader: { http: { credentials: \"same-origin\" } },\n ...opt,\n mode: type,\n })\n .then((result) => {\n result.view\n .toImageURL(\"png\")\n .then((imageData) => {\n if (output_area !== undefined) {\n const output = {\n data: {\n \"image/png\": imageData.split(\",\")[1],\n },\n metadata: { \"jupyter-vega\": selector },\n output_type: \"display_data\",\n };\n // This appends the PNG output, but doesn't render it this time\n // as the JS version will be rendered already.\n output_area.outputs.push(output);\n }\n })\n .catch((error) => showError(el, error));\n })\n .catch((error) => showError(el, error));\n}\n\nexport * from \"./widget\";\n","import * as plugin from \"./index\";\nimport * as base from \"@jupyter-widgets/base\";\n\nmodule.exports = {\n id: \"jupyter-vega\",\n requires: [base.IJupyterWidgetRegistry],\n activate: (app: any, widgets: any) => {\n widgets.registerWidget({\n name: \"jupyter-vega\",\n version: plugin.version,\n exports: plugin,\n });\n },\n autoStart: true,\n};\n","const pkg = require(\"../package.json\");\nexport const MODULE_VERSION = pkg.version;\nexport const MODULE_NAME = pkg.name;\n","import { DOMWidgetView, DOMWidgetModel } from \"@jupyter-widgets/base\";\nimport { MODULE_NAME, MODULE_VERSION } from \"./version\";\nimport { vegaEmbed } from \"./index\";\nimport { Result } from \"vega-embed\";\nimport * as ndarray from \"ndarray\";\nimport { table_serialization, rowProxy, IDict } from \"jupyter-tablewidgets\";\n\ninterface WidgetUpdate {\n key: string;\n remove?: string;\n insert?: any[] | \"@dataframe\" | \"@array2d\";\n}\n\ninterface WidgetUpdateMessage {\n type: \"update\";\n updates: WidgetUpdate[];\n resize: boolean;\n}\n\nfunction serializeImgURL(imgURL: string, mgr: VegaWidgetModel): string {\n if (\n mgr.viewInstance === null ||\n mgr.viewInstance.viewElement === undefined ||\n mgr.viewInstance.hasBeenUpdated === false\n ) {\n return imgURL;\n }\n let id_ = mgr.viewInstance.viewElement.id;\n if (id_ === \"\" || id_ === undefined) {\n id_ = \"VEGA_ID_\" + crypto.randomUUID();\n mgr.viewInstance.viewElement.id = id_;\n }\n let canvas = document.querySelector(`#${id_} canvas`);\n if (canvas === null) {\n return imgURL;\n }\n return JSON.stringify({\n // @ts-ignore\n width: canvas.style.width || canvas.width,\n // @ts-ignore\n height: canvas.style.height || canvas.height,\n // @ts-ignore\n url: canvas.toDataURL(),\n });\n}\n\n// validate the ev object and cast it to the correct type\nfunction checkWidgetUpdate(ev: any): WidgetUpdateMessage | null {\n if (ev.type != \"update\") {\n return null;\n }\n\n // TODO: Fully validate ev and give a easy to understand error message if it is ill-formed\n return ev as WidgetUpdateMessage;\n}\n\nexport class VegaWidgetModel extends DOMWidgetModel {\n defaults() {\n return {\n ...DOMWidgetModel.prototype.defaults(),\n _model_name: \"VegaWidgetModel\",\n _view_name: \"VegaWidget\",\n _spec_source: \"\",\n _opt_source: \"\",\n _df: ndarray([]),\n _img_url: \"\",\n _columns: [],\n };\n }\n viewInstance: VegaWidget | null = null;\n static serializers = {\n ...DOMWidgetModel.serializers,\n _img_url: { serialize: serializeImgURL } as any,\n _df: table_serialization as any,\n };\n\n static model_name = \"VegaWidgetModel\";\n static model_module = MODULE_NAME;\n static model_module_version = MODULE_VERSION;\n static view_name = \"VegaWidget\";\n static view_module = MODULE_NAME;\n static view_module_version = MODULE_VERSION;\n}\n\nexport class VegaWidget extends DOMWidgetView {\n result?: Result;\n hasBeenUpdated: boolean = false; // when it is \"true\" it means that the view has been updated at least once\n viewElement = document.createElement(\"div\");\n errorElement = document.createElement(\"div\");\n\n async render() {\n this.el.appendChild(this.viewElement);\n this.errorElement.style.color = \"red\";\n this.el.appendChild(this.errorElement);\n let model = this.model as VegaWidgetModel;\n model.viewInstance = this;\n const reembed = async () => {\n const spec = JSON.parse(this.model.get(\"_spec_source\"));\n const opt = JSON.parse(this.model.get(\"_opt_source\") || \"{}\");\n const imgURL = this.model.get(\"_img_url\");\n if (imgURL !== \"\" && imgURL !== \"null\") {\n let imgJson = JSON.parse(imgURL);\n let imgElement = document.createElement(\"img\");\n imgElement.src = imgJson.url;\n let h = parseInt(imgJson.height);\n if (h > 0) {\n imgElement.height = h;\n }\n let w = parseInt(imgJson.width);\n if (w > 0) {\n imgElement.width = w;\n }\n this.viewElement.appendChild(imgElement);\n this.model.set(\"_img_url\", \"null\");\n return;\n }\n if (spec == null) {\n return;\n }\n try {\n const result = await vegaEmbed(this.viewElement, spec, {\n loader: { http: { credentials: \"same-origin\" } },\n ...opt,\n });\n if (this.result) {\n this.result.finalize();\n }\n this.result = result;\n this.send({ type: \"display\" });\n } catch (err) {\n if (this.result) {\n this.result.finalize();\n }\n console.error(err);\n }\n };\n\n const applyUpdate = async (update: WidgetUpdate, resize: boolean) => {\n const result = this.result;\n if (result == null) {\n throw new Error(\"Internal error: no view attached to widget\");\n }\n const filter = new Function(\n \"datum\",\n `return (${update.remove || \"false\"})`\n );\n let newValues = update.insert || [];\n switch (newValues) {\n case \"@dataframe\": {\n newValues = this.updateDataFrame();\n break;\n }\n case \"@array2d\": {\n newValues = this.updateArray2D();\n }\n }\n const changeSet = result.view\n .changeset()\n .remove(filter)\n .insert(newValues);\n const view = result.view.change(update.key, changeSet);\n if (resize) view.resize();\n await view.runAsync();\n };\n\n const applyUpdates = async (message: WidgetUpdateMessage) => {\n this.hasBeenUpdated = true;\n for (const update of message.updates) {\n await applyUpdate(update, message.resize);\n }\n };\n\n this.model.on(\"change:_spec_source\", reembed);\n this.model.on(\"change:_opt_source\", reembed);\n this.model.on(\"msg:custom\", (ev: any) => {\n const message = checkWidgetUpdate(ev);\n if (message == null) {\n return;\n }\n\n applyUpdates(message).catch((err: Error) => {\n this.errorElement.textContent = String(err);\n console.error(err);\n });\n });\n\n // initial rendering\n await reembed();\n }\n\n updateDataFrame(): any[] {\n const table = this.model.get(\"_df\");\n const proxy = rowProxy(table);\n const rows = Array(table.size);\n for (let i = 0; i < rows.length; ++i) {\n rows[i] = proxy(i);\n }\n return rows;\n }\n\n updateArray2D(): any[] {\n /* A 2D array is encoded for transfer like a dataframe\n having an unique, (2D) column.\n The column name is \"special\", i.e. it is a string containing\n three comma separated keys, e.g. \"x,y,z\"\n this format is useful for encoding, for example, a heatmap */\n const table = this.model.get(\"_df\");\n const res = Array(table.size * table.size);\n const fancyCol = table.columns[0];\n const arr: ndarray.NdArray = table.data[fancyCol];\n const cols: string[] = fancyCol.split(\",\");\n let k = 0;\n for (let i = 0; i < arr.shape[0]; i++) {\n for (let j = 0; j < arr.shape[1]; j++) {\n let row: IDict = {};\n row[cols[0]] = i;\n row[cols[1]] = j;\n row[cols[2]] = arr.get(i, j);\n res[k++] = row;\n }\n }\n return res;\n }\n}\n","\"use strict\"\n\nfunction unique_pred(list, compare) {\n var ptr = 1\n , len = list.length\n , a=list[0], b=list[0]\n for(var i=1; i= 48 && charCode <= 57) {\n i++;\n continue;\n }\n return false;\n }\n return true;\n}\n/**\n* Escapes a json pointer path\n* @param path The raw pointer\n* @return the Escaped path\n*/\nexport function escapePathComponent(path) {\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\n return path;\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\n}\n/**\n * Unescapes a json pointer path\n * @param path The escaped pointer\n * @return The unescaped path\n */\nexport function unescapePathComponent(path) {\n return path.replace(/~1/g, '/').replace(/~0/g, '~');\n}\nexport function _getPathRecursive(root, obj) {\n var found;\n for (var key in root) {\n if (hasOwnProperty(root, key)) {\n if (root[key] === obj) {\n return escapePathComponent(key) + '/';\n }\n else if (typeof root[key] === 'object') {\n found = _getPathRecursive(root[key], obj);\n if (found != '') {\n return escapePathComponent(key) + '/' + found;\n }\n }\n }\n }\n return '';\n}\nexport function getPath(root, obj) {\n if (root === obj) {\n return '/';\n }\n var path = _getPathRecursive(root, obj);\n if (path === '') {\n throw new Error(\"Object not found in root\");\n }\n return \"/\" + path;\n}\n/**\n* Recursively checks whether an object has any undefined values inside.\n*/\nexport function hasUndefined(obj) {\n if (obj === undefined) {\n return true;\n }\n if (obj) {\n if (Array.isArray(obj)) {\n for (var i_1 = 0, len = obj.length; i_1 < len; i_1++) {\n if (hasUndefined(obj[i_1])) {\n return true;\n }\n }\n }\n else if (typeof obj === \"object\") {\n var objKeys = _objectKeys(obj);\n var objKeysLength = objKeys.length;\n for (var i = 0; i < objKeysLength; i++) {\n if (hasUndefined(obj[objKeys[i]])) {\n return true;\n }\n }\n }\n }\n return false;\n}\nfunction patchErrorMessageFormatter(message, args) {\n var messageParts = [message];\n for (var key in args) {\n var value = typeof args[key] === 'object' ? JSON.stringify(args[key], null, 2) : args[key]; // pretty print\n if (typeof value !== 'undefined') {\n messageParts.push(key + \": \" + value);\n }\n }\n return messageParts.join('\\n');\n}\nvar PatchError = /** @class */ (function (_super) {\n __extends(PatchError, _super);\n function PatchError(message, name, index, operation, tree) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, patchErrorMessageFormatter(message, { name: name, index: index, operation: operation, tree: tree })) || this;\n _this.name = name;\n _this.index = index;\n _this.operation = operation;\n _this.tree = tree;\n Object.setPrototypeOf(_this, _newTarget.prototype); // restore prototype chain, see https://stackoverflow.com/a/48342359\n _this.message = patchErrorMessageFormatter(message, { name: name, index: index, operation: operation, tree: tree });\n return _this;\n }\n return PatchError;\n}(Error));\nexport { PatchError };\n","import { PatchError, _deepClone, isInteger, unescapePathComponent, hasUndefined } from './helpers.mjs';\nexport var JsonPatchError = PatchError;\nexport var deepClone = _deepClone;\n/* We use a Javascript hash to store each\n function. Each hash entry (property) uses\n the operation identifiers specified in rfc6902.\n In this way, we can map each patch operation\n to its dedicated function in efficient way.\n */\n/* The operations applicable to an object */\nvar objOps = {\n add: function (obj, key, document) {\n obj[key] = this.value;\n return { newDocument: document };\n },\n remove: function (obj, key, document) {\n var removed = obj[key];\n delete obj[key];\n return { newDocument: document, removed: removed };\n },\n replace: function (obj, key, document) {\n var removed = obj[key];\n obj[key] = this.value;\n return { newDocument: document, removed: removed };\n },\n move: function (obj, key, document) {\n /* in case move target overwrites an existing value,\n return the removed value, this can be taxing performance-wise,\n and is potentially unneeded */\n var removed = getValueByPointer(document, this.path);\n if (removed) {\n removed = _deepClone(removed);\n }\n var originalValue = applyOperation(document, { op: \"remove\", path: this.from }).removed;\n applyOperation(document, { op: \"add\", path: this.path, value: originalValue });\n return { newDocument: document, removed: removed };\n },\n copy: function (obj, key, document) {\n var valueToCopy = getValueByPointer(document, this.from);\n // enforce copy by value so further operations don't affect source (see issue #177)\n applyOperation(document, { op: \"add\", path: this.path, value: _deepClone(valueToCopy) });\n return { newDocument: document };\n },\n test: function (obj, key, document) {\n return { newDocument: document, test: _areEquals(obj[key], this.value) };\n },\n _get: function (obj, key, document) {\n this.value = obj[key];\n return { newDocument: document };\n }\n};\n/* The operations applicable to an array. Many are the same as for the object */\nvar arrOps = {\n add: function (arr, i, document) {\n if (isInteger(i)) {\n arr.splice(i, 0, this.value);\n }\n else { // array props\n arr[i] = this.value;\n }\n // this may be needed when using '-' in an array\n return { newDocument: document, index: i };\n },\n remove: function (arr, i, document) {\n var removedList = arr.splice(i, 1);\n return { newDocument: document, removed: removedList[0] };\n },\n replace: function (arr, i, document) {\n var removed = arr[i];\n arr[i] = this.value;\n return { newDocument: document, removed: removed };\n },\n move: objOps.move,\n copy: objOps.copy,\n test: objOps.test,\n _get: objOps._get\n};\n/**\n * Retrieves a value from a JSON document by a JSON pointer.\n * Returns the value.\n *\n * @param document The document to get the value from\n * @param pointer an escaped JSON pointer\n * @return The retrieved value\n */\nexport function getValueByPointer(document, pointer) {\n if (pointer == '') {\n return document;\n }\n var getOriginalDestination = { op: \"_get\", path: pointer };\n applyOperation(document, getOriginalDestination);\n return getOriginalDestination.value;\n}\n/**\n * Apply a single JSON Patch Operation on a JSON document.\n * Returns the {newDocument, result} of the operation.\n * It modifies the `document` and `operation` objects - it gets the values by reference.\n * If you would like to avoid touching your values, clone them:\n * `jsonpatch.applyOperation(document, jsonpatch._deepClone(operation))`.\n *\n * @param document The document to patch\n * @param operation The operation to apply\n * @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.\n * @param mutateDocument Whether to mutate the original document or clone it before applying\n * @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.\n * @return `{newDocument, result}` after the operation\n */\nexport function applyOperation(document, operation, validateOperation, mutateDocument, banPrototypeModifications, index) {\n if (validateOperation === void 0) { validateOperation = false; }\n if (mutateDocument === void 0) { mutateDocument = true; }\n if (banPrototypeModifications === void 0) { banPrototypeModifications = true; }\n if (index === void 0) { index = 0; }\n if (validateOperation) {\n if (typeof validateOperation == 'function') {\n validateOperation(operation, 0, document, operation.path);\n }\n else {\n validator(operation, 0);\n }\n }\n /* ROOT OPERATIONS */\n if (operation.path === \"\") {\n var returnValue = { newDocument: document };\n if (operation.op === 'add') {\n returnValue.newDocument = operation.value;\n return returnValue;\n }\n else if (operation.op === 'replace') {\n returnValue.newDocument = operation.value;\n returnValue.removed = document; //document we removed\n return returnValue;\n }\n else if (operation.op === 'move' || operation.op === 'copy') { // it's a move or copy to root\n returnValue.newDocument = getValueByPointer(document, operation.from); // get the value by json-pointer in `from` field\n if (operation.op === 'move') { // report removed item\n returnValue.removed = document;\n }\n return returnValue;\n }\n else if (operation.op === 'test') {\n returnValue.test = _areEquals(document, operation.value);\n if (returnValue.test === false) {\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n returnValue.newDocument = document;\n return returnValue;\n }\n else if (operation.op === 'remove') { // a remove on root\n returnValue.removed = document;\n returnValue.newDocument = null;\n return returnValue;\n }\n else if (operation.op === '_get') {\n operation.value = document;\n return returnValue;\n }\n else { /* bad operation */\n if (validateOperation) {\n throw new JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document);\n }\n else {\n return returnValue;\n }\n }\n } /* END ROOT OPERATIONS */\n else {\n if (!mutateDocument) {\n document = _deepClone(document);\n }\n var path = operation.path || \"\";\n var keys = path.split('/');\n var obj = document;\n var t = 1; //skip empty element - http://jsperf.com/to-shift-or-not-to-shift\n var len = keys.length;\n var existingPathFragment = undefined;\n var key = void 0;\n var validateFunction = void 0;\n if (typeof validateOperation == 'function') {\n validateFunction = validateOperation;\n }\n else {\n validateFunction = validator;\n }\n while (true) {\n key = keys[t];\n if (key && key.indexOf('~') != -1) {\n key = unescapePathComponent(key);\n }\n if (banPrototypeModifications &&\n (key == '__proto__' ||\n (key == 'prototype' && t > 0 && keys[t - 1] == 'constructor'))) {\n throw new TypeError('JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README');\n }\n if (validateOperation) {\n if (existingPathFragment === undefined) {\n if (obj[key] === undefined) {\n existingPathFragment = keys.slice(0, t).join('/');\n }\n else if (t == len - 1) {\n existingPathFragment = operation.path;\n }\n if (existingPathFragment !== undefined) {\n validateFunction(operation, 0, document, existingPathFragment);\n }\n }\n }\n t++;\n if (Array.isArray(obj)) {\n if (key === '-') {\n key = obj.length;\n }\n else {\n if (validateOperation && !isInteger(key)) {\n throw new JsonPatchError(\"Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index\", \"OPERATION_PATH_ILLEGAL_ARRAY_INDEX\", index, operation, document);\n } // only parse key when it's an integer for `arr.prop` to work\n else if (isInteger(key)) {\n key = ~~key;\n }\n }\n if (t >= len) {\n if (validateOperation && operation.op === \"add\" && key > obj.length) {\n throw new JsonPatchError(\"The specified index MUST NOT be greater than the number of elements in the array\", \"OPERATION_VALUE_OUT_OF_BOUNDS\", index, operation, document);\n }\n var returnValue = arrOps[operation.op].call(operation, obj, key, document); // Apply patch\n if (returnValue.test === false) {\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n return returnValue;\n }\n }\n else {\n if (t >= len) {\n var returnValue = objOps[operation.op].call(operation, obj, key, document); // Apply patch\n if (returnValue.test === false) {\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n return returnValue;\n }\n }\n obj = obj[key];\n // If we have more keys in the path, but the next value isn't a non-null object,\n // throw an OPERATION_PATH_UNRESOLVABLE error instead of iterating again.\n if (validateOperation && t < len && (!obj || typeof obj !== \"object\")) {\n throw new JsonPatchError('Cannot perform operation at the desired path', 'OPERATION_PATH_UNRESOLVABLE', index, operation, document);\n }\n }\n }\n}\n/**\n * Apply a full JSON Patch array on a JSON document.\n * Returns the {newDocument, result} of the patch.\n * It modifies the `document` object and `patch` - it gets the values by reference.\n * If you would like to avoid touching your values, clone them:\n * `jsonpatch.applyPatch(document, jsonpatch._deepClone(patch))`.\n *\n * @param document The document to patch\n * @param patch The patch to apply\n * @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.\n * @param mutateDocument Whether to mutate the original document or clone it before applying\n * @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.\n * @return An array of `{newDocument, result}` after the patch\n */\nexport function applyPatch(document, patch, validateOperation, mutateDocument, banPrototypeModifications) {\n if (mutateDocument === void 0) { mutateDocument = true; }\n if (banPrototypeModifications === void 0) { banPrototypeModifications = true; }\n if (validateOperation) {\n if (!Array.isArray(patch)) {\n throw new JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');\n }\n }\n if (!mutateDocument) {\n document = _deepClone(document);\n }\n var results = new Array(patch.length);\n for (var i = 0, length_1 = patch.length; i < length_1; i++) {\n // we don't need to pass mutateDocument argument because if it was true, we already deep cloned the object, we'll just pass `true`\n results[i] = applyOperation(document, patch[i], validateOperation, true, banPrototypeModifications, i);\n document = results[i].newDocument; // in case root was replaced\n }\n results.newDocument = document;\n return results;\n}\n/**\n * Apply a single JSON Patch Operation on a JSON document.\n * Returns the updated document.\n * Suitable as a reducer.\n *\n * @param document The document to patch\n * @param operation The operation to apply\n * @return The updated document\n */\nexport function applyReducer(document, operation, index) {\n var operationResult = applyOperation(document, operation);\n if (operationResult.test === false) { // failed test\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n return operationResult.newDocument;\n}\n/**\n * Validates a single operation. Called from `jsonpatch.validate`. Throws `JsonPatchError` in case of an error.\n * @param {object} operation - operation object (patch)\n * @param {number} index - index of operation in the sequence\n * @param {object} [document] - object where the operation is supposed to be applied\n * @param {string} [existingPathFragment] - comes along with `document`\n */\nexport function validator(operation, index, document, existingPathFragment) {\n if (typeof operation !== 'object' || operation === null || Array.isArray(operation)) {\n throw new JsonPatchError('Operation is not an object', 'OPERATION_NOT_AN_OBJECT', index, operation, document);\n }\n else if (!objOps[operation.op]) {\n throw new JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document);\n }\n else if (typeof operation.path !== 'string') {\n throw new JsonPatchError('Operation `path` property is not a string', 'OPERATION_PATH_INVALID', index, operation, document);\n }\n else if (operation.path.indexOf('/') !== 0 && operation.path.length > 0) {\n // paths that aren't empty string should start with \"/\"\n throw new JsonPatchError('Operation `path` property must start with \"/\"', 'OPERATION_PATH_INVALID', index, operation, document);\n }\n else if ((operation.op === 'move' || operation.op === 'copy') && typeof operation.from !== 'string') {\n throw new JsonPatchError('Operation `from` property is not present (applicable in `move` and `copy` operations)', 'OPERATION_FROM_REQUIRED', index, operation, document);\n }\n else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && operation.value === undefined) {\n throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_REQUIRED', index, operation, document);\n }\n else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && hasUndefined(operation.value)) {\n throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED', index, operation, document);\n }\n else if (document) {\n if (operation.op == \"add\") {\n var pathLen = operation.path.split(\"/\").length;\n var existingPathLen = existingPathFragment.split(\"/\").length;\n if (pathLen !== existingPathLen + 1 && pathLen !== existingPathLen) {\n throw new JsonPatchError('Cannot perform an `add` operation at the desired path', 'OPERATION_PATH_CANNOT_ADD', index, operation, document);\n }\n }\n else if (operation.op === 'replace' || operation.op === 'remove' || operation.op === '_get') {\n if (operation.path !== existingPathFragment) {\n throw new JsonPatchError('Cannot perform the operation at a path that does not exist', 'OPERATION_PATH_UNRESOLVABLE', index, operation, document);\n }\n }\n else if (operation.op === 'move' || operation.op === 'copy') {\n var existingValue = { op: \"_get\", path: operation.from, value: undefined };\n var error = validate([existingValue], document);\n if (error && error.name === 'OPERATION_PATH_UNRESOLVABLE') {\n throw new JsonPatchError('Cannot perform the operation from a path that does not exist', 'OPERATION_FROM_UNRESOLVABLE', index, operation, document);\n }\n }\n }\n}\n/**\n * Validates a sequence of operations. If `document` parameter is provided, the sequence is additionally validated against the object document.\n * If error is encountered, returns a JsonPatchError object\n * @param sequence\n * @param document\n * @returns {JsonPatchError|undefined}\n */\nexport function validate(sequence, document, externalValidator) {\n try {\n if (!Array.isArray(sequence)) {\n throw new JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');\n }\n if (document) {\n //clone document and sequence so that we can safely try applying operations\n applyPatch(_deepClone(document), _deepClone(sequence), externalValidator || true);\n }\n else {\n externalValidator = externalValidator || validator;\n for (var i = 0; i < sequence.length; i++) {\n externalValidator(sequence[i], i, document, undefined);\n }\n }\n }\n catch (e) {\n if (e instanceof JsonPatchError) {\n return e;\n }\n else {\n throw e;\n }\n }\n}\n// based on https://github.com/epoberezkin/fast-deep-equal\n// MIT License\n// Copyright (c) 2017 Evgeny Poberezkin\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\nexport function _areEquals(a, b) {\n if (a === b)\n return true;\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = Array.isArray(a), arrB = Array.isArray(b), i, length, key;\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length)\n return false;\n for (i = length; i-- !== 0;)\n if (!_areEquals(a[i], b[i]))\n return false;\n return true;\n }\n if (arrA != arrB)\n return false;\n var keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length)\n return false;\n for (i = length; i-- !== 0;)\n if (!b.hasOwnProperty(keys[i]))\n return false;\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (!_areEquals(a[key], b[key]))\n return false;\n }\n return true;\n }\n return a !== a && b !== b;\n}\n;\n","/*!\n * https://github.com/Starcounter-Jack/JSON-Patch\n * (c) 2017-2021 Joachim Wester\n * MIT license\n */\nimport { _deepClone, _objectKeys, escapePathComponent, hasOwnProperty } from './helpers.mjs';\nimport { applyPatch } from './core.mjs';\nvar beforeDict = new WeakMap();\nvar Mirror = /** @class */ (function () {\n function Mirror(obj) {\n this.observers = new Map();\n this.obj = obj;\n }\n return Mirror;\n}());\nvar ObserverInfo = /** @class */ (function () {\n function ObserverInfo(callback, observer) {\n this.callback = callback;\n this.observer = observer;\n }\n return ObserverInfo;\n}());\nfunction getMirror(obj) {\n return beforeDict.get(obj);\n}\nfunction getObserverFromMirror(mirror, callback) {\n return mirror.observers.get(callback);\n}\nfunction removeObserverFromMirror(mirror, observer) {\n mirror.observers.delete(observer.callback);\n}\n/**\n * Detach an observer from an object\n */\nexport function unobserve(root, observer) {\n observer.unobserve();\n}\n/**\n * Observes changes made to an object, which can then be retrieved using generate\n */\nexport function observe(obj, callback) {\n var patches = [];\n var observer;\n var mirror = getMirror(obj);\n if (!mirror) {\n mirror = new Mirror(obj);\n beforeDict.set(obj, mirror);\n }\n else {\n var observerInfo = getObserverFromMirror(mirror, callback);\n observer = observerInfo && observerInfo.observer;\n }\n if (observer) {\n return observer;\n }\n observer = {};\n mirror.value = _deepClone(obj);\n if (callback) {\n observer.callback = callback;\n observer.next = null;\n var dirtyCheck = function () {\n generate(observer);\n };\n var fastCheck = function () {\n clearTimeout(observer.next);\n observer.next = setTimeout(dirtyCheck);\n };\n if (typeof window !== 'undefined') { //not Node\n window.addEventListener('mouseup', fastCheck);\n window.addEventListener('keyup', fastCheck);\n window.addEventListener('mousedown', fastCheck);\n window.addEventListener('keydown', fastCheck);\n window.addEventListener('change', fastCheck);\n }\n }\n observer.patches = patches;\n observer.object = obj;\n observer.unobserve = function () {\n generate(observer);\n clearTimeout(observer.next);\n removeObserverFromMirror(mirror, observer);\n if (typeof window !== 'undefined') {\n window.removeEventListener('mouseup', fastCheck);\n window.removeEventListener('keyup', fastCheck);\n window.removeEventListener('mousedown', fastCheck);\n window.removeEventListener('keydown', fastCheck);\n window.removeEventListener('change', fastCheck);\n }\n };\n mirror.observers.set(callback, new ObserverInfo(callback, observer));\n return observer;\n}\n/**\n * Generate an array of patches from an observer\n */\nexport function generate(observer, invertible) {\n if (invertible === void 0) { invertible = false; }\n var mirror = beforeDict.get(observer.object);\n _generate(mirror.value, observer.object, observer.patches, \"\", invertible);\n if (observer.patches.length) {\n applyPatch(mirror.value, observer.patches);\n }\n var temp = observer.patches;\n if (temp.length > 0) {\n observer.patches = [];\n if (observer.callback) {\n observer.callback(temp);\n }\n }\n return temp;\n}\n// Dirty check if obj is different from mirror, generate patches and update mirror\nfunction _generate(mirror, obj, patches, path, invertible) {\n if (obj === mirror) {\n return;\n }\n if (typeof obj.toJSON === \"function\") {\n obj = obj.toJSON();\n }\n var newKeys = _objectKeys(obj);\n var oldKeys = _objectKeys(mirror);\n var changed = false;\n var deleted = false;\n //if ever \"move\" operation is implemented here, make sure this test runs OK: \"should not generate the same patch twice (move)\"\n for (var t = oldKeys.length - 1; t >= 0; t--) {\n var key = oldKeys[t];\n var oldVal = mirror[key];\n if (hasOwnProperty(obj, key) && !(obj[key] === undefined && oldVal !== undefined && Array.isArray(obj) === false)) {\n var newVal = obj[key];\n if (typeof oldVal == \"object\" && oldVal != null && typeof newVal == \"object\" && newVal != null && Array.isArray(oldVal) === Array.isArray(newVal)) {\n _generate(oldVal, newVal, patches, path + \"/\" + escapePathComponent(key), invertible);\n }\n else {\n if (oldVal !== newVal) {\n changed = true;\n if (invertible) {\n patches.push({ op: \"test\", path: path + \"/\" + escapePathComponent(key), value: _deepClone(oldVal) });\n }\n patches.push({ op: \"replace\", path: path + \"/\" + escapePathComponent(key), value: _deepClone(newVal) });\n }\n }\n }\n else if (Array.isArray(mirror) === Array.isArray(obj)) {\n if (invertible) {\n patches.push({ op: \"test\", path: path + \"/\" + escapePathComponent(key), value: _deepClone(oldVal) });\n }\n patches.push({ op: \"remove\", path: path + \"/\" + escapePathComponent(key) });\n deleted = true; // property has been deleted\n }\n else {\n if (invertible) {\n patches.push({ op: \"test\", path: path, value: mirror });\n }\n patches.push({ op: \"replace\", path: path, value: obj });\n changed = true;\n }\n }\n if (!deleted && newKeys.length == oldKeys.length) {\n return;\n }\n for (var t = 0; t < newKeys.length; t++) {\n var key = newKeys[t];\n if (!hasOwnProperty(mirror, key) && obj[key] !== undefined) {\n patches.push({ op: \"add\", path: path + \"/\" + escapePathComponent(key), value: _deepClone(obj[key]) });\n }\n }\n}\n/**\n * Create an array of patches from the differences in two objects\n */\nexport function compare(tree1, tree2, invertible) {\n if (invertible === void 0) { invertible = false; }\n var patches = [];\n _generate(tree1, tree2, patches, '', invertible);\n return patches;\n}\n","export * from './module/core.mjs';\nexport * from './module/duplex.mjs';\nexport {\n PatchError as JsonPatchError,\n _deepClone as deepClone,\n escapePathComponent,\n unescapePathComponent\n} from './module/helpers.mjs';\n\n\n/**\n * Default export for backwards compat\n */\n\nimport * as core from './module/core.mjs';\nimport * as duplex from './module/duplex.mjs';\nimport {\n PatchError as JsonPatchError,\n _deepClone as deepClone,\n escapePathComponent,\n unescapePathComponent\n} from './module/helpers.mjs';\n\nexport default Object.assign({}, core, duplex, {\n JsonPatchError,\n deepClone,\n escapePathComponent,\n unescapePathComponent\n});","function accessor (fn, fields, name) {\n fn.fields = fields || [];\n fn.fname = name;\n return fn;\n}\nfunction accessorName(fn) {\n return fn == null ? null : fn.fname;\n}\nfunction accessorFields(fn) {\n return fn == null ? null : fn.fields;\n}\n\nfunction getter (path) {\n return path.length === 1 ? get1(path[0]) : getN(path);\n}\nconst get1 = field => function (obj) {\n return obj[field];\n};\nconst getN = path => {\n const len = path.length;\n return function (obj) {\n for (let i = 0; i < len; ++i) {\n obj = obj[path[i]];\n }\n return obj;\n };\n};\n\nfunction error (message) {\n throw Error(message);\n}\n\nfunction splitAccessPath (p) {\n const path = [],\n n = p.length;\n let q = null,\n b = 0,\n s = '',\n i,\n j,\n c;\n p = p + '';\n function push() {\n path.push(s + p.substring(i, j));\n s = '';\n i = j + 1;\n }\n for (i = j = 0; j < n; ++j) {\n c = p[j];\n if (c === '\\\\') {\n s += p.substring(i, j);\n s += p.substring(++j, ++j);\n i = j;\n } else if (c === q) {\n push();\n q = null;\n b = -1;\n } else if (q) {\n continue;\n } else if (i === b && c === '\"') {\n i = j + 1;\n q = c;\n } else if (i === b && c === \"'\") {\n i = j + 1;\n q = c;\n } else if (c === '.' && !b) {\n if (j > i) {\n push();\n } else {\n i = j + 1;\n }\n } else if (c === '[') {\n if (j > i) push();\n b = i = j + 1;\n } else if (c === ']') {\n if (!b) error('Access path missing open bracket: ' + p);\n if (b > 0) push();\n b = 0;\n i = j + 1;\n }\n }\n if (b) error('Access path missing closing bracket: ' + p);\n if (q) error('Access path missing closing quote: ' + p);\n if (j > i) {\n j++;\n push();\n }\n return path;\n}\n\nfunction field (field, name, opt) {\n const path = splitAccessPath(field);\n field = path.length === 1 ? path[0] : field;\n return accessor((opt && opt.get || getter)(path), [field], name || field);\n}\n\nconst id = field('id');\nconst identity = accessor(_ => _, [], 'identity');\nconst zero = accessor(() => 0, [], 'zero');\nconst one = accessor(() => 1, [], 'one');\nconst truthy = accessor(() => true, [], 'true');\nconst falsy = accessor(() => false, [], 'false');\n\nfunction log$1(method, level, input) {\n const args = [level].concat([].slice.call(input));\n console[method].apply(console, args); // eslint-disable-line no-console\n}\n\nconst None = 0;\nconst Error$1 = 1;\nconst Warn = 2;\nconst Info = 3;\nconst Debug = 4;\nfunction logger (_, method) {\n let handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : log$1;\n let level = _ || None;\n return {\n level(_) {\n if (arguments.length) {\n level = +_;\n return this;\n } else {\n return level;\n }\n },\n error() {\n if (level >= Error$1) handler(method || 'error', 'ERROR', arguments);\n return this;\n },\n warn() {\n if (level >= Warn) handler(method || 'warn', 'WARN', arguments);\n return this;\n },\n info() {\n if (level >= Info) handler(method || 'log', 'INFO', arguments);\n return this;\n },\n debug() {\n if (level >= Debug) handler(method || 'log', 'DEBUG', arguments);\n return this;\n }\n };\n}\n\nvar isArray = Array.isArray;\n\nfunction isObject (_) {\n return _ === Object(_);\n}\n\nconst isLegalKey = key => key !== '__proto__';\nfunction mergeConfig() {\n for (var _len = arguments.length, configs = new Array(_len), _key = 0; _key < _len; _key++) {\n configs[_key] = arguments[_key];\n }\n return configs.reduce((out, source) => {\n for (const key in source) {\n if (key === 'signals') {\n // for signals, we merge the signals arrays\n // source signals take precedence over\n // existing signals with the same name\n out.signals = mergeNamed(out.signals, source.signals);\n } else {\n // otherwise, merge objects subject to recursion constraints\n // for legend block, recurse for the layout entry only\n // for style block, recurse for all properties\n // otherwise, no recursion: objects overwrite, no merging\n const r = key === 'legend' ? {\n layout: 1\n } : key === 'style' ? true : null;\n writeConfig(out, key, source[key], r);\n }\n }\n return out;\n }, {});\n}\nfunction writeConfig(output, key, value, recurse) {\n if (!isLegalKey(key)) return;\n let k, o;\n if (isObject(value) && !isArray(value)) {\n o = isObject(output[key]) ? output[key] : output[key] = {};\n for (k in value) {\n if (recurse && (recurse === true || recurse[k])) {\n writeConfig(o, k, value[k]);\n } else if (isLegalKey(k)) {\n o[k] = value[k];\n }\n }\n } else {\n output[key] = value;\n }\n}\nfunction mergeNamed(a, b) {\n if (a == null) return b;\n const map = {},\n out = [];\n function add(_) {\n if (!map[_.name]) {\n map[_.name] = 1;\n out.push(_);\n }\n }\n b.forEach(add);\n a.forEach(add);\n return out;\n}\n\nfunction peek (array) {\n return array[array.length - 1];\n}\n\nfunction toNumber (_) {\n return _ == null || _ === '' ? null : +_;\n}\n\nconst exp = sign => x => sign * Math.exp(x);\nconst log = sign => x => Math.log(sign * x);\nconst symlog = c => x => Math.sign(x) * Math.log1p(Math.abs(x / c));\nconst symexp = c => x => Math.sign(x) * Math.expm1(Math.abs(x)) * c;\nconst pow = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\nfunction pan(domain, delta, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n dd = (d1 - d0) * delta;\n return [ground(d0 - dd), ground(d1 - dd)];\n}\nfunction panLinear(domain, delta) {\n return pan(domain, delta, toNumber, identity);\n}\nfunction panLog(domain, delta) {\n var sign = Math.sign(domain[0]);\n return pan(domain, delta, log(sign), exp(sign));\n}\nfunction panPow(domain, delta, exponent) {\n return pan(domain, delta, pow(exponent), pow(1 / exponent));\n}\nfunction panSymlog(domain, delta, constant) {\n return pan(domain, delta, symlog(constant), symexp(constant));\n}\nfunction zoom(domain, anchor, scale, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n da = anchor != null ? lift(anchor) : (d0 + d1) / 2;\n return [ground(da + (d0 - da) * scale), ground(da + (d1 - da) * scale)];\n}\nfunction zoomLinear(domain, anchor, scale) {\n return zoom(domain, anchor, scale, toNumber, identity);\n}\nfunction zoomLog(domain, anchor, scale) {\n const sign = Math.sign(domain[0]);\n return zoom(domain, anchor, scale, log(sign), exp(sign));\n}\nfunction zoomPow(domain, anchor, scale, exponent) {\n return zoom(domain, anchor, scale, pow(exponent), pow(1 / exponent));\n}\nfunction zoomSymlog(domain, anchor, scale, constant) {\n return zoom(domain, anchor, scale, symlog(constant), symexp(constant));\n}\n\nfunction quarter(date) {\n return 1 + ~~(new Date(date).getMonth() / 3);\n}\nfunction utcquarter(date) {\n return 1 + ~~(new Date(date).getUTCMonth() / 3);\n}\n\nfunction array (_) {\n return _ != null ? isArray(_) ? _ : [_] : [];\n}\n\n/**\n * Span-preserving range clamp. If the span of the input range is less\n * than (max - min) and an endpoint exceeds either the min or max value,\n * the range is translated such that the span is preserved and one\n * endpoint touches the boundary of the min/max range.\n * If the span exceeds (max - min), the range [min, max] is returned.\n */\nfunction clampRange (range, min, max) {\n let lo = range[0],\n hi = range[1],\n span;\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n span = hi - lo;\n return span >= max - min ? [min, max] : [lo = Math.min(Math.max(lo, min), max - span), lo + span];\n}\n\nfunction isFunction (_) {\n return typeof _ === 'function';\n}\n\nconst DESCENDING = 'descending';\nfunction compare (fields, orders, opt) {\n opt = opt || {};\n orders = array(orders) || [];\n const ord = [],\n get = [],\n fmap = {},\n gen = opt.comparator || comparator;\n array(fields).forEach((f, i) => {\n if (f == null) return;\n ord.push(orders[i] === DESCENDING ? -1 : 1);\n get.push(f = isFunction(f) ? f : field(f, null, opt));\n (accessorFields(f) || []).forEach(_ => fmap[_] = 1);\n });\n return get.length === 0 ? null : accessor(gen(get, ord), Object.keys(fmap));\n}\nconst ascending = (u, v) => (u < v || u == null) && v != null ? -1 : (u > v || v == null) && u != null ? 1 : (v = v instanceof Date ? +v : v, u = u instanceof Date ? +u : u) !== u && v === v ? -1 : v !== v && u === u ? 1 : 0;\nconst comparator = (fields, orders) => fields.length === 1 ? compare1(fields[0], orders[0]) : compareN(fields, orders, fields.length);\nconst compare1 = (field, order) => function (a, b) {\n return ascending(field(a), field(b)) * order;\n};\nconst compareN = (fields, orders, n) => {\n orders.push(0); // pad zero for convenient lookup\n return function (a, b) {\n let f,\n c = 0,\n i = -1;\n while (c === 0 && ++i < n) {\n f = fields[i];\n c = ascending(f(a), f(b));\n }\n return c * orders[i];\n };\n};\n\nfunction constant (_) {\n return isFunction(_) ? _ : () => _;\n}\n\nfunction debounce (delay, handler) {\n let tid;\n return e => {\n if (tid) clearTimeout(tid);\n tid = setTimeout(() => (handler(e), tid = null), delay);\n };\n}\n\nfunction extend (_) {\n for (let x, k, i = 1, len = arguments.length; i < len; ++i) {\n x = arguments[i];\n for (k in x) {\n _[k] = x[k];\n }\n }\n return _;\n}\n\n/**\n * Return an array with minimum and maximum values, in the\n * form [min, max]. Ignores null, undefined, and NaN values.\n */\nfunction extent (array, f) {\n let i = 0,\n n,\n v,\n min,\n max;\n if (array && (n = array.length)) {\n if (f == null) {\n // find first valid value\n for (v = array[i]; i < n && (v == null || v !== v); v = array[++i]);\n min = max = v;\n\n // visit all other values\n for (; i < n; ++i) {\n v = array[i];\n // skip null/undefined; NaN will fail all comparisons\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n } else {\n // find first valid value\n for (v = f(array[i]); i < n && (v == null || v !== v); v = f(array[++i]));\n min = max = v;\n\n // visit all other values\n for (; i < n; ++i) {\n v = f(array[i]);\n // skip null/undefined; NaN will fail all comparisons\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n }\n }\n return [min, max];\n}\n\nfunction extentIndex (array, f) {\n const n = array.length;\n let i = -1,\n a,\n b,\n c,\n u,\n v;\n if (f == null) {\n while (++i < n) {\n b = array[i];\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n if (i === n) return [-1, -1];\n u = v = i;\n while (++i < n) {\n b = array[i];\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n } else {\n while (++i < n) {\n b = f(array[i], i, array);\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n if (i === n) return [-1, -1];\n u = v = i;\n while (++i < n) {\n b = f(array[i], i, array);\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n }\n return [u, v];\n}\n\nconst hop = Object.prototype.hasOwnProperty;\nfunction has (object, property) {\n return hop.call(object, property);\n}\n\nconst NULL = {};\nfunction fastmap (input) {\n let obj = {},\n test;\n function has$1(key) {\n return has(obj, key) && obj[key] !== NULL;\n }\n const map = {\n size: 0,\n empty: 0,\n object: obj,\n has: has$1,\n get(key) {\n return has$1(key) ? obj[key] : undefined;\n },\n set(key, value) {\n if (!has$1(key)) {\n ++map.size;\n if (obj[key] === NULL) --map.empty;\n }\n obj[key] = value;\n return this;\n },\n delete(key) {\n if (has$1(key)) {\n --map.size;\n ++map.empty;\n obj[key] = NULL;\n }\n return this;\n },\n clear() {\n map.size = map.empty = 0;\n map.object = obj = {};\n },\n test(_) {\n if (arguments.length) {\n test = _;\n return map;\n } else {\n return test;\n }\n },\n clean() {\n const next = {};\n let size = 0;\n for (const key in obj) {\n const value = obj[key];\n if (value !== NULL && (!test || !test(value))) {\n next[key] = value;\n ++size;\n }\n }\n map.size = size;\n map.empty = 0;\n map.object = obj = next;\n }\n };\n if (input) Object.keys(input).forEach(key => {\n map.set(key, input[key]);\n });\n return map;\n}\n\nfunction flush (range, value, threshold, left, right, center) {\n if (!threshold && threshold !== 0) return center;\n const t = +threshold;\n let a = range[0],\n b = peek(range),\n l;\n\n // swap endpoints if range is reversed\n if (b < a) {\n l = a;\n a = b;\n b = l;\n }\n\n // compare value to endpoints\n l = Math.abs(value - a);\n const r = Math.abs(b - value);\n\n // adjust if value is within threshold distance of endpoint\n return l < r && l <= t ? left : r <= t ? right : center;\n}\n\nfunction inherits (child, parent, members) {\n const proto = child.prototype = Object.create(parent.prototype);\n Object.defineProperty(proto, 'constructor', {\n value: child,\n writable: true,\n enumerable: true,\n configurable: true\n });\n return extend(proto, members);\n}\n\n/**\n * Predicate that returns true if the value lies within the span\n * of the given range. The left and right flags control the use\n * of inclusive (true) or exclusive (false) comparisons.\n */\nfunction inrange (value, range, left, right) {\n let r0 = range[0],\n r1 = range[range.length - 1],\n t;\n if (r0 > r1) {\n t = r0;\n r0 = r1;\n r1 = t;\n }\n left = left === undefined || left;\n right = right === undefined || right;\n return (left ? r0 <= value : r0 < value) && (right ? value <= r1 : value < r1);\n}\n\nfunction isBoolean (_) {\n return typeof _ === 'boolean';\n}\n\nfunction isDate (_) {\n return Object.prototype.toString.call(_) === '[object Date]';\n}\n\nfunction isIterable (_) {\n return _ && isFunction(_[Symbol.iterator]);\n}\n\nfunction isNumber (_) {\n return typeof _ === 'number';\n}\n\nfunction isRegExp (_) {\n return Object.prototype.toString.call(_) === '[object RegExp]';\n}\n\nfunction isString (_) {\n return typeof _ === 'string';\n}\n\nfunction key (fields, flat, opt) {\n if (fields) {\n fields = flat ? array(fields).map(f => f.replace(/\\\\(.)/g, '$1')) : array(fields);\n }\n const len = fields && fields.length,\n gen = opt && opt.get || getter,\n map = f => gen(flat ? [f] : splitAccessPath(f));\n let fn;\n if (!len) {\n fn = function () {\n return '';\n };\n } else if (len === 1) {\n const get = map(fields[0]);\n fn = function (_) {\n return '' + get(_);\n };\n } else {\n const get = fields.map(map);\n fn = function (_) {\n let s = '' + get[0](_),\n i = 0;\n while (++i < len) s += '|' + get[i](_);\n return s;\n };\n }\n return accessor(fn, fields, 'key');\n}\n\nfunction lerp (array, frac) {\n const lo = array[0],\n hi = peek(array),\n f = +frac;\n return !f ? lo : f === 1 ? hi : lo + f * (hi - lo);\n}\n\nconst DEFAULT_MAX_SIZE = 10000;\n\n// adapted from https://github.com/dominictarr/hashlru/ (MIT License)\nfunction lruCache (maxsize) {\n maxsize = +maxsize || DEFAULT_MAX_SIZE;\n let curr, prev, size;\n const clear = () => {\n curr = {};\n prev = {};\n size = 0;\n };\n const update = (key, value) => {\n if (++size > maxsize) {\n prev = curr;\n curr = {};\n size = 1;\n }\n return curr[key] = value;\n };\n clear();\n return {\n clear,\n has: key => has(curr, key) || has(prev, key),\n get: key => has(curr, key) ? curr[key] : has(prev, key) ? update(key, prev[key]) : undefined,\n set: (key, value) => has(curr, key) ? curr[key] = value : update(key, value)\n };\n}\n\nfunction merge (compare, array0, array1, output) {\n const n0 = array0.length,\n n1 = array1.length;\n if (!n1) return array0;\n if (!n0) return array1;\n const merged = output || new array0.constructor(n0 + n1);\n let i0 = 0,\n i1 = 0,\n i = 0;\n for (; i0 < n0 && i1 < n1; ++i) {\n merged[i] = compare(array0[i0], array1[i1]) > 0 ? array1[i1++] : array0[i0++];\n }\n for (; i0 < n0; ++i0, ++i) {\n merged[i] = array0[i0];\n }\n for (; i1 < n1; ++i1, ++i) {\n merged[i] = array1[i1];\n }\n return merged;\n}\n\nfunction repeat (str, reps) {\n let s = '';\n while (--reps >= 0) s += str;\n return s;\n}\n\nfunction pad (str, length, padchar, align) {\n const c = padchar || ' ',\n s = str + '',\n n = length - s.length;\n return n <= 0 ? s : align === 'left' ? repeat(c, n) + s : align === 'center' ? repeat(c, ~~(n / 2)) + s + repeat(c, Math.ceil(n / 2)) : s + repeat(c, n);\n}\n\n/**\n * Return the numerical span of an array: the difference between\n * the last and first values.\n */\nfunction span (array) {\n return array && peek(array) - array[0] || 0;\n}\n\nfunction $(x) {\n return isArray(x) ? '[' + x.map($) + ']' : isObject(x) || isString(x) ?\n // Output valid JSON and JS source strings.\n // See http://timelessrepo.com/json-isnt-a-javascript-subset\n JSON.stringify(x).replace('\\u2028', '\\\\u2028').replace('\\u2029', '\\\\u2029') : x;\n}\n\nfunction toBoolean (_) {\n return _ == null || _ === '' ? null : !_ || _ === 'false' || _ === '0' ? false : !!_;\n}\n\nconst defaultParser = _ => isNumber(_) ? _ : isDate(_) ? _ : Date.parse(_);\nfunction toDate (_, parser) {\n parser = parser || defaultParser;\n return _ == null || _ === '' ? null : parser(_);\n}\n\nfunction toString (_) {\n return _ == null || _ === '' ? null : _ + '';\n}\n\nfunction toSet (_) {\n const s = {},\n n = _.length;\n for (let i = 0; i < n; ++i) s[_[i]] = true;\n return s;\n}\n\nfunction truncate (str, length, align, ellipsis) {\n const e = ellipsis != null ? ellipsis : '\\u2026',\n s = str + '',\n n = s.length,\n l = Math.max(0, length - e.length);\n return n <= length ? s : align === 'left' ? e + s.slice(n - l) : align === 'center' ? s.slice(0, Math.ceil(l / 2)) + e + s.slice(n - ~~(l / 2)) : s.slice(0, l) + e;\n}\n\nfunction visitArray (array, filter, visitor) {\n if (array) {\n if (filter) {\n const n = array.length;\n for (let i = 0; i < n; ++i) {\n const t = filter(array[i]);\n if (t) visitor(t, i, array);\n }\n } else {\n array.forEach(visitor);\n }\n }\n}\n\nexport { Debug, Error$1 as Error, Info, None, Warn, accessor, accessorFields, accessorName, array, ascending, clampRange, compare, constant, debounce, error, extend, extent, extentIndex, falsy, fastmap, field, flush, has as hasOwnProperty, id, identity, inherits, inrange, isArray, isBoolean, isDate, isFunction, isIterable, isNumber, isObject, isRegExp, isString, key, lerp, logger, lruCache, merge, mergeConfig, one, pad, panLinear, panLog, panPow, panSymlog, peek, quarter, repeat, span, splitAccessPath, $ as stringValue, toBoolean, toDate, toNumber, toSet, toString, truncate, truthy, utcquarter, visitArray, writeConfig, zero, zoomLinear, zoomLog, zoomPow, zoomSymlog };\n","var EOL = {},\n EOF = {},\n QUOTE = 34,\n NEWLINE = 10,\n RETURN = 13;\n\nfunction objectConverter(columns) {\n return new Function(\"d\", \"return {\" + columns.map(function(name, i) {\n return JSON.stringify(name) + \": d[\" + i + \"] || \\\"\\\"\";\n }).join(\",\") + \"}\");\n}\n\nfunction customConverter(columns, f) {\n var object = objectConverter(columns);\n return function(row, i) {\n return f(object(row), i, columns);\n };\n}\n\n// Compute unique columns in order of discovery.\nfunction inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}\n\nfunction pad(value, width) {\n var s = value + \"\", length = s.length;\n return length < width ? new Array(width - length + 1).join(0) + s : s;\n}\n\nfunction formatYear(year) {\n return year < 0 ? \"-\" + pad(-year, 6)\n : year > 9999 ? \"+\" + pad(year, 6)\n : pad(year, 4);\n}\n\nfunction formatDate(date) {\n var hours = date.getUTCHours(),\n minutes = date.getUTCMinutes(),\n seconds = date.getUTCSeconds(),\n milliseconds = date.getUTCMilliseconds();\n return isNaN(date) ? \"Invalid Date\"\n : formatYear(date.getUTCFullYear(), 4) + \"-\" + pad(date.getUTCMonth() + 1, 2) + \"-\" + pad(date.getUTCDate(), 2)\n + (milliseconds ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \":\" + pad(seconds, 2) + \".\" + pad(milliseconds, 3) + \"Z\"\n : seconds ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \":\" + pad(seconds, 2) + \"Z\"\n : minutes || hours ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \"Z\"\n : \"\");\n}\n\nexport default function(delimiter) {\n var reFormat = new RegExp(\"[\\\"\" + delimiter + \"\\n\\r]\"),\n DELIMITER = delimiter.charCodeAt(0);\n\n function parse(text, f) {\n var convert, columns, rows = parseRows(text, function(row, i) {\n if (convert) return convert(row, i - 1);\n columns = row, convert = f ? customConverter(row, f) : objectConverter(row);\n });\n rows.columns = columns || [];\n return rows;\n }\n\n function parseRows(text, f) {\n var rows = [], // output rows\n N = text.length,\n I = 0, // current character index\n n = 0, // current line number\n t, // current token\n eof = N <= 0, // current token followed by EOF?\n eol = false; // current token followed by EOL?\n\n // Strip the trailing newline.\n if (text.charCodeAt(N - 1) === NEWLINE) --N;\n if (text.charCodeAt(N - 1) === RETURN) --N;\n\n function token() {\n if (eof) return EOF;\n if (eol) return eol = false, EOL;\n\n // Unescape quotes.\n var i, j = I, c;\n if (text.charCodeAt(j) === QUOTE) {\n while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE);\n if ((i = I) >= N) eof = true;\n else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true;\n else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }\n return text.slice(j + 1, i - 1).replace(/\"\"/g, \"\\\"\");\n }\n\n // Find next delimiter or newline.\n while (I < N) {\n if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true;\n else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }\n else if (c !== DELIMITER) continue;\n return text.slice(j, i);\n }\n\n // Return last token before EOF.\n return eof = true, text.slice(j, N);\n }\n\n while ((t = token()) !== EOF) {\n var row = [];\n while (t !== EOL && t !== EOF) row.push(t), t = token();\n if (f && (row = f(row, n++)) == null) continue;\n rows.push(row);\n }\n\n return rows;\n }\n\n function preformatBody(rows, columns) {\n return rows.map(function(row) {\n return columns.map(function(column) {\n return formatValue(row[column]);\n }).join(delimiter);\n });\n }\n\n function format(rows, columns) {\n if (columns == null) columns = inferColumns(rows);\n return [columns.map(formatValue).join(delimiter)].concat(preformatBody(rows, columns)).join(\"\\n\");\n }\n\n function formatBody(rows, columns) {\n if (columns == null) columns = inferColumns(rows);\n return preformatBody(rows, columns).join(\"\\n\");\n }\n\n function formatRows(rows) {\n return rows.map(formatRow).join(\"\\n\");\n }\n\n function formatRow(row) {\n return row.map(formatValue).join(delimiter);\n }\n\n function formatValue(value) {\n return value == null ? \"\"\n : value instanceof Date ? formatDate(value)\n : reFormat.test(value += \"\") ? \"\\\"\" + value.replace(/\"/g, \"\\\"\\\"\") + \"\\\"\"\n : value;\n }\n\n return {\n parse: parse,\n parseRows: parseRows,\n format: format,\n formatBody: formatBody,\n formatRows: formatRows,\n formatRow: formatRow,\n formatValue: formatValue\n };\n}\n","export default function(x) {\n return x;\n}\n","import reverse from \"./reverse.js\";\nimport transform from \"./transform.js\";\n\nexport default function(topology, o) {\n if (typeof o === \"string\") o = topology.objects[o];\n return o.type === \"GeometryCollection\"\n ? {type: \"FeatureCollection\", features: o.geometries.map(function(o) { return feature(topology, o); })}\n : feature(topology, o);\n}\n\nfunction feature(topology, o) {\n var id = o.id,\n bbox = o.bbox,\n properties = o.properties == null ? {} : o.properties,\n geometry = object(topology, o);\n return id == null && bbox == null ? {type: \"Feature\", properties: properties, geometry: geometry}\n : bbox == null ? {type: \"Feature\", id: id, properties: properties, geometry: geometry}\n : {type: \"Feature\", id: id, bbox: bbox, properties: properties, geometry: geometry};\n}\n\nexport function object(topology, o) {\n var transformPoint = transform(topology.transform),\n arcs = topology.arcs;\n\n function arc(i, points) {\n if (points.length) points.pop();\n for (var a = arcs[i < 0 ? ~i : i], k = 0, n = a.length; k < n; ++k) {\n points.push(transformPoint(a[k], k));\n }\n if (i < 0) reverse(points, n);\n }\n\n function point(p) {\n return transformPoint(p);\n }\n\n function line(arcs) {\n var points = [];\n for (var i = 0, n = arcs.length; i < n; ++i) arc(arcs[i], points);\n if (points.length < 2) points.push(points[0]); // This should never happen per the specification.\n return points;\n }\n\n function ring(arcs) {\n var points = line(arcs);\n while (points.length < 4) points.push(points[0]); // This may happen if an arc has only two points.\n return points;\n }\n\n function polygon(arcs) {\n return arcs.map(ring);\n }\n\n function geometry(o) {\n var type = o.type, coordinates;\n switch (type) {\n case \"GeometryCollection\": return {type: type, geometries: o.geometries.map(geometry)};\n case \"Point\": coordinates = point(o.coordinates); break;\n case \"MultiPoint\": coordinates = o.coordinates.map(point); break;\n case \"LineString\": coordinates = line(o.arcs); break;\n case \"MultiLineString\": coordinates = o.arcs.map(line); break;\n case \"Polygon\": coordinates = polygon(o.arcs); break;\n case \"MultiPolygon\": coordinates = o.arcs.map(polygon); break;\n default: return null;\n }\n return {type: type, coordinates: coordinates};\n }\n\n return geometry(o);\n}\n","import identity from \"./identity.js\";\n\nexport default function(transform) {\n if (transform == null) return identity;\n var x0,\n y0,\n kx = transform.scale[0],\n ky = transform.scale[1],\n dx = transform.translate[0],\n dy = transform.translate[1];\n return function(input, i) {\n if (!i) x0 = y0 = 0;\n var j = 2, n = input.length, output = new Array(n);\n output[0] = (x0 += input[0]) * kx + dx;\n output[1] = (y0 += input[1]) * ky + dy;\n while (j < n) output[j] = input[j], ++j;\n return output;\n };\n}\n","export default function(array, n) {\n var t, j = array.length, i = j - n;\n while (i < --j) t = array[i], array[i++] = array[j], array[j] = t;\n}\n","export default function(topology, arcs) {\n var stitchedArcs = {},\n fragmentByStart = {},\n fragmentByEnd = {},\n fragments = [],\n emptyIndex = -1;\n\n // Stitch empty arcs first, since they may be subsumed by other arcs.\n arcs.forEach(function(i, j) {\n var arc = topology.arcs[i < 0 ? ~i : i], t;\n if (arc.length < 3 && !arc[1][0] && !arc[1][1]) {\n t = arcs[++emptyIndex], arcs[emptyIndex] = i, arcs[j] = t;\n }\n });\n\n arcs.forEach(function(i) {\n var e = ends(i),\n start = e[0],\n end = e[1],\n f, g;\n\n if (f = fragmentByEnd[start]) {\n delete fragmentByEnd[f.end];\n f.push(i);\n f.end = end;\n if (g = fragmentByStart[end]) {\n delete fragmentByStart[g.start];\n var fg = g === f ? f : f.concat(g);\n fragmentByStart[fg.start = f.start] = fragmentByEnd[fg.end = g.end] = fg;\n } else {\n fragmentByStart[f.start] = fragmentByEnd[f.end] = f;\n }\n } else if (f = fragmentByStart[end]) {\n delete fragmentByStart[f.start];\n f.unshift(i);\n f.start = start;\n if (g = fragmentByEnd[start]) {\n delete fragmentByEnd[g.end];\n var gf = g === f ? f : g.concat(f);\n fragmentByStart[gf.start = g.start] = fragmentByEnd[gf.end = f.end] = gf;\n } else {\n fragmentByStart[f.start] = fragmentByEnd[f.end] = f;\n }\n } else {\n f = [i];\n fragmentByStart[f.start = start] = fragmentByEnd[f.end = end] = f;\n }\n });\n\n function ends(i) {\n var arc = topology.arcs[i < 0 ? ~i : i], p0 = arc[0], p1;\n if (topology.transform) p1 = [0, 0], arc.forEach(function(dp) { p1[0] += dp[0], p1[1] += dp[1]; });\n else p1 = arc[arc.length - 1];\n return i < 0 ? [p1, p0] : [p0, p1];\n }\n\n function flush(fragmentByEnd, fragmentByStart) {\n for (var k in fragmentByEnd) {\n var f = fragmentByEnd[k];\n delete fragmentByStart[f.start];\n delete f.start;\n delete f.end;\n f.forEach(function(i) { stitchedArcs[i < 0 ? ~i : i] = 1; });\n fragments.push(f);\n }\n }\n\n flush(fragmentByEnd, fragmentByStart);\n flush(fragmentByStart, fragmentByEnd);\n arcs.forEach(function(i) { if (!stitchedArcs[i < 0 ? ~i : i]) fragments.push([i]); });\n\n return fragments;\n}\n","import {object} from \"./feature.js\";\nimport stitch from \"./stitch.js\";\n\nexport default function(topology) {\n return object(topology, meshArcs.apply(this, arguments));\n}\n\nexport function meshArcs(topology, object, filter) {\n var arcs, i, n;\n if (arguments.length > 1) arcs = extractArcs(topology, object, filter);\n else for (i = 0, arcs = new Array(n = topology.arcs.length); i < n; ++i) arcs[i] = i;\n return {type: \"MultiLineString\", arcs: stitch(topology, arcs)};\n}\n\nfunction extractArcs(topology, object, filter) {\n var arcs = [],\n geomsByArc = [],\n geom;\n\n function extract0(i) {\n var j = i < 0 ? ~i : i;\n (geomsByArc[j] || (geomsByArc[j] = [])).push({i: i, g: geom});\n }\n\n function extract1(arcs) {\n arcs.forEach(extract0);\n }\n\n function extract2(arcs) {\n arcs.forEach(extract1);\n }\n\n function extract3(arcs) {\n arcs.forEach(extract2);\n }\n\n function geometry(o) {\n switch (geom = o, o.type) {\n case \"GeometryCollection\": o.geometries.forEach(geometry); break;\n case \"LineString\": extract1(o.arcs); break;\n case \"MultiLineString\": case \"Polygon\": extract2(o.arcs); break;\n case \"MultiPolygon\": extract3(o.arcs); break;\n }\n }\n\n geometry(object);\n\n geomsByArc.forEach(filter == null\n ? function(geoms) { arcs.push(geoms[0].i); }\n : function(geoms) { if (filter(geoms[0].g, geoms[geoms.length - 1].g)) arcs.push(geoms[0].i); });\n\n return arcs;\n}\n","const e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n const step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log10(step)),\n error = step / Math.pow(10, power),\n factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n let i1, i2, inc;\n if (power < 0) {\n inc = Math.pow(10, -power) / factor;\n i1 = Math.round(start * inc);\n i2 = Math.round(stop * inc);\n if (i1 / inc < start) ++i1;\n if (i2 / inc > stop) --i2;\n inc = -inc;\n } else {\n inc = Math.pow(10, power) * factor;\n i1 = Math.round(start / inc);\n i2 = Math.round(stop / inc);\n if (i1 * inc < start) ++i1;\n if (i2 * inc > stop) --i2;\n }\n if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n if (!(count > 0)) return [];\n if (start === stop) return [start];\n const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n if (!(i2 >= i1)) return [];\n const n = i2 - i1 + 1, ticks = new Array(n);\n if (reverse) {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n } else {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n }\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n","// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n","export default function(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n","import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": (x, p) => (x * 100).toFixed(p),\n \"b\": (x) => Math.round(x).toString(2),\n \"c\": (x) => x + \"\",\n \"d\": formatDecimal,\n \"e\": (x, p) => x.toExponential(p),\n \"f\": (x, p) => x.toFixed(p),\n \"g\": (x, p) => x.toPrecision(p),\n \"o\": (x) => Math.round(x).toString(8),\n \"p\": (x, p) => formatRounded(x * 100, p),\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n \"x\": (x) => Math.round(x).toString(16)\n};\n","export default function(x) {\n return x;\n}\n","import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"−\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n","export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n","export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n","// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n","const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = (date) => {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = (date) => {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = (date) => {\n const d0 = interval(date), d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = (date, step) => {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = (start, stop, step) => {\n const range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n let previous;\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = (test) => {\n return timeInterval((date) => {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, (date, step) => {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = (start, end) => {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = (step) => {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? (d) => field(d) % step === 0\n : (d) => interval.count(0, d) % step === 0);\n };\n }\n\n return interval;\n}\n","export const durationSecond = 1000;\nexport const durationMinute = durationSecond * 60;\nexport const durationHour = durationMinute * 60;\nexport const durationDay = durationHour * 24;\nexport const durationWeek = durationDay * 7;\nexport const durationMonth = durationDay * 30;\nexport const durationYear = durationDay * 365;\n","import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n return timeInterval((date) => {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setDate(date.getDate() + step * 7);\n }, (start, end) => {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n return timeInterval((date) => {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, (start, end) => {\n return (end - start) / durationWeek;\n });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n return end.getFullYear() - start.getFullYear();\n}, (date) => {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport const utcYears = utcYear.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n return (end - start) / durationSecond;\n}, (date) => {\n return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const millisecond = timeInterval(() => {\n // noop\n}, (date, step) => {\n date.setTime(+date + step);\n}, (start, end) => {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = (k) => {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return timeInterval((date) => {\n date.setTime(Math.floor(date / k) * k);\n }, (date, step) => {\n date.setTime(+date + step * k);\n }, (start, end) => {\n return (end - start) / k;\n });\n};\n\nexport const milliseconds = millisecond.range;\n","export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n","import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can’t do this\n // for a comparator (except for specific, known comparators) because we can’t\n // tell if the comparator is symmetric, and an asymmetric comparator can’t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n","import { array, error, hasOwnProperty, extend, peek, toSet, constant, zero, one, span } from 'vega-util';\nimport { timeDay, timeWeek, utcDay, utcWeek, timeYear, timeMonth, timeHour, timeMinute, timeSecond, timeMillisecond, utcYear, utcMonth, utcHour, utcMinute, utcSecond, utcMillisecond } from 'd3-time';\nimport { bisector, tickStep } from 'd3-array';\n\nconst YEAR = 'year';\nconst QUARTER = 'quarter';\nconst MONTH = 'month';\nconst WEEK = 'week';\nconst DATE = 'date';\nconst DAY = 'day';\nconst DAYOFYEAR = 'dayofyear';\nconst HOURS = 'hours';\nconst MINUTES = 'minutes';\nconst SECONDS = 'seconds';\nconst MILLISECONDS = 'milliseconds';\nconst TIME_UNITS = [YEAR, QUARTER, MONTH, WEEK, DATE, DAY, DAYOFYEAR, HOURS, MINUTES, SECONDS, MILLISECONDS];\nconst UNITS = TIME_UNITS.reduce((o, u, i) => (o[u] = 1 + i, o), {});\nfunction timeUnits(units) {\n const u = array(units).slice(),\n m = {};\n\n // check validity\n if (!u.length) error('Missing time unit.');\n u.forEach(unit => {\n if (hasOwnProperty(UNITS, unit)) {\n m[unit] = 1;\n } else {\n error(`Invalid time unit: ${unit}.`);\n }\n });\n const numTypes = (m[WEEK] || m[DAY] ? 1 : 0) + (m[QUARTER] || m[MONTH] || m[DATE] ? 1 : 0) + (m[DAYOFYEAR] ? 1 : 0);\n if (numTypes > 1) {\n error(`Incompatible time units: ${units}`);\n }\n\n // ensure proper sort order\n u.sort((a, b) => UNITS[a] - UNITS[b]);\n return u;\n}\nconst defaultSpecifiers = {\n [YEAR]: '%Y ',\n [QUARTER]: 'Q%q ',\n [MONTH]: '%b ',\n [DATE]: '%d ',\n [WEEK]: 'W%U ',\n [DAY]: '%a ',\n [DAYOFYEAR]: '%j ',\n [HOURS]: '%H:00',\n [MINUTES]: '00:%M',\n [SECONDS]: ':%S',\n [MILLISECONDS]: '.%L',\n [`${YEAR}-${MONTH}`]: '%Y-%m ',\n [`${YEAR}-${MONTH}-${DATE}`]: '%Y-%m-%d ',\n [`${HOURS}-${MINUTES}`]: '%H:%M'\n};\nfunction timeUnitSpecifier(units, specifiers) {\n const s = extend({}, defaultSpecifiers, specifiers),\n u = timeUnits(units),\n n = u.length;\n let fmt = '',\n start = 0,\n end,\n key;\n for (start = 0; start < n;) {\n for (end = u.length; end > start; --end) {\n key = u.slice(start, end).join('-');\n if (s[key] != null) {\n fmt += s[key];\n start = end;\n break;\n }\n }\n }\n return fmt.trim();\n}\n\nconst t0 = new Date();\nfunction localYear(y) {\n t0.setFullYear(y);\n t0.setMonth(0);\n t0.setDate(1);\n t0.setHours(0, 0, 0, 0);\n return t0;\n}\nfunction dayofyear(d) {\n return localDayOfYear(new Date(d));\n}\nfunction week(d) {\n return localWeekNum(new Date(d));\n}\nfunction localDayOfYear(d) {\n return timeDay.count(localYear(d.getFullYear()) - 1, d);\n}\nfunction localWeekNum(d) {\n return timeWeek.count(localYear(d.getFullYear()) - 1, d);\n}\nfunction localFirst(y) {\n return localYear(y).getDay();\n}\nfunction localDate(y, m, d, H, M, S, L) {\n if (0 <= y && y < 100) {\n const date = new Date(-1, m, d, H, M, S, L);\n date.setFullYear(y);\n return date;\n }\n return new Date(y, m, d, H, M, S, L);\n}\nfunction utcdayofyear(d) {\n return utcDayOfYear(new Date(d));\n}\nfunction utcweek(d) {\n return utcWeekNum(new Date(d));\n}\nfunction utcDayOfYear(d) {\n const y = Date.UTC(d.getUTCFullYear(), 0, 1);\n return utcDay.count(y - 1, d);\n}\nfunction utcWeekNum(d) {\n const y = Date.UTC(d.getUTCFullYear(), 0, 1);\n return utcWeek.count(y - 1, d);\n}\nfunction utcFirst(y) {\n t0.setTime(Date.UTC(y, 0, 1));\n return t0.getUTCDay();\n}\nfunction utcDate(y, m, d, H, M, S, L) {\n if (0 <= y && y < 100) {\n const date = new Date(Date.UTC(-1, m, d, H, M, S, L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(y, m, d, H, M, S, L));\n}\n\nfunction floor(units, step, get, inv, newDate) {\n const s = step || 1,\n b = peek(units),\n _ = (unit, p, key) => {\n key = key || unit;\n return getUnit(get[key], inv[key], unit === b && s, p);\n };\n const t = new Date(),\n u = toSet(units),\n y = u[YEAR] ? _(YEAR) : constant(2012),\n m = u[MONTH] ? _(MONTH) : u[QUARTER] ? _(QUARTER) : zero,\n d = u[WEEK] && u[DAY] ? _(DAY, 1, WEEK + DAY) : u[WEEK] ? _(WEEK, 1) : u[DAY] ? _(DAY, 1) : u[DATE] ? _(DATE, 1) : u[DAYOFYEAR] ? _(DAYOFYEAR, 1) : one,\n H = u[HOURS] ? _(HOURS) : zero,\n M = u[MINUTES] ? _(MINUTES) : zero,\n S = u[SECONDS] ? _(SECONDS) : zero,\n L = u[MILLISECONDS] ? _(MILLISECONDS) : zero;\n return function (v) {\n t.setTime(+v);\n const year = y(t);\n return newDate(year, m(t), d(t, year), H(t), M(t), S(t), L(t));\n };\n}\nfunction getUnit(f, inv, step, phase) {\n const u = step <= 1 ? f : phase ? (d, y) => phase + step * Math.floor((f(d, y) - phase) / step) : (d, y) => step * Math.floor(f(d, y) / step);\n return inv ? (d, y) => inv(u(d, y), y) : u;\n}\n\n// returns the day of the year based on week number, day of week,\n// and the day of the week for the first day of the year\nfunction weekday(week, day, firstDay) {\n return day + week * 7 - (firstDay + 6) % 7;\n}\n\n// -- LOCAL TIME --\n\nconst localGet = {\n [YEAR]: d => d.getFullYear(),\n [QUARTER]: d => Math.floor(d.getMonth() / 3),\n [MONTH]: d => d.getMonth(),\n [DATE]: d => d.getDate(),\n [HOURS]: d => d.getHours(),\n [MINUTES]: d => d.getMinutes(),\n [SECONDS]: d => d.getSeconds(),\n [MILLISECONDS]: d => d.getMilliseconds(),\n [DAYOFYEAR]: d => localDayOfYear(d),\n [WEEK]: d => localWeekNum(d),\n [WEEK + DAY]: (d, y) => weekday(localWeekNum(d), d.getDay(), localFirst(y)),\n [DAY]: (d, y) => weekday(1, d.getDay(), localFirst(y))\n};\nconst localInv = {\n [QUARTER]: q => 3 * q,\n [WEEK]: (w, y) => weekday(w, 0, localFirst(y))\n};\nfunction timeFloor(units, step) {\n return floor(units, step || 1, localGet, localInv, localDate);\n}\n\n// -- UTC TIME --\n\nconst utcGet = {\n [YEAR]: d => d.getUTCFullYear(),\n [QUARTER]: d => Math.floor(d.getUTCMonth() / 3),\n [MONTH]: d => d.getUTCMonth(),\n [DATE]: d => d.getUTCDate(),\n [HOURS]: d => d.getUTCHours(),\n [MINUTES]: d => d.getUTCMinutes(),\n [SECONDS]: d => d.getUTCSeconds(),\n [MILLISECONDS]: d => d.getUTCMilliseconds(),\n [DAYOFYEAR]: d => utcDayOfYear(d),\n [WEEK]: d => utcWeekNum(d),\n [DAY]: (d, y) => weekday(1, d.getUTCDay(), utcFirst(y)),\n [WEEK + DAY]: (d, y) => weekday(utcWeekNum(d), d.getUTCDay(), utcFirst(y))\n};\nconst utcInv = {\n [QUARTER]: q => 3 * q,\n [WEEK]: (w, y) => weekday(w, 0, utcFirst(y))\n};\nfunction utcFloor(units, step) {\n return floor(units, step || 1, utcGet, utcInv, utcDate);\n}\n\nconst timeIntervals = {\n [YEAR]: timeYear,\n [QUARTER]: timeMonth.every(3),\n [MONTH]: timeMonth,\n [WEEK]: timeWeek,\n [DATE]: timeDay,\n [DAY]: timeDay,\n [DAYOFYEAR]: timeDay,\n [HOURS]: timeHour,\n [MINUTES]: timeMinute,\n [SECONDS]: timeSecond,\n [MILLISECONDS]: timeMillisecond\n};\nconst utcIntervals = {\n [YEAR]: utcYear,\n [QUARTER]: utcMonth.every(3),\n [MONTH]: utcMonth,\n [WEEK]: utcWeek,\n [DATE]: utcDay,\n [DAY]: utcDay,\n [DAYOFYEAR]: utcDay,\n [HOURS]: utcHour,\n [MINUTES]: utcMinute,\n [SECONDS]: utcSecond,\n [MILLISECONDS]: utcMillisecond\n};\nfunction timeInterval(unit) {\n return timeIntervals[unit];\n}\nfunction utcInterval(unit) {\n return utcIntervals[unit];\n}\nfunction offset(ival, date, step) {\n return ival ? ival.offset(date, step) : undefined;\n}\nfunction timeOffset(unit, date, step) {\n return offset(timeInterval(unit), date, step);\n}\nfunction utcOffset(unit, date, step) {\n return offset(utcInterval(unit), date, step);\n}\nfunction sequence(ival, start, stop, step) {\n return ival ? ival.range(start, stop, step) : undefined;\n}\nfunction timeSequence(unit, start, stop, step) {\n return sequence(timeInterval(unit), start, stop, step);\n}\nfunction utcSequence(unit, start, stop, step) {\n return sequence(utcInterval(unit), start, stop, step);\n}\n\nconst durationSecond = 1000,\n durationMinute = durationSecond * 60,\n durationHour = durationMinute * 60,\n durationDay = durationHour * 24,\n durationWeek = durationDay * 7,\n durationMonth = durationDay * 30,\n durationYear = durationDay * 365;\nconst Milli = [YEAR, MONTH, DATE, HOURS, MINUTES, SECONDS, MILLISECONDS],\n Seconds = Milli.slice(0, -1),\n Minutes = Seconds.slice(0, -1),\n Hours = Minutes.slice(0, -1),\n Day = Hours.slice(0, -1),\n Week = [YEAR, WEEK],\n Month = [YEAR, MONTH],\n Year = [YEAR];\nconst intervals = [[Seconds, 1, durationSecond], [Seconds, 5, 5 * durationSecond], [Seconds, 15, 15 * durationSecond], [Seconds, 30, 30 * durationSecond], [Minutes, 1, durationMinute], [Minutes, 5, 5 * durationMinute], [Minutes, 15, 15 * durationMinute], [Minutes, 30, 30 * durationMinute], [Hours, 1, durationHour], [Hours, 3, 3 * durationHour], [Hours, 6, 6 * durationHour], [Hours, 12, 12 * durationHour], [Day, 1, durationDay], [Week, 1, durationWeek], [Month, 1, durationMonth], [Month, 3, 3 * durationMonth], [Year, 1, durationYear]];\nfunction bin (opt) {\n const ext = opt.extent,\n max = opt.maxbins || 40,\n target = Math.abs(span(ext)) / max;\n let i = bisector(i => i[2]).right(intervals, target),\n units,\n step;\n if (i === intervals.length) {\n units = Year, step = tickStep(ext[0] / durationYear, ext[1] / durationYear, max);\n } else if (i) {\n i = intervals[target / intervals[i - 1][2] < intervals[i][2] / target ? i - 1 : i];\n units = i[0];\n step = i[1];\n } else {\n units = Milli;\n step = Math.max(tickStep(ext[0], ext[1], max), 1);\n }\n return {\n units,\n step\n };\n}\n\nexport { DATE, DAY, DAYOFYEAR, HOURS, MILLISECONDS, MINUTES, MONTH, QUARTER, SECONDS, TIME_UNITS, WEEK, YEAR, dayofyear, bin as timeBin, timeFloor, timeInterval, timeOffset, timeSequence, timeUnitSpecifier, timeUnits, utcFloor, utcInterval, utcOffset, utcSequence, utcdayofyear, utcweek, week };\n","import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n return new Map(names.map((name, i) => [name.toLowerCase(), i]));\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n","import { tickStep } from 'd3-array';\nimport { formatSpecifier, precisionFixed, precisionRound, precisionPrefix, format, formatPrefix, formatLocale } from 'd3-format';\nimport { SECONDS, MINUTES, HOURS, DATE, WEEK, MONTH, QUARTER, YEAR, MILLISECONDS, DAY, timeInterval, utcInterval } from 'vega-time';\nimport { isString, isObject, error, extend } from 'vega-util';\nimport { timeFormat, timeParse, utcFormat, utcParse, timeFormatLocale as timeFormatLocale$1 } from 'd3-time-format';\n\nfunction memoize (method) {\n const cache = {};\n return spec => cache[spec] || (cache[spec] = method(spec));\n}\n\nfunction trimZeroes(numberFormat, decimalChar) {\n return x => {\n const str = numberFormat(x),\n dec = str.indexOf(decimalChar);\n if (dec < 0) return str;\n let idx = rightmostDigit(str, dec);\n const end = idx < str.length ? str.slice(idx) : '';\n while (--idx > dec) if (str[idx] !== '0') {\n ++idx;\n break;\n }\n return str.slice(0, idx) + end;\n };\n}\nfunction rightmostDigit(str, dec) {\n let i = str.lastIndexOf('e'),\n c;\n if (i > 0) return i;\n for (i = str.length; --i > dec;) {\n c = str.charCodeAt(i);\n if (c >= 48 && c <= 57) return i + 1; // is digit\n }\n}\n\nfunction numberLocale(locale) {\n const format = memoize(locale.format),\n formatPrefix = locale.formatPrefix;\n return {\n format,\n formatPrefix,\n formatFloat(spec) {\n const s = formatSpecifier(spec || ',');\n if (s.precision == null) {\n s.precision = 12;\n switch (s.type) {\n case '%':\n s.precision -= 2;\n break;\n case 'e':\n s.precision -= 1;\n break;\n }\n return trimZeroes(format(s),\n // number format\n format('.1f')(1)[1] // decimal point character\n );\n } else {\n return format(s);\n }\n },\n formatSpan(start, stop, count, specifier) {\n specifier = formatSpecifier(specifier == null ? ',f' : specifier);\n const step = tickStep(start, stop, count),\n value = Math.max(Math.abs(start), Math.abs(stop));\n let precision;\n if (specifier.precision == null) {\n switch (specifier.type) {\n case 's':\n {\n if (!isNaN(precision = precisionPrefix(step, value))) {\n specifier.precision = precision;\n }\n return formatPrefix(specifier, value);\n }\n case '':\n case 'e':\n case 'g':\n case 'p':\n case 'r':\n {\n if (!isNaN(precision = precisionRound(step, value))) {\n specifier.precision = precision - (specifier.type === 'e');\n }\n break;\n }\n case 'f':\n case '%':\n {\n if (!isNaN(precision = precisionFixed(step))) {\n specifier.precision = precision - (specifier.type === '%') * 2;\n }\n break;\n }\n }\n }\n return format(specifier);\n }\n };\n}\nlet defaultNumberLocale;\nresetNumberFormatDefaultLocale();\nfunction resetNumberFormatDefaultLocale() {\n return defaultNumberLocale = numberLocale({\n format: format,\n formatPrefix: formatPrefix\n });\n}\nfunction numberFormatLocale(definition) {\n return numberLocale(formatLocale(definition));\n}\nfunction numberFormatDefaultLocale(definition) {\n return arguments.length ? defaultNumberLocale = numberFormatLocale(definition) : defaultNumberLocale;\n}\n\nfunction timeMultiFormat(format, interval, spec) {\n spec = spec || {};\n if (!isObject(spec)) {\n error(`Invalid time multi-format specifier: ${spec}`);\n }\n const second = interval(SECONDS),\n minute = interval(MINUTES),\n hour = interval(HOURS),\n day = interval(DATE),\n week = interval(WEEK),\n month = interval(MONTH),\n quarter = interval(QUARTER),\n year = interval(YEAR),\n L = format(spec[MILLISECONDS] || '.%L'),\n S = format(spec[SECONDS] || ':%S'),\n M = format(spec[MINUTES] || '%I:%M'),\n H = format(spec[HOURS] || '%I %p'),\n d = format(spec[DATE] || spec[DAY] || '%a %d'),\n w = format(spec[WEEK] || '%b %d'),\n m = format(spec[MONTH] || '%B'),\n q = format(spec[QUARTER] || '%B'),\n y = format(spec[YEAR] || '%Y');\n return date => (second(date) < date ? L : minute(date) < date ? S : hour(date) < date ? M : day(date) < date ? H : month(date) < date ? week(date) < date ? d : w : year(date) < date ? quarter(date) < date ? m : q : y)(date);\n}\nfunction timeLocale(locale) {\n const timeFormat = memoize(locale.format),\n utcFormat = memoize(locale.utcFormat);\n return {\n timeFormat: spec => isString(spec) ? timeFormat(spec) : timeMultiFormat(timeFormat, timeInterval, spec),\n utcFormat: spec => isString(spec) ? utcFormat(spec) : timeMultiFormat(utcFormat, utcInterval, spec),\n timeParse: memoize(locale.parse),\n utcParse: memoize(locale.utcParse)\n };\n}\nlet defaultTimeLocale;\nresetTimeFormatDefaultLocale();\nfunction resetTimeFormatDefaultLocale() {\n return defaultTimeLocale = timeLocale({\n format: timeFormat,\n parse: timeParse,\n utcFormat: utcFormat,\n utcParse: utcParse\n });\n}\nfunction timeFormatLocale(definition) {\n return timeLocale(timeFormatLocale$1(definition));\n}\nfunction timeFormatDefaultLocale(definition) {\n return arguments.length ? defaultTimeLocale = timeFormatLocale(definition) : defaultTimeLocale;\n}\n\nconst createLocale = (number, time) => extend({}, number, time);\nfunction locale(numberSpec, timeSpec) {\n const number = numberSpec ? numberFormatLocale(numberSpec) : numberFormatDefaultLocale();\n const time = timeSpec ? timeFormatLocale(timeSpec) : timeFormatDefaultLocale();\n return createLocale(number, time);\n}\nfunction defaultLocale(numberSpec, timeSpec) {\n const args = arguments.length;\n if (args && args !== 2) {\n error('defaultLocale expects either zero or two arguments.');\n }\n return args ? createLocale(numberFormatDefaultLocale(numberSpec), timeFormatDefaultLocale(timeSpec)) : createLocale(numberFormatDefaultLocale(), timeFormatDefaultLocale());\n}\nfunction resetDefaultLocale() {\n resetNumberFormatDefaultLocale();\n resetTimeFormatDefaultLocale();\n return defaultLocale();\n}\n\nexport { defaultLocale, locale, numberFormatDefaultLocale, numberFormatLocale, resetDefaultLocale, resetNumberFormatDefaultLocale, resetTimeFormatDefaultLocale, timeFormatDefaultLocale, timeFormatLocale };\n","import { extend, error, stringValue, isFunction, toBoolean, toNumber, toDate, toString, identity, field, isObject, isArray, isIterable, hasOwnProperty } from 'vega-util';\nimport { dsvFormat } from 'd3-dsv';\nimport { feature, mesh } from 'topojson-client';\nimport { timeFormatDefaultLocale } from 'vega-format';\n\n// Matches absolute URLs with optional protocol\n// https://... file://... //...\nconst protocol_re = /^(data:|([A-Za-z]+:)?\\/\\/)/;\n\n// Matches allowed URIs. From https://github.com/cure53/DOMPurify/blob/master/src/regexp.js with added file://\nconst allowed_re = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i; // eslint-disable-line no-useless-escape\nconst whitespace_re = /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205f\\u3000]/g; // eslint-disable-line no-control-regex\n\n// Special treatment in node.js for the file: protocol\nconst fileProtocol = 'file://';\n\n/**\n * Factory for a loader constructor that provides methods for requesting\n * files from either the network or disk, and for sanitizing request URIs.\n * @param {function} fetch - The Fetch API for HTTP network requests.\n * If null or undefined, HTTP loading will be disabled.\n * @param {object} fs - The file system interface for file loading.\n * If null or undefined, local file loading will be disabled.\n * @return {function} A loader constructor with the following signature:\n * param {object} [options] - Optional default loading options to use.\n * return {object} - A new loader instance.\n */\nfunction loaderFactory (fetch, fs) {\n return options => ({\n options: options || {},\n sanitize: sanitize,\n load: load,\n fileAccess: !!fs,\n file: fileLoader(fs),\n http: httpLoader(fetch)\n });\n}\n\n/**\n * Load an external resource, typically either from the web or from the local\n * filesystem. This function uses {@link sanitize} to first sanitize the uri,\n * then calls either {@link http} (for web requests) or {@link file} (for\n * filesystem loading).\n * @param {string} uri - The resource indicator (e.g., URL or filename).\n * @param {object} [options] - Optional loading options. These options will\n * override any existing default options.\n * @return {Promise} - A promise that resolves to the loaded content.\n */\nasync function load(uri, options) {\n const opt = await this.sanitize(uri, options),\n url = opt.href;\n return opt.localFile ? this.file(url) : this.http(url, options);\n}\n\n/**\n * URI sanitizer function.\n * @param {string} uri - The uri (url or filename) to check.\n * @param {object} options - An options hash.\n * @return {Promise} - A promise that resolves to an object containing\n * sanitized uri data, or rejects it the input uri is deemed invalid.\n * The properties of the resolved object are assumed to be\n * valid attributes for an HTML 'a' tag. The sanitized uri *must* be\n * provided by the 'href' property of the returned object.\n */\nasync function sanitize(uri, options) {\n options = extend({}, this.options, options);\n const fileAccess = this.fileAccess,\n result = {\n href: null\n };\n let isFile, loadFile, base;\n const isAllowed = allowed_re.test(uri.replace(whitespace_re, ''));\n if (uri == null || typeof uri !== 'string' || !isAllowed) {\n error('Sanitize failure, invalid URI: ' + stringValue(uri));\n }\n const hasProtocol = protocol_re.test(uri);\n\n // if relative url (no protocol/host), prepend baseURL\n if ((base = options.baseURL) && !hasProtocol) {\n // Ensure that there is a slash between the baseURL (e.g. hostname) and url\n if (!uri.startsWith('/') && !base.endsWith('/')) {\n uri = '/' + uri;\n }\n uri = base + uri;\n }\n\n // should we load from file system?\n loadFile = (isFile = uri.startsWith(fileProtocol)) || options.mode === 'file' || options.mode !== 'http' && !hasProtocol && fileAccess;\n if (isFile) {\n // strip file protocol\n uri = uri.slice(fileProtocol.length);\n } else if (uri.startsWith('//')) {\n if (options.defaultProtocol === 'file') {\n // if is file, strip protocol and set loadFile flag\n uri = uri.slice(2);\n loadFile = true;\n } else {\n // if relative protocol (starts with '//'), prepend default protocol\n uri = (options.defaultProtocol || 'http') + ':' + uri;\n }\n }\n\n // set non-enumerable mode flag to indicate local file load\n Object.defineProperty(result, 'localFile', {\n value: !!loadFile\n });\n\n // set uri\n result.href = uri;\n\n // set default result target, if specified\n if (options.target) {\n result.target = options.target + '';\n }\n\n // set default result rel, if specified (#1542)\n if (options.rel) {\n result.rel = options.rel + '';\n }\n\n // provide control over cross-origin image handling (#2238)\n // https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image\n if (options.context === 'image' && options.crossOrigin) {\n result.crossOrigin = options.crossOrigin + '';\n }\n\n // return\n return result;\n}\n\n/**\n * File system loader factory.\n * @param {object} fs - The file system interface.\n * @return {function} - A file loader with the following signature:\n * param {string} filename - The file system path to load.\n * param {string} filename - The file system path to load.\n * return {Promise} A promise that resolves to the file contents.\n */\nfunction fileLoader(fs) {\n return fs ? filename => new Promise((accept, reject) => {\n fs.readFile(filename, (error, data) => {\n if (error) reject(error);else accept(data);\n });\n }) : fileReject;\n}\n\n/**\n * Default file system loader that simply rejects.\n */\nasync function fileReject() {\n error('No file system access.');\n}\n\n/**\n * HTTP request handler factory.\n * @param {function} fetch - The Fetch API method.\n * @return {function} - An http loader with the following signature:\n * param {string} url - The url to request.\n * param {object} options - An options hash.\n * return {Promise} - A promise that resolves to the file contents.\n */\nfunction httpLoader(fetch) {\n return fetch ? async function (url, options) {\n const opt = extend({}, this.options.http, options),\n type = options && options.response,\n response = await fetch(url, opt);\n return !response.ok ? error(response.status + '' + response.statusText) : isFunction(response[type]) ? response[type]() : response.text();\n } : httpReject;\n}\n\n/**\n * Default http request handler that simply rejects.\n */\nasync function httpReject() {\n error('No HTTP fetch method available.');\n}\n\nconst isValid = _ => _ != null && _ === _;\nconst isBoolean = _ => _ === 'true' || _ === 'false' || _ === true || _ === false;\nconst isDate = _ => !Number.isNaN(Date.parse(_));\nconst isNumber = _ => !Number.isNaN(+_) && !(_ instanceof Date);\nconst isInteger = _ => isNumber(_) && Number.isInteger(+_);\nconst typeParsers = {\n boolean: toBoolean,\n integer: toNumber,\n number: toNumber,\n date: toDate,\n string: toString,\n unknown: identity\n};\nconst typeTests = [isBoolean, isInteger, isNumber, isDate];\nconst typeList = ['boolean', 'integer', 'number', 'date'];\nfunction inferType(values, field) {\n if (!values || !values.length) return 'unknown';\n const n = values.length,\n m = typeTests.length,\n a = typeTests.map((_, i) => i + 1);\n for (let i = 0, t = 0, j, value; i < n; ++i) {\n value = field ? values[i][field] : values[i];\n for (j = 0; j < m; ++j) {\n if (a[j] && isValid(value) && !typeTests[j](value)) {\n a[j] = 0;\n ++t;\n if (t === typeTests.length) return 'string';\n }\n }\n }\n return typeList[a.reduce((u, v) => u === 0 ? v : u, 0) - 1];\n}\nfunction inferTypes(data, fields) {\n return fields.reduce((types, field) => {\n types[field] = inferType(data, field);\n return types;\n }, {});\n}\n\nfunction delimitedFormat(delimiter) {\n const parse = function (data, format) {\n const delim = {\n delimiter: delimiter\n };\n return dsv(data, format ? extend(format, delim) : delim);\n };\n parse.responseType = 'text';\n return parse;\n}\nfunction dsv(data, format) {\n if (format.header) {\n data = format.header.map(stringValue).join(format.delimiter) + '\\n' + data;\n }\n return dsvFormat(format.delimiter).parse(data + '');\n}\ndsv.responseType = 'text';\n\nfunction isBuffer(_) {\n return typeof Buffer === 'function' && isFunction(Buffer.isBuffer) ? Buffer.isBuffer(_) : false;\n}\nfunction json(data, format) {\n const prop = format && format.property ? field(format.property) : identity;\n return isObject(data) && !isBuffer(data) ? parseJSON(prop(data), format) : prop(JSON.parse(data));\n}\njson.responseType = 'json';\nfunction parseJSON(data, format) {\n if (!isArray(data) && isIterable(data)) {\n data = [...data];\n }\n return format && format.copy ? JSON.parse(JSON.stringify(data)) : data;\n}\n\nconst filters = {\n interior: (a, b) => a !== b,\n exterior: (a, b) => a === b\n};\nfunction topojson(data, format) {\n let method, object, property, filter;\n data = json(data, format);\n if (format && format.feature) {\n method = feature;\n property = format.feature;\n } else if (format && format.mesh) {\n method = mesh;\n property = format.mesh;\n filter = filters[format.filter];\n } else {\n error('Missing TopoJSON feature or mesh parameter.');\n }\n object = (object = data.objects[property]) ? method(data, object, filter) : error('Invalid TopoJSON object: ' + property);\n return object && object.features || [object];\n}\ntopojson.responseType = 'json';\n\nconst format = {\n dsv: dsv,\n csv: delimitedFormat(','),\n tsv: delimitedFormat('\\t'),\n json: json,\n topojson: topojson\n};\nfunction formats(name, reader) {\n if (arguments.length > 1) {\n format[name] = reader;\n return this;\n } else {\n return hasOwnProperty(format, name) ? format[name] : null;\n }\n}\nfunction responseType(type) {\n const f = formats(type);\n return f && f.responseType || 'text';\n}\n\nfunction read (data, schema, timeParser, utcParser) {\n schema = schema || {};\n const reader = formats(schema.type || 'json');\n if (!reader) error('Unknown data format type: ' + schema.type);\n data = reader(data, schema);\n if (schema.parse) parse(data, schema.parse, timeParser, utcParser);\n if (hasOwnProperty(data, 'columns')) delete data.columns;\n return data;\n}\nfunction parse(data, types, timeParser, utcParser) {\n if (!data.length) return; // early exit for empty data\n\n const locale = timeFormatDefaultLocale();\n timeParser = timeParser || locale.timeParse;\n utcParser = utcParser || locale.utcParse;\n let fields = data.columns || Object.keys(data[0]),\n datum,\n field,\n i,\n j,\n n,\n m;\n if (types === 'auto') types = inferTypes(data, fields);\n fields = Object.keys(types);\n const parsers = fields.map(field => {\n const type = types[field];\n let parts, pattern;\n if (type && (type.startsWith('date:') || type.startsWith('utc:'))) {\n parts = type.split(/:(.+)?/, 2); // split on first :\n pattern = parts[1];\n if (pattern[0] === '\\'' && pattern[pattern.length - 1] === '\\'' || pattern[0] === '\"' && pattern[pattern.length - 1] === '\"') {\n pattern = pattern.slice(1, -1);\n }\n const parse = parts[0] === 'utc' ? utcParser : timeParser;\n return parse(pattern);\n }\n if (!typeParsers[type]) {\n throw Error('Illegal format pattern: ' + field + ':' + type);\n }\n return typeParsers[type];\n });\n for (i = 0, n = data.length, m = fields.length; i < n; ++i) {\n datum = data[i];\n for (j = 0; j < m; ++j) {\n field = fields[j];\n datum[field] = parsers[j](datum[field]);\n }\n }\n}\n\nconst loader = loaderFactory(typeof fetch !== 'undefined' && fetch,\n// use built-in fetch API\nnull // no file system access\n);\n\nexport { format, formats, inferType, inferTypes, loader, read, responseType, typeParsers };\n","import { identity, array, isFunction, constant, isArray, id, error, truthy, debounce, extend, visitArray, inherits, logger, Error, hasOwnProperty } from 'vega-util';\nimport { read, responseType, loader } from 'vega-loader';\nimport { defaultLocale } from 'vega-format';\n\nfunction UniqueList(idFunc) {\n const $ = idFunc || identity,\n list = [],\n ids = {};\n list.add = _ => {\n const id = $(_);\n if (!ids[id]) {\n ids[id] = 1;\n list.push(_);\n }\n return list;\n };\n list.remove = _ => {\n const id = $(_);\n if (ids[id]) {\n ids[id] = 0;\n const idx = list.indexOf(_);\n if (idx >= 0) list.splice(idx, 1);\n }\n return list;\n };\n return list;\n}\n\n/**\n * Invoke and await a potentially async callback function. If\n * an error occurs, trap it and route to Dataflow.error.\n * @param {Dataflow} df - The dataflow instance\n * @param {function} callback - A callback function to invoke\n * and then await. The dataflow will be passed as the single\n * argument to the function.\n */\nasync function asyncCallback (df, callback) {\n try {\n await callback(df);\n } catch (err) {\n df.error(err);\n }\n}\n\nconst TUPLE_ID_KEY = Symbol('vega_id');\nlet TUPLE_ID = 1;\n\n/**\n * Checks if an input value is a registered tuple.\n * @param {*} t - The value to check.\n * @return {boolean} True if the input is a tuple, false otherwise.\n */\nfunction isTuple(t) {\n return !!(t && tupleid(t));\n}\n\n/**\n * Returns the id of a tuple.\n * @param {object} t - The input tuple.\n * @return {*} the tuple id.\n */\nfunction tupleid(t) {\n return t[TUPLE_ID_KEY];\n}\n\n/**\n * Sets the id of a tuple.\n * @param {object} t - The input tuple.\n * @param {*} id - The id value to set.\n * @return {object} the input tuple.\n */\nfunction setid(t, id) {\n t[TUPLE_ID_KEY] = id;\n return t;\n}\n\n/**\n * Ingest an object or value as a data tuple.\n * If the input value is an object, an id field will be added to it. For\n * efficiency, the input object is modified directly. A copy is not made.\n * If the input value is a literal, it will be wrapped in a new object\n * instance, with the value accessible as the 'data' property.\n * @param datum - The value to ingest.\n * @return {object} The ingested data tuple.\n */\nfunction ingest$1(datum) {\n const t = datum === Object(datum) ? datum : {\n data: datum\n };\n return tupleid(t) ? t : setid(t, TUPLE_ID++);\n}\n\n/**\n * Given a source tuple, return a derived copy.\n * @param {object} t - The source tuple.\n * @return {object} The derived tuple.\n */\nfunction derive(t) {\n return rederive(t, ingest$1({}));\n}\n\n/**\n * Rederive a derived tuple by copying values from the source tuple.\n * @param {object} t - The source tuple.\n * @param {object} d - The derived tuple.\n * @return {object} The derived tuple.\n */\nfunction rederive(t, d) {\n for (const k in t) d[k] = t[k];\n return d;\n}\n\n/**\n * Replace an existing tuple with a new tuple.\n * @param {object} t - The existing data tuple.\n * @param {object} d - The new tuple that replaces the old.\n * @return {object} The new tuple.\n */\nfunction replace(t, d) {\n return setid(d, tupleid(t));\n}\n\n/**\n * Generate an augmented comparator function that provides stable\n * sorting by tuple id when the given comparator produces ties.\n * @param {function} cmp - The comparator to augment.\n * @param {function} [f] - Optional tuple accessor function.\n * @return {function} An augmented comparator function.\n */\nfunction stableCompare(cmp, f) {\n return !cmp ? null : f ? (a, b) => cmp(a, b) || tupleid(f(a)) - tupleid(f(b)) : (a, b) => cmp(a, b) || tupleid(a) - tupleid(b);\n}\n\nfunction isChangeSet(v) {\n return v && v.constructor === changeset;\n}\nfunction changeset() {\n const add = [],\n // insert tuples\n rem = [],\n // remove tuples\n mod = [],\n // modify tuples\n remp = [],\n // remove by predicate\n modp = []; // modify by predicate\n let clean = null,\n reflow = false;\n return {\n constructor: changeset,\n insert(t) {\n const d = array(t),\n n = d.length;\n for (let i = 0; i < n; ++i) add.push(d[i]);\n return this;\n },\n remove(t) {\n const a = isFunction(t) ? remp : rem,\n d = array(t),\n n = d.length;\n for (let i = 0; i < n; ++i) a.push(d[i]);\n return this;\n },\n modify(t, field, value) {\n const m = {\n field: field,\n value: constant(value)\n };\n if (isFunction(t)) {\n m.filter = t;\n modp.push(m);\n } else {\n m.tuple = t;\n mod.push(m);\n }\n return this;\n },\n encode(t, set) {\n if (isFunction(t)) modp.push({\n filter: t,\n field: set\n });else mod.push({\n tuple: t,\n field: set\n });\n return this;\n },\n clean(value) {\n clean = value;\n return this;\n },\n reflow() {\n reflow = true;\n return this;\n },\n pulse(pulse, tuples) {\n const cur = {},\n out = {};\n let i, n, m, f, t, id;\n\n // build lookup table of current tuples\n for (i = 0, n = tuples.length; i < n; ++i) {\n cur[tupleid(tuples[i])] = 1;\n }\n\n // process individual tuples to remove\n for (i = 0, n = rem.length; i < n; ++i) {\n t = rem[i];\n cur[tupleid(t)] = -1;\n }\n\n // process predicate-based removals\n for (i = 0, n = remp.length; i < n; ++i) {\n f = remp[i];\n tuples.forEach(t => {\n if (f(t)) cur[tupleid(t)] = -1;\n });\n }\n\n // process all add tuples\n for (i = 0, n = add.length; i < n; ++i) {\n t = add[i];\n id = tupleid(t);\n if (cur[id]) {\n // tuple already resides in dataset\n // if flagged for both add and remove, cancel\n cur[id] = 1;\n } else {\n // tuple does not reside in dataset, add\n pulse.add.push(ingest$1(add[i]));\n }\n }\n\n // populate pulse rem list\n for (i = 0, n = tuples.length; i < n; ++i) {\n t = tuples[i];\n if (cur[tupleid(t)] < 0) pulse.rem.push(t);\n }\n\n // modify helper method\n function modify(t, f, v) {\n if (v) {\n t[f] = v(t);\n } else {\n pulse.encode = f;\n }\n if (!reflow) out[tupleid(t)] = t;\n }\n\n // process individual tuples to modify\n for (i = 0, n = mod.length; i < n; ++i) {\n m = mod[i];\n t = m.tuple;\n f = m.field;\n id = cur[tupleid(t)];\n if (id > 0) {\n modify(t, f, m.value);\n pulse.modifies(f);\n }\n }\n\n // process predicate-based modifications\n for (i = 0, n = modp.length; i < n; ++i) {\n m = modp[i];\n f = m.filter;\n tuples.forEach(t => {\n if (f(t) && cur[tupleid(t)] > 0) {\n modify(t, m.field, m.value);\n }\n });\n pulse.modifies(m.field);\n }\n\n // upon reflow request, populate mod with all non-removed tuples\n // otherwise, populate mod with modified tuples only\n if (reflow) {\n pulse.mod = rem.length || remp.length ? tuples.filter(t => cur[tupleid(t)] > 0) : tuples.slice();\n } else {\n for (id in out) pulse.mod.push(out[id]);\n }\n\n // set pulse garbage collection request\n if (clean || clean == null && (rem.length || remp.length)) {\n pulse.clean(true);\n }\n return pulse;\n }\n };\n}\n\nconst CACHE = '_:mod:_';\n\n/**\n * Hash that tracks modifications to assigned values.\n * Callers *must* use the set method to update values.\n */\nfunction Parameters() {\n Object.defineProperty(this, CACHE, {\n writable: true,\n value: {}\n });\n}\nParameters.prototype = {\n /**\n * Set a parameter value. If the parameter value changes, the parameter\n * will be recorded as modified.\n * @param {string} name - The parameter name.\n * @param {number} index - The index into an array-value parameter. Ignored if\n * the argument is undefined, null or less than zero.\n * @param {*} value - The parameter value to set.\n * @param {boolean} [force=false] - If true, records the parameter as modified\n * even if the value is unchanged.\n * @return {Parameters} - This parameter object.\n */\n set(name, index, value, force) {\n const o = this,\n v = o[name],\n mod = o[CACHE];\n if (index != null && index >= 0) {\n if (v[index] !== value || force) {\n v[index] = value;\n mod[index + ':' + name] = -1;\n mod[name] = -1;\n }\n } else if (v !== value || force) {\n o[name] = value;\n mod[name] = isArray(value) ? 1 + value.length : -1;\n }\n return o;\n },\n /**\n * Tests if one or more parameters has been modified. If invoked with no\n * arguments, returns true if any parameter value has changed. If the first\n * argument is array, returns trues if any parameter name in the array has\n * changed. Otherwise, tests if the given name and optional array index has\n * changed.\n * @param {string} name - The parameter name to test.\n * @param {number} [index=undefined] - The parameter array index to test.\n * @return {boolean} - Returns true if a queried parameter was modified.\n */\n modified(name, index) {\n const mod = this[CACHE];\n if (!arguments.length) {\n for (const k in mod) {\n if (mod[k]) return true;\n }\n return false;\n } else if (isArray(name)) {\n for (let k = 0; k < name.length; ++k) {\n if (mod[name[k]]) return true;\n }\n return false;\n }\n return index != null && index >= 0 ? index + 1 < mod[name] || !!mod[index + ':' + name] : !!mod[name];\n },\n /**\n * Clears the modification records. After calling this method,\n * all parameters are considered unmodified.\n */\n clear() {\n this[CACHE] = {};\n return this;\n }\n};\n\nlet OP_ID = 0;\nconst PULSE = 'pulse',\n NO_PARAMS = new Parameters();\n\n// Boolean Flags\nconst SKIP$1 = 1,\n MODIFIED = 2;\n\n/**\n * An Operator is a processing node in a dataflow graph.\n * Each operator stores a value and an optional value update function.\n * Operators can accept a hash of named parameters. Parameter values can\n * either be direct (JavaScript literals, arrays, objects) or indirect\n * (other operators whose values will be pulled dynamically). Operators\n * included as parameters will have this operator added as a dependency.\n * @constructor\n * @param {*} [init] - The initial value for this operator.\n * @param {function(object, Pulse)} [update] - An update function. Upon\n * evaluation of this operator, the update function will be invoked and the\n * return value will be used as the new value of this operator.\n * @param {object} [params] - The parameters for this operator.\n * @param {boolean} [react=true] - Flag indicating if this operator should\n * listen for changes to upstream operators included as parameters.\n * @see parameters\n */\nfunction Operator(init, update, params, react) {\n this.id = ++OP_ID;\n this.value = init;\n this.stamp = -1;\n this.rank = -1;\n this.qrank = -1;\n this.flags = 0;\n if (update) {\n this._update = update;\n }\n if (params) this.parameters(params, react);\n}\nfunction flag(bit) {\n return function (state) {\n const f = this.flags;\n if (arguments.length === 0) return !!(f & bit);\n this.flags = state ? f | bit : f & ~bit;\n return this;\n };\n}\nOperator.prototype = {\n /**\n * Returns a list of target operators dependent on this operator.\n * If this list does not exist, it is created and then returned.\n * @return {UniqueList}\n */\n targets() {\n return this._targets || (this._targets = UniqueList(id));\n },\n /**\n * Sets the value of this operator.\n * @param {*} value - the value to set.\n * @return {Number} Returns 1 if the operator value has changed\n * according to strict equality, returns 0 otherwise.\n */\n set(value) {\n if (this.value !== value) {\n this.value = value;\n return 1;\n } else {\n return 0;\n }\n },\n /**\n * Indicates that operator evaluation should be skipped on the next pulse.\n * This operator will still propagate incoming pulses, but its update function\n * will not be invoked. The skip flag is reset after every pulse, so calling\n * this method will affect processing of the next pulse only.\n */\n skip: flag(SKIP$1),\n /**\n * Indicates that this operator's value has been modified on its most recent\n * pulse. Normally modification is checked via strict equality; however, in\n * some cases it is more efficient to update the internal state of an object.\n * In those cases, the modified flag can be used to trigger propagation. Once\n * set, the modification flag persists across pulses until unset. The flag can\n * be used with the last timestamp to test if a modification is recent.\n */\n modified: flag(MODIFIED),\n /**\n * Sets the parameters for this operator. The parameter values are analyzed for\n * operator instances. If found, this operator will be added as a dependency\n * of the parameterizing operator. Operator values are dynamically marshalled\n * from each operator parameter prior to evaluation. If a parameter value is\n * an array, the array will also be searched for Operator instances. However,\n * the search does not recurse into sub-arrays or object properties.\n * @param {object} params - A hash of operator parameters.\n * @param {boolean} [react=true] - A flag indicating if this operator should\n * automatically update (react) when parameter values change. In other words,\n * this flag determines if the operator registers itself as a listener on\n * any upstream operators included in the parameters.\n * @param {boolean} [initonly=false] - A flag indicating if this operator\n * should calculate an update only upon its initial evaluation, then\n * deregister dependencies and suppress all future update invocations.\n * @return {Operator[]} - An array of upstream dependencies.\n */\n parameters(params, react, initonly) {\n react = react !== false;\n const argval = this._argval = this._argval || new Parameters(),\n argops = this._argops = this._argops || [],\n deps = [];\n let name, value, n, i;\n const add = (name, index, value) => {\n if (value instanceof Operator) {\n if (value !== this) {\n if (react) value.targets().add(this);\n deps.push(value);\n }\n argops.push({\n op: value,\n name: name,\n index: index\n });\n } else {\n argval.set(name, index, value);\n }\n };\n for (name in params) {\n value = params[name];\n if (name === PULSE) {\n array(value).forEach(op => {\n if (!(op instanceof Operator)) {\n error('Pulse parameters must be operator instances.');\n } else if (op !== this) {\n op.targets().add(this);\n deps.push(op);\n }\n });\n this.source = value;\n } else if (isArray(value)) {\n argval.set(name, -1, Array(n = value.length));\n for (i = 0; i < n; ++i) add(name, i, value[i]);\n } else {\n add(name, -1, value);\n }\n }\n this.marshall().clear(); // initialize values\n if (initonly) argops.initonly = true;\n return deps;\n },\n /**\n * Internal method for marshalling parameter values.\n * Visits each operator dependency to pull the latest value.\n * @return {Parameters} A Parameters object to pass to the update function.\n */\n marshall(stamp) {\n const argval = this._argval || NO_PARAMS,\n argops = this._argops;\n let item, i, op, mod;\n if (argops) {\n const n = argops.length;\n for (i = 0; i < n; ++i) {\n item = argops[i];\n op = item.op;\n mod = op.modified() && op.stamp === stamp;\n argval.set(item.name, item.index, op.value, mod);\n }\n if (argops.initonly) {\n for (i = 0; i < n; ++i) {\n item = argops[i];\n item.op.targets().remove(this);\n }\n this._argops = null;\n this._update = null;\n }\n }\n return argval;\n },\n /**\n * Detach this operator from the dataflow.\n * Unregisters listeners on upstream dependencies.\n */\n detach() {\n const argops = this._argops;\n let i, n, item, op;\n if (argops) {\n for (i = 0, n = argops.length; i < n; ++i) {\n item = argops[i];\n op = item.op;\n if (op._targets) {\n op._targets.remove(this);\n }\n }\n }\n\n // remove references to the source and pulse object,\n // if present, to prevent memory leaks of old data.\n this.pulse = null;\n this.source = null;\n },\n /**\n * Delegate method to perform operator processing.\n * Subclasses can override this method to perform custom processing.\n * By default, it marshalls parameters and calls the update function\n * if that function is defined. If the update function does not\n * change the operator value then StopPropagation is returned.\n * If no update function is defined, this method does nothing.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return The output pulse or StopPropagation. A falsy return value\n * (including undefined) will let the input pulse pass through.\n */\n evaluate(pulse) {\n const update = this._update;\n if (update) {\n const params = this.marshall(pulse.stamp),\n v = update.call(this, params, pulse);\n params.clear();\n if (v !== this.value) {\n this.value = v;\n } else if (!this.modified()) {\n return pulse.StopPropagation;\n }\n }\n },\n /**\n * Run this operator for the current pulse. If this operator has already\n * been run at (or after) the pulse timestamp, returns StopPropagation.\n * Internally, this method calls {@link evaluate} to perform processing.\n * If {@link evaluate} returns a falsy value, the input pulse is returned.\n * This method should NOT be overridden, instead overrride {@link evaluate}.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return the output pulse for this operator (or StopPropagation)\n */\n run(pulse) {\n if (pulse.stamp < this.stamp) return pulse.StopPropagation;\n let rv;\n if (this.skip()) {\n this.skip(false);\n rv = 0;\n } else {\n rv = this.evaluate(pulse);\n }\n return this.pulse = rv || pulse;\n }\n};\n\n/**\n * Add an operator to the dataflow graph. This function accepts a\n * variety of input argument types. The basic signature supports an\n * initial value, update function and parameters. If the first parameter\n * is an Operator instance, it will be added directly. If it is a\n * constructor for an Operator subclass, a new instance will be instantiated.\n * Otherwise, if the first parameter is a function instance, it will be used\n * as the update function and a null initial value is assumed.\n * @param {*} init - One of: the operator to add, the initial value of\n * the operator, an operator class to instantiate, or an update function.\n * @param {function} [update] - The operator update function.\n * @param {object} [params] - The operator parameters.\n * @param {boolean} [react=true] - Flag indicating if this operator should\n * listen for changes to upstream operators included as parameters.\n * @return {Operator} - The added operator.\n */\nfunction add (init, update, params, react) {\n let shift = 1,\n op;\n if (init instanceof Operator) {\n op = init;\n } else if (init && init.prototype instanceof Operator) {\n op = new init();\n } else if (isFunction(init)) {\n op = new Operator(null, init);\n } else {\n shift = 0;\n op = new Operator(init, update);\n }\n this.rank(op);\n if (shift) {\n react = params;\n params = update;\n }\n if (params) this.connect(op, op.parameters(params, react));\n this.touch(op);\n return op;\n}\n\n/**\n * Connect a target operator as a dependent of source operators.\n * If necessary, this method will rerank the target operator and its\n * dependents to ensure propagation proceeds in a topologically sorted order.\n * @param {Operator} target - The target operator.\n * @param {Array} - The source operators that should propagate\n * to the target operator.\n */\nfunction connect (target, sources) {\n const targetRank = target.rank,\n n = sources.length;\n for (let i = 0; i < n; ++i) {\n if (targetRank < sources[i].rank) {\n this.rerank(target);\n return;\n }\n }\n}\n\nlet STREAM_ID = 0;\n\n/**\n * Models an event stream.\n * @constructor\n * @param {function(Object, number): boolean} [filter] - Filter predicate.\n * Events pass through when truthy, events are suppressed when falsy.\n * @param {function(Object): *} [apply] - Applied to input events to produce\n * new event values.\n * @param {function(Object)} [receive] - Event callback function to invoke\n * upon receipt of a new event. Use to override standard event processing.\n */\nfunction EventStream(filter, apply, receive) {\n this.id = ++STREAM_ID;\n this.value = null;\n if (receive) this.receive = receive;\n if (filter) this._filter = filter;\n if (apply) this._apply = apply;\n}\n\n/**\n * Creates a new event stream instance with the provided\n * (optional) filter, apply and receive functions.\n * @param {function(Object, number): boolean} [filter] - Filter predicate.\n * Events pass through when truthy, events are suppressed when falsy.\n * @param {function(Object): *} [apply] - Applied to input events to produce\n * new event values.\n * @see EventStream\n */\nfunction stream(filter, apply, receive) {\n return new EventStream(filter, apply, receive);\n}\nEventStream.prototype = {\n _filter: truthy,\n _apply: identity,\n targets() {\n return this._targets || (this._targets = UniqueList(id));\n },\n consume(_) {\n if (!arguments.length) return !!this._consume;\n this._consume = !!_;\n return this;\n },\n receive(evt) {\n if (this._filter(evt)) {\n const val = this.value = this._apply(evt),\n trg = this._targets,\n n = trg ? trg.length : 0;\n for (let i = 0; i < n; ++i) trg[i].receive(val);\n if (this._consume) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n }\n },\n filter(filter) {\n const s = stream(filter);\n this.targets().add(s);\n return s;\n },\n apply(apply) {\n const s = stream(null, apply);\n this.targets().add(s);\n return s;\n },\n merge() {\n const s = stream();\n this.targets().add(s);\n for (let i = 0, n = arguments.length; i < n; ++i) {\n arguments[i].targets().add(s);\n }\n return s;\n },\n throttle(pause) {\n let t = -1;\n return this.filter(() => {\n const now = Date.now();\n if (now - t > pause) {\n t = now;\n return 1;\n } else {\n return 0;\n }\n });\n },\n debounce(delay) {\n const s = stream();\n this.targets().add(stream(null, null, debounce(delay, e => {\n const df = e.dataflow;\n s.receive(e);\n if (df && df.run) df.run();\n })));\n return s;\n },\n between(a, b) {\n let active = false;\n a.targets().add(stream(null, null, () => active = true));\n b.targets().add(stream(null, null, () => active = false));\n return this.filter(() => active);\n },\n detach() {\n // ensures compatibility with operators (#2753)\n // remove references to other streams and filter functions that may\n // be bound to subcontexts that need to be garbage collected.\n this._filter = truthy;\n this._targets = null;\n }\n};\n\n/**\n * Create a new event stream from an event source.\n * @param {object} source - The event source to monitor. The input must\n * support the addEventListener method.\n * @param {string} type - The event type.\n * @param {function(object): boolean} [filter] - Event filter function.\n * @param {function(object): *} [apply] - Event application function.\n * If provided, this function will be invoked and the result will be\n * used as the downstream event value.\n * @return {EventStream}\n */\nfunction events (source, type, filter, apply) {\n const df = this,\n s = stream(filter, apply),\n send = function (e) {\n e.dataflow = df;\n try {\n s.receive(e);\n } catch (error) {\n df.error(error);\n } finally {\n df.run();\n }\n };\n let sources;\n if (typeof source === 'string' && typeof document !== 'undefined') {\n sources = document.querySelectorAll(source);\n } else {\n sources = array(source);\n }\n const n = sources.length;\n for (let i = 0; i < n; ++i) {\n sources[i].addEventListener(type, send);\n }\n return s;\n}\n\nfunction parse(data, format) {\n const locale = this.locale();\n return read(data, format, locale.timeParse, locale.utcParse);\n}\n\n/**\n * Ingests new data into the dataflow. First parses the data using the\n * vega-loader read method, then pulses a changeset to the target operator.\n * @param {Operator} target - The Operator to target with ingested data,\n * typically a Collect transform instance.\n * @param {*} data - The input data, prior to parsing. For JSON this may\n * be a string or an object. For CSV, TSV, etc should be a string.\n * @param {object} format - The data format description for parsing\n * loaded data. This object is passed to the vega-loader read method.\n * @returns {Dataflow}\n */\nfunction ingest(target, data, format) {\n data = this.parse(data, format);\n return this.pulse(target, this.changeset().insert(data));\n}\n\n/**\n * Request data from an external source, parse it, and return a Promise.\n * @param {string} url - The URL from which to load the data. This string\n * is passed to the vega-loader load method.\n * @param {object} [format] - The data format description for parsing\n * loaded data. This object is passed to the vega-loader read method.\n * @return {Promise} A Promise that resolves upon completion of the request.\n * The resolved object contains the following properties:\n * - data: an array of parsed data (or null upon error)\n * - status: a code for success (0), load fail (-1), or parse fail (-2)\n */\nasync function request(url, format) {\n const df = this;\n let status = 0,\n data;\n try {\n data = await df.loader().load(url, {\n context: 'dataflow',\n response: responseType(format && format.type)\n });\n try {\n data = df.parse(data, format);\n } catch (err) {\n status = -2;\n df.warn('Data ingestion failed', url, err);\n }\n } catch (err) {\n status = -1;\n df.warn('Loading failed', url, err);\n }\n return {\n data,\n status\n };\n}\nasync function preload(target, url, format) {\n const df = this,\n pending = df._pending || loadPending(df);\n pending.requests += 1;\n const res = await df.request(url, format);\n df.pulse(target, df.changeset().remove(truthy).insert(res.data || []));\n pending.done();\n return res;\n}\nfunction loadPending(df) {\n let accept;\n const pending = new Promise(a => accept = a);\n pending.requests = 0;\n pending.done = () => {\n if (--pending.requests === 0) {\n df._pending = null;\n accept(df);\n }\n };\n return df._pending = pending;\n}\n\nconst SKIP = {\n skip: true\n};\n\n/**\n * Perform operator updates in response to events. Applies an\n * update function to compute a new operator value. If the update function\n * returns a {@link ChangeSet}, the operator will be pulsed with those tuple\n * changes. Otherwise, the operator value will be updated to the return value.\n * @param {EventStream|Operator} source - The event source to react to.\n * This argument can be either an EventStream or an Operator.\n * @param {Operator|function(object):Operator} target - The operator to update.\n * This argument can either be an Operator instance or (if the source\n * argument is an EventStream), a function that accepts an event object as\n * input and returns an Operator to target.\n * @param {function(Parameters,Event): *} [update] - Optional update function\n * to compute the new operator value, or a literal value to set. Update\n * functions expect to receive a parameter object and event as arguments.\n * This function can either return a new operator value or (if the source\n * argument is an EventStream) a {@link ChangeSet} instance to pulse\n * the target operator with tuple changes.\n * @param {object} [params] - The update function parameters.\n * @param {object} [options] - Additional options hash. If not overridden,\n * updated operators will be skipped by default.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @param {boolean} [options.force] - If true, the operator will\n * be re-evaluated even if its value has not changed.\n * @return {Dataflow}\n */\nfunction on (source, target, update, params, options) {\n const fn = source instanceof Operator ? onOperator : onStream;\n fn(this, source, target, update, params, options);\n return this;\n}\nfunction onStream(df, stream, target, update, params, options) {\n const opt = extend({}, options, SKIP);\n let func, op;\n if (!isFunction(target)) target = constant(target);\n if (update === undefined) {\n func = e => df.touch(target(e));\n } else if (isFunction(update)) {\n op = new Operator(null, update, params, false);\n func = e => {\n op.evaluate(e);\n const t = target(e),\n v = op.value;\n isChangeSet(v) ? df.pulse(t, v, options) : df.update(t, v, opt);\n };\n } else {\n func = e => df.update(target(e), update, opt);\n }\n stream.apply(func);\n}\nfunction onOperator(df, source, target, update, params, options) {\n if (update === undefined) {\n source.targets().add(target);\n } else {\n const opt = options || {},\n op = new Operator(null, updater(target, update), params, false);\n op.modified(opt.force);\n op.rank = source.rank; // immediately follow source\n source.targets().add(op); // add dependency\n\n if (target) {\n op.skip(true); // skip first invocation\n op.value = target.value; // initialize value\n op.targets().add(target); // chain dependencies\n df.connect(target, [op]); // rerank as needed, #1672\n }\n }\n}\n\nfunction updater(target, update) {\n update = isFunction(update) ? update : constant(update);\n return target ? function (_, pulse) {\n const value = update(_, pulse);\n if (!target.skip()) {\n target.skip(value !== this.value).value = value;\n }\n return value;\n } : update;\n}\n\n/**\n * Assigns a rank to an operator. Ranks are assigned in increasing order\n * by incrementing an internal rank counter.\n * @param {Operator} op - The operator to assign a rank.\n */\nfunction rank(op) {\n op.rank = ++this._rank;\n}\n\n/**\n * Re-ranks an operator and all downstream target dependencies. This\n * is necessary when upstream dependencies of higher rank are added to\n * a target operator.\n * @param {Operator} op - The operator to re-rank.\n */\nfunction rerank(op) {\n const queue = [op];\n let cur, list, i;\n while (queue.length) {\n this.rank(cur = queue.pop());\n if (list = cur._targets) {\n for (i = list.length; --i >= 0;) {\n queue.push(cur = list[i]);\n if (cur === op) error('Cycle detected in dataflow graph.');\n }\n }\n }\n}\n\n/**\n * Sentinel value indicating pulse propagation should stop.\n */\nconst StopPropagation = {};\n\n// Pulse visit type flags\nconst ADD = 1 << 0,\n REM = 1 << 1,\n MOD = 1 << 2,\n ADD_REM = ADD | REM,\n ADD_MOD = ADD | MOD,\n ALL = ADD | REM | MOD,\n REFLOW = 1 << 3,\n SOURCE = 1 << 4,\n NO_SOURCE = 1 << 5,\n NO_FIELDS = 1 << 6;\n\n/**\n * A Pulse enables inter-operator communication during a run of the\n * dataflow graph. In addition to the current timestamp, a pulse may also\n * contain a change-set of added, removed or modified data tuples, as well as\n * a pointer to a full backing data source. Tuple change sets may not\n * be fully materialized; for example, to prevent needless array creation\n * a change set may include larger arrays and corresponding filter functions.\n * The pulse provides a {@link visit} method to enable proper and efficient\n * iteration over requested data tuples.\n *\n * In addition, each pulse can track modification flags for data tuple fields.\n * Responsible transform operators should call the {@link modifies} method to\n * indicate changes to data fields. The {@link modified} method enables\n * querying of this modification state.\n *\n * @constructor\n * @param {Dataflow} dataflow - The backing dataflow instance.\n * @param {number} stamp - The current propagation timestamp.\n * @param {string} [encode] - An optional encoding set name, which is then\n * accessible as Pulse.encode. Operators can respond to (or ignore) this\n * setting as appropriate. This parameter can be used in conjunction with\n * the Encode transform in the vega-encode module.\n */\nfunction Pulse(dataflow, stamp, encode) {\n this.dataflow = dataflow;\n this.stamp = stamp == null ? -1 : stamp;\n this.add = [];\n this.rem = [];\n this.mod = [];\n this.fields = null;\n this.encode = encode || null;\n}\nfunction materialize(data, filter) {\n const out = [];\n visitArray(data, filter, _ => out.push(_));\n return out;\n}\nfunction filter(pulse, flags) {\n const map = {};\n pulse.visit(flags, t => {\n map[tupleid(t)] = 1;\n });\n return t => map[tupleid(t)] ? null : t;\n}\nfunction addFilter(a, b) {\n return a ? (t, i) => a(t, i) && b(t, i) : b;\n}\nPulse.prototype = {\n /**\n * Sentinel value indicating pulse propagation should stop.\n */\n StopPropagation,\n /**\n * Boolean flag indicating ADD (added) tuples.\n */\n ADD,\n /**\n * Boolean flag indicating REM (removed) tuples.\n */\n REM,\n /**\n * Boolean flag indicating MOD (modified) tuples.\n */\n MOD,\n /**\n * Boolean flag indicating ADD (added) and REM (removed) tuples.\n */\n ADD_REM,\n /**\n * Boolean flag indicating ADD (added) and MOD (modified) tuples.\n */\n ADD_MOD,\n /**\n * Boolean flag indicating ADD, REM and MOD tuples.\n */\n ALL,\n /**\n * Boolean flag indicating all tuples in a data source\n * except for the ADD, REM and MOD tuples.\n */\n REFLOW,\n /**\n * Boolean flag indicating a 'pass-through' to a\n * backing data source, ignoring ADD, REM and MOD tuples.\n */\n SOURCE,\n /**\n * Boolean flag indicating that source data should be\n * suppressed when creating a forked pulse.\n */\n NO_SOURCE,\n /**\n * Boolean flag indicating that field modifications should be\n * suppressed when creating a forked pulse.\n */\n NO_FIELDS,\n /**\n * Creates a new pulse based on the values of this pulse.\n * The dataflow, time stamp and field modification values are copied over.\n * By default, new empty ADD, REM and MOD arrays are created.\n * @param {number} flags - Integer of boolean flags indicating which (if any)\n * tuple arrays should be copied to the new pulse. The supported flag values\n * are ADD, REM and MOD. Array references are copied directly: new array\n * instances are not created.\n * @return {Pulse} - The forked pulse instance.\n * @see init\n */\n fork(flags) {\n return new Pulse(this.dataflow).init(this, flags);\n },\n /**\n * Creates a copy of this pulse with new materialized array\n * instances for the ADD, REM, MOD, and SOURCE arrays.\n * The dataflow, time stamp and field modification values are copied over.\n * @return {Pulse} - The cloned pulse instance.\n * @see init\n */\n clone() {\n const p = this.fork(ALL);\n p.add = p.add.slice();\n p.rem = p.rem.slice();\n p.mod = p.mod.slice();\n if (p.source) p.source = p.source.slice();\n return p.materialize(ALL | SOURCE);\n },\n /**\n * Returns a pulse that adds all tuples from a backing source. This is\n * useful for cases where operators are added to a dataflow after an\n * upstream data pipeline has already been processed, ensuring that\n * new operators can observe all tuples within a stream.\n * @return {Pulse} - A pulse instance with all source tuples included\n * in the add array. If the current pulse already has all source\n * tuples in its add array, it is returned directly. If the current\n * pulse does not have a backing source, it is returned directly.\n */\n addAll() {\n let p = this;\n const reuse = !p.source || p.add === p.rem // special case for indexed set (e.g., crossfilter)\n || !p.rem.length && p.source.length === p.add.length;\n if (reuse) {\n return p;\n } else {\n p = new Pulse(this.dataflow).init(this);\n p.add = p.source;\n p.rem = []; // new operators can ignore rem #2769\n return p;\n }\n },\n /**\n * Initialize this pulse based on the values of another pulse. This method\n * is used internally by {@link fork} to initialize a new forked tuple.\n * The dataflow, time stamp and field modification values are copied over.\n * By default, new empty ADD, REM and MOD arrays are created.\n * @param {Pulse} src - The source pulse to copy from.\n * @param {number} flags - Integer of boolean flags indicating which (if any)\n * tuple arrays should be copied to the new pulse. The supported flag values\n * are ADD, REM and MOD. Array references are copied directly: new array\n * instances are not created. By default, source data arrays are copied\n * to the new pulse. Use the NO_SOURCE flag to enforce a null source.\n * @return {Pulse} - Returns this Pulse instance.\n */\n init(src, flags) {\n const p = this;\n p.stamp = src.stamp;\n p.encode = src.encode;\n if (src.fields && !(flags & NO_FIELDS)) {\n p.fields = src.fields;\n }\n if (flags & ADD) {\n p.addF = src.addF;\n p.add = src.add;\n } else {\n p.addF = null;\n p.add = [];\n }\n if (flags & REM) {\n p.remF = src.remF;\n p.rem = src.rem;\n } else {\n p.remF = null;\n p.rem = [];\n }\n if (flags & MOD) {\n p.modF = src.modF;\n p.mod = src.mod;\n } else {\n p.modF = null;\n p.mod = [];\n }\n if (flags & NO_SOURCE) {\n p.srcF = null;\n p.source = null;\n } else {\n p.srcF = src.srcF;\n p.source = src.source;\n if (src.cleans) p.cleans = src.cleans;\n }\n return p;\n },\n /**\n * Schedules a function to run after pulse propagation completes.\n * @param {function} func - The function to run.\n */\n runAfter(func) {\n this.dataflow.runAfter(func);\n },\n /**\n * Indicates if tuples have been added, removed or modified.\n * @param {number} [flags] - The tuple types (ADD, REM or MOD) to query.\n * Defaults to ALL, returning true if any tuple type has changed.\n * @return {boolean} - Returns true if one or more queried tuple types have\n * changed, false otherwise.\n */\n changed(flags) {\n const f = flags || ALL;\n return f & ADD && this.add.length || f & REM && this.rem.length || f & MOD && this.mod.length;\n },\n /**\n * Forces a \"reflow\" of tuple values, such that all tuples in the backing\n * source are added to the MOD set, unless already present in the ADD set.\n * @param {boolean} [fork=false] - If true, returns a forked copy of this\n * pulse, and invokes reflow on that derived pulse.\n * @return {Pulse} - The reflowed pulse instance.\n */\n reflow(fork) {\n if (fork) return this.fork(ALL).reflow();\n const len = this.add.length,\n src = this.source && this.source.length;\n if (src && src !== len) {\n this.mod = this.source;\n if (len) this.filter(MOD, filter(this, ADD));\n }\n return this;\n },\n /**\n * Get/set metadata to pulse requesting garbage collection\n * to reclaim currently unused resources.\n */\n clean(value) {\n if (arguments.length) {\n this.cleans = !!value;\n return this;\n } else {\n return this.cleans;\n }\n },\n /**\n * Marks one or more data field names as modified to assist dependency\n * tracking and incremental processing by transform operators.\n * @param {string|Array} _ - The field(s) to mark as modified.\n * @return {Pulse} - This pulse instance.\n */\n modifies(_) {\n const hash = this.fields || (this.fields = {});\n if (isArray(_)) {\n _.forEach(f => hash[f] = true);\n } else {\n hash[_] = true;\n }\n return this;\n },\n /**\n * Checks if one or more data fields have been modified during this pulse\n * propagation timestamp.\n * @param {string|Array} _ - The field(s) to check for modified.\n * @param {boolean} nomod - If true, will check the modified flag even if\n * no mod tuples exist. If false (default), mod tuples must be present.\n * @return {boolean} - Returns true if any of the provided fields has been\n * marked as modified, false otherwise.\n */\n modified(_, nomod) {\n const fields = this.fields;\n return !((nomod || this.mod.length) && fields) ? false : !arguments.length ? !!fields : isArray(_) ? _.some(f => fields[f]) : fields[_];\n },\n /**\n * Adds a filter function to one more tuple sets. Filters are applied to\n * backing tuple arrays, to determine the actual set of tuples considered\n * added, removed or modified. They can be used to delay materialization of\n * a tuple set in order to avoid expensive array copies. In addition, the\n * filter functions can serve as value transformers: unlike standard predicate\n * function (which return boolean values), Pulse filters should return the\n * actual tuple value to process. If a tuple set is already filtered, the\n * new filter function will be appended into a conjuntive ('and') query.\n * @param {number} flags - Flags indicating the tuple set(s) to filter.\n * @param {function(*):object} filter - Filter function that will be applied\n * to the tuple set array, and should return a data tuple if the value\n * should be included in the tuple set, and falsy (or null) otherwise.\n * @return {Pulse} - Returns this pulse instance.\n */\n filter(flags, filter) {\n const p = this;\n if (flags & ADD) p.addF = addFilter(p.addF, filter);\n if (flags & REM) p.remF = addFilter(p.remF, filter);\n if (flags & MOD) p.modF = addFilter(p.modF, filter);\n if (flags & SOURCE) p.srcF = addFilter(p.srcF, filter);\n return p;\n },\n /**\n * Materialize one or more tuple sets in this pulse. If the tuple set(s) have\n * a registered filter function, it will be applied and the tuple set(s) will\n * be replaced with materialized tuple arrays.\n * @param {number} flags - Flags indicating the tuple set(s) to materialize.\n * @return {Pulse} - Returns this pulse instance.\n */\n materialize(flags) {\n flags = flags || ALL;\n const p = this;\n if (flags & ADD && p.addF) {\n p.add = materialize(p.add, p.addF);\n p.addF = null;\n }\n if (flags & REM && p.remF) {\n p.rem = materialize(p.rem, p.remF);\n p.remF = null;\n }\n if (flags & MOD && p.modF) {\n p.mod = materialize(p.mod, p.modF);\n p.modF = null;\n }\n if (flags & SOURCE && p.srcF) {\n p.source = p.source.filter(p.srcF);\n p.srcF = null;\n }\n return p;\n },\n /**\n * Visit one or more tuple sets in this pulse.\n * @param {number} flags - Flags indicating the tuple set(s) to visit.\n * Legal values are ADD, REM, MOD and SOURCE (if a backing data source\n * has been set).\n * @param {function(object):*} - Visitor function invoked per-tuple.\n * @return {Pulse} - Returns this pulse instance.\n */\n visit(flags, visitor) {\n const p = this,\n v = visitor;\n if (flags & SOURCE) {\n visitArray(p.source, p.srcF, v);\n return p;\n }\n if (flags & ADD) visitArray(p.add, p.addF, v);\n if (flags & REM) visitArray(p.rem, p.remF, v);\n if (flags & MOD) visitArray(p.mod, p.modF, v);\n const src = p.source;\n if (flags & REFLOW && src) {\n const sum = p.add.length + p.mod.length;\n if (sum === src.length) ; else if (sum) {\n visitArray(src, filter(p, ADD_MOD), v);\n } else {\n // if no add/rem/mod tuples, visit source\n visitArray(src, p.srcF, v);\n }\n }\n return p;\n }\n};\n\n/**\n * Represents a set of multiple pulses. Used as input for operators\n * that accept multiple pulses at a time. Contained pulses are\n * accessible via the public \"pulses\" array property. This pulse doe\n * not carry added, removed or modified tuples directly. However,\n * the visit method can be used to traverse all such tuples contained\n * in sub-pulses with a timestamp matching this parent multi-pulse.\n * @constructor\n * @param {Dataflow} dataflow - The backing dataflow instance.\n * @param {number} stamp - The timestamp.\n * @param {Array} pulses - The sub-pulses for this multi-pulse.\n */\nfunction MultiPulse(dataflow, stamp, pulses, encode) {\n const p = this;\n let c = 0;\n this.dataflow = dataflow;\n this.stamp = stamp;\n this.fields = null;\n this.encode = encode || null;\n this.pulses = pulses;\n for (const pulse of pulses) {\n if (pulse.stamp !== stamp) continue;\n if (pulse.fields) {\n const hash = p.fields || (p.fields = {});\n for (const f in pulse.fields) {\n hash[f] = 1;\n }\n }\n if (pulse.changed(p.ADD)) c |= p.ADD;\n if (pulse.changed(p.REM)) c |= p.REM;\n if (pulse.changed(p.MOD)) c |= p.MOD;\n }\n this.changes = c;\n}\ninherits(MultiPulse, Pulse, {\n /**\n * Creates a new pulse based on the values of this pulse.\n * The dataflow, time stamp and field modification values are copied over.\n * @return {Pulse}\n */\n fork(flags) {\n const p = new Pulse(this.dataflow).init(this, flags & this.NO_FIELDS);\n if (flags !== undefined) {\n if (flags & p.ADD) this.visit(p.ADD, t => p.add.push(t));\n if (flags & p.REM) this.visit(p.REM, t => p.rem.push(t));\n if (flags & p.MOD) this.visit(p.MOD, t => p.mod.push(t));\n }\n return p;\n },\n changed(flags) {\n return this.changes & flags;\n },\n modified(_) {\n const p = this,\n fields = p.fields;\n return !(fields && p.changes & p.MOD) ? 0 : isArray(_) ? _.some(f => fields[f]) : fields[_];\n },\n filter() {\n error('MultiPulse does not support filtering.');\n },\n materialize() {\n error('MultiPulse does not support materialization.');\n },\n visit(flags, visitor) {\n const p = this,\n pulses = p.pulses,\n n = pulses.length;\n let i = 0;\n if (flags & p.SOURCE) {\n for (; i < n; ++i) {\n pulses[i].visit(flags, visitor);\n }\n } else {\n for (; i < n; ++i) {\n if (pulses[i].stamp === p.stamp) {\n pulses[i].visit(flags, visitor);\n }\n }\n }\n return p;\n }\n});\n\n/* eslint-disable require-atomic-updates */\n\n/**\n * Evaluates the dataflow and returns a Promise that resolves when pulse\n * propagation completes. This method will increment the current timestamp\n * and process all updated, pulsed and touched operators. When invoked for\n * the first time, all registered operators will be processed. This method\n * should not be invoked by third-party clients, use {@link runAsync} or\n * {@link run} instead.\n * @param {string} [encode] - The name of an encoding set to invoke during\n * propagation. This value is added to generated Pulse instances;\n * operators can then respond to (or ignore) this setting as appropriate.\n * This parameter can be used in conjunction with the Encode transform in\n * the vega-encode package.\n * @param {function} [prerun] - An optional callback function to invoke\n * immediately before dataflow evaluation commences.\n * @param {function} [postrun] - An optional callback function to invoke\n * after dataflow evaluation completes. The callback will be invoked\n * after those registered via {@link runAfter}.\n * @return {Promise} - A promise that resolves to this dataflow after\n * evaluation completes.\n */\nasync function evaluate(encode, prerun, postrun) {\n const df = this,\n async = [];\n\n // if the pulse value is set, this is a re-entrant call\n if (df._pulse) return reentrant(df);\n\n // wait for pending datasets to load\n if (df._pending) await df._pending;\n\n // invoke prerun function, if provided\n if (prerun) await asyncCallback(df, prerun);\n\n // exit early if there are no updates\n if (!df._touched.length) {\n df.debug('Dataflow invoked, but nothing to do.');\n return df;\n }\n\n // increment timestamp clock\n const stamp = ++df._clock;\n\n // set the current pulse\n df._pulse = new Pulse(df, stamp, encode);\n\n // initialize priority queue, reset touched operators\n df._touched.forEach(op => df._enqueue(op, true));\n df._touched = UniqueList(id);\n let count = 0,\n op,\n next,\n error;\n try {\n while (df._heap.size() > 0) {\n // dequeue operator with highest priority\n op = df._heap.pop();\n\n // re-queue if rank changed\n if (op.rank !== op.qrank) {\n df._enqueue(op, true);\n continue;\n }\n\n // otherwise, evaluate the operator\n next = op.run(df._getPulse(op, encode));\n if (next.then) {\n // await if operator returns a promise directly\n next = await next;\n } else if (next.async) {\n // queue parallel asynchronous execution\n async.push(next.async);\n next = StopPropagation;\n }\n\n // propagate evaluation, enqueue dependent operators\n if (next !== StopPropagation) {\n if (op._targets) op._targets.forEach(op => df._enqueue(op));\n }\n\n // increment visit counter\n ++count;\n }\n } catch (err) {\n df._heap.clear();\n error = err;\n }\n\n // reset pulse map\n df._input = {};\n df._pulse = null;\n df.debug(`Pulse ${stamp}: ${count} operators`);\n if (error) {\n df._postrun = [];\n df.error(error);\n }\n\n // invoke callbacks queued via runAfter\n if (df._postrun.length) {\n const pr = df._postrun.sort((a, b) => b.priority - a.priority);\n df._postrun = [];\n for (let i = 0; i < pr.length; ++i) {\n await asyncCallback(df, pr[i].callback);\n }\n }\n\n // invoke postrun function, if provided\n if (postrun) await asyncCallback(df, postrun);\n\n // handle non-blocking asynchronous callbacks\n if (async.length) {\n Promise.all(async).then(cb => df.runAsync(null, () => {\n cb.forEach(f => {\n try {\n f(df);\n } catch (err) {\n df.error(err);\n }\n });\n }));\n }\n return df;\n}\n\n/**\n * Queues dataflow evaluation to run once any other queued evaluations have\n * completed and returns a Promise that resolves when the queued pulse\n * propagation completes. If provided, a callback function will be invoked\n * immediately before evaluation commences. This method will ensure a\n * separate evaluation is invoked for each time it is called.\n * @param {string} [encode] - The name of an encoding set to invoke during\n * propagation. This value is added to generated Pulse instances;\n * operators can then respond to (or ignore) this setting as appropriate.\n * This parameter can be used in conjunction with the Encode transform in\n * the vega-encode package.\n * @param {function} [prerun] - An optional callback function to invoke\n * immediately before dataflow evaluation commences.\n * @param {function} [postrun] - An optional callback function to invoke\n * after dataflow evaluation completes. The callback will be invoked\n * after those registered via {@link runAfter}.\n * @return {Promise} - A promise that resolves to this dataflow after\n * evaluation completes.\n */\nasync function runAsync(encode, prerun, postrun) {\n // await previously queued functions\n while (this._running) await this._running;\n\n // run dataflow, manage running promise\n const clear = () => this._running = null;\n (this._running = this.evaluate(encode, prerun, postrun)).then(clear, clear);\n return this._running;\n}\n\n/**\n * Requests dataflow evaluation and the immediately returns this dataflow\n * instance. If there are pending data loading or other asynchronous\n * operations, the dataflow will evaluate asynchronously after this method\n * has been invoked. To track when dataflow evaluation completes, use the\n * {@link runAsync} method instead. This method will raise an error if\n * invoked while the dataflow is already in the midst of evaluation.\n * @param {string} [encode] - The name of an encoding set to invoke during\n * propagation. This value is added to generated Pulse instances;\n * operators can then respond to (or ignore) this setting as appropriate.\n * This parameter can be used in conjunction with the Encode transform in\n * the vega-encode module.\n * @param {function} [prerun] - An optional callback function to invoke\n * immediately before dataflow evaluation commences.\n * @param {function} [postrun] - An optional callback function to invoke\n * after dataflow evaluation completes. The callback will be invoked\n * after those registered via {@link runAfter}.\n * @return {Dataflow} - This dataflow instance.\n */\nfunction run(encode, prerun, postrun) {\n return this._pulse ? reentrant(this) : (this.evaluate(encode, prerun, postrun), this);\n}\n\n/**\n * Schedules a callback function to be invoked after the current pulse\n * propagation completes. If no propagation is currently occurring,\n * the function is invoked immediately. Callbacks scheduled via runAfter\n * are invoked immediately upon completion of the current cycle, before\n * any request queued via runAsync. This method is primarily intended for\n * internal use. Third-party callers using runAfter to schedule a callback\n * that invokes {@link run} or {@link runAsync} should not use this method,\n * but instead use {@link runAsync} with prerun or postrun arguments.\n * @param {function(Dataflow)} callback - The callback function to run.\n * The callback will be invoked with this Dataflow instance as its\n * sole argument.\n * @param {boolean} enqueue - A boolean flag indicating that the\n * callback should be queued up to run after the next propagation\n * cycle, suppressing immediate invocation when propagation is not\n * currently occurring.\n * @param {number} [priority] - A priority value used to sort registered\n * callbacks to determine execution order. This argument is intended\n * for internal Vega use only.\n */\nfunction runAfter(callback, enqueue, priority) {\n if (this._pulse || enqueue) {\n // pulse propagation is currently running, queue to run after\n this._postrun.push({\n priority: priority || 0,\n callback: callback\n });\n } else {\n // pulse propagation already complete, invoke immediately\n try {\n callback(this);\n } catch (err) {\n this.error(err);\n }\n }\n}\n\n/**\n * Raise an error for re-entrant dataflow evaluation.\n */\nfunction reentrant(df) {\n df.error('Dataflow already running. Use runAsync() to chain invocations.');\n return df;\n}\n\n/**\n * Enqueue an operator into the priority queue for evaluation. The operator\n * will be enqueued if it has no registered pulse for the current cycle, or if\n * the force argument is true. Upon enqueue, this method also sets the\n * operator's qrank to the current rank value.\n * @param {Operator} op - The operator to enqueue.\n * @param {boolean} [force] - A flag indicating if the operator should be\n * forceably added to the queue, even if it has already been previously\n * enqueued during the current pulse propagation. This is useful when the\n * dataflow graph is dynamically modified and the operator rank changes.\n */\nfunction enqueue(op, force) {\n const q = op.stamp < this._clock;\n if (q) op.stamp = this._clock;\n if (q || force) {\n op.qrank = op.rank;\n this._heap.push(op);\n }\n}\n\n/**\n * Provide a correct pulse for evaluating an operator. If the operator has an\n * explicit source operator, we will try to pull the pulse(s) from it.\n * If there is an array of source operators, we build a multi-pulse.\n * Otherwise, we return a current pulse with correct source data.\n * If the pulse is the pulse map has an explicit target set, we use that.\n * Else if the pulse on the upstream source operator is current, we use that.\n * Else we use the pulse from the pulse map, but copy the source tuple array.\n * @param {Operator} op - The operator for which to get an input pulse.\n * @param {string} [encode] - An (optional) encoding set name with which to\n * annotate the returned pulse. See {@link run} for more information.\n */\nfunction getPulse(op, encode) {\n const s = op.source,\n stamp = this._clock;\n return s && isArray(s) ? new MultiPulse(this, stamp, s.map(_ => _.pulse), encode) : this._input[op.id] || singlePulse(this._pulse, s && s.pulse);\n}\nfunction singlePulse(p, s) {\n if (s && s.stamp === p.stamp) {\n return s;\n }\n p = p.fork();\n if (s && s !== StopPropagation) {\n p.source = s.source;\n }\n return p;\n}\n\nconst NO_OPT = {\n skip: false,\n force: false\n};\n\n/**\n * Touches an operator, scheduling it to be evaluated. If invoked outside of\n * a pulse propagation, the operator will be evaluated the next time this\n * dataflow is run. If invoked in the midst of pulse propagation, the operator\n * will be queued for evaluation if and only if the operator has not yet been\n * evaluated on the current propagation timestamp.\n * @param {Operator} op - The operator to touch.\n * @param {object} [options] - Additional options hash.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @return {Dataflow}\n */\nfunction touch(op, options) {\n const opt = options || NO_OPT;\n if (this._pulse) {\n // if in midst of propagation, add to priority queue\n this._enqueue(op);\n } else {\n // otherwise, queue for next propagation\n this._touched.add(op);\n }\n if (opt.skip) op.skip(true);\n return this;\n}\n\n/**\n * Updates the value of the given operator.\n * @param {Operator} op - The operator to update.\n * @param {*} value - The value to set.\n * @param {object} [options] - Additional options hash.\n * @param {boolean} [options.force] - If true, the operator will\n * be re-evaluated even if its value has not changed.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @return {Dataflow}\n */\nfunction update(op, value, options) {\n const opt = options || NO_OPT;\n if (op.set(value) || opt.force) {\n this.touch(op, opt);\n }\n return this;\n}\n\n/**\n * Pulses an operator with a changeset of tuples. If invoked outside of\n * a pulse propagation, the pulse will be applied the next time this\n * dataflow is run. If invoked in the midst of pulse propagation, the pulse\n * will be added to the set of active pulses and will be applied if and\n * only if the target operator has not yet been evaluated on the current\n * propagation timestamp.\n * @param {Operator} op - The operator to pulse.\n * @param {ChangeSet} value - The tuple changeset to apply.\n * @param {object} [options] - Additional options hash.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @return {Dataflow}\n */\nfunction pulse(op, changeset, options) {\n this.touch(op, options || NO_OPT);\n const p = new Pulse(this, this._clock + (this._pulse ? 0 : 1)),\n t = op.pulse && op.pulse.source || [];\n p.target = op;\n this._input[op.id] = changeset.pulse(p, t);\n return this;\n}\n\nfunction Heap(cmp) {\n let nodes = [];\n return {\n clear: () => nodes = [],\n size: () => nodes.length,\n peek: () => nodes[0],\n push: x => {\n nodes.push(x);\n return siftdown(nodes, 0, nodes.length - 1, cmp);\n },\n pop: () => {\n const last = nodes.pop();\n let item;\n if (nodes.length) {\n item = nodes[0];\n nodes[0] = last;\n siftup(nodes, 0, cmp);\n } else {\n item = last;\n }\n return item;\n }\n };\n}\nfunction siftdown(array, start, idx, cmp) {\n let parent, pidx;\n const item = array[idx];\n while (idx > start) {\n pidx = idx - 1 >> 1;\n parent = array[pidx];\n if (cmp(item, parent) < 0) {\n array[idx] = parent;\n idx = pidx;\n continue;\n }\n break;\n }\n return array[idx] = item;\n}\nfunction siftup(array, idx, cmp) {\n const start = idx,\n end = array.length,\n item = array[idx];\n let cidx = (idx << 1) + 1,\n ridx;\n while (cidx < end) {\n ridx = cidx + 1;\n if (ridx < end && cmp(array[cidx], array[ridx]) >= 0) {\n cidx = ridx;\n }\n array[idx] = array[cidx];\n idx = cidx;\n cidx = (idx << 1) + 1;\n }\n array[idx] = item;\n return siftdown(array, start, idx, cmp);\n}\n\n/**\n * A dataflow graph for reactive processing of data streams.\n * @constructor\n */\nfunction Dataflow() {\n this.logger(logger());\n this.logLevel(Error);\n this._clock = 0;\n this._rank = 0;\n this._locale = defaultLocale();\n try {\n this._loader = loader();\n } catch (e) {\n // do nothing if loader module is unavailable\n }\n this._touched = UniqueList(id);\n this._input = {};\n this._pulse = null;\n this._heap = Heap((a, b) => a.qrank - b.qrank);\n this._postrun = [];\n}\nfunction logMethod(method) {\n return function () {\n return this._log[method].apply(this, arguments);\n };\n}\nDataflow.prototype = {\n /**\n * The current timestamp of this dataflow. This value reflects the\n * timestamp of the previous dataflow run. The dataflow is initialized\n * with a stamp value of 0. The initial run of the dataflow will have\n * a timestap of 1, and so on. This value will match the\n * {@link Pulse.stamp} property.\n * @return {number} - The current timestamp value.\n */\n stamp() {\n return this._clock;\n },\n /**\n * Gets or sets the loader instance to use for data file loading. A\n * loader object must provide a \"load\" method for loading files and a\n * \"sanitize\" method for checking URL/filename validity. Both methods\n * should accept a URI and options hash as arguments, and return a Promise\n * that resolves to the loaded file contents (load) or a hash containing\n * sanitized URI data with the sanitized url assigned to the \"href\" property\n * (sanitize).\n * @param {object} _ - The loader instance to use.\n * @return {object|Dataflow} - If no arguments are provided, returns\n * the current loader instance. Otherwise returns this Dataflow instance.\n */\n loader(_) {\n if (arguments.length) {\n this._loader = _;\n return this;\n } else {\n return this._loader;\n }\n },\n /**\n * Gets or sets the locale instance to use for formatting and parsing\n * string values. The locale object should be provided by the\n * vega-format library, and include methods such as format, timeFormat,\n * utcFormat, timeParse, and utcParse.\n * @param {object} _ - The locale instance to use.\n * @return {object|Dataflow} - If no arguments are provided, returns\n * the current locale instance. Otherwise returns this Dataflow instance.\n */\n locale(_) {\n if (arguments.length) {\n this._locale = _;\n return this;\n } else {\n return this._locale;\n }\n },\n /**\n * Get or set the logger instance used to log messages. If no arguments are\n * provided, returns the current logger instance. Otherwise, sets the logger\n * and return this Dataflow instance. Provided loggers must support the full\n * API of logger objects generated by the vega-util logger method. Note that\n * by default the log level of the new logger will be used; use the logLevel\n * method to adjust the log level as needed.\n */\n logger(logger) {\n if (arguments.length) {\n this._log = logger;\n return this;\n } else {\n return this._log;\n }\n },\n /**\n * Logs an error message. By default, logged messages are written to console\n * output. The message will only be logged if the current log level is high\n * enough to permit error messages.\n */\n error: logMethod('error'),\n /**\n * Logs a warning message. By default, logged messages are written to console\n * output. The message will only be logged if the current log level is high\n * enough to permit warning messages.\n */\n warn: logMethod('warn'),\n /**\n * Logs a information message. By default, logged messages are written to\n * console output. The message will only be logged if the current log level is\n * high enough to permit information messages.\n */\n info: logMethod('info'),\n /**\n * Logs a debug message. By default, logged messages are written to console\n * output. The message will only be logged if the current log level is high\n * enough to permit debug messages.\n */\n debug: logMethod('debug'),\n /**\n * Get or set the current log level. If an argument is provided, it\n * will be used as the new log level.\n * @param {number} [level] - Should be one of None, Warn, Info\n * @return {number} - The current log level.\n */\n logLevel: logMethod('level'),\n /**\n * Empty entry threshold for garbage cleaning. Map data structures will\n * perform cleaning once the number of empty entries exceeds this value.\n */\n cleanThreshold: 1e4,\n // OPERATOR REGISTRATION\n add,\n connect,\n rank,\n rerank,\n // OPERATOR UPDATES\n pulse,\n touch,\n update,\n changeset,\n // DATA LOADING\n ingest,\n parse,\n preload,\n request,\n // EVENT HANDLING\n events,\n on,\n // PULSE PROPAGATION\n evaluate,\n run,\n runAsync,\n runAfter,\n _enqueue: enqueue,\n _getPulse: getPulse\n};\n\n/**\n * Abstract class for operators that process data tuples.\n * Subclasses must provide a {@link transform} method for operator processing.\n * @constructor\n * @param {*} [init] - The initial value for this operator.\n * @param {object} [params] - The parameters for this operator.\n * @param {Operator} [source] - The operator from which to receive pulses.\n */\nfunction Transform(init, params) {\n Operator.call(this, init, null, params);\n}\ninherits(Transform, Operator, {\n /**\n * Overrides {@link Operator.evaluate} for transform operators.\n * Internally, this method calls {@link evaluate} to perform processing.\n * If {@link evaluate} returns a falsy value, the input pulse is returned.\n * This method should NOT be overridden, instead overrride {@link evaluate}.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return the output pulse for this operator (or StopPropagation)\n */\n run(pulse) {\n if (pulse.stamp < this.stamp) return pulse.StopPropagation;\n let rv;\n if (this.skip()) {\n this.skip(false);\n } else {\n rv = this.evaluate(pulse);\n }\n rv = rv || pulse;\n if (rv.then) {\n rv = rv.then(_ => this.pulse = _);\n } else if (rv !== pulse.StopPropagation) {\n this.pulse = rv;\n }\n return rv;\n },\n /**\n * Overrides {@link Operator.evaluate} for transform operators.\n * Marshalls parameter values and then invokes {@link transform}.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return {Pulse} The output pulse (or StopPropagation). A falsy return\n value (including undefined) will let the input pulse pass through.\n */\n evaluate(pulse) {\n const params = this.marshall(pulse.stamp),\n out = this.transform(params, pulse);\n params.clear();\n return out;\n },\n /**\n * Process incoming pulses.\n * Subclasses should override this method to implement transforms.\n * @param {Parameters} _ - The operator parameter values.\n * @param {Pulse} pulse - The current dataflow pulse.\n * @return {Pulse} The output pulse (or StopPropagation). A falsy return\n * value (including undefined) will let the input pulse pass through.\n */\n transform() {}\n});\n\nconst transforms = {};\nfunction definition(type) {\n const t = transform(type);\n return t && t.Definition || null;\n}\nfunction transform(type) {\n type = type && type.toLowerCase();\n return hasOwnProperty(transforms, type) ? transforms[type] : null;\n}\n\nexport { Dataflow, EventStream, MultiPulse, Operator, Parameters, Pulse, Transform, UniqueList, asyncCallback, changeset, definition, derive, ingest$1 as ingest, isChangeSet, isTuple, rederive, replace, stableCompare, transform, transforms, tupleid };\n","export default function max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n","export default function min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n","import ascending from \"./ascending.js\";\nimport permute from \"./permute.js\";\n\nexport default function sort(values, ...F) {\n if (typeof values[Symbol.iterator] !== \"function\") throw new TypeError(\"values is not iterable\");\n values = Array.from(values);\n let [f] = F;\n if ((f && f.length !== 2) || F.length > 1) {\n const index = Uint32Array.from(values, (d, i) => i);\n if (F.length > 1) {\n F = F.map(f => values.map(f));\n index.sort((i, j) => {\n for (const f of F) {\n const c = ascendingDefined(f[i], f[j]);\n if (c) return c;\n }\n });\n } else {\n f = values.map(f);\n index.sort((i, j) => ascendingDefined(f[i], f[j]));\n }\n return permute(values, index);\n }\n return values.sort(compareDefined(f));\n}\n\nexport function compareDefined(compare = ascending) {\n if (compare === ascending) return ascendingDefined;\n if (typeof compare !== \"function\") throw new TypeError(\"compare is not a function\");\n return (a, b) => {\n const x = compare(a, b);\n if (x || x === 0) return x;\n return (compare(b, b) === 0) - (compare(a, a) === 0);\n };\n}\n\nexport function ascendingDefined(a, b) {\n return (a == null || !(a >= a)) - (b == null || !(b >= b)) || (a < b ? -1 : a > b ? 1 : 0);\n}\n","import {ascendingDefined, compareDefined} from \"./sort.js\";\n\n// Based on https://github.com/mourner/quickselect\n// ISC license, Copyright 2018 Vladimir Agafonkin.\nexport default function quickselect(array, k, left = 0, right = Infinity, compare) {\n k = Math.floor(k);\n left = Math.floor(Math.max(0, left));\n right = Math.floor(Math.min(array.length - 1, right));\n\n if (!(left <= k && k <= right)) return array;\n\n compare = compare === undefined ? ascendingDefined : compareDefined(compare);\n\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n const t = array[k];\n let i = left;\n let j = right;\n\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);\n else ++j, swap(array, j, right);\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n\n return array;\n}\n\nfunction swap(array, i, j) {\n const t = array[i];\n array[i] = array[j];\n array[j] = t;\n}\n","export default function number(x) {\n return x === null ? NaN : +x;\n}\n\nexport function* numbers(values, valueof) {\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n","import max from \"./max.js\";\nimport maxIndex from \"./maxIndex.js\";\nimport min from \"./min.js\";\nimport minIndex from \"./minIndex.js\";\nimport quickselect from \"./quickselect.js\";\nimport number, {numbers} from \"./number.js\";\nimport {ascendingDefined} from \"./sort.js\";\nimport greatest from \"./greatest.js\";\n\nexport default function quantile(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return min(values);\n if (p >= 1) return max(values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = max(quickselect(values, i0).subarray(0, i0 + 1)),\n value1 = min(values.subarray(i0 + 1));\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileSorted(values, p, valueof = number) {\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileIndex(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return minIndex(values);\n if (p >= 1) return maxIndex(values);\n var n,\n i = Math.floor((n - 1) * p),\n order = (i, j) => ascendingDefined(values[i], values[j]),\n index = quickselect(Uint32Array.from(values, (_, i) => i), i, 0, n - 1, order);\n return greatest(index.subarray(0, i + 1), i => values[i]);\n}\n","import quantile, {quantileIndex} from \"./quantile.js\";\n\nexport default function median(values, valueof) {\n return quantile(values, 0.5, valueof);\n}\n\nexport function medianIndex(values, valueof) {\n return quantileIndex(values, 0.5, valueof);\n}\n","import { ascending, quantileSorted, deviation, quantile, median } from 'd3-array';\n\nfunction* numbers (values, valueof) {\n if (valueof == null) {\n for (let value of values) {\n if (value != null && value !== '' && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n value = valueof(value, ++index, values);\n if (value != null && value !== '' && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n\nfunction quantiles (array, p, f) {\n const values = Float64Array.from(numbers(array, f));\n\n // don't depend on return value from typed array sort call\n // protects against undefined sort results in Safari (vega/vega-lite#4964)\n values.sort(ascending);\n return p.map(_ => quantileSorted(values, _));\n}\n\nfunction quartiles (array, f) {\n return quantiles(array, [0.25, 0.50, 0.75], f);\n}\n\n// Scott, D. W. (1992) Multivariate Density Estimation:\n// Theory, Practice, and Visualization. Wiley.\nfunction estimateBandwidth (array, f) {\n const n = array.length,\n d = deviation(array, f),\n q = quartiles(array, f),\n h = (q[2] - q[0]) / 1.34,\n v = Math.min(d, h) || d || Math.abs(q[0]) || 1;\n return 1.06 * v * Math.pow(n, -0.2);\n}\n\nfunction bin (_) {\n // determine range\n const maxb = _.maxbins || 20,\n base = _.base || 10,\n logb = Math.log(base),\n div = _.divide || [5, 2];\n let min = _.extent[0],\n max = _.extent[1],\n step,\n level,\n minstep,\n v,\n i,\n n;\n const span = _.span || max - min || Math.abs(min) || 1;\n if (_.step) {\n // if step size is explicitly given, use that\n step = _.step;\n } else if (_.steps) {\n // if provided, limit choice to acceptable step sizes\n v = span / maxb;\n for (i = 0, n = _.steps.length; i < n && _.steps[i] < v; ++i);\n step = _.steps[Math.max(0, i - 1)];\n } else {\n // else use span to determine step size\n level = Math.ceil(Math.log(maxb) / logb);\n minstep = _.minstep || 0;\n step = Math.max(minstep, Math.pow(base, Math.round(Math.log(span) / logb) - level));\n\n // increase step size if too many bins\n while (Math.ceil(span / step) > maxb) {\n step *= base;\n }\n\n // decrease step size if allowed\n for (i = 0, n = div.length; i < n; ++i) {\n v = step / div[i];\n if (v >= minstep && span / v <= maxb) step = v;\n }\n }\n\n // update precision, min and max\n v = Math.log(step);\n const precision = v >= 0 ? 0 : ~~(-v / logb) + 1,\n eps = Math.pow(base, -precision - 1);\n if (_.nice || _.nice === undefined) {\n v = Math.floor(min / step + eps) * step;\n min = min < v ? v - step : v;\n max = Math.ceil(max / step) * step;\n }\n return {\n start: min,\n stop: max === min ? min + step : max,\n step: step\n };\n}\n\nvar random = Math.random;\nfunction setRandom(r) {\n random = r;\n}\n\nfunction bootstrapCI (array, samples, alpha, f) {\n if (!array.length) return [undefined, undefined];\n const values = Float64Array.from(numbers(array, f)),\n n = values.length,\n m = samples;\n let a, i, j, mu;\n for (j = 0, mu = Array(m); j < m; ++j) {\n for (a = 0, i = 0; i < n; ++i) {\n a += values[~~(random() * n)];\n }\n mu[j] = a / n;\n }\n mu.sort(ascending);\n return [quantile(mu, alpha / 2), quantile(mu, 1 - alpha / 2)];\n}\n\n// Dot density binning for dot plot construction.\n// Based on Leland Wilkinson, Dot Plots, The American Statistician, 1999.\n// https://www.cs.uic.edu/~wilkinson/Publications/dotplots.pdf\nfunction dotbin (array, step, smooth, f) {\n f = f || (_ => _);\n const n = array.length,\n v = new Float64Array(n);\n let i = 0,\n j = 1,\n a = f(array[0]),\n b = a,\n w = a + step,\n x;\n for (; j < n; ++j) {\n x = f(array[j]);\n if (x >= w) {\n b = (a + b) / 2;\n for (; i < j; ++i) v[i] = b;\n w = x + step;\n a = x;\n }\n b = x;\n }\n b = (a + b) / 2;\n for (; i < j; ++i) v[i] = b;\n return smooth ? smoothing(v, step + step / 4) : v;\n}\n\n// perform smoothing to reduce variance\n// swap points between \"adjacent\" stacks\n// Wilkinson defines adjacent as within step/4 units\nfunction smoothing(v, thresh) {\n const n = v.length;\n let a = 0,\n b = 1,\n c,\n d;\n\n // get left stack\n while (v[a] === v[b]) ++b;\n while (b < n) {\n // get right stack\n c = b + 1;\n while (v[b] === v[c]) ++c;\n\n // are stacks adjacent?\n // if so, compare sizes and swap as needed\n if (v[b] - v[b - 1] < thresh) {\n d = b + (a + c - b - b >> 1);\n while (d < b) v[d++] = v[b];\n while (d > b) v[d--] = v[a];\n }\n\n // update left stack indices\n a = b;\n b = c;\n }\n return v;\n}\n\nfunction lcg (seed) {\n // Random numbers using a Linear Congruential Generator with seed value\n // Uses glibc values from https://en.wikipedia.org/wiki/Linear_congruential_generator\n return function () {\n seed = (1103515245 * seed + 12345) % 2147483647;\n return seed / 2147483647;\n };\n}\n\nfunction integer (min, max) {\n if (max == null) {\n max = min;\n min = 0;\n }\n let a, b, d;\n const dist = {\n min(_) {\n if (arguments.length) {\n a = _ || 0;\n d = b - a;\n return dist;\n } else {\n return a;\n }\n },\n max(_) {\n if (arguments.length) {\n b = _ || 0;\n d = b - a;\n return dist;\n } else {\n return b;\n }\n },\n sample() {\n return a + Math.floor(d * random());\n },\n pdf(x) {\n return x === Math.floor(x) && x >= a && x < b ? 1 / d : 0;\n },\n cdf(x) {\n const v = Math.floor(x);\n return v < a ? 0 : v >= b ? 1 : (v - a + 1) / d;\n },\n icdf(p) {\n return p >= 0 && p <= 1 ? a - 1 + Math.floor(p * d) : NaN;\n }\n };\n return dist.min(min).max(max);\n}\n\nconst SQRT2PI = Math.sqrt(2 * Math.PI);\nconst SQRT2 = Math.SQRT2;\n\nlet nextSample = NaN;\nfunction sampleNormal(mean, stdev) {\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n let x = 0,\n y = 0,\n rds,\n c;\n if (nextSample === nextSample) {\n x = nextSample;\n nextSample = NaN;\n } else {\n do {\n x = random() * 2 - 1;\n y = random() * 2 - 1;\n rds = x * x + y * y;\n } while (rds === 0 || rds > 1);\n c = Math.sqrt(-2 * Math.log(rds) / rds); // Box-Muller transform\n x *= c;\n nextSample = y * c;\n }\n return mean + x * stdev;\n}\nfunction densityNormal(value, mean, stdev) {\n stdev = stdev == null ? 1 : stdev;\n const z = (value - (mean || 0)) / stdev;\n return Math.exp(-0.5 * z * z) / (stdev * SQRT2PI);\n}\n\n// Approximation from West (2009)\n// Better Approximations to Cumulative Normal Functions\nfunction cumulativeNormal(value, mean, stdev) {\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n const z = (value - mean) / stdev,\n Z = Math.abs(z);\n let cd;\n if (Z > 37) {\n cd = 0;\n } else {\n const exp = Math.exp(-Z * Z / 2);\n let sum;\n if (Z < 7.07106781186547) {\n sum = 3.52624965998911e-02 * Z + 0.700383064443688;\n sum = sum * Z + 6.37396220353165;\n sum = sum * Z + 33.912866078383;\n sum = sum * Z + 112.079291497871;\n sum = sum * Z + 221.213596169931;\n sum = sum * Z + 220.206867912376;\n cd = exp * sum;\n sum = 8.83883476483184e-02 * Z + 1.75566716318264;\n sum = sum * Z + 16.064177579207;\n sum = sum * Z + 86.7807322029461;\n sum = sum * Z + 296.564248779674;\n sum = sum * Z + 637.333633378831;\n sum = sum * Z + 793.826512519948;\n sum = sum * Z + 440.413735824752;\n cd = cd / sum;\n } else {\n sum = Z + 0.65;\n sum = Z + 4 / sum;\n sum = Z + 3 / sum;\n sum = Z + 2 / sum;\n sum = Z + 1 / sum;\n cd = exp / sum / 2.506628274631;\n }\n }\n return z > 0 ? 1 - cd : cd;\n}\n\n// Approximation of Probit function using inverse error function.\nfunction quantileNormal(p, mean, stdev) {\n if (p < 0 || p > 1) return NaN;\n return (mean || 0) + (stdev == null ? 1 : stdev) * SQRT2 * erfinv(2 * p - 1);\n}\n\n// Approximate inverse error function. Implementation from \"Approximating\n// the erfinv function\" by Mike Giles, GPU Computing Gems, volume 2, 2010.\n// Ported from Apache Commons Math, http://www.apache.org/licenses/LICENSE-2.0\nfunction erfinv(x) {\n // beware that the logarithm argument must be\n // commputed as (1.0 - x) * (1.0 + x),\n // it must NOT be simplified as 1.0 - x * x as this\n // would induce rounding errors near the boundaries +/-1\n let w = -Math.log((1 - x) * (1 + x)),\n p;\n if (w < 6.25) {\n w -= 3.125;\n p = -3.6444120640178196996e-21;\n p = -1.685059138182016589e-19 + p * w;\n p = 1.2858480715256400167e-18 + p * w;\n p = 1.115787767802518096e-17 + p * w;\n p = -1.333171662854620906e-16 + p * w;\n p = 2.0972767875968561637e-17 + p * w;\n p = 6.6376381343583238325e-15 + p * w;\n p = -4.0545662729752068639e-14 + p * w;\n p = -8.1519341976054721522e-14 + p * w;\n p = 2.6335093153082322977e-12 + p * w;\n p = -1.2975133253453532498e-11 + p * w;\n p = -5.4154120542946279317e-11 + p * w;\n p = 1.051212273321532285e-09 + p * w;\n p = -4.1126339803469836976e-09 + p * w;\n p = -2.9070369957882005086e-08 + p * w;\n p = 4.2347877827932403518e-07 + p * w;\n p = -1.3654692000834678645e-06 + p * w;\n p = -1.3882523362786468719e-05 + p * w;\n p = 0.0001867342080340571352 + p * w;\n p = -0.00074070253416626697512 + p * w;\n p = -0.0060336708714301490533 + p * w;\n p = 0.24015818242558961693 + p * w;\n p = 1.6536545626831027356 + p * w;\n } else if (w < 16.0) {\n w = Math.sqrt(w) - 3.25;\n p = 2.2137376921775787049e-09;\n p = 9.0756561938885390979e-08 + p * w;\n p = -2.7517406297064545428e-07 + p * w;\n p = 1.8239629214389227755e-08 + p * w;\n p = 1.5027403968909827627e-06 + p * w;\n p = -4.013867526981545969e-06 + p * w;\n p = 2.9234449089955446044e-06 + p * w;\n p = 1.2475304481671778723e-05 + p * w;\n p = -4.7318229009055733981e-05 + p * w;\n p = 6.8284851459573175448e-05 + p * w;\n p = 2.4031110387097893999e-05 + p * w;\n p = -0.0003550375203628474796 + p * w;\n p = 0.00095328937973738049703 + p * w;\n p = -0.0016882755560235047313 + p * w;\n p = 0.0024914420961078508066 + p * w;\n p = -0.0037512085075692412107 + p * w;\n p = 0.005370914553590063617 + p * w;\n p = 1.0052589676941592334 + p * w;\n p = 3.0838856104922207635 + p * w;\n } else if (Number.isFinite(w)) {\n w = Math.sqrt(w) - 5.0;\n p = -2.7109920616438573243e-11;\n p = -2.5556418169965252055e-10 + p * w;\n p = 1.5076572693500548083e-09 + p * w;\n p = -3.7894654401267369937e-09 + p * w;\n p = 7.6157012080783393804e-09 + p * w;\n p = -1.4960026627149240478e-08 + p * w;\n p = 2.9147953450901080826e-08 + p * w;\n p = -6.7711997758452339498e-08 + p * w;\n p = 2.2900482228026654717e-07 + p * w;\n p = -9.9298272942317002539e-07 + p * w;\n p = 4.5260625972231537039e-06 + p * w;\n p = -1.9681778105531670567e-05 + p * w;\n p = 7.5995277030017761139e-05 + p * w;\n p = -0.00021503011930044477347 + p * w;\n p = -0.00013871931833623122026 + p * w;\n p = 1.0103004648645343977 + p * w;\n p = 4.8499064014085844221 + p * w;\n } else {\n p = Infinity;\n }\n return p * x;\n}\nfunction gaussian (mean, stdev) {\n let mu, sigma;\n const dist = {\n mean(_) {\n if (arguments.length) {\n mu = _ || 0;\n return dist;\n } else {\n return mu;\n }\n },\n stdev(_) {\n if (arguments.length) {\n sigma = _ == null ? 1 : _;\n return dist;\n } else {\n return sigma;\n }\n },\n sample: () => sampleNormal(mu, sigma),\n pdf: value => densityNormal(value, mu, sigma),\n cdf: value => cumulativeNormal(value, mu, sigma),\n icdf: p => quantileNormal(p, mu, sigma)\n };\n return dist.mean(mean).stdev(stdev);\n}\n\nfunction kde (support, bandwidth) {\n const kernel = gaussian();\n let n = 0;\n const dist = {\n data(_) {\n if (arguments.length) {\n support = _;\n n = _ ? _.length : 0;\n return dist.bandwidth(bandwidth);\n } else {\n return support;\n }\n },\n bandwidth(_) {\n if (!arguments.length) return bandwidth;\n bandwidth = _;\n if (!bandwidth && support) bandwidth = estimateBandwidth(support);\n return dist;\n },\n sample() {\n return support[~~(random() * n)] + bandwidth * kernel.sample();\n },\n pdf(x) {\n let y = 0,\n i = 0;\n for (; i < n; ++i) {\n y += kernel.pdf((x - support[i]) / bandwidth);\n }\n return y / bandwidth / n;\n },\n cdf(x) {\n let y = 0,\n i = 0;\n for (; i < n; ++i) {\n y += kernel.cdf((x - support[i]) / bandwidth);\n }\n return y / n;\n },\n icdf() {\n throw Error('KDE icdf not supported.');\n }\n };\n return dist.data(support);\n}\n\nfunction sampleLogNormal(mean, stdev) {\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n return Math.exp(mean + sampleNormal() * stdev);\n}\nfunction densityLogNormal(value, mean, stdev) {\n if (value <= 0) return 0;\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n const z = (Math.log(value) - mean) / stdev;\n return Math.exp(-0.5 * z * z) / (stdev * SQRT2PI * value);\n}\nfunction cumulativeLogNormal(value, mean, stdev) {\n return cumulativeNormal(Math.log(value), mean, stdev);\n}\nfunction quantileLogNormal(p, mean, stdev) {\n return Math.exp(quantileNormal(p, mean, stdev));\n}\nfunction lognormal (mean, stdev) {\n let mu, sigma;\n const dist = {\n mean(_) {\n if (arguments.length) {\n mu = _ || 0;\n return dist;\n } else {\n return mu;\n }\n },\n stdev(_) {\n if (arguments.length) {\n sigma = _ == null ? 1 : _;\n return dist;\n } else {\n return sigma;\n }\n },\n sample: () => sampleLogNormal(mu, sigma),\n pdf: value => densityLogNormal(value, mu, sigma),\n cdf: value => cumulativeLogNormal(value, mu, sigma),\n icdf: p => quantileLogNormal(p, mu, sigma)\n };\n return dist.mean(mean).stdev(stdev);\n}\n\nfunction mixture (dists, weights) {\n let m = 0,\n w;\n function normalize(x) {\n const w = [];\n let sum = 0,\n i;\n for (i = 0; i < m; ++i) {\n sum += w[i] = x[i] == null ? 1 : +x[i];\n }\n for (i = 0; i < m; ++i) {\n w[i] /= sum;\n }\n return w;\n }\n const dist = {\n weights(_) {\n if (arguments.length) {\n w = normalize(weights = _ || []);\n return dist;\n }\n return weights;\n },\n distributions(_) {\n if (arguments.length) {\n if (_) {\n m = _.length;\n dists = _;\n } else {\n m = 0;\n dists = [];\n }\n return dist.weights(weights);\n }\n return dists;\n },\n sample() {\n const r = random();\n let d = dists[m - 1],\n v = w[0],\n i = 0;\n\n // first select distribution\n for (; i < m - 1; v += w[++i]) {\n if (r < v) {\n d = dists[i];\n break;\n }\n }\n // then sample from it\n return d.sample();\n },\n pdf(x) {\n let p = 0,\n i = 0;\n for (; i < m; ++i) {\n p += w[i] * dists[i].pdf(x);\n }\n return p;\n },\n cdf(x) {\n let p = 0,\n i = 0;\n for (; i < m; ++i) {\n p += w[i] * dists[i].cdf(x);\n }\n return p;\n },\n icdf() {\n throw Error('Mixture icdf not supported.');\n }\n };\n return dist.distributions(dists).weights(weights);\n}\n\nfunction sampleUniform(min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return min + (max - min) * random();\n}\nfunction densityUniform(value, min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return value >= min && value <= max ? 1 / (max - min) : 0;\n}\nfunction cumulativeUniform(value, min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return value < min ? 0 : value > max ? 1 : (value - min) / (max - min);\n}\nfunction quantileUniform(p, min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return p >= 0 && p <= 1 ? min + p * (max - min) : NaN;\n}\nfunction uniform (min, max) {\n let a, b;\n const dist = {\n min(_) {\n if (arguments.length) {\n a = _ || 0;\n return dist;\n } else {\n return a;\n }\n },\n max(_) {\n if (arguments.length) {\n b = _ == null ? 1 : _;\n return dist;\n } else {\n return b;\n }\n },\n sample: () => sampleUniform(a, b),\n pdf: value => densityUniform(value, a, b),\n cdf: value => cumulativeUniform(value, a, b),\n icdf: p => quantileUniform(p, a, b)\n };\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return dist.min(min).max(max);\n}\n\n// Ordinary Least Squares\nfunction ols (uX, uY, uXY, uX2) {\n const delta = uX2 - uX * uX,\n slope = Math.abs(delta) < 1e-24 ? 0 : (uXY - uX * uY) / delta,\n intercept = uY - slope * uX;\n return [intercept, slope];\n}\n\nfunction points(data, x, y, sort) {\n data = data.filter(d => {\n let u = x(d),\n v = y(d);\n return u != null && (u = +u) >= u && v != null && (v = +v) >= v;\n });\n if (sort) {\n data.sort((a, b) => x(a) - x(b));\n }\n const n = data.length,\n X = new Float64Array(n),\n Y = new Float64Array(n);\n\n // extract values, calculate means\n let i = 0,\n ux = 0,\n uy = 0,\n xv,\n yv,\n d;\n for (d of data) {\n X[i] = xv = +x(d);\n Y[i] = yv = +y(d);\n ++i;\n ux += (xv - ux) / i;\n uy += (yv - uy) / i;\n }\n\n // mean center the data\n for (i = 0; i < n; ++i) {\n X[i] -= ux;\n Y[i] -= uy;\n }\n return [X, Y, ux, uy];\n}\nfunction visitPoints(data, x, y, callback) {\n let i = -1,\n u,\n v;\n for (const d of data) {\n u = x(d);\n v = y(d);\n if (u != null && (u = +u) >= u && v != null && (v = +v) >= v) {\n callback(u, v, ++i);\n }\n }\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\nfunction rSquared (data, x, y, uY, predict) {\n let SSE = 0,\n SST = 0;\n visitPoints(data, x, y, (dx, dy) => {\n const sse = dy - predict(dx),\n sst = dy - uY;\n SSE += sse * sse;\n SST += sst * sst;\n });\n return 1 - SSE / SST;\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\nfunction linear (data, x, y) {\n let X = 0,\n Y = 0,\n XY = 0,\n X2 = 0,\n n = 0;\n visitPoints(data, x, y, (dx, dy) => {\n ++n;\n X += (dx - X) / n;\n Y += (dy - Y) / n;\n XY += (dx * dy - XY) / n;\n X2 += (dx * dx - X2) / n;\n });\n const coef = ols(X, Y, XY, X2),\n predict = x => coef[0] + coef[1] * x;\n return {\n coef: coef,\n predict: predict,\n rSquared: rSquared(data, x, y, Y, predict)\n };\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\nfunction log (data, x, y) {\n let X = 0,\n Y = 0,\n XY = 0,\n X2 = 0,\n n = 0;\n visitPoints(data, x, y, (dx, dy) => {\n ++n;\n dx = Math.log(dx);\n X += (dx - X) / n;\n Y += (dy - Y) / n;\n XY += (dx * dy - XY) / n;\n X2 += (dx * dx - X2) / n;\n });\n const coef = ols(X, Y, XY, X2),\n predict = x => coef[0] + coef[1] * Math.log(x);\n return {\n coef: coef,\n predict: predict,\n rSquared: rSquared(data, x, y, Y, predict)\n };\n}\n\nfunction exp (data, x, y) {\n // eslint-disable-next-line no-unused-vars\n const [xv, yv, ux, uy] = points(data, x, y);\n let YL = 0,\n XY = 0,\n XYL = 0,\n X2Y = 0,\n n = 0,\n dx,\n ly,\n xy;\n visitPoints(data, x, y, (_, dy) => {\n dx = xv[n++];\n ly = Math.log(dy);\n xy = dx * dy;\n YL += (dy * ly - YL) / n;\n XY += (xy - XY) / n;\n XYL += (xy * ly - XYL) / n;\n X2Y += (dx * xy - X2Y) / n;\n });\n const [c0, c1] = ols(XY / uy, YL / uy, XYL / uy, X2Y / uy),\n predict = x => Math.exp(c0 + c1 * (x - ux));\n return {\n coef: [Math.exp(c0 - c1 * ux), c1],\n predict: predict,\n rSquared: rSquared(data, x, y, uy, predict)\n };\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\nfunction pow (data, x, y) {\n let X = 0,\n Y = 0,\n XY = 0,\n X2 = 0,\n YS = 0,\n n = 0;\n visitPoints(data, x, y, (dx, dy) => {\n const lx = Math.log(dx),\n ly = Math.log(dy);\n ++n;\n X += (lx - X) / n;\n Y += (ly - Y) / n;\n XY += (lx * ly - XY) / n;\n X2 += (lx * lx - X2) / n;\n YS += (dy - YS) / n;\n });\n const coef = ols(X, Y, XY, X2),\n predict = x => coef[0] * Math.pow(x, coef[1]);\n coef[0] = Math.exp(coef[0]);\n return {\n coef: coef,\n predict: predict,\n rSquared: rSquared(data, x, y, YS, predict)\n };\n}\n\nfunction quad (data, x, y) {\n const [xv, yv, ux, uy] = points(data, x, y),\n n = xv.length;\n let X2 = 0,\n X3 = 0,\n X4 = 0,\n XY = 0,\n X2Y = 0,\n i,\n dx,\n dy,\n x2;\n for (i = 0; i < n;) {\n dx = xv[i];\n dy = yv[i++];\n x2 = dx * dx;\n X2 += (x2 - X2) / i;\n X3 += (x2 * dx - X3) / i;\n X4 += (x2 * x2 - X4) / i;\n XY += (dx * dy - XY) / i;\n X2Y += (x2 * dy - X2Y) / i;\n }\n const X2X2 = X4 - X2 * X2,\n d = X2 * X2X2 - X3 * X3,\n a = (X2Y * X2 - XY * X3) / d,\n b = (XY * X2X2 - X2Y * X3) / d,\n c = -a * X2,\n predict = x => {\n x = x - ux;\n return a * x * x + b * x + c + uy;\n };\n\n // transform coefficients back from mean-centered space\n return {\n coef: [c - b * ux + a * ux * ux + uy, b - 2 * a * ux, a],\n predict: predict,\n rSquared: rSquared(data, x, y, uy, predict)\n };\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\n// ... which was adapted from regression-js by Tom Alexander\n// Source: https://github.com/Tom-Alexander/regression-js/blob/master/src/regression.js#L246\n// License: https://github.com/Tom-Alexander/regression-js/blob/master/LICENSE\nfunction poly (data, x, y, order) {\n // use more efficient methods for lower orders\n if (order === 1) return linear(data, x, y);\n if (order === 2) return quad(data, x, y);\n const [xv, yv, ux, uy] = points(data, x, y),\n n = xv.length,\n lhs = [],\n rhs = [],\n k = order + 1;\n let i, j, l, v, c;\n for (i = 0; i < k; ++i) {\n for (l = 0, v = 0; l < n; ++l) {\n v += Math.pow(xv[l], i) * yv[l];\n }\n lhs.push(v);\n c = new Float64Array(k);\n for (j = 0; j < k; ++j) {\n for (l = 0, v = 0; l < n; ++l) {\n v += Math.pow(xv[l], i + j);\n }\n c[j] = v;\n }\n rhs.push(c);\n }\n rhs.push(lhs);\n const coef = gaussianElimination(rhs),\n predict = x => {\n x -= ux;\n let y = uy + coef[0] + coef[1] * x + coef[2] * x * x;\n for (i = 3; i < k; ++i) y += coef[i] * Math.pow(x, i);\n return y;\n };\n return {\n coef: uncenter(k, coef, -ux, uy),\n predict: predict,\n rSquared: rSquared(data, x, y, uy, predict)\n };\n}\nfunction uncenter(k, a, x, y) {\n const z = Array(k);\n let i, j, v, c;\n\n // initialize to zero\n for (i = 0; i < k; ++i) z[i] = 0;\n\n // polynomial expansion\n for (i = k - 1; i >= 0; --i) {\n v = a[i];\n c = 1;\n z[i] += v;\n for (j = 1; j <= i; ++j) {\n c *= (i + 1 - j) / j; // binomial coefficent\n z[i - j] += v * Math.pow(x, j) * c;\n }\n }\n\n // bias term\n z[0] += y;\n return z;\n}\n\n// Given an array for a two-dimensional matrix and the polynomial order,\n// solve A * x = b using Gaussian elimination.\nfunction gaussianElimination(matrix) {\n const n = matrix.length - 1,\n coef = [];\n let i, j, k, r, t;\n for (i = 0; i < n; ++i) {\n r = i; // max row\n for (j = i + 1; j < n; ++j) {\n if (Math.abs(matrix[i][j]) > Math.abs(matrix[i][r])) {\n r = j;\n }\n }\n for (k = i; k < n + 1; ++k) {\n t = matrix[k][i];\n matrix[k][i] = matrix[k][r];\n matrix[k][r] = t;\n }\n for (j = i + 1; j < n; ++j) {\n for (k = n; k >= i; k--) {\n matrix[k][j] -= matrix[k][i] * matrix[i][j] / matrix[i][i];\n }\n }\n }\n for (j = n - 1; j >= 0; --j) {\n t = 0;\n for (k = j + 1; k < n; ++k) {\n t += matrix[k][j] * coef[k];\n }\n coef[j] = (matrix[n][j] - t) / matrix[j][j];\n }\n return coef;\n}\n\nconst maxiters = 2,\n epsilon = 1e-12;\n\n// Adapted from science.js by Jason Davies\n// Source: https://github.com/jasondavies/science.js/blob/master/src/stats/loess.js\n// License: https://github.com/jasondavies/science.js/blob/master/LICENSE\nfunction loess (data, x, y, bandwidth) {\n const [xv, yv, ux, uy] = points(data, x, y, true),\n n = xv.length,\n bw = Math.max(2, ~~(bandwidth * n)),\n // # nearest neighbors\n yhat = new Float64Array(n),\n residuals = new Float64Array(n),\n robustWeights = new Float64Array(n).fill(1);\n for (let iter = -1; ++iter <= maxiters;) {\n const interval = [0, bw - 1];\n for (let i = 0; i < n; ++i) {\n const dx = xv[i],\n i0 = interval[0],\n i1 = interval[1],\n edge = dx - xv[i0] > xv[i1] - dx ? i0 : i1;\n let W = 0,\n X = 0,\n Y = 0,\n XY = 0,\n X2 = 0;\n const denom = 1 / Math.abs(xv[edge] - dx || 1); // avoid singularity!\n\n for (let k = i0; k <= i1; ++k) {\n const xk = xv[k],\n yk = yv[k],\n w = tricube(Math.abs(dx - xk) * denom) * robustWeights[k],\n xkw = xk * w;\n W += w;\n X += xkw;\n Y += yk * w;\n XY += yk * xkw;\n X2 += xk * xkw;\n }\n\n // linear regression fit\n const [a, b] = ols(X / W, Y / W, XY / W, X2 / W);\n yhat[i] = a + b * dx;\n residuals[i] = Math.abs(yv[i] - yhat[i]);\n updateInterval(xv, i + 1, interval);\n }\n if (iter === maxiters) {\n break;\n }\n const medianResidual = median(residuals);\n if (Math.abs(medianResidual) < epsilon) break;\n for (let i = 0, arg, w; i < n; ++i) {\n arg = residuals[i] / (6 * medianResidual);\n // default to epsilon (rather than zero) for large deviations\n // keeping weights tiny but non-zero prevents singularites\n robustWeights[i] = arg >= 1 ? epsilon : (w = 1 - arg * arg) * w;\n }\n }\n return output(xv, yhat, ux, uy);\n}\n\n// weighting kernel for local regression\nfunction tricube(x) {\n return (x = 1 - x * x * x) * x * x;\n}\n\n// advance sliding window interval of nearest neighbors\nfunction updateInterval(xv, i, interval) {\n const val = xv[i];\n let left = interval[0],\n right = interval[1] + 1;\n if (right >= xv.length) return;\n\n // step right if distance to new right edge is <= distance to old left edge\n // step when distance is equal to ensure movement over duplicate x values\n while (i > left && xv[right] - val <= val - xv[left]) {\n interval[0] = ++left;\n interval[1] = right;\n ++right;\n }\n}\n\n// generate smoothed output points\n// average points with repeated x values\nfunction output(xv, yhat, ux, uy) {\n const n = xv.length,\n out = [];\n let i = 0,\n cnt = 0,\n prev = [],\n v;\n for (; i < n; ++i) {\n v = xv[i] + ux;\n if (prev[0] === v) {\n // average output values via online update\n prev[1] += (yhat[i] - prev[1]) / ++cnt;\n } else {\n // add new output point\n cnt = 0;\n prev[1] += uy;\n prev = [v, yhat[i]];\n out.push(prev);\n }\n }\n prev[1] += uy;\n return out;\n}\n\n// subdivide up to accuracy of 0.5 degrees\nconst MIN_RADIANS = 0.5 * Math.PI / 180;\n\n// Adaptively sample an interpolated function over a domain extent\nfunction sampleCurve (f, extent, minSteps, maxSteps) {\n minSteps = minSteps || 25;\n maxSteps = Math.max(minSteps, maxSteps || 200);\n const point = x => [x, f(x)],\n minX = extent[0],\n maxX = extent[1],\n span = maxX - minX,\n stop = span / maxSteps,\n prev = [point(minX)],\n next = [];\n if (minSteps === maxSteps) {\n // no adaptation, sample uniform grid directly and return\n for (let i = 1; i < maxSteps; ++i) {\n prev.push(point(minX + i / minSteps * span));\n }\n prev.push(point(maxX));\n return prev;\n } else {\n // sample minimum points on uniform grid\n // then move on to perform adaptive refinement\n next.push(point(maxX));\n for (let i = minSteps; --i > 0;) {\n next.push(point(minX + i / minSteps * span));\n }\n }\n let p0 = prev[0];\n let p1 = next[next.length - 1];\n const sx = 1 / span;\n const sy = scaleY(p0[1], next);\n while (p1) {\n // midpoint for potential curve subdivision\n const pm = point((p0[0] + p1[0]) / 2);\n const dx = pm[0] - p0[0] >= stop;\n if (dx && angleDelta(p0, pm, p1, sx, sy) > MIN_RADIANS) {\n // maximum resolution has not yet been met, and\n // subdivision midpoint is sufficiently different from endpoint\n // save subdivision, push midpoint onto the visitation stack\n next.push(pm);\n } else {\n // subdivision midpoint sufficiently similar to endpoint\n // skip subdivision, store endpoint, move to next point on the stack\n p0 = p1;\n prev.push(p1);\n next.pop();\n }\n p1 = next[next.length - 1];\n }\n return prev;\n}\nfunction scaleY(init, points) {\n let ymin = init;\n let ymax = init;\n const n = points.length;\n for (let i = 0; i < n; ++i) {\n const y = points[i][1];\n if (y < ymin) ymin = y;\n if (y > ymax) ymax = y;\n }\n return 1 / (ymax - ymin);\n}\nfunction angleDelta(p, q, r, sx, sy) {\n const a0 = Math.atan2(sy * (r[1] - p[1]), sx * (r[0] - p[0])),\n a1 = Math.atan2(sy * (q[1] - p[1]), sx * (q[0] - p[0]));\n return Math.abs(a0 - a1);\n}\n\nexport { estimateBandwidth as bandwidthNRD, bin, bootstrapCI, cumulativeLogNormal, cumulativeNormal, cumulativeUniform, densityLogNormal, densityNormal, densityUniform, dotbin, quantileLogNormal, quantileNormal, quantileUniform, quantiles, quartiles, random, integer as randomInteger, kde as randomKDE, lcg as randomLCG, lognormal as randomLogNormal, mixture as randomMixture, gaussian as randomNormal, uniform as randomUniform, exp as regressionExp, linear as regressionLinear, loess as regressionLoess, log as regressionLog, poly as regressionPoly, pow as regressionPow, quad as regressionQuad, sampleCurve, sampleLogNormal, sampleNormal, sampleUniform, setRandom };\n","import variance from \"./variance.js\";\n\nexport default function deviation(values, valueof) {\n const v = variance(values, valueof);\n return v ? Math.sqrt(v) : v;\n}\n","export default function variance(values, valueof) {\n let count = 0;\n let delta;\n let mean = 0;\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n delta = value - mean;\n mean += delta / ++count;\n sum += delta * (value - mean);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n delta = value - mean;\n mean += delta / ++count;\n sum += delta * (value - mean);\n }\n }\n }\n if (count > 1) return sum / (count - 1);\n}\n","export default function range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","import { extend, identity, field, hasOwnProperty, extentIndex, inherits, array, accessorName, error, accessorFields, accessor, toNumber, merge, compare, truthy, extent, span, fastmap, isArray, key, ascending, peek, zero, constant } from 'vega-util';\nimport { tupleid, Transform, replace, ingest, stableCompare, Operator, derive, rederive } from 'vega-dataflow';\nimport { quartiles, bootstrapCI, bin, randomKDE, randomMixture, randomNormal, randomLogNormal, randomUniform, sampleCurve, dotbin, quantiles, random } from 'vega-statistics';\nimport { median, mean, min, max, range, bisector } from 'd3-array';\nimport { TIME_UNITS, utcInterval, timeInterval, timeBin, timeUnits, utcFloor, timeFloor } from 'vega-time';\n\nfunction multikey(f) {\n return x => {\n const n = f.length;\n let i = 1,\n k = String(f[0](x));\n for (; i < n; ++i) {\n k += '|' + f[i](x);\n }\n return k;\n };\n}\nfunction groupkey(fields) {\n return !fields || !fields.length ? function () {\n return '';\n } : fields.length === 1 ? fields[0] : multikey(fields);\n}\n\nfunction measureName(op, field, as) {\n return as || op + (!field ? '' : '_' + field);\n}\nconst noop = () => {};\nconst base_op = {\n init: noop,\n add: noop,\n rem: noop,\n idx: 0\n};\nconst AggregateOps = {\n values: {\n init: m => m.cell.store = true,\n value: m => m.cell.data.values(),\n idx: -1\n },\n count: {\n value: m => m.cell.num\n },\n __count__: {\n value: m => m.missing + m.valid\n },\n missing: {\n value: m => m.missing\n },\n valid: {\n value: m => m.valid\n },\n sum: {\n init: m => m.sum = 0,\n value: m => m.sum,\n add: (m, v) => m.sum += +v,\n rem: (m, v) => m.sum -= v\n },\n product: {\n init: m => m.product = 1,\n value: m => m.valid ? m.product : undefined,\n add: (m, v) => m.product *= v,\n rem: (m, v) => m.product /= v\n },\n mean: {\n init: m => m.mean = 0,\n value: m => m.valid ? m.mean : undefined,\n add: (m, v) => (m.mean_d = v - m.mean, m.mean += m.mean_d / m.valid),\n rem: (m, v) => (m.mean_d = v - m.mean, m.mean -= m.valid ? m.mean_d / m.valid : m.mean)\n },\n average: {\n value: m => m.valid ? m.mean : undefined,\n req: ['mean'],\n idx: 1\n },\n variance: {\n init: m => m.dev = 0,\n value: m => m.valid > 1 ? m.dev / (m.valid - 1) : undefined,\n add: (m, v) => m.dev += m.mean_d * (v - m.mean),\n rem: (m, v) => m.dev -= m.mean_d * (v - m.mean),\n req: ['mean'],\n idx: 1\n },\n variancep: {\n value: m => m.valid > 1 ? m.dev / m.valid : undefined,\n req: ['variance'],\n idx: 2\n },\n stdev: {\n value: m => m.valid > 1 ? Math.sqrt(m.dev / (m.valid - 1)) : undefined,\n req: ['variance'],\n idx: 2\n },\n stdevp: {\n value: m => m.valid > 1 ? Math.sqrt(m.dev / m.valid) : undefined,\n req: ['variance'],\n idx: 2\n },\n stderr: {\n value: m => m.valid > 1 ? Math.sqrt(m.dev / (m.valid * (m.valid - 1))) : undefined,\n req: ['variance'],\n idx: 2\n },\n distinct: {\n value: m => m.cell.data.distinct(m.get),\n req: ['values'],\n idx: 3\n },\n ci0: {\n value: m => m.cell.data.ci0(m.get),\n req: ['values'],\n idx: 3\n },\n ci1: {\n value: m => m.cell.data.ci1(m.get),\n req: ['values'],\n idx: 3\n },\n median: {\n value: m => m.cell.data.q2(m.get),\n req: ['values'],\n idx: 3\n },\n q1: {\n value: m => m.cell.data.q1(m.get),\n req: ['values'],\n idx: 3\n },\n q3: {\n value: m => m.cell.data.q3(m.get),\n req: ['values'],\n idx: 3\n },\n min: {\n init: m => m.min = undefined,\n value: m => m.min = Number.isNaN(m.min) ? m.cell.data.min(m.get) : m.min,\n add: (m, v) => {\n if (v < m.min || m.min === undefined) m.min = v;\n },\n rem: (m, v) => {\n if (v <= m.min) m.min = NaN;\n },\n req: ['values'],\n idx: 4\n },\n max: {\n init: m => m.max = undefined,\n value: m => m.max = Number.isNaN(m.max) ? m.cell.data.max(m.get) : m.max,\n add: (m, v) => {\n if (v > m.max || m.max === undefined) m.max = v;\n },\n rem: (m, v) => {\n if (v >= m.max) m.max = NaN;\n },\n req: ['values'],\n idx: 4\n },\n argmin: {\n init: m => m.argmin = undefined,\n value: m => m.argmin || m.cell.data.argmin(m.get),\n add: (m, v, t) => {\n if (v < m.min) m.argmin = t;\n },\n rem: (m, v) => {\n if (v <= m.min) m.argmin = undefined;\n },\n req: ['min', 'values'],\n idx: 3\n },\n argmax: {\n init: m => m.argmax = undefined,\n value: m => m.argmax || m.cell.data.argmax(m.get),\n add: (m, v, t) => {\n if (v > m.max) m.argmax = t;\n },\n rem: (m, v) => {\n if (v >= m.max) m.argmax = undefined;\n },\n req: ['max', 'values'],\n idx: 3\n }\n};\nconst ValidAggregateOps = Object.keys(AggregateOps).filter(d => d !== '__count__');\nfunction measure(key, value) {\n return out => extend({\n name: key,\n out: out || key\n }, base_op, value);\n}\n[...ValidAggregateOps, '__count__'].forEach(key => {\n AggregateOps[key] = measure(key, AggregateOps[key]);\n});\nfunction createMeasure(op, name) {\n return AggregateOps[op](name);\n}\nfunction compareIndex(a, b) {\n return a.idx - b.idx;\n}\nfunction resolve(agg) {\n const map = {};\n agg.forEach(a => map[a.name] = a);\n const getreqs = a => {\n if (!a.req) return;\n a.req.forEach(key => {\n if (!map[key]) getreqs(map[key] = AggregateOps[key]());\n });\n };\n agg.forEach(getreqs);\n return Object.values(map).sort(compareIndex);\n}\nfunction init() {\n this.valid = 0;\n this.missing = 0;\n this._ops.forEach(op => op.init(this));\n}\nfunction add(v, t) {\n if (v == null || v === '') {\n ++this.missing;\n return;\n }\n if (v !== v) return;\n ++this.valid;\n this._ops.forEach(op => op.add(this, v, t));\n}\nfunction rem(v, t) {\n if (v == null || v === '') {\n --this.missing;\n return;\n }\n if (v !== v) return;\n --this.valid;\n this._ops.forEach(op => op.rem(this, v, t));\n}\nfunction set(t) {\n this._out.forEach(op => t[op.out] = op.value(this));\n return t;\n}\nfunction compileMeasures(agg, field) {\n const get = field || identity,\n ops = resolve(agg),\n out = agg.slice().sort(compareIndex);\n function ctr(cell) {\n this._ops = ops;\n this._out = out;\n this.cell = cell;\n this.init();\n }\n ctr.prototype.init = init;\n ctr.prototype.add = add;\n ctr.prototype.rem = rem;\n ctr.prototype.set = set;\n ctr.prototype.get = get;\n ctr.fields = agg.map(op => op.out);\n return ctr;\n}\n\nfunction TupleStore(key) {\n this._key = key ? field(key) : tupleid;\n this.reset();\n}\nconst prototype$1 = TupleStore.prototype;\nprototype$1.reset = function () {\n this._add = [];\n this._rem = [];\n this._ext = null;\n this._get = null;\n this._q = null;\n};\nprototype$1.add = function (v) {\n this._add.push(v);\n};\nprototype$1.rem = function (v) {\n this._rem.push(v);\n};\nprototype$1.values = function () {\n this._get = null;\n if (this._rem.length === 0) return this._add;\n const a = this._add,\n r = this._rem,\n k = this._key,\n n = a.length,\n m = r.length,\n x = Array(n - m),\n map = {};\n let i, j, v;\n\n // use unique key field to clear removed values\n for (i = 0; i < m; ++i) {\n map[k(r[i])] = 1;\n }\n for (i = 0, j = 0; i < n; ++i) {\n if (map[k(v = a[i])]) {\n map[k(v)] = 0;\n } else {\n x[j++] = v;\n }\n }\n this._rem = [];\n return this._add = x;\n};\n\n// memoizing statistics methods\n\nprototype$1.distinct = function (get) {\n const v = this.values(),\n map = {};\n let n = v.length,\n count = 0,\n s;\n while (--n >= 0) {\n s = get(v[n]) + '';\n if (!hasOwnProperty(map, s)) {\n map[s] = 1;\n ++count;\n }\n }\n return count;\n};\nprototype$1.extent = function (get) {\n if (this._get !== get || !this._ext) {\n const v = this.values(),\n i = extentIndex(v, get);\n this._ext = [v[i[0]], v[i[1]]];\n this._get = get;\n }\n return this._ext;\n};\nprototype$1.argmin = function (get) {\n return this.extent(get)[0] || {};\n};\nprototype$1.argmax = function (get) {\n return this.extent(get)[1] || {};\n};\nprototype$1.min = function (get) {\n const m = this.extent(get)[0];\n return m != null ? get(m) : undefined;\n};\nprototype$1.max = function (get) {\n const m = this.extent(get)[1];\n return m != null ? get(m) : undefined;\n};\nprototype$1.quartile = function (get) {\n if (this._get !== get || !this._q) {\n this._q = quartiles(this.values(), get);\n this._get = get;\n }\n return this._q;\n};\nprototype$1.q1 = function (get) {\n return this.quartile(get)[0];\n};\nprototype$1.q2 = function (get) {\n return this.quartile(get)[1];\n};\nprototype$1.q3 = function (get) {\n return this.quartile(get)[2];\n};\nprototype$1.ci = function (get) {\n if (this._get !== get || !this._ci) {\n this._ci = bootstrapCI(this.values(), 1000, 0.05, get);\n this._get = get;\n }\n return this._ci;\n};\nprototype$1.ci0 = function (get) {\n return this.ci(get)[0];\n};\nprototype$1.ci1 = function (get) {\n return this.ci(get)[1];\n};\n\n/**\n * Group-by aggregation operator.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {Array} [params.fields] - An array of accessors to aggregate.\n * @param {Array} [params.ops] - An array of strings indicating aggregation operations.\n * @param {Array} [params.as] - An array of output field names for aggregated values.\n * @param {boolean} [params.cross=false] - A flag indicating that the full\n * cross-product of groupby values should be generated, including empty cells.\n * If true, the drop parameter is ignored and empty cells are retained.\n * @param {boolean} [params.drop=true] - A flag indicating if empty cells should be removed.\n */\nfunction Aggregate(params) {\n Transform.call(this, null, params);\n this._adds = []; // array of added output tuples\n this._mods = []; // array of modified output tuples\n this._alen = 0; // number of active added tuples\n this._mlen = 0; // number of active modified tuples\n this._drop = true; // should empty aggregation cells be removed\n this._cross = false; // produce full cross-product of group-by values\n\n this._dims = []; // group-by dimension accessors\n this._dnames = []; // group-by dimension names\n\n this._measures = []; // collection of aggregation monoids\n this._countOnly = false; // flag indicating only count aggregation\n this._counts = null; // collection of count fields\n this._prev = null; // previous aggregation cells\n\n this._inputs = null; // array of dependent input tuple field names\n this._outputs = null; // array of output tuple field names\n}\n\nAggregate.Definition = {\n 'type': 'Aggregate',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'ops',\n 'type': 'enum',\n 'array': true,\n 'values': ValidAggregateOps\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'null': true,\n 'array': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }, {\n 'name': 'drop',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'cross',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'key',\n 'type': 'field'\n }]\n};\ninherits(Aggregate, Transform, {\n transform(_, pulse) {\n const aggr = this,\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n mod = _.modified();\n aggr.stamp = out.stamp;\n if (aggr.value && (mod || pulse.modified(aggr._inputs, true))) {\n aggr._prev = aggr.value;\n aggr.value = mod ? aggr.init(_) : {};\n pulse.visit(pulse.SOURCE, t => aggr.add(t));\n } else {\n aggr.value = aggr.value || aggr.init(_);\n pulse.visit(pulse.REM, t => aggr.rem(t));\n pulse.visit(pulse.ADD, t => aggr.add(t));\n }\n\n // Indicate output fields and return aggregate tuples.\n out.modifies(aggr._outputs);\n\n // Should empty cells be dropped?\n aggr._drop = _.drop !== false;\n\n // If domain cross-product requested, generate empty cells as needed\n // and ensure that empty cells are not dropped\n if (_.cross && aggr._dims.length > 1) {\n aggr._drop = false;\n aggr.cross();\n }\n if (pulse.clean() && aggr._drop) {\n out.clean(true).runAfter(() => this.clean());\n }\n return aggr.changes(out);\n },\n cross() {\n const aggr = this,\n curr = aggr.value,\n dims = aggr._dnames,\n vals = dims.map(() => ({})),\n n = dims.length;\n\n // collect all group-by domain values\n function collect(cells) {\n let key, i, t, v;\n for (key in cells) {\n t = cells[key].tuple;\n for (i = 0; i < n; ++i) {\n vals[i][v = t[dims[i]]] = v;\n }\n }\n }\n collect(aggr._prev);\n collect(curr);\n\n // iterate over key cross-product, create cells as needed\n function generate(base, tuple, index) {\n const name = dims[index],\n v = vals[index++];\n for (const k in v) {\n const key = base ? base + '|' + k : k;\n tuple[name] = v[k];\n if (index < n) generate(key, tuple, index);else if (!curr[key]) aggr.cell(key, tuple);\n }\n }\n generate('', {}, 0);\n },\n init(_) {\n // initialize input and output fields\n const inputs = this._inputs = [],\n outputs = this._outputs = [],\n inputMap = {};\n function inputVisit(get) {\n const fields = array(accessorFields(get)),\n n = fields.length;\n let i = 0,\n f;\n for (; i < n; ++i) {\n if (!inputMap[f = fields[i]]) {\n inputMap[f] = 1;\n inputs.push(f);\n }\n }\n }\n\n // initialize group-by dimensions\n this._dims = array(_.groupby);\n this._dnames = this._dims.map(d => {\n const dname = accessorName(d);\n inputVisit(d);\n outputs.push(dname);\n return dname;\n });\n this.cellkey = _.key ? _.key : groupkey(this._dims);\n\n // initialize aggregate measures\n this._countOnly = true;\n this._counts = [];\n this._measures = [];\n const fields = _.fields || [null],\n ops = _.ops || ['count'],\n as = _.as || [],\n n = fields.length,\n map = {};\n let field, op, m, mname, outname, i;\n if (n !== ops.length) {\n error('Unmatched number of fields and aggregate ops.');\n }\n for (i = 0; i < n; ++i) {\n field = fields[i];\n op = ops[i];\n if (field == null && op !== 'count') {\n error('Null aggregate field specified.');\n }\n mname = accessorName(field);\n outname = measureName(op, mname, as[i]);\n outputs.push(outname);\n if (op === 'count') {\n this._counts.push(outname);\n continue;\n }\n m = map[mname];\n if (!m) {\n inputVisit(field);\n m = map[mname] = [];\n m.field = field;\n this._measures.push(m);\n }\n if (op !== 'count') this._countOnly = false;\n m.push(createMeasure(op, outname));\n }\n this._measures = this._measures.map(m => compileMeasures(m, m.field));\n return {}; // aggregation cells (this.value)\n },\n\n // -- Cell Management -----\n\n cellkey: groupkey(),\n cell(key, t) {\n let cell = this.value[key];\n if (!cell) {\n cell = this.value[key] = this.newcell(key, t);\n this._adds[this._alen++] = cell;\n } else if (cell.num === 0 && this._drop && cell.stamp < this.stamp) {\n cell.stamp = this.stamp;\n this._adds[this._alen++] = cell;\n } else if (cell.stamp < this.stamp) {\n cell.stamp = this.stamp;\n this._mods[this._mlen++] = cell;\n }\n return cell;\n },\n newcell(key, t) {\n const cell = {\n key: key,\n num: 0,\n agg: null,\n tuple: this.newtuple(t, this._prev && this._prev[key]),\n stamp: this.stamp,\n store: false\n };\n if (!this._countOnly) {\n const measures = this._measures,\n n = measures.length;\n cell.agg = Array(n);\n for (let i = 0; i < n; ++i) {\n cell.agg[i] = new measures[i](cell);\n }\n }\n if (cell.store) {\n cell.data = new TupleStore();\n }\n return cell;\n },\n newtuple(t, p) {\n const names = this._dnames,\n dims = this._dims,\n n = dims.length,\n x = {};\n for (let i = 0; i < n; ++i) {\n x[names[i]] = dims[i](t);\n }\n return p ? replace(p.tuple, x) : ingest(x);\n },\n clean() {\n const cells = this.value;\n for (const key in cells) {\n if (cells[key].num === 0) {\n delete cells[key];\n }\n }\n },\n // -- Process Tuples -----\n\n add(t) {\n const key = this.cellkey(t),\n cell = this.cell(key, t);\n cell.num += 1;\n if (this._countOnly) return;\n if (cell.store) cell.data.add(t);\n const agg = cell.agg;\n for (let i = 0, n = agg.length; i < n; ++i) {\n agg[i].add(agg[i].get(t), t);\n }\n },\n rem(t) {\n const key = this.cellkey(t),\n cell = this.cell(key, t);\n cell.num -= 1;\n if (this._countOnly) return;\n if (cell.store) cell.data.rem(t);\n const agg = cell.agg;\n for (let i = 0, n = agg.length; i < n; ++i) {\n agg[i].rem(agg[i].get(t), t);\n }\n },\n celltuple(cell) {\n const tuple = cell.tuple,\n counts = this._counts;\n\n // consolidate stored values\n if (cell.store) {\n cell.data.values();\n }\n\n // update tuple properties\n for (let i = 0, n = counts.length; i < n; ++i) {\n tuple[counts[i]] = cell.num;\n }\n if (!this._countOnly) {\n const agg = cell.agg;\n for (let i = 0, n = agg.length; i < n; ++i) {\n agg[i].set(tuple);\n }\n }\n return tuple;\n },\n changes(out) {\n const adds = this._adds,\n mods = this._mods,\n prev = this._prev,\n drop = this._drop,\n add = out.add,\n rem = out.rem,\n mod = out.mod;\n let cell, key, i, n;\n if (prev) for (key in prev) {\n cell = prev[key];\n if (!drop || cell.num) rem.push(cell.tuple);\n }\n for (i = 0, n = this._alen; i < n; ++i) {\n add.push(this.celltuple(adds[i]));\n adds[i] = null; // for garbage collection\n }\n\n for (i = 0, n = this._mlen; i < n; ++i) {\n cell = mods[i];\n (cell.num === 0 && drop ? rem : mod).push(this.celltuple(cell));\n mods[i] = null; // for garbage collection\n }\n\n this._alen = this._mlen = 0; // reset list of active cells\n this._prev = null;\n return out;\n }\n});\n\n// epsilon bias to offset floating point error (#1737)\nconst EPSILON$1 = 1e-14;\n\n/**\n * Generates a binning function for discretizing data.\n * @constructor\n * @param {object} params - The parameters for this operator. The\n * provided values should be valid options for the {@link bin} function.\n * @param {function(object): *} params.field - The data field to bin.\n */\nfunction Bin(params) {\n Transform.call(this, null, params);\n}\nBin.Definition = {\n 'type': 'Bin',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'interval',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'anchor',\n 'type': 'number'\n }, {\n 'name': 'maxbins',\n 'type': 'number',\n 'default': 20\n }, {\n 'name': 'base',\n 'type': 'number',\n 'default': 10\n }, {\n 'name': 'divide',\n 'type': 'number',\n 'array': true,\n 'default': [5, 2]\n }, {\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'required': true\n }, {\n 'name': 'span',\n 'type': 'number'\n }, {\n 'name': 'step',\n 'type': 'number'\n }, {\n 'name': 'steps',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'minstep',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'nice',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'name',\n 'type': 'string'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['bin0', 'bin1']\n }]\n};\ninherits(Bin, Transform, {\n transform(_, pulse) {\n const band = _.interval !== false,\n bins = this._bins(_),\n start = bins.start,\n step = bins.step,\n as = _.as || ['bin0', 'bin1'],\n b0 = as[0],\n b1 = as[1];\n let flag;\n if (_.modified()) {\n pulse = pulse.reflow(true);\n flag = pulse.SOURCE;\n } else {\n flag = pulse.modified(accessorFields(_.field)) ? pulse.ADD_MOD : pulse.ADD;\n }\n pulse.visit(flag, band ? t => {\n const v = bins(t);\n // minimum bin value (inclusive)\n t[b0] = v;\n // maximum bin value (exclusive)\n // use convoluted math for better floating point agreement\n // see https://github.com/vega/vega/issues/830\n // infinite values propagate through this formula! #2227\n t[b1] = v == null ? null : start + step * (1 + (v - start) / step);\n } : t => t[b0] = bins(t));\n return pulse.modifies(band ? as : b0);\n },\n _bins(_) {\n if (this.value && !_.modified()) {\n return this.value;\n }\n const field = _.field,\n bins = bin(_),\n step = bins.step;\n let start = bins.start,\n stop = start + Math.ceil((bins.stop - start) / step) * step,\n a,\n d;\n if ((a = _.anchor) != null) {\n d = a - (start + step * Math.floor((a - start) / step));\n start += d;\n stop += d;\n }\n const f = function (t) {\n let v = toNumber(field(t));\n return v == null ? null : v < start ? -Infinity : v > stop ? +Infinity : (v = Math.max(start, Math.min(v, stop - step)), start + step * Math.floor(EPSILON$1 + (v - start) / step));\n };\n f.start = start;\n f.stop = bins.stop;\n f.step = step;\n return this.value = accessor(f, accessorFields(field), _.name || 'bin_' + accessorName(field));\n }\n});\n\nfunction SortedList (idFunc, source, input) {\n const $ = idFunc;\n let data = source || [],\n add = input || [],\n rem = {},\n cnt = 0;\n return {\n add: t => add.push(t),\n remove: t => rem[$(t)] = ++cnt,\n size: () => data.length,\n data: (compare, resort) => {\n if (cnt) {\n data = data.filter(t => !rem[$(t)]);\n rem = {};\n cnt = 0;\n }\n if (resort && compare) {\n data.sort(compare);\n }\n if (add.length) {\n data = compare ? merge(compare, data, add.sort(compare)) : data.concat(add);\n add = [];\n }\n return data;\n }\n };\n}\n\n/**\n * Collects all data tuples that pass through this operator.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - An optional\n * comparator function for additionally sorting the collected tuples.\n */\nfunction Collect(params) {\n Transform.call(this, [], params);\n}\nCollect.Definition = {\n 'type': 'Collect',\n 'metadata': {\n 'source': true\n },\n 'params': [{\n 'name': 'sort',\n 'type': 'compare'\n }]\n};\ninherits(Collect, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.ALL),\n list = SortedList(tupleid, this.value, out.materialize(out.ADD).add),\n sort = _.sort,\n mod = pulse.changed() || sort && (_.modified('sort') || pulse.modified(sort.fields));\n out.visit(out.REM, list.remove);\n this.modified(mod);\n this.value = out.source = list.data(stableCompare(sort), mod);\n\n // propagate tree root if defined\n if (pulse.source && pulse.source.root) {\n this.value.root = pulse.source.root;\n }\n return out;\n }\n});\n\n/**\n * Generates a comparator function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - The fields to compare.\n * @param {Array} [params.orders] - The sort orders.\n * Each entry should be one of \"ascending\" (default) or \"descending\".\n */\nfunction Compare(params) {\n Operator.call(this, null, update$5, params);\n}\ninherits(Compare, Operator);\nfunction update$5(_) {\n return this.value && !_.modified() ? this.value : compare(_.fields, _.orders);\n}\n\n/**\n * Count regexp-defined pattern occurrences in a text field.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - An accessor for the text field.\n * @param {string} [params.pattern] - RegExp string defining the text pattern.\n * @param {string} [params.case] - One of 'lower', 'upper' or null (mixed) case.\n * @param {string} [params.stopwords] - RegExp string of words to ignore.\n */\nfunction CountPattern(params) {\n Transform.call(this, null, params);\n}\nCountPattern.Definition = {\n 'type': 'CountPattern',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'case',\n 'type': 'enum',\n 'values': ['upper', 'lower', 'mixed'],\n 'default': 'mixed'\n }, {\n 'name': 'pattern',\n 'type': 'string',\n 'default': '[\\\\w\"]+'\n }, {\n 'name': 'stopwords',\n 'type': 'string',\n 'default': ''\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['text', 'count']\n }]\n};\nfunction tokenize(text, tcase, match) {\n switch (tcase) {\n case 'upper':\n text = text.toUpperCase();\n break;\n case 'lower':\n text = text.toLowerCase();\n break;\n }\n return text.match(match);\n}\ninherits(CountPattern, Transform, {\n transform(_, pulse) {\n const process = update => tuple => {\n var tokens = tokenize(get(tuple), _.case, match) || [],\n t;\n for (var i = 0, n = tokens.length; i < n; ++i) {\n if (!stop.test(t = tokens[i])) update(t);\n }\n };\n const init = this._parameterCheck(_, pulse),\n counts = this._counts,\n match = this._match,\n stop = this._stop,\n get = _.field,\n as = _.as || ['text', 'count'],\n add = process(t => counts[t] = 1 + (counts[t] || 0)),\n rem = process(t => counts[t] -= 1);\n if (init) {\n pulse.visit(pulse.SOURCE, add);\n } else {\n pulse.visit(pulse.ADD, add);\n pulse.visit(pulse.REM, rem);\n }\n return this._finish(pulse, as); // generate output tuples\n },\n\n _parameterCheck(_, pulse) {\n let init = false;\n if (_.modified('stopwords') || !this._stop) {\n this._stop = new RegExp('^' + (_.stopwords || '') + '$', 'i');\n init = true;\n }\n if (_.modified('pattern') || !this._match) {\n this._match = new RegExp(_.pattern || '[\\\\w\\']+', 'g');\n init = true;\n }\n if (_.modified('field') || pulse.modified(_.field.fields)) {\n init = true;\n }\n if (init) this._counts = {};\n return init;\n },\n _finish(pulse, as) {\n const counts = this._counts,\n tuples = this._tuples || (this._tuples = {}),\n text = as[0],\n count = as[1],\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n let w, t, c;\n for (w in counts) {\n t = tuples[w];\n c = counts[w] || 0;\n if (!t && c) {\n tuples[w] = t = ingest({});\n t[text] = w;\n t[count] = c;\n out.add.push(t);\n } else if (c === 0) {\n if (t) out.rem.push(t);\n counts[w] = null;\n tuples[w] = null;\n } else if (t[count] !== c) {\n t[count] = c;\n out.mod.push(t);\n }\n }\n return out.modifies(as);\n }\n});\n\n/**\n * Perform a cross-product of a tuple stream with itself.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object):boolean} [params.filter] - An optional filter\n * function for selectively including tuples in the cross product.\n * @param {Array} [params.as] - The names of the output fields.\n */\nfunction Cross(params) {\n Transform.call(this, null, params);\n}\nCross.Definition = {\n 'type': 'Cross',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'filter',\n 'type': 'expr'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['a', 'b']\n }]\n};\ninherits(Cross, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n as = _.as || ['a', 'b'],\n a = as[0],\n b = as[1],\n reset = !this.value || pulse.changed(pulse.ADD_REM) || _.modified('as') || _.modified('filter');\n let data = this.value;\n if (reset) {\n if (data) out.rem = data;\n data = pulse.materialize(pulse.SOURCE).source;\n out.add = this.value = cross(data, a, b, _.filter || truthy);\n } else {\n out.mod = data;\n }\n out.source = this.value;\n return out.modifies(as);\n }\n});\nfunction cross(input, a, b, filter) {\n var data = [],\n t = {},\n n = input.length,\n i = 0,\n j,\n left;\n for (; i < n; ++i) {\n t[a] = left = input[i];\n for (j = 0; j < n; ++j) {\n t[b] = input[j];\n if (filter(t)) {\n data.push(ingest(t));\n t = {};\n t[a] = left;\n }\n }\n }\n return data;\n}\n\nconst Distributions = {\n kde: randomKDE,\n mixture: randomMixture,\n normal: randomNormal,\n lognormal: randomLogNormal,\n uniform: randomUniform\n};\nconst DISTRIBUTIONS = 'distributions',\n FUNCTION = 'function',\n FIELD = 'field';\n\n/**\n * Parse a parameter object for a probability distribution.\n * @param {object} def - The distribution parameter object.\n * @param {function():Array} - A method for requesting\n * source data. Used for distributions (such as KDE) that\n * require sample data points. This method will only be\n * invoked if the 'from' parameter for a target data source\n * is not provided. Typically this method returns backing\n * source data for a Pulse object.\n * @return {object} - The output distribution object.\n */\nfunction parse(def, data) {\n const func = def[FUNCTION];\n if (!hasOwnProperty(Distributions, func)) {\n error('Unknown distribution function: ' + func);\n }\n const d = Distributions[func]();\n for (const name in def) {\n // if data field, extract values\n if (name === FIELD) {\n d.data((def.from || data()).map(def[name]));\n }\n\n // if distribution mixture, recurse to parse each definition\n else if (name === DISTRIBUTIONS) {\n d[name](def[name].map(_ => parse(_, data)));\n }\n\n // otherwise, simply set the parameter\n else if (typeof d[name] === FUNCTION) {\n d[name](def[name]);\n }\n }\n return d;\n}\n\n/**\n * Grid sample points for a probability density. Given a distribution and\n * a sampling extent, will generate points suitable for plotting either\n * PDF (probability density function) or CDF (cumulative distribution\n * function) curves.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.distribution - The probability distribution. This\n * is an object parameter dependent on the distribution type.\n * @param {string} [params.method='pdf'] - The distribution method to sample.\n * One of 'pdf' or 'cdf'.\n * @param {Array} [params.extent] - The [min, max] extent over which\n * to sample the distribution. This argument is required in most cases, but\n * can be omitted if the distribution (e.g., 'kde') supports a 'data' method\n * that returns numerical sample points from which the extent can be deduced.\n * @param {number} [params.minsteps=25] - The minimum number of curve samples\n * for plotting the density.\n * @param {number} [params.maxsteps=200] - The maximum number of curve samples\n * for plotting the density.\n * @param {number} [params.steps] - The exact number of curve samples for\n * plotting the density. If specified, overrides both minsteps and maxsteps\n * to set an exact number of uniform samples. Useful in conjunction with\n * a fixed extent to ensure consistent sample points for stacked densities.\n */\nfunction Density(params) {\n Transform.call(this, null, params);\n}\nconst distributions = [{\n 'key': {\n 'function': 'normal'\n },\n 'params': [{\n 'name': 'mean',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'stdev',\n 'type': 'number',\n 'default': 1\n }]\n}, {\n 'key': {\n 'function': 'lognormal'\n },\n 'params': [{\n 'name': 'mean',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'stdev',\n 'type': 'number',\n 'default': 1\n }]\n}, {\n 'key': {\n 'function': 'uniform'\n },\n 'params': [{\n 'name': 'min',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'max',\n 'type': 'number',\n 'default': 1\n }]\n}, {\n 'key': {\n 'function': 'kde'\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'from',\n 'type': 'data'\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'default': 0\n }]\n}];\nconst mixture = {\n 'key': {\n 'function': 'mixture'\n },\n 'params': [{\n 'name': 'distributions',\n 'type': 'param',\n 'array': true,\n 'params': distributions\n }, {\n 'name': 'weights',\n 'type': 'number',\n 'array': true\n }]\n};\nDensity.Definition = {\n 'type': 'Density',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'steps',\n 'type': 'number'\n }, {\n 'name': 'minsteps',\n 'type': 'number',\n 'default': 25\n }, {\n 'name': 'maxsteps',\n 'type': 'number',\n 'default': 200\n }, {\n 'name': 'method',\n 'type': 'string',\n 'default': 'pdf',\n 'values': ['pdf', 'cdf']\n }, {\n 'name': 'distribution',\n 'type': 'param',\n 'params': distributions.concat(mixture)\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'default': ['value', 'density']\n }]\n};\ninherits(Density, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n if (!this.value || pulse.changed() || _.modified()) {\n const dist = parse(_.distribution, source(pulse)),\n minsteps = _.steps || _.minsteps || 25,\n maxsteps = _.steps || _.maxsteps || 200;\n let method = _.method || 'pdf';\n if (method !== 'pdf' && method !== 'cdf') {\n error('Invalid density method: ' + method);\n }\n if (!_.extent && !dist.data) {\n error('Missing density extent parameter.');\n }\n method = dist[method];\n const as = _.as || ['value', 'density'],\n domain = _.extent || extent(dist.data()),\n values = sampleCurve(method, domain, minsteps, maxsteps).map(v => {\n const tuple = {};\n tuple[as[0]] = v[0];\n tuple[as[1]] = v[1];\n return ingest(tuple);\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n return out;\n }\n});\nfunction source(pulse) {\n return () => pulse.materialize(pulse.SOURCE).source;\n}\n\n// use either provided alias or accessor field name\nfunction fieldNames(fields, as) {\n if (!fields) return null;\n return fields.map((f, i) => as[i] || accessorName(f));\n}\nfunction partition$1(data, groupby, field) {\n const groups = [],\n get = f => f(t);\n let map, i, n, t, k, g;\n\n // partition data points into groups\n if (groupby == null) {\n groups.push(data.map(field));\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n if (!g) {\n map[k] = g = [];\n g.dims = k;\n groups.push(g);\n }\n g.push(field(t));\n }\n }\n return groups;\n}\n\nconst Output = 'bin';\n\n/**\n * Dot density binning for dot plot construction.\n * Based on Leland Wilkinson, Dot Plots, The American Statistician, 1999.\n * https://www.cs.uic.edu/~wilkinson/Publications/dotplots.pdf\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to bin.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {number} [params.step] - The step size (bin width) within which dots should be\n * stacked. Defaults to 1/30 of the extent of the data *field*.\n * @param {boolean} [params.smooth=false] - A boolean flag indicating if dot density\n * stacks should be smoothed to reduce variance.\n */\nfunction DotBin(params) {\n Transform.call(this, null, params);\n}\nDotBin.Definition = {\n 'type': 'DotBin',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'step',\n 'type': 'number'\n }, {\n 'name': 'smooth',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': Output\n }]\n};\nconst autostep = (data, field) => span(extent(data, field)) / 30;\ninherits(DotBin, Transform, {\n transform(_, pulse) {\n if (this.value && !(_.modified() || pulse.changed())) {\n return pulse; // early exit\n }\n\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition$1(pulse.source, _.groupby, identity),\n smooth = _.smooth || false,\n field = _.field,\n step = _.step || autostep(source, field),\n sort = stableCompare((a, b) => field(a) - field(b)),\n as = _.as || Output,\n n = groups.length;\n\n // compute dotplot bins per group\n let min = Infinity,\n max = -Infinity,\n i = 0,\n j;\n for (; i < n; ++i) {\n const g = groups[i].sort(sort);\n j = -1;\n for (const v of dotbin(g, step, smooth, field)) {\n if (v < min) min = v;\n if (v > max) max = v;\n g[++j][as] = v;\n }\n }\n this.value = {\n start: min,\n stop: max,\n step: step\n };\n return pulse.reflow(true).modifies(as);\n }\n});\n\n/**\n * Wraps an expression function with access to external parameters.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function} params.expr - The expression function. The\n * function should accept both a datum and a parameter object.\n * This operator's value will be a new function that wraps the\n * expression function with access to this operator's parameters.\n */\nfunction Expression(params) {\n Operator.call(this, null, update$4, params);\n this.modified(true);\n}\ninherits(Expression, Operator);\nfunction update$4(_) {\n const expr = _.expr;\n return this.value && !_.modified('expr') ? this.value : accessor(datum => expr(datum, _), accessorFields(expr), accessorName(expr));\n}\n\n/**\n * Computes extents (min/max) for a data field.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The field over which to compute extends.\n */\nfunction Extent(params) {\n Transform.call(this, [undefined, undefined], params);\n}\nExtent.Definition = {\n 'type': 'Extent',\n 'metadata': {},\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }]\n};\ninherits(Extent, Transform, {\n transform(_, pulse) {\n const extent = this.value,\n field = _.field,\n mod = pulse.changed() || pulse.modified(field.fields) || _.modified('field');\n let min = extent[0],\n max = extent[1];\n if (mod || min == null) {\n min = +Infinity;\n max = -Infinity;\n }\n pulse.visit(mod ? pulse.SOURCE : pulse.ADD, t => {\n const v = toNumber(field(t));\n if (v != null) {\n // NaNs will fail all comparisons!\n if (v < min) min = v;\n if (v > max) max = v;\n }\n });\n if (!Number.isFinite(min) || !Number.isFinite(max)) {\n let name = accessorName(field);\n if (name) name = ` for field \"${name}\"`;\n pulse.dataflow.warn(`Infinite extent${name}: [${min}, ${max}]`);\n min = max = undefined;\n }\n this.value = [min, max];\n }\n});\n\n/**\n * Provides a bridge between a parent transform and a target subflow that\n * consumes only a subset of the tuples that pass through the parent.\n * @constructor\n * @param {Pulse} pulse - A pulse to use as the value of this operator.\n * @param {Transform} parent - The parent transform (typically a Facet instance).\n */\nfunction Subflow(pulse, parent) {\n Operator.call(this, pulse);\n this.parent = parent;\n this.count = 0;\n}\ninherits(Subflow, Operator, {\n /**\n * Routes pulses from this subflow to a target transform.\n * @param {Transform} target - A transform that receives the subflow of tuples.\n */\n connect(target) {\n this.detachSubflow = target.detachSubflow;\n this.targets().add(target);\n return target.source = this;\n },\n /**\n * Add an 'add' tuple to the subflow pulse.\n * @param {Tuple} t - The tuple being added.\n */\n add(t) {\n this.count += 1;\n this.value.add.push(t);\n },\n /**\n * Add a 'rem' tuple to the subflow pulse.\n * @param {Tuple} t - The tuple being removed.\n */\n rem(t) {\n this.count -= 1;\n this.value.rem.push(t);\n },\n /**\n * Add a 'mod' tuple to the subflow pulse.\n * @param {Tuple} t - The tuple being modified.\n */\n mod(t) {\n this.value.mod.push(t);\n },\n /**\n * Re-initialize this operator's pulse value.\n * @param {Pulse} pulse - The pulse to copy from.\n * @see Pulse.init\n */\n init(pulse) {\n this.value.init(pulse, pulse.NO_SOURCE);\n },\n /**\n * Evaluate this operator. This method overrides the\n * default behavior to simply return the contained pulse value.\n * @return {Pulse}\n */\n evaluate() {\n // assert: this.value.stamp === pulse.stamp\n return this.value;\n }\n});\n\n/**\n * Facets a dataflow into a set of subflows based on a key.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(Dataflow, string): Operator} params.subflow - A function\n * that generates a subflow of operators and returns its root operator.\n * @param {function(object): *} params.key - The key field to facet by.\n */\nfunction Facet(params) {\n Transform.call(this, {}, params);\n this._keys = fastmap(); // cache previously calculated key values\n\n // keep track of active subflows, use as targets array for listeners\n // this allows us to limit propagation to only updated subflows\n const a = this._targets = [];\n a.active = 0;\n a.forEach = f => {\n for (let i = 0, n = a.active; i < n; ++i) {\n f(a[i], i, a);\n }\n };\n}\ninherits(Facet, Transform, {\n activate(flow) {\n this._targets[this._targets.active++] = flow;\n },\n // parent argument provided by PreFacet subclass\n subflow(key, flow, pulse, parent) {\n const flows = this.value;\n let sf = hasOwnProperty(flows, key) && flows[key],\n df,\n p;\n if (!sf) {\n p = parent || (p = this._group[key]) && p.tuple;\n df = pulse.dataflow;\n sf = new Subflow(pulse.fork(pulse.NO_SOURCE), this);\n df.add(sf).connect(flow(df, key, p));\n flows[key] = sf;\n this.activate(sf);\n } else if (sf.value.stamp < pulse.stamp) {\n sf.init(pulse);\n this.activate(sf);\n }\n return sf;\n },\n clean() {\n const flows = this.value;\n let detached = 0;\n for (const key in flows) {\n if (flows[key].count === 0) {\n const detach = flows[key].detachSubflow;\n if (detach) detach();\n delete flows[key];\n ++detached;\n }\n }\n\n // remove inactive targets from the active targets array\n if (detached) {\n const active = this._targets.filter(sf => sf && sf.count > 0);\n this.initTargets(active);\n }\n },\n initTargets(act) {\n const a = this._targets,\n n = a.length,\n m = act ? act.length : 0;\n let i = 0;\n for (; i < m; ++i) {\n a[i] = act[i];\n }\n for (; i < n && a[i] != null; ++i) {\n a[i] = null; // ensure old flows can be garbage collected\n }\n\n a.active = m;\n },\n transform(_, pulse) {\n const df = pulse.dataflow,\n key = _.key,\n flow = _.subflow,\n cache = this._keys,\n rekey = _.modified('key'),\n subflow = key => this.subflow(key, flow, pulse);\n this._group = _.group || {};\n this.initTargets(); // reset list of active subflows\n\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t),\n k = cache.get(id);\n if (k !== undefined) {\n cache.delete(id);\n subflow(k).rem(t);\n }\n });\n pulse.visit(pulse.ADD, t => {\n const k = key(t);\n cache.set(tupleid(t), k);\n subflow(k).add(t);\n });\n if (rekey || pulse.modified(key.fields)) {\n pulse.visit(pulse.MOD, t => {\n const id = tupleid(t),\n k0 = cache.get(id),\n k1 = key(t);\n if (k0 === k1) {\n subflow(k1).mod(t);\n } else {\n cache.set(id, k1);\n subflow(k0).rem(t);\n subflow(k1).add(t);\n }\n });\n } else if (pulse.changed(pulse.MOD)) {\n pulse.visit(pulse.MOD, t => {\n subflow(cache.get(tupleid(t))).mod(t);\n });\n }\n if (rekey) {\n pulse.visit(pulse.REFLOW, t => {\n const id = tupleid(t),\n k0 = cache.get(id),\n k1 = key(t);\n if (k0 !== k1) {\n cache.set(id, k1);\n subflow(k0).rem(t);\n subflow(k1).add(t);\n }\n });\n }\n if (pulse.clean()) {\n df.runAfter(() => {\n this.clean();\n cache.clean();\n });\n } else if (cache.empty > df.cleanThreshold) {\n df.runAfter(cache.clean);\n }\n return pulse;\n }\n});\n\n/**\n * Generates one or more field accessor functions.\n * If the 'name' parameter is an array, an array of field accessors\n * will be created and the 'as' parameter will be ignored.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {string} params.name - The field name(s) to access.\n * @param {string} params.as - The accessor function name.\n */\nfunction Field(params) {\n Operator.call(this, null, update$3, params);\n}\ninherits(Field, Operator);\nfunction update$3(_) {\n return this.value && !_.modified() ? this.value : isArray(_.name) ? array(_.name).map(f => field(f)) : field(_.name, _.as);\n}\n\n/**\n * Filters data tuples according to a predicate function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.expr - The predicate expression function\n * that determines a tuple's filter status. Truthy values pass the filter.\n */\nfunction Filter(params) {\n Transform.call(this, fastmap(), params);\n}\nFilter.Definition = {\n 'type': 'Filter',\n 'metadata': {\n 'changes': true\n },\n 'params': [{\n 'name': 'expr',\n 'type': 'expr',\n 'required': true\n }]\n};\ninherits(Filter, Transform, {\n transform(_, pulse) {\n const df = pulse.dataflow,\n cache = this.value,\n // cache ids of filtered tuples\n output = pulse.fork(),\n add = output.add,\n rem = output.rem,\n mod = output.mod,\n test = _.expr;\n let isMod = true;\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n if (!cache.has(id)) rem.push(t);else cache.delete(id);\n });\n pulse.visit(pulse.ADD, t => {\n if (test(t, _)) add.push(t);else cache.set(tupleid(t), 1);\n });\n function revisit(t) {\n const id = tupleid(t),\n b = test(t, _),\n s = cache.get(id);\n if (b && s) {\n cache.delete(id);\n add.push(t);\n } else if (!b && !s) {\n cache.set(id, 1);\n rem.push(t);\n } else if (isMod && b && !s) {\n mod.push(t);\n }\n }\n pulse.visit(pulse.MOD, revisit);\n if (_.modified()) {\n isMod = false;\n pulse.visit(pulse.REFLOW, revisit);\n }\n if (cache.empty > df.cleanThreshold) df.runAfter(cache.clean);\n return output;\n }\n});\n\n/**\n * Flattens array-typed field values into new data objects.\n * If multiple fields are specified, they are treated as parallel arrays,\n * with output values included for each matching index (or null if missing).\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - An array of field\n * accessors for the tuple fields that should be flattened.\n * @param {string} [params.index] - Optional output field name for index\n * value. If unspecified, no index field is included in the output.\n * @param {Array} [params.as] - Output field names for flattened\n * array fields. Any unspecified fields will use the field name provided\n * by the fields accessors.\n */\nfunction Flatten(params) {\n Transform.call(this, [], params);\n}\nFlatten.Definition = {\n 'type': 'Flatten',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'index',\n 'type': 'string'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }]\n};\ninherits(Flatten, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n fields = _.fields,\n as = fieldNames(fields, _.as || []),\n index = _.index || null,\n m = as.length;\n\n // remove any previous results\n out.rem = this.value;\n\n // generate flattened tuples\n pulse.visit(pulse.SOURCE, t => {\n const arrays = fields.map(f => f(t)),\n maxlen = arrays.reduce((l, a) => Math.max(l, a.length), 0);\n let i = 0,\n j,\n d,\n v;\n for (; i < maxlen; ++i) {\n d = derive(t);\n for (j = 0; j < m; ++j) {\n d[as[j]] = (v = arrays[j][i]) == null ? null : v;\n }\n if (index) {\n d[index] = i;\n }\n out.add.push(d);\n }\n });\n this.value = out.source = out.add;\n if (index) out.modifies(index);\n return out.modifies(as);\n }\n});\n\n/**\n * Folds one more tuple fields into multiple tuples in which the field\n * name and values are available under new 'key' and 'value' fields.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.fields - An array of field accessors\n * for the tuple fields that should be folded.\n * @param {Array} [params.as] - Output field names for folded key\n * and value fields, defaults to ['key', 'value'].\n */\nfunction Fold(params) {\n Transform.call(this, [], params);\n}\nFold.Definition = {\n 'type': 'Fold',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['key', 'value']\n }]\n};\ninherits(Fold, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n fields = _.fields,\n fnames = fields.map(accessorName),\n as = _.as || ['key', 'value'],\n k = as[0],\n v = as[1],\n n = fields.length;\n out.rem = this.value;\n pulse.visit(pulse.SOURCE, t => {\n for (let i = 0, d; i < n; ++i) {\n d = derive(t);\n d[k] = fnames[i];\n d[v] = fields[i](t);\n out.add.push(d);\n }\n });\n this.value = out.source = out.add;\n return out.modifies(as);\n }\n});\n\n/**\n * Invokes a function for each data tuple and saves the results as a new field.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.expr - The formula function to invoke for each tuple.\n * @param {string} params.as - The field name under which to save the result.\n * @param {boolean} [params.initonly=false] - If true, the formula is applied to\n * added tuples only, and does not update in response to modifications.\n */\nfunction Formula(params) {\n Transform.call(this, null, params);\n}\nFormula.Definition = {\n 'type': 'Formula',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'expr',\n 'type': 'expr',\n 'required': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'required': true\n }, {\n 'name': 'initonly',\n 'type': 'boolean'\n }]\n};\ninherits(Formula, Transform, {\n transform(_, pulse) {\n const func = _.expr,\n as = _.as,\n mod = _.modified(),\n flag = _.initonly ? pulse.ADD : mod ? pulse.SOURCE : pulse.modified(func.fields) || pulse.modified(as) ? pulse.ADD_MOD : pulse.ADD;\n if (mod) {\n // parameters updated, need to reflow\n pulse = pulse.materialize().reflow(true);\n }\n if (!_.initonly) {\n pulse.modifies(as);\n }\n return pulse.visit(flag, t => t[as] = func(t, _));\n }\n});\n\n/**\n * Generates data tuples using a provided generator function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(Parameters): object} params.generator - A tuple generator\n * function. This function is given the operator parameters as input.\n * Changes to any additional parameters will not trigger re-calculation\n * of previously generated tuples. Only future tuples are affected.\n * @param {number} params.size - The number of tuples to produce.\n */\nfunction Generate(params) {\n Transform.call(this, [], params);\n}\ninherits(Generate, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.ALL),\n gen = _.generator;\n let data = this.value,\n num = _.size - data.length,\n add,\n rem,\n t;\n if (num > 0) {\n // need more tuples, generate and add\n for (add = []; --num >= 0;) {\n add.push(t = ingest(gen(_)));\n data.push(t);\n }\n out.add = out.add.length ? out.materialize(out.ADD).add.concat(add) : add;\n } else {\n // need fewer tuples, remove\n rem = data.slice(0, -num);\n out.rem = out.rem.length ? out.materialize(out.REM).rem.concat(rem) : rem;\n data = data.slice(-num);\n }\n out.source = this.value = data;\n return out;\n }\n});\n\nconst Methods = {\n value: 'value',\n median: median,\n mean: mean,\n min: min,\n max: max\n};\nconst Empty = [];\n\n/**\n * Impute missing values.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to impute.\n * @param {Array} [params.groupby] - An array of\n * accessors to determine series within which to perform imputation.\n * @param {function(object): *} params.key - An accessor for a key value.\n * Each key value should be unique within a group. New tuples will be\n * imputed for any key values that are not found within a group.\n * @param {Array<*>} [params.keyvals] - Optional array of required key\n * values. New tuples will be imputed for any key values that are not\n * found within a group. In addition, these values will be automatically\n * augmented with the key values observed in the input data.\n * @param {string} [method='value'] - The imputation method to use. One of\n * 'value', 'mean', 'median', 'max', 'min'.\n * @param {*} [value=0] - The constant value to use for imputation\n * when using method 'value'.\n */\nfunction Impute(params) {\n Transform.call(this, [], params);\n}\nImpute.Definition = {\n 'type': 'Impute',\n 'metadata': {\n 'changes': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'key',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'keyvals',\n 'array': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'method',\n 'type': 'enum',\n 'default': 'value',\n 'values': ['value', 'mean', 'median', 'max', 'min']\n }, {\n 'name': 'value',\n 'default': 0\n }]\n};\nfunction getValue(_) {\n var m = _.method || Methods.value,\n v;\n if (Methods[m] == null) {\n error('Unrecognized imputation method: ' + m);\n } else if (m === Methods.value) {\n v = _.value !== undefined ? _.value : 0;\n return () => v;\n } else {\n return Methods[m];\n }\n}\nfunction getField(_) {\n const f = _.field;\n return t => t ? f(t) : NaN;\n}\ninherits(Impute, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ALL),\n impute = getValue(_),\n field = getField(_),\n fName = accessorName(_.field),\n kName = accessorName(_.key),\n gNames = (_.groupby || []).map(accessorName),\n groups = partition(pulse.source, _.groupby, _.key, _.keyvals),\n curr = [],\n prev = this.value,\n m = groups.domain.length,\n group,\n value,\n gVals,\n kVal,\n g,\n i,\n j,\n l,\n n,\n t;\n for (g = 0, l = groups.length; g < l; ++g) {\n group = groups[g];\n gVals = group.values;\n value = NaN;\n\n // add tuples for missing values\n for (j = 0; j < m; ++j) {\n if (group[j] != null) continue;\n kVal = groups.domain[j];\n t = {\n _impute: true\n };\n for (i = 0, n = gVals.length; i < n; ++i) t[gNames[i]] = gVals[i];\n t[kName] = kVal;\n t[fName] = Number.isNaN(value) ? value = impute(group, field) : value;\n curr.push(ingest(t));\n }\n }\n\n // update pulse with imputed tuples\n if (curr.length) out.add = out.materialize(out.ADD).add.concat(curr);\n if (prev.length) out.rem = out.materialize(out.REM).rem.concat(prev);\n this.value = curr;\n return out;\n }\n});\nfunction partition(data, groupby, key, keyvals) {\n var get = f => f(t),\n groups = [],\n domain = keyvals ? keyvals.slice() : [],\n kMap = {},\n gMap = {},\n gVals,\n gKey,\n group,\n i,\n j,\n k,\n n,\n t;\n domain.forEach((k, i) => kMap[k] = i + 1);\n for (i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = key(t);\n j = kMap[k] || (kMap[k] = domain.push(k));\n gKey = (gVals = groupby ? groupby.map(get) : Empty) + '';\n if (!(group = gMap[gKey])) {\n group = gMap[gKey] = [];\n groups.push(group);\n group.values = gVals;\n }\n group[j - 1] = t;\n }\n groups.domain = domain;\n return groups;\n}\n\n/**\n * Extend input tuples with aggregate values.\n * Calcuates aggregate values and joins them with the input stream.\n * @constructor\n */\nfunction JoinAggregate(params) {\n Aggregate.call(this, params);\n}\nJoinAggregate.Definition = {\n 'type': 'JoinAggregate',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'null': true,\n 'array': true\n }, {\n 'name': 'ops',\n 'type': 'enum',\n 'array': true,\n 'values': ValidAggregateOps\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }, {\n 'name': 'key',\n 'type': 'field'\n }]\n};\ninherits(JoinAggregate, Aggregate, {\n transform(_, pulse) {\n const aggr = this,\n mod = _.modified();\n let cells;\n\n // process all input tuples to calculate aggregates\n if (aggr.value && (mod || pulse.modified(aggr._inputs, true))) {\n cells = aggr.value = mod ? aggr.init(_) : {};\n pulse.visit(pulse.SOURCE, t => aggr.add(t));\n } else {\n cells = aggr.value = aggr.value || this.init(_);\n pulse.visit(pulse.REM, t => aggr.rem(t));\n pulse.visit(pulse.ADD, t => aggr.add(t));\n }\n\n // update aggregation cells\n aggr.changes();\n\n // write aggregate values to input tuples\n pulse.visit(pulse.SOURCE, t => {\n extend(t, cells[aggr.cellkey(t)].tuple);\n });\n return pulse.reflow(mod).modifies(this._outputs);\n },\n changes() {\n const adds = this._adds,\n mods = this._mods;\n let i, n;\n for (i = 0, n = this._alen; i < n; ++i) {\n this.celltuple(adds[i]);\n adds[i] = null; // for garbage collection\n }\n\n for (i = 0, n = this._mlen; i < n; ++i) {\n this.celltuple(mods[i]);\n mods[i] = null; // for garbage collection\n }\n\n this._alen = this._mlen = 0; // reset list of active cells\n }\n});\n\n/**\n * Compute kernel density estimates (KDE) for one or more data groups.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby.\n * @param {function(object): *} params.field - An accessor for the data field\n * to estimate.\n * @param {number} [params.bandwidth=0] - The KDE kernel bandwidth.\n * If zero or unspecified, the bandwidth is automatically determined.\n * @param {boolean} [params.counts=false] - A boolean flag indicating if the\n * output values should be probability estimates (false, default) or\n * smoothed counts (true).\n * @param {string} [params.cumulative=false] - A boolean flag indicating if a\n * density (false) or cumulative distribution (true) should be generated.\n * @param {Array} [params.extent] - The domain extent over which to\n * plot the density. If unspecified, the [min, max] data extent is used.\n * @param {string} [params.resolve='independent'] - Indicates how parameters for\n * multiple densities should be resolved. If \"independent\" (the default), each\n * density may have its own domain extent and dynamic number of curve sample\n * steps. If \"shared\", the KDE transform will ensure that all densities are\n * defined over a shared domain and curve steps, enabling stacking.\n * @param {number} [params.minsteps=25] - The minimum number of curve samples\n * for plotting the density.\n * @param {number} [params.maxsteps=200] - The maximum number of curve samples\n * for plotting the density.\n * @param {number} [params.steps] - The exact number of curve samples for\n * plotting the density. If specified, overrides both minsteps and maxsteps\n * to set an exact number of uniform samples. Useful in conjunction with\n * a fixed extent to ensure consistent sample points for stacked densities.\n */\nfunction KDE(params) {\n Transform.call(this, null, params);\n}\nKDE.Definition = {\n 'type': 'KDE',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'cumulative',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'counts',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'resolve',\n 'type': 'enum',\n 'values': ['shared', 'independent'],\n 'default': 'independent'\n }, {\n 'name': 'steps',\n 'type': 'number'\n }, {\n 'name': 'minsteps',\n 'type': 'number',\n 'default': 25\n }, {\n 'name': 'maxsteps',\n 'type': 'number',\n 'default': 200\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'default': ['value', 'density']\n }]\n};\ninherits(KDE, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n if (!this.value || pulse.changed() || _.modified()) {\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition$1(source, _.groupby, _.field),\n names = (_.groupby || []).map(accessorName),\n bandwidth = _.bandwidth,\n method = _.cumulative ? 'cdf' : 'pdf',\n as = _.as || ['value', 'density'],\n values = [];\n let domain = _.extent,\n minsteps = _.steps || _.minsteps || 25,\n maxsteps = _.steps || _.maxsteps || 200;\n if (method !== 'pdf' && method !== 'cdf') {\n error('Invalid density method: ' + method);\n }\n if (_.resolve === 'shared') {\n if (!domain) domain = extent(source, _.field);\n minsteps = maxsteps = _.steps || maxsteps;\n }\n groups.forEach(g => {\n const density = randomKDE(g, bandwidth)[method],\n scale = _.counts ? g.length : 1,\n local = domain || extent(g);\n sampleCurve(density, local, minsteps, maxsteps).forEach(v => {\n const t = {};\n for (let i = 0; i < names.length; ++i) {\n t[names[i]] = g.dims[i];\n }\n t[as[0]] = v[0];\n t[as[1]] = v[1] * scale;\n values.push(ingest(t));\n });\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n return out;\n }\n});\n\n/**\n * Generates a key function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - The field name(s) for the key function.\n * @param {boolean} params.flat - A boolean flag indicating if the field names\n * should be treated as flat property names, side-stepping nested field\n * lookups normally indicated by dot or bracket notation.\n */\nfunction Key(params) {\n Operator.call(this, null, update$2, params);\n}\ninherits(Key, Operator);\nfunction update$2(_) {\n return this.value && !_.modified() ? this.value : key(_.fields, _.flat);\n}\n\n/**\n * Load and parse data from an external source. Marshalls parameter\n * values and then invokes the Dataflow request method.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {string} params.url - The URL to load from.\n * @param {object} params.format - The data format options.\n */\nfunction Load(params) {\n Transform.call(this, [], params);\n this._pending = null;\n}\ninherits(Load, Transform, {\n transform(_, pulse) {\n const df = pulse.dataflow;\n if (this._pending) {\n // update state and return pulse\n return output(this, pulse, this._pending);\n }\n if (stop(_)) return pulse.StopPropagation;\n if (_.values) {\n // parse and ingest values, return output pulse\n return output(this, pulse, df.parse(_.values, _.format));\n } else if (_.async) {\n // return promise for non-blocking async loading\n const p = df.request(_.url, _.format).then(res => {\n this._pending = array(res.data);\n return df => df.touch(this);\n });\n return {\n async: p\n };\n } else {\n // return promise for synchronous loading\n return df.request(_.url, _.format).then(res => output(this, pulse, array(res.data)));\n }\n }\n});\nfunction stop(_) {\n return _.modified('async') && !(_.modified('values') || _.modified('url') || _.modified('format'));\n}\nfunction output(op, pulse, data) {\n data.forEach(ingest);\n const out = pulse.fork(pulse.NO_FIELDS & pulse.NO_SOURCE);\n out.rem = op.value;\n op.value = out.source = out.add = data;\n op._pending = null;\n if (out.rem.length) out.clean(true);\n return out;\n}\n\n/**\n * Extend tuples by joining them with values from a lookup table.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Map} params.index - The lookup table map.\n * @param {Array} params.as - Output field names for each lookup value.\n * @param {*} [params.default] - A default value to use if lookup fails.\n */\nfunction Lookup(params) {\n Transform.call(this, {}, params);\n}\nLookup.Definition = {\n 'type': 'Lookup',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'index',\n 'type': 'index',\n 'params': [{\n 'name': 'from',\n 'type': 'data',\n 'required': true\n }, {\n 'name': 'key',\n 'type': 'field',\n 'required': true\n }]\n }, {\n 'name': 'values',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }, {\n 'name': 'default',\n 'default': null\n }]\n};\ninherits(Lookup, Transform, {\n transform(_, pulse) {\n const keys = _.fields,\n index = _.index,\n values = _.values,\n defaultValue = _.default == null ? null : _.default,\n reset = _.modified(),\n n = keys.length;\n let flag = reset ? pulse.SOURCE : pulse.ADD,\n out = pulse,\n as = _.as,\n set,\n m,\n mods;\n if (values) {\n m = values.length;\n if (n > 1 && !as) {\n error('Multi-field lookup requires explicit \"as\" parameter.');\n }\n if (as && as.length !== n * m) {\n error('The \"as\" parameter has too few output field names.');\n }\n as = as || values.map(accessorName);\n set = function (t) {\n for (var i = 0, k = 0, j, v; i < n; ++i) {\n v = index.get(keys[i](t));\n if (v == null) for (j = 0; j < m; ++j, ++k) t[as[k]] = defaultValue;else for (j = 0; j < m; ++j, ++k) t[as[k]] = values[j](v);\n }\n };\n } else {\n if (!as) {\n error('Missing output field names.');\n }\n set = function (t) {\n for (var i = 0, v; i < n; ++i) {\n v = index.get(keys[i](t));\n t[as[i]] = v == null ? defaultValue : v;\n }\n };\n }\n if (reset) {\n out = pulse.reflow(true);\n } else {\n mods = keys.some(k => pulse.modified(k.fields));\n flag |= mods ? pulse.MOD : 0;\n }\n pulse.visit(flag, set);\n return out.modifies(as);\n }\n});\n\n/**\n * Computes global min/max extents over a collection of extents.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array>} params.extents - The input extents.\n */\nfunction MultiExtent(params) {\n Operator.call(this, null, update$1, params);\n}\ninherits(MultiExtent, Operator);\nfunction update$1(_) {\n if (this.value && !_.modified()) {\n return this.value;\n }\n const ext = _.extents,\n n = ext.length;\n let min = +Infinity,\n max = -Infinity,\n i,\n e;\n for (i = 0; i < n; ++i) {\n e = ext[i];\n if (e[0] < min) min = e[0];\n if (e[1] > max) max = e[1];\n }\n return [min, max];\n}\n\n/**\n * Merge a collection of value arrays.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array>} params.values - The input value arrrays.\n */\nfunction MultiValues(params) {\n Operator.call(this, null, update, params);\n}\ninherits(MultiValues, Operator);\nfunction update(_) {\n return this.value && !_.modified() ? this.value : _.values.reduce((data, _) => data.concat(_), []);\n}\n\n/**\n * Operator whose value is simply its parameter hash. This operator is\n * useful for enabling reactive updates to values of nested objects.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction Params(params) {\n Transform.call(this, null, params);\n}\ninherits(Params, Transform, {\n transform(_, pulse) {\n this.modified(_.modified());\n this.value = _;\n return pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS); // do not pass tuples\n }\n});\n\n/**\n * Aggregate and pivot selected field values to become new fields.\n * This operator is useful to construction cross-tabulations.\n * @constructor\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby. These fields act just like groupby fields of an Aggregate transform.\n * @param {function(object): *} params.field - The field to pivot on. The unique\n * values of this field become new field names in the output stream.\n * @param {function(object): *} params.value - The field to populate pivoted fields.\n * The aggregate values of this field become the values of the new pivoted fields.\n * @param {string} [params.op] - The aggregation operation for the value field,\n * applied per cell in the output stream. The default is \"sum\".\n * @param {number} [params.limit] - An optional parameter indicating the maximum\n * number of pivoted fields to generate. The pivoted field names are sorted in\n * ascending order prior to enforcing the limit.\n */\nfunction Pivot(params) {\n Aggregate.call(this, params);\n}\nPivot.Definition = {\n 'type': 'Pivot',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'value',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'op',\n 'type': 'enum',\n 'values': ValidAggregateOps,\n 'default': 'sum'\n }, {\n 'name': 'limit',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'key',\n 'type': 'field'\n }]\n};\ninherits(Pivot, Aggregate, {\n _transform: Aggregate.prototype.transform,\n transform(_, pulse) {\n return this._transform(aggregateParams(_, pulse), pulse);\n }\n});\n\n// Shoehorn a pivot transform into an aggregate transform!\n// First collect all unique pivot field values.\n// Then generate aggregate fields for each output pivot field.\nfunction aggregateParams(_, pulse) {\n const key = _.field,\n value = _.value,\n op = (_.op === 'count' ? '__count__' : _.op) || 'sum',\n fields = accessorFields(key).concat(accessorFields(value)),\n keys = pivotKeys(key, _.limit || 0, pulse);\n\n // if data stream content changes, pivot fields may change\n // flag parameter modification to ensure re-initialization\n if (pulse.changed()) _.set('__pivot__', null, null, true);\n return {\n key: _.key,\n groupby: _.groupby,\n ops: keys.map(() => op),\n fields: keys.map(k => get(k, key, value, fields)),\n as: keys.map(k => k + ''),\n modified: _.modified.bind(_)\n };\n}\n\n// Generate aggregate field accessor.\n// Output NaN for non-existent values; aggregator will ignore!\nfunction get(k, key, value, fields) {\n return accessor(d => key(d) === k ? value(d) : NaN, fields, k + '');\n}\n\n// Collect (and optionally limit) all unique pivot values.\nfunction pivotKeys(key, limit, pulse) {\n const map = {},\n list = [];\n pulse.visit(pulse.SOURCE, t => {\n const k = key(t);\n if (!map[k]) {\n map[k] = 1;\n list.push(k);\n }\n });\n list.sort(ascending);\n return limit ? list.slice(0, limit) : list;\n}\n\n/**\n * Partitions pre-faceted data into tuple subflows.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(Dataflow, string): Operator} params.subflow - A function\n * that generates a subflow of operators and returns its root operator.\n * @param {function(object): Array} params.field - The field\n * accessor for an array of subflow tuple objects.\n */\nfunction PreFacet(params) {\n Facet.call(this, params);\n}\ninherits(PreFacet, Facet, {\n transform(_, pulse) {\n const flow = _.subflow,\n field = _.field,\n subflow = t => this.subflow(tupleid(t), flow, pulse, t);\n if (_.modified('field') || field && pulse.modified(accessorFields(field))) {\n error('PreFacet does not support field modification.');\n }\n this.initTargets(); // reset list of active subflows\n\n if (field) {\n pulse.visit(pulse.MOD, t => {\n const sf = subflow(t);\n field(t).forEach(_ => sf.mod(_));\n });\n pulse.visit(pulse.ADD, t => {\n const sf = subflow(t);\n field(t).forEach(_ => sf.add(ingest(_)));\n });\n pulse.visit(pulse.REM, t => {\n const sf = subflow(t);\n field(t).forEach(_ => sf.rem(_));\n });\n } else {\n pulse.visit(pulse.MOD, t => subflow(t).mod(t));\n pulse.visit(pulse.ADD, t => subflow(t).add(t));\n pulse.visit(pulse.REM, t => subflow(t).rem(t));\n }\n if (pulse.clean()) {\n pulse.runAfter(() => this.clean());\n }\n return pulse;\n }\n});\n\n/**\n * Performs a relational projection, copying selected fields from source\n * tuples to a new set of derived tuples.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.as] - Output field names for each projected\n * field. Any unspecified fields will use the field name provided by\n * the field accessor.\n */\nfunction Project(params) {\n Transform.call(this, null, params);\n}\nProject.Definition = {\n 'type': 'Project',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }]\n};\ninherits(Project, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n fields = _.fields,\n as = fieldNames(_.fields, _.as || []),\n derive = fields ? (s, t) => project(s, t, fields, as) : rederive;\n let lut;\n if (this.value) {\n lut = this.value;\n } else {\n pulse = pulse.addAll();\n lut = this.value = {};\n }\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n out.rem.push(lut[id]);\n lut[id] = null;\n });\n pulse.visit(pulse.ADD, t => {\n const dt = derive(t, ingest({}));\n lut[tupleid(t)] = dt;\n out.add.push(dt);\n });\n pulse.visit(pulse.MOD, t => {\n out.mod.push(derive(t, lut[tupleid(t)]));\n });\n return out;\n }\n});\nfunction project(s, t, fields, as) {\n for (let i = 0, n = fields.length; i < n; ++i) {\n t[as[i]] = fields[i](s);\n }\n return t;\n}\n\n/**\n * Proxy the value of another operator as a pure signal value.\n * Ensures no tuples are propagated.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {*} params.value - The value to proxy, becomes the value of this operator.\n */\nfunction Proxy(params) {\n Transform.call(this, null, params);\n}\ninherits(Proxy, Transform, {\n transform(_, pulse) {\n this.value = _.value;\n return _.modified('value') ? pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS) : pulse.StopPropagation;\n }\n});\n\n/**\n * Generates sample quantile values from an input data stream.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - An accessor for the data field\n * over which to calculate quantile values.\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby.\n * @param {Array} [params.probs] - An array of probabilities in\n * the range (0, 1) for which to compute quantile values. If not specified,\n * the *step* parameter will be used.\n * @param {Array} [params.step=0.01] - A probability step size for\n * sampling quantile values. All values from one-half the step size up to\n * 1 (exclusive) will be sampled. This parameter is only used if the\n * *quantiles* parameter is not provided.\n */\nfunction Quantile(params) {\n Transform.call(this, null, params);\n}\nQuantile.Definition = {\n 'type': 'Quantile',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'probs',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'step',\n 'type': 'number',\n 'default': 0.01\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'default': ['prob', 'value']\n }]\n};\nconst EPSILON = 1e-14;\ninherits(Quantile, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n as = _.as || ['prob', 'value'];\n if (this.value && !_.modified() && !pulse.changed()) {\n out.source = this.value;\n return out;\n }\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition$1(source, _.groupby, _.field),\n names = (_.groupby || []).map(accessorName),\n values = [],\n step = _.step || 0.01,\n p = _.probs || range(step / 2, 1 - EPSILON, step),\n n = p.length;\n groups.forEach(g => {\n const q = quantiles(g, p);\n for (let i = 0; i < n; ++i) {\n const t = {};\n for (let i = 0; i < names.length; ++i) {\n t[names[i]] = g.dims[i];\n }\n t[as[0]] = p[i];\n t[as[1]] = q[i];\n values.push(ingest(t));\n }\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n return out;\n }\n});\n\n/**\n * Relays a data stream between data processing pipelines.\n * If the derive parameter is set, this transform will create derived\n * copies of observed tuples. This provides derived data streams in which\n * modifications to the tuples do not pollute an upstream data source.\n * @param {object} params - The parameters for this operator.\n * @param {number} [params.derive=false] - Boolean flag indicating if\n * the transform should make derived copies of incoming tuples.\n * @constructor\n */\nfunction Relay(params) {\n Transform.call(this, null, params);\n}\ninherits(Relay, Transform, {\n transform(_, pulse) {\n let out, lut;\n if (this.value) {\n lut = this.value;\n } else {\n out = pulse = pulse.addAll();\n lut = this.value = {};\n }\n if (_.derive) {\n out = pulse.fork(pulse.NO_SOURCE);\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n out.rem.push(lut[id]);\n lut[id] = null;\n });\n pulse.visit(pulse.ADD, t => {\n const dt = derive(t);\n lut[tupleid(t)] = dt;\n out.add.push(dt);\n });\n pulse.visit(pulse.MOD, t => {\n const dt = lut[tupleid(t)];\n for (const k in t) {\n dt[k] = t[k];\n // down stream writes may overwrite re-derived tuples\n // conservatively mark all source fields as modified\n out.modifies(k);\n }\n out.mod.push(dt);\n });\n }\n return out;\n }\n});\n\n/**\n * Samples tuples passing through this operator.\n * Uses reservoir sampling to maintain a representative sample.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {number} [params.size=1000] - The maximum number of samples.\n */\nfunction Sample(params) {\n Transform.call(this, [], params);\n this.count = 0;\n}\nSample.Definition = {\n 'type': 'Sample',\n 'metadata': {},\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'default': 1000\n }]\n};\ninherits(Sample, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n mod = _.modified('size'),\n num = _.size,\n map = this.value.reduce((m, t) => (m[tupleid(t)] = 1, m), {});\n let res = this.value,\n cnt = this.count,\n cap = 0;\n\n // sample reservoir update function\n function update(t) {\n let p, idx;\n if (res.length < num) {\n res.push(t);\n } else {\n idx = ~~((cnt + 1) * random());\n if (idx < res.length && idx >= cap) {\n p = res[idx];\n if (map[tupleid(p)]) out.rem.push(p); // eviction\n res[idx] = t;\n }\n }\n ++cnt;\n }\n if (pulse.rem.length) {\n // find all tuples that should be removed, add to output\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n if (map[id]) {\n map[id] = -1;\n out.rem.push(t);\n }\n --cnt;\n });\n\n // filter removed tuples out of the sample reservoir\n res = res.filter(t => map[tupleid(t)] !== -1);\n }\n if ((pulse.rem.length || mod) && res.length < num && pulse.source) {\n // replenish sample if backing data source is available\n cap = cnt = res.length;\n pulse.visit(pulse.SOURCE, t => {\n // update, but skip previously sampled tuples\n if (!map[tupleid(t)]) update(t);\n });\n cap = -1;\n }\n if (mod && res.length > num) {\n const n = res.length - num;\n for (let i = 0; i < n; ++i) {\n map[tupleid(res[i])] = -1;\n out.rem.push(res[i]);\n }\n res = res.slice(n);\n }\n if (pulse.mod.length) {\n // propagate modified tuples in the sample reservoir\n pulse.visit(pulse.MOD, t => {\n if (map[tupleid(t)]) out.mod.push(t);\n });\n }\n if (pulse.add.length) {\n // update sample reservoir\n pulse.visit(pulse.ADD, update);\n }\n if (pulse.add.length || cap < 0) {\n // output newly added tuples\n out.add = res.filter(t => !map[tupleid(t)]);\n }\n this.count = cnt;\n this.value = out.source = res;\n return out;\n }\n});\n\n/**\n * Generates data tuples for a specified sequence range of numbers.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {number} params.start - The first number in the sequence.\n * @param {number} params.stop - The last number (exclusive) in the sequence.\n * @param {number} [params.step=1] - The step size between numbers in the sequence.\n */\nfunction Sequence(params) {\n Transform.call(this, null, params);\n}\nSequence.Definition = {\n 'type': 'Sequence',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'start',\n 'type': 'number',\n 'required': true\n }, {\n 'name': 'stop',\n 'type': 'number',\n 'required': true\n }, {\n 'name': 'step',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'data'\n }]\n};\ninherits(Sequence, Transform, {\n transform(_, pulse) {\n if (this.value && !_.modified()) return;\n const out = pulse.materialize().fork(pulse.MOD),\n as = _.as || 'data';\n out.rem = this.value ? pulse.rem.concat(this.value) : pulse.rem;\n this.value = range(_.start, _.stop, _.step || 1).map(v => {\n const t = {};\n t[as] = v;\n return ingest(t);\n });\n out.add = pulse.add.concat(this.value);\n return out;\n }\n});\n\n/**\n * Propagates a new pulse without any tuples so long as the input\n * pulse contains some added, removed or modified tuples.\n * @param {object} params - The parameters for this operator.\n * @constructor\n */\nfunction Sieve(params) {\n Transform.call(this, null, params);\n this.modified(true); // always treat as modified\n}\n\ninherits(Sieve, Transform, {\n transform(_, pulse) {\n this.value = pulse.source;\n return pulse.changed() ? pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS) : pulse.StopPropagation;\n }\n});\n\n/**\n * Discretize dates to specific time units.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The data field containing date/time values.\n */\nfunction TimeUnit(params) {\n Transform.call(this, null, params);\n}\nconst OUTPUT = ['unit0', 'unit1'];\nTimeUnit.Definition = {\n 'type': 'TimeUnit',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'interval',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'units',\n 'type': 'enum',\n 'values': TIME_UNITS,\n 'array': true\n }, {\n 'name': 'step',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'maxbins',\n 'type': 'number',\n 'default': 40\n }, {\n 'name': 'extent',\n 'type': 'date',\n 'array': true\n }, {\n 'name': 'timezone',\n 'type': 'enum',\n 'default': 'local',\n 'values': ['local', 'utc']\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': OUTPUT\n }]\n};\ninherits(TimeUnit, Transform, {\n transform(_, pulse) {\n const field = _.field,\n band = _.interval !== false,\n utc = _.timezone === 'utc',\n floor = this._floor(_, pulse),\n offset = (utc ? utcInterval : timeInterval)(floor.unit).offset,\n as = _.as || OUTPUT,\n u0 = as[0],\n u1 = as[1],\n step = floor.step;\n let min = floor.start || Infinity,\n max = floor.stop || -Infinity,\n flag = pulse.ADD;\n if (_.modified() || pulse.changed(pulse.REM) || pulse.modified(accessorFields(field))) {\n pulse = pulse.reflow(true);\n flag = pulse.SOURCE;\n min = Infinity;\n max = -Infinity;\n }\n pulse.visit(flag, t => {\n const v = field(t);\n let a, b;\n if (v == null) {\n t[u0] = null;\n if (band) t[u1] = null;\n } else {\n t[u0] = a = b = floor(v);\n if (band) t[u1] = b = offset(a, step);\n if (a < min) min = a;\n if (b > max) max = b;\n }\n });\n floor.start = min;\n floor.stop = max;\n return pulse.modifies(band ? as : u0);\n },\n _floor(_, pulse) {\n const utc = _.timezone === 'utc';\n\n // get parameters\n const {\n units,\n step\n } = _.units ? {\n units: _.units,\n step: _.step || 1\n } : timeBin({\n extent: _.extent || extent(pulse.materialize(pulse.SOURCE).source, _.field),\n maxbins: _.maxbins\n });\n\n // check / standardize time units\n const tunits = timeUnits(units),\n prev = this.value || {},\n floor = (utc ? utcFloor : timeFloor)(tunits, step);\n floor.unit = peek(tunits);\n floor.units = tunits;\n floor.step = step;\n floor.start = prev.start;\n floor.stop = prev.stop;\n return this.value = floor;\n }\n});\n\n/**\n * An index that maps from unique, string-coerced, field values to tuples.\n * Assumes that the field serves as a unique key with no duplicate values.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The field accessor to index.\n */\nfunction TupleIndex(params) {\n Transform.call(this, fastmap(), params);\n}\ninherits(TupleIndex, Transform, {\n transform(_, pulse) {\n const df = pulse.dataflow,\n field = _.field,\n index = this.value,\n set = t => index.set(field(t), t);\n let mod = true;\n if (_.modified('field') || pulse.modified(field.fields)) {\n index.clear();\n pulse.visit(pulse.SOURCE, set);\n } else if (pulse.changed()) {\n pulse.visit(pulse.REM, t => index.delete(field(t)));\n pulse.visit(pulse.ADD, set);\n } else {\n mod = false;\n }\n this.modified(mod);\n if (index.empty > df.cleanThreshold) df.runAfter(index.clean);\n return pulse.fork();\n }\n});\n\n/**\n * Extracts an array of values. Assumes the source data has already been\n * reduced as needed (e.g., by an upstream Aggregate transform).\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The domain field to extract.\n * @param {function(*,*): number} [params.sort] - An optional\n * comparator function for sorting the values. The comparator will be\n * applied to backing tuples prior to value extraction.\n */\nfunction Values(params) {\n Transform.call(this, null, params);\n}\ninherits(Values, Transform, {\n transform(_, pulse) {\n const run = !this.value || _.modified('field') || _.modified('sort') || pulse.changed() || _.sort && pulse.modified(_.sort.fields);\n if (run) {\n this.value = (_.sort ? pulse.source.slice().sort(stableCompare(_.sort)) : pulse.source).map(_.field);\n }\n }\n});\n\nfunction WindowOp(op, field, param, as) {\n const fn = WindowOps[op](field, param);\n return {\n init: fn.init || zero,\n update: function (w, t) {\n t[as] = fn.next(w);\n }\n };\n}\nconst WindowOps = {\n row_number: function () {\n return {\n next: w => w.index + 1\n };\n },\n rank: function () {\n let rank;\n return {\n init: () => rank = 1,\n next: w => {\n const i = w.index,\n data = w.data;\n return i && w.compare(data[i - 1], data[i]) ? rank = i + 1 : rank;\n }\n };\n },\n dense_rank: function () {\n let drank;\n return {\n init: () => drank = 1,\n next: w => {\n const i = w.index,\n d = w.data;\n return i && w.compare(d[i - 1], d[i]) ? ++drank : drank;\n }\n };\n },\n percent_rank: function () {\n const rank = WindowOps.rank(),\n next = rank.next;\n return {\n init: rank.init,\n next: w => (next(w) - 1) / (w.data.length - 1)\n };\n },\n cume_dist: function () {\n let cume;\n return {\n init: () => cume = 0,\n next: w => {\n const d = w.data,\n c = w.compare;\n let i = w.index;\n if (cume < i) {\n while (i + 1 < d.length && !c(d[i], d[i + 1])) ++i;\n cume = i;\n }\n return (1 + cume) / d.length;\n }\n };\n },\n ntile: function (field, num) {\n num = +num;\n if (!(num > 0)) error('ntile num must be greater than zero.');\n const cume = WindowOps.cume_dist(),\n next = cume.next;\n return {\n init: cume.init,\n next: w => Math.ceil(num * next(w))\n };\n },\n lag: function (field, offset) {\n offset = +offset || 1;\n return {\n next: w => {\n const i = w.index - offset;\n return i >= 0 ? field(w.data[i]) : null;\n }\n };\n },\n lead: function (field, offset) {\n offset = +offset || 1;\n return {\n next: w => {\n const i = w.index + offset,\n d = w.data;\n return i < d.length ? field(d[i]) : null;\n }\n };\n },\n first_value: function (field) {\n return {\n next: w => field(w.data[w.i0])\n };\n },\n last_value: function (field) {\n return {\n next: w => field(w.data[w.i1 - 1])\n };\n },\n nth_value: function (field, nth) {\n nth = +nth;\n if (!(nth > 0)) error('nth_value nth must be greater than zero.');\n return {\n next: w => {\n const i = w.i0 + (nth - 1);\n return i < w.i1 ? field(w.data[i]) : null;\n }\n };\n },\n prev_value: function (field) {\n let prev;\n return {\n init: () => prev = null,\n next: w => {\n const v = field(w.data[w.index]);\n return v != null ? prev = v : prev;\n }\n };\n },\n next_value: function (field) {\n let v, i;\n return {\n init: () => (v = null, i = -1),\n next: w => {\n const d = w.data;\n return w.index <= i ? v : (i = find(field, d, w.index)) < 0 ? (i = d.length, v = null) : v = field(d[i]);\n }\n };\n }\n};\nfunction find(field, data, index) {\n for (let n = data.length; index < n; ++index) {\n const v = field(data[index]);\n if (v != null) return index;\n }\n return -1;\n}\nconst ValidWindowOps = Object.keys(WindowOps);\n\nfunction WindowState(_) {\n const ops = array(_.ops),\n fields = array(_.fields),\n params = array(_.params),\n as = array(_.as),\n outputs = this.outputs = [],\n windows = this.windows = [],\n inputs = {},\n map = {},\n counts = [],\n measures = [];\n let countOnly = true;\n function visitInputs(f) {\n array(accessorFields(f)).forEach(_ => inputs[_] = 1);\n }\n visitInputs(_.sort);\n ops.forEach((op, i) => {\n const field = fields[i],\n mname = accessorName(field),\n name = measureName(op, mname, as[i]);\n visitInputs(field);\n outputs.push(name);\n\n // Window operation\n if (hasOwnProperty(WindowOps, op)) {\n windows.push(WindowOp(op, fields[i], params[i], name));\n }\n\n // Aggregate operation\n else {\n if (field == null && op !== 'count') {\n error('Null aggregate field specified.');\n }\n if (op === 'count') {\n counts.push(name);\n return;\n }\n countOnly = false;\n let m = map[mname];\n if (!m) {\n m = map[mname] = [];\n m.field = field;\n measures.push(m);\n }\n m.push(createMeasure(op, name));\n }\n });\n if (counts.length || measures.length) {\n this.cell = cell(measures, counts, countOnly);\n }\n this.inputs = Object.keys(inputs);\n}\nconst prototype = WindowState.prototype;\nprototype.init = function () {\n this.windows.forEach(_ => _.init());\n if (this.cell) this.cell.init();\n};\nprototype.update = function (w, t) {\n const cell = this.cell,\n wind = this.windows,\n data = w.data,\n m = wind && wind.length;\n let j;\n if (cell) {\n for (j = w.p0; j < w.i0; ++j) cell.rem(data[j]);\n for (j = w.p1; j < w.i1; ++j) cell.add(data[j]);\n cell.set(t);\n }\n for (j = 0; j < m; ++j) wind[j].update(w, t);\n};\nfunction cell(measures, counts, countOnly) {\n measures = measures.map(m => compileMeasures(m, m.field));\n const cell = {\n num: 0,\n agg: null,\n store: false,\n count: counts\n };\n if (!countOnly) {\n var n = measures.length,\n a = cell.agg = Array(n),\n i = 0;\n for (; i < n; ++i) a[i] = new measures[i](cell);\n }\n if (cell.store) {\n var store = cell.data = new TupleStore();\n }\n cell.add = function (t) {\n cell.num += 1;\n if (countOnly) return;\n if (store) store.add(t);\n for (let i = 0; i < n; ++i) {\n a[i].add(a[i].get(t), t);\n }\n };\n cell.rem = function (t) {\n cell.num -= 1;\n if (countOnly) return;\n if (store) store.rem(t);\n for (let i = 0; i < n; ++i) {\n a[i].rem(a[i].get(t), t);\n }\n };\n cell.set = function (t) {\n let i, n;\n\n // consolidate stored values\n if (store) store.values();\n\n // update tuple properties\n for (i = 0, n = counts.length; i < n; ++i) t[counts[i]] = cell.num;\n if (!countOnly) for (i = 0, n = a.length; i < n; ++i) a[i].set(t);\n };\n cell.init = function () {\n cell.num = 0;\n if (store) store.reset();\n for (let i = 0; i < n; ++i) a[i].init();\n };\n return cell;\n}\n\n/**\n * Perform window calculations and write results to the input stream.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - A comparator function for sorting tuples within a window.\n * @param {Array} [params.groupby] - An array of accessors by which to partition tuples into separate windows.\n * @param {Array} params.ops - An array of strings indicating window operations to perform.\n * @param {Array} [params.fields] - An array of accessors\n * for data fields to use as inputs to window operations.\n * @param {Array<*>} [params.params] - An array of parameter values for window operations.\n * @param {Array} [params.as] - An array of output field names for window operations.\n * @param {Array} [params.frame] - Window frame definition as two-element array.\n * @param {boolean} [params.ignorePeers=false] - If true, base window frame boundaries on row\n * number alone, ignoring peers with identical sort values. If false (default),\n * the window boundaries will be adjusted to include peer values.\n */\nfunction Window(params) {\n Transform.call(this, {}, params);\n this._mlen = 0;\n this._mods = [];\n}\nWindow.Definition = {\n 'type': 'Window',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'ops',\n 'type': 'enum',\n 'array': true,\n 'values': ValidWindowOps.concat(ValidAggregateOps)\n }, {\n 'name': 'params',\n 'type': 'number',\n 'null': true,\n 'array': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'null': true,\n 'array': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }, {\n 'name': 'frame',\n 'type': 'number',\n 'null': true,\n 'array': true,\n 'length': 2,\n 'default': [null, 0]\n }, {\n 'name': 'ignorePeers',\n 'type': 'boolean',\n 'default': false\n }]\n};\ninherits(Window, Transform, {\n transform(_, pulse) {\n this.stamp = pulse.stamp;\n const mod = _.modified(),\n cmp = stableCompare(_.sort),\n key = groupkey(_.groupby),\n group = t => this.group(key(t));\n\n // initialize window state\n let state = this.state;\n if (!state || mod) {\n state = this.state = new WindowState(_);\n }\n\n // partition input tuples\n if (mod || pulse.modified(state.inputs)) {\n this.value = {};\n pulse.visit(pulse.SOURCE, t => group(t).add(t));\n } else {\n pulse.visit(pulse.REM, t => group(t).remove(t));\n pulse.visit(pulse.ADD, t => group(t).add(t));\n }\n\n // perform window calculations for each modified partition\n for (let i = 0, n = this._mlen; i < n; ++i) {\n processPartition(this._mods[i], state, cmp, _);\n }\n this._mlen = 0;\n this._mods = [];\n\n // TODO don't reflow everything?\n return pulse.reflow(mod).modifies(state.outputs);\n },\n group(key) {\n let group = this.value[key];\n if (!group) {\n group = this.value[key] = SortedList(tupleid);\n group.stamp = -1;\n }\n if (group.stamp < this.stamp) {\n group.stamp = this.stamp;\n this._mods[this._mlen++] = group;\n }\n return group;\n }\n});\nfunction processPartition(list, state, cmp, _) {\n const sort = _.sort,\n range = sort && !_.ignorePeers,\n frame = _.frame || [null, 0],\n data = list.data(cmp),\n // use cmp for stable sort\n n = data.length,\n b = range ? bisector(sort) : null,\n w = {\n i0: 0,\n i1: 0,\n p0: 0,\n p1: 0,\n index: 0,\n data: data,\n compare: sort || constant(-1)\n };\n state.init();\n for (let i = 0; i < n; ++i) {\n setWindow(w, frame, i, n);\n if (range) adjustRange(w, b);\n state.update(w, data[i]);\n }\n}\nfunction setWindow(w, f, i, n) {\n w.p0 = w.i0;\n w.p1 = w.i1;\n w.i0 = f[0] == null ? 0 : Math.max(0, i - Math.abs(f[0]));\n w.i1 = f[1] == null ? n : Math.min(n, i + Math.abs(f[1]) + 1);\n w.index = i;\n}\n\n// if frame type is 'range', adjust window for peer values\nfunction adjustRange(w, bisect) {\n const r0 = w.i0,\n r1 = w.i1 - 1,\n c = w.compare,\n d = w.data,\n n = d.length - 1;\n if (r0 > 0 && !c(d[r0], d[r0 - 1])) w.i0 = bisect.left(d, d[r0]);\n if (r1 < n && !c(d[r1], d[r1 + 1])) w.i1 = bisect.right(d, d[r1]);\n}\n\nexport { Aggregate as aggregate, Bin as bin, Collect as collect, Compare as compare, CountPattern as countpattern, Cross as cross, Density as density, DotBin as dotbin, Expression as expression, Extent as extent, Facet as facet, Field as field, Filter as filter, Flatten as flatten, Fold as fold, Formula as formula, Generate as generate, Impute as impute, JoinAggregate as joinaggregate, KDE as kde, Key as key, Load as load, Lookup as lookup, MultiExtent as multiextent, MultiValues as multivalues, Params as params, Pivot as pivot, PreFacet as prefacet, Project as project, Proxy as proxy, Quantile as quantile, Relay as relay, Sample as sample, Sequence as sequence, Sieve as sieve, Subflow as subflow, TimeUnit as timeunit, TupleIndex as tupleindex, Values as values, Window as window };\n","export default function mean(values, valueof) {\n let count = 0;\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n ++count, sum += value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n ++count, sum += value;\n }\n }\n }\n if (count) return sum / count;\n}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // falls through\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n","export default function() {}\n","import noop from \"../noop.js\";\nimport {point} from \"./basis.js\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n","import {point} from \"./basis.js\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n","import {Basis} from \"./basis.js\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {point} from \"./cardinal.js\";\n\nexport function CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalOpen(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import noop from \"../noop.js\";\nimport {point} from \"./cardinal.js\";\n\nexport function CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import {epsilon} from \"../math.js\";\nimport {Cardinal} from \"./cardinal.js\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalClosed} from \"./cardinalClosed.js\";\nimport noop from \"../noop.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalOpen} from \"./cardinalOpen.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","import noop from \"../noop.js\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction append(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n let d = Math.floor(digits);\n if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);\n if (d > 15) return append;\n const k = 10 ** d;\n return function(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n}\n\nexport class Path {\n constructor(digits) {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n this._append = digits == null ? append : appendRound(digits);\n }\n moveTo(x, y) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._append`Z`;\n }\n }\n lineTo(x, y) {\n this._append`L${this._x1 = +x},${this._y1 = +y}`;\n }\n quadraticCurveTo(x1, y1, x, y) {\n this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;\n }\n bezierCurveTo(x1, y1, x2, y2, x, y) {\n this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;\n }\n arcTo(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._append`M${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._append`L${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Otherwise, draw an arc!\n else {\n let x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;\n }\n\n this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;\n }\n }\n arc(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._append`M${x0},${y0}`;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._append`L${x0},${y0}`;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._append`A${r},${r},0,1,${cw},${x - dx},${y - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x + r * Math.cos(a1)},${this._y1 = y + r * Math.sin(a1)}`;\n }\n }\n rect(x, y, w, h) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;\n }\n toString() {\n return this._;\n }\n}\n\nexport function path() {\n return new Path;\n}\n\n// Allow instanceof d3.path\npath.prototype = Path.prototype;\n\nexport function pathRound(digits = 3) {\n return new Path(+digits);\n}\n","import {Path} from \"d3-path\";\n\nexport function withPath(shape) {\n let digits = 3;\n\n shape.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) {\n digits = null;\n } else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n return shape;\n };\n\n return () => new Path(digits);\n}\n","import constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\nimport {withPath} from \"./path.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null,\n path = withPath(arc);\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle. If this\n // intersection fails, it’s probably because the arc is too small, so\n // disable the corner radius entirely.\n if (da < pi) {\n if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n } else {\n rc0 = rc1 = 0;\n }\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n","export var slice = Array.prototype.slice;\n\nexport default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x, y) {\n var defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(line);\n\n x = typeof x === \"function\" ? x : (x === undefined) ? pointX : constant(x);\n y = typeof y === \"function\" ? y : (y === undefined) ? pointY : constant(y);\n\n function line(data) {\n var i,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x0, y0, y1) {\n var x1 = null,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(area);\n\n x0 = typeof x0 === \"function\" ? x0 : (x0 === undefined) ? pointX : constant(+x0);\n y0 = typeof y0 === \"function\" ? y0 : (y0 === undefined) ? constant(0) : constant(+y0);\n y1 = typeof y1 === \"function\" ? y1 : (y1 === undefined) ? pointY : constant(+y1);\n\n function area(data) {\n var i,\n j,\n k,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n","import {min, sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const r = sqrt(size + min(size / 28, 0.75)) * 0.59436;\n const t = r / 2;\n const u = t * sqrt3;\n context.moveTo(0, r);\n context.lineTo(0, -r);\n context.moveTo(-u, -t);\n context.lineTo(u, t);\n context.moveTo(-u, t);\n context.lineTo(u, -t);\n }\n};\n","import {pi, sqrt, tau} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst tan30 = sqrt(1 / 3);\nconst tan30_2 = tan30 * 2;\n\nexport default {\n draw(context, size) {\n const y = sqrt(size / tan30_2);\n const x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n","import {sin, cos, sqrt, pi, tau} from \"../math.js\";\n\nconst ka = 0.89081309152928522810;\nconst kr = sin(pi / 10) / sin(7 * pi / 10);\nconst kx = sin(tau / 10) * kr;\nconst ky = -cos(tau / 10) * kr;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size * ka);\n const x = kx * r;\n const y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (let i = 1; i < 5; ++i) {\n const a = tau * i / 5;\n const c = cos(a);\n const s = sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n","function domCanvas(w, h) {\n if (typeof document !== 'undefined' && document.createElement) {\n const c = document.createElement('canvas');\n if (c && c.getContext) {\n c.width = w;\n c.height = h;\n return c;\n }\n }\n return null;\n}\nconst domImage = () => typeof Image !== 'undefined' ? Image : null;\n\nexport { domCanvas as canvas, domCanvas, domImage as image };\n","import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const y = -sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const s = sqrt(size) * 0.6824;\n const t = s / 2;\n const u = (s * sqrt3) / 2; // cos(Math.PI / 6)\n context.moveTo(0, -s);\n context.lineTo(u, t);\n context.lineTo(-u, t);\n context.closePath();\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst c = -0.5;\nconst s = sqrt(3) / 2;\nconst k = 1 / sqrt(12);\nconst a = (k / 2 + 1) * 3;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / a);\n const x0 = r / 2, y0 = r * k;\n const x1 = x0, y1 = r * k + r;\n const x2 = -x1, y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n","import ascending from \"./ascending.js\";\nimport bisector from \"./bisector.js\";\nimport number from \"./number.js\";\n\nconst ascendingBisect = bisector(ascending);\nexport const bisectRight = ascendingBisect.right;\nexport const bisectLeft = ascendingBisect.left;\nexport const bisectCenter = bisector(number).center;\nexport default bisectRight;\n","export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHex8: color_formatHex8,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb() {\n return this;\n },\n clamp() {\n return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n },\n displayable() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatHex8: rgb_formatHex8,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n value = clampi(value);\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n clamp() {\n return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n },\n displayable() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n }\n}));\n\nfunction clamph(value) {\n value = (value || 0) % 360;\n return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","import {basis} from \"./basis.js\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","export default x => () => x;\n","import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n","import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n","export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n","import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n","export default function number(x) {\n return +x;\n}\n","import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateNumber, interpolateRound} from \"d3-interpolate\";\nimport constant from \"./constant.js\";\nimport number from \"./number.js\";\n\nvar unit = [0, 1];\n\nexport function identity(x) {\n return x;\n}\n\nfunction normalize(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n var t;\n if (a > b) t = a, a = b, b = t;\n return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = normalize(domain[i], domain[i + 1]);\n r[i] = interpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport function transformer() {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n transform,\n untransform,\n unknown,\n clamp = identity,\n piecewise,\n output,\n input;\n\n function rescale() {\n var n = Math.min(domain.length, range.length);\n if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);\n piecewise = n > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n }\n\n scale.invert = function(y) {\n return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = Array.from(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t, u) {\n transform = t, untransform = u;\n return rescale();\n };\n}\n\nexport default function continuous() {\n return transformer()(identity, identity);\n}\n","export default function constants(x) {\n return function() {\n return x;\n };\n}\n","export function initRange(domain, range) {\n switch (arguments.length) {\n case 0: break;\n case 1: this.range(domain); break;\n default: this.range(range).domain(domain); break;\n }\n return this;\n}\n\nexport function initInterpolator(domain, interpolator) {\n switch (arguments.length) {\n case 0: break;\n case 1: {\n if (typeof domain === \"function\") this.interpolator(domain);\n else this.range(domain);\n break;\n }\n default: {\n this.domain(domain);\n if (typeof interpolator === \"function\") this.interpolator(interpolator);\n else this.range(interpolator);\n break;\n }\n }\n return this;\n}\n","import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function tickFormat(start, stop, count, specifier) {\n var step = tickStep(start, stop, count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n","import {ticks, tickIncrement} from \"d3-array\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport tickFormat from \"./tickFormat.js\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n var d = domain();\n return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain();\n var i0 = 0;\n var i1 = d.length - 1;\n var start = d[i0];\n var stop = d[i1];\n var prestep;\n var step;\n var maxIter = 10;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n \n while (maxIter-- > 0) {\n step = tickIncrement(start, stop, count);\n if (step === prestep) {\n d[i0] = start\n d[i1] = stop\n return domain(d);\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n } else {\n break;\n }\n prestep = step;\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous();\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n","export default function nice(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n","import {ticks} from \"d3-array\";\nimport {format, formatSpecifier} from \"d3-format\";\nimport nice from \"./nice.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformLog(x) {\n return Math.log(x);\n}\n\nfunction transformExp(x) {\n return Math.exp(x);\n}\n\nfunction transformLogn(x) {\n return -Math.log(-x);\n}\n\nfunction transformExpn(x) {\n return -Math.exp(-x);\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : x => Math.pow(base, x);\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), x => Math.log(x) / base);\n}\n\nfunction reflect(f) {\n return (x, k) => -f(-x, k);\n}\n\nexport function loggish(transform) {\n const scale = transform(transformLog, transformExp);\n const domain = scale.domain;\n let base = 10;\n let logs;\n let pows;\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) {\n logs = reflect(logs), pows = reflect(pows);\n transform(transformLogn, transformExpn);\n } else {\n transform(transformLog, transformExp);\n }\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = count => {\n const d = domain();\n let u = d[0];\n let v = d[d.length - 1];\n const r = v < u;\n\n if (r) ([u, v] = [v, u]);\n\n let i = logs(u);\n let j = logs(v);\n let k;\n let t;\n const n = count == null ? 10 : +count;\n let z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.floor(i), j = Math.ceil(j);\n if (u > 0) for (; i <= j; ++i) {\n for (k = 1; k < base; ++k) {\n t = i < 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i <= j; ++i) {\n for (k = base - 1; k >= 1; --k) {\n t = i > 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n if (z.length * 2 < n) z = ticks(u, v, n);\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = (count, specifier) => {\n if (count == null) count = 10;\n if (specifier == null) specifier = base === 10 ? \"s\" : \",\";\n if (typeof specifier !== \"function\") {\n if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;\n specifier = format(specifier);\n }\n if (count === Infinity) return specifier;\n const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return d => {\n let i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = () => {\n return domain(nice(domain(), {\n floor: x => pows(Math.floor(logs(x))),\n ceil: x => pows(Math.ceil(logs(x)))\n }));\n };\n\n return scale;\n}\n\nexport default function log() {\n const scale = loggish(transformer()).domain([1, 10]);\n scale.copy = () => copy(scale, log()).base(scale.base());\n initRange.apply(scale, arguments);\n return scale;\n}\n","import {linearish} from \"./linear.js\";\nimport {copy, identity, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformPow(exponent) {\n return function(x) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n };\n}\n\nfunction transformSqrt(x) {\n return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);\n}\n\nfunction transformSquare(x) {\n return x < 0 ? -x * x : x * x;\n}\n\nexport function powish(transform) {\n var scale = transform(identity, identity),\n exponent = 1;\n\n function rescale() {\n return exponent === 1 ? transform(identity, identity)\n : exponent === 0.5 ? transform(transformSqrt, transformSquare)\n : transform(transformPow(exponent), transformPow(1 / exponent));\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, rescale()) : exponent;\n };\n\n return linearish(scale);\n}\n\nexport default function pow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, pow()).exponent(scale.exponent());\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n\nexport function sqrt() {\n return pow.apply(null, arguments).exponent(0.5);\n}\n","import {linearish} from \"./linear.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformSymlog(c) {\n return function(x) {\n return Math.sign(x) * Math.log1p(Math.abs(x / c));\n };\n}\n\nfunction transformSymexp(c) {\n return function(x) {\n return Math.sign(x) * Math.expm1(Math.abs(x)) * c;\n };\n}\n\nexport function symlogish(transform) {\n var c = 1, scale = transform(transformSymlog(c), transformSymexp(c));\n\n scale.constant = function(_) {\n return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c;\n };\n\n return linearish(scale);\n}\n\nexport default function symlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, symlog()).constant(scale.constant());\n };\n\n return initRange.apply(scale, arguments);\n}\n","import {bisector, tickStep} from \"d3-array\";\nimport {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from \"./duration.js\";\nimport {millisecond} from \"./millisecond.js\";\nimport {second} from \"./second.js\";\nimport {timeMinute, utcMinute} from \"./minute.js\";\nimport {timeHour, utcHour} from \"./hour.js\";\nimport {timeDay, unixDay} from \"./day.js\";\nimport {timeSunday, utcSunday} from \"./week.js\";\nimport {timeMonth, utcMonth} from \"./month.js\";\nimport {timeYear, utcYear} from \"./year.js\";\n\nfunction ticker(year, month, week, day, hour, minute) {\n\n const tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function ticks(start, stop, count) {\n const reverse = stop < start;\n if (reverse) [start, stop] = [stop, start];\n const interval = count && typeof count.range === \"function\" ? count : tickInterval(start, stop, count);\n const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop\n return reverse ? ticks.reverse() : ticks;\n }\n\n function tickInterval(start, stop, count) {\n const target = Math.abs(stop - start) / count;\n const i = bisector(([,, step]) => step).right(tickIntervals, target);\n if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));\n if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));\n const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n return t.every(step);\n }\n\n return [ticks, tickInterval];\n}\n\nconst [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);\n\nexport {utcTicks, utcTickInterval, timeTicks, timeTickInterval};\n","import {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeTicks, timeTickInterval} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport nice from \"./nice.js\";\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {\n var scale = continuous(),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(Array.from(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval) {\n var d = domain();\n if (!interval || typeof interval.range !== \"function\") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);\n return interval ? domain(nice(d, interval)) : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));\n };\n\n return scale;\n}\n\nexport default function time() {\n return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);\n}\n","import {interpolate, interpolateRound} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 1,\n t0,\n t1,\n k10,\n transform,\n interpolator = identity,\n clamp = false,\n unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1;\n return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0);\n return scale;\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .interpolator(source.interpolator())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport default function sequential() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, sequential());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialLog() {\n var scale = loggish(transformer()).domain([1, 10]);\n\n scale.copy = function() {\n return copy(scale, sequentialLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSqrt() {\n return sequentialPow.apply(null, arguments).exponent(0.5);\n}\n","import {default as value} from \"./value.js\";\n\nexport default function piecewise(interpolate, values) {\n if (values === undefined) values = interpolate, interpolate = value;\n var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);\n while (i < n) I[i] = interpolate(v, v = values[++i]);\n return function(t) {\n var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));\n return I[i](t - i);\n };\n}\n","import {interpolate, interpolateRound, piecewise} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {copy} from \"./sequential.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 0.5,\n x2 = 1,\n s = 1,\n t0,\n t1,\n t2,\n k10,\n k21,\n interpolator = identity,\n transform,\n clamp = false,\n unknown;\n\n function scale(x) {\n return isNaN(x = +x) ? unknown : (x = 0.5 + ((x = +transform(x)) - t1) * (s * x < s * t1 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1, x2] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1, scale) : [x0, x1, x2];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1, r2;\n return arguments.length ? ([r0, r1, r2] = _, interpolator = piecewise(interpolate, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), t2 = t(x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1;\n return scale;\n };\n}\n\nexport default function diverging() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, diverging());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingLog() {\n var scale = loggish(transformer()).domain([0.1, 1, 10]);\n\n scale.copy = function() {\n return copy(scale, divergingLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSqrt() {\n return divergingPow.apply(null, arguments).exponent(0.5);\n}\n","export class InternMap extends Map {\n constructor(entries, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (entries != null) for (const [key, value] of entries) this.set(key, value);\n }\n get(key) {\n return super.get(intern_get(this, key));\n }\n has(key) {\n return super.has(intern_get(this, key));\n }\n set(key, value) {\n return super.set(intern_set(this, key), value);\n }\n delete(key) {\n return super.delete(intern_delete(this, key));\n }\n}\n\nexport class InternSet extends Set {\n constructor(values, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (values != null) for (const value of values) this.add(value);\n }\n has(value) {\n return super.has(intern_get(this, value));\n }\n add(value) {\n return super.add(intern_set(this, value));\n }\n delete(value) {\n return super.delete(intern_delete(this, value));\n }\n}\n\nfunction intern_get({_intern, _key}, value) {\n const key = _key(value);\n return _intern.has(key) ? _intern.get(key) : value;\n}\n\nfunction intern_set({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) return _intern.get(key);\n _intern.set(key, value);\n return value;\n}\n\nfunction intern_delete({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) {\n value = _intern.get(key);\n _intern.delete(key);\n }\n return value;\n}\n\nfunction keyof(value) {\n return value !== null && typeof value === \"object\" ? value.valueOf() : value;\n}\n","import {InternMap} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport const implicit = Symbol(\"implicit\");\n\nexport default function ordinal() {\n var index = new InternMap(),\n domain = [],\n range = [],\n unknown = implicit;\n\n function scale(d) {\n let i = index.get(d);\n if (i === undefined) {\n if (unknown !== implicit) return unknown;\n index.set(d, i = domain.push(d) - 1);\n }\n return range[i % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = new InternMap();\n for (const value of _) {\n if (index.has(value)) continue;\n index.set(value, domain.push(value) - 1);\n }\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal(domain, range).unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n","export default function(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n","import {hue} from \"./color.js\";\n\nexport default function(a, b) {\n var i = hue(+a, +b);\n return function(t) {\n var x = i(t);\n return x - 360 * Math.floor(x / 360);\n };\n}\n","var degrees = 180 / Math.PI;\n\nexport var identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n","import decompose, {identity} from \"./decompose.js\";\n\nvar svgNode;\n\n/* eslint-disable no-undef */\nexport function parseCss(value) {\n const m = new (typeof DOMMatrix === \"function\" ? DOMMatrix : WebKitCSSMatrix)(value + \"\");\n return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);\n}\n\nexport function parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n","import number from \"../number.js\";\nimport {parseCss, parseSvg} from \"./parse.js\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n","var epsilon2 = 1e-12;\n\nfunction cosh(x) {\n return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\nexport default (function zoomRho(rho, rho2, rho4) {\n\n // p0 = [ux0, uy0, w0]\n // p1 = [ux1, uy1, w1]\n function zoom(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 ≅ u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000 * rho / Math.SQRT2;\n\n return i;\n }\n\n zoom.rho = function(_) {\n var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;\n return zoomRho(_1, _2, _4);\n };\n\n return zoom;\n})(Math.SQRT2, 2, 4);\n","import {hsl as colorHsl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hsl(hue) {\n return function(start, end) {\n var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hsl(hue);\nexport var hslLong = hsl(color);\n","export const radians = Math.PI / 180;\nexport const degrees = 180 / Math.PI;\n","import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\n// https://observablehq.com/@mbostock/lab-and-rgb\nconst K = 18,\n Xn = 0.96422,\n Yn = 1,\n Zn = 0.82521,\n t0 = 4 / 29,\n t1 = 6 / 29,\n t2 = 3 * t1 * t1,\n t3 = t1 * t1 * t1;\n\nfunction labConvert(o) {\n if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);\n if (o instanceof Hcl) return hcl2lab(o);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = rgb2lrgb(o.r),\n g = rgb2lrgb(o.g),\n b = rgb2lrgb(o.b),\n y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;\n if (r === g && g === b) x = z = y; else {\n x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);\n z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);\n }\n return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);\n}\n\nexport function gray(l, opacity) {\n return new Lab(l, 0, 0, opacity == null ? 1 : opacity);\n}\n\nexport default function lab(l, a, b, opacity) {\n return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);\n}\n\nexport function Lab(l, a, b, opacity) {\n this.l = +l;\n this.a = +a;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Lab, lab, extend(Color, {\n brighter(k) {\n return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n darker(k) {\n return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n rgb() {\n var y = (this.l + 16) / 116,\n x = isNaN(this.a) ? y : y + this.a / 500,\n z = isNaN(this.b) ? y : y - this.b / 200;\n x = Xn * lab2xyz(x);\n y = Yn * lab2xyz(y);\n z = Zn * lab2xyz(z);\n return new Rgb(\n lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),\n lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),\n lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),\n this.opacity\n );\n }\n}));\n\nfunction xyz2lab(t) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction lrgb2rgb(x) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2lrgb(x) {\n return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\nfunction hclConvert(o) {\n if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);\n if (!(o instanceof Lab)) o = labConvert(o);\n if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);\n var h = Math.atan2(o.b, o.a) * degrees;\n return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);\n}\n\nexport function lch(l, c, h, opacity) {\n return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function hcl(h, c, l, opacity) {\n return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function Hcl(h, c, l, opacity) {\n this.h = +h;\n this.c = +c;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nfunction hcl2lab(o) {\n if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);\n var h = o.h * radians;\n return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);\n}\n\ndefine(Hcl, hcl, extend(Color, {\n brighter(k) {\n return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);\n },\n darker(k) {\n return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);\n },\n rgb() {\n return hcl2lab(this).rgb();\n }\n}));\n","import {lab as colorLab} from \"d3-color\";\nimport color from \"./color.js\";\n\nexport default function lab(start, end) {\n var l = color((start = colorLab(start)).l, (end = colorLab(end)).l),\n a = color(start.a, end.a),\n b = color(start.b, end.b),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.l = l(t);\n start.a = a(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n}\n","import {hcl as colorHcl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hcl(hue) {\n return function(start, end) {\n var h = hue((start = colorHcl(start)).h, (end = colorHcl(end)).h),\n c = color(start.c, end.c),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.c = c(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hcl(hue);\nexport var hclLong = hcl(color);\n","import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb, darker, brighter} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * degrees - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nexport default function cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nexport function Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * radians,\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new Rgb(\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n","import {cubehelix as colorCubehelix} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\nexport default cubehelix(hue);\nexport var cubehelixLong = cubehelix(color);\n","export default function(interpolator, n) {\n var samples = new Array(n);\n for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));\n return samples;\n}\n","import { toNumber, peek, toSet, array, constant, isNumber, span, isObject, isString, error, isArray } from 'vega-util';\nimport { bisectRight, range, bisect } from 'd3-array';\nimport * as $ from 'd3-scale';\nimport { scaleOrdinal, tickFormat as tickFormat$1 } from 'd3-scale';\nexport { scaleImplicit } from 'd3-scale';\nimport * as $$1 from 'd3-interpolate';\nimport { timeInterval, utcInterval } from 'vega-time';\n\nfunction bandSpace (count, paddingInner, paddingOuter) {\n const space = count - paddingInner + paddingOuter * 2;\n return count ? space > 0 ? space : 1 : 0;\n}\n\nconst Identity = 'identity';\nconst Linear = 'linear';\nconst Log = 'log';\nconst Pow = 'pow';\nconst Sqrt = 'sqrt';\nconst Symlog = 'symlog';\nconst Time = 'time';\nconst UTC = 'utc';\nconst Sequential = 'sequential';\nconst Diverging = 'diverging';\nconst Quantile = 'quantile';\nconst Quantize = 'quantize';\nconst Threshold = 'threshold';\nconst Ordinal = 'ordinal';\nconst Point = 'point';\nconst Band = 'band';\nconst BinOrdinal = 'bin-ordinal';\n\n// categories\nconst Continuous = 'continuous';\nconst Discrete = 'discrete';\nconst Discretizing = 'discretizing';\nconst Interpolating = 'interpolating';\nconst Temporal = 'temporal';\n\nfunction invertRange (scale) {\n return function (_) {\n let lo = _[0],\n hi = _[1],\n t;\n if (hi < lo) {\n t = lo;\n lo = hi;\n hi = t;\n }\n return [scale.invert(lo), scale.invert(hi)];\n };\n}\n\nfunction invertRangeExtent (scale) {\n return function (_) {\n const range = scale.range();\n let lo = _[0],\n hi = _[1],\n min = -1,\n max,\n t,\n i,\n n;\n if (hi < lo) {\n t = lo;\n lo = hi;\n hi = t;\n }\n for (i = 0, n = range.length; i < n; ++i) {\n if (range[i] >= lo && range[i] <= hi) {\n if (min < 0) min = i;\n max = i;\n }\n }\n if (min < 0) return undefined;\n lo = scale.invertExtent(range[min]);\n hi = scale.invertExtent(range[max]);\n return [lo[0] === undefined ? lo[1] : lo[0], hi[1] === undefined ? hi[0] : hi[1]];\n };\n}\n\nfunction band() {\n const scale = scaleOrdinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range;\n let range$1 = [0, 1],\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n delete scale.unknown;\n function rescale() {\n const n = domain().length,\n reverse = range$1[1] < range$1[0],\n stop = range$1[1 - reverse],\n space = bandSpace(n, paddingInner, paddingOuter);\n let start = range$1[reverse - 0];\n step = (stop - start) / (space || 1);\n if (round) {\n step = Math.floor(step);\n }\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) {\n start = Math.round(start);\n bandwidth = Math.round(bandwidth);\n }\n const values = range(n).map(i => start + step * i);\n return ordinalRange(reverse ? values.reverse() : values);\n }\n scale.domain = function (_) {\n if (arguments.length) {\n domain(_);\n return rescale();\n } else {\n return domain();\n }\n };\n scale.range = function (_) {\n if (arguments.length) {\n range$1 = [+_[0], +_[1]];\n return rescale();\n } else {\n return range$1.slice();\n }\n };\n scale.rangeRound = function (_) {\n range$1 = [+_[0], +_[1]];\n round = true;\n return rescale();\n };\n scale.bandwidth = function () {\n return bandwidth;\n };\n scale.step = function () {\n return step;\n };\n scale.round = function (_) {\n if (arguments.length) {\n round = !!_;\n return rescale();\n } else {\n return round;\n }\n };\n scale.padding = function (_) {\n if (arguments.length) {\n paddingOuter = Math.max(0, Math.min(1, _));\n paddingInner = paddingOuter;\n return rescale();\n } else {\n return paddingInner;\n }\n };\n scale.paddingInner = function (_) {\n if (arguments.length) {\n paddingInner = Math.max(0, Math.min(1, _));\n return rescale();\n } else {\n return paddingInner;\n }\n };\n scale.paddingOuter = function (_) {\n if (arguments.length) {\n paddingOuter = Math.max(0, Math.min(1, _));\n return rescale();\n } else {\n return paddingOuter;\n }\n };\n scale.align = function (_) {\n if (arguments.length) {\n align = Math.max(0, Math.min(1, _));\n return rescale();\n } else {\n return align;\n }\n };\n scale.invertRange = function (_) {\n // bail if range has null or undefined values\n if (_[0] == null || _[1] == null) return;\n const reverse = range$1[1] < range$1[0],\n values = reverse ? ordinalRange().reverse() : ordinalRange(),\n n = values.length - 1;\n let lo = +_[0],\n hi = +_[1],\n a,\n b,\n t;\n\n // bail if either range endpoint is invalid\n if (lo !== lo || hi !== hi) return;\n\n // order range inputs, bail if outside of scale range\n if (hi < lo) {\n t = lo;\n lo = hi;\n hi = t;\n }\n if (hi < values[0] || lo > range$1[1 - reverse]) return;\n\n // binary search to index into scale range\n a = Math.max(0, bisectRight(values, lo) - 1);\n b = lo === hi ? a : bisectRight(values, hi) - 1;\n\n // increment index a if lo is within padding gap\n if (lo - values[a] > bandwidth + 1e-10) ++a;\n if (reverse) {\n // map + swap\n t = a;\n a = n - b;\n b = n - t;\n }\n return a > b ? undefined : domain().slice(a, b + 1);\n };\n scale.invert = function (_) {\n const value = scale.invertRange([_, _]);\n return value ? value[0] : value;\n };\n scale.copy = function () {\n return band().domain(domain()).range(range$1).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);\n };\n return rescale();\n}\nfunction pointish(scale) {\n const copy = scale.copy;\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n scale.copy = function () {\n return pointish(copy());\n };\n return scale;\n}\nfunction point() {\n return pointish(band().paddingInner(1));\n}\n\nvar map = Array.prototype.map;\nfunction numbers(_) {\n return map.call(_, toNumber);\n}\n\nconst slice = Array.prototype.slice;\n\nfunction scaleBinOrdinal() {\n let domain = [],\n range = [];\n function scale(x) {\n return x == null || x !== x ? undefined : range[(bisect(domain, x) - 1) % range.length];\n }\n scale.domain = function (_) {\n if (arguments.length) {\n domain = numbers(_);\n return scale;\n } else {\n return domain.slice();\n }\n };\n scale.range = function (_) {\n if (arguments.length) {\n range = slice.call(_);\n return scale;\n } else {\n return range.slice();\n }\n };\n scale.tickFormat = function (count, specifier) {\n return tickFormat$1(domain[0], peek(domain), count == null ? 10 : count, specifier);\n };\n scale.copy = function () {\n return scaleBinOrdinal().domain(scale.domain()).range(scale.range());\n };\n return scale;\n}\n\n/** Private scale registry: should not be exported */\nconst scales = new Map();\nconst VEGA_SCALE = Symbol('vega_scale');\nfunction registerScale(scale) {\n scale[VEGA_SCALE] = true;\n return scale;\n}\n\n/**\n * Return true if object was created by a constructor from the vega-scale `scale` function.\n */\nfunction isRegisteredScale(scale) {\n return scale && scale[VEGA_SCALE] === true;\n}\n\n/**\n * Augment scales with their type and needed inverse methods.\n */\nfunction create(type, constructor, metadata) {\n const ctr = function scale() {\n const s = constructor();\n if (!s.invertRange) {\n s.invertRange = s.invert ? invertRange(s) : s.invertExtent ? invertRangeExtent(s) : undefined;\n }\n s.type = type;\n return registerScale(s);\n };\n ctr.metadata = toSet(array(metadata));\n return ctr;\n}\n\n/**\n * Registry function for adding and accessing scale constructor functions.\n * The *type* argument is a String indicating the name of the scale type.\n *\n * If the *scale* argument is not specified, this method returns the matching scale constructor in the registry, or `null` if not found.\n * If the *scale* argument is provided, it must be a scale constructor function to add to the registry under the given *type* name.\n * The *metadata* argument provides additional information to guide appropriate use of scales within Vega.\n *\n * *metadata* can be either a string or string array. The valid string values are:\n * - `\"continuous\"` - the scale is defined over a continuous-valued domain.\n * - `\"discrete\"` - the scale is defined over a discrete domain and range.\n * - `\"discretizing\"` - the scale discretizes a continuous domain to a discrete range.\n * - `\"interpolating\"` - the scale range is defined using a color interpolator.\n * - `\"log\"` - the scale performs a logarithmic transform of the continuous domain.\n * - `\"temporal\"` - the scale domain is defined over date-time values.\n */\nfunction scale(type, scale, metadata) {\n if (arguments.length > 1) {\n scales.set(type, create(type, scale, metadata));\n return this;\n } else {\n return isValidScaleType(type) ? scales.get(type) : undefined;\n }\n}\n\n// identity scale\nscale(Identity, $.scaleIdentity);\n\n// continuous scales\nscale(Linear, $.scaleLinear, Continuous);\nscale(Log, $.scaleLog, [Continuous, Log]);\nscale(Pow, $.scalePow, Continuous);\nscale(Sqrt, $.scaleSqrt, Continuous);\nscale(Symlog, $.scaleSymlog, Continuous);\nscale(Time, $.scaleTime, [Continuous, Temporal]);\nscale(UTC, $.scaleUtc, [Continuous, Temporal]);\n\n// sequential scales\nscale(Sequential, $.scaleSequential, [Continuous, Interpolating]); // backwards compat\nscale(`${Sequential}-${Linear}`, $.scaleSequential, [Continuous, Interpolating]);\nscale(`${Sequential}-${Log}`, $.scaleSequentialLog, [Continuous, Interpolating, Log]);\nscale(`${Sequential}-${Pow}`, $.scaleSequentialPow, [Continuous, Interpolating]);\nscale(`${Sequential}-${Sqrt}`, $.scaleSequentialSqrt, [Continuous, Interpolating]);\nscale(`${Sequential}-${Symlog}`, $.scaleSequentialSymlog, [Continuous, Interpolating]);\n\n// diverging scales\nscale(`${Diverging}-${Linear}`, $.scaleDiverging, [Continuous, Interpolating]);\nscale(`${Diverging}-${Log}`, $.scaleDivergingLog, [Continuous, Interpolating, Log]);\nscale(`${Diverging}-${Pow}`, $.scaleDivergingPow, [Continuous, Interpolating]);\nscale(`${Diverging}-${Sqrt}`, $.scaleDivergingSqrt, [Continuous, Interpolating]);\nscale(`${Diverging}-${Symlog}`, $.scaleDivergingSymlog, [Continuous, Interpolating]);\n\n// discretizing scales\nscale(Quantile, $.scaleQuantile, [Discretizing, Quantile]);\nscale(Quantize, $.scaleQuantize, Discretizing);\nscale(Threshold, $.scaleThreshold, Discretizing);\n\n// discrete scales\nscale(BinOrdinal, scaleBinOrdinal, [Discrete, Discretizing]);\nscale(Ordinal, $.scaleOrdinal, Discrete);\nscale(Band, band, Discrete);\nscale(Point, point, Discrete);\nfunction isValidScaleType(type) {\n return scales.has(type);\n}\nfunction hasType(key, type) {\n const s = scales.get(key);\n return s && s.metadata[type];\n}\nfunction isContinuous(key) {\n return hasType(key, Continuous);\n}\nfunction isDiscrete(key) {\n return hasType(key, Discrete);\n}\nfunction isDiscretizing(key) {\n return hasType(key, Discretizing);\n}\nfunction isLogarithmic(key) {\n return hasType(key, Log);\n}\nfunction isTemporal(key) {\n return hasType(key, Temporal);\n}\nfunction isInterpolating(key) {\n return hasType(key, Interpolating);\n}\nfunction isQuantile(key) {\n return hasType(key, Quantile);\n}\n\nconst scaleProps = ['clamp', 'base', 'constant', 'exponent'];\nfunction interpolateRange(interpolator, range) {\n const start = range[0],\n span = peek(range) - start;\n return function (i) {\n return interpolator(start + i * span);\n };\n}\nfunction interpolateColors(colors, type, gamma) {\n return $$1.piecewise(interpolate(type || 'rgb', gamma), colors);\n}\nfunction quantizeInterpolator(interpolator, count) {\n const samples = new Array(count),\n n = count + 1;\n for (let i = 0; i < count;) samples[i] = interpolator(++i / n);\n return samples;\n}\nfunction scaleCopy(scale) {\n const t = scale.type,\n s = scale.copy();\n s.type = t;\n return s;\n}\nfunction scaleFraction(scale$1, min, max) {\n const delta = max - min;\n let i, t, s;\n if (!delta || !Number.isFinite(delta)) {\n return constant(0.5);\n } else {\n i = (t = scale$1.type).indexOf('-');\n t = i < 0 ? t : t.slice(i + 1);\n s = scale(t)().domain([min, max]).range([0, 1]);\n scaleProps.forEach(m => scale$1[m] ? s[m](scale$1[m]()) : 0);\n return s;\n }\n}\nfunction interpolate(type, gamma) {\n const interp = $$1[method(type)];\n return gamma != null && interp && interp.gamma ? interp.gamma(gamma) : interp;\n}\nfunction method(type) {\n return 'interpolate' + type.toLowerCase().split('-').map(s => s[0].toUpperCase() + s.slice(1)).join('');\n}\n\nconst continuous = {\n blues: 'cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90',\n greens: 'd3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429',\n greys: 'e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e',\n oranges: 'fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303',\n purples: 'e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c',\n reds: 'fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13',\n blueGreen: 'd5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429',\n bluePurple: 'ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71',\n greenBlue: 'd3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1',\n orangeRed: 'fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403',\n purpleBlue: 'dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281',\n purpleBlueGreen: 'dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353',\n purpleRed: 'dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a',\n redPurple: 'fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174',\n yellowGreen: 'e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034',\n yellowOrangeBrown: 'feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204',\n yellowOrangeRed: 'fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225',\n blueOrange: '134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07',\n brownBlueGreen: '704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147',\n purpleGreen: '5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29',\n purpleOrange: '4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07',\n redBlue: '8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85',\n redGrey: '8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434',\n yellowGreenBlue: 'eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185',\n redYellowBlue: 'a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695',\n redYellowGreen: 'a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837',\n pinkYellowGreen: '8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419',\n spectral: '9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2',\n viridis: '440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725',\n magma: '0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf',\n inferno: '0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4',\n plasma: '0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921',\n cividis: '00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647',\n rainbow: '6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa',\n sinebow: 'ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040',\n turbo: '23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00',\n browns: 'eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632',\n tealBlues: 'bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985',\n teals: 'bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667',\n warmGreys: 'dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e',\n goldGreen: 'f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36',\n goldOrange: 'f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26',\n goldRed: 'f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e',\n lightGreyRed: 'efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b',\n lightGreyTeal: 'e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc',\n lightMulti: 'e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c',\n lightOrange: 'f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b',\n lightTealBlue: 'e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988',\n darkBlue: '3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff',\n darkGold: '3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff',\n darkGreen: '3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa',\n darkMulti: '3737371f5287197d8c29a86995ce3fffe800ffffff',\n darkRed: '3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c'\n};\nconst discrete = {\n category10: '1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf',\n category20: '1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5',\n category20b: '393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6',\n category20c: '3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9',\n tableau10: '4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac',\n tableau20: '4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5',\n accent: '7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666',\n dark2: '1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666',\n paired: 'a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928',\n pastel1: 'fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2',\n pastel2: 'b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc',\n set1: 'e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999',\n set2: '66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3',\n set3: '8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f'\n};\n\nfunction colors(palette) {\n const n = palette.length / 6 | 0,\n c = new Array(n);\n for (let i = 0; i < n;) {\n c[i] = '#' + palette.slice(i * 6, ++i * 6);\n }\n return c;\n}\nfunction apply(_, f) {\n for (const k in _) scheme(k, f(_[k]));\n}\nconst schemes = {};\napply(discrete, colors);\napply(continuous, _ => interpolateColors(colors(_)));\nfunction scheme(name, scheme) {\n name = name && name.toLowerCase();\n if (arguments.length > 1) {\n schemes[name] = scheme;\n return this;\n } else {\n return schemes[name];\n }\n}\n\nconst SymbolLegend = 'symbol';\nconst DiscreteLegend = 'discrete';\nconst GradientLegend = 'gradient';\n\nconst defaultFormatter = value => isArray(value) ? value.map(v => String(v)) : String(value);\nconst ascending = (a, b) => a[1] - b[1];\nconst descending = (a, b) => b[1] - a[1];\n\n/**\n * Determine the tick count or interval function.\n * @param {Scale} scale - The scale for which to generate tick values.\n * @param {*} count - The desired tick count or interval specifier.\n * @param {number} minStep - The desired minimum step between tick values.\n * @return {*} - The tick count or interval function.\n */\nfunction tickCount(scale, count, minStep) {\n let step;\n if (isNumber(count)) {\n if (scale.bins) {\n count = Math.max(count, scale.bins.length);\n }\n if (minStep != null) {\n count = Math.min(count, Math.floor(span(scale.domain()) / minStep || 1));\n }\n }\n if (isObject(count)) {\n step = count.step;\n count = count.interval;\n }\n if (isString(count)) {\n count = scale.type === Time ? timeInterval(count) : scale.type == UTC ? utcInterval(count) : error('Only time and utc scales accept interval strings.');\n if (step) count = count.every(step);\n }\n return count;\n}\n\n/**\n * Filter a set of candidate tick values, ensuring that only tick values\n * that lie within the scale range are included.\n * @param {Scale} scale - The scale for which to generate tick values.\n * @param {Array<*>} ticks - The candidate tick values.\n * @param {*} count - The tick count or interval function.\n * @return {Array<*>} - The filtered tick values.\n */\nfunction validTicks(scale, ticks, count) {\n let range = scale.range(),\n lo = range[0],\n hi = peek(range),\n cmp = ascending;\n if (lo > hi) {\n range = hi;\n hi = lo;\n lo = range;\n cmp = descending;\n }\n lo = Math.floor(lo);\n hi = Math.ceil(hi);\n\n // filter ticks to valid values within the range\n // additionally sort ticks in range order (#2579)\n ticks = ticks.map(v => [v, scale(v)]).filter(_ => lo <= _[1] && _[1] <= hi).sort(cmp).map(_ => _[0]);\n if (count > 0 && ticks.length > 1) {\n const endpoints = [ticks[0], peek(ticks)];\n while (ticks.length > count && ticks.length >= 3) {\n ticks = ticks.filter((_, i) => !(i % 2));\n }\n if (ticks.length < 3) {\n ticks = endpoints;\n }\n }\n return ticks;\n}\n\n/**\n * Generate tick values for the given scale and approximate tick count or\n * interval value. If the scale has a 'ticks' method, it will be used to\n * generate the ticks, with the count argument passed as a parameter. If the\n * scale lacks a 'ticks' method, the full scale domain will be returned.\n * @param {Scale} scale - The scale for which to generate tick values.\n * @param {*} [count] - The approximate number of desired ticks.\n * @return {Array<*>} - The generated tick values.\n */\nfunction tickValues(scale, count) {\n return scale.bins ? validTicks(scale, scale.bins) : scale.ticks ? scale.ticks(count) : scale.domain();\n}\n\n/**\n * Generate a label format function for a scale. If the scale has a\n * 'tickFormat' method, it will be used to generate the formatter, with the\n * count and specifier arguments passed as parameters. If the scale lacks a\n * 'tickFormat' method, the returned formatter performs simple string coercion.\n * If the input scale is a logarithmic scale and the format specifier does not\n * indicate a desired decimal precision, a special variable precision formatter\n * that automatically trims trailing zeroes will be generated.\n * @param {Scale} scale - The scale for which to generate the label formatter.\n * @param {*} [count] - The approximate number of desired ticks.\n * @param {string} [specifier] - The format specifier. Must be a legal d3\n * specifier string (see https://github.com/d3/d3-format#formatSpecifier) or\n * time multi-format specifier object.\n * @return {function(*):string} - The generated label formatter.\n */\nfunction tickFormat(locale, scale, count, specifier, formatType, noSkip) {\n const type = scale.type;\n let format = defaultFormatter;\n if (type === Time || formatType === Time) {\n format = locale.timeFormat(specifier);\n } else if (type === UTC || formatType === UTC) {\n format = locale.utcFormat(specifier);\n } else if (isLogarithmic(type)) {\n const varfmt = locale.formatFloat(specifier);\n if (noSkip || scale.bins) {\n format = varfmt;\n } else {\n const test = tickLog(scale, count, false);\n format = _ => test(_) ? varfmt(_) : '';\n }\n } else if (scale.tickFormat) {\n // if d3 scale has tickFormat, it must be continuous\n const d = scale.domain();\n format = locale.formatSpan(d[0], d[d.length - 1], count, specifier);\n } else if (specifier) {\n format = locale.format(specifier);\n }\n return format;\n}\nfunction tickLog(scale, count, values) {\n const ticks = tickValues(scale, count),\n base = scale.base(),\n logb = Math.log(base),\n k = Math.max(1, base * count / ticks.length);\n\n // apply d3-scale's log format filter criteria\n const test = d => {\n let i = d / Math.pow(base, Math.round(Math.log(d) / logb));\n if (i * base < base - 0.5) i *= base;\n return i <= k;\n };\n return values ? ticks.filter(test) : test;\n}\n\nconst symbols = {\n [Quantile]: 'quantiles',\n [Quantize]: 'thresholds',\n [Threshold]: 'domain'\n};\nconst formats = {\n [Quantile]: 'quantiles',\n [Quantize]: 'domain'\n};\nfunction labelValues(scale, count) {\n return scale.bins ? binValues(scale.bins) : scale.type === Log ? tickLog(scale, count, true) : symbols[scale.type] ? thresholdValues(scale[symbols[scale.type]]()) : tickValues(scale, count);\n}\nfunction thresholdFormat(locale, scale, specifier) {\n const _ = scale[formats[scale.type]](),\n n = _.length;\n let d = n > 1 ? _[1] - _[0] : _[0],\n i;\n for (i = 1; i < n; ++i) {\n d = Math.min(d, _[i] - _[i - 1]);\n }\n\n // tickCount = 3 ticks times 10 for increased resolution\n return locale.formatSpan(0, d, 3 * 10, specifier);\n}\nfunction thresholdValues(thresholds) {\n const values = [-Infinity].concat(thresholds);\n values.max = +Infinity;\n return values;\n}\nfunction binValues(bins) {\n const values = bins.slice(0, -1);\n values.max = peek(bins);\n return values;\n}\nconst isDiscreteRange = scale => symbols[scale.type] || scale.bins;\nfunction labelFormat(locale, scale, count, type, specifier, formatType, noSkip) {\n const format = formats[scale.type] && formatType !== Time && formatType !== UTC ? thresholdFormat(locale, scale, specifier) : tickFormat(locale, scale, count, specifier, formatType, noSkip);\n return type === SymbolLegend && isDiscreteRange(scale) ? formatRange(format) : type === DiscreteLegend ? formatDiscrete(format) : formatPoint(format);\n}\nconst formatRange = format => (value, index, array) => {\n const limit = get(array[index + 1], get(array.max, +Infinity)),\n lo = formatValue(value, format),\n hi = formatValue(limit, format);\n return lo && hi ? lo + ' \\u2013 ' + hi : hi ? '< ' + hi : '\\u2265 ' + lo;\n};\nconst get = (value, dflt) => value != null ? value : dflt;\nconst formatDiscrete = format => (value, index) => index ? format(value) : null;\nconst formatPoint = format => value => format(value);\nconst formatValue = (value, format) => Number.isFinite(value) ? format(value) : null;\nfunction labelFraction(scale) {\n const domain = scale.domain(),\n count = domain.length - 1;\n let lo = +domain[0],\n hi = +peek(domain),\n span = hi - lo;\n if (scale.type === Threshold) {\n const adjust = count ? span / count : 0.1;\n lo -= adjust;\n hi += adjust;\n span = hi - lo;\n }\n return value => (value - lo) / span;\n}\n\nfunction format(locale, scale, specifier, formatType) {\n const type = formatType || scale.type;\n\n // replace abbreviated time specifiers to improve screen reader experience\n if (isString(specifier) && isTemporal(type)) {\n specifier = specifier.replace(/%a/g, '%A').replace(/%b/g, '%B');\n }\n return !specifier && type === Time ? locale.timeFormat('%A, %d %B %Y, %X') : !specifier && type === UTC ? locale.utcFormat('%A, %d %B %Y, %X UTC') : labelFormat(locale, scale, 5, null, specifier, formatType, true);\n}\nfunction domainCaption(locale, scale, opt) {\n opt = opt || {};\n const max = Math.max(3, opt.maxlen || 7),\n fmt = format(locale, scale, opt.format, opt.formatType);\n\n // if scale breaks domain into bins, describe boundaries\n if (isDiscretizing(scale.type)) {\n const v = labelValues(scale).slice(1).map(fmt),\n n = v.length;\n return `${n} boundar${n === 1 ? 'y' : 'ies'}: ${v.join(', ')}`;\n }\n\n // if scale domain is discrete, list values\n else if (isDiscrete(scale.type)) {\n const d = scale.domain(),\n n = d.length,\n v = n > max ? d.slice(0, max - 2).map(fmt).join(', ') + ', ending with ' + d.slice(-1).map(fmt) : d.map(fmt).join(', ');\n return `${n} value${n === 1 ? '' : 's'}: ${v}`;\n }\n\n // if scale domain is continuous, describe value range\n else {\n const d = scale.domain();\n return `values from ${fmt(d[0])} to ${fmt(peek(d))}`;\n }\n}\n\nexport { Band, BinOrdinal, DiscreteLegend, Diverging, GradientLegend, Identity, Linear, Log, Ordinal, Point, Pow, Quantile, Quantize, Sequential, Sqrt, SymbolLegend, Symlog, Threshold, Time, UTC, bandSpace, domainCaption, interpolate, interpolateColors, interpolateRange, isContinuous, isDiscrete, isDiscretizing, isInterpolating, isLogarithmic, isQuantile, isRegisteredScale, isTemporal, isValidScaleType, labelFormat, labelFraction, labelValues, quantizeInterpolator, registerScale, scale, scaleCopy, scaleFraction, scheme, tickCount, tickFormat, tickValues, validTicks };\n","import {linearish} from \"./linear.js\";\nimport number from \"./number.js\";\n\nexport default function identity(domain) {\n var unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = Array.from(_, number), scale) : domain.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return identity(domain).unknown(unknown);\n };\n\n domain = arguments.length ? Array.from(domain, number) : [0, 1];\n\n return linearish(scale);\n}\n","import {utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcTicks, utcTickInterval} from \"d3-time\";\nimport {utcFormat} from \"d3-time-format\";\nimport {calendar} from \"./time.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function utcTime() {\n return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);\n}\n","import {ascending, bisect, quantileSorted as threshold} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantile() {\n var domain = [],\n range = [],\n thresholds = [],\n unknown;\n\n function rescale() {\n var i = 0, n = Math.max(1, range.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = threshold(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : range[bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n","import {bisect} from \"d3-array\";\nimport {linearish} from \"./linear.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1],\n unknown;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : scale;\n };\n\n scale.thresholds = function() {\n return domain.slice();\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(linearish(scale), arguments);\n}\n","import {bisect} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function threshold() {\n var domain = [0.5],\n range = [0, 1],\n unknown,\n n = 1;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n","import { hasOwnProperty, isFunction, inherits, truthy, lruCache, isArray, error, toSet, array, peek, extend, isNumber, isObject } from 'vega-util';\nimport { curveBasis, curveBasisClosed, curveBasisOpen, curveBundle, curveCardinal, curveCardinalOpen, curveCardinalClosed, curveCatmullRom, curveCatmullRomClosed, curveCatmullRomOpen, curveLinear, curveLinearClosed, curveMonotoneY, curveMonotoneX, curveNatural, curveStep, curveStepAfter, curveStepBefore, arc as arc$2, area as area$2, line as line$2, symbol as symbol$2 } from 'd3-shape';\nimport { path as path$3 } from 'd3-path';\nexport { path } from 'd3-path';\nimport { image as image$1, canvas } from 'vega-canvas';\nimport { loader } from 'vega-loader';\nimport { isDiscrete, domainCaption } from 'vega-scale';\n\nlet gradient_id = 0;\nfunction resetSVGGradientId() {\n gradient_id = 0;\n}\nconst patternPrefix = 'p_';\nfunction isGradient(value) {\n return value && value.gradient;\n}\nfunction gradientRef(g, defs, base) {\n const type = g.gradient;\n let id = g.id,\n prefix = type === 'radial' ? patternPrefix : '';\n\n // check id, assign default values as needed\n if (!id) {\n id = g.id = 'gradient_' + gradient_id++;\n if (type === 'radial') {\n g.x1 = get(g.x1, 0.5);\n g.y1 = get(g.y1, 0.5);\n g.r1 = get(g.r1, 0);\n g.x2 = get(g.x2, 0.5);\n g.y2 = get(g.y2, 0.5);\n g.r2 = get(g.r2, 0.5);\n prefix = patternPrefix;\n } else {\n g.x1 = get(g.x1, 0);\n g.y1 = get(g.y1, 0);\n g.x2 = get(g.x2, 1);\n g.y2 = get(g.y2, 0);\n }\n }\n\n // register definition\n defs[id] = g;\n\n // return url reference\n return 'url(' + (base || '') + '#' + prefix + id + ')';\n}\nfunction get(val, def) {\n return val != null ? val : def;\n}\nfunction Gradient (p0, p1) {\n var stops = [],\n gradient;\n return gradient = {\n gradient: 'linear',\n x1: p0 ? p0[0] : 0,\n y1: p0 ? p0[1] : 0,\n x2: p1 ? p1[0] : 1,\n y2: p1 ? p1[1] : 0,\n stops: stops,\n stop: function (offset, color) {\n stops.push({\n offset: offset,\n color: color\n });\n return gradient;\n }\n };\n}\n\nconst lookup = {\n 'basis': {\n curve: curveBasis\n },\n 'basis-closed': {\n curve: curveBasisClosed\n },\n 'basis-open': {\n curve: curveBasisOpen\n },\n 'bundle': {\n curve: curveBundle,\n tension: 'beta',\n value: 0.85\n },\n 'cardinal': {\n curve: curveCardinal,\n tension: 'tension',\n value: 0\n },\n 'cardinal-open': {\n curve: curveCardinalOpen,\n tension: 'tension',\n value: 0\n },\n 'cardinal-closed': {\n curve: curveCardinalClosed,\n tension: 'tension',\n value: 0\n },\n 'catmull-rom': {\n curve: curveCatmullRom,\n tension: 'alpha',\n value: 0.5\n },\n 'catmull-rom-closed': {\n curve: curveCatmullRomClosed,\n tension: 'alpha',\n value: 0.5\n },\n 'catmull-rom-open': {\n curve: curveCatmullRomOpen,\n tension: 'alpha',\n value: 0.5\n },\n 'linear': {\n curve: curveLinear\n },\n 'linear-closed': {\n curve: curveLinearClosed\n },\n 'monotone': {\n horizontal: curveMonotoneY,\n vertical: curveMonotoneX\n },\n 'natural': {\n curve: curveNatural\n },\n 'step': {\n curve: curveStep\n },\n 'step-after': {\n curve: curveStepAfter\n },\n 'step-before': {\n curve: curveStepBefore\n }\n};\nfunction curves(type, orientation, tension) {\n var entry = hasOwnProperty(lookup, type) && lookup[type],\n curve = null;\n if (entry) {\n curve = entry.curve || entry[orientation || 'vertical'];\n if (entry.tension && tension != null) {\n curve = curve[entry.tension](tension);\n }\n }\n return curve;\n}\n\nconst paramCounts = {\n m: 2,\n l: 2,\n h: 1,\n v: 1,\n z: 0,\n c: 6,\n s: 4,\n q: 4,\n t: 2,\n a: 7\n};\nconst commandPattern = /[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi;\nconst numberPattern = /^[+-]?(([0-9]*\\.[0-9]+)|([0-9]+\\.)|([0-9]+))([eE][+-]?[0-9]+)?/;\nconst spacePattern = /^((\\s+,?\\s*)|(,\\s*))/;\nconst flagPattern = /^[01]/;\nfunction parse(path) {\n const commands = [];\n const matches = path.match(commandPattern) || [];\n matches.forEach(str => {\n let cmd = str[0];\n const type = cmd.toLowerCase();\n\n // parse parameters\n const paramCount = paramCounts[type];\n const params = parseParams(type, paramCount, str.slice(1).trim());\n const count = params.length;\n\n // error checking based on parameter count\n if (count < paramCount || count && count % paramCount !== 0) {\n throw Error('Invalid SVG path, incorrect parameter count');\n }\n\n // register the command\n commands.push([cmd, ...params.slice(0, paramCount)]);\n\n // exit now if we're done, also handles zero-param 'z'\n if (count === paramCount) {\n return;\n }\n\n // handle implicit line-to\n if (type === 'm') {\n cmd = cmd === 'M' ? 'L' : 'l';\n }\n\n // repeat command when given extended param list\n for (let i = paramCount; i < count; i += paramCount) {\n commands.push([cmd, ...params.slice(i, i + paramCount)]);\n }\n });\n return commands;\n}\nfunction parseParams(type, paramCount, segment) {\n const params = [];\n for (let index = 0; paramCount && index < segment.length;) {\n for (let i = 0; i < paramCount; ++i) {\n const pattern = type === 'a' && (i === 3 || i === 4) ? flagPattern : numberPattern;\n const match = segment.slice(index).match(pattern);\n if (match === null) {\n throw Error('Invalid SVG path, incorrect parameter type');\n }\n index += match[0].length;\n params.push(+match[0]);\n const ws = segment.slice(index).match(spacePattern);\n if (ws !== null) {\n index += ws[0].length;\n }\n }\n }\n return params;\n}\n\nconst DegToRad = Math.PI / 180;\nconst Epsilon = 1e-14;\nconst HalfPi = Math.PI / 2;\nconst Tau = Math.PI * 2;\nconst HalfSqrt3 = Math.sqrt(3) / 2;\n\nvar segmentCache = {};\nvar bezierCache = {};\nvar join = [].join;\n\n// Copied from Inkscape svgtopdf, thanks!\nfunction segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {\n const key = join.call(arguments);\n if (segmentCache[key]) {\n return segmentCache[key];\n }\n const th = rotateX * DegToRad;\n const sin_th = Math.sin(th);\n const cos_th = Math.cos(th);\n rx = Math.abs(rx);\n ry = Math.abs(ry);\n const px = cos_th * (ox - x) * 0.5 + sin_th * (oy - y) * 0.5;\n const py = cos_th * (oy - y) * 0.5 - sin_th * (ox - x) * 0.5;\n let pl = px * px / (rx * rx) + py * py / (ry * ry);\n if (pl > 1) {\n pl = Math.sqrt(pl);\n rx *= pl;\n ry *= pl;\n }\n const a00 = cos_th / rx;\n const a01 = sin_th / rx;\n const a10 = -sin_th / ry;\n const a11 = cos_th / ry;\n const x0 = a00 * ox + a01 * oy;\n const y0 = a10 * ox + a11 * oy;\n const x1 = a00 * x + a01 * y;\n const y1 = a10 * x + a11 * y;\n const d = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0);\n let sfactor_sq = 1 / d - 0.25;\n if (sfactor_sq < 0) sfactor_sq = 0;\n let sfactor = Math.sqrt(sfactor_sq);\n if (sweep == large) sfactor = -sfactor;\n const xc = 0.5 * (x0 + x1) - sfactor * (y1 - y0);\n const yc = 0.5 * (y0 + y1) + sfactor * (x1 - x0);\n const th0 = Math.atan2(y0 - yc, x0 - xc);\n const th1 = Math.atan2(y1 - yc, x1 - xc);\n let th_arc = th1 - th0;\n if (th_arc < 0 && sweep === 1) {\n th_arc += Tau;\n } else if (th_arc > 0 && sweep === 0) {\n th_arc -= Tau;\n }\n const segs = Math.ceil(Math.abs(th_arc / (HalfPi + 0.001)));\n const result = [];\n for (let i = 0; i < segs; ++i) {\n const th2 = th0 + i * th_arc / segs;\n const th3 = th0 + (i + 1) * th_arc / segs;\n result[i] = [xc, yc, th2, th3, rx, ry, sin_th, cos_th];\n }\n return segmentCache[key] = result;\n}\nfunction bezier(params) {\n const key = join.call(params);\n if (bezierCache[key]) {\n return bezierCache[key];\n }\n var cx = params[0],\n cy = params[1],\n th0 = params[2],\n th1 = params[3],\n rx = params[4],\n ry = params[5],\n sin_th = params[6],\n cos_th = params[7];\n const a00 = cos_th * rx;\n const a01 = -sin_th * ry;\n const a10 = sin_th * rx;\n const a11 = cos_th * ry;\n const cos_th0 = Math.cos(th0);\n const sin_th0 = Math.sin(th0);\n const cos_th1 = Math.cos(th1);\n const sin_th1 = Math.sin(th1);\n const th_half = 0.5 * (th1 - th0);\n const sin_th_h2 = Math.sin(th_half * 0.5);\n const t = 8 / 3 * sin_th_h2 * sin_th_h2 / Math.sin(th_half);\n const x1 = cx + cos_th0 - t * sin_th0;\n const y1 = cy + sin_th0 + t * cos_th0;\n const x3 = cx + cos_th1;\n const y3 = cy + sin_th1;\n const x2 = x3 + t * sin_th1;\n const y2 = y3 - t * cos_th1;\n return bezierCache[key] = [a00 * x1 + a01 * y1, a10 * x1 + a11 * y1, a00 * x2 + a01 * y2, a10 * x2 + a11 * y2, a00 * x3 + a01 * y3, a10 * x3 + a11 * y3];\n}\n\nconst temp = ['l', 0, 0, 0, 0, 0, 0, 0];\nfunction scale$1(current, sX, sY) {\n const c = temp[0] = current[0];\n if (c === 'a' || c === 'A') {\n temp[1] = sX * current[1];\n temp[2] = sY * current[2];\n temp[3] = current[3];\n temp[4] = current[4];\n temp[5] = current[5];\n temp[6] = sX * current[6];\n temp[7] = sY * current[7];\n } else if (c === 'h' || c === 'H') {\n temp[1] = sX * current[1];\n } else if (c === 'v' || c === 'V') {\n temp[1] = sY * current[1];\n } else {\n for (var i = 1, n = current.length; i < n; ++i) {\n temp[i] = (i % 2 == 1 ? sX : sY) * current[i];\n }\n }\n return temp;\n}\nfunction pathRender (context, path, l, t, sX, sY) {\n var current,\n // current instruction\n previous = null,\n x = 0,\n // current x\n y = 0,\n // current y\n controlX = 0,\n // current control point x\n controlY = 0,\n // current control point y\n tempX,\n tempY,\n tempControlX,\n tempControlY,\n anchorX = 0,\n anchorY = 0;\n if (l == null) l = 0;\n if (t == null) t = 0;\n if (sX == null) sX = 1;\n if (sY == null) sY = sX;\n if (context.beginPath) context.beginPath();\n for (var i = 0, len = path.length; i < len; ++i) {\n current = path[i];\n if (sX !== 1 || sY !== 1) {\n current = scale$1(current, sX, sY);\n }\n switch (current[0]) {\n // first letter\n\n case 'l':\n // lineto, relative\n x += current[1];\n y += current[2];\n context.lineTo(x + l, y + t);\n break;\n case 'L':\n // lineto, absolute\n x = current[1];\n y = current[2];\n context.lineTo(x + l, y + t);\n break;\n case 'h':\n // horizontal lineto, relative\n x += current[1];\n context.lineTo(x + l, y + t);\n break;\n case 'H':\n // horizontal lineto, absolute\n x = current[1];\n context.lineTo(x + l, y + t);\n break;\n case 'v':\n // vertical lineto, relative\n y += current[1];\n context.lineTo(x + l, y + t);\n break;\n case 'V':\n // verical lineto, absolute\n y = current[1];\n context.lineTo(x + l, y + t);\n break;\n case 'm':\n // moveTo, relative\n x += current[1];\n y += current[2];\n anchorX = x;\n anchorY = y;\n context.moveTo(x + l, y + t);\n break;\n case 'M':\n // moveTo, absolute\n x = current[1];\n y = current[2];\n anchorX = x;\n anchorY = y;\n context.moveTo(x + l, y + t);\n break;\n case 'c':\n // bezierCurveTo, relative\n tempX = x + current[5];\n tempY = y + current[6];\n controlX = x + current[3];\n controlY = y + current[4];\n context.bezierCurveTo(x + current[1] + l,\n // x1\n y + current[2] + t,\n // y1\n controlX + l,\n // x2\n controlY + t,\n // y2\n tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n case 'C':\n // bezierCurveTo, absolute\n x = current[5];\n y = current[6];\n controlX = current[3];\n controlY = current[4];\n context.bezierCurveTo(current[1] + l, current[2] + t, controlX + l, controlY + t, x + l, y + t);\n break;\n case 's':\n // shorthand cubic bezierCurveTo, relative\n // transform to absolute x,y\n tempX = x + current[3];\n tempY = y + current[4];\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n context.bezierCurveTo(controlX + l, controlY + t, x + current[1] + l, y + current[2] + t, tempX + l, tempY + t);\n\n // set control point to 2nd one of this command\n // the first control point is assumed to be the reflection of\n // the second control point on the previous command relative\n // to the current point.\n controlX = x + current[1];\n controlY = y + current[2];\n x = tempX;\n y = tempY;\n break;\n case 'S':\n // shorthand cubic bezierCurveTo, absolute\n tempX = current[3];\n tempY = current[4];\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n context.bezierCurveTo(controlX + l, controlY + t, current[1] + l, current[2] + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n // set control point to 2nd one of this command\n // the first control point is assumed to be the reflection of\n // the second control point on the previous command relative\n // to the current point.\n controlX = current[1];\n controlY = current[2];\n break;\n case 'q':\n // quadraticCurveTo, relative\n // transform to absolute x,y\n tempX = x + current[3];\n tempY = y + current[4];\n controlX = x + current[1];\n controlY = y + current[2];\n context.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n case 'Q':\n // quadraticCurveTo, absolute\n tempX = current[3];\n tempY = current[4];\n context.quadraticCurveTo(current[1] + l, current[2] + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n controlX = current[1];\n controlY = current[2];\n break;\n case 't':\n // shorthand quadraticCurveTo, relative\n\n // transform to absolute x,y\n tempX = x + current[1];\n tempY = y + current[2];\n if (previous[0].match(/[QqTt]/) === null) {\n // If there is no previous command or if the previous command was not a Q, q, T or t,\n // assume the control point is coincident with the current point\n controlX = x;\n controlY = y;\n } else if (previous[0] === 't') {\n // calculate reflection of previous control points for t\n controlX = 2 * x - tempControlX;\n controlY = 2 * y - tempControlY;\n } else if (previous[0] === 'q') {\n // calculate reflection of previous control points for q\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n }\n tempControlX = controlX;\n tempControlY = controlY;\n context.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n controlX = x + current[1];\n controlY = y + current[2];\n break;\n case 'T':\n tempX = current[1];\n tempY = current[2];\n\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n context.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n case 'a':\n drawArc(context, x + l, y + t, [current[1], current[2], current[3], current[4], current[5], current[6] + x + l, current[7] + y + t]);\n x += current[6];\n y += current[7];\n break;\n case 'A':\n drawArc(context, x + l, y + t, [current[1], current[2], current[3], current[4], current[5], current[6] + l, current[7] + t]);\n x = current[6];\n y = current[7];\n break;\n case 'z':\n case 'Z':\n x = anchorX;\n y = anchorY;\n context.closePath();\n break;\n }\n previous = current;\n }\n}\nfunction drawArc(context, x, y, coords) {\n const seg = segments(coords[5],\n // end x\n coords[6],\n // end y\n coords[0],\n // radius x\n coords[1],\n // radius y\n coords[3],\n // large flag\n coords[4],\n // sweep flag\n coords[2],\n // rotation\n x, y);\n for (let i = 0; i < seg.length; ++i) {\n const bez = bezier(seg[i]);\n context.bezierCurveTo(bez[0], bez[1], bez[2], bez[3], bez[4], bez[5]);\n }\n}\n\nconst Tan30 = 0.5773502691896257;\nconst builtins = {\n 'circle': {\n draw: function (context, size) {\n const r = Math.sqrt(size) / 2;\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, Tau);\n }\n },\n 'cross': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n s = r / 2.5;\n context.moveTo(-r, -s);\n context.lineTo(-r, s);\n context.lineTo(-s, s);\n context.lineTo(-s, r);\n context.lineTo(s, r);\n context.lineTo(s, s);\n context.lineTo(r, s);\n context.lineTo(r, -s);\n context.lineTo(s, -s);\n context.lineTo(s, -r);\n context.lineTo(-s, -r);\n context.lineTo(-s, -s);\n context.closePath();\n }\n },\n 'diamond': {\n draw: function (context, size) {\n const r = Math.sqrt(size) / 2;\n context.moveTo(-r, 0);\n context.lineTo(0, -r);\n context.lineTo(r, 0);\n context.lineTo(0, r);\n context.closePath();\n }\n },\n 'square': {\n draw: function (context, size) {\n var w = Math.sqrt(size),\n x = -w / 2;\n context.rect(x, x, w, w);\n }\n },\n 'arrow': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n s = r / 7,\n t = r / 2.5,\n v = r / 8;\n context.moveTo(-s, r);\n context.lineTo(s, r);\n context.lineTo(s, -v);\n context.lineTo(t, -v);\n context.lineTo(0, -r);\n context.lineTo(-t, -v);\n context.lineTo(-s, -v);\n context.closePath();\n }\n },\n 'wedge': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r,\n o = h - r * Tan30,\n b = r / 4;\n context.moveTo(0, -h - o);\n context.lineTo(-b, h - o);\n context.lineTo(b, h - o);\n context.closePath();\n }\n },\n 'triangle': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r,\n o = h - r * Tan30;\n context.moveTo(0, -h - o);\n context.lineTo(-r, h - o);\n context.lineTo(r, h - o);\n context.closePath();\n }\n },\n 'triangle-up': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(0, -h);\n context.lineTo(-r, h);\n context.lineTo(r, h);\n context.closePath();\n }\n },\n 'triangle-down': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(0, h);\n context.lineTo(-r, -h);\n context.lineTo(r, -h);\n context.closePath();\n }\n },\n 'triangle-right': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(h, 0);\n context.lineTo(-h, -r);\n context.lineTo(-h, r);\n context.closePath();\n }\n },\n 'triangle-left': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(-h, 0);\n context.lineTo(h, -r);\n context.lineTo(h, r);\n context.closePath();\n }\n },\n 'stroke': {\n draw: function (context, size) {\n const r = Math.sqrt(size) / 2;\n context.moveTo(-r, 0);\n context.lineTo(r, 0);\n }\n }\n};\nfunction symbols(_) {\n return hasOwnProperty(builtins, _) ? builtins[_] : customSymbol(_);\n}\nvar custom = {};\nfunction customSymbol(path) {\n if (!hasOwnProperty(custom, path)) {\n const parsed = parse(path);\n custom[path] = {\n draw: function (context, size) {\n pathRender(context, parsed, 0, 0, Math.sqrt(size) / 2);\n }\n };\n }\n return custom[path];\n}\n\n// See http://spencermortensen.com/articles/bezier-circle/\nconst C = 0.448084975506; // C = 1 - c\n\nfunction rectangleX(d) {\n return d.x;\n}\nfunction rectangleY(d) {\n return d.y;\n}\nfunction rectangleWidth(d) {\n return d.width;\n}\nfunction rectangleHeight(d) {\n return d.height;\n}\nfunction number(_) {\n return typeof _ === 'function' ? _ : () => +_;\n}\nfunction clamp(value, min, max) {\n return Math.max(min, Math.min(value, max));\n}\nfunction vg_rect () {\n var x = rectangleX,\n y = rectangleY,\n width = rectangleWidth,\n height = rectangleHeight,\n crTL = number(0),\n crTR = crTL,\n crBL = crTL,\n crBR = crTL,\n context = null;\n function rectangle(_, x0, y0) {\n var buffer,\n x1 = x0 != null ? x0 : +x.call(this, _),\n y1 = y0 != null ? y0 : +y.call(this, _),\n w = +width.call(this, _),\n h = +height.call(this, _),\n s = Math.min(w, h) / 2,\n tl = clamp(+crTL.call(this, _), 0, s),\n tr = clamp(+crTR.call(this, _), 0, s),\n bl = clamp(+crBL.call(this, _), 0, s),\n br = clamp(+crBR.call(this, _), 0, s);\n if (!context) context = buffer = path$3();\n if (tl <= 0 && tr <= 0 && bl <= 0 && br <= 0) {\n context.rect(x1, y1, w, h);\n } else {\n var x2 = x1 + w,\n y2 = y1 + h;\n context.moveTo(x1 + tl, y1);\n context.lineTo(x2 - tr, y1);\n context.bezierCurveTo(x2 - C * tr, y1, x2, y1 + C * tr, x2, y1 + tr);\n context.lineTo(x2, y2 - br);\n context.bezierCurveTo(x2, y2 - C * br, x2 - C * br, y2, x2 - br, y2);\n context.lineTo(x1 + bl, y2);\n context.bezierCurveTo(x1 + C * bl, y2, x1, y2 - C * bl, x1, y2 - bl);\n context.lineTo(x1, y1 + tl);\n context.bezierCurveTo(x1, y1 + C * tl, x1 + C * tl, y1, x1 + tl, y1);\n context.closePath();\n }\n if (buffer) {\n context = null;\n return buffer + '' || null;\n }\n }\n rectangle.x = function (_) {\n if (arguments.length) {\n x = number(_);\n return rectangle;\n } else {\n return x;\n }\n };\n rectangle.y = function (_) {\n if (arguments.length) {\n y = number(_);\n return rectangle;\n } else {\n return y;\n }\n };\n rectangle.width = function (_) {\n if (arguments.length) {\n width = number(_);\n return rectangle;\n } else {\n return width;\n }\n };\n rectangle.height = function (_) {\n if (arguments.length) {\n height = number(_);\n return rectangle;\n } else {\n return height;\n }\n };\n rectangle.cornerRadius = function (tl, tr, br, bl) {\n if (arguments.length) {\n crTL = number(tl);\n crTR = tr != null ? number(tr) : crTL;\n crBR = br != null ? number(br) : crTL;\n crBL = bl != null ? number(bl) : crTR;\n return rectangle;\n } else {\n return crTL;\n }\n };\n rectangle.context = function (_) {\n if (arguments.length) {\n context = _ == null ? null : _;\n return rectangle;\n } else {\n return context;\n }\n };\n return rectangle;\n}\n\nfunction vg_trail () {\n var x,\n y,\n size,\n defined,\n context = null,\n ready,\n x1,\n y1,\n r1;\n function point(x2, y2, w2) {\n const r2 = w2 / 2;\n if (ready) {\n var ux = y1 - y2,\n uy = x2 - x1;\n if (ux || uy) {\n // get normal vector\n var ud = Math.sqrt(ux * ux + uy * uy),\n rx = (ux /= ud) * r1,\n ry = (uy /= ud) * r1,\n t = Math.atan2(uy, ux);\n\n // draw segment\n context.moveTo(x1 - rx, y1 - ry);\n context.lineTo(x2 - ux * r2, y2 - uy * r2);\n context.arc(x2, y2, r2, t - Math.PI, t);\n context.lineTo(x1 + rx, y1 + ry);\n context.arc(x1, y1, r1, t, t + Math.PI);\n } else {\n context.arc(x2, y2, r2, 0, Tau);\n }\n context.closePath();\n } else {\n ready = 1;\n }\n x1 = x2;\n y1 = y2;\n r1 = r2;\n }\n function trail(data) {\n var i,\n n = data.length,\n d,\n defined0 = false,\n buffer;\n if (context == null) context = buffer = path$3();\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) ready = 0;\n }\n if (defined0) point(+x(d, i, data), +y(d, i, data), +size(d, i, data));\n }\n if (buffer) {\n context = null;\n return buffer + '' || null;\n }\n }\n trail.x = function (_) {\n if (arguments.length) {\n x = _;\n return trail;\n } else {\n return x;\n }\n };\n trail.y = function (_) {\n if (arguments.length) {\n y = _;\n return trail;\n } else {\n return y;\n }\n };\n trail.size = function (_) {\n if (arguments.length) {\n size = _;\n return trail;\n } else {\n return size;\n }\n };\n trail.defined = function (_) {\n if (arguments.length) {\n defined = _;\n return trail;\n } else {\n return defined;\n }\n };\n trail.context = function (_) {\n if (arguments.length) {\n if (_ == null) {\n context = null;\n } else {\n context = _;\n }\n return trail;\n } else {\n return context;\n }\n };\n return trail;\n}\n\nfunction value$1(a, b) {\n return a != null ? a : b;\n}\nconst x = item => item.x || 0,\n y = item => item.y || 0,\n w = item => item.width || 0,\n h = item => item.height || 0,\n xw = item => (item.x || 0) + (item.width || 0),\n yh = item => (item.y || 0) + (item.height || 0),\n sa = item => item.startAngle || 0,\n ea = item => item.endAngle || 0,\n pa = item => item.padAngle || 0,\n ir = item => item.innerRadius || 0,\n or = item => item.outerRadius || 0,\n cr = item => item.cornerRadius || 0,\n tl = item => value$1(item.cornerRadiusTopLeft, item.cornerRadius) || 0,\n tr = item => value$1(item.cornerRadiusTopRight, item.cornerRadius) || 0,\n br = item => value$1(item.cornerRadiusBottomRight, item.cornerRadius) || 0,\n bl = item => value$1(item.cornerRadiusBottomLeft, item.cornerRadius) || 0,\n sz = item => value$1(item.size, 64),\n ts = item => item.size || 1,\n def = item => !(item.defined === false),\n type = item => symbols(item.shape || 'circle');\nconst arcShape = arc$2().startAngle(sa).endAngle(ea).padAngle(pa).innerRadius(ir).outerRadius(or).cornerRadius(cr),\n areavShape = area$2().x(x).y1(y).y0(yh).defined(def),\n areahShape = area$2().y(y).x1(x).x0(xw).defined(def),\n lineShape = line$2().x(x).y(y).defined(def),\n rectShape = vg_rect().x(x).y(y).width(w).height(h).cornerRadius(tl, tr, br, bl),\n symbolShape = symbol$2().type(type).size(sz),\n trailShape = vg_trail().x(x).y(y).defined(def).size(ts);\nfunction hasCornerRadius(item) {\n return item.cornerRadius || item.cornerRadiusTopLeft || item.cornerRadiusTopRight || item.cornerRadiusBottomRight || item.cornerRadiusBottomLeft;\n}\nfunction arc$1(context, item) {\n return arcShape.context(context)(item);\n}\nfunction area$1(context, items) {\n const item = items[0],\n interp = item.interpolate || 'linear';\n return (item.orient === 'horizontal' ? areahShape : areavShape).curve(curves(interp, item.orient, item.tension)).context(context)(items);\n}\nfunction line$1(context, items) {\n const item = items[0],\n interp = item.interpolate || 'linear';\n return lineShape.curve(curves(interp, item.orient, item.tension)).context(context)(items);\n}\nfunction rectangle(context, item, x, y) {\n return rectShape.context(context)(item, x, y);\n}\nfunction shape$1(context, item) {\n return (item.mark.shape || item.shape).context(context)(item);\n}\nfunction symbol$1(context, item) {\n return symbolShape.context(context)(item);\n}\nfunction trail$1(context, items) {\n return trailShape.context(context)(items);\n}\n\nvar clip_id = 1;\nfunction resetSVGClipId() {\n clip_id = 1;\n}\nfunction clip$1 (renderer, item, size) {\n var clip = item.clip,\n defs = renderer._defs,\n id = item.clip_id || (item.clip_id = 'clip' + clip_id++),\n c = defs.clipping[id] || (defs.clipping[id] = {\n id: id\n });\n if (isFunction(clip)) {\n c.path = clip(null);\n } else if (hasCornerRadius(size)) {\n c.path = rectangle(null, size, 0, 0);\n } else {\n c.width = size.width || 0;\n c.height = size.height || 0;\n }\n return 'url(#' + id + ')';\n}\n\nfunction Bounds(b) {\n this.clear();\n if (b) this.union(b);\n}\nBounds.prototype = {\n clone() {\n return new Bounds(this);\n },\n clear() {\n this.x1 = +Number.MAX_VALUE;\n this.y1 = +Number.MAX_VALUE;\n this.x2 = -Number.MAX_VALUE;\n this.y2 = -Number.MAX_VALUE;\n return this;\n },\n empty() {\n return this.x1 === +Number.MAX_VALUE && this.y1 === +Number.MAX_VALUE && this.x2 === -Number.MAX_VALUE && this.y2 === -Number.MAX_VALUE;\n },\n equals(b) {\n return this.x1 === b.x1 && this.y1 === b.y1 && this.x2 === b.x2 && this.y2 === b.y2;\n },\n set(x1, y1, x2, y2) {\n if (x2 < x1) {\n this.x2 = x1;\n this.x1 = x2;\n } else {\n this.x1 = x1;\n this.x2 = x2;\n }\n if (y2 < y1) {\n this.y2 = y1;\n this.y1 = y2;\n } else {\n this.y1 = y1;\n this.y2 = y2;\n }\n return this;\n },\n add(x, y) {\n if (x < this.x1) this.x1 = x;\n if (y < this.y1) this.y1 = y;\n if (x > this.x2) this.x2 = x;\n if (y > this.y2) this.y2 = y;\n return this;\n },\n expand(d) {\n this.x1 -= d;\n this.y1 -= d;\n this.x2 += d;\n this.y2 += d;\n return this;\n },\n round() {\n this.x1 = Math.floor(this.x1);\n this.y1 = Math.floor(this.y1);\n this.x2 = Math.ceil(this.x2);\n this.y2 = Math.ceil(this.y2);\n return this;\n },\n scale(s) {\n this.x1 *= s;\n this.y1 *= s;\n this.x2 *= s;\n this.y2 *= s;\n return this;\n },\n translate(dx, dy) {\n this.x1 += dx;\n this.x2 += dx;\n this.y1 += dy;\n this.y2 += dy;\n return this;\n },\n rotate(angle, x, y) {\n const p = this.rotatedPoints(angle, x, y);\n return this.clear().add(p[0], p[1]).add(p[2], p[3]).add(p[4], p[5]).add(p[6], p[7]);\n },\n rotatedPoints(angle, x, y) {\n var {\n x1,\n y1,\n x2,\n y2\n } = this,\n cos = Math.cos(angle),\n sin = Math.sin(angle),\n cx = x - x * cos + y * sin,\n cy = y - x * sin - y * cos;\n return [cos * x1 - sin * y1 + cx, sin * x1 + cos * y1 + cy, cos * x1 - sin * y2 + cx, sin * x1 + cos * y2 + cy, cos * x2 - sin * y1 + cx, sin * x2 + cos * y1 + cy, cos * x2 - sin * y2 + cx, sin * x2 + cos * y2 + cy];\n },\n union(b) {\n if (b.x1 < this.x1) this.x1 = b.x1;\n if (b.y1 < this.y1) this.y1 = b.y1;\n if (b.x2 > this.x2) this.x2 = b.x2;\n if (b.y2 > this.y2) this.y2 = b.y2;\n return this;\n },\n intersect(b) {\n if (b.x1 > this.x1) this.x1 = b.x1;\n if (b.y1 > this.y1) this.y1 = b.y1;\n if (b.x2 < this.x2) this.x2 = b.x2;\n if (b.y2 < this.y2) this.y2 = b.y2;\n return this;\n },\n encloses(b) {\n return b && this.x1 <= b.x1 && this.x2 >= b.x2 && this.y1 <= b.y1 && this.y2 >= b.y2;\n },\n alignsWith(b) {\n return b && (this.x1 == b.x1 || this.x2 == b.x2 || this.y1 == b.y1 || this.y2 == b.y2);\n },\n intersects(b) {\n return b && !(this.x2 < b.x1 || this.x1 > b.x2 || this.y2 < b.y1 || this.y1 > b.y2);\n },\n contains(x, y) {\n return !(x < this.x1 || x > this.x2 || y < this.y1 || y > this.y2);\n },\n width() {\n return this.x2 - this.x1;\n },\n height() {\n return this.y2 - this.y1;\n }\n};\n\nfunction Item(mark) {\n this.mark = mark;\n this.bounds = this.bounds || new Bounds();\n}\n\nfunction GroupItem(mark) {\n Item.call(this, mark);\n this.items = this.items || [];\n}\ninherits(GroupItem, Item);\n\nfunction ResourceLoader(customLoader) {\n this._pending = 0;\n this._loader = customLoader || loader();\n}\nfunction increment(loader) {\n loader._pending += 1;\n}\nfunction decrement(loader) {\n loader._pending -= 1;\n}\nResourceLoader.prototype = {\n pending() {\n return this._pending;\n },\n sanitizeURL(uri) {\n const loader = this;\n increment(loader);\n return loader._loader.sanitize(uri, {\n context: 'href'\n }).then(opt => {\n decrement(loader);\n return opt;\n }).catch(() => {\n decrement(loader);\n return null;\n });\n },\n loadImage(uri) {\n const loader = this,\n Image = image$1();\n increment(loader);\n return loader._loader.sanitize(uri, {\n context: 'image'\n }).then(opt => {\n const url = opt.href;\n if (!url || !Image) throw {\n url: url\n };\n const img = new Image();\n\n // set crossOrigin only if cors is defined; empty string sets anonymous mode\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/crossOrigin\n const cors = hasOwnProperty(opt, 'crossOrigin') ? opt.crossOrigin : 'anonymous';\n if (cors != null) img.crossOrigin = cors;\n\n // attempt to load image resource\n img.onload = () => decrement(loader);\n img.onerror = () => decrement(loader);\n img.src = url;\n return img;\n }).catch(e => {\n decrement(loader);\n return {\n complete: false,\n width: 0,\n height: 0,\n src: e && e.url || ''\n };\n });\n },\n ready() {\n const loader = this;\n return new Promise(accept => {\n function poll(value) {\n if (!loader.pending()) accept(value);else setTimeout(() => {\n poll(true);\n }, 10);\n }\n poll(false);\n });\n }\n};\n\nfunction boundStroke (bounds, item, miter) {\n if (item.stroke && item.opacity !== 0 && item.strokeOpacity !== 0) {\n const sw = item.strokeWidth != null ? +item.strokeWidth : 1;\n bounds.expand(sw + (miter ? miterAdjustment(item, sw) : 0));\n }\n return bounds;\n}\nfunction miterAdjustment(item, strokeWidth) {\n // TODO: more sophisticated adjustment? Or miter support in boundContext?\n return item.strokeJoin && item.strokeJoin !== 'miter' ? 0 : strokeWidth;\n}\n\nconst circleThreshold = Tau - 1e-8;\nlet bounds, lx, ly, rot, ma, mb, mc, md;\nconst add = (x, y) => bounds.add(x, y);\nconst addL = (x, y) => add(lx = x, ly = y);\nconst addX = x => add(x, bounds.y1);\nconst addY = y => add(bounds.x1, y);\nconst px = (x, y) => ma * x + mc * y;\nconst py = (x, y) => mb * x + md * y;\nconst addp = (x, y) => add(px(x, y), py(x, y));\nconst addpL = (x, y) => addL(px(x, y), py(x, y));\nfunction boundContext (_, deg) {\n bounds = _;\n if (deg) {\n rot = deg * DegToRad;\n ma = md = Math.cos(rot);\n mb = Math.sin(rot);\n mc = -mb;\n } else {\n ma = md = 1;\n rot = mb = mc = 0;\n }\n return context$1;\n}\nconst context$1 = {\n beginPath() {},\n closePath() {},\n moveTo: addpL,\n lineTo: addpL,\n rect(x, y, w, h) {\n if (rot) {\n addp(x + w, y);\n addp(x + w, y + h);\n addp(x, y + h);\n addpL(x, y);\n } else {\n add(x + w, y + h);\n addL(x, y);\n }\n },\n quadraticCurveTo(x1, y1, x2, y2) {\n const px1 = px(x1, y1),\n py1 = py(x1, y1),\n px2 = px(x2, y2),\n py2 = py(x2, y2);\n quadExtrema(lx, px1, px2, addX);\n quadExtrema(ly, py1, py2, addY);\n addL(px2, py2);\n },\n bezierCurveTo(x1, y1, x2, y2, x3, y3) {\n const px1 = px(x1, y1),\n py1 = py(x1, y1),\n px2 = px(x2, y2),\n py2 = py(x2, y2),\n px3 = px(x3, y3),\n py3 = py(x3, y3);\n cubicExtrema(lx, px1, px2, px3, addX);\n cubicExtrema(ly, py1, py2, py3, addY);\n addL(px3, py3);\n },\n arc(cx, cy, r, sa, ea, ccw) {\n sa += rot;\n ea += rot;\n\n // store last point on path\n lx = r * Math.cos(ea) + cx;\n ly = r * Math.sin(ea) + cy;\n if (Math.abs(ea - sa) > circleThreshold) {\n // treat as full circle\n add(cx - r, cy - r);\n add(cx + r, cy + r);\n } else {\n const update = a => add(r * Math.cos(a) + cx, r * Math.sin(a) + cy);\n let s, i;\n\n // sample end points\n update(sa);\n update(ea);\n\n // sample interior points aligned with 90 degrees\n if (ea !== sa) {\n sa = sa % Tau;\n if (sa < 0) sa += Tau;\n ea = ea % Tau;\n if (ea < 0) ea += Tau;\n if (ea < sa) {\n ccw = !ccw; // flip direction\n s = sa;\n sa = ea;\n ea = s; // swap end-points\n }\n\n if (ccw) {\n ea -= Tau;\n s = sa - sa % HalfPi;\n for (i = 0; i < 4 && s > ea; ++i, s -= HalfPi) update(s);\n } else {\n s = sa - sa % HalfPi + HalfPi;\n for (i = 0; i < 4 && s < ea; ++i, s = s + HalfPi) update(s);\n }\n }\n }\n }\n};\nfunction quadExtrema(x0, x1, x2, cb) {\n const t = (x0 - x1) / (x0 + x2 - 2 * x1);\n if (0 < t && t < 1) cb(x0 + (x1 - x0) * t);\n}\nfunction cubicExtrema(x0, x1, x2, x3, cb) {\n const a = x3 - x0 + 3 * x1 - 3 * x2,\n b = x0 + x2 - 2 * x1,\n c = x0 - x1;\n let t0 = 0,\n t1 = 0,\n r;\n\n // solve for parameter t\n if (Math.abs(a) > Epsilon) {\n // quadratic equation\n r = b * b + c * a;\n if (r >= 0) {\n r = Math.sqrt(r);\n t0 = (-b + r) / a;\n t1 = (-b - r) / a;\n }\n } else {\n // linear equation\n t0 = 0.5 * c / b;\n }\n\n // calculate position\n if (0 < t0 && t0 < 1) cb(cubic(t0, x0, x1, x2, x3));\n if (0 < t1 && t1 < 1) cb(cubic(t1, x0, x1, x2, x3));\n}\nfunction cubic(t, x0, x1, x2, x3) {\n const s = 1 - t,\n s2 = s * s,\n t2 = t * t;\n return s2 * s * x0 + 3 * s2 * t * x1 + 3 * s * t2 * x2 + t2 * t * x3;\n}\n\nvar context = (context = canvas(1, 1)) ? context.getContext('2d') : null;\n\nconst b = new Bounds();\nfunction intersectPath(draw) {\n return function (item, brush) {\n // rely on (inaccurate) bounds intersection if no context\n if (!context) return true;\n\n // add path to offscreen graphics context\n draw(context, item);\n\n // get bounds intersection region\n b.clear().union(item.bounds).intersect(brush).round();\n const {\n x1,\n y1,\n x2,\n y2\n } = b;\n\n // iterate over intersection region\n // perform fine grained inclusion test\n for (let y = y1; y <= y2; ++y) {\n for (let x = x1; x <= x2; ++x) {\n if (context.isPointInPath(x, y)) {\n return true;\n }\n }\n }\n\n // false if no hits in intersection region\n return false;\n };\n}\nfunction intersectPoint(item, box) {\n return box.contains(item.x || 0, item.y || 0);\n}\nfunction intersectRect(item, box) {\n const x = item.x || 0,\n y = item.y || 0,\n w = item.width || 0,\n h = item.height || 0;\n return box.intersects(b.set(x, y, x + w, y + h));\n}\nfunction intersectRule(item, box) {\n const x = item.x || 0,\n y = item.y || 0,\n x2 = item.x2 != null ? item.x2 : x,\n y2 = item.y2 != null ? item.y2 : y;\n return intersectBoxLine(box, x, y, x2, y2);\n}\nfunction intersectBoxLine(box, x, y, u, v) {\n const {\n x1,\n y1,\n x2,\n y2\n } = box,\n dx = u - x,\n dy = v - y;\n let t0 = 0,\n t1 = 1,\n p,\n q,\n r,\n e;\n for (e = 0; e < 4; ++e) {\n if (e === 0) {\n p = -dx;\n q = -(x1 - x);\n }\n if (e === 1) {\n p = dx;\n q = x2 - x;\n }\n if (e === 2) {\n p = -dy;\n q = -(y1 - y);\n }\n if (e === 3) {\n p = dy;\n q = y2 - y;\n }\n if (Math.abs(p) < 1e-10 && q < 0) return false;\n r = q / p;\n if (p < 0) {\n if (r > t1) return false;else if (r > t0) t0 = r;\n } else if (p > 0) {\n if (r < t0) return false;else if (r < t1) t1 = r;\n }\n }\n return true;\n}\n\nfunction blend (context, item) {\n context.globalCompositeOperation = item.blend || 'source-over';\n}\n\nfunction value (value, dflt) {\n return value == null ? dflt : value;\n}\n\nfunction addStops(gradient, stops) {\n const n = stops.length;\n for (let i = 0; i < n; ++i) {\n gradient.addColorStop(stops[i].offset, stops[i].color);\n }\n return gradient;\n}\nfunction gradient (context, spec, bounds) {\n const w = bounds.width(),\n h = bounds.height();\n let gradient;\n if (spec.gradient === 'radial') {\n gradient = context.createRadialGradient(bounds.x1 + value(spec.x1, 0.5) * w, bounds.y1 + value(spec.y1, 0.5) * h, Math.max(w, h) * value(spec.r1, 0), bounds.x1 + value(spec.x2, 0.5) * w, bounds.y1 + value(spec.y2, 0.5) * h, Math.max(w, h) * value(spec.r2, 0.5));\n } else {\n // linear gradient\n const x1 = value(spec.x1, 0),\n y1 = value(spec.y1, 0),\n x2 = value(spec.x2, 1),\n y2 = value(spec.y2, 0);\n if (x1 === x2 || y1 === y2 || w === h) {\n // axis aligned: use normal gradient\n gradient = context.createLinearGradient(bounds.x1 + x1 * w, bounds.y1 + y1 * h, bounds.x1 + x2 * w, bounds.y1 + y2 * h);\n } else {\n // not axis aligned: render gradient into a pattern (#2365)\n // this allows us to use normalized bounding box coordinates\n const image = canvas(Math.ceil(w), Math.ceil(h)),\n ictx = image.getContext('2d');\n ictx.scale(w, h);\n ictx.fillStyle = addStops(ictx.createLinearGradient(x1, y1, x2, y2), spec.stops);\n ictx.fillRect(0, 0, w, h);\n return context.createPattern(image, 'no-repeat');\n }\n }\n return addStops(gradient, spec.stops);\n}\n\nfunction color (context, item, value) {\n return isGradient(value) ? gradient(context, value, item.bounds) : value;\n}\n\nfunction fill (context, item, opacity) {\n opacity *= item.fillOpacity == null ? 1 : item.fillOpacity;\n if (opacity > 0) {\n context.globalAlpha = opacity;\n context.fillStyle = color(context, item, item.fill);\n return true;\n } else {\n return false;\n }\n}\n\nvar Empty = [];\nfunction stroke (context, item, opacity) {\n var lw = (lw = item.strokeWidth) != null ? lw : 1;\n if (lw <= 0) return false;\n opacity *= item.strokeOpacity == null ? 1 : item.strokeOpacity;\n if (opacity > 0) {\n context.globalAlpha = opacity;\n context.strokeStyle = color(context, item, item.stroke);\n context.lineWidth = lw;\n context.lineCap = item.strokeCap || 'butt';\n context.lineJoin = item.strokeJoin || 'miter';\n context.miterLimit = item.strokeMiterLimit || 10;\n if (context.setLineDash) {\n context.setLineDash(item.strokeDash || Empty);\n context.lineDashOffset = item.strokeDashOffset || 0;\n }\n return true;\n } else {\n return false;\n }\n}\n\nfunction compare(a, b) {\n return a.zindex - b.zindex || a.index - b.index;\n}\nfunction zorder(scene) {\n if (!scene.zdirty) return scene.zitems;\n var items = scene.items,\n output = [],\n item,\n i,\n n;\n for (i = 0, n = items.length; i < n; ++i) {\n item = items[i];\n item.index = i;\n if (item.zindex) output.push(item);\n }\n scene.zdirty = false;\n return scene.zitems = output.sort(compare);\n}\nfunction visit(scene, visitor) {\n var items = scene.items,\n i,\n n;\n if (!items || !items.length) return;\n const zitems = zorder(scene);\n if (zitems && zitems.length) {\n for (i = 0, n = items.length; i < n; ++i) {\n if (!items[i].zindex) visitor(items[i]);\n }\n items = zitems;\n }\n for (i = 0, n = items.length; i < n; ++i) {\n visitor(items[i]);\n }\n}\nfunction pickVisit(scene, visitor) {\n var items = scene.items,\n hit,\n i;\n if (!items || !items.length) return null;\n const zitems = zorder(scene);\n if (zitems && zitems.length) items = zitems;\n for (i = items.length; --i >= 0;) {\n if (hit = visitor(items[i])) return hit;\n }\n if (items === zitems) {\n for (items = scene.items, i = items.length; --i >= 0;) {\n if (!items[i].zindex) {\n if (hit = visitor(items[i])) return hit;\n }\n }\n }\n return null;\n}\n\nfunction drawAll(path) {\n return function (context, scene, bounds) {\n visit(scene, item => {\n if (!bounds || bounds.intersects(item.bounds)) {\n drawPath(path, context, item, item);\n }\n });\n };\n}\nfunction drawOne(path) {\n return function (context, scene, bounds) {\n if (scene.items.length && (!bounds || bounds.intersects(scene.bounds))) {\n drawPath(path, context, scene.items[0], scene.items);\n }\n };\n}\nfunction drawPath(path, context, item, items) {\n var opacity = item.opacity == null ? 1 : item.opacity;\n if (opacity === 0) return;\n if (path(context, items)) return;\n blend(context, item);\n if (item.fill && fill(context, item, opacity)) {\n context.fill();\n }\n if (item.stroke && stroke(context, item, opacity)) {\n context.stroke();\n }\n}\n\nfunction pick$1(test) {\n test = test || truthy;\n return function (context, scene, x, y, gx, gy) {\n x *= context.pixelRatio;\n y *= context.pixelRatio;\n return pickVisit(scene, item => {\n const b = item.bounds;\n // first hit test against bounding box\n if (b && !b.contains(gx, gy) || !b) return;\n // if in bounding box, perform more careful test\n if (test(context, item, x, y, gx, gy)) return item;\n });\n };\n}\nfunction hitPath(path, filled) {\n return function (context, o, x, y) {\n var item = Array.isArray(o) ? o[0] : o,\n fill = filled == null ? item.fill : filled,\n stroke = item.stroke && context.isPointInStroke,\n lw,\n lc;\n if (stroke) {\n lw = item.strokeWidth;\n lc = item.strokeCap;\n context.lineWidth = lw != null ? lw : 1;\n context.lineCap = lc != null ? lc : 'butt';\n }\n return path(context, o) ? false : fill && context.isPointInPath(x, y) || stroke && context.isPointInStroke(x, y);\n };\n}\nfunction pickPath(path) {\n return pick$1(hitPath(path));\n}\n\nfunction translate(x, y) {\n return 'translate(' + x + ',' + y + ')';\n}\nfunction rotate(a) {\n return 'rotate(' + a + ')';\n}\nfunction scale(scaleX, scaleY) {\n return 'scale(' + scaleX + ',' + scaleY + ')';\n}\nfunction translateItem(item) {\n return translate(item.x || 0, item.y || 0);\n}\nfunction rotateItem(item) {\n return translate(item.x || 0, item.y || 0) + (item.angle ? ' ' + rotate(item.angle) : '');\n}\nfunction transformItem(item) {\n return translate(item.x || 0, item.y || 0) + (item.angle ? ' ' + rotate(item.angle) : '') + (item.scaleX || item.scaleY ? ' ' + scale(item.scaleX || 1, item.scaleY || 1) : '');\n}\n\nfunction markItemPath (type, shape, isect) {\n function attr(emit, item) {\n emit('transform', rotateItem(item));\n emit('d', shape(null, item));\n }\n function bound(bounds, item) {\n shape(boundContext(bounds, item.angle), item);\n return boundStroke(bounds, item).translate(item.x || 0, item.y || 0);\n }\n function draw(context, item) {\n var x = item.x || 0,\n y = item.y || 0,\n a = item.angle || 0;\n context.translate(x, y);\n if (a) context.rotate(a *= DegToRad);\n context.beginPath();\n shape(context, item);\n if (a) context.rotate(-a);\n context.translate(-x, -y);\n }\n return {\n type: type,\n tag: 'path',\n nested: false,\n attr: attr,\n bound: bound,\n draw: drawAll(draw),\n pick: pickPath(draw),\n isect: isect || intersectPath(draw)\n };\n}\n\nvar arc = markItemPath('arc', arc$1);\n\nfunction pickArea(a, p) {\n var v = a[0].orient === 'horizontal' ? p[1] : p[0],\n z = a[0].orient === 'horizontal' ? 'y' : 'x',\n i = a.length,\n min = +Infinity,\n hit,\n d;\n while (--i >= 0) {\n if (a[i].defined === false) continue;\n d = Math.abs(a[i][z] - v);\n if (d < min) {\n min = d;\n hit = a[i];\n }\n }\n return hit;\n}\nfunction pickLine(a, p) {\n var t = Math.pow(a[0].strokeWidth || 1, 2),\n i = a.length,\n dx,\n dy,\n dd;\n while (--i >= 0) {\n if (a[i].defined === false) continue;\n dx = a[i].x - p[0];\n dy = a[i].y - p[1];\n dd = dx * dx + dy * dy;\n if (dd < t) return a[i];\n }\n return null;\n}\nfunction pickTrail(a, p) {\n var i = a.length,\n dx,\n dy,\n dd;\n while (--i >= 0) {\n if (a[i].defined === false) continue;\n dx = a[i].x - p[0];\n dy = a[i].y - p[1];\n dd = dx * dx + dy * dy;\n dx = a[i].size || 1;\n if (dd < dx * dx) return a[i];\n }\n return null;\n}\n\nfunction markMultiItemPath (type, shape, tip) {\n function attr(emit, item) {\n var items = item.mark.items;\n if (items.length) emit('d', shape(null, items));\n }\n function bound(bounds, mark) {\n var items = mark.items;\n if (items.length === 0) {\n return bounds;\n } else {\n shape(boundContext(bounds), items);\n return boundStroke(bounds, items[0]);\n }\n }\n function draw(context, items) {\n context.beginPath();\n shape(context, items);\n }\n const hit = hitPath(draw);\n function pick(context, scene, x, y, gx, gy) {\n var items = scene.items,\n b = scene.bounds;\n if (!items || !items.length || b && !b.contains(gx, gy)) {\n return null;\n }\n x *= context.pixelRatio;\n y *= context.pixelRatio;\n return hit(context, items, x, y) ? items[0] : null;\n }\n return {\n type: type,\n tag: 'path',\n nested: true,\n attr: attr,\n bound: bound,\n draw: drawOne(draw),\n pick: pick,\n isect: intersectPoint,\n tip: tip\n };\n}\n\nvar area = markMultiItemPath('area', area$1, pickArea);\n\nfunction clip (context, scene) {\n var clip = scene.clip;\n context.save();\n if (isFunction(clip)) {\n context.beginPath();\n clip(context);\n context.clip();\n } else {\n clipGroup(context, scene.group);\n }\n}\nfunction clipGroup(context, group) {\n context.beginPath();\n hasCornerRadius(group) ? rectangle(context, group, 0, 0) : context.rect(0, 0, group.width || 0, group.height || 0);\n context.clip();\n}\n\nfunction offset$1(item) {\n const sw = value(item.strokeWidth, 1);\n return item.strokeOffset != null ? item.strokeOffset : item.stroke && sw > 0.5 && sw < 1.5 ? 0.5 - Math.abs(sw - 1) : 0;\n}\nfunction attr$5(emit, item) {\n emit('transform', translateItem(item));\n}\nfunction emitRectangle(emit, item) {\n const off = offset$1(item);\n emit('d', rectangle(null, item, off, off));\n}\nfunction background(emit, item) {\n emit('class', 'background');\n emit('aria-hidden', true);\n emitRectangle(emit, item);\n}\nfunction foreground(emit, item) {\n emit('class', 'foreground');\n emit('aria-hidden', true);\n if (item.strokeForeground) {\n emitRectangle(emit, item);\n } else {\n emit('d', '');\n }\n}\nfunction content(emit, item, renderer) {\n const url = item.clip ? clip$1(renderer, item, item) : null;\n emit('clip-path', url);\n}\nfunction bound$5(bounds, group) {\n if (!group.clip && group.items) {\n const items = group.items,\n m = items.length;\n for (let j = 0; j < m; ++j) {\n bounds.union(items[j].bounds);\n }\n }\n if ((group.clip || group.width || group.height) && !group.noBound) {\n bounds.add(0, 0).add(group.width || 0, group.height || 0);\n }\n boundStroke(bounds, group);\n return bounds.translate(group.x || 0, group.y || 0);\n}\nfunction rectanglePath(context, group, x, y) {\n const off = offset$1(group);\n context.beginPath();\n rectangle(context, group, (x || 0) + off, (y || 0) + off);\n}\nconst hitBackground = hitPath(rectanglePath);\nconst hitForeground = hitPath(rectanglePath, false);\nconst hitCorner = hitPath(rectanglePath, true);\nfunction draw$4(context, scene, bounds) {\n visit(scene, group => {\n const gx = group.x || 0,\n gy = group.y || 0,\n fore = group.strokeForeground,\n opacity = group.opacity == null ? 1 : group.opacity;\n\n // draw group background\n if ((group.stroke || group.fill) && opacity) {\n rectanglePath(context, group, gx, gy);\n blend(context, group);\n if (group.fill && fill(context, group, opacity)) {\n context.fill();\n }\n if (group.stroke && !fore && stroke(context, group, opacity)) {\n context.stroke();\n }\n }\n\n // setup graphics context, set clip and bounds\n context.save();\n context.translate(gx, gy);\n if (group.clip) clipGroup(context, group);\n if (bounds) bounds.translate(-gx, -gy);\n\n // draw group contents\n visit(group, item => {\n this.draw(context, item, bounds);\n });\n\n // restore graphics context\n if (bounds) bounds.translate(gx, gy);\n context.restore();\n\n // draw group foreground\n if (fore && group.stroke && opacity) {\n rectanglePath(context, group, gx, gy);\n blend(context, group);\n if (stroke(context, group, opacity)) {\n context.stroke();\n }\n }\n });\n}\nfunction pick(context, scene, x, y, gx, gy) {\n if (scene.bounds && !scene.bounds.contains(gx, gy) || !scene.items) {\n return null;\n }\n const cx = x * context.pixelRatio,\n cy = y * context.pixelRatio;\n return pickVisit(scene, group => {\n let hit, dx, dy;\n\n // first hit test bounding box\n const b = group.bounds;\n if (b && !b.contains(gx, gy)) return;\n\n // passed bounds check, test rectangular clip\n dx = group.x || 0;\n dy = group.y || 0;\n const dw = dx + (group.width || 0),\n dh = dy + (group.height || 0),\n c = group.clip;\n if (c && (gx < dx || gx > dw || gy < dy || gy > dh)) return;\n\n // adjust coordinate system\n context.save();\n context.translate(dx, dy);\n dx = gx - dx;\n dy = gy - dy;\n\n // test background for rounded corner clip\n if (c && hasCornerRadius(group) && !hitCorner(context, group, cx, cy)) {\n context.restore();\n return null;\n }\n const fore = group.strokeForeground,\n ix = scene.interactive !== false;\n\n // hit test against group foreground\n if (ix && fore && group.stroke && hitForeground(context, group, cx, cy)) {\n context.restore();\n return group;\n }\n\n // hit test against contained marks\n hit = pickVisit(group, mark => pickMark(mark, dx, dy) ? this.pick(mark, x, y, dx, dy) : null);\n\n // hit test against group background\n if (!hit && ix && (group.fill || !fore && group.stroke) && hitBackground(context, group, cx, cy)) {\n hit = group;\n }\n\n // restore state and return\n context.restore();\n return hit || null;\n });\n}\nfunction pickMark(mark, x, y) {\n return (mark.interactive !== false || mark.marktype === 'group') && mark.bounds && mark.bounds.contains(x, y);\n}\nvar group = {\n type: 'group',\n tag: 'g',\n nested: false,\n attr: attr$5,\n bound: bound$5,\n draw: draw$4,\n pick: pick,\n isect: intersectRect,\n content: content,\n background: background,\n foreground: foreground\n};\n\nvar metadata = {\n 'xmlns': 'http://www.w3.org/2000/svg',\n 'xmlns:xlink': 'http://www.w3.org/1999/xlink',\n 'version': '1.1'\n};\n\nfunction getImage(item, renderer) {\n var image = item.image;\n if (!image || item.url && item.url !== image.url) {\n image = {\n complete: false,\n width: 0,\n height: 0\n };\n renderer.loadImage(item.url).then(image => {\n item.image = image;\n item.image.url = item.url;\n });\n }\n return image;\n}\nfunction imageWidth(item, image) {\n return item.width != null ? item.width : !image || !image.width ? 0 : item.aspect !== false && item.height ? item.height * image.width / image.height : image.width;\n}\nfunction imageHeight(item, image) {\n return item.height != null ? item.height : !image || !image.height ? 0 : item.aspect !== false && item.width ? item.width * image.height / image.width : image.height;\n}\nfunction imageXOffset(align, w) {\n return align === 'center' ? w / 2 : align === 'right' ? w : 0;\n}\nfunction imageYOffset(baseline, h) {\n return baseline === 'middle' ? h / 2 : baseline === 'bottom' ? h : 0;\n}\nfunction attr$4(emit, item, renderer) {\n const img = getImage(item, renderer),\n w = imageWidth(item, img),\n h = imageHeight(item, img),\n x = (item.x || 0) - imageXOffset(item.align, w),\n y = (item.y || 0) - imageYOffset(item.baseline, h),\n i = !img.src && img.toDataURL ? img.toDataURL() : img.src || '';\n emit('href', i, metadata['xmlns:xlink'], 'xlink:href');\n emit('transform', translate(x, y));\n emit('width', w);\n emit('height', h);\n emit('preserveAspectRatio', item.aspect === false ? 'none' : 'xMidYMid');\n}\nfunction bound$4(bounds, item) {\n const img = item.image,\n w = imageWidth(item, img),\n h = imageHeight(item, img),\n x = (item.x || 0) - imageXOffset(item.align, w),\n y = (item.y || 0) - imageYOffset(item.baseline, h);\n return bounds.set(x, y, x + w, y + h);\n}\nfunction draw$3(context, scene, bounds) {\n visit(scene, item => {\n if (bounds && !bounds.intersects(item.bounds)) return; // bounds check\n\n const img = getImage(item, this);\n let w = imageWidth(item, img);\n let h = imageHeight(item, img);\n if (w === 0 || h === 0) return; // early exit\n\n let x = (item.x || 0) - imageXOffset(item.align, w),\n y = (item.y || 0) - imageYOffset(item.baseline, h),\n opacity,\n ar0,\n ar1,\n t;\n if (item.aspect !== false) {\n ar0 = img.width / img.height;\n ar1 = item.width / item.height;\n if (ar0 === ar0 && ar1 === ar1 && ar0 !== ar1) {\n if (ar1 < ar0) {\n t = w / ar0;\n y += (h - t) / 2;\n h = t;\n } else {\n t = h * ar0;\n x += (w - t) / 2;\n w = t;\n }\n }\n }\n if (img.complete || img.toDataURL) {\n blend(context, item);\n context.globalAlpha = (opacity = item.opacity) != null ? opacity : 1;\n context.imageSmoothingEnabled = item.smooth !== false;\n context.drawImage(img, x, y, w, h);\n }\n });\n}\nvar image = {\n type: 'image',\n tag: 'image',\n nested: false,\n attr: attr$4,\n bound: bound$4,\n draw: draw$3,\n pick: pick$1(),\n isect: truthy,\n // bounds check is sufficient\n get: getImage,\n xOffset: imageXOffset,\n yOffset: imageYOffset\n};\n\nvar line = markMultiItemPath('line', line$1, pickLine);\n\nfunction attr$3(emit, item) {\n var sx = item.scaleX || 1,\n sy = item.scaleY || 1;\n if (sx !== 1 || sy !== 1) {\n emit('vector-effect', 'non-scaling-stroke');\n }\n emit('transform', transformItem(item));\n emit('d', item.path);\n}\nfunction path$1(context, item) {\n var path = item.path;\n if (path == null) return true;\n var x = item.x || 0,\n y = item.y || 0,\n sx = item.scaleX || 1,\n sy = item.scaleY || 1,\n a = (item.angle || 0) * DegToRad,\n cache = item.pathCache;\n if (!cache || cache.path !== path) {\n (item.pathCache = cache = parse(path)).path = path;\n }\n if (a && context.rotate && context.translate) {\n context.translate(x, y);\n context.rotate(a);\n pathRender(context, cache, 0, 0, sx, sy);\n context.rotate(-a);\n context.translate(-x, -y);\n } else {\n pathRender(context, cache, x, y, sx, sy);\n }\n}\nfunction bound$3(bounds, item) {\n return path$1(boundContext(bounds, item.angle), item) ? bounds.set(0, 0, 0, 0) : boundStroke(bounds, item, true);\n}\nvar path$2 = {\n type: 'path',\n tag: 'path',\n nested: false,\n attr: attr$3,\n bound: bound$3,\n draw: drawAll(path$1),\n pick: pickPath(path$1),\n isect: intersectPath(path$1)\n};\n\nfunction attr$2(emit, item) {\n emit('d', rectangle(null, item));\n}\nfunction bound$2(bounds, item) {\n var x, y;\n return boundStroke(bounds.set(x = item.x || 0, y = item.y || 0, x + item.width || 0, y + item.height || 0), item);\n}\nfunction draw$2(context, item) {\n context.beginPath();\n rectangle(context, item);\n}\nvar rect = {\n type: 'rect',\n tag: 'path',\n nested: false,\n attr: attr$2,\n bound: bound$2,\n draw: drawAll(draw$2),\n pick: pickPath(draw$2),\n isect: intersectRect\n};\n\nfunction attr$1(emit, item) {\n emit('transform', translateItem(item));\n emit('x2', item.x2 != null ? item.x2 - (item.x || 0) : 0);\n emit('y2', item.y2 != null ? item.y2 - (item.y || 0) : 0);\n}\nfunction bound$1(bounds, item) {\n var x1, y1;\n return boundStroke(bounds.set(x1 = item.x || 0, y1 = item.y || 0, item.x2 != null ? item.x2 : x1, item.y2 != null ? item.y2 : y1), item);\n}\nfunction path(context, item, opacity) {\n var x1, y1, x2, y2;\n if (item.stroke && stroke(context, item, opacity)) {\n x1 = item.x || 0;\n y1 = item.y || 0;\n x2 = item.x2 != null ? item.x2 : x1;\n y2 = item.y2 != null ? item.y2 : y1;\n context.beginPath();\n context.moveTo(x1, y1);\n context.lineTo(x2, y2);\n return true;\n }\n return false;\n}\nfunction draw$1(context, scene, bounds) {\n visit(scene, item => {\n if (bounds && !bounds.intersects(item.bounds)) return; // bounds check\n var opacity = item.opacity == null ? 1 : item.opacity;\n if (opacity && path(context, item, opacity)) {\n blend(context, item);\n context.stroke();\n }\n });\n}\nfunction hit$1(context, item, x, y) {\n if (!context.isPointInStroke) return false;\n return path(context, item, 1) && context.isPointInStroke(x, y);\n}\nvar rule = {\n type: 'rule',\n tag: 'line',\n nested: false,\n attr: attr$1,\n bound: bound$1,\n draw: draw$1,\n pick: pick$1(hit$1),\n isect: intersectRule\n};\n\nvar shape = markItemPath('shape', shape$1);\n\nvar symbol = markItemPath('symbol', symbol$1, intersectPoint);\n\n// memoize text width measurement\nconst widthCache = lruCache();\nvar textMetrics = {\n height: fontSize,\n measureWidth: measureWidth,\n estimateWidth: estimateWidth,\n width: estimateWidth,\n canvas: useCanvas\n};\nuseCanvas(true);\nfunction useCanvas(use) {\n textMetrics.width = use && context ? measureWidth : estimateWidth;\n}\n\n// make simple estimate if no canvas is available\nfunction estimateWidth(item, text) {\n return _estimateWidth(textValue(item, text), fontSize(item));\n}\nfunction _estimateWidth(text, currentFontHeight) {\n return ~~(0.8 * text.length * currentFontHeight);\n}\n\n// measure text width if canvas is available\nfunction measureWidth(item, text) {\n return fontSize(item) <= 0 || !(text = textValue(item, text)) ? 0 : _measureWidth(text, font(item));\n}\nfunction _measureWidth(text, currentFont) {\n const key = `(${currentFont}) ${text}`;\n let width = widthCache.get(key);\n if (width === undefined) {\n context.font = currentFont;\n width = context.measureText(text).width;\n widthCache.set(key, width);\n }\n return width;\n}\nfunction fontSize(item) {\n return item.fontSize != null ? +item.fontSize || 0 : 11;\n}\nfunction lineHeight(item) {\n return item.lineHeight != null ? item.lineHeight : fontSize(item) + 2;\n}\nfunction lineArray(_) {\n return isArray(_) ? _.length > 1 ? _ : _[0] : _;\n}\nfunction textLines(item) {\n return lineArray(item.lineBreak && item.text && !isArray(item.text) ? item.text.split(item.lineBreak) : item.text);\n}\nfunction multiLineOffset(item) {\n const tl = textLines(item);\n return (isArray(tl) ? tl.length - 1 : 0) * lineHeight(item);\n}\nfunction textValue(item, line) {\n const text = line == null ? '' : (line + '').trim();\n return item.limit > 0 && text.length ? truncate(item, text) : text;\n}\nfunction widthGetter(item) {\n if (textMetrics.width === measureWidth) {\n // we are using canvas\n const currentFont = font(item);\n return text => _measureWidth(text, currentFont);\n } else {\n // we are relying on estimates\n const currentFontHeight = fontSize(item);\n return text => _estimateWidth(text, currentFontHeight);\n }\n}\nfunction truncate(item, text) {\n var limit = +item.limit,\n width = widthGetter(item);\n if (width(text) < limit) return text;\n var ellipsis = item.ellipsis || '\\u2026',\n rtl = item.dir === 'rtl',\n lo = 0,\n hi = text.length,\n mid;\n limit -= width(ellipsis);\n if (rtl) {\n while (lo < hi) {\n mid = lo + hi >>> 1;\n if (width(text.slice(mid)) > limit) lo = mid + 1;else hi = mid;\n }\n return ellipsis + text.slice(lo);\n } else {\n while (lo < hi) {\n mid = 1 + (lo + hi >>> 1);\n if (width(text.slice(0, mid)) < limit) lo = mid;else hi = mid - 1;\n }\n return text.slice(0, lo) + ellipsis;\n }\n}\nfunction fontFamily(item, quote) {\n var font = item.font;\n return (quote && font ? String(font).replace(/\"/g, '\\'') : font) || 'sans-serif';\n}\nfunction font(item, quote) {\n return '' + (item.fontStyle ? item.fontStyle + ' ' : '') + (item.fontVariant ? item.fontVariant + ' ' : '') + (item.fontWeight ? item.fontWeight + ' ' : '') + fontSize(item) + 'px ' + fontFamily(item, quote);\n}\nfunction offset(item) {\n // perform our own font baseline calculation\n // why? not all browsers support SVG 1.1 'alignment-baseline' :(\n // this also ensures consistent layout across renderers\n var baseline = item.baseline,\n h = fontSize(item);\n return Math.round(baseline === 'top' ? 0.79 * h : baseline === 'middle' ? 0.30 * h : baseline === 'bottom' ? -0.21 * h : baseline === 'line-top' ? 0.29 * h + 0.5 * lineHeight(item) : baseline === 'line-bottom' ? 0.29 * h - 0.5 * lineHeight(item) : 0);\n}\n\nconst textAlign = {\n 'left': 'start',\n 'center': 'middle',\n 'right': 'end'\n};\nconst tempBounds = new Bounds();\nfunction anchorPoint(item) {\n var x = item.x || 0,\n y = item.y || 0,\n r = item.radius || 0,\n t;\n if (r) {\n t = (item.theta || 0) - HalfPi;\n x += r * Math.cos(t);\n y += r * Math.sin(t);\n }\n tempBounds.x1 = x;\n tempBounds.y1 = y;\n return tempBounds;\n}\nfunction attr(emit, item) {\n var dx = item.dx || 0,\n dy = (item.dy || 0) + offset(item),\n p = anchorPoint(item),\n x = p.x1,\n y = p.y1,\n a = item.angle || 0,\n t;\n emit('text-anchor', textAlign[item.align] || 'start');\n if (a) {\n t = translate(x, y) + ' ' + rotate(a);\n if (dx || dy) t += ' ' + translate(dx, dy);\n } else {\n t = translate(x + dx, y + dy);\n }\n emit('transform', t);\n}\nfunction bound(bounds, item, mode) {\n var h = textMetrics.height(item),\n a = item.align,\n p = anchorPoint(item),\n x = p.x1,\n y = p.y1,\n dx = item.dx || 0,\n dy = (item.dy || 0) + offset(item) - Math.round(0.8 * h),\n // use 4/5 offset\n tl = textLines(item),\n w;\n\n // get dimensions\n if (isArray(tl)) {\n // multi-line text\n h += lineHeight(item) * (tl.length - 1);\n w = tl.reduce((w, t) => Math.max(w, textMetrics.width(item, t)), 0);\n } else {\n // single-line text\n w = textMetrics.width(item, tl);\n }\n\n // horizontal alignment\n if (a === 'center') {\n dx -= w / 2;\n } else if (a === 'right') {\n dx -= w;\n } else ;\n bounds.set(dx += x, dy += y, dx + w, dy + h);\n if (item.angle && !mode) {\n bounds.rotate(item.angle * DegToRad, x, y);\n } else if (mode === 2) {\n return bounds.rotatedPoints(item.angle * DegToRad, x, y);\n }\n return bounds;\n}\nfunction draw(context, scene, bounds) {\n visit(scene, item => {\n var opacity = item.opacity == null ? 1 : item.opacity,\n p,\n x,\n y,\n i,\n lh,\n tl,\n str;\n if (bounds && !bounds.intersects(item.bounds) ||\n // bounds check\n opacity === 0 || item.fontSize <= 0 || item.text == null || item.text.length === 0) return;\n context.font = font(item);\n context.textAlign = item.align || 'left';\n p = anchorPoint(item);\n x = p.x1, y = p.y1;\n if (item.angle) {\n context.save();\n context.translate(x, y);\n context.rotate(item.angle * DegToRad);\n x = y = 0; // reset x, y\n }\n\n x += item.dx || 0;\n y += (item.dy || 0) + offset(item);\n tl = textLines(item);\n blend(context, item);\n if (isArray(tl)) {\n lh = lineHeight(item);\n for (i = 0; i < tl.length; ++i) {\n str = textValue(item, tl[i]);\n if (item.fill && fill(context, item, opacity)) {\n context.fillText(str, x, y);\n }\n if (item.stroke && stroke(context, item, opacity)) {\n context.strokeText(str, x, y);\n }\n y += lh;\n }\n } else {\n str = textValue(item, tl);\n if (item.fill && fill(context, item, opacity)) {\n context.fillText(str, x, y);\n }\n if (item.stroke && stroke(context, item, opacity)) {\n context.strokeText(str, x, y);\n }\n }\n if (item.angle) context.restore();\n });\n}\nfunction hit(context, item, x, y, gx, gy) {\n if (item.fontSize <= 0) return false;\n if (!item.angle) return true; // bounds sufficient if no rotation\n\n // project point into space of unrotated bounds\n var p = anchorPoint(item),\n ax = p.x1,\n ay = p.y1,\n b = bound(tempBounds, item, 1),\n a = -item.angle * DegToRad,\n cos = Math.cos(a),\n sin = Math.sin(a),\n px = cos * gx - sin * gy + (ax - cos * ax + sin * ay),\n py = sin * gx + cos * gy + (ay - sin * ax - cos * ay);\n return b.contains(px, py);\n}\nfunction intersectText(item, box) {\n const p = bound(tempBounds, item, 2);\n return intersectBoxLine(box, p[0], p[1], p[2], p[3]) || intersectBoxLine(box, p[0], p[1], p[4], p[5]) || intersectBoxLine(box, p[4], p[5], p[6], p[7]) || intersectBoxLine(box, p[2], p[3], p[6], p[7]);\n}\nvar text = {\n type: 'text',\n tag: 'text',\n nested: false,\n attr: attr,\n bound: bound,\n draw: draw,\n pick: pick$1(hit),\n isect: intersectText\n};\n\nvar trail = markMultiItemPath('trail', trail$1, pickTrail);\n\nvar Marks = {\n arc: arc,\n area: area,\n group: group,\n image: image,\n line: line,\n path: path$2,\n rect: rect,\n rule: rule,\n shape: shape,\n symbol: symbol,\n text: text,\n trail: trail\n};\n\nfunction boundItem (item, func, opt) {\n var type = Marks[item.mark.marktype],\n bound = func || type.bound;\n if (type.nested) item = item.mark;\n return bound(item.bounds || (item.bounds = new Bounds()), item, opt);\n}\n\nvar DUMMY = {\n mark: null\n};\nfunction boundMark (mark, bounds, opt) {\n var type = Marks[mark.marktype],\n bound = type.bound,\n items = mark.items,\n hasItems = items && items.length,\n i,\n n,\n item,\n b;\n if (type.nested) {\n if (hasItems) {\n item = items[0];\n } else {\n // no items, fake it\n DUMMY.mark = mark;\n item = DUMMY;\n }\n b = boundItem(item, bound, opt);\n bounds = bounds && bounds.union(b) || b;\n return bounds;\n }\n bounds = bounds || mark.bounds && mark.bounds.clear() || new Bounds();\n if (hasItems) {\n for (i = 0, n = items.length; i < n; ++i) {\n bounds.union(boundItem(items[i], bound, opt));\n }\n }\n return mark.bounds = bounds;\n}\n\nconst keys = ['marktype', 'name', 'role', 'interactive', 'clip', 'items', 'zindex', 'x', 'y', 'width', 'height', 'align', 'baseline',\n// layout\n'fill', 'fillOpacity', 'opacity', 'blend',\n// fill\n'stroke', 'strokeOpacity', 'strokeWidth', 'strokeCap',\n// stroke\n'strokeDash', 'strokeDashOffset',\n// stroke dash\n'strokeForeground', 'strokeOffset',\n// group\n'startAngle', 'endAngle', 'innerRadius', 'outerRadius',\n// arc\n'cornerRadius', 'padAngle',\n// arc, rect\n'cornerRadiusTopLeft', 'cornerRadiusTopRight',\n// rect, group\n'cornerRadiusBottomLeft', 'cornerRadiusBottomRight', 'interpolate', 'tension', 'orient', 'defined',\n// area, line\n'url', 'aspect', 'smooth',\n// image\n'path', 'scaleX', 'scaleY',\n// path\n'x2', 'y2',\n// rule\n'size', 'shape',\n// symbol\n'text', 'angle', 'theta', 'radius', 'dir', 'dx', 'dy',\n// text\n'ellipsis', 'limit', 'lineBreak', 'lineHeight', 'font', 'fontSize', 'fontWeight', 'fontStyle', 'fontVariant',\n// font\n'description', 'aria', 'ariaRole', 'ariaRoleDescription' // aria\n];\n\nfunction sceneToJSON(scene, indent) {\n return JSON.stringify(scene, keys, indent);\n}\nfunction sceneFromJSON(json) {\n const scene = typeof json === 'string' ? JSON.parse(json) : json;\n return initialize(scene);\n}\nfunction initialize(scene) {\n var type = scene.marktype,\n items = scene.items,\n parent,\n i,\n n;\n if (items) {\n for (i = 0, n = items.length; i < n; ++i) {\n parent = type ? 'mark' : 'group';\n items[i][parent] = scene;\n if (items[i].zindex) items[i][parent].zdirty = true;\n if ('group' === (type || parent)) initialize(items[i]);\n }\n }\n if (type) boundMark(scene);\n return scene;\n}\n\nfunction Scenegraph(scene) {\n if (arguments.length) {\n this.root = sceneFromJSON(scene);\n } else {\n this.root = createMark({\n marktype: 'group',\n name: 'root',\n role: 'frame'\n });\n this.root.items = [new GroupItem(this.root)];\n }\n}\nScenegraph.prototype = {\n toJSON(indent) {\n return sceneToJSON(this.root, indent || 0);\n },\n mark(markdef, group, index) {\n group = group || this.root.items[0];\n const mark = createMark(markdef, group);\n group.items[index] = mark;\n if (mark.zindex) mark.group.zdirty = true;\n return mark;\n }\n};\nfunction createMark(def, group) {\n const mark = {\n bounds: new Bounds(),\n clip: !!def.clip,\n group: group,\n interactive: def.interactive === false ? false : true,\n items: [],\n marktype: def.marktype,\n name: def.name || undefined,\n role: def.role || undefined,\n zindex: def.zindex || 0\n };\n\n // add accessibility properties if defined\n if (def.aria != null) {\n mark.aria = def.aria;\n }\n if (def.description) {\n mark.description = def.description;\n }\n return mark;\n}\n\n// create a new DOM element\nfunction domCreate(doc, tag, ns) {\n if (!doc && typeof document !== 'undefined' && document.createElement) {\n doc = document;\n }\n return doc ? ns ? doc.createElementNS(ns, tag) : doc.createElement(tag) : null;\n}\n\n// find first child element with matching tag\nfunction domFind(el, tag) {\n tag = tag.toLowerCase();\n var nodes = el.childNodes,\n i = 0,\n n = nodes.length;\n for (; i < n; ++i) if (nodes[i].tagName.toLowerCase() === tag) {\n return nodes[i];\n }\n}\n\n// retrieve child element at given index\n// create & insert if doesn't exist or if tags do not match\nfunction domChild(el, index, tag, ns) {\n var a = el.childNodes[index],\n b;\n if (!a || a.tagName.toLowerCase() !== tag.toLowerCase()) {\n b = a || null;\n a = domCreate(el.ownerDocument, tag, ns);\n el.insertBefore(a, b);\n }\n return a;\n}\n\n// remove all child elements at or above the given index\nfunction domClear(el, index) {\n var nodes = el.childNodes,\n curr = nodes.length;\n while (curr > index) el.removeChild(nodes[--curr]);\n return el;\n}\n\n// generate css class name for mark\nfunction cssClass(mark) {\n return 'mark-' + mark.marktype + (mark.role ? ' role-' + mark.role : '') + (mark.name ? ' ' + mark.name : '');\n}\n\nfunction point (event, el) {\n const rect = el.getBoundingClientRect();\n return [event.clientX - rect.left - (el.clientLeft || 0), event.clientY - rect.top - (el.clientTop || 0)];\n}\n\nfunction resolveItem (item, event, el, origin) {\n var mark = item && item.mark,\n mdef,\n p;\n if (mark && (mdef = Marks[mark.marktype]).tip) {\n p = point(event, el);\n p[0] -= origin[0];\n p[1] -= origin[1];\n while (item = item.mark.group) {\n p[0] -= item.x || 0;\n p[1] -= item.y || 0;\n }\n item = mdef.tip(mark.items, p);\n }\n return item;\n}\n\n/**\n * Create a new Handler instance.\n * @param {object} [customLoader] - Optional loader instance for\n * href URL sanitization. If not specified, a standard loader\n * instance will be generated.\n * @param {function} [customTooltip] - Optional tooltip handler\n * function for custom tooltip display.\n * @constructor\n */\nfunction Handler(customLoader, customTooltip) {\n this._active = null;\n this._handlers = {};\n this._loader = customLoader || loader();\n this._tooltip = customTooltip || defaultTooltip;\n}\n\n// The default tooltip display handler.\n// Sets the HTML title attribute on the visualization container.\nfunction defaultTooltip(handler, event, item, value) {\n handler.element().setAttribute('title', value || '');\n}\nHandler.prototype = {\n /**\n * Initialize a new Handler instance.\n * @param {DOMElement} el - The containing DOM element for the display.\n * @param {Array} origin - The origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {object} [obj] - Optional context object that should serve as\n * the \"this\" context for event callbacks.\n * @return {Handler} - This handler instance.\n */\n initialize(el, origin, obj) {\n this._el = el;\n this._obj = obj || null;\n return this.origin(origin);\n },\n /**\n * Returns the parent container element for a visualization.\n * @return {DOMElement} - The containing DOM element.\n */\n element() {\n return this._el;\n },\n /**\n * Returns the scene element (e.g., canvas or SVG) of the visualization\n * Subclasses must override if the first child is not the scene element.\n * @return {DOMElement} - The scene (e.g., canvas or SVG) element.\n */\n canvas() {\n return this._el && this._el.firstChild;\n },\n /**\n * Get / set the origin coordinates of the visualization.\n */\n origin(origin) {\n if (arguments.length) {\n this._origin = origin || [0, 0];\n return this;\n } else {\n return this._origin.slice();\n }\n },\n /**\n * Get / set the scenegraph root.\n */\n scene(scene) {\n if (!arguments.length) return this._scene;\n this._scene = scene;\n return this;\n },\n /**\n * Add an event handler. Subclasses should override this method.\n */\n on( /*type, handler*/) {},\n /**\n * Remove an event handler. Subclasses should override this method.\n */\n off( /*type, handler*/) {},\n /**\n * Utility method for finding the array index of an event handler.\n * @param {Array} h - An array of registered event handlers.\n * @param {string} type - The event type.\n * @param {function} handler - The event handler instance to find.\n * @return {number} - The handler's array index or -1 if not registered.\n */\n _handlerIndex(h, type, handler) {\n for (let i = h ? h.length : 0; --i >= 0;) {\n if (h[i].type === type && (!handler || h[i].handler === handler)) {\n return i;\n }\n }\n return -1;\n },\n /**\n * Returns an array with registered event handlers.\n * @param {string} [type] - The event type to query. Any annotations\n * are ignored; for example, for the argument \"click.foo\", \".foo\" will\n * be ignored and the method returns all \"click\" handlers. If type is\n * null or unspecified, this method returns handlers for all types.\n * @return {Array} - A new array containing all registered event handlers.\n */\n handlers(type) {\n const h = this._handlers,\n a = [];\n if (type) {\n a.push(...h[this.eventName(type)]);\n } else {\n for (const k in h) {\n a.push(...h[k]);\n }\n }\n return a;\n },\n /**\n * Parses an event name string to return the specific event type.\n * For example, given \"click.foo\" returns \"click\"\n * @param {string} name - The input event type string.\n * @return {string} - A string with the event type only.\n */\n eventName(name) {\n const i = name.indexOf('.');\n return i < 0 ? name : name.slice(0, i);\n },\n /**\n * Handle hyperlink navigation in response to an item.href value.\n * @param {Event} event - The event triggering hyperlink navigation.\n * @param {Item} item - The scenegraph item.\n * @param {string} href - The URL to navigate to.\n */\n handleHref(event, item, href) {\n this._loader.sanitize(href, {\n context: 'href'\n }).then(opt => {\n const e = new MouseEvent(event.type, event),\n a = domCreate(null, 'a');\n for (const name in opt) a.setAttribute(name, opt[name]);\n a.dispatchEvent(e);\n }).catch(() => {/* do nothing */});\n },\n /**\n * Handle tooltip display in response to an item.tooltip value.\n * @param {Event} event - The event triggering tooltip display.\n * @param {Item} item - The scenegraph item.\n * @param {boolean} show - A boolean flag indicating whether\n * to show or hide a tooltip for the given item.\n */\n handleTooltip(event, item, show) {\n if (item && item.tooltip != null) {\n item = resolveItem(item, event, this.canvas(), this._origin);\n const value = show && item && item.tooltip || null;\n this._tooltip.call(this._obj, this, event, item, value);\n }\n },\n /**\n * Returns the size of a scenegraph item and its position relative\n * to the viewport.\n * @param {Item} item - The scenegraph item.\n * @return {object} - A bounding box object (compatible with the\n * DOMRect type) consisting of x, y, width, heigh, top, left,\n * right, and bottom properties.\n */\n getItemBoundingClientRect(item) {\n const el = this.canvas();\n if (!el) return;\n const rect = el.getBoundingClientRect(),\n origin = this._origin,\n bounds = item.bounds,\n width = bounds.width(),\n height = bounds.height();\n let x = bounds.x1 + origin[0] + rect.left,\n y = bounds.y1 + origin[1] + rect.top;\n\n // translate coordinate for each parent group\n while (item.mark && (item = item.mark.group)) {\n x += item.x || 0;\n y += item.y || 0;\n }\n\n // return DOMRect-compatible bounding box\n return {\n x,\n y,\n width,\n height,\n left: x,\n top: y,\n right: x + width,\n bottom: y + height\n };\n }\n};\n\n/**\n * Create a new Renderer instance.\n * @param {object} [loader] - Optional loader instance for\n * image and href URL sanitization. If not specified, a\n * standard loader instance will be generated.\n * @constructor\n */\nfunction Renderer(loader) {\n this._el = null;\n this._bgcolor = null;\n this._loader = new ResourceLoader(loader);\n}\nRenderer.prototype = {\n /**\n * Initialize a new Renderer instance.\n * @param {DOMElement} el - The containing DOM element for the display.\n * @param {number} width - The coordinate width of the display, in pixels.\n * @param {number} height - The coordinate height of the display, in pixels.\n * @param {Array} origin - The origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {Renderer} - This renderer instance.\n */\n initialize(el, width, height, origin, scaleFactor) {\n this._el = el;\n return this.resize(width, height, origin, scaleFactor);\n },\n /**\n * Returns the parent container element for a visualization.\n * @return {DOMElement} - The containing DOM element.\n */\n element() {\n return this._el;\n },\n /**\n * Returns the scene element (e.g., canvas or SVG) of the visualization\n * Subclasses must override if the first child is not the scene element.\n * @return {DOMElement} - The scene (e.g., canvas or SVG) element.\n */\n canvas() {\n return this._el && this._el.firstChild;\n },\n /**\n * Get / set the background color.\n */\n background(bgcolor) {\n if (arguments.length === 0) return this._bgcolor;\n this._bgcolor = bgcolor;\n return this;\n },\n /**\n * Resize the display.\n * @param {number} width - The new coordinate width of the display, in pixels.\n * @param {number} height - The new coordinate height of the display, in pixels.\n * @param {Array} origin - The new origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {Renderer} - This renderer instance;\n */\n resize(width, height, origin, scaleFactor) {\n this._width = width;\n this._height = height;\n this._origin = origin || [0, 0];\n this._scale = scaleFactor || 1;\n return this;\n },\n /**\n * Report a dirty item whose bounds should be redrawn.\n * This base class method does nothing. Subclasses that perform\n * incremental should implement this method.\n * @param {Item} item - The dirty item whose bounds should be redrawn.\n */\n dirty( /*item*/) {},\n /**\n * Render an input scenegraph, potentially with a set of dirty items.\n * This method will perform an immediate rendering with available resources.\n * The renderer may also need to perform image loading to perform a complete\n * render. This process can lead to asynchronous re-rendering of the scene\n * after this method returns. To receive notification when rendering is\n * complete, use the renderAsync method instead.\n * @param {object} scene - The root mark of a scenegraph to render.\n * @return {Renderer} - This renderer instance.\n */\n render(scene) {\n const r = this;\n\n // bind arguments into a render call, and cache it\n // this function may be subsequently called for async redraw\n r._call = function () {\n r._render(scene);\n };\n\n // invoke the renderer\n r._call();\n\n // clear the cached call for garbage collection\n // async redraws will stash their own copy\n r._call = null;\n return r;\n },\n /**\n * Internal rendering method. Renderer subclasses should override this\n * method to actually perform rendering.\n * @param {object} scene - The root mark of a scenegraph to render.\n */\n _render( /*scene*/\n ) {\n // subclasses to override\n },\n /**\n * Asynchronous rendering method. Similar to render, but returns a Promise\n * that resolves when all rendering is completed. Sometimes a renderer must\n * perform image loading to get a complete rendering. The returned\n * Promise will not resolve until this process completes.\n * @param {object} scene - The root mark of a scenegraph to render.\n * @return {Promise} - A Promise that resolves when rendering is complete.\n */\n renderAsync(scene) {\n const r = this.render(scene);\n return this._ready ? this._ready.then(() => r) : Promise.resolve(r);\n },\n /**\n * Internal method for asynchronous resource loading.\n * Proxies method calls to the ImageLoader, and tracks loading\n * progress to invoke a re-render once complete.\n * @param {string} method - The method name to invoke on the ImageLoader.\n * @param {string} uri - The URI for the requested resource.\n * @return {Promise} - A Promise that resolves to the requested resource.\n */\n _load(method, uri) {\n var r = this,\n p = r._loader[method](uri);\n if (!r._ready) {\n // re-render the scene when loading completes\n const call = r._call;\n r._ready = r._loader.ready().then(redraw => {\n if (redraw) call();\n r._ready = null;\n });\n }\n return p;\n },\n /**\n * Sanitize a URL to include as a hyperlink in the rendered scene.\n * This method proxies a call to ImageLoader.sanitizeURL, but also tracks\n * image loading progress and invokes a re-render once complete.\n * @param {string} uri - The URI string to sanitize.\n * @return {Promise} - A Promise that resolves to the sanitized URL.\n */\n sanitizeURL(uri) {\n return this._load('sanitizeURL', uri);\n },\n /**\n * Requests an image to include in the rendered scene.\n * This method proxies a call to ImageLoader.loadImage, but also tracks\n * image loading progress and invokes a re-render once complete.\n * @param {string} uri - The URI string of the image.\n * @return {Promise} - A Promise that resolves to the loaded Image.\n */\n loadImage(uri) {\n return this._load('loadImage', uri);\n }\n};\n\nconst KeyDownEvent = 'keydown';\nconst KeyPressEvent = 'keypress';\nconst KeyUpEvent = 'keyup';\nconst DragEnterEvent = 'dragenter';\nconst DragLeaveEvent = 'dragleave';\nconst DragOverEvent = 'dragover';\nconst MouseDownEvent = 'mousedown';\nconst MouseUpEvent = 'mouseup';\nconst MouseMoveEvent = 'mousemove';\nconst MouseOutEvent = 'mouseout';\nconst MouseOverEvent = 'mouseover';\nconst ClickEvent = 'click';\nconst DoubleClickEvent = 'dblclick';\nconst WheelEvent = 'wheel';\nconst MouseWheelEvent = 'mousewheel';\nconst TouchStartEvent = 'touchstart';\nconst TouchMoveEvent = 'touchmove';\nconst TouchEndEvent = 'touchend';\nconst Events = [KeyDownEvent, KeyPressEvent, KeyUpEvent, DragEnterEvent, DragLeaveEvent, DragOverEvent, MouseDownEvent, MouseUpEvent, MouseMoveEvent, MouseOutEvent, MouseOverEvent, ClickEvent, DoubleClickEvent, WheelEvent, MouseWheelEvent, TouchStartEvent, TouchMoveEvent, TouchEndEvent];\nconst TooltipShowEvent = MouseMoveEvent;\nconst TooltipHideEvent = MouseOutEvent;\nconst HrefEvent = ClickEvent;\n\nfunction CanvasHandler(loader, tooltip) {\n Handler.call(this, loader, tooltip);\n this._down = null;\n this._touch = null;\n this._first = true;\n this._events = {};\n}\nconst eventBundle = type => type === TouchStartEvent || type === TouchMoveEvent || type === TouchEndEvent ? [TouchStartEvent, TouchMoveEvent, TouchEndEvent] : [type];\n\n// lazily add listeners to the canvas as needed\nfunction eventListenerCheck(handler, type) {\n eventBundle(type).forEach(_ => addEventListener(handler, _));\n}\nfunction addEventListener(handler, type) {\n const canvas = handler.canvas();\n if (canvas && !handler._events[type]) {\n handler._events[type] = 1;\n canvas.addEventListener(type, handler[type] ? evt => handler[type](evt) : evt => handler.fire(type, evt));\n }\n}\nfunction move(moveEvent, overEvent, outEvent) {\n return function (evt) {\n const a = this._active,\n p = this.pickEvent(evt);\n if (p === a) {\n // active item and picked item are the same\n this.fire(moveEvent, evt); // fire move\n } else {\n // active item and picked item are different\n if (!a || !a.exit) {\n // fire out for prior active item\n // suppress if active item was removed from scene\n this.fire(outEvent, evt);\n }\n this._active = p; // set new active item\n this.fire(overEvent, evt); // fire over for new active item\n this.fire(moveEvent, evt); // fire move for new active item\n }\n };\n}\n\nfunction inactive(type) {\n return function (evt) {\n this.fire(type, evt);\n this._active = null;\n };\n}\ninherits(CanvasHandler, Handler, {\n initialize(el, origin, obj) {\n this._canvas = el && domFind(el, 'canvas');\n\n // add minimal events required for proper state management\n [ClickEvent, MouseDownEvent, MouseMoveEvent, MouseOutEvent, DragLeaveEvent].forEach(type => eventListenerCheck(this, type));\n return Handler.prototype.initialize.call(this, el, origin, obj);\n },\n // return the backing canvas instance\n canvas() {\n return this._canvas;\n },\n // retrieve the current canvas context\n context() {\n return this._canvas.getContext('2d');\n },\n // supported events\n events: Events,\n // to keep old versions of firefox happy\n DOMMouseScroll(evt) {\n this.fire(MouseWheelEvent, evt);\n },\n mousemove: move(MouseMoveEvent, MouseOverEvent, MouseOutEvent),\n dragover: move(DragOverEvent, DragEnterEvent, DragLeaveEvent),\n mouseout: inactive(MouseOutEvent),\n dragleave: inactive(DragLeaveEvent),\n mousedown(evt) {\n this._down = this._active;\n this.fire(MouseDownEvent, evt);\n },\n click(evt) {\n if (this._down === this._active) {\n this.fire(ClickEvent, evt);\n this._down = null;\n }\n },\n touchstart(evt) {\n this._touch = this.pickEvent(evt.changedTouches[0]);\n if (this._first) {\n this._active = this._touch;\n this._first = false;\n }\n this.fire(TouchStartEvent, evt, true);\n },\n touchmove(evt) {\n this.fire(TouchMoveEvent, evt, true);\n },\n touchend(evt) {\n this.fire(TouchEndEvent, evt, true);\n this._touch = null;\n },\n // fire an event\n fire(type, evt, touch) {\n const a = touch ? this._touch : this._active,\n h = this._handlers[type];\n\n // set event type relative to scenegraph items\n evt.vegaType = type;\n\n // handle hyperlinks and tooltips first\n if (type === HrefEvent && a && a.href) {\n this.handleHref(evt, a, a.href);\n } else if (type === TooltipShowEvent || type === TooltipHideEvent) {\n this.handleTooltip(evt, a, type !== TooltipHideEvent);\n }\n\n // invoke all registered handlers\n if (h) {\n for (let i = 0, len = h.length; i < len; ++i) {\n h[i].handler.call(this._obj, evt, a);\n }\n }\n },\n // add an event handler\n on(type, handler) {\n const name = this.eventName(type),\n h = this._handlers,\n i = this._handlerIndex(h[name], type, handler);\n if (i < 0) {\n eventListenerCheck(this, type);\n (h[name] || (h[name] = [])).push({\n type: type,\n handler: handler\n });\n }\n return this;\n },\n // remove an event handler\n off(type, handler) {\n const name = this.eventName(type),\n h = this._handlers[name],\n i = this._handlerIndex(h, type, handler);\n if (i >= 0) {\n h.splice(i, 1);\n }\n return this;\n },\n pickEvent(evt) {\n const p = point(evt, this._canvas),\n o = this._origin;\n return this.pick(this._scene, p[0], p[1], p[0] - o[0], p[1] - o[1]);\n },\n // find the scenegraph item at the current mouse position\n // x, y -- the absolute x, y mouse coordinates on the canvas element\n // gx, gy -- the relative coordinates within the current group\n pick(scene, x, y, gx, gy) {\n const g = this.context(),\n mark = Marks[scene.marktype];\n return mark.pick.call(this, g, scene, x, y, gx, gy);\n }\n});\n\nfunction devicePixelRatio() {\n return typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1;\n}\nvar pixelRatio = devicePixelRatio();\nfunction resize (canvas, width, height, origin, scaleFactor, opt) {\n const inDOM = typeof HTMLElement !== 'undefined' && canvas instanceof HTMLElement && canvas.parentNode != null,\n context = canvas.getContext('2d'),\n ratio = inDOM ? pixelRatio : scaleFactor;\n canvas.width = width * ratio;\n canvas.height = height * ratio;\n for (const key in opt) {\n context[key] = opt[key];\n }\n if (inDOM && ratio !== 1) {\n canvas.style.width = width + 'px';\n canvas.style.height = height + 'px';\n }\n context.pixelRatio = ratio;\n context.setTransform(ratio, 0, 0, ratio, ratio * origin[0], ratio * origin[1]);\n return canvas;\n}\n\nfunction CanvasRenderer(loader) {\n Renderer.call(this, loader);\n this._options = {};\n this._redraw = false;\n this._dirty = new Bounds();\n this._tempb = new Bounds();\n}\nconst base$1 = Renderer.prototype;\nconst viewBounds = (origin, width, height) => new Bounds().set(0, 0, width, height).translate(-origin[0], -origin[1]);\nfunction clipToBounds(g, b, origin) {\n // expand bounds by 1 pixel, then round to pixel boundaries\n b.expand(1).round();\n\n // align to base pixel grid in case of non-integer scaling (#2425)\n if (g.pixelRatio % 1) {\n b.scale(g.pixelRatio).round().scale(1 / g.pixelRatio);\n }\n\n // to avoid artifacts translate if origin has fractional pixels\n b.translate(-(origin[0] % 1), -(origin[1] % 1));\n\n // set clip path\n g.beginPath();\n g.rect(b.x1, b.y1, b.width(), b.height());\n g.clip();\n return b;\n}\ninherits(CanvasRenderer, Renderer, {\n initialize(el, width, height, origin, scaleFactor, options) {\n this._options = options || {};\n this._canvas = this._options.externalContext ? null : canvas(1, 1, this._options.type); // instantiate a small canvas\n\n if (el && this._canvas) {\n domClear(el, 0).appendChild(this._canvas);\n this._canvas.setAttribute('class', 'marks');\n }\n\n // this method will invoke resize to size the canvas appropriately\n return base$1.initialize.call(this, el, width, height, origin, scaleFactor);\n },\n resize(width, height, origin, scaleFactor) {\n base$1.resize.call(this, width, height, origin, scaleFactor);\n if (this._canvas) {\n // configure canvas size and transform\n resize(this._canvas, this._width, this._height, this._origin, this._scale, this._options.context);\n } else {\n // external context needs to be scaled and positioned to origin\n const ctx = this._options.externalContext;\n if (!ctx) error('CanvasRenderer is missing a valid canvas or context');\n ctx.scale(this._scale, this._scale);\n ctx.translate(this._origin[0], this._origin[1]);\n }\n this._redraw = true;\n return this;\n },\n canvas() {\n return this._canvas;\n },\n context() {\n return this._options.externalContext || (this._canvas ? this._canvas.getContext('2d') : null);\n },\n dirty(item) {\n const b = this._tempb.clear().union(item.bounds);\n let g = item.mark.group;\n while (g) {\n b.translate(g.x || 0, g.y || 0);\n g = g.mark.group;\n }\n this._dirty.union(b);\n },\n _render(scene) {\n const g = this.context(),\n o = this._origin,\n w = this._width,\n h = this._height,\n db = this._dirty,\n vb = viewBounds(o, w, h);\n\n // setup\n g.save();\n const b = this._redraw || db.empty() ? (this._redraw = false, vb.expand(1)) : clipToBounds(g, vb.intersect(db), o);\n this.clear(-o[0], -o[1], w, h);\n\n // render\n this.draw(g, scene, b);\n\n // takedown\n g.restore();\n db.clear();\n return this;\n },\n draw(ctx, scene, bounds) {\n const mark = Marks[scene.marktype];\n if (scene.clip) clip(ctx, scene);\n mark.draw.call(this, ctx, scene, bounds);\n if (scene.clip) ctx.restore();\n },\n clear(x, y, w, h) {\n const opt = this._options,\n g = this.context();\n if (opt.type !== 'pdf' && !opt.externalContext) {\n // calling clear rect voids vector output in pdf mode\n // and could remove external context content (#2615)\n g.clearRect(x, y, w, h);\n }\n if (this._bgcolor != null) {\n g.fillStyle = this._bgcolor;\n g.fillRect(x, y, w, h);\n }\n }\n});\n\nfunction SVGHandler(loader, tooltip) {\n Handler.call(this, loader, tooltip);\n const h = this;\n h._hrefHandler = listener(h, (evt, item) => {\n if (item && item.href) h.handleHref(evt, item, item.href);\n });\n h._tooltipHandler = listener(h, (evt, item) => {\n h.handleTooltip(evt, item, evt.type !== TooltipHideEvent);\n });\n}\n\n// wrap an event listener for the SVG DOM\nconst listener = (context, handler) => evt => {\n let item = evt.target.__data__;\n item = Array.isArray(item) ? item[0] : item;\n evt.vegaType = evt.type;\n handler.call(context._obj, evt, item);\n};\ninherits(SVGHandler, Handler, {\n initialize(el, origin, obj) {\n let svg = this._svg;\n if (svg) {\n svg.removeEventListener(HrefEvent, this._hrefHandler);\n svg.removeEventListener(TooltipShowEvent, this._tooltipHandler);\n svg.removeEventListener(TooltipHideEvent, this._tooltipHandler);\n }\n this._svg = svg = el && domFind(el, 'svg');\n if (svg) {\n svg.addEventListener(HrefEvent, this._hrefHandler);\n svg.addEventListener(TooltipShowEvent, this._tooltipHandler);\n svg.addEventListener(TooltipHideEvent, this._tooltipHandler);\n }\n return Handler.prototype.initialize.call(this, el, origin, obj);\n },\n canvas() {\n return this._svg;\n },\n // add an event handler\n on(type, handler) {\n const name = this.eventName(type),\n h = this._handlers,\n i = this._handlerIndex(h[name], type, handler);\n if (i < 0) {\n const x = {\n type,\n handler,\n listener: listener(this, handler)\n };\n (h[name] || (h[name] = [])).push(x);\n if (this._svg) {\n this._svg.addEventListener(name, x.listener);\n }\n }\n return this;\n },\n // remove an event handler\n off(type, handler) {\n const name = this.eventName(type),\n h = this._handlers[name],\n i = this._handlerIndex(h, type, handler);\n if (i >= 0) {\n if (this._svg) {\n this._svg.removeEventListener(name, h[i].listener);\n }\n h.splice(i, 1);\n }\n return this;\n }\n});\n\nconst ARIA_HIDDEN = 'aria-hidden';\nconst ARIA_LABEL = 'aria-label';\nconst ARIA_ROLE = 'role';\nconst ARIA_ROLEDESCRIPTION = 'aria-roledescription';\nconst GRAPHICS_OBJECT = 'graphics-object';\nconst GRAPHICS_SYMBOL = 'graphics-symbol';\nconst bundle = (role, roledesc, label) => ({\n [ARIA_ROLE]: role,\n [ARIA_ROLEDESCRIPTION]: roledesc,\n [ARIA_LABEL]: label || undefined\n});\n\n// these roles are covered by related roles\n// we can ignore them, no need to generate attributes\nconst AriaIgnore = toSet(['axis-domain', 'axis-grid', 'axis-label', 'axis-tick', 'axis-title', 'legend-band', 'legend-entry', 'legend-gradient', 'legend-label', 'legend-title', 'legend-symbol', 'title']);\n\n// aria attribute generators for guide roles\nconst AriaGuides = {\n 'axis': {\n desc: 'axis',\n caption: axisCaption\n },\n 'legend': {\n desc: 'legend',\n caption: legendCaption\n },\n 'title-text': {\n desc: 'title',\n caption: item => `Title text '${titleCaption(item)}'`\n },\n 'title-subtitle': {\n desc: 'subtitle',\n caption: item => `Subtitle text '${titleCaption(item)}'`\n }\n};\n\n// aria properties generated for mark item encoding channels\nconst AriaEncode = {\n ariaRole: ARIA_ROLE,\n ariaRoleDescription: ARIA_ROLEDESCRIPTION,\n description: ARIA_LABEL\n};\nfunction ariaItemAttributes(emit, item) {\n const hide = item.aria === false;\n emit(ARIA_HIDDEN, hide || undefined);\n if (hide || item.description == null) {\n for (const prop in AriaEncode) {\n emit(AriaEncode[prop], undefined);\n }\n } else {\n const type = item.mark.marktype;\n emit(ARIA_LABEL, item.description);\n emit(ARIA_ROLE, item.ariaRole || (type === 'group' ? GRAPHICS_OBJECT : GRAPHICS_SYMBOL));\n emit(ARIA_ROLEDESCRIPTION, item.ariaRoleDescription || `${type} mark`);\n }\n}\nfunction ariaMarkAttributes(mark) {\n return mark.aria === false ? {\n [ARIA_HIDDEN]: true\n } : AriaIgnore[mark.role] ? null : AriaGuides[mark.role] ? ariaGuide(mark, AriaGuides[mark.role]) : ariaMark(mark);\n}\nfunction ariaMark(mark) {\n const type = mark.marktype;\n const recurse = type === 'group' || type === 'text' || mark.items.some(_ => _.description != null && _.aria !== false);\n return bundle(recurse ? GRAPHICS_OBJECT : GRAPHICS_SYMBOL, `${type} mark container`, mark.description);\n}\nfunction ariaGuide(mark, opt) {\n try {\n const item = mark.items[0],\n caption = opt.caption || (() => '');\n return bundle(opt.role || GRAPHICS_SYMBOL, opt.desc, item.description || caption(item));\n } catch (err) {\n return null;\n }\n}\nfunction titleCaption(item) {\n return array(item.text).join(' ');\n}\nfunction axisCaption(item) {\n const datum = item.datum,\n orient = item.orient,\n title = datum.title ? extractTitle(item) : null,\n ctx = item.context,\n scale = ctx.scales[datum.scale].value,\n locale = ctx.dataflow.locale(),\n type = scale.type,\n xy = orient === 'left' || orient === 'right' ? 'Y' : 'X';\n return `${xy}-axis` + (title ? ` titled '${title}'` : '') + ` for a ${isDiscrete(type) ? 'discrete' : type} scale` + ` with ${domainCaption(locale, scale, item)}`;\n}\nfunction legendCaption(item) {\n const datum = item.datum,\n title = datum.title ? extractTitle(item) : null,\n type = `${datum.type || ''} legend`.trim(),\n scales = datum.scales,\n props = Object.keys(scales),\n ctx = item.context,\n scale = ctx.scales[scales[props[0]]].value,\n locale = ctx.dataflow.locale();\n return capitalize(type) + (title ? ` titled '${title}'` : '') + ` for ${channelCaption(props)}` + ` with ${domainCaption(locale, scale, item)}`;\n}\nfunction extractTitle(item) {\n try {\n return array(peek(item.items).items[0].text).join(' ');\n } catch (err) {\n return null;\n }\n}\nfunction channelCaption(props) {\n props = props.map(p => p + (p === 'fill' || p === 'stroke' ? ' color' : ''));\n return props.length < 2 ? props[0] : props.slice(0, -1).join(', ') + ' and ' + peek(props);\n}\nfunction capitalize(s) {\n return s.length ? s[0].toUpperCase() + s.slice(1) : s;\n}\n\nconst innerText = val => (val + '').replace(/&/g, '&').replace(//g, '>');\nconst attrText = val => innerText(val).replace(/\"/g, '"').replace(/\\t/g, ' ').replace(/\\n/g, ' ').replace(/\\r/g, ' ');\nfunction markup() {\n let buf = '',\n outer = '',\n inner = '';\n const stack = [],\n clear = () => outer = inner = '',\n push = tag => {\n if (outer) {\n buf += `${outer}>${inner}`;\n clear();\n }\n stack.push(tag);\n },\n attr = (name, value) => {\n if (value != null) outer += ` ${name}=\"${attrText(value)}\"`;\n return m;\n },\n m = {\n open(tag) {\n push(tag);\n outer = '<' + tag;\n for (var _len = arguments.length, attrs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n attrs[_key - 1] = arguments[_key];\n }\n for (const set of attrs) {\n for (const key in set) attr(key, set[key]);\n }\n return m;\n },\n close() {\n const tag = stack.pop();\n if (outer) {\n buf += outer + (inner ? `>${inner}` : '/>');\n } else {\n buf += ``;\n }\n clear();\n return m;\n },\n attr,\n text: t => (inner += innerText(t), m),\n toString: () => buf\n };\n return m;\n}\nconst serializeXML = node => _serialize(markup(), node) + '';\nfunction _serialize(m, node) {\n m.open(node.tagName);\n if (node.hasAttributes()) {\n const attrs = node.attributes,\n n = attrs.length;\n for (let i = 0; i < n; ++i) {\n m.attr(attrs[i].name, attrs[i].value);\n }\n }\n if (node.hasChildNodes()) {\n const children = node.childNodes;\n for (const child of children) {\n child.nodeType === 3 // text node\n ? m.text(child.nodeValue) : _serialize(m, child);\n }\n }\n return m.close();\n}\n\nconst stylesAttr = {\n fill: 'fill',\n fillOpacity: 'fill-opacity',\n stroke: 'stroke',\n strokeOpacity: 'stroke-opacity',\n strokeWidth: 'stroke-width',\n strokeCap: 'stroke-linecap',\n strokeJoin: 'stroke-linejoin',\n strokeDash: 'stroke-dasharray',\n strokeDashOffset: 'stroke-dashoffset',\n strokeMiterLimit: 'stroke-miterlimit',\n opacity: 'opacity'\n};\nconst stylesCss = {\n blend: 'mix-blend-mode'\n};\n\n// ensure miter limit default is consistent with canvas (#2498)\nconst rootAttributes = {\n 'fill': 'none',\n 'stroke-miterlimit': 10\n};\n\nconst RootIndex = 0,\n xmlns = 'http://www.w3.org/2000/xmlns/',\n svgns = metadata.xmlns;\nfunction SVGRenderer(loader) {\n Renderer.call(this, loader);\n this._dirtyID = 0;\n this._dirty = [];\n this._svg = null;\n this._root = null;\n this._defs = null;\n}\nconst base = Renderer.prototype;\ninherits(SVGRenderer, Renderer, {\n /**\n * Initialize a new SVGRenderer instance.\n * @param {DOMElement} el - The containing DOM element for the display.\n * @param {number} width - The coordinate width of the display, in pixels.\n * @param {number} height - The coordinate height of the display, in pixels.\n * @param {Array} origin - The origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {SVGRenderer} - This renderer instance.\n */\n initialize(el, width, height, origin, scaleFactor) {\n // create the svg definitions cache\n this._defs = {};\n this._clearDefs();\n if (el) {\n this._svg = domChild(el, 0, 'svg', svgns);\n this._svg.setAttributeNS(xmlns, 'xmlns', svgns);\n this._svg.setAttributeNS(xmlns, 'xmlns:xlink', metadata['xmlns:xlink']);\n this._svg.setAttribute('version', metadata['version']);\n this._svg.setAttribute('class', 'marks');\n domClear(el, 1);\n\n // set the svg root group\n this._root = domChild(this._svg, RootIndex, 'g', svgns);\n setAttributes(this._root, rootAttributes);\n\n // ensure no additional child elements\n domClear(this._svg, RootIndex + 1);\n }\n\n // set background color if defined\n this.background(this._bgcolor);\n return base.initialize.call(this, el, width, height, origin, scaleFactor);\n },\n /**\n * Get / set the background color.\n */\n background(bgcolor) {\n if (arguments.length && this._svg) {\n this._svg.style.setProperty('background-color', bgcolor);\n }\n return base.background.apply(this, arguments);\n },\n /**\n * Resize the display.\n * @param {number} width - The new coordinate width of the display, in pixels.\n * @param {number} height - The new coordinate height of the display, in pixels.\n * @param {Array} origin - The new origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {SVGRenderer} - This renderer instance;\n */\n resize(width, height, origin, scaleFactor) {\n base.resize.call(this, width, height, origin, scaleFactor);\n if (this._svg) {\n setAttributes(this._svg, {\n width: this._width * this._scale,\n height: this._height * this._scale,\n viewBox: `0 0 ${this._width} ${this._height}`\n });\n this._root.setAttribute('transform', `translate(${this._origin})`);\n }\n this._dirty = [];\n return this;\n },\n /**\n * Returns the SVG element of the visualization.\n * @return {DOMElement} - The SVG element.\n */\n canvas() {\n return this._svg;\n },\n /**\n * Returns an SVG text string for the rendered content,\n * or null if this renderer is currently headless.\n */\n svg() {\n const svg = this._svg,\n bg = this._bgcolor;\n if (!svg) return null;\n let node;\n if (bg) {\n svg.removeAttribute('style');\n node = domChild(svg, RootIndex, 'rect', svgns);\n setAttributes(node, {\n width: this._width,\n height: this._height,\n fill: bg\n });\n }\n const text = serializeXML(svg);\n if (bg) {\n svg.removeChild(node);\n this._svg.style.setProperty('background-color', bg);\n }\n return text;\n },\n /**\n * Internal rendering method.\n * @param {object} scene - The root mark of a scenegraph to render.\n */\n _render(scene) {\n // perform spot updates and re-render markup\n if (this._dirtyCheck()) {\n if (this._dirtyAll) this._clearDefs();\n this.mark(this._root, scene);\n domClear(this._root, 1);\n }\n this.defs();\n this._dirty = [];\n ++this._dirtyID;\n return this;\n },\n // -- Manage rendering of items marked as dirty --\n\n /**\n * Flag a mark item as dirty.\n * @param {Item} item - The mark item.\n */\n dirty(item) {\n if (item.dirty !== this._dirtyID) {\n item.dirty = this._dirtyID;\n this._dirty.push(item);\n }\n },\n /**\n * Check if a mark item is considered dirty.\n * @param {Item} item - The mark item.\n */\n isDirty(item) {\n return this._dirtyAll || !item._svg || !item._svg.ownerSVGElement || item.dirty === this._dirtyID;\n },\n /**\n * Internal method to check dirty status and, if possible,\n * make targetted updates without a full rendering pass.\n */\n _dirtyCheck() {\n this._dirtyAll = true;\n const items = this._dirty;\n if (!items.length || !this._dirtyID) return true;\n const id = ++this._dirtyID;\n let item, mark, type, mdef, i, n, o;\n for (i = 0, n = items.length; i < n; ++i) {\n item = items[i];\n mark = item.mark;\n if (mark.marktype !== type) {\n // memoize mark instance lookup\n type = mark.marktype;\n mdef = Marks[type];\n }\n if (mark.zdirty && mark.dirty !== id) {\n this._dirtyAll = false;\n dirtyParents(item, id);\n mark.items.forEach(i => {\n i.dirty = id;\n });\n }\n if (mark.zdirty) continue; // handle in standard drawing pass\n\n if (item.exit) {\n // EXIT\n if (mdef.nested && mark.items.length) {\n // if nested mark with remaining points, update instead\n o = mark.items[0];\n if (o._svg) this._update(mdef, o._svg, o);\n } else if (item._svg) {\n // otherwise remove from DOM\n o = item._svg.parentNode;\n if (o) o.removeChild(item._svg);\n }\n item._svg = null;\n continue;\n }\n item = mdef.nested ? mark.items[0] : item;\n if (item._update === id) continue; // already visited\n\n if (!item._svg || !item._svg.ownerSVGElement) {\n // ENTER\n this._dirtyAll = false;\n dirtyParents(item, id);\n } else {\n // IN-PLACE UPDATE\n this._update(mdef, item._svg, item);\n }\n item._update = id;\n }\n return !this._dirtyAll;\n },\n // -- Construct & maintain scenegraph to SVG mapping ---\n\n /**\n * Render a set of mark items.\n * @param {SVGElement} el - The parent element in the SVG tree.\n * @param {object} scene - The mark parent to render.\n * @param {SVGElement} prev - The previous sibling in the SVG tree.\n */\n mark(el, scene, prev) {\n if (!this.isDirty(scene)) {\n return scene._svg;\n }\n const svg = this._svg,\n mdef = Marks[scene.marktype],\n events = scene.interactive === false ? 'none' : null,\n isGroup = mdef.tag === 'g';\n const parent = bind(scene, el, prev, 'g', svg);\n parent.setAttribute('class', cssClass(scene));\n\n // apply aria attributes to parent container element\n const aria = ariaMarkAttributes(scene);\n for (const key in aria) setAttribute(parent, key, aria[key]);\n if (!isGroup) {\n setAttribute(parent, 'pointer-events', events);\n }\n setAttribute(parent, 'clip-path', scene.clip ? clip$1(this, scene, scene.group) : null);\n let sibling = null,\n i = 0;\n const process = item => {\n const dirty = this.isDirty(item),\n node = bind(item, parent, sibling, mdef.tag, svg);\n if (dirty) {\n this._update(mdef, node, item);\n if (isGroup) recurse(this, node, item);\n }\n sibling = node;\n ++i;\n };\n if (mdef.nested) {\n if (scene.items.length) process(scene.items[0]);\n } else {\n visit(scene, process);\n }\n domClear(parent, i);\n return parent;\n },\n /**\n * Update the attributes of an SVG element for a mark item.\n * @param {object} mdef - The mark definition object\n * @param {SVGElement} el - The SVG element.\n * @param {Item} item - The mark item.\n */\n _update(mdef, el, item) {\n // set dom element and values cache\n // provides access to emit method\n element = el;\n values = el.__values__;\n\n // apply aria-specific properties\n ariaItemAttributes(emit, item);\n\n // apply svg attributes\n mdef.attr(emit, item, this);\n\n // some marks need special treatment\n const extra = mark_extras[mdef.type];\n if (extra) extra.call(this, mdef, el, item);\n\n // apply svg style attributes\n // note: element state may have been modified by 'extra' method\n if (element) this.style(element, item);\n },\n /**\n * Update the presentation attributes of an SVG element for a mark item.\n * @param {SVGElement} el - The SVG element.\n * @param {Item} item - The mark item.\n */\n style(el, item) {\n if (item == null) return;\n for (const prop in stylesAttr) {\n let value = prop === 'font' ? fontFamily(item) : item[prop];\n if (value === values[prop]) continue;\n const name = stylesAttr[prop];\n if (value == null) {\n el.removeAttribute(name);\n } else {\n if (isGradient(value)) {\n value = gradientRef(value, this._defs.gradient, href());\n }\n el.setAttribute(name, value + '');\n }\n values[prop] = value;\n }\n for (const prop in stylesCss) {\n setStyle(el, stylesCss[prop], item[prop]);\n }\n },\n /**\n * Render SVG defs, as needed.\n * Must be called *after* marks have been processed to ensure the\n * collected state is current and accurate.\n */\n defs() {\n const svg = this._svg,\n defs = this._defs;\n let el = defs.el,\n index = 0;\n for (const id in defs.gradient) {\n if (!el) defs.el = el = domChild(svg, RootIndex + 1, 'defs', svgns);\n index = updateGradient(el, defs.gradient[id], index);\n }\n for (const id in defs.clipping) {\n if (!el) defs.el = el = domChild(svg, RootIndex + 1, 'defs', svgns);\n index = updateClipping(el, defs.clipping[id], index);\n }\n\n // clean-up\n if (el) {\n index === 0 ? (svg.removeChild(el), defs.el = null) : domClear(el, index);\n }\n },\n /**\n * Clear defs caches.\n */\n _clearDefs() {\n const def = this._defs;\n def.gradient = {};\n def.clipping = {};\n }\n});\n\n// mark ancestor chain with a dirty id\nfunction dirtyParents(item, id) {\n for (; item && item.dirty !== id; item = item.mark.group) {\n item.dirty = id;\n if (item.mark && item.mark.dirty !== id) {\n item.mark.dirty = id;\n } else return;\n }\n}\n\n// update gradient definitions\nfunction updateGradient(el, grad, index) {\n let i, n, stop;\n if (grad.gradient === 'radial') {\n // SVG radial gradients automatically transform to normalized bbox\n // coordinates, in a way that is cumbersome to replicate in canvas.\n // We wrap the radial gradient in a pattern element, allowing us to\n // maintain a circular gradient that matches what canvas provides.\n let pt = domChild(el, index++, 'pattern', svgns);\n setAttributes(pt, {\n id: patternPrefix + grad.id,\n viewBox: '0,0,1,1',\n width: '100%',\n height: '100%',\n preserveAspectRatio: 'xMidYMid slice'\n });\n pt = domChild(pt, 0, 'rect', svgns);\n setAttributes(pt, {\n width: 1,\n height: 1,\n fill: `url(${href()}#${grad.id})`\n });\n el = domChild(el, index++, 'radialGradient', svgns);\n setAttributes(el, {\n id: grad.id,\n fx: grad.x1,\n fy: grad.y1,\n fr: grad.r1,\n cx: grad.x2,\n cy: grad.y2,\n r: grad.r2\n });\n } else {\n el = domChild(el, index++, 'linearGradient', svgns);\n setAttributes(el, {\n id: grad.id,\n x1: grad.x1,\n x2: grad.x2,\n y1: grad.y1,\n y2: grad.y2\n });\n }\n for (i = 0, n = grad.stops.length; i < n; ++i) {\n stop = domChild(el, i, 'stop', svgns);\n stop.setAttribute('offset', grad.stops[i].offset);\n stop.setAttribute('stop-color', grad.stops[i].color);\n }\n domClear(el, i);\n return index;\n}\n\n// update clipping path definitions\nfunction updateClipping(el, clip, index) {\n let mask;\n el = domChild(el, index, 'clipPath', svgns);\n el.setAttribute('id', clip.id);\n if (clip.path) {\n mask = domChild(el, 0, 'path', svgns);\n mask.setAttribute('d', clip.path);\n } else {\n mask = domChild(el, 0, 'rect', svgns);\n setAttributes(mask, {\n x: 0,\n y: 0,\n width: clip.width,\n height: clip.height\n });\n }\n domClear(el, 1);\n return index + 1;\n}\n\n// Recursively process group contents.\nfunction recurse(renderer, el, group) {\n // child 'g' element is second to last among children (path, g, path)\n // other children here are foreground and background path elements\n el = el.lastChild.previousSibling;\n let prev,\n idx = 0;\n visit(group, item => {\n prev = renderer.mark(el, item, prev);\n ++idx;\n });\n\n // remove any extraneous DOM elements\n domClear(el, 1 + idx);\n}\n\n// Bind a scenegraph item to an SVG DOM element.\n// Create new SVG elements as needed.\nfunction bind(item, el, sibling, tag, svg) {\n let node = item._svg,\n doc;\n\n // create a new dom node if needed\n if (!node) {\n doc = el.ownerDocument;\n node = domCreate(doc, tag, svgns);\n item._svg = node;\n if (item.mark) {\n node.__data__ = item;\n node.__values__ = {\n fill: 'default'\n };\n\n // if group, create background, content, and foreground elements\n if (tag === 'g') {\n const bg = domCreate(doc, 'path', svgns);\n node.appendChild(bg);\n bg.__data__ = item;\n const cg = domCreate(doc, 'g', svgns);\n node.appendChild(cg);\n cg.__data__ = item;\n const fg = domCreate(doc, 'path', svgns);\n node.appendChild(fg);\n fg.__data__ = item;\n fg.__values__ = {\n fill: 'default'\n };\n }\n }\n }\n\n // (re-)insert if (a) not contained in SVG or (b) sibling order has changed\n if (node.ownerSVGElement !== svg || siblingCheck(node, sibling)) {\n el.insertBefore(node, sibling ? sibling.nextSibling : el.firstChild);\n }\n return node;\n}\n\n// check if two nodes are ordered siblings\nfunction siblingCheck(node, sibling) {\n return node.parentNode && node.parentNode.childNodes.length > 1 && node.previousSibling != sibling; // treat null/undefined the same\n}\n\n// -- Set attributes & styles on SVG elements ---\n\nlet element = null,\n // temp var for current SVG element\n values = null; // temp var for current values hash\n\n// Extra configuration for certain mark types\nconst mark_extras = {\n group(mdef, el, item) {\n const fg = element = el.childNodes[2];\n values = fg.__values__;\n mdef.foreground(emit, item, this);\n values = el.__values__; // use parent's values hash\n element = el.childNodes[1];\n mdef.content(emit, item, this);\n const bg = element = el.childNodes[0];\n mdef.background(emit, item, this);\n const value = item.mark.interactive === false ? 'none' : null;\n if (value !== values.events) {\n setAttribute(fg, 'pointer-events', value);\n setAttribute(bg, 'pointer-events', value);\n values.events = value;\n }\n if (item.strokeForeground && item.stroke) {\n const fill = item.fill;\n setAttribute(fg, 'display', null);\n\n // set style of background\n this.style(bg, item);\n setAttribute(bg, 'stroke', null);\n\n // set style of foreground\n if (fill) item.fill = null;\n values = fg.__values__;\n this.style(fg, item);\n if (fill) item.fill = fill;\n\n // leave element null to prevent downstream styling\n element = null;\n } else {\n // ensure foreground is ignored\n setAttribute(fg, 'display', 'none');\n }\n },\n image(mdef, el, item) {\n if (item.smooth === false) {\n setStyle(el, 'image-rendering', 'optimizeSpeed');\n setStyle(el, 'image-rendering', 'pixelated');\n } else {\n setStyle(el, 'image-rendering', null);\n }\n },\n text(mdef, el, item) {\n const tl = textLines(item);\n let key, value, doc, lh;\n if (isArray(tl)) {\n // multi-line text\n value = tl.map(_ => textValue(item, _));\n key = value.join('\\n'); // content cache key\n\n if (key !== values.text) {\n domClear(el, 0);\n doc = el.ownerDocument;\n lh = lineHeight(item);\n value.forEach((t, i) => {\n const ts = domCreate(doc, 'tspan', svgns);\n ts.__data__ = item; // data binding\n ts.textContent = t;\n if (i) {\n ts.setAttribute('x', 0);\n ts.setAttribute('dy', lh);\n }\n el.appendChild(ts);\n });\n values.text = key;\n }\n } else {\n // single-line text\n value = textValue(item, tl);\n if (value !== values.text) {\n el.textContent = value;\n values.text = value;\n }\n }\n setAttribute(el, 'font-family', fontFamily(item));\n setAttribute(el, 'font-size', fontSize(item) + 'px');\n setAttribute(el, 'font-style', item.fontStyle);\n setAttribute(el, 'font-variant', item.fontVariant);\n setAttribute(el, 'font-weight', item.fontWeight);\n }\n};\nfunction emit(name, value, ns) {\n // early exit if value is unchanged\n if (value === values[name]) return;\n\n // use appropriate method given namespace (ns)\n if (ns) {\n setAttributeNS(element, name, value, ns);\n } else {\n setAttribute(element, name, value);\n }\n\n // note current value for future comparison\n values[name] = value;\n}\nfunction setStyle(el, name, value) {\n if (value !== values[name]) {\n if (value == null) {\n el.style.removeProperty(name);\n } else {\n el.style.setProperty(name, value + '');\n }\n values[name] = value;\n }\n}\nfunction setAttributes(el, attrs) {\n for (const key in attrs) {\n setAttribute(el, key, attrs[key]);\n }\n}\nfunction setAttribute(el, name, value) {\n if (value != null) {\n // if value is provided, update DOM attribute\n el.setAttribute(name, value);\n } else {\n // else remove DOM attribute\n el.removeAttribute(name);\n }\n}\nfunction setAttributeNS(el, name, value, ns) {\n if (value != null) {\n // if value is provided, update DOM attribute\n el.setAttributeNS(ns, name, value);\n } else {\n // else remove DOM attribute\n el.removeAttributeNS(ns, name);\n }\n}\nfunction href() {\n let loc;\n return typeof window === 'undefined' ? '' : (loc = window.location).hash ? loc.href.slice(0, -loc.hash.length) : loc.href;\n}\n\nfunction SVGStringRenderer(loader) {\n Renderer.call(this, loader);\n this._text = null;\n this._defs = {\n gradient: {},\n clipping: {}\n };\n}\ninherits(SVGStringRenderer, Renderer, {\n /**\n * Returns the rendered SVG text string,\n * or null if rendering has not yet occurred.\n */\n svg() {\n return this._text;\n },\n /**\n * Internal rendering method.\n * @param {object} scene - The root mark of a scenegraph to render.\n */\n _render(scene) {\n const m = markup();\n\n // svg tag\n m.open('svg', extend({}, metadata, {\n class: 'marks',\n width: this._width * this._scale,\n height: this._height * this._scale,\n viewBox: `0 0 ${this._width} ${this._height}`\n }));\n\n // background, if defined\n const bg = this._bgcolor;\n if (bg && bg !== 'transparent' && bg !== 'none') {\n m.open('rect', {\n width: this._width,\n height: this._height,\n fill: bg\n }).close();\n }\n\n // root content group\n m.open('g', rootAttributes, {\n transform: 'translate(' + this._origin + ')'\n });\n this.mark(m, scene);\n m.close(); // \n\n // defs\n this.defs(m);\n\n // get SVG text string\n this._text = m.close() + '';\n return this;\n },\n /**\n * Render a set of mark items.\n * @param {object} m - The markup context.\n * @param {object} scene - The mark parent to render.\n */\n mark(m, scene) {\n const mdef = Marks[scene.marktype],\n tag = mdef.tag,\n attrList = [ariaItemAttributes, mdef.attr];\n\n // render opening group tag\n m.open('g', {\n 'class': cssClass(scene),\n 'clip-path': scene.clip ? clip$1(this, scene, scene.group) : null\n }, ariaMarkAttributes(scene), {\n 'pointer-events': tag !== 'g' && scene.interactive === false ? 'none' : null\n });\n\n // render contained elements\n const process = item => {\n const href = this.href(item);\n if (href) m.open('a', href);\n m.open(tag, this.attr(scene, item, attrList, tag !== 'g' ? tag : null));\n if (tag === 'text') {\n const tl = textLines(item);\n if (isArray(tl)) {\n // multi-line text\n const attrs = {\n x: 0,\n dy: lineHeight(item)\n };\n for (let i = 0; i < tl.length; ++i) {\n m.open('tspan', i ? attrs : null).text(textValue(item, tl[i])).close();\n }\n } else {\n // single-line text\n m.text(textValue(item, tl));\n }\n } else if (tag === 'g') {\n const fore = item.strokeForeground,\n fill = item.fill,\n stroke = item.stroke;\n if (fore && stroke) {\n item.stroke = null;\n }\n m.open('path', this.attr(scene, item, mdef.background, 'bgrect')).close();\n\n // recurse for group content\n m.open('g', this.attr(scene, item, mdef.content));\n visit(item, scene => this.mark(m, scene));\n m.close();\n if (fore && stroke) {\n if (fill) item.fill = null;\n item.stroke = stroke;\n m.open('path', this.attr(scene, item, mdef.foreground, 'bgrect')).close();\n if (fill) item.fill = fill;\n } else {\n m.open('path', this.attr(scene, item, mdef.foreground, 'bgfore')).close();\n }\n }\n m.close(); // \n if (href) m.close(); // \n };\n\n if (mdef.nested) {\n if (scene.items && scene.items.length) process(scene.items[0]);\n } else {\n visit(scene, process);\n }\n\n // render closing group tag\n return m.close(); // \n },\n\n /**\n * Get href attributes for a hyperlinked mark item.\n * @param {Item} item - The mark item.\n */\n href(item) {\n const href = item.href;\n let attr;\n if (href) {\n if (attr = this._hrefs && this._hrefs[href]) {\n return attr;\n } else {\n this.sanitizeURL(href).then(attr => {\n // rewrite to use xlink namespace\n attr['xlink:href'] = attr.href;\n attr.href = null;\n (this._hrefs || (this._hrefs = {}))[href] = attr;\n });\n }\n }\n return null;\n },\n /**\n * Get an object of SVG attributes for a mark item.\n * @param {object} scene - The mark parent.\n * @param {Item} item - The mark item.\n * @param {array|function} attrs - One or more attribute emitters.\n * @param {string} tag - The tag being rendered.\n */\n attr(scene, item, attrs, tag) {\n const object = {},\n emit = (name, value, ns, prefixed) => {\n object[prefixed || name] = value;\n };\n\n // apply mark specific attributes\n if (Array.isArray(attrs)) {\n attrs.forEach(fn => fn(emit, item, this));\n } else {\n attrs(emit, item, this);\n }\n\n // apply style attributes\n if (tag) {\n style(object, item, scene, tag, this._defs);\n }\n return object;\n },\n /**\n * Render SVG defs, as needed.\n * Must be called *after* marks have been processed to ensure the\n * collected state is current and accurate.\n * @param {object} m - The markup context.\n */\n defs(m) {\n const gradient = this._defs.gradient,\n clipping = this._defs.clipping,\n count = Object.keys(gradient).length + Object.keys(clipping).length;\n if (count === 0) return; // nothing to do\n\n m.open('defs');\n for (const id in gradient) {\n const def = gradient[id],\n stops = def.stops;\n if (def.gradient === 'radial') {\n // SVG radial gradients automatically transform to normalized bbox\n // coordinates, in a way that is cumbersome to replicate in canvas.\n // We wrap the radial gradient in a pattern element, allowing us to\n // maintain a circular gradient that matches what canvas provides.\n\n m.open('pattern', {\n id: patternPrefix + id,\n viewBox: '0,0,1,1',\n width: '100%',\n height: '100%',\n preserveAspectRatio: 'xMidYMid slice'\n });\n m.open('rect', {\n width: '1',\n height: '1',\n fill: 'url(#' + id + ')'\n }).close();\n m.close(); // \n\n m.open('radialGradient', {\n id: id,\n fx: def.x1,\n fy: def.y1,\n fr: def.r1,\n cx: def.x2,\n cy: def.y2,\n r: def.r2\n });\n } else {\n m.open('linearGradient', {\n id: id,\n x1: def.x1,\n x2: def.x2,\n y1: def.y1,\n y2: def.y2\n });\n }\n for (let i = 0; i < stops.length; ++i) {\n m.open('stop', {\n offset: stops[i].offset,\n 'stop-color': stops[i].color\n }).close();\n }\n m.close();\n }\n for (const id in clipping) {\n const def = clipping[id];\n m.open('clipPath', {\n id: id\n });\n if (def.path) {\n m.open('path', {\n d: def.path\n }).close();\n } else {\n m.open('rect', {\n x: 0,\n y: 0,\n width: def.width,\n height: def.height\n }).close();\n }\n m.close();\n }\n m.close();\n }\n});\n\n// Helper function for attr for style presentation attributes\nfunction style(s, item, scene, tag, defs) {\n let styleList;\n if (item == null) return s;\n if (tag === 'bgrect' && scene.interactive === false) {\n s['pointer-events'] = 'none';\n }\n if (tag === 'bgfore') {\n if (scene.interactive === false) {\n s['pointer-events'] = 'none';\n }\n s.display = 'none';\n if (item.fill !== null) return s;\n }\n if (tag === 'image' && item.smooth === false) {\n styleList = ['image-rendering: optimizeSpeed;', 'image-rendering: pixelated;'];\n }\n if (tag === 'text') {\n s['font-family'] = fontFamily(item);\n s['font-size'] = fontSize(item) + 'px';\n s['font-style'] = item.fontStyle;\n s['font-variant'] = item.fontVariant;\n s['font-weight'] = item.fontWeight;\n }\n for (const prop in stylesAttr) {\n let value = item[prop];\n const name = stylesAttr[prop];\n if (value === 'transparent' && (name === 'fill' || name === 'stroke')) ; else if (value != null) {\n if (isGradient(value)) {\n value = gradientRef(value, defs.gradient, '');\n }\n s[name] = value;\n }\n }\n for (const prop in stylesCss) {\n const value = item[prop];\n if (value != null) {\n styleList = styleList || [];\n styleList.push(`${stylesCss[prop]}: ${value};`);\n }\n }\n if (styleList) {\n s.style = styleList.join(' ');\n }\n return s;\n}\n\nconst Canvas = 'canvas';\nconst PNG = 'png';\nconst SVG = 'svg';\nconst None = 'none';\nconst RenderType = {\n Canvas: Canvas,\n PNG: PNG,\n SVG: SVG,\n None: None\n};\nconst modules = {};\nmodules[Canvas] = modules[PNG] = {\n renderer: CanvasRenderer,\n headless: CanvasRenderer,\n handler: CanvasHandler\n};\nmodules[SVG] = {\n renderer: SVGRenderer,\n headless: SVGStringRenderer,\n handler: SVGHandler\n};\nmodules[None] = {};\nfunction renderModule(name, _) {\n name = String(name || '').toLowerCase();\n if (arguments.length > 1) {\n modules[name] = _;\n return this;\n } else {\n return modules[name];\n }\n}\n\nfunction intersect(scene, bounds, filter) {\n const hits = [],\n // intersection results\n box = new Bounds().union(bounds),\n // defensive copy\n type = scene.marktype;\n return type ? intersectMark(scene, box, filter, hits) : type === 'group' ? intersectGroup(scene, box, filter, hits) : error('Intersect scene must be mark node or group item.');\n}\nfunction intersectMark(mark, box, filter, hits) {\n if (visitMark(mark, box, filter)) {\n const items = mark.items,\n type = mark.marktype,\n n = items.length;\n let i = 0;\n if (type === 'group') {\n for (; i < n; ++i) {\n intersectGroup(items[i], box, filter, hits);\n }\n } else {\n for (const test = Marks[type].isect; i < n; ++i) {\n const item = items[i];\n if (intersectItem(item, box, test)) hits.push(item);\n }\n }\n }\n return hits;\n}\nfunction visitMark(mark, box, filter) {\n // process if bounds intersect and if\n // (1) mark is a group mark (so we must recurse), or\n // (2) mark is interactive and passes filter\n return mark.bounds && box.intersects(mark.bounds) && (mark.marktype === 'group' || mark.interactive !== false && (!filter || filter(mark)));\n}\nfunction intersectGroup(group, box, filter, hits) {\n // test intersect against group\n // skip groups by default unless filter says otherwise\n if (filter && filter(group.mark) && intersectItem(group, box, Marks.group.isect)) {\n hits.push(group);\n }\n\n // recursively test children marks\n // translate box to group coordinate space\n const marks = group.items,\n n = marks && marks.length;\n if (n) {\n const x = group.x || 0,\n y = group.y || 0;\n box.translate(-x, -y);\n for (let i = 0; i < n; ++i) {\n intersectMark(marks[i], box, filter, hits);\n }\n box.translate(x, y);\n }\n return hits;\n}\nfunction intersectItem(item, box, test) {\n // test bounds enclosure, bounds intersection, then detailed test\n const bounds = item.bounds;\n return box.encloses(bounds) || box.intersects(bounds) && test(item, box);\n}\n\nconst clipBounds = new Bounds();\nfunction boundClip (mark) {\n const clip = mark.clip;\n if (isFunction(clip)) {\n clip(boundContext(clipBounds.clear()));\n } else if (clip) {\n clipBounds.set(0, 0, mark.group.width, mark.group.height);\n } else return;\n mark.bounds.intersect(clipBounds);\n}\n\nconst TOLERANCE = 1e-9;\nfunction sceneEqual(a, b, key) {\n return a === b ? true : key === 'path' ? pathEqual(a, b) : a instanceof Date && b instanceof Date ? +a === +b : isNumber(a) && isNumber(b) ? Math.abs(a - b) <= TOLERANCE : !a || !b || !isObject(a) && !isObject(b) ? a == b : objectEqual(a, b);\n}\nfunction pathEqual(a, b) {\n return sceneEqual(parse(a), parse(b));\n}\nfunction objectEqual(a, b) {\n var ka = Object.keys(a),\n kb = Object.keys(b),\n key,\n i;\n if (ka.length !== kb.length) return false;\n ka.sort();\n kb.sort();\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i]) return false;\n }\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!sceneEqual(a[key], b[key], key)) return false;\n }\n return typeof a === typeof b;\n}\n\nfunction resetSVGDefIds() {\n resetSVGClipId();\n resetSVGGradientId();\n}\n\nexport { Bounds, CanvasHandler, CanvasRenderer, Gradient, GroupItem, Handler, Item, Marks, RenderType, Renderer, ResourceLoader, SVGHandler, SVGRenderer, SVGStringRenderer, Scenegraph, boundClip, boundContext, boundItem, boundMark, boundStroke, domChild, domClear, domCreate, domFind, font, fontFamily, fontSize, intersect, intersectBoxLine, intersectPath, intersectPoint, intersectRule, lineHeight, markup, multiLineOffset, curves as pathCurves, pathEqual, parse as pathParse, vg_rect as pathRectangle, pathRender, symbols as pathSymbols, vg_trail as pathTrail, point, renderModule, resetSVGClipId, resetSVGDefIds, sceneEqual, sceneFromJSON, pickVisit as scenePickVisit, sceneToJSON, visit as sceneVisit, zorder as sceneZOrder, serializeXML, textMetrics };\n","import constant from \"./constant.js\";\nimport {withPath} from \"./path.js\";\nimport asterisk from \"./symbol/asterisk.js\";\nimport circle from \"./symbol/circle.js\";\nimport cross from \"./symbol/cross.js\";\nimport diamond from \"./symbol/diamond.js\";\nimport diamond2 from \"./symbol/diamond2.js\";\nimport plus from \"./symbol/plus.js\";\nimport square from \"./symbol/square.js\";\nimport square2 from \"./symbol/square2.js\";\nimport star from \"./symbol/star.js\";\nimport triangle from \"./symbol/triangle.js\";\nimport triangle2 from \"./symbol/triangle2.js\";\nimport wye from \"./symbol/wye.js\";\nimport times from \"./symbol/times.js\";\n\n// These symbols are designed to be filled.\nexport const symbolsFill = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\n// These symbols are designed to be stroked (with a width of 1.5px and round caps).\nexport const symbolsStroke = [\n circle,\n plus,\n times,\n triangle2,\n asterisk,\n square2,\n diamond2\n];\n\nexport default function Symbol(type, size) {\n let context = null,\n path = withPath(symbol);\n\n type = typeof type === \"function\" ? type : constant(type || circle);\n size = typeof size === \"function\" ? size : constant(size === undefined ? 64 : +size);\n\n function symbol() {\n let buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n","import { Transform } from 'vega-dataflow';\nimport { Marks, boundClip, GroupItem, Item, Bounds, multiLineOffset, boundStroke } from 'vega-scenegraph';\nimport { inherits, peek, isObject } from 'vega-util';\n\nconst Top = 'top';\nconst Left = 'left';\nconst Right = 'right';\nconst Bottom = 'bottom';\nconst TopLeft = 'top-left';\nconst TopRight = 'top-right';\nconst BottomLeft = 'bottom-left';\nconst BottomRight = 'bottom-right';\nconst Start = 'start';\nconst Middle = 'middle';\nconst End = 'end';\nconst X = 'x';\nconst Y = 'y';\nconst Group = 'group';\nconst AxisRole = 'axis';\nconst TitleRole = 'title';\nconst FrameRole = 'frame';\nconst ScopeRole = 'scope';\nconst LegendRole = 'legend';\nconst RowHeader = 'row-header';\nconst RowFooter = 'row-footer';\nconst RowTitle = 'row-title';\nconst ColHeader = 'column-header';\nconst ColFooter = 'column-footer';\nconst ColTitle = 'column-title';\nconst Padding = 'padding';\nconst Symbols = 'symbol';\nconst Fit = 'fit';\nconst FitX = 'fit-x';\nconst FitY = 'fit-y';\nconst Pad = 'pad';\nconst None = 'none';\nconst All = 'all';\nconst Each = 'each';\nconst Flush = 'flush';\nconst Column = 'column';\nconst Row = 'row';\n\n/**\n * Calculate bounding boxes for scenegraph items.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.mark - The scenegraph mark instance to bound.\n */\nfunction Bound(params) {\n Transform.call(this, null, params);\n}\ninherits(Bound, Transform, {\n transform(_, pulse) {\n const view = pulse.dataflow,\n mark = _.mark,\n type = mark.marktype,\n entry = Marks[type],\n bound = entry.bound;\n let markBounds = mark.bounds,\n rebound;\n if (entry.nested) {\n // multi-item marks have a single bounds instance\n if (mark.items.length) view.dirty(mark.items[0]);\n markBounds = boundItem(mark, bound);\n mark.items.forEach(item => {\n item.bounds.clear().union(markBounds);\n });\n } else if (type === Group || _.modified()) {\n // operator parameters modified -> re-bound all items\n // updates group bounds in response to modified group content\n pulse.visit(pulse.MOD, item => view.dirty(item));\n markBounds.clear();\n mark.items.forEach(item => markBounds.union(boundItem(item, bound)));\n\n // force reflow for axes/legends/titles to propagate any layout changes\n switch (mark.role) {\n case AxisRole:\n case LegendRole:\n case TitleRole:\n pulse.reflow();\n }\n } else {\n // incrementally update bounds, re-bound mark as needed\n rebound = pulse.changed(pulse.REM);\n pulse.visit(pulse.ADD, item => {\n markBounds.union(boundItem(item, bound));\n });\n pulse.visit(pulse.MOD, item => {\n rebound = rebound || markBounds.alignsWith(item.bounds);\n view.dirty(item);\n markBounds.union(boundItem(item, bound));\n });\n if (rebound) {\n markBounds.clear();\n mark.items.forEach(item => markBounds.union(item.bounds));\n }\n }\n\n // ensure mark bounds do not exceed any clipping region\n boundClip(mark);\n return pulse.modifies('bounds');\n }\n});\nfunction boundItem(item, bound, opt) {\n return bound(item.bounds.clear(), item, opt);\n}\n\nconst COUNTER_NAME = ':vega_identifier:';\n\n/**\n * Adds a unique identifier to all added tuples.\n * This transform creates a new signal that serves as an id counter.\n * As a result, the id counter is shared across all instances of this\n * transform, generating unique ids across multiple data streams. In\n * addition, this signal value can be included in a snapshot of the\n * dataflow state, enabling correct resumption of id allocation.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {string} params.as - The field name for the generated identifier.\n */\nfunction Identifier(params) {\n Transform.call(this, 0, params);\n}\nIdentifier.Definition = {\n 'type': 'Identifier',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'as',\n 'type': 'string',\n 'required': true\n }]\n};\ninherits(Identifier, Transform, {\n transform(_, pulse) {\n const counter = getCounter(pulse.dataflow),\n as = _.as;\n let id = counter.value;\n pulse.visit(pulse.ADD, t => t[as] = t[as] || ++id);\n counter.set(this.value = id);\n return pulse;\n }\n});\nfunction getCounter(view) {\n return view._signals[COUNTER_NAME] || (view._signals[COUNTER_NAME] = view.add(0));\n}\n\n/**\n * Bind scenegraph items to a scenegraph mark instance.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.markdef - The mark definition for creating the mark.\n * This is an object of legal scenegraph mark properties which *must* include\n * the 'marktype' property.\n */\nfunction Mark(params) {\n Transform.call(this, null, params);\n}\ninherits(Mark, Transform, {\n transform(_, pulse) {\n let mark = this.value;\n\n // acquire mark on first invocation, bind context and group\n if (!mark) {\n mark = pulse.dataflow.scenegraph().mark(_.markdef, lookup$1(_), _.index);\n mark.group.context = _.context;\n if (!_.context.group) _.context.group = mark.group;\n mark.source = this.source; // point to upstream collector\n mark.clip = _.clip;\n mark.interactive = _.interactive;\n this.value = mark;\n }\n\n // initialize entering items\n const Init = mark.marktype === Group ? GroupItem : Item;\n pulse.visit(pulse.ADD, item => Init.call(item, mark));\n\n // update clipping and/or interactive status\n if (_.modified('clip') || _.modified('interactive')) {\n mark.clip = _.clip;\n mark.interactive = !!_.interactive;\n mark.zdirty = true; // force scenegraph re-eval\n pulse.reflow();\n }\n\n // bind items array to scenegraph mark\n mark.items = pulse.source;\n return pulse;\n }\n});\nfunction lookup$1(_) {\n const g = _.groups,\n p = _.parent;\n return g && g.size === 1 ? g.get(Object.keys(g.object)[0]) : g && p ? g.lookup(p) : null;\n}\n\n/**\n * Analyze items for overlap, changing opacity to hide items with\n * overlapping bounding boxes. This transform will preserve at least\n * two items (e.g., first and last) even if overlap persists.\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - A comparator\n * function for sorting items.\n * @param {object} [params.method] - The overlap removal method to apply.\n * One of 'parity' (default, hide every other item until there is no\n * more overlap) or 'greedy' (sequentially scan and hide and items that\n * overlap with the last visible item).\n * @param {object} [params.boundScale] - A scale whose range should be used\n * to bound the items. Items exceeding the bounds of the scale range\n * will be treated as overlapping. If null or undefined, no bounds check\n * will be applied.\n * @param {object} [params.boundOrient] - The orientation of the scale\n * (top, bottom, left, or right) used to bound items. This parameter is\n * ignored if boundScale is null or undefined.\n * @param {object} [params.boundTolerance] - The tolerance in pixels for\n * bound inclusion testing (default 1). This specifies by how many pixels\n * an item's bounds may exceed the scale range bounds and not be culled.\n * @constructor\n */\nfunction Overlap(params) {\n Transform.call(this, null, params);\n}\nconst methods = {\n parity: items => items.filter((item, i) => i % 2 ? item.opacity = 0 : 1),\n greedy: (items, sep) => {\n let a;\n return items.filter((b, i) => !i || !intersect(a.bounds, b.bounds, sep) ? (a = b, 1) : b.opacity = 0);\n }\n};\n\n// compute bounding box intersection\n// including padding pixels of separation\nconst intersect = (a, b, sep) => sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);\nconst hasOverlap = (items, pad) => {\n for (var i = 1, n = items.length, a = items[0].bounds, b; i < n; a = b, ++i) {\n if (intersect(a, b = items[i].bounds, pad)) return true;\n }\n};\nconst hasBounds = item => {\n const b = item.bounds;\n return b.width() > 1 && b.height() > 1;\n};\nconst boundTest = (scale, orient, tolerance) => {\n var range = scale.range(),\n b = new Bounds();\n if (orient === Top || orient === Bottom) {\n b.set(range[0], -Infinity, range[1], +Infinity);\n } else {\n b.set(-Infinity, range[0], +Infinity, range[1]);\n }\n b.expand(tolerance || 1);\n return item => b.encloses(item.bounds);\n};\n\n// reset all items to be fully opaque\nconst reset = source => {\n source.forEach(item => item.opacity = 1);\n return source;\n};\n\n// add all tuples to mod, fork pulse if parameters were modified\n// fork prevents cross-stream tuple pollution (e.g., pulse from scale)\nconst reflow = (pulse, _) => pulse.reflow(_.modified()).modifies('opacity');\ninherits(Overlap, Transform, {\n transform(_, pulse) {\n const reduce = methods[_.method] || methods.parity,\n sep = _.separation || 0;\n let source = pulse.materialize(pulse.SOURCE).source,\n items,\n test;\n if (!source || !source.length) return;\n if (!_.method) {\n // early exit if method is falsy\n if (_.modified('method')) {\n reset(source);\n pulse = reflow(pulse, _);\n }\n return pulse;\n }\n\n // skip labels with no content\n source = source.filter(hasBounds);\n\n // early exit, nothing to do\n if (!source.length) return;\n if (_.sort) {\n source = source.slice().sort(_.sort);\n }\n items = reset(source);\n pulse = reflow(pulse, _);\n if (items.length >= 3 && hasOverlap(items, sep)) {\n do {\n items = reduce(items, sep);\n } while (items.length >= 3 && hasOverlap(items, sep));\n if (items.length < 3 && !peek(source).opacity) {\n if (items.length > 1) peek(items).opacity = 0;\n peek(source).opacity = 1;\n }\n }\n if (_.boundScale && _.boundTolerance >= 0) {\n test = boundTest(_.boundScale, _.boundOrient, +_.boundTolerance);\n source.forEach(item => {\n if (!test(item)) item.opacity = 0;\n });\n }\n\n // re-calculate mark bounds\n const bounds = items[0].mark.bounds.clear();\n source.forEach(item => {\n if (item.opacity) bounds.union(item.bounds);\n });\n return pulse;\n }\n});\n\n/**\n * Queue modified scenegraph items for rendering.\n * @constructor\n */\nfunction Render(params) {\n Transform.call(this, null, params);\n}\ninherits(Render, Transform, {\n transform(_, pulse) {\n const view = pulse.dataflow;\n pulse.visit(pulse.ALL, item => view.dirty(item));\n\n // set z-index dirty flag as needed\n if (pulse.fields && pulse.fields['zindex']) {\n const item = pulse.source && pulse.source[0];\n if (item) item.mark.zdirty = true;\n }\n }\n});\n\nconst tempBounds = new Bounds();\nfunction set(item, property, value) {\n return item[property] === value ? 0 : (item[property] = value, 1);\n}\n\nfunction isYAxis(mark) {\n var orient = mark.items[0].orient;\n return orient === Left || orient === Right;\n}\nfunction axisIndices(datum) {\n let index = +datum.grid;\n return [datum.ticks ? index++ : -1,\n // ticks index\n datum.labels ? index++ : -1,\n // labels index\n index + +datum.domain // title index\n ];\n}\n\nfunction axisLayout(view, axis, width, height) {\n var item = axis.items[0],\n datum = item.datum,\n delta = item.translate != null ? item.translate : 0.5,\n orient = item.orient,\n indices = axisIndices(datum),\n range = item.range,\n offset = item.offset,\n position = item.position,\n minExtent = item.minExtent,\n maxExtent = item.maxExtent,\n title = datum.title && item.items[indices[2]].items[0],\n titlePadding = item.titlePadding,\n bounds = item.bounds,\n dl = title && multiLineOffset(title),\n x = 0,\n y = 0,\n i,\n s;\n tempBounds.clear().union(bounds);\n bounds.clear();\n if ((i = indices[0]) > -1) bounds.union(item.items[i].bounds);\n if ((i = indices[1]) > -1) bounds.union(item.items[i].bounds);\n\n // position axis group and title\n switch (orient) {\n case Top:\n x = position || 0;\n y = -offset;\n s = Math.max(minExtent, Math.min(maxExtent, -bounds.y1));\n bounds.add(0, -s).add(range, 0);\n if (title) axisTitleLayout(view, title, s, titlePadding, dl, 0, -1, bounds);\n break;\n case Left:\n x = -offset;\n y = position || 0;\n s = Math.max(minExtent, Math.min(maxExtent, -bounds.x1));\n bounds.add(-s, 0).add(0, range);\n if (title) axisTitleLayout(view, title, s, titlePadding, dl, 1, -1, bounds);\n break;\n case Right:\n x = width + offset;\n y = position || 0;\n s = Math.max(minExtent, Math.min(maxExtent, bounds.x2));\n bounds.add(0, 0).add(s, range);\n if (title) axisTitleLayout(view, title, s, titlePadding, dl, 1, 1, bounds);\n break;\n case Bottom:\n x = position || 0;\n y = height + offset;\n s = Math.max(minExtent, Math.min(maxExtent, bounds.y2));\n bounds.add(0, 0).add(range, s);\n if (title) axisTitleLayout(view, title, s, titlePadding, 0, 0, 1, bounds);\n break;\n default:\n x = item.x;\n y = item.y;\n }\n\n // update bounds\n boundStroke(bounds.translate(x, y), item);\n if (set(item, 'x', x + delta) | set(item, 'y', y + delta)) {\n item.bounds = tempBounds;\n view.dirty(item);\n item.bounds = bounds;\n view.dirty(item);\n }\n return item.mark.bounds.clear().union(bounds);\n}\nfunction axisTitleLayout(view, title, offset, pad, dl, isYAxis, sign, bounds) {\n const b = title.bounds;\n if (title.auto) {\n const v = sign * (offset + dl + pad);\n let dx = 0,\n dy = 0;\n view.dirty(title);\n isYAxis ? dx = (title.x || 0) - (title.x = v) : dy = (title.y || 0) - (title.y = v);\n title.mark.bounds.clear().union(b.translate(-dx, -dy));\n view.dirty(title);\n }\n bounds.union(b);\n}\n\n// aggregation functions for grid margin determination\nconst min = (a, b) => Math.floor(Math.min(a, b));\nconst max = (a, b) => Math.ceil(Math.max(a, b));\nfunction gridLayoutGroups(group) {\n var groups = group.items,\n n = groups.length,\n i = 0,\n mark,\n items;\n const views = {\n marks: [],\n rowheaders: [],\n rowfooters: [],\n colheaders: [],\n colfooters: [],\n rowtitle: null,\n coltitle: null\n };\n\n // layout axes, gather legends, collect bounds\n for (; i < n; ++i) {\n mark = groups[i];\n items = mark.items;\n if (mark.marktype === Group) {\n switch (mark.role) {\n case AxisRole:\n case LegendRole:\n case TitleRole:\n break;\n case RowHeader:\n views.rowheaders.push(...items);\n break;\n case RowFooter:\n views.rowfooters.push(...items);\n break;\n case ColHeader:\n views.colheaders.push(...items);\n break;\n case ColFooter:\n views.colfooters.push(...items);\n break;\n case RowTitle:\n views.rowtitle = items[0];\n break;\n case ColTitle:\n views.coltitle = items[0];\n break;\n default:\n views.marks.push(...items);\n }\n }\n }\n return views;\n}\nfunction bboxFlush(item) {\n return new Bounds().set(0, 0, item.width || 0, item.height || 0);\n}\nfunction bboxFull(item) {\n const b = item.bounds.clone();\n return b.empty() ? b.set(0, 0, 0, 0) : b.translate(-(item.x || 0), -(item.y || 0));\n}\nfunction get(opt, key, d) {\n const v = isObject(opt) ? opt[key] : opt;\n return v != null ? v : d !== undefined ? d : 0;\n}\nfunction offsetValue(v) {\n return v < 0 ? Math.ceil(-v) : 0;\n}\nfunction gridLayout(view, groups, opt) {\n var dirty = !opt.nodirty,\n bbox = opt.bounds === Flush ? bboxFlush : bboxFull,\n bounds = tempBounds.set(0, 0, 0, 0),\n alignCol = get(opt.align, Column),\n alignRow = get(opt.align, Row),\n padCol = get(opt.padding, Column),\n padRow = get(opt.padding, Row),\n ncols = opt.columns || groups.length,\n nrows = ncols <= 0 ? 1 : Math.ceil(groups.length / ncols),\n n = groups.length,\n xOffset = Array(n),\n xExtent = Array(ncols),\n xMax = 0,\n yOffset = Array(n),\n yExtent = Array(nrows),\n yMax = 0,\n dx = Array(n),\n dy = Array(n),\n boxes = Array(n),\n m,\n i,\n c,\n r,\n b,\n g,\n px,\n py,\n x,\n y,\n offset;\n for (i = 0; i < ncols; ++i) xExtent[i] = 0;\n for (i = 0; i < nrows; ++i) yExtent[i] = 0;\n\n // determine offsets for each group\n for (i = 0; i < n; ++i) {\n g = groups[i];\n b = boxes[i] = bbox(g);\n g.x = g.x || 0;\n dx[i] = 0;\n g.y = g.y || 0;\n dy[i] = 0;\n c = i % ncols;\n r = ~~(i / ncols);\n xMax = Math.max(xMax, px = Math.ceil(b.x2));\n yMax = Math.max(yMax, py = Math.ceil(b.y2));\n xExtent[c] = Math.max(xExtent[c], px);\n yExtent[r] = Math.max(yExtent[r], py);\n xOffset[i] = padCol + offsetValue(b.x1);\n yOffset[i] = padRow + offsetValue(b.y1);\n if (dirty) view.dirty(groups[i]);\n }\n\n // set initial alignment offsets\n for (i = 0; i < n; ++i) {\n if (i % ncols === 0) xOffset[i] = 0;\n if (i < ncols) yOffset[i] = 0;\n }\n\n // enforce column alignment constraints\n if (alignCol === Each) {\n for (c = 1; c < ncols; ++c) {\n for (offset = 0, i = c; i < n; i += ncols) {\n if (offset < xOffset[i]) offset = xOffset[i];\n }\n for (i = c; i < n; i += ncols) {\n xOffset[i] = offset + xExtent[c - 1];\n }\n }\n } else if (alignCol === All) {\n for (offset = 0, i = 0; i < n; ++i) {\n if (i % ncols && offset < xOffset[i]) offset = xOffset[i];\n }\n for (i = 0; i < n; ++i) {\n if (i % ncols) xOffset[i] = offset + xMax;\n }\n } else {\n for (alignCol = false, c = 1; c < ncols; ++c) {\n for (i = c; i < n; i += ncols) {\n xOffset[i] += xExtent[c - 1];\n }\n }\n }\n\n // enforce row alignment constraints\n if (alignRow === Each) {\n for (r = 1; r < nrows; ++r) {\n for (offset = 0, i = r * ncols, m = i + ncols; i < m; ++i) {\n if (offset < yOffset[i]) offset = yOffset[i];\n }\n for (i = r * ncols; i < m; ++i) {\n yOffset[i] = offset + yExtent[r - 1];\n }\n }\n } else if (alignRow === All) {\n for (offset = 0, i = ncols; i < n; ++i) {\n if (offset < yOffset[i]) offset = yOffset[i];\n }\n for (i = ncols; i < n; ++i) {\n yOffset[i] = offset + yMax;\n }\n } else {\n for (alignRow = false, r = 1; r < nrows; ++r) {\n for (i = r * ncols, m = i + ncols; i < m; ++i) {\n yOffset[i] += yExtent[r - 1];\n }\n }\n }\n\n // perform horizontal grid layout\n for (x = 0, i = 0; i < n; ++i) {\n x = xOffset[i] + (i % ncols ? x : 0);\n dx[i] += x - groups[i].x;\n }\n\n // perform vertical grid layout\n for (c = 0; c < ncols; ++c) {\n for (y = 0, i = c; i < n; i += ncols) {\n y += yOffset[i];\n dy[i] += y - groups[i].y;\n }\n }\n\n // perform horizontal centering\n if (alignCol && get(opt.center, Column) && nrows > 1) {\n for (i = 0; i < n; ++i) {\n b = alignCol === All ? xMax : xExtent[i % ncols];\n x = b - boxes[i].x2 - groups[i].x - dx[i];\n if (x > 0) dx[i] += x / 2;\n }\n }\n\n // perform vertical centering\n if (alignRow && get(opt.center, Row) && ncols !== 1) {\n for (i = 0; i < n; ++i) {\n b = alignRow === All ? yMax : yExtent[~~(i / ncols)];\n y = b - boxes[i].y2 - groups[i].y - dy[i];\n if (y > 0) dy[i] += y / 2;\n }\n }\n\n // position grid relative to anchor\n for (i = 0; i < n; ++i) {\n bounds.union(boxes[i].translate(dx[i], dy[i]));\n }\n x = get(opt.anchor, X);\n y = get(opt.anchor, Y);\n switch (get(opt.anchor, Column)) {\n case End:\n x -= bounds.width();\n break;\n case Middle:\n x -= bounds.width() / 2;\n }\n switch (get(opt.anchor, Row)) {\n case End:\n y -= bounds.height();\n break;\n case Middle:\n y -= bounds.height() / 2;\n }\n x = Math.round(x);\n y = Math.round(y);\n\n // update mark positions, bounds, dirty\n bounds.clear();\n for (i = 0; i < n; ++i) {\n groups[i].mark.bounds.clear();\n }\n for (i = 0; i < n; ++i) {\n g = groups[i];\n g.x += dx[i] += x;\n g.y += dy[i] += y;\n bounds.union(g.mark.bounds.union(g.bounds.translate(dx[i], dy[i])));\n if (dirty) view.dirty(g);\n }\n return bounds;\n}\nfunction trellisLayout(view, group, opt) {\n var views = gridLayoutGroups(group),\n groups = views.marks,\n bbox = opt.bounds === Flush ? boundFlush : boundFull,\n off = opt.offset,\n ncols = opt.columns || groups.length,\n nrows = ncols <= 0 ? 1 : Math.ceil(groups.length / ncols),\n cells = nrows * ncols,\n x,\n y,\n x2,\n y2,\n anchor,\n band,\n offset;\n\n // -- initial grid layout\n const bounds = gridLayout(view, groups, opt);\n if (bounds.empty()) bounds.set(0, 0, 0, 0); // empty grid\n\n // -- layout grid headers and footers --\n\n // perform row header layout\n if (views.rowheaders) {\n band = get(opt.headerBand, Row, null);\n x = layoutHeaders(view, views.rowheaders, groups, ncols, nrows, -get(off, 'rowHeader'), min, 0, bbox, 'x1', 0, ncols, 1, band);\n }\n\n // perform column header layout\n if (views.colheaders) {\n band = get(opt.headerBand, Column, null);\n y = layoutHeaders(view, views.colheaders, groups, ncols, ncols, -get(off, 'columnHeader'), min, 1, bbox, 'y1', 0, 1, ncols, band);\n }\n\n // perform row footer layout\n if (views.rowfooters) {\n band = get(opt.footerBand, Row, null);\n x2 = layoutHeaders(view, views.rowfooters, groups, ncols, nrows, get(off, 'rowFooter'), max, 0, bbox, 'x2', ncols - 1, ncols, 1, band);\n }\n\n // perform column footer layout\n if (views.colfooters) {\n band = get(opt.footerBand, Column, null);\n y2 = layoutHeaders(view, views.colfooters, groups, ncols, ncols, get(off, 'columnFooter'), max, 1, bbox, 'y2', cells - ncols, 1, ncols, band);\n }\n\n // perform row title layout\n if (views.rowtitle) {\n anchor = get(opt.titleAnchor, Row);\n offset = get(off, 'rowTitle');\n offset = anchor === End ? x2 + offset : x - offset;\n band = get(opt.titleBand, Row, 0.5);\n layoutTitle(view, views.rowtitle, offset, 0, bounds, band);\n }\n\n // perform column title layout\n if (views.coltitle) {\n anchor = get(opt.titleAnchor, Column);\n offset = get(off, 'columnTitle');\n offset = anchor === End ? y2 + offset : y - offset;\n band = get(opt.titleBand, Column, 0.5);\n layoutTitle(view, views.coltitle, offset, 1, bounds, band);\n }\n}\nfunction boundFlush(item, field) {\n return field === 'x1' ? item.x || 0 : field === 'y1' ? item.y || 0 : field === 'x2' ? (item.x || 0) + (item.width || 0) : field === 'y2' ? (item.y || 0) + (item.height || 0) : undefined;\n}\nfunction boundFull(item, field) {\n return item.bounds[field];\n}\nfunction layoutHeaders(view, headers, groups, ncols, limit, offset, agg, isX, bound, bf, start, stride, back, band) {\n var n = groups.length,\n init = 0,\n edge = 0,\n i,\n j,\n k,\n m,\n b,\n h,\n g,\n x,\n y;\n\n // if no groups, early exit and return 0\n if (!n) return init;\n\n // compute margin\n for (i = start; i < n; i += stride) {\n if (groups[i]) init = agg(init, bound(groups[i], bf));\n }\n\n // if no headers, return margin calculation\n if (!headers.length) return init;\n\n // check if number of headers exceeds number of rows or columns\n if (headers.length > limit) {\n view.warn('Grid headers exceed limit: ' + limit);\n headers = headers.slice(0, limit);\n }\n\n // apply offset\n init += offset;\n\n // clear mark bounds for all headers\n for (j = 0, m = headers.length; j < m; ++j) {\n view.dirty(headers[j]);\n headers[j].mark.bounds.clear();\n }\n\n // layout each header\n for (i = start, j = 0, m = headers.length; j < m; ++j, i += stride) {\n h = headers[j];\n b = h.mark.bounds;\n\n // search for nearest group to align to\n // necessary if table has empty cells\n for (k = i; k >= 0 && (g = groups[k]) == null; k -= back);\n\n // assign coordinates and update bounds\n if (isX) {\n x = band == null ? g.x : Math.round(g.bounds.x1 + band * g.bounds.width());\n y = init;\n } else {\n x = init;\n y = band == null ? g.y : Math.round(g.bounds.y1 + band * g.bounds.height());\n }\n b.union(h.bounds.translate(x - (h.x || 0), y - (h.y || 0)));\n h.x = x;\n h.y = y;\n view.dirty(h);\n\n // update current edge of layout bounds\n edge = agg(edge, b[bf]);\n }\n return edge;\n}\nfunction layoutTitle(view, g, offset, isX, bounds, band) {\n if (!g) return;\n view.dirty(g);\n\n // compute title coordinates\n var x = offset,\n y = offset;\n isX ? x = Math.round(bounds.x1 + band * bounds.width()) : y = Math.round(bounds.y1 + band * bounds.height());\n\n // assign coordinates and update bounds\n g.bounds.translate(x - (g.x || 0), y - (g.y || 0));\n g.mark.bounds.clear().union(g.bounds);\n g.x = x;\n g.y = y;\n\n // queue title for redraw\n view.dirty(g);\n}\n\n// utility for looking up legend layout configuration\nfunction lookup(config, orient) {\n const opt = config[orient] || {};\n return (key, d) => opt[key] != null ? opt[key] : config[key] != null ? config[key] : d;\n}\n\n// if legends specify offset directly, use the maximum specified value\nfunction offsets(legends, value) {\n let max = -Infinity;\n legends.forEach(item => {\n if (item.offset != null) max = Math.max(max, item.offset);\n });\n return max > -Infinity ? max : value;\n}\nfunction legendParams(g, orient, config, xb, yb, w, h) {\n const _ = lookup(config, orient),\n offset = offsets(g, _('offset', 0)),\n anchor = _('anchor', Start),\n mult = anchor === End ? 1 : anchor === Middle ? 0.5 : 0;\n const p = {\n align: Each,\n bounds: _('bounds', Flush),\n columns: _('direction') === 'vertical' ? 1 : g.length,\n padding: _('margin', 8),\n center: _('center'),\n nodirty: true\n };\n switch (orient) {\n case Left:\n p.anchor = {\n x: Math.floor(xb.x1) - offset,\n column: End,\n y: mult * (h || xb.height() + 2 * xb.y1),\n row: anchor\n };\n break;\n case Right:\n p.anchor = {\n x: Math.ceil(xb.x2) + offset,\n y: mult * (h || xb.height() + 2 * xb.y1),\n row: anchor\n };\n break;\n case Top:\n p.anchor = {\n y: Math.floor(yb.y1) - offset,\n row: End,\n x: mult * (w || yb.width() + 2 * yb.x1),\n column: anchor\n };\n break;\n case Bottom:\n p.anchor = {\n y: Math.ceil(yb.y2) + offset,\n x: mult * (w || yb.width() + 2 * yb.x1),\n column: anchor\n };\n break;\n case TopLeft:\n p.anchor = {\n x: offset,\n y: offset\n };\n break;\n case TopRight:\n p.anchor = {\n x: w - offset,\n y: offset,\n column: End\n };\n break;\n case BottomLeft:\n p.anchor = {\n x: offset,\n y: h - offset,\n row: End\n };\n break;\n case BottomRight:\n p.anchor = {\n x: w - offset,\n y: h - offset,\n column: End,\n row: End\n };\n break;\n }\n return p;\n}\nfunction legendLayout(view, legend) {\n var item = legend.items[0],\n datum = item.datum,\n orient = item.orient,\n bounds = item.bounds,\n x = item.x,\n y = item.y,\n w,\n h;\n\n // cache current bounds for later comparison\n item._bounds ? item._bounds.clear().union(bounds) : item._bounds = bounds.clone();\n bounds.clear();\n\n // adjust legend to accommodate padding and title\n legendGroupLayout(view, item, item.items[0].items[0]);\n\n // aggregate bounds to determine size, and include origin\n bounds = legendBounds(item, bounds);\n w = 2 * item.padding;\n h = 2 * item.padding;\n if (!bounds.empty()) {\n w = Math.ceil(bounds.width() + w);\n h = Math.ceil(bounds.height() + h);\n }\n if (datum.type === Symbols) {\n legendEntryLayout(item.items[0].items[0].items[0].items);\n }\n if (orient !== None) {\n item.x = x = 0;\n item.y = y = 0;\n }\n item.width = w;\n item.height = h;\n boundStroke(bounds.set(x, y, x + w, y + h), item);\n item.mark.bounds.clear().union(bounds);\n return item;\n}\nfunction legendBounds(item, b) {\n // aggregate item bounds\n item.items.forEach(_ => b.union(_.bounds));\n\n // anchor to legend origin\n b.x1 = item.padding;\n b.y1 = item.padding;\n return b;\n}\nfunction legendGroupLayout(view, item, entry) {\n var pad = item.padding,\n ex = pad - entry.x,\n ey = pad - entry.y;\n if (!item.datum.title) {\n if (ex || ey) translate(view, entry, ex, ey);\n } else {\n var title = item.items[1].items[0],\n anchor = title.anchor,\n tpad = item.titlePadding || 0,\n tx = pad - title.x,\n ty = pad - title.y;\n switch (title.orient) {\n case Left:\n ex += Math.ceil(title.bounds.width()) + tpad;\n break;\n case Right:\n case Bottom:\n break;\n default:\n ey += title.bounds.height() + tpad;\n }\n if (ex || ey) translate(view, entry, ex, ey);\n switch (title.orient) {\n case Left:\n ty += legendTitleOffset(item, entry, title, anchor, 1, 1);\n break;\n case Right:\n tx += legendTitleOffset(item, entry, title, End, 0, 0) + tpad;\n ty += legendTitleOffset(item, entry, title, anchor, 1, 1);\n break;\n case Bottom:\n tx += legendTitleOffset(item, entry, title, anchor, 0, 0);\n ty += legendTitleOffset(item, entry, title, End, -1, 0, 1) + tpad;\n break;\n default:\n tx += legendTitleOffset(item, entry, title, anchor, 0, 0);\n }\n if (tx || ty) translate(view, title, tx, ty);\n\n // translate legend if title pushes into negative coordinates\n if ((tx = Math.round(title.bounds.x1 - pad)) < 0) {\n translate(view, entry, -tx, 0);\n translate(view, title, -tx, 0);\n }\n }\n}\nfunction legendTitleOffset(item, entry, title, anchor, y, lr, noBar) {\n const grad = item.datum.type !== 'symbol',\n vgrad = title.datum.vgrad,\n e = grad && (lr || !vgrad) && !noBar ? entry.items[0] : entry,\n s = e.bounds[y ? 'y2' : 'x2'] - item.padding,\n u = vgrad && lr ? s : 0,\n v = vgrad && lr ? 0 : s,\n o = y <= 0 ? 0 : multiLineOffset(title);\n return Math.round(anchor === Start ? u : anchor === End ? v - o : 0.5 * (s - o));\n}\nfunction translate(view, item, dx, dy) {\n item.x += dx;\n item.y += dy;\n item.bounds.translate(dx, dy);\n item.mark.bounds.translate(dx, dy);\n view.dirty(item);\n}\nfunction legendEntryLayout(entries) {\n // get max widths for each column\n const widths = entries.reduce((w, g) => {\n w[g.column] = Math.max(g.bounds.x2 - g.x, w[g.column] || 0);\n return w;\n }, {});\n\n // set dimensions of legend entry groups\n entries.forEach(g => {\n g.width = widths[g.column];\n g.height = g.bounds.y2 - g.y;\n });\n}\n\nfunction titleLayout(view, mark, width, height, viewBounds) {\n var group = mark.items[0],\n frame = group.frame,\n orient = group.orient,\n anchor = group.anchor,\n offset = group.offset,\n padding = group.padding,\n title = group.items[0].items[0],\n subtitle = group.items[1] && group.items[1].items[0],\n end = orient === Left || orient === Right ? height : width,\n start = 0,\n x = 0,\n y = 0,\n sx = 0,\n sy = 0,\n pos;\n if (frame !== Group) {\n orient === Left ? (start = viewBounds.y2, end = viewBounds.y1) : orient === Right ? (start = viewBounds.y1, end = viewBounds.y2) : (start = viewBounds.x1, end = viewBounds.x2);\n } else if (orient === Left) {\n start = height, end = 0;\n }\n pos = anchor === Start ? start : anchor === End ? end : (start + end) / 2;\n if (subtitle && subtitle.text) {\n // position subtitle\n switch (orient) {\n case Top:\n case Bottom:\n sy = title.bounds.height() + padding;\n break;\n case Left:\n sx = title.bounds.width() + padding;\n break;\n case Right:\n sx = -title.bounds.width() - padding;\n break;\n }\n tempBounds.clear().union(subtitle.bounds);\n tempBounds.translate(sx - (subtitle.x || 0), sy - (subtitle.y || 0));\n if (set(subtitle, 'x', sx) | set(subtitle, 'y', sy)) {\n view.dirty(subtitle);\n subtitle.bounds.clear().union(tempBounds);\n subtitle.mark.bounds.clear().union(tempBounds);\n view.dirty(subtitle);\n }\n tempBounds.clear().union(subtitle.bounds);\n } else {\n tempBounds.clear();\n }\n tempBounds.union(title.bounds);\n\n // position title group\n switch (orient) {\n case Top:\n x = pos;\n y = viewBounds.y1 - tempBounds.height() - offset;\n break;\n case Left:\n x = viewBounds.x1 - tempBounds.width() - offset;\n y = pos;\n break;\n case Right:\n x = viewBounds.x2 + tempBounds.width() + offset;\n y = pos;\n break;\n case Bottom:\n x = pos;\n y = viewBounds.y2 + offset;\n break;\n default:\n x = group.x;\n y = group.y;\n }\n if (set(group, 'x', x) | set(group, 'y', y)) {\n tempBounds.translate(x, y);\n view.dirty(group);\n group.bounds.clear().union(tempBounds);\n mark.bounds.clear().union(tempBounds);\n view.dirty(group);\n }\n return group.bounds;\n}\n\n/**\n * Layout view elements such as axes and legends.\n * Also performs size adjustments.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.mark - Scenegraph mark of groups to layout.\n */\nfunction ViewLayout(params) {\n Transform.call(this, null, params);\n}\ninherits(ViewLayout, Transform, {\n transform(_, pulse) {\n const view = pulse.dataflow;\n _.mark.items.forEach(group => {\n if (_.layout) trellisLayout(view, group, _.layout);\n layoutGroup(view, group, _);\n });\n return shouldReflow(_.mark.group) ? pulse.reflow() : pulse;\n }\n});\nfunction shouldReflow(group) {\n // We typically should reflow if layout is invoked (#2568), as child items\n // may have resized and reflow ensures group bounds are re-calculated.\n // However, legend entries have a special exception to avoid instability.\n // For example, if a selected legend symbol gains a stroke on hover,\n // we don't want to re-position subsequent elements in the legend.\n return group && group.mark.role !== 'legend-entry';\n}\nfunction layoutGroup(view, group, _) {\n var items = group.items,\n width = Math.max(0, group.width || 0),\n height = Math.max(0, group.height || 0),\n viewBounds = new Bounds().set(0, 0, width, height),\n xBounds = viewBounds.clone(),\n yBounds = viewBounds.clone(),\n legends = [],\n title,\n mark,\n orient,\n b,\n i,\n n;\n\n // layout axes, gather legends, collect bounds\n for (i = 0, n = items.length; i < n; ++i) {\n mark = items[i];\n switch (mark.role) {\n case AxisRole:\n b = isYAxis(mark) ? xBounds : yBounds;\n b.union(axisLayout(view, mark, width, height));\n break;\n case TitleRole:\n title = mark;\n break;\n case LegendRole:\n legends.push(legendLayout(view, mark));\n break;\n case FrameRole:\n case ScopeRole:\n case RowHeader:\n case RowFooter:\n case RowTitle:\n case ColHeader:\n case ColFooter:\n case ColTitle:\n xBounds.union(mark.bounds);\n yBounds.union(mark.bounds);\n break;\n default:\n viewBounds.union(mark.bounds);\n }\n }\n\n // layout legends, adjust viewBounds\n if (legends.length) {\n // group legends by orient\n const l = {};\n legends.forEach(item => {\n orient = item.orient || Right;\n if (orient !== None) (l[orient] || (l[orient] = [])).push(item);\n });\n\n // perform grid layout for each orient group\n for (const orient in l) {\n const g = l[orient];\n gridLayout(view, g, legendParams(g, orient, _.legends, xBounds, yBounds, width, height));\n }\n\n // update view bounds\n legends.forEach(item => {\n const b = item.bounds;\n if (!b.equals(item._bounds)) {\n item.bounds = item._bounds;\n view.dirty(item); // dirty previous location\n item.bounds = b;\n view.dirty(item);\n }\n if (_.autosize && (_.autosize.type === Fit || _.autosize.type === FitX || _.autosize.type === FitY)) {\n // For autosize fit, incorporate the orthogonal dimension only.\n // Legends that overrun the chart area will then be clipped;\n // otherwise the chart area gets reduced to nothing!\n switch (item.orient) {\n case Left:\n case Right:\n viewBounds.add(b.x1, 0).add(b.x2, 0);\n break;\n case Top:\n case Bottom:\n viewBounds.add(0, b.y1).add(0, b.y2);\n }\n } else {\n viewBounds.union(b);\n }\n });\n }\n\n // combine bounding boxes\n viewBounds.union(xBounds).union(yBounds);\n\n // layout title, adjust bounds\n if (title) {\n viewBounds.union(titleLayout(view, title, width, height, viewBounds));\n }\n\n // override aggregated view bounds if content is clipped\n if (group.clip) {\n viewBounds.set(0, 0, group.width || 0, group.height || 0);\n }\n\n // perform size adjustment\n viewSizeLayout(view, group, viewBounds, _);\n}\nfunction viewSizeLayout(view, group, viewBounds, _) {\n const auto = _.autosize || {},\n type = auto.type;\n if (view._autosize < 1 || !type) return;\n let viewWidth = view._width,\n viewHeight = view._height,\n width = Math.max(0, group.width || 0),\n left = Math.max(0, Math.ceil(-viewBounds.x1)),\n height = Math.max(0, group.height || 0),\n top = Math.max(0, Math.ceil(-viewBounds.y1));\n const right = Math.max(0, Math.ceil(viewBounds.x2 - width)),\n bottom = Math.max(0, Math.ceil(viewBounds.y2 - height));\n if (auto.contains === Padding) {\n const padding = view.padding();\n viewWidth -= padding.left + padding.right;\n viewHeight -= padding.top + padding.bottom;\n }\n if (type === None) {\n left = 0;\n top = 0;\n width = viewWidth;\n height = viewHeight;\n } else if (type === Fit) {\n width = Math.max(0, viewWidth - left - right);\n height = Math.max(0, viewHeight - top - bottom);\n } else if (type === FitX) {\n width = Math.max(0, viewWidth - left - right);\n viewHeight = height + top + bottom;\n } else if (type === FitY) {\n viewWidth = width + left + right;\n height = Math.max(0, viewHeight - top - bottom);\n } else if (type === Pad) {\n viewWidth = width + left + right;\n viewHeight = height + top + bottom;\n }\n view._resizeView(viewWidth, viewHeight, width, height, [left, top], auto.resize);\n}\n\nexport { Bound as bound, Identifier as identifier, Mark as mark, Overlap as overlap, Render as render, ViewLayout as viewlayout };\n","export default function sum(values, valueof) {\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n sum += value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n sum += value;\n }\n }\n }\n return sum;\n}\n","import { Transform, ingest, tupleid, stableCompare } from 'vega-dataflow';\nimport { tickCount, tickFormat, validTicks, tickValues, SymbolLegend, labelFormat, labelValues, GradientLegend, scaleFraction, labelFraction, scale, Sequential, Linear, isContinuous, Time, UTC, Ordinal, scaleImplicit, Log, Sqrt, Pow, Symlog, isLogarithmic, BinOrdinal, isInterpolating, interpolateColors, interpolate, Band, Point, bandSpace, scheme, Threshold, Quantile, Quantize, quantizeInterpolator, interpolateRange, Diverging } from 'vega-scale';\nimport { inherits, isArray, error, fastmap, falsy, isFunction, constant, peek, one, toSet, isString, zoomLog, zoomPow, zoomSymlog, zoomLinear, stringValue } from 'vega-util';\nimport { sum, range } from 'd3-array';\nimport { interpolateRound, interpolate as interpolate$1 } from 'd3-interpolate';\n\n/**\n * Generates axis ticks for visualizing a spatial scale.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Scale} params.scale - The scale to generate ticks for.\n * @param {*} [params.count=10] - The approximate number of ticks, or\n * desired tick interval, to use.\n * @param {Array<*>} [params.values] - The exact tick values to use.\n * These must be legal domain values for the provided scale.\n * If provided, the count argument is ignored.\n * @param {function(*):string} [params.formatSpecifier] - A format specifier\n * to use in conjunction with scale.tickFormat. Legal values are\n * any valid d3 4.0 format specifier.\n * @param {function(*):string} [params.format] - The format function to use.\n * If provided, the formatSpecifier argument is ignored.\n */\nfunction AxisTicks(params) {\n Transform.call(this, null, params);\n}\ninherits(AxisTicks, Transform, {\n transform(_, pulse) {\n if (this.value && !_.modified()) {\n return pulse.StopPropagation;\n }\n var locale = pulse.dataflow.locale(),\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n ticks = this.value,\n scale = _.scale,\n tally = _.count == null ? _.values ? _.values.length : 10 : _.count,\n count = tickCount(scale, tally, _.minstep),\n format = _.format || tickFormat(locale, scale, count, _.formatSpecifier, _.formatType, !!_.values),\n values = _.values ? validTicks(scale, _.values, count) : tickValues(scale, count);\n if (ticks) out.rem = ticks;\n ticks = values.map((value, i) => ingest({\n index: i / (values.length - 1 || 1),\n value: value,\n label: format(value)\n }));\n if (_.extra && ticks.length) {\n // add an extra tick pegged to the initial domain value\n // this is used to generate axes with 'binned' domains\n ticks.push(ingest({\n index: -1,\n extra: {\n value: ticks[0].value\n },\n label: ''\n }));\n }\n out.source = ticks;\n out.add = ticks;\n this.value = ticks;\n return out;\n }\n});\n\n/**\n * Joins a set of data elements against a set of visual items.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): object} [params.item] - An item generator function.\n * @param {function(object): *} [params.key] - The key field associating data and visual items.\n */\nfunction DataJoin(params) {\n Transform.call(this, null, params);\n}\nfunction defaultItemCreate() {\n return ingest({});\n}\nfunction newMap(key) {\n const map = fastmap().test(t => t.exit);\n map.lookup = t => map.get(key(t));\n return map;\n}\ninherits(DataJoin, Transform, {\n transform(_, pulse) {\n var df = pulse.dataflow,\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n item = _.item || defaultItemCreate,\n key = _.key || tupleid,\n map = this.value;\n\n // prevent transient (e.g., hover) requests from\n // cascading across marks derived from marks\n if (isArray(out.encode)) {\n out.encode = null;\n }\n if (map && (_.modified('key') || pulse.modified(key))) {\n error('DataJoin does not support modified key function or fields.');\n }\n if (!map) {\n pulse = pulse.addAll();\n this.value = map = newMap(key);\n }\n pulse.visit(pulse.ADD, t => {\n const k = key(t);\n let x = map.get(k);\n if (x) {\n if (x.exit) {\n map.empty--;\n out.add.push(x);\n } else {\n out.mod.push(x);\n }\n } else {\n x = item(t);\n map.set(k, x);\n out.add.push(x);\n }\n x.datum = t;\n x.exit = false;\n });\n pulse.visit(pulse.MOD, t => {\n const k = key(t),\n x = map.get(k);\n if (x) {\n x.datum = t;\n out.mod.push(x);\n }\n });\n pulse.visit(pulse.REM, t => {\n const k = key(t),\n x = map.get(k);\n if (t === x.datum && !x.exit) {\n out.rem.push(x);\n x.exit = true;\n ++map.empty;\n }\n });\n if (pulse.changed(pulse.ADD_MOD)) out.modifies('datum');\n if (pulse.clean() || _.clean && map.empty > df.cleanThreshold) {\n df.runAfter(map.clean);\n }\n return out;\n }\n});\n\n/**\n * Invokes encoding functions for visual items.\n * @constructor\n * @param {object} params - The parameters to the encoding functions. This\n * parameter object will be passed through to all invoked encoding functions.\n * @param {object} [params.mod=false] - Flag indicating if tuples in the input\n * mod set that are unmodified by encoders should be included in the output.\n * @param {object} param.encoders - The encoding functions\n * @param {function(object, object): boolean} [param.encoders.update] - Update encoding set\n * @param {function(object, object): boolean} [param.encoders.enter] - Enter encoding set\n * @param {function(object, object): boolean} [param.encoders.exit] - Exit encoding set\n */\nfunction Encode(params) {\n Transform.call(this, null, params);\n}\ninherits(Encode, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ADD_REM),\n fmod = _.mod || false,\n encoders = _.encoders,\n encode = pulse.encode;\n\n // if an array, the encode directive includes additional sets\n // that must be defined in order for the primary set to be invoked\n // e.g., only run the update set if the hover set is defined\n if (isArray(encode)) {\n if (out.changed() || encode.every(e => encoders[e])) {\n encode = encode[0];\n out.encode = null; // consume targeted encode directive\n } else {\n return pulse.StopPropagation;\n }\n }\n\n // marshall encoder functions\n var reenter = encode === 'enter',\n update = encoders.update || falsy,\n enter = encoders.enter || falsy,\n exit = encoders.exit || falsy,\n set = (encode && !reenter ? encoders[encode] : update) || falsy;\n if (pulse.changed(pulse.ADD)) {\n pulse.visit(pulse.ADD, t => {\n enter(t, _);\n update(t, _);\n });\n out.modifies(enter.output);\n out.modifies(update.output);\n if (set !== falsy && set !== update) {\n pulse.visit(pulse.ADD, t => {\n set(t, _);\n });\n out.modifies(set.output);\n }\n }\n if (pulse.changed(pulse.REM) && exit !== falsy) {\n pulse.visit(pulse.REM, t => {\n exit(t, _);\n });\n out.modifies(exit.output);\n }\n if (reenter || set !== falsy) {\n const flag = pulse.MOD | (_.modified() ? pulse.REFLOW : 0);\n if (reenter) {\n pulse.visit(flag, t => {\n const mod = enter(t, _) || fmod;\n if (set(t, _) || mod) out.mod.push(t);\n });\n if (out.mod.length) out.modifies(enter.output);\n } else {\n pulse.visit(flag, t => {\n if (set(t, _) || fmod) out.mod.push(t);\n });\n }\n if (out.mod.length) out.modifies(set.output);\n }\n return out.changed() ? out : pulse.StopPropagation;\n }\n});\n\n/**\n * Generates legend entries for visualizing a scale.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Scale} params.scale - The scale to generate items for.\n * @param {*} [params.count=5] - The approximate number of items, or\n * desired tick interval, to use.\n * @param {*} [params.limit] - The maximum number of entries to\n * include in a symbol legend.\n * @param {Array<*>} [params.values] - The exact tick values to use.\n * These must be legal domain values for the provided scale.\n * If provided, the count argument is ignored.\n * @param {string} [params.formatSpecifier] - A format specifier\n * to use in conjunction with scale.tickFormat. Legal values are\n * any valid D3 format specifier string.\n * @param {function(*):string} [params.format] - The format function to use.\n * If provided, the formatSpecifier argument is ignored.\n */\nfunction LegendEntries(params) {\n Transform.call(this, [], params);\n}\ninherits(LegendEntries, Transform, {\n transform(_, pulse) {\n if (this.value != null && !_.modified()) {\n return pulse.StopPropagation;\n }\n var locale = pulse.dataflow.locale(),\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n items = this.value,\n type = _.type || SymbolLegend,\n scale = _.scale,\n limit = +_.limit,\n count = tickCount(scale, _.count == null ? 5 : _.count, _.minstep),\n lskip = !!_.values || type === SymbolLegend,\n format = _.format || labelFormat(locale, scale, count, type, _.formatSpecifier, _.formatType, lskip),\n values = _.values || labelValues(scale, count),\n domain,\n fraction,\n size,\n offset,\n ellipsis;\n if (items) out.rem = items;\n if (type === SymbolLegend) {\n if (limit && values.length > limit) {\n pulse.dataflow.warn('Symbol legend count exceeds limit, filtering items.');\n items = values.slice(0, limit - 1);\n ellipsis = true;\n } else {\n items = values;\n }\n if (isFunction(size = _.size)) {\n // if first value maps to size zero, remove from list (vega#717)\n if (!_.values && scale(items[0]) === 0) {\n items = items.slice(1);\n }\n // compute size offset for legend entries\n offset = items.reduce((max, value) => Math.max(max, size(value, _)), 0);\n } else {\n size = constant(offset = size || 8);\n }\n items = items.map((value, index) => ingest({\n index: index,\n label: format(value, index, items),\n value: value,\n offset: offset,\n size: size(value, _)\n }));\n if (ellipsis) {\n ellipsis = values[items.length];\n items.push(ingest({\n index: items.length,\n label: `\\u2026${values.length - items.length} entries`,\n value: ellipsis,\n offset: offset,\n size: size(ellipsis, _)\n }));\n }\n } else if (type === GradientLegend) {\n domain = scale.domain(), fraction = scaleFraction(scale, domain[0], peek(domain));\n\n // if automatic label generation produces 2 or fewer values,\n // use the domain end points instead (fixes vega/vega#1364)\n if (values.length < 3 && !_.values && domain[0] !== peek(domain)) {\n values = [domain[0], peek(domain)];\n }\n items = values.map((value, index) => ingest({\n index: index,\n label: format(value, index, values),\n value: value,\n perc: fraction(value)\n }));\n } else {\n size = values.length - 1;\n fraction = labelFraction(scale);\n items = values.map((value, index) => ingest({\n index: index,\n label: format(value, index, values),\n value: value,\n perc: index ? fraction(value) : 0,\n perc2: index === size ? 1 : fraction(values[index + 1])\n }));\n }\n out.source = items;\n out.add = items;\n this.value = items;\n return out;\n }\n});\n\nconst sourceX = t => t.source.x;\nconst sourceY = t => t.source.y;\nconst targetX = t => t.target.x;\nconst targetY = t => t.target.y;\n\n/**\n * Layout paths linking source and target elements.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction LinkPath(params) {\n Transform.call(this, {}, params);\n}\nLinkPath.Definition = {\n 'type': 'LinkPath',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'sourceX',\n 'type': 'field',\n 'default': 'source.x'\n }, {\n 'name': 'sourceY',\n 'type': 'field',\n 'default': 'source.y'\n }, {\n 'name': 'targetX',\n 'type': 'field',\n 'default': 'target.x'\n }, {\n 'name': 'targetY',\n 'type': 'field',\n 'default': 'target.y'\n }, {\n 'name': 'orient',\n 'type': 'enum',\n 'default': 'vertical',\n 'values': ['horizontal', 'vertical', 'radial']\n }, {\n 'name': 'shape',\n 'type': 'enum',\n 'default': 'line',\n 'values': ['line', 'arc', 'curve', 'diagonal', 'orthogonal']\n }, {\n 'name': 'require',\n 'type': 'signal'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'path'\n }]\n};\ninherits(LinkPath, Transform, {\n transform(_, pulse) {\n var sx = _.sourceX || sourceX,\n sy = _.sourceY || sourceY,\n tx = _.targetX || targetX,\n ty = _.targetY || targetY,\n as = _.as || 'path',\n orient = _.orient || 'vertical',\n shape = _.shape || 'line',\n path = Paths.get(shape + '-' + orient) || Paths.get(shape);\n if (!path) {\n error('LinkPath unsupported type: ' + _.shape + (_.orient ? '-' + _.orient : ''));\n }\n pulse.visit(pulse.SOURCE, t => {\n t[as] = path(sx(t), sy(t), tx(t), ty(t));\n });\n return pulse.reflow(_.modified()).modifies(as);\n }\n});\nconst line = (sx, sy, tx, ty) => 'M' + sx + ',' + sy + 'L' + tx + ',' + ty;\nconst lineR = (sa, sr, ta, tr) => line(sr * Math.cos(sa), sr * Math.sin(sa), tr * Math.cos(ta), tr * Math.sin(ta));\nconst arc = (sx, sy, tx, ty) => {\n var dx = tx - sx,\n dy = ty - sy,\n rr = Math.sqrt(dx * dx + dy * dy) / 2,\n ra = 180 * Math.atan2(dy, dx) / Math.PI;\n return 'M' + sx + ',' + sy + 'A' + rr + ',' + rr + ' ' + ra + ' 0 1' + ' ' + tx + ',' + ty;\n};\nconst arcR = (sa, sr, ta, tr) => arc(sr * Math.cos(sa), sr * Math.sin(sa), tr * Math.cos(ta), tr * Math.sin(ta));\nconst curve = (sx, sy, tx, ty) => {\n const dx = tx - sx,\n dy = ty - sy,\n ix = 0.2 * (dx + dy),\n iy = 0.2 * (dy - dx);\n return 'M' + sx + ',' + sy + 'C' + (sx + ix) + ',' + (sy + iy) + ' ' + (tx + iy) + ',' + (ty - ix) + ' ' + tx + ',' + ty;\n};\nconst curveR = (sa, sr, ta, tr) => curve(sr * Math.cos(sa), sr * Math.sin(sa), tr * Math.cos(ta), tr * Math.sin(ta));\nconst orthoX = (sx, sy, tx, ty) => 'M' + sx + ',' + sy + 'V' + ty + 'H' + tx;\nconst orthoY = (sx, sy, tx, ty) => 'M' + sx + ',' + sy + 'H' + tx + 'V' + ty;\nconst orthoR = (sa, sr, ta, tr) => {\n const sc = Math.cos(sa),\n ss = Math.sin(sa),\n tc = Math.cos(ta),\n ts = Math.sin(ta),\n sf = Math.abs(ta - sa) > Math.PI ? ta <= sa : ta > sa;\n return 'M' + sr * sc + ',' + sr * ss + 'A' + sr + ',' + sr + ' 0 0,' + (sf ? 1 : 0) + ' ' + sr * tc + ',' + sr * ts + 'L' + tr * tc + ',' + tr * ts;\n};\nconst diagonalX = (sx, sy, tx, ty) => {\n const m = (sx + tx) / 2;\n return 'M' + sx + ',' + sy + 'C' + m + ',' + sy + ' ' + m + ',' + ty + ' ' + tx + ',' + ty;\n};\nconst diagonalY = (sx, sy, tx, ty) => {\n const m = (sy + ty) / 2;\n return 'M' + sx + ',' + sy + 'C' + sx + ',' + m + ' ' + tx + ',' + m + ' ' + tx + ',' + ty;\n};\nconst diagonalR = (sa, sr, ta, tr) => {\n const sc = Math.cos(sa),\n ss = Math.sin(sa),\n tc = Math.cos(ta),\n ts = Math.sin(ta),\n mr = (sr + tr) / 2;\n return 'M' + sr * sc + ',' + sr * ss + 'C' + mr * sc + ',' + mr * ss + ' ' + mr * tc + ',' + mr * ts + ' ' + tr * tc + ',' + tr * ts;\n};\nconst Paths = fastmap({\n 'line': line,\n 'line-radial': lineR,\n 'arc': arc,\n 'arc-radial': arcR,\n 'curve': curve,\n 'curve-radial': curveR,\n 'orthogonal-horizontal': orthoX,\n 'orthogonal-vertical': orthoY,\n 'orthogonal-radial': orthoR,\n 'diagonal-horizontal': diagonalX,\n 'diagonal-vertical': diagonalY,\n 'diagonal-radial': diagonalR\n});\n\n/**\n * Pie and donut chart layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size pie segments.\n * @param {number} [params.startAngle=0] - The start angle (in radians) of the layout.\n * @param {number} [params.endAngle=2π] - The end angle (in radians) of the layout.\n * @param {boolean} [params.sort] - Boolean flag for sorting sectors by value.\n */\nfunction Pie(params) {\n Transform.call(this, null, params);\n}\nPie.Definition = {\n 'type': 'Pie',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'startAngle',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'endAngle',\n 'type': 'number',\n 'default': 6.283185307179586\n }, {\n 'name': 'sort',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['startAngle', 'endAngle']\n }]\n};\ninherits(Pie, Transform, {\n transform(_, pulse) {\n var as = _.as || ['startAngle', 'endAngle'],\n startAngle = as[0],\n endAngle = as[1],\n field = _.field || one,\n start = _.startAngle || 0,\n stop = _.endAngle != null ? _.endAngle : 2 * Math.PI,\n data = pulse.source,\n values = data.map(field),\n n = values.length,\n a = start,\n k = (stop - start) / sum(values),\n index = range(n),\n i,\n t,\n v;\n if (_.sort) {\n index.sort((a, b) => values[a] - values[b]);\n }\n for (i = 0; i < n; ++i) {\n v = values[index[i]];\n t = data[index[i]];\n t[startAngle] = a;\n t[endAngle] = a += v * k;\n }\n this.value = values;\n return pulse.reflow(_.modified()).modifies(as);\n }\n});\n\nconst DEFAULT_COUNT = 5;\nfunction includeZero(scale) {\n const type = scale.type;\n return !scale.bins && (type === Linear || type === Pow || type === Sqrt);\n}\nfunction includePad(type) {\n return isContinuous(type) && type !== Sequential;\n}\nconst SKIP = toSet(['set', 'modified', 'clear', 'type', 'scheme', 'schemeExtent', 'schemeCount', 'domain', 'domainMin', 'domainMid', 'domainMax', 'domainRaw', 'domainImplicit', 'nice', 'zero', 'bins', 'range', 'rangeStep', 'round', 'reverse', 'interpolate', 'interpolateGamma']);\n\n/**\n * Maintains a scale function mapping data values to visual channels.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction Scale(params) {\n Transform.call(this, null, params);\n this.modified(true); // always treat as modified\n}\n\ninherits(Scale, Transform, {\n transform(_, pulse) {\n var df = pulse.dataflow,\n scale$1 = this.value,\n key = scaleKey(_);\n if (!scale$1 || key !== scale$1.type) {\n this.value = scale$1 = scale(key)();\n }\n for (key in _) if (!SKIP[key]) {\n // padding is a scale property for band/point but not others\n if (key === 'padding' && includePad(scale$1.type)) continue;\n // invoke scale property setter, raise warning if not found\n isFunction(scale$1[key]) ? scale$1[key](_[key]) : df.warn('Unsupported scale property: ' + key);\n }\n configureRange(scale$1, _, configureBins(scale$1, _, configureDomain(scale$1, _, df)));\n return pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n }\n});\nfunction scaleKey(_) {\n var t = _.type,\n d = '',\n n;\n\n // backwards compatibility pre Vega 5.\n if (t === Sequential) return Sequential + '-' + Linear;\n if (isContinuousColor(_)) {\n n = _.rawDomain ? _.rawDomain.length : _.domain ? _.domain.length + +(_.domainMid != null) : 0;\n d = n === 2 ? Sequential + '-' : n === 3 ? Diverging + '-' : '';\n }\n return (d + t || Linear).toLowerCase();\n}\nfunction isContinuousColor(_) {\n const t = _.type;\n return isContinuous(t) && t !== Time && t !== UTC && (_.scheme || _.range && _.range.length && _.range.every(isString));\n}\nfunction configureDomain(scale, _, df) {\n // check raw domain, if provided use that and exit early\n const raw = rawDomain(scale, _.domainRaw, df);\n if (raw > -1) return raw;\n var domain = _.domain,\n type = scale.type,\n zero = _.zero || _.zero === undefined && includeZero(scale),\n n,\n mid;\n if (!domain) return 0;\n\n // adjust continuous domain for minimum pixel padding\n if (includePad(type) && _.padding && domain[0] !== peek(domain)) {\n domain = padDomain(type, domain, _.range, _.padding, _.exponent, _.constant);\n }\n\n // adjust domain based on zero, min, max settings\n if (zero || _.domainMin != null || _.domainMax != null || _.domainMid != null) {\n n = (domain = domain.slice()).length - 1 || 1;\n if (zero) {\n if (domain[0] > 0) domain[0] = 0;\n if (domain[n] < 0) domain[n] = 0;\n }\n if (_.domainMin != null) domain[0] = _.domainMin;\n if (_.domainMax != null) domain[n] = _.domainMax;\n if (_.domainMid != null) {\n mid = _.domainMid;\n const i = mid > domain[n] ? n + 1 : mid < domain[0] ? 0 : n;\n if (i !== n) df.warn('Scale domainMid exceeds domain min or max.', mid);\n domain.splice(i, 0, mid);\n }\n }\n\n // set the scale domain\n scale.domain(domainCheck(type, domain, df));\n\n // if ordinal scale domain is defined, prevent implicit\n // domain construction as side-effect of scale lookup\n if (type === Ordinal) {\n scale.unknown(_.domainImplicit ? scaleImplicit : undefined);\n }\n\n // perform 'nice' adjustment as requested\n if (_.nice && scale.nice) {\n scale.nice(_.nice !== true && tickCount(scale, _.nice) || null);\n }\n\n // return the cardinality of the domain\n return domain.length;\n}\nfunction rawDomain(scale, raw, df) {\n if (raw) {\n scale.domain(domainCheck(scale.type, raw, df));\n return raw.length;\n } else {\n return -1;\n }\n}\nfunction padDomain(type, domain, range, pad, exponent, constant) {\n var span = Math.abs(peek(range) - range[0]),\n frac = span / (span - 2 * pad),\n d = type === Log ? zoomLog(domain, null, frac) : type === Sqrt ? zoomPow(domain, null, frac, 0.5) : type === Pow ? zoomPow(domain, null, frac, exponent || 1) : type === Symlog ? zoomSymlog(domain, null, frac, constant || 1) : zoomLinear(domain, null, frac);\n domain = domain.slice();\n domain[0] = d[0];\n domain[domain.length - 1] = d[1];\n return domain;\n}\nfunction domainCheck(type, domain, df) {\n if (isLogarithmic(type)) {\n // sum signs of domain values\n // if all pos or all neg, abs(sum) === domain.length\n var s = Math.abs(domain.reduce((s, v) => s + (v < 0 ? -1 : v > 0 ? 1 : 0), 0));\n if (s !== domain.length) {\n df.warn('Log scale domain includes zero: ' + stringValue(domain));\n }\n }\n return domain;\n}\nfunction configureBins(scale, _, count) {\n let bins = _.bins;\n if (bins && !isArray(bins)) {\n // generate bin boundary array\n const domain = scale.domain(),\n lo = domain[0],\n hi = peek(domain),\n step = bins.step;\n let start = bins.start == null ? lo : bins.start,\n stop = bins.stop == null ? hi : bins.stop;\n if (!step) error('Scale bins parameter missing step property.');\n if (start < lo) start = step * Math.ceil(lo / step);\n if (stop > hi) stop = step * Math.floor(hi / step);\n bins = range(start, stop + step / 2, step);\n }\n if (bins) {\n // assign bin boundaries to scale instance\n scale.bins = bins;\n } else if (scale.bins) {\n // no current bins, remove bins if previously set\n delete scale.bins;\n }\n\n // special handling for bin-ordinal scales\n if (scale.type === BinOrdinal) {\n if (!bins) {\n // the domain specifies the bins\n scale.bins = scale.domain();\n } else if (!_.domain && !_.domainRaw) {\n // the bins specify the domain\n scale.domain(bins);\n count = bins.length;\n }\n }\n\n // return domain cardinality\n return count;\n}\nfunction configureRange(scale, _, count) {\n var type = scale.type,\n round = _.round || false,\n range = _.range;\n\n // if range step specified, calculate full range extent\n if (_.rangeStep != null) {\n range = configureRangeStep(type, _, count);\n }\n\n // else if a range scheme is defined, use that\n else if (_.scheme) {\n range = configureScheme(type, _, count);\n if (isFunction(range)) {\n if (scale.interpolator) {\n return scale.interpolator(range);\n } else {\n error(`Scale type ${type} does not support interpolating color schemes.`);\n }\n }\n }\n\n // given a range array for an interpolating scale, convert to interpolator\n if (range && isInterpolating(type)) {\n return scale.interpolator(interpolateColors(flip(range, _.reverse), _.interpolate, _.interpolateGamma));\n }\n\n // configure rounding / interpolation\n if (range && _.interpolate && scale.interpolate) {\n scale.interpolate(interpolate(_.interpolate, _.interpolateGamma));\n } else if (isFunction(scale.round)) {\n scale.round(round);\n } else if (isFunction(scale.rangeRound)) {\n scale.interpolate(round ? interpolateRound : interpolate$1);\n }\n if (range) scale.range(flip(range, _.reverse));\n}\nfunction configureRangeStep(type, _, count) {\n if (type !== Band && type !== Point) {\n error('Only band and point scales support rangeStep.');\n }\n\n // calculate full range based on requested step size and padding\n var outer = (_.paddingOuter != null ? _.paddingOuter : _.padding) || 0,\n inner = type === Point ? 1 : (_.paddingInner != null ? _.paddingInner : _.padding) || 0;\n return [0, _.rangeStep * bandSpace(count, inner, outer)];\n}\nfunction configureScheme(type, _, count) {\n var extent = _.schemeExtent,\n name,\n scheme$1;\n if (isArray(_.scheme)) {\n scheme$1 = interpolateColors(_.scheme, _.interpolate, _.interpolateGamma);\n } else {\n name = _.scheme.toLowerCase();\n scheme$1 = scheme(name);\n if (!scheme$1) error(`Unrecognized scheme name: ${_.scheme}`);\n }\n\n // determine size for potential discrete range\n count = type === Threshold ? count + 1 : type === BinOrdinal ? count - 1 : type === Quantile || type === Quantize ? +_.schemeCount || DEFAULT_COUNT : count;\n\n // adjust and/or quantize scheme as appropriate\n return isInterpolating(type) ? adjustScheme(scheme$1, extent, _.reverse) : isFunction(scheme$1) ? quantizeInterpolator(adjustScheme(scheme$1, extent), count) : type === Ordinal ? scheme$1 : scheme$1.slice(0, count);\n}\nfunction adjustScheme(scheme, extent, reverse) {\n return isFunction(scheme) && (extent || reverse) ? interpolateRange(scheme, flip(extent || [0, 1], reverse)) : scheme;\n}\nfunction flip(array, reverse) {\n return reverse ? array.slice().reverse() : array;\n}\n\n/**\n * Sorts scenegraph items in the pulse source array.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - A comparator\n * function for sorting tuples.\n */\nfunction SortItems(params) {\n Transform.call(this, null, params);\n}\ninherits(SortItems, Transform, {\n transform(_, pulse) {\n const mod = _.modified('sort') || pulse.changed(pulse.ADD) || pulse.modified(_.sort.fields) || pulse.modified('datum');\n if (mod) pulse.source.sort(stableCompare(_.sort));\n this.modified(mod);\n return pulse;\n }\n});\n\nconst Zero = 'zero',\n Center = 'center',\n Normalize = 'normalize',\n DefOutput = ['y0', 'y1'];\n\n/**\n * Stack layout for visualization elements.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to stack.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {function(object,object): number} [params.sort] - A comparator for stack sorting.\n * @param {string} [offset='zero'] - Stack baseline offset. One of 'zero', 'center', 'normalize'.\n */\nfunction Stack(params) {\n Transform.call(this, null, params);\n}\nStack.Definition = {\n 'type': 'Stack',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'offset',\n 'type': 'enum',\n 'default': Zero,\n 'values': [Zero, Center, Normalize]\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': DefOutput\n }]\n};\ninherits(Stack, Transform, {\n transform(_, pulse) {\n var as = _.as || DefOutput,\n y0 = as[0],\n y1 = as[1],\n sort = stableCompare(_.sort),\n field = _.field || one,\n stack = _.offset === Center ? stackCenter : _.offset === Normalize ? stackNormalize : stackZero,\n groups,\n i,\n n,\n max;\n\n // partition, sum, and sort the stack groups\n groups = partition(pulse.source, _.groupby, sort, field);\n\n // compute stack layouts per group\n for (i = 0, n = groups.length, max = groups.max; i < n; ++i) {\n stack(groups[i], max, field, y0, y1);\n }\n return pulse.reflow(_.modified()).modifies(as);\n }\n});\nfunction stackCenter(group, max, field, y0, y1) {\n var last = (max - group.sum) / 2,\n m = group.length,\n j = 0,\n t;\n for (; j < m; ++j) {\n t = group[j];\n t[y0] = last;\n t[y1] = last += Math.abs(field(t));\n }\n}\nfunction stackNormalize(group, max, field, y0, y1) {\n var scale = 1 / group.sum,\n last = 0,\n m = group.length,\n j = 0,\n v = 0,\n t;\n for (; j < m; ++j) {\n t = group[j];\n t[y0] = last;\n t[y1] = last = scale * (v += Math.abs(field(t)));\n }\n}\nfunction stackZero(group, max, field, y0, y1) {\n var lastPos = 0,\n lastNeg = 0,\n m = group.length,\n j = 0,\n v,\n t;\n for (; j < m; ++j) {\n t = group[j];\n v = +field(t);\n if (v < 0) {\n t[y0] = lastNeg;\n t[y1] = lastNeg += v;\n } else {\n t[y0] = lastPos;\n t[y1] = lastPos += v;\n }\n }\n}\nfunction partition(data, groupby, sort, field) {\n var groups = [],\n get = f => f(t),\n map,\n i,\n n,\n m,\n t,\n k,\n g,\n s,\n max;\n\n // partition data points into stack groups\n if (groupby == null) {\n groups.push(data.slice());\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n if (!g) {\n map[k] = g = [];\n groups.push(g);\n }\n g.push(t);\n }\n }\n\n // compute sums of groups, sort groups as needed\n for (k = 0, max = 0, m = groups.length; k < m; ++k) {\n g = groups[k];\n for (i = 0, s = 0, n = g.length; i < n; ++i) {\n s += Math.abs(field(g[i]));\n }\n g.sum = s;\n if (s > max) max = s;\n if (sort) g.sort(sort);\n }\n groups.max = max;\n return groups;\n}\n\nexport { AxisTicks as axisticks, DataJoin as datajoin, Encode as encode, LegendEntries as legendentries, LinkPath as linkpath, Pie as pie, Scale as scale, SortItems as sortitems, Stack as stack };\n","export default x => x;\n","function streamGeometry(geometry, stream) {\n if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {\n streamGeometryType[geometry.type](geometry, stream);\n }\n}\n\nvar streamObjectType = {\n Feature: function(object, stream) {\n streamGeometry(object.geometry, stream);\n },\n FeatureCollection: function(object, stream) {\n var features = object.features, i = -1, n = features.length;\n while (++i < n) streamGeometry(features[i].geometry, stream);\n }\n};\n\nvar streamGeometryType = {\n Sphere: function(object, stream) {\n stream.sphere();\n },\n Point: function(object, stream) {\n object = object.coordinates;\n stream.point(object[0], object[1], object[2]);\n },\n MultiPoint: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]);\n },\n LineString: function(object, stream) {\n streamLine(object.coordinates, stream, 0);\n },\n MultiLineString: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamLine(coordinates[i], stream, 0);\n },\n Polygon: function(object, stream) {\n streamPolygon(object.coordinates, stream);\n },\n MultiPolygon: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamPolygon(coordinates[i], stream);\n },\n GeometryCollection: function(object, stream) {\n var geometries = object.geometries, i = -1, n = geometries.length;\n while (++i < n) streamGeometry(geometries[i], stream);\n }\n};\n\nfunction streamLine(coordinates, stream, closed) {\n var i = -1, n = coordinates.length - closed, coordinate;\n stream.lineStart();\n while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);\n stream.lineEnd();\n}\n\nfunction streamPolygon(coordinates, stream) {\n var i = -1, n = coordinates.length;\n stream.polygonStart();\n while (++i < n) streamLine(coordinates[i], stream, 1);\n stream.polygonEnd();\n}\n\nexport default function(object, stream) {\n if (object && streamObjectType.hasOwnProperty(object.type)) {\n streamObjectType[object.type](object, stream);\n } else {\n streamGeometry(object, stream);\n }\n}\n","// https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423\nexport class Adder {\n constructor() {\n this._partials = new Float64Array(32);\n this._n = 0;\n }\n add(x) {\n const p = this._partials;\n let i = 0;\n for (let j = 0; j < this._n && j < 32; j++) {\n const y = p[j],\n hi = x + y,\n lo = Math.abs(x) < Math.abs(y) ? x - (hi - y) : y - (hi - x);\n if (lo) p[i++] = lo;\n x = hi;\n }\n p[i] = x;\n this._n = i + 1;\n return this;\n }\n valueOf() {\n const p = this._partials;\n let n = this._n, x, y, lo, hi = 0;\n if (n > 0) {\n hi = p[--n];\n while (n > 0) {\n x = hi;\n y = p[--n];\n hi = x + y;\n lo = y - (hi - x);\n if (lo) break;\n }\n if (n > 0 && ((lo < 0 && p[n - 1] < 0) || (lo > 0 && p[n - 1] > 0))) {\n y = lo * 2;\n x = hi + y;\n if (y == x - hi) hi = x;\n }\n }\n return hi;\n }\n}\n\nexport function fsum(values, valueof) {\n const adder = new Adder();\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n adder.add(value);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n adder.add(value);\n }\n }\n }\n return +adder;\n}\n\nexport function fcumsum(values, valueof) {\n const adder = new Adder();\n let index = -1;\n return Float64Array.from(values, valueof === undefined\n ? v => adder.add(+v || 0)\n : v => adder.add(+valueof(v, ++index, values) || 0)\n );\n}\n","export var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var tau = pi * 2;\n\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var ceil = Math.ceil;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var hypot = Math.hypot;\nexport var log = Math.log;\nexport var pow = Math.pow;\nexport var sin = Math.sin;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sqrt = Math.sqrt;\nexport var tan = Math.tan;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);\n}\n\nexport function haversin(x) {\n return (x = sin(x / 2)) * x;\n}\n","export default function noop() {}\n","import {Adder} from \"d3-array\";\nimport {abs} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar areaSum = new Adder(),\n areaRingSum = new Adder(),\n x00,\n y00,\n x0,\n y0;\n\nvar areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n areaStream.lineStart = areaStream.lineEnd = areaStream.point = noop;\n areaSum.add(abs(areaRingSum));\n areaRingSum = new Adder();\n },\n result: function() {\n var area = areaSum / 2;\n areaSum = new Adder();\n return area;\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaPointFirst(x, y) {\n areaStream.point = areaPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction areaPoint(x, y) {\n areaRingSum.add(y0 * x - x0 * y);\n x0 = x, y0 = y;\n}\n\nfunction areaRingEnd() {\n areaPoint(x00, y00);\n}\n\nexport default areaStream;\n","import noop from \"../noop.js\";\n\nvar x0 = Infinity,\n y0 = x0,\n x1 = -x0,\n y1 = x1;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop,\n result: function() {\n var bounds = [[x0, y0], [x1, y1]];\n x1 = y1 = -(y0 = x0 = Infinity);\n return bounds;\n }\n};\n\nfunction boundsPoint(x, y) {\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n}\n\nexport default boundsStream;\n","import {sqrt} from \"../math.js\";\n\n// TODO Enforce positive area for exterior, negative area for interior?\n\nvar X0 = 0,\n Y0 = 0,\n Z0 = 0,\n X1 = 0,\n Y1 = 0,\n Z1 = 0,\n X2 = 0,\n Y2 = 0,\n Z2 = 0,\n x00,\n y00,\n x0,\n y0;\n\nvar centroidStream = {\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.point = centroidPoint;\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n },\n result: function() {\n var centroid = Z2 ? [X2 / Z2, Y2 / Z2]\n : Z1 ? [X1 / Z1, Y1 / Z1]\n : Z0 ? [X0 / Z0, Y0 / Z0]\n : [NaN, NaN];\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 =\n X2 = Y2 = Z2 = 0;\n return centroid;\n }\n};\n\nfunction centroidPoint(x, y) {\n X0 += x;\n Y0 += y;\n ++Z0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidPointFirstLine;\n}\n\nfunction centroidPointFirstLine(x, y) {\n centroidStream.point = centroidPointLine;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidPointLine(x, y) {\n var dx = x - x0, dy = y - y0, z = sqrt(dx * dx + dy * dy);\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingStart() {\n centroidStream.point = centroidPointFirstRing;\n}\n\nfunction centroidRingEnd() {\n centroidPointRing(x00, y00);\n}\n\nfunction centroidPointFirstRing(x, y) {\n centroidStream.point = centroidPointRing;\n centroidPoint(x00 = x0 = x, y00 = y0 = y);\n}\n\nfunction centroidPointRing(x, y) {\n var dx = x - x0,\n dy = y - y0,\n z = sqrt(dx * dx + dy * dy);\n\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n\n z = y0 * x - x0 * y;\n X2 += z * (x0 + x);\n Y2 += z * (y0 + y);\n Z2 += z * 3;\n centroidPoint(x0 = x, y0 = y);\n}\n\nexport default centroidStream;\n","import {tau} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nexport default function PathContext(context) {\n this._context = context;\n}\n\nPathContext.prototype = {\n _radius: 4.5,\n pointRadius: function(_) {\n return this._radius = _, this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._context.closePath();\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._context.moveTo(x, y);\n this._point = 1;\n break;\n }\n case 1: {\n this._context.lineTo(x, y);\n break;\n }\n default: {\n this._context.moveTo(x + this._radius, y);\n this._context.arc(x, y, this._radius, 0, tau);\n break;\n }\n }\n },\n result: noop\n};\n","import {Adder} from \"d3-array\";\nimport {sqrt} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar lengthSum = new Adder(),\n lengthRing,\n x00,\n y00,\n x0,\n y0;\n\nvar lengthStream = {\n point: noop,\n lineStart: function() {\n lengthStream.point = lengthPointFirst;\n },\n lineEnd: function() {\n if (lengthRing) lengthPoint(x00, y00);\n lengthStream.point = noop;\n },\n polygonStart: function() {\n lengthRing = true;\n },\n polygonEnd: function() {\n lengthRing = null;\n },\n result: function() {\n var length = +lengthSum;\n lengthSum = new Adder();\n return length;\n }\n};\n\nfunction lengthPointFirst(x, y) {\n lengthStream.point = lengthPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction lengthPoint(x, y) {\n x0 -= x, y0 -= y;\n lengthSum.add(sqrt(x0 * x0 + y0 * y0));\n x0 = x, y0 = y;\n}\n\nexport default lengthStream;\n","// Simple caching for constant-radius points.\nlet cacheDigits, cacheAppend, cacheRadius, cacheCircle;\n\nexport default class PathString {\n constructor(digits) {\n this._append = digits == null ? append : appendRound(digits);\n this._radius = 4.5;\n this._ = \"\";\n }\n pointRadius(_) {\n this._radius = +_;\n return this;\n }\n polygonStart() {\n this._line = 0;\n }\n polygonEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line === 0) this._ += \"Z\";\n this._point = NaN;\n }\n point(x, y) {\n switch (this._point) {\n case 0: {\n this._append`M${x},${y}`;\n this._point = 1;\n break;\n }\n case 1: {\n this._append`L${x},${y}`;\n break;\n }\n default: {\n this._append`M${x},${y}`;\n if (this._radius !== cacheRadius || this._append !== cacheAppend) {\n const r = this._radius;\n const s = this._;\n this._ = \"\"; // stash the old string so we can cache the circle path fragment\n this._append`m0,${r}a${r},${r} 0 1,1 0,${-2 * r}a${r},${r} 0 1,1 0,${2 * r}z`;\n cacheRadius = r;\n cacheAppend = this._append;\n cacheCircle = this._;\n this._ = s;\n }\n this._ += cacheCircle;\n break;\n }\n }\n }\n result() {\n const result = this._;\n this._ = \"\";\n return result.length ? result : null;\n }\n}\n\nfunction append(strings) {\n let i = 1;\n this._ += strings[0];\n for (const j = strings.length; i < j; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n const d = Math.floor(digits);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${digits}`);\n if (d > 15) return append;\n if (d !== cacheDigits) {\n const k = 10 ** d;\n cacheDigits = d;\n cacheAppend = function append(strings) {\n let i = 1;\n this._ += strings[0];\n for (const j = strings.length; i < j; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n }\n return cacheAppend;\n}\n","import identity from \"../identity.js\";\nimport stream from \"../stream.js\";\nimport pathArea from \"./area.js\";\nimport pathBounds from \"./bounds.js\";\nimport pathCentroid from \"./centroid.js\";\nimport PathContext from \"./context.js\";\nimport pathMeasure from \"./measure.js\";\nimport PathString from \"./string.js\";\n\nexport default function(projection, context) {\n let digits = 3,\n pointRadius = 4.5,\n projectionStream,\n contextStream;\n\n function path(object) {\n if (object) {\n if (typeof pointRadius === \"function\") contextStream.pointRadius(+pointRadius.apply(this, arguments));\n stream(object, projectionStream(contextStream));\n }\n return contextStream.result();\n }\n\n path.area = function(object) {\n stream(object, projectionStream(pathArea));\n return pathArea.result();\n };\n\n path.measure = function(object) {\n stream(object, projectionStream(pathMeasure));\n return pathMeasure.result();\n };\n\n path.bounds = function(object) {\n stream(object, projectionStream(pathBounds));\n return pathBounds.result();\n };\n\n path.centroid = function(object) {\n stream(object, projectionStream(pathCentroid));\n return pathCentroid.result();\n };\n\n path.projection = function(_) {\n if (!arguments.length) return projection;\n projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream;\n return path;\n };\n\n path.context = function(_) {\n if (!arguments.length) return context;\n contextStream = _ == null ? (context = null, new PathString(digits)) : new PathContext(context = _);\n if (typeof pointRadius !== \"function\") contextStream.pointRadius(pointRadius);\n return path;\n };\n\n path.pointRadius = function(_) {\n if (!arguments.length) return pointRadius;\n pointRadius = typeof _ === \"function\" ? _ : (contextStream.pointRadius(+_), +_);\n return path;\n };\n\n path.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) digits = null;\n else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n if (context === null) contextStream = new PathString(digits);\n return path;\n };\n\n return path.projection(projection).digits(digits).context(context);\n}\n","import noop from \"../noop.js\";\n\nexport default function() {\n var lines = [],\n line;\n return {\n point: function(x, y, m) {\n line.push([x, y, m]);\n },\n lineStart: function() {\n lines.push(line = []);\n },\n lineEnd: noop,\n rejoin: function() {\n if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));\n },\n result: function() {\n var result = lines;\n lines = [];\n line = null;\n return result;\n }\n };\n}\n","import {abs, epsilon} from \"./math.js\";\n\nexport default function(a, b) {\n return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;\n}\n","import pointEqual from \"../pointEqual.js\";\nimport {epsilon} from \"../math.js\";\n\nfunction Intersection(point, points, other, entry) {\n this.x = point;\n this.z = points;\n this.o = other; // another intersection\n this.e = entry; // is an entry?\n this.v = false; // visited\n this.n = this.p = null; // next & previous\n}\n\n// A generalized polygon clipping algorithm: given a polygon that has been cut\n// into its visible line segments, and rejoins the segments by interpolating\n// along the clip edge.\nexport default function(segments, compareIntersection, startInside, interpolate, stream) {\n var subject = [],\n clip = [],\n i,\n n;\n\n segments.forEach(function(segment) {\n if ((n = segment.length - 1) <= 0) return;\n var n, p0 = segment[0], p1 = segment[n], x;\n\n if (pointEqual(p0, p1)) {\n if (!p0[2] && !p1[2]) {\n stream.lineStart();\n for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);\n stream.lineEnd();\n return;\n }\n // handle degenerate cases by moving the point\n p1[0] += 2 * epsilon;\n }\n\n subject.push(x = new Intersection(p0, segment, null, true));\n clip.push(x.o = new Intersection(p0, null, x, false));\n subject.push(x = new Intersection(p1, segment, null, false));\n clip.push(x.o = new Intersection(p1, null, x, true));\n });\n\n if (!subject.length) return;\n\n clip.sort(compareIntersection);\n link(subject);\n link(clip);\n\n for (i = 0, n = clip.length; i < n; ++i) {\n clip[i].e = startInside = !startInside;\n }\n\n var start = subject[0],\n points,\n point;\n\n while (1) {\n // Find first unvisited intersection.\n var current = start,\n isSubject = true;\n while (current.v) if ((current = current.n) === start) return;\n points = current.z;\n stream.lineStart();\n do {\n current.v = current.o.v = true;\n if (current.e) {\n if (isSubject) {\n for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.n.x, 1, stream);\n }\n current = current.n;\n } else {\n if (isSubject) {\n points = current.p.z;\n for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.p.x, -1, stream);\n }\n current = current.p;\n }\n current = current.o;\n points = current.z;\n isSubject = !isSubject;\n } while (!current.v);\n stream.lineEnd();\n }\n}\n\nfunction link(array) {\n if (!(n = array.length)) return;\n var n,\n i = 0,\n a = array[0],\n b;\n while (++i < n) {\n a.n = b = array[i];\n b.p = a;\n a = b;\n }\n a.n = b = array[0];\n b.p = a;\n}\n","import {asin, atan2, cos, sin, sqrt} from \"./math.js\";\n\nexport function spherical(cartesian) {\n return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])];\n}\n\nexport function cartesian(spherical) {\n var lambda = spherical[0], phi = spherical[1], cosPhi = cos(phi);\n return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];\n}\n\nexport function cartesianDot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n\nexport function cartesianCross(a, b) {\n return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];\n}\n\n// TODO return a\nexport function cartesianAddInPlace(a, b) {\n a[0] += b[0], a[1] += b[1], a[2] += b[2];\n}\n\nexport function cartesianScale(vector, k) {\n return [vector[0] * k, vector[1] * k, vector[2] * k];\n}\n\n// TODO return d\nexport function cartesianNormalizeInPlace(d) {\n var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);\n d[0] /= l, d[1] /= l, d[2] /= l;\n}\n","import {Adder} from \"d3-array\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace} from \"./cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, epsilon2, halfPi, pi, quarterPi, sign, sin, tau} from \"./math.js\";\n\nfunction longitude(point) {\n return abs(point[0]) <= pi ? point[0] : sign(point[0]) * ((abs(point[0]) + pi) % tau - pi);\n}\n\nexport default function(polygon, point) {\n var lambda = longitude(point),\n phi = point[1],\n sinPhi = sin(phi),\n normal = [sin(lambda), -cos(lambda), 0],\n angle = 0,\n winding = 0;\n\n var sum = new Adder();\n\n if (sinPhi === 1) phi = halfPi + epsilon;\n else if (sinPhi === -1) phi = -halfPi - epsilon;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n if (!(m = (ring = polygon[i]).length)) continue;\n var ring,\n m,\n point0 = ring[m - 1],\n lambda0 = longitude(point0),\n phi0 = point0[1] / 2 + quarterPi,\n sinPhi0 = sin(phi0),\n cosPhi0 = cos(phi0);\n\n for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {\n var point1 = ring[j],\n lambda1 = longitude(point1),\n phi1 = point1[1] / 2 + quarterPi,\n sinPhi1 = sin(phi1),\n cosPhi1 = cos(phi1),\n delta = lambda1 - lambda0,\n sign = delta >= 0 ? 1 : -1,\n absDelta = sign * delta,\n antimeridian = absDelta > pi,\n k = sinPhi0 * sinPhi1;\n\n sum.add(atan2(k * sign * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta)));\n angle += antimeridian ? delta + sign * tau : delta;\n\n // Are the longitudes either side of the point’s meridian (lambda),\n // and are the latitudes smaller than the parallel (phi)?\n if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {\n var arc = cartesianCross(cartesian(point0), cartesian(point1));\n cartesianNormalizeInPlace(arc);\n var intersection = cartesianCross(normal, arc);\n cartesianNormalizeInPlace(intersection);\n var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);\n if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {\n winding += antimeridian ^ delta >= 0 ? 1 : -1;\n }\n }\n }\n }\n\n // First, determine whether the South pole is inside or outside:\n //\n // It is inside if:\n // * the polygon winds around it in a clockwise direction.\n // * the polygon does not (cumulatively) wind around it, but has a negative\n // (counter-clockwise) area.\n //\n // Second, count the (signed) number of times a segment crosses a lambda\n // from the point to the South pole. If it is zero, then the point is the\n // same side as the South pole.\n\n return (angle < -epsilon || angle < epsilon && sum < -epsilon2) ^ (winding & 1);\n}\n","function* flatten(arrays) {\n for (const array of arrays) {\n yield* array;\n }\n}\n\nexport default function merge(arrays) {\n return Array.from(flatten(arrays));\n}\n","import clipBuffer from \"./buffer.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {epsilon, halfPi} from \"../math.js\";\nimport polygonContains from \"../polygonContains.js\";\nimport {merge} from \"d3-array\";\n\nexport default function(pointVisible, clipLine, interpolate, start) {\n return function(sink) {\n var line = clipLine(sink),\n ringBuffer = clipBuffer(),\n ringSink = clipLine(ringBuffer),\n polygonStarted = false,\n polygon,\n segments,\n ring;\n\n var clip = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() {\n clip.point = pointRing;\n clip.lineStart = ringStart;\n clip.lineEnd = ringEnd;\n segments = [];\n polygon = [];\n },\n polygonEnd: function() {\n clip.point = point;\n clip.lineStart = lineStart;\n clip.lineEnd = lineEnd;\n segments = merge(segments);\n var startInside = polygonContains(polygon, start);\n if (segments.length) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n clipRejoin(segments, compareIntersection, startInside, interpolate, sink);\n } else if (startInside) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n }\n if (polygonStarted) sink.polygonEnd(), polygonStarted = false;\n segments = polygon = null;\n },\n sphere: function() {\n sink.polygonStart();\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n sink.polygonEnd();\n }\n };\n\n function point(lambda, phi) {\n if (pointVisible(lambda, phi)) sink.point(lambda, phi);\n }\n\n function pointLine(lambda, phi) {\n line.point(lambda, phi);\n }\n\n function lineStart() {\n clip.point = pointLine;\n line.lineStart();\n }\n\n function lineEnd() {\n clip.point = point;\n line.lineEnd();\n }\n\n function pointRing(lambda, phi) {\n ring.push([lambda, phi]);\n ringSink.point(lambda, phi);\n }\n\n function ringStart() {\n ringSink.lineStart();\n ring = [];\n }\n\n function ringEnd() {\n pointRing(ring[0][0], ring[0][1]);\n ringSink.lineEnd();\n\n var clean = ringSink.clean(),\n ringSegments = ringBuffer.result(),\n i, n = ringSegments.length, m,\n segment,\n point;\n\n ring.pop();\n polygon.push(ring);\n ring = null;\n\n if (!n) return;\n\n // No intersections.\n if (clean & 1) {\n segment = ringSegments[0];\n if ((m = segment.length - 1) > 0) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n for (i = 0; i < m; ++i) sink.point((point = segment[i])[0], point[1]);\n sink.lineEnd();\n }\n return;\n }\n\n // Rejoin connected segments.\n // TODO reuse ringBuffer.rejoin()?\n if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));\n\n segments.push(ringSegments.filter(validSegment));\n }\n\n return clip;\n };\n}\n\nfunction validSegment(segment) {\n return segment.length > 1;\n}\n\n// Intersections are sorted along the clip edge. For both antimeridian cutting\n// and circle clipping, the same comparison is used.\nfunction compareIntersection(a, b) {\n return ((a = a.x)[0] < 0 ? a[1] - halfPi - epsilon : halfPi - a[1])\n - ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon : halfPi - b[1]);\n}\n","import clip from \"./index.js\";\nimport {abs, atan, cos, epsilon, halfPi, pi, sin} from \"../math.js\";\n\nexport default clip(\n function() { return true; },\n clipAntimeridianLine,\n clipAntimeridianInterpolate,\n [-pi, -halfPi]\n);\n\n// Takes a line and cuts into visible segments. Return values: 0 - there were\n// intersections or the line was empty; 1 - no intersections; 2 - there were\n// intersections, and the first and last segments should be rejoined.\nfunction clipAntimeridianLine(stream) {\n var lambda0 = NaN,\n phi0 = NaN,\n sign0 = NaN,\n clean; // no intersections\n\n return {\n lineStart: function() {\n stream.lineStart();\n clean = 1;\n },\n point: function(lambda1, phi1) {\n var sign1 = lambda1 > 0 ? pi : -pi,\n delta = abs(lambda1 - lambda0);\n if (abs(delta - pi) < epsilon) { // line crosses a pole\n stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n stream.point(lambda1, phi0);\n clean = 0;\n } else if (sign0 !== sign1 && delta >= pi) { // line crosses antimeridian\n if (abs(lambda0 - sign0) < epsilon) lambda0 -= sign0 * epsilon; // handle degeneracies\n if (abs(lambda1 - sign1) < epsilon) lambda1 -= sign1 * epsilon;\n phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n clean = 0;\n }\n stream.point(lambda0 = lambda1, phi0 = phi1);\n sign0 = sign1;\n },\n lineEnd: function() {\n stream.lineEnd();\n lambda0 = phi0 = NaN;\n },\n clean: function() {\n return 2 - clean; // if intersections, rejoin first and last segments\n }\n };\n}\n\nfunction clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) {\n var cosPhi0,\n cosPhi1,\n sinLambda0Lambda1 = sin(lambda0 - lambda1);\n return abs(sinLambda0Lambda1) > epsilon\n ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1)\n - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0))\n / (cosPhi0 * cosPhi1 * sinLambda0Lambda1))\n : (phi0 + phi1) / 2;\n}\n\nfunction clipAntimeridianInterpolate(from, to, direction, stream) {\n var phi;\n if (from == null) {\n phi = direction * halfPi;\n stream.point(-pi, phi);\n stream.point(0, phi);\n stream.point(pi, phi);\n stream.point(pi, 0);\n stream.point(pi, -phi);\n stream.point(0, -phi);\n stream.point(-pi, -phi);\n stream.point(-pi, 0);\n stream.point(-pi, phi);\n } else if (abs(from[0] - to[0]) > epsilon) {\n var lambda = from[0] < to[0] ? pi : -pi;\n phi = direction * lambda / 2;\n stream.point(-lambda, phi);\n stream.point(0, phi);\n stream.point(lambda, phi);\n } else {\n stream.point(to[0], to[1]);\n }\n}\n","import {cartesian, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport constant from \"./constant.js\";\nimport {acos, cos, degrees, epsilon, radians, sin, tau} from \"./math.js\";\nimport {rotateRadians} from \"./rotation.js\";\n\n// Generates a circle centered at [0°, 0°], with a given radius and precision.\nexport function circleStream(stream, radius, delta, direction, t0, t1) {\n if (!delta) return;\n var cosRadius = cos(radius),\n sinRadius = sin(radius),\n step = direction * delta;\n if (t0 == null) {\n t0 = radius + direction * tau;\n t1 = radius - step / 2;\n } else {\n t0 = circleRadius(cosRadius, t0);\n t1 = circleRadius(cosRadius, t1);\n if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau;\n }\n for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) {\n point = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * sin(t)]);\n stream.point(point[0], point[1]);\n }\n}\n\n// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0].\nfunction circleRadius(cosRadius, point) {\n point = cartesian(point), point[0] -= cosRadius;\n cartesianNormalizeInPlace(point);\n var radius = acos(-point[1]);\n return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;\n}\n\nexport default function() {\n var center = constant([0, 0]),\n radius = constant(90),\n precision = constant(6),\n ring,\n rotate,\n stream = {point: point};\n\n function point(x, y) {\n ring.push(x = rotate(x, y));\n x[0] *= degrees, x[1] *= degrees;\n }\n\n function circle() {\n var c = center.apply(this, arguments),\n r = radius.apply(this, arguments) * radians,\n p = precision.apply(this, arguments) * radians;\n ring = [];\n rotate = rotateRadians(-c[0] * radians, -c[1] * radians, 0).invert;\n circleStream(stream, r, p, 1);\n c = {type: \"Polygon\", coordinates: [ring]};\n ring = rotate = null;\n return c;\n }\n\n circle.center = function(_) {\n return arguments.length ? (center = typeof _ === \"function\" ? _ : constant([+_[0], +_[1]]), circle) : center;\n };\n\n circle.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), circle) : radius;\n };\n\n circle.precision = function(_) {\n return arguments.length ? (precision = typeof _ === \"function\" ? _ : constant(+_), circle) : precision;\n };\n\n return circle;\n}\n","import {abs, epsilon} from \"../math.js\";\nimport clipBuffer from \"./buffer.js\";\nimport clipLine from \"./line.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {merge} from \"d3-array\";\n\nvar clipMax = 1e9, clipMin = -clipMax;\n\n// TODO Use d3-polygon’s polygonContains here for the ring check?\n// TODO Eliminate duplicate buffering in clipBuffer and polygon.push?\n\nexport default function clipRectangle(x0, y0, x1, y1) {\n\n function visible(x, y) {\n return x0 <= x && x <= x1 && y0 <= y && y <= y1;\n }\n\n function interpolate(from, to, direction, stream) {\n var a = 0, a1 = 0;\n if (from == null\n || (a = corner(from, direction)) !== (a1 = corner(to, direction))\n || comparePoint(from, to) < 0 ^ direction > 0) {\n do stream.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);\n while ((a = (a + direction + 4) % 4) !== a1);\n } else {\n stream.point(to[0], to[1]);\n }\n }\n\n function corner(p, direction) {\n return abs(p[0] - x0) < epsilon ? direction > 0 ? 0 : 3\n : abs(p[0] - x1) < epsilon ? direction > 0 ? 2 : 1\n : abs(p[1] - y0) < epsilon ? direction > 0 ? 1 : 0\n : direction > 0 ? 3 : 2; // abs(p[1] - y1) < epsilon\n }\n\n function compareIntersection(a, b) {\n return comparePoint(a.x, b.x);\n }\n\n function comparePoint(a, b) {\n var ca = corner(a, 1),\n cb = corner(b, 1);\n return ca !== cb ? ca - cb\n : ca === 0 ? b[1] - a[1]\n : ca === 1 ? a[0] - b[0]\n : ca === 2 ? a[1] - b[1]\n : b[0] - a[0];\n }\n\n return function(stream) {\n var activeStream = stream,\n bufferStream = clipBuffer(),\n segments,\n polygon,\n ring,\n x__, y__, v__, // first point\n x_, y_, v_, // previous point\n first,\n clean;\n\n var clipStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: polygonStart,\n polygonEnd: polygonEnd\n };\n\n function point(x, y) {\n if (visible(x, y)) activeStream.point(x, y);\n }\n\n function polygonInside() {\n var winding = 0;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n for (var ring = polygon[i], j = 1, m = ring.length, point = ring[0], a0, a1, b0 = point[0], b1 = point[1]; j < m; ++j) {\n a0 = b0, a1 = b1, point = ring[j], b0 = point[0], b1 = point[1];\n if (a1 <= y1) { if (b1 > y1 && (b0 - a0) * (y1 - a1) > (b1 - a1) * (x0 - a0)) ++winding; }\n else { if (b1 <= y1 && (b0 - a0) * (y1 - a1) < (b1 - a1) * (x0 - a0)) --winding; }\n }\n }\n\n return winding;\n }\n\n // Buffer geometry within a polygon and then clip it en masse.\n function polygonStart() {\n activeStream = bufferStream, segments = [], polygon = [], clean = true;\n }\n\n function polygonEnd() {\n var startInside = polygonInside(),\n cleanInside = clean && startInside,\n visible = (segments = merge(segments)).length;\n if (cleanInside || visible) {\n stream.polygonStart();\n if (cleanInside) {\n stream.lineStart();\n interpolate(null, null, 1, stream);\n stream.lineEnd();\n }\n if (visible) {\n clipRejoin(segments, compareIntersection, startInside, interpolate, stream);\n }\n stream.polygonEnd();\n }\n activeStream = stream, segments = polygon = ring = null;\n }\n\n function lineStart() {\n clipStream.point = linePoint;\n if (polygon) polygon.push(ring = []);\n first = true;\n v_ = false;\n x_ = y_ = NaN;\n }\n\n // TODO rather than special-case polygons, simply handle them separately.\n // Ideally, coincident intersection points should be jittered to avoid\n // clipping issues.\n function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }\n\n function linePoint(x, y) {\n var v = visible(x, y);\n if (polygon) ring.push([x, y]);\n if (first) {\n x__ = x, y__ = y, v__ = v;\n first = false;\n if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n }\n } else {\n if (v && v_) activeStream.point(x, y);\n else {\n var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))],\n b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))];\n if (clipLine(a, b, x0, y0, x1, y1)) {\n if (!v_) {\n activeStream.lineStart();\n activeStream.point(a[0], a[1]);\n }\n activeStream.point(b[0], b[1]);\n if (!v) activeStream.lineEnd();\n clean = false;\n } else if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n clean = false;\n }\n }\n }\n x_ = x, y_ = y, v_ = v;\n }\n\n return clipStream;\n };\n}\n","export default function(a, b, x0, y0, x1, y1) {\n var ax = a[0],\n ay = a[1],\n bx = b[0],\n by = b[1],\n t0 = 0,\n t1 = 1,\n dx = bx - ax,\n dy = by - ay,\n r;\n\n r = x0 - ax;\n if (!dx && r > 0) return;\n r /= dx;\n if (dx < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dx > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = x1 - ax;\n if (!dx && r < 0) return;\n r /= dx;\n if (dx < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dx > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n r = y0 - ay;\n if (!dy && r > 0) return;\n r /= dy;\n if (dy < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dy > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = y1 - ay;\n if (!dy && r < 0) return;\n r /= dy;\n if (dy < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dy > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy;\n if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy;\n return true;\n}\n","export default function(a, b) {\n\n function compose(x, y) {\n return x = a(x, y), b(x[0], x[1]);\n }\n\n if (a.invert && b.invert) compose.invert = function(x, y) {\n return x = b.invert(x, y), x && a.invert(x[0], x[1]);\n };\n\n return compose;\n}\n","import compose from \"./compose.js\";\nimport {abs, asin, atan2, cos, degrees, pi, radians, sin, tau} from \"./math.js\";\n\nfunction rotationIdentity(lambda, phi) {\n if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;\n return [lambda, phi];\n}\n\nrotationIdentity.invert = rotationIdentity;\n\nexport function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {\n return (deltaLambda %= tau) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma))\n : rotationLambda(deltaLambda))\n : (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma)\n : rotationIdentity);\n}\n\nfunction forwardRotationLambda(deltaLambda) {\n return function(lambda, phi) {\n lambda += deltaLambda;\n if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;\n return [lambda, phi];\n };\n}\n\nfunction rotationLambda(deltaLambda) {\n var rotation = forwardRotationLambda(deltaLambda);\n rotation.invert = forwardRotationLambda(-deltaLambda);\n return rotation;\n}\n\nfunction rotationPhiGamma(deltaPhi, deltaGamma) {\n var cosDeltaPhi = cos(deltaPhi),\n sinDeltaPhi = sin(deltaPhi),\n cosDeltaGamma = cos(deltaGamma),\n sinDeltaGamma = sin(deltaGamma);\n\n function rotation(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaPhi + x * sinDeltaPhi;\n return [\n atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),\n asin(k * cosDeltaGamma + y * sinDeltaGamma)\n ];\n }\n\n rotation.invert = function(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaGamma - y * sinDeltaGamma;\n return [\n atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),\n asin(k * cosDeltaPhi - x * sinDeltaPhi)\n ];\n };\n\n return rotation;\n}\n\nexport default function(rotate) {\n rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);\n\n function forward(coordinates) {\n coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n }\n\n forward.invert = function(coordinates) {\n coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n };\n\n return forward;\n}\n","export default function(methods) {\n return {\n stream: transformer(methods)\n };\n}\n\nexport function transformer(methods) {\n return function(stream) {\n var s = new TransformStream;\n for (var key in methods) s[key] = methods[key];\n s.stream = stream;\n return s;\n };\n}\n\nfunction TransformStream() {}\n\nTransformStream.prototype = {\n constructor: TransformStream,\n point: function(x, y) { this.stream.point(x, y); },\n sphere: function() { this.stream.sphere(); },\n lineStart: function() { this.stream.lineStart(); },\n lineEnd: function() { this.stream.lineEnd(); },\n polygonStart: function() { this.stream.polygonStart(); },\n polygonEnd: function() { this.stream.polygonEnd(); }\n};\n","import {default as geoStream} from \"../stream.js\";\nimport boundsStream from \"../path/bounds.js\";\n\nfunction fit(projection, fitBounds, object) {\n var clip = projection.clipExtent && projection.clipExtent();\n projection.scale(150).translate([0, 0]);\n if (clip != null) projection.clipExtent(null);\n geoStream(object, projection.stream(boundsStream));\n fitBounds(boundsStream.result());\n if (clip != null) projection.clipExtent(clip);\n return projection;\n}\n\nexport function fitExtent(projection, extent, object) {\n return fit(projection, function(b) {\n var w = extent[1][0] - extent[0][0],\n h = extent[1][1] - extent[0][1],\n k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])),\n x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2,\n y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitSize(projection, size, object) {\n return fitExtent(projection, [[0, 0], size], object);\n}\n\nexport function fitWidth(projection, width, object) {\n return fit(projection, function(b) {\n var w = +width,\n k = w / (b[1][0] - b[0][0]),\n x = (w - k * (b[1][0] + b[0][0])) / 2,\n y = -k * b[0][1];\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitHeight(projection, height, object) {\n return fit(projection, function(b) {\n var h = +height,\n k = h / (b[1][1] - b[0][1]),\n x = -k * b[0][0],\n y = (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n","import {cartesian} from \"../cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, radians, sqrt} from \"../math.js\";\nimport {transformer} from \"../transform.js\";\n\nvar maxDepth = 16, // maximum depth of subdivision\n cosMinDistance = cos(30 * radians); // cos(minimum angular distance)\n\nexport default function(project, delta2) {\n return +delta2 ? resample(project, delta2) : resampleNone(project);\n}\n\nfunction resampleNone(project) {\n return transformer({\n point: function(x, y) {\n x = project(x, y);\n this.stream.point(x[0], x[1]);\n }\n });\n}\n\nfunction resample(project, delta2) {\n\n function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) {\n var dx = x1 - x0,\n dy = y1 - y0,\n d2 = dx * dx + dy * dy;\n if (d2 > 4 * delta2 && depth--) {\n var a = a0 + a1,\n b = b0 + b1,\n c = c0 + c1,\n m = sqrt(a * a + b * b + c * c),\n phi2 = asin(c /= m),\n lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a),\n p = project(lambda2, phi2),\n x2 = p[0],\n y2 = p[1],\n dx2 = x2 - x0,\n dy2 = y2 - y0,\n dz = dy * dx2 - dx * dy2;\n if (dz * dz / d2 > delta2 // perpendicular projected distance\n || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end\n || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream);\n stream.point(x2, y2);\n resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream);\n }\n }\n }\n return function(stream) {\n var lambda00, x00, y00, a00, b00, c00, // first point\n lambda0, x0, y0, a0, b0, c0; // previous point\n\n var resampleStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; },\n polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; }\n };\n\n function point(x, y) {\n x = project(x, y);\n stream.point(x[0], x[1]);\n }\n\n function lineStart() {\n x0 = NaN;\n resampleStream.point = linePoint;\n stream.lineStart();\n }\n\n function linePoint(lambda, phi) {\n var c = cartesian([lambda, phi]), p = project(lambda, phi);\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);\n stream.point(x0, y0);\n }\n\n function lineEnd() {\n resampleStream.point = point;\n stream.lineEnd();\n }\n\n function ringStart() {\n lineStart();\n resampleStream.point = ringPoint;\n resampleStream.lineEnd = ringEnd;\n }\n\n function ringPoint(lambda, phi) {\n linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;\n resampleStream.point = linePoint;\n }\n\n function ringEnd() {\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream);\n resampleStream.lineEnd = lineEnd;\n lineEnd();\n }\n\n return resampleStream;\n };\n}\n","import clipAntimeridian from \"../clip/antimeridian.js\";\nimport clipCircle from \"../clip/circle.js\";\nimport clipRectangle from \"../clip/rectangle.js\";\nimport compose from \"../compose.js\";\nimport identity from \"../identity.js\";\nimport {cos, degrees, radians, sin, sqrt} from \"../math.js\";\nimport {rotateRadians} from \"../rotation.js\";\nimport {transformer} from \"../transform.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\nimport resample from \"./resample.js\";\n\nvar transformRadians = transformer({\n point: function(x, y) {\n this.stream.point(x * radians, y * radians);\n }\n});\n\nfunction transformRotate(rotate) {\n return transformer({\n point: function(x, y) {\n var r = rotate(x, y);\n return this.stream.point(r[0], r[1]);\n }\n });\n}\n\nfunction scaleTranslate(k, dx, dy, sx, sy) {\n function transform(x, y) {\n x *= sx; y *= sy;\n return [dx + k * x, dy - k * y];\n }\n transform.invert = function(x, y) {\n return [(x - dx) / k * sx, (dy - y) / k * sy];\n };\n return transform;\n}\n\nfunction scaleTranslateRotate(k, dx, dy, sx, sy, alpha) {\n if (!alpha) return scaleTranslate(k, dx, dy, sx, sy);\n var cosAlpha = cos(alpha),\n sinAlpha = sin(alpha),\n a = cosAlpha * k,\n b = sinAlpha * k,\n ai = cosAlpha / k,\n bi = sinAlpha / k,\n ci = (sinAlpha * dy - cosAlpha * dx) / k,\n fi = (sinAlpha * dx + cosAlpha * dy) / k;\n function transform(x, y) {\n x *= sx; y *= sy;\n return [a * x - b * y + dx, dy - b * x - a * y];\n }\n transform.invert = function(x, y) {\n return [sx * (ai * x - bi * y + ci), sy * (fi - bi * x - ai * y)];\n };\n return transform;\n}\n\nexport default function projection(project) {\n return projectionMutator(function() { return project; })();\n}\n\nexport function projectionMutator(projectAt) {\n var project,\n k = 150, // scale\n x = 480, y = 250, // translate\n lambda = 0, phi = 0, // center\n deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, // pre-rotate\n alpha = 0, // post-rotate angle\n sx = 1, // reflectX\n sy = 1, // reflectX\n theta = null, preclip = clipAntimeridian, // pre-clip angle\n x0 = null, y0, x1, y1, postclip = identity, // post-clip extent\n delta2 = 0.5, // precision\n projectResample,\n projectTransform,\n projectRotateTransform,\n cache,\n cacheStream;\n\n function projection(point) {\n return projectRotateTransform(point[0] * radians, point[1] * radians);\n }\n\n function invert(point) {\n point = projectRotateTransform.invert(point[0], point[1]);\n return point && [point[0] * degrees, point[1] * degrees];\n }\n\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));\n };\n\n projection.preclip = function(_) {\n return arguments.length ? (preclip = _, theta = undefined, reset()) : preclip;\n };\n\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\n };\n\n projection.clipAngle = function(_) {\n return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees;\n };\n\n projection.clipExtent = function(_) {\n return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n projection.scale = function(_) {\n return arguments.length ? (k = +_, recenter()) : k;\n };\n\n projection.translate = function(_) {\n return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y];\n };\n\n projection.center = function(_) {\n return arguments.length ? (lambda = _[0] % 360 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];\n };\n\n projection.rotate = function(_) {\n return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];\n };\n\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, recenter()) : alpha * degrees;\n };\n\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, recenter()) : sx < 0;\n };\n\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0;\n };\n\n projection.precision = function(_) {\n return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2);\n };\n\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n function recenter() {\n var center = scaleTranslateRotate(k, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)),\n transform = scaleTranslateRotate(k, x - center[0], y - center[1], sx, sy, alpha);\n rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma);\n projectTransform = compose(project, transform);\n projectRotateTransform = compose(rotate, projectTransform);\n projectResample = resample(projectTransform, delta2);\n return reset();\n }\n\n function reset() {\n cache = cacheStream = null;\n return projection;\n }\n\n return function() {\n project = projectAt.apply(this, arguments);\n projection.invert = project.invert && invert;\n return recenter();\n };\n}\n","import {cartesian, cartesianAddInPlace, cartesianCross, cartesianDot, cartesianScale, spherical} from \"../cartesian.js\";\nimport {circleStream} from \"../circle.js\";\nimport {abs, cos, epsilon, pi, radians, sqrt} from \"../math.js\";\nimport pointEqual from \"../pointEqual.js\";\nimport clip from \"./index.js\";\n\nexport default function(radius) {\n var cr = cos(radius),\n delta = 6 * radians,\n smallRadius = cr > 0,\n notHemisphere = abs(cr) > epsilon; // TODO optimise for this common case\n\n function interpolate(from, to, direction, stream) {\n circleStream(stream, radius, delta, direction, from, to);\n }\n\n function visible(lambda, phi) {\n return cos(lambda) * cos(phi) > cr;\n }\n\n // Takes a line and cuts into visible segments. Return values used for polygon\n // clipping: 0 - there were intersections or the line was empty; 1 - no\n // intersections 2 - there were intersections, and the first and last segments\n // should be rejoined.\n function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }\n\n // Intersects the great circle between a and b with the clip circle.\n function intersect(a, b, two) {\n var pa = cartesian(a),\n pb = cartesian(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = cartesianCross(pa, pb),\n n2n2 = cartesianDot(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = cartesianCross(n1, n2),\n A = cartesianScale(n1, c1),\n B = cartesianScale(n2, c2);\n cartesianAddInPlace(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = cartesianDot(A, u),\n uu = cartesianDot(u, u),\n t2 = w * w - uu * (cartesianDot(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = sqrt(t2),\n q = cartesianScale(u, (-w - t) / uu);\n cartesianAddInPlace(q, A);\n q = spherical(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = abs(delta - pi) < epsilon,\n meridian = polar || delta < epsilon;\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = cartesianScale(u, (-w + t) / uu);\n cartesianAddInPlace(q1, A);\n return [q, spherical(q1)];\n }\n }\n\n // Generates a 4-bit vector representing the location of a point relative to\n // the small circle's bounding box.\n function code(lambda, phi) {\n var r = smallRadius ? radius : pi - radius,\n code = 0;\n if (lambda < -r) code |= 1; // left\n else if (lambda > r) code |= 2; // right\n if (phi < -r) code |= 4; // below\n else if (phi > r) code |= 8; // above\n return code;\n }\n\n return clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);\n}\n","import {degrees, pi, radians} from \"../math.js\";\nimport {projectionMutator} from \"./index.js\";\n\nexport function conicProjection(projectAt) {\n var phi0 = 0,\n phi1 = pi / 3,\n m = projectionMutator(projectAt),\n p = m(phi0, phi1);\n\n p.parallels = function(_) {\n return arguments.length ? m(phi0 = _[0] * radians, phi1 = _[1] * radians) : [phi0 * degrees, phi1 * degrees];\n };\n\n return p;\n}\n","import {abs, asin, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {cylindricalEqualAreaRaw} from \"./cylindricalEqualArea.js\";\n\nexport function conicEqualAreaRaw(y0, y1) {\n var sy0 = sin(y0), n = (sy0 + sin(y1)) / 2;\n\n // Are the parallels symmetrical around the Equator?\n if (abs(n) < epsilon) return cylindricalEqualAreaRaw(y0);\n\n var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c) / n;\n\n function project(x, y) {\n var r = sqrt(c - 2 * n * sin(y)) / n;\n return [r * sin(x *= n), r0 - r * cos(x)];\n }\n\n project.invert = function(x, y) {\n var r0y = r0 - y,\n l = atan2(x, abs(r0y)) * sign(r0y);\n if (r0y * n < 0)\n l -= pi * sign(x) * sign(r0y);\n return [l / n, asin((c - (x * x + r0y * r0y) * n * n) / (2 * n))];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEqualAreaRaw)\n .scale(155.424)\n .center([0, 33.6442]);\n}\n","import {asin, cos, sin} from \"../math.js\";\n\nexport function cylindricalEqualAreaRaw(phi0) {\n var cosPhi0 = cos(phi0);\n\n function forward(lambda, phi) {\n return [lambda * cosPhi0, sin(phi) / cosPhi0];\n }\n\n forward.invert = function(x, y) {\n return [x / cosPhi0, asin(y * cosPhi0)];\n };\n\n return forward;\n}\n","import conicEqualArea from \"./conicEqualArea.js\";\n\nexport default function() {\n return conicEqualArea()\n .parallels([29.5, 45.5])\n .scale(1070)\n .translate([480, 250])\n .rotate([96, 0])\n .center([-0.6, 38.7]);\n}\n","import {asin, atan2, cos, sin, sqrt} from \"../math.js\";\n\nexport function azimuthalRaw(scale) {\n return function(x, y) {\n var cx = cos(x),\n cy = cos(y),\n k = scale(cx * cy);\n if (k === Infinity) return [2, 0];\n return [\n k * cy * sin(x),\n k * sin(y)\n ];\n }\n}\n\nexport function azimuthalInvert(angle) {\n return function(x, y) {\n var z = sqrt(x * x + y * y),\n c = angle(z),\n sc = sin(c),\n cc = cos(c);\n return [\n atan2(x * sc, z * cc),\n asin(z && y * sc / z)\n ];\n }\n}\n","import {asin, sqrt} from \"../math.js\";\nimport {azimuthalRaw, azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport var azimuthalEqualAreaRaw = azimuthalRaw(function(cxcy) {\n return sqrt(2 / (1 + cxcy));\n});\n\nazimuthalEqualAreaRaw.invert = azimuthalInvert(function(z) {\n return 2 * asin(z / 2);\n});\n\nexport default function() {\n return projection(azimuthalEqualAreaRaw)\n .scale(124.75)\n .clipAngle(180 - 1e-3);\n}\n","import {acos, sin} from \"../math.js\";\nimport {azimuthalRaw, azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport var azimuthalEquidistantRaw = azimuthalRaw(function(c) {\n return (c = acos(c)) && c / sin(c);\n});\n\nazimuthalEquidistantRaw.invert = azimuthalInvert(function(z) {\n return z;\n});\n\nexport default function() {\n return projection(azimuthalEquidistantRaw)\n .scale(79.4188)\n .clipAngle(180 - 1e-3);\n}\n","import {atan, exp, halfPi, log, pi, tan, tau} from \"../math.js\";\nimport rotation from \"../rotation.js\";\nimport projection from \"./index.js\";\n\nexport function mercatorRaw(lambda, phi) {\n return [lambda, log(tan((halfPi + phi) / 2))];\n}\n\nmercatorRaw.invert = function(x, y) {\n return [x, 2 * atan(exp(y)) - halfPi];\n};\n\nexport default function() {\n return mercatorProjection(mercatorRaw)\n .scale(961 / tau);\n}\n\nexport function mercatorProjection(project) {\n var m = projection(project),\n center = m.center,\n scale = m.scale,\n translate = m.translate,\n clipExtent = m.clipExtent,\n x0 = null, y0, x1, y1; // clip extent\n\n m.scale = function(_) {\n return arguments.length ? (scale(_), reclip()) : scale();\n };\n\n m.translate = function(_) {\n return arguments.length ? (translate(_), reclip()) : translate();\n };\n\n m.center = function(_) {\n return arguments.length ? (center(_), reclip()) : center();\n };\n\n m.clipExtent = function(_) {\n return arguments.length ? ((_ == null ? x0 = y0 = x1 = y1 = null : (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1])), reclip()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n function reclip() {\n var k = pi * scale(),\n t = m(rotation(m.rotate()).invert([0, 0]));\n return clipExtent(x0 == null\n ? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw\n ? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]]\n : [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]);\n }\n\n return reclip();\n}\n","import {abs, atan, atan2, cos, epsilon, halfPi, log, pi, pow, sign, sin, sqrt, tan} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {mercatorRaw} from \"./mercator.js\";\n\nfunction tany(y) {\n return tan((halfPi + y) / 2);\n}\n\nexport function conicConformalRaw(y0, y1) {\n var cy0 = cos(y0),\n n = y0 === y1 ? sin(y0) : log(cy0 / cos(y1)) / log(tany(y1) / tany(y0)),\n f = cy0 * pow(tany(y0), n) / n;\n\n if (!n) return mercatorRaw;\n\n function project(x, y) {\n if (f > 0) { if (y < -halfPi + epsilon) y = -halfPi + epsilon; }\n else { if (y > halfPi - epsilon) y = halfPi - epsilon; }\n var r = f / pow(tany(y), n);\n return [r * sin(n * x), f - r * cos(n * x)];\n }\n\n project.invert = function(x, y) {\n var fy = f - y, r = sign(n) * sqrt(x * x + fy * fy),\n l = atan2(x, abs(fy)) * sign(fy);\n if (fy * n < 0)\n l -= pi * sign(x) * sign(fy);\n return [l / n, 2 * atan(pow(f / r, 1 / n)) - halfPi];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicConformalRaw)\n .scale(109.5)\n .parallels([30, 30]);\n}\n","import projection from \"./index.js\";\n\nexport function equirectangularRaw(lambda, phi) {\n return [lambda, phi];\n}\n\nequirectangularRaw.invert = equirectangularRaw;\n\nexport default function() {\n return projection(equirectangularRaw)\n .scale(152.63);\n}\n","import {abs, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {equirectangularRaw} from \"./equirectangular.js\";\n\nexport function conicEquidistantRaw(y0, y1) {\n var cy0 = cos(y0),\n n = y0 === y1 ? sin(y0) : (cy0 - cos(y1)) / (y1 - y0),\n g = cy0 / n + y0;\n\n if (abs(n) < epsilon) return equirectangularRaw;\n\n function project(x, y) {\n var gy = g - y, nx = n * x;\n return [gy * sin(nx), g - gy * cos(nx)];\n }\n\n project.invert = function(x, y) {\n var gy = g - y,\n l = atan2(x, abs(gy)) * sign(gy);\n if (gy * n < 0)\n l -= pi * sign(x) * sign(gy);\n return [l / n, g - sign(n) * sqrt(x * x + gy * gy)];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEquidistantRaw)\n .scale(131.154)\n .center([0, 13.9389]);\n}\n","import projection from \"./index.js\";\nimport {abs, asin, cos, epsilon2, sin, sqrt} from \"../math.js\";\n\nvar A1 = 1.340264,\n A2 = -0.081106,\n A3 = 0.000893,\n A4 = 0.003796,\n M = sqrt(3) / 2,\n iterations = 12;\n\nexport function equalEarthRaw(lambda, phi) {\n var l = asin(M * sin(phi)), l2 = l * l, l6 = l2 * l2 * l2;\n return [\n lambda * cos(l) / (M * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2))),\n l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2))\n ];\n}\n\nequalEarthRaw.invert = function(x, y) {\n var l = y, l2 = l * l, l6 = l2 * l2 * l2;\n for (var i = 0, delta, fy, fpy; i < iterations; ++i) {\n fy = l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - y;\n fpy = A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2);\n l -= delta = fy / fpy, l2 = l * l, l6 = l2 * l2 * l2;\n if (abs(delta) < epsilon2) break;\n }\n return [\n M * x * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / cos(l),\n asin(sin(l) / M)\n ];\n};\n\nexport default function() {\n return projection(equalEarthRaw)\n .scale(177.158);\n}\n","import {atan, cos, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function gnomonicRaw(x, y) {\n var cy = cos(y), k = cos(x) * cy;\n return [cy * sin(x) / k, sin(y) / k];\n}\n\ngnomonicRaw.invert = azimuthalInvert(atan);\n\nexport default function() {\n return projection(gnomonicRaw)\n .scale(144.049)\n .clipAngle(60);\n}\n","import projection from \"./index.js\";\nimport {abs, epsilon} from \"../math.js\";\n\nexport function naturalEarth1Raw(lambda, phi) {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n return [\n lambda * (0.8707 - 0.131979 * phi2 + phi4 * (-0.013791 + phi4 * (0.003971 * phi2 - 0.001529 * phi4))),\n phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4)))\n ];\n}\n\nnaturalEarth1Raw.invert = function(x, y) {\n var phi = y, i = 25, delta;\n do {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n phi -= delta = (phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) - y) /\n (1.007226 + phi2 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi2 - 0.005916 * 11 * phi4)));\n } while (abs(delta) > epsilon && --i > 0);\n return [\n x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))),\n phi\n ];\n};\n\nexport default function() {\n return projection(naturalEarth1Raw)\n .scale(175.295);\n}\n","import {asin, cos, epsilon, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function orthographicRaw(x, y) {\n return [cos(y) * sin(x), sin(y)];\n}\n\northographicRaw.invert = azimuthalInvert(asin);\n\nexport default function() {\n return projection(orthographicRaw)\n .scale(249.5)\n .clipAngle(90 + epsilon);\n}\n","import {atan, cos, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function stereographicRaw(x, y) {\n var cy = cos(y), k = 1 + cos(x) * cy;\n return [cy * sin(x) / k, sin(y) / k];\n}\n\nstereographicRaw.invert = azimuthalInvert(function(z) {\n return 2 * atan(z);\n});\n\nexport default function() {\n return projection(stereographicRaw)\n .scale(250)\n .clipAngle(142);\n}\n","import {atan, exp, halfPi, log, tan} from \"../math.js\";\nimport {mercatorProjection} from \"./mercator.js\";\n\nexport function transverseMercatorRaw(lambda, phi) {\n return [log(tan((halfPi + phi) / 2)), -lambda];\n}\n\ntransverseMercatorRaw.invert = function(x, y) {\n return [-y, 2 * atan(exp(x)) - halfPi];\n};\n\nexport default function() {\n var m = mercatorProjection(transverseMercatorRaw),\n center = m.center,\n rotate = m.rotate;\n\n m.center = function(_) {\n return arguments.length ? center([-_[1], _[0]]) : (_ = center(), [_[1], -_[0]]);\n };\n\n m.rotate = function(_) {\n return arguments.length ? rotate([_[0], _[1], _.length > 2 ? _[2] + 90 : 90]) : (_ = rotate(), [_[0], _[1], _[2] - 90]);\n };\n\n return rotate([0, 0, 90])\n .scale(159.155);\n}\n","export var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var ceil = Math.ceil;\nexport var cos = Math.cos;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var log = Math.log;\nexport var max = Math.max;\nexport var min = Math.min;\nexport var pow = Math.pow;\nexport var round = Math.round;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sin = Math.sin;\nexport var tan = Math.tan;\n\nexport var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var sqrt1_2 = Math.SQRT1_2;\nexport var sqrt2 = sqrt(2);\nexport var sqrtPi = sqrt(pi);\nexport var tau = pi * 2;\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport function sinci(x) {\n return x ? x / Math.sin(x) : 1;\n}\n\nexport function asin(x) {\n return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);\n}\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function sqrt(x) {\n return x > 0 ? Math.sqrt(x) : 0;\n}\n\nexport function tanh(x) {\n x = exp(2 * x);\n return (x - 1) / (x + 1);\n}\n\nexport function sinh(x) {\n return (exp(x) - exp(-x)) / 2;\n}\n\nexport function cosh(x) {\n return (exp(x) + exp(-x)) / 2;\n}\n\nexport function arsinh(x) {\n return log(x + sqrt(x * x + 1));\n}\n\nexport function arcosh(x) {\n return log(x + sqrt(x * x - 1));\n}\n","import {geoProjection as projection} from \"d3-geo\";\nimport {abs, asin, cos, epsilon, halfPi, pi, sin, sqrt2} from \"./math.js\";\n\nexport function mollweideBromleyTheta(cp, phi) {\n var cpsinPhi = cp * sin(phi), i = 30, delta;\n do phi -= delta = (phi + sin(phi) - cpsinPhi) / (1 + cos(phi));\n while (abs(delta) > epsilon && --i > 0);\n return phi / 2;\n}\n\nexport function mollweideBromleyRaw(cx, cy, cp) {\n\n function forward(lambda, phi) {\n return [cx * lambda * cos(phi = mollweideBromleyTheta(cp, phi)), cy * sin(phi)];\n }\n\n forward.invert = function(x, y) {\n return y = asin(y / cy), [x / (cx * cos(y)), asin((2 * y + sin(2 * y)) / cp)];\n };\n\n return forward;\n}\n\nexport var mollweideRaw = mollweideBromleyRaw(sqrt2 / halfPi, sqrt2, pi);\n\nexport default function() {\n return projection(mollweideRaw)\n .scale(169.529);\n}\n","import { geoPath, geoAlbers, geoAlbersUsa, geoAzimuthalEqualArea, geoAzimuthalEquidistant, geoConicConformal, geoConicEqualArea, geoConicEquidistant, geoEqualEarth, geoEquirectangular, geoGnomonic, geoIdentity, geoMercator, geoNaturalEarth1, geoOrthographic, geoStereographic, geoTransverseMercator } from 'd3-geo';\nimport { geoMollweide } from 'd3-geo-projection';\nimport { registerScale } from 'vega-scale';\n\nconst defaultPath = geoPath();\nconst projectionProperties = [\n// standard properties in d3-geo\n'clipAngle', 'clipExtent', 'scale', 'translate', 'center', 'rotate', 'parallels', 'precision', 'reflectX', 'reflectY',\n// extended properties in d3-geo-projections\n'coefficient', 'distance', 'fraction', 'lobes', 'parallel', 'radius', 'ratio', 'spacing', 'tilt'];\n\n/**\n * Augment projections with their type and a copy method.\n */\nfunction create(type, constructor) {\n return function projection() {\n const p = constructor();\n p.type = type;\n p.path = geoPath().projection(p);\n p.copy = p.copy || function () {\n const c = projection();\n projectionProperties.forEach(prop => {\n if (p[prop]) c[prop](p[prop]());\n });\n c.path.pointRadius(p.path.pointRadius());\n return c;\n };\n return registerScale(p);\n };\n}\nfunction projection(type, proj) {\n if (!type || typeof type !== 'string') {\n throw new Error('Projection type must be a name string.');\n }\n type = type.toLowerCase();\n if (arguments.length > 1) {\n projections[type] = create(type, proj);\n return this;\n } else {\n return projections[type] || null;\n }\n}\nfunction getProjectionPath(proj) {\n return proj && proj.path || defaultPath;\n}\nconst projections = {\n // base d3-geo projection types\n albers: geoAlbers,\n albersusa: geoAlbersUsa,\n azimuthalequalarea: geoAzimuthalEqualArea,\n azimuthalequidistant: geoAzimuthalEquidistant,\n conicconformal: geoConicConformal,\n conicequalarea: geoConicEqualArea,\n conicequidistant: geoConicEquidistant,\n equalEarth: geoEqualEarth,\n equirectangular: geoEquirectangular,\n gnomonic: geoGnomonic,\n identity: geoIdentity,\n mercator: geoMercator,\n mollweide: geoMollweide,\n naturalEarth1: geoNaturalEarth1,\n orthographic: geoOrthographic,\n stereographic: geoStereographic,\n transversemercator: geoTransverseMercator\n};\nfor (const key in projections) {\n projection(key, projections[key]);\n}\n\nexport { getProjectionPath, projection, projectionProperties };\n","import {epsilon} from \"../math.js\";\nimport albers from \"./albers.js\";\nimport conicEqualArea from \"./conicEqualArea.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\n\n// The projections must have mutually exclusive clip regions on the sphere,\n// as this will avoid emitting interleaving lines and polygons.\nfunction multiplex(streams) {\n var n = streams.length;\n return {\n point: function(x, y) { var i = -1; while (++i < n) streams[i].point(x, y); },\n sphere: function() { var i = -1; while (++i < n) streams[i].sphere(); },\n lineStart: function() { var i = -1; while (++i < n) streams[i].lineStart(); },\n lineEnd: function() { var i = -1; while (++i < n) streams[i].lineEnd(); },\n polygonStart: function() { var i = -1; while (++i < n) streams[i].polygonStart(); },\n polygonEnd: function() { var i = -1; while (++i < n) streams[i].polygonEnd(); }\n };\n}\n\n// A composite projection for the United States, configured by default for\n// 960×500. The projection also works quite well at 960×600 if you change the\n// scale to 1285 and adjust the translate accordingly. The set of standard\n// parallels for each region comes from USGS, which is published here:\n// http://egsc.usgs.gov/isb/pubs/MapProjections/projections.html#albers\nexport default function() {\n var cache,\n cacheStream,\n lower48 = albers(), lower48Point,\n alaska = conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338\n hawaii = conicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), hawaiiPoint, // ESRI:102007\n point, pointStream = {point: function(x, y) { point = [x, y]; }};\n\n function albersUsa(coordinates) {\n var x = coordinates[0], y = coordinates[1];\n return point = null,\n (lower48Point.point(x, y), point)\n || (alaskaPoint.point(x, y), point)\n || (hawaiiPoint.point(x, y), point);\n }\n\n albersUsa.invert = function(coordinates) {\n var k = lower48.scale(),\n t = lower48.translate(),\n x = (coordinates[0] - t[0]) / k,\n y = (coordinates[1] - t[1]) / k;\n return (y >= 0.120 && y < 0.234 && x >= -0.425 && x < -0.214 ? alaska\n : y >= 0.166 && y < 0.234 && x >= -0.214 && x < -0.115 ? hawaii\n : lower48).invert(coordinates);\n };\n\n albersUsa.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = multiplex([lower48.stream(cacheStream = stream), alaska.stream(stream), hawaii.stream(stream)]);\n };\n\n albersUsa.precision = function(_) {\n if (!arguments.length) return lower48.precision();\n lower48.precision(_), alaska.precision(_), hawaii.precision(_);\n return reset();\n };\n\n albersUsa.scale = function(_) {\n if (!arguments.length) return lower48.scale();\n lower48.scale(_), alaska.scale(_ * 0.35), hawaii.scale(_);\n return albersUsa.translate(lower48.translate());\n };\n\n albersUsa.translate = function(_) {\n if (!arguments.length) return lower48.translate();\n var k = lower48.scale(), x = +_[0], y = +_[1];\n\n lower48Point = lower48\n .translate(_)\n .clipExtent([[x - 0.455 * k, y - 0.238 * k], [x + 0.455 * k, y + 0.238 * k]])\n .stream(pointStream);\n\n alaskaPoint = alaska\n .translate([x - 0.307 * k, y + 0.201 * k])\n .clipExtent([[x - 0.425 * k + epsilon, y + 0.120 * k + epsilon], [x - 0.214 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n hawaiiPoint = hawaii\n .translate([x - 0.205 * k, y + 0.212 * k])\n .clipExtent([[x - 0.214 * k + epsilon, y + 0.166 * k + epsilon], [x - 0.115 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n return reset();\n };\n\n albersUsa.fitExtent = function(extent, object) {\n return fitExtent(albersUsa, extent, object);\n };\n\n albersUsa.fitSize = function(size, object) {\n return fitSize(albersUsa, size, object);\n };\n\n albersUsa.fitWidth = function(width, object) {\n return fitWidth(albersUsa, width, object);\n };\n\n albersUsa.fitHeight = function(height, object) {\n return fitHeight(albersUsa, height, object);\n };\n\n function reset() {\n cache = cacheStream = null;\n return albersUsa;\n }\n\n return albersUsa.scale(1070);\n}\n","import clipRectangle from \"../clip/rectangle.js\";\nimport identity from \"../identity.js\";\nimport {transformer} from \"../transform.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\nimport {cos, degrees, radians, sin} from \"../math.js\";\n\nexport default function() {\n var k = 1, tx = 0, ty = 0, sx = 1, sy = 1, // scale, translate and reflect\n alpha = 0, ca, sa, // angle\n x0 = null, y0, x1, y1, // clip extent\n kx = 1, ky = 1,\n transform = transformer({\n point: function(x, y) {\n var p = projection([x, y])\n this.stream.point(p[0], p[1]);\n }\n }),\n postclip = identity,\n cache,\n cacheStream;\n\n function reset() {\n kx = k * sx;\n ky = k * sy;\n cache = cacheStream = null;\n return projection;\n }\n\n function projection (p) {\n var x = p[0] * kx, y = p[1] * ky;\n if (alpha) {\n var t = y * ca - x * sa;\n x = x * ca + y * sa;\n y = t;\n } \n return [x + tx, y + ty];\n }\n projection.invert = function(p) {\n var x = p[0] - tx, y = p[1] - ty;\n if (alpha) {\n var t = y * ca + x * sa;\n x = x * ca - y * sa;\n y = t;\n }\n return [x / kx, y / ky];\n };\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transform(postclip(cacheStream = stream));\n };\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\n };\n projection.clipExtent = function(_) {\n return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n projection.scale = function(_) {\n return arguments.length ? (k = +_, reset()) : k;\n };\n projection.translate = function(_) {\n return arguments.length ? (tx = +_[0], ty = +_[1], reset()) : [tx, ty];\n }\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, sa = sin(alpha), ca = cos(alpha), reset()) : alpha * degrees;\n };\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, reset()) : sx < 0;\n };\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, reset()) : sy < 0;\n };\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n return projection;\n}\n","import {range} from \"d3-array\";\nimport {abs, ceil, epsilon} from \"./math.js\";\n\nfunction graticuleX(y0, y1, dy) {\n var y = range(y0, y1 - epsilon, dy).concat(y1);\n return function(x) { return y.map(function(y) { return [x, y]; }); };\n}\n\nfunction graticuleY(x0, x1, dx) {\n var x = range(x0, x1 - epsilon, dx).concat(x1);\n return function(y) { return x.map(function(x) { return [x, y]; }); };\n}\n\nexport default function graticule() {\n var x1, x0, X1, X0,\n y1, y0, Y1, Y0,\n dx = 10, dy = dx, DX = 90, DY = 360,\n x, y, X, Y,\n precision = 2.5;\n\n function graticule() {\n return {type: \"MultiLineString\", coordinates: lines()};\n }\n\n function lines() {\n return range(ceil(X0 / DX) * DX, X1, DX).map(X)\n .concat(range(ceil(Y0 / DY) * DY, Y1, DY).map(Y))\n .concat(range(ceil(x0 / dx) * dx, x1, dx).filter(function(x) { return abs(x % DX) > epsilon; }).map(x))\n .concat(range(ceil(y0 / dy) * dy, y1, dy).filter(function(y) { return abs(y % DY) > epsilon; }).map(y));\n }\n\n graticule.lines = function() {\n return lines().map(function(coordinates) { return {type: \"LineString\", coordinates: coordinates}; });\n };\n\n graticule.outline = function() {\n return {\n type: \"Polygon\",\n coordinates: [\n X(X0).concat(\n Y(Y1).slice(1),\n X(X1).reverse().slice(1),\n Y(Y0).reverse().slice(1))\n ]\n };\n };\n\n graticule.extent = function(_) {\n if (!arguments.length) return graticule.extentMinor();\n return graticule.extentMajor(_).extentMinor(_);\n };\n\n graticule.extentMajor = function(_) {\n if (!arguments.length) return [[X0, Y0], [X1, Y1]];\n X0 = +_[0][0], X1 = +_[1][0];\n Y0 = +_[0][1], Y1 = +_[1][1];\n if (X0 > X1) _ = X0, X0 = X1, X1 = _;\n if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.extentMinor = function(_) {\n if (!arguments.length) return [[x0, y0], [x1, y1]];\n x0 = +_[0][0], x1 = +_[1][0];\n y0 = +_[0][1], y1 = +_[1][1];\n if (x0 > x1) _ = x0, x0 = x1, x1 = _;\n if (y0 > y1) _ = y0, y0 = y1, y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.step = function(_) {\n if (!arguments.length) return graticule.stepMinor();\n return graticule.stepMajor(_).stepMinor(_);\n };\n\n graticule.stepMajor = function(_) {\n if (!arguments.length) return [DX, DY];\n DX = +_[0], DY = +_[1];\n return graticule;\n };\n\n graticule.stepMinor = function(_) {\n if (!arguments.length) return [dx, dy];\n dx = +_[0], dy = +_[1];\n return graticule;\n };\n\n graticule.precision = function(_) {\n if (!arguments.length) return precision;\n precision = +_;\n x = graticuleX(y0, y1, 90);\n y = graticuleY(x0, x1, precision);\n X = graticuleX(Y0, Y1, 90);\n Y = graticuleY(X0, X1, precision);\n return graticule;\n };\n\n return graticule\n .extentMajor([[-180, -90 + epsilon], [180, 90 - epsilon]])\n .extentMinor([[-180, -80 - epsilon], [180, 80 + epsilon]]);\n}\n\nexport function graticule10() {\n return graticule()();\n}\n","import { Transform, rederive, ingest, replace } from 'vega-dataflow';\nimport { error, extent, inherits, identity, isArray, isFunction, isNumber, array, constant, one, accessorName, accessorFields, field, extend, toSet, zero } from 'vega-util';\nimport { tickStep, range, max, sum } from 'd3-array';\nimport { bandwidthNRD } from 'vega-statistics';\nimport { getProjectionPath, projectionProperties, projection } from 'vega-projection';\nimport { geoGraticule } from 'd3-geo';\nimport { rgb } from 'd3-color';\nimport { canvas } from 'vega-canvas';\n\nfunction noop() {}\nconst cases = [[], [[[1.0, 1.5], [0.5, 1.0]]], [[[1.5, 1.0], [1.0, 1.5]]], [[[1.5, 1.0], [0.5, 1.0]]], [[[1.0, 0.5], [1.5, 1.0]]], [[[1.0, 1.5], [0.5, 1.0]], [[1.0, 0.5], [1.5, 1.0]]], [[[1.0, 0.5], [1.0, 1.5]]], [[[1.0, 0.5], [0.5, 1.0]]], [[[0.5, 1.0], [1.0, 0.5]]], [[[1.0, 1.5], [1.0, 0.5]]], [[[0.5, 1.0], [1.0, 0.5]], [[1.5, 1.0], [1.0, 1.5]]], [[[1.5, 1.0], [1.0, 0.5]]], [[[0.5, 1.0], [1.5, 1.0]]], [[[1.0, 1.5], [1.5, 1.0]]], [[[0.5, 1.0], [1.0, 1.5]]], []];\n\n// Implementation adapted from d3/d3-contour. Thanks!\nfunction contours () {\n var dx = 1,\n dy = 1,\n smooth = smoothLinear;\n function contours(values, tz) {\n return tz.map(value => contour(values, value));\n }\n\n // Accumulate, smooth contour rings, assign holes to exterior rings.\n // Based on https://github.com/mbostock/shapefile/blob/v0.6.2/shp/polygon.js\n function contour(values, value) {\n var polygons = [],\n holes = [];\n isorings(values, value, ring => {\n smooth(ring, values, value);\n if (area(ring) > 0) polygons.push([ring]);else holes.push(ring);\n });\n holes.forEach(hole => {\n for (var i = 0, n = polygons.length, polygon; i < n; ++i) {\n if (contains((polygon = polygons[i])[0], hole) !== -1) {\n polygon.push(hole);\n return;\n }\n }\n });\n return {\n type: 'MultiPolygon',\n value: value,\n coordinates: polygons\n };\n }\n\n // Marching squares with isolines stitched into rings.\n // Based on https://github.com/topojson/topojson-client/blob/v3.0.0/src/stitch.js\n function isorings(values, value, callback) {\n var fragmentByStart = new Array(),\n fragmentByEnd = new Array(),\n x,\n y,\n t0,\n t1,\n t2,\n t3;\n\n // Special case for the first row (y = -1, t2 = t3 = 0).\n x = y = -1;\n t1 = values[0] >= value;\n cases[t1 << 1].forEach(stitch);\n while (++x < dx - 1) {\n t0 = t1, t1 = values[x + 1] >= value;\n cases[t0 | t1 << 1].forEach(stitch);\n }\n cases[t1 << 0].forEach(stitch);\n\n // General case for the intermediate rows.\n while (++y < dy - 1) {\n x = -1;\n t1 = values[y * dx + dx] >= value;\n t2 = values[y * dx] >= value;\n cases[t1 << 1 | t2 << 2].forEach(stitch);\n while (++x < dx - 1) {\n t0 = t1, t1 = values[y * dx + dx + x + 1] >= value;\n t3 = t2, t2 = values[y * dx + x + 1] >= value;\n cases[t0 | t1 << 1 | t2 << 2 | t3 << 3].forEach(stitch);\n }\n cases[t1 | t2 << 3].forEach(stitch);\n }\n\n // Special case for the last row (y = dy - 1, t0 = t1 = 0).\n x = -1;\n t2 = values[y * dx] >= value;\n cases[t2 << 2].forEach(stitch);\n while (++x < dx - 1) {\n t3 = t2, t2 = values[y * dx + x + 1] >= value;\n cases[t2 << 2 | t3 << 3].forEach(stitch);\n }\n cases[t2 << 3].forEach(stitch);\n function stitch(line) {\n var start = [line[0][0] + x, line[0][1] + y],\n end = [line[1][0] + x, line[1][1] + y],\n startIndex = index(start),\n endIndex = index(end),\n f,\n g;\n if (f = fragmentByEnd[startIndex]) {\n if (g = fragmentByStart[endIndex]) {\n delete fragmentByEnd[f.end];\n delete fragmentByStart[g.start];\n if (f === g) {\n f.ring.push(end);\n callback(f.ring);\n } else {\n fragmentByStart[f.start] = fragmentByEnd[g.end] = {\n start: f.start,\n end: g.end,\n ring: f.ring.concat(g.ring)\n };\n }\n } else {\n delete fragmentByEnd[f.end];\n f.ring.push(end);\n fragmentByEnd[f.end = endIndex] = f;\n }\n } else if (f = fragmentByStart[endIndex]) {\n if (g = fragmentByEnd[startIndex]) {\n delete fragmentByStart[f.start];\n delete fragmentByEnd[g.end];\n if (f === g) {\n f.ring.push(end);\n callback(f.ring);\n } else {\n fragmentByStart[g.start] = fragmentByEnd[f.end] = {\n start: g.start,\n end: f.end,\n ring: g.ring.concat(f.ring)\n };\n }\n } else {\n delete fragmentByStart[f.start];\n f.ring.unshift(start);\n fragmentByStart[f.start = startIndex] = f;\n }\n } else {\n fragmentByStart[startIndex] = fragmentByEnd[endIndex] = {\n start: startIndex,\n end: endIndex,\n ring: [start, end]\n };\n }\n }\n }\n function index(point) {\n return point[0] * 2 + point[1] * (dx + 1) * 4;\n }\n function smoothLinear(ring, values, value) {\n ring.forEach(point => {\n var x = point[0],\n y = point[1],\n xt = x | 0,\n yt = y | 0,\n v0,\n v1 = values[yt * dx + xt];\n if (x > 0 && x < dx && xt === x) {\n v0 = values[yt * dx + xt - 1];\n point[0] = x + (value - v0) / (v1 - v0) - 0.5;\n }\n if (y > 0 && y < dy && yt === y) {\n v0 = values[(yt - 1) * dx + xt];\n point[1] = y + (value - v0) / (v1 - v0) - 0.5;\n }\n });\n }\n contours.contour = contour;\n contours.size = function (_) {\n if (!arguments.length) return [dx, dy];\n var _0 = Math.floor(_[0]),\n _1 = Math.floor(_[1]);\n if (!(_0 >= 0 && _1 >= 0)) error('invalid size');\n return dx = _0, dy = _1, contours;\n };\n contours.smooth = function (_) {\n return arguments.length ? (smooth = _ ? smoothLinear : noop, contours) : smooth === smoothLinear;\n };\n return contours;\n}\nfunction area(ring) {\n var i = 0,\n n = ring.length,\n area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1];\n while (++i < n) area += ring[i - 1][1] * ring[i][0] - ring[i - 1][0] * ring[i][1];\n return area;\n}\nfunction contains(ring, hole) {\n var i = -1,\n n = hole.length,\n c;\n while (++i < n) if (c = ringContains(ring, hole[i])) return c;\n return 0;\n}\nfunction ringContains(ring, point) {\n var x = point[0],\n y = point[1],\n contains = -1;\n for (var i = 0, n = ring.length, j = n - 1; i < n; j = i++) {\n var pi = ring[i],\n xi = pi[0],\n yi = pi[1],\n pj = ring[j],\n xj = pj[0],\n yj = pj[1];\n if (segmentContains(pi, pj, point)) return 0;\n if (yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi) contains = -contains;\n }\n return contains;\n}\nfunction segmentContains(a, b, c) {\n var i;\n return collinear(a, b, c) && within(a[i = +(a[0] === b[0])], c[i], b[i]);\n}\nfunction collinear(a, b, c) {\n return (b[0] - a[0]) * (c[1] - a[1]) === (c[0] - a[0]) * (b[1] - a[1]);\n}\nfunction within(p, q, r) {\n return p <= q && q <= r || r <= q && q <= p;\n}\n\nfunction quantize (k, nice, zero) {\n return function (values) {\n var ex = extent(values),\n start = zero ? Math.min(ex[0], 0) : ex[0],\n stop = ex[1],\n span = stop - start,\n step = nice ? tickStep(start, stop, k) : span / (k + 1);\n return range(start + step, stop, step);\n };\n}\n\n/**\n * Generate isocontours (level sets) based on input raster grid data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} [params.field] - The field with raster grid\n * data. If unspecified, the tuple itself is interpreted as a raster grid.\n * @param {Array} [params.thresholds] - Contour threshold array. If\n * specified, the levels, nice, resolve, and zero parameters are ignored.\n * @param {number} [params.levels] - The desired number of contour levels.\n * @param {boolean} [params.nice] - Boolean flag indicating if the contour\n * threshold values should be automatically aligned to \"nice\"\n * human-friendly values. Setting this flag may cause the number of\n * thresholds to deviate from the specified levels.\n * @param {string} [params.resolve] - The method for resolving thresholds\n * across multiple input grids. If 'independent' (the default), threshold\n * calculation will be performed separately for each grid. If 'shared', a\n * single set of threshold values will be used for all input grids.\n * @param {boolean} [params.zero] - Boolean flag indicating if the contour\n * threshold values should include zero.\n * @param {boolean} [params.smooth] - Boolean flag indicating if the contour\n * polygons should be smoothed using linear interpolation. The default is\n * true. The parameter is ignored when using density estimation.\n * @param {boolean} [params.scale] - Optional numerical value by which to\n * scale the output isocontour coordinates. This parameter can be useful\n * to scale the contours to match a desired output resolution.\n * @param {string} [params.as='contour'] - The output field in which to store\n * the generated isocontour data (default 'contour').\n */\nfunction Isocontour(params) {\n Transform.call(this, null, params);\n}\nIsocontour.Definition = {\n 'type': 'Isocontour',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'thresholds',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'levels',\n 'type': 'number'\n }, {\n 'name': 'nice',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'resolve',\n 'type': 'enum',\n 'values': ['shared', 'independent'],\n 'default': 'independent'\n }, {\n 'name': 'zero',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'smooth',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'scale',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'translate',\n 'type': 'number',\n 'array': true,\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'default': 'contour'\n }]\n};\ninherits(Isocontour, Transform, {\n transform(_, pulse) {\n if (this.value && !pulse.changed() && !_.modified()) {\n return pulse.StopPropagation;\n }\n var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n source = pulse.materialize(pulse.SOURCE).source,\n field = _.field || identity,\n contour = contours().smooth(_.smooth !== false),\n tz = _.thresholds || levels(source, field, _),\n as = _.as === null ? null : _.as || 'contour',\n values = [];\n source.forEach(t => {\n const grid = field(t);\n\n // generate contour paths in GeoJSON format\n const paths = contour.size([grid.width, grid.height])(grid.values, isArray(tz) ? tz : tz(grid.values));\n\n // adjust contour path coordinates as needed\n transformPaths(paths, grid, t, _);\n\n // ingest; copy source data properties to output\n paths.forEach(p => {\n values.push(rederive(t, ingest(as != null ? {\n [as]: p\n } : p)));\n });\n });\n if (this.value) out.rem = this.value;\n this.value = out.source = out.add = values;\n return out;\n }\n});\nfunction levels(values, f, _) {\n const q = quantize(_.levels || 10, _.nice, _.zero !== false);\n return _.resolve !== 'shared' ? q : q(values.map(t => max(f(t).values)));\n}\nfunction transformPaths(paths, grid, datum, _) {\n let s = _.scale || grid.scale,\n t = _.translate || grid.translate;\n if (isFunction(s)) s = s(datum, _);\n if (isFunction(t)) t = t(datum, _);\n if ((s === 1 || s == null) && !t) return;\n const sx = (isNumber(s) ? s : s[0]) || 1,\n sy = (isNumber(s) ? s : s[1]) || 1,\n tx = t && t[0] || 0,\n ty = t && t[1] || 0;\n paths.forEach(transform(grid, sx, sy, tx, ty));\n}\nfunction transform(grid, sx, sy, tx, ty) {\n const x1 = grid.x1 || 0,\n y1 = grid.y1 || 0,\n flip = sx * sy < 0;\n function transformPolygon(coordinates) {\n coordinates.forEach(transformRing);\n }\n function transformRing(coordinates) {\n if (flip) coordinates.reverse(); // maintain winding order\n coordinates.forEach(transformPoint);\n }\n function transformPoint(coordinates) {\n coordinates[0] = (coordinates[0] - x1) * sx + tx;\n coordinates[1] = (coordinates[1] - y1) * sy + ty;\n }\n return function (geometry) {\n geometry.coordinates.forEach(transformPolygon);\n return geometry;\n };\n}\n\nfunction radius(bw, data, f) {\n const v = bw >= 0 ? bw : bandwidthNRD(data, f);\n return Math.round((Math.sqrt(4 * v * v + 1) - 1) / 2);\n}\nfunction number(_) {\n return isFunction(_) ? _ : constant(+_);\n}\n\n// Implementation adapted from d3/d3-contour. Thanks!\nfunction density2D () {\n var x = d => d[0],\n y = d => d[1],\n weight = one,\n bandwidth = [-1, -1],\n dx = 960,\n dy = 500,\n k = 2; // log2(cellSize)\n\n function density(data, counts) {\n const rx = radius(bandwidth[0], data, x) >> k,\n // blur x-radius\n ry = radius(bandwidth[1], data, y) >> k,\n // blur y-radius\n ox = rx ? rx + 2 : 0,\n // x-offset padding for blur\n oy = ry ? ry + 2 : 0,\n // y-offset padding for blur\n n = 2 * ox + (dx >> k),\n // grid width\n m = 2 * oy + (dy >> k),\n // grid height\n values0 = new Float32Array(n * m),\n values1 = new Float32Array(n * m);\n let values = values0;\n data.forEach(d => {\n const xi = ox + (+x(d) >> k),\n yi = oy + (+y(d) >> k);\n if (xi >= 0 && xi < n && yi >= 0 && yi < m) {\n values0[xi + yi * n] += +weight(d);\n }\n });\n if (rx > 0 && ry > 0) {\n blurX(n, m, values0, values1, rx);\n blurY(n, m, values1, values0, ry);\n blurX(n, m, values0, values1, rx);\n blurY(n, m, values1, values0, ry);\n blurX(n, m, values0, values1, rx);\n blurY(n, m, values1, values0, ry);\n } else if (rx > 0) {\n blurX(n, m, values0, values1, rx);\n blurX(n, m, values1, values0, rx);\n blurX(n, m, values0, values1, rx);\n values = values1;\n } else if (ry > 0) {\n blurY(n, m, values0, values1, ry);\n blurY(n, m, values1, values0, ry);\n blurY(n, m, values0, values1, ry);\n values = values1;\n }\n\n // scale density estimates\n // density in points per square pixel or probability density\n const s = counts ? Math.pow(2, -2 * k) : 1 / sum(values);\n for (let i = 0, sz = n * m; i < sz; ++i) values[i] *= s;\n return {\n values: values,\n scale: 1 << k,\n width: n,\n height: m,\n x1: ox,\n y1: oy,\n x2: ox + (dx >> k),\n y2: oy + (dy >> k)\n };\n }\n density.x = function (_) {\n return arguments.length ? (x = number(_), density) : x;\n };\n density.y = function (_) {\n return arguments.length ? (y = number(_), density) : y;\n };\n density.weight = function (_) {\n return arguments.length ? (weight = number(_), density) : weight;\n };\n density.size = function (_) {\n if (!arguments.length) return [dx, dy];\n var _0 = +_[0],\n _1 = +_[1];\n if (!(_0 >= 0 && _1 >= 0)) error('invalid size');\n return dx = _0, dy = _1, density;\n };\n density.cellSize = function (_) {\n if (!arguments.length) return 1 << k;\n if (!((_ = +_) >= 1)) error('invalid cell size');\n k = Math.floor(Math.log(_) / Math.LN2);\n return density;\n };\n density.bandwidth = function (_) {\n if (!arguments.length) return bandwidth;\n _ = array(_);\n if (_.length === 1) _ = [+_[0], +_[0]];\n if (_.length !== 2) error('invalid bandwidth');\n return bandwidth = _, density;\n };\n return density;\n}\nfunction blurX(n, m, source, target, r) {\n const w = (r << 1) + 1;\n for (let j = 0; j < m; ++j) {\n for (let i = 0, sr = 0; i < n + r; ++i) {\n if (i < n) {\n sr += source[i + j * n];\n }\n if (i >= r) {\n if (i >= w) {\n sr -= source[i - w + j * n];\n }\n target[i - r + j * n] = sr / Math.min(i + 1, n - 1 + w - i, w);\n }\n }\n }\n}\nfunction blurY(n, m, source, target, r) {\n const w = (r << 1) + 1;\n for (let i = 0; i < n; ++i) {\n for (let j = 0, sr = 0; j < m + r; ++j) {\n if (j < m) {\n sr += source[i + j * n];\n }\n if (j >= r) {\n if (j >= w) {\n sr -= source[i + (j - w) * n];\n }\n target[i + (j - r) * n] = sr / Math.min(j + 1, m - 1 + w - j, w);\n }\n }\n }\n}\n\n/**\n * Perform 2D kernel-density estimation of point data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.size - The [width, height] extent (in\n * units of input pixels) over which to perform density estimation.\n * @param {function(object): number} params.x - The x-coordinate accessor.\n * @param {function(object): number} params.y - The y-coordinate accessor.\n * @param {function(object): number} [params.weight] - The weight accessor.\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby.\n * @param {number} [params.cellSize] - Contour density calculation cell size.\n * This parameter determines the level of spatial approximation. For example,\n * the default value of 4 maps to 2x reductions in both x- and y- dimensions.\n * A value of 1 will result in an output raster grid whose dimensions exactly\n * matches the size parameter.\n * @param {Array} [params.bandwidth] - The KDE kernel bandwidths,\n * in pixels. The input can be a two-element array specifying separate\n * x and y bandwidths, or a single-element array specifying both. If the\n * bandwidth is unspecified or less than zero, the bandwidth will be\n * automatically determined.\n * @param {boolean} [params.counts=false] - A boolean flag indicating if the\n * output values should be probability estimates (false, default) or\n * smoothed counts (true).\n * @param {string} [params.as='grid'] - The output field in which to store\n * the generated raster grid (default 'grid').\n */\nfunction KDE2D(params) {\n Transform.call(this, null, params);\n}\nKDE2D.Definition = {\n 'type': 'KDE2D',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'required': true\n }, {\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'weight',\n 'type': 'field'\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'cellSize',\n 'type': 'number'\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'counts',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'grid'\n }]\n};\nconst PARAMS = ['x', 'y', 'weight', 'size', 'cellSize', 'bandwidth'];\nfunction params(obj, _) {\n PARAMS.forEach(param => _[param] != null ? obj[param](_[param]) : 0);\n return obj;\n}\ninherits(KDE2D, Transform, {\n transform(_, pulse) {\n if (this.value && !pulse.changed() && !_.modified()) return pulse.StopPropagation;\n var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n source = pulse.materialize(pulse.SOURCE).source,\n groups = partition(source, _.groupby),\n names = (_.groupby || []).map(accessorName),\n kde = params(density2D(), _),\n as = _.as || 'grid',\n values = [];\n function set(t, vals) {\n for (let i = 0; i < names.length; ++i) t[names[i]] = vals[i];\n return t;\n }\n\n // generate density raster grids\n values = groups.map(g => ingest(set({\n [as]: kde(g, _.counts)\n }, g.dims)));\n if (this.value) out.rem = this.value;\n this.value = out.source = out.add = values;\n return out;\n }\n});\nfunction partition(data, groupby) {\n var groups = [],\n get = f => f(t),\n map,\n i,\n n,\n t,\n k,\n g;\n\n // partition data points into groups\n if (groupby == null) {\n groups.push(data);\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n if (!g) {\n map[k] = g = [];\n g.dims = k;\n groups.push(g);\n }\n g.push(t);\n }\n }\n return groups;\n}\n\n/**\n * Generate contours based on kernel-density estimation of point data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.size - The dimensions [width, height] over which to compute contours.\n * If the values parameter is provided, this must be the dimensions of the input data.\n * If density estimation is performed, this is the output view dimensions in pixels.\n * @param {Array} [params.values] - An array of numeric values representing an\n * width x height grid of values over which to compute contours. If unspecified, this\n * transform will instead attempt to compute contours for the kernel density estimate\n * using values drawn from data tuples in the input pulse.\n * @param {function(object): number} [params.x] - The pixel x-coordinate accessor for density estimation.\n * @param {function(object): number} [params.y] - The pixel y-coordinate accessor for density estimation.\n * @param {function(object): number} [params.weight] - The data point weight accessor for density estimation.\n * @param {number} [params.cellSize] - Contour density calculation cell size.\n * @param {number} [params.bandwidth] - Kernel density estimation bandwidth.\n * @param {Array} [params.thresholds] - Contour threshold array. If\n * this parameter is set, the count and nice parameters will be ignored.\n * @param {number} [params.count] - The desired number of contours.\n * @param {boolean} [params.nice] - Boolean flag indicating if the contour\n * threshold values should be automatically aligned to \"nice\"\n * human-friendly values. Setting this flag may cause the number of\n * thresholds to deviate from the specified count.\n * @param {boolean} [params.smooth] - Boolean flag indicating if the contour\n * polygons should be smoothed using linear interpolation. The default is\n * true. The parameter is ignored when using density estimation.\n */\nfunction Contour(params) {\n Transform.call(this, null, params);\n}\nContour.Definition = {\n 'type': 'Contour',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'required': true\n }, {\n 'name': 'values',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'x',\n 'type': 'field'\n }, {\n 'name': 'y',\n 'type': 'field'\n }, {\n 'name': 'weight',\n 'type': 'field'\n }, {\n 'name': 'cellSize',\n 'type': 'number'\n }, {\n 'name': 'bandwidth',\n 'type': 'number'\n }, {\n 'name': 'count',\n 'type': 'number'\n }, {\n 'name': 'nice',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'thresholds',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'smooth',\n 'type': 'boolean',\n 'default': true\n }]\n};\ninherits(Contour, Transform, {\n transform(_, pulse) {\n if (this.value && !pulse.changed() && !_.modified()) {\n return pulse.StopPropagation;\n }\n var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n contour = contours().smooth(_.smooth !== false),\n values = _.values,\n thresh = _.thresholds || quantize(_.count || 10, _.nice, !!values),\n size = _.size,\n grid,\n post;\n if (!values) {\n values = pulse.materialize(pulse.SOURCE).source;\n grid = params(density2D(), _)(values, true);\n post = transform(grid, grid.scale || 1, grid.scale || 1, 0, 0);\n size = [grid.width, grid.height];\n values = grid.values;\n }\n thresh = isArray(thresh) ? thresh : thresh(values);\n values = contour.size(size)(values, thresh);\n if (post) values.forEach(post);\n if (this.value) out.rem = this.value;\n this.value = out.source = out.add = (values || []).map(ingest);\n return out;\n }\n});\n\nconst Feature = 'Feature';\nconst FeatureCollection = 'FeatureCollection';\nconst MultiPoint = 'MultiPoint';\n\n/**\n * Consolidate an array of [longitude, latitude] points or GeoJSON features\n * into a combined GeoJSON object. This transform is particularly useful for\n * combining geo data for a Projection's fit argument. The resulting GeoJSON\n * data is available as this transform's value. Input pulses are unchanged.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.fields] - A two-element array\n * of field accessors for the longitude and latitude values.\n * @param {function(object): *} params.geojson - A field accessor for\n * retrieving GeoJSON feature data.\n */\nfunction GeoJSON(params) {\n Transform.call(this, null, params);\n}\nGeoJSON.Definition = {\n 'type': 'GeoJSON',\n 'metadata': {},\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'geojson',\n 'type': 'field'\n }]\n};\ninherits(GeoJSON, Transform, {\n transform(_, pulse) {\n var features = this._features,\n points = this._points,\n fields = _.fields,\n lon = fields && fields[0],\n lat = fields && fields[1],\n geojson = _.geojson || !fields && identity,\n flag = pulse.ADD,\n mod;\n mod = _.modified() || pulse.changed(pulse.REM) || pulse.modified(accessorFields(geojson)) || lon && pulse.modified(accessorFields(lon)) || lat && pulse.modified(accessorFields(lat));\n if (!this.value || mod) {\n flag = pulse.SOURCE;\n this._features = features = [];\n this._points = points = [];\n }\n if (geojson) {\n pulse.visit(flag, t => features.push(geojson(t)));\n }\n if (lon && lat) {\n pulse.visit(flag, t => {\n var x = lon(t),\n y = lat(t);\n if (x != null && y != null && (x = +x) === x && (y = +y) === y) {\n points.push([x, y]);\n }\n });\n features = features.concat({\n type: Feature,\n geometry: {\n type: MultiPoint,\n coordinates: points\n }\n });\n }\n this.value = {\n type: FeatureCollection,\n features: features\n };\n }\n});\n\n/**\n * Map GeoJSON data to an SVG path string.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(number, number): *} params.projection - The cartographic\n * projection to apply.\n * @param {function(object): *} [params.field] - The field with GeoJSON data,\n * or null if the tuple itself is a GeoJSON feature.\n * @param {string} [params.as='path'] - The output field in which to store\n * the generated path data (default 'path').\n */\nfunction GeoPath(params) {\n Transform.call(this, null, params);\n}\nGeoPath.Definition = {\n 'type': 'GeoPath',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'projection',\n 'type': 'projection'\n }, {\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'pointRadius',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'path'\n }]\n};\ninherits(GeoPath, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ALL),\n path = this.value,\n field = _.field || identity,\n as = _.as || 'path',\n flag = out.SOURCE;\n if (!path || _.modified()) {\n // parameters updated, reset and reflow\n this.value = path = getProjectionPath(_.projection);\n out.materialize().reflow();\n } else {\n flag = field === identity || pulse.modified(field.fields) ? out.ADD_MOD : out.ADD;\n }\n const prev = initPath(path, _.pointRadius);\n out.visit(flag, t => t[as] = path(field(t)));\n path.pointRadius(prev);\n return out.modifies(as);\n }\n});\nfunction initPath(path, pointRadius) {\n const prev = path.pointRadius();\n path.context(null);\n if (pointRadius != null) {\n path.pointRadius(pointRadius);\n }\n return prev;\n}\n\n/**\n * Geo-code a longitude/latitude point to an x/y coordinate.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(number, number): *} params.projection - The cartographic\n * projection to apply.\n * @param {Array} params.fields - A two-element array of\n * field accessors for the longitude and latitude values.\n * @param {Array} [params.as] - A two-element array of field names\n * under which to store the result. Defaults to ['x','y'].\n */\nfunction GeoPoint(params) {\n Transform.call(this, null, params);\n}\nGeoPoint.Definition = {\n 'type': 'GeoPoint',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'projection',\n 'type': 'projection',\n 'required': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['x', 'y']\n }]\n};\ninherits(GeoPoint, Transform, {\n transform(_, pulse) {\n var proj = _.projection,\n lon = _.fields[0],\n lat = _.fields[1],\n as = _.as || ['x', 'y'],\n x = as[0],\n y = as[1],\n mod;\n function set(t) {\n const xy = proj([lon(t), lat(t)]);\n if (xy) {\n t[x] = xy[0];\n t[y] = xy[1];\n } else {\n t[x] = undefined;\n t[y] = undefined;\n }\n }\n if (_.modified()) {\n // parameters updated, reflow\n pulse = pulse.materialize().reflow(true).visit(pulse.SOURCE, set);\n } else {\n mod = pulse.modified(lon.fields) || pulse.modified(lat.fields);\n pulse.visit(mod ? pulse.ADD_MOD : pulse.ADD, set);\n }\n return pulse.modifies(as);\n }\n});\n\n/**\n * Annotate items with a geopath shape generator.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(number, number): *} params.projection - The cartographic\n * projection to apply.\n * @param {function(object): *} [params.field] - The field with GeoJSON data,\n * or null if the tuple itself is a GeoJSON feature.\n * @param {string} [params.as='shape'] - The output field in which to store\n * the generated path data (default 'shape').\n */\nfunction GeoShape(params) {\n Transform.call(this, null, params);\n}\nGeoShape.Definition = {\n 'type': 'GeoShape',\n 'metadata': {\n 'modifies': true,\n 'nomod': true\n },\n 'params': [{\n 'name': 'projection',\n 'type': 'projection'\n }, {\n 'name': 'field',\n 'type': 'field',\n 'default': 'datum'\n }, {\n 'name': 'pointRadius',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'shape'\n }]\n};\ninherits(GeoShape, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ALL),\n shape = this.value,\n as = _.as || 'shape',\n flag = out.ADD;\n if (!shape || _.modified()) {\n // parameters updated, reset and reflow\n this.value = shape = shapeGenerator(getProjectionPath(_.projection), _.field || field('datum'), _.pointRadius);\n out.materialize().reflow();\n flag = out.SOURCE;\n }\n out.visit(flag, t => t[as] = shape);\n return out.modifies(as);\n }\n});\nfunction shapeGenerator(path, field, pointRadius) {\n const shape = pointRadius == null ? _ => path(field(_)) : _ => {\n var prev = path.pointRadius(),\n value = path.pointRadius(pointRadius)(field(_));\n path.pointRadius(prev);\n return value;\n };\n shape.context = _ => {\n path.context(_);\n return shape;\n };\n return shape;\n}\n\n/**\n * GeoJSON feature generator for creating graticules.\n * @constructor\n */\nfunction Graticule(params) {\n Transform.call(this, [], params);\n this.generator = geoGraticule();\n}\nGraticule.Definition = {\n 'type': 'Graticule',\n 'metadata': {\n 'changes': true,\n 'generates': true\n },\n 'params': [{\n 'name': 'extent',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'extentMajor',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'extentMinor',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'step',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'stepMajor',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'default': [90, 360]\n }, {\n 'name': 'stepMinor',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'default': [10, 10]\n }, {\n 'name': 'precision',\n 'type': 'number',\n 'default': 2.5\n }]\n};\ninherits(Graticule, Transform, {\n transform(_, pulse) {\n var src = this.value,\n gen = this.generator,\n t;\n if (!src.length || _.modified()) {\n for (const prop in _) {\n if (isFunction(gen[prop])) {\n gen[prop](_[prop]);\n }\n }\n }\n t = gen();\n if (src.length) {\n pulse.mod.push(replace(src[0], t));\n } else {\n pulse.add.push(ingest(t));\n }\n src[0] = t;\n return pulse;\n }\n});\n\n/**\n * Render a heatmap image for input raster grid data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} [params.field] - The field with raster grid\n * data. If unspecified, the tuple itself is interpreted as a raster grid.\n * @param {string} [params.color] - A constant color value or function for\n * individual pixel color. If a function, it will be invoked with an input\n * object that includes $x, $y, $value, and $max fields for the grid.\n * @param {number} [params.opacity] - A constant opacity value or function for\n * individual pixel opacity. If a function, it will be invoked with an input\n * object that includes $x, $y, $value, and $max fields for the grid.\n * @param {string} [params.resolve] - The method for resolving maximum values\n * across multiple input grids. If 'independent' (the default), maximum\n * calculation will be performed separately for each grid. If 'shared',\n * a single global maximum will be used for all input grids.\n * @param {string} [params.as='image'] - The output field in which to store\n * the generated bitmap canvas images (default 'image').\n */\nfunction Heatmap(params) {\n Transform.call(this, null, params);\n}\nHeatmap.Definition = {\n 'type': 'heatmap',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'color',\n 'type': 'string',\n 'expr': true\n }, {\n 'name': 'opacity',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'resolve',\n 'type': 'enum',\n 'values': ['shared', 'independent'],\n 'default': 'independent'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'image'\n }]\n};\ninherits(Heatmap, Transform, {\n transform(_, pulse) {\n if (!pulse.changed() && !_.modified()) {\n return pulse.StopPropagation;\n }\n var source = pulse.materialize(pulse.SOURCE).source,\n shared = _.resolve === 'shared',\n field = _.field || identity,\n opacity = opacity_(_.opacity, _),\n color = color_(_.color, _),\n as = _.as || 'image',\n obj = {\n $x: 0,\n $y: 0,\n $value: 0,\n $max: shared ? max(source.map(t => max(field(t).values))) : 0\n };\n source.forEach(t => {\n const v = field(t);\n\n // build proxy data object\n const o = extend({}, t, obj);\n // set maximum value if not globally shared\n if (!shared) o.$max = max(v.values || []);\n\n // generate canvas image\n // optimize color/opacity if not pixel-dependent\n t[as] = toCanvas(v, o, color.dep ? color : constant(color(o)), opacity.dep ? opacity : constant(opacity(o)));\n });\n return pulse.reflow(true).modifies(as);\n }\n});\n\n// get image color function\nfunction color_(color, _) {\n let f;\n if (isFunction(color)) {\n f = obj => rgb(color(obj, _));\n f.dep = dependency(color);\n } else {\n // default to mid-grey\n f = constant(rgb(color || '#888'));\n }\n return f;\n}\n\n// get image opacity function\nfunction opacity_(opacity, _) {\n let f;\n if (isFunction(opacity)) {\n f = obj => opacity(obj, _);\n f.dep = dependency(opacity);\n } else if (opacity) {\n f = constant(opacity);\n } else {\n // default to [0, max] opacity gradient\n f = obj => obj.$value / obj.$max || 0;\n f.dep = true;\n }\n return f;\n}\n\n// check if function depends on individual pixel data\nfunction dependency(f) {\n if (!isFunction(f)) return false;\n const set = toSet(accessorFields(f));\n return set.$x || set.$y || set.$value || set.$max;\n}\n\n// render raster grid to canvas\nfunction toCanvas(grid, obj, color, opacity) {\n const n = grid.width,\n m = grid.height,\n x1 = grid.x1 || 0,\n y1 = grid.y1 || 0,\n x2 = grid.x2 || n,\n y2 = grid.y2 || m,\n val = grid.values,\n value = val ? i => val[i] : zero,\n can = canvas(x2 - x1, y2 - y1),\n ctx = can.getContext('2d'),\n img = ctx.getImageData(0, 0, x2 - x1, y2 - y1),\n pix = img.data;\n for (let j = y1, k = 0; j < y2; ++j) {\n obj.$y = j - y1;\n for (let i = x1, r = j * n; i < x2; ++i, k += 4) {\n obj.$x = i - x1;\n obj.$value = value(i + r);\n const v = color(obj);\n pix[k + 0] = v.r;\n pix[k + 1] = v.g;\n pix[k + 2] = v.b;\n pix[k + 3] = ~~(255 * opacity(obj));\n }\n }\n ctx.putImageData(img, 0, 0);\n return can;\n}\n\n/**\n * Maintains a cartographic projection.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction Projection(params) {\n Transform.call(this, null, params);\n this.modified(true); // always treat as modified\n}\n\ninherits(Projection, Transform, {\n transform(_, pulse) {\n let proj = this.value;\n if (!proj || _.modified('type')) {\n this.value = proj = create(_.type);\n projectionProperties.forEach(prop => {\n if (_[prop] != null) set(proj, prop, _[prop]);\n });\n } else {\n projectionProperties.forEach(prop => {\n if (_.modified(prop)) set(proj, prop, _[prop]);\n });\n }\n if (_.pointRadius != null) proj.path.pointRadius(_.pointRadius);\n if (_.fit) fit(proj, _);\n return pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n }\n});\nfunction fit(proj, _) {\n const data = collectGeoJSON(_.fit);\n _.extent ? proj.fitExtent(_.extent, data) : _.size ? proj.fitSize(_.size, data) : 0;\n}\nfunction create(type) {\n const constructor = projection((type || 'mercator').toLowerCase());\n if (!constructor) error('Unrecognized projection type: ' + type);\n return constructor();\n}\nfunction set(proj, key, value) {\n if (isFunction(proj[key])) proj[key](value);\n}\nfunction collectGeoJSON(data) {\n data = array(data);\n return data.length === 1 ? data[0] : {\n type: FeatureCollection,\n features: data.reduce((a, f) => a.concat(featurize(f)), [])\n };\n}\nfunction featurize(f) {\n return f.type === FeatureCollection ? f.features : array(f).filter(d => d != null).map(d => d.type === Feature ? d : {\n type: Feature,\n geometry: d\n });\n}\n\nexport { Contour as contour, GeoJSON as geojson, GeoPath as geopath, GeoPoint as geopoint, GeoShape as geoshape, Graticule as graticule, Heatmap as heatmap, Isocontour as isocontour, KDE2D as kde2d, Projection as projection };\n","export default function(d) {\n const x = +this._x.call(null, d),\n y = +this._y.call(null, d);\n return add(this.cover(x, y), x, y, d);\n}\n\nfunction add(tree, x, y, d) {\n if (isNaN(x) || isNaN(y)) return tree; // ignore invalid points\n\n var parent,\n node = tree._root,\n leaf = {data: d},\n x0 = tree._x0,\n y0 = tree._y0,\n x1 = tree._x1,\n y1 = tree._y1,\n xm,\n ym,\n xp,\n yp,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return tree._root = leaf, tree;\n\n // Find the existing leaf for the new point, or add it.\n while (node.length) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree;\n }\n\n // Is the new point is exactly coincident with the existing point?\n xp = +tree._x.call(null, node.data);\n yp = +tree._y.call(null, node.data);\n if (x === xp && y === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;\n\n // Otherwise, split the leaf node until the old and new point are separated.\n do {\n parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4);\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n } while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | (xp >= xm)));\n return parent[j] = node, parent[i] = leaf, tree;\n}\n\nexport function addAll(data) {\n var d, i, n = data.length,\n x,\n y,\n xz = new Array(n),\n yz = new Array(n),\n x0 = Infinity,\n y0 = Infinity,\n x1 = -Infinity,\n y1 = -Infinity;\n\n // Compute the points and their extent.\n for (i = 0; i < n; ++i) {\n if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d))) continue;\n xz[i] = x;\n yz[i] = y;\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n }\n\n // If there were no (valid) points, abort.\n if (x0 > x1 || y0 > y1) return this;\n\n // Expand the tree to cover the new points.\n this.cover(x0, y0).cover(x1, y1);\n\n // Add the new points.\n for (i = 0; i < n; ++i) {\n add(this, xz[i], yz[i], data[i]);\n }\n\n return this;\n}\n","export default function(node, x0, y0, x1, y1) {\n this.node = node;\n this.x0 = x0;\n this.y0 = y0;\n this.x1 = x1;\n this.y1 = y1;\n}\n","export function defaultX(d) {\n return d[0];\n}\n\nexport default function(_) {\n return arguments.length ? (this._x = _, this) : this._x;\n}\n","export function defaultY(d) {\n return d[1];\n}\n\nexport default function(_) {\n return arguments.length ? (this._y = _, this) : this._y;\n}\n","import tree_add, {addAll as tree_addAll} from \"./add.js\";\nimport tree_cover from \"./cover.js\";\nimport tree_data from \"./data.js\";\nimport tree_extent from \"./extent.js\";\nimport tree_find from \"./find.js\";\nimport tree_remove, {removeAll as tree_removeAll} from \"./remove.js\";\nimport tree_root from \"./root.js\";\nimport tree_size from \"./size.js\";\nimport tree_visit from \"./visit.js\";\nimport tree_visitAfter from \"./visitAfter.js\";\nimport tree_x, {defaultX} from \"./x.js\";\nimport tree_y, {defaultY} from \"./y.js\";\n\nexport default function quadtree(nodes, x, y) {\n var tree = new Quadtree(x == null ? defaultX : x, y == null ? defaultY : y, NaN, NaN, NaN, NaN);\n return nodes == null ? tree : tree.addAll(nodes);\n}\n\nfunction Quadtree(x, y, x0, y0, x1, y1) {\n this._x = x;\n this._y = y;\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n this._root = undefined;\n}\n\nfunction leaf_copy(leaf) {\n var copy = {data: leaf.data}, next = copy;\n while (leaf = leaf.next) next = next.next = {data: leaf.data};\n return copy;\n}\n\nvar treeProto = quadtree.prototype = Quadtree.prototype;\n\ntreeProto.copy = function() {\n var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1),\n node = this._root,\n nodes,\n child;\n\n if (!node) return copy;\n\n if (!node.length) return copy._root = leaf_copy(node), copy;\n\n nodes = [{source: node, target: copy._root = new Array(4)}];\n while (node = nodes.pop()) {\n for (var i = 0; i < 4; ++i) {\n if (child = node.source[i]) {\n if (child.length) nodes.push({source: child, target: node.target[i] = new Array(4)});\n else node.target[i] = leaf_copy(child);\n }\n }\n }\n\n return copy;\n};\n\ntreeProto.add = tree_add;\ntreeProto.addAll = tree_addAll;\ntreeProto.cover = tree_cover;\ntreeProto.data = tree_data;\ntreeProto.extent = tree_extent;\ntreeProto.find = tree_find;\ntreeProto.remove = tree_remove;\ntreeProto.removeAll = tree_removeAll;\ntreeProto.root = tree_root;\ntreeProto.size = tree_size;\ntreeProto.visit = tree_visit;\ntreeProto.visitAfter = tree_visitAfter;\ntreeProto.x = tree_x;\ntreeProto.y = tree_y;\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export default function(random) {\n return (random() - 0.5) * 1e-6;\n}\n","import {quadtree} from \"d3-quadtree\";\nimport constant from \"./constant.js\";\nimport jiggle from \"./jiggle.js\";\n\nfunction x(d) {\n return d.x + d.vx;\n}\n\nfunction y(d) {\n return d.y + d.vy;\n}\n\nexport default function(radius) {\n var nodes,\n radii,\n random,\n strength = 1,\n iterations = 1;\n\n if (typeof radius !== \"function\") radius = constant(radius == null ? 1 : +radius);\n\n function force() {\n var i, n = nodes.length,\n tree,\n node,\n xi,\n yi,\n ri,\n ri2;\n\n for (var k = 0; k < iterations; ++k) {\n tree = quadtree(nodes, x, y).visitAfter(prepare);\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n ri = radii[node.index], ri2 = ri * ri;\n xi = node.x + node.vx;\n yi = node.y + node.vy;\n tree.visit(apply);\n }\n }\n\n function apply(quad, x0, y0, x1, y1) {\n var data = quad.data, rj = quad.r, r = ri + rj;\n if (data) {\n if (data.index > node.index) {\n var x = xi - data.x - data.vx,\n y = yi - data.y - data.vy,\n l = x * x + y * y;\n if (l < r * r) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n l = (r - (l = Math.sqrt(l))) / l * strength;\n node.vx += (x *= l) * (r = (rj *= rj) / (ri2 + rj));\n node.vy += (y *= l) * r;\n data.vx -= x * (r = 1 - r);\n data.vy -= y * r;\n }\n }\n return;\n }\n return x0 > xi + r || x1 < xi - r || y0 > yi + r || y1 < yi - r;\n }\n }\n\n function prepare(quad) {\n if (quad.data) return quad.r = radii[quad.data.index];\n for (var i = quad.r = 0; i < 4; ++i) {\n if (quad[i] && quad[i].r > quad.r) {\n quad.r = quad[i].r;\n }\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length, node;\n radii = new Array(n);\n for (i = 0; i < n; ++i) node = nodes[i], radii[node.index] = +radius(node, i, nodes);\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.iterations = function(_) {\n return arguments.length ? (iterations = +_, force) : iterations;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = +_, force) : strength;\n };\n\n force.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : radius;\n };\n\n return force;\n}\n","export default function(x, y) {\n if (isNaN(x = +x) || isNaN(y = +y)) return this; // ignore invalid points\n\n var x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1;\n\n // If the quadtree has no extent, initialize them.\n // Integer extent are necessary so that if we later double the extent,\n // the existing quadrant boundaries don’t change due to floating point error!\n if (isNaN(x0)) {\n x1 = (x0 = Math.floor(x)) + 1;\n y1 = (y0 = Math.floor(y)) + 1;\n }\n\n // Otherwise, double repeatedly to cover.\n else {\n var z = x1 - x0 || 1,\n node = this._root,\n parent,\n i;\n\n while (x0 > x || x >= x1 || y0 > y || y >= y1) {\n i = (y < y0) << 1 | (x < x0);\n parent = new Array(4), parent[i] = node, node = parent, z *= 2;\n switch (i) {\n case 0: x1 = x0 + z, y1 = y0 + z; break;\n case 1: x0 = x1 - z, y1 = y0 + z; break;\n case 2: x1 = x0 + z, y0 = y1 - z; break;\n case 3: x0 = x1 - z, y0 = y1 - z; break;\n }\n }\n\n if (this._root && this._root.length) this._root = node;\n }\n\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n return this;\n}\n","export default function() {\n var data = [];\n this.visit(function(node) {\n if (!node.length) do data.push(node.data); while (node = node.next)\n });\n return data;\n}\n","export default function(_) {\n return arguments.length\n ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1])\n : isNaN(this._x0) ? undefined : [[this._x0, this._y0], [this._x1, this._y1]];\n}\n","import Quad from \"./quad.js\";\n\nexport default function(x, y, radius) {\n var data,\n x0 = this._x0,\n y0 = this._y0,\n x1,\n y1,\n x2,\n y2,\n x3 = this._x1,\n y3 = this._y1,\n quads = [],\n node = this._root,\n q,\n i;\n\n if (node) quads.push(new Quad(node, x0, y0, x3, y3));\n if (radius == null) radius = Infinity;\n else {\n x0 = x - radius, y0 = y - radius;\n x3 = x + radius, y3 = y + radius;\n radius *= radius;\n }\n\n while (q = quads.pop()) {\n\n // Stop searching if this quadrant can’t contain a closer node.\n if (!(node = q.node)\n || (x1 = q.x0) > x3\n || (y1 = q.y0) > y3\n || (x2 = q.x1) < x0\n || (y2 = q.y1) < y0) continue;\n\n // Bisect the current quadrant.\n if (node.length) {\n var xm = (x1 + x2) / 2,\n ym = (y1 + y2) / 2;\n\n quads.push(\n new Quad(node[3], xm, ym, x2, y2),\n new Quad(node[2], x1, ym, xm, y2),\n new Quad(node[1], xm, y1, x2, ym),\n new Quad(node[0], x1, y1, xm, ym)\n );\n\n // Visit the closest quadrant first.\n if (i = (y >= ym) << 1 | (x >= xm)) {\n q = quads[quads.length - 1];\n quads[quads.length - 1] = quads[quads.length - 1 - i];\n quads[quads.length - 1 - i] = q;\n }\n }\n\n // Visit this point. (Visiting coincident points isn’t necessary!)\n else {\n var dx = x - +this._x.call(null, node.data),\n dy = y - +this._y.call(null, node.data),\n d2 = dx * dx + dy * dy;\n if (d2 < radius) {\n var d = Math.sqrt(radius = d2);\n x0 = x - d, y0 = y - d;\n x3 = x + d, y3 = y + d;\n data = node.data;\n }\n }\n }\n\n return data;\n}\n","export default function(d) {\n if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d))) return this; // ignore invalid points\n\n var parent,\n node = this._root,\n retainer,\n previous,\n next,\n x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1,\n x,\n y,\n xm,\n ym,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return this;\n\n // Find the leaf node for the point.\n // While descending, also retain the deepest parent with a non-removed sibling.\n if (node.length) while (true) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (!(parent = node, node = node[i = bottom << 1 | right])) return this;\n if (!node.length) break;\n if (parent[(i + 1) & 3] || parent[(i + 2) & 3] || parent[(i + 3) & 3]) retainer = parent, j = i;\n }\n\n // Find the point to remove.\n while (node.data !== d) if (!(previous = node, node = node.next)) return this;\n if (next = node.next) delete node.next;\n\n // If there are multiple coincident points, remove just the point.\n if (previous) return (next ? previous.next = next : delete previous.next), this;\n\n // If this is the root point, remove it.\n if (!parent) return this._root = next, this;\n\n // Remove this leaf.\n next ? parent[i] = next : delete parent[i];\n\n // If the parent now contains exactly one leaf, collapse superfluous parents.\n if ((node = parent[0] || parent[1] || parent[2] || parent[3])\n && node === (parent[3] || parent[2] || parent[1] || parent[0])\n && !node.length) {\n if (retainer) retainer[j] = node;\n else this._root = node;\n }\n\n return this;\n}\n\nexport function removeAll(data) {\n for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);\n return this;\n}\n","export default function() {\n return this._root;\n}\n","export default function() {\n var size = 0;\n this.visit(function(node) {\n if (!node.length) do ++size; while (node = node.next)\n });\n return size;\n}\n","import Quad from \"./quad.js\";\n\nexport default function(callback) {\n var quads = [], q, node = this._root, child, x0, y0, x1, y1;\n if (node) quads.push(new Quad(node, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) {\n var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));\n if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));\n if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));\n if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));\n }\n }\n return this;\n}\n","import Quad from \"./quad.js\";\n\nexport default function(callback) {\n var quads = [], next = [], q;\n if (this._root) quads.push(new Quad(this._root, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n var node = q.node;\n if (node.length) {\n var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));\n if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));\n if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));\n if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));\n }\n next.push(q);\n }\n while (q = next.pop()) {\n callback(q.node, q.x0, q.y0, q.x1, q.y1);\n }\n return this;\n}\n","var noop = {value: () => {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n","var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n","// https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use\nconst a = 1664525;\nconst c = 1013904223;\nconst m = 4294967296; // 2^32\n\nexport default function() {\n let s = 1;\n return () => (s = (a * s + c) % m) / m;\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {timer} from \"d3-timer\";\nimport lcg from \"./lcg.js\";\n\nexport function x(d) {\n return d.x;\n}\n\nexport function y(d) {\n return d.y;\n}\n\nvar initialRadius = 10,\n initialAngle = Math.PI * (3 - Math.sqrt(5));\n\nexport default function(nodes) {\n var simulation,\n alpha = 1,\n alphaMin = 0.001,\n alphaDecay = 1 - Math.pow(alphaMin, 1 / 300),\n alphaTarget = 0,\n velocityDecay = 0.6,\n forces = new Map(),\n stepper = timer(step),\n event = dispatch(\"tick\", \"end\"),\n random = lcg();\n\n if (nodes == null) nodes = [];\n\n function step() {\n tick();\n event.call(\"tick\", simulation);\n if (alpha < alphaMin) {\n stepper.stop();\n event.call(\"end\", simulation);\n }\n }\n\n function tick(iterations) {\n var i, n = nodes.length, node;\n\n if (iterations === undefined) iterations = 1;\n\n for (var k = 0; k < iterations; ++k) {\n alpha += (alphaTarget - alpha) * alphaDecay;\n\n forces.forEach(function(force) {\n force(alpha);\n });\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n if (node.fx == null) node.x += node.vx *= velocityDecay;\n else node.x = node.fx, node.vx = 0;\n if (node.fy == null) node.y += node.vy *= velocityDecay;\n else node.y = node.fy, node.vy = 0;\n }\n }\n\n return simulation;\n }\n\n function initializeNodes() {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.index = i;\n if (node.fx != null) node.x = node.fx;\n if (node.fy != null) node.y = node.fy;\n if (isNaN(node.x) || isNaN(node.y)) {\n var radius = initialRadius * Math.sqrt(0.5 + i), angle = i * initialAngle;\n node.x = radius * Math.cos(angle);\n node.y = radius * Math.sin(angle);\n }\n if (isNaN(node.vx) || isNaN(node.vy)) {\n node.vx = node.vy = 0;\n }\n }\n }\n\n function initializeForce(force) {\n if (force.initialize) force.initialize(nodes, random);\n return force;\n }\n\n initializeNodes();\n\n return simulation = {\n tick: tick,\n\n restart: function() {\n return stepper.restart(step), simulation;\n },\n\n stop: function() {\n return stepper.stop(), simulation;\n },\n\n nodes: function(_) {\n return arguments.length ? (nodes = _, initializeNodes(), forces.forEach(initializeForce), simulation) : nodes;\n },\n\n alpha: function(_) {\n return arguments.length ? (alpha = +_, simulation) : alpha;\n },\n\n alphaMin: function(_) {\n return arguments.length ? (alphaMin = +_, simulation) : alphaMin;\n },\n\n alphaDecay: function(_) {\n return arguments.length ? (alphaDecay = +_, simulation) : +alphaDecay;\n },\n\n alphaTarget: function(_) {\n return arguments.length ? (alphaTarget = +_, simulation) : alphaTarget;\n },\n\n velocityDecay: function(_) {\n return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay;\n },\n\n randomSource: function(_) {\n return arguments.length ? (random = _, forces.forEach(initializeForce), simulation) : random;\n },\n\n force: function(name, _) {\n return arguments.length > 1 ? ((_ == null ? forces.delete(name) : forces.set(name, initializeForce(_))), simulation) : forces.get(name);\n },\n\n find: function(x, y, radius) {\n var i = 0,\n n = nodes.length,\n dx,\n dy,\n d2,\n node,\n closest;\n\n if (radius == null) radius = Infinity;\n else radius *= radius;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n dx = x - node.x;\n dy = y - node.y;\n d2 = dx * dx + dy * dy;\n if (d2 < radius) closest = node, radius = d2;\n }\n\n return closest;\n },\n\n on: function(name, _) {\n return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name);\n }\n };\n}\n","import constant from \"./constant.js\";\nimport jiggle from \"./jiggle.js\";\n\nfunction index(d) {\n return d.index;\n}\n\nfunction find(nodeById, nodeId) {\n var node = nodeById.get(nodeId);\n if (!node) throw new Error(\"node not found: \" + nodeId);\n return node;\n}\n\nexport default function(links) {\n var id = index,\n strength = defaultStrength,\n strengths,\n distance = constant(30),\n distances,\n nodes,\n count,\n bias,\n random,\n iterations = 1;\n\n if (links == null) links = [];\n\n function defaultStrength(link) {\n return 1 / Math.min(count[link.source.index], count[link.target.index]);\n }\n\n function force(alpha) {\n for (var k = 0, n = links.length; k < iterations; ++k) {\n for (var i = 0, link, source, target, x, y, l, b; i < n; ++i) {\n link = links[i], source = link.source, target = link.target;\n x = target.x + target.vx - source.x - source.vx || jiggle(random);\n y = target.y + target.vy - source.y - source.vy || jiggle(random);\n l = Math.sqrt(x * x + y * y);\n l = (l - distances[i]) / l * alpha * strengths[i];\n x *= l, y *= l;\n target.vx -= x * (b = bias[i]);\n target.vy -= y * b;\n source.vx += x * (b = 1 - b);\n source.vy += y * b;\n }\n }\n }\n\n function initialize() {\n if (!nodes) return;\n\n var i,\n n = nodes.length,\n m = links.length,\n nodeById = new Map(nodes.map((d, i) => [id(d, i, nodes), d])),\n link;\n\n for (i = 0, count = new Array(n); i < m; ++i) {\n link = links[i], link.index = i;\n if (typeof link.source !== \"object\") link.source = find(nodeById, link.source);\n if (typeof link.target !== \"object\") link.target = find(nodeById, link.target);\n count[link.source.index] = (count[link.source.index] || 0) + 1;\n count[link.target.index] = (count[link.target.index] || 0) + 1;\n }\n\n for (i = 0, bias = new Array(m); i < m; ++i) {\n link = links[i], bias[i] = count[link.source.index] / (count[link.source.index] + count[link.target.index]);\n }\n\n strengths = new Array(m), initializeStrength();\n distances = new Array(m), initializeDistance();\n }\n\n function initializeStrength() {\n if (!nodes) return;\n\n for (var i = 0, n = links.length; i < n; ++i) {\n strengths[i] = +strength(links[i], i, links);\n }\n }\n\n function initializeDistance() {\n if (!nodes) return;\n\n for (var i = 0, n = links.length; i < n; ++i) {\n distances[i] = +distance(links[i], i, links);\n }\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.links = function(_) {\n return arguments.length ? (links = _, initialize(), force) : links;\n };\n\n force.id = function(_) {\n return arguments.length ? (id = _, force) : id;\n };\n\n force.iterations = function(_) {\n return arguments.length ? (iterations = +_, force) : iterations;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initializeStrength(), force) : strength;\n };\n\n force.distance = function(_) {\n return arguments.length ? (distance = typeof _ === \"function\" ? _ : constant(+_), initializeDistance(), force) : distance;\n };\n\n return force;\n}\n","import { Transform } from 'vega-dataflow';\nimport { inherits, array, isFunction, accessorFields, hasOwnProperty, error } from 'vega-util';\nimport { forceSimulation, forceCenter, forceCollide, forceManyBody, forceLink, forceX, forceY } from 'd3-force';\n\nconst ForceMap = {\n center: forceCenter,\n collide: forceCollide,\n nbody: forceManyBody,\n link: forceLink,\n x: forceX,\n y: forceY\n};\nconst Forces = 'forces',\n ForceParams = ['alpha', 'alphaMin', 'alphaTarget', 'velocityDecay', 'forces'],\n ForceConfig = ['static', 'iterations'],\n ForceOutput = ['x', 'y', 'vx', 'vy'];\n\n/**\n * Force simulation layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.forces - The forces to apply.\n */\nfunction Force(params) {\n Transform.call(this, null, params);\n}\nForce.Definition = {\n 'type': 'Force',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'static',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'restart',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'iterations',\n 'type': 'number',\n 'default': 300\n }, {\n 'name': 'alpha',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'alphaMin',\n 'type': 'number',\n 'default': 0.001\n }, {\n 'name': 'alphaTarget',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'velocityDecay',\n 'type': 'number',\n 'default': 0.4\n }, {\n 'name': 'forces',\n 'type': 'param',\n 'array': true,\n 'params': [{\n 'key': {\n 'force': 'center'\n },\n 'params': [{\n 'name': 'x',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'y',\n 'type': 'number',\n 'default': 0\n }]\n }, {\n 'key': {\n 'force': 'collide'\n },\n 'params': [{\n 'name': 'radius',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'strength',\n 'type': 'number',\n 'default': 0.7\n }, {\n 'name': 'iterations',\n 'type': 'number',\n 'default': 1\n }]\n }, {\n 'key': {\n 'force': 'nbody'\n },\n 'params': [{\n 'name': 'strength',\n 'type': 'number',\n 'default': -30,\n 'expr': true\n }, {\n 'name': 'theta',\n 'type': 'number',\n 'default': 0.9\n }, {\n 'name': 'distanceMin',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'distanceMax',\n 'type': 'number'\n }]\n }, {\n 'key': {\n 'force': 'link'\n },\n 'params': [{\n 'name': 'links',\n 'type': 'data'\n }, {\n 'name': 'id',\n 'type': 'field'\n }, {\n 'name': 'distance',\n 'type': 'number',\n 'default': 30,\n 'expr': true\n }, {\n 'name': 'strength',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'iterations',\n 'type': 'number',\n 'default': 1\n }]\n }, {\n 'key': {\n 'force': 'x'\n },\n 'params': [{\n 'name': 'strength',\n 'type': 'number',\n 'default': 0.1\n }, {\n 'name': 'x',\n 'type': 'field'\n }]\n }, {\n 'key': {\n 'force': 'y'\n },\n 'params': [{\n 'name': 'strength',\n 'type': 'number',\n 'default': 0.1\n }, {\n 'name': 'y',\n 'type': 'field'\n }]\n }]\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'modify': false,\n 'default': ForceOutput\n }]\n};\ninherits(Force, Transform, {\n transform(_, pulse) {\n var sim = this.value,\n change = pulse.changed(pulse.ADD_REM),\n params = _.modified(ForceParams),\n iters = _.iterations || 300;\n\n // configure simulation\n if (!sim) {\n this.value = sim = simulation(pulse.source, _);\n sim.on('tick', rerun(pulse.dataflow, this));\n if (!_.static) {\n change = true;\n sim.tick(); // ensure we run on init\n }\n\n pulse.modifies('index');\n } else {\n if (change) {\n pulse.modifies('index');\n sim.nodes(pulse.source);\n }\n if (params || pulse.changed(pulse.MOD)) {\n setup(sim, _, 0, pulse);\n }\n }\n\n // run simulation\n if (params || change || _.modified(ForceConfig) || pulse.changed() && _.restart) {\n sim.alpha(Math.max(sim.alpha(), _.alpha || 1)).alphaDecay(1 - Math.pow(sim.alphaMin(), 1 / iters));\n if (_.static) {\n for (sim.stop(); --iters >= 0;) sim.tick();\n } else {\n if (sim.stopped()) sim.restart();\n if (!change) return pulse.StopPropagation; // defer to sim ticks\n }\n }\n\n return this.finish(_, pulse);\n },\n finish(_, pulse) {\n const dataflow = pulse.dataflow;\n\n // inspect dependencies, touch link source data\n for (let args = this._argops, j = 0, m = args.length, arg; j < m; ++j) {\n arg = args[j];\n if (arg.name !== Forces || arg.op._argval.force !== 'link') {\n continue;\n }\n for (var ops = arg.op._argops, i = 0, n = ops.length, op; i < n; ++i) {\n if (ops[i].name === 'links' && (op = ops[i].op.source)) {\n dataflow.pulse(op, dataflow.changeset().reflow());\n break;\n }\n }\n }\n\n // reflow all nodes\n return pulse.reflow(_.modified()).modifies(ForceOutput);\n }\n});\nfunction rerun(df, op) {\n return () => df.touch(op).run();\n}\nfunction simulation(nodes, _) {\n const sim = forceSimulation(nodes),\n stop = sim.stop,\n restart = sim.restart;\n let stopped = false;\n sim.stopped = () => stopped;\n sim.restart = () => (stopped = false, restart());\n sim.stop = () => (stopped = true, stop());\n return setup(sim, _, true).on('end', () => stopped = true);\n}\nfunction setup(sim, _, init, pulse) {\n var f = array(_.forces),\n i,\n n,\n p,\n name;\n for (i = 0, n = ForceParams.length; i < n; ++i) {\n p = ForceParams[i];\n if (p !== Forces && _.modified(p)) sim[p](_[p]);\n }\n for (i = 0, n = f.length; i < n; ++i) {\n name = Forces + i;\n p = init || _.modified(Forces, i) ? getForce(f[i]) : pulse && modified(f[i], pulse) ? sim.force(name) : null;\n if (p) sim.force(name, p);\n }\n for (n = sim.numForces || 0; i < n; ++i) {\n sim.force(Forces + i, null); // remove\n }\n\n sim.numForces = f.length;\n return sim;\n}\nfunction modified(f, pulse) {\n var k, v;\n for (k in f) {\n if (isFunction(v = f[k]) && pulse.modified(accessorFields(v))) return 1;\n }\n return 0;\n}\nfunction getForce(_) {\n var f, p;\n if (!hasOwnProperty(ForceMap, _.force)) {\n error('Unrecognized force: ' + _.force);\n }\n f = ForceMap[_.force]();\n for (p in _) {\n if (isFunction(f[p])) setForceParam(f[p], _[p], _);\n }\n return f;\n}\nfunction setForceParam(f, v, _) {\n f(isFunction(v) ? d => v(d, _) : v);\n}\n\nexport { Force as force };\n","export default function(x, y) {\n var nodes, strength = 1;\n\n if (x == null) x = 0;\n if (y == null) y = 0;\n\n function force() {\n var i,\n n = nodes.length,\n node,\n sx = 0,\n sy = 0;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i], sx += node.x, sy += node.y;\n }\n\n for (sx = (sx / n - x) * strength, sy = (sy / n - y) * strength, i = 0; i < n; ++i) {\n node = nodes[i], node.x -= sx, node.y -= sy;\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = +_, force) : x;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = +_, force) : y;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = +_, force) : strength;\n };\n\n return force;\n}\n","import {quadtree} from \"d3-quadtree\";\nimport constant from \"./constant.js\";\nimport jiggle from \"./jiggle.js\";\nimport {x, y} from \"./simulation.js\";\n\nexport default function() {\n var nodes,\n node,\n random,\n alpha,\n strength = constant(-30),\n strengths,\n distanceMin2 = 1,\n distanceMax2 = Infinity,\n theta2 = 0.81;\n\n function force(_) {\n var i, n = nodes.length, tree = quadtree(nodes, x, y).visitAfter(accumulate);\n for (alpha = _, i = 0; i < n; ++i) node = nodes[i], tree.visit(apply);\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length, node;\n strengths = new Array(n);\n for (i = 0; i < n; ++i) node = nodes[i], strengths[node.index] = +strength(node, i, nodes);\n }\n\n function accumulate(quad) {\n var strength = 0, q, c, weight = 0, x, y, i;\n\n // For internal nodes, accumulate forces from child quadrants.\n if (quad.length) {\n for (x = y = i = 0; i < 4; ++i) {\n if ((q = quad[i]) && (c = Math.abs(q.value))) {\n strength += q.value, weight += c, x += c * q.x, y += c * q.y;\n }\n }\n quad.x = x / weight;\n quad.y = y / weight;\n }\n\n // For leaf nodes, accumulate forces from coincident quadrants.\n else {\n q = quad;\n q.x = q.data.x;\n q.y = q.data.y;\n do strength += strengths[q.data.index];\n while (q = q.next);\n }\n\n quad.value = strength;\n }\n\n function apply(quad, x1, _, x2) {\n if (!quad.value) return true;\n\n var x = quad.x - node.x,\n y = quad.y - node.y,\n w = x2 - x1,\n l = x * x + y * y;\n\n // Apply the Barnes-Hut approximation if possible.\n // Limit forces for very close nodes; randomize direction if coincident.\n if (w * w / theta2 < l) {\n if (l < distanceMax2) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);\n node.vx += x * quad.value * alpha / l;\n node.vy += y * quad.value * alpha / l;\n }\n return true;\n }\n\n // Otherwise, process points directly.\n else if (quad.length || l >= distanceMax2) return;\n\n // Limit forces for very close nodes; randomize direction if coincident.\n if (quad.data !== node || quad.next) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);\n }\n\n do if (quad.data !== node) {\n w = strengths[quad.data.index] * alpha / l;\n node.vx += x * w;\n node.vy += y * w;\n } while (quad = quad.next);\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.distanceMin = function(_) {\n return arguments.length ? (distanceMin2 = _ * _, force) : Math.sqrt(distanceMin2);\n };\n\n force.distanceMax = function(_) {\n return arguments.length ? (distanceMax2 = _ * _, force) : Math.sqrt(distanceMax2);\n };\n\n force.theta = function(_) {\n return arguments.length ? (theta2 = _ * _, force) : Math.sqrt(theta2);\n };\n\n return force;\n}\n","import constant from \"./constant.js\";\n\nexport default function(x) {\n var strength = constant(0.1),\n nodes,\n strengths,\n xz;\n\n if (typeof x !== \"function\") x = constant(x == null ? 0 : +x);\n\n function force(alpha) {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.vx += (xz[i] - node.x) * strengths[i] * alpha;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n xz = new Array(n);\n for (i = 0; i < n; ++i) {\n strengths[i] = isNaN(xz[i] = +x(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : x;\n };\n\n return force;\n}\n","import constant from \"./constant.js\";\n\nexport default function(y) {\n var strength = constant(0.1),\n nodes,\n strengths,\n yz;\n\n if (typeof y !== \"function\") y = constant(y == null ? 0 : +y);\n\n function force(alpha) {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.vy += (yz[i] - node.y) * strengths[i] * alpha;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n yz = new Array(n);\n for (i = 0; i < n; ++i) {\n strengths[i] = isNaN(yz[i] = +y(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : y;\n };\n\n return force;\n}\n","function count(node) {\n var sum = 0,\n children = node.children,\n i = children && children.length;\n if (!i) sum = 1;\n else while (--i >= 0) sum += children[i].value;\n node.value = sum;\n}\n\nexport default function() {\n return this.eachAfter(count);\n}\n","import node_count from \"./count.js\";\nimport node_each from \"./each.js\";\nimport node_eachBefore from \"./eachBefore.js\";\nimport node_eachAfter from \"./eachAfter.js\";\nimport node_find from \"./find.js\";\nimport node_sum from \"./sum.js\";\nimport node_sort from \"./sort.js\";\nimport node_path from \"./path.js\";\nimport node_ancestors from \"./ancestors.js\";\nimport node_descendants from \"./descendants.js\";\nimport node_leaves from \"./leaves.js\";\nimport node_links from \"./links.js\";\nimport node_iterator from \"./iterator.js\";\n\nexport default function hierarchy(data, children) {\n if (data instanceof Map) {\n data = [undefined, data];\n if (children === undefined) children = mapChildren;\n } else if (children === undefined) {\n children = objectChildren;\n }\n\n var root = new Node(data),\n node,\n nodes = [root],\n child,\n childs,\n i,\n n;\n\n while (node = nodes.pop()) {\n if ((childs = children(node.data)) && (n = (childs = Array.from(childs)).length)) {\n node.children = childs;\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = childs[i] = new Node(childs[i]));\n child.parent = node;\n child.depth = node.depth + 1;\n }\n }\n }\n\n return root.eachBefore(computeHeight);\n}\n\nfunction node_copy() {\n return hierarchy(this).eachBefore(copyData);\n}\n\nfunction objectChildren(d) {\n return d.children;\n}\n\nfunction mapChildren(d) {\n return Array.isArray(d) ? d[1] : null;\n}\n\nfunction copyData(node) {\n if (node.data.value !== undefined) node.value = node.data.value;\n node.data = node.data.data;\n}\n\nexport function computeHeight(node) {\n var height = 0;\n do node.height = height;\n while ((node = node.parent) && (node.height < ++height));\n}\n\nexport function Node(data) {\n this.data = data;\n this.depth =\n this.height = 0;\n this.parent = null;\n}\n\nNode.prototype = hierarchy.prototype = {\n constructor: Node,\n count: node_count,\n each: node_each,\n eachAfter: node_eachAfter,\n eachBefore: node_eachBefore,\n find: node_find,\n sum: node_sum,\n sort: node_sort,\n path: node_path,\n ancestors: node_ancestors,\n descendants: node_descendants,\n leaves: node_leaves,\n links: node_links,\n copy: node_copy,\n [Symbol.iterator]: node_iterator\n};\n","export function optional(f) {\n return f == null ? null : required(f);\n}\n\nexport function required(f) {\n if (typeof f !== \"function\") throw new Error;\n return f;\n}\n","export function constantZero() {\n return 0;\n}\n\nexport default function(x) {\n return function() {\n return x;\n };\n}\n","export default function(callback, that) {\n let index = -1;\n for (const node of this) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n","export default function(callback, that) {\n var node = this, nodes = [node], next = [], children, i, n, index = -1;\n while (node = nodes.pop()) {\n next.push(node);\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n nodes.push(children[i]);\n }\n }\n }\n while (node = next.pop()) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n","export default function(callback, that) {\n var node = this, nodes = [node], children, i, index = -1;\n while (node = nodes.pop()) {\n callback.call(that, node, ++index, this);\n if (children = node.children) {\n for (i = children.length - 1; i >= 0; --i) {\n nodes.push(children[i]);\n }\n }\n }\n return this;\n}\n","export default function(callback, that) {\n let index = -1;\n for (const node of this) {\n if (callback.call(that, node, ++index, this)) {\n return node;\n }\n }\n}\n","export default function(value) {\n return this.eachAfter(function(node) {\n var sum = +value(node.data) || 0,\n children = node.children,\n i = children && children.length;\n while (--i >= 0) sum += children[i].value;\n node.value = sum;\n });\n}\n","export default function(compare) {\n return this.eachBefore(function(node) {\n if (node.children) {\n node.children.sort(compare);\n }\n });\n}\n","export default function(end) {\n var start = this,\n ancestor = leastCommonAncestor(start, end),\n nodes = [start];\n while (start !== ancestor) {\n start = start.parent;\n nodes.push(start);\n }\n var k = nodes.length;\n while (end !== ancestor) {\n nodes.splice(k, 0, end);\n end = end.parent;\n }\n return nodes;\n}\n\nfunction leastCommonAncestor(a, b) {\n if (a === b) return a;\n var aNodes = a.ancestors(),\n bNodes = b.ancestors(),\n c = null;\n a = aNodes.pop();\n b = bNodes.pop();\n while (a === b) {\n c = a;\n a = aNodes.pop();\n b = bNodes.pop();\n }\n return c;\n}\n","export default function() {\n var node = this, nodes = [node];\n while (node = node.parent) {\n nodes.push(node);\n }\n return nodes;\n}\n","export default function() {\n return Array.from(this);\n}\n","export default function() {\n var leaves = [];\n this.eachBefore(function(node) {\n if (!node.children) {\n leaves.push(node);\n }\n });\n return leaves;\n}\n","export default function() {\n var root = this, links = [];\n root.each(function(node) {\n if (node !== root) { // Don’t include the root’s parent, if any.\n links.push({source: node.parent, target: node});\n }\n });\n return links;\n}\n","export default function*() {\n var node = this, current, next = [node], children, i, n;\n do {\n current = next.reverse(), next = [];\n while (node = current.pop()) {\n yield node;\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n next.push(children[i]);\n }\n }\n }\n } while (next.length);\n}\n","// https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use\nconst a = 1664525;\nconst c = 1013904223;\nconst m = 4294967296; // 2^32\n\nexport default function() {\n let s = 1;\n return () => (s = (a * s + c) % m) / m;\n}\n","import {shuffle} from \"../array.js\";\nimport lcg from \"../lcg.js\";\n\nexport default function(circles) {\n return packEncloseRandom(circles, lcg());\n}\n\nexport function packEncloseRandom(circles, random) {\n var i = 0, n = (circles = shuffle(Array.from(circles), random)).length, B = [], p, e;\n\n while (i < n) {\n p = circles[i];\n if (e && enclosesWeak(e, p)) ++i;\n else e = encloseBasis(B = extendBasis(B, p)), i = 0;\n }\n\n return e;\n}\n\nfunction extendBasis(B, p) {\n var i, j;\n\n if (enclosesWeakAll(p, B)) return [p];\n\n // If we get here then B must have at least one element.\n for (i = 0; i < B.length; ++i) {\n if (enclosesNot(p, B[i])\n && enclosesWeakAll(encloseBasis2(B[i], p), B)) {\n return [B[i], p];\n }\n }\n\n // If we get here then B must have at least two elements.\n for (i = 0; i < B.length - 1; ++i) {\n for (j = i + 1; j < B.length; ++j) {\n if (enclosesNot(encloseBasis2(B[i], B[j]), p)\n && enclosesNot(encloseBasis2(B[i], p), B[j])\n && enclosesNot(encloseBasis2(B[j], p), B[i])\n && enclosesWeakAll(encloseBasis3(B[i], B[j], p), B)) {\n return [B[i], B[j], p];\n }\n }\n }\n\n // If we get here then something is very wrong.\n throw new Error;\n}\n\nfunction enclosesNot(a, b) {\n var dr = a.r - b.r, dx = b.x - a.x, dy = b.y - a.y;\n return dr < 0 || dr * dr < dx * dx + dy * dy;\n}\n\nfunction enclosesWeak(a, b) {\n var dr = a.r - b.r + Math.max(a.r, b.r, 1) * 1e-9, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction enclosesWeakAll(a, B) {\n for (var i = 0; i < B.length; ++i) {\n if (!enclosesWeak(a, B[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction encloseBasis(B) {\n switch (B.length) {\n case 1: return encloseBasis1(B[0]);\n case 2: return encloseBasis2(B[0], B[1]);\n case 3: return encloseBasis3(B[0], B[1], B[2]);\n }\n}\n\nfunction encloseBasis1(a) {\n return {\n x: a.x,\n y: a.y,\n r: a.r\n };\n}\n\nfunction encloseBasis2(a, b) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1,\n l = Math.sqrt(x21 * x21 + y21 * y21);\n return {\n x: (x1 + x2 + x21 / l * r21) / 2,\n y: (y1 + y2 + y21 / l * r21) / 2,\n r: (l + r1 + r2) / 2\n };\n}\n\nfunction encloseBasis3(a, b, c) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x3 = c.x, y3 = c.y, r3 = c.r,\n a2 = x1 - x2,\n a3 = x1 - x3,\n b2 = y1 - y2,\n b3 = y1 - y3,\n c2 = r2 - r1,\n c3 = r3 - r1,\n d1 = x1 * x1 + y1 * y1 - r1 * r1,\n d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2,\n d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3,\n ab = a3 * b2 - a2 * b3,\n xa = (b2 * d3 - b3 * d2) / (ab * 2) - x1,\n xb = (b3 * c2 - b2 * c3) / ab,\n ya = (a3 * d2 - a2 * d3) / (ab * 2) - y1,\n yb = (a2 * c3 - a3 * c2) / ab,\n A = xb * xb + yb * yb - 1,\n B = 2 * (r1 + xa * xb + ya * yb),\n C = xa * xa + ya * ya - r1 * r1,\n r = -(Math.abs(A) > 1e-6 ? (B + Math.sqrt(B * B - 4 * A * C)) / (2 * A) : C / B);\n return {\n x: x1 + xa + xb * r,\n y: y1 + ya + yb * r,\n r: r\n };\n}\n","import array from \"../array.js\";\nimport lcg from \"../lcg.js\";\nimport {packEncloseRandom} from \"./enclose.js\";\n\nfunction place(b, a, c) {\n var dx = b.x - a.x, x, a2,\n dy = b.y - a.y, y, b2,\n d2 = dx * dx + dy * dy;\n if (d2) {\n a2 = a.r + c.r, a2 *= a2;\n b2 = b.r + c.r, b2 *= b2;\n if (a2 > b2) {\n x = (d2 + b2 - a2) / (2 * d2);\n y = Math.sqrt(Math.max(0, b2 / d2 - x * x));\n c.x = b.x - x * dx - y * dy;\n c.y = b.y - x * dy + y * dx;\n } else {\n x = (d2 + a2 - b2) / (2 * d2);\n y = Math.sqrt(Math.max(0, a2 / d2 - x * x));\n c.x = a.x + x * dx - y * dy;\n c.y = a.y + x * dy + y * dx;\n }\n } else {\n c.x = a.x + c.r;\n c.y = a.y;\n }\n}\n\nfunction intersects(a, b) {\n var dr = a.r + b.r - 1e-6, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction score(node) {\n var a = node._,\n b = node.next._,\n ab = a.r + b.r,\n dx = (a.x * b.r + b.x * a.r) / ab,\n dy = (a.y * b.r + b.y * a.r) / ab;\n return dx * dx + dy * dy;\n}\n\nfunction Node(circle) {\n this._ = circle;\n this.next = null;\n this.previous = null;\n}\n\nexport function packSiblingsRandom(circles, random) {\n if (!(n = (circles = array(circles)).length)) return 0;\n\n var a, b, c, n, aa, ca, i, j, k, sj, sk;\n\n // Place the first circle.\n a = circles[0], a.x = 0, a.y = 0;\n if (!(n > 1)) return a.r;\n\n // Place the second circle.\n b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0;\n if (!(n > 2)) return a.r + b.r;\n\n // Place the third circle.\n place(b, a, c = circles[2]);\n\n // Initialize the front-chain using the first three circles a, b and c.\n a = new Node(a), b = new Node(b), c = new Node(c);\n a.next = c.previous = b;\n b.next = a.previous = c;\n c.next = b.previous = a;\n\n // Attempt to place each remaining circle…\n pack: for (i = 3; i < n; ++i) {\n place(a._, b._, c = circles[i]), c = new Node(c);\n\n // Find the closest intersecting circle on the front-chain, if any.\n // “Closeness” is determined by linear distance along the front-chain.\n // “Ahead” or “behind” is likewise determined by linear distance.\n j = b.next, k = a.previous, sj = b._.r, sk = a._.r;\n do {\n if (sj <= sk) {\n if (intersects(j._, c._)) {\n b = j, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sj += j._.r, j = j.next;\n } else {\n if (intersects(k._, c._)) {\n a = k, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sk += k._.r, k = k.previous;\n }\n } while (j !== k.next);\n\n // Success! Insert the new circle c between a and b.\n c.previous = a, c.next = b, a.next = b.previous = b = c;\n\n // Compute the new closest circle pair to the centroid.\n aa = score(a);\n while ((c = c.next) !== b) {\n if ((ca = score(c)) < aa) {\n a = c, aa = ca;\n }\n }\n b = a.next;\n }\n\n // Compute the enclosing circle of the front chain.\n a = [b._], c = b; while ((c = c.next) !== b) a.push(c._); c = packEncloseRandom(a, random);\n\n // Translate the circles to put the enclosing circle around the origin.\n for (i = 0; i < n; ++i) a = circles[i], a.x -= c.x, a.y -= c.y;\n\n return c.r;\n}\n\nexport default function(circles) {\n packSiblingsRandom(circles, lcg());\n return circles;\n}\n","export default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n\nexport function shuffle(array, random) {\n let m = array.length,\n t,\n i;\n\n while (m) {\n i = random() * m-- | 0;\n t = array[m];\n array[m] = array[i];\n array[i] = t;\n }\n\n return array;\n}\n","import {optional} from \"../accessors.js\";\nimport constant, {constantZero} from \"../constant.js\";\nimport lcg from \"../lcg.js\";\nimport {packSiblingsRandom} from \"./siblings.js\";\n\nfunction defaultRadius(d) {\n return Math.sqrt(d.value);\n}\n\nexport default function() {\n var radius = null,\n dx = 1,\n dy = 1,\n padding = constantZero;\n\n function pack(root) {\n const random = lcg();\n root.x = dx / 2, root.y = dy / 2;\n if (radius) {\n root.eachBefore(radiusLeaf(radius))\n .eachAfter(packChildrenRandom(padding, 0.5, random))\n .eachBefore(translateChild(1));\n } else {\n root.eachBefore(radiusLeaf(defaultRadius))\n .eachAfter(packChildrenRandom(constantZero, 1, random))\n .eachAfter(packChildrenRandom(padding, root.r / Math.min(dx, dy), random))\n .eachBefore(translateChild(Math.min(dx, dy) / (2 * root.r)));\n }\n return root;\n }\n\n pack.radius = function(x) {\n return arguments.length ? (radius = optional(x), pack) : radius;\n };\n\n pack.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], pack) : [dx, dy];\n };\n\n pack.padding = function(x) {\n return arguments.length ? (padding = typeof x === \"function\" ? x : constant(+x), pack) : padding;\n };\n\n return pack;\n}\n\nfunction radiusLeaf(radius) {\n return function(node) {\n if (!node.children) {\n node.r = Math.max(0, +radius(node) || 0);\n }\n };\n}\n\nfunction packChildrenRandom(padding, k, random) {\n return function(node) {\n if (children = node.children) {\n var children,\n i,\n n = children.length,\n r = padding(node) * k || 0,\n e;\n\n if (r) for (i = 0; i < n; ++i) children[i].r += r;\n e = packSiblingsRandom(children, random);\n if (r) for (i = 0; i < n; ++i) children[i].r -= r;\n node.r = e + r;\n }\n };\n}\n\nfunction translateChild(k) {\n return function(node) {\n var parent = node.parent;\n node.r *= k;\n if (parent) {\n node.x = parent.x + k * node.x;\n node.y = parent.y + k * node.y;\n }\n };\n}\n","export default function(node) {\n node.x0 = Math.round(node.x0);\n node.y0 = Math.round(node.y0);\n node.x1 = Math.round(node.x1);\n node.y1 = Math.round(node.y1);\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (x1 - x0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.y0 = y0, node.y1 = y1;\n node.x0 = x0, node.x1 = x0 += node.value * k;\n }\n}\n","import {optional} from \"./accessors.js\";\nimport {Node, computeHeight} from \"./hierarchy/index.js\";\n\nvar preroot = {depth: -1},\n ambiguous = {},\n imputed = {};\n\nfunction defaultId(d) {\n return d.id;\n}\n\nfunction defaultParentId(d) {\n return d.parentId;\n}\n\nexport default function() {\n var id = defaultId,\n parentId = defaultParentId,\n path;\n\n function stratify(data) {\n var nodes = Array.from(data),\n currentId = id,\n currentParentId = parentId,\n n,\n d,\n i,\n root,\n parent,\n node,\n nodeId,\n nodeKey,\n nodeByKey = new Map;\n\n if (path != null) {\n const I = nodes.map((d, i) => normalize(path(d, i, data)));\n const P = I.map(parentof);\n const S = new Set(I).add(\"\");\n for (const i of P) {\n if (!S.has(i)) {\n S.add(i);\n I.push(i);\n P.push(parentof(i));\n nodes.push(imputed);\n }\n }\n currentId = (_, i) => I[i];\n currentParentId = (_, i) => P[i];\n }\n\n for (i = 0, n = nodes.length; i < n; ++i) {\n d = nodes[i], node = nodes[i] = new Node(d);\n if ((nodeId = currentId(d, i, data)) != null && (nodeId += \"\")) {\n nodeKey = node.id = nodeId;\n nodeByKey.set(nodeKey, nodeByKey.has(nodeKey) ? ambiguous : node);\n }\n if ((nodeId = currentParentId(d, i, data)) != null && (nodeId += \"\")) {\n node.parent = nodeId;\n }\n }\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n if (nodeId = node.parent) {\n parent = nodeByKey.get(nodeId);\n if (!parent) throw new Error(\"missing: \" + nodeId);\n if (parent === ambiguous) throw new Error(\"ambiguous: \" + nodeId);\n if (parent.children) parent.children.push(node);\n else parent.children = [node];\n node.parent = parent;\n } else {\n if (root) throw new Error(\"multiple roots\");\n root = node;\n }\n }\n\n if (!root) throw new Error(\"no root\");\n\n // When imputing internal nodes, only introduce roots if needed.\n // Then replace the imputed marker data with null.\n if (path != null) {\n while (root.data === imputed && root.children.length === 1) {\n root = root.children[0], --n;\n }\n for (let i = nodes.length - 1; i >= 0; --i) {\n node = nodes[i];\n if (node.data !== imputed) break;\n node.data = null;\n }\n }\n\n root.parent = preroot;\n root.eachBefore(function(node) { node.depth = node.parent.depth + 1; --n; }).eachBefore(computeHeight);\n root.parent = null;\n if (n > 0) throw new Error(\"cycle\");\n\n return root;\n }\n\n stratify.id = function(x) {\n return arguments.length ? (id = optional(x), stratify) : id;\n };\n\n stratify.parentId = function(x) {\n return arguments.length ? (parentId = optional(x), stratify) : parentId;\n };\n\n stratify.path = function(x) {\n return arguments.length ? (path = optional(x), stratify) : path;\n };\n\n return stratify;\n}\n\n// To normalize a path, we coerce to a string, strip the trailing slash if any\n// (as long as the trailing slash is not immediately preceded by another slash),\n// and add leading slash if missing.\nfunction normalize(path) {\n path = `${path}`;\n let i = path.length;\n if (slash(path, i - 1) && !slash(path, i - 2)) path = path.slice(0, -1);\n return path[0] === \"/\" ? path : `/${path}`;\n}\n\n// Walk backwards to find the first slash that is not the leading slash, e.g.:\n// \"/foo/bar\" ⇥ \"/foo\", \"/foo\" ⇥ \"/\", \"/\" ↦ \"\". (The root is special-cased\n// because the id of the root must be a truthy value.)\nfunction parentof(path) {\n let i = path.length;\n if (i < 2) return \"\";\n while (--i > 1) if (slash(path, i)) break;\n return path.slice(0, i);\n}\n\n// Slashes can be escaped; to determine whether a slash is a path delimiter, we\n// count the number of preceding backslashes escaping the forward slash: an odd\n// number indicates an escaped forward slash.\nfunction slash(path, i) {\n if (path[i] === \"/\") {\n let k = 0;\n while (i > 0 && path[--i] === \"\\\\\") ++k;\n if ((k & 1) === 0) return true;\n }\n return false;\n}\n","import {Node} from \"./hierarchy/index.js\";\n\nfunction defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\n// function radialSeparation(a, b) {\n// return (a.parent === b.parent ? 1 : 2) / a.depth;\n// }\n\n// This function is used to traverse the left contour of a subtree (or\n// subforest). It returns the successor of v on this contour. This successor is\n// either given by the leftmost child of v or by the thread of v. The function\n// returns null if and only if v is on the highest level of its subtree.\nfunction nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n}\n\n// This function works analogously to nextLeft.\nfunction nextRight(v) {\n var children = v.children;\n return children ? children[children.length - 1] : v.t;\n}\n\n// Shifts the current subtree rooted at w+. This is done by increasing\n// prelim(w+) and mod(w+) by shift.\nfunction moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}\n\n// All other shifts, applied to the smaller subtrees between w- and w+, are\n// performed by this function. To prepare the shifts, we have to adjust\n// change(w+), shift(w+), and change(w-).\nfunction executeShifts(v) {\n var shift = 0,\n change = 0,\n children = v.children,\n i = children.length,\n w;\n while (--i >= 0) {\n w = children[i];\n w.z += shift;\n w.m += shift;\n shift += w.s + (change += w.c);\n }\n}\n\n// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise,\n// returns the specified (default) ancestor.\nfunction nextAncestor(vim, v, ancestor) {\n return vim.a.parent === v.parent ? vim.a : ancestor;\n}\n\nfunction TreeNode(node, i) {\n this._ = node;\n this.parent = null;\n this.children = null;\n this.A = null; // default ancestor\n this.a = this; // ancestor\n this.z = 0; // prelim\n this.m = 0; // mod\n this.c = 0; // change\n this.s = 0; // shift\n this.t = null; // thread\n this.i = i; // number\n}\n\nTreeNode.prototype = Object.create(Node.prototype);\n\nfunction treeRoot(root) {\n var tree = new TreeNode(root, 0),\n node,\n nodes = [tree],\n child,\n children,\n i,\n n;\n\n while (node = nodes.pop()) {\n if (children = node._.children) {\n node.children = new Array(n = children.length);\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = node.children[i] = new TreeNode(children[i], i));\n child.parent = node;\n }\n }\n }\n\n (tree.parent = new TreeNode(null, 0)).children = [tree];\n return tree;\n}\n\n// Node-link tree diagram using the Reingold-Tilford \"tidy\" algorithm\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}\n","function defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\nfunction meanX(children) {\n return children.reduce(meanXReduce, 0) / children.length;\n}\n\nfunction meanXReduce(x, c) {\n return x + c.x;\n}\n\nfunction maxY(children) {\n return 1 + children.reduce(maxYReduce, 0);\n}\n\nfunction maxYReduce(y, c) {\n return Math.max(y, c.y);\n}\n\nfunction leafLeft(node) {\n var children;\n while (children = node.children) node = children[0];\n return node;\n}\n\nfunction leafRight(node) {\n var children;\n while (children = node.children) node = children[children.length - 1];\n return node;\n}\n\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = false;\n\n function cluster(root) {\n var previousNode,\n x = 0;\n\n // First walk, computing the initial x & y values.\n root.eachAfter(function(node) {\n var children = node.children;\n if (children) {\n node.x = meanX(children);\n node.y = maxY(children);\n } else {\n node.x = previousNode ? x += separation(node, previousNode) : 0;\n node.y = 0;\n previousNode = node;\n }\n });\n\n var left = leafLeft(root),\n right = leafRight(root),\n x0 = left.x - separation(left, right) / 2,\n x1 = right.x + separation(right, left) / 2;\n\n // Second walk, normalizing x & y to the desired size.\n return root.eachAfter(nodeSize ? function(node) {\n node.x = (node.x - root.x) * dx;\n node.y = (root.y - node.y) * dy;\n } : function(node) {\n node.x = (node.x - x0) / (x1 - x0) * dx;\n node.y = (1 - (root.y ? node.y / root.y : 1)) * dy;\n });\n }\n\n cluster.separation = function(x) {\n return arguments.length ? (separation = x, cluster) : separation;\n };\n\n cluster.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? null : [dx, dy]);\n };\n\n cluster.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? [dx, dy] : null);\n };\n\n return cluster;\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (y1 - y0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.x0 = x0, node.x1 = x1;\n node.y0 = y0, node.y1 = y0 += node.value * k;\n }\n}\n","import treemapDice from \"./dice.js\";\nimport treemapSlice from \"./slice.js\";\n\nexport var phi = (1 + Math.sqrt(5)) / 2;\n\nexport function squarifyRatio(ratio, parent, x0, y0, x1, y1) {\n var rows = [],\n nodes = parent.children,\n row,\n nodeValue,\n i0 = 0,\n i1 = 0,\n n = nodes.length,\n dx, dy,\n value = parent.value,\n sumValue,\n minValue,\n maxValue,\n newRatio,\n minRatio,\n alpha,\n beta;\n\n while (i0 < n) {\n dx = x1 - x0, dy = y1 - y0;\n\n // Find the next non-empty node.\n do sumValue = nodes[i1++].value; while (!sumValue && i1 < n);\n minValue = maxValue = sumValue;\n alpha = Math.max(dy / dx, dx / dy) / (value * ratio);\n beta = sumValue * sumValue * alpha;\n minRatio = Math.max(maxValue / beta, beta / minValue);\n\n // Keep adding nodes while the aspect ratio maintains or improves.\n for (; i1 < n; ++i1) {\n sumValue += nodeValue = nodes[i1].value;\n if (nodeValue < minValue) minValue = nodeValue;\n if (nodeValue > maxValue) maxValue = nodeValue;\n beta = sumValue * sumValue * alpha;\n newRatio = Math.max(maxValue / beta, beta / minValue);\n if (newRatio > minRatio) { sumValue -= nodeValue; break; }\n minRatio = newRatio;\n }\n\n // Position and record the row orientation.\n rows.push(row = {value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1)});\n if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);\n else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);\n value -= sumValue, i0 = i1;\n }\n\n return rows;\n}\n\nexport default (function custom(ratio) {\n\n function squarify(parent, x0, y0, x1, y1) {\n squarifyRatio(ratio, parent, x0, y0, x1, y1);\n }\n\n squarify.ratio = function(x) {\n return custom((x = +x) > 1 ? x : 1);\n };\n\n return squarify;\n})(phi);\n","import treemapDice from \"./dice.js\";\nimport treemapSlice from \"./slice.js\";\nimport {phi, squarifyRatio} from \"./squarify.js\";\n\nexport default (function custom(ratio) {\n\n function resquarify(parent, x0, y0, x1, y1) {\n if ((rows = parent._squarify) && (rows.ratio === ratio)) {\n var rows,\n row,\n nodes,\n i,\n j = -1,\n n,\n m = rows.length,\n value = parent.value;\n\n while (++j < m) {\n row = rows[j], nodes = row.children;\n for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value;\n if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += (y1 - y0) * row.value / value : y1);\n else treemapSlice(row, x0, y0, value ? x0 += (x1 - x0) * row.value / value : x1, y1);\n value -= row.value;\n }\n } else {\n parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);\n rows.ratio = ratio;\n }\n }\n\n resquarify.ratio = function(x) {\n return custom((x = +x) > 1 ? x : 1);\n };\n\n return resquarify;\n})(phi);\n","import { Transform, isTuple, ingest, tupleid, stableCompare } from 'vega-dataflow';\nimport { inherits, error, array, one, truthy, hasOwnProperty } from 'vega-util';\nimport { hierarchy, pack, partition, stratify, tree, cluster, treemap, treemapBinary, treemapDice, treemapSlice, treemapSliceDice, treemapSquarify, treemapResquarify } from 'd3-hierarchy';\n\n// Build lookup table mapping tuple keys to tree node instances\nfunction lookup (tree, key, filter) {\n const map = {};\n tree.each(node => {\n const t = node.data;\n if (filter(t)) map[key(t)] = node;\n });\n tree.lookup = map;\n return tree;\n}\n\n/**\n * Nest tuples into a tree structure, grouped by key values.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.keys - The key fields to nest by, in order.\n * @param {boolean} [params.generate=false] - A boolean flag indicating if\n * non-leaf nodes generated by this transform should be included in the\n * output. The default (false) includes only the input data (leaf nodes)\n * in the data stream.\n */\nfunction Nest(params) {\n Transform.call(this, null, params);\n}\nNest.Definition = {\n 'type': 'Nest',\n 'metadata': {\n 'treesource': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'keys',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'generate',\n 'type': 'boolean'\n }]\n};\nconst children = n => n.values;\ninherits(Nest, Transform, {\n transform(_, pulse) {\n if (!pulse.source) {\n error('Nest transform requires an upstream data source.');\n }\n var gen = _.generate,\n mod = _.modified(),\n out = pulse.clone(),\n tree = this.value;\n if (!tree || mod || pulse.changed()) {\n // collect nodes to remove\n if (tree) {\n tree.each(node => {\n if (node.children && isTuple(node.data)) {\n out.rem.push(node.data);\n }\n });\n }\n\n // generate new tree structure\n this.value = tree = hierarchy({\n values: array(_.keys).reduce((n, k) => {\n n.key(k);\n return n;\n }, nest()).entries(out.source)\n }, children);\n\n // collect nodes to add\n if (gen) {\n tree.each(node => {\n if (node.children) {\n node = ingest(node.data);\n out.add.push(node);\n out.source.push(node);\n }\n });\n }\n\n // build lookup table\n lookup(tree, tupleid, tupleid);\n }\n out.source.root = tree;\n return out;\n }\n});\nfunction nest() {\n const keys = [],\n nest = {\n entries: array => entries(apply(array, 0), 0),\n key: d => (keys.push(d), nest)\n };\n function apply(array, depth) {\n if (depth >= keys.length) {\n return array;\n }\n const n = array.length,\n key = keys[depth++],\n valuesByKey = {},\n result = {};\n let i = -1,\n keyValue,\n value,\n values;\n while (++i < n) {\n keyValue = key(value = array[i]) + '';\n if (values = valuesByKey[keyValue]) {\n values.push(value);\n } else {\n valuesByKey[keyValue] = [value];\n }\n }\n for (keyValue in valuesByKey) {\n result[keyValue] = apply(valuesByKey[keyValue], depth);\n }\n return result;\n }\n function entries(map, depth) {\n if (++depth > keys.length) return map;\n const array = [];\n for (const key in map) {\n array.push({\n key,\n values: entries(map[key], depth)\n });\n }\n return array;\n }\n return nest;\n}\n\n/**\n * Abstract class for tree layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction HierarchyLayout(params) {\n Transform.call(this, null, params);\n}\nconst defaultSeparation = (a, b) => a.parent === b.parent ? 1 : 2;\ninherits(HierarchyLayout, Transform, {\n transform(_, pulse) {\n if (!pulse.source || !pulse.source.root) {\n error(this.constructor.name + ' transform requires a backing tree data source.');\n }\n const layout = this.layout(_.method),\n fields = this.fields,\n root = pulse.source.root,\n as = _.as || fields;\n if (_.field) root.sum(_.field);else root.count();\n if (_.sort) root.sort(stableCompare(_.sort, d => d.data));\n setParams(layout, this.params, _);\n if (layout.separation) {\n layout.separation(_.separation !== false ? defaultSeparation : one);\n }\n try {\n this.value = layout(root);\n } catch (err) {\n error(err);\n }\n root.each(node => setFields(node, fields, as));\n return pulse.reflow(_.modified()).modifies(as).modifies('leaf');\n }\n});\nfunction setParams(layout, params, _) {\n for (let p, i = 0, n = params.length; i < n; ++i) {\n p = params[i];\n if (p in _) layout[p](_[p]);\n }\n}\nfunction setFields(node, fields, as) {\n const t = node.data,\n n = fields.length - 1;\n for (let i = 0; i < n; ++i) {\n t[as[i]] = node[fields[i]];\n }\n t[as[n]] = node.children ? node.children.length : 0;\n}\n\nconst Output$3 = ['x', 'y', 'r', 'depth', 'children'];\n\n/**\n * Packed circle tree layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size nodes.\n */\nfunction Pack(params) {\n HierarchyLayout.call(this, params);\n}\nPack.Definition = {\n 'type': 'Pack',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'radius',\n 'type': 'field',\n 'default': null\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output$3.length,\n 'default': Output$3\n }]\n};\ninherits(Pack, HierarchyLayout, {\n layout: pack,\n params: ['radius', 'size', 'padding'],\n fields: Output$3\n});\n\nconst Output$2 = ['x0', 'y0', 'x1', 'y1', 'depth', 'children'];\n\n/**\n * Partition tree layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size nodes.\n */\nfunction Partition(params) {\n HierarchyLayout.call(this, params);\n}\nPartition.Definition = {\n 'type': 'Partition',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'round',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output$2.length,\n 'default': Output$2\n }]\n};\ninherits(Partition, HierarchyLayout, {\n layout: partition,\n params: ['size', 'round', 'padding'],\n fields: Output$2\n});\n\n/**\n * Stratify a collection of tuples into a tree structure based on\n * id and parent id fields.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.key - Unique key field for each tuple.\n * @param {function(object): *} params.parentKey - Field with key for parent tuple.\n */\nfunction Stratify(params) {\n Transform.call(this, null, params);\n}\nStratify.Definition = {\n 'type': 'Stratify',\n 'metadata': {\n 'treesource': true\n },\n 'params': [{\n 'name': 'key',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'parentKey',\n 'type': 'field',\n 'required': true\n }]\n};\ninherits(Stratify, Transform, {\n transform(_, pulse) {\n if (!pulse.source) {\n error('Stratify transform requires an upstream data source.');\n }\n let tree = this.value;\n const mod = _.modified(),\n out = pulse.fork(pulse.ALL).materialize(pulse.SOURCE),\n run = !tree || mod || pulse.changed(pulse.ADD_REM) || pulse.modified(_.key.fields) || pulse.modified(_.parentKey.fields);\n\n // prevent upstream source pollution\n out.source = out.source.slice();\n if (run) {\n tree = out.source.length ? lookup(stratify().id(_.key).parentId(_.parentKey)(out.source), _.key, truthy) : lookup(stratify()([{}]), _.key, _.key);\n }\n out.source.root = this.value = tree;\n return out;\n }\n});\n\nconst Layouts = {\n tidy: tree,\n cluster: cluster\n};\nconst Output$1 = ['x', 'y', 'depth', 'children'];\n\n/**\n * Tree layout. Depending on the method parameter, performs either\n * Reingold-Tilford 'tidy' layout or dendrogram 'cluster' layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction Tree(params) {\n HierarchyLayout.call(this, params);\n}\nTree.Definition = {\n 'type': 'Tree',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'method',\n 'type': 'enum',\n 'default': 'tidy',\n 'values': ['tidy', 'cluster']\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'nodeSize',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'separation',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output$1.length,\n 'default': Output$1\n }]\n};\ninherits(Tree, HierarchyLayout, {\n /**\n * Tree layout generator. Supports both 'tidy' and 'cluster' layouts.\n */\n layout(method) {\n const m = method || 'tidy';\n if (hasOwnProperty(Layouts, m)) return Layouts[m]();else error('Unrecognized Tree layout method: ' + m);\n },\n params: ['size', 'nodeSize'],\n fields: Output$1\n});\n\n/**\n * Generate tuples representing links between tree nodes.\n * The resulting tuples will contain 'source' and 'target' fields,\n * which point to parent and child node tuples, respectively.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction TreeLinks(params) {\n Transform.call(this, [], params);\n}\nTreeLinks.Definition = {\n 'type': 'TreeLinks',\n 'metadata': {\n 'tree': true,\n 'generates': true,\n 'changes': true\n },\n 'params': []\n};\ninherits(TreeLinks, Transform, {\n transform(_, pulse) {\n const links = this.value,\n tree = pulse.source && pulse.source.root,\n out = pulse.fork(pulse.NO_SOURCE),\n lut = {};\n if (!tree) error('TreeLinks transform requires a tree data source.');\n if (pulse.changed(pulse.ADD_REM)) {\n // remove previous links\n out.rem = links;\n\n // build lookup table of valid tuples\n pulse.visit(pulse.SOURCE, t => lut[tupleid(t)] = 1);\n\n // generate links for all edges incident on valid tuples\n tree.each(node => {\n const t = node.data,\n p = node.parent && node.parent.data;\n if (p && lut[tupleid(t)] && lut[tupleid(p)]) {\n out.add.push(ingest({\n source: p,\n target: t\n }));\n }\n });\n this.value = out.add;\n } else if (pulse.changed(pulse.MOD)) {\n // build lookup table of modified tuples\n pulse.visit(pulse.MOD, t => lut[tupleid(t)] = 1);\n\n // gather links incident on modified tuples\n links.forEach(link => {\n if (lut[tupleid(link.source)] || lut[tupleid(link.target)]) {\n out.mod.push(link);\n }\n });\n }\n return out;\n }\n});\n\nconst Tiles = {\n binary: treemapBinary,\n dice: treemapDice,\n slice: treemapSlice,\n slicedice: treemapSliceDice,\n squarify: treemapSquarify,\n resquarify: treemapResquarify\n};\nconst Output = ['x0', 'y0', 'x1', 'y1', 'depth', 'children'];\n\n/**\n * Treemap layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size nodes.\n */\nfunction Treemap(params) {\n HierarchyLayout.call(this, params);\n}\nTreemap.Definition = {\n 'type': 'Treemap',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'method',\n 'type': 'enum',\n 'default': 'squarify',\n 'values': ['squarify', 'resquarify', 'binary', 'dice', 'slice', 'slicedice']\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingInner',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingOuter',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingTop',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingRight',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingBottom',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingLeft',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'ratio',\n 'type': 'number',\n 'default': 1.618033988749895\n }, {\n 'name': 'round',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output.length,\n 'default': Output\n }]\n};\ninherits(Treemap, HierarchyLayout, {\n /**\n * Treemap layout generator. Adds 'method' and 'ratio' parameters\n * to configure the underlying tile method.\n */\n layout() {\n const x = treemap();\n x.ratio = _ => {\n const t = x.tile();\n if (t.ratio) x.tile(t.ratio(_));\n };\n x.method = _ => {\n if (hasOwnProperty(Tiles, _)) x.tile(Tiles[_]);else error('Unrecognized Treemap layout method: ' + _);\n };\n return x;\n },\n params: ['method', 'ratio', 'size', 'round', 'padding', 'paddingInner', 'paddingOuter', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n fields: Output\n});\n\nexport { Nest as nest, Pack as pack, Partition as partition, Stratify as stratify, Tree as tree, TreeLinks as treelinks, Treemap as treemap };\n","import roundNode from \"./treemap/round.js\";\nimport treemapDice from \"./treemap/dice.js\";\n\nexport default function() {\n var dx = 1,\n dy = 1,\n padding = 0,\n round = false;\n\n function partition(root) {\n var n = root.height + 1;\n root.x0 =\n root.y0 = padding;\n root.x1 = dx;\n root.y1 = dy / n;\n root.eachBefore(positionNode(dy, n));\n if (round) root.eachBefore(roundNode);\n return root;\n }\n\n function positionNode(dy, n) {\n return function(node) {\n if (node.children) {\n treemapDice(node, node.x0, dy * (node.depth + 1) / n, node.x1, dy * (node.depth + 2) / n);\n }\n var x0 = node.x0,\n y0 = node.y0,\n x1 = node.x1 - padding,\n y1 = node.y1 - padding;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n };\n }\n\n partition.round = function(x) {\n return arguments.length ? (round = !!x, partition) : round;\n };\n\n partition.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], partition) : [dx, dy];\n };\n\n partition.padding = function(x) {\n return arguments.length ? (padding = +x, partition) : padding;\n };\n\n return partition;\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n i, n = nodes.length,\n sum, sums = new Array(n + 1);\n\n for (sums[0] = sum = i = 0; i < n; ++i) {\n sums[i + 1] = sum += nodes[i].value;\n }\n\n partition(0, n, parent.value, x0, y0, x1, y1);\n\n function partition(i, j, value, x0, y0, x1, y1) {\n if (i >= j - 1) {\n var node = nodes[i];\n node.x0 = x0, node.y0 = y0;\n node.x1 = x1, node.y1 = y1;\n return;\n }\n\n var valueOffset = sums[i],\n valueTarget = (value / 2) + valueOffset,\n k = i + 1,\n hi = j - 1;\n\n while (k < hi) {\n var mid = k + hi >>> 1;\n if (sums[mid] < valueTarget) k = mid + 1;\n else hi = mid;\n }\n\n if ((valueTarget - sums[k - 1]) < (sums[k] - valueTarget) && i + 1 < k) --k;\n\n var valueLeft = sums[k] - valueOffset,\n valueRight = value - valueLeft;\n\n if ((x1 - x0) > (y1 - y0)) {\n var xk = value ? (x0 * valueRight + x1 * valueLeft) / value : x1;\n partition(i, k, valueLeft, x0, y0, xk, y1);\n partition(k, j, valueRight, xk, y0, x1, y1);\n } else {\n var yk = value ? (y0 * valueRight + y1 * valueLeft) / value : y1;\n partition(i, k, valueLeft, x0, y0, x1, yk);\n partition(k, j, valueRight, x0, yk, x1, y1);\n }\n }\n}\n","import dice from \"./dice.js\";\nimport slice from \"./slice.js\";\n\nexport default function(parent, x0, y0, x1, y1) {\n (parent.depth & 1 ? slice : dice)(parent, x0, y0, x1, y1);\n}\n","import roundNode from \"./round.js\";\nimport squarify from \"./squarify.js\";\nimport {required} from \"../accessors.js\";\nimport constant, {constantZero} from \"../constant.js\";\n\nexport default function() {\n var tile = squarify,\n round = false,\n dx = 1,\n dy = 1,\n paddingStack = [0],\n paddingInner = constantZero,\n paddingTop = constantZero,\n paddingRight = constantZero,\n paddingBottom = constantZero,\n paddingLeft = constantZero;\n\n function treemap(root) {\n root.x0 =\n root.y0 = 0;\n root.x1 = dx;\n root.y1 = dy;\n root.eachBefore(positionNode);\n paddingStack = [0];\n if (round) root.eachBefore(roundNode);\n return root;\n }\n\n function positionNode(node) {\n var p = paddingStack[node.depth],\n x0 = node.x0 + p,\n y0 = node.y0 + p,\n x1 = node.x1 - p,\n y1 = node.y1 - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n if (node.children) {\n p = paddingStack[node.depth + 1] = paddingInner(node) / 2;\n x0 += paddingLeft(node) - p;\n y0 += paddingTop(node) - p;\n x1 -= paddingRight(node) - p;\n y1 -= paddingBottom(node) - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n tile(node, x0, y0, x1, y1);\n }\n }\n\n treemap.round = function(x) {\n return arguments.length ? (round = !!x, treemap) : round;\n };\n\n treemap.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];\n };\n\n treemap.tile = function(x) {\n return arguments.length ? (tile = required(x), treemap) : tile;\n };\n\n treemap.padding = function(x) {\n return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();\n };\n\n treemap.paddingInner = function(x) {\n return arguments.length ? (paddingInner = typeof x === \"function\" ? x : constant(+x), treemap) : paddingInner;\n };\n\n treemap.paddingOuter = function(x) {\n return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();\n };\n\n treemap.paddingTop = function(x) {\n return arguments.length ? (paddingTop = typeof x === \"function\" ? x : constant(+x), treemap) : paddingTop;\n };\n\n treemap.paddingRight = function(x) {\n return arguments.length ? (paddingRight = typeof x === \"function\" ? x : constant(+x), treemap) : paddingRight;\n };\n\n treemap.paddingBottom = function(x) {\n return arguments.length ? (paddingBottom = typeof x === \"function\" ? x : constant(+x), treemap) : paddingBottom;\n };\n\n treemap.paddingLeft = function(x) {\n return arguments.length ? (paddingLeft = typeof x === \"function\" ? x : constant(+x), treemap) : paddingLeft;\n };\n\n return treemap;\n}\n","import { Marks, textMetrics } from 'vega-scenegraph';\nimport { canvas } from 'vega-canvas';\nimport { rederive, Transform } from 'vega-dataflow';\nimport { inherits, error, array, isFunction } from 'vega-util';\n\n// bit mask for getting first 2 bytes of alpha value\nconst ALPHA_MASK = 0xff000000;\nfunction baseBitmaps($, data) {\n const bitmap = $.bitmap();\n // when there is no base mark but data points are to be avoided\n (data || []).forEach(d => bitmap.set($(d.boundary[0]), $(d.boundary[3])));\n return [bitmap, undefined];\n}\nfunction markBitmaps($, baseMark, avoidMarks, labelInside, isGroupArea) {\n // create canvas\n const width = $.width,\n height = $.height,\n border = labelInside || isGroupArea,\n context = canvas(width, height).getContext('2d'),\n baseMarkContext = canvas(width, height).getContext('2d'),\n strokeContext = border && canvas(width, height).getContext('2d');\n\n // render all marks to be avoided into canvas\n avoidMarks.forEach(items => draw(context, items, false));\n draw(baseMarkContext, baseMark, false);\n if (border) {\n draw(strokeContext, baseMark, true);\n }\n\n // get canvas buffer, create bitmaps\n const buffer = getBuffer(context, width, height),\n baseMarkBuffer = getBuffer(baseMarkContext, width, height),\n strokeBuffer = border && getBuffer(strokeContext, width, height),\n layer1 = $.bitmap(),\n layer2 = border && $.bitmap();\n\n // populate bitmap layers\n let x, y, u, v, index, alpha, strokeAlpha, baseMarkAlpha;\n for (y = 0; y < height; ++y) {\n for (x = 0; x < width; ++x) {\n index = y * width + x;\n alpha = buffer[index] & ALPHA_MASK;\n baseMarkAlpha = baseMarkBuffer[index] & ALPHA_MASK;\n strokeAlpha = border && strokeBuffer[index] & ALPHA_MASK;\n if (alpha || strokeAlpha || baseMarkAlpha) {\n u = $(x);\n v = $(y);\n if (!isGroupArea && (alpha || baseMarkAlpha)) layer1.set(u, v); // update interior bitmap\n if (border && (alpha || strokeAlpha)) layer2.set(u, v); // update border bitmap\n }\n }\n }\n\n return [layer1, layer2];\n}\nfunction getBuffer(context, width, height) {\n return new Uint32Array(context.getImageData(0, 0, width, height).data.buffer);\n}\nfunction draw(context, items, interior) {\n if (!items.length) return;\n const type = items[0].mark.marktype;\n if (type === 'group') {\n items.forEach(group => {\n group.items.forEach(mark => draw(context, mark.items, interior));\n });\n } else {\n Marks[type].draw(context, {\n items: interior ? items.map(prepare) : items\n });\n }\n}\n\n/**\n * Prepare item before drawing into canvas (setting stroke and opacity)\n * @param {object} source item to be prepared\n * @returns prepared item\n */\nfunction prepare(source) {\n const item = rederive(source, {});\n if (item.stroke && item.strokeOpacity !== 0 || item.fill && item.fillOpacity !== 0) {\n return {\n ...item,\n strokeOpacity: 1,\n stroke: '#000',\n fillOpacity: 0\n };\n }\n return item;\n}\n\nconst DIV = 5,\n // bit shift from x, y index to bit vector array index\n MOD = 31,\n // bit mask for index lookup within a bit vector\n SIZE = 32,\n // individual bit vector size\n RIGHT0 = new Uint32Array(SIZE + 1),\n // left-anchored bit vectors, full -> 0\n RIGHT1 = new Uint32Array(SIZE + 1); // right-anchored bit vectors, 0 -> full\n\nRIGHT1[0] = 0;\nRIGHT0[0] = ~RIGHT1[0];\nfor (let i = 1; i <= SIZE; ++i) {\n RIGHT1[i] = RIGHT1[i - 1] << 1 | 1;\n RIGHT0[i] = ~RIGHT1[i];\n}\nfunction Bitmap (w, h) {\n const array = new Uint32Array(~~((w * h + SIZE) / SIZE));\n function _set(index, mask) {\n array[index] |= mask;\n }\n function _clear(index, mask) {\n array[index] &= mask;\n }\n return {\n array: array,\n get: (x, y) => {\n const index = y * w + x;\n return array[index >>> DIV] & 1 << (index & MOD);\n },\n set: (x, y) => {\n const index = y * w + x;\n _set(index >>> DIV, 1 << (index & MOD));\n },\n clear: (x, y) => {\n const index = y * w + x;\n _clear(index >>> DIV, ~(1 << (index & MOD)));\n },\n getRange: (x, y, x2, y2) => {\n let r = y2,\n start,\n end,\n indexStart,\n indexEnd;\n for (; r >= y; --r) {\n start = r * w + x;\n end = r * w + x2;\n indexStart = start >>> DIV;\n indexEnd = end >>> DIV;\n if (indexStart === indexEnd) {\n if (array[indexStart] & RIGHT0[start & MOD] & RIGHT1[(end & MOD) + 1]) {\n return true;\n }\n } else {\n if (array[indexStart] & RIGHT0[start & MOD]) return true;\n if (array[indexEnd] & RIGHT1[(end & MOD) + 1]) return true;\n for (let i = indexStart + 1; i < indexEnd; ++i) {\n if (array[i]) return true;\n }\n }\n }\n return false;\n },\n setRange: (x, y, x2, y2) => {\n let start, end, indexStart, indexEnd, i;\n for (; y <= y2; ++y) {\n start = y * w + x;\n end = y * w + x2;\n indexStart = start >>> DIV;\n indexEnd = end >>> DIV;\n if (indexStart === indexEnd) {\n _set(indexStart, RIGHT0[start & MOD] & RIGHT1[(end & MOD) + 1]);\n } else {\n _set(indexStart, RIGHT0[start & MOD]);\n _set(indexEnd, RIGHT1[(end & MOD) + 1]);\n for (i = indexStart + 1; i < indexEnd; ++i) _set(i, 0xffffffff);\n }\n }\n },\n clearRange: (x, y, x2, y2) => {\n let start, end, indexStart, indexEnd, i;\n for (; y <= y2; ++y) {\n start = y * w + x;\n end = y * w + x2;\n indexStart = start >>> DIV;\n indexEnd = end >>> DIV;\n if (indexStart === indexEnd) {\n _clear(indexStart, RIGHT1[start & MOD] | RIGHT0[(end & MOD) + 1]);\n } else {\n _clear(indexStart, RIGHT1[start & MOD]);\n _clear(indexEnd, RIGHT0[(end & MOD) + 1]);\n for (i = indexStart + 1; i < indexEnd; ++i) _clear(i, 0);\n }\n }\n },\n outOfBounds: (x, y, x2, y2) => x < 0 || y < 0 || y2 >= h || x2 >= w\n };\n}\n\nfunction scaler (width, height, padding) {\n const ratio = Math.max(1, Math.sqrt(width * height / 1e6)),\n w = ~~((width + 2 * padding + ratio) / ratio),\n h = ~~((height + 2 * padding + ratio) / ratio),\n scale = _ => ~~((_ + padding) / ratio);\n scale.invert = _ => _ * ratio - padding;\n scale.bitmap = () => Bitmap(w, h);\n scale.ratio = ratio;\n scale.padding = padding;\n scale.width = width;\n scale.height = height;\n return scale;\n}\n\nfunction placeAreaLabelNaive ($, bitmaps, avoidBaseMark, markIndex) {\n const width = $.width,\n height = $.height;\n\n // try to place a label within an input area mark\n return function (d) {\n const items = d.datum.datum.items[markIndex].items,\n // area points\n n = items.length,\n // number of points\n textHeight = d.datum.fontSize,\n // label width\n textWidth = textMetrics.width(d.datum, d.datum.text); // label height\n\n let maxAreaWidth = 0,\n x1,\n x2,\n y1,\n y2,\n x,\n y,\n areaWidth;\n\n // for each area sample point\n for (let i = 0; i < n; ++i) {\n x1 = items[i].x;\n y1 = items[i].y;\n x2 = items[i].x2 === undefined ? x1 : items[i].x2;\n y2 = items[i].y2 === undefined ? y1 : items[i].y2;\n x = (x1 + x2) / 2;\n y = (y1 + y2) / 2;\n areaWidth = Math.abs(x2 - x1 + y2 - y1);\n if (areaWidth >= maxAreaWidth) {\n maxAreaWidth = areaWidth;\n d.x = x;\n d.y = y;\n }\n }\n x = textWidth / 2;\n y = textHeight / 2;\n x1 = d.x - x;\n x2 = d.x + x;\n y1 = d.y - y;\n y2 = d.y + y;\n d.align = 'center';\n if (x1 < 0 && x2 <= width) {\n d.align = 'left';\n } else if (0 <= x1 && width < x2) {\n d.align = 'right';\n }\n d.baseline = 'middle';\n if (y1 < 0 && y2 <= height) {\n d.baseline = 'top';\n } else if (0 <= y1 && height < y2) {\n d.baseline = 'bottom';\n }\n return true;\n };\n}\n\nfunction outOfBounds(x, y, textWidth, textHeight, width, height) {\n let r = textWidth / 2;\n return x - r < 0 || x + r > width || y - (r = textHeight / 2) < 0 || y + r > height;\n}\nfunction collision($, x, y, textHeight, textWidth, h, bm0, bm1) {\n const w = textWidth * h / (textHeight * 2),\n x1 = $(x - w),\n x2 = $(x + w),\n y1 = $(y - (h = h / 2)),\n y2 = $(y + h);\n return bm0.outOfBounds(x1, y1, x2, y2) || bm0.getRange(x1, y1, x2, y2) || bm1 && bm1.getRange(x1, y1, x2, y2);\n}\n\nfunction placeAreaLabelReducedSearch ($, bitmaps, avoidBaseMark, markIndex) {\n const width = $.width,\n height = $.height,\n bm0 = bitmaps[0],\n // where labels have been placed\n bm1 = bitmaps[1]; // area outlines\n\n function tryLabel(_x, _y, maxSize, textWidth, textHeight) {\n const x = $.invert(_x),\n y = $.invert(_y);\n let lo = maxSize,\n hi = height,\n mid;\n if (!outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, lo, bm0, bm1) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n // if the label fits at the current sample point,\n // perform binary search to find the largest font size that fits\n while (hi - lo >= 1) {\n mid = (lo + hi) / 2;\n if (collision($, x, y, textHeight, textWidth, mid, bm0, bm1)) {\n hi = mid;\n } else {\n lo = mid;\n }\n }\n // place label if current lower bound exceeds prior max font size\n if (lo > maxSize) {\n return [x, y, lo, true];\n }\n }\n }\n\n // try to place a label within an input area mark\n return function (d) {\n const items = d.datum.datum.items[markIndex].items,\n // area points\n n = items.length,\n // number of points\n textHeight = d.datum.fontSize,\n // label width\n textWidth = textMetrics.width(d.datum, d.datum.text); // label height\n\n let maxSize = avoidBaseMark ? textHeight : 0,\n labelPlaced = false,\n labelPlaced2 = false,\n maxAreaWidth = 0,\n x1,\n x2,\n y1,\n y2,\n x,\n y,\n _x,\n _y,\n _x1,\n _xMid,\n _x2,\n _y1,\n _yMid,\n _y2,\n areaWidth,\n result,\n swapTmp;\n\n // for each area sample point\n for (let i = 0; i < n; ++i) {\n x1 = items[i].x;\n y1 = items[i].y;\n x2 = items[i].x2 === undefined ? x1 : items[i].x2;\n y2 = items[i].y2 === undefined ? y1 : items[i].y2;\n if (x1 > x2) {\n swapTmp = x1;\n x1 = x2;\n x2 = swapTmp;\n }\n if (y1 > y2) {\n swapTmp = y1;\n y1 = y2;\n y2 = swapTmp;\n }\n _x1 = $(x1);\n _x2 = $(x2);\n _xMid = ~~((_x1 + _x2) / 2);\n _y1 = $(y1);\n _y2 = $(y2);\n _yMid = ~~((_y1 + _y2) / 2);\n\n // search along the line from mid point between the 2 border to lower border\n for (_x = _xMid; _x >= _x1; --_x) {\n for (_y = _yMid; _y >= _y1; --_y) {\n result = tryLabel(_x, _y, maxSize, textWidth, textHeight);\n if (result) {\n [d.x, d.y, maxSize, labelPlaced] = result;\n }\n }\n }\n\n // search along the line from mid point between the 2 border to upper border\n for (_x = _xMid; _x <= _x2; ++_x) {\n for (_y = _yMid; _y <= _y2; ++_y) {\n result = tryLabel(_x, _y, maxSize, textWidth, textHeight);\n if (result) {\n [d.x, d.y, maxSize, labelPlaced] = result;\n }\n }\n }\n\n // place label at slice center if not placed through other means\n // and if we're not avoiding overlap with other areas\n if (!labelPlaced && !avoidBaseMark) {\n // one span is zero, hence we can add\n areaWidth = Math.abs(x2 - x1 + y2 - y1);\n x = (x1 + x2) / 2;\n y = (y1 + y2) / 2;\n\n // place label if it fits and improves the max area width\n if (areaWidth >= maxAreaWidth && !outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n maxAreaWidth = areaWidth;\n d.x = x;\n d.y = y;\n labelPlaced2 = true;\n }\n }\n }\n\n // record current label placement information, update label bitmap\n if (labelPlaced || labelPlaced2) {\n x = textWidth / 2;\n y = textHeight / 2;\n bm0.setRange($(d.x - x), $(d.y - y), $(d.x + x), $(d.y + y));\n d.align = 'center';\n d.baseline = 'middle';\n return true;\n } else {\n return false;\n }\n };\n}\n\n// pixel direction offsets for flood fill search\nconst X_DIR = [-1, -1, 1, 1];\nconst Y_DIR = [-1, 1, -1, 1];\nfunction placeAreaLabelFloodFill ($, bitmaps, avoidBaseMark, markIndex) {\n const width = $.width,\n height = $.height,\n bm0 = bitmaps[0],\n // where labels have been placed\n bm1 = bitmaps[1],\n // area outlines\n bm2 = $.bitmap(); // flood-fill visitations\n\n // try to place a label within an input area mark\n return function (d) {\n const items = d.datum.datum.items[markIndex].items,\n // area points\n n = items.length,\n // number of points\n textHeight = d.datum.fontSize,\n // label width\n textWidth = textMetrics.width(d.datum, d.datum.text),\n // label height\n stack = []; // flood fill stack\n\n let maxSize = avoidBaseMark ? textHeight : 0,\n labelPlaced = false,\n labelPlaced2 = false,\n maxAreaWidth = 0,\n x1,\n x2,\n y1,\n y2,\n x,\n y,\n _x,\n _y,\n lo,\n hi,\n mid,\n areaWidth;\n\n // for each area sample point\n for (let i = 0; i < n; ++i) {\n x1 = items[i].x;\n y1 = items[i].y;\n x2 = items[i].x2 === undefined ? x1 : items[i].x2;\n y2 = items[i].y2 === undefined ? y1 : items[i].y2;\n\n // add scaled center point to stack\n stack.push([$((x1 + x2) / 2), $((y1 + y2) / 2)]);\n\n // perform flood fill, visit points\n while (stack.length) {\n [_x, _y] = stack.pop();\n\n // exit if point already marked\n if (bm0.get(_x, _y) || bm1.get(_x, _y) || bm2.get(_x, _y)) continue;\n\n // mark point in flood fill bitmap\n // add search points for all (in bound) directions\n bm2.set(_x, _y);\n for (let j = 0; j < 4; ++j) {\n x = _x + X_DIR[j];\n y = _y + Y_DIR[j];\n if (!bm2.outOfBounds(x, y, x, y)) stack.push([x, y]);\n }\n\n // unscale point back to x, y space\n x = $.invert(_x);\n y = $.invert(_y);\n lo = maxSize;\n hi = height; // TODO: make this bound smaller\n\n if (!outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, lo, bm0, bm1) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n // if the label fits at the current sample point,\n // perform binary search to find the largest font size that fits\n while (hi - lo >= 1) {\n mid = (lo + hi) / 2;\n if (collision($, x, y, textHeight, textWidth, mid, bm0, bm1)) {\n hi = mid;\n } else {\n lo = mid;\n }\n }\n // place label if current lower bound exceeds prior max font size\n if (lo > maxSize) {\n d.x = x;\n d.y = y;\n maxSize = lo;\n labelPlaced = true;\n }\n }\n }\n\n // place label at slice center if not placed through other means\n // and if we're not avoiding overlap with other areas\n if (!labelPlaced && !avoidBaseMark) {\n // one span is zero, hence we can add\n areaWidth = Math.abs(x2 - x1 + y2 - y1);\n x = (x1 + x2) / 2;\n y = (y1 + y2) / 2;\n\n // place label if it fits and improves the max area width\n if (areaWidth >= maxAreaWidth && !outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n maxAreaWidth = areaWidth;\n d.x = x;\n d.y = y;\n labelPlaced2 = true;\n }\n }\n }\n\n // record current label placement information, update label bitmap\n if (labelPlaced || labelPlaced2) {\n x = textWidth / 2;\n y = textHeight / 2;\n bm0.setRange($(d.x - x), $(d.y - y), $(d.x + x), $(d.y + y));\n d.align = 'center';\n d.baseline = 'middle';\n return true;\n } else {\n return false;\n }\n };\n}\n\nconst Aligns = ['right', 'center', 'left'],\n Baselines = ['bottom', 'middle', 'top'];\nfunction placeMarkLabel ($, bitmaps, anchors, offsets) {\n const width = $.width,\n height = $.height,\n bm0 = bitmaps[0],\n bm1 = bitmaps[1],\n n = offsets.length;\n return function (d) {\n const boundary = d.boundary,\n textHeight = d.datum.fontSize;\n\n // can not be placed if the mark is not visible in the graph bound\n if (boundary[2] < 0 || boundary[5] < 0 || boundary[0] > width || boundary[3] > height) {\n return false;\n }\n let textWidth = d.textWidth ?? 0,\n dx,\n dy,\n isInside,\n sizeFactor,\n insideFactor,\n x1,\n x2,\n y1,\n y2,\n xc,\n yc,\n _x1,\n _x2,\n _y1,\n _y2;\n\n // for each anchor and offset\n for (let i = 0; i < n; ++i) {\n dx = (anchors[i] & 0x3) - 1;\n dy = (anchors[i] >>> 0x2 & 0x3) - 1;\n isInside = dx === 0 && dy === 0 || offsets[i] < 0;\n sizeFactor = dx && dy ? Math.SQRT1_2 : 1;\n insideFactor = offsets[i] < 0 ? -1 : 1;\n x1 = boundary[1 + dx] + offsets[i] * dx * sizeFactor;\n yc = boundary[4 + dy] + insideFactor * textHeight * dy / 2 + offsets[i] * dy * sizeFactor;\n y1 = yc - textHeight / 2;\n y2 = yc + textHeight / 2;\n _x1 = $(x1);\n _y1 = $(y1);\n _y2 = $(y2);\n if (!textWidth) {\n // to avoid finding width of text label,\n if (!test(_x1, _x1, _y1, _y2, bm0, bm1, x1, x1, y1, y2, boundary, isInside)) {\n // skip this anchor/offset option if we fail to place a label with 1px width\n continue;\n } else {\n // Otherwise, find the label width\n textWidth = textMetrics.width(d.datum, d.datum.text);\n }\n }\n xc = x1 + insideFactor * textWidth * dx / 2;\n x1 = xc - textWidth / 2;\n x2 = xc + textWidth / 2;\n _x1 = $(x1);\n _x2 = $(x2);\n if (test(_x1, _x2, _y1, _y2, bm0, bm1, x1, x2, y1, y2, boundary, isInside)) {\n // place label if the position is placeable\n d.x = !dx ? xc : dx * insideFactor < 0 ? x2 : x1;\n d.y = !dy ? yc : dy * insideFactor < 0 ? y2 : y1;\n d.align = Aligns[dx * insideFactor + 1];\n d.baseline = Baselines[dy * insideFactor + 1];\n bm0.setRange(_x1, _y1, _x2, _y2);\n return true;\n }\n }\n return false;\n };\n}\n\n// Test if a label with the given dimensions can be added without overlap\nfunction test(_x1, _x2, _y1, _y2, bm0, bm1, x1, x2, y1, y2, boundary, isInside) {\n return !(bm0.outOfBounds(_x1, _y1, _x2, _y2) || (isInside && bm1 || bm0).getRange(_x1, _y1, _x2, _y2));\n}\n\n// 8-bit representation of anchors\nconst TOP = 0x0,\n MIDDLE = 0x4,\n BOTTOM = 0x8,\n LEFT = 0x0,\n CENTER = 0x1,\n RIGHT = 0x2;\n\n// Mapping from text anchor to number representation\nconst anchorCode = {\n 'top-left': TOP + LEFT,\n 'top': TOP + CENTER,\n 'top-right': TOP + RIGHT,\n 'left': MIDDLE + LEFT,\n 'middle': MIDDLE + CENTER,\n 'right': MIDDLE + RIGHT,\n 'bottom-left': BOTTOM + LEFT,\n 'bottom': BOTTOM + CENTER,\n 'bottom-right': BOTTOM + RIGHT\n};\nconst placeAreaLabel = {\n 'naive': placeAreaLabelNaive,\n 'reduced-search': placeAreaLabelReducedSearch,\n 'floodfill': placeAreaLabelFloodFill\n};\nfunction labelLayout (texts, size, compare, offset, anchor, avoidMarks, avoidBaseMark, lineAnchor, markIndex, padding, method) {\n // early exit for empty data\n if (!texts.length) return texts;\n const positions = Math.max(offset.length, anchor.length),\n offsets = getOffsets(offset, positions),\n anchors = getAnchors(anchor, positions),\n marktype = markType(texts[0].datum),\n grouptype = marktype === 'group' && texts[0].datum.items[markIndex].marktype,\n isGroupArea = grouptype === 'area',\n boundary = markBoundary(marktype, grouptype, lineAnchor, markIndex),\n infPadding = padding === null || padding === Infinity,\n isNaiveGroupArea = isGroupArea && method === 'naive';\n let maxTextWidth = -1,\n maxTextHeight = -1;\n\n // prepare text mark data for placing\n const data = texts.map(d => {\n const textWidth = infPadding ? textMetrics.width(d, d.text) : undefined;\n maxTextWidth = Math.max(maxTextWidth, textWidth);\n maxTextHeight = Math.max(maxTextHeight, d.fontSize);\n return {\n datum: d,\n opacity: 0,\n x: undefined,\n y: undefined,\n align: undefined,\n baseline: undefined,\n boundary: boundary(d),\n textWidth\n };\n });\n padding = padding === null || padding === Infinity ? Math.max(maxTextWidth, maxTextHeight) + Math.max(...offset) : padding;\n const $ = scaler(size[0], size[1], padding);\n let bitmaps;\n if (!isNaiveGroupArea) {\n // sort labels in priority order, if comparator is provided\n if (compare) {\n data.sort((a, b) => compare(a.datum, b.datum));\n }\n\n // flag indicating if label can be placed inside its base mark\n let labelInside = false;\n for (let i = 0; i < anchors.length && !labelInside; ++i) {\n // label inside if anchor is at center\n // label inside if offset to be inside the mark bound\n labelInside = anchors[i] === 0x5 || offsets[i] < 0;\n }\n\n // extract data information from base mark when base mark is to be avoided\n // base mark is implicitly avoided if it is a group area\n const baseMark = (marktype && avoidBaseMark || isGroupArea) && texts.map(d => d.datum);\n\n // generate bitmaps for layout calculation\n bitmaps = avoidMarks.length || baseMark ? markBitmaps($, baseMark || [], avoidMarks, labelInside, isGroupArea) : baseBitmaps($, avoidBaseMark && data);\n }\n\n // generate label placement function\n const place = isGroupArea ? placeAreaLabel[method]($, bitmaps, avoidBaseMark, markIndex) : placeMarkLabel($, bitmaps, anchors, offsets);\n\n // place all labels\n data.forEach(d => d.opacity = +place(d));\n return data;\n}\nfunction getOffsets(_, count) {\n const offsets = new Float64Array(count),\n n = _.length;\n for (let i = 0; i < n; ++i) offsets[i] = _[i] || 0;\n for (let i = n; i < count; ++i) offsets[i] = offsets[n - 1];\n return offsets;\n}\nfunction getAnchors(_, count) {\n const anchors = new Int8Array(count),\n n = _.length;\n for (let i = 0; i < n; ++i) anchors[i] |= anchorCode[_[i]];\n for (let i = n; i < count; ++i) anchors[i] = anchors[n - 1];\n return anchors;\n}\nfunction markType(item) {\n return item && item.mark && item.mark.marktype;\n}\n\n/**\n * Factory function for function for getting base mark boundary, depending\n * on mark and group type. When mark type is undefined, line or area: boundary\n * is the coordinate of each data point. When base mark is grouped line,\n * boundary is either at the start or end of the line depending on the\n * value of lineAnchor. Otherwise, use bounds of base mark.\n */\nfunction markBoundary(marktype, grouptype, lineAnchor, markIndex) {\n const xy = d => [d.x, d.x, d.x, d.y, d.y, d.y];\n if (!marktype) {\n return xy; // no reactive geometry\n } else if (marktype === 'line' || marktype === 'area') {\n return d => xy(d.datum);\n } else if (grouptype === 'line') {\n return d => {\n const items = d.datum.items[markIndex].items;\n return xy(items.length ? items[lineAnchor === 'start' ? 0 : items.length - 1] : {\n x: NaN,\n y: NaN\n });\n };\n } else {\n return d => {\n const b = d.datum.bounds;\n return [b.x1, (b.x1 + b.x2) / 2, b.x2, b.y1, (b.y1 + b.y2) / 2, b.y2];\n };\n }\n}\n\nconst Output = ['x', 'y', 'opacity', 'align', 'baseline'];\nconst Anchors = ['top-left', 'left', 'bottom-left', 'top', 'bottom', 'top-right', 'right', 'bottom-right'];\n\n/**\n * Compute text label layout to annotate marks.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.size - The size of the layout, provided as a [width, height] array.\n * @param {function(*,*): number} [params.sort] - An optional\n * comparator function for sorting label data in priority order.\n * @param {Array} [params.anchor] - Label anchor points relative to the base mark bounding box.\n * The available options are 'top-left', 'left', 'bottom-left', 'top',\n * 'bottom', 'top-right', 'right', 'bottom-right', 'middle'.\n * @param {Array} [params.offset] - Label offsets (in pixels) from the base mark bounding box.\n * This parameter is parallel to the list of anchor points.\n * @param {number | null} [params.padding=0] - The amount (in pixels) that a label may exceed the layout size.\n * If this parameter is null, a label may exceed the layout size without any boundary.\n * @param {string} [params.lineAnchor='end'] - For group line mark labels only, indicates the anchor\n * position for labels. One of 'start' or 'end'.\n * @param {string} [params.markIndex=0] - For group mark labels only, an index indicating\n * which mark within the group should be labeled.\n * @param {Array} [params.avoidMarks] - A list of additional mark names for which the label\n * layout should avoid overlap.\n * @param {boolean} [params.avoidBaseMark=true] - Boolean flag indicating if labels should avoid\n * overlap with the underlying base mark being labeled.\n * @param {string} [params.method='naive'] - For area make labels only, a method for\n * place labels. One of 'naive', 'reduced-search', or 'floodfill'.\n * @param {Array} [params.as] - The output fields written by the transform.\n * The default is ['x', 'y', 'opacity', 'align', 'baseline'].\n */\nfunction Label(params) {\n Transform.call(this, null, params);\n}\nLabel.Definition = {\n type: 'Label',\n metadata: {\n modifies: true\n },\n params: [{\n name: 'size',\n type: 'number',\n array: true,\n length: 2,\n required: true\n }, {\n name: 'sort',\n type: 'compare'\n }, {\n name: 'anchor',\n type: 'string',\n array: true,\n default: Anchors\n }, {\n name: 'offset',\n type: 'number',\n array: true,\n default: [1]\n }, {\n name: 'padding',\n type: 'number',\n default: 0,\n null: true\n }, {\n name: 'lineAnchor',\n type: 'string',\n values: ['start', 'end'],\n default: 'end'\n }, {\n name: 'markIndex',\n type: 'number',\n default: 0\n }, {\n name: 'avoidBaseMark',\n type: 'boolean',\n default: true\n }, {\n name: 'avoidMarks',\n type: 'data',\n array: true\n }, {\n name: 'method',\n type: 'string',\n default: 'naive'\n }, {\n name: 'as',\n type: 'string',\n array: true,\n length: Output.length,\n default: Output\n }]\n};\ninherits(Label, Transform, {\n transform(_, pulse) {\n function modp(param) {\n const p = _[param];\n return isFunction(p) && pulse.modified(p.fields);\n }\n const mod = _.modified();\n if (!(mod || pulse.changed(pulse.ADD_REM) || modp('sort'))) return;\n if (!_.size || _.size.length !== 2) {\n error('Size parameter should be specified as a [width, height] array.');\n }\n const as = _.as || Output;\n\n // run label layout\n labelLayout(pulse.materialize(pulse.SOURCE).source || [], _.size, _.sort, array(_.offset == null ? 1 : _.offset), array(_.anchor || Anchors), _.avoidMarks || [], _.avoidBaseMark !== false, _.lineAnchor || 'end', _.markIndex || 0, _.padding === undefined ? 0 : _.padding, _.method || 'naive').forEach(l => {\n // write layout results to data stream\n const t = l.datum;\n t[as[0]] = l.x;\n t[as[1]] = l.y;\n t[as[2]] = l.opacity;\n t[as[3]] = l.align;\n t[as[4]] = l.baseline;\n });\n return pulse.reflow(mod).modifies(as);\n }\n});\n\nexport { Label as label };\n","import { regressionLoess, sampleCurve, regressionLinear, regressionLog, regressionExp, regressionPow, regressionQuad, regressionPoly } from 'vega-statistics';\nimport { Transform, ingest } from 'vega-dataflow';\nimport { inherits, accessorName, hasOwnProperty, error, extent } from 'vega-util';\n\nfunction partition (data, groupby) {\n var groups = [],\n get = function (f) {\n return f(t);\n },\n map,\n i,\n n,\n t,\n k,\n g;\n\n // partition data points into stack groups\n if (groupby == null) {\n groups.push(data);\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n if (!g) {\n map[k] = g = [];\n g.dims = k;\n groups.push(g);\n }\n g.push(t);\n }\n }\n return groups;\n}\n\n/**\n * Compute locally-weighted regression fits for one or more data groups.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.x - An accessor for the predictor data field.\n * @param {function(object): *} params.y - An accessor for the predicted data field.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {number} [params.bandwidth=0.3] - The loess bandwidth.\n */\nfunction Loess(params) {\n Transform.call(this, null, params);\n}\nLoess.Definition = {\n 'type': 'Loess',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'default': 0.3\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }]\n};\ninherits(Loess, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n if (!this.value || pulse.changed() || _.modified()) {\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition(source, _.groupby),\n names = (_.groupby || []).map(accessorName),\n m = names.length,\n as = _.as || [accessorName(_.x), accessorName(_.y)],\n values = [];\n groups.forEach(g => {\n regressionLoess(g, _.x, _.y, _.bandwidth || 0.3).forEach(p => {\n const t = {};\n for (let i = 0; i < m; ++i) {\n t[names[i]] = g.dims[i];\n }\n t[as[0]] = p[0];\n t[as[1]] = p[1];\n values.push(ingest(t));\n });\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n return out;\n }\n});\n\nconst Methods = {\n linear: regressionLinear,\n log: regressionLog,\n exp: regressionExp,\n pow: regressionPow,\n quad: regressionQuad,\n poly: regressionPoly\n};\nconst degreesOfFreedom = (method, order) => method === 'poly' ? order : method === 'quad' ? 2 : 1;\n\n/**\n * Compute regression fits for one or more data groups.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.x - An accessor for the predictor data field.\n * @param {function(object): *} params.y - An accessor for the predicted data field.\n * @param {string} [params.method='linear'] - The regression method to apply.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {Array} [params.extent] - The domain extent over which to plot the regression line.\n * @param {number} [params.order=3] - The polynomial order. Only applies to the 'poly' method.\n */\nfunction Regression(params) {\n Transform.call(this, null, params);\n}\nRegression.Definition = {\n 'type': 'Regression',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'method',\n 'type': 'string',\n 'default': 'linear',\n 'values': Object.keys(Methods)\n }, {\n 'name': 'order',\n 'type': 'number',\n 'default': 3\n }, {\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'params',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }]\n};\ninherits(Regression, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n if (!this.value || pulse.changed() || _.modified()) {\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition(source, _.groupby),\n names = (_.groupby || []).map(accessorName),\n method = _.method || 'linear',\n order = _.order || 3,\n dof = degreesOfFreedom(method, order),\n as = _.as || [accessorName(_.x), accessorName(_.y)],\n fit = Methods[method],\n values = [];\n let domain = _.extent;\n if (!hasOwnProperty(Methods, method)) {\n error('Invalid regression method: ' + method);\n }\n if (domain != null) {\n if (method === 'log' && domain[0] <= 0) {\n pulse.dataflow.warn('Ignoring extent with values <= 0 for log regression.');\n domain = null;\n }\n }\n groups.forEach(g => {\n const n = g.length;\n if (n <= dof) {\n pulse.dataflow.warn('Skipping regression with more parameters than data points.');\n return;\n }\n const model = fit(g, _.x, _.y, order);\n if (_.params) {\n // if parameter vectors requested return those\n values.push(ingest({\n keys: g.dims,\n coef: model.coef,\n rSquared: model.rSquared\n }));\n return;\n }\n const dom = domain || extent(g, _.x),\n add = p => {\n const t = {};\n for (let i = 0; i < names.length; ++i) {\n t[names[i]] = g.dims[i];\n }\n t[as[0]] = p[0];\n t[as[1]] = p[1];\n values.push(ingest(t));\n };\n if (method === 'linear') {\n // for linear regression we only need the end points\n dom.forEach(x => add([x, model.predict(x)]));\n } else {\n // otherwise return trend line sample points\n sampleCurve(model.predict, dom, 25, 200).forEach(add);\n }\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n return out;\n }\n});\n\nexport { Loess as loess, Regression as regression };\n","export const epsilon = 1.1102230246251565e-16;\nexport const splitter = 134217729;\nexport const resulterrbound = (3 + 8 * epsilon) * epsilon;\n\n// fast_expansion_sum_zeroelim routine from oritinal code\nexport function sum(elen, e, flen, f, h) {\n let Q, Qnew, hh, bvirt;\n let enow = e[0];\n let fnow = f[0];\n let eindex = 0;\n let findex = 0;\n if ((fnow > enow) === (fnow > -enow)) {\n Q = enow;\n enow = e[++eindex];\n } else {\n Q = fnow;\n fnow = f[++findex];\n }\n let hindex = 0;\n if (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = enow + Q;\n hh = Q - (Qnew - enow);\n enow = e[++eindex];\n } else {\n Qnew = fnow + Q;\n hh = Q - (Qnew - fnow);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n while (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n } else {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n }\n while (eindex < elen) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n while (findex < flen) {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nexport function sum_three(alen, a, blen, b, clen, c, tmp, out) {\n return sum(sum(alen, a, blen, b, tmp), tmp, clen, c, out);\n}\n\n// scale_expansion_zeroelim routine from oritinal code\nexport function scale(elen, e, b, h) {\n let Q, sum, hh, product1, product0;\n let bvirt, c, ahi, alo, bhi, blo;\n\n c = splitter * b;\n bhi = c - (c - b);\n blo = b - bhi;\n let enow = e[0];\n Q = enow * b;\n c = splitter * enow;\n ahi = c - (c - enow);\n alo = enow - ahi;\n hh = alo * blo - (Q - ahi * bhi - alo * bhi - ahi * blo);\n let hindex = 0;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n for (let i = 1; i < elen; i++) {\n enow = e[i];\n product1 = enow * b;\n c = splitter * enow;\n ahi = c - (c - enow);\n alo = enow - ahi;\n product0 = alo * blo - (product1 - ahi * bhi - alo * bhi - ahi * blo);\n sum = Q + product0;\n bvirt = sum - Q;\n hh = Q - (sum - bvirt) + (product0 - bvirt);\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n Q = product1 + sum;\n hh = sum - (Q - product1);\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nexport function negate(elen, e) {\n for (let i = 0; i < elen; i++) e[i] = -e[i];\n return elen;\n}\n\nexport function estimate(elen, e) {\n let Q = e[0];\n for (let i = 1; i < elen; i++) Q += e[i];\n return Q;\n}\n\nexport function vec(n) {\n return new Float64Array(n);\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum} from './util.js';\n\nconst ccwerrboundA = (3 + 16 * epsilon) * epsilon;\nconst ccwerrboundB = (2 + 12 * epsilon) * epsilon;\nconst ccwerrboundC = (9 + 64 * epsilon) * epsilon * epsilon;\n\nconst B = vec(4);\nconst C1 = vec(8);\nconst C2 = vec(12);\nconst D = vec(16);\nconst u = vec(4);\n\nfunction orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {\n let acxtail, acytail, bcxtail, bcytail;\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n const acx = ax - cx;\n const bcx = bx - cx;\n const acy = ay - cy;\n const bcy = by - cy;\n\n s1 = acx * bcy;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcx;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n B[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n B[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n B[2] = _j - (u3 - bvirt) + (_i - bvirt);\n B[3] = u3;\n\n let det = estimate(4, B);\n let errbound = ccwerrboundB * detsum;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - acx;\n acxtail = ax - (acx + bvirt) + (bvirt - cx);\n bvirt = bx - bcx;\n bcxtail = bx - (bcx + bvirt) + (bvirt - cx);\n bvirt = ay - acy;\n acytail = ay - (acy + bvirt) + (bvirt - cy);\n bvirt = by - bcy;\n bcytail = by - (bcy + bvirt) + (bvirt - cy);\n\n if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) {\n return det;\n }\n\n errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det);\n det += (acx * bcytail + bcy * acxtail) - (acy * bcxtail + bcx * acytail);\n if (det >= errbound || -det >= errbound) return det;\n\n s1 = acxtail * bcy;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcx;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const C1len = sum(4, B, 4, u, C1);\n\n s1 = acx * bcytail;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcxtail;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const C2len = sum(C1len, C1, 4, u, C2);\n\n s1 = acxtail * bcytail;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcxtail;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const Dlen = sum(C2len, C2, 4, u, D);\n\n return D[Dlen - 1];\n}\n\nexport function orient2d(ax, ay, bx, by, cx, cy) {\n const detleft = (ay - cy) * (bx - cx);\n const detright = (ax - cx) * (by - cy);\n const det = detleft - detright;\n\n if (detleft === 0 || detright === 0 || (detleft > 0) !== (detright > 0)) return det;\n\n const detsum = Math.abs(detleft + detright);\n if (Math.abs(det) >= ccwerrboundA * detsum) return det;\n\n return -orient2dadapt(ax, ay, bx, by, cx, cy, detsum);\n}\n\nexport function orient2dfast(ax, ay, bx, by, cx, cy) {\n return (ay - cy) * (bx - cx) - (ax - cx) * (by - cy);\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum, scale} from './util.js';\n\nconst o3derrboundA = (7 + 56 * epsilon) * epsilon;\nconst o3derrboundB = (3 + 28 * epsilon) * epsilon;\nconst o3derrboundC = (26 + 288 * epsilon) * epsilon * epsilon;\n\nconst bc = vec(4);\nconst ca = vec(4);\nconst ab = vec(4);\nconst at_b = vec(4);\nconst at_c = vec(4);\nconst bt_c = vec(4);\nconst bt_a = vec(4);\nconst ct_a = vec(4);\nconst ct_b = vec(4);\nconst bct = vec(8);\nconst cat = vec(8);\nconst abt = vec(8);\nconst u = vec(4);\n\nconst _8 = vec(8);\nconst _8b = vec(8);\nconst _16 = vec(8);\nconst _12 = vec(12);\n\nlet fin = vec(192);\nlet fin2 = vec(192);\n\nfunction finadd(finlen, alen, a) {\n finlen = sum(finlen, fin, alen, a, fin2);\n const tmp = fin; fin = fin2; fin2 = tmp;\n return finlen;\n}\n\nfunction tailinit(xtail, ytail, ax, ay, bx, by, a, b) {\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _k, _0, s1, s0, t1, t0, u3, negate;\n if (xtail === 0) {\n if (ytail === 0) {\n a[0] = 0;\n b[0] = 0;\n return 1;\n } else {\n negate = -ytail;\n s1 = negate * ax;\n c = splitter * negate;\n ahi = c - (c - negate);\n alo = negate - ahi;\n c = splitter * ax;\n bhi = c - (c - ax);\n blo = ax - bhi;\n a[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n a[1] = s1;\n s1 = ytail * bx;\n c = splitter * ytail;\n ahi = c - (c - ytail);\n alo = ytail - ahi;\n c = splitter * bx;\n bhi = c - (c - bx);\n blo = bx - bhi;\n b[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n b[1] = s1;\n return 2;\n }\n } else {\n if (ytail === 0) {\n s1 = xtail * ay;\n c = splitter * xtail;\n ahi = c - (c - xtail);\n alo = xtail - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n a[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n a[1] = s1;\n negate = -xtail;\n s1 = negate * by;\n c = splitter * negate;\n ahi = c - (c - negate);\n alo = negate - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n b[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n b[1] = s1;\n return 2;\n } else {\n s1 = xtail * ay;\n c = splitter * xtail;\n ahi = c - (c - xtail);\n alo = xtail - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ytail * ax;\n c = splitter * ytail;\n ahi = c - (c - ytail);\n alo = ytail - ahi;\n c = splitter * ax;\n bhi = c - (c - ax);\n blo = ax - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n a[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n a[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n a[2] = _j - (u3 - bvirt) + (_i - bvirt);\n a[3] = u3;\n s1 = ytail * bx;\n c = splitter * ytail;\n ahi = c - (c - ytail);\n alo = ytail - ahi;\n c = splitter * bx;\n bhi = c - (c - bx);\n blo = bx - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = xtail * by;\n c = splitter * xtail;\n ahi = c - (c - xtail);\n alo = xtail - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n b[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n b[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n b[2] = _j - (u3 - bvirt) + (_i - bvirt);\n b[3] = u3;\n return 4;\n }\n }\n}\n\nfunction tailadd(finlen, a, b, k, z) {\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _k, _0, s1, s0, u3;\n s1 = a * b;\n c = splitter * a;\n ahi = c - (c - a);\n alo = a - ahi;\n c = splitter * b;\n bhi = c - (c - b);\n blo = b - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n c = splitter * k;\n bhi = c - (c - k);\n blo = k - bhi;\n _i = s0 * k;\n c = splitter * s0;\n ahi = c - (c - s0);\n alo = s0 - ahi;\n u[0] = alo * blo - (_i - ahi * bhi - alo * bhi - ahi * blo);\n _j = s1 * k;\n c = splitter * s1;\n ahi = c - (c - s1);\n alo = s1 - ahi;\n _0 = alo * blo - (_j - ahi * bhi - alo * bhi - ahi * blo);\n _k = _i + _0;\n bvirt = _k - _i;\n u[1] = _i - (_k - bvirt) + (_0 - bvirt);\n u3 = _j + _k;\n u[2] = _k - (u3 - _j);\n u[3] = u3;\n finlen = finadd(finlen, 4, u);\n if (z !== 0) {\n c = splitter * z;\n bhi = c - (c - z);\n blo = z - bhi;\n _i = s0 * z;\n c = splitter * s0;\n ahi = c - (c - s0);\n alo = s0 - ahi;\n u[0] = alo * blo - (_i - ahi * bhi - alo * bhi - ahi * blo);\n _j = s1 * z;\n c = splitter * s1;\n ahi = c - (c - s1);\n alo = s1 - ahi;\n _0 = alo * blo - (_j - ahi * bhi - alo * bhi - ahi * blo);\n _k = _i + _0;\n bvirt = _k - _i;\n u[1] = _i - (_k - bvirt) + (_0 - bvirt);\n u3 = _j + _k;\n u[2] = _k - (u3 - _j);\n u[3] = u3;\n finlen = finadd(finlen, 4, u);\n }\n return finlen;\n}\n\nfunction orient3dadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, permanent) {\n let finlen;\n let adxtail, bdxtail, cdxtail;\n let adytail, bdytail, cdytail;\n let adztail, bdztail, cdztail;\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _k, _0, s1, s0, t1, t0, u3;\n\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n const adz = az - dz;\n const bdz = bz - dz;\n const cdz = cz - dz;\n\n s1 = bdx * cdy;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdx * bdy;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bc[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bc[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bc[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bc[3] = u3;\n s1 = cdx * ady;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adx * cdy;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ca[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ca[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ca[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ca[3] = u3;\n s1 = adx * bdy;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdx * ady;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ab[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ab[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ab[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ab[3] = u3;\n\n finlen = sum(\n sum(\n scale(4, bc, adz, _8), _8,\n scale(4, ca, bdz, _8b), _8b, _16), _16,\n scale(4, ab, cdz, _8), _8, fin);\n\n let det = estimate(finlen, fin);\n let errbound = o3derrboundB * permanent;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - adx;\n adxtail = ax - (adx + bvirt) + (bvirt - dx);\n bvirt = bx - bdx;\n bdxtail = bx - (bdx + bvirt) + (bvirt - dx);\n bvirt = cx - cdx;\n cdxtail = cx - (cdx + bvirt) + (bvirt - dx);\n bvirt = ay - ady;\n adytail = ay - (ady + bvirt) + (bvirt - dy);\n bvirt = by - bdy;\n bdytail = by - (bdy + bvirt) + (bvirt - dy);\n bvirt = cy - cdy;\n cdytail = cy - (cdy + bvirt) + (bvirt - dy);\n bvirt = az - adz;\n adztail = az - (adz + bvirt) + (bvirt - dz);\n bvirt = bz - bdz;\n bdztail = bz - (bdz + bvirt) + (bvirt - dz);\n bvirt = cz - cdz;\n cdztail = cz - (cdz + bvirt) + (bvirt - dz);\n\n if (adxtail === 0 && bdxtail === 0 && cdxtail === 0 &&\n adytail === 0 && bdytail === 0 && cdytail === 0 &&\n adztail === 0 && bdztail === 0 && cdztail === 0) {\n return det;\n }\n\n errbound = o3derrboundC * permanent + resulterrbound * Math.abs(det);\n det +=\n adz * (bdx * cdytail + cdy * bdxtail - (bdy * cdxtail + cdx * bdytail)) + adztail * (bdx * cdy - bdy * cdx) +\n bdz * (cdx * adytail + ady * cdxtail - (cdy * adxtail + adx * cdytail)) + bdztail * (cdx * ady - cdy * adx) +\n cdz * (adx * bdytail + bdy * adxtail - (ady * bdxtail + bdx * adytail)) + cdztail * (adx * bdy - ady * bdx);\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n const at_len = tailinit(adxtail, adytail, bdx, bdy, cdx, cdy, at_b, at_c);\n const bt_len = tailinit(bdxtail, bdytail, cdx, cdy, adx, ady, bt_c, bt_a);\n const ct_len = tailinit(cdxtail, cdytail, adx, ady, bdx, bdy, ct_a, ct_b);\n\n const bctlen = sum(bt_len, bt_c, ct_len, ct_b, bct);\n finlen = finadd(finlen, scale(bctlen, bct, adz, _16), _16);\n\n const catlen = sum(ct_len, ct_a, at_len, at_c, cat);\n finlen = finadd(finlen, scale(catlen, cat, bdz, _16), _16);\n\n const abtlen = sum(at_len, at_b, bt_len, bt_a, abt);\n finlen = finadd(finlen, scale(abtlen, abt, cdz, _16), _16);\n\n if (adztail !== 0) {\n finlen = finadd(finlen, scale(4, bc, adztail, _12), _12);\n finlen = finadd(finlen, scale(bctlen, bct, adztail, _16), _16);\n }\n if (bdztail !== 0) {\n finlen = finadd(finlen, scale(4, ca, bdztail, _12), _12);\n finlen = finadd(finlen, scale(catlen, cat, bdztail, _16), _16);\n }\n if (cdztail !== 0) {\n finlen = finadd(finlen, scale(4, ab, cdztail, _12), _12);\n finlen = finadd(finlen, scale(abtlen, abt, cdztail, _16), _16);\n }\n\n if (adxtail !== 0) {\n if (bdytail !== 0) {\n finlen = tailadd(finlen, adxtail, bdytail, cdz, cdztail);\n }\n if (cdytail !== 0) {\n finlen = tailadd(finlen, -adxtail, cdytail, bdz, bdztail);\n }\n }\n if (bdxtail !== 0) {\n if (cdytail !== 0) {\n finlen = tailadd(finlen, bdxtail, cdytail, adz, adztail);\n }\n if (adytail !== 0) {\n finlen = tailadd(finlen, -bdxtail, adytail, cdz, cdztail);\n }\n }\n if (cdxtail !== 0) {\n if (adytail !== 0) {\n finlen = tailadd(finlen, cdxtail, adytail, bdz, bdztail);\n }\n if (bdytail !== 0) {\n finlen = tailadd(finlen, -cdxtail, bdytail, adz, adztail);\n }\n }\n\n return fin[finlen - 1];\n}\n\nexport function orient3d(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz) {\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n const adz = az - dz;\n const bdz = bz - dz;\n const cdz = cz - dz;\n\n const bdxcdy = bdx * cdy;\n const cdxbdy = cdx * bdy;\n\n const cdxady = cdx * ady;\n const adxcdy = adx * cdy;\n\n const adxbdy = adx * bdy;\n const bdxady = bdx * ady;\n\n const det =\n adz * (bdxcdy - cdxbdy) +\n bdz * (cdxady - adxcdy) +\n cdz * (adxbdy - bdxady);\n\n const permanent =\n (Math.abs(bdxcdy) + Math.abs(cdxbdy)) * Math.abs(adz) +\n (Math.abs(cdxady) + Math.abs(adxcdy)) * Math.abs(bdz) +\n (Math.abs(adxbdy) + Math.abs(bdxady)) * Math.abs(cdz);\n\n const errbound = o3derrboundA * permanent;\n if (det > errbound || -det > errbound) {\n return det;\n }\n\n return orient3dadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, permanent);\n}\n\nexport function orient3dfast(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz) {\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n const adz = az - dz;\n const bdz = bz - dz;\n const cdz = cz - dz;\n\n return adx * (bdy * cdz - bdz * cdy) +\n bdx * (cdy * adz - cdz * ady) +\n cdx * (ady * bdz - adz * bdy);\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum, sum_three, scale} from './util.js';\n\nconst iccerrboundA = (10 + 96 * epsilon) * epsilon;\nconst iccerrboundB = (4 + 48 * epsilon) * epsilon;\nconst iccerrboundC = (44 + 576 * epsilon) * epsilon * epsilon;\n\nconst bc = vec(4);\nconst ca = vec(4);\nconst ab = vec(4);\nconst aa = vec(4);\nconst bb = vec(4);\nconst cc = vec(4);\nconst u = vec(4);\nconst v = vec(4);\nconst axtbc = vec(8);\nconst aytbc = vec(8);\nconst bxtca = vec(8);\nconst bytca = vec(8);\nconst cxtab = vec(8);\nconst cytab = vec(8);\nconst abt = vec(8);\nconst bct = vec(8);\nconst cat = vec(8);\nconst abtt = vec(4);\nconst bctt = vec(4);\nconst catt = vec(4);\n\nconst _8 = vec(8);\nconst _16 = vec(16);\nconst _16b = vec(16);\nconst _16c = vec(16);\nconst _32 = vec(32);\nconst _32b = vec(32);\nconst _48 = vec(48);\nconst _64 = vec(64);\n\nlet fin = vec(1152);\nlet fin2 = vec(1152);\n\nfunction finadd(finlen, a, alen) {\n finlen = sum(finlen, fin, a, alen, fin2);\n const tmp = fin; fin = fin2; fin2 = tmp;\n return finlen;\n}\n\nfunction incircleadapt(ax, ay, bx, by, cx, cy, dx, dy, permanent) {\n let finlen;\n let adxtail, bdxtail, cdxtail, adytail, bdytail, cdytail;\n let axtbclen, aytbclen, bxtcalen, bytcalen, cxtablen, cytablen;\n let abtlen, bctlen, catlen;\n let abttlen, bcttlen, cattlen;\n let n1, n0;\n\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n\n s1 = bdx * cdy;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdx * bdy;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bc[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bc[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bc[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bc[3] = u3;\n s1 = cdx * ady;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adx * cdy;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ca[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ca[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ca[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ca[3] = u3;\n s1 = adx * bdy;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdx * ady;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ab[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ab[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ab[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ab[3] = u3;\n\n finlen = sum(\n sum(\n sum(\n scale(scale(4, bc, adx, _8), _8, adx, _16), _16,\n scale(scale(4, bc, ady, _8), _8, ady, _16b), _16b, _32), _32,\n sum(\n scale(scale(4, ca, bdx, _8), _8, bdx, _16), _16,\n scale(scale(4, ca, bdy, _8), _8, bdy, _16b), _16b, _32b), _32b, _64), _64,\n sum(\n scale(scale(4, ab, cdx, _8), _8, cdx, _16), _16,\n scale(scale(4, ab, cdy, _8), _8, cdy, _16b), _16b, _32), _32, fin);\n\n let det = estimate(finlen, fin);\n let errbound = iccerrboundB * permanent;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - adx;\n adxtail = ax - (adx + bvirt) + (bvirt - dx);\n bvirt = ay - ady;\n adytail = ay - (ady + bvirt) + (bvirt - dy);\n bvirt = bx - bdx;\n bdxtail = bx - (bdx + bvirt) + (bvirt - dx);\n bvirt = by - bdy;\n bdytail = by - (bdy + bvirt) + (bvirt - dy);\n bvirt = cx - cdx;\n cdxtail = cx - (cdx + bvirt) + (bvirt - dx);\n bvirt = cy - cdy;\n cdytail = cy - (cdy + bvirt) + (bvirt - dy);\n if (adxtail === 0 && bdxtail === 0 && cdxtail === 0 && adytail === 0 && bdytail === 0 && cdytail === 0) {\n return det;\n }\n\n errbound = iccerrboundC * permanent + resulterrbound * Math.abs(det);\n det += ((adx * adx + ady * ady) * ((bdx * cdytail + cdy * bdxtail) - (bdy * cdxtail + cdx * bdytail)) +\n 2 * (adx * adxtail + ady * adytail) * (bdx * cdy - bdy * cdx)) +\n ((bdx * bdx + bdy * bdy) * ((cdx * adytail + ady * cdxtail) - (cdy * adxtail + adx * cdytail)) +\n 2 * (bdx * bdxtail + bdy * bdytail) * (cdx * ady - cdy * adx)) +\n ((cdx * cdx + cdy * cdy) * ((adx * bdytail + bdy * adxtail) - (ady * bdxtail + bdx * adytail)) +\n 2 * (cdx * cdxtail + cdy * cdytail) * (adx * bdy - ady * bdx));\n\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n if (bdxtail !== 0 || bdytail !== 0 || cdxtail !== 0 || cdytail !== 0) {\n s1 = adx * adx;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n s0 = alo * alo - (s1 - ahi * ahi - (ahi + ahi) * alo);\n t1 = ady * ady;\n c = splitter * ady;\n ahi = c - (c - ady);\n alo = ady - ahi;\n t0 = alo * alo - (t1 - ahi * ahi - (ahi + ahi) * alo);\n _i = s0 + t0;\n bvirt = _i - s0;\n aa[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n aa[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n aa[2] = _j - (u3 - bvirt) + (_i - bvirt);\n aa[3] = u3;\n }\n if (cdxtail !== 0 || cdytail !== 0 || adxtail !== 0 || adytail !== 0) {\n s1 = bdx * bdx;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n s0 = alo * alo - (s1 - ahi * ahi - (ahi + ahi) * alo);\n t1 = bdy * bdy;\n c = splitter * bdy;\n ahi = c - (c - bdy);\n alo = bdy - ahi;\n t0 = alo * alo - (t1 - ahi * ahi - (ahi + ahi) * alo);\n _i = s0 + t0;\n bvirt = _i - s0;\n bb[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n bb[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bb[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bb[3] = u3;\n }\n if (adxtail !== 0 || adytail !== 0 || bdxtail !== 0 || bdytail !== 0) {\n s1 = cdx * cdx;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n s0 = alo * alo - (s1 - ahi * ahi - (ahi + ahi) * alo);\n t1 = cdy * cdy;\n c = splitter * cdy;\n ahi = c - (c - cdy);\n alo = cdy - ahi;\n t0 = alo * alo - (t1 - ahi * ahi - (ahi + ahi) * alo);\n _i = s0 + t0;\n bvirt = _i - s0;\n cc[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n cc[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n cc[2] = _j - (u3 - bvirt) + (_i - bvirt);\n cc[3] = u3;\n }\n\n if (adxtail !== 0) {\n axtbclen = scale(4, bc, adxtail, axtbc);\n finlen = finadd(finlen, sum_three(\n scale(axtbclen, axtbc, 2 * adx, _16), _16,\n scale(scale(4, cc, adxtail, _8), _8, bdy, _16b), _16b,\n scale(scale(4, bb, adxtail, _8), _8, -cdy, _16c), _16c, _32, _48), _48);\n }\n if (adytail !== 0) {\n aytbclen = scale(4, bc, adytail, aytbc);\n finlen = finadd(finlen, sum_three(\n scale(aytbclen, aytbc, 2 * ady, _16), _16,\n scale(scale(4, bb, adytail, _8), _8, cdx, _16b), _16b,\n scale(scale(4, cc, adytail, _8), _8, -bdx, _16c), _16c, _32, _48), _48);\n }\n if (bdxtail !== 0) {\n bxtcalen = scale(4, ca, bdxtail, bxtca);\n finlen = finadd(finlen, sum_three(\n scale(bxtcalen, bxtca, 2 * bdx, _16), _16,\n scale(scale(4, aa, bdxtail, _8), _8, cdy, _16b), _16b,\n scale(scale(4, cc, bdxtail, _8), _8, -ady, _16c), _16c, _32, _48), _48);\n }\n if (bdytail !== 0) {\n bytcalen = scale(4, ca, bdytail, bytca);\n finlen = finadd(finlen, sum_three(\n scale(bytcalen, bytca, 2 * bdy, _16), _16,\n scale(scale(4, cc, bdytail, _8), _8, adx, _16b), _16b,\n scale(scale(4, aa, bdytail, _8), _8, -cdx, _16c), _16c, _32, _48), _48);\n }\n if (cdxtail !== 0) {\n cxtablen = scale(4, ab, cdxtail, cxtab);\n finlen = finadd(finlen, sum_three(\n scale(cxtablen, cxtab, 2 * cdx, _16), _16,\n scale(scale(4, bb, cdxtail, _8), _8, ady, _16b), _16b,\n scale(scale(4, aa, cdxtail, _8), _8, -bdy, _16c), _16c, _32, _48), _48);\n }\n if (cdytail !== 0) {\n cytablen = scale(4, ab, cdytail, cytab);\n finlen = finadd(finlen, sum_three(\n scale(cytablen, cytab, 2 * cdy, _16), _16,\n scale(scale(4, aa, cdytail, _8), _8, bdx, _16b), _16b,\n scale(scale(4, bb, cdytail, _8), _8, -adx, _16c), _16c, _32, _48), _48);\n }\n\n if (adxtail !== 0 || adytail !== 0) {\n if (bdxtail !== 0 || bdytail !== 0 || cdxtail !== 0 || cdytail !== 0) {\n s1 = bdxtail * cdy;\n c = splitter * bdxtail;\n ahi = c - (c - bdxtail);\n alo = bdxtail - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdx * cdytail;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * cdytail;\n bhi = c - (c - cdytail);\n blo = cdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n u[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n u[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n s1 = cdxtail * -bdy;\n c = splitter * cdxtail;\n ahi = c - (c - cdxtail);\n alo = cdxtail - ahi;\n c = splitter * -bdy;\n bhi = c - (c - -bdy);\n blo = -bdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdx * -bdytail;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * -bdytail;\n bhi = c - (c - -bdytail);\n blo = -bdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n v[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n v[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n v[2] = _j - (u3 - bvirt) + (_i - bvirt);\n v[3] = u3;\n bctlen = sum(4, u, 4, v, bct);\n s1 = bdxtail * cdytail;\n c = splitter * bdxtail;\n ahi = c - (c - bdxtail);\n alo = bdxtail - ahi;\n c = splitter * cdytail;\n bhi = c - (c - cdytail);\n blo = cdytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdxtail * bdytail;\n c = splitter * cdxtail;\n ahi = c - (c - cdxtail);\n alo = cdxtail - ahi;\n c = splitter * bdytail;\n bhi = c - (c - bdytail);\n blo = bdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bctt[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bctt[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bctt[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bctt[3] = u3;\n bcttlen = 4;\n } else {\n bct[0] = 0;\n bctlen = 1;\n bctt[0] = 0;\n bcttlen = 1;\n }\n if (adxtail !== 0) {\n const len = scale(bctlen, bct, adxtail, _16c);\n finlen = finadd(finlen, sum(\n scale(axtbclen, axtbc, adxtail, _16), _16,\n scale(len, _16c, 2 * adx, _32), _32, _48), _48);\n\n const len2 = scale(bcttlen, bctt, adxtail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * adx, _16), _16,\n scale(len2, _8, adxtail, _16b), _16b,\n scale(len, _16c, adxtail, _32), _32, _32b, _64), _64);\n\n if (bdytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, cc, adxtail, _8), _8, bdytail, _16), _16);\n }\n if (cdytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, bb, -adxtail, _8), _8, cdytail, _16), _16);\n }\n }\n if (adytail !== 0) {\n const len = scale(bctlen, bct, adytail, _16c);\n finlen = finadd(finlen, sum(\n scale(aytbclen, aytbc, adytail, _16), _16,\n scale(len, _16c, 2 * ady, _32), _32, _48), _48);\n\n const len2 = scale(bcttlen, bctt, adytail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * ady, _16), _16,\n scale(len2, _8, adytail, _16b), _16b,\n scale(len, _16c, adytail, _32), _32, _32b, _64), _64);\n }\n }\n if (bdxtail !== 0 || bdytail !== 0) {\n if (cdxtail !== 0 || cdytail !== 0 || adxtail !== 0 || adytail !== 0) {\n s1 = cdxtail * ady;\n c = splitter * cdxtail;\n ahi = c - (c - cdxtail);\n alo = cdxtail - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdx * adytail;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * adytail;\n bhi = c - (c - adytail);\n blo = adytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n u[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n u[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n n1 = -cdy;\n n0 = -cdytail;\n s1 = adxtail * n1;\n c = splitter * adxtail;\n ahi = c - (c - adxtail);\n alo = adxtail - ahi;\n c = splitter * n1;\n bhi = c - (c - n1);\n blo = n1 - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adx * n0;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * n0;\n bhi = c - (c - n0);\n blo = n0 - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n v[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n v[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n v[2] = _j - (u3 - bvirt) + (_i - bvirt);\n v[3] = u3;\n catlen = sum(4, u, 4, v, cat);\n s1 = cdxtail * adytail;\n c = splitter * cdxtail;\n ahi = c - (c - cdxtail);\n alo = cdxtail - ahi;\n c = splitter * adytail;\n bhi = c - (c - adytail);\n blo = adytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adxtail * cdytail;\n c = splitter * adxtail;\n ahi = c - (c - adxtail);\n alo = adxtail - ahi;\n c = splitter * cdytail;\n bhi = c - (c - cdytail);\n blo = cdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n catt[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n catt[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n catt[2] = _j - (u3 - bvirt) + (_i - bvirt);\n catt[3] = u3;\n cattlen = 4;\n } else {\n cat[0] = 0;\n catlen = 1;\n catt[0] = 0;\n cattlen = 1;\n }\n if (bdxtail !== 0) {\n const len = scale(catlen, cat, bdxtail, _16c);\n finlen = finadd(finlen, sum(\n scale(bxtcalen, bxtca, bdxtail, _16), _16,\n scale(len, _16c, 2 * bdx, _32), _32, _48), _48);\n\n const len2 = scale(cattlen, catt, bdxtail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * bdx, _16), _16,\n scale(len2, _8, bdxtail, _16b), _16b,\n scale(len, _16c, bdxtail, _32), _32, _32b, _64), _64);\n\n if (cdytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, aa, bdxtail, _8), _8, cdytail, _16), _16);\n }\n if (adytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, cc, -bdxtail, _8), _8, adytail, _16), _16);\n }\n }\n if (bdytail !== 0) {\n const len = scale(catlen, cat, bdytail, _16c);\n finlen = finadd(finlen, sum(\n scale(bytcalen, bytca, bdytail, _16), _16,\n scale(len, _16c, 2 * bdy, _32), _32, _48), _48);\n\n const len2 = scale(cattlen, catt, bdytail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * bdy, _16), _16,\n scale(len2, _8, bdytail, _16b), _16b,\n scale(len, _16c, bdytail, _32), _32, _32b, _64), _64);\n }\n }\n if (cdxtail !== 0 || cdytail !== 0) {\n if (adxtail !== 0 || adytail !== 0 || bdxtail !== 0 || bdytail !== 0) {\n s1 = adxtail * bdy;\n c = splitter * adxtail;\n ahi = c - (c - adxtail);\n alo = adxtail - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adx * bdytail;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * bdytail;\n bhi = c - (c - bdytail);\n blo = bdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n u[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n u[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n n1 = -ady;\n n0 = -adytail;\n s1 = bdxtail * n1;\n c = splitter * bdxtail;\n ahi = c - (c - bdxtail);\n alo = bdxtail - ahi;\n c = splitter * n1;\n bhi = c - (c - n1);\n blo = n1 - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdx * n0;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * n0;\n bhi = c - (c - n0);\n blo = n0 - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n v[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n v[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n v[2] = _j - (u3 - bvirt) + (_i - bvirt);\n v[3] = u3;\n abtlen = sum(4, u, 4, v, abt);\n s1 = adxtail * bdytail;\n c = splitter * adxtail;\n ahi = c - (c - adxtail);\n alo = adxtail - ahi;\n c = splitter * bdytail;\n bhi = c - (c - bdytail);\n blo = bdytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdxtail * adytail;\n c = splitter * bdxtail;\n ahi = c - (c - bdxtail);\n alo = bdxtail - ahi;\n c = splitter * adytail;\n bhi = c - (c - adytail);\n blo = adytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n abtt[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n abtt[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n abtt[2] = _j - (u3 - bvirt) + (_i - bvirt);\n abtt[3] = u3;\n abttlen = 4;\n } else {\n abt[0] = 0;\n abtlen = 1;\n abtt[0] = 0;\n abttlen = 1;\n }\n if (cdxtail !== 0) {\n const len = scale(abtlen, abt, cdxtail, _16c);\n finlen = finadd(finlen, sum(\n scale(cxtablen, cxtab, cdxtail, _16), _16,\n scale(len, _16c, 2 * cdx, _32), _32, _48), _48);\n\n const len2 = scale(abttlen, abtt, cdxtail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * cdx, _16), _16,\n scale(len2, _8, cdxtail, _16b), _16b,\n scale(len, _16c, cdxtail, _32), _32, _32b, _64), _64);\n\n if (adytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, bb, cdxtail, _8), _8, adytail, _16), _16);\n }\n if (bdytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, aa, -cdxtail, _8), _8, bdytail, _16), _16);\n }\n }\n if (cdytail !== 0) {\n const len = scale(abtlen, abt, cdytail, _16c);\n finlen = finadd(finlen, sum(\n scale(cytablen, cytab, cdytail, _16), _16,\n scale(len, _16c, 2 * cdy, _32), _32, _48), _48);\n\n const len2 = scale(abttlen, abtt, cdytail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * cdy, _16), _16,\n scale(len2, _8, cdytail, _16b), _16b,\n scale(len, _16c, cdytail, _32), _32, _32b, _64), _64);\n }\n }\n\n return fin[finlen - 1];\n}\n\nexport function incircle(ax, ay, bx, by, cx, cy, dx, dy) {\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n\n const bdxcdy = bdx * cdy;\n const cdxbdy = cdx * bdy;\n const alift = adx * adx + ady * ady;\n\n const cdxady = cdx * ady;\n const adxcdy = adx * cdy;\n const blift = bdx * bdx + bdy * bdy;\n\n const adxbdy = adx * bdy;\n const bdxady = bdx * ady;\n const clift = cdx * cdx + cdy * cdy;\n\n const det =\n alift * (bdxcdy - cdxbdy) +\n blift * (cdxady - adxcdy) +\n clift * (adxbdy - bdxady);\n\n const permanent =\n (Math.abs(bdxcdy) + Math.abs(cdxbdy)) * alift +\n (Math.abs(cdxady) + Math.abs(adxcdy)) * blift +\n (Math.abs(adxbdy) + Math.abs(bdxady)) * clift;\n\n const errbound = iccerrboundA * permanent;\n\n if (det > errbound || -det > errbound) {\n return det;\n }\n return incircleadapt(ax, ay, bx, by, cx, cy, dx, dy, permanent);\n}\n\nexport function incirclefast(ax, ay, bx, by, cx, cy, dx, dy) {\n const adx = ax - dx;\n const ady = ay - dy;\n const bdx = bx - dx;\n const bdy = by - dy;\n const cdx = cx - dx;\n const cdy = cy - dy;\n\n const abdet = adx * bdy - bdx * ady;\n const bcdet = bdx * cdy - cdx * bdy;\n const cadet = cdx * ady - adx * cdy;\n const alift = adx * adx + ady * ady;\n const blift = bdx * bdx + bdy * bdy;\n const clift = cdx * cdx + cdy * cdy;\n\n return alift * bcdet + blift * cadet + clift * abdet;\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum, sum_three, scale, negate} from './util.js';\n\nconst isperrboundA = (16 + 224 * epsilon) * epsilon;\nconst isperrboundB = (5 + 72 * epsilon) * epsilon;\nconst isperrboundC = (71 + 1408 * epsilon) * epsilon * epsilon;\n\nconst ab = vec(4);\nconst bc = vec(4);\nconst cd = vec(4);\nconst de = vec(4);\nconst ea = vec(4);\nconst ac = vec(4);\nconst bd = vec(4);\nconst ce = vec(4);\nconst da = vec(4);\nconst eb = vec(4);\n\nconst abc = vec(24);\nconst bcd = vec(24);\nconst cde = vec(24);\nconst dea = vec(24);\nconst eab = vec(24);\nconst abd = vec(24);\nconst bce = vec(24);\nconst cda = vec(24);\nconst deb = vec(24);\nconst eac = vec(24);\n\nconst adet = vec(1152);\nconst bdet = vec(1152);\nconst cdet = vec(1152);\nconst ddet = vec(1152);\nconst edet = vec(1152);\nconst abdet = vec(2304);\nconst cddet = vec(2304);\nconst cdedet = vec(3456);\nconst deter = vec(5760);\n\nconst _8 = vec(8);\nconst _8b = vec(8);\nconst _8c = vec(8);\nconst _16 = vec(16);\nconst _24 = vec(24);\nconst _48 = vec(48);\nconst _48b = vec(48);\nconst _96 = vec(96);\nconst _192 = vec(192);\nconst _384x = vec(384);\nconst _384y = vec(384);\nconst _384z = vec(384);\nconst _768 = vec(768);\n\nfunction sum_three_scale(a, b, c, az, bz, cz, out) {\n return sum_three(\n scale(4, a, az, _8), _8,\n scale(4, b, bz, _8b), _8b,\n scale(4, c, cz, _8c), _8c, _16, out);\n}\n\nfunction liftexact(alen, a, blen, b, clen, c, dlen, d, x, y, z, out) {\n const len = sum(\n sum(alen, a, blen, b, _48), _48,\n negate(sum(clen, c, dlen, d, _48b), _48b), _48b, _96);\n\n return sum_three(\n scale(scale(len, _96, x, _192), _192, x, _384x), _384x,\n scale(scale(len, _96, y, _192), _192, y, _384y), _384y,\n scale(scale(len, _96, z, _192), _192, z, _384z), _384z, _768, out);\n}\n\nfunction insphereexact(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez) {\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n s1 = ax * by;\n c = splitter * ax;\n ahi = c - (c - ax);\n alo = ax - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bx * ay;\n c = splitter * bx;\n ahi = c - (c - bx);\n alo = bx - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ab[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ab[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ab[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ab[3] = u3;\n s1 = bx * cy;\n c = splitter * bx;\n ahi = c - (c - bx);\n alo = bx - ahi;\n c = splitter * cy;\n bhi = c - (c - cy);\n blo = cy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cx * by;\n c = splitter * cx;\n ahi = c - (c - cx);\n alo = cx - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bc[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bc[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bc[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bc[3] = u3;\n s1 = cx * dy;\n c = splitter * cx;\n ahi = c - (c - cx);\n alo = cx - ahi;\n c = splitter * dy;\n bhi = c - (c - dy);\n blo = dy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = dx * cy;\n c = splitter * dx;\n ahi = c - (c - dx);\n alo = dx - ahi;\n c = splitter * cy;\n bhi = c - (c - cy);\n blo = cy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n cd[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n cd[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n cd[2] = _j - (u3 - bvirt) + (_i - bvirt);\n cd[3] = u3;\n s1 = dx * ey;\n c = splitter * dx;\n ahi = c - (c - dx);\n alo = dx - ahi;\n c = splitter * ey;\n bhi = c - (c - ey);\n blo = ey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ex * dy;\n c = splitter * ex;\n ahi = c - (c - ex);\n alo = ex - ahi;\n c = splitter * dy;\n bhi = c - (c - dy);\n blo = dy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n de[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n de[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n de[2] = _j - (u3 - bvirt) + (_i - bvirt);\n de[3] = u3;\n s1 = ex * ay;\n c = splitter * ex;\n ahi = c - (c - ex);\n alo = ex - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ax * ey;\n c = splitter * ax;\n ahi = c - (c - ax);\n alo = ax - ahi;\n c = splitter * ey;\n bhi = c - (c - ey);\n blo = ey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ea[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ea[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ea[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ea[3] = u3;\n s1 = ax * cy;\n c = splitter * ax;\n ahi = c - (c - ax);\n alo = ax - ahi;\n c = splitter * cy;\n bhi = c - (c - cy);\n blo = cy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cx * ay;\n c = splitter * cx;\n ahi = c - (c - cx);\n alo = cx - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ac[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ac[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ac[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ac[3] = u3;\n s1 = bx * dy;\n c = splitter * bx;\n ahi = c - (c - bx);\n alo = bx - ahi;\n c = splitter * dy;\n bhi = c - (c - dy);\n blo = dy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = dx * by;\n c = splitter * dx;\n ahi = c - (c - dx);\n alo = dx - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bd[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bd[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bd[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bd[3] = u3;\n s1 = cx * ey;\n c = splitter * cx;\n ahi = c - (c - cx);\n alo = cx - ahi;\n c = splitter * ey;\n bhi = c - (c - ey);\n blo = ey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ex * cy;\n c = splitter * ex;\n ahi = c - (c - ex);\n alo = ex - ahi;\n c = splitter * cy;\n bhi = c - (c - cy);\n blo = cy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ce[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ce[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ce[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ce[3] = u3;\n s1 = dx * ay;\n c = splitter * dx;\n ahi = c - (c - dx);\n alo = dx - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ax * dy;\n c = splitter * ax;\n ahi = c - (c - ax);\n alo = ax - ahi;\n c = splitter * dy;\n bhi = c - (c - dy);\n blo = dy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n da[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n da[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n da[2] = _j - (u3 - bvirt) + (_i - bvirt);\n da[3] = u3;\n s1 = ex * by;\n c = splitter * ex;\n ahi = c - (c - ex);\n alo = ex - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bx * ey;\n c = splitter * bx;\n ahi = c - (c - bx);\n alo = bx - ahi;\n c = splitter * ey;\n bhi = c - (c - ey);\n blo = ey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n eb[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n eb[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n eb[2] = _j - (u3 - bvirt) + (_i - bvirt);\n eb[3] = u3;\n\n const abclen = sum_three_scale(ab, bc, ac, cz, az, -bz, abc);\n const bcdlen = sum_three_scale(bc, cd, bd, dz, bz, -cz, bcd);\n const cdelen = sum_three_scale(cd, de, ce, ez, cz, -dz, cde);\n const dealen = sum_three_scale(de, ea, da, az, dz, -ez, dea);\n const eablen = sum_three_scale(ea, ab, eb, bz, ez, -az, eab);\n const abdlen = sum_three_scale(ab, bd, da, dz, az, bz, abd);\n const bcelen = sum_three_scale(bc, ce, eb, ez, bz, cz, bce);\n const cdalen = sum_three_scale(cd, da, ac, az, cz, dz, cda);\n const deblen = sum_three_scale(de, eb, bd, bz, dz, ez, deb);\n const eaclen = sum_three_scale(ea, ac, ce, cz, ez, az, eac);\n\n const deterlen = sum_three(\n liftexact(cdelen, cde, bcelen, bce, deblen, deb, bcdlen, bcd, ax, ay, az, adet), adet,\n liftexact(dealen, dea, cdalen, cda, eaclen, eac, cdelen, cde, bx, by, bz, bdet), bdet,\n sum_three(\n liftexact(eablen, eab, deblen, deb, abdlen, abd, dealen, dea, cx, cy, cz, cdet), cdet,\n liftexact(abclen, abc, eaclen, eac, bcelen, bce, eablen, eab, dx, dy, dz, ddet), ddet,\n liftexact(bcdlen, bcd, abdlen, abd, cdalen, cda, abclen, abc, ex, ey, ez, edet), edet, cddet, cdedet), cdedet, abdet, deter);\n\n return deter[deterlen - 1];\n}\n\nconst xdet = vec(96);\nconst ydet = vec(96);\nconst zdet = vec(96);\nconst fin = vec(1152);\n\nfunction liftadapt(a, b, c, az, bz, cz, x, y, z, out) {\n const len = sum_three_scale(a, b, c, az, bz, cz, _24);\n return sum_three(\n scale(scale(len, _24, x, _48), _48, x, xdet), xdet,\n scale(scale(len, _24, y, _48), _48, y, ydet), ydet,\n scale(scale(len, _24, z, _48), _48, z, zdet), zdet, _192, out);\n}\n\nfunction insphereadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez, permanent) {\n let ab3, bc3, cd3, da3, ac3, bd3;\n\n let aextail, bextail, cextail, dextail;\n let aeytail, beytail, ceytail, deytail;\n let aeztail, beztail, ceztail, deztail;\n\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0;\n\n const aex = ax - ex;\n const bex = bx - ex;\n const cex = cx - ex;\n const dex = dx - ex;\n const aey = ay - ey;\n const bey = by - ey;\n const cey = cy - ey;\n const dey = dy - ey;\n const aez = az - ez;\n const bez = bz - ez;\n const cez = cz - ez;\n const dez = dz - ez;\n\n s1 = aex * bey;\n c = splitter * aex;\n ahi = c - (c - aex);\n alo = aex - ahi;\n c = splitter * bey;\n bhi = c - (c - bey);\n blo = bey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bex * aey;\n c = splitter * bex;\n ahi = c - (c - bex);\n alo = bex - ahi;\n c = splitter * aey;\n bhi = c - (c - aey);\n blo = aey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ab[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ab[1] = _0 - (_i + bvirt) + (bvirt - t1);\n ab3 = _j + _i;\n bvirt = ab3 - _j;\n ab[2] = _j - (ab3 - bvirt) + (_i - bvirt);\n ab[3] = ab3;\n s1 = bex * cey;\n c = splitter * bex;\n ahi = c - (c - bex);\n alo = bex - ahi;\n c = splitter * cey;\n bhi = c - (c - cey);\n blo = cey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cex * bey;\n c = splitter * cex;\n ahi = c - (c - cex);\n alo = cex - ahi;\n c = splitter * bey;\n bhi = c - (c - bey);\n blo = bey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bc[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bc[1] = _0 - (_i + bvirt) + (bvirt - t1);\n bc3 = _j + _i;\n bvirt = bc3 - _j;\n bc[2] = _j - (bc3 - bvirt) + (_i - bvirt);\n bc[3] = bc3;\n s1 = cex * dey;\n c = splitter * cex;\n ahi = c - (c - cex);\n alo = cex - ahi;\n c = splitter * dey;\n bhi = c - (c - dey);\n blo = dey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = dex * cey;\n c = splitter * dex;\n ahi = c - (c - dex);\n alo = dex - ahi;\n c = splitter * cey;\n bhi = c - (c - cey);\n blo = cey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n cd[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n cd[1] = _0 - (_i + bvirt) + (bvirt - t1);\n cd3 = _j + _i;\n bvirt = cd3 - _j;\n cd[2] = _j - (cd3 - bvirt) + (_i - bvirt);\n cd[3] = cd3;\n s1 = dex * aey;\n c = splitter * dex;\n ahi = c - (c - dex);\n alo = dex - ahi;\n c = splitter * aey;\n bhi = c - (c - aey);\n blo = aey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = aex * dey;\n c = splitter * aex;\n ahi = c - (c - aex);\n alo = aex - ahi;\n c = splitter * dey;\n bhi = c - (c - dey);\n blo = dey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n da[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n da[1] = _0 - (_i + bvirt) + (bvirt - t1);\n da3 = _j + _i;\n bvirt = da3 - _j;\n da[2] = _j - (da3 - bvirt) + (_i - bvirt);\n da[3] = da3;\n s1 = aex * cey;\n c = splitter * aex;\n ahi = c - (c - aex);\n alo = aex - ahi;\n c = splitter * cey;\n bhi = c - (c - cey);\n blo = cey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cex * aey;\n c = splitter * cex;\n ahi = c - (c - cex);\n alo = cex - ahi;\n c = splitter * aey;\n bhi = c - (c - aey);\n blo = aey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ac[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ac[1] = _0 - (_i + bvirt) + (bvirt - t1);\n ac3 = _j + _i;\n bvirt = ac3 - _j;\n ac[2] = _j - (ac3 - bvirt) + (_i - bvirt);\n ac[3] = ac3;\n s1 = bex * dey;\n c = splitter * bex;\n ahi = c - (c - bex);\n alo = bex - ahi;\n c = splitter * dey;\n bhi = c - (c - dey);\n blo = dey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = dex * bey;\n c = splitter * dex;\n ahi = c - (c - dex);\n alo = dex - ahi;\n c = splitter * bey;\n bhi = c - (c - bey);\n blo = bey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bd[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bd[1] = _0 - (_i + bvirt) + (bvirt - t1);\n bd3 = _j + _i;\n bvirt = bd3 - _j;\n bd[2] = _j - (bd3 - bvirt) + (_i - bvirt);\n bd[3] = bd3;\n\n const finlen = sum(\n sum(\n negate(liftadapt(bc, cd, bd, dez, bez, -cez, aex, aey, aez, adet), adet), adet,\n liftadapt(cd, da, ac, aez, cez, dez, bex, bey, bez, bdet), bdet, abdet), abdet,\n sum(\n negate(liftadapt(da, ab, bd, bez, dez, aez, cex, cey, cez, cdet), cdet), cdet,\n liftadapt(ab, bc, ac, cez, aez, -bez, dex, dey, dez, ddet), ddet, cddet), cddet, fin);\n\n let det = estimate(finlen, fin);\n let errbound = isperrboundB * permanent;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - aex;\n aextail = ax - (aex + bvirt) + (bvirt - ex);\n bvirt = ay - aey;\n aeytail = ay - (aey + bvirt) + (bvirt - ey);\n bvirt = az - aez;\n aeztail = az - (aez + bvirt) + (bvirt - ez);\n bvirt = bx - bex;\n bextail = bx - (bex + bvirt) + (bvirt - ex);\n bvirt = by - bey;\n beytail = by - (bey + bvirt) + (bvirt - ey);\n bvirt = bz - bez;\n beztail = bz - (bez + bvirt) + (bvirt - ez);\n bvirt = cx - cex;\n cextail = cx - (cex + bvirt) + (bvirt - ex);\n bvirt = cy - cey;\n ceytail = cy - (cey + bvirt) + (bvirt - ey);\n bvirt = cz - cez;\n ceztail = cz - (cez + bvirt) + (bvirt - ez);\n bvirt = dx - dex;\n dextail = dx - (dex + bvirt) + (bvirt - ex);\n bvirt = dy - dey;\n deytail = dy - (dey + bvirt) + (bvirt - ey);\n bvirt = dz - dez;\n deztail = dz - (dez + bvirt) + (bvirt - ez);\n if (aextail === 0 && aeytail === 0 && aeztail === 0 &&\n bextail === 0 && beytail === 0 && beztail === 0 &&\n cextail === 0 && ceytail === 0 && ceztail === 0 &&\n dextail === 0 && deytail === 0 && deztail === 0) {\n return det;\n }\n\n errbound = isperrboundC * permanent + resulterrbound * Math.abs(det);\n\n const abeps = (aex * beytail + bey * aextail) - (aey * bextail + bex * aeytail);\n const bceps = (bex * ceytail + cey * bextail) - (bey * cextail + cex * beytail);\n const cdeps = (cex * deytail + dey * cextail) - (cey * dextail + dex * ceytail);\n const daeps = (dex * aeytail + aey * dextail) - (dey * aextail + aex * deytail);\n const aceps = (aex * ceytail + cey * aextail) - (aey * cextail + cex * aeytail);\n const bdeps = (bex * deytail + dey * bextail) - (bey * dextail + dex * beytail);\n det +=\n (((bex * bex + bey * bey + bez * bez) * ((cez * daeps + dez * aceps + aez * cdeps) +\n (ceztail * da3 + deztail * ac3 + aeztail * cd3)) + (dex * dex + dey * dey + dez * dez) *\n ((aez * bceps - bez * aceps + cez * abeps) + (aeztail * bc3 - beztail * ac3 + ceztail * ab3))) -\n ((aex * aex + aey * aey + aez * aez) * ((bez * cdeps - cez * bdeps + dez * bceps) +\n (beztail * cd3 - ceztail * bd3 + deztail * bc3)) + (cex * cex + cey * cey + cez * cez) *\n ((dez * abeps + aez * bdeps + bez * daeps) + (deztail * ab3 + aeztail * bd3 + beztail * da3)))) +\n 2 * (((bex * bextail + bey * beytail + bez * beztail) * (cez * da3 + dez * ac3 + aez * cd3) +\n (dex * dextail + dey * deytail + dez * deztail) * (aez * bc3 - bez * ac3 + cez * ab3)) -\n ((aex * aextail + aey * aeytail + aez * aeztail) * (bez * cd3 - cez * bd3 + dez * bc3) +\n (cex * cextail + cey * ceytail + cez * ceztail) * (dez * ab3 + aez * bd3 + bez * da3)));\n\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n return insphereexact(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez);\n}\n\nexport function insphere(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez) {\n const aex = ax - ex;\n const bex = bx - ex;\n const cex = cx - ex;\n const dex = dx - ex;\n const aey = ay - ey;\n const bey = by - ey;\n const cey = cy - ey;\n const dey = dy - ey;\n const aez = az - ez;\n const bez = bz - ez;\n const cez = cz - ez;\n const dez = dz - ez;\n\n const aexbey = aex * bey;\n const bexaey = bex * aey;\n const ab = aexbey - bexaey;\n const bexcey = bex * cey;\n const cexbey = cex * bey;\n const bc = bexcey - cexbey;\n const cexdey = cex * dey;\n const dexcey = dex * cey;\n const cd = cexdey - dexcey;\n const dexaey = dex * aey;\n const aexdey = aex * dey;\n const da = dexaey - aexdey;\n const aexcey = aex * cey;\n const cexaey = cex * aey;\n const ac = aexcey - cexaey;\n const bexdey = bex * dey;\n const dexbey = dex * bey;\n const bd = bexdey - dexbey;\n\n const abc = aez * bc - bez * ac + cez * ab;\n const bcd = bez * cd - cez * bd + dez * bc;\n const cda = cez * da + dez * ac + aez * cd;\n const dab = dez * ab + aez * bd + bez * da;\n\n const alift = aex * aex + aey * aey + aez * aez;\n const blift = bex * bex + bey * bey + bez * bez;\n const clift = cex * cex + cey * cey + cez * cez;\n const dlift = dex * dex + dey * dey + dez * dez;\n\n const det = (clift * dab - dlift * abc) + (alift * bcd - blift * cda);\n\n const aezplus = Math.abs(aez);\n const bezplus = Math.abs(bez);\n const cezplus = Math.abs(cez);\n const dezplus = Math.abs(dez);\n const aexbeyplus = Math.abs(aexbey);\n const bexaeyplus = Math.abs(bexaey);\n const bexceyplus = Math.abs(bexcey);\n const cexbeyplus = Math.abs(cexbey);\n const cexdeyplus = Math.abs(cexdey);\n const dexceyplus = Math.abs(dexcey);\n const dexaeyplus = Math.abs(dexaey);\n const aexdeyplus = Math.abs(aexdey);\n const aexceyplus = Math.abs(aexcey);\n const cexaeyplus = Math.abs(cexaey);\n const bexdeyplus = Math.abs(bexdey);\n const dexbeyplus = Math.abs(dexbey);\n const permanent =\n ((cexdeyplus + dexceyplus) * bezplus + (dexbeyplus + bexdeyplus) * cezplus + (bexceyplus + cexbeyplus) * dezplus) * alift +\n ((dexaeyplus + aexdeyplus) * cezplus + (aexceyplus + cexaeyplus) * dezplus + (cexdeyplus + dexceyplus) * aezplus) * blift +\n ((aexbeyplus + bexaeyplus) * dezplus + (bexdeyplus + dexbeyplus) * aezplus + (dexaeyplus + aexdeyplus) * bezplus) * clift +\n ((bexceyplus + cexbeyplus) * aezplus + (cexaeyplus + aexceyplus) * bezplus + (aexbeyplus + bexaeyplus) * cezplus) * dlift;\n\n const errbound = isperrboundA * permanent;\n if (det > errbound || -det > errbound) {\n return det;\n }\n return -insphereadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez, permanent);\n}\n\nexport function inspherefast(pax, pay, paz, pbx, pby, pbz, pcx, pcy, pcz, pdx, pdy, pdz, pex, pey, pez) {\n const aex = pax - pex;\n const bex = pbx - pex;\n const cex = pcx - pex;\n const dex = pdx - pex;\n const aey = pay - pey;\n const bey = pby - pey;\n const cey = pcy - pey;\n const dey = pdy - pey;\n const aez = paz - pez;\n const bez = pbz - pez;\n const cez = pcz - pez;\n const dez = pdz - pez;\n\n const ab = aex * bey - bex * aey;\n const bc = bex * cey - cex * bey;\n const cd = cex * dey - dex * cey;\n const da = dex * aey - aex * dey;\n const ac = aex * cey - cex * aey;\n const bd = bex * dey - dex * bey;\n\n const abc = aez * bc - bez * ac + cez * ab;\n const bcd = bez * cd - cez * bd + dez * bc;\n const cda = cez * da + dez * ac + aez * cd;\n const dab = dez * ab + aez * bd + bez * da;\n\n const alift = aex * aex + aey * aey + aez * aez;\n const blift = bex * bex + bey * bey + bez * bez;\n const clift = cex * cex + cey * cey + cez * cez;\n const dlift = dex * dex + dey * dey + dez * dez;\n\n return (clift * dab - dlift * abc) + (alift * bcd - blift * cda);\n}\n","\nconst EPSILON = Math.pow(2, -52);\nconst EDGE_STACK = new Uint32Array(512);\n\nimport {orient2d} from 'robust-predicates';\n\nexport default class Delaunator {\n\n static from(points, getX = defaultGetX, getY = defaultGetY) {\n const n = points.length;\n const coords = new Float64Array(n * 2);\n\n for (let i = 0; i < n; i++) {\n const p = points[i];\n coords[2 * i] = getX(p);\n coords[2 * i + 1] = getY(p);\n }\n\n return new Delaunator(coords);\n }\n\n constructor(coords) {\n const n = coords.length >> 1;\n if (n > 0 && typeof coords[0] !== 'number') throw new Error('Expected coords to contain numbers.');\n\n this.coords = coords;\n\n // arrays that will store the triangulation graph\n const maxTriangles = Math.max(2 * n - 5, 0);\n this._triangles = new Uint32Array(maxTriangles * 3);\n this._halfedges = new Int32Array(maxTriangles * 3);\n\n // temporary arrays for tracking the edges of the advancing convex hull\n this._hashSize = Math.ceil(Math.sqrt(n));\n this._hullPrev = new Uint32Array(n); // edge to prev edge\n this._hullNext = new Uint32Array(n); // edge to next edge\n this._hullTri = new Uint32Array(n); // edge to adjacent triangle\n this._hullHash = new Int32Array(this._hashSize).fill(-1); // angular edge hash\n\n // temporary arrays for sorting points\n this._ids = new Uint32Array(n);\n this._dists = new Float64Array(n);\n\n this.update();\n }\n\n update() {\n const {coords, _hullPrev: hullPrev, _hullNext: hullNext, _hullTri: hullTri, _hullHash: hullHash} = this;\n const n = coords.length >> 1;\n\n // populate an array of point indices; calculate input data bbox\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n\n for (let i = 0; i < n; i++) {\n const x = coords[2 * i];\n const y = coords[2 * i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n this._ids[i] = i;\n }\n const cx = (minX + maxX) / 2;\n const cy = (minY + maxY) / 2;\n\n let minDist = Infinity;\n let i0, i1, i2;\n\n // pick a seed point close to the center\n for (let i = 0; i < n; i++) {\n const d = dist(cx, cy, coords[2 * i], coords[2 * i + 1]);\n if (d < minDist) {\n i0 = i;\n minDist = d;\n }\n }\n const i0x = coords[2 * i0];\n const i0y = coords[2 * i0 + 1];\n\n minDist = Infinity;\n\n // find the point closest to the seed\n for (let i = 0; i < n; i++) {\n if (i === i0) continue;\n const d = dist(i0x, i0y, coords[2 * i], coords[2 * i + 1]);\n if (d < minDist && d > 0) {\n i1 = i;\n minDist = d;\n }\n }\n let i1x = coords[2 * i1];\n let i1y = coords[2 * i1 + 1];\n\n let minRadius = Infinity;\n\n // find the third point which forms the smallest circumcircle with the first two\n for (let i = 0; i < n; i++) {\n if (i === i0 || i === i1) continue;\n const r = circumradius(i0x, i0y, i1x, i1y, coords[2 * i], coords[2 * i + 1]);\n if (r < minRadius) {\n i2 = i;\n minRadius = r;\n }\n }\n let i2x = coords[2 * i2];\n let i2y = coords[2 * i2 + 1];\n\n if (minRadius === Infinity) {\n // order collinear points by dx (or dy if all x are identical)\n // and return the list as a hull\n for (let i = 0; i < n; i++) {\n this._dists[i] = (coords[2 * i] - coords[0]) || (coords[2 * i + 1] - coords[1]);\n }\n quicksort(this._ids, this._dists, 0, n - 1);\n const hull = new Uint32Array(n);\n let j = 0;\n for (let i = 0, d0 = -Infinity; i < n; i++) {\n const id = this._ids[i];\n if (this._dists[id] > d0) {\n hull[j++] = id;\n d0 = this._dists[id];\n }\n }\n this.hull = hull.subarray(0, j);\n this.triangles = new Uint32Array(0);\n this.halfedges = new Uint32Array(0);\n return;\n }\n\n // swap the order of the seed points for counter-clockwise orientation\n if (orient2d(i0x, i0y, i1x, i1y, i2x, i2y) < 0) {\n const i = i1;\n const x = i1x;\n const y = i1y;\n i1 = i2;\n i1x = i2x;\n i1y = i2y;\n i2 = i;\n i2x = x;\n i2y = y;\n }\n\n const center = circumcenter(i0x, i0y, i1x, i1y, i2x, i2y);\n this._cx = center.x;\n this._cy = center.y;\n\n for (let i = 0; i < n; i++) {\n this._dists[i] = dist(coords[2 * i], coords[2 * i + 1], center.x, center.y);\n }\n\n // sort the points by distance from the seed triangle circumcenter\n quicksort(this._ids, this._dists, 0, n - 1);\n\n // set up the seed triangle as the starting hull\n this._hullStart = i0;\n let hullSize = 3;\n\n hullNext[i0] = hullPrev[i2] = i1;\n hullNext[i1] = hullPrev[i0] = i2;\n hullNext[i2] = hullPrev[i1] = i0;\n\n hullTri[i0] = 0;\n hullTri[i1] = 1;\n hullTri[i2] = 2;\n\n hullHash.fill(-1);\n hullHash[this._hashKey(i0x, i0y)] = i0;\n hullHash[this._hashKey(i1x, i1y)] = i1;\n hullHash[this._hashKey(i2x, i2y)] = i2;\n\n this.trianglesLen = 0;\n this._addTriangle(i0, i1, i2, -1, -1, -1);\n\n for (let k = 0, xp, yp; k < this._ids.length; k++) {\n const i = this._ids[k];\n const x = coords[2 * i];\n const y = coords[2 * i + 1];\n\n // skip near-duplicate points\n if (k > 0 && Math.abs(x - xp) <= EPSILON && Math.abs(y - yp) <= EPSILON) continue;\n xp = x;\n yp = y;\n\n // skip seed triangle points\n if (i === i0 || i === i1 || i === i2) continue;\n\n // find a visible edge on the convex hull using edge hash\n let start = 0;\n for (let j = 0, key = this._hashKey(x, y); j < this._hashSize; j++) {\n start = hullHash[(key + j) % this._hashSize];\n if (start !== -1 && start !== hullNext[start]) break;\n }\n\n start = hullPrev[start];\n let e = start, q;\n while (q = hullNext[e], orient2d(x, y, coords[2 * e], coords[2 * e + 1], coords[2 * q], coords[2 * q + 1]) >= 0) {\n e = q;\n if (e === start) {\n e = -1;\n break;\n }\n }\n if (e === -1) continue; // likely a near-duplicate point; skip it\n\n // add the first triangle from the point\n let t = this._addTriangle(e, i, hullNext[e], -1, -1, hullTri[e]);\n\n // recursively flip triangles from the point until they satisfy the Delaunay condition\n hullTri[i] = this._legalize(t + 2);\n hullTri[e] = t; // keep track of boundary triangles on the hull\n hullSize++;\n\n // walk forward through the hull, adding more triangles and flipping recursively\n let n = hullNext[e];\n while (q = hullNext[n], orient2d(x, y, coords[2 * n], coords[2 * n + 1], coords[2 * q], coords[2 * q + 1]) < 0) {\n t = this._addTriangle(n, i, q, hullTri[i], -1, hullTri[n]);\n hullTri[i] = this._legalize(t + 2);\n hullNext[n] = n; // mark as removed\n hullSize--;\n n = q;\n }\n\n // walk backward from the other side, adding more triangles and flipping\n if (e === start) {\n while (q = hullPrev[e], orient2d(x, y, coords[2 * q], coords[2 * q + 1], coords[2 * e], coords[2 * e + 1]) < 0) {\n t = this._addTriangle(q, i, e, -1, hullTri[e], hullTri[q]);\n this._legalize(t + 2);\n hullTri[q] = t;\n hullNext[e] = e; // mark as removed\n hullSize--;\n e = q;\n }\n }\n\n // update the hull indices\n this._hullStart = hullPrev[i] = e;\n hullNext[e] = hullPrev[n] = i;\n hullNext[i] = n;\n\n // save the two new edges in the hash table\n hullHash[this._hashKey(x, y)] = i;\n hullHash[this._hashKey(coords[2 * e], coords[2 * e + 1])] = e;\n }\n\n this.hull = new Uint32Array(hullSize);\n for (let i = 0, e = this._hullStart; i < hullSize; i++) {\n this.hull[i] = e;\n e = hullNext[e];\n }\n\n // trim typed triangle mesh arrays\n this.triangles = this._triangles.subarray(0, this.trianglesLen);\n this.halfedges = this._halfedges.subarray(0, this.trianglesLen);\n }\n\n _hashKey(x, y) {\n return Math.floor(pseudoAngle(x - this._cx, y - this._cy) * this._hashSize) % this._hashSize;\n }\n\n _legalize(a) {\n const {_triangles: triangles, _halfedges: halfedges, coords} = this;\n\n let i = 0;\n let ar = 0;\n\n // recursion eliminated with a fixed-size stack\n while (true) {\n const b = halfedges[a];\n\n /* if the pair of triangles doesn't satisfy the Delaunay condition\n * (p1 is inside the circumcircle of [p0, pl, pr]), flip them,\n * then do the same check/flip recursively for the new pair of triangles\n *\n * pl pl\n * /||\\ / \\\n * al/ || \\bl al/ \\a\n * / || \\ / \\\n * / a||b \\ flip /___ar___\\\n * p0\\ || /p1 => p0\\---bl---/p1\n * \\ || / \\ /\n * ar\\ || /br b\\ /br\n * \\||/ \\ /\n * pr pr\n */\n const a0 = a - a % 3;\n ar = a0 + (a + 2) % 3;\n\n if (b === -1) { // convex hull edge\n if (i === 0) break;\n a = EDGE_STACK[--i];\n continue;\n }\n\n const b0 = b - b % 3;\n const al = a0 + (a + 1) % 3;\n const bl = b0 + (b + 2) % 3;\n\n const p0 = triangles[ar];\n const pr = triangles[a];\n const pl = triangles[al];\n const p1 = triangles[bl];\n\n const illegal = inCircle(\n coords[2 * p0], coords[2 * p0 + 1],\n coords[2 * pr], coords[2 * pr + 1],\n coords[2 * pl], coords[2 * pl + 1],\n coords[2 * p1], coords[2 * p1 + 1]);\n\n if (illegal) {\n triangles[a] = p1;\n triangles[b] = p0;\n\n const hbl = halfedges[bl];\n\n // edge swapped on the other side of the hull (rare); fix the halfedge reference\n if (hbl === -1) {\n let e = this._hullStart;\n do {\n if (this._hullTri[e] === bl) {\n this._hullTri[e] = a;\n break;\n }\n e = this._hullPrev[e];\n } while (e !== this._hullStart);\n }\n this._link(a, hbl);\n this._link(b, halfedges[ar]);\n this._link(ar, bl);\n\n const br = b0 + (b + 1) % 3;\n\n // don't worry about hitting the cap: it can only happen on extremely degenerate input\n if (i < EDGE_STACK.length) {\n EDGE_STACK[i++] = br;\n }\n } else {\n if (i === 0) break;\n a = EDGE_STACK[--i];\n }\n }\n\n return ar;\n }\n\n _link(a, b) {\n this._halfedges[a] = b;\n if (b !== -1) this._halfedges[b] = a;\n }\n\n // add a new triangle given vertex indices and adjacent half-edge ids\n _addTriangle(i0, i1, i2, a, b, c) {\n const t = this.trianglesLen;\n\n this._triangles[t] = i0;\n this._triangles[t + 1] = i1;\n this._triangles[t + 2] = i2;\n\n this._link(t, a);\n this._link(t + 1, b);\n this._link(t + 2, c);\n\n this.trianglesLen += 3;\n\n return t;\n }\n}\n\n// monotonically increases with real angle, but doesn't need expensive trigonometry\nfunction pseudoAngle(dx, dy) {\n const p = dx / (Math.abs(dx) + Math.abs(dy));\n return (dy > 0 ? 3 - p : 1 + p) / 4; // [0..1]\n}\n\nfunction dist(ax, ay, bx, by) {\n const dx = ax - bx;\n const dy = ay - by;\n return dx * dx + dy * dy;\n}\n\nfunction inCircle(ax, ay, bx, by, cx, cy, px, py) {\n const dx = ax - px;\n const dy = ay - py;\n const ex = bx - px;\n const ey = by - py;\n const fx = cx - px;\n const fy = cy - py;\n\n const ap = dx * dx + dy * dy;\n const bp = ex * ex + ey * ey;\n const cp = fx * fx + fy * fy;\n\n return dx * (ey * cp - bp * fy) -\n dy * (ex * cp - bp * fx) +\n ap * (ex * fy - ey * fx) < 0;\n}\n\nfunction circumradius(ax, ay, bx, by, cx, cy) {\n const dx = bx - ax;\n const dy = by - ay;\n const ex = cx - ax;\n const ey = cy - ay;\n\n const bl = dx * dx + dy * dy;\n const cl = ex * ex + ey * ey;\n const d = 0.5 / (dx * ey - dy * ex);\n\n const x = (ey * bl - dy * cl) * d;\n const y = (dx * cl - ex * bl) * d;\n\n return x * x + y * y;\n}\n\nfunction circumcenter(ax, ay, bx, by, cx, cy) {\n const dx = bx - ax;\n const dy = by - ay;\n const ex = cx - ax;\n const ey = cy - ay;\n\n const bl = dx * dx + dy * dy;\n const cl = ex * ex + ey * ey;\n const d = 0.5 / (dx * ey - dy * ex);\n\n const x = ax + (ey * bl - dy * cl) * d;\n const y = ay + (dx * cl - ex * bl) * d;\n\n return {x, y};\n}\n\nfunction quicksort(ids, dists, left, right) {\n if (right - left <= 20) {\n for (let i = left + 1; i <= right; i++) {\n const temp = ids[i];\n const tempDist = dists[temp];\n let j = i - 1;\n while (j >= left && dists[ids[j]] > tempDist) ids[j + 1] = ids[j--];\n ids[j + 1] = temp;\n }\n } else {\n const median = (left + right) >> 1;\n let i = left + 1;\n let j = right;\n swap(ids, median, i);\n if (dists[ids[left]] > dists[ids[right]]) swap(ids, left, right);\n if (dists[ids[i]] > dists[ids[right]]) swap(ids, i, right);\n if (dists[ids[left]] > dists[ids[i]]) swap(ids, left, i);\n\n const temp = ids[i];\n const tempDist = dists[temp];\n while (true) {\n do i++; while (dists[ids[i]] < tempDist);\n do j--; while (dists[ids[j]] > tempDist);\n if (j < i) break;\n swap(ids, i, j);\n }\n ids[left + 1] = ids[j];\n ids[j] = temp;\n\n if (right - i + 1 >= j - left) {\n quicksort(ids, dists, i, right);\n quicksort(ids, dists, left, j - 1);\n } else {\n quicksort(ids, dists, left, j - 1);\n quicksort(ids, dists, i, right);\n }\n }\n}\n\nfunction swap(arr, i, j) {\n const tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\nfunction defaultGetX(p) {\n return p[0];\n}\nfunction defaultGetY(p) {\n return p[1];\n}\n","const epsilon = 1e-6;\n\nexport default class Path {\n constructor() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n }\n moveTo(x, y) {\n this._ += `M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n }\n lineTo(x, y) {\n this._ += `L${this._x1 = +x},${this._y1 = +y}`;\n }\n arc(x, y, r) {\n x = +x, y = +y, r = +r;\n const x0 = x + r;\n const y0 = y;\n if (r < 0) throw new Error(\"negative radius\");\n if (this._x1 === null) this._ += `M${x0},${y0}`;\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) this._ += \"L\" + x0 + \",\" + y0;\n if (!r) return;\n this._ += `A${r},${r},0,1,1,${x - r},${y}A${r},${r},0,1,1,${this._x1 = x0},${this._y1 = y0}`;\n }\n rect(x, y, w, h) {\n this._ += `M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${+w}v${+h}h${-w}Z`;\n }\n value() {\n return this._ || null;\n }\n}\n","export default class Polygon {\n constructor() {\n this._ = [];\n }\n moveTo(x, y) {\n this._.push([x, y]);\n }\n closePath() {\n this._.push(this._[0].slice());\n }\n lineTo(x, y) {\n this._.push([x, y]);\n }\n value() {\n return this._.length ? this._ : null;\n }\n}\n","import Path from \"./path.js\";\nimport Polygon from \"./polygon.js\";\n\nexport default class Voronoi {\n constructor(delaunay, [xmin, ymin, xmax, ymax] = [0, 0, 960, 500]) {\n if (!((xmax = +xmax) >= (xmin = +xmin)) || !((ymax = +ymax) >= (ymin = +ymin))) throw new Error(\"invalid bounds\");\n this.delaunay = delaunay;\n this._circumcenters = new Float64Array(delaunay.points.length * 2);\n this.vectors = new Float64Array(delaunay.points.length * 2);\n this.xmax = xmax, this.xmin = xmin;\n this.ymax = ymax, this.ymin = ymin;\n this._init();\n }\n update() {\n this.delaunay.update();\n this._init();\n return this;\n }\n _init() {\n const {delaunay: {points, hull, triangles}, vectors} = this;\n let bx, by; // lazily computed barycenter of the hull\n\n // Compute circumcenters.\n const circumcenters = this.circumcenters = this._circumcenters.subarray(0, triangles.length / 3 * 2);\n for (let i = 0, j = 0, n = triangles.length, x, y; i < n; i += 3, j += 2) {\n const t1 = triangles[i] * 2;\n const t2 = triangles[i + 1] * 2;\n const t3 = triangles[i + 2] * 2;\n const x1 = points[t1];\n const y1 = points[t1 + 1];\n const x2 = points[t2];\n const y2 = points[t2 + 1];\n const x3 = points[t3];\n const y3 = points[t3 + 1];\n\n const dx = x2 - x1;\n const dy = y2 - y1;\n const ex = x3 - x1;\n const ey = y3 - y1;\n const ab = (dx * ey - dy * ex) * 2;\n\n if (Math.abs(ab) < 1e-9) {\n // For a degenerate triangle, the circumcenter is at the infinity, in a\n // direction orthogonal to the halfedge and away from the “center” of\n // the diagram , defined as the hull’s barycenter.\n if (bx === undefined) {\n bx = by = 0;\n for (const i of hull) bx += points[i * 2], by += points[i * 2 + 1];\n bx /= hull.length, by /= hull.length;\n }\n const a = 1e9 * Math.sign((bx - x1) * ey - (by - y1) * ex);\n x = (x1 + x3) / 2 - a * ey;\n y = (y1 + y3) / 2 + a * ex;\n } else {\n const d = 1 / ab;\n const bl = dx * dx + dy * dy;\n const cl = ex * ex + ey * ey;\n x = x1 + (ey * bl - dy * cl) * d;\n y = y1 + (dx * cl - ex * bl) * d;\n }\n circumcenters[j] = x;\n circumcenters[j + 1] = y;\n }\n\n // Compute exterior cell rays.\n let h = hull[hull.length - 1];\n let p0, p1 = h * 4;\n let x0, x1 = points[2 * h];\n let y0, y1 = points[2 * h + 1];\n vectors.fill(0);\n for (let i = 0; i < hull.length; ++i) {\n h = hull[i];\n p0 = p1, x0 = x1, y0 = y1;\n p1 = h * 4, x1 = points[2 * h], y1 = points[2 * h + 1];\n vectors[p0 + 2] = vectors[p1] = y0 - y1;\n vectors[p0 + 3] = vectors[p1 + 1] = x1 - x0;\n }\n }\n render(context) {\n const buffer = context == null ? context = new Path : undefined;\n const {delaunay: {halfedges, inedges, hull}, circumcenters, vectors} = this;\n if (hull.length <= 1) return null;\n for (let i = 0, n = halfedges.length; i < n; ++i) {\n const j = halfedges[i];\n if (j < i) continue;\n const ti = Math.floor(i / 3) * 2;\n const tj = Math.floor(j / 3) * 2;\n const xi = circumcenters[ti];\n const yi = circumcenters[ti + 1];\n const xj = circumcenters[tj];\n const yj = circumcenters[tj + 1];\n this._renderSegment(xi, yi, xj, yj, context);\n }\n let h0, h1 = hull[hull.length - 1];\n for (let i = 0; i < hull.length; ++i) {\n h0 = h1, h1 = hull[i];\n const t = Math.floor(inedges[h1] / 3) * 2;\n const x = circumcenters[t];\n const y = circumcenters[t + 1];\n const v = h0 * 4;\n const p = this._project(x, y, vectors[v + 2], vectors[v + 3]);\n if (p) this._renderSegment(x, y, p[0], p[1], context);\n }\n return buffer && buffer.value();\n }\n renderBounds(context) {\n const buffer = context == null ? context = new Path : undefined;\n context.rect(this.xmin, this.ymin, this.xmax - this.xmin, this.ymax - this.ymin);\n return buffer && buffer.value();\n }\n renderCell(i, context) {\n const buffer = context == null ? context = new Path : undefined;\n const points = this._clip(i);\n if (points === null || !points.length) return;\n context.moveTo(points[0], points[1]);\n let n = points.length;\n while (points[0] === points[n-2] && points[1] === points[n-1] && n > 1) n -= 2;\n for (let i = 2; i < n; i += 2) {\n if (points[i] !== points[i-2] || points[i+1] !== points[i-1])\n context.lineTo(points[i], points[i + 1]);\n }\n context.closePath();\n return buffer && buffer.value();\n }\n *cellPolygons() {\n const {delaunay: {points}} = this;\n for (let i = 0, n = points.length / 2; i < n; ++i) {\n const cell = this.cellPolygon(i);\n if (cell) cell.index = i, yield cell;\n }\n }\n cellPolygon(i) {\n const polygon = new Polygon;\n this.renderCell(i, polygon);\n return polygon.value();\n }\n _renderSegment(x0, y0, x1, y1, context) {\n let S;\n const c0 = this._regioncode(x0, y0);\n const c1 = this._regioncode(x1, y1);\n if (c0 === 0 && c1 === 0) {\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n } else if (S = this._clipSegment(x0, y0, x1, y1, c0, c1)) {\n context.moveTo(S[0], S[1]);\n context.lineTo(S[2], S[3]);\n }\n }\n contains(i, x, y) {\n if ((x = +x, x !== x) || (y = +y, y !== y)) return false;\n return this.delaunay._step(i, x, y) === i;\n }\n *neighbors(i) {\n const ci = this._clip(i);\n if (ci) for (const j of this.delaunay.neighbors(i)) {\n const cj = this._clip(j);\n // find the common edge\n if (cj) loop: for (let ai = 0, li = ci.length; ai < li; ai += 2) {\n for (let aj = 0, lj = cj.length; aj < lj; aj += 2) {\n if (ci[ai] === cj[aj]\n && ci[ai + 1] === cj[aj + 1]\n && ci[(ai + 2) % li] === cj[(aj + lj - 2) % lj]\n && ci[(ai + 3) % li] === cj[(aj + lj - 1) % lj]) {\n yield j;\n break loop;\n }\n }\n }\n }\n }\n _cell(i) {\n const {circumcenters, delaunay: {inedges, halfedges, triangles}} = this;\n const e0 = inedges[i];\n if (e0 === -1) return null; // coincident point\n const points = [];\n let e = e0;\n do {\n const t = Math.floor(e / 3);\n points.push(circumcenters[t * 2], circumcenters[t * 2 + 1]);\n e = e % 3 === 2 ? e - 2 : e + 1;\n if (triangles[e] !== i) break; // bad triangulation\n e = halfedges[e];\n } while (e !== e0 && e !== -1);\n return points;\n }\n _clip(i) {\n // degenerate case (1 valid point: return the box)\n if (i === 0 && this.delaunay.hull.length === 1) {\n return [this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax, this.xmin, this.ymin];\n }\n const points = this._cell(i);\n if (points === null) return null;\n const {vectors: V} = this;\n const v = i * 4;\n return this._simplify(V[v] || V[v + 1]\n ? this._clipInfinite(i, points, V[v], V[v + 1], V[v + 2], V[v + 3])\n : this._clipFinite(i, points));\n }\n _clipFinite(i, points) {\n const n = points.length;\n let P = null;\n let x0, y0, x1 = points[n - 2], y1 = points[n - 1];\n let c0, c1 = this._regioncode(x1, y1);\n let e0, e1 = 0;\n for (let j = 0; j < n; j += 2) {\n x0 = x1, y0 = y1, x1 = points[j], y1 = points[j + 1];\n c0 = c1, c1 = this._regioncode(x1, y1);\n if (c0 === 0 && c1 === 0) {\n e0 = e1, e1 = 0;\n if (P) P.push(x1, y1);\n else P = [x1, y1];\n } else {\n let S, sx0, sy0, sx1, sy1;\n if (c0 === 0) {\n if ((S = this._clipSegment(x0, y0, x1, y1, c0, c1)) === null) continue;\n [sx0, sy0, sx1, sy1] = S;\n } else {\n if ((S = this._clipSegment(x1, y1, x0, y0, c1, c0)) === null) continue;\n [sx1, sy1, sx0, sy0] = S;\n e0 = e1, e1 = this._edgecode(sx0, sy0);\n if (e0 && e1) this._edge(i, e0, e1, P, P.length);\n if (P) P.push(sx0, sy0);\n else P = [sx0, sy0];\n }\n e0 = e1, e1 = this._edgecode(sx1, sy1);\n if (e0 && e1) this._edge(i, e0, e1, P, P.length);\n if (P) P.push(sx1, sy1);\n else P = [sx1, sy1];\n }\n }\n if (P) {\n e0 = e1, e1 = this._edgecode(P[0], P[1]);\n if (e0 && e1) this._edge(i, e0, e1, P, P.length);\n } else if (this.contains(i, (this.xmin + this.xmax) / 2, (this.ymin + this.ymax) / 2)) {\n return [this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax, this.xmin, this.ymin];\n }\n return P;\n }\n _clipSegment(x0, y0, x1, y1, c0, c1) {\n // for more robustness, always consider the segment in the same order\n const flip = c0 < c1;\n if (flip) [x0, y0, x1, y1, c0, c1] = [x1, y1, x0, y0, c1, c0];\n while (true) {\n if (c0 === 0 && c1 === 0) return flip ? [x1, y1, x0, y0] : [x0, y0, x1, y1];\n if (c0 & c1) return null;\n let x, y, c = c0 || c1;\n if (c & 0b1000) x = x0 + (x1 - x0) * (this.ymax - y0) / (y1 - y0), y = this.ymax;\n else if (c & 0b0100) x = x0 + (x1 - x0) * (this.ymin - y0) / (y1 - y0), y = this.ymin;\n else if (c & 0b0010) y = y0 + (y1 - y0) * (this.xmax - x0) / (x1 - x0), x = this.xmax;\n else y = y0 + (y1 - y0) * (this.xmin - x0) / (x1 - x0), x = this.xmin;\n if (c0) x0 = x, y0 = y, c0 = this._regioncode(x0, y0);\n else x1 = x, y1 = y, c1 = this._regioncode(x1, y1);\n }\n }\n _clipInfinite(i, points, vx0, vy0, vxn, vyn) {\n let P = Array.from(points), p;\n if (p = this._project(P[0], P[1], vx0, vy0)) P.unshift(p[0], p[1]);\n if (p = this._project(P[P.length - 2], P[P.length - 1], vxn, vyn)) P.push(p[0], p[1]);\n if (P = this._clipFinite(i, P)) {\n for (let j = 0, n = P.length, c0, c1 = this._edgecode(P[n - 2], P[n - 1]); j < n; j += 2) {\n c0 = c1, c1 = this._edgecode(P[j], P[j + 1]);\n if (c0 && c1) j = this._edge(i, c0, c1, P, j), n = P.length;\n }\n } else if (this.contains(i, (this.xmin + this.xmax) / 2, (this.ymin + this.ymax) / 2)) {\n P = [this.xmin, this.ymin, this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax];\n }\n return P;\n }\n _edge(i, e0, e1, P, j) {\n while (e0 !== e1) {\n let x, y;\n switch (e0) {\n case 0b0101: e0 = 0b0100; continue; // top-left\n case 0b0100: e0 = 0b0110, x = this.xmax, y = this.ymin; break; // top\n case 0b0110: e0 = 0b0010; continue; // top-right\n case 0b0010: e0 = 0b1010, x = this.xmax, y = this.ymax; break; // right\n case 0b1010: e0 = 0b1000; continue; // bottom-right\n case 0b1000: e0 = 0b1001, x = this.xmin, y = this.ymax; break; // bottom\n case 0b1001: e0 = 0b0001; continue; // bottom-left\n case 0b0001: e0 = 0b0101, x = this.xmin, y = this.ymin; break; // left\n }\n // Note: this implicitly checks for out of bounds: if P[j] or P[j+1] are\n // undefined, the conditional statement will be executed.\n if ((P[j] !== x || P[j + 1] !== y) && this.contains(i, x, y)) {\n P.splice(j, 0, x, y), j += 2;\n }\n }\n return j;\n }\n _project(x0, y0, vx, vy) {\n let t = Infinity, c, x, y;\n if (vy < 0) { // top\n if (y0 <= this.ymin) return null;\n if ((c = (this.ymin - y0) / vy) < t) y = this.ymin, x = x0 + (t = c) * vx;\n } else if (vy > 0) { // bottom\n if (y0 >= this.ymax) return null;\n if ((c = (this.ymax - y0) / vy) < t) y = this.ymax, x = x0 + (t = c) * vx;\n }\n if (vx > 0) { // right\n if (x0 >= this.xmax) return null;\n if ((c = (this.xmax - x0) / vx) < t) x = this.xmax, y = y0 + (t = c) * vy;\n } else if (vx < 0) { // left\n if (x0 <= this.xmin) return null;\n if ((c = (this.xmin - x0) / vx) < t) x = this.xmin, y = y0 + (t = c) * vy;\n }\n return [x, y];\n }\n _edgecode(x, y) {\n return (x === this.xmin ? 0b0001\n : x === this.xmax ? 0b0010 : 0b0000)\n | (y === this.ymin ? 0b0100\n : y === this.ymax ? 0b1000 : 0b0000);\n }\n _regioncode(x, y) {\n return (x < this.xmin ? 0b0001\n : x > this.xmax ? 0b0010 : 0b0000)\n | (y < this.ymin ? 0b0100\n : y > this.ymax ? 0b1000 : 0b0000);\n }\n _simplify(P) {\n if (P && P.length > 4) {\n for (let i = 0; i < P.length; i+= 2) {\n const j = (i + 2) % P.length, k = (i + 4) % P.length;\n if (P[i] === P[j] && P[j] === P[k] || P[i + 1] === P[j + 1] && P[j + 1] === P[k + 1]) {\n P.splice(j, 2), i -= 2;\n }\n }\n if (!P.length) P = null;\n }\n return P;\n }\n}\n","import Delaunator from \"delaunator\";\nimport Path from \"./path.js\";\nimport Polygon from \"./polygon.js\";\nimport Voronoi from \"./voronoi.js\";\n\nconst tau = 2 * Math.PI, pow = Math.pow;\n\nfunction pointX(p) {\n return p[0];\n}\n\nfunction pointY(p) {\n return p[1];\n}\n\n// A triangulation is collinear if all its triangles have a non-null area\nfunction collinear(d) {\n const {triangles, coords} = d;\n for (let i = 0; i < triangles.length; i += 3) {\n const a = 2 * triangles[i],\n b = 2 * triangles[i + 1],\n c = 2 * triangles[i + 2],\n cross = (coords[c] - coords[a]) * (coords[b + 1] - coords[a + 1])\n - (coords[b] - coords[a]) * (coords[c + 1] - coords[a + 1]);\n if (cross > 1e-10) return false;\n }\n return true;\n}\n\nfunction jitter(x, y, r) {\n return [x + Math.sin(x + y) * r, y + Math.cos(x - y) * r];\n}\n\nexport default class Delaunay {\n static from(points, fx = pointX, fy = pointY, that) {\n return new Delaunay(\"length\" in points\n ? flatArray(points, fx, fy, that)\n : Float64Array.from(flatIterable(points, fx, fy, that)));\n }\n constructor(points) {\n this._delaunator = new Delaunator(points);\n this.inedges = new Int32Array(points.length / 2);\n this._hullIndex = new Int32Array(points.length / 2);\n this.points = this._delaunator.coords;\n this._init();\n }\n update() {\n this._delaunator.update();\n this._init();\n return this;\n }\n _init() {\n const d = this._delaunator, points = this.points;\n\n // check for collinear\n if (d.hull && d.hull.length > 2 && collinear(d)) {\n this.collinear = Int32Array.from({length: points.length/2}, (_,i) => i)\n .sort((i, j) => points[2 * i] - points[2 * j] || points[2 * i + 1] - points[2 * j + 1]); // for exact neighbors\n const e = this.collinear[0], f = this.collinear[this.collinear.length - 1],\n bounds = [ points[2 * e], points[2 * e + 1], points[2 * f], points[2 * f + 1] ],\n r = 1e-8 * Math.hypot(bounds[3] - bounds[1], bounds[2] - bounds[0]);\n for (let i = 0, n = points.length / 2; i < n; ++i) {\n const p = jitter(points[2 * i], points[2 * i + 1], r);\n points[2 * i] = p[0];\n points[2 * i + 1] = p[1];\n }\n this._delaunator = new Delaunator(points);\n } else {\n delete this.collinear;\n }\n\n const halfedges = this.halfedges = this._delaunator.halfedges;\n const hull = this.hull = this._delaunator.hull;\n const triangles = this.triangles = this._delaunator.triangles;\n const inedges = this.inedges.fill(-1);\n const hullIndex = this._hullIndex.fill(-1);\n\n // Compute an index from each point to an (arbitrary) incoming halfedge\n // Used to give the first neighbor of each point; for this reason,\n // on the hull we give priority to exterior halfedges\n for (let e = 0, n = halfedges.length; e < n; ++e) {\n const p = triangles[e % 3 === 2 ? e - 2 : e + 1];\n if (halfedges[e] === -1 || inedges[p] === -1) inedges[p] = e;\n }\n for (let i = 0, n = hull.length; i < n; ++i) {\n hullIndex[hull[i]] = i;\n }\n\n // degenerate case: 1 or 2 (distinct) points\n if (hull.length <= 2 && hull.length > 0) {\n this.triangles = new Int32Array(3).fill(-1);\n this.halfedges = new Int32Array(3).fill(-1);\n this.triangles[0] = hull[0];\n inedges[hull[0]] = 1;\n if (hull.length === 2) {\n inedges[hull[1]] = 0;\n this.triangles[1] = hull[1];\n this.triangles[2] = hull[1];\n }\n }\n }\n voronoi(bounds) {\n return new Voronoi(this, bounds);\n }\n *neighbors(i) {\n const {inedges, hull, _hullIndex, halfedges, triangles, collinear} = this;\n\n // degenerate case with several collinear points\n if (collinear) {\n const l = collinear.indexOf(i);\n if (l > 0) yield collinear[l - 1];\n if (l < collinear.length - 1) yield collinear[l + 1];\n return;\n }\n\n const e0 = inedges[i];\n if (e0 === -1) return; // coincident point\n let e = e0, p0 = -1;\n do {\n yield p0 = triangles[e];\n e = e % 3 === 2 ? e - 2 : e + 1;\n if (triangles[e] !== i) return; // bad triangulation\n e = halfedges[e];\n if (e === -1) {\n const p = hull[(_hullIndex[i] + 1) % hull.length];\n if (p !== p0) yield p;\n return;\n }\n } while (e !== e0);\n }\n find(x, y, i = 0) {\n if ((x = +x, x !== x) || (y = +y, y !== y)) return -1;\n const i0 = i;\n let c;\n while ((c = this._step(i, x, y)) >= 0 && c !== i && c !== i0) i = c;\n return c;\n }\n _step(i, x, y) {\n const {inedges, hull, _hullIndex, halfedges, triangles, points} = this;\n if (inedges[i] === -1 || !points.length) return (i + 1) % (points.length >> 1);\n let c = i;\n let dc = pow(x - points[i * 2], 2) + pow(y - points[i * 2 + 1], 2);\n const e0 = inedges[i];\n let e = e0;\n do {\n let t = triangles[e];\n const dt = pow(x - points[t * 2], 2) + pow(y - points[t * 2 + 1], 2);\n if (dt < dc) dc = dt, c = t;\n e = e % 3 === 2 ? e - 2 : e + 1;\n if (triangles[e] !== i) break; // bad triangulation\n e = halfedges[e];\n if (e === -1) {\n e = hull[(_hullIndex[i] + 1) % hull.length];\n if (e !== t) {\n if (pow(x - points[e * 2], 2) + pow(y - points[e * 2 + 1], 2) < dc) return e;\n }\n break;\n }\n } while (e !== e0);\n return c;\n }\n render(context) {\n const buffer = context == null ? context = new Path : undefined;\n const {points, halfedges, triangles} = this;\n for (let i = 0, n = halfedges.length; i < n; ++i) {\n const j = halfedges[i];\n if (j < i) continue;\n const ti = triangles[i] * 2;\n const tj = triangles[j] * 2;\n context.moveTo(points[ti], points[ti + 1]);\n context.lineTo(points[tj], points[tj + 1]);\n }\n this.renderHull(context);\n return buffer && buffer.value();\n }\n renderPoints(context, r) {\n if (r === undefined && (!context || typeof context.moveTo !== \"function\")) r = context, context = null;\n r = r == undefined ? 2 : +r;\n const buffer = context == null ? context = new Path : undefined;\n const {points} = this;\n for (let i = 0, n = points.length; i < n; i += 2) {\n const x = points[i], y = points[i + 1];\n context.moveTo(x + r, y);\n context.arc(x, y, r, 0, tau);\n }\n return buffer && buffer.value();\n }\n renderHull(context) {\n const buffer = context == null ? context = new Path : undefined;\n const {hull, points} = this;\n const h = hull[0] * 2, n = hull.length;\n context.moveTo(points[h], points[h + 1]);\n for (let i = 1; i < n; ++i) {\n const h = 2 * hull[i];\n context.lineTo(points[h], points[h + 1]);\n }\n context.closePath();\n return buffer && buffer.value();\n }\n hullPolygon() {\n const polygon = new Polygon;\n this.renderHull(polygon);\n return polygon.value();\n }\n renderTriangle(i, context) {\n const buffer = context == null ? context = new Path : undefined;\n const {points, triangles} = this;\n const t0 = triangles[i *= 3] * 2;\n const t1 = triangles[i + 1] * 2;\n const t2 = triangles[i + 2] * 2;\n context.moveTo(points[t0], points[t0 + 1]);\n context.lineTo(points[t1], points[t1 + 1]);\n context.lineTo(points[t2], points[t2 + 1]);\n context.closePath();\n return buffer && buffer.value();\n }\n *trianglePolygons() {\n const {triangles} = this;\n for (let i = 0, n = triangles.length / 3; i < n; ++i) {\n yield this.trianglePolygon(i);\n }\n }\n trianglePolygon(i) {\n const polygon = new Polygon;\n this.renderTriangle(i, polygon);\n return polygon.value();\n }\n}\n\nfunction flatArray(points, fx, fy, that) {\n const n = points.length;\n const array = new Float64Array(n * 2);\n for (let i = 0; i < n; ++i) {\n const p = points[i];\n array[i * 2] = fx.call(that, p, i, points);\n array[i * 2 + 1] = fy.call(that, p, i, points);\n }\n return array;\n}\n\nfunction* flatIterable(points, fx, fy, that) {\n let i = 0;\n for (const p of points) {\n yield fx.call(that, p, i, points);\n yield fy.call(that, p, i, points);\n ++i;\n }\n}\n","import { Transform } from 'vega-dataflow';\nimport { inherits } from 'vega-util';\nimport { Delaunay } from 'd3-delaunay';\n\nfunction Voronoi(params) {\n Transform.call(this, null, params);\n}\nVoronoi.Definition = {\n 'type': 'Voronoi',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'extent',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'default': [[-1e5, -1e5], [1e5, 1e5]],\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'path'\n }]\n};\nconst defaultExtent = [-1e5, -1e5, 1e5, 1e5];\ninherits(Voronoi, Transform, {\n transform(_, pulse) {\n const as = _.as || 'path',\n data = pulse.source;\n\n // nothing to do if no data\n if (!data || !data.length) return pulse;\n\n // configure and construct voronoi diagram\n let s = _.size;\n s = s ? [0, 0, s[0], s[1]] : (s = _.extent) ? [s[0][0], s[0][1], s[1][0], s[1][1]] : defaultExtent;\n const voronoi = this.value = Delaunay.from(data, _.x, _.y).voronoi(s);\n\n // map polygons to paths\n for (let i = 0, n = data.length; i < n; ++i) {\n const polygon = voronoi.cellPolygon(i);\n data[i][as] = polygon ? toPathString(polygon) : null;\n }\n return pulse.reflow(_.modified()).modifies(as);\n }\n});\n\n// suppress duplicated end point vertices\nfunction toPathString(p) {\n const x = p[0][0],\n y = p[0][1];\n let n = p.length - 1;\n for (; p[n][0] === x && p[n][1] === y; --n);\n return 'M' + p.slice(0, n + 1).join('L') + 'Z';\n}\n\nexport { Voronoi as voronoi };\n","import { canvas } from 'vega-canvas';\nimport { Transform } from 'vega-dataflow';\nimport { inherits, error, isFunction, constant, extent } from 'vega-util';\nimport { scale } from 'vega-scale';\nimport { random } from 'vega-statistics';\n\n/*\nCopyright (c) 2013, Jason Davies.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n * The name Jason Davies may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL JASON DAVIES BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\nOR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\nADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n// Word cloud layout by Jason Davies, https://www.jasondavies.com/wordcloud/\n// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf\n\nvar cloudRadians = Math.PI / 180,\n cw = 1 << 11 >> 5,\n ch = 1 << 11;\nfunction cloud () {\n var size = [256, 256],\n text,\n font,\n fontSize,\n fontStyle,\n fontWeight,\n rotate,\n padding,\n spiral = archimedeanSpiral,\n words = [],\n random = Math.random,\n cloud = {};\n cloud.layout = function () {\n var contextAndRatio = getContext(canvas()),\n board = zeroArray((size[0] >> 5) * size[1]),\n bounds = null,\n n = words.length,\n i = -1,\n tags = [],\n data = words.map(d => ({\n text: text(d),\n font: font(d),\n style: fontStyle(d),\n weight: fontWeight(d),\n rotate: rotate(d),\n size: ~~(fontSize(d) + 1e-14),\n padding: padding(d),\n xoff: 0,\n yoff: 0,\n x1: 0,\n y1: 0,\n x0: 0,\n y0: 0,\n hasText: false,\n sprite: null,\n datum: d\n })).sort((a, b) => b.size - a.size);\n while (++i < n) {\n var d = data[i];\n d.x = size[0] * (random() + .5) >> 1;\n d.y = size[1] * (random() + .5) >> 1;\n cloudSprite(contextAndRatio, d, data, i);\n if (d.hasText && place(board, d, bounds)) {\n tags.push(d);\n if (bounds) cloudBounds(bounds, d);else bounds = [{\n x: d.x + d.x0,\n y: d.y + d.y0\n }, {\n x: d.x + d.x1,\n y: d.y + d.y1\n }];\n // Temporary hack\n d.x -= size[0] >> 1;\n d.y -= size[1] >> 1;\n }\n }\n return tags;\n };\n function getContext(canvas) {\n canvas.width = canvas.height = 1;\n var ratio = Math.sqrt(canvas.getContext('2d').getImageData(0, 0, 1, 1).data.length >> 2);\n canvas.width = (cw << 5) / ratio;\n canvas.height = ch / ratio;\n var context = canvas.getContext('2d');\n context.fillStyle = context.strokeStyle = 'red';\n context.textAlign = 'center';\n return {\n context: context,\n ratio: ratio\n };\n }\n function place(board, tag, bounds) {\n var startX = tag.x,\n startY = tag.y,\n maxDelta = Math.sqrt(size[0] * size[0] + size[1] * size[1]),\n s = spiral(size),\n dt = random() < .5 ? 1 : -1,\n t = -dt,\n dxdy,\n dx,\n dy;\n while (dxdy = s(t += dt)) {\n dx = ~~dxdy[0];\n dy = ~~dxdy[1];\n if (Math.min(Math.abs(dx), Math.abs(dy)) >= maxDelta) break;\n tag.x = startX + dx;\n tag.y = startY + dy;\n if (tag.x + tag.x0 < 0 || tag.y + tag.y0 < 0 || tag.x + tag.x1 > size[0] || tag.y + tag.y1 > size[1]) continue;\n // TODO only check for collisions within current bounds.\n if (!bounds || !cloudCollide(tag, board, size[0])) {\n if (!bounds || collideRects(tag, bounds)) {\n var sprite = tag.sprite,\n w = tag.width >> 5,\n sw = size[0] >> 5,\n lx = tag.x - (w << 4),\n sx = lx & 0x7f,\n msx = 32 - sx,\n h = tag.y1 - tag.y0,\n x = (tag.y + tag.y0) * sw + (lx >> 5),\n last;\n for (var j = 0; j < h; j++) {\n last = 0;\n for (var i = 0; i <= w; i++) {\n board[x + i] |= last << msx | (i < w ? (last = sprite[j * w + i]) >>> sx : 0);\n }\n x += sw;\n }\n tag.sprite = null;\n return true;\n }\n }\n }\n return false;\n }\n cloud.words = function (_) {\n if (arguments.length) {\n words = _;\n return cloud;\n } else {\n return words;\n }\n };\n cloud.size = function (_) {\n if (arguments.length) {\n size = [+_[0], +_[1]];\n return cloud;\n } else {\n return size;\n }\n };\n cloud.font = function (_) {\n if (arguments.length) {\n font = functor(_);\n return cloud;\n } else {\n return font;\n }\n };\n cloud.fontStyle = function (_) {\n if (arguments.length) {\n fontStyle = functor(_);\n return cloud;\n } else {\n return fontStyle;\n }\n };\n cloud.fontWeight = function (_) {\n if (arguments.length) {\n fontWeight = functor(_);\n return cloud;\n } else {\n return fontWeight;\n }\n };\n cloud.rotate = function (_) {\n if (arguments.length) {\n rotate = functor(_);\n return cloud;\n } else {\n return rotate;\n }\n };\n cloud.text = function (_) {\n if (arguments.length) {\n text = functor(_);\n return cloud;\n } else {\n return text;\n }\n };\n cloud.spiral = function (_) {\n if (arguments.length) {\n spiral = spirals[_] || _;\n return cloud;\n } else {\n return spiral;\n }\n };\n cloud.fontSize = function (_) {\n if (arguments.length) {\n fontSize = functor(_);\n return cloud;\n } else {\n return fontSize;\n }\n };\n cloud.padding = function (_) {\n if (arguments.length) {\n padding = functor(_);\n return cloud;\n } else {\n return padding;\n }\n };\n cloud.random = function (_) {\n if (arguments.length) {\n random = _;\n return cloud;\n } else {\n return random;\n }\n };\n return cloud;\n}\n\n// Fetches a monochrome sprite bitmap for the specified text.\n// Load in batches for speed.\nfunction cloudSprite(contextAndRatio, d, data, di) {\n if (d.sprite) return;\n var c = contextAndRatio.context,\n ratio = contextAndRatio.ratio;\n c.clearRect(0, 0, (cw << 5) / ratio, ch / ratio);\n var x = 0,\n y = 0,\n maxh = 0,\n n = data.length,\n w,\n w32,\n h,\n i,\n j;\n --di;\n while (++di < n) {\n d = data[di];\n c.save();\n c.font = d.style + ' ' + d.weight + ' ' + ~~((d.size + 1) / ratio) + 'px ' + d.font;\n w = c.measureText(d.text + 'm').width * ratio;\n h = d.size << 1;\n if (d.rotate) {\n var sr = Math.sin(d.rotate * cloudRadians),\n cr = Math.cos(d.rotate * cloudRadians),\n wcr = w * cr,\n wsr = w * sr,\n hcr = h * cr,\n hsr = h * sr;\n w = Math.max(Math.abs(wcr + hsr), Math.abs(wcr - hsr)) + 0x1f >> 5 << 5;\n h = ~~Math.max(Math.abs(wsr + hcr), Math.abs(wsr - hcr));\n } else {\n w = w + 0x1f >> 5 << 5;\n }\n if (h > maxh) maxh = h;\n if (x + w >= cw << 5) {\n x = 0;\n y += maxh;\n maxh = 0;\n }\n if (y + h >= ch) break;\n c.translate((x + (w >> 1)) / ratio, (y + (h >> 1)) / ratio);\n if (d.rotate) c.rotate(d.rotate * cloudRadians);\n c.fillText(d.text, 0, 0);\n if (d.padding) {\n c.lineWidth = 2 * d.padding;\n c.strokeText(d.text, 0, 0);\n }\n c.restore();\n d.width = w;\n d.height = h;\n d.xoff = x;\n d.yoff = y;\n d.x1 = w >> 1;\n d.y1 = h >> 1;\n d.x0 = -d.x1;\n d.y0 = -d.y1;\n d.hasText = true;\n x += w;\n }\n var pixels = c.getImageData(0, 0, (cw << 5) / ratio, ch / ratio).data,\n sprite = [];\n while (--di >= 0) {\n d = data[di];\n if (!d.hasText) continue;\n w = d.width;\n w32 = w >> 5;\n h = d.y1 - d.y0;\n // Zero the buffer\n for (i = 0; i < h * w32; i++) sprite[i] = 0;\n x = d.xoff;\n if (x == null) return;\n y = d.yoff;\n var seen = 0,\n seenRow = -1;\n for (j = 0; j < h; j++) {\n for (i = 0; i < w; i++) {\n var k = w32 * j + (i >> 5),\n m = pixels[(y + j) * (cw << 5) + (x + i) << 2] ? 1 << 31 - i % 32 : 0;\n sprite[k] |= m;\n seen |= m;\n }\n if (seen) seenRow = j;else {\n d.y0++;\n h--;\n j--;\n y++;\n }\n }\n d.y1 = d.y0 + seenRow;\n d.sprite = sprite.slice(0, (d.y1 - d.y0) * w32);\n }\n}\n\n// Use mask-based collision detection.\nfunction cloudCollide(tag, board, sw) {\n sw >>= 5;\n var sprite = tag.sprite,\n w = tag.width >> 5,\n lx = tag.x - (w << 4),\n sx = lx & 0x7f,\n msx = 32 - sx,\n h = tag.y1 - tag.y0,\n x = (tag.y + tag.y0) * sw + (lx >> 5),\n last;\n for (var j = 0; j < h; j++) {\n last = 0;\n for (var i = 0; i <= w; i++) {\n if ((last << msx | (i < w ? (last = sprite[j * w + i]) >>> sx : 0)) & board[x + i]) return true;\n }\n x += sw;\n }\n return false;\n}\nfunction cloudBounds(bounds, d) {\n var b0 = bounds[0],\n b1 = bounds[1];\n if (d.x + d.x0 < b0.x) b0.x = d.x + d.x0;\n if (d.y + d.y0 < b0.y) b0.y = d.y + d.y0;\n if (d.x + d.x1 > b1.x) b1.x = d.x + d.x1;\n if (d.y + d.y1 > b1.y) b1.y = d.y + d.y1;\n}\nfunction collideRects(a, b) {\n return a.x + a.x1 > b[0].x && a.x + a.x0 < b[1].x && a.y + a.y1 > b[0].y && a.y + a.y0 < b[1].y;\n}\nfunction archimedeanSpiral(size) {\n var e = size[0] / size[1];\n return function (t) {\n return [e * (t *= .1) * Math.cos(t), t * Math.sin(t)];\n };\n}\nfunction rectangularSpiral(size) {\n var dy = 4,\n dx = dy * size[0] / size[1],\n x = 0,\n y = 0;\n return function (t) {\n var sign = t < 0 ? -1 : 1;\n // See triangular numbers: T_n = n * (n + 1) / 2.\n switch (Math.sqrt(1 + 4 * sign * t) - sign & 3) {\n case 0:\n x += dx;\n break;\n case 1:\n y += dy;\n break;\n case 2:\n x -= dx;\n break;\n default:\n y -= dy;\n break;\n }\n return [x, y];\n };\n}\n\n// TODO reuse arrays?\nfunction zeroArray(n) {\n var a = [],\n i = -1;\n while (++i < n) a[i] = 0;\n return a;\n}\nfunction functor(d) {\n return typeof d === 'function' ? d : function () {\n return d;\n };\n}\nvar spirals = {\n archimedean: archimedeanSpiral,\n rectangular: rectangularSpiral\n};\n\nconst Output = ['x', 'y', 'font', 'fontSize', 'fontStyle', 'fontWeight', 'angle'];\nconst Params = ['text', 'font', 'rotate', 'fontSize', 'fontStyle', 'fontWeight'];\nfunction Wordcloud(params) {\n Transform.call(this, cloud(), params);\n}\nWordcloud.Definition = {\n 'type': 'Wordcloud',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'font',\n 'type': 'string',\n 'expr': true,\n 'default': 'sans-serif'\n }, {\n 'name': 'fontStyle',\n 'type': 'string',\n 'expr': true,\n 'default': 'normal'\n }, {\n 'name': 'fontWeight',\n 'type': 'string',\n 'expr': true,\n 'default': 'normal'\n }, {\n 'name': 'fontSize',\n 'type': 'number',\n 'expr': true,\n 'default': 14\n }, {\n 'name': 'fontSizeRange',\n 'type': 'number',\n 'array': 'nullable',\n 'default': [10, 50]\n }, {\n 'name': 'rotate',\n 'type': 'number',\n 'expr': true,\n 'default': 0\n }, {\n 'name': 'text',\n 'type': 'field'\n }, {\n 'name': 'spiral',\n 'type': 'string',\n 'values': ['archimedean', 'rectangular']\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 7,\n 'default': Output\n }]\n};\ninherits(Wordcloud, Transform, {\n transform(_, pulse) {\n if (_.size && !(_.size[0] && _.size[1])) {\n error('Wordcloud size dimensions must be non-zero.');\n }\n function modp(param) {\n const p = _[param];\n return isFunction(p) && pulse.modified(p.fields);\n }\n const mod = _.modified();\n if (!(mod || pulse.changed(pulse.ADD_REM) || Params.some(modp))) return;\n const data = pulse.materialize(pulse.SOURCE).source,\n layout = this.value,\n as = _.as || Output;\n let fontSize = _.fontSize || 14,\n range;\n isFunction(fontSize) ? range = _.fontSizeRange : fontSize = constant(fontSize);\n\n // create font size scaling function as needed\n if (range) {\n const fsize = fontSize,\n sizeScale = scale('sqrt')().domain(extent(data, fsize)).range(range);\n fontSize = x => sizeScale(fsize(x));\n }\n data.forEach(t => {\n t[as[0]] = NaN;\n t[as[1]] = NaN;\n t[as[3]] = 0;\n });\n\n // configure layout\n const words = layout.words(data).text(_.text).size(_.size || [500, 500]).padding(_.padding || 1).spiral(_.spiral || 'archimedean').rotate(_.rotate || 0).font(_.font || 'sans-serif').fontStyle(_.fontStyle || 'normal').fontWeight(_.fontWeight || 'normal').fontSize(fontSize).random(random).layout();\n const size = layout.size(),\n dx = size[0] >> 1,\n dy = size[1] >> 1,\n n = words.length;\n for (let i = 0, w, t; i < n; ++i) {\n w = words[i];\n t = w.datum;\n t[as[0]] = w.x + dx;\n t[as[1]] = w.y + dy;\n t[as[2]] = w.font;\n t[as[3]] = w.size;\n t[as[4]] = w.style;\n t[as[5]] = w.weight;\n t[as[6]] = w.rotate;\n }\n return pulse.reflow(mod).modifies(as);\n }\n});\n\nexport { Wordcloud as wordcloud };\n","import { bisectLeft, bisectRight, permute } from 'd3-array';\nimport { Transform } from 'vega-dataflow';\nimport { inherits } from 'vega-util';\n\nconst array8 = n => new Uint8Array(n);\nconst array16 = n => new Uint16Array(n);\nconst array32 = n => new Uint32Array(n);\n\n/**\n * Maintains CrossFilter state.\n */\nfunction Bitmaps() {\n let width = 8,\n data = [],\n seen = array32(0),\n curr = array(0, width),\n prev = array(0, width);\n return {\n data: () => data,\n seen: () => seen = lengthen(seen, data.length),\n add(array) {\n for (let i = 0, j = data.length, n = array.length, t; i < n; ++i) {\n t = array[i];\n t._index = j++;\n data.push(t);\n }\n },\n remove(num, map) {\n // map: index -> boolean (true => remove)\n const n = data.length,\n copy = Array(n - num),\n reindex = data; // reuse old data array for index map\n let t, i, j;\n\n // seek forward to first removal\n for (i = 0; !map[i] && i < n; ++i) {\n copy[i] = data[i];\n reindex[i] = i;\n }\n\n // condense arrays\n for (j = i; i < n; ++i) {\n t = data[i];\n if (!map[i]) {\n reindex[i] = j;\n curr[j] = curr[i];\n prev[j] = prev[i];\n copy[j] = t;\n t._index = j++;\n } else {\n reindex[i] = -1;\n }\n curr[i] = 0; // clear unused bits\n }\n\n data = copy;\n return reindex;\n },\n size: () => data.length,\n curr: () => curr,\n prev: () => prev,\n reset: k => prev[k] = curr[k],\n all: () => width < 0x101 ? 0xff : width < 0x10001 ? 0xffff : 0xffffffff,\n set(k, one) {\n curr[k] |= one;\n },\n clear(k, one) {\n curr[k] &= ~one;\n },\n resize(n, m) {\n const k = curr.length;\n if (n > k || m > width) {\n width = Math.max(m, width);\n curr = array(n, width, curr);\n prev = array(n, width);\n }\n }\n };\n}\nfunction lengthen(array, length, copy) {\n if (array.length >= length) return array;\n copy = copy || new array.constructor(length);\n copy.set(array);\n return copy;\n}\nfunction array(n, m, array) {\n const copy = (m < 0x101 ? array8 : m < 0x10001 ? array16 : array32)(n);\n if (array) copy.set(array);\n return copy;\n}\n\nfunction Dimension (index, i, query) {\n const bit = 1 << i;\n return {\n one: bit,\n zero: ~bit,\n range: query.slice(),\n bisect: index.bisect,\n index: index.index,\n size: index.size,\n onAdd(added, curr) {\n const dim = this,\n range = dim.bisect(dim.range, added.value),\n idx = added.index,\n lo = range[0],\n hi = range[1],\n n1 = idx.length;\n let i;\n for (i = 0; i < lo; ++i) curr[idx[i]] |= bit;\n for (i = hi; i < n1; ++i) curr[idx[i]] |= bit;\n return dim;\n }\n };\n}\n\n/**\n * Maintains a list of values, sorted by key.\n */\nfunction SortedIndex() {\n let index = array32(0),\n value = [],\n size = 0;\n function insert(key, data, base) {\n if (!data.length) return [];\n const n0 = size,\n n1 = data.length,\n addi = array32(n1);\n let addv = Array(n1),\n oldv,\n oldi,\n i;\n for (i = 0; i < n1; ++i) {\n addv[i] = key(data[i]);\n addi[i] = i;\n }\n addv = sort(addv, addi);\n if (n0) {\n oldv = value;\n oldi = index;\n value = Array(n0 + n1);\n index = array32(n0 + n1);\n merge(base, oldv, oldi, n0, addv, addi, n1, value, index);\n } else {\n if (base > 0) for (i = 0; i < n1; ++i) {\n addi[i] += base;\n }\n value = addv;\n index = addi;\n }\n size = n0 + n1;\n return {\n index: addi,\n value: addv\n };\n }\n function remove(num, map) {\n // map: index -> remove\n const n = size;\n let idx, i, j;\n\n // seek forward to first removal\n for (i = 0; !map[index[i]] && i < n; ++i);\n\n // condense index and value arrays\n for (j = i; i < n; ++i) {\n if (!map[idx = index[i]]) {\n index[j] = idx;\n value[j] = value[i];\n ++j;\n }\n }\n size = n - num;\n }\n function reindex(map) {\n for (let i = 0, n = size; i < n; ++i) {\n index[i] = map[index[i]];\n }\n }\n function bisect(range, array) {\n let n;\n if (array) {\n n = array.length;\n } else {\n array = value;\n n = size;\n }\n return [bisectLeft(array, range[0], 0, n), bisectRight(array, range[1], 0, n)];\n }\n return {\n insert: insert,\n remove: remove,\n bisect: bisect,\n reindex: reindex,\n index: () => index,\n size: () => size\n };\n}\nfunction sort(values, index) {\n values.sort.call(index, (a, b) => {\n const x = values[a],\n y = values[b];\n return x < y ? -1 : x > y ? 1 : 0;\n });\n return permute(values, index);\n}\nfunction merge(base, value0, index0, n0, value1, index1, n1, value, index) {\n let i0 = 0,\n i1 = 0,\n i;\n for (i = 0; i0 < n0 && i1 < n1; ++i) {\n if (value0[i0] < value1[i1]) {\n value[i] = value0[i0];\n index[i] = index0[i0++];\n } else {\n value[i] = value1[i1];\n index[i] = index1[i1++] + base;\n }\n }\n for (; i0 < n0; ++i0, ++i) {\n value[i] = value0[i0];\n index[i] = index0[i0];\n }\n for (; i1 < n1; ++i1, ++i) {\n value[i] = value1[i1];\n index[i] = index1[i1] + base;\n }\n}\n\n/**\n * An indexed multi-dimensional filter.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - An array of dimension accessors to filter.\n * @param {Array} params.query - An array of per-dimension range queries.\n */\nfunction CrossFilter(params) {\n Transform.call(this, Bitmaps(), params);\n this._indices = null;\n this._dims = null;\n}\nCrossFilter.Definition = {\n 'type': 'CrossFilter',\n 'metadata': {},\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'query',\n 'type': 'array',\n 'array': true,\n 'required': true,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }]\n};\ninherits(CrossFilter, Transform, {\n transform(_, pulse) {\n if (!this._dims) {\n return this.init(_, pulse);\n } else {\n var init = _.modified('fields') || _.fields.some(f => pulse.modified(f.fields));\n return init ? this.reinit(_, pulse) : this.eval(_, pulse);\n }\n },\n init(_, pulse) {\n const fields = _.fields,\n query = _.query,\n indices = this._indices = {},\n dims = this._dims = [],\n m = query.length;\n let i = 0,\n key,\n index;\n\n // instantiate indices and dimensions\n for (; i < m; ++i) {\n key = fields[i].fname;\n index = indices[key] || (indices[key] = SortedIndex());\n dims.push(Dimension(index, i, query[i]));\n }\n return this.eval(_, pulse);\n },\n reinit(_, pulse) {\n const output = pulse.materialize().fork(),\n fields = _.fields,\n query = _.query,\n indices = this._indices,\n dims = this._dims,\n bits = this.value,\n curr = bits.curr(),\n prev = bits.prev(),\n all = bits.all(),\n out = output.rem = output.add,\n mod = output.mod,\n m = query.length,\n adds = {};\n let add, index, key, mods, remMap, modMap, i, n, f;\n\n // set prev to current state\n prev.set(curr);\n\n // if pulse has remove tuples, process them first\n if (pulse.rem.length) {\n remMap = this.remove(_, pulse, output);\n }\n\n // if pulse has added tuples, add them to state\n if (pulse.add.length) {\n bits.add(pulse.add);\n }\n\n // if pulse has modified tuples, create an index map\n if (pulse.mod.length) {\n modMap = {};\n for (mods = pulse.mod, i = 0, n = mods.length; i < n; ++i) {\n modMap[mods[i]._index] = 1;\n }\n }\n\n // re-initialize indices as needed, update curr bitmap\n for (i = 0; i < m; ++i) {\n f = fields[i];\n if (!dims[i] || _.modified('fields', i) || pulse.modified(f.fields)) {\n key = f.fname;\n if (!(add = adds[key])) {\n indices[key] = index = SortedIndex();\n adds[key] = add = index.insert(f, pulse.source, 0);\n }\n dims[i] = Dimension(index, i, query[i]).onAdd(add, curr);\n }\n }\n\n // visit each tuple\n // if filter state changed, push index to add/rem\n // else if in mod and passes a filter, push index to mod\n for (i = 0, n = bits.data().length; i < n; ++i) {\n if (remMap[i]) {\n // skip if removed tuple\n continue;\n } else if (prev[i] !== curr[i]) {\n // add if state changed\n out.push(i);\n } else if (modMap[i] && curr[i] !== all) {\n // otherwise, pass mods through\n mod.push(i);\n }\n }\n bits.mask = (1 << m) - 1;\n return output;\n },\n eval(_, pulse) {\n const output = pulse.materialize().fork(),\n m = this._dims.length;\n let mask = 0;\n if (pulse.rem.length) {\n this.remove(_, pulse, output);\n mask |= (1 << m) - 1;\n }\n if (_.modified('query') && !_.modified('fields')) {\n mask |= this.update(_, pulse, output);\n }\n if (pulse.add.length) {\n this.insert(_, pulse, output);\n mask |= (1 << m) - 1;\n }\n if (pulse.mod.length) {\n this.modify(pulse, output);\n mask |= (1 << m) - 1;\n }\n this.value.mask = mask;\n return output;\n },\n insert(_, pulse, output) {\n const tuples = pulse.add,\n bits = this.value,\n dims = this._dims,\n indices = this._indices,\n fields = _.fields,\n adds = {},\n out = output.add,\n n = bits.size() + tuples.length,\n m = dims.length;\n let k = bits.size(),\n j,\n key,\n add;\n\n // resize bitmaps and add tuples as needed\n bits.resize(n, m);\n bits.add(tuples);\n const curr = bits.curr(),\n prev = bits.prev(),\n all = bits.all();\n\n // add to dimensional indices\n for (j = 0; j < m; ++j) {\n key = fields[j].fname;\n add = adds[key] || (adds[key] = indices[key].insert(fields[j], tuples, k));\n dims[j].onAdd(add, curr);\n }\n\n // set previous filters, output if passes at least one filter\n for (; k < n; ++k) {\n prev[k] = all;\n if (curr[k] !== all) out.push(k);\n }\n },\n modify(pulse, output) {\n const out = output.mod,\n bits = this.value,\n curr = bits.curr(),\n all = bits.all(),\n tuples = pulse.mod;\n let i, n, k;\n for (i = 0, n = tuples.length; i < n; ++i) {\n k = tuples[i]._index;\n if (curr[k] !== all) out.push(k);\n }\n },\n remove(_, pulse, output) {\n const indices = this._indices,\n bits = this.value,\n curr = bits.curr(),\n prev = bits.prev(),\n all = bits.all(),\n map = {},\n out = output.rem,\n tuples = pulse.rem;\n let i, n, k, f;\n\n // process tuples, output if passes at least one filter\n for (i = 0, n = tuples.length; i < n; ++i) {\n k = tuples[i]._index;\n map[k] = 1; // build index map\n prev[k] = f = curr[k];\n curr[k] = all;\n if (f !== all) out.push(k);\n }\n\n // remove from dimensional indices\n for (k in indices) {\n indices[k].remove(n, map);\n }\n this.reindex(pulse, n, map);\n return map;\n },\n // reindex filters and indices after propagation completes\n reindex(pulse, num, map) {\n const indices = this._indices,\n bits = this.value;\n pulse.runAfter(() => {\n const indexMap = bits.remove(num, map);\n for (const key in indices) indices[key].reindex(indexMap);\n });\n },\n update(_, pulse, output) {\n const dims = this._dims,\n query = _.query,\n stamp = pulse.stamp,\n m = dims.length;\n let mask = 0,\n i,\n q;\n\n // survey how many queries have changed\n output.filters = 0;\n for (q = 0; q < m; ++q) {\n if (_.modified('query', q)) {\n i = q;\n ++mask;\n }\n }\n if (mask === 1) {\n // only one query changed, use more efficient update\n mask = dims[i].one;\n this.incrementOne(dims[i], query[i], output.add, output.rem);\n } else {\n // multiple queries changed, perform full record keeping\n for (q = 0, mask = 0; q < m; ++q) {\n if (!_.modified('query', q)) continue;\n mask |= dims[q].one;\n this.incrementAll(dims[q], query[q], stamp, output.add);\n output.rem = output.add; // duplicate add/rem for downstream resolve\n }\n }\n\n return mask;\n },\n incrementAll(dim, query, stamp, out) {\n const bits = this.value,\n seen = bits.seen(),\n curr = bits.curr(),\n prev = bits.prev(),\n index = dim.index(),\n old = dim.bisect(dim.range),\n range = dim.bisect(query),\n lo1 = range[0],\n hi1 = range[1],\n lo0 = old[0],\n hi0 = old[1],\n one = dim.one;\n let i, j, k;\n\n // Fast incremental update based on previous lo index.\n if (lo1 < lo0) {\n for (i = lo1, j = Math.min(lo0, hi1); i < j; ++i) {\n k = index[i];\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n curr[k] ^= one;\n }\n } else if (lo1 > lo0) {\n for (i = lo0, j = Math.min(lo1, hi0); i < j; ++i) {\n k = index[i];\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n curr[k] ^= one;\n }\n }\n\n // Fast incremental update based on previous hi index.\n if (hi1 > hi0) {\n for (i = Math.max(lo1, hi0), j = hi1; i < j; ++i) {\n k = index[i];\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n curr[k] ^= one;\n }\n } else if (hi1 < hi0) {\n for (i = Math.max(lo0, hi1), j = hi0; i < j; ++i) {\n k = index[i];\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n curr[k] ^= one;\n }\n }\n dim.range = query.slice();\n },\n incrementOne(dim, query, add, rem) {\n const bits = this.value,\n curr = bits.curr(),\n index = dim.index(),\n old = dim.bisect(dim.range),\n range = dim.bisect(query),\n lo1 = range[0],\n hi1 = range[1],\n lo0 = old[0],\n hi0 = old[1],\n one = dim.one;\n let i, j, k;\n\n // Fast incremental update based on previous lo index.\n if (lo1 < lo0) {\n for (i = lo1, j = Math.min(lo0, hi1); i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n add.push(k);\n }\n } else if (lo1 > lo0) {\n for (i = lo0, j = Math.min(lo1, hi0); i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n rem.push(k);\n }\n }\n\n // Fast incremental update based on previous hi index.\n if (hi1 > hi0) {\n for (i = Math.max(lo1, hi0), j = hi1; i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n add.push(k);\n }\n } else if (hi1 < hi0) {\n for (i = Math.max(lo0, hi1), j = hi0; i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n rem.push(k);\n }\n }\n dim.range = query.slice();\n }\n});\n\n/**\n * Selectively filters tuples by resolving against a filter bitmap.\n * Useful for processing the output of a cross-filter transform.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.ignore - A bit mask indicating which filters to ignore.\n * @param {object} params.filter - The per-tuple filter bitmaps. Typically this\n * parameter value is a reference to a {@link CrossFilter} transform.\n */\nfunction ResolveFilter(params) {\n Transform.call(this, null, params);\n}\nResolveFilter.Definition = {\n 'type': 'ResolveFilter',\n 'metadata': {},\n 'params': [{\n 'name': 'ignore',\n 'type': 'number',\n 'required': true,\n 'description': 'A bit mask indicating which filters to ignore.'\n }, {\n 'name': 'filter',\n 'type': 'object',\n 'required': true,\n 'description': 'Per-tuple filter bitmaps from a CrossFilter transform.'\n }]\n};\ninherits(ResolveFilter, Transform, {\n transform(_, pulse) {\n const ignore = ~(_.ignore || 0),\n // bit mask where zeros -> dims to ignore\n bitmap = _.filter,\n mask = bitmap.mask;\n\n // exit early if no relevant filter changes\n if ((mask & ignore) === 0) return pulse.StopPropagation;\n const output = pulse.fork(pulse.ALL),\n data = bitmap.data(),\n curr = bitmap.curr(),\n prev = bitmap.prev(),\n pass = k => !(curr[k] & ignore) ? data[k] : null;\n\n // propagate all mod tuples that pass the filter\n output.filter(output.MOD, pass);\n\n // determine add & rem tuples via filter functions\n // for efficiency, we do *not* populate new arrays,\n // instead we add filter functions applied downstream\n\n if (!(mask & mask - 1)) {\n // only one filter changed\n output.filter(output.ADD, pass);\n output.filter(output.REM, k => (curr[k] & ignore) === mask ? data[k] : null);\n } else {\n // multiple filters changed\n output.filter(output.ADD, k => {\n const c = curr[k] & ignore,\n f = !c && c ^ prev[k] & ignore;\n return f ? data[k] : null;\n });\n output.filter(output.REM, k => {\n const c = curr[k] & ignore,\n f = c && !(c ^ (c ^ prev[k] & ignore));\n return f ? data[k] : null;\n });\n }\n\n // add filter to source data in case of reflow...\n return output.filter(output.SOURCE, t => pass(t._index));\n }\n});\n\nexport { CrossFilter as crossfilter, ResolveFilter as resolvefilter };\n","export default function permute(source, keys) {\n return Array.from(keys, key => source[key]);\n}\n","import { error, toSet, isFunction, isString, hasOwnProperty } from 'vega-util';\n\nconst RawCode = 'RawCode';\nconst Literal = 'Literal';\nconst Property = 'Property';\nconst Identifier = 'Identifier';\nconst ArrayExpression = 'ArrayExpression';\nconst BinaryExpression = 'BinaryExpression';\nconst CallExpression = 'CallExpression';\nconst ConditionalExpression = 'ConditionalExpression';\nconst LogicalExpression = 'LogicalExpression';\nconst MemberExpression = 'MemberExpression';\nconst ObjectExpression = 'ObjectExpression';\nconst UnaryExpression = 'UnaryExpression';\nfunction ASTNode(type) {\n this.type = type;\n}\nASTNode.prototype.visit = function (visitor) {\n let c, i, n;\n if (visitor(this)) return 1;\n for (c = children(this), i = 0, n = c.length; i < n; ++i) {\n if (c[i].visit(visitor)) return 1;\n }\n};\nfunction children(node) {\n switch (node.type) {\n case ArrayExpression:\n return node.elements;\n case BinaryExpression:\n case LogicalExpression:\n return [node.left, node.right];\n case CallExpression:\n return [node.callee].concat(node.arguments);\n case ConditionalExpression:\n return [node.test, node.consequent, node.alternate];\n case MemberExpression:\n return [node.object, node.property];\n case ObjectExpression:\n return node.properties;\n case Property:\n return [node.key, node.value];\n case UnaryExpression:\n return [node.argument];\n case Identifier:\n case Literal:\n case RawCode:\n default:\n return [];\n }\n}\n\n/*\n The following expression parser is based on Esprima (http://esprima.org/).\n Original header comment and license for Esprima is included here:\n\n Copyright (C) 2013 Ariya Hidayat \n Copyright (C) 2013 Thaddee Tyl \n Copyright (C) 2013 Mathias Bynens \n Copyright (C) 2012 Ariya Hidayat \n Copyright (C) 2012 Mathias Bynens \n Copyright (C) 2012 Joost-Wim Boekesteijn \n Copyright (C) 2012 Kris Kowal \n Copyright (C) 2012 Yusuke Suzuki \n Copyright (C) 2012 Arpad Borsos \n Copyright (C) 2011 Ariya Hidayat \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\nvar TokenName, source, index, length, lookahead;\nvar TokenBooleanLiteral = 1,\n TokenEOF = 2,\n TokenIdentifier = 3,\n TokenKeyword = 4,\n TokenNullLiteral = 5,\n TokenNumericLiteral = 6,\n TokenPunctuator = 7,\n TokenStringLiteral = 8,\n TokenRegularExpression = 9;\nTokenName = {};\nTokenName[TokenBooleanLiteral] = 'Boolean';\nTokenName[TokenEOF] = '';\nTokenName[TokenIdentifier] = 'Identifier';\nTokenName[TokenKeyword] = 'Keyword';\nTokenName[TokenNullLiteral] = 'Null';\nTokenName[TokenNumericLiteral] = 'Numeric';\nTokenName[TokenPunctuator] = 'Punctuator';\nTokenName[TokenStringLiteral] = 'String';\nTokenName[TokenRegularExpression] = 'RegularExpression';\nvar SyntaxArrayExpression = 'ArrayExpression',\n SyntaxBinaryExpression = 'BinaryExpression',\n SyntaxCallExpression = 'CallExpression',\n SyntaxConditionalExpression = 'ConditionalExpression',\n SyntaxIdentifier = 'Identifier',\n SyntaxLiteral = 'Literal',\n SyntaxLogicalExpression = 'LogicalExpression',\n SyntaxMemberExpression = 'MemberExpression',\n SyntaxObjectExpression = 'ObjectExpression',\n SyntaxProperty = 'Property',\n SyntaxUnaryExpression = 'UnaryExpression';\n\n// Error messages should be identical to V8.\nvar MessageUnexpectedToken = 'Unexpected token %0',\n MessageUnexpectedNumber = 'Unexpected number',\n MessageUnexpectedString = 'Unexpected string',\n MessageUnexpectedIdentifier = 'Unexpected identifier',\n MessageUnexpectedReserved = 'Unexpected reserved word',\n MessageUnexpectedEOS = 'Unexpected end of input',\n MessageInvalidRegExp = 'Invalid regular expression',\n MessageUnterminatedRegExp = 'Invalid regular expression: missing /',\n MessageStrictOctalLiteral = 'Octal literals are not allowed in strict mode.',\n MessageStrictDuplicateProperty = 'Duplicate data property in object literal not allowed in strict mode';\nvar ILLEGAL = 'ILLEGAL',\n DISABLED = 'Disabled.';\n\n// See also tools/generate-unicode-regex.py.\nvar RegexNonAsciiIdentifierStart = new RegExp('[\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0370-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0620-\\\\u064A\\\\u066E\\\\u066F\\\\u0671-\\\\u06D3\\\\u06D5\\\\u06E5\\\\u06E6\\\\u06EE\\\\u06EF\\\\u06FA-\\\\u06FC\\\\u06FF\\\\u0710\\\\u0712-\\\\u072F\\\\u074D-\\\\u07A5\\\\u07B1\\\\u07CA-\\\\u07EA\\\\u07F4\\\\u07F5\\\\u07FA\\\\u0800-\\\\u0815\\\\u081A\\\\u0824\\\\u0828\\\\u0840-\\\\u0858\\\\u08A0-\\\\u08B2\\\\u0904-\\\\u0939\\\\u093D\\\\u0950\\\\u0958-\\\\u0961\\\\u0971-\\\\u0980\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BD\\\\u09CE\\\\u09DC\\\\u09DD\\\\u09DF-\\\\u09E1\\\\u09F0\\\\u09F1\\\\u0A05-\\\\u0A0A\\\\u0A0F\\\\u0A10\\\\u0A13-\\\\u0A28\\\\u0A2A-\\\\u0A30\\\\u0A32\\\\u0A33\\\\u0A35\\\\u0A36\\\\u0A38\\\\u0A39\\\\u0A59-\\\\u0A5C\\\\u0A5E\\\\u0A72-\\\\u0A74\\\\u0A85-\\\\u0A8D\\\\u0A8F-\\\\u0A91\\\\u0A93-\\\\u0AA8\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EA3\\\\u0EA5\\\\u0EA7\\\\u0EAA\\\\u0EAB\\\\u0EAD-\\\\u0EB0\\\\u0EB2\\\\u0EB3\\\\u0EBD\\\\u0EC0-\\\\u0EC4\\\\u0EC6\\\\u0EDC-\\\\u0EDF\\\\u0F00\\\\u0F40-\\\\u0F47\\\\u0F49-\\\\u0F6C\\\\u0F88-\\\\u0F8C\\\\u1000-\\\\u102A\\\\u103F\\\\u1050-\\\\u1055\\\\u105A-\\\\u105D\\\\u1061\\\\u1065\\\\u1066\\\\u106E-\\\\u1070\\\\u1075-\\\\u1081\\\\u108E\\\\u10A0-\\\\u10C5\\\\u10C7\\\\u10CD\\\\u10D0-\\\\u10FA\\\\u10FC-\\\\u1248\\\\u124A-\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1711\\\\u1720-\\\\u1731\\\\u1740-\\\\u1751\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1780-\\\\u17B3\\\\u17D7\\\\u17DC\\\\u1820-\\\\u1877\\\\u1880-\\\\u18A8\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1950-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19C1-\\\\u19C7\\\\u1A00-\\\\u1A16\\\\u1A20-\\\\u1A54\\\\u1AA7\\\\u1B05-\\\\u1B33\\\\u1B45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-\\\\u3007\\\\u3021-\\\\u3029\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FCC\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA61F\\\\uA62A\\\\uA62B\\\\uA640-\\\\uA66E\\\\uA67F-\\\\uA69D\\\\uA6A0-\\\\uA6EF\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B-\\\\uA78E\\\\uA790-\\\\uA7AD\\\\uA7B0\\\\uA7B1\\\\uA7F7-\\\\uA801\\\\uA803-\\\\uA805\\\\uA807-\\\\uA80A\\\\uA80C-\\\\uA822\\\\uA840-\\\\uA873\\\\uA882-\\\\uA8B3\\\\uA8F2-\\\\uA8F7\\\\uA8FB\\\\uA90A-\\\\uA925\\\\uA930-\\\\uA946\\\\uA960-\\\\uA97C\\\\uA984-\\\\uA9B2\\\\uA9CF\\\\uA9E0-\\\\uA9E4\\\\uA9E6-\\\\uA9EF\\\\uA9FA-\\\\uA9FE\\\\uAA00-\\\\uAA28\\\\uAA40-\\\\uAA42\\\\uAA44-\\\\uAA4B\\\\uAA60-\\\\uAA76\\\\uAA7A\\\\uAA7E-\\\\uAAAF\\\\uAAB1\\\\uAAB5\\\\uAAB6\\\\uAAB9-\\\\uAABD\\\\uAAC0\\\\uAAC2\\\\uAADB-\\\\uAADD\\\\uAAE0-\\\\uAAEA\\\\uAAF2-\\\\uAAF4\\\\uAB01-\\\\uAB06\\\\uAB09-\\\\uAB0E\\\\uAB11-\\\\uAB16\\\\uAB20-\\\\uAB26\\\\uAB28-\\\\uAB2E\\\\uAB30-\\\\uAB5A\\\\uAB5C-\\\\uAB5F\\\\uAB64\\\\uAB65\\\\uABC0-\\\\uABE2\\\\uAC00-\\\\uD7A3\\\\uD7B0-\\\\uD7C6\\\\uD7CB-\\\\uD7FB\\\\uF900-\\\\uFA6D\\\\uFA70-\\\\uFAD9\\\\uFB00-\\\\uFB06\\\\uFB13-\\\\uFB17\\\\uFB1D\\\\uFB1F-\\\\uFB28\\\\uFB2A-\\\\uFB36\\\\uFB38-\\\\uFB3C\\\\uFB3E\\\\uFB40\\\\uFB41\\\\uFB43\\\\uFB44\\\\uFB46-\\\\uFBB1\\\\uFBD3-\\\\uFD3D\\\\uFD50-\\\\uFD8F\\\\uFD92-\\\\uFDC7\\\\uFDF0-\\\\uFDFB\\\\uFE70-\\\\uFE74\\\\uFE76-\\\\uFEFC\\\\uFF21-\\\\uFF3A\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]'),\n // eslint-disable-next-line no-misleading-character-class\n RegexNonAsciiIdentifierPart = new RegExp('[\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0300-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u0483-\\\\u0487\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u0591-\\\\u05BD\\\\u05BF\\\\u05C1\\\\u05C2\\\\u05C4\\\\u05C5\\\\u05C7\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0610-\\\\u061A\\\\u0620-\\\\u0669\\\\u066E-\\\\u06D3\\\\u06D5-\\\\u06DC\\\\u06DF-\\\\u06E8\\\\u06EA-\\\\u06FC\\\\u06FF\\\\u0710-\\\\u074A\\\\u074D-\\\\u07B1\\\\u07C0-\\\\u07F5\\\\u07FA\\\\u0800-\\\\u082D\\\\u0840-\\\\u085B\\\\u08A0-\\\\u08B2\\\\u08E4-\\\\u0963\\\\u0966-\\\\u096F\\\\u0971-\\\\u0983\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BC-\\\\u09C4\\\\u09C7\\\\u09C8\\\\u09CB-\\\\u09CE\\\\u09D7\\\\u09DC\\\\u09DD\\\\u09DF-\\\\u09E3\\\\u09E6-\\\\u09F1\\\\u0A01-\\\\u0A03\\\\u0A05-\\\\u0A0A\\\\u0A0F\\\\u0A10\\\\u0A13-\\\\u0A28\\\\u0A2A-\\\\u0A30\\\\u0A32\\\\u0A33\\\\u0A35\\\\u0A36\\\\u0A38\\\\u0A39\\\\u0A3C\\\\u0A3E-\\\\u0A42\\\\u0A47\\\\u0A48\\\\u0A4B-\\\\u0A4D\\\\u0A51\\\\u0A59-\\\\u0A5C\\\\u0A5E\\\\u0A66-\\\\u0A75\\\\u0A81-\\\\u0A83\\\\u0A85-\\\\u0A8D\\\\u0A8F-\\\\u0A91\\\\u0A93-\\\\u0AA8\\\\u0AAA-\\\\u0AB0\\\\u0AB2\\\\u0AB3\\\\u0AB5-\\\\u0AB9\\\\u0ABC-\\\\u0AC5\\\\u0AC7-\\\\u0AC9\\\\u0ACB-\\\\u0ACD\\\\u0AD0\\\\u0AE0-\\\\u0AE3\\\\u0AE6-\\\\u0AEF\\\\u0B01-\\\\u0B03\\\\u0B05-\\\\u0B0C\\\\u0B0F\\\\u0B10\\\\u0B13-\\\\u0B28\\\\u0B2A-\\\\u0B30\\\\u0B32\\\\u0B33\\\\u0B35-\\\\u0B39\\\\u0B3C-\\\\u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\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1714\\\\u1720-\\\\u1734\\\\u1740-\\\\u1753\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1772\\\\u1773\\\\u1780-\\\\u17D3\\\\u17D7\\\\u17DC\\\\u17DD\\\\u17E0-\\\\u17E9\\\\u180B-\\\\u180D\\\\u1810-\\\\u1819\\\\u1820-\\\\u1877\\\\u1880-\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1920-\\\\u192B\\\\u1930-\\\\u193B\\\\u1946-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19B0-\\\\u19C9\\\\u19D0-\\\\u19D9\\\\u1A00-\\\\u1A1B\\\\u1A20-\\\\u1A5E\\\\u1A60-\\\\u1A7C\\\\u1A7F-\\\\u1A89\\\\u1A90-\\\\u1A99\\\\u1AA7\\\\u1AB0-\\\\u1ABD\\\\u1B00-\\\\u1B4B\\\\u1B50-\\\\u1B59\\\\u1B6B-\\\\u1B73\\\\u1B80-\\\\u1BF3\\\\u1C00-\\\\u1C37\\\\u1C40-\\\\u1C49\\\\u1C4D-\\\\u1C7D\\\\u1CD0-\\\\u1CD2\\\\u1CD4-\\\\u1CF6\\\\u1CF8\\\\u1CF9\\\\u1D00-\\\\u1DF5\\\\u1DFC-\\\\u1F15\\\\u1F18-\\\\u1F1D\\\\u1F20-\\\\u1F45\\\\u1F48-\\\\u1F4D\\\\u1F50-\\\\u1F57\\\\u1F59\\\\u1F5B\\\\u1F5D\\\\u1F5F-\\\\u1F7D\\\\u1F80-\\\\u1FB4\\\\u1FB6-\\\\u1FBC\\\\u1FBE\\\\u1FC2-\\\\u1FC4\\\\u1FC6-\\\\u1FCC\\\\u1FD0-\\\\u1FD3\\\\u1FD6-\\\\u1FDB\\\\u1FE0-\\\\u1FEC\\\\u1FF2-\\\\u1FF4\\\\u1FF6-\\\\u1FFC\\\\u200C\\\\u200D\\\\u203F\\\\u2040\\\\u2054\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u20D0-\\\\u20DC\\\\u20E1\\\\u20E5-\\\\u20F0\\\\u2102\\\\u2107\\\\u210A-\\\\u2113\\\\u2115\\\\u2119-\\\\u211D\\\\u2124\\\\u2126\\\\u2128\\\\u212A-\\\\u212D\\\\u212F-\\\\u2139\\\\u213C-\\\\u213F\\\\u2145-\\\\u2149\\\\u214E\\\\u2160-\\\\u2188\\\\u2C00-\\\\u2C2E\\\\u2C30-\\\\u2C5E\\\\u2C60-\\\\u2CE4\\\\u2CEB-\\\\u2CF3\\\\u2D00-\\\\u2D25\\\\u2D27\\\\u2D2D\\\\u2D30-\\\\u2D67\\\\u2D6F\\\\u2D7F-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2DE0-\\\\u2DFF\\\\u2E2F\\\\u3005-\\\\u3007\\\\u3021-\\\\u302F\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u3099\\\\u309A\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FCC\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA62B\\\\uA640-\\\\uA66F\\\\uA674-\\\\uA67D\\\\uA67F-\\\\uA69D\\\\uA69F-\\\\uA6F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\\\uFEFC\\\\uFF10-\\\\uFF19\\\\uFF21-\\\\uFF3A\\\\uFF3F\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]');\n\n// Ensure the condition is true, otherwise throw an error.\n// This is only to have a better contract semantic, i.e. another safety net\n// to catch a logic error. The condition shall be fulfilled in normal case.\n// Do NOT use this to enforce a certain condition on any user input.\n\nfunction assert(condition, message) {\n /* istanbul ignore next */\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n}\nfunction isDecimalDigit(ch) {\n return ch >= 0x30 && ch <= 0x39; // 0..9\n}\n\nfunction isHexDigit(ch) {\n return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;\n}\nfunction isOctalDigit(ch) {\n return '01234567'.indexOf(ch) >= 0;\n}\n\n// 7.2 White Space\n\nfunction isWhiteSpace(ch) {\n return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0;\n}\n\n// 7.3 Line Terminators\n\nfunction isLineTerminator(ch) {\n return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;\n}\n\n// 7.6 Identifier Names and Identifiers\n\nfunction isIdentifierStart(ch) {\n return ch === 0x24 || ch === 0x5F ||\n // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A ||\n // A..Z\n ch >= 0x61 && ch <= 0x7A ||\n // a..z\n ch === 0x5C ||\n // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierStart.test(String.fromCharCode(ch));\n}\nfunction isIdentifierPart(ch) {\n return ch === 0x24 || ch === 0x5F ||\n // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A ||\n // A..Z\n ch >= 0x61 && ch <= 0x7A ||\n // a..z\n ch >= 0x30 && ch <= 0x39 ||\n // 0..9\n ch === 0x5C ||\n // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierPart.test(String.fromCharCode(ch));\n}\n\n// 7.6.1.1 Keywords\n\nconst keywords = {\n 'if': 1,\n 'in': 1,\n 'do': 1,\n 'var': 1,\n 'for': 1,\n 'new': 1,\n 'try': 1,\n 'let': 1,\n 'this': 1,\n 'else': 1,\n 'case': 1,\n 'void': 1,\n 'with': 1,\n 'enum': 1,\n 'while': 1,\n 'break': 1,\n 'catch': 1,\n 'throw': 1,\n 'const': 1,\n 'yield': 1,\n 'class': 1,\n 'super': 1,\n 'return': 1,\n 'typeof': 1,\n 'delete': 1,\n 'switch': 1,\n 'export': 1,\n 'import': 1,\n 'public': 1,\n 'static': 1,\n 'default': 1,\n 'finally': 1,\n 'extends': 1,\n 'package': 1,\n 'private': 1,\n 'function': 1,\n 'continue': 1,\n 'debugger': 1,\n 'interface': 1,\n 'protected': 1,\n 'instanceof': 1,\n 'implements': 1\n};\nfunction skipComment() {\n while (index < length) {\n const ch = source.charCodeAt(index);\n if (isWhiteSpace(ch) || isLineTerminator(ch)) {\n ++index;\n } else {\n break;\n }\n }\n}\nfunction scanHexEscape(prefix) {\n var i,\n len,\n ch,\n code = 0;\n len = prefix === 'u' ? 4 : 2;\n for (i = 0; i < len; ++i) {\n if (index < length && isHexDigit(source[index])) {\n ch = source[index++];\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n } else {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n return String.fromCharCode(code);\n}\nfunction scanUnicodeCodePointEscape() {\n var ch, code, cu1, cu2;\n ch = source[index];\n code = 0;\n\n // At least, one hex digit is required.\n if (ch === '}') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n while (index < length) {\n ch = source[index++];\n if (!isHexDigit(ch)) {\n break;\n }\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n }\n if (code > 0x10FFFF || ch !== '}') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n // UTF-16 Encoding\n if (code <= 0xFFFF) {\n return String.fromCharCode(code);\n }\n cu1 = (code - 0x10000 >> 10) + 0xD800;\n cu2 = (code - 0x10000 & 1023) + 0xDC00;\n return String.fromCharCode(cu1, cu2);\n}\nfunction getEscapedIdentifier() {\n var ch, id;\n ch = source.charCodeAt(index++);\n id = String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierStart(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n id = ch;\n }\n while (index < length) {\n ch = source.charCodeAt(index);\n if (!isIdentifierPart(ch)) {\n break;\n }\n ++index;\n id += String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n id = id.substr(0, id.length - 1);\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierPart(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n id += ch;\n }\n }\n return id;\n}\nfunction getIdentifier() {\n var start, ch;\n start = index++;\n while (index < length) {\n ch = source.charCodeAt(index);\n if (ch === 0x5C) {\n // Blackslash (U+005C) marks Unicode escape sequence.\n index = start;\n return getEscapedIdentifier();\n }\n if (isIdentifierPart(ch)) {\n ++index;\n } else {\n break;\n }\n }\n return source.slice(start, index);\n}\nfunction scanIdentifier() {\n var start, id, type;\n start = index;\n\n // Backslash (U+005C) starts an escaped character.\n id = source.charCodeAt(index) === 0x5C ? getEscapedIdentifier() : getIdentifier();\n\n // There is no keyword or literal with only one character.\n // Thus, it must be an identifier.\n if (id.length === 1) {\n type = TokenIdentifier;\n } else if (keywords.hasOwnProperty(id)) {\n // eslint-disable-line no-prototype-builtins\n type = TokenKeyword;\n } else if (id === 'null') {\n type = TokenNullLiteral;\n } else if (id === 'true' || id === 'false') {\n type = TokenBooleanLiteral;\n } else {\n type = TokenIdentifier;\n }\n return {\n type: type,\n value: id,\n start: start,\n end: index\n };\n}\n\n// 7.7 Punctuators\n\nfunction scanPunctuator() {\n var start = index,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2,\n ch3,\n ch4;\n switch (code) {\n // Check for most common single-character punctuators.\n case 0x2E: // . dot\n case 0x28: // ( open bracket\n case 0x29: // ) close bracket\n case 0x3B: // ; semicolon\n case 0x2C: // , comma\n case 0x7B: // { open curly brace\n case 0x7D: // } close curly brace\n case 0x5B: // [\n case 0x5D: // ]\n case 0x3A: // :\n case 0x3F: // ?\n case 0x7E:\n // ~\n ++index;\n return {\n type: TokenPunctuator,\n value: String.fromCharCode(code),\n start: start,\n end: index\n };\n default:\n code2 = source.charCodeAt(index + 1);\n\n // '=' (U+003D) marks an assignment or comparison operator.\n if (code2 === 0x3D) {\n switch (code) {\n case 0x2B: // +\n case 0x2D: // -\n case 0x2F: // /\n case 0x3C: // <\n case 0x3E: // >\n case 0x5E: // ^\n case 0x7C: // |\n case 0x25: // %\n case 0x26: // &\n case 0x2A:\n // *\n index += 2;\n return {\n type: TokenPunctuator,\n value: String.fromCharCode(code) + String.fromCharCode(code2),\n start: start,\n end: index\n };\n case 0x21: // !\n case 0x3D:\n // =\n index += 2;\n\n // !== and ===\n if (source.charCodeAt(index) === 0x3D) {\n ++index;\n }\n return {\n type: TokenPunctuator,\n value: source.slice(start, index),\n start: start,\n end: index\n };\n }\n }\n }\n\n // 4-character punctuator: >>>=\n\n ch4 = source.substr(index, 4);\n if (ch4 === '>>>=') {\n index += 4;\n return {\n type: TokenPunctuator,\n value: ch4,\n start: start,\n end: index\n };\n }\n\n // 3-character punctuators: === !== >>> <<= >>=\n\n ch3 = ch4.substr(0, 3);\n if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {\n index += 3;\n return {\n type: TokenPunctuator,\n value: ch3,\n start: start,\n end: index\n };\n }\n\n // Other 2-character punctuators: ++ -- << >> && ||\n ch2 = ch3.substr(0, 2);\n if (ch1 === ch2[1] && '+-<>&|'.indexOf(ch1) >= 0 || ch2 === '=>') {\n index += 2;\n return {\n type: TokenPunctuator,\n value: ch2,\n start: start,\n end: index\n };\n }\n if (ch2 === '//') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n // 1-character punctuators: < > = ! + - * % & | ^ /\n\n if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n ++index;\n return {\n type: TokenPunctuator,\n value: ch1,\n start: start,\n end: index\n };\n }\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n}\n\n// 7.8.3 Numeric Literals\n\nfunction scanHexLiteral(start) {\n let number = '';\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n if (number.length === 0) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n return {\n type: TokenNumericLiteral,\n value: parseInt('0x' + number, 16),\n start: start,\n end: index\n };\n}\nfunction scanOctalLiteral(start) {\n let number = '0' + source[index++];\n while (index < length) {\n if (!isOctalDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n return {\n type: TokenNumericLiteral,\n value: parseInt(number, 8),\n octal: true,\n start: start,\n end: index\n };\n}\nfunction scanNumericLiteral() {\n var number, start, ch;\n ch = source[index];\n assert(isDecimalDigit(ch.charCodeAt(0)) || ch === '.', 'Numeric literal must start with a decimal digit or a decimal point');\n start = index;\n number = '';\n if (ch !== '.') {\n number = source[index++];\n ch = source[index];\n\n // Hex number starts with '0x'.\n // Octal number starts with '0'.\n if (number === '0') {\n if (ch === 'x' || ch === 'X') {\n ++index;\n return scanHexLiteral(start);\n }\n if (isOctalDigit(ch)) {\n return scanOctalLiteral(start);\n }\n\n // decimal number starts with '0' such as '09' is illegal.\n if (ch && isDecimalDigit(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n if (ch === '.') {\n number += source[index++];\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n if (ch === 'e' || ch === 'E') {\n number += source[index++];\n ch = source[index];\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n if (isDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n return {\n type: TokenNumericLiteral,\n value: parseFloat(number),\n start: start,\n end: index\n };\n}\n\n// 7.8.4 String Literals\n\nfunction scanStringLiteral() {\n var str = '',\n quote,\n start,\n ch,\n code,\n octal = false;\n quote = source[index];\n assert(quote === '\\'' || quote === '\"', 'String literal must starts with a quote');\n start = index;\n ++index;\n while (index < length) {\n ch = source[index++];\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'u':\n case 'x':\n if (source[index] === '{') {\n ++index;\n str += scanUnicodeCodePointEscape();\n } else {\n str += scanHexEscape(ch);\n }\n break;\n case 'n':\n str += '\\n';\n break;\n case 'r':\n str += '\\r';\n break;\n case 't':\n str += '\\t';\n break;\n case 'b':\n str += '\\b';\n break;\n case 'f':\n str += '\\f';\n break;\n case 'v':\n str += '\\x0B';\n break;\n default:\n if (isOctalDigit(ch)) {\n code = '01234567'.indexOf(ch);\n\n // \\0 is not octal escape sequence\n if (code !== 0) {\n octal = true;\n }\n if (index < length && isOctalDigit(source[index])) {\n octal = true;\n code = code * 8 + '01234567'.indexOf(source[index++]);\n\n // 3 digits are only allowed when string starts\n // with 0, 1, 2, 3\n if ('0123'.indexOf(ch) >= 0 && index < length && isOctalDigit(source[index])) {\n code = code * 8 + '01234567'.indexOf(source[index++]);\n }\n }\n str += String.fromCharCode(code);\n } else {\n str += ch;\n }\n break;\n }\n } else {\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n if (quote !== '') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n return {\n type: TokenStringLiteral,\n value: str,\n octal: octal,\n start: start,\n end: index\n };\n}\nfunction testRegExp(pattern, flags) {\n let tmp = pattern;\n if (flags.indexOf('u') >= 0) {\n // Replace each astral symbol and every Unicode code point\n // escape sequence with a single ASCII symbol to avoid throwing on\n // regular expressions that are only valid in combination with the\n // `/u` flag.\n // Note: replacing with the ASCII symbol `x` might cause false\n // negatives in unlikely scenarios. For example, `[\\u{61}-b]` is a\n // perfectly valid pattern that is equivalent to `[a-b]`, but it\n // would be replaced by `[x-b]` which throws an error.\n tmp = tmp.replace(/\\\\u\\{([0-9a-fA-F]+)\\}/g, ($0, $1) => {\n if (parseInt($1, 16) <= 0x10FFFF) {\n return 'x';\n }\n throwError({}, MessageInvalidRegExp);\n }).replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g, 'x');\n }\n\n // First, detect invalid regular expressions.\n try {\n new RegExp(tmp);\n } catch (e) {\n throwError({}, MessageInvalidRegExp);\n }\n\n // Return a regular expression object for this pattern-flag pair, or\n // `null` in case the current environment doesn't support the flags it\n // uses.\n try {\n return new RegExp(pattern, flags);\n } catch (exception) {\n return null;\n }\n}\nfunction scanRegExpBody() {\n var ch, str, classMarker, terminated, body;\n ch = source[index];\n assert(ch === '/', 'Regular expression literal must start with a slash');\n str = source[index++];\n classMarker = false;\n terminated = false;\n while (index < length) {\n ch = source[index++];\n str += ch;\n if (ch === '\\\\') {\n ch = source[index++];\n // ECMA-262 7.8.5\n if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, MessageUnterminatedRegExp);\n }\n str += ch;\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, MessageUnterminatedRegExp);\n } else if (classMarker) {\n if (ch === ']') {\n classMarker = false;\n }\n } else {\n if (ch === '/') {\n terminated = true;\n break;\n } else if (ch === '[') {\n classMarker = true;\n }\n }\n }\n if (!terminated) {\n throwError({}, MessageUnterminatedRegExp);\n }\n\n // Exclude leading and trailing slash.\n body = str.substr(1, str.length - 2);\n return {\n value: body,\n literal: str\n };\n}\nfunction scanRegExpFlags() {\n var ch, str, flags;\n str = '';\n flags = '';\n while (index < length) {\n ch = source[index];\n if (!isIdentifierPart(ch.charCodeAt(0))) {\n break;\n }\n ++index;\n if (ch === '\\\\' && index < length) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } else {\n flags += ch;\n str += ch;\n }\n }\n if (flags.search(/[^gimuy]/g) >= 0) {\n throwError({}, MessageInvalidRegExp, flags);\n }\n return {\n value: flags,\n literal: str\n };\n}\nfunction scanRegExp() {\n var start, body, flags, value;\n lookahead = null;\n skipComment();\n start = index;\n body = scanRegExpBody();\n flags = scanRegExpFlags();\n value = testRegExp(body.value, flags.value);\n return {\n literal: body.literal + flags.literal,\n value: value,\n regex: {\n pattern: body.value,\n flags: flags.value\n },\n start: start,\n end: index\n };\n}\nfunction isIdentifierName(token) {\n return token.type === TokenIdentifier || token.type === TokenKeyword || token.type === TokenBooleanLiteral || token.type === TokenNullLiteral;\n}\nfunction advance() {\n skipComment();\n if (index >= length) {\n return {\n type: TokenEOF,\n start: index,\n end: index\n };\n }\n const ch = source.charCodeAt(index);\n if (isIdentifierStart(ch)) {\n return scanIdentifier();\n }\n\n // Very common: ( and ) and ;\n if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {\n return scanPunctuator();\n }\n\n // String literal starts with single quote (U+0027) or double quote (U+0022).\n if (ch === 0x27 || ch === 0x22) {\n return scanStringLiteral();\n }\n\n // Dot (.) U+002E can also start a floating-point number, hence the need\n // to check the next character.\n if (ch === 0x2E) {\n if (isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNumericLiteral();\n }\n return scanPunctuator();\n }\n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n return scanPunctuator();\n}\nfunction lex() {\n const token = lookahead;\n index = token.end;\n lookahead = advance();\n index = token.end;\n return token;\n}\nfunction peek() {\n const pos = index;\n lookahead = advance();\n index = pos;\n}\nfunction finishArrayExpression(elements) {\n const node = new ASTNode(SyntaxArrayExpression);\n node.elements = elements;\n return node;\n}\nfunction finishBinaryExpression(operator, left, right) {\n const node = new ASTNode(operator === '||' || operator === '&&' ? SyntaxLogicalExpression : SyntaxBinaryExpression);\n node.operator = operator;\n node.left = left;\n node.right = right;\n return node;\n}\nfunction finishCallExpression(callee, args) {\n const node = new ASTNode(SyntaxCallExpression);\n node.callee = callee;\n node.arguments = args;\n return node;\n}\nfunction finishConditionalExpression(test, consequent, alternate) {\n const node = new ASTNode(SyntaxConditionalExpression);\n node.test = test;\n node.consequent = consequent;\n node.alternate = alternate;\n return node;\n}\nfunction finishIdentifier(name) {\n const node = new ASTNode(SyntaxIdentifier);\n node.name = name;\n return node;\n}\nfunction finishLiteral(token) {\n const node = new ASTNode(SyntaxLiteral);\n node.value = token.value;\n node.raw = source.slice(token.start, token.end);\n if (token.regex) {\n if (node.raw === '//') {\n node.raw = '/(?:)/';\n }\n node.regex = token.regex;\n }\n return node;\n}\nfunction finishMemberExpression(accessor, object, property) {\n const node = new ASTNode(SyntaxMemberExpression);\n node.computed = accessor === '[';\n node.object = object;\n node.property = property;\n if (!node.computed) property.member = true;\n return node;\n}\nfunction finishObjectExpression(properties) {\n const node = new ASTNode(SyntaxObjectExpression);\n node.properties = properties;\n return node;\n}\nfunction finishProperty(kind, key, value) {\n const node = new ASTNode(SyntaxProperty);\n node.key = key;\n node.value = value;\n node.kind = kind;\n return node;\n}\nfunction finishUnaryExpression(operator, argument) {\n const node = new ASTNode(SyntaxUnaryExpression);\n node.operator = operator;\n node.argument = argument;\n node.prefix = true;\n return node;\n}\n\n// Throw an exception\n\nfunction throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(/%(\\d)/g, (whole, index) => {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n });\n error = new Error(msg);\n error.index = index;\n error.description = msg;\n throw error;\n}\n\n// Throw an exception because of the token.\n\nfunction throwUnexpected(token) {\n if (token.type === TokenEOF) {\n throwError(token, MessageUnexpectedEOS);\n }\n if (token.type === TokenNumericLiteral) {\n throwError(token, MessageUnexpectedNumber);\n }\n if (token.type === TokenStringLiteral) {\n throwError(token, MessageUnexpectedString);\n }\n if (token.type === TokenIdentifier) {\n throwError(token, MessageUnexpectedIdentifier);\n }\n if (token.type === TokenKeyword) {\n throwError(token, MessageUnexpectedReserved);\n }\n\n // BooleanLiteral, NullLiteral, or Punctuator.\n throwError(token, MessageUnexpectedToken, token.value);\n}\n\n// Expect the next token to match the specified punctuator.\n// If not, an exception will be thrown.\n\nfunction expect(value) {\n const token = lex();\n if (token.type !== TokenPunctuator || token.value !== value) {\n throwUnexpected(token);\n }\n}\n\n// Return true if the next token matches the specified punctuator.\n\nfunction match(value) {\n return lookahead.type === TokenPunctuator && lookahead.value === value;\n}\n\n// Return true if the next token matches the specified keyword\n\nfunction matchKeyword(keyword) {\n return lookahead.type === TokenKeyword && lookahead.value === keyword;\n}\n\n// 11.1.4 Array Initialiser\n\nfunction parseArrayInitialiser() {\n const elements = [];\n index = lookahead.start;\n expect('[');\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elements.push(parseConditionalExpression());\n if (!match(']')) {\n expect(',');\n }\n }\n }\n lex();\n return finishArrayExpression(elements);\n}\n\n// 11.1.5 Object Initialiser\n\nfunction parseObjectPropertyKey() {\n index = lookahead.start;\n const token = lex();\n\n // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n\n if (token.type === TokenStringLiteral || token.type === TokenNumericLiteral) {\n if (token.octal) {\n throwError(token, MessageStrictOctalLiteral);\n }\n return finishLiteral(token);\n }\n return finishIdentifier(token.value);\n}\nfunction parseObjectProperty() {\n var token, key, id, value;\n index = lookahead.start;\n token = lookahead;\n if (token.type === TokenIdentifier) {\n id = parseObjectPropertyKey();\n expect(':');\n value = parseConditionalExpression();\n return finishProperty('init', id, value);\n }\n if (token.type === TokenEOF || token.type === TokenPunctuator) {\n throwUnexpected(token);\n } else {\n key = parseObjectPropertyKey();\n expect(':');\n value = parseConditionalExpression();\n return finishProperty('init', key, value);\n }\n}\nfunction parseObjectInitialiser() {\n var properties = [],\n property,\n name,\n key,\n map = {},\n toString = String;\n index = lookahead.start;\n expect('{');\n while (!match('}')) {\n property = parseObjectProperty();\n if (property.key.type === SyntaxIdentifier) {\n name = property.key.name;\n } else {\n name = toString(property.key.value);\n }\n key = '$' + name;\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n throwError({}, MessageStrictDuplicateProperty);\n } else {\n map[key] = true;\n }\n properties.push(property);\n if (!match('}')) {\n expect(',');\n }\n }\n expect('}');\n return finishObjectExpression(properties);\n}\n\n// 11.1.6 The Grouping Operator\n\nfunction parseGroupExpression() {\n expect('(');\n const expr = parseExpression();\n expect(')');\n return expr;\n}\n\n// 11.1 Primary Expressions\n\nconst legalKeywords = {\n 'if': 1\n};\nfunction parsePrimaryExpression() {\n var type, token, expr;\n if (match('(')) {\n return parseGroupExpression();\n }\n if (match('[')) {\n return parseArrayInitialiser();\n }\n if (match('{')) {\n return parseObjectInitialiser();\n }\n type = lookahead.type;\n index = lookahead.start;\n if (type === TokenIdentifier || legalKeywords[lookahead.value]) {\n expr = finishIdentifier(lex().value);\n } else if (type === TokenStringLiteral || type === TokenNumericLiteral) {\n if (lookahead.octal) {\n throwError(lookahead, MessageStrictOctalLiteral);\n }\n expr = finishLiteral(lex());\n } else if (type === TokenKeyword) {\n throw new Error(DISABLED);\n } else if (type === TokenBooleanLiteral) {\n token = lex();\n token.value = token.value === 'true';\n expr = finishLiteral(token);\n } else if (type === TokenNullLiteral) {\n token = lex();\n token.value = null;\n expr = finishLiteral(token);\n } else if (match('/') || match('/=')) {\n expr = finishLiteral(scanRegExp());\n peek();\n } else {\n throwUnexpected(lex());\n }\n return expr;\n}\n\n// 11.2 Left-Hand-Side Expressions\n\nfunction parseArguments() {\n const args = [];\n expect('(');\n if (!match(')')) {\n while (index < length) {\n args.push(parseConditionalExpression());\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n expect(')');\n return args;\n}\nfunction parseNonComputedProperty() {\n index = lookahead.start;\n const token = lex();\n if (!isIdentifierName(token)) {\n throwUnexpected(token);\n }\n return finishIdentifier(token.value);\n}\nfunction parseNonComputedMember() {\n expect('.');\n return parseNonComputedProperty();\n}\nfunction parseComputedMember() {\n expect('[');\n const expr = parseExpression();\n expect(']');\n return expr;\n}\nfunction parseLeftHandSideExpressionAllowCall() {\n var expr, args, property;\n expr = parsePrimaryExpression();\n for (;;) {\n if (match('.')) {\n property = parseNonComputedMember();\n expr = finishMemberExpression('.', expr, property);\n } else if (match('(')) {\n args = parseArguments();\n expr = finishCallExpression(expr, args);\n } else if (match('[')) {\n property = parseComputedMember();\n expr = finishMemberExpression('[', expr, property);\n } else {\n break;\n }\n }\n return expr;\n}\n\n// 11.3 Postfix Expressions\n\nfunction parsePostfixExpression() {\n const expr = parseLeftHandSideExpressionAllowCall();\n if (lookahead.type === TokenPunctuator) {\n if (match('++') || match('--')) {\n throw new Error(DISABLED);\n }\n }\n return expr;\n}\n\n// 11.4 Unary Operators\n\nfunction parseUnaryExpression() {\n var token, expr;\n if (lookahead.type !== TokenPunctuator && lookahead.type !== TokenKeyword) {\n expr = parsePostfixExpression();\n } else if (match('++') || match('--')) {\n throw new Error(DISABLED);\n } else if (match('+') || match('-') || match('~') || match('!')) {\n token = lex();\n expr = parseUnaryExpression();\n expr = finishUnaryExpression(token.value, expr);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n throw new Error(DISABLED);\n } else {\n expr = parsePostfixExpression();\n }\n return expr;\n}\nfunction binaryPrecedence(token) {\n let prec = 0;\n if (token.type !== TokenPunctuator && token.type !== TokenKeyword) {\n return 0;\n }\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n case '&&':\n prec = 2;\n break;\n case '|':\n prec = 3;\n break;\n case '^':\n prec = 4;\n break;\n case '&':\n prec = 5;\n break;\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n case 'in':\n prec = 7;\n break;\n case '<<':\n case '>>':\n case '>>>':\n prec = 8;\n break;\n case '+':\n case '-':\n prec = 9;\n break;\n case '*':\n case '/':\n case '%':\n prec = 11;\n break;\n }\n return prec;\n}\n\n// 11.5 Multiplicative Operators\n// 11.6 Additive Operators\n// 11.7 Bitwise Shift Operators\n// 11.8 Relational Operators\n// 11.9 Equality Operators\n// 11.10 Binary Bitwise Operators\n// 11.11 Binary Logical Operators\n\nfunction parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n marker = lookahead;\n left = parseUnaryExpression();\n token = lookahead;\n prec = binaryPrecedence(token);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n stack = [left, token, right];\n while ((prec = binaryPrecedence(lookahead)) > 0) {\n // Reduce: make a binary expression from the three topmost entries.\n while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = finishBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n markers.pop();\n expr = finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n return expr;\n}\n\n// 11.12 Conditional Operator\n\nfunction parseConditionalExpression() {\n var expr, consequent, alternate;\n expr = parseBinaryExpression();\n if (match('?')) {\n lex();\n consequent = parseConditionalExpression();\n expect(':');\n alternate = parseConditionalExpression();\n expr = finishConditionalExpression(expr, consequent, alternate);\n }\n return expr;\n}\n\n// 11.14 Comma Operator\n\nfunction parseExpression() {\n const expr = parseConditionalExpression();\n if (match(',')) {\n throw new Error(DISABLED); // no sequence expressions\n }\n\n return expr;\n}\nfunction parser (code) {\n source = code;\n index = 0;\n length = source.length;\n lookahead = null;\n peek();\n const expr = parseExpression();\n if (lookahead.type !== TokenEOF) {\n throw new Error('Unexpect token after expression.');\n }\n return expr;\n}\n\nvar Constants = {\n NaN: 'NaN',\n E: 'Math.E',\n LN2: 'Math.LN2',\n LN10: 'Math.LN10',\n LOG2E: 'Math.LOG2E',\n LOG10E: 'Math.LOG10E',\n PI: 'Math.PI',\n SQRT1_2: 'Math.SQRT1_2',\n SQRT2: 'Math.SQRT2',\n MIN_VALUE: 'Number.MIN_VALUE',\n MAX_VALUE: 'Number.MAX_VALUE'\n};\n\nfunction Functions (codegen) {\n function fncall(name, args, cast, type) {\n let obj = codegen(args[0]);\n if (cast) {\n obj = cast + '(' + obj + ')';\n if (cast.lastIndexOf('new ', 0) === 0) obj = '(' + obj + ')';\n }\n return obj + '.' + name + (type < 0 ? '' : type === 0 ? '()' : '(' + args.slice(1).map(codegen).join(',') + ')');\n }\n function fn(name, cast, type) {\n return args => fncall(name, args, cast, type);\n }\n const DATE = 'new Date',\n STRING = 'String',\n REGEXP = 'RegExp';\n return {\n // MATH functions\n isNaN: 'Number.isNaN',\n isFinite: 'Number.isFinite',\n abs: 'Math.abs',\n acos: 'Math.acos',\n asin: 'Math.asin',\n atan: 'Math.atan',\n atan2: 'Math.atan2',\n ceil: 'Math.ceil',\n cos: 'Math.cos',\n exp: 'Math.exp',\n floor: 'Math.floor',\n log: 'Math.log',\n max: 'Math.max',\n min: 'Math.min',\n pow: 'Math.pow',\n random: 'Math.random',\n round: 'Math.round',\n sin: 'Math.sin',\n sqrt: 'Math.sqrt',\n tan: 'Math.tan',\n clamp: function (args) {\n if (args.length < 3) error('Missing arguments to clamp function.');\n if (args.length > 3) error('Too many arguments to clamp function.');\n const a = args.map(codegen);\n return 'Math.max(' + a[1] + ', Math.min(' + a[2] + ',' + a[0] + '))';\n },\n // DATE functions\n now: 'Date.now',\n utc: 'Date.UTC',\n datetime: DATE,\n date: fn('getDate', DATE, 0),\n day: fn('getDay', DATE, 0),\n year: fn('getFullYear', DATE, 0),\n month: fn('getMonth', DATE, 0),\n hours: fn('getHours', DATE, 0),\n minutes: fn('getMinutes', DATE, 0),\n seconds: fn('getSeconds', DATE, 0),\n milliseconds: fn('getMilliseconds', DATE, 0),\n time: fn('getTime', DATE, 0),\n timezoneoffset: fn('getTimezoneOffset', DATE, 0),\n utcdate: fn('getUTCDate', DATE, 0),\n utcday: fn('getUTCDay', DATE, 0),\n utcyear: fn('getUTCFullYear', DATE, 0),\n utcmonth: fn('getUTCMonth', DATE, 0),\n utchours: fn('getUTCHours', DATE, 0),\n utcminutes: fn('getUTCMinutes', DATE, 0),\n utcseconds: fn('getUTCSeconds', DATE, 0),\n utcmilliseconds: fn('getUTCMilliseconds', DATE, 0),\n // sequence functions\n length: fn('length', null, -1),\n // STRING functions\n parseFloat: 'parseFloat',\n parseInt: 'parseInt',\n upper: fn('toUpperCase', STRING, 0),\n lower: fn('toLowerCase', STRING, 0),\n substring: fn('substring', STRING),\n split: fn('split', STRING),\n trim: fn('trim', STRING, 0),\n // REGEXP functions\n regexp: REGEXP,\n test: fn('test', REGEXP),\n // Control Flow functions\n if: function (args) {\n if (args.length < 3) error('Missing arguments to if function.');\n if (args.length > 3) error('Too many arguments to if function.');\n const a = args.map(codegen);\n return '(' + a[0] + '?' + a[1] + ':' + a[2] + ')';\n }\n };\n}\n\nfunction stripQuotes(s) {\n const n = s && s.length - 1;\n return n && (s[0] === '\"' && s[n] === '\"' || s[0] === '\\'' && s[n] === '\\'') ? s.slice(1, -1) : s;\n}\nfunction codegen (opt) {\n opt = opt || {};\n const allowed = opt.allowed ? toSet(opt.allowed) : {},\n forbidden = opt.forbidden ? toSet(opt.forbidden) : {},\n constants = opt.constants || Constants,\n functions = (opt.functions || Functions)(visit),\n globalvar = opt.globalvar,\n fieldvar = opt.fieldvar,\n outputGlobal = isFunction(globalvar) ? globalvar : id => `${globalvar}[\"${id}\"]`;\n let globals = {},\n fields = {},\n memberDepth = 0;\n function visit(ast) {\n if (isString(ast)) return ast;\n const generator = Generators[ast.type];\n if (generator == null) error('Unsupported type: ' + ast.type);\n return generator(ast);\n }\n const Generators = {\n Literal: n => n.raw,\n Identifier: n => {\n const id = n.name;\n if (memberDepth > 0) {\n return id;\n } else if (hasOwnProperty(forbidden, id)) {\n return error('Illegal identifier: ' + id);\n } else if (hasOwnProperty(constants, id)) {\n return constants[id];\n } else if (hasOwnProperty(allowed, id)) {\n return id;\n } else {\n globals[id] = 1;\n return outputGlobal(id);\n }\n },\n MemberExpression: n => {\n const d = !n.computed,\n o = visit(n.object);\n if (d) memberDepth += 1;\n const p = visit(n.property);\n if (o === fieldvar) {\n // strip quotes to sanitize field name (#1653)\n fields[stripQuotes(p)] = 1;\n }\n if (d) memberDepth -= 1;\n return o + (d ? '.' + p : '[' + p + ']');\n },\n CallExpression: n => {\n if (n.callee.type !== 'Identifier') {\n error('Illegal callee type: ' + n.callee.type);\n }\n const callee = n.callee.name,\n args = n.arguments,\n fn = hasOwnProperty(functions, callee) && functions[callee];\n if (!fn) error('Unrecognized function: ' + callee);\n return isFunction(fn) ? fn(args) : fn + '(' + args.map(visit).join(',') + ')';\n },\n ArrayExpression: n => '[' + n.elements.map(visit).join(',') + ']',\n BinaryExpression: n => '(' + visit(n.left) + ' ' + n.operator + ' ' + visit(n.right) + ')',\n UnaryExpression: n => '(' + n.operator + visit(n.argument) + ')',\n ConditionalExpression: n => '(' + visit(n.test) + '?' + visit(n.consequent) + ':' + visit(n.alternate) + ')',\n LogicalExpression: n => '(' + visit(n.left) + n.operator + visit(n.right) + ')',\n ObjectExpression: n => '{' + n.properties.map(visit).join(',') + '}',\n Property: n => {\n memberDepth += 1;\n const k = visit(n.key);\n memberDepth -= 1;\n return k + ':' + visit(n.value);\n }\n };\n function codegen(ast) {\n const result = {\n code: visit(ast),\n globals: Object.keys(globals),\n fields: Object.keys(fields)\n };\n globals = {};\n fields = {};\n return result;\n }\n codegen.functions = functions;\n codegen.constants = constants;\n return codegen;\n}\n\nexport { ASTNode, ArrayExpression, BinaryExpression, CallExpression, ConditionalExpression, Identifier, Literal, LogicalExpression, MemberExpression, ObjectExpression, Property, RawCode, UnaryExpression, codegen as codegenExpression, Constants as constants, Functions as functions, parser as parseExpression };\n","import {Adder} from \"d3-array\";\nimport {atan2, cos, quarterPi, radians, sin, tau} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nexport var areaRingSum = new Adder();\n\n// hello?\n\nvar areaSum = new Adder(),\n lambda00,\n phi00,\n lambda0,\n cosPhi0,\n sinPhi0;\n\nexport var areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaRingSum = new Adder();\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n var areaRing = +areaRingSum;\n areaSum.add(areaRing < 0 ? tau + areaRing : areaRing);\n this.lineStart = this.lineEnd = this.point = noop;\n },\n sphere: function() {\n areaSum.add(tau);\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaRingEnd() {\n areaPoint(lambda00, phi00);\n}\n\nfunction areaPointFirst(lambda, phi) {\n areaStream.point = areaPoint;\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi);\n}\n\nfunction areaPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n phi = phi / 2 + quarterPi; // half the angular distance from south pole\n\n // Spherical excess E for a spherical triangle with vertices: south pole,\n // previous point, current point. Uses a formula derived from Cagnoli’s\n // theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2).\n var dLambda = lambda - lambda0,\n sdLambda = dLambda >= 0 ? 1 : -1,\n adLambda = sdLambda * dLambda,\n cosPhi = cos(phi),\n sinPhi = sin(phi),\n k = sinPhi0 * sinPhi,\n u = cosPhi0 * cosPhi + k * cos(adLambda),\n v = k * sdLambda * sin(adLambda);\n areaRingSum.add(atan2(v, u));\n\n // Advance the previous points.\n lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;\n}\n\nexport default function(object) {\n areaSum = new Adder();\n stream(object, areaStream);\n return areaSum * 2;\n}\n","import {Adder} from \"d3-array\";\nimport {areaStream, areaRingSum} from \"./area.js\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport {abs, degrees, epsilon, radians} from \"./math.js\";\nimport stream from \"./stream.js\";\n\nvar lambda0, phi0, lambda1, phi1, // bounds\n lambda2, // previous lambda-coordinate\n lambda00, phi00, // first point\n p0, // previous 3D point\n deltaSum,\n ranges,\n range;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: boundsLineStart,\n lineEnd: boundsLineEnd,\n polygonStart: function() {\n boundsStream.point = boundsRingPoint;\n boundsStream.lineStart = boundsRingStart;\n boundsStream.lineEnd = boundsRingEnd;\n deltaSum = new Adder();\n areaStream.polygonStart();\n },\n polygonEnd: function() {\n areaStream.polygonEnd();\n boundsStream.point = boundsPoint;\n boundsStream.lineStart = boundsLineStart;\n boundsStream.lineEnd = boundsLineEnd;\n if (areaRingSum < 0) lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n else if (deltaSum > epsilon) phi1 = 90;\n else if (deltaSum < -epsilon) phi0 = -90;\n range[0] = lambda0, range[1] = lambda1;\n },\n sphere: function() {\n lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n }\n};\n\nfunction boundsPoint(lambda, phi) {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n}\n\nfunction linePoint(lambda, phi) {\n var p = cartesian([lambda * radians, phi * radians]);\n if (p0) {\n var normal = cartesianCross(p0, p),\n equatorial = [normal[1], -normal[0], 0],\n inflection = cartesianCross(equatorial, normal);\n cartesianNormalizeInPlace(inflection);\n inflection = spherical(inflection);\n var delta = lambda - lambda2,\n sign = delta > 0 ? 1 : -1,\n lambdai = inflection[0] * degrees * sign,\n phii,\n antimeridian = abs(delta) > 180;\n if (antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = inflection[1] * degrees;\n if (phii > phi1) phi1 = phii;\n } else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = -inflection[1] * degrees;\n if (phii < phi0) phi0 = phii;\n } else {\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n }\n if (antimeridian) {\n if (lambda < lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n } else {\n if (lambda1 >= lambda0) {\n if (lambda < lambda0) lambda0 = lambda;\n if (lambda > lambda1) lambda1 = lambda;\n } else {\n if (lambda > lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n }\n }\n } else {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n }\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n p0 = p, lambda2 = lambda;\n}\n\nfunction boundsLineStart() {\n boundsStream.point = linePoint;\n}\n\nfunction boundsLineEnd() {\n range[0] = lambda0, range[1] = lambda1;\n boundsStream.point = boundsPoint;\n p0 = null;\n}\n\nfunction boundsRingPoint(lambda, phi) {\n if (p0) {\n var delta = lambda - lambda2;\n deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);\n } else {\n lambda00 = lambda, phi00 = phi;\n }\n areaStream.point(lambda, phi);\n linePoint(lambda, phi);\n}\n\nfunction boundsRingStart() {\n areaStream.lineStart();\n}\n\nfunction boundsRingEnd() {\n boundsRingPoint(lambda00, phi00);\n areaStream.lineEnd();\n if (abs(deltaSum) > epsilon) lambda0 = -(lambda1 = 180);\n range[0] = lambda0, range[1] = lambda1;\n p0 = null;\n}\n\n// Finds the left-right distance between two longitudes.\n// This is almost the same as (lambda1 - lambda0 + 360°) % 360°, except that we want\n// the distance between ±180° to be 360°.\nfunction angle(lambda0, lambda1) {\n return (lambda1 -= lambda0) < 0 ? lambda1 + 360 : lambda1;\n}\n\nfunction rangeCompare(a, b) {\n return a[0] - b[0];\n}\n\nfunction rangeContains(range, x) {\n return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;\n}\n\nexport default function(feature) {\n var i, n, a, b, merged, deltaMax, delta;\n\n phi1 = lambda1 = -(lambda0 = phi0 = Infinity);\n ranges = [];\n stream(feature, boundsStream);\n\n // First, sort ranges by their minimum longitudes.\n if (n = ranges.length) {\n ranges.sort(rangeCompare);\n\n // Then, merge any ranges that overlap.\n for (i = 1, a = ranges[0], merged = [a]; i < n; ++i) {\n b = ranges[i];\n if (rangeContains(a, b[0]) || rangeContains(a, b[1])) {\n if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];\n if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];\n } else {\n merged.push(a = b);\n }\n }\n\n // Finally, find the largest gap between the merged ranges.\n // The final bounding box will be the inverse of this gap.\n for (deltaMax = -Infinity, n = merged.length - 1, i = 0, a = merged[n]; i <= n; a = b, ++i) {\n b = merged[i];\n if ((delta = angle(a[1], b[0])) > deltaMax) deltaMax = delta, lambda0 = b[0], lambda1 = a[1];\n }\n }\n\n ranges = range = null;\n\n return lambda0 === Infinity || phi0 === Infinity\n ? [[NaN, NaN], [NaN, NaN]]\n : [[lambda0, phi0], [lambda1, phi1]];\n}\n","import {Adder} from \"d3-array\";\nimport {asin, atan2, cos, degrees, epsilon, epsilon2, hypot, radians, sin, sqrt} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nvar W0, W1,\n X0, Y0, Z0,\n X1, Y1, Z1,\n X2, Y2, Z2,\n lambda00, phi00, // first point\n x0, y0, z0; // previous point\n\nvar centroidStream = {\n sphere: noop,\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n }\n};\n\n// Arithmetic mean of Cartesian vectors.\nfunction centroidPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n centroidPointCartesian(cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi));\n}\n\nfunction centroidPointCartesian(x, y, z) {\n ++W0;\n X0 += (x - X0) / W0;\n Y0 += (y - Y0) / W0;\n Z0 += (z - Z0) / W0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidLinePointFirst;\n}\n\nfunction centroidLinePointFirst(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidStream.point = centroidLinePoint;\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLinePoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n w = atan2(sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\n// See J. E. Brock, The Inertia Tensor for a Spherical Triangle,\n// J. Applied Mechanics 42, 239 (1975).\nfunction centroidRingStart() {\n centroidStream.point = centroidRingPointFirst;\n}\n\nfunction centroidRingEnd() {\n centroidRingPoint(lambda00, phi00);\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingPointFirst(lambda, phi) {\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n centroidStream.point = centroidRingPoint;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidRingPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n cx = y0 * z - z0 * y,\n cy = z0 * x - x0 * z,\n cz = x0 * y - y0 * x,\n m = hypot(cx, cy, cz),\n w = asin(m), // line weight = angle\n v = m && -w / m; // area weight multiplier\n X2.add(v * cx);\n Y2.add(v * cy);\n Z2.add(v * cz);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nexport default function(object) {\n W0 = W1 =\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 = 0;\n X2 = new Adder();\n Y2 = new Adder();\n Z2 = new Adder();\n stream(object, centroidStream);\n\n var x = +X2,\n y = +Y2,\n z = +Z2,\n m = hypot(x, y, z);\n\n // If the area-weighted ccentroid is undefined, fall back to length-weighted ccentroid.\n if (m < epsilon2) {\n x = X1, y = Y1, z = Z1;\n // If the feature has zero length, fall back to arithmetic mean of point vectors.\n if (W1 < epsilon) x = X0, y = Y0, z = Z0;\n m = hypot(x, y, z);\n // If the feature still has an undefined ccentroid, then return.\n if (m < epsilon2) return [NaN, NaN];\n }\n\n return [atan2(y, x) * degrees, asin(z / m) * degrees];\n}\n","export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n","import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can’t do this\n // for a comparator (except for specific, known comparators) because we can’t\n // tell if the comparator is symmetric, and an asymmetric comparator can’t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n","import {InternSet} from \"internmap\";\n\nexport default function intersection(values, ...others) {\n values = new InternSet(values);\n others = others.map(set);\n out: for (const value of values) {\n for (const other of others) {\n if (!other.has(value)) {\n values.delete(value);\n continue out;\n }\n }\n }\n return values;\n}\n\nfunction set(values) {\n return values instanceof InternSet ? values : new InternSet(values);\n}\n","import { bisector, union, intersection } from 'd3-array';\nimport { field, isDate, toNumber, isArray, inrange, extend, array, error, peek, hasOwnProperty } from 'vega-util';\nimport { Literal } from 'vega-expression';\n\nconst Intersect = 'intersect';\nconst Union = 'union';\nconst VlMulti = 'vlMulti';\nconst VlPoint = 'vlPoint';\nconst Or = 'or';\nconst And = 'and';\nconst SelectionId = '_vgsid_';\nconst $selectionId = field(SelectionId);\n\nconst TYPE_ENUM = 'E',\n TYPE_RANGE_INC = 'R',\n TYPE_RANGE_EXC = 'R-E',\n TYPE_RANGE_LE = 'R-LE',\n TYPE_RANGE_RE = 'R-RE',\n UNIT_INDEX = 'index:unit';\n\n// TODO: revisit date coercion?\nfunction testPoint(datum, entry) {\n var fields = entry.fields,\n values = entry.values,\n n = fields.length,\n i = 0,\n dval,\n f;\n for (; i < n; ++i) {\n f = fields[i];\n f.getter = field.getter || field(f.field);\n dval = f.getter(datum);\n if (isDate(dval)) dval = toNumber(dval);\n if (isDate(values[i])) values[i] = toNumber(values[i]);\n if (isDate(values[i][0])) values[i] = values[i].map(toNumber);\n if (f.type === TYPE_ENUM) {\n // Enumerated fields can either specify individual values (single/multi selections)\n // or an array of values (interval selections).\n if (isArray(values[i]) ? values[i].indexOf(dval) < 0 : dval !== values[i]) {\n return false;\n }\n } else {\n if (f.type === TYPE_RANGE_INC) {\n if (!inrange(dval, values[i])) return false;\n } else if (f.type === TYPE_RANGE_RE) {\n // Discrete selection of bins test within the range [bin_start, bin_end).\n if (!inrange(dval, values[i], true, false)) return false;\n } else if (f.type === TYPE_RANGE_EXC) {\n // 'R-E'/'R-LE' included for completeness.\n if (!inrange(dval, values[i], false, false)) return false;\n } else if (f.type === TYPE_RANGE_LE) {\n if (!inrange(dval, values[i], false, true)) return false;\n }\n }\n }\n return true;\n}\n\n/**\n * Tests if a tuple is contained within an interactive selection.\n * @param {string} name - The name of the data set representing the selection.\n * Tuples in the dataset are of the form\n * {unit: string, fields: array, values: array<*>}.\n * Fielddef is of the form\n * {field: string, channel: string, type: 'E' | 'R'} where\n * 'type' identifies whether tuples in the dataset enumerate\n * values for the field, or specify a continuous range.\n * @param {object} datum - The tuple to test for inclusion.\n * @param {string} op - The set operation for combining selections.\n * One of 'intersect' or 'union' (default).\n * @return {boolean} - True if the datum is in the selection, false otherwise.\n */\nfunction selectionTest(name, datum, op) {\n var data = this.context.data[name],\n entries = data ? data.values.value : [],\n unitIdx = data ? data[UNIT_INDEX] && data[UNIT_INDEX].value : undefined,\n intersect = op === Intersect,\n n = entries.length,\n i = 0,\n entry,\n miss,\n count,\n unit,\n b;\n for (; i < n; ++i) {\n entry = entries[i];\n if (unitIdx && intersect) {\n // multi selections union within the same unit and intersect across units.\n miss = miss || {};\n count = miss[unit = entry.unit] || 0;\n\n // if we've already matched this unit, skip.\n if (count === -1) continue;\n b = testPoint(datum, entry);\n miss[unit] = b ? -1 : ++count;\n\n // if we match and there are no other units return true\n // if we've missed against all tuples in this unit return false\n if (b && unitIdx.size === 1) return true;\n if (!b && count === unitIdx.get(unit).count) return false;\n } else {\n b = testPoint(datum, entry);\n\n // if we find a miss and we do require intersection return false\n // if we find a match and we don't require intersection return true\n if (intersect ^ b) return b;\n }\n }\n\n // if intersecting and we made it here, then we saw no misses\n // if not intersecting, then we saw no matches\n // if no active selections, return false\n return n && intersect;\n}\nconst bisect = bisector($selectionId),\n bisectLeft = bisect.left,\n bisectRight = bisect.right;\nfunction selectionIdTest(name, datum, op) {\n const data = this.context.data[name],\n entries = data ? data.values.value : [],\n unitIdx = data ? data[UNIT_INDEX] && data[UNIT_INDEX].value : undefined,\n intersect = op === Intersect,\n value = $selectionId(datum),\n index = bisectLeft(entries, value);\n if (index === entries.length) return false;\n if ($selectionId(entries[index]) !== value) return false;\n if (unitIdx && intersect) {\n if (unitIdx.size === 1) return true;\n if (bisectRight(entries, value) - index < unitIdx.size) return false;\n }\n return true;\n}\n\n/**\n * Maps an array of scene graph items to an array of selection tuples.\n * @param {string} name - The name of the dataset representing the selection.\n * @param {string} base - The base object that generated tuples extend.\n *\n * @returns {array} An array of selection entries for the given unit.\n */\nfunction selectionTuples(array, base) {\n return array.map(x => extend(base.fields ? {\n values: base.fields.map(f => (f.getter || (f.getter = field(f.field)))(x.datum))\n } : {\n [SelectionId]: $selectionId(x.datum)\n }, base));\n}\n\n/**\n * Resolves selection for use as a scale domain or reads via the API.\n * @param {string} name - The name of the dataset representing the selection\n * @param {string} [op='union'] - The set operation for combining selections.\n * One of 'intersect' or 'union' (default).\n * @param {boolean} isMulti - Identifies a \"multi\" selection to perform more\n * expensive resolution computation.\n * @param {boolean} vl5 - With Vega-Lite v5, \"multi\" selections are now called \"point\"\n * selections, and thus the resolved tuple should reflect this name.\n * This parameter allows us to reflect this change without triggering\n * a major version bump for Vega.\n * @returns {object} An object of selected fields and values.\n */\nfunction selectionResolve(name, op, isMulti, vl5) {\n var data = this.context.data[name],\n entries = data ? data.values.value : [],\n resolved = {},\n multiRes = {},\n types = {},\n entry,\n fields,\n values,\n unit,\n field,\n value,\n res,\n resUnit,\n type,\n union,\n n = entries.length,\n i = 0,\n j,\n m;\n\n // First union all entries within the same unit.\n for (; i < n; ++i) {\n entry = entries[i];\n unit = entry.unit;\n fields = entry.fields;\n values = entry.values;\n if (fields && values) {\n // Intentional selection stores\n for (j = 0, m = fields.length; j < m; ++j) {\n field = fields[j];\n res = resolved[field.field] || (resolved[field.field] = {});\n resUnit = res[unit] || (res[unit] = []);\n types[field.field] = type = field.type.charAt(0);\n union = ops[`${type}_union`];\n res[unit] = union(resUnit, array(values[j]));\n }\n\n // If the same multi-selection is repeated over views and projected over\n // an encoding, it may operate over different fields making it especially\n // tricky to reliably resolve it. At best, we can de-dupe identical entries\n // but doing so may be more computationally expensive than it is worth.\n // Instead, for now, we simply transform our store representation into\n // a more human-friendly one.\n if (isMulti) {\n resUnit = multiRes[unit] || (multiRes[unit] = []);\n resUnit.push(array(values).reduce((obj, curr, j) => (obj[fields[j].field] = curr, obj), {}));\n }\n } else {\n // Short circuit extensional selectionId stores which hold sorted IDs unique to each unit.\n field = SelectionId;\n value = $selectionId(entry);\n res = resolved[field] || (resolved[field] = {});\n resUnit = res[unit] || (res[unit] = []);\n resUnit.push(value);\n if (isMulti) {\n resUnit = multiRes[unit] || (multiRes[unit] = []);\n resUnit.push({\n [SelectionId]: value\n });\n }\n }\n }\n\n // Then resolve fields across units as per the op.\n op = op || Union;\n if (resolved[SelectionId]) {\n resolved[SelectionId] = ops[`${SelectionId}_${op}`](...Object.values(resolved[SelectionId]));\n } else {\n Object.keys(resolved).forEach(field => {\n resolved[field] = Object.keys(resolved[field]).map(unit => resolved[field][unit]).reduce((acc, curr) => acc === undefined ? curr : ops[`${types[field]}_${op}`](acc, curr));\n });\n }\n entries = Object.keys(multiRes);\n if (isMulti && entries.length) {\n const key = vl5 ? VlPoint : VlMulti;\n resolved[key] = op === Union ? {\n [Or]: entries.reduce((acc, k) => (acc.push(...multiRes[k]), acc), [])\n } : {\n [And]: entries.map(k => ({\n [Or]: multiRes[k]\n }))\n };\n }\n return resolved;\n}\nvar ops = {\n [`${SelectionId}_union`]: union,\n [`${SelectionId}_intersect`]: intersection,\n E_union: function (base, value) {\n if (!base.length) return value;\n var i = 0,\n n = value.length;\n for (; i < n; ++i) if (base.indexOf(value[i]) < 0) base.push(value[i]);\n return base;\n },\n E_intersect: function (base, value) {\n return !base.length ? value : base.filter(v => value.indexOf(v) >= 0);\n },\n R_union: function (base, value) {\n var lo = toNumber(value[0]),\n hi = toNumber(value[1]);\n if (lo > hi) {\n lo = value[1];\n hi = value[0];\n }\n if (!base.length) return [lo, hi];\n if (base[0] > lo) base[0] = lo;\n if (base[1] < hi) base[1] = hi;\n return base;\n },\n R_intersect: function (base, value) {\n var lo = toNumber(value[0]),\n hi = toNumber(value[1]);\n if (lo > hi) {\n lo = value[1];\n hi = value[0];\n }\n if (!base.length) return [lo, hi];\n if (hi < base[0] || base[1] < lo) {\n return [];\n } else {\n if (base[0] < lo) base[0] = lo;\n if (base[1] > hi) base[1] = hi;\n }\n return base;\n }\n};\n\nconst DataPrefix = ':',\n IndexPrefix = '@';\nfunction selectionVisitor(name, args, scope, params) {\n if (args[0].type !== Literal) error('First argument to selection functions must be a string literal.');\n const data = args[0].value,\n op = args.length >= 2 && peek(args).value,\n field = 'unit',\n indexName = IndexPrefix + field,\n dataName = DataPrefix + data;\n\n // eslint-disable-next-line no-prototype-builtins\n if (op === Intersect && !hasOwnProperty(params, indexName)) {\n params[indexName] = scope.getData(data).indataRef(scope, field);\n }\n\n // eslint-disable-next-line no-prototype-builtins\n if (!hasOwnProperty(params, dataName)) {\n params[dataName] = scope.getData(data).tuplesRef();\n }\n}\n\nexport { selectionIdTest, selectionResolve, selectionTest, selectionTuples, selectionVisitor };\n","import {InternSet} from \"internmap\";\n\nexport default function union(...others) {\n const set = new InternSet();\n for (const other of others) {\n for (const o of other) {\n set.add(o);\n }\n }\n return set;\n}\n","import { truthy, error, hasOwnProperty, isFunction, isString, stringValue, extend, isArray, isObject, field, peek, identity, array as array$1, isBoolean, isDate, isNumber, isRegExp, toBoolean, toDate, toNumber, toString, flush, lerp, pad, span, inrange, truncate, quarter, utcquarter, extent, clampRange, panLinear, panLog, panPow, panSymlog, zoomLinear, zoomLog, zoomPow, zoomSymlog } from 'vega-util';\nimport { Literal, codegenExpression, constants, functions, parseExpression, CallExpression } from 'vega-expression';\nimport { isRegisteredScale, bandSpace, scale as scale$1, scaleFraction } from 'vega-scale';\nimport { geoArea as geoArea$1, geoBounds as geoBounds$1, geoCentroid as geoCentroid$1 } from 'd3-geo';\nimport { rgb, lab, hcl, hsl } from 'd3-color';\nimport { isTuple } from 'vega-dataflow';\nimport { Gradient, pathRender, pathParse, Bounds, intersect as intersect$1 } from 'vega-scenegraph';\nimport { selectionVisitor, selectionTest, selectionIdTest, selectionResolve, selectionTuples } from 'vega-selections';\nimport { random, cumulativeNormal, cumulativeLogNormal, cumulativeUniform, densityNormal, densityLogNormal, densityUniform, quantileNormal, quantileLogNormal, quantileUniform, sampleNormal, sampleLogNormal, sampleUniform } from 'vega-statistics';\nimport { utcOffset, utcSequence, timeOffset, timeSequence, timeUnitSpecifier, week, utcweek, dayofyear, utcdayofyear } from 'vega-time';\nimport { range as range$1 } from 'd3-array';\n\nfunction data(name) {\n const data = this.context.data[name];\n return data ? data.values.value : [];\n}\nfunction indata(name, field, value) {\n const index = this.context.data[name]['index:' + field],\n entry = index ? index.value.get(value) : undefined;\n return entry ? entry.count : entry;\n}\nfunction setdata(name, tuples) {\n const df = this.context.dataflow,\n data = this.context.data[name],\n input = data.input;\n df.pulse(input, df.changeset().remove(truthy).insert(tuples));\n return 1;\n}\n\nfunction encode (item, name, retval) {\n if (item) {\n const df = this.context.dataflow,\n target = item.mark.source;\n df.pulse(target, df.changeset().encode(item, name));\n }\n return retval !== undefined ? retval : item;\n}\n\nconst wrap = method => function (value, spec) {\n const locale = this.context.dataflow.locale();\n return locale[method](spec)(value);\n};\nconst format = wrap('format');\nconst timeFormat = wrap('timeFormat');\nconst utcFormat = wrap('utcFormat');\nconst timeParse = wrap('timeParse');\nconst utcParse = wrap('utcParse');\nconst dateObj = new Date(2000, 0, 1);\nfunction time(month, day, specifier) {\n if (!Number.isInteger(month) || !Number.isInteger(day)) return '';\n dateObj.setYear(2000);\n dateObj.setMonth(month);\n dateObj.setDate(day);\n return timeFormat.call(this, dateObj, specifier);\n}\nfunction monthFormat(month) {\n return time.call(this, month, 1, '%B');\n}\nfunction monthAbbrevFormat(month) {\n return time.call(this, month, 1, '%b');\n}\nfunction dayFormat(day) {\n return time.call(this, 0, 2 + day, '%A');\n}\nfunction dayAbbrevFormat(day) {\n return time.call(this, 0, 2 + day, '%a');\n}\n\nconst DataPrefix = ':';\nconst IndexPrefix = '@';\nconst ScalePrefix = '%';\nconst SignalPrefix = '$';\n\nfunction dataVisitor(name, args, scope, params) {\n if (args[0].type !== Literal) {\n error('First argument to data functions must be a string literal.');\n }\n const data = args[0].value,\n dataName = DataPrefix + data;\n if (!hasOwnProperty(dataName, params)) {\n try {\n params[dataName] = scope.getData(data).tuplesRef();\n } catch (err) {\n // if data set does not exist, there's nothing to track\n }\n }\n}\nfunction indataVisitor(name, args, scope, params) {\n if (args[0].type !== Literal) error('First argument to indata must be a string literal.');\n if (args[1].type !== Literal) error('Second argument to indata must be a string literal.');\n const data = args[0].value,\n field = args[1].value,\n indexName = IndexPrefix + field;\n if (!hasOwnProperty(indexName, params)) {\n params[indexName] = scope.getData(data).indataRef(scope, field);\n }\n}\nfunction scaleVisitor(name, args, scope, params) {\n if (args[0].type === Literal) {\n // add scale dependency\n addScaleDependency(scope, params, args[0].value);\n } else {\n // indirect scale lookup; add all scales as parameters\n for (name in scope.scales) {\n addScaleDependency(scope, params, name);\n }\n }\n}\nfunction addScaleDependency(scope, params, name) {\n const scaleName = ScalePrefix + name;\n if (!hasOwnProperty(params, scaleName)) {\n try {\n params[scaleName] = scope.scaleRef(name);\n } catch (err) {\n // TODO: error handling? warning?\n }\n }\n}\n\nfunction getScale(nameOrFunction, ctx) {\n if (isFunction(nameOrFunction)) {\n return nameOrFunction;\n }\n if (isString(nameOrFunction)) {\n const maybeScale = ctx.scales[nameOrFunction];\n return maybeScale && isRegisteredScale(maybeScale.value) ? maybeScale.value : undefined;\n }\n return undefined;\n}\nfunction internalScaleFunctions(codegen, fnctx, visitors) {\n // add helper method to the 'this' expression function context\n fnctx.__bandwidth = s => s && s.bandwidth ? s.bandwidth() : 0;\n\n // register AST visitors for internal scale functions\n visitors._bandwidth = scaleVisitor;\n visitors._range = scaleVisitor;\n visitors._scale = scaleVisitor;\n\n // resolve scale reference directly to the signal hash argument\n const ref = arg => '_[' + (arg.type === Literal ? stringValue(ScalePrefix + arg.value) : stringValue(ScalePrefix) + '+' + codegen(arg)) + ']';\n\n // define and return internal scale function code generators\n // these internal functions are called by mark encoders\n return {\n _bandwidth: args => `this.__bandwidth(${ref(args[0])})`,\n _range: args => `${ref(args[0])}.range()`,\n _scale: args => `${ref(args[0])}(${codegen(args[1])})`\n };\n}\n\nfunction geoMethod(methodName, globalMethod) {\n return function (projection, geojson, group) {\n if (projection) {\n // projection defined, use it\n const p = getScale(projection, (group || this).context);\n return p && p.path[methodName](geojson);\n } else {\n // projection undefined, use global method\n return globalMethod(geojson);\n }\n };\n}\nconst geoArea = geoMethod('area', geoArea$1);\nconst geoBounds = geoMethod('bounds', geoBounds$1);\nconst geoCentroid = geoMethod('centroid', geoCentroid$1);\n\nfunction inScope (item) {\n const group = this.context.group;\n let value = false;\n if (group) while (item) {\n if (item === group) {\n value = true;\n break;\n }\n item = item.mark.group;\n }\n return value;\n}\n\nfunction log(df, method, args) {\n try {\n df[method].apply(df, ['EXPRESSION'].concat([].slice.call(args)));\n } catch (err) {\n df.warn(err);\n }\n return args[args.length - 1];\n}\nfunction warn() {\n return log(this.context.dataflow, 'warn', arguments);\n}\nfunction info() {\n return log(this.context.dataflow, 'info', arguments);\n}\nfunction debug() {\n return log(this.context.dataflow, 'debug', arguments);\n}\n\n// https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\nfunction channel_luminance_value(channelValue) {\n const val = channelValue / 255;\n if (val <= 0.03928) {\n return val / 12.92;\n }\n return Math.pow((val + 0.055) / 1.055, 2.4);\n}\nfunction luminance(color) {\n const c = rgb(color),\n r = channel_luminance_value(c.r),\n g = channel_luminance_value(c.g),\n b = channel_luminance_value(c.b);\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n}\n\n// https://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef\nfunction contrast(color1, color2) {\n const lum1 = luminance(color1),\n lum2 = luminance(color2),\n lumL = Math.max(lum1, lum2),\n lumD = Math.min(lum1, lum2);\n return (lumL + 0.05) / (lumD + 0.05);\n}\n\nfunction merge () {\n const args = [].slice.call(arguments);\n args.unshift({});\n return extend(...args);\n}\n\nfunction equal(a, b) {\n return a === b || a !== a && b !== b ? true : isArray(a) ? isArray(b) && a.length === b.length ? equalArray(a, b) : false : isObject(a) && isObject(b) ? equalObject(a, b) : false;\n}\nfunction equalArray(a, b) {\n for (let i = 0, n = a.length; i < n; ++i) {\n if (!equal(a[i], b[i])) return false;\n }\n return true;\n}\nfunction equalObject(a, b) {\n for (const key in a) {\n if (!equal(a[key], b[key])) return false;\n }\n return true;\n}\nfunction removePredicate(props) {\n return _ => equalObject(props, _);\n}\nfunction modify (name, insert, remove, toggle, modify, values) {\n const df = this.context.dataflow,\n data = this.context.data[name],\n input = data.input,\n stamp = df.stamp();\n let changes = data.changes,\n predicate,\n key;\n if (df._trigger === false || !(input.value.length || insert || toggle)) {\n // nothing to do!\n return 0;\n }\n if (!changes || changes.stamp < stamp) {\n data.changes = changes = df.changeset();\n changes.stamp = stamp;\n df.runAfter(() => {\n data.modified = true;\n df.pulse(input, changes).run();\n }, true, 1);\n }\n if (remove) {\n predicate = remove === true ? truthy : isArray(remove) || isTuple(remove) ? remove : removePredicate(remove);\n changes.remove(predicate);\n }\n if (insert) {\n changes.insert(insert);\n }\n if (toggle) {\n predicate = removePredicate(toggle);\n if (input.value.some(predicate)) {\n changes.remove(predicate);\n } else {\n changes.insert(toggle);\n }\n }\n if (modify) {\n for (key in values) {\n changes.modify(modify, key, values[key]);\n }\n }\n return 1;\n}\n\nfunction pinchDistance(event) {\n const t = event.touches,\n dx = t[0].clientX - t[1].clientX,\n dy = t[0].clientY - t[1].clientY;\n return Math.sqrt(dx * dx + dy * dy);\n}\nfunction pinchAngle(event) {\n const t = event.touches;\n return Math.atan2(t[0].clientY - t[1].clientY, t[0].clientX - t[1].clientX);\n}\n\n// memoize accessor functions\nconst accessors = {};\nfunction pluck (data, name) {\n const accessor = accessors[name] || (accessors[name] = field(name));\n return isArray(data) ? data.map(accessor) : accessor(data);\n}\n\nfunction array(seq) {\n return isArray(seq) || ArrayBuffer.isView(seq) ? seq : null;\n}\nfunction sequence(seq) {\n return array(seq) || (isString(seq) ? seq : null);\n}\nfunction join(seq) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return array(seq).join(...args);\n}\nfunction indexof(seq) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n return sequence(seq).indexOf(...args);\n}\nfunction lastindexof(seq) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n return sequence(seq).lastIndexOf(...args);\n}\nfunction slice(seq) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n return sequence(seq).slice(...args);\n}\nfunction replace(str, pattern, repl) {\n if (isFunction(repl)) error('Function argument passed to replace.');\n return String(str).replace(pattern, repl);\n}\nfunction reverse(seq) {\n return array(seq).slice().reverse();\n}\n\nfunction bandspace(count, paddingInner, paddingOuter) {\n return bandSpace(count || 0, paddingInner || 0, paddingOuter || 0);\n}\nfunction bandwidth(name, group) {\n const s = getScale(name, (group || this).context);\n return s && s.bandwidth ? s.bandwidth() : 0;\n}\nfunction copy(name, group) {\n const s = getScale(name, (group || this).context);\n return s ? s.copy() : undefined;\n}\nfunction domain(name, group) {\n const s = getScale(name, (group || this).context);\n return s ? s.domain() : [];\n}\nfunction invert(name, range, group) {\n const s = getScale(name, (group || this).context);\n return !s ? undefined : isArray(range) ? (s.invertRange || s.invert)(range) : (s.invert || s.invertExtent)(range);\n}\nfunction range(name, group) {\n const s = getScale(name, (group || this).context);\n return s && s.range ? s.range() : [];\n}\nfunction scale(name, value, group) {\n const s = getScale(name, (group || this).context);\n return s ? s(value) : undefined;\n}\n\nfunction scaleGradient (scale, p0, p1, count, group) {\n scale = getScale(scale, (group || this).context);\n const gradient = Gradient(p0, p1);\n let stops = scale.domain(),\n min = stops[0],\n max = peek(stops),\n fraction = identity;\n if (!(max - min)) {\n // expand scale if domain has zero span, fix #1479\n scale = (scale.interpolator ? scale$1('sequential')().interpolator(scale.interpolator()) : scale$1('linear')().interpolate(scale.interpolate()).range(scale.range())).domain([min = 0, max = 1]);\n } else {\n fraction = scaleFraction(scale, min, max);\n }\n if (scale.ticks) {\n stops = scale.ticks(+count || 15);\n if (min !== stops[0]) stops.unshift(min);\n if (max !== peek(stops)) stops.push(max);\n }\n stops.forEach(_ => gradient.stop(fraction(_), scale(_)));\n return gradient;\n}\n\nfunction geoShape(projection, geojson, group) {\n const p = getScale(projection, (group || this).context);\n return function (context) {\n return p ? p.path.context(context)(geojson) : '';\n };\n}\nfunction pathShape(path) {\n let p = null;\n return function (context) {\n return context ? pathRender(context, p = p || pathParse(path)) : path;\n };\n}\n\nconst datum = d => d.data;\nfunction treeNodes(name, context) {\n const tree = data.call(context, name);\n return tree.root && tree.root.lookup || {};\n}\nfunction treePath(name, source, target) {\n const nodes = treeNodes(name, this),\n s = nodes[source],\n t = nodes[target];\n return s && t ? s.path(t).map(datum) : undefined;\n}\nfunction treeAncestors(name, node) {\n const n = treeNodes(name, this)[node];\n return n ? n.ancestors().map(datum) : undefined;\n}\n\nconst _window = () => typeof window !== 'undefined' && window || null;\nfunction screen() {\n const w = _window();\n return w ? w.screen : {};\n}\nfunction windowSize() {\n const w = _window();\n return w ? [w.innerWidth, w.innerHeight] : [undefined, undefined];\n}\nfunction containerSize() {\n const view = this.context.dataflow,\n el = view.container && view.container();\n return el ? [el.clientWidth, el.clientHeight] : [undefined, undefined];\n}\n\nfunction intersect (b, opt, group) {\n if (!b) return [];\n const [u, v] = b,\n box = new Bounds().set(u[0], u[1], v[0], v[1]),\n scene = group || this.context.dataflow.scenegraph().root;\n return intersect$1(scene, box, filter(opt));\n}\nfunction filter(opt) {\n let p = null;\n if (opt) {\n const types = array$1(opt.marktype),\n names = array$1(opt.markname);\n p = _ => (!types.length || types.some(t => _.marktype === t)) && (!names.length || names.some(s => _.name === s));\n }\n return p;\n}\n\n/**\n * Appends a new point to the lasso\n *\n * @param {*} lasso the lasso in pixel space\n * @param {*} x the x coordinate in pixel space\n * @param {*} y the y coordinate in pixel space\n * @param {*} minDist the minimum distance, in pixels, that thenew point needs to be apart from the last point\n * @returns a new array containing the lasso with the new point\n */\nfunction lassoAppend(lasso, x, y) {\n let minDist = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 5;\n lasso = array$1(lasso);\n const last = lasso[lasso.length - 1];\n\n // Add point to lasso if its the first point or distance to last point exceed minDist\n return last === undefined || Math.sqrt((last[0] - x) ** 2 + (last[1] - y) ** 2) > minDist ? [...lasso, [x, y]] : lasso;\n}\n\n/**\n * Generates a svg path command which draws a lasso\n *\n * @param {*} lasso the lasso in pixel space in the form [[x,y], [x,y], ...]\n * @returns the svg path command that draws the lasso\n */\nfunction lassoPath(lasso) {\n return array$1(lasso).reduce((svg, _ref, i) => {\n let [x, y] = _ref;\n return svg += i == 0 ? `M ${x},${y} ` : i === lasso.length - 1 ? ' Z' : `L ${x},${y} `;\n }, '');\n}\n\n/**\n * Inverts the lasso from pixel space to an array of vega scenegraph tuples\n *\n * @param {*} data the dataset\n * @param {*} pixelLasso the lasso in pixel space, [[x,y], [x,y], ...]\n * @param {*} unit the unit where the lasso is defined\n *\n * @returns an array of vega scenegraph tuples\n */\nfunction intersectLasso(markname, pixelLasso, unit) {\n const {\n x,\n y,\n mark\n } = unit;\n const bb = new Bounds().set(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER);\n\n // Get bounding box around lasso\n for (const [px, py] of pixelLasso) {\n if (px < bb.x1) bb.x1 = px;\n if (px > bb.x2) bb.x2 = px;\n if (py < bb.y1) bb.y1 = py;\n if (py > bb.y2) bb.y2 = py;\n }\n\n // Translate bb against unit coordinates\n bb.translate(x, y);\n const intersection = intersect([[bb.x1, bb.y1], [bb.x2, bb.y2]], markname, mark);\n\n // Check every point against the lasso\n return intersection.filter(tuple => pointInPolygon(tuple.x, tuple.y, pixelLasso));\n}\n\n/**\n * Performs a test if a point is inside a polygon based on the idea from\n * https://wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html\n *\n * This method will not need the same start/end point since it wraps around the edges of the array\n *\n * @param {*} test a point to test against\n * @param {*} polygon a polygon in the form [[x,y], [x,y], ...]\n * @returns true if the point lies inside the polygon, false otherwise\n */\nfunction pointInPolygon(testx, testy, polygon) {\n let intersections = 0;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const [prevX, prevY] = polygon[j];\n const [x, y] = polygon[i];\n\n // count intersections\n if (y > testy != prevY > testy && testx < (prevX - x) * (testy - y) / (prevY - y) + x) {\n intersections++;\n }\n }\n\n // point is in polygon if intersection count is odd\n return intersections & 1;\n}\n\n// Expression function context object\nconst functionContext = {\n random() {\n return random();\n },\n // override default\n cumulativeNormal,\n cumulativeLogNormal,\n cumulativeUniform,\n densityNormal,\n densityLogNormal,\n densityUniform,\n quantileNormal,\n quantileLogNormal,\n quantileUniform,\n sampleNormal,\n sampleLogNormal,\n sampleUniform,\n isArray,\n isBoolean,\n isDate,\n isDefined(_) {\n return _ !== undefined;\n },\n isNumber,\n isObject,\n isRegExp,\n isString,\n isTuple,\n isValid(_) {\n return _ != null && _ === _;\n },\n toBoolean,\n toDate(_) {\n return toDate(_);\n },\n // suppress extra arguments\n toNumber,\n toString,\n indexof,\n join,\n lastindexof,\n replace,\n reverse,\n slice,\n flush,\n lerp,\n merge,\n pad,\n peek,\n pluck,\n span,\n inrange,\n truncate,\n rgb,\n lab,\n hcl,\n hsl,\n luminance,\n contrast,\n sequence: range$1,\n format,\n utcFormat,\n utcParse,\n utcOffset,\n utcSequence,\n timeFormat,\n timeParse,\n timeOffset,\n timeSequence,\n timeUnitSpecifier,\n monthFormat,\n monthAbbrevFormat,\n dayFormat,\n dayAbbrevFormat,\n quarter,\n utcquarter,\n week,\n utcweek,\n dayofyear,\n utcdayofyear,\n warn,\n info,\n debug,\n extent(_) {\n return extent(_);\n },\n // suppress extra arguments\n inScope,\n intersect,\n clampRange,\n pinchDistance,\n pinchAngle,\n screen,\n containerSize,\n windowSize,\n bandspace,\n setdata,\n pathShape,\n panLinear,\n panLog,\n panPow,\n panSymlog,\n zoomLinear,\n zoomLog,\n zoomPow,\n zoomSymlog,\n encode,\n modify,\n lassoAppend,\n lassoPath,\n intersectLasso\n};\nconst eventFunctions = ['view', 'item', 'group', 'xy', 'x', 'y'],\n // event functions\n eventPrefix = 'event.vega.',\n // event function prefix\n thisPrefix = 'this.',\n // function context prefix\n astVisitors = {}; // AST visitors for dependency analysis\n\n// export code generator parameters\nconst codegenParams = {\n forbidden: ['_'],\n allowed: ['datum', 'event', 'item'],\n fieldvar: 'datum',\n globalvar: id => `_[${stringValue(SignalPrefix + id)}]`,\n functions: buildFunctions,\n constants: constants,\n visitors: astVisitors\n};\n\n// export code generator\nconst codeGenerator = codegenExpression(codegenParams);\n\n// Build expression function registry\nfunction buildFunctions(codegen) {\n const fn = functions(codegen);\n eventFunctions.forEach(name => fn[name] = eventPrefix + name);\n for (const name in functionContext) {\n fn[name] = thisPrefix + name;\n }\n extend(fn, internalScaleFunctions(codegen, functionContext, astVisitors));\n return fn;\n}\n\n// Register an expression function\nfunction expressionFunction(name, fn, visitor) {\n if (arguments.length === 1) {\n return functionContext[name];\n }\n\n // register with the functionContext\n functionContext[name] = fn;\n\n // if there is an astVisitor register that, too\n if (visitor) astVisitors[name] = visitor;\n\n // if the code generator has already been initialized,\n // we need to also register the function with it\n if (codeGenerator) codeGenerator.functions[name] = thisPrefix + name;\n return this;\n}\n\n// register expression functions with ast visitors\nexpressionFunction('bandwidth', bandwidth, scaleVisitor);\nexpressionFunction('copy', copy, scaleVisitor);\nexpressionFunction('domain', domain, scaleVisitor);\nexpressionFunction('range', range, scaleVisitor);\nexpressionFunction('invert', invert, scaleVisitor);\nexpressionFunction('scale', scale, scaleVisitor);\nexpressionFunction('gradient', scaleGradient, scaleVisitor);\nexpressionFunction('geoArea', geoArea, scaleVisitor);\nexpressionFunction('geoBounds', geoBounds, scaleVisitor);\nexpressionFunction('geoCentroid', geoCentroid, scaleVisitor);\nexpressionFunction('geoShape', geoShape, scaleVisitor);\nexpressionFunction('indata', indata, indataVisitor);\nexpressionFunction('data', data, dataVisitor);\nexpressionFunction('treePath', treePath, dataVisitor);\nexpressionFunction('treeAncestors', treeAncestors, dataVisitor);\n\n// register Vega-Lite selection functions\nexpressionFunction('vlSelectionTest', selectionTest, selectionVisitor);\nexpressionFunction('vlSelectionIdTest', selectionIdTest, selectionVisitor);\nexpressionFunction('vlSelectionResolve', selectionResolve, selectionVisitor);\nexpressionFunction('vlSelectionTuples', selectionTuples);\n\nfunction parser (expr, scope) {\n const params = {};\n\n // parse the expression to an abstract syntax tree (ast)\n let ast;\n try {\n expr = isString(expr) ? expr : stringValue(expr) + '';\n ast = parseExpression(expr);\n } catch (err) {\n error('Expression parse error: ' + expr);\n }\n\n // analyze ast function calls for dependencies\n ast.visit(node => {\n if (node.type !== CallExpression) return;\n const name = node.callee.name,\n visit = codegenParams.visitors[name];\n if (visit) visit(name, node.arguments, scope, params);\n });\n\n // perform code generation\n const gen = codeGenerator(ast);\n\n // collect signal dependencies\n gen.globals.forEach(name => {\n const signalName = SignalPrefix + name;\n if (!hasOwnProperty(params, signalName) && scope.getSignal(name)) {\n params[signalName] = scope.signalRef(name);\n }\n });\n\n // return generated expression code and dependencies\n return {\n $expr: extend({\n code: gen.code\n }, scope.options.ast ? {\n ast\n } : null),\n $fields: gen.fields,\n $params: params\n };\n}\n\nexport { DataPrefix, IndexPrefix, ScalePrefix, SignalPrefix, bandspace, bandwidth, codeGenerator, codegenParams, containerSize, contrast, copy, data, dataVisitor, dayAbbrevFormat, dayFormat, debug, domain, encode, expressionFunction, format, functionContext, geoArea, geoBounds, geoCentroid, geoShape, inScope, indata, indataVisitor, indexof, info, invert, join, lastindexof, luminance, merge, modify, monthAbbrevFormat, monthFormat, parser as parseExpression, pathShape, pinchAngle, pinchDistance, pluck, range, replace, reverse, scale, scaleGradient, scaleVisitor, screen, setdata, slice, timeFormat, timeParse, treeAncestors, treePath, utcFormat, utcParse, warn, windowSize };\n","import { toSet, stringValue, error, isArray, isObject, hasOwnProperty, accessor, key, field, array, compare, truthy } from 'vega-util';\nimport { tupleid } from 'vega-dataflow';\n\n/**\n * Parse a serialized dataflow specification.\n */\nfunction parse (spec) {\n const ctx = this,\n operators = spec.operators || [];\n\n // parse background\n if (spec.background) {\n ctx.background = spec.background;\n }\n\n // parse event configuration\n if (spec.eventConfig) {\n ctx.eventConfig = spec.eventConfig;\n }\n\n // parse locale configuration\n if (spec.locale) {\n ctx.locale = spec.locale;\n }\n\n // parse operators\n operators.forEach(entry => ctx.parseOperator(entry));\n\n // parse operator parameters\n operators.forEach(entry => ctx.parseOperatorParameters(entry));\n\n // parse streams\n (spec.streams || []).forEach(entry => ctx.parseStream(entry));\n\n // parse updates\n (spec.updates || []).forEach(entry => ctx.parseUpdate(entry));\n return ctx.resolve();\n}\n\nconst Skip = toSet(['rule']),\n Swap = toSet(['group', 'image', 'rect']);\nfunction adjustSpatial(encode, marktype) {\n let code = '';\n if (Skip[marktype]) return code;\n if (encode.x2) {\n if (encode.x) {\n if (Swap[marktype]) {\n code += 'if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;';\n }\n code += 'o.width=o.x2-o.x;';\n } else {\n code += 'o.x=o.x2-(o.width||0);';\n }\n }\n if (encode.xc) {\n code += 'o.x=o.xc-(o.width||0)/2;';\n }\n if (encode.y2) {\n if (encode.y) {\n if (Swap[marktype]) {\n code += 'if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;';\n }\n code += 'o.height=o.y2-o.y;';\n } else {\n code += 'o.y=o.y2-(o.height||0);';\n }\n }\n if (encode.yc) {\n code += 'o.y=o.yc-(o.height||0)/2;';\n }\n return code;\n}\nfunction canonicalType(type) {\n return (type + '').toLowerCase();\n}\nfunction isOperator(type) {\n return canonicalType(type) === 'operator';\n}\nfunction isCollect(type) {\n return canonicalType(type) === 'collect';\n}\n\nfunction expression(ctx, args, code) {\n // wrap code in return statement if expression does not terminate\n if (!code.endsWith(';')) {\n code = 'return(' + code + ');';\n }\n const fn = Function(...args.concat(code));\n return ctx && ctx.functions ? fn.bind(ctx.functions) : fn;\n}\n\n// generate code for comparing a single field\nfunction _compare(u, v, lt, gt) {\n return `((u = ${u}) < (v = ${v}) || u == null) && v != null ? ${lt}\n : (u > v || v == null) && u != null ? ${gt}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${lt}\n : v !== v && u === u ? ${gt} : `;\n}\nvar expressionCodegen = {\n /**\n * Parse an expression used to update an operator value.\n */\n operator: (ctx, expr) => expression(ctx, ['_'], expr.code),\n /**\n * Parse an expression provided as an operator parameter value.\n */\n parameter: (ctx, expr) => expression(ctx, ['datum', '_'], expr.code),\n /**\n * Parse an expression applied to an event stream.\n */\n event: (ctx, expr) => expression(ctx, ['event'], expr.code),\n /**\n * Parse an expression used to handle an event-driven operator update.\n */\n handler: (ctx, expr) => {\n const code = `var datum=event.item&&event.item.datum;return ${expr.code};`;\n return expression(ctx, ['_', 'event'], code);\n },\n /**\n * Parse an expression that performs visual encoding.\n */\n encode: (ctx, encode) => {\n const {\n marktype,\n channels\n } = encode;\n let code = 'var o=item,datum=o.datum,m=0,$;';\n for (const name in channels) {\n const o = 'o[' + stringValue(name) + ']';\n code += `$=${channels[name].code};if(${o}!==$)${o}=$,m=1;`;\n }\n code += adjustSpatial(channels, marktype);\n code += 'return m;';\n return expression(ctx, ['item', '_'], code);\n },\n /**\n * Optimized code generators for access and comparison.\n */\n codegen: {\n get(path) {\n const ref = `[${path.map(stringValue).join('][')}]`;\n const get = Function('_', `return _${ref};`);\n get.path = ref;\n return get;\n },\n comparator(fields, orders) {\n let t;\n const map = (f, i) => {\n const o = orders[i];\n let u, v;\n if (f.path) {\n u = `a${f.path}`;\n v = `b${f.path}`;\n } else {\n (t = t || {})['f' + i] = f;\n u = `this.f${i}(a)`;\n v = `this.f${i}(b)`;\n }\n return _compare(u, v, -o, o);\n };\n const fn = Function('a', 'b', 'var u, v; return ' + fields.map(map).join('') + '0;');\n return t ? fn.bind(t) : fn;\n }\n }\n};\n\n/**\n * Parse a dataflow operator.\n */\nfunction parseOperator(spec) {\n const ctx = this;\n if (isOperator(spec.type) || !spec.type) {\n ctx.operator(spec, spec.update ? ctx.operatorExpression(spec.update) : null);\n } else {\n ctx.transform(spec, spec.type);\n }\n}\n\n/**\n * Parse and assign operator parameters.\n */\nfunction parseOperatorParameters(spec) {\n const ctx = this;\n if (spec.params) {\n const op = ctx.get(spec.id);\n if (!op) error('Invalid operator id: ' + spec.id);\n ctx.dataflow.connect(op, op.parameters(ctx.parseParameters(spec.params), spec.react, spec.initonly));\n }\n}\n\n/**\n * Parse a set of operator parameters.\n */\nfunction parseParameters(spec, params) {\n params = params || {};\n const ctx = this;\n for (const key in spec) {\n const value = spec[key];\n params[key] = isArray(value) ? value.map(v => parseParameter(v, ctx, params)) : parseParameter(value, ctx, params);\n }\n return params;\n}\n\n/**\n * Parse a single parameter.\n */\nfunction parseParameter(spec, ctx, params) {\n if (!spec || !isObject(spec)) return spec;\n for (let i = 0, n = PARSERS.length, p; i < n; ++i) {\n p = PARSERS[i];\n if (hasOwnProperty(spec, p.key)) {\n return p.parse(spec, ctx, params);\n }\n }\n return spec;\n}\n\n/** Reference parsers. */\nvar PARSERS = [{\n key: '$ref',\n parse: getOperator\n}, {\n key: '$key',\n parse: getKey\n}, {\n key: '$expr',\n parse: getExpression\n}, {\n key: '$field',\n parse: getField\n}, {\n key: '$encode',\n parse: getEncode\n}, {\n key: '$compare',\n parse: getCompare\n}, {\n key: '$context',\n parse: getContext\n}, {\n key: '$subflow',\n parse: getSubflow\n}, {\n key: '$tupleid',\n parse: getTupleId\n}];\n\n/**\n * Resolve an operator reference.\n */\nfunction getOperator(_, ctx) {\n return ctx.get(_.$ref) || error('Operator not defined: ' + _.$ref);\n}\n\n/**\n * Resolve an expression reference.\n */\nfunction getExpression(_, ctx, params) {\n if (_.$params) {\n // parse expression parameters\n ctx.parseParameters(_.$params, params);\n }\n const k = 'e:' + _.$expr.code;\n return ctx.fn[k] || (ctx.fn[k] = accessor(ctx.parameterExpression(_.$expr), _.$fields));\n}\n\n/**\n * Resolve a key accessor reference.\n */\nfunction getKey(_, ctx) {\n const k = 'k:' + _.$key + '_' + !!_.$flat;\n return ctx.fn[k] || (ctx.fn[k] = key(_.$key, _.$flat, ctx.expr.codegen));\n}\n\n/**\n * Resolve a field accessor reference.\n */\nfunction getField(_, ctx) {\n if (!_.$field) return null;\n const k = 'f:' + _.$field + '_' + _.$name;\n return ctx.fn[k] || (ctx.fn[k] = field(_.$field, _.$name, ctx.expr.codegen));\n}\n\n/**\n * Resolve a comparator function reference.\n */\nfunction getCompare(_, ctx) {\n // As of Vega 5.5.3, $tupleid sort is no longer used.\n // Keep here for now for backwards compatibility.\n const k = 'c:' + _.$compare + '_' + _.$order,\n c = array(_.$compare).map(_ => _ && _.$tupleid ? tupleid : _);\n return ctx.fn[k] || (ctx.fn[k] = compare(c, _.$order, ctx.expr.codegen));\n}\n\n/**\n * Resolve an encode operator reference.\n */\nfunction getEncode(_, ctx) {\n const spec = _.$encode,\n encode = {};\n for (const name in spec) {\n const enc = spec[name];\n encode[name] = accessor(ctx.encodeExpression(enc.$expr), enc.$fields);\n encode[name].output = enc.$output;\n }\n return encode;\n}\n\n/**\n * Resolve a context reference.\n */\nfunction getContext(_, ctx) {\n return ctx;\n}\n\n/**\n * Resolve a recursive subflow specification.\n */\nfunction getSubflow(_, ctx) {\n const spec = _.$subflow;\n return function (dataflow, key, parent) {\n const subctx = ctx.fork().parse(spec),\n op = subctx.get(spec.operators[0].id),\n p = subctx.signals.parent;\n if (p) p.set(parent);\n op.detachSubflow = () => ctx.detach(subctx);\n return op;\n };\n}\n\n/**\n * Resolve a tuple id reference.\n */\nfunction getTupleId() {\n return tupleid;\n}\n\n/**\n * Parse an event stream specification.\n */\nfunction parseStream (spec) {\n var ctx = this,\n filter = spec.filter != null ? ctx.eventExpression(spec.filter) : undefined,\n stream = spec.stream != null ? ctx.get(spec.stream) : undefined,\n args;\n if (spec.source) {\n stream = ctx.events(spec.source, spec.type, filter);\n } else if (spec.merge) {\n args = spec.merge.map(_ => ctx.get(_));\n stream = args[0].merge.apply(args[0], args.slice(1));\n }\n if (spec.between) {\n args = spec.between.map(_ => ctx.get(_));\n stream = stream.between(args[0], args[1]);\n }\n if (spec.filter) {\n stream = stream.filter(filter);\n }\n if (spec.throttle != null) {\n stream = stream.throttle(+spec.throttle);\n }\n if (spec.debounce != null) {\n stream = stream.debounce(+spec.debounce);\n }\n if (stream == null) {\n error('Invalid stream definition: ' + JSON.stringify(spec));\n }\n if (spec.consume) stream.consume(true);\n ctx.stream(spec, stream);\n}\n\n/**\n * Parse an event-driven operator update.\n */\nfunction parseUpdate (spec) {\n var ctx = this,\n srcid = isObject(srcid = spec.source) ? srcid.$ref : srcid,\n source = ctx.get(srcid),\n target = null,\n update = spec.update,\n params = undefined;\n if (!source) error('Source not defined: ' + spec.source);\n target = spec.target && spec.target.$expr ? ctx.eventExpression(spec.target.$expr) : ctx.get(spec.target);\n if (update && update.$expr) {\n if (update.$params) {\n params = ctx.parseParameters(update.$params);\n }\n update = ctx.handlerExpression(update.$expr);\n }\n ctx.update(spec, source, target, update, params);\n}\n\nconst SKIP = {\n skip: true\n};\nfunction getState(options) {\n var ctx = this,\n state = {};\n if (options.signals) {\n var signals = state.signals = {};\n Object.keys(ctx.signals).forEach(key => {\n const op = ctx.signals[key];\n if (options.signals(key, op)) {\n signals[key] = op.value;\n }\n });\n }\n if (options.data) {\n var data = state.data = {};\n Object.keys(ctx.data).forEach(key => {\n const dataset = ctx.data[key];\n if (options.data(key, dataset)) {\n data[key] = dataset.input.value;\n }\n });\n }\n if (ctx.subcontext && options.recurse !== false) {\n state.subcontext = ctx.subcontext.map(ctx => ctx.getState(options));\n }\n return state;\n}\nfunction setState(state) {\n var ctx = this,\n df = ctx.dataflow,\n data = state.data,\n signals = state.signals;\n Object.keys(signals || {}).forEach(key => {\n df.update(ctx.signals[key], signals[key], SKIP);\n });\n Object.keys(data || {}).forEach(key => {\n df.pulse(ctx.data[key].input, df.changeset().remove(truthy).insert(data[key]));\n });\n (state.subcontext || []).forEach((substate, i) => {\n const subctx = ctx.subcontext[i];\n if (subctx) subctx.setState(substate);\n });\n}\n\n/**\n * Context objects store the current parse state.\n * Enables lookup of parsed operators, event streams, accessors, etc.\n * Provides a 'fork' method for creating child contexts for subflows.\n */\nfunction context (df, transforms, functions, expr) {\n return new Context(df, transforms, functions, expr);\n}\nfunction Context(df, transforms, functions, expr) {\n this.dataflow = df;\n this.transforms = transforms;\n this.events = df.events.bind(df);\n this.expr = expr || expressionCodegen, this.signals = {};\n this.scales = {};\n this.nodes = {};\n this.data = {};\n this.fn = {};\n if (functions) {\n this.functions = Object.create(functions);\n this.functions.context = this;\n }\n}\nfunction Subcontext(ctx) {\n this.dataflow = ctx.dataflow;\n this.transforms = ctx.transforms;\n this.events = ctx.events;\n this.expr = ctx.expr;\n this.signals = Object.create(ctx.signals);\n this.scales = Object.create(ctx.scales);\n this.nodes = Object.create(ctx.nodes);\n this.data = Object.create(ctx.data);\n this.fn = Object.create(ctx.fn);\n if (ctx.functions) {\n this.functions = Object.create(ctx.functions);\n this.functions.context = this;\n }\n}\nContext.prototype = Subcontext.prototype = {\n fork() {\n const ctx = new Subcontext(this);\n (this.subcontext || (this.subcontext = [])).push(ctx);\n return ctx;\n },\n detach(ctx) {\n this.subcontext = this.subcontext.filter(c => c !== ctx);\n\n // disconnect all nodes in the subcontext\n // wipe out targets first for better efficiency\n const keys = Object.keys(ctx.nodes);\n for (const key of keys) ctx.nodes[key]._targets = null;\n for (const key of keys) ctx.nodes[key].detach();\n ctx.nodes = null;\n },\n get(id) {\n return this.nodes[id];\n },\n set(id, node) {\n return this.nodes[id] = node;\n },\n add(spec, op) {\n const ctx = this,\n df = ctx.dataflow,\n data = spec.value;\n ctx.set(spec.id, op);\n if (isCollect(spec.type) && data) {\n if (data.$ingest) {\n df.ingest(op, data.$ingest, data.$format);\n } else if (data.$request) {\n df.preload(op, data.$request, data.$format);\n } else {\n df.pulse(op, df.changeset().insert(data));\n }\n }\n if (spec.root) {\n ctx.root = op;\n }\n if (spec.parent) {\n let p = ctx.get(spec.parent.$ref);\n if (p) {\n df.connect(p, [op]);\n op.targets().add(p);\n } else {\n (ctx.unresolved = ctx.unresolved || []).push(() => {\n p = ctx.get(spec.parent.$ref);\n df.connect(p, [op]);\n op.targets().add(p);\n });\n }\n }\n if (spec.signal) {\n ctx.signals[spec.signal] = op;\n }\n if (spec.scale) {\n ctx.scales[spec.scale] = op;\n }\n if (spec.data) {\n for (const name in spec.data) {\n const data = ctx.data[name] || (ctx.data[name] = {});\n spec.data[name].forEach(role => data[role] = op);\n }\n }\n },\n resolve() {\n (this.unresolved || []).forEach(fn => fn());\n delete this.unresolved;\n return this;\n },\n operator(spec, update) {\n this.add(spec, this.dataflow.add(spec.value, update));\n },\n transform(spec, type) {\n this.add(spec, this.dataflow.add(this.transforms[canonicalType(type)]));\n },\n stream(spec, stream) {\n this.set(spec.id, stream);\n },\n update(spec, stream, target, update, params) {\n this.dataflow.on(stream, target, update, params, spec.options);\n },\n // expression parsing\n operatorExpression(expr) {\n return this.expr.operator(this, expr);\n },\n parameterExpression(expr) {\n return this.expr.parameter(this, expr);\n },\n eventExpression(expr) {\n return this.expr.event(this, expr);\n },\n handlerExpression(expr) {\n return this.expr.handler(this, expr);\n },\n encodeExpression(encode) {\n return this.expr.encode(this, encode);\n },\n // parse methods\n parse,\n parseOperator,\n parseOperatorParameters,\n parseParameters,\n parseStream,\n parseUpdate,\n // state methods\n getState,\n setState\n};\n\nexport { context };\n","import { isString, hasOwnProperty, error, truthy, constant, extend, array, isObject, isArray, toSet, debounce, isDate, inherits, stringValue } from 'vega-util';\nimport { changeset, isChangeSet, EventStream, transforms, Dataflow, asyncCallback } from 'vega-dataflow';\nimport { point, renderModule, CanvasHandler, RenderType, Scenegraph } from 'vega-scenegraph';\nimport { tickStep } from 'd3-array';\nimport { functionContext } from 'vega-functions';\nimport { context } from 'vega-runtime';\nimport { interval } from 'd3-timer';\nimport { locale } from 'vega-format';\n\n// initialize aria role and label attributes\nfunction initializeAria(view) {\n const el = view.container();\n if (el) {\n el.setAttribute('role', 'graphics-document');\n el.setAttribute('aria-roleDescription', 'visualization');\n ariaLabel(el, view.description());\n }\n}\n\n// update aria-label if we have a DOM container element\nfunction ariaLabel(el, desc) {\n if (el) desc == null ? el.removeAttribute('aria-label') : el.setAttribute('aria-label', desc);\n}\n\nfunction background (view) {\n // respond to background signal\n view.add(null, _ => {\n view._background = _.bg;\n view._resize = 1;\n return _.bg;\n }, {\n bg: view._signals.background\n });\n}\n\nconst Default = 'default';\nfunction cursor (view) {\n // get cursor signal, add to dataflow if needed\n const cursor = view._signals.cursor || (view._signals.cursor = view.add({\n user: Default,\n item: null\n }));\n\n // evaluate cursor on each mousemove event\n view.on(view.events('view', 'mousemove'), cursor, (_, event) => {\n const value = cursor.value,\n user = value ? isString(value) ? value : value.user : Default,\n item = event.item && event.item.cursor || null;\n return value && user === value.user && item == value.item ? value : {\n user: user,\n item: item\n };\n });\n\n // when cursor signal updates, set visible cursor\n view.add(null, function (_) {\n let user = _.cursor,\n item = this.value;\n if (!isString(user)) {\n item = user.item;\n user = user.user;\n }\n setCursor(view, user && user !== Default ? user : item || user);\n return item;\n }, {\n cursor: cursor\n });\n}\nfunction setCursor(view, cursor) {\n const el = view.globalCursor() ? typeof document !== 'undefined' && document.body : view.container();\n if (el) {\n return cursor == null ? el.style.removeProperty('cursor') : el.style.cursor = cursor;\n }\n}\n\nfunction dataref(view, name) {\n var data = view._runtime.data;\n if (!hasOwnProperty(data, name)) {\n error('Unrecognized data set: ' + name);\n }\n return data[name];\n}\nfunction data(name, values) {\n return arguments.length < 2 ? dataref(this, name).values.value : change.call(this, name, changeset().remove(truthy).insert(values));\n}\nfunction change(name, changes) {\n if (!isChangeSet(changes)) {\n error('Second argument to changes must be a changeset.');\n }\n const dataset = dataref(this, name);\n dataset.modified = true;\n return this.pulse(dataset.input, changes);\n}\nfunction insert(name, _) {\n return change.call(this, name, changeset().insert(_));\n}\nfunction remove(name, _) {\n return change.call(this, name, changeset().remove(_));\n}\n\nfunction width(view) {\n var padding = view.padding();\n return Math.max(0, view._viewWidth + padding.left + padding.right);\n}\nfunction height(view) {\n var padding = view.padding();\n return Math.max(0, view._viewHeight + padding.top + padding.bottom);\n}\nfunction offset(view) {\n var padding = view.padding(),\n origin = view._origin;\n return [padding.left + origin[0], padding.top + origin[1]];\n}\nfunction resizeRenderer(view) {\n var origin = offset(view),\n w = width(view),\n h = height(view);\n view._renderer.background(view.background());\n view._renderer.resize(w, h, origin);\n view._handler.origin(origin);\n view._resizeListeners.forEach(handler => {\n try {\n handler(w, h);\n } catch (error) {\n view.error(error);\n }\n });\n}\n\n/**\n * Extend an event with additional view-specific methods.\n * Adds a new property ('vega') to an event that provides a number\n * of methods for querying information about the current interaction.\n * The vega object provides the following methods:\n * view - Returns the backing View instance.\n * item - Returns the currently active scenegraph item (if any).\n * group - Returns the currently active scenegraph group (if any).\n * This method accepts a single string-typed argument indicating the name\n * of the desired parent group. The scenegraph will be traversed from\n * the item up towards the root to search for a matching group. If no\n * argument is provided the enclosing group for the active item is\n * returned, unless the item it itself a group, in which case it is\n * returned directly.\n * xy - Returns a two-element array containing the x and y coordinates for\n * mouse or touch events. For touch events, this is based on the first\n * elements in the changedTouches array. This method accepts a single\n * argument: either an item instance or mark name that should serve as\n * the reference coordinate system. If no argument is provided the\n * top-level view coordinate system is assumed.\n * x - Returns the current x-coordinate, accepts the same arguments as xy.\n * y - Returns the current y-coordinate, accepts the same arguments as xy.\n * @param {Event} event - The input event to extend.\n * @param {Item} item - The currently active scenegraph item (if any).\n * @return {Event} - The extended input event.\n */\nfunction eventExtend (view, event, item) {\n var r = view._renderer,\n el = r && r.canvas(),\n p,\n e,\n translate;\n if (el) {\n translate = offset(view);\n e = event.changedTouches ? event.changedTouches[0] : event;\n p = point(e, el);\n p[0] -= translate[0];\n p[1] -= translate[1];\n }\n event.dataflow = view;\n event.item = item;\n event.vega = extension(view, item, p);\n return event;\n}\nfunction extension(view, item, point) {\n const itemGroup = item ? item.mark.marktype === 'group' ? item : item.mark.group : null;\n function group(name) {\n var g = itemGroup,\n i;\n if (name) for (i = item; i; i = i.mark.group) {\n if (i.mark.name === name) {\n g = i;\n break;\n }\n }\n return g && g.mark && g.mark.interactive ? g : {};\n }\n function xy(item) {\n if (!item) return point;\n if (isString(item)) item = group(item);\n const p = point.slice();\n while (item) {\n p[0] -= item.x || 0;\n p[1] -= item.y || 0;\n item = item.mark && item.mark.group;\n }\n return p;\n }\n return {\n view: constant(view),\n item: constant(item || {}),\n group: group,\n xy: xy,\n x: item => xy(item)[0],\n y: item => xy(item)[1]\n };\n}\n\nconst VIEW = 'view',\n TIMER = 'timer',\n WINDOW = 'window',\n NO_TRAP = {\n trap: false\n };\n\n/**\n * Initialize event handling configuration.\n * @param {object} config - The configuration settings.\n * @return {object}\n */\nfunction initializeEventConfig(config) {\n const events = extend({\n defaults: {}\n }, config);\n const unpack = (obj, keys) => {\n keys.forEach(k => {\n if (isArray(obj[k])) obj[k] = toSet(obj[k]);\n });\n };\n unpack(events.defaults, ['prevent', 'allow']);\n unpack(events, ['view', 'window', 'selector']);\n return events;\n}\nfunction trackEventListener(view, sources, type, handler) {\n view._eventListeners.push({\n type: type,\n sources: array(sources),\n handler: handler\n });\n}\nfunction prevent(view, type) {\n var def = view._eventConfig.defaults,\n prevent = def.prevent,\n allow = def.allow;\n return prevent === false || allow === true ? false : prevent === true || allow === false ? true : prevent ? prevent[type] : allow ? !allow[type] : view.preventDefault();\n}\nfunction permit(view, key, type) {\n const rule = view._eventConfig && view._eventConfig[key];\n if (rule === false || isObject(rule) && !rule[type]) {\n view.warn(`Blocked ${key} ${type} event listener.`);\n return false;\n }\n return true;\n}\n\n/**\n * Create a new event stream from an event source.\n * @param {object} source - The event source to monitor.\n * @param {string} type - The event type.\n * @param {function(object): boolean} [filter] - Event filter function.\n * @return {EventStream}\n */\nfunction events(source, type, filter) {\n var view = this,\n s = new EventStream(filter),\n send = function (e, item) {\n view.runAsync(null, () => {\n if (source === VIEW && prevent(view, type)) {\n e.preventDefault();\n }\n s.receive(eventExtend(view, e, item));\n });\n },\n sources;\n if (source === TIMER) {\n if (permit(view, 'timer', type)) {\n view.timer(send, type);\n }\n } else if (source === VIEW) {\n if (permit(view, 'view', type)) {\n // send traps errors, so use {trap: false} option\n view.addEventListener(type, send, NO_TRAP);\n }\n } else {\n if (source === WINDOW) {\n if (permit(view, 'window', type) && typeof window !== 'undefined') {\n sources = [window];\n }\n } else if (typeof document !== 'undefined') {\n if (permit(view, 'selector', type)) {\n sources = Array.from(document.querySelectorAll(source));\n }\n }\n if (!sources) {\n view.warn('Can not resolve event source: ' + source);\n } else {\n for (var i = 0, n = sources.length; i < n; ++i) {\n sources[i].addEventListener(type, send);\n }\n trackEventListener(view, sources, type, send);\n }\n }\n return s;\n}\n\nfunction itemFilter(event) {\n return event.item;\n}\nfunction markTarget(event) {\n // grab upstream collector feeding the mark operator\n return event.item.mark.source;\n}\nfunction invoke(name) {\n return function (_, event) {\n return event.vega.view().changeset().encode(event.item, name);\n };\n}\nfunction hover (hoverSet, leaveSet) {\n hoverSet = [hoverSet || 'hover'];\n leaveSet = [leaveSet || 'update', hoverSet[0]];\n\n // invoke hover set upon mouseover\n this.on(this.events('view', 'mouseover', itemFilter), markTarget, invoke(hoverSet));\n\n // invoke leave set upon mouseout\n this.on(this.events('view', 'mouseout', itemFilter), markTarget, invoke(leaveSet));\n return this;\n}\n\n/**\n * Finalize a View instance that is being removed.\n * Cancel any running timers.\n * Remove all external event listeners.\n * Remove any currently displayed tooltip.\n */\nfunction finalize () {\n var tooltip = this._tooltip,\n timers = this._timers,\n listeners = this._eventListeners,\n n,\n m,\n e;\n n = timers.length;\n while (--n >= 0) {\n timers[n].stop();\n }\n n = listeners.length;\n while (--n >= 0) {\n e = listeners[n];\n m = e.sources.length;\n while (--m >= 0) {\n e.sources[m].removeEventListener(e.type, e.handler);\n }\n }\n if (tooltip) {\n tooltip.call(this, this._handler, null, null, null);\n }\n return this;\n}\n\nfunction element (tag, attr, text) {\n const el = document.createElement(tag);\n for (const key in attr) el.setAttribute(key, attr[key]);\n if (text != null) el.textContent = text;\n return el;\n}\n\nconst BindClass = 'vega-bind',\n NameClass = 'vega-bind-name',\n RadioClass = 'vega-bind-radio';\n\n/**\n * Bind a signal to an external HTML input element. The resulting two-way\n * binding will propagate input changes to signals, and propagate signal\n * changes to the input element state. If this view instance has no parent\n * element, we assume the view is headless and no bindings are created.\n * @param {Element|string} el - The parent DOM element to which the input\n * element should be appended as a child. If string-valued, this argument\n * will be treated as a CSS selector. If null or undefined, the parent\n * element of this view will be used as the element.\n * @param {object} param - The binding parameters which specify the signal\n * to bind to, the input element type, and type-specific configuration.\n * @return {View} - This view instance.\n */\nfunction bind (view, el, binding) {\n if (!el) return;\n const param = binding.param;\n let bind = binding.state;\n if (!bind) {\n bind = binding.state = {\n elements: null,\n active: false,\n set: null,\n update: value => {\n if (value != view.signal(param.signal)) {\n view.runAsync(null, () => {\n bind.source = true;\n view.signal(param.signal, value);\n });\n }\n }\n };\n if (param.debounce) {\n bind.update = debounce(param.debounce, bind.update);\n }\n }\n const create = param.input == null && param.element ? target : generate;\n create(bind, el, param, view);\n if (!bind.active) {\n view.on(view._signals[param.signal], null, () => {\n bind.source ? bind.source = false : bind.set(view.signal(param.signal));\n });\n bind.active = true;\n }\n return bind;\n}\n\n/**\n * Bind the signal to an external EventTarget.\n */\nfunction target(bind, node, param, view) {\n const type = param.event || 'input';\n const handler = () => bind.update(node.value);\n\n // initialize signal value to external input value\n view.signal(param.signal, node.value);\n\n // listen for changes on the element\n node.addEventListener(type, handler);\n\n // register with view, so we can remove it upon finalization\n trackEventListener(view, node, type, handler);\n\n // propagate change to element\n bind.set = value => {\n node.value = value;\n node.dispatchEvent(event(type));\n };\n}\nfunction event(type) {\n return typeof Event !== 'undefined' ? new Event(type) : {\n type\n };\n}\n\n/**\n * Generate an HTML input form element and bind it to a signal.\n */\nfunction generate(bind, el, param, view) {\n const value = view.signal(param.signal);\n const div = element('div', {\n 'class': BindClass\n });\n const wrapper = param.input === 'radio' ? div : div.appendChild(element('label'));\n wrapper.appendChild(element('span', {\n 'class': NameClass\n }, param.name || param.signal));\n el.appendChild(div);\n let input = form;\n switch (param.input) {\n case 'checkbox':\n input = checkbox;\n break;\n case 'select':\n input = select;\n break;\n case 'radio':\n input = radio;\n break;\n case 'range':\n input = range;\n break;\n }\n input(bind, wrapper, param, value);\n}\n\n/**\n * Generates an arbitrary input form element.\n * The input type is controlled via user-provided parameters.\n */\nfunction form(bind, el, param, value) {\n const node = element('input');\n for (const key in param) {\n if (key !== 'signal' && key !== 'element') {\n node.setAttribute(key === 'input' ? 'type' : key, param[key]);\n }\n }\n node.setAttribute('name', param.signal);\n node.value = value;\n el.appendChild(node);\n node.addEventListener('input', () => bind.update(node.value));\n bind.elements = [node];\n bind.set = value => node.value = value;\n}\n\n/**\n * Generates a checkbox input element.\n */\nfunction checkbox(bind, el, param, value) {\n const attr = {\n type: 'checkbox',\n name: param.signal\n };\n if (value) attr.checked = true;\n const node = element('input', attr);\n el.appendChild(node);\n node.addEventListener('change', () => bind.update(node.checked));\n bind.elements = [node];\n bind.set = value => node.checked = !!value || null;\n}\n\n/**\n * Generates a selection list input element.\n */\nfunction select(bind, el, param, value) {\n const node = element('select', {\n name: param.signal\n }),\n labels = param.labels || [];\n param.options.forEach((option, i) => {\n const attr = {\n value: option\n };\n if (valuesEqual(option, value)) attr.selected = true;\n node.appendChild(element('option', attr, (labels[i] || option) + ''));\n });\n el.appendChild(node);\n node.addEventListener('change', () => {\n bind.update(param.options[node.selectedIndex]);\n });\n bind.elements = [node];\n bind.set = value => {\n for (let i = 0, n = param.options.length; i < n; ++i) {\n if (valuesEqual(param.options[i], value)) {\n node.selectedIndex = i;\n return;\n }\n }\n };\n}\n\n/**\n * Generates a radio button group.\n */\nfunction radio(bind, el, param, value) {\n const group = element('span', {\n 'class': RadioClass\n }),\n labels = param.labels || [];\n el.appendChild(group);\n bind.elements = param.options.map((option, i) => {\n const attr = {\n type: 'radio',\n name: param.signal,\n value: option\n };\n if (valuesEqual(option, value)) attr.checked = true;\n const input = element('input', attr);\n input.addEventListener('change', () => bind.update(option));\n const label = element('label', {}, (labels[i] || option) + '');\n label.prepend(input);\n group.appendChild(label);\n return input;\n });\n bind.set = value => {\n const nodes = bind.elements,\n n = nodes.length;\n for (let i = 0; i < n; ++i) {\n if (valuesEqual(nodes[i].value, value)) nodes[i].checked = true;\n }\n };\n}\n\n/**\n * Generates a slider input element.\n */\nfunction range(bind, el, param, value) {\n value = value !== undefined ? value : (+param.max + +param.min) / 2;\n const max = param.max != null ? param.max : Math.max(100, +value) || 100,\n min = param.min || Math.min(0, max, +value) || 0,\n step = param.step || tickStep(min, max, 100);\n const node = element('input', {\n type: 'range',\n name: param.signal,\n min: min,\n max: max,\n step: step\n });\n node.value = value;\n const span = element('span', {}, +value);\n el.appendChild(node);\n el.appendChild(span);\n const update = () => {\n span.textContent = node.value;\n bind.update(+node.value);\n };\n\n // subscribe to both input and change\n node.addEventListener('input', update);\n node.addEventListener('change', update);\n bind.elements = [node];\n bind.set = value => {\n node.value = value;\n span.textContent = value;\n };\n}\nfunction valuesEqual(a, b) {\n return a === b || a + '' === b + '';\n}\n\nfunction initializeRenderer (view, r, el, constructor, scaleFactor, opt) {\n r = r || new constructor(view.loader());\n return r.initialize(el, width(view), height(view), offset(view), scaleFactor, opt).background(view.background());\n}\n\nfunction trap (view, fn) {\n return !fn ? null : function () {\n try {\n fn.apply(this, arguments);\n } catch (error) {\n view.error(error);\n }\n };\n}\n\nfunction initializeHandler (view, prevHandler, el, constructor) {\n // instantiate scenegraph handler\n const handler = new constructor(view.loader(), trap(view, view.tooltip())).scene(view.scenegraph().root).initialize(el, offset(view), view);\n\n // transfer event handlers\n if (prevHandler) {\n prevHandler.handlers().forEach(h => {\n handler.on(h.type, h.handler);\n });\n }\n return handler;\n}\n\nfunction initialize (el, elBind) {\n const view = this,\n type = view._renderType,\n config = view._eventConfig.bind,\n module = renderModule(type);\n\n // containing dom element\n el = view._el = el ? lookup(view, el, true) : null;\n\n // initialize aria attributes\n initializeAria(view);\n\n // select appropriate renderer & handler\n if (!module) view.error('Unrecognized renderer type: ' + type);\n const Handler = module.handler || CanvasHandler,\n Renderer = el ? module.renderer : module.headless;\n\n // initialize renderer and input handler\n view._renderer = !Renderer ? null : initializeRenderer(view, view._renderer, el, Renderer);\n view._handler = initializeHandler(view, view._handler, el, Handler);\n view._redraw = true;\n\n // initialize signal bindings\n if (el && config !== 'none') {\n elBind = elBind ? view._elBind = lookup(view, elBind, true) : el.appendChild(element('form', {\n 'class': 'vega-bindings'\n }));\n view._bind.forEach(_ => {\n if (_.param.element && config !== 'container') {\n _.element = lookup(view, _.param.element, !!_.param.input);\n }\n });\n view._bind.forEach(_ => {\n bind(view, _.element || elBind, _);\n });\n }\n return view;\n}\nfunction lookup(view, el, clear) {\n if (typeof el === 'string') {\n if (typeof document !== 'undefined') {\n el = document.querySelector(el);\n if (!el) {\n view.error('Signal bind element not found: ' + el);\n return null;\n }\n } else {\n view.error('DOM document instance not found.');\n return null;\n }\n }\n if (el && clear) {\n try {\n el.textContent = '';\n } catch (e) {\n el = null;\n view.error(e);\n }\n }\n return el;\n}\n\nconst number = _ => +_ || 0;\nconst paddingObject = _ => ({\n top: _,\n bottom: _,\n left: _,\n right: _\n});\nfunction padding (_) {\n return isObject(_) ? {\n top: number(_.top),\n bottom: number(_.bottom),\n left: number(_.left),\n right: number(_.right)\n } : paddingObject(number(_));\n}\n\n/**\n * Render the current scene in a headless fashion.\n * This method is asynchronous, returning a Promise instance.\n * @return {Promise} - A Promise that resolves to a renderer.\n */\nasync function renderHeadless (view, type, scaleFactor, opt) {\n const module = renderModule(type),\n ctr = module && module.headless;\n if (!ctr) error('Unrecognized renderer type: ' + type);\n await view.runAsync();\n return initializeRenderer(view, null, null, ctr, scaleFactor, opt).renderAsync(view._scenegraph.root);\n}\n\n/**\n * Produce an image URL for the visualization. Depending on the type\n * parameter, the generated URL contains data for either a PNG or SVG image.\n * The URL can be used (for example) to download images of the visualization.\n * This method is asynchronous, returning a Promise instance.\n * @param {string} type - The image type. One of 'svg', 'png' or 'canvas'.\n * The 'canvas' and 'png' types are synonyms for a PNG image.\n * @return {Promise} - A promise that resolves to an image URL.\n */\nasync function renderToImageURL (type, scaleFactor) {\n if (type !== RenderType.Canvas && type !== RenderType.SVG && type !== RenderType.PNG) {\n error('Unrecognized image type: ' + type);\n }\n const r = await renderHeadless(this, type, scaleFactor);\n return type === RenderType.SVG ? toBlobURL(r.svg(), 'image/svg+xml') : r.canvas().toDataURL('image/png');\n}\nfunction toBlobURL(data, mime) {\n const blob = new Blob([data], {\n type: mime\n });\n return window.URL.createObjectURL(blob);\n}\n\n/**\n * Produce a Canvas instance containing a rendered visualization.\n * This method is asynchronous, returning a Promise instance.\n * @return {Promise} - A promise that resolves to a Canvas instance.\n */\nasync function renderToCanvas (scaleFactor, opt) {\n const r = await renderHeadless(this, RenderType.Canvas, scaleFactor, opt);\n return r.canvas();\n}\n\n/**\n * Produce a rendered SVG string of the visualization.\n * This method is asynchronous, returning a Promise instance.\n * @return {Promise} - A promise that resolves to an SVG string.\n */\nasync function renderToSVG (scaleFactor) {\n const r = await renderHeadless(this, RenderType.SVG, scaleFactor);\n return r.svg();\n}\n\nfunction runtime (view, spec, expr) {\n return context(view, transforms, functionContext, expr).parse(spec);\n}\n\nfunction scale(name) {\n var scales = this._runtime.scales;\n if (!hasOwnProperty(scales, name)) {\n error('Unrecognized scale or projection: ' + name);\n }\n return scales[name].value;\n}\n\nvar Width = 'width',\n Height = 'height',\n Padding = 'padding',\n Skip = {\n skip: true\n };\nfunction viewWidth(view, width) {\n var a = view.autosize(),\n p = view.padding();\n return width - (a && a.contains === Padding ? p.left + p.right : 0);\n}\nfunction viewHeight(view, height) {\n var a = view.autosize(),\n p = view.padding();\n return height - (a && a.contains === Padding ? p.top + p.bottom : 0);\n}\nfunction initializeResize(view) {\n var s = view._signals,\n w = s[Width],\n h = s[Height],\n p = s[Padding];\n function resetSize() {\n view._autosize = view._resize = 1;\n }\n\n // respond to width signal\n view._resizeWidth = view.add(null, _ => {\n view._width = _.size;\n view._viewWidth = viewWidth(view, _.size);\n resetSize();\n }, {\n size: w\n });\n\n // respond to height signal\n view._resizeHeight = view.add(null, _ => {\n view._height = _.size;\n view._viewHeight = viewHeight(view, _.size);\n resetSize();\n }, {\n size: h\n });\n\n // respond to padding signal\n const resizePadding = view.add(null, resetSize, {\n pad: p\n });\n\n // set rank to run immediately after source signal\n view._resizeWidth.rank = w.rank + 1;\n view._resizeHeight.rank = h.rank + 1;\n resizePadding.rank = p.rank + 1;\n}\nfunction resizeView(viewWidth, viewHeight, width, height, origin, auto) {\n this.runAfter(view => {\n let rerun = 0;\n\n // reset autosize flag\n view._autosize = 0;\n\n // width value changed: update signal, skip resize op\n if (view.width() !== width) {\n rerun = 1;\n view.signal(Width, width, Skip); // set width, skip update calc\n view._resizeWidth.skip(true); // skip width resize handler\n }\n\n // height value changed: update signal, skip resize op\n if (view.height() !== height) {\n rerun = 1;\n view.signal(Height, height, Skip); // set height, skip update calc\n view._resizeHeight.skip(true); // skip height resize handler\n }\n\n // view width changed: update view property, set resize flag\n if (view._viewWidth !== viewWidth) {\n view._resize = 1;\n view._viewWidth = viewWidth;\n }\n\n // view height changed: update view property, set resize flag\n if (view._viewHeight !== viewHeight) {\n view._resize = 1;\n view._viewHeight = viewHeight;\n }\n\n // origin changed: update view property, set resize flag\n if (view._origin[0] !== origin[0] || view._origin[1] !== origin[1]) {\n view._resize = 1;\n view._origin = origin;\n }\n\n // run dataflow on width/height signal change\n if (rerun) view.run('enter');\n if (auto) view.runAfter(v => v.resize());\n }, false, 1);\n}\n\n/**\n * Get the current view state, consisting of signal values and/or data sets.\n * @param {object} [options] - Options flags indicating which state to export.\n * If unspecified, all signals and data sets will be exported.\n * @param {function(string, Operator):boolean} [options.signals] - Optional\n * predicate function for testing if a signal should be included in the\n * exported state. If unspecified, all signals will be included, except for\n * those named 'parent' or those which refer to a Transform value.\n * @param {function(string, object):boolean} [options.data] - Optional\n * predicate function for testing if a data set's input should be included\n * in the exported state. If unspecified, all data sets that have been\n * explicitly modified will be included.\n * @param {boolean} [options.recurse=true] - Flag indicating if the exported\n * state should recursively include state from group mark sub-contexts.\n * @return {object} - An object containing the exported state values.\n */\nfunction getState(options) {\n return this._runtime.getState(options || {\n data: dataTest,\n signals: signalTest,\n recurse: true\n });\n}\nfunction dataTest(name, data) {\n return data.modified && isArray(data.input.value) && name.indexOf('_:vega:_');\n}\nfunction signalTest(name, op) {\n return !(name === 'parent' || op instanceof transforms.proxy);\n}\n\n/**\n * Sets the current view state and updates the view by invoking run.\n * @param {object} state - A state object containing signal and/or\n * data set values, following the format used by the getState method.\n * @return {View} - This view instance.\n */\nfunction setState(state) {\n this.runAsync(null, v => {\n v._trigger = false;\n v._runtime.setState(state);\n }, v => {\n v._trigger = true;\n });\n return this;\n}\n\nfunction timer (callback, delay) {\n function tick(elapsed) {\n callback({\n timestamp: Date.now(),\n elapsed: elapsed\n });\n }\n this._timers.push(interval(tick, delay));\n}\n\nfunction defaultTooltip (handler, event, item, value) {\n const el = handler.element();\n if (el) el.setAttribute('title', formatTooltip(value));\n}\nfunction formatTooltip(value) {\n return value == null ? '' : isArray(value) ? formatArray(value) : isObject(value) && !isDate(value) ? formatObject(value) : value + '';\n}\nfunction formatObject(obj) {\n return Object.keys(obj).map(key => {\n const v = obj[key];\n return key + ': ' + (isArray(v) ? formatArray(v) : formatValue(v));\n }).join('\\n');\n}\nfunction formatArray(value) {\n return '[' + value.map(formatValue).join(', ') + ']';\n}\nfunction formatValue(value) {\n return isArray(value) ? '[\\u2026]' : isObject(value) && !isDate(value) ? '{\\u2026}' : value;\n}\n\n/**\n * Create a new View instance from a Vega dataflow runtime specification.\n * The generated View will not immediately be ready for display. Callers\n * should also invoke the initialize method (e.g., to set the parent\n * DOM element in browser-based deployment) and then invoke the run\n * method to evaluate the dataflow graph. Rendering will automatically\n * be performed upon dataflow runs.\n * @constructor\n * @param {object} spec - The Vega dataflow runtime specification.\n */\nfunction View(spec, options) {\n const view = this;\n options = options || {};\n Dataflow.call(view);\n if (options.loader) view.loader(options.loader);\n if (options.logger) view.logger(options.logger);\n if (options.logLevel != null) view.logLevel(options.logLevel);\n if (options.locale || spec.locale) {\n const loc = extend({}, spec.locale, options.locale);\n view.locale(locale(loc.number, loc.time));\n }\n view._el = null;\n view._elBind = null;\n view._renderType = options.renderer || RenderType.Canvas;\n view._scenegraph = new Scenegraph();\n const root = view._scenegraph.root;\n\n // initialize renderer, handler and event management\n view._renderer = null;\n view._tooltip = options.tooltip || defaultTooltip, view._redraw = true;\n view._handler = new CanvasHandler().scene(root);\n view._globalCursor = false;\n view._preventDefault = false;\n view._timers = [];\n view._eventListeners = [];\n view._resizeListeners = [];\n\n // initialize event configuration\n view._eventConfig = initializeEventConfig(spec.eventConfig);\n view.globalCursor(view._eventConfig.globalCursor);\n\n // initialize dataflow graph\n const ctx = runtime(view, spec, options.expr);\n view._runtime = ctx;\n view._signals = ctx.signals;\n view._bind = (spec.bindings || []).map(_ => ({\n state: null,\n param: extend({}, _)\n }));\n\n // initialize scenegraph\n if (ctx.root) ctx.root.set(root);\n root.source = ctx.data.root.input;\n view.pulse(ctx.data.root.input, view.changeset().insert(root.items));\n\n // initialize view size\n view._width = view.width();\n view._height = view.height();\n view._viewWidth = viewWidth(view, view._width);\n view._viewHeight = viewHeight(view, view._height);\n view._origin = [0, 0];\n view._resize = 0;\n view._autosize = 1;\n initializeResize(view);\n\n // initialize background color\n background(view);\n\n // initialize cursor\n cursor(view);\n\n // initialize view description\n view.description(spec.description);\n\n // initialize hover proessing, if requested\n if (options.hover) view.hover();\n\n // initialize DOM container(s) and renderer\n if (options.container) view.initialize(options.container, options.bind);\n}\nfunction lookupSignal(view, name) {\n return hasOwnProperty(view._signals, name) ? view._signals[name] : error('Unrecognized signal name: ' + stringValue(name));\n}\nfunction findOperatorHandler(op, handler) {\n const h = (op._targets || []).filter(op => op._update && op._update.handler === handler);\n return h.length ? h[0] : null;\n}\nfunction addOperatorListener(view, name, op, handler) {\n let h = findOperatorHandler(op, handler);\n if (!h) {\n h = trap(view, () => handler(name, op.value));\n h.handler = handler;\n view.on(op, null, h);\n }\n return view;\n}\nfunction removeOperatorListener(view, op, handler) {\n const h = findOperatorHandler(op, handler);\n if (h) op._targets.remove(h);\n return view;\n}\ninherits(View, Dataflow, {\n // -- DATAFLOW / RENDERING ----\n\n async evaluate(encode, prerun, postrun) {\n // evaluate dataflow and prerun\n await Dataflow.prototype.evaluate.call(this, encode, prerun);\n\n // render as needed\n if (this._redraw || this._resize) {\n try {\n if (this._renderer) {\n if (this._resize) {\n this._resize = 0;\n resizeRenderer(this);\n }\n await this._renderer.renderAsync(this._scenegraph.root);\n }\n this._redraw = false;\n } catch (e) {\n this.error(e);\n }\n }\n\n // evaluate postrun\n if (postrun) asyncCallback(this, postrun);\n return this;\n },\n dirty(item) {\n this._redraw = true;\n this._renderer && this._renderer.dirty(item);\n },\n // -- GET / SET ----\n\n description(text) {\n if (arguments.length) {\n const desc = text != null ? text + '' : null;\n if (desc !== this._desc) ariaLabel(this._el, this._desc = desc);\n return this;\n }\n return this._desc;\n },\n container() {\n return this._el;\n },\n scenegraph() {\n return this._scenegraph;\n },\n origin() {\n return this._origin.slice();\n },\n signal(name, value, options) {\n const op = lookupSignal(this, name);\n return arguments.length === 1 ? op.value : this.update(op, value, options);\n },\n width(_) {\n return arguments.length ? this.signal('width', _) : this.signal('width');\n },\n height(_) {\n return arguments.length ? this.signal('height', _) : this.signal('height');\n },\n padding(_) {\n return arguments.length ? this.signal('padding', padding(_)) : padding(this.signal('padding'));\n },\n autosize(_) {\n return arguments.length ? this.signal('autosize', _) : this.signal('autosize');\n },\n background(_) {\n return arguments.length ? this.signal('background', _) : this.signal('background');\n },\n renderer(type) {\n if (!arguments.length) return this._renderType;\n if (!renderModule(type)) error('Unrecognized renderer type: ' + type);\n if (type !== this._renderType) {\n this._renderType = type;\n this._resetRenderer();\n }\n return this;\n },\n tooltip(handler) {\n if (!arguments.length) return this._tooltip;\n if (handler !== this._tooltip) {\n this._tooltip = handler;\n this._resetRenderer();\n }\n return this;\n },\n loader(loader) {\n if (!arguments.length) return this._loader;\n if (loader !== this._loader) {\n Dataflow.prototype.loader.call(this, loader);\n this._resetRenderer();\n }\n return this;\n },\n resize() {\n // set flag to perform autosize\n this._autosize = 1;\n // touch autosize signal to ensure top-level ViewLayout runs\n return this.touch(lookupSignal(this, 'autosize'));\n },\n _resetRenderer() {\n if (this._renderer) {\n this._renderer = null;\n this.initialize(this._el, this._elBind);\n }\n },\n // -- SIZING ----\n _resizeView: resizeView,\n // -- EVENT HANDLING ----\n\n addEventListener(type, handler, options) {\n let callback = handler;\n if (!(options && options.trap === false)) {\n // wrap callback in error handler\n callback = trap(this, handler);\n callback.raw = handler;\n }\n this._handler.on(type, callback);\n return this;\n },\n removeEventListener(type, handler) {\n var handlers = this._handler.handlers(type),\n i = handlers.length,\n h,\n t;\n\n // search registered handlers, remove if match found\n while (--i >= 0) {\n t = handlers[i].type;\n h = handlers[i].handler;\n if (type === t && (handler === h || handler === h.raw)) {\n this._handler.off(t, h);\n break;\n }\n }\n return this;\n },\n addResizeListener(handler) {\n const l = this._resizeListeners;\n if (l.indexOf(handler) < 0) {\n // add handler if it isn't already registered\n // note: error trapping handled elsewhere, so\n // no need to wrap handlers here\n l.push(handler);\n }\n return this;\n },\n removeResizeListener(handler) {\n var l = this._resizeListeners,\n i = l.indexOf(handler);\n if (i >= 0) {\n l.splice(i, 1);\n }\n return this;\n },\n addSignalListener(name, handler) {\n return addOperatorListener(this, name, lookupSignal(this, name), handler);\n },\n removeSignalListener(name, handler) {\n return removeOperatorListener(this, lookupSignal(this, name), handler);\n },\n addDataListener(name, handler) {\n return addOperatorListener(this, name, dataref(this, name).values, handler);\n },\n removeDataListener(name, handler) {\n return removeOperatorListener(this, dataref(this, name).values, handler);\n },\n globalCursor(_) {\n if (arguments.length) {\n if (this._globalCursor !== !!_) {\n const prev = setCursor(this, null); // clear previous cursor\n this._globalCursor = !!_;\n if (prev) setCursor(this, prev); // swap cursor\n }\n\n return this;\n } else {\n return this._globalCursor;\n }\n },\n preventDefault(_) {\n if (arguments.length) {\n this._preventDefault = _;\n return this;\n } else {\n return this._preventDefault;\n }\n },\n timer,\n events,\n finalize,\n hover,\n // -- DATA ----\n data,\n change,\n insert,\n remove,\n // -- SCALES --\n scale,\n // -- INITIALIZATION ----\n initialize,\n // -- HEADLESS RENDERING ----\n toImageURL: renderToImageURL,\n toCanvas: renderToCanvas,\n toSVG: renderToSVG,\n // -- SAVE / RESTORE STATE ----\n getState,\n setState\n});\n\nexport { View };\n","import {Timer, now} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n var t = new Timer, total = delay;\n if (delay == null) return t.restart(callback, delay, time), t;\n t._restart = t.restart;\n t.restart = function(callback, delay, time) {\n delay = +delay, time = time == null ? now() : +time;\n t._restart(function tick(elapsed) {\n elapsed += total;\n t._restart(tick, total += delay, time);\n callback(elapsed);\n }, delay, time);\n }\n t.restart(callback, delay, time);\n return t;\n}\n","const VIEW = 'view',\n LBRACK = '[',\n RBRACK = ']',\n LBRACE = '{',\n RBRACE = '}',\n COLON = ':',\n COMMA = ',',\n NAME = '@',\n GT = '>',\n ILLEGAL = /[[\\]{}]/,\n DEFAULT_MARKS = {\n '*': 1,\n arc: 1,\n area: 1,\n group: 1,\n image: 1,\n line: 1,\n path: 1,\n rect: 1,\n rule: 1,\n shape: 1,\n symbol: 1,\n text: 1,\n trail: 1\n };\nlet DEFAULT_SOURCE, MARKS;\n\n/**\n * Parse an event selector string.\n * Returns an array of event stream definitions.\n */\nfunction eventSelector (selector, source, marks) {\n DEFAULT_SOURCE = source || VIEW;\n MARKS = marks || DEFAULT_MARKS;\n return parseMerge(selector.trim()).map(parseSelector);\n}\nfunction isMarkType(type) {\n return MARKS[type];\n}\nfunction find(s, i, endChar, pushChar, popChar) {\n const n = s.length;\n let count = 0,\n c;\n for (; i < n; ++i) {\n c = s[i];\n if (!count && c === endChar) return i;else if (popChar && popChar.indexOf(c) >= 0) --count;else if (pushChar && pushChar.indexOf(c) >= 0) ++count;\n }\n return i;\n}\nfunction parseMerge(s) {\n const output = [],\n n = s.length;\n let start = 0,\n i = 0;\n while (i < n) {\n i = find(s, i, COMMA, LBRACK + LBRACE, RBRACK + RBRACE);\n output.push(s.substring(start, i).trim());\n start = ++i;\n }\n if (output.length === 0) {\n throw 'Empty event selector: ' + s;\n }\n return output;\n}\nfunction parseSelector(s) {\n return s[0] === '[' ? parseBetween(s) : parseStream(s);\n}\nfunction parseBetween(s) {\n const n = s.length;\n let i = 1,\n b;\n i = find(s, i, RBRACK, LBRACK, RBRACK);\n if (i === n) {\n throw 'Empty between selector: ' + s;\n }\n b = parseMerge(s.substring(1, i));\n if (b.length !== 2) {\n throw 'Between selector must have two elements: ' + s;\n }\n s = s.slice(i + 1).trim();\n if (s[0] !== GT) {\n throw 'Expected \\'>\\' after between selector: ' + s;\n }\n b = b.map(parseSelector);\n const stream = parseSelector(s.slice(1).trim());\n if (stream.between) {\n return {\n between: b,\n stream: stream\n };\n } else {\n stream.between = b;\n }\n return stream;\n}\nfunction parseStream(s) {\n const stream = {\n source: DEFAULT_SOURCE\n },\n source = [];\n let throttle = [0, 0],\n markname = 0,\n start = 0,\n n = s.length,\n i = 0,\n j,\n filter;\n\n // extract throttle from end\n if (s[n - 1] === RBRACE) {\n i = s.lastIndexOf(LBRACE);\n if (i >= 0) {\n try {\n throttle = parseThrottle(s.substring(i + 1, n - 1));\n } catch (e) {\n throw 'Invalid throttle specification: ' + s;\n }\n s = s.slice(0, i).trim();\n n = s.length;\n } else throw 'Unmatched right brace: ' + s;\n i = 0;\n }\n if (!n) throw s;\n\n // set name flag based on first char\n if (s[0] === NAME) markname = ++i;\n\n // extract first part of multi-part stream selector\n j = find(s, i, COLON);\n if (j < n) {\n source.push(s.substring(start, j).trim());\n start = i = ++j;\n }\n\n // extract remaining part of stream selector\n i = find(s, i, LBRACK);\n if (i === n) {\n source.push(s.substring(start, n).trim());\n } else {\n source.push(s.substring(start, i).trim());\n filter = [];\n start = ++i;\n if (start === n) throw 'Unmatched left bracket: ' + s;\n }\n\n // extract filters\n while (i < n) {\n i = find(s, i, RBRACK);\n if (i === n) throw 'Unmatched left bracket: ' + s;\n filter.push(s.substring(start, i).trim());\n if (i < n - 1 && s[++i] !== LBRACK) throw 'Expected left bracket: ' + s;\n start = ++i;\n }\n\n // marshall event stream specification\n if (!(n = source.length) || ILLEGAL.test(source[n - 1])) {\n throw 'Invalid event selector: ' + s;\n }\n if (n > 1) {\n stream.type = source[1];\n if (markname) {\n stream.markname = source[0].slice(1);\n } else if (isMarkType(source[0])) {\n stream.marktype = source[0];\n } else {\n stream.source = source[0];\n }\n } else {\n stream.type = source[0];\n }\n if (stream.type.slice(-1) === '!') {\n stream.consume = true;\n stream.type = stream.type.slice(0, -1);\n }\n if (filter != null) stream.filter = filter;\n if (throttle[0]) stream.throttle = throttle[0];\n if (throttle[1]) stream.debounce = throttle[1];\n return stream;\n}\nfunction parseThrottle(s) {\n const a = s.split(COMMA);\n if (!s.length || a.length > 2) throw s;\n return a.map(_ => {\n const x = +_;\n if (x !== x) throw s;\n return x;\n });\n}\n\nexport { eventSelector as parseSelector };\n","import { isObject, isArray, extend, hasOwnProperty, array, stringValue, peek, error, isString, splitAccessPath, mergeConfig } from 'vega-util';\nimport { parseExpression } from 'vega-functions';\nimport { parseSelector } from 'vega-event-selector';\nimport { isValidScaleType, isDiscrete, isQuantile, isContinuous, isDiscretizing } from 'vega-scale';\nimport { definition as definition$1 } from 'vega-dataflow';\n\nfunction parseAutosize (spec) {\n return isObject(spec) ? spec : {\n type: spec || 'pad'\n };\n}\n\nconst number = _ => +_ || 0;\nconst paddingObject = _ => ({\n top: _,\n bottom: _,\n left: _,\n right: _\n});\nfunction parsePadding (spec) {\n return !isObject(spec) ? paddingObject(number(spec)) : spec.signal ? spec : {\n top: number(spec.top),\n bottom: number(spec.bottom),\n left: number(spec.left),\n right: number(spec.right)\n };\n}\n\nconst encoder = _ => isObject(_) && !isArray(_) ? extend({}, _) : {\n value: _\n};\nfunction addEncode(object, name, value, set) {\n if (value != null) {\n const isEncoder = isObject(value) && !isArray(value) || isArray(value) && value.length && isObject(value[0]);\n\n // Always assign signal to update, even if the signal is from the enter block\n if (isEncoder) {\n object.update[name] = value;\n } else {\n object[set || 'enter'][name] = {\n value: value\n };\n }\n return 1;\n } else {\n return 0;\n }\n}\nfunction addEncoders(object, enter, update) {\n for (const name in enter) {\n addEncode(object, name, enter[name]);\n }\n for (const name in update) {\n addEncode(object, name, update[name], 'update');\n }\n}\nfunction extendEncode(encode, extra, skip) {\n for (const name in extra) {\n if (skip && hasOwnProperty(skip, name)) continue;\n encode[name] = extend(encode[name] || {}, extra[name]);\n }\n return encode;\n}\nfunction has(key, encode) {\n return encode && (encode.enter && encode.enter[key] || encode.update && encode.update[key]);\n}\n\nconst MarkRole = 'mark';\nconst FrameRole = 'frame';\nconst ScopeRole = 'scope';\nconst AxisRole = 'axis';\nconst AxisDomainRole = 'axis-domain';\nconst AxisGridRole = 'axis-grid';\nconst AxisLabelRole = 'axis-label';\nconst AxisTickRole = 'axis-tick';\nconst AxisTitleRole = 'axis-title';\nconst LegendRole = 'legend';\nconst LegendBandRole = 'legend-band';\nconst LegendEntryRole = 'legend-entry';\nconst LegendGradientRole = 'legend-gradient';\nconst LegendLabelRole = 'legend-label';\nconst LegendSymbolRole = 'legend-symbol';\nconst LegendTitleRole = 'legend-title';\nconst TitleRole = 'title';\nconst TitleTextRole = 'title-text';\nconst TitleSubtitleRole = 'title-subtitle';\n\nfunction applyDefaults (encode, type, role, style, config) {\n const defaults = {},\n enter = {};\n let update, key, skip, props;\n\n // if text mark, apply global lineBreak settings (#2370)\n key = 'lineBreak';\n if (type === 'text' && config[key] != null && !has(key, encode)) {\n applyDefault(defaults, key, config[key]);\n }\n\n // ignore legend and axis roles\n if (role == 'legend' || String(role).startsWith('axis')) {\n role = null;\n }\n\n // resolve mark config\n props = role === FrameRole ? config.group : role === MarkRole ? extend({}, config.mark, config[type]) : null;\n for (key in props) {\n // do not apply defaults if relevant fields are defined\n skip = has(key, encode) || (key === 'fill' || key === 'stroke') && (has('fill', encode) || has('stroke', encode));\n if (!skip) applyDefault(defaults, key, props[key]);\n }\n\n // resolve styles, apply with increasing precedence\n array(style).forEach(name => {\n const props = config.style && config.style[name];\n for (const key in props) {\n if (!has(key, encode)) {\n applyDefault(defaults, key, props[key]);\n }\n }\n });\n encode = extend({}, encode); // defensive copy\n for (key in defaults) {\n props = defaults[key];\n if (props.signal) {\n (update = update || {})[key] = props;\n } else {\n enter[key] = props;\n }\n }\n encode.enter = extend(enter, encode.enter);\n if (update) encode.update = extend(update, encode.update);\n return encode;\n}\nfunction applyDefault(defaults, key, value) {\n defaults[key] = value && value.signal ? {\n signal: value.signal\n } : {\n value: value\n };\n}\n\nconst scaleRef = scale => isString(scale) ? stringValue(scale) : scale.signal ? `(${scale.signal})` : field(scale);\nfunction entry$1(enc) {\n if (enc.gradient != null) {\n return gradient(enc);\n }\n let value = enc.signal ? `(${enc.signal})` : enc.color ? color(enc.color) : enc.field != null ? field(enc.field) : enc.value !== undefined ? stringValue(enc.value) : undefined;\n if (enc.scale != null) {\n value = scale(enc, value);\n }\n if (value === undefined) {\n value = null;\n }\n if (enc.exponent != null) {\n value = `pow(${value},${property(enc.exponent)})`;\n }\n if (enc.mult != null) {\n value += `*${property(enc.mult)}`;\n }\n if (enc.offset != null) {\n value += `+${property(enc.offset)}`;\n }\n if (enc.round) {\n value = `round(${value})`;\n }\n return value;\n}\nconst _color = (type, x, y, z) => `(${type}(${[x, y, z].map(entry$1).join(',')})+'')`;\nfunction color(enc) {\n return enc.c ? _color('hcl', enc.h, enc.c, enc.l) : enc.h || enc.s ? _color('hsl', enc.h, enc.s, enc.l) : enc.l || enc.a ? _color('lab', enc.l, enc.a, enc.b) : enc.r || enc.g || enc.b ? _color('rgb', enc.r, enc.g, enc.b) : null;\n}\nfunction gradient(enc) {\n // map undefined to null; expression lang does not allow undefined\n const args = [enc.start, enc.stop, enc.count].map(_ => _ == null ? null : stringValue(_));\n\n // trim null inputs from the end\n while (args.length && peek(args) == null) args.pop();\n args.unshift(scaleRef(enc.gradient));\n return `gradient(${args.join(',')})`;\n}\nfunction property(property) {\n return isObject(property) ? '(' + entry$1(property) + ')' : property;\n}\nfunction field(ref) {\n return resolveField(isObject(ref) ? ref : {\n datum: ref\n });\n}\nfunction resolveField(ref) {\n let object, level, field;\n if (ref.signal) {\n object = 'datum';\n field = ref.signal;\n } else if (ref.group || ref.parent) {\n level = Math.max(1, ref.level || 1);\n object = 'item';\n while (level-- > 0) {\n object += '.mark.group';\n }\n if (ref.parent) {\n field = ref.parent;\n object += '.datum';\n } else {\n field = ref.group;\n }\n } else if (ref.datum) {\n object = 'datum';\n field = ref.datum;\n } else {\n error('Invalid field reference: ' + stringValue(ref));\n }\n if (!ref.signal) {\n field = isString(field) ? splitAccessPath(field).map(stringValue).join('][') : resolveField(field);\n }\n return object + '[' + field + ']';\n}\nfunction scale(enc, value) {\n const scale = scaleRef(enc.scale);\n if (enc.range != null) {\n // pull value from scale range\n value = `lerp(_range(${scale}), ${+enc.range})`;\n } else {\n // run value through scale and/or pull scale bandwidth\n if (value !== undefined) value = `_scale(${scale}, ${value})`;\n if (enc.band) {\n value = (value ? value + '+' : '') + `_bandwidth(${scale})` + (+enc.band === 1 ? '' : '*' + property(enc.band));\n if (enc.extra) {\n // include logic to handle extraneous elements\n value = `(datum.extra ? _scale(${scale}, datum.extra.value) : ${value})`;\n }\n }\n if (value == null) value = '0';\n }\n return value;\n}\n\nfunction rule (enc) {\n let code = '';\n enc.forEach(rule => {\n const value = entry$1(rule);\n code += rule.test ? `(${rule.test})?${value}:` : value;\n });\n\n // if no else clause, terminate with null (#1366)\n if (peek(code) === ':') {\n code += 'null';\n }\n return code;\n}\n\nfunction parseEncode (encode, type, role, style, scope, params) {\n const enc = {};\n params = params || {};\n params.encoders = {\n $encode: enc\n };\n encode = applyDefaults(encode, type, role, style, scope.config);\n for (const key in encode) {\n enc[key] = parseBlock(encode[key], type, params, scope);\n }\n return params;\n}\nfunction parseBlock(block, marktype, params, scope) {\n const channels = {},\n fields = {};\n for (const name in block) {\n if (block[name] != null) {\n // skip any null entries\n channels[name] = parse$1(expr(block[name]), scope, params, fields);\n }\n }\n return {\n $expr: {\n marktype,\n channels\n },\n $fields: Object.keys(fields),\n $output: Object.keys(block)\n };\n}\nfunction expr(enc) {\n return isArray(enc) ? rule(enc) : entry$1(enc);\n}\nfunction parse$1(code, scope, params, fields) {\n const expr = parseExpression(code, scope);\n expr.$fields.forEach(name => fields[name] = 1);\n extend(params, expr.$params);\n return expr.$expr;\n}\n\nconst OUTER = 'outer',\n OUTER_INVALID = ['value', 'update', 'init', 'react', 'bind'];\nfunction outerError(prefix, name) {\n error(prefix + ' for \"outer\" push: ' + stringValue(name));\n}\nfunction parseSignal (signal, scope) {\n const name = signal.name;\n if (signal.push === OUTER) {\n // signal must already be defined, raise error if not\n if (!scope.signals[name]) outerError('No prior signal definition', name);\n // signal push must not use properties reserved for standard definition\n OUTER_INVALID.forEach(prop => {\n if (signal[prop] !== undefined) outerError('Invalid property ', prop);\n });\n } else {\n // define a new signal in the current scope\n const op = scope.addSignal(name, signal.value);\n if (signal.react === false) op.react = false;\n if (signal.bind) scope.addBinding(name, signal.bind);\n }\n}\n\nfunction Entry(type, value, params, parent) {\n this.id = -1;\n this.type = type;\n this.value = value;\n this.params = params;\n if (parent) this.parent = parent;\n}\nfunction entry(type, value, params, parent) {\n return new Entry(type, value, params, parent);\n}\nfunction operator(value, params) {\n return entry('operator', value, params);\n}\n\n// -----\n\nfunction ref(op) {\n const ref = {\n $ref: op.id\n };\n // if operator not yet registered, cache ref to resolve later\n if (op.id < 0) (op.refs = op.refs || []).push(ref);\n return ref;\n}\nfunction fieldRef$1(field, name) {\n return name ? {\n $field: field,\n $name: name\n } : {\n $field: field\n };\n}\nconst keyFieldRef = fieldRef$1('key');\nfunction compareRef(fields, orders) {\n return {\n $compare: fields,\n $order: orders\n };\n}\nfunction keyRef(fields, flat) {\n const ref = {\n $key: fields\n };\n if (flat) ref.$flat = true;\n return ref;\n}\n\n// -----\n\nconst Ascending = 'ascending';\nconst Descending = 'descending';\nfunction sortKey(sort) {\n return !isObject(sort) ? '' : (sort.order === Descending ? '-' : '+') + aggrField(sort.op, sort.field);\n}\nfunction aggrField(op, field) {\n return (op && op.signal ? '$' + op.signal : op || '') + (op && field ? '_' : '') + (field && field.signal ? '$' + field.signal : field || '');\n}\n\n// -----\n\nconst Scope$1 = 'scope';\nconst View = 'view';\nfunction isSignal(_) {\n return _ && _.signal;\n}\nfunction isExpr$1(_) {\n return _ && _.expr;\n}\nfunction hasSignal(_) {\n if (isSignal(_)) return true;\n if (isObject(_)) for (const key in _) {\n if (hasSignal(_[key])) return true;\n }\n return false;\n}\nfunction value(specValue, defaultValue) {\n return specValue != null ? specValue : defaultValue;\n}\nfunction deref(v) {\n return v && v.signal || v;\n}\n\nconst Timer = 'timer';\nfunction parseStream(stream, scope) {\n const method = stream.merge ? mergeStream : stream.stream ? nestedStream : stream.type ? eventStream : error('Invalid stream specification: ' + stringValue(stream));\n return method(stream, scope);\n}\nfunction eventSource(source) {\n return source === Scope$1 ? View : source || View;\n}\nfunction mergeStream(stream, scope) {\n const list = stream.merge.map(s => parseStream(s, scope)),\n entry = streamParameters({\n merge: list\n }, stream, scope);\n return scope.addStream(entry).id;\n}\nfunction nestedStream(stream, scope) {\n const id = parseStream(stream.stream, scope),\n entry = streamParameters({\n stream: id\n }, stream, scope);\n return scope.addStream(entry).id;\n}\nfunction eventStream(stream, scope) {\n let id;\n if (stream.type === Timer) {\n id = scope.event(Timer, stream.throttle);\n stream = {\n between: stream.between,\n filter: stream.filter\n };\n } else {\n id = scope.event(eventSource(stream.source), stream.type);\n }\n const entry = streamParameters({\n stream: id\n }, stream, scope);\n return Object.keys(entry).length === 1 ? id : scope.addStream(entry).id;\n}\nfunction streamParameters(entry, stream, scope) {\n let param = stream.between;\n if (param) {\n if (param.length !== 2) {\n error('Stream \"between\" parameter must have 2 entries: ' + stringValue(stream));\n }\n entry.between = [parseStream(param[0], scope), parseStream(param[1], scope)];\n }\n param = stream.filter ? [].concat(stream.filter) : [];\n if (stream.marktype || stream.markname || stream.markrole) {\n // add filter for mark type, name and/or role\n param.push(filterMark(stream.marktype, stream.markname, stream.markrole));\n }\n if (stream.source === Scope$1) {\n // add filter to limit events from sub-scope only\n param.push('inScope(event.item)');\n }\n if (param.length) {\n entry.filter = parseExpression('(' + param.join(')&&(') + ')', scope).$expr;\n }\n if ((param = stream.throttle) != null) {\n entry.throttle = +param;\n }\n if ((param = stream.debounce) != null) {\n entry.debounce = +param;\n }\n if (stream.consume) {\n entry.consume = true;\n }\n return entry;\n}\nfunction filterMark(type, name, role) {\n const item = 'event.item';\n return item + (type && type !== '*' ? '&&' + item + '.mark.marktype===\\'' + type + '\\'' : '') + (role ? '&&' + item + '.mark.role===\\'' + role + '\\'' : '') + (name ? '&&' + item + '.mark.name===\\'' + name + '\\'' : '');\n}\n\n// bypass expression parser for internal operator references\nconst OP_VALUE_EXPR = {\n code: '_.$value',\n ast: {\n type: 'Identifier',\n value: 'value'\n }\n};\nfunction parseUpdate (spec, scope, target) {\n const encode = spec.encode,\n entry = {\n target: target\n };\n let events = spec.events,\n update = spec.update,\n sources = [];\n if (!events) {\n error('Signal update missing events specification.');\n }\n\n // interpret as an event selector string\n if (isString(events)) {\n events = parseSelector(events, scope.isSubscope() ? Scope$1 : View);\n }\n\n // separate event streams from signal updates\n events = array(events).filter(s => s.signal || s.scale ? (sources.push(s), 0) : 1);\n\n // merge internal operator listeners\n if (sources.length > 1) {\n sources = [mergeSources(sources)];\n }\n\n // merge event streams, include as source\n if (events.length) {\n sources.push(events.length > 1 ? {\n merge: events\n } : events[0]);\n }\n if (encode != null) {\n if (update) error('Signal encode and update are mutually exclusive.');\n update = 'encode(item(),' + stringValue(encode) + ')';\n }\n\n // resolve update value\n entry.update = isString(update) ? parseExpression(update, scope) : update.expr != null ? parseExpression(update.expr, scope) : update.value != null ? update.value : update.signal != null ? {\n $expr: OP_VALUE_EXPR,\n $params: {\n $value: scope.signalRef(update.signal)\n }\n } : error('Invalid signal update specification.');\n if (spec.force) {\n entry.options = {\n force: true\n };\n }\n sources.forEach(source => scope.addUpdate(extend(streamSource(source, scope), entry)));\n}\nfunction streamSource(stream, scope) {\n return {\n source: stream.signal ? scope.signalRef(stream.signal) : stream.scale ? scope.scaleRef(stream.scale) : parseStream(stream, scope)\n };\n}\nfunction mergeSources(sources) {\n return {\n signal: '[' + sources.map(s => s.scale ? 'scale(\"' + s.scale + '\")' : s.signal) + ']'\n };\n}\n\nfunction parseSignalUpdates (signal, scope) {\n const op = scope.getSignal(signal.name);\n let expr = signal.update;\n if (signal.init) {\n if (expr) {\n error('Signals can not include both init and update expressions.');\n } else {\n expr = signal.init;\n op.initonly = true;\n }\n }\n if (expr) {\n expr = parseExpression(expr, scope);\n op.update = expr.$expr;\n op.params = expr.$params;\n }\n if (signal.on) {\n signal.on.forEach(_ => parseUpdate(_, scope, op.id));\n }\n}\n\nconst transform = name => (params, value, parent) => entry(name, value, params || undefined, parent);\nconst Aggregate = transform('aggregate');\nconst AxisTicks = transform('axisticks');\nconst Bound = transform('bound');\nconst Collect = transform('collect');\nconst Compare = transform('compare');\nconst DataJoin = transform('datajoin');\nconst Encode = transform('encode');\nconst Expression = transform('expression');\nconst Facet = transform('facet');\nconst Field = transform('field');\nconst Key = transform('key');\nconst LegendEntries = transform('legendentries');\nconst Load = transform('load');\nconst Mark = transform('mark');\nconst MultiExtent = transform('multiextent');\nconst MultiValues = transform('multivalues');\nconst Overlap = transform('overlap');\nconst Params = transform('params');\nconst PreFacet = transform('prefacet');\nconst Projection = transform('projection');\nconst Proxy = transform('proxy');\nconst Relay = transform('relay');\nconst Render = transform('render');\nconst Scale = transform('scale');\nconst Sieve = transform('sieve');\nconst SortItems = transform('sortitems');\nconst ViewLayout = transform('viewlayout');\nconst Values = transform('values');\n\nlet FIELD_REF_ID = 0;\nconst MULTIDOMAIN_SORT_OPS = {\n min: 'min',\n max: 'max',\n count: 'sum'\n};\nfunction initScale(spec, scope) {\n const type = spec.type || 'linear';\n if (!isValidScaleType(type)) {\n error('Unrecognized scale type: ' + stringValue(type));\n }\n scope.addScale(spec.name, {\n type,\n domain: undefined\n });\n}\nfunction parseScale(spec, scope) {\n const params = scope.getScale(spec.name).params;\n let key;\n params.domain = parseScaleDomain(spec.domain, spec, scope);\n if (spec.range != null) {\n params.range = parseScaleRange(spec, scope, params);\n }\n if (spec.interpolate != null) {\n parseScaleInterpolate(spec.interpolate, params);\n }\n if (spec.nice != null) {\n params.nice = parseScaleNice(spec.nice);\n }\n if (spec.bins != null) {\n params.bins = parseScaleBins(spec.bins, scope);\n }\n for (key in spec) {\n if (hasOwnProperty(params, key) || key === 'name') continue;\n params[key] = parseLiteral(spec[key], scope);\n }\n}\nfunction parseLiteral(v, scope) {\n return !isObject(v) ? v : v.signal ? scope.signalRef(v.signal) : error('Unsupported object: ' + stringValue(v));\n}\nfunction parseArray(v, scope) {\n return v.signal ? scope.signalRef(v.signal) : v.map(v => parseLiteral(v, scope));\n}\nfunction dataLookupError(name) {\n error('Can not find data set: ' + stringValue(name));\n}\n\n// -- SCALE DOMAIN ----\n\nfunction parseScaleDomain(domain, spec, scope) {\n if (!domain) {\n if (spec.domainMin != null || spec.domainMax != null) {\n error('No scale domain defined for domainMin/domainMax to override.');\n }\n return; // default domain\n }\n\n return domain.signal ? scope.signalRef(domain.signal) : (isArray(domain) ? explicitDomain : domain.fields ? multipleDomain : singularDomain)(domain, spec, scope);\n}\nfunction explicitDomain(domain, spec, scope) {\n return domain.map(v => parseLiteral(v, scope));\n}\nfunction singularDomain(domain, spec, scope) {\n const data = scope.getData(domain.data);\n if (!data) dataLookupError(domain.data);\n return isDiscrete(spec.type) ? data.valuesRef(scope, domain.field, parseSort(domain.sort, false)) : isQuantile(spec.type) ? data.domainRef(scope, domain.field) : data.extentRef(scope, domain.field);\n}\nfunction multipleDomain(domain, spec, scope) {\n const data = domain.data,\n fields = domain.fields.reduce((dom, d) => {\n d = isString(d) ? {\n data: data,\n field: d\n } : isArray(d) || d.signal ? fieldRef(d, scope) : d;\n dom.push(d);\n return dom;\n }, []);\n return (isDiscrete(spec.type) ? ordinalMultipleDomain : isQuantile(spec.type) ? quantileMultipleDomain : numericMultipleDomain)(domain, scope, fields);\n}\nfunction fieldRef(data, scope) {\n const name = '_:vega:_' + FIELD_REF_ID++,\n coll = Collect({});\n if (isArray(data)) {\n coll.value = {\n $ingest: data\n };\n } else if (data.signal) {\n const code = 'setdata(' + stringValue(name) + ',' + data.signal + ')';\n coll.params.input = scope.signalRef(code);\n }\n scope.addDataPipeline(name, [coll, Sieve({})]);\n return {\n data: name,\n field: 'data'\n };\n}\nfunction ordinalMultipleDomain(domain, scope, fields) {\n const sort = parseSort(domain.sort, true);\n let a, v;\n\n // get value counts for each domain field\n const counts = fields.map(f => {\n const data = scope.getData(f.data);\n if (!data) dataLookupError(f.data);\n return data.countsRef(scope, f.field, sort);\n });\n\n // aggregate the results from each domain field\n const p = {\n groupby: keyFieldRef,\n pulse: counts\n };\n if (sort) {\n a = sort.op || 'count';\n v = sort.field ? aggrField(a, sort.field) : 'count';\n p.ops = [MULTIDOMAIN_SORT_OPS[a]];\n p.fields = [scope.fieldRef(v)];\n p.as = [v];\n }\n a = scope.add(Aggregate(p));\n\n // collect aggregate output\n const c = scope.add(Collect({\n pulse: ref(a)\n }));\n\n // extract values for combined domain\n v = scope.add(Values({\n field: keyFieldRef,\n sort: scope.sortRef(sort),\n pulse: ref(c)\n }));\n return ref(v);\n}\nfunction parseSort(sort, multidomain) {\n if (sort) {\n if (!sort.field && !sort.op) {\n if (isObject(sort)) sort.field = 'key';else sort = {\n field: 'key'\n };\n } else if (!sort.field && sort.op !== 'count') {\n error('No field provided for sort aggregate op: ' + sort.op);\n } else if (multidomain && sort.field) {\n if (sort.op && !MULTIDOMAIN_SORT_OPS[sort.op]) {\n error('Multiple domain scales can not be sorted using ' + sort.op);\n }\n }\n }\n return sort;\n}\nfunction quantileMultipleDomain(domain, scope, fields) {\n // get value arrays for each domain field\n const values = fields.map(f => {\n const data = scope.getData(f.data);\n if (!data) dataLookupError(f.data);\n return data.domainRef(scope, f.field);\n });\n\n // combine value arrays\n return ref(scope.add(MultiValues({\n values: values\n })));\n}\nfunction numericMultipleDomain(domain, scope, fields) {\n // get extents for each domain field\n const extents = fields.map(f => {\n const data = scope.getData(f.data);\n if (!data) dataLookupError(f.data);\n return data.extentRef(scope, f.field);\n });\n\n // combine extents\n return ref(scope.add(MultiExtent({\n extents: extents\n })));\n}\n\n// -- SCALE BINS -----\n\nfunction parseScaleBins(v, scope) {\n return v.signal || isArray(v) ? parseArray(v, scope) : scope.objectProperty(v);\n}\n\n// -- SCALE NICE -----\n\nfunction parseScaleNice(nice) {\n return isObject(nice) ? {\n interval: parseLiteral(nice.interval),\n step: parseLiteral(nice.step)\n } : parseLiteral(nice);\n}\n\n// -- SCALE INTERPOLATION -----\n\nfunction parseScaleInterpolate(interpolate, params) {\n params.interpolate = parseLiteral(interpolate.type || interpolate);\n if (interpolate.gamma != null) {\n params.interpolateGamma = parseLiteral(interpolate.gamma);\n }\n}\n\n// -- SCALE RANGE -----\n\nfunction parseScaleRange(spec, scope, params) {\n const config = scope.config.range;\n let range = spec.range;\n if (range.signal) {\n return scope.signalRef(range.signal);\n } else if (isString(range)) {\n if (config && hasOwnProperty(config, range)) {\n spec = extend({}, spec, {\n range: config[range]\n });\n return parseScaleRange(spec, scope, params);\n } else if (range === 'width') {\n range = [0, {\n signal: 'width'\n }];\n } else if (range === 'height') {\n range = isDiscrete(spec.type) ? [0, {\n signal: 'height'\n }] : [{\n signal: 'height'\n }, 0];\n } else {\n error('Unrecognized scale range value: ' + stringValue(range));\n }\n } else if (range.scheme) {\n params.scheme = isArray(range.scheme) ? parseArray(range.scheme, scope) : parseLiteral(range.scheme, scope);\n if (range.extent) params.schemeExtent = parseArray(range.extent, scope);\n if (range.count) params.schemeCount = parseLiteral(range.count, scope);\n return;\n } else if (range.step) {\n params.rangeStep = parseLiteral(range.step, scope);\n return;\n } else if (isDiscrete(spec.type) && !isArray(range)) {\n return parseScaleDomain(range, spec, scope);\n } else if (!isArray(range)) {\n error('Unsupported range type: ' + stringValue(range));\n }\n return range.map(v => (isArray(v) ? parseArray : parseLiteral)(v, scope));\n}\n\nfunction parseProjection (proj, scope) {\n const config = scope.config.projection || {},\n params = {};\n for (const name in proj) {\n if (name === 'name') continue;\n params[name] = parseParameter$1(proj[name], name, scope);\n }\n\n // apply projection defaults from config\n for (const name in config) {\n if (params[name] == null) {\n params[name] = parseParameter$1(config[name], name, scope);\n }\n }\n scope.addProjection(proj.name, params);\n}\nfunction parseParameter$1(_, name, scope) {\n return isArray(_) ? _.map(_ => parseParameter$1(_, name, scope)) : !isObject(_) ? _ : _.signal ? scope.signalRef(_.signal) : name === 'fit' ? _ : error('Unsupported parameter object: ' + stringValue(_));\n}\n\nconst Top = 'top';\nconst Left = 'left';\nconst Right = 'right';\nconst Bottom = 'bottom';\nconst Center = 'center';\nconst Vertical = 'vertical';\nconst Start = 'start';\nconst Middle = 'middle';\nconst End = 'end';\nconst Index = 'index';\nconst Label = 'label';\nconst Offset = 'offset';\nconst Perc = 'perc';\nconst Perc2 = 'perc2';\nconst Value = 'value';\nconst GuideLabelStyle = 'guide-label';\nconst GuideTitleStyle = 'guide-title';\nconst GroupTitleStyle = 'group-title';\nconst GroupSubtitleStyle = 'group-subtitle';\nconst Symbols = 'symbol';\nconst Gradient = 'gradient';\nconst Discrete = 'discrete';\nconst Size = 'size';\nconst Shape = 'shape';\nconst Fill = 'fill';\nconst Stroke = 'stroke';\nconst StrokeWidth = 'strokeWidth';\nconst StrokeDash = 'strokeDash';\nconst Opacity = 'opacity';\n\n// Encoding channels supported by legends\n// In priority order of 'canonical' scale\nconst LegendScales = [Size, Shape, Fill, Stroke, StrokeWidth, StrokeDash, Opacity];\nconst Skip = {\n name: 1,\n style: 1,\n interactive: 1\n};\nconst zero = {\n value: 0\n};\nconst one = {\n value: 1\n};\n\nconst GroupMark = 'group';\nconst RectMark = 'rect';\nconst RuleMark = 'rule';\nconst SymbolMark = 'symbol';\nconst TextMark = 'text';\n\nfunction guideGroup (mark) {\n mark.type = GroupMark;\n mark.interactive = mark.interactive || false;\n return mark;\n}\n\nfunction lookup(spec, config) {\n const _ = (name, dflt) => value(spec[name], value(config[name], dflt));\n _.isVertical = s => Vertical === value(spec.direction, config.direction || (s ? config.symbolDirection : config.gradientDirection));\n _.gradientLength = () => value(spec.gradientLength, config.gradientLength || config.gradientWidth);\n _.gradientThickness = () => value(spec.gradientThickness, config.gradientThickness || config.gradientHeight);\n _.entryColumns = () => value(spec.columns, value(config.columns, +_.isVertical(true)));\n return _;\n}\nfunction getEncoding(name, encode) {\n const v = encode && (encode.update && encode.update[name] || encode.enter && encode.enter[name]);\n return v && v.signal ? v : v ? v.value : null;\n}\nfunction getStyle(name, scope, style) {\n const s = scope.config.style[style];\n return s && s[name];\n}\nfunction anchorExpr(s, e, m) {\n return `item.anchor === '${Start}' ? ${s} : item.anchor === '${End}' ? ${e} : ${m}`;\n}\nconst alignExpr$1 = anchorExpr(stringValue(Left), stringValue(Right), stringValue(Center));\nfunction tickBand(_) {\n const v = _('tickBand');\n let offset = _('tickOffset'),\n band,\n extra;\n if (!v) {\n // if no tick band entry, fall back on other properties\n band = _('bandPosition');\n extra = _('tickExtra');\n } else if (v.signal) {\n // if signal, augment code to interpret values\n band = {\n signal: `(${v.signal}) === 'extent' ? 1 : 0.5`\n };\n extra = {\n signal: `(${v.signal}) === 'extent'`\n };\n if (!isObject(offset)) {\n offset = {\n signal: `(${v.signal}) === 'extent' ? 0 : ${offset}`\n };\n }\n } else if (v === 'extent') {\n // if constant, simply set values\n band = 1;\n extra = true;\n offset = 0;\n } else {\n band = 0.5;\n extra = false;\n }\n return {\n extra,\n band,\n offset\n };\n}\nfunction extendOffset(value, offset) {\n return !offset ? value : !value ? offset : !isObject(value) ? {\n value,\n offset\n } : Object.assign({}, value, {\n offset: extendOffset(value.offset, offset)\n });\n}\n\nfunction guideMark (mark, extras) {\n if (extras) {\n mark.name = extras.name;\n mark.style = extras.style || mark.style;\n mark.interactive = !!extras.interactive;\n mark.encode = extendEncode(mark.encode, extras, Skip);\n } else {\n mark.interactive = false;\n }\n return mark;\n}\n\nfunction legendGradient (spec, scale, config, userEncode) {\n const _ = lookup(spec, config),\n vertical = _.isVertical(),\n thickness = _.gradientThickness(),\n length = _.gradientLength();\n let enter, start, stop, width, height;\n if (vertical) {\n start = [0, 1];\n stop = [0, 0];\n width = thickness;\n height = length;\n } else {\n start = [0, 0];\n stop = [1, 0];\n width = length;\n height = thickness;\n }\n const encode = {\n enter: enter = {\n opacity: zero,\n x: zero,\n y: zero,\n width: encoder(width),\n height: encoder(height)\n },\n update: extend({}, enter, {\n opacity: one,\n fill: {\n gradient: scale,\n start: start,\n stop: stop\n }\n }),\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('gradientStrokeColor'),\n strokeWidth: _('gradientStrokeWidth')\n }, {\n // update\n opacity: _('gradientOpacity')\n });\n return guideMark({\n type: RectMark,\n role: LegendGradientRole,\n encode\n }, userEncode);\n}\n\nfunction legendGradientDiscrete (spec, scale, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n vertical = _.isVertical(),\n thickness = _.gradientThickness(),\n length = _.gradientLength();\n let u,\n v,\n uu,\n vv,\n adjust = '';\n vertical ? (u = 'y', uu = 'y2', v = 'x', vv = 'width', adjust = '1-') : (u = 'x', uu = 'x2', v = 'y', vv = 'height');\n const enter = {\n opacity: zero,\n fill: {\n scale: scale,\n field: Value\n }\n };\n enter[u] = {\n signal: adjust + 'datum.' + Perc,\n mult: length\n };\n enter[v] = zero;\n enter[uu] = {\n signal: adjust + 'datum.' + Perc2,\n mult: length\n };\n enter[vv] = encoder(thickness);\n const encode = {\n enter: enter,\n update: extend({}, enter, {\n opacity: one\n }),\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('gradientStrokeColor'),\n strokeWidth: _('gradientStrokeWidth')\n }, {\n // update\n opacity: _('gradientOpacity')\n });\n return guideMark({\n type: RectMark,\n role: LegendBandRole,\n key: Value,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nconst alignExpr = `datum.${Perc}<=0?\"${Left}\":datum.${Perc}>=1?\"${Right}\":\"${Center}\"`,\n baselineExpr = `datum.${Perc}<=0?\"${Bottom}\":datum.${Perc}>=1?\"${Top}\":\"${Middle}\"`;\nfunction legendGradientLabels (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n vertical = _.isVertical(),\n thickness = encoder(_.gradientThickness()),\n length = _.gradientLength();\n let overlap = _('labelOverlap'),\n enter,\n update,\n u,\n v,\n adjust = '';\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one,\n text: {\n field: Label\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n fill: _('labelColor'),\n fillOpacity: _('labelOpacity'),\n font: _('labelFont'),\n fontSize: _('labelFontSize'),\n fontStyle: _('labelFontStyle'),\n fontWeight: _('labelFontWeight'),\n limit: value(spec.labelLimit, config.gradientLabelLimit)\n });\n if (vertical) {\n enter.align = {\n value: 'left'\n };\n enter.baseline = update.baseline = {\n signal: baselineExpr\n };\n u = 'y';\n v = 'x';\n adjust = '1-';\n } else {\n enter.align = update.align = {\n signal: alignExpr\n };\n enter.baseline = {\n value: 'top'\n };\n u = 'x';\n v = 'y';\n }\n enter[u] = update[u] = {\n signal: adjust + 'datum.' + Perc,\n mult: length\n };\n enter[v] = update[v] = thickness;\n thickness.offset = value(spec.labelOffset, config.gradientLabelOffset) || 0;\n overlap = overlap ? {\n separation: _('labelSeparation'),\n method: overlap,\n order: 'datum.' + Index\n } : undefined;\n\n // type, role, style, key, dataRef, encode, extras\n return guideMark({\n type: TextMark,\n role: LegendLabelRole,\n style: GuideLabelStyle,\n key: Value,\n from: dataRef,\n encode,\n overlap\n }, userEncode);\n}\n\n// userEncode is top-level, includes entries, symbols, labels\nfunction legendSymbolGroups (spec, config, userEncode, dataRef, columns) {\n const _ = lookup(spec, config),\n entries = userEncode.entries,\n interactive = !!(entries && entries.interactive),\n name = entries ? entries.name : undefined,\n height = _('clipHeight'),\n symbolOffset = _('symbolOffset'),\n valueRef = {\n data: 'value'\n },\n xSignal = `(${columns}) ? datum.${Offset} : datum.${Size}`,\n yEncode = height ? encoder(height) : {\n field: Size\n },\n index = `datum.${Index}`,\n ncols = `max(1, ${columns})`;\n let encode, enter, update, nrows, sort;\n yEncode.mult = 0.5;\n\n // -- LEGEND SYMBOLS --\n encode = {\n enter: enter = {\n opacity: zero,\n x: {\n signal: xSignal,\n mult: 0.5,\n offset: symbolOffset\n },\n y: yEncode\n },\n update: update = {\n opacity: one,\n x: enter.x,\n y: enter.y\n },\n exit: {\n opacity: zero\n }\n };\n let baseFill = null,\n baseStroke = null;\n if (!spec.fill) {\n baseFill = config.symbolBaseFillColor;\n baseStroke = config.symbolBaseStrokeColor;\n }\n addEncoders(encode, {\n fill: _('symbolFillColor', baseFill),\n shape: _('symbolType'),\n size: _('symbolSize'),\n stroke: _('symbolStrokeColor', baseStroke),\n strokeDash: _('symbolDash'),\n strokeDashOffset: _('symbolDashOffset'),\n strokeWidth: _('symbolStrokeWidth')\n }, {\n // update\n opacity: _('symbolOpacity')\n });\n LegendScales.forEach(scale => {\n if (spec[scale]) {\n update[scale] = enter[scale] = {\n scale: spec[scale],\n field: Value\n };\n }\n });\n const symbols = guideMark({\n type: SymbolMark,\n role: LegendSymbolRole,\n key: Value,\n from: valueRef,\n clip: height ? true : undefined,\n encode\n }, userEncode.symbols);\n\n // -- LEGEND LABELS --\n const labelOffset = encoder(symbolOffset);\n labelOffset.offset = _('labelOffset');\n encode = {\n enter: enter = {\n opacity: zero,\n x: {\n signal: xSignal,\n offset: labelOffset\n },\n y: yEncode\n },\n update: update = {\n opacity: one,\n text: {\n field: Label\n },\n x: enter.x,\n y: enter.y\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n align: _('labelAlign'),\n baseline: _('labelBaseline'),\n fill: _('labelColor'),\n fillOpacity: _('labelOpacity'),\n font: _('labelFont'),\n fontSize: _('labelFontSize'),\n fontStyle: _('labelFontStyle'),\n fontWeight: _('labelFontWeight'),\n limit: _('labelLimit')\n });\n const labels = guideMark({\n type: TextMark,\n role: LegendLabelRole,\n style: GuideLabelStyle,\n key: Value,\n from: valueRef,\n encode\n }, userEncode.labels);\n\n // -- LEGEND ENTRY GROUPS --\n encode = {\n enter: {\n noBound: {\n value: !height\n },\n // ignore width/height in bounds calc\n width: zero,\n height: height ? encoder(height) : zero,\n opacity: zero\n },\n exit: {\n opacity: zero\n },\n update: update = {\n opacity: one,\n row: {\n signal: null\n },\n column: {\n signal: null\n }\n }\n };\n\n // annotate and sort groups to ensure correct ordering\n if (_.isVertical(true)) {\n nrows = `ceil(item.mark.items.length / ${ncols})`;\n update.row.signal = `${index}%${nrows}`;\n update.column.signal = `floor(${index} / ${nrows})`;\n sort = {\n field: ['row', index]\n };\n } else {\n update.row.signal = `floor(${index} / ${ncols})`;\n update.column.signal = `${index} % ${ncols}`;\n sort = {\n field: index\n };\n }\n // handle zero column case (implies infinite columns)\n update.column.signal = `(${columns})?${update.column.signal}:${index}`;\n\n // facet legend entries into sub-groups\n dataRef = {\n facet: {\n data: dataRef,\n name: 'value',\n groupby: Index\n }\n };\n return guideGroup({\n role: ScopeRole,\n from: dataRef,\n encode: extendEncode(encode, entries, Skip),\n marks: [symbols, labels],\n name,\n interactive,\n sort\n });\n}\nfunction legendSymbolLayout(spec, config) {\n const _ = lookup(spec, config);\n\n // layout parameters for legend entries\n return {\n align: _('gridAlign'),\n columns: _.entryColumns(),\n center: {\n row: true,\n column: false\n },\n padding: {\n row: _('rowPadding'),\n column: _('columnPadding')\n }\n };\n}\n\n// expression logic for align, anchor, angle, and baseline calculation\nconst isL = 'item.orient === \"left\"',\n isR = 'item.orient === \"right\"',\n isLR = `(${isL} || ${isR})`,\n isVG = `datum.vgrad && ${isLR}`,\n baseline = anchorExpr('\"top\"', '\"bottom\"', '\"middle\"'),\n alignFlip = anchorExpr('\"right\"', '\"left\"', '\"center\"'),\n exprAlign = `datum.vgrad && ${isR} ? (${alignFlip}) : (${isLR} && !(datum.vgrad && ${isL})) ? \"left\" : ${alignExpr$1}`,\n exprAnchor = `item._anchor || (${isLR} ? \"middle\" : \"start\")`,\n exprAngle = `${isVG} ? (${isL} ? -90 : 90) : 0`,\n exprBaseline = `${isLR} ? (datum.vgrad ? (${isR} ? \"bottom\" : \"top\") : ${baseline}) : \"top\"`;\nfunction legendTitle (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config);\n const encode = {\n enter: {\n opacity: zero\n },\n update: {\n opacity: one,\n x: {\n field: {\n group: 'padding'\n }\n },\n y: {\n field: {\n group: 'padding'\n }\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n orient: _('titleOrient'),\n _anchor: _('titleAnchor'),\n anchor: {\n signal: exprAnchor\n },\n angle: {\n signal: exprAngle\n },\n align: {\n signal: exprAlign\n },\n baseline: {\n signal: exprBaseline\n },\n text: spec.title,\n fill: _('titleColor'),\n fillOpacity: _('titleOpacity'),\n font: _('titleFont'),\n fontSize: _('titleFontSize'),\n fontStyle: _('titleFontStyle'),\n fontWeight: _('titleFontWeight'),\n limit: _('titleLimit'),\n lineHeight: _('titleLineHeight')\n }, {\n // require update\n align: _('titleAlign'),\n baseline: _('titleBaseline')\n });\n return guideMark({\n type: TextMark,\n role: LegendTitleRole,\n style: GuideTitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction clip (clip, scope) {\n let expr;\n if (isObject(clip)) {\n if (clip.signal) {\n expr = clip.signal;\n } else if (clip.path) {\n expr = 'pathShape(' + param(clip.path) + ')';\n } else if (clip.sphere) {\n expr = 'geoShape(' + param(clip.sphere) + ', {type: \"Sphere\"})';\n }\n }\n return expr ? scope.signalRef(expr) : !!clip;\n}\nfunction param(value) {\n return isObject(value) && value.signal ? value.signal : stringValue(value);\n}\n\nfunction getRole (spec) {\n const role = spec.role || '';\n return !role.indexOf('axis') || !role.indexOf('legend') || !role.indexOf('title') ? role : spec.type === GroupMark ? ScopeRole : role || MarkRole;\n}\n\nfunction definition (spec) {\n return {\n marktype: spec.type,\n name: spec.name || undefined,\n role: spec.role || getRole(spec),\n zindex: +spec.zindex || undefined,\n aria: spec.aria,\n description: spec.description\n };\n}\n\nfunction interactive (spec, scope) {\n return spec && spec.signal ? scope.signalRef(spec.signal) : spec === false ? false : true;\n}\n\n/**\n * Parse a data transform specification.\n */\nfunction parseTransform (spec, scope) {\n const def = definition$1(spec.type);\n if (!def) error('Unrecognized transform type: ' + stringValue(spec.type));\n const t = entry(def.type.toLowerCase(), null, parseParameters(def, spec, scope));\n if (spec.signal) scope.addSignal(spec.signal, scope.proxy(t));\n t.metadata = def.metadata || {};\n return t;\n}\n\n/**\n * Parse all parameters of a data transform.\n */\nfunction parseParameters(def, spec, scope) {\n const params = {},\n n = def.params.length;\n for (let i = 0; i < n; ++i) {\n const pdef = def.params[i];\n params[pdef.name] = parseParameter(pdef, spec, scope);\n }\n return params;\n}\n\n/**\n * Parse a data transform parameter.\n */\nfunction parseParameter(def, spec, scope) {\n const type = def.type,\n value = spec[def.name];\n if (type === 'index') {\n return parseIndexParameter(def, spec, scope);\n } else if (value === undefined) {\n if (def.required) {\n error('Missing required ' + stringValue(spec.type) + ' parameter: ' + stringValue(def.name));\n }\n return;\n } else if (type === 'param') {\n return parseSubParameters(def, spec, scope);\n } else if (type === 'projection') {\n return scope.projectionRef(spec[def.name]);\n }\n return def.array && !isSignal(value) ? value.map(v => parameterValue(def, v, scope)) : parameterValue(def, value, scope);\n}\n\n/**\n * Parse a single parameter value.\n */\nfunction parameterValue(def, value, scope) {\n const type = def.type;\n if (isSignal(value)) {\n return isExpr(type) ? error('Expression references can not be signals.') : isField(type) ? scope.fieldRef(value) : isCompare(type) ? scope.compareRef(value) : scope.signalRef(value.signal);\n } else {\n const expr = def.expr || isField(type);\n return expr && outerExpr(value) ? scope.exprRef(value.expr, value.as) : expr && outerField(value) ? fieldRef$1(value.field, value.as) : isExpr(type) ? parseExpression(value, scope) : isData(type) ? ref(scope.getData(value).values) : isField(type) ? fieldRef$1(value) : isCompare(type) ? scope.compareRef(value) : value;\n }\n}\n\n/**\n * Parse parameter for accessing an index of another data set.\n */\nfunction parseIndexParameter(def, spec, scope) {\n if (!isString(spec.from)) {\n error('Lookup \"from\" parameter must be a string literal.');\n }\n return scope.getData(spec.from).lookupRef(scope, spec.key);\n}\n\n/**\n * Parse a parameter that contains one or more sub-parameter objects.\n */\nfunction parseSubParameters(def, spec, scope) {\n const value = spec[def.name];\n if (def.array) {\n if (!isArray(value)) {\n // signals not allowed!\n error('Expected an array of sub-parameters. Instead: ' + stringValue(value));\n }\n return value.map(v => parseSubParameter(def, v, scope));\n } else {\n return parseSubParameter(def, value, scope);\n }\n}\n\n/**\n * Parse a sub-parameter object.\n */\nfunction parseSubParameter(def, value, scope) {\n const n = def.params.length;\n let pdef;\n\n // loop over defs to find matching key\n for (let i = 0; i < n; ++i) {\n pdef = def.params[i];\n for (const k in pdef.key) {\n if (pdef.key[k] !== value[k]) {\n pdef = null;\n break;\n }\n }\n if (pdef) break;\n }\n // raise error if matching key not found\n if (!pdef) error('Unsupported parameter: ' + stringValue(value));\n\n // parse params, create Params transform, return ref\n const params = extend(parseParameters(pdef, value, scope), pdef.key);\n return ref(scope.add(Params(params)));\n}\n\n// -- Utilities -----\n\nconst outerExpr = _ => _ && _.expr;\nconst outerField = _ => _ && _.field;\nconst isData = _ => _ === 'data';\nconst isExpr = _ => _ === 'expr';\nconst isField = _ => _ === 'field';\nconst isCompare = _ => _ === 'compare';\n\nfunction parseData$1 (from, group, scope) {\n let facet, key, op, dataRef, parent;\n\n // if no source data, generate singleton datum\n if (!from) {\n dataRef = ref(scope.add(Collect(null, [{}])));\n }\n\n // if faceted, process facet specification\n else if (facet = from.facet) {\n if (!group) error('Only group marks can be faceted.');\n\n // use pre-faceted source data, if available\n if (facet.field != null) {\n dataRef = parent = getDataRef(facet, scope);\n } else {\n // generate facet aggregates if no direct data specification\n if (!from.data) {\n op = parseTransform(extend({\n type: 'aggregate',\n groupby: array(facet.groupby)\n }, facet.aggregate), scope);\n op.params.key = scope.keyRef(facet.groupby);\n op.params.pulse = getDataRef(facet, scope);\n dataRef = parent = ref(scope.add(op));\n } else {\n parent = ref(scope.getData(from.data).aggregate);\n }\n key = scope.keyRef(facet.groupby, true);\n }\n }\n\n // if not yet defined, get source data reference\n if (!dataRef) {\n dataRef = getDataRef(from, scope);\n }\n return {\n key: key,\n pulse: dataRef,\n parent: parent\n };\n}\nfunction getDataRef(from, scope) {\n return from.$ref ? from : from.data && from.data.$ref ? from.data : ref(scope.getData(from.data).output);\n}\n\nfunction DataScope(scope, input, output, values, aggr) {\n this.scope = scope; // parent scope object\n this.input = input; // first operator in pipeline (tuple input)\n this.output = output; // last operator in pipeline (tuple output)\n this.values = values; // operator for accessing tuples (but not tuple flow)\n\n // last aggregate in transform pipeline\n this.aggregate = aggr;\n\n // lookup table of field indices\n this.index = {};\n}\nDataScope.fromEntries = function (scope, entries) {\n const n = entries.length,\n values = entries[n - 1],\n output = entries[n - 2];\n let input = entries[0],\n aggr = null,\n i = 1;\n if (input && input.type === 'load') {\n input = entries[1];\n }\n\n // add operator entries to this scope, wire up pulse chain\n scope.add(entries[0]);\n for (; i < n; ++i) {\n entries[i].params.pulse = ref(entries[i - 1]);\n scope.add(entries[i]);\n if (entries[i].type === 'aggregate') aggr = entries[i];\n }\n return new DataScope(scope, input, output, values, aggr);\n};\nfunction fieldKey(field) {\n return isString(field) ? field : null;\n}\nfunction addSortField(scope, p, sort) {\n const as = aggrField(sort.op, sort.field);\n let s;\n if (p.ops) {\n for (let i = 0, n = p.as.length; i < n; ++i) {\n if (p.as[i] === as) return;\n }\n } else {\n p.ops = ['count'];\n p.fields = [null];\n p.as = ['count'];\n }\n if (sort.op) {\n p.ops.push((s = sort.op.signal) ? scope.signalRef(s) : sort.op);\n p.fields.push(scope.fieldRef(sort.field));\n p.as.push(as);\n }\n}\nfunction cache(scope, ds, name, optype, field, counts, index) {\n const cache = ds[name] || (ds[name] = {}),\n sort = sortKey(counts);\n let k = fieldKey(field),\n v,\n op;\n if (k != null) {\n scope = ds.scope;\n k = k + (sort ? '|' + sort : '');\n v = cache[k];\n }\n if (!v) {\n const params = counts ? {\n field: keyFieldRef,\n pulse: ds.countsRef(scope, field, counts)\n } : {\n field: scope.fieldRef(field),\n pulse: ref(ds.output)\n };\n if (sort) params.sort = scope.sortRef(counts);\n op = scope.add(entry(optype, undefined, params));\n if (index) ds.index[field] = op;\n v = ref(op);\n if (k != null) cache[k] = v;\n }\n return v;\n}\nDataScope.prototype = {\n countsRef(scope, field, sort) {\n const ds = this,\n cache = ds.counts || (ds.counts = {}),\n k = fieldKey(field);\n let v, a, p;\n if (k != null) {\n scope = ds.scope;\n v = cache[k];\n }\n if (!v) {\n p = {\n groupby: scope.fieldRef(field, 'key'),\n pulse: ref(ds.output)\n };\n if (sort && sort.field) addSortField(scope, p, sort);\n a = scope.add(Aggregate(p));\n v = scope.add(Collect({\n pulse: ref(a)\n }));\n v = {\n agg: a,\n ref: ref(v)\n };\n if (k != null) cache[k] = v;\n } else if (sort && sort.field) {\n addSortField(scope, v.agg.params, sort);\n }\n return v.ref;\n },\n tuplesRef() {\n return ref(this.values);\n },\n extentRef(scope, field) {\n return cache(scope, this, 'extent', 'extent', field, false);\n },\n domainRef(scope, field) {\n return cache(scope, this, 'domain', 'values', field, false);\n },\n valuesRef(scope, field, sort) {\n return cache(scope, this, 'vals', 'values', field, sort || true);\n },\n lookupRef(scope, field) {\n return cache(scope, this, 'lookup', 'tupleindex', field, false);\n },\n indataRef(scope, field) {\n return cache(scope, this, 'indata', 'tupleindex', field, true, true);\n }\n};\n\nfunction parseFacet (spec, scope, group) {\n const facet = spec.from.facet,\n name = facet.name,\n data = getDataRef(facet, scope);\n let op;\n if (!facet.name) {\n error('Facet must have a name: ' + stringValue(facet));\n }\n if (!facet.data) {\n error('Facet must reference a data set: ' + stringValue(facet));\n }\n if (facet.field) {\n op = scope.add(PreFacet({\n field: scope.fieldRef(facet.field),\n pulse: data\n }));\n } else if (facet.groupby) {\n op = scope.add(Facet({\n key: scope.keyRef(facet.groupby),\n group: ref(scope.proxy(group.parent)),\n pulse: data\n }));\n } else {\n error('Facet must specify groupby or field: ' + stringValue(facet));\n }\n\n // initialize facet subscope\n const subscope = scope.fork(),\n source = subscope.add(Collect()),\n values = subscope.add(Sieve({\n pulse: ref(source)\n }));\n subscope.addData(name, new DataScope(subscope, source, source, values));\n subscope.addSignal('parent', null);\n\n // parse faceted subflow\n op.params.subflow = {\n $subflow: subscope.parse(spec).toRuntime()\n };\n}\n\nfunction parseSubflow (spec, scope, input) {\n const op = scope.add(PreFacet({\n pulse: input.pulse\n })),\n subscope = scope.fork();\n subscope.add(Sieve());\n subscope.addSignal('parent', null);\n\n // parse group mark subflow\n op.params.subflow = {\n $subflow: subscope.parse(spec).toRuntime()\n };\n}\n\nfunction parseTrigger (spec, scope, name) {\n const remove = spec.remove,\n insert = spec.insert,\n toggle = spec.toggle,\n modify = spec.modify,\n values = spec.values,\n op = scope.add(operator());\n const update = 'if(' + spec.trigger + ',modify(\"' + name + '\",' + [insert, remove, toggle, modify, values].map(_ => _ == null ? 'null' : _).join(',') + '),0)';\n const expr = parseExpression(update, scope);\n op.update = expr.$expr;\n op.params = expr.$params;\n}\n\nfunction parseMark (spec, scope) {\n const role = getRole(spec),\n group = spec.type === GroupMark,\n facet = spec.from && spec.from.facet,\n overlap = spec.overlap;\n let layout = spec.layout || role === ScopeRole || role === FrameRole,\n ops,\n op,\n store,\n enc,\n name,\n layoutRef,\n boundRef;\n const nested = role === MarkRole || layout || facet;\n\n // resolve input data\n const input = parseData$1(spec.from, group, scope);\n\n // data join to map tuples to visual items\n op = scope.add(DataJoin({\n key: input.key || (spec.key ? fieldRef$1(spec.key) : undefined),\n pulse: input.pulse,\n clean: !group\n }));\n const joinRef = ref(op);\n\n // collect visual items\n op = store = scope.add(Collect({\n pulse: joinRef\n }));\n\n // connect visual items to scenegraph\n op = scope.add(Mark({\n markdef: definition(spec),\n interactive: interactive(spec.interactive, scope),\n clip: clip(spec.clip, scope),\n context: {\n $context: true\n },\n groups: scope.lookup(),\n parent: scope.signals.parent ? scope.signalRef('parent') : null,\n index: scope.markpath(),\n pulse: ref(op)\n }));\n const markRef = ref(op);\n\n // add visual encoders\n op = enc = scope.add(Encode(parseEncode(spec.encode, spec.type, role, spec.style, scope, {\n mod: false,\n pulse: markRef\n })));\n\n // monitor parent marks to propagate changes\n op.params.parent = scope.encode();\n\n // add post-encoding transforms, if defined\n if (spec.transform) {\n spec.transform.forEach(_ => {\n const tx = parseTransform(_, scope),\n md = tx.metadata;\n if (md.generates || md.changes) {\n error('Mark transforms should not generate new data.');\n }\n if (!md.nomod) enc.params.mod = true; // update encode mod handling\n tx.params.pulse = ref(op);\n scope.add(op = tx);\n });\n }\n\n // if item sort specified, perform post-encoding\n if (spec.sort) {\n op = scope.add(SortItems({\n sort: scope.compareRef(spec.sort),\n pulse: ref(op)\n }));\n }\n const encodeRef = ref(op);\n\n // add view layout operator if needed\n if (facet || layout) {\n layout = scope.add(ViewLayout({\n layout: scope.objectProperty(spec.layout),\n legends: scope.legends,\n mark: markRef,\n pulse: encodeRef\n }));\n layoutRef = ref(layout);\n }\n\n // compute bounding boxes\n const bound = scope.add(Bound({\n mark: markRef,\n pulse: layoutRef || encodeRef\n }));\n boundRef = ref(bound);\n\n // if group mark, recurse to parse nested content\n if (group) {\n // juggle layout & bounds to ensure they run *after* any faceting transforms\n if (nested) {\n ops = scope.operators;\n ops.pop();\n if (layout) ops.pop();\n }\n scope.pushState(encodeRef, layoutRef || boundRef, joinRef);\n facet ? parseFacet(spec, scope, input) // explicit facet\n : nested ? parseSubflow(spec, scope, input) // standard mark group\n : scope.parse(spec); // guide group, we can avoid nested scopes\n scope.popState();\n if (nested) {\n if (layout) ops.push(layout);\n ops.push(bound);\n }\n }\n\n // if requested, add overlap removal transform\n if (overlap) {\n boundRef = parseOverlap(overlap, boundRef, scope);\n }\n\n // render / sieve items\n const render = scope.add(Render({\n pulse: boundRef\n })),\n sieve = scope.add(Sieve({\n pulse: ref(render)\n }, undefined, scope.parent()));\n\n // if mark is named, make accessible as reactive geometry\n // add trigger updates if defined\n if (spec.name != null) {\n name = spec.name;\n scope.addData(name, new DataScope(scope, store, render, sieve));\n if (spec.on) spec.on.forEach(on => {\n if (on.insert || on.remove || on.toggle) {\n error('Marks only support modify triggers.');\n }\n parseTrigger(on, scope, name);\n });\n }\n}\nfunction parseOverlap(overlap, source, scope) {\n const method = overlap.method,\n bound = overlap.bound,\n sep = overlap.separation;\n const params = {\n separation: isSignal(sep) ? scope.signalRef(sep.signal) : sep,\n method: isSignal(method) ? scope.signalRef(method.signal) : method,\n pulse: source\n };\n if (overlap.order) {\n params.sort = scope.compareRef({\n field: overlap.order\n });\n }\n if (bound) {\n const tol = bound.tolerance;\n params.boundTolerance = isSignal(tol) ? scope.signalRef(tol.signal) : +tol;\n params.boundScale = scope.scaleRef(bound.scale);\n params.boundOrient = bound.orient;\n }\n return ref(scope.add(Overlap(params)));\n}\n\nfunction parseLegend (spec, scope) {\n const config = scope.config.legend,\n encode = spec.encode || {},\n _ = lookup(spec, config),\n legendEncode = encode.legend || {},\n name = legendEncode.name || undefined,\n interactive = legendEncode.interactive,\n style = legendEncode.style,\n scales = {};\n let scale = 0,\n entryLayout,\n params,\n children;\n\n // resolve scales and 'canonical' scale name\n LegendScales.forEach(s => spec[s] ? (scales[s] = spec[s], scale = scale || spec[s]) : 0);\n if (!scale) error('Missing valid scale for legend.');\n\n // resolve legend type (symbol, gradient, or discrete gradient)\n const type = legendType(spec, scope.scaleType(scale));\n\n // single-element data source for legend group\n const datum = {\n title: spec.title != null,\n scales: scales,\n type: type,\n vgrad: type !== 'symbol' && _.isVertical()\n };\n const dataRef = ref(scope.add(Collect(null, [datum])));\n\n // encoding properties for legend entry sub-group\n const entryEncode = {\n enter: {\n x: {\n value: 0\n },\n y: {\n value: 0\n }\n }\n };\n\n // data source for legend values\n const entryRef = ref(scope.add(LegendEntries(params = {\n type: type,\n scale: scope.scaleRef(scale),\n count: scope.objectProperty(_('tickCount')),\n limit: scope.property(_('symbolLimit')),\n values: scope.objectProperty(spec.values),\n minstep: scope.property(spec.tickMinStep),\n formatType: scope.property(spec.formatType),\n formatSpecifier: scope.property(spec.format)\n })));\n\n // continuous gradient legend\n if (type === Gradient) {\n children = [legendGradient(spec, scale, config, encode.gradient), legendGradientLabels(spec, config, encode.labels, entryRef)];\n // adjust default tick count based on the gradient length\n params.count = params.count || scope.signalRef(`max(2,2*floor((${deref(_.gradientLength())})/100))`);\n }\n\n // discrete gradient legend\n else if (type === Discrete) {\n children = [legendGradientDiscrete(spec, scale, config, encode.gradient, entryRef), legendGradientLabels(spec, config, encode.labels, entryRef)];\n }\n\n // symbol legend\n else {\n // determine legend symbol group layout\n entryLayout = legendSymbolLayout(spec, config);\n children = [legendSymbolGroups(spec, config, encode, entryRef, deref(entryLayout.columns))];\n // pass symbol size information to legend entry generator\n params.size = sizeExpression(spec, scope, children[0].marks);\n }\n\n // generate legend marks\n children = [guideGroup({\n role: LegendEntryRole,\n from: dataRef,\n encode: entryEncode,\n marks: children,\n layout: entryLayout,\n interactive\n })];\n\n // include legend title if defined\n if (datum.title) {\n children.push(legendTitle(spec, config, encode.title, dataRef));\n }\n\n // parse legend specification\n return parseMark(guideGroup({\n role: LegendRole,\n from: dataRef,\n encode: extendEncode(buildLegendEncode(_, spec, config), legendEncode, Skip),\n marks: children,\n aria: _('aria'),\n description: _('description'),\n zindex: _('zindex'),\n name,\n interactive,\n style\n }), scope);\n}\nfunction legendType(spec, scaleType) {\n let type = spec.type || Symbols;\n if (!spec.type && scaleCount(spec) === 1 && (spec.fill || spec.stroke)) {\n type = isContinuous(scaleType) ? Gradient : isDiscretizing(scaleType) ? Discrete : Symbols;\n }\n return type !== Gradient ? type : isDiscretizing(scaleType) ? Discrete : Gradient;\n}\nfunction scaleCount(spec) {\n return LegendScales.reduce((count, type) => count + (spec[type] ? 1 : 0), 0);\n}\nfunction buildLegendEncode(_, spec, config) {\n const encode = {\n enter: {},\n update: {}\n };\n addEncoders(encode, {\n orient: _('orient'),\n offset: _('offset'),\n padding: _('padding'),\n titlePadding: _('titlePadding'),\n cornerRadius: _('cornerRadius'),\n fill: _('fillColor'),\n stroke: _('strokeColor'),\n strokeWidth: config.strokeWidth,\n strokeDash: config.strokeDash,\n x: _('legendX'),\n y: _('legendY'),\n // accessibility support\n format: spec.format,\n formatType: spec.formatType\n });\n return encode;\n}\nfunction sizeExpression(spec, scope, marks) {\n const size = deref(getChannel('size', spec, marks)),\n strokeWidth = deref(getChannel('strokeWidth', spec, marks)),\n fontSize = deref(getFontSize(marks[1].encode, scope, GuideLabelStyle));\n return parseExpression(`max(ceil(sqrt(${size})+${strokeWidth}),${fontSize})`, scope);\n}\nfunction getChannel(name, spec, marks) {\n return spec[name] ? `scale(\"${spec[name]}\",datum)` : getEncoding(name, marks[0].encode);\n}\nfunction getFontSize(encode, scope, style) {\n return getEncoding('fontSize', encode) || getStyle('fontSize', scope, style);\n}\n\nconst angleExpr = `item.orient===\"${Left}\"?-90:item.orient===\"${Right}\"?90:0`;\nfunction parseTitle (spec, scope) {\n spec = isString(spec) ? {\n text: spec\n } : spec;\n const _ = lookup(spec, scope.config.title),\n encode = spec.encode || {},\n userEncode = encode.group || {},\n name = userEncode.name || undefined,\n interactive = userEncode.interactive,\n style = userEncode.style,\n children = [];\n\n // single-element data source for group title\n const datum = {},\n dataRef = ref(scope.add(Collect(null, [datum])));\n\n // include title text\n children.push(buildTitle(spec, _, titleEncode(spec), dataRef));\n\n // include subtitle text\n if (spec.subtitle) {\n children.push(buildSubTitle(spec, _, encode.subtitle, dataRef));\n }\n\n // parse title specification\n return parseMark(guideGroup({\n role: TitleRole,\n from: dataRef,\n encode: groupEncode(_, userEncode),\n marks: children,\n aria: _('aria'),\n description: _('description'),\n zindex: _('zindex'),\n name,\n interactive,\n style\n }), scope);\n}\n\n// provide backwards-compatibility for title custom encode;\n// the top-level encode block has been *deprecated*.\nfunction titleEncode(spec) {\n const encode = spec.encode;\n return encode && encode.title || extend({\n name: spec.name,\n interactive: spec.interactive,\n style: spec.style\n }, encode);\n}\nfunction groupEncode(_, userEncode) {\n const encode = {\n enter: {},\n update: {}\n };\n addEncoders(encode, {\n orient: _('orient'),\n anchor: _('anchor'),\n align: {\n signal: alignExpr$1\n },\n angle: {\n signal: angleExpr\n },\n limit: _('limit'),\n frame: _('frame'),\n offset: _('offset') || 0,\n padding: _('subtitlePadding')\n });\n return extendEncode(encode, userEncode, Skip);\n}\nfunction buildTitle(spec, _, userEncode, dataRef) {\n const zero = {\n value: 0\n },\n text = spec.text,\n encode = {\n enter: {\n opacity: zero\n },\n update: {\n opacity: {\n value: 1\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n text: text,\n align: {\n signal: 'item.mark.group.align'\n },\n angle: {\n signal: 'item.mark.group.angle'\n },\n limit: {\n signal: 'item.mark.group.limit'\n },\n baseline: 'top',\n dx: _('dx'),\n dy: _('dy'),\n fill: _('color'),\n font: _('font'),\n fontSize: _('fontSize'),\n fontStyle: _('fontStyle'),\n fontWeight: _('fontWeight'),\n lineHeight: _('lineHeight')\n }, {\n // update\n align: _('align'),\n angle: _('angle'),\n baseline: _('baseline')\n });\n return guideMark({\n type: TextMark,\n role: TitleTextRole,\n style: GroupTitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\nfunction buildSubTitle(spec, _, userEncode, dataRef) {\n const zero = {\n value: 0\n },\n text = spec.subtitle,\n encode = {\n enter: {\n opacity: zero\n },\n update: {\n opacity: {\n value: 1\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n text: text,\n align: {\n signal: 'item.mark.group.align'\n },\n angle: {\n signal: 'item.mark.group.angle'\n },\n limit: {\n signal: 'item.mark.group.limit'\n },\n baseline: 'top',\n dx: _('dx'),\n dy: _('dy'),\n fill: _('subtitleColor'),\n font: _('subtitleFont'),\n fontSize: _('subtitleFontSize'),\n fontStyle: _('subtitleFontStyle'),\n fontWeight: _('subtitleFontWeight'),\n lineHeight: _('subtitleLineHeight')\n }, {\n // update\n align: _('align'),\n angle: _('angle'),\n baseline: _('baseline')\n });\n return guideMark({\n type: TextMark,\n role: TitleSubtitleRole,\n style: GroupSubtitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction parseData(data, scope) {\n const transforms = [];\n if (data.transform) {\n data.transform.forEach(tx => {\n transforms.push(parseTransform(tx, scope));\n });\n }\n if (data.on) {\n data.on.forEach(on => {\n parseTrigger(on, scope, data.name);\n });\n }\n scope.addDataPipeline(data.name, analyze(data, scope, transforms));\n}\n\n/**\n * Analyze a data pipeline, add needed operators.\n */\nfunction analyze(data, scope, ops) {\n const output = [];\n let source = null,\n modify = false,\n generate = false,\n upstream,\n i,\n n,\n t,\n m;\n if (data.values) {\n // hard-wired input data set\n if (isSignal(data.values) || hasSignal(data.format)) {\n // if either values is signal or format has signal, use dynamic loader\n output.push(load(scope, data));\n output.push(source = collect());\n } else {\n // otherwise, ingest upon dataflow init\n output.push(source = collect({\n $ingest: data.values,\n $format: data.format\n }));\n }\n } else if (data.url) {\n // load data from external source\n if (hasSignal(data.url) || hasSignal(data.format)) {\n // if either url or format has signal, use dynamic loader\n output.push(load(scope, data));\n output.push(source = collect());\n } else {\n // otherwise, request load upon dataflow init\n output.push(source = collect({\n $request: data.url,\n $format: data.format\n }));\n }\n } else if (data.source) {\n // derives from one or more other data sets\n source = upstream = array(data.source).map(d => ref(scope.getData(d).output));\n output.push(null); // populate later\n }\n\n // scan data transforms, add collectors as needed\n for (i = 0, n = ops.length; i < n; ++i) {\n t = ops[i];\n m = t.metadata;\n if (!source && !m.source) {\n output.push(source = collect());\n }\n output.push(t);\n if (m.generates) generate = true;\n if (m.modifies && !generate) modify = true;\n if (m.source) source = t;else if (m.changes) source = null;\n }\n if (upstream) {\n n = upstream.length - 1;\n output[0] = Relay({\n derive: modify,\n pulse: n ? upstream : upstream[0]\n });\n if (modify || n) {\n // collect derived and multi-pulse tuples\n output.splice(1, 0, collect());\n }\n }\n if (!source) output.push(collect());\n output.push(Sieve({}));\n return output;\n}\nfunction collect(values) {\n const s = Collect({}, values);\n s.metadata = {\n source: true\n };\n return s;\n}\nfunction load(scope, data) {\n return Load({\n url: data.url ? scope.property(data.url) : undefined,\n async: data.async ? scope.property(data.async) : undefined,\n values: data.values ? scope.property(data.values) : undefined,\n format: scope.objectProperty(data.format)\n });\n}\n\nconst isX = orient => orient === Bottom || orient === Top;\n\n// get sign coefficient based on axis orient\nconst getSign = (orient, a, b) => isSignal(orient) ? ifLeftTopExpr(orient.signal, a, b) : orient === Left || orient === Top ? a : b;\n\n// condition on axis x-direction\nconst ifX = (orient, a, b) => isSignal(orient) ? ifXEnc(orient.signal, a, b) : isX(orient) ? a : b;\n\n// condition on axis y-direction\nconst ifY = (orient, a, b) => isSignal(orient) ? ifYEnc(orient.signal, a, b) : isX(orient) ? b : a;\nconst ifTop = (orient, a, b) => isSignal(orient) ? ifTopExpr(orient.signal, a, b) : orient === Top ? {\n value: a\n} : {\n value: b\n};\nconst ifRight = (orient, a, b) => isSignal(orient) ? ifRightExpr(orient.signal, a, b) : orient === Right ? {\n value: a\n} : {\n value: b\n};\nconst ifXEnc = ($orient, a, b) => ifEnc(`${$orient} === '${Top}' || ${$orient} === '${Bottom}'`, a, b);\nconst ifYEnc = ($orient, a, b) => ifEnc(`${$orient} !== '${Top}' && ${$orient} !== '${Bottom}'`, a, b);\nconst ifLeftTopExpr = ($orient, a, b) => ifExpr(`${$orient} === '${Left}' || ${$orient} === '${Top}'`, a, b);\nconst ifTopExpr = ($orient, a, b) => ifExpr(`${$orient} === '${Top}'`, a, b);\nconst ifRightExpr = ($orient, a, b) => ifExpr(`${$orient} === '${Right}'`, a, b);\nconst ifEnc = (test, a, b) => {\n // ensure inputs are encoder objects (or null)\n a = a != null ? encoder(a) : a;\n b = b != null ? encoder(b) : b;\n if (isSimple(a) && isSimple(b)) {\n // if possible generate simple signal expression\n a = a ? a.signal || stringValue(a.value) : null;\n b = b ? b.signal || stringValue(b.value) : null;\n return {\n signal: `${test} ? (${a}) : (${b})`\n };\n } else {\n // otherwise generate rule set\n return [extend({\n test\n }, a)].concat(b || []);\n }\n};\nconst isSimple = enc => enc == null || Object.keys(enc).length === 1;\nconst ifExpr = (test, a, b) => ({\n signal: `${test} ? (${toExpr(a)}) : (${toExpr(b)})`\n});\nconst ifOrient = ($orient, t, b, l, r) => ({\n signal: (l != null ? `${$orient} === '${Left}' ? (${toExpr(l)}) : ` : '') + (b != null ? `${$orient} === '${Bottom}' ? (${toExpr(b)}) : ` : '') + (r != null ? `${$orient} === '${Right}' ? (${toExpr(r)}) : ` : '') + (t != null ? `${$orient} === '${Top}' ? (${toExpr(t)}) : ` : '') + '(null)'\n});\nconst toExpr = v => isSignal(v) ? v.signal : v == null ? null : stringValue(v);\nconst mult = (sign, value) => value === 0 ? 0 : isSignal(sign) ? {\n signal: `(${sign.signal}) * ${value}`\n} : {\n value: sign * value\n};\nconst patch = (value, base) => {\n const s = value.signal;\n return s && s.endsWith('(null)') ? {\n signal: s.slice(0, -6) + base.signal\n } : value;\n};\n\nfunction fallback(prop, config, axisConfig, style) {\n let styleProp;\n if (config && hasOwnProperty(config, prop)) {\n return config[prop];\n } else if (hasOwnProperty(axisConfig, prop)) {\n return axisConfig[prop];\n } else if (prop.startsWith('title')) {\n switch (prop) {\n case 'titleColor':\n styleProp = 'fill';\n break;\n case 'titleFont':\n case 'titleFontSize':\n case 'titleFontWeight':\n styleProp = prop[5].toLowerCase() + prop.slice(6);\n }\n return style[GuideTitleStyle][styleProp];\n } else if (prop.startsWith('label')) {\n switch (prop) {\n case 'labelColor':\n styleProp = 'fill';\n break;\n case 'labelFont':\n case 'labelFontSize':\n styleProp = prop[5].toLowerCase() + prop.slice(6);\n }\n return style[GuideLabelStyle][styleProp];\n }\n return null;\n}\nfunction keys(objects) {\n const map = {};\n for (const obj of objects) {\n if (!obj) continue;\n for (const key in obj) map[key] = 1;\n }\n return Object.keys(map);\n}\nfunction axisConfig (spec, scope) {\n var config = scope.config,\n style = config.style,\n axis = config.axis,\n band = scope.scaleType(spec.scale) === 'band' && config.axisBand,\n orient = spec.orient,\n xy,\n or,\n key;\n if (isSignal(orient)) {\n const xyKeys = keys([config.axisX, config.axisY]),\n orientKeys = keys([config.axisTop, config.axisBottom, config.axisLeft, config.axisRight]);\n xy = {};\n for (key of xyKeys) {\n xy[key] = ifX(orient, fallback(key, config.axisX, axis, style), fallback(key, config.axisY, axis, style));\n }\n or = {};\n for (key of orientKeys) {\n or[key] = ifOrient(orient.signal, fallback(key, config.axisTop, axis, style), fallback(key, config.axisBottom, axis, style), fallback(key, config.axisLeft, axis, style), fallback(key, config.axisRight, axis, style));\n }\n } else {\n xy = orient === Top || orient === Bottom ? config.axisX : config.axisY;\n or = config['axis' + orient[0].toUpperCase() + orient.slice(1)];\n }\n const result = xy || or || band ? extend({}, axis, xy, or, band) : axis;\n return result;\n}\n\nfunction axisDomain (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n orient = spec.orient;\n let enter, update;\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('domainColor'),\n strokeCap: _('domainCap'),\n strokeDash: _('domainDash'),\n strokeDashOffset: _('domainDashOffset'),\n strokeWidth: _('domainWidth'),\n strokeOpacity: _('domainOpacity')\n });\n const pos0 = position(spec, 0);\n const pos1 = position(spec, 1);\n enter.x = update.x = ifX(orient, pos0, zero);\n enter.x2 = update.x2 = ifX(orient, pos1);\n enter.y = update.y = ifY(orient, pos0, zero);\n enter.y2 = update.y2 = ifY(orient, pos1);\n return guideMark({\n type: RuleMark,\n role: AxisDomainRole,\n from: dataRef,\n encode\n }, userEncode);\n}\nfunction position(spec, pos) {\n return {\n scale: spec.scale,\n range: pos\n };\n}\n\nfunction axisGrid (spec, config, userEncode, dataRef, band) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n vscale = spec.gridScale,\n sign = getSign(orient, 1, -1),\n offset = offsetValue(spec.offset, sign);\n let enter, exit, update;\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one\n },\n exit: exit = {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('gridColor'),\n strokeCap: _('gridCap'),\n strokeDash: _('gridDash'),\n strokeDashOffset: _('gridDashOffset'),\n strokeOpacity: _('gridOpacity'),\n strokeWidth: _('gridWidth')\n });\n const tickPos = {\n scale: spec.scale,\n field: Value,\n band: band.band,\n extra: band.extra,\n offset: band.offset,\n round: _('tickRound')\n };\n const sz = ifX(orient, {\n signal: 'height'\n }, {\n signal: 'width'\n });\n const gridStart = vscale ? {\n scale: vscale,\n range: 0,\n mult: sign,\n offset: offset\n } : {\n value: 0,\n offset: offset\n };\n const gridEnd = vscale ? {\n scale: vscale,\n range: 1,\n mult: sign,\n offset: offset\n } : extend(sz, {\n mult: sign,\n offset: offset\n });\n enter.x = update.x = ifX(orient, tickPos, gridStart);\n enter.y = update.y = ifY(orient, tickPos, gridStart);\n enter.x2 = update.x2 = ifY(orient, gridEnd);\n enter.y2 = update.y2 = ifX(orient, gridEnd);\n exit.x = ifX(orient, tickPos);\n exit.y = ifY(orient, tickPos);\n return guideMark({\n type: RuleMark,\n role: AxisGridRole,\n key: Value,\n from: dataRef,\n encode\n }, userEncode);\n}\nfunction offsetValue(offset, sign) {\n if (sign === 1) ; else if (!isObject(offset)) {\n offset = isSignal(sign) ? {\n signal: `(${sign.signal}) * (${offset || 0})`\n } : sign * (offset || 0);\n } else {\n let entry = offset = extend({}, offset);\n while (entry.mult != null) {\n if (!isObject(entry.mult)) {\n entry.mult = isSignal(sign) // no offset if sign === 1\n ? {\n signal: `(${entry.mult}) * (${sign.signal})`\n } : entry.mult * sign;\n return offset;\n } else {\n entry = entry.mult = extend({}, entry.mult);\n }\n }\n entry.mult = sign;\n }\n return offset;\n}\n\nfunction axisTicks (spec, config, userEncode, dataRef, size, band) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n sign = getSign(orient, -1, 1);\n let enter, exit, update;\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one\n },\n exit: exit = {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('tickColor'),\n strokeCap: _('tickCap'),\n strokeDash: _('tickDash'),\n strokeDashOffset: _('tickDashOffset'),\n strokeOpacity: _('tickOpacity'),\n strokeWidth: _('tickWidth')\n });\n const tickSize = encoder(size);\n tickSize.mult = sign;\n const tickPos = {\n scale: spec.scale,\n field: Value,\n band: band.band,\n extra: band.extra,\n offset: band.offset,\n round: _('tickRound')\n };\n update.y = enter.y = ifX(orient, zero, tickPos);\n update.y2 = enter.y2 = ifX(orient, tickSize);\n exit.x = ifX(orient, tickPos);\n update.x = enter.x = ifY(orient, zero, tickPos);\n update.x2 = enter.x2 = ifY(orient, tickSize);\n exit.y = ifY(orient, tickPos);\n return guideMark({\n type: RuleMark,\n role: AxisTickRole,\n key: Value,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction flushExpr(scale, threshold, a, b, c) {\n return {\n signal: 'flush(range(\"' + scale + '\"), ' + 'scale(\"' + scale + '\", datum.value), ' + threshold + ',' + a + ',' + b + ',' + c + ')'\n };\n}\nfunction axisLabels (spec, config, userEncode, dataRef, size, band) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n scale = spec.scale,\n sign = getSign(orient, -1, 1),\n flush = deref(_('labelFlush')),\n flushOffset = deref(_('labelFlushOffset')),\n labelAlign = _('labelAlign'),\n labelBaseline = _('labelBaseline');\n let flushOn = flush === 0 || !!flush,\n update;\n const tickSize = encoder(size);\n tickSize.mult = sign;\n tickSize.offset = encoder(_('labelPadding') || 0);\n tickSize.offset.mult = sign;\n const tickPos = {\n scale: scale,\n field: Value,\n band: 0.5,\n offset: extendOffset(band.offset, _('labelOffset'))\n };\n const align = ifX(orient, flushOn ? flushExpr(scale, flush, '\"left\"', '\"right\"', '\"center\"') : {\n value: 'center'\n }, ifRight(orient, 'left', 'right'));\n const baseline = ifX(orient, ifTop(orient, 'bottom', 'top'), flushOn ? flushExpr(scale, flush, '\"top\"', '\"bottom\"', '\"middle\"') : {\n value: 'middle'\n });\n const offsetExpr = flushExpr(scale, flush, `-(${flushOffset})`, flushOffset, 0);\n flushOn = flushOn && flushOffset;\n const enter = {\n opacity: zero,\n x: ifX(orient, tickPos, tickSize),\n y: ifY(orient, tickPos, tickSize)\n };\n const encode = {\n enter: enter,\n update: update = {\n opacity: one,\n text: {\n field: Label\n },\n x: enter.x,\n y: enter.y,\n align,\n baseline\n },\n exit: {\n opacity: zero,\n x: enter.x,\n y: enter.y\n }\n };\n addEncoders(encode, {\n dx: !labelAlign && flushOn ? ifX(orient, offsetExpr) : null,\n dy: !labelBaseline && flushOn ? ifY(orient, offsetExpr) : null\n });\n addEncoders(encode, {\n angle: _('labelAngle'),\n fill: _('labelColor'),\n fillOpacity: _('labelOpacity'),\n font: _('labelFont'),\n fontSize: _('labelFontSize'),\n fontWeight: _('labelFontWeight'),\n fontStyle: _('labelFontStyle'),\n limit: _('labelLimit'),\n lineHeight: _('labelLineHeight')\n }, {\n align: labelAlign,\n baseline: labelBaseline\n });\n const bound = _('labelBound');\n let overlap = _('labelOverlap');\n\n // if overlap method or bound defined, request label overlap removal\n overlap = overlap || bound ? {\n separation: _('labelSeparation'),\n method: overlap,\n order: 'datum.index',\n bound: bound ? {\n scale,\n orient,\n tolerance: bound\n } : null\n } : undefined;\n if (update.align !== align) {\n update.align = patch(update.align, align);\n }\n if (update.baseline !== baseline) {\n update.baseline = patch(update.baseline, baseline);\n }\n return guideMark({\n type: TextMark,\n role: AxisLabelRole,\n style: GuideLabelStyle,\n key: Value,\n from: dataRef,\n encode,\n overlap\n }, userEncode);\n}\n\nfunction axisTitle (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n sign = getSign(orient, -1, 1);\n let enter, update;\n const encode = {\n enter: enter = {\n opacity: zero,\n anchor: encoder(_('titleAnchor', null)),\n align: {\n signal: alignExpr$1\n }\n },\n update: update = extend({}, enter, {\n opacity: one,\n text: encoder(spec.title)\n }),\n exit: {\n opacity: zero\n }\n };\n const titlePos = {\n signal: `lerp(range(\"${spec.scale}\"), ${anchorExpr(0, 1, 0.5)})`\n };\n update.x = ifX(orient, titlePos);\n update.y = ifY(orient, titlePos);\n enter.angle = ifX(orient, zero, mult(sign, 90));\n enter.baseline = ifX(orient, ifTop(orient, Bottom, Top), {\n value: Bottom\n });\n update.angle = enter.angle;\n update.baseline = enter.baseline;\n addEncoders(encode, {\n fill: _('titleColor'),\n fillOpacity: _('titleOpacity'),\n font: _('titleFont'),\n fontSize: _('titleFontSize'),\n fontStyle: _('titleFontStyle'),\n fontWeight: _('titleFontWeight'),\n limit: _('titleLimit'),\n lineHeight: _('titleLineHeight')\n }, {\n // require update\n align: _('titleAlign'),\n angle: _('titleAngle'),\n baseline: _('titleBaseline')\n });\n autoLayout(_, orient, encode, userEncode);\n encode.update.align = patch(encode.update.align, enter.align);\n encode.update.angle = patch(encode.update.angle, enter.angle);\n encode.update.baseline = patch(encode.update.baseline, enter.baseline);\n return guideMark({\n type: TextMark,\n role: AxisTitleRole,\n style: GuideTitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\nfunction autoLayout(_, orient, encode, userEncode) {\n const auto = (value, dim) => value != null ? (encode.update[dim] = patch(encoder(value), encode.update[dim]), false) : !has(dim, userEncode) ? true : false;\n const autoY = auto(_('titleX'), 'x'),\n autoX = auto(_('titleY'), 'y');\n encode.enter.auto = autoX === autoY ? encoder(autoX) : ifX(orient, encoder(autoX), encoder(autoY));\n}\n\nfunction parseAxis (spec, scope) {\n const config = axisConfig(spec, scope),\n encode = spec.encode || {},\n axisEncode = encode.axis || {},\n name = axisEncode.name || undefined,\n interactive = axisEncode.interactive,\n style = axisEncode.style,\n _ = lookup(spec, config),\n band = tickBand(_);\n\n // single-element data source for axis group\n const datum = {\n scale: spec.scale,\n ticks: !!_('ticks'),\n labels: !!_('labels'),\n grid: !!_('grid'),\n domain: !!_('domain'),\n title: spec.title != null\n };\n const dataRef = ref(scope.add(Collect({}, [datum])));\n\n // data source for axis ticks\n const ticksRef = ref(scope.add(AxisTicks({\n scale: scope.scaleRef(spec.scale),\n extra: scope.property(band.extra),\n count: scope.objectProperty(spec.tickCount),\n values: scope.objectProperty(spec.values),\n minstep: scope.property(spec.tickMinStep),\n formatType: scope.property(spec.formatType),\n formatSpecifier: scope.property(spec.format)\n })));\n\n // generate axis marks\n const children = [];\n let size;\n\n // include axis gridlines if requested\n if (datum.grid) {\n children.push(axisGrid(spec, config, encode.grid, ticksRef, band));\n }\n\n // include axis ticks if requested\n if (datum.ticks) {\n size = _('tickSize');\n children.push(axisTicks(spec, config, encode.ticks, ticksRef, size, band));\n }\n\n // include axis labels if requested\n if (datum.labels) {\n size = datum.ticks ? size : 0;\n children.push(axisLabels(spec, config, encode.labels, ticksRef, size, band));\n }\n\n // include axis domain path if requested\n if (datum.domain) {\n children.push(axisDomain(spec, config, encode.domain, dataRef));\n }\n\n // include axis title if defined\n if (datum.title) {\n children.push(axisTitle(spec, config, encode.title, dataRef));\n }\n\n // parse axis specification\n return parseMark(guideGroup({\n role: AxisRole,\n from: dataRef,\n encode: extendEncode(buildAxisEncode(_, spec), axisEncode, Skip),\n marks: children,\n aria: _('aria'),\n description: _('description'),\n zindex: _('zindex'),\n name,\n interactive,\n style\n }), scope);\n}\nfunction buildAxisEncode(_, spec) {\n const encode = {\n enter: {},\n update: {}\n };\n addEncoders(encode, {\n orient: _('orient'),\n offset: _('offset') || 0,\n position: value(spec.position, 0),\n titlePadding: _('titlePadding'),\n minExtent: _('minExtent'),\n maxExtent: _('maxExtent'),\n range: {\n signal: `abs(span(range(\"${spec.scale}\")))`\n },\n translate: _('translate'),\n // accessibility support\n format: spec.format,\n formatType: spec.formatType\n });\n return encode;\n}\n\nfunction parseScope (spec, scope, preprocessed) {\n const signals = array(spec.signals),\n scales = array(spec.scales);\n\n // parse signal definitions, if not already preprocessed\n if (!preprocessed) signals.forEach(_ => parseSignal(_, scope));\n\n // parse cartographic projection definitions\n array(spec.projections).forEach(_ => parseProjection(_, scope));\n\n // initialize scale references\n scales.forEach(_ => initScale(_, scope));\n\n // parse data sources\n array(spec.data).forEach(_ => parseData(_, scope));\n\n // parse scale definitions\n scales.forEach(_ => parseScale(_, scope));\n\n // parse signal updates\n (preprocessed || signals).forEach(_ => parseSignalUpdates(_, scope));\n\n // parse axis definitions\n array(spec.axes).forEach(_ => parseAxis(_, scope));\n\n // parse mark definitions\n array(spec.marks).forEach(_ => parseMark(_, scope));\n\n // parse legend definitions\n array(spec.legends).forEach(_ => parseLegend(_, scope));\n\n // parse title, if defined\n if (spec.title) parseTitle(spec.title, scope);\n\n // parse collected lambda (anonymous) expressions\n scope.parseLambdas();\n return scope;\n}\n\nconst rootEncode = spec => extendEncode({\n enter: {\n x: {\n value: 0\n },\n y: {\n value: 0\n }\n },\n update: {\n width: {\n signal: 'width'\n },\n height: {\n signal: 'height'\n }\n }\n}, spec);\nfunction parseView(spec, scope) {\n const config = scope.config;\n\n // add scenegraph root\n const root = ref(scope.root = scope.add(operator()));\n\n // parse top-level signal definitions\n const signals = collectSignals(spec, config);\n signals.forEach(_ => parseSignal(_, scope));\n\n // assign description, event, legend, and locale configuration\n scope.description = spec.description || config.description;\n scope.eventConfig = config.events;\n scope.legends = scope.objectProperty(config.legend && config.legend.layout);\n scope.locale = config.locale;\n\n // store root group item\n const input = scope.add(Collect());\n\n // encode root group item\n const encode = scope.add(Encode(parseEncode(rootEncode(spec.encode), GroupMark, FrameRole, spec.style, scope, {\n pulse: ref(input)\n })));\n\n // perform view layout\n const parent = scope.add(ViewLayout({\n layout: scope.objectProperty(spec.layout),\n legends: scope.legends,\n autosize: scope.signalRef('autosize'),\n mark: root,\n pulse: ref(encode)\n }));\n scope.operators.pop();\n\n // parse remainder of specification\n scope.pushState(ref(encode), ref(parent), null);\n parseScope(spec, scope, signals);\n scope.operators.push(parent);\n\n // bound / render / sieve root item\n let op = scope.add(Bound({\n mark: root,\n pulse: ref(parent)\n }));\n op = scope.add(Render({\n pulse: ref(op)\n }));\n op = scope.add(Sieve({\n pulse: ref(op)\n }));\n\n // track metadata for root item\n scope.addData('root', new DataScope(scope, input, input, op));\n return scope;\n}\nfunction signalObject(name, value) {\n return value && value.signal ? {\n name,\n update: value.signal\n } : {\n name,\n value\n };\n}\n\n/**\n * Collect top-level signals, merging values as needed. Signals\n * defined in the config signals arrays are added only if that\n * signal is not explicitly defined in the specification.\n * Built-in signals (autosize, background, padding, width, height)\n * receive special treatment. They are initialized using the\n * top-level spec property, or, if undefined in the spec, using\n * the corresponding top-level config property. If this property\n * is a signal reference object, the signal expression maps to the\n * signal 'update' property. If the spec's top-level signal array\n * contains an entry that matches a built-in signal, that entry\n * will be merged with the built-in specification, potentially\n * overwriting existing 'value' or 'update' properties.\n */\nfunction collectSignals(spec, config) {\n const _ = name => value(spec[name], config[name]),\n signals = [signalObject('background', _('background')), signalObject('autosize', parseAutosize(_('autosize'))), signalObject('padding', parsePadding(_('padding'))), signalObject('width', _('width') || 0), signalObject('height', _('height') || 0)],\n pre = signals.reduce((p, s) => (p[s.name] = s, p), {}),\n map = {};\n\n // add spec signal array\n array(spec.signals).forEach(s => {\n if (hasOwnProperty(pre, s.name)) {\n // merge if built-in signal\n s = extend(pre[s.name], s);\n } else {\n // otherwise add to signal list\n signals.push(s);\n }\n map[s.name] = s;\n });\n\n // add config signal array\n array(config.signals).forEach(s => {\n if (!hasOwnProperty(map, s.name) && !hasOwnProperty(pre, s.name)) {\n // add to signal list if not already defined\n signals.push(s);\n }\n });\n return signals;\n}\n\nfunction Scope(config, options) {\n this.config = config || {};\n this.options = options || {};\n this.bindings = [];\n this.field = {};\n this.signals = {};\n this.lambdas = {};\n this.scales = {};\n this.events = {};\n this.data = {};\n this.streams = [];\n this.updates = [];\n this.operators = [];\n this.eventConfig = null;\n this.locale = null;\n this._id = 0;\n this._subid = 0;\n this._nextsub = [0];\n this._parent = [];\n this._encode = [];\n this._lookup = [];\n this._markpath = [];\n}\nfunction Subscope(scope) {\n this.config = scope.config;\n this.options = scope.options;\n this.legends = scope.legends;\n this.field = Object.create(scope.field);\n this.signals = Object.create(scope.signals);\n this.lambdas = Object.create(scope.lambdas);\n this.scales = Object.create(scope.scales);\n this.events = Object.create(scope.events);\n this.data = Object.create(scope.data);\n this.streams = [];\n this.updates = [];\n this.operators = [];\n this._id = 0;\n this._subid = ++scope._nextsub[0];\n this._nextsub = scope._nextsub;\n this._parent = scope._parent.slice();\n this._encode = scope._encode.slice();\n this._lookup = scope._lookup.slice();\n this._markpath = scope._markpath;\n}\nScope.prototype = Subscope.prototype = {\n parse(spec) {\n return parseScope(spec, this);\n },\n fork() {\n return new Subscope(this);\n },\n isSubscope() {\n return this._subid > 0;\n },\n toRuntime() {\n this.finish();\n return {\n description: this.description,\n operators: this.operators,\n streams: this.streams,\n updates: this.updates,\n bindings: this.bindings,\n eventConfig: this.eventConfig,\n locale: this.locale\n };\n },\n id() {\n return (this._subid ? this._subid + ':' : 0) + this._id++;\n },\n add(op) {\n this.operators.push(op);\n op.id = this.id();\n // if pre-registration references exist, resolve them now\n if (op.refs) {\n op.refs.forEach(ref => {\n ref.$ref = op.id;\n });\n op.refs = null;\n }\n return op;\n },\n proxy(op) {\n const vref = op instanceof Entry ? ref(op) : op;\n return this.add(Proxy({\n value: vref\n }));\n },\n addStream(stream) {\n this.streams.push(stream);\n stream.id = this.id();\n return stream;\n },\n addUpdate(update) {\n this.updates.push(update);\n return update;\n },\n // Apply metadata\n finish() {\n let name, ds;\n\n // annotate root\n if (this.root) this.root.root = true;\n\n // annotate signals\n for (name in this.signals) {\n this.signals[name].signal = name;\n }\n\n // annotate scales\n for (name in this.scales) {\n this.scales[name].scale = name;\n }\n\n // annotate data sets\n function annotate(op, name, type) {\n let data, list;\n if (op) {\n data = op.data || (op.data = {});\n list = data[name] || (data[name] = []);\n list.push(type);\n }\n }\n for (name in this.data) {\n ds = this.data[name];\n annotate(ds.input, name, 'input');\n annotate(ds.output, name, 'output');\n annotate(ds.values, name, 'values');\n for (const field in ds.index) {\n annotate(ds.index[field], name, 'index:' + field);\n }\n }\n return this;\n },\n // ----\n\n pushState(encode, parent, lookup) {\n this._encode.push(ref(this.add(Sieve({\n pulse: encode\n }))));\n this._parent.push(parent);\n this._lookup.push(lookup ? ref(this.proxy(lookup)) : null);\n this._markpath.push(-1);\n },\n popState() {\n this._encode.pop();\n this._parent.pop();\n this._lookup.pop();\n this._markpath.pop();\n },\n parent() {\n return peek(this._parent);\n },\n encode() {\n return peek(this._encode);\n },\n lookup() {\n return peek(this._lookup);\n },\n markpath() {\n const p = this._markpath;\n return ++p[p.length - 1];\n },\n // ----\n\n fieldRef(field, name) {\n if (isString(field)) return fieldRef$1(field, name);\n if (!field.signal) {\n error('Unsupported field reference: ' + stringValue(field));\n }\n const s = field.signal;\n let f = this.field[s];\n if (!f) {\n const params = {\n name: this.signalRef(s)\n };\n if (name) params.as = name;\n this.field[s] = f = ref(this.add(Field(params)));\n }\n return f;\n },\n compareRef(cmp) {\n let signal = false;\n const check = _ => isSignal(_) ? (signal = true, this.signalRef(_.signal)) : isExpr$1(_) ? (signal = true, this.exprRef(_.expr)) : _;\n const fields = array(cmp.field).map(check),\n orders = array(cmp.order).map(check);\n return signal ? ref(this.add(Compare({\n fields: fields,\n orders: orders\n }))) : compareRef(fields, orders);\n },\n keyRef(fields, flat) {\n let signal = false;\n const check = _ => isSignal(_) ? (signal = true, ref(sig[_.signal])) : _;\n const sig = this.signals;\n fields = array(fields).map(check);\n return signal ? ref(this.add(Key({\n fields: fields,\n flat: flat\n }))) : keyRef(fields, flat);\n },\n sortRef(sort) {\n if (!sort) return sort;\n\n // including id ensures stable sorting\n const a = aggrField(sort.op, sort.field),\n o = sort.order || Ascending;\n return o.signal ? ref(this.add(Compare({\n fields: a,\n orders: this.signalRef(o.signal)\n }))) : compareRef(a, o);\n },\n // ----\n\n event(source, type) {\n const key = source + ':' + type;\n if (!this.events[key]) {\n const id = this.id();\n this.streams.push({\n id: id,\n source: source,\n type: type\n });\n this.events[key] = id;\n }\n return this.events[key];\n },\n // ----\n\n hasOwnSignal(name) {\n return hasOwnProperty(this.signals, name);\n },\n addSignal(name, value) {\n if (this.hasOwnSignal(name)) {\n error('Duplicate signal name: ' + stringValue(name));\n }\n const op = value instanceof Entry ? value : this.add(operator(value));\n return this.signals[name] = op;\n },\n getSignal(name) {\n if (!this.signals[name]) {\n error('Unrecognized signal name: ' + stringValue(name));\n }\n return this.signals[name];\n },\n signalRef(s) {\n if (this.signals[s]) {\n return ref(this.signals[s]);\n } else if (!hasOwnProperty(this.lambdas, s)) {\n this.lambdas[s] = this.add(operator(null));\n }\n return ref(this.lambdas[s]);\n },\n parseLambdas() {\n const code = Object.keys(this.lambdas);\n for (let i = 0, n = code.length; i < n; ++i) {\n const s = code[i],\n e = parseExpression(s, this),\n op = this.lambdas[s];\n op.params = e.$params;\n op.update = e.$expr;\n }\n },\n property(spec) {\n return spec && spec.signal ? this.signalRef(spec.signal) : spec;\n },\n objectProperty(spec) {\n return !spec || !isObject(spec) ? spec : this.signalRef(spec.signal || propertyLambda(spec));\n },\n exprRef(code, name) {\n const params = {\n expr: parseExpression(code, this)\n };\n if (name) params.expr.$name = name;\n return ref(this.add(Expression(params)));\n },\n addBinding(name, bind) {\n if (!this.bindings) {\n error('Nested signals do not support binding: ' + stringValue(name));\n }\n this.bindings.push(extend({\n signal: name\n }, bind));\n },\n // ----\n\n addScaleProj(name, transform) {\n if (hasOwnProperty(this.scales, name)) {\n error('Duplicate scale or projection name: ' + stringValue(name));\n }\n this.scales[name] = this.add(transform);\n },\n addScale(name, params) {\n this.addScaleProj(name, Scale(params));\n },\n addProjection(name, params) {\n this.addScaleProj(name, Projection(params));\n },\n getScale(name) {\n if (!this.scales[name]) {\n error('Unrecognized scale name: ' + stringValue(name));\n }\n return this.scales[name];\n },\n scaleRef(name) {\n return ref(this.getScale(name));\n },\n scaleType(name) {\n return this.getScale(name).params.type;\n },\n projectionRef(name) {\n return this.scaleRef(name);\n },\n projectionType(name) {\n return this.scaleType(name);\n },\n // ----\n\n addData(name, dataScope) {\n if (hasOwnProperty(this.data, name)) {\n error('Duplicate data set name: ' + stringValue(name));\n }\n return this.data[name] = dataScope;\n },\n getData(name) {\n if (!this.data[name]) {\n error('Undefined data set name: ' + stringValue(name));\n }\n return this.data[name];\n },\n addDataPipeline(name, entries) {\n if (hasOwnProperty(this.data, name)) {\n error('Duplicate data set name: ' + stringValue(name));\n }\n return this.addData(name, DataScope.fromEntries(this, entries));\n }\n};\nfunction propertyLambda(spec) {\n return (isArray(spec) ? arrayLambda : objectLambda)(spec);\n}\nfunction arrayLambda(array) {\n const n = array.length;\n let code = '[';\n for (let i = 0; i < n; ++i) {\n const value = array[i];\n code += (i > 0 ? ',' : '') + (isObject(value) ? value.signal || propertyLambda(value) : stringValue(value));\n }\n return code + ']';\n}\nfunction objectLambda(obj) {\n let code = '{',\n i = 0,\n key,\n value;\n for (key in obj) {\n value = obj[key];\n code += (++i > 1 ? ',' : '') + stringValue(key) + ':' + (isObject(value) ? value.signal || propertyLambda(value) : stringValue(value));\n }\n return code + '}';\n}\n\n/**\n * Standard configuration defaults for Vega specification parsing.\n * Users can provide their own (sub-)set of these default values\n * by passing in a config object to the top-level parse method.\n */\nfunction defaults () {\n const defaultFont = 'sans-serif',\n defaultSymbolSize = 30,\n defaultStrokeWidth = 2,\n defaultColor = '#4c78a8',\n black = '#000',\n gray = '#888',\n lightGray = '#ddd';\n return {\n // default visualization description\n description: 'Vega visualization',\n // default padding around visualization\n padding: 0,\n // default for automatic sizing; options: 'none', 'pad', 'fit'\n // or provide an object (e.g., {'type': 'pad', 'resize': true})\n autosize: 'pad',\n // default view background color\n // covers the entire view component\n background: null,\n // default event handling configuration\n // preventDefault for view-sourced event types except 'wheel'\n events: {\n defaults: {\n allow: ['wheel']\n }\n },\n // defaults for top-level group marks\n // accepts mark properties (fill, stroke, etc)\n // covers the data rectangle within group width/height\n group: null,\n // defaults for basic mark types\n // each subset accepts mark properties (fill, stroke, etc)\n mark: null,\n arc: {\n fill: defaultColor\n },\n area: {\n fill: defaultColor\n },\n image: null,\n line: {\n stroke: defaultColor,\n strokeWidth: defaultStrokeWidth\n },\n path: {\n stroke: defaultColor\n },\n rect: {\n fill: defaultColor\n },\n rule: {\n stroke: black\n },\n shape: {\n stroke: defaultColor\n },\n symbol: {\n fill: defaultColor,\n size: 64\n },\n text: {\n fill: black,\n font: defaultFont,\n fontSize: 11\n },\n trail: {\n fill: defaultColor,\n size: defaultStrokeWidth\n },\n // style definitions\n style: {\n // axis & legend labels\n 'guide-label': {\n fill: black,\n font: defaultFont,\n fontSize: 10\n },\n // axis & legend titles\n 'guide-title': {\n fill: black,\n font: defaultFont,\n fontSize: 11,\n fontWeight: 'bold'\n },\n // headers, including chart title\n 'group-title': {\n fill: black,\n font: defaultFont,\n fontSize: 13,\n fontWeight: 'bold'\n },\n // chart subtitle\n 'group-subtitle': {\n fill: black,\n font: defaultFont,\n fontSize: 12\n },\n // defaults for styled point marks in Vega-Lite\n point: {\n size: defaultSymbolSize,\n strokeWidth: defaultStrokeWidth,\n shape: 'circle'\n },\n circle: {\n size: defaultSymbolSize,\n strokeWidth: defaultStrokeWidth\n },\n square: {\n size: defaultSymbolSize,\n strokeWidth: defaultStrokeWidth,\n shape: 'square'\n },\n // defaults for styled group marks in Vega-Lite\n cell: {\n fill: 'transparent',\n stroke: lightGray\n },\n view: {\n fill: 'transparent'\n }\n },\n // defaults for title\n title: {\n orient: 'top',\n anchor: 'middle',\n offset: 4,\n subtitlePadding: 3\n },\n // defaults for axes\n axis: {\n minExtent: 0,\n maxExtent: 200,\n bandPosition: 0.5,\n domain: true,\n domainWidth: 1,\n domainColor: gray,\n grid: false,\n gridWidth: 1,\n gridColor: lightGray,\n labels: true,\n labelAngle: 0,\n labelLimit: 180,\n labelOffset: 0,\n labelPadding: 2,\n ticks: true,\n tickColor: gray,\n tickOffset: 0,\n tickRound: true,\n tickSize: 5,\n tickWidth: 1,\n titlePadding: 4\n },\n // correction for centering bias\n axisBand: {\n tickOffset: -0.5\n },\n // defaults for cartographic projection\n projection: {\n type: 'mercator'\n },\n // defaults for legends\n legend: {\n orient: 'right',\n padding: 0,\n gridAlign: 'each',\n columnPadding: 10,\n rowPadding: 2,\n symbolDirection: 'vertical',\n gradientDirection: 'vertical',\n gradientLength: 200,\n gradientThickness: 16,\n gradientStrokeColor: lightGray,\n gradientStrokeWidth: 0,\n gradientLabelOffset: 2,\n labelAlign: 'left',\n labelBaseline: 'middle',\n labelLimit: 160,\n labelOffset: 4,\n labelOverlap: true,\n symbolLimit: 30,\n symbolType: 'circle',\n symbolSize: 100,\n symbolOffset: 0,\n symbolStrokeWidth: 1.5,\n symbolBaseFillColor: 'transparent',\n symbolBaseStrokeColor: gray,\n titleLimit: 180,\n titleOrient: 'top',\n titlePadding: 5,\n layout: {\n offset: 18,\n direction: 'horizontal',\n left: {\n direction: 'vertical'\n },\n right: {\n direction: 'vertical'\n }\n }\n },\n // defaults for scale ranges\n range: {\n category: {\n scheme: 'tableau10'\n },\n ordinal: {\n scheme: 'blues'\n },\n heatmap: {\n scheme: 'yellowgreenblue'\n },\n ramp: {\n scheme: 'blues'\n },\n diverging: {\n scheme: 'blueorange',\n extent: [1, 0]\n },\n symbol: ['circle', 'square', 'triangle-up', 'cross', 'diamond', 'triangle-right', 'triangle-down', 'triangle-left']\n }\n };\n}\n\nfunction parse (spec, config, options) {\n if (!isObject(spec)) {\n error('Input Vega specification must be an object.');\n }\n config = mergeConfig(defaults(), config, spec.config);\n return parseView(spec, new Scope(config, options)).toRuntime();\n}\n\nexport { AxisDomainRole, AxisGridRole, AxisLabelRole, AxisRole, AxisTickRole, AxisTitleRole, DataScope, FrameRole, LegendEntryRole, LegendLabelRole, LegendRole, LegendSymbolRole, LegendTitleRole, MarkRole, Scope, ScopeRole, defaults as config, parse, parseSignal as signal, parseSignalUpdates as signalUpdates, parseStream as stream };\n","import { extend } from 'vega-util';\nexport * from 'vega-util';\nimport { transforms } from 'vega-dataflow';\nexport { Dataflow, EventStream, MultiPulse, Operator, Parameters, Pulse, Transform, changeset, definition, ingest, isTuple, transform, transforms, tupleid } from 'vega-dataflow';\nimport * as tx from 'vega-transforms';\nimport * as vtx from 'vega-view-transforms';\nimport * as encode from 'vega-encode';\nimport * as geo from 'vega-geo';\nimport * as force from 'vega-force';\nimport * as tree from 'vega-hierarchy';\nimport * as label from 'vega-label';\nimport * as reg from 'vega-regression';\nimport * as voronoi from 'vega-voronoi';\nimport * as wordcloud from 'vega-wordcloud';\nimport * as xf from 'vega-crossfilter';\nexport * from 'vega-statistics';\nexport * from 'vega-time';\nexport * from 'vega-loader';\nexport * from 'vega-scenegraph';\nexport { interpolate, interpolateColors, interpolateRange, quantizeInterpolator, scale, scheme } from 'vega-scale';\nexport { projection } from 'vega-projection';\nexport { View } from 'vega-view';\nexport { defaultLocale, numberFormatDefaultLocale as formatLocale, locale, resetDefaultLocale, timeFormatDefaultLocale as timeFormatLocale } from 'vega-format';\nexport { expressionFunction } from 'vega-functions';\nexport { parse } from 'vega-parser';\nexport { context as runtimeContext } from 'vega-runtime';\nexport { codegenExpression, parseExpression } from 'vega-expression';\nexport { parseSelector } from 'vega-event-selector';\n\nvar version = \"5.24.0\";\n\n// -- Transforms -----\nextend(transforms, tx, vtx, encode, geo, force, label, tree, reg, voronoi, wordcloud, xf);\n\nexport { version };\n","function adjustSpatial (item, encode, swap) {\n let t;\n if (encode.x2) {\n if (encode.x) {\n if (swap && item.x > item.x2) {\n t = item.x;\n item.x = item.x2;\n item.x2 = t;\n }\n item.width = item.x2 - item.x;\n } else {\n item.x = item.x2 - (item.width || 0);\n }\n }\n if (encode.xc) {\n item.x = item.xc - (item.width || 0) / 2;\n }\n if (encode.y2) {\n if (encode.y) {\n if (swap && item.y > item.y2) {\n t = item.y;\n item.y = item.y2;\n item.y2 = t;\n }\n item.height = item.y2 - item.y;\n } else {\n item.y = item.y2 - (item.height || 0);\n }\n }\n if (encode.yc) {\n item.y = item.yc - (item.height || 0) / 2;\n }\n}\n\nvar Constants = {\n NaN: NaN,\n E: Math.E,\n LN2: Math.LN2,\n LN10: Math.LN10,\n LOG2E: Math.LOG2E,\n LOG10E: Math.LOG10E,\n PI: Math.PI,\n SQRT1_2: Math.SQRT1_2,\n SQRT2: Math.SQRT2,\n MIN_VALUE: Number.MIN_VALUE,\n MAX_VALUE: Number.MAX_VALUE\n};\n\nvar Ops = {\n '*': (a, b) => a * b,\n '+': (a, b) => a + b,\n '-': (a, b) => a - b,\n '/': (a, b) => a / b,\n '%': (a, b) => a % b,\n '>': (a, b) => a > b,\n '<': (a, b) => a < b,\n '<=': (a, b) => a <= b,\n '>=': (a, b) => a >= b,\n '==': (a, b) => a == b,\n '!=': (a, b) => a != b,\n '===': (a, b) => a === b,\n '!==': (a, b) => a !== b,\n '&': (a, b) => a & b,\n '|': (a, b) => a | b,\n '^': (a, b) => a ^ b,\n '<<': (a, b) => a << b,\n '>>': (a, b) => a >> b,\n '>>>': (a, b) => a >>> b\n};\n\nvar Unary = {\n '+': a => +a,\n '-': a => -a,\n '~': a => ~a,\n '!': a => !a\n};\n\nconst slice = Array.prototype.slice;\nconst apply = (m, args, cast) => {\n const obj = cast ? cast(args[0]) : args[0];\n return obj[m].apply(obj, slice.call(args, 1));\n};\nconst datetime = (y, m, d, H, M, S, ms) => new Date(y, m || 0, d != null ? d : 1, H || 0, M || 0, S || 0, ms || 0);\nvar Functions = {\n // math functions\n isNaN: Number.isNaN,\n isFinite: Number.isFinite,\n abs: Math.abs,\n acos: Math.acos,\n asin: Math.asin,\n atan: Math.atan,\n atan2: Math.atan2,\n ceil: Math.ceil,\n cos: Math.cos,\n exp: Math.exp,\n floor: Math.floor,\n log: Math.log,\n max: Math.max,\n min: Math.min,\n pow: Math.pow,\n random: Math.random,\n round: Math.round,\n sin: Math.sin,\n sqrt: Math.sqrt,\n tan: Math.tan,\n clamp: (a, b, c) => Math.max(b, Math.min(c, a)),\n // date functions\n now: Date.now,\n utc: Date.UTC,\n datetime: datetime,\n date: d => new Date(d).getDate(),\n day: d => new Date(d).getDay(),\n year: d => new Date(d).getFullYear(),\n month: d => new Date(d).getMonth(),\n hours: d => new Date(d).getHours(),\n minutes: d => new Date(d).getMinutes(),\n seconds: d => new Date(d).getSeconds(),\n milliseconds: d => new Date(d).getMilliseconds(),\n time: d => new Date(d).getTime(),\n timezoneoffset: d => new Date(d).getTimezoneOffset(),\n utcdate: d => new Date(d).getUTCDate(),\n utcday: d => new Date(d).getUTCDay(),\n utcyear: d => new Date(d).getUTCFullYear(),\n utcmonth: d => new Date(d).getUTCMonth(),\n utchours: d => new Date(d).getUTCHours(),\n utcminutes: d => new Date(d).getUTCMinutes(),\n utcseconds: d => new Date(d).getUTCSeconds(),\n utcmilliseconds: d => new Date(d).getUTCMilliseconds(),\n // sequence functions\n length: x => x.length,\n join: function () {\n return apply('join', arguments);\n },\n indexof: function () {\n return apply('indexOf', arguments);\n },\n lastindexof: function () {\n return apply('lastIndexOf', arguments);\n },\n slice: function () {\n return apply('slice', arguments);\n },\n reverse: x => x.slice().reverse(),\n // string functions\n parseFloat: parseFloat,\n parseInt: parseInt,\n upper: x => String(x).toUpperCase(),\n lower: x => String(x).toLowerCase(),\n substring: function () {\n return apply('substring', arguments, String);\n },\n split: function () {\n return apply('split', arguments, String);\n },\n replace: function () {\n return apply('replace', arguments, String);\n },\n trim: x => String(x).trim(),\n // regexp functions\n regexp: RegExp,\n test: (r, t) => RegExp(r).test(t)\n};\n\nconst EventFunctions = ['view', 'item', 'group', 'xy', 'x', 'y'];\nconst DisallowedMethods = new Set([Function, eval, setTimeout, setInterval]);\nif (typeof setImmediate === 'function') DisallowedMethods.add(setImmediate);\nconst Visitors = {\n Literal: ($, n) => n.value,\n Identifier: ($, n) => {\n const id = n.name;\n return $.memberDepth > 0 ? id : id === 'datum' ? $.datum : id === 'event' ? $.event : id === 'item' ? $.item : Constants[id] || $.params['$' + id];\n },\n MemberExpression: ($, n) => {\n const d = !n.computed,\n o = $(n.object);\n if (d) $.memberDepth += 1;\n const p = $(n.property);\n if (d) $.memberDepth -= 1;\n if (DisallowedMethods.has(o[p])) {\n // eslint-disable-next-line no-console\n console.error(`Prevented interpretation of member \"${p}\" which could lead to insecure code execution`);\n return;\n }\n return o[p];\n },\n CallExpression: ($, n) => {\n const args = n.arguments;\n let name = n.callee.name;\n\n // handle special internal functions used by encoders\n // re-route to corresponding standard function\n if (name.startsWith('_')) {\n name = name.slice(1);\n }\n\n // special case \"if\" due to conditional evaluation of branches\n return name === 'if' ? $(args[0]) ? $(args[1]) : $(args[2]) : ($.fn[name] || Functions[name]).apply($.fn, args.map($));\n },\n ArrayExpression: ($, n) => n.elements.map($),\n BinaryExpression: ($, n) => Ops[n.operator]($(n.left), $(n.right)),\n UnaryExpression: ($, n) => Unary[n.operator]($(n.argument)),\n ConditionalExpression: ($, n) => $(n.test) ? $(n.consequent) : $(n.alternate),\n LogicalExpression: ($, n) => n.operator === '&&' ? $(n.left) && $(n.right) : $(n.left) || $(n.right),\n ObjectExpression: ($, n) => n.properties.reduce((o, p) => {\n $.memberDepth += 1;\n const k = $(p.key);\n $.memberDepth -= 1;\n if (DisallowedMethods.has($(p.value))) {\n // eslint-disable-next-line no-console\n console.error(`Prevented interpretation of property \"${k}\" which could lead to insecure code execution`);\n } else {\n o[k] = $(p.value);\n }\n return o;\n }, {})\n};\nfunction interpret (ast, fn, params, datum, event, item) {\n const $ = n => Visitors[n.type]($, n);\n $.memberDepth = 0;\n $.fn = Object.create(fn);\n $.params = params;\n $.datum = datum;\n $.event = event;\n $.item = item;\n\n // route event functions to annotated vega event context\n EventFunctions.forEach(f => $.fn[f] = function () {\n return event.vega[f](...arguments);\n });\n return $(ast);\n}\n\nvar expression = {\n /**\n * Parse an expression used to update an operator value.\n */\n operator(ctx, expr) {\n const ast = expr.ast,\n fn = ctx.functions;\n return _ => interpret(ast, fn, _);\n },\n /**\n * Parse an expression provided as an operator parameter value.\n */\n parameter(ctx, expr) {\n const ast = expr.ast,\n fn = ctx.functions;\n return (datum, _) => interpret(ast, fn, _, datum);\n },\n /**\n * Parse an expression applied to an event stream.\n */\n event(ctx, expr) {\n const ast = expr.ast,\n fn = ctx.functions;\n return event => interpret(ast, fn, undefined, undefined, event);\n },\n /**\n * Parse an expression used to handle an event-driven operator update.\n */\n handler(ctx, expr) {\n const ast = expr.ast,\n fn = ctx.functions;\n return (_, event) => {\n const datum = event.item && event.item.datum;\n return interpret(ast, fn, _, datum, event);\n };\n },\n /**\n * Parse an expression that performs visual encoding.\n */\n encode(ctx, encode) {\n const {\n marktype,\n channels\n } = encode,\n fn = ctx.functions,\n swap = marktype === 'group' || marktype === 'image' || marktype === 'rect';\n return (item, _) => {\n const datum = item.datum;\n let m = 0,\n v;\n for (const name in channels) {\n v = interpret(channels[name].ast, fn, _, datum, undefined, item);\n if (item[name] !== v) {\n item[name] = v;\n m = 1;\n }\n }\n if (marktype !== 'rule') {\n adjustSpatial(item, channels, swap);\n }\n return m;\n };\n }\n};\n\nexport { expression as expressionInterpreter };\n","function accessor (fn, fields, name) {\n fn.fields = fields || [];\n fn.fname = name;\n return fn;\n}\nfunction accessorName(fn) {\n return fn == null ? null : fn.fname;\n}\nfunction accessorFields(fn) {\n return fn == null ? null : fn.fields;\n}\n\nfunction getter (path) {\n return path.length === 1 ? get1(path[0]) : getN(path);\n}\n\nconst get1 = field => function (obj) {\n return obj[field];\n};\n\nconst getN = path => {\n const len = path.length;\n return function (obj) {\n for (let i = 0; i < len; ++i) {\n obj = obj[path[i]];\n }\n\n return obj;\n };\n};\n\nfunction error (message) {\n throw Error(message);\n}\n\nfunction splitAccessPath (p) {\n const path = [],\n n = p.length;\n let q = null,\n b = 0,\n s = '',\n i,\n j,\n c;\n p = p + '';\n\n function push() {\n path.push(s + p.substring(i, j));\n s = '';\n i = j + 1;\n }\n\n for (i = j = 0; j < n; ++j) {\n c = p[j];\n\n if (c === '\\\\') {\n s += p.substring(i, j);\n s += p.substring(++j, ++j);\n i = j;\n } else if (c === q) {\n push();\n q = null;\n b = -1;\n } else if (q) {\n continue;\n } else if (i === b && c === '\"') {\n i = j + 1;\n q = c;\n } else if (i === b && c === \"'\") {\n i = j + 1;\n q = c;\n } else if (c === '.' && !b) {\n if (j > i) {\n push();\n } else {\n i = j + 1;\n }\n } else if (c === '[') {\n if (j > i) push();\n b = i = j + 1;\n } else if (c === ']') {\n if (!b) error('Access path missing open bracket: ' + p);\n if (b > 0) push();\n b = 0;\n i = j + 1;\n }\n }\n\n if (b) error('Access path missing closing bracket: ' + p);\n if (q) error('Access path missing closing quote: ' + p);\n\n if (j > i) {\n j++;\n push();\n }\n\n return path;\n}\n\nfunction field (field, name, opt) {\n const path = splitAccessPath(field);\n field = path.length === 1 ? path[0] : field;\n return accessor((opt && opt.get || getter)(path), [field], name || field);\n}\n\nconst id = field('id');\nconst identity = accessor(_ => _, [], 'identity');\nconst zero = accessor(() => 0, [], 'zero');\nconst one = accessor(() => 1, [], 'one');\nconst truthy = accessor(() => true, [], 'true');\nconst falsy = accessor(() => false, [], 'false');\n\nfunction log$1(method, level, input) {\n const args = [level].concat([].slice.call(input));\n console[method].apply(console, args); // eslint-disable-line no-console\n}\n\nconst None = 0;\nconst Error$1 = 1;\nconst Warn = 2;\nconst Info = 3;\nconst Debug = 4;\nfunction logger (_, method) {\n let level = _ || None;\n return {\n level(_) {\n if (arguments.length) {\n level = +_;\n return this;\n } else {\n return level;\n }\n },\n\n error() {\n if (level >= Error$1) log$1(method || 'error', 'ERROR', arguments);\n return this;\n },\n\n warn() {\n if (level >= Warn) log$1(method || 'warn', 'WARN', arguments);\n return this;\n },\n\n info() {\n if (level >= Info) log$1(method || 'log', 'INFO', arguments);\n return this;\n },\n\n debug() {\n if (level >= Debug) log$1(method || 'log', 'DEBUG', arguments);\n return this;\n }\n\n };\n}\n\nvar isArray = Array.isArray;\n\nfunction isObject (_) {\n return _ === Object(_);\n}\n\nconst isLegalKey = key => key !== '__proto__';\n\nfunction mergeConfig(...configs) {\n return configs.reduce((out, source) => {\n for (const key in source) {\n if (key === 'signals') {\n // for signals, we merge the signals arrays\n // source signals take precedence over\n // existing signals with the same name\n out.signals = mergeNamed(out.signals, source.signals);\n } else {\n // otherwise, merge objects subject to recursion constraints\n // for legend block, recurse for the layout entry only\n // for style block, recurse for all properties\n // otherwise, no recursion: objects overwrite, no merging\n const r = key === 'legend' ? {\n layout: 1\n } : key === 'style' ? true : null;\n writeConfig(out, key, source[key], r);\n }\n }\n\n return out;\n }, {});\n}\nfunction writeConfig(output, key, value, recurse) {\n if (!isLegalKey(key)) return;\n let k, o;\n\n if (isObject(value) && !isArray(value)) {\n o = isObject(output[key]) ? output[key] : output[key] = {};\n\n for (k in value) {\n if (recurse && (recurse === true || recurse[k])) {\n writeConfig(o, k, value[k]);\n } else if (isLegalKey(k)) {\n o[k] = value[k];\n }\n }\n } else {\n output[key] = value;\n }\n}\n\nfunction mergeNamed(a, b) {\n if (a == null) return b;\n const map = {},\n out = [];\n\n function add(_) {\n if (!map[_.name]) {\n map[_.name] = 1;\n out.push(_);\n }\n }\n\n b.forEach(add);\n a.forEach(add);\n return out;\n}\n\nfunction peek (array) {\n return array[array.length - 1];\n}\n\nfunction toNumber (_) {\n return _ == null || _ === '' ? null : +_;\n}\n\nconst exp = sign => x => sign * Math.exp(x);\n\nconst log = sign => x => Math.log(sign * x);\n\nconst symlog = c => x => Math.sign(x) * Math.log1p(Math.abs(x / c));\n\nconst symexp = c => x => Math.sign(x) * Math.expm1(Math.abs(x)) * c;\n\nconst pow = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n\nfunction pan(domain, delta, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n dd = (d1 - d0) * delta;\n return [ground(d0 - dd), ground(d1 - dd)];\n}\n\nfunction panLinear(domain, delta) {\n return pan(domain, delta, toNumber, identity);\n}\nfunction panLog(domain, delta) {\n var sign = Math.sign(domain[0]);\n return pan(domain, delta, log(sign), exp(sign));\n}\nfunction panPow(domain, delta, exponent) {\n return pan(domain, delta, pow(exponent), pow(1 / exponent));\n}\nfunction panSymlog(domain, delta, constant) {\n return pan(domain, delta, symlog(constant), symexp(constant));\n}\n\nfunction zoom(domain, anchor, scale, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n da = anchor != null ? lift(anchor) : (d0 + d1) / 2;\n return [ground(da + (d0 - da) * scale), ground(da + (d1 - da) * scale)];\n}\n\nfunction zoomLinear(domain, anchor, scale) {\n return zoom(domain, anchor, scale, toNumber, identity);\n}\nfunction zoomLog(domain, anchor, scale) {\n const sign = Math.sign(domain[0]);\n return zoom(domain, anchor, scale, log(sign), exp(sign));\n}\nfunction zoomPow(domain, anchor, scale, exponent) {\n return zoom(domain, anchor, scale, pow(exponent), pow(1 / exponent));\n}\nfunction zoomSymlog(domain, anchor, scale, constant) {\n return zoom(domain, anchor, scale, symlog(constant), symexp(constant));\n}\n\nfunction quarter(date) {\n return 1 + ~~(new Date(date).getMonth() / 3);\n}\nfunction utcquarter(date) {\n return 1 + ~~(new Date(date).getUTCMonth() / 3);\n}\n\nfunction array (_) {\n return _ != null ? isArray(_) ? _ : [_] : [];\n}\n\n/**\n * Span-preserving range clamp. If the span of the input range is less\n * than (max - min) and an endpoint exceeds either the min or max value,\n * the range is translated such that the span is preserved and one\n * endpoint touches the boundary of the min/max range.\n * If the span exceeds (max - min), the range [min, max] is returned.\n */\nfunction clampRange (range, min, max) {\n let lo = range[0],\n hi = range[1],\n span;\n\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n\n span = hi - lo;\n return span >= max - min ? [min, max] : [lo = Math.min(Math.max(lo, min), max - span), lo + span];\n}\n\nfunction isFunction (_) {\n return typeof _ === 'function';\n}\n\nconst DESCENDING = 'descending';\nfunction compare (fields, orders, opt) {\n opt = opt || {};\n orders = array(orders) || [];\n const ord = [],\n get = [],\n fmap = {},\n gen = opt.comparator || comparator;\n array(fields).forEach((f, i) => {\n if (f == null) return;\n ord.push(orders[i] === DESCENDING ? -1 : 1);\n get.push(f = isFunction(f) ? f : field(f, null, opt));\n (accessorFields(f) || []).forEach(_ => fmap[_] = 1);\n });\n return get.length === 0 ? null : accessor(gen(get, ord), Object.keys(fmap));\n}\nconst ascending = (u, v) => (u < v || u == null) && v != null ? -1 : (u > v || v == null) && u != null ? 1 : (v = v instanceof Date ? +v : v, u = u instanceof Date ? +u : u) !== u && v === v ? -1 : v !== v && u === u ? 1 : 0;\n\nconst comparator = (fields, orders) => fields.length === 1 ? compare1(fields[0], orders[0]) : compareN(fields, orders, fields.length);\n\nconst compare1 = (field, order) => function (a, b) {\n return ascending(field(a), field(b)) * order;\n};\n\nconst compareN = (fields, orders, n) => {\n orders.push(0); // pad zero for convenient lookup\n\n return function (a, b) {\n let f,\n c = 0,\n i = -1;\n\n while (c === 0 && ++i < n) {\n f = fields[i];\n c = ascending(f(a), f(b));\n }\n\n return c * orders[i];\n };\n};\n\nfunction constant (_) {\n return isFunction(_) ? _ : () => _;\n}\n\nfunction debounce (delay, handler) {\n let tid;\n return e => {\n if (tid) clearTimeout(tid);\n tid = setTimeout(() => (handler(e), tid = null), delay);\n };\n}\n\nfunction extend (_) {\n for (let x, k, i = 1, len = arguments.length; i < len; ++i) {\n x = arguments[i];\n\n for (k in x) {\n _[k] = x[k];\n }\n }\n\n return _;\n}\n\n/**\n * Return an array with minimum and maximum values, in the\n * form [min, max]. Ignores null, undefined, and NaN values.\n */\nfunction extent (array, f) {\n let i = 0,\n n,\n v,\n min,\n max;\n\n if (array && (n = array.length)) {\n if (f == null) {\n // find first valid value\n for (v = array[i]; i < n && (v == null || v !== v); v = array[++i]);\n\n min = max = v; // visit all other values\n\n for (; i < n; ++i) {\n v = array[i]; // skip null/undefined; NaN will fail all comparisons\n\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n } else {\n // find first valid value\n for (v = f(array[i]); i < n && (v == null || v !== v); v = f(array[++i]));\n\n min = max = v; // visit all other values\n\n for (; i < n; ++i) {\n v = f(array[i]); // skip null/undefined; NaN will fail all comparisons\n\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n }\n }\n\n return [min, max];\n}\n\nfunction extentIndex (array, f) {\n const n = array.length;\n let i = -1,\n a,\n b,\n c,\n u,\n v;\n\n if (f == null) {\n while (++i < n) {\n b = array[i];\n\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n\n if (i === n) return [-1, -1];\n u = v = i;\n\n while (++i < n) {\n b = array[i];\n\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n } else {\n while (++i < n) {\n b = f(array[i], i, array);\n\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n\n if (i === n) return [-1, -1];\n u = v = i;\n\n while (++i < n) {\n b = f(array[i], i, array);\n\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n }\n\n return [u, v];\n}\n\nconst hop = Object.prototype.hasOwnProperty;\nfunction has (object, property) {\n return hop.call(object, property);\n}\n\nconst NULL = {};\nfunction fastmap (input) {\n let obj = {},\n test;\n\n function has$1(key) {\n return has(obj, key) && obj[key] !== NULL;\n }\n\n const map = {\n size: 0,\n empty: 0,\n object: obj,\n has: has$1,\n\n get(key) {\n return has$1(key) ? obj[key] : undefined;\n },\n\n set(key, value) {\n if (!has$1(key)) {\n ++map.size;\n if (obj[key] === NULL) --map.empty;\n }\n\n obj[key] = value;\n return this;\n },\n\n delete(key) {\n if (has$1(key)) {\n --map.size;\n ++map.empty;\n obj[key] = NULL;\n }\n\n return this;\n },\n\n clear() {\n map.size = map.empty = 0;\n map.object = obj = {};\n },\n\n test(_) {\n if (arguments.length) {\n test = _;\n return map;\n } else {\n return test;\n }\n },\n\n clean() {\n const next = {};\n let size = 0;\n\n for (const key in obj) {\n const value = obj[key];\n\n if (value !== NULL && (!test || !test(value))) {\n next[key] = value;\n ++size;\n }\n }\n\n map.size = size;\n map.empty = 0;\n map.object = obj = next;\n }\n\n };\n if (input) Object.keys(input).forEach(key => {\n map.set(key, input[key]);\n });\n return map;\n}\n\nfunction flush (range, value, threshold, left, right, center) {\n if (!threshold && threshold !== 0) return center;\n const t = +threshold;\n let a = range[0],\n b = peek(range),\n l; // swap endpoints if range is reversed\n\n if (b < a) {\n l = a;\n a = b;\n b = l;\n } // compare value to endpoints\n\n\n l = Math.abs(value - a);\n const r = Math.abs(b - value); // adjust if value is within threshold distance of endpoint\n\n return l < r && l <= t ? left : r <= t ? right : center;\n}\n\nfunction inherits (child, parent, members) {\n const proto = child.prototype = Object.create(parent.prototype);\n Object.defineProperty(proto, 'constructor', {\n value: child,\n writable: true,\n enumerable: true,\n configurable: true\n });\n return extend(proto, members);\n}\n\n/**\n * Predicate that returns true if the value lies within the span\n * of the given range. The left and right flags control the use\n * of inclusive (true) or exclusive (false) comparisons.\n */\nfunction inrange (value, range, left, right) {\n let r0 = range[0],\n r1 = range[range.length - 1],\n t;\n\n if (r0 > r1) {\n t = r0;\n r0 = r1;\n r1 = t;\n }\n\n left = left === undefined || left;\n right = right === undefined || right;\n return (left ? r0 <= value : r0 < value) && (right ? value <= r1 : value < r1);\n}\n\nfunction isBoolean (_) {\n return typeof _ === 'boolean';\n}\n\nfunction isDate (_) {\n return Object.prototype.toString.call(_) === '[object Date]';\n}\n\nfunction isIterable (_) {\n return _ && isFunction(_[Symbol.iterator]);\n}\n\nfunction isNumber (_) {\n return typeof _ === 'number';\n}\n\nfunction isRegExp (_) {\n return Object.prototype.toString.call(_) === '[object RegExp]';\n}\n\nfunction isString (_) {\n return typeof _ === 'string';\n}\n\nfunction key (fields, flat, opt) {\n if (fields) {\n fields = flat ? array(fields).map(f => f.replace(/\\\\(.)/g, '$1')) : array(fields);\n }\n\n const len = fields && fields.length,\n gen = opt && opt.get || getter,\n map = f => gen(flat ? [f] : splitAccessPath(f));\n\n let fn;\n\n if (!len) {\n fn = function () {\n return '';\n };\n } else if (len === 1) {\n const get = map(fields[0]);\n\n fn = function (_) {\n return '' + get(_);\n };\n } else {\n const get = fields.map(map);\n\n fn = function (_) {\n let s = '' + get[0](_),\n i = 0;\n\n while (++i < len) s += '|' + get[i](_);\n\n return s;\n };\n }\n\n return accessor(fn, fields, 'key');\n}\n\nfunction lerp (array, frac) {\n const lo = array[0],\n hi = peek(array),\n f = +frac;\n return !f ? lo : f === 1 ? hi : lo + f * (hi - lo);\n}\n\nconst DEFAULT_MAX_SIZE = 10000; // adapted from https://github.com/dominictarr/hashlru/ (MIT License)\n\nfunction lruCache (maxsize) {\n maxsize = +maxsize || DEFAULT_MAX_SIZE;\n let curr, prev, size;\n\n const clear = () => {\n curr = {};\n prev = {};\n size = 0;\n };\n\n const update = (key, value) => {\n if (++size > maxsize) {\n prev = curr;\n curr = {};\n size = 1;\n }\n\n return curr[key] = value;\n };\n\n clear();\n return {\n clear,\n has: key => has(curr, key) || has(prev, key),\n get: key => has(curr, key) ? curr[key] : has(prev, key) ? update(key, prev[key]) : undefined,\n set: (key, value) => has(curr, key) ? curr[key] = value : update(key, value)\n };\n}\n\nfunction merge (compare, array0, array1, output) {\n const n0 = array0.length,\n n1 = array1.length;\n if (!n1) return array0;\n if (!n0) return array1;\n const merged = output || new array0.constructor(n0 + n1);\n let i0 = 0,\n i1 = 0,\n i = 0;\n\n for (; i0 < n0 && i1 < n1; ++i) {\n merged[i] = compare(array0[i0], array1[i1]) > 0 ? array1[i1++] : array0[i0++];\n }\n\n for (; i0 < n0; ++i0, ++i) {\n merged[i] = array0[i0];\n }\n\n for (; i1 < n1; ++i1, ++i) {\n merged[i] = array1[i1];\n }\n\n return merged;\n}\n\nfunction repeat (str, reps) {\n let s = '';\n\n while (--reps >= 0) s += str;\n\n return s;\n}\n\nfunction pad (str, length, padchar, align) {\n const c = padchar || ' ',\n s = str + '',\n n = length - s.length;\n return n <= 0 ? s : align === 'left' ? repeat(c, n) + s : align === 'center' ? repeat(c, ~~(n / 2)) + s + repeat(c, Math.ceil(n / 2)) : s + repeat(c, n);\n}\n\n/**\n * Return the numerical span of an array: the difference between\n * the last and first values.\n */\n\nfunction span (array) {\n return array && peek(array) - array[0] || 0;\n}\n\nfunction $(x) {\n return isArray(x) ? '[' + x.map($) + ']' : isObject(x) || isString(x) ? // Output valid JSON and JS source strings.\n // See http://timelessrepo.com/json-isnt-a-javascript-subset\n JSON.stringify(x).replace('\\u2028', '\\\\u2028').replace('\\u2029', '\\\\u2029') : x;\n}\n\nfunction toBoolean (_) {\n return _ == null || _ === '' ? null : !_ || _ === 'false' || _ === '0' ? false : !!_;\n}\n\nconst defaultParser = _ => isNumber(_) ? _ : isDate(_) ? _ : Date.parse(_);\n\nfunction toDate (_, parser) {\n parser = parser || defaultParser;\n return _ == null || _ === '' ? null : parser(_);\n}\n\nfunction toString (_) {\n return _ == null || _ === '' ? null : _ + '';\n}\n\nfunction toSet (_) {\n const s = {},\n n = _.length;\n\n for (let i = 0; i < n; ++i) s[_[i]] = true;\n\n return s;\n}\n\nfunction truncate (str, length, align, ellipsis) {\n const e = ellipsis != null ? ellipsis : '\\u2026',\n s = str + '',\n n = s.length,\n l = Math.max(0, length - e.length);\n return n <= length ? s : align === 'left' ? e + s.slice(n - l) : align === 'center' ? s.slice(0, Math.ceil(l / 2)) + e + s.slice(n - ~~(l / 2)) : s.slice(0, l) + e;\n}\n\nfunction visitArray (array, filter, visitor) {\n if (array) {\n if (filter) {\n const n = array.length;\n\n for (let i = 0; i < n; ++i) {\n const t = filter(array[i]);\n if (t) visitor(t, i, array);\n }\n } else {\n array.forEach(visitor);\n }\n }\n}\n\nexport { Debug, Error$1 as Error, Info, None, Warn, accessor, accessorFields, accessorName, array, ascending, clampRange, compare, constant, debounce, error, extend, extent, extentIndex, falsy, fastmap, field, flush, has as hasOwnProperty, id, identity, inherits, inrange, isArray, isBoolean, isDate, isFunction, isIterable, isNumber, isObject, isRegExp, isString, key, lerp, logger, lruCache, merge, mergeConfig, one, pad, panLinear, panLog, panPow, panSymlog, peek, quarter, repeat, span, splitAccessPath, $ as stringValue, toBoolean, toDate, toNumber, toSet, toString, truncate, truthy, utcquarter, visitArray, writeConfig, zero, zoomLinear, zoomLog, zoomPow, zoomSymlog };\n","Array.prototype.flat||Object.defineProperty(Array.prototype,\"flat\",{configurable:!0,value:function r(){var t=isNaN(arguments[0])?1:Number(arguments[0]);return t?Array.prototype.reduce.call(this,function(a,e){return Array.isArray(e)?a.push.apply(a,r.call(e,t-1)):a.push(e),a},[]):Array.prototype.slice.call(this)},writable:!0}),Array.prototype.flatMap||Object.defineProperty(Array.prototype,\"flatMap\",{configurable:!0,value:function(r){return Array.prototype.map.apply(this,arguments).flat()},writable:!0})\n","export function isLogicalOr(op) {\n return !!op.or;\n}\nexport function isLogicalAnd(op) {\n return !!op.and;\n}\nexport function isLogicalNot(op) {\n return !!op.not;\n}\nexport function forEachLeaf(op, fn) {\n if (isLogicalNot(op)) {\n forEachLeaf(op.not, fn);\n }\n else if (isLogicalAnd(op)) {\n for (const subop of op.and) {\n forEachLeaf(subop, fn);\n }\n }\n else if (isLogicalOr(op)) {\n for (const subop of op.or) {\n forEachLeaf(subop, fn);\n }\n }\n else {\n fn(op);\n }\n}\nexport function normalizeLogicalComposition(op, normalizer) {\n if (isLogicalNot(op)) {\n return { not: normalizeLogicalComposition(op.not, normalizer) };\n }\n else if (isLogicalAnd(op)) {\n return { and: op.and.map(o => normalizeLogicalComposition(o, normalizer)) };\n }\n else if (isLogicalOr(op)) {\n return { or: op.or.map(o => normalizeLogicalComposition(o, normalizer)) };\n }\n else {\n return normalizer(op);\n }\n}\n//# sourceMappingURL=logical.js.map","import 'array-flat-polyfill';\nimport { default as clone_ } from 'clone';\nimport deepEqual_ from 'fast-deep-equal';\nimport stableStringify from 'fast-json-stable-stringify';\nimport { hasOwnProperty, isNumber, isString, splitAccessPath, stringValue, writeConfig } from 'vega-util';\nimport { isLogicalAnd, isLogicalNot, isLogicalOr } from './logical';\nexport const deepEqual = deepEqual_;\nexport const duplicate = clone_;\n/**\n * Creates an object composed of the picked object properties.\n *\n * var object = {'a': 1, 'b': '2', 'c': 3};\n * pick(object, ['a', 'c']);\n * // → {'a': 1, 'c': 3}\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function pick(obj, props) {\n const copy = {};\n for (const prop of props) {\n if (hasOwnProperty(obj, prop)) {\n copy[prop] = obj[prop];\n }\n }\n return copy;\n}\n/**\n * The opposite of _.pick; this method creates an object composed of the own\n * and inherited enumerable string keyed properties of object that are not omitted.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function omit(obj, props) {\n const copy = Object.assign({}, obj);\n for (const prop of props) {\n delete copy[prop];\n }\n return copy;\n}\n/**\n * Monkey patch Set so that `stringify` produces a string representation of sets.\n */\nSet.prototype['toJSON'] = function () {\n return `Set(${[...this].map(x => stableStringify(x)).join(',')})`;\n};\n/**\n * Converts any object to a string representation that can be consumed by humans.\n */\nexport const stringify = stableStringify;\n/**\n * Converts any object to a string of limited size, or a number.\n */\nexport function hash(a) {\n if (isNumber(a)) {\n return a;\n }\n const str = isString(a) ? a : stableStringify(a);\n // short strings can be used as hash directly, longer strings are hashed to reduce memory usage\n if (str.length < 250) {\n return str;\n }\n // from http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/\n let h = 0;\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i);\n h = (h << 5) - h + char;\n h = h & h; // Convert to 32bit integer\n }\n return h;\n}\nexport function isNullOrFalse(x) {\n return x === false || x === null;\n}\nexport function contains(array, item) {\n return array.indexOf(item) > -1;\n}\n/**\n * Returns true if any item returns true.\n */\nexport function some(arr, f) {\n let i = 0;\n for (const [k, a] of arr.entries()) {\n if (f(a, k, i++)) {\n return true;\n }\n }\n return false;\n}\n/**\n * Returns true if all items return true.\n */\nexport function every(arr, f) {\n let i = 0;\n for (const [k, a] of arr.entries()) {\n if (!f(a, k, i++)) {\n return false;\n }\n }\n return true;\n}\n/**\n * recursively merges src into dest\n */\nexport function mergeDeep(dest, ...src) {\n for (const s of src) {\n deepMerge_(dest, s !== null && s !== void 0 ? s : {});\n }\n return dest;\n}\nfunction deepMerge_(dest, src) {\n for (const property of keys(src)) {\n writeConfig(dest, property, src[property], true);\n }\n}\nexport function unique(values, f) {\n const results = [];\n const u = {};\n let v;\n for (const val of values) {\n v = f(val);\n if (v in u) {\n continue;\n }\n u[v] = 1;\n results.push(val);\n }\n return results;\n}\n/**\n * Returns true if the two dictionaries disagree. Applies only to defined values.\n */\nexport function isEqual(dict, other) {\n const dictKeys = keys(dict);\n const otherKeys = keys(other);\n if (dictKeys.length !== otherKeys.length) {\n return false;\n }\n for (const key of dictKeys) {\n if (dict[key] !== other[key]) {\n return false;\n }\n }\n return true;\n}\nexport function setEqual(a, b) {\n if (a.size !== b.size) {\n return false;\n }\n for (const e of a) {\n if (!b.has(e)) {\n return false;\n }\n }\n return true;\n}\nexport function hasIntersection(a, b) {\n for (const key of a) {\n if (b.has(key)) {\n return true;\n }\n }\n return false;\n}\nexport function prefixGenerator(a) {\n const prefixes = new Set();\n for (const x of a) {\n const splitField = splitAccessPath(x);\n // Wrap every element other than the first in `[]`\n const wrappedWithAccessors = splitField.map((y, i) => (i === 0 ? y : `[${y}]`));\n const computedPrefixes = wrappedWithAccessors.map((_, i) => wrappedWithAccessors.slice(0, i + 1).join(''));\n for (const y of computedPrefixes) {\n prefixes.add(y);\n }\n }\n return prefixes;\n}\n/**\n * Returns true if a and b have an intersection. Also return true if a or b are undefined\n * since this means we don't know what fields a node produces or depends on.\n */\nexport function fieldIntersection(a, b) {\n if (a === undefined || b === undefined) {\n return true;\n }\n return hasIntersection(prefixGenerator(a), prefixGenerator(b));\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function isEmpty(obj) {\n return keys(obj).length === 0;\n}\n// This is a stricter version of Object.keys but with better types. See https://github.com/Microsoft/TypeScript/pull/12253#issuecomment-263132208\nexport const keys = Object.keys;\nexport const vals = Object.values;\nexport const entries = Object.entries;\nexport function isBoolean(b) {\n return b === true || b === false;\n}\n/**\n * Convert a string into a valid variable name\n */\nexport function varName(s) {\n // Replace non-alphanumeric characters (anything besides a-zA-Z0-9_) with _\n const alphanumericS = s.replace(/\\W/g, '_');\n // Add _ if the string has leading numbers.\n return (s.match(/^\\d+/) ? '_' : '') + alphanumericS;\n}\nexport function logicalExpr(op, cb) {\n if (isLogicalNot(op)) {\n return '!(' + logicalExpr(op.not, cb) + ')';\n }\n else if (isLogicalAnd(op)) {\n return '(' + op.and.map((and) => logicalExpr(and, cb)).join(') && (') + ')';\n }\n else if (isLogicalOr(op)) {\n return '(' + op.or.map((or) => logicalExpr(or, cb)).join(') || (') + ')';\n }\n else {\n return cb(op);\n }\n}\n/**\n * Delete nested property of an object, and delete the ancestors of the property if they become empty.\n */\nexport function deleteNestedProperty(obj, orderedProps) {\n if (orderedProps.length === 0) {\n return true;\n }\n const prop = orderedProps.shift(); // eslint-disable-line @typescript-eslint/no-non-null-assertion\n if (prop in obj && deleteNestedProperty(obj[prop], orderedProps)) {\n delete obj[prop];\n }\n return isEmpty(obj);\n}\nexport function titleCase(s) {\n return s.charAt(0).toUpperCase() + s.substr(1);\n}\n/**\n * Converts a path to an access path with datum.\n * @param path The field name.\n * @param datum The string to use for `datum`.\n */\nexport function accessPathWithDatum(path, datum = 'datum') {\n const pieces = splitAccessPath(path);\n const prefixes = [];\n for (let i = 1; i <= pieces.length; i++) {\n const prefix = `[${pieces.slice(0, i).map(stringValue).join('][')}]`;\n prefixes.push(`${datum}${prefix}`);\n }\n return prefixes.join(' && ');\n}\n/**\n * Return access with datum to the flattened field.\n *\n * @param path The field name.\n * @param datum The string to use for `datum`.\n */\nexport function flatAccessWithDatum(path, datum = 'datum') {\n return `${datum}[${stringValue(splitAccessPath(path).join('.'))}]`;\n}\nfunction escapePathAccess(string) {\n return string.replace(/(\\[|\\]|\\.|'|\")/g, '\\\\$1');\n}\n/**\n * Replaces path accesses with access to non-nested field.\n * For example, `foo[\"bar\"].baz` becomes `foo\\\\.bar\\\\.baz`.\n */\nexport function replacePathInField(path) {\n return `${splitAccessPath(path).map(escapePathAccess).join('\\\\.')}`;\n}\n/**\n * Replace all occurrences of a string with another string.\n *\n * @param string the string to replace in\n * @param find the string to replace\n * @param replacement the replacement\n */\nexport function replaceAll(string, find, replacement) {\n return string.replace(new RegExp(find.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'g'), replacement);\n}\n/**\n * Remove path accesses with access from field.\n * For example, `foo[\"bar\"].baz` becomes `foo.bar.baz`.\n */\nexport function removePathFromField(path) {\n return `${splitAccessPath(path).join('.')}`;\n}\n/**\n * Count the depth of the path. Returns 1 for fields that are not nested.\n */\nexport function accessPathDepth(path) {\n if (!path) {\n return 0;\n }\n return splitAccessPath(path).length;\n}\n/**\n * This is a replacement for chained || for numeric properties or properties that respect null so that 0 will be included.\n */\nexport function getFirstDefined(...args) {\n for (const arg of args) {\n if (arg !== undefined) {\n return arg;\n }\n }\n return undefined;\n}\n// variable used to generate id\nlet idCounter = 42;\n/**\n * Returns a new random id every time it gets called.\n *\n * Has side effect!\n */\nexport function uniqueId(prefix) {\n const id = ++idCounter;\n return prefix ? String(prefix) + id : id;\n}\n/**\n * Resets the id counter used in uniqueId. This can be useful for testing.\n */\nexport function resetIdCounter() {\n idCounter = 42;\n}\nexport function internalField(name) {\n return isInternalField(name) ? name : `__${name}`;\n}\nexport function isInternalField(name) {\n return name.indexOf('__') === 0;\n}\n/**\n * Normalize angle to be within [0,360).\n */\nexport function normalizeAngle(angle) {\n if (angle === undefined) {\n return undefined;\n }\n return ((angle % 360) + 360) % 360;\n}\n/**\n * Returns whether the passed in value is a valid number.\n */\nexport function isNumeric(value) {\n if (isNumber(value)) {\n return true;\n }\n return !isNaN(value) && !isNaN(parseFloat(value));\n}\n//# sourceMappingURL=util.js.map","import { keys } from './util';\nexport const CONDITIONAL_AXIS_PROP_INDEX = {\n labelAlign: {\n part: 'labels',\n vgProp: 'align'\n },\n labelBaseline: {\n part: 'labels',\n vgProp: 'baseline'\n },\n labelColor: {\n part: 'labels',\n vgProp: 'fill'\n },\n labelFont: {\n part: 'labels',\n vgProp: 'font'\n },\n labelFontSize: {\n part: 'labels',\n vgProp: 'fontSize'\n },\n labelFontStyle: {\n part: 'labels',\n vgProp: 'fontStyle'\n },\n labelFontWeight: {\n part: 'labels',\n vgProp: 'fontWeight'\n },\n labelOpacity: {\n part: 'labels',\n vgProp: 'opacity'\n },\n labelOffset: null,\n labelPadding: null,\n gridColor: {\n part: 'grid',\n vgProp: 'stroke'\n },\n gridDash: {\n part: 'grid',\n vgProp: 'strokeDash'\n },\n gridDashOffset: {\n part: 'grid',\n vgProp: 'strokeDashOffset'\n },\n gridOpacity: {\n part: 'grid',\n vgProp: 'opacity'\n },\n gridWidth: {\n part: 'grid',\n vgProp: 'strokeWidth'\n },\n tickColor: {\n part: 'ticks',\n vgProp: 'stroke'\n },\n tickDash: {\n part: 'ticks',\n vgProp: 'strokeDash'\n },\n tickDashOffset: {\n part: 'ticks',\n vgProp: 'strokeDashOffset'\n },\n tickOpacity: {\n part: 'ticks',\n vgProp: 'opacity'\n },\n tickSize: null,\n tickWidth: {\n part: 'ticks',\n vgProp: 'strokeWidth'\n }\n};\nexport function isConditionalAxisValue(v) {\n return v && v['condition'];\n}\nexport const AXIS_PARTS = ['domain', 'grid', 'labels', 'ticks', 'title'];\n/**\n * A dictionary listing whether a certain axis property is applicable for only main axes or only grid axes.\n */\nexport const AXIS_PROPERTY_TYPE = {\n grid: 'grid',\n gridCap: 'grid',\n gridColor: 'grid',\n gridDash: 'grid',\n gridDashOffset: 'grid',\n gridOpacity: 'grid',\n gridScale: 'grid',\n gridWidth: 'grid',\n orient: 'main',\n bandPosition: 'both',\n aria: 'main',\n description: 'main',\n domain: 'main',\n domainCap: 'main',\n domainColor: 'main',\n domainDash: 'main',\n domainDashOffset: 'main',\n domainOpacity: 'main',\n domainWidth: 'main',\n format: 'main',\n formatType: 'main',\n labelAlign: 'main',\n labelAngle: 'main',\n labelBaseline: 'main',\n labelBound: 'main',\n labelColor: 'main',\n labelFlush: 'main',\n labelFlushOffset: 'main',\n labelFont: 'main',\n labelFontSize: 'main',\n labelFontStyle: 'main',\n labelFontWeight: 'main',\n labelLimit: 'main',\n labelLineHeight: 'main',\n labelOffset: 'main',\n labelOpacity: 'main',\n labelOverlap: 'main',\n labelPadding: 'main',\n labels: 'main',\n labelSeparation: 'main',\n maxExtent: 'main',\n minExtent: 'main',\n offset: 'both',\n position: 'main',\n tickCap: 'main',\n tickColor: 'main',\n tickDash: 'main',\n tickDashOffset: 'main',\n tickMinStep: 'main',\n tickOffset: 'both',\n tickOpacity: 'main',\n tickRound: 'both',\n ticks: 'main',\n tickSize: 'main',\n tickWidth: 'both',\n title: 'main',\n titleAlign: 'main',\n titleAnchor: 'main',\n titleAngle: 'main',\n titleBaseline: 'main',\n titleColor: 'main',\n titleFont: 'main',\n titleFontSize: 'main',\n titleFontStyle: 'main',\n titleFontWeight: 'main',\n titleLimit: 'main',\n titleLineHeight: 'main',\n titleOpacity: 'main',\n titlePadding: 'main',\n titleX: 'main',\n titleY: 'main',\n encode: 'both',\n scale: 'both',\n tickBand: 'both',\n tickCount: 'both',\n tickExtra: 'both',\n translate: 'both',\n values: 'both',\n zindex: 'both' // this is actually set afterward, so it doesn't matter\n};\nexport const COMMON_AXIS_PROPERTIES_INDEX = {\n orient: 1,\n aria: 1,\n bandPosition: 1,\n description: 1,\n domain: 1,\n domainCap: 1,\n domainColor: 1,\n domainDash: 1,\n domainDashOffset: 1,\n domainOpacity: 1,\n domainWidth: 1,\n format: 1,\n formatType: 1,\n grid: 1,\n gridCap: 1,\n gridColor: 1,\n gridDash: 1,\n gridDashOffset: 1,\n gridOpacity: 1,\n gridWidth: 1,\n labelAlign: 1,\n labelAngle: 1,\n labelBaseline: 1,\n labelBound: 1,\n labelColor: 1,\n labelFlush: 1,\n labelFlushOffset: 1,\n labelFont: 1,\n labelFontSize: 1,\n labelFontStyle: 1,\n labelFontWeight: 1,\n labelLimit: 1,\n labelLineHeight: 1,\n labelOffset: 1,\n labelOpacity: 1,\n labelOverlap: 1,\n labelPadding: 1,\n labels: 1,\n labelSeparation: 1,\n maxExtent: 1,\n minExtent: 1,\n offset: 1,\n position: 1,\n tickBand: 1,\n tickCap: 1,\n tickColor: 1,\n tickCount: 1,\n tickDash: 1,\n tickDashOffset: 1,\n tickExtra: 1,\n tickMinStep: 1,\n tickOffset: 1,\n tickOpacity: 1,\n tickRound: 1,\n ticks: 1,\n tickSize: 1,\n tickWidth: 1,\n title: 1,\n titleAlign: 1,\n titleAnchor: 1,\n titleAngle: 1,\n titleBaseline: 1,\n titleColor: 1,\n titleFont: 1,\n titleFontSize: 1,\n titleFontStyle: 1,\n titleFontWeight: 1,\n titleLimit: 1,\n titleLineHeight: 1,\n titleOpacity: 1,\n titlePadding: 1,\n titleX: 1,\n titleY: 1,\n translate: 1,\n values: 1,\n zindex: 1\n};\nconst AXIS_PROPERTIES_INDEX = Object.assign(Object.assign({}, COMMON_AXIS_PROPERTIES_INDEX), { style: 1, labelExpr: 1, encoding: 1 });\nexport function isAxisProperty(prop) {\n return !!AXIS_PROPERTIES_INDEX[prop];\n}\n// Export for dependent projects\nexport const AXIS_PROPERTIES = keys(AXIS_PROPERTIES_INDEX);\nconst AXIS_CONFIGS_INDEX = {\n axis: 1,\n axisBand: 1,\n axisBottom: 1,\n axisDiscrete: 1,\n axisLeft: 1,\n axisPoint: 1,\n axisQuantitative: 1,\n axisRight: 1,\n axisTemporal: 1,\n axisTop: 1,\n axisX: 1,\n axisXBand: 1,\n axisXDiscrete: 1,\n axisXPoint: 1,\n axisXQuantitative: 1,\n axisXTemporal: 1,\n axisY: 1,\n axisYBand: 1,\n axisYDiscrete: 1,\n axisYPoint: 1,\n axisYQuantitative: 1,\n axisYTemporal: 1\n};\nexport const AXIS_CONFIGS = keys(AXIS_CONFIGS_INDEX);\n//# sourceMappingURL=axis.js.map","import { isString, toSet } from 'vega-util';\nimport { contains, keys } from './util';\nconst AGGREGATE_OP_INDEX = {\n argmax: 1,\n argmin: 1,\n average: 1,\n count: 1,\n distinct: 1,\n product: 1,\n max: 1,\n mean: 1,\n median: 1,\n min: 1,\n missing: 1,\n q1: 1,\n q3: 1,\n ci0: 1,\n ci1: 1,\n stderr: 1,\n stdev: 1,\n stdevp: 1,\n sum: 1,\n valid: 1,\n values: 1,\n variance: 1,\n variancep: 1\n};\nexport const MULTIDOMAIN_SORT_OP_INDEX = {\n count: 1,\n min: 1,\n max: 1\n};\nexport function isArgminDef(a) {\n return !!a && !!a['argmin'];\n}\nexport function isArgmaxDef(a) {\n return !!a && !!a['argmax'];\n}\nexport const AGGREGATE_OPS = keys(AGGREGATE_OP_INDEX);\nexport function isAggregateOp(a) {\n return isString(a) && !!AGGREGATE_OP_INDEX[a];\n}\nexport const COUNTING_OPS = ['count', 'valid', 'missing', 'distinct'];\nexport function isCountingAggregateOp(aggregate) {\n return isString(aggregate) && contains(COUNTING_OPS, aggregate);\n}\nexport function isMinMaxOp(aggregate) {\n return isString(aggregate) && contains(['min', 'max'], aggregate);\n}\n/** Additive-based aggregation operations. These can be applied to stack. */\nexport const SUM_OPS = ['count', 'sum', 'distinct', 'valid', 'missing'];\n/**\n * Aggregation operators that always produce values within the range [domainMin, domainMax].\n */\nexport const SHARED_DOMAIN_OPS = ['mean', 'average', 'median', 'q1', 'q3', 'min', 'max'];\nexport const SHARED_DOMAIN_OP_INDEX = toSet(SHARED_DOMAIN_OPS);\n//# sourceMappingURL=aggregate.js.map","/*\n * Constants and utilities for encoding channels (Visual variables)\n * such as 'x', 'y', 'color'.\n */\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { keys } from './util';\n// Facet\nexport const ROW = 'row';\nexport const COLUMN = 'column';\nexport const FACET = 'facet';\n// Position\nexport const X = 'x';\nexport const Y = 'y';\nexport const X2 = 'x2';\nexport const Y2 = 'y2';\n// Arc-Position\nexport const RADIUS = 'radius';\nexport const RADIUS2 = 'radius2';\nexport const THETA = 'theta';\nexport const THETA2 = 'theta2';\n// Geo Position\nexport const LATITUDE = 'latitude';\nexport const LONGITUDE = 'longitude';\nexport const LATITUDE2 = 'latitude2';\nexport const LONGITUDE2 = 'longitude2';\n// Mark property with scale\nexport const COLOR = 'color';\nexport const FILL = 'fill';\nexport const STROKE = 'stroke';\nexport const SHAPE = 'shape';\nexport const SIZE = 'size';\nexport const ANGLE = 'angle';\nexport const OPACITY = 'opacity';\nexport const FILLOPACITY = 'fillOpacity';\nexport const STROKEOPACITY = 'strokeOpacity';\nexport const STROKEWIDTH = 'strokeWidth';\nexport const STROKEDASH = 'strokeDash';\n// Non-scale channel\nexport const TEXT = 'text';\nexport const ORDER = 'order';\nexport const DETAIL = 'detail';\nexport const KEY = 'key';\nexport const TOOLTIP = 'tooltip';\nexport const HREF = 'href';\nexport const URL = 'url';\nexport const DESCRIPTION = 'description';\nconst POSITION_CHANNEL_INDEX = {\n x: 1,\n y: 1,\n x2: 1,\n y2: 1\n};\nconst POLAR_POSITION_CHANNEL_INDEX = {\n theta: 1,\n theta2: 1,\n radius: 1,\n radius2: 1\n};\nexport function isPolarPositionChannel(c) {\n return c in POLAR_POSITION_CHANNEL_INDEX;\n}\nconst GEO_POSIITON_CHANNEL_INDEX = {\n longitude: 1,\n longitude2: 1,\n latitude: 1,\n latitude2: 1\n};\nexport function getPositionChannelFromLatLong(channel) {\n switch (channel) {\n case LATITUDE:\n return 'y';\n case LATITUDE2:\n return 'y2';\n case LONGITUDE:\n return 'x';\n case LONGITUDE2:\n return 'x2';\n }\n}\nexport function isGeoPositionChannel(c) {\n return c in GEO_POSIITON_CHANNEL_INDEX;\n}\nexport const GEOPOSITION_CHANNELS = keys(GEO_POSIITON_CHANNEL_INDEX);\nconst UNIT_CHANNEL_INDEX = Object.assign(Object.assign(Object.assign(Object.assign({}, POSITION_CHANNEL_INDEX), POLAR_POSITION_CHANNEL_INDEX), GEO_POSIITON_CHANNEL_INDEX), { \n // color\n color: 1, fill: 1, stroke: 1, \n // other non-position with scale\n opacity: 1, fillOpacity: 1, strokeOpacity: 1, strokeWidth: 1, strokeDash: 1, size: 1, angle: 1, shape: 1, \n // channels without scales\n order: 1, text: 1, detail: 1, key: 1, tooltip: 1, href: 1, url: 1, description: 1 });\nexport function isColorChannel(channel) {\n return channel === COLOR || channel === FILL || channel === STROKE;\n}\nconst FACET_CHANNEL_INDEX = {\n row: 1,\n column: 1,\n facet: 1\n};\nexport const FACET_CHANNELS = keys(FACET_CHANNEL_INDEX);\nconst CHANNEL_INDEX = Object.assign(Object.assign({}, UNIT_CHANNEL_INDEX), FACET_CHANNEL_INDEX);\nexport const CHANNELS = keys(CHANNEL_INDEX);\nconst { order: _o, detail: _d, tooltip: _tt1 } = CHANNEL_INDEX, SINGLE_DEF_CHANNEL_INDEX = __rest(CHANNEL_INDEX, [\"order\", \"detail\", \"tooltip\"]);\nconst { row: _r, column: _c, facet: _f } = SINGLE_DEF_CHANNEL_INDEX, SINGLE_DEF_UNIT_CHANNEL_INDEX = __rest(SINGLE_DEF_CHANNEL_INDEX, [\"row\", \"column\", \"facet\"]);\n/**\n * Channels that cannot have an array of channelDef.\n * model.fieldDef, getFieldDef only work for these channels.\n *\n * (The only two channels that can have an array of channelDefs are \"detail\" and \"order\".\n * Since there can be multiple fieldDefs for detail and order, getFieldDef/model.fieldDef\n * are not applicable for them. Similarly, selection projection won't work with \"detail\" and \"order\".)\n */\nexport const SINGLE_DEF_CHANNELS = keys(SINGLE_DEF_CHANNEL_INDEX);\nexport const SINGLE_DEF_UNIT_CHANNELS = keys(SINGLE_DEF_UNIT_CHANNEL_INDEX);\nexport function isSingleDefUnitChannel(str) {\n return !!SINGLE_DEF_UNIT_CHANNEL_INDEX[str];\n}\nexport function isChannel(str) {\n return !!CHANNEL_INDEX[str];\n}\nexport const SECONDARY_RANGE_CHANNEL = [X2, Y2, LATITUDE2, LONGITUDE2, THETA2, RADIUS2];\nexport function isSecondaryRangeChannel(c) {\n const main = getMainRangeChannel(c);\n return main !== c;\n}\n/**\n * Get the main channel for a range channel. E.g. `x` for `x2`.\n */\nexport function getMainRangeChannel(channel) {\n switch (channel) {\n case X2:\n return X;\n case Y2:\n return Y;\n case LATITUDE2:\n return LATITUDE;\n case LONGITUDE2:\n return LONGITUDE;\n case THETA2:\n return THETA;\n case RADIUS2:\n return RADIUS;\n }\n return channel;\n}\nexport function getVgPositionChannel(channel) {\n if (isPolarPositionChannel(channel)) {\n switch (channel) {\n case THETA:\n return 'startAngle';\n case THETA2:\n return 'endAngle';\n case RADIUS:\n return 'outerRadius';\n case RADIUS2:\n return 'innerRadius';\n }\n }\n return channel;\n}\n/**\n * Get the main channel for a range channel. E.g. `x` for `x2`.\n */\nexport function getSecondaryRangeChannel(channel) {\n switch (channel) {\n case X:\n return X2;\n case Y:\n return Y2;\n case LATITUDE:\n return LATITUDE2;\n case LONGITUDE:\n return LONGITUDE2;\n case THETA:\n return THETA2;\n case RADIUS:\n return RADIUS2;\n }\n return undefined;\n}\nexport function getSizeChannel(channel) {\n switch (channel) {\n case X:\n case X2:\n return 'width';\n case Y:\n case Y2:\n return 'height';\n }\n return undefined;\n}\n/**\n * Get the main channel for a range channel. E.g. `x` for `x2`.\n */\nexport function getOffsetChannel(channel) {\n switch (channel) {\n case X:\n return 'xOffset';\n case Y:\n return 'yOffset';\n case X2:\n return 'x2Offset';\n case Y2:\n return 'y2Offset';\n case THETA:\n return 'thetaOffset';\n case RADIUS:\n return 'radiusOffset';\n case THETA2:\n return 'theta2Offset';\n case RADIUS2:\n return 'radius2Offset';\n }\n return undefined;\n}\n// CHANNELS without COLUMN, ROW\nexport const UNIT_CHANNELS = keys(UNIT_CHANNEL_INDEX);\n// NONPOSITION_CHANNELS = UNIT_CHANNELS without X, Y, X2, Y2;\nconst { x: _x, y: _y, \n// x2 and y2 share the same scale as x and y\nx2: _x2, y2: _y2, latitude: _latitude, longitude: _longitude, latitude2: _latitude2, longitude2: _longitude2, theta: _theta, theta2: _theta2, radius: _radius, radius2: _radius2 } = UNIT_CHANNEL_INDEX, \n// The rest of unit channels then have scale\nNONPOSITION_CHANNEL_INDEX = __rest(UNIT_CHANNEL_INDEX, [\"x\", \"y\", \"x2\", \"y2\", \"latitude\", \"longitude\", \"latitude2\", \"longitude2\", \"theta\", \"theta2\", \"radius\", \"radius2\"]);\nexport const NONPOSITION_CHANNELS = keys(NONPOSITION_CHANNEL_INDEX);\nexport const POSITION_SCALE_CHANNEL_INDEX = {\n x: 1,\n y: 1\n};\nexport const POSITION_SCALE_CHANNELS = keys(POSITION_SCALE_CHANNEL_INDEX);\nexport function isXorY(channel) {\n return channel in POSITION_SCALE_CHANNEL_INDEX;\n}\nexport const POLAR_POSITION_SCALE_CHANNEL_INDEX = {\n theta: 1,\n radius: 1\n};\nexport const POLAR_POSITION_SCALE_CHANNELS = keys(POLAR_POSITION_SCALE_CHANNEL_INDEX);\nexport function getPositionScaleChannel(sizeType) {\n return sizeType === 'width' ? X : Y;\n}\n// NON_POSITION_SCALE_CHANNEL = SCALE_CHANNELS without X, Y\nconst { \n// x2 and y2 share the same scale as x and y\n// text and tooltip have format instead of scale,\n// href has neither format, nor scale\ntext: _t, tooltip: _tt, href: _hr, url: _u, description: _al, \n// detail and order have no scale\ndetail: _dd, key: _k, order: _oo } = NONPOSITION_CHANNEL_INDEX, NONPOSITION_SCALE_CHANNEL_INDEX = __rest(NONPOSITION_CHANNEL_INDEX, [\"text\", \"tooltip\", \"href\", \"url\", \"description\", \"detail\", \"key\", \"order\"]);\nexport const NONPOSITION_SCALE_CHANNELS = keys(NONPOSITION_SCALE_CHANNEL_INDEX);\nexport function isNonPositionScaleChannel(channel) {\n return !!NONPOSITION_CHANNEL_INDEX[channel];\n}\n/**\n * @returns whether Vega supports legends for a particular channel\n */\nexport function supportLegend(channel) {\n switch (channel) {\n case COLOR:\n case FILL:\n case STROKE:\n case SIZE:\n case SHAPE:\n case OPACITY:\n case STROKEWIDTH:\n case STROKEDASH:\n return true;\n case FILLOPACITY:\n case STROKEOPACITY:\n case ANGLE:\n return false;\n }\n}\n// Declare SCALE_CHANNEL_INDEX\nconst SCALE_CHANNEL_INDEX = Object.assign(Object.assign(Object.assign({}, POSITION_SCALE_CHANNEL_INDEX), POLAR_POSITION_SCALE_CHANNEL_INDEX), NONPOSITION_SCALE_CHANNEL_INDEX);\n/** List of channels with scales */\nexport const SCALE_CHANNELS = keys(SCALE_CHANNEL_INDEX);\nexport function isScaleChannel(channel) {\n return !!SCALE_CHANNEL_INDEX[channel];\n}\n/**\n * Return whether a channel supports a particular mark type.\n * @param channel channel name\n * @param mark the mark type\n * @return whether the mark supports the channel\n */\nexport function supportMark(channel, mark) {\n return getSupportedMark(channel)[mark];\n}\nconst ALL_MARKS = {\n // all marks\n arc: 'always',\n area: 'always',\n bar: 'always',\n circle: 'always',\n geoshape: 'always',\n image: 'always',\n line: 'always',\n rule: 'always',\n point: 'always',\n rect: 'always',\n square: 'always',\n trail: 'always',\n text: 'always',\n tick: 'always'\n};\nconst { geoshape: _g } = ALL_MARKS, ALL_MARKS_EXCEPT_GEOSHAPE = __rest(ALL_MARKS, [\"geoshape\"]);\n/**\n * Return a dictionary showing whether a channel supports mark type.\n * @param channel\n * @return A dictionary mapping mark types to 'always', 'binned', or undefined\n */\nfunction getSupportedMark(channel) {\n switch (channel) {\n case COLOR:\n case FILL:\n case STROKE:\n // falls through\n case DESCRIPTION:\n case DETAIL:\n case KEY:\n case TOOLTIP:\n case HREF:\n case ORDER: // TODO: revise (order might not support rect, which is not stackable?)\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n case STROKEWIDTH:\n // falls through\n case FACET:\n case ROW: // falls through\n case COLUMN:\n return ALL_MARKS;\n case X:\n case Y:\n case LATITUDE:\n case LONGITUDE:\n // all marks except geoshape. geoshape does not use X, Y -- it uses a projection\n return ALL_MARKS_EXCEPT_GEOSHAPE;\n case X2:\n case Y2:\n case LATITUDE2:\n case LONGITUDE2:\n return {\n area: 'always',\n bar: 'always',\n image: 'always',\n rect: 'always',\n rule: 'always',\n circle: 'binned',\n point: 'binned',\n square: 'binned',\n tick: 'binned',\n line: 'binned',\n trail: 'binned'\n };\n case SIZE:\n return {\n point: 'always',\n tick: 'always',\n rule: 'always',\n circle: 'always',\n square: 'always',\n bar: 'always',\n text: 'always',\n line: 'always',\n trail: 'always'\n };\n case STROKEDASH:\n return {\n line: 'always',\n point: 'always',\n tick: 'always',\n rule: 'always',\n circle: 'always',\n square: 'always',\n bar: 'always',\n geoshape: 'always'\n };\n case SHAPE:\n return { point: 'always', geoshape: 'always' };\n case TEXT:\n return { text: 'always' };\n case ANGLE:\n return { point: 'always', square: 'always', text: 'always' };\n case URL:\n return { image: 'always' };\n case THETA:\n return { text: 'always', arc: 'always' };\n case RADIUS:\n return { text: 'always', arc: 'always' };\n case THETA2:\n case RADIUS2:\n return { arc: 'always' };\n }\n}\nexport function rangeType(channel) {\n switch (channel) {\n case X:\n case Y:\n case THETA:\n case RADIUS:\n case SIZE:\n case ANGLE:\n case STROKEWIDTH:\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n // X2 and Y2 use X and Y scales, so they similarly have continuous range. [falls through]\n case X2:\n case Y2:\n case THETA2:\n case RADIUS2:\n return undefined;\n case FACET:\n case ROW:\n case COLUMN:\n case SHAPE:\n case STROKEDASH:\n // TEXT, TOOLTIP, URL, and HREF have no scale but have discrete output [falls through]\n case TEXT:\n case TOOLTIP:\n case HREF:\n case URL:\n case DESCRIPTION:\n return 'discrete';\n // Color can be either continuous or discrete, depending on scale type.\n case COLOR:\n case FILL:\n case STROKE:\n return 'flexible';\n // No scale, no range type.\n case LATITUDE:\n case LONGITUDE:\n case LATITUDE2:\n case LONGITUDE2:\n case DETAIL:\n case KEY:\n case ORDER:\n return undefined;\n }\n}\n//# sourceMappingURL=channel.js.map","import { isBoolean, isObject } from 'vega-util';\nimport { COLOR, COLUMN, FILL, FILLOPACITY, OPACITY, ROW, SHAPE, SIZE, STROKE, STROKEDASH, STROKEOPACITY, STROKEWIDTH } from './channel';\nimport { normalizeBin } from './channeldef';\nimport { entries, keys, varName } from './util';\n/**\n * Create a key for the bin configuration. Not for prebinned bin.\n */\nexport function binToString(bin) {\n if (isBoolean(bin)) {\n bin = normalizeBin(bin, undefined);\n }\n return ('bin' +\n keys(bin)\n .map(p => (isSelectionExtent(bin[p]) ? varName(`_${p}_${entries(bin[p])}`) : varName(`_${p}_${bin[p]}`)))\n .join(''));\n}\n/**\n * Vega-Lite should bin the data.\n */\nexport function isBinning(bin) {\n return bin === true || (isBinParams(bin) && !bin.binned);\n}\n/**\n * The data is already binned and so Vega-Lite should not bin it again.\n */\nexport function isBinned(bin) {\n return bin === 'binned' || (isBinParams(bin) && bin.binned === true);\n}\nexport function isBinParams(bin) {\n return isObject(bin);\n}\nexport function isSelectionExtent(extent) {\n return extent === null || extent === void 0 ? void 0 : extent['selection'];\n}\nexport function autoMaxBins(channel) {\n switch (channel) {\n case ROW:\n case COLUMN:\n case SIZE:\n case COLOR:\n case FILL:\n case STROKE:\n case STROKEWIDTH:\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n // Facets and Size shouldn't have too many bins\n // We choose 6 like shape to simplify the rule [falls through]\n case SHAPE:\n return 6; // Vega's \"shape\" has 6 distinct values\n case STROKEDASH:\n return 4; // We only provide 5 different stroke dash values (but 4 is more effective)\n default:\n return 10;\n }\n}\n//# sourceMappingURL=bin.js.map","import { getSizeChannel } from '../channel';\nimport { stringify } from '../util';\nexport function invalidSpec(spec) {\n return `Invalid specification ${JSON.stringify(spec)}. Make sure the specification includes at least one of the following properties: \"mark\", \"layer\", \"facet\", \"hconcat\", \"vconcat\", \"concat\", or \"repeat\".`;\n}\n// FIT\nexport const FIT_NON_SINGLE = 'Autosize \"fit\" only works for single views and layered views.';\nexport function containerSizeNonSingle(name) {\n const uName = name == 'width' ? 'Width' : 'Height';\n return `${uName} \"container\" only works for single views and layered views.`;\n}\nexport function containerSizeNotCompatibleWithAutosize(name) {\n const uName = name == 'width' ? 'Width' : 'Height';\n const fitDirection = name == 'width' ? 'x' : 'y';\n return `${uName} \"container\" only works well with autosize \"fit\" or \"fit-${fitDirection}\".`;\n}\nexport function droppingFit(channel) {\n return channel\n ? `Dropping \"fit-${channel}\" because spec has discrete ${getSizeChannel(channel)}.`\n : `Dropping \"fit\" because spec has discrete size.`;\n}\n// VIEW SIZE\nexport function unknownField(channel) {\n return `Unknown field for ${channel}. Cannot calculate view size.`;\n}\n// SELECTION\nexport function cannotProjectOnChannelWithoutField(channel) {\n return `Cannot project a selection on encoding channel \"${channel}\", which has no field.`;\n}\nexport function cannotProjectAggregate(channel, aggregate) {\n return `Cannot project a selection on encoding channel \"${channel}\" as it uses an aggregate function (\"${aggregate}\").`;\n}\nexport function nearestNotSupportForContinuous(mark) {\n return `The \"nearest\" transform is not supported for ${mark} marks.`;\n}\nexport function selectionNotSupported(mark) {\n return `Selection not supported for ${mark} yet.`;\n}\nexport function selectionNotFound(name) {\n return `Cannot find a selection named \"${name}\".`;\n}\nexport const SCALE_BINDINGS_CONTINUOUS = 'Scale bindings are currently only supported for scales with unbinned, continuous domains.';\nexport const LEGEND_BINDINGS_MUST_HAVE_PROJECTION = 'Legend bindings are only supported for selections over an individual field or encoding channel.';\nexport function noSameUnitLookup(name) {\n return (`Cannot define and lookup the \"${name}\" selection in the same view. ` +\n `Try moving the lookup into a second, layered view?`);\n}\nexport const NEEDS_SAME_SELECTION = 'The same selection must be used to override scale domains in a layered view.';\nexport const INTERVAL_INITIALIZED_WITH_X_Y = 'Interval selections should be initialized using \"x\" and/or \"y\" keys.';\n// REPEAT\nexport function noSuchRepeatedValue(field) {\n return `Unknown repeated value \"${field}\".`;\n}\nexport function columnsNotSupportByRowCol(type) {\n return `The \"columns\" property cannot be used when \"${type}\" has nested row/column.`;\n}\n// CONCAT / REPEAT\nexport const CONCAT_CANNOT_SHARE_AXIS = 'Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).';\n// DATA\nexport function unrecognizedParse(p) {\n return `Unrecognized parse \"${p}\".`;\n}\nexport function differentParse(field, local, ancestor) {\n return `An ancestor parsed field \"${field}\" as ${ancestor} but a child wants to parse the field as ${local}.`;\n}\nexport const ADD_SAME_CHILD_TWICE = 'Attempt to add the same child twice.';\n// TRANSFORMS\nexport function invalidTransformIgnored(transform) {\n return `Ignoring an invalid transform: ${stringify(transform)}.`;\n}\nexport const NO_FIELDS_NEEDS_AS = 'If \"from.fields\" is not specified, \"as\" has to be a string that specifies the key to be used for the data from the secondary source.';\n// ENCODING & FACET\nexport function customFormatTypeNotAllowed(channel) {\n return `Config.customFormatTypes is not true, thus custom format type and format for channel ${channel} are dropped.`;\n}\nexport function projectionOverridden(opt) {\n const { parentProjection, projection } = opt;\n return `Layer's shared projection ${stringify(parentProjection)} is overridden by a child projection ${stringify(projection)}.`;\n}\nexport const REPLACE_ANGLE_WITH_THETA = 'Arc marks uses theta channel rather than angle, replacing angle with theta.';\nexport function primitiveChannelDef(channel, type, value) {\n return `Channel ${channel} is a ${type}. Converted to {value: ${stringify(value)}}.`;\n}\nexport function invalidFieldType(type) {\n return `Invalid field type \"${type}\".`;\n}\nexport function invalidFieldTypeForCountAggregate(type, aggregate) {\n return `Invalid field type \"${type}\" for aggregate: \"${aggregate}\", using \"quantitative\" instead.`;\n}\nexport function invalidAggregate(aggregate) {\n return `Invalid aggregation operator \"${aggregate}\".`;\n}\nexport function missingFieldType(channel, newType) {\n return `Missing type for channel \"${channel}\", using \"${newType}\" instead.`;\n}\nexport function droppingColor(type, opt) {\n const { fill, stroke } = opt;\n return `Dropping color ${type} as the plot also has ${fill && stroke ? 'fill and stroke' : fill ? 'fill' : 'stroke'}.`;\n}\nexport function emptyFieldDef(fieldDef, channel) {\n return `Dropping ${stringify(fieldDef)} from channel \"${channel}\" since it does not contain any data field, datum, value, or signal.`;\n}\nexport function latLongDeprecated(channel, type, newChannel) {\n return `${channel}-encoding with type ${type} is deprecated. Replacing with ${newChannel}-encoding.`;\n}\nexport const LINE_WITH_VARYING_SIZE = 'Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.';\nexport function incompatibleChannel(channel, markOrFacet, when) {\n return `${channel} dropped as it is incompatible with \"${markOrFacet}\"${when ? ` when ${when}` : ''}.`;\n}\nexport function invalidEncodingChannel(channel) {\n return `${channel}-encoding is dropped as ${channel} is not a valid encoding channel.`;\n}\nexport function facetChannelShouldBeDiscrete(channel) {\n return `${channel} encoding should be discrete (ordinal / nominal / binned).`;\n}\nexport function facetChannelDropped(channels) {\n return `Facet encoding dropped as ${channels.join(' and ')} ${channels.length > 1 ? 'are' : 'is'} also specified.`;\n}\nexport function discreteChannelCannotEncode(channel, type) {\n return `Using discrete channel \"${channel}\" to encode \"${type}\" field can be misleading as it does not encode ${type === 'ordinal' ? 'order' : 'magnitude'}.`;\n}\n// MARK\nexport function rangeMarkAlignmentCannotBeExpression(align) {\n return `The ${align} for range marks cannot be an expression`;\n}\nexport function lineWithRange(hasX2, hasY2) {\n const channels = hasX2 && hasY2 ? 'x2 and y2' : hasX2 ? 'x2' : 'y2';\n return `Line mark is for continuous lines and thus cannot be used with ${channels}. We will use the rule mark (line segments) instead.`;\n}\nexport function orientOverridden(original, actual) {\n return `Specified orient \"${original}\" overridden with \"${actual}\".`;\n}\n// SCALE\nexport const CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN = 'Custom domain scale cannot be unioned with default field-based domain.';\nexport const RANGE_STEP_DEPRECATED = `Scale's \"rangeStep\" is deprecated and will be removed in Vega-Lite 5.0. Please use \"width\"/\"height\": {\"step\": ...} instead. See https://vega.github.io/vega-lite/docs/size.html.`;\nexport function cannotUseScalePropertyWithNonColor(prop) {\n return `Cannot use the scale property \"${prop}\" with non-color channel.`;\n}\nexport function unaggregateDomainHasNoEffectForRawField(fieldDef) {\n return `Using unaggregated domain with raw field has no effect (${stringify(fieldDef)}).`;\n}\nexport function unaggregateDomainWithNonSharedDomainOp(aggregate) {\n return `Unaggregated domain not applicable for \"${aggregate}\" since it produces values outside the origin domain of the source data.`;\n}\nexport function unaggregatedDomainWithLogScale(fieldDef) {\n return `Unaggregated domain is currently unsupported for log scale (${stringify(fieldDef)}).`;\n}\nexport function cannotApplySizeToNonOrientedMark(mark) {\n return `Cannot apply size to non-oriented mark \"${mark}\".`;\n}\nexport function scaleTypeNotWorkWithChannel(channel, scaleType, defaultScaleType) {\n return `Channel \"${channel}\" does not work with \"${scaleType}\" scale. We are using \"${defaultScaleType}\" scale instead.`;\n}\nexport function scaleTypeNotWorkWithFieldDef(scaleType, defaultScaleType) {\n return `FieldDef does not work with \"${scaleType}\" scale. We are using \"${defaultScaleType}\" scale instead.`;\n}\nexport function scalePropertyNotWorkWithScaleType(scaleType, propName, channel) {\n return `${channel}-scale's \"${propName}\" is dropped as it does not work with ${scaleType} scale.`;\n}\nexport function scaleTypeNotWorkWithMark(mark, scaleType) {\n return `Scale type \"${scaleType}\" does not work with mark \"${mark}\".`;\n}\nexport function stepDropped(channel) {\n return `The step for \"${channel}\" is dropped because the ${channel === 'width' ? 'x' : 'y'} is continuous.`;\n}\nexport function mergeConflictingProperty(property, propertyOf, v1, v2) {\n return `Conflicting ${propertyOf.toString()} property \"${property.toString()}\" (${stringify(v1)} and ${stringify(v2)}). Using ${stringify(v1)}.`;\n}\nexport function mergeConflictingDomainProperty(property, propertyOf, v1, v2) {\n return `Conflicting ${propertyOf.toString()} property \"${property.toString()}\" (${stringify(v1)} and ${stringify(v2)}). Using the union of the two domains.`;\n}\nexport function independentScaleMeansIndependentGuide(channel) {\n return `Setting the scale to be independent for \"${channel}\" means we also have to set the guide (axis or legend) to be independent.`;\n}\nexport function domainSortDropped(sort) {\n return `Dropping sort property ${stringify(sort)} as unioned domains only support boolean or op \"count\", \"min\", and \"max\".`;\n}\nexport const MORE_THAN_ONE_SORT = 'Domains that should be unioned has conflicting sort properties. Sort will be set to true.';\nexport const FACETED_INDEPENDENT_DIFFERENT_SOURCES = 'Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.';\nexport const FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES = 'Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.';\nexport const FACETED_INDEPENDENT_SAME_SOURCE = 'Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.';\n// AXIS\nexport const INVALID_CHANNEL_FOR_AXIS = 'Invalid channel for axis.';\n// STACK\nexport function cannotStackRangedMark(channel) {\n return `Cannot stack \"${channel}\" if there is already \"${channel}2\".`;\n}\nexport function cannotStackNonLinearScale(scaleType) {\n return `Cannot stack non-linear scale (${scaleType}).`;\n}\nexport function stackNonSummativeAggregate(aggregate) {\n return `Stacking is applied even though the aggregate function is non-summative (\"${aggregate}\").`;\n}\n// TIMEUNIT\nexport function invalidTimeUnit(unitName, value) {\n return `Invalid ${unitName}: ${stringify(value)}.`;\n}\nexport function droppedDay(d) {\n return `Dropping day from datetime ${stringify(d)} as day cannot be combined with other units.`;\n}\nexport function errorBarCenterAndExtentAreNotNeeded(center, extent) {\n return `${extent ? 'extent ' : ''}${extent && center ? 'and ' : ''}${center ? 'center ' : ''}${extent && center ? 'are ' : 'is '}not needed when data are aggregated.`;\n}\nexport function errorBarCenterIsUsedWithWrongExtent(center, extent, mark) {\n return `${center} is not usually used with ${extent} for ${mark}.`;\n}\nexport function errorBarContinuousAxisHasCustomizedAggregate(aggregate, compositeMark) {\n return `Continuous axis should not have customized aggregation function ${aggregate}; ${compositeMark} already agregates the axis.`;\n}\nexport function errorBand1DNotSupport(property) {\n return `1D error band does not support ${property}.`;\n}\n// CHANNEL\nexport function channelRequiredForBinned(channel) {\n return `Channel ${channel} is required for \"binned\" bin.`;\n}\nexport function channelShouldNotBeUsedForBinned(channel) {\n return `Channel ${channel} should not be used with \"binned\" bin.`;\n}\nexport function domainRequiredForThresholdScale(channel) {\n return `Domain for ${channel} is required for threshold scale.`;\n}\n//# sourceMappingURL=message.js.map","/**\n * Vega-Lite's singleton logger utility.\n */\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n privateMap.set(receiver, value);\n return value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n return privateMap.get(receiver);\n};\nvar _level;\nimport { Debug, Error as ErrorLevel, Info, logger, Warn } from 'vega-util';\nimport * as message_1 from './message';\nexport { message_1 as message };\n/**\n * Main (default) Vega Logger instance for Vega-Lite.\n */\nconst main = logger(Warn);\nlet current = main;\n/**\n * Logger tool for checking if the code throws correct warning.\n */\nexport class LocalLogger {\n constructor() {\n this.warns = [];\n this.infos = [];\n this.debugs = [];\n _level.set(this, Warn);\n }\n level(_) {\n if (_) {\n __classPrivateFieldSet(this, _level, _);\n return this;\n }\n return __classPrivateFieldGet(this, _level);\n }\n warn(...args) {\n if (__classPrivateFieldGet(this, _level) >= Warn)\n this.warns.push(...args);\n return this;\n }\n info(...args) {\n if (__classPrivateFieldGet(this, _level) >= Info)\n this.infos.push(...args);\n return this;\n }\n debug(...args) {\n if (__classPrivateFieldGet(this, _level) >= Debug)\n this.debugs.push(...args);\n return this;\n }\n error(...args) {\n if (__classPrivateFieldGet(this, _level) >= ErrorLevel)\n throw Error(...args);\n return this;\n }\n}\n_level = new WeakMap();\nexport function wrap(f) {\n return () => {\n current = new LocalLogger();\n f(current);\n reset();\n };\n}\n/**\n * Set the singleton logger to be a custom logger.\n */\nexport function set(newLogger) {\n current = newLogger;\n return current;\n}\n/**\n * Reset the main logger to use the default Vega Logger.\n */\nexport function reset() {\n current = main;\n return current;\n}\nexport function error(...args) {\n current.error(...args);\n}\nexport function warn(...args) {\n current.warn(...args);\n}\nexport function info(...args) {\n current.info(...args);\n}\nexport function debug(...args) {\n current.debug(...args);\n}\n//# sourceMappingURL=index.js.map","// DateTime definition object\nimport { isNumber, isObject } from 'vega-util';\nimport * as log from './log';\nimport { TIMEUNIT_PARTS } from './timeunit';\nimport { duplicate, isNumeric, keys } from './util';\nexport function isDateTime(o) {\n if (o && isObject(o)) {\n for (const part of TIMEUNIT_PARTS) {\n if (part in o) {\n return true;\n }\n }\n }\n return false;\n}\nexport const MONTHS = [\n 'january',\n 'february',\n 'march',\n 'april',\n 'may',\n 'june',\n 'july',\n 'august',\n 'september',\n 'october',\n 'november',\n 'december'\n];\nexport const SHORT_MONTHS = MONTHS.map(m => m.substr(0, 3));\nexport const DAYS = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];\nexport const SHORT_DAYS = DAYS.map(d => d.substr(0, 3));\nfunction normalizeQuarter(q) {\n if (isNumeric(q)) {\n q = +q;\n }\n if (isNumber(q)) {\n if (q > 4) {\n log.warn(log.message.invalidTimeUnit('quarter', q));\n }\n // We accept 1-based quarter, so need to readjust to 0-based quarter\n return q - 1;\n }\n else {\n // Invalid quarter\n throw new Error(log.message.invalidTimeUnit('quarter', q));\n }\n}\nfunction normalizeMonth(m) {\n if (isNumeric(m)) {\n m = +m;\n }\n if (isNumber(m)) {\n // We accept 1-based month, so need to readjust to 0-based month\n return m - 1;\n }\n else {\n const lowerM = m.toLowerCase();\n const monthIndex = MONTHS.indexOf(lowerM);\n if (monthIndex !== -1) {\n return monthIndex; // 0 for january, ...\n }\n const shortM = lowerM.substr(0, 3);\n const shortMonthIndex = SHORT_MONTHS.indexOf(shortM);\n if (shortMonthIndex !== -1) {\n return shortMonthIndex;\n }\n // Invalid month\n throw new Error(log.message.invalidTimeUnit('month', m));\n }\n}\nfunction normalizeDay(d) {\n if (isNumeric(d)) {\n d = +d;\n }\n if (isNumber(d)) {\n // mod so that this can be both 0-based where 0 = sunday\n // and 1-based where 7=sunday\n return d % 7;\n }\n else {\n const lowerD = d.toLowerCase();\n const dayIndex = DAYS.indexOf(lowerD);\n if (dayIndex !== -1) {\n return dayIndex; // 0 for january, ...\n }\n const shortD = lowerD.substr(0, 3);\n const shortDayIndex = SHORT_DAYS.indexOf(shortD);\n if (shortDayIndex !== -1) {\n return shortDayIndex;\n }\n // Invalid day\n throw new Error(log.message.invalidTimeUnit('day', d));\n }\n}\n/**\n * @param d the date.\n * @param normalize whether to normalize quarter, month, day. This should probably be true if d is a DateTime.\n * @returns array of date time parts [year, month, day, hours, minutes, seconds, milliseconds]\n */\nfunction dateTimeParts(d, normalize) {\n const parts = [];\n if (normalize && d.day !== undefined) {\n if (keys(d).length > 1) {\n log.warn(log.message.droppedDay(d));\n d = duplicate(d);\n delete d.day;\n }\n }\n if (d.year !== undefined) {\n parts.push(d.year);\n }\n else {\n // Just like Vega's timeunit transform, set default year to 2012, so domain conversion will be compatible with Vega\n // Note: 2012 is a leap year (and so the date February 29 is respected) that begins on a Sunday (and so days of the week will order properly at the beginning of the year).\n parts.push(2012);\n }\n if (d.month !== undefined) {\n const month = normalize ? normalizeMonth(d.month) : d.month;\n parts.push(month);\n }\n else if (d.quarter !== undefined) {\n const quarter = normalize ? normalizeQuarter(d.quarter) : d.quarter;\n parts.push(isNumber(quarter) ? quarter * 3 : quarter + '*3');\n }\n else {\n parts.push(0); // months start at zero in JS\n }\n if (d.date !== undefined) {\n parts.push(d.date);\n }\n else if (d.day !== undefined) {\n // HACK: Day only works as a standalone unit\n // This is only correct because we always set year to 2006 for day\n const day = normalize ? normalizeDay(d.day) : d.day;\n parts.push(isNumber(day) ? day + 1 : day + '+1');\n }\n else {\n parts.push(1); // Date starts at 1 in JS\n }\n // Note: can't use TimeUnit enum here as importing it will create\n // circular dependency problem!\n for (const timeUnit of ['hours', 'minutes', 'seconds', 'milliseconds']) {\n const unit = d[timeUnit];\n parts.push(typeof unit === 'undefined' ? 0 : unit);\n }\n return parts;\n}\n/**\n * Return Vega expression for a date time.\n *\n * @param d the date time.\n * @returns the Vega expression.\n */\nexport function dateTimeToExpr(d) {\n const parts = dateTimeParts(d, true);\n const string = parts.join(', ');\n if (d.utc) {\n return `utc(${string})`;\n }\n else {\n return `datetime(${string})`;\n }\n}\n/**\n * Return Vega expression for a date time expression.\n *\n * @param d the internal date time object with expression.\n * @returns the Vega expression.\n */\nexport function dateTimeExprToExpr(d) {\n const parts = dateTimeParts(d, false);\n const string = parts.join(', ');\n if (d.utc) {\n return `utc(${string})`;\n }\n else {\n return `datetime(${string})`;\n }\n}\n/**\n * @param d the date time.\n * @returns the timestamp.\n */\nexport function dateTimeToTimestamp(d) {\n const parts = dateTimeParts(d, true);\n if (d.utc) {\n return +new Date(Date.UTC(...parts));\n }\n else {\n return +new Date(...parts);\n }\n}\n//# sourceMappingURL=datetime.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport stringify from 'fast-json-stable-stringify';\nimport { isObject, isString } from 'vega-util';\nimport { dateTimeExprToExpr } from './datetime';\nimport { accessPathWithDatum, keys, varName } from './util';\n/** Time Unit that only corresponds to only one part of Date objects. */\nexport const LOCAL_SINGLE_TIMEUNIT_INDEX = {\n year: 1,\n quarter: 1,\n month: 1,\n week: 1,\n day: 1,\n dayofyear: 1,\n date: 1,\n hours: 1,\n minutes: 1,\n seconds: 1,\n milliseconds: 1\n};\nexport const TIMEUNIT_PARTS = keys(LOCAL_SINGLE_TIMEUNIT_INDEX);\nexport function isLocalSingleTimeUnit(timeUnit) {\n return !!LOCAL_SINGLE_TIMEUNIT_INDEX[timeUnit];\n}\nexport const UTC_SINGLE_TIMEUNIT_INDEX = {\n utcyear: 1,\n utcquarter: 1,\n utcmonth: 1,\n utcweek: 1,\n utcday: 1,\n utcdayofyear: 1,\n utcdate: 1,\n utchours: 1,\n utcminutes: 1,\n utcseconds: 1,\n utcmilliseconds: 1\n};\nexport const LOCAL_MULTI_TIMEUNIT_INDEX = {\n yearquarter: 1,\n yearquartermonth: 1,\n yearmonth: 1,\n yearmonthdate: 1,\n yearmonthdatehours: 1,\n yearmonthdatehoursminutes: 1,\n yearmonthdatehoursminutesseconds: 1,\n yearweek: 1,\n yearweekday: 1,\n yearweekdayhours: 1,\n yearweekdayhoursminutes: 1,\n yearweekdayhoursminutesseconds: 1,\n yeardayofyear: 1,\n quartermonth: 1,\n monthdate: 1,\n monthdatehours: 1,\n monthdatehoursminutes: 1,\n monthdatehoursminutesseconds: 1,\n weekday: 1,\n weeksdayhours: 1,\n weekdayhoursminutes: 1,\n weekdayhoursminutesseconds: 1,\n dayhours: 1,\n dayhoursminutes: 1,\n dayhoursminutesseconds: 1,\n hoursminutes: 1,\n hoursminutesseconds: 1,\n minutesseconds: 1,\n secondsmilliseconds: 1\n};\nexport const UTC_MULTI_TIMEUNIT_INDEX = {\n utcyearquarter: 1,\n utcyearquartermonth: 1,\n utcyearmonth: 1,\n utcyearmonthdate: 1,\n utcyearmonthdatehours: 1,\n utcyearmonthdatehoursminutes: 1,\n utcyearmonthdatehoursminutesseconds: 1,\n utcyearweek: 1,\n utcyearweekday: 1,\n utcyearweekdayhours: 1,\n utcyearweekdayhoursminutes: 1,\n utcyearweekdayhoursminutesseconds: 1,\n utcyeardayofyear: 1,\n utcquartermonth: 1,\n utcmonthdate: 1,\n utcmonthdatehours: 1,\n utcmonthdatehoursminutes: 1,\n utcmonthdatehoursminutesseconds: 1,\n utcweekday: 1,\n utcweeksdayhours: 1,\n utcweekdayhoursminutes: 1,\n utcweekdayhoursminutesseconds: 1,\n utcdayhours: 1,\n utcdayhoursminutes: 1,\n utcdayhoursminutesseconds: 1,\n utchoursminutes: 1,\n utchoursminutesseconds: 1,\n utcminutesseconds: 1,\n utcsecondsmilliseconds: 1\n};\nexport function isUTCTimeUnit(t) {\n return t.startsWith('utc');\n}\nexport function getLocalTimeUnit(t) {\n return t.substr(3);\n}\n// In order of increasing specificity\nexport const VEGALITE_TIMEFORMAT = {\n 'year-month': '%b %Y ',\n 'year-month-date': '%b %d, %Y '\n};\nexport function getTimeUnitParts(timeUnit) {\n const parts = [];\n for (const part of TIMEUNIT_PARTS) {\n if (containsTimeUnit(timeUnit, part)) {\n parts.push(part);\n }\n }\n return parts;\n}\n/** Returns true if fullTimeUnit contains the timeUnit, false otherwise. */\nexport function containsTimeUnit(fullTimeUnit, timeUnit) {\n const index = fullTimeUnit.indexOf(timeUnit);\n if (index < 0) {\n return false;\n }\n // exclude milliseconds\n if (index > 0 && timeUnit === 'seconds' && fullTimeUnit.charAt(index - 1) === 'i') {\n return false;\n }\n // exclude dayofyear\n if (fullTimeUnit.length > index + 3 && timeUnit === 'day' && fullTimeUnit.charAt(index + 3) === 'o') {\n return false;\n }\n if (index > 0 && timeUnit === 'year' && fullTimeUnit.charAt(index - 1) === 'f') {\n return false;\n }\n return true;\n}\n/**\n * Returns Vega expression for a given timeUnit and fieldRef\n */\nexport function fieldExpr(fullTimeUnit, field, { end } = { end: false }) {\n const fieldRef = accessPathWithDatum(field);\n const utc = isUTCTimeUnit(fullTimeUnit) ? 'utc' : '';\n function func(timeUnit) {\n if (timeUnit === 'quarter') {\n // quarter starting at 0 (0,3,6,9).\n return `(${utc}quarter(${fieldRef})-1)`;\n }\n else {\n return `${utc}${timeUnit}(${fieldRef})`;\n }\n }\n let lastTimeUnit;\n const dateExpr = {};\n for (const part of TIMEUNIT_PARTS) {\n if (containsTimeUnit(fullTimeUnit, part)) {\n dateExpr[part] = func(part);\n lastTimeUnit = part;\n }\n }\n if (end) {\n dateExpr[lastTimeUnit] += '+1';\n }\n return dateTimeExprToExpr(dateExpr);\n}\nexport function timeUnitSpecifierExpression(timeUnit) {\n if (!timeUnit) {\n return undefined;\n }\n const timeUnitParts = getTimeUnitParts(timeUnit);\n return `timeUnitSpecifier(${stringify(timeUnitParts)}, ${stringify(VEGALITE_TIMEFORMAT)})`;\n}\n/**\n * Returns the signal expression used for axis labels for a time unit.\n */\nexport function formatExpression(timeUnit, field, isUTCScale) {\n if (!timeUnit) {\n return undefined;\n }\n const expr = timeUnitSpecifierExpression(timeUnit);\n // We only use utcFormat for utc scale\n // For utc time units, the data is already converted as a part of timeUnit transform.\n // Thus, utc time units should use timeFormat to avoid shifting the time twice.\n const utc = isUTCScale || isUTCTimeUnit(timeUnit);\n return `${utc ? 'utc' : 'time'}Format(${field}, ${expr})`;\n}\nexport function normalizeTimeUnit(timeUnit) {\n if (!timeUnit) {\n return undefined;\n }\n let params;\n if (isString(timeUnit)) {\n params = {\n unit: timeUnit\n };\n }\n else if (isObject(timeUnit)) {\n params = Object.assign(Object.assign({}, timeUnit), (timeUnit.unit ? { unit: timeUnit.unit } : {}));\n }\n if (isUTCTimeUnit(params.unit)) {\n params.utc = true;\n params.unit = getLocalTimeUnit(params.unit);\n }\n return params;\n}\nexport function timeUnitToString(tu) {\n const _a = normalizeTimeUnit(tu), { utc } = _a, rest = __rest(_a, [\"utc\"]);\n if (rest.unit) {\n return ((utc ? 'utc' : '') +\n keys(rest)\n .map(p => varName(`${p === 'unit' ? '' : `_${p}_`}${rest[p]}`))\n .join(''));\n }\n else {\n // when maxbins is specified instead of units\n return ((utc ? 'utc' : '') +\n 'timeunit' +\n keys(rest)\n .map(p => varName(`_${p}_${rest[p]}`))\n .join(''));\n }\n}\n//# sourceMappingURL=timeunit.js.map","import { isArray } from 'vega-util';\nimport { keys } from './util';\nexport function isSignalRef(o) {\n return o && !!o['signal'];\n}\nexport function isVgRangeStep(range) {\n return !!range['step'];\n}\nexport function isDataRefUnionedDomain(domain) {\n if (!isArray(domain)) {\n return 'fields' in domain && !('data' in domain);\n }\n return false;\n}\nexport function isFieldRefUnionDomain(domain) {\n if (!isArray(domain)) {\n return 'fields' in domain && 'data' in domain;\n }\n return false;\n}\nexport function isDataRefDomain(domain) {\n if (!isArray(domain)) {\n return 'field' in domain && 'data' in domain;\n }\n return false;\n}\nconst VG_MARK_CONFIG_INDEX = {\n aria: 1,\n description: 1,\n ariaRole: 1,\n ariaRoleDescription: 1,\n blend: 1,\n opacity: 1,\n fill: 1,\n fillOpacity: 1,\n stroke: 1,\n strokeCap: 1,\n strokeWidth: 1,\n strokeOpacity: 1,\n strokeDash: 1,\n strokeDashOffset: 1,\n strokeJoin: 1,\n strokeOffset: 1,\n strokeMiterLimit: 1,\n startAngle: 1,\n endAngle: 1,\n padAngle: 1,\n innerRadius: 1,\n outerRadius: 1,\n size: 1,\n shape: 1,\n interpolate: 1,\n tension: 1,\n orient: 1,\n align: 1,\n baseline: 1,\n text: 1,\n dir: 1,\n dx: 1,\n dy: 1,\n ellipsis: 1,\n limit: 1,\n radius: 1,\n theta: 1,\n angle: 1,\n font: 1,\n fontSize: 1,\n fontWeight: 1,\n fontStyle: 1,\n lineBreak: 1,\n lineHeight: 1,\n cursor: 1,\n href: 1,\n tooltip: 1,\n cornerRadius: 1,\n cornerRadiusTopLeft: 1,\n cornerRadiusTopRight: 1,\n cornerRadiusBottomLeft: 1,\n cornerRadiusBottomRight: 1,\n aspect: 1,\n width: 1,\n height: 1,\n url: 1,\n smooth: 1\n // commented below are vg channel that do not have mark config.\n // x: 1,\n // y: 1,\n // x2: 1,\n // y2: 1,\n // xc'|'yc'\n // clip: 1,\n // path: 1,\n // url: 1,\n};\nexport const VG_MARK_CONFIGS = keys(VG_MARK_CONFIG_INDEX);\nexport const VG_MARK_INDEX = {\n arc: 1,\n area: 1,\n group: 1,\n image: 1,\n line: 1,\n path: 1,\n rect: 1,\n rule: 1,\n shape: 1,\n symbol: 1,\n text: 1,\n trail: 1\n};\n// Vega's cornerRadius channels.\nexport const VG_CORNERRADIUS_CHANNELS = [\n 'cornerRadius',\n 'cornerRadiusTopLeft',\n 'cornerRadiusTopRight',\n 'cornerRadiusBottomLeft',\n 'cornerRadiusBottomRight'\n];\n//# sourceMappingURL=vega.schema.js.map","import { isArray } from 'vega-util';\nimport { valueExpr, vgField } from './channeldef';\nimport { fieldExpr as timeUnitFieldExpr, normalizeTimeUnit } from './timeunit';\nimport { isSignalRef } from './vega.schema';\nexport function isSelectionPredicate(predicate) {\n return predicate === null || predicate === void 0 ? void 0 : predicate['selection'];\n}\nexport function isFieldEqualPredicate(predicate) {\n return predicate && !!predicate.field && predicate.equal !== undefined;\n}\nexport function isFieldLTPredicate(predicate) {\n return predicate && !!predicate.field && predicate.lt !== undefined;\n}\nexport function isFieldLTEPredicate(predicate) {\n return predicate && !!predicate.field && predicate.lte !== undefined;\n}\nexport function isFieldGTPredicate(predicate) {\n return predicate && !!predicate.field && predicate.gt !== undefined;\n}\nexport function isFieldGTEPredicate(predicate) {\n return predicate && !!predicate.field && predicate.gte !== undefined;\n}\nexport function isFieldRangePredicate(predicate) {\n if (predicate && predicate.field) {\n if (isArray(predicate.range) && predicate.range.length === 2) {\n return true;\n }\n else if (isSignalRef(predicate.range)) {\n return true;\n }\n }\n return false;\n}\nexport function isFieldOneOfPredicate(predicate) {\n return (predicate && !!predicate.field && (isArray(predicate.oneOf) || isArray(predicate.in)) // backward compatibility\n );\n}\nexport function isFieldValidPredicate(predicate) {\n return predicate && !!predicate.field && predicate.valid !== undefined;\n}\nexport function isFieldPredicate(predicate) {\n return (isFieldOneOfPredicate(predicate) ||\n isFieldEqualPredicate(predicate) ||\n isFieldRangePredicate(predicate) ||\n isFieldLTPredicate(predicate) ||\n isFieldGTPredicate(predicate) ||\n isFieldLTEPredicate(predicate) ||\n isFieldGTEPredicate(predicate));\n}\nfunction predicateValueExpr(v, timeUnit) {\n return valueExpr(v, { timeUnit, wrapTime: true });\n}\nfunction predicateValuesExpr(vals, timeUnit) {\n return vals.map(v => predicateValueExpr(v, timeUnit));\n}\n// This method is used by Voyager. Do not change its behavior without changing Voyager.\nexport function fieldFilterExpression(predicate, useInRange = true) {\n var _a;\n const { field } = predicate;\n const timeUnit = (_a = normalizeTimeUnit(predicate.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit;\n const fieldExpr = timeUnit\n ? // For timeUnit, cast into integer with time() so we can use ===, inrange, indexOf to compare values directly.\n // TODO: We calculate timeUnit on the fly here. Consider if we would like to consolidate this with timeUnit pipeline\n // TODO: support utc\n 'time(' + timeUnitFieldExpr(timeUnit, field) + ')'\n : vgField(predicate, { expr: 'datum' });\n if (isFieldEqualPredicate(predicate)) {\n return fieldExpr + '===' + predicateValueExpr(predicate.equal, timeUnit);\n }\n else if (isFieldLTPredicate(predicate)) {\n const upper = predicate.lt;\n return `${fieldExpr}<${predicateValueExpr(upper, timeUnit)}`;\n }\n else if (isFieldGTPredicate(predicate)) {\n const lower = predicate.gt;\n return `${fieldExpr}>${predicateValueExpr(lower, timeUnit)}`;\n }\n else if (isFieldLTEPredicate(predicate)) {\n const upper = predicate.lte;\n return `${fieldExpr}<=${predicateValueExpr(upper, timeUnit)}`;\n }\n else if (isFieldGTEPredicate(predicate)) {\n const lower = predicate.gte;\n return `${fieldExpr}>=${predicateValueExpr(lower, timeUnit)}`;\n }\n else if (isFieldOneOfPredicate(predicate)) {\n return `indexof([${predicateValuesExpr(predicate.oneOf, timeUnit).join(',')}], ${fieldExpr}) !== -1`;\n }\n else if (isFieldValidPredicate(predicate)) {\n return fieldValidPredicate(fieldExpr, predicate.valid);\n }\n else if (isFieldRangePredicate(predicate)) {\n const { range } = predicate;\n const lower = isSignalRef(range) ? { signal: `${range.signal}[0]` } : range[0];\n const upper = isSignalRef(range) ? { signal: `${range.signal}[1]` } : range[1];\n if (lower !== null && upper !== null && useInRange) {\n return ('inrange(' +\n fieldExpr +\n ', [' +\n predicateValueExpr(lower, timeUnit) +\n ', ' +\n predicateValueExpr(upper, timeUnit) +\n '])');\n }\n const exprs = [];\n if (lower !== null) {\n exprs.push(`${fieldExpr} >= ${predicateValueExpr(lower, timeUnit)}`);\n }\n if (upper !== null) {\n exprs.push(`${fieldExpr} <= ${predicateValueExpr(upper, timeUnit)}`);\n }\n return exprs.length > 0 ? exprs.join(' && ') : 'true';\n }\n /* istanbul ignore next: it should never reach here */\n throw new Error(`Invalid field predicate: ${JSON.stringify(predicate)}`);\n}\nexport function fieldValidPredicate(fieldExpr, valid = true) {\n if (valid) {\n return `isValid(${fieldExpr}) && isFinite(+${fieldExpr})`;\n }\n else {\n return `!isValid(${fieldExpr}) || !isFinite(+${fieldExpr})`;\n }\n}\nexport function normalizePredicate(f) {\n var _a;\n if (isFieldPredicate(f) && f.timeUnit) {\n return Object.assign(Object.assign({}, f), { timeUnit: (_a = normalizeTimeUnit(f.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit });\n }\n return f;\n}\n//# sourceMappingURL=predicate.js.map","import { keys } from './util';\n/**\n * Data type based on level of measurement\n */\nexport const Type = {\n quantitative: 'quantitative',\n ordinal: 'ordinal',\n temporal: 'temporal',\n nominal: 'nominal',\n geojson: 'geojson'\n};\nexport function isType(t) {\n return t in Type;\n}\nexport const QUANTITATIVE = Type.quantitative;\nexport const ORDINAL = Type.ordinal;\nexport const TEMPORAL = Type.temporal;\nexport const NOMINAL = Type.nominal;\nexport const GEOJSON = Type.geojson;\nexport const TYPES = keys(Type);\n/**\n * Get full, lowercase type name for a given type.\n * @param type\n * @return Full type name.\n */\nexport function getFullName(type) {\n if (type) {\n type = type.toLowerCase();\n switch (type) {\n case 'q':\n case QUANTITATIVE:\n return 'quantitative';\n case 't':\n case TEMPORAL:\n return 'temporal';\n case 'o':\n case ORDINAL:\n return 'ordinal';\n case 'n':\n case NOMINAL:\n return 'nominal';\n case GEOJSON:\n return 'geojson';\n }\n }\n // If we get invalid input, return undefined type.\n return undefined;\n}\n//# sourceMappingURL=type.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isString, toSet } from 'vega-util';\nimport * as CHANNEL from './channel';\nimport { isColorChannel } from './channel';\nimport * as log from './log';\nimport { NOMINAL, ORDINAL, QUANTITATIVE, TEMPORAL } from './type';\nimport { contains, keys } from './util';\nexport const ScaleType = {\n // Continuous - Quantitative\n LINEAR: 'linear',\n LOG: 'log',\n POW: 'pow',\n SQRT: 'sqrt',\n SYMLOG: 'symlog',\n IDENTITY: 'identity',\n SEQUENTIAL: 'sequential',\n // Continuous - Time\n TIME: 'time',\n UTC: 'utc',\n // Discretizing scales\n QUANTILE: 'quantile',\n QUANTIZE: 'quantize',\n THRESHOLD: 'threshold',\n BIN_ORDINAL: 'bin-ordinal',\n // Discrete scales\n ORDINAL: 'ordinal',\n POINT: 'point',\n BAND: 'band'\n};\n/**\n * Index for scale categories -- only scale of the same categories can be merged together.\n * Current implementation is trying to be conservative and avoid merging scale type that might not work together\n */\nexport const SCALE_CATEGORY_INDEX = {\n linear: 'numeric',\n log: 'numeric',\n pow: 'numeric',\n sqrt: 'numeric',\n symlog: 'numeric',\n identity: 'numeric',\n sequential: 'numeric',\n time: 'time',\n utc: 'time',\n ordinal: 'ordinal',\n 'bin-ordinal': 'bin-ordinal',\n point: 'ordinal-position',\n band: 'ordinal-position',\n quantile: 'discretizing',\n quantize: 'discretizing',\n threshold: 'discretizing'\n};\nexport const SCALE_TYPES = keys(SCALE_CATEGORY_INDEX);\n/**\n * Whether the two given scale types can be merged together.\n */\nexport function scaleCompatible(scaleType1, scaleType2) {\n const scaleCategory1 = SCALE_CATEGORY_INDEX[scaleType1];\n const scaleCategory2 = SCALE_CATEGORY_INDEX[scaleType2];\n return (scaleCategory1 === scaleCategory2 ||\n (scaleCategory1 === 'ordinal-position' && scaleCategory2 === 'time') ||\n (scaleCategory2 === 'ordinal-position' && scaleCategory1 === 'time'));\n}\n/**\n * Index for scale precedence -- high score = higher priority for merging.\n */\nconst SCALE_PRECEDENCE_INDEX = {\n // numeric\n linear: 0,\n log: 1,\n pow: 1,\n sqrt: 1,\n symlog: 1,\n identity: 1,\n sequential: 1,\n // time\n time: 0,\n utc: 0,\n // ordinal-position -- these have higher precedence than continuous scales as they support more types of data\n point: 10,\n band: 11,\n // non grouped types\n ordinal: 0,\n 'bin-ordinal': 0,\n quantile: 0,\n quantize: 0,\n threshold: 0\n};\n/**\n * Return scale categories -- only scale of the same categories can be merged together.\n */\nexport function scaleTypePrecedence(scaleType) {\n return SCALE_PRECEDENCE_INDEX[scaleType];\n}\nexport const CONTINUOUS_TO_CONTINUOUS_SCALES = ['linear', 'log', 'pow', 'sqrt', 'symlog', 'time', 'utc'];\nconst CONTINUOUS_TO_CONTINUOUS_INDEX = toSet(CONTINUOUS_TO_CONTINUOUS_SCALES);\nexport const QUANTITATIVE_SCALES = ['linear', 'log', 'pow', 'sqrt', 'symlog'];\nconst QUANTITATIVE_SCALES_INDEX = toSet(QUANTITATIVE_SCALES);\nexport function isQuantitative(type) {\n return type in QUANTITATIVE_SCALES_INDEX;\n}\nexport const CONTINUOUS_TO_DISCRETE_SCALES = ['quantile', 'quantize', 'threshold'];\nconst CONTINUOUS_TO_DISCRETE_INDEX = toSet(CONTINUOUS_TO_DISCRETE_SCALES);\nexport const CONTINUOUS_DOMAIN_SCALES = CONTINUOUS_TO_CONTINUOUS_SCALES.concat([\n 'quantile',\n 'quantize',\n 'threshold',\n 'sequential',\n 'identity'\n]);\nconst CONTINUOUS_DOMAIN_INDEX = toSet(CONTINUOUS_DOMAIN_SCALES);\nexport const DISCRETE_DOMAIN_SCALES = ['ordinal', 'bin-ordinal', 'point', 'band'];\nconst DISCRETE_DOMAIN_INDEX = toSet(DISCRETE_DOMAIN_SCALES);\nexport const TIME_SCALE_TYPES = ['time', 'utc'];\nexport function hasDiscreteDomain(type) {\n return type in DISCRETE_DOMAIN_INDEX;\n}\nexport function hasContinuousDomain(type) {\n return type in CONTINUOUS_DOMAIN_INDEX;\n}\nexport function isContinuousToContinuous(type) {\n return type in CONTINUOUS_TO_CONTINUOUS_INDEX;\n}\nexport function isContinuousToDiscrete(type) {\n return type in CONTINUOUS_TO_DISCRETE_INDEX;\n}\nexport const defaultScaleConfig = {\n pointPadding: 0.5,\n barBandPaddingInner: 0.1,\n rectBandPaddingInner: 0,\n minBandSize: 2,\n minFontSize: 8,\n maxFontSize: 40,\n minOpacity: 0.3,\n maxOpacity: 0.8,\n // FIXME: revise if these *can* become ratios of width/height step\n minSize: 9,\n minStrokeWidth: 1,\n maxStrokeWidth: 4,\n quantileCount: 4,\n quantizeCount: 4\n};\nexport function isExtendedScheme(scheme) {\n return !isString(scheme) && !!scheme['name'];\n}\nexport function isSelectionDomain(domain) {\n return domain === null || domain === void 0 ? void 0 : domain['selection'];\n}\nexport function isDomainUnionWith(domain) {\n return domain && domain['unionWith'];\n}\nconst SCALE_PROPERTY_INDEX = {\n type: 1,\n domain: 1,\n domainMax: 1,\n domainMin: 1,\n domainMid: 1,\n align: 1,\n range: 1,\n rangeMax: 1,\n rangeMin: 1,\n scheme: 1,\n bins: 1,\n // Other properties\n reverse: 1,\n round: 1,\n // quantitative / time\n clamp: 1,\n nice: 1,\n // quantitative\n base: 1,\n exponent: 1,\n constant: 1,\n interpolate: 1,\n zero: 1,\n // band/point\n padding: 1,\n paddingInner: 1,\n paddingOuter: 1\n};\nexport const SCALE_PROPERTIES = keys(SCALE_PROPERTY_INDEX);\nconst { type, domain, range, rangeMax, rangeMin, scheme } = SCALE_PROPERTY_INDEX, NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTY_INDEX = __rest(SCALE_PROPERTY_INDEX, [\"type\", \"domain\", \"range\", \"rangeMax\", \"rangeMin\", \"scheme\"]);\nexport const NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES = keys(NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTY_INDEX);\nexport function scaleTypeSupportProperty(scaleType, propName) {\n switch (propName) {\n case 'type':\n case 'domain':\n case 'reverse':\n case 'range':\n return true;\n case 'scheme':\n case 'interpolate':\n return !contains(['point', 'band', 'identity'], scaleType);\n case 'bins':\n return !contains(['point', 'band', 'identity', 'ordinal'], scaleType);\n case 'round':\n return isContinuousToContinuous(scaleType) || scaleType === 'band' || scaleType === 'point';\n case 'padding':\n case 'rangeMin':\n case 'rangeMax':\n return isContinuousToContinuous(scaleType) || contains(['point', 'band'], scaleType);\n case 'paddingOuter':\n case 'align':\n return contains(['point', 'band'], scaleType);\n case 'paddingInner':\n return scaleType === 'band';\n case 'domainMax':\n case 'domainMid':\n case 'domainMin':\n case 'clamp':\n return isContinuousToContinuous(scaleType);\n case 'nice':\n return isContinuousToContinuous(scaleType) || scaleType === 'quantize' || scaleType === 'threshold';\n case 'exponent':\n return scaleType === 'pow';\n case 'base':\n return scaleType === 'log';\n case 'constant':\n return scaleType === 'symlog';\n case 'zero':\n return (hasContinuousDomain(scaleType) &&\n !contains([\n 'log',\n 'time',\n 'utc',\n 'threshold',\n 'quantile' // quantile depends on distribution so zero does not matter\n ], scaleType));\n }\n}\n/**\n * Returns undefined if the input channel supports the input scale property name\n */\nexport function channelScalePropertyIncompatability(channel, propName) {\n switch (propName) {\n case 'interpolate':\n case 'scheme':\n case 'domainMid':\n if (!isColorChannel(channel)) {\n return log.message.cannotUseScalePropertyWithNonColor(channel);\n }\n return undefined;\n case 'align':\n case 'type':\n case 'bins':\n case 'domain':\n case 'domainMax':\n case 'domainMin':\n case 'range':\n case 'base':\n case 'exponent':\n case 'constant':\n case 'nice':\n case 'padding':\n case 'paddingInner':\n case 'paddingOuter':\n case 'rangeMax':\n case 'rangeMin':\n case 'reverse':\n case 'round':\n case 'clamp':\n case 'zero':\n return undefined; // GOOD!\n }\n}\nexport function scaleTypeSupportDataType(specifiedType, fieldDefType) {\n if (contains([ORDINAL, NOMINAL], fieldDefType)) {\n return specifiedType === undefined || hasDiscreteDomain(specifiedType);\n }\n else if (fieldDefType === TEMPORAL) {\n return contains([ScaleType.TIME, ScaleType.UTC, undefined], specifiedType);\n }\n else if (fieldDefType === QUANTITATIVE) {\n return contains([\n ScaleType.LOG,\n ScaleType.POW,\n ScaleType.SQRT,\n ScaleType.SYMLOG,\n ScaleType.QUANTILE,\n ScaleType.QUANTIZE,\n ScaleType.THRESHOLD,\n ScaleType.LINEAR,\n undefined\n ], specifiedType);\n }\n return true;\n}\nexport function channelSupportScaleType(channel, scaleType) {\n if (!CHANNEL.isScaleChannel(channel)) {\n return false;\n }\n switch (channel) {\n case CHANNEL.X:\n case CHANNEL.Y:\n case CHANNEL.THETA:\n case CHANNEL.RADIUS:\n return isContinuousToContinuous(scaleType) || contains(['band', 'point'], scaleType);\n case CHANNEL.SIZE: // TODO: size and opacity can support ordinal with more modification\n case CHANNEL.STROKEWIDTH:\n case CHANNEL.OPACITY:\n case CHANNEL.FILLOPACITY:\n case CHANNEL.STROKEOPACITY:\n case CHANNEL.ANGLE:\n // Although it generally doesn't make sense to use band with size and opacity,\n // it can also work since we use band: 0.5 to get midpoint.\n return (isContinuousToContinuous(scaleType) ||\n isContinuousToDiscrete(scaleType) ||\n contains(['band', 'point', 'ordinal'], scaleType));\n case CHANNEL.COLOR:\n case CHANNEL.FILL:\n case CHANNEL.STROKE:\n return scaleType !== 'band'; // band does not make sense with color\n case CHANNEL.STROKEDASH:\n return scaleType === 'ordinal' || isContinuousToDiscrete(scaleType);\n case CHANNEL.SHAPE:\n return scaleType === 'ordinal'; // shape = lookup only\n }\n}\n//# sourceMappingURL=scale.js.map","import { signalRefOrValue } from './compile/common';\nimport { keys } from './util';\nimport { isSignalRef } from './vega.schema';\nexport function isExprRef(o) {\n return o && !!o['expr'];\n}\nexport function isExprOrSignalRef(o) {\n return isExprRef(o) || isSignalRef(o);\n}\nexport function replaceExprRefInIndex(index) {\n const props = keys(index || {});\n const newIndex = {};\n for (const prop of props) {\n newIndex[prop] = signalRefOrValue(index[prop]);\n }\n return newIndex;\n}\n//# sourceMappingURL=expr.js.map","import { toSet } from 'vega-util';\nimport { contains, keys } from './util';\n/**\n * All types of primitive marks.\n */\nexport const Mark = {\n arc: 'arc',\n area: 'area',\n bar: 'bar',\n image: 'image',\n line: 'line',\n point: 'point',\n rect: 'rect',\n rule: 'rule',\n text: 'text',\n tick: 'tick',\n trail: 'trail',\n circle: 'circle',\n square: 'square',\n geoshape: 'geoshape'\n};\nexport const ARC = Mark.arc;\nexport const AREA = Mark.area;\nexport const BAR = Mark.bar;\nexport const IMAGE = Mark.image;\nexport const LINE = Mark.line;\nexport const POINT = Mark.point;\nexport const RECT = Mark.rect;\nexport const RULE = Mark.rule;\nexport const TEXT = Mark.text;\nexport const TICK = Mark.tick;\nexport const TRAIL = Mark.trail;\nexport const CIRCLE = Mark.circle;\nexport const SQUARE = Mark.square;\nexport const GEOSHAPE = Mark.geoshape;\nexport function isMark(m) {\n return m in Mark;\n}\nexport function isPathMark(m) {\n return contains(['line', 'area', 'trail'], m);\n}\nexport function isRectBasedMark(m) {\n return contains(['rect', 'bar', 'image', 'arc' /* arc is rect/interval in polar coordinate */], m);\n}\nexport const PRIMITIVE_MARKS = keys(Mark);\nexport function isMarkDef(mark) {\n return mark['type'];\n}\nconst PRIMITIVE_MARK_INDEX = toSet(PRIMITIVE_MARKS);\nexport function isPrimitiveMark(mark) {\n const markType = isMarkDef(mark) ? mark.type : mark;\n return markType in PRIMITIVE_MARK_INDEX;\n}\nexport const STROKE_CONFIG = [\n 'stroke',\n 'strokeWidth',\n 'strokeDash',\n 'strokeDashOffset',\n 'strokeOpacity',\n 'strokeJoin',\n 'strokeMiterLimit'\n];\nexport const FILL_CONFIG = ['fill', 'fillOpacity'];\nexport const FILL_STROKE_CONFIG = [...STROKE_CONFIG, ...FILL_CONFIG];\nconst VL_ONLY_MARK_CONFIG_INDEX = {\n color: 1,\n filled: 1,\n invalid: 1,\n order: 1,\n radius2: 1,\n theta2: 1,\n timeUnitBand: 1,\n timeUnitBandPosition: 1\n};\nexport const VL_ONLY_MARK_CONFIG_PROPERTIES = keys(VL_ONLY_MARK_CONFIG_INDEX);\nexport const VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX = {\n area: ['line', 'point'],\n bar: ['binSpacing', 'continuousBandSize', 'discreteBandSize'],\n rect: ['binSpacing', 'continuousBandSize', 'discreteBandSize'],\n line: ['point'],\n tick: ['bandSize', 'thickness']\n};\nexport const defaultMarkConfig = {\n color: '#4c78a8',\n invalid: 'filter',\n timeUnitBand: 1\n};\nconst MARK_CONFIG_INDEX = {\n mark: 1,\n arc: 1,\n area: 1,\n bar: 1,\n circle: 1,\n image: 1,\n line: 1,\n point: 1,\n rect: 1,\n rule: 1,\n square: 1,\n text: 1,\n tick: 1,\n trail: 1,\n geoshape: 1\n};\nexport const MARK_CONFIGS = keys(MARK_CONFIG_INDEX);\nexport const BAR_CORNER_RADIUS_INDEX = {\n horizontal: ['cornerRadiusTopRight', 'cornerRadiusBottomRight'],\n vertical: ['cornerRadiusTopLeft', 'cornerRadiusTopRight']\n};\nconst DEFAULT_RECT_BAND_SIZE = 5;\nexport const defaultBarConfig = {\n binSpacing: 1,\n continuousBandSize: DEFAULT_RECT_BAND_SIZE,\n timeUnitBandPosition: 0.5\n};\nexport const defaultRectConfig = {\n binSpacing: 0,\n continuousBandSize: DEFAULT_RECT_BAND_SIZE,\n timeUnitBandPosition: 0.5\n};\nexport const defaultTickConfig = {\n thickness: 1\n};\nexport function getMarkType(m) {\n return isMarkDef(m) ? m.type : m;\n}\n//# sourceMappingURL=mark.js.map","import { isFunction, isString } from 'vega-util';\nimport { isCountingAggregateOp } from '../../../aggregate';\nimport { isBinned, isBinning } from '../../../bin';\nimport { getMainRangeChannel, X, X2, Y2 } from '../../../channel';\nimport { binRequiresRange, getBand, isDatumDef, isFieldDef, isFieldOrDatumDef, isTypedFieldDef, isValueDef, vgField } from '../../../channeldef';\nimport { dateTimeToExpr, isDateTime } from '../../../datetime';\nimport { isExprRef } from '../../../expr';\nimport * as log from '../../../log';\nimport { isPathMark } from '../../../mark';\nimport { fieldValidPredicate } from '../../../predicate';\nimport { hasDiscreteDomain, isContinuousToContinuous } from '../../../scale';\nimport { TEMPORAL } from '../../../type';\nimport { contains } from '../../../util';\nimport { isSignalRef } from '../../../vega.schema';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nexport function midPointRefWithPositionInvalidTest(params) {\n const { channel, channelDef, markDef, scale, config } = params;\n const ref = midPoint(params);\n // Wrap to check if the positional value is invalid, if so, plot the point on the min value\n if (\n // Only this for field def without counting aggregate (as count wouldn't be null)\n isFieldDef(channelDef) &&\n !isCountingAggregateOp(channelDef.aggregate) &&\n // and only for continuous scale without zero (otherwise, null / invalid will be interpreted as zero, which doesn't cause layout problem)\n scale &&\n isContinuousToContinuous(scale.get('type')) &&\n scale.get('zero') === false) {\n return wrapPositionInvalidTest({\n fieldDef: channelDef,\n channel,\n markDef,\n ref,\n config\n });\n }\n return ref;\n}\nexport function wrapPositionInvalidTest({ fieldDef, channel, markDef, ref, config }) {\n if (isPathMark(markDef.type)) {\n // path mark already use defined to skip points, no need to do it here.\n return ref;\n }\n const invalid = getMarkPropOrConfig('invalid', markDef, config);\n if (invalid === null) {\n // if there is no invalid filter, don't do the invalid test\n return ref;\n }\n return [fieldInvalidTestValueRef(fieldDef, channel), ref];\n}\nexport function fieldInvalidTestValueRef(fieldDef, channel) {\n const test = fieldInvalidPredicate(fieldDef, true);\n const mainChannel = getMainRangeChannel(channel); // we can cast here as the output can't be other things.\n const zeroValueRef = mainChannel === 'y'\n ? { field: { group: 'height' } }\n : // x / angle / radius can all use 0\n { value: 0 };\n return Object.assign({ test }, zeroValueRef);\n}\nexport function fieldInvalidPredicate(field, invalid = true) {\n return fieldValidPredicate(isString(field) ? field : vgField(field, { expr: 'datum' }), !invalid);\n}\nexport function datumDefToExpr(datumDef) {\n const { datum } = datumDef;\n if (isDateTime(datum)) {\n return dateTimeToExpr(datum);\n }\n return `${JSON.stringify(datum)}`;\n}\nexport function valueRefForFieldOrDatumDef(fieldDef, scaleName, opt, encode) {\n const ref = {};\n if (scaleName) {\n ref.scale = scaleName;\n }\n if (isDatumDef(fieldDef)) {\n const { datum } = fieldDef;\n if (isDateTime(datum)) {\n ref.signal = dateTimeToExpr(datum);\n }\n else if (isSignalRef(datum)) {\n ref.signal = datum.signal;\n }\n else if (isExprRef(datum)) {\n ref.signal = datum.expr;\n }\n else {\n ref.value = datum;\n }\n }\n else {\n ref.field = vgField(fieldDef, opt);\n }\n if (encode) {\n const { offset, band } = encode;\n if (offset) {\n ref.offset = offset;\n }\n if (band) {\n ref.band = band;\n }\n }\n return ref;\n}\n/**\n * Signal that returns the middle of a bin from start and end field. Should only be used with x and y.\n */\nexport function interpolatedSignalRef({ scaleName, fieldOrDatumDef, fieldOrDatumDef2, offset, startSuffix, band = 0.5 }) {\n const expr = 0 < band && band < 1 ? 'datum' : undefined;\n const start = vgField(fieldOrDatumDef, { expr, suffix: startSuffix });\n const end = fieldOrDatumDef2 !== undefined\n ? vgField(fieldOrDatumDef2, { expr })\n : vgField(fieldOrDatumDef, { suffix: 'end', expr });\n const ref = {};\n if (band === 0 || band === 1) {\n ref.scale = scaleName;\n const val = band === 0 ? start : end;\n ref.field = val;\n }\n else {\n const datum = `${band} * ${start} + ${1 - band} * ${end}`;\n ref.signal = `scale(\"${scaleName}\", ${datum})`;\n }\n if (offset) {\n ref.offset = offset;\n }\n return ref;\n}\n/**\n * @returns {VgValueRef} Value Ref for xc / yc or mid point for other channels.\n */\nexport function midPoint({ channel, channelDef, channel2Def, markDef, config, scaleName, scale, stack, offset, defaultRef, band }) {\n var _a;\n // TODO: datum support\n if (channelDef) {\n /* istanbul ignore else */\n if (isFieldOrDatumDef(channelDef)) {\n if (isTypedFieldDef(channelDef)) {\n band = band !== null && band !== void 0 ? band : getBand({\n channel,\n fieldDef: channelDef,\n fieldDef2: channel2Def,\n markDef,\n stack,\n config,\n isMidPoint: true\n });\n const { bin, timeUnit, type } = channelDef;\n if (isBinning(bin) || (band && timeUnit && type === TEMPORAL)) {\n // Use middle only for x an y to place marks in the center between start and end of the bin range.\n // We do not use the mid point for other channels (e.g. size) so that properties of legends and marks match.\n if (stack && stack.impute) {\n // For stack, we computed bin_mid so we can impute.\n return valueRefForFieldOrDatumDef(channelDef, scaleName, { binSuffix: 'mid' }, { offset });\n }\n if (band) {\n // if band = 0, no need to call interpolation\n // For non-stack, we can just calculate bin mid on the fly using signal.\n return interpolatedSignalRef({ scaleName, fieldOrDatumDef: channelDef, band, offset });\n }\n return valueRefForFieldOrDatumDef(channelDef, scaleName, binRequiresRange(channelDef, channel) ? { binSuffix: 'range' } : {}, {\n offset\n });\n }\n else if (isBinned(bin)) {\n if (isFieldDef(channel2Def)) {\n return interpolatedSignalRef({\n scaleName,\n fieldOrDatumDef: channelDef,\n fieldOrDatumDef2: channel2Def,\n band,\n offset\n });\n }\n else {\n const channel2 = channel === X ? X2 : Y2;\n log.warn(log.message.channelRequiredForBinned(channel2));\n }\n }\n }\n const scaleType = scale === null || scale === void 0 ? void 0 : scale.get('type');\n return valueRefForFieldOrDatumDef(channelDef, scaleName, hasDiscreteDomain(scaleType) ? { binSuffix: 'range' } : {}, // no need for bin suffix if there is no scale\n {\n offset,\n // For band, to get mid point, need to offset by half of the band\n band: scaleType === 'band' ? (_a = band !== null && band !== void 0 ? band : channelDef.band) !== null && _a !== void 0 ? _a : 0.5 : undefined\n });\n }\n else if (isValueDef(channelDef)) {\n const value = channelDef.value;\n const offsetMixins = offset ? { offset } : {};\n return Object.assign(Object.assign({}, widthHeightValueOrSignalRef(channel, value)), offsetMixins);\n }\n // If channelDef is neither field def or value def, it's a condition-only def.\n // In such case, we will use default ref.\n }\n if (isFunction(defaultRef)) {\n defaultRef = defaultRef();\n }\n if (defaultRef) {\n // for non-position, ref could be undefined.\n return Object.assign(Object.assign({}, defaultRef), (offset ? { offset } : {}));\n }\n return defaultRef;\n}\n/**\n * Convert special \"width\" and \"height\" values in Vega-Lite into Vega value ref.\n */\nexport function widthHeightValueOrSignalRef(channel, value) {\n if (contains(['x', 'x2'], channel) && value === 'width') {\n return { field: { group: 'width' } };\n }\n else if (contains(['y', 'y2'], channel) && value === 'height') {\n return { field: { group: 'height' } };\n }\n return signalOrValueRef(value);\n}\n//# sourceMappingURL=valueref.js.map","import { isString } from 'vega-util';\nimport { isBinning } from '../bin';\nimport { channelDefType, isFieldDef, isFieldOrDatumDefForTimeFormat, isScaleFieldDef, vgField } from '../channeldef';\nimport { fieldValidPredicate } from '../predicate';\nimport { ScaleType } from '../scale';\nimport { formatExpression, normalizeTimeUnit, timeUnitSpecifierExpression } from '../timeunit';\nimport { QUANTITATIVE } from '../type';\nimport { isSignalRef } from '../vega.schema';\nimport { datumDefToExpr } from './mark/encode/valueref';\nexport function isCustomFormatType(formatType) {\n return formatType && formatType !== 'number' && formatType !== 'time';\n}\nfunction customFormatExpr(formatType, field, format) {\n return `${formatType}(${field}${format ? `, ${JSON.stringify(format)}` : ''})`;\n}\nexport const BIN_RANGE_DELIMITER = ' \\u2013 ';\nexport function formatSignalRef({ fieldOrDatumDef, format, formatType, expr, normalizeStack, config }) {\n var _a, _b;\n if (isCustomFormatType(formatType)) {\n return formatCustomType({\n fieldOrDatumDef,\n format,\n formatType,\n expr,\n config\n });\n }\n const field = fieldToFormat(fieldOrDatumDef, expr, normalizeStack);\n if (isFieldOrDatumDefForTimeFormat(fieldOrDatumDef)) {\n const signal = timeFormatExpression(field, isFieldDef(fieldOrDatumDef) ? (_a = normalizeTimeUnit(fieldOrDatumDef.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit : undefined, format, config.timeFormat, isScaleFieldDef(fieldOrDatumDef) && ((_b = fieldOrDatumDef.scale) === null || _b === void 0 ? void 0 : _b.type) === ScaleType.UTC);\n return signal ? { signal } : undefined;\n }\n format = numberFormat(channelDefType(fieldOrDatumDef), format, config);\n if (isFieldDef(fieldOrDatumDef) && isBinning(fieldOrDatumDef.bin)) {\n const endField = vgField(fieldOrDatumDef, { expr, binSuffix: 'end' });\n return {\n signal: binFormatExpression(field, endField, format, formatType, config)\n };\n }\n else if (format || channelDefType(fieldOrDatumDef) === 'quantitative') {\n return {\n signal: `${formatExpr(field, format)}`\n };\n }\n else {\n return { signal: `isValid(${field}) ? ${field} : \"\"+${field}` };\n }\n}\nfunction fieldToFormat(fieldOrDatumDef, expr, normalizeStack) {\n if (isFieldDef(fieldOrDatumDef)) {\n if (normalizeStack) {\n return `${vgField(fieldOrDatumDef, { expr, suffix: 'end' })}-${vgField(fieldOrDatumDef, {\n expr,\n suffix: 'start'\n })}`;\n }\n else {\n return vgField(fieldOrDatumDef, { expr });\n }\n }\n else {\n return datumDefToExpr(fieldOrDatumDef);\n }\n}\nexport function formatCustomType({ fieldOrDatumDef, format, formatType, expr, normalizeStack, config, field }) {\n field = field !== null && field !== void 0 ? field : fieldToFormat(fieldOrDatumDef, expr, normalizeStack);\n if (isFieldDef(fieldOrDatumDef) && isBinning(fieldOrDatumDef.bin)) {\n const endField = vgField(fieldOrDatumDef, { expr, binSuffix: 'end' });\n return {\n signal: binFormatExpression(field, endField, format, formatType, config)\n };\n }\n return { signal: customFormatExpr(formatType, field, format) };\n}\nexport function guideFormat(fieldOrDatumDef, type, format, formatType, config, omitTimeFormatConfig // axis doesn't use config.timeFormat\n) {\n var _a;\n if (isCustomFormatType(formatType)) {\n return undefined; // handled in encode block\n }\n if (isFieldOrDatumDefForTimeFormat(fieldOrDatumDef)) {\n const timeUnit = isFieldDef(fieldOrDatumDef) ? (_a = normalizeTimeUnit(fieldOrDatumDef.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit : undefined;\n return timeFormat(format, timeUnit, config, omitTimeFormatConfig);\n }\n return numberFormat(type, format, config);\n}\nexport function guideFormatType(formatType, fieldOrDatumDef, scaleType) {\n if (formatType && (isSignalRef(formatType) || formatType === 'number' || formatType === 'time')) {\n return formatType;\n }\n if (isFieldOrDatumDefForTimeFormat(fieldOrDatumDef) && scaleType !== 'time' && scaleType !== 'utc') {\n return 'time';\n }\n return undefined;\n}\n/**\n * Returns number format for a fieldDef.\n */\nexport function numberFormat(type, specifiedFormat, config) {\n // Specified format in axis/legend has higher precedence than fieldDef.format\n if (isString(specifiedFormat)) {\n return specifiedFormat;\n }\n if (type === QUANTITATIVE) {\n // we only apply the default if the field is quantitative\n return config.numberFormat;\n }\n return undefined;\n}\n/**\n * Returns time format for a fieldDef for use in guides.\n */\nexport function timeFormat(specifiedFormat, timeUnit, config, omitTimeFormatConfig) {\n if (specifiedFormat) {\n return specifiedFormat;\n }\n if (timeUnit) {\n return {\n signal: timeUnitSpecifierExpression(timeUnit)\n };\n }\n return omitTimeFormatConfig ? undefined : config.timeFormat;\n}\nfunction formatExpr(field, format) {\n return `format(${field}, \"${format || ''}\")`;\n}\nfunction binNumberFormatExpr(field, format, formatType, config) {\n var _a;\n if (isCustomFormatType(formatType)) {\n return customFormatExpr(formatType, field, format);\n }\n return formatExpr(field, (_a = (isString(format) ? format : undefined)) !== null && _a !== void 0 ? _a : config.numberFormat);\n}\nexport function binFormatExpression(startField, endField, format, formatType, config) {\n const start = binNumberFormatExpr(startField, format, formatType, config);\n const end = binNumberFormatExpr(endField, format, formatType, config);\n return `${fieldValidPredicate(startField, false)} ? \"null\" : ${start} + \"${BIN_RANGE_DELIMITER}\" + ${end}`;\n}\n/**\n * Returns the time expression used for axis/legend labels or text mark for a temporal field\n */\nexport function timeFormatExpression(field, timeUnit, format, rawTimeFormat, // should be provided only for actual text and headers, not axis/legend labels\nisUTCScale) {\n if (!timeUnit || format) {\n // If there is no time unit, or if user explicitly specifies format for axis/legend/text.\n format = isString(format) ? format : rawTimeFormat; // only use provided timeFormat if there is no timeUnit.\n return `${isUTCScale ? 'utc' : 'time'}Format(${field}, '${format}')`;\n }\n else {\n return formatExpression(timeUnit, field, isUTCScale);\n }\n}\n//# sourceMappingURL=format.js.map","import { isArray } from 'vega-util';\nexport const DEFAULT_SORT_OP = 'min';\nconst SORT_BY_CHANNEL_INDEX = {\n x: 1,\n y: 1,\n color: 1,\n fill: 1,\n stroke: 1,\n strokeWidth: 1,\n size: 1,\n shape: 1,\n fillOpacity: 1,\n strokeOpacity: 1,\n opacity: 1,\n text: 1\n};\nexport function isSortByChannel(c) {\n return c in SORT_BY_CHANNEL_INDEX;\n}\nexport function isSortByEncoding(sort) {\n return !!sort && !!sort['encoding'];\n}\nexport function isSortField(sort) {\n return !!sort && (sort['op'] === 'count' || !!sort['field']);\n}\nexport function isSortArray(sort) {\n return !!sort && isArray(sort);\n}\n//# sourceMappingURL=sort.js.map","export function isFacetMapping(f) {\n return 'row' in f || 'column' in f;\n}\nexport function isFacetFieldDef(channelDef) {\n return !!channelDef && 'header' in channelDef;\n}\nexport function isFacetSpec(spec) {\n return 'facet' in spec;\n}\n//# sourceMappingURL=facet.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray, isBoolean, isNumber, isString } from 'vega-util';\nimport { isAggregateOp, isArgmaxDef, isArgminDef, isCountingAggregateOp } from './aggregate';\nimport { autoMaxBins, binToString, isBinned, isBinning } from './bin';\nimport { ANGLE, COLOR, COLUMN, DESCRIPTION, DETAIL, FACET, FILL, FILLOPACITY, HREF, isScaleChannel, isSecondaryRangeChannel, isXorY, KEY, LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2, OPACITY, ORDER, RADIUS, RADIUS2, ROW, SHAPE, SIZE, STROKE, STROKEDASH, STROKEOPACITY, STROKEWIDTH, TEXT, THETA, THETA2, TOOLTIP, URL, X, X2, Y, Y2 } from './channel';\nimport { getMarkConfig } from './compile/common';\nimport { isCustomFormatType } from './compile/format';\nimport { dateTimeToExpr, isDateTime } from './datetime';\nimport { isExprRef } from './expr';\nimport * as log from './log';\nimport { isRectBasedMark } from './mark';\nimport { SCALE_CATEGORY_INDEX } from './scale';\nimport { isSortByChannel } from './sort';\nimport { isFacetFieldDef } from './spec/facet';\nimport { getTimeUnitParts, isLocalSingleTimeUnit, normalizeTimeUnit, timeUnitToString } from './timeunit';\nimport { getFullName, QUANTITATIVE } from './type';\nimport { contains, flatAccessWithDatum, getFirstDefined, internalField, omit, removePathFromField, replacePathInField, titleCase } from './util';\nimport { isSignalRef } from './vega.schema';\nexport function isConditionalSelection(c) {\n return c['selection'];\n}\nexport function isRepeatRef(field) {\n return field && !isString(field) && 'repeat' in field;\n}\nexport function toFieldDefBase(fieldDef) {\n const { field, timeUnit, bin, aggregate } = fieldDef;\n return Object.assign(Object.assign(Object.assign(Object.assign({}, (timeUnit ? { timeUnit } : {})), (bin ? { bin } : {})), (aggregate ? { aggregate } : {})), { field });\n}\nexport function isSortableFieldDef(fieldDef) {\n return 'sort' in fieldDef;\n}\nexport function getBand({ channel, fieldDef, fieldDef2, markDef: mark, stack, config, isMidPoint }) {\n if (isFieldOrDatumDef(fieldDef) && fieldDef.band !== undefined) {\n return fieldDef.band;\n }\n if (isFieldDef(fieldDef)) {\n const { timeUnit, bin } = fieldDef;\n if (timeUnit && !fieldDef2) {\n if (isMidPoint) {\n return getMarkConfig('timeUnitBandPosition', mark, config);\n }\n else {\n return isRectBasedMark(mark.type) ? getMarkConfig('timeUnitBand', mark, config) : 0;\n }\n }\n else if (isBinning(bin)) {\n return isRectBasedMark(mark.type) && !isMidPoint ? 1 : 0.5;\n }\n }\n if ((stack === null || stack === void 0 ? void 0 : stack.fieldChannel) === channel && isMidPoint) {\n return 0.5;\n }\n return undefined;\n}\nexport function hasBand(channel, fieldDef, fieldDef2, stack, markDef, config) {\n if (isBinning(fieldDef.bin) || (fieldDef.timeUnit && isTypedFieldDef(fieldDef) && fieldDef.type === 'temporal')) {\n return !!getBand({ channel, fieldDef, fieldDef2, stack, markDef, config });\n }\n return false;\n}\nexport function isConditionalDef(channelDef) {\n return !!channelDef && 'condition' in channelDef;\n}\n/**\n * Return if a channelDef is a ConditionalValueDef with ConditionFieldDef\n */\nexport function hasConditionalFieldDef(channelDef) {\n const condition = channelDef && channelDef['condition'];\n return !!condition && !isArray(condition) && isFieldDef(condition);\n}\nexport function hasConditionalFieldOrDatumDef(channelDef) {\n const condition = channelDef && channelDef['condition'];\n return !!condition && !isArray(condition) && isFieldOrDatumDef(condition);\n}\nexport function hasConditionalValueDef(channelDef) {\n const condition = channelDef && channelDef['condition'];\n return !!condition && (isArray(condition) || isValueDef(condition));\n}\nexport function isFieldDef(channelDef) {\n // TODO: we can't use field in channelDef here as it's somehow failing runtime test\n return !!channelDef && (!!channelDef['field'] || channelDef['aggregate'] === 'count');\n}\nexport function channelDefType(channelDef) {\n return channelDef && channelDef['type'];\n}\nexport function isDatumDef(channelDef) {\n return !!channelDef && 'datum' in channelDef;\n}\nexport function isContinuousFieldOrDatumDef(cd) {\n // TODO: make datum support DateTime object\n return (isTypedFieldDef(cd) && isContinuous(cd)) || isNumericDataDef(cd);\n}\nexport function isQuantitativeFieldOrDatumDef(cd) {\n // TODO: make datum support DateTime object\n return channelDefType(cd) === 'quantitative' || isNumericDataDef(cd);\n}\nexport function isNumericDataDef(cd) {\n return isDatumDef(cd) && isNumber(cd.datum);\n}\nexport function isFieldOrDatumDef(channelDef) {\n return isFieldDef(channelDef) || isDatumDef(channelDef);\n}\nexport function isTypedFieldDef(channelDef) {\n return !!channelDef && ('field' in channelDef || channelDef['aggregate'] === 'count') && 'type' in channelDef;\n}\nexport function isValueDef(channelDef) {\n return channelDef && 'value' in channelDef && 'value' in channelDef;\n}\nexport function isScaleFieldDef(channelDef) {\n return !!channelDef && ('scale' in channelDef || 'sort' in channelDef);\n}\nexport function isPositionFieldOrDatumDef(channelDef) {\n return channelDef && ('axis' in channelDef || 'stack' in channelDef || 'impute' in channelDef);\n}\nexport function isMarkPropFieldOrDatumDef(channelDef) {\n return !!channelDef && 'legend' in channelDef;\n}\nexport function isStringFieldOrDatumDef(channelDef) {\n return !!channelDef && ('format' in channelDef || 'formatType' in channelDef);\n}\nexport function toStringFieldDef(fieldDef) {\n // omit properties that don't exist in string field defs\n return omit(fieldDef, ['legend', 'axis', 'header', 'scale']);\n}\nfunction isOpFieldDef(fieldDef) {\n return 'op' in fieldDef;\n}\n/**\n * Get a Vega field reference from a Vega-Lite field def.\n */\nexport function vgField(fieldDef, opt = {}) {\n var _a, _b, _c;\n let field = fieldDef.field;\n const prefix = opt.prefix;\n let suffix = opt.suffix;\n let argAccessor = ''; // for accessing argmin/argmax field at the end without getting escaped\n if (isCount(fieldDef)) {\n field = internalField('count');\n }\n else {\n let fn;\n if (!opt.nofn) {\n if (isOpFieldDef(fieldDef)) {\n fn = fieldDef.op;\n }\n else {\n const { bin, aggregate, timeUnit } = fieldDef;\n if (isBinning(bin)) {\n fn = binToString(bin);\n suffix = ((_a = opt.binSuffix) !== null && _a !== void 0 ? _a : '') + ((_b = opt.suffix) !== null && _b !== void 0 ? _b : '');\n }\n else if (aggregate) {\n if (isArgmaxDef(aggregate)) {\n argAccessor = `[\"${field}\"]`;\n field = `argmax_${aggregate.argmax}`;\n }\n else if (isArgminDef(aggregate)) {\n argAccessor = `[\"${field}\"]`;\n field = `argmin_${aggregate.argmin}`;\n }\n else {\n fn = String(aggregate);\n }\n }\n else if (timeUnit) {\n fn = timeUnitToString(timeUnit);\n suffix = ((!contains(['range', 'mid'], opt.binSuffix) && opt.binSuffix) || '') + ((_c = opt.suffix) !== null && _c !== void 0 ? _c : '');\n }\n }\n }\n if (fn) {\n field = field ? `${fn}_${field}` : fn;\n }\n }\n if (suffix) {\n field = `${field}_${suffix}`;\n }\n if (prefix) {\n field = `${prefix}_${field}`;\n }\n if (opt.forAs) {\n return removePathFromField(field);\n }\n else if (opt.expr) {\n // Expression to access flattened field. No need to escape dots.\n return flatAccessWithDatum(field, opt.expr) + argAccessor;\n }\n else {\n // We flattened all fields so paths should have become dot.\n return replacePathInField(field) + argAccessor;\n }\n}\nexport function isDiscrete(def) {\n switch (def.type) {\n case 'nominal':\n case 'ordinal':\n case 'geojson':\n return true;\n case 'quantitative':\n return isFieldDef(def) && !!def.bin;\n case 'temporal':\n return false;\n }\n throw new Error(log.message.invalidFieldType(def.type));\n}\nexport function isContinuous(fieldDef) {\n return !isDiscrete(fieldDef);\n}\nexport function isCount(fieldDef) {\n return fieldDef.aggregate === 'count';\n}\nexport function verbalTitleFormatter(fieldDef, config) {\n var _a;\n const { field, bin, timeUnit, aggregate } = fieldDef;\n if (aggregate === 'count') {\n return config.countTitle;\n }\n else if (isBinning(bin)) {\n return `${field} (binned)`;\n }\n else if (timeUnit) {\n const unit = (_a = normalizeTimeUnit(timeUnit)) === null || _a === void 0 ? void 0 : _a.unit;\n if (unit) {\n return `${field} (${getTimeUnitParts(unit).join('-')})`;\n }\n }\n else if (aggregate) {\n if (isArgmaxDef(aggregate)) {\n return `${field} for max ${aggregate.argmax}`;\n }\n else if (isArgminDef(aggregate)) {\n return `${field} for min ${aggregate.argmin}`;\n }\n else {\n return `${titleCase(aggregate)} of ${field}`;\n }\n }\n return field;\n}\nexport function functionalTitleFormatter(fieldDef) {\n const { aggregate, bin, timeUnit, field } = fieldDef;\n if (isArgmaxDef(aggregate)) {\n return `${field} for argmax(${aggregate.argmax})`;\n }\n else if (isArgminDef(aggregate)) {\n return `${field} for argmin(${aggregate.argmin})`;\n }\n const timeUnitParams = normalizeTimeUnit(timeUnit);\n const fn = aggregate || (timeUnitParams === null || timeUnitParams === void 0 ? void 0 : timeUnitParams.unit) || ((timeUnitParams === null || timeUnitParams === void 0 ? void 0 : timeUnitParams.maxbins) && 'timeunit') || (isBinning(bin) && 'bin');\n if (fn) {\n return fn.toUpperCase() + '(' + field + ')';\n }\n else {\n return field;\n }\n}\nexport const defaultTitleFormatter = (fieldDef, config) => {\n switch (config.fieldTitle) {\n case 'plain':\n return fieldDef.field;\n case 'functional':\n return functionalTitleFormatter(fieldDef);\n default:\n return verbalTitleFormatter(fieldDef, config);\n }\n};\nlet titleFormatter = defaultTitleFormatter;\nexport function setTitleFormatter(formatter) {\n titleFormatter = formatter;\n}\nexport function resetTitleFormatter() {\n setTitleFormatter(defaultTitleFormatter);\n}\nexport function title(fieldOrDatumDef, config, { allowDisabling, includeDefault = true }) {\n var _a, _b;\n const guideTitle = (_a = getGuide(fieldOrDatumDef)) === null || _a === void 0 ? void 0 : _a.title;\n if (!isFieldDef(fieldOrDatumDef)) {\n return guideTitle;\n }\n const fieldDef = fieldOrDatumDef;\n const def = includeDefault ? defaultTitle(fieldDef, config) : undefined;\n if (allowDisabling) {\n return getFirstDefined(guideTitle, fieldDef.title, def);\n }\n else {\n return (_b = guideTitle !== null && guideTitle !== void 0 ? guideTitle : fieldDef.title) !== null && _b !== void 0 ? _b : def;\n }\n}\nexport function getGuide(fieldDef) {\n if (isPositionFieldOrDatumDef(fieldDef) && fieldDef.axis) {\n return fieldDef.axis;\n }\n else if (isMarkPropFieldOrDatumDef(fieldDef) && fieldDef.legend) {\n return fieldDef.legend;\n }\n else if (isFacetFieldDef(fieldDef) && fieldDef.header) {\n return fieldDef.header;\n }\n return undefined;\n}\nexport function defaultTitle(fieldDef, config) {\n return titleFormatter(fieldDef, config);\n}\nexport function getFormatMixins(fieldDef) {\n var _a;\n if (isStringFieldOrDatumDef(fieldDef)) {\n const { format, formatType } = fieldDef;\n return { format, formatType };\n }\n else {\n const guide = (_a = getGuide(fieldDef)) !== null && _a !== void 0 ? _a : {};\n const { format, formatType } = guide;\n return { format, formatType };\n }\n}\nexport function defaultType(fieldDef, channel) {\n var _a;\n switch (channel) {\n case 'latitude':\n case 'longitude':\n return 'quantitative';\n case 'row':\n case 'column':\n case 'facet':\n case 'shape':\n case 'strokeDash':\n return 'nominal';\n case 'order':\n return 'ordinal';\n }\n if (isSortableFieldDef(fieldDef) && isArray(fieldDef.sort)) {\n return 'ordinal';\n }\n const { aggregate, bin, timeUnit } = fieldDef;\n if (timeUnit) {\n return 'temporal';\n }\n if (bin || (aggregate && !isArgmaxDef(aggregate) && !isArgminDef(aggregate))) {\n return 'quantitative';\n }\n if (isScaleFieldDef(fieldDef) && ((_a = fieldDef.scale) === null || _a === void 0 ? void 0 : _a.type)) {\n switch (SCALE_CATEGORY_INDEX[fieldDef.scale.type]) {\n case 'numeric':\n case 'discretizing':\n return 'quantitative';\n case 'time':\n return 'temporal';\n }\n }\n return 'nominal';\n}\n/**\n * Returns the fieldDef -- either from the outer channelDef or from the condition of channelDef.\n * @param channelDef\n */\nexport function getFieldDef(channelDef) {\n if (isFieldDef(channelDef)) {\n return channelDef;\n }\n else if (hasConditionalFieldDef(channelDef)) {\n return channelDef.condition;\n }\n return undefined;\n}\nexport function getFieldOrDatumDef(channelDef) {\n if (isFieldOrDatumDef(channelDef)) {\n return channelDef;\n }\n else if (hasConditionalFieldOrDatumDef(channelDef)) {\n return channelDef.condition;\n }\n return undefined;\n}\n/**\n * Convert type to full, lowercase type, or augment the fieldDef with a default type if missing.\n */\nexport function initChannelDef(channelDef, channel, config, opt = {}) {\n if (isString(channelDef) || isNumber(channelDef) || isBoolean(channelDef)) {\n const primitiveType = isString(channelDef) ? 'string' : isNumber(channelDef) ? 'number' : 'boolean';\n log.warn(log.message.primitiveChannelDef(channel, primitiveType, channelDef));\n return { value: channelDef };\n }\n // If a fieldDef contains a field, we need type.\n if (isFieldOrDatumDef(channelDef)) {\n return initFieldOrDatumDef(channelDef, channel, config, opt);\n }\n else if (hasConditionalFieldOrDatumDef(channelDef)) {\n return Object.assign(Object.assign({}, channelDef), { \n // Need to cast as normalizeFieldDef normally return FieldDef, but here we know that it is definitely Condition\n condition: initFieldOrDatumDef(channelDef.condition, channel, config, opt) });\n }\n return channelDef;\n}\nexport function initFieldOrDatumDef(fd, channel, config, opt) {\n if (isStringFieldOrDatumDef(fd)) {\n const { format, formatType } = fd, rest = __rest(fd, [\"format\", \"formatType\"]);\n if (isCustomFormatType(formatType) && !config.customFormatTypes) {\n log.warn(log.message.customFormatTypeNotAllowed(channel));\n return initFieldOrDatumDef(rest, channel, config, opt);\n }\n }\n else {\n const guideType = isPositionFieldOrDatumDef(fd)\n ? 'axis'\n : isMarkPropFieldOrDatumDef(fd)\n ? 'legend'\n : isFacetFieldDef(fd)\n ? 'header'\n : null;\n if (guideType && fd[guideType]) {\n const _a = fd[guideType], { format, formatType } = _a, newGuide = __rest(_a, [\"format\", \"formatType\"]);\n if (isCustomFormatType(formatType) && !config.customFormatTypes) {\n log.warn(log.message.customFormatTypeNotAllowed(channel));\n return initFieldOrDatumDef(Object.assign(Object.assign({}, fd), { [guideType]: newGuide }), channel, config, opt);\n }\n }\n }\n if (isFieldDef(fd)) {\n return initFieldDef(fd, channel, opt);\n }\n return initDatumDef(fd);\n}\nfunction initDatumDef(datumDef) {\n let type = datumDef['type'];\n if (type) {\n return datumDef;\n }\n const { datum } = datumDef;\n type = isNumber(datum) ? 'quantitative' : isString(datum) ? 'nominal' : isDateTime(datum) ? 'temporal' : undefined;\n return Object.assign(Object.assign({}, datumDef), { type });\n}\nexport function initFieldDef(fd, channel, { compositeMark = false } = {}) {\n const { aggregate, timeUnit, bin, field } = fd;\n const fieldDef = Object.assign({}, fd);\n // Drop invalid aggregate\n if (!compositeMark && aggregate && !isAggregateOp(aggregate) && !isArgmaxDef(aggregate) && !isArgminDef(aggregate)) {\n log.warn(log.message.invalidAggregate(aggregate));\n delete fieldDef.aggregate;\n }\n // Normalize Time Unit\n if (timeUnit) {\n fieldDef.timeUnit = normalizeTimeUnit(timeUnit);\n }\n if (field) {\n fieldDef.field = `${field}`;\n }\n // Normalize bin\n if (isBinning(bin)) {\n fieldDef.bin = normalizeBin(bin, channel);\n }\n if (isBinned(bin) && !isXorY(channel)) {\n log.warn(log.message.channelShouldNotBeUsedForBinned(channel));\n }\n // Normalize Type\n if (isTypedFieldDef(fieldDef)) {\n const { type } = fieldDef;\n const fullType = getFullName(type);\n if (type !== fullType) {\n // convert short type to full type\n fieldDef.type = fullType;\n }\n if (type !== 'quantitative') {\n if (isCountingAggregateOp(aggregate)) {\n log.warn(log.message.invalidFieldTypeForCountAggregate(type, aggregate));\n fieldDef.type = 'quantitative';\n }\n }\n }\n else if (!isSecondaryRangeChannel(channel)) {\n // If type is empty / invalid, then augment with default type\n const newType = defaultType(fieldDef, channel);\n fieldDef['type'] = newType;\n }\n if (isTypedFieldDef(fieldDef)) {\n const { compatible, warning } = channelCompatibility(fieldDef, channel) || {};\n if (compatible === false) {\n log.warn(warning);\n }\n }\n if (isSortableFieldDef(fieldDef) && isString(fieldDef.sort)) {\n const { sort } = fieldDef;\n if (isSortByChannel(sort)) {\n return Object.assign(Object.assign({}, fieldDef), { sort: { encoding: sort } });\n }\n const sub = sort.substr(1);\n if (sort.charAt(0) === '-' && isSortByChannel(sub)) {\n return Object.assign(Object.assign({}, fieldDef), { sort: { encoding: sub, order: 'descending' } });\n }\n }\n if (isFacetFieldDef(fieldDef)) {\n const { header } = fieldDef;\n const { orient } = header, rest = __rest(header, [\"orient\"]);\n if (orient) {\n return Object.assign(Object.assign({}, fieldDef), { header: Object.assign(Object.assign({}, rest), { labelOrient: header.labelOrient || orient, titleOrient: header.titleOrient || orient }) });\n }\n }\n return fieldDef;\n}\nexport function normalizeBin(bin, channel) {\n if (isBoolean(bin)) {\n return { maxbins: autoMaxBins(channel) };\n }\n else if (bin === 'binned') {\n return {\n binned: true\n };\n }\n else if (!bin.maxbins && !bin.step) {\n return Object.assign(Object.assign({}, bin), { maxbins: autoMaxBins(channel) });\n }\n else {\n return bin;\n }\n}\nconst COMPATIBLE = { compatible: true };\nexport function channelCompatibility(fieldDef, channel) {\n const type = fieldDef.type;\n if (type === 'geojson' && channel !== 'shape') {\n return {\n compatible: false,\n warning: `Channel ${channel} should not be used with a geojson data.`\n };\n }\n switch (channel) {\n case ROW:\n case COLUMN:\n case FACET:\n if (isContinuous(fieldDef)) {\n return {\n compatible: false,\n warning: log.message.facetChannelShouldBeDiscrete(channel)\n };\n }\n return COMPATIBLE;\n case X:\n case Y:\n case COLOR:\n case FILL:\n case STROKE:\n case TEXT:\n case DETAIL:\n case KEY:\n case TOOLTIP:\n case HREF:\n case URL:\n case ANGLE:\n case THETA:\n case RADIUS:\n case DESCRIPTION:\n return COMPATIBLE;\n case LONGITUDE:\n case LONGITUDE2:\n case LATITUDE:\n case LATITUDE2:\n if (type !== QUANTITATIVE) {\n return {\n compatible: false,\n warning: `Channel ${channel} should be used with a quantitative field only, not ${fieldDef.type} field.`\n };\n }\n return COMPATIBLE;\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n case STROKEWIDTH:\n case SIZE:\n case THETA2:\n case RADIUS2:\n case X2:\n case Y2:\n if (type === 'nominal' && !fieldDef['sort']) {\n return {\n compatible: false,\n warning: `Channel ${channel} should not be used with an unsorted discrete field.`\n };\n }\n return COMPATIBLE;\n case STROKEDASH:\n if (!contains(['ordinal', 'nominal'], fieldDef.type)) {\n return {\n compatible: false,\n warning: 'StrokeDash channel should be used with only discrete data.'\n };\n }\n return COMPATIBLE;\n case SHAPE:\n if (!contains(['ordinal', 'nominal', 'geojson'], fieldDef.type)) {\n return {\n compatible: false,\n warning: 'Shape channel should be used with only either discrete or geojson data.'\n };\n }\n return COMPATIBLE;\n case ORDER:\n if (fieldDef.type === 'nominal' && !('sort' in fieldDef)) {\n return {\n compatible: false,\n warning: `Channel order is inappropriate for nominal field, which has no inherent order.`\n };\n }\n return COMPATIBLE;\n }\n}\n/**\n * Check if the field def uses a time format or does not use any format but is temporal\n * (this does not cover field defs that are temporal but use a number format).\n */\nexport function isFieldOrDatumDefForTimeFormat(fieldOrDatumDef) {\n const { formatType } = getFormatMixins(fieldOrDatumDef);\n return formatType === 'time' || (!formatType && isTimeFieldDef(fieldOrDatumDef));\n}\n/**\n * Check if field def has type `temporal`. If you want to also cover field defs that use a time format, use `isTimeFormatFieldDef`.\n */\nexport function isTimeFieldDef(def) {\n return def && (def['type'] === 'temporal' || (isFieldDef(def) && !!def.timeUnit));\n}\n/**\n * Getting a value associated with a fielddef.\n * Convert the value to Vega expression if applicable (for datetime object, or string if the field def is temporal or has timeUnit)\n */\nexport function valueExpr(v, { timeUnit, type, wrapTime, undefinedIfExprNotRequired }) {\n var _a;\n const unit = timeUnit && ((_a = normalizeTimeUnit(timeUnit)) === null || _a === void 0 ? void 0 : _a.unit);\n let isTime = unit || type === 'temporal';\n let expr;\n if (isExprRef(v)) {\n expr = v.expr;\n }\n else if (isSignalRef(v)) {\n expr = v.signal;\n }\n else if (isDateTime(v)) {\n isTime = true;\n expr = dateTimeToExpr(v);\n }\n else if (isString(v) || isNumber(v)) {\n if (isTime) {\n expr = `datetime(${JSON.stringify(v)})`;\n if (isLocalSingleTimeUnit(unit)) {\n // for single timeUnit, we will use dateTimeToExpr to convert number/string to match the timeUnit\n if ((isNumber(v) && v < 10000) || (isString(v) && isNaN(Date.parse(v)))) {\n expr = dateTimeToExpr({ [unit]: v });\n }\n }\n }\n }\n if (expr) {\n return wrapTime && isTime ? `time(${expr})` : expr;\n }\n // number or boolean or normal string\n return undefinedIfExprNotRequired ? undefined : JSON.stringify(v);\n}\n/**\n * Standardize value array -- convert each value to Vega expression if applicable\n */\nexport function valueArray(fieldOrDatumDef, values) {\n const { type } = fieldOrDatumDef;\n return values.map(v => {\n const expr = valueExpr(v, {\n timeUnit: isFieldDef(fieldOrDatumDef) ? fieldOrDatumDef.timeUnit : undefined,\n type,\n undefinedIfExprNotRequired: true\n });\n // return signal for the expression if we need an expression\n if (expr !== undefined) {\n return { signal: expr };\n }\n // otherwise just return the original value\n return v;\n });\n}\n/**\n * Checks whether a fieldDef for a particular channel requires a computed bin range.\n */\nexport function binRequiresRange(fieldDef, channel) {\n if (!isBinning(fieldDef.bin)) {\n console.warn('Only call this method for binned field defs.');\n return false;\n }\n // We need the range only when the user explicitly forces a binned field to be use discrete scale. In this case, bin range is used in axis and legend labels.\n // We could check whether the axis or legend exists (not disabled) but that seems overkill.\n return isScaleChannel(channel) && contains(['ordinal', 'nominal'], fieldDef.type);\n}\n//# sourceMappingURL=channeldef.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray, isString } from 'vega-util';\nimport { pick } from './util';\nexport function extractTitleConfig(titleConfig) {\n const { \n // These are non-mark title config that need to be hardcoded\n anchor, frame, offset, orient, \n // color needs to be redirect to fill\n color, \n // subtitle properties\n subtitleColor, subtitleFont, subtitleFontSize, subtitleFontStyle, subtitleFontWeight, subtitleLineHeight, subtitlePadding } = titleConfig, \n // The rest are mark config.\n rest = __rest(titleConfig, [\"anchor\", \"frame\", \"offset\", \"orient\", \"color\", \"subtitleColor\", \"subtitleFont\", \"subtitleFontSize\", \"subtitleFontStyle\", \"subtitleFontWeight\", \"subtitleLineHeight\", \"subtitlePadding\"]);\n const titleMarkConfig = Object.assign(Object.assign({}, rest), (color ? { fill: color } : {}));\n // These are non-mark title config that need to be hardcoded\n const nonMark = Object.assign(Object.assign(Object.assign(Object.assign({}, (anchor ? { anchor } : {})), (frame ? { frame } : {})), (offset ? { offset } : {})), (orient ? { orient } : {}));\n // subtitle part can stay in config.title since header titles do not use subtitle\n const subtitle = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (subtitleColor ? { subtitleColor } : {})), (subtitleFont ? { subtitleFont } : {})), (subtitleFontSize ? { subtitleFontSize } : {})), (subtitleFontStyle ? { subtitleFontStyle } : {})), (subtitleFontWeight ? { subtitleFontWeight } : {})), (subtitleLineHeight ? { subtitleLineHeight } : {})), (subtitlePadding ? { subtitlePadding } : {}));\n const subtitleMarkConfig = pick(titleMarkConfig, ['align', 'baseline', 'dx', 'dy', 'limit']);\n return { titleMarkConfig, subtitleMarkConfig, nonMark, subtitle };\n}\nexport function isText(v) {\n return isString(v) || (isArray(v) && isString(v[0]));\n}\n//# sourceMappingURL=title.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array, isArray, stringValue } from 'vega-util';\nimport { vgField } from '../channeldef';\nimport { isExprRef } from '../expr';\nimport { isText } from '../title';\nimport { deepEqual, getFirstDefined } from '../util';\nimport { isSignalRef } from '../vega.schema';\nexport const BIN_RANGE_DELIMITER = ' \\u2013 ';\nexport function signalOrValueRefWithCondition(val) {\n const condition = isArray(val.condition)\n ? val.condition.map(conditionalSignalRefOrValue)\n : conditionalSignalRefOrValue(val.condition);\n return Object.assign(Object.assign({}, signalRefOrValue(val)), { condition });\n}\nexport function signalRefOrValue(value) {\n if (isExprRef(value)) {\n const { expr } = value, rest = __rest(value, [\"expr\"]);\n return Object.assign({ signal: expr }, rest);\n }\n return value;\n}\nexport function conditionalSignalRefOrValue(value) {\n if (isExprRef(value)) {\n const { expr } = value, rest = __rest(value, [\"expr\"]);\n return Object.assign({ signal: expr }, rest);\n }\n return value;\n}\nexport function signalOrValueRef(value) {\n if (isExprRef(value)) {\n const { expr } = value, rest = __rest(value, [\"expr\"]);\n return Object.assign({ signal: expr }, rest);\n }\n if (isSignalRef(value)) {\n return value;\n }\n return value !== undefined ? { value } : undefined;\n}\nexport function exprFromValueOrSignalRef(ref) {\n if (isSignalRef(ref)) {\n return ref.signal;\n }\n return stringValue(ref.value);\n}\nexport function signalOrStringValue(v) {\n if (isSignalRef(v)) {\n return v.signal;\n }\n return v == null ? null : stringValue(v);\n}\nexport function applyMarkConfig(e, model, propsList) {\n for (const property of propsList) {\n const value = getMarkConfig(property, model.markDef, model.config);\n if (value !== undefined) {\n e[property] = signalOrValueRef(value);\n }\n }\n return e;\n}\nexport function getStyles(mark) {\n var _a;\n return [].concat(mark.type, (_a = mark.style) !== null && _a !== void 0 ? _a : []);\n}\nexport function getMarkPropOrConfig(channel, mark, config, opt = {}) {\n const { vgChannel, ignoreVgConfig } = opt;\n if (vgChannel && mark[vgChannel] !== undefined) {\n return mark[vgChannel];\n }\n else if (mark[channel] !== undefined) {\n return mark[channel];\n }\n else if (ignoreVgConfig && (!vgChannel || vgChannel === channel)) {\n return undefined;\n }\n return getMarkConfig(channel, mark, config, opt);\n}\n/**\n * Return property value from style or mark specific config property if exists.\n * Otherwise, return general mark specific config.\n */\nexport function getMarkConfig(channel, mark, config, { vgChannel } = {}) {\n return getFirstDefined(\n // style config has highest precedence\n vgChannel ? getMarkStyleConfig(channel, mark, config.style) : undefined, getMarkStyleConfig(channel, mark, config.style), \n // then mark-specific config\n vgChannel ? config[mark.type][vgChannel] : undefined, config[mark.type][channel], // Need to cast because MarkDef doesn't perfectly match with AnyMarkConfig, but if the type isn't available, we'll get nothing here, which is fine\n // If there is vgChannel, skip vl channel.\n // For example, vl size for text is vg fontSize, but config.mark.size is only for point size.\n vgChannel ? config.mark[vgChannel] : config.mark[channel] // Need to cast for the same reason as above\n );\n}\nexport function getMarkStyleConfig(prop, mark, styleConfigIndex) {\n return getStyleConfig(prop, getStyles(mark), styleConfigIndex);\n}\nexport function getStyleConfig(p, styles, styleConfigIndex) {\n styles = array(styles);\n let value;\n for (const style of styles) {\n const styleConfig = styleConfigIndex[style];\n if (styleConfig && styleConfig[p] !== undefined) {\n value = styleConfig[p];\n }\n }\n return value;\n}\n/**\n * Return Vega sort parameters (tuple of field and order).\n */\nexport function sortParams(orderDef, fieldRefOption) {\n return array(orderDef).reduce((s, orderChannelDef) => {\n var _a;\n s.field.push(vgField(orderChannelDef, fieldRefOption));\n s.order.push((_a = orderChannelDef.sort) !== null && _a !== void 0 ? _a : 'ascending');\n return s;\n }, { field: [], order: [] });\n}\nexport function mergeTitleFieldDefs(f1, f2) {\n const merged = [...f1];\n f2.forEach(fdToMerge => {\n for (const fieldDef1 of merged) {\n // If already exists, no need to append to merged array\n if (deepEqual(fieldDef1, fdToMerge)) {\n return;\n }\n }\n merged.push(fdToMerge);\n });\n return merged;\n}\nexport function mergeTitle(title1, title2) {\n if (deepEqual(title1, title2) || !title2) {\n // if titles are the same or title2 is falsy\n return title1;\n }\n else if (!title1) {\n // if title1 is falsy\n return title2;\n }\n else {\n return [...array(title1), ...array(title2)].join(', ');\n }\n}\nexport function mergeTitleComponent(v1, v2) {\n const v1Val = v1.value;\n const v2Val = v2.value;\n if (v1Val == null || v2Val === null) {\n return {\n explicit: v1.explicit,\n value: null\n };\n }\n else if ((isText(v1Val) || isSignalRef(v1Val)) && (isText(v2Val) || isSignalRef(v2Val))) {\n return {\n explicit: v1.explicit,\n value: mergeTitle(v1Val, v2Val)\n };\n }\n else if (isText(v1Val) || isSignalRef(v1Val)) {\n return {\n explicit: v1.explicit,\n value: v1Val\n };\n }\n else if (isText(v2Val) || isSignalRef(v2Val)) {\n return {\n explicit: v1.explicit,\n value: v2Val\n };\n }\n else if (!isText(v1Val) && !isSignalRef(v1Val) && !isText(v2Val) && !isSignalRef(v2Val)) {\n return {\n explicit: v1.explicit,\n value: mergeTitleFieldDefs(v1Val, v2Val)\n };\n }\n /* istanbul ignore next: Condition should not happen -- only for warning in development. */\n throw new Error('It should never reach here');\n}\n//# sourceMappingURL=common.js.map","export function isUnitSpec(spec) {\n return 'mark' in spec;\n}\n//# sourceMappingURL=unit.js.map","import { getMarkType } from '../mark';\nimport { isUnitSpec } from '../spec/unit';\nexport class CompositeMarkNormalizer {\n constructor(name, run) {\n this.name = name;\n this.run = run;\n }\n hasMatchingType(spec) {\n if (isUnitSpec(spec)) {\n return getMarkType(spec.mark) === this.name;\n }\n return false;\n }\n}\n//# sourceMappingURL=base.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array, isArray } from 'vega-util';\nimport { isArgmaxDef, isArgminDef } from './aggregate';\nimport { isBinned, isBinning } from './bin';\nimport { ANGLE, CHANNELS, COLOR, DESCRIPTION, DETAIL, FILL, FILLOPACITY, HREF, isChannel, isNonPositionScaleChannel, isSecondaryRangeChannel, isXorY, KEY, LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2, OPACITY, ORDER, RADIUS, RADIUS2, SHAPE, SIZE, STROKE, STROKEDASH, STROKEOPACITY, STROKEWIDTH, supportMark, TEXT, THETA, THETA2, TOOLTIP, URL, X, X2, Y, Y2 } from './channel';\nimport { binRequiresRange, getFieldDef, getGuide, hasConditionalFieldDef, initChannelDef, initFieldDef, isConditionalDef, isDatumDef, isFieldDef, isTypedFieldDef, isValueDef, title, vgField } from './channeldef';\nimport * as log from './log';\nimport { QUANTITATIVE, TEMPORAL } from './type';\nimport { keys, some } from './util';\nimport { isSignalRef } from './vega.schema';\nexport function channelHasField(encoding, channel) {\n const channelDef = encoding && encoding[channel];\n if (channelDef) {\n if (isArray(channelDef)) {\n return some(channelDef, fieldDef => !!fieldDef.field);\n }\n else {\n return isFieldDef(channelDef) || hasConditionalFieldDef(channelDef);\n }\n }\n return false;\n}\nexport function isAggregate(encoding) {\n return some(CHANNELS, channel => {\n if (channelHasField(encoding, channel)) {\n const channelDef = encoding[channel];\n if (isArray(channelDef)) {\n return some(channelDef, fieldDef => !!fieldDef.aggregate);\n }\n else {\n const fieldDef = getFieldDef(channelDef);\n return fieldDef && !!fieldDef.aggregate;\n }\n }\n return false;\n });\n}\nexport function extractTransformsFromEncoding(oldEncoding, config) {\n const groupby = [];\n const bins = [];\n const timeUnits = [];\n const aggregate = [];\n const encoding = {};\n forEach(oldEncoding, (channelDef, channel) => {\n // Extract potential embedded transformations along with remaining properties\n if (isFieldDef(channelDef)) {\n const { field, aggregate: aggOp, bin, timeUnit } = channelDef, remaining = __rest(channelDef, [\"field\", \"aggregate\", \"bin\", \"timeUnit\"]);\n if (aggOp || timeUnit || bin) {\n const guide = getGuide(channelDef);\n const isTitleDefined = guide && guide.title;\n let newField = vgField(channelDef, { forAs: true });\n const newFieldDef = Object.assign(Object.assign(Object.assign({}, (isTitleDefined ? [] : { title: title(channelDef, config, { allowDisabling: true }) })), remaining), { \n // Always overwrite field\n field: newField });\n if (aggOp) {\n let op;\n if (isArgmaxDef(aggOp)) {\n op = 'argmax';\n newField = vgField({ op: 'argmax', field: aggOp.argmax }, { forAs: true });\n newFieldDef.field = `${newField}.${field}`;\n }\n else if (isArgminDef(aggOp)) {\n op = 'argmin';\n newField = vgField({ op: 'argmin', field: aggOp.argmin }, { forAs: true });\n newFieldDef.field = `${newField}.${field}`;\n }\n else if (aggOp !== 'boxplot' && aggOp !== 'errorbar' && aggOp !== 'errorband') {\n op = aggOp;\n }\n if (op) {\n const aggregateEntry = {\n op,\n as: newField\n };\n if (field) {\n aggregateEntry.field = field;\n }\n aggregate.push(aggregateEntry);\n }\n }\n else {\n groupby.push(newField);\n if (isTypedFieldDef(channelDef) && isBinning(bin)) {\n bins.push({ bin, field, as: newField });\n // Add additional groupbys for range and end of bins\n groupby.push(vgField(channelDef, { binSuffix: 'end' }));\n if (binRequiresRange(channelDef, channel)) {\n groupby.push(vgField(channelDef, { binSuffix: 'range' }));\n }\n // Create accompanying 'x2' or 'y2' field if channel is 'x' or 'y' respectively\n if (isXorY(channel)) {\n const secondaryChannel = {\n field: newField + '_end'\n };\n encoding[channel + '2'] = secondaryChannel;\n }\n newFieldDef.bin = 'binned';\n if (!isSecondaryRangeChannel(channel)) {\n newFieldDef['type'] = QUANTITATIVE;\n }\n }\n else if (timeUnit) {\n timeUnits.push({\n timeUnit,\n field,\n as: newField\n });\n // define the format type for later compilation\n const formatType = isTypedFieldDef(channelDef) && channelDef.type !== TEMPORAL && 'time';\n if (formatType) {\n if (channel === TEXT || channel === TOOLTIP) {\n newFieldDef['formatType'] = formatType;\n }\n else if (isNonPositionScaleChannel(channel)) {\n newFieldDef['legend'] = Object.assign({ formatType }, newFieldDef['legend']);\n }\n else if (isXorY(channel)) {\n newFieldDef['axis'] = Object.assign({ formatType }, newFieldDef['axis']);\n }\n }\n }\n }\n // now the field should refer to post-transformed field instead\n encoding[channel] = newFieldDef;\n }\n else {\n groupby.push(field);\n encoding[channel] = oldEncoding[channel];\n }\n }\n else {\n // For value def / signal ref / datum def, just copy\n encoding[channel] = oldEncoding[channel];\n }\n });\n return {\n bins,\n timeUnits,\n aggregate,\n groupby,\n encoding\n };\n}\nexport function markChannelCompatible(encoding, channel, mark) {\n const markSupported = supportMark(channel, mark);\n if (!markSupported) {\n return false;\n }\n else if (markSupported === 'binned') {\n const primaryFieldDef = encoding[channel === X2 ? X : Y];\n // circle, point, square and tick only support x2/y2 when their corresponding x/y fieldDef\n // has \"binned\" data and thus need x2/y2 to specify the bin-end field.\n if (isFieldDef(primaryFieldDef) && isFieldDef(encoding[channel]) && isBinned(primaryFieldDef.bin)) {\n return true;\n }\n else {\n return false;\n }\n }\n return true;\n}\nexport function initEncoding(encoding, mark, filled, config) {\n return keys(encoding).reduce((normalizedEncoding, channel) => {\n if (!isChannel(channel)) {\n // Drop invalid channel\n log.warn(log.message.invalidEncodingChannel(channel));\n return normalizedEncoding;\n }\n const channelDef = encoding[channel];\n if (channel === 'angle' && mark === 'arc' && !encoding.theta) {\n log.warn(log.message.REPLACE_ANGLE_WITH_THETA);\n channel = THETA;\n }\n if (!markChannelCompatible(encoding, channel, mark)) {\n // Drop unsupported channel\n log.warn(log.message.incompatibleChannel(channel, mark));\n return normalizedEncoding;\n }\n // Drop line's size if the field is aggregated.\n if (channel === SIZE && mark === 'line') {\n const fieldDef = getFieldDef(encoding[channel]);\n if (fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.aggregate) {\n log.warn(log.message.LINE_WITH_VARYING_SIZE);\n return normalizedEncoding;\n }\n }\n // Drop color if either fill or stroke is specified\n if (channel === COLOR && (filled ? 'fill' in encoding : 'stroke' in encoding)) {\n log.warn(log.message.droppingColor('encoding', { fill: 'fill' in encoding, stroke: 'stroke' in encoding }));\n return normalizedEncoding;\n }\n if (channel === DETAIL ||\n (channel === ORDER && !isArray(channelDef) && !isValueDef(channelDef)) ||\n (channel === TOOLTIP && isArray(channelDef))) {\n if (channelDef) {\n // Array of fieldDefs for detail channel (or production rule)\n normalizedEncoding[channel] = array(channelDef).reduce((defs, fieldDef) => {\n if (!isFieldDef(fieldDef)) {\n log.warn(log.message.emptyFieldDef(fieldDef, channel));\n }\n else {\n defs.push(initFieldDef(fieldDef, channel));\n }\n return defs;\n }, []);\n }\n }\n else {\n if (channel === TOOLTIP && channelDef === null) {\n // Preserve null so we can use it to disable tooltip\n normalizedEncoding[channel] = null;\n }\n else if (!isFieldDef(channelDef) &&\n !isDatumDef(channelDef) &&\n !isValueDef(channelDef) &&\n !isConditionalDef(channelDef) &&\n !isSignalRef(channelDef)) {\n log.warn(log.message.emptyFieldDef(channelDef, channel));\n return normalizedEncoding;\n }\n normalizedEncoding[channel] = initChannelDef(channelDef, channel, config);\n }\n return normalizedEncoding;\n }, {});\n}\n/**\n * For composite marks, we have to call initChannelDef during init so we can infer types earlier.\n */\nexport function normalizeEncoding(encoding, config) {\n const normalizedEncoding = {};\n for (const channel of keys(encoding)) {\n const newChannelDef = initChannelDef(encoding[channel], channel, config, { compositeMark: true });\n normalizedEncoding[channel] = newChannelDef;\n }\n return normalizedEncoding;\n}\nexport function fieldDefs(encoding) {\n const arr = [];\n for (const channel of keys(encoding)) {\n if (channelHasField(encoding, channel)) {\n const channelDef = encoding[channel];\n const channelDefArray = array(channelDef);\n for (const def of channelDefArray) {\n if (isFieldDef(def)) {\n arr.push(def);\n }\n else if (hasConditionalFieldDef(def)) {\n arr.push(def.condition);\n }\n }\n }\n }\n return arr;\n}\nexport function forEach(mapping, f, thisArg) {\n if (!mapping) {\n return;\n }\n for (const channel of keys(mapping)) {\n const el = mapping[channel];\n if (isArray(el)) {\n for (const channelDef of el) {\n f.call(thisArg, channelDef, channel);\n }\n }\n else {\n f.call(thisArg, el, channel);\n }\n }\n}\nexport function reduce(mapping, f, init, thisArg) {\n if (!mapping) {\n return init;\n }\n return keys(mapping).reduce((r, channel) => {\n const map = mapping[channel];\n if (isArray(map)) {\n return map.reduce((r1, channelDef) => {\n return f.call(thisArg, r1, channelDef, channel);\n }, r);\n }\n else {\n return f.call(thisArg, r, map, channel);\n }\n }, init);\n}\n/**\n * Returns list of path grouping fields for the given encoding\n */\nexport function pathGroupingFields(mark, encoding) {\n return keys(encoding).reduce((details, channel) => {\n switch (channel) {\n // x, y, x2, y2, lat, long, lat1, long2, order, tooltip, href, aria label, cursor should not cause lines to group\n case X:\n case Y:\n case HREF:\n case DESCRIPTION:\n case URL:\n case X2:\n case Y2:\n case THETA:\n case THETA2:\n case RADIUS:\n case RADIUS2:\n // falls through\n case LATITUDE:\n case LONGITUDE:\n case LATITUDE2:\n case LONGITUDE2:\n // TODO: case 'cursor':\n // text, shape, shouldn't be a part of line/trail/area [falls through]\n case TEXT:\n case SHAPE:\n case ANGLE:\n // falls through\n // tooltip fields should not be added to group by [falls through]\n case TOOLTIP:\n return details;\n case ORDER:\n // order should not group line / trail\n if (mark === 'line' || mark === 'trail') {\n return details;\n }\n // but order should group area for stacking (falls through)\n case DETAIL:\n case KEY: {\n const channelDef = encoding[channel];\n if (isArray(channelDef) || isFieldDef(channelDef)) {\n for (const fieldDef of array(channelDef)) {\n if (!fieldDef.aggregate) {\n details.push(vgField(fieldDef, {}));\n }\n }\n }\n return details;\n }\n case SIZE:\n if (mark === 'trail') {\n // For trail, size should not group trail lines.\n return details;\n }\n // For line, size should group lines.\n // falls through\n case COLOR:\n case FILL:\n case STROKE:\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n case STROKEDASH:\n case STROKEWIDTH: {\n // TODO strokeDashOffset:\n // falls through\n const fieldDef = getFieldDef(encoding[channel]);\n if (fieldDef && !fieldDef.aggregate) {\n details.push(vgField(fieldDef, {}));\n }\n return details;\n }\n }\n }, []);\n}\n//# sourceMappingURL=encoding.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray, isBoolean, isString } from 'vega-util';\nimport { isContinuousFieldOrDatumDef, isFieldDef, isFieldOrDatumDefForTimeFormat } from '../channeldef';\nimport { fieldDefs } from '../encoding';\nimport * as log from '../log';\nimport { isMarkDef } from '../mark';\nimport { getFirstDefined, hash, unique } from '../util';\nimport { isSignalRef } from '../vega.schema';\nimport { toStringFieldDef } from './../channeldef';\nexport function filterTooltipWithAggregatedField(oldEncoding) {\n const { tooltip } = oldEncoding, filteredEncoding = __rest(oldEncoding, [\"tooltip\"]);\n if (!tooltip) {\n return { filteredEncoding };\n }\n let customTooltipWithAggregatedField;\n let customTooltipWithoutAggregatedField;\n if (isArray(tooltip)) {\n for (const t of tooltip) {\n if (t.aggregate) {\n if (!customTooltipWithAggregatedField) {\n customTooltipWithAggregatedField = [];\n }\n customTooltipWithAggregatedField.push(t);\n }\n else {\n if (!customTooltipWithoutAggregatedField) {\n customTooltipWithoutAggregatedField = [];\n }\n customTooltipWithoutAggregatedField.push(t);\n }\n }\n if (customTooltipWithAggregatedField) {\n filteredEncoding.tooltip = customTooltipWithAggregatedField;\n }\n }\n else {\n if (tooltip['aggregate']) {\n filteredEncoding.tooltip = tooltip;\n }\n else {\n customTooltipWithoutAggregatedField = tooltip;\n }\n }\n if (isArray(customTooltipWithoutAggregatedField) && customTooltipWithoutAggregatedField.length === 1) {\n customTooltipWithoutAggregatedField = customTooltipWithoutAggregatedField[0];\n }\n return { customTooltipWithoutAggregatedField, filteredEncoding };\n}\nexport function getCompositeMarkTooltip(tooltipSummary, continuousAxisChannelDef, encodingWithoutContinuousAxis, withFieldName = true) {\n if ('tooltip' in encodingWithoutContinuousAxis) {\n return { tooltip: encodingWithoutContinuousAxis.tooltip };\n }\n const fiveSummaryTooltip = tooltipSummary.map(({ fieldPrefix, titlePrefix }) => {\n const mainTitle = withFieldName ? ` of ${getTitle(continuousAxisChannelDef)}` : '';\n return {\n field: fieldPrefix + continuousAxisChannelDef.field,\n type: continuousAxisChannelDef.type,\n title: isSignalRef(titlePrefix) ? { signal: titlePrefix + `\"${escape(mainTitle)}\"` } : titlePrefix + mainTitle\n };\n });\n const tooltipFieldDefs = fieldDefs(encodingWithoutContinuousAxis).map(toStringFieldDef);\n return {\n tooltip: [\n ...fiveSummaryTooltip,\n // need to cast because TextFieldDef supports fewer types of bin\n ...unique(tooltipFieldDefs, hash)\n ]\n };\n}\nexport function getTitle(continuousAxisChannelDef) {\n const { title, field } = continuousAxisChannelDef;\n return getFirstDefined(title, field);\n}\nexport function makeCompositeAggregatePartFactory(compositeMarkDef, continuousAxis, continuousAxisChannelDef, sharedEncoding, compositeMarkConfig) {\n const { scale, axis } = continuousAxisChannelDef;\n return ({ partName, mark, positionPrefix, endPositionPrefix = undefined, extraEncoding = {} }) => {\n const title = getTitle(continuousAxisChannelDef);\n return partLayerMixins(compositeMarkDef, partName, compositeMarkConfig, {\n mark,\n encoding: Object.assign(Object.assign(Object.assign({ [continuousAxis]: Object.assign(Object.assign(Object.assign({ field: positionPrefix + '_' + continuousAxisChannelDef.field, type: continuousAxisChannelDef.type }, (title !== undefined ? { title } : {})), (scale !== undefined ? { scale } : {})), (axis !== undefined ? { axis } : {})) }, (isString(endPositionPrefix)\n ? {\n [continuousAxis + '2']: {\n field: endPositionPrefix + '_' + continuousAxisChannelDef.field\n }\n }\n : {})), sharedEncoding), extraEncoding)\n });\n };\n}\nexport function partLayerMixins(markDef, part, compositeMarkConfig, partBaseSpec) {\n const { clip, color, opacity } = markDef;\n const mark = markDef.type;\n if (markDef[part] || (markDef[part] === undefined && compositeMarkConfig[part])) {\n return [\n Object.assign(Object.assign({}, partBaseSpec), { mark: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, compositeMarkConfig[part]), (clip ? { clip } : {})), (color ? { color } : {})), (opacity ? { opacity } : {})), (isMarkDef(partBaseSpec.mark) ? partBaseSpec.mark : { type: partBaseSpec.mark })), { style: `${mark}-${part}` }), (isBoolean(markDef[part]) ? {} : markDef[part])) })\n ];\n }\n return [];\n}\nexport function compositeMarkContinuousAxis(spec, orient, compositeMark) {\n const { encoding } = spec;\n const continuousAxis = orient === 'vertical' ? 'y' : 'x';\n const continuousAxisChannelDef = encoding[continuousAxis]; // Safe to cast because if x is not continuous fielddef, the orient would not be horizontal.\n const continuousAxisChannelDef2 = encoding[continuousAxis + '2'];\n const continuousAxisChannelDefError = encoding[continuousAxis + 'Error'];\n const continuousAxisChannelDefError2 = encoding[continuousAxis + 'Error2'];\n return {\n continuousAxisChannelDef: filterAggregateFromChannelDef(continuousAxisChannelDef, compositeMark),\n continuousAxisChannelDef2: filterAggregateFromChannelDef(continuousAxisChannelDef2, compositeMark),\n continuousAxisChannelDefError: filterAggregateFromChannelDef(continuousAxisChannelDefError, compositeMark),\n continuousAxisChannelDefError2: filterAggregateFromChannelDef(continuousAxisChannelDefError2, compositeMark),\n continuousAxis\n };\n}\nfunction filterAggregateFromChannelDef(continuousAxisChannelDef, compositeMark) {\n if (continuousAxisChannelDef && continuousAxisChannelDef.aggregate) {\n const { aggregate } = continuousAxisChannelDef, continuousAxisWithoutAggregate = __rest(continuousAxisChannelDef, [\"aggregate\"]);\n if (aggregate !== compositeMark) {\n log.warn(log.message.errorBarContinuousAxisHasCustomizedAggregate(aggregate, compositeMark));\n }\n return continuousAxisWithoutAggregate;\n }\n else {\n return continuousAxisChannelDef;\n }\n}\nexport function compositeMarkOrient(spec, compositeMark) {\n const { mark, encoding } = spec;\n const { x, y } = encoding;\n if (isMarkDef(mark) && mark.orient) {\n return mark.orient;\n }\n if (isContinuousFieldOrDatumDef(x)) {\n // x is continuous\n if (isContinuousFieldOrDatumDef(y)) {\n // both x and y are continuous\n const xAggregate = isFieldDef(x) && x.aggregate;\n const yAggregate = isFieldDef(y) && y.aggregate;\n if (!xAggregate && yAggregate === compositeMark) {\n return 'vertical';\n }\n else if (!yAggregate && xAggregate === compositeMark) {\n return 'horizontal';\n }\n else if (xAggregate === compositeMark && yAggregate === compositeMark) {\n throw new Error('Both x and y cannot have aggregate');\n }\n else {\n if (isFieldOrDatumDefForTimeFormat(y) && !isFieldOrDatumDefForTimeFormat(x)) {\n // y is temporal but x is not\n return 'horizontal';\n }\n // default orientation for two continuous\n return 'vertical';\n }\n }\n return 'horizontal';\n }\n else if (isContinuousFieldOrDatumDef(y)) {\n // y is continuous but x is not\n return 'vertical';\n }\n else {\n // Neither x nor y is continuous.\n throw new Error(`Need a valid continuous axis for ${compositeMark}s`);\n }\n}\n//# sourceMappingURL=common.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isNumber, isObject } from 'vega-util';\nimport { getMarkPropOrConfig } from '../compile/common';\nimport { extractTransformsFromEncoding, normalizeEncoding } from '../encoding';\nimport * as log from '../log';\nimport { isMarkDef } from '../mark';\nimport { isEmpty, omit } from '../util';\nimport { CompositeMarkNormalizer } from './base';\nimport { compositeMarkContinuousAxis, compositeMarkOrient, filterTooltipWithAggregatedField, getCompositeMarkTooltip, getTitle, makeCompositeAggregatePartFactory, partLayerMixins } from './common';\nexport const BOXPLOT = 'boxplot';\nexport const BOXPLOT_PARTS = ['box', 'median', 'outliers', 'rule', 'ticks'];\nexport const boxPlotNormalizer = new CompositeMarkNormalizer(BOXPLOT, normalizeBoxPlot);\nexport function getBoxPlotType(extent) {\n if (isNumber(extent)) {\n return 'tukey';\n }\n // Ham: If we ever want to, we could add another extent syntax `{kIQR: number}` for the original [Q1-k*IQR, Q3+k*IQR] whisker and call this boxPlotType = `kIQR`. However, I'm not exposing this for now.\n return extent;\n}\nexport function normalizeBoxPlot(spec, { config }) {\n var _a, _b;\n // Need to initEncoding first so we can infer type\n spec = Object.assign(Object.assign({}, spec), { encoding: normalizeEncoding(spec.encoding, config) });\n const { mark, encoding: _encoding, selection, projection: _p } = spec, outerSpec = __rest(spec, [\"mark\", \"encoding\", \"selection\", \"projection\"]);\n const markDef = isMarkDef(mark) ? mark : { type: mark };\n // TODO(https://github.com/vega/vega-lite/issues/3702): add selection support\n if (selection) {\n log.warn(log.message.selectionNotSupported('boxplot'));\n }\n const extent = (_a = markDef.extent) !== null && _a !== void 0 ? _a : config.boxplot.extent;\n const sizeValue = getMarkPropOrConfig('size', markDef, // TODO: https://github.com/vega/vega-lite/issues/6245\n config);\n const boxPlotType = getBoxPlotType(extent);\n const { bins, timeUnits, transform, continuousAxisChannelDef, continuousAxis, groupby, aggregate, encodingWithoutContinuousAxis, ticksOrient, boxOrient, customTooltipWithoutAggregatedField } = boxParams(spec, extent, config);\n const { color, size } = encodingWithoutContinuousAxis, encodingWithoutSizeColorAndContinuousAxis = __rest(encodingWithoutContinuousAxis, [\"color\", \"size\"]);\n const makeBoxPlotPart = (sharedEncoding) => {\n return makeCompositeAggregatePartFactory(markDef, continuousAxis, continuousAxisChannelDef, sharedEncoding, config.boxplot);\n };\n const makeBoxPlotExtent = makeBoxPlotPart(encodingWithoutSizeColorAndContinuousAxis);\n const makeBoxPlotBox = makeBoxPlotPart(encodingWithoutContinuousAxis);\n const makeBoxPlotMidTick = makeBoxPlotPart(Object.assign(Object.assign({}, encodingWithoutSizeColorAndContinuousAxis), (size ? { size } : {})));\n const fiveSummaryTooltipEncoding = getCompositeMarkTooltip([\n { fieldPrefix: boxPlotType === 'min-max' ? 'upper_whisker_' : 'max_', titlePrefix: 'Max' },\n { fieldPrefix: 'upper_box_', titlePrefix: 'Q3' },\n { fieldPrefix: 'mid_box_', titlePrefix: 'Median' },\n { fieldPrefix: 'lower_box_', titlePrefix: 'Q1' },\n { fieldPrefix: boxPlotType === 'min-max' ? 'lower_whisker_' : 'min_', titlePrefix: 'Min' }\n ], continuousAxisChannelDef, encodingWithoutContinuousAxis);\n // ## Whisker Layers\n const endTick = { type: 'tick', color: 'black', opacity: 1, orient: ticksOrient, invalid: null, aria: false };\n const whiskerTooltipEncoding = boxPlotType === 'min-max'\n ? fiveSummaryTooltipEncoding // for min-max, show five-summary tooltip for whisker\n : // for tukey / k-IQR, just show upper/lower-whisker\n getCompositeMarkTooltip([\n { fieldPrefix: 'upper_whisker_', titlePrefix: 'Upper Whisker' },\n { fieldPrefix: 'lower_whisker_', titlePrefix: 'Lower Whisker' }\n ], continuousAxisChannelDef, encodingWithoutContinuousAxis);\n const whiskerLayers = [\n ...makeBoxPlotExtent({\n partName: 'rule',\n mark: { type: 'rule', invalid: null, aria: false },\n positionPrefix: 'lower_whisker',\n endPositionPrefix: 'lower_box',\n extraEncoding: whiskerTooltipEncoding\n }),\n ...makeBoxPlotExtent({\n partName: 'rule',\n mark: { type: 'rule', invalid: null, aria: false },\n positionPrefix: 'upper_box',\n endPositionPrefix: 'upper_whisker',\n extraEncoding: whiskerTooltipEncoding\n }),\n ...makeBoxPlotExtent({\n partName: 'ticks',\n mark: endTick,\n positionPrefix: 'lower_whisker',\n extraEncoding: whiskerTooltipEncoding\n }),\n ...makeBoxPlotExtent({\n partName: 'ticks',\n mark: endTick,\n positionPrefix: 'upper_whisker',\n extraEncoding: whiskerTooltipEncoding\n })\n ];\n // ## Box Layers\n // TODO: support hiding certain mark parts\n const boxLayers = [\n ...(boxPlotType !== 'tukey' ? whiskerLayers : []),\n ...makeBoxPlotBox({\n partName: 'box',\n mark: Object.assign(Object.assign({ type: 'bar' }, (sizeValue ? { size: sizeValue } : {})), { orient: boxOrient, invalid: null, ariaRoleDescription: 'box' }),\n positionPrefix: 'lower_box',\n endPositionPrefix: 'upper_box',\n extraEncoding: fiveSummaryTooltipEncoding\n }),\n ...makeBoxPlotMidTick({\n partName: 'median',\n mark: Object.assign(Object.assign(Object.assign({ type: 'tick', invalid: null }, (isObject(config.boxplot.median) && config.boxplot.median.color ? { color: config.boxplot.median.color } : {})), (sizeValue ? { size: sizeValue } : {})), { orient: ticksOrient, aria: false }),\n positionPrefix: 'mid_box',\n extraEncoding: fiveSummaryTooltipEncoding\n })\n ];\n if (boxPlotType === 'min-max') {\n return Object.assign(Object.assign({}, outerSpec), { transform: ((_b = outerSpec.transform) !== null && _b !== void 0 ? _b : []).concat(transform), layer: boxLayers });\n }\n // Tukey Box Plot\n const lowerBoxExpr = `datum[\"lower_box_${continuousAxisChannelDef.field}\"]`;\n const upperBoxExpr = `datum[\"upper_box_${continuousAxisChannelDef.field}\"]`;\n const iqrExpr = `(${upperBoxExpr} - ${lowerBoxExpr})`;\n const lowerWhiskerExpr = `${lowerBoxExpr} - ${extent} * ${iqrExpr}`;\n const upperWhiskerExpr = `${upperBoxExpr} + ${extent} * ${iqrExpr}`;\n const fieldExpr = `datum[\"${continuousAxisChannelDef.field}\"]`;\n const joinaggregateTransform = {\n joinaggregate: boxParamsQuartiles(continuousAxisChannelDef.field),\n groupby\n };\n const filteredWhiskerSpec = {\n transform: [\n {\n filter: `(${lowerWhiskerExpr} <= ${fieldExpr}) && (${fieldExpr} <= ${upperWhiskerExpr})`\n },\n {\n aggregate: [\n {\n op: 'min',\n field: continuousAxisChannelDef.field,\n as: 'lower_whisker_' + continuousAxisChannelDef.field\n },\n {\n op: 'max',\n field: continuousAxisChannelDef.field,\n as: 'upper_whisker_' + continuousAxisChannelDef.field\n },\n // preserve lower_box / upper_box\n {\n op: 'min',\n field: 'lower_box_' + continuousAxisChannelDef.field,\n as: 'lower_box_' + continuousAxisChannelDef.field\n },\n {\n op: 'max',\n field: 'upper_box_' + continuousAxisChannelDef.field,\n as: 'upper_box_' + continuousAxisChannelDef.field\n },\n ...aggregate\n ],\n groupby\n }\n ],\n layer: whiskerLayers\n };\n const { tooltip } = encodingWithoutSizeColorAndContinuousAxis, encodingWithoutSizeColorContinuousAxisAndTooltip = __rest(encodingWithoutSizeColorAndContinuousAxis, [\"tooltip\"]);\n const { scale, axis } = continuousAxisChannelDef;\n const title = getTitle(continuousAxisChannelDef);\n const axisWithoutTitle = omit(axis, ['title']);\n const outlierLayersMixins = partLayerMixins(markDef, 'outliers', config.boxplot, {\n transform: [{ filter: `(${fieldExpr} < ${lowerWhiskerExpr}) || (${fieldExpr} > ${upperWhiskerExpr})` }],\n mark: 'point',\n encoding: Object.assign(Object.assign(Object.assign({ [continuousAxis]: Object.assign(Object.assign(Object.assign({ field: continuousAxisChannelDef.field, type: continuousAxisChannelDef.type }, (title !== undefined ? { title } : {})), (scale !== undefined ? { scale } : {})), (isEmpty(axisWithoutTitle) ? {} : { axis: axisWithoutTitle })) }, encodingWithoutSizeColorContinuousAxisAndTooltip), (color ? { color } : {})), (customTooltipWithoutAggregatedField ? { tooltip: customTooltipWithoutAggregatedField } : {}))\n })[0];\n let filteredLayersMixins;\n const filteredLayersMixinsTransforms = [...bins, ...timeUnits, joinaggregateTransform];\n if (outlierLayersMixins) {\n filteredLayersMixins = {\n transform: filteredLayersMixinsTransforms,\n layer: [outlierLayersMixins, filteredWhiskerSpec]\n };\n }\n else {\n filteredLayersMixins = filteredWhiskerSpec;\n filteredLayersMixins.transform.unshift(...filteredLayersMixinsTransforms);\n }\n return Object.assign(Object.assign({}, outerSpec), { layer: [\n filteredLayersMixins,\n {\n // boxplot\n transform,\n layer: boxLayers\n }\n ] });\n}\nfunction boxParamsQuartiles(continousAxisField) {\n return [\n {\n op: 'q1',\n field: continousAxisField,\n as: 'lower_box_' + continousAxisField\n },\n {\n op: 'q3',\n field: continousAxisField,\n as: 'upper_box_' + continousAxisField\n }\n ];\n}\nfunction boxParams(spec, extent, config) {\n const orient = compositeMarkOrient(spec, BOXPLOT);\n const { continuousAxisChannelDef, continuousAxis } = compositeMarkContinuousAxis(spec, orient, BOXPLOT);\n const continuousFieldName = continuousAxisChannelDef.field;\n const boxPlotType = getBoxPlotType(extent);\n const boxplotSpecificAggregate = [\n ...boxParamsQuartiles(continuousFieldName),\n {\n op: 'median',\n field: continuousFieldName,\n as: 'mid_box_' + continuousFieldName\n },\n {\n op: 'min',\n field: continuousFieldName,\n as: (boxPlotType === 'min-max' ? 'lower_whisker_' : 'min_') + continuousFieldName\n },\n {\n op: 'max',\n field: continuousFieldName,\n as: (boxPlotType === 'min-max' ? 'upper_whisker_' : 'max_') + continuousFieldName\n }\n ];\n const postAggregateCalculates = boxPlotType === 'min-max' || boxPlotType === 'tukey'\n ? []\n : [\n // This is for the original k-IQR, which we do not expose\n {\n calculate: `datum[\"upper_box_${continuousFieldName}\"] - datum[\"lower_box_${continuousFieldName}\"]`,\n as: 'iqr_' + continuousFieldName\n },\n {\n calculate: `min(datum[\"upper_box_${continuousFieldName}\"] + datum[\"iqr_${continuousFieldName}\"] * ${extent}, datum[\"max_${continuousFieldName}\"])`,\n as: 'upper_whisker_' + continuousFieldName\n },\n {\n calculate: `max(datum[\"lower_box_${continuousFieldName}\"] - datum[\"iqr_${continuousFieldName}\"] * ${extent}, datum[\"min_${continuousFieldName}\"])`,\n as: 'lower_whisker_' + continuousFieldName\n }\n ];\n const _a = spec.encoding, _b = continuousAxis, oldContinuousAxisChannelDef = _a[_b], oldEncodingWithoutContinuousAxis = __rest(_a, [typeof _b === \"symbol\" ? _b : _b + \"\"]);\n const { customTooltipWithoutAggregatedField, filteredEncoding } = filterTooltipWithAggregatedField(oldEncodingWithoutContinuousAxis);\n const { bins, timeUnits, aggregate, groupby, encoding: encodingWithoutContinuousAxis } = extractTransformsFromEncoding(filteredEncoding, config);\n const ticksOrient = orient === 'vertical' ? 'horizontal' : 'vertical';\n const boxOrient = orient;\n const transform = [\n ...bins,\n ...timeUnits,\n {\n aggregate: [...aggregate, ...boxplotSpecificAggregate],\n groupby\n },\n ...postAggregateCalculates\n ];\n return {\n bins,\n timeUnits,\n transform,\n groupby,\n aggregate,\n continuousAxisChannelDef,\n continuousAxis,\n encodingWithoutContinuousAxis,\n ticksOrient,\n boxOrient,\n customTooltipWithoutAggregatedField\n };\n}\n//# sourceMappingURL=boxplot.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isContinuousFieldOrDatumDef, isFieldOrDatumDef, title } from '../channeldef';\nimport { extractTransformsFromEncoding, normalizeEncoding } from '../encoding';\nimport * as log from '../log';\nimport { isMarkDef } from '../mark';\nimport { replaceAll, titleCase } from '../util';\nimport { CompositeMarkNormalizer } from './base';\nimport { compositeMarkContinuousAxis, compositeMarkOrient, getCompositeMarkTooltip, makeCompositeAggregatePartFactory } from './common';\nexport const ERRORBAR = 'errorbar';\nexport const ERRORBAR_PARTS = ['ticks', 'rule'];\nexport const errorBarNormalizer = new CompositeMarkNormalizer(ERRORBAR, normalizeErrorBar);\nexport function normalizeErrorBar(spec, { config }) {\n // Need to initEncoding first so we can infer type\n spec = Object.assign(Object.assign({}, spec), { encoding: normalizeEncoding(spec.encoding, config) });\n const { transform, continuousAxisChannelDef, continuousAxis, encodingWithoutContinuousAxis, ticksOrient, markDef, outerSpec, tooltipEncoding } = errorBarParams(spec, ERRORBAR, config);\n delete encodingWithoutContinuousAxis['size'];\n const makeErrorBarPart = makeCompositeAggregatePartFactory(markDef, continuousAxis, continuousAxisChannelDef, encodingWithoutContinuousAxis, config.errorbar);\n const thickness = markDef.thickness;\n const size = markDef.size;\n const tick = Object.assign(Object.assign({ type: 'tick', orient: ticksOrient, aria: false }, (thickness !== undefined ? { thickness } : {})), (size !== undefined ? { size } : {}));\n const layer = [\n ...makeErrorBarPart({\n partName: 'ticks',\n mark: tick,\n positionPrefix: 'lower',\n extraEncoding: tooltipEncoding\n }),\n ...makeErrorBarPart({\n partName: 'ticks',\n mark: tick,\n positionPrefix: 'upper',\n extraEncoding: tooltipEncoding\n }),\n ...makeErrorBarPart({\n partName: 'rule',\n mark: Object.assign({ type: 'rule', ariaRoleDescription: 'errorbar' }, (thickness !== undefined ? { size: thickness } : {})),\n positionPrefix: 'lower',\n endPositionPrefix: 'upper',\n extraEncoding: tooltipEncoding\n })\n ];\n return Object.assign(Object.assign(Object.assign({}, outerSpec), { transform }), (layer.length > 1 ? { layer } : Object.assign({}, layer[0])));\n}\nfunction errorBarOrientAndInputType(spec, compositeMark) {\n const { encoding } = spec;\n if (errorBarIsInputTypeRaw(encoding)) {\n return {\n orient: compositeMarkOrient(spec, compositeMark),\n inputType: 'raw'\n };\n }\n const isTypeAggregatedUpperLower = errorBarIsInputTypeAggregatedUpperLower(encoding);\n const isTypeAggregatedError = errorBarIsInputTypeAggregatedError(encoding);\n const x = encoding.x;\n const y = encoding.y;\n if (isTypeAggregatedUpperLower) {\n // type is aggregated-upper-lower\n if (isTypeAggregatedError) {\n throw new Error(`${compositeMark} cannot be both type aggregated-upper-lower and aggregated-error`);\n }\n const x2 = encoding.x2;\n const y2 = encoding.y2;\n if (isFieldOrDatumDef(x2) && isFieldOrDatumDef(y2)) {\n // having both x, x2 and y, y2\n throw new Error(`${compositeMark} cannot have both x2 and y2`);\n }\n else if (isFieldOrDatumDef(x2)) {\n if (isContinuousFieldOrDatumDef(x)) {\n // having x, x2 quantitative and field y, y2 are not specified\n return { orient: 'horizontal', inputType: 'aggregated-upper-lower' };\n }\n else {\n // having x, x2 that are not both quantitative\n throw new Error(`Both x and x2 have to be quantitative in ${compositeMark}`);\n }\n }\n else if (isFieldOrDatumDef(y2)) {\n // y2 is a FieldDef\n if (isContinuousFieldOrDatumDef(y)) {\n // having y, y2 quantitative and field x, x2 are not specified\n return { orient: 'vertical', inputType: 'aggregated-upper-lower' };\n }\n else {\n // having y, y2 that are not both quantitative\n throw new Error(`Both y and y2 have to be quantitative in ${compositeMark}`);\n }\n }\n throw new Error('No ranged axis');\n }\n else {\n // type is aggregated-error\n const xError = encoding.xError;\n const xError2 = encoding.xError2;\n const yError = encoding.yError;\n const yError2 = encoding.yError2;\n if (isFieldOrDatumDef(xError2) && !isFieldOrDatumDef(xError)) {\n // having xError2 without xError\n throw new Error(`${compositeMark} cannot have xError2 without xError`);\n }\n if (isFieldOrDatumDef(yError2) && !isFieldOrDatumDef(yError)) {\n // having yError2 without yError\n throw new Error(`${compositeMark} cannot have yError2 without yError`);\n }\n if (isFieldOrDatumDef(xError) && isFieldOrDatumDef(yError)) {\n // having both xError and yError\n throw new Error(`${compositeMark} cannot have both xError and yError with both are quantiative`);\n }\n else if (isFieldOrDatumDef(xError)) {\n if (isContinuousFieldOrDatumDef(x)) {\n // having x and xError that are all quantitative\n return { orient: 'horizontal', inputType: 'aggregated-error' };\n }\n else {\n // having x, xError, and xError2 that are not all quantitative\n throw new Error('All x, xError, and xError2 (if exist) have to be quantitative');\n }\n }\n else if (isFieldOrDatumDef(yError)) {\n if (isContinuousFieldOrDatumDef(y)) {\n // having y and yError that are all quantitative\n return { orient: 'vertical', inputType: 'aggregated-error' };\n }\n else {\n // having y, yError, and yError2 that are not all quantitative\n throw new Error('All y, yError, and yError2 (if exist) have to be quantitative');\n }\n }\n throw new Error('No ranged axis');\n }\n}\nfunction errorBarIsInputTypeRaw(encoding) {\n return ((isFieldOrDatumDef(encoding.x) || isFieldOrDatumDef(encoding.y)) &&\n !isFieldOrDatumDef(encoding.x2) &&\n !isFieldOrDatumDef(encoding.y2) &&\n !isFieldOrDatumDef(encoding.xError) &&\n !isFieldOrDatumDef(encoding.xError2) &&\n !isFieldOrDatumDef(encoding.yError) &&\n !isFieldOrDatumDef(encoding.yError2));\n}\nfunction errorBarIsInputTypeAggregatedUpperLower(encoding) {\n return isFieldOrDatumDef(encoding.x2) || isFieldOrDatumDef(encoding.y2);\n}\nfunction errorBarIsInputTypeAggregatedError(encoding) {\n return (isFieldOrDatumDef(encoding.xError) ||\n isFieldOrDatumDef(encoding.xError2) ||\n isFieldOrDatumDef(encoding.yError) ||\n isFieldOrDatumDef(encoding.yError2));\n}\nexport function errorBarParams(spec, compositeMark, config) {\n var _a;\n // TODO: use selection\n const { mark, encoding, selection, projection: _p } = spec, outerSpec = __rest(spec, [\"mark\", \"encoding\", \"selection\", \"projection\"]);\n const markDef = isMarkDef(mark) ? mark : { type: mark };\n // TODO(https://github.com/vega/vega-lite/issues/3702): add selection support\n if (selection) {\n log.warn(log.message.selectionNotSupported(compositeMark));\n }\n const { orient, inputType } = errorBarOrientAndInputType(spec, compositeMark);\n const { continuousAxisChannelDef, continuousAxisChannelDef2, continuousAxisChannelDefError, continuousAxisChannelDefError2, continuousAxis } = compositeMarkContinuousAxis(spec, orient, compositeMark);\n const { errorBarSpecificAggregate, postAggregateCalculates, tooltipSummary, tooltipTitleWithFieldName } = errorBarAggregationAndCalculation(markDef, continuousAxisChannelDef, continuousAxisChannelDef2, continuousAxisChannelDefError, continuousAxisChannelDefError2, inputType, compositeMark, config);\n const _b = encoding, _c = continuousAxis, oldContinuousAxisChannelDef = _b[_c], _d = continuousAxis === 'x' ? 'x2' : 'y2', oldContinuousAxisChannelDef2 = _b[_d], _e = continuousAxis === 'x' ? 'xError' : 'yError', oldContinuousAxisChannelDefError = _b[_e], _f = continuousAxis === 'x' ? 'xError2' : 'yError2', oldContinuousAxisChannelDefError2 = _b[_f], oldEncodingWithoutContinuousAxis = __rest(_b, [typeof _c === \"symbol\" ? _c : _c + \"\", typeof _d === \"symbol\" ? _d : _d + \"\", typeof _e === \"symbol\" ? _e : _e + \"\", typeof _f === \"symbol\" ? _f : _f + \"\"]);\n const { bins, timeUnits, aggregate: oldAggregate, groupby: oldGroupBy, encoding: encodingWithoutContinuousAxis } = extractTransformsFromEncoding(oldEncodingWithoutContinuousAxis, config);\n const aggregate = [...oldAggregate, ...errorBarSpecificAggregate];\n const groupby = inputType !== 'raw' ? [] : oldGroupBy;\n const tooltipEncoding = getCompositeMarkTooltip(tooltipSummary, continuousAxisChannelDef, encodingWithoutContinuousAxis, tooltipTitleWithFieldName);\n return {\n transform: [\n ...((_a = outerSpec.transform) !== null && _a !== void 0 ? _a : []),\n ...bins,\n ...timeUnits,\n ...(aggregate.length === 0 ? [] : [{ aggregate, groupby }]),\n ...postAggregateCalculates\n ],\n groupby,\n continuousAxisChannelDef,\n continuousAxis,\n encodingWithoutContinuousAxis,\n ticksOrient: orient === 'vertical' ? 'horizontal' : 'vertical',\n markDef,\n outerSpec,\n tooltipEncoding\n };\n}\nfunction errorBarAggregationAndCalculation(markDef, continuousAxisChannelDef, continuousAxisChannelDef2, continuousAxisChannelDefError, continuousAxisChannelDefError2, inputType, compositeMark, config) {\n let errorBarSpecificAggregate = [];\n let postAggregateCalculates = [];\n const continuousFieldName = continuousAxisChannelDef.field;\n let tooltipSummary;\n let tooltipTitleWithFieldName = false;\n if (inputType === 'raw') {\n const center = markDef.center\n ? markDef.center\n : markDef.extent\n ? markDef.extent === 'iqr'\n ? 'median'\n : 'mean'\n : config.errorbar.center;\n const extent = markDef.extent ? markDef.extent : center === 'mean' ? 'stderr' : 'iqr';\n if ((center === 'median') !== (extent === 'iqr')) {\n log.warn(log.message.errorBarCenterIsUsedWithWrongExtent(center, extent, compositeMark));\n }\n if (extent === 'stderr' || extent === 'stdev') {\n errorBarSpecificAggregate = [\n { op: extent, field: continuousFieldName, as: 'extent_' + continuousFieldName },\n { op: center, field: continuousFieldName, as: 'center_' + continuousFieldName }\n ];\n postAggregateCalculates = [\n {\n calculate: `datum[\"center_${continuousFieldName}\"] + datum[\"extent_${continuousFieldName}\"]`,\n as: 'upper_' + continuousFieldName\n },\n {\n calculate: `datum[\"center_${continuousFieldName}\"] - datum[\"extent_${continuousFieldName}\"]`,\n as: 'lower_' + continuousFieldName\n }\n ];\n tooltipSummary = [\n { fieldPrefix: 'center_', titlePrefix: titleCase(center) },\n { fieldPrefix: 'upper_', titlePrefix: getTitlePrefix(center, extent, '+') },\n { fieldPrefix: 'lower_', titlePrefix: getTitlePrefix(center, extent, '-') }\n ];\n tooltipTitleWithFieldName = true;\n }\n else {\n let centerOp;\n let lowerExtentOp;\n let upperExtentOp;\n if (extent === 'ci') {\n centerOp = 'mean';\n lowerExtentOp = 'ci0';\n upperExtentOp = 'ci1';\n }\n else {\n centerOp = 'median';\n lowerExtentOp = 'q1';\n upperExtentOp = 'q3';\n }\n errorBarSpecificAggregate = [\n { op: lowerExtentOp, field: continuousFieldName, as: 'lower_' + continuousFieldName },\n { op: upperExtentOp, field: continuousFieldName, as: 'upper_' + continuousFieldName },\n { op: centerOp, field: continuousFieldName, as: 'center_' + continuousFieldName }\n ];\n tooltipSummary = [\n {\n fieldPrefix: 'upper_',\n titlePrefix: title({ field: continuousFieldName, aggregate: upperExtentOp, type: 'quantitative' }, config, {\n allowDisabling: false\n })\n },\n {\n fieldPrefix: 'lower_',\n titlePrefix: title({ field: continuousFieldName, aggregate: lowerExtentOp, type: 'quantitative' }, config, {\n allowDisabling: false\n })\n },\n {\n fieldPrefix: 'center_',\n titlePrefix: title({ field: continuousFieldName, aggregate: centerOp, type: 'quantitative' }, config, {\n allowDisabling: false\n })\n }\n ];\n }\n }\n else {\n if (markDef.center || markDef.extent) {\n log.warn(log.message.errorBarCenterAndExtentAreNotNeeded(markDef.center, markDef.extent));\n }\n if (inputType === 'aggregated-upper-lower') {\n tooltipSummary = [];\n postAggregateCalculates = [\n { calculate: `datum[\"${continuousAxisChannelDef2.field}\"]`, as: 'upper_' + continuousFieldName },\n { calculate: `datum[\"${continuousFieldName}\"]`, as: 'lower_' + continuousFieldName }\n ];\n }\n else if (inputType === 'aggregated-error') {\n tooltipSummary = [{ fieldPrefix: '', titlePrefix: continuousFieldName }];\n postAggregateCalculates = [\n {\n calculate: `datum[\"${continuousFieldName}\"] + datum[\"${continuousAxisChannelDefError.field}\"]`,\n as: 'upper_' + continuousFieldName\n }\n ];\n if (continuousAxisChannelDefError2) {\n postAggregateCalculates.push({\n calculate: `datum[\"${continuousFieldName}\"] + datum[\"${continuousAxisChannelDefError2.field}\"]`,\n as: 'lower_' + continuousFieldName\n });\n }\n else {\n postAggregateCalculates.push({\n calculate: `datum[\"${continuousFieldName}\"] - datum[\"${continuousAxisChannelDefError.field}\"]`,\n as: 'lower_' + continuousFieldName\n });\n }\n }\n for (const postAggregateCalculate of postAggregateCalculates) {\n tooltipSummary.push({\n fieldPrefix: postAggregateCalculate.as.substring(0, 6),\n titlePrefix: replaceAll(replaceAll(postAggregateCalculate.calculate, 'datum[\"', ''), '\"]', '')\n });\n }\n }\n return { postAggregateCalculates, errorBarSpecificAggregate, tooltipSummary, tooltipTitleWithFieldName };\n}\nfunction getTitlePrefix(center, extent, operation) {\n return titleCase(center) + ' ' + operation + ' ' + extent;\n}\n//# sourceMappingURL=errorbar.js.map","import { normalizeEncoding } from '../encoding';\nimport * as log from '../log';\nimport { CompositeMarkNormalizer } from './base';\nimport { makeCompositeAggregatePartFactory } from './common';\nimport { errorBarParams } from './errorbar';\nexport const ERRORBAND = 'errorband';\nexport const ERRORBAND_PARTS = ['band', 'borders'];\nexport const errorBandNormalizer = new CompositeMarkNormalizer(ERRORBAND, normalizeErrorBand);\nexport function normalizeErrorBand(spec, { config }) {\n // Need to initEncoding first so we can infer type\n spec = Object.assign(Object.assign({}, spec), { encoding: normalizeEncoding(spec.encoding, config) });\n const { transform, continuousAxisChannelDef, continuousAxis, encodingWithoutContinuousAxis, markDef, outerSpec, tooltipEncoding } = errorBarParams(spec, ERRORBAND, config);\n const errorBandDef = markDef;\n const makeErrorBandPart = makeCompositeAggregatePartFactory(errorBandDef, continuousAxis, continuousAxisChannelDef, encodingWithoutContinuousAxis, config.errorband);\n const is2D = spec.encoding.x !== undefined && spec.encoding.y !== undefined;\n let bandMark = { type: is2D ? 'area' : 'rect' };\n let bordersMark = { type: is2D ? 'line' : 'rule' };\n const interpolate = Object.assign(Object.assign({}, (errorBandDef.interpolate ? { interpolate: errorBandDef.interpolate } : {})), (errorBandDef.tension && errorBandDef.interpolate ? { tension: errorBandDef.tension } : {}));\n if (is2D) {\n bandMark = Object.assign(Object.assign(Object.assign({}, bandMark), interpolate), { ariaRoleDescription: 'errorband' });\n bordersMark = Object.assign(Object.assign(Object.assign({}, bordersMark), interpolate), { aria: false });\n }\n else if (errorBandDef.interpolate) {\n log.warn(log.message.errorBand1DNotSupport('interpolate'));\n }\n else if (errorBandDef.tension) {\n log.warn(log.message.errorBand1DNotSupport('tension'));\n }\n return Object.assign(Object.assign({}, outerSpec), { transform, layer: [\n ...makeErrorBandPart({\n partName: 'band',\n mark: bandMark,\n positionPrefix: 'lower',\n endPositionPrefix: 'upper',\n extraEncoding: tooltipEncoding\n }),\n ...makeErrorBandPart({\n partName: 'borders',\n mark: bordersMark,\n positionPrefix: 'lower',\n extraEncoding: tooltipEncoding\n }),\n ...makeErrorBandPart({\n partName: 'borders',\n mark: bordersMark,\n positionPrefix: 'upper',\n extraEncoding: tooltipEncoding\n })\n ] });\n}\n//# sourceMappingURL=errorband.js.map","import { keys } from '../util';\nimport { CompositeMarkNormalizer } from './base';\nimport { BOXPLOT, BOXPLOT_PARTS, normalizeBoxPlot } from './boxplot';\nimport { ERRORBAND, ERRORBAND_PARTS, normalizeErrorBand } from './errorband';\nimport { ERRORBAR, ERRORBAR_PARTS, normalizeErrorBar } from './errorbar';\n/**\n * Registry index for all composite mark's normalizer\n */\nconst compositeMarkRegistry = {};\nexport function add(mark, run, parts) {\n const normalizer = new CompositeMarkNormalizer(mark, run);\n compositeMarkRegistry[mark] = { normalizer, parts };\n}\nexport function remove(mark) {\n delete compositeMarkRegistry[mark];\n}\nexport function getAllCompositeMarks() {\n return keys(compositeMarkRegistry);\n}\nadd(BOXPLOT, normalizeBoxPlot, BOXPLOT_PARTS);\nadd(ERRORBAR, normalizeErrorBar, ERRORBAR_PARTS);\nadd(ERRORBAND, normalizeErrorBand, ERRORBAND_PARTS);\n//# sourceMappingURL=index.js.map","export const VL_ONLY_LEGEND_CONFIG = [\n 'gradientHorizontalMaxLength',\n 'gradientHorizontalMinLength',\n 'gradientVerticalMaxLength',\n 'gradientVerticalMinLength',\n 'unselectedOpacity'\n];\n//# sourceMappingURL=guide.js.map","import { keys } from './util';\nexport const HEADER_TITLE_PROPERTIES_MAP = {\n titleAlign: 'align',\n titleAnchor: 'anchor',\n titleAngle: 'angle',\n titleBaseline: 'baseline',\n titleColor: 'color',\n titleFont: 'font',\n titleFontSize: 'fontSize',\n titleFontStyle: 'fontStyle',\n titleFontWeight: 'fontWeight',\n titleLimit: 'limit',\n titleLineHeight: 'lineHeight',\n titleOrient: 'orient',\n titlePadding: 'offset'\n};\nexport const HEADER_LABEL_PROPERTIES_MAP = {\n labelAlign: 'align',\n labelAnchor: 'anchor',\n labelAngle: 'angle',\n labelBaseline: 'baseline',\n labelColor: 'color',\n labelFont: 'font',\n labelFontSize: 'fontSize',\n labelFontStyle: 'fontStyle',\n labelFontWeight: 'fontWeight',\n labelLimit: 'limit',\n labelLineHeight: 'lineHeight',\n labelOrient: 'orient',\n labelPadding: 'offset'\n};\nexport const HEADER_TITLE_PROPERTIES = keys(HEADER_TITLE_PROPERTIES_MAP);\nexport const HEADER_LABEL_PROPERTIES = keys(HEADER_LABEL_PROPERTIES_MAP);\nconst HEADER_CONFIGS_INDEX = {\n header: 1,\n headerRow: 1,\n headerColumn: 1,\n headerFacet: 1\n};\nexport const HEADER_CONFIGS = keys(HEADER_CONFIGS_INDEX);\n//# sourceMappingURL=header.js.map","import { keys } from './util';\nexport const LEGEND_SCALE_CHANNELS = [\n 'size',\n 'shape',\n 'fill',\n 'stroke',\n 'strokeDash',\n 'strokeWidth',\n 'opacity'\n];\nexport const defaultLegendConfig = {\n gradientHorizontalMaxLength: 200,\n gradientHorizontalMinLength: 100,\n gradientVerticalMaxLength: 200,\n gradientVerticalMinLength: 64,\n unselectedOpacity: 0.35\n};\nexport const COMMON_LEGEND_PROPERTY_INDEX = {\n aria: 1,\n clipHeight: 1,\n columnPadding: 1,\n columns: 1,\n cornerRadius: 1,\n description: 1,\n direction: 1,\n fillColor: 1,\n format: 1,\n formatType: 1,\n gradientLength: 1,\n gradientOpacity: 1,\n gradientStrokeColor: 1,\n gradientStrokeWidth: 1,\n gradientThickness: 1,\n gridAlign: 1,\n labelAlign: 1,\n labelBaseline: 1,\n labelColor: 1,\n labelFont: 1,\n labelFontSize: 1,\n labelFontStyle: 1,\n labelFontWeight: 1,\n labelLimit: 1,\n labelOffset: 1,\n labelOpacity: 1,\n labelOverlap: 1,\n labelPadding: 1,\n labelSeparation: 1,\n legendX: 1,\n legendY: 1,\n offset: 1,\n orient: 1,\n padding: 1,\n rowPadding: 1,\n strokeColor: 1,\n symbolDash: 1,\n symbolDashOffset: 1,\n symbolFillColor: 1,\n symbolLimit: 1,\n symbolOffset: 1,\n symbolOpacity: 1,\n symbolSize: 1,\n symbolStrokeColor: 1,\n symbolStrokeWidth: 1,\n symbolType: 1,\n tickCount: 1,\n tickMinStep: 1,\n title: 1,\n titleAlign: 1,\n titleAnchor: 1,\n titleBaseline: 1,\n titleColor: 1,\n titleFont: 1,\n titleFontSize: 1,\n titleFontStyle: 1,\n titleFontWeight: 1,\n titleLimit: 1,\n titleLineHeight: 1,\n titleOpacity: 1,\n titleOrient: 1,\n titlePadding: 1,\n type: 1,\n values: 1,\n zindex: 1\n};\nexport const LEGEND_PROPERTIES = keys(COMMON_LEGEND_PROPERTY_INDEX);\n//# sourceMappingURL=legend.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nexport function assembleParameterSignals(params) {\n const signals = [];\n for (const param of params || []) {\n const { expr, bind } = param, rest = __rest(param, [\"expr\", \"bind\"]);\n if (bind && expr) {\n // Vega's InitSignal -- apply expr to \"init\"\n const signal = Object.assign(Object.assign({}, rest), { bind, init: expr });\n signals.push(signal);\n }\n else {\n const signal = Object.assign(Object.assign(Object.assign({}, rest), (expr ? { update: expr } : {})), (bind ? { bind } : {}));\n signals.push(signal);\n }\n }\n return signals;\n}\n//# sourceMappingURL=parameter.js.map","import { isObject } from 'vega-util';\nexport const SELECTION_ID = '_vgsid_';\nexport const defaultConfig = {\n single: {\n on: 'click',\n fields: [SELECTION_ID],\n resolve: 'global',\n empty: 'all',\n clear: 'dblclick'\n },\n multi: {\n on: 'click',\n fields: [SELECTION_ID],\n toggle: 'event.shiftKey',\n resolve: 'global',\n empty: 'all',\n clear: 'dblclick'\n },\n interval: {\n on: '[mousedown, window:mouseup] > window:mousemove!',\n encodings: ['x', 'y'],\n translate: '[mousedown, window:mouseup] > window:mousemove!',\n zoom: 'wheel!',\n mark: { fill: '#333', fillOpacity: 0.125, stroke: 'white' },\n resolve: 'global',\n clear: 'dblclick'\n }\n};\nexport function isLegendBinding(bind) {\n return !!bind && (bind === 'legend' || !!bind.legend);\n}\nexport function isLegendStreamBinding(bind) {\n return isLegendBinding(bind) && isObject(bind);\n}\n//# sourceMappingURL=selection.js.map","export function isAnyConcatSpec(spec) {\n return isVConcatSpec(spec) || isHConcatSpec(spec) || isConcatSpec(spec);\n}\nexport function isConcatSpec(spec) {\n return 'concat' in spec;\n}\nexport function isVConcatSpec(spec) {\n return 'vconcat' in spec;\n}\nexport function isHConcatSpec(spec) {\n return 'hconcat' in spec;\n}\n//# sourceMappingURL=concat.js.map","import { isNumber, isObject } from 'vega-util';\nimport { keys } from '../util';\nimport { isConcatSpec, isVConcatSpec } from './concat';\nimport { isFacetMapping, isFacetSpec } from './facet';\nexport function isStep(size) {\n return isObject(size) && size['step'] !== undefined;\n}\nexport function isFrameMixins(o) {\n return o['view'] || o['width'] || o['height'];\n}\nexport const DEFAULT_SPACING = 20;\nconst COMPOSITION_LAYOUT_INDEX = {\n align: 1,\n bounds: 1,\n center: 1,\n columns: 1,\n spacing: 1\n};\nconst COMPOSITION_LAYOUT_PROPERTIES = keys(COMPOSITION_LAYOUT_INDEX);\nexport function extractCompositionLayout(spec, specType, config) {\n var _a, _b;\n const compositionConfig = config[specType];\n const layout = {};\n // Apply config first\n const { spacing: spacingConfig, columns } = compositionConfig;\n if (spacingConfig !== undefined) {\n layout.spacing = spacingConfig;\n }\n if (columns !== undefined) {\n if ((isFacetSpec(spec) && !isFacetMapping(spec.facet)) || isConcatSpec(spec)) {\n layout.columns = columns;\n }\n }\n if (isVConcatSpec(spec)) {\n layout.columns = 1;\n }\n // Then copy properties from the spec\n for (const prop of COMPOSITION_LAYOUT_PROPERTIES) {\n if (spec[prop] !== undefined) {\n if (prop === 'spacing') {\n const spacing = spec[prop];\n layout[prop] = isNumber(spacing)\n ? spacing\n : {\n row: (_a = spacing.row) !== null && _a !== void 0 ? _a : spacingConfig,\n column: (_b = spacing.column) !== null && _b !== void 0 ? _b : spacingConfig\n };\n }\n else {\n layout[prop] = spec[prop];\n }\n }\n }\n return layout;\n}\n//# sourceMappingURL=base.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isObject, mergeConfig } from 'vega-util';\nimport { AXIS_CONFIGS, isConditionalAxisValue } from './axis';\nimport { signalOrValueRefWithCondition, signalRefOrValue } from './compile/common';\nimport { getAllCompositeMarks } from './compositemark';\nimport { replaceExprRefInIndex } from './expr';\nimport { VL_ONLY_LEGEND_CONFIG } from './guide';\nimport { HEADER_CONFIGS } from './header';\nimport { defaultLegendConfig } from './legend';\nimport * as mark from './mark';\nimport { MARK_CONFIGS, PRIMITIVE_MARKS, VL_ONLY_MARK_CONFIG_PROPERTIES, VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX } from './mark';\nimport { assembleParameterSignals } from './parameter';\nimport { defaultScaleConfig } from './scale';\nimport { defaultConfig as defaultSelectionConfig } from './selection';\nimport { DEFAULT_SPACING, isStep } from './spec/base';\nimport { extractTitleConfig } from './title';\nimport { duplicate, getFirstDefined, isEmpty, keys, omit } from './util';\nexport function getViewConfigContinuousSize(viewConfig, channel) {\n var _a;\n return (_a = viewConfig[channel]) !== null && _a !== void 0 ? _a : viewConfig[channel === 'width' ? 'continuousWidth' : 'continuousHeight']; // get width/height for backwards compatibility\n}\nexport function getViewConfigDiscreteStep(viewConfig, channel) {\n const size = getViewConfigDiscreteSize(viewConfig, channel);\n return isStep(size) ? size.step : DEFAULT_STEP;\n}\nexport function getViewConfigDiscreteSize(viewConfig, channel) {\n var _a;\n const size = (_a = viewConfig[channel]) !== null && _a !== void 0 ? _a : viewConfig[channel === 'width' ? 'discreteWidth' : 'discreteHeight']; // get width/height for backwards compatibility\n return getFirstDefined(size, { step: viewConfig.step });\n}\nexport const DEFAULT_STEP = 20;\nexport const defaultViewConfig = {\n continuousWidth: 200,\n continuousHeight: 200,\n step: DEFAULT_STEP\n};\nexport function isVgScheme(rangeScheme) {\n return rangeScheme && !!rangeScheme['scheme'];\n}\nexport const defaultConfig = {\n background: 'white',\n padding: 5,\n timeFormat: '%b %d, %Y',\n countTitle: 'Count of Records',\n view: defaultViewConfig,\n mark: mark.defaultMarkConfig,\n arc: {},\n area: {},\n bar: mark.defaultBarConfig,\n circle: {},\n geoshape: {},\n image: {},\n line: {},\n point: {},\n rect: mark.defaultRectConfig,\n rule: { color: 'black' },\n square: {},\n text: { color: 'black' },\n tick: mark.defaultTickConfig,\n trail: {},\n boxplot: {\n size: 14,\n extent: 1.5,\n box: {},\n median: { color: 'white' },\n outliers: {},\n rule: {},\n ticks: null\n },\n errorbar: {\n center: 'mean',\n rule: true,\n ticks: false\n },\n errorband: {\n band: {\n opacity: 0.3\n },\n borders: false\n },\n scale: defaultScaleConfig,\n projection: {},\n legend: defaultLegendConfig,\n header: { titlePadding: 10, labelPadding: 10 },\n headerColumn: {},\n headerRow: {},\n headerFacet: {},\n selection: defaultSelectionConfig,\n style: {},\n title: {},\n facet: { spacing: DEFAULT_SPACING },\n concat: { spacing: DEFAULT_SPACING }\n};\n// Tableau10 color palette, copied from `vegaScale.scheme('tableau10')`\nconst tab10 = [\n '#4c78a8',\n '#f58518',\n '#e45756',\n '#72b7b2',\n '#54a24b',\n '#eeca3b',\n '#b279a2',\n '#ff9da6',\n '#9d755d',\n '#bab0ac'\n];\nexport const DEFAULT_FONT_SIZE = {\n text: 11,\n guideLabel: 10,\n guideTitle: 11,\n groupTitle: 13,\n groupSubtitle: 12\n};\nexport const DEFAULT_COLOR = {\n blue: tab10[0],\n orange: tab10[1],\n red: tab10[2],\n teal: tab10[3],\n green: tab10[4],\n yellow: tab10[5],\n purple: tab10[6],\n pink: tab10[7],\n brown: tab10[8],\n gray0: '#000',\n gray1: '#111',\n gray2: '#222',\n gray3: '#333',\n gray4: '#444',\n gray5: '#555',\n gray6: '#666',\n gray7: '#777',\n gray8: '#888',\n gray9: '#999',\n gray10: '#aaa',\n gray11: '#bbb',\n gray12: '#ccc',\n gray13: '#ddd',\n gray14: '#eee',\n gray15: '#fff'\n};\nexport function colorSignalConfig(color = {}) {\n return {\n signals: [\n {\n name: 'color',\n value: isObject(color) ? Object.assign(Object.assign({}, DEFAULT_COLOR), color) : DEFAULT_COLOR\n }\n ],\n mark: { color: { signal: 'color.blue' } },\n rule: { color: { signal: 'color.gray0' } },\n text: {\n color: { signal: 'color.gray0' }\n },\n style: {\n 'guide-label': {\n fill: { signal: 'color.gray0' }\n },\n 'guide-title': {\n fill: { signal: 'color.gray0' }\n },\n 'group-title': {\n fill: { signal: 'color.gray0' }\n },\n 'group-subtitle': {\n fill: { signal: 'color.gray0' }\n },\n cell: {\n stroke: { signal: 'color.gray8' }\n }\n },\n axis: {\n domainColor: { signal: 'color.gray13' },\n gridColor: { signal: 'color.gray8' },\n tickColor: { signal: 'color.gray13' }\n },\n range: {\n category: [\n { signal: 'color.blue' },\n { signal: 'color.orange' },\n { signal: 'color.red' },\n { signal: 'color.teal' },\n { signal: 'color.green' },\n { signal: 'color.yellow' },\n { signal: 'color.purple' },\n { signal: 'color.pink' },\n { signal: 'color.brown' },\n { signal: 'color.grey8' }\n ]\n }\n };\n}\nexport function fontSizeSignalConfig(fontSize) {\n return {\n signals: [\n {\n name: 'fontSize',\n value: isObject(fontSize) ? Object.assign(Object.assign({}, DEFAULT_FONT_SIZE), fontSize) : DEFAULT_FONT_SIZE\n }\n ],\n text: {\n fontSize: { signal: 'fontSize.text' }\n },\n style: {\n 'guide-label': {\n fontSize: { signal: 'fontSize.guideLabel' }\n },\n 'guide-title': {\n fontSize: { signal: 'fontSize.guideTitle' }\n },\n 'group-title': {\n fontSize: { signal: 'fontSize.groupTitle' }\n },\n 'group-subtitle': {\n fontSize: { signal: 'fontSize.groupSubtitle' }\n }\n }\n };\n}\nexport function fontConfig(font) {\n return {\n text: { font },\n style: {\n 'guide-label': { font },\n 'guide-title': { font },\n 'group-title': { font },\n 'group-subtitle': { font }\n }\n };\n}\nfunction getAxisConfigInternal(axisConfig) {\n const props = keys(axisConfig || {});\n const axisConfigInternal = {};\n for (const prop of props) {\n const val = axisConfig[prop];\n axisConfigInternal[prop] = isConditionalAxisValue(val)\n ? signalOrValueRefWithCondition(val)\n : signalRefOrValue(val);\n }\n return axisConfigInternal;\n}\nfunction getStyleConfigInternal(styleConfig) {\n const props = keys(styleConfig);\n const styleConfigInternal = {};\n for (const prop of props) {\n // We need to cast to cheat a bit here since styleConfig can be either mark config or axis config\n styleConfigInternal[prop] = getAxisConfigInternal(styleConfig[prop]);\n }\n return styleConfigInternal;\n}\nconst configPropsWithExpr = [\n ...MARK_CONFIGS,\n ...AXIS_CONFIGS,\n ...HEADER_CONFIGS,\n 'background',\n 'padding',\n 'legend',\n 'lineBreak',\n 'scale',\n 'style',\n 'title',\n 'view'\n];\n/**\n * Merge specified config with default config and config for the `color` flag,\n * then replace all expressions with signals\n */\nexport function initConfig(specifiedConfig = {}) {\n const { color, font, fontSize } = specifiedConfig, restConfig = __rest(specifiedConfig, [\"color\", \"font\", \"fontSize\"]);\n const mergedConfig = mergeConfig({}, defaultConfig, font ? fontConfig(font) : {}, color ? colorSignalConfig(color) : {}, fontSize ? fontSizeSignalConfig(fontSize) : {}, restConfig || {});\n const outputConfig = omit(mergedConfig, configPropsWithExpr);\n for (const prop of ['background', 'lineBreak', 'padding']) {\n if (mergedConfig[prop]) {\n outputConfig[prop] = signalRefOrValue(mergedConfig[prop]);\n }\n }\n for (const markConfigType of mark.MARK_CONFIGS) {\n if (mergedConfig[markConfigType]) {\n outputConfig[markConfigType] = replaceExprRefInIndex(mergedConfig[markConfigType]);\n }\n }\n for (const axisConfigType of AXIS_CONFIGS) {\n if (mergedConfig[axisConfigType]) {\n outputConfig[axisConfigType] = getAxisConfigInternal(mergedConfig[axisConfigType]);\n }\n }\n for (const headerConfigType of HEADER_CONFIGS) {\n if (mergedConfig[headerConfigType]) {\n outputConfig[headerConfigType] = replaceExprRefInIndex(mergedConfig[headerConfigType]);\n }\n }\n if (mergedConfig.legend) {\n outputConfig.legend = replaceExprRefInIndex(mergedConfig.legend);\n }\n if (mergedConfig.scale) {\n outputConfig.scale = replaceExprRefInIndex(mergedConfig.scale);\n }\n if (mergedConfig.style) {\n outputConfig.style = getStyleConfigInternal(mergedConfig.style);\n }\n if (mergedConfig.title) {\n outputConfig.title = replaceExprRefInIndex(mergedConfig.title);\n }\n if (mergedConfig.view) {\n outputConfig.view = replaceExprRefInIndex(mergedConfig.view);\n }\n return outputConfig;\n}\nconst MARK_STYLES = ['view', ...PRIMITIVE_MARKS];\nconst VL_ONLY_CONFIG_PROPERTIES = [\n 'color',\n 'fontSize',\n 'background',\n 'padding',\n 'facet',\n 'concat',\n 'numberFormat',\n 'timeFormat',\n 'countTitle',\n 'header',\n 'axisQuantitative',\n 'axisTemporal',\n 'axisDiscrete',\n 'axisPoint',\n 'axisXBand',\n 'axisXPoint',\n 'axisXDiscrete',\n 'axisXQuantitative',\n 'axisXTemporal',\n 'axisYBand',\n 'axisYPoint',\n 'axisYDiscrete',\n 'axisYQuantitative',\n 'axisYTemporal',\n 'scale',\n 'selection',\n 'overlay' // FIXME: Redesign and unhide this\n];\nconst VL_ONLY_ALL_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX = Object.assign({ view: ['continuousWidth', 'continuousHeight', 'discreteWidth', 'discreteHeight', 'step'] }, VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX);\nexport function stripAndRedirectConfig(config) {\n config = duplicate(config);\n for (const prop of VL_ONLY_CONFIG_PROPERTIES) {\n delete config[prop];\n }\n if (config.axis) {\n // delete condition axis config\n for (const prop in config.axis) {\n if (isConditionalAxisValue(config.axis[prop])) {\n delete config.axis[prop];\n }\n }\n }\n if (config.legend) {\n for (const prop of VL_ONLY_LEGEND_CONFIG) {\n delete config.legend[prop];\n }\n }\n // Remove Vega-Lite only generic mark config\n if (config.mark) {\n for (const prop of VL_ONLY_MARK_CONFIG_PROPERTIES) {\n delete config.mark[prop];\n }\n if (config.mark.tooltip && isObject(config.mark.tooltip)) {\n delete config.mark.tooltip;\n }\n }\n if (config.params) {\n config.signals = (config.signals || []).concat(assembleParameterSignals(config.params));\n delete config.params;\n }\n for (const markType of MARK_STYLES) {\n // Remove Vega-Lite-only mark config\n for (const prop of VL_ONLY_MARK_CONFIG_PROPERTIES) {\n delete config[markType][prop];\n }\n // Remove Vega-Lite only mark-specific config\n const vlOnlyMarkSpecificConfigs = VL_ONLY_ALL_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX[markType];\n if (vlOnlyMarkSpecificConfigs) {\n for (const prop of vlOnlyMarkSpecificConfigs) {\n delete config[markType][prop];\n }\n }\n // Redirect mark config to config.style so that mark config only affect its own mark type\n // without affecting other marks that share the same underlying Vega marks.\n // For example, config.rect should not affect bar marks.\n redirectConfigToStyleConfig(config, markType);\n }\n for (const m of getAllCompositeMarks()) {\n // Clean up the composite mark config as we don't need them in the output specs anymore\n delete config[m];\n }\n redirectTitleConfig(config);\n // Remove empty config objects.\n for (const prop in config) {\n if (isObject(config[prop]) && isEmpty(config[prop])) {\n delete config[prop];\n }\n }\n return isEmpty(config) ? undefined : config;\n}\n/**\n *\n * Redirect config.title -- so that title config do not affect header labels,\n * which also uses `title` directive to implement.\n *\n * For subtitle configs in config.title, keep them in config.title as header titles never have subtitles.\n */\nfunction redirectTitleConfig(config) {\n const { titleMarkConfig, subtitleMarkConfig, subtitle } = extractTitleConfig(config.title);\n // set config.style if title/subtitleMarkConfig is not an empty object\n if (!isEmpty(titleMarkConfig)) {\n config.style['group-title'] = Object.assign(Object.assign({}, config.style['group-title']), titleMarkConfig // config.title has higher precedence than config.style.group-title in Vega\n );\n }\n if (!isEmpty(subtitleMarkConfig)) {\n config.style['group-subtitle'] = Object.assign(Object.assign({}, config.style['group-subtitle']), subtitleMarkConfig);\n }\n // subtitle part can stay in config.title since header titles do not use subtitle\n if (!isEmpty(subtitle)) {\n config.title = subtitle;\n }\n else {\n delete config.title;\n }\n}\nfunction redirectConfigToStyleConfig(config, prop, // string = composite mark\ntoProp, compositeMarkPart) {\n const propConfig = compositeMarkPart ? config[prop][compositeMarkPart] : config[prop];\n if (prop === 'view') {\n toProp = 'cell'; // View's default style is \"cell\"\n }\n const style = Object.assign(Object.assign({}, propConfig), config.style[toProp !== null && toProp !== void 0 ? toProp : prop]);\n // set config.style if it is not an empty object\n if (!isEmpty(style)) {\n config.style[toProp !== null && toProp !== void 0 ? toProp : prop] = style;\n }\n if (!compositeMarkPart) {\n // For composite mark, so don't delete the whole config yet as we have to do multiple redirections.\n delete config[prop];\n }\n}\n//# sourceMappingURL=config.js.map","export function isLayerSpec(spec) {\n return 'layer' in spec;\n}\n//# sourceMappingURL=layer.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as log from '../log';\nimport { isConcatSpec, isHConcatSpec, isVConcatSpec } from './concat';\nimport { isFacetSpec } from './facet';\nimport { isLayerSpec } from './layer';\nimport { isRepeatSpec } from './repeat';\nimport { isUnitSpec } from './unit';\nexport class SpecMapper {\n map(spec, params) {\n if (isFacetSpec(spec)) {\n return this.mapFacet(spec, params);\n }\n else if (isRepeatSpec(spec)) {\n return this.mapRepeat(spec, params);\n }\n else if (isHConcatSpec(spec)) {\n return this.mapHConcat(spec, params);\n }\n else if (isVConcatSpec(spec)) {\n return this.mapVConcat(spec, params);\n }\n else if (isConcatSpec(spec)) {\n return this.mapConcat(spec, params);\n }\n else {\n return this.mapLayerOrUnit(spec, params);\n }\n }\n mapLayerOrUnit(spec, params) {\n if (isLayerSpec(spec)) {\n return this.mapLayer(spec, params);\n }\n else if (isUnitSpec(spec)) {\n return this.mapUnit(spec, params);\n }\n throw new Error(log.message.invalidSpec(spec));\n }\n mapLayer(spec, params) {\n return Object.assign(Object.assign({}, spec), { layer: spec.layer.map(subspec => this.mapLayerOrUnit(subspec, params)) });\n }\n mapHConcat(spec, params) {\n return Object.assign(Object.assign({}, spec), { hconcat: spec.hconcat.map(subspec => this.map(subspec, params)) });\n }\n mapVConcat(spec, params) {\n return Object.assign(Object.assign({}, spec), { vconcat: spec.vconcat.map(subspec => this.map(subspec, params)) });\n }\n mapConcat(spec, params) {\n const { concat } = spec, rest = __rest(spec, [\"concat\"]);\n return Object.assign(Object.assign({}, rest), { concat: concat.map(subspec => this.map(subspec, params)) });\n }\n mapFacet(spec, params) {\n return Object.assign(Object.assign({}, spec), { \n // TODO: remove \"any\" once we support all facet listed in https://github.com/vega/vega-lite/issues/2760\n spec: this.map(spec.spec, params) });\n }\n mapRepeat(spec, params) {\n return Object.assign(Object.assign({}, spec), { \n // as any is required here since TS cannot infer that the output type satisfies the input type\n spec: this.map(spec.spec, params) });\n }\n}\n//# sourceMappingURL=map.js.map","import { isArray } from 'vega-util';\nexport function isRepeatSpec(spec) {\n return 'repeat' in spec;\n}\nexport function isLayerRepeatSpec(spec) {\n return !isArray(spec.repeat) && spec.repeat['layer'];\n}\n//# sourceMappingURL=repeat.js.map","import { array, isBoolean } from 'vega-util';\nimport { SUM_OPS } from './aggregate';\nimport { getSecondaryRangeChannel, NONPOSITION_CHANNELS } from './channel';\nimport { channelDefType, getFieldDef, isFieldDef, isFieldOrDatumDef, vgField } from './channeldef';\nimport { channelHasField, isAggregate } from './encoding';\nimport * as log from './log';\nimport { ARC, AREA, BAR, CIRCLE, isMarkDef, isPathMark, LINE, POINT, RULE, SQUARE, TEXT, TICK } from './mark';\nimport { ScaleType } from './scale';\nimport { contains } from './util';\nconst STACK_OFFSET_INDEX = {\n zero: 1,\n center: 1,\n normalize: 1\n};\nexport function isStackOffset(s) {\n return s in STACK_OFFSET_INDEX;\n}\nexport const STACKABLE_MARKS = new Set([ARC, BAR, AREA, RULE, POINT, CIRCLE, SQUARE, LINE, TEXT, TICK]);\nexport const STACK_BY_DEFAULT_MARKS = new Set([BAR, AREA, ARC]);\nfunction potentialStackedChannel(encoding, x) {\n var _a, _b;\n const y = x === 'x' ? 'y' : 'radius';\n const xDef = encoding[x];\n const yDef = encoding[y];\n if (isFieldDef(xDef) && isFieldDef(yDef)) {\n if (channelDefType(xDef) === 'quantitative' && channelDefType(yDef) === 'quantitative') {\n if (xDef.stack) {\n return x;\n }\n else if (yDef.stack) {\n return y;\n }\n const xAggregate = isFieldDef(xDef) && !!xDef.aggregate;\n const yAggregate = isFieldDef(yDef) && !!yDef.aggregate;\n // if there is no explicit stacking, only apply stack if there is only one aggregate for x or y\n if (xAggregate !== yAggregate) {\n return xAggregate ? x : y;\n }\n else {\n const xScale = (_a = xDef.scale) === null || _a === void 0 ? void 0 : _a.type;\n const yScale = (_b = yDef.scale) === null || _b === void 0 ? void 0 : _b.type;\n if (xScale && xScale !== 'linear') {\n return y;\n }\n else if (yScale && yScale !== 'linear') {\n return x;\n }\n }\n }\n else if (channelDefType(xDef) === 'quantitative') {\n return x;\n }\n else if (channelDefType(yDef) === 'quantitative') {\n return y;\n }\n }\n else if (channelDefType(xDef) === 'quantitative') {\n return x;\n }\n else if (channelDefType(yDef) === 'quantitative') {\n return y;\n }\n return undefined;\n}\nfunction getDimensionChannel(channel) {\n switch (channel) {\n case 'x':\n return 'y';\n case 'y':\n return 'x';\n case 'theta':\n return 'radius';\n case 'radius':\n return 'theta';\n }\n}\n// Note: CompassQL uses this method and only pass in required properties of each argument object.\n// If required properties change, make sure to update CompassQL.\nexport function stack(m, encoding, opt = {}) {\n const mark = isMarkDef(m) ? m.type : m;\n // Should have stackable mark\n if (!STACKABLE_MARKS.has(mark)) {\n return null;\n }\n // Run potential stacked twice, one for Cartesian and another for Polar,\n // so text marks can be stacked in any of the coordinates.\n // Note: The logic here is not perfectly correct. If we want to support stacked dot plots where each dot is a pie chart with label, we have to change the stack logic here to separate Cartesian stacking for polar stacking.\n // However, since we probably never want to do that, let's just note the limitation here.\n const fieldChannel = potentialStackedChannel(encoding, 'x') || potentialStackedChannel(encoding, 'theta');\n if (!fieldChannel) {\n return null;\n }\n const stackedFieldDef = encoding[fieldChannel];\n const stackedField = isFieldDef(stackedFieldDef) ? vgField(stackedFieldDef, {}) : undefined;\n let dimensionChannel = getDimensionChannel(fieldChannel);\n let dimensionDef = encoding[dimensionChannel];\n let dimensionField = isFieldDef(dimensionDef) ? vgField(dimensionDef, {}) : undefined;\n // avoid grouping by the stacked field\n if (dimensionField === stackedField) {\n dimensionField = undefined;\n dimensionDef = undefined;\n dimensionChannel = undefined;\n }\n // Should have grouping level of detail that is different from the dimension field\n const stackBy = NONPOSITION_CHANNELS.reduce((sc, channel) => {\n // Ignore tooltip in stackBy (https://github.com/vega/vega-lite/issues/4001)\n if (channel !== 'tooltip' && channelHasField(encoding, channel)) {\n const channelDef = encoding[channel];\n for (const cDef of array(channelDef)) {\n const fieldDef = getFieldDef(cDef);\n if (fieldDef.aggregate) {\n continue;\n }\n // Check whether the channel's field is identical to x/y's field or if the channel is a repeat\n const f = vgField(fieldDef, {});\n if (\n // if fielddef is a repeat, just include it in the stack by\n !f ||\n // otherwise, the field must be different from x and y fields.\n f !== dimensionField) {\n sc.push({ channel, fieldDef });\n }\n }\n }\n return sc;\n }, []);\n // Automatically determine offset\n let offset;\n if (stackedFieldDef.stack !== undefined) {\n if (isBoolean(stackedFieldDef.stack)) {\n offset = stackedFieldDef.stack ? 'zero' : null;\n }\n else {\n offset = stackedFieldDef.stack;\n }\n }\n else if (stackBy.length > 0 && STACK_BY_DEFAULT_MARKS.has(mark)) {\n // Bar and Area with sum ops are automatically stacked by default\n offset = 'zero';\n }\n if (!offset || !isStackOffset(offset)) {\n return null;\n }\n if (isAggregate(encoding) && stackBy.length === 0) {\n return null;\n }\n // warn when stacking non-linear\n if (stackedFieldDef.scale && stackedFieldDef.scale.type && stackedFieldDef.scale.type !== ScaleType.LINEAR) {\n if (opt.disallowNonLinearStack) {\n return null;\n }\n else {\n log.warn(log.message.cannotStackNonLinearScale(stackedFieldDef.scale.type));\n }\n }\n // Check if it is a ranged mark\n if (isFieldOrDatumDef(encoding[getSecondaryRangeChannel(fieldChannel)])) {\n if (stackedFieldDef.stack !== undefined) {\n log.warn(log.message.cannotStackRangedMark(fieldChannel));\n }\n return null;\n }\n // Warn if stacking non-summative aggregate\n if (isFieldDef(stackedFieldDef) && stackedFieldDef.aggregate && !contains(SUM_OPS, stackedFieldDef.aggregate)) {\n log.warn(log.message.stackNonSummativeAggregate(stackedFieldDef.aggregate));\n }\n return {\n groupbyChannel: dimensionDef ? dimensionChannel : undefined,\n groupbyField: dimensionField,\n fieldChannel,\n impute: stackedFieldDef.impute === null ? false : isPathMark(mark),\n stackBy,\n offset\n };\n}\n//# sourceMappingURL=stack.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isObject } from 'vega-util';\nimport { normalizeEncoding } from '../encoding';\nimport { isMarkDef } from '../mark';\nimport { isUnitSpec } from '../spec/unit';\nimport { stack } from '../stack';\nimport { keys, omit, pick } from '../util';\nfunction dropLineAndPoint(markDef) {\n const { point: _point, line: _line } = markDef, mark = __rest(markDef, [\"point\", \"line\"]);\n return keys(mark).length > 1 ? mark : mark.type;\n}\nfunction dropLineAndPointFromConfig(config) {\n for (const mark of ['line', 'area', 'rule', 'trail']) {\n if (config[mark]) {\n config = Object.assign(Object.assign({}, config), { \n // TODO: remove as any\n [mark]: omit(config[mark], ['point', 'line']) });\n }\n }\n return config;\n}\nfunction getPointOverlay(markDef, markConfig = {}, encoding) {\n if (markDef.point === 'transparent') {\n return { opacity: 0 };\n }\n else if (markDef.point) {\n // truthy : true or object\n return isObject(markDef.point) ? markDef.point : {};\n }\n else if (markDef.point !== undefined) {\n // false or null\n return null;\n }\n else {\n // undefined (not disabled)\n if (markConfig.point || encoding.shape) {\n // enable point overlay if config[mark].point is truthy or if encoding.shape is provided\n return isObject(markConfig.point) ? markConfig.point : {};\n }\n // markDef.point is defined as falsy\n return undefined;\n }\n}\nfunction getLineOverlay(markDef, markConfig = {}) {\n if (markDef.line) {\n // true or object\n return markDef.line === true ? {} : markDef.line;\n }\n else if (markDef.line !== undefined) {\n // false or null\n return null;\n }\n else {\n // undefined (not disabled)\n if (markConfig.line) {\n // enable line overlay if config[mark].line is truthy\n return markConfig.line === true ? {} : markConfig.line;\n }\n // markDef.point is defined as falsy\n return undefined;\n }\n}\nexport class PathOverlayNormalizer {\n constructor() {\n this.name = 'path-overlay';\n }\n hasMatchingType(spec, config) {\n if (isUnitSpec(spec)) {\n const { mark, encoding } = spec;\n const markDef = isMarkDef(mark) ? mark : { type: mark };\n switch (markDef.type) {\n case 'line':\n case 'rule':\n case 'trail':\n return !!getPointOverlay(markDef, config[markDef.type], encoding);\n case 'area':\n return (\n // false / null are also included as we want to remove the properties\n !!getPointOverlay(markDef, config[markDef.type], encoding) ||\n !!getLineOverlay(markDef, config[markDef.type]));\n }\n }\n return false;\n }\n run(spec, params, normalize) {\n const { config } = params;\n const { selection, projection, mark, encoding: e } = spec, outerSpec = __rest(spec, [\"selection\", \"projection\", \"mark\", \"encoding\"]);\n // Need to call normalizeEncoding because we need the inferred types to correctly determine stack\n const encoding = normalizeEncoding(e, config);\n const markDef = isMarkDef(mark) ? mark : { type: mark };\n const pointOverlay = getPointOverlay(markDef, config[markDef.type], encoding);\n const lineOverlay = markDef.type === 'area' && getLineOverlay(markDef, config[markDef.type]);\n const layer = [\n Object.assign(Object.assign({}, (selection ? { selection } : {})), { mark: dropLineAndPoint(Object.assign(Object.assign({}, (markDef.type === 'area' && markDef.opacity === undefined && markDef.fillOpacity === undefined\n ? { opacity: 0.7 }\n : {})), markDef)), \n // drop shape from encoding as this might be used to trigger point overlay\n encoding: omit(encoding, ['shape']) })\n ];\n // FIXME: determine rules for applying selections.\n // Need to copy stack config to overlayed layer\n const stackProps = stack(markDef, encoding);\n let overlayEncoding = encoding;\n if (stackProps) {\n const { fieldChannel: stackFieldChannel, offset } = stackProps;\n overlayEncoding = Object.assign(Object.assign({}, encoding), { [stackFieldChannel]: Object.assign(Object.assign({}, encoding[stackFieldChannel]), (offset ? { stack: offset } : {})) });\n }\n if (lineOverlay) {\n layer.push(Object.assign(Object.assign({}, (projection ? { projection } : {})), { mark: Object.assign(Object.assign({ type: 'line' }, pick(markDef, ['clip', 'interpolate', 'tension', 'tooltip'])), lineOverlay), encoding: overlayEncoding }));\n }\n if (pointOverlay) {\n layer.push(Object.assign(Object.assign({}, (projection ? { projection } : {})), { mark: Object.assign(Object.assign({ type: 'point', opacity: 1, filled: true }, pick(markDef, ['clip', 'tooltip'])), pointOverlay), encoding: overlayEncoding }));\n }\n return normalize(Object.assign(Object.assign({}, outerSpec), { layer }), Object.assign(Object.assign({}, params), { config: dropLineAndPointFromConfig(config) }));\n }\n}\n//# sourceMappingURL=pathoverlay.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { getSizeChannel, POSITION_SCALE_CHANNELS } from '../channel';\nimport { isFieldOrDatumDef } from '../channeldef';\nimport * as log from '../log';\nimport { isUnitSpec } from '../spec/unit';\nimport { isEmpty } from '../util';\nexport class RangeStepNormalizer {\n constructor() {\n this.name = 'RangeStep';\n }\n hasMatchingType(spec) {\n var _a;\n if (isUnitSpec(spec) && spec.encoding) {\n for (const channel of POSITION_SCALE_CHANNELS) {\n const def = spec.encoding[channel];\n if (def && isFieldOrDatumDef(def)) {\n if ((_a = def === null || def === void 0 ? void 0 : def.scale) === null || _a === void 0 ? void 0 : _a['rangeStep']) {\n return true;\n }\n }\n }\n }\n return false;\n }\n run(spec) {\n var _a;\n const sizeMixins = {};\n let encoding = Object.assign({}, spec.encoding);\n for (const channel of POSITION_SCALE_CHANNELS) {\n const sizeType = getSizeChannel(channel);\n const def = encoding[channel];\n if (def && isFieldOrDatumDef(def)) {\n if ((_a = def === null || def === void 0 ? void 0 : def.scale) === null || _a === void 0 ? void 0 : _a['rangeStep']) {\n const { scale } = def, defWithoutScale = __rest(def, [\"scale\"]);\n const _b = scale, { rangeStep } = _b, scaleWithoutRangeStep = __rest(_b, [\"rangeStep\"]);\n sizeMixins[sizeType] = { step: scale['rangeStep'] };\n log.warn(log.message.RANGE_STEP_DEPRECATED);\n encoding = Object.assign(Object.assign({}, encoding), { [channel]: Object.assign(Object.assign({}, defWithoutScale), (isEmpty(scaleWithoutRangeStep) ? {} : { scale: scaleWithoutRangeStep })) });\n }\n }\n }\n return Object.assign(Object.assign(Object.assign({}, sizeMixins), spec), { encoding });\n }\n}\n//# sourceMappingURL=rangestep.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { hasOwnProperty, isArray } from 'vega-util';\nimport { hasConditionalFieldOrDatumDef, isConditionalDef, isFieldDef, isFieldOrDatumDef, isRepeatRef, isSortableFieldDef } from '../channeldef';\nimport * as log from '../log';\nimport { isSortField } from '../sort';\nimport { isFacetMapping } from '../spec/facet';\nexport function replaceRepeaterInFacet(facet, repeater) {\n if (!repeater) {\n return facet;\n }\n if (isFacetMapping(facet)) {\n return replaceRepeaterInMapping(facet, repeater);\n }\n return replaceRepeaterInFieldDef(facet, repeater);\n}\nexport function replaceRepeaterInEncoding(encoding, repeater) {\n if (!repeater) {\n return encoding;\n }\n return replaceRepeaterInMapping(encoding, repeater);\n}\n/**\n * Replaces repeated value and returns if the repeated value is valid.\n */\nfunction replaceRepeatInProp(prop, o, repeater) {\n const val = o[prop];\n if (isRepeatRef(val)) {\n if (val.repeat in repeater) {\n return Object.assign(Object.assign({}, o), { [prop]: repeater[val.repeat] });\n }\n else {\n log.warn(log.message.noSuchRepeatedValue(val.repeat));\n return undefined;\n }\n }\n return o;\n}\n/**\n * Replace repeater values in a field def with the concrete field name.\n */\nfunction replaceRepeaterInFieldDef(fieldDef, repeater) {\n fieldDef = replaceRepeatInProp('field', fieldDef, repeater);\n if (fieldDef === undefined) {\n // the field def should be ignored\n return undefined;\n }\n else if (fieldDef === null) {\n return null;\n }\n if (isSortableFieldDef(fieldDef) && isSortField(fieldDef.sort)) {\n const sort = replaceRepeatInProp('field', fieldDef.sort, repeater);\n fieldDef = Object.assign(Object.assign({}, fieldDef), (sort ? { sort } : {}));\n }\n return fieldDef;\n}\nfunction replaceRepeaterInFieldOrDatumDef(def, repeater) {\n if (isFieldDef(def)) {\n return replaceRepeaterInFieldDef(def, repeater);\n }\n else {\n const datumDef = replaceRepeatInProp('datum', def, repeater);\n if (datumDef !== def && !datumDef.type) {\n datumDef.type = 'nominal';\n }\n return datumDef;\n }\n}\nfunction replaceRepeaterInChannelDef(channelDef, repeater) {\n if (isFieldOrDatumDef(channelDef)) {\n const fd = replaceRepeaterInFieldOrDatumDef(channelDef, repeater);\n if (fd) {\n return fd;\n }\n else if (isConditionalDef(channelDef)) {\n return { condition: channelDef.condition };\n }\n }\n else {\n if (hasConditionalFieldOrDatumDef(channelDef)) {\n const fd = replaceRepeaterInFieldOrDatumDef(channelDef.condition, repeater);\n if (fd) {\n return Object.assign(Object.assign({}, channelDef), { condition: fd });\n }\n else {\n const { condition } = channelDef, channelDefWithoutCondition = __rest(channelDef, [\"condition\"]);\n return channelDefWithoutCondition;\n }\n }\n return channelDef;\n }\n return undefined;\n}\nfunction replaceRepeaterInMapping(mapping, repeater) {\n const out = {};\n for (const channel in mapping) {\n if (hasOwnProperty(mapping, channel)) {\n const channelDef = mapping[channel];\n if (isArray(channelDef)) {\n // array cannot have condition\n out[channel] = channelDef // somehow we need to cast it here\n .map(cd => replaceRepeaterInChannelDef(cd, repeater))\n .filter(cd => cd);\n }\n else {\n const cd = replaceRepeaterInChannelDef(channelDef, repeater);\n if (cd !== undefined) {\n out[channel] = cd;\n }\n }\n }\n }\n return out;\n}\n//# sourceMappingURL=repeater.js.map","import { isBinned } from '../bin';\nimport { getMainRangeChannel, SECONDARY_RANGE_CHANNEL } from '../channel';\nimport { isDatumDef, isFieldDef } from '../channeldef';\nimport * as log from '../log';\nimport { isUnitSpec } from '../spec/unit';\nexport class RuleForRangedLineNormalizer {\n constructor() {\n this.name = 'RuleForRangedLine';\n }\n hasMatchingType(spec) {\n if (isUnitSpec(spec)) {\n const { encoding, mark } = spec;\n if (mark === 'line') {\n for (const channel of SECONDARY_RANGE_CHANNEL) {\n const mainChannel = getMainRangeChannel(channel);\n const mainChannelDef = encoding[mainChannel];\n if (encoding[channel]) {\n if ((isFieldDef(mainChannelDef) && !isBinned(mainChannelDef.bin)) || isDatumDef(mainChannelDef)) {\n return true;\n }\n }\n }\n }\n }\n return false;\n }\n run(spec, params, normalize) {\n const { encoding } = spec;\n log.warn(log.message.lineWithRange(!!encoding.x2, !!encoding.y2));\n return normalize(Object.assign(Object.assign({}, spec), { mark: 'rule' }), params);\n }\n}\n//# sourceMappingURL=ruleforrangedline.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray } from 'vega-util';\nimport { COLUMN, FACET, ROW } from '../channel';\nimport { hasConditionalFieldOrDatumDef, isFieldOrDatumDef, isValueDef } from '../channeldef';\nimport { boxPlotNormalizer } from '../compositemark/boxplot';\nimport { errorBandNormalizer } from '../compositemark/errorband';\nimport { errorBarNormalizer } from '../compositemark/errorbar';\nimport { channelHasField } from '../encoding';\nimport * as log from '../log';\nimport { isFacetMapping } from '../spec/facet';\nimport { SpecMapper } from '../spec/map';\nimport { isLayerRepeatSpec } from '../spec/repeat';\nimport { isUnitSpec } from '../spec/unit';\nimport { isEmpty, keys, omit, varName } from '../util';\nimport { isSignalRef } from '../vega.schema';\nimport { PathOverlayNormalizer } from './pathoverlay';\nimport { RangeStepNormalizer } from './rangestep';\nimport { replaceRepeaterInEncoding, replaceRepeaterInFacet } from './repeater';\nimport { RuleForRangedLineNormalizer } from './ruleforrangedline';\nexport class CoreNormalizer extends SpecMapper {\n constructor() {\n super(...arguments);\n this.nonFacetUnitNormalizers = [\n boxPlotNormalizer,\n errorBarNormalizer,\n errorBandNormalizer,\n new PathOverlayNormalizer(),\n new RuleForRangedLineNormalizer(),\n new RangeStepNormalizer()\n ];\n }\n map(spec, params) {\n // Special handling for a faceted unit spec as it can return a facet spec, not just a layer or unit spec like a normal unit spec.\n if (isUnitSpec(spec)) {\n const hasRow = channelHasField(spec.encoding, ROW);\n const hasColumn = channelHasField(spec.encoding, COLUMN);\n const hasFacet = channelHasField(spec.encoding, FACET);\n if (hasRow || hasColumn || hasFacet) {\n return this.mapFacetedUnit(spec, params);\n }\n }\n return super.map(spec, params);\n }\n // This is for normalizing non-facet unit\n mapUnit(spec, params) {\n const { parentEncoding, parentProjection } = params;\n const encoding = replaceRepeaterInEncoding(spec.encoding, params.repeater);\n const specWithReplacedEncoding = Object.assign(Object.assign({}, spec), (encoding ? { encoding } : {}));\n if (parentEncoding || parentProjection) {\n return this.mapUnitWithParentEncodingOrProjection(specWithReplacedEncoding, params);\n }\n const normalizeLayerOrUnit = this.mapLayerOrUnit.bind(this);\n for (const unitNormalizer of this.nonFacetUnitNormalizers) {\n if (unitNormalizer.hasMatchingType(specWithReplacedEncoding, params.config)) {\n return unitNormalizer.run(specWithReplacedEncoding, params, normalizeLayerOrUnit);\n }\n }\n return specWithReplacedEncoding;\n }\n mapRepeat(spec, params) {\n if (isLayerRepeatSpec(spec)) {\n return this.mapLayerRepeat(spec, params);\n }\n else {\n return this.mapNonLayerRepeat(spec, params);\n }\n }\n mapLayerRepeat(spec, params) {\n const { repeat, spec: childSpec } = spec, rest = __rest(spec, [\"repeat\", \"spec\"]);\n const { row, column, layer } = repeat;\n const { repeater = {}, repeaterPrefix = '' } = params;\n if (row || column) {\n return this.mapRepeat(Object.assign(Object.assign({}, spec), { repeat: Object.assign(Object.assign({}, (row ? { row } : {})), (column ? { column } : {})), spec: {\n repeat: { layer },\n spec: childSpec\n } }), params);\n }\n else {\n return Object.assign(Object.assign({}, rest), { layer: layer.map(layerValue => {\n const childRepeater = Object.assign(Object.assign({}, repeater), { layer: layerValue });\n const childName = (childSpec.name || '') + repeaterPrefix + `child__layer_${varName(layerValue)}`;\n const child = this.mapLayerOrUnit(childSpec, Object.assign(Object.assign({}, params), { repeater: childRepeater, repeaterPrefix: childName }));\n child.name = childName;\n return child;\n }) });\n }\n }\n mapNonLayerRepeat(spec, params) {\n var _a;\n const { repeat, spec: childSpec, data } = spec, remainingProperties = __rest(spec, [\"repeat\", \"spec\", \"data\"]);\n if (!isArray(repeat) && spec.columns) {\n // is repeat with row/column\n spec = omit(spec, ['columns']);\n log.warn(log.message.columnsNotSupportByRowCol('repeat'));\n }\n const concat = [];\n const { repeater = {}, repeaterPrefix = '' } = params;\n const row = (!isArray(repeat) && repeat.row) || [repeater ? repeater.row : null];\n const column = (!isArray(repeat) && repeat.column) || [repeater ? repeater.column : null];\n const repeatValues = (isArray(repeat) && repeat) || [repeater ? repeater.repeat : null];\n // cross product\n for (const repeatValue of repeatValues) {\n for (const rowValue of row) {\n for (const columnValue of column) {\n const childRepeater = {\n repeat: repeatValue,\n row: rowValue,\n column: columnValue,\n layer: repeater.layer\n };\n const childName = (childSpec.name || '') +\n repeaterPrefix +\n 'child__' +\n (isArray(repeat)\n ? `${varName(repeatValue)}`\n : (repeat.row ? `row_${varName(rowValue)}` : '') +\n (repeat.column ? `column_${varName(columnValue)}` : ''));\n const child = this.map(childSpec, Object.assign(Object.assign({}, params), { repeater: childRepeater, repeaterPrefix: childName }));\n child.name = childName;\n // we move data up\n concat.push(omit(child, ['data']));\n }\n }\n }\n const columns = isArray(repeat) ? spec.columns : repeat.column ? repeat.column.length : 1;\n return Object.assign(Object.assign({ data: (_a = childSpec.data) !== null && _a !== void 0 ? _a : data, align: 'all' }, remainingProperties), { columns,\n concat });\n }\n mapFacet(spec, params) {\n const { facet } = spec;\n if (isFacetMapping(facet) && spec.columns) {\n // is facet with row/column\n spec = omit(spec, ['columns']);\n log.warn(log.message.columnsNotSupportByRowCol('facet'));\n }\n return super.mapFacet(spec, params);\n }\n mapUnitWithParentEncodingOrProjection(spec, params) {\n const { encoding, projection } = spec;\n const { parentEncoding, parentProjection, config } = params;\n const mergedProjection = mergeProjection({ parentProjection, projection });\n const mergedEncoding = mergeEncoding({\n parentEncoding,\n encoding: replaceRepeaterInEncoding(encoding, params.repeater)\n });\n return this.mapUnit(Object.assign(Object.assign(Object.assign({}, spec), (mergedProjection ? { projection: mergedProjection } : {})), (mergedEncoding ? { encoding: mergedEncoding } : {})), { config });\n }\n mapFacetedUnit(spec, params) {\n // New encoding in the inside spec should not contain row / column\n // as row/column should be moved to facet\n const _a = spec.encoding, { row, column, facet } = _a, encoding = __rest(_a, [\"row\", \"column\", \"facet\"]);\n // Mark and encoding should be moved into the inner spec\n const { mark, width, projection, height, view, selection, encoding: _ } = spec, outerSpec = __rest(spec, [\"mark\", \"width\", \"projection\", \"height\", \"view\", \"selection\", \"encoding\"]);\n const { facetMapping, layout } = this.getFacetMappingAndLayout({ row, column, facet }, params);\n const newEncoding = replaceRepeaterInEncoding(encoding, params.repeater);\n return this.mapFacet(Object.assign(Object.assign(Object.assign({}, outerSpec), layout), { \n // row / column has higher precedence than facet\n facet: facetMapping, spec: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (width ? { width } : {})), (height ? { height } : {})), (view ? { view } : {})), (projection ? { projection } : {})), { mark, encoding: newEncoding }), (selection ? { selection } : {})) }), params);\n }\n getFacetMappingAndLayout(facets, params) {\n var _a;\n const { row, column, facet } = facets;\n if (row || column) {\n if (facet) {\n log.warn(log.message.facetChannelDropped([...(row ? [ROW] : []), ...(column ? [COLUMN] : [])]));\n }\n const facetMapping = {};\n const layout = {};\n for (const channel of [ROW, COLUMN]) {\n const def = facets[channel];\n if (def) {\n const { align, center, spacing, columns } = def, defWithoutLayout = __rest(def, [\"align\", \"center\", \"spacing\", \"columns\"]);\n facetMapping[channel] = defWithoutLayout;\n for (const prop of ['align', 'center', 'spacing']) {\n if (def[prop] !== undefined) {\n layout[prop] = (_a = layout[prop]) !== null && _a !== void 0 ? _a : {};\n layout[prop][channel] = def[prop];\n }\n }\n }\n }\n return { facetMapping, layout };\n }\n else {\n const { align, center, spacing, columns } = facet, facetMapping = __rest(facet, [\"align\", \"center\", \"spacing\", \"columns\"]);\n return {\n facetMapping: replaceRepeaterInFacet(facetMapping, params.repeater),\n layout: Object.assign(Object.assign(Object.assign(Object.assign({}, (align ? { align } : {})), (center ? { center } : {})), (spacing ? { spacing } : {})), (columns ? { columns } : {}))\n };\n }\n }\n mapLayer(spec, _a) {\n // Special handling for extended layer spec\n var { parentEncoding, parentProjection } = _a, otherParams = __rest(_a, [\"parentEncoding\", \"parentProjection\"]);\n const { encoding, projection } = spec, rest = __rest(spec, [\"encoding\", \"projection\"]);\n const params = Object.assign(Object.assign({}, otherParams), { parentEncoding: mergeEncoding({ parentEncoding, encoding, layer: true }), parentProjection: mergeProjection({ parentProjection, projection }) });\n return super.mapLayer(rest, params);\n }\n}\nfunction mergeEncoding({ parentEncoding, encoding = {}, layer }) {\n let merged = {};\n if (parentEncoding) {\n const channels = new Set([...keys(parentEncoding), ...keys(encoding)]);\n for (const channel of channels) {\n const channelDef = encoding[channel];\n const parentChannelDef = parentEncoding[channel];\n if (isFieldOrDatumDef(channelDef)) {\n // Field/Datum Def can inherit properties from its parent\n // Note that parentChannelDef doesn't have to be a field/datum def if the channelDef is already one.\n const mergedChannelDef = Object.assign(Object.assign({}, parentChannelDef), channelDef);\n merged[channel] = mergedChannelDef;\n }\n else if (hasConditionalFieldOrDatumDef(channelDef)) {\n merged[channel] = Object.assign(Object.assign({}, channelDef), { condition: Object.assign(Object.assign({}, parentChannelDef), channelDef.condition) });\n }\n else if (channelDef || channelDef === null) {\n merged[channel] = channelDef;\n }\n else if (layer ||\n isValueDef(parentChannelDef) ||\n isSignalRef(parentChannelDef) ||\n isFieldOrDatumDef(parentChannelDef) ||\n isArray(parentChannelDef)) {\n merged[channel] = parentChannelDef;\n }\n }\n }\n else {\n merged = encoding;\n }\n return !merged || isEmpty(merged) ? undefined : merged;\n}\nfunction mergeProjection(opt) {\n const { parentProjection, projection } = opt;\n if (parentProjection && projection) {\n log.warn(log.message.projectionOverridden({ parentProjection, projection }));\n }\n return projection !== null && projection !== void 0 ? projection : parentProjection;\n}\n//# sourceMappingURL=core.js.map","import { isString } from 'vega-util';\nimport { initConfig } from '../config';\nimport * as log from '../log';\nimport { isLayerSpec, isUnitSpec } from '../spec';\nimport { deepEqual } from '../util';\nimport { CoreNormalizer } from './core';\nexport function normalize(spec, config) {\n if (config === undefined) {\n config = initConfig(spec.config);\n }\n const normalizedSpec = normalizeGenericSpec(spec, config);\n const { width, height } = spec;\n const autosize = normalizeAutoSize(normalizedSpec, { width, height, autosize: spec.autosize }, config);\n return Object.assign(Object.assign({}, normalizedSpec), (autosize ? { autosize } : {}));\n}\nconst normalizer = new CoreNormalizer();\n/**\n * Decompose extended unit specs into composition of pure unit specs.\n */\nfunction normalizeGenericSpec(spec, config = {}) {\n return normalizer.map(spec, { config });\n}\nfunction _normalizeAutoSize(autosize) {\n return isString(autosize) ? { type: autosize } : autosize !== null && autosize !== void 0 ? autosize : {};\n}\n/**\n * Normalize autosize and deal with width or height == \"container\".\n */\nexport function normalizeAutoSize(spec, sizeInfo, config) {\n let { width, height } = sizeInfo;\n const isFitCompatible = isUnitSpec(spec) || isLayerSpec(spec);\n const autosizeDefault = {};\n if (!isFitCompatible) {\n // If spec is not compatible with autosize == \"fit\", discard width/height == container\n if (width == 'container') {\n log.warn(log.message.containerSizeNonSingle('width'));\n width = undefined;\n }\n if (height == 'container') {\n log.warn(log.message.containerSizeNonSingle('height'));\n height = undefined;\n }\n }\n else {\n // Default autosize parameters to fit when width/height is \"container\"\n if (width == 'container' && height == 'container') {\n autosizeDefault.type = 'fit';\n autosizeDefault.contains = 'padding';\n }\n else if (width == 'container') {\n autosizeDefault.type = 'fit-x';\n autosizeDefault.contains = 'padding';\n }\n else if (height == 'container') {\n autosizeDefault.type = 'fit-y';\n autosizeDefault.contains = 'padding';\n }\n }\n const autosize = Object.assign(Object.assign(Object.assign({ type: 'pad' }, autosizeDefault), (config ? _normalizeAutoSize(config.autosize) : {})), _normalizeAutoSize(spec.autosize));\n if (autosize.type === 'fit' && !isFitCompatible) {\n log.warn(log.message.FIT_NON_SINGLE);\n autosize.type = 'pad';\n }\n if (width == 'container' && !(autosize.type == 'fit' || autosize.type == 'fit-x')) {\n log.warn(log.message.containerSizeNotCompatibleWithAutosize('width'));\n }\n if (height == 'container' && !(autosize.type == 'fit' || autosize.type == 'fit-y')) {\n log.warn(log.message.containerSizeNotCompatibleWithAutosize('height'));\n }\n // Delete autosize property if it's Vega's default\n if (deepEqual(autosize, { type: 'pad' })) {\n return undefined;\n }\n return autosize;\n}\n//# sourceMappingURL=index.js.map","import { getPositionScaleChannel } from '../channel';\nimport { signalRefOrValue } from '../compile/common';\nexport function isFitType(autoSizeType) {\n return autoSizeType === 'fit' || autoSizeType === 'fit-x' || autoSizeType === 'fit-y';\n}\nexport function getFitType(sizeType) {\n return sizeType ? `fit-${getPositionScaleChannel(sizeType)}` : 'fit';\n}\nconst TOP_LEVEL_PROPERTIES = [\n 'background',\n 'padding'\n // We do not include \"autosize\" here as it is supported by only unit and layer specs and thus need to be normalized\n];\nexport function extractTopLevelProperties(t, includeParams) {\n const o = {};\n for (const p of TOP_LEVEL_PROPERTIES) {\n if (t && t[p] !== undefined) {\n o[p] = signalRefOrValue(t[p]);\n }\n }\n if (includeParams) {\n o.params = t.params;\n }\n return o;\n}\n//# sourceMappingURL=toplevel.js.map","import * as log from '../log';\nimport { deepEqual, duplicate, getFirstDefined, keys } from '../util';\n/**\n * Generic class for storing properties that are explicitly specified\n * and implicitly determined by the compiler.\n * This is important for scale/axis/legend merging as\n * we want to prioritize properties that users explicitly specified.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport class Split {\n constructor(explicit = {}, implicit = {}) {\n this.explicit = explicit;\n this.implicit = implicit;\n }\n clone() {\n return new Split(duplicate(this.explicit), duplicate(this.implicit));\n }\n combine() {\n // FIXME remove \"as any\".\n // Add \"as any\" to avoid an error \"Spread types may only be created from object types\".\n return Object.assign(Object.assign({}, this.explicit), this.implicit);\n }\n get(key) {\n // Explicit has higher precedence\n return getFirstDefined(this.explicit[key], this.implicit[key]);\n }\n getWithExplicit(key) {\n // Explicit has higher precedence\n if (this.explicit[key] !== undefined) {\n return { explicit: true, value: this.explicit[key] };\n }\n else if (this.implicit[key] !== undefined) {\n return { explicit: false, value: this.implicit[key] };\n }\n return { explicit: false, value: undefined };\n }\n setWithExplicit(key, value) {\n if (value.value !== undefined) {\n this.set(key, value.value, value.explicit);\n }\n }\n set(key, value, explicit) {\n delete this[explicit ? 'implicit' : 'explicit'][key];\n this[explicit ? 'explicit' : 'implicit'][key] = value;\n return this;\n }\n copyKeyFromSplit(key, s) {\n // Explicit has higher precedence\n if (s.explicit[key] !== undefined) {\n this.set(key, s.explicit[key], true);\n }\n else if (s.implicit[key] !== undefined) {\n this.set(key, s.implicit[key], false);\n }\n }\n copyKeyFromObject(key, s) {\n // Explicit has higher precedence\n if (s[key] !== undefined) {\n this.set(key, s[key], true);\n }\n }\n /**\n * Merge split object into this split object. Properties from the other split\n * overwrite properties from this split.\n */\n copyAll(other) {\n for (const key of keys(other.combine())) {\n const val = other.getWithExplicit(key);\n this.setWithExplicit(key, val);\n }\n }\n}\nexport function makeExplicit(value) {\n return {\n explicit: true,\n value\n };\n}\nexport function makeImplicit(value) {\n return {\n explicit: false,\n value\n };\n}\nexport function tieBreakByComparing(compare) {\n return (v1, v2, property, propertyOf) => {\n const diff = compare(v1.value, v2.value);\n if (diff > 0) {\n return v1;\n }\n else if (diff < 0) {\n return v2;\n }\n return defaultTieBreaker(v1, v2, property, propertyOf);\n };\n}\nexport function defaultTieBreaker(v1, v2, property, propertyOf) {\n if (v1.explicit && v2.explicit) {\n log.warn(log.message.mergeConflictingProperty(property, propertyOf, v1.value, v2.value));\n }\n // If equal score, prefer v1.\n return v1;\n}\nexport function mergeValuesWithExplicit(v1, v2, property, propertyOf, tieBreaker = defaultTieBreaker) {\n if (v1 === undefined || v1.value === undefined) {\n // For first run\n return v2;\n }\n if (v1.explicit && !v2.explicit) {\n return v1;\n }\n else if (v2.explicit && !v1.explicit) {\n return v2;\n }\n else if (deepEqual(v1.value, v2.value)) {\n return v1;\n }\n else {\n return tieBreaker(v1, v2, property, propertyOf);\n }\n}\n//# sourceMappingURL=split.js.map","import { Split } from '../split';\n/**\n * Class to track interesting properties (see https://15721.courses.cs.cmu.edu/spring2016/papers/graefe-ieee1995.pdf)\n * about how fields have been parsed or whether they have been derived in a transform. We use this to not parse the\n * same field again (or differently).\n */\nexport class AncestorParse extends Split {\n constructor(explicit = {}, implicit = {}, parseNothing = false) {\n super(explicit, implicit);\n this.explicit = explicit;\n this.implicit = implicit;\n this.parseNothing = parseNothing;\n }\n clone() {\n const clone = super.clone();\n clone.parseNothing = this.parseNothing;\n return clone;\n }\n}\n//# sourceMappingURL=index.js.map","export function isUrlData(data) {\n return 'url' in data;\n}\nexport function isInlineData(data) {\n return 'values' in data;\n}\nexport function isNamedData(data) {\n return 'name' in data && !isUrlData(data) && !isInlineData(data) && !isGenerator(data);\n}\nexport function isGenerator(data) {\n return data && (isSequenceGenerator(data) || isSphereGenerator(data) || isGraticuleGenerator(data));\n}\nexport function isSequenceGenerator(data) {\n return 'sequence' in data;\n}\nexport function isSphereGenerator(data) {\n return 'sphere' in data;\n}\nexport function isGraticuleGenerator(data) {\n return 'graticule' in data;\n}\nexport var DataSourceType;\n(function (DataSourceType) {\n DataSourceType[DataSourceType[\"Raw\"] = 0] = \"Raw\";\n DataSourceType[DataSourceType[\"Main\"] = 1] = \"Main\";\n DataSourceType[DataSourceType[\"Row\"] = 2] = \"Row\";\n DataSourceType[DataSourceType[\"Column\"] = 3] = \"Column\";\n DataSourceType[DataSourceType[\"Lookup\"] = 4] = \"Lookup\";\n})(DataSourceType || (DataSourceType = {}));\n//# sourceMappingURL=data.js.map","import { normalizeLogicalComposition } from './logical';\nimport { normalizePredicate } from './predicate';\nexport function isFilter(t) {\n return 'filter' in t;\n}\nexport function isImputeSequence(t) {\n return (t === null || t === void 0 ? void 0 : t['stop']) !== undefined;\n}\nexport function isLookup(t) {\n return 'lookup' in t;\n}\nexport function isLookupData(from) {\n return 'data' in from;\n}\nexport function isLookupSelection(from) {\n return 'selection' in from;\n}\nexport function isPivot(t) {\n return 'pivot' in t;\n}\nexport function isDensity(t) {\n return 'density' in t;\n}\nexport function isQuantile(t) {\n return 'quantile' in t;\n}\nexport function isRegression(t) {\n return 'regression' in t;\n}\nexport function isLoess(t) {\n return 'loess' in t;\n}\nexport function isSample(t) {\n return 'sample' in t;\n}\nexport function isWindow(t) {\n return 'window' in t;\n}\nexport function isJoinAggregate(t) {\n return 'joinaggregate' in t;\n}\nexport function isFlatten(t) {\n return 'flatten' in t;\n}\nexport function isCalculate(t) {\n return 'calculate' in t;\n}\nexport function isBin(t) {\n return 'bin' in t;\n}\nexport function isImpute(t) {\n return 'impute' in t;\n}\nexport function isTimeUnit(t) {\n return 'timeUnit' in t;\n}\nexport function isAggregate(t) {\n return 'aggregate' in t;\n}\nexport function isStack(t) {\n return 'stack' in t;\n}\nexport function isFold(t) {\n return 'fold' in t;\n}\nexport function normalizeTransform(transform) {\n return transform.map(t => {\n if (isFilter(t)) {\n return {\n filter: normalizeLogicalComposition(t.filter, normalizePredicate)\n };\n }\n return t;\n });\n}\n//# sourceMappingURL=transform.js.map","const VIEW = 'view',\n LBRACK = '[',\n RBRACK = ']',\n LBRACE = '{',\n RBRACE = '}',\n COLON = ':',\n COMMA = ',',\n NAME = '@',\n GT = '>',\n ILLEGAL = /[[\\]{}]/,\n DEFAULT_MARKS = {\n '*': 1,\n arc: 1,\n area: 1,\n group: 1,\n image: 1,\n line: 1,\n path: 1,\n rect: 1,\n rule: 1,\n shape: 1,\n symbol: 1,\n text: 1,\n trail: 1\n};\nlet DEFAULT_SOURCE, MARKS;\n/**\n * Parse an event selector string.\n * Returns an array of event stream definitions.\n */\n\nfunction eventSelector (selector, source, marks) {\n DEFAULT_SOURCE = source || VIEW;\n MARKS = marks || DEFAULT_MARKS;\n return parseMerge(selector.trim()).map(parseSelector);\n}\n\nfunction isMarkType(type) {\n return MARKS[type];\n}\n\nfunction find(s, i, endChar, pushChar, popChar) {\n const n = s.length;\n let count = 0,\n c;\n\n for (; i < n; ++i) {\n c = s[i];\n if (!count && c === endChar) return i;else if (popChar && popChar.indexOf(c) >= 0) --count;else if (pushChar && pushChar.indexOf(c) >= 0) ++count;\n }\n\n return i;\n}\n\nfunction parseMerge(s) {\n const output = [],\n n = s.length;\n let start = 0,\n i = 0;\n\n while (i < n) {\n i = find(s, i, COMMA, LBRACK + LBRACE, RBRACK + RBRACE);\n output.push(s.substring(start, i).trim());\n start = ++i;\n }\n\n if (output.length === 0) {\n throw 'Empty event selector: ' + s;\n }\n\n return output;\n}\n\nfunction parseSelector(s) {\n return s[0] === '[' ? parseBetween(s) : parseStream(s);\n}\n\nfunction parseBetween(s) {\n const n = s.length;\n let i = 1,\n b;\n i = find(s, i, RBRACK, LBRACK, RBRACK);\n\n if (i === n) {\n throw 'Empty between selector: ' + s;\n }\n\n b = parseMerge(s.substring(1, i));\n\n if (b.length !== 2) {\n throw 'Between selector must have two elements: ' + s;\n }\n\n s = s.slice(i + 1).trim();\n\n if (s[0] !== GT) {\n throw 'Expected \\'>\\' after between selector: ' + s;\n }\n\n b = b.map(parseSelector);\n const stream = parseSelector(s.slice(1).trim());\n\n if (stream.between) {\n return {\n between: b,\n stream: stream\n };\n } else {\n stream.between = b;\n }\n\n return stream;\n}\n\nfunction parseStream(s) {\n const stream = {\n source: DEFAULT_SOURCE\n },\n source = [];\n let throttle = [0, 0],\n markname = 0,\n start = 0,\n n = s.length,\n i = 0,\n j,\n filter; // extract throttle from end\n\n if (s[n - 1] === RBRACE) {\n i = s.lastIndexOf(LBRACE);\n\n if (i >= 0) {\n try {\n throttle = parseThrottle(s.substring(i + 1, n - 1));\n } catch (e) {\n throw 'Invalid throttle specification: ' + s;\n }\n\n s = s.slice(0, i).trim();\n n = s.length;\n } else throw 'Unmatched right brace: ' + s;\n\n i = 0;\n }\n\n if (!n) throw s; // set name flag based on first char\n\n if (s[0] === NAME) markname = ++i; // extract first part of multi-part stream selector\n\n j = find(s, i, COLON);\n\n if (j < n) {\n source.push(s.substring(start, j).trim());\n start = i = ++j;\n } // extract remaining part of stream selector\n\n\n i = find(s, i, LBRACK);\n\n if (i === n) {\n source.push(s.substring(start, n).trim());\n } else {\n source.push(s.substring(start, i).trim());\n filter = [];\n start = ++i;\n if (start === n) throw 'Unmatched left bracket: ' + s;\n } // extract filters\n\n\n while (i < n) {\n i = find(s, i, RBRACK);\n if (i === n) throw 'Unmatched left bracket: ' + s;\n filter.push(s.substring(start, i).trim());\n if (i < n - 1 && s[++i] !== LBRACK) throw 'Expected left bracket: ' + s;\n start = ++i;\n } // marshall event stream specification\n\n\n if (!(n = source.length) || ILLEGAL.test(source[n - 1])) {\n throw 'Invalid event selector: ' + s;\n }\n\n if (n > 1) {\n stream.type = source[1];\n\n if (markname) {\n stream.markname = source[0].slice(1);\n } else if (isMarkType(source[0])) {\n stream.marktype = source[0];\n } else {\n stream.source = source[0];\n }\n } else {\n stream.type = source[0];\n }\n\n if (stream.type.slice(-1) === '!') {\n stream.consume = true;\n stream.type = stream.type.slice(0, -1);\n }\n\n if (filter != null) stream.filter = filter;\n if (throttle[0]) stream.throttle = throttle[0];\n if (throttle[1]) stream.debounce = throttle[1];\n return stream;\n}\n\nfunction parseThrottle(s) {\n const a = s.split(COMMA);\n if (!s.length || a.length > 2) throw s;\n return a.map(_ => {\n const x = +_;\n if (x !== x) throw s;\n return x;\n });\n}\n\nexport { eventSelector as selector };\n","import { array } from 'vega-util';\nimport { isConditionalDef, isConditionalSelection } from '../../../channeldef';\nimport { expression } from '../../predicate';\nimport { parseSelectionPredicate } from '../../selection/parse';\n/**\n * Return a mixin that includes a Vega production rule for a Vega-Lite conditional channel definition\n * or a simple mixin if channel def has no condition.\n */\nexport function wrapCondition(model, channelDef, vgChannel, refFn) {\n const condition = isConditionalDef(channelDef) && channelDef.condition;\n const valueRef = refFn(channelDef);\n if (condition) {\n const conditions = array(condition);\n const vgConditions = conditions.map(c => {\n const conditionValueRef = refFn(c);\n const test = isConditionalSelection(c)\n ? parseSelectionPredicate(model, c.selection) // FIXME: remove casting once TS is no longer dumb about it\n : expression(model, c.test); // FIXME: remove casting once TS is no longer dumb about it\n return Object.assign({ test }, conditionValueRef);\n });\n return {\n [vgChannel]: [...vgConditions, ...(valueRef !== undefined ? [valueRef] : [])]\n };\n }\n else {\n return valueRef !== undefined ? { [vgChannel]: valueRef } : {};\n }\n}\n//# sourceMappingURL=conditional.js.map","import { getFormatMixins, isFieldOrDatumDef, isValueDef } from '../../../channeldef';\nimport { signalOrValueRef } from '../../common';\nimport { formatSignalRef } from '../../format';\nimport { wrapCondition } from './conditional';\nexport function text(model, channel = 'text') {\n const channelDef = model.encoding[channel];\n return wrapCondition(model, channelDef, channel, cDef => textRef(cDef, model.config));\n}\nexport function textRef(channelDef, config, expr = 'datum') {\n // text\n if (channelDef) {\n if (isValueDef(channelDef)) {\n return signalOrValueRef(channelDef.value);\n }\n if (isFieldOrDatumDef(channelDef)) {\n const { format, formatType } = getFormatMixins(channelDef);\n return formatSignalRef({ fieldOrDatumDef: channelDef, format, formatType, expr, config });\n }\n }\n return undefined;\n}\n//# sourceMappingURL=text.js.map","import { array, isArray, isObject, isString } from 'vega-util';\nimport { isBinned } from '../../../bin';\nimport { getMainRangeChannel, isXorY } from '../../../channel';\nimport { defaultTitle, getFieldDef, getFormatMixins, hasConditionalFieldDef, isFieldDef, isTypedFieldDef, vgField } from '../../../channeldef';\nimport { forEach } from '../../../encoding';\nimport { entries } from '../../../util';\nimport { isSignalRef } from '../../../vega.schema';\nimport { getMarkPropOrConfig } from '../../common';\nimport { binFormatExpression, formatSignalRef } from '../../format';\nimport { wrapCondition } from './conditional';\nimport { textRef } from './text';\nexport function tooltip(model, opt = {}) {\n const { encoding, markDef, config, stack } = model;\n const channelDef = encoding.tooltip;\n if (isArray(channelDef)) {\n return { tooltip: tooltipRefForEncoding({ tooltip: channelDef }, stack, config, opt) };\n }\n else {\n const datum = opt.reactiveGeom ? 'datum.datum' : 'datum';\n return wrapCondition(model, channelDef, 'tooltip', cDef => {\n // use valueRef based on channelDef first\n const tooltipRefFromChannelDef = textRef(cDef, config, datum);\n if (tooltipRefFromChannelDef) {\n return tooltipRefFromChannelDef;\n }\n if (cDef === null) {\n // Allow using encoding.tooltip = null to disable tooltip\n return undefined;\n }\n let markTooltip = getMarkPropOrConfig('tooltip', markDef, config);\n if (markTooltip === true) {\n markTooltip = { content: 'encoding' };\n }\n if (isString(markTooltip)) {\n return { value: markTooltip };\n }\n else if (isObject(markTooltip)) {\n // `tooltip` is `{fields: 'encodings' | 'fields'}`\n if (isSignalRef(markTooltip)) {\n return markTooltip;\n }\n else if (markTooltip.content === 'encoding') {\n return tooltipRefForEncoding(encoding, stack, config, opt);\n }\n else {\n return { signal: datum };\n }\n }\n return undefined;\n });\n }\n}\nexport function tooltipData(encoding, stack, config, { reactiveGeom } = {}) {\n const toSkip = {};\n const expr = reactiveGeom ? 'datum.datum' : 'datum';\n const tuples = [];\n function add(fDef, channel) {\n const mainChannel = getMainRangeChannel(channel);\n const fieldDef = isTypedFieldDef(fDef)\n ? fDef\n : Object.assign(Object.assign({}, fDef), { type: encoding[mainChannel].type // for secondary field def, copy type from main channel\n });\n const title = fieldDef.title || defaultTitle(fieldDef, config);\n const key = array(title).join(', ');\n let value;\n if (isXorY(channel)) {\n const channel2 = channel === 'x' ? 'x2' : 'y2';\n const fieldDef2 = getFieldDef(encoding[channel2]);\n if (isBinned(fieldDef.bin) && fieldDef2) {\n const startField = vgField(fieldDef, { expr });\n const endField = vgField(fieldDef2, { expr });\n const { format, formatType } = getFormatMixins(fieldDef);\n value = binFormatExpression(startField, endField, format, formatType, config);\n toSkip[channel2] = true;\n }\n else if (stack && stack.fieldChannel === channel && stack.offset === 'normalize') {\n const { format, formatType } = getFormatMixins(fieldDef);\n value = formatSignalRef({ fieldOrDatumDef: fieldDef, format, formatType, expr, config, normalizeStack: true })\n .signal;\n }\n }\n value = value !== null && value !== void 0 ? value : textRef(fieldDef, config, expr).signal;\n tuples.push({ channel, key, value });\n }\n forEach(encoding, (channelDef, channel) => {\n if (isFieldDef(channelDef)) {\n add(channelDef, channel);\n }\n else if (hasConditionalFieldDef(channelDef)) {\n add(channelDef.condition, channel);\n }\n });\n const out = {};\n for (const { channel, key, value } of tuples) {\n if (!toSkip[channel] && !out[key]) {\n out[key] = value;\n }\n }\n return out;\n}\nexport function tooltipRefForEncoding(encoding, stack, config, { reactiveGeom } = {}) {\n const data = tooltipData(encoding, stack, config, { reactiveGeom });\n const keyValues = entries(data).map(([key, value]) => `\"${key}\": ${value}`);\n return keyValues.length > 0 ? { signal: `{${keyValues.join(', ')}}` } : undefined;\n}\n//# sourceMappingURL=tooltip.js.map","import { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { wrapCondition } from './conditional';\nimport * as ref from './valueref';\n/**\n * Return encode for non-positional channels with scales. (Text doesn't have scale.)\n */\nexport function nonPosition(channel, model, opt = {}) {\n const { markDef, encoding, config } = model;\n const { vgChannel } = opt;\n let { defaultRef, defaultValue } = opt;\n if (defaultRef === undefined) {\n // prettier-ignore\n defaultValue = defaultValue !== null && defaultValue !== void 0 ? defaultValue : getMarkPropOrConfig(channel, markDef, config, { vgChannel, ignoreVgConfig: true });\n if (defaultValue !== undefined) {\n defaultRef = signalOrValueRef(defaultValue);\n }\n }\n const channelDef = encoding[channel];\n return wrapCondition(model, channelDef, vgChannel !== null && vgChannel !== void 0 ? vgChannel : channel, cDef => {\n return ref.midPoint({\n channel,\n channelDef: cDef,\n markDef,\n config,\n scaleName: model.scaleName(channel),\n scale: model.getScaleComponent(channel),\n stack: null,\n defaultRef\n });\n });\n}\n//# sourceMappingURL=nonposition.js.map","import * as log from '../../../log';\nimport { contains } from '../../../util';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { nonPosition } from './nonposition';\nexport function color(model, opt = { filled: undefined }) {\n var _a, _b, _c, _d;\n const { markDef, encoding, config } = model;\n const { type: markType } = markDef;\n // Allow filled to be overridden (for trail's \"filled\")\n const filled = (_a = opt.filled) !== null && _a !== void 0 ? _a : getMarkPropOrConfig('filled', markDef, config);\n const transparentIfNeeded = contains(['bar', 'point', 'circle', 'square', 'geoshape'], markType)\n ? 'transparent'\n : undefined;\n const defaultFill = (_c = (_b = getMarkPropOrConfig(filled === true ? 'color' : undefined, markDef, config, { vgChannel: 'fill' })) !== null && _b !== void 0 ? _b : \n // need to add this manually as getMarkConfig normally drops config.mark[channel] if vgChannel is specified\n config.mark[filled === true && 'color']) !== null && _c !== void 0 ? _c : \n // If there is no fill, always fill symbols, bar, geoshape\n // with transparent fills https://github.com/vega/vega-lite/issues/1316\n transparentIfNeeded;\n const defaultStroke = (_d = getMarkPropOrConfig(filled === false ? 'color' : undefined, markDef, config, { vgChannel: 'stroke' })) !== null && _d !== void 0 ? _d : \n // need to add this manually as getMarkConfig normally drops config.mark[channel] if vgChannel is specified\n config.mark[filled === false && 'color'];\n const colorVgChannel = filled ? 'fill' : 'stroke';\n const fillStrokeMarkDefAndConfig = Object.assign(Object.assign({}, (defaultFill ? { fill: signalOrValueRef(defaultFill) } : {})), (defaultStroke ? { stroke: signalOrValueRef(defaultStroke) } : {}));\n if (markDef.color && (filled ? markDef.fill : markDef.stroke)) {\n log.warn(log.message.droppingColor('property', { fill: 'fill' in markDef, stroke: 'stroke' in markDef }));\n }\n return Object.assign(Object.assign(Object.assign(Object.assign({}, fillStrokeMarkDefAndConfig), nonPosition('color', model, {\n vgChannel: colorVgChannel,\n defaultValue: filled ? defaultFill : defaultStroke\n })), nonPosition('fill', model, {\n // if there is encoding.fill, include default fill just in case we have conditional-only fill encoding\n defaultValue: encoding.fill ? defaultFill : undefined\n })), nonPosition('stroke', model, {\n // if there is encoding.stroke, include default fill just in case we have conditional-only stroke encoding\n defaultValue: encoding.stroke ? defaultStroke : undefined\n }));\n}\n//# sourceMappingURL=color.js.map","import { getOffsetChannel } from '../../../channel';\nexport function getOffset(channel, markDef) {\n const offsetChannel = getOffsetChannel(channel);\n // TODO: in the future read from encoding channel too\n const markDefOffsetValue = markDef[offsetChannel];\n if (markDefOffsetValue) {\n return markDefOffsetValue;\n }\n return undefined;\n}\n//# sourceMappingURL=offset.js.map","import { getMainRangeChannel, getSecondaryRangeChannel, getSizeChannel, getVgPositionChannel, isXorY } from '../../../channel';\nimport { getBand, isFieldDef, isFieldOrDatumDef } from '../../../channeldef';\nimport { ScaleType } from '../../../scale';\nimport { contains } from '../../../util';\nimport { getMarkPropOrConfig } from '../../common';\nimport { getOffset } from './offset';\nimport * as ref from './valueref';\n/**\n * Return encode for point (non-band) position channels.\n */\nexport function pointPosition(channel, model, { defaultPos, vgChannel, isMidPoint }) {\n const { encoding, markDef, config, stack } = model;\n const channelDef = encoding[channel];\n const channel2Def = encoding[getSecondaryRangeChannel(channel)];\n const scaleName = model.scaleName(channel);\n const scale = model.getScaleComponent(channel);\n const offset = getOffset(channel, markDef);\n // Get default position or position from mark def\n const defaultRef = pointPositionDefaultRef({\n model,\n defaultPos,\n channel,\n scaleName,\n scale\n });\n const valueRef = !channelDef && isXorY(channel) && (encoding.latitude || encoding.longitude)\n ? // use geopoint output if there are lat/long and there is no point position overriding lat/long.\n { field: model.getName(channel) }\n : positionRef({\n channel,\n channelDef,\n channel2Def,\n markDef,\n config,\n isMidPoint,\n scaleName,\n scale,\n stack,\n offset,\n defaultRef\n });\n return valueRef ? { [vgChannel || channel]: valueRef } : undefined;\n}\n// TODO: we need to find a way to refactor these so that scaleName is a part of scale\n// but that's complicated. For now, this is a huge step moving forward.\n/**\n * @return Vega ValueRef for normal x- or y-position without projection\n */\nexport function positionRef(params) {\n const { channel, channelDef, isMidPoint, scaleName, stack, offset, markDef, config } = params;\n // This isn't a part of midPoint because we use midPoint for non-position too\n if (isFieldOrDatumDef(channelDef) && stack && channel === stack.fieldChannel) {\n if (isFieldDef(channelDef)) {\n const band = getBand({\n channel,\n fieldDef: channelDef,\n isMidPoint,\n markDef,\n stack,\n config\n });\n if (band !== undefined) {\n return ref.interpolatedSignalRef({\n scaleName,\n fieldOrDatumDef: channelDef,\n startSuffix: 'start',\n band,\n offset\n });\n }\n }\n // x or y use stack_end so that stacked line's point mark use stack_end too.\n return ref.valueRefForFieldOrDatumDef(channelDef, scaleName, { suffix: 'end' }, { offset });\n }\n return ref.midPointRefWithPositionInvalidTest(params);\n}\nexport function pointPositionDefaultRef({ model, defaultPos, channel, scaleName, scale }) {\n const { markDef, config } = model;\n return () => {\n const mainChannel = getMainRangeChannel(channel);\n const vgChannel = getVgPositionChannel(channel);\n const definedValueOrConfig = getMarkPropOrConfig(channel, markDef, config, { vgChannel });\n if (definedValueOrConfig !== undefined) {\n return ref.widthHeightValueOrSignalRef(channel, definedValueOrConfig);\n }\n switch (defaultPos) {\n case 'zeroOrMin':\n case 'zeroOrMax':\n if (scaleName) {\n const scaleType = scale.get('type');\n if (contains([ScaleType.LOG, ScaleType.TIME, ScaleType.UTC], scaleType)) {\n // Log scales cannot have zero.\n // Zero in time scale is arbitrary, and does not affect ratio.\n // (Time is an interval level of measurement, not ratio).\n // See https://en.wikipedia.org/wiki/Level_of_measurement for more info.\n }\n else {\n if (scale.domainDefinitelyIncludesZero()) {\n return {\n scale: scaleName,\n value: 0\n };\n }\n }\n }\n if (defaultPos === 'zeroOrMin') {\n return mainChannel === 'y' ? { field: { group: 'height' } } : { value: 0 };\n }\n else {\n // zeroOrMax\n switch (mainChannel) {\n case 'radius':\n // max of radius is min(width, height) / 2\n return {\n signal: `min(${model.width.signal},${model.height.signal})/2`\n };\n case 'theta':\n return { signal: '2*PI' };\n case 'x':\n return { field: { group: 'width' } };\n case 'y':\n return { value: 0 };\n }\n }\n break;\n case 'mid': {\n const sizeRef = model[getSizeChannel(channel)];\n return Object.assign(Object.assign({}, sizeRef), { mult: 0.5 });\n }\n }\n // defaultPos === null\n return undefined;\n };\n}\n//# sourceMappingURL=position-point.js.map","import { getVgPositionChannel } from '../../../channel';\nimport * as log from '../../../log';\nimport { isSignalRef } from '../../../vega.schema';\nimport { getMarkPropOrConfig } from '../../common';\nconst ALIGNED_X_CHANNEL = {\n left: 'x',\n center: 'xc',\n right: 'x2'\n};\nconst BASELINED_Y_CHANNEL = {\n top: 'y',\n middle: 'yc',\n bottom: 'y2'\n};\nexport function vgAlignedPositionChannel(channel, markDef, config, defaultAlign = 'middle') {\n if (channel === 'radius' || channel === 'theta') {\n return getVgPositionChannel(channel);\n }\n const alignChannel = channel === 'x' ? 'align' : 'baseline';\n const align = getMarkPropOrConfig(alignChannel, markDef, config);\n let alignExcludingSignal;\n if (isSignalRef(align)) {\n log.warn(log.message.rangeMarkAlignmentCannotBeExpression(alignChannel));\n alignExcludingSignal = undefined;\n }\n else {\n alignExcludingSignal = align;\n }\n if (channel === 'x') {\n return ALIGNED_X_CHANNEL[alignExcludingSignal || (defaultAlign === 'top' ? 'left' : 'center')];\n }\n else {\n return BASELINED_Y_CHANNEL[alignExcludingSignal || defaultAlign];\n }\n}\n//# sourceMappingURL=position-align.js.map","import { getMainRangeChannel, getSecondaryRangeChannel, getSizeChannel, getVgPositionChannel } from '../../../channel';\nimport { isFieldOrDatumDef } from '../../../channeldef';\nimport { getMarkStyleConfig } from '../../common';\nimport { getOffset } from './offset';\nimport { vgAlignedPositionChannel } from './position-align';\nimport { pointPosition, pointPositionDefaultRef } from './position-point';\nimport * as ref from './valueref';\n/**\n * Utility for area/rule position, which can be either point or range. (One of the axes should be point and the other should be range.)\n */\nexport function pointOrRangePosition(channel, model, { defaultPos, defaultPos2, range }) {\n if (range) {\n return rangePosition(channel, model, { defaultPos, defaultPos2 });\n }\n return pointPosition(channel, model, { defaultPos });\n}\nexport function rangePosition(channel, model, { defaultPos, defaultPos2 }) {\n const { markDef, config } = model;\n const channel2 = getSecondaryRangeChannel(channel);\n const sizeChannel = getSizeChannel(channel);\n const pos2Mixins = pointPosition2OrSize(model, defaultPos2, channel2);\n const vgChannel = pos2Mixins[sizeChannel]\n ? // If there is width/height, we need to position the marks based on the alignment.\n vgAlignedPositionChannel(channel, markDef, config)\n : // Otherwise, make sure to apply to the right Vg Channel (for arc mark)\n getVgPositionChannel(channel);\n return Object.assign(Object.assign({}, pointPosition(channel, model, { defaultPos, vgChannel })), pos2Mixins);\n}\n/**\n * Return encode for x2, y2.\n * If channel is not specified, return one channel based on orientation.\n */\nfunction pointPosition2OrSize(model, defaultPos, channel) {\n const { encoding, mark, markDef, stack, config } = model;\n const baseChannel = getMainRangeChannel(channel);\n const sizeChannel = getSizeChannel(channel);\n const vgChannel = getVgPositionChannel(channel);\n const channelDef = encoding[baseChannel];\n const scaleName = model.scaleName(baseChannel);\n const scale = model.getScaleComponent(baseChannel);\n const offset = channel in encoding || channel in markDef\n ? getOffset(channel, model.markDef)\n : getOffset(baseChannel, model.markDef);\n if (!channelDef && (channel === 'x2' || channel === 'y2') && (encoding.latitude || encoding.longitude)) {\n // use geopoint output if there are lat2/long2 and there is no point position2 overriding lat2/long2.\n return { [vgChannel]: { field: model.getName(channel) } };\n }\n const valueRef = position2Ref({\n channel,\n channelDef,\n channel2Def: encoding[channel],\n markDef,\n config,\n scaleName,\n scale,\n stack,\n offset,\n defaultRef: undefined\n });\n if (valueRef !== undefined) {\n return { [vgChannel]: valueRef };\n }\n // TODO: check width/height encoding here once we add them\n // no x2/y2 encoding, then try to read x2/y2 or width/height based on precedence:\n // markDef > config.style > mark-specific config (config[mark]) > general mark config (config.mark)\n return (position2orSize(channel, markDef) ||\n position2orSize(channel, {\n [channel]: getMarkStyleConfig(channel, markDef, config.style),\n [sizeChannel]: getMarkStyleConfig(sizeChannel, markDef, config.style)\n }) ||\n position2orSize(channel, config[mark]) ||\n position2orSize(channel, config.mark) || {\n [vgChannel]: pointPositionDefaultRef({\n model,\n defaultPos,\n channel,\n scaleName,\n scale\n })()\n });\n}\nexport function position2Ref({ channel, channelDef, channel2Def, markDef, config, scaleName, scale, stack, offset, defaultRef }) {\n if (isFieldOrDatumDef(channelDef) &&\n stack &&\n // If fieldChannel is X and channel is X2 (or Y and Y2)\n channel.charAt(0) === stack.fieldChannel.charAt(0)) {\n return ref.valueRefForFieldOrDatumDef(channelDef, scaleName, { suffix: 'start' }, { offset });\n }\n return ref.midPointRefWithPositionInvalidTest({\n channel,\n channelDef: channel2Def,\n scaleName,\n scale,\n stack,\n markDef,\n config,\n offset,\n defaultRef\n });\n}\nfunction position2orSize(channel, markDef) {\n const sizeChannel = getSizeChannel(channel);\n const vgChannel = getVgPositionChannel(channel);\n if (markDef[vgChannel] !== undefined) {\n return { [vgChannel]: ref.widthHeightValueOrSignalRef(channel, markDef[vgChannel]) };\n }\n else if (markDef[channel] !== undefined) {\n return { [vgChannel]: ref.widthHeightValueOrSignalRef(channel, markDef[channel]) };\n }\n else if (markDef[sizeChannel]) {\n return { [sizeChannel]: ref.widthHeightValueOrSignalRef(channel, markDef[sizeChannel]) };\n }\n return undefined;\n}\n//# sourceMappingURL=position-range.js.map","import { isArray, isNumber } from 'vega-util';\nimport { isBinned, isBinning, isBinParams } from '../../../bin';\nimport { getSecondaryRangeChannel, getSizeChannel, getVgPositionChannel, isPolarPositionChannel, isXorY } from '../../../channel';\nimport { getBand, isFieldDef, isFieldOrDatumDef, vgField } from '../../../channeldef';\nimport { DEFAULT_STEP, getViewConfigDiscreteStep } from '../../../config';\nimport * as log from '../../../log';\nimport { hasDiscreteDomain, ScaleType } from '../../../scale';\nimport { getFirstDefined } from '../../../util';\nimport { isSignalRef, isVgRangeStep } from '../../../vega.schema';\nimport { getMarkPropOrConfig, signalOrStringValue } from '../../common';\nimport { nonPosition } from './nonposition';\nimport { getOffset } from './offset';\nimport { vgAlignedPositionChannel } from './position-align';\nimport { pointPositionDefaultRef } from './position-point';\nimport { rangePosition } from './position-range';\nimport * as ref from './valueref';\nexport function rectPosition(model, channel, mark) {\n var _a, _b, _c, _d;\n const { config, encoding, markDef, stack } = model;\n const channel2 = getSecondaryRangeChannel(channel);\n const sizeChannel = getSizeChannel(channel);\n const channelDef = encoding[channel];\n const channelDef2 = encoding[channel2];\n const scale = model.getScaleComponent(channel);\n const scaleType = scale ? scale.get('type') : undefined;\n const scaleName = model.scaleName(channel);\n const orient = markDef.orient;\n const hasSizeDef = (_b = (_a = encoding[sizeChannel]) !== null && _a !== void 0 ? _a : encoding.size) !== null && _b !== void 0 ? _b : getMarkPropOrConfig('size', markDef, config, { vgChannel: sizeChannel });\n const isBarBand = mark === 'bar' && (channel === 'x' ? orient === 'vertical' : orient === 'horizontal');\n // x, x2, and width -- we must specify two of these in all conditions\n if (isFieldDef(channelDef) &&\n (isBinning(channelDef.bin) || isBinned(channelDef.bin) || (channelDef.timeUnit && !channelDef2)) &&\n !hasSizeDef &&\n !hasDiscreteDomain(scaleType)) {\n const band = getBand({ channel, fieldDef: channelDef, stack, markDef, config });\n const axis = (_c = model.component.axes[channel]) === null || _c === void 0 ? void 0 : _c[0];\n const axisTranslate = (_d = axis === null || axis === void 0 ? void 0 : axis.get('translate')) !== null && _d !== void 0 ? _d : 0.5; // vega default is 0.5\n return rectBinPosition({\n fieldDef: channelDef,\n fieldDef2: channelDef2,\n channel,\n markDef,\n scaleName,\n band,\n axisTranslate,\n spacing: isXorY(channel) ? getMarkPropOrConfig('binSpacing', markDef, config) : undefined,\n reverse: scale.get('reverse'),\n config\n });\n }\n else if (((isFieldOrDatumDef(channelDef) && hasDiscreteDomain(scaleType)) || isBarBand) && !channelDef2) {\n return positionAndSize(mark, channelDef, channel, model);\n }\n else {\n return rangePosition(channel, model, { defaultPos: 'zeroOrMax', defaultPos2: 'zeroOrMin' });\n }\n}\nfunction defaultSizeRef(mark, sizeChannel, scaleName, scale, config, band) {\n if (scale) {\n const scaleType = scale.get('type');\n if (scaleType === 'point' || scaleType === 'band') {\n if (config[mark].discreteBandSize !== undefined) {\n return { value: config[mark].discreteBandSize };\n }\n if (scaleType === ScaleType.POINT) {\n const scaleRange = scale.get('range');\n if (isVgRangeStep(scaleRange) && isNumber(scaleRange.step)) {\n return { value: scaleRange.step - 2 };\n }\n return { value: DEFAULT_STEP - 2 };\n }\n else {\n // BAND\n return { scale: scaleName, band };\n }\n }\n else {\n // continuous scale\n return { value: config[mark].continuousBandSize };\n }\n }\n // No Scale\n const step = getViewConfigDiscreteStep(config.view, sizeChannel);\n const value = getFirstDefined(\n // No scale is like discrete bar (with one item)\n config[mark].discreteBandSize, step - 2);\n return value !== undefined ? { value } : undefined;\n}\n/**\n * Output position encoding and its size encoding for continuous, point, and band scales.\n */\nfunction positionAndSize(mark, fieldDef, channel, model) {\n var _a;\n const { markDef, encoding, config, stack } = model;\n const orient = markDef.orient;\n const scaleName = model.scaleName(channel);\n const scale = model.getScaleComponent(channel);\n const vgSizeChannel = getSizeChannel(channel);\n const channel2 = getSecondaryRangeChannel(channel);\n // use \"size\" channel for bars, if there is orient and the channel matches the right orientation\n const useVlSizeChannel = (orient === 'horizontal' && channel === 'y') || (orient === 'vertical' && channel === 'x');\n const sizeFromMarkOrConfig = getMarkPropOrConfig(useVlSizeChannel ? 'size' : vgSizeChannel, markDef, config, {\n vgChannel: vgSizeChannel\n });\n // Use size encoding / mark property / config if it exists\n let sizeMixins;\n if (encoding.size || sizeFromMarkOrConfig !== undefined) {\n if (useVlSizeChannel) {\n sizeMixins = nonPosition('size', model, { vgChannel: vgSizeChannel, defaultValue: sizeFromMarkOrConfig });\n }\n else {\n log.warn(log.message.cannotApplySizeToNonOrientedMark(markDef.type));\n }\n }\n // Otherwise, apply default value\n const band = (_a = (isFieldOrDatumDef(fieldDef) ? getBand({ channel, fieldDef, markDef, stack, config }) : undefined)) !== null && _a !== void 0 ? _a : 1;\n sizeMixins = sizeMixins || { [vgSizeChannel]: defaultSizeRef(mark, vgSizeChannel, scaleName, scale, config, band) };\n /*\n Band scales with size value and all point scales, use xc/yc + band=0.5\n \n Otherwise (band scales that has size based on a band ref), use x/y with position band = (1 - size_band) / 2.\n In this case, size_band is the band specified in the x/y-encoding.\n By default band is 1, so `(1 - band) / 2` = 0.\n If band is 0.6, the the x/y position in such case should be `(1 - band) / 2` = 0.2\n */\n const center = (scale === null || scale === void 0 ? void 0 : scale.get('type')) !== 'band' || !('band' in sizeMixins[vgSizeChannel]);\n const vgChannel = vgAlignedPositionChannel(channel, markDef, config, center ? 'middle' : 'top');\n const offset = getOffset(channel, markDef);\n const posRef = ref.midPointRefWithPositionInvalidTest({\n channel,\n channelDef: fieldDef,\n markDef,\n config,\n scaleName,\n scale,\n stack,\n offset,\n defaultRef: pointPositionDefaultRef({ model, defaultPos: 'mid', channel, scaleName, scale }),\n band: center ? 0.5 : (1 - band) / 2\n });\n if (vgSizeChannel) {\n return Object.assign({ [vgChannel]: posRef }, sizeMixins);\n }\n else {\n // otherwise, we must simulate size by setting position2 = position + size\n // (for theta/radius since Vega doesn't have thetaWidth/radiusWidth)\n const vgChannel2 = getVgPositionChannel(channel2);\n const sizeRef = sizeMixins[vgSizeChannel];\n const sizeOffset = offset ? Object.assign(Object.assign({}, sizeRef), { offset }) : sizeRef;\n return {\n [vgChannel]: posRef,\n // posRef might be an array that wraps position invalid test\n [vgChannel2]: isArray(posRef)\n ? [posRef[0], Object.assign(Object.assign({}, posRef[1]), { offset: sizeOffset })]\n : Object.assign(Object.assign({}, posRef), { offset: sizeOffset })\n };\n }\n}\nfunction getBinSpacing(channel, spacing, reverse, translate, offset) {\n if (isPolarPositionChannel(channel)) {\n return 0;\n }\n const spacingOffset = channel === 'x' || channel === 'y2' ? -spacing / 2 : spacing / 2;\n if (isSignalRef(reverse) || isSignalRef(offset) || isSignalRef(translate)) {\n const reverseExpr = signalOrStringValue(reverse);\n const offsetExpr = signalOrStringValue(offset);\n const translateExpr = signalOrStringValue(translate);\n const t = translateExpr ? `${translateExpr} + ` : '';\n const r = reverseExpr ? `(${reverseExpr} ? -1 : 1) * ` : '';\n const o = offsetExpr ? `(${offsetExpr} + ${spacingOffset})` : spacingOffset;\n return {\n signal: t + r + o\n };\n }\n else {\n offset = offset || 0;\n return translate + (reverse ? -offset - spacingOffset : +offset + spacingOffset);\n }\n}\nexport function rectBinPosition({ fieldDef, fieldDef2, channel, band, scaleName, markDef, spacing = 0, axisTranslate, reverse, config }) {\n const channel2 = getSecondaryRangeChannel(channel);\n const vgChannel = getVgPositionChannel(channel);\n const vgChannel2 = getVgPositionChannel(channel2);\n const offset = getOffset(channel, markDef);\n if (isBinning(fieldDef.bin) || fieldDef.timeUnit) {\n return {\n [vgChannel2]: rectBinRef({\n channel,\n fieldDef,\n scaleName,\n markDef,\n band: (1 - band) / 2,\n offset: getBinSpacing(channel2, spacing, reverse, axisTranslate, offset),\n config\n }),\n [vgChannel]: rectBinRef({\n channel,\n fieldDef,\n scaleName,\n markDef,\n band: 1 - (1 - band) / 2,\n offset: getBinSpacing(channel, spacing, reverse, axisTranslate, offset),\n config\n })\n };\n }\n else if (isBinned(fieldDef.bin)) {\n const startRef = ref.valueRefForFieldOrDatumDef(fieldDef, scaleName, {}, { offset: getBinSpacing(channel2, spacing, reverse, axisTranslate, offset) });\n if (isFieldDef(fieldDef2)) {\n return {\n [vgChannel2]: startRef,\n [vgChannel]: ref.valueRefForFieldOrDatumDef(fieldDef2, scaleName, {}, { offset: getBinSpacing(channel, spacing, reverse, axisTranslate, offset) })\n };\n }\n else if (isBinParams(fieldDef.bin) && fieldDef.bin.step) {\n return {\n [vgChannel2]: startRef,\n [vgChannel]: {\n signal: `scale(\"${scaleName}\", ${vgField(fieldDef, { expr: 'datum' })} + ${fieldDef.bin.step})`,\n offset: getBinSpacing(channel, spacing, reverse, axisTranslate, offset)\n }\n };\n }\n }\n log.warn(log.message.channelRequiredForBinned(channel2));\n return undefined;\n}\n/**\n * Value Ref for binned fields\n */\nexport function rectBinRef({ channel, fieldDef, scaleName, markDef, band, offset, config }) {\n const r = ref.interpolatedSignalRef({\n scaleName,\n fieldOrDatumDef: fieldDef,\n band,\n offset\n });\n return ref.wrapPositionInvalidTest({\n fieldDef,\n channel,\n markDef,\n ref: r,\n config\n });\n}\n//# sourceMappingURL=position-rect.js.map","import { array } from 'vega-util';\nimport { SCALE_CHANNELS } from '../../../channel';\nimport { isPathMark } from '../../../mark';\nimport { hasContinuousDomain } from '../../../scale';\nimport { keys } from '../../../util';\nimport { VG_MARK_CONFIGS } from '../../../vega.schema';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { aria } from './aria';\nimport { color } from './color';\nimport { nonPosition } from './nonposition';\nimport { text } from './text';\nimport { tooltip } from './tooltip';\nimport { fieldInvalidPredicate } from './valueref';\nimport { zindex } from './zindex';\nexport { color } from './color';\nexport { wrapCondition } from './conditional';\nexport { nonPosition } from './nonposition';\nexport { pointPosition } from './position-point';\nexport { pointOrRangePosition, rangePosition } from './position-range';\nexport { rectPosition } from './position-rect';\nexport { text } from './text';\nexport { tooltip } from './tooltip';\nconst ALWAYS_IGNORE = new Set(['aria']);\nexport function baseEncodeEntry(model, ignore) {\n const { fill = undefined, stroke = undefined } = ignore.color === 'include' ? color(model) : {};\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, markDefProperties(model.markDef, ignore)), wrapAllFieldsInvalid(model, 'fill', fill)), wrapAllFieldsInvalid(model, 'stroke', stroke)), nonPosition('opacity', model)), nonPosition('fillOpacity', model)), nonPosition('strokeOpacity', model)), nonPosition('strokeWidth', model)), nonPosition('strokeDash', model)), zindex(model)), tooltip(model)), text(model, 'href')), aria(model));\n}\n// TODO: mark VgValueRef[] as readonly after https://github.com/vega/vega/pull/1987\nfunction wrapAllFieldsInvalid(model, channel, valueRef) {\n const { config, mark, markDef } = model;\n const invalid = getMarkPropOrConfig('invalid', markDef, config);\n if (invalid === 'hide' && valueRef && !isPathMark(mark)) {\n // For non-path marks, we have to exclude invalid values (null and NaN) for scales with continuous domains.\n // For path marks, we will use \"defined\" property and skip these values instead.\n const test = allFieldsInvalidPredicate(model, { invalid: true, channels: SCALE_CHANNELS });\n if (test) {\n return {\n [channel]: [\n // prepend the invalid case\n // TODO: support custom value\n { test, value: null },\n ...array(valueRef)\n ]\n };\n }\n }\n return valueRef ? { [channel]: valueRef } : {};\n}\nfunction markDefProperties(mark, ignore) {\n return VG_MARK_CONFIGS.reduce((m, prop) => {\n if (!ALWAYS_IGNORE.has(prop) && mark[prop] !== undefined && ignore[prop] !== 'ignore') {\n m[prop] = signalOrValueRef(mark[prop]);\n }\n return m;\n }, {});\n}\nfunction allFieldsInvalidPredicate(model, { invalid = false, channels }) {\n const filterIndex = channels.reduce((aggregator, channel) => {\n const scaleComponent = model.getScaleComponent(channel);\n if (scaleComponent) {\n const scaleType = scaleComponent.get('type');\n const field = model.vgField(channel, { expr: 'datum' });\n // While discrete domain scales can handle invalid values, continuous scales can't.\n if (field && hasContinuousDomain(scaleType)) {\n aggregator[field] = true;\n }\n }\n return aggregator;\n }, {});\n const fields = keys(filterIndex);\n if (fields.length > 0) {\n const op = invalid ? '||' : '&&';\n return fields.map(field => fieldInvalidPredicate(field, invalid)).join(` ${op} `);\n }\n return undefined;\n}\n//# sourceMappingURL=base.js.map","import { isValueDef } from '../../../channeldef';\nimport { isPathMark } from '../../../mark';\nimport { signalOrValueRef } from '../../common';\nimport { wrapCondition } from './conditional';\nexport function zindex(model) {\n const { encoding, mark } = model;\n const order = encoding.order;\n if (!isPathMark(mark) && isValueDef(order)) {\n return wrapCondition(model, order, 'zindex', cd => signalOrValueRef(cd.value));\n }\n return {};\n}\n//# sourceMappingURL=zindex.js.map","import { entries, isEmpty } from '../../../util';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { VG_MARK_INDEX } from './../../../vega.schema';\nimport { wrapCondition } from './conditional';\nimport { textRef } from './text';\nimport { tooltipData } from './tooltip';\nexport function aria(model) {\n const { markDef, config } = model;\n const enableAria = getMarkPropOrConfig('aria', markDef, config);\n // We can ignore other aria properties if ariaHidden is true.\n if (enableAria === false) {\n // getMarkGroups sets aria to false already so we don't have to set it in the encode block\n return {};\n }\n return Object.assign(Object.assign(Object.assign({}, (enableAria ? { aria: enableAria } : {})), ariaRoleDescription(model)), description(model));\n}\nfunction ariaRoleDescription(model) {\n const { mark, markDef, config } = model;\n if (config.aria === false) {\n return {};\n }\n const ariaRoleDesc = getMarkPropOrConfig('ariaRoleDescription', markDef, config);\n if (ariaRoleDesc != null) {\n return { ariaRoleDescription: { value: ariaRoleDesc } };\n }\n return mark in VG_MARK_INDEX ? {} : { ariaRoleDescription: { value: mark } };\n}\nexport function description(model) {\n const { encoding, markDef, config, stack } = model;\n const channelDef = encoding.description;\n if (channelDef) {\n return wrapCondition(model, channelDef, 'description', cDef => textRef(cDef, model.config));\n }\n // Use default from mark def or config if defined.\n // Functions in encode usually just return undefined but since we are defining a default below, we need to check the default here.\n const descriptionValue = getMarkPropOrConfig('description', markDef, config);\n if (descriptionValue != null) {\n return {\n description: signalOrValueRef(descriptionValue)\n };\n }\n if (config.aria === false) {\n return {};\n }\n const data = tooltipData(encoding, stack, config);\n if (isEmpty(data)) {\n return undefined;\n }\n return {\n description: {\n signal: entries(data)\n .map(([key, value], index) => `\"${index > 0 ? '; ' : ''}${key}: \" + (${value})`)\n .join(' + ')\n }\n };\n}\n//# sourceMappingURL=aria.js.map","import { POSITION_SCALE_CHANNELS } from '../../../channel';\nimport { hasContinuousDomain } from '../../../scale';\nimport { keys } from '../../../util';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { fieldInvalidPredicate } from './valueref';\nexport function defined(model) {\n const { config, markDef } = model;\n const invalid = getMarkPropOrConfig('invalid', markDef, config);\n if (invalid) {\n const signal = allFieldsInvalidPredicate(model, { channels: POSITION_SCALE_CHANNELS });\n if (signal) {\n return { defined: { signal } };\n }\n }\n return {};\n}\nfunction allFieldsInvalidPredicate(model, { invalid = false, channels }) {\n const filterIndex = channels.reduce((aggregator, channel) => {\n const scaleComponent = model.getScaleComponent(channel);\n if (scaleComponent) {\n const scaleType = scaleComponent.get('type');\n const field = model.vgField(channel, { expr: 'datum' });\n // While discrete domain scales can handle invalid values, continuous scales can't.\n if (field && hasContinuousDomain(scaleType)) {\n aggregator[field] = true;\n }\n }\n return aggregator;\n }, {});\n const fields = keys(filterIndex);\n if (fields.length > 0) {\n const op = invalid ? '||' : '&&';\n return fields.map(field => fieldInvalidPredicate(field, invalid)).join(` ${op} `);\n }\n return undefined;\n}\nexport function valueIfDefined(prop, value) {\n if (value !== undefined) {\n return { [prop]: signalOrValueRef(value) };\n }\n return undefined;\n}\n//# sourceMappingURL=defined.js.map","import * as log from '../../../log';\nimport { isPathMark } from '../../../mark';\nimport { tooltip } from '../../mark/encode';\nconst VORONOI = 'voronoi';\nconst nearest = {\n has: selCmpt => {\n return selCmpt.type !== 'interval' && selCmpt.nearest;\n },\n parse: (model, selCmpt) => {\n // Scope selection events to the voronoi mark to prevent capturing\n // events that occur on the group mark (https://github.com/vega/vega/issues/2112).\n if (selCmpt.events) {\n for (const s of selCmpt.events) {\n s.markname = model.getName(VORONOI);\n }\n }\n },\n marks: (model, selCmpt, marks) => {\n const { x, y } = selCmpt.project.hasChannel;\n const markType = model.mark;\n if (isPathMark(markType)) {\n log.warn(log.message.nearestNotSupportForContinuous(markType));\n return marks;\n }\n const cellDef = {\n name: model.getName(VORONOI),\n type: 'path',\n interactive: true,\n from: { data: model.getName('marks') },\n encode: {\n update: Object.assign({ fill: { value: 'transparent' }, strokeWidth: { value: 0.35 }, stroke: { value: 'transparent' }, isVoronoi: { value: true } }, tooltip(model, { reactiveGeom: true }))\n },\n transform: [\n {\n type: 'voronoi',\n x: { expr: x || !y ? 'datum.datum.x || 0' : '0' },\n y: { expr: y || !x ? 'datum.datum.y || 0' : '0' },\n size: [model.getSizeSignalRef('width'), model.getSizeSignalRef('height')]\n }\n ]\n };\n let index = 0;\n let exists = false;\n marks.forEach((mark, i) => {\n var _a;\n const name = (_a = mark.name) !== null && _a !== void 0 ? _a : '';\n if (name === model.component.mark[0].name) {\n index = i;\n }\n else if (name.indexOf(VORONOI) >= 0) {\n exists = true;\n }\n });\n if (!exists) {\n marks.splice(index + 1, 0, cellDef);\n }\n return marks;\n }\n};\nexport default nearest;\n//# sourceMappingURL=nearest.js.map","import * as log from '../../log';\nimport { uniqueId } from '../../util';\n/**\n * A node in the dataflow tree.\n */\nexport class DataFlowNode {\n constructor(parent, debugName) {\n this.debugName = debugName;\n this._children = [];\n this._parent = null;\n if (parent) {\n this.parent = parent;\n }\n }\n /**\n * Clone this node with a deep copy but don't clone links to children or parents.\n */\n clone() {\n throw new Error('Cannot clone node');\n }\n get parent() {\n return this._parent;\n }\n /**\n * Set the parent of the node and also add this node to the parent's children.\n */\n set parent(parent) {\n this._parent = parent;\n if (parent) {\n parent.addChild(this);\n }\n }\n get children() {\n return this._children;\n }\n numChildren() {\n return this._children.length;\n }\n addChild(child, loc) {\n // do not add the same child twice\n if (this._children.indexOf(child) > -1) {\n log.warn(log.message.ADD_SAME_CHILD_TWICE);\n return;\n }\n if (loc !== undefined) {\n this._children.splice(loc, 0, child);\n }\n else {\n this._children.push(child);\n }\n }\n removeChild(oldChild) {\n const loc = this._children.indexOf(oldChild);\n this._children.splice(loc, 1);\n return loc;\n }\n /**\n * Remove node from the dataflow.\n */\n remove() {\n let loc = this._parent.removeChild(this);\n for (const child of this._children) {\n // do not use the set method because we want to insert at a particular location\n child._parent = this._parent;\n this._parent.addChild(child, loc++);\n }\n }\n /**\n * Insert another node as a parent of this node.\n */\n insertAsParentOf(other) {\n const parent = other.parent;\n parent.removeChild(this);\n this.parent = parent;\n other.parent = this;\n }\n swapWithParent() {\n const parent = this._parent;\n const newParent = parent.parent;\n // reconnect the children\n for (const child of this._children) {\n child.parent = parent;\n }\n // remove old links\n this._children = []; // equivalent to removing every child link one by one\n parent.removeChild(this);\n parent.parent.removeChild(parent);\n // swap two nodes\n this.parent = newParent;\n parent.parent = this;\n }\n}\nexport class OutputNode extends DataFlowNode {\n /**\n * @param source The name of the source. Will change in assemble.\n * @param type The type of the output node.\n * @param refCounts A global ref counter map.\n */\n constructor(parent, source, type, refCounts) {\n super(parent, source);\n this.type = type;\n this.refCounts = refCounts;\n this._source = this._name = source;\n if (this.refCounts && !(this._name in this.refCounts)) {\n this.refCounts[this._name] = 0;\n }\n }\n clone() {\n const cloneObj = new this.constructor();\n cloneObj.debugName = 'clone_' + this.debugName;\n cloneObj._source = this._source;\n cloneObj._name = 'clone_' + this._name;\n cloneObj.type = this.type;\n cloneObj.refCounts = this.refCounts;\n cloneObj.refCounts[cloneObj._name] = 0;\n return cloneObj;\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return new Set();\n }\n hash() {\n if (this._hash === undefined) {\n this._hash = `Output ${uniqueId()}`;\n }\n return this._hash;\n }\n /**\n * Request the datasource name and increase the ref counter.\n *\n * During the parsing phase, this will return the simple name such as 'main' or 'raw'.\n * It is crucial to request the name from an output node to mark it as a required node.\n * If nobody ever requests the name, this datasource will not be instantiated in the assemble phase.\n *\n * In the assemble phase, this will return the correct name.\n */\n getSource() {\n this.refCounts[this._name]++;\n return this._source;\n }\n isRequired() {\n return !!this.refCounts[this._name];\n }\n setSource(source) {\n this._source = source;\n }\n}\n//# sourceMappingURL=dataflow.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { getSecondaryRangeChannel } from '../../channel';\nimport { hasBand, vgField } from '../../channeldef';\nimport { getTimeUnitParts, normalizeTimeUnit } from '../../timeunit';\nimport { duplicate, hash, isEmpty, replacePathInField, vals, entries } from '../../util';\nimport { isUnitModel } from '../model';\nimport { DataFlowNode } from './dataflow';\nexport class TimeUnitNode extends DataFlowNode {\n constructor(parent, formula) {\n super(parent);\n this.formula = formula;\n }\n clone() {\n return new TimeUnitNode(null, duplicate(this.formula));\n }\n static makeFromEncoding(parent, model) {\n const formula = model.reduceFieldDef((timeUnitComponent, fieldDef, channel) => {\n const { field, timeUnit } = fieldDef;\n const channelDef2 = isUnitModel(model) ? model.encoding[getSecondaryRangeChannel(channel)] : undefined;\n const band = isUnitModel(model) && hasBand(channel, fieldDef, channelDef2, model.stack, model.markDef, model.config);\n if (timeUnit) {\n const as = vgField(fieldDef, { forAs: true });\n timeUnitComponent[hash({\n as,\n field,\n timeUnit\n })] = Object.assign({ as,\n field,\n timeUnit }, (band ? { band: true } : {}));\n }\n return timeUnitComponent;\n }, {});\n if (isEmpty(formula)) {\n return null;\n }\n return new TimeUnitNode(parent, formula);\n }\n static makeFromTransform(parent, t) {\n const _a = Object.assign({}, t), { timeUnit } = _a, other = __rest(_a, [\"timeUnit\"]);\n const normalizedTimeUnit = normalizeTimeUnit(timeUnit);\n const component = Object.assign(Object.assign({}, other), { timeUnit: normalizedTimeUnit });\n return new TimeUnitNode(parent, {\n [hash(component)]: component\n });\n }\n /**\n * Merge together TimeUnitNodes assigning the children of `other` to `this`\n * and removing `other`.\n */\n merge(other) {\n this.formula = Object.assign({}, this.formula);\n // if the same hash happen twice, merge \"band\"\n for (const key in other.formula) {\n if (!this.formula[key] || other.formula[key].band) {\n // copy if it's not a duplicate or if we need to copy band over\n this.formula[key] = other.formula[key];\n }\n }\n for (const child of other.children) {\n other.removeChild(child);\n child.parent = this;\n }\n other.remove();\n }\n /**\n * Remove time units coming from the other node.\n */\n removeFormulas(fields) {\n const newFormula = {};\n for (const [key, timeUnit] of entries(this.formula)) {\n if (!fields.has(timeUnit.as)) {\n newFormula[key] = timeUnit;\n }\n }\n this.formula = newFormula;\n }\n producedFields() {\n return new Set(vals(this.formula).map(f => f.as));\n }\n dependentFields() {\n return new Set(vals(this.formula).map(f => f.field));\n }\n hash() {\n return `TimeUnit ${hash(this.formula)}`;\n }\n assemble() {\n const transforms = [];\n for (const f of vals(this.formula)) {\n const { field, as, timeUnit } = f;\n const _a = normalizeTimeUnit(timeUnit), { unit, utc } = _a, params = __rest(_a, [\"unit\", \"utc\"]);\n transforms.push(Object.assign(Object.assign(Object.assign(Object.assign({ field: replacePathInField(field), type: 'timeunit' }, (unit ? { units: getTimeUnitParts(unit) } : {})), (utc ? { timezone: 'utc' } : {})), params), { as: [as, `${as}_end`] }));\n }\n return transforms;\n }\n}\n//# sourceMappingURL=timeunit.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array } from 'vega-util';\nimport { isSingleDefUnitChannel } from '../../../channel';\nimport * as log from '../../../log';\nimport { hasContinuousDomain } from '../../../scale';\nimport { hash, keys, replacePathInField, varName, isEmpty } from '../../../util';\nimport { TimeUnitNode } from '../../data/timeunit';\nexport const TUPLE_FIELDS = '_tuple_fields';\nexport class SelectionProjectionComponent {\n constructor(...items) {\n this.items = items;\n this.hasChannel = {};\n this.hasField = {};\n }\n}\nconst project = {\n has: () => {\n return true; // This transform handles its own defaults, so always run parse.\n },\n parse: (model, selCmpt, selDef) => {\n var _a, _b, _c;\n const name = selCmpt.name;\n const proj = (_a = selCmpt.project) !== null && _a !== void 0 ? _a : (selCmpt.project = new SelectionProjectionComponent());\n const parsed = {};\n const timeUnits = {};\n const signals = new Set();\n const signalName = (p, range) => {\n const suffix = range === 'visual' ? p.channel : p.field;\n let sg = varName(`${name}_${suffix}`);\n for (let counter = 1; signals.has(sg); counter++) {\n sg = varName(`${name}_${suffix}_${counter}`);\n }\n signals.add(sg);\n return { [range]: sg };\n };\n // If no explicit projection (either fields or encodings) is specified, set some defaults.\n // If an initial value is set, try to infer projections.\n // Otherwise, use the default configuration.\n if (!selDef.fields && !selDef.encodings) {\n const cfg = model.config.selection[selDef.type];\n if (selDef.init) {\n for (const init of array(selDef.init)) {\n for (const key of keys(init)) {\n if (isSingleDefUnitChannel(key)) {\n (selDef.encodings || (selDef.encodings = [])).push(key);\n }\n else {\n if (selDef.type === 'interval') {\n log.warn(log.message.INTERVAL_INITIALIZED_WITH_X_Y);\n selDef.encodings = cfg.encodings;\n }\n else {\n (selDef.fields || (selDef.fields = [])).push(key);\n }\n }\n }\n }\n }\n else {\n selDef.encodings = cfg.encodings;\n selDef.fields = cfg.fields;\n }\n }\n // TODO: find a possible channel mapping for these fields.\n for (const field of (_b = selDef.fields) !== null && _b !== void 0 ? _b : []) {\n const p = { type: 'E', field };\n p.signals = Object.assign({}, signalName(p, 'data'));\n proj.items.push(p);\n proj.hasField[field] = p;\n }\n for (const channel of (_c = selDef.encodings) !== null && _c !== void 0 ? _c : []) {\n const fieldDef = model.fieldDef(channel);\n if (fieldDef) {\n let field = fieldDef.field;\n if (fieldDef.aggregate) {\n log.warn(log.message.cannotProjectAggregate(channel, fieldDef.aggregate));\n continue;\n }\n else if (!field) {\n log.warn(log.message.cannotProjectOnChannelWithoutField(channel));\n continue;\n }\n if (fieldDef.timeUnit) {\n field = model.vgField(channel);\n // Construct TimeUnitComponents which will be combined into a\n // TimeUnitNode. This node may need to be inserted into the\n // dataflow if the selection is used across views that do not\n // have these time units defined.\n const component = {\n timeUnit: fieldDef.timeUnit,\n as: field,\n field: fieldDef.field\n };\n timeUnits[hash(component)] = component;\n }\n // Prevent duplicate projections on the same field.\n // TODO: what if the same field is bound to multiple channels (e.g., SPLOM diag).\n if (!parsed[field]) {\n // Determine whether the tuple will store enumerated or ranged values.\n // Interval selections store ranges for continuous scales, and enumerations otherwise.\n // Single/multi selections store ranges for binned fields, and enumerations otherwise.\n let type = 'E';\n if (selCmpt.type === 'interval') {\n const scaleType = model.getScaleComponent(channel).get('type');\n if (hasContinuousDomain(scaleType)) {\n type = 'R';\n }\n }\n else if (fieldDef.bin) {\n type = 'R-RE';\n }\n const p = { field, channel, type };\n p.signals = Object.assign(Object.assign({}, signalName(p, 'data')), signalName(p, 'visual'));\n proj.items.push((parsed[field] = p));\n proj.hasField[field] = proj.hasChannel[channel] = parsed[field];\n }\n }\n else {\n log.warn(log.message.cannotProjectOnChannelWithoutField(channel));\n }\n }\n if (selDef.init) {\n const parseInit = (i) => {\n return proj.items.map(p => (i[p.channel] !== undefined ? i[p.channel] : i[p.field]));\n };\n if (selDef.type === 'interval') {\n selCmpt.init = parseInit(selDef.init);\n }\n else {\n const init = array(selDef.init);\n selCmpt.init = init.map(parseInit);\n }\n }\n if (!isEmpty(timeUnits)) {\n proj.timeUnit = new TimeUnitNode(null, timeUnits);\n }\n },\n signals: (model, selCmpt, allSignals) => {\n const name = selCmpt.name + TUPLE_FIELDS;\n const hasSignal = allSignals.filter(s => s.name === name);\n return hasSignal.length > 0\n ? allSignals\n : allSignals.concat({\n name,\n value: selCmpt.project.items.map(proj => {\n const { signals, hasLegend } = proj, rest = __rest(proj, [\"signals\", \"hasLegend\"]);\n rest.field = replacePathInField(rest.field);\n return rest;\n })\n });\n }\n};\nexport default project;\n//# sourceMappingURL=project.js.map","import { stringValue } from 'vega-util';\nimport { TUPLE } from '..';\nimport { varName } from '../../../util';\nimport { assembleInit } from '../assemble';\nimport nearest from './nearest';\nimport { TUPLE_FIELDS } from './project';\nimport { isLegendBinding } from '../../../selection';\nconst inputBindings = {\n has: selCmpt => {\n return (selCmpt.type === 'single' &&\n selCmpt.resolve === 'global' &&\n selCmpt.bind &&\n selCmpt.bind !== 'scales' &&\n !isLegendBinding(selCmpt.bind));\n },\n parse: (model, selCmpt, selDef, origDef) => {\n // Binding a selection to input widgets disables default direct manipulation interaction.\n // A user can choose to re-enable it by explicitly specifying triggering input events.\n if (!origDef.on)\n delete selCmpt.events;\n if (!origDef.clear)\n delete selCmpt.clear;\n },\n topLevelSignals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const proj = selCmpt.project;\n const bind = selCmpt.bind;\n const init = selCmpt.init && selCmpt.init[0]; // Can only exist on single selections (one initial value).\n const datum = nearest.has(selCmpt) ? '(item().isVoronoi ? datum.datum : datum)' : 'datum';\n proj.items.forEach((p, i) => {\n var _a, _b;\n const sgname = varName(`${name}_${p.field}`);\n const hasSignal = signals.filter(s => s.name === sgname);\n if (!hasSignal.length) {\n signals.unshift(Object.assign(Object.assign({ name: sgname }, (init ? { init: assembleInit(init[i]) } : { value: null })), { on: selCmpt.events\n ? [\n {\n events: selCmpt.events,\n update: `datum && item().mark.marktype !== 'group' ? ${datum}[${stringValue(p.field)}] : null`\n }\n ]\n : [], bind: (_b = (_a = bind[p.field]) !== null && _a !== void 0 ? _a : bind[p.channel]) !== null && _b !== void 0 ? _b : bind }));\n }\n });\n return signals;\n },\n signals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const proj = selCmpt.project;\n const signal = signals.filter(s => s.name === name + TUPLE)[0];\n const fields = name + TUPLE_FIELDS;\n const values = proj.items.map(p => varName(`${name}_${p.field}`));\n const valid = values.map(v => `${v} !== null`).join(' && ');\n if (values.length) {\n signal.update = `${valid} ? {fields: ${fields}, values: [${values.join(', ')}]} : null`;\n }\n delete signal.value;\n delete signal.on;\n return signals;\n }\n};\nexport default inputBindings;\n//# sourceMappingURL=inputs.js.map","import { TUPLE, unitName } from '..';\nexport const TOGGLE = '_toggle';\nconst toggle = {\n has: selCmpt => {\n return selCmpt.type === 'multi' && !!selCmpt.toggle;\n },\n signals: (model, selCmpt, signals) => {\n return signals.concat({\n name: selCmpt.name + TOGGLE,\n value: false,\n on: [{ events: selCmpt.events, update: selCmpt.toggle }]\n });\n },\n modifyExpr: (model, selCmpt) => {\n const tpl = selCmpt.name + TUPLE;\n const signal = selCmpt.name + TOGGLE;\n return (`${signal} ? null : ${tpl}, ` +\n (selCmpt.resolve === 'global' ? `${signal} ? null : true, ` : `${signal} ? null : {unit: ${unitName(model)}}, `) +\n `${signal} ? ${tpl} : null`);\n }\n};\nexport default toggle;\n//# sourceMappingURL=toggle.js.map","import { selector as parseSelector } from 'vega-event-selector';\nimport { isString } from 'vega-util';\nimport { TUPLE } from '..';\nimport { varName } from '../../../util';\nimport inputBindings from './inputs';\nimport toggle, { TOGGLE } from './toggle';\nconst clear = {\n has: selCmpt => {\n return selCmpt.clear !== undefined && selCmpt.clear !== false;\n },\n parse: (model, selCmpt, selDef) => {\n if (selDef.clear) {\n selCmpt.clear = isString(selDef.clear) ? parseSelector(selDef.clear, 'scope') : selDef.clear;\n }\n },\n topLevelSignals: (model, selCmpt, signals) => {\n if (inputBindings.has(selCmpt)) {\n for (const proj of selCmpt.project.items) {\n const idx = signals.findIndex(n => n.name === varName(`${selCmpt.name}_${proj.field}`));\n if (idx !== -1) {\n signals[idx].on.push({ events: selCmpt.clear, update: 'null' });\n }\n }\n }\n return signals;\n },\n signals: (model, selCmpt, signals) => {\n function addClear(idx, update) {\n if (idx !== -1 && signals[idx].on) {\n signals[idx].on.push({ events: selCmpt.clear, update });\n }\n }\n // Be as minimalist as possible when adding clear triggers to minimize dataflow execution.\n if (selCmpt.type === 'interval') {\n for (const proj of selCmpt.project.items) {\n const vIdx = signals.findIndex(n => n.name === proj.signals.visual);\n addClear(vIdx, '[0, 0]');\n if (vIdx === -1) {\n const dIdx = signals.findIndex(n => n.name === proj.signals.data);\n addClear(dIdx, 'null');\n }\n }\n }\n else {\n let tIdx = signals.findIndex(n => n.name === selCmpt.name + TUPLE);\n addClear(tIdx, 'null');\n if (toggle.has(selCmpt)) {\n tIdx = signals.findIndex(n => n.name === selCmpt.name + TOGGLE);\n addClear(tIdx, 'false');\n }\n }\n return signals;\n }\n};\nexport default clear;\n//# sourceMappingURL=clear.js.map","import { stringValue } from 'vega-util';\nimport { VL_SELECTION_RESOLVE } from '..';\nimport { isScaleChannel } from '../../../channel';\nimport * as log from '../../../log';\nimport { hasContinuousDomain } from '../../../scale';\nimport { isLayerModel } from '../../model';\nconst scaleBindings = {\n has: selCmpt => {\n return selCmpt.type === 'interval' && selCmpt.resolve === 'global' && selCmpt.bind && selCmpt.bind === 'scales';\n },\n parse: (model, selCmpt) => {\n const bound = (selCmpt.scales = []);\n for (const proj of selCmpt.project.items) {\n const channel = proj.channel;\n if (!isScaleChannel(channel)) {\n continue;\n }\n const scale = model.getScaleComponent(channel);\n const scaleType = scale ? scale.get('type') : undefined;\n if (!scale || !hasContinuousDomain(scaleType)) {\n log.warn(log.message.SCALE_BINDINGS_CONTINUOUS);\n continue;\n }\n const extent = { selection: selCmpt.name, field: proj.field };\n scale.set('selectionExtent', extent, true);\n bound.push(proj);\n }\n },\n topLevelSignals: (model, selCmpt, signals) => {\n const bound = selCmpt.scales.filter(proj => signals.filter(s => s.name === proj.signals.data).length === 0);\n // Top-level signals are only needed for multiview displays and if this\n // view's top-level signals haven't already been generated.\n if (!model.parent || isTopLevelLayer(model) || bound.length === 0) {\n return signals;\n }\n // vlSelectionResolve does not account for the behavior of bound scales in\n // multiview displays. Each unit view adds a tuple to the store, but the\n // state of the selection is the unit selection most recently updated. This\n // state is captured by the top-level signals that we insert and \"push\n // outer\" to from within the units. We need to reassemble this state into\n // the top-level named signal, except no single selCmpt has a global view.\n const namedSg = signals.filter(s => s.name === selCmpt.name)[0];\n let update = namedSg.update;\n if (update.indexOf(VL_SELECTION_RESOLVE) >= 0) {\n namedSg.update = `{${bound.map(proj => `${stringValue(proj.field)}: ${proj.signals.data}`).join(', ')}}`;\n }\n else {\n for (const proj of bound) {\n const mapping = `${stringValue(proj.field)}: ${proj.signals.data}`;\n if (update.indexOf(mapping) < 0) {\n update = `${update.substring(0, update.length - 1)}, ${mapping}}`;\n }\n }\n namedSg.update = update;\n }\n return signals.concat(bound.map(proj => ({ name: proj.signals.data })));\n },\n signals: (model, selCmpt, signals) => {\n // Nested signals need only push to top-level signals with multiview displays.\n if (model.parent && !isTopLevelLayer(model)) {\n for (const proj of selCmpt.scales) {\n const signal = signals.filter(s => s.name === proj.signals.data)[0];\n signal.push = 'outer';\n delete signal.value;\n delete signal.update;\n }\n }\n return signals;\n }\n};\nexport default scaleBindings;\nexport function domain(model, channel) {\n const scale = stringValue(model.scaleName(channel));\n return `domain(${scale})`;\n}\nfunction isTopLevelLayer(model) {\n var _a;\n return model.parent && isLayerModel(model.parent) && ((_a = !model.parent.parent) !== null && _a !== void 0 ? _a : isTopLevelLayer(model.parent.parent));\n}\n//# sourceMappingURL=scales.js.map","import { selector as parseSelector } from 'vega-event-selector';\nimport { array, isString } from 'vega-util';\nimport { forEachSelection, TUPLE } from '..';\nimport * as log from '../../../log';\nimport { isLegendBinding, isLegendStreamBinding, SELECTION_ID } from '../../../selection';\nimport { duplicate, varName } from '../../../util';\nimport { TUPLE_FIELDS } from './project';\nimport { TOGGLE } from './toggle';\nconst legendBindings = {\n has: (selCmpt) => {\n const spec = selCmpt.resolve === 'global' && selCmpt.bind && isLegendBinding(selCmpt.bind);\n const projLen = selCmpt.project.items.length === 1 && selCmpt.project.items[0].field !== SELECTION_ID;\n if (spec && !projLen) {\n log.warn(log.message.LEGEND_BINDINGS_MUST_HAVE_PROJECTION);\n }\n return spec && projLen;\n },\n parse: (model, selCmpt, selDef, origDef) => {\n var _a;\n // Binding a selection to a legend disables default direct manipulation interaction.\n // A user can choose to re-enable it by explicitly specifying triggering input events.\n if (!origDef.on)\n delete selCmpt.events;\n if (!origDef.clear)\n delete selCmpt.clear;\n if (origDef.on || origDef.clear) {\n const legendFilter = 'event.item && indexof(event.item.mark.role, \"legend\") < 0';\n for (const evt of selCmpt.events) {\n evt.filter = array((_a = evt.filter) !== null && _a !== void 0 ? _a : []);\n if (evt.filter.indexOf(legendFilter) < 0) {\n evt.filter.push(legendFilter);\n }\n }\n }\n const evt = isLegendStreamBinding(selCmpt.bind) ? selCmpt.bind.legend : 'click';\n const stream = isString(evt) ? parseSelector(evt, 'view') : array(evt);\n selCmpt.bind = { legend: { merge: stream } };\n },\n topLevelSignals: (model, selCmpt, signals) => {\n const selName = selCmpt.name;\n const stream = isLegendStreamBinding(selCmpt.bind) && selCmpt.bind.legend;\n const markName = (name) => (s) => {\n const ds = duplicate(s);\n ds.markname = name;\n return ds;\n };\n for (const proj of selCmpt.project.items) {\n if (!proj.hasLegend)\n continue;\n const prefix = `${varName(proj.field)}_legend`;\n const sgName = `${selName}_${prefix}`;\n const hasSignal = signals.filter(s => s.name === sgName);\n if (hasSignal.length === 0) {\n const events = stream.merge\n .map(markName(`${prefix}_symbols`))\n .concat(stream.merge.map(markName(`${prefix}_labels`)))\n .concat(stream.merge.map(markName(`${prefix}_entries`)));\n signals.unshift(Object.assign(Object.assign({ name: sgName }, (!selCmpt.init ? { value: null } : {})), { on: [\n // Legend entries do not store values, so we need to walk the scenegraph to the symbol datum.\n { events, update: 'datum.value || item().items[0].items[0].datum.value', force: true },\n { events: stream.merge, update: `!event.item || !datum ? null : ${sgName}`, force: true }\n ] }));\n }\n }\n return signals;\n },\n signals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const proj = selCmpt.project;\n const tuple = signals.find(s => s.name === name + TUPLE);\n const fields = name + TUPLE_FIELDS;\n const values = proj.items.filter(p => p.hasLegend).map(p => varName(`${name}_${varName(p.field)}_legend`));\n const valid = values.map(v => `${v} !== null`).join(' && ');\n const update = `${valid} ? {fields: ${fields}, values: [${values.join(', ')}]} : null`;\n if (selCmpt.events && values.length > 0) {\n tuple.on.push({\n events: values.map(signal => ({ signal })),\n update\n });\n }\n else if (values.length > 0) {\n tuple.update = update;\n delete tuple.value;\n delete tuple.on;\n }\n const toggle = signals.find(s => s.name === name + TOGGLE);\n const events = isLegendStreamBinding(selCmpt.bind) && selCmpt.bind.legend;\n if (toggle) {\n if (!selCmpt.events)\n toggle.on[0].events = events;\n else\n toggle.on.push(Object.assign(Object.assign({}, toggle.on[0]), { events }));\n }\n return signals;\n }\n};\nexport default legendBindings;\nexport function parseInteractiveLegend(model, channel, legendCmpt) {\n var _a;\n const field = (_a = model.fieldDef(channel)) === null || _a === void 0 ? void 0 : _a.field;\n forEachSelection(model, selCmpt => {\n var _a, _b;\n const proj = (_a = selCmpt.project.hasField[field]) !== null && _a !== void 0 ? _a : selCmpt.project.hasChannel[channel];\n if (proj && legendBindings.has(selCmpt)) {\n const legendSelections = (_b = legendCmpt.get('selections')) !== null && _b !== void 0 ? _b : [];\n legendSelections.push(selCmpt.name);\n legendCmpt.set('selections', legendSelections, false);\n proj.hasLegend = true;\n }\n });\n}\n//# sourceMappingURL=legends.js.map","import { selector as parseSelector } from 'vega-event-selector';\nimport { X, Y } from '../../../channel';\nimport { BRUSH as INTERVAL_BRUSH } from '../interval';\nimport scalesCompiler, { domain } from './scales';\nconst ANCHOR = '_translate_anchor';\nconst DELTA = '_translate_delta';\nconst translate = {\n has: selCmpt => {\n return selCmpt.type === 'interval' && selCmpt.translate;\n },\n signals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const hasScales = scalesCompiler.has(selCmpt);\n const anchor = name + ANCHOR;\n const { x, y } = selCmpt.project.hasChannel;\n let events = parseSelector(selCmpt.translate, 'scope');\n if (!hasScales) {\n events = events.map(e => ((e.between[0].markname = name + INTERVAL_BRUSH), e));\n }\n signals.push({\n name: anchor,\n value: {},\n on: [\n {\n events: events.map(e => e.between[0]),\n update: '{x: x(unit), y: y(unit)' +\n (x !== undefined ? ', extent_x: ' + (hasScales ? domain(model, X) : `slice(${x.signals.visual})`) : '') +\n (y !== undefined ? ', extent_y: ' + (hasScales ? domain(model, Y) : `slice(${y.signals.visual})`) : '') +\n '}'\n }\n ]\n }, {\n name: name + DELTA,\n value: {},\n on: [\n {\n events: events,\n update: `{x: ${anchor}.x - x(unit), y: ${anchor}.y - y(unit)}`\n }\n ]\n });\n if (x !== undefined) {\n onDelta(model, selCmpt, x, 'width', signals);\n }\n if (y !== undefined) {\n onDelta(model, selCmpt, y, 'height', signals);\n }\n return signals;\n }\n};\nexport default translate;\nfunction onDelta(model, selCmpt, proj, size, signals) {\n var _a;\n const name = selCmpt.name;\n const anchor = name + ANCHOR;\n const delta = name + DELTA;\n const channel = proj.channel;\n const hasScales = scalesCompiler.has(selCmpt);\n const signal = signals.filter(s => s.name === proj.signals[hasScales ? 'data' : 'visual'])[0];\n const sizeSg = model.getSizeSignalRef(size).signal;\n const scaleCmpt = model.getScaleComponent(channel);\n const scaleType = scaleCmpt.get('type');\n const sign = hasScales && channel === X ? '-' : ''; // Invert delta when panning x-scales.\n const extent = `${anchor}.extent_${channel}`;\n const offset = `${sign}${delta}.${channel} / ` + (hasScales ? `${sizeSg}` : `span(${extent})`);\n const panFn = !hasScales\n ? 'panLinear'\n : scaleType === 'log'\n ? 'panLog'\n : scaleType === 'pow'\n ? 'panPow'\n : 'panLinear';\n const update = `${panFn}(${extent}, ${offset}` +\n (hasScales && scaleType === 'pow' ? `, ${(_a = scaleCmpt.get('exponent')) !== null && _a !== void 0 ? _a : 1}` : '') +\n ')';\n signal.on.push({\n events: { signal: delta },\n update: hasScales ? update : `clampRange(${update}, 0, ${sizeSg})`\n });\n}\n//# sourceMappingURL=translate.js.map","import { selector as parseSelector } from 'vega-event-selector';\nimport { stringValue } from 'vega-util';\nimport { X, Y } from '../../../channel';\nimport { BRUSH as INTERVAL_BRUSH } from '../interval';\nimport { default as scalesCompiler, domain } from './scales';\nconst ANCHOR = '_zoom_anchor';\nconst DELTA = '_zoom_delta';\nconst zoom = {\n has: selCmpt => {\n return selCmpt.type === 'interval' && selCmpt.zoom;\n },\n signals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const hasScales = scalesCompiler.has(selCmpt);\n const delta = name + DELTA;\n const { x, y } = selCmpt.project.hasChannel;\n const sx = stringValue(model.scaleName(X));\n const sy = stringValue(model.scaleName(Y));\n let events = parseSelector(selCmpt.zoom, 'scope');\n if (!hasScales) {\n events = events.map(e => ((e.markname = name + INTERVAL_BRUSH), e));\n }\n signals.push({\n name: name + ANCHOR,\n on: [\n {\n events: events,\n update: !hasScales\n ? `{x: x(unit), y: y(unit)}`\n : '{' +\n [sx ? `x: invert(${sx}, x(unit))` : '', sy ? `y: invert(${sy}, y(unit))` : '']\n .filter(expr => !!expr)\n .join(', ') +\n '}'\n }\n ]\n }, {\n name: delta,\n on: [\n {\n events: events,\n force: true,\n update: 'pow(1.001, event.deltaY * pow(16, event.deltaMode))'\n }\n ]\n });\n if (x !== undefined) {\n onDelta(model, selCmpt, x, 'width', signals);\n }\n if (y !== undefined) {\n onDelta(model, selCmpt, y, 'height', signals);\n }\n return signals;\n }\n};\nexport default zoom;\nfunction onDelta(model, selCmpt, proj, size, signals) {\n var _a;\n const name = selCmpt.name;\n const channel = proj.channel;\n const hasScales = scalesCompiler.has(selCmpt);\n const signal = signals.filter(s => s.name === proj.signals[hasScales ? 'data' : 'visual'])[0];\n const sizeSg = model.getSizeSignalRef(size).signal;\n const scaleCmpt = model.getScaleComponent(channel);\n const scaleType = scaleCmpt.get('type');\n const base = hasScales ? domain(model, channel) : signal.name;\n const delta = name + DELTA;\n const anchor = `${name}${ANCHOR}.${channel}`;\n const zoomFn = !hasScales\n ? 'zoomLinear'\n : scaleType === 'log'\n ? 'zoomLog'\n : scaleType === 'pow'\n ? 'zoomPow'\n : 'zoomLinear';\n const update = `${zoomFn}(${base}, ${anchor}, ${delta}` +\n (hasScales && scaleType === 'pow' ? `, ${(_a = scaleCmpt.get('exponent')) !== null && _a !== void 0 ? _a : 1}` : '') +\n ')';\n signal.on.push({\n events: { signal: delta },\n update: hasScales ? update : `clampRange(${update}, 0, ${sizeSg})`\n });\n}\n//# sourceMappingURL=zoom.js.map","import clear from './clear';\nimport inputs from './inputs';\nimport nearest from './nearest';\nimport project from './project';\nimport scales from './scales';\nimport legends from './legends';\nimport toggle from './toggle';\nimport translate from './translate';\nimport zoom from './zoom';\nconst compilers = [project, toggle, scales, legends, translate, zoom, inputs, nearest, clear];\nexport function forEachTransform(selCmpt, cb) {\n for (const t of compilers) {\n if (t.has(selCmpt)) {\n cb(t);\n }\n }\n}\n//# sourceMappingURL=transforms.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { selector as parseSelector } from 'vega-event-selector';\nimport { identity, isArray, stringValue } from 'vega-util';\nimport { forEachSelection, MODIFY, STORE, unitName, VL_SELECTION_RESOLVE, TUPLE } from '.';\nimport { dateTimeToExpr, isDateTime, dateTimeToTimestamp } from '../../datetime';\nimport { keys, varName } from '../../util';\nimport { isUnitModel } from '../model';\nimport { forEachTransform } from './transforms/transforms';\nimport { parseSelectionBinExtent } from './parse';\nexport function assembleInit(init, isExpr = true, wrap = identity) {\n if (isArray(init)) {\n const assembled = init.map(v => assembleInit(v, isExpr, wrap));\n return isExpr ? `[${assembled.join(', ')}]` : assembled;\n }\n else if (isDateTime(init)) {\n if (isExpr) {\n return wrap(dateTimeToExpr(init));\n }\n else {\n return wrap(dateTimeToTimestamp(init));\n }\n }\n return isExpr ? wrap(JSON.stringify(init)) : init;\n}\nexport function assembleUnitSelectionSignals(model, signals) {\n forEachSelection(model, (selCmpt, selCompiler) => {\n const name = selCmpt.name;\n let modifyExpr = selCompiler.modifyExpr(model, selCmpt);\n signals.push(...selCompiler.signals(model, selCmpt));\n forEachTransform(selCmpt, txCompiler => {\n if (txCompiler.signals) {\n signals = txCompiler.signals(model, selCmpt, signals);\n }\n if (txCompiler.modifyExpr) {\n modifyExpr = txCompiler.modifyExpr(model, selCmpt, modifyExpr);\n }\n });\n signals.push({\n name: name + MODIFY,\n on: [\n {\n events: { signal: selCmpt.name + TUPLE },\n update: `modify(${stringValue(selCmpt.name + STORE)}, ${modifyExpr})`\n }\n ]\n });\n });\n return cleanupEmptyOnArray(signals);\n}\nexport function assembleFacetSignals(model, signals) {\n if (model.component.selection && keys(model.component.selection).length) {\n const name = stringValue(model.getName('cell'));\n signals.unshift({\n name: 'facet',\n value: {},\n on: [\n {\n events: parseSelector('mousemove', 'scope'),\n update: `isTuple(facet) ? facet : group(${name}).datum`\n }\n ]\n });\n }\n return cleanupEmptyOnArray(signals);\n}\nexport function assembleTopLevelSignals(model, signals) {\n let hasSelections = false;\n forEachSelection(model, (selCmpt, selCompiler) => {\n const name = selCmpt.name;\n const store = stringValue(name + STORE);\n const hasSg = signals.filter(s => s.name === name);\n if (hasSg.length === 0) {\n const resolve = selCmpt.resolve === 'global' ? 'union' : selCmpt.resolve;\n const isMulti = selCmpt.type === 'multi' ? ', true)' : ')';\n signals.push({\n name: selCmpt.name,\n update: `${VL_SELECTION_RESOLVE}(${store}, ${stringValue(resolve)}${isMulti}`\n });\n }\n hasSelections = true;\n if (selCompiler.topLevelSignals) {\n signals = selCompiler.topLevelSignals(model, selCmpt, signals);\n }\n forEachTransform(selCmpt, txCompiler => {\n if (txCompiler.topLevelSignals) {\n signals = txCompiler.topLevelSignals(model, selCmpt, signals);\n }\n });\n });\n if (hasSelections) {\n const hasUnit = signals.filter(s => s.name === 'unit');\n if (hasUnit.length === 0) {\n signals.unshift({\n name: 'unit',\n value: {},\n on: [{ events: 'mousemove', update: 'isTuple(group()) ? group() : unit' }]\n });\n }\n }\n return cleanupEmptyOnArray(signals);\n}\nexport function assembleUnitSelectionData(model, data) {\n const dataCopy = [...data];\n forEachSelection(model, selCmpt => {\n const init = { name: selCmpt.name + STORE };\n if (selCmpt.init) {\n const fields = selCmpt.project.items.map(proj => {\n const { signals } = proj, rest = __rest(proj, [\"signals\"]);\n return rest;\n });\n const insert = selCmpt.init.map(i => assembleInit(i, false));\n init.values =\n selCmpt.type === 'interval'\n ? [{ unit: unitName(model, { escape: false }), fields, values: insert }]\n : insert.map(i => ({ unit: unitName(model, { escape: false }), fields, values: i }));\n }\n const contains = dataCopy.filter(d => d.name === selCmpt.name + STORE);\n if (!contains.length) {\n dataCopy.push(init);\n }\n });\n return dataCopy;\n}\nexport function assembleUnitSelectionMarks(model, marks) {\n forEachSelection(model, (selCmpt, selCompiler) => {\n marks = selCompiler.marks ? selCompiler.marks(model, selCmpt, marks) : marks;\n forEachTransform(selCmpt, txCompiler => {\n if (txCompiler.marks) {\n marks = txCompiler.marks(model, selCmpt, marks);\n }\n });\n });\n return marks;\n}\nexport function assembleLayerSelectionMarks(model, marks) {\n for (const child of model.children) {\n if (isUnitModel(child)) {\n marks = assembleUnitSelectionMarks(child, marks);\n }\n }\n return marks;\n}\nexport function assembleSelectionScaleDomain(model, extent) {\n const name = extent.selection;\n const selCmpt = model.getSelectionComponent(name, varName(name));\n return { signal: parseSelectionBinExtent(selCmpt, extent) };\n}\nfunction cleanupEmptyOnArray(signals) {\n return signals.map(s => {\n if (s.on && !s.on.length)\n delete s.on;\n return s;\n });\n}\n//# sourceMappingURL=assemble.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array, stringValue } from 'vega-util';\nimport { STORE, TUPLE, unitName } from '.';\nimport { X, Y } from '../../channel';\nimport { warn } from '../../log';\nimport { hasContinuousDomain } from '../../scale';\nimport { keys } from '../../util';\nimport { assembleInit } from './assemble';\nimport { TUPLE_FIELDS } from './transforms/project';\nimport scales from './transforms/scales';\nexport const BRUSH = '_brush';\nexport const SCALE_TRIGGER = '_scale_trigger';\nconst interval = {\n signals: (model, selCmpt) => {\n const name = selCmpt.name;\n const fieldsSg = name + TUPLE_FIELDS;\n const hasScales = scales.has(selCmpt);\n const signals = [];\n const dataSignals = [];\n const scaleTriggers = [];\n if (selCmpt.translate && !hasScales) {\n const filterExpr = `!event.item || event.item.mark.name !== ${stringValue(name + BRUSH)}`;\n events(selCmpt, (on, evt) => {\n var _a;\n const filters = array((_a = evt.between[0].filter) !== null && _a !== void 0 ? _a : (evt.between[0].filter = []));\n if (filters.indexOf(filterExpr) < 0) {\n filters.push(filterExpr);\n }\n return on;\n });\n }\n selCmpt.project.items.forEach((proj, i) => {\n const channel = proj.channel;\n if (channel !== X && channel !== Y) {\n warn('Interval selections only support x and y encoding channels.');\n return;\n }\n const init = selCmpt.init ? selCmpt.init[i] : null;\n const cs = channelSignals(model, selCmpt, proj, init);\n const dname = proj.signals.data;\n const vname = proj.signals.visual;\n const scaleName = stringValue(model.scaleName(channel));\n const scaleType = model.getScaleComponent(channel).get('type');\n const toNum = hasContinuousDomain(scaleType) ? '+' : '';\n signals.push(...cs);\n dataSignals.push(dname);\n scaleTriggers.push({\n scaleName: model.scaleName(channel),\n expr: `(!isArray(${dname}) || ` +\n `(${toNum}invert(${scaleName}, ${vname})[0] === ${toNum}${dname}[0] && ` +\n `${toNum}invert(${scaleName}, ${vname})[1] === ${toNum}${dname}[1]))`\n });\n });\n // Proxy scale reactions to ensure that an infinite loop doesn't occur\n // when an interval selection filter touches the scale.\n if (!hasScales) {\n signals.push({\n name: name + SCALE_TRIGGER,\n value: {},\n on: [\n {\n events: scaleTriggers.map(t => ({ scale: t.scaleName })),\n update: scaleTriggers.map(t => t.expr).join(' && ') + ` ? ${name + SCALE_TRIGGER} : {}`\n }\n ]\n });\n }\n // Only add an interval to the store if it has valid data extents. Data extents\n // are set to null if pixel extents are equal to account for intervals over\n // ordinal/nominal domains which, when inverted, will still produce a valid datum.\n const init = selCmpt.init;\n const update = `unit: ${unitName(model)}, fields: ${fieldsSg}, values`;\n return signals.concat(Object.assign(Object.assign({ name: name + TUPLE }, (init ? { init: `{${update}: ${assembleInit(init)}}` } : {})), { on: [\n {\n events: [{ signal: dataSignals.join(' || ') }],\n update: dataSignals.join(' && ') + ` ? {${update}: [${dataSignals}]} : null`\n }\n ] }));\n },\n modifyExpr: (model, selCmpt) => {\n const tpl = selCmpt.name + TUPLE;\n return tpl + ', ' + (selCmpt.resolve === 'global' ? 'true' : `{unit: ${unitName(model)}}`);\n },\n marks: (model, selCmpt, marks) => {\n const name = selCmpt.name;\n const { x, y } = selCmpt.project.hasChannel;\n const xvname = x && x.signals.visual;\n const yvname = y && y.signals.visual;\n const store = `data(${stringValue(selCmpt.name + STORE)})`;\n // Do not add a brush if we're binding to scales.\n if (scales.has(selCmpt)) {\n return marks;\n }\n const update = {\n x: x !== undefined ? { signal: `${xvname}[0]` } : { value: 0 },\n y: y !== undefined ? { signal: `${yvname}[0]` } : { value: 0 },\n x2: x !== undefined ? { signal: `${xvname}[1]` } : { field: { group: 'width' } },\n y2: y !== undefined ? { signal: `${yvname}[1]` } : { field: { group: 'height' } }\n };\n // If the selection is resolved to global, only a single interval is in\n // the store. Wrap brush mark's encodings with a production rule to test\n // this based on the `unit` property. Hide the brush mark if it corresponds\n // to a unit different from the one in the store.\n if (selCmpt.resolve === 'global') {\n for (const key of keys(update)) {\n update[key] = [\n Object.assign({ test: `${store}.length && ${store}[0].unit === ${unitName(model)}` }, update[key]),\n { value: 0 }\n ];\n }\n }\n // Two brush marks ensure that fill colors and other aesthetic choices do\n // not interefere with the core marks, but that the brushed region can still\n // be interacted with (e.g., dragging it around).\n const _a = selCmpt.mark, { fill, fillOpacity, cursor } = _a, stroke = __rest(_a, [\"fill\", \"fillOpacity\", \"cursor\"]);\n const vgStroke = keys(stroke).reduce((def, k) => {\n def[k] = [\n {\n test: [x !== undefined && `${xvname}[0] !== ${xvname}[1]`, y !== undefined && `${yvname}[0] !== ${yvname}[1]`]\n .filter(t => t)\n .join(' && '),\n value: stroke[k]\n },\n { value: null }\n ];\n return def;\n }, {});\n return [\n {\n name: name + BRUSH + '_bg',\n type: 'rect',\n clip: true,\n encode: {\n enter: {\n fill: { value: fill },\n fillOpacity: { value: fillOpacity }\n },\n update: update\n }\n },\n ...marks,\n {\n name: name + BRUSH,\n type: 'rect',\n clip: true,\n encode: {\n enter: Object.assign(Object.assign({}, (cursor ? { cursor: { value: cursor } } : {})), { fill: { value: 'transparent' } }),\n update: Object.assign(Object.assign({}, update), vgStroke)\n }\n }\n ];\n }\n};\nexport default interval;\n/**\n * Returns the visual and data signals for an interval selection.\n */\nfunction channelSignals(model, selCmpt, proj, init) {\n const channel = proj.channel;\n const vname = proj.signals.visual;\n const dname = proj.signals.data;\n const hasScales = scales.has(selCmpt);\n const scaleName = stringValue(model.scaleName(channel));\n const scale = model.getScaleComponent(channel);\n const scaleType = scale ? scale.get('type') : undefined;\n const scaled = (str) => `scale(${scaleName}, ${str})`;\n const size = model.getSizeSignalRef(channel === X ? 'width' : 'height').signal;\n const coord = `${channel}(unit)`;\n const on = events(selCmpt, (def, evt) => {\n return [\n ...def,\n { events: evt.between[0], update: `[${coord}, ${coord}]` },\n { events: evt, update: `[${vname}[0], clamp(${coord}, 0, ${size})]` } // Brush End\n ];\n });\n // React to pan/zooms of continuous scales. Non-continuous scales\n // (band, point) cannot be pan/zoomed and any other changes\n // to their domains (e.g., filtering) should clear the brushes.\n on.push({\n events: { signal: selCmpt.name + SCALE_TRIGGER },\n update: hasContinuousDomain(scaleType) ? `[${scaled(`${dname}[0]`)}, ${scaled(`${dname}[1]`)}]` : `[0, 0]`\n });\n return hasScales\n ? [{ name: dname, on: [] }]\n : [\n Object.assign(Object.assign({ name: vname }, (init ? { init: assembleInit(init, true, scaled) } : { value: [] })), { on: on }),\n Object.assign(Object.assign({ name: dname }, (init ? { init: assembleInit(init) } : {})), { on: [\n {\n events: { signal: vname },\n update: `${vname}[0] === ${vname}[1] ? null : invert(${scaleName}, ${vname})`\n }\n ] })\n ];\n}\nfunction events(selCmpt, cb) {\n return selCmpt.events.reduce((on, evt) => {\n if (!evt.between) {\n warn(`${evt} is not an ordered event stream for interval selections.`);\n return on;\n }\n return cb(on, evt);\n }, []);\n}\n//# sourceMappingURL=interval.js.map","import { stringValue } from 'vega-util';\nimport { TUPLE, unitName } from '.';\nimport { TUPLE_FIELDS } from './transforms/project';\nexport function singleOrMultiSignals(model, selCmpt) {\n const name = selCmpt.name;\n const fieldsSg = name + TUPLE_FIELDS;\n const project = selCmpt.project;\n const datum = '(item().isVoronoi ? datum.datum : datum)';\n const values = project.items\n .map(p => {\n const fieldDef = model.fieldDef(p.channel);\n // Binned fields should capture extents, for a range test against the raw field.\n return fieldDef && fieldDef.bin\n ? `[${datum}[${stringValue(model.vgField(p.channel, {}))}], ` +\n `${datum}[${stringValue(model.vgField(p.channel, { binSuffix: 'end' }))}]]`\n : `${datum}[${stringValue(p.field)}]`;\n })\n .join(', ');\n // Only add a discrete selection to the store if a datum is present _and_\n // the interaction isn't occurring on a group mark. This guards against\n // polluting interactive state with invalid values in faceted displays\n // as the group marks are also data-driven. We force the update to account\n // for constant null states but varying toggles (e.g., shift-click in\n // whitespace followed by a click in whitespace; the store should only\n // be cleared on the second click).\n const update = `unit: ${unitName(model)}, fields: ${fieldsSg}, values`;\n const events = selCmpt.events;\n return [\n {\n name: name + TUPLE,\n on: events\n ? [\n {\n events,\n update: `datum && item().mark.marktype !== 'group' ? {${update}: [${values}]} : null`,\n force: true\n }\n ]\n : []\n }\n ];\n}\nconst multi = {\n signals: singleOrMultiSignals,\n modifyExpr: (model, selCmpt) => {\n const tpl = selCmpt.name + TUPLE;\n return tpl + ', ' + (selCmpt.resolve === 'global' ? 'null' : `{unit: ${unitName(model)}}`);\n }\n};\nexport default multi;\n//# sourceMappingURL=multi.js.map","import { TUPLE, unitName } from '.';\nimport { singleOrMultiSignals } from './multi';\nconst single = {\n signals: singleOrMultiSignals,\n modifyExpr: (model, selCmpt) => {\n const tpl = selCmpt.name + TUPLE;\n return tpl + ', ' + (selCmpt.resolve === 'global' ? 'true' : `{unit: ${unitName(model)}}`);\n }\n};\nexport default single;\n//# sourceMappingURL=single.js.map","import { stringValue } from 'vega-util';\nimport { FACET_CHANNELS } from '../../channel';\nimport { SELECTION_ID } from '../../selection';\nimport { vals } from '../../util';\nimport { isFacetModel } from '../model';\nimport interval from './interval';\nimport multi from './multi';\nimport single from './single';\nexport const STORE = '_store';\nexport const TUPLE = '_tuple';\nexport const MODIFY = '_modify';\nexport const SELECTION_DOMAIN = '_selection_domain_';\nexport const VL_SELECTION_RESOLVE = 'vlSelectionResolve';\nconst compilers = { single, multi, interval };\nexport function forEachSelection(model, cb) {\n const selections = model.component.selection;\n if (selections) {\n for (const sel of vals(selections)) {\n const success = cb(sel, compilers[sel.type]);\n if (success === true)\n break;\n }\n }\n}\nfunction getFacetModel(model) {\n let parent = model.parent;\n while (parent) {\n if (isFacetModel(parent)) {\n break;\n }\n parent = parent.parent;\n }\n return parent;\n}\nexport function unitName(model, { escape } = { escape: true }) {\n let name = escape ? stringValue(model.name) : model.name;\n const facetModel = getFacetModel(model);\n if (facetModel) {\n const { facet } = facetModel;\n for (const channel of FACET_CHANNELS) {\n if (facet[channel]) {\n name += ` + '__facet_${channel}_' + (facet[${stringValue(facetModel.vgField(channel))}])`;\n }\n }\n }\n return name;\n}\nexport function requiresSelectionId(model) {\n let identifier = false;\n forEachSelection(model, selCmpt => {\n identifier = identifier || selCmpt.project.items.some(proj => proj.field === SELECTION_ID);\n });\n return identifier;\n}\n//# sourceMappingURL=index.js.map","function accessor (fn, fields, name) {\n fn.fields = fields || [];\n fn.fname = name;\n return fn;\n}\nfunction accessorName(fn) {\n return fn == null ? null : fn.fname;\n}\nfunction accessorFields(fn) {\n return fn == null ? null : fn.fields;\n}\n\nfunction getter (path) {\n return path.length === 1 ? get1(path[0]) : getN(path);\n}\nconst get1 = field => function (obj) {\n return obj[field];\n};\nconst getN = path => {\n const len = path.length;\n return function (obj) {\n for (let i = 0; i < len; ++i) {\n obj = obj[path[i]];\n }\n return obj;\n };\n};\n\nfunction error (message) {\n throw Error(message);\n}\n\nfunction splitAccessPath (p) {\n const path = [],\n n = p.length;\n let q = null,\n b = 0,\n s = '',\n i,\n j,\n c;\n p = p + '';\n function push() {\n path.push(s + p.substring(i, j));\n s = '';\n i = j + 1;\n }\n for (i = j = 0; j < n; ++j) {\n c = p[j];\n if (c === '\\\\') {\n s += p.substring(i, j);\n s += p.substring(++j, ++j);\n i = j;\n } else if (c === q) {\n push();\n q = null;\n b = -1;\n } else if (q) {\n continue;\n } else if (i === b && c === '\"') {\n i = j + 1;\n q = c;\n } else if (i === b && c === \"'\") {\n i = j + 1;\n q = c;\n } else if (c === '.' && !b) {\n if (j > i) {\n push();\n } else {\n i = j + 1;\n }\n } else if (c === '[') {\n if (j > i) push();\n b = i = j + 1;\n } else if (c === ']') {\n if (!b) error('Access path missing open bracket: ' + p);\n if (b > 0) push();\n b = 0;\n i = j + 1;\n }\n }\n if (b) error('Access path missing closing bracket: ' + p);\n if (q) error('Access path missing closing quote: ' + p);\n if (j > i) {\n j++;\n push();\n }\n return path;\n}\n\nfunction field (field, name, opt) {\n const path = splitAccessPath(field);\n field = path.length === 1 ? path[0] : field;\n return accessor((opt && opt.get || getter)(path), [field], name || field);\n}\n\nconst id = field('id');\nconst identity = accessor(_ => _, [], 'identity');\nconst zero = accessor(() => 0, [], 'zero');\nconst one = accessor(() => 1, [], 'one');\nconst truthy = accessor(() => true, [], 'true');\nconst falsy = accessor(() => false, [], 'false');\n\nfunction log$1(method, level, input) {\n const args = [level].concat([].slice.call(input));\n console[method].apply(console, args); // eslint-disable-line no-console\n}\n\nconst None = 0;\nconst Error$1 = 1;\nconst Warn = 2;\nconst Info = 3;\nconst Debug = 4;\nfunction logger (_, method) {\n let handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : log$1;\n let level = _ || None;\n return {\n level(_) {\n if (arguments.length) {\n level = +_;\n return this;\n } else {\n return level;\n }\n },\n error() {\n if (level >= Error$1) handler(method || 'error', 'ERROR', arguments);\n return this;\n },\n warn() {\n if (level >= Warn) handler(method || 'warn', 'WARN', arguments);\n return this;\n },\n info() {\n if (level >= Info) handler(method || 'log', 'INFO', arguments);\n return this;\n },\n debug() {\n if (level >= Debug) handler(method || 'log', 'DEBUG', arguments);\n return this;\n }\n };\n}\n\nvar isArray = Array.isArray;\n\nfunction isObject (_) {\n return _ === Object(_);\n}\n\nconst isLegalKey = key => key !== '__proto__';\nfunction mergeConfig() {\n for (var _len = arguments.length, configs = new Array(_len), _key = 0; _key < _len; _key++) {\n configs[_key] = arguments[_key];\n }\n return configs.reduce((out, source) => {\n for (const key in source) {\n if (key === 'signals') {\n // for signals, we merge the signals arrays\n // source signals take precedence over\n // existing signals with the same name\n out.signals = mergeNamed(out.signals, source.signals);\n } else {\n // otherwise, merge objects subject to recursion constraints\n // for legend block, recurse for the layout entry only\n // for style block, recurse for all properties\n // otherwise, no recursion: objects overwrite, no merging\n const r = key === 'legend' ? {\n layout: 1\n } : key === 'style' ? true : null;\n writeConfig(out, key, source[key], r);\n }\n }\n return out;\n }, {});\n}\nfunction writeConfig(output, key, value, recurse) {\n if (!isLegalKey(key)) return;\n let k, o;\n if (isObject(value) && !isArray(value)) {\n o = isObject(output[key]) ? output[key] : output[key] = {};\n for (k in value) {\n if (recurse && (recurse === true || recurse[k])) {\n writeConfig(o, k, value[k]);\n } else if (isLegalKey(k)) {\n o[k] = value[k];\n }\n }\n } else {\n output[key] = value;\n }\n}\nfunction mergeNamed(a, b) {\n if (a == null) return b;\n const map = {},\n out = [];\n function add(_) {\n if (!map[_.name]) {\n map[_.name] = 1;\n out.push(_);\n }\n }\n b.forEach(add);\n a.forEach(add);\n return out;\n}\n\nfunction peek (array) {\n return array[array.length - 1];\n}\n\nfunction toNumber (_) {\n return _ == null || _ === '' ? null : +_;\n}\n\nconst exp = sign => x => sign * Math.exp(x);\nconst log = sign => x => Math.log(sign * x);\nconst symlog = c => x => Math.sign(x) * Math.log1p(Math.abs(x / c));\nconst symexp = c => x => Math.sign(x) * Math.expm1(Math.abs(x)) * c;\nconst pow = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\nfunction pan(domain, delta, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n dd = (d1 - d0) * delta;\n return [ground(d0 - dd), ground(d1 - dd)];\n}\nfunction panLinear(domain, delta) {\n return pan(domain, delta, toNumber, identity);\n}\nfunction panLog(domain, delta) {\n var sign = Math.sign(domain[0]);\n return pan(domain, delta, log(sign), exp(sign));\n}\nfunction panPow(domain, delta, exponent) {\n return pan(domain, delta, pow(exponent), pow(1 / exponent));\n}\nfunction panSymlog(domain, delta, constant) {\n return pan(domain, delta, symlog(constant), symexp(constant));\n}\nfunction zoom(domain, anchor, scale, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n da = anchor != null ? lift(anchor) : (d0 + d1) / 2;\n return [ground(da + (d0 - da) * scale), ground(da + (d1 - da) * scale)];\n}\nfunction zoomLinear(domain, anchor, scale) {\n return zoom(domain, anchor, scale, toNumber, identity);\n}\nfunction zoomLog(domain, anchor, scale) {\n const sign = Math.sign(domain[0]);\n return zoom(domain, anchor, scale, log(sign), exp(sign));\n}\nfunction zoomPow(domain, anchor, scale, exponent) {\n return zoom(domain, anchor, scale, pow(exponent), pow(1 / exponent));\n}\nfunction zoomSymlog(domain, anchor, scale, constant) {\n return zoom(domain, anchor, scale, symlog(constant), symexp(constant));\n}\n\nfunction quarter(date) {\n return 1 + ~~(new Date(date).getMonth() / 3);\n}\nfunction utcquarter(date) {\n return 1 + ~~(new Date(date).getUTCMonth() / 3);\n}\n\nfunction array (_) {\n return _ != null ? isArray(_) ? _ : [_] : [];\n}\n\n/**\n * Span-preserving range clamp. If the span of the input range is less\n * than (max - min) and an endpoint exceeds either the min or max value,\n * the range is translated such that the span is preserved and one\n * endpoint touches the boundary of the min/max range.\n * If the span exceeds (max - min), the range [min, max] is returned.\n */\nfunction clampRange (range, min, max) {\n let lo = range[0],\n hi = range[1],\n span;\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n span = hi - lo;\n return span >= max - min ? [min, max] : [lo = Math.min(Math.max(lo, min), max - span), lo + span];\n}\n\nfunction isFunction (_) {\n return typeof _ === 'function';\n}\n\nconst DESCENDING = 'descending';\nfunction compare (fields, orders, opt) {\n opt = opt || {};\n orders = array(orders) || [];\n const ord = [],\n get = [],\n fmap = {},\n gen = opt.comparator || comparator;\n array(fields).forEach((f, i) => {\n if (f == null) return;\n ord.push(orders[i] === DESCENDING ? -1 : 1);\n get.push(f = isFunction(f) ? f : field(f, null, opt));\n (accessorFields(f) || []).forEach(_ => fmap[_] = 1);\n });\n return get.length === 0 ? null : accessor(gen(get, ord), Object.keys(fmap));\n}\nconst ascending = (u, v) => (u < v || u == null) && v != null ? -1 : (u > v || v == null) && u != null ? 1 : (v = v instanceof Date ? +v : v, u = u instanceof Date ? +u : u) !== u && v === v ? -1 : v !== v && u === u ? 1 : 0;\nconst comparator = (fields, orders) => fields.length === 1 ? compare1(fields[0], orders[0]) : compareN(fields, orders, fields.length);\nconst compare1 = (field, order) => function (a, b) {\n return ascending(field(a), field(b)) * order;\n};\nconst compareN = (fields, orders, n) => {\n orders.push(0); // pad zero for convenient lookup\n return function (a, b) {\n let f,\n c = 0,\n i = -1;\n while (c === 0 && ++i < n) {\n f = fields[i];\n c = ascending(f(a), f(b));\n }\n return c * orders[i];\n };\n};\n\nfunction constant (_) {\n return isFunction(_) ? _ : () => _;\n}\n\nfunction debounce (delay, handler) {\n let tid;\n return e => {\n if (tid) clearTimeout(tid);\n tid = setTimeout(() => (handler(e), tid = null), delay);\n };\n}\n\nfunction extend (_) {\n for (let x, k, i = 1, len = arguments.length; i < len; ++i) {\n x = arguments[i];\n for (k in x) {\n _[k] = x[k];\n }\n }\n return _;\n}\n\n/**\n * Return an array with minimum and maximum values, in the\n * form [min, max]. Ignores null, undefined, and NaN values.\n */\nfunction extent (array, f) {\n let i = 0,\n n,\n v,\n min,\n max;\n if (array && (n = array.length)) {\n if (f == null) {\n // find first valid value\n for (v = array[i]; i < n && (v == null || v !== v); v = array[++i]);\n min = max = v;\n\n // visit all other values\n for (; i < n; ++i) {\n v = array[i];\n // skip null/undefined; NaN will fail all comparisons\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n } else {\n // find first valid value\n for (v = f(array[i]); i < n && (v == null || v !== v); v = f(array[++i]));\n min = max = v;\n\n // visit all other values\n for (; i < n; ++i) {\n v = f(array[i]);\n // skip null/undefined; NaN will fail all comparisons\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n }\n }\n return [min, max];\n}\n\nfunction extentIndex (array, f) {\n const n = array.length;\n let i = -1,\n a,\n b,\n c,\n u,\n v;\n if (f == null) {\n while (++i < n) {\n b = array[i];\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n if (i === n) return [-1, -1];\n u = v = i;\n while (++i < n) {\n b = array[i];\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n } else {\n while (++i < n) {\n b = f(array[i], i, array);\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n if (i === n) return [-1, -1];\n u = v = i;\n while (++i < n) {\n b = f(array[i], i, array);\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n }\n return [u, v];\n}\n\nconst hop = Object.prototype.hasOwnProperty;\nfunction has (object, property) {\n return hop.call(object, property);\n}\n\nconst NULL = {};\nfunction fastmap (input) {\n let obj = {},\n test;\n function has$1(key) {\n return has(obj, key) && obj[key] !== NULL;\n }\n const map = {\n size: 0,\n empty: 0,\n object: obj,\n has: has$1,\n get(key) {\n return has$1(key) ? obj[key] : undefined;\n },\n set(key, value) {\n if (!has$1(key)) {\n ++map.size;\n if (obj[key] === NULL) --map.empty;\n }\n obj[key] = value;\n return this;\n },\n delete(key) {\n if (has$1(key)) {\n --map.size;\n ++map.empty;\n obj[key] = NULL;\n }\n return this;\n },\n clear() {\n map.size = map.empty = 0;\n map.object = obj = {};\n },\n test(_) {\n if (arguments.length) {\n test = _;\n return map;\n } else {\n return test;\n }\n },\n clean() {\n const next = {};\n let size = 0;\n for (const key in obj) {\n const value = obj[key];\n if (value !== NULL && (!test || !test(value))) {\n next[key] = value;\n ++size;\n }\n }\n map.size = size;\n map.empty = 0;\n map.object = obj = next;\n }\n };\n if (input) Object.keys(input).forEach(key => {\n map.set(key, input[key]);\n });\n return map;\n}\n\nfunction flush (range, value, threshold, left, right, center) {\n if (!threshold && threshold !== 0) return center;\n const t = +threshold;\n let a = range[0],\n b = peek(range),\n l;\n\n // swap endpoints if range is reversed\n if (b < a) {\n l = a;\n a = b;\n b = l;\n }\n\n // compare value to endpoints\n l = Math.abs(value - a);\n const r = Math.abs(b - value);\n\n // adjust if value is within threshold distance of endpoint\n return l < r && l <= t ? left : r <= t ? right : center;\n}\n\nfunction inherits (child, parent, members) {\n const proto = child.prototype = Object.create(parent.prototype);\n Object.defineProperty(proto, 'constructor', {\n value: child,\n writable: true,\n enumerable: true,\n configurable: true\n });\n return extend(proto, members);\n}\n\n/**\n * Predicate that returns true if the value lies within the span\n * of the given range. The left and right flags control the use\n * of inclusive (true) or exclusive (false) comparisons.\n */\nfunction inrange (value, range, left, right) {\n let r0 = range[0],\n r1 = range[range.length - 1],\n t;\n if (r0 > r1) {\n t = r0;\n r0 = r1;\n r1 = t;\n }\n left = left === undefined || left;\n right = right === undefined || right;\n return (left ? r0 <= value : r0 < value) && (right ? value <= r1 : value < r1);\n}\n\nfunction isBoolean (_) {\n return typeof _ === 'boolean';\n}\n\nfunction isDate (_) {\n return Object.prototype.toString.call(_) === '[object Date]';\n}\n\nfunction isIterable (_) {\n return _ && isFunction(_[Symbol.iterator]);\n}\n\nfunction isNumber (_) {\n return typeof _ === 'number';\n}\n\nfunction isRegExp (_) {\n return Object.prototype.toString.call(_) === '[object RegExp]';\n}\n\nfunction isString (_) {\n return typeof _ === 'string';\n}\n\nfunction key (fields, flat, opt) {\n if (fields) {\n fields = flat ? array(fields).map(f => f.replace(/\\\\(.)/g, '$1')) : array(fields);\n }\n const len = fields && fields.length,\n gen = opt && opt.get || getter,\n map = f => gen(flat ? [f] : splitAccessPath(f));\n let fn;\n if (!len) {\n fn = function () {\n return '';\n };\n } else if (len === 1) {\n const get = map(fields[0]);\n fn = function (_) {\n return '' + get(_);\n };\n } else {\n const get = fields.map(map);\n fn = function (_) {\n let s = '' + get[0](_),\n i = 0;\n while (++i < len) s += '|' + get[i](_);\n return s;\n };\n }\n return accessor(fn, fields, 'key');\n}\n\nfunction lerp (array, frac) {\n const lo = array[0],\n hi = peek(array),\n f = +frac;\n return !f ? lo : f === 1 ? hi : lo + f * (hi - lo);\n}\n\nconst DEFAULT_MAX_SIZE = 10000;\n\n// adapted from https://github.com/dominictarr/hashlru/ (MIT License)\nfunction lruCache (maxsize) {\n maxsize = +maxsize || DEFAULT_MAX_SIZE;\n let curr, prev, size;\n const clear = () => {\n curr = {};\n prev = {};\n size = 0;\n };\n const update = (key, value) => {\n if (++size > maxsize) {\n prev = curr;\n curr = {};\n size = 1;\n }\n return curr[key] = value;\n };\n clear();\n return {\n clear,\n has: key => has(curr, key) || has(prev, key),\n get: key => has(curr, key) ? curr[key] : has(prev, key) ? update(key, prev[key]) : undefined,\n set: (key, value) => has(curr, key) ? curr[key] = value : update(key, value)\n };\n}\n\nfunction merge (compare, array0, array1, output) {\n const n0 = array0.length,\n n1 = array1.length;\n if (!n1) return array0;\n if (!n0) return array1;\n const merged = output || new array0.constructor(n0 + n1);\n let i0 = 0,\n i1 = 0,\n i = 0;\n for (; i0 < n0 && i1 < n1; ++i) {\n merged[i] = compare(array0[i0], array1[i1]) > 0 ? array1[i1++] : array0[i0++];\n }\n for (; i0 < n0; ++i0, ++i) {\n merged[i] = array0[i0];\n }\n for (; i1 < n1; ++i1, ++i) {\n merged[i] = array1[i1];\n }\n return merged;\n}\n\nfunction repeat (str, reps) {\n let s = '';\n while (--reps >= 0) s += str;\n return s;\n}\n\nfunction pad (str, length, padchar, align) {\n const c = padchar || ' ',\n s = str + '',\n n = length - s.length;\n return n <= 0 ? s : align === 'left' ? repeat(c, n) + s : align === 'center' ? repeat(c, ~~(n / 2)) + s + repeat(c, Math.ceil(n / 2)) : s + repeat(c, n);\n}\n\n/**\n * Return the numerical span of an array: the difference between\n * the last and first values.\n */\nfunction span (array) {\n return array && peek(array) - array[0] || 0;\n}\n\nfunction $(x) {\n return isArray(x) ? '[' + x.map($) + ']' : isObject(x) || isString(x) ?\n // Output valid JSON and JS source strings.\n // See http://timelessrepo.com/json-isnt-a-javascript-subset\n JSON.stringify(x).replace('\\u2028', '\\\\u2028').replace('\\u2029', '\\\\u2029') : x;\n}\n\nfunction toBoolean (_) {\n return _ == null || _ === '' ? null : !_ || _ === 'false' || _ === '0' ? false : !!_;\n}\n\nconst defaultParser = _ => isNumber(_) ? _ : isDate(_) ? _ : Date.parse(_);\nfunction toDate (_, parser) {\n parser = parser || defaultParser;\n return _ == null || _ === '' ? null : parser(_);\n}\n\nfunction toString (_) {\n return _ == null || _ === '' ? null : _ + '';\n}\n\nfunction toSet (_) {\n const s = {},\n n = _.length;\n for (let i = 0; i < n; ++i) s[_[i]] = true;\n return s;\n}\n\nfunction truncate (str, length, align, ellipsis) {\n const e = ellipsis != null ? ellipsis : '\\u2026',\n s = str + '',\n n = s.length,\n l = Math.max(0, length - e.length);\n return n <= length ? s : align === 'left' ? e + s.slice(n - l) : align === 'center' ? s.slice(0, Math.ceil(l / 2)) + e + s.slice(n - ~~(l / 2)) : s.slice(0, l) + e;\n}\n\nfunction visitArray (array, filter, visitor) {\n if (array) {\n if (filter) {\n const n = array.length;\n for (let i = 0; i < n; ++i) {\n const t = filter(array[i]);\n if (t) visitor(t, i, array);\n }\n } else {\n array.forEach(visitor);\n }\n }\n}\n\nexport { Debug, Error$1 as Error, Info, None, Warn, accessor, accessorFields, accessorName, array, ascending, clampRange, compare, constant, debounce, error, extend, extent, extentIndex, falsy, fastmap, field, flush, has as hasOwnProperty, id, identity, inherits, inrange, isArray, isBoolean, isDate, isFunction, isIterable, isNumber, isObject, isRegExp, isString, key, lerp, logger, lruCache, merge, mergeConfig, one, pad, panLinear, panLog, panPow, panSymlog, peek, quarter, repeat, span, splitAccessPath, $ as stringValue, toBoolean, toDate, toNumber, toSet, toString, truncate, truthy, utcquarter, visitArray, writeConfig, zero, zoomLinear, zoomLog, zoomPow, zoomSymlog };\n","import { error, toSet, isFunction, isString, hasOwnProperty } from 'vega-util';\n\nconst RawCode = 'RawCode';\nconst Literal = 'Literal';\nconst Property = 'Property';\nconst Identifier = 'Identifier';\nconst ArrayExpression = 'ArrayExpression';\nconst BinaryExpression = 'BinaryExpression';\nconst CallExpression = 'CallExpression';\nconst ConditionalExpression = 'ConditionalExpression';\nconst LogicalExpression = 'LogicalExpression';\nconst MemberExpression = 'MemberExpression';\nconst ObjectExpression = 'ObjectExpression';\nconst UnaryExpression = 'UnaryExpression';\nfunction ASTNode(type) {\n this.type = type;\n}\n\nASTNode.prototype.visit = function (visitor) {\n let c, i, n;\n if (visitor(this)) return 1;\n\n for (c = children(this), i = 0, n = c.length; i < n; ++i) {\n if (c[i].visit(visitor)) return 1;\n }\n};\n\nfunction children(node) {\n switch (node.type) {\n case ArrayExpression:\n return node.elements;\n\n case BinaryExpression:\n case LogicalExpression:\n return [node.left, node.right];\n\n case CallExpression:\n return [node.callee].concat(node.arguments);\n\n case ConditionalExpression:\n return [node.test, node.consequent, node.alternate];\n\n case MemberExpression:\n return [node.object, node.property];\n\n case ObjectExpression:\n return node.properties;\n\n case Property:\n return [node.key, node.value];\n\n case UnaryExpression:\n return [node.argument];\n\n case Identifier:\n case Literal:\n case RawCode:\n default:\n return [];\n }\n}\n\n/*\n The following expression parser is based on Esprima (http://esprima.org/).\n Original header comment and license for Esprima is included here:\n\n Copyright (C) 2013 Ariya Hidayat \n Copyright (C) 2013 Thaddee Tyl \n Copyright (C) 2013 Mathias Bynens \n Copyright (C) 2012 Ariya Hidayat \n Copyright (C) 2012 Mathias Bynens \n Copyright (C) 2012 Joost-Wim Boekesteijn \n Copyright (C) 2012 Kris Kowal \n Copyright (C) 2012 Yusuke Suzuki \n Copyright (C) 2012 Arpad Borsos \n Copyright (C) 2011 Ariya Hidayat \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\nvar TokenName, source, index, length, lookahead;\nvar TokenBooleanLiteral = 1,\n TokenEOF = 2,\n TokenIdentifier = 3,\n TokenKeyword = 4,\n TokenNullLiteral = 5,\n TokenNumericLiteral = 6,\n TokenPunctuator = 7,\n TokenStringLiteral = 8,\n TokenRegularExpression = 9;\nTokenName = {};\nTokenName[TokenBooleanLiteral] = 'Boolean';\nTokenName[TokenEOF] = '';\nTokenName[TokenIdentifier] = 'Identifier';\nTokenName[TokenKeyword] = 'Keyword';\nTokenName[TokenNullLiteral] = 'Null';\nTokenName[TokenNumericLiteral] = 'Numeric';\nTokenName[TokenPunctuator] = 'Punctuator';\nTokenName[TokenStringLiteral] = 'String';\nTokenName[TokenRegularExpression] = 'RegularExpression';\nvar SyntaxArrayExpression = 'ArrayExpression',\n SyntaxBinaryExpression = 'BinaryExpression',\n SyntaxCallExpression = 'CallExpression',\n SyntaxConditionalExpression = 'ConditionalExpression',\n SyntaxIdentifier = 'Identifier',\n SyntaxLiteral = 'Literal',\n SyntaxLogicalExpression = 'LogicalExpression',\n SyntaxMemberExpression = 'MemberExpression',\n SyntaxObjectExpression = 'ObjectExpression',\n SyntaxProperty = 'Property',\n SyntaxUnaryExpression = 'UnaryExpression'; // Error messages should be identical to V8.\n\nvar MessageUnexpectedToken = 'Unexpected token %0',\n MessageUnexpectedNumber = 'Unexpected number',\n MessageUnexpectedString = 'Unexpected string',\n MessageUnexpectedIdentifier = 'Unexpected identifier',\n MessageUnexpectedReserved = 'Unexpected reserved word',\n MessageUnexpectedEOS = 'Unexpected end of input',\n MessageInvalidRegExp = 'Invalid regular expression',\n MessageUnterminatedRegExp = 'Invalid regular expression: missing /',\n MessageStrictOctalLiteral = 'Octal literals are not allowed in strict mode.',\n MessageStrictDuplicateProperty = 'Duplicate data property in object literal not allowed in strict mode';\nvar ILLEGAL = 'ILLEGAL',\n DISABLED = 'Disabled.'; // See also tools/generate-unicode-regex.py.\n\nvar RegexNonAsciiIdentifierStart = new RegExp('[\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0370-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0620-\\\\u064A\\\\u066E\\\\u066F\\\\u0671-\\\\u06D3\\\\u06D5\\\\u06E5\\\\u06E6\\\\u06EE\\\\u06EF\\\\u06FA-\\\\u06FC\\\\u06FF\\\\u0710\\\\u0712-\\\\u072F\\\\u074D-\\\\u07A5\\\\u07B1\\\\u07CA-\\\\u07EA\\\\u07F4\\\\u07F5\\\\u07FA\\\\u0800-\\\\u0815\\\\u081A\\\\u0824\\\\u0828\\\\u0840-\\\\u0858\\\\u08A0-\\\\u08B2\\\\u0904-\\\\u0939\\\\u093D\\\\u0950\\\\u0958-\\\\u0961\\\\u0971-\\\\u0980\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BD\\\\u09CE\\\\u09DC\\\\u09DD\\\\u09DF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\\\\u0D85-\\\\u0D96\\\\u0D9A-\\\\u0DB1\\\\u0DB3-\\\\u0DBB\\\\u0DBD\\\\u0DC0-\\\\u0DC6\\\\u0E01-\\\\u0E30\\\\u0E32\\\\u0E33\\\\u0E40-\\\\u0E46\\\\u0E81\\\\u0E82\\\\u0E84\\\\u0E87\\\\u0E88\\\\u0E8A\\\\u0E8D\\\\u0E94-\\\\u0E97\\\\u0E99-\\\\u0E9F\\\\u0EA1-\\\\u0EA3\\\\u0EA5\\\\u0EA7\\\\u0EAA\\\\u0EAB\\\\u0EAD-\\\\u0EB0\\\\u0EB2\\\\u0EB3\\\\u0EBD\\\\u0EC0-\\\\u0EC4\\\\u0EC6\\\\u0EDC-\\\\u0EDF\\\\u0F00\\\\u0F40-\\\\u0F47\\\\u0F49-\\\\u0F6C\\\\u0F88-\\\\u0F8C\\\\u1000-\\\\u102A\\\\u103F\\\\u1050-\\\\u1055\\\\u105A-\\\\u105D\\\\u1061\\\\u1065\\\\u1066\\\\u106E-\\\\u1070\\\\u1075-\\\\u1081\\\\u108E\\\\u10A0-\\\\u10C5\\\\u10C7\\\\u10CD\\\\u10D0-\\\\u10FA\\\\u10FC-\\\\u1248\\\\u124A-\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1711\\\\u1720-\\\\u1731\\\\u1740-\\\\u1751\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1780-\\\\u17B3\\\\u17D7\\\\u17DC\\\\u1820-\\\\u1877\\\\u1880-\\\\u18A8\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1950-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19C1-\\\\u19C7\\\\u1A00-\\\\u1A16\\\\u1A20-\\\\u1A54\\\\u1AA7\\\\u1B05-\\\\u1B33\\\\u1B45-\\\\u1B4B\\\\u1B83-\\\\u1BA0\\\\u1BAE\\\\u1BAF\\\\u1BBA-\\\\u1BE5\\\\u1C00-\\\\u1C23\\\\u1C4D-\\\\u1C4F\\\\u1C5A-\\\\u1C7D\\\\u1CE9-\\\\u1CEC\\\\u1CEE-\\\\u1CF1\\\\u1CF5\\\\u1CF6\\\\u1D00-\\\\u1DBF\\\\u1E00-\\\\u1F15\\\\u1F18-\\\\u1F1D\\\\u1F20-\\\\u1F45\\\\u1F48-\\\\u1F4D\\\\u1F50-\\\\u1F57\\\\u1F59\\\\u1F5B\\\\u1F5D\\\\u1F5F-\\\\u1F7D\\\\u1F80-\\\\u1FB4\\\\u1FB6-\\\\u1FBC\\\\u1FBE\\\\u1FC2-\\\\u1FC4\\\\u1FC6-\\\\u1FCC\\\\u1FD0-\\\\u1FD3\\\\u1FD6-\\\\u1FDB\\\\u1FE0-\\\\u1FEC\\\\u1FF2-\\\\u1FF4\\\\u1FF6-\\\\u1FFC\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u2102\\\\u2107\\\\u210A-\\\\u2113\\\\u2115\\\\u2119-\\\\u211D\\\\u2124\\\\u2126\\\\u2128\\\\u212A-\\\\u212D\\\\u212F-\\\\u2139\\\\u213C-\\\\u213F\\\\u2145-\\\\u2149\\\\u214E\\\\u2160-\\\\u2188\\\\u2C00-\\\\u2C2E\\\\u2C30-\\\\u2C5E\\\\u2C60-\\\\u2CE4\\\\u2CEB-\\\\u2CEE\\\\u2CF2\\\\u2CF3\\\\u2D00-\\\\u2D25\\\\u2D27\\\\u2D2D\\\\u2D30-\\\\u2D67\\\\u2D6F\\\\u2D80-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2E2F\\\\u3005-\\\\u3007\\\\u3021-\\\\u3029\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FCC\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA61F\\\\uA62A\\\\uA62B\\\\uA640-\\\\uA66E\\\\uA67F-\\\\uA69D\\\\uA6A0-\\\\uA6EF\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B-\\\\uA78E\\\\uA790-\\\\uA7AD\\\\uA7B0\\\\uA7B1\\\\uA7F7-\\\\uA801\\\\uA803-\\\\uA805\\\\uA807-\\\\uA80A\\\\uA80C-\\\\uA822\\\\uA840-\\\\uA873\\\\uA882-\\\\uA8B3\\\\uA8F2-\\\\uA8F7\\\\uA8FB\\\\uA90A-\\\\uA925\\\\uA930-\\\\uA946\\\\uA960-\\\\uA97C\\\\uA984-\\\\uA9B2\\\\uA9CF\\\\uA9E0-\\\\uA9E4\\\\uA9E6-\\\\uA9EF\\\\uA9FA-\\\\uA9FE\\\\uAA00-\\\\uAA28\\\\uAA40-\\\\uAA42\\\\uAA44-\\\\uAA4B\\\\uAA60-\\\\uAA76\\\\uAA7A\\\\uAA7E-\\\\uAAAF\\\\uAAB1\\\\uAAB5\\\\uAAB6\\\\uAAB9-\\\\uAABD\\\\uAAC0\\\\uAAC2\\\\uAADB-\\\\uAADD\\\\uAAE0-\\\\uAAEA\\\\uAAF2-\\\\uAAF4\\\\uAB01-\\\\uAB06\\\\uAB09-\\\\uAB0E\\\\uAB11-\\\\uAB16\\\\uAB20-\\\\uAB26\\\\uAB28-\\\\uAB2E\\\\uAB30-\\\\uAB5A\\\\uAB5C-\\\\uAB5F\\\\uAB64\\\\uAB65\\\\uABC0-\\\\uABE2\\\\uAC00-\\\\uD7A3\\\\uD7B0-\\\\uD7C6\\\\uD7CB-\\\\uD7FB\\\\uF900-\\\\uFA6D\\\\uFA70-\\\\uFAD9\\\\uFB00-\\\\uFB06\\\\uFB13-\\\\uFB17\\\\uFB1D\\\\uFB1F-\\\\uFB28\\\\uFB2A-\\\\uFB36\\\\uFB38-\\\\uFB3C\\\\uFB3E\\\\uFB40\\\\uFB41\\\\uFB43\\\\uFB44\\\\uFB46-\\\\uFBB1\\\\uFBD3-\\\\uFD3D\\\\uFD50-\\\\uFD8F\\\\uFD92-\\\\uFDC7\\\\uFDF0-\\\\uFDFB\\\\uFE70-\\\\uFE74\\\\uFE76-\\\\uFEFC\\\\uFF21-\\\\uFF3A\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]'),\n // eslint-disable-next-line no-misleading-character-class\nRegexNonAsciiIdentifierPart = new RegExp('[\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0300-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u0483-\\\\u0487\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u0591-\\\\u05BD\\\\u05BF\\\\u05C1\\\\u05C2\\\\u05C4\\\\u05C5\\\\u05C7\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0610-\\\\u061A\\\\u0620-\\\\u0669\\\\u066E-\\\\u06D3\\\\u06D5-\\\\u06DC\\\\u06DF-\\\\u06E8\\\\u06EA-\\\\u06FC\\\\u06FF\\\\u0710-\\\\u074A\\\\u074D-\\\\u07B1\\\\u07C0-\\\\u07F5\\\\u07FA\\\\u0800-\\\\u082D\\\\u0840-\\\\u085B\\\\u08A0-\\\\u08B2\\\\u08E4-\\\\u0963\\\\u0966-\\\\u096F\\\\u0971-\\\\u0983\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BC-\\\\u09C4\\\\u09C7\\\\u09C8\\\\u09CB-\\\\u09CE\\\\u09D7\\\\u09DC\\\\u09DD\\\\u09DF-\\\\u09E3\\\\u09E6-\\\\u09F1\\\\u0A01-\\\\u0A03\\\\u0A05-\\\\u0A0A\\\\u0A0F\\\\u0A10\\\\u0A13-\\\\u0A28\\\\u0A2A-\\\\u0A30\\\\u0A32\\\\u0A33\\\\u0A35\\\\u0A36\\\\u0A38\\\\u0A39\\\\u0A3C\\\\u0A3E-\\\\u0A42\\\\u0A47\\\\u0A48\\\\u0A4B-\\\\u0A4D\\\\u0A51\\\\u0A59-\\\\u0A5C\\\\u0A5E\\\\u0A66-\\\\u0A75\\\\u0A81-\\\\u0A83\\\\u0A85-\\\\u0A8D\\\\u0A8F-\\\\u0A91\\\\u0A93-\\\\u0AA8\\\\u0AAA-\\\\u0AB0\\\\u0AB2\\\\u0AB3\\\\u0AB5-\\\\u0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\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u135D-\\\\u135F\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1714\\\\u1720-\\\\u1734\\\\u1740-\\\\u1753\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1772\\\\u1773\\\\u1780-\\\\u17D3\\\\u17D7\\\\u17DC\\\\u17DD\\\\u17E0-\\\\u17E9\\\\u180B-\\\\u180D\\\\u1810-\\\\u1819\\\\u1820-\\\\u1877\\\\u1880-\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1920-\\\\u192B\\\\u1930-\\\\u193B\\\\u1946-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19B0-\\\\u19C9\\\\u19D0-\\\\u19D9\\\\u1A00-\\\\u1A1B\\\\u1A20-\\\\u1A5E\\\\u1A60-\\\\u1A7C\\\\u1A7F-\\\\u1A89\\\\u1A90-\\\\u1A99\\\\u1AA7\\\\u1AB0-\\\\u1ABD\\\\u1B00-\\\\u1B4B\\\\u1B50-\\\\u1B59\\\\u1B6B-\\\\u1B73\\\\u1B80-\\\\u1BF3\\\\u1C00-\\\\u1C37\\\\u1C40-\\\\u1C49\\\\u1C4D-\\\\u1C7D\\\\u1CD0-\\\\u1CD2\\\\u1CD4-\\\\u1CF6\\\\u1CF8\\\\u1CF9\\\\u1D00-\\\\u1DF5\\\\u1DFC-\\\\u1F15\\\\u1F18-\\\\u1F1D\\\\u1F20-\\\\u1F45\\\\u1F48-\\\\u1F4D\\\\u1F50-\\\\u1F57\\\\u1F59\\\\u1F5B\\\\u1F5D\\\\u1F5F-\\\\u1F7D\\\\u1F80-\\\\u1FB4\\\\u1FB6-\\\\u1FBC\\\\u1FBE\\\\u1FC2-\\\\u1FC4\\\\u1FC6-\\\\u1FCC\\\\u1FD0-\\\\u1FD3\\\\u1FD6-\\\\u1FDB\\\\u1FE0-\\\\u1FEC\\\\u1FF2-\\\\u1FF4\\\\u1FF6-\\\\u1FFC\\\\u200C\\\\u200D\\\\u203F\\\\u2040\\\\u2054\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u20D0-\\\\u20DC\\\\u20E1\\\\u20E5-\\\\u20F0\\\\u2102\\\\u2107\\\\u210A-\\\\u2113\\\\u2115\\\\u2119-\\\\u211D\\\\u2124\\\\u2126\\\\u2128\\\\u212A-\\\\u212D\\\\u212F-\\\\u2139\\\\u213C-\\\\u213F\\\\u2145-\\\\u2149\\\\u214E\\\\u2160-\\\\u2188\\\\u2C00-\\\\u2C2E\\\\u2C30-\\\\u2C5E\\\\u2C60-\\\\u2CE4\\\\u2CEB-\\\\u2CF3\\\\u2D00-\\\\u2D25\\\\u2D27\\\\u2D2D\\\\u2D30-\\\\u2D67\\\\u2D6F\\\\u2D7F-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2DE0-\\\\u2DFF\\\\u2E2F\\\\u3005-\\\\u3007\\\\u3021-\\\\u302F\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u3099\\\\u309A\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30F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38-\\\\uFB3C\\\\uFB3E\\\\uFB40\\\\uFB41\\\\uFB43\\\\uFB44\\\\uFB46-\\\\uFBB1\\\\uFBD3-\\\\uFD3D\\\\uFD50-\\\\uFD8F\\\\uFD92-\\\\uFDC7\\\\uFDF0-\\\\uFDFB\\\\uFE00-\\\\uFE0F\\\\uFE20-\\\\uFE2D\\\\uFE33\\\\uFE34\\\\uFE4D-\\\\uFE4F\\\\uFE70-\\\\uFE74\\\\uFE76-\\\\uFEFC\\\\uFF10-\\\\uFF19\\\\uFF21-\\\\uFF3A\\\\uFF3F\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]'); // Ensure the condition is true, otherwise throw an error.\n// This is only to have a better contract semantic, i.e. another safety net\n// to catch a logic error. The condition shall be fulfilled in normal case.\n// Do NOT use this to enforce a certain condition on any user input.\n\nfunction assert(condition, message) {\n /* istanbul ignore next */\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n}\n\nfunction isDecimalDigit(ch) {\n return ch >= 0x30 && ch <= 0x39; // 0..9\n}\n\nfunction isHexDigit(ch) {\n return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;\n}\n\nfunction isOctalDigit(ch) {\n return '01234567'.indexOf(ch) >= 0;\n} // 7.2 White Space\n\n\nfunction isWhiteSpace(ch) {\n return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0;\n} // 7.3 Line Terminators\n\n\nfunction isLineTerminator(ch) {\n return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;\n} // 7.6 Identifier Names and Identifiers\n\n\nfunction isIdentifierStart(ch) {\n return ch === 0x24 || ch === 0x5F || // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A || // A..Z\n ch >= 0x61 && ch <= 0x7A || // a..z\n ch === 0x5C || // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierStart.test(String.fromCharCode(ch));\n}\n\nfunction isIdentifierPart(ch) {\n return ch === 0x24 || ch === 0x5F || // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A || // A..Z\n ch >= 0x61 && ch <= 0x7A || // a..z\n ch >= 0x30 && ch <= 0x39 || // 0..9\n ch === 0x5C || // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierPart.test(String.fromCharCode(ch));\n} // 7.6.1.1 Keywords\n\n\nconst keywords = {\n 'if': 1,\n 'in': 1,\n 'do': 1,\n 'var': 1,\n 'for': 1,\n 'new': 1,\n 'try': 1,\n 'let': 1,\n 'this': 1,\n 'else': 1,\n 'case': 1,\n 'void': 1,\n 'with': 1,\n 'enum': 1,\n 'while': 1,\n 'break': 1,\n 'catch': 1,\n 'throw': 1,\n 'const': 1,\n 'yield': 1,\n 'class': 1,\n 'super': 1,\n 'return': 1,\n 'typeof': 1,\n 'delete': 1,\n 'switch': 1,\n 'export': 1,\n 'import': 1,\n 'public': 1,\n 'static': 1,\n 'default': 1,\n 'finally': 1,\n 'extends': 1,\n 'package': 1,\n 'private': 1,\n 'function': 1,\n 'continue': 1,\n 'debugger': 1,\n 'interface': 1,\n 'protected': 1,\n 'instanceof': 1,\n 'implements': 1\n};\n\nfunction skipComment() {\n while (index < length) {\n const ch = source.charCodeAt(index);\n\n if (isWhiteSpace(ch) || isLineTerminator(ch)) {\n ++index;\n } else {\n break;\n }\n }\n}\n\nfunction scanHexEscape(prefix) {\n var i,\n len,\n ch,\n code = 0;\n len = prefix === 'u' ? 4 : 2;\n\n for (i = 0; i < len; ++i) {\n if (index < length && isHexDigit(source[index])) {\n ch = source[index++];\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n } else {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n\n return String.fromCharCode(code);\n}\n\nfunction scanUnicodeCodePointEscape() {\n var ch, code, cu1, cu2;\n ch = source[index];\n code = 0; // At least, one hex digit is required.\n\n if (ch === '}') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n while (index < length) {\n ch = source[index++];\n\n if (!isHexDigit(ch)) {\n break;\n }\n\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n }\n\n if (code > 0x10FFFF || ch !== '}') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } // UTF-16 Encoding\n\n\n if (code <= 0xFFFF) {\n return String.fromCharCode(code);\n }\n\n cu1 = (code - 0x10000 >> 10) + 0xD800;\n cu2 = (code - 0x10000 & 1023) + 0xDC00;\n return String.fromCharCode(cu1, cu2);\n}\n\nfunction getEscapedIdentifier() {\n var ch, id;\n ch = source.charCodeAt(index++);\n id = String.fromCharCode(ch); // '\\u' (U+005C, U+0075) denotes an escaped character.\n\n if (ch === 0x5C) {\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n ++index;\n ch = scanHexEscape('u');\n\n if (!ch || ch === '\\\\' || !isIdentifierStart(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n id = ch;\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n\n if (!isIdentifierPart(ch)) {\n break;\n }\n\n ++index;\n id += String.fromCharCode(ch); // '\\u' (U+005C, U+0075) denotes an escaped character.\n\n if (ch === 0x5C) {\n id = id.substr(0, id.length - 1);\n\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n ++index;\n ch = scanHexEscape('u');\n\n if (!ch || ch === '\\\\' || !isIdentifierPart(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n id += ch;\n }\n }\n\n return id;\n}\n\nfunction getIdentifier() {\n var start, ch;\n start = index++;\n\n while (index < length) {\n ch = source.charCodeAt(index);\n\n if (ch === 0x5C) {\n // Blackslash (U+005C) marks Unicode escape sequence.\n index = start;\n return getEscapedIdentifier();\n }\n\n if (isIdentifierPart(ch)) {\n ++index;\n } else {\n break;\n }\n }\n\n return source.slice(start, index);\n}\n\nfunction scanIdentifier() {\n var start, id, type;\n start = index; // Backslash (U+005C) starts an escaped character.\n\n id = source.charCodeAt(index) === 0x5C ? getEscapedIdentifier() : getIdentifier(); // There is no keyword or literal with only one character.\n // Thus, it must be an identifier.\n\n if (id.length === 1) {\n type = TokenIdentifier;\n } else if (keywords.hasOwnProperty(id)) {\n // eslint-disable-line no-prototype-builtins\n type = TokenKeyword;\n } else if (id === 'null') {\n type = TokenNullLiteral;\n } else if (id === 'true' || id === 'false') {\n type = TokenBooleanLiteral;\n } else {\n type = TokenIdentifier;\n }\n\n return {\n type: type,\n value: id,\n start: start,\n end: index\n };\n} // 7.7 Punctuators\n\n\nfunction scanPunctuator() {\n var start = index,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2,\n ch3,\n ch4;\n\n switch (code) {\n // Check for most common single-character punctuators.\n case 0x2E: // . dot\n\n case 0x28: // ( open bracket\n\n case 0x29: // ) close bracket\n\n case 0x3B: // ; semicolon\n\n case 0x2C: // , comma\n\n case 0x7B: // { open curly brace\n\n case 0x7D: // } close curly brace\n\n case 0x5B: // [\n\n case 0x5D: // ]\n\n case 0x3A: // :\n\n case 0x3F: // ?\n\n case 0x7E:\n // ~\n ++index;\n return {\n type: TokenPunctuator,\n value: String.fromCharCode(code),\n start: start,\n end: index\n };\n\n default:\n code2 = source.charCodeAt(index + 1); // '=' (U+003D) marks an assignment or comparison operator.\n\n if (code2 === 0x3D) {\n switch (code) {\n case 0x2B: // +\n\n case 0x2D: // -\n\n case 0x2F: // /\n\n case 0x3C: // <\n\n case 0x3E: // >\n\n case 0x5E: // ^\n\n case 0x7C: // |\n\n case 0x25: // %\n\n case 0x26: // &\n\n case 0x2A:\n // *\n index += 2;\n return {\n type: TokenPunctuator,\n value: String.fromCharCode(code) + String.fromCharCode(code2),\n start: start,\n end: index\n };\n\n case 0x21: // !\n\n case 0x3D:\n // =\n index += 2; // !== and ===\n\n if (source.charCodeAt(index) === 0x3D) {\n ++index;\n }\n\n return {\n type: TokenPunctuator,\n value: source.slice(start, index),\n start: start,\n end: index\n };\n }\n }\n\n } // 4-character punctuator: >>>=\n\n\n ch4 = source.substr(index, 4);\n\n if (ch4 === '>>>=') {\n index += 4;\n return {\n type: TokenPunctuator,\n value: ch4,\n start: start,\n end: index\n };\n } // 3-character punctuators: === !== >>> <<= >>=\n\n\n ch3 = ch4.substr(0, 3);\n\n if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {\n index += 3;\n return {\n type: TokenPunctuator,\n value: ch3,\n start: start,\n end: index\n };\n } // Other 2-character punctuators: ++ -- << >> && ||\n\n\n ch2 = ch3.substr(0, 2);\n\n if (ch1 === ch2[1] && '+-<>&|'.indexOf(ch1) >= 0 || ch2 === '=>') {\n index += 2;\n return {\n type: TokenPunctuator,\n value: ch2,\n start: start,\n end: index\n };\n }\n\n if (ch2 === '//') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } // 1-character punctuators: < > = ! + - * % & | ^ /\n\n\n if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n ++index;\n return {\n type: TokenPunctuator,\n value: ch1,\n start: start,\n end: index\n };\n }\n\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n} // 7.8.3 Numeric Literals\n\n\nfunction scanHexLiteral(start) {\n let number = '';\n\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n\n number += source[index++];\n }\n\n if (number.length === 0) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenNumericLiteral,\n value: parseInt('0x' + number, 16),\n start: start,\n end: index\n };\n}\n\nfunction scanOctalLiteral(start) {\n let number = '0' + source[index++];\n\n while (index < length) {\n if (!isOctalDigit(source[index])) {\n break;\n }\n\n number += source[index++];\n }\n\n if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenNumericLiteral,\n value: parseInt(number, 8),\n octal: true,\n start: start,\n end: index\n };\n}\n\nfunction scanNumericLiteral() {\n var number, start, ch;\n ch = source[index];\n assert(isDecimalDigit(ch.charCodeAt(0)) || ch === '.', 'Numeric literal must start with a decimal digit or a decimal point');\n start = index;\n number = '';\n\n if (ch !== '.') {\n number = source[index++];\n ch = source[index]; // Hex number starts with '0x'.\n // Octal number starts with '0'.\n\n if (number === '0') {\n if (ch === 'x' || ch === 'X') {\n ++index;\n return scanHexLiteral(start);\n }\n\n if (isOctalDigit(ch)) {\n return scanOctalLiteral(start);\n } // decimal number starts with '0' such as '09' is illegal.\n\n\n if (ch && isDecimalDigit(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n\n ch = source[index];\n }\n\n if (ch === '.') {\n number += source[index++];\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n\n ch = source[index];\n }\n\n if (ch === 'e' || ch === 'E') {\n number += source[index++];\n ch = source[index];\n\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n\n if (isDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenNumericLiteral,\n value: parseFloat(number),\n start: start,\n end: index\n };\n} // 7.8.4 String Literals\n\n\nfunction scanStringLiteral() {\n var str = '',\n quote,\n start,\n ch,\n code,\n octal = false;\n quote = source[index];\n assert(quote === '\\'' || quote === '\"', 'String literal must starts with a quote');\n start = index;\n ++index;\n\n while (index < length) {\n ch = source[index++];\n\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n\n if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'u':\n case 'x':\n if (source[index] === '{') {\n ++index;\n str += scanUnicodeCodePointEscape();\n } else {\n str += scanHexEscape(ch);\n }\n\n break;\n\n case 'n':\n str += '\\n';\n break;\n\n case 'r':\n str += '\\r';\n break;\n\n case 't':\n str += '\\t';\n break;\n\n case 'b':\n str += '\\b';\n break;\n\n case 'f':\n str += '\\f';\n break;\n\n case 'v':\n str += '\\x0B';\n break;\n\n default:\n if (isOctalDigit(ch)) {\n code = '01234567'.indexOf(ch); // \\0 is not octal escape sequence\n\n if (code !== 0) {\n octal = true;\n }\n\n if (index < length && isOctalDigit(source[index])) {\n octal = true;\n code = code * 8 + '01234567'.indexOf(source[index++]); // 3 digits are only allowed when string starts\n // with 0, 1, 2, 3\n\n if ('0123'.indexOf(ch) >= 0 && index < length && isOctalDigit(source[index])) {\n code = code * 8 + '01234567'.indexOf(source[index++]);\n }\n }\n\n str += String.fromCharCode(code);\n } else {\n str += ch;\n }\n\n break;\n }\n } else {\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n\n if (quote !== '') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenStringLiteral,\n value: str,\n octal: octal,\n start: start,\n end: index\n };\n}\n\nfunction testRegExp(pattern, flags) {\n let tmp = pattern;\n\n if (flags.indexOf('u') >= 0) {\n // Replace each astral symbol and every Unicode code point\n // escape sequence with a single ASCII symbol to avoid throwing on\n // regular expressions that are only valid in combination with the\n // `/u` flag.\n // Note: replacing with the ASCII symbol `x` might cause false\n // negatives in unlikely scenarios. For example, `[\\u{61}-b]` is a\n // perfectly valid pattern that is equivalent to `[a-b]`, but it\n // would be replaced by `[x-b]` which throws an error.\n tmp = tmp.replace(/\\\\u\\{([0-9a-fA-F]+)\\}/g, ($0, $1) => {\n if (parseInt($1, 16) <= 0x10FFFF) {\n return 'x';\n }\n\n throwError({}, MessageInvalidRegExp);\n }).replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g, 'x');\n } // First, detect invalid regular expressions.\n\n\n try {\n new RegExp(tmp);\n } catch (e) {\n throwError({}, MessageInvalidRegExp);\n } // Return a regular expression object for this pattern-flag pair, or\n // `null` in case the current environment doesn't support the flags it\n // uses.\n\n\n try {\n return new RegExp(pattern, flags);\n } catch (exception) {\n return null;\n }\n}\n\nfunction scanRegExpBody() {\n var ch, str, classMarker, terminated, body;\n ch = source[index];\n assert(ch === '/', 'Regular expression literal must start with a slash');\n str = source[index++];\n classMarker = false;\n terminated = false;\n\n while (index < length) {\n ch = source[index++];\n str += ch;\n\n if (ch === '\\\\') {\n ch = source[index++]; // ECMA-262 7.8.5\n\n if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, MessageUnterminatedRegExp);\n }\n\n str += ch;\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, MessageUnterminatedRegExp);\n } else if (classMarker) {\n if (ch === ']') {\n classMarker = false;\n }\n } else {\n if (ch === '/') {\n terminated = true;\n break;\n } else if (ch === '[') {\n classMarker = true;\n }\n }\n }\n\n if (!terminated) {\n throwError({}, MessageUnterminatedRegExp);\n } // Exclude leading and trailing slash.\n\n\n body = str.substr(1, str.length - 2);\n return {\n value: body,\n literal: str\n };\n}\n\nfunction scanRegExpFlags() {\n var ch, str, flags;\n str = '';\n flags = '';\n\n while (index < length) {\n ch = source[index];\n\n if (!isIdentifierPart(ch.charCodeAt(0))) {\n break;\n }\n\n ++index;\n\n if (ch === '\\\\' && index < length) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } else {\n flags += ch;\n str += ch;\n }\n }\n\n if (flags.search(/[^gimuy]/g) >= 0) {\n throwError({}, MessageInvalidRegExp, flags);\n }\n\n return {\n value: flags,\n literal: str\n };\n}\n\nfunction scanRegExp() {\n var start, body, flags, value;\n lookahead = null;\n skipComment();\n start = index;\n body = scanRegExpBody();\n flags = scanRegExpFlags();\n value = testRegExp(body.value, flags.value);\n return {\n literal: body.literal + flags.literal,\n value: value,\n regex: {\n pattern: body.value,\n flags: flags.value\n },\n start: start,\n end: index\n };\n}\n\nfunction isIdentifierName(token) {\n return token.type === TokenIdentifier || token.type === TokenKeyword || token.type === TokenBooleanLiteral || token.type === TokenNullLiteral;\n}\n\nfunction advance() {\n skipComment();\n\n if (index >= length) {\n return {\n type: TokenEOF,\n start: index,\n end: index\n };\n }\n\n const ch = source.charCodeAt(index);\n\n if (isIdentifierStart(ch)) {\n return scanIdentifier();\n } // Very common: ( and ) and ;\n\n\n if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {\n return scanPunctuator();\n } // String literal starts with single quote (U+0027) or double quote (U+0022).\n\n\n if (ch === 0x27 || ch === 0x22) {\n return scanStringLiteral();\n } // Dot (.) U+002E can also start a floating-point number, hence the need\n // to check the next character.\n\n\n if (ch === 0x2E) {\n if (isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNumericLiteral();\n }\n\n return scanPunctuator();\n }\n\n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n\n return scanPunctuator();\n}\n\nfunction lex() {\n const token = lookahead;\n index = token.end;\n lookahead = advance();\n index = token.end;\n return token;\n}\n\nfunction peek() {\n const pos = index;\n lookahead = advance();\n index = pos;\n}\n\nfunction finishArrayExpression(elements) {\n const node = new ASTNode(SyntaxArrayExpression);\n node.elements = elements;\n return node;\n}\n\nfunction finishBinaryExpression(operator, left, right) {\n const node = new ASTNode(operator === '||' || operator === '&&' ? SyntaxLogicalExpression : SyntaxBinaryExpression);\n node.operator = operator;\n node.left = left;\n node.right = right;\n return node;\n}\n\nfunction finishCallExpression(callee, args) {\n const node = new ASTNode(SyntaxCallExpression);\n node.callee = callee;\n node.arguments = args;\n return node;\n}\n\nfunction finishConditionalExpression(test, consequent, alternate) {\n const node = new ASTNode(SyntaxConditionalExpression);\n node.test = test;\n node.consequent = consequent;\n node.alternate = alternate;\n return node;\n}\n\nfunction finishIdentifier(name) {\n const node = new ASTNode(SyntaxIdentifier);\n node.name = name;\n return node;\n}\n\nfunction finishLiteral(token) {\n const node = new ASTNode(SyntaxLiteral);\n node.value = token.value;\n node.raw = source.slice(token.start, token.end);\n\n if (token.regex) {\n if (node.raw === '//') {\n node.raw = '/(?:)/';\n }\n\n node.regex = token.regex;\n }\n\n return node;\n}\n\nfunction finishMemberExpression(accessor, object, property) {\n const node = new ASTNode(SyntaxMemberExpression);\n node.computed = accessor === '[';\n node.object = object;\n node.property = property;\n if (!node.computed) property.member = true;\n return node;\n}\n\nfunction finishObjectExpression(properties) {\n const node = new ASTNode(SyntaxObjectExpression);\n node.properties = properties;\n return node;\n}\n\nfunction finishProperty(kind, key, value) {\n const node = new ASTNode(SyntaxProperty);\n node.key = key;\n node.value = value;\n node.kind = kind;\n return node;\n}\n\nfunction finishUnaryExpression(operator, argument) {\n const node = new ASTNode(SyntaxUnaryExpression);\n node.operator = operator;\n node.argument = argument;\n node.prefix = true;\n return node;\n} // Throw an exception\n\n\nfunction throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(/%(\\d)/g, (whole, index) => {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n });\n error = new Error(msg);\n error.index = index;\n error.description = msg;\n throw error;\n} // Throw an exception because of the token.\n\n\nfunction throwUnexpected(token) {\n if (token.type === TokenEOF) {\n throwError(token, MessageUnexpectedEOS);\n }\n\n if (token.type === TokenNumericLiteral) {\n throwError(token, MessageUnexpectedNumber);\n }\n\n if (token.type === TokenStringLiteral) {\n throwError(token, MessageUnexpectedString);\n }\n\n if (token.type === TokenIdentifier) {\n throwError(token, MessageUnexpectedIdentifier);\n }\n\n if (token.type === TokenKeyword) {\n throwError(token, MessageUnexpectedReserved);\n } // BooleanLiteral, NullLiteral, or Punctuator.\n\n\n throwError(token, MessageUnexpectedToken, token.value);\n} // Expect the next token to match the specified punctuator.\n// If not, an exception will be thrown.\n\n\nfunction expect(value) {\n const token = lex();\n\n if (token.type !== TokenPunctuator || token.value !== value) {\n throwUnexpected(token);\n }\n} // Return true if the next token matches the specified punctuator.\n\n\nfunction match(value) {\n return lookahead.type === TokenPunctuator && lookahead.value === value;\n} // Return true if the next token matches the specified keyword\n\n\nfunction matchKeyword(keyword) {\n return lookahead.type === TokenKeyword && lookahead.value === keyword;\n} // 11.1.4 Array Initialiser\n\n\nfunction parseArrayInitialiser() {\n const elements = [];\n index = lookahead.start;\n expect('[');\n\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elements.push(parseConditionalExpression());\n\n if (!match(']')) {\n expect(',');\n }\n }\n }\n\n lex();\n return finishArrayExpression(elements);\n} // 11.1.5 Object Initialiser\n\n\nfunction parseObjectPropertyKey() {\n index = lookahead.start;\n const token = lex(); // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n\n if (token.type === TokenStringLiteral || token.type === TokenNumericLiteral) {\n if (token.octal) {\n throwError(token, MessageStrictOctalLiteral);\n }\n\n return finishLiteral(token);\n }\n\n return finishIdentifier(token.value);\n}\n\nfunction parseObjectProperty() {\n var token, key, id, value;\n index = lookahead.start;\n token = lookahead;\n\n if (token.type === TokenIdentifier) {\n id = parseObjectPropertyKey();\n expect(':');\n value = parseConditionalExpression();\n return finishProperty('init', id, value);\n }\n\n if (token.type === TokenEOF || token.type === TokenPunctuator) {\n throwUnexpected(token);\n } else {\n key = parseObjectPropertyKey();\n expect(':');\n value = parseConditionalExpression();\n return finishProperty('init', key, value);\n }\n}\n\nfunction parseObjectInitialiser() {\n var properties = [],\n property,\n name,\n key,\n map = {},\n toString = String;\n index = lookahead.start;\n expect('{');\n\n while (!match('}')) {\n property = parseObjectProperty();\n\n if (property.key.type === SyntaxIdentifier) {\n name = property.key.name;\n } else {\n name = toString(property.key.value);\n }\n\n key = '$' + name;\n\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n throwError({}, MessageStrictDuplicateProperty);\n } else {\n map[key] = true;\n }\n\n properties.push(property);\n\n if (!match('}')) {\n expect(',');\n }\n }\n\n expect('}');\n return finishObjectExpression(properties);\n} // 11.1.6 The Grouping Operator\n\n\nfunction parseGroupExpression() {\n expect('(');\n const expr = parseExpression();\n expect(')');\n return expr;\n} // 11.1 Primary Expressions\n\n\nconst legalKeywords = {\n 'if': 1\n};\n\nfunction parsePrimaryExpression() {\n var type, token, expr;\n\n if (match('(')) {\n return parseGroupExpression();\n }\n\n if (match('[')) {\n return parseArrayInitialiser();\n }\n\n if (match('{')) {\n return parseObjectInitialiser();\n }\n\n type = lookahead.type;\n index = lookahead.start;\n\n if (type === TokenIdentifier || legalKeywords[lookahead.value]) {\n expr = finishIdentifier(lex().value);\n } else if (type === TokenStringLiteral || type === TokenNumericLiteral) {\n if (lookahead.octal) {\n throwError(lookahead, MessageStrictOctalLiteral);\n }\n\n expr = finishLiteral(lex());\n } else if (type === TokenKeyword) {\n throw new Error(DISABLED);\n } else if (type === TokenBooleanLiteral) {\n token = lex();\n token.value = token.value === 'true';\n expr = finishLiteral(token);\n } else if (type === TokenNullLiteral) {\n token = lex();\n token.value = null;\n expr = finishLiteral(token);\n } else if (match('/') || match('/=')) {\n expr = finishLiteral(scanRegExp());\n peek();\n } else {\n throwUnexpected(lex());\n }\n\n return expr;\n} // 11.2 Left-Hand-Side Expressions\n\n\nfunction parseArguments() {\n const args = [];\n expect('(');\n\n if (!match(')')) {\n while (index < length) {\n args.push(parseConditionalExpression());\n\n if (match(')')) {\n break;\n }\n\n expect(',');\n }\n }\n\n expect(')');\n return args;\n}\n\nfunction parseNonComputedProperty() {\n index = lookahead.start;\n const token = lex();\n\n if (!isIdentifierName(token)) {\n throwUnexpected(token);\n }\n\n return finishIdentifier(token.value);\n}\n\nfunction parseNonComputedMember() {\n expect('.');\n return parseNonComputedProperty();\n}\n\nfunction parseComputedMember() {\n expect('[');\n const expr = parseExpression();\n expect(']');\n return expr;\n}\n\nfunction parseLeftHandSideExpressionAllowCall() {\n var expr, args, property;\n expr = parsePrimaryExpression();\n\n for (;;) {\n if (match('.')) {\n property = parseNonComputedMember();\n expr = finishMemberExpression('.', expr, property);\n } else if (match('(')) {\n args = parseArguments();\n expr = finishCallExpression(expr, args);\n } else if (match('[')) {\n property = parseComputedMember();\n expr = finishMemberExpression('[', expr, property);\n } else {\n break;\n }\n }\n\n return expr;\n} // 11.3 Postfix Expressions\n\n\nfunction parsePostfixExpression() {\n const expr = parseLeftHandSideExpressionAllowCall();\n\n if (lookahead.type === TokenPunctuator) {\n if (match('++') || match('--')) {\n throw new Error(DISABLED);\n }\n }\n\n return expr;\n} // 11.4 Unary Operators\n\n\nfunction parseUnaryExpression() {\n var token, expr;\n\n if (lookahead.type !== TokenPunctuator && lookahead.type !== TokenKeyword) {\n expr = parsePostfixExpression();\n } else if (match('++') || match('--')) {\n throw new Error(DISABLED);\n } else if (match('+') || match('-') || match('~') || match('!')) {\n token = lex();\n expr = parseUnaryExpression();\n expr = finishUnaryExpression(token.value, expr);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n throw new Error(DISABLED);\n } else {\n expr = parsePostfixExpression();\n }\n\n return expr;\n}\n\nfunction binaryPrecedence(token) {\n let prec = 0;\n\n if (token.type !== TokenPunctuator && token.type !== TokenKeyword) {\n return 0;\n }\n\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n\n case '&&':\n prec = 2;\n break;\n\n case '|':\n prec = 3;\n break;\n\n case '^':\n prec = 4;\n break;\n\n case '&':\n prec = 5;\n break;\n\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n case 'in':\n prec = 7;\n break;\n\n case '<<':\n case '>>':\n case '>>>':\n prec = 8;\n break;\n\n case '+':\n case '-':\n prec = 9;\n break;\n\n case '*':\n case '/':\n case '%':\n prec = 11;\n break;\n }\n\n return prec;\n} // 11.5 Multiplicative Operators\n// 11.6 Additive Operators\n// 11.7 Bitwise Shift Operators\n// 11.8 Relational Operators\n// 11.9 Equality Operators\n// 11.10 Binary Bitwise Operators\n// 11.11 Binary Logical Operators\n\n\nfunction parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n marker = lookahead;\n left = parseUnaryExpression();\n token = lookahead;\n prec = binaryPrecedence(token);\n\n if (prec === 0) {\n return left;\n }\n\n token.prec = prec;\n lex();\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead)) > 0) {\n // Reduce: make a binary expression from the three topmost entries.\n while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = finishBinaryExpression(operator, left, right);\n stack.push(expr);\n } // Shift.\n\n\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n } // Final reduce to clean-up the stack.\n\n\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n\n while (i > 1) {\n markers.pop();\n expr = finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n} // 11.12 Conditional Operator\n\n\nfunction parseConditionalExpression() {\n var expr, consequent, alternate;\n expr = parseBinaryExpression();\n\n if (match('?')) {\n lex();\n consequent = parseConditionalExpression();\n expect(':');\n alternate = parseConditionalExpression();\n expr = finishConditionalExpression(expr, consequent, alternate);\n }\n\n return expr;\n} // 11.14 Comma Operator\n\n\nfunction parseExpression() {\n const expr = parseConditionalExpression();\n\n if (match(',')) {\n throw new Error(DISABLED); // no sequence expressions\n }\n\n return expr;\n}\n\nfunction parser (code) {\n source = code;\n index = 0;\n length = source.length;\n lookahead = null;\n peek();\n const expr = parseExpression();\n\n if (lookahead.type !== TokenEOF) {\n throw new Error('Unexpect token after expression.');\n }\n\n return expr;\n}\n\nvar Constants = {\n NaN: 'NaN',\n E: 'Math.E',\n LN2: 'Math.LN2',\n LN10: 'Math.LN10',\n LOG2E: 'Math.LOG2E',\n LOG10E: 'Math.LOG10E',\n PI: 'Math.PI',\n SQRT1_2: 'Math.SQRT1_2',\n SQRT2: 'Math.SQRT2',\n MIN_VALUE: 'Number.MIN_VALUE',\n MAX_VALUE: 'Number.MAX_VALUE'\n};\n\nfunction Functions (codegen) {\n function fncall(name, args, cast, type) {\n let obj = codegen(args[0]);\n\n if (cast) {\n obj = cast + '(' + obj + ')';\n if (cast.lastIndexOf('new ', 0) === 0) obj = '(' + obj + ')';\n }\n\n return obj + '.' + name + (type < 0 ? '' : type === 0 ? '()' : '(' + args.slice(1).map(codegen).join(',') + ')');\n }\n\n function fn(name, cast, type) {\n return args => fncall(name, args, cast, type);\n }\n\n const DATE = 'new Date',\n STRING = 'String',\n REGEXP = 'RegExp';\n return {\n // MATH functions\n isNaN: 'Number.isNaN',\n isFinite: 'Number.isFinite',\n abs: 'Math.abs',\n acos: 'Math.acos',\n asin: 'Math.asin',\n atan: 'Math.atan',\n atan2: 'Math.atan2',\n ceil: 'Math.ceil',\n cos: 'Math.cos',\n exp: 'Math.exp',\n floor: 'Math.floor',\n log: 'Math.log',\n max: 'Math.max',\n min: 'Math.min',\n pow: 'Math.pow',\n random: 'Math.random',\n round: 'Math.round',\n sin: 'Math.sin',\n sqrt: 'Math.sqrt',\n tan: 'Math.tan',\n clamp: function (args) {\n if (args.length < 3) error('Missing arguments to clamp function.');\n if (args.length > 3) error('Too many arguments to clamp function.');\n const a = args.map(codegen);\n return 'Math.max(' + a[1] + ', Math.min(' + a[2] + ',' + a[0] + '))';\n },\n // DATE functions\n now: 'Date.now',\n utc: 'Date.UTC',\n datetime: DATE,\n date: fn('getDate', DATE, 0),\n day: fn('getDay', DATE, 0),\n year: fn('getFullYear', DATE, 0),\n month: fn('getMonth', DATE, 0),\n hours: fn('getHours', DATE, 0),\n minutes: fn('getMinutes', DATE, 0),\n seconds: fn('getSeconds', DATE, 0),\n milliseconds: fn('getMilliseconds', DATE, 0),\n time: fn('getTime', DATE, 0),\n timezoneoffset: fn('getTimezoneOffset', DATE, 0),\n utcdate: fn('getUTCDate', DATE, 0),\n utcday: fn('getUTCDay', DATE, 0),\n utcyear: fn('getUTCFullYear', DATE, 0),\n utcmonth: fn('getUTCMonth', DATE, 0),\n utchours: fn('getUTCHours', DATE, 0),\n utcminutes: fn('getUTCMinutes', DATE, 0),\n utcseconds: fn('getUTCSeconds', DATE, 0),\n utcmilliseconds: fn('getUTCMilliseconds', DATE, 0),\n // sequence functions\n length: fn('length', null, -1),\n join: fn('join', null),\n indexof: fn('indexOf', null),\n lastindexof: fn('lastIndexOf', null),\n slice: fn('slice', null),\n reverse: function (args) {\n return '(' + codegen(args[0]) + ').slice().reverse()';\n },\n // STRING functions\n parseFloat: 'parseFloat',\n parseInt: 'parseInt',\n upper: fn('toUpperCase', STRING, 0),\n lower: fn('toLowerCase', STRING, 0),\n substring: fn('substring', STRING),\n split: fn('split', STRING),\n replace: fn('replace', STRING),\n trim: fn('trim', STRING, 0),\n // REGEXP functions\n regexp: REGEXP,\n test: fn('test', REGEXP),\n // Control Flow functions\n if: function (args) {\n if (args.length < 3) error('Missing arguments to if function.');\n if (args.length > 3) error('Too many arguments to if function.');\n const a = args.map(codegen);\n return '(' + a[0] + '?' + a[1] + ':' + a[2] + ')';\n }\n };\n}\n\nfunction stripQuotes(s) {\n const n = s && s.length - 1;\n return n && (s[0] === '\"' && s[n] === '\"' || s[0] === '\\'' && s[n] === '\\'') ? s.slice(1, -1) : s;\n}\n\nfunction codegen (opt) {\n opt = opt || {};\n const allowed = opt.allowed ? toSet(opt.allowed) : {},\n forbidden = opt.forbidden ? toSet(opt.forbidden) : {},\n constants = opt.constants || Constants,\n functions = (opt.functions || Functions)(visit),\n globalvar = opt.globalvar,\n fieldvar = opt.fieldvar,\n outputGlobal = isFunction(globalvar) ? globalvar : id => \"\".concat(globalvar, \"[\\\"\").concat(id, \"\\\"]\");\n let globals = {},\n fields = {},\n memberDepth = 0;\n\n function visit(ast) {\n if (isString(ast)) return ast;\n const generator = Generators[ast.type];\n if (generator == null) error('Unsupported type: ' + ast.type);\n return generator(ast);\n }\n\n const Generators = {\n Literal: n => n.raw,\n Identifier: n => {\n const id = n.name;\n\n if (memberDepth > 0) {\n return id;\n } else if (hasOwnProperty(forbidden, id)) {\n return error('Illegal identifier: ' + id);\n } else if (hasOwnProperty(constants, id)) {\n return constants[id];\n } else if (hasOwnProperty(allowed, id)) {\n return id;\n } else {\n globals[id] = 1;\n return outputGlobal(id);\n }\n },\n MemberExpression: n => {\n const d = !n.computed,\n o = visit(n.object);\n if (d) memberDepth += 1;\n const p = visit(n.property);\n\n if (o === fieldvar) {\n // strip quotes to sanitize field name (#1653)\n fields[stripQuotes(p)] = 1;\n }\n\n if (d) memberDepth -= 1;\n return o + (d ? '.' + p : '[' + p + ']');\n },\n CallExpression: n => {\n if (n.callee.type !== 'Identifier') {\n error('Illegal callee type: ' + n.callee.type);\n }\n\n const callee = n.callee.name,\n args = n.arguments,\n fn = hasOwnProperty(functions, callee) && functions[callee];\n if (!fn) error('Unrecognized function: ' + callee);\n return isFunction(fn) ? fn(args) : fn + '(' + args.map(visit).join(',') + ')';\n },\n ArrayExpression: n => '[' + n.elements.map(visit).join(',') + ']',\n BinaryExpression: n => '(' + visit(n.left) + ' ' + n.operator + ' ' + visit(n.right) + ')',\n UnaryExpression: n => '(' + n.operator + visit(n.argument) + ')',\n ConditionalExpression: n => '(' + visit(n.test) + '?' + visit(n.consequent) + ':' + visit(n.alternate) + ')',\n LogicalExpression: n => '(' + visit(n.left) + n.operator + visit(n.right) + ')',\n ObjectExpression: n => '{' + n.properties.map(visit).join(',') + '}',\n Property: n => {\n memberDepth += 1;\n const k = visit(n.key);\n memberDepth -= 1;\n return k + ':' + visit(n.value);\n }\n };\n\n function codegen(ast) {\n const result = {\n code: visit(ast),\n globals: Object.keys(globals),\n fields: Object.keys(fields)\n };\n globals = {};\n fields = {};\n return result;\n }\n\n codegen.functions = functions;\n codegen.constants = constants;\n return codegen;\n}\n\nexport { ASTNode, ArrayExpression, BinaryExpression, CallExpression, ConditionalExpression, Identifier, Literal, LogicalExpression, MemberExpression, ObjectExpression, Property, RawCode, UnaryExpression, codegen, Constants as constants, Functions as functions, parser as parse };\n","import { parse } from 'vega-expression';\nfunction getName(node) {\n const name = [];\n if (node.type === 'Identifier') {\n return [node.name];\n }\n if (node.type === 'Literal') {\n return [node.value];\n }\n if (node.type === 'MemberExpression') {\n name.push(...getName(node.object));\n name.push(...getName(node.property));\n }\n return name;\n}\nfunction startsWithDatum(node) {\n if (node.object.type === 'MemberExpression') {\n return startsWithDatum(node.object);\n }\n return node.object.name === 'datum';\n}\nexport function getDependentFields(expression) {\n const ast = parse(expression);\n const dependents = new Set();\n ast.visit((node) => {\n if (node.type === 'MemberExpression' && startsWithDatum(node)) {\n dependents.add(getName(node).slice(1).join('.'));\n }\n });\n return dependents;\n}\n//# sourceMappingURL=expressions.js.map","import { duplicate } from '../../util';\nimport { expression } from '../predicate';\nimport { DataFlowNode } from './dataflow';\nimport { getDependentFields } from './expressions';\nexport class FilterNode extends DataFlowNode {\n constructor(parent, model, filter) {\n super(parent);\n this.model = model;\n this.filter = filter;\n // TODO: refactor this to not take a node and\n // then add a static function makeFromOperand and make the constructor take only an expression\n this.expr = expression(this.model, this.filter, this);\n this._dependentFields = getDependentFields(this.expr);\n }\n clone() {\n return new FilterNode(null, this.model, duplicate(this.filter));\n }\n dependentFields() {\n return this._dependentFields;\n }\n producedFields() {\n return new Set(); // filter does not produce any new fields\n }\n assemble() {\n return {\n type: 'filter',\n expr: this.expr\n };\n }\n hash() {\n return `Filter ${this.expr}`;\n }\n}\n//# sourceMappingURL=filter.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { selector as parseSelector } from 'vega-event-selector';\nimport { isString, stringValue } from 'vega-util';\nimport { forEachSelection, STORE } from '.';\nimport { warn } from '../../log';\nimport { duplicate, keys, logicalExpr, varName } from '../../util';\nimport { OutputNode } from '../data/dataflow';\nimport { FilterNode } from '../data/filter';\nimport { forEachTransform } from './transforms/transforms';\nimport { DataSourceType } from '../../data';\nexport function parseUnitSelection(model, selDefs) {\n var _a;\n const selCmpts = {};\n const selectionConfig = model.config.selection;\n for (const name of keys(selDefs !== null && selDefs !== void 0 ? selDefs : {})) {\n const selDef = duplicate(selDefs[name]);\n const _b = selectionConfig[selDef.type], { fields, encodings } = _b, cfg = __rest(_b, [\"fields\", \"encodings\"]); // Project transform applies its defaults.\n // Set default values from config if a property hasn't been specified,\n // or if it is true. E.g., \"translate\": true should use the default\n // event handlers for translate. However, true may be a valid value for\n // a property (e.g., \"nearest\": true).\n for (const key in cfg) {\n // A selection should contain either `encodings` or `fields`, only use\n // default values for these two values if neither of them is specified.\n if ((key === 'encodings' && selDef.fields) || (key === 'fields' && selDef.encodings)) {\n continue;\n }\n if (key === 'mark') {\n selDef[key] = Object.assign(Object.assign({}, cfg[key]), selDef[key]);\n }\n if (selDef[key] === undefined || selDef[key] === true) {\n selDef[key] = (_a = cfg[key]) !== null && _a !== void 0 ? _a : selDef[key];\n }\n }\n const safeName = varName(name);\n const selCmpt = (selCmpts[safeName] = Object.assign(Object.assign({}, selDef), { name: safeName, events: isString(selDef.on) ? parseSelector(selDef.on, 'scope') : duplicate(selDef.on) }));\n forEachTransform(selCmpt, txCompiler => {\n if (txCompiler.has(selCmpt) && txCompiler.parse) {\n txCompiler.parse(model, selCmpt, selDef, selDefs[name]);\n }\n });\n }\n return selCmpts;\n}\nexport function parseSelectionPredicate(model, selections, dfnode, datum = 'datum') {\n const stores = [];\n function expr(name) {\n const vname = varName(name);\n const selCmpt = model.getSelectionComponent(vname, name);\n const store = stringValue(vname + STORE);\n if (selCmpt.project.timeUnit) {\n const child = dfnode !== null && dfnode !== void 0 ? dfnode : model.component.data.raw;\n const tunode = selCmpt.project.timeUnit.clone();\n if (child.parent) {\n tunode.insertAsParentOf(child);\n }\n else {\n child.parent = tunode;\n }\n }\n if (selCmpt.empty !== 'none') {\n stores.push(store);\n }\n return (`vlSelectionTest(${store}, ${datum}` + (selCmpt.resolve === 'global' ? ')' : `, ${stringValue(selCmpt.resolve)})`));\n }\n const predicateStr = logicalExpr(selections, expr);\n return ((stores.length ? '!(' + stores.map(s => `length(data(${s}))`).join(' || ') + ') || ' : '') + `(${predicateStr})`);\n}\nexport function parseSelectionBinExtent(selCmpt, extent) {\n const encoding = extent['encoding'];\n let field = extent['field'];\n if (!encoding && !field) {\n field = selCmpt.project.items[0].field;\n if (selCmpt.project.items.length > 1) {\n warn('A \"field\" or \"encoding\" must be specified when using a selection as a scale domain. ' +\n `Using \"field\": ${stringValue(field)}.`);\n }\n }\n else if (encoding && !field) {\n const encodings = selCmpt.project.items.filter(p => p.channel === encoding);\n if (!encodings.length || encodings.length > 1) {\n field = selCmpt.project.items[0].field;\n warn((!encodings.length ? 'No ' : 'Multiple ') +\n `matching ${stringValue(encoding)} encoding found for selection ${stringValue(extent.selection)}. ` +\n `Using \"field\": ${stringValue(field)}.`);\n }\n else {\n field = encodings[0].field;\n }\n }\n return `${selCmpt.name}[${stringValue(field)}]`;\n}\nexport function materializeSelections(model, main) {\n forEachSelection(model, selCmpt => {\n const selection = selCmpt.name;\n const lookupName = model.getName(`lookup_${selection}`);\n model.component.data.outputNodes[lookupName] = selCmpt.materialized = new OutputNode(new FilterNode(main, model, { selection }), lookupName, DataSourceType.Lookup, model.component.data.outputNodeRefCounts);\n });\n}\n//# sourceMappingURL=parse.js.map","import { isString } from 'vega-util';\nimport { fieldFilterExpression, isSelectionPredicate } from '../predicate';\nimport { logicalExpr } from '../util';\nimport { parseSelectionPredicate } from './selection/parse';\n/**\n * Converts a predicate into an expression.\n */\n// model is only used for selection filters.\nexport function expression(model, filterOp, node) {\n return logicalExpr(filterOp, (predicate) => {\n if (isString(predicate)) {\n return predicate;\n }\n else if (isSelectionPredicate(predicate)) {\n return parseSelectionPredicate(model, predicate.selection, node);\n }\n else {\n // Filter Object\n return fieldFilterExpression(predicate);\n }\n });\n}\n//# sourceMappingURL=predicate.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array, isArray } from 'vega-util';\nimport { AXIS_PARTS, AXIS_PROPERTY_TYPE, CONDITIONAL_AXIS_PROP_INDEX, isConditionalAxisValue } from '../../axis';\nimport { POSITION_SCALE_CHANNELS } from '../../channel';\nimport { defaultTitle } from '../../channeldef';\nimport { isText } from '../../title';\nimport { getFirstDefined, isEmpty, replaceAll } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { exprFromValueOrSignalRef } from '../common';\nimport { expression } from '../predicate';\nfunction assembleTitle(title, config) {\n if (!title) {\n return undefined;\n }\n if (isArray(title) && !isText(title)) {\n return title.map(fieldDef => defaultTitle(fieldDef, config)).join(', ');\n }\n return title;\n}\nfunction setAxisEncode(axis, part, vgProp, vgRef) {\n var _a, _b, _c;\n axis.encode = (_a = axis.encode) !== null && _a !== void 0 ? _a : {};\n axis.encode[part] = (_b = axis.encode[part]) !== null && _b !== void 0 ? _b : {};\n axis.encode[part].update = (_c = axis.encode[part].update) !== null && _c !== void 0 ? _c : {};\n // TODO: remove as any after https://github.com/prisma/nexus-prisma/issues/291\n axis.encode[part].update[vgProp] = vgRef;\n}\nexport function assembleAxis(axisCmpt, kind, config, opt = { header: false }) {\n var _a, _b;\n const _c = axisCmpt.combine(), { disable, orient, scale, labelExpr, title, zindex } = _c, axis = __rest(_c, [\"disable\", \"orient\", \"scale\", \"labelExpr\", \"title\", \"zindex\"]);\n if (disable) {\n return undefined;\n }\n for (const prop in axis) {\n const propType = AXIS_PROPERTY_TYPE[prop];\n const propValue = axis[prop];\n if (propType && propType !== kind && propType !== 'both') {\n // Remove properties that are not valid for this kind of axis\n delete axis[prop];\n }\n else if (isConditionalAxisValue(propValue)) {\n // deal with conditional axis value\n const { condition } = propValue, valueOrSignalRef = __rest(propValue, [\"condition\"]);\n const conditions = array(condition);\n const propIndex = CONDITIONAL_AXIS_PROP_INDEX[prop];\n if (propIndex) {\n const { vgProp, part } = propIndex;\n // If there is a corresponding Vega property for the channel,\n // use Vega's custom axis encoding and delete the original axis property to avoid conflicts\n const vgRef = [\n ...conditions.map(c => {\n const { test } = c, valueOrSignalCRef = __rest(c, [\"test\"]);\n return Object.assign({ test: expression(null, test) }, valueOrSignalCRef);\n }),\n valueOrSignalRef\n ];\n setAxisEncode(axis, part, vgProp, vgRef);\n delete axis[prop];\n }\n else if (propIndex === null) {\n // If propIndex is null, this means we support conditional axis property by converting the condition to signal instead.\n const signalRef = {\n signal: conditions\n .map(c => {\n const { test } = c, valueOrSignalCRef = __rest(c, [\"test\"]);\n return `${expression(null, test)} ? ${exprFromValueOrSignalRef(valueOrSignalCRef)} : `;\n })\n .join('') + exprFromValueOrSignalRef(valueOrSignalRef)\n };\n axis[prop] = signalRef;\n }\n }\n else if (isSignalRef(propValue)) {\n const propIndex = CONDITIONAL_AXIS_PROP_INDEX[prop];\n if (propIndex) {\n const { vgProp, part } = propIndex;\n setAxisEncode(axis, part, vgProp, propValue);\n delete axis[prop];\n } // else do nothing since the property already supports signal\n }\n }\n if (kind === 'grid') {\n if (!axis.grid) {\n return undefined;\n }\n // Remove unnecessary encode block\n if (axis.encode) {\n // Only need to keep encode block for grid\n const { grid } = axis.encode;\n axis.encode = Object.assign({}, (grid ? { grid } : {}));\n if (isEmpty(axis.encode)) {\n delete axis.encode;\n }\n }\n return Object.assign(Object.assign({ scale,\n orient }, axis), { domain: false, labels: false, aria: false, \n // Always set min/maxExtent to 0 to ensure that `config.axis*.minExtent` and `config.axis*.maxExtent`\n // would not affect gridAxis\n maxExtent: 0, minExtent: 0, ticks: false, zindex: getFirstDefined(zindex, 0) // put grid behind marks by default\n });\n }\n else {\n // kind === 'main'\n if (!opt.header && axisCmpt.mainExtracted) {\n // if mainExtracted has been extracted to a separate facet\n return undefined;\n }\n if (labelExpr !== undefined) {\n let expr = labelExpr;\n if (((_b = (_a = axis.encode) === null || _a === void 0 ? void 0 : _a.labels) === null || _b === void 0 ? void 0 : _b.update) && isSignalRef(axis.encode.labels.update.text)) {\n expr = replaceAll(labelExpr, 'datum.label', axis.encode.labels.update.text.signal);\n }\n setAxisEncode(axis, 'labels', 'text', { signal: expr });\n }\n if (axis.labelAlign === null) {\n delete axis.labelAlign;\n }\n // Remove unnecessary encode block\n if (axis.encode) {\n for (const part of AXIS_PARTS) {\n if (!axisCmpt.hasAxisPart(part)) {\n delete axis.encode[part];\n }\n }\n if (isEmpty(axis.encode)) {\n delete axis.encode;\n }\n }\n const titleString = assembleTitle(title, config);\n return Object.assign(Object.assign(Object.assign(Object.assign({ scale,\n orient, grid: false }, (titleString ? { title: titleString } : {})), axis), (config.aria === false ? { aria: false } : {})), { zindex: getFirstDefined(zindex, 0) // put axis line above marks by default\n });\n }\n}\n/**\n * Add axis signals so grid line works correctly\n * (Fix https://github.com/vega/vega-lite/issues/4226)\n */\nexport function assembleAxisSignals(model) {\n const { axes } = model.component;\n const signals = [];\n for (const channel of POSITION_SCALE_CHANNELS) {\n if (axes[channel]) {\n for (const axis of axes[channel]) {\n if (!axis.get('disable') && !axis.get('gridScale')) {\n // If there is x-axis but no y-scale for gridScale, need to set height/width so x-axis can draw the grid with the right height. Same for y-axis and width.\n const sizeType = channel === 'x' ? 'height' : 'width';\n const update = model.getSizeSignalRef(sizeType).signal;\n if (sizeType !== update) {\n signals.push({\n name: sizeType,\n update: update\n });\n }\n }\n }\n }\n }\n return signals;\n}\nexport function assembleAxes(axisComponents, config) {\n const { x = [], y = [] } = axisComponents;\n return [\n ...x.map(a => assembleAxis(a, 'grid', config)),\n ...y.map(a => assembleAxis(a, 'grid', config)),\n ...x.map(a => assembleAxis(a, 'main', config)),\n ...y.map(a => assembleAxis(a, 'main', config))\n ].filter(a => a); // filter undefined\n}\n//# sourceMappingURL=assemble.js.map","import { array } from 'vega-util';\nimport { isQuantitative } from '../../scale';\nimport { keys, titleCase } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { getStyleConfig, signalOrStringValue } from '../common';\nfunction getAxisConfigFromConfigTypes(configTypes, config, channel, orient) {\n // TODO: add special casing to add conditional value based on orient signal\n return Object.assign.apply(null, [\n {},\n ...configTypes.map(configType => {\n if (configType === 'axisOrient') {\n const orient1 = channel === 'x' ? 'bottom' : 'left';\n const orientConfig1 = config[channel === 'x' ? 'axisBottom' : 'axisLeft'] || {};\n const orientConfig2 = config[channel === 'x' ? 'axisTop' : 'axisRight'] || {};\n const props = new Set([...keys(orientConfig1), ...keys(orientConfig2)]);\n const conditionalOrientAxisConfig = {};\n for (const prop of props.values()) {\n conditionalOrientAxisConfig[prop] = {\n // orient is surely signal in this case\n signal: `${orient['signal']} === \"${orient1}\" ? ${signalOrStringValue(orientConfig1[prop])} : ${signalOrStringValue(orientConfig2[prop])}`\n };\n }\n return conditionalOrientAxisConfig;\n }\n return config[configType];\n })\n ]);\n}\nexport function getAxisConfigs(channel, scaleType, orient, config) {\n const typeBasedConfigTypes = scaleType === 'band'\n ? ['axisDiscrete', 'axisBand']\n : scaleType === 'point'\n ? ['axisDiscrete', 'axisPoint']\n : isQuantitative(scaleType)\n ? ['axisQuantitative']\n : scaleType === 'time' || scaleType === 'utc'\n ? ['axisTemporal']\n : [];\n const axisChannel = channel === 'x' ? 'axisX' : 'axisY';\n const axisOrient = isSignalRef(orient) ? 'axisOrient' : 'axis' + titleCase(orient); // axisTop, axisBottom, ...\n const vlOnlyConfigTypes = [\n // technically Vega does have axisBand, but if we make another separation here,\n // it will further introduce complexity in the code\n ...typeBasedConfigTypes,\n ...typeBasedConfigTypes.map(c => axisChannel + c.substr(4))\n ];\n const vgConfigTypes = ['axis', axisOrient, axisChannel];\n return {\n vlOnlyAxisConfig: getAxisConfigFromConfigTypes(vlOnlyConfigTypes, config, channel, orient),\n vgAxisConfig: getAxisConfigFromConfigTypes(vgConfigTypes, config, channel, orient),\n axisConfigStyle: getAxisConfigStyle([...vgConfigTypes, ...vlOnlyConfigTypes], config)\n };\n}\nexport function getAxisConfigStyle(axisConfigTypes, config) {\n var _a;\n const toMerge = [{}];\n for (const configType of axisConfigTypes) {\n // TODO: add special casing to add conditional value based on orient signal\n let style = (_a = config[configType]) === null || _a === void 0 ? void 0 : _a.style;\n if (style) {\n style = array(style);\n for (const s of style) {\n toMerge.push(config.style[s]);\n }\n }\n }\n return Object.assign.apply(null, toMerge);\n}\nexport function getAxisConfig(property, styleConfigIndex, style, axisConfigs = {}) {\n var _a;\n const styleConfig = getStyleConfig(property, style, styleConfigIndex);\n if (styleConfig !== undefined) {\n return {\n configFrom: 'style',\n configValue: styleConfig\n };\n }\n for (const configFrom of ['vlOnlyAxisConfig', 'vgAxisConfig', 'axisConfigStyle']) {\n if (((_a = axisConfigs[configFrom]) === null || _a === void 0 ? void 0 : _a[property]) !== undefined) {\n return { configFrom, configValue: axisConfigs[configFrom][property] };\n }\n }\n return {};\n}\n//# sourceMappingURL=config.js.map","import { isArray, isObject } from 'vega-util';\nimport { isBinned, isBinning } from '../../bin';\nimport { X } from '../../channel';\nimport { isDiscrete, isFieldDef, toFieldDefBase, valueArray } from '../../channeldef';\nimport { hasDiscreteDomain } from '../../scale';\nimport { normalizeTimeUnit } from '../../timeunit';\nimport { NOMINAL, ORDINAL } from '../../type';\nimport { contains, normalizeAngle } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { mergeTitle, mergeTitleFieldDefs } from '../common';\nimport { guideFormat, guideFormatType } from '../format';\nimport { getAxisConfig } from './config';\nexport const axisRules = {\n scale: ({ model, channel }) => model.scaleName(channel),\n format: ({ fieldOrDatumDef, config, axis }) => {\n const { format, formatType } = axis;\n return guideFormat(fieldOrDatumDef, fieldOrDatumDef.type, format, formatType, config, true);\n },\n formatType: ({ axis, fieldOrDatumDef, scaleType }) => {\n const { formatType } = axis;\n return guideFormatType(formatType, fieldOrDatumDef, scaleType);\n },\n grid: ({ fieldOrDatumDef, axis, scaleType }) => {\n var _a;\n if (isFieldDef(fieldOrDatumDef) && isBinned(fieldOrDatumDef.bin)) {\n return false;\n }\n else {\n return (_a = axis.grid) !== null && _a !== void 0 ? _a : defaultGrid(scaleType, fieldOrDatumDef);\n }\n },\n gridScale: ({ model, channel }) => gridScale(model, channel),\n labelAlign: ({ axis, labelAngle, orient, channel }) => axis.labelAlign || defaultLabelAlign(labelAngle, orient, channel),\n labelAngle: ({ labelAngle }) => labelAngle,\n labelBaseline: ({ axis, labelAngle, orient, channel }) => axis.labelBaseline || defaultLabelBaseline(labelAngle, orient, channel),\n labelFlush: ({ axis, fieldOrDatumDef, channel }) => { var _a; return (_a = axis.labelFlush) !== null && _a !== void 0 ? _a : defaultLabelFlush(fieldOrDatumDef.type, channel); },\n labelOverlap: ({ axis, fieldOrDatumDef, scaleType }) => { var _a; return (_a = axis.labelOverlap) !== null && _a !== void 0 ? _a : defaultLabelOverlap(fieldOrDatumDef.type, scaleType, isFieldDef(fieldOrDatumDef) && !!fieldOrDatumDef.timeUnit, isFieldDef(fieldOrDatumDef) ? fieldOrDatumDef.sort : undefined); },\n // we already calculate orient in parse\n orient: ({ orient }) => orient,\n tickCount: ({ channel, model, axis, fieldOrDatumDef, scaleType }) => {\n var _a;\n const sizeType = channel === 'x' ? 'width' : channel === 'y' ? 'height' : undefined;\n const size = sizeType ? model.getSizeSignalRef(sizeType) : undefined;\n return (_a = axis.tickCount) !== null && _a !== void 0 ? _a : defaultTickCount({ fieldOrDatumDef, scaleType, size, values: axis.values });\n },\n title: ({ axis, model, channel }) => {\n if (axis.title !== undefined) {\n return axis.title;\n }\n const fieldDefTitle = getFieldDefTitle(model, channel);\n if (fieldDefTitle !== undefined) {\n return fieldDefTitle;\n }\n const fieldDef = model.typedFieldDef(channel);\n const channel2 = channel === 'x' ? 'x2' : 'y2';\n const fieldDef2 = model.fieldDef(channel2);\n // If title not specified, store base parts of fieldDef (and fieldDef2 if exists)\n return mergeTitleFieldDefs(fieldDef ? [toFieldDefBase(fieldDef)] : [], isFieldDef(fieldDef2) ? [toFieldDefBase(fieldDef2)] : []);\n },\n values: ({ axis, fieldOrDatumDef }) => values(axis, fieldOrDatumDef),\n zindex: ({ axis, fieldOrDatumDef, mark }) => { var _a; return (_a = axis.zindex) !== null && _a !== void 0 ? _a : defaultZindex(mark, fieldOrDatumDef); }\n};\n// TODO: we need to refactor this method after we take care of config refactoring\n/**\n * Default rules for whether to show a grid should be shown for a channel.\n * If `grid` is unspecified, the default value is `true` for ordinal scales that are not binned\n */\nexport function defaultGrid(scaleType, fieldDef) {\n return !hasDiscreteDomain(scaleType) && isFieldDef(fieldDef) && !isBinning(fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.bin);\n}\nexport function gridScale(model, channel) {\n const gridChannel = channel === 'x' ? 'y' : 'x';\n if (model.getScaleComponent(gridChannel)) {\n return model.scaleName(gridChannel);\n }\n return undefined;\n}\nexport function getLabelAngle(fieldOrDatumDef, axis, channel, styleConfig, axisConfigs) {\n const labelAngle = axis === null || axis === void 0 ? void 0 : axis.labelAngle;\n // try axis value\n if (labelAngle !== undefined) {\n return isSignalRef(labelAngle) ? labelAngle : normalizeAngle(labelAngle);\n }\n else {\n // try axis config value\n const { configValue: angle } = getAxisConfig('labelAngle', styleConfig, axis === null || axis === void 0 ? void 0 : axis.style, axisConfigs);\n if (angle !== undefined) {\n return normalizeAngle(angle);\n }\n else {\n // get default value\n if (channel === X &&\n contains([NOMINAL, ORDINAL], fieldOrDatumDef.type) &&\n !(isFieldDef(fieldOrDatumDef) && fieldOrDatumDef.timeUnit)) {\n return 270;\n }\n // no default\n return undefined;\n }\n }\n}\nexport function normalizeAngleExpr(angle) {\n return `(((${angle.signal} % 360) + 360) % 360)`;\n}\nexport function defaultLabelBaseline(angle, orient, channel, alwaysIncludeMiddle) {\n if (angle !== undefined) {\n if (channel === 'x') {\n if (isSignalRef(angle)) {\n const a = normalizeAngleExpr(angle);\n const orientIsTop = isSignalRef(orient) ? `(${orient.signal} === \"top\")` : orient === 'top';\n return {\n signal: `(45 < ${a} && ${a} < 135) || (225 < ${a} && ${a} < 315) ? \"middle\" :` +\n `(${a} <= 45 || 315 <= ${a}) === ${orientIsTop} ? \"bottom\" : \"top\"`\n };\n }\n if ((45 < angle && angle < 135) || (225 < angle && angle < 315)) {\n return 'middle';\n }\n if (isSignalRef(orient)) {\n const op = angle <= 45 || 315 <= angle ? '===' : '!==';\n return { signal: `${orient.signal} ${op} \"top\" ? \"bottom\" : \"top\"` };\n }\n return (angle <= 45 || 315 <= angle) === (orient === 'top') ? 'bottom' : 'top';\n }\n else {\n if (isSignalRef(angle)) {\n const a = normalizeAngleExpr(angle);\n const orientIsLeft = isSignalRef(orient) ? `(${orient.signal} === \"left\")` : orient === 'left';\n const middle = alwaysIncludeMiddle ? '\"middle\"' : 'null';\n return {\n signal: `${a} <= 45 || 315 <= ${a} || (135 <= ${a} && ${a} <= 225) ? ${middle} : (45 <= ${a} && ${a} <= 135) === ${orientIsLeft} ? \"top\" : \"bottom\"`\n };\n }\n if (angle <= 45 || 315 <= angle || (135 <= angle && angle <= 225)) {\n return alwaysIncludeMiddle ? 'middle' : null;\n }\n if (isSignalRef(orient)) {\n const op = 45 <= angle && angle <= 135 ? '===' : '!==';\n return { signal: `${orient.signal} ${op} \"left\" ? \"top\" : \"bottom\"` };\n }\n return (45 <= angle && angle <= 135) === (orient === 'left') ? 'top' : 'bottom';\n }\n }\n return undefined;\n}\nexport function defaultLabelAlign(angle, orient, channel) {\n if (angle === undefined) {\n return undefined;\n }\n const isX = channel === 'x';\n const startAngle = isX ? 0 : 90;\n const mainOrient = isX ? 'bottom' : 'left';\n if (isSignalRef(angle)) {\n const a = normalizeAngleExpr(angle);\n const orientIsMain = isSignalRef(orient) ? `(${orient.signal} === \"${mainOrient}\")` : orient === mainOrient;\n return {\n signal: `(${startAngle ? '(' + a + ' + 90)' : a} % 180 === 0) ? ${isX ? null : '\"center\"'} :` +\n `(${startAngle} < ${a} && ${a} < ${180 + startAngle}) === ${orientIsMain} ? \"left\" : \"right\"`\n };\n }\n if ((angle + startAngle) % 180 === 0) {\n // For bottom, use default label align so label flush still works\n return isX ? null : 'center';\n }\n if (isSignalRef(orient)) {\n const op = startAngle < angle && angle < 180 + startAngle ? '===' : '!==';\n const orientIsMain = `${orient.signal} ${op} \"${mainOrient}\"`;\n return {\n signal: `${orientIsMain} ? \"left\" : \"right\"`\n };\n }\n if ((startAngle < angle && angle < 180 + startAngle) === (orient === mainOrient)) {\n return 'left';\n }\n return 'right';\n}\nexport function defaultLabelFlush(type, channel) {\n if (channel === 'x' && contains(['quantitative', 'temporal'], type)) {\n return true;\n }\n return undefined;\n}\nexport function defaultLabelOverlap(type, scaleType, hasTimeUnit, sort) {\n // do not prevent overlap for nominal data because there is no way to infer what the missing labels are\n if ((hasTimeUnit && !isObject(sort)) || (type !== 'nominal' && type !== 'ordinal')) {\n if (scaleType === 'log' || scaleType === 'symlog') {\n return 'greedy';\n }\n return true;\n }\n return undefined;\n}\nexport function defaultOrient(channel) {\n return channel === 'x' ? 'bottom' : 'left';\n}\nexport function defaultTickCount({ fieldOrDatumDef, scaleType, size, values: vals }) {\n var _a;\n if (!vals && !hasDiscreteDomain(scaleType) && scaleType !== 'log') {\n if (isFieldDef(fieldOrDatumDef)) {\n if (isBinning(fieldOrDatumDef.bin)) {\n // for binned data, we don't want more ticks than maxbins\n return { signal: `ceil(${size.signal}/10)` };\n }\n if (fieldOrDatumDef.timeUnit &&\n contains(['month', 'hours', 'day', 'quarter'], (_a = normalizeTimeUnit(fieldOrDatumDef.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit)) {\n return undefined;\n }\n }\n return { signal: `ceil(${size.signal}/40)` };\n }\n return undefined;\n}\nexport function getFieldDefTitle(model, channel) {\n const channel2 = channel === 'x' ? 'x2' : 'y2';\n const fieldDef = model.fieldDef(channel);\n const fieldDef2 = model.fieldDef(channel2);\n const title1 = fieldDef ? fieldDef.title : undefined;\n const title2 = fieldDef2 ? fieldDef2.title : undefined;\n if (title1 && title2) {\n return mergeTitle(title1, title2);\n }\n else if (title1) {\n return title1;\n }\n else if (title2) {\n return title2;\n }\n else if (title1 !== undefined) {\n // falsy value to disable config\n return title1;\n }\n else if (title2 !== undefined) {\n // falsy value to disable config\n return title2;\n }\n return undefined;\n}\nexport function values(axis, fieldOrDatumDef) {\n const vals = axis.values;\n if (isArray(vals)) {\n return valueArray(fieldOrDatumDef, vals);\n }\n else if (isSignalRef(vals)) {\n return vals;\n }\n return undefined;\n}\nexport function defaultZindex(mark, fieldDef) {\n if (mark === 'rect' && isDiscrete(fieldDef)) {\n return 1;\n }\n return 0;\n}\n//# sourceMappingURL=properties.js.map","import { isScaleFieldDef, vgField } from '../../channeldef';\nimport { fieldFilterExpression } from '../../predicate';\nimport { isSortArray } from '../../sort';\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nimport { getDependentFields } from './expressions';\nexport class CalculateNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n this._dependentFields = getDependentFields(this.transform.calculate);\n }\n clone() {\n return new CalculateNode(null, duplicate(this.transform));\n }\n static parseAllForSortIndex(parent, model) {\n // get all the encoding with sort fields from model\n model.forEachFieldDef((fieldDef, channel) => {\n if (!isScaleFieldDef(fieldDef)) {\n return;\n }\n if (isSortArray(fieldDef.sort)) {\n const { field, timeUnit } = fieldDef;\n const sort = fieldDef.sort;\n // generate `datum[\"a\"] === val0 ? 0 : datum[\"a\"] === val1 ? 1 : ... : n` via FieldEqualPredicate\n const calculate = sort\n .map((sortValue, i) => {\n return `${fieldFilterExpression({ field, timeUnit, equal: sortValue })} ? ${i} : `;\n })\n .join('') + sort.length;\n parent = new CalculateNode(parent, {\n calculate,\n as: sortArrayIndexField(fieldDef, channel, { forAs: true })\n });\n }\n });\n return parent;\n }\n producedFields() {\n return new Set([this.transform.as]);\n }\n dependentFields() {\n return this._dependentFields;\n }\n assemble() {\n return {\n type: 'formula',\n expr: this.transform.calculate,\n as: this.transform.as\n };\n }\n hash() {\n return `Calculate ${hash(this.transform)}`;\n }\n}\nexport function sortArrayIndexField(fieldDef, channel, opt) {\n return vgField(fieldDef, Object.assign({ prefix: channel, suffix: 'sort_index' }, (opt !== null && opt !== void 0 ? opt : {})));\n}\n//# sourceMappingURL=calculate.js.map","import { contains, getFirstDefined } from '../../util';\n/**\n * Get header channel, which can be different from facet channel when orient is specified or when the facet channel is facet.\n */\nexport function getHeaderChannel(channel, orient) {\n if (contains(['top', 'bottom'], orient)) {\n return 'column';\n }\n else if (contains(['left', 'right'], orient)) {\n return 'row';\n }\n return channel === 'row' ? 'row' : 'column';\n}\nexport function getHeaderProperty(prop, header, config, channel) {\n const headerSpecificConfig = channel === 'row' ? config.headerRow : channel === 'column' ? config.headerColumn : config.headerFacet;\n return getFirstDefined((header || {})[prop], headerSpecificConfig[prop], config.header[prop]);\n}\nexport function getHeaderProperties(properties, header, config, channel) {\n const props = {};\n for (const prop of properties) {\n const value = getHeaderProperty(prop, header || {}, config, channel);\n if (value !== undefined) {\n props[prop] = value;\n }\n }\n return props;\n}\n//# sourceMappingURL=common.js.map","export const HEADER_CHANNELS = ['row', 'column'];\nexport const HEADER_TYPES = ['header', 'footer'];\n//# sourceMappingURL=component.js.map","/**\n * Utility for generating row / column headers\n */\nimport { isArray } from 'vega-util';\nimport { FACET_CHANNELS } from '../../channel';\nimport { vgField } from '../../channeldef';\nimport { HEADER_LABEL_PROPERTIES, HEADER_LABEL_PROPERTIES_MAP, HEADER_TITLE_PROPERTIES, HEADER_TITLE_PROPERTIES_MAP } from '../../header';\nimport { isSortField } from '../../sort';\nimport { isFacetMapping } from '../../spec/facet';\nimport { contains, isEmpty, normalizeAngle, replaceAll } from '../../util';\nimport { defaultLabelAlign, defaultLabelBaseline } from '../axis/properties';\nimport { sortArrayIndexField } from '../data/calculate';\nimport { formatSignalRef } from '../format';\nimport { isFacetModel } from '../model';\nimport { getHeaderChannel, getHeaderProperties, getHeaderProperty } from './common';\nimport { HEADER_TYPES } from './component';\n// TODO: rename to assembleHeaderTitleGroup\nexport function assembleTitleGroup(model, channel) {\n const title = model.component.layoutHeaders[channel].title;\n const config = model.config ? model.config : undefined;\n const facetFieldDef = model.component.layoutHeaders[channel].facetFieldDef\n ? model.component.layoutHeaders[channel].facetFieldDef\n : undefined;\n const { titleAnchor, titleAngle: ta, titleOrient } = getHeaderProperties(['titleAnchor', 'titleAngle', 'titleOrient'], facetFieldDef.header, config, channel);\n const headerChannel = getHeaderChannel(channel, titleOrient);\n const titleAngle = normalizeAngle(ta);\n return {\n name: `${channel}-title`,\n type: 'group',\n role: `${headerChannel}-title`,\n title: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ text: title }, (channel === 'row' ? { orient: 'left' } : {})), { style: 'guide-title' }), defaultHeaderGuideBaseline(titleAngle, headerChannel)), defaultHeaderGuideAlign(headerChannel, titleAngle, titleAnchor)), assembleHeaderProperties(config, facetFieldDef, channel, HEADER_TITLE_PROPERTIES, HEADER_TITLE_PROPERTIES_MAP))\n };\n}\nexport function defaultHeaderGuideAlign(headerChannel, angle, anchor = 'middle') {\n switch (anchor) {\n case 'start':\n return { align: 'left' };\n case 'end':\n return { align: 'right' };\n }\n const align = defaultLabelAlign(angle, headerChannel === 'row' ? 'left' : 'top', headerChannel === 'row' ? 'y' : 'x');\n return align ? { align } : {};\n}\nexport function defaultHeaderGuideBaseline(angle, channel) {\n const baseline = defaultLabelBaseline(angle, channel === 'row' ? 'left' : 'top', channel === 'row' ? 'y' : 'x', true);\n return baseline ? { baseline } : {};\n}\nexport function assembleHeaderGroups(model, channel) {\n const layoutHeader = model.component.layoutHeaders[channel];\n const groups = [];\n for (const headerType of HEADER_TYPES) {\n if (layoutHeader[headerType]) {\n for (const headerComponent of layoutHeader[headerType]) {\n const group = assembleHeaderGroup(model, channel, headerType, layoutHeader, headerComponent);\n if (group != null) {\n groups.push(group);\n }\n }\n }\n }\n return groups;\n}\nfunction getSort(facetFieldDef, channel) {\n var _a;\n const { sort } = facetFieldDef;\n if (isSortField(sort)) {\n return {\n field: vgField(sort, { expr: 'datum' }),\n order: (_a = sort.order) !== null && _a !== void 0 ? _a : 'ascending'\n };\n }\n else if (isArray(sort)) {\n return {\n field: sortArrayIndexField(facetFieldDef, channel, { expr: 'datum' }),\n order: 'ascending'\n };\n }\n else {\n return {\n field: vgField(facetFieldDef, { expr: 'datum' }),\n order: sort !== null && sort !== void 0 ? sort : 'ascending'\n };\n }\n}\nexport function assembleLabelTitle(facetFieldDef, channel, config) {\n const { format, formatType, labelAngle, labelAnchor, labelOrient, labelExpr } = getHeaderProperties(['format', 'formatType', 'labelAngle', 'labelAnchor', 'labelOrient', 'labelExpr'], facetFieldDef.header, config, channel);\n const titleTextExpr = formatSignalRef({ fieldOrDatumDef: facetFieldDef, format, formatType, expr: 'parent', config })\n .signal;\n const headerChannel = getHeaderChannel(channel, labelOrient);\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ text: {\n signal: labelExpr\n ? replaceAll(replaceAll(labelExpr, 'datum.label', titleTextExpr), 'datum.value', vgField(facetFieldDef, { expr: 'parent' }))\n : titleTextExpr\n } }, (channel === 'row' ? { orient: 'left' } : {})), { style: 'guide-label', frame: 'group' }), defaultHeaderGuideBaseline(labelAngle, headerChannel)), defaultHeaderGuideAlign(headerChannel, labelAngle, labelAnchor)), assembleHeaderProperties(config, facetFieldDef, channel, HEADER_LABEL_PROPERTIES, HEADER_LABEL_PROPERTIES_MAP));\n}\nexport function assembleHeaderGroup(model, channel, headerType, layoutHeader, headerComponent) {\n if (headerComponent) {\n let title = null;\n const { facetFieldDef } = layoutHeader;\n const config = model.config ? model.config : undefined;\n if (facetFieldDef && headerComponent.labels) {\n const { labelOrient } = getHeaderProperties(['labelOrient'], facetFieldDef.header, config, channel);\n // Include label title in the header if orient aligns with the channel\n if ((channel === 'row' && !contains(['top', 'bottom'], labelOrient)) ||\n (channel === 'column' && !contains(['left', 'right'], labelOrient))) {\n title = assembleLabelTitle(facetFieldDef, channel, config);\n }\n }\n const isFacetWithoutRowCol = isFacetModel(model) && !isFacetMapping(model.facet);\n const axes = headerComponent.axes;\n const hasAxes = (axes === null || axes === void 0 ? void 0 : axes.length) > 0;\n if (title || hasAxes) {\n const sizeChannel = channel === 'row' ? 'height' : 'width';\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ name: model.getName(`${channel}_${headerType}`), type: 'group', role: `${channel}-${headerType}` }, (layoutHeader.facetFieldDef\n ? {\n from: { data: model.getName(channel + '_domain') },\n sort: getSort(facetFieldDef, channel)\n }\n : {})), (hasAxes && isFacetWithoutRowCol\n ? {\n from: { data: model.getName(`facet_domain_${channel}`) }\n }\n : {})), (title ? { title } : {})), (headerComponent.sizeSignal\n ? {\n encode: {\n update: {\n [sizeChannel]: headerComponent.sizeSignal\n }\n }\n }\n : {})), (hasAxes ? { axes } : {}));\n }\n }\n return null;\n}\nconst LAYOUT_TITLE_BAND = {\n column: {\n start: 0,\n end: 1\n },\n row: {\n start: 1,\n end: 0\n }\n};\nexport function getLayoutTitleBand(titleAnchor, headerChannel) {\n return LAYOUT_TITLE_BAND[headerChannel][titleAnchor];\n}\nexport function assembleLayoutTitleBand(headerComponentIndex, config) {\n const titleBand = {};\n for (const channel of FACET_CHANNELS) {\n const headerComponent = headerComponentIndex[channel];\n if (headerComponent === null || headerComponent === void 0 ? void 0 : headerComponent.facetFieldDef) {\n const { titleAnchor, titleOrient } = getHeaderProperties(['titleAnchor', 'titleOrient'], headerComponent.facetFieldDef.header, config, channel);\n const headerChannel = getHeaderChannel(channel, titleOrient);\n const band = getLayoutTitleBand(titleAnchor, headerChannel);\n if (band !== undefined) {\n titleBand[headerChannel] = band;\n }\n }\n }\n return isEmpty(titleBand) ? undefined : titleBand;\n}\nexport function assembleHeaderProperties(config, facetFieldDef, channel, properties, propertiesMap) {\n const props = {};\n for (const prop of properties) {\n if (!propertiesMap[prop]) {\n continue;\n }\n const value = getHeaderProperty(prop, facetFieldDef === null || facetFieldDef === void 0 ? void 0 : facetFieldDef.header, config, channel);\n if (value !== undefined) {\n props[propertiesMap[prop]] = value;\n }\n }\n return props;\n}\n//# sourceMappingURL=assemble.js.map","import { getViewConfigContinuousSize } from '../../config';\nimport { hasDiscreteDomain } from '../../scale';\nimport { getFirstDefined } from '../../util';\nimport { isVgRangeStep } from '../../vega.schema';\nimport { signalOrStringValue } from '../common';\nimport { isFacetModel } from '../model';\nexport function assembleLayoutSignals(model) {\n return [\n ...sizeSignals(model, 'width'),\n ...sizeSignals(model, 'height'),\n ...sizeSignals(model, 'childWidth'),\n ...sizeSignals(model, 'childHeight')\n ];\n}\nexport function sizeSignals(model, sizeType) {\n const channel = sizeType === 'width' ? 'x' : 'y';\n const size = model.component.layoutSize.get(sizeType);\n if (!size || size === 'merged') {\n return [];\n }\n // Read size signal name from name map, just in case it is the top-level size signal that got renamed.\n const name = model.getSizeSignalRef(sizeType).signal;\n if (size === 'step') {\n const scaleComponent = model.getScaleComponent(channel);\n if (scaleComponent) {\n const type = scaleComponent.get('type');\n const range = scaleComponent.get('range');\n if (hasDiscreteDomain(type) && isVgRangeStep(range)) {\n const scaleName = model.scaleName(channel);\n if (isFacetModel(model.parent)) {\n // If parent is facet and this is an independent scale, return only signal signal\n // as the width/height will be calculated using the cardinality from\n // facet's aggregate rather than reading from scale domain\n const parentResolve = model.parent.component.resolve;\n if (parentResolve.scale[channel] === 'independent') {\n return [stepSignal(scaleName, range)];\n }\n }\n return [\n stepSignal(scaleName, range),\n {\n name,\n update: sizeExpr(scaleName, scaleComponent, `domain('${scaleName}').length`)\n }\n ];\n }\n }\n /* istanbul ignore next: Condition should not happen -- only for warning in development. */\n throw new Error('layout size is step although width/height is not step.');\n }\n else if (size == 'container') {\n const isWidth = name.endsWith('width');\n const expr = isWidth ? 'containerSize()[0]' : 'containerSize()[1]';\n const defaultValue = getViewConfigContinuousSize(model.config.view, isWidth ? 'width' : 'height');\n const safeExpr = `isFinite(${expr}) ? ${expr} : ${defaultValue}`;\n return [{ name, init: safeExpr, on: [{ update: safeExpr, events: 'window:resize' }] }];\n }\n else {\n return [\n {\n name,\n value: size\n }\n ];\n }\n}\nfunction stepSignal(scaleName, range) {\n return {\n name: scaleName + '_step',\n value: range.step\n };\n}\nexport function sizeExpr(scaleName, scaleComponent, cardinality) {\n const type = scaleComponent.get('type');\n const padding = scaleComponent.get('padding');\n const paddingOuter = getFirstDefined(scaleComponent.get('paddingOuter'), padding);\n let paddingInner = scaleComponent.get('paddingInner');\n paddingInner =\n type === 'band'\n ? // only band has real paddingInner\n paddingInner !== undefined\n ? paddingInner\n : padding\n : // For point, as calculated in https://github.com/vega/vega-scale/blob/master/src/band.js#L128,\n // it's equivalent to have paddingInner = 1 since there is only n-1 steps between n points.\n 1;\n return `bandspace(${cardinality}, ${signalOrStringValue(paddingInner)}, ${signalOrStringValue(paddingOuter)}) * ${scaleName}_step`;\n}\n//# sourceMappingURL=assemble.js.map","export function getSizeTypeFromLayoutSizeType(layoutSizeType) {\n return layoutSizeType === 'childWidth' ? 'width' : layoutSizeType === 'childHeight' ? 'height' : layoutSizeType;\n}\n//# sourceMappingURL=component.js.map","import { keys } from '../util';\nimport { signalOrValueRef } from './common';\nimport { wrapCondition } from './mark/encode';\nexport function guideEncodeEntry(encoding, model) {\n return keys(encoding).reduce((encode, channel) => {\n const valueDef = encoding[channel];\n return Object.assign(Object.assign({}, encode), wrapCondition(model, valueDef, channel, def => signalOrValueRef(def.value)));\n }, {});\n}\n//# sourceMappingURL=guide.js.map","import { isXorY } from '../channel';\nimport * as log from '../log';\nimport { isConcatModel, isFacetModel, isLayerModel } from './model';\nexport function defaultScaleResolve(channel, model) {\n if (isLayerModel(model) || isFacetModel(model)) {\n return 'shared';\n }\n else if (isConcatModel(model)) {\n return isXorY(channel) ? 'independent' : 'shared';\n }\n /* istanbul ignore next: should never reach here. */\n throw new Error('invalid model type for resolve');\n}\nexport function parseGuideResolve(resolve, channel) {\n const channelScaleResolve = resolve.scale[channel];\n const guide = isXorY(channel) ? 'axis' : 'legend';\n if (channelScaleResolve === 'independent') {\n if (resolve[guide][channel] === 'shared') {\n log.warn(log.message.independentScaleMeansIndependentGuide(channel));\n }\n return 'independent';\n }\n return resolve[guide][channel] || 'shared';\n}\n//# sourceMappingURL=resolve.js.map","import { COMMON_LEGEND_PROPERTY_INDEX } from '../../legend';\nimport { keys } from '../../util';\nimport { Split } from '../split';\nconst LEGEND_COMPONENT_PROPERTY_INDEX = Object.assign(Object.assign({}, COMMON_LEGEND_PROPERTY_INDEX), { disable: 1, labelExpr: 1, selections: 1, \n // channel scales\n opacity: 1, shape: 1, stroke: 1, fill: 1, size: 1, strokeWidth: 1, strokeDash: 1, \n // encode\n encode: 1 });\nexport const LEGEND_COMPONENT_PROPERTIES = keys(LEGEND_COMPONENT_PROPERTY_INDEX);\nexport class LegendComponent extends Split {\n}\n//# sourceMappingURL=component.js.map","import { array, isArray, stringValue } from 'vega-util';\nimport { COLOR, OPACITY } from '../../channel';\nimport { hasConditionalValueDef, isFieldDef, isValueDef } from '../../channeldef';\nimport { FILL_STROKE_CONFIG } from '../../mark';\nimport { getFirstDefined, isEmpty, varName } from '../../util';\nimport { applyMarkConfig, signalOrValueRef } from '../common';\nimport { formatCustomType, isCustomFormatType } from '../format';\nimport * as mixins from '../mark/encode';\nimport { STORE } from '../selection';\nexport const legendEncodeRules = {\n symbols,\n gradient,\n labels,\n entries\n};\nexport function symbols(symbolsSpec, { fieldOrDatumDef, model, channel, legendCmpt, legendType }) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n if (legendType !== 'symbol') {\n return undefined;\n }\n const { markDef, encoding, config, mark } = model;\n const filled = markDef.filled && mark !== 'trail';\n let out = Object.assign(Object.assign({}, applyMarkConfig({}, model, FILL_STROKE_CONFIG)), mixins.color(model, { filled })); // FIXME: remove this when VgEncodeEntry is compatible with SymbolEncodeEntry\n const symbolOpacity = (_a = legendCmpt.get('symbolOpacity')) !== null && _a !== void 0 ? _a : config.legend.symbolOpacity;\n const symbolFillColor = (_b = legendCmpt.get('symbolFillColor')) !== null && _b !== void 0 ? _b : config.legend.symbolFillColor;\n const symbolStrokeColor = (_c = legendCmpt.get('symbolStrokeColor')) !== null && _c !== void 0 ? _c : config.legend.symbolStrokeColor;\n const opacity = symbolOpacity === undefined ? (_d = getMaxValue(encoding.opacity)) !== null && _d !== void 0 ? _d : markDef.opacity : undefined;\n if (out.fill) {\n // for fill legend, we don't want any fill in symbol\n if (channel === 'fill' || (filled && channel === COLOR)) {\n delete out.fill;\n }\n else {\n if (out.fill['field']) {\n // For others, set fill to some opaque value (or nothing if a color is already set)\n if (symbolFillColor) {\n delete out.fill;\n }\n else {\n out.fill = signalOrValueRef((_e = config.legend.symbolBaseFillColor) !== null && _e !== void 0 ? _e : 'black');\n out.fillOpacity = signalOrValueRef(opacity !== null && opacity !== void 0 ? opacity : 1);\n }\n }\n else if (isArray(out.fill)) {\n const fill = (_h = (_g = getFirstConditionValue((_f = encoding.fill) !== null && _f !== void 0 ? _f : encoding.color)) !== null && _g !== void 0 ? _g : markDef.fill) !== null && _h !== void 0 ? _h : (filled && markDef.color);\n if (fill) {\n out.fill = signalOrValueRef(fill);\n }\n }\n }\n }\n if (out.stroke) {\n if (channel === 'stroke' || (!filled && channel === COLOR)) {\n delete out.stroke;\n }\n else {\n if (out.stroke['field'] || symbolStrokeColor) {\n // For others, remove stroke field\n delete out.stroke;\n }\n else if (isArray(out.stroke)) {\n const stroke = getFirstDefined(getFirstConditionValue(encoding.stroke || encoding.color), markDef.stroke, filled ? markDef.color : undefined);\n if (stroke) {\n out.stroke = { value: stroke };\n }\n }\n }\n }\n if (channel !== OPACITY) {\n const condition = isFieldDef(fieldOrDatumDef) && selectedCondition(model, legendCmpt, fieldOrDatumDef);\n if (condition) {\n out.opacity = [\n Object.assign({ test: condition }, signalOrValueRef(opacity !== null && opacity !== void 0 ? opacity : 1)),\n signalOrValueRef(config.legend.unselectedOpacity)\n ];\n }\n else if (opacity) {\n out.opacity = signalOrValueRef(opacity);\n }\n }\n out = Object.assign(Object.assign({}, out), symbolsSpec);\n return isEmpty(out) ? undefined : out;\n}\nexport function gradient(gradientSpec, { model, legendType, legendCmpt }) {\n var _a;\n if (legendType !== 'gradient') {\n return undefined;\n }\n const { config, markDef, encoding } = model;\n let out = {};\n const gradientOpacity = (_a = legendCmpt.get('gradientOpacity')) !== null && _a !== void 0 ? _a : config.legend.gradientOpacity;\n const opacity = gradientOpacity === undefined ? getMaxValue(encoding.opacity) || markDef.opacity : undefined;\n if (opacity) {\n // only apply opacity if it is neither zero or undefined\n out.opacity = signalOrValueRef(opacity);\n }\n out = Object.assign(Object.assign({}, out), gradientSpec);\n return isEmpty(out) ? undefined : out;\n}\nexport function labels(specifiedlabelsSpec, { fieldOrDatumDef, model, channel, legendCmpt }) {\n const legend = model.legend(channel) || {};\n const config = model.config;\n const condition = isFieldDef(fieldOrDatumDef) ? selectedCondition(model, legendCmpt, fieldOrDatumDef) : undefined;\n const opacity = condition ? [{ test: condition, value: 1 }, { value: config.legend.unselectedOpacity }] : undefined;\n const { format, formatType } = legend;\n const text = isCustomFormatType(formatType)\n ? formatCustomType({\n fieldOrDatumDef,\n field: 'datum.value',\n format,\n formatType,\n config\n })\n : undefined;\n const labelsSpec = Object.assign(Object.assign(Object.assign({}, (opacity ? { opacity } : {})), (text ? { text } : {})), specifiedlabelsSpec);\n return isEmpty(labelsSpec) ? undefined : labelsSpec;\n}\nexport function entries(entriesSpec, { legendCmpt }) {\n const selections = legendCmpt.get('selections');\n return (selections === null || selections === void 0 ? void 0 : selections.length) ? Object.assign(Object.assign({}, entriesSpec), { fill: { value: 'transparent' } }) : entriesSpec;\n}\nfunction getMaxValue(channelDef) {\n return getConditionValue(channelDef, (v, conditionalDef) => Math.max(v, conditionalDef.value));\n}\nexport function getFirstConditionValue(channelDef) {\n return getConditionValue(channelDef, (v, conditionalDef) => {\n return getFirstDefined(v, conditionalDef.value);\n });\n}\nfunction getConditionValue(channelDef, reducer) {\n if (hasConditionalValueDef(channelDef)) {\n return array(channelDef.condition).reduce(reducer, channelDef.value);\n }\n else if (isValueDef(channelDef)) {\n return channelDef.value;\n }\n return undefined;\n}\nfunction selectedCondition(model, legendCmpt, fieldDef) {\n const selections = legendCmpt.get('selections');\n if (!(selections === null || selections === void 0 ? void 0 : selections.length))\n return undefined;\n const field = stringValue(fieldDef.field);\n return selections\n .map(name => {\n const store = stringValue(varName(name) + STORE);\n return `(!length(data(${store})) || (${name}[${field}] && indexof(${name}[${field}], datum.value) >= 0))`;\n })\n .join(' || ');\n}\n//# sourceMappingURL=encode.js.map","import { isArray } from 'vega-util';\nimport { isColorChannel } from '../../channel';\nimport { title as fieldDefTitle, valueArray } from '../../channeldef';\nimport { isContinuousToContinuous } from '../../scale';\nimport { contains, getFirstDefined } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { guideFormat, guideFormatType } from '../format';\nimport { getFirstConditionValue } from './encode';\nexport const legendRules = {\n direction: ({ direction }) => direction,\n format: ({ fieldOrDatumDef, legend, config }) => {\n const { format, formatType } = legend;\n return guideFormat(fieldOrDatumDef, fieldOrDatumDef.type, format, formatType, config, false);\n },\n formatType: ({ legend, fieldOrDatumDef, scaleType }) => {\n const { formatType } = legend;\n return guideFormatType(formatType, fieldOrDatumDef, scaleType);\n },\n gradientLength: params => {\n var _a, _b;\n const { legend, legendConfig } = params;\n return (_b = (_a = legend.gradientLength) !== null && _a !== void 0 ? _a : legendConfig.gradientLength) !== null && _b !== void 0 ? _b : defaultGradientLength(params);\n },\n labelOverlap: ({ legend, legendConfig, scaleType }) => { var _a, _b; return (_b = (_a = legend.labelOverlap) !== null && _a !== void 0 ? _a : legendConfig.labelOverlap) !== null && _b !== void 0 ? _b : defaultLabelOverlap(scaleType); },\n symbolType: ({ legend, markDef, channel, encoding }) => { var _a; return (_a = legend.symbolType) !== null && _a !== void 0 ? _a : defaultSymbolType(markDef.type, channel, encoding.shape, markDef.shape); },\n title: ({ fieldOrDatumDef, config }) => fieldDefTitle(fieldOrDatumDef, config, { allowDisabling: true }),\n type: ({ legendType, scaleType, channel }) => {\n if (isColorChannel(channel) && isContinuousToContinuous(scaleType)) {\n if (legendType === 'gradient') {\n return undefined;\n }\n }\n else if (legendType === 'symbol') {\n return undefined;\n }\n return legendType;\n },\n values: ({ fieldOrDatumDef, legend }) => values(legend, fieldOrDatumDef)\n};\nexport function values(legend, fieldOrDatumDef) {\n const vals = legend.values;\n if (isArray(vals)) {\n return valueArray(fieldOrDatumDef, vals);\n }\n else if (isSignalRef(vals)) {\n return vals;\n }\n return undefined;\n}\nexport function defaultSymbolType(mark, channel, shapeChannelDef, markShape) {\n var _a;\n if (channel !== 'shape') {\n // use the value from the shape encoding or the mark config if they exist\n const shape = (_a = getFirstConditionValue(shapeChannelDef)) !== null && _a !== void 0 ? _a : markShape;\n if (shape) {\n return shape;\n }\n }\n switch (mark) {\n case 'bar':\n case 'rect':\n case 'image':\n case 'square':\n return 'square';\n case 'line':\n case 'trail':\n case 'rule':\n return 'stroke';\n case 'arc':\n case 'point':\n case 'circle':\n case 'tick':\n case 'geoshape':\n case 'area':\n case 'text':\n return 'circle';\n }\n}\nexport function clipHeight(legendType) {\n if (legendType === 'gradient') {\n return 20;\n }\n return undefined;\n}\nexport function getLegendType(params) {\n const { legend } = params;\n return getFirstDefined(legend.type, defaultType(params));\n}\nexport function defaultType({ channel, timeUnit, scaleType }) {\n // Following the logic in https://github.com/vega/vega-parser/blob/master/src/parsers/legend.js\n if (isColorChannel(channel)) {\n if (contains(['quarter', 'month', 'day'], timeUnit)) {\n return 'symbol';\n }\n if (isContinuousToContinuous(scaleType)) {\n return 'gradient';\n }\n }\n return 'symbol';\n}\nexport function getDirection({ legendConfig, legendType, orient, legend }) {\n var _a, _b;\n return ((_b = (_a = legend.direction) !== null && _a !== void 0 ? _a : legendConfig[legendType ? 'gradientDirection' : 'symbolDirection']) !== null && _b !== void 0 ? _b : defaultDirection(orient, legendType));\n}\nexport function defaultDirection(orient, legendType) {\n switch (orient) {\n case 'top':\n case 'bottom':\n return 'horizontal';\n case 'left':\n case 'right':\n case 'none':\n case undefined: // undefined = \"right\" in Vega\n return undefined; // vertical is Vega's default\n default:\n // top-left / ...\n // For inner legend, uses compact layout like Tableau\n return legendType === 'gradient' ? 'horizontal' : undefined;\n }\n}\nexport function defaultGradientLength({ legendConfig, model, direction, orient, scaleType }) {\n const { gradientHorizontalMaxLength, gradientHorizontalMinLength, gradientVerticalMaxLength, gradientVerticalMinLength } = legendConfig;\n if (isContinuousToContinuous(scaleType)) {\n if (direction === 'horizontal') {\n if (orient === 'top' || orient === 'bottom') {\n return gradientLengthSignal(model, 'width', gradientHorizontalMinLength, gradientHorizontalMaxLength);\n }\n else {\n return gradientHorizontalMinLength;\n }\n }\n else {\n // vertical / undefined (Vega uses vertical by default)\n return gradientLengthSignal(model, 'height', gradientVerticalMinLength, gradientVerticalMaxLength);\n }\n }\n return undefined;\n}\nfunction gradientLengthSignal(model, sizeType, min, max) {\n const sizeSignal = model.getSizeSignalRef(sizeType).signal;\n return { signal: `clamp(${sizeSignal}, ${min}, ${max})` };\n}\nexport function defaultLabelOverlap(scaleType) {\n if (contains(['quantile', 'threshold', 'log', 'symlog'], scaleType)) {\n return 'greedy';\n }\n return undefined;\n}\n//# sourceMappingURL=properties.js.map","import { COLOR, SHAPE } from '../../channel';\nimport { getFieldOrDatumDef, isFieldDef } from '../../channeldef';\nimport { LEGEND_SCALE_CHANNELS } from '../../legend';\nimport { normalizeTimeUnit } from '../../timeunit';\nimport { GEOJSON } from '../../type';\nimport { deleteNestedProperty, isEmpty, keys, varName } from '../../util';\nimport { mergeTitleComponent } from '../common';\nimport { guideEncodeEntry } from '../guide';\nimport { isUnitModel } from '../model';\nimport { parseGuideResolve } from '../resolve';\nimport { parseInteractiveLegend } from '../selection/transforms/legends';\nimport { defaultTieBreaker, makeImplicit, mergeValuesWithExplicit } from '../split';\nimport { LegendComponent, LEGEND_COMPONENT_PROPERTIES } from './component';\nimport { legendEncodeRules } from './encode';\nimport { getDirection, getLegendType, legendRules } from './properties';\nexport function parseLegend(model) {\n const legendComponent = isUnitModel(model) ? parseUnitLegend(model) : parseNonUnitLegend(model);\n model.component.legends = legendComponent;\n return legendComponent;\n}\nfunction parseUnitLegend(model) {\n const { encoding } = model;\n const legendComponent = {};\n for (const channel of [COLOR, ...LEGEND_SCALE_CHANNELS]) {\n const def = getFieldOrDatumDef(encoding[channel]);\n if (!def || !model.getScaleComponent(channel)) {\n continue;\n }\n if (channel === SHAPE && isFieldDef(def) && def.type === GEOJSON) {\n continue;\n }\n legendComponent[channel] = parseLegendForChannel(model, channel);\n }\n return legendComponent;\n}\nfunction getLegendDefWithScale(model, channel) {\n const scale = model.scaleName(channel);\n if (model.mark === 'trail') {\n if (channel === 'color') {\n // trail is a filled mark, but its default symbolType (\"stroke\") should use \"stroke\"\n return { stroke: scale };\n }\n else if (channel === 'size') {\n return { strokeWidth: scale };\n }\n }\n if (channel === 'color') {\n return model.markDef.filled ? { fill: scale } : { stroke: scale };\n }\n return { [channel]: scale };\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isExplicit(value, property, legend, fieldDef) {\n switch (property) {\n case 'disable':\n return legend !== undefined; // if axis is specified or null/false, then it's enable/disable state is explicit\n case 'values':\n // specified legend.values is already respected, but may get transformed.\n return !!(legend === null || legend === void 0 ? void 0 : legend.values);\n case 'title':\n // title can be explicit if fieldDef.title is set\n if (property === 'title' && value === (fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.title)) {\n return true;\n }\n }\n // Otherwise, things are explicit if the returned value matches the specified property\n return value === (legend || {})[property];\n}\nexport function parseLegendForChannel(model, channel) {\n var _a, _b, _c;\n let legend = model.legend(channel);\n const { markDef, encoding, config } = model;\n const legendConfig = config.legend;\n const legendCmpt = new LegendComponent({}, getLegendDefWithScale(model, channel));\n parseInteractiveLegend(model, channel, legendCmpt);\n const disable = legend !== undefined ? !legend : legendConfig.disable;\n legendCmpt.set('disable', disable, legend !== undefined);\n if (disable) {\n return legendCmpt;\n }\n legend = legend || {};\n const scaleType = model.getScaleComponent(channel).get('type');\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n const timeUnit = isFieldDef(fieldOrDatumDef) ? (_a = normalizeTimeUnit(fieldOrDatumDef.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit : undefined;\n const orient = legend.orient || config.legend.orient || 'right';\n const legendType = getLegendType({ legend, channel, timeUnit, scaleType });\n const direction = getDirection({ legend, legendType, orient, legendConfig });\n const ruleParams = {\n legend,\n channel,\n model,\n markDef,\n encoding,\n fieldOrDatumDef,\n legendConfig,\n config,\n scaleType,\n orient,\n legendType,\n direction\n };\n for (const property of LEGEND_COMPONENT_PROPERTIES) {\n if ((legendType === 'gradient' && property.startsWith('symbol')) ||\n (legendType === 'symbol' && property.startsWith('gradient'))) {\n continue;\n }\n const value = property in legendRules ? legendRules[property](ruleParams) : legend[property];\n if (value !== undefined) {\n const explicit = isExplicit(value, property, legend, model.fieldDef(channel));\n if (explicit || config.legend[property] === undefined) {\n legendCmpt.set(property, value, explicit);\n }\n }\n }\n const legendEncoding = (_b = legend === null || legend === void 0 ? void 0 : legend.encoding) !== null && _b !== void 0 ? _b : {};\n const selections = legendCmpt.get('selections');\n const legendEncode = {};\n const legendEncodeParams = { fieldOrDatumDef, model, channel, legendCmpt, legendType };\n for (const part of ['labels', 'legend', 'title', 'symbols', 'gradient', 'entries']) {\n const legendEncodingPart = guideEncodeEntry((_c = legendEncoding[part]) !== null && _c !== void 0 ? _c : {}, model);\n const value = part in legendEncodeRules\n ? legendEncodeRules[part](legendEncodingPart, legendEncodeParams) // apply rule\n : legendEncodingPart; // no rule -- just default values\n if (value !== undefined && !isEmpty(value)) {\n legendEncode[part] = Object.assign(Object.assign(Object.assign({}, ((selections === null || selections === void 0 ? void 0 : selections.length) && isFieldDef(fieldOrDatumDef)\n ? { name: `${varName(fieldOrDatumDef.field)}_legend_${part}` }\n : {})), ((selections === null || selections === void 0 ? void 0 : selections.length) ? { interactive: !!selections } : {})), { update: value });\n }\n }\n if (!isEmpty(legendEncode)) {\n legendCmpt.set('encode', legendEncode, !!(legend === null || legend === void 0 ? void 0 : legend.encoding));\n }\n return legendCmpt;\n}\nfunction parseNonUnitLegend(model) {\n const { legends, resolve } = model.component;\n for (const child of model.children) {\n parseLegend(child);\n for (const channel of keys(child.component.legends)) {\n resolve.legend[channel] = parseGuideResolve(model.component.resolve, channel);\n if (resolve.legend[channel] === 'shared') {\n // If the resolve says shared (and has not been overridden)\n // We will try to merge and see if there is a conflict\n legends[channel] = mergeLegendComponent(legends[channel], child.component.legends[channel]);\n if (!legends[channel]) {\n // If merge returns nothing, there is a conflict so we cannot make the legend shared.\n // Thus, mark legend as independent and remove the legend component.\n resolve.legend[channel] = 'independent';\n delete legends[channel];\n }\n }\n }\n }\n for (const channel of keys(legends)) {\n for (const child of model.children) {\n if (!child.component.legends[channel]) {\n // skip if the child does not have a particular legend\n continue;\n }\n if (resolve.legend[channel] === 'shared') {\n // After merging shared legend, make sure to remove legend from child\n delete child.component.legends[channel];\n }\n }\n }\n return legends;\n}\nexport function mergeLegendComponent(mergedLegend, childLegend) {\n var _a, _b, _c, _d;\n if (!mergedLegend) {\n return childLegend.clone();\n }\n const mergedOrient = mergedLegend.getWithExplicit('orient');\n const childOrient = childLegend.getWithExplicit('orient');\n if (mergedOrient.explicit && childOrient.explicit && mergedOrient.value !== childOrient.value) {\n // TODO: throw warning if resolve is explicit (We don't have info about explicit/implicit resolve yet.)\n // Cannot merge due to inconsistent orient\n return undefined;\n }\n let typeMerged = false;\n // Otherwise, let's merge\n for (const prop of LEGEND_COMPONENT_PROPERTIES) {\n const mergedValueWithExplicit = mergeValuesWithExplicit(mergedLegend.getWithExplicit(prop), childLegend.getWithExplicit(prop), prop, 'legend', \n // Tie breaker function\n (v1, v2) => {\n switch (prop) {\n case 'symbolType':\n return mergeSymbolType(v1, v2);\n case 'title':\n return mergeTitleComponent(v1, v2);\n case 'type':\n // There are only two types. If we have different types, then prefer symbol over gradient.\n typeMerged = true;\n return makeImplicit('symbol');\n }\n return defaultTieBreaker(v1, v2, prop, 'legend');\n });\n mergedLegend.setWithExplicit(prop, mergedValueWithExplicit);\n }\n if (typeMerged) {\n if ((_b = (_a = mergedLegend.implicit) === null || _a === void 0 ? void 0 : _a.encode) === null || _b === void 0 ? void 0 : _b.gradient) {\n deleteNestedProperty(mergedLegend.implicit, ['encode', 'gradient']);\n }\n if ((_d = (_c = mergedLegend.explicit) === null || _c === void 0 ? void 0 : _c.encode) === null || _d === void 0 ? void 0 : _d.gradient) {\n deleteNestedProperty(mergedLegend.explicit, ['encode', 'gradient']);\n }\n }\n return mergedLegend;\n}\nfunction mergeSymbolType(st1, st2) {\n if (st2.value === 'circle') {\n // prefer \"circle\" over \"stroke\"\n return st2;\n }\n return st1;\n}\n//# sourceMappingURL=parse.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { LEGEND_SCALE_CHANNELS } from '../../legend';\nimport { keys, replaceAll, stringify, vals } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { mergeLegendComponent } from './parse';\nfunction setLegendEncode(legend, part, vgProp, vgRef) {\n var _a, _b, _c;\n legend.encode = (_a = legend.encode) !== null && _a !== void 0 ? _a : {};\n legend.encode[part] = (_b = legend.encode[part]) !== null && _b !== void 0 ? _b : {};\n legend.encode[part].update = (_c = legend.encode[part].update) !== null && _c !== void 0 ? _c : {};\n // TODO: remove as any after https://github.com/prisma/nexus-prisma/issues/291\n legend.encode[part].update[vgProp] = vgRef;\n}\nexport function assembleLegends(model) {\n const legendComponentIndex = model.component.legends;\n const legendByDomain = {};\n for (const channel of keys(legendComponentIndex)) {\n const scaleComponent = model.getScaleComponent(channel);\n const domainHash = stringify(scaleComponent.get('domains'));\n if (legendByDomain[domainHash]) {\n for (const mergedLegendComponent of legendByDomain[domainHash]) {\n const merged = mergeLegendComponent(mergedLegendComponent, legendComponentIndex[channel]);\n if (!merged) {\n // If cannot merge, need to add this legend separately\n legendByDomain[domainHash].push(legendComponentIndex[channel]);\n }\n }\n }\n else {\n legendByDomain[domainHash] = [legendComponentIndex[channel].clone()];\n }\n }\n const legends = vals(legendByDomain)\n .flat()\n .map(l => assembleLegend(l, model.config))\n .filter(l => l !== undefined);\n return legends;\n}\nexport function assembleLegend(legendCmpt, config) {\n var _a, _b, _c;\n const _d = legendCmpt.combine(), { disable, labelExpr, selections } = _d, legend = __rest(_d, [\"disable\", \"labelExpr\", \"selections\"]);\n if (disable) {\n return undefined;\n }\n if (config.aria === false && legend.aria == undefined) {\n legend.aria = false;\n }\n if ((_a = legend.encode) === null || _a === void 0 ? void 0 : _a.symbols) {\n const out = legend.encode.symbols.update;\n if (out.fill && out.fill['value'] !== 'transparent' && !out.stroke && !legend.stroke) {\n // For non color channel's legend, we need to override symbol stroke config from Vega config if stroke channel is not used.\n out.stroke = { value: 'transparent' };\n }\n // Remove properties that the legend is encoding.\n for (const property of LEGEND_SCALE_CHANNELS) {\n if (legend[property]) {\n delete out[property];\n }\n }\n }\n if (!legend.title) {\n // title schema doesn't include null, ''\n delete legend.title;\n }\n if (labelExpr !== undefined) {\n let expr = labelExpr;\n if (((_c = (_b = legend.encode) === null || _b === void 0 ? void 0 : _b.labels) === null || _c === void 0 ? void 0 : _c.update) && isSignalRef(legend.encode.labels.update.text)) {\n expr = replaceAll(labelExpr, 'datum.label', legend.encode.labels.update.text.signal);\n }\n setLegendEncode(legend, 'labels', 'text', { signal: expr });\n }\n return legend;\n}\n//# sourceMappingURL=assemble.js.map","import { contains } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { isConcatModel, isLayerModel } from '../model';\nexport function assembleProjections(model) {\n if (isLayerModel(model) || isConcatModel(model)) {\n return assembleProjectionsForModelAndChildren(model);\n }\n else {\n return assembleProjectionForModel(model);\n }\n}\nexport function assembleProjectionsForModelAndChildren(model) {\n return model.children.reduce((projections, child) => {\n return projections.concat(child.assembleProjections());\n }, assembleProjectionForModel(model));\n}\nexport function assembleProjectionForModel(model) {\n const component = model.component.projection;\n if (!component || component.merged) {\n return [];\n }\n const projection = component.combine();\n const { name } = projection; // we need to extract name so that it is always present in the output and pass TS type validation\n if (!component.data) {\n // generate custom projection, no automatic fitting\n return [\n Object.assign(Object.assign({ name }, { translate: { signal: '[width / 2, height / 2]' } }), projection)\n ];\n }\n else {\n // generate projection that uses extent fitting\n const size = {\n signal: `[${component.size.map(ref => ref.signal).join(', ')}]`\n };\n const fits = component.data.reduce((sources, data) => {\n const source = isSignalRef(data) ? data.signal : `data('${model.lookupDataSource(data)}')`;\n if (!contains(sources, source)) {\n // build a unique list of sources\n sources.push(source);\n }\n return sources;\n }, []);\n if (fits.length <= 0) {\n throw new Error(\"Projection's fit didn't find any data sources\");\n }\n return [\n Object.assign({ name,\n size, fit: {\n signal: fits.length > 1 ? `[${fits.join(', ')}]` : fits[0]\n } }, projection)\n ];\n }\n}\n//# sourceMappingURL=assemble.js.map","export const PROJECTION_PROPERTIES = [\n 'type',\n 'clipAngle',\n 'clipExtent',\n 'center',\n 'rotate',\n 'precision',\n 'reflectX',\n 'reflectY',\n 'coefficient',\n 'distance',\n 'fraction',\n 'lobes',\n 'parallel',\n 'radius',\n 'ratio',\n 'spacing',\n 'tilt'\n];\n//# sourceMappingURL=projection.js.map","import { Split } from '../split';\nexport class ProjectionComponent extends Split {\n constructor(name, specifiedProjection, size, data) {\n super(Object.assign({}, specifiedProjection), // all explicit properties of projection\n { name } // name as initial implicit property\n );\n this.specifiedProjection = specifiedProjection;\n this.size = size;\n this.data = data;\n this.merged = false;\n }\n /**\n * Whether the projection parameters should fit provided data.\n */\n get isFit() {\n return !!this.data;\n }\n}\n//# sourceMappingURL=component.js.map","import { hasOwnProperty } from 'vega-util';\nimport { LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2, SHAPE } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { DataSourceType } from '../../data';\nimport { PROJECTION_PROPERTIES } from '../../projection';\nimport { GEOJSON } from '../../type';\nimport { duplicate, every, stringify } from '../../util';\nimport { isUnitModel } from '../model';\nimport { ProjectionComponent } from './component';\nexport function parseProjection(model) {\n model.component.projection = isUnitModel(model) ? parseUnitProjection(model) : parseNonUnitProjections(model);\n}\nfunction parseUnitProjection(model) {\n var _a;\n if (model.hasProjection) {\n const proj = model.specifiedProjection;\n const fit = !(proj && (proj.scale != null || proj.translate != null));\n const size = fit ? [model.getSizeSignalRef('width'), model.getSizeSignalRef('height')] : undefined;\n const data = fit ? gatherFitData(model) : undefined;\n return new ProjectionComponent(model.projectionName(true), Object.assign(Object.assign({}, ((_a = model.config.projection) !== null && _a !== void 0 ? _a : {})), (proj !== null && proj !== void 0 ? proj : {})), size, data);\n }\n return undefined;\n}\nfunction gatherFitData(model) {\n const data = [];\n const { encoding } = model;\n for (const posssiblePair of [\n [LONGITUDE, LATITUDE],\n [LONGITUDE2, LATITUDE2]\n ]) {\n if (getFieldOrDatumDef(encoding[posssiblePair[0]]) || getFieldOrDatumDef(encoding[posssiblePair[1]])) {\n data.push({\n signal: model.getName(`geojson_${data.length}`)\n });\n }\n }\n if (model.channelHasField(SHAPE) && model.typedFieldDef(SHAPE).type === GEOJSON) {\n data.push({\n signal: model.getName(`geojson_${data.length}`)\n });\n }\n if (data.length === 0) {\n // main source is geojson, so we can just use that\n data.push(model.requestDataName(DataSourceType.Main));\n }\n return data;\n}\nfunction mergeIfNoConflict(first, second) {\n const allPropertiesShared = every(PROJECTION_PROPERTIES, prop => {\n // neither has the property\n if (!hasOwnProperty(first.explicit, prop) && !hasOwnProperty(second.explicit, prop)) {\n return true;\n }\n // both have property and an equal value for property\n if (hasOwnProperty(first.explicit, prop) &&\n hasOwnProperty(second.explicit, prop) &&\n // some properties might be signals or objects and require hashing for comparison\n stringify(first.get(prop)) === stringify(second.get(prop))) {\n return true;\n }\n return false;\n });\n const size = stringify(first.size) === stringify(second.size);\n if (size) {\n if (allPropertiesShared) {\n return first;\n }\n else if (stringify(first.explicit) === stringify({})) {\n return second;\n }\n else if (stringify(second.explicit) === stringify({})) {\n return first;\n }\n }\n // if all properties don't match, let each unit spec have its own projection\n return null;\n}\nfunction parseNonUnitProjections(model) {\n if (model.children.length === 0) {\n return undefined;\n }\n let nonUnitProjection;\n // parse all children first\n for (const child of model.children) {\n parseProjection(child);\n }\n // analyze parsed projections, attempt to merge\n const mergable = every(model.children, child => {\n const projection = child.component.projection;\n if (!projection) {\n // child layer does not use a projection\n return true;\n }\n else if (!nonUnitProjection) {\n // cached 'projection' is null, cache this one\n nonUnitProjection = projection;\n return true;\n }\n else {\n const merge = mergeIfNoConflict(nonUnitProjection, projection);\n if (merge) {\n nonUnitProjection = merge;\n }\n return !!merge;\n }\n });\n // if cached one and all other children share the same projection,\n if (nonUnitProjection && mergable) {\n // so we can elevate it to the layer level\n const name = model.projectionName(true);\n const modelProjection = new ProjectionComponent(name, nonUnitProjection.specifiedProjection, nonUnitProjection.size, duplicate(nonUnitProjection.data));\n // rename and assign all others as merged\n for (const child of model.children) {\n const projection = child.component.projection;\n if (projection) {\n if (projection.isFit) {\n modelProjection.data.push(...child.component.projection.data);\n }\n child.renameProjection(projection.get('name'), name);\n projection.merged = true;\n }\n }\n return modelProjection;\n }\n return undefined;\n}\n//# sourceMappingURL=parse.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isString } from 'vega-util';\nimport { binToString, isBinning, isSelectionExtent } from '../../bin';\nimport { binRequiresRange, isTypedFieldDef, normalizeBin, vgField } from '../../channeldef';\nimport { duplicate, hash, isEmpty, keys, replacePathInField, unique, vals, varName } from '../../util';\nimport { binFormatExpression } from '../format';\nimport { isUnitModel } from '../model';\nimport { parseSelectionBinExtent } from '../selection/parse';\nimport { DataFlowNode } from './dataflow';\nfunction rangeFormula(model, fieldDef, channel, config) {\n var _a, _b;\n if (binRequiresRange(fieldDef, channel)) {\n // read format from axis or legend, if there is no format then use config.numberFormat\n const guide = isUnitModel(model)\n ? (_b = (_a = model.axis(channel)) !== null && _a !== void 0 ? _a : model.legend(channel)) !== null && _b !== void 0 ? _b : {} : {};\n const startField = vgField(fieldDef, { expr: 'datum' });\n const endField = vgField(fieldDef, { expr: 'datum', binSuffix: 'end' });\n return {\n formulaAs: vgField(fieldDef, { binSuffix: 'range', forAs: true }),\n formula: binFormatExpression(startField, endField, guide.format, guide.formatType, config)\n };\n }\n return {};\n}\nfunction binKey(bin, field) {\n return `${binToString(bin)}_${field}`;\n}\nfunction getSignalsFromModel(model, key) {\n return {\n signal: model.getName(`${key}_bins`),\n extentSignal: model.getName(`${key}_extent`)\n };\n}\nexport function getBinSignalName(model, field, bin) {\n var _a;\n const normalizedBin = (_a = normalizeBin(bin, undefined)) !== null && _a !== void 0 ? _a : {};\n const key = binKey(normalizedBin, field);\n return model.getName(`${key}_bins`);\n}\nfunction isBinTransform(t) {\n return 'as' in t;\n}\nfunction createBinComponent(t, bin, model) {\n let as;\n let span;\n if (isBinTransform(t)) {\n as = isString(t.as) ? [t.as, `${t.as}_end`] : [t.as[0], t.as[1]];\n }\n else {\n as = [vgField(t, { forAs: true }), vgField(t, { binSuffix: 'end', forAs: true })];\n }\n const normalizedBin = Object.assign({}, normalizeBin(bin, undefined));\n const key = binKey(normalizedBin, t.field);\n const { signal, extentSignal } = getSignalsFromModel(model, key);\n if (isSelectionExtent(normalizedBin.extent)) {\n const ext = normalizedBin.extent;\n const selName = ext.selection;\n span = parseSelectionBinExtent(model.getSelectionComponent(varName(selName), selName), ext);\n delete normalizedBin.extent; // Vega-Lite selection extent map to Vega's span property.\n }\n const binComponent = Object.assign(Object.assign(Object.assign({ bin: normalizedBin, field: t.field, as: [as] }, (signal ? { signal } : {})), (extentSignal ? { extentSignal } : {})), (span ? { span } : {}));\n return { key, binComponent };\n}\nexport class BinNode extends DataFlowNode {\n constructor(parent, bins) {\n super(parent);\n this.bins = bins;\n }\n clone() {\n return new BinNode(null, duplicate(this.bins));\n }\n static makeFromEncoding(parent, model) {\n const bins = model.reduceFieldDef((binComponentIndex, fieldDef, channel) => {\n if (isTypedFieldDef(fieldDef) && isBinning(fieldDef.bin)) {\n const { key, binComponent } = createBinComponent(fieldDef, fieldDef.bin, model);\n binComponentIndex[key] = Object.assign(Object.assign(Object.assign({}, binComponent), binComponentIndex[key]), rangeFormula(model, fieldDef, channel, model.config));\n }\n return binComponentIndex;\n }, {});\n if (isEmpty(bins)) {\n return null;\n }\n return new BinNode(parent, bins);\n }\n /**\n * Creates a bin node from BinTransform.\n * The optional parameter should provide\n */\n static makeFromTransform(parent, t, model) {\n const { key, binComponent } = createBinComponent(t, t.bin, model);\n return new BinNode(parent, {\n [key]: binComponent\n });\n }\n /**\n * Merge bin nodes. This method either integrates the bin config from the other node\n * or if this node already has a bin config, renames the corresponding signal in the model.\n */\n merge(other, renameSignal) {\n for (const key of keys(other.bins)) {\n if (key in this.bins) {\n renameSignal(other.bins[key].signal, this.bins[key].signal);\n // Ensure that we don't have duplicate names for signal pairs\n this.bins[key].as = unique([...this.bins[key].as, ...other.bins[key].as], hash);\n }\n else {\n this.bins[key] = other.bins[key];\n }\n }\n for (const child of other.children) {\n other.removeChild(child);\n child.parent = this;\n }\n other.remove();\n }\n producedFields() {\n return new Set(vals(this.bins)\n .map(c => c.as)\n .flat(2));\n }\n dependentFields() {\n return new Set(vals(this.bins).map(c => c.field));\n }\n hash() {\n return `Bin ${hash(this.bins)}`;\n }\n assemble() {\n return vals(this.bins).flatMap(bin => {\n const transform = [];\n const [binAs, ...remainingAs] = bin.as;\n const _a = bin.bin, { extent } = _a, params = __rest(_a, [\"extent\"]);\n const binTrans = Object.assign(Object.assign(Object.assign({ type: 'bin', field: replacePathInField(bin.field), as: binAs, signal: bin.signal }, (!isSelectionExtent(extent) ? { extent } : { extent: null })), (bin.span ? { span: { signal: `span(${bin.span})` } } : {})), params);\n if (!extent && bin.extentSignal) {\n transform.push({\n type: 'extent',\n field: replacePathInField(bin.field),\n signal: bin.extentSignal\n });\n binTrans.extent = { signal: bin.extentSignal };\n }\n transform.push(binTrans);\n for (const as of remainingAs) {\n for (let i = 0; i < 2; i++) {\n transform.push({\n type: 'formula',\n expr: vgField({ field: binAs[i] }, { expr: 'datum' }),\n as: as[i]\n });\n }\n }\n if (bin.formula) {\n transform.push({\n type: 'formula',\n expr: bin.formula,\n as: bin.formulaAs\n });\n }\n return transform;\n });\n }\n}\n//# sourceMappingURL=bin.js.map","import { isArgmaxDef, isArgminDef } from '../../aggregate';\nimport { getPositionChannelFromLatLong, getSecondaryRangeChannel, isGeoPositionChannel, isScaleChannel } from '../../channel';\nimport { binRequiresRange, hasBand, isTypedFieldDef, vgField } from '../../channeldef';\nimport * as log from '../../log';\nimport { duplicate, hash, keys, replacePathInField, setEqual } from '../../util';\nimport { isUnitModel } from '../model';\nimport { DataFlowNode } from './dataflow';\nfunction addDimension(dims, channel, fieldDef, model) {\n const channelDef2 = isUnitModel(model) ? model.encoding[getSecondaryRangeChannel(channel)] : undefined;\n if (isTypedFieldDef(fieldDef) &&\n isUnitModel(model) &&\n hasBand(channel, fieldDef, channelDef2, model.stack, model.markDef, model.config)) {\n dims.add(vgField(fieldDef, {}));\n dims.add(vgField(fieldDef, { suffix: 'end' }));\n if (fieldDef.bin && binRequiresRange(fieldDef, channel)) {\n dims.add(vgField(fieldDef, { binSuffix: 'range' }));\n }\n }\n else if (isGeoPositionChannel(channel)) {\n const posChannel = getPositionChannelFromLatLong(channel);\n dims.add(model.getName(posChannel));\n }\n else {\n dims.add(vgField(fieldDef));\n }\n return dims;\n}\nfunction mergeMeasures(parentMeasures, childMeasures) {\n var _a;\n for (const field of keys(childMeasures)) {\n // when we merge a measure, we either have to add an aggregation operator or even a new field\n const ops = childMeasures[field];\n for (const op of keys(ops)) {\n if (field in parentMeasures) {\n // add operator to existing measure field\n parentMeasures[field][op] = new Set([...((_a = parentMeasures[field][op]) !== null && _a !== void 0 ? _a : []), ...ops[op]]);\n }\n else {\n parentMeasures[field] = { [op]: ops[op] };\n }\n }\n }\n}\nexport class AggregateNode extends DataFlowNode {\n /**\n * @param dimensions string set for dimensions\n * @param measures dictionary mapping field name => dict of aggregation functions and names to use\n */\n constructor(parent, dimensions, measures) {\n super(parent);\n this.dimensions = dimensions;\n this.measures = measures;\n }\n clone() {\n return new AggregateNode(null, new Set(this.dimensions), duplicate(this.measures));\n }\n get groupBy() {\n return this.dimensions;\n }\n static makeFromEncoding(parent, model) {\n let isAggregate = false;\n model.forEachFieldDef(fd => {\n if (fd.aggregate) {\n isAggregate = true;\n }\n });\n const meas = {};\n const dims = new Set();\n if (!isAggregate) {\n // no need to create this node if the model has no aggregation\n return null;\n }\n model.forEachFieldDef((fieldDef, channel) => {\n var _a, _b, _c, _d;\n const { aggregate, field } = fieldDef;\n if (aggregate) {\n if (aggregate === 'count') {\n meas['*'] = (_a = meas['*']) !== null && _a !== void 0 ? _a : {};\n meas['*']['count'] = new Set([vgField(fieldDef, { forAs: true })]);\n }\n else {\n if (isArgminDef(aggregate) || isArgmaxDef(aggregate)) {\n const op = isArgminDef(aggregate) ? 'argmin' : 'argmax';\n const argField = aggregate[op];\n meas[argField] = (_b = meas[argField]) !== null && _b !== void 0 ? _b : {};\n meas[argField][op] = new Set([vgField({ op, field: argField }, { forAs: true })]);\n }\n else {\n meas[field] = (_c = meas[field]) !== null && _c !== void 0 ? _c : {};\n meas[field][aggregate] = new Set([vgField(fieldDef, { forAs: true })]);\n }\n // For scale channel with domain === 'unaggregated', add min/max so we can use their union as unaggregated domain\n if (isScaleChannel(channel) && model.scaleDomain(channel) === 'unaggregated') {\n meas[field] = (_d = meas[field]) !== null && _d !== void 0 ? _d : {};\n meas[field]['min'] = new Set([vgField({ field, aggregate: 'min' }, { forAs: true })]);\n meas[field]['max'] = new Set([vgField({ field, aggregate: 'max' }, { forAs: true })]);\n }\n }\n }\n else {\n addDimension(dims, channel, fieldDef, model);\n }\n });\n if (dims.size + keys(meas).length === 0) {\n return null;\n }\n return new AggregateNode(parent, dims, meas);\n }\n static makeFromTransform(parent, t) {\n var _a, _b, _c;\n const dims = new Set();\n const meas = {};\n for (const s of t.aggregate) {\n const { op, field, as } = s;\n if (op) {\n if (op === 'count') {\n meas['*'] = (_a = meas['*']) !== null && _a !== void 0 ? _a : {};\n meas['*']['count'] = new Set([as ? as : vgField(s, { forAs: true })]);\n }\n else {\n meas[field] = (_b = meas[field]) !== null && _b !== void 0 ? _b : {};\n meas[field][op] = new Set([as ? as : vgField(s, { forAs: true })]);\n }\n }\n }\n for (const s of (_c = t.groupby) !== null && _c !== void 0 ? _c : []) {\n dims.add(s);\n }\n if (dims.size + keys(meas).length === 0) {\n return null;\n }\n return new AggregateNode(parent, dims, meas);\n }\n merge(other) {\n if (setEqual(this.dimensions, other.dimensions)) {\n mergeMeasures(this.measures, other.measures);\n return true;\n }\n else {\n log.debug('different dimensions, cannot merge');\n return false;\n }\n }\n addDimensions(fields) {\n fields.forEach(this.dimensions.add, this.dimensions);\n }\n dependentFields() {\n return new Set([...this.dimensions, ...keys(this.measures)]);\n }\n producedFields() {\n const out = new Set();\n for (const field of keys(this.measures)) {\n for (const op of keys(this.measures[field])) {\n const m = this.measures[field][op];\n if (m.size === 0) {\n out.add(`${op}_${field}`);\n }\n else {\n m.forEach(out.add, out);\n }\n }\n }\n return out;\n }\n hash() {\n return `Aggregate ${hash({ dimensions: this.dimensions, measures: this.measures })}`;\n }\n assemble() {\n const ops = [];\n const fields = [];\n const as = [];\n for (const field of keys(this.measures)) {\n for (const op of keys(this.measures[field])) {\n for (const alias of this.measures[field][op]) {\n as.push(alias);\n ops.push(op);\n fields.push(field === '*' ? null : replacePathInField(field));\n }\n }\n }\n const result = {\n type: 'aggregate',\n groupby: [...this.dimensions].map(replacePathInField),\n ops,\n fields,\n as\n };\n return result;\n }\n}\n//# sourceMappingURL=aggregate.js.map","import { isArray } from 'vega-util';\nimport { isBinning } from '../../bin';\nimport { COLUMN, FACET_CHANNELS, POSITION_SCALE_CHANNELS, ROW } from '../../channel';\nimport { vgField } from '../../channeldef';\nimport * as log from '../../log';\nimport { hasDiscreteDomain } from '../../scale';\nimport { DEFAULT_SORT_OP, isSortField } from '../../sort';\nimport { hash } from '../../util';\nimport { isVgRangeStep } from '../../vega.schema';\nimport { HEADER_CHANNELS, HEADER_TYPES } from '../header/component';\nimport { assembleDomain, getFieldFromDomain } from '../scale/domain';\nimport { sortArrayIndexField } from './calculate';\nimport { DataFlowNode } from './dataflow';\n/**\n * A node that helps us track what fields we are faceting by.\n */\nexport class FacetNode extends DataFlowNode {\n /**\n * @param model The facet model.\n * @param name The name that this facet source will have.\n * @param data The source data for this facet data.\n */\n constructor(parent, model, name, data) {\n super(parent);\n this.model = model;\n this.name = name;\n this.data = data;\n for (const channel of FACET_CHANNELS) {\n const fieldDef = model.facet[channel];\n if (fieldDef) {\n const { bin, sort } = fieldDef;\n this[channel] = Object.assign({ name: model.getName(`${channel}_domain`), fields: [vgField(fieldDef), ...(isBinning(bin) ? [vgField(fieldDef, { binSuffix: 'end' })] : [])] }, (isSortField(sort)\n ? { sortField: sort }\n : isArray(sort)\n ? { sortIndexField: sortArrayIndexField(fieldDef, channel) }\n : {}));\n }\n }\n this.childModel = model.child;\n }\n hash() {\n let out = `Facet`;\n for (const channel of FACET_CHANNELS) {\n if (this[channel]) {\n out += ` ${channel.charAt(0)}:${hash(this[channel])}`;\n }\n }\n return out;\n }\n get fields() {\n var _a;\n const f = [];\n for (const channel of FACET_CHANNELS) {\n if ((_a = this[channel]) === null || _a === void 0 ? void 0 : _a.fields) {\n f.push(...this[channel].fields);\n }\n }\n return f;\n }\n dependentFields() {\n const depFields = new Set(this.fields);\n for (const channel of FACET_CHANNELS) {\n if (this[channel]) {\n if (this[channel].sortField) {\n depFields.add(this[channel].sortField.field);\n }\n if (this[channel].sortIndexField) {\n depFields.add(this[channel].sortIndexField);\n }\n }\n }\n return depFields;\n }\n producedFields() {\n return new Set(); // facet does not produce any new fields\n }\n /**\n * The name to reference this source is its name.\n */\n getSource() {\n return this.name;\n }\n getChildIndependentFieldsWithStep() {\n const childIndependentFieldsWithStep = {};\n for (const channel of POSITION_SCALE_CHANNELS) {\n const childScaleComponent = this.childModel.component.scales[channel];\n if (childScaleComponent && !childScaleComponent.merged) {\n // independent scale\n const type = childScaleComponent.get('type');\n const range = childScaleComponent.get('range');\n if (hasDiscreteDomain(type) && isVgRangeStep(range)) {\n const domain = assembleDomain(this.childModel, channel);\n const field = getFieldFromDomain(domain);\n if (field) {\n childIndependentFieldsWithStep[channel] = field;\n }\n else {\n log.warn(log.message.unknownField(channel));\n }\n }\n }\n }\n return childIndependentFieldsWithStep;\n }\n assembleRowColumnHeaderData(channel, crossedDataName, childIndependentFieldsWithStep) {\n const childChannel = { row: 'y', column: 'x' }[channel];\n const fields = [];\n const ops = [];\n const as = [];\n if (childIndependentFieldsWithStep && childIndependentFieldsWithStep[childChannel]) {\n if (crossedDataName) {\n // If there is a crossed data, calculate max\n fields.push(`distinct_${childIndependentFieldsWithStep[childChannel]}`);\n ops.push('max');\n }\n else {\n // If there is no crossed data, just calculate distinct\n fields.push(childIndependentFieldsWithStep[childChannel]);\n ops.push('distinct');\n }\n // Although it is technically a max, just name it distinct so it's easier to refer to it\n as.push(`distinct_${childIndependentFieldsWithStep[childChannel]}`);\n }\n const { sortField, sortIndexField } = this[channel];\n if (sortField) {\n const { op = DEFAULT_SORT_OP, field } = sortField;\n fields.push(field);\n ops.push(op);\n as.push(vgField(sortField, { forAs: true }));\n }\n else if (sortIndexField) {\n fields.push(sortIndexField);\n ops.push('max');\n as.push(sortIndexField);\n }\n return {\n name: this[channel].name,\n // Use data from the crossed one if it exist\n source: crossedDataName !== null && crossedDataName !== void 0 ? crossedDataName : this.data,\n transform: [\n Object.assign({ type: 'aggregate', groupby: this[channel].fields }, (fields.length\n ? {\n fields,\n ops,\n as\n }\n : {}))\n ]\n };\n }\n assembleFacetHeaderData(childIndependentFieldsWithStep) {\n var _a, _b;\n const { columns } = this.model.layout;\n const { layoutHeaders } = this.model.component;\n const data = [];\n const hasSharedAxis = {};\n for (const headerChannel of HEADER_CHANNELS) {\n for (const headerType of HEADER_TYPES) {\n const headers = (_a = (layoutHeaders[headerChannel] && layoutHeaders[headerChannel][headerType])) !== null && _a !== void 0 ? _a : [];\n for (const header of headers) {\n if (((_b = header.axes) === null || _b === void 0 ? void 0 : _b.length) > 0) {\n hasSharedAxis[headerChannel] = true;\n break;\n }\n }\n }\n if (hasSharedAxis[headerChannel]) {\n const cardinality = `length(data(\"${this.facet.name}\"))`;\n const stop = headerChannel === 'row'\n ? columns\n ? { signal: `ceil(${cardinality} / ${columns})` }\n : 1\n : columns\n ? { signal: `min(${cardinality}, ${columns})` }\n : { signal: cardinality };\n data.push({\n name: `${this.facet.name}_${headerChannel}`,\n transform: [\n {\n type: 'sequence',\n start: 0,\n stop\n }\n ]\n });\n }\n }\n const { row, column } = hasSharedAxis;\n if (row || column) {\n data.unshift(this.assembleRowColumnHeaderData('facet', null, childIndependentFieldsWithStep));\n }\n return data;\n }\n assemble() {\n var _a, _b;\n const data = [];\n let crossedDataName = null;\n const childIndependentFieldsWithStep = this.getChildIndependentFieldsWithStep();\n const { column, row, facet } = this;\n if (column && row && (childIndependentFieldsWithStep.x || childIndependentFieldsWithStep.y)) {\n // Need to create a cross dataset to correctly calculate cardinality\n crossedDataName = `cross_${this.column.name}_${this.row.name}`;\n const fields = [].concat((_a = childIndependentFieldsWithStep.x) !== null && _a !== void 0 ? _a : [], (_b = childIndependentFieldsWithStep.y) !== null && _b !== void 0 ? _b : []);\n const ops = fields.map(() => 'distinct');\n data.push({\n name: crossedDataName,\n source: this.data,\n transform: [\n {\n type: 'aggregate',\n groupby: this.fields,\n fields,\n ops\n }\n ]\n });\n }\n for (const channel of [COLUMN, ROW]) {\n if (this[channel]) {\n data.push(this.assembleRowColumnHeaderData(channel, crossedDataName, childIndependentFieldsWithStep));\n }\n }\n if (facet) {\n const facetData = this.assembleFacetHeaderData(childIndependentFieldsWithStep);\n if (facetData) {\n data.push(...facetData);\n }\n }\n return data;\n }\n}\n//# sourceMappingURL=facet.js.map","import { isNumber, isString } from 'vega-util';\nimport { isMinMaxOp } from '../../aggregate';\nimport { getMainRangeChannel } from '../../channel';\nimport { isFieldDef, isFieldOrDatumDefForTimeFormat, isScaleFieldDef, isTypedFieldDef } from '../../channeldef';\nimport { isGenerator } from '../../data';\nimport { isDateTime } from '../../datetime';\nimport * as log from '../../log';\nimport { forEachLeaf } from '../../logical';\nimport { isPathMark } from '../../mark';\nimport { isFieldEqualPredicate, isFieldGTEPredicate, isFieldGTPredicate, isFieldLTEPredicate, isFieldLTPredicate, isFieldOneOfPredicate, isFieldPredicate, isFieldRangePredicate } from '../../predicate';\nimport { isSortField } from '../../sort';\nimport { accessPathDepth, accessPathWithDatum, duplicate, hash, keys, removePathFromField } from '../../util';\nimport { signalRefOrValue } from '../common';\nimport { isFacetModel, isUnitModel } from '../model';\nimport { Split } from '../split';\nimport { DataFlowNode } from './dataflow';\n/**\n * Remove quotes from a string.\n */\nfunction unquote(pattern) {\n if ((pattern[0] === \"'\" && pattern[pattern.length - 1] === \"'\") ||\n (pattern[0] === '\"' && pattern[pattern.length - 1] === '\"')) {\n return pattern.slice(1, -1);\n }\n return pattern;\n}\n/**\n * @param field The field.\n * @param parse What to parse the field as.\n */\nfunction parseExpression(field, parse) {\n const f = accessPathWithDatum(field);\n if (parse === 'number') {\n return `toNumber(${f})`;\n }\n else if (parse === 'boolean') {\n return `toBoolean(${f})`;\n }\n else if (parse === 'string') {\n return `toString(${f})`;\n }\n else if (parse === 'date') {\n return `toDate(${f})`;\n }\n else if (parse === 'flatten') {\n return f;\n }\n else if (parse.indexOf('date:') === 0) {\n const specifier = unquote(parse.slice(5, parse.length));\n return `timeParse(${f},'${specifier}')`;\n }\n else if (parse.indexOf('utc:') === 0) {\n const specifier = unquote(parse.slice(4, parse.length));\n return `utcParse(${f},'${specifier}')`;\n }\n else {\n log.warn(log.message.unrecognizedParse(parse));\n return null;\n }\n}\nexport function getImplicitFromFilterTransform(transform) {\n const implicit = {};\n forEachLeaf(transform.filter, filter => {\n var _a;\n if (isFieldPredicate(filter)) {\n // Automatically add a parse node for filters with filter objects\n let val = null;\n // For EqualFilter, just use the equal property.\n // For RangeFilter and OneOfFilter, all array members should have\n // the same type, so we only use the first one.\n if (isFieldEqualPredicate(filter)) {\n val = signalRefOrValue(filter.equal);\n }\n else if (isFieldLTEPredicate(filter)) {\n val = signalRefOrValue(filter.lte);\n }\n else if (isFieldLTPredicate(filter)) {\n val = signalRefOrValue(filter.lt);\n }\n else if (isFieldGTPredicate(filter)) {\n val = signalRefOrValue(filter.gt);\n }\n else if (isFieldGTEPredicate(filter)) {\n val = signalRefOrValue(filter.gte);\n }\n else if (isFieldRangePredicate(filter)) {\n val = filter.range[0];\n }\n else if (isFieldOneOfPredicate(filter)) {\n val = ((_a = filter.oneOf) !== null && _a !== void 0 ? _a : filter['in'])[0];\n } // else -- for filter expression, we can't infer anything\n if (val) {\n if (isDateTime(val)) {\n implicit[filter.field] = 'date';\n }\n else if (isNumber(val)) {\n implicit[filter.field] = 'number';\n }\n else if (isString(val)) {\n implicit[filter.field] = 'string';\n }\n }\n if (filter.timeUnit) {\n implicit[filter.field] = 'date';\n }\n }\n });\n return implicit;\n}\n/**\n * Creates a parse node for implicit parsing from a model and updates ancestorParse.\n */\nexport function getImplicitFromEncoding(model) {\n const implicit = {};\n function add(fieldDef) {\n if (isFieldOrDatumDefForTimeFormat(fieldDef)) {\n implicit[fieldDef.field] = 'date';\n }\n else if (fieldDef.type === 'quantitative' &&\n isMinMaxOp(fieldDef.aggregate) // we need to parse numbers to support correct min and max\n ) {\n implicit[fieldDef.field] = 'number';\n }\n else if (accessPathDepth(fieldDef.field) > 1) {\n // For non-date/non-number (strings and booleans), derive a flattened field for a referenced nested field.\n // (Parsing numbers / dates already flattens numeric and temporal fields.)\n if (!(fieldDef.field in implicit)) {\n implicit[fieldDef.field] = 'flatten';\n }\n }\n else if (isScaleFieldDef(fieldDef) && isSortField(fieldDef.sort) && accessPathDepth(fieldDef.sort.field) > 1) {\n // Flatten fields that we sort by but that are not otherwise flattened.\n if (!(fieldDef.sort.field in implicit)) {\n implicit[fieldDef.sort.field] = 'flatten';\n }\n }\n }\n if (isUnitModel(model) || isFacetModel(model)) {\n // Parse encoded fields\n model.forEachFieldDef((fieldDef, channel) => {\n if (isTypedFieldDef(fieldDef)) {\n add(fieldDef);\n }\n else {\n const mainChannel = getMainRangeChannel(channel);\n const mainFieldDef = model.fieldDef(mainChannel);\n add(Object.assign(Object.assign({}, fieldDef), { type: mainFieldDef.type }));\n }\n });\n }\n // Parse quantitative dimension fields of path marks as numbers so that we sort them correctly.\n if (isUnitModel(model)) {\n const { mark, markDef, encoding } = model;\n if (isPathMark(mark) &&\n // No need to sort by dimension if we have a connected scatterplot (order channel is present)\n !model.encoding.order) {\n const dimensionChannel = markDef.orient === 'horizontal' ? 'y' : 'x';\n const dimensionChannelDef = encoding[dimensionChannel];\n if (isFieldDef(dimensionChannelDef) &&\n dimensionChannelDef.type === 'quantitative' &&\n !(dimensionChannelDef.field in implicit)) {\n implicit[dimensionChannelDef.field] = 'number';\n }\n }\n }\n return implicit;\n}\n/**\n * Creates a parse node for implicit parsing from a model and updates ancestorParse.\n */\nexport function getImplicitFromSelection(model) {\n const implicit = {};\n if (isUnitModel(model) && model.component.selection) {\n for (const name of keys(model.component.selection)) {\n const selCmpt = model.component.selection[name];\n for (const proj of selCmpt.project.items) {\n if (!proj.channel && accessPathDepth(proj.field) > 1) {\n implicit[proj.field] = 'flatten';\n }\n }\n }\n }\n return implicit;\n}\nexport class ParseNode extends DataFlowNode {\n constructor(parent, parse) {\n super(parent);\n this._parse = parse;\n }\n clone() {\n return new ParseNode(null, duplicate(this._parse));\n }\n hash() {\n return `Parse ${hash(this._parse)}`;\n }\n /**\n * Creates a parse node from a data.format.parse and updates ancestorParse.\n */\n static makeExplicit(parent, model, ancestorParse) {\n // Custom parse\n let explicit = {};\n const data = model.data;\n if (!isGenerator(data) && data && data.format && data.format.parse) {\n explicit = data.format.parse;\n }\n return this.makeWithAncestors(parent, explicit, {}, ancestorParse);\n }\n /**\n * Creates a parse node from \"explicit\" parse and \"implicit\" parse and updates ancestorParse.\n */\n static makeWithAncestors(parent, explicit, implicit, ancestorParse) {\n // We should not parse what has already been parsed in a parent (explicitly or implicitly) or what has been derived (maked as \"derived\"). We also don't need to flatten a field that has already been parsed.\n for (const field of keys(implicit)) {\n const parsedAs = ancestorParse.getWithExplicit(field);\n if (parsedAs.value !== undefined) {\n // We always ignore derived fields even if they are implicitly defined because we expect users to create the right types.\n if (parsedAs.explicit ||\n parsedAs.value === implicit[field] ||\n parsedAs.value === 'derived' ||\n implicit[field] === 'flatten') {\n delete implicit[field];\n }\n else {\n log.warn(log.message.differentParse(field, implicit[field], parsedAs.value));\n }\n }\n }\n for (const field of keys(explicit)) {\n const parsedAs = ancestorParse.get(field);\n if (parsedAs !== undefined) {\n // Don't parse a field again if it has been parsed with the same type already.\n if (parsedAs === explicit[field]) {\n delete explicit[field];\n }\n else {\n log.warn(log.message.differentParse(field, explicit[field], parsedAs));\n }\n }\n }\n const parse = new Split(explicit, implicit);\n // add the format parse from this model so that children don't parse the same field again\n ancestorParse.copyAll(parse);\n // copy only non-null parses\n const p = {};\n for (const key of keys(parse.combine())) {\n const val = parse.get(key);\n if (val !== null) {\n p[key] = val;\n }\n }\n if (keys(p).length === 0 || ancestorParse.parseNothing) {\n return null;\n }\n return new ParseNode(parent, p);\n }\n get parse() {\n return this._parse;\n }\n merge(other) {\n this._parse = Object.assign(Object.assign({}, this._parse), other.parse);\n other.remove();\n }\n /**\n * Assemble an object for Vega's format.parse property.\n */\n assembleFormatParse() {\n const formatParse = {};\n for (const field of keys(this._parse)) {\n const p = this._parse[field];\n if (accessPathDepth(field) === 1) {\n formatParse[field] = p;\n }\n }\n return formatParse;\n }\n // format parse depends and produces all fields in its parse\n producedFields() {\n return new Set(keys(this._parse));\n }\n dependentFields() {\n return new Set(keys(this._parse));\n }\n assembleTransforms(onlyNested = false) {\n return keys(this._parse)\n .filter(field => (onlyNested ? accessPathDepth(field) > 1 : true))\n .map(field => {\n const expr = parseExpression(field, this._parse[field]);\n if (!expr) {\n return null;\n }\n const formula = {\n type: 'formula',\n expr,\n as: removePathFromField(field) // Vega output is always flattened\n };\n return formula;\n })\n .filter(t => t !== null);\n }\n}\n//# sourceMappingURL=formatparse.js.map","import { SELECTION_ID } from '../../selection';\nimport { DataFlowNode } from './dataflow';\nexport class IdentifierNode extends DataFlowNode {\n clone() {\n return new IdentifierNode(null);\n }\n constructor(parent) {\n super(parent);\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return new Set([SELECTION_ID]);\n }\n hash() {\n return 'Identifier';\n }\n assemble() {\n return { type: 'identifier', as: SELECTION_ID };\n }\n}\n//# sourceMappingURL=identifier.js.map","import { hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class GraticuleNode extends DataFlowNode {\n constructor(parent, params) {\n super(parent);\n this.params = params;\n }\n clone() {\n return new GraticuleNode(null, this.params);\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return undefined; // there should never be a node before graticule\n }\n hash() {\n return `Graticule ${hash(this.params)}`;\n }\n assemble() {\n return Object.assign({ type: 'graticule' }, (this.params === true ? {} : this.params));\n }\n}\n//# sourceMappingURL=graticule.js.map","import { hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class SequenceNode extends DataFlowNode {\n constructor(parent, params) {\n super(parent);\n this.params = params;\n }\n clone() {\n return new SequenceNode(null, this.params);\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n var _a;\n return new Set([(_a = this.params.as) !== null && _a !== void 0 ? _a : 'data']);\n }\n hash() {\n return `Hash ${hash(this.params)}`;\n }\n assemble() {\n return Object.assign({ type: 'sequence' }, this.params);\n }\n}\n//# sourceMappingURL=sequence.js.map","import { isGenerator, isInlineData, isNamedData, isSphereGenerator, isUrlData } from '../../data';\nimport { contains, isEmpty, omit } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class SourceNode extends DataFlowNode {\n constructor(data) {\n super(null); // source cannot have parent\n data = data !== null && data !== void 0 ? data : { name: 'source' };\n let format;\n if (!isGenerator(data)) {\n format = data.format ? Object.assign({}, omit(data.format, ['parse'])) : {};\n }\n if (isInlineData(data)) {\n this._data = { values: data.values };\n }\n else if (isUrlData(data)) {\n this._data = { url: data.url };\n if (!format.type) {\n // Extract extension from URL using snippet from\n // http://stackoverflow.com/questions/680929/how-to-extract-extension-from-filename-string-in-javascript\n let defaultExtension = /(?:\\.([^.]+))?$/.exec(data.url)[1];\n if (!contains(['json', 'csv', 'tsv', 'dsv', 'topojson'], defaultExtension)) {\n defaultExtension = 'json';\n }\n // defaultExtension has type string but we ensure that it is DataFormatType above\n format.type = defaultExtension;\n }\n }\n else if (isSphereGenerator(data)) {\n // hardwire GeoJSON sphere data into output specification\n this._data = { values: [{ type: 'Sphere' }] };\n }\n else if (isNamedData(data) || isGenerator(data)) {\n this._data = {};\n }\n // set flag to check if generator\n this._generator = isGenerator(data);\n // any dataset can be named\n if (data.name) {\n this._name = data.name;\n }\n if (format && !isEmpty(format)) {\n this._data.format = format;\n }\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return undefined; // we don't know what this source produces\n }\n get data() {\n return this._data;\n }\n hasName() {\n return !!this._name;\n }\n get isGenerator() {\n return this._generator;\n }\n get dataName() {\n return this._name;\n }\n set dataName(name) {\n this._name = name;\n }\n set parent(parent) {\n throw new Error('Source nodes have to be roots.');\n }\n remove() {\n throw new Error('Source nodes are roots and cannot be removed.');\n }\n hash() {\n throw new Error('Cannot hash sources');\n }\n assemble() {\n return Object.assign(Object.assign({ name: this._name }, this._data), { transform: [] });\n }\n}\n//# sourceMappingURL=source.js.map","var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n privateMap.set(receiver, value);\n return value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n return privateMap.get(receiver);\n};\nvar _modified;\nimport { GraticuleNode } from './graticule';\nimport { SequenceNode } from './sequence';\nimport { SourceNode } from './source';\n/**\n * Whether this dataflow node is the source of the dataflow that produces data i.e. a source or a generator.\n */\nexport function isDataSourceNode(node) {\n return node instanceof SourceNode || node instanceof GraticuleNode || node instanceof SequenceNode;\n}\n/**\n * Abstract base class for Dataflow optimizers.\n * Contains only mutation handling logic. Subclasses need to implement iteration logic.\n */\nexport class Optimizer {\n constructor() {\n _modified.set(this, void 0);\n __classPrivateFieldSet(this, _modified, false);\n }\n // Once true, #modified is never set to false\n setModified() {\n __classPrivateFieldSet(this, _modified, true);\n }\n get modifiedFlag() {\n return __classPrivateFieldGet(this, _modified);\n }\n}\n_modified = new WeakMap();\n/**\n * Starts from a node and runs the optimization function (the \"run\" method) upwards to the root,\n * depending on the continue and modified flag values returned by the optimization function.\n */\nexport class BottomUpOptimizer extends Optimizer {\n /**\n * Compute a map of node depths that we can use to determine a topological sort order.\n */\n getNodeDepths(node, depth, depths) {\n depths.set(node, depth);\n for (const child of node.children) {\n this.getNodeDepths(child, depth + 1, depths);\n }\n return depths;\n }\n /**\n * Run the optimizer on all nodes starting from the leaves.\n */\n optimize(node) {\n const depths = this.getNodeDepths(node, 0, new Map());\n const topologicalSort = [...depths.entries()].sort((a, b) => b[1] - a[1]);\n for (const tuple of topologicalSort) {\n this.run(tuple[0]);\n }\n return this.modifiedFlag;\n }\n}\n/**\n * The optimizer function (the \"run\" method), is invoked on the given node and then continues recursively.\n */\nexport class TopDownOptimizer extends Optimizer {\n /**\n * Run the optimizer depth first on all nodes starting from the roots.\n */\n optimize(node) {\n this.run(node);\n for (const child of node.children) {\n this.optimize(child);\n }\n return this.modifiedFlag;\n }\n}\n//# sourceMappingURL=optimizer.js.map","import { fieldIntersection, hash, hasIntersection, isEmpty, keys, some } from '../../util';\nimport { requiresSelectionId } from '../selection';\nimport { AggregateNode } from './aggregate';\nimport { BinNode } from './bin';\nimport { OutputNode } from './dataflow';\nimport { FacetNode } from './facet';\nimport { FilterNode } from './filter';\nimport { ParseNode } from './formatparse';\nimport { IdentifierNode } from './identifier';\nimport { BottomUpOptimizer, isDataSourceNode, Optimizer, TopDownOptimizer } from './optimizer';\nimport { SourceNode } from './source';\nimport { TimeUnitNode } from './timeunit';\n/**\n * Merge identical nodes at forks by comparing hashes.\n *\n * Does not need to iterate from leaves so we implement this with recursion as it's a bit simpler.\n */\nexport class MergeIdenticalNodes extends TopDownOptimizer {\n mergeNodes(parent, nodes) {\n const mergedNode = nodes.shift();\n for (const node of nodes) {\n parent.removeChild(node);\n node.parent = mergedNode;\n node.remove();\n }\n }\n run(node) {\n const hashes = node.children.map(x => x.hash());\n const buckets = {};\n for (let i = 0; i < hashes.length; i++) {\n if (buckets[hashes[i]] === undefined) {\n buckets[hashes[i]] = [node.children[i]];\n }\n else {\n buckets[hashes[i]].push(node.children[i]);\n }\n }\n for (const k of keys(buckets)) {\n if (buckets[k].length > 1) {\n this.setModified();\n this.mergeNodes(node, buckets[k]);\n }\n }\n }\n}\n/**\n * Optimizer that removes identifier nodes that are not needed for selections.\n */\nexport class RemoveUnnecessaryIdentifierNodes extends TopDownOptimizer {\n constructor(model) {\n super();\n this.requiresSelectionId = model && requiresSelectionId(model);\n }\n run(node) {\n if (node instanceof IdentifierNode) {\n // Only preserve IdentifierNodes if we have default discrete selections\n // in our model tree, and if the nodes come after tuple producing nodes.\n if (!(this.requiresSelectionId &&\n (isDataSourceNode(node.parent) || node.parent instanceof AggregateNode || node.parent instanceof ParseNode))) {\n this.setModified();\n node.remove();\n }\n }\n }\n}\n/**\n * Removes duplicate time unit nodes (as determined by the name of the output field) that may be generated due to\n * selections projected over time units. Only keeps the first time unit in any branch.\n *\n * This optimizer is a custom top down optimizer that keep track of produced fields in a branch.\n */\nexport class RemoveDuplicateTimeUnits extends Optimizer {\n optimize(node) {\n this.run(node, new Set());\n return this.modifiedFlag;\n }\n run(node, timeUnitFields) {\n let producedFields = new Set();\n if (node instanceof TimeUnitNode) {\n producedFields = node.producedFields();\n if (hasIntersection(producedFields, timeUnitFields)) {\n this.setModified();\n node.removeFormulas(timeUnitFields);\n if (node.producedFields.length === 0) {\n node.remove();\n }\n }\n }\n for (const child of node.children) {\n this.run(child, new Set([...timeUnitFields, ...producedFields]));\n }\n }\n}\n/**\n * Remove output nodes that are not required.\n */\nexport class RemoveUnnecessaryOutputNodes extends TopDownOptimizer {\n constructor() {\n super();\n }\n run(node) {\n if (node instanceof OutputNode && !node.isRequired()) {\n this.setModified();\n node.remove();\n }\n }\n}\n/**\n * Move parse nodes up to forks and merges them if possible.\n */\nexport class MoveParseUp extends BottomUpOptimizer {\n run(node) {\n if (isDataSourceNode(node)) {\n return;\n }\n if (node.numChildren() > 1) {\n // Don't move parse further up but continue with parent.\n return;\n }\n for (const child of node.children) {\n if (child instanceof ParseNode) {\n if (node instanceof ParseNode) {\n this.setModified();\n node.merge(child);\n }\n else {\n // Don't swap with nodes that produce something that the parse node depends on (e.g. lookup).\n if (fieldIntersection(node.producedFields(), child.dependentFields())) {\n continue;\n }\n this.setModified();\n child.swapWithParent();\n }\n }\n }\n return;\n }\n}\n/**\n * Inserts an intermediate ParseNode containing all non-conflicting parse fields and removes the empty ParseNodes.\n *\n * We assume that dependent paths that do not have a parse node can be just merged.\n */\nexport class MergeParse extends BottomUpOptimizer {\n run(node) {\n const originalChildren = [...node.children];\n const parseChildren = node.children.filter((child) => child instanceof ParseNode);\n if (node.numChildren() > 1 && parseChildren.length >= 1) {\n const commonParse = {};\n const conflictingParse = new Set();\n for (const parseNode of parseChildren) {\n const parse = parseNode.parse;\n for (const k of keys(parse)) {\n if (!(k in commonParse)) {\n commonParse[k] = parse[k];\n }\n else if (commonParse[k] !== parse[k]) {\n conflictingParse.add(k);\n }\n }\n }\n for (const field of conflictingParse) {\n delete commonParse[field];\n }\n if (!isEmpty(commonParse)) {\n this.setModified();\n const mergedParseNode = new ParseNode(node, commonParse);\n for (const childNode of originalChildren) {\n if (childNode instanceof ParseNode) {\n for (const key of keys(commonParse)) {\n delete childNode.parse[key];\n }\n }\n node.removeChild(childNode);\n childNode.parent = mergedParseNode;\n // remove empty parse nodes\n if (childNode instanceof ParseNode && keys(childNode.parse).length === 0) {\n childNode.remove();\n }\n }\n }\n }\n }\n}\n/**\n * Repeatedly remove leaf nodes that are not output or facet nodes.\n * The reason is that we don't need subtrees that don't have any output nodes.\n * Facet nodes are needed for the row or column domains.\n */\nexport class RemoveUnusedSubtrees extends BottomUpOptimizer {\n run(node) {\n if (node instanceof OutputNode || node.numChildren() > 0 || node instanceof FacetNode) {\n // no need to continue with parent because it is output node or will have children (there was a fork)\n }\n else if (node instanceof SourceNode) {\n // ignore empty unused sources as they will be removed in optimizationDataflowHelper\n }\n else {\n this.setModified();\n node.remove();\n }\n }\n}\n/**\n * Merge adjacent time unit nodes.\n */\nexport class MergeTimeUnits extends BottomUpOptimizer {\n run(node) {\n const timeUnitChildren = node.children.filter((x) => x instanceof TimeUnitNode);\n const combination = timeUnitChildren.pop();\n for (const timeUnit of timeUnitChildren) {\n this.setModified();\n combination.merge(timeUnit);\n }\n }\n}\nexport class MergeAggregates extends BottomUpOptimizer {\n run(node) {\n const aggChildren = node.children.filter((child) => child instanceof AggregateNode);\n // Object which we'll use to map the fields which an aggregate is grouped by to\n // the set of aggregates with that grouping. This is useful as only aggregates\n // with the same group by can be merged\n const groupedAggregates = {};\n // Build groupedAggregates\n for (const agg of aggChildren) {\n const groupBys = hash(agg.groupBy);\n if (!(groupBys in groupedAggregates)) {\n groupedAggregates[groupBys] = [];\n }\n groupedAggregates[groupBys].push(agg);\n }\n // Merge aggregateNodes with same key in groupedAggregates\n for (const group of keys(groupedAggregates)) {\n const mergeableAggs = groupedAggregates[group];\n if (mergeableAggs.length > 1) {\n const mergedAggs = mergeableAggs.pop();\n for (const agg of mergeableAggs) {\n if (mergedAggs.merge(agg)) {\n node.removeChild(agg);\n agg.parent = mergedAggs;\n agg.remove();\n this.setModified();\n }\n }\n }\n }\n }\n}\n/**\n * Merge bin nodes and move them up through forks. Stop at filters, parse, identifier as we want them to stay before the bin node.\n */\nexport class MergeBins extends BottomUpOptimizer {\n constructor(model) {\n super();\n this.model = model;\n }\n run(node) {\n const moveBinsUp = !(isDataSourceNode(node) ||\n node instanceof FilterNode ||\n node instanceof ParseNode ||\n node instanceof IdentifierNode);\n const promotableBins = [];\n const remainingBins = [];\n for (const child of node.children) {\n if (child instanceof BinNode) {\n if (moveBinsUp && !fieldIntersection(node.producedFields(), child.dependentFields())) {\n promotableBins.push(child);\n }\n else {\n remainingBins.push(child);\n }\n }\n }\n if (promotableBins.length > 0) {\n const promotedBin = promotableBins.pop();\n for (const bin of promotableBins) {\n promotedBin.merge(bin, this.model.renameSignal.bind(this.model));\n }\n this.setModified();\n if (node instanceof BinNode) {\n node.merge(promotedBin, this.model.renameSignal.bind(this.model));\n }\n else {\n promotedBin.swapWithParent();\n }\n }\n if (remainingBins.length > 1) {\n const remainingBin = remainingBins.pop();\n for (const bin of remainingBins) {\n remainingBin.merge(bin, this.model.renameSignal.bind(this.model));\n }\n this.setModified();\n }\n }\n}\n/**\n * This optimizer takes output nodes that are at a fork and moves them before the fork.\n *\n * The algorithm iterates over the children and tries to find the last output node in a chain of output nodes.\n * It then moves all output nodes before that main output node. All other children (and the children of the output nodes)\n * are inserted after the main output node.\n */\nexport class MergeOutputs extends BottomUpOptimizer {\n run(node) {\n const children = [...node.children];\n const hasOutputChild = some(children, child => child instanceof OutputNode);\n if (!hasOutputChild || node.numChildren() <= 1) {\n return;\n }\n const otherChildren = [];\n // The output node we will connect all other nodes to.\n // Output nodes will be added before the new node, other nodes after.\n let mainOutput;\n for (const child of children) {\n if (child instanceof OutputNode) {\n let lastOutput = child;\n while (lastOutput.numChildren() === 1) {\n const [theChild] = lastOutput.children;\n if (theChild instanceof OutputNode) {\n lastOutput = theChild;\n }\n else {\n break;\n }\n }\n otherChildren.push(...lastOutput.children);\n if (mainOutput) {\n // Move the output nodes before the mainOutput. We do this by setting\n // the parent of the first not to the parent of the main output and\n // the main output's parent to the last output.\n // note: the child is the first output\n node.removeChild(child);\n child.parent = mainOutput.parent;\n mainOutput.parent.removeChild(mainOutput);\n mainOutput.parent = lastOutput;\n this.setModified();\n }\n else {\n mainOutput = lastOutput;\n }\n }\n else {\n otherChildren.push(child);\n }\n }\n if (otherChildren.length) {\n this.setModified();\n for (const child of otherChildren) {\n child.parent.removeChild(child);\n child.parent = mainOutput;\n }\n }\n }\n}\n//# sourceMappingURL=optimizers.js.map","import { vgField } from '../../channeldef';\nimport { duplicate, hash } from '../../util';\nimport { unique } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for the join aggregate transform nodes.\n */\nexport class JoinAggregateTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new JoinAggregateTransformNode(null, duplicate(this.transform));\n }\n addDimensions(fields) {\n this.transform.groupby = unique(this.transform.groupby.concat(fields), d => d);\n }\n dependentFields() {\n const out = new Set();\n if (this.transform.groupby) {\n this.transform.groupby.forEach(out.add, out);\n }\n this.transform.joinaggregate\n .map(w => w.field)\n .filter(f => f !== undefined)\n .forEach(out.add, out);\n return out;\n }\n producedFields() {\n return new Set(this.transform.joinaggregate.map(this.getDefaultName));\n }\n getDefaultName(joinAggregateFieldDef) {\n var _a;\n return (_a = joinAggregateFieldDef.as) !== null && _a !== void 0 ? _a : vgField(joinAggregateFieldDef);\n }\n hash() {\n return `JoinAggregateTransform ${hash(this.transform)}`;\n }\n assemble() {\n const fields = [];\n const ops = [];\n const as = [];\n for (const joinaggregate of this.transform.joinaggregate) {\n ops.push(joinaggregate.op);\n as.push(this.getDefaultName(joinaggregate));\n fields.push(joinaggregate.field === undefined ? null : joinaggregate.field);\n }\n const groupby = this.transform.groupby;\n return Object.assign({ type: 'joinaggregate', as,\n ops,\n fields }, (groupby !== undefined ? { groupby } : {}));\n }\n}\n//# sourceMappingURL=joinaggregate.js.map","import { isArray, isString } from 'vega-util';\nimport { getFieldDef, isFieldDef, vgField } from '../../channeldef';\nimport { duplicate, getFirstDefined, hash } from '../../util';\nimport { sortParams } from '../common';\nimport { DataFlowNode } from './dataflow';\nfunction getStackByFields(model) {\n return model.stack.stackBy.reduce((fields, by) => {\n const fieldDef = by.fieldDef;\n const _field = vgField(fieldDef);\n if (_field) {\n fields.push(_field);\n }\n return fields;\n }, []);\n}\nfunction isValidAsArray(as) {\n return isArray(as) && as.every(s => isString(s)) && as.length > 1;\n}\nexport class StackNode extends DataFlowNode {\n constructor(parent, stack) {\n super(parent);\n this._stack = stack;\n }\n clone() {\n return new StackNode(null, duplicate(this._stack));\n }\n static makeFromTransform(parent, stackTransform) {\n const { stack, groupby, as, offset = 'zero' } = stackTransform;\n const sortFields = [];\n const sortOrder = [];\n if (stackTransform.sort !== undefined) {\n for (const sortField of stackTransform.sort) {\n sortFields.push(sortField.field);\n sortOrder.push(getFirstDefined(sortField.order, 'ascending'));\n }\n }\n const sort = {\n field: sortFields,\n order: sortOrder\n };\n let normalizedAs;\n if (isValidAsArray(as)) {\n normalizedAs = as;\n }\n else if (isString(as)) {\n normalizedAs = [as, as + '_end'];\n }\n else {\n normalizedAs = [stackTransform.stack + '_start', stackTransform.stack + '_end'];\n }\n return new StackNode(parent, {\n stackField: stack,\n groupby,\n offset,\n sort,\n facetby: [],\n as: normalizedAs\n });\n }\n static makeFromEncoding(parent, model) {\n const stackProperties = model.stack;\n const { encoding } = model;\n if (!stackProperties) {\n return null;\n }\n const { groupbyChannel, fieldChannel, offset, impute } = stackProperties;\n let dimensionFieldDef;\n if (groupbyChannel) {\n const cDef = encoding[groupbyChannel];\n dimensionFieldDef = getFieldDef(cDef); // Fair to cast as groupByChannel is always either x or y\n }\n const stackby = getStackByFields(model);\n const orderDef = model.encoding.order;\n let sort;\n if (isArray(orderDef) || isFieldDef(orderDef)) {\n sort = sortParams(orderDef);\n }\n else {\n // default = descending by stackFields\n // FIXME is the default here correct for binned fields?\n sort = stackby.reduce((s, field) => {\n s.field.push(field);\n s.order.push(fieldChannel === 'y' ? 'descending' : 'ascending');\n return s;\n }, { field: [], order: [] });\n }\n return new StackNode(parent, {\n dimensionFieldDef,\n stackField: model.vgField(fieldChannel),\n facetby: [],\n stackby,\n sort,\n offset,\n impute,\n as: [\n model.vgField(fieldChannel, { suffix: 'start', forAs: true }),\n model.vgField(fieldChannel, { suffix: 'end', forAs: true })\n ]\n });\n }\n get stack() {\n return this._stack;\n }\n addDimensions(fields) {\n this._stack.facetby.push(...fields);\n }\n dependentFields() {\n const out = new Set();\n out.add(this._stack.stackField);\n this.getGroupbyFields().forEach(out.add, out);\n this._stack.facetby.forEach(out.add, out);\n this._stack.sort.field.forEach(out.add, out);\n return out;\n }\n producedFields() {\n return new Set(this._stack.as);\n }\n hash() {\n return `Stack ${hash(this._stack)}`;\n }\n getGroupbyFields() {\n const { dimensionFieldDef, impute, groupby } = this._stack;\n if (dimensionFieldDef) {\n if (dimensionFieldDef.bin) {\n if (impute) {\n // For binned group by field with impute, we calculate bin_mid\n // as we cannot impute two fields simultaneously\n return [vgField(dimensionFieldDef, { binSuffix: 'mid' })];\n }\n return [\n // For binned group by field without impute, we need both bin (start) and bin_end\n vgField(dimensionFieldDef, {}),\n vgField(dimensionFieldDef, { binSuffix: 'end' })\n ];\n }\n return [vgField(dimensionFieldDef)];\n }\n return groupby !== null && groupby !== void 0 ? groupby : [];\n }\n assemble() {\n const transform = [];\n const { facetby, dimensionFieldDef, stackField: field, stackby, sort, offset, impute, as } = this._stack;\n // Impute\n if (impute && dimensionFieldDef) {\n const { band = 0.5, bin } = dimensionFieldDef;\n if (bin) {\n // As we can only impute one field at a time, we need to calculate\n // mid point for a binned field\n transform.push({\n type: 'formula',\n expr: `${band}*` +\n vgField(dimensionFieldDef, { expr: 'datum' }) +\n `+${1 - band}*` +\n vgField(dimensionFieldDef, { expr: 'datum', binSuffix: 'end' }),\n as: vgField(dimensionFieldDef, { binSuffix: 'mid', forAs: true })\n });\n }\n transform.push({\n type: 'impute',\n field,\n groupby: [...stackby, ...facetby],\n key: vgField(dimensionFieldDef, { binSuffix: 'mid' }),\n method: 'value',\n value: 0\n });\n }\n // Stack\n transform.push({\n type: 'stack',\n groupby: [...this.getGroupbyFields(), ...facetby],\n field,\n sort,\n as,\n offset\n });\n return transform;\n }\n}\n//# sourceMappingURL=stack.js.map","import { isAggregateOp } from '../../aggregate';\nimport { vgField } from '../../channeldef';\nimport { duplicate, hash } from '../../util';\nimport { unique } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for the window transform nodes\n */\nexport class WindowTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new WindowTransformNode(null, duplicate(this.transform));\n }\n addDimensions(fields) {\n this.transform.groupby = unique(this.transform.groupby.concat(fields), d => d);\n }\n dependentFields() {\n var _a, _b;\n const out = new Set();\n ((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : []).forEach(out.add, out);\n ((_b = this.transform.sort) !== null && _b !== void 0 ? _b : []).forEach(m => out.add(m.field));\n this.transform.window\n .map(w => w.field)\n .filter(f => f !== undefined)\n .forEach(out.add, out);\n return out;\n }\n producedFields() {\n return new Set(this.transform.window.map(this.getDefaultName));\n }\n getDefaultName(windowFieldDef) {\n var _a;\n return (_a = windowFieldDef.as) !== null && _a !== void 0 ? _a : vgField(windowFieldDef);\n }\n hash() {\n return `WindowTransform ${hash(this.transform)}`;\n }\n assemble() {\n var _a;\n const fields = [];\n const ops = [];\n const as = [];\n const params = [];\n for (const window of this.transform.window) {\n ops.push(window.op);\n as.push(this.getDefaultName(window));\n params.push(window.param === undefined ? null : window.param);\n fields.push(window.field === undefined ? null : window.field);\n }\n const frame = this.transform.frame;\n const groupby = this.transform.groupby;\n if (frame && frame[0] === null && frame[1] === null && ops.every(o => isAggregateOp(o))) {\n // when the window does not rely on any particular window ops or frame, switch to a simpler and more efficient joinaggregate\n return Object.assign({ type: 'joinaggregate', as, ops: ops, fields }, (groupby !== undefined ? { groupby } : {}));\n }\n const sortFields = [];\n const sortOrder = [];\n if (this.transform.sort !== undefined) {\n for (const sortField of this.transform.sort) {\n sortFields.push(sortField.field);\n sortOrder.push((_a = sortField.order) !== null && _a !== void 0 ? _a : 'ascending');\n }\n }\n const sort = {\n field: sortFields,\n order: sortOrder\n };\n const ignorePeers = this.transform.ignorePeers;\n return Object.assign(Object.assign(Object.assign({ type: 'window', params,\n as,\n ops,\n fields,\n sort }, (ignorePeers !== undefined ? { ignorePeers } : {})), (groupby !== undefined ? { groupby } : {})), (frame !== undefined ? { frame } : {}));\n }\n}\n//# sourceMappingURL=window.js.map","import { DataSourceType } from '../../data';\nimport { AggregateNode } from './aggregate';\nimport { OutputNode } from './dataflow';\nimport { FacetNode } from './facet';\nimport { JoinAggregateTransformNode } from './joinaggregate';\nimport { FACET_SCALE_PREFIX } from './optimize';\nimport { StackNode } from './stack';\nimport { WindowTransformNode } from './window';\n/**\n * Clones the subtree and ignores output nodes except for the leaves, which are renamed.\n */\nfunction cloneSubtree(facet) {\n function clone(node) {\n if (!(node instanceof FacetNode)) {\n const copy = node.clone();\n if (copy instanceof OutputNode) {\n const newName = FACET_SCALE_PREFIX + copy.getSource();\n copy.setSource(newName);\n facet.model.component.data.outputNodes[newName] = copy;\n }\n else if (copy instanceof AggregateNode ||\n copy instanceof StackNode ||\n copy instanceof WindowTransformNode ||\n copy instanceof JoinAggregateTransformNode) {\n copy.addDimensions(facet.fields);\n }\n for (const n of node.children.flatMap(clone)) {\n n.parent = copy;\n }\n return [copy];\n }\n return node.children.flatMap(clone);\n }\n return clone;\n}\n/**\n * Move facet nodes down to the next fork or output node. Also pull the main output with the facet node.\n * After moving down the facet node, make a copy of the subtree and make it a child of the main output.\n */\nexport function moveFacetDown(node) {\n if (node instanceof FacetNode) {\n if (node.numChildren() === 1 && !(node.children[0] instanceof OutputNode)) {\n // move down until we hit a fork or output node\n const child = node.children[0];\n if (child instanceof AggregateNode ||\n child instanceof StackNode ||\n child instanceof WindowTransformNode ||\n child instanceof JoinAggregateTransformNode) {\n child.addDimensions(node.fields);\n }\n child.swapWithParent();\n moveFacetDown(node);\n }\n else {\n // move main to facet\n const facetMain = node.model.component.data.main;\n moveMainDownToFacet(facetMain);\n // replicate the subtree and place it before the facet's main node\n const cloner = cloneSubtree(node);\n const copy = node.children.map(cloner).flat();\n for (const c of copy) {\n c.parent = facetMain;\n }\n }\n }\n else {\n node.children.map(moveFacetDown);\n }\n}\nfunction moveMainDownToFacet(node) {\n if (node instanceof OutputNode && node.type === DataSourceType.Main) {\n if (node.numChildren() === 1) {\n const child = node.children[0];\n if (!(child instanceof FacetNode)) {\n child.swapWithParent();\n moveMainDownToFacet(node);\n }\n }\n }\n}\n//# sourceMappingURL=subtree.js.map","import * as log from '../../log';\nimport * as optimizers from './optimizers';\nimport { moveFacetDown } from './subtree';\nexport const FACET_SCALE_PREFIX = 'scale_';\nexport const MAX_OPTIMIZATION_RUNS = 5;\n/**\n * Iterates over a dataflow graph and checks whether all links are consistent.\n */\nexport function checkLinks(nodes) {\n for (const node of nodes) {\n for (const child of node.children) {\n if (child.parent !== node) {\n // log.error('Dataflow graph is inconsistent.', node, child);\n return false;\n }\n }\n if (!checkLinks(node.children)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Run the specified optimizer on the provided nodes.\n *\n * @param optimizer The optimizer instance to run.\n * @param nodes A set of nodes to optimize.\n */\nfunction runOptimizer(optimizer, nodes) {\n let modified = false;\n for (const node of nodes) {\n modified = optimizer.optimize(node) || modified;\n }\n return modified;\n}\nfunction optimizationDataflowHelper(dataComponent, model, firstPass) {\n let roots = dataComponent.sources;\n let modified = false;\n modified = runOptimizer(new optimizers.RemoveUnnecessaryOutputNodes(), roots) || modified;\n modified = runOptimizer(new optimizers.RemoveUnnecessaryIdentifierNodes(model), roots) || modified;\n // remove source nodes that don't have any children because they also don't have output nodes\n roots = roots.filter(r => r.numChildren() > 0);\n modified = runOptimizer(new optimizers.RemoveUnusedSubtrees(), roots) || modified;\n roots = roots.filter(r => r.numChildren() > 0);\n if (!firstPass) {\n // Only run these optimizations after the optimizer has moved down the facet node.\n // With this change, we can be more aggressive in the optimizations.\n modified = runOptimizer(new optimizers.MoveParseUp(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeBins(model), roots) || modified;\n modified = runOptimizer(new optimizers.RemoveDuplicateTimeUnits(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeParse(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeAggregates(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeTimeUnits(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeIdenticalNodes(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeOutputs(), roots) || modified;\n }\n dataComponent.sources = roots;\n return modified;\n}\n/**\n * Optimizes the dataflow of the passed in data component.\n */\nexport function optimizeDataflow(data, model) {\n // check before optimizations\n checkLinks(data.sources);\n let firstPassCounter = 0;\n let secondPassCounter = 0;\n for (let i = 0; i < MAX_OPTIMIZATION_RUNS; i++) {\n if (!optimizationDataflowHelper(data, model, true)) {\n break;\n }\n firstPassCounter++;\n }\n // move facets down and make a copy of the subtree so that we can have scales at the top level\n data.sources.map(moveFacetDown);\n for (let i = 0; i < MAX_OPTIMIZATION_RUNS; i++) {\n if (!optimizationDataflowHelper(data, model, false)) {\n break;\n }\n secondPassCounter++;\n }\n // check after optimizations\n checkLinks(data.sources);\n if (Math.max(firstPassCounter, secondPassCounter) === MAX_OPTIMIZATION_RUNS) {\n log.warn(`Maximum optimization runs(${MAX_OPTIMIZATION_RUNS}) reached.`);\n }\n}\n//# sourceMappingURL=optimize.js.map","/**\n * A class that behaves like a SignalRef but lazily generates the signal.\n * The provided generator function should use `Model.getSignalName` to use the correct signal name.\n */\nexport class SignalRefWrapper {\n constructor(exprGenerator) {\n Object.defineProperty(this, 'signal', {\n enumerable: true,\n get: exprGenerator\n });\n }\n static fromName(rename, signalName) {\n return new SignalRefWrapper(() => rename(signalName));\n }\n}\n//# sourceMappingURL=signal.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isObject, isString } from 'vega-util';\nimport { isAggregateOp, isArgmaxDef, isArgminDef, MULTIDOMAIN_SORT_OP_INDEX as UNIONDOMAIN_SORT_OP_INDEX, SHARED_DOMAIN_OP_INDEX } from '../../aggregate';\nimport { isBinning, isBinParams, isSelectionExtent } from '../../bin';\nimport { getSecondaryRangeChannel, isScaleChannel } from '../../channel';\nimport { binRequiresRange, getFieldOrDatumDef, hasBand, isDatumDef, isFieldDef, valueExpr, vgField } from '../../channeldef';\nimport { DataSourceType } from '../../data';\nimport * as log from '../../log';\nimport { hasDiscreteDomain, isDomainUnionWith, isSelectionDomain } from '../../scale';\nimport { DEFAULT_SORT_OP, isSortArray, isSortByEncoding, isSortField } from '../../sort';\nimport { normalizeTimeUnit } from '../../timeunit';\nimport * as util from '../../util';\nimport { isDataRefDomain, isDataRefUnionedDomain, isFieldRefUnionDomain, isSignalRef } from '../../vega.schema';\nimport { getBinSignalName } from '../data/bin';\nimport { sortArrayIndexField } from '../data/calculate';\nimport { FACET_SCALE_PREFIX } from '../data/optimize';\nimport { isFacetModel, isUnitModel } from '../model';\nimport { SignalRefWrapper } from '../signal';\nimport { makeExplicit, makeImplicit, mergeValuesWithExplicit } from '../split';\nexport function parseScaleDomain(model) {\n if (isUnitModel(model)) {\n parseUnitScaleDomain(model);\n }\n else {\n parseNonUnitScaleDomain(model);\n }\n}\nfunction parseUnitScaleDomain(model) {\n const localScaleComponents = model.component.scales;\n for (const channel of util.keys(localScaleComponents)) {\n const domains = parseDomainForChannel(model, channel);\n const localScaleCmpt = localScaleComponents[channel];\n localScaleCmpt.setWithExplicit('domains', domains);\n parseSelectionDomain(model, channel);\n if (model.component.data.isFaceted) {\n // get resolve from closest facet parent as this decides whether we need to refer to cloned subtree or not\n let facetParent = model;\n while (!isFacetModel(facetParent) && facetParent.parent) {\n facetParent = facetParent.parent;\n }\n const resolve = facetParent.component.resolve.scale[channel];\n if (resolve === 'shared') {\n for (const domain of domains.value) {\n // Replace the scale domain with data output from a cloned subtree after the facet.\n if (isDataRefDomain(domain)) {\n // use data from cloned subtree (which is the same as data but with a prefix added once)\n domain.data = FACET_SCALE_PREFIX + domain.data.replace(FACET_SCALE_PREFIX, '');\n }\n }\n }\n }\n }\n}\nfunction parseNonUnitScaleDomain(model) {\n for (const child of model.children) {\n parseScaleDomain(child);\n }\n const localScaleComponents = model.component.scales;\n for (const channel of util.keys(localScaleComponents)) {\n let domains;\n let selectionExtent = null;\n for (const child of model.children) {\n const childComponent = child.component.scales[channel];\n if (childComponent) {\n if (domains === undefined) {\n domains = childComponent.getWithExplicit('domains');\n }\n else {\n domains = mergeValuesWithExplicit(domains, childComponent.getWithExplicit('domains'), 'domains', 'scale', domainsTieBreaker);\n }\n const se = childComponent.get('selectionExtent');\n if (selectionExtent && se && selectionExtent.selection !== se.selection) {\n log.warn(log.message.NEEDS_SAME_SELECTION);\n }\n selectionExtent = se;\n }\n }\n localScaleComponents[channel].setWithExplicit('domains', domains);\n if (selectionExtent) {\n localScaleComponents[channel].set('selectionExtent', selectionExtent, true);\n }\n }\n}\n/**\n * Remove unaggregated domain if it is not applicable\n * Add unaggregated domain if domain is not specified and config.scale.useUnaggregatedDomain is true.\n */\nfunction normalizeUnaggregatedDomain(domain, fieldDef, scaleType, scaleConfig) {\n if (domain === 'unaggregated') {\n const { valid, reason } = canUseUnaggregatedDomain(fieldDef, scaleType);\n if (!valid) {\n log.warn(reason);\n return undefined;\n }\n }\n else if (domain === undefined && scaleConfig.useUnaggregatedDomain) {\n // Apply config if domain is not specified.\n const { valid } = canUseUnaggregatedDomain(fieldDef, scaleType);\n if (valid) {\n return 'unaggregated';\n }\n }\n return domain;\n}\nexport function parseDomainForChannel(model, channel) {\n const scaleType = model.getScaleComponent(channel).get('type');\n const { encoding } = model;\n const domain = normalizeUnaggregatedDomain(model.scaleDomain(channel), model.typedFieldDef(channel), scaleType, model.config.scale);\n if (domain !== model.scaleDomain(channel)) {\n model.specifiedScales[channel] = Object.assign(Object.assign({}, model.specifiedScales[channel]), { domain });\n }\n // If channel is either X or Y then union them with X2 & Y2 if they exist\n if (channel === 'x' && getFieldOrDatumDef(encoding.x2)) {\n if (getFieldOrDatumDef(encoding.x)) {\n return mergeValuesWithExplicit(parseSingleChannelDomain(scaleType, domain, model, 'x'), parseSingleChannelDomain(scaleType, domain, model, 'x2'), 'domain', 'scale', domainsTieBreaker);\n }\n else {\n return parseSingleChannelDomain(scaleType, domain, model, 'x2');\n }\n }\n else if (channel === 'y' && getFieldOrDatumDef(encoding.y2)) {\n if (getFieldOrDatumDef(encoding.y)) {\n return mergeValuesWithExplicit(parseSingleChannelDomain(scaleType, domain, model, 'y'), parseSingleChannelDomain(scaleType, domain, model, 'y2'), 'domain', 'scale', domainsTieBreaker);\n }\n else {\n return parseSingleChannelDomain(scaleType, domain, model, 'y2');\n }\n }\n return parseSingleChannelDomain(scaleType, domain, model, channel);\n}\nfunction mapDomainToDataSignal(domain, type, timeUnit) {\n return domain.map(v => {\n const data = valueExpr(v, { timeUnit, type });\n return { signal: `{data: ${data}}` };\n });\n}\nfunction convertDomainIfItIsDateTime(domain, type, timeUnit) {\n var _a;\n // explicit value\n const normalizedTimeUnit = (_a = normalizeTimeUnit(timeUnit)) === null || _a === void 0 ? void 0 : _a.unit;\n if (type === 'temporal' || normalizedTimeUnit) {\n return mapDomainToDataSignal(domain, type, normalizedTimeUnit);\n }\n return [domain]; // Date time won't make sense\n}\nfunction parseSingleChannelDomain(scaleType, domain, model, channel) {\n const { encoding } = model;\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n const { type } = fieldOrDatumDef;\n const timeUnit = fieldOrDatumDef['timeUnit'];\n if (isDomainUnionWith(domain)) {\n const defaultDomain = parseSingleChannelDomain(scaleType, undefined, model, channel);\n const unionWith = convertDomainIfItIsDateTime(domain.unionWith, type, timeUnit);\n return makeExplicit([...defaultDomain.value, ...unionWith]);\n }\n else if (isSignalRef(domain)) {\n return makeExplicit([domain]);\n }\n else if (domain && domain !== 'unaggregated' && !isSelectionDomain(domain)) {\n return makeExplicit(convertDomainIfItIsDateTime(domain, type, timeUnit));\n }\n const stack = model.stack;\n if (stack && channel === stack.fieldChannel) {\n if (stack.offset === 'normalize') {\n return makeImplicit([[0, 1]]);\n }\n const data = model.requestDataName(DataSourceType.Main);\n return makeImplicit([\n {\n data,\n field: model.vgField(channel, { suffix: 'start' })\n },\n {\n data,\n field: model.vgField(channel, { suffix: 'end' })\n }\n ]);\n }\n const sort = isScaleChannel(channel) && isFieldDef(fieldOrDatumDef) ? domainSort(model, channel, scaleType) : undefined;\n if (isDatumDef(fieldOrDatumDef)) {\n const d = convertDomainIfItIsDateTime([fieldOrDatumDef.datum], type, timeUnit);\n return makeImplicit(d);\n }\n const fieldDef = fieldOrDatumDef; // now we can be sure it's a fieldDef\n if (domain === 'unaggregated') {\n const data = model.requestDataName(DataSourceType.Main);\n const { field } = fieldOrDatumDef;\n return makeImplicit([\n {\n data,\n field: vgField({ field, aggregate: 'min' })\n },\n {\n data,\n field: vgField({ field, aggregate: 'max' })\n }\n ]);\n }\n else if (isBinning(fieldDef.bin)) {\n if (hasDiscreteDomain(scaleType)) {\n if (scaleType === 'bin-ordinal') {\n // we can omit the domain as it is inferred from the `bins` property\n return makeImplicit([]);\n }\n // ordinal bin scale takes domain from bin_range, ordered by bin start\n // This is useful for both axis-based scale (x/y) and legend-based scale (other channels).\n return makeImplicit([\n {\n // If sort by aggregation of a specified sort field, we need to use RAW table,\n // so we can aggregate values for the scale independently from the main aggregation.\n data: util.isBoolean(sort)\n ? model.requestDataName(DataSourceType.Main)\n : model.requestDataName(DataSourceType.Raw),\n // Use range if we added it and the scale does not support computing a range as a signal.\n field: model.vgField(channel, binRequiresRange(fieldDef, channel) ? { binSuffix: 'range' } : {}),\n // we have to use a sort object if sort = true to make the sort correct by bin start\n sort: sort === true || !isObject(sort)\n ? {\n field: model.vgField(channel, {}),\n op: 'min' // min or max doesn't matter since we sort by the start of the bin range\n }\n : sort\n }\n ]);\n }\n else {\n // continuous scales\n const { bin } = fieldDef;\n if (isBinning(bin)) {\n const binSignal = getBinSignalName(model, fieldDef.field, bin);\n return makeImplicit([\n new SignalRefWrapper(() => {\n const signal = model.getSignalName(binSignal);\n return `[${signal}.start, ${signal}.stop]`;\n })\n ]);\n }\n else {\n return makeImplicit([\n {\n data: model.requestDataName(DataSourceType.Main),\n field: model.vgField(channel, {})\n }\n ]);\n }\n }\n }\n else if (fieldDef.timeUnit &&\n util.contains(['time', 'utc'], scaleType) &&\n hasBand(channel, fieldDef, isUnitModel(model) ? model.encoding[getSecondaryRangeChannel(channel)] : undefined, model.stack, model.markDef, model.config)) {\n const data = model.requestDataName(DataSourceType.Main);\n return makeImplicit([\n {\n data,\n field: model.vgField(channel)\n },\n {\n data,\n field: model.vgField(channel, { suffix: 'end' })\n }\n ]);\n }\n else if (sort) {\n return makeImplicit([\n {\n // If sort by aggregation of a specified sort field, we need to use RAW table,\n // so we can aggregate values for the scale independently from the main aggregation.\n data: util.isBoolean(sort)\n ? model.requestDataName(DataSourceType.Main)\n : model.requestDataName(DataSourceType.Raw),\n field: model.vgField(channel),\n sort: sort\n }\n ]);\n }\n else {\n return makeImplicit([\n {\n data: model.requestDataName(DataSourceType.Main),\n field: model.vgField(channel)\n }\n ]);\n }\n}\nfunction normalizeSortField(sort, isStackedMeasure) {\n const { op, field, order } = sort;\n return Object.assign(Object.assign({ \n // Apply default op\n op: op !== null && op !== void 0 ? op : (isStackedMeasure ? 'sum' : DEFAULT_SORT_OP) }, (field ? { field: util.replacePathInField(field) } : {})), (order ? { order } : {}));\n}\nfunction parseSelectionDomain(model, channel) {\n var _a;\n const scale = model.component.scales[channel];\n const spec = model.specifiedScales[channel].domain;\n const bin = (_a = model.fieldDef(channel)) === null || _a === void 0 ? void 0 : _a.bin;\n const domain = isSelectionDomain(spec) && spec;\n const extent = isBinParams(bin) && isSelectionExtent(bin.extent) && bin.extent;\n if (domain || extent) {\n // As scale parsing occurs before selection parsing, we cannot set\n // domainRaw directly. So instead, we store the selectionExtent on\n // the scale component, and then add domainRaw during scale assembly.\n scale.set('selectionExtent', domain !== null && domain !== void 0 ? domain : extent, true);\n }\n}\nexport function domainSort(model, channel, scaleType) {\n if (!hasDiscreteDomain(scaleType)) {\n return undefined;\n }\n // save to cast as the only exception is the geojson type for shape, which would not generate a scale\n const fieldDef = model.fieldDef(channel);\n const sort = fieldDef.sort;\n // if the sort is specified with array, use the derived sort index field\n if (isSortArray(sort)) {\n return {\n op: 'min',\n field: sortArrayIndexField(fieldDef, channel),\n order: 'ascending'\n };\n }\n const { stack } = model;\n const stackDimensions = stack\n ? [...(stack.groupbyField ? [stack.groupbyField] : []), ...stack.stackBy.map(s => s.fieldDef.field)]\n : undefined;\n // Sorted based on an aggregate calculation over a specified sort field (only for ordinal scale)\n if (isSortField(sort)) {\n const isStackedMeasure = stack && !util.contains(stackDimensions, sort.field);\n return normalizeSortField(sort, isStackedMeasure);\n }\n else if (isSortByEncoding(sort)) {\n const { encoding, order } = sort;\n const fieldDefToSortBy = model.fieldDef(encoding);\n const { aggregate, field } = fieldDefToSortBy;\n const isStackedMeasure = stack && !util.contains(stackDimensions, field);\n if (isArgminDef(aggregate) || isArgmaxDef(aggregate)) {\n return normalizeSortField({\n field: vgField(fieldDefToSortBy),\n order\n }, isStackedMeasure);\n }\n else if (isAggregateOp(aggregate) || !aggregate) {\n return normalizeSortField({\n op: aggregate,\n field,\n order\n }, isStackedMeasure);\n }\n }\n else if (sort === 'descending') {\n return {\n op: 'min',\n field: model.vgField(channel),\n order: 'descending'\n };\n }\n else if (util.contains(['ascending', undefined /* default =ascending*/], sort)) {\n return true;\n }\n // sort == null\n return undefined;\n}\n/**\n * Determine if a scale can use unaggregated domain.\n * @return {Boolean} Returns true if all of the following conditions apply:\n * 1. `scale.domain` is `unaggregated`\n * 2. Aggregation function is not `count` or `sum`\n * 3. The scale is quantitative or time scale.\n */\nexport function canUseUnaggregatedDomain(fieldDef, scaleType) {\n const { aggregate, type } = fieldDef;\n if (!aggregate) {\n return {\n valid: false,\n reason: log.message.unaggregateDomainHasNoEffectForRawField(fieldDef)\n };\n }\n if (isString(aggregate) && !SHARED_DOMAIN_OP_INDEX[aggregate]) {\n return {\n valid: false,\n reason: log.message.unaggregateDomainWithNonSharedDomainOp(aggregate)\n };\n }\n if (type === 'quantitative') {\n if (scaleType === 'log') {\n return {\n valid: false,\n reason: log.message.unaggregatedDomainWithLogScale(fieldDef)\n };\n }\n }\n return { valid: true };\n}\n/**\n * Tie breaker for mergeValuesWithExplicit for domains. We concat the specified values.\n */\nfunction domainsTieBreaker(v1, v2, property, propertyOf) {\n if (v1.explicit && v2.explicit) {\n log.warn(log.message.mergeConflictingDomainProperty(property, propertyOf, v1.value, v2.value));\n }\n // If equal score, concat the domains so that we union them later.\n return { explicit: v1.explicit, value: [...v1.value, ...v2.value] };\n}\n/**\n * Converts an array of domains to a single Vega scale domain.\n */\nexport function mergeDomains(domains) {\n const uniqueDomains = util.unique(domains.map(domain => {\n // ignore sort property when computing the unique domains\n if (isDataRefDomain(domain)) {\n const { sort: _s } = domain, domainWithoutSort = __rest(domain, [\"sort\"]);\n return domainWithoutSort;\n }\n return domain;\n }), util.hash);\n const sorts = util.unique(domains\n .map(d => {\n if (isDataRefDomain(d)) {\n const s = d.sort;\n if (s !== undefined && !util.isBoolean(s)) {\n if ('op' in s && s.op === 'count') {\n // let's make sure that if op is count, we don't use a field\n delete s.field;\n }\n if (s.order === 'ascending') {\n // drop order: ascending as it is the default\n delete s.order;\n }\n }\n return s;\n }\n return undefined;\n })\n .filter(s => s !== undefined), util.hash);\n if (uniqueDomains.length === 0) {\n return undefined;\n }\n else if (uniqueDomains.length === 1) {\n const domain = domains[0];\n if (isDataRefDomain(domain) && sorts.length > 0) {\n let sort = sorts[0];\n if (sorts.length > 1) {\n log.warn(log.message.MORE_THAN_ONE_SORT);\n sort = true;\n }\n else {\n // Simplify domain sort by removing field and op when the field is the same as the domain field.\n if (isObject(sort) && 'field' in sort) {\n const sortField = sort.field;\n if (domain.field === sortField) {\n sort = sort.order ? { order: sort.order } : true;\n }\n }\n }\n return Object.assign(Object.assign({}, domain), { sort });\n }\n return domain;\n }\n // only keep sort properties that work with unioned domains\n const unionDomainSorts = util.unique(sorts.map(s => {\n if (util.isBoolean(s) || !('op' in s) || (isString(s.op) && s.op in UNIONDOMAIN_SORT_OP_INDEX)) {\n return s;\n }\n log.warn(log.message.domainSortDropped(s));\n return true;\n }), util.hash);\n let sort;\n if (unionDomainSorts.length === 1) {\n sort = unionDomainSorts[0];\n }\n else if (unionDomainSorts.length > 1) {\n log.warn(log.message.MORE_THAN_ONE_SORT);\n sort = true;\n }\n const allData = util.unique(domains.map(d => {\n if (isDataRefDomain(d)) {\n return d.data;\n }\n return null;\n }), x => x);\n if (allData.length === 1 && allData[0] !== null) {\n // create a union domain of different fields with a single data source\n const domain = Object.assign({ data: allData[0], fields: uniqueDomains.map(d => d.field) }, (sort ? { sort } : {}));\n return domain;\n }\n return Object.assign({ fields: uniqueDomains }, (sort ? { sort } : {}));\n}\n/**\n * Return a field if a scale uses a single field.\n * Return `undefined` otherwise.\n */\nexport function getFieldFromDomain(domain) {\n if (isDataRefDomain(domain) && isString(domain.field)) {\n return domain.field;\n }\n else if (isDataRefUnionedDomain(domain)) {\n let field;\n for (const nonUnionDomain of domain.fields) {\n if (isDataRefDomain(nonUnionDomain) && isString(nonUnionDomain.field)) {\n if (!field) {\n field = nonUnionDomain.field;\n }\n else if (field !== nonUnionDomain.field) {\n log.warn(log.message.FACETED_INDEPENDENT_DIFFERENT_SOURCES);\n return field;\n }\n }\n }\n log.warn(log.message.FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES);\n return field;\n }\n else if (isFieldRefUnionDomain(domain)) {\n log.warn(log.message.FACETED_INDEPENDENT_SAME_SOURCE);\n const field = domain.fields[0];\n return isString(field) ? field : undefined;\n }\n return undefined;\n}\nexport function assembleDomain(model, channel) {\n const scaleComponent = model.component.scales[channel];\n const domains = scaleComponent.get('domains').map((domain) => {\n // Correct references to data as the original domain's data was determined\n // in parseScale, which happens before parseData. Thus the original data\n // reference can be incorrect.\n if (isDataRefDomain(domain)) {\n domain.data = model.lookupDataSource(domain.data);\n }\n return domain;\n });\n // domains is an array that has to be merged into a single vega domain\n return mergeDomains(domains);\n}\n//# sourceMappingURL=domain.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isObject } from 'vega-util';\nimport { isXorY } from '../../channel';\nimport { keys } from '../../util';\nimport { isDataRefDomain, isVgRangeStep } from '../../vega.schema';\nimport { isConcatModel, isLayerModel } from '../model';\nimport { assembleSelectionScaleDomain } from '../selection/assemble';\nimport { assembleDomain } from './domain';\nexport function assembleScales(model) {\n if (isLayerModel(model) || isConcatModel(model)) {\n // For concat and layer, include scales of children too\n return model.children.reduce((scales, child) => {\n return scales.concat(assembleScales(child));\n }, assembleScalesForModel(model));\n }\n else {\n // For facet, child scales would not be included in the parent's scope.\n // For unit, there is no child.\n return assembleScalesForModel(model);\n }\n}\nexport function assembleScalesForModel(model) {\n return keys(model.component.scales).reduce((scales, channel) => {\n const scaleComponent = model.component.scales[channel];\n if (scaleComponent.merged) {\n // Skipped merged scales\n return scales;\n }\n const scale = scaleComponent.combine();\n const { name, type, selectionExtent, domains: _d, range: _r, reverse } = scale, otherScaleProps = __rest(scale, [\"name\", \"type\", \"selectionExtent\", \"domains\", \"range\", \"reverse\"]);\n const range = assembleScaleRange(scale.range, name, channel, model);\n let domainRaw;\n if (selectionExtent) {\n domainRaw = assembleSelectionScaleDomain(model, selectionExtent);\n }\n const domain = assembleDomain(model, channel);\n scales.push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ name,\n type }, (domain ? { domain } : {})), (domainRaw ? { domainRaw } : {})), { range }), (reverse !== undefined ? { reverse: reverse } : {})), otherScaleProps));\n return scales;\n }, []);\n}\nexport function assembleScaleRange(scaleRange, scaleName, channel, model) {\n // add signals to x/y range\n if (isXorY(channel)) {\n if (isVgRangeStep(scaleRange)) {\n // For width/height step, use a signal created in layout assemble instead of a constant step.\n return {\n step: { signal: scaleName + '_step' }\n };\n }\n }\n else if (isObject(scaleRange) && isDataRefDomain(scaleRange)) {\n return Object.assign(Object.assign({}, scaleRange), { data: model.lookupDataSource(scaleRange.data) });\n }\n return scaleRange;\n}\n//# sourceMappingURL=assemble.js.map","import { isArray } from 'vega-util';\nimport { some } from '../../util';\nimport { Split } from '../split';\nexport class ScaleComponent extends Split {\n constructor(name, typeWithExplicit) {\n super({}, // no initial explicit property\n { name } // name as initial implicit property\n );\n this.merged = false;\n this.setWithExplicit('type', typeWithExplicit);\n }\n /**\n * Whether the scale definitely includes zero in the domain\n */\n domainDefinitelyIncludesZero() {\n if (this.get('zero') !== false) {\n return true;\n }\n return some(this.get('domains'), d => isArray(d) && d.length === 2 && d[0] <= 0 && d[1] >= 0);\n }\n}\n//# sourceMappingURL=component.js.map","import { isArray, isNumber, isObject } from 'vega-util';\nimport { isBinning } from '../../bin';\nimport { ANGLE, COLOR, FILL, FILLOPACITY, isXorY, OPACITY, RADIUS, SCALE_CHANNELS, SHAPE, SIZE, STROKE, STROKEDASH, STROKEOPACITY, STROKEWIDTH, THETA, X, Y } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { getViewConfigDiscreteSize, getViewConfigDiscreteStep } from '../../config';\nimport { DataSourceType } from '../../data';\nimport * as log from '../../log';\nimport { channelScalePropertyIncompatability, hasContinuousDomain, hasDiscreteDomain, isContinuousToDiscrete, isExtendedScheme, scaleTypeSupportProperty } from '../../scale';\nimport { isStep } from '../../spec/base';\nimport * as util from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { signalOrStringValue } from '../common';\nimport { getBinSignalName } from '../data/bin';\nimport { SignalRefWrapper } from '../signal';\nimport { makeExplicit, makeImplicit } from '../split';\nexport const RANGE_PROPERTIES = ['range', 'scheme'];\nfunction getSizeChannel(channel) {\n return channel === 'x' ? 'width' : channel === 'y' ? 'height' : undefined;\n}\nexport function parseUnitScaleRange(model) {\n const localScaleComponents = model.component.scales;\n // use SCALE_CHANNELS instead of scales[channel] to ensure that x, y come first!\n for (const channel of SCALE_CHANNELS) {\n const localScaleCmpt = localScaleComponents[channel];\n if (!localScaleCmpt) {\n continue;\n }\n const rangeWithExplicit = parseRangeForChannel(channel, model);\n localScaleCmpt.setWithExplicit('range', rangeWithExplicit);\n }\n}\nfunction getBinStepSignal(model, channel) {\n const fieldDef = model.fieldDef(channel);\n if (fieldDef && fieldDef.bin && isBinning(fieldDef.bin)) {\n const binSignal = getBinSignalName(model, fieldDef.field, fieldDef.bin);\n // TODO: extract this to be range step signal\n const sizeType = getSizeChannel(channel);\n const sizeSignal = model.getName(sizeType);\n return new SignalRefWrapper(() => {\n const updatedName = model.getSignalName(binSignal);\n const binCount = `(${updatedName}.stop - ${updatedName}.start) / ${updatedName}.step`;\n return `${model.getSignalName(sizeSignal)} / (${binCount})`;\n });\n }\n return undefined;\n}\n/**\n * Return mixins that includes one of the Vega range types (explicit range, range.step, range.scheme).\n */\nexport function parseRangeForChannel(channel, model) {\n const specifiedScale = model.specifiedScales[channel];\n const { size } = model;\n const mergedScaleCmpt = model.getScaleComponent(channel);\n const scaleType = mergedScaleCmpt.get('type');\n // Check if any of the range properties is specified.\n // If so, check if it is compatible and make sure that we only output one of the properties\n for (const property of RANGE_PROPERTIES) {\n if (specifiedScale[property] !== undefined) {\n const supportedByScaleType = scaleTypeSupportProperty(scaleType, property);\n const channelIncompatability = channelScalePropertyIncompatability(channel, property);\n if (!supportedByScaleType) {\n log.warn(log.message.scalePropertyNotWorkWithScaleType(scaleType, property, channel));\n }\n else if (channelIncompatability) {\n // channel\n log.warn(channelIncompatability);\n }\n else {\n switch (property) {\n case 'range': {\n const range = specifiedScale.range;\n if (isArray(range)) {\n if (isXorY(channel)) {\n return makeExplicit(range.map(v => {\n if (v === 'width' || v === 'height') {\n // get signal for width/height\n // Just like default range logic below, we use SignalRefWrapper to account for potential merges and renames.\n const sizeSignal = model.getName(v);\n const getSignalName = model.getSignalName.bind(model);\n return SignalRefWrapper.fromName(getSignalName, sizeSignal);\n }\n return v;\n }));\n }\n }\n else if (isObject(range)) {\n return makeExplicit({\n data: model.requestDataName(DataSourceType.Main),\n field: range.field,\n sort: { op: 'min', field: model.vgField(channel) }\n });\n }\n return makeExplicit(range);\n }\n case 'scheme':\n return makeExplicit(parseScheme(specifiedScale[property]));\n }\n }\n }\n }\n if (channel === X || channel === Y) {\n const sizeChannel = channel === X ? 'width' : 'height';\n const sizeValue = size[sizeChannel];\n if (isStep(sizeValue)) {\n if (hasDiscreteDomain(scaleType)) {\n return makeExplicit({ step: sizeValue.step });\n }\n else {\n log.warn(log.message.stepDropped(sizeChannel));\n }\n }\n }\n const { rangeMin, rangeMax } = specifiedScale;\n const d = defaultRange(channel, model);\n if ((rangeMin !== undefined || rangeMax !== undefined) &&\n // it's ok to check just rangeMin's compatibility since rangeMin/rangeMax are the same\n scaleTypeSupportProperty(scaleType, 'rangeMin') &&\n isArray(d) &&\n d.length === 2) {\n return makeExplicit([rangeMin !== null && rangeMin !== void 0 ? rangeMin : d[0], rangeMax !== null && rangeMax !== void 0 ? rangeMax : d[1]]);\n }\n return makeImplicit(d);\n}\nfunction parseScheme(scheme) {\n if (isExtendedScheme(scheme)) {\n return Object.assign({ scheme: scheme.name }, util.omit(scheme, ['name']));\n }\n return { scheme: scheme };\n}\nfunction defaultRange(channel, model) {\n const { size, config, mark, encoding } = model;\n const getSignalName = model.getSignalName.bind(model);\n const { type } = getFieldOrDatumDef(encoding[channel]);\n const mergedScaleCmpt = model.getScaleComponent(channel);\n const scaleType = mergedScaleCmpt.get('type');\n const { domain, domainMid } = model.specifiedScales[channel];\n switch (channel) {\n case X:\n case Y: {\n // If there is no explicit width/height for discrete x/y scales\n if (util.contains(['point', 'band'], scaleType)) {\n if (channel === X && !size.width) {\n const w = getViewConfigDiscreteSize(config.view, 'width');\n if (isStep(w)) {\n return w;\n }\n }\n else if (channel === Y && !size.height) {\n const h = getViewConfigDiscreteSize(config.view, 'height');\n if (isStep(h)) {\n return h;\n }\n }\n }\n // If step is null, use zero to width or height.\n // Note that we use SignalRefWrapper to account for potential merges and renames.\n const sizeType = getSizeChannel(channel);\n const sizeSignal = model.getName(sizeType);\n if (channel === Y && hasContinuousDomain(scaleType)) {\n // For y continuous scale, we have to start from the height as the bottom part has the max value.\n return [SignalRefWrapper.fromName(getSignalName, sizeSignal), 0];\n }\n else {\n return [0, SignalRefWrapper.fromName(getSignalName, sizeSignal)];\n }\n }\n case SIZE: {\n // TODO: support custom rangeMin, rangeMax\n const zero = model.component.scales[channel].get('zero');\n const rangeMin = sizeRangeMin(mark, zero, config);\n const rangeMax = sizeRangeMax(mark, size, model, config);\n if (isContinuousToDiscrete(scaleType)) {\n return interpolateRange(rangeMin, rangeMax, defaultContinuousToDiscreteCount(scaleType, config, domain, channel));\n }\n else {\n return [rangeMin, rangeMax];\n }\n }\n case THETA:\n return [0, Math.PI * 2];\n case ANGLE:\n // TODO: add config.scale.min/maxAngleDegree (for point and text) and config.scale.min/maxAngleRadian (for arc) once we add arc marks.\n // (It's weird to add just config.scale.min/maxAngleDegree for now)\n return [0, 360];\n case RADIUS: {\n // max radius = half od min(width,height)\n return [\n 0,\n new SignalRefWrapper(() => {\n const w = model.getSignalName('width');\n const h = model.getSignalName('height');\n return `min(${w},${h})/2`;\n })\n ];\n }\n case STROKEWIDTH:\n // TODO: support custom rangeMin, rangeMax\n return [config.scale.minStrokeWidth, config.scale.maxStrokeWidth];\n case STROKEDASH:\n return [\n // TODO: add this to Vega's config.range?\n [1, 0],\n [4, 2],\n [2, 1],\n [1, 1],\n [1, 2, 4, 2]\n ];\n case SHAPE:\n return 'symbol';\n case COLOR:\n case FILL:\n case STROKE:\n if (scaleType === 'ordinal') {\n // Only nominal data uses ordinal scale by default\n return type === 'nominal' ? 'category' : 'ordinal';\n }\n else {\n if (domainMid !== undefined) {\n return 'diverging';\n }\n else {\n return mark === 'rect' || mark === 'geoshape' ? 'heatmap' : 'ramp';\n }\n }\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n // TODO: support custom rangeMin, rangeMax\n return [config.scale.minOpacity, config.scale.maxOpacity];\n }\n /* istanbul ignore next: should never reach here */\n throw new Error(`Scale range undefined for channel ${channel}`);\n}\nexport function defaultContinuousToDiscreteCount(scaleType, config, domain, channel) {\n switch (scaleType) {\n case 'quantile':\n return config.scale.quantileCount;\n case 'quantize':\n return config.scale.quantizeCount;\n case 'threshold':\n if (domain !== undefined && isArray(domain)) {\n return domain.length + 1;\n }\n else {\n log.warn(log.message.domainRequiredForThresholdScale(channel));\n // default threshold boundaries for threshold scale since domain has cardinality of 2\n return 3;\n }\n }\n}\n/**\n * Returns the linear interpolation of the range according to the cardinality\n *\n * @param rangeMin start of the range\n * @param rangeMax end of the range\n * @param cardinality number of values in the output range\n */\nexport function interpolateRange(rangeMin, rangeMax, cardinality) {\n // always return a signal since it's better to compute the sequence in Vega later\n const f = () => {\n const rMax = signalOrStringValue(rangeMax);\n const rMin = signalOrStringValue(rangeMin);\n const step = `(${rMax} - ${rMin}) / (${cardinality} - 1)`;\n return `sequence(${rMin}, ${rMax} + ${step}, ${step})`;\n };\n if (isSignalRef(rangeMax)) {\n return new SignalRefWrapper(f);\n }\n else {\n return { signal: f() };\n }\n}\nfunction sizeRangeMin(mark, zero, config) {\n if (zero) {\n if (isSignalRef(zero)) {\n return { signal: `${zero.signal} ? 0 : ${sizeRangeMin(mark, false, config)}` };\n }\n else {\n return 0;\n }\n }\n switch (mark) {\n case 'bar':\n case 'tick':\n return config.scale.minBandSize;\n case 'line':\n case 'trail':\n case 'rule':\n return config.scale.minStrokeWidth;\n case 'text':\n return config.scale.minFontSize;\n case 'point':\n case 'square':\n case 'circle':\n return config.scale.minSize;\n }\n /* istanbul ignore next: should never reach here */\n // sizeRangeMin not implemented for the mark\n throw new Error(log.message.incompatibleChannel('size', mark));\n}\nexport const MAX_SIZE_RANGE_STEP_RATIO = 0.95;\nfunction sizeRangeMax(mark, size, model, config) {\n const xyStepSignals = {\n x: getBinStepSignal(model, 'x'),\n y: getBinStepSignal(model, 'y')\n };\n switch (mark) {\n case 'bar':\n case 'tick': {\n if (config.scale.maxBandSize !== undefined) {\n return config.scale.maxBandSize;\n }\n const min = minXYStep(size, xyStepSignals, config.view);\n if (isNumber(min)) {\n return min - 1;\n }\n else {\n return new SignalRefWrapper(() => `${min.signal} - 1`);\n }\n }\n case 'line':\n case 'trail':\n case 'rule':\n return config.scale.maxStrokeWidth;\n case 'text':\n return config.scale.maxFontSize;\n case 'point':\n case 'square':\n case 'circle': {\n if (config.scale.maxSize) {\n return config.scale.maxSize;\n }\n const pointStep = minXYStep(size, xyStepSignals, config.view);\n if (isNumber(pointStep)) {\n return Math.pow(MAX_SIZE_RANGE_STEP_RATIO * pointStep, 2);\n }\n else {\n return new SignalRefWrapper(() => `pow(${MAX_SIZE_RANGE_STEP_RATIO} * ${pointStep.signal}, 2)`);\n }\n }\n }\n /* istanbul ignore next: should never reach here */\n // sizeRangeMax not implemented for the mark\n throw new Error(log.message.incompatibleChannel('size', mark));\n}\n/**\n * @returns {number} Range step of x or y or minimum between the two if both are ordinal scale.\n */\nfunction minXYStep(size, xyStepSignals, viewConfig) {\n const widthStep = isStep(size.width) ? size.width.step : getViewConfigDiscreteStep(viewConfig, 'width');\n const heightStep = isStep(size.height) ? size.height.step : getViewConfigDiscreteStep(viewConfig, 'height');\n if (xyStepSignals.x || xyStepSignals.y) {\n return new SignalRefWrapper(() => {\n const exprs = [\n xyStepSignals.x ? xyStepSignals.x.signal : widthStep,\n xyStepSignals.y ? xyStepSignals.y.signal : heightStep\n ];\n return `min(${exprs.join(', ')})`;\n });\n }\n return Math.min(widthStep, heightStep);\n}\n//# sourceMappingURL=range.js.map","import { isArray } from 'vega-util';\nimport { isBinned, isBinning, isBinParams } from '../../bin';\nimport { COLOR, FILL, POLAR_POSITION_SCALE_CHANNELS, POSITION_SCALE_CHANNELS, POSITION_SCALE_CHANNEL_INDEX, STROKE } from '../../channel';\nimport { getFieldDef, getFieldOrDatumDef, isFieldDef, valueExpr } from '../../channeldef';\nimport { isDateTime } from '../../datetime';\nimport * as log from '../../log';\nimport { channelScalePropertyIncompatability, hasContinuousDomain, isContinuousToContinuous, isContinuousToDiscrete, ScaleType, scaleTypeSupportProperty } from '../../scale';\nimport * as util from '../../util';\nimport { contains, getFirstDefined, keys } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { getBinSignalName } from '../data/bin';\nimport { isUnitModel } from '../model';\nimport { SignalRefWrapper } from '../signal';\nimport { mergeValuesWithExplicit, tieBreakByComparing } from '../split';\nimport { parseUnitScaleRange } from './range';\nexport function parseScaleProperty(model, property) {\n if (isUnitModel(model)) {\n parseUnitScaleProperty(model, property);\n }\n else {\n parseNonUnitScaleProperty(model, property);\n }\n}\nfunction parseUnitScaleProperty(model, property) {\n const localScaleComponents = model.component.scales;\n const { config, encoding, markDef, specifiedScales } = model;\n for (const channel of keys(localScaleComponents)) {\n const specifiedScale = specifiedScales[channel];\n const localScaleCmpt = localScaleComponents[channel];\n const mergedScaleCmpt = model.getScaleComponent(channel);\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n const specifiedValue = specifiedScale[property];\n const scaleType = mergedScaleCmpt.get('type');\n const scalePadding = mergedScaleCmpt.get('padding');\n const scalePaddingInner = mergedScaleCmpt.get('paddingInner');\n const supportedByScaleType = scaleTypeSupportProperty(scaleType, property);\n const channelIncompatability = channelScalePropertyIncompatability(channel, property);\n if (specifiedValue !== undefined) {\n // If there is a specified value, check if it is compatible with scale type and channel\n if (!supportedByScaleType) {\n log.warn(log.message.scalePropertyNotWorkWithScaleType(scaleType, property, channel));\n }\n else if (channelIncompatability) {\n // channel\n log.warn(channelIncompatability);\n }\n }\n if (supportedByScaleType && channelIncompatability === undefined) {\n if (specifiedValue !== undefined) {\n const timeUnit = fieldOrDatumDef['timeUnit'];\n const type = fieldOrDatumDef.type;\n switch (property) {\n // domainMax/Min to signal if the value is a datetime object\n case 'domainMax':\n case 'domainMin':\n if (isDateTime(specifiedScale[property]) || type === 'temporal' || timeUnit) {\n localScaleCmpt.set(property, { signal: valueExpr(specifiedScale[property], { type, timeUnit }) }, true);\n }\n else {\n localScaleCmpt.set(property, specifiedScale[property], true);\n }\n break;\n default:\n localScaleCmpt.copyKeyFromObject(property, specifiedScale);\n }\n }\n else {\n const value = property in scaleRules\n ? scaleRules[property]({\n model,\n channel,\n fieldOrDatumDef,\n scaleType,\n scalePadding,\n scalePaddingInner,\n domain: specifiedScale.domain,\n markDef,\n config\n })\n : config.scale[property];\n if (value !== undefined) {\n localScaleCmpt.set(property, value, false);\n }\n }\n }\n }\n}\nexport const scaleRules = {\n bins: ({ model, fieldOrDatumDef }) => (isFieldDef(fieldOrDatumDef) ? bins(model, fieldOrDatumDef) : undefined),\n interpolate: ({ channel, fieldOrDatumDef }) => interpolate(channel, fieldOrDatumDef.type),\n nice: ({ scaleType, channel, fieldOrDatumDef }) => nice(scaleType, channel, fieldOrDatumDef),\n padding: ({ channel, scaleType, fieldOrDatumDef, markDef, config }) => padding(channel, scaleType, config.scale, fieldOrDatumDef, markDef, config.bar),\n paddingInner: ({ scalePadding, channel, markDef, config }) => paddingInner(scalePadding, channel, markDef.type, config.scale),\n paddingOuter: ({ scalePadding, channel, scaleType, markDef, scalePaddingInner, config }) => paddingOuter(scalePadding, channel, scaleType, markDef.type, scalePaddingInner, config.scale),\n reverse: ({ fieldOrDatumDef, scaleType, channel, config }) => {\n const sort = isFieldDef(fieldOrDatumDef) ? fieldOrDatumDef.sort : undefined;\n return reverse(scaleType, sort, channel, config.scale);\n },\n zero: ({ channel, fieldOrDatumDef, domain, markDef, scaleType }) => zero(channel, fieldOrDatumDef, domain, markDef, scaleType)\n};\n// This method is here rather than in range.ts to avoid circular dependency.\nexport function parseScaleRange(model) {\n if (isUnitModel(model)) {\n parseUnitScaleRange(model);\n }\n else {\n parseNonUnitScaleProperty(model, 'range');\n }\n}\nexport function parseNonUnitScaleProperty(model, property) {\n const localScaleComponents = model.component.scales;\n for (const child of model.children) {\n if (property === 'range') {\n parseScaleRange(child);\n }\n else {\n parseScaleProperty(child, property);\n }\n }\n for (const channel of keys(localScaleComponents)) {\n let valueWithExplicit;\n for (const child of model.children) {\n const childComponent = child.component.scales[channel];\n if (childComponent) {\n const childValueWithExplicit = childComponent.getWithExplicit(property);\n valueWithExplicit = mergeValuesWithExplicit(valueWithExplicit, childValueWithExplicit, property, 'scale', tieBreakByComparing((v1, v2) => {\n switch (property) {\n case 'range':\n // For step, prefer larger step\n if (v1.step && v2.step) {\n return v1.step - v2.step;\n }\n return 0;\n // TODO: precedence rule for other properties\n }\n return 0;\n }));\n }\n }\n localScaleComponents[channel].setWithExplicit(property, valueWithExplicit);\n }\n}\nexport function bins(model, fieldDef) {\n const bin = fieldDef.bin;\n if (isBinning(bin)) {\n const binSignal = getBinSignalName(model, fieldDef.field, bin);\n return new SignalRefWrapper(() => {\n return model.getSignalName(binSignal);\n });\n }\n else if (isBinned(bin) && isBinParams(bin) && bin.step !== undefined) {\n // start and stop will be determined from the scale domain\n return {\n step: bin.step\n };\n }\n return undefined;\n}\nexport function interpolate(channel, type) {\n if (contains([COLOR, FILL, STROKE], channel) && type !== 'nominal') {\n return 'hcl';\n }\n return undefined;\n}\nexport function nice(scaleType, channel, fieldOrDatumDef) {\n var _a;\n if (((_a = getFieldDef(fieldOrDatumDef)) === null || _a === void 0 ? void 0 : _a.bin) || util.contains([ScaleType.TIME, ScaleType.UTC], scaleType)) {\n return undefined;\n }\n return channel in POSITION_SCALE_CHANNEL_INDEX ? true : undefined;\n}\nexport function padding(channel, scaleType, scaleConfig, fieldOrDatumDef, markDef, barConfig) {\n if (channel in POSITION_SCALE_CHANNEL_INDEX) {\n if (isContinuousToContinuous(scaleType)) {\n if (scaleConfig.continuousPadding !== undefined) {\n return scaleConfig.continuousPadding;\n }\n const { type, orient } = markDef;\n if (type === 'bar' && !(isFieldDef(fieldOrDatumDef) && (fieldOrDatumDef.bin || fieldOrDatumDef.timeUnit))) {\n if ((orient === 'vertical' && channel === 'x') || (orient === 'horizontal' && channel === 'y')) {\n return barConfig.continuousBandSize;\n }\n }\n }\n if (scaleType === ScaleType.POINT) {\n return scaleConfig.pointPadding;\n }\n }\n return undefined;\n}\nexport function paddingInner(paddingValue, channel, mark, scaleConfig) {\n if (paddingValue !== undefined) {\n // If user has already manually specified \"padding\", no need to add default paddingInner.\n return undefined;\n }\n if (channel in POSITION_SCALE_CHANNEL_INDEX) {\n // Padding is only set for X and Y by default.\n // Basically it doesn't make sense to add padding for color and size.\n // paddingOuter would only be called if it's a band scale, just return the default for bandScale.\n const { bandPaddingInner, barBandPaddingInner, rectBandPaddingInner } = scaleConfig;\n return getFirstDefined(bandPaddingInner, mark === 'bar' ? barBandPaddingInner : rectBandPaddingInner);\n }\n return undefined;\n}\nexport function paddingOuter(paddingValue, channel, scaleType, mark, paddingInnerValue, scaleConfig) {\n if (paddingValue !== undefined) {\n // If user has already manually specified \"padding\", no need to add default paddingOuter.\n return undefined;\n }\n if (channel in POSITION_SCALE_CHANNEL_INDEX) {\n // Padding is only set for X and Y by default.\n // Basically it doesn't make sense to add padding for color and size.\n if (scaleType === ScaleType.BAND) {\n const { bandPaddingOuter } = scaleConfig;\n return getFirstDefined(bandPaddingOuter, \n /* By default, paddingOuter is paddingInner / 2. The reason is that\n size (width/height) = step * (cardinality - paddingInner + 2 * paddingOuter).\n and we want the width/height to be integer by default.\n Note that step (by default) and cardinality are integers.) */\n isSignalRef(paddingInnerValue) ? { signal: `${paddingInnerValue.signal}/2` } : paddingInnerValue / 2);\n }\n }\n return undefined;\n}\nexport function reverse(scaleType, sort, channel, scaleConfig) {\n if (channel === 'x' && scaleConfig.xReverse !== undefined) {\n if (hasContinuousDomain(scaleType) && sort === 'descending') {\n if (isSignalRef(scaleConfig.xReverse)) {\n return { signal: `!${scaleConfig.xReverse.signal}` };\n }\n else {\n return !scaleConfig.xReverse;\n }\n }\n return scaleConfig.xReverse;\n }\n if (hasContinuousDomain(scaleType) && sort === 'descending') {\n // For continuous domain scales, Vega does not support domain sort.\n // Thus, we reverse range instead if sort is descending\n return true;\n }\n return undefined;\n}\nexport function zero(channel, fieldDef, specifiedDomain, markDef, scaleType) {\n // If users explicitly provide a domain range, we should not augment zero as that will be unexpected.\n const hasCustomDomain = !!specifiedDomain && specifiedDomain !== 'unaggregated';\n if (hasCustomDomain) {\n if (hasContinuousDomain(scaleType)) {\n if (isArray(specifiedDomain)) {\n const first = specifiedDomain[0];\n const last = specifiedDomain[specifiedDomain.length - 1];\n if (first <= 0 && last >= 0) {\n // if the domain includes zero, make zero remains true\n return true;\n }\n }\n return false;\n }\n }\n // If there is no custom domain, return true only for the following cases:\n // 1) using quantitative field with size\n // While this can be either ratio or interval fields, our assumption is that\n // ratio are more common. However, if the scaleType is discretizing scale, we want to return\n // false so that range doesn't start at zero\n if (channel === 'size' && fieldDef.type === 'quantitative' && !isContinuousToDiscrete(scaleType)) {\n return true;\n }\n // 2) non-binned, quantitative x-scale or y-scale\n // (For binning, we should not include zero by default because binning are calculated without zero.)\n if (!(isFieldDef(fieldDef) && fieldDef.bin) &&\n util.contains([...POSITION_SCALE_CHANNELS, ...POLAR_POSITION_SCALE_CHANNELS], channel)) {\n const { orient, type } = markDef;\n if (contains(['bar', 'area', 'line', 'trail'], type)) {\n if ((orient === 'horizontal' && channel === 'y') || (orient === 'vertical' && channel === 'x')) {\n return false;\n }\n }\n return true;\n }\n return false;\n}\n//# sourceMappingURL=properties.js.map","import { SCALE_CHANNELS, SHAPE } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { GEOSHAPE } from '../../mark';\nimport { NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES, scaleCompatible, scaleTypePrecedence } from '../../scale';\nimport { GEOJSON } from '../../type';\nimport { keys } from '../../util';\nimport { isUnitModel } from '../model';\nimport { defaultScaleResolve } from '../resolve';\nimport { mergeValuesWithExplicit, tieBreakByComparing } from '../split';\nimport { ScaleComponent } from './component';\nimport { parseScaleDomain } from './domain';\nimport { parseScaleProperty, parseScaleRange } from './properties';\nimport { scaleType } from './type';\nexport function parseScales(model, { ignoreRange } = {}) {\n parseScaleCore(model);\n parseScaleDomain(model);\n for (const prop of NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES) {\n parseScaleProperty(model, prop);\n }\n if (!ignoreRange) {\n // range depends on zero\n parseScaleRange(model);\n }\n}\nexport function parseScaleCore(model) {\n if (isUnitModel(model)) {\n model.component.scales = parseUnitScaleCore(model);\n }\n else {\n model.component.scales = parseNonUnitScaleCore(model);\n }\n}\n/**\n * Parse scales for all channels of a model.\n */\nfunction parseUnitScaleCore(model) {\n const { encoding, mark } = model;\n return SCALE_CHANNELS.reduce((scaleComponents, channel) => {\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]); // must be typed def to have scale\n // Don't generate scale for shape of geoshape\n if (fieldOrDatumDef && mark === GEOSHAPE && channel === SHAPE && fieldOrDatumDef.type === GEOJSON) {\n return scaleComponents;\n }\n let specifiedScale = fieldOrDatumDef && fieldOrDatumDef['scale'];\n if (fieldOrDatumDef && specifiedScale !== null && specifiedScale !== false) {\n specifiedScale = specifiedScale !== null && specifiedScale !== void 0 ? specifiedScale : {};\n const sType = scaleType(specifiedScale, channel, fieldOrDatumDef, mark);\n scaleComponents[channel] = new ScaleComponent(model.scaleName(channel + '', true), {\n value: sType,\n explicit: specifiedScale.type === sType\n });\n }\n return scaleComponents;\n }, {});\n}\nconst scaleTypeTieBreaker = tieBreakByComparing((st1, st2) => scaleTypePrecedence(st1) - scaleTypePrecedence(st2));\nfunction parseNonUnitScaleCore(model) {\n var _a;\n const scaleComponents = (model.component.scales = {});\n const scaleTypeWithExplicitIndex = {};\n const resolve = model.component.resolve;\n // Parse each child scale and determine if a particular channel can be merged.\n for (const child of model.children) {\n parseScaleCore(child);\n // Instead of always merging right away -- check if it is compatible to merge first!\n for (const channel of keys(child.component.scales)) {\n // if resolve is undefined, set default first\n resolve.scale[channel] = (_a = resolve.scale[channel]) !== null && _a !== void 0 ? _a : defaultScaleResolve(channel, model);\n if (resolve.scale[channel] === 'shared') {\n const explicitScaleType = scaleTypeWithExplicitIndex[channel];\n const childScaleType = child.component.scales[channel].getWithExplicit('type');\n if (explicitScaleType) {\n if (scaleCompatible(explicitScaleType.value, childScaleType.value)) {\n // merge scale component if type are compatible\n scaleTypeWithExplicitIndex[channel] = mergeValuesWithExplicit(explicitScaleType, childScaleType, 'type', 'scale', scaleTypeTieBreaker);\n }\n else {\n // Otherwise, update conflicting channel to be independent\n resolve.scale[channel] = 'independent';\n // Remove from the index so they don't get merged\n delete scaleTypeWithExplicitIndex[channel];\n }\n }\n else {\n scaleTypeWithExplicitIndex[channel] = childScaleType;\n }\n }\n }\n }\n // Merge each channel listed in the index\n for (const channel of keys(scaleTypeWithExplicitIndex)) {\n // Create new merged scale component\n const name = model.scaleName(channel, true);\n const typeWithExplicit = scaleTypeWithExplicitIndex[channel];\n scaleComponents[channel] = new ScaleComponent(name, typeWithExplicit);\n // rename each child and mark them as merged\n for (const child of model.children) {\n const childScale = child.component.scales[channel];\n if (childScale) {\n child.renameScale(childScale.get('name'), name);\n childScale.merged = true;\n }\n }\n }\n return scaleComponents;\n}\n//# sourceMappingURL=parse.js.map","import { isBinning } from '../../bin';\nimport { isColorChannel, isScaleChannel, rangeType } from '../../channel';\nimport { isFieldDef, isPositionFieldOrDatumDef } from '../../channeldef';\nimport * as log from '../../log';\nimport { channelSupportScaleType, scaleTypeSupportDataType } from '../../scale';\nimport { normalizeTimeUnit } from '../../timeunit';\nimport * as util from '../../util';\nimport { POLAR_POSITION_SCALE_CHANNEL_INDEX, POSITION_SCALE_CHANNEL_INDEX } from './../../channel';\n/**\n * Determine if there is a specified scale type and if it is appropriate,\n * or determine default type if type is unspecified or inappropriate.\n */\n// NOTE: CompassQL uses this method.\nexport function scaleType(specifiedScale, channel, fieldDef, mark) {\n const defaultScaleType = defaultType(channel, fieldDef, mark);\n const { type } = specifiedScale;\n if (!isScaleChannel(channel)) {\n // There is no scale for these channels\n return null;\n }\n if (type !== undefined) {\n // Check if explicitly specified scale type is supported by the channel\n if (!channelSupportScaleType(channel, type)) {\n log.warn(log.message.scaleTypeNotWorkWithChannel(channel, type, defaultScaleType));\n return defaultScaleType;\n }\n // Check if explicitly specified scale type is supported by the data type\n if (isFieldDef(fieldDef) && !scaleTypeSupportDataType(type, fieldDef.type)) {\n log.warn(log.message.scaleTypeNotWorkWithFieldDef(type, defaultScaleType));\n return defaultScaleType;\n }\n return type;\n }\n return defaultScaleType;\n}\n/**\n * Determine appropriate default scale type.\n */\n// NOTE: Voyager uses this method.\nfunction defaultType(channel, fieldDef, mark) {\n var _a;\n switch (fieldDef.type) {\n case 'nominal':\n case 'ordinal':\n if (isColorChannel(channel) || rangeType(channel) === 'discrete') {\n if (channel === 'shape' && fieldDef.type === 'ordinal') {\n log.warn(log.message.discreteChannelCannotEncode(channel, 'ordinal'));\n }\n return 'ordinal';\n }\n if (channel in POSITION_SCALE_CHANNEL_INDEX) {\n if (util.contains(['rect', 'bar', 'image', 'rule'], mark)) {\n // The rect/bar mark should fit into a band.\n // For rule, using band scale to make rule align with axis ticks better https://github.com/vega/vega-lite/issues/3429\n return 'band';\n }\n }\n else if (mark === 'arc' && channel in POLAR_POSITION_SCALE_CHANNEL_INDEX) {\n return 'band';\n }\n if (fieldDef.band !== undefined || (isPositionFieldOrDatumDef(fieldDef) && ((_a = fieldDef.axis) === null || _a === void 0 ? void 0 : _a.tickBand))) {\n return 'band';\n }\n // Otherwise, use ordinal point scale so we can easily get center positions of the marks.\n return 'point';\n case 'temporal':\n if (isColorChannel(channel)) {\n return 'time';\n }\n else if (rangeType(channel) === 'discrete') {\n log.warn(log.message.discreteChannelCannotEncode(channel, 'temporal'));\n // TODO: consider using quantize (equivalent to binning) once we have it\n return 'ordinal';\n }\n else if (isFieldDef(fieldDef) && fieldDef.timeUnit && normalizeTimeUnit(fieldDef.timeUnit).utc) {\n return 'utc';\n }\n return 'time';\n case 'quantitative':\n if (isColorChannel(channel)) {\n if (isFieldDef(fieldDef) && isBinning(fieldDef.bin)) {\n return 'bin-ordinal';\n }\n return 'linear';\n }\n else if (rangeType(channel) === 'discrete') {\n log.warn(log.message.discreteChannelCannotEncode(channel, 'quantitative'));\n // TODO: consider using quantize (equivalent to binning) once we have it\n return 'ordinal';\n }\n return 'linear';\n case 'geojson':\n return undefined;\n }\n /* istanbul ignore next: should never reach this */\n throw new Error(log.message.invalidFieldType(fieldDef.type));\n}\n//# sourceMappingURL=type.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { FACET_CHANNELS, getPositionScaleChannel, isChannel, isScaleChannel } from '../channel';\nimport { getFieldDef, vgField } from '../channeldef';\nimport { DataSourceType } from '../data';\nimport { forEach, reduce } from '../encoding';\nimport { replaceExprRefInIndex } from '../expr';\nimport * as log from '../log';\nimport { hasDiscreteDomain } from '../scale';\nimport { isFacetSpec } from '../spec';\nimport { extractCompositionLayout } from '../spec/base';\nimport { extractTitleConfig, isText } from '../title';\nimport { normalizeTransform } from '../transform';\nimport { contains, duplicate, isEmpty, keys, varName } from '../util';\nimport { isVgRangeStep } from '../vega.schema';\nimport { assembleAxes } from './axis/assemble';\nimport { signalOrValueRef, signalRefOrValue } from './common';\nimport { assembleHeaderGroups, assembleLayoutTitleBand, assembleTitleGroup } from './header/assemble';\nimport { HEADER_CHANNELS } from './header/component';\nimport { sizeExpr } from './layoutsize/assemble';\nimport { getSizeTypeFromLayoutSizeType } from './layoutsize/component';\nimport { assembleLegends } from './legend/assemble';\nimport { parseLegend } from './legend/parse';\nimport { assembleProjections } from './projection/assemble';\nimport { parseProjection } from './projection/parse';\nimport { assembleScales } from './scale/assemble';\nimport { assembleDomain, getFieldFromDomain } from './scale/domain';\nimport { parseScales } from './scale/parse';\nimport { Split } from './split';\nexport class NameMap {\n constructor() {\n this.nameMap = {};\n }\n rename(oldName, newName) {\n this.nameMap[oldName] = newName;\n }\n has(name) {\n return this.nameMap[name] !== undefined;\n }\n get(name) {\n // If the name appears in the _nameMap, we need to read its new name.\n // We have to loop over the dict just in case the new name also gets renamed.\n while (this.nameMap[name] && name !== this.nameMap[name]) {\n name = this.nameMap[name];\n }\n return name;\n }\n}\n/*\n We use type guards instead of `instanceof` as `instanceof` makes\n different parts of the compiler depend on the actual implementation of\n the model classes, which in turn depend on different parts of the compiler.\n Thus, `instanceof` leads to circular dependency problems.\n\n On the other hand, type guards only make different parts of the compiler\n depend on the type of the model classes, but not the actual implementation.\n*/\nexport function isUnitModel(model) {\n return (model === null || model === void 0 ? void 0 : model.type) === 'unit';\n}\nexport function isFacetModel(model) {\n return (model === null || model === void 0 ? void 0 : model.type) === 'facet';\n}\nexport function isConcatModel(model) {\n return (model === null || model === void 0 ? void 0 : model.type) === 'concat';\n}\nexport function isLayerModel(model) {\n return (model === null || model === void 0 ? void 0 : model.type) === 'layer';\n}\nexport class Model {\n constructor(spec, type, parent, parentGivenName, config, resolve, view) {\n var _a, _b;\n this.type = type;\n this.parent = parent;\n this.config = config;\n this.children = [];\n /**\n * Corrects the data references in marks after assemble.\n */\n this.correctDataNames = (mark) => {\n // TODO: make this correct\n // for normal data references\n if (mark.from && mark.from.data) {\n mark.from.data = this.lookupDataSource(mark.from.data);\n }\n // for access to facet data\n if (mark.from && mark.from.facet && mark.from.facet.data) {\n mark.from.facet.data = this.lookupDataSource(mark.from.facet.data);\n }\n return mark;\n };\n this.parent = parent;\n this.config = config;\n this.view = replaceExprRefInIndex(view);\n // If name is not provided, always use parent's givenName to avoid name conflicts.\n this.name = (_a = spec.name) !== null && _a !== void 0 ? _a : parentGivenName;\n this.title = isText(spec.title) ? { text: spec.title } : spec.title ? this.initTitle(spec.title) : undefined;\n // Shared name maps\n this.scaleNameMap = parent ? parent.scaleNameMap : new NameMap();\n this.projectionNameMap = parent ? parent.projectionNameMap : new NameMap();\n this.signalNameMap = parent ? parent.signalNameMap : new NameMap();\n this.data = spec.data;\n this.description = spec.description;\n this.transforms = normalizeTransform((_b = spec.transform) !== null && _b !== void 0 ? _b : []);\n this.layout = type === 'layer' || type === 'unit' ? {} : extractCompositionLayout(spec, type, config);\n this.component = {\n data: {\n sources: parent ? parent.component.data.sources : [],\n outputNodes: parent ? parent.component.data.outputNodes : {},\n outputNodeRefCounts: parent ? parent.component.data.outputNodeRefCounts : {},\n // data is faceted if the spec is a facet spec or the parent has faceted data and data is undefined\n isFaceted: isFacetSpec(spec) || (parent && parent.component.data.isFaceted && spec.data === undefined)\n },\n layoutSize: new Split(),\n layoutHeaders: { row: {}, column: {}, facet: {} },\n mark: null,\n resolve: Object.assign({ scale: {}, axis: {}, legend: {} }, (resolve ? duplicate(resolve) : {})),\n selection: null,\n scales: null,\n projection: null,\n axes: {},\n legends: {}\n };\n }\n initTitle(title) {\n const props = keys(title);\n const titleInternal = {\n text: signalRefOrValue(title.text)\n };\n for (const prop of props) {\n titleInternal[prop] = signalRefOrValue(title[prop]);\n }\n return titleInternal;\n }\n get width() {\n return this.getSizeSignalRef('width');\n }\n get height() {\n return this.getSizeSignalRef('height');\n }\n parse() {\n this.parseScale();\n this.parseLayoutSize(); // depends on scale\n this.renameTopLevelLayoutSizeSignal();\n this.parseSelections();\n this.parseProjection();\n this.parseData(); // (pathorder) depends on markDef; selection filters depend on parsed selections; depends on projection because some transforms require the finalized projection name.\n this.parseAxesAndHeaders(); // depends on scale and layout size\n this.parseLegends(); // depends on scale, markDef\n this.parseMarkGroup(); // depends on data name, scale, layout size, axisGroup, and children's scale, axis, legend and mark.\n }\n parseScale() {\n parseScales(this);\n }\n parseProjection() {\n parseProjection(this);\n }\n /**\n * Rename top-level spec's size to be just width / height, ignoring model name.\n * This essentially merges the top-level spec's width/height signals with the width/height signals\n * to help us reduce redundant signals declaration.\n */\n renameTopLevelLayoutSizeSignal() {\n if (this.getName('width') !== 'width') {\n this.renameSignal(this.getName('width'), 'width');\n }\n if (this.getName('height') !== 'height') {\n this.renameSignal(this.getName('height'), 'height');\n }\n }\n parseLegends() {\n parseLegend(this);\n }\n assembleGroupStyle() {\n var _a, _b;\n if (this.type === 'unit' || this.type === 'layer') {\n return (_b = (_a = this.view) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : 'cell';\n }\n return undefined;\n }\n assembleEncodeFromView(view) {\n // Exclude \"style\"\n const { style: _ } = view, baseView = __rest(view, [\"style\"]);\n const e = {};\n for (const property of keys(baseView)) {\n const value = baseView[property];\n if (value !== undefined) {\n e[property] = signalOrValueRef(value);\n }\n }\n return e;\n }\n assembleGroupEncodeEntry(isTopLevel) {\n let encodeEntry = {};\n if (this.view) {\n encodeEntry = this.assembleEncodeFromView(this.view);\n }\n if (!isTopLevel) {\n // Descriptions are already added to the top-level description so we only need to add them to the inner views.\n if (this.description) {\n encodeEntry['description'] = signalOrValueRef(this.description);\n }\n // For top-level spec, we can set the global width and height signal to adjust the group size.\n // For other child specs, we have to manually set width and height in the encode entry.\n if (this.type === 'unit' || this.type === 'layer') {\n return Object.assign({ width: this.getSizeSignalRef('width'), height: this.getSizeSignalRef('height') }, (encodeEntry !== null && encodeEntry !== void 0 ? encodeEntry : {}));\n }\n }\n return isEmpty(encodeEntry) ? undefined : encodeEntry;\n }\n assembleLayout() {\n if (!this.layout) {\n return undefined;\n }\n const _a = this.layout, { spacing } = _a, layout = __rest(_a, [\"spacing\"]);\n const { component, config } = this;\n const titleBand = assembleLayoutTitleBand(component.layoutHeaders, config);\n return Object.assign(Object.assign(Object.assign({ padding: spacing }, this.assembleDefaultLayout()), layout), (titleBand ? { titleBand } : {}));\n }\n assembleDefaultLayout() {\n return {};\n }\n assembleHeaderMarks() {\n const { layoutHeaders } = this.component;\n let headerMarks = [];\n for (const channel of FACET_CHANNELS) {\n if (layoutHeaders[channel].title) {\n headerMarks.push(assembleTitleGroup(this, channel));\n }\n }\n for (const channel of HEADER_CHANNELS) {\n headerMarks = headerMarks.concat(assembleHeaderGroups(this, channel));\n }\n return headerMarks;\n }\n assembleAxes() {\n return assembleAxes(this.component.axes, this.config);\n }\n assembleLegends() {\n return assembleLegends(this);\n }\n assembleProjections() {\n return assembleProjections(this);\n }\n assembleTitle() {\n var _a, _b, _c;\n const _d = (_a = this.title) !== null && _a !== void 0 ? _a : {}, { encoding } = _d, titleNoEncoding = __rest(_d, [\"encoding\"]);\n const title = Object.assign(Object.assign(Object.assign({}, extractTitleConfig(this.config.title).nonMark), titleNoEncoding), (encoding ? { encode: { update: encoding } } : {}));\n if (title.text) {\n if (contains(['unit', 'layer'], this.type)) {\n // Unit/Layer\n if (contains(['middle', undefined], title.anchor)) {\n title.frame = (_b = title.frame) !== null && _b !== void 0 ? _b : 'group';\n }\n }\n else {\n // composition with Vega layout\n // Set title = \"start\" by default for composition as \"middle\" does not look nice\n // https://github.com/vega/vega/issues/960#issuecomment-471360328\n title.anchor = (_c = title.anchor) !== null && _c !== void 0 ? _c : 'start';\n }\n return isEmpty(title) ? undefined : title;\n }\n return undefined;\n }\n /**\n * Assemble the mark group for this model. We accept optional `signals` so that we can include concat top-level signals with the top-level model's local signals.\n */\n assembleGroup(signals = []) {\n const group = {};\n signals = signals.concat(this.assembleSignals());\n if (signals.length > 0) {\n group.signals = signals;\n }\n const layout = this.assembleLayout();\n if (layout) {\n group.layout = layout;\n }\n group.marks = [].concat(this.assembleHeaderMarks(), this.assembleMarks());\n // Only include scales if this spec is top-level or if parent is facet.\n // (Otherwise, it will be merged with upper-level's scope.)\n const scales = !this.parent || isFacetModel(this.parent) ? assembleScales(this) : [];\n if (scales.length > 0) {\n group.scales = scales;\n }\n const axes = this.assembleAxes();\n if (axes.length > 0) {\n group.axes = axes;\n }\n const legends = this.assembleLegends();\n if (legends.length > 0) {\n group.legends = legends;\n }\n return group;\n }\n getName(text) {\n return varName((this.name ? this.name + '_' : '') + text);\n }\n getDataName(type) {\n return this.getName(DataSourceType[type].toLowerCase());\n }\n /**\n * Request a data source name for the given data source type and mark that data source as required.\n * This method should be called in parse, so that all used data source can be correctly instantiated in assembleData().\n * You can lookup the correct dataset name in assemble with `lookupDataSource`.\n */\n requestDataName(name) {\n const fullName = this.getDataName(name);\n // Increase ref count. This is critical because otherwise we won't create a data source.\n // We also increase the ref counts on OutputNode.getSource() calls.\n const refCounts = this.component.data.outputNodeRefCounts;\n refCounts[fullName] = (refCounts[fullName] || 0) + 1;\n return fullName;\n }\n getSizeSignalRef(layoutSizeType) {\n if (isFacetModel(this.parent)) {\n const sizeType = getSizeTypeFromLayoutSizeType(layoutSizeType);\n const channel = getPositionScaleChannel(sizeType);\n const scaleComponent = this.component.scales[channel];\n if (scaleComponent && !scaleComponent.merged) {\n // independent scale\n const type = scaleComponent.get('type');\n const range = scaleComponent.get('range');\n if (hasDiscreteDomain(type) && isVgRangeStep(range)) {\n const scaleName = scaleComponent.get('name');\n const domain = assembleDomain(this, channel);\n const field = getFieldFromDomain(domain);\n if (field) {\n const fieldRef = vgField({ aggregate: 'distinct', field }, { expr: 'datum' });\n return {\n signal: sizeExpr(scaleName, scaleComponent, fieldRef)\n };\n }\n else {\n log.warn(log.message.unknownField(channel));\n return null;\n }\n }\n }\n }\n return {\n signal: this.signalNameMap.get(this.getName(layoutSizeType))\n };\n }\n /**\n * Lookup the name of the datasource for an output node. You probably want to call this in assemble.\n */\n lookupDataSource(name) {\n const node = this.component.data.outputNodes[name];\n if (!node) {\n // Name not found in map so let's just return what we got.\n // This can happen if we already have the correct name.\n return name;\n }\n return node.getSource();\n }\n getSignalName(oldSignalName) {\n return this.signalNameMap.get(oldSignalName);\n }\n renameSignal(oldName, newName) {\n this.signalNameMap.rename(oldName, newName);\n }\n renameScale(oldName, newName) {\n this.scaleNameMap.rename(oldName, newName);\n }\n renameProjection(oldName, newName) {\n this.projectionNameMap.rename(oldName, newName);\n }\n /**\n * @return scale name for a given channel after the scale has been parsed and named.\n */\n scaleName(originalScaleName, parse) {\n if (parse) {\n // During the parse phase always return a value\n // No need to refer to rename map because a scale can't be renamed\n // before it has the original name.\n return this.getName(originalScaleName);\n }\n // If there is a scale for the channel, it should either\n // be in the scale component or exist in the name map\n if (\n // If there is a scale for the channel, there should be a local scale component for it\n (isChannel(originalScaleName) && isScaleChannel(originalScaleName) && this.component.scales[originalScaleName]) ||\n // in the scale name map (the scale get merged by its parent)\n this.scaleNameMap.has(this.getName(originalScaleName))) {\n return this.scaleNameMap.get(this.getName(originalScaleName));\n }\n return undefined;\n }\n /**\n * @return projection name after the projection has been parsed and named.\n */\n projectionName(parse) {\n if (parse) {\n // During the parse phase always return a value\n // No need to refer to rename map because a projection can't be renamed\n // before it has the original name.\n return this.getName('projection');\n }\n if ((this.component.projection && !this.component.projection.merged) ||\n this.projectionNameMap.has(this.getName('projection'))) {\n return this.projectionNameMap.get(this.getName('projection'));\n }\n return undefined;\n }\n /**\n * Traverse a model's hierarchy to get the scale component for a particular channel.\n */\n getScaleComponent(channel) {\n /* istanbul ignore next: This is warning for debugging test */\n if (!this.component.scales) {\n throw new Error('getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().');\n }\n const localScaleComponent = this.component.scales[channel];\n if (localScaleComponent && !localScaleComponent.merged) {\n return localScaleComponent;\n }\n return this.parent ? this.parent.getScaleComponent(channel) : undefined;\n }\n /**\n * Traverse a model's hierarchy to get a particular selection component.\n */\n getSelectionComponent(variableName, origName) {\n let sel = this.component.selection[variableName];\n if (!sel && this.parent) {\n sel = this.parent.getSelectionComponent(variableName, origName);\n }\n if (!sel) {\n throw new Error(log.message.selectionNotFound(origName));\n }\n return sel;\n }\n /**\n * Returns true if the model has a signalRef for an axis orient.\n */\n hasAxisOrientSignalRef() {\n var _a, _b;\n return (((_a = this.component.axes.x) === null || _a === void 0 ? void 0 : _a.some(a => a.hasOrientSignalRef())) || ((_b = this.component.axes.y) === null || _b === void 0 ? void 0 : _b.some(a => a.hasOrientSignalRef())));\n }\n}\n/** Abstract class for UnitModel and FacetModel. Both of which can contain fieldDefs as a part of its own specification. */\nexport class ModelWithField extends Model {\n /** Get \"field\" reference for Vega */\n vgField(channel, opt = {}) {\n const fieldDef = this.fieldDef(channel);\n if (!fieldDef) {\n return undefined;\n }\n return vgField(fieldDef, opt);\n }\n reduceFieldDef(f, init) {\n return reduce(this.getMapping(), (acc, cd, c) => {\n const fieldDef = getFieldDef(cd);\n if (fieldDef) {\n return f(acc, fieldDef, c);\n }\n return acc;\n }, init);\n }\n forEachFieldDef(f, t) {\n forEach(this.getMapping(), (cd, c) => {\n const fieldDef = getFieldDef(cd);\n if (fieldDef) {\n f(fieldDef, c);\n }\n }, t);\n }\n}\n//# sourceMappingURL=model.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for density transform nodes\n */\nexport class DensityTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : 'value', (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : 'density'];\n }\n clone() {\n return new DensityTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.density, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `DensityTransform ${hash(this.transform)}`;\n }\n assemble() {\n const _a = this.transform, { density } = _a, rest = __rest(_a, [\"density\"]);\n const result = Object.assign({ type: 'kde', field: density }, rest);\n return result;\n }\n}\n//# sourceMappingURL=density.js.map","import { isScaleChannel } from '../../channel';\nimport { vgField as fieldRef } from '../../channeldef';\nimport { isPathMark } from '../../mark';\nimport { hasContinuousDomain } from '../../scale';\nimport { hash, keys } from '../../util';\nimport { getMarkPropOrConfig } from '../common';\nimport { DataFlowNode } from './dataflow';\nexport class FilterInvalidNode extends DataFlowNode {\n constructor(parent, filter) {\n super(parent);\n this.filter = filter;\n }\n clone() {\n return new FilterInvalidNode(null, Object.assign({}, this.filter));\n }\n static make(parent, model) {\n const { config, mark, markDef } = model;\n const invalid = getMarkPropOrConfig('invalid', markDef, config);\n if (invalid !== 'filter') {\n return null;\n }\n const filter = model.reduceFieldDef((aggregator, fieldDef, channel) => {\n const scaleComponent = isScaleChannel(channel) && model.getScaleComponent(channel);\n if (scaleComponent) {\n const scaleType = scaleComponent.get('type');\n // While discrete domain scales can handle invalid values, continuous scales can't.\n // Thus, for non-path marks, we have to filter null for scales with continuous domains.\n // (For path marks, we will use \"defined\" property and skip these values instead.)\n if (hasContinuousDomain(scaleType) && fieldDef.aggregate !== 'count' && !isPathMark(mark)) {\n aggregator[fieldDef.field] = fieldDef; // we know that the fieldDef is a typed field def\n }\n }\n return aggregator;\n }, {});\n if (!keys(filter).length) {\n return null;\n }\n return new FilterInvalidNode(parent, filter);\n }\n dependentFields() {\n return new Set(keys(this.filter));\n }\n producedFields() {\n return new Set(); // filter does not produce any new fields\n }\n hash() {\n return `FilterInvalid ${hash(this.filter)}`;\n }\n /**\n * Create the VgTransforms for each of the filtered fields.\n */\n assemble() {\n const filters = keys(this.filter).reduce((vegaFilters, field) => {\n const fieldDef = this.filter[field];\n const ref = fieldRef(fieldDef, { expr: 'datum' });\n if (fieldDef !== null) {\n if (fieldDef.type === 'temporal') {\n vegaFilters.push(`(isDate(${ref}) || (isValid(${ref}) && isFinite(+${ref})))`);\n }\n else if (fieldDef.type === 'quantitative') {\n vegaFilters.push(`isValid(${ref})`);\n vegaFilters.push(`isFinite(+${ref})`);\n }\n else {\n // should never get here\n }\n }\n return vegaFilters;\n }, []);\n return filters.length > 0\n ? {\n type: 'filter',\n expr: filters.join(' && ')\n }\n : null;\n }\n}\n//# sourceMappingURL=filterinvalid.js.map","import { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for flatten transform nodes\n */\nexport class FlattenTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const { flatten, as = [] } = this.transform;\n this.transform.as = flatten.map((f, i) => { var _a; return (_a = as[i]) !== null && _a !== void 0 ? _a : f; });\n }\n clone() {\n return new FlattenTransformNode(this.parent, duplicate(this.transform));\n }\n dependentFields() {\n return new Set(this.transform.flatten);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `FlattenTransform ${hash(this.transform)}`;\n }\n assemble() {\n const { flatten: fields, as } = this.transform;\n const result = {\n type: 'flatten',\n fields,\n as\n };\n return result;\n }\n}\n//# sourceMappingURL=flatten.js.map","import { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for flatten transform nodes\n */\nexport class FoldTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : 'key', (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : 'value'];\n }\n clone() {\n return new FoldTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n return new Set(this.transform.fold);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `FoldTransform ${hash(this.transform)}`;\n }\n assemble() {\n const { fold, as } = this.transform;\n const result = {\n type: 'fold',\n fields: fold,\n as\n };\n return result;\n }\n}\n//# sourceMappingURL=fold.js.map","import { isString } from 'vega-util';\nimport { LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2, SHAPE } from '../../channel';\nimport { getFieldOrDatumDef, isDatumDef, isFieldDef, isValueDef } from '../../channeldef';\nimport { GEOJSON } from '../../type';\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class GeoJSONNode extends DataFlowNode {\n constructor(parent, fields, geojson, signal) {\n super(parent);\n this.fields = fields;\n this.geojson = geojson;\n this.signal = signal;\n }\n clone() {\n return new GeoJSONNode(null, duplicate(this.fields), this.geojson, this.signal);\n }\n static parseAll(parent, model) {\n if (model.component.projection && !model.component.projection.isFit) {\n return parent;\n }\n let geoJsonCounter = 0;\n for (const coordinates of [\n [LONGITUDE, LATITUDE],\n [LONGITUDE2, LATITUDE2]\n ]) {\n const pair = coordinates.map(channel => {\n const def = getFieldOrDatumDef(model.encoding[channel]);\n return isFieldDef(def)\n ? def.field\n : isDatumDef(def)\n ? { expr: `${def.datum}` }\n : isValueDef(def)\n ? { expr: `${def['value']}` }\n : undefined;\n });\n if (pair[0] || pair[1]) {\n parent = new GeoJSONNode(parent, pair, null, model.getName(`geojson_${geoJsonCounter++}`));\n }\n }\n if (model.channelHasField(SHAPE)) {\n const fieldDef = model.typedFieldDef(SHAPE);\n if (fieldDef.type === GEOJSON) {\n parent = new GeoJSONNode(parent, null, fieldDef.field, model.getName(`geojson_${geoJsonCounter++}`));\n }\n }\n return parent;\n }\n dependentFields() {\n var _a;\n const fields = ((_a = this.fields) !== null && _a !== void 0 ? _a : []).filter(isString);\n return new Set([...(this.geojson ? [this.geojson] : []), ...fields]);\n }\n producedFields() {\n return new Set();\n }\n hash() {\n return `GeoJSON ${this.geojson} ${this.signal} ${hash(this.fields)}`;\n }\n assemble() {\n return Object.assign(Object.assign(Object.assign({ type: 'geojson' }, (this.fields ? { fields: this.fields } : {})), (this.geojson ? { geojson: this.geojson } : {})), { signal: this.signal });\n }\n}\n//# sourceMappingURL=geojson.js.map","import { isString } from 'vega-util';\nimport { LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2 } from '../../channel';\nimport { getFieldOrDatumDef, isDatumDef, isFieldDef, isValueDef } from '../../channeldef';\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class GeoPointNode extends DataFlowNode {\n constructor(parent, projection, fields, as) {\n super(parent);\n this.projection = projection;\n this.fields = fields;\n this.as = as;\n }\n clone() {\n return new GeoPointNode(null, this.projection, duplicate(this.fields), duplicate(this.as));\n }\n static parseAll(parent, model) {\n if (!model.projectionName()) {\n return parent;\n }\n for (const coordinates of [\n [LONGITUDE, LATITUDE],\n [LONGITUDE2, LATITUDE2]\n ]) {\n const pair = coordinates.map(channel => {\n const def = getFieldOrDatumDef(model.encoding[channel]);\n return isFieldDef(def)\n ? def.field\n : isDatumDef(def)\n ? { expr: `${def.datum}` }\n : isValueDef(def)\n ? { expr: `${def['value']}` }\n : undefined;\n });\n const suffix = coordinates[0] === LONGITUDE2 ? '2' : '';\n if (pair[0] || pair[1]) {\n parent = new GeoPointNode(parent, model.projectionName(), pair, [\n model.getName('x' + suffix),\n model.getName('y' + suffix)\n ]);\n }\n }\n return parent;\n }\n dependentFields() {\n return new Set(this.fields.filter(isString));\n }\n producedFields() {\n return new Set(this.as);\n }\n hash() {\n return `Geopoint ${this.projection} ${hash(this.fields)} ${hash(this.as)}`;\n }\n assemble() {\n return {\n type: 'geopoint',\n projection: this.projection,\n fields: this.fields,\n as: this.as\n };\n }\n}\n//# sourceMappingURL=geopoint.js.map","import { isFieldDef } from '../../channeldef';\nimport { pathGroupingFields } from '../../encoding';\nimport { isImputeSequence } from '../../transform';\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class ImputeNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new ImputeNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.impute, this.transform.key, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set([this.transform.impute]);\n }\n processSequence(keyvals) {\n const { start = 0, stop, step } = keyvals;\n const result = [start, stop, ...(step ? [step] : [])].join(',');\n return { signal: `sequence(${result})` };\n }\n static makeFromTransform(parent, imputeTransform) {\n return new ImputeNode(parent, imputeTransform);\n }\n static makeFromEncoding(parent, model) {\n const encoding = model.encoding;\n const xDef = encoding.x;\n const yDef = encoding.y;\n if (isFieldDef(xDef) && isFieldDef(yDef)) {\n const imputedChannel = xDef.impute ? xDef : yDef.impute ? yDef : undefined;\n if (imputedChannel === undefined) {\n return undefined;\n }\n const keyChannel = xDef.impute ? yDef : yDef.impute ? xDef : undefined;\n const { method, value, frame, keyvals } = imputedChannel.impute;\n const groupbyFields = pathGroupingFields(model.mark, encoding);\n return new ImputeNode(parent, Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ impute: imputedChannel.field, key: keyChannel.field }, (method ? { method } : {})), (value !== undefined ? { value } : {})), (frame ? { frame } : {})), (keyvals !== undefined ? { keyvals } : {})), (groupbyFields.length ? { groupby: groupbyFields } : {})));\n }\n return null;\n }\n hash() {\n return `Impute ${hash(this.transform)}`;\n }\n assemble() {\n const { impute, key, keyvals, method, groupby, value, frame = [null, null] } = this.transform;\n const imputeTransform = Object.assign(Object.assign(Object.assign(Object.assign({ type: 'impute', field: impute, key }, (keyvals ? { keyvals: isImputeSequence(keyvals) ? this.processSequence(keyvals) : keyvals } : {})), { method: 'value' }), (groupby ? { groupby } : {})), { value: !method || method === 'value' ? value : null });\n if (method && method !== 'value') {\n const deriveNewField = Object.assign({ type: 'window', as: [`imputed_${impute}_value`], ops: [method], fields: [impute], frame, ignorePeers: false }, (groupby ? { groupby } : {}));\n const replaceOriginal = {\n type: 'formula',\n expr: `datum.${impute} === null ? datum.imputed_${impute}_value : datum.${impute}`,\n as: impute\n };\n return [imputeTransform, deriveNewField, replaceOriginal];\n }\n else {\n return [imputeTransform];\n }\n }\n}\n//# sourceMappingURL=impute.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for loess transform nodes\n */\nexport class LoessTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : transform.on, (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : transform.loess];\n }\n clone() {\n return new LoessTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.loess, this.transform.on, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `LoessTransform ${hash(this.transform)}`;\n }\n assemble() {\n const _a = this.transform, { loess, on } = _a, rest = __rest(_a, [\"loess\", \"on\"]);\n const result = Object.assign({ type: 'loess', x: on, y: loess }, rest);\n return result;\n }\n}\n//# sourceMappingURL=loess.js.map","import { array, isString } from 'vega-util';\nimport * as log from '../../log';\nimport { isLookupData, isLookupSelection } from '../../transform';\nimport { duplicate, hash, varName } from '../../util';\nimport { DataFlowNode, OutputNode } from './dataflow';\nimport { findSource } from './parse';\nimport { SourceNode } from './source';\nimport { DataSourceType } from '../../data';\nexport class LookupNode extends DataFlowNode {\n constructor(parent, transform, secondary) {\n super(parent);\n this.transform = transform;\n this.secondary = secondary;\n }\n clone() {\n return new LookupNode(null, duplicate(this.transform), this.secondary);\n }\n static make(parent, model, transform, counter) {\n const sources = model.component.data.sources;\n const { from } = transform;\n let fromOutputNode = null;\n if (isLookupData(from)) {\n let fromSource = findSource(from.data, sources);\n if (!fromSource) {\n fromSource = new SourceNode(from.data);\n sources.push(fromSource);\n }\n const fromOutputName = model.getName(`lookup_${counter}`);\n fromOutputNode = new OutputNode(fromSource, fromOutputName, DataSourceType.Lookup, model.component.data.outputNodeRefCounts);\n model.component.data.outputNodes[fromOutputName] = fromOutputNode;\n }\n else if (isLookupSelection(from)) {\n const selName = from.selection;\n transform = Object.assign({ as: selName }, transform);\n fromOutputNode = model.getSelectionComponent(varName(selName), selName).materialized;\n if (!fromOutputNode) {\n throw new Error(log.message.noSameUnitLookup(selName));\n }\n }\n return new LookupNode(parent, transform, fromOutputNode.getSource());\n }\n dependentFields() {\n return new Set([this.transform.lookup]);\n }\n producedFields() {\n return new Set(this.transform.as ? array(this.transform.as) : this.transform.from.fields);\n }\n hash() {\n return `Lookup ${hash({ transform: this.transform, secondary: this.secondary })}`;\n }\n assemble() {\n let foreign;\n if (this.transform.from.fields) {\n // lookup a few fields and add create a flat output\n foreign = Object.assign({ values: this.transform.from.fields }, (this.transform.as ? { as: array(this.transform.as) } : {}));\n }\n else {\n // lookup full record and nest it\n let asName = this.transform.as;\n if (!isString(asName)) {\n log.warn(log.message.NO_FIELDS_NEEDS_AS);\n asName = '_lookup';\n }\n foreign = {\n as: [asName]\n };\n }\n return Object.assign(Object.assign({ type: 'lookup', from: this.secondary, key: this.transform.from.key, fields: [this.transform.lookup] }, foreign), (this.transform.default ? { default: this.transform.default } : {}));\n }\n}\n//# sourceMappingURL=lookup.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for quantile transform nodes\n */\nexport class QuantileTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : 'prob', (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : 'value'];\n }\n clone() {\n return new QuantileTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.quantile, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `QuantileTransform ${hash(this.transform)}`;\n }\n assemble() {\n const _a = this.transform, { quantile } = _a, rest = __rest(_a, [\"quantile\"]);\n const result = Object.assign({ type: 'quantile', field: quantile }, rest);\n return result;\n }\n}\n//# sourceMappingURL=quantile.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for regression transform nodes\n */\nexport class RegressionTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : transform.on, (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : transform.regression];\n }\n clone() {\n return new RegressionTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.regression, this.transform.on, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `RegressionTransform ${hash(this.transform)}`;\n }\n assemble() {\n const _a = this.transform, { regression, on } = _a, rest = __rest(_a, [\"regression\", \"on\"]);\n const result = Object.assign({ type: 'regression', x: on, y: regression }, rest);\n return result;\n }\n}\n//# sourceMappingURL=regression.js.map","import { duplicate, hash, unique } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for pivot transform nodes.\n */\nexport class PivotTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new PivotTransformNode(null, duplicate(this.transform));\n }\n addDimensions(fields) {\n var _a;\n this.transform.groupby = unique(((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : []).concat(fields), d => d);\n }\n producedFields() {\n return undefined; // return undefined so that potentially everything can depend on the pivot\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.pivot, this.transform.value, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n hash() {\n return `PivotTransform ${hash(this.transform)}`;\n }\n assemble() {\n const { pivot, value, groupby, limit, op } = this.transform;\n return Object.assign(Object.assign(Object.assign({ type: 'pivot', field: pivot, value }, (limit !== undefined ? { limit } : {})), (op !== undefined ? { op } : {})), (groupby !== undefined ? { groupby } : {}));\n }\n}\n//# sourceMappingURL=pivot.js.map","import { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for the sample transform nodes\n */\nexport class SampleTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new SampleTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return new Set();\n }\n hash() {\n return `SampleTransform ${hash(this.transform)}`;\n }\n assemble() {\n return {\n type: 'sample',\n size: this.transform.sample\n };\n }\n}\n//# sourceMappingURL=sample.js.map","import { isUrlData } from '../../data';\nimport { AggregateNode } from './aggregate';\nimport { BinNode } from './bin';\nimport { CalculateNode } from './calculate';\nimport { OutputNode } from './dataflow';\nimport { DensityTransformNode } from './density';\nimport { FacetNode } from './facet';\nimport { FilterNode } from './filter';\nimport { FilterInvalidNode } from './filterinvalid';\nimport { FlattenTransformNode } from './flatten';\nimport { FoldTransformNode } from './fold';\nimport { ParseNode } from './formatparse';\nimport { GeoJSONNode } from './geojson';\nimport { GeoPointNode } from './geopoint';\nimport { GraticuleNode } from './graticule';\nimport { IdentifierNode } from './identifier';\nimport { ImputeNode } from './impute';\nimport { JoinAggregateTransformNode } from './joinaggregate';\nimport { LoessTransformNode } from './loess';\nimport { LookupNode } from './lookup';\nimport { QuantileTransformNode } from './quantile';\nimport { RegressionTransformNode } from './regression';\nimport { PivotTransformNode } from './pivot';\nimport { SampleTransformNode } from './sample';\nimport { SequenceNode } from './sequence';\nimport { SourceNode } from './source';\nimport { StackNode } from './stack';\nimport { TimeUnitNode } from './timeunit';\nimport { WindowTransformNode } from './window';\nfunction makeWalkTree(data) {\n // to name datasources\n let datasetIndex = 0;\n /**\n * Recursively walk down the tree.\n */\n function walkTree(node, dataSource) {\n var _a;\n if (node instanceof SourceNode) {\n // If the source is a named data source or a data source with values, we need\n // to put it in a different data source. Otherwise, Vega may override the data.\n if (!node.isGenerator && !isUrlData(node.data)) {\n data.push(dataSource);\n const newData = {\n name: null,\n source: dataSource.name,\n transform: []\n };\n dataSource = newData;\n }\n }\n if (node instanceof ParseNode) {\n if (node.parent instanceof SourceNode && !dataSource.source) {\n // If node's parent is a root source and the data source does not refer to another data source, use normal format parse\n dataSource.format = Object.assign(Object.assign({}, ((_a = dataSource.format) !== null && _a !== void 0 ? _a : {})), { parse: node.assembleFormatParse() });\n // add calculates for all nested fields\n dataSource.transform.push(...node.assembleTransforms(true));\n }\n else {\n // Otherwise use Vega expression to parse\n dataSource.transform.push(...node.assembleTransforms());\n }\n }\n if (node instanceof FacetNode) {\n if (!dataSource.name) {\n dataSource.name = `data_${datasetIndex++}`;\n }\n if (!dataSource.source || dataSource.transform.length > 0) {\n data.push(dataSource);\n node.data = dataSource.name;\n }\n else {\n node.data = dataSource.source;\n }\n for (const d of node.assemble()) {\n data.push(d);\n }\n // break here because the rest of the tree has to be taken care of by the facet.\n return;\n }\n if (node instanceof GraticuleNode ||\n node instanceof SequenceNode ||\n node instanceof FilterInvalidNode ||\n node instanceof FilterNode ||\n node instanceof CalculateNode ||\n node instanceof GeoPointNode ||\n node instanceof GeoJSONNode ||\n node instanceof AggregateNode ||\n node instanceof LookupNode ||\n node instanceof WindowTransformNode ||\n node instanceof JoinAggregateTransformNode ||\n node instanceof FoldTransformNode ||\n node instanceof FlattenTransformNode ||\n node instanceof DensityTransformNode ||\n node instanceof LoessTransformNode ||\n node instanceof QuantileTransformNode ||\n node instanceof RegressionTransformNode ||\n node instanceof IdentifierNode ||\n node instanceof SampleTransformNode ||\n node instanceof PivotTransformNode) {\n dataSource.transform.push(node.assemble());\n }\n if (node instanceof BinNode ||\n node instanceof TimeUnitNode ||\n node instanceof ImputeNode ||\n node instanceof StackNode) {\n dataSource.transform.push(...node.assemble());\n }\n if (node instanceof OutputNode) {\n if (dataSource.source && dataSource.transform.length === 0) {\n node.setSource(dataSource.source);\n }\n else if (node.parent instanceof OutputNode) {\n // Note that an output node may be required but we still do not assemble a\n // separate data source for it.\n node.setSource(dataSource.name);\n }\n else {\n if (!dataSource.name) {\n dataSource.name = `data_${datasetIndex++}`;\n }\n // Here we set the name of the datasource we generated. From now on\n // other assemblers can use it.\n node.setSource(dataSource.name);\n // if this node has more than one child, we will add a datasource automatically\n if (node.numChildren() === 1) {\n data.push(dataSource);\n const newData = {\n name: null,\n source: dataSource.name,\n transform: []\n };\n dataSource = newData;\n }\n }\n }\n switch (node.numChildren()) {\n case 0:\n // done\n if (node instanceof OutputNode && (!dataSource.source || dataSource.transform.length > 0)) {\n // do not push empty datasources that are simply references\n data.push(dataSource);\n }\n break;\n case 1:\n walkTree(node.children[0], dataSource);\n break;\n default: {\n if (!dataSource.name) {\n dataSource.name = `data_${datasetIndex++}`;\n }\n let source = dataSource.name;\n if (!dataSource.source || dataSource.transform.length > 0) {\n data.push(dataSource);\n }\n else {\n source = dataSource.source;\n }\n for (const child of node.children) {\n const newData = {\n name: null,\n source: source,\n transform: []\n };\n walkTree(child, newData);\n }\n break;\n }\n }\n }\n return walkTree;\n}\n/**\n * Assemble data sources that are derived from faceted data.\n */\nexport function assembleFacetData(root) {\n const data = [];\n const walkTree = makeWalkTree(data);\n for (const child of root.children) {\n walkTree(child, {\n source: root.name,\n name: null,\n transform: []\n });\n }\n return data;\n}\n/**\n * Create Vega data array from a given compiled model and append all of them to the given array\n *\n * @param model\n * @param data array\n * @return modified data array\n */\nexport function assembleRootData(dataComponent, datasets) {\n var _a, _b;\n const data = [];\n // dataComponent.sources.forEach(debug);\n // draw(dataComponent.sources);\n const walkTree = makeWalkTree(data);\n let sourceIndex = 0;\n for (const root of dataComponent.sources) {\n // assign a name if the source does not have a name yet\n if (!root.hasName()) {\n root.dataName = `source_${sourceIndex++}`;\n }\n const newData = root.assemble();\n walkTree(root, newData);\n }\n // remove empty transform arrays for cleaner output\n for (const d of data) {\n if (d.transform.length === 0) {\n delete d.transform;\n }\n }\n // move sources without transforms (the ones that are potentially used in lookups) to the beginning\n let whereTo = 0;\n for (const [i, d] of data.entries()) {\n if (((_a = d.transform) !== null && _a !== void 0 ? _a : []).length === 0 && !d.source) {\n data.splice(whereTo++, 0, data.splice(i, 1)[0]);\n }\n }\n // now fix the from references in lookup transforms\n for (const d of data) {\n for (const t of (_b = d.transform) !== null && _b !== void 0 ? _b : []) {\n if (t.type === 'lookup') {\n t.from = dataComponent.outputNodes[t.from].getSource();\n }\n }\n }\n // inline values for datasets that are in the datastore\n for (const d of data) {\n if (d.name in datasets) {\n d.values = datasets[d.name];\n }\n }\n return data;\n}\n//# sourceMappingURL=assemble.js.map","import { isArray } from 'vega-util';\nimport { FACET_CHANNELS } from '../../channel';\nimport { title as fieldDefTitle } from '../../channeldef';\nimport { contains, getFirstDefined } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { assembleAxis } from '../axis/assemble';\nimport { parseGuideResolve } from '../resolve';\nimport { getHeaderProperty } from './common';\nexport function getHeaderType(orient) {\n if (orient === 'top' || orient === 'left' || isSignalRef(orient)) {\n // we always use header for orient signal since we can't dynamically make header becomes footer\n return 'header';\n }\n return 'footer';\n}\nexport function parseFacetHeaders(model) {\n for (const channel of FACET_CHANNELS) {\n parseFacetHeader(model, channel);\n }\n mergeChildAxis(model, 'x');\n mergeChildAxis(model, 'y');\n}\nfunction parseFacetHeader(model, channel) {\n var _a;\n const { facet, config, child, component } = model;\n if (model.channelHasField(channel)) {\n const fieldDef = facet[channel];\n const titleConfig = getHeaderProperty('title', null, config, channel);\n let title = fieldDefTitle(fieldDef, config, {\n allowDisabling: true,\n includeDefault: titleConfig === undefined || !!titleConfig\n });\n if (child.component.layoutHeaders[channel].title) {\n // TODO: better handle multiline titles\n title = isArray(title) ? title.join(', ') : title;\n // merge title with child to produce \"Title / Subtitle / Sub-subtitle\"\n title += ' / ' + child.component.layoutHeaders[channel].title;\n child.component.layoutHeaders[channel].title = null;\n }\n const labelOrient = getHeaderProperty('labelOrient', fieldDef, config, channel);\n const header = (_a = fieldDef.header) !== null && _a !== void 0 ? _a : {};\n const labels = getFirstDefined(header.labels, config.header.labels, true);\n const headerType = contains(['bottom', 'right'], labelOrient) ? 'footer' : 'header';\n component.layoutHeaders[channel] = {\n title,\n facetFieldDef: fieldDef,\n [headerType]: channel === 'facet' ? [] : [makeHeaderComponent(model, channel, labels)]\n };\n }\n}\nfunction makeHeaderComponent(model, channel, labels) {\n const sizeType = channel === 'row' ? 'height' : 'width';\n return {\n labels,\n sizeSignal: model.child.component.layoutSize.get(sizeType) ? model.child.getSizeSignalRef(sizeType) : undefined,\n axes: []\n };\n}\nfunction mergeChildAxis(model, channel) {\n var _a;\n const { child } = model;\n if (child.component.axes[channel]) {\n const { layoutHeaders, resolve } = model.component;\n resolve.axis[channel] = parseGuideResolve(resolve, channel);\n if (resolve.axis[channel] === 'shared') {\n // For shared axis, move the axes to facet's header or footer\n const headerChannel = channel === 'x' ? 'column' : 'row';\n const layoutHeader = layoutHeaders[headerChannel];\n for (const axisComponent of child.component.axes[channel]) {\n const headerType = getHeaderType(axisComponent.get('orient'));\n layoutHeader[headerType] = (_a = layoutHeader[headerType]) !== null && _a !== void 0 ? _a : [makeHeaderComponent(model, headerChannel, false)];\n // FIXME: assemble shouldn't be called here, but we do it this way so we only extract the main part of the axes\n const mainAxis = assembleAxis(axisComponent, 'main', model.config, { header: true });\n if (mainAxis) {\n // LayoutHeader no longer keep track of property precedence, thus let's combine.\n layoutHeader[headerType][0].axes.push(mainAxis);\n }\n axisComponent.mainExtracted = true;\n }\n }\n else {\n // Otherwise do nothing for independent axes\n }\n }\n}\n//# sourceMappingURL=parse.js.map","import { getPositionScaleChannel, getSizeChannel, POSITION_SCALE_CHANNELS } from '../../channel';\nimport { getViewConfigContinuousSize, getViewConfigDiscreteSize } from '../../config';\nimport { hasDiscreteDomain } from '../../scale';\nimport { isStep } from '../../spec/base';\nimport { isVgRangeStep } from '../../vega.schema';\nimport { mergeValuesWithExplicit } from '../split';\nimport { getSizeTypeFromLayoutSizeType } from './component';\nexport function parseLayerLayoutSize(model) {\n parseChildrenLayoutSize(model);\n parseNonUnitLayoutSizeForChannel(model, 'width');\n parseNonUnitLayoutSizeForChannel(model, 'height');\n}\nexport const parseRepeatLayoutSize = parseConcatLayoutSize;\nexport function parseConcatLayoutSize(model) {\n parseChildrenLayoutSize(model);\n // for columns === 1 (vconcat), we can completely merge width. Otherwise, we can treat merged width as childWidth.\n const widthType = model.layout.columns === 1 ? 'width' : 'childWidth';\n // for columns === undefined (hconcat), we can completely merge height. Otherwise, we can treat merged height as childHeight.\n const heightType = model.layout.columns === undefined ? 'height' : 'childHeight';\n parseNonUnitLayoutSizeForChannel(model, widthType);\n parseNonUnitLayoutSizeForChannel(model, heightType);\n}\nexport function parseChildrenLayoutSize(model) {\n for (const child of model.children) {\n child.parseLayoutSize();\n }\n}\n/**\n * Merge child layout size (width or height).\n */\nfunction parseNonUnitLayoutSizeForChannel(model, layoutSizeType) {\n /*\n * For concat, the parent width or height might not be the same as the children's shared height.\n * For example, hconcat's subviews may share width, but the shared width is not the hconcat view's width.\n *\n * layoutSizeType represents the output of the view (could be childWidth/childHeight/width/height)\n * while the sizeType represents the properties of the child.\n */\n const sizeType = getSizeTypeFromLayoutSizeType(layoutSizeType);\n const channel = getPositionScaleChannel(sizeType);\n const resolve = model.component.resolve;\n const layoutSizeCmpt = model.component.layoutSize;\n let mergedSize;\n // Try to merge layout size\n for (const child of model.children) {\n const childSize = child.component.layoutSize.getWithExplicit(sizeType);\n const scaleResolve = resolve.scale[channel];\n if (scaleResolve === 'independent' && childSize.value === 'step') {\n // Do not merge independent scales with range-step as their size depends\n // on the scale domains, which can be different between scales.\n mergedSize = undefined;\n break;\n }\n if (mergedSize) {\n if (scaleResolve === 'independent' && mergedSize.value !== childSize.value) {\n // For independent scale, only merge if all the sizes are the same.\n // If the values are different, abandon the merge!\n mergedSize = undefined;\n break;\n }\n mergedSize = mergeValuesWithExplicit(mergedSize, childSize, sizeType, '');\n }\n else {\n mergedSize = childSize;\n }\n }\n if (mergedSize) {\n // If merged, rename size and set size of all children.\n for (const child of model.children) {\n model.renameSignal(child.getName(sizeType), model.getName(layoutSizeType));\n child.component.layoutSize.set(sizeType, 'merged', false);\n }\n layoutSizeCmpt.setWithExplicit(layoutSizeType, mergedSize);\n }\n else {\n layoutSizeCmpt.setWithExplicit(layoutSizeType, {\n explicit: false,\n value: undefined\n });\n }\n}\nexport function parseUnitLayoutSize(model) {\n const { size, component } = model;\n for (const channel of POSITION_SCALE_CHANNELS) {\n const sizeType = getSizeChannel(channel);\n if (size[sizeType]) {\n const specifiedSize = size[sizeType];\n component.layoutSize.set(sizeType, isStep(specifiedSize) ? 'step' : specifiedSize, true);\n }\n else {\n const defaultSize = defaultUnitSize(model, sizeType);\n component.layoutSize.set(sizeType, defaultSize, false);\n }\n }\n}\nfunction defaultUnitSize(model, sizeType) {\n const channel = sizeType === 'width' ? 'x' : 'y';\n const config = model.config;\n const scaleComponent = model.getScaleComponent(channel);\n if (scaleComponent) {\n const scaleType = scaleComponent.get('type');\n const range = scaleComponent.get('range');\n if (hasDiscreteDomain(scaleType)) {\n const size = getViewConfigDiscreteSize(config.view, sizeType);\n if (isVgRangeStep(range) || isStep(size)) {\n // For discrete domain with range.step, use dynamic width/height\n return 'step';\n }\n else {\n return size;\n }\n }\n else {\n return getViewConfigContinuousSize(config.view, sizeType);\n }\n }\n else if (model.hasProjection || model.mark === 'arc') {\n // arc should use continuous size by default otherwise the pie is extremely small\n return getViewConfigContinuousSize(config.view, sizeType);\n }\n else {\n const size = getViewConfigDiscreteSize(config.view, sizeType);\n return isStep(size) ? size.step : size;\n }\n}\n//# sourceMappingURL=parse.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray } from 'vega-util';\nimport { isBinning } from '../bin';\nimport { COLUMN, FACET_CHANNELS, POSITION_SCALE_CHANNELS, ROW } from '../channel';\nimport { initFieldDef, vgField } from '../channeldef';\nimport { replaceExprRefInIndex } from '../expr';\nimport * as log from '../log';\nimport { hasDiscreteDomain } from '../scale';\nimport { DEFAULT_SORT_OP, isSortField } from '../sort';\nimport { isFacetMapping } from '../spec/facet';\nimport { contains, keys } from '../util';\nimport { isVgRangeStep } from '../vega.schema';\nimport { buildModel } from './buildmodel';\nimport { assembleFacetData } from './data/assemble';\nimport { sortArrayIndexField } from './data/calculate';\nimport { parseData } from './data/parse';\nimport { assembleLabelTitle } from './header/assemble';\nimport { getHeaderChannel, getHeaderProperty } from './header/common';\nimport { HEADER_CHANNELS, HEADER_TYPES } from './header/component';\nimport { parseFacetHeaders } from './header/parse';\nimport { parseChildrenLayoutSize } from './layoutsize/parse';\nimport { ModelWithField } from './model';\nimport { assembleDomain, getFieldFromDomain } from './scale/domain';\nimport { assembleFacetSignals } from './selection/assemble';\nexport function facetSortFieldName(fieldDef, sort, opt) {\n return vgField(sort, Object.assign({ suffix: `by_${vgField(fieldDef)}` }, (opt !== null && opt !== void 0 ? opt : {})));\n}\nexport class FacetModel extends ModelWithField {\n constructor(spec, parent, parentGivenName, config) {\n super(spec, 'facet', parent, parentGivenName, config, spec.resolve);\n this.child = buildModel(spec.spec, this, this.getName('child'), undefined, config);\n this.children = [this.child];\n this.facet = this.initFacet(spec.facet);\n }\n initFacet(facet) {\n // clone to prevent side effect to the original spec\n if (!isFacetMapping(facet)) {\n return { facet: this.initFacetFieldDef(facet, 'facet') };\n }\n const channels = keys(facet);\n const normalizedFacet = {};\n for (const channel of channels) {\n if (!contains([ROW, COLUMN], channel)) {\n // Drop unsupported channel\n log.warn(log.message.incompatibleChannel(channel, 'facet'));\n break;\n }\n const fieldDef = facet[channel];\n if (fieldDef.field === undefined) {\n log.warn(log.message.emptyFieldDef(fieldDef, channel));\n break;\n }\n normalizedFacet[channel] = this.initFacetFieldDef(fieldDef, channel);\n }\n return normalizedFacet;\n }\n initFacetFieldDef(fieldDef, channel) {\n const { header } = fieldDef, rest = __rest(fieldDef, [\"header\"]);\n // Cast because we call initFieldDef, which assumes general FieldDef.\n // However, FacetFieldDef is a bit more constrained than the general FieldDef\n const facetFieldDef = initFieldDef(rest, channel);\n if (header) {\n facetFieldDef.header = replaceExprRefInIndex(header);\n }\n return facetFieldDef;\n }\n channelHasField(channel) {\n return !!this.facet[channel];\n }\n fieldDef(channel) {\n return this.facet[channel];\n }\n parseData() {\n this.component.data = parseData(this);\n this.child.parseData();\n }\n parseLayoutSize() {\n parseChildrenLayoutSize(this);\n }\n parseSelections() {\n // As a facet has a single child, the selection components are the same.\n // The child maintains its selections to assemble signals, which remain\n // within its unit.\n this.child.parseSelections();\n this.component.selection = this.child.component.selection;\n }\n parseMarkGroup() {\n this.child.parseMarkGroup();\n }\n parseAxesAndHeaders() {\n this.child.parseAxesAndHeaders();\n parseFacetHeaders(this);\n }\n assembleSelectionTopLevelSignals(signals) {\n return this.child.assembleSelectionTopLevelSignals(signals);\n }\n assembleSignals() {\n this.child.assembleSignals();\n return [];\n }\n assembleSelectionData(data) {\n return this.child.assembleSelectionData(data);\n }\n getHeaderLayoutMixins() {\n var _a, _b, _c;\n const layoutMixins = {};\n for (const channel of FACET_CHANNELS) {\n for (const headerType of HEADER_TYPES) {\n const layoutHeaderComponent = this.component.layoutHeaders[channel];\n const headerComponent = layoutHeaderComponent[headerType];\n const { facetFieldDef } = layoutHeaderComponent;\n if (facetFieldDef) {\n const titleOrient = getHeaderProperty('titleOrient', facetFieldDef.header, this.config, channel);\n if (contains(['right', 'bottom'], titleOrient)) {\n const headerChannel = getHeaderChannel(channel, titleOrient);\n layoutMixins.titleAnchor = (_a = layoutMixins.titleAnchor) !== null && _a !== void 0 ? _a : {};\n layoutMixins.titleAnchor[headerChannel] = 'end';\n }\n }\n if (headerComponent === null || headerComponent === void 0 ? void 0 : headerComponent[0]) {\n // set header/footerBand\n const sizeType = channel === 'row' ? 'height' : 'width';\n const bandType = headerType === 'header' ? 'headerBand' : 'footerBand';\n if (channel !== 'facet' && !this.child.component.layoutSize.get(sizeType)) {\n // If facet child does not have size signal, then apply headerBand\n layoutMixins[bandType] = (_b = layoutMixins[bandType]) !== null && _b !== void 0 ? _b : {};\n layoutMixins[bandType][channel] = 0.5;\n }\n if (layoutHeaderComponent.title) {\n layoutMixins.offset = (_c = layoutMixins.offset) !== null && _c !== void 0 ? _c : {};\n layoutMixins.offset[channel === 'row' ? 'rowTitle' : 'columnTitle'] = 10;\n }\n }\n }\n }\n return layoutMixins;\n }\n assembleDefaultLayout() {\n const { column, row } = this.facet;\n const columns = column ? this.columnDistinctSignal() : row ? 1 : undefined;\n let align = 'all';\n // Do not align the cells if the scale corresponding to the direction is indepent.\n // We always align when we facet into both row and column.\n if (!row && this.component.resolve.scale.x === 'independent') {\n align = 'none';\n }\n else if (!column && this.component.resolve.scale.y === 'independent') {\n align = 'none';\n }\n return Object.assign(Object.assign(Object.assign({}, this.getHeaderLayoutMixins()), (columns ? { columns } : {})), { bounds: 'full', align });\n }\n assembleLayoutSignals() {\n // FIXME(https://github.com/vega/vega-lite/issues/1193): this can be incorrect if we have independent scales.\n return this.child.assembleLayoutSignals();\n }\n columnDistinctSignal() {\n if (this.parent && this.parent instanceof FacetModel) {\n // For nested facet, we will add columns to group mark instead\n // See discussion in https://github.com/vega/vega/issues/952\n // and https://github.com/vega/vega-view/releases/tag/v1.2.6\n return undefined;\n }\n else {\n // In facetNode.assemble(), the name is always this.getName('column') + '_layout'.\n const facetLayoutDataName = this.getName('column_domain');\n return { signal: `length(data('${facetLayoutDataName}'))` };\n }\n }\n assembleGroup(signals) {\n if (this.parent && this.parent instanceof FacetModel) {\n // Provide number of columns for layout.\n // See discussion in https://github.com/vega/vega/issues/952\n // and https://github.com/vega/vega-view/releases/tag/v1.2.6\n return Object.assign(Object.assign({}, (this.channelHasField('column')\n ? {\n encode: {\n update: {\n // TODO(https://github.com/vega/vega-lite/issues/2759):\n // Correct the signal for facet of concat of facet_column\n columns: { field: vgField(this.facet.column, { prefix: 'distinct' }) }\n }\n }\n }\n : {})), super.assembleGroup(signals));\n }\n return super.assembleGroup(signals);\n }\n /**\n * Aggregate cardinality for calculating size\n */\n getCardinalityAggregateForChild() {\n const fields = [];\n const ops = [];\n const as = [];\n if (this.child instanceof FacetModel) {\n if (this.child.channelHasField('column')) {\n const field = vgField(this.child.facet.column);\n fields.push(field);\n ops.push('distinct');\n as.push(`distinct_${field}`);\n }\n }\n else {\n for (const channel of POSITION_SCALE_CHANNELS) {\n const childScaleComponent = this.child.component.scales[channel];\n if (childScaleComponent && !childScaleComponent.merged) {\n const type = childScaleComponent.get('type');\n const range = childScaleComponent.get('range');\n if (hasDiscreteDomain(type) && isVgRangeStep(range)) {\n const domain = assembleDomain(this.child, channel);\n const field = getFieldFromDomain(domain);\n if (field) {\n fields.push(field);\n ops.push('distinct');\n as.push(`distinct_${field}`);\n }\n else {\n log.warn(log.message.unknownField(channel));\n }\n }\n }\n }\n }\n return { fields, ops, as };\n }\n assembleFacet() {\n const { name, data } = this.component.data.facetRoot;\n const { row, column } = this.facet;\n const { fields, ops, as } = this.getCardinalityAggregateForChild();\n const groupby = [];\n for (const channel of FACET_CHANNELS) {\n const fieldDef = this.facet[channel];\n if (fieldDef) {\n groupby.push(vgField(fieldDef));\n const { bin, sort } = fieldDef;\n if (isBinning(bin)) {\n groupby.push(vgField(fieldDef, { binSuffix: 'end' }));\n }\n if (isSortField(sort)) {\n const { field, op = DEFAULT_SORT_OP } = sort;\n const outputName = facetSortFieldName(fieldDef, sort);\n if (row && column) {\n // For crossed facet, use pre-calculate field as it requires a different groupby\n // For each calculated field, apply max and assign them to the same name as\n // all values of the same group should be the same anyway.\n fields.push(outputName);\n ops.push('max');\n as.push(outputName);\n }\n else {\n fields.push(field);\n ops.push(op);\n as.push(outputName);\n }\n }\n else if (isArray(sort)) {\n const outputName = sortArrayIndexField(fieldDef, channel);\n fields.push(outputName);\n ops.push('max');\n as.push(outputName);\n }\n }\n }\n const cross = !!row && !!column;\n return Object.assign({ name,\n data,\n groupby }, (cross || fields.length > 0\n ? {\n aggregate: Object.assign(Object.assign({}, (cross ? { cross } : {})), (fields.length ? { fields, ops, as } : {}))\n }\n : {}));\n }\n facetSortFields(channel) {\n const { facet } = this;\n const fieldDef = facet[channel];\n if (fieldDef) {\n if (isSortField(fieldDef.sort)) {\n return [facetSortFieldName(fieldDef, fieldDef.sort, { expr: 'datum' })];\n }\n else if (isArray(fieldDef.sort)) {\n return [sortArrayIndexField(fieldDef, channel, { expr: 'datum' })];\n }\n return [vgField(fieldDef, { expr: 'datum' })];\n }\n return [];\n }\n facetSortOrder(channel) {\n const { facet } = this;\n const fieldDef = facet[channel];\n if (fieldDef) {\n const { sort } = fieldDef;\n const order = (isSortField(sort) ? sort.order : !isArray(sort) && sort) || 'ascending';\n return [order];\n }\n return [];\n }\n assembleLabelTitle() {\n var _a;\n const { facet, config } = this;\n if (facet.facet) {\n // Facet always uses title to display labels\n return assembleLabelTitle(facet.facet, 'facet', config);\n }\n const ORTHOGONAL_ORIENT = {\n row: ['top', 'bottom'],\n column: ['left', 'right']\n };\n for (const channel of HEADER_CHANNELS) {\n if (facet[channel]) {\n const labelOrient = getHeaderProperty('labelOrient', (_a = facet[channel]) === null || _a === void 0 ? void 0 : _a.header, config, channel);\n if (contains(ORTHOGONAL_ORIENT[channel], labelOrient)) {\n // Row/Column with orthogonal labelOrient must use title to display labels\n return assembleLabelTitle(facet[channel], channel, config);\n }\n }\n }\n return undefined;\n }\n assembleMarks() {\n const { child } = this;\n // If we facet by two dimensions, we need to add a cross operator to the aggregation\n // so that we create all groups\n const facetRoot = this.component.data.facetRoot;\n const data = assembleFacetData(facetRoot);\n const encodeEntry = child.assembleGroupEncodeEntry(false);\n const title = this.assembleLabelTitle() || child.assembleTitle();\n const style = child.assembleGroupStyle();\n const markGroup = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ name: this.getName('cell'), type: 'group' }, (title ? { title } : {})), (style ? { style } : {})), { from: {\n facet: this.assembleFacet()\n }, \n // TODO: move this to after data\n sort: {\n field: FACET_CHANNELS.map(c => this.facetSortFields(c)).flat(),\n order: FACET_CHANNELS.map(c => this.facetSortOrder(c)).flat()\n } }), (data.length > 0 ? { data: data } : {})), (encodeEntry ? { encode: { update: encodeEntry } } : {})), child.assembleGroup(assembleFacetSignals(this, [])));\n return [markGroup];\n }\n getMapping() {\n return this.facet;\n }\n}\n//# sourceMappingURL=facet.js.map","import { AncestorParse } from '.';\nimport { isGenerator, isGraticuleGenerator, isInlineData, isNamedData, isSequenceGenerator, isUrlData, DataSourceType } from '../../data';\nimport * as log from '../../log';\nimport { isAggregate, isBin, isCalculate, isDensity, isFilter, isFlatten, isFold, isImpute, isJoinAggregate, isLoess, isLookup, isPivot, isQuantile, isRegression, isSample, isStack, isTimeUnit, isWindow } from '../../transform';\nimport { deepEqual, mergeDeep } from '../../util';\nimport { isFacetModel, isLayerModel, isUnitModel } from '../model';\nimport { requiresSelectionId } from '../selection';\nimport { materializeSelections } from '../selection/parse';\nimport { AggregateNode } from './aggregate';\nimport { BinNode } from './bin';\nimport { CalculateNode } from './calculate';\nimport { OutputNode } from './dataflow';\nimport { DensityTransformNode } from './density';\nimport { FacetNode } from './facet';\nimport { FilterNode } from './filter';\nimport { FilterInvalidNode } from './filterinvalid';\nimport { FlattenTransformNode } from './flatten';\nimport { FoldTransformNode } from './fold';\nimport { getImplicitFromEncoding, getImplicitFromFilterTransform, getImplicitFromSelection, ParseNode } from './formatparse';\nimport { GeoJSONNode } from './geojson';\nimport { GeoPointNode } from './geopoint';\nimport { GraticuleNode } from './graticule';\nimport { IdentifierNode } from './identifier';\nimport { ImputeNode } from './impute';\nimport { JoinAggregateTransformNode } from './joinaggregate';\nimport { makeJoinAggregateFromFacet } from './joinaggregatefacet';\nimport { LoessTransformNode } from './loess';\nimport { LookupNode } from './lookup';\nimport { PivotTransformNode } from './pivot';\nimport { QuantileTransformNode } from './quantile';\nimport { RegressionTransformNode } from './regression';\nimport { SampleTransformNode } from './sample';\nimport { SequenceNode } from './sequence';\nimport { SourceNode } from './source';\nimport { StackNode } from './stack';\nimport { TimeUnitNode } from './timeunit';\nimport { WindowTransformNode } from './window';\nexport function findSource(data, sources) {\n var _a, _b, _c, _d;\n for (const other of sources) {\n const otherData = other.data;\n // if both datasets have a name defined, we cannot merge\n if (data.name && other.hasName() && data.name !== other.dataName) {\n continue;\n }\n const formatMesh = (_a = data['format']) === null || _a === void 0 ? void 0 : _a.mesh;\n const otherFeature = (_b = otherData.format) === null || _b === void 0 ? void 0 : _b.feature;\n // feature and mesh are mutually exclusive\n if (formatMesh && otherFeature) {\n continue;\n }\n // we have to extract the same feature or mesh\n const formatFeature = (_c = data['format']) === null || _c === void 0 ? void 0 : _c.feature;\n if ((formatFeature || otherFeature) && formatFeature !== otherFeature) {\n continue;\n }\n const otherMesh = (_d = otherData.format) === null || _d === void 0 ? void 0 : _d.mesh;\n if ((formatMesh || otherMesh) && formatMesh !== otherMesh) {\n continue;\n }\n if (isInlineData(data) && isInlineData(otherData)) {\n if (deepEqual(data.values, otherData.values)) {\n return other;\n }\n }\n else if (isUrlData(data) && isUrlData(otherData)) {\n if (data.url === otherData.url) {\n return other;\n }\n }\n else if (isNamedData(data)) {\n if (data.name === other.dataName) {\n return other;\n }\n }\n }\n return null;\n}\nfunction parseRoot(model, sources) {\n if (model.data || !model.parent) {\n // if the model defines a data source or is the root, create a source node\n if (model.data === null) {\n // data: null means we should ignore the parent's data so we just create a new data source\n const source = new SourceNode({ values: [] });\n sources.push(source);\n return source;\n }\n const existingSource = findSource(model.data, sources);\n if (existingSource) {\n if (!isGenerator(model.data)) {\n existingSource.data.format = mergeDeep({}, model.data.format, existingSource.data.format);\n }\n // if the new source has a name but the existing one does not, we can set it\n if (!existingSource.hasName() && model.data.name) {\n existingSource.dataName = model.data.name;\n }\n return existingSource;\n }\n else {\n const source = new SourceNode(model.data);\n sources.push(source);\n return source;\n }\n }\n else {\n // If we don't have a source defined (overriding parent's data), use the parent's facet root or main.\n return model.parent.component.data.facetRoot\n ? model.parent.component.data.facetRoot\n : model.parent.component.data.main;\n }\n}\n/**\n * Parses a transform array into a chain of connected dataflow nodes.\n */\nexport function parseTransformArray(head, model, ancestorParse) {\n var _a, _b;\n let lookupCounter = 0;\n for (const t of model.transforms) {\n let derivedType = undefined;\n let transformNode;\n if (isCalculate(t)) {\n transformNode = head = new CalculateNode(head, t);\n derivedType = 'derived';\n }\n else if (isFilter(t)) {\n const implicit = getImplicitFromFilterTransform(t);\n transformNode = head = (_a = ParseNode.makeWithAncestors(head, {}, implicit, ancestorParse)) !== null && _a !== void 0 ? _a : head;\n head = new FilterNode(head, model, t.filter);\n }\n else if (isBin(t)) {\n transformNode = head = BinNode.makeFromTransform(head, t, model);\n derivedType = 'number';\n }\n else if (isTimeUnit(t)) {\n derivedType = 'date';\n const parsedAs = ancestorParse.getWithExplicit(t.field);\n // Create parse node because the input to time unit is always date.\n if (parsedAs.value === undefined) {\n head = new ParseNode(head, { [t.field]: derivedType });\n ancestorParse.set(t.field, derivedType, false);\n }\n transformNode = head = TimeUnitNode.makeFromTransform(head, t);\n }\n else if (isAggregate(t)) {\n transformNode = head = AggregateNode.makeFromTransform(head, t);\n derivedType = 'number';\n if (requiresSelectionId(model)) {\n head = new IdentifierNode(head);\n }\n }\n else if (isLookup(t)) {\n transformNode = head = LookupNode.make(head, model, t, lookupCounter++);\n derivedType = 'derived';\n }\n else if (isWindow(t)) {\n transformNode = head = new WindowTransformNode(head, t);\n derivedType = 'number';\n }\n else if (isJoinAggregate(t)) {\n transformNode = head = new JoinAggregateTransformNode(head, t);\n derivedType = 'number';\n }\n else if (isStack(t)) {\n transformNode = head = StackNode.makeFromTransform(head, t);\n derivedType = 'derived';\n }\n else if (isFold(t)) {\n transformNode = head = new FoldTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isFlatten(t)) {\n transformNode = head = new FlattenTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isPivot(t)) {\n transformNode = head = new PivotTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isSample(t)) {\n head = new SampleTransformNode(head, t);\n }\n else if (isImpute(t)) {\n transformNode = head = ImputeNode.makeFromTransform(head, t);\n derivedType = 'derived';\n }\n else if (isDensity(t)) {\n transformNode = head = new DensityTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isQuantile(t)) {\n transformNode = head = new QuantileTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isRegression(t)) {\n transformNode = head = new RegressionTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isLoess(t)) {\n transformNode = head = new LoessTransformNode(head, t);\n derivedType = 'derived';\n }\n else {\n log.warn(log.message.invalidTransformIgnored(t));\n continue;\n }\n if (transformNode && derivedType !== undefined) {\n for (const field of (_b = transformNode.producedFields()) !== null && _b !== void 0 ? _b : []) {\n ancestorParse.set(field, derivedType, false);\n }\n }\n }\n return head;\n}\n/*\nDescription of the dataflow (http://asciiflow.com/):\n +--------+\n | Source |\n +---+----+\n |\n v\n FormatParse\n (explicit)\n |\n v\n Transforms\n(Filter, Calculate, Binning, TimeUnit, Aggregate, Window, ...)\n |\n v\n FormatParse\n (implicit)\n |\n v\n Binning (in `encoding`)\n |\n v\n Timeunit (in `encoding`)\n |\n v\nFormula From Sort Array\n |\n v\n +--+--+\n | Raw |\n +-----+\n |\n v\n Aggregate (in `encoding`)\n |\n v\n Stack (in `encoding`)\n |\n v\n Invalid Filter\n |\n v\n +----------+\n | Main |\n +----------+\n |\n v\n +-------+\n | Facet |----> \"column\", \"column-layout\", and \"row\"\n +-------+\n |\n v\n ...Child data...\n*/\nexport function parseData(model) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n let head = parseRoot(model, model.component.data.sources);\n const { outputNodes, outputNodeRefCounts } = model.component.data;\n const ancestorParse = model.parent ? model.parent.component.data.ancestorParse.clone() : new AncestorParse();\n const data = model.data;\n if (isGenerator(data)) {\n // insert generator transform\n if (isSequenceGenerator(data)) {\n head = new SequenceNode(head, data.sequence);\n }\n else if (isGraticuleGenerator(data)) {\n head = new GraticuleNode(head, data.graticule);\n }\n // no parsing necessary for generator\n ancestorParse.parseNothing = true;\n }\n else if (((_a = data === null || data === void 0 ? void 0 : data.format) === null || _a === void 0 ? void 0 : _a.parse) === null) {\n // format.parse: null means disable parsing\n ancestorParse.parseNothing = true;\n }\n head = (_b = ParseNode.makeExplicit(head, model, ancestorParse)) !== null && _b !== void 0 ? _b : head;\n // Default discrete selections require an identifer transform to\n // uniquely identify data points. Add this transform at the head of\n // the pipeline such that the identifier field is available for all\n // subsequent datasets. During optimization, we will remove this\n // transform if it proves to be unnecessary. Additional identifier\n // transforms will be necessary when new tuples are constructed\n // (e.g., post-aggregation).\n head = new IdentifierNode(head);\n // HACK: This is equivalent for merging bin extent for union scale.\n // FIXME(https://github.com/vega/vega-lite/issues/2270): Correctly merge extent / bin node for shared bin scale\n const parentIsLayer = model.parent && isLayerModel(model.parent);\n if (isUnitModel(model) || isFacetModel(model)) {\n if (parentIsLayer) {\n head = (_c = BinNode.makeFromEncoding(head, model)) !== null && _c !== void 0 ? _c : head;\n }\n }\n if (model.transforms.length > 0) {\n head = parseTransformArray(head, model, ancestorParse);\n }\n // create parse nodes for fields that need to be parsed (or flattened) implicitly\n const implicitSelection = getImplicitFromSelection(model);\n const implicitEncoding = getImplicitFromEncoding(model);\n head = (_d = ParseNode.makeWithAncestors(head, {}, Object.assign(Object.assign({}, implicitSelection), implicitEncoding), ancestorParse)) !== null && _d !== void 0 ? _d : head;\n if (isUnitModel(model)) {\n head = GeoJSONNode.parseAll(head, model);\n head = GeoPointNode.parseAll(head, model);\n }\n if (isUnitModel(model) || isFacetModel(model)) {\n if (!parentIsLayer) {\n head = (_e = BinNode.makeFromEncoding(head, model)) !== null && _e !== void 0 ? _e : head;\n }\n head = (_f = TimeUnitNode.makeFromEncoding(head, model)) !== null && _f !== void 0 ? _f : head;\n head = CalculateNode.parseAllForSortIndex(head, model);\n }\n // add an output node pre aggregation\n const rawName = model.getDataName(DataSourceType.Raw);\n const raw = new OutputNode(head, rawName, DataSourceType.Raw, outputNodeRefCounts);\n outputNodes[rawName] = raw;\n head = raw;\n if (isUnitModel(model)) {\n const agg = AggregateNode.makeFromEncoding(head, model);\n if (agg) {\n head = agg;\n if (requiresSelectionId(model)) {\n head = new IdentifierNode(head);\n }\n }\n head = (_g = ImputeNode.makeFromEncoding(head, model)) !== null && _g !== void 0 ? _g : head;\n head = (_h = StackNode.makeFromEncoding(head, model)) !== null && _h !== void 0 ? _h : head;\n }\n if (isUnitModel(model)) {\n head = (_j = FilterInvalidNode.make(head, model)) !== null && _j !== void 0 ? _j : head;\n }\n // output node for marks\n const mainName = model.getDataName(DataSourceType.Main);\n const main = new OutputNode(head, mainName, DataSourceType.Main, outputNodeRefCounts);\n outputNodes[mainName] = main;\n head = main;\n if (isUnitModel(model)) {\n materializeSelections(model, main);\n }\n // add facet marker\n let facetRoot = null;\n if (isFacetModel(model)) {\n const facetName = model.getName('facet');\n // Derive new aggregate for facet's sort field\n // augment data source with new fields for crossed facet\n head = (_k = makeJoinAggregateFromFacet(head, model.facet)) !== null && _k !== void 0 ? _k : head;\n facetRoot = new FacetNode(head, model, facetName, main.getSource());\n outputNodes[facetName] = facetRoot;\n }\n return Object.assign(Object.assign({}, model.component.data), { outputNodes,\n outputNodeRefCounts,\n raw,\n main,\n facetRoot,\n ancestorParse });\n}\n//# sourceMappingURL=parse.js.map","import { vgField } from '../../channeldef';\nimport { DEFAULT_SORT_OP, isSortField } from '../../sort';\nimport { facetSortFieldName } from '../facet';\nimport { JoinAggregateTransformNode } from './joinaggregate';\nexport function makeJoinAggregateFromFacet(parent, facet) {\n const { row, column } = facet;\n if (row && column) {\n let newParent = null;\n // only need to make one for crossed facet\n for (const fieldDef of [row, column]) {\n if (isSortField(fieldDef.sort)) {\n const { field, op = DEFAULT_SORT_OP } = fieldDef.sort;\n parent = newParent = new JoinAggregateTransformNode(parent, {\n joinaggregate: [\n {\n op,\n field,\n as: facetSortFieldName(fieldDef, fieldDef.sort, { forAs: true })\n }\n ],\n groupby: [vgField(fieldDef)]\n });\n }\n }\n return newParent;\n }\n return null;\n}\n//# sourceMappingURL=joinaggregatefacet.js.map","import * as log from '../log';\nimport { isHConcatSpec, isVConcatSpec } from '../spec';\nimport { keys } from '../util';\nimport { buildModel } from './buildmodel';\nimport { parseData } from './data/parse';\nimport { assembleLayoutSignals } from './layoutsize/assemble';\nimport { parseConcatLayoutSize } from './layoutsize/parse';\nimport { Model } from './model';\nexport class ConcatModel extends Model {\n constructor(spec, parent, parentGivenName, config) {\n var _a, _b, _c, _d;\n super(spec, 'concat', parent, parentGivenName, config, spec.resolve);\n if (((_b = (_a = spec.resolve) === null || _a === void 0 ? void 0 : _a.axis) === null || _b === void 0 ? void 0 : _b.x) === 'shared' || ((_d = (_c = spec.resolve) === null || _c === void 0 ? void 0 : _c.axis) === null || _d === void 0 ? void 0 : _d.y) === 'shared') {\n log.warn(log.message.CONCAT_CANNOT_SHARE_AXIS);\n }\n this.children = this.getChildren(spec).map((child, i) => {\n return buildModel(child, this, this.getName('concat_' + i), undefined, config);\n });\n }\n parseData() {\n this.component.data = parseData(this);\n for (const child of this.children) {\n child.parseData();\n }\n }\n parseSelections() {\n // Merge selections up the hierarchy so that they may be referenced\n // across unit specs. Persist their definitions within each child\n // to assemble signals which remain within output Vega unit groups.\n this.component.selection = {};\n for (const child of this.children) {\n child.parseSelections();\n for (const key of keys(child.component.selection)) {\n this.component.selection[key] = child.component.selection[key];\n }\n }\n }\n parseMarkGroup() {\n for (const child of this.children) {\n child.parseMarkGroup();\n }\n }\n parseAxesAndHeaders() {\n for (const child of this.children) {\n child.parseAxesAndHeaders();\n }\n // TODO(#2415): support shared axes\n }\n getChildren(spec) {\n if (isVConcatSpec(spec)) {\n return spec.vconcat;\n }\n else if (isHConcatSpec(spec)) {\n return spec.hconcat;\n }\n return spec.concat;\n }\n parseLayoutSize() {\n parseConcatLayoutSize(this);\n }\n parseAxisGroup() {\n return null;\n }\n assembleSelectionTopLevelSignals(signals) {\n return this.children.reduce((sg, child) => child.assembleSelectionTopLevelSignals(sg), signals);\n }\n assembleSignals() {\n this.children.forEach(child => child.assembleSignals());\n return [];\n }\n assembleLayoutSignals() {\n const layoutSignals = assembleLayoutSignals(this);\n for (const child of this.children) {\n layoutSignals.push(...child.assembleLayoutSignals());\n }\n return layoutSignals;\n }\n assembleSelectionData(data) {\n return this.children.reduce((db, child) => child.assembleSelectionData(db), data);\n }\n assembleMarks() {\n // only children have marks\n return this.children.map(child => {\n const title = child.assembleTitle();\n const style = child.assembleGroupStyle();\n const encodeEntry = child.assembleGroupEncodeEntry(false);\n return Object.assign(Object.assign(Object.assign(Object.assign({ type: 'group', name: child.getName('group') }, (title ? { title } : {})), (style ? { style } : {})), (encodeEntry ? { encode: { update: encodeEntry } } : {})), child.assembleGroup());\n });\n }\n assembleDefaultLayout() {\n const columns = this.layout.columns;\n return Object.assign(Object.assign({}, (columns != null ? { columns: columns } : {})), { bounds: 'full', \n // Use align each so it can work with multiple plots with different size\n align: 'each' });\n }\n}\n//# sourceMappingURL=concat.js.map","import { COMMON_AXIS_PROPERTIES_INDEX } from '../../axis';\nimport { duplicate, keys } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { Split } from '../split';\nfunction isFalseOrNull(v) {\n return v === false || v === null;\n}\nconst AXIS_COMPONENT_PROPERTIES_INDEX = Object.assign(Object.assign({ disable: 1, gridScale: 1, scale: 1 }, COMMON_AXIS_PROPERTIES_INDEX), { labelExpr: 1, encode: 1 });\nexport const AXIS_COMPONENT_PROPERTIES = keys(AXIS_COMPONENT_PROPERTIES_INDEX);\nexport class AxisComponent extends Split {\n constructor(explicit = {}, implicit = {}, mainExtracted = false) {\n super();\n this.explicit = explicit;\n this.implicit = implicit;\n this.mainExtracted = mainExtracted;\n }\n clone() {\n return new AxisComponent(duplicate(this.explicit), duplicate(this.implicit), this.mainExtracted);\n }\n hasAxisPart(part) {\n // FIXME(https://github.com/vega/vega-lite/issues/2552) this method can be wrong if users use a Vega theme.\n if (part === 'axis') {\n // always has the axis container part\n return true;\n }\n if (part === 'grid' || part === 'title') {\n return !!this.get(part);\n }\n // Other parts are enabled by default, so they should not be false or null.\n return !isFalseOrNull(this.get(part));\n }\n hasOrientSignalRef() {\n return isSignalRef(this.explicit.orient);\n }\n}\n//# sourceMappingURL=component.js.map","import { AXIS_PARTS, isAxisProperty, isConditionalAxisValue } from '../../axis';\nimport { POSITION_SCALE_CHANNELS } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { getFirstDefined, isEmpty, keys, normalizeAngle } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { mergeTitleComponent } from '../common';\nimport { guideEncodeEntry } from '../guide';\nimport { parseGuideResolve } from '../resolve';\nimport { defaultTieBreaker, mergeValuesWithExplicit } from '../split';\nimport { AxisComponent, AXIS_COMPONENT_PROPERTIES } from './component';\nimport { getAxisConfig, getAxisConfigs } from './config';\nimport * as encode from './encode';\nimport { axisRules, defaultOrient, getFieldDefTitle, getLabelAngle } from './properties';\nexport function parseUnitAxes(model) {\n return POSITION_SCALE_CHANNELS.reduce((axis, channel) => {\n if (model.component.scales[channel]) {\n axis[channel] = [parseAxis(channel, model)];\n }\n return axis;\n }, {});\n}\nconst OPPOSITE_ORIENT = {\n bottom: 'top',\n top: 'bottom',\n left: 'right',\n right: 'left'\n};\nexport function parseLayerAxes(model) {\n var _a;\n const { axes, resolve } = model.component;\n const axisCount = { top: 0, bottom: 0, right: 0, left: 0 };\n for (const child of model.children) {\n child.parseAxesAndHeaders();\n for (const channel of keys(child.component.axes)) {\n resolve.axis[channel] = parseGuideResolve(model.component.resolve, channel);\n if (resolve.axis[channel] === 'shared') {\n // If the resolve says shared (and has not been overridden)\n // We will try to merge and see if there is a conflict\n axes[channel] = mergeAxisComponents(axes[channel], child.component.axes[channel]);\n if (!axes[channel]) {\n // If merge returns nothing, there is a conflict so we cannot make the axis shared.\n // Thus, mark axis as independent and remove the axis component.\n resolve.axis[channel] = 'independent';\n delete axes[channel];\n }\n }\n }\n }\n // Move axes to layer's axis component and merge shared axes\n for (const channel of POSITION_SCALE_CHANNELS) {\n for (const child of model.children) {\n if (!child.component.axes[channel]) {\n // skip if the child does not have a particular axis\n continue;\n }\n if (resolve.axis[channel] === 'independent') {\n // If axes are independent, concat the axisComponent array.\n axes[channel] = ((_a = axes[channel]) !== null && _a !== void 0 ? _a : []).concat(child.component.axes[channel]);\n // Automatically adjust orient\n for (const axisComponent of child.component.axes[channel]) {\n const { value: orient, explicit } = axisComponent.getWithExplicit('orient');\n if (isSignalRef(orient)) {\n continue;\n }\n if (axisCount[orient] > 0 && !explicit) {\n // Change axis orient if the number do not match\n const oppositeOrient = OPPOSITE_ORIENT[orient];\n if (axisCount[orient] > axisCount[oppositeOrient]) {\n axisComponent.set('orient', oppositeOrient, false);\n }\n }\n axisCount[orient]++;\n // TODO(https://github.com/vega/vega-lite/issues/2634): automatically add extra offset?\n }\n }\n // After merging, make sure to remove axes from child\n delete child.component.axes[channel];\n }\n // Suppress grid lines for dual axis charts (https://github.com/vega/vega-lite/issues/4676)\n if (resolve.axis[channel] === 'independent' && axes[channel] && axes[channel].length > 1) {\n for (const axisCmpt of axes[channel]) {\n if (!!axisCmpt.get('grid') && !axisCmpt.explicit.grid) {\n axisCmpt.implicit.grid = false;\n }\n }\n }\n }\n}\nfunction mergeAxisComponents(mergedAxisCmpts, childAxisCmpts) {\n if (mergedAxisCmpts) {\n // FIXME: this is a bit wrong once we support multiple axes\n if (mergedAxisCmpts.length !== childAxisCmpts.length) {\n return undefined; // Cannot merge axis component with different number of axes.\n }\n const length = mergedAxisCmpts.length;\n for (let i = 0; i < length; i++) {\n const merged = mergedAxisCmpts[i];\n const child = childAxisCmpts[i];\n if (!!merged !== !!child) {\n return undefined;\n }\n else if (merged && child) {\n const mergedOrient = merged.getWithExplicit('orient');\n const childOrient = child.getWithExplicit('orient');\n if (mergedOrient.explicit && childOrient.explicit && mergedOrient.value !== childOrient.value) {\n // TODO: throw warning if resolve is explicit (We don't have info about explicit/implicit resolve yet.)\n // Cannot merge due to inconsistent orient\n return undefined;\n }\n else {\n mergedAxisCmpts[i] = mergeAxisComponent(merged, child);\n }\n }\n }\n }\n else {\n // For first one, return a copy of the child\n return childAxisCmpts.map(axisComponent => axisComponent.clone());\n }\n return mergedAxisCmpts;\n}\nfunction mergeAxisComponent(merged, child) {\n for (const prop of AXIS_COMPONENT_PROPERTIES) {\n const mergedValueWithExplicit = mergeValuesWithExplicit(merged.getWithExplicit(prop), child.getWithExplicit(prop), prop, 'axis', \n // Tie breaker function\n (v1, v2) => {\n switch (prop) {\n case 'title':\n return mergeTitleComponent(v1, v2);\n case 'gridScale':\n return {\n explicit: v1.explicit,\n value: getFirstDefined(v1.value, v2.value)\n };\n }\n return defaultTieBreaker(v1, v2, prop, 'axis');\n });\n merged.setWithExplicit(prop, mergedValueWithExplicit);\n }\n return merged;\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isExplicit(value, property, axis, model, channel) {\n if (property === 'disable') {\n return axis !== undefined; // if axis is specified or null/false, then it's enable/disable state is explicit\n }\n axis = axis || {};\n switch (property) {\n case 'titleAngle':\n case 'labelAngle':\n return value === (isSignalRef(axis.labelAngle) ? axis.labelAngle : normalizeAngle(axis.labelAngle));\n case 'values':\n return !!axis.values;\n // specified axis.values is already respected, but may get transformed.\n case 'encode':\n // both VL axis.encoding and axis.labelAngle affect VG axis.encode\n return !!axis.encoding || !!axis.labelAngle;\n case 'title':\n // title can be explicit if fieldDef.title is set\n if (value === getFieldDefTitle(model, channel)) {\n return true;\n }\n }\n // Otherwise, things are explicit if the returned value matches the specified property\n return value === axis[property];\n}\n/**\n * Properties to always include values from config\n */\nconst propsToAlwaysIncludeConfig = new Set([\n 'grid',\n 'translate',\n // the rest are not axis configs in Vega, but are in VL, so we need to set too.\n 'format',\n 'formatType',\n 'orient',\n 'labelExpr',\n 'tickCount',\n 'position',\n 'tickMinStep'\n]);\nfunction parseAxis(channel, model) {\n var _a, _b, _c;\n let axis = model.axis(channel);\n const axisComponent = new AxisComponent();\n const fieldOrDatumDef = getFieldOrDatumDef(model.encoding[channel]);\n const { mark, config } = model;\n const orient = (axis === null || axis === void 0 ? void 0 : axis.orient) || ((_a = config[channel === 'x' ? 'axisX' : 'axisY']) === null || _a === void 0 ? void 0 : _a.orient) || ((_b = config.axis) === null || _b === void 0 ? void 0 : _b.orient) ||\n defaultOrient(channel);\n const scaleType = model.getScaleComponent(channel).get('type');\n const axisConfigs = getAxisConfigs(channel, scaleType, orient, model.config);\n const disable = axis !== undefined ? !axis : getAxisConfig('disable', config.style, axis === null || axis === void 0 ? void 0 : axis.style, axisConfigs).configValue;\n axisComponent.set('disable', disable, axis !== undefined);\n if (disable) {\n return axisComponent;\n }\n axis = axis || {};\n const labelAngle = getLabelAngle(fieldOrDatumDef, axis, channel, config.style, axisConfigs);\n const ruleParams = {\n fieldOrDatumDef,\n axis,\n channel,\n model,\n scaleType,\n orient,\n labelAngle,\n mark,\n config\n };\n // 1.2. Add properties\n for (const property of AXIS_COMPONENT_PROPERTIES) {\n const value = property in axisRules ? axisRules[property](ruleParams) : isAxisProperty(property) ? axis[property] : undefined;\n const hasValue = value !== undefined;\n const explicit = isExplicit(value, property, axis, model, channel);\n if (hasValue && explicit) {\n axisComponent.set(property, value, explicit);\n }\n else {\n const { configValue = undefined, configFrom = undefined } = isAxisProperty(property) && property !== 'values'\n ? getAxisConfig(property, config.style, axis.style, axisConfigs)\n : {};\n const hasConfigValue = configValue !== undefined;\n if (hasValue && !hasConfigValue) {\n // only set property if it is explicitly set or has no config value (otherwise we will accidentally override config)\n axisComponent.set(property, value, explicit);\n }\n else if (\n // Cases need implicit values\n // 1. Axis config that aren't available in Vega\n !(configFrom === 'vgAxisConfig') ||\n // 2. Certain properties are always included (see `propsToAlwaysIncludeConfig`'s declaration for more details)\n (propsToAlwaysIncludeConfig.has(property) && hasConfigValue) ||\n // 3. Conditional axis values and signals\n isConditionalAxisValue(configValue) ||\n isSignalRef(configValue)) {\n // If a config is specified and is conditional, copy conditional value from axis config\n axisComponent.set(property, configValue, false);\n }\n }\n }\n // 2) Add guide encode definition groups\n const axisEncoding = (_c = axis.encoding) !== null && _c !== void 0 ? _c : {};\n const axisEncode = AXIS_PARTS.reduce((e, part) => {\n var _a;\n if (!axisComponent.hasAxisPart(part)) {\n // No need to create encode for a disabled part.\n return e;\n }\n const axisEncodingPart = guideEncodeEntry((_a = axisEncoding[part]) !== null && _a !== void 0 ? _a : {}, model);\n const value = part === 'labels' ? encode.labels(model, channel, axisEncodingPart) : axisEncodingPart;\n if (value !== undefined && !isEmpty(value)) {\n e[part] = { update: value };\n }\n return e;\n }, {});\n // FIXME: By having encode as one property, we won't have fine grained encode merging.\n if (!isEmpty(axisEncode)) {\n axisComponent.set('encode', axisEncode, !!axis.encoding || axis.labelAngle !== undefined);\n }\n return axisComponent;\n}\n//# sourceMappingURL=parse.js.map","import { getSecondaryRangeChannel } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { formatCustomType, isCustomFormatType } from '../format';\nexport function labels(model, channel, specifiedLabelsSpec) {\n var _a;\n const { encoding, config } = model;\n const fieldOrDatumDef = (_a = getFieldOrDatumDef(encoding[channel])) !== null && _a !== void 0 ? _a : getFieldOrDatumDef(encoding[getSecondaryRangeChannel(channel)]);\n const axis = model.axis(channel) || {};\n const { format, formatType } = axis;\n if (isCustomFormatType(formatType)) {\n return Object.assign({ text: formatCustomType({\n fieldOrDatumDef,\n field: 'datum.value',\n format,\n formatType,\n config\n }) }, specifiedLabelsSpec);\n }\n return specifiedLabelsSpec;\n}\n//# sourceMappingURL=encode.js.map","import * as encode from './encode';\nfunction encodeEntry(model, fixedShape) {\n const { config } = model;\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'include',\n orient: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.nonPosition('size', model)), encode.nonPosition('angle', model)), shapeMixins(model, config, fixedShape));\n}\nexport function shapeMixins(model, config, fixedShape) {\n if (fixedShape) {\n return { shape: { value: fixedShape } };\n }\n return encode.nonPosition('shape', model);\n}\nexport const point = {\n vgMark: 'symbol',\n encodeEntry: (model) => {\n return encodeEntry(model);\n }\n};\nexport const circle = {\n vgMark: 'symbol',\n encodeEntry: (model) => {\n return encodeEntry(model, 'circle');\n }\n};\nexport const square = {\n vgMark: 'symbol',\n encodeEntry: (model) => {\n return encodeEntry(model, 'square');\n }\n};\n//# sourceMappingURL=point.js.map","import { isNumber } from 'vega-util';\nimport { getViewConfigDiscreteStep } from '../../config';\nimport { isVgRangeStep } from '../../vega.schema';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../common';\nimport * as encode from './encode';\nexport const tick = {\n vgMark: 'rect',\n encodeEntry: (model) => {\n const { config, markDef } = model;\n const orient = markDef.orient;\n const vgSizeChannel = orient === 'horizontal' ? 'width' : 'height';\n const vgThicknessChannel = orient === 'horizontal' ? 'height' : 'width';\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid', vgChannel: 'xc' })), encode.pointPosition('y', model, { defaultPos: 'mid', vgChannel: 'yc' })), encode.nonPosition('size', model, {\n defaultValue: defaultSize(model),\n vgChannel: vgSizeChannel\n })), { [vgThicknessChannel]: signalOrValueRef(getMarkPropOrConfig('thickness', markDef, config)) });\n }\n};\nfunction defaultSize(model) {\n var _a;\n const { config, markDef } = model;\n const { orient } = markDef;\n const vgSizeChannel = orient === 'horizontal' ? 'width' : 'height';\n const scale = model.getScaleComponent(orient === 'horizontal' ? 'x' : 'y');\n const markPropOrConfig = (_a = getMarkPropOrConfig('size', markDef, config, { vgChannel: vgSizeChannel })) !== null && _a !== void 0 ? _a : config.tick.bandSize;\n if (markPropOrConfig !== undefined) {\n return markPropOrConfig;\n }\n else {\n const scaleRange = scale ? scale.get('range') : undefined;\n if (scaleRange && isVgRangeStep(scaleRange) && isNumber(scaleRange.step)) {\n return (scaleRange.step * 3) / 4;\n }\n const defaultViewStep = getViewConfigDiscreteStep(config.view, vgSizeChannel);\n return (defaultViewStep * 3) / 4;\n }\n}\n//# sourceMappingURL=tick.js.map","import { isArray } from 'vega-util';\nimport { isFieldDef, isValueDef, vgField } from '../../channeldef';\nimport { DataSourceType } from '../../data';\nimport { isAggregate, pathGroupingFields } from '../../encoding';\nimport { AREA, BAR, isPathMark, LINE, TRAIL } from '../../mark';\nimport { isSortByEncoding, isSortField } from '../../sort';\nimport { contains, getFirstDefined, isNullOrFalse, keys, omit, pick } from '../../util';\nimport { VG_CORNERRADIUS_CHANNELS } from '../../vega.schema';\nimport { getMarkConfig, getMarkPropOrConfig, getStyles, signalOrValueRef, sortParams } from '../common';\nimport { arc } from './arc';\nimport { area } from './area';\nimport { bar } from './bar';\nimport { geoshape } from './geoshape';\nimport { image } from './image';\nimport { line, trail } from './line';\nimport { circle, point, square } from './point';\nimport { rect } from './rect';\nimport { rule } from './rule';\nimport { text } from './text';\nimport { tick } from './tick';\nconst markCompiler = {\n arc,\n area,\n bar,\n circle,\n geoshape,\n image,\n line,\n point,\n rect,\n rule,\n square,\n text,\n tick,\n trail\n};\nexport function parseMarkGroups(model) {\n if (contains([LINE, AREA, TRAIL], model.mark)) {\n const details = pathGroupingFields(model.mark, model.encoding);\n if (details.length > 0) {\n return getPathGroups(model, details);\n }\n // otherwise use standard mark groups\n }\n else if (contains([BAR], model.mark)) {\n const hasCornerRadius = VG_CORNERRADIUS_CHANNELS.some(prop => getMarkPropOrConfig(prop, model.markDef, model.config));\n if (model.stack && !model.fieldDef('size') && hasCornerRadius) {\n return getGroupsForStackedBarWithCornerRadius(model);\n }\n }\n return getMarkGroup(model);\n}\nconst FACETED_PATH_PREFIX = 'faceted_path_';\nfunction getPathGroups(model, details) {\n // TODO: for non-stacked plot, map order to zindex. (Maybe rename order for layer to zindex?)\n return [\n {\n name: model.getName('pathgroup'),\n type: 'group',\n from: {\n facet: {\n name: FACETED_PATH_PREFIX + model.requestDataName(DataSourceType.Main),\n data: model.requestDataName(DataSourceType.Main),\n groupby: details\n }\n },\n encode: {\n update: {\n width: { field: { group: 'width' } },\n height: { field: { group: 'height' } }\n }\n },\n // With subfacet for line/area group, need to use faceted data from above.\n marks: getMarkGroup(model, { fromPrefix: FACETED_PATH_PREFIX })\n }\n ];\n}\nconst STACK_GROUP_PREFIX = 'stack_group_';\n/**\n * We need to put stacked bars into groups in order to enable cornerRadius for stacks.\n * If stack is used and the model doesn't have size encoding, we put the mark into groups,\n * and apply cornerRadius properties at the group.\n */\nfunction getGroupsForStackedBarWithCornerRadius(model) {\n // Generate the mark\n const [mark] = getMarkGroup(model, { fromPrefix: STACK_GROUP_PREFIX });\n // Get the scale for the stacked field\n const fieldScale = model.scaleName(model.stack.fieldChannel);\n const stackField = (opt = {}) => model.vgField(model.stack.fieldChannel, opt);\n // Find the min/max of the pixel value on the stacked direction\n const stackFieldGroup = (func, expr) => {\n const vgFieldMinMax = [\n stackField({ prefix: 'min', suffix: 'start', expr }),\n stackField({ prefix: 'max', suffix: 'start', expr }),\n stackField({ prefix: 'min', suffix: 'end', expr }),\n stackField({ prefix: 'max', suffix: 'end', expr })\n ];\n return `${func}(${vgFieldMinMax.map(field => `scale('${fieldScale}',${field})`).join(',')})`;\n };\n let groupUpdate;\n let innerGroupUpdate;\n // Build the encoding for group and an inner group\n if (model.stack.fieldChannel === 'x') {\n // Move cornerRadius, y/yc/y2/height properties to group\n // Group x/x2 should be the min/max of the marks within\n groupUpdate = Object.assign(Object.assign({}, pick(mark.encode.update, ['y', 'yc', 'y2', 'height', ...VG_CORNERRADIUS_CHANNELS])), { x: { signal: stackFieldGroup('min', 'datum') }, x2: { signal: stackFieldGroup('max', 'datum') }, clip: { value: true } });\n // Inner group should revert the x translation, and pass height through\n innerGroupUpdate = {\n x: { field: { group: 'x' }, mult: -1 },\n height: { field: { group: 'height' } }\n };\n // The marks should use the same height as group, without y/yc/y2 properties (because it's already done by group)\n // This is why size encoding is not supported yet\n mark.encode.update = Object.assign(Object.assign({}, omit(mark.encode.update, ['y', 'yc', 'y2'])), { height: { field: { group: 'height' } } });\n }\n else {\n groupUpdate = Object.assign(Object.assign({}, pick(mark.encode.update, ['x', 'xc', 'x2', 'width'])), { y: { signal: stackFieldGroup('min', 'datum') }, y2: { signal: stackFieldGroup('max', 'datum') }, clip: { value: true } });\n innerGroupUpdate = {\n y: { field: { group: 'y' }, mult: -1 },\n width: { field: { group: 'width' } }\n };\n mark.encode.update = Object.assign(Object.assign({}, omit(mark.encode.update, ['x', 'xc', 'x2'])), { width: { field: { group: 'width' } } });\n }\n // Deal with cornerRadius properties\n for (const key of VG_CORNERRADIUS_CHANNELS) {\n const configValue = getMarkConfig(key, model.markDef, model.config);\n // Move from mark to group\n if (mark.encode.update[key]) {\n groupUpdate[key] = mark.encode.update[key];\n delete mark.encode.update[key];\n }\n else if (configValue) {\n groupUpdate[key] = signalOrValueRef(configValue);\n }\n // Overwrite any cornerRadius on mark set by config --- they are already moved to the group\n if (configValue) {\n mark.encode.update[key] = { value: 0 };\n }\n }\n // For bin and time unit, we have to add bin/timeunit -end channels.\n const groupByField = model.fieldDef(model.stack.groupbyChannel);\n const groupby = vgField(groupByField) ? [vgField(groupByField)] : [];\n if ((groupByField === null || groupByField === void 0 ? void 0 : groupByField.bin) || (groupByField === null || groupByField === void 0 ? void 0 : groupByField.timeUnit)) {\n groupby.push(vgField(groupByField, { binSuffix: 'end' }));\n }\n const strokeProperties = [\n 'stroke',\n 'strokeWidth',\n 'strokeJoin',\n 'strokeCap',\n 'strokeDash',\n 'strokeDashOffset',\n 'strokeMiterLimit',\n 'strokeOpacity'\n ];\n // Generate stroke properties for the group\n groupUpdate = strokeProperties.reduce((encode, prop) => {\n if (mark.encode.update[prop]) {\n return Object.assign(Object.assign({}, encode), { [prop]: mark.encode.update[prop] });\n }\n else {\n const configValue = getMarkConfig(prop, model.markDef, model.config);\n if (configValue !== undefined) {\n return Object.assign(Object.assign({}, encode), { [prop]: signalOrValueRef(configValue) });\n }\n else {\n return encode;\n }\n }\n }, groupUpdate);\n // Apply strokeForeground and strokeOffset if stroke is used\n if (groupUpdate.stroke) {\n groupUpdate.strokeForeground = { value: true };\n groupUpdate.strokeOffset = { value: 0 };\n }\n return [\n {\n type: 'group',\n from: {\n facet: {\n data: model.requestDataName(DataSourceType.Main),\n name: STACK_GROUP_PREFIX + model.requestDataName(DataSourceType.Main),\n groupby,\n aggregate: {\n fields: [\n stackField({ suffix: 'start' }),\n stackField({ suffix: 'start' }),\n stackField({ suffix: 'end' }),\n stackField({ suffix: 'end' })\n ],\n ops: ['min', 'max', 'min', 'max']\n }\n }\n },\n encode: {\n update: groupUpdate\n },\n marks: [\n {\n type: 'group',\n encode: { update: innerGroupUpdate },\n marks: [mark]\n }\n ]\n }\n ];\n}\nexport function getSort(model) {\n const { encoding, stack, mark, markDef, config } = model;\n const order = encoding.order;\n if ((!isArray(order) && isValueDef(order) && isNullOrFalse(order.value)) ||\n (!order && isNullOrFalse(getMarkPropOrConfig('order', markDef, config)))) {\n return undefined;\n }\n else if ((isArray(order) || isFieldDef(order)) && !stack) {\n // Sort by the order field if it is specified and the field is not stacked. (For stacked field, order specify stack order.)\n return sortParams(order, { expr: 'datum' });\n }\n else if (isPathMark(mark)) {\n // For both line and area, we sort values based on dimension by default\n const dimensionChannel = markDef.orient === 'horizontal' ? 'y' : 'x';\n const dimensionChannelDef = encoding[dimensionChannel];\n if (isFieldDef(dimensionChannelDef)) {\n const s = dimensionChannelDef.sort;\n if (isArray(s)) {\n return {\n field: vgField(dimensionChannelDef, { prefix: dimensionChannel, suffix: 'sort_index', expr: 'datum' })\n };\n }\n else if (isSortField(s)) {\n return {\n field: vgField({\n // FIXME: this op might not already exist?\n // FIXME: what if dimensionChannel (x or y) contains custom domain?\n aggregate: isAggregate(model.encoding) ? s.op : undefined,\n field: s.field\n }, { expr: 'datum' })\n };\n }\n else if (isSortByEncoding(s)) {\n const fieldDefToSort = model.fieldDef(s.encoding);\n return {\n field: vgField(fieldDefToSort, { expr: 'datum' }),\n order: s.order\n };\n }\n else if (s === null) {\n return undefined;\n }\n else {\n return {\n field: vgField(dimensionChannelDef, {\n // For stack with imputation, we only have bin_mid\n binSuffix: model.stack && model.stack.impute ? 'mid' : undefined,\n expr: 'datum'\n })\n };\n }\n }\n return undefined;\n }\n return undefined;\n}\nfunction getMarkGroup(model, opt = { fromPrefix: '' }) {\n const { mark, markDef, encoding, config } = model;\n const clip = getFirstDefined(markDef.clip, scaleClip(model), projectionClip(model));\n const style = getStyles(markDef);\n const key = encoding.key;\n const sort = getSort(model);\n const interactive = interactiveFlag(model);\n const aria = getMarkPropOrConfig('aria', markDef, config);\n const postEncodingTransform = markCompiler[mark].postEncodingTransform\n ? markCompiler[mark].postEncodingTransform(model)\n : null;\n return [\n Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ name: model.getName('marks'), type: markCompiler[mark].vgMark }, (clip ? { clip: true } : {})), (style ? { style } : {})), (key ? { key: key.field } : {})), (sort ? { sort } : {})), (interactive ? interactive : {})), (aria === false ? { aria } : {})), { from: { data: opt.fromPrefix + model.requestDataName(DataSourceType.Main) }, encode: {\n update: markCompiler[mark].encodeEntry(model)\n } }), (postEncodingTransform\n ? {\n transform: postEncodingTransform\n }\n : {}))\n ];\n}\n/**\n * If scales are bound to interval selections, we want to automatically clip\n * marks to account for panning/zooming interactions. We identify bound scales\n * by the selectionExtent property, which gets added during scale parsing.\n */\nfunction scaleClip(model) {\n const xScale = model.getScaleComponent('x');\n const yScale = model.getScaleComponent('y');\n return (xScale && xScale.get('selectionExtent')) || (yScale && yScale.get('selectionExtent')) ? true : undefined;\n}\n/**\n * If we use a custom projection with auto-fitting to the geodata extent,\n * we need to clip to ensure the chart size doesn't explode.\n */\nfunction projectionClip(model) {\n const projection = model.component.projection;\n return projection && !projection.isFit ? true : undefined;\n}\n/**\n * Only output interactive flags if we have selections defined somewhere in our model hierarchy.\n */\nfunction interactiveFlag(model) {\n if (!model.component.selection)\n return null;\n const unitCount = keys(model.component.selection).length;\n let parentCount = unitCount;\n let parent = model.parent;\n while (parent && parentCount === 0) {\n parentCount = keys(parent.component.selection).length;\n parent = parent.parent;\n }\n return parentCount\n ? {\n interactive: unitCount > 0 || !!model.encoding.tooltip\n }\n : null;\n}\n//# sourceMappingURL=mark.js.map","import * as encode from './encode';\nexport const arc = {\n vgMark: 'arc',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'ignore',\n orient: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.rectPosition(model, 'radius', 'arc')), encode.rectPosition(model, 'theta', 'arc'));\n }\n};\n//# sourceMappingURL=arc.js.map","import * as encode from './encode';\nexport const area = {\n vgMark: 'area',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'include',\n size: 'ignore',\n theta: 'ignore'\n })), encode.pointOrRangePosition('x', model, {\n defaultPos: 'zeroOrMin',\n defaultPos2: 'zeroOrMin',\n range: model.markDef.orient === 'horizontal'\n })), encode.pointOrRangePosition('y', model, {\n defaultPos: 'zeroOrMin',\n defaultPos2: 'zeroOrMin',\n range: model.markDef.orient === 'vertical'\n })), encode.defined(model));\n }\n};\n//# sourceMappingURL=area.js.map","import * as encode from './encode';\nexport const bar = {\n vgMark: 'rect',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.rectPosition(model, 'x', 'bar')), encode.rectPosition(model, 'y', 'bar'));\n }\n};\n//# sourceMappingURL=bar.js.map","import { isFieldDef, vgField } from '../../channeldef';\nimport { GEOJSON } from '../../type';\nimport * as encode from './encode';\nexport const geoshape = {\n vgMark: 'shape',\n encodeEntry: (model) => {\n return Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'ignore',\n orient: 'ignore',\n theta: 'ignore'\n }));\n },\n postEncodingTransform: (model) => {\n const { encoding } = model;\n const shapeDef = encoding.shape;\n const transform = Object.assign({ type: 'geoshape', projection: model.projectionName() }, (shapeDef && isFieldDef(shapeDef) && shapeDef.type === GEOJSON\n ? { field: vgField(shapeDef, { expr: 'datum' }) }\n : {}));\n return [transform];\n }\n};\n//# sourceMappingURL=geoshape.js.map","import * as encode from './encode';\nexport const image = {\n vgMark: 'image',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'ignore',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.rectPosition(model, 'x', 'image')), encode.rectPosition(model, 'y', 'image')), encode.text(model, 'url'));\n }\n};\n//# sourceMappingURL=image.js.map","import * as encode from './encode';\nexport const line = {\n vgMark: 'line',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'ignore',\n orient: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.nonPosition('size', model, {\n vgChannel: 'strokeWidth' // VL's line size is strokeWidth\n })), encode.defined(model));\n }\n};\nexport const trail = {\n vgMark: 'trail',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'include',\n orient: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.nonPosition('size', model)), encode.defined(model));\n }\n};\n//# sourceMappingURL=line.js.map","import * as encode from './encode';\nexport const rect = {\n vgMark: 'rect',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.rectPosition(model, 'x', 'rect')), encode.rectPosition(model, 'y', 'rect'));\n }\n};\n//# sourceMappingURL=rect.js.map","import * as encode from './encode';\nexport const rule = {\n vgMark: 'rule',\n encodeEntry: (model) => {\n const { markDef } = model;\n const orient = markDef.orient;\n if (!model.encoding.x && !model.encoding.y && !model.encoding.latitude && !model.encoding.longitude) {\n // Show nothing if we have none of x, y, lat, and long.\n return {};\n }\n return Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.pointOrRangePosition('x', model, {\n defaultPos: orient === 'horizontal' ? 'zeroOrMax' : 'mid',\n defaultPos2: 'zeroOrMin',\n range: orient !== 'vertical' // include x2 for horizontal or line segment rule\n })), encode.pointOrRangePosition('y', model, {\n defaultPos: orient === 'vertical' ? 'zeroOrMax' : 'mid',\n defaultPos2: 'zeroOrMin',\n range: orient !== 'horizontal' // include y2 for vertical or line segment rule\n })), encode.nonPosition('size', model, {\n vgChannel: 'strokeWidth' // VL's rule size is strokeWidth\n }));\n }\n};\n//# sourceMappingURL=rule.js.map","import { getMarkPropOrConfig } from '../common';\nimport * as encode from './encode';\nexport const text = {\n vgMark: 'text',\n encodeEntry: (model) => {\n const { config, encoding } = model;\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'include',\n baseline: 'include',\n color: 'include',\n size: 'ignore',\n orient: 'ignore',\n theta: 'include'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.text(model)), encode.nonPosition('size', model, {\n vgChannel: 'fontSize' // VL's text size is fontSize\n })), encode.nonPosition('angle', model)), encode.valueIfDefined('align', align(model.markDef, encoding, config))), encode.valueIfDefined('baseline', baseline(model.markDef, encoding, config))), encode.pointPosition('radius', model, { defaultPos: null, isMidPoint: true })), encode.pointPosition('theta', model, { defaultPos: null, isMidPoint: true }));\n }\n};\nfunction align(markDef, encoding, config) {\n const a = getMarkPropOrConfig('align', markDef, config);\n if (a === undefined) {\n return 'center';\n }\n // If there is a config, Vega-parser will process this already.\n return undefined;\n}\nfunction baseline(markDef, encoding, config) {\n const b = getMarkPropOrConfig('baseline', markDef, config);\n if (b === undefined) {\n return 'middle';\n }\n // If there is a config, Vega-parser will process this already.\n return undefined;\n}\n//# sourceMappingURL=text.js.map","import { isArray } from 'vega-util';\nimport { isConditionalAxisValue } from '../axis';\nimport { GEOPOSITION_CHANNELS, NONPOSITION_SCALE_CHANNELS, POSITION_SCALE_CHANNELS, SCALE_CHANNELS, supportLegend, X, Y } from '../channel';\nimport { getFieldDef, getFieldOrDatumDef, isFieldOrDatumDef, isTypedFieldDef } from '../channeldef';\nimport { isGraticuleGenerator } from '../data';\nimport * as vlEncoding from '../encoding';\nimport { initEncoding } from '../encoding';\nimport { replaceExprRefInIndex } from '../expr';\nimport { GEOSHAPE, isMarkDef } from '../mark';\nimport { isFrameMixins } from '../spec/base';\nimport { stack } from '../stack';\nimport { keys } from '../util';\nimport { assembleAxisSignals } from './axis/assemble';\nimport { parseUnitAxes } from './axis/parse';\nimport { signalOrValueRefWithCondition, signalRefOrValue } from './common';\nimport { parseData } from './data/parse';\nimport { assembleLayoutSignals } from './layoutsize/assemble';\nimport { initLayoutSize } from './layoutsize/init';\nimport { parseUnitLayoutSize } from './layoutsize/parse';\nimport { defaultFilled, initMarkdef } from './mark/init';\nimport { parseMarkGroups } from './mark/mark';\nimport { isLayerModel, ModelWithField } from './model';\nimport { assembleTopLevelSignals, assembleUnitSelectionData, assembleUnitSelectionMarks, assembleUnitSelectionSignals } from './selection/assemble';\nimport { parseUnitSelection } from './selection/parse';\n/**\n * Internal model of Vega-Lite specification for the compiler.\n */\nexport class UnitModel extends ModelWithField {\n constructor(spec, parent, parentGivenName, parentGivenSize = {}, config) {\n super(spec, 'unit', parent, parentGivenName, config, undefined, isFrameMixins(spec) ? spec.view : undefined);\n this.specifiedScales = {};\n this.specifiedAxes = {};\n this.specifiedLegends = {};\n this.specifiedProjection = {};\n this.selection = {};\n this.children = [];\n const markDef = isMarkDef(spec.mark) ? Object.assign({}, spec.mark) : { type: spec.mark };\n const mark = markDef.type;\n // Need to init filled before other mark properties because encoding depends on filled but other mark properties depend on types inside encoding\n if (markDef.filled === undefined) {\n markDef.filled = defaultFilled(markDef, config, {\n graticule: spec.data && isGraticuleGenerator(spec.data)\n });\n }\n const encoding = (this.encoding = initEncoding(spec.encoding || {}, mark, markDef.filled, config));\n this.markDef = initMarkdef(markDef, encoding, config);\n this.size = initLayoutSize({\n encoding: encoding,\n size: isFrameMixins(spec)\n ? Object.assign(Object.assign(Object.assign({}, parentGivenSize), (spec.width ? { width: spec.width } : {})), (spec.height ? { height: spec.height } : {})) : parentGivenSize\n });\n // calculate stack properties\n this.stack = stack(mark, encoding);\n this.specifiedScales = this.initScales(mark, encoding);\n this.specifiedAxes = this.initAxes(encoding);\n this.specifiedLegends = this.initLegends(encoding);\n this.specifiedProjection = spec.projection;\n // Selections will be initialized upon parse.\n this.selection = spec.selection;\n }\n get hasProjection() {\n const { encoding } = this;\n const isGeoShapeMark = this.mark === GEOSHAPE;\n const hasGeoPosition = encoding && GEOPOSITION_CHANNELS.some(channel => isFieldOrDatumDef(encoding[channel]));\n return isGeoShapeMark || hasGeoPosition;\n }\n /**\n * Return specified Vega-Lite scale domain for a particular channel\n * @param channel\n */\n scaleDomain(channel) {\n const scale = this.specifiedScales[channel];\n return scale ? scale.domain : undefined;\n }\n axis(channel) {\n return this.specifiedAxes[channel];\n }\n legend(channel) {\n return this.specifiedLegends[channel];\n }\n initScales(mark, encoding) {\n return SCALE_CHANNELS.reduce((scales, channel) => {\n var _a;\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n if (fieldOrDatumDef) {\n scales[channel] = this.initScale((_a = fieldOrDatumDef.scale) !== null && _a !== void 0 ? _a : {});\n }\n return scales;\n }, {});\n }\n initScale(scale) {\n const { domain, range } = scale;\n const scaleInternal = replaceExprRefInIndex(scale);\n if (isArray(domain)) {\n scaleInternal.domain = domain.map(signalRefOrValue);\n }\n if (isArray(range)) {\n scaleInternal.range = range.map(signalRefOrValue);\n }\n return scaleInternal;\n }\n initAxes(encoding) {\n return POSITION_SCALE_CHANNELS.reduce((_axis, channel) => {\n // Position Axis\n // TODO: handle ConditionFieldDef\n const channelDef = encoding[channel];\n if (isFieldOrDatumDef(channelDef) ||\n (channel === X && isFieldOrDatumDef(encoding.x2)) ||\n (channel === Y && isFieldOrDatumDef(encoding.y2))) {\n const axisSpec = isFieldOrDatumDef(channelDef) ? channelDef.axis : undefined;\n _axis[channel] = axisSpec\n ? this.initAxis(Object.assign({}, axisSpec)) // convert truthy value to object\n : axisSpec;\n }\n return _axis;\n }, {});\n }\n initAxis(axis) {\n const props = keys(axis);\n const axisInternal = {};\n for (const prop of props) {\n const val = axis[prop];\n axisInternal[prop] = isConditionalAxisValue(val)\n ? signalOrValueRefWithCondition(val)\n : signalRefOrValue(val);\n }\n return axisInternal;\n }\n initLegends(encoding) {\n return NONPOSITION_SCALE_CHANNELS.reduce((_legend, channel) => {\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n if (fieldOrDatumDef && supportLegend(channel)) {\n const legend = fieldOrDatumDef.legend;\n _legend[channel] = legend\n ? replaceExprRefInIndex(legend) // convert truthy value to object\n : legend;\n }\n return _legend;\n }, {});\n }\n parseData() {\n this.component.data = parseData(this);\n }\n parseLayoutSize() {\n parseUnitLayoutSize(this);\n }\n parseSelections() {\n this.component.selection = parseUnitSelection(this, this.selection);\n }\n parseMarkGroup() {\n this.component.mark = parseMarkGroups(this);\n }\n parseAxesAndHeaders() {\n this.component.axes = parseUnitAxes(this);\n }\n assembleSelectionTopLevelSignals(signals) {\n return assembleTopLevelSignals(this, signals);\n }\n assembleSignals() {\n return [...assembleAxisSignals(this), ...assembleUnitSelectionSignals(this, [])];\n }\n assembleSelectionData(data) {\n return assembleUnitSelectionData(this, data);\n }\n assembleLayout() {\n return null;\n }\n assembleLayoutSignals() {\n return assembleLayoutSignals(this);\n }\n assembleMarks() {\n var _a;\n let marks = (_a = this.component.mark) !== null && _a !== void 0 ? _a : [];\n // If this unit is part of a layer, selections should augment\n // all in concert rather than each unit individually. This\n // ensures correct interleaving of clipping and brushed marks.\n if (!this.parent || !isLayerModel(this.parent)) {\n marks = assembleUnitSelectionMarks(this, marks);\n }\n return marks.map(this.correctDataNames);\n }\n getMapping() {\n return this.encoding;\n }\n get mark() {\n return this.markDef.type;\n }\n channelHasField(channel) {\n return vlEncoding.channelHasField(this.encoding, channel);\n }\n fieldDef(channel) {\n const channelDef = this.encoding[channel];\n return getFieldDef(channelDef);\n }\n typedFieldDef(channel) {\n const fieldDef = this.fieldDef(channel);\n if (isTypedFieldDef(fieldDef)) {\n return fieldDef;\n }\n return null;\n }\n}\n//# sourceMappingURL=unit.js.map","import { isBinned, isBinning } from '../../bin';\nimport { isContinuousFieldOrDatumDef, isFieldDef, isNumericDataDef } from '../../channeldef';\nimport { isAggregate } from '../../encoding';\nimport { replaceExprRefInIndex } from '../../expr';\nimport * as log from '../../log';\nimport { AREA, BAR, BAR_CORNER_RADIUS_INDEX as BAR_CORNER_RADIUS_END_INDEX, CIRCLE, IMAGE, LINE, POINT, RECT, RULE, SQUARE, TEXT, TICK } from '../../mark';\nimport { QUANTITATIVE, TEMPORAL } from '../../type';\nimport { contains, getFirstDefined } from '../../util';\nimport { getMarkConfig, getMarkPropOrConfig } from '../common';\nexport function initMarkdef(originalMarkDef, encoding, config) {\n const markDef = replaceExprRefInIndex(originalMarkDef);\n // set orient, which can be overridden by rules as sometimes the specified orient is invalid.\n const specifiedOrient = getMarkPropOrConfig('orient', markDef, config);\n markDef.orient = orient(markDef.type, encoding, specifiedOrient);\n if (specifiedOrient !== undefined && specifiedOrient !== markDef.orient) {\n log.warn(log.message.orientOverridden(markDef.orient, specifiedOrient));\n }\n if (markDef.type === 'bar' && markDef.orient) {\n const cornerRadiusEnd = getMarkPropOrConfig('cornerRadiusEnd', markDef, config);\n if (cornerRadiusEnd !== undefined) {\n const newProps = (markDef.orient === 'horizontal' && encoding.x2) || (markDef.orient === 'vertical' && encoding.y2)\n ? ['cornerRadius']\n : BAR_CORNER_RADIUS_END_INDEX[markDef.orient];\n for (const newProp of newProps) {\n markDef[newProp] = cornerRadiusEnd;\n }\n if (markDef.cornerRadiusEnd !== undefined) {\n delete markDef.cornerRadiusEnd; // no need to keep the original cap cornerRadius\n }\n }\n }\n // set opacity and filled if not specified in mark config\n const specifiedOpacity = getMarkPropOrConfig('opacity', markDef, config);\n if (specifiedOpacity === undefined) {\n markDef.opacity = opacity(markDef.type, encoding);\n }\n // set cursor, which should be pointer if href channel is present unless otherwise specified\n const specifiedCursor = getMarkPropOrConfig('cursor', markDef, config);\n if (specifiedCursor === undefined) {\n markDef.cursor = cursor(markDef, encoding, config);\n }\n return markDef;\n}\nfunction cursor(markDef, encoding, config) {\n if (encoding.href || markDef.href || getMarkPropOrConfig('href', markDef, config)) {\n return 'pointer';\n }\n return markDef.cursor;\n}\nfunction opacity(mark, encoding) {\n if (contains([POINT, TICK, CIRCLE, SQUARE], mark)) {\n // point-based marks\n if (!isAggregate(encoding)) {\n return 0.7;\n }\n }\n return undefined;\n}\nexport function defaultFilled(markDef, config, { graticule }) {\n if (graticule) {\n return false;\n }\n const filledConfig = getMarkConfig('filled', markDef, config);\n const mark = markDef.type;\n return getFirstDefined(filledConfig, mark !== POINT && mark !== LINE && mark !== RULE);\n}\nfunction orient(mark, encoding, specifiedOrient) {\n switch (mark) {\n case POINT:\n case CIRCLE:\n case SQUARE:\n case TEXT:\n case RECT:\n case IMAGE:\n // orient is meaningless for these marks.\n return undefined;\n }\n const { x, y, x2, y2 } = encoding;\n switch (mark) {\n case BAR:\n if (isFieldDef(x) && (isBinned(x.bin) || (isFieldDef(y) && y.aggregate && !x.aggregate))) {\n return 'vertical';\n }\n if (isFieldDef(y) && (isBinned(y.bin) || (isFieldDef(x) && x.aggregate && !y.aggregate))) {\n return 'horizontal';\n }\n if (y2 || x2) {\n // Ranged bar does not always have clear orientation, so we allow overriding\n if (specifiedOrient) {\n return specifiedOrient;\n }\n // If y is range and x is non-range, non-bin Q, y is likely a prebinned field\n if (!x2) {\n if ((isFieldDef(x) && x.type === QUANTITATIVE && !isBinning(x.bin)) || isNumericDataDef(x)) {\n return 'horizontal';\n }\n }\n // If x is range and y is non-range, non-bin Q, x is likely a prebinned field\n if (!y2) {\n if ((isFieldDef(y) && y.type === QUANTITATIVE && !isBinning(y.bin)) || isNumericDataDef(y)) {\n return 'vertical';\n }\n }\n }\n // falls through\n case RULE:\n // return undefined for line segment rule and bar with both axis ranged\n // we have to ignore the case that the data are already binned\n if (x2 && !(isFieldDef(x) && isBinned(x.bin)) && y2 && !(isFieldDef(y) && isBinned(y.bin))) {\n return undefined;\n }\n // falls through\n case AREA:\n // If there are range for both x and y, y (vertical) has higher precedence.\n if (y2) {\n if (isFieldDef(y) && isBinned(y.bin)) {\n return 'horizontal';\n }\n else {\n return 'vertical';\n }\n }\n else if (x2) {\n if (isFieldDef(x) && isBinned(x.bin)) {\n return 'vertical';\n }\n else {\n return 'horizontal';\n }\n }\n else if (mark === RULE) {\n if (x && !y) {\n return 'vertical';\n }\n else if (y && !x) {\n return 'horizontal';\n }\n }\n // falls through\n case LINE:\n case TICK: {\n // Tick is opposite to bar, line, area and never have ranged mark.\n const xIsContinuous = isContinuousFieldOrDatumDef(x);\n const yIsContinuous = isContinuousFieldOrDatumDef(y);\n if (xIsContinuous && !yIsContinuous) {\n return mark !== 'tick' ? 'horizontal' : 'vertical';\n }\n else if (!xIsContinuous && yIsContinuous) {\n return mark !== 'tick' ? 'vertical' : 'horizontal';\n }\n else if (xIsContinuous && yIsContinuous) {\n const xDef = x; // we can cast here since they are surely fieldDef\n const yDef = y;\n const xIsTemporal = xDef.type === TEMPORAL;\n const yIsTemporal = yDef.type === TEMPORAL;\n // temporal without timeUnit is considered continuous, but better serves as dimension\n if (xIsTemporal && !yIsTemporal) {\n return mark !== 'tick' ? 'vertical' : 'horizontal';\n }\n else if (!xIsTemporal && yIsTemporal) {\n return mark !== 'tick' ? 'horizontal' : 'vertical';\n }\n if (!xDef.aggregate && yDef.aggregate) {\n return mark !== 'tick' ? 'vertical' : 'horizontal';\n }\n else if (xDef.aggregate && !yDef.aggregate) {\n return mark !== 'tick' ? 'horizontal' : 'vertical';\n }\n if (specifiedOrient) {\n // When ambiguous, use user specified one.\n return specifiedOrient;\n }\n return 'vertical';\n }\n else {\n // Discrete x Discrete case\n if (specifiedOrient) {\n // When ambiguous, use user specified one.\n return specifiedOrient;\n }\n return undefined;\n }\n }\n }\n return 'vertical';\n}\n//# sourceMappingURL=init.js.map","import { getSizeChannel, POSITION_SCALE_CHANNELS } from '../../channel';\nimport { isContinuousFieldOrDatumDef } from '../../channeldef';\nimport * as log from '../../log';\nimport { isStep } from '../../spec/base';\nexport function initLayoutSize({ encoding, size }) {\n for (const channel of POSITION_SCALE_CHANNELS) {\n const sizeType = getSizeChannel(channel);\n if (isStep(size[sizeType])) {\n if (isContinuousFieldOrDatumDef(encoding[channel])) {\n delete size[sizeType];\n log.warn(log.message.stepDropped(sizeType));\n }\n }\n }\n return size;\n}\n//# sourceMappingURL=init.js.map","import * as log from '../log';\nimport { isLayerSpec, isUnitSpec } from '../spec';\nimport { keys } from '../util';\nimport { assembleAxisSignals } from './axis/assemble';\nimport { parseLayerAxes } from './axis/parse';\nimport { parseData } from './data/parse';\nimport { assembleLayoutSignals } from './layoutsize/assemble';\nimport { parseLayerLayoutSize } from './layoutsize/parse';\nimport { assembleLegends } from './legend/assemble';\nimport { Model } from './model';\nimport { assembleLayerSelectionMarks } from './selection/assemble';\nimport { UnitModel } from './unit';\nexport class LayerModel extends Model {\n constructor(spec, parent, parentGivenName, parentGivenSize, config) {\n super(spec, 'layer', parent, parentGivenName, config, spec.resolve, spec.view);\n const layoutSize = Object.assign(Object.assign(Object.assign({}, parentGivenSize), (spec.width ? { width: spec.width } : {})), (spec.height ? { height: spec.height } : {}));\n this.children = spec.layer.map((layer, i) => {\n if (isLayerSpec(layer)) {\n return new LayerModel(layer, this, this.getName('layer_' + i), layoutSize, config);\n }\n else if (isUnitSpec(layer)) {\n return new UnitModel(layer, this, this.getName('layer_' + i), layoutSize, config);\n }\n throw new Error(log.message.invalidSpec(layer));\n });\n }\n parseData() {\n this.component.data = parseData(this);\n for (const child of this.children) {\n child.parseData();\n }\n }\n parseLayoutSize() {\n parseLayerLayoutSize(this);\n }\n parseSelections() {\n // Merge selections up the hierarchy so that they may be referenced\n // across unit specs. Persist their definitions within each child\n // to assemble signals which remain within output Vega unit groups.\n this.component.selection = {};\n for (const child of this.children) {\n child.parseSelections();\n for (const key of keys(child.component.selection)) {\n this.component.selection[key] = child.component.selection[key];\n }\n }\n }\n parseMarkGroup() {\n for (const child of this.children) {\n child.parseMarkGroup();\n }\n }\n parseAxesAndHeaders() {\n parseLayerAxes(this);\n }\n assembleSelectionTopLevelSignals(signals) {\n return this.children.reduce((sg, child) => child.assembleSelectionTopLevelSignals(sg), signals);\n }\n // TODO: Support same named selections across children.\n assembleSignals() {\n return this.children.reduce((signals, child) => {\n return signals.concat(child.assembleSignals());\n }, assembleAxisSignals(this));\n }\n assembleLayoutSignals() {\n return this.children.reduce((signals, child) => {\n return signals.concat(child.assembleLayoutSignals());\n }, assembleLayoutSignals(this));\n }\n assembleSelectionData(data) {\n return this.children.reduce((db, child) => child.assembleSelectionData(db), data);\n }\n assembleTitle() {\n let title = super.assembleTitle();\n if (title) {\n return title;\n }\n // If title does not provide layer, look into children\n for (const child of this.children) {\n title = child.assembleTitle();\n if (title) {\n return title;\n }\n }\n return undefined;\n }\n assembleLayout() {\n return null;\n }\n assembleMarks() {\n return assembleLayerSelectionMarks(this, this.children.flatMap(child => {\n return child.assembleMarks();\n }));\n }\n assembleLegends() {\n return this.children.reduce((legends, child) => {\n return legends.concat(child.assembleLegends());\n }, assembleLegends(this));\n }\n}\n//# sourceMappingURL=layer.js.map","import * as log from '../log';\nimport { isAnyConcatSpec, isFacetSpec, isLayerSpec, isUnitSpec } from '../spec';\nimport { ConcatModel } from './concat';\nimport { FacetModel } from './facet';\nimport { LayerModel } from './layer';\nimport { UnitModel } from './unit';\nexport function buildModel(spec, parent, parentGivenName, unitSize, config) {\n if (isFacetSpec(spec)) {\n return new FacetModel(spec, parent, parentGivenName, config);\n }\n else if (isLayerSpec(spec)) {\n return new LayerModel(spec, parent, parentGivenName, unitSize, config);\n }\n else if (isUnitSpec(spec)) {\n return new UnitModel(spec, parent, parentGivenName, unitSize, config);\n }\n else if (isAnyConcatSpec(spec)) {\n return new ConcatModel(spec, parent, parentGivenName, config);\n }\n throw new Error(log.message.invalidSpec(spec));\n}\n//# sourceMappingURL=buildmodel.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isString, mergeConfig } from 'vega-util';\nimport { getPositionScaleChannel } from '../channel';\nimport * as vlFieldDef from '../channeldef';\nimport { initConfig, stripAndRedirectConfig } from '../config';\nimport * as log from '../log';\nimport { normalize } from '../normalize';\nimport { assembleParameterSignals } from '../parameter';\nimport { extractTopLevelProperties, getFitType, isFitType } from '../spec/toplevel';\nimport { keys } from '../util';\nimport { buildModel } from './buildmodel';\nimport { assembleRootData } from './data/assemble';\nimport { optimizeDataflow } from './data/optimize';\n/**\n * Vega-Lite's main function, for compiling Vega-Lite spec into Vega spec.\n *\n * At a high-level, we make the following transformations in different phases:\n *\n * Input spec\n * |\n * | (Normalization)\n * v\n * Normalized Spec (Row/Column channels in single-view specs becomes faceted specs, composite marks becomes layered specs.)\n * |\n * | (Build Model)\n * v\n * A model tree of the spec\n * |\n * | (Parse)\n * v\n * A model tree with parsed components (intermediate structure of visualization primitives in a format that can be easily merged)\n * |\n * | (Optimize)\n * v\n * A model tree with parsed components with the data component optimized\n * |\n * | (Assemble)\n * v\n * Vega spec\n *\n * @param inputSpec The Vega-Lite specification.\n * @param opt Optional arguments passed to the Vega-Lite compiler.\n * @returns An object containing the compiled Vega spec and normalized Vega-Lite spec.\n */\nexport function compile(inputSpec, opt = {}) {\n // 0. Augment opt with default opts\n if (opt.logger) {\n // set the singleton logger to the provided logger\n log.set(opt.logger);\n }\n if (opt.fieldTitle) {\n // set the singleton field title formatter\n vlFieldDef.setTitleFormatter(opt.fieldTitle);\n }\n try {\n // 1. Initialize config by deep merging default config with the config provided via option and the input spec.\n const config = initConfig(mergeConfig(opt.config, inputSpec.config));\n // 2. Normalize: Convert input spec -> normalized spec\n // - Decompose all extended unit specs into composition of unit spec. For example, a box plot get expanded into multiple layers of bars, ticks, and rules. The shorthand row/column channel is also expanded to a facet spec.\n // - Normalize autosize and width or height spec\n const spec = normalize(inputSpec, config);\n // 3. Build Model: normalized spec -> Model (a tree structure)\n // This phases instantiates the models with default config by doing a top-down traversal. This allows us to pass properties that child models derive from their parents via their constructors.\n // See the abstract `Model` class and its children (UnitModel, LayerModel, FacetModel, ConcatModel) for different types of models.\n const model = buildModel(spec, null, '', undefined, config);\n // 4 Parse: Model --> Model with components\n // Note that components = intermediate representations that are equivalent to Vega specs.\n // We need these intermediate representation because we need to merge many visualization \"components\" like projections, scales, axes, and legends.\n // We will later convert these components into actual Vega specs in the assemble phase.\n // In this phase, we do a bottom-up traversal over the whole tree to\n // parse for each type of components once (e.g., data, layout, mark, scale).\n // By doing bottom-up traversal, we start parsing components of unit specs and\n // then merge child components of parent composite specs.\n //\n // Please see inside model.parse() for order of different components parsed.\n model.parse();\n // drawDataflow(model.component.data.sources);\n // 5. Optimize the dataflow. This will modify the data component of the model.\n optimizeDataflow(model.component.data, model);\n // drawDataflow(model.component.data.sources);\n // 6. Assemble: convert model components --> Vega Spec.\n const vgSpec = assembleTopLevelModel(model, getTopLevelProperties(inputSpec, spec.autosize, config, model), inputSpec.datasets, inputSpec.usermeta);\n return {\n spec: vgSpec,\n normalized: spec\n };\n }\n finally {\n // Reset the singleton logger if a logger is provided\n if (opt.logger) {\n log.reset();\n }\n // Reset the singleton field title formatter if provided\n if (opt.fieldTitle) {\n vlFieldDef.resetTitleFormatter();\n }\n }\n}\nfunction getTopLevelProperties(inputSpec, autosize, config, model) {\n const width = model.component.layoutSize.get('width');\n const height = model.component.layoutSize.get('height');\n if (autosize === undefined) {\n autosize = { type: 'pad' };\n if (model.hasAxisOrientSignalRef()) {\n autosize.resize = true;\n }\n }\n else if (isString(autosize)) {\n autosize = { type: autosize };\n }\n if (width && height && isFitType(autosize.type)) {\n if (width === 'step' && height === 'step') {\n log.warn(log.message.droppingFit());\n autosize.type = 'pad';\n }\n else if (width === 'step' || height === 'step') {\n // effectively XOR, because else if\n // get step dimension\n const sizeType = width === 'step' ? 'width' : 'height';\n // log that we're dropping fit for respective channel\n log.warn(log.message.droppingFit(getPositionScaleChannel(sizeType)));\n // setting type to inverse fit (so if we dropped fit-x, type is now fit-y)\n const inverseSizeType = sizeType === 'width' ? 'height' : 'width';\n autosize.type = getFitType(inverseSizeType);\n }\n }\n return Object.assign(Object.assign(Object.assign({}, (keys(autosize).length === 1 && autosize.type\n ? autosize.type === 'pad'\n ? {}\n : { autosize: autosize.type }\n : { autosize })), extractTopLevelProperties(config, false)), extractTopLevelProperties(inputSpec, true));\n}\n/*\n * Assemble the top-level model to a Vega spec.\n *\n * Note: this couldn't be `model.assemble()` since the top-level model\n * needs some special treatment to generate top-level properties.\n */\nfunction assembleTopLevelModel(model, topLevelProperties, datasets = {}, usermeta) {\n // Config with Vega-Lite only config removed.\n const vgConfig = model.config ? stripAndRedirectConfig(model.config) : undefined;\n const data = [].concat(model.assembleSelectionData([]), \n // only assemble data in the root\n assembleRootData(model.component.data, datasets));\n const projections = model.assembleProjections();\n const title = model.assembleTitle();\n const style = model.assembleGroupStyle();\n const encodeEntry = model.assembleGroupEncodeEntry(true);\n let layoutSignals = model.assembleLayoutSignals();\n // move width and height signals with values to top level\n layoutSignals = layoutSignals.filter(signal => {\n if ((signal.name === 'width' || signal.name === 'height') && signal.value !== undefined) {\n topLevelProperties[signal.name] = +signal.value;\n return false;\n }\n return true;\n });\n const { params } = topLevelProperties, otherTopLevelProps = __rest(topLevelProperties, [\"params\"]);\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ $schema: 'https://vega.github.io/schema/vega/v5.json' }, (model.description ? { description: model.description } : {})), otherTopLevelProps), (title ? { title } : {})), (style ? { style } : {})), (encodeEntry ? { encode: { update: encodeEntry } } : {})), { data }), (projections.length > 0 ? { projections: projections } : {})), model.assembleGroup([\n ...layoutSignals,\n ...model.assembleSelectionTopLevelSignals([]),\n ...assembleParameterSignals(params)\n ])), (vgConfig ? { config: vgConfig } : {})), (usermeta ? { usermeta } : {}));\n}\n//# sourceMappingURL=compile.js.map","function e(e){const[n,r]=/schema\\/([\\w-]+)\\/([\\w\\.\\-]+)\\.json$/g.exec(e).slice(1,3);return{library:n,version:r}}export default e;\n//# sourceMappingURL=parser.module.js.map\n","var name = \"vega-themes\";\nvar version$1 = \"2.12.1\";\nvar description = \"Themes for stylized Vega and Vega-Lite visualizations.\";\nvar keywords = [\n\t\"vega\",\n\t\"vega-lite\",\n\t\"themes\",\n\t\"style\"\n];\nvar license = \"BSD-3-Clause\";\nvar author = {\n\tname: \"UW Interactive Data Lab\",\n\turl: \"https://idl.cs.washington.edu\"\n};\nvar contributors = [\n\t{\n\t\tname: \"Emily Gu\",\n\t\turl: \"https://github.com/emilygu\"\n\t},\n\t{\n\t\tname: \"Arvind Satyanarayan\",\n\t\turl: \"http://arvindsatya.com\"\n\t},\n\t{\n\t\tname: \"Jeffrey Heer\",\n\t\turl: \"https://idl.cs.washington.edu\"\n\t},\n\t{\n\t\tname: \"Dominik Moritz\",\n\t\turl: \"https://www.domoritz.de\"\n\t}\n];\nvar main = \"build/vega-themes.js\";\nvar module = \"build/vega-themes.module.js\";\nvar unpkg = \"build/vega-themes.min.js\";\nvar jsdelivr = \"build/vega-themes.min.js\";\nvar types = \"build/vega-themes.module.d.ts\";\nvar repository = {\n\ttype: \"git\",\n\turl: \"https://github.com/vega/vega-themes.git\"\n};\nvar files = [\n\t\"src\",\n\t\"build\"\n];\nvar scripts = {\n\tprebuild: \"yarn clean\",\n\tbuild: \"rollup -c\",\n\tclean: \"rimraf build && rimraf examples/build\",\n\t\"copy:data\": \"rsync -r node_modules/vega-datasets/data/* examples/data\",\n\t\"copy:build\": \"rsync -r build/* examples/build\",\n\t\"deploy:gh\": \"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples\",\n\tpreversion: \"yarn lint\",\n\tserve: \"browser-sync start -s -f build examples --serveStatic examples\",\n\tstart: \"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'\",\n\tprepare: \"beemo create-config\",\n\teslintbase: \"beemo eslint .\",\n\tformat: \"yarn eslintbase --fix\",\n\tlint: \"yarn eslintbase\",\n\trelease: \"release-it\"\n};\nvar devDependencies = {\n\t\"@release-it/conventional-changelog\": \"^5.1.1\",\n\t\"@rollup/plugin-json\": \"^6.0.0\",\n\t\"@rollup/plugin-node-resolve\": \"^15.0.1\",\n\t\"@rollup/plugin-terser\": \"^0.4.0\",\n\t\"browser-sync\": \"^2.27.10\",\n\tconcurrently: \"^7.3.0\",\n\t\"gh-pages\": \"^5.0.0\",\n\t\"release-it\": \"^15.6.0\",\n\t\"rollup-plugin-bundle-size\": \"^1.0.3\",\n\t\"rollup-plugin-ts\": \"^3.0.2\",\n\trollup: \"^3.15.0\",\n\ttypescript: \"^4.7.4\",\n\t\"vega-lite-dev-config\": \"^0.21.0\",\n\t\"vega-lite\": \"^5.0.0\",\n\tvega: \"^5.19.1\"\n};\nvar peerDependencies = {\n\tvega: \"*\",\n\t\"vega-lite\": \"*\"\n};\nvar dependencies = {\n};\nvar pkg = {\n\tname: name,\n\tversion: version$1,\n\tdescription: description,\n\tkeywords: keywords,\n\tlicense: license,\n\tauthor: author,\n\tcontributors: contributors,\n\tmain: main,\n\tmodule: module,\n\tunpkg: unpkg,\n\tjsdelivr: jsdelivr,\n\ttypes: types,\n\trepository: repository,\n\tfiles: files,\n\tscripts: scripts,\n\tdevDependencies: devDependencies,\n\tpeerDependencies: peerDependencies,\n\tdependencies: dependencies\n};\n\nconst lightColor = '#fff';\nconst medColor = '#888';\nconst darkTheme = {\n background: '#333',\n view: {\n stroke: medColor,\n },\n title: {\n color: lightColor,\n subtitleColor: lightColor,\n },\n style: {\n 'guide-label': {\n fill: lightColor,\n },\n 'guide-title': {\n fill: lightColor,\n },\n },\n axis: {\n domainColor: lightColor,\n gridColor: medColor,\n tickColor: lightColor,\n },\n};\n\nconst markColor$7 = '#4572a7';\nconst excelTheme = {\n background: '#fff',\n arc: { fill: markColor$7 },\n area: { fill: markColor$7 },\n line: { stroke: markColor$7, strokeWidth: 2 },\n path: { stroke: markColor$7 },\n rect: { fill: markColor$7 },\n shape: { stroke: markColor$7 },\n symbol: { fill: markColor$7, strokeWidth: 1.5, size: 50 },\n axis: {\n bandPosition: 0.5,\n grid: true,\n gridColor: '#000000',\n gridOpacity: 1,\n gridWidth: 0.5,\n labelPadding: 10,\n tickSize: 5,\n tickWidth: 0.5,\n },\n axisBand: {\n grid: false,\n tickExtra: true,\n },\n legend: {\n labelBaseline: 'middle',\n labelFontSize: 11,\n symbolSize: 50,\n symbolType: 'square',\n },\n range: {\n category: [\n '#4572a7',\n '#aa4643',\n '#8aa453',\n '#71598e',\n '#4598ae',\n '#d98445',\n '#94aace',\n '#d09393',\n '#b9cc98',\n '#a99cbc',\n ],\n },\n};\n\nconst markColor$6 = '#30a2da';\nconst axisColor$2 = '#cbcbcb';\nconst guideLabelColor = '#999';\nconst guideTitleColor = '#333';\nconst backgroundColor$2 = '#f0f0f0';\nconst blackTitle = '#333';\nconst fiveThirtyEightTheme = {\n arc: { fill: markColor$6 },\n area: { fill: markColor$6 },\n axis: {\n domainColor: axisColor$2,\n grid: true,\n gridColor: axisColor$2,\n gridWidth: 1,\n labelColor: guideLabelColor,\n labelFontSize: 10,\n titleColor: guideTitleColor,\n tickColor: axisColor$2,\n tickSize: 10,\n titleFontSize: 14,\n titlePadding: 10,\n labelPadding: 4,\n },\n axisBand: {\n grid: false,\n },\n background: backgroundColor$2,\n group: {\n fill: backgroundColor$2,\n },\n legend: {\n labelColor: blackTitle,\n labelFontSize: 11,\n padding: 1,\n symbolSize: 30,\n symbolType: 'square',\n titleColor: blackTitle,\n titleFontSize: 14,\n titlePadding: 10,\n },\n line: {\n stroke: markColor$6,\n strokeWidth: 2,\n },\n path: { stroke: markColor$6, strokeWidth: 0.5 },\n rect: { fill: markColor$6 },\n range: {\n category: [\n '#30a2da',\n '#fc4f30',\n '#e5ae38',\n '#6d904f',\n '#8b8b8b',\n '#b96db8',\n '#ff9e27',\n '#56cc60',\n '#52d2ca',\n '#52689e',\n '#545454',\n '#9fe4f8',\n ],\n diverging: ['#cc0020', '#e77866', '#f6e7e1', '#d6e8ed', '#91bfd9', '#1d78b5'],\n heatmap: ['#d6e8ed', '#cee0e5', '#91bfd9', '#549cc6', '#1d78b5'],\n },\n point: {\n filled: true,\n shape: 'circle',\n },\n shape: { stroke: markColor$6 },\n bar: {\n binSpacing: 2,\n fill: markColor$6,\n stroke: null,\n },\n title: {\n anchor: 'start',\n fontSize: 24,\n fontWeight: 600,\n offset: 20,\n },\n};\n\nconst markColor$5 = '#000';\nconst ggplot2Theme = {\n group: {\n fill: '#e5e5e5',\n },\n arc: { fill: markColor$5 },\n area: { fill: markColor$5 },\n line: { stroke: markColor$5 },\n path: { stroke: markColor$5 },\n rect: { fill: markColor$5 },\n shape: { stroke: markColor$5 },\n symbol: { fill: markColor$5, size: 40 },\n axis: {\n domain: false,\n grid: true,\n gridColor: '#FFFFFF',\n gridOpacity: 1,\n labelColor: '#7F7F7F',\n labelPadding: 4,\n tickColor: '#7F7F7F',\n tickSize: 5.67,\n titleFontSize: 16,\n titleFontWeight: 'normal',\n },\n legend: {\n labelBaseline: 'middle',\n labelFontSize: 11,\n symbolSize: 40,\n },\n range: {\n category: [\n '#000000',\n '#7F7F7F',\n '#1A1A1A',\n '#999999',\n '#333333',\n '#B0B0B0',\n '#4D4D4D',\n '#C9C9C9',\n '#666666',\n '#DCDCDC',\n ],\n },\n};\n\nconst headlineFontSize = 22;\nconst headlineFontWeight = 'normal';\nconst labelFont$1 = 'Benton Gothic, sans-serif';\nconst labelFontSize = 11.5;\nconst labelFontWeight = 'normal';\nconst markColor$4 = '#82c6df';\n// const markHighlight = '#006d8f';\n// const markDemocrat = '#5789b8';\n// const markRepublican = '#d94f54';\nconst titleFont = 'Benton Gothic Bold, sans-serif';\nconst titleFontWeight = 'normal';\nconst titleFontSize$1 = 13;\nconst colorSchemes$1 = {\n 'category-6': ['#ec8431', '#829eb1', '#c89d29', '#3580b1', '#adc839', '#ab7fb4'],\n 'fire-7': ['#fbf2c7', '#f9e39c', '#f8d36e', '#f4bb6a', '#e68a4f', '#d15a40', '#ab4232'],\n 'fireandice-6': ['#e68a4f', '#f4bb6a', '#f9e39c', '#dadfe2', '#a6b7c6', '#849eae'],\n 'ice-7': ['#edefee', '#dadfe2', '#c4ccd2', '#a6b7c6', '#849eae', '#607785', '#47525d'],\n};\nconst latimesTheme = {\n background: '#ffffff',\n title: {\n anchor: 'start',\n color: '#000000',\n font: titleFont,\n fontSize: headlineFontSize,\n fontWeight: headlineFontWeight,\n },\n arc: { fill: markColor$4 },\n area: { fill: markColor$4 },\n line: { stroke: markColor$4, strokeWidth: 2 },\n path: { stroke: markColor$4 },\n rect: { fill: markColor$4 },\n shape: { stroke: markColor$4 },\n symbol: { fill: markColor$4, size: 30 },\n axis: {\n labelFont: labelFont$1,\n labelFontSize,\n labelFontWeight,\n titleFont,\n titleFontSize: titleFontSize$1,\n titleFontWeight,\n },\n axisX: {\n labelAngle: 0,\n labelPadding: 4,\n tickSize: 3,\n },\n axisY: {\n labelBaseline: 'middle',\n maxExtent: 45,\n minExtent: 45,\n tickSize: 2,\n titleAlign: 'left',\n titleAngle: 0,\n titleX: -45,\n titleY: -11,\n },\n legend: {\n labelFont: labelFont$1,\n labelFontSize,\n symbolType: 'square',\n titleFont,\n titleFontSize: titleFontSize$1,\n titleFontWeight,\n },\n range: {\n category: colorSchemes$1['category-6'],\n diverging: colorSchemes$1['fireandice-6'],\n heatmap: colorSchemes$1['fire-7'],\n ordinal: colorSchemes$1['fire-7'],\n ramp: colorSchemes$1['fire-7'],\n },\n};\n\nconst markColor$3 = '#ab5787';\nconst axisColor$1 = '#979797';\nconst quartzTheme = {\n background: '#f9f9f9',\n arc: { fill: markColor$3 },\n area: { fill: markColor$3 },\n line: { stroke: markColor$3 },\n path: { stroke: markColor$3 },\n rect: { fill: markColor$3 },\n shape: { stroke: markColor$3 },\n symbol: { fill: markColor$3, size: 30 },\n axis: {\n domainColor: axisColor$1,\n domainWidth: 0.5,\n gridWidth: 0.2,\n labelColor: axisColor$1,\n tickColor: axisColor$1,\n tickWidth: 0.2,\n titleColor: axisColor$1,\n },\n axisBand: {\n grid: false,\n },\n axisX: {\n grid: true,\n tickSize: 10,\n },\n axisY: {\n domain: false,\n grid: true,\n tickSize: 0,\n },\n legend: {\n labelFontSize: 11,\n padding: 1,\n symbolSize: 30,\n symbolType: 'square',\n },\n range: {\n category: [\n '#ab5787',\n '#51b2e5',\n '#703c5c',\n '#168dd9',\n '#d190b6',\n '#00609f',\n '#d365ba',\n '#154866',\n '#666666',\n '#c4c4c4',\n ],\n },\n};\n\nconst markColor$2 = '#3e5c69';\nconst voxTheme = {\n background: '#fff',\n arc: { fill: markColor$2 },\n area: { fill: markColor$2 },\n line: { stroke: markColor$2 },\n path: { stroke: markColor$2 },\n rect: { fill: markColor$2 },\n shape: { stroke: markColor$2 },\n symbol: { fill: markColor$2 },\n axis: {\n domainWidth: 0.5,\n grid: true,\n labelPadding: 2,\n tickSize: 5,\n tickWidth: 0.5,\n titleFontWeight: 'normal',\n },\n axisBand: {\n grid: false,\n },\n axisX: {\n gridWidth: 0.2,\n },\n axisY: {\n gridDash: [3],\n gridWidth: 0.4,\n },\n legend: {\n labelFontSize: 11,\n padding: 1,\n symbolType: 'square',\n },\n range: {\n category: ['#3e5c69', '#6793a6', '#182429', '#0570b0', '#3690c0', '#74a9cf', '#a6bddb', '#e2ddf2'],\n },\n};\n\nconst markColor$1 = '#1696d2';\nconst axisColor = '#000000';\nconst backgroundColor$1 = '#FFFFFF';\nconst font = 'Lato';\nconst labelFont = 'Lato';\nconst sourceFont = 'Lato';\nconst gridColor$1 = '#DEDDDD';\nconst titleFontSize = 18;\nconst colorSchemes = {\n 'main-colors': ['#1696d2', '#d2d2d2', '#000000', '#fdbf11', '#ec008b', '#55b748', '#5c5859', '#db2b27'],\n 'shades-blue': ['#CFE8F3', '#A2D4EC', '#73BFE2', '#46ABDB', '#1696D2', '#12719E', '#0A4C6A', '#062635'],\n 'shades-gray': ['#F5F5F5', '#ECECEC', '#E3E3E3', '#DCDBDB', '#D2D2D2', '#9D9D9D', '#696969', '#353535'],\n 'shades-yellow': ['#FFF2CF', '#FCE39E', '#FDD870', '#FCCB41', '#FDBF11', '#E88E2D', '#CA5800', '#843215'],\n 'shades-magenta': ['#F5CBDF', '#EB99C2', '#E46AA7', '#E54096', '#EC008B', '#AF1F6B', '#761548', '#351123'],\n 'shades-green': ['#DCEDD9', '#BCDEB4', '#98CF90', '#78C26D', '#55B748', '#408941', '#2C5C2D', '#1A2E19'],\n 'shades-black': ['#D5D5D4', '#ADABAC', '#848081', '#5C5859', '#332D2F', '#262223', '#1A1717', '#0E0C0D'],\n 'shades-red': ['#F8D5D4', '#F1AAA9', '#E9807D', '#E25552', '#DB2B27', '#A4201D', '#6E1614', '#370B0A'],\n 'one-group': ['#1696d2', '#000000'],\n 'two-groups-cat-1': ['#1696d2', '#000000'],\n 'two-groups-cat-2': ['#1696d2', '#fdbf11'],\n 'two-groups-cat-3': ['#1696d2', '#db2b27'],\n 'two-groups-seq': ['#a2d4ec', '#1696d2'],\n 'three-groups-cat': ['#1696d2', '#fdbf11', '#000000'],\n 'three-groups-seq': ['#a2d4ec', '#1696d2', '#0a4c6a'],\n 'four-groups-cat-1': ['#000000', '#d2d2d2', '#fdbf11', '#1696d2'],\n 'four-groups-cat-2': ['#1696d2', '#ec0008b', '#fdbf11', '#5c5859'],\n 'four-groups-seq': ['#cfe8f3', '#73bf42', '#1696d2', '#0a4c6a'],\n 'five-groups-cat-1': ['#1696d2', '#fdbf11', '#d2d2d2', '#ec008b', '#000000'],\n 'five-groups-cat-2': ['#1696d2', '#0a4c6a', '#d2d2d2', '#fdbf11', '#332d2f'],\n 'five-groups-seq': ['#cfe8f3', '#73bf42', '#1696d2', '#0a4c6a', '#000000'],\n 'six-groups-cat-1': ['#1696d2', '#ec008b', '#fdbf11', '#000000', '#d2d2d2', '#55b748'],\n 'six-groups-cat-2': ['#1696d2', '#d2d2d2', '#ec008b', '#fdbf11', '#332d2f', '#0a4c6a'],\n 'six-groups-seq': ['#cfe8f3', '#a2d4ec', '#73bfe2', '#46abdb', '#1696d2', '#12719e'],\n 'diverging-colors': ['#ca5800', '#fdbf11', '#fdd870', '#fff2cf', '#cfe8f3', '#73bfe2', '#1696d2', '#0a4c6a'],\n};\nconst urbanInstituteTheme = {\n background: backgroundColor$1,\n title: {\n anchor: 'start',\n fontSize: titleFontSize,\n font: font,\n },\n axisX: {\n domain: true,\n domainColor: axisColor,\n domainWidth: 1,\n grid: false,\n labelFontSize: 12,\n labelFont: labelFont,\n labelAngle: 0,\n tickColor: axisColor,\n tickSize: 5,\n titleFontSize: 12,\n titlePadding: 10,\n titleFont: font,\n },\n axisY: {\n domain: false,\n domainWidth: 1,\n grid: true,\n gridColor: gridColor$1,\n gridWidth: 1,\n labelFontSize: 12,\n labelFont: labelFont,\n labelPadding: 8,\n ticks: false,\n titleFontSize: 12,\n titlePadding: 10,\n titleFont: font,\n titleAngle: 0,\n titleY: -10,\n titleX: 18,\n },\n legend: {\n labelFontSize: 12,\n labelFont: labelFont,\n symbolSize: 100,\n titleFontSize: 12,\n titlePadding: 10,\n titleFont: font,\n orient: 'right',\n offset: 10,\n },\n view: {\n stroke: 'transparent',\n },\n range: {\n category: colorSchemes['six-groups-cat-1'],\n diverging: colorSchemes['diverging-colors'],\n heatmap: colorSchemes['diverging-colors'],\n ordinal: colorSchemes['six-groups-seq'],\n ramp: colorSchemes['shades-blue'],\n },\n area: {\n fill: markColor$1,\n },\n rect: {\n fill: markColor$1,\n },\n line: {\n color: markColor$1,\n stroke: markColor$1,\n strokeWidth: 5,\n },\n trail: {\n color: markColor$1,\n stroke: markColor$1,\n strokeWidth: 0,\n size: 1,\n },\n path: {\n stroke: markColor$1,\n strokeWidth: 0.5,\n },\n point: {\n filled: true,\n },\n text: {\n font: sourceFont,\n color: markColor$1,\n fontSize: 11,\n align: 'center',\n fontWeight: 400,\n size: 11,\n },\n style: {\n bar: {\n fill: markColor$1,\n stroke: null,\n },\n },\n arc: { fill: markColor$1 },\n shape: { stroke: markColor$1 },\n symbol: { fill: markColor$1, size: 30 },\n};\n\n/**\n * Copyright 2020 Google LLC.\n *\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file or at\n * https://developers.google.com/open-source/licenses/bsd\n */\nconst markColor = '#3366CC';\nconst gridColor = '#ccc';\nconst defaultFont = 'Arial, sans-serif';\nconst googlechartsTheme = {\n arc: { fill: markColor },\n area: { fill: markColor },\n path: { stroke: markColor },\n rect: { fill: markColor },\n shape: { stroke: markColor },\n symbol: { stroke: markColor },\n circle: { fill: markColor },\n background: '#fff',\n padding: {\n top: 10,\n right: 10,\n bottom: 10,\n left: 10,\n },\n style: {\n 'guide-label': {\n font: defaultFont,\n fontSize: 12,\n },\n 'guide-title': {\n font: defaultFont,\n fontSize: 12,\n },\n 'group-title': {\n font: defaultFont,\n fontSize: 12,\n },\n },\n title: {\n font: defaultFont,\n fontSize: 14,\n fontWeight: 'bold',\n dy: -3,\n anchor: 'start',\n },\n axis: {\n gridColor: gridColor,\n tickColor: gridColor,\n domain: false,\n grid: true,\n },\n range: {\n category: [\n '#4285F4',\n '#DB4437',\n '#F4B400',\n '#0F9D58',\n '#AB47BC',\n '#00ACC1',\n '#FF7043',\n '#9E9D24',\n '#5C6BC0',\n '#F06292',\n '#00796B',\n '#C2185B',\n ],\n heatmap: ['#c6dafc', '#5e97f6', '#2a56c6'],\n },\n};\n\nconst ptToPx = (value) => value * (1 / 3 + 1);\nconst fontSmallPx = ptToPx(9);\nconst legendFontPx = ptToPx(10);\nconst fontLargePx = ptToPx(12);\nconst fontStandard = 'Segoe UI';\nconst fontTitle = 'wf_standard-font, helvetica, arial, sans-serif';\nconst firstLevelElementColor = '#252423';\nconst secondLevelElementColor = '#605E5C';\nconst backgroundColor = 'transparent';\nconst backgroundSecondaryColor = '#C8C6C4';\nconst paletteColor1 = '#118DFF';\nconst paletteColor2 = '#12239E';\nconst paletteColor3 = '#E66C37';\nconst paletteColor4 = '#6B007B';\nconst paletteColor5 = '#E044A7';\nconst paletteColor6 = '#744EC2';\nconst paletteColor7 = '#D9B300';\nconst paletteColor8 = '#D64550';\nconst divergentColorMax = paletteColor1;\nconst divergentColorMin = '#DEEFFF';\nconst divergentPalette = [divergentColorMin, divergentColorMax];\nconst ordinalPalette = [\n divergentColorMin,\n '#c7e4ff',\n '#b0d9ff',\n '#9aceff',\n '#83c3ff',\n '#6cb9ff',\n '#55aeff',\n '#3fa3ff',\n '#2898ff',\n divergentColorMax,\n];\nconst powerbiTheme = {\n view: { stroke: backgroundColor },\n background: backgroundColor,\n font: fontStandard,\n header: {\n titleFont: fontTitle,\n titleFontSize: fontLargePx,\n titleColor: firstLevelElementColor,\n labelFont: fontStandard,\n labelFontSize: legendFontPx,\n labelColor: secondLevelElementColor,\n },\n axis: {\n ticks: false,\n grid: false,\n domain: false,\n labelColor: secondLevelElementColor,\n labelFontSize: fontSmallPx,\n titleFont: fontTitle,\n titleColor: firstLevelElementColor,\n titleFontSize: fontLargePx,\n titleFontWeight: 'normal',\n },\n axisQuantitative: {\n tickCount: 3,\n grid: true,\n gridColor: backgroundSecondaryColor,\n gridDash: [1, 5],\n labelFlush: false,\n },\n axisBand: { tickExtra: true },\n axisX: { labelPadding: 5 },\n axisY: { labelPadding: 10 },\n bar: { fill: paletteColor1 },\n line: {\n stroke: paletteColor1,\n strokeWidth: 3,\n strokeCap: 'round',\n strokeJoin: 'round',\n },\n text: { font: fontStandard, fontSize: fontSmallPx, fill: secondLevelElementColor },\n arc: { fill: paletteColor1 },\n area: { fill: paletteColor1, line: true, opacity: 0.6 },\n path: { stroke: paletteColor1 },\n rect: { fill: paletteColor1 },\n point: { fill: paletteColor1, filled: true, size: 75 },\n shape: { stroke: paletteColor1 },\n symbol: { fill: paletteColor1, strokeWidth: 1.5, size: 50 },\n legend: {\n titleFont: fontStandard,\n titleFontWeight: 'bold',\n titleColor: secondLevelElementColor,\n labelFont: fontStandard,\n labelFontSize: legendFontPx,\n labelColor: secondLevelElementColor,\n symbolType: 'circle',\n symbolSize: 75,\n },\n range: {\n category: [\n paletteColor1,\n paletteColor2,\n paletteColor3,\n paletteColor4,\n paletteColor5,\n paletteColor6,\n paletteColor7,\n paletteColor8,\n ],\n diverging: divergentPalette,\n heatmap: divergentPalette,\n ordinal: ordinalPalette,\n },\n};\n\nconst version = pkg.version;\n\nexport { darkTheme as dark, excelTheme as excel, fiveThirtyEightTheme as fivethirtyeight, ggplot2Theme as ggplot2, googlechartsTheme as googlecharts, latimesTheme as latimes, powerbiTheme as powerbi, quartzTheme as quartz, urbanInstituteTheme as urbaninstitute, version, voxTheme as vox };\n","import { isArray, isString, isObject } from 'vega-util';\n\nvar name = \"vega-tooltip\";\nvar version$1 = \"0.30.1\";\nvar description = \"A tooltip plugin for Vega-Lite and Vega visualizations.\";\nvar keywords = [\n\t\"vega-lite\",\n\t\"vega\",\n\t\"tooltip\"\n];\nvar repository = {\n\ttype: \"git\",\n\turl: \"https://github.com/vega/vega-tooltip.git\"\n};\nvar author = {\n\tname: \"UW Interactive Data Lab\",\n\turl: \"https://idl.cs.washington.edu\"\n};\nvar collaborators = [\n\t\"Dominik Moritz\",\n\t\"Sira Horradarn\",\n\t\"Zening Qu\",\n\t\"Kanit Wongsuphasawat\",\n\t\"Yuri Astrakhan\",\n\t\"Jeffrey Heer\"\n];\nvar license = \"BSD-3-Clause\";\nvar bugs = {\n\turl: \"https://github.com/vega/vega-tooltip/issues\"\n};\nvar homepage = \"https://github.com/vega/vega-tooltip#readme\";\nvar main = \"build/vega-tooltip.js\";\nvar module = \"build/vega-tooltip.module.js\";\nvar unpkg = \"build/vega-tooltip.min.js\";\nvar jsdelivr = \"build/vega-tooltip.min.js\";\nvar types = \"build/vega-tooltip.module.d.ts\";\nvar files = [\n\t\"src\",\n\t\"build\",\n\t\"types\"\n];\nvar scripts = {\n\tprebuild: \"yarn clean && yarn build:style\",\n\tbuild: \"rollup -c\",\n\t\"build:style\": \"./build-style.sh\",\n\tclean: \"rimraf build && rimraf src/style.ts\",\n\t\"copy:data\": \"rsync -r node_modules/vega-datasets/data/* examples/data\",\n\t\"copy:build\": \"rsync -r build/* examples/build\",\n\t\"deploy:gh\": \"yarn build && yarn copy:build && gh-pages -d examples && yarn clean\",\n\tprepublishOnly: \"yarn clean && yarn build\",\n\tpreversion: \"yarn lint && yarn test\",\n\tserve: \"browser-sync start -s -f build examples --serveStatic examples\",\n\tstart: \"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'\",\n\tpretest: \"yarn build:style\",\n\ttest: \"beemo jest\",\n\t\"test:inspect\": \"node --inspect-brk ./node_modules/.bin/jest --runInBand\",\n\tprepare: \"beemo create-config && yarn copy:data\",\n\tprettierbase: \"beemo prettier '*.{css,scss,html}'\",\n\teslintbase: \"beemo eslint .\",\n\tformat: \"yarn eslintbase --fix && yarn prettierbase --write\",\n\tlint: \"yarn eslintbase && yarn prettierbase --check\",\n\trelease: \"release-it\"\n};\nvar devDependencies = {\n\t\"@release-it/conventional-changelog\": \"^5.1.1\",\n\t\"@rollup/plugin-json\": \"^6.0.0\",\n\t\"@rollup/plugin-node-resolve\": \"^15.0.1\",\n\t\"release-it\": \"^15.6.0\",\n\t\"browser-sync\": \"^2.27.11\",\n\tconcurrently: \"^7.6.0\",\n\t\"gh-pages\": \"^5.0.0\",\n\t\"jest-environment-jsdom\": \"^29.4.2\",\n\tpath: \"^0.12.7\",\n\trollup: \"^3.15.0\",\n\t\"rollup-plugin-bundle-size\": \"^1.0.3\",\n\t\"@rollup/plugin-terser\": \"^0.4.0\",\n\t\"rollup-plugin-ts\": \"^3.2.0\",\n\tsass: \"^1.58.0\",\n\ttypescript: \"~4.9.5\",\n\t\"vega-datasets\": \"^2.5.4\",\n\t\"vega-lite-dev-config\": \"^0.21.0\",\n\t\"vega-typings\": \"^0.22.3\"\n};\nvar dependencies = {\n\t\"vega-util\": \"^1.17.0\"\n};\nvar pkg = {\n\tname: name,\n\tversion: version$1,\n\tdescription: description,\n\tkeywords: keywords,\n\trepository: repository,\n\tauthor: author,\n\tcollaborators: collaborators,\n\tlicense: license,\n\tbugs: bugs,\n\thomepage: homepage,\n\tmain: main,\n\tmodule: module,\n\tunpkg: unpkg,\n\tjsdelivr: jsdelivr,\n\ttypes: types,\n\tfiles: files,\n\tscripts: scripts,\n\tdevDependencies: devDependencies,\n\tdependencies: dependencies\n};\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\n\n/**\n * Format the value to be shown in the tooltip.\n *\n * @param value The value to show in the tooltip.\n * @param valueToHtml Function to convert a single cell value to an HTML string\n */\nfunction formatValue(value, valueToHtml, maxDepth) {\n if (isArray(value)) {\n return `[${value.map((v) => valueToHtml(isString(v) ? v : stringify(v, maxDepth))).join(', ')}]`;\n }\n if (isObject(value)) {\n let content = '';\n const _a = value, { title, image } = _a, rest = __rest(_a, [\"title\", \"image\"]);\n if (title) {\n content += `

${valueToHtml(title)}

`;\n }\n if (image) {\n content += ``;\n }\n const keys = Object.keys(rest);\n if (keys.length > 0) {\n content += '';\n for (const key of keys) {\n let val = rest[key];\n // ignore undefined properties\n if (val === undefined) {\n continue;\n }\n if (isObject(val)) {\n val = stringify(val, maxDepth);\n }\n content += ``;\n }\n content += `
${valueToHtml(key)}:${valueToHtml(val)}
`;\n }\n return content || '{}'; // show empty object if there are no properties\n }\n return valueToHtml(value);\n}\nfunction replacer(maxDepth) {\n const stack = [];\n return function (key, value) {\n if (typeof value !== 'object' || value === null) {\n return value;\n }\n const pos = stack.indexOf(this) + 1;\n stack.length = pos;\n if (stack.length > maxDepth) {\n return '[Object]';\n }\n if (stack.indexOf(value) >= 0) {\n return '[Circular]';\n }\n stack.push(value);\n return value;\n };\n}\n/**\n * Stringify any JS object to valid JSON\n */\nfunction stringify(obj, maxDepth) {\n return JSON.stringify(obj, replacer(maxDepth));\n}\n\n// generated with build-style.sh\nvar defaultStyle = `#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black;\n}\n#vg-tooltip-element.visible {\n visibility: visible;\n}\n#vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px;\n}\n#vg-tooltip-element img {\n max-width: 200px;\n max-height: 200px;\n}\n#vg-tooltip-element table {\n border-spacing: 0;\n}\n#vg-tooltip-element table tr {\n border: none;\n}\n#vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px;\n}\n#vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px;\n}\n#vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left;\n}\n#vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white;\n}\n#vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf;\n}\n`;\n\nconst EL_ID = 'vg-tooltip-element';\nconst DEFAULT_OPTIONS = {\n /**\n * X offset.\n */\n offsetX: 10,\n /**\n * Y offset.\n */\n offsetY: 10,\n /**\n * ID of the tooltip element.\n */\n id: EL_ID,\n /**\n * ID of the tooltip CSS style.\n */\n styleId: 'vega-tooltip-style',\n /**\n * The name of the theme. You can use the CSS class called [THEME]-theme to style the tooltips.\n *\n * There are two predefined themes: \"light\" (default) and \"dark\".\n */\n theme: 'light',\n /**\n * Do not use the default styles provided by Vega Tooltip. If you enable this option, you need to use your own styles. It is not necessary to disable the default style when using a custom theme.\n */\n disableDefaultStyle: false,\n /**\n * HTML sanitizer function that removes dangerous HTML to prevent XSS.\n *\n * This should be a function from string to string. You may replace it with a formatter such as a markdown formatter.\n */\n sanitize: escapeHTML,\n /**\n * The maximum recursion depth when printing objects in the tooltip.\n */\n maxDepth: 2,\n /**\n * A function to customize the rendered HTML of the tooltip.\n * @param value A value string, or object of value strings keyed by field\n * @param sanitize The `sanitize` function from `options.sanitize`\n * @returns {string} The returned string will become the `innerHTML` of the tooltip element\n */\n formatTooltip: formatValue,\n};\n/**\n * Escape special HTML characters.\n *\n * @param value A value to convert to string and HTML-escape.\n */\nfunction escapeHTML(value) {\n return String(value).replace(/&/g, '&').replace(/ window.innerWidth) {\n x = +event.clientX - offsetX - tooltipBox.width;\n }\n let y = event.clientY + offsetY;\n if (y + tooltipBox.height > window.innerHeight) {\n y = +event.clientY - offsetY - tooltipBox.height;\n }\n return { x, y };\n}\n\n/**\n * The tooltip handler class.\n */\nclass Handler {\n /**\n * Create the tooltip handler and initialize the element and style.\n *\n * @param options Tooltip Options\n */\n constructor(options) {\n this.options = Object.assign(Object.assign({}, DEFAULT_OPTIONS), options);\n const elementId = this.options.id;\n this.el = null;\n // bind this to call\n this.call = this.tooltipHandler.bind(this);\n // prepend a default stylesheet for tooltips to the head\n if (!this.options.disableDefaultStyle && !document.getElementById(this.options.styleId)) {\n const style = document.createElement('style');\n style.setAttribute('id', this.options.styleId);\n style.innerHTML = createDefaultStyle(elementId);\n const head = document.head;\n if (head.childNodes.length > 0) {\n head.insertBefore(style, head.childNodes[0]);\n }\n else {\n head.appendChild(style);\n }\n }\n }\n /**\n * The tooltip handler function.\n */\n tooltipHandler(handler, event, item, value) {\n // console.log(handler, event, item, value);\n var _a;\n // append a div element that we use as a tooltip unless it already exists\n this.el = document.getElementById(this.options.id);\n if (!this.el) {\n this.el = document.createElement('div');\n this.el.setAttribute('id', this.options.id);\n this.el.classList.add('vg-tooltip');\n const tooltipContainer = (_a = document.fullscreenElement) !== null && _a !== void 0 ? _a : document.body;\n tooltipContainer.appendChild(this.el);\n }\n // hide tooltip for null, undefined, or empty string values\n if (value == null || value === '') {\n this.el.classList.remove('visible', `${this.options.theme}-theme`);\n return;\n }\n // set the tooltip content\n this.el.innerHTML = this.options.formatTooltip(value, this.options.sanitize, this.options.maxDepth);\n // make the tooltip visible\n this.el.classList.add('visible', `${this.options.theme}-theme`);\n const { x, y } = calculatePosition(event, this.el.getBoundingClientRect(), this.options.offsetX, this.options.offsetY);\n this.el.style.top = `${y}px`;\n this.el.style.left = `${x}px`;\n }\n}\n\nconst version = pkg.version;\n/**\n * Create a tooltip handler and register it with the provided view.\n *\n * @param view The Vega view.\n * @param opt Tooltip options.\n */\nfunction index (view, opt) {\n const handler = new Handler(opt);\n view.tooltip(handler.call).run();\n return handler;\n}\n\nexport { DEFAULT_OPTIONS, Handler, calculatePosition, createDefaultStyle, index as default, escapeHTML, formatValue, replacer, stringify, version };\n//# sourceMappingURL=vega-tooltip.module.js.map\n","import { applyPatch } from 'fast-json-patch';\nimport stringify from 'json-stringify-pretty-compact';\nimport * as vegaImport from 'vega';\nimport { writeConfig, mergeConfig, isString, isBoolean, isObject } from 'vega';\nimport { expressionInterpreter } from 'vega-interpreter';\nimport * as vegaLiteImport from 'vega-lite';\nimport schemaParser from 'vega-schema-url-parser';\nimport * as themes from 'vega-themes';\nimport { Handler } from 'vega-tooltip';\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\nfunction _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\n\nfunction _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}\n\nfunction _defineProperty(obj, key, value) {\n key = _toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar Op = Object.prototype;\nvar hasOwn = Op.hasOwnProperty;\nvar undefined$1; // More compressible than void 0.\nvar $Symbol = typeof Symbol === \"function\" ? Symbol : {};\nvar iteratorSymbol = $Symbol.iterator || \"@@iterator\";\nvar asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\nvar toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\nfunction wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n return generator;\n}\n\n// Try/catch helper to minimize deoptimizations. Returns a completion\n// record like context.tryEntries[i].completion. This interface could\n// have been (and was previously) designed to take a closure to be\n// invoked without arguments, but in all the cases we care about we\n// already have an existing method we want to call, so there's no need\n// to create a new function object. We can even get away with assuming\n// the method takes exactly one argument, since that happens to be true\n// in every case, so we don't have to touch the arguments object. The\n// only additional allocation required is the completion record, which\n// has a stable shape and so hopefully should be cheap to allocate.\nfunction tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n}\nvar GenStateSuspendedStart = \"suspendedStart\";\nvar GenStateSuspendedYield = \"suspendedYield\";\nvar GenStateExecuting = \"executing\";\nvar GenStateCompleted = \"completed\";\n\n// Returning this object from the innerFn has the same effect as\n// breaking out of the dispatch switch statement.\nvar ContinueSentinel = {};\n\n// Dummy constructor functions that we use as the .constructor and\n// .constructor.prototype properties for functions that return Generator\n// objects. For full spec compliance, you may wish to configure your\n// minifier not to mangle the names of these two functions.\nfunction Generator() {}\nfunction GeneratorFunction() {}\nfunction GeneratorFunctionPrototype() {}\n\n// This is a polyfill for %IteratorPrototype% for environments that\n// don't natively support it.\nvar IteratorPrototype = {};\nIteratorPrototype[iteratorSymbol] = function () {\n return this;\n};\nvar getProto = Object.getPrototypeOf;\nvar NativeIteratorPrototype = getProto && getProto(getProto(values([])));\nif (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n}\nvar Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);\nGeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\nGeneratorFunctionPrototype.constructor = GeneratorFunction;\nGeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = \"GeneratorFunction\";\n\n// Helper for defining the .next, .throw, and .return methods of the\n// Iterator interface in terms of a single ._invoke method.\nfunction defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n}\nfunction isGeneratorFunction(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\" : false;\n}\nfunction mark(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n}\n\n// Within the body of any async function, `await x` is transformed to\n// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n// `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n// meant to be awaited.\nfunction awrap(arg) {\n return {\n __await: arg\n };\n}\nfunction AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value && typeof value === \"object\" && hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function (value) {\n invoke(\"next\", value, resolve, reject);\n }, function (err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n return PromiseImpl.resolve(value).then(function (unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function (error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n var previousPromise;\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function (resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n}\ndefineIteratorMethods(AsyncIterator.prototype);\nAsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n};\n\n// Note that simple async functions are implemented on top of\n// AsyncIterator objects; they just return a Promise for the value of\n// the final result produced by the iterator.\nfunction async(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);\n return isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function (result) {\n return result.done ? result.value : iter.next();\n });\n}\nfunction makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n context.method = method;\n context.arg = arg;\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n context.dispatchException(context.arg);\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n state = GenStateExecuting;\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done ? GenStateCompleted : GenStateSuspendedYield;\n if (record.arg === ContinueSentinel) {\n continue;\n }\n return {\n value: record.arg,\n done: context.done\n };\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n}\n\n// Call delegate.iterator[context.method](context.arg) and handle the\n// result, either by returning a { value, done } result from the\n// delegate iterator, or by modifying context.method and context.arg,\n// setting context.delegate to null, and returning the ContinueSentinel.\nfunction maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined$1) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined$1;\n maybeInvokeDelegate(delegate, context);\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n context.method = \"throw\";\n context.arg = new TypeError(\"The iterator does not provide a 'throw' method\");\n }\n return ContinueSentinel;\n }\n var record = tryCatch(method, delegate.iterator, context.arg);\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n var info = record.arg;\n if (!info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined$1;\n }\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n}\n\n// Define Generator.prototype.{next,throw,return} in terms of the\n// unified ._invoke helper method.\ndefineIteratorMethods(Gp);\nGp[toStringTagSymbol] = \"Generator\";\n\n// A Generator should always return itself as the iterator object when the\n// @@iterator function is called on it. Some browsers' implementations of the\n// iterator prototype chain incorrectly implement this, causing the Generator\n// object to not be returned from this call. This ensures that doesn't happen.\n// See https://github.com/facebook/regenerator/issues/274 for more details.\nGp[iteratorSymbol] = function () {\n return this;\n};\nGp.toString = function () {\n return \"[object Generator]\";\n};\nfunction pushTryEntry(locs) {\n var entry = {\n tryLoc: locs[0]\n };\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n this.tryEntries.push(entry);\n}\nfunction resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n}\nfunction Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{\n tryLoc: \"root\"\n }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n}\nfunction keys(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n}\nfunction values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n if (!isNaN(iterable.length)) {\n var i = -1,\n next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n next.value = undefined$1;\n next.done = true;\n return next;\n };\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return {\n next: doneResult\n };\n}\nfunction doneResult() {\n return {\n value: undefined$1,\n done: true\n };\n}\nContext.prototype = {\n constructor: Context,\n reset: function reset(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined$1;\n this.done = false;\n this.delegate = null;\n this.method = \"next\";\n this.arg = undefined$1;\n this.tryEntries.forEach(resetTryEntry);\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {\n this[name] = undefined$1;\n }\n }\n }\n },\n stop: function stop() {\n this.done = true;\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n return this.rval;\n },\n dispatchException: function dispatchException(exception) {\n if (this.done) {\n throw exception;\n }\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined$1;\n }\n return !!caught;\n }\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n abrupt: function abrupt(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n if (finallyEntry && (type === \"break\" || type === \"continue\") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n return this.complete(record);\n },\n complete: function complete(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n if (record.type === \"break\" || record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n return ContinueSentinel;\n },\n finish: function finish(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n \"catch\": function _catch(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined$1;\n }\n return ContinueSentinel;\n }\n};\n\n// Export a default namespace that plays well with Rollup\nvar _regeneratorRuntime = {\n wrap,\n isGeneratorFunction,\n AsyncIterator,\n mark,\n awrap,\n async,\n keys,\n values\n};\n\nvar iterator;\nvar hasRequiredIterator;\nfunction requireIterator() {\n if (hasRequiredIterator) return iterator;\n hasRequiredIterator = 1;\n iterator = function iterator(Yallist) {\n Yallist.prototype[Symbol.iterator] = /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {\n var walker;\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n walker = this.head;\n case 1:\n if (!walker) {\n _context.next = 7;\n break;\n }\n _context.next = 4;\n return walker.value;\n case 4:\n walker = walker.next;\n _context.next = 1;\n break;\n case 7:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n });\n };\n return iterator;\n}\n\nvar yallist = Yallist$1;\nYallist$1.Node = Node;\nYallist$1.create = Yallist$1;\nfunction Yallist$1(list) {\n var self = this;\n if (!(self instanceof Yallist$1)) {\n self = new Yallist$1();\n }\n self.tail = null;\n self.head = null;\n self.length = 0;\n if (list && typeof list.forEach === 'function') {\n list.forEach(function (item) {\n self.push(item);\n });\n } else if (arguments.length > 0) {\n for (var i = 0, l = arguments.length; i < l; i++) {\n self.push(arguments[i]);\n }\n }\n return self;\n}\nYallist$1.prototype.removeNode = function (node) {\n if (node.list !== this) {\n throw new Error('removing node which does not belong to this list');\n }\n var next = node.next;\n var prev = node.prev;\n if (next) {\n next.prev = prev;\n }\n if (prev) {\n prev.next = next;\n }\n if (node === this.head) {\n this.head = next;\n }\n if (node === this.tail) {\n this.tail = prev;\n }\n node.list.length--;\n node.next = null;\n node.prev = null;\n node.list = null;\n return next;\n};\nYallist$1.prototype.unshiftNode = function (node) {\n if (node === this.head) {\n return;\n }\n if (node.list) {\n node.list.removeNode(node);\n }\n var head = this.head;\n node.list = this;\n node.next = head;\n if (head) {\n head.prev = node;\n }\n this.head = node;\n if (!this.tail) {\n this.tail = node;\n }\n this.length++;\n};\nYallist$1.prototype.pushNode = function (node) {\n if (node === this.tail) {\n return;\n }\n if (node.list) {\n node.list.removeNode(node);\n }\n var tail = this.tail;\n node.list = this;\n node.prev = tail;\n if (tail) {\n tail.next = node;\n }\n this.tail = node;\n if (!this.head) {\n this.head = node;\n }\n this.length++;\n};\nYallist$1.prototype.push = function () {\n for (var i = 0, l = arguments.length; i < l; i++) {\n push(this, arguments[i]);\n }\n return this.length;\n};\nYallist$1.prototype.unshift = function () {\n for (var i = 0, l = arguments.length; i < l; i++) {\n unshift(this, arguments[i]);\n }\n return this.length;\n};\nYallist$1.prototype.pop = function () {\n if (!this.tail) {\n return undefined;\n }\n var res = this.tail.value;\n this.tail = this.tail.prev;\n if (this.tail) {\n this.tail.next = null;\n } else {\n this.head = null;\n }\n this.length--;\n return res;\n};\nYallist$1.prototype.shift = function () {\n if (!this.head) {\n return undefined;\n }\n var res = this.head.value;\n this.head = this.head.next;\n if (this.head) {\n this.head.prev = null;\n } else {\n this.tail = null;\n }\n this.length--;\n return res;\n};\nYallist$1.prototype.forEach = function (fn, thisp) {\n thisp = thisp || this;\n for (var walker = this.head, i = 0; walker !== null; i++) {\n fn.call(thisp, walker.value, i, this);\n walker = walker.next;\n }\n};\nYallist$1.prototype.forEachReverse = function (fn, thisp) {\n thisp = thisp || this;\n for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {\n fn.call(thisp, walker.value, i, this);\n walker = walker.prev;\n }\n};\nYallist$1.prototype.get = function (n) {\n for (var i = 0, walker = this.head; walker !== null && i < n; i++) {\n // abort out of the list early if we hit a cycle\n walker = walker.next;\n }\n if (i === n && walker !== null) {\n return walker.value;\n }\n};\nYallist$1.prototype.getReverse = function (n) {\n for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {\n // abort out of the list early if we hit a cycle\n walker = walker.prev;\n }\n if (i === n && walker !== null) {\n return walker.value;\n }\n};\nYallist$1.prototype.map = function (fn, thisp) {\n thisp = thisp || this;\n var res = new Yallist$1();\n for (var walker = this.head; walker !== null;) {\n res.push(fn.call(thisp, walker.value, this));\n walker = walker.next;\n }\n return res;\n};\nYallist$1.prototype.mapReverse = function (fn, thisp) {\n thisp = thisp || this;\n var res = new Yallist$1();\n for (var walker = this.tail; walker !== null;) {\n res.push(fn.call(thisp, walker.value, this));\n walker = walker.prev;\n }\n return res;\n};\nYallist$1.prototype.reduce = function (fn, initial) {\n var acc;\n var walker = this.head;\n if (arguments.length > 1) {\n acc = initial;\n } else if (this.head) {\n walker = this.head.next;\n acc = this.head.value;\n } else {\n throw new TypeError('Reduce of empty list with no initial value');\n }\n for (var i = 0; walker !== null; i++) {\n acc = fn(acc, walker.value, i);\n walker = walker.next;\n }\n return acc;\n};\nYallist$1.prototype.reduceReverse = function (fn, initial) {\n var acc;\n var walker = this.tail;\n if (arguments.length > 1) {\n acc = initial;\n } else if (this.tail) {\n walker = this.tail.prev;\n acc = this.tail.value;\n } else {\n throw new TypeError('Reduce of empty list with no initial value');\n }\n for (var i = this.length - 1; walker !== null; i--) {\n acc = fn(acc, walker.value, i);\n walker = walker.prev;\n }\n return acc;\n};\nYallist$1.prototype.toArray = function () {\n var arr = new Array(this.length);\n for (var i = 0, walker = this.head; walker !== null; i++) {\n arr[i] = walker.value;\n walker = walker.next;\n }\n return arr;\n};\nYallist$1.prototype.toArrayReverse = function () {\n var arr = new Array(this.length);\n for (var i = 0, walker = this.tail; walker !== null; i++) {\n arr[i] = walker.value;\n walker = walker.prev;\n }\n return arr;\n};\nYallist$1.prototype.slice = function (from, to) {\n to = to || this.length;\n if (to < 0) {\n to += this.length;\n }\n from = from || 0;\n if (from < 0) {\n from += this.length;\n }\n var ret = new Yallist$1();\n if (to < from || to < 0) {\n return ret;\n }\n if (from < 0) {\n from = 0;\n }\n if (to > this.length) {\n to = this.length;\n }\n for (var i = 0, walker = this.head; walker !== null && i < from; i++) {\n walker = walker.next;\n }\n for (; walker !== null && i < to; i++, walker = walker.next) {\n ret.push(walker.value);\n }\n return ret;\n};\nYallist$1.prototype.sliceReverse = function (from, to) {\n to = to || this.length;\n if (to < 0) {\n to += this.length;\n }\n from = from || 0;\n if (from < 0) {\n from += this.length;\n }\n var ret = new Yallist$1();\n if (to < from || to < 0) {\n return ret;\n }\n if (from < 0) {\n from = 0;\n }\n if (to > this.length) {\n to = this.length;\n }\n for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {\n walker = walker.prev;\n }\n for (; walker !== null && i > from; i--, walker = walker.prev) {\n ret.push(walker.value);\n }\n return ret;\n};\nYallist$1.prototype.splice = function (start, deleteCount) {\n if (start > this.length) {\n start = this.length - 1;\n }\n if (start < 0) {\n start = this.length + start;\n }\n for (var i = 0, walker = this.head; walker !== null && i < start; i++) {\n walker = walker.next;\n }\n var ret = [];\n for (var i = 0; walker && i < deleteCount; i++) {\n ret.push(walker.value);\n walker = this.removeNode(walker);\n }\n if (walker === null) {\n walker = this.tail;\n }\n if (walker !== this.head && walker !== this.tail) {\n walker = walker.prev;\n }\n for (var i = 0; i < (arguments.length <= 2 ? 0 : arguments.length - 2); i++) {\n walker = insert(this, walker, i + 2 < 2 || arguments.length <= i + 2 ? undefined : arguments[i + 2]);\n }\n return ret;\n};\nYallist$1.prototype.reverse = function () {\n var head = this.head;\n var tail = this.tail;\n for (var walker = head; walker !== null; walker = walker.prev) {\n var p = walker.prev;\n walker.prev = walker.next;\n walker.next = p;\n }\n this.head = tail;\n this.tail = head;\n return this;\n};\nfunction insert(self, node, value) {\n var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self);\n if (inserted.next === null) {\n self.tail = inserted;\n }\n if (inserted.prev === null) {\n self.head = inserted;\n }\n self.length++;\n return inserted;\n}\nfunction push(self, item) {\n self.tail = new Node(item, self.tail, null, self);\n if (!self.head) {\n self.head = self.tail;\n }\n self.length++;\n}\nfunction unshift(self, item) {\n self.head = new Node(item, null, self.head, self);\n if (!self.tail) {\n self.tail = self.head;\n }\n self.length++;\n}\nfunction Node(value, prev, next, list) {\n if (!(this instanceof Node)) {\n return new Node(value, prev, next, list);\n }\n this.list = list;\n this.value = value;\n if (prev) {\n prev.next = this;\n this.prev = prev;\n } else {\n this.prev = null;\n }\n if (next) {\n next.prev = this;\n this.next = next;\n } else {\n this.next = null;\n }\n}\ntry {\n // add if support for Symbol.iterator is present\n requireIterator()(Yallist$1);\n} catch (er) {}\n\n// A linked list to keep track of recently-used-ness\nvar Yallist = yallist;\nvar MAX = Symbol('max');\nvar LENGTH = Symbol('length');\nvar LENGTH_CALCULATOR = Symbol('lengthCalculator');\nvar ALLOW_STALE = Symbol('allowStale');\nvar MAX_AGE = Symbol('maxAge');\nvar DISPOSE = Symbol('dispose');\nvar NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet');\nvar LRU_LIST = Symbol('lruList');\nvar CACHE = Symbol('cache');\nvar UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet');\nvar naiveLength = () => 1;\n\n// lruList is a yallist where the head is the youngest\n// item, and the tail is the oldest. the list contains the Hit\n// objects as the entries.\n// Each Hit object has a reference to its Yallist.Node. This\n// never changes.\n//\n// cache is a Map (or PseudoMap) that matches the keys to\n// the Yallist.Node object.\nclass LRUCache {\n constructor(options) {\n if (typeof options === 'number') options = {\n max: options\n };\n if (!options) options = {};\n if (options.max && (typeof options.max !== 'number' || options.max < 0)) throw new TypeError('max must be a non-negative number');\n // Kind of weird to have a default max of Infinity, but oh well.\n this[MAX] = options.max || Infinity;\n var lc = options.length || naiveLength;\n this[LENGTH_CALCULATOR] = typeof lc !== 'function' ? naiveLength : lc;\n this[ALLOW_STALE] = options.stale || false;\n if (options.maxAge && typeof options.maxAge !== 'number') throw new TypeError('maxAge must be a number');\n this[MAX_AGE] = options.maxAge || 0;\n this[DISPOSE] = options.dispose;\n this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;\n this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;\n this.reset();\n }\n\n // resize the cache when the max changes.\n set max(mL) {\n if (typeof mL !== 'number' || mL < 0) throw new TypeError('max must be a non-negative number');\n this[MAX] = mL || Infinity;\n trim(this);\n }\n get max() {\n return this[MAX];\n }\n set allowStale(allowStale) {\n this[ALLOW_STALE] = !!allowStale;\n }\n get allowStale() {\n return this[ALLOW_STALE];\n }\n set maxAge(mA) {\n if (typeof mA !== 'number') throw new TypeError('maxAge must be a non-negative number');\n this[MAX_AGE] = mA;\n trim(this);\n }\n get maxAge() {\n return this[MAX_AGE];\n }\n\n // resize the cache when the lengthCalculator changes.\n set lengthCalculator(lC) {\n if (typeof lC !== 'function') lC = naiveLength;\n if (lC !== this[LENGTH_CALCULATOR]) {\n this[LENGTH_CALCULATOR] = lC;\n this[LENGTH] = 0;\n this[LRU_LIST].forEach(hit => {\n hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);\n this[LENGTH] += hit.length;\n });\n }\n trim(this);\n }\n get lengthCalculator() {\n return this[LENGTH_CALCULATOR];\n }\n get length() {\n return this[LENGTH];\n }\n get itemCount() {\n return this[LRU_LIST].length;\n }\n rforEach(fn, thisp) {\n thisp = thisp || this;\n for (var walker = this[LRU_LIST].tail; walker !== null;) {\n var prev = walker.prev;\n forEachStep(this, fn, walker, thisp);\n walker = prev;\n }\n }\n forEach(fn, thisp) {\n thisp = thisp || this;\n for (var walker = this[LRU_LIST].head; walker !== null;) {\n var next = walker.next;\n forEachStep(this, fn, walker, thisp);\n walker = next;\n }\n }\n keys() {\n return this[LRU_LIST].toArray().map(k => k.key);\n }\n values() {\n return this[LRU_LIST].toArray().map(k => k.value);\n }\n reset() {\n if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {\n this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value));\n }\n this[CACHE] = new Map(); // hash of items by key\n this[LRU_LIST] = new Yallist(); // list of items in order of use recency\n this[LENGTH] = 0; // length of items in the list\n }\n\n dump() {\n return this[LRU_LIST].map(hit => isStale(this, hit) ? false : {\n k: hit.key,\n v: hit.value,\n e: hit.now + (hit.maxAge || 0)\n }).toArray().filter(h => h);\n }\n dumpLru() {\n return this[LRU_LIST];\n }\n set(key, value, maxAge) {\n maxAge = maxAge || this[MAX_AGE];\n if (maxAge && typeof maxAge !== 'number') throw new TypeError('maxAge must be a number');\n var now = maxAge ? Date.now() : 0;\n var len = this[LENGTH_CALCULATOR](value, key);\n if (this[CACHE].has(key)) {\n if (len > this[MAX]) {\n del(this, this[CACHE].get(key));\n return false;\n }\n var node = this[CACHE].get(key);\n var item = node.value;\n\n // dispose of the old one before overwriting\n // split out into 2 ifs for better coverage tracking\n if (this[DISPOSE]) {\n if (!this[NO_DISPOSE_ON_SET]) this[DISPOSE](key, item.value);\n }\n item.now = now;\n item.maxAge = maxAge;\n item.value = value;\n this[LENGTH] += len - item.length;\n item.length = len;\n this.get(key);\n trim(this);\n return true;\n }\n var hit = new Entry(key, value, len, now, maxAge);\n\n // oversized objects fall out of cache automatically.\n if (hit.length > this[MAX]) {\n if (this[DISPOSE]) this[DISPOSE](key, value);\n return false;\n }\n this[LENGTH] += hit.length;\n this[LRU_LIST].unshift(hit);\n this[CACHE].set(key, this[LRU_LIST].head);\n trim(this);\n return true;\n }\n has(key) {\n if (!this[CACHE].has(key)) return false;\n var hit = this[CACHE].get(key).value;\n return !isStale(this, hit);\n }\n get(key) {\n return get(this, key, true);\n }\n peek(key) {\n return get(this, key, false);\n }\n pop() {\n var node = this[LRU_LIST].tail;\n if (!node) return null;\n del(this, node);\n return node.value;\n }\n del(key) {\n del(this, this[CACHE].get(key));\n }\n load(arr) {\n // reset the cache\n this.reset();\n var now = Date.now();\n // A previous serialized cache has the most recent items first\n for (var l = arr.length - 1; l >= 0; l--) {\n var hit = arr[l];\n var expiresAt = hit.e || 0;\n if (expiresAt === 0)\n // the item was created without expiration in a non aged cache\n this.set(hit.k, hit.v);else {\n var maxAge = expiresAt - now;\n // dont add already expired items\n if (maxAge > 0) {\n this.set(hit.k, hit.v, maxAge);\n }\n }\n }\n }\n prune() {\n this[CACHE].forEach((value, key) => get(this, key, false));\n }\n}\nvar get = (self, key, doUse) => {\n var node = self[CACHE].get(key);\n if (node) {\n var hit = node.value;\n if (isStale(self, hit)) {\n del(self, node);\n if (!self[ALLOW_STALE]) return undefined;\n } else {\n if (doUse) {\n if (self[UPDATE_AGE_ON_GET]) node.value.now = Date.now();\n self[LRU_LIST].unshiftNode(node);\n }\n }\n return hit.value;\n }\n};\nvar isStale = (self, hit) => {\n if (!hit || !hit.maxAge && !self[MAX_AGE]) return false;\n var diff = Date.now() - hit.now;\n return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE];\n};\nvar trim = self => {\n if (self[LENGTH] > self[MAX]) {\n for (var walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null;) {\n // We know that we're about to delete this one, and also\n // what the next least recently used key will be, so just\n // go ahead and set it now.\n var prev = walker.prev;\n del(self, walker);\n walker = prev;\n }\n }\n};\nvar del = (self, node) => {\n if (node) {\n var hit = node.value;\n if (self[DISPOSE]) self[DISPOSE](hit.key, hit.value);\n self[LENGTH] -= hit.length;\n self[CACHE].delete(hit.key);\n self[LRU_LIST].removeNode(node);\n }\n};\nclass Entry {\n constructor(key, value, length, now, maxAge) {\n this.key = key;\n this.value = value;\n this.length = length;\n this.now = now;\n this.maxAge = maxAge || 0;\n }\n}\nvar forEachStep = (self, fn, node, thisp) => {\n var hit = node.value;\n if (isStale(self, hit)) {\n del(self, node);\n if (!self[ALLOW_STALE]) hit = undefined;\n }\n if (hit) fn.call(thisp, hit.value, hit.key, self);\n};\nvar lruCache = LRUCache;\n\n// parse out just the options we care about so we always get a consistent\n// obj with keys in a consistent order.\nvar opts = ['includePrerelease', 'loose', 'rtl'];\nvar parseOptions$1 = options => !options ? {} : typeof options !== 'object' ? {\n loose: true\n} : opts.filter(k => options[k]).reduce((o, k) => {\n o[k] = true;\n return o;\n}, {});\nvar parseOptions_1 = parseOptions$1;\n\nvar reExports = {};\nvar re$1 = {\n get exports(){ return reExports; },\n set exports(v){ reExports = v; },\n};\n\n// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nvar SEMVER_SPEC_VERSION = '2.0.0';\nvar MAX_LENGTH$1 = 256;\nvar MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */9007199254740991;\n\n// Max safe segment length for coercion.\nvar MAX_SAFE_COMPONENT_LENGTH = 16;\nvar constants = {\n SEMVER_SPEC_VERSION,\n MAX_LENGTH: MAX_LENGTH$1,\n MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,\n MAX_SAFE_COMPONENT_LENGTH\n};\n\nvar debug$1 = typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\\bsemver\\b/i.test(process.env.NODE_DEBUG) ? function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return console.error('SEMVER', ...args);\n} : () => {};\nvar debug_1 = debug$1;\n\n(function (module, exports) {\n var MAX_SAFE_COMPONENT_LENGTH = constants.MAX_SAFE_COMPONENT_LENGTH;\n var debug = debug_1;\n exports = module.exports = {};\n\n // The actual regexps go on exports.re\n var re = exports.re = [];\n var src = exports.src = [];\n var t = exports.t = {};\n var R = 0;\n var createToken = (name, value, isGlobal) => {\n var index = R++;\n debug(name, index, value);\n t[name] = index;\n src[index] = value;\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined);\n };\n\n // The following Regular Expressions can be used for tokenizing,\n // validating, and parsing SemVer version strings.\n\n // ## Numeric Identifier\n // A single `0`, or a non-zero digit followed by zero or more digits.\n\n createToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*');\n createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+');\n\n // ## Non-numeric Identifier\n // Zero or more digits, followed by a letter or hyphen, and then zero or\n // more letters, digits, or hyphens.\n\n createToken('NONNUMERICIDENTIFIER', '\\\\d*[a-zA-Z-][a-zA-Z0-9-]*');\n\n // ## Main Version\n // Three dot-separated numeric identifiers.\n\n createToken('MAINVERSION', \"(\".concat(src[t.NUMERICIDENTIFIER], \")\\\\.\") + \"(\".concat(src[t.NUMERICIDENTIFIER], \")\\\\.\") + \"(\".concat(src[t.NUMERICIDENTIFIER], \")\"));\n createToken('MAINVERSIONLOOSE', \"(\".concat(src[t.NUMERICIDENTIFIERLOOSE], \")\\\\.\") + \"(\".concat(src[t.NUMERICIDENTIFIERLOOSE], \")\\\\.\") + \"(\".concat(src[t.NUMERICIDENTIFIERLOOSE], \")\"));\n\n // ## Pre-release Version Identifier\n // A numeric identifier, or a non-numeric identifier.\n\n createToken('PRERELEASEIDENTIFIER', \"(?:\".concat(src[t.NUMERICIDENTIFIER], \"|\").concat(src[t.NONNUMERICIDENTIFIER], \")\"));\n createToken('PRERELEASEIDENTIFIERLOOSE', \"(?:\".concat(src[t.NUMERICIDENTIFIERLOOSE], \"|\").concat(src[t.NONNUMERICIDENTIFIER], \")\"));\n\n // ## Pre-release Version\n // Hyphen, followed by one or more dot-separated pre-release version\n // identifiers.\n\n createToken('PRERELEASE', \"(?:-(\".concat(src[t.PRERELEASEIDENTIFIER], \"(?:\\\\.\").concat(src[t.PRERELEASEIDENTIFIER], \")*))\"));\n createToken('PRERELEASELOOSE', \"(?:-?(\".concat(src[t.PRERELEASEIDENTIFIERLOOSE], \"(?:\\\\.\").concat(src[t.PRERELEASEIDENTIFIERLOOSE], \")*))\"));\n\n // ## Build Metadata Identifier\n // Any combination of digits, letters, or hyphens.\n\n createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+');\n\n // ## Build Metadata\n // Plus sign, followed by one or more period-separated build metadata\n // identifiers.\n\n createToken('BUILD', \"(?:\\\\+(\".concat(src[t.BUILDIDENTIFIER], \"(?:\\\\.\").concat(src[t.BUILDIDENTIFIER], \")*))\"));\n\n // ## Full Version String\n // A main version, followed optionally by a pre-release version and\n // build metadata.\n\n // Note that the only major, minor, patch, and pre-release sections of\n // the version string are capturing groups. The build metadata is not a\n // capturing group, because it should not ever be used in version\n // comparison.\n\n createToken('FULLPLAIN', \"v?\".concat(src[t.MAINVERSION]).concat(src[t.PRERELEASE], \"?\").concat(src[t.BUILD], \"?\"));\n createToken('FULL', \"^\".concat(src[t.FULLPLAIN], \"$\"));\n\n // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n // common in the npm registry.\n createToken('LOOSEPLAIN', \"[v=\\\\s]*\".concat(src[t.MAINVERSIONLOOSE]).concat(src[t.PRERELEASELOOSE], \"?\").concat(src[t.BUILD], \"?\"));\n createToken('LOOSE', \"^\".concat(src[t.LOOSEPLAIN], \"$\"));\n createToken('GTLT', '((?:<|>)?=?)');\n\n // Something like \"2.*\" or \"1.2.x\".\n // Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n // Only the first item is strictly required.\n createToken('XRANGEIDENTIFIERLOOSE', \"\".concat(src[t.NUMERICIDENTIFIERLOOSE], \"|x|X|\\\\*\"));\n createToken('XRANGEIDENTIFIER', \"\".concat(src[t.NUMERICIDENTIFIER], \"|x|X|\\\\*\"));\n createToken('XRANGEPLAIN', \"[v=\\\\s]*(\".concat(src[t.XRANGEIDENTIFIER], \")\") + \"(?:\\\\.(\".concat(src[t.XRANGEIDENTIFIER], \")\") + \"(?:\\\\.(\".concat(src[t.XRANGEIDENTIFIER], \")\") + \"(?:\".concat(src[t.PRERELEASE], \")?\").concat(src[t.BUILD], \"?\") + \")?)?\");\n createToken('XRANGEPLAINLOOSE', \"[v=\\\\s]*(\".concat(src[t.XRANGEIDENTIFIERLOOSE], \")\") + \"(?:\\\\.(\".concat(src[t.XRANGEIDENTIFIERLOOSE], \")\") + \"(?:\\\\.(\".concat(src[t.XRANGEIDENTIFIERLOOSE], \")\") + \"(?:\".concat(src[t.PRERELEASELOOSE], \")?\").concat(src[t.BUILD], \"?\") + \")?)?\");\n createToken('XRANGE', \"^\".concat(src[t.GTLT], \"\\\\s*\").concat(src[t.XRANGEPLAIN], \"$\"));\n createToken('XRANGELOOSE', \"^\".concat(src[t.GTLT], \"\\\\s*\").concat(src[t.XRANGEPLAINLOOSE], \"$\"));\n\n // Coercion.\n // Extract anything that could conceivably be a part of a valid semver\n createToken('COERCE', \"\".concat('(^|[^\\\\d])' + '(\\\\d{1,').concat(MAX_SAFE_COMPONENT_LENGTH, \"})\") + \"(?:\\\\.(\\\\d{1,\".concat(MAX_SAFE_COMPONENT_LENGTH, \"}))?\") + \"(?:\\\\.(\\\\d{1,\".concat(MAX_SAFE_COMPONENT_LENGTH, \"}))?\") + \"(?:$|[^\\\\d])\");\n createToken('COERCERTL', src[t.COERCE], true);\n\n // Tilde ranges.\n // Meaning is \"reasonably at or greater than\"\n createToken('LONETILDE', '(?:~>?)');\n createToken('TILDETRIM', \"(\\\\s*)\".concat(src[t.LONETILDE], \"\\\\s+\"), true);\n exports.tildeTrimReplace = '$1~';\n createToken('TILDE', \"^\".concat(src[t.LONETILDE]).concat(src[t.XRANGEPLAIN], \"$\"));\n createToken('TILDELOOSE', \"^\".concat(src[t.LONETILDE]).concat(src[t.XRANGEPLAINLOOSE], \"$\"));\n\n // Caret ranges.\n // Meaning is \"at least and backwards compatible with\"\n createToken('LONECARET', '(?:\\\\^)');\n createToken('CARETTRIM', \"(\\\\s*)\".concat(src[t.LONECARET], \"\\\\s+\"), true);\n exports.caretTrimReplace = '$1^';\n createToken('CARET', \"^\".concat(src[t.LONECARET]).concat(src[t.XRANGEPLAIN], \"$\"));\n createToken('CARETLOOSE', \"^\".concat(src[t.LONECARET]).concat(src[t.XRANGEPLAINLOOSE], \"$\"));\n\n // A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\n createToken('COMPARATORLOOSE', \"^\".concat(src[t.GTLT], \"\\\\s*(\").concat(src[t.LOOSEPLAIN], \")$|^$\"));\n createToken('COMPARATOR', \"^\".concat(src[t.GTLT], \"\\\\s*(\").concat(src[t.FULLPLAIN], \")$|^$\"));\n\n // An expression to strip any whitespace between the gtlt and the thing\n // it modifies, so that `> 1.2.3` ==> `>1.2.3`\n createToken('COMPARATORTRIM', \"(\\\\s*)\".concat(src[t.GTLT], \"\\\\s*(\").concat(src[t.LOOSEPLAIN], \"|\").concat(src[t.XRANGEPLAIN], \")\"), true);\n exports.comparatorTrimReplace = '$1$2$3';\n\n // Something like `1.2.3 - 1.2.4`\n // Note that these all use the loose form, because they'll be\n // checked against either the strict or loose comparator form\n // later.\n createToken('HYPHENRANGE', \"^\\\\s*(\".concat(src[t.XRANGEPLAIN], \")\") + \"\\\\s+-\\\\s+\" + \"(\".concat(src[t.XRANGEPLAIN], \")\") + \"\\\\s*$\");\n createToken('HYPHENRANGELOOSE', \"^\\\\s*(\".concat(src[t.XRANGEPLAINLOOSE], \")\") + \"\\\\s+-\\\\s+\" + \"(\".concat(src[t.XRANGEPLAINLOOSE], \")\") + \"\\\\s*$\");\n\n // Star ranges basically just allow anything at all.\n createToken('STAR', '(<|>)?=?\\\\s*\\\\*');\n // >=0.0.0 is like a star\n createToken('GTE0', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$');\n createToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$');\n})(re$1, reExports);\n\nvar numeric = /^[0-9]+$/;\nvar compareIdentifiers$1 = (a, b) => {\n var anum = numeric.test(a);\n var bnum = numeric.test(b);\n if (anum && bnum) {\n a = +a;\n b = +b;\n }\n return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;\n};\nvar rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a);\nvar identifiers = {\n compareIdentifiers: compareIdentifiers$1,\n rcompareIdentifiers\n};\n\nvar debug = debug_1;\nvar MAX_LENGTH = constants.MAX_LENGTH,\n MAX_SAFE_INTEGER = constants.MAX_SAFE_INTEGER;\nvar re = reExports.re,\n t = reExports.t;\nvar parseOptions = parseOptions_1;\nvar compareIdentifiers = identifiers.compareIdentifiers;\nlet SemVer$1 = class SemVer {\n constructor(version, options) {\n options = parseOptions(options);\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {\n return version;\n } else {\n version = version.version;\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(\"Invalid Version: \".concat(version));\n }\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\"version is longer than \".concat(MAX_LENGTH, \" characters\"));\n }\n debug('SemVer', version, options);\n this.options = options;\n this.loose = !!options.loose;\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease;\n var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);\n if (!m) {\n throw new TypeError(\"Invalid Version: \".concat(version));\n }\n this.raw = version;\n\n // these are actually numbers\n this.major = +m[1];\n this.minor = +m[2];\n this.patch = +m[3];\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version');\n }\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version');\n }\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version');\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = [];\n } else {\n this.prerelease = m[4].split('.').map(id => {\n if (/^[0-9]+$/.test(id)) {\n var num = +id;\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num;\n }\n }\n return id;\n });\n }\n this.build = m[5] ? m[5].split('.') : [];\n this.format();\n }\n format() {\n this.version = \"\".concat(this.major, \".\").concat(this.minor, \".\").concat(this.patch);\n if (this.prerelease.length) {\n this.version += \"-\".concat(this.prerelease.join('.'));\n }\n return this.version;\n }\n toString() {\n return this.version;\n }\n compare(other) {\n debug('SemVer.compare', this.version, this.options, other);\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0;\n }\n other = new SemVer(other, this.options);\n }\n if (other.version === this.version) {\n return 0;\n }\n return this.compareMain(other) || this.comparePre(other);\n }\n compareMain(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);\n }\n comparePre(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1;\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1;\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0;\n }\n var i = 0;\n do {\n var a = this.prerelease[i];\n var b = other.prerelease[i];\n debug('prerelease compare', i, a, b);\n if (a === undefined && b === undefined) {\n return 0;\n } else if (b === undefined) {\n return 1;\n } else if (a === undefined) {\n return -1;\n } else if (a === b) {\n continue;\n } else {\n return compareIdentifiers(a, b);\n }\n } while (++i);\n }\n compareBuild(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n var i = 0;\n do {\n var a = this.build[i];\n var b = other.build[i];\n debug('prerelease compare', i, a, b);\n if (a === undefined && b === undefined) {\n return 0;\n } else if (b === undefined) {\n return 1;\n } else if (a === undefined) {\n return -1;\n } else if (a === b) {\n continue;\n } else {\n return compareIdentifiers(a, b);\n }\n } while (++i);\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc(release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor = 0;\n this.major++;\n this.inc('pre', identifier);\n break;\n case 'preminor':\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor++;\n this.inc('pre', identifier);\n break;\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0;\n this.inc('patch', identifier);\n this.inc('pre', identifier);\n break;\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier);\n }\n this.inc('pre', identifier);\n break;\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {\n this.major++;\n }\n this.minor = 0;\n this.patch = 0;\n this.prerelease = [];\n break;\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++;\n }\n this.patch = 0;\n this.prerelease = [];\n break;\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++;\n }\n this.prerelease = [];\n break;\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0];\n } else {\n var i = this.prerelease.length;\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++;\n i = -2;\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0);\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0];\n }\n } else {\n this.prerelease = [identifier, 0];\n }\n }\n break;\n default:\n throw new Error(\"invalid increment argument: \".concat(release));\n }\n this.format();\n this.raw = this.version;\n return this;\n }\n};\nvar semver = SemVer$1;\n\nvar SemVer = semver;\nvar compare$6 = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));\nvar compare_1 = compare$6;\n\nvar compare$5 = compare_1;\nvar eq$1 = (a, b, loose) => compare$5(a, b, loose) === 0;\nvar eq_1 = eq$1;\n\nvar compare$4 = compare_1;\nvar neq$1 = (a, b, loose) => compare$4(a, b, loose) !== 0;\nvar neq_1 = neq$1;\n\nvar compare$3 = compare_1;\nvar gt$1 = (a, b, loose) => compare$3(a, b, loose) > 0;\nvar gt_1 = gt$1;\n\nvar compare$2 = compare_1;\nvar gte$1 = (a, b, loose) => compare$2(a, b, loose) >= 0;\nvar gte_1 = gte$1;\n\nvar compare$1 = compare_1;\nvar lt$1 = (a, b, loose) => compare$1(a, b, loose) < 0;\nvar lt_1 = lt$1;\n\nvar compare = compare_1;\nvar lte$1 = (a, b, loose) => compare(a, b, loose) <= 0;\nvar lte_1 = lte$1;\n\nvar eq = eq_1;\nvar neq = neq_1;\nvar gt = gt_1;\nvar gte = gte_1;\nvar lt = lt_1;\nvar lte = lte_1;\nvar cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object') {\n a = a.version;\n }\n if (typeof b === 'object') {\n b = b.version;\n }\n return a === b;\n case '!==':\n if (typeof a === 'object') {\n a = a.version;\n }\n if (typeof b === 'object') {\n b = b.version;\n }\n return a !== b;\n case '':\n case '=':\n case '==':\n return eq(a, b, loose);\n case '!=':\n return neq(a, b, loose);\n case '>':\n return gt(a, b, loose);\n case '>=':\n return gte(a, b, loose);\n case '<':\n return lt(a, b, loose);\n case '<=':\n return lte(a, b, loose);\n default:\n throw new TypeError(\"Invalid operator: \".concat(op));\n }\n};\nvar cmp_1 = cmp;\n\nvar comparator;\nvar hasRequiredComparator;\nfunction requireComparator() {\n if (hasRequiredComparator) return comparator;\n hasRequiredComparator = 1;\n var ANY = Symbol('SemVer ANY');\n // hoisted class for cyclic dependency\n class Comparator {\n static get ANY() {\n return ANY;\n }\n constructor(comp, options) {\n options = parseOptions(options);\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp;\n } else {\n comp = comp.value;\n }\n }\n debug('comparator', comp, options);\n this.options = options;\n this.loose = !!options.loose;\n this.parse(comp);\n if (this.semver === ANY) {\n this.value = '';\n } else {\n this.value = this.operator + this.semver.version;\n }\n debug('comp', this);\n }\n parse(comp) {\n var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];\n var m = comp.match(r);\n if (!m) {\n throw new TypeError(\"Invalid comparator: \".concat(comp));\n }\n this.operator = m[1] !== undefined ? m[1] : '';\n if (this.operator === '=') {\n this.operator = '';\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY;\n } else {\n this.semver = new SemVer(m[2], this.options.loose);\n }\n }\n toString() {\n return this.value;\n }\n test(version) {\n debug('Comparator.test', version, this.options.loose);\n if (this.semver === ANY || version === ANY) {\n return true;\n }\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options);\n } catch (er) {\n return false;\n }\n }\n return cmp(version, this.operator, this.semver, this.options);\n }\n intersects(comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required');\n }\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n };\n }\n if (this.operator === '') {\n if (this.value === '') {\n return true;\n }\n return new Range(comp.value, options).test(this.value);\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true;\n }\n return new Range(this.value, options).test(comp.semver);\n }\n var sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>');\n var sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<');\n var sameSemVer = this.semver.version === comp.semver.version;\n var differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<=');\n var oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, options) && (this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<');\n var oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, options) && (this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>');\n return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;\n }\n }\n comparator = Comparator;\n var parseOptions = parseOptions_1;\n var re = reExports.re,\n t = reExports.t;\n var cmp = cmp_1;\n var debug = debug_1;\n var SemVer = semver;\n var Range = requireRange();\n return comparator;\n}\n\nfunction _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }\nfunction _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nvar range;\nvar hasRequiredRange;\nfunction requireRange() {\n if (hasRequiredRange) return range;\n hasRequiredRange = 1;\n // hoisted class for cyclic dependency\n class Range {\n constructor(range, options) {\n options = parseOptions(options);\n if (range instanceof Range) {\n if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {\n return range;\n } else {\n return new Range(range.raw, options);\n }\n }\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value;\n this.set = [[range]];\n this.format();\n return this;\n }\n this.options = options;\n this.loose = !!options.loose;\n this.includePrerelease = !!options.includePrerelease;\n\n // First, split based on boolean or ||\n this.raw = range;\n this.set = range.split('||')\n // map the range to a 2d array of comparators\n .map(r => this.parseRange(r.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length);\n if (!this.set.length) {\n throw new TypeError(\"Invalid SemVer Range: \".concat(range));\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n var first = this.set[0];\n this.set = this.set.filter(c => !isNullSet(c[0]));\n if (this.set.length === 0) {\n this.set = [first];\n } else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n var _iterator = _createForOfIteratorHelper$1(this.set),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var c = _step.value;\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c];\n break;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n }\n this.format();\n }\n format() {\n this.range = this.set.map(comps => {\n return comps.join(' ').trim();\n }).join('||').trim();\n return this.range;\n }\n toString() {\n return this.range;\n }\n parseRange(range) {\n range = range.trim();\n\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n var memoOpts = Object.keys(this.options).join(',');\n var memoKey = \"parseRange:\".concat(memoOpts, \":\").concat(range);\n var cached = cache.get(memoKey);\n if (cached) {\n return cached;\n }\n var loose = this.options.loose;\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease));\n debug('hyphen replace', range);\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);\n debug('comparator trim', range);\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace);\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace);\n\n // normalize spaces\n range = range.split(/\\s+/).join(' ');\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n var rangeList = range.split(' ').map(comp => parseComparator(comp, this.options)).join(' ').split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options));\n if (loose) {\n // in loose mode, throw out any that are not valid comparators\n rangeList = rangeList.filter(comp => {\n debug('loose invalid filter', comp, this.options);\n return !!comp.match(re[t.COMPARATORLOOSE]);\n });\n }\n debug('range list', rangeList);\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n var rangeMap = new Map();\n var comparators = rangeList.map(comp => new Comparator(comp, this.options));\n var _iterator2 = _createForOfIteratorHelper$1(comparators),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var comp = _step2.value;\n if (isNullSet(comp)) {\n return [comp];\n }\n rangeMap.set(comp.value, comp);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n if (rangeMap.size > 1 && rangeMap.has('')) {\n rangeMap.delete('');\n }\n var result = [...rangeMap.values()];\n cache.set(memoKey, result);\n return result;\n }\n intersects(range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required');\n }\n return this.set.some(thisComparators => {\n return isSatisfiable(thisComparators, options) && range.set.some(rangeComparators => {\n return isSatisfiable(rangeComparators, options) && thisComparators.every(thisComparator => {\n return rangeComparators.every(rangeComparator => {\n return thisComparator.intersects(rangeComparator, options);\n });\n });\n });\n });\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test(version) {\n if (!version) {\n return false;\n }\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options);\n } catch (er) {\n return false;\n }\n }\n for (var i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true;\n }\n }\n return false;\n }\n }\n range = Range;\n var LRU = lruCache;\n var cache = new LRU({\n max: 1000\n });\n var parseOptions = parseOptions_1;\n var Comparator = requireComparator();\n var debug = debug_1;\n var SemVer = semver;\n var re = reExports.re,\n t = reExports.t,\n comparatorTrimReplace = reExports.comparatorTrimReplace,\n tildeTrimReplace = reExports.tildeTrimReplace,\n caretTrimReplace = reExports.caretTrimReplace;\n var isNullSet = c => c.value === '<0.0.0-0';\n var isAny = c => c.value === '';\n\n // take a set of comparators and determine whether there\n // exists a version which can satisfy it\n var isSatisfiable = (comparators, options) => {\n var result = true;\n var remainingComparators = comparators.slice();\n var testComparator = remainingComparators.pop();\n while (result && remainingComparators.length) {\n result = remainingComparators.every(otherComparator => {\n return testComparator.intersects(otherComparator, options);\n });\n testComparator = remainingComparators.pop();\n }\n return result;\n };\n\n // comprised of xranges, tildes, stars, and gtlt's at this point.\n // already replaced the hyphen ranges\n // turn into a set of JUST comparators.\n var parseComparator = (comp, options) => {\n debug('comp', comp, options);\n comp = replaceCarets(comp, options);\n debug('caret', comp);\n comp = replaceTildes(comp, options);\n debug('tildes', comp);\n comp = replaceXRanges(comp, options);\n debug('xrange', comp);\n comp = replaceStars(comp, options);\n debug('stars', comp);\n return comp;\n };\n var isX = id => !id || id.toLowerCase() === 'x' || id === '*';\n\n // ~, ~> --> * (any, kinda silly)\n // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\n // ~0.0.1 --> >=0.0.1 <0.1.0-0\n var replaceTildes = (comp, options) => comp.trim().split(/\\s+/).map(c => {\n return replaceTilde(c, options);\n }).join(' ');\n var replaceTilde = (comp, options) => {\n var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr);\n var ret;\n if (isX(M)) {\n ret = '';\n } else if (isX(m)) {\n ret = \">=\".concat(M, \".0.0 <\").concat(+M + 1, \".0.0-0\");\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = \">=\".concat(M, \".\").concat(m, \".0 <\").concat(M, \".\").concat(+m + 1, \".0-0\");\n } else if (pr) {\n debug('replaceTilde pr', pr);\n ret = \">=\".concat(M, \".\").concat(m, \".\").concat(p, \"-\").concat(pr, \" <\").concat(M, \".\").concat(+m + 1, \".0-0\");\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = \">=\".concat(M, \".\").concat(m, \".\").concat(p, \" <\").concat(M, \".\").concat(+m + 1, \".0-0\");\n }\n debug('tilde return', ret);\n return ret;\n });\n };\n\n // ^ --> * (any, kinda silly)\n // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n // ^1.2.3 --> >=1.2.3 <2.0.0-0\n // ^1.2.0 --> >=1.2.0 <2.0.0-0\n // ^0.0.1 --> >=0.0.1 <0.0.2-0\n // ^0.1.0 --> >=0.1.0 <0.2.0-0\n var replaceCarets = (comp, options) => comp.trim().split(/\\s+/).map(c => {\n return replaceCaret(c, options);\n }).join(' ');\n var replaceCaret = (comp, options) => {\n debug('caret', comp, options);\n var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];\n var z = options.includePrerelease ? '-0' : '';\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr);\n var ret;\n if (isX(M)) {\n ret = '';\n } else if (isX(m)) {\n ret = \">=\".concat(M, \".0.0\").concat(z, \" <\").concat(+M + 1, \".0.0-0\");\n } else if (isX(p)) {\n if (M === '0') {\n ret = \">=\".concat(M, \".\").concat(m, \".0\").concat(z, \" <\").concat(M, \".\").concat(+m + 1, \".0-0\");\n } else {\n ret = \">=\".concat(M, \".\").concat(m, \".0\").concat(z, \" <\").concat(+M + 1, \".0.0-0\");\n }\n } else if (pr) {\n debug('replaceCaret pr', pr);\n if (M === '0') {\n if (m === '0') {\n ret = \">=\".concat(M, \".\").concat(m, \".\").concat(p, \"-\").concat(pr, \" <\").concat(M, \".\").concat(m, \".\").concat(+p + 1, \"-0\");\n } else {\n ret = \">=\".concat(M, \".\").concat(m, \".\").concat(p, \"-\").concat(pr, \" <\").concat(M, \".\").concat(+m + 1, \".0-0\");\n }\n } else {\n ret = \">=\".concat(M, \".\").concat(m, \".\").concat(p, \"-\").concat(pr, \" <\").concat(+M + 1, \".0.0-0\");\n }\n } else {\n debug('no pr');\n if (M === '0') {\n if (m === '0') {\n ret = \">=\".concat(M, \".\").concat(m, \".\").concat(p).concat(z, \" <\").concat(M, \".\").concat(m, \".\").concat(+p + 1, \"-0\");\n } else {\n ret = \">=\".concat(M, \".\").concat(m, \".\").concat(p).concat(z, \" <\").concat(M, \".\").concat(+m + 1, \".0-0\");\n }\n } else {\n ret = \">=\".concat(M, \".\").concat(m, \".\").concat(p, \" <\").concat(+M + 1, \".0.0-0\");\n }\n }\n debug('caret return', ret);\n return ret;\n });\n };\n var replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options);\n return comp.split(/\\s+/).map(c => {\n return replaceXRange(c, options);\n }).join(' ');\n };\n var replaceXRange = (comp, options) => {\n comp = comp.trim();\n var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr);\n var xM = isX(M);\n var xm = xM || isX(m);\n var xp = xm || isX(p);\n var anyX = xp;\n if (gtlt === '=' && anyX) {\n gtlt = '';\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : '';\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0';\n } else {\n // nothing is forbidden\n ret = '*';\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0;\n }\n p = 0;\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>=';\n if (xm) {\n M = +M + 1;\n m = 0;\n p = 0;\n } else {\n m = +m + 1;\n p = 0;\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<';\n if (xm) {\n M = +M + 1;\n } else {\n m = +m + 1;\n }\n }\n if (gtlt === '<') {\n pr = '-0';\n }\n ret = \"\".concat(gtlt + M, \".\").concat(m, \".\").concat(p).concat(pr);\n } else if (xm) {\n ret = \">=\".concat(M, \".0.0\").concat(pr, \" <\").concat(+M + 1, \".0.0-0\");\n } else if (xp) {\n ret = \">=\".concat(M, \".\").concat(m, \".0\").concat(pr, \" <\").concat(M, \".\").concat(+m + 1, \".0-0\");\n }\n debug('xRange return', ret);\n return ret;\n });\n };\n\n // Because * is AND-ed with everything else in the comparator,\n // and '' means \"any version\", just remove the *s entirely.\n var replaceStars = (comp, options) => {\n debug('replaceStars', comp, options);\n // Looseness is ignored here. star is always as loose as it gets!\n return comp.trim().replace(re[t.STAR], '');\n };\n var replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options);\n return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '');\n };\n\n // This function is passed to string.replace(re[t.HYPHENRANGE])\n // M, m, patch, prerelease, build\n // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n // 1.2 - 3.4 => >=1.2.0 <3.5.0-0\n var hyphenReplace = incPr => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => {\n if (isX(fM)) {\n from = '';\n } else if (isX(fm)) {\n from = \">=\".concat(fM, \".0.0\").concat(incPr ? '-0' : '');\n } else if (isX(fp)) {\n from = \">=\".concat(fM, \".\").concat(fm, \".0\").concat(incPr ? '-0' : '');\n } else if (fpr) {\n from = \">=\".concat(from);\n } else {\n from = \">=\".concat(from).concat(incPr ? '-0' : '');\n }\n if (isX(tM)) {\n to = '';\n } else if (isX(tm)) {\n to = \"<\".concat(+tM + 1, \".0.0-0\");\n } else if (isX(tp)) {\n to = \"<\".concat(tM, \".\").concat(+tm + 1, \".0-0\");\n } else if (tpr) {\n to = \"<=\".concat(tM, \".\").concat(tm, \".\").concat(tp, \"-\").concat(tpr);\n } else if (incPr) {\n to = \"<\".concat(tM, \".\").concat(tm, \".\").concat(+tp + 1, \"-0\");\n } else {\n to = \"<=\".concat(to);\n }\n return \"\".concat(from, \" \").concat(to).trim();\n };\n var testSet = (set, version, options) => {\n for (var i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false;\n }\n }\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (var _i = 0; _i < set.length; _i++) {\n debug(set[_i].semver);\n if (set[_i].semver === Comparator.ANY) {\n continue;\n }\n if (set[_i].semver.prerelease.length > 0) {\n var allowed = set[_i].semver;\n if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {\n return true;\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false;\n }\n return true;\n };\n return range;\n}\n\nvar Range = requireRange();\nvar satisfies = (version, range, options) => {\n try {\n range = new Range(range, options);\n } catch (er) {\n return false;\n }\n return range.test(version);\n};\nvar satisfies_1 = satisfies;\n\n/**\n * Open editor url in a new window, and pass a message.\n */\nfunction post (window, url, data) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n var editor = window.open(url);\n var wait = 10000;\n var step = 250;\n var _URL = new URL(url),\n origin = _URL.origin;\n // eslint-disable-next-line no-bitwise\n var count = ~~(wait / step);\n function listen(evt) {\n if (evt.source === editor) {\n count = 0;\n window.removeEventListener('message', listen, false);\n }\n }\n window.addEventListener('message', listen, false);\n\n // send message\n // periodically resend until ack received or timeout\n function send() {\n if (count <= 0) {\n return;\n }\n editor.postMessage(data, origin);\n setTimeout(send, step);\n count -= 1;\n }\n setTimeout(send, step);\n}\n\n// generated with build-style.sh\nvar embedStyle = \".vega-embed {\\n position: relative;\\n display: inline-block;\\n box-sizing: border-box;\\n}\\n.vega-embed.has-actions {\\n padding-right: 38px;\\n}\\n.vega-embed details:not([open]) > :not(summary) {\\n display: none !important;\\n}\\n.vega-embed summary {\\n list-style: none;\\n position: absolute;\\n top: 0;\\n right: 0;\\n padding: 6px;\\n z-index: 1000;\\n background: white;\\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\\n color: #1b1e23;\\n border: 1px solid #aaa;\\n border-radius: 999px;\\n opacity: 0.2;\\n transition: opacity 0.4s ease-in;\\n cursor: pointer;\\n line-height: 0px;\\n}\\n.vega-embed summary::-webkit-details-marker {\\n display: none;\\n}\\n.vega-embed summary:active {\\n box-shadow: #aaa 0px 0px 0px 1px inset;\\n}\\n.vega-embed summary svg {\\n width: 14px;\\n height: 14px;\\n}\\n.vega-embed details[open] summary {\\n opacity: 0.7;\\n}\\n.vega-embed:hover summary, .vega-embed:focus-within summary {\\n opacity: 1 !important;\\n transition: opacity 0.2s ease;\\n}\\n.vega-embed .vega-actions {\\n position: absolute;\\n z-index: 1001;\\n top: 35px;\\n right: -9px;\\n display: flex;\\n flex-direction: column;\\n padding-bottom: 8px;\\n padding-top: 8px;\\n border-radius: 4px;\\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\\n border: 1px solid #d9d9d9;\\n background: white;\\n animation-duration: 0.15s;\\n animation-name: scale-in;\\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\\n text-align: left;\\n}\\n.vega-embed .vega-actions a {\\n padding: 8px 16px;\\n font-family: sans-serif;\\n font-size: 14px;\\n font-weight: 600;\\n white-space: nowrap;\\n color: #434a56;\\n text-decoration: none;\\n}\\n.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {\\n background-color: #f7f7f9;\\n color: black;\\n}\\n.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\\n content: \\\"\\\";\\n display: inline-block;\\n position: absolute;\\n}\\n.vega-embed .vega-actions::before {\\n left: auto;\\n right: 14px;\\n top: -16px;\\n border: 8px solid rgba(0, 0, 0, 0);\\n border-bottom-color: #d9d9d9;\\n}\\n.vega-embed .vega-actions::after {\\n left: auto;\\n right: 15px;\\n top: -14px;\\n border: 7px solid rgba(0, 0, 0, 0);\\n border-bottom-color: #fff;\\n}\\n.vega-embed .chart-wrapper.fit-x {\\n width: 100%;\\n}\\n.vega-embed .chart-wrapper.fit-y {\\n height: 100%;\\n}\\n\\n.vega-embed-wrapper {\\n max-width: 100%;\\n overflow: auto;\\n padding-right: 14px;\\n}\\n\\n@keyframes scale-in {\\n from {\\n opacity: 0;\\n transform: scale(0.6);\\n }\\n to {\\n opacity: 1;\\n transform: scale(1);\\n }\\n}\\n\";\n\n// polyfill for IE\nif (!String.prototype.startsWith) {\n // eslint-disable-next-line no-extend-native,func-names\n String.prototype.startsWith = function (search, pos) {\n return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\n };\n}\nfunction mergeDeep(dest) {\n for (var _len = arguments.length, src = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n src[_key - 1] = arguments[_key];\n }\n for (var _i = 0, _src = src; _i < _src.length; _i++) {\n var s = _src[_i];\n deepMerge_(dest, s);\n }\n return dest;\n}\nfunction deepMerge_(dest, src) {\n for (var _i2 = 0, _Object$keys = Object.keys(src); _i2 < _Object$keys.length; _i2++) {\n var property = _Object$keys[_i2];\n writeConfig(dest, property, src[property], true);\n }\n}\n\nvar name = \"vega-embed\";\nvar version$1 = \"6.21.3\";\nvar description = \"Publish Vega visualizations as embedded web components.\";\nvar keywords = [\"vega\", \"data\", \"visualization\", \"component\", \"embed\"];\nvar repository = {\n type: \"git\",\n url: \"http://github.com/vega/vega-embed.git\"\n};\nvar author = {\n name: \"UW Interactive Data Lab\",\n url: \"http://idl.cs.washington.edu\"\n};\nvar contributors = [{\n name: \"Dominik Moritz\",\n url: \"https://www.domoritz.de\"\n}];\nvar bugs = {\n url: \"https://github.com/vega/vega-embed/issues\"\n};\nvar homepage = \"https://github.com/vega/vega-embed#readme\";\nvar license = \"BSD-3-Clause\";\nvar main = \"build/vega-embed.js\";\nvar module = \"build/vega-embed.module.js\";\nvar unpkg = \"build/vega-embed.min.js\";\nvar jsdelivr = \"build/vega-embed.min.js\";\nvar types = \"build/vega-embed.module.d.ts\";\nvar files = [\"src\", \"build\", \"build-es5\", \"patches\"];\nvar devDependencies = {\n \"@babel/plugin-transform-runtime\": \"^7.19.6\",\n \"@release-it/conventional-changelog\": \"^5.1.1\",\n \"@rollup/plugin-commonjs\": \"24.0.1\",\n \"@rollup/plugin-json\": \"^6.0.0\",\n \"@rollup/plugin-node-resolve\": \"^15.0.1\",\n \"@rollup/plugin-terser\": \"^0.4.0\",\n \"@types/semver\": \"^7.3.13\",\n \"browser-sync\": \"^2.27.11\",\n concurrently: \"^7.6.0\",\n \"del-cli\": \"^5.0.0\",\n \"jest-canvas-mock\": \"^2.4.0\",\n \"jest-environment-jsdom\": \"^29.4.3\",\n \"patch-package\": \"^6.5.1\",\n \"postinstall-postinstall\": \"^2.1.0\",\n \"release-it\": \"^15.6.0\",\n \"rollup-plugin-bundle-size\": \"^1.0.3\",\n \"rollup-plugin-ts\": \"^3.2.0\",\n rollup: \"3.15.0\",\n sass: \"^1.58.1\",\n typescript: \"^4.9.5\",\n \"vega-lite-dev-config\": \"^0.21.0\",\n \"vega-lite\": \"^5.2.0\",\n vega: \"^5.22.1\"\n};\nvar peerDependencies = {\n vega: \"^5.21.0\",\n \"vega-lite\": \"*\"\n};\nvar dependencies = {\n \"fast-json-patch\": \"^3.1.1\",\n \"json-stringify-pretty-compact\": \"^3.0.0\",\n semver: \"^7.3.8\",\n tslib: \"^2.5.0\",\n \"vega-interpreter\": \"^1.0.4\",\n \"vega-schema-url-parser\": \"^2.2.0\",\n \"vega-themes\": \"^2.12.1\",\n \"vega-tooltip\": \"^0.30.1\"\n};\nvar bundledDependencies = [\"yallist\"];\nvar scripts = {\n prebuild: \"yarn clean && yarn build:style\",\n build: \"rollup -c\",\n \"build:style\": \"./build-style.sh\",\n clean: \"del-cli build build-es5 src/style.ts\",\n prepublishOnly: \"yarn clean && yarn build\",\n preversion: \"yarn lint && yarn test\",\n serve: \"browser-sync start --directory -s -f build *.html\",\n start: \"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'\",\n pretest: \"yarn build:style\",\n test: \"beemo jest --stdio stream\",\n \"test:inspect\": \"node --inspect-brk ./node_modules/.bin/jest --runInBand\",\n prepare: \"beemo create-config && npx patch-package\",\n prettierbase: \"beemo prettier '*.{css,scss,html}'\",\n eslintbase: \"beemo eslint .\",\n format: \"yarn eslintbase --fix && yarn prettierbase --write\",\n lint: \"yarn eslintbase && yarn prettierbase --check\",\n release: \"release-it\"\n};\nvar pkg = {\n name: name,\n version: version$1,\n description: description,\n keywords: keywords,\n repository: repository,\n author: author,\n contributors: contributors,\n bugs: bugs,\n homepage: homepage,\n license: license,\n main: main,\n module: module,\n unpkg: unpkg,\n jsdelivr: jsdelivr,\n types: types,\n files: files,\n devDependencies: devDependencies,\n peerDependencies: peerDependencies,\n dependencies: dependencies,\n bundledDependencies: bundledDependencies,\n scripts: scripts\n};\n\nvar _w$vl;\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nvar version = pkg.version;\nvar vega = vegaImport;\nvar _vegaLite = vegaLiteImport;\nvar w = typeof window !== 'undefined' ? window : undefined;\nif (_vegaLite === undefined && w !== null && w !== void 0 && (_w$vl = w.vl) !== null && _w$vl !== void 0 && _w$vl.compile) {\n _vegaLite = w.vl;\n}\nvar DEFAULT_ACTIONS = {\n export: {\n svg: true,\n png: true\n },\n source: true,\n compiled: true,\n editor: true\n};\nvar I18N = {\n CLICK_TO_VIEW_ACTIONS: 'Click to view actions',\n COMPILED_ACTION: 'View Compiled Vega',\n EDITOR_ACTION: 'Open in Vega Editor',\n PNG_ACTION: 'Save as PNG',\n SOURCE_ACTION: 'View Source',\n SVG_ACTION: 'Save as SVG'\n};\nvar NAMES = {\n vega: 'Vega',\n 'vega-lite': 'Vega-Lite'\n};\nvar VERSION = {\n vega: vega.version,\n 'vega-lite': _vegaLite ? _vegaLite.version : 'not available'\n};\nvar PREPROCESSOR = {\n vega: vgSpec => vgSpec,\n 'vega-lite': (vlSpec, config) => _vegaLite.compile(vlSpec, {\n config: config\n }).spec\n};\nvar SVG_CIRCLES = \"\\n\\n \\n \\n \\n\";\nvar CHART_WRAPPER_CLASS = 'chart-wrapper';\nfunction isTooltipHandler(h) {\n return typeof h === 'function';\n}\nfunction viewSource(source, sourceHeader, sourceFooter, mode) {\n var header = \"\".concat(sourceHeader, \"
\");\n  var footer = \"
\".concat(sourceFooter, \"\");\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n var win = window.open('');\n win.document.write(header + source + footer);\n win.document.title = \"\".concat(NAMES[mode], \" JSON Source\");\n}\n\n/**\n * Try to guess the type of spec.\n *\n * @param spec Vega or Vega-Lite spec.\n */\nfunction guessMode(spec, providedMode) {\n // Decide mode\n if (spec.$schema) {\n var parsed = schemaParser(spec.$schema);\n if (providedMode && providedMode !== parsed.library) {\n var _NAMES$providedMode;\n console.warn(\"The given visualization spec is written in \".concat(NAMES[parsed.library], \", but mode argument sets \").concat((_NAMES$providedMode = NAMES[providedMode]) !== null && _NAMES$providedMode !== void 0 ? _NAMES$providedMode : providedMode, \".\"));\n }\n var mode = parsed.library;\n if (!satisfies_1(VERSION[mode], \"^\".concat(parsed.version.slice(1)))) {\n console.warn(\"The input spec uses \".concat(NAMES[mode], \" \").concat(parsed.version, \", but the current version of \").concat(NAMES[mode], \" is v\").concat(VERSION[mode], \".\"));\n }\n return mode;\n }\n\n // try to guess from the provided spec\n if ('mark' in spec || 'encoding' in spec || 'layer' in spec || 'hconcat' in spec || 'vconcat' in spec || 'facet' in spec || 'repeat' in spec) {\n return 'vega-lite';\n }\n if ('marks' in spec || 'signals' in spec || 'scales' in spec || 'axes' in spec) {\n return 'vega';\n }\n return providedMode !== null && providedMode !== void 0 ? providedMode : 'vega';\n}\nfunction isLoader(o) {\n return !!(o && 'load' in o);\n}\nfunction createLoader(opts) {\n return isLoader(opts) ? opts : vega.loader(opts);\n}\nfunction embedOptionsFromUsermeta(parsedSpec) {\n var _embedOptions, _parsedSpec$usermeta;\n var opts = (_embedOptions = (_parsedSpec$usermeta = parsedSpec.usermeta) === null || _parsedSpec$usermeta === void 0 ? void 0 : _parsedSpec$usermeta.embedOptions) !== null && _embedOptions !== void 0 ? _embedOptions : {};\n if (isString(opts.defaultStyle)) {\n // we don't allow styles set via usermeta since it would allow injection of logic (we set the style via innerHTML)\n opts.defaultStyle = false;\n }\n return opts;\n}\n\n/**\n * Embed a Vega visualization component in a web page. This function returns a promise.\n *\n * @param el DOM element in which to place component (DOM node or CSS selector).\n * @param spec String : A URL string from which to load the Vega specification.\n * Object : The Vega/Vega-Lite specification as a parsed JSON object.\n * @param opts A JavaScript object containing options for embedding.\n */\nfunction embed(_x, _x2) {\n return _embed2.apply(this, arguments);\n}\nfunction _embed2() {\n _embed2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(el, spec) {\n var _parsedOpts$config, _usermetaOpts$config;\n var opts,\n parsedSpec,\n loader,\n loadedEmbedOptions,\n usermetaLoader,\n _opts$loader,\n usermetaOpts,\n parsedOpts,\n mergedOpts,\n _args = arguments;\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n opts = _args.length > 2 && _args[2] !== undefined ? _args[2] : {};\n if (!isString(spec)) {\n _context.next = 10;\n break;\n }\n loader = createLoader(opts.loader);\n _context.t0 = JSON;\n _context.next = 6;\n return loader.load(spec);\n case 6:\n _context.t1 = _context.sent;\n parsedSpec = _context.t0.parse.call(_context.t0, _context.t1);\n _context.next = 11;\n break;\n case 10:\n parsedSpec = spec;\n case 11:\n loadedEmbedOptions = embedOptionsFromUsermeta(parsedSpec);\n usermetaLoader = loadedEmbedOptions.loader; // either create the loader for the first time or create a new loader if the spec has new loader options\n if (!loader || usermetaLoader) {\n loader = createLoader((_opts$loader = opts.loader) !== null && _opts$loader !== void 0 ? _opts$loader : usermetaLoader);\n }\n _context.next = 16;\n return loadOpts(loadedEmbedOptions, loader);\n case 16:\n usermetaOpts = _context.sent;\n _context.next = 19;\n return loadOpts(opts, loader);\n case 19:\n parsedOpts = _context.sent;\n mergedOpts = _objectSpread(_objectSpread({}, mergeDeep(parsedOpts, usermetaOpts)), {}, {\n config: mergeConfig((_parsedOpts$config = parsedOpts.config) !== null && _parsedOpts$config !== void 0 ? _parsedOpts$config : {}, (_usermetaOpts$config = usermetaOpts.config) !== null && _usermetaOpts$config !== void 0 ? _usermetaOpts$config : {})\n });\n _context.next = 23;\n return _embed(el, parsedSpec, mergedOpts, loader);\n case 23:\n return _context.abrupt(\"return\", _context.sent);\n case 24:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _embed2.apply(this, arguments);\n}\nfunction loadOpts(_x3, _x4) {\n return _loadOpts.apply(this, arguments);\n}\nfunction _loadOpts() {\n _loadOpts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(opt, loader) {\n var _opt$config;\n var config, patch;\n return _regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n if (!isString(opt.config)) {\n _context2.next = 8;\n break;\n }\n _context2.t1 = JSON;\n _context2.next = 4;\n return loader.load(opt.config);\n case 4:\n _context2.t2 = _context2.sent;\n _context2.t0 = _context2.t1.parse.call(_context2.t1, _context2.t2);\n _context2.next = 9;\n break;\n case 8:\n _context2.t0 = (_opt$config = opt.config) !== null && _opt$config !== void 0 ? _opt$config : {};\n case 9:\n config = _context2.t0;\n if (!isString(opt.patch)) {\n _context2.next = 18;\n break;\n }\n _context2.t4 = JSON;\n _context2.next = 14;\n return loader.load(opt.patch);\n case 14:\n _context2.t5 = _context2.sent;\n _context2.t3 = _context2.t4.parse.call(_context2.t4, _context2.t5);\n _context2.next = 19;\n break;\n case 18:\n _context2.t3 = opt.patch;\n case 19:\n patch = _context2.t3;\n return _context2.abrupt(\"return\", _objectSpread(_objectSpread(_objectSpread({}, opt), patch ? {\n patch\n } : {}), config ? {\n config\n } : {}));\n case 21:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _loadOpts.apply(this, arguments);\n}\nfunction getRoot(el) {\n var _document$head;\n var possibleRoot = el.getRootNode ? el.getRootNode() : document;\n return possibleRoot instanceof ShadowRoot ? {\n root: possibleRoot,\n rootContainer: possibleRoot\n } : {\n root: document,\n rootContainer: (_document$head = document.head) !== null && _document$head !== void 0 ? _document$head : document.body\n };\n}\nfunction _embed(_x5, _x6) {\n return _embed3.apply(this, arguments);\n}\nfunction _embed3() {\n _embed3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(el, spec) {\n var _opts$config, _opts$actions, _opts$renderer, _opts$logLevel, _opts$downloadFileNam, _ref, _expressionInterprete;\n var opts,\n loader,\n config,\n actions,\n i18n,\n renderer,\n logLevel,\n downloadFileName,\n element,\n ID,\n _getRoot,\n root,\n rootContainer,\n style,\n mode,\n vgSpec,\n parsed,\n container,\n chartWrapper,\n patch,\n name,\n expressionFunction,\n ast,\n runtime,\n view,\n handler,\n hover,\n _ref2,\n hoverSet,\n updateSet,\n documentClickHandler,\n wrapper,\n details,\n summary,\n ctrl,\n _iterator,\n _step,\n _loop,\n viewSourceLink,\n compileLink,\n _opts$editorUrl,\n editorUrl,\n editorLink,\n finalize,\n _args5 = arguments;\n return _regeneratorRuntime.wrap(function _callee4$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n finalize = function _finalize() {\n if (documentClickHandler) {\n document.removeEventListener('click', documentClickHandler);\n }\n view.finalize();\n };\n opts = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};\n loader = _args5.length > 3 ? _args5[3] : undefined;\n config = opts.theme ? mergeConfig(themes[opts.theme], (_opts$config = opts.config) !== null && _opts$config !== void 0 ? _opts$config : {}) : opts.config;\n actions = isBoolean(opts.actions) ? opts.actions : mergeDeep({}, DEFAULT_ACTIONS, (_opts$actions = opts.actions) !== null && _opts$actions !== void 0 ? _opts$actions : {});\n i18n = _objectSpread(_objectSpread({}, I18N), opts.i18n);\n renderer = (_opts$renderer = opts.renderer) !== null && _opts$renderer !== void 0 ? _opts$renderer : 'canvas';\n logLevel = (_opts$logLevel = opts.logLevel) !== null && _opts$logLevel !== void 0 ? _opts$logLevel : vega.Warn;\n downloadFileName = (_opts$downloadFileNam = opts.downloadFileName) !== null && _opts$downloadFileNam !== void 0 ? _opts$downloadFileNam : 'visualization';\n element = typeof el === 'string' ? document.querySelector(el) : el;\n if (element) {\n _context5.next = 12;\n break;\n }\n throw new Error(\"\".concat(el, \" does not exist\"));\n case 12:\n if (opts.defaultStyle !== false) {\n ID = 'vega-embed-style';\n _getRoot = getRoot(element), root = _getRoot.root, rootContainer = _getRoot.rootContainer;\n if (!root.getElementById(ID)) {\n style = document.createElement('style');\n style.id = ID;\n style.innerHTML = opts.defaultStyle === undefined || opts.defaultStyle === true ? (embedStyle ).toString() : opts.defaultStyle;\n rootContainer.appendChild(style);\n }\n }\n mode = guessMode(spec, opts.mode);\n vgSpec = PREPROCESSOR[mode](spec, config);\n if (mode === 'vega-lite') {\n if (vgSpec.$schema) {\n parsed = schemaParser(vgSpec.$schema);\n if (!satisfies_1(VERSION.vega, \"^\".concat(parsed.version.slice(1)))) {\n console.warn(\"The compiled spec uses Vega \".concat(parsed.version, \", but current version is v\").concat(VERSION.vega, \".\"));\n }\n }\n }\n element.classList.add('vega-embed');\n if (actions) {\n element.classList.add('has-actions');\n }\n element.innerHTML = ''; // clear container\n container = element;\n if (actions) {\n chartWrapper = document.createElement('div');\n chartWrapper.classList.add(CHART_WRAPPER_CLASS);\n element.appendChild(chartWrapper);\n container = chartWrapper;\n }\n patch = opts.patch;\n if (patch) {\n vgSpec = patch instanceof Function ? patch(vgSpec) : applyPatch(vgSpec, patch, true, false).newDocument;\n }\n\n // Set locale. Note that this is a global setting.\n if (opts.formatLocale) {\n vega.formatLocale(opts.formatLocale);\n }\n if (opts.timeFormatLocale) {\n vega.timeFormatLocale(opts.timeFormatLocale);\n }\n\n // Set custom expression functions\n if (opts.expressionFunctions) {\n for (name in opts.expressionFunctions) {\n expressionFunction = opts.expressionFunctions[name];\n if ('fn' in expressionFunction) {\n vega.expressionFunction(name, expressionFunction.fn, expressionFunction['visitor']);\n } else if (expressionFunction instanceof Function) {\n vega.expressionFunction(name, expressionFunction);\n }\n }\n }\n ast = opts.ast; // Do not apply the config to Vega when we have already applied it to Vega-Lite.\n // This call may throw an Error if parsing fails.\n runtime = vega.parse(vgSpec, mode === 'vega-lite' ? {} : config, {\n ast\n });\n view = new (opts.viewClass || vega.View)(runtime, _objectSpread({\n loader,\n logLevel,\n renderer\n }, ast ? {\n expr: (_ref = (_expressionInterprete = vega.expressionInterpreter) !== null && _expressionInterprete !== void 0 ? _expressionInterprete : opts.expr) !== null && _ref !== void 0 ? _ref : expressionInterpreter\n } : {}));\n view.addSignalListener('autosize', (_, autosize) => {\n var type = autosize.type;\n if (type == 'fit-x') {\n container.classList.add('fit-x');\n container.classList.remove('fit-y');\n } else if (type == 'fit-y') {\n container.classList.remove('fit-x');\n container.classList.add('fit-y');\n } else if (type == 'fit') {\n container.classList.add('fit-x', 'fit-y');\n } else {\n container.classList.remove('fit-x', 'fit-y');\n }\n });\n if (opts.tooltip !== false) {\n handler = isTooltipHandler(opts.tooltip) ? opts.tooltip :\n // user provided boolean true or tooltip options\n new Handler(opts.tooltip === true ? {} : opts.tooltip).call;\n view.tooltip(handler);\n }\n hover = opts.hover;\n if (hover === undefined) {\n hover = mode === 'vega';\n }\n if (hover) {\n _ref2 = typeof hover === 'boolean' ? {} : hover, hoverSet = _ref2.hoverSet, updateSet = _ref2.updateSet;\n view.hover(hoverSet, updateSet);\n }\n if (opts) {\n if (opts.width != null) {\n view.width(opts.width);\n }\n if (opts.height != null) {\n view.height(opts.height);\n }\n if (opts.padding != null) {\n view.padding(opts.padding);\n }\n }\n _context5.next = 37;\n return view.initialize(container, opts.bind).runAsync();\n case 37:\n if (!(actions !== false)) {\n _context5.next = 63;\n break;\n }\n wrapper = element;\n if (opts.defaultStyle !== false) {\n details = document.createElement('details');\n details.title = i18n.CLICK_TO_VIEW_ACTIONS;\n element.append(details);\n wrapper = details;\n summary = document.createElement('summary');\n summary.innerHTML = SVG_CIRCLES;\n details.append(summary);\n documentClickHandler = ev => {\n if (!details.contains(ev.target)) {\n details.removeAttribute('open');\n }\n };\n document.addEventListener('click', documentClickHandler);\n }\n ctrl = document.createElement('div');\n wrapper.append(ctrl);\n ctrl.classList.add('vega-actions');\n\n // add 'Export' action\n if (!(actions === true || actions.export !== false)) {\n _context5.next = 60;\n break;\n }\n _iterator = _createForOfIteratorHelper(['svg', 'png']);\n _context5.prev = 45;\n _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {\n var ext, i18nExportAction, exportLink, scaleFactor;\n return _regeneratorRuntime.wrap(function _loop$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n ext = _step.value;\n if (actions === true || actions.export === true || actions.export[ext]) {\n i18nExportAction = i18n[\"\".concat(ext.toUpperCase(), \"_ACTION\")];\n exportLink = document.createElement('a');\n scaleFactor = isObject(opts.scaleFactor) ? opts.scaleFactor[ext] : opts.scaleFactor;\n exportLink.text = i18nExportAction;\n exportLink.href = '#';\n exportLink.target = '_blank';\n exportLink.download = \"\".concat(downloadFileName, \".\").concat(ext);\n // add link on mousedown so that it's correct when the click happens\n exportLink.addEventListener('mousedown', /*#__PURE__*/function () {\n var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(e) {\n var url;\n return _regeneratorRuntime.wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n e.preventDefault();\n _context3.next = 3;\n return view.toImageURL(ext, scaleFactor);\n case 3:\n url = _context3.sent;\n this.href = url;\n case 5:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n return function (_x7) {\n return _ref3.apply(this, arguments);\n };\n }());\n ctrl.append(exportLink);\n }\n case 2:\n case \"end\":\n return _context4.stop();\n }\n }, _loop);\n });\n _iterator.s();\n case 48:\n if ((_step = _iterator.n()).done) {\n _context5.next = 52;\n break;\n }\n return _context5.delegateYield(_loop(), \"t0\", 50);\n case 50:\n _context5.next = 48;\n break;\n case 52:\n _context5.next = 57;\n break;\n case 54:\n _context5.prev = 54;\n _context5.t1 = _context5[\"catch\"](45);\n _iterator.e(_context5.t1);\n case 57:\n _context5.prev = 57;\n _iterator.f();\n return _context5.finish(57);\n case 60:\n // add 'View Source' action\n if (actions === true || actions.source !== false) {\n viewSourceLink = document.createElement('a');\n viewSourceLink.text = i18n.SOURCE_ACTION;\n viewSourceLink.href = '#';\n viewSourceLink.addEventListener('click', function (e) {\n var _opts$sourceHeader, _opts$sourceFooter;\n viewSource(stringify(spec), (_opts$sourceHeader = opts.sourceHeader) !== null && _opts$sourceHeader !== void 0 ? _opts$sourceHeader : '', (_opts$sourceFooter = opts.sourceFooter) !== null && _opts$sourceFooter !== void 0 ? _opts$sourceFooter : '', mode);\n e.preventDefault();\n });\n ctrl.append(viewSourceLink);\n }\n\n // add 'View Compiled' action\n if (mode === 'vega-lite' && (actions === true || actions.compiled !== false)) {\n compileLink = document.createElement('a');\n compileLink.text = i18n.COMPILED_ACTION;\n compileLink.href = '#';\n compileLink.addEventListener('click', function (e) {\n var _opts$sourceHeader2, _opts$sourceFooter2;\n viewSource(stringify(vgSpec), (_opts$sourceHeader2 = opts.sourceHeader) !== null && _opts$sourceHeader2 !== void 0 ? _opts$sourceHeader2 : '', (_opts$sourceFooter2 = opts.sourceFooter) !== null && _opts$sourceFooter2 !== void 0 ? _opts$sourceFooter2 : '', 'vega');\n e.preventDefault();\n });\n ctrl.append(compileLink);\n }\n\n // add 'Open in Vega Editor' action\n if (actions === true || actions.editor !== false) {\n editorUrl = (_opts$editorUrl = opts.editorUrl) !== null && _opts$editorUrl !== void 0 ? _opts$editorUrl : 'https://vega.github.io/editor/';\n editorLink = document.createElement('a');\n editorLink.text = i18n.EDITOR_ACTION;\n editorLink.href = '#';\n editorLink.addEventListener('click', function (e) {\n post(window, editorUrl, {\n config: config,\n mode,\n renderer,\n spec: stringify(spec)\n });\n e.preventDefault();\n });\n ctrl.append(editorLink);\n }\n case 63:\n return _context5.abrupt(\"return\", {\n view,\n spec,\n vgSpec,\n finalize,\n embedOptions: opts\n });\n case 64:\n case \"end\":\n return _context5.stop();\n }\n }, _callee4, null, [[45, 54, 57, 60]]);\n }));\n return _embed3.apply(this, arguments);\n}\n\nexport { DEFAULT_ACTIONS, embed as default, guessMode, vega, _vegaLite as vegaLite, version };\n//# sourceMappingURL=vega-embed.module.js.map\n","module.exports = __WEBPACK_EXTERNAL_MODULE__146__;","\"use strict\";\n\n// Note: This regex matches even invalid JSON strings, but since we’re\n// working on the output of `JSON.stringify` we know that only valid strings\n// are present (unless the user supplied a weird `options.indent` but in\n// that case we don’t care since the output would be invalid anyway).\nvar stringOrChar = /(\"(?:[^\\\\\"]|\\\\.)*\")|[:,]/g;\n\nmodule.exports = function stringify(passedObj, options) {\n var indent, maxLength, replacer;\n\n options = options || {};\n indent = JSON.stringify(\n [1],\n undefined,\n options.indent === undefined ? 2 : options.indent\n ).slice(2, -3);\n maxLength =\n indent === \"\"\n ? Infinity\n : options.maxLength === undefined\n ? 80\n : options.maxLength;\n replacer = options.replacer;\n\n return (function _stringify(obj, currentIndent, reserved) {\n // prettier-ignore\n var end, index, items, key, keyPart, keys, length, nextIndent, prettified, start, string, value;\n\n if (obj && typeof obj.toJSON === \"function\") {\n obj = obj.toJSON();\n }\n\n string = JSON.stringify(obj, replacer);\n\n if (string === undefined) {\n return string;\n }\n\n length = maxLength - currentIndent.length - reserved;\n\n if (string.length <= length) {\n prettified = string.replace(\n stringOrChar,\n function (match, stringLiteral) {\n return stringLiteral || match + \" \";\n }\n );\n if (prettified.length <= length) {\n return prettified;\n }\n }\n\n if (replacer != null) {\n obj = JSON.parse(string);\n replacer = undefined;\n }\n\n if (typeof obj === \"object\" && obj !== null) {\n nextIndent = currentIndent + indent;\n items = [];\n index = 0;\n\n if (Array.isArray(obj)) {\n start = \"[\";\n end = \"]\";\n length = obj.length;\n for (; index < length; index++) {\n items.push(\n _stringify(obj[index], nextIndent, index === length - 1 ? 0 : 1) ||\n \"null\"\n );\n }\n } else {\n start = \"{\";\n end = \"}\";\n keys = Object.keys(obj);\n length = keys.length;\n for (; index < length; index++) {\n key = keys[index];\n keyPart = JSON.stringify(key) + \": \";\n value = _stringify(\n obj[key],\n nextIndent,\n keyPart.length + (index === length - 1 ? 0 : 1)\n );\n if (value !== undefined) {\n items.push(keyPart + value);\n }\n }\n }\n\n if (items.length > 0) {\n return [start, indent + items.join(\",\\n\" + nextIndent), end].join(\n \"\\n\" + currentIndent\n );\n }\n }\n\n return string;\n })(passedObj, \"\", 0);\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(959);\n"],"names":["clone","_instanceof","obj","type","nativeMap","nativeSet","nativePromise","Map","_","Set","Promise","parent","circular","depth","prototype","includeNonEnumerable","allParents","allChildren","useBuffer","Buffer","Infinity","_clone","child","proto","resolve","reject","then","value","err","__isArray","__isRegExp","RegExp","source","__getRegExpFlags","lastIndex","__isDate","Date","getTime","isBuffer","allocUnsafe","length","copy","Error","Object","create","getPrototypeOf","index","indexOf","push","i","forEach","key","keyChild","valueChild","set","entryChild","add","attrs","getOwnPropertyDescriptor","getOwnPropertySymbols","symbols","symbol","descriptor","enumerable","defineProperty","allPropertyNames","getOwnPropertyNames","propertyName","__objToStr","o","toString","call","re","flags","global","ignoreCase","multiline","clonePrototype","c","module","exports","createThunk","Procedure","this","argTypes","shimArgs","arrayArgs","arrayBlockIndices","scalarArgs","offsetArgs","offsetArgIndex","indexArgs","shapeArgs","funcName","pre","body","post","debug","user_args","proc","proc_args","args","slice","arg_type","blockIndices","count","lvalue","offset","array","printCode","blockSize","uniq","innerFill","order","j","dimension","nargs","has_index","code","vars","idx","pidx","join","processBlock","block","dtypes","carg","name","ptrStr","arrNum","offArgIndex","localStr","arrStr","replace","reStrArr","ptrStrArr","Math","abs","trim","typeSummary","summary","Array","allEqual","t","digits","match","charAt","typesig","orders","blockBegin","blockEnd","loopBegin","loopEnd","loopOrders","newOrder","arglist","zeros","off_arg","init_string","thisVars","concat","matched","countMatches","indexStr","outerFill","console","log","loopName","Function","f","compile","thunkName","string_typesig","max","shapeLengthConditions","shapeConditions","thunk","bind","undefined","esprima","PREFIX_COUNTER","CompiledArgument","rvalue","CompiledRoutine","localVars","func","src","ast","parse","range","prefix","argNames","params","expression","callee","names","getArgNames","compiledArgs","exploded","n","rewrite","node","nstr","lo","hi","visit","computed","object","property","argNo","usage","left","operator","LVALUE","getUsage","identifier","window","g","self","isGlobal","id","createLocal","keys","REQUIRED_FIELDS","OPTIONAL_FIELDS","warn","dupe_array","result","dupe_number","root","factory","Token","TokenName","FnExprTokens","Syntax","PropertyKind","Messages","Regex","SyntaxTreeDelegate","strict","lineNumber","lineStart","delegate","lookahead","state","extra","assert","condition","message","isDecimalDigit","ch","isHexDigit","isOctalDigit","isWhiteSpace","isLineTerminator","isIdentifierStart","NonAsciiIdentifierStart","test","String","fromCharCode","isIdentifierPart","NonAsciiIdentifierPart","isStrictModeReservedWord","isRestrictedWord","isKeyword","addComment","start","end","loc","comment","lastCommentStart","comments","attachComment","leadingComments","trailingComments","skipSingleLineComment","line","column","charCodeAt","skipMultiLineComment","throwError","UnexpectedToken","skipComment","scanHexEscape","len","toLowerCase","getEscapedIdentifier","substr","getIdentifier","scanPunctuator","code2","ch2","ch3","ch4","ch1","tokenize","openParenToken","tokens","openCurlyToken","Punctuator","scanNumericLiteral","number","NumericLiteral","parseInt","scanHexLiteral","isImplicitOctalLiteral","octal","scanOctalLiteral","parseFloat","scanRegExp","str","classMarker","terminated","UnterminatedRegExp","literal","scanRegExpBody","restore","throwErrorTolerant","scanRegExpFlags","pattern","e","InvalidRegExp","testRegExp","RegularExpression","collectRegex","pos","regex","token","pop","advance","EOF","Identifier","Keyword","NullLiteral","BooleanLiteral","quote","unescaped","startLineNumber","startLineStart","StringLiteral","scanStringLiteral","prevToken","checkToken","advanceSlash","collectToken","lex","peek","Position","SourceLocation","startLine","startColumn","peekLineTerminator","found","messageFormat","error","arguments","msg","whole","description","apply","errors","throwUnexpected","UnexpectedEOS","UnexpectedNumber","UnexpectedString","UnexpectedIdentifier","isFutureReservedWord","UnexpectedReserved","StrictReservedWord","expect","expectKeyword","keyword","matchKeyword","consumeSemicolon","oldIndex","oldLineNumber","oldLineStart","oldLookahead","isLeftHandSide","expr","MemberExpression","parsePropertyFunction","param","first","previousStrict","startToken","parseFunctionSourceElements","StrictParamName","markEnd","createFunctionExpression","parseObjectPropertyKey","StrictOctalLiteral","createLiteral","createIdentifier","parseObjectProperty","parseAssignmentExpression","createProperty","parseVariableIdentifier","parsePrimaryExpression","parseExpression","parseGroupExpression","elements","createArrayExpression","parseArrayInitialiser","kind","properties","map","Data","Get","hasOwnProperty","StrictDuplicateProperty","AccessorDataProperty","AccessorGetSet","createObjectExpression","parseObjectInitialiser","stricted","firstRestricted","tmp","StrictFunctionName","parseParams","parseFunctionExpression","createThisExpression","parseArguments","parseNonComputedProperty","isIdentifierName","parseNonComputedMember","parseComputedMember","parseNewExpression","allowIn","createMemberExpression","parseLeftHandSideExpression","createNewExpression","parsePostfixExpression","previousAllowIn","createCallExpression","parseLeftHandSideExpressionAllowCall","StrictLHSPostfix","InvalidLHSInAssignment","createPostfixExpression","parseUnaryExpression","StrictLHSPrefix","createUnaryExpression","argument","StrictDelete","binaryPrecedence","prec","parseConditionalExpression","consequent","alternate","marker","markers","stack","right","createBinaryExpression","parseBinaryExpression","createConditionalExpression","op","StrictLHSAssignment","createAssignmentExpression","createSequenceExpression","expressions","parseBlock","statement","list","parseSourceElement","parseStatementList","createBlockStatement","parseVariableDeclaration","init","StrictVarName","createVariableDeclarator","parseVariableDeclarationList","parseForStatement","update","oldInIteration","declarations","createVariableDeclaration","InvalidLHSInForIn","inIteration","parseStatement","createForStatement","createForInStatement","parseSwitchCase","createSwitchCase","parseTryStatement","handlers","finalizer","StrictCatchVariable","createCatchClause","NoCatchOrFinally","createTryStatement","labeledBody","createEmptyStatement","createExpressionStatement","parseExpressionStatement","label","inSwitch","IllegalBreak","createBreakStatement","labelSet","UnknownLabel","parseBreakStatement","IllegalContinue","createContinueStatement","parseContinueStatement","createDebuggerStatement","createDoWhileStatement","parseFunctionDeclaration","createIfStatement","parseIfStatement","inFunctionBody","IllegalReturn","createReturnStatement","discriminant","cases","clause","oldInSwitch","defaultFound","createSwitchStatement","MultipleDefaultsInSwitch","parseSwitchStatement","NewlineAfterThrow","createThrowStatement","parseThrowStatement","createWhileStatement","parseWhileStatement","StrictModeWith","createWithStatement","parseWithStatement","Redeclaration","createLabeledStatement","sourceElement","oldLabelSet","oldInFunctionBody","sourceElements","Literal","paramSet","StrictParamDupe","createFunctionDeclaration","parseProgram","parseSourceElements","createProgram","filterTokenLocation","entry","AssignmentExpression","ArrayExpression","BlockStatement","BinaryExpression","BreakStatement","CallExpression","CatchClause","ConditionalExpression","ContinueStatement","DoWhileStatement","DebuggerStatement","EmptyStatement","ExpressionStatement","ForStatement","ForInStatement","FunctionDeclaration","FunctionExpression","IfStatement","LabeledStatement","LogicalExpression","NewExpression","ObjectExpression","Program","Property","ReturnStatement","SequenceExpression","SwitchStatement","SwitchCase","ThisExpression","ThrowStatement","TryStatement","UnaryExpression","UpdateExpression","VariableDeclaration","VariableDeclarator","WhileStatement","WithStatement","processComment","lastChild","bottomRightStack","postProcess","each","defaults","rest","generator","raw","accessor","guardedHandlers","version","options","tolerant","lexError","program","types","freeze","equal","a","b","constructor","isArray","valueOf","data","opts","cmp","cycles","aobj","bobj","seen","stringify","toJSON","isFinite","JSON","out","TypeError","seenIndex","sort","splice","readFloatLE","isSlowBuffer","_isBuffer","decompress","pako","lz4","zlib","input","inflate","Uint8Array","buffer","rowProxy","table_serialization","EchoTableWidgetView","EchoTableWidgetModel","TableWidgetModel","widgets_1","get","serializers_1","compression_1","tableToJSON","JSONToTable","ndarray","dtypeToArray","int8","Int8Array","int16","Int16Array","int32","Int32Array","uint8","uint16","Uint16Array","uint32","Uint32Array","float32","Float32Array","float64","Float64Array","RowIndex","Symbol","manager","size","decoder","TextDecoder","col","val","entries","compression","valBuffer","dtype","u8buf","strcol","decode","lstr","shape","min","columns","widget","table","fields","arraycolumn","stringcolumn","v","isNaN","r","deserialize","serialize","__awaiter","thisArg","_arguments","P","fulfilled","step","next","rejected","done","base_1","ndarray_unpack","DOMWidgetModel","assign","_model_name","_view_name","_model_module","_view_module","_model_module_version","_view_module_version","_table","_columns","serializers","echo","unpack_models","DOMWidgetView","render","that","model","res","touch","xxhash","util","hashSize","blockBuf","makeBuffer","hashTable","makeHashTable","magicNum","bsUncompressed","bsMap","buf","sliceArray","arraySlice","compressBound","decompressBound","sIndex","readU32","useBlockSum","useContentSize","bsIdx","maxBlockSize","readU64","maxSize","decompressBlock","dst","sLength","dIndex","mLength","mOffset","sEnd","literalCount","compressBlock","mIndex","mAnchor","searchMatchCount","seq","hash","hashU32","decompressFrame","useContentSum","compSize","compressFrame","writeU32","bsDefault","remaining","clearHashTable","z","compress","x","imul","al","bl","prime1","prime2","prime3","prime5","rotl32","rotmul32","h","m","shiftxor32","s","xxhapply","m0","m1","xxh1","xxh4","xxh16","seed","l","dup","do_unpack","cwise","arr","iota","hasTypedArrays","compare1st","stride","terms","compileConstructor","className","useGetters","procedure","CACHED_CONSTRUCTORS","indices","index_str","shapeArg","strideArg","a_vars","c_vars","tShape","tStride","ctor","d","sz","arrayDType","ctor_list","Deflate","deflate","deflateRaw","gzip","Inflate","inflateRaw","ungzip","constants","zlib_deflate","utils","strings","ZStream","Z_NO_FLUSH","Z_SYNC_FLUSH","Z_FULL_FLUSH","Z_FINISH","Z_OK","Z_STREAM_END","Z_DEFAULT_COMPRESSION","Z_DEFAULT_STRATEGY","Z_DEFLATED","level","method","chunkSize","windowBits","memLevel","strategy","opt","ended","chunks","strm","avail_out","status","deflateInit2","header","deflateSetHeader","dictionary","dict","string2buf","deflateSetDictionary","_dict_set","deflator","flush_mode","_flush_mode","next_in","avail_in","output","next_out","onData","subarray","deflateEnd","onEnd","chunk","flattenChunks","zlib_inflate","GZheader","Z_NEED_DICT","Z_STREAM_ERROR","Z_DATA_ERROR","Z_MEM_ERROR","to","inflateInit2","inflateGetHeader","inflateSetDictionary","inflator","last_avail_out","wrap","inflateReset","next_out_utf8","utf8border","tail","utf8str","buf2string","inflateEnd","_has","sources","shift","p","STR_APPLY_UIA_OK","__","_utf8len","q","TextEncoder","encode","c2","m_pos","str_len","buf_len","utf16buf","c_len","buf2binstring","adler","s1","s2","Z_PARTIAL_FLUSH","Z_BLOCK","Z_TREES","Z_ERRNO","Z_BUF_ERROR","Z_NO_COMPRESSION","Z_BEST_SPEED","Z_BEST_COMPRESSION","Z_FILTERED","Z_HUFFMAN_ONLY","Z_RLE","Z_FIXED","Z_BINARY","Z_TEXT","Z_UNKNOWN","crcTable","k","makeTable","crc","_tr_init","_tr_stored_block","_tr_flush_block","_tr_tally","_tr_align","adler32","crc32","MAX_MATCH","MIN_LOOKAHEAD","INIT_STATE","BUSY_STATE","FINISH_STATE","errorCode","rank","zero","slide_hash","wsize","w_size","hash_size","head","prev","HASH","hash_shift","hash_mask","flush_pending","pending","pending_buf","pending_out","total_out","flush_block_only","last","block_start","strstart","put_byte","putShortMSB","read_buf","total_in","longest_match","cur_match","chain_length","max_chain_length","scan","best_len","prev_length","nice_match","limit","_win","wmask","w_mask","strend","scan_end1","scan_end","good_match","match_start","fill_window","_w_size","more","window_size","insert","ins_h","deflate_stored","flush","have","min_block","pending_buf_size","used","bi_valid","matches","high_water","deflate_fast","hash_head","bflush","match_length","max_lazy_match","MIN_MATCH","sym_next","deflate_slow","max_insert","prev_match","match_available","Config","good_length","max_lazy","nice_length","max_chain","configuration_table","DeflateState","gzhead","gzindex","last_flush","w_bits","hash_bits","dyn_ltree","HEAP_SIZE","dyn_dtree","bl_tree","l_desc","d_desc","bl_desc","bl_count","MAX_BITS","heap","heap_len","heap_max","sym_buf","lit_bufsize","sym_end","opt_len","static_len","bi_buf","deflateStateCheck","deflateResetKeep","data_type","deflateReset","ret","deflateInit","old_flush","level_flags","text","hcrc","time","os","beg","gzhead_extra","bstate","deflate_huff","deflate_rle","dictLength","tmpDict","avail","deflateInfo","xflags","extra_len","BAD","_in","_out","dmax","whave","wnext","s_window","hold","bits","lcode","dcode","lmask","dmask","here","dist","from","from_source","lencode","distcode","lenbits","distbits","top","dolen","mode","dodist","sane","inflate_fast","inflate_table","HEAD","DICT","TYPE","TYPEDO","COPY_","LEN_","LEN","CHECK","MEM","zswap32","InflateState","havedict","check","total","wbits","ncode","nlen","ndist","lens","work","lendyn","distdyn","back","was","inflateStateCheck","inflateResetKeep","inflateReset2","lenfix","distfix","virgin","fixedtables","sym","updatewindow","inflateInit","put","here_bits","here_op","here_val","last_bits","last_op","last_val","hbuf","inf_leave","dictid","inflateInfo","lbase","lext","dbase","dext","lens_index","codes","table_index","incr","fill","low","mask","curr","drop","huff","base","MAXBITS","offs","extra_lbits","extra_dbits","extra_blbits","bl_order","static_ltree","static_dtree","D_CODES","_dist_code","_length_code","base_length","base_dist","StaticTreeDesc","static_tree","extra_bits","extra_base","elems","max_length","has_stree","static_l_desc","static_d_desc","static_bl_desc","TreeDesc","dyn_tree","stat_desc","max_code","d_code","put_short","w","send_bits","send_code","tree","bi_reverse","gen_codes","next_code","init_block","LITERALS","END_BLOCK","bi_windup","smaller","_n2","_m2","pqdownheap","compress_block","ltree","dtree","lc","sx","build_tree","desc","stree","xbits","overflow","gen_bitlen","scan_tree","curlen","prevlen","nextlen","max_count","min_count","REP_3_6","REPZ_3_10","REPZ_11_138","send_tree","static_init_done","stored_len","LENGTH_CODES","L_CODES","tr_static_init","opt_lenb","static_lenb","max_blindex","block_mask","detect_data_type","BL_CODES","build_bl_tree","lcodes","dcodes","blcodes","send_all_trees","STATIC_TREES","bi_flush","default","showError","el","innerHTML","VegaWidgetModel","VegaWidget","selector","spec","output_area","imgIndex","outputs","item","metadata","imageIndex","jsIndex","javascriptIndex","document","getElementById","substring","loader","http","credentials","view","toImageURL","imageData","split","output_type","catch","requires","IJupyterWidgetRegistry","activate","app","widgets","registerWidget","plugin","autoStart","pkg","MODULE_VERSION","MODULE_NAME","viewInstance","_spec_source","_opt_source","_df","_img_url","imgURL","mgr","viewElement","hasBeenUpdated","id_","crypto","randomUUID","canvas","querySelector","width","style","height","url","toDataURL","model_name","model_module","model_module_version","view_name","view_module","view_module_version","createElement","errorElement","appendChild","color","reembed","imgJson","imgElement","vegaEmbed","finalize","send","applyUpdate","resize","filter","remove","newValues","updateDataFrame","updateArray2D","changeSet","changeset","change","runAsync","applyUpdates","updates","on","ev","checkWidgetUpdate","textContent","proxy","rows","fancyCol","cols","row","compare","sorted","ptr","unique_pred","unique_eq","extendStatics","__extends","setPrototypeOf","__proto__","_hasOwnProperty","_objectKeys","keys_1","_deepClone","isInteger","charCode","escapePathComponent","path","unescapePathComponent","hasUndefined","i_1","objKeys","objKeysLength","patchErrorMessageFormatter","messageParts","PatchError","_super","operation","_newTarget","_this","JsonPatchError","deepClone","objOps","newDocument","removed","move","getValueByPointer","originalValue","applyOperation","valueToCopy","_areEquals","_get","arrOps","pointer","getOriginalDestination","validateOperation","mutateDocument","banPrototypeModifications","validator","returnValue","existingPathFragment","validateFunction","applyPatch","patch","results","length_1","applyReducer","operationResult","pathLen","existingPathLen","validate","sequence","externalValidator","arrA","arrB","beforeDict","WeakMap","Mirror","observers","ObserverInfo","callback","observer","unobserve","observe","mirror","getMirror","observerInfo","getObserverFromMirror","dirtyCheck","generate","fastCheck","clearTimeout","setTimeout","addEventListener","patches","delete","removeObserverFromMirror","removeEventListener","invertible","_generate","temp","newKeys","oldKeys","deleted","oldVal","newVal","tree1","tree2","fn","fname","accessorName","accessorFields","getter","get1","getN","field","splitAccessPath","identity","one","truthy","falsy","log$1","None","Error$1","logger","handler","info","isObject","isLegalKey","mergeConfig","_len","configs","_key","reduce","signals","mergeNamed","layout","writeConfig","recurse","toNumber","exp","sign","symlog","log1p","symexp","expm1","pow","exponent","pan","domain","delta","lift","ground","d0","d1","dd","panLinear","panLog","panPow","panSymlog","constant","zoom","anchor","scale","da","zoomLinear","zoomLog","zoomPow","zoomSymlog","quarter","date","getMonth","utcquarter","getUTCMonth","clampRange","span","DESCENDING","ord","fmap","gen","comparator","ascending","u","compare1","compareN","debounce","delay","tid","extend","extent","extentIndex","hop","has","NULL","fastmap","has$1","empty","clear","clean","threshold","center","inherits","members","writable","configurable","inrange","r0","r1","isBoolean","isDate","isIterable","iterator","isNumber","isRegExp","flat","lerp","frac","DEFAULT_MAX_SIZE","lruCache","maxsize","merge","array0","array1","n0","n1","merged","i0","i1","repeat","reps","pad","padchar","align","ceil","$","toBoolean","defaultParser","toDate","parser","truncate","ellipsis","visitArray","visitor","EOL","QUOTE","NEWLINE","RETURN","objectConverter","inferColumns","columnSet","delimiter","reFormat","DELIMITER","parseRows","N","I","eof","eol","preformatBody","formatValue","formatRow","year","hours","getUTCHours","minutes","getUTCMinutes","seconds","getUTCSeconds","milliseconds","getUTCMilliseconds","getUTCFullYear","getUTCDate","formatDate","convert","customConverter","format","formatBody","formatRows","topology","objects","features","geometries","bbox","geometry","transformPoint","transform","x0","y0","kx","ky","dx","translate","dy","arcs","arc","points","reverse","point","ring","polygon","coordinates","stitchedArcs","fragmentByStart","fragmentByEnd","fragments","emptyIndex","p1","p0","dp","ends","fg","unshift","gf","meshArcs","geom","geomsByArc","extract0","extract1","extract2","extract3","geoms","extractArcs","stitch","e10","sqrt","e5","e2","tickSpec","stop","power","floor","log10","factor","i2","inc","round","ticks","tickIncrement","tickStep","prefixExponent","formatSpecifier","specifier","exec","FormatSpecifier","comma","precision","formatDecimalParts","toExponential","coefficient","NaN","toFixed","toLocaleString","toPrecision","formatRounded","toUpperCase","formatPrefix","prefixes","locale","grouping","thousands","group","Number","currencyPrefix","currency","currencySuffix","decimal","numerals","formatNumerals","percent","minus","nan","newFormat","formatTypes","suffix","formatType","maybeSuffix","valuePrefix","valueSuffix","valueNegative","formatTrim","padding","t0","t1","timeInterval","floori","offseti","interval","previous","setTime","every","durationSecond","durationMinute","durationHour","durationDay","durationWeek","durationMonth","durationYear","timeDay","setHours","setDate","getDate","getTimezoneOffset","utcDay","setUTCHours","setUTCDate","unixDay","timeWeekday","getDay","timeSunday","timeMonday","timeTuesday","timeWednesday","timeThursday","timeFriday","timeSaturday","utcWeekday","getUTCDay","utcSunday","utcMonday","utcTuesday","utcWednesday","utcThursday","utcFriday","utcSaturday","timeYear","setMonth","setFullYear","getFullYear","utcYear","setUTCMonth","setUTCFullYear","timeMonth","utcMonth","timeHour","getMilliseconds","getSeconds","getMinutes","getHours","utcHour","setUTCMinutes","timeMinute","utcMinute","setUTCSeconds","second","millisecond","descending","bisector","compare2","mid","YEAR","QUARTER","MONTH","WEEK","DATE","DAY","DAYOFYEAR","HOURS","MINUTES","SECONDS","MILLISECONDS","TIME_UNITS","UNITS","timeUnits","units","unit","defaultSpecifiers","timeUnitSpecifier","specifiers","fmt","localYear","y","dayofyear","localDayOfYear","week","localWeekNum","localFirst","localDate","H","M","S","L","utcdayofyear","utcDayOfYear","utcweek","utcWeekNum","UTC","utcFirst","utcDate","inv","newDate","phase","getUnit","weekday","day","firstDay","localGet","localInv","timeFloor","utcGet","utcInv","utcFloor","timeIntervals","utcIntervals","utcInterval","ival","timeOffset","utcOffset","timeSequence","utcSequence","Milli","Seconds","Minutes","Hours","Day","Month","Year","intervals","bin","ext","maxbins","target","formatLocale","locale_dateTime","dateTime","locale_date","locale_time","locale_periods","periods","locale_weekdays","days","locale_shortWeekdays","shortDays","locale_months","months","locale_shortMonths","shortMonths","periodRe","formatRe","periodLookup","formatLookup","weekdayRe","weekdayLookup","shortWeekdayRe","shortWeekdayLookup","monthRe","monthLookup","shortMonthRe","shortMonthLookup","formats","formatDayOfMonth","formatMicroseconds","formatYearISO","formatFullYearISO","formatHour24","formatHour12","formatDayOfYear","formatMilliseconds","formatMonthNumber","formatMinutes","formatUnixTimestamp","formatUnixTimestampSeconds","formatSeconds","formatWeekdayNumberMonday","formatWeekNumberSunday","formatWeekNumberISO","formatWeekdayNumberSunday","formatWeekNumberMonday","formatFullYear","formatZone","formatLiteralPercent","utcFormats","formatUTCDayOfMonth","formatUTCMicroseconds","formatUTCYearISO","formatUTCFullYearISO","formatUTCHour24","formatUTCHour12","formatUTCDayOfYear","formatUTCMilliseconds","formatUTCMonthNumber","formatUTCMinutes","formatUTCSeconds","formatUTCWeekdayNumberMonday","formatUTCWeekNumberSunday","formatUTCWeekNumberISO","formatUTCWeekdayNumberSunday","formatUTCWeekNumberMonday","formatUTCYear","formatUTCFullYear","formatUTCZone","parses","string","parseSpecifier","parseDayOfMonth","parseMicroseconds","parseYear","parseFullYear","parseHour24","parseDayOfYear","parseMilliseconds","parseMonthNumber","parseMinutes","parseQuarter","parseUnixTimestamp","parseUnixTimestampSeconds","parseSeconds","parseWeekdayNumberMonday","parseWeekNumberSunday","parseWeekNumberISO","parseWeekdayNumberSunday","parseWeekNumberMonday","parseZone","parseLiteralPercent","pads","newParse","Z","Q","V","W","U","X","utcFormat","utcParse","timeFormat","timeParse","numberRe","percentRe","requoteRe","requote","dISO","dow","UTCdISO","memoize","cache","numberLocale","formatFloat","numberFormat","decimalChar","dec","lastIndexOf","rightmostDigit","trimZeroes","formatSpan","precisionPrefix","precisionRound","precisionFixed","defaultNumberLocale","defaultTimeLocale","resetNumberFormatDefaultLocale","numberFormatLocale","definition","numberFormatDefaultLocale","timeMultiFormat","minute","hour","month","timeLocale","resetTimeFormatDefaultLocale","timeFormatLocale","timeFormatDefaultLocale","createLocale","numberSpec","timeSpec","resetDefaultLocale","protocol_re","allowed_re","whitespace_re","fileProtocol","async","load","uri","sanitize","href","localFile","file","fileAccess","isFile","loadFile","isAllowed","hasProtocol","baseURL","startsWith","endsWith","defaultProtocol","rel","context","crossOrigin","fileLoader","fs","filename","accept","readFile","fileReject","httpLoader","fetch","response","ok","statusText","httpReject","isValid","typeParsers","boolean","integer","unknown","typeTests","typeList","inferType","values","inferTypes","delimitedFormat","delim","responseType","dsv","json","prop","parseJSON","filters","interior","exterior","topojson","feature","mesh","csv","tsv","reader","read","schema","timeParser","utcParser","datum","parsers","parts","loaderFactory","UniqueList","idFunc","ids","asyncCallback","df","TUPLE_ID_KEY","TUPLE_ID","isTuple","tupleid","setid","ingest$1","derive","rederive","stableCompare","isChangeSet","rem","mod","remp","modp","reflow","modify","tuple","pulse","tuples","cur","modifies","CACHE","Parameters","force","modified","OP_ID","NO_PARAMS","Operator","react","stamp","qrank","_update","parameters","flag","bit","targets","_targets","skip","initonly","argval","_argval","argops","_argops","deps","marshall","detach","evaluate","StopPropagation","run","rv","STREAM_ID","EventStream","receive","_filter","_apply","stream","consume","_consume","evt","trg","preventDefault","stopPropagation","throttle","pause","now","dataflow","between","active","SKIP","onStream","onOperator","updater","connect","Pulse","materialize","addFilter","MultiPulse","pulses","changed","ADD","REM","MOD","changes","reentrant","ADD_REM","ADD_MOD","ALL","REFLOW","SOURCE","NO_SOURCE","NO_FIELDS","fork","addAll","addF","remF","modF","srcF","cleans","runAfter","nomod","some","sum","NO_OPT","siftdown","Dataflow","logLevel","_clock","_rank","_locale","_loader","_touched","_input","_pulse","_heap","nodes","ridx","cidx","siftup","Heap","_postrun","logMethod","_log","Transform","cleanThreshold","targetRank","rerank","queue","_enqueue","ingest","preload","_pending","requests","loadPending","request","events","querySelectorAll","prerun","postrun","_getPulse","pr","priority","all","cb","_running","enqueue","singlePulse","transforms","Definition","valueof","compareDefined","sd","swap","quantile","value0","quantileSorted","median","quantiles","quartiles","estimateBandwidth","mean","variance","deviation","maxb","logb","div","divide","minstep","steps","eps","nice","random","setRandom","bootstrapCI","samples","alpha","mu","dotbin","smooth","thresh","smoothing","sample","pdf","cdf","icdf","SQRT2PI","PI","SQRT2","nextSample","sampleNormal","stdev","rds","densityNormal","cumulativeNormal","cd","quantileNormal","erfinv","gaussian","sigma","kde","support","bandwidth","kernel","sampleLogNormal","densityLogNormal","cumulativeLogNormal","quantileLogNormal","lognormal","mixture","dists","weights","normalize","distributions","sampleUniform","densityUniform","cumulativeUniform","quantileUniform","uniform","ols","uX","uY","uXY","uX2","slope","Y","xv","yv","ux","uy","visitPoints","rSquared","predict","SSE","SST","sse","sst","linear","XY","X2","coef","ly","xy","YL","XYL","X2Y","c0","c1","YS","lx","quad","x2","X3","X4","X2X2","poly","lhs","rhs","matrix","gaussianElimination","uncenter","maxiters","epsilon","loess","bw","yhat","residuals","robustWeights","iter","edge","denom","xk","yk","tricube","xkw","updateInterval","medianResidual","arg","cnt","MIN_RADIANS","sampleCurve","minSteps","maxSteps","minX","maxX","sy","ymin","ymax","scaleY","pm","angleDelta","a0","atan2","a1","groupkey","measureName","as","noop","base_op","AggregateOps","cell","store","num","__count__","missing","valid","product","mean_d","average","req","dev","variancep","stdevp","stderr","distinct","ci0","ci1","q2","q1","q3","argmin","argmax","ValidAggregateOps","createMeasure","compareIndex","_ops","compileMeasures","agg","ops","getreqs","ctr","TupleStore","reset","measure","prototype$1","Aggregate","_adds","_mods","_alen","_mlen","_drop","_cross","_dims","_dnames","_measures","_countOnly","_counts","_prev","_inputs","_outputs","Bin","SortedList","resort","Collect","Compare","update$5","CountPattern","Cross","_add","_rem","_ext","_q","quartile","ci","_ci","aggr","cross","dims","vals","collect","cells","inputs","inputMap","inputVisit","groupby","dname","cellkey","mname","outname","newcell","newtuple","measures","celltuple","counts","adds","mods","band","bins","_bins","b0","b1","process","tcase","case","_parameterCheck","_match","_stop","_finish","stopwords","_tuples","Distributions","normal","FUNCTION","def","Density","fieldNames","partition$1","groups","DotBin","Expression","update$4","Extent","Subflow","Facet","_keys","Field","update$3","Filter","Flatten","Fold","Formula","Generate","distribution","minsteps","maxsteps","autostep","detachSubflow","flow","subflow","flows","sf","_group","detached","initTargets","act","rekey","k0","k1","isMod","revisit","arrays","maxlen","fnames","Methods","Empty","Impute","JoinAggregate","KDE","Key","update$2","Load","Lookup","MultiExtent","update$1","extents","MultiValues","Params","Pivot","PreFacet","Project","Proxy","Quantile","Relay","Sample","Sequence","Sieve","TimeUnit","gVals","kVal","impute","getValue","getField","fName","kName","gNames","keyvals","gKey","kMap","gMap","partition","_impute","cumulative","density","defaultValue","_transform","pivotKeys","aggregateParams","project","lut","dt","probs","cap","OUTPUT","TupleIndex","Values","utc","timezone","_floor","u0","u1","tunits","WindowOps","row_number","dense_rank","drank","percent_rank","cume_dist","cume","ntile","lag","lead","first_value","last_value","nth_value","nth","prev_value","next_value","find","ValidWindowOps","WindowState","windows","countOnly","visitInputs","WindowOp","Window","processPartition","ignorePeers","frame","setWindow","adjustRange","bisect","_context","bezierCurveTo","_x0","_x1","_y0","_y1","Basis","BasisClosed","BasisOpen","Bundle","beta","_basis","_beta","wind","areaStart","_line","areaEnd","_point","lineEnd","lineTo","closePath","moveTo","_x2","_x3","_x4","_y2","_y3","_y4","_x","_y","custom","bundle","_k","Cardinal","tension","cardinal","CardinalOpen","CardinalClosed","_x5","_y5","cos","sin","pi","halfPi","tau","asin","x1","y1","y2","_l01_a","_l01_2a","_l12_a","_l12_2a","_l23_a","_l23_2a","CatmullRom","_alpha","x23","y23","catmullRom","CatmullRomClosed","CatmullRomOpen","Linear","LinearClosed","slope3","h0","h1","s0","slope2","MonotoneX","MonotoneY","ReflectContext","Natural","controlPoints","Step","_t","_t0","px","py","tauEpsilon","append","Path","_append","appendRound","quadraticCurveTo","arcTo","x21","y21","x01","y01","l01_2","x20","y20","l21_2","l20_2","l21","l01","tan","acos","t01","t21","ccw","cw","rect","withPath","RangeError","arcInnerRadius","innerRadius","arcOuterRadius","outerRadius","arcStartAngle","startAngle","arcEndAngle","endAngle","arcPadAngle","padAngle","cornerTangents","rc","ox","oy","x11","y11","x10","y10","x00","y00","d2","D","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","cx","cy","defined","curve","defined0","area","x0z","y0z","arealine","lineX0","lineY0","lineY1","lineX1","draw","domCanvas","getContext","domImage","Image","ascendingBisect","bisectRight","bisectLeft","Color","darker","brighter","reI","reN","reP","reHex","reRgbInteger","reRgbPercent","reRgbaInteger","reRgbaPercent","reHslPercent","reHslaPercent","named","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","color_formatHex","rgb","formatHex","color_formatRgb","formatRgb","rgbn","Rgb","rgba","hsla","rgbConvert","opacity","rgb_formatHex","hex","rgb_formatRgb","clampa","clampi","Hsl","hslConvert","hsl","clamph","clampt","hsl2rgb","m2","v0","v1","v2","v3","t2","t3","channels","displayable","formatHex8","formatHsl","clamp","hue","nogamma","rgbGamma","exponential","gamma","rgbSpline","spline","colors","rgbBasis","rgbBasisClosed","isNumberArray","ArrayBuffer","isView","DataView","numberArray","genericArray","nb","na","reA","reB","am","bm","bs","bi","bimap","interpolate","polymap","transformer","untransform","piecewise","rescale","clamper","invert","rangeRound","continuous","initRange","initInterpolator","interpolator","tickFormat","linearish","prestep","maxIter","transformLog","transformExp","transformLogn","transformExpn","pow10","reflect","loggish","logs","pows","E","log2","logp","powp","transformPow","transformSqrt","transformSquare","powish","transformSymlog","transformSymexp","symlogish","ticker","tickIntervals","tickInterval","utcTicks","utcTickInterval","timeTicks","timeTickInterval","calendar","formatMillisecond","formatSecond","formatMinute","formatHour","formatDay","formatWeek","formatMonth","formatYear","k10","sequential","sequentialPow","k21","r2","divergingPow","InternMap","keyof","super","defineProperties","_intern","intern_get","intern_set","intern_delete","InternSet","implicit","ordinal","svgNode","translateX","translateY","rotate","skewX","scaleX","atan","interpolateTransform","pxComma","pxParen","degParen","xa","ya","xb","yb","interpolateTransformCss","DOMMatrix","WebKitCSSMatrix","isIdentity","decompose","interpolateTransformSvg","createElementNS","setAttribute","baseVal","consolidate","cosh","zoomRho","rho","rho2","rho4","ux0","uy0","w0","ux1","uy1","w1","coshr0","tanh","sinh","duration","_1","_2","hslLong","Xn","Yn","Zn","labConvert","Lab","Hcl","hcl2lab","rgb2lrgb","xyz2lab","lab","lab2xyz","lrgb2rgb","hcl","hclConvert","hclLong","A","B","C","ED","EB","BC_DA","Cubehelix","cubehelixConvert","cubehelix","cubehelixGamma","cubehelixLong","bandSpace","paddingInner","paddingOuter","space","Log","Pow","Sqrt","Symlog","Time","Sequential","Diverging","Quantize","Threshold","Ordinal","Point","Band","BinOrdinal","Continuous","Discrete","Discretizing","Interpolating","Temporal","ordinalRange","range$1","invertRange","pointish","scales","VEGA_SCALE","registerScale","invertExtent","invertRangeExtent","isValidScaleType","hasType","isContinuous","isDiscrete","isDiscretizing","isLogarithmic","isInterpolating","isQuantile","sequentialLog","sequentialSymlog","diverging","divergingLog","divergingSymlog","thresholds","quantize","scaleBinOrdinal","scaleProps","interpolateRange","interpolateColors","quantizeInterpolator","scaleFraction","scale$1","interp","palette","scheme","schemes","category10","category20","category20b","category20c","tableau10","tableau20","accent","dark2","paired","pastel1","pastel2","set1","set2","set3","blues","greens","greys","oranges","purples","reds","blueGreen","bluePurple","greenBlue","orangeRed","purpleBlue","purpleBlueGreen","purpleRed","redPurple","yellowGreen","yellowOrangeBrown","yellowOrangeRed","blueOrange","brownBlueGreen","purpleGreen","purpleOrange","redBlue","redGrey","yellowGreenBlue","redYellowBlue","redYellowGreen","pinkYellowGreen","spectral","viridis","magma","inferno","plasma","cividis","rainbow","sinebow","turbo","browns","tealBlues","teals","warmGreys","goldGreen","goldOrange","goldRed","lightGreyRed","lightGreyTeal","lightMulti","lightOrange","lightTealBlue","darkBlue","darkGold","darkGreen","darkMulti","darkRed","SymbolLegend","DiscreteLegend","defaultFormatter","tickCount","minStep","validTicks","endpoints","tickValues","noSkip","varfmt","tickLog","labelValues","binValues","thresholdValues","isDiscreteRange","labelFormat","thresholdFormat","formatRange","formatDiscrete","formatPoint","dflt","domainCaption","isTemporal","gradient_id","patternPrefix","isGradient","gradient","gradientRef","defs","Gradient","stops","lookup","horizontal","vertical","curves","orientation","paramCounts","commandPattern","numberPattern","spacePattern","flagPattern","commands","cmd","paramCount","segment","ws","DegToRad","HalfPi","Tau","HalfSqrt3","segmentCache","bezierCache","bezier","th0","th1","rx","ry","sin_th","cos_th","a00","a01","a10","a11","cos_th0","sin_th0","cos_th1","sin_th1","th_half","sin_th_h2","x3","y3","current","sX","sY","pathRender","tempX","tempY","tempControlX","tempControlY","controlX","controlY","anchorX","anchorY","beginPath","drawArc","coords","seg","large","sweep","rotateX","th","pl","sfactor_sq","sfactor","xc","yc","th_arc","segs","th2","th3","segments","bez","Tan30","builtins","parsed","customSymbol","rectangleX","rectangleY","rectangleWidth","rectangleHeight","vg_rect","crTL","crTR","crBL","crBR","rectangle","tl","tr","br","cornerRadius","vg_trail","ready","w2","ud","trail","value$1","arcShape","padRadius","da0","da1","ap","rp","rc0","rc1","oc","x32","y32","intersect","ax","ay","bx","by","kc","centroid","areavShape","areahShape","lineShape","rectShape","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomRight","cornerRadiusBottomLeft","symbolShape","circle","trailShape","hasCornerRadius","clip_id","resetSVGClipId","clip$1","renderer","clip","_defs","clipping","Bounds","union","Item","mark","bounds","GroupItem","items","ResourceLoader","customLoader","increment","decrement","boundStroke","miter","stroke","strokeOpacity","sw","strokeWidth","expand","strokeJoin","miterAdjustment","MAX_VALUE","equals","angle","rotatedPoints","encloses","alignsWith","intersects","contains","sanitizeURL","loadImage","img","cors","onload","onerror","complete","poll","circleThreshold","rot","ma","mb","mc","md","addL","addX","addY","addp","addpL","boundContext","deg","context$1","px1","py1","px2","py2","quadExtrema","px3","py3","cubicExtrema","sa","ea","cubic","intersectPath","brush","isPointInPath","intersectPoint","box","intersectRect","intersectRule","intersectBoxLine","blend","globalCompositeOperation","addStops","addColorStop","createRadialGradient","image","ictx","fillStyle","createLinearGradient","fillRect","createPattern","fillOpacity","globalAlpha","lw","strokeStyle","lineWidth","lineCap","strokeCap","lineJoin","miterLimit","strokeMiterLimit","setLineDash","strokeDash","lineDashOffset","strokeDashOffset","zindex","zorder","scene","zdirty","zitems","pickVisit","hit","drawAll","drawPath","drawOne","pick$1","gx","gy","pixelRatio","hitPath","filled","isPointInStroke","pickPath","translateItem","markItemPath","isect","tag","nested","attr","emit","rotateItem","bound","pick","markMultiItemPath","tip","orient","clipGroup","offset$1","strokeOffset","emitRectangle","off","rectanglePath","hitBackground","hitForeground","hitCorner","noBound","fore","strokeForeground","save","dw","dh","ix","interactive","marktype","pickMark","content","background","foreground","getImage","imageWidth","aspect","imageHeight","imageXOffset","imageYOffset","baseline","ar0","ar1","imageSmoothingEnabled","drawImage","xOffset","yOffset","path$1","pathCache","path$2","transformItem","draw$2","rule","widthCache","textMetrics","fontSize","measureWidth","estimateWidth","useCanvas","use","_estimateWidth","textValue","currentFontHeight","_measureWidth","font","currentFont","measureText","lineHeight","textLines","lineBreak","multiLineOffset","widthGetter","rtl","dir","fontFamily","fontStyle","fontVariant","fontWeight","textAlign","tempBounds","anchorPoint","radius","theta","lh","fillText","strokeText","Marks","boundItem","DUMMY","boundMark","hasItems","sceneToJSON","indent","sceneFromJSON","initialize","Scenegraph","createMark","role","aria","domCreate","doc","ns","domFind","childNodes","tagName","domChild","ownerDocument","insertBefore","domClear","removeChild","cssClass","event","getBoundingClientRect","clientX","clientLeft","clientY","clientTop","Handler","customTooltip","_active","_handlers","_tooltip","defaultTooltip","element","Renderer","_el","_bgcolor","markdef","origin","_obj","firstChild","_origin","_scene","_handlerIndex","eventName","handleHref","MouseEvent","dispatchEvent","handleTooltip","show","tooltip","mdef","resolveItem","getItemBoundingClientRect","bottom","scaleFactor","bgcolor","_width","_height","_scale","dirty","_call","_render","renderAsync","_ready","_load","redraw","DragEnterEvent","DragLeaveEvent","DragOverEvent","MouseDownEvent","MouseMoveEvent","MouseOutEvent","MouseOverEvent","ClickEvent","MouseWheelEvent","TouchStartEvent","TouchMoveEvent","TouchEndEvent","TooltipShowEvent","TooltipHideEvent","HrefEvent","CanvasHandler","_down","_touch","_first","_events","eventListenerCheck","eventBundle","fire","moveEvent","overEvent","outEvent","pickEvent","exit","inactive","_canvas","DOMMouseScroll","mousemove","dragover","mouseout","dragleave","mousedown","click","touchstart","changedTouches","touchmove","touchend","vegaType","devicePixelRatio","CanvasRenderer","_options","_redraw","_dirty","_tempb","base$1","SVGHandler","_hrefHandler","listener","_tooltipHandler","externalContext","inDOM","HTMLElement","parentNode","ratio","setTransform","ctx","db","vb","viewBounds","clipToBounds","clearRect","__data__","svg","_svg","ARIA_HIDDEN","ARIA_LABEL","ARIA_ROLE","ARIA_ROLEDESCRIPTION","GRAPHICS_OBJECT","GRAPHICS_SYMBOL","roledesc","AriaIgnore","AriaGuides","caption","title","extractTitle","props","channelCaption","titleCaption","AriaEncode","ariaRole","ariaRoleDescription","ariaItemAttributes","hide","ariaMarkAttributes","ariaGuide","ariaMark","innerText","attrText","markup","outer","inner","open","close","serializeXML","_serialize","hasAttributes","attributes","hasChildNodes","children","nodeType","nodeValue","stylesAttr","stylesCss","rootAttributes","xmlns","svgns","SVGRenderer","_dirtyID","_root","dirtyParents","updateGradient","grad","pt","setAttributes","viewBox","preserveAspectRatio","fx","fy","fr","updateClipping","sibling","__values__","bg","cg","ownerSVGElement","previousSibling","siblingCheck","nextSibling","_clearDefs","setAttributeNS","RootIndex","setProperty","removeAttribute","_dirtyCheck","_dirtyAll","isDirty","isGroup","mark_extras","setStyle","ts","removeAttributeNS","removeProperty","location","SVGStringRenderer","_text","class","attrList","_hrefs","prefixed","styleList","display","Canvas","RenderType","PNG","SVG","modules","renderModule","hits","intersectMark","intersectGroup","visitMark","intersectItem","marks","headless","clipBounds","boundClip","TOLERANCE","sceneEqual","pathEqual","ka","kb","objectEqual","resetSVGDefIds","Top","Left","Right","Bottom","Start","Middle","End","Group","AxisRole","TitleRole","LegendRole","RowHeader","RowFooter","RowTitle","ColHeader","ColFooter","ColTitle","FitX","FitY","All","Each","Flush","Column","Row","Bound","rebound","markBounds","COUNTER_NAME","Mark","Overlap","counter","_signals","scenegraph","lookup$1","Init","methods","parity","greedy","sep","hasOverlap","hasBounds","Render","separation","boundScale","boundTolerance","tolerance","boundTest","boundOrient","isYAxis","axisLayout","axis","grid","labels","axisIndices","position","minExtent","maxExtent","titlePadding","dl","axisTitleLayout","auto","bboxFlush","bboxFull","offsetValue","gridLayout","nodirty","alignCol","alignRow","padCol","padRow","ncols","nrows","xExtent","xMax","yExtent","yMax","boxes","boundFlush","boundFull","layoutHeaders","headers","isX","bf","layoutTitle","legendParams","config","legends","offsets","mult","legendLayout","legend","_bounds","ex","ey","tpad","tx","ty","legendTitleOffset","legendGroupLayout","legendBounds","widths","legendEntryLayout","lr","noBar","vgrad","ViewLayout","AxisTicks","DataJoin","defaultItemCreate","Encode","LegendEntries","views","rowheaders","rowfooters","colheaders","colfooters","rowtitle","coltitle","gridLayoutGroups","headerBand","footerBand","titleAnchor","titleBand","trellisLayout","xBounds","yBounds","autosize","subtitle","titleLayout","_autosize","viewWidth","viewHeight","_resizeView","viewSizeLayout","layoutGroup","shouldReflow","newMap","fmod","encoders","reenter","enter","fraction","lskip","perc","adjust","labelFraction","perc2","sourceX","sourceY","targetX","targetY","LinkPath","Paths","rr","iy","sr","ta","sc","ss","tc","mr","Pie","includePad","Scale","domainCheck","adjustScheme","flip","SortItems","isContinuousColor","rawDomain","domainMid","scaleKey","rangeStep","configureRangeStep","scheme$1","schemeExtent","interpolateGamma","schemeCount","configureScheme","configureRange","domainRaw","configureBins","includeZero","padDomain","domainMin","domainMax","domainImplicit","configureDomain","Zero","Center","Normalize","DefOutput","Stack","stackCenter","stackNormalize","stackZero","lastPos","lastNeg","streamGeometry","streamGeometryType","streamObjectType","Feature","FeatureCollection","Sphere","sphere","MultiPoint","LineString","streamLine","MultiLineString","Polygon","streamPolygon","MultiPolygon","GeometryCollection","closed","coordinate","polygonStart","polygonEnd","Adder","_partials","_n","quarterPi","hypot","areaSum","areaRingSum","areaStream","areaRingStart","areaRingEnd","areaPointFirst","areaPoint","boundsStream","X0","Y0","Z0","X1","Y1","Z1","Y2","Z2","centroidStream","centroidPoint","centroidLineStart","centroidLineEnd","centroidRingStart","centroidRingEnd","centroidPointFirstLine","centroidPointLine","centroidPointFirstRing","centroidPointRing","PathContext","_radius","pointRadius","lengthRing","lengthSum","lengthStream","lengthPointFirst","lengthPoint","cacheDigits","cacheAppend","cacheRadius","cacheCircle","PathString","projection","projectionStream","contextStream","lines","rejoin","Intersection","other","compareIntersection","startInside","subject","pointEqual","isSubject","spherical","cartesian","lambda","phi","cosPhi","cartesianDot","cartesianCross","cartesianAddInPlace","cartesianScale","vector","cartesianNormalizeInPlace","longitude","flatten","pointVisible","clipLine","sink","ringBuffer","ringSink","polygonStarted","pointRing","ringStart","ringEnd","sinPhi","winding","point0","lambda0","phi0","sinPhi0","cosPhi0","lambda1","sinPhi1","cosPhi1","point1","phi1","absDelta","antimeridian","intersection","phiArc","polygonContains","pointLine","ringSegments","validSegment","sign0","sign1","sinLambda0Lambda1","clipAntimeridianIntersect","direction","circleRadius","cosRadius","clipMax","clipMin","clipRectangle","visible","corner","comparePoint","ca","x__","y__","v__","x_","y_","v_","activeStream","bufferStream","clipStream","linePoint","polygonInside","cleanInside","compose","rotationIdentity","deltaLambda","deltaPhi","deltaGamma","rotationLambda","rotationPhiGamma","forwardRotationLambda","rotation","cosDeltaPhi","sinDeltaPhi","cosDeltaGamma","sinDeltaGamma","TransformStream","fit","fitBounds","clipExtent","fitExtent","fitSize","fitWidth","fitHeight","maxDepth","cosMinDistance","delta2","resampleLineTo","phi2","lambda2","dx2","dy2","dz","lambda00","b00","c00","resampleStream","ringPoint","resampleNone","transformRadians","scaleTranslateRotate","scaleTranslate","cosAlpha","sinAlpha","ai","fi","projectionMutator","projectAt","projectResample","projectTransform","projectRotateTransform","cacheStream","preclip","postclip","recenter","resample","transformRotate","clipAngle","cr","smallRadius","notHemisphere","two","n2","n2n2","n1n2","determinant","n1xn2","uu","polar","v00","point2","sinRadius","circleStream","reflectX","reflectY","conicProjection","parallels","conicEqualAreaRaw","sy0","forward","cylindricalEqualAreaRaw","r0y","conicEqualArea","azimuthalRaw","azimuthalInvert","cc","azimuthalEqualAreaRaw","cxcy","azimuthalEquidistantRaw","mercatorRaw","mercatorProjection","reclip","tany","conicConformalRaw","equirectangularRaw","conicEquidistantRaw","nx","A1","A2","A3","A4","equalEarthRaw","l2","l6","gnomonicRaw","naturalEarth1Raw","phi4","orthographicRaw","stereographicRaw","transverseMercatorRaw","sqrt2","SQRT1_2","mollweideBromleyTheta","cp","cpsinPhi","mollweideRaw","mollweideBromleyRaw","defaultPath","projectionProperties","proj","projections","getProjectionPath","albers","albersusa","lower48Point","alaskaPoint","hawaiiPoint","lower48","alaska","hawaii","pointStream","albersUsa","streams","azimuthalequalarea","azimuthalequidistant","conicconformal","conicequalarea","conicequidistant","equalEarth","equirectangular","gnomonic","mercator","mollweide","naturalEarth1","orthographic","stereographic","transversemercator","graticuleX","graticuleY","contours","smoothLinear","tz","contour","polygons","holes","startIndex","endIndex","isorings","hole","xt","yt","_0","ringContains","xi","yi","pj","xj","yj","segmentContains","collinear","Isocontour","transformPolygon","transformRing","density2D","weight","values0","values1","blurX","blurY","cellSize","LN2","KDE2D","levels","paths","transformPaths","PARAMS","Contour","GeoJSON","GeoPath","GeoPoint","GeoShape","Graticule","DX","DY","graticule","outline","extentMajor","extentMinor","stepMajor","stepMinor","Heatmap","dependency","$x","$y","$value","$max","Projection","xm","ym","xp","yp","leaf","defaultX","defaultY","quadtree","Quadtree","leaf_copy","_features","_points","lon","lat","geojson","initPath","shapeGenerator","shared","dep","opacity_","color_","can","getImageData","pix","putImageData","toCanvas","featurize","collectGeoJSON","treeProto","vx","vy","cover","xz","yz","quads","retainer","removeAll","visitAfter","dispatch","Dispatch","typename","T","taskHead","taskTail","timeout","pokeDelay","clockLast","clockNow","clockSkew","clock","performance","setFrame","requestAnimationFrame","clearNow","Timer","_time","_next","timer","restart","wake","timerFlush","sleep","nap","poke","clearInterval","setInterval","initialAngle","nodeById","nodeId","ForceMap","strength","collide","radii","iterations","ri","ri2","prepare","rj","jiggle","_nodes","_random","nbody","strengths","distanceMin2","distanceMax2","theta2","accumulate","distanceMin","distanceMax","link","links","distances","bias","distance","initializeStrength","initializeDistance","Forces","ForceParams","ForceConfig","ForceOutput","Force","setup","sim","forces","getForce","numForces","setForceParam","hierarchy","mapChildren","objectChildren","childs","Node","eachBefore","computeHeight","copyData","optional","required","constantZero","iters","simulation","alphaMin","alphaDecay","alphaTarget","velocityDecay","stepper","tick","initializeNodes","initializeForce","randomSource","closest","stopped","static","finish","eachAfter","ancestor","aNodes","ancestors","bNodes","leastCommonAncestor","descendants","leaves","extendBasis","enclosesWeakAll","enclosesNot","encloseBasis2","encloseBasis3","dr","enclosesWeak","encloseBasis","r21","r3","a2","a3","b2","b3","c3","d3","ab","place","score","packSiblingsRandom","circles","aa","sj","sk","pack","shuffle","packEncloseRandom","defaultRadius","radiusLeaf","packChildrenRandom","translateChild","preroot","ambiguous","imputed","defaultId","defaultParentId","parentId","stratify","nodeKey","currentId","currentParentId","nodeByKey","slash","parentof","defaultSeparation","nextLeft","nextRight","moveSubtree","wm","wp","nextAncestor","vim","TreeNode","meanXReduce","maxYReduce","squarifyRatio","sumValue","minValue","maxValue","newRatio","minRatio","dice","squarify","resquarify","_squarify","Nest","nest","valuesByKey","keyValue","HierarchyLayout","setParams","setFields","Output$3","Pack","Output$2","Partition","Stratify","positionNode","parentKey","Layouts","tidy","nodeSize","treeRoot","firstWalk","secondWalk","sizeNode","siblings","executeShifts","midpoint","vip","vop","vom","sip","sop","som","apportion","cluster","previousNode","meanX","maxY","leafLeft","leafRight","Output$1","Tree","TreeLinks","Tiles","binary","sums","valueOffset","valueTarget","valueLeft","valueRight","slicedice","Treemap","tile","paddingStack","paddingTop","paddingRight","paddingBottom","paddingLeft","treemap","ALPHA_MASK","getBuffer","DIV","SIZE","RIGHT0","RIGHT1","outOfBounds","textWidth","textHeight","collision","bm0","bm1","getRange","X_DIR","Y_DIR","Aligns","Baselines","boundary","isInside","anchorCode","TOP","MIDDLE","BOTTOM","placeAreaLabel","bitmaps","avoidBaseMark","markIndex","areaWidth","maxAreaWidth","tryLabel","_xMid","_yMid","swapTmp","labelPlaced","labelPlaced2","setRange","bm2","bitmap","labelLayout","texts","avoidMarks","lineAnchor","positions","getOffsets","anchors","getAnchors","grouptype","isGroupArea","markBoundary","infPadding","isNaiveGroupArea","maxTextWidth","maxTextHeight","_set","_clear","indexStart","indexEnd","clearRange","Bitmap","scaler","labelInside","baseMark","border","baseMarkContext","strokeContext","baseMarkBuffer","strokeBuffer","layer1","layer2","strokeAlpha","baseMarkAlpha","markBitmaps","baseBitmaps","sizeFactor","insideFactor","placeMarkLabel","Anchors","Label","Loess","null","Regression","dof","degreesOfFreedom","dom","elen","flen","Qnew","hh","bvirt","enow","fnow","eindex","findex","hindex","vec","C1","C2","orient2d","detleft","detright","det","detsum","acxtail","acytail","bcxtail","bcytail","ahi","alo","bhi","blo","_i","_j","u3","acx","bcx","acy","bcy","errbound","C1len","C2len","Dlen","orient2dadapt","EDGE_STACK","Delaunator","getX","defaultGetX","getY","defaultGetY","maxTriangles","_triangles","_halfedges","_hashSize","_hullPrev","_hullNext","_hullTri","_hullHash","_ids","_dists","hullPrev","hullNext","hullTri","hullHash","minY","minDist","i0x","i0y","i1x","i1y","minRadius","circumradius","i2x","i2y","quicksort","hull","triangles","halfedges","cl","circumcenter","_cx","_cy","_hullStart","hullSize","_hashKey","trianglesLen","_addTriangle","_legalize","pseudoAngle","ar","inCircle","hbl","_link","bp","tempDist","Voronoi","delaunay","xmin","xmax","_circumcenters","vectors","_init","circumcenters","inedges","ti","tj","_renderSegment","_project","renderBounds","renderCell","_clip","cellPolygon","_regioncode","_clipSegment","_step","neighbors","cj","loop","li","aj","lj","_cell","e0","_simplify","_clipInfinite","_clipFinite","e1","sx0","sx1","sy1","_edgecode","_edge","vx0","vy0","vxn","vyn","pointX","pointY","jitter","Delaunay","flatArray","flatIterable","_delaunator","_hullIndex","hullIndex","voronoi","dc","renderHull","renderPoints","hullPolygon","renderTriangle","trianglePolygon","defaultExtent","toPathString","cloudRadians","cloudSprite","contextAndRatio","di","sprite","w32","maxh","wcr","wsr","hcr","hsr","xoff","yoff","hasText","pixels","seenRow","cloudCollide","board","msx","cloudBounds","collideRects","archimedeanSpiral","functor","spirals","archimedean","rectangular","Wordcloud","spiral","words","cloud","dxdy","startX","startY","maxDelta","zeroArray","tags","fontSizeRange","fsize","sizeScale","array8","array16","array32","Dimension","query","onAdd","added","dim","SortedIndex","addi","oldv","oldi","addv","index0","value1","index1","reindex","CrossFilter","lengthen","_index","Bitmaps","_indices","ResolveFilter","reinit","eval","remMap","modMap","indexMap","incrementOne","incrementAll","old","lo1","hi1","lo0","hi0","ignore","pass","ASTNode","TokenBooleanLiteral","TokenEOF","TokenIdentifier","TokenKeyword","TokenNullLiteral","TokenNumericLiteral","TokenPunctuator","TokenStringLiteral","SyntaxArrayExpression","SyntaxBinaryExpression","SyntaxCallExpression","SyntaxConditionalExpression","SyntaxIdentifier","SyntaxLiteral","SyntaxLogicalExpression","SyntaxMemberExpression","SyntaxObjectExpression","SyntaxProperty","SyntaxUnaryExpression","MessageUnexpectedToken","MessageUnexpectedNumber","MessageUnexpectedString","MessageUnexpectedIdentifier","MessageUnexpectedReserved","MessageUnexpectedEOS","MessageInvalidRegExp","MessageUnterminatedRegExp","MessageStrictOctalLiteral","MessageStrictDuplicateProperty","ILLEGAL","DISABLED","RegexNonAsciiIdentifierStart","RegexNonAsciiIdentifierPart","keywords","scanUnicodeCodePointEscape","cu1","cu2","scanIdentifier","finishBinaryExpression","finishCallExpression","finishIdentifier","finishLiteral","finishMemberExpression","member","finishProperty","legalKeywords","finishArrayExpression","finishObjectExpression","search","$0","$1","exception","finishUnaryExpression","finishConditionalExpression","Constants","LN10","LOG2E","LOG10E","MIN_VALUE","Functions","codegen","cast","fncall","STRING","REGEXP","datetime","timezoneoffset","utcdate","utcday","utcyear","utcmonth","utchours","utcminutes","utcseconds","utcmilliseconds","upper","lower","regexp","if","allowed","forbidden","functions","globalvar","fieldvar","outputGlobal","globals","memberDepth","Generators","stripQuotes","phi00","deltaSum","ranges","areaRing","dLambda","sdLambda","adLambda","W0","W1","z0","boundsLineStart","boundsLineEnd","boundsRingPoint","boundsRingStart","boundsRingEnd","inflection","phii","lambdai","rangeCompare","rangeContains","centroidPointCartesian","centroidLinePointFirst","centroidLinePoint","centroidRingPointFirst","centroidRingPoint","cz","Intersect","Union","SelectionId","$selectionId","UNIT_INDEX","testPoint","dval","others","E_union","E_intersect","R_union","R_intersect","selectionVisitor","scope","indexName","dataName","getData","indataRef","tuplesRef","dateObj","setYear","ScalePrefix","SignalPrefix","dataVisitor","scaleVisitor","addScaleDependency","scaleName","scaleRef","getScale","nameOrFunction","maybeScale","geoMethod","methodName","globalMethod","geoArea","geoBounds","deltaMax","geoCentroid","channel_luminance_value","channelValue","luminance","equalArray","equalObject","removePredicate","accessors","treeNodes","_window","markname","functionContext","isDefined","isString","indexof","_len2","_key2","lastindexof","_len3","_key3","repl","_len4","_key4","pluck","contrast","color1","color2","lum1","lum2","monthFormat","monthAbbrevFormat","dayFormat","dayAbbrevFormat","inScope","pinchDistance","touches","pinchAngle","screen","containerSize","container","clientWidth","clientHeight","windowSize","innerWidth","innerHeight","bandspace","setdata","pathShape","retval","toggle","predicate","_trigger","lassoAppend","lasso","lassoPath","_ref","intersectLasso","pixelLasso","bb","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","testx","testy","intersections","prevX","prevY","pointInPolygon","eventFunctions","thisPrefix","astVisitors","codegenParams","fnctx","visitors","__bandwidth","_bandwidth","_range","ref","internalScaleFunctions","codeGenerator","expressionFunction","signalName","getSignal","signalRef","$expr","$fields","$params","miss","unitIdx","isMulti","vl5","resUnit","resolved","multiRes","acc","Skip","Swap","canonicalType","expressionCodegen","parameter","adjustSpatial","lt","gt","_compare","parseParameter","PARSERS","$ref","$key","$flat","parseParameters","parameterExpression","$field","$name","$encode","enc","encodeExpression","$output","$compare","$order","$tupleid","$subflow","subctx","operators","Context","Subcontext","ariaLabel","subcontext","$ingest","$format","$request","unresolved","signal","operatorExpression","eventExpression","handlerExpression","eventConfig","parseOperator","parseOperatorParameters","parseStream","parseUpdate","srcid","getState","dataset","setState","substate","Default","setCursor","cursor","globalCursor","dataref","_runtime","_viewWidth","_viewHeight","VIEW","NO_TRAP","trap","trackEventListener","_eventListeners","permit","_eventConfig","itemFilter","markTarget","invoke","vega","RadioClass","Event","wrapper","checked","option","valuesEqual","selected","selectedIndex","prepend","initializeRenderer","paddingObject","renderHeadless","_scenegraph","Width","Height","dataTest","signalTest","formatArray","formatTooltip","View","_elBind","_renderType","_renderer","_handler","_globalCursor","_preventDefault","_timers","_resizeListeners","unpack","initializeEventConfig","runtime","_bind","bindings","_resize","resetSize","_resizeWidth","_resizeHeight","resizePadding","initializeResize","_background","user","hover","lookupSignal","findOperatorHandler","addOperatorListener","removeOperatorListener","_desc","_resetRenderer","rerun","addResizeListener","removeResizeListener","addSignalListener","removeSignalListener","addDataListener","removeDataListener","_restart","elapsed","timestamp","prevent","allow","itemGroup","extension","eventExtend","timers","listeners","hoverSet","leaveSet","elBind","initializeAria","prevHandler","initializeHandler","binding","mime","blob","Blob","URL","createObjectURL","toBlobURL","toSVG","LBRACK","RBRACK","LBRACE","RBRACE","COLON","COMMA","NAME","GT","DEFAULT_MARKS","DEFAULT_SOURCE","MARKS","eventSelector","parseMerge","parseSelector","endChar","pushChar","popChar","parseBetween","parseThrottle","parseAutosize","parsePadding","encoder","addEncode","addEncoders","extendEncode","MarkRole","AxisDomainRole","AxisGridRole","AxisLabelRole","AxisTickRole","AxisTitleRole","LegendBandRole","LegendEntryRole","LegendGradientRole","LegendLabelRole","LegendSymbolRole","LegendTitleRole","TitleTextRole","TitleSubtitleRole","applyDefault","entry$1","_color","resolveField","parseEncode","applyDefaults","parse$1","OUTER","OUTER_INVALID","outerError","parseSignal","addSignal","addBinding","Entry","refs","fieldRef$1","keyFieldRef","compareRef","aggrField","Scope$1","isSignal","hasSignal","specValue","deref","mergeStream","nestedStream","eventStream","streamParameters","addStream","markrole","filterMark","OP_VALUE_EXPR","mergeSources","FIELD_REF_ID","MULTIDOMAIN_SORT_OPS","parseScale","parseScaleDomain","parseScaleRange","parseLiteral","parseScaleInterpolate","parseScaleNice","parseArray","objectProperty","parseScaleBins","dataLookupError","explicitDomain","multipleDomain","singularDomain","valuesRef","parseSort","domainRef","extentRef","coll","addDataPipeline","fieldRef","ordinalMultipleDomain","quantileMultipleDomain","numericMultipleDomain","countsRef","sortRef","multidomain","parseParameter$1","Vertical","Index","Offset","Perc","Perc2","Value","GuideLabelStyle","GuideTitleStyle","GroupTitleStyle","GroupSubtitleStyle","Size","LegendScales","GroupMark","RectMark","RuleMark","SymbolMark","TextMark","guideGroup","isVertical","symbolDirection","gradientDirection","gradientLength","gradientWidth","gradientThickness","gradientHeight","entryColumns","getEncoding","anchorExpr","alignExpr$1","extendOffset","guideMark","extras","legendGradient","userEncode","thickness","legendGradientDiscrete","dataRef","vv","alignExpr","baselineExpr","legendGradientLabels","overlap","labelLimit","gradientLabelLimit","labelOffset","gradientLabelOffset","legendSymbolGroups","symbolOffset","valueRef","xSignal","yEncode","baseFill","baseStroke","symbolBaseFillColor","symbolBaseStrokeColor","facet","isL","isR","isLR","isVG","exprAlign","exprAnchor","exprAngle","exprBaseline","getRole","parseTransform","pdef","lookupRef","parseIndexParameter","parseSubParameter","parseSubParameters","projectionRef","parameterValue","isExpr","isField","isCompare","outerExpr","exprRef","outerField","isData","getDataRef","DataScope","aggregate","fieldKey","addSortField","ds","optype","sortKey","parseTrigger","trigger","parseMark","layoutRef","boundRef","keyRef","parseData$1","joinRef","$context","markpath","markRef","generates","encodeRef","pushState","subscope","addData","toRuntime","parseFacet","parseSubflow","popState","tol","parseOverlap","sieve","buildLegendEncode","getChannel","fromEntries","angleExpr","groupEncode","getSign","ifLeftTopExpr","ifX","ifXEnc","ifY","ifYEnc","ifTop","ifTopExpr","ifRight","ifRightExpr","$orient","ifEnc","ifExpr","isSimple","toExpr","ifOrient","fallback","axisConfig","styleProp","flushExpr","parseAxis","or","scaleType","axisBand","xyKeys","axisX","axisY","orientKeys","axisTop","axisBottom","axisLeft","axisRight","axisEncode","tickBand","ticksRef","tickMinStep","vscale","gridScale","tickPos","gridStart","gridEnd","axisGrid","tickSize","axisTicks","flushOffset","labelAlign","labelBaseline","flushOn","offsetExpr","axisLabels","pos0","pos1","axisDomain","titlePos","autoY","autoX","autoLayout","axisTitle","buildAxisEncode","parseScope","preprocessed","addProjection","parseProjection","addScale","initScale","upstream","analyze","parseData","isSubscope","addUpdate","streamSource","parseSignalUpdates","axes","legendEncode","entryLayout","scaleCount","legendType","entryRef","legendSymbolLayout","getStyle","getFontSize","sizeExpression","_anchor","legendTitle","parseLegend","buildTitle","titleEncode","buildSubTitle","parseTitle","parseLambdas","rootEncode","signalObject","Scope","lambdas","_id","_subid","_nextsub","_parent","_encode","_lookup","_markpath","Subscope","propertyLambda","arrayLambda","objectLambda","defaultFont","defaultColor","lightGray","square","subtitlePadding","bandPosition","domainWidth","domainColor","gridWidth","gridColor","labelAngle","labelPadding","tickColor","tickOffset","tickRound","tickWidth","gridAlign","columnPadding","rowPadding","gradientStrokeColor","gradientStrokeWidth","labelOverlap","symbolLimit","symbolType","symbolSize","symbolStrokeWidth","titleLimit","titleOrient","category","heatmap","ramp","collectSignals","parseView","vref","annotate","isExpr$1","sig","hasOwnSignal","addScaleProj","projectionType","dataScope","Ops","Unary","ms","EventFunctions","DisallowedMethods","setImmediate","Visitors","interpret","flatMap","isLogicalOr","isLogicalAnd","and","isLogicalNot","not","forEachLeaf","subop","normalizeLogicalComposition","normalizer","deepEqual","duplicate","omit","isNullOrFalse","mergeDeep","dest","deepMerge_","unique","isEqual","dictKeys","otherKeys","setEqual","hasIntersection","prefixGenerator","wrappedWithAccessors","computedPrefixes","fieldIntersection","isEmpty","varName","alphanumericS","logicalExpr","deleteNestedProperty","orderedProps","titleCase","accessPathWithDatum","pieces","flatAccessWithDatum","escapePathAccess","replacePathInField","replaceAll","replacement","removePathFromField","accessPathDepth","getFirstDefined","idCounter","uniqueId","resetIdCounter","internalField","isInternalField","normalizeAngle","isNumeric","CONDITIONAL_AXIS_PROP_INDEX","part","vgProp","labelColor","labelFont","labelFontSize","labelFontStyle","labelFontWeight","labelOpacity","gridDash","gridDashOffset","gridOpacity","tickDash","tickDashOffset","tickOpacity","isConditionalAxisValue","AXIS_PARTS","AXIS_PROPERTY_TYPE","gridCap","domainCap","domainDash","domainDashOffset","domainOpacity","labelBound","labelFlush","labelFlushOffset","labelLineHeight","labelSeparation","tickCap","titleAlign","titleAngle","titleBaseline","titleColor","titleFont","titleFontSize","titleFontStyle","titleFontWeight","titleLineHeight","titleOpacity","titleX","titleY","tickExtra","COMMON_AXIS_PROPERTIES_INDEX","AXIS_PROPERTIES_INDEX","labelExpr","encoding","isAxisProperty","AXIS_CONFIGS","axisDiscrete","axisPoint","axisQuantitative","axisTemporal","axisXBand","axisXDiscrete","axisXPoint","axisXQuantitative","axisXTemporal","axisYBand","axisYDiscrete","axisYPoint","axisYQuantitative","axisYTemporal","AGGREGATE_OP_INDEX","MULTIDOMAIN_SORT_OP_INDEX","isArgminDef","isArgmaxDef","isAggregateOp","COUNTING_OPS","isCountingAggregateOp","SUM_OPS","SHARED_DOMAIN_OP_INDEX","__rest","propertyIsEnumerable","ROW","COLUMN","FACET","RADIUS","RADIUS2","THETA","THETA2","LATITUDE","LONGITUDE","LATITUDE2","LONGITUDE2","COLOR","FILL","STROKE","SHAPE","ANGLE","OPACITY","FILLOPACITY","STROKEOPACITY","STROKEWIDTH","STROKEDASH","TEXT","ORDER","DETAIL","KEY","TOOLTIP","HREF","DESCRIPTION","POLAR_POSITION_CHANNEL_INDEX","radius2","isPolarPositionChannel","GEO_POSIITON_CHANNEL_INDEX","longitude2","latitude","latitude2","GEOPOSITION_CHANNELS","UNIT_CHANNEL_INDEX","detail","isColorChannel","channel","FACET_CHANNEL_INDEX","FACET_CHANNELS","CHANNEL_INDEX","CHANNELS","_o","_d","_tt1","SINGLE_DEF_CHANNEL_INDEX","_r","_c","_f","SINGLE_DEF_UNIT_CHANNEL_INDEX","isChannel","SECONDARY_RANGE_CHANNEL","isSecondaryRangeChannel","getMainRangeChannel","getVgPositionChannel","getSecondaryRangeChannel","getSizeChannel","_latitude","_longitude","_latitude2","_longitude2","_theta","_theta2","_radius2","NONPOSITION_CHANNEL_INDEX","NONPOSITION_CHANNELS","POSITION_SCALE_CHANNEL_INDEX","POSITION_SCALE_CHANNELS","isXorY","POLAR_POSITION_SCALE_CHANNEL_INDEX","POLAR_POSITION_SCALE_CHANNELS","getPositionScaleChannel","sizeType","_tt","_hr","_u","_al","_dd","_oo","NONPOSITION_SCALE_CHANNEL_INDEX","NONPOSITION_SCALE_CHANNELS","SCALE_CHANNEL_INDEX","SCALE_CHANNELS","isScaleChannel","ALL_MARKS","bar","geoshape","_g","ALL_MARKS_EXCEPT_GEOSHAPE","rangeType","binToString","normalizeBin","isSelectionExtent","isBinning","isBinParams","binned","isBinned","autoMaxBins","invalidSpec","FIT_NON_SINGLE","containerSizeNonSingle","containerSizeNotCompatibleWithAutosize","droppingFit","unknownField","cannotProjectOnChannelWithoutField","cannotProjectAggregate","selectionNotSupported","columnsNotSupportByRowCol","differentParse","local","customFormatTypeNotAllowed","invalidFieldType","droppingColor","emptyFieldDef","fieldDef","incompatibleChannel","markOrFacet","when","facetChannelShouldBeDiscrete","discreteChannelCannotEncode","unaggregateDomainHasNoEffectForRawField","unaggregateDomainWithNonSharedDomainOp","unaggregatedDomainWithLogScale","scalePropertyNotWorkWithScaleType","propName","stepDropped","MORE_THAN_ONE_SORT","invalidTimeUnit","unitName","errorBand1DNotSupport","channelRequiredForBinned","main","isDateTime","TIMEUNIT_PARTS","MONTHS","SHORT_MONTHS","DAYS","SHORT_DAYS","dateTimeParts","lowerM","monthIndex","shortM","shortMonthIndex","normalizeMonth","normalizeQuarter","lowerD","dayIndex","shortD","shortDayIndex","normalizeDay","timeUnit","dateTimeToExpr","LOCAL_SINGLE_TIMEUNIT_INDEX","isUTCTimeUnit","VEGALITE_TIMEFORMAT","getTimeUnitParts","containsTimeUnit","fullTimeUnit","timeUnitSpecifierExpression","timeUnitParts","normalizeTimeUnit","getLocalTimeUnit","isVgRangeStep","isDataRefDomain","VG_MARK_CONFIGS","VG_MARK_INDEX","VG_CORNERRADIUS_CHANNELS","isFieldEqualPredicate","isFieldLTPredicate","isFieldLTEPredicate","lte","isFieldGTPredicate","isFieldGTEPredicate","gte","isFieldRangePredicate","isFieldOneOfPredicate","oneOf","in","isFieldPredicate","predicateValueExpr","valueExpr","wrapTime","fieldFilterExpression","useInRange","_a","fieldExpr","lastTimeUnit","dateExpr","dateTimeExprToExpr","vgField","predicateValuesExpr","isFieldValidPredicate","fieldValidPredicate","exprs","normalizePredicate","Type","quantitative","temporal","nominal","QUANTITATIVE","ORDINAL","TEMPORAL","NOMINAL","GEOJSON","ScaleType","LINEAR","LOG","POW","SQRT","SYMLOG","IDENTITY","SEQUENTIAL","TIME","QUANTILE","QUANTIZE","THRESHOLD","BIN_ORDINAL","POINT","BAND","SCALE_CATEGORY_INDEX","scaleCompatible","scaleType1","scaleType2","scaleCategory1","scaleCategory2","SCALE_PRECEDENCE_INDEX","scaleTypePrecedence","CONTINUOUS_TO_CONTINUOUS_SCALES","CONTINUOUS_TO_CONTINUOUS_INDEX","QUANTITATIVE_SCALES_INDEX","CONTINUOUS_TO_DISCRETE_INDEX","CONTINUOUS_DOMAIN_INDEX","DISCRETE_DOMAIN_INDEX","hasDiscreteDomain","hasContinuousDomain","isContinuousToContinuous","isContinuousToDiscrete","isSelectionDomain","SCALE_PROPERTY_INDEX","rangeMax","rangeMin","NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTY_INDEX","NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES","scaleTypeSupportProperty","channelScalePropertyIncompatability","isExprRef","replaceExprRefInIndex","newIndex","signalRefOrValue","ARC","AREA","BAR","IMAGE","LINE","RECT","RULE","TICK","TRAIL","CIRCLE","SQUARE","GEOSHAPE","isPathMark","isRectBasedMark","PRIMITIVE_MARKS","isMarkDef","FILL_STROKE_CONFIG","VL_ONLY_MARK_CONFIG_PROPERTIES","invalid","timeUnitBand","timeUnitBandPosition","MARK_CONFIGS","BAR_CORNER_RADIUS_INDEX","midPointRefWithPositionInvalidTest","channelDef","markDef","midPoint","isFieldDef","wrapPositionInvalidTest","getMarkPropOrConfig","fieldInvalidTestValueRef","fieldInvalidPredicate","zeroValueRef","valueRefForFieldOrDatumDef","isDatumDef","interpolatedSignalRef","fieldOrDatumDef","fieldOrDatumDef2","startSuffix","channel2Def","defaultRef","isFieldOrDatumDef","isTypedFieldDef","getBand","fieldDef2","isMidPoint","binSuffix","binRequiresRange","isValueDef","offsetMixins","widthHeightValueOrSignalRef","signalOrValueRef","isCustomFormatType","customFormatExpr","BIN_RANGE_DELIMITER","formatSignalRef","normalizeStack","_b","formatCustomType","fieldToFormat","isFieldOrDatumDefForTimeFormat","rawTimeFormat","isUTCScale","formatExpression","timeFormatExpression","isScaleFieldDef","channelDefType","binFormatExpression","formatExpr","datumDef","datumDefToExpr","guideFormat","omitTimeFormatConfig","specifiedFormat","guideFormatType","binNumberFormatExpr","startField","endField","DEFAULT_SORT_OP","SORT_BY_CHANNEL_INDEX","isSortByChannel","isSortByEncoding","isSortField","isSortArray","isFacetMapping","isFacetFieldDef","isFacetSpec","toFieldDefBase","isSortableFieldDef","getMarkConfig","fieldChannel","hasBand","isConditionalDef","hasConditionalFieldDef","hasConditionalFieldOrDatumDef","isContinuousFieldOrDatumDef","isNumericDataDef","isPositionFieldOrDatumDef","isMarkPropFieldOrDatumDef","isStringFieldOrDatumDef","toStringFieldDef","argAccessor","isCount","nofn","isOpFieldDef","tu","timeUnitToString","forAs","defaultTitleFormatter","fieldTitle","timeUnitParams","functionalTitleFormatter","countTitle","verbalTitleFormatter","titleFormatter","setTitleFormatter","formatter","allowDisabling","includeDefault","guideTitle","getGuide","defaultTitle","getFormatMixins","guide","getFieldDef","getFieldOrDatumDef","initChannelDef","initFieldOrDatumDef","fd","customFormatTypes","guideType","newGuide","initFieldDef","initDatumDef","compositeMark","fullType","getFullName","newType","defaultType","compatible","warning","COMPATIBLE","channelCompatibility","sub","labelOrient","isTimeFieldDef","undefinedIfExprNotRequired","isTime","isLocalSingleTimeUnit","valueArray","extractTitleConfig","titleConfig","subtitleColor","subtitleFont","subtitleFontSize","subtitleFontStyle","subtitleFontWeight","subtitleLineHeight","titleMarkConfig","nonMark","subtitleMarkConfig","isText","signalOrValueRefWithCondition","conditionalSignalRefOrValue","exprFromValueOrSignalRef","signalOrStringValue","getStyles","vgChannel","ignoreVgConfig","getMarkStyleConfig","styleConfigIndex","getStyleConfig","styles","styleConfig","sortParams","orderDef","fieldRefOption","orderChannelDef","mergeTitleFieldDefs","f1","f2","fdToMerge","fieldDef1","mergeTitle","title1","title2","mergeTitleComponent","v1Val","v2Val","explicit","isUnitSpec","CompositeMarkNormalizer","hasMatchingType","getMarkType","channelHasField","isAggregate","extractTransformsFromEncoding","oldEncoding","aggOp","isTitleDefined","newField","newFieldDef","aggregateEntry","secondaryChannel","isNonPositionScaleChannel","initEncoding","normalizedEncoding","markSupported","getSupportedMark","supportMark","primaryFieldDef","markChannelCompatible","normalizeEncoding","newChannelDef","mapping","pathGroupingFields","details","getCompositeMarkTooltip","tooltipSummary","continuousAxisChannelDef","encodingWithoutContinuousAxis","withFieldName","fiveSummaryTooltip","fieldPrefix","titlePrefix","mainTitle","getTitle","escape","tooltipFieldDefs","channelDefArray","fieldDefs","makeCompositeAggregatePartFactory","compositeMarkDef","continuousAxis","sharedEncoding","compositeMarkConfig","partName","positionPrefix","endPositionPrefix","extraEncoding","partLayerMixins","partBaseSpec","compositeMarkContinuousAxis","continuousAxisChannelDef2","continuousAxisChannelDefError","continuousAxisChannelDefError2","filterAggregateFromChannelDef","continuousAxisWithoutAggregate","compositeMarkOrient","xAggregate","yAggregate","BOXPLOT","boxPlotNormalizer","normalizeBoxPlot","getBoxPlotType","_encoding","selection","_p","outerSpec","boxplot","sizeValue","boxPlotType","ticksOrient","boxOrient","customTooltipWithoutAggregatedField","continuousFieldName","boxplotSpecificAggregate","boxParamsQuartiles","postAggregateCalculates","calculate","oldEncodingWithoutContinuousAxis","filteredEncoding","customTooltipWithAggregatedField","filterTooltipWithAggregatedField","boxParams","encodingWithoutSizeColorAndContinuousAxis","makeBoxPlotPart","makeBoxPlotExtent","makeBoxPlotBox","makeBoxPlotMidTick","fiveSummaryTooltipEncoding","endTick","whiskerTooltipEncoding","whiskerLayers","boxLayers","layer","lowerBoxExpr","upperBoxExpr","iqrExpr","lowerWhiskerExpr","upperWhiskerExpr","joinaggregateTransform","joinaggregate","filteredWhiskerSpec","encodingWithoutSizeColorContinuousAxisAndTooltip","axisWithoutTitle","outlierLayersMixins","filteredLayersMixins","filteredLayersMixinsTransforms","continousAxisField","ERRORBAR","errorBarNormalizer","normalizeErrorBar","tooltipEncoding","errorBarParams","makeErrorBarPart","errorbar","inputType","xError","xError2","yError","yError2","errorBarIsInputTypeRaw","isTypeAggregatedUpperLower","errorBarIsInputTypeAggregatedUpperLower","isTypeAggregatedError","errorBarIsInputTypeAggregatedError","errorBarOrientAndInputType","errorBarSpecificAggregate","tooltipTitleWithFieldName","getTitlePrefix","centerOp","lowerExtentOp","upperExtentOp","postAggregateCalculate","errorBarAggregationAndCalculation","_e","oldAggregate","oldGroupBy","ERRORBAND","errorBandNormalizer","normalizeErrorBand","errorBandDef","makeErrorBandPart","errorband","is2D","bandMark","bordersMark","compositeMarkRegistry","VL_ONLY_LEGEND_CONFIG","HEADER_TITLE_PROPERTIES_MAP","HEADER_LABEL_PROPERTIES_MAP","labelAnchor","HEADER_TITLE_PROPERTIES","HEADER_LABEL_PROPERTIES","HEADER_CONFIGS","headerRow","headerColumn","headerFacet","LEGEND_SCALE_CHANNELS","COMMON_LEGEND_PROPERTY_INDEX","clipHeight","fillColor","gradientOpacity","legendX","legendY","strokeColor","symbolDash","symbolDashOffset","symbolFillColor","symbolOpacity","symbolStrokeColor","assembleParameterSignals","SELECTION_ID","defaultConfig","single","multi","encodings","isLegendBinding","isLegendStreamBinding","isConcatSpec","isVConcatSpec","isHConcatSpec","isStep","isFrameMixins","COMPOSITION_LAYOUT_PROPERTIES","spacing","getViewConfigContinuousSize","viewConfig","getViewConfigDiscreteStep","getViewConfigDiscreteSize","DEFAULT_STEP","continuousWidth","continuousHeight","binSpacing","continuousBandSize","outliers","borders","pointPadding","barBandPaddingInner","rectBandPaddingInner","minBandSize","minFontSize","maxFontSize","minOpacity","maxOpacity","minSize","minStrokeWidth","maxStrokeWidth","quantileCount","quantizeCount","gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity","tab10","DEFAULT_FONT_SIZE","guideLabel","groupTitle","groupSubtitle","DEFAULT_COLOR","gray0","gray1","gray2","gray3","gray4","gray5","gray6","gray7","gray8","gray9","gray10","gray11","gray12","gray13","gray14","gray15","getAxisConfigInternal","axisConfigInternal","configPropsWithExpr","initConfig","specifiedConfig","restConfig","mergedConfig","fontConfig","colorSignalConfig","fontSizeSignalConfig","outputConfig","markConfigType","axisConfigType","headerConfigType","styleConfigInternal","getStyleConfigInternal","MARK_STYLES","VL_ONLY_CONFIG_PROPERTIES","VL_ONLY_ALL_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX","redirectConfigToStyleConfig","toProp","compositeMarkPart","propConfig","isLayerSpec","SpecMapper","mapFacet","isRepeatSpec","mapRepeat","mapHConcat","mapVConcat","mapConcat","mapLayerOrUnit","mapLayer","mapUnit","subspec","hconcat","vconcat","STACK_OFFSET_INDEX","STACKABLE_MARKS","STACK_BY_DEFAULT_MARKS","potentialStackedChannel","xDef","yDef","xScale","yScale","stackedFieldDef","stackedField","dimensionChannel","getDimensionChannel","dimensionDef","dimensionField","stackBy","cDef","disallowNonLinearStack","groupbyChannel","groupbyField","dropLineAndPoint","dropLineAndPointFromConfig","getPointOverlay","markConfig","getLineOverlay","PathOverlayNormalizer","pointOverlay","lineOverlay","stackProps","overlayEncoding","stackFieldChannel","RangeStepNormalizer","sizeMixins","defWithoutScale","scaleWithoutRangeStep","replaceRepeaterInFacet","repeater","replaceRepeaterInMapping","replaceRepeaterInFieldDef","replaceRepeaterInEncoding","replaceRepeatInProp","isRepeatRef","replaceRepeaterInFieldOrDatumDef","replaceRepeaterInChannelDef","RuleForRangedLineNormalizer","mainChannelDef","hasX2","hasY2","mergeEncoding","parentEncoding","parentChannelDef","mergedChannelDef","mergeProjection","parentProjection","normalizedSpec","normalizeGenericSpec","sizeInfo","isFitCompatible","autosizeDefault","_normalizeAutoSize","normalizeAutoSize","nonFacetUnitNormalizers","hasRow","hasColumn","hasFacet","mapFacetedUnit","specWithReplacedEncoding","mapUnitWithParentEncodingOrProjection","normalizeLayerOrUnit","unitNormalizer","isLayerRepeatSpec","mapLayerRepeat","mapNonLayerRepeat","childSpec","repeaterPrefix","layerValue","childRepeater","childName","remainingProperties","repeatValues","repeatValue","rowValue","columnValue","mergedProjection","mergedEncoding","facetMapping","getFacetMappingAndLayout","newEncoding","facets","defWithoutLayout","otherParams","TOP_LEVEL_PROPERTIES","extractTopLevelProperties","includeParams","Split","combine","getWithExplicit","setWithExplicit","copyKeyFromSplit","copyKeyFromObject","copyAll","makeExplicit","makeImplicit","tieBreakByComparing","propertyOf","diff","defaultTieBreaker","mergeValuesWithExplicit","tieBreaker","AncestorParse","parseNothing","isUrlData","isInlineData","isNamedData","isGenerator","isSequenceGenerator","isSphereGenerator","isGraticuleGenerator","DataSourceType","isFilter","isImputeSequence","isLookup","isPivot","isDensity","isRegression","isLoess","isSample","isWindow","isJoinAggregate","isFlatten","isCalculate","isBin","isImpute","isTimeUnit","isStack","isFold","wrapCondition","refFn","vgConditions","conditionValueRef","isConditionalSelection","parseSelectionPredicate","textRef","tooltipRefForEncoding","reactiveGeom","tooltipRefFromChannelDef","markTooltip","tooltipData","toSkip","fDef","mainChannel","channel2","keyValues","nonPosition","getScaleComponent","markType","transparentIfNeeded","defaultFill","defaultStroke","colorVgChannel","fillStrokeMarkDefAndConfig","getOffset","offsetChannel","getOffsetChannel","markDefOffsetValue","pointPosition","defaultPos","pointPositionDefaultRef","getName","positionRef","definedValueOrConfig","domainDefinitelyIncludesZero","sizeRef","ALIGNED_X_CHANNEL","BASELINED_Y_CHANNEL","middle","vgAlignedPositionChannel","defaultAlign","alignChannel","alignExcludingSignal","pointOrRangePosition","defaultPos2","rangePosition","sizeChannel","pos2Mixins","baseChannel","position2Ref","position2orSize","pointPosition2OrSize","rectPosition","channelDef2","hasSizeDef","isBarBand","component","axisTranslate","vgChannel2","rectBinRef","getBinSpacing","startRef","rectBinPosition","vgSizeChannel","useVlSizeChannel","sizeFromMarkOrConfig","defaultSizeRef","posRef","sizeOffset","positionAndSize","discreteBandSize","scaleRange","spacingOffset","reverseExpr","translateExpr","ALWAYS_IGNORE","baseEncodeEntry","markDefProperties","wrapAllFieldsInvalid","enableAria","ariaRoleDesc","descriptionValue","filterIndex","aggregator","scaleComponent","allFieldsInvalidPredicate","valueIfDefined","VORONOI","nearest","selCmpt","hasChannel","cellDef","isVoronoi","getSizeSignalRef","exists","DataFlowNode","debugName","_children","addChild","numChildren","oldChild","insertAsParentOf","swapWithParent","newParent","OutputNode","refCounts","_source","_name","cloneObj","dependentFields","producedFields","_hash","getSource","isRequired","setSource","TimeUnitNode","formula","reduceFieldDef","timeUnitComponent","isUnitModel","normalizedTimeUnit","removeFormulas","newFormula","assemble","TUPLE_FIELDS","SelectionProjectionComponent","hasField","selDef","sg","cfg","parseInit","allSignals","hasLegend","inputBindings","origDef","topLevelSignals","sgname","assembleInit","TUPLE","TOGGLE","modifyExpr","tpl","findIndex","addClear","vIdx","visual","tIdx","scaleBindings","isTopLevelLayer","namedSg","VL_SELECTION_RESOLVE","isLayerModel","legendBindings","projLen","legendFilter","selName","markName","sgName","ANCHOR","DELTA","hasScales","onDelta","sizeSg","scaleCmpt","compilers","forEachTransform","assembled","dateTimeToTimestamp","assembleUnitSelectionMarks","forEachSelection","selCompiler","txCompiler","cleanupEmptyOnArray","BRUSH","SCALE_TRIGGER","fieldsSg","dataSignals","scaleTriggers","filterExpr","cs","vname","scaled","coord","channelSignals","toNum","xvname","yvname","STORE","vgStroke","singleOrMultiSignals","selections","sel","facetModel","isFacetModel","getFacetModel","requiresSelectionId","startsWithDatum","getDependentFields","dependents","FilterNode","_dependentFields","dfnode","stores","predicateStr","getSelectionComponent","tunode","parseSelectionBinExtent","filterOp","isSelectionPredicate","setAxisEncode","vgRef","assembleAxis","axisCmpt","disable","propType","propValue","valueOrSignalRef","conditions","propIndex","valueOrSignalCRef","mainExtracted","hasAxisPart","titleString","assembleTitle","assembleAxisSignals","getAxisConfigFromConfigTypes","configTypes","configType","orient1","orientConfig1","orientConfig2","conditionalOrientAxisConfig","getAxisConfigStyle","axisConfigTypes","toMerge","getAxisConfig","axisConfigs","configFrom","configValue","axisRules","defaultGrid","gridChannel","defaultLabelAlign","defaultLabelBaseline","defaultLabelFlush","hasTimeUnit","defaultLabelOverlap","defaultTickCount","fieldDefTitle","getFieldDefTitle","typedFieldDef","defaultZindex","normalizeAngleExpr","alwaysIncludeMiddle","mainOrient","CalculateNode","forEachFieldDef","sortValue","sortArrayIndexField","getHeaderChannel","getHeaderProperty","headerSpecificConfig","getHeaderProperties","HEADER_CHANNELS","HEADER_TYPES","assembleTitleGroup","facetFieldDef","headerChannel","defaultHeaderGuideBaseline","defaultHeaderGuideAlign","assembleHeaderProperties","assembleHeaderGroups","layoutHeader","headerType","headerComponent","assembleHeaderGroup","getSort","assembleLabelTitle","titleTextExpr","isFacetWithoutRowCol","hasAxes","sizeSignal","LAYOUT_TITLE_BAND","getLayoutTitleBand","propertiesMap","assembleLayoutSignals","sizeSignals","layoutSize","stepSignal","sizeExpr","isWidth","safeExpr","cardinality","getSizeTypeFromLayoutSizeType","layoutSizeType","guideEncodeEntry","valueDef","defaultScaleResolve","isConcatModel","parseGuideResolve","channelScaleResolve","LEGEND_COMPONENT_PROPERTY_INDEX","LEGEND_COMPONENT_PROPERTIES","LegendComponent","legendEncodeRules","symbolsSpec","legendCmpt","_h","propsList","applyMarkConfig","getMaxValue","getFirstConditionValue","selectedCondition","gradientSpec","specifiedlabelsSpec","labelsSpec","entriesSpec","getConditionValue","conditionalDef","reducer","hasConditionalValueDef","legendRules","legendConfig","gradientLengthSignal","defaultGradientLength","shapeChannelDef","markShape","defaultSymbolType","getDirection","defaultDirection","legendComponent","parseLegendForChannel","parseUnitLegend","mergeLegendComponent","parseNonUnitLegend","isExplicit","getLegendDefWithScale","legendSelections","parseInteractiveLegend","getLegendType","ruleParams","legendEncoding","legendEncodeParams","legendEncodingPart","mergedLegend","childLegend","mergedOrient","childOrient","typeMerged","mergedValueWithExplicit","st1","st2","assembleLegends","legendComponentIndex","legendByDomain","domainHash","mergedLegendComponent","setLegendEncode","assembleLegend","assembleProjectionForModel","fits","lookupDataSource","PROJECTION_PROPERTIES","ProjectionComponent","specifiedProjection","isFit","hasProjection","posssiblePair","requestDataName","Main","gatherFitData","projectionName","parseUnitProjection","nonUnitProjection","mergable","allPropertiesShared","mergeIfNoConflict","modelProjection","renameProjection","parseNonUnitProjections","binKey","getBinSignalName","createBinComponent","isBinTransform","normalizedBin","extentSignal","getSignalsFromModel","binComponent","BinNode","binComponentIndex","formulaAs","rangeFormula","renameSignal","binAs","remainingAs","binTrans","AggregateNode","dimensions","groupBy","meas","argField","scaleDomain","posChannel","getPositionChannelFromLatLong","addDimension","parentMeasures","childMeasures","mergeMeasures","addDimensions","alias","FacetNode","sortField","sortIndexField","childModel","depFields","getChildIndependentFieldsWithStep","childIndependentFieldsWithStep","childScaleComponent","getFieldFromDomain","assembleDomain","assembleRowColumnHeaderData","crossedDataName","childChannel","assembleFacetHeaderData","hasSharedAxis","facetData","unquote","getImplicitFromFilterTransform","ParseNode","_parse","ancestorParse","makeWithAncestors","parsedAs","assembleFormatParse","formatParse","assembleTransforms","onlyNested","IdentifierNode","GraticuleNode","SequenceNode","SourceNode","_data","defaultExtension","_generator","hasName","_modified","receiver","privateMap","isDataSourceNode","Optimizer","setModified","modifiedFlag","BottomUpOptimizer","getNodeDepths","depths","optimize","topologicalSort","TopDownOptimizer","MergeIdenticalNodes","mergeNodes","mergedNode","hashes","buckets","RemoveUnnecessaryIdentifierNodes","RemoveDuplicateTimeUnits","timeUnitFields","RemoveUnnecessaryOutputNodes","MoveParseUp","MergeParse","originalChildren","parseChildren","commonParse","conflictingParse","parseNode","mergedParseNode","childNode","RemoveUnusedSubtrees","MergeTimeUnits","timeUnitChildren","combination","MergeAggregates","aggChildren","groupedAggregates","groupBys","mergeableAggs","mergedAggs","MergeBins","moveBinsUp","promotableBins","remainingBins","promotedBin","remainingBin","MergeOutputs","otherChildren","mainOutput","lastOutput","theChild","JoinAggregateTransformNode","getDefaultName","joinAggregateFieldDef","StackNode","_stack","stackTransform","sortFields","sortOrder","normalizedAs","isValidAsArray","stackField","facetby","stackProperties","dimensionFieldDef","stackby","_field","getStackByFields","getGroupbyFields","WindowTransformNode","windowFieldDef","moveFacetDown","facetMain","moveMainDownToFacet","cloner","newName","FACET_SCALE_PREFIX","outputNodes","MAX_OPTIMIZATION_RUNS","checkLinks","runOptimizer","optimizer","optimizationDataflowHelper","dataComponent","firstPass","roots","SignalRefWrapper","exprGenerator","rename","localScaleComponents","domains","parseDomainForChannel","parseSelectionDomain","isFaceted","facetParent","parseUnitScaleDomain","selectionExtent","childComponent","domainsTieBreaker","se","parseNonUnitScaleDomain","scaleConfig","reason","canUseUnaggregatedDomain","useUnaggregatedDomain","normalizeUnaggregatedDomain","specifiedScales","parseSingleChannelDomain","convertDomainIfItIsDateTime","mapDomainToDataSignal","isDomainUnionWith","defaultDomain","unionWith","stackDimensions","normalizeSortField","fieldDefToSortBy","isStackedMeasure","domainSort","Raw","binSignal","getSignalName","isDataRefUnionedDomain","nonUnionDomain","isFieldRefUnionDomain","uniqueDomains","_s","sorts","unionDomainSorts","allData","mergeDomains","assembleScales","assembleScalesForModel","otherScaleProps","assembleScaleRange","assembleSelectionScaleDomain","ScaleComponent","typeWithExplicit","RANGE_PROPERTIES","getBinStepSignal","updatedName","binCount","parseRangeForChannel","specifiedScale","supportedByScaleType","channelIncompatability","fromName","parseScheme","sizeRangeMin","xyStepSignals","maxBandSize","minXYStep","pointStep","MAX_SIZE_RANGE_STEP_RATIO","sizeRangeMax","rMax","rMin","defaultContinuousToDiscreteCount","defaultRange","isExtendedScheme","widthStep","heightStep","parseScaleProperty","localScaleCmpt","mergedScaleCmpt","specifiedValue","scalePadding","scalePaddingInner","scaleRules","parseUnitScaleProperty","parseNonUnitScaleProperty","barConfig","continuousPadding","paddingValue","bandPaddingInner","paddingInnerValue","bandPaddingOuter","xReverse","specifiedDomain","rangeWithExplicit","parseUnitScaleRange","valueWithExplicit","parseScaleCore","scaleComponents","sType","defaultScaleType","channelSupportScaleType","specifiedType","fieldDefType","parseUnitScaleCore","scaleTypeWithExplicitIndex","explicitScaleType","childScaleType","scaleTypeTieBreaker","childScale","renameScale","parseNonUnitScaleCore","NameMap","nameMap","oldName","Model","parentGivenName","correctDataNames","initTitle","scaleNameMap","projectionNameMap","signalNameMap","specType","compositionConfig","spacingConfig","extractCompositionLayout","outputNodeRefCounts","titleInternal","parseLayoutSize","renameTopLevelLayoutSizeSignal","parseSelections","parseAxesAndHeaders","parseLegends","parseMarkGroup","ignoreRange","parseScales","assembleGroupStyle","assembleEncodeFromView","baseView","assembleGroupEncodeEntry","isTopLevel","encodeEntry","assembleLayout","headerComponentIndex","assembleLayoutTitleBand","assembleDefaultLayout","assembleHeaderMarks","headerMarks","assembleAxes","axisComponents","assembleProjections","assembleProjectionsForModelAndChildren","titleNoEncoding","assembleGroup","assembleSignals","assembleMarks","getDataName","fullName","oldSignalName","originalScaleName","localScaleComponent","variableName","origName","hasAxisOrientSignalRef","hasOrientSignalRef","ModelWithField","getMapping","DensityTransformNode","specifiedAs","FilterInvalidNode","vegaFilters","FlattenTransformNode","FoldTransformNode","fold","GeoJSONNode","geoJsonCounter","pair","GeoPointNode","ImputeNode","processSequence","imputeTransform","imputedChannel","keyChannel","groupbyFields","LoessTransformNode","LookupNode","secondary","fromOutputNode","isLookupData","fromSource","findSource","fromOutputName","isLookupSelection","materialized","foreign","asName","QuantileTransformNode","RegressionTransformNode","regression","PivotTransformNode","pivot","SampleTransformNode","makeWalkTree","datasetIndex","walkTree","dataSource","parseFacetHeader","makeHeaderComponent","mergeChildAxis","axisComponent","mainAxis","parseChildrenLayoutSize","parseNonUnitLayoutSizeForChannel","layoutSizeCmpt","mergedSize","childSize","scaleResolve","defaultUnitSize","facetSortFieldName","FacetModel","buildModel","initFacet","initFacetFieldDef","normalizedFacet","parseFacetHeaders","assembleSelectionTopLevelSignals","assembleSelectionData","getHeaderLayoutMixins","layoutMixins","layoutHeaderComponent","bandType","columnDistinctSignal","getCardinalityAggregateForChild","assembleFacet","facetRoot","outputName","facetSortFields","facetSortOrder","ORTHOGONAL_ORIENT","assembleFacetData","assembleFacetSignals","otherData","formatMesh","otherFeature","formatFeature","otherMesh","existingSource","parseRoot","parentIsLayer","makeFromEncoding","lookupCounter","derivedType","transformNode","makeFromTransform","make","parseTransformArray","implicitSelection","getImplicitFromSelection","implicitEncoding","mainFieldDef","dimensionChannelDef","getImplicitFromEncoding","parseAll","parseAllForSortIndex","rawName","mainName","lookupName","materializeSelections","facetName","makeJoinAggregateFromFacet","ConcatModel","getChildren","widthType","heightType","parseConcatLayoutSize","parseAxisGroup","layoutSignals","AXIS_COMPONENT_PROPERTIES_INDEX","AXIS_COMPONENT_PROPERTIES","AxisComponent","OPPOSITE_ORIENT","mergeAxisComponents","mergedAxisCmpts","childAxisCmpts","mergeAxisComponent","propsToAlwaysIncludeConfig","defaultOrient","typeBasedConfigTypes","axisChannel","axisOrient","vlOnlyConfigTypes","vgConfigTypes","vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle","getAxisConfigs","getLabelAngle","hasValue","hasConfigValue","axisEncoding","axisEncodingPart","specifiedLabelsSpec","fixedShape","shapeMixins","defaultSize","markPropOrConfig","bandSize","markCompiler","vgMark","postEncodingTransform","shapeDef","vgThicknessChannel","FACETED_PATH_PREFIX","STACK_GROUP_PREFIX","getMarkGroup","fromPrefix","scaleClip","projectionClip","unitCount","parentCount","interactiveFlag","UnitModel","parentGivenSize","specifiedAxes","specifiedLegends","filledConfig","defaultFilled","originalMarkDef","specifiedOrient","xIsContinuous","yIsContinuous","xIsTemporal","yIsTemporal","cornerRadiusEnd","newProps","newProp","initMarkdef","initLayoutSize","initScales","initAxes","initLegends","isGeoShapeMark","hasGeoPosition","scaleInternal","_axis","axisSpec","initAxis","axisInternal","_legend","supportLegend","specifiedSize","parseUnitLayoutSize","selDefs","selCmpts","selectionConfig","safeName","parseUnitSelection","getPathGroups","fieldScale","stackFieldGroup","groupUpdate","innerGroupUpdate","groupByField","getGroupsForStackedBarWithCornerRadius","parseMarkGroups","hasSelections","assembleTopLevelSignals","dataCopy","assembleUnitSelectionData","LayerModel","axisCount","oppositeOrient","parseLayerAxes","assembleLayerSelectionMarks","unitSize","isAnyConcatSpec","inputSpec","newLogger","firstPassCounter","secondPassCounter","optimizeDataflow","vgSpec","topLevelProperties","datasets","usermeta","vgConfig","vlOnlyMarkSpecificConfigs","redirectTitleConfig","stripAndRedirectConfig","sourceIndex","newData","whereTo","assembleRootData","otherTopLevelProps","$schema","assembleTopLevelModel","autoSizeType","inverseSizeType","getFitType","getTopLevelProperties","normalized","library","lightColor","medColor","darkTheme","markColor$7","excelTheme","markColor$6","axisColor$2","backgroundColor$2","blackTitle","fiveThirtyEightTheme","markColor$5","ggplot2Theme","labelFont$1","markColor$4","colorSchemes$1","latimesTheme","markColor$3","axisColor$1","quartzTheme","markColor$2","voxTheme","markColor$1","axisColor","colorSchemes","urbanInstituteTheme","markColor","googlechartsTheme","ptToPx","fontSmallPx","legendFontPx","fontLargePx","fontStandard","fontTitle","firstLevelElementColor","secondLevelElementColor","backgroundColor","paletteColor1","divergentColorMin","divergentPalette","powerbiTheme","replacer","EL_ID","DEFAULT_OPTIONS","offsetX","offsetY","styleId","theme","disableDefaultStyle","valueToHtml","elementId","tooltipHandler","createDefaultStyle","classList","fullscreenElement","tooltipBox","calculatePosition","_typeof","_defineProperty","hint","prim","toPrimitive","_toPrimitive","_toPropertyKey","asyncGeneratorStep","_throw","_asyncToGenerator","undefined$1","Op","hasOwn","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","innerFn","outerFn","tryLocsList","protoGenerator","Generator","_invoke","GenStateSuspendedStart","GenStateExecuting","GenStateCompleted","doneResult","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","GenStateSuspendedYield","makeInvokeMethod","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","NativeIteratorPrototype","Gp","defineIteratorMethods","isGeneratorFunction","genFun","displayName","AsyncIterator","PromiseImpl","__await","unwrapped","previousPromise","callInvokeWithMethodAndArg","resultName","nextLoc","pushTryEntry","locs","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","iterable","iteratorMethod","skipTempReset","rootRecord","rval","handle","caught","hasCatch","hasFinally","finallyEntry","thrown","delegateYield","hasRequiredIterator","_regeneratorRuntime","awrap","yallist","Yallist$1","inserted","removeNode","unshiftNode","pushNode","thisp","walker","forEachReverse","getReverse","mapReverse","initial","reduceReverse","toArray","toArrayReverse","sliceReverse","deleteCount","Yallist","_callee","er","MAX","LENGTH","LENGTH_CALCULATOR","ALLOW_STALE","MAX_AGE","DISPOSE","NO_DISPOSE_ON_SET","LRU_LIST","UPDATE_AGE_ON_GET","naiveLength","doUse","isStale","del","maxAge","forEachStep","parseOptions_1","loose","reExports","re$1","SEMVER_SPEC_VERSION","MAX_LENGTH","MAX_SAFE_COMPONENT_LENGTH","debug_1","env","NODE_DEBUG","R","createToken","NUMERICIDENTIFIER","NUMERICIDENTIFIERLOOSE","NONNUMERICIDENTIFIER","PRERELEASEIDENTIFIER","PRERELEASEIDENTIFIERLOOSE","BUILDIDENTIFIER","MAINVERSION","PRERELEASE","BUILD","FULLPLAIN","MAINVERSIONLOOSE","PRERELEASELOOSE","LOOSEPLAIN","XRANGEIDENTIFIER","XRANGEIDENTIFIERLOOSE","GTLT","XRANGEPLAIN","XRANGEPLAINLOOSE","COERCE","LONETILDE","tildeTrimReplace","LONECARET","caretTrimReplace","comparatorTrimReplace","hasRequiredComparator","hasRequiredRange","numeric","identifiers","anum","bnum","parseOptions","compareIdentifiers","semver","SemVer","includePrerelease","LOOSE","FULL","major","minor","prerelease","build","compareMain","comparePre","compareBuild","release","compare_1","compare$5","compare$4","compare$3","compare$2","compare$1","eq","neq","cmp_1","_createForOfIteratorHelper$1","allowArrayLike","it","minLen","_arrayLikeToArray$1","_unsupportedIterableToArray$1","F","normalCompletion","didErr","_e2","return","arr2","Range","requireRange","Comparator","parseRange","isNullSet","_iterator","isAny","comps","memoOpts","memoKey","cached","hr","HYPHENRANGELOOSE","HYPHENRANGE","hyphenReplace","COMPARATORTRIM","rangeList","TILDETRIM","CARETTRIM","comp","parseComparator","replaceGTE0","COMPARATORLOOSE","_step2","rangeMap","comparators","_iterator2","thisComparators","isSatisfiable","rangeComparators","thisComparator","rangeComparator","testSet","stale","dispose","noDisposeOnSet","updateAgeOnGet","mL","allowStale","mA","lengthCalculator","lC","itemCount","rforEach","dump","dumpLru","expiresAt","prune","ANY","COMPARATOR","sameDirectionIncreasing","sameDirectionDecreasing","sameSemVer","differentDirectionsInclusive","oppositeDirectionsLessThan","oppositeDirectionsGreaterThan","requireComparator","remainingComparators","testComparator","otherComparator","replaceCarets","replaceTildes","replaceXRanges","replaceStars","replaceTilde","TILDELOOSE","TILDE","replaceCaret","CARETLOOSE","CARET","replaceXRange","XRANGELOOSE","XRANGE","gtlt","xM","anyX","STAR","GTE0PRE","GTE0","incPr","fM","fm","fp","fpr","fb","tM","tm","tp","tpr","tb","satisfies_1","editor","listen","postMessage","_w$vl","embedStyle","_src","_i2","_Object$keys","_createForOfIteratorHelper","_arrayLikeToArray","_unsupportedIterableToArray","ownKeys","enumerableOnly","_objectSpread","getOwnPropertyDescriptors","_vegaLite","vl","DEFAULT_ACTIONS","export","png","compiled","I18N","CLICK_TO_VIEW_ACTIONS","COMPILED_ACTION","EDITOR_ACTION","PNG_ACTION","SOURCE_ACTION","SVG_ACTION","NAMES","VERSION","PREPROCESSOR","vlSpec","SVG_CIRCLES","CHART_WRAPPER_CLASS","viewSource","sourceHeader","sourceFooter","footer","win","write","guessMode","providedMode","_NAMES$providedMode","createLoader","embedOptionsFromUsermeta","parsedSpec","_embedOptions","_parsedSpec$usermeta","embedOptions","defaultStyle","_embed2","_parsedOpts$config","_usermetaOpts$config","loadedEmbedOptions","usermetaLoader","_opts$loader","usermetaOpts","parsedOpts","mergedOpts","_args","loadOpts","_embed","_loadOpts","_callee2","_opt$config","_context2","t4","t5","getRoot","_document$head","possibleRoot","getRootNode","ShadowRoot","rootContainer","_x6","_embed3","_callee4","_opts$config","_opts$actions","_opts$renderer","_opts$logLevel","_opts$downloadFileNam","_expressionInterprete","actions","i18n","downloadFileName","ID","_getRoot","chartWrapper","_ref2","updateSet","documentClickHandler","ctrl","_loop","viewSourceLink","compileLink","_opts$editorUrl","editorUrl","editorLink","_args5","_context5","Warn","expressionFunctions","viewClass","expressionInterpreter","i18nExportAction","exportLink","_context4","download","_ref3","_callee3","_context3","_x7","_opts$sourceHeader","_opts$sourceFooter","_opts$sourceHeader2","_opts$sourceFooter2","__WEBPACK_EXTERNAL_MODULE__146__","stringOrChar","passedObj","maxLength","_stringify","currentIndent","reserved","keyPart","nextIndent","prettified","stringLiteral","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","__esModule","globalThis"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"labplugin.js","mappings":";0DAAA,IAAIA,EAAQ,WACZ,aAEA,SAASC,EAAYC,EAAKC,GACxB,OAAe,MAARA,GAAgBD,aAAeC,CACxC,CAEA,IAAIC,EASAC,EAOAC,EAfJ,IACEF,EAAYG,GACd,CAAE,MAAMC,GAGNJ,EAAY,WAAY,CAC1B,CAGA,IACEC,EAAYI,GACd,CAAE,MAAMD,GACNH,EAAY,WAAY,CAC1B,CAGA,IACEC,EAAgBI,OAClB,CAAE,MAAMF,GACNF,EAAgB,WAAY,CAC9B,CAuBA,SAASN,EAAMW,EAAQC,EAAUC,EAAOC,EAAWC,GACzB,iBAAbH,IACTC,EAAQD,EAASC,MACjBC,EAAYF,EAASE,UACrBC,EAAuBH,EAASG,qBAChCH,EAAWA,EAASA,UAItB,IAAII,EAAa,GACbC,EAAc,GAEdC,EAA6B,oBAAVC,OA0IvB,YAxIuB,IAAZP,IACTA,GAAW,QAEO,IAATC,IACTA,EAAQO,KAGV,SAASC,EAAOV,EAAQE,GAEtB,GAAe,OAAXF,EACF,OAAO,KAET,GAAc,IAAVE,EACF,OAAOF,EAET,IAAIW,EACAC,EACJ,GAAqB,iBAAVZ,EACT,OAAOA,EAGT,GAAIV,EAAYU,EAAQP,GACtBkB,EAAQ,IAAIlB,OACP,GAAIH,EAAYU,EAAQN,GAC7BiB,EAAQ,IAAIjB,OACP,GAAIJ,EAAYU,EAAQL,GAC7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AAE,MAAOsJ,GACR,GAAsB,iBAAXtG,OAAqB,OAAOA,MACxC,CACA,CAPuB,GCAxB4lP,EAAoB/uP,EAAI,CAACnE,EAAK6gE,IAAUp+D,OAAO7B,UAAUyY,eAAehV,KAAKrE,EAAK6gE,GCClFqyL,EAAoBxoO,EAAK5lB,IACH,oBAAXmkB,QAA0BA,OAAOsqO,aAC1C9wP,OAAOqB,eAAegB,EAASmkB,OAAOsqO,YAAa,CAAE9xP,MAAO,WAE7DgB,OAAOqB,eAAegB,EAAS,aAAc,CAAErD,OAAO,GAAO,ECFpCyxP,EAAoB","sources":["webpack://jupyter-vega/./node_modules/clone/clone.js","webpack://jupyter-vega/./node_modules/cwise-compiler/compiler.js","webpack://jupyter-vega/./node_modules/cwise-compiler/lib/compile.js","webpack://jupyter-vega/./node_modules/cwise-compiler/lib/thunk.js","webpack://jupyter-vega/./node_modules/cwise-parser/index.js","webpack://jupyter-vega/./node_modules/cwise/lib/cwise-esprima.js","webpack://jupyter-vega/./node_modules/dup/dup.js","webpack://jupyter-vega/./node_modules/esprima/esprima.js","webpack://jupyter-vega/./node_modules/fast-deep-equal/index.js","webpack://jupyter-vega/./node_modules/fast-json-stable-stringify/index.js","webpack://jupyter-vega/./node_modules/iota-array/iota.js","webpack://jupyter-vega/./node_modules/is-buffer/index.js","webpack://jupyter-vega/./node_modules/jupyter-tablewidgets/lib/compression.js","webpack://jupyter-vega/./node_modules/jupyter-tablewidgets/lib/index.js","webpack://jupyter-vega/./node_modules/jupyter-tablewidgets/lib/serializers.js","webpack://jupyter-vega/./node_modules/jupyter-tablewidgets/lib/widgets.js","webpack://jupyter-vega/./node_modules/lz4js/lz4.js","webpack://jupyter-vega/./node_modules/lz4js/util.js","webpack://jupyter-vega/./node_modules/lz4js/xxh32.js","webpack://jupyter-vega/./node_modules/ndarray-unpack/unpack.js","webpack://jupyter-vega/./node_modules/ndarray/ndarray.js","webpack://jupyter-vega/./node_modules/pako/index.js","webpack://jupyter-vega/./node_modules/pako/lib/deflate.js","webpack://jupyter-vega/./node_modules/pako/lib/inflate.js","webpack://jupyter-vega/./node_modules/pako/lib/utils/common.js","webpack://jupyter-vega/./node_modules/pako/lib/utils/strings.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/adler32.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/constants.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/crc32.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/deflate.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/gzheader.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/inffast.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/inflate.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/inftrees.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/messages.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/trees.js","webpack://jupyter-vega/./node_modules/pako/lib/zlib/zstream.js","webpack://jupyter-vega/./src/index.ts","webpack://jupyter-vega/./src/labplugin.ts","webpack://jupyter-vega/./src/version.ts","webpack://jupyter-vega/./src/widget.ts","webpack://jupyter-vega/./node_modules/uniq/uniq.js","webpack://jupyter-vega/./node_modules/vega-embed/build/vega-embed.js","webpack://jupyter-vega/./node_modules/vega-lite/node_modules/vega-util/build/vega-util.module.js","webpack://jupyter-vega/./node_modules/array-flat-polyfill/index.mjs","webpack://jupyter-vega/./node_modules/vega-lite/build/src/logical.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/util.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/axis.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/aggregate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/channel.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/bin.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/log/message.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/log/index.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/datetime.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/timeunit.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/vega.schema.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/predicate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/type.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/scale.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/expr.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/mark.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/valueref.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/format.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/sort.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/facet.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/channeldef.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/title.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/common.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/unit.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/base.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/encoding.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/common.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/boxplot.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/errorbar.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/errorband.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compositemark/index.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/guide.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/header.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/legend.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/parameter.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/selection.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/concat.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/base.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/config.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/layer.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/map.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/repeat.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/stack.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/pathoverlay.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/rangestep.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/repeater.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/ruleforrangedline.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/core.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/normalize/index.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/spec/toplevel.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/split.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/index.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/data.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/transform.js","webpack://jupyter-vega/./node_modules/vega-lite/node_modules/vega-event-selector/build/vega-event-selector.module.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/conditional.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/text.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/tooltip.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/nonposition.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/color.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/offset.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/position-point.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/position-align.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/position-range.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/position-rect.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/base.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/zindex.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/aria.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/encode/defined.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/nearest.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/dataflow.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/timeunit.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/project.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/inputs.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/toggle.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/clear.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/scales.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/legends.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/translate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/zoom.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/transforms/transforms.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/interval.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/multi.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/single.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/index.js","webpack://jupyter-vega/./node_modules/vega-lite/node_modules/vega-expression/node_modules/vega-util/build/vega-util.module.js","webpack://jupyter-vega/./node_modules/vega-lite/node_modules/vega-expression/build/vega-expression.module.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/expressions.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/filter.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/selection/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/predicate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/config.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/properties.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/calculate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/header/common.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/header/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/header/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layoutsize/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layoutsize/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/guide.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/resolve.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/encode.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/properties.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/legend/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/projection/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/projection.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/projection/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/projection/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/bin.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/aggregate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/facet.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/formatparse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/identifier.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/graticule.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/sequence.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/source.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/optimizer.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/optimizers.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/joinaggregate.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/stack.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/window.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/subtree.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/optimize.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/signal.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/domain.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/range.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/properties.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/scale/type.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/model.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/density.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/filterinvalid.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/flatten.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/fold.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/geojson.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/geopoint.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/impute.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/loess.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/lookup.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/quantile.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/regression.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/pivot.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/sample.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/assemble.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/header/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layoutsize/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/facet.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/data/joinaggregatefacet.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/concat.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/component.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/parse.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/axis/encode.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/point.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/tick.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/mark.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/arc.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/area.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/bar.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/geoshape.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/image.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/line.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/rect.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/rule.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/text.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/unit.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/mark/init.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layoutsize/init.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/layer.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/buildmodel.js","webpack://jupyter-vega/./node_modules/vega-lite/build/src/compile/compile.js","webpack://jupyter-vega/./node_modules/vega-util/build/vega-util.module.js","webpack://jupyter-vega/./node_modules/d3-dsv/src/dsv.js","webpack://jupyter-vega/./node_modules/topojson-client/src/identity.js","webpack://jupyter-vega/./node_modules/topojson-client/src/feature.js","webpack://jupyter-vega/./node_modules/topojson-client/src/transform.js","webpack://jupyter-vega/./node_modules/topojson-client/src/reverse.js","webpack://jupyter-vega/./node_modules/topojson-client/src/stitch.js","webpack://jupyter-vega/./node_modules/topojson-client/src/mesh.js","webpack://jupyter-vega/./node_modules/d3-array/src/ticks.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatSpecifier.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatPrefixAuto.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatDecimal.js","webpack://jupyter-vega/./node_modules/d3-format/src/exponent.js","webpack://jupyter-vega/./node_modules/d3-format/src/precisionPrefix.js","webpack://jupyter-vega/./node_modules/d3-format/src/precisionRound.js","webpack://jupyter-vega/./node_modules/d3-format/src/precisionFixed.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatRounded.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatTypes.js","webpack://jupyter-vega/./node_modules/d3-format/src/identity.js","webpack://jupyter-vega/./node_modules/d3-format/src/locale.js","webpack://jupyter-vega/./node_modules/d3-format/src/defaultLocale.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatGroup.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatNumerals.js","webpack://jupyter-vega/./node_modules/d3-format/src/formatTrim.js","webpack://jupyter-vega/./node_modules/d3-time/src/interval.js","webpack://jupyter-vega/./node_modules/d3-time/src/duration.js","webpack://jupyter-vega/./node_modules/d3-time/src/day.js","webpack://jupyter-vega/./node_modules/d3-time/src/week.js","webpack://jupyter-vega/./node_modules/d3-time/src/year.js","webpack://jupyter-vega/./node_modules/d3-time/src/month.js","webpack://jupyter-vega/./node_modules/d3-time/src/hour.js","webpack://jupyter-vega/./node_modules/d3-time/src/minute.js","webpack://jupyter-vega/./node_modules/d3-time/src/second.js","webpack://jupyter-vega/./node_modules/d3-time/src/millisecond.js","webpack://jupyter-vega/./node_modules/d3-array/src/ascending.js","webpack://jupyter-vega/./node_modules/d3-array/src/descending.js","webpack://jupyter-vega/./node_modules/d3-array/src/bisector.js","webpack://jupyter-vega/./node_modules/vega-time/build/vega-time.module.js","webpack://jupyter-vega/./node_modules/d3-time-format/src/locale.js","webpack://jupyter-vega/./node_modules/d3-time-format/src/defaultLocale.js","webpack://jupyter-vega/./node_modules/vega-format/build/vega-format.module.js","webpack://jupyter-vega/./node_modules/vega-loader/build/vega-loader.browser.module.js","webpack://jupyter-vega/./node_modules/vega-dataflow/build/vega-dataflow.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/max.js","webpack://jupyter-vega/./node_modules/d3-array/src/min.js","webpack://jupyter-vega/./node_modules/d3-array/src/sort.js","webpack://jupyter-vega/./node_modules/d3-array/src/quickselect.js","webpack://jupyter-vega/./node_modules/d3-array/src/number.js","webpack://jupyter-vega/./node_modules/d3-array/src/quantile.js","webpack://jupyter-vega/./node_modules/d3-array/src/median.js","webpack://jupyter-vega/./node_modules/vega-statistics/build/vega-statistics.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/deviation.js","webpack://jupyter-vega/./node_modules/d3-array/src/variance.js","webpack://jupyter-vega/./node_modules/d3-array/src/range.js","webpack://jupyter-vega/./node_modules/vega-transforms/build/vega-transforms.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/mean.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/basis.js","webpack://jupyter-vega/./node_modules/d3-shape/src/noop.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/basisClosed.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/basisOpen.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/bundle.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/cardinal.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/cardinalOpen.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/cardinalClosed.js","webpack://jupyter-vega/./node_modules/d3-shape/src/math.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/catmullRom.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/catmullRomClosed.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/catmullRomOpen.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/linear.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/linearClosed.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/monotone.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/natural.js","webpack://jupyter-vega/./node_modules/d3-shape/src/curve/step.js","webpack://jupyter-vega/./node_modules/d3-shape/src/constant.js","webpack://jupyter-vega/./node_modules/d3-path/src/path.js","webpack://jupyter-vega/./node_modules/d3-shape/src/path.js","webpack://jupyter-vega/./node_modules/d3-shape/src/arc.js","webpack://jupyter-vega/./node_modules/d3-shape/src/array.js","webpack://jupyter-vega/./node_modules/d3-shape/src/point.js","webpack://jupyter-vega/./node_modules/d3-shape/src/line.js","webpack://jupyter-vega/./node_modules/d3-shape/src/area.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/asterisk.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/circle.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/diamond.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/star.js","webpack://jupyter-vega/./node_modules/vega-canvas/build/vega-canvas.browser.module.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/triangle.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/triangle2.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol/wye.js","webpack://jupyter-vega/./node_modules/d3-array/src/bisect.js","webpack://jupyter-vega/./node_modules/d3-color/src/define.js","webpack://jupyter-vega/./node_modules/d3-color/src/color.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/basis.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/basisClosed.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/constant.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/color.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/rgb.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/numberArray.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/array.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/date.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/number.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/object.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/string.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/value.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/round.js","webpack://jupyter-vega/./node_modules/d3-scale/src/number.js","webpack://jupyter-vega/./node_modules/d3-scale/src/continuous.js","webpack://jupyter-vega/./node_modules/d3-scale/src/constant.js","webpack://jupyter-vega/./node_modules/d3-scale/src/init.js","webpack://jupyter-vega/./node_modules/d3-scale/src/tickFormat.js","webpack://jupyter-vega/./node_modules/d3-scale/src/linear.js","webpack://jupyter-vega/./node_modules/d3-scale/src/nice.js","webpack://jupyter-vega/./node_modules/d3-scale/src/log.js","webpack://jupyter-vega/./node_modules/d3-scale/src/pow.js","webpack://jupyter-vega/./node_modules/d3-scale/src/symlog.js","webpack://jupyter-vega/./node_modules/d3-time/src/ticks.js","webpack://jupyter-vega/./node_modules/d3-scale/src/time.js","webpack://jupyter-vega/./node_modules/d3-scale/src/sequential.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/piecewise.js","webpack://jupyter-vega/./node_modules/d3-scale/src/diverging.js","webpack://jupyter-vega/./node_modules/internmap/src/index.js","webpack://jupyter-vega/./node_modules/d3-scale/src/ordinal.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/discrete.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/hue.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/transform/decompose.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/transform/parse.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/transform/index.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/zoom.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/hsl.js","webpack://jupyter-vega/./node_modules/d3-color/src/math.js","webpack://jupyter-vega/./node_modules/d3-color/src/lab.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/lab.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/hcl.js","webpack://jupyter-vega/./node_modules/d3-color/src/cubehelix.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/cubehelix.js","webpack://jupyter-vega/./node_modules/d3-interpolate/src/quantize.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/colors.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/Accent.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/category10.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/Dark2.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/observable10.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/Paired.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/Pastel1.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/Pastel2.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/Set1.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/Set2.js","webpack://jupyter-vega/./node_modules/d3-scale-chromatic/src/categorical/Set3.js","webpack://jupyter-vega/./node_modules/vega-scale/build/vega-scale.module.js","webpack://jupyter-vega/./node_modules/d3-scale/src/identity.js","webpack://jupyter-vega/./node_modules/d3-scale/src/utcTime.js","webpack://jupyter-vega/./node_modules/d3-scale/src/quantile.js","webpack://jupyter-vega/./node_modules/d3-scale/src/quantize.js","webpack://jupyter-vega/./node_modules/d3-scale/src/threshold.js","webpack://jupyter-vega/./node_modules/vega-scenegraph/build/vega-scenegraph.module.js","webpack://jupyter-vega/./node_modules/d3-shape/src/symbol.js","webpack://jupyter-vega/./node_modules/vega-view-transforms/build/vega-view-transforms.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/sum.js","webpack://jupyter-vega/./node_modules/vega-encode/build/vega-encode.module.js","webpack://jupyter-vega/./node_modules/d3-geo/src/identity.js","webpack://jupyter-vega/./node_modules/d3-geo/src/stream.js","webpack://jupyter-vega/./node_modules/d3-array/src/fsum.js","webpack://jupyter-vega/./node_modules/d3-geo/src/math.js","webpack://jupyter-vega/./node_modules/d3-geo/src/noop.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/area.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/bounds.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/centroid.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/context.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/measure.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/string.js","webpack://jupyter-vega/./node_modules/d3-geo/src/path/index.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/buffer.js","webpack://jupyter-vega/./node_modules/d3-geo/src/pointEqual.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/rejoin.js","webpack://jupyter-vega/./node_modules/d3-geo/src/cartesian.js","webpack://jupyter-vega/./node_modules/d3-geo/src/polygonContains.js","webpack://jupyter-vega/./node_modules/d3-array/src/merge.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/index.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/antimeridian.js","webpack://jupyter-vega/./node_modules/d3-geo/src/circle.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/rectangle.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/line.js","webpack://jupyter-vega/./node_modules/d3-geo/src/compose.js","webpack://jupyter-vega/./node_modules/d3-geo/src/rotation.js","webpack://jupyter-vega/./node_modules/d3-geo/src/transform.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/fit.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/resample.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/index.js","webpack://jupyter-vega/./node_modules/d3-geo/src/clip/circle.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/conic.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/conicEqualArea.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/cylindricalEqualArea.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/albers.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/azimuthal.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/azimuthalEqualArea.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/azimuthalEquidistant.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/mercator.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/conicConformal.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/equirectangular.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/conicEquidistant.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/equalEarth.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/gnomonic.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/naturalEarth1.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/orthographic.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/stereographic.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/transverseMercator.js","webpack://jupyter-vega/./node_modules/d3-geo-projection/src/math.js","webpack://jupyter-vega/./node_modules/d3-geo-projection/src/mollweide.js","webpack://jupyter-vega/./node_modules/vega-projection/build/vega-projection.module.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/albersUsa.js","webpack://jupyter-vega/./node_modules/d3-geo/src/projection/identity.js","webpack://jupyter-vega/./node_modules/d3-geo/src/graticule.js","webpack://jupyter-vega/./node_modules/vega-geo/build/vega-geo.module.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/add.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/quad.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/x.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/y.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/quadtree.js","webpack://jupyter-vega/./node_modules/d3-force/src/constant.js","webpack://jupyter-vega/./node_modules/d3-force/src/jiggle.js","webpack://jupyter-vega/./node_modules/d3-force/src/collide.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/cover.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/data.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/extent.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/find.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/remove.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/root.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/size.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/visit.js","webpack://jupyter-vega/./node_modules/d3-quadtree/src/visitAfter.js","webpack://jupyter-vega/./node_modules/d3-dispatch/src/dispatch.js","webpack://jupyter-vega/./node_modules/d3-timer/src/timer.js","webpack://jupyter-vega/./node_modules/d3-force/src/lcg.js","webpack://jupyter-vega/./node_modules/d3-force/src/simulation.js","webpack://jupyter-vega/./node_modules/d3-force/src/link.js","webpack://jupyter-vega/./node_modules/vega-force/build/vega-force.module.js","webpack://jupyter-vega/./node_modules/d3-force/src/center.js","webpack://jupyter-vega/./node_modules/d3-force/src/manyBody.js","webpack://jupyter-vega/./node_modules/d3-force/src/x.js","webpack://jupyter-vega/./node_modules/d3-force/src/y.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/count.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/index.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/accessors.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/constant.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/each.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/eachAfter.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/eachBefore.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/find.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/sum.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/sort.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/path.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/ancestors.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/descendants.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/leaves.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/links.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/hierarchy/iterator.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/lcg.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/pack/enclose.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/pack/siblings.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/array.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/pack/index.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/round.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/dice.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/stratify.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/tree.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/cluster.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/slice.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/squarify.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/resquarify.js","webpack://jupyter-vega/./node_modules/vega-hierarchy/build/vega-hierarchy.module.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/partition.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/binary.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/sliceDice.js","webpack://jupyter-vega/./node_modules/d3-hierarchy/src/treemap/index.js","webpack://jupyter-vega/./node_modules/vega-label/build/vega-label.module.js","webpack://jupyter-vega/./node_modules/vega-regression/build/vega-regression.module.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/util.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/orient2d.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/orient3d.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/incircle.js","webpack://jupyter-vega/./node_modules/robust-predicates/esm/insphere.js","webpack://jupyter-vega/./node_modules/delaunator/index.js","webpack://jupyter-vega/./node_modules/d3-delaunay/src/path.js","webpack://jupyter-vega/./node_modules/d3-delaunay/src/polygon.js","webpack://jupyter-vega/./node_modules/d3-delaunay/src/voronoi.js","webpack://jupyter-vega/./node_modules/d3-delaunay/src/delaunay.js","webpack://jupyter-vega/./node_modules/vega-voronoi/build/vega-voronoi.module.js","webpack://jupyter-vega/./node_modules/vega-wordcloud/build/vega-wordcloud.module.js","webpack://jupyter-vega/./node_modules/vega-crossfilter/build/vega-crossfilter.module.js","webpack://jupyter-vega/./node_modules/d3-array/src/permute.js","webpack://jupyter-vega/./node_modules/vega-expression/build/vega-expression.module.js","webpack://jupyter-vega/./node_modules/d3-geo/src/area.js","webpack://jupyter-vega/./node_modules/d3-geo/src/bounds.js","webpack://jupyter-vega/./node_modules/d3-geo/src/centroid.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/ascending.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/descending.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/bisector.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/intersection.js","webpack://jupyter-vega/./node_modules/vega-selections/build/vega-selection.module.js","webpack://jupyter-vega/./node_modules/vega-selections/node_modules/d3-array/src/union.js","webpack://jupyter-vega/./node_modules/vega-functions/build/vega-functions.module.js","webpack://jupyter-vega/./node_modules/vega-runtime/build/vega-runtime.module.js","webpack://jupyter-vega/./node_modules/vega-view/build/vega-view.module.js","webpack://jupyter-vega/./node_modules/d3-timer/src/interval.js","webpack://jupyter-vega/./node_modules/vega-event-selector/build/vega-event-selector.module.js","webpack://jupyter-vega/./node_modules/vega-parser/build/vega-parser.module.js","webpack://jupyter-vega/./node_modules/vega/build/vega.module.js","webpack://jupyter-vega/external amd \"@jupyter-widgets/base\"","webpack://jupyter-vega/webpack/bootstrap","webpack://jupyter-vega/webpack/runtime/compat get default export","webpack://jupyter-vega/webpack/runtime/define property getters","webpack://jupyter-vega/webpack/runtime/global","webpack://jupyter-vega/webpack/runtime/hasOwnProperty shorthand","webpack://jupyter-vega/webpack/runtime/make namespace object","webpack://jupyter-vega/webpack/startup"],"sourcesContent":["var clone = (function() {\n'use strict';\n\nfunction _instanceof(obj, type) {\n return type != null && obj instanceof type;\n}\n\nvar nativeMap;\ntry {\n nativeMap = Map;\n} catch(_) {\n // maybe a reference error because no `Map`. Give it a dummy value that no\n // value will ever be an instanceof.\n nativeMap = function() {};\n}\n\nvar nativeSet;\ntry {\n nativeSet = Set;\n} catch(_) {\n nativeSet = function() {};\n}\n\nvar nativePromise;\ntry {\n nativePromise = Promise;\n} catch(_) {\n nativePromise = function() {};\n}\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n * @param `includeNonEnumerable` - set to true if the non-enumerable properties\n * should be cloned as well. Non-enumerable properties on the prototype\n * chain will be ignored. (optional - false by default)\n*/\nfunction clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n}\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n}\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n}\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n}\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n}\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif (typeof module === 'object' && module.exports) {\n module.exports = clone;\n}\n","\"use strict\"\n\nvar createThunk = require(\"./lib/thunk.js\")\n\nfunction Procedure() {\n this.argTypes = []\n this.shimArgs = []\n this.arrayArgs = []\n this.arrayBlockIndices = []\n this.scalarArgs = []\n this.offsetArgs = []\n this.offsetArgIndex = []\n this.indexArgs = []\n this.shapeArgs = []\n this.funcName = \"\"\n this.pre = null\n this.body = null\n this.post = null\n this.debug = false\n}\n\nfunction compileCwise(user_args) {\n //Create procedure\n var proc = new Procedure()\n \n //Parse blocks\n proc.pre = user_args.pre\n proc.body = user_args.body\n proc.post = user_args.post\n\n //Parse arguments\n var proc_args = user_args.args.slice(0)\n proc.argTypes = proc_args\n for(var i=0; i0) {\n throw new Error(\"cwise: pre() block may not reference array args\")\n }\n if(i < proc.post.args.length && proc.post.args[i].count>0) {\n throw new Error(\"cwise: post() block may not reference array args\")\n }\n } else if(arg_type === \"scalar\") {\n proc.scalarArgs.push(i)\n proc.shimArgs.push(\"scalar\" + i)\n } else if(arg_type === \"index\") {\n proc.indexArgs.push(i)\n if(i < proc.pre.args.length && proc.pre.args[i].count > 0) {\n throw new Error(\"cwise: pre() block may not reference array index\")\n }\n if(i < proc.body.args.length && proc.body.args[i].lvalue) {\n throw new Error(\"cwise: body() block may not write to array index\")\n }\n if(i < proc.post.args.length && proc.post.args[i].count > 0) {\n throw new Error(\"cwise: post() block may not reference array index\")\n }\n } else if(arg_type === \"shape\") {\n proc.shapeArgs.push(i)\n if(i < proc.pre.args.length && proc.pre.args[i].lvalue) {\n throw new Error(\"cwise: pre() block may not write to array shape\")\n }\n if(i < proc.body.args.length && proc.body.args[i].lvalue) {\n throw new Error(\"cwise: body() block may not write to array shape\")\n }\n if(i < proc.post.args.length && proc.post.args[i].lvalue) {\n throw new Error(\"cwise: post() block may not write to array shape\")\n }\n } else if(typeof arg_type === \"object\" && arg_type.offset) {\n proc.argTypes[i] = \"offset\"\n proc.offsetArgs.push({ array: arg_type.array, offset:arg_type.offset })\n proc.offsetArgIndex.push(i)\n } else {\n throw new Error(\"cwise: Unknown argument type \" + proc_args[i])\n }\n }\n \n //Make sure at least one array argument was specified\n if(proc.arrayArgs.length <= 0) {\n throw new Error(\"cwise: No array arguments specified\")\n }\n \n //Make sure arguments are correct\n if(proc.pre.args.length > proc_args.length) {\n throw new Error(\"cwise: Too many arguments in pre() block\")\n }\n if(proc.body.args.length > proc_args.length) {\n throw new Error(\"cwise: Too many arguments in body() block\")\n }\n if(proc.post.args.length > proc_args.length) {\n throw new Error(\"cwise: Too many arguments in post() block\")\n }\n\n //Check debug flag\n proc.debug = !!user_args.printCode || !!user_args.debug\n \n //Retrieve name\n proc.funcName = user_args.funcName || \"cwise\"\n \n //Read in block size\n proc.blockSize = user_args.blockSize || 64\n\n return createThunk(proc)\n}\n\nmodule.exports = compileCwise\n","\"use strict\"\n\nvar uniq = require(\"uniq\")\n\n// This function generates very simple loops analogous to how you typically traverse arrays (the outermost loop corresponds to the slowest changing index, the innermost loop to the fastest changing index)\n// TODO: If two arrays have the same strides (and offsets) there is potential for decreasing the number of \"pointers\" and related variables. The drawback is that the type signature would become more specific and that there would thus be less potential for caching, but it might still be worth it, especially when dealing with large numbers of arguments.\nfunction innerFill(order, proc, body) {\n var dimension = order.length\n , nargs = proc.arrayArgs.length\n , has_index = proc.indexArgs.length>0\n , code = []\n , vars = []\n , idx=0, pidx=0, i, j\n for(i=0; i 0) {\n code.push(\"var \" + vars.join(\",\"))\n } \n //Scan loop\n for(i=dimension-1; i>=0; --i) { // Start at largest stride and work your way inwards\n idx = order[i]\n code.push([\"for(i\",i,\"=0;i\",i,\" 0) {\n code.push([\"index[\",pidx,\"]-=s\",pidx].join(\"\"))\n }\n code.push([\"++index[\",idx,\"]\"].join(\"\"))\n }\n code.push(\"}\")\n }\n return code.join(\"\\n\")\n}\n\n// Generate \"outer\" loops that loop over blocks of data, applying \"inner\" loops to the blocks by manipulating the local variables in such a way that the inner loop only \"sees\" the current block.\n// TODO: If this is used, then the previous declaration (done by generateCwiseOp) of s* is essentially unnecessary.\n// I believe the s* are not used elsewhere (in particular, I don't think they're used in the pre/post parts and \"shape\" is defined independently), so it would be possible to make defining the s* dependent on what loop method is being used.\nfunction outerFill(matched, order, proc, body) {\n var dimension = order.length\n , nargs = proc.arrayArgs.length\n , blockSize = proc.blockSize\n , has_index = proc.indexArgs.length > 0\n , code = []\n for(var i=0; i0;){\"].join(\"\")) // Iterate back to front\n code.push([\"if(j\",i,\"<\",blockSize,\"){\"].join(\"\")) // Either decrease j by blockSize (s = blockSize), or set it to zero (after setting s = j).\n code.push([\"s\",order[i],\"=j\",i].join(\"\"))\n code.push([\"j\",i,\"=0\"].join(\"\"))\n code.push([\"}else{s\",order[i],\"=\",blockSize].join(\"\"))\n code.push([\"j\",i,\"-=\",blockSize,\"}\"].join(\"\"))\n if(has_index) {\n code.push([\"index[\",order[i],\"]=j\",i].join(\"\"))\n }\n }\n for(var i=0; i 0) {\n allEqual = allEqual && summary[i] === summary[i-1]\n }\n }\n if(allEqual) {\n return summary[0]\n }\n return summary.join(\"\")\n}\n\n//Generates a cwise operator\nfunction generateCWiseOp(proc, typesig) {\n\n //Compute dimension\n // Arrays get put first in typesig, and there are two entries per array (dtype and order), so this gets the number of dimensions in the first array arg.\n var dimension = (typesig[1].length - Math.abs(proc.arrayBlockIndices[0]))|0\n var orders = new Array(proc.arrayArgs.length)\n var dtypes = new Array(proc.arrayArgs.length)\n for(var i=0; i 0) {\n vars.push(\"shape=SS.slice(0)\") // Makes the shape over which we iterate available to the user defined functions (so you can use width/height for example)\n }\n if(proc.indexArgs.length > 0) {\n // Prepare an array to keep track of the (logical) indices, initialized to dimension zeroes.\n var zeros = new Array(dimension)\n for(var i=0; i 0) {\n code.push(\"var \" + vars.join(\",\"))\n }\n for(var i=0; i 3) {\n code.push(processBlock(proc.pre, proc, dtypes))\n }\n\n //Process body\n var body = processBlock(proc.body, proc, dtypes)\n var matched = countMatches(loopOrders)\n if(matched < dimension) {\n code.push(outerFill(matched, loopOrders[0], proc, body)) // TODO: Rather than passing loopOrders[0], it might be interesting to look at passing an order that represents the majority of the arguments for example.\n } else {\n code.push(innerFill(loopOrders[0], proc, body))\n }\n\n //Inline epilog\n if(proc.post.body.length > 3) {\n code.push(processBlock(proc.post, proc, dtypes))\n }\n \n if(proc.debug) {\n console.log(\"-----Generated cwise routine for \", typesig, \":\\n\" + code.join(\"\\n\") + \"\\n----------\")\n }\n \n var loopName = [(proc.funcName||\"unnamed\"), \"_cwise_loop_\", orders[0].join(\"s\"),\"m\",matched,typeSummary(dtypes)].join(\"\")\n var f = new Function([\"function \",loopName,\"(\", arglist.join(\",\"),\"){\", code.join(\"\\n\"),\"} return \", loopName].join(\"\"))\n return f()\n}\nmodule.exports = generateCWiseOp\n","\"use strict\"\n\n// The function below is called when constructing a cwise function object, and does the following:\n// A function object is constructed which accepts as argument a compilation function and returns another function.\n// It is this other function that is eventually returned by createThunk, and this function is the one that actually\n// checks whether a certain pattern of arguments has already been used before and compiles new loops as needed.\n// The compilation passed to the first function object is used for compiling new functions.\n// Once this function object is created, it is called with compile as argument, where the first argument of compile\n// is bound to \"proc\" (essentially containing a preprocessed version of the user arguments to cwise).\n// So createThunk roughly works like this:\n// function createThunk(proc) {\n// var thunk = function(compileBound) {\n// var CACHED = {}\n// return function(arrays and scalars) {\n// if (dtype and order of arrays in CACHED) {\n// var func = CACHED[dtype and order of arrays]\n// } else {\n// var func = CACHED[dtype and order of arrays] = compileBound(dtype and order of arrays)\n// }\n// return func(arrays and scalars)\n// }\n// }\n// return thunk(compile.bind1(proc))\n// }\n\nvar compile = require(\"./compile.js\")\n\nfunction createThunk(proc) {\n var code = [\"'use strict'\", \"var CACHED={}\"]\n var vars = []\n var thunkName = proc.funcName + \"_cwise_thunk\"\n \n //Build thunk\n code.push([\"return function \", thunkName, \"(\", proc.shimArgs.join(\",\"), \"){\"].join(\"\"))\n var typesig = []\n var string_typesig = []\n var proc_args = [[\"array\",proc.arrayArgs[0],\".shape.slice(\", // Slice shape so that we only retain the shape over which we iterate (which gets passed to the cwise operator as SS).\n Math.max(0,proc.arrayBlockIndices[0]),proc.arrayBlockIndices[0]<0?(\",\"+proc.arrayBlockIndices[0]+\")\"):\")\"].join(\"\")]\n var shapeLengthConditions = [], shapeConditions = []\n // Process array arguments\n for(var i=0; i0) { // Gather conditions to check for shape equality (ignoring block indices)\n shapeLengthConditions.push(\"array\" + proc.arrayArgs[0] + \".shape.length===array\" + j + \".shape.length+\" + (Math.abs(proc.arrayBlockIndices[0])-Math.abs(proc.arrayBlockIndices[i])))\n shapeConditions.push(\"array\" + proc.arrayArgs[0] + \".shape[shapeIndex+\" + Math.max(0,proc.arrayBlockIndices[0]) + \"]===array\" + j + \".shape[shapeIndex+\" + Math.max(0,proc.arrayBlockIndices[i]) + \"]\")\n }\n }\n // Check for shape equality\n if (proc.arrayArgs.length > 1) {\n code.push(\"if (!(\" + shapeLengthConditions.join(\" && \") + \")) throw new Error('cwise: Arrays do not all have the same dimensionality!')\")\n code.push(\"for(var shapeIndex=array\" + proc.arrayArgs[0] + \".shape.length-\" + Math.abs(proc.arrayBlockIndices[0]) + \"; shapeIndex-->0;) {\")\n code.push(\"if (!(\" + shapeConditions.join(\" && \") + \")) throw new Error('cwise: Arrays do not all have the same shape!')\")\n code.push(\"}\")\n }\n // Process scalar arguments\n for(var i=0; i= 0) {\n var carg = compiledArgs[argNo]\n var usage = getUsage(node)\n if(usage & LVALUE) {\n carg.lvalue = true\n }\n if(usage & RVALUE) {\n carg.rvalue = true\n }\n ++carg.count\n rewrite(node, carg.name)\n } else if(isGlobal(name)) {\n //Don't rewrite globals\n } else {\n rewrite(node, createLocal(name))\n }\n } else if(node.type === \"Literal\") {\n if(typeof node.value === \"string\") {\n rewrite(node, escapeString(node.value))\n }\n } else if(node.type === \"WithStatement\") {\n throw new Error(\"cwise-parser: with() statements not allowed\")\n } else {\n //Visit all children\n var keys = Object.keys(node)\n for(var i=0, n=keys.length; i 0) {\n return dupe_number(count|0, value)\n }\n break\n case \"object\":\n if(typeof (count.length) === \"number\") {\n return dupe_array(count, value, 0)\n }\n break\n }\n return []\n}\n\nmodule.exports = dupe","/*\n Copyright (C) 2013 Ariya Hidayat \n Copyright (C) 2013 Thaddee Tyl \n Copyright (C) 2013 Mathias Bynens \n Copyright (C) 2012 Ariya Hidayat \n Copyright (C) 2012 Mathias Bynens \n Copyright (C) 2012 Joost-Wim Boekesteijn \n Copyright (C) 2012 Kris Kowal \n Copyright (C) 2012 Yusuke Suzuki \n Copyright (C) 2012 Arpad Borsos \n Copyright (C) 2011 Ariya Hidayat \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n/*jslint bitwise:true plusplus:true */\n/*global esprima:true, define:true, exports:true, window: true,\nthrowErrorTolerant: true,\nthrowError: true, generateStatement: true, peek: true,\nparseAssignmentExpression: true, parseBlock: true, parseExpression: true,\nparseFunctionDeclaration: true, parseFunctionExpression: true,\nparseFunctionSourceElements: true, parseVariableIdentifier: true,\nparseLeftHandSideExpression: true,\nparseUnaryExpression: true,\nparseStatement: true, parseSourceElement: true */\n\n(function (root, factory) {\n 'use strict';\n\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js,\n // Rhino, and plain browser loading.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define(['exports'], factory);\n } else if (typeof exports !== 'undefined') {\n factory(exports);\n } else {\n factory((root.esprima = {}));\n }\n}(this, function (exports) {\n 'use strict';\n\n var Token,\n TokenName,\n FnExprTokens,\n Syntax,\n PropertyKind,\n Messages,\n Regex,\n SyntaxTreeDelegate,\n source,\n strict,\n index,\n lineNumber,\n lineStart,\n length,\n delegate,\n lookahead,\n state,\n extra;\n\n Token = {\n BooleanLiteral: 1,\n EOF: 2,\n Identifier: 3,\n Keyword: 4,\n NullLiteral: 5,\n NumericLiteral: 6,\n Punctuator: 7,\n StringLiteral: 8,\n RegularExpression: 9\n };\n\n TokenName = {};\n TokenName[Token.BooleanLiteral] = 'Boolean';\n TokenName[Token.EOF] = '';\n TokenName[Token.Identifier] = 'Identifier';\n TokenName[Token.Keyword] = 'Keyword';\n TokenName[Token.NullLiteral] = 'Null';\n TokenName[Token.NumericLiteral] = 'Numeric';\n TokenName[Token.Punctuator] = 'Punctuator';\n TokenName[Token.StringLiteral] = 'String';\n TokenName[Token.RegularExpression] = 'RegularExpression';\n\n // A function following one of those tokens is an expression.\n FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new',\n 'return', 'case', 'delete', 'throw', 'void',\n // assignment operators\n '=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=',\n '&=', '|=', '^=', ',',\n // binary/unary operators\n '+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&',\n '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=',\n '<=', '<', '>', '!=', '!=='];\n\n Syntax = {\n AssignmentExpression: 'AssignmentExpression',\n ArrayExpression: 'ArrayExpression',\n BlockStatement: 'BlockStatement',\n BinaryExpression: 'BinaryExpression',\n BreakStatement: 'BreakStatement',\n CallExpression: 'CallExpression',\n CatchClause: 'CatchClause',\n ConditionalExpression: 'ConditionalExpression',\n ContinueStatement: 'ContinueStatement',\n DoWhileStatement: 'DoWhileStatement',\n DebuggerStatement: 'DebuggerStatement',\n EmptyStatement: 'EmptyStatement',\n ExpressionStatement: 'ExpressionStatement',\n ForStatement: 'ForStatement',\n ForInStatement: 'ForInStatement',\n FunctionDeclaration: 'FunctionDeclaration',\n FunctionExpression: 'FunctionExpression',\n Identifier: 'Identifier',\n IfStatement: 'IfStatement',\n Literal: 'Literal',\n LabeledStatement: 'LabeledStatement',\n LogicalExpression: 'LogicalExpression',\n MemberExpression: 'MemberExpression',\n NewExpression: 'NewExpression',\n ObjectExpression: 'ObjectExpression',\n Program: 'Program',\n Property: 'Property',\n ReturnStatement: 'ReturnStatement',\n SequenceExpression: 'SequenceExpression',\n SwitchStatement: 'SwitchStatement',\n SwitchCase: 'SwitchCase',\n ThisExpression: 'ThisExpression',\n ThrowStatement: 'ThrowStatement',\n TryStatement: 'TryStatement',\n UnaryExpression: 'UnaryExpression',\n UpdateExpression: 'UpdateExpression',\n VariableDeclaration: 'VariableDeclaration',\n VariableDeclarator: 'VariableDeclarator',\n WhileStatement: 'WhileStatement',\n WithStatement: 'WithStatement'\n };\n\n PropertyKind = {\n Data: 1,\n Get: 2,\n Set: 4\n };\n\n // Error messages should be identical to V8.\n Messages = {\n UnexpectedToken: 'Unexpected token %0',\n UnexpectedNumber: 'Unexpected number',\n UnexpectedString: 'Unexpected string',\n UnexpectedIdentifier: 'Unexpected identifier',\n UnexpectedReserved: 'Unexpected reserved word',\n UnexpectedEOS: 'Unexpected end of input',\n NewlineAfterThrow: 'Illegal newline after throw',\n InvalidRegExp: 'Invalid regular expression',\n UnterminatedRegExp: 'Invalid regular expression: missing /',\n InvalidLHSInAssignment: 'Invalid left-hand side in assignment',\n InvalidLHSInForIn: 'Invalid left-hand side in for-in',\n MultipleDefaultsInSwitch: 'More than one default clause in switch statement',\n NoCatchOrFinally: 'Missing catch or finally after try',\n UnknownLabel: 'Undefined label \\'%0\\'',\n Redeclaration: '%0 \\'%1\\' has already been declared',\n IllegalContinue: 'Illegal continue statement',\n IllegalBreak: 'Illegal break statement',\n IllegalReturn: 'Illegal return statement',\n StrictModeWith: 'Strict mode code may not include a with statement',\n StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',\n StrictVarName: 'Variable name may not be eval or arguments in strict mode',\n StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',\n StrictParamDupe: 'Strict mode function may not have duplicate parameter names',\n StrictFunctionName: 'Function name may not be eval or arguments in strict mode',\n StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',\n StrictDelete: 'Delete of an unqualified identifier in strict mode.',\n StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode',\n AccessorDataProperty: 'Object literal may not have data and accessor property with the same name',\n AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name',\n StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',\n StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',\n StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',\n StrictReservedWord: 'Use of future reserved word in strict mode'\n };\n\n // See also tools/generate-unicode-regex.py.\n Regex = {\n NonAsciiIdentifierStart: new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8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0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]'),\n NonAsciiIdentifierPart: new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0\\u08A2-\\u08AC\\u08E4-\\u08FE\\u0900-\\u0963\\u0966-\\u096F\\u0971-\\u0977\\u0979-\\u097F\\u0981-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\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0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1D00-\\u1DE6\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA697\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A\\uAA7B\\uAA80-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE26\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]')\n };\n\n // Ensure the condition is true, otherwise throw an error.\n // This is only to have a better contract semantic, i.e. another safety net\n // to catch a logic error. The condition shall be fulfilled in normal case.\n // Do NOT use this to enforce a certain condition on any user input.\n\n function assert(condition, message) {\n /* istanbul ignore if */\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }\n\n function isDecimalDigit(ch) {\n return (ch >= 48 && ch <= 57); // 0..9\n }\n\n function isHexDigit(ch) {\n return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;\n }\n\n function isOctalDigit(ch) {\n return '01234567'.indexOf(ch) >= 0;\n }\n\n\n // 7.2 White Space\n\n function isWhiteSpace(ch) {\n return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||\n (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);\n }\n\n // 7.3 Line Terminators\n\n function isLineTerminator(ch) {\n return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029);\n }\n\n // 7.6 Identifier Names and Identifiers\n\n function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }\n\n function isIdentifierPart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch >= 0x30 && ch <= 0x39) || // 0..9\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch)));\n }\n\n // 7.6.1.2 Future Reserved Words\n\n function isFutureReservedWord(id) {\n switch (id) {\n case 'class':\n case 'enum':\n case 'export':\n case 'extends':\n case 'import':\n case 'super':\n return true;\n default:\n return false;\n }\n }\n\n function isStrictModeReservedWord(id) {\n switch (id) {\n case 'implements':\n case 'interface':\n case 'package':\n case 'private':\n case 'protected':\n case 'public':\n case 'static':\n case 'yield':\n case 'let':\n return true;\n default:\n return false;\n }\n }\n\n function isRestrictedWord(id) {\n return id === 'eval' || id === 'arguments';\n }\n\n // 7.6.1.1 Keywords\n\n function isKeyword(id) {\n if (strict && isStrictModeReservedWord(id)) {\n return true;\n }\n\n // 'const' is specialized as Keyword in V8.\n // 'yield' and 'let' are for compatiblity with SpiderMonkey and ES.next.\n // Some others are from future reserved words.\n\n switch (id.length) {\n case 2:\n return (id === 'if') || (id === 'in') || (id === 'do');\n case 3:\n return (id === 'var') || (id === 'for') || (id === 'new') ||\n (id === 'try') || (id === 'let');\n case 4:\n return (id === 'this') || (id === 'else') || (id === 'case') ||\n (id === 'void') || (id === 'with') || (id === 'enum');\n case 5:\n return (id === 'while') || (id === 'break') || (id === 'catch') ||\n (id === 'throw') || (id === 'const') || (id === 'yield') ||\n (id === 'class') || (id === 'super');\n case 6:\n return (id === 'return') || (id === 'typeof') || (id === 'delete') ||\n (id === 'switch') || (id === 'export') || (id === 'import');\n case 7:\n return (id === 'default') || (id === 'finally') || (id === 'extends');\n case 8:\n return (id === 'function') || (id === 'continue') || (id === 'debugger');\n case 10:\n return (id === 'instanceof');\n default:\n return false;\n }\n }\n\n // 7.4 Comments\n\n function addComment(type, value, start, end, loc) {\n var comment, attacher;\n\n assert(typeof start === 'number', 'Comment must have valid position');\n\n // Because the way the actual token is scanned, often the comments\n // (if any) are skipped twice during the lexical analysis.\n // Thus, we need to skip adding a comment if the comment array already\n // handled it.\n if (state.lastCommentStart >= start) {\n return;\n }\n state.lastCommentStart = start;\n\n comment = {\n type: type,\n value: value\n };\n if (extra.range) {\n comment.range = [start, end];\n }\n if (extra.loc) {\n comment.loc = loc;\n }\n extra.comments.push(comment);\n if (extra.attachComment) {\n extra.leadingComments.push(comment);\n extra.trailingComments.push(comment);\n }\n }\n\n function skipSingleLineComment(offset) {\n var start, loc, ch, comment;\n\n start = index - offset;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart - offset\n }\n };\n\n while (index < length) {\n ch = source.charCodeAt(index);\n ++index;\n if (isLineTerminator(ch)) {\n if (extra.comments) {\n comment = source.slice(start + offset, index - 1);\n loc.end = {\n line: lineNumber,\n column: index - lineStart - 1\n };\n addComment('Line', comment, start, index - 1, loc);\n }\n if (ch === 13 && source.charCodeAt(index) === 10) {\n ++index;\n }\n ++lineNumber;\n lineStart = index;\n return;\n }\n }\n\n if (extra.comments) {\n comment = source.slice(start + offset, index);\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n addComment('Line', comment, start, index, loc);\n }\n }\n\n function skipMultiLineComment() {\n var start, loc, ch, comment;\n\n if (extra.comments) {\n start = index - 2;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart - 2\n }\n };\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n if (isLineTerminator(ch)) {\n if (ch === 0x0D && source.charCodeAt(index + 1) === 0x0A) {\n ++index;\n }\n ++lineNumber;\n ++index;\n lineStart = index;\n if (index >= length) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n } else if (ch === 0x2A) {\n // Block comment ends with '*/'.\n if (source.charCodeAt(index + 1) === 0x2F) {\n ++index;\n ++index;\n if (extra.comments) {\n comment = source.slice(start + 2, index - 2);\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n addComment('Block', comment, start, index, loc);\n }\n return;\n }\n ++index;\n } else {\n ++index;\n }\n }\n\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n function skipComment() {\n var ch, start;\n\n start = (index === 0);\n while (index < length) {\n ch = source.charCodeAt(index);\n\n if (isWhiteSpace(ch)) {\n ++index;\n } else if (isLineTerminator(ch)) {\n ++index;\n if (ch === 0x0D && source.charCodeAt(index) === 0x0A) {\n ++index;\n }\n ++lineNumber;\n lineStart = index;\n start = true;\n } else if (ch === 0x2F) { // U+002F is '/'\n ch = source.charCodeAt(index + 1);\n if (ch === 0x2F) {\n ++index;\n ++index;\n skipSingleLineComment(2);\n start = true;\n } else if (ch === 0x2A) { // U+002A is '*'\n ++index;\n ++index;\n skipMultiLineComment();\n } else {\n break;\n }\n } else if (start && ch === 0x2D) { // U+002D is '-'\n // U+003E is '>'\n if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) {\n // '-->' is a single-line comment\n index += 3;\n skipSingleLineComment(3);\n } else {\n break;\n }\n } else if (ch === 0x3C) { // U+003C is '<'\n if (source.slice(index + 1, index + 4) === '!--') {\n ++index; // `<`\n ++index; // `!`\n ++index; // `-`\n ++index; // `-`\n skipSingleLineComment(4);\n } else {\n break;\n }\n } else {\n break;\n }\n }\n }\n\n function scanHexEscape(prefix) {\n var i, len, ch, code = 0;\n\n len = (prefix === 'u') ? 4 : 2;\n for (i = 0; i < len; ++i) {\n if (index < length && isHexDigit(source[index])) {\n ch = source[index++];\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n } else {\n return '';\n }\n }\n return String.fromCharCode(code);\n }\n\n function getEscapedIdentifier() {\n var ch, id;\n\n ch = source.charCodeAt(index++);\n id = String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierStart(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n id = ch;\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n if (!isIdentifierPart(ch)) {\n break;\n }\n ++index;\n id += String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n id = id.substr(0, id.length - 1);\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierPart(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n id += ch;\n }\n }\n\n return id;\n }\n\n function getIdentifier() {\n var start, ch;\n\n start = index++;\n while (index < length) {\n ch = source.charCodeAt(index);\n if (ch === 0x5C) {\n // Blackslash (U+005C) marks Unicode escape sequence.\n index = start;\n return getEscapedIdentifier();\n }\n if (isIdentifierPart(ch)) {\n ++index;\n } else {\n break;\n }\n }\n\n return source.slice(start, index);\n }\n\n function scanIdentifier() {\n var start, id, type;\n\n start = index;\n\n // Backslash (U+005C) starts an escaped character.\n id = (source.charCodeAt(index) === 0x5C) ? getEscapedIdentifier() : getIdentifier();\n\n // There is no keyword or literal with only one character.\n // Thus, it must be an identifier.\n if (id.length === 1) {\n type = Token.Identifier;\n } else if (isKeyword(id)) {\n type = Token.Keyword;\n } else if (id === 'null') {\n type = Token.NullLiteral;\n } else if (id === 'true' || id === 'false') {\n type = Token.BooleanLiteral;\n } else {\n type = Token.Identifier;\n }\n\n return {\n type: type,\n value: id,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n\n // 7.7 Punctuators\n\n function scanPunctuator() {\n var start = index,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2,\n ch3,\n ch4;\n\n switch (code) {\n\n // Check for most common single-character punctuators.\n case 0x2E: // . dot\n case 0x28: // ( open bracket\n case 0x29: // ) close bracket\n case 0x3B: // ; semicolon\n case 0x2C: // , comma\n case 0x7B: // { open curly brace\n case 0x7D: // } close curly brace\n case 0x5B: // [\n case 0x5D: // ]\n case 0x3A: // :\n case 0x3F: // ?\n case 0x7E: // ~\n ++index;\n if (extra.tokenize) {\n if (code === 0x28) {\n extra.openParenToken = extra.tokens.length;\n } else if (code === 0x7B) {\n extra.openCurlyToken = extra.tokens.length;\n }\n }\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n\n default:\n code2 = source.charCodeAt(index + 1);\n\n // '=' (U+003D) marks an assignment or comparison operator.\n if (code2 === 0x3D) {\n switch (code) {\n case 0x2B: // +\n case 0x2D: // -\n case 0x2F: // /\n case 0x3C: // <\n case 0x3E: // >\n case 0x5E: // ^\n case 0x7C: // |\n case 0x25: // %\n case 0x26: // &\n case 0x2A: // *\n index += 2;\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code) + String.fromCharCode(code2),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n\n case 0x21: // !\n case 0x3D: // =\n index += 2;\n\n // !== and ===\n if (source.charCodeAt(index) === 0x3D) {\n ++index;\n }\n return {\n type: Token.Punctuator,\n value: source.slice(start, index),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n }\n }\n\n // 4-character punctuator: >>>=\n\n ch4 = source.substr(index, 4);\n\n if (ch4 === '>>>=') {\n index += 4;\n return {\n type: Token.Punctuator,\n value: ch4,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 3-character punctuators: === !== >>> <<= >>=\n\n ch3 = ch4.substr(0, 3);\n\n if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {\n index += 3;\n return {\n type: Token.Punctuator,\n value: ch3,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // Other 2-character punctuators: ++ -- << >> && ||\n ch2 = ch3.substr(0, 2);\n\n if ((ch1 === ch2[1] && ('+-<>&|'.indexOf(ch1) >= 0)) || ch2 === '=>') {\n index += 2;\n return {\n type: Token.Punctuator,\n value: ch2,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 1-character punctuators: < > = ! + - * % & | ^ /\n if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n ++index;\n return {\n type: Token.Punctuator,\n value: ch1,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n // 7.8.3 Numeric Literals\n\n function scanHexLiteral(start) {\n var number = '';\n\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (number.length === 0) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt('0x' + number, 16),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function scanOctalLiteral(start) {\n var number = '0' + source[index++];\n while (index < length) {\n if (!isOctalDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt(number, 8),\n octal: true,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function isImplicitOctalLiteral() {\n var i, ch;\n\n // Implicit octal, unless there is a non-octal digit.\n // (Annex B.1.1 on Numeric Literals)\n for (i = index + 1; i < length; ++i) {\n ch = source[i];\n if (ch === '8' || ch === '9') {\n return false;\n }\n if (!isOctalDigit(ch)) {\n return true;\n }\n }\n\n return true;\n }\n\n function scanNumericLiteral() {\n var number, start, ch;\n\n ch = source[index];\n assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),\n 'Numeric literal must start with a decimal digit or a decimal point');\n\n start = index;\n number = '';\n if (ch !== '.') {\n number = source[index++];\n ch = source[index];\n\n // Hex number starts with '0x'.\n // Octal number starts with '0'.\n if (number === '0') {\n if (ch === 'x' || ch === 'X') {\n ++index;\n return scanHexLiteral(start);\n }\n if (isOctalDigit(ch)) {\n if (isImplicitOctalLiteral()) {\n return scanOctalLiteral(start);\n }\n }\n }\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === '.') {\n number += source[index++];\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === 'e' || ch === 'E') {\n number += source[index++];\n\n ch = source[index];\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n if (isDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseFloat(number),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 7.8.4 String Literals\n\n function scanStringLiteral() {\n var str = '', quote, start, ch, code, unescaped, restore, octal = false, startLineNumber, startLineStart;\n startLineNumber = lineNumber;\n startLineStart = lineStart;\n\n quote = source[index];\n assert((quote === '\\'' || quote === '\"'),\n 'String literal must starts with a quote');\n\n start = index;\n ++index;\n\n while (index < length) {\n ch = source[index++];\n\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'u':\n case 'x':\n restore = index;\n unescaped = scanHexEscape(ch);\n if (unescaped) {\n str += unescaped;\n } else {\n index = restore;\n str += ch;\n }\n break;\n case 'n':\n str += '\\n';\n break;\n case 'r':\n str += '\\r';\n break;\n case 't':\n str += '\\t';\n break;\n case 'b':\n str += '\\b';\n break;\n case 'f':\n str += '\\f';\n break;\n case 'v':\n str += '\\x0B';\n break;\n\n default:\n if (isOctalDigit(ch)) {\n code = '01234567'.indexOf(ch);\n\n // \\0 is not octal escape sequence\n if (code !== 0) {\n octal = true;\n }\n\n if (index < length && isOctalDigit(source[index])) {\n octal = true;\n code = code * 8 + '01234567'.indexOf(source[index++]);\n\n // 3 digits are only allowed when string starts\n // with 0, 1, 2, 3\n if ('0123'.indexOf(ch) >= 0 &&\n index < length &&\n isOctalDigit(source[index])) {\n code = code * 8 + '01234567'.indexOf(source[index++]);\n }\n }\n str += String.fromCharCode(code);\n } else {\n str += ch;\n }\n break;\n }\n } else {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n\n if (quote !== '') {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.StringLiteral,\n value: str,\n octal: octal,\n startLineNumber: startLineNumber,\n startLineStart: startLineStart,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function testRegExp(pattern, flags) {\n var value;\n try {\n value = new RegExp(pattern, flags);\n } catch (e) {\n throwError({}, Messages.InvalidRegExp);\n }\n return value;\n }\n\n function scanRegExpBody() {\n var ch, str, classMarker, terminated, body;\n\n ch = source[index];\n assert(ch === '/', 'Regular expression literal must start with a slash');\n str = source[index++];\n\n classMarker = false;\n terminated = false;\n while (index < length) {\n ch = source[index++];\n str += ch;\n if (ch === '\\\\') {\n ch = source[index++];\n // ECMA-262 7.8.5\n if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, Messages.UnterminatedRegExp);\n }\n str += ch;\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, Messages.UnterminatedRegExp);\n } else if (classMarker) {\n if (ch === ']') {\n classMarker = false;\n }\n } else {\n if (ch === '/') {\n terminated = true;\n break;\n } else if (ch === '[') {\n classMarker = true;\n }\n }\n }\n\n if (!terminated) {\n throwError({}, Messages.UnterminatedRegExp);\n }\n\n // Exclude leading and trailing slash.\n body = str.substr(1, str.length - 2);\n return {\n value: body,\n literal: str\n };\n }\n\n function scanRegExpFlags() {\n var ch, str, flags, restore;\n\n str = '';\n flags = '';\n while (index < length) {\n ch = source[index];\n if (!isIdentifierPart(ch.charCodeAt(0))) {\n break;\n }\n\n ++index;\n if (ch === '\\\\' && index < length) {\n ch = source[index];\n if (ch === 'u') {\n ++index;\n restore = index;\n ch = scanHexEscape('u');\n if (ch) {\n flags += ch;\n for (str += '\\\\u'; restore < index; ++restore) {\n str += source[restore];\n }\n } else {\n index = restore;\n flags += 'u';\n str += '\\\\u';\n }\n throwErrorTolerant({}, Messages.UnexpectedToken, 'ILLEGAL');\n } else {\n str += '\\\\';\n throwErrorTolerant({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n } else {\n flags += ch;\n str += ch;\n }\n }\n\n return {\n value: flags,\n literal: str\n };\n }\n\n function scanRegExp() {\n var start, body, flags, pattern, value;\n\n lookahead = null;\n skipComment();\n start = index;\n\n body = scanRegExpBody();\n flags = scanRegExpFlags();\n value = testRegExp(body.value, flags.value);\n\n if (extra.tokenize) {\n return {\n type: Token.RegularExpression,\n value: value,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n return {\n literal: body.literal + flags.literal,\n value: value,\n start: start,\n end: index\n };\n }\n\n function collectRegex() {\n var pos, loc, regex, token;\n\n skipComment();\n\n pos = index;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart\n }\n };\n\n regex = scanRegExp();\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n\n /* istanbul ignore next */\n if (!extra.tokenize) {\n // Pop the previous token, which is likely '/' or '/='\n if (extra.tokens.length > 0) {\n token = extra.tokens[extra.tokens.length - 1];\n if (token.range[0] === pos && token.type === 'Punctuator') {\n if (token.value === '/' || token.value === '/=') {\n extra.tokens.pop();\n }\n }\n }\n\n extra.tokens.push({\n type: 'RegularExpression',\n value: regex.literal,\n range: [pos, index],\n loc: loc\n });\n }\n\n return regex;\n }\n\n function isIdentifierName(token) {\n return token.type === Token.Identifier ||\n token.type === Token.Keyword ||\n token.type === Token.BooleanLiteral ||\n token.type === Token.NullLiteral;\n }\n\n function advanceSlash() {\n var prevToken,\n checkToken;\n // Using the following algorithm:\n // https://github.com/mozilla/sweet.js/wiki/design\n prevToken = extra.tokens[extra.tokens.length - 1];\n if (!prevToken) {\n // Nothing before that: it cannot be a division.\n return collectRegex();\n }\n if (prevToken.type === 'Punctuator') {\n if (prevToken.value === ']') {\n return scanPunctuator();\n }\n if (prevToken.value === ')') {\n checkToken = extra.tokens[extra.openParenToken - 1];\n if (checkToken &&\n checkToken.type === 'Keyword' &&\n (checkToken.value === 'if' ||\n checkToken.value === 'while' ||\n checkToken.value === 'for' ||\n checkToken.value === 'with')) {\n return collectRegex();\n }\n return scanPunctuator();\n }\n if (prevToken.value === '}') {\n // Dividing a function by anything makes little sense,\n // but we have to check for that.\n if (extra.tokens[extra.openCurlyToken - 3] &&\n extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') {\n // Anonymous function.\n checkToken = extra.tokens[extra.openCurlyToken - 4];\n if (!checkToken) {\n return scanPunctuator();\n }\n } else if (extra.tokens[extra.openCurlyToken - 4] &&\n extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') {\n // Named function.\n checkToken = extra.tokens[extra.openCurlyToken - 5];\n if (!checkToken) {\n return collectRegex();\n }\n } else {\n return scanPunctuator();\n }\n // checkToken determines whether the function is\n // a declaration or an expression.\n if (FnExprTokens.indexOf(checkToken.value) >= 0) {\n // It is an expression.\n return scanPunctuator();\n }\n // It is a declaration.\n return collectRegex();\n }\n return collectRegex();\n }\n if (prevToken.type === 'Keyword' && prevToken.value !== 'this') {\n return collectRegex();\n }\n return scanPunctuator();\n }\n\n function advance() {\n var ch;\n\n skipComment();\n\n if (index >= length) {\n return {\n type: Token.EOF,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: index,\n end: index\n };\n }\n\n ch = source.charCodeAt(index);\n\n if (isIdentifierStart(ch)) {\n return scanIdentifier();\n }\n\n // Very common: ( and ) and ;\n if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {\n return scanPunctuator();\n }\n\n // String literal starts with single quote (U+0027) or double quote (U+0022).\n if (ch === 0x27 || ch === 0x22) {\n return scanStringLiteral();\n }\n\n\n // Dot (.) U+002E can also start a floating-point number, hence the need\n // to check the next character.\n if (ch === 0x2E) {\n if (isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNumericLiteral();\n }\n return scanPunctuator();\n }\n\n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n\n // Slash (/) U+002F can also start a regex.\n if (extra.tokenize && ch === 0x2F) {\n return advanceSlash();\n }\n\n return scanPunctuator();\n }\n\n function collectToken() {\n var loc, token, range, value;\n\n skipComment();\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart\n }\n };\n\n token = advance();\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n\n if (token.type !== Token.EOF) {\n value = source.slice(token.start, token.end);\n extra.tokens.push({\n type: TokenName[token.type],\n value: value,\n range: [token.start, token.end],\n loc: loc\n });\n }\n\n return token;\n }\n\n function lex() {\n var token;\n\n token = lookahead;\n index = token.end;\n lineNumber = token.lineNumber;\n lineStart = token.lineStart;\n\n lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();\n\n index = token.end;\n lineNumber = token.lineNumber;\n lineStart = token.lineStart;\n\n return token;\n }\n\n function peek() {\n var pos, line, start;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();\n index = pos;\n lineNumber = line;\n lineStart = start;\n }\n\n function Position(line, column) {\n this.line = line;\n this.column = column;\n }\n\n function SourceLocation(startLine, startColumn, line, column) {\n this.start = new Position(startLine, startColumn);\n this.end = new Position(line, column);\n }\n\n SyntaxTreeDelegate = {\n\n name: 'SyntaxTree',\n\n processComment: function (node) {\n var lastChild, trailingComments;\n\n if (node.type === Syntax.Program) {\n if (node.body.length > 0) {\n return;\n }\n }\n\n if (extra.trailingComments.length > 0) {\n if (extra.trailingComments[0].range[0] >= node.range[1]) {\n trailingComments = extra.trailingComments;\n extra.trailingComments = [];\n } else {\n extra.trailingComments.length = 0;\n }\n } else {\n if (extra.bottomRightStack.length > 0 &&\n extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments &&\n extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments[0].range[0] >= node.range[1]) {\n trailingComments = extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments;\n delete extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments;\n }\n }\n\n // Eating the stack.\n while (extra.bottomRightStack.length > 0 && extra.bottomRightStack[extra.bottomRightStack.length - 1].range[0] >= node.range[0]) {\n lastChild = extra.bottomRightStack.pop();\n }\n\n if (lastChild) {\n if (lastChild.leadingComments && lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= node.range[0]) {\n node.leadingComments = lastChild.leadingComments;\n delete lastChild.leadingComments;\n }\n } else if (extra.leadingComments.length > 0 && extra.leadingComments[extra.leadingComments.length - 1].range[1] <= node.range[0]) {\n node.leadingComments = extra.leadingComments;\n extra.leadingComments = [];\n }\n\n\n if (trailingComments) {\n node.trailingComments = trailingComments;\n }\n\n extra.bottomRightStack.push(node);\n },\n\n markEnd: function (node, startToken) {\n if (extra.range) {\n node.range = [startToken.start, index];\n }\n if (extra.loc) {\n node.loc = new SourceLocation(\n startToken.startLineNumber === undefined ? startToken.lineNumber : startToken.startLineNumber,\n startToken.start - (startToken.startLineStart === undefined ? startToken.lineStart : startToken.startLineStart),\n lineNumber,\n index - lineStart\n );\n this.postProcess(node);\n }\n\n if (extra.attachComment) {\n this.processComment(node);\n }\n return node;\n },\n\n postProcess: function (node) {\n if (extra.source) {\n node.loc.source = extra.source;\n }\n return node;\n },\n\n createArrayExpression: function (elements) {\n return {\n type: Syntax.ArrayExpression,\n elements: elements\n };\n },\n\n createAssignmentExpression: function (operator, left, right) {\n return {\n type: Syntax.AssignmentExpression,\n operator: operator,\n left: left,\n right: right\n };\n },\n\n createBinaryExpression: function (operator, left, right) {\n var type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression :\n Syntax.BinaryExpression;\n return {\n type: type,\n operator: operator,\n left: left,\n right: right\n };\n },\n\n createBlockStatement: function (body) {\n return {\n type: Syntax.BlockStatement,\n body: body\n };\n },\n\n createBreakStatement: function (label) {\n return {\n type: Syntax.BreakStatement,\n label: label\n };\n },\n\n createCallExpression: function (callee, args) {\n return {\n type: Syntax.CallExpression,\n callee: callee,\n 'arguments': args\n };\n },\n\n createCatchClause: function (param, body) {\n return {\n type: Syntax.CatchClause,\n param: param,\n body: body\n };\n },\n\n createConditionalExpression: function (test, consequent, alternate) {\n return {\n type: Syntax.ConditionalExpression,\n test: test,\n consequent: consequent,\n alternate: alternate\n };\n },\n\n createContinueStatement: function (label) {\n return {\n type: Syntax.ContinueStatement,\n label: label\n };\n },\n\n createDebuggerStatement: function () {\n return {\n type: Syntax.DebuggerStatement\n };\n },\n\n createDoWhileStatement: function (body, test) {\n return {\n type: Syntax.DoWhileStatement,\n body: body,\n test: test\n };\n },\n\n createEmptyStatement: function () {\n return {\n type: Syntax.EmptyStatement\n };\n },\n\n createExpressionStatement: function (expression) {\n return {\n type: Syntax.ExpressionStatement,\n expression: expression\n };\n },\n\n createForStatement: function (init, test, update, body) {\n return {\n type: Syntax.ForStatement,\n init: init,\n test: test,\n update: update,\n body: body\n };\n },\n\n createForInStatement: function (left, right, body) {\n return {\n type: Syntax.ForInStatement,\n left: left,\n right: right,\n body: body,\n each: false\n };\n },\n\n createFunctionDeclaration: function (id, params, defaults, body) {\n return {\n type: Syntax.FunctionDeclaration,\n id: id,\n params: params,\n defaults: defaults,\n body: body,\n rest: null,\n generator: false,\n expression: false\n };\n },\n\n createFunctionExpression: function (id, params, defaults, body) {\n return {\n type: Syntax.FunctionExpression,\n id: id,\n params: params,\n defaults: defaults,\n body: body,\n rest: null,\n generator: false,\n expression: false\n };\n },\n\n createIdentifier: function (name) {\n return {\n type: Syntax.Identifier,\n name: name\n };\n },\n\n createIfStatement: function (test, consequent, alternate) {\n return {\n type: Syntax.IfStatement,\n test: test,\n consequent: consequent,\n alternate: alternate\n };\n },\n\n createLabeledStatement: function (label, body) {\n return {\n type: Syntax.LabeledStatement,\n label: label,\n body: body\n };\n },\n\n createLiteral: function (token) {\n return {\n type: Syntax.Literal,\n value: token.value,\n raw: source.slice(token.start, token.end)\n };\n },\n\n createMemberExpression: function (accessor, object, property) {\n return {\n type: Syntax.MemberExpression,\n computed: accessor === '[',\n object: object,\n property: property\n };\n },\n\n createNewExpression: function (callee, args) {\n return {\n type: Syntax.NewExpression,\n callee: callee,\n 'arguments': args\n };\n },\n\n createObjectExpression: function (properties) {\n return {\n type: Syntax.ObjectExpression,\n properties: properties\n };\n },\n\n createPostfixExpression: function (operator, argument) {\n return {\n type: Syntax.UpdateExpression,\n operator: operator,\n argument: argument,\n prefix: false\n };\n },\n\n createProgram: function (body) {\n return {\n type: Syntax.Program,\n body: body\n };\n },\n\n createProperty: function (kind, key, value) {\n return {\n type: Syntax.Property,\n key: key,\n value: value,\n kind: kind\n };\n },\n\n createReturnStatement: function (argument) {\n return {\n type: Syntax.ReturnStatement,\n argument: argument\n };\n },\n\n createSequenceExpression: function (expressions) {\n return {\n type: Syntax.SequenceExpression,\n expressions: expressions\n };\n },\n\n createSwitchCase: function (test, consequent) {\n return {\n type: Syntax.SwitchCase,\n test: test,\n consequent: consequent\n };\n },\n\n createSwitchStatement: function (discriminant, cases) {\n return {\n type: Syntax.SwitchStatement,\n discriminant: discriminant,\n cases: cases\n };\n },\n\n createThisExpression: function () {\n return {\n type: Syntax.ThisExpression\n };\n },\n\n createThrowStatement: function (argument) {\n return {\n type: Syntax.ThrowStatement,\n argument: argument\n };\n },\n\n createTryStatement: function (block, guardedHandlers, handlers, finalizer) {\n return {\n type: Syntax.TryStatement,\n block: block,\n guardedHandlers: guardedHandlers,\n handlers: handlers,\n finalizer: finalizer\n };\n },\n\n createUnaryExpression: function (operator, argument) {\n if (operator === '++' || operator === '--') {\n return {\n type: Syntax.UpdateExpression,\n operator: operator,\n argument: argument,\n prefix: true\n };\n }\n return {\n type: Syntax.UnaryExpression,\n operator: operator,\n argument: argument,\n prefix: true\n };\n },\n\n createVariableDeclaration: function (declarations, kind) {\n return {\n type: Syntax.VariableDeclaration,\n declarations: declarations,\n kind: kind\n };\n },\n\n createVariableDeclarator: function (id, init) {\n return {\n type: Syntax.VariableDeclarator,\n id: id,\n init: init\n };\n },\n\n createWhileStatement: function (test, body) {\n return {\n type: Syntax.WhileStatement,\n test: test,\n body: body\n };\n },\n\n createWithStatement: function (object, body) {\n return {\n type: Syntax.WithStatement,\n object: object,\n body: body\n };\n }\n };\n\n // Return true if there is a line terminator before the next token.\n\n function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }\n\n // Throw an exception\n\n function throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(\n /%(\\d)/g,\n function (whole, index) {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n }\n );\n\n if (typeof token.lineNumber === 'number') {\n error = new Error('Line ' + token.lineNumber + ': ' + msg);\n error.index = token.start;\n error.lineNumber = token.lineNumber;\n error.column = token.start - lineStart + 1;\n } else {\n error = new Error('Line ' + lineNumber + ': ' + msg);\n error.index = index;\n error.lineNumber = lineNumber;\n error.column = index - lineStart + 1;\n }\n\n error.description = msg;\n throw error;\n }\n\n function throwErrorTolerant() {\n try {\n throwError.apply(null, arguments);\n } catch (e) {\n if (extra.errors) {\n extra.errors.push(e);\n } else {\n throw e;\n }\n }\n }\n\n\n // Throw an exception because of the token.\n\n function throwUnexpected(token) {\n if (token.type === Token.EOF) {\n throwError(token, Messages.UnexpectedEOS);\n }\n\n if (token.type === Token.NumericLiteral) {\n throwError(token, Messages.UnexpectedNumber);\n }\n\n if (token.type === Token.StringLiteral) {\n throwError(token, Messages.UnexpectedString);\n }\n\n if (token.type === Token.Identifier) {\n throwError(token, Messages.UnexpectedIdentifier);\n }\n\n if (token.type === Token.Keyword) {\n if (isFutureReservedWord(token.value)) {\n throwError(token, Messages.UnexpectedReserved);\n } else if (strict && isStrictModeReservedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictReservedWord);\n return;\n }\n throwError(token, Messages.UnexpectedToken, token.value);\n }\n\n // BooleanLiteral, NullLiteral, or Punctuator.\n throwError(token, Messages.UnexpectedToken, token.value);\n }\n\n // Expect the next token to match the specified punctuator.\n // If not, an exception will be thrown.\n\n function expect(value) {\n var token = lex();\n if (token.type !== Token.Punctuator || token.value !== value) {\n throwUnexpected(token);\n }\n }\n\n // Expect the next token to match the specified keyword.\n // If not, an exception will be thrown.\n\n function expectKeyword(keyword) {\n var token = lex();\n if (token.type !== Token.Keyword || token.value !== keyword) {\n throwUnexpected(token);\n }\n }\n\n // Return true if the next token matches the specified punctuator.\n\n function match(value) {\n return lookahead.type === Token.Punctuator && lookahead.value === value;\n }\n\n // Return true if the next token matches the specified keyword\n\n function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }\n\n // Return true if the next token is an assignment operator\n\n function matchAssign() {\n var op;\n\n if (lookahead.type !== Token.Punctuator) {\n return false;\n }\n op = lookahead.value;\n return op === '=' ||\n op === '*=' ||\n op === '/=' ||\n op === '%=' ||\n op === '+=' ||\n op === '-=' ||\n op === '<<=' ||\n op === '>>=' ||\n op === '>>>=' ||\n op === '&=' ||\n op === '^=' ||\n op === '|=';\n }\n\n function consumeSemicolon() {\n var line, oldIndex = index, oldLineNumber = lineNumber,\n oldLineStart = lineStart, oldLookahead = lookahead;\n\n // Catch the very common case first: immediately a semicolon (U+003B).\n if (source.charCodeAt(index) === 0x3B || match(';')) {\n lex();\n return;\n }\n\n line = lineNumber;\n skipComment();\n if (lineNumber !== line) {\n index = oldIndex;\n lineNumber = oldLineNumber;\n lineStart = oldLineStart;\n lookahead = oldLookahead;\n return;\n }\n\n if (lookahead.type !== Token.EOF && !match('}')) {\n throwUnexpected(lookahead);\n }\n }\n\n // Return true if provided expression is LeftHandSideExpression\n\n function isLeftHandSide(expr) {\n return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression;\n }\n\n // 11.1.4 Array Initialiser\n\n function parseArrayInitialiser() {\n var elements = [], startToken;\n\n startToken = lookahead;\n expect('[');\n\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elements.push(parseAssignmentExpression());\n\n if (!match(']')) {\n expect(',');\n }\n }\n }\n\n lex();\n\n return delegate.markEnd(delegate.createArrayExpression(elements), startToken);\n }\n\n // 11.1.5 Object Initialiser\n\n function parsePropertyFunction(param, first) {\n var previousStrict, body, startToken;\n\n previousStrict = strict;\n startToken = lookahead;\n body = parseFunctionSourceElements();\n if (first && strict && isRestrictedWord(param[0].name)) {\n throwErrorTolerant(first, Messages.StrictParamName);\n }\n strict = previousStrict;\n return delegate.markEnd(delegate.createFunctionExpression(null, param, [], body), startToken);\n }\n\n function parseObjectPropertyKey() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n\n if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) {\n if (strict && token.octal) {\n throwErrorTolerant(token, Messages.StrictOctalLiteral);\n }\n return delegate.markEnd(delegate.createLiteral(token), startToken);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseObjectProperty() {\n var token, key, id, value, param, startToken;\n\n token = lookahead;\n startToken = lookahead;\n\n if (token.type === Token.Identifier) {\n\n id = parseObjectPropertyKey();\n\n // Property Assignment: Getter and Setter.\n\n if (token.value === 'get' && !match(':')) {\n key = parseObjectPropertyKey();\n expect('(');\n expect(')');\n value = parsePropertyFunction([]);\n return delegate.markEnd(delegate.createProperty('get', key, value), startToken);\n }\n if (token.value === 'set' && !match(':')) {\n key = parseObjectPropertyKey();\n expect('(');\n token = lookahead;\n if (token.type !== Token.Identifier) {\n expect(')');\n throwErrorTolerant(token, Messages.UnexpectedToken, token.value);\n value = parsePropertyFunction([]);\n } else {\n param = [ parseVariableIdentifier() ];\n expect(')');\n value = parsePropertyFunction(param, token);\n }\n return delegate.markEnd(delegate.createProperty('set', key, value), startToken);\n }\n expect(':');\n value = parseAssignmentExpression();\n return delegate.markEnd(delegate.createProperty('init', id, value), startToken);\n }\n if (token.type === Token.EOF || token.type === Token.Punctuator) {\n throwUnexpected(token);\n } else {\n key = parseObjectPropertyKey();\n expect(':');\n value = parseAssignmentExpression();\n return delegate.markEnd(delegate.createProperty('init', key, value), startToken);\n }\n }\n\n function parseObjectInitialiser() {\n var properties = [], property, name, key, kind, map = {}, toString = String, startToken;\n\n startToken = lookahead;\n\n expect('{');\n\n while (!match('}')) {\n property = parseObjectProperty();\n\n if (property.key.type === Syntax.Identifier) {\n name = property.key.name;\n } else {\n name = toString(property.key.value);\n }\n kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set;\n\n key = '$' + name;\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n if (map[key] === PropertyKind.Data) {\n if (strict && kind === PropertyKind.Data) {\n throwErrorTolerant({}, Messages.StrictDuplicateProperty);\n } else if (kind !== PropertyKind.Data) {\n throwErrorTolerant({}, Messages.AccessorDataProperty);\n }\n } else {\n if (kind === PropertyKind.Data) {\n throwErrorTolerant({}, Messages.AccessorDataProperty);\n } else if (map[key] & kind) {\n throwErrorTolerant({}, Messages.AccessorGetSet);\n }\n }\n map[key] |= kind;\n } else {\n map[key] = kind;\n }\n\n properties.push(property);\n\n if (!match('}')) {\n expect(',');\n }\n }\n\n expect('}');\n\n return delegate.markEnd(delegate.createObjectExpression(properties), startToken);\n }\n\n // 11.1.6 The Grouping Operator\n\n function parseGroupExpression() {\n var expr;\n\n expect('(');\n\n expr = parseExpression();\n\n expect(')');\n\n return expr;\n }\n\n\n // 11.1 Primary Expressions\n\n function parsePrimaryExpression() {\n var type, token, expr, startToken;\n\n if (match('(')) {\n return parseGroupExpression();\n }\n\n if (match('[')) {\n return parseArrayInitialiser();\n }\n\n if (match('{')) {\n return parseObjectInitialiser();\n }\n\n type = lookahead.type;\n startToken = lookahead;\n\n if (type === Token.Identifier) {\n expr = delegate.createIdentifier(lex().value);\n } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {\n if (strict && lookahead.octal) {\n throwErrorTolerant(lookahead, Messages.StrictOctalLiteral);\n }\n expr = delegate.createLiteral(lex());\n } else if (type === Token.Keyword) {\n if (matchKeyword('function')) {\n return parseFunctionExpression();\n }\n if (matchKeyword('this')) {\n lex();\n expr = delegate.createThisExpression();\n } else {\n throwUnexpected(lex());\n }\n } else if (type === Token.BooleanLiteral) {\n token = lex();\n token.value = (token.value === 'true');\n expr = delegate.createLiteral(token);\n } else if (type === Token.NullLiteral) {\n token = lex();\n token.value = null;\n expr = delegate.createLiteral(token);\n } else if (match('/') || match('/=')) {\n if (typeof extra.tokens !== 'undefined') {\n expr = delegate.createLiteral(collectRegex());\n } else {\n expr = delegate.createLiteral(scanRegExp());\n }\n peek();\n } else {\n throwUnexpected(lex());\n }\n\n return delegate.markEnd(expr, startToken);\n }\n\n // 11.2 Left-Hand-Side Expressions\n\n function parseArguments() {\n var args = [];\n\n expect('(');\n\n if (!match(')')) {\n while (index < length) {\n args.push(parseAssignmentExpression());\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return args;\n }\n\n function parseNonComputedProperty() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n if (!isIdentifierName(token)) {\n throwUnexpected(token);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseNonComputedMember() {\n expect('.');\n\n return parseNonComputedProperty();\n }\n\n function parseComputedMember() {\n var expr;\n\n expect('[');\n\n expr = parseExpression();\n\n expect(']');\n\n return expr;\n }\n\n function parseNewExpression() {\n var callee, args, startToken;\n\n startToken = lookahead;\n expectKeyword('new');\n callee = parseLeftHandSideExpression();\n args = match('(') ? parseArguments() : [];\n\n return delegate.markEnd(delegate.createNewExpression(callee, args), startToken);\n }\n\n function parseLeftHandSideExpressionAllowCall() {\n var expr, args, property, startToken, previousAllowIn = state.allowIn;\n\n startToken = lookahead;\n state.allowIn = true;\n expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n\n for (;;) {\n if (match('.')) {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n } else if (match('(')) {\n args = parseArguments();\n expr = delegate.createCallExpression(expr, args);\n } else if (match('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else {\n break;\n }\n delegate.markEnd(expr, startToken);\n }\n state.allowIn = previousAllowIn;\n\n return expr;\n }\n\n function parseLeftHandSideExpression() {\n var expr, property, startToken;\n assert(state.allowIn, 'callee of new expression always allow in keyword.');\n\n startToken = lookahead;\n\n expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n\n while (match('.') || match('[')) {\n if (match('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n }\n delegate.markEnd(expr, startToken);\n }\n return expr;\n }\n\n // 11.3 Postfix Expressions\n\n function parsePostfixExpression() {\n var expr, token, startToken = lookahead;\n\n expr = parseLeftHandSideExpressionAllowCall();\n\n if (lookahead.type === Token.Punctuator) {\n if ((match('++') || match('--')) && !peekLineTerminator()) {\n // 11.3.1, 11.3.2\n if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n throwErrorTolerant({}, Messages.StrictLHSPostfix);\n }\n\n if (!isLeftHandSide(expr)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n token = lex();\n expr = delegate.markEnd(delegate.createPostfixExpression(token.value, expr), startToken);\n }\n }\n\n return expr;\n }\n\n // 11.4 Unary Operators\n\n function parseUnaryExpression() {\n var token, expr, startToken;\n\n if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {\n expr = parsePostfixExpression();\n } else if (match('++') || match('--')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n // 11.4.4, 11.4.5\n if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n throwErrorTolerant({}, Messages.StrictLHSPrefix);\n }\n\n if (!isLeftHandSide(expr)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n } else if (match('+') || match('-') || match('~') || match('!')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) {\n throwErrorTolerant({}, Messages.StrictDelete);\n }\n } else {\n expr = parsePostfixExpression();\n }\n\n return expr;\n }\n\n function binaryPrecedence(token, allowIn) {\n var prec = 0;\n\n if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {\n return 0;\n }\n\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n\n case '&&':\n prec = 2;\n break;\n\n case '|':\n prec = 3;\n break;\n\n case '^':\n prec = 4;\n break;\n\n case '&':\n prec = 5;\n break;\n\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n prec = 7;\n break;\n\n case 'in':\n prec = allowIn ? 7 : 0;\n break;\n\n case '<<':\n case '>>':\n case '>>>':\n prec = 8;\n break;\n\n case '+':\n case '-':\n prec = 9;\n break;\n\n case '*':\n case '/':\n case '%':\n prec = 11;\n break;\n\n default:\n break;\n }\n\n return prec;\n }\n\n // 11.5 Multiplicative Operators\n // 11.6 Additive Operators\n // 11.7 Bitwise Shift Operators\n // 11.8 Relational Operators\n // 11.9 Equality Operators\n // 11.10 Binary Bitwise Operators\n // 11.11 Binary Logical Operators\n\n function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers[markers.length - 1];\n delegate.markEnd(expr, marker);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n delegate.markEnd(expr, marker);\n }\n\n return expr;\n }\n\n\n // 11.12 Conditional Operator\n\n function parseConditionalExpression() {\n var expr, previousAllowIn, consequent, alternate, startToken;\n\n startToken = lookahead;\n\n expr = parseBinaryExpression();\n\n if (match('?')) {\n lex();\n previousAllowIn = state.allowIn;\n state.allowIn = true;\n consequent = parseAssignmentExpression();\n state.allowIn = previousAllowIn;\n expect(':');\n alternate = parseAssignmentExpression();\n\n expr = delegate.createConditionalExpression(expr, consequent, alternate);\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 11.13 Assignment Operators\n\n function parseAssignmentExpression() {\n var token, left, right, node, startToken;\n\n token = lookahead;\n startToken = lookahead;\n\n node = left = parseConditionalExpression();\n\n if (matchAssign()) {\n // LeftHandSideExpression\n if (!isLeftHandSide(left)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n // 11.13.1\n if (strict && left.type === Syntax.Identifier && isRestrictedWord(left.name)) {\n throwErrorTolerant(token, Messages.StrictLHSAssignment);\n }\n\n token = lex();\n right = parseAssignmentExpression();\n node = delegate.markEnd(delegate.createAssignmentExpression(token.value, left, right), startToken);\n }\n\n return node;\n }\n\n // 11.14 Comma Operator\n\n function parseExpression() {\n var expr, startToken = lookahead;\n\n expr = parseAssignmentExpression();\n\n if (match(',')) {\n expr = delegate.createSequenceExpression([ expr ]);\n\n while (index < length) {\n if (!match(',')) {\n break;\n }\n lex();\n expr.expressions.push(parseAssignmentExpression());\n }\n\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 12.1 Block\n\n function parseStatementList() {\n var list = [],\n statement;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n statement = parseSourceElement();\n if (typeof statement === 'undefined') {\n break;\n }\n list.push(statement);\n }\n\n return list;\n }\n\n function parseBlock() {\n var block, startToken;\n\n startToken = lookahead;\n expect('{');\n\n block = parseStatementList();\n\n expect('}');\n\n return delegate.markEnd(delegate.createBlockStatement(block), startToken);\n }\n\n // 12.2 Variable Statement\n\n function parseVariableIdentifier() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n if (token.type !== Token.Identifier) {\n throwUnexpected(token);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseVariableDeclaration(kind) {\n var init = null, id, startToken;\n\n startToken = lookahead;\n id = parseVariableIdentifier();\n\n // 12.2.1\n if (strict && isRestrictedWord(id.name)) {\n throwErrorTolerant({}, Messages.StrictVarName);\n }\n\n if (kind === 'const') {\n expect('=');\n init = parseAssignmentExpression();\n } else if (match('=')) {\n lex();\n init = parseAssignmentExpression();\n }\n\n return delegate.markEnd(delegate.createVariableDeclarator(id, init), startToken);\n }\n\n function parseVariableDeclarationList(kind) {\n var list = [];\n\n do {\n list.push(parseVariableDeclaration(kind));\n if (!match(',')) {\n break;\n }\n lex();\n } while (index < length);\n\n return list;\n }\n\n function parseVariableStatement() {\n var declarations;\n\n expectKeyword('var');\n\n declarations = parseVariableDeclarationList();\n\n consumeSemicolon();\n\n return delegate.createVariableDeclaration(declarations, 'var');\n }\n\n // kind may be `const` or `let`\n // Both are experimental and not in the specification yet.\n // see http://wiki.ecmascript.org/doku.php?id=harmony:const\n // and http://wiki.ecmascript.org/doku.php?id=harmony:let\n function parseConstLetDeclaration(kind) {\n var declarations, startToken;\n\n startToken = lookahead;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken);\n }\n\n // 12.3 Empty Statement\n\n function parseEmptyStatement() {\n expect(';');\n return delegate.createEmptyStatement();\n }\n\n // 12.4 Expression Statement\n\n function parseExpressionStatement() {\n var expr = parseExpression();\n consumeSemicolon();\n return delegate.createExpressionStatement(expr);\n }\n\n // 12.5 If statement\n\n function parseIfStatement() {\n var test, consequent, alternate;\n\n expectKeyword('if');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n consequent = parseStatement();\n\n if (matchKeyword('else')) {\n lex();\n alternate = parseStatement();\n } else {\n alternate = null;\n }\n\n return delegate.createIfStatement(test, consequent, alternate);\n }\n\n // 12.6 Iteration Statements\n\n function parseDoWhileStatement() {\n var body, test, oldInIteration;\n\n expectKeyword('do');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n expectKeyword('while');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n if (match(';')) {\n lex();\n }\n\n return delegate.createDoWhileStatement(body, test);\n }\n\n function parseWhileStatement() {\n var test, body, oldInIteration;\n\n expectKeyword('while');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n return delegate.createWhileStatement(test, body);\n }\n\n function parseForVariableDeclaration() {\n var token, declarations, startToken;\n\n startToken = lookahead;\n token = lex();\n declarations = parseVariableDeclarationList();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, token.value), startToken);\n }\n\n function parseForStatement() {\n var init, test, update, left, right, body, oldInIteration, previousAllowIn = state.allowIn;\n\n init = test = update = null;\n\n expectKeyword('for');\n\n expect('(');\n\n if (match(';')) {\n lex();\n } else {\n if (matchKeyword('var') || matchKeyword('let')) {\n state.allowIn = false;\n init = parseForVariableDeclaration();\n state.allowIn = previousAllowIn;\n\n if (init.declarations.length === 1 && matchKeyword('in')) {\n lex();\n left = init;\n right = parseExpression();\n init = null;\n }\n } else {\n state.allowIn = false;\n init = parseExpression();\n state.allowIn = previousAllowIn;\n\n if (matchKeyword('in')) {\n // LeftHandSideExpression\n if (!isLeftHandSide(init)) {\n throwErrorTolerant({}, Messages.InvalidLHSInForIn);\n }\n\n lex();\n left = init;\n right = parseExpression();\n init = null;\n }\n }\n\n if (typeof left === 'undefined') {\n expect(';');\n }\n }\n\n if (typeof left === 'undefined') {\n\n if (!match(';')) {\n test = parseExpression();\n }\n expect(';');\n\n if (!match(')')) {\n update = parseExpression();\n }\n }\n\n expect(')');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n return (typeof left === 'undefined') ?\n delegate.createForStatement(init, test, update, body) :\n delegate.createForInStatement(left, right, body);\n }\n\n // 12.7 The continue statement\n\n function parseContinueStatement() {\n var label = null, key;\n\n expectKeyword('continue');\n\n // Optimize the most common form: 'continue;'.\n if (source.charCodeAt(index) === 0x3B) {\n lex();\n\n if (!state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(null);\n }\n\n if (peekLineTerminator()) {\n if (!state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(null);\n }\n\n if (lookahead.type === Token.Identifier) {\n label = parseVariableIdentifier();\n\n key = '$' + label.name;\n if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.UnknownLabel, label.name);\n }\n }\n\n consumeSemicolon();\n\n if (label === null && !state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(label);\n }\n\n // 12.8 The break statement\n\n function parseBreakStatement() {\n var label = null, key;\n\n expectKeyword('break');\n\n // Catch the very common case first: immediately a semicolon (U+003B).\n if (source.charCodeAt(index) === 0x3B) {\n lex();\n\n if (!(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(null);\n }\n\n if (peekLineTerminator()) {\n if (!(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(null);\n }\n\n if (lookahead.type === Token.Identifier) {\n label = parseVariableIdentifier();\n\n key = '$' + label.name;\n if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.UnknownLabel, label.name);\n }\n }\n\n consumeSemicolon();\n\n if (label === null && !(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(label);\n }\n\n // 12.9 The return statement\n\n function parseReturnStatement() {\n var argument = null;\n\n expectKeyword('return');\n\n if (!state.inFunctionBody) {\n throwErrorTolerant({}, Messages.IllegalReturn);\n }\n\n // 'return' followed by a space and an identifier is very common.\n if (source.charCodeAt(index) === 0x20) {\n if (isIdentifierStart(source.charCodeAt(index + 1))) {\n argument = parseExpression();\n consumeSemicolon();\n return delegate.createReturnStatement(argument);\n }\n }\n\n if (peekLineTerminator()) {\n return delegate.createReturnStatement(null);\n }\n\n if (!match(';')) {\n if (!match('}') && lookahead.type !== Token.EOF) {\n argument = parseExpression();\n }\n }\n\n consumeSemicolon();\n\n return delegate.createReturnStatement(argument);\n }\n\n // 12.10 The with statement\n\n function parseWithStatement() {\n var object, body;\n\n if (strict) {\n // TODO(ikarienator): Should we update the test cases instead?\n skipComment();\n throwErrorTolerant({}, Messages.StrictModeWith);\n }\n\n expectKeyword('with');\n\n expect('(');\n\n object = parseExpression();\n\n expect(')');\n\n body = parseStatement();\n\n return delegate.createWithStatement(object, body);\n }\n\n // 12.10 The swith statement\n\n function parseSwitchCase() {\n var test, consequent = [], statement, startToken;\n\n startToken = lookahead;\n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n\n while (index < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n statement = parseStatement();\n consequent.push(statement);\n }\n\n return delegate.markEnd(delegate.createSwitchCase(test, consequent), startToken);\n }\n\n function parseSwitchStatement() {\n var discriminant, cases, clause, oldInSwitch, defaultFound;\n\n expectKeyword('switch');\n\n expect('(');\n\n discriminant = parseExpression();\n\n expect(')');\n\n expect('{');\n\n cases = [];\n\n if (match('}')) {\n lex();\n return delegate.createSwitchStatement(discriminant, cases);\n }\n\n oldInSwitch = state.inSwitch;\n state.inSwitch = true;\n defaultFound = false;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n clause = parseSwitchCase();\n if (clause.test === null) {\n if (defaultFound) {\n throwError({}, Messages.MultipleDefaultsInSwitch);\n }\n defaultFound = true;\n }\n cases.push(clause);\n }\n\n state.inSwitch = oldInSwitch;\n\n expect('}');\n\n return delegate.createSwitchStatement(discriminant, cases);\n }\n\n // 12.13 The throw statement\n\n function parseThrowStatement() {\n var argument;\n\n expectKeyword('throw');\n\n if (peekLineTerminator()) {\n throwError({}, Messages.NewlineAfterThrow);\n }\n\n argument = parseExpression();\n\n consumeSemicolon();\n\n return delegate.createThrowStatement(argument);\n }\n\n // 12.14 The try statement\n\n function parseCatchClause() {\n var param, body, startToken;\n\n startToken = lookahead;\n expectKeyword('catch');\n\n expect('(');\n if (match(')')) {\n throwUnexpected(lookahead);\n }\n\n param = parseVariableIdentifier();\n // 12.14.1\n if (strict && isRestrictedWord(param.name)) {\n throwErrorTolerant({}, Messages.StrictCatchVariable);\n }\n\n expect(')');\n body = parseBlock();\n return delegate.markEnd(delegate.createCatchClause(param, body), startToken);\n }\n\n function parseTryStatement() {\n var block, handlers = [], finalizer = null;\n\n expectKeyword('try');\n\n block = parseBlock();\n\n if (matchKeyword('catch')) {\n handlers.push(parseCatchClause());\n }\n\n if (matchKeyword('finally')) {\n lex();\n finalizer = parseBlock();\n }\n\n if (handlers.length === 0 && !finalizer) {\n throwError({}, Messages.NoCatchOrFinally);\n }\n\n return delegate.createTryStatement(block, [], handlers, finalizer);\n }\n\n // 12.15 The debugger statement\n\n function parseDebuggerStatement() {\n expectKeyword('debugger');\n\n consumeSemicolon();\n\n return delegate.createDebuggerStatement();\n }\n\n // 12 Statements\n\n function parseStatement() {\n var type = lookahead.type,\n expr,\n labeledBody,\n key,\n startToken;\n\n if (type === Token.EOF) {\n throwUnexpected(lookahead);\n }\n\n if (type === Token.Punctuator && lookahead.value === '{') {\n return parseBlock();\n }\n\n startToken = lookahead;\n\n if (type === Token.Punctuator) {\n switch (lookahead.value) {\n case ';':\n return delegate.markEnd(parseEmptyStatement(), startToken);\n case '(':\n return delegate.markEnd(parseExpressionStatement(), startToken);\n default:\n break;\n }\n }\n\n if (type === Token.Keyword) {\n switch (lookahead.value) {\n case 'break':\n return delegate.markEnd(parseBreakStatement(), startToken);\n case 'continue':\n return delegate.markEnd(parseContinueStatement(), startToken);\n case 'debugger':\n return delegate.markEnd(parseDebuggerStatement(), startToken);\n case 'do':\n return delegate.markEnd(parseDoWhileStatement(), startToken);\n case 'for':\n return delegate.markEnd(parseForStatement(), startToken);\n case 'function':\n return delegate.markEnd(parseFunctionDeclaration(), startToken);\n case 'if':\n return delegate.markEnd(parseIfStatement(), startToken);\n case 'return':\n return delegate.markEnd(parseReturnStatement(), startToken);\n case 'switch':\n return delegate.markEnd(parseSwitchStatement(), startToken);\n case 'throw':\n return delegate.markEnd(parseThrowStatement(), startToken);\n case 'try':\n return delegate.markEnd(parseTryStatement(), startToken);\n case 'var':\n return delegate.markEnd(parseVariableStatement(), startToken);\n case 'while':\n return delegate.markEnd(parseWhileStatement(), startToken);\n case 'with':\n return delegate.markEnd(parseWithStatement(), startToken);\n default:\n break;\n }\n }\n\n expr = parseExpression();\n\n // 12.12 Labelled Statements\n if ((expr.type === Syntax.Identifier) && match(':')) {\n lex();\n\n key = '$' + expr.name;\n if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.Redeclaration, 'Label', expr.name);\n }\n\n state.labelSet[key] = true;\n labeledBody = parseStatement();\n delete state.labelSet[key];\n return delegate.markEnd(delegate.createLabeledStatement(expr, labeledBody), startToken);\n }\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createExpressionStatement(expr), startToken);\n }\n\n // 13 Function Definition\n\n function parseFunctionSourceElements() {\n var sourceElement, sourceElements = [], token, directive, firstRestricted,\n oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, startToken;\n\n startToken = lookahead;\n expect('{');\n\n while (index < length) {\n if (lookahead.type !== Token.StringLiteral) {\n break;\n }\n token = lookahead;\n\n sourceElement = parseSourceElement();\n sourceElements.push(sourceElement);\n if (sourceElement.expression.type !== Syntax.Literal) {\n // this is not directive\n break;\n }\n directive = source.slice(token.start + 1, token.end - 1);\n if (directive === 'use strict') {\n strict = true;\n if (firstRestricted) {\n throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);\n }\n } else {\n if (!firstRestricted && token.octal) {\n firstRestricted = token;\n }\n }\n }\n\n oldLabelSet = state.labelSet;\n oldInIteration = state.inIteration;\n oldInSwitch = state.inSwitch;\n oldInFunctionBody = state.inFunctionBody;\n\n state.labelSet = {};\n state.inIteration = false;\n state.inSwitch = false;\n state.inFunctionBody = true;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n sourceElement = parseSourceElement();\n if (typeof sourceElement === 'undefined') {\n break;\n }\n sourceElements.push(sourceElement);\n }\n\n expect('}');\n\n state.labelSet = oldLabelSet;\n state.inIteration = oldInIteration;\n state.inSwitch = oldInSwitch;\n state.inFunctionBody = oldInFunctionBody;\n\n return delegate.markEnd(delegate.createBlockStatement(sourceElements), startToken);\n }\n\n function parseParams(firstRestricted) {\n var param, params = [], token, stricted, paramSet, key, message;\n expect('(');\n\n if (!match(')')) {\n paramSet = {};\n while (index < length) {\n token = lookahead;\n param = parseVariableIdentifier();\n key = '$' + token.value;\n if (strict) {\n if (isRestrictedWord(token.value)) {\n stricted = token;\n message = Messages.StrictParamName;\n }\n if (Object.prototype.hasOwnProperty.call(paramSet, key)) {\n stricted = token;\n message = Messages.StrictParamDupe;\n }\n } else if (!firstRestricted) {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictParamName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n } else if (Object.prototype.hasOwnProperty.call(paramSet, key)) {\n firstRestricted = token;\n message = Messages.StrictParamDupe;\n }\n }\n params.push(param);\n paramSet[key] = true;\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return {\n params: params,\n stricted: stricted,\n firstRestricted: firstRestricted,\n message: message\n };\n }\n\n function parseFunctionDeclaration() {\n var id, params = [], body, token, stricted, tmp, firstRestricted, message, previousStrict, startToken;\n\n startToken = lookahead;\n\n expectKeyword('function');\n token = lookahead;\n id = parseVariableIdentifier();\n if (strict) {\n if (isRestrictedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictFunctionName);\n }\n } else {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictFunctionName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n }\n }\n\n tmp = parseParams(firstRestricted);\n params = tmp.params;\n stricted = tmp.stricted;\n firstRestricted = tmp.firstRestricted;\n if (tmp.message) {\n message = tmp.message;\n }\n\n previousStrict = strict;\n body = parseFunctionSourceElements();\n if (strict && firstRestricted) {\n throwError(firstRestricted, message);\n }\n if (strict && stricted) {\n throwErrorTolerant(stricted, message);\n }\n strict = previousStrict;\n\n return delegate.markEnd(delegate.createFunctionDeclaration(id, params, [], body), startToken);\n }\n\n function parseFunctionExpression() {\n var token, id = null, stricted, firstRestricted, message, tmp, params = [], body, previousStrict, startToken;\n\n startToken = lookahead;\n expectKeyword('function');\n\n if (!match('(')) {\n token = lookahead;\n id = parseVariableIdentifier();\n if (strict) {\n if (isRestrictedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictFunctionName);\n }\n } else {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictFunctionName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n }\n }\n }\n\n tmp = parseParams(firstRestricted);\n params = tmp.params;\n stricted = tmp.stricted;\n firstRestricted = tmp.firstRestricted;\n if (tmp.message) {\n message = tmp.message;\n }\n\n previousStrict = strict;\n body = parseFunctionSourceElements();\n if (strict && firstRestricted) {\n throwError(firstRestricted, message);\n }\n if (strict && stricted) {\n throwErrorTolerant(stricted, message);\n }\n strict = previousStrict;\n\n return delegate.markEnd(delegate.createFunctionExpression(id, params, [], body), startToken);\n }\n\n // 14 Program\n\n function parseSourceElement() {\n if (lookahead.type === Token.Keyword) {\n switch (lookahead.value) {\n case 'const':\n case 'let':\n return parseConstLetDeclaration(lookahead.value);\n case 'function':\n return parseFunctionDeclaration();\n default:\n return parseStatement();\n }\n }\n\n if (lookahead.type !== Token.EOF) {\n return parseStatement();\n }\n }\n\n function parseSourceElements() {\n var sourceElement, sourceElements = [], token, directive, firstRestricted;\n\n while (index < length) {\n token = lookahead;\n if (token.type !== Token.StringLiteral) {\n break;\n }\n\n sourceElement = parseSourceElement();\n sourceElements.push(sourceElement);\n if (sourceElement.expression.type !== Syntax.Literal) {\n // this is not directive\n break;\n }\n directive = source.slice(token.start + 1, token.end - 1);\n if (directive === 'use strict') {\n strict = true;\n if (firstRestricted) {\n throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);\n }\n } else {\n if (!firstRestricted && token.octal) {\n firstRestricted = token;\n }\n }\n }\n\n while (index < length) {\n sourceElement = parseSourceElement();\n /* istanbul ignore if */\n if (typeof sourceElement === 'undefined') {\n break;\n }\n sourceElements.push(sourceElement);\n }\n return sourceElements;\n }\n\n function parseProgram() {\n var body, startToken;\n\n skipComment();\n peek();\n startToken = lookahead;\n strict = false;\n\n body = parseSourceElements();\n return delegate.markEnd(delegate.createProgram(body), startToken);\n }\n\n function filterTokenLocation() {\n var i, entry, token, tokens = [];\n\n for (i = 0; i < extra.tokens.length; ++i) {\n entry = extra.tokens[i];\n token = {\n type: entry.type,\n value: entry.value\n };\n if (extra.range) {\n token.range = entry.range;\n }\n if (extra.loc) {\n token.loc = entry.loc;\n }\n tokens.push(token);\n }\n\n extra.tokens = tokens;\n }\n\n function tokenize(code, options) {\n var toString,\n token,\n tokens;\n\n toString = String;\n if (typeof code !== 'string' && !(code instanceof String)) {\n code = toString(code);\n }\n\n delegate = SyntaxTreeDelegate;\n source = code;\n index = 0;\n lineNumber = (source.length > 0) ? 1 : 0;\n lineStart = 0;\n length = source.length;\n lookahead = null;\n state = {\n allowIn: true,\n labelSet: {},\n inFunctionBody: false,\n inIteration: false,\n inSwitch: false,\n lastCommentStart: -1\n };\n\n extra = {};\n\n // Options matching.\n options = options || {};\n\n // Of course we collect tokens here.\n options.tokens = true;\n extra.tokens = [];\n extra.tokenize = true;\n // The following two fields are necessary to compute the Regex tokens.\n extra.openParenToken = -1;\n extra.openCurlyToken = -1;\n\n extra.range = (typeof options.range === 'boolean') && options.range;\n extra.loc = (typeof options.loc === 'boolean') && options.loc;\n\n if (typeof options.comment === 'boolean' && options.comment) {\n extra.comments = [];\n }\n if (typeof options.tolerant === 'boolean' && options.tolerant) {\n extra.errors = [];\n }\n\n try {\n peek();\n if (lookahead.type === Token.EOF) {\n return extra.tokens;\n }\n\n token = lex();\n while (lookahead.type !== Token.EOF) {\n try {\n token = lex();\n } catch (lexError) {\n token = lookahead;\n if (extra.errors) {\n extra.errors.push(lexError);\n // We have to break on the first error\n // to avoid infinite loops.\n break;\n } else {\n throw lexError;\n }\n }\n }\n\n filterTokenLocation();\n tokens = extra.tokens;\n if (typeof extra.comments !== 'undefined') {\n tokens.comments = extra.comments;\n }\n if (typeof extra.errors !== 'undefined') {\n tokens.errors = extra.errors;\n }\n } catch (e) {\n throw e;\n } finally {\n extra = {};\n }\n return tokens;\n }\n\n function parse(code, options) {\n var program, toString;\n\n toString = String;\n if (typeof code !== 'string' && !(code instanceof String)) {\n code = toString(code);\n }\n\n delegate = SyntaxTreeDelegate;\n source = code;\n index = 0;\n lineNumber = (source.length > 0) ? 1 : 0;\n lineStart = 0;\n length = source.length;\n lookahead = null;\n state = {\n allowIn: true,\n labelSet: {},\n inFunctionBody: false,\n inIteration: false,\n inSwitch: false,\n lastCommentStart: -1\n };\n\n extra = {};\n if (typeof options !== 'undefined') {\n extra.range = (typeof options.range === 'boolean') && options.range;\n extra.loc = (typeof options.loc === 'boolean') && options.loc;\n extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment;\n\n if (extra.loc && options.source !== null && options.source !== undefined) {\n extra.source = toString(options.source);\n }\n\n if (typeof options.tokens === 'boolean' && options.tokens) {\n extra.tokens = [];\n }\n if (typeof options.comment === 'boolean' && options.comment) {\n extra.comments = [];\n }\n if (typeof options.tolerant === 'boolean' && options.tolerant) {\n extra.errors = [];\n }\n if (extra.attachComment) {\n extra.range = true;\n extra.comments = [];\n extra.bottomRightStack = [];\n extra.trailingComments = [];\n extra.leadingComments = [];\n }\n }\n\n try {\n program = parseProgram();\n if (typeof extra.comments !== 'undefined') {\n program.comments = extra.comments;\n }\n if (typeof extra.tokens !== 'undefined') {\n filterTokenLocation();\n program.tokens = extra.tokens;\n }\n if (typeof extra.errors !== 'undefined') {\n program.errors = extra.errors;\n }\n } catch (e) {\n throw e;\n } finally {\n extra = {};\n }\n\n return program;\n }\n\n // Sync with *.json manifests.\n exports.version = '1.2.5';\n\n exports.tokenize = tokenize;\n\n exports.parse = parse;\n\n // Deep copy.\n /* istanbul ignore next */\n exports.Syntax = (function () {\n var name, types = {};\n\n if (typeof Object.create === 'function') {\n types = Object.create(null);\n }\n\n for (name in Syntax) {\n if (Syntax.hasOwnProperty(name)) {\n types[name] = Syntax[name];\n }\n }\n\n if (typeof Object.freeze === 'function') {\n Object.freeze(types);\n }\n\n return types;\n }());\n\n}));\n/* vim: set sw=4 ts=4 et tw=80 : */\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","'use strict';\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n","\"use strict\"\n\nfunction iota(n) {\n var result = new Array(n)\n for(var i=0; i\n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","\"use strict\";\n// Initial software, Jean-Daniel Fekete, Christian Poli, Copyright (c) Inria, BSD 3-Clause License, 2021\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.decompress = void 0;\nconst pako = require(\"pako\");\nconst lz4 = require(\"lz4js\");\nexports.decompress = {\n zlib: (input) => {\n return pako.inflate(new Uint8Array(input)).buffer;\n },\n lz4: (input) => {\n return lz4.decompress(new Uint8Array(input)).buffer;\n },\n};\n//# sourceMappingURL=compression.js.map","\"use strict\";\n// Initial software, Jean-Daniel Fekete, Christian Poli, Copyright (c) Inria, BSD 3-Clause License, 2021\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = exports.decompress = exports.rowProxy = exports.table_serialization = exports.EchoTableWidgetView = exports.EchoTableWidgetModel = exports.TableWidgetModel = void 0;\nvar widgets_1 = require(\"./widgets\");\nObject.defineProperty(exports, \"TableWidgetModel\", { enumerable: true, get: function () { return widgets_1.TableWidgetModel; } });\nObject.defineProperty(exports, \"EchoTableWidgetModel\", { enumerable: true, get: function () { return widgets_1.EchoTableWidgetModel; } });\nObject.defineProperty(exports, \"EchoTableWidgetView\", { enumerable: true, get: function () { return widgets_1.EchoTableWidgetView; } });\nvar serializers_1 = require(\"./serializers\");\nObject.defineProperty(exports, \"table_serialization\", { enumerable: true, get: function () { return serializers_1.table_serialization; } });\nObject.defineProperty(exports, \"rowProxy\", { enumerable: true, get: function () { return serializers_1.rowProxy; } });\nvar compression_1 = require(\"./compression\");\nObject.defineProperty(exports, \"decompress\", { enumerable: true, get: function () { return compression_1.decompress; } });\nexports.version = require('../package.json').version;\n//# sourceMappingURL=index.js.map","\"use strict\";\n// Initial software, Jean-Daniel Fekete, Christian Poli, Copyright (c) Inria, BSD 3-Clause License, 2021\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.table_serialization = exports.tableToJSON = exports.rowProxy = exports.JSONToTable = void 0;\nconst ndarray = require(\"ndarray\");\nconst compression_1 = require(\"./compression\");\nconst dtypeToArray = {\n \"bool\": Uint8Array,\n int8: Int8Array,\n int16: Int16Array,\n int32: Int32Array,\n uint8: Uint8Array,\n uint16: Uint16Array,\n uint32: Uint32Array,\n float32: Float32Array,\n float64: Float64Array,\n str: Array\n};\nconst RowIndex = Symbol('rowIndex');\nfunction JSONToTable(obj, manager) {\n if (obj === null) {\n return null;\n }\n var data = {};\n var size = Infinity;\n let decoder = new TextDecoder(\"utf-8\");\n let buffer;\n for (const [col, val] of Object.entries(obj.data)) {\n // console.log(col, val);\n if (val.compression !== undefined) {\n let valBuffer = val.buffer;\n buffer = compression_1.decompress[val.compression](valBuffer.buffer);\n if (val.dtype === \"str\") {\n let u8buf = buffer;\n let strcol = decoder.decode(u8buf);\n let lstr = JSON.parse(strcol);\n data[col] = lstr;\n }\n else { //numeric\n data[col] = ndarray(new dtypeToArray[val.dtype](buffer), val.shape);\n size = Math.min(size, val.shape[0]);\n }\n }\n else { // no compression\n if (val.dtype === \"str\") {\n let lstr = val.buffer;\n data[col] = lstr;\n size = Math.min(size, lstr.length);\n }\n else { //numeric\n let valBuffer = val.buffer;\n data[col] = ndarray(new dtypeToArray[val.dtype](valBuffer.buffer), val.shape);\n size = Math.min(size, val.shape[0]);\n }\n }\n }\n var result = { columns: obj.columns, data: data, size: size };\n // console.log(\"result\", result);\n //let objFoo = obj.data.foo;\n return result;\n}\nexports.JSONToTable = JSONToTable;\nfunction rowProxy(table) {\n if (table === null) {\n return null;\n }\n var fields = table.columns;\n var proto = {};\n fields.forEach((name) => {\n const column = table.data[name];\n const arraycolumn = column;\n const stringcolumn = column;\n // skip columns with duplicate names\n if (proto.hasOwnProperty(name))\n return;\n if (arraycolumn.shape === undefined) {\n Object.defineProperty(proto, name, {\n get: function () {\n const i = this[RowIndex];\n return stringcolumn[i];\n },\n set: function () {\n throw Error('Arrow field values can not be overwritten.');\n },\n enumerable: true\n });\n }\n else {\n Object.defineProperty(proto, name, {\n get: function () {\n const i = this[RowIndex];\n const v = arraycolumn.get(i);\n return isNaN(v) ? null : v;\n },\n set: function () {\n throw Error('Arrow field values can not be overwritten.');\n },\n enumerable: true\n });\n }\n });\n return (i) => {\n var r = Object.create(proto);\n r[RowIndex] = i;\n return r;\n };\n}\nexports.rowProxy = rowProxy;\nfunction tableToJSON(obj, widget) {\n return null; // TODO: implement or remove ...\n}\nexports.tableToJSON = tableToJSON;\n/**\n * Serializers for to/from tables/dataframes\n */\nexports.table_serialization = { deserialize: JSONToTable, serialize: tableToJSON };\n//# sourceMappingURL=serializers.js.map","\"use strict\";\n// Initial software, Jean-Daniel Fekete, Christian Poli, Copyright (c) Inria, BSD 3-Clause License, 2021\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EchoTableWidgetView = exports.EchoTableWidgetModel = exports.TableWidgetModel = void 0;\nconst base_1 = require(\"@jupyter-widgets/base\");\nconst ndarray = require(\"ndarray\");\nconst ndarray_unpack = require(\"ndarray-unpack\");\nconst serializers_1 = require(\"./serializers\");\nlet version = require('../package.json').version;\nclass TableWidgetModel extends base_1.DOMWidgetModel {\n defaults() {\n return Object.assign(Object.assign({}, base_1.DOMWidgetModel.prototype.defaults()), { _model_name: \"TableWidgetModel\", _view_name: null, _model_module: 'jupyter-tablewidgets', _view_module: null, _model_module_version: version, _view_module_version: '', _table: ndarray([]), _columns: [] });\n }\n ;\n}\nexports.TableWidgetModel = TableWidgetModel;\nTableWidgetModel.serializers = Object.assign(Object.assign({}, base_1.DOMWidgetModel.serializers), { _table: serializers_1.table_serialization });\n// https://gist.github.com/pbugnion/63cf43b41ec0eed2d0b7e7426d1c67d2\nclass EchoTableWidgetModel extends base_1.DOMWidgetModel {\n defaults() {\n return Object.assign(Object.assign({}, base_1.DOMWidgetModel.prototype.defaults()), { _model_name: \"EchoTableWidgetModel\", _view_name: \"EchoTableWidgetView\", _model_module: 'jupyter-tablewidgets', _view_module: 'jupyter-tablewidgets', _model_module_version: version, _view_module_version: version, data: [], echo: [] });\n }\n ;\n}\nexports.EchoTableWidgetModel = EchoTableWidgetModel;\nEchoTableWidgetModel.serializers = Object.assign(Object.assign({}, base_1.DOMWidgetModel.serializers), { data: { deserialize: base_1.unpack_models } });\nclass EchoTableWidgetView extends base_1.DOMWidgetView {\n render() {\n return __awaiter(this, void 0, void 0, function* () {\n let that = this.model;\n let subwg = that.get(\"data\");\n let table = subwg.get(\"_table\");\n let res = { 'columns': table.columns, 'data': {} };\n for (const [col, v] of Object.entries(table.data)) {\n let val = v;\n if (val.dtype !== undefined) {\n res.data[col] = ndarray_unpack(val);\n }\n else {\n res.data[col] = val;\n }\n }\n that.set(\"echo\", res);\n this.touch();\n });\n }\n ;\n}\nexports.EchoTableWidgetView = EchoTableWidgetView;\n//# sourceMappingURL=widgets.js.map","// lz4.js - An implementation of Lz4 in plain JavaScript.\n//\n// TODO:\n// - Unify header parsing/writing.\n// - Support options (block size, checksums)\n// - Support streams\n// - Better error handling (handle bad offset, etc.)\n// - HC support (better search algorithm)\n// - Tests/benchmarking\n\nvar xxhash = require('./xxh32.js');\nvar util = require('./util.js');\n\n// Constants\n// --\n\n// Compression format parameters/constants.\nvar minMatch = 4;\nvar minLength = 13;\nvar searchLimit = 5;\nvar skipTrigger = 6;\nvar hashSize = 1 << 16;\n\n// Token constants.\nvar mlBits = 4;\nvar mlMask = (1 << mlBits) - 1;\nvar runBits = 4;\nvar runMask = (1 << runBits) - 1;\n\n// Shared buffers\nvar blockBuf = makeBuffer(5 << 20);\nvar hashTable = makeHashTable();\n\n// Frame constants.\nvar magicNum = 0x184D2204;\n\n// Frame descriptor flags.\nvar fdContentChksum = 0x4;\nvar fdContentSize = 0x8;\nvar fdBlockChksum = 0x10;\n// var fdBlockIndep = 0x20;\nvar fdVersion = 0x40;\nvar fdVersionMask = 0xC0;\n\n// Block sizes.\nvar bsUncompressed = 0x80000000;\nvar bsDefault = 7;\nvar bsShift = 4;\nvar bsMask = 7;\nvar bsMap = {\n 4: 0x10000,\n 5: 0x40000,\n 6: 0x100000,\n 7: 0x400000\n};\n\n// Utility functions/primitives\n// --\n\n// Makes our hashtable. On older browsers, may return a plain array.\nfunction makeHashTable () {\n try {\n return new Uint32Array(hashSize);\n } catch (error) {\n var hashTable = new Array(hashSize);\n\n for (var i = 0; i < hashSize; i++) {\n hashTable[i] = 0;\n }\n\n return hashTable;\n }\n}\n\n// Clear hashtable.\nfunction clearHashTable (table) {\n for (var i = 0; i < hashSize; i++) {\n hashTable[i] = 0;\n }\n}\n\n// Makes a byte buffer. On older browsers, may return a plain array.\nfunction makeBuffer (size) {\n try {\n return new Uint8Array(size);\n } catch (error) {\n var buf = new Array(size);\n\n for (var i = 0; i < size; i++) {\n buf[i] = 0;\n }\n\n return buf;\n }\n}\n\nfunction sliceArray (array, start, end) {\n if (typeof array.buffer !== undefined) {\n if (Uint8Array.prototype.slice) {\n return array.slice(start, end);\n } else {\n // Uint8Array#slice polyfill.\n var len = array.length;\n\n // Calculate start.\n start = start | 0;\n start = (start < 0) ? Math.max(len + start, 0) : Math.min(start, len);\n\n // Calculate end.\n end = (end === undefined) ? len : end | 0;\n end = (end < 0) ? Math.max(len + end, 0) : Math.min(end, len);\n\n // Copy into new array.\n var arraySlice = new Uint8Array(end - start);\n for (var i = start, n = 0; i < end;) {\n arraySlice[n++] = array[i++];\n }\n\n return arraySlice;\n }\n } else {\n // Assume normal array.\n return array.slice(start, end);\n }\n}\n\n// Implementation\n// --\n\n// Calculates an upper bound for lz4 compression.\nexports.compressBound = function compressBound (n) {\n return (n + (n / 255) + 16) | 0;\n};\n\n// Calculates an upper bound for lz4 decompression, by reading the data.\nexports.decompressBound = function decompressBound (src) {\n var sIndex = 0;\n\n // Read magic number\n if (util.readU32(src, sIndex) !== magicNum) {\n throw new Error('invalid magic number');\n }\n\n sIndex += 4;\n\n // Read descriptor\n var descriptor = src[sIndex++];\n\n // Check version\n if ((descriptor & fdVersionMask) !== fdVersion) {\n throw new Error('incompatible descriptor version ' + (descriptor & fdVersionMask));\n }\n\n // Read flags\n var useBlockSum = (descriptor & fdBlockChksum) !== 0;\n var useContentSize = (descriptor & fdContentSize) !== 0;\n\n // Read block size\n var bsIdx = (src[sIndex++] >> bsShift) & bsMask;\n\n if (bsMap[bsIdx] === undefined) {\n throw new Error('invalid block size ' + bsIdx);\n }\n\n var maxBlockSize = bsMap[bsIdx];\n\n // Get content size\n if (useContentSize) {\n return util.readU64(src, sIndex);\n }\n\n // Checksum\n sIndex++;\n\n // Read blocks.\n var maxSize = 0;\n while (true) {\n var blockSize = util.readU32(src, sIndex);\n sIndex += 4;\n\n if (blockSize & bsUncompressed) {\n blockSize &= ~bsUncompressed;\n maxSize += blockSize;\n } else {\n maxSize += maxBlockSize;\n }\n\n if (blockSize === 0) {\n return maxSize;\n }\n\n if (useBlockSum) {\n sIndex += 4;\n }\n\n sIndex += blockSize;\n }\n};\n\n// Creates a buffer of a given byte-size, falling back to plain arrays.\nexports.makeBuffer = makeBuffer;\n\n// Decompresses a block of Lz4.\nexports.decompressBlock = function decompressBlock (src, dst, sIndex, sLength, dIndex) {\n var mLength, mOffset, sEnd, n, i;\n\n // Setup initial state.\n sEnd = sIndex + sLength;\n\n // Consume entire input block.\n while (sIndex < sEnd) {\n var token = src[sIndex++];\n\n // Copy literals.\n var literalCount = (token >> 4);\n if (literalCount > 0) {\n // Parse length.\n if (literalCount === 0xf) {\n while (true) {\n literalCount += src[sIndex];\n if (src[sIndex++] !== 0xff) {\n break;\n }\n }\n }\n\n // Copy literals\n for (n = sIndex + literalCount; sIndex < n;) {\n dst[dIndex++] = src[sIndex++];\n }\n }\n\n if (sIndex >= sEnd) {\n break;\n }\n\n // Copy match.\n mLength = (token & 0xf);\n\n // Parse offset.\n mOffset = src[sIndex++] | (src[sIndex++] << 8);\n\n // Parse length.\n if (mLength === 0xf) {\n while (true) {\n mLength += src[sIndex];\n if (src[sIndex++] !== 0xff) {\n break;\n }\n }\n }\n\n mLength += minMatch;\n\n // Copy match.\n for (i = dIndex - mOffset, n = i + mLength; i < n;) {\n dst[dIndex++] = dst[i++] | 0;\n }\n }\n\n return dIndex;\n};\n\n// Compresses a block with Lz4.\nexports.compressBlock = function compressBlock (src, dst, sIndex, sLength, hashTable) {\n var mIndex, mAnchor, mLength, mOffset, mStep;\n var literalCount, dIndex, sEnd, n;\n\n // Setup initial state.\n dIndex = 0;\n sEnd = sLength + sIndex;\n mAnchor = sIndex;\n\n // Process only if block is large enough.\n if (sLength >= minLength) {\n var searchMatchCount = (1 << skipTrigger) + 3;\n\n // Consume until last n literals (Lz4 spec limitation.)\n while (sIndex + minMatch < sEnd - searchLimit) {\n var seq = util.readU32(src, sIndex);\n var hash = util.hashU32(seq) >>> 0;\n\n // Crush hash to 16 bits.\n hash = ((hash >> 16) ^ hash) >>> 0 & 0xffff;\n\n // Look for a match in the hashtable. NOTE: remove one; see below.\n mIndex = hashTable[hash] - 1;\n\n // Put pos in hash table. NOTE: add one so that zero = invalid.\n hashTable[hash] = sIndex + 1;\n\n // Determine if there is a match (within range.)\n if (mIndex < 0 || ((sIndex - mIndex) >>> 16) > 0 || util.readU32(src, mIndex) !== seq) {\n mStep = searchMatchCount++ >> skipTrigger;\n sIndex += mStep;\n continue;\n }\n\n searchMatchCount = (1 << skipTrigger) + 3;\n\n // Calculate literal count and offset.\n literalCount = sIndex - mAnchor;\n mOffset = sIndex - mIndex;\n\n // We've already matched one word, so get that out of the way.\n sIndex += minMatch;\n mIndex += minMatch;\n\n // Determine match length.\n // N.B.: mLength does not include minMatch, Lz4 adds it back\n // in decoding.\n mLength = sIndex;\n while (sIndex < sEnd - searchLimit && src[sIndex] === src[mIndex]) {\n sIndex++;\n mIndex++;\n }\n mLength = sIndex - mLength;\n\n // Write token + literal count.\n var token = mLength < mlMask ? mLength : mlMask;\n if (literalCount >= runMask) {\n dst[dIndex++] = (runMask << mlBits) + token;\n for (n = literalCount - runMask; n >= 0xff; n -= 0xff) {\n dst[dIndex++] = 0xff;\n }\n dst[dIndex++] = n;\n } else {\n dst[dIndex++] = (literalCount << mlBits) + token;\n }\n\n // Write literals.\n for (var i = 0; i < literalCount; i++) {\n dst[dIndex++] = src[mAnchor + i];\n }\n\n // Write offset.\n dst[dIndex++] = mOffset;\n dst[dIndex++] = (mOffset >> 8);\n\n // Write match length.\n if (mLength >= mlMask) {\n for (n = mLength - mlMask; n >= 0xff; n -= 0xff) {\n dst[dIndex++] = 0xff;\n }\n dst[dIndex++] = n;\n }\n\n // Move the anchor.\n mAnchor = sIndex;\n }\n }\n\n // Nothing was encoded.\n if (mAnchor === 0) {\n return 0;\n }\n\n // Write remaining literals.\n // Write literal token+count.\n literalCount = sEnd - mAnchor;\n if (literalCount >= runMask) {\n dst[dIndex++] = (runMask << mlBits);\n for (n = literalCount - runMask; n >= 0xff; n -= 0xff) {\n dst[dIndex++] = 0xff;\n }\n dst[dIndex++] = n;\n } else {\n dst[dIndex++] = (literalCount << mlBits);\n }\n\n // Write literals.\n sIndex = mAnchor;\n while (sIndex < sEnd) {\n dst[dIndex++] = src[sIndex++];\n }\n\n return dIndex;\n};\n\n// Decompresses a frame of Lz4 data.\nexports.decompressFrame = function decompressFrame (src, dst) {\n var useBlockSum, useContentSum, useContentSize, descriptor;\n var sIndex = 0;\n var dIndex = 0;\n\n // Read magic number\n if (util.readU32(src, sIndex) !== magicNum) {\n throw new Error('invalid magic number');\n }\n\n sIndex += 4;\n\n // Read descriptor\n descriptor = src[sIndex++];\n\n // Check version\n if ((descriptor & fdVersionMask) !== fdVersion) {\n throw new Error('incompatible descriptor version');\n }\n\n // Read flags\n useBlockSum = (descriptor & fdBlockChksum) !== 0;\n useContentSum = (descriptor & fdContentChksum) !== 0;\n useContentSize = (descriptor & fdContentSize) !== 0;\n\n // Read block size\n var bsIdx = (src[sIndex++] >> bsShift) & bsMask;\n\n if (bsMap[bsIdx] === undefined) {\n throw new Error('invalid block size');\n }\n\n if (useContentSize) {\n // TODO: read content size\n sIndex += 8;\n }\n\n sIndex++;\n\n // Read blocks.\n while (true) {\n var compSize;\n\n compSize = util.readU32(src, sIndex);\n sIndex += 4;\n\n if (compSize === 0) {\n break;\n }\n\n if (useBlockSum) {\n // TODO: read block checksum\n sIndex += 4;\n }\n\n // Check if block is compressed\n if ((compSize & bsUncompressed) !== 0) {\n // Mask off the 'uncompressed' bit\n compSize &= ~bsUncompressed;\n\n // Copy uncompressed data into destination buffer.\n for (var j = 0; j < compSize; j++) {\n dst[dIndex++] = src[sIndex++];\n }\n } else {\n // Decompress into blockBuf\n dIndex = exports.decompressBlock(src, dst, sIndex, compSize, dIndex);\n sIndex += compSize;\n }\n }\n\n if (useContentSum) {\n // TODO: read content checksum\n sIndex += 4;\n }\n\n return dIndex;\n};\n\n// Compresses data to an Lz4 frame.\nexports.compressFrame = function compressFrame (src, dst) {\n var dIndex = 0;\n\n // Write magic number.\n util.writeU32(dst, dIndex, magicNum);\n dIndex += 4;\n\n // Descriptor flags.\n dst[dIndex++] = fdVersion;\n dst[dIndex++] = bsDefault << bsShift;\n\n // Descriptor checksum.\n dst[dIndex] = xxhash.hash(0, dst, 4, dIndex - 4) >> 8;\n dIndex++;\n\n // Write blocks.\n var maxBlockSize = bsMap[bsDefault];\n var remaining = src.length;\n var sIndex = 0;\n\n // Clear the hashtable.\n clearHashTable(hashTable);\n\n // Split input into blocks and write.\n while (remaining > 0) {\n var compSize = 0;\n var blockSize = remaining > maxBlockSize ? maxBlockSize : remaining;\n\n compSize = exports.compressBlock(src, blockBuf, sIndex, blockSize, hashTable);\n\n if (compSize > blockSize || compSize === 0) {\n // Output uncompressed.\n util.writeU32(dst, dIndex, 0x80000000 | blockSize);\n dIndex += 4;\n\n for (var z = sIndex + blockSize; sIndex < z;) {\n dst[dIndex++] = src[sIndex++];\n }\n\n remaining -= blockSize;\n } else {\n // Output compressed.\n util.writeU32(dst, dIndex, compSize);\n dIndex += 4;\n\n for (var j = 0; j < compSize;) {\n dst[dIndex++] = blockBuf[j++];\n }\n\n sIndex += blockSize;\n remaining -= blockSize;\n }\n }\n\n // Write blank end block.\n util.writeU32(dst, dIndex, 0);\n dIndex += 4;\n\n return dIndex;\n};\n\n// Decompresses a buffer containing an Lz4 frame. maxSize is optional; if not\n// provided, a maximum size will be determined by examining the data. The\n// buffer returned will always be perfectly-sized.\nexports.decompress = function decompress (src, maxSize) {\n var dst, size;\n\n if (maxSize === undefined) {\n maxSize = exports.decompressBound(src);\n }\n\n dst = exports.makeBuffer(maxSize);\n size = exports.decompressFrame(src, dst);\n\n if (size !== maxSize) {\n dst = sliceArray(dst, 0, size);\n }\n\n return dst;\n};\n\n// Compresses a buffer to an Lz4 frame. maxSize is optional; if not provided,\n// a buffer will be created based on the theoretical worst output size for a\n// given input size. The buffer returned will always be perfectly-sized.\nexports.compress = function compress (src, maxSize) {\n var dst, size;\n\n if (maxSize === undefined) {\n maxSize = exports.compressBound(src.length);\n }\n\n dst = exports.makeBuffer(maxSize);\n size = exports.compressFrame(src, dst);\n\n if (size !== maxSize) {\n dst = sliceArray(dst, 0, size);\n }\n\n return dst;\n};\n","// Simple hash function, from: http://burtleburtle.net/bob/hash/integer.html.\n// Chosen because it doesn't use multiply and achieves full avalanche.\nexports.hashU32 = function hashU32 (a) {\n a = a | 0;\n a = a + 2127912214 + (a << 12) | 0;\n a = a ^ -949894596 ^ a >>> 19;\n a = a + 374761393 + (a << 5) | 0;\n a = a + -744332180 ^ a << 9;\n a = a + -42973499 + (a << 3) | 0;\n return a ^ -1252372727 ^ a >>> 16 | 0;\n};\n\n// Reads a 64-bit little-endian integer from an array.\nexports.readU64 = function readU64 (b, n) {\n var x = 0;\n x |= b[n++] << 0;\n x |= b[n++] << 8;\n x |= b[n++] << 16;\n x |= b[n++] << 24;\n x |= b[n++] << 32;\n x |= b[n++] << 40;\n x |= b[n++] << 48;\n x |= b[n++] << 56;\n return x;\n};\n\n// Reads a 32-bit little-endian integer from an array.\nexports.readU32 = function readU32 (b, n) {\n var x = 0;\n x |= b[n++] << 0;\n x |= b[n++] << 8;\n x |= b[n++] << 16;\n x |= b[n++] << 24;\n return x;\n};\n\n// Writes a 32-bit little-endian integer from an array.\nexports.writeU32 = function writeU32 (b, n, x) {\n b[n++] = (x >> 0) & 0xff;\n b[n++] = (x >> 8) & 0xff;\n b[n++] = (x >> 16) & 0xff;\n b[n++] = (x >> 24) & 0xff;\n};\n\n// Multiplies two numbers using 32-bit integer multiplication.\n// Algorithm from Emscripten.\nexports.imul = function imul (a, b) {\n var ah = a >>> 16;\n var al = a & 65535;\n var bh = b >>> 16;\n var bl = b & 65535;\n\n return al * bl + (ah * bl + al * bh << 16) | 0;\n};\n","// xxh32.js - implementation of xxhash32 in plain JavaScript\nvar util = require('./util.js');\n\n// xxhash32 primes\nvar prime1 = 0x9e3779b1;\nvar prime2 = 0x85ebca77;\nvar prime3 = 0xc2b2ae3d;\nvar prime4 = 0x27d4eb2f;\nvar prime5 = 0x165667b1;\n\n// Utility functions/primitives\n// --\n\nfunction rotl32 (x, r) {\n x = x | 0;\n r = r | 0;\n\n return x >>> (32 - r | 0) | x << r | 0;\n}\n\nfunction rotmul32 (h, r, m) {\n h = h | 0;\n r = r | 0;\n m = m | 0;\n\n return util.imul(h >>> (32 - r | 0) | h << r, m) | 0;\n}\n\nfunction shiftxor32 (h, s) {\n h = h | 0;\n s = s | 0;\n\n return h >>> s ^ h | 0;\n}\n\n// Implementation\n// --\n\nfunction xxhapply (h, src, m0, s, m1) {\n return rotmul32(util.imul(src, m0) + h, s, m1);\n}\n\nfunction xxh1 (h, src, index) {\n return rotmul32((h + util.imul(src[index], prime5)), 11, prime1);\n}\n\nfunction xxh4 (h, src, index) {\n return xxhapply(h, util.readU32(src, index), prime3, 17, prime4);\n}\n\nfunction xxh16 (h, src, index) {\n return [\n xxhapply(h[0], util.readU32(src, index + 0), prime2, 13, prime1),\n xxhapply(h[1], util.readU32(src, index + 4), prime2, 13, prime1),\n xxhapply(h[2], util.readU32(src, index + 8), prime2, 13, prime1),\n xxhapply(h[3], util.readU32(src, index + 12), prime2, 13, prime1)\n ];\n}\n\nfunction xxh32 (seed, src, index, len) {\n var h, l;\n l = len;\n if (len >= 16) {\n h = [\n seed + prime1 + prime2,\n seed + prime2,\n seed,\n seed - prime1\n ];\n\n while (len >= 16) {\n h = xxh16(h, src, index);\n\n index += 16;\n len -= 16;\n }\n\n h = rotl32(h[0], 1) + rotl32(h[1], 7) + rotl32(h[2], 12) + rotl32(h[3], 18) + l;\n } else {\n h = (seed + prime5 + len) >>> 0;\n }\n\n while (len >= 4) {\n h = xxh4(h, src, index);\n\n index += 4;\n len -= 4;\n }\n\n while (len > 0) {\n h = xxh1(h, src, index);\n\n index++;\n len--;\n }\n\n h = shiftxor32(util.imul(shiftxor32(util.imul(shiftxor32(h, 15), prime2), 13), prime3), 16);\n\n return h >>> 0;\n}\n\nexports.hash = xxh32;\n","\"use strict\"\n\nvar dup = require(\"dup\")\nvar cwise = require(\"cwise\")\n\nvar do_unpack = cwise({ \n args: [\"array\", \"scalar\", \"index\"],\n body: function unpackCwise(arr, a, idx) {\n var v = a, i\n for(i=0;iMath.abs(this.stride[1]))?[1,0]:[0,1]}})\")\n } else if(dimension === 3) {\n code.push(\n\"var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);\\\nif(s0>s1){\\\nif(s1>s2){\\\nreturn [2,1,0];\\\n}else if(s0>s2){\\\nreturn [1,2,0];\\\n}else{\\\nreturn [1,0,2];\\\n}\\\n}else if(s0>s2){\\\nreturn [2,0,1];\\\n}else if(s2>s1){\\\nreturn [0,1,2];\\\n}else{\\\nreturn [0,2,1];\\\n}}})\")\n }\n } else {\n code.push(\"ORDER})\")\n }\n }\n\n //view.set(i0, ..., v):\n code.push(\n\"proto.set=function \"+className+\"_set(\"+args.join(\",\")+\",v){\")\n if(useGetters) {\n code.push(\"return this.data.set(\"+index_str+\",v)}\")\n } else {\n code.push(\"return this.data[\"+index_str+\"]=v}\")\n }\n\n //view.get(i0, ...):\n code.push(\"proto.get=function \"+className+\"_get(\"+args.join(\",\")+\"){\")\n if(useGetters) {\n code.push(\"return this.data.get(\"+index_str+\")}\")\n } else {\n code.push(\"return this.data[\"+index_str+\"]}\")\n }\n\n //view.index:\n code.push(\n \"proto.index=function \"+className+\"_index(\", args.join(), \"){return \"+index_str+\"}\")\n\n //view.hi():\n code.push(\"proto.hi=function \"+className+\"_hi(\"+args.join(\",\")+\"){return new \"+className+\"(this.data,\"+\n indices.map(function(i) {\n return [\"(typeof i\",i,\"!=='number'||i\",i,\"<0)?this.shape[\", i, \"]:i\", i,\"|0\"].join(\"\")\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"this.stride[\"+i + \"]\"\n }).join(\",\")+\",this.offset)}\")\n\n //view.lo():\n var a_vars = indices.map(function(i) { return \"a\"+i+\"=this.shape[\"+i+\"]\" })\n var c_vars = indices.map(function(i) { return \"c\"+i+\"=this.stride[\"+i+\"]\" })\n code.push(\"proto.lo=function \"+className+\"_lo(\"+args.join(\",\")+\"){var b=this.offset,d=0,\"+a_vars.join(\",\")+\",\"+c_vars.join(\",\"))\n for(var i=0; i=0){\\\nd=i\"+i+\"|0;\\\nb+=c\"+i+\"*d;\\\na\"+i+\"-=d}\")\n }\n code.push(\"return new \"+className+\"(this.data,\"+\n indices.map(function(i) {\n return \"a\"+i\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"c\"+i\n }).join(\",\")+\",b)}\")\n\n //view.step():\n code.push(\"proto.step=function \"+className+\"_step(\"+args.join(\",\")+\"){var \"+\n indices.map(function(i) {\n return \"a\"+i+\"=this.shape[\"+i+\"]\"\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"b\"+i+\"=this.stride[\"+i+\"]\"\n }).join(\",\")+\",c=this.offset,d=0,ceil=Math.ceil\")\n for(var i=0; i=0){c=(c+this.stride[\"+i+\"]*i\"+i+\")|0}else{a.push(this.shape[\"+i+\"]);b.push(this.stride[\"+i+\"])}\")\n }\n code.push(\"var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}\")\n\n //Add return statement\n code.push(\"return function construct_\"+className+\"(data,shape,stride,offset){return new \"+className+\"(data,\"+\n indices.map(function(i) {\n return \"shape[\"+i+\"]\"\n }).join(\",\")+\",\"+\n indices.map(function(i) {\n return \"stride[\"+i+\"]\"\n }).join(\",\")+\",offset)}\")\n\n //Compile procedure\n var procedure = new Function(\"CTOR_LIST\", \"ORDER\", code.join(\"\\n\"))\n return procedure(CACHED_CONSTRUCTORS[dtype], order)\n}\n\nfunction arrayDType(data) {\n if(isBuffer(data)) {\n return \"buffer\"\n }\n if(hasTypedArrays) {\n switch(Object.prototype.toString.call(data)) {\n case \"[object Float64Array]\":\n return \"float64\"\n case \"[object Float32Array]\":\n return \"float32\"\n case \"[object Int8Array]\":\n return \"int8\"\n case \"[object Int16Array]\":\n return \"int16\"\n case \"[object Int32Array]\":\n return \"int32\"\n case \"[object Uint8Array]\":\n return \"uint8\"\n case \"[object Uint16Array]\":\n return \"uint16\"\n case \"[object Uint32Array]\":\n return \"uint32\"\n case \"[object Uint8ClampedArray]\":\n return \"uint8_clamped\"\n case \"[object BigInt64Array]\":\n return \"bigint64\"\n case \"[object BigUint64Array]\":\n return \"biguint64\"\n }\n }\n if(Array.isArray(data)) {\n return \"array\"\n }\n return \"generic\"\n}\n\nvar CACHED_CONSTRUCTORS = {\n \"float32\":[],\n \"float64\":[],\n \"int8\":[],\n \"int16\":[],\n \"int32\":[],\n \"uint8\":[],\n \"uint16\":[],\n \"uint32\":[],\n \"array\":[],\n \"uint8_clamped\":[],\n \"bigint64\": [],\n \"biguint64\": [],\n \"buffer\":[],\n \"generic\":[]\n}\n\n;(function() {\n for(var id in CACHED_CONSTRUCTORS) {\n CACHED_CONSTRUCTORS[id].push(compileConstructor(id, -1))\n }\n});\n\nfunction wrappedNDArrayCtor(data, shape, stride, offset) {\n if(data === undefined) {\n var ctor = CACHED_CONSTRUCTORS.array[0]\n return ctor([])\n } else if(typeof data === \"number\") {\n data = [data]\n }\n if(shape === undefined) {\n shape = [ data.length ]\n }\n var d = shape.length\n if(stride === undefined) {\n stride = new Array(d)\n for(var i=d-1, sz=1; i>=0; --i) {\n stride[i] = sz\n sz *= shape[i]\n }\n }\n if(offset === undefined) {\n offset = 0\n for(var i=0; i Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param).\n **/\n\n/**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n **/\n\n/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\n\n/**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw deflate\n * - `gzip` (Boolean) - create gzip wrapper\n * - `header` (Object) - custom header for gzip\n * - `text` (Boolean) - true if compressed data believed to be text\n * - `time` (Number) - modification time, unix timestamp\n * - `os` (Number) - operation system code\n * - `extra` (Array) - array of bytes with extra data (max 65536)\n * - `name` (String) - file name (binary string)\n * - `comment` (String) - comment (binary string)\n * - `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * , chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true); // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n **/\nfunction Deflate(options) {\n this.options = utils.assign({\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY\n }, options || {});\n\n let opt = this.options;\n\n if (opt.raw && (opt.windowBits > 0)) {\n opt.windowBits = -opt.windowBits;\n }\n\n else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n opt.windowBits += 16;\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n let status = zlib_deflate.deflateInit2(\n this.strm,\n opt.level,\n opt.method,\n opt.windowBits,\n opt.memLevel,\n opt.strategy\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n if (opt.header) {\n zlib_deflate.deflateSetHeader(this.strm, opt.header);\n }\n\n if (opt.dictionary) {\n let dict;\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n // If we need to compress text, change encoding to utf8.\n dict = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(opt.dictionary);\n } else {\n dict = opt.dictionary;\n }\n\n status = zlib_deflate.deflateSetDictionary(this.strm, dict);\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this._dict_set = true;\n }\n}\n\n/**\n * Deflate#push(data[, flush_mode]) -> Boolean\n * - data (Uint8Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with\n * new compressed chunks. Returns `true` on success. The last data block must\n * have `flush_mode` Z_FINISH (or `true`). That will flush internal pending\n * buffers and call [[Deflate#onEnd]].\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nDeflate.prototype.push = function (data, flush_mode) {\n const strm = this.strm;\n const chunkSize = this.options.chunkSize;\n let status, _flush_mode;\n\n if (this.ended) { return false; }\n\n if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;\n else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH;\n\n // Convert data if needed\n if (typeof data === 'string') {\n // If we need to compress text, change encoding to utf8.\n strm.input = strings.string2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n for (;;) {\n if (strm.avail_out === 0) {\n strm.output = new Uint8Array(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n // Make sure avail_out > 6 to avoid repeating markers\n if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH) && strm.avail_out <= 6) {\n this.onData(strm.output.subarray(0, strm.next_out));\n strm.avail_out = 0;\n continue;\n }\n\n status = zlib_deflate.deflate(strm, _flush_mode);\n\n // Ended => flush and finish\n if (status === Z_STREAM_END) {\n if (strm.next_out > 0) {\n this.onData(strm.output.subarray(0, strm.next_out));\n }\n status = zlib_deflate.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK;\n }\n\n // Flush if out buffer full\n if (strm.avail_out === 0) {\n this.onData(strm.output);\n continue;\n }\n\n // Flush if requested and has data\n if (_flush_mode > 0 && strm.next_out > 0) {\n this.onData(strm.output.subarray(0, strm.next_out));\n strm.avail_out = 0;\n continue;\n }\n\n if (strm.avail_in === 0) break;\n }\n\n return true;\n};\n\n\n/**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array): output data.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nDeflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Deflate#onEnd(status) -> Void\n * - status (Number): deflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called once after you tell deflate that the input stream is\n * complete (Z_FINISH). By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nDeflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n this.result = utils.flattenChunks(this.chunks);\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * deflate(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\n *\n * - level\n * - windowBits\n * - memLevel\n * - strategy\n * - dictionary\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * const data = new Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate(input, options) {\n const deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}\n\n\nmodule.exports.Deflate = Deflate;\nmodule.exports.deflate = deflate;\nmodule.exports.deflateRaw = deflateRaw;\nmodule.exports.gzip = gzip;\nmodule.exports.constants = require('./zlib/constants');\n","'use strict';\n\n\nconst zlib_inflate = require('./zlib/inflate');\nconst utils = require('./utils/common');\nconst strings = require('./utils/strings');\nconst msg = require('./zlib/messages');\nconst ZStream = require('./zlib/zstream');\nconst GZheader = require('./zlib/gzheader');\n\nconst toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH, Z_FINISH,\n Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR\n} = require('./zlib/constants');\n\n/* ===========================================================================*/\n\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * const chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * const chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate(options) {\n this.options = utils.assign({\n chunkSize: 1024 * 64,\n windowBits: 15,\n to: ''\n }, options || {});\n\n const opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n let status = zlib_inflate.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this.header = new GZheader();\n\n zlib_inflate.inflateGetHeader(this.strm, this.header);\n\n // Setup dictionary\n if (opt.dictionary) {\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n opt.dictionary = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n opt.dictionary = new Uint8Array(opt.dictionary);\n }\n if (opt.raw) { //In raw mode we need to set the dictionary early\n status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n }\n }\n}\n\n/**\n * Inflate#push(data[, flush_mode]) -> Boolean\n * - data (Uint8Array|ArrayBuffer): input data\n * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE\n * flush modes. See constants. Skipped or `false` means Z_NO_FLUSH,\n * `true` means Z_FINISH.\n *\n * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. If end of stream detected,\n * [[Inflate#onEnd]] will be called.\n *\n * `flush_mode` is not needed for normal operation, because end of stream\n * detected automatically. You may try to use it for advanced things, but\n * this functionality was not tested.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nInflate.prototype.push = function (data, flush_mode) {\n const strm = this.strm;\n const chunkSize = this.options.chunkSize;\n const dictionary = this.options.dictionary;\n let status, _flush_mode, last_avail_out;\n\n if (this.ended) return false;\n\n if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;\n else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH;\n\n // Convert data if needed\n if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n for (;;) {\n if (strm.avail_out === 0) {\n strm.output = new Uint8Array(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = zlib_inflate.inflate(strm, _flush_mode);\n\n if (status === Z_NEED_DICT && dictionary) {\n status = zlib_inflate.inflateSetDictionary(strm, dictionary);\n\n if (status === Z_OK) {\n status = zlib_inflate.inflate(strm, _flush_mode);\n } else if (status === Z_DATA_ERROR) {\n // Replace code with more verbose\n status = Z_NEED_DICT;\n }\n }\n\n // Skip snyc markers if more data follows and not raw mode\n while (strm.avail_in > 0 &&\n status === Z_STREAM_END &&\n strm.state.wrap > 0 &&\n data[strm.next_in] !== 0)\n {\n zlib_inflate.inflateReset(strm);\n status = zlib_inflate.inflate(strm, _flush_mode);\n }\n\n switch (status) {\n case Z_STREAM_ERROR:\n case Z_DATA_ERROR:\n case Z_NEED_DICT:\n case Z_MEM_ERROR:\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n // Remember real `avail_out` value, because we may patch out buffer content\n // to align utf8 strings boundaries.\n last_avail_out = strm.avail_out;\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === Z_STREAM_END) {\n\n if (this.options.to === 'string') {\n\n let next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n let tail = strm.next_out - next_out_utf8;\n let utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail & realign counters\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) strm.output.set(strm.output.subarray(next_out_utf8, next_out_utf8 + tail), 0);\n\n this.onData(utf8str);\n\n } else {\n this.onData(strm.output.length === strm.next_out ? strm.output : strm.output.subarray(0, strm.next_out));\n }\n }\n }\n\n // Must repeat iteration if out buffer is full\n if (status === Z_OK && last_avail_out === 0) continue;\n\n // Finalize if end of stream reached.\n if (status === Z_STREAM_END) {\n status = zlib_inflate.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return true;\n }\n\n if (strm.avail_in === 0) break;\n }\n\n return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|String): output data. When string output requested,\n * each chunk will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nInflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH). By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako');\n * const input = pako.deflate(new Uint8Array([1,2,3,4,5,6,7,8,9]));\n * let output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err) {\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate(input, options) {\n const inflator = new Inflate(options);\n\n inflator.push(input);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) throw inflator.msg || msg[inflator.err];\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nmodule.exports.Inflate = Inflate;\nmodule.exports.inflate = inflate;\nmodule.exports.inflateRaw = inflateRaw;\nmodule.exports.ungzip = inflate;\nmodule.exports.constants = require('./zlib/constants');\n","'use strict';\n\n\nconst _has = (obj, key) => {\n return Object.prototype.hasOwnProperty.call(obj, key);\n};\n\nmodule.exports.assign = function (obj /*from1, from2, from3, ...*/) {\n const sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n const source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (const p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// Join array of chunks to single array.\nmodule.exports.flattenChunks = (chunks) => {\n // calculate data length\n let len = 0;\n\n for (let i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n const result = new Uint8Array(len);\n\n for (let i = 0, pos = 0, l = chunks.length; i < l; i++) {\n let chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n};\n","// String encode/decode helpers\n'use strict';\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nlet STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nconst _utf8len = new Uint8Array(256);\nfor (let q = 0; q < 256; q++) {\n _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nmodule.exports.string2buf = (str) => {\n if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) {\n return new TextEncoder().encode(str);\n }\n\n let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n buf = new Uint8Array(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n};\n\n// Helper\nconst buf2binstring = (buf, len) => {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if (buf.subarray && STR_APPLY_UIA_OK) {\n return String.fromCharCode.apply(null, buf.length === len ? buf : buf.subarray(0, len));\n }\n }\n\n let result = '';\n for (let i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n};\n\n\n// convert array to string\nmodule.exports.buf2string = (buf, max) => {\n const len = max || buf.length;\n\n if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) {\n return new TextDecoder().decode(buf.subarray(0, max));\n }\n\n let i, out;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n const utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n let c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n let c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nmodule.exports.utf8border = (buf, max) => {\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n let pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n","'use strict';\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst adler32 = (adler, buf, len, pos) => {\n let s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n};\n\n\nmodule.exports = adler32;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n","'use strict';\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nconst makeTable = () => {\n let c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n};\n\n// Create table on load. Just 255 signed longs. Not a problem.\nconst crcTable = new Uint32Array(makeTable());\n\n\nconst crc32 = (crc, buf, len, pos) => {\n const t = crcTable;\n const end = pos + len;\n\n crc ^= -1;\n\n for (let i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n};\n\n\nmodule.exports = crc32;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst { _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align } = require('./trees');\nconst adler32 = require('./adler32');\nconst crc32 = require('./crc32');\nconst msg = require('./messages');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH, Z_PARTIAL_FLUSH, Z_FULL_FLUSH, Z_FINISH, Z_BLOCK,\n Z_OK, Z_STREAM_END, Z_STREAM_ERROR, Z_DATA_ERROR, Z_BUF_ERROR,\n Z_DEFAULT_COMPRESSION,\n Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED, Z_DEFAULT_STRATEGY,\n Z_UNKNOWN,\n Z_DEFLATED\n} = require('./constants');\n\n/*============================================================================*/\n\n\nconst MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nconst MAX_WBITS = 15;\n/* 32K LZ77 window */\nconst DEF_MEM_LEVEL = 8;\n\n\nconst LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nconst LITERALS = 256;\n/* number of literal bytes 0..255 */\nconst L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nconst D_CODES = 30;\n/* number of distance codes */\nconst BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nconst HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nconst MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\nconst MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nconst PRESET_DICT = 0x20;\n\nconst INIT_STATE = 42; /* zlib header -> BUSY_STATE */\n//#ifdef GZIP\nconst GZIP_STATE = 57; /* gzip header -> BUSY_STATE | EXTRA_STATE */\n//#endif\nconst EXTRA_STATE = 69; /* gzip extra block -> NAME_STATE */\nconst NAME_STATE = 73; /* gzip file name -> COMMENT_STATE */\nconst COMMENT_STATE = 91; /* gzip comment -> HCRC_STATE */\nconst HCRC_STATE = 103; /* gzip header CRC -> BUSY_STATE */\nconst BUSY_STATE = 113; /* deflate -> FINISH_STATE */\nconst FINISH_STATE = 666; /* stream complete */\n\nconst BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nconst BS_BLOCK_DONE = 2; /* block flush performed */\nconst BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nconst BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nconst OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nconst err = (strm, errorCode) => {\n strm.msg = msg[errorCode];\n return errorCode;\n};\n\nconst rank = (f) => {\n return ((f) * 2) - ((f) > 4 ? 9 : 0);\n};\n\nconst zero = (buf) => {\n let len = buf.length; while (--len >= 0) { buf[len] = 0; }\n};\n\n/* ===========================================================================\n * Slide the hash table when sliding the window down (could be avoided with 32\n * bit values at the expense of memory usage). We slide even when level == 0 to\n * keep the hash table consistent if we switch back to level > 0 later.\n */\nconst slide_hash = (s) => {\n let n, m;\n let p;\n let wsize = s.w_size;\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= wsize ? m - wsize : 0);\n } while (--n);\n n = wsize;\n//#ifndef FASTEST\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= wsize ? m - wsize : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n//#endif\n};\n\n/* eslint-disable new-cap */\nlet HASH_ZLIB = (s, prev, data) => ((prev << s.hash_shift) ^ data) & s.hash_mask;\n// This hash causes less collisions, https://github.com/nodeca/pako/issues/135\n// But breaks binary compatibility\n//let HASH_FAST = (s, prev, data) => ((prev << 8) + (prev >> 8) + (data << 4)) & s.hash_mask;\nlet HASH = HASH_ZLIB;\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output, except for\n * some deflate_stored() output, goes through this function so some\n * applications may wish to modify it to avoid allocating a large\n * strm->next_out buffer and copying into it. (See also read_buf()).\n */\nconst flush_pending = (strm) => {\n const s = strm.state;\n\n //_tr_flush_bits(s);\n let len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n strm.output.set(s.pending_buf.subarray(s.pending_out, s.pending_out + len), strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n};\n\n\nconst flush_block_only = (s, last) => {\n _tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n};\n\n\nconst put_byte = (s, b) => {\n s.pending_buf[s.pending++] = b;\n};\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nconst putShortMSB = (s, b) => {\n\n // put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n};\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nconst read_buf = (strm, buf, start, size) => {\n\n let len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n buf.set(strm.input.subarray(strm.next_in, strm.next_in + len), start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n};\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nconst longest_match = (s, cur_match) => {\n\n let chain_length = s.max_chain_length; /* max hash chain length */\n let scan = s.strstart; /* current string */\n let match; /* matched string */\n let len; /* length of current match */\n let best_len = s.prev_length; /* best match length so far */\n let nice_match = s.nice_match; /* stop if match long enough */\n const limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n const _win = s.window; // shortcut\n\n const wmask = s.w_mask;\n const prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n const strend = s.strstart + MAX_MATCH;\n let scan_end1 = _win[scan + best_len - 1];\n let scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n};\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nconst fill_window = (s) => {\n\n const _w_size = s.w_size;\n let n, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n s.window.set(s.window.subarray(_w_size, _w_size + _w_size - more), 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n slide_hash(s);\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + 1]);\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]);\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// const curr = s.strstart + s.lookahead;\n// let init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n};\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n *\n * In case deflateParams() is used to later switch to a non-zero compression\n * level, s->matches (otherwise unused when storing) keeps track of the number\n * of hash table slides to perform. If s->matches is 1, then one hash table\n * slide will be done when switching. If s->matches is 2, the maximum value\n * allowed here, then the hash table will be cleared, since two or more slides\n * is the same as a clear.\n *\n * deflate_stored() is written to minimize the number of times an input byte is\n * copied. It is most efficient with large input and output buffers, which\n * maximizes the opportunites to have a single copy from next_in to next_out.\n */\nconst deflate_stored = (s, flush) => {\n\n /* Smallest worthy block size when not flushing or finishing. By default\n * this is 32K. This can be as small as 507 bytes for memLevel == 1. For\n * large input and output buffers, the stored block size will be larger.\n */\n let min_block = s.pending_buf_size - 5 > s.w_size ? s.w_size : s.pending_buf_size - 5;\n\n /* Copy as many min_block or larger stored blocks directly to next_out as\n * possible. If flushing, copy the remaining available input to next_out as\n * stored blocks, if there is enough space.\n */\n let len, left, have, last = 0;\n let used = s.strm.avail_in;\n do {\n /* Set len to the maximum size block that we can copy directly with the\n * available input data and output space. Set left to how much of that\n * would be copied from what's left in the window.\n */\n len = 65535/* MAX_STORED */; /* maximum deflate stored block length */\n have = (s.bi_valid + 42) >> 3; /* number of header bytes */\n if (s.strm.avail_out < have) { /* need room for header */\n break;\n }\n /* maximum stored block length that will fit in avail_out: */\n have = s.strm.avail_out - have;\n left = s.strstart - s.block_start; /* bytes left in window */\n if (len > left + s.strm.avail_in) {\n len = left + s.strm.avail_in; /* limit len to the input */\n }\n if (len > have) {\n len = have; /* limit len to the output */\n }\n\n /* If the stored block would be less than min_block in length, or if\n * unable to copy all of the available input when flushing, then try\n * copying to the window and the pending buffer instead. Also don't\n * write an empty block when flushing -- deflate() does that.\n */\n if (len < min_block && ((len === 0 && flush !== Z_FINISH) ||\n flush === Z_NO_FLUSH ||\n len !== left + s.strm.avail_in)) {\n break;\n }\n\n /* Make a dummy stored block in pending to get the header bytes,\n * including any pending bits. This also updates the debugging counts.\n */\n last = flush === Z_FINISH && len === left + s.strm.avail_in ? 1 : 0;\n _tr_stored_block(s, 0, 0, last);\n\n /* Replace the lengths in the dummy stored block with len. */\n s.pending_buf[s.pending - 4] = len;\n s.pending_buf[s.pending - 3] = len >> 8;\n s.pending_buf[s.pending - 2] = ~len;\n s.pending_buf[s.pending - 1] = ~len >> 8;\n\n /* Write the stored block header bytes. */\n flush_pending(s.strm);\n\n//#ifdef ZLIB_DEBUG\n// /* Update debugging counts for the data about to be copied. */\n// s->compressed_len += len << 3;\n// s->bits_sent += len << 3;\n//#endif\n\n /* Copy uncompressed bytes from the window to next_out. */\n if (left) {\n if (left > len) {\n left = len;\n }\n //zmemcpy(s->strm->next_out, s->window + s->block_start, left);\n s.strm.output.set(s.window.subarray(s.block_start, s.block_start + left), s.strm.next_out);\n s.strm.next_out += left;\n s.strm.avail_out -= left;\n s.strm.total_out += left;\n s.block_start += left;\n len -= left;\n }\n\n /* Copy uncompressed bytes directly from next_in to next_out, updating\n * the check value.\n */\n if (len) {\n read_buf(s.strm, s.strm.output, s.strm.next_out, len);\n s.strm.next_out += len;\n s.strm.avail_out -= len;\n s.strm.total_out += len;\n }\n } while (last === 0);\n\n /* Update the sliding window with the last s->w_size bytes of the copied\n * data, or append all of the copied data to the existing window if less\n * than s->w_size bytes were copied. Also update the number of bytes to\n * insert in the hash tables, in the event that deflateParams() switches to\n * a non-zero compression level.\n */\n used -= s.strm.avail_in; /* number of input bytes directly copied */\n if (used) {\n /* If any input was used, then no unused input remains in the window,\n * therefore s->block_start == s->strstart.\n */\n if (used >= s.w_size) { /* supplant the previous history */\n s.matches = 2; /* clear hash */\n //zmemcpy(s->window, s->strm->next_in - s->w_size, s->w_size);\n s.window.set(s.strm.input.subarray(s.strm.next_in - s.w_size, s.strm.next_in), 0);\n s.strstart = s.w_size;\n s.insert = s.strstart;\n }\n else {\n if (s.window_size - s.strstart <= used) {\n /* Slide the window down. */\n s.strstart -= s.w_size;\n //zmemcpy(s->window, s->window + s->w_size, s->strstart);\n s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0);\n if (s.matches < 2) {\n s.matches++; /* add a pending slide_hash() */\n }\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n }\n //zmemcpy(s->window + s->strstart, s->strm->next_in - used, used);\n s.window.set(s.strm.input.subarray(s.strm.next_in - used, s.strm.next_in), s.strstart);\n s.strstart += used;\n s.insert += used > s.w_size - s.insert ? s.w_size - s.insert : used;\n }\n s.block_start = s.strstart;\n }\n if (s.high_water < s.strstart) {\n s.high_water = s.strstart;\n }\n\n /* If the last block was written to next_out, then done. */\n if (last) {\n return BS_FINISH_DONE;\n }\n\n /* If flushing and all input has been consumed, then done. */\n if (flush !== Z_NO_FLUSH && flush !== Z_FINISH &&\n s.strm.avail_in === 0 && s.strstart === s.block_start) {\n return BS_BLOCK_DONE;\n }\n\n /* Fill the window with any remaining input. */\n have = s.window_size - s.strstart;\n if (s.strm.avail_in > have && s.block_start >= s.w_size) {\n /* Slide the window down. */\n s.block_start -= s.w_size;\n s.strstart -= s.w_size;\n //zmemcpy(s->window, s->window + s->w_size, s->strstart);\n s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0);\n if (s.matches < 2) {\n s.matches++; /* add a pending slide_hash() */\n }\n have += s.w_size; /* more space now */\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n }\n if (have > s.strm.avail_in) {\n have = s.strm.avail_in;\n }\n if (have) {\n read_buf(s.strm, s.window, s.strstart, have);\n s.strstart += have;\n s.insert += have > s.w_size - s.insert ? s.w_size - s.insert : have;\n }\n if (s.high_water < s.strstart) {\n s.high_water = s.strstart;\n }\n\n /* There was not enough avail_out to write a complete worthy or flushed\n * stored block to next_out. Write a stored block to pending instead, if we\n * have enough input for a worthy block, or if flushing and there is enough\n * room for the remaining input as a stored block in the pending buffer.\n */\n have = (s.bi_valid + 42) >> 3; /* number of header bytes */\n /* maximum stored block length that will fit in pending: */\n have = s.pending_buf_size - have > 65535/* MAX_STORED */ ? 65535/* MAX_STORED */ : s.pending_buf_size - have;\n min_block = have > s.w_size ? s.w_size : have;\n left = s.strstart - s.block_start;\n if (left >= min_block ||\n ((left || flush === Z_FINISH) && flush !== Z_NO_FLUSH &&\n s.strm.avail_in === 0 && left <= have)) {\n len = left > have ? have : left;\n last = flush === Z_FINISH && s.strm.avail_in === 0 &&\n len === left ? 1 : 0;\n _tr_stored_block(s, s.block_start, len, last);\n s.block_start += len;\n flush_pending(s.strm);\n }\n\n /* We've done all we can with the available input and output. */\n return last ? BS_FINISH_STARTED : BS_NEED_MORE;\n};\n\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nconst deflate_fast = (s, flush) => {\n\n let hash_head; /* head of the hash chain */\n let bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + 1]);\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nconst deflate_slow = (s, flush) => {\n\n let hash_head; /* head of hash chain */\n let bflush; /* set if current block must be flushed */\n\n let max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n};\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nconst deflate_rle = (s, flush) => {\n\n let bflush; /* set if current block must be flushed */\n let prev; /* byte at distance one to match */\n let scan, strend; /* scan goes up to strend for length of run */\n\n const _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nconst deflate_huff = (s, flush) => {\n\n let bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n break; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}\n\nconst configuration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nconst lm_init = (s) => {\n\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n};\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new Uint16Array(HEAP_SIZE * 2);\n this.dyn_dtree = new Uint16Array((2 * D_CODES + 1) * 2);\n this.bl_tree = new Uint16Array((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new Uint16Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new Uint16Array(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new Uint16Array(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.sym_buf = 0; /* buffer for distances and literals/lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.sym_next = 0; /* running index in sym_buf */\n this.sym_end = 0; /* symbol table full when sym_next reaches this */\n\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n}\n\n\n/* =========================================================================\n * Check for a valid deflate stream state. Return 0 if ok, 1 if not.\n */\nconst deflateStateCheck = (strm) => {\n\n if (!strm) {\n return 1;\n }\n const s = strm.state;\n if (!s || s.strm !== strm || (s.status !== INIT_STATE &&\n//#ifdef GZIP\n s.status !== GZIP_STATE &&\n//#endif\n s.status !== EXTRA_STATE &&\n s.status !== NAME_STATE &&\n s.status !== COMMENT_STATE &&\n s.status !== HCRC_STATE &&\n s.status !== BUSY_STATE &&\n s.status !== FINISH_STATE)) {\n return 1;\n }\n return 0;\n};\n\n\nconst deflateResetKeep = (strm) => {\n\n if (deflateStateCheck(strm)) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n const s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status =\n//#ifdef GZIP\n s.wrap === 2 ? GZIP_STATE :\n//#endif\n s.wrap ? INIT_STATE : BUSY_STATE;\n strm.adler = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = -2;\n _tr_init(s);\n return Z_OK;\n};\n\n\nconst deflateReset = (strm) => {\n\n const ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n};\n\n\nconst deflateSetHeader = (strm, head) => {\n\n if (deflateStateCheck(strm) || strm.state.wrap !== 2) {\n return Z_STREAM_ERROR;\n }\n strm.state.gzhead = head;\n return Z_OK;\n};\n\n\nconst deflateInit2 = (strm, level, method, windowBits, memLevel, strategy) => {\n\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR;\n }\n let wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED || (windowBits === 8 && wrap !== 1)) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n const s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n s.status = INIT_STATE; /* to pass state test in deflateReset() */\n\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n s.window = new Uint8Array(s.w_size * 2);\n s.head = new Uint16Array(s.hash_size);\n s.prev = new Uint16Array(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n /* We overlay pending_buf and sym_buf. This works since the average size\n * for length/distance pairs over any compressed block is assured to be 31\n * bits or less.\n *\n * Analysis: The longest fixed codes are a length code of 8 bits plus 5\n * extra bits, for lengths 131 to 257. The longest fixed distance codes are\n * 5 bits plus 13 extra bits, for distances 16385 to 32768. The longest\n * possible fixed-codes length/distance pair is then 31 bits total.\n *\n * sym_buf starts one-fourth of the way into pending_buf. So there are\n * three bytes in sym_buf for every four bytes in pending_buf. Each symbol\n * in sym_buf is three bytes -- two for the distance and one for the\n * literal/length. As each symbol is consumed, the pointer to the next\n * sym_buf value to read moves forward three bytes. From that symbol, up to\n * 31 bits are written to pending_buf. The closest the written pending_buf\n * bits gets to the next sym_buf symbol to read is just before the last\n * code is written. At that time, 31*(n-2) bits have been written, just\n * after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at\n * 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1\n * symbols are written.) The closest the writing gets to what is unread is\n * then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and\n * can range from 128 to 32768.\n *\n * Therefore, at a minimum, there are 142 bits of space between what is\n * written and what is read in the overlain buffers, so the symbols cannot\n * be overwritten by the compressed data. That space is actually 139 bits,\n * due to the three-bit fixed-code block header.\n *\n * That covers the case where either Z_FIXED is specified, forcing fixed\n * codes, or when the use of fixed codes is chosen, because that choice\n * results in a smaller compressed block than dynamic codes. That latter\n * condition then assures that the above analysis also covers all dynamic\n * blocks. A dynamic-code block will only be chosen to be emitted if it has\n * fewer bits than a fixed-code block would for the same set of symbols.\n * Therefore its average symbol length is assured to be less than 31. So\n * the compressed data for a dynamic block also cannot overwrite the\n * symbols from which it is being constructed.\n */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n s.pending_buf = new Uint8Array(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->sym_buf = s->pending_buf + s->lit_bufsize;\n s.sym_buf = s.lit_bufsize;\n\n //s->sym_end = (s->lit_bufsize - 1) * 3;\n s.sym_end = (s.lit_bufsize - 1) * 3;\n /* We avoid equality with lit_bufsize*3 because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n};\n\nconst deflateInit = (strm, level) => {\n\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n};\n\n\n/* ========================================================================= */\nconst deflate = (strm, flush) => {\n\n if (deflateStateCheck(strm) || flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n\n const s = strm.state;\n\n if (!strm.output ||\n (strm.avail_in !== 0 && !strm.input) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n\n const old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK;\n }\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* Write the header */\n if (s.status === INIT_STATE && s.wrap === 0) {\n s.status = BUSY_STATE;\n }\n if (s.status === INIT_STATE) {\n /* zlib header */\n let header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n let level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n putShortMSB(s, header);\n\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n }\n//#ifdef GZIP\n if (s.status === GZIP_STATE) {\n /* gzip header */\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) { // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n }\n else {\n put_byte(s, (s.gzhead.text ? 1 : 0) +\n (s.gzhead.hcrc ? 2 : 0) +\n (!s.gzhead.extra ? 0 : 4) +\n (!s.gzhead.name ? 0 : 8) +\n (!s.gzhead.comment ? 0 : 16)\n );\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, (s.gzhead.time >> 8) & 0xff);\n put_byte(s, (s.gzhead.time >> 16) & 0xff);\n put_byte(s, (s.gzhead.time >> 24) & 0xff);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let left = (s.gzhead.extra.length & 0xffff) - s.gzindex;\n while (s.pending + left > s.pending_buf_size) {\n let copy = s.pending_buf_size - s.pending;\n // zmemcpy(s.pending_buf + s.pending,\n // s.gzhead.extra + s.gzindex, copy);\n s.pending_buf.set(s.gzhead.extra.subarray(s.gzindex, s.gzindex + copy), s.pending);\n s.pending = s.pending_buf_size;\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex += copy;\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n beg = 0;\n left -= copy;\n }\n // JS specific: s.gzhead.extra may be TypedArray or Array for backward compatibility\n // TypedArray.slice and TypedArray.from don't exist in IE10-IE11\n let gzhead_extra = new Uint8Array(s.gzhead.extra);\n // zmemcpy(s->pending_buf + s->pending,\n // s->gzhead->extra + s->gzindex, left);\n s.pending_buf.set(gzhead_extra.subarray(s.gzindex, s.gzindex + left), s.pending);\n s.pending += left;\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex = 0;\n }\n s.status = NAME_STATE;\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let val;\n do {\n if (s.pending === s.pending_buf_size) {\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n beg = 0;\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex = 0;\n }\n s.status = COMMENT_STATE;\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let val;\n do {\n if (s.pending === s.pending_buf_size) {\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n beg = 0;\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n }\n s.status = HCRC_STATE;\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n }\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n }\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK;\n }\n }\n//#endif\n\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n let bstate = s.level === 0 ? deflate_stored(s, flush) :\n s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :\n s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush);\n\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n _tr_align(s);\n }\n else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n _tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH) {\n /*** CLEAR_HASH(s); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n }\n\n if (flush !== Z_FINISH) { return Z_OK; }\n if (s.wrap <= 0) { return Z_STREAM_END; }\n\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n put_byte(s, (strm.adler >> 16) & 0xff);\n put_byte(s, (strm.adler >> 24) & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, (strm.total_in >> 8) & 0xff);\n put_byte(s, (strm.total_in >> 16) & 0xff);\n put_byte(s, (strm.total_in >> 24) & 0xff);\n }\n else\n {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n};\n\n\nconst deflateEnd = (strm) => {\n\n if (deflateStateCheck(strm)) {\n return Z_STREAM_ERROR;\n }\n\n const status = strm.state.status;\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n};\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nconst deflateSetDictionary = (strm, dictionary) => {\n\n let dictLength = dictionary.length;\n\n if (deflateStateCheck(strm)) {\n return Z_STREAM_ERROR;\n }\n\n const s = strm.state;\n const wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR;\n }\n\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n let tmpDict = new Uint8Array(s.w_size);\n tmpDict.set(dictionary.subarray(dictLength - s.w_size, dictLength), 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n const avail = strm.avail_in;\n const next = strm.next_in;\n const input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n let str = s.strstart;\n let n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]);\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK;\n};\n\n\nmodule.exports.deflateInit = deflateInit;\nmodule.exports.deflateInit2 = deflateInit2;\nmodule.exports.deflateReset = deflateReset;\nmodule.exports.deflateResetKeep = deflateResetKeep;\nmodule.exports.deflateSetHeader = deflateSetHeader;\nmodule.exports.deflate = deflate;\nmodule.exports.deflateEnd = deflateEnd;\nmodule.exports.deflateSetDictionary = deflateSetDictionary;\nmodule.exports.deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nmodule.exports.deflateBound = deflateBound;\nmodule.exports.deflateCopy = deflateCopy;\nmodule.exports.deflateGetDictionary = deflateGetDictionary;\nmodule.exports.deflateParams = deflateParams;\nmodule.exports.deflatePending = deflatePending;\nmodule.exports.deflatePrime = deflatePrime;\nmodule.exports.deflateTune = deflateTune;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nmodule.exports = GZheader;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nconst BAD = 16209; /* got a data error -- remain here until reset */\nconst TYPE = 16191; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n let _in; /* local strm.input */\n let last; /* have enough input while in < last */\n let _out; /* local strm.output */\n let beg; /* inflate()'s initial strm.output */\n let end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n let dmax; /* maximum distance from zlib header */\n//#endif\n let wsize; /* window size or zero if not using window */\n let whave; /* valid bytes in the window */\n let wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n let s_window; /* allocated sliding window, if wsize != 0 */\n let hold; /* local strm.hold */\n let bits; /* local strm.bits */\n let lcode; /* local strm.lencode */\n let dcode; /* local strm.distcode */\n let lmask; /* mask for first level of length codes */\n let dmask; /* mask for first level of distance codes */\n let here; /* retrieved table entry */\n let op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n let len; /* match length, unused bytes */\n let dist; /* match distance */\n let from; /* where to copy match from */\n let from_source;\n\n\n let input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n const state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst adler32 = require('./adler32');\nconst crc32 = require('./crc32');\nconst inflate_fast = require('./inffast');\nconst inflate_table = require('./inftrees');\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_FINISH, Z_BLOCK, Z_TREES,\n Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR, Z_BUF_ERROR,\n Z_DEFLATED\n} = require('./constants');\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nconst HEAD = 16180; /* i: waiting for magic header */\nconst FLAGS = 16181; /* i: waiting for method and flags (gzip) */\nconst TIME = 16182; /* i: waiting for modification time (gzip) */\nconst OS = 16183; /* i: waiting for extra flags and operating system (gzip) */\nconst EXLEN = 16184; /* i: waiting for extra length (gzip) */\nconst EXTRA = 16185; /* i: waiting for extra bytes (gzip) */\nconst NAME = 16186; /* i: waiting for end of file name (gzip) */\nconst COMMENT = 16187; /* i: waiting for end of comment (gzip) */\nconst HCRC = 16188; /* i: waiting for header crc (gzip) */\nconst DICTID = 16189; /* i: waiting for dictionary check value */\nconst DICT = 16190; /* waiting for inflateSetDictionary() call */\nconst TYPE = 16191; /* i: waiting for type bits, including last-flag bit */\nconst TYPEDO = 16192; /* i: same, but skip check to exit inflate on new block */\nconst STORED = 16193; /* i: waiting for stored size (length and complement) */\nconst COPY_ = 16194; /* i/o: same as COPY below, but only first time in */\nconst COPY = 16195; /* i/o: waiting for input or output to copy stored block */\nconst TABLE = 16196; /* i: waiting for dynamic block table lengths */\nconst LENLENS = 16197; /* i: waiting for code length code lengths */\nconst CODELENS = 16198; /* i: waiting for length/lit and distance code lengths */\nconst LEN_ = 16199; /* i: same as LEN below, but only first time in */\nconst LEN = 16200; /* i: waiting for length/lit/eob code */\nconst LENEXT = 16201; /* i: waiting for length extra bits */\nconst DIST = 16202; /* i: waiting for distance code */\nconst DISTEXT = 16203; /* i: waiting for distance extra bits */\nconst MATCH = 16204; /* o: waiting for output space to copy string */\nconst LIT = 16205; /* o: waiting for output space to write literal */\nconst CHECK = 16206; /* i: waiting for 32-bit check value */\nconst LENGTH = 16207; /* i: waiting for 32-bit length (gzip) */\nconst DONE = 16208; /* finished check, done -- remain here until reset */\nconst BAD = 16209; /* got a data error -- remain here until reset */\nconst MEM = 16210; /* got an inflate() memory error -- remain here until reset */\nconst SYNC = 16211; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nconst ENOUGH_LENS = 852;\nconst ENOUGH_DISTS = 592;\n//const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst MAX_WBITS = 15;\n/* 32K LZ77 window */\nconst DEF_WBITS = MAX_WBITS;\n\n\nconst zswap32 = (q) => {\n\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n};\n\n\nfunction InflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip,\n bit 2 true to validate check value */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib), or\n -1 if raw or no header yet */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new Uint16Array(320); /* temporary storage for code lengths */\n this.work = new Uint16Array(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new Int32Array(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\n\nconst inflateStateCheck = (strm) => {\n\n if (!strm) {\n return 1;\n }\n const state = strm.state;\n if (!state || state.strm !== strm ||\n state.mode < HEAD || state.mode > SYNC) {\n return 1;\n }\n return 0;\n};\n\n\nconst inflateResetKeep = (strm) => {\n\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.flags = -1;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS);\n state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n};\n\n\nconst inflateReset = (strm) => {\n\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n};\n\n\nconst inflateReset2 = (strm, windowBits) => {\n let wrap;\n\n /* get the state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 5;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n};\n\n\nconst inflateInit2 = (strm, windowBits) => {\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n const state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.strm = strm;\n state.window = null/*Z_NULL*/;\n state.mode = HEAD; /* to pass state test in inflateReset2() */\n const ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n};\n\n\nconst inflateInit = (strm) => {\n\n return inflateInit2(strm, DEF_WBITS);\n};\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nlet virgin = true;\n\nlet lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\n\nconst fixedtables = (state) => {\n\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n lenfix = new Int32Array(512);\n distfix = new Int32Array(32);\n\n /* literal/length table */\n let sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n};\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nconst updatewindow = (strm, src, end, copy) => {\n\n let dist;\n const state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new Uint8Array(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n state.window.set(src.subarray(end - state.wsize, end), 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n state.window.set(src.subarray(end - copy, end - copy + dist), state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n state.window.set(src.subarray(end - copy, end), 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n};\n\n\nconst inflate = (strm, flush) => {\n\n let state;\n let input, output; // input/output buffers\n let next; /* next input INDEX */\n let put; /* next output INDEX */\n let have, left; /* available input and output */\n let hold; /* bit buffer */\n let bits; /* bits in bit buffer */\n let _in, _out; /* save starting available input and output */\n let copy; /* number of stored or match bytes to copy */\n let from; /* where to copy match bytes from */\n let from_source;\n let here = 0; /* current decoding table entry */\n let here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //let last; /* parent table entry */\n let last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n let len; /* length to copy for repeats, bits to drop */\n let ret; /* return code */\n const hbuf = new Uint8Array(4); /* buffer for gzip header crc calculation */\n let opts;\n\n let n; // temporary variable for NEED_BITS\n\n const order = /* permutation of code lengths */\n new Uint8Array([ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]);\n\n\n if (inflateStateCheck(strm) || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n if (state.wbits === 0) {\n state.wbits = 15;\n }\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n if (len > 15 || len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n\n // !!! pako patch. Force use `options.windowBits` if passed.\n // Required to always use max window size by default.\n state.dmax = 1 << state.wbits;\n //state.dmax = 1 << len;\n\n state.flags = 0; /* indicate zlib header */\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Uint8Array(state.head.extra_len);\n }\n state.head.extra.set(\n input.subarray(\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n next + copy\n ),\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 4) && hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n output.set(input.subarray(next, next + copy), put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if ((state.wrap & 4) && _out) {\n strm.adler = state.check =\n /*UPDATE_CHECK(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.wrap & 4) && (state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 4) && hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if ((state.wrap & 4) && _out) {\n strm.adler = state.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n};\n\n\nconst inflateEnd = (strm) => {\n\n if (inflateStateCheck(strm)) {\n return Z_STREAM_ERROR;\n }\n\n let state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n};\n\n\nconst inflateGetHeader = (strm, head) => {\n\n /* check state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n};\n\n\nconst inflateSetDictionary = (strm, dictionary) => {\n const dictLength = dictionary.length;\n\n let state;\n let dictid;\n let ret;\n\n /* check state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n};\n\n\nmodule.exports.inflateReset = inflateReset;\nmodule.exports.inflateReset2 = inflateReset2;\nmodule.exports.inflateResetKeep = inflateResetKeep;\nmodule.exports.inflateInit = inflateInit;\nmodule.exports.inflateInit2 = inflateInit2;\nmodule.exports.inflate = inflate;\nmodule.exports.inflateEnd = inflateEnd;\nmodule.exports.inflateGetHeader = inflateGetHeader;\nmodule.exports.inflateSetDictionary = inflateSetDictionary;\nmodule.exports.inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nmodule.exports.inflateCodesUsed = inflateCodesUsed;\nmodule.exports.inflateCopy = inflateCopy;\nmodule.exports.inflateGetDictionary = inflateGetDictionary;\nmodule.exports.inflateMark = inflateMark;\nmodule.exports.inflatePrime = inflatePrime;\nmodule.exports.inflateSync = inflateSync;\nmodule.exports.inflateSyncPoint = inflateSyncPoint;\nmodule.exports.inflateUndermine = inflateUndermine;\nmodule.exports.inflateValidate = inflateValidate;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst MAXBITS = 15;\nconst ENOUGH_LENS = 852;\nconst ENOUGH_DISTS = 592;\n//const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\nconst lbase = new Uint16Array([ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n]);\n\nconst lext = new Uint8Array([ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n]);\n\nconst dbase = new Uint16Array([ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n]);\n\nconst dext = new Uint8Array([ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n]);\n\nconst inflate_table = (type, lens, lens_index, codes, table, table_index, work, opts) =>\n{\n const bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n let len = 0; /* a code's length in bits */\n let sym = 0; /* index of code symbols */\n let min = 0, max = 0; /* minimum and maximum code lengths */\n let root = 0; /* number of index bits for root table */\n let curr = 0; /* number of index bits for current table */\n let drop = 0; /* code bits to drop for sub-table */\n let left = 0; /* number of prefix codes available */\n let used = 0; /* code entries in table used */\n let huff = 0; /* Huffman code */\n let incr; /* for incrementing code, index */\n let fill; /* index for replicating entries */\n let low; /* low bits for current root entry */\n let mask; /* mask for low root bits */\n let next; /* next available space in table */\n let base = null; /* base value table to use */\n// let shoextra; /* extra bits table to use */\n let match; /* use base and extra for symbol >= match */\n const count = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n const offs = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n let extra = null;\n\n let here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n match = 20;\n\n } else if (type === LENS) {\n base = lbase;\n extra = lext;\n match = 257;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n match = 0;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] + 1 < match) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] >= match) {\n here_op = extra[work[sym] - match];\n here_val = base[work[sym] - match];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n\n\nmodule.exports = inflate_table;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* eslint-disable space-unary-ops */\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//const Z_FILTERED = 1;\n//const Z_HUFFMAN_ONLY = 2;\n//const Z_RLE = 3;\nconst Z_FIXED = 4;\n//const Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nconst Z_BINARY = 0;\nconst Z_TEXT = 1;\n//const Z_ASCII = 1; // = Z_TEXT\nconst Z_UNKNOWN = 2;\n\n/*============================================================================*/\n\n\nfunction zero(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nconst STORED_BLOCK = 0;\nconst STATIC_TREES = 1;\nconst DYN_TREES = 2;\n/* The three kinds of block type */\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nconst LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nconst LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nconst L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nconst D_CODES = 30;\n/* number of distance codes */\n\nconst BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nconst HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nconst MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nconst MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nconst END_BLOCK = 256;\n/* end of block literal code */\n\nconst REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nconst REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nconst REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nconst extra_lbits = /* extra bits for each length code */\n new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]);\n\nconst extra_dbits = /* extra bits for each distance code */\n new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]);\n\nconst extra_blbits = /* extra bits for each bit length code */\n new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]);\n\nconst bl_order =\n new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nconst DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nconst static_ltree = new Array((L_CODES + 2) * 2);\nzero(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nconst static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nconst _dist_code = new Array(DIST_CODE_LEN);\nzero(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nconst _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nconst base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nconst base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nlet static_l_desc;\nlet static_d_desc;\nlet static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nconst d_code = (dist) => {\n\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n};\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nconst put_short = (s, w) => {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n};\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nconst send_bits = (s, value, length) => {\n\n if (s.bi_valid > (Buf_size - length)) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n};\n\n\nconst send_code = (s, c, tree) => {\n\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n};\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nconst bi_reverse = (code, len) => {\n\n let res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n};\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nconst bi_flush = (s) => {\n\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n};\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nconst gen_bitlen = (s, desc) => {\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n\n const tree = desc.dyn_tree;\n const max_code = desc.max_code;\n const stree = desc.stat_desc.static_tree;\n const has_stree = desc.stat_desc.has_stree;\n const extra = desc.stat_desc.extra_bits;\n const base = desc.stat_desc.extra_base;\n const max_length = desc.stat_desc.max_length;\n let h; /* heap index */\n let n, m; /* iterate over the tree elements */\n let bits; /* bit length */\n let xbits; /* extra bits */\n let f; /* frequency */\n let overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Tracev((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Tracev((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n};\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nconst gen_codes = (tree, max_code, bl_count) => {\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n\n const next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n let code = 0; /* running code value */\n let bits; /* bit index */\n let n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n code = (code + bl_count[bits - 1]) << 1;\n next_code[bits] = code;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1< {\n\n let n; /* iterates over tree elements */\n let bits; /* bit counter */\n let length; /* length value */\n let code; /* code value */\n let dist; /* distance index */\n const bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n};\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nconst init_block = (s) => {\n\n let n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.sym_next = s.matches = 0;\n};\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nconst bi_windup = (s) =>\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n};\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nconst smaller = (tree, n, m, depth) => {\n\n const _n2 = n * 2;\n const _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n};\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nconst pqdownheap = (s, tree, k) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n\n const v = s.heap[k];\n let j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n};\n\n\n// inlined manually\n// const SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nconst compress_block = (s, ltree, dtree) => {\n// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n\n let dist; /* distance of matched string */\n let lc; /* match length or unmatched char (if dist == 0) */\n let sx = 0; /* running index in sym_buf */\n let code; /* the code to send */\n let extra; /* number of extra bits to send */\n\n if (s.sym_next !== 0) {\n do {\n dist = s.pending_buf[s.sym_buf + sx++] & 0xff;\n dist += (s.pending_buf[s.sym_buf + sx++] & 0xff) << 8;\n lc = s.pending_buf[s.sym_buf + sx++];\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and sym_buf is ok: */\n //Assert(s->pending < s->lit_bufsize + sx, \"pendingBuf overflow\");\n\n } while (sx < s.sym_next);\n }\n\n send_code(s, END_BLOCK, ltree);\n};\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nconst build_tree = (s, desc) => {\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n\n const tree = desc.dyn_tree;\n const stree = desc.stat_desc.static_tree;\n const has_stree = desc.stat_desc.has_stree;\n const elems = desc.stat_desc.elems;\n let n, m; /* iterate over heap elements */\n let max_code = -1; /* largest code with non zero frequency */\n let node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE;\n\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);\n tree[node * 2]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n /*** pqremove ***/\n n = s.heap[1/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n};\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nconst scan_tree = (s, tree, max_code) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n};\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nconst send_tree = (s, tree, max_code) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n};\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nconst build_bl_tree = (s) => {\n\n let max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n};\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nconst send_all_trees = (s, lcodes, dcodes, blcodes) => {\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n\n let rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n};\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"block list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"allow list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nconst detect_data_type = (s) => {\n /* block_mask is the bit mask of block-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n let block_mask = 0xf3ffc07f;\n let n;\n\n /* Check for non-textual (\"block-listed\") bytes. */\n for (n = 0; n <= 31; n++, block_mask >>>= 1) {\n if ((block_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"allow-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n }\n\n /* There are no \"block-listed\" or \"allow-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n};\n\n\nlet static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nconst _tr_init = (s) =>\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n};\n\n\n/* ===========================================================================\n * Send a stored block\n */\nconst _tr_stored_block = (s, buf, stored_len, last) => {\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n bi_windup(s); /* align on byte boundary */\n put_short(s, stored_len);\n put_short(s, ~stored_len);\n if (stored_len) {\n s.pending_buf.set(s.window.subarray(buf, buf + stored_len), s.pending);\n }\n s.pending += stored_len;\n};\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nconst _tr_align = (s) => {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n};\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and write out the encoded block.\n */\nconst _tr_flush_block = (s, buf, stored_len, last) => {\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n\n let opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n let max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->sym_next / 3));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n};\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nconst _tr_tally = (s, dist, lc) => {\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n\n s.pending_buf[s.sym_buf + s.sym_next++] = dist;\n s.pending_buf[s.sym_buf + s.sym_next++] = dist >> 8;\n s.pending_buf[s.sym_buf + s.sym_next++] = lc;\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n return (s.sym_next === s.sym_end);\n};\n\nmodule.exports._tr_init = _tr_init;\nmodule.exports._tr_stored_block = _tr_stored_block;\nmodule.exports._tr_flush_block = _tr_flush_block;\nmodule.exports._tr_tally = _tr_tally;\nmodule.exports._tr_align = _tr_align;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nmodule.exports = ZStream;\n","import { Spec } from \"vega\";\nimport vegaEmbed, { EmbedOptions, Mode } from \"vega-embed\";\nimport { TopLevelSpec } from \"vega-lite\";\n\nexport { default as vegaEmbed } from \"vega-embed\";\nexport { VegaWidgetModel, VegaWidget } from \"./widget\";\nexport const version = require(\"../package.json\").version;\n\nfunction javascriptIndex(selector: string, outputs: any) {\n // Return the index in the output array of the JS repr of this viz\n for (let i = 0; i < outputs.length; i++) {\n const item = outputs[i];\n if (\n item.metadata &&\n item.metadata[\"jupyter-vega\"] === selector &&\n item.data[\"application/javascript\"] !== undefined\n ) {\n return i;\n }\n }\n return -1;\n}\n\nfunction imageIndex(selector: string, outputs: any) {\n // Return the index in the output array of the PNG repr of this viz\n for (let i = 0; i < outputs.length; i++) {\n const item = outputs[i];\n if (\n item.metadata &&\n item.metadata[\"jupyter-vega\"] === selector &&\n item.data[\"image/png\"] !== undefined\n ) {\n return i;\n }\n }\n return -1;\n}\n\nfunction showError(el: HTMLElement, error: Error) {\n el.innerHTML = `
\n

Javascript Error: ${error.message}

\n

This usually means there's a typo in your chart specification.\n See the JavaScript console for the full traceback.

\n
`;\n\n throw error;\n}\n\nexport function render(\n selector: string,\n spec: Spec | TopLevelSpec,\n type: Mode,\n opt: EmbedOptions,\n output_area: any,\n) {\n // Find the indices of this visualizations JS and PNG\n // representation.\n const imgIndex = imageIndex(selector, output_area.outputs);\n const jsIndex = javascriptIndex(selector, output_area.outputs);\n\n // If we have already rendered a static image, don't render\n // the JS version or append a new PNG version\n if (imgIndex > -1 && jsIndex > -1) {\n return;\n }\n\n // Never been rendered, so render JS and append the PNG to the\n // outputs for the cell\n const el = document.getElementById(selector.substring(1))!;\n vegaEmbed(el, spec, {\n loader: { http: { credentials: \"same-origin\" } },\n ...opt,\n mode: type,\n })\n .then((result) => {\n result.view\n .toImageURL(\"png\")\n .then((imageData) => {\n if (output_area !== undefined) {\n const output = {\n data: {\n \"image/png\": imageData.split(\",\")[1],\n },\n metadata: { \"jupyter-vega\": selector },\n output_type: \"display_data\",\n };\n // This appends the PNG output, but doesn't render it this time\n // as the JS version will be rendered already.\n output_area.outputs.push(output);\n }\n })\n .catch((error) => showError(el, error));\n })\n .catch((error) => showError(el, error));\n}\n\nexport * from \"./widget\";\n","import * as plugin from \"./index\";\nimport * as base from \"@jupyter-widgets/base\";\n\nmodule.exports = {\n id: \"jupyter-vega\",\n requires: [base.IJupyterWidgetRegistry],\n activate: (app: any, widgets: any) => {\n widgets.registerWidget({\n name: \"jupyter-vega\",\n version: plugin.version,\n exports: plugin,\n });\n },\n autoStart: true,\n};\n","const pkg = require(\"../package.json\");\nexport const MODULE_VERSION = pkg.version;\nexport const MODULE_NAME = pkg.name;\n","import { DOMWidgetView, DOMWidgetModel } from \"@jupyter-widgets/base\";\nimport { MODULE_NAME, MODULE_VERSION } from \"./version\";\nimport { vegaEmbed } from \"./index\";\nimport { Result } from \"vega-embed\";\nimport * as ndarray from \"ndarray\";\nimport { table_serialization, rowProxy, IDict } from \"jupyter-tablewidgets\";\n\ninterface WidgetUpdate {\n key: string;\n remove?: string;\n insert?: any[] | \"@dataframe\" | \"@array2d\";\n}\n\ninterface WidgetUpdateMessage {\n type: \"update\";\n updates: WidgetUpdate[];\n resize: boolean;\n}\n\nfunction serializeImgURL(imgURL: string, mgr: VegaWidgetModel): string {\n if (\n mgr.viewInstance === null ||\n mgr.viewInstance.viewElement === undefined ||\n mgr.viewInstance.hasBeenUpdated === false\n ) {\n return imgURL;\n }\n let id_ = mgr.viewInstance.viewElement.id;\n if (id_ === \"\" || id_ === undefined) {\n id_ = \"VEGA_ID_\" + crypto.randomUUID();\n mgr.viewInstance.viewElement.id = id_;\n }\n let canvas = document.querySelector(`#${id_} canvas`);\n if (canvas === null) {\n return imgURL;\n }\n return JSON.stringify({\n // @ts-ignore\n width: canvas.style.width || canvas.width,\n // @ts-ignore\n height: canvas.style.height || canvas.height,\n // @ts-ignore\n url: canvas.toDataURL(),\n });\n}\n\n// validate the ev object and cast it to the correct type\nfunction checkWidgetUpdate(ev: any): WidgetUpdateMessage | null {\n if (ev.type != \"update\") {\n return null;\n }\n\n // TODO: Fully validate ev and give a easy to understand error message if it is ill-formed\n return ev as WidgetUpdateMessage;\n}\n\nexport class VegaWidgetModel extends DOMWidgetModel {\n defaults() {\n return {\n ...DOMWidgetModel.prototype.defaults(),\n _model_name: \"VegaWidgetModel\",\n _view_name: \"VegaWidget\",\n _spec_source: \"\",\n _opt_source: \"\",\n _df: ndarray([]),\n _img_url: \"\",\n _columns: [],\n };\n }\n viewInstance: VegaWidget | null = null;\n static serializers = {\n ...DOMWidgetModel.serializers,\n _img_url: { serialize: serializeImgURL } as any,\n _df: table_serialization as any,\n };\n\n static model_name = \"VegaWidgetModel\";\n static model_module = MODULE_NAME;\n static model_module_version = MODULE_VERSION;\n static view_name = \"VegaWidget\";\n static view_module = MODULE_NAME;\n static view_module_version = MODULE_VERSION;\n}\n\nexport class VegaWidget extends DOMWidgetView {\n result?: Result;\n hasBeenUpdated: boolean = false; // when it is \"true\" it means that the view has been updated at least once\n viewElement = document.createElement(\"div\");\n errorElement = document.createElement(\"div\");\n\n async render() {\n this.el.appendChild(this.viewElement);\n this.errorElement.style.color = \"red\";\n this.el.appendChild(this.errorElement);\n let model = this.model as VegaWidgetModel;\n model.viewInstance = this;\n const reembed = async () => {\n const spec = JSON.parse(this.model.get(\"_spec_source\"));\n const opt = JSON.parse(this.model.get(\"_opt_source\") || \"{}\");\n const imgURL = this.model.get(\"_img_url\");\n if (imgURL !== \"\" && imgURL !== \"null\") {\n let imgJson = JSON.parse(imgURL);\n let imgElement = document.createElement(\"img\");\n imgElement.src = imgJson.url;\n let h = parseInt(imgJson.height);\n if (h > 0) {\n imgElement.height = h;\n }\n let w = parseInt(imgJson.width);\n if (w > 0) {\n imgElement.width = w;\n }\n this.viewElement.appendChild(imgElement);\n this.model.set(\"_img_url\", \"null\");\n return;\n }\n if (spec == null) {\n return;\n }\n try {\n const result = await vegaEmbed(this.viewElement, spec, {\n loader: { http: { credentials: \"same-origin\" } },\n ...opt,\n });\n if (this.result) {\n this.result.finalize();\n }\n this.result = result;\n this.send({ type: \"display\" });\n } catch (err) {\n if (this.result) {\n this.result.finalize();\n }\n console.error(err);\n }\n };\n\n const applyUpdate = async (update: WidgetUpdate, resize: boolean) => {\n const result = this.result;\n if (result == null) {\n throw new Error(\"Internal error: no view attached to widget\");\n }\n const filter = new Function(\n \"datum\",\n `return (${update.remove || \"false\"})`,\n );\n let newValues = update.insert || [];\n switch (newValues) {\n case \"@dataframe\": {\n newValues = this.updateDataFrame();\n break;\n }\n case \"@array2d\": {\n newValues = this.updateArray2D();\n }\n }\n const changeSet = result.view\n .changeset()\n .remove(filter)\n .insert(newValues);\n const view = result.view.change(update.key, changeSet);\n if (resize) view.resize();\n await view.runAsync();\n };\n\n const applyUpdates = async (message: WidgetUpdateMessage) => {\n this.hasBeenUpdated = true;\n for (const update of message.updates) {\n await applyUpdate(update, message.resize);\n }\n };\n\n this.model.on(\"change:_spec_source\", reembed);\n this.model.on(\"change:_opt_source\", reembed);\n this.model.on(\"msg:custom\", (ev: any) => {\n const message = checkWidgetUpdate(ev);\n if (message == null) {\n return;\n }\n\n applyUpdates(message).catch((err: Error) => {\n this.errorElement.textContent = String(err);\n console.error(err);\n });\n });\n\n // initial rendering\n await reembed();\n }\n\n updateDataFrame(): any[] {\n const table = this.model.get(\"_df\");\n const proxy = rowProxy(table);\n const rows = Array(table.size);\n for (let i = 0; i < rows.length; ++i) {\n rows[i] = proxy(i);\n }\n return rows;\n }\n\n updateArray2D(): any[] {\n /* A 2D array is encoded for transfer like a dataframe\n having an unique, (2D) column.\n The column name is \"special\", i.e. it is a string containing\n three comma separated keys, e.g. \"x,y,z\"\n this format is useful for encoding, for example, a heatmap */\n const table = this.model.get(\"_df\");\n const res = Array(table.size * table.size);\n const fancyCol = table.columns[0];\n const arr: ndarray.NdArray = table.data[fancyCol];\n const cols: string[] = fancyCol.split(\",\");\n let k = 0;\n for (let i = 0; i < arr.shape[0]; i++) {\n for (let j = 0; j < arr.shape[1]; j++) {\n let row: IDict = {};\n row[cols[0]] = i;\n row[cols[1]] = j;\n row[cols[2]] = arr.get(i, j);\n res[k++] = row;\n }\n }\n return res;\n }\n}\n","\"use strict\"\n\nfunction unique_pred(list, compare) {\n var ptr = 1\n , len = list.length\n , a=list[0], b=list[0]\n for(var i=1; i= 48 && charCode <= 57) {\n i++;\n continue;\n }\n return false;\n }\n return true;\n }\n /**\n * Escapes a json pointer path\n * @param path The raw pointer\n * @return the Escaped path\n */\n function escapePathComponent(path) {\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1) return path;\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\n }\n /**\n * Unescapes a json pointer path\n * @param path The escaped pointer\n * @return The unescaped path\n */\n function unescapePathComponent(path) {\n return path.replace(/~1/g, '/').replace(/~0/g, '~');\n }\n /**\n * Recursively checks whether an object has any undefined values inside.\n */\n function hasUndefined(obj) {\n if (obj === undefined) {\n return true;\n }\n if (obj) {\n if (Array.isArray(obj)) {\n for (var i_1 = 0, len = obj.length; i_1 < len; i_1++) {\n if (hasUndefined(obj[i_1])) {\n return true;\n }\n }\n } else if (typeof obj === \"object\") {\n var objKeys = _objectKeys(obj);\n var objKeysLength = objKeys.length;\n for (var i = 0; i < objKeysLength; i++) {\n if (hasUndefined(obj[objKeys[i]])) {\n return true;\n }\n }\n }\n }\n return false;\n }\n function patchErrorMessageFormatter(message, args) {\n var messageParts = [message];\n for (var key in args) {\n var value = typeof args[key] === 'object' ? JSON.stringify(args[key], null, 2) : args[key]; // pretty print\n if (typeof value !== 'undefined') {\n messageParts.push(key + \": \" + value);\n }\n }\n return messageParts.join('\\n');\n }\n var PatchError = /** @class */function (_super) {\n __extends(PatchError, _super);\n function PatchError(message, name, index, operation, tree) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, patchErrorMessageFormatter(message, {\n name: name,\n index: index,\n operation: operation,\n tree: tree\n })) || this;\n _this.name = name;\n _this.index = index;\n _this.operation = operation;\n _this.tree = tree;\n Object.setPrototypeOf(_this, _newTarget.prototype); // restore prototype chain, see https://stackoverflow.com/a/48342359\n _this.message = patchErrorMessageFormatter(message, {\n name: name,\n index: index,\n operation: operation,\n tree: tree\n });\n return _this;\n }\n return PatchError;\n }(Error);\n\n var JsonPatchError = PatchError;\n var deepClone = _deepClone;\n /* We use a Javascript hash to store each\n function. Each hash entry (property) uses\n the operation identifiers specified in rfc6902.\n In this way, we can map each patch operation\n to its dedicated function in efficient way.\n */\n /* The operations applicable to an object */\n var objOps = {\n add: function (obj, key, document) {\n obj[key] = this.value;\n return {\n newDocument: document\n };\n },\n remove: function (obj, key, document) {\n var removed = obj[key];\n delete obj[key];\n return {\n newDocument: document,\n removed: removed\n };\n },\n replace: function (obj, key, document) {\n var removed = obj[key];\n obj[key] = this.value;\n return {\n newDocument: document,\n removed: removed\n };\n },\n move: function (obj, key, document) {\n /* in case move target overwrites an existing value,\n return the removed value, this can be taxing performance-wise,\n and is potentially unneeded */\n var removed = getValueByPointer(document, this.path);\n if (removed) {\n removed = _deepClone(removed);\n }\n var originalValue = applyOperation(document, {\n op: \"remove\",\n path: this.from\n }).removed;\n applyOperation(document, {\n op: \"add\",\n path: this.path,\n value: originalValue\n });\n return {\n newDocument: document,\n removed: removed\n };\n },\n copy: function (obj, key, document) {\n var valueToCopy = getValueByPointer(document, this.from);\n // enforce copy by value so further operations don't affect source (see issue #177)\n applyOperation(document, {\n op: \"add\",\n path: this.path,\n value: _deepClone(valueToCopy)\n });\n return {\n newDocument: document\n };\n },\n test: function (obj, key, document) {\n return {\n newDocument: document,\n test: _areEquals(obj[key], this.value)\n };\n },\n _get: function (obj, key, document) {\n this.value = obj[key];\n return {\n newDocument: document\n };\n }\n };\n /* The operations applicable to an array. Many are the same as for the object */\n var arrOps = {\n add: function (arr, i, document) {\n if (isInteger(i)) {\n arr.splice(i, 0, this.value);\n } else {\n // array props\n arr[i] = this.value;\n }\n // this may be needed when using '-' in an array\n return {\n newDocument: document,\n index: i\n };\n },\n remove: function (arr, i, document) {\n var removedList = arr.splice(i, 1);\n return {\n newDocument: document,\n removed: removedList[0]\n };\n },\n replace: function (arr, i, document) {\n var removed = arr[i];\n arr[i] = this.value;\n return {\n newDocument: document,\n removed: removed\n };\n },\n move: objOps.move,\n copy: objOps.copy,\n test: objOps.test,\n _get: objOps._get\n };\n /**\n * Retrieves a value from a JSON document by a JSON pointer.\n * Returns the value.\n *\n * @param document The document to get the value from\n * @param pointer an escaped JSON pointer\n * @return The retrieved value\n */\n function getValueByPointer(document, pointer) {\n if (pointer == '') {\n return document;\n }\n var getOriginalDestination = {\n op: \"_get\",\n path: pointer\n };\n applyOperation(document, getOriginalDestination);\n return getOriginalDestination.value;\n }\n /**\n * Apply a single JSON Patch Operation on a JSON document.\n * Returns the {newDocument, result} of the operation.\n * It modifies the `document` and `operation` objects - it gets the values by reference.\n * If you would like to avoid touching your values, clone them:\n * `jsonpatch.applyOperation(document, jsonpatch._deepClone(operation))`.\n *\n * @param document The document to patch\n * @param operation The operation to apply\n * @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.\n * @param mutateDocument Whether to mutate the original document or clone it before applying\n * @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.\n * @return `{newDocument, result}` after the operation\n */\n function applyOperation(document, operation, validateOperation, mutateDocument, banPrototypeModifications, index) {\n if (validateOperation === void 0) {\n validateOperation = false;\n }\n if (mutateDocument === void 0) {\n mutateDocument = true;\n }\n if (banPrototypeModifications === void 0) {\n banPrototypeModifications = true;\n }\n if (index === void 0) {\n index = 0;\n }\n if (validateOperation) {\n if (typeof validateOperation == 'function') {\n validateOperation(operation, 0, document, operation.path);\n } else {\n validator(operation, 0);\n }\n }\n /* ROOT OPERATIONS */\n if (operation.path === \"\") {\n var returnValue = {\n newDocument: document\n };\n if (operation.op === 'add') {\n returnValue.newDocument = operation.value;\n return returnValue;\n } else if (operation.op === 'replace') {\n returnValue.newDocument = operation.value;\n returnValue.removed = document; //document we removed\n return returnValue;\n } else if (operation.op === 'move' || operation.op === 'copy') {\n // it's a move or copy to root\n returnValue.newDocument = getValueByPointer(document, operation.from); // get the value by json-pointer in `from` field\n if (operation.op === 'move') {\n // report removed item\n returnValue.removed = document;\n }\n return returnValue;\n } else if (operation.op === 'test') {\n returnValue.test = _areEquals(document, operation.value);\n if (returnValue.test === false) {\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n returnValue.newDocument = document;\n return returnValue;\n } else if (operation.op === 'remove') {\n // a remove on root\n returnValue.removed = document;\n returnValue.newDocument = null;\n return returnValue;\n } else if (operation.op === '_get') {\n operation.value = document;\n return returnValue;\n } else {\n /* bad operation */\n if (validateOperation) {\n throw new JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document);\n } else {\n return returnValue;\n }\n }\n } /* END ROOT OPERATIONS */else {\n if (!mutateDocument) {\n document = _deepClone(document);\n }\n var path = operation.path || \"\";\n var keys = path.split('/');\n var obj = document;\n var t = 1; //skip empty element - http://jsperf.com/to-shift-or-not-to-shift\n var len = keys.length;\n var existingPathFragment = undefined;\n var key = void 0;\n var validateFunction = void 0;\n if (typeof validateOperation == 'function') {\n validateFunction = validateOperation;\n } else {\n validateFunction = validator;\n }\n while (true) {\n key = keys[t];\n if (key && key.indexOf('~') != -1) {\n key = unescapePathComponent(key);\n }\n if (banPrototypeModifications && (key == '__proto__' || key == 'prototype' && t > 0 && keys[t - 1] == 'constructor')) {\n throw new TypeError('JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README');\n }\n if (validateOperation) {\n if (existingPathFragment === undefined) {\n if (obj[key] === undefined) {\n existingPathFragment = keys.slice(0, t).join('/');\n } else if (t == len - 1) {\n existingPathFragment = operation.path;\n }\n if (existingPathFragment !== undefined) {\n validateFunction(operation, 0, document, existingPathFragment);\n }\n }\n }\n t++;\n if (Array.isArray(obj)) {\n if (key === '-') {\n key = obj.length;\n } else {\n if (validateOperation && !isInteger(key)) {\n throw new JsonPatchError(\"Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index\", \"OPERATION_PATH_ILLEGAL_ARRAY_INDEX\", index, operation, document);\n } // only parse key when it's an integer for `arr.prop` to work\n else if (isInteger(key)) {\n key = ~~key;\n }\n }\n if (t >= len) {\n if (validateOperation && operation.op === \"add\" && key > obj.length) {\n throw new JsonPatchError(\"The specified index MUST NOT be greater than the number of elements in the array\", \"OPERATION_VALUE_OUT_OF_BOUNDS\", index, operation, document);\n }\n var returnValue = arrOps[operation.op].call(operation, obj, key, document); // Apply patch\n if (returnValue.test === false) {\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n return returnValue;\n }\n } else {\n if (t >= len) {\n var returnValue = objOps[operation.op].call(operation, obj, key, document); // Apply patch\n if (returnValue.test === false) {\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n return returnValue;\n }\n }\n obj = obj[key];\n // If we have more keys in the path, but the next value isn't a non-null object,\n // throw an OPERATION_PATH_UNRESOLVABLE error instead of iterating again.\n if (validateOperation && t < len && (!obj || typeof obj !== \"object\")) {\n throw new JsonPatchError('Cannot perform operation at the desired path', 'OPERATION_PATH_UNRESOLVABLE', index, operation, document);\n }\n }\n }\n }\n /**\n * Apply a full JSON Patch array on a JSON document.\n * Returns the {newDocument, result} of the patch.\n * It modifies the `document` object and `patch` - it gets the values by reference.\n * If you would like to avoid touching your values, clone them:\n * `jsonpatch.applyPatch(document, jsonpatch._deepClone(patch))`.\n *\n * @param document The document to patch\n * @param patch The patch to apply\n * @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.\n * @param mutateDocument Whether to mutate the original document or clone it before applying\n * @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.\n * @return An array of `{newDocument, result}` after the patch\n */\n function applyPatch(document, patch, validateOperation, mutateDocument, banPrototypeModifications) {\n if (mutateDocument === void 0) {\n mutateDocument = true;\n }\n if (banPrototypeModifications === void 0) {\n banPrototypeModifications = true;\n }\n if (validateOperation) {\n if (!Array.isArray(patch)) {\n throw new JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');\n }\n }\n if (!mutateDocument) {\n document = _deepClone(document);\n }\n var results = new Array(patch.length);\n for (var i = 0, length_1 = patch.length; i < length_1; i++) {\n // we don't need to pass mutateDocument argument because if it was true, we already deep cloned the object, we'll just pass `true`\n results[i] = applyOperation(document, patch[i], validateOperation, true, banPrototypeModifications, i);\n document = results[i].newDocument; // in case root was replaced\n }\n results.newDocument = document;\n return results;\n }\n /**\n * Apply a single JSON Patch Operation on a JSON document.\n * Returns the updated document.\n * Suitable as a reducer.\n *\n * @param document The document to patch\n * @param operation The operation to apply\n * @return The updated document\n */\n function applyReducer(document, operation, index) {\n var operationResult = applyOperation(document, operation);\n if (operationResult.test === false) {\n // failed test\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n return operationResult.newDocument;\n }\n /**\n * Validates a single operation. Called from `jsonpatch.validate`. Throws `JsonPatchError` in case of an error.\n * @param {object} operation - operation object (patch)\n * @param {number} index - index of operation in the sequence\n * @param {object} [document] - object where the operation is supposed to be applied\n * @param {string} [existingPathFragment] - comes along with `document`\n */\n function validator(operation, index, document, existingPathFragment) {\n if (typeof operation !== 'object' || operation === null || Array.isArray(operation)) {\n throw new JsonPatchError('Operation is not an object', 'OPERATION_NOT_AN_OBJECT', index, operation, document);\n } else if (!objOps[operation.op]) {\n throw new JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document);\n } else if (typeof operation.path !== 'string') {\n throw new JsonPatchError('Operation `path` property is not a string', 'OPERATION_PATH_INVALID', index, operation, document);\n } else if (operation.path.indexOf('/') !== 0 && operation.path.length > 0) {\n // paths that aren't empty string should start with \"/\"\n throw new JsonPatchError('Operation `path` property must start with \"/\"', 'OPERATION_PATH_INVALID', index, operation, document);\n } else if ((operation.op === 'move' || operation.op === 'copy') && typeof operation.from !== 'string') {\n throw new JsonPatchError('Operation `from` property is not present (applicable in `move` and `copy` operations)', 'OPERATION_FROM_REQUIRED', index, operation, document);\n } else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && operation.value === undefined) {\n throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_REQUIRED', index, operation, document);\n } else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && hasUndefined(operation.value)) {\n throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED', index, operation, document);\n } else if (document) {\n if (operation.op == \"add\") {\n var pathLen = operation.path.split(\"/\").length;\n var existingPathLen = existingPathFragment.split(\"/\").length;\n if (pathLen !== existingPathLen + 1 && pathLen !== existingPathLen) {\n throw new JsonPatchError('Cannot perform an `add` operation at the desired path', 'OPERATION_PATH_CANNOT_ADD', index, operation, document);\n }\n } else if (operation.op === 'replace' || operation.op === 'remove' || operation.op === '_get') {\n if (operation.path !== existingPathFragment) {\n throw new JsonPatchError('Cannot perform the operation at a path that does not exist', 'OPERATION_PATH_UNRESOLVABLE', index, operation, document);\n }\n } else if (operation.op === 'move' || operation.op === 'copy') {\n var existingValue = {\n op: \"_get\",\n path: operation.from,\n value: undefined\n };\n var error = validate([existingValue], document);\n if (error && error.name === 'OPERATION_PATH_UNRESOLVABLE') {\n throw new JsonPatchError('Cannot perform the operation from a path that does not exist', 'OPERATION_FROM_UNRESOLVABLE', index, operation, document);\n }\n }\n }\n }\n /**\n * Validates a sequence of operations. If `document` parameter is provided, the sequence is additionally validated against the object document.\n * If error is encountered, returns a JsonPatchError object\n * @param sequence\n * @param document\n * @returns {JsonPatchError|undefined}\n */\n function validate(sequence, document, externalValidator) {\n try {\n if (!Array.isArray(sequence)) {\n throw new JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');\n }\n if (document) {\n //clone document and sequence so that we can safely try applying operations\n applyPatch(_deepClone(document), _deepClone(sequence), externalValidator || true);\n } else {\n externalValidator = externalValidator || validator;\n for (var i = 0; i < sequence.length; i++) {\n externalValidator(sequence[i], i, document, undefined);\n }\n }\n } catch (e) {\n if (e instanceof JsonPatchError) {\n return e;\n } else {\n throw e;\n }\n }\n }\n // based on https://github.com/epoberezkin/fast-deep-equal\n // MIT License\n // Copyright (c) 2017 Evgeny Poberezkin\n // Permission is hereby granted, free of charge, to any person obtaining a copy\n // of this software and associated documentation files (the \"Software\"), to deal\n // in the Software without restriction, including without limitation the rights\n // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n // copies of the Software, and to permit persons to whom the Software is\n // furnished to do so, subject to the following conditions:\n // The above copyright notice and this permission notice shall be included in all\n // copies or substantial portions of the Software.\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n // SOFTWARE.\n function _areEquals(a, b) {\n if (a === b) return true;\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = Array.isArray(a),\n arrB = Array.isArray(b),\n i,\n length,\n key;\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;) if (!_areEquals(a[i], b[i])) return false;\n return true;\n }\n if (arrA != arrB) return false;\n var keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n for (i = length; i-- !== 0;) if (!b.hasOwnProperty(keys[i])) return false;\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (!_areEquals(a[key], b[key])) return false;\n }\n return true;\n }\n return a !== a && b !== b;\n }\n\n var core = /*#__PURE__*/Object.freeze({\n __proto__: null,\n JsonPatchError: JsonPatchError,\n _areEquals: _areEquals,\n applyOperation: applyOperation,\n applyPatch: applyPatch,\n applyReducer: applyReducer,\n deepClone: deepClone,\n getValueByPointer: getValueByPointer,\n validate: validate,\n validator: validator\n });\n\n /*!\n * https://github.com/Starcounter-Jack/JSON-Patch\n * (c) 2017-2021 Joachim Wester\n * MIT license\n */\n var beforeDict = new WeakMap();\n var Mirror = /** @class */function () {\n function Mirror(obj) {\n this.observers = new Map();\n this.obj = obj;\n }\n return Mirror;\n }();\n var ObserverInfo = /** @class */function () {\n function ObserverInfo(callback, observer) {\n this.callback = callback;\n this.observer = observer;\n }\n return ObserverInfo;\n }();\n function getMirror(obj) {\n return beforeDict.get(obj);\n }\n function getObserverFromMirror(mirror, callback) {\n return mirror.observers.get(callback);\n }\n function removeObserverFromMirror(mirror, observer) {\n mirror.observers.delete(observer.callback);\n }\n /**\n * Detach an observer from an object\n */\n function unobserve(root, observer) {\n observer.unobserve();\n }\n /**\n * Observes changes made to an object, which can then be retrieved using generate\n */\n function observe(obj, callback) {\n var patches = [];\n var observer;\n var mirror = getMirror(obj);\n if (!mirror) {\n mirror = new Mirror(obj);\n beforeDict.set(obj, mirror);\n } else {\n var observerInfo = getObserverFromMirror(mirror, callback);\n observer = observerInfo && observerInfo.observer;\n }\n if (observer) {\n return observer;\n }\n observer = {};\n mirror.value = _deepClone(obj);\n if (callback) {\n observer.callback = callback;\n observer.next = null;\n var dirtyCheck = function () {\n generate(observer);\n };\n var fastCheck = function () {\n clearTimeout(observer.next);\n observer.next = setTimeout(dirtyCheck);\n };\n if (typeof window !== 'undefined') {\n //not Node\n window.addEventListener('mouseup', fastCheck);\n window.addEventListener('keyup', fastCheck);\n window.addEventListener('mousedown', fastCheck);\n window.addEventListener('keydown', fastCheck);\n window.addEventListener('change', fastCheck);\n }\n }\n observer.patches = patches;\n observer.object = obj;\n observer.unobserve = function () {\n generate(observer);\n clearTimeout(observer.next);\n removeObserverFromMirror(mirror, observer);\n if (typeof window !== 'undefined') {\n window.removeEventListener('mouseup', fastCheck);\n window.removeEventListener('keyup', fastCheck);\n window.removeEventListener('mousedown', fastCheck);\n window.removeEventListener('keydown', fastCheck);\n window.removeEventListener('change', fastCheck);\n }\n };\n mirror.observers.set(callback, new ObserverInfo(callback, observer));\n return observer;\n }\n /**\n * Generate an array of patches from an observer\n */\n function generate(observer, invertible) {\n if (invertible === void 0) {\n invertible = false;\n }\n var mirror = beforeDict.get(observer.object);\n _generate(mirror.value, observer.object, observer.patches, \"\", invertible);\n if (observer.patches.length) {\n applyPatch(mirror.value, observer.patches);\n }\n var temp = observer.patches;\n if (temp.length > 0) {\n observer.patches = [];\n if (observer.callback) {\n observer.callback(temp);\n }\n }\n return temp;\n }\n // Dirty check if obj is different from mirror, generate patches and update mirror\n function _generate(mirror, obj, patches, path, invertible) {\n if (obj === mirror) {\n return;\n }\n if (typeof obj.toJSON === \"function\") {\n obj = obj.toJSON();\n }\n var newKeys = _objectKeys(obj);\n var oldKeys = _objectKeys(mirror);\n var deleted = false;\n //if ever \"move\" operation is implemented here, make sure this test runs OK: \"should not generate the same patch twice (move)\"\n for (var t = oldKeys.length - 1; t >= 0; t--) {\n var key = oldKeys[t];\n var oldVal = mirror[key];\n if (hasOwnProperty(obj, key) && !(obj[key] === undefined && oldVal !== undefined && Array.isArray(obj) === false)) {\n var newVal = obj[key];\n if (typeof oldVal == \"object\" && oldVal != null && typeof newVal == \"object\" && newVal != null && Array.isArray(oldVal) === Array.isArray(newVal)) {\n _generate(oldVal, newVal, patches, path + \"/\" + escapePathComponent(key), invertible);\n } else {\n if (oldVal !== newVal) {\n if (invertible) {\n patches.push({\n op: \"test\",\n path: path + \"/\" + escapePathComponent(key),\n value: _deepClone(oldVal)\n });\n }\n patches.push({\n op: \"replace\",\n path: path + \"/\" + escapePathComponent(key),\n value: _deepClone(newVal)\n });\n }\n }\n } else if (Array.isArray(mirror) === Array.isArray(obj)) {\n if (invertible) {\n patches.push({\n op: \"test\",\n path: path + \"/\" + escapePathComponent(key),\n value: _deepClone(oldVal)\n });\n }\n patches.push({\n op: \"remove\",\n path: path + \"/\" + escapePathComponent(key)\n });\n deleted = true; // property has been deleted\n } else {\n if (invertible) {\n patches.push({\n op: \"test\",\n path: path,\n value: mirror\n });\n }\n patches.push({\n op: \"replace\",\n path: path,\n value: obj\n });\n }\n }\n if (!deleted && newKeys.length == oldKeys.length) {\n return;\n }\n for (var t = 0; t < newKeys.length; t++) {\n var key = newKeys[t];\n if (!hasOwnProperty(mirror, key) && obj[key] !== undefined) {\n patches.push({\n op: \"add\",\n path: path + \"/\" + escapePathComponent(key),\n value: _deepClone(obj[key])\n });\n }\n }\n }\n /**\n * Create an array of patches from the differences in two objects\n */\n function compare$7(tree1, tree2, invertible) {\n if (invertible === void 0) {\n invertible = false;\n }\n var patches = [];\n _generate(tree1, tree2, patches, '', invertible);\n return patches;\n }\n\n var duplex = /*#__PURE__*/Object.freeze({\n __proto__: null,\n compare: compare$7,\n generate: generate,\n observe: observe,\n unobserve: unobserve\n });\n\n Object.assign({}, core, duplex, {\n JsonPatchError: PatchError,\n deepClone: _deepClone,\n escapePathComponent,\n unescapePathComponent\n });\n\n function getDefaultExportFromCjs (x) {\n \treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n }\n\n // Note: This regex matches even invalid JSON strings, but since we’re\n // working on the output of `JSON.stringify` we know that only valid strings\n // are present (unless the user supplied a weird `options.indent` but in\n // that case we don’t care since the output would be invalid anyway).\n var stringOrChar = /(\"(?:[^\\\\\"]|\\\\.)*\")|[:,]/g;\n var jsonStringifyPrettyCompact = function stringify(passedObj, options) {\n var indent, maxLength, replacer;\n options = options || {};\n indent = JSON.stringify([1], undefined, options.indent === undefined ? 2 : options.indent).slice(2, -3);\n maxLength = indent === \"\" ? Infinity : options.maxLength === undefined ? 80 : options.maxLength;\n replacer = options.replacer;\n return function _stringify(obj, currentIndent, reserved) {\n // prettier-ignore\n var end, index, items, key, keyPart, keys, length, nextIndent, prettified, start, string, value;\n if (obj && typeof obj.toJSON === \"function\") {\n obj = obj.toJSON();\n }\n string = JSON.stringify(obj, replacer);\n if (string === undefined) {\n return string;\n }\n length = maxLength - currentIndent.length - reserved;\n if (string.length <= length) {\n prettified = string.replace(stringOrChar, function (match, stringLiteral) {\n return stringLiteral || match + \" \";\n });\n if (prettified.length <= length) {\n return prettified;\n }\n }\n if (replacer != null) {\n obj = JSON.parse(string);\n replacer = undefined;\n }\n if (typeof obj === \"object\" && obj !== null) {\n nextIndent = currentIndent + indent;\n items = [];\n index = 0;\n if (Array.isArray(obj)) {\n start = \"[\";\n end = \"]\";\n length = obj.length;\n for (; index < length; index++) {\n items.push(_stringify(obj[index], nextIndent, index === length - 1 ? 0 : 1) || \"null\");\n }\n } else {\n start = \"{\";\n end = \"}\";\n keys = Object.keys(obj);\n length = keys.length;\n for (; index < length; index++) {\n key = keys[index];\n keyPart = JSON.stringify(key) + \": \";\n value = _stringify(obj[key], nextIndent, keyPart.length + (index === length - 1 ? 0 : 1));\n if (value !== undefined) {\n items.push(keyPart + value);\n }\n }\n }\n if (items.length > 0) {\n return [start, indent + items.join(\",\\n\" + nextIndent), end].join(\"\\n\" + currentIndent);\n }\n }\n return string;\n }(passedObj, \"\", 0);\n };\n var stringify$1 = /*@__PURE__*/getDefaultExportFromCjs(jsonStringifyPrettyCompact);\n\n class LRUCache {\n constructor() {\n this.max = 1000;\n this.map = new Map();\n }\n get(key) {\n const value = this.map.get(key);\n if (value === undefined) {\n return undefined;\n } else {\n // Remove the key from the map and add it to the end\n this.map.delete(key);\n this.map.set(key, value);\n return value;\n }\n }\n delete(key) {\n return this.map.delete(key);\n }\n set(key, value) {\n const deleted = this.delete(key);\n if (!deleted && value !== undefined) {\n // If cache is full, delete the least recently used item\n if (this.map.size >= this.max) {\n const firstKey = this.map.keys().next().value;\n this.delete(firstKey);\n }\n this.map.set(key, value);\n }\n return this;\n }\n }\n var lrucache = LRUCache;\n\n // parse out just the options we care about\n const looseOption = Object.freeze({\n loose: true\n });\n const emptyOpts = Object.freeze({});\n const parseOptions$1 = options => {\n if (!options) {\n return emptyOpts;\n }\n if (typeof options !== 'object') {\n return looseOption;\n }\n return options;\n };\n var parseOptions_1 = parseOptions$1;\n\n var re$1 = {exports: {}};\n\n // Note: this is the semver.org version of the spec that it implements\n // Not necessarily the package version of this code.\n const SEMVER_SPEC_VERSION = '2.0.0';\n const MAX_LENGTH$1 = 256;\n const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */9007199254740991;\n\n // Max safe segment length for coercion.\n const MAX_SAFE_COMPONENT_LENGTH = 16;\n\n // Max safe length for a build identifier. The max length minus 6 characters for\n // the shortest version with a build 0.0.0+BUILD.\n const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH$1 - 6;\n const RELEASE_TYPES = ['major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', 'prerelease'];\n var constants = {\n MAX_LENGTH: MAX_LENGTH$1,\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,\n RELEASE_TYPES,\n SEMVER_SPEC_VERSION,\n FLAG_INCLUDE_PRERELEASE: 0b001,\n FLAG_LOOSE: 0b010\n };\n\n const debug$1 = typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\\bsemver\\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error('SEMVER', ...args) : () => {};\n var debug_1 = debug$1;\n\n (function (module, exports) {\n const {\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_LENGTH\n } = constants;\n const debug = debug_1;\n exports = module.exports = {};\n\n // The actual regexps go on exports.re\n const re = exports.re = [];\n const safeRe = exports.safeRe = [];\n const src = exports.src = [];\n const t = exports.t = {};\n let R = 0;\n const LETTERDASHNUMBER = '[a-zA-Z0-9-]';\n\n // Replace some greedy regex tokens to prevent regex dos issues. These regex are\n // used internally via the safeRe object since all inputs in this library get\n // normalized first to trim and collapse all extra whitespace. The original\n // regexes are exported for userland consumption and lower level usage. A\n // future breaking change could export the safer regex only with a note that\n // all input should have extra whitespace removed.\n const safeRegexReplacements = [['\\\\s', 1], ['\\\\d', MAX_LENGTH], [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]];\n const makeSafeRegex = value => {\n for (const [token, max] of safeRegexReplacements) {\n value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);\n }\n return value;\n };\n const createToken = (name, value, isGlobal) => {\n const safe = makeSafeRegex(value);\n const index = R++;\n debug(name, index, value);\n t[name] = index;\n src[index] = value;\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined);\n safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined);\n };\n\n // The following Regular Expressions can be used for tokenizing,\n // validating, and parsing SemVer version strings.\n\n // ## Numeric Identifier\n // A single `0`, or a non-zero digit followed by zero or more digits.\n\n createToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*');\n createToken('NUMERICIDENTIFIERLOOSE', '\\\\d+');\n\n // ## Non-numeric Identifier\n // Zero or more digits, followed by a letter or hyphen, and then zero or\n // more letters, digits, or hyphens.\n\n createToken('NONNUMERICIDENTIFIER', `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);\n\n // ## Main Version\n // Three dot-separated numeric identifiers.\n\n createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` + `(${src[t.NUMERICIDENTIFIER]})\\\\.` + `(${src[t.NUMERICIDENTIFIER]})`);\n createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})`);\n\n // ## Pre-release Version Identifier\n // A numeric identifier, or a non-numeric identifier.\n\n createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);\n createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);\n\n // ## Pre-release Version\n // Hyphen, followed by one or more dot-separated pre-release version\n // identifiers.\n\n createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`);\n createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);\n\n // ## Build Metadata Identifier\n // Any combination of digits, letters, or hyphens.\n\n createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`);\n\n // ## Build Metadata\n // Plus sign, followed by one or more period-separated build metadata\n // identifiers.\n\n createToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`);\n\n // ## Full Version String\n // A main version, followed optionally by a pre-release version and\n // build metadata.\n\n // Note that the only major, minor, patch, and pre-release sections of\n // the version string are capturing groups. The build metadata is not a\n // capturing group, because it should not ever be used in version\n // comparison.\n\n createToken('FULLPLAIN', `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);\n createToken('FULL', `^${src[t.FULLPLAIN]}$`);\n\n // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n // common in the npm registry.\n createToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);\n createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`);\n createToken('GTLT', '((?:<|>)?=?)');\n\n // Something like \"2.*\" or \"1.2.x\".\n // Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n // Only the first item is strictly required.\n createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`);\n createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`);\n createToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` + `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?` + `)?)?`);\n createToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?` + `)?)?`);\n createToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`);\n createToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`);\n\n // Coercion.\n // Extract anything that could conceivably be a part of a valid semver\n createToken('COERCEPLAIN', `${'(^|[^\\\\d])' + '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);\n createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\\\d])`);\n createToken('COERCEFULL', src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?` + `(?:${src[t.BUILD]})?` + `(?:$|[^\\\\d])`);\n createToken('COERCERTL', src[t.COERCE], true);\n createToken('COERCERTLFULL', src[t.COERCEFULL], true);\n\n // Tilde ranges.\n // Meaning is \"reasonably at or greater than\"\n createToken('LONETILDE', '(?:~>?)');\n createToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true);\n exports.tildeTrimReplace = '$1~';\n createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);\n createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);\n\n // Caret ranges.\n // Meaning is \"at least and backwards compatible with\"\n createToken('LONECARET', '(?:\\\\^)');\n createToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true);\n exports.caretTrimReplace = '$1^';\n createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);\n createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);\n\n // A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\n createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`);\n createToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`);\n\n // An expression to strip any whitespace between the gtlt and the thing\n // it modifies, so that `> 1.2.3` ==> `>1.2.3`\n createToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);\n exports.comparatorTrimReplace = '$1$2$3';\n\n // Something like `1.2.3 - 1.2.4`\n // Note that these all use the loose form, because they'll be\n // checked against either the strict or loose comparator form\n // later.\n createToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` + `\\\\s+-\\\\s+` + `(${src[t.XRANGEPLAIN]})` + `\\\\s*$`);\n createToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` + `\\\\s+-\\\\s+` + `(${src[t.XRANGEPLAINLOOSE]})` + `\\\\s*$`);\n\n // Star ranges basically just allow anything at all.\n createToken('STAR', '(<|>)?=?\\\\s*\\\\*');\n // >=0.0.0 is like a star\n createToken('GTE0', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$');\n createToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$');\n })(re$1, re$1.exports);\n var reExports = re$1.exports;\n\n const numeric = /^[0-9]+$/;\n const compareIdentifiers$1 = (a, b) => {\n const anum = numeric.test(a);\n const bnum = numeric.test(b);\n if (anum && bnum) {\n a = +a;\n b = +b;\n }\n return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;\n };\n const rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a);\n var identifiers = {\n compareIdentifiers: compareIdentifiers$1,\n rcompareIdentifiers\n };\n\n const debug = debug_1;\n const {\n MAX_LENGTH,\n MAX_SAFE_INTEGER\n } = constants;\n const {\n safeRe: re,\n t\n } = reExports;\n const parseOptions = parseOptions_1;\n const {\n compareIdentifiers\n } = identifiers;\n let SemVer$1 = class SemVer {\n constructor(version, options) {\n options = parseOptions(options);\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {\n return version;\n } else {\n version = version.version;\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`);\n }\n if (version.length > MAX_LENGTH) {\n throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);\n }\n debug('SemVer', version, options);\n this.options = options;\n this.loose = !!options.loose;\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease;\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`);\n }\n this.raw = version;\n\n // these are actually numbers\n this.major = +m[1];\n this.minor = +m[2];\n this.patch = +m[3];\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version');\n }\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version');\n }\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version');\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = [];\n } else {\n this.prerelease = m[4].split('.').map(id => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id;\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num;\n }\n }\n return id;\n });\n }\n this.build = m[5] ? m[5].split('.') : [];\n this.format();\n }\n format() {\n this.version = `${this.major}.${this.minor}.${this.patch}`;\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`;\n }\n return this.version;\n }\n toString() {\n return this.version;\n }\n compare(other) {\n debug('SemVer.compare', this.version, this.options, other);\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0;\n }\n other = new SemVer(other, this.options);\n }\n if (other.version === this.version) {\n return 0;\n }\n return this.compareMain(other) || this.comparePre(other);\n }\n compareMain(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);\n }\n comparePre(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1;\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1;\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0;\n }\n let i = 0;\n do {\n const a = this.prerelease[i];\n const b = other.prerelease[i];\n debug('prerelease compare', i, a, b);\n if (a === undefined && b === undefined) {\n return 0;\n } else if (b === undefined) {\n return 1;\n } else if (a === undefined) {\n return -1;\n } else if (a === b) {\n continue;\n } else {\n return compareIdentifiers(a, b);\n }\n } while (++i);\n }\n compareBuild(other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options);\n }\n let i = 0;\n do {\n const a = this.build[i];\n const b = other.build[i];\n debug('build compare', i, a, b);\n if (a === undefined && b === undefined) {\n return 0;\n } else if (b === undefined) {\n return 1;\n } else if (a === undefined) {\n return -1;\n } else if (a === b) {\n continue;\n } else {\n return compareIdentifiers(a, b);\n }\n } while (++i);\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc(release, identifier, identifierBase) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor = 0;\n this.major++;\n this.inc('pre', identifier, identifierBase);\n break;\n case 'preminor':\n this.prerelease.length = 0;\n this.patch = 0;\n this.minor++;\n this.inc('pre', identifier, identifierBase);\n break;\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0;\n this.inc('patch', identifier, identifierBase);\n this.inc('pre', identifier, identifierBase);\n break;\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier, identifierBase);\n }\n this.inc('pre', identifier, identifierBase);\n break;\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {\n this.major++;\n }\n this.minor = 0;\n this.patch = 0;\n this.prerelease = [];\n break;\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++;\n }\n this.patch = 0;\n this.prerelease = [];\n break;\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++;\n }\n this.prerelease = [];\n break;\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n {\n const base = Number(identifierBase) ? 1 : 0;\n if (!identifier && identifierBase === false) {\n throw new Error('invalid increment argument: identifier is empty');\n }\n if (this.prerelease.length === 0) {\n this.prerelease = [base];\n } else {\n let i = this.prerelease.length;\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++;\n i = -2;\n }\n }\n if (i === -1) {\n // didn't increment anything\n if (identifier === this.prerelease.join('.') && identifierBase === false) {\n throw new Error('invalid increment argument: identifier already exists');\n }\n this.prerelease.push(base);\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n let prerelease = [identifier, base];\n if (identifierBase === false) {\n prerelease = [identifier];\n }\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = prerelease;\n }\n } else {\n this.prerelease = prerelease;\n }\n }\n break;\n }\n default:\n throw new Error(`invalid increment argument: ${release}`);\n }\n this.raw = this.format();\n if (this.build.length) {\n this.raw += `+${this.build.join('.')}`;\n }\n return this;\n }\n };\n var semver = SemVer$1;\n\n const SemVer = semver;\n const compare$6 = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));\n var compare_1 = compare$6;\n\n const compare$5 = compare_1;\n const eq$1 = (a, b, loose) => compare$5(a, b, loose) === 0;\n var eq_1 = eq$1;\n\n const compare$4 = compare_1;\n const neq$1 = (a, b, loose) => compare$4(a, b, loose) !== 0;\n var neq_1 = neq$1;\n\n const compare$3 = compare_1;\n const gt$1 = (a, b, loose) => compare$3(a, b, loose) > 0;\n var gt_1 = gt$1;\n\n const compare$2 = compare_1;\n const gte$1 = (a, b, loose) => compare$2(a, b, loose) >= 0;\n var gte_1 = gte$1;\n\n const compare$1 = compare_1;\n const lt$1 = (a, b, loose) => compare$1(a, b, loose) < 0;\n var lt_1 = lt$1;\n\n const compare = compare_1;\n const lte$1 = (a, b, loose) => compare(a, b, loose) <= 0;\n var lte_1 = lte$1;\n\n const eq = eq_1;\n const neq = neq_1;\n const gt = gt_1;\n const gte = gte_1;\n const lt = lt_1;\n const lte = lte_1;\n const cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object') {\n a = a.version;\n }\n if (typeof b === 'object') {\n b = b.version;\n }\n return a === b;\n case '!==':\n if (typeof a === 'object') {\n a = a.version;\n }\n if (typeof b === 'object') {\n b = b.version;\n }\n return a !== b;\n case '':\n case '=':\n case '==':\n return eq(a, b, loose);\n case '!=':\n return neq(a, b, loose);\n case '>':\n return gt(a, b, loose);\n case '>=':\n return gte(a, b, loose);\n case '<':\n return lt(a, b, loose);\n case '<=':\n return lte(a, b, loose);\n default:\n throw new TypeError(`Invalid operator: ${op}`);\n }\n };\n var cmp_1 = cmp;\n\n var comparator;\n var hasRequiredComparator;\n function requireComparator() {\n if (hasRequiredComparator) return comparator;\n hasRequiredComparator = 1;\n const ANY = Symbol('SemVer ANY');\n // hoisted class for cyclic dependency\n class Comparator {\n static get ANY() {\n return ANY;\n }\n constructor(comp, options) {\n options = parseOptions(options);\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp;\n } else {\n comp = comp.value;\n }\n }\n comp = comp.trim().split(/\\s+/).join(' ');\n debug('comparator', comp, options);\n this.options = options;\n this.loose = !!options.loose;\n this.parse(comp);\n if (this.semver === ANY) {\n this.value = '';\n } else {\n this.value = this.operator + this.semver.version;\n }\n debug('comp', this);\n }\n parse(comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];\n const m = comp.match(r);\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`);\n }\n this.operator = m[1] !== undefined ? m[1] : '';\n if (this.operator === '=') {\n this.operator = '';\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY;\n } else {\n this.semver = new SemVer(m[2], this.options.loose);\n }\n }\n toString() {\n return this.value;\n }\n test(version) {\n debug('Comparator.test', version, this.options.loose);\n if (this.semver === ANY || version === ANY) {\n return true;\n }\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options);\n } catch (er) {\n return false;\n }\n }\n return cmp(version, this.operator, this.semver, this.options);\n }\n intersects(comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required');\n }\n if (this.operator === '') {\n if (this.value === '') {\n return true;\n }\n return new Range(comp.value, options).test(this.value);\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true;\n }\n return new Range(this.value, options).test(comp.semver);\n }\n options = parseOptions(options);\n\n // Special cases where nothing can possibly be lower\n if (options.includePrerelease && (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {\n return false;\n }\n if (!options.includePrerelease && (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {\n return false;\n }\n\n // Same direction increasing (> or >=)\n if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {\n return true;\n }\n // Same direction decreasing (< or <=)\n if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {\n return true;\n }\n // same SemVer and both sides are inclusive (<= or >=)\n if (this.semver.version === comp.semver.version && this.operator.includes('=') && comp.operator.includes('=')) {\n return true;\n }\n // opposite directions less than\n if (cmp(this.semver, '<', comp.semver, options) && this.operator.startsWith('>') && comp.operator.startsWith('<')) {\n return true;\n }\n // opposite directions greater than\n if (cmp(this.semver, '>', comp.semver, options) && this.operator.startsWith('<') && comp.operator.startsWith('>')) {\n return true;\n }\n return false;\n }\n }\n comparator = Comparator;\n const parseOptions = parseOptions_1;\n const {\n safeRe: re,\n t\n } = reExports;\n const cmp = cmp_1;\n const debug = debug_1;\n const SemVer = semver;\n const Range = requireRange();\n return comparator;\n }\n\n var range;\n var hasRequiredRange;\n function requireRange() {\n if (hasRequiredRange) return range;\n hasRequiredRange = 1;\n // hoisted class for cyclic dependency\n class Range {\n constructor(range, options) {\n options = parseOptions(options);\n if (range instanceof Range) {\n if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {\n return range;\n } else {\n return new Range(range.raw, options);\n }\n }\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value;\n this.set = [[range]];\n this.format();\n return this;\n }\n this.options = options;\n this.loose = !!options.loose;\n this.includePrerelease = !!options.includePrerelease;\n\n // First reduce all whitespace as much as possible so we do not have to rely\n // on potentially slow regexes like \\s*. This is then stored and used for\n // future error messages as well.\n this.raw = range.trim().split(/\\s+/).join(' ');\n\n // First, split on ||\n this.set = this.raw.split('||')\n // map the range to a 2d array of comparators\n .map(r => this.parseRange(r.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length);\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${this.raw}`);\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0];\n this.set = this.set.filter(c => !isNullSet(c[0]));\n if (this.set.length === 0) {\n this.set = [first];\n } else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c];\n break;\n }\n }\n }\n }\n this.format();\n }\n format() {\n this.range = this.set.map(comps => comps.join(' ').trim()).join('||').trim();\n return this.range;\n }\n toString() {\n return this.range;\n }\n parseRange(range) {\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);\n const memoKey = memoOpts + ':' + range;\n const cached = cache.get(memoKey);\n if (cached) {\n return cached;\n }\n const loose = this.options.loose;\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease));\n debug('hyphen replace', range);\n\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);\n debug('comparator trim', range);\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace);\n debug('tilde trim', range);\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace);\n debug('caret trim', range);\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n let rangeList = range.split(' ').map(comp => parseComparator(comp, this.options)).join(' ').split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options));\n if (loose) {\n // in loose mode, throw out any that are not valid comparators\n rangeList = rangeList.filter(comp => {\n debug('loose invalid filter', comp, this.options);\n return !!comp.match(re[t.COMPARATORLOOSE]);\n });\n }\n debug('range list', rangeList);\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const rangeMap = new Map();\n const comparators = rangeList.map(comp => new Comparator(comp, this.options));\n for (const comp of comparators) {\n if (isNullSet(comp)) {\n return [comp];\n }\n rangeMap.set(comp.value, comp);\n }\n if (rangeMap.size > 1 && rangeMap.has('')) {\n rangeMap.delete('');\n }\n const result = [...rangeMap.values()];\n cache.set(memoKey, result);\n return result;\n }\n intersects(range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required');\n }\n return this.set.some(thisComparators => {\n return isSatisfiable(thisComparators, options) && range.set.some(rangeComparators => {\n return isSatisfiable(rangeComparators, options) && thisComparators.every(thisComparator => {\n return rangeComparators.every(rangeComparator => {\n return thisComparator.intersects(rangeComparator, options);\n });\n });\n });\n });\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test(version) {\n if (!version) {\n return false;\n }\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options);\n } catch (er) {\n return false;\n }\n }\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true;\n }\n }\n return false;\n }\n }\n range = Range;\n const LRU = lrucache;\n const cache = new LRU();\n const parseOptions = parseOptions_1;\n const Comparator = requireComparator();\n const debug = debug_1;\n const SemVer = semver;\n const {\n safeRe: re,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace\n } = reExports;\n const {\n FLAG_INCLUDE_PRERELEASE,\n FLAG_LOOSE\n } = constants;\n const isNullSet = c => c.value === '<0.0.0-0';\n const isAny = c => c.value === '';\n\n // take a set of comparators and determine whether there\n // exists a version which can satisfy it\n const isSatisfiable = (comparators, options) => {\n let result = true;\n const remainingComparators = comparators.slice();\n let testComparator = remainingComparators.pop();\n while (result && remainingComparators.length) {\n result = remainingComparators.every(otherComparator => {\n return testComparator.intersects(otherComparator, options);\n });\n testComparator = remainingComparators.pop();\n }\n return result;\n };\n\n // comprised of xranges, tildes, stars, and gtlt's at this point.\n // already replaced the hyphen ranges\n // turn into a set of JUST comparators.\n const parseComparator = (comp, options) => {\n debug('comp', comp, options);\n comp = replaceCarets(comp, options);\n debug('caret', comp);\n comp = replaceTildes(comp, options);\n debug('tildes', comp);\n comp = replaceXRanges(comp, options);\n debug('xrange', comp);\n comp = replaceStars(comp, options);\n debug('stars', comp);\n return comp;\n };\n const isX = id => !id || id.toLowerCase() === 'x' || id === '*';\n\n // ~, ~> --> * (any, kinda silly)\n // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\n // ~0.0.1 --> >=0.0.1 <0.1.0-0\n const replaceTildes = (comp, options) => {\n return comp.trim().split(/\\s+/).map(c => replaceTilde(c, options)).join(' ');\n };\n const replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr);\n let ret;\n if (isX(M)) {\n ret = '';\n } else if (isX(m)) {\n ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;\n } else if (pr) {\n debug('replaceTilde pr', pr);\n ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;\n }\n debug('tilde return', ret);\n return ret;\n });\n };\n\n // ^ --> * (any, kinda silly)\n // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n // ^1.2.3 --> >=1.2.3 <2.0.0-0\n // ^1.2.0 --> >=1.2.0 <2.0.0-0\n // ^0.0.1 --> >=0.0.1 <0.0.2-0\n // ^0.1.0 --> >=0.1.0 <0.2.0-0\n const replaceCarets = (comp, options) => {\n return comp.trim().split(/\\s+/).map(c => replaceCaret(c, options)).join(' ');\n };\n const replaceCaret = (comp, options) => {\n debug('caret', comp, options);\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];\n const z = options.includePrerelease ? '-0' : '';\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr);\n let ret;\n if (isX(M)) {\n ret = '';\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;\n }\n } else if (pr) {\n debug('replaceCaret pr', pr);\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;\n } else {\n ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;\n }\n } else {\n debug('no pr');\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;\n } else {\n ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;\n }\n } else {\n ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;\n }\n }\n debug('caret return', ret);\n return ret;\n });\n };\n const replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options);\n return comp.split(/\\s+/).map(c => replaceXRange(c, options)).join(' ');\n };\n const replaceXRange = (comp, options) => {\n comp = comp.trim();\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr);\n const xM = isX(M);\n const xm = xM || isX(m);\n const xp = xm || isX(p);\n const anyX = xp;\n if (gtlt === '=' && anyX) {\n gtlt = '';\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : '';\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0';\n } else {\n // nothing is forbidden\n ret = '*';\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0;\n }\n p = 0;\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>=';\n if (xm) {\n M = +M + 1;\n m = 0;\n p = 0;\n } else {\n m = +m + 1;\n p = 0;\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<';\n if (xm) {\n M = +M + 1;\n } else {\n m = +m + 1;\n }\n }\n if (gtlt === '<') {\n pr = '-0';\n }\n ret = `${gtlt + M}.${m}.${p}${pr}`;\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;\n }\n debug('xRange return', ret);\n return ret;\n });\n };\n\n // Because * is AND-ed with everything else in the comparator,\n // and '' means \"any version\", just remove the *s entirely.\n const replaceStars = (comp, options) => {\n debug('replaceStars', comp, options);\n // Looseness is ignored here. star is always as loose as it gets!\n return comp.trim().replace(re[t.STAR], '');\n };\n const replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options);\n return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '');\n };\n\n // This function is passed to string.replace(re[t.HYPHENRANGE])\n // M, m, patch, prerelease, build\n // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n // 1.2 - 3.4 => >=1.2.0 <3.5.0-0\n // TODO build?\n const hyphenReplace = incPr => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {\n if (isX(fM)) {\n from = '';\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`;\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`;\n } else if (fpr) {\n from = `>=${from}`;\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`;\n }\n if (isX(tM)) {\n to = '';\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`;\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`;\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`;\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`;\n } else {\n to = `<=${to}`;\n }\n return `${from} ${to}`.trim();\n };\n const testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false;\n }\n }\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver);\n if (set[i].semver === Comparator.ANY) {\n continue;\n }\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver;\n if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {\n return true;\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false;\n }\n return true;\n };\n return range;\n }\n\n const Range = requireRange();\n const satisfies = (version, range, options) => {\n try {\n range = new Range(range, options);\n } catch (er) {\n return false;\n }\n return range.test(version);\n };\n var satisfies_1 = satisfies;\n var satisfies$1 = /*@__PURE__*/getDefaultExportFromCjs(satisfies_1);\n\n function adjustSpatial(item, encode, swap) {\n let t;\n if (encode.x2) {\n if (encode.x) {\n if (swap && item.x > item.x2) {\n t = item.x;\n item.x = item.x2;\n item.x2 = t;\n }\n item.width = item.x2 - item.x;\n } else {\n item.x = item.x2 - (item.width || 0);\n }\n }\n if (encode.xc) {\n item.x = item.xc - (item.width || 0) / 2;\n }\n if (encode.y2) {\n if (encode.y) {\n if (swap && item.y > item.y2) {\n t = item.y;\n item.y = item.y2;\n item.y2 = t;\n }\n item.height = item.y2 - item.y;\n } else {\n item.y = item.y2 - (item.height || 0);\n }\n }\n if (encode.yc) {\n item.y = item.yc - (item.height || 0) / 2;\n }\n }\n var Constants = {\n NaN: NaN,\n E: Math.E,\n LN2: Math.LN2,\n LN10: Math.LN10,\n LOG2E: Math.LOG2E,\n LOG10E: Math.LOG10E,\n PI: Math.PI,\n SQRT1_2: Math.SQRT1_2,\n SQRT2: Math.SQRT2,\n MIN_VALUE: Number.MIN_VALUE,\n MAX_VALUE: Number.MAX_VALUE\n };\n var Ops = {\n '*': (a, b) => a * b,\n '+': (a, b) => a + b,\n '-': (a, b) => a - b,\n '/': (a, b) => a / b,\n '%': (a, b) => a % b,\n '>': (a, b) => a > b,\n '<': (a, b) => a < b,\n '<=': (a, b) => a <= b,\n '>=': (a, b) => a >= b,\n '==': (a, b) => a == b,\n '!=': (a, b) => a != b,\n '===': (a, b) => a === b,\n '!==': (a, b) => a !== b,\n '&': (a, b) => a & b,\n '|': (a, b) => a | b,\n '^': (a, b) => a ^ b,\n '<<': (a, b) => a << b,\n '>>': (a, b) => a >> b,\n '>>>': (a, b) => a >>> b\n };\n var Unary = {\n '+': a => +a,\n '-': a => -a,\n '~': a => ~a,\n '!': a => !a\n };\n const slice = Array.prototype.slice;\n const apply = (m, args, cast) => {\n const obj = cast ? cast(args[0]) : args[0];\n return obj[m].apply(obj, slice.call(args, 1));\n };\n const datetime = (y, m, d, H, M, S, ms) => new Date(y, m || 0, d != null ? d : 1, H || 0, M || 0, S || 0, ms || 0);\n var Functions = {\n // math functions\n isNaN: Number.isNaN,\n isFinite: Number.isFinite,\n abs: Math.abs,\n acos: Math.acos,\n asin: Math.asin,\n atan: Math.atan,\n atan2: Math.atan2,\n ceil: Math.ceil,\n cos: Math.cos,\n exp: Math.exp,\n floor: Math.floor,\n log: Math.log,\n max: Math.max,\n min: Math.min,\n pow: Math.pow,\n random: Math.random,\n round: Math.round,\n sin: Math.sin,\n sqrt: Math.sqrt,\n tan: Math.tan,\n clamp: (a, b, c) => Math.max(b, Math.min(c, a)),\n // date functions\n now: Date.now,\n utc: Date.UTC,\n datetime: datetime,\n date: d => new Date(d).getDate(),\n day: d => new Date(d).getDay(),\n year: d => new Date(d).getFullYear(),\n month: d => new Date(d).getMonth(),\n hours: d => new Date(d).getHours(),\n minutes: d => new Date(d).getMinutes(),\n seconds: d => new Date(d).getSeconds(),\n milliseconds: d => new Date(d).getMilliseconds(),\n time: d => new Date(d).getTime(),\n timezoneoffset: d => new Date(d).getTimezoneOffset(),\n utcdate: d => new Date(d).getUTCDate(),\n utcday: d => new Date(d).getUTCDay(),\n utcyear: d => new Date(d).getUTCFullYear(),\n utcmonth: d => new Date(d).getUTCMonth(),\n utchours: d => new Date(d).getUTCHours(),\n utcminutes: d => new Date(d).getUTCMinutes(),\n utcseconds: d => new Date(d).getUTCSeconds(),\n utcmilliseconds: d => new Date(d).getUTCMilliseconds(),\n // sequence functions\n length: x => x.length,\n join: function () {\n return apply('join', arguments);\n },\n indexof: function () {\n return apply('indexOf', arguments);\n },\n lastindexof: function () {\n return apply('lastIndexOf', arguments);\n },\n slice: function () {\n return apply('slice', arguments);\n },\n reverse: x => x.slice().reverse(),\n // string functions\n parseFloat: parseFloat,\n parseInt: parseInt,\n upper: x => String(x).toUpperCase(),\n lower: x => String(x).toLowerCase(),\n substring: function () {\n return apply('substring', arguments, String);\n },\n split: function () {\n return apply('split', arguments, String);\n },\n replace: function () {\n return apply('replace', arguments, String);\n },\n trim: x => String(x).trim(),\n // regexp functions\n regexp: RegExp,\n test: (r, t) => RegExp(r).test(t)\n };\n const EventFunctions = ['view', 'item', 'group', 'xy', 'x', 'y'];\n const DisallowedMethods = new Set([Function, eval, setTimeout, setInterval]);\n if (typeof setImmediate === 'function') DisallowedMethods.add(setImmediate);\n const Visitors = {\n Literal: ($, n) => n.value,\n Identifier: ($, n) => {\n const id = n.name;\n return $.memberDepth > 0 ? id : id === 'datum' ? $.datum : id === 'event' ? $.event : id === 'item' ? $.item : Constants[id] || $.params['$' + id];\n },\n MemberExpression: ($, n) => {\n const d = !n.computed,\n o = $(n.object);\n if (d) $.memberDepth += 1;\n const p = $(n.property);\n if (d) $.memberDepth -= 1;\n if (DisallowedMethods.has(o[p])) {\n // eslint-disable-next-line no-console\n console.error(`Prevented interpretation of member \"${p}\" which could lead to insecure code execution`);\n return;\n }\n return o[p];\n },\n CallExpression: ($, n) => {\n const args = n.arguments;\n let name = n.callee.name;\n\n // handle special internal functions used by encoders\n // re-route to corresponding standard function\n if (name.startsWith('_')) {\n name = name.slice(1);\n }\n\n // special case \"if\" due to conditional evaluation of branches\n return name === 'if' ? $(args[0]) ? $(args[1]) : $(args[2]) : ($.fn[name] || Functions[name]).apply($.fn, args.map($));\n },\n ArrayExpression: ($, n) => n.elements.map($),\n BinaryExpression: ($, n) => Ops[n.operator]($(n.left), $(n.right)),\n UnaryExpression: ($, n) => Unary[n.operator]($(n.argument)),\n ConditionalExpression: ($, n) => $(n.test) ? $(n.consequent) : $(n.alternate),\n LogicalExpression: ($, n) => n.operator === '&&' ? $(n.left) && $(n.right) : $(n.left) || $(n.right),\n ObjectExpression: ($, n) => n.properties.reduce((o, p) => {\n $.memberDepth += 1;\n const k = $(p.key);\n $.memberDepth -= 1;\n if (DisallowedMethods.has($(p.value))) {\n // eslint-disable-next-line no-console\n console.error(`Prevented interpretation of property \"${k}\" which could lead to insecure code execution`);\n } else {\n o[k] = $(p.value);\n }\n return o;\n }, {})\n };\n function interpret(ast, fn, params, datum, event, item) {\n const $ = n => Visitors[n.type]($, n);\n $.memberDepth = 0;\n $.fn = Object.create(fn);\n $.params = params;\n $.datum = datum;\n $.event = event;\n $.item = item;\n\n // route event functions to annotated vega event context\n EventFunctions.forEach(f => $.fn[f] = function () {\n return event.vega[f](...arguments);\n });\n return $(ast);\n }\n var expression = {\n /**\n * Parse an expression used to update an operator value.\n */\n operator(ctx, expr) {\n const ast = expr.ast,\n fn = ctx.functions;\n return _ => interpret(ast, fn, _);\n },\n /**\n * Parse an expression provided as an operator parameter value.\n */\n parameter(ctx, expr) {\n const ast = expr.ast,\n fn = ctx.functions;\n return (datum, _) => interpret(ast, fn, _, datum);\n },\n /**\n * Parse an expression applied to an event stream.\n */\n event(ctx, expr) {\n const ast = expr.ast,\n fn = ctx.functions;\n return event => interpret(ast, fn, undefined, undefined, event);\n },\n /**\n * Parse an expression used to handle an event-driven operator update.\n */\n handler(ctx, expr) {\n const ast = expr.ast,\n fn = ctx.functions;\n return (_, event) => {\n const datum = event.item && event.item.datum;\n return interpret(ast, fn, _, datum, event);\n };\n },\n /**\n * Parse an expression that performs visual encoding.\n */\n encode(ctx, encode) {\n const {\n marktype,\n channels\n } = encode,\n fn = ctx.functions,\n swap = marktype === 'group' || marktype === 'image' || marktype === 'rect';\n return (item, _) => {\n const datum = item.datum;\n let m = 0,\n v;\n for (const name in channels) {\n v = interpret(channels[name].ast, fn, _, datum, undefined, item);\n if (item[name] !== v) {\n item[name] = v;\n m = 1;\n }\n }\n if (marktype !== 'rule') {\n adjustSpatial(item, channels, swap);\n }\n return m;\n };\n }\n };\n\n function e(e) {\n const [n, r] = /schema\\/([\\w-]+)\\/([\\w\\.\\-]+)\\.json$/g.exec(e).slice(1, 3);\n return {\n library: n,\n version: r\n };\n }\n\n var name$1 = \"vega-themes\";\n var version$1$1 = \"2.15.0\";\n var description$1 = \"Themes for stylized Vega and Vega-Lite visualizations.\";\n var keywords$1 = [\"vega\", \"vega-lite\", \"themes\", \"style\"];\n var license$1 = \"BSD-3-Clause\";\n var author$1 = {\n name: \"UW Interactive Data Lab\",\n url: \"https://idl.cs.washington.edu\"\n };\n var contributors$1 = [{\n name: \"Emily Gu\",\n url: \"https://github.com/emilygu\"\n }, {\n name: \"Arvind Satyanarayan\",\n url: \"http://arvindsatya.com\"\n }, {\n name: \"Jeffrey Heer\",\n url: \"https://idl.cs.washington.edu\"\n }, {\n name: \"Dominik Moritz\",\n url: \"https://www.domoritz.de\"\n }];\n var main$1 = \"build/vega-themes.js\";\n var module$1 = \"build/vega-themes.module.js\";\n var unpkg$1 = \"build/vega-themes.min.js\";\n var jsdelivr$1 = \"build/vega-themes.min.js\";\n var types$1 = \"build/vega-themes.module.d.ts\";\n var repository$1 = {\n type: \"git\",\n url: \"https://github.com/vega/vega-themes.git\"\n };\n var files$1 = [\"src\", \"build\"];\n var scripts$1 = {\n prebuild: \"yarn clean\",\n build: \"rollup -c\",\n clean: \"rimraf build && rimraf examples/build\",\n \"copy:data\": \"rsync -r node_modules/vega-datasets/data/* examples/data\",\n \"copy:build\": \"rsync -r build/* examples/build\",\n \"deploy:gh\": \"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples\",\n preversion: \"yarn lint\",\n serve: \"browser-sync start -s -f build examples --serveStatic examples\",\n start: \"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'\",\n format: \"eslint . --fix\",\n lint: \"eslint .\",\n release: \"release-it\"\n };\n var devDependencies$1 = {\n \"@babel/core\": \"^7.24.6\",\n \"@babel/plugin-transform-runtime\": \"^7.24.6\",\n \"@babel/preset-env\": \"^7.24.6\",\n \"@babel/preset-typescript\": \"^7.24.6\",\n \"@release-it/conventional-changelog\": \"^8.0.1\",\n \"@rollup/plugin-json\": \"^6.1.0\",\n \"@rollup/plugin-node-resolve\": \"^15.2.3\",\n \"@rollup/plugin-terser\": \"^0.4.4\",\n \"@typescript-eslint/eslint-plugin\": \"^7.11.0\",\n \"@typescript-eslint/parser\": \"^7.11.0\",\n \"browser-sync\": \"^3.0.2\",\n concurrently: \"^8.2.2\",\n eslint: \"^8.45.0\",\n \"eslint-config-prettier\": \"^9.1.0\",\n \"eslint-plugin-prettier\": \"^5.1.3\",\n \"gh-pages\": \"^6.1.1\",\n prettier: \"^3.2.5\",\n \"release-it\": \"^17.3.0\",\n rollup: \"^4.18.0\",\n \"rollup-plugin-bundle-size\": \"^1.0.3\",\n \"rollup-plugin-ts\": \"^3.4.5\",\n typescript: \"^5.4.5\",\n vega: \"^5.25.0\",\n \"vega-lite\": \"^5.9.3\"\n };\n var peerDependencies$1 = {\n vega: \"*\",\n \"vega-lite\": \"*\"\n };\n var dependencies$1 = {};\n var pkg$1 = {\n name: name$1,\n version: version$1$1,\n description: description$1,\n keywords: keywords$1,\n license: license$1,\n author: author$1,\n contributors: contributors$1,\n main: main$1,\n module: module$1,\n unpkg: unpkg$1,\n jsdelivr: jsdelivr$1,\n types: types$1,\n repository: repository$1,\n files: files$1,\n scripts: scripts$1,\n devDependencies: devDependencies$1,\n peerDependencies: peerDependencies$1,\n dependencies: dependencies$1\n };\n const lightColor = '#fff';\n const medColor = '#888';\n const darkTheme = {\n background: '#333',\n view: {\n stroke: medColor\n },\n title: {\n color: lightColor,\n subtitleColor: lightColor\n },\n style: {\n 'guide-label': {\n fill: lightColor\n },\n 'guide-title': {\n fill: lightColor\n }\n },\n axis: {\n domainColor: lightColor,\n gridColor: medColor,\n tickColor: lightColor\n }\n };\n const markColor$7 = '#4572a7';\n const excelTheme = {\n background: '#fff',\n arc: {\n fill: markColor$7\n },\n area: {\n fill: markColor$7\n },\n line: {\n stroke: markColor$7,\n strokeWidth: 2\n },\n path: {\n stroke: markColor$7\n },\n rect: {\n fill: markColor$7\n },\n shape: {\n stroke: markColor$7\n },\n symbol: {\n fill: markColor$7,\n strokeWidth: 1.5,\n size: 50\n },\n axis: {\n bandPosition: 0.5,\n grid: true,\n gridColor: '#000000',\n gridOpacity: 1,\n gridWidth: 0.5,\n labelPadding: 10,\n tickSize: 5,\n tickWidth: 0.5\n },\n axisBand: {\n grid: false,\n tickExtra: true\n },\n legend: {\n labelBaseline: 'middle',\n labelFontSize: 11,\n symbolSize: 50,\n symbolType: 'square'\n },\n range: {\n category: ['#4572a7', '#aa4643', '#8aa453', '#71598e', '#4598ae', '#d98445', '#94aace', '#d09393', '#b9cc98', '#a99cbc']\n }\n };\n const markColor$6 = '#30a2da';\n const axisColor$2 = '#cbcbcb';\n const guideLabelColor = '#999';\n const guideTitleColor = '#333';\n const backgroundColor$2 = '#f0f0f0';\n const blackTitle = '#333';\n const fiveThirtyEightTheme = {\n arc: {\n fill: markColor$6\n },\n area: {\n fill: markColor$6\n },\n axis: {\n domainColor: axisColor$2,\n grid: true,\n gridColor: axisColor$2,\n gridWidth: 1,\n labelColor: guideLabelColor,\n labelFontSize: 10,\n titleColor: guideTitleColor,\n tickColor: axisColor$2,\n tickSize: 10,\n titleFontSize: 14,\n titlePadding: 10,\n labelPadding: 4\n },\n axisBand: {\n grid: false\n },\n background: backgroundColor$2,\n group: {\n fill: backgroundColor$2\n },\n legend: {\n labelColor: blackTitle,\n labelFontSize: 11,\n padding: 1,\n symbolSize: 30,\n symbolType: 'square',\n titleColor: blackTitle,\n titleFontSize: 14,\n titlePadding: 10\n },\n line: {\n stroke: markColor$6,\n strokeWidth: 2\n },\n path: {\n stroke: markColor$6,\n strokeWidth: 0.5\n },\n rect: {\n fill: markColor$6\n },\n range: {\n category: ['#30a2da', '#fc4f30', '#e5ae38', '#6d904f', '#8b8b8b', '#b96db8', '#ff9e27', '#56cc60', '#52d2ca', '#52689e', '#545454', '#9fe4f8'],\n diverging: ['#cc0020', '#e77866', '#f6e7e1', '#d6e8ed', '#91bfd9', '#1d78b5'],\n heatmap: ['#d6e8ed', '#cee0e5', '#91bfd9', '#549cc6', '#1d78b5']\n },\n point: {\n filled: true,\n shape: 'circle'\n },\n shape: {\n stroke: markColor$6\n },\n bar: {\n binSpacing: 2,\n fill: markColor$6,\n stroke: null\n },\n title: {\n anchor: 'start',\n fontSize: 24,\n fontWeight: 600,\n offset: 20\n }\n };\n const markColor$5 = '#000';\n const ggplot2Theme = {\n group: {\n fill: '#e5e5e5'\n },\n arc: {\n fill: markColor$5\n },\n area: {\n fill: markColor$5\n },\n line: {\n stroke: markColor$5\n },\n path: {\n stroke: markColor$5\n },\n rect: {\n fill: markColor$5\n },\n shape: {\n stroke: markColor$5\n },\n symbol: {\n fill: markColor$5,\n size: 40\n },\n axis: {\n domain: false,\n grid: true,\n gridColor: '#FFFFFF',\n gridOpacity: 1,\n labelColor: '#7F7F7F',\n labelPadding: 4,\n tickColor: '#7F7F7F',\n tickSize: 5.67,\n titleFontSize: 16,\n titleFontWeight: 'normal'\n },\n legend: {\n labelBaseline: 'middle',\n labelFontSize: 11,\n symbolSize: 40\n },\n range: {\n category: ['#000000', '#7F7F7F', '#1A1A1A', '#999999', '#333333', '#B0B0B0', '#4D4D4D', '#C9C9C9', '#666666', '#DCDCDC']\n }\n };\n const headlineFontSize = 22;\n const headlineFontWeight = 'normal';\n const labelFont$1 = 'Benton Gothic, sans-serif';\n const labelFontSize = 11.5;\n const labelFontWeight = 'normal';\n const markColor$4 = '#82c6df';\n // const markHighlight = '#006d8f';\n // const markDemocrat = '#5789b8';\n // const markRepublican = '#d94f54';\n const titleFont = 'Benton Gothic Bold, sans-serif';\n const titleFontWeight = 'normal';\n const titleFontSize$1 = 13;\n const colorSchemes$1 = {\n 'category-6': ['#ec8431', '#829eb1', '#c89d29', '#3580b1', '#adc839', '#ab7fb4'],\n 'fire-7': ['#fbf2c7', '#f9e39c', '#f8d36e', '#f4bb6a', '#e68a4f', '#d15a40', '#ab4232'],\n 'fireandice-6': ['#e68a4f', '#f4bb6a', '#f9e39c', '#dadfe2', '#a6b7c6', '#849eae'],\n 'ice-7': ['#edefee', '#dadfe2', '#c4ccd2', '#a6b7c6', '#849eae', '#607785', '#47525d']\n };\n const latimesTheme = {\n background: '#ffffff',\n title: {\n anchor: 'start',\n color: '#000000',\n font: titleFont,\n fontSize: headlineFontSize,\n fontWeight: headlineFontWeight\n },\n arc: {\n fill: markColor$4\n },\n area: {\n fill: markColor$4\n },\n line: {\n stroke: markColor$4,\n strokeWidth: 2\n },\n path: {\n stroke: markColor$4\n },\n rect: {\n fill: markColor$4\n },\n shape: {\n stroke: markColor$4\n },\n symbol: {\n fill: markColor$4,\n size: 30\n },\n axis: {\n labelFont: labelFont$1,\n labelFontSize,\n labelFontWeight,\n titleFont,\n titleFontSize: titleFontSize$1,\n titleFontWeight\n },\n axisX: {\n labelAngle: 0,\n labelPadding: 4,\n tickSize: 3\n },\n axisY: {\n labelBaseline: 'middle',\n maxExtent: 45,\n minExtent: 45,\n tickSize: 2,\n titleAlign: 'left',\n titleAngle: 0,\n titleX: -45,\n titleY: -11\n },\n legend: {\n labelFont: labelFont$1,\n labelFontSize,\n symbolType: 'square',\n titleFont,\n titleFontSize: titleFontSize$1,\n titleFontWeight\n },\n range: {\n category: colorSchemes$1['category-6'],\n diverging: colorSchemes$1['fireandice-6'],\n heatmap: colorSchemes$1['fire-7'],\n ordinal: colorSchemes$1['fire-7'],\n ramp: colorSchemes$1['fire-7']\n }\n };\n const markColor$3 = '#ab5787';\n const axisColor$1 = '#979797';\n const quartzTheme = {\n background: '#f9f9f9',\n arc: {\n fill: markColor$3\n },\n area: {\n fill: markColor$3\n },\n line: {\n stroke: markColor$3\n },\n path: {\n stroke: markColor$3\n },\n rect: {\n fill: markColor$3\n },\n shape: {\n stroke: markColor$3\n },\n symbol: {\n fill: markColor$3,\n size: 30\n },\n axis: {\n domainColor: axisColor$1,\n domainWidth: 0.5,\n gridWidth: 0.2,\n labelColor: axisColor$1,\n tickColor: axisColor$1,\n tickWidth: 0.2,\n titleColor: axisColor$1\n },\n axisBand: {\n grid: false\n },\n axisX: {\n grid: true,\n tickSize: 10\n },\n axisY: {\n domain: false,\n grid: true,\n tickSize: 0\n },\n legend: {\n labelFontSize: 11,\n padding: 1,\n symbolSize: 30,\n symbolType: 'square'\n },\n range: {\n category: ['#ab5787', '#51b2e5', '#703c5c', '#168dd9', '#d190b6', '#00609f', '#d365ba', '#154866', '#666666', '#c4c4c4']\n }\n };\n const markColor$2 = '#3e5c69';\n const voxTheme = {\n background: '#fff',\n arc: {\n fill: markColor$2\n },\n area: {\n fill: markColor$2\n },\n line: {\n stroke: markColor$2\n },\n path: {\n stroke: markColor$2\n },\n rect: {\n fill: markColor$2\n },\n shape: {\n stroke: markColor$2\n },\n symbol: {\n fill: markColor$2\n },\n axis: {\n domainWidth: 0.5,\n grid: true,\n labelPadding: 2,\n tickSize: 5,\n tickWidth: 0.5,\n titleFontWeight: 'normal'\n },\n axisBand: {\n grid: false\n },\n axisX: {\n gridWidth: 0.2\n },\n axisY: {\n gridDash: [3],\n gridWidth: 0.4\n },\n legend: {\n labelFontSize: 11,\n padding: 1,\n symbolType: 'square'\n },\n range: {\n category: ['#3e5c69', '#6793a6', '#182429', '#0570b0', '#3690c0', '#74a9cf', '#a6bddb', '#e2ddf2']\n }\n };\n const markColor$1 = '#1696d2';\n const axisColor = '#000000';\n const backgroundColor$1 = '#FFFFFF';\n const font = 'Lato';\n const labelFont = 'Lato';\n const sourceFont = 'Lato';\n const gridColor$1 = '#DEDDDD';\n const titleFontSize = 18;\n const colorSchemes = {\n 'main-colors': ['#1696d2', '#d2d2d2', '#000000', '#fdbf11', '#ec008b', '#55b748', '#5c5859', '#db2b27'],\n 'shades-blue': ['#CFE8F3', '#A2D4EC', '#73BFE2', '#46ABDB', '#1696D2', '#12719E', '#0A4C6A', '#062635'],\n 'shades-gray': ['#F5F5F5', '#ECECEC', '#E3E3E3', '#DCDBDB', '#D2D2D2', '#9D9D9D', '#696969', '#353535'],\n 'shades-yellow': ['#FFF2CF', '#FCE39E', '#FDD870', '#FCCB41', '#FDBF11', '#E88E2D', '#CA5800', '#843215'],\n 'shades-magenta': ['#F5CBDF', '#EB99C2', '#E46AA7', '#E54096', '#EC008B', '#AF1F6B', '#761548', '#351123'],\n 'shades-green': ['#DCEDD9', '#BCDEB4', '#98CF90', '#78C26D', '#55B748', '#408941', '#2C5C2D', '#1A2E19'],\n 'shades-black': ['#D5D5D4', '#ADABAC', '#848081', '#5C5859', '#332D2F', '#262223', '#1A1717', '#0E0C0D'],\n 'shades-red': ['#F8D5D4', '#F1AAA9', '#E9807D', '#E25552', '#DB2B27', '#A4201D', '#6E1614', '#370B0A'],\n 'one-group': ['#1696d2', '#000000'],\n 'two-groups-cat-1': ['#1696d2', '#000000'],\n 'two-groups-cat-2': ['#1696d2', '#fdbf11'],\n 'two-groups-cat-3': ['#1696d2', '#db2b27'],\n 'two-groups-seq': ['#a2d4ec', '#1696d2'],\n 'three-groups-cat': ['#1696d2', '#fdbf11', '#000000'],\n 'three-groups-seq': ['#a2d4ec', '#1696d2', '#0a4c6a'],\n 'four-groups-cat-1': ['#000000', '#d2d2d2', '#fdbf11', '#1696d2'],\n 'four-groups-cat-2': ['#1696d2', '#ec0008b', '#fdbf11', '#5c5859'],\n 'four-groups-seq': ['#cfe8f3', '#73bf42', '#1696d2', '#0a4c6a'],\n 'five-groups-cat-1': ['#1696d2', '#fdbf11', '#d2d2d2', '#ec008b', '#000000'],\n 'five-groups-cat-2': ['#1696d2', '#0a4c6a', '#d2d2d2', '#fdbf11', '#332d2f'],\n 'five-groups-seq': ['#cfe8f3', '#73bf42', '#1696d2', '#0a4c6a', '#000000'],\n 'six-groups-cat-1': ['#1696d2', '#ec008b', '#fdbf11', '#000000', '#d2d2d2', '#55b748'],\n 'six-groups-cat-2': ['#1696d2', '#d2d2d2', '#ec008b', '#fdbf11', '#332d2f', '#0a4c6a'],\n 'six-groups-seq': ['#cfe8f3', '#a2d4ec', '#73bfe2', '#46abdb', '#1696d2', '#12719e'],\n 'diverging-colors': ['#ca5800', '#fdbf11', '#fdd870', '#fff2cf', '#cfe8f3', '#73bfe2', '#1696d2', '#0a4c6a']\n };\n const urbanInstituteTheme = {\n background: backgroundColor$1,\n title: {\n anchor: 'start',\n fontSize: titleFontSize,\n font: font\n },\n axisX: {\n domain: true,\n domainColor: axisColor,\n domainWidth: 1,\n grid: false,\n labelFontSize: 12,\n labelFont: labelFont,\n labelAngle: 0,\n tickColor: axisColor,\n tickSize: 5,\n titleFontSize: 12,\n titlePadding: 10,\n titleFont: font\n },\n axisY: {\n domain: false,\n domainWidth: 1,\n grid: true,\n gridColor: gridColor$1,\n gridWidth: 1,\n labelFontSize: 12,\n labelFont: labelFont,\n labelPadding: 8,\n ticks: false,\n titleFontSize: 12,\n titlePadding: 10,\n titleFont: font,\n titleAngle: 0,\n titleY: -10,\n titleX: 18\n },\n legend: {\n labelFontSize: 12,\n labelFont: labelFont,\n symbolSize: 100,\n titleFontSize: 12,\n titlePadding: 10,\n titleFont: font,\n orient: 'right',\n offset: 10\n },\n view: {\n stroke: 'transparent'\n },\n range: {\n category: colorSchemes['six-groups-cat-1'],\n diverging: colorSchemes['diverging-colors'],\n heatmap: colorSchemes['diverging-colors'],\n ordinal: colorSchemes['six-groups-seq'],\n ramp: colorSchemes['shades-blue']\n },\n area: {\n fill: markColor$1\n },\n rect: {\n fill: markColor$1\n },\n line: {\n color: markColor$1,\n stroke: markColor$1,\n strokeWidth: 5\n },\n trail: {\n color: markColor$1,\n stroke: markColor$1,\n strokeWidth: 0,\n size: 1\n },\n path: {\n stroke: markColor$1,\n strokeWidth: 0.5\n },\n point: {\n filled: true\n },\n text: {\n font: sourceFont,\n color: markColor$1,\n fontSize: 11,\n align: 'center',\n fontWeight: 400,\n size: 11\n },\n style: {\n bar: {\n fill: markColor$1,\n stroke: null\n }\n },\n arc: {\n fill: markColor$1\n },\n shape: {\n stroke: markColor$1\n },\n symbol: {\n fill: markColor$1,\n size: 30\n }\n };\n\n /**\n * Copyright 2020 Google LLC.\n *\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file or at\n * https://developers.google.com/open-source/licenses/bsd\n */\n\n const markColor = '#3366CC';\n const gridColor = '#ccc';\n const defaultFont$1 = 'Arial, sans-serif';\n const googlechartsTheme = {\n arc: {\n fill: markColor\n },\n area: {\n fill: markColor\n },\n path: {\n stroke: markColor\n },\n rect: {\n fill: markColor\n },\n shape: {\n stroke: markColor\n },\n symbol: {\n stroke: markColor\n },\n circle: {\n fill: markColor\n },\n background: '#fff',\n padding: {\n top: 10,\n right: 10,\n bottom: 10,\n left: 10\n },\n style: {\n 'guide-label': {\n font: defaultFont$1,\n fontSize: 12\n },\n 'guide-title': {\n font: defaultFont$1,\n fontSize: 12\n },\n 'group-title': {\n font: defaultFont$1,\n fontSize: 12\n }\n },\n title: {\n font: defaultFont$1,\n fontSize: 14,\n fontWeight: 'bold',\n dy: -3,\n anchor: 'start'\n },\n axis: {\n gridColor: gridColor,\n tickColor: gridColor,\n domain: false,\n grid: true\n },\n range: {\n category: ['#4285F4', '#DB4437', '#F4B400', '#0F9D58', '#AB47BC', '#00ACC1', '#FF7043', '#9E9D24', '#5C6BC0', '#F06292', '#00796B', '#C2185B'],\n heatmap: ['#c6dafc', '#5e97f6', '#2a56c6']\n }\n };\n const ptToPx = value => value * (1 / 3 + 1);\n const fontSmallPx = ptToPx(9);\n const legendFontPx = ptToPx(10);\n const fontLargePx = ptToPx(12);\n const fontStandard = 'Segoe UI';\n const fontTitle = 'wf_standard-font, helvetica, arial, sans-serif';\n const firstLevelElementColor = '#252423';\n const secondLevelElementColor = '#605E5C';\n const backgroundColor = 'transparent';\n const backgroundSecondaryColor = '#C8C6C4';\n const paletteColor1 = '#118DFF';\n const paletteColor2 = '#12239E';\n const paletteColor3 = '#E66C37';\n const paletteColor4 = '#6B007B';\n const paletteColor5 = '#E044A7';\n const paletteColor6 = '#744EC2';\n const paletteColor7 = '#D9B300';\n const paletteColor8 = '#D64550';\n const divergentColorMax = paletteColor1;\n const divergentColorMin = '#DEEFFF';\n const divergentPalette = [divergentColorMin, divergentColorMax];\n const ordinalPalette = [divergentColorMin, '#c7e4ff', '#b0d9ff', '#9aceff', '#83c3ff', '#6cb9ff', '#55aeff', '#3fa3ff', '#2898ff', divergentColorMax];\n const powerbiTheme = {\n view: {\n stroke: backgroundColor\n },\n background: backgroundColor,\n font: fontStandard,\n header: {\n titleFont: fontTitle,\n titleFontSize: fontLargePx,\n titleColor: firstLevelElementColor,\n labelFont: fontStandard,\n labelFontSize: legendFontPx,\n labelColor: secondLevelElementColor\n },\n axis: {\n ticks: false,\n grid: false,\n domain: false,\n labelColor: secondLevelElementColor,\n labelFontSize: fontSmallPx,\n titleFont: fontTitle,\n titleColor: firstLevelElementColor,\n titleFontSize: fontLargePx,\n titleFontWeight: 'normal'\n },\n axisQuantitative: {\n tickCount: 3,\n grid: true,\n gridColor: backgroundSecondaryColor,\n gridDash: [1, 5],\n labelFlush: false\n },\n axisBand: {\n tickExtra: true\n },\n axisX: {\n labelPadding: 5\n },\n axisY: {\n labelPadding: 10\n },\n bar: {\n fill: paletteColor1\n },\n line: {\n stroke: paletteColor1,\n strokeWidth: 3,\n strokeCap: 'round',\n strokeJoin: 'round'\n },\n text: {\n font: fontStandard,\n fontSize: fontSmallPx,\n fill: secondLevelElementColor\n },\n arc: {\n fill: paletteColor1\n },\n area: {\n fill: paletteColor1,\n line: true,\n opacity: 0.6\n },\n path: {\n stroke: paletteColor1\n },\n rect: {\n fill: paletteColor1\n },\n point: {\n fill: paletteColor1,\n filled: true,\n size: 75\n },\n shape: {\n stroke: paletteColor1\n },\n symbol: {\n fill: paletteColor1,\n strokeWidth: 1.5,\n size: 50\n },\n legend: {\n titleFont: fontStandard,\n titleFontWeight: 'bold',\n titleColor: secondLevelElementColor,\n labelFont: fontStandard,\n labelFontSize: legendFontPx,\n labelColor: secondLevelElementColor,\n symbolType: 'circle',\n symbolSize: 75\n },\n range: {\n category: [paletteColor1, paletteColor2, paletteColor3, paletteColor4, paletteColor5, paletteColor6, paletteColor7, paletteColor8],\n diverging: divergentPalette,\n heatmap: divergentPalette,\n ordinal: ordinalPalette\n }\n };\n const defaultFont = 'IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,\".sfnstext-regular\",sans-serif';\n const condensedFont = 'IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, \".SFNSText-Regular\", sans-serif';\n const fontWeight = 400;\n const TOKENS = {\n textPrimary: {\n g90: '#f4f4f4',\n g100: '#f4f4f4',\n white: '#161616',\n g10: '#161616'\n },\n textSecondary: {\n g90: '#c6c6c6',\n g100: '#c6c6c6',\n white: '#525252',\n g10: '#525252'\n },\n // layer\n layerAccent01: {\n white: '#e0e0e0',\n g10: '#e0e0e0',\n g90: '#525252',\n g100: '#393939'\n },\n // grid\n gridBg: {\n white: '#ffffff',\n g10: '#ffffff',\n g90: '#161616',\n g100: '#161616'\n }\n };\n const darkCategories = ['#8a3ffc', '#33b1ff', '#007d79', '#ff7eb6', '#fa4d56', '#fff1f1', '#6fdc8c', '#4589ff', '#d12771', '#d2a106', '#08bdba', '#bae6ff', '#ba4e00', '#d4bbff'];\n const lightCategories = ['#6929c4', '#1192e8', '#005d5d', '#9f1853', '#fa4d56', '#570408', '#198038', '#002d9c', '#ee538b', '#b28600', '#009d9a', '#012749', '#8a3800', '#a56eff'];\n function genCarbonConfig({\n theme,\n background\n }) {\n const type = ['white', 'g10'].includes(theme) ? 'light' : 'dark';\n const viewbg = TOKENS.gridBg[theme];\n const titleColor = TOKENS.textPrimary[theme];\n const textColor = TOKENS.textSecondary[theme];\n const category = type === 'dark' ? darkCategories : lightCategories;\n const markColor = type === 'dark' ? '#d4bbff' : '#6929c4';\n return {\n background,\n arc: {\n fill: markColor\n },\n area: {\n fill: markColor\n },\n path: {\n stroke: markColor\n },\n rect: {\n fill: markColor\n },\n shape: {\n stroke: markColor\n },\n symbol: {\n stroke: markColor\n },\n circle: {\n fill: markColor\n },\n view: {\n fill: viewbg,\n stroke: viewbg\n },\n group: {\n fill: viewbg\n },\n title: {\n color: titleColor,\n anchor: 'start',\n dy: -15,\n fontSize: 16,\n font: defaultFont,\n fontWeight: 600\n },\n axis: {\n // Axis labels\n labelColor: textColor,\n labelFontSize: 12,\n labelFont: condensedFont,\n labelFontWeight: fontWeight,\n // Axis titles\n titleColor: titleColor,\n titleFontWeight: 600,\n titleFontSize: 12,\n // MISC\n grid: true,\n gridColor: TOKENS.layerAccent01[theme],\n labelAngle: 0\n },\n axisX: {\n titlePadding: 10\n },\n axisY: {\n titlePadding: 2.5\n },\n style: {\n 'guide-label': {\n font: defaultFont,\n fill: textColor,\n fontWeight: fontWeight\n },\n 'guide-title': {\n font: defaultFont,\n fill: textColor,\n fontWeight: fontWeight\n }\n },\n range: {\n category,\n diverging: ['#750e13', '#a2191f', '#da1e28', '#fa4d56', '#ff8389', '#ffb3b8', '#ffd7d9', '#fff1f1', '#e5f6ff', '#bae6ff', '#82cfff', '#33b1ff', '#1192e8', '#0072c3', '#00539a', '#003a6d'],\n heatmap: ['#f6f2ff', '#e8daff', '#d4bbff', '#be95ff', '#a56eff', '#8a3ffc', '#6929c4', '#491d8b', '#31135e', '#1c0f30']\n }\n };\n }\n const carbonwhite = genCarbonConfig({\n theme: 'white',\n background: '#ffffff'\n });\n const carbong10 = genCarbonConfig({\n theme: 'g10',\n background: '#f4f4f4'\n });\n const carbong90 = genCarbonConfig({\n theme: 'g90',\n background: '#262626'\n });\n const carbong100 = genCarbonConfig({\n theme: 'g100',\n background: '#161616'\n });\n const version$2 = pkg$1.version;\n\n var themes = /*#__PURE__*/Object.freeze({\n __proto__: null,\n carbong10: carbong10,\n carbong100: carbong100,\n carbong90: carbong90,\n carbonwhite: carbonwhite,\n dark: darkTheme,\n excel: excelTheme,\n fivethirtyeight: fiveThirtyEightTheme,\n ggplot2: ggplot2Theme,\n googlecharts: googlechartsTheme,\n latimes: latimesTheme,\n powerbi: powerbiTheme,\n quartz: quartzTheme,\n urbaninstitute: urbanInstituteTheme,\n version: version$2,\n vox: voxTheme\n });\n\n function accessor(fn, fields, name) {\n fn.fields = fields || [];\n fn.fname = name;\n return fn;\n }\n function getter(path) {\n return path.length === 1 ? get1(path[0]) : getN(path);\n }\n const get1 = field => function (obj) {\n return obj[field];\n };\n const getN = path => {\n const len = path.length;\n return function (obj) {\n for (let i = 0; i < len; ++i) {\n obj = obj[path[i]];\n }\n return obj;\n };\n };\n function error(message) {\n throw Error(message);\n }\n function splitAccessPath(p) {\n const path = [],\n n = p.length;\n let q = null,\n b = 0,\n s = '',\n i,\n j,\n c;\n p = p + '';\n function push() {\n path.push(s + p.substring(i, j));\n s = '';\n i = j + 1;\n }\n for (i = j = 0; j < n; ++j) {\n c = p[j];\n if (c === '\\\\') {\n s += p.substring(i, j++);\n i = j;\n } else if (c === q) {\n push();\n q = null;\n b = -1;\n } else if (q) {\n continue;\n } else if (i === b && c === '\"') {\n i = j + 1;\n q = c;\n } else if (i === b && c === \"'\") {\n i = j + 1;\n q = c;\n } else if (c === '.' && !b) {\n if (j > i) {\n push();\n } else {\n i = j + 1;\n }\n } else if (c === '[') {\n if (j > i) push();\n b = i = j + 1;\n } else if (c === ']') {\n if (!b) error('Access path missing open bracket: ' + p);\n if (b > 0) push();\n b = 0;\n i = j + 1;\n }\n }\n if (b) error('Access path missing closing bracket: ' + p);\n if (q) error('Access path missing closing quote: ' + p);\n if (j > i) {\n j++;\n push();\n }\n return path;\n }\n function field(field, name, opt) {\n const path = splitAccessPath(field);\n field = path.length === 1 ? path[0] : field;\n return accessor((getter)(path), [field], field);\n }\n field('id');\n accessor(_ => _, [], 'identity');\n accessor(() => 0, [], 'zero');\n accessor(() => 1, [], 'one');\n accessor(() => true, [], 'true');\n accessor(() => false, [], 'false');\n var isArray = Array.isArray;\n function isObject(_) {\n return _ === Object(_);\n }\n function isString(_) {\n return typeof _ === 'string';\n }\n\n /**\n * Format the value to be shown in the tooltip.\n *\n * @param value The value to show in the tooltip.\n * @param valueToHtml Function to convert a single cell value to an HTML string\n */\n function formatValue(value, valueToHtml, maxDepth, baseURL) {\n if (isArray(value)) {\n return `[${value.map(v => valueToHtml(isString(v) ? v : stringify(v, maxDepth))).join(', ')}]`;\n }\n if (isObject(value)) {\n let content = '';\n const {\n title,\n image,\n ...rest\n } = value;\n if (title) {\n content += `

${valueToHtml(title)}

`;\n }\n if (image) {\n content += ``;\n }\n const keys = Object.keys(rest);\n if (keys.length > 0) {\n content += '';\n for (const key of keys) {\n let val = rest[key];\n\n // ignore undefined properties\n if (val === undefined) {\n continue;\n }\n if (isObject(val)) {\n val = stringify(val, maxDepth);\n }\n content += ``;\n }\n content += `
${valueToHtml(key)}${valueToHtml(val)}
`;\n }\n return content || '{}'; // show empty object if there are no properties\n }\n return valueToHtml(value);\n }\n function replacer(maxDepth) {\n const stack = [];\n return function (key, value) {\n if (typeof value !== 'object' || value === null) {\n return value;\n }\n const pos = stack.indexOf(this) + 1;\n stack.length = pos;\n if (stack.length > maxDepth) {\n return '[Object]';\n }\n if (stack.indexOf(value) >= 0) {\n return '[Circular]';\n }\n stack.push(value);\n return value;\n };\n }\n\n /**\n * Stringify any JS object to valid JSON\n */\n function stringify(obj, maxDepth) {\n return JSON.stringify(obj, replacer(maxDepth));\n }\n\n // generated with build-style.sh\n var defaultStyle = `#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black;\n}\n#vg-tooltip-element.visible {\n visibility: visible;\n}\n#vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px;\n}\n#vg-tooltip-element table {\n border-spacing: 0;\n}\n#vg-tooltip-element table tr {\n border: none;\n}\n#vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px;\n}\n#vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px;\n}\n#vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left;\n}\n#vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white;\n}\n#vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf;\n}\n`;\n const EL_ID = 'vg-tooltip-element';\n const DEFAULT_OPTIONS = {\n /**\n * X offset.\n */\n offsetX: 10,\n /**\n * Y offset.\n */\n offsetY: 10,\n /**\n * ID of the tooltip element.\n */\n id: EL_ID,\n /**\n * ID of the tooltip CSS style.\n */\n styleId: 'vega-tooltip-style',\n /**\n * The name of the theme. You can use the CSS class called [THEME]-theme to style the tooltips.\n *\n * There are two predefined themes: \"light\" (default) and \"dark\".\n */\n theme: 'light',\n /**\n * Do not use the default styles provided by Vega Tooltip. If you enable this option, you need to use your own styles. It is not necessary to disable the default style when using a custom theme.\n */\n disableDefaultStyle: false,\n /**\n * HTML sanitizer function that removes dangerous HTML to prevent XSS.\n *\n * This should be a function from string to string. You may replace it with a formatter such as a markdown formatter.\n */\n sanitize: escapeHTML,\n /**\n * The maximum recursion depth when printing objects in the tooltip.\n */\n maxDepth: 2,\n /**\n * A function to customize the rendered HTML of the tooltip.\n * @param value A value string, or object of value strings keyed by field\n * @param sanitize The `sanitize` function from `options.sanitize`\n * @param baseURL The `baseURL` from `options.baseURL`\n * @returns {string} The returned string will become the `innerHTML` of the tooltip element\n */\n formatTooltip: formatValue,\n /**\n * The baseurl to use in image paths.\n */\n baseURL: ''\n };\n /**\n * Escape special HTML characters.\n *\n * @param value A value to convert to string and HTML-escape.\n */\n function escapeHTML(value) {\n return String(value).replace(/&/g, '&').replace(/ window.innerWidth) {\n x = +event.clientX - offsetX - tooltipBox.width;\n }\n let y = event.clientY + offsetY;\n if (y + tooltipBox.height > window.innerHeight) {\n y = +event.clientY - offsetY - tooltipBox.height;\n }\n return {\n x,\n y\n };\n }\n\n /**\n * The tooltip handler class.\n */\n class Handler {\n /**\n * The handler function. We bind this to this function in the constructor.\n */\n\n /**\n * Complete tooltip options.\n */\n\n /**\n * The tooltip html element.\n */\n\n /**\n * Create the tooltip handler and initialize the element and style.\n *\n * @param options Tooltip Options\n */\n constructor(options) {\n this.options = {\n ...DEFAULT_OPTIONS,\n ...options\n };\n const elementId = this.options.id;\n this.el = null;\n\n // bind this to call\n this.call = this.tooltipHandler.bind(this);\n\n // prepend a default stylesheet for tooltips to the head\n if (!this.options.disableDefaultStyle && !document.getElementById(this.options.styleId)) {\n const style = document.createElement('style');\n style.setAttribute('id', this.options.styleId);\n style.innerHTML = createDefaultStyle(elementId);\n const head = document.head;\n if (head.childNodes.length > 0) {\n head.insertBefore(style, head.childNodes[0]);\n } else {\n head.appendChild(style);\n }\n }\n }\n\n /**\n * The tooltip handler function.\n */\n tooltipHandler(handler, event, item, value) {\n // console.log(handler, event, item, value);\n\n // append a div element that we use as a tooltip unless it already exists\n this.el = document.getElementById(this.options.id);\n if (!this.el) {\n this.el = document.createElement('div');\n this.el.setAttribute('id', this.options.id);\n this.el.classList.add('vg-tooltip');\n const tooltipContainer = document.fullscreenElement ?? document.body;\n tooltipContainer.appendChild(this.el);\n }\n\n // hide tooltip for null, undefined, or empty string values\n if (value == null || value === '') {\n this.el.classList.remove('visible', `${this.options.theme}-theme`);\n return;\n }\n\n // set the tooltip content\n this.el.innerHTML = this.options.formatTooltip(value, this.options.sanitize, this.options.maxDepth, this.options.baseURL);\n\n // make the tooltip visible\n this.el.classList.add('visible', `${this.options.theme}-theme`);\n const {\n x,\n y\n } = calculatePosition(event, this.el.getBoundingClientRect(), this.options.offsetX, this.options.offsetY);\n this.el.style.top = `${y}px`;\n this.el.style.left = `${x}px`;\n }\n }\n\n /**\n * Open editor url in a new window, and pass a message.\n */\n function post (window, url, data) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const editor = window.open(url);\n const wait = 10_000;\n const step = 250;\n const {\n origin\n } = new URL(url);\n // eslint-disable-next-line no-bitwise\n let count = ~~(wait / step);\n function listen(evt) {\n if (evt.source === editor) {\n count = 0;\n window.removeEventListener('message', listen, false);\n }\n }\n window.addEventListener('message', listen, false);\n\n // send message\n // periodically resend until ack received or timeout\n function send() {\n if (count <= 0) {\n return;\n }\n editor.postMessage(data, origin);\n setTimeout(send, step);\n count -= 1;\n }\n setTimeout(send, step);\n }\n\n // generated with build-style.sh\n var embedStyle = `.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box;\n}\n.vega-embed.has-actions {\n padding-right: 38px;\n}\n.vega-embed details:not([open]) > :not(summary) {\n display: none !important;\n}\n.vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n cursor: pointer;\n line-height: 0px;\n}\n.vega-embed summary::-webkit-details-marker {\n display: none;\n}\n.vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset;\n}\n.vega-embed summary svg {\n width: 14px;\n height: 14px;\n}\n.vega-embed details[open] summary {\n opacity: 0.7;\n}\n.vega-embed:hover summary, .vega-embed:focus-within summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease;\n}\n.vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left;\n}\n.vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none;\n}\n.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {\n background-color: #f7f7f9;\n color: black;\n}\n.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: \"\";\n display: inline-block;\n position: absolute;\n}\n.vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid rgba(0, 0, 0, 0);\n border-bottom-color: #d9d9d9;\n}\n.vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid rgba(0, 0, 0, 0);\n border-bottom-color: #fff;\n}\n.vega-embed .chart-wrapper.fit-x {\n width: 100%;\n}\n.vega-embed .chart-wrapper.fit-y {\n height: 100%;\n}\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: auto;\n padding-right: 14px;\n}\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n`;\n\n function isURL(s) {\n return s.startsWith('http://') || s.startsWith('https://') || s.startsWith('//');\n }\n function mergeDeep(dest, ...src) {\n for (const s of src) {\n deepMerge_(dest, s);\n }\n return dest;\n }\n function deepMerge_(dest, src) {\n for (const property of Object.keys(src)) {\n vegaImport.writeConfig(dest, property, src[property], true);\n }\n }\n\n var name = \"vega-embed\";\n var version$1 = \"6.26.0\";\n var description = \"Publish Vega visualizations as embedded web components.\";\n var keywords = [\"vega\", \"data\", \"visualization\", \"component\", \"embed\"];\n var repository = {\n type: \"git\",\n url: \"http://github.com/vega/vega-embed.git\"\n };\n var author = {\n name: \"UW Interactive Data Lab\",\n url: \"http://idl.cs.washington.edu\"\n };\n var contributors = [{\n name: \"Dominik Moritz\",\n url: \"https://www.domoritz.de\"\n }];\n var bugs = {\n url: \"https://github.com/vega/vega-embed/issues\"\n };\n var homepage = \"https://github.com/vega/vega-embed#readme\";\n var license = \"BSD-3-Clause\";\n var main = \"build/vega-embed.js\";\n var module = \"build/vega-embed.module.js\";\n var unpkg = \"build/vega-embed.min.js\";\n var jsdelivr = \"build/vega-embed.min.js\";\n var types = \"build/vega-embed.module.d.ts\";\n var files = [\"src\", \"build\"];\n var exports$1 = {\n \".\": {\n \"import\": {\n types: \"./build/vega-embed.module.d.ts\",\n \"default\": \"./build/vega-embed.module.js\"\n },\n require: {\n \"default\": \"./build/vega-embed.js\"\n }\n }\n };\n var devDependencies = {\n \"@babel/core\": \"^7.24.7\",\n \"@babel/eslint-parser\": \"^7.24.7\",\n \"@babel/plugin-transform-runtime\": \"^7.24.7\",\n \"@babel/preset-env\": \"^7.24.7\",\n \"@babel/preset-typescript\": \"^7.24.7\",\n \"@release-it/conventional-changelog\": \"^8.0.1\",\n \"@rollup/plugin-commonjs\": \"26.0.1\",\n \"@rollup/plugin-json\": \"^6.1.0\",\n \"@rollup/plugin-node-resolve\": \"^15.2.3\",\n \"@rollup/plugin-terser\": \"^0.4.4\",\n \"@types/semver\": \"^7.5.8\",\n \"@typescript-eslint/parser\": \"^7.15.0\",\n \"@vitest/coverage-v8\": \"^1.6.0\",\n \"browser-sync\": \"^3.0.2\",\n concurrently: \"^8.2.2\",\n \"del-cli\": \"^5.1.0\",\n eslint: \"^9.6.0\",\n \"eslint-config-prettier\": \"^9.1.0\",\n \"eslint-plugin-prettier\": \"^5.1.3\",\n \"eslint-plugin-vitest\": \"^0.5.4\",\n jsdom: \"^24.1.0\",\n \"postinstall-postinstall\": \"^2.1.0\",\n prettier: \"^3.3.2\",\n \"release-it\": \"^17.4.1\",\n rollup: \"4.18.0\",\n \"rollup-plugin-bundle-size\": \"^1.0.3\",\n \"rollup-plugin-ts\": \"^3.4.5\",\n sass: \"^1.77.6\",\n typescript: \"^5.5.3\",\n \"typescript-eslint\": \"^7.15.0\",\n vega: \"^5.30.0\",\n \"vega-lite\": \"^5.19.0\",\n vitest: \"^1.6.0\",\n \"vitest-canvas-mock\": \"^0.3.3\"\n };\n var peerDependencies = {\n vega: \"^5.21.0\",\n \"vega-lite\": \"*\"\n };\n var dependencies = {\n \"fast-json-patch\": \"^3.1.1\",\n \"json-stringify-pretty-compact\": \"^3.0.0\",\n semver: \"^7.6.2\",\n tslib: \"^2.6.3\",\n \"vega-interpreter\": \"^1.0.5\",\n \"vega-schema-url-parser\": \"^2.2.0\",\n \"vega-themes\": \"^2.15.0\",\n \"vega-tooltip\": \"^0.34.0\"\n };\n var scripts = {\n prebuild: \"yarn clean && yarn build:style\",\n build: \"rollup -c\",\n \"build:style\": \"./build-style.sh\",\n clean: \"del-cli build src/style.ts\",\n prepublishOnly: \"yarn clean && yarn build\",\n preversion: \"yarn lint && yarn test\",\n serve: \"browser-sync start --directory -s -f build *.html\",\n start: \"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'\",\n pretest: \"yarn build:style\",\n test: \"vitest run\",\n prettierbase: \"prettier '*.{css,scss,html}'\",\n format: \"eslint . --fix && yarn prettierbase --write\",\n lint: \"eslint . && yarn prettierbase --check\",\n release: \"release-it\"\n };\n var pkg = {\n name: name,\n version: version$1,\n description: description,\n keywords: keywords,\n repository: repository,\n author: author,\n contributors: contributors,\n bugs: bugs,\n homepage: homepage,\n license: license,\n main: main,\n module: module,\n unpkg: unpkg,\n jsdelivr: jsdelivr,\n types: types,\n files: files,\n exports: exports$1,\n devDependencies: devDependencies,\n peerDependencies: peerDependencies,\n dependencies: dependencies,\n scripts: scripts\n };\n\n const version = pkg.version;\n const vega = vegaImport__namespace;\n let vegaLite = vegaLiteImport__namespace;\n\n // For backwards compatibility with Vega-Lite before v4.\n const w = typeof window !== 'undefined' ? window : undefined;\n if (vegaLite === undefined && w?.vl?.compile) {\n vegaLite = w.vl;\n }\n const DEFAULT_ACTIONS = {\n export: {\n svg: true,\n png: true\n },\n source: true,\n compiled: true,\n editor: true\n };\n const I18N = {\n CLICK_TO_VIEW_ACTIONS: 'Click to view actions',\n COMPILED_ACTION: 'View Compiled Vega',\n EDITOR_ACTION: 'Open in Vega Editor',\n PNG_ACTION: 'Save as PNG',\n SOURCE_ACTION: 'View Source',\n SVG_ACTION: 'Save as SVG'\n };\n const NAMES = {\n vega: 'Vega',\n 'vega-lite': 'Vega-Lite'\n };\n const VERSION = {\n vega: vega.version,\n 'vega-lite': vegaLite ? vegaLite.version : 'not available'\n };\n const PREPROCESSOR = {\n vega: vgSpec => vgSpec,\n 'vega-lite': (vlSpec, config) => vegaLite.compile(vlSpec, {\n config: config\n }).spec\n };\n const SVG_CIRCLES = `\n\n \n \n \n`;\n const CHART_WRAPPER_CLASS = 'chart-wrapper';\n function isTooltipHandler(h) {\n return typeof h === 'function';\n }\n function viewSource(source, sourceHeader, sourceFooter, mode) {\n const header = `${sourceHeader}
`;\n      const footer = `
${sourceFooter}`;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const win = window.open('');\n win.document.write(header + source + footer);\n win.document.title = `${NAMES[mode]} JSON Source`;\n }\n\n /**\n * Try to guess the type of spec.\n *\n * @param spec Vega or Vega-Lite spec.\n */\n function guessMode(spec, providedMode) {\n // Decide mode\n if (spec.$schema) {\n const parsed = e(spec.$schema);\n if (providedMode && providedMode !== parsed.library) {\n console.warn(`The given visualization spec is written in ${NAMES[parsed.library]}, but mode argument sets ${NAMES[providedMode] ?? providedMode}.`);\n }\n const mode = parsed.library;\n if (!satisfies$1(VERSION[mode], `^${parsed.version.slice(1)}`)) {\n console.warn(`The input spec uses ${NAMES[mode]} ${parsed.version}, but the current version of ${NAMES[mode]} is v${VERSION[mode]}.`);\n }\n return mode;\n }\n\n // try to guess from the provided spec\n if ('mark' in spec || 'encoding' in spec || 'layer' in spec || 'hconcat' in spec || 'vconcat' in spec || 'facet' in spec || 'repeat' in spec) {\n return 'vega-lite';\n }\n if ('marks' in spec || 'signals' in spec || 'scales' in spec || 'axes' in spec) {\n return 'vega';\n }\n return providedMode ?? 'vega';\n }\n function isLoader(o) {\n return !!(o && 'load' in o);\n }\n function createLoader(opts) {\n return isLoader(opts) ? opts : vega.loader(opts);\n }\n function embedOptionsFromUsermeta(parsedSpec) {\n const opts = parsedSpec.usermeta?.embedOptions ?? {};\n if (vegaImport.isString(opts.defaultStyle)) {\n // we don't allow styles set via usermeta since it would allow injection of logic (we set the style via innerHTML)\n opts.defaultStyle = false;\n }\n return opts;\n }\n\n /**\n * Embed a Vega visualization component in a web page. This function returns a promise.\n *\n * @param el DOM element in which to place component (DOM node or CSS selector).\n * @param spec String : A URL string from which to load the Vega specification.\n * Object : The Vega/Vega-Lite specification as a parsed JSON object.\n * @param opts A JavaScript object containing options for embedding.\n */\n async function embed(el, spec, opts = {}) {\n let parsedSpec;\n let loader;\n if (vegaImport.isString(spec)) {\n loader = createLoader(opts.loader);\n parsedSpec = JSON.parse(await loader.load(spec));\n } else {\n parsedSpec = spec;\n }\n const loadedEmbedOptions = embedOptionsFromUsermeta(parsedSpec);\n const usermetaLoader = loadedEmbedOptions.loader;\n\n // either create the loader for the first time or create a new loader if the spec has new loader options\n if (!loader || usermetaLoader) {\n loader = createLoader(opts.loader ?? usermetaLoader);\n }\n const usermetaOpts = await loadOpts(loadedEmbedOptions, loader);\n const parsedOpts = await loadOpts(opts, loader);\n const mergedOpts = {\n ...mergeDeep(parsedOpts, usermetaOpts),\n config: vegaImport.mergeConfig(parsedOpts.config ?? {}, usermetaOpts.config ?? {})\n };\n return await _embed(el, parsedSpec, mergedOpts, loader);\n }\n async function loadOpts(opt, loader) {\n const config = vegaImport.isString(opt.config) ? JSON.parse(await loader.load(opt.config)) : opt.config ?? {};\n const patch = vegaImport.isString(opt.patch) ? JSON.parse(await loader.load(opt.patch)) : opt.patch;\n return {\n ...opt,\n ...(patch ? {\n patch\n } : {}),\n ...(config ? {\n config\n } : {})\n };\n }\n function getRoot(el) {\n const possibleRoot = el.getRootNode ? el.getRootNode() : document;\n return possibleRoot instanceof ShadowRoot ? {\n root: possibleRoot,\n rootContainer: possibleRoot\n } : {\n root: document,\n rootContainer: document.head ?? document.body\n };\n }\n async function _embed(el, spec, opts = {}, loader) {\n const config = opts.theme ? vegaImport.mergeConfig(themes[opts.theme], opts.config ?? {}) : opts.config;\n const actions = vegaImport.isBoolean(opts.actions) ? opts.actions : mergeDeep({}, DEFAULT_ACTIONS, opts.actions ?? {});\n const i18n = {\n ...I18N,\n ...opts.i18n\n };\n const renderer = opts.renderer ?? 'canvas';\n const logLevel = opts.logLevel ?? vega.Warn;\n const downloadFileName = opts.downloadFileName ?? 'visualization';\n const element = typeof el === 'string' ? document.querySelector(el) : el;\n if (!element) {\n throw new Error(`${el} does not exist`);\n }\n if (opts.defaultStyle !== false) {\n const ID = 'vega-embed-style';\n const {\n root,\n rootContainer\n } = getRoot(element);\n if (!root.getElementById(ID)) {\n const style = document.createElement('style');\n style.id = ID;\n style.innerHTML = opts.defaultStyle === undefined || opts.defaultStyle === true ? (embedStyle ).toString() : opts.defaultStyle;\n rootContainer.appendChild(style);\n }\n }\n const mode = guessMode(spec, opts.mode);\n let vgSpec = PREPROCESSOR[mode](spec, config);\n if (mode === 'vega-lite') {\n if (vgSpec.$schema) {\n const parsed = e(vgSpec.$schema);\n if (!satisfies$1(VERSION.vega, `^${parsed.version.slice(1)}`)) {\n console.warn(`The compiled spec uses Vega ${parsed.version}, but current version is v${VERSION.vega}.`);\n }\n }\n }\n element.classList.add('vega-embed');\n if (actions) {\n element.classList.add('has-actions');\n }\n element.innerHTML = ''; // clear container\n\n let container = element;\n if (actions) {\n const chartWrapper = document.createElement('div');\n chartWrapper.classList.add(CHART_WRAPPER_CLASS);\n element.appendChild(chartWrapper);\n container = chartWrapper;\n }\n const patch = opts.patch;\n if (patch) {\n vgSpec = patch instanceof Function ? patch(vgSpec) : applyPatch(vgSpec, patch, true, false).newDocument;\n }\n\n // Set locale. Note that this is a global setting.\n if (opts.formatLocale) {\n vega.formatLocale(opts.formatLocale);\n }\n if (opts.timeFormatLocale) {\n vega.timeFormatLocale(opts.timeFormatLocale);\n }\n\n // Set custom expression functions\n if (opts.expressionFunctions) {\n for (const name in opts.expressionFunctions) {\n const expressionFunction = opts.expressionFunctions[name];\n if ('fn' in expressionFunction) {\n vega.expressionFunction(name, expressionFunction.fn, expressionFunction['visitor']);\n } else if (expressionFunction instanceof Function) {\n vega.expressionFunction(name, expressionFunction);\n }\n }\n }\n const {\n ast\n } = opts;\n\n // Do not apply the config to Vega when we have already applied it to Vega-Lite.\n // This call may throw an Error if parsing fails.\n const runtime = vega.parse(vgSpec, mode === 'vega-lite' ? {} : config, {\n ast\n });\n const view = new (opts.viewClass || vega.View)(runtime, {\n loader,\n logLevel,\n renderer,\n ...(ast ? {\n expr: vega.expressionInterpreter ?? opts.expr ?? expression\n } : {})\n });\n view.addSignalListener('autosize', (_, autosize) => {\n const {\n type\n } = autosize;\n if (type == 'fit-x') {\n container.classList.add('fit-x');\n container.classList.remove('fit-y');\n } else if (type == 'fit-y') {\n container.classList.remove('fit-x');\n container.classList.add('fit-y');\n } else if (type == 'fit') {\n container.classList.add('fit-x', 'fit-y');\n } else {\n container.classList.remove('fit-x', 'fit-y');\n }\n });\n if (opts.tooltip !== false) {\n const {\n loader: loader_,\n tooltip\n } = opts;\n const baseURL = loader_ && !isLoader(loader_) ? loader_?.baseURL : undefined;\n const handler = isTooltipHandler(tooltip) ? tooltip :\n // user provided boolean true or tooltip options\n new Handler({\n baseURL,\n ...(tooltip === true ? {} : tooltip)\n }).call;\n view.tooltip(handler);\n }\n let {\n hover\n } = opts;\n if (hover === undefined) {\n hover = mode === 'vega';\n }\n if (hover) {\n const {\n hoverSet,\n updateSet\n } = typeof hover === 'boolean' ? {} : hover;\n view.hover(hoverSet, updateSet);\n }\n if (opts) {\n if (opts.width != null) {\n view.width(opts.width);\n }\n if (opts.height != null) {\n view.height(opts.height);\n }\n if (opts.padding != null) {\n view.padding(opts.padding);\n }\n }\n await view.initialize(container, opts.bind).runAsync();\n let documentClickHandler;\n if (actions !== false) {\n let wrapper = element;\n if (opts.defaultStyle !== false || opts.forceActionsMenu) {\n const details = document.createElement('details');\n details.title = i18n.CLICK_TO_VIEW_ACTIONS;\n element.append(details);\n wrapper = details;\n const summary = document.createElement('summary');\n summary.innerHTML = SVG_CIRCLES;\n details.append(summary);\n documentClickHandler = ev => {\n if (!details.contains(ev.target)) {\n details.removeAttribute('open');\n }\n };\n document.addEventListener('click', documentClickHandler);\n }\n const ctrl = document.createElement('div');\n wrapper.append(ctrl);\n ctrl.classList.add('vega-actions');\n\n // add 'Export' action\n if (actions === true || actions.export !== false) {\n for (const ext of ['svg', 'png']) {\n if (actions === true || actions.export === true || actions.export[ext]) {\n const i18nExportAction = i18n[`${ext.toUpperCase()}_ACTION`];\n const exportLink = document.createElement('a');\n const scaleFactor = vegaImport.isObject(opts.scaleFactor) ? opts.scaleFactor[ext] : opts.scaleFactor;\n exportLink.text = i18nExportAction;\n exportLink.href = '#';\n exportLink.target = '_blank';\n exportLink.download = `${downloadFileName}.${ext}`;\n // add link on mousedown so that it's correct when the click happens\n exportLink.addEventListener('mousedown', async function (e) {\n e.preventDefault();\n const url = await view.toImageURL(ext, scaleFactor);\n this.href = url;\n });\n ctrl.append(exportLink);\n }\n }\n }\n\n // add 'View Source' action\n if (actions === true || actions.source !== false) {\n const viewSourceLink = document.createElement('a');\n viewSourceLink.text = i18n.SOURCE_ACTION;\n viewSourceLink.href = '#';\n viewSourceLink.addEventListener('click', function (e) {\n viewSource(stringify$1(spec), opts.sourceHeader ?? '', opts.sourceFooter ?? '', mode);\n e.preventDefault();\n });\n ctrl.append(viewSourceLink);\n }\n\n // add 'View Compiled' action\n if (mode === 'vega-lite' && (actions === true || actions.compiled !== false)) {\n const compileLink = document.createElement('a');\n compileLink.text = i18n.COMPILED_ACTION;\n compileLink.href = '#';\n compileLink.addEventListener('click', function (e) {\n viewSource(stringify$1(vgSpec), opts.sourceHeader ?? '', opts.sourceFooter ?? '', 'vega');\n e.preventDefault();\n });\n ctrl.append(compileLink);\n }\n\n // add 'Open in Vega Editor' action\n if (actions === true || actions.editor !== false) {\n const editorUrl = opts.editorUrl ?? 'https://vega.github.io/editor/';\n const editorLink = document.createElement('a');\n editorLink.text = i18n.EDITOR_ACTION;\n editorLink.href = '#';\n editorLink.addEventListener('click', function (e) {\n post(window, editorUrl, {\n config: config,\n mode: patch ? 'vega' : mode,\n renderer,\n spec: stringify$1(patch ? vgSpec : spec)\n });\n e.preventDefault();\n });\n ctrl.append(editorLink);\n }\n }\n function finalize() {\n if (documentClickHandler) {\n document.removeEventListener('click', documentClickHandler);\n }\n view.finalize();\n }\n return {\n view,\n spec,\n vgSpec,\n finalize,\n embedOptions: opts\n };\n }\n\n /**\n * Create a promise to an HTML Div element with an embedded Vega-Lite or Vega visualization.\n * The element has a value property with the view. By default all actions except for the editor action are disabled.\n *\n * The main use case is in [Observable](https://observablehq.com/).\n */\n async function container (spec, opt = {}) {\n const wrapper = document.createElement('div');\n wrapper.classList.add('vega-embed-wrapper');\n const div = document.createElement('div');\n wrapper.appendChild(div);\n const actions = opt.actions === true || opt.actions === false ? opt.actions : {\n export: true,\n source: false,\n compiled: true,\n editor: true,\n ...opt.actions\n };\n const result = await embed(div, spec, {\n actions,\n ...opt\n });\n wrapper.value = result.view;\n return wrapper;\n }\n\n /**\n * Returns true if the object is an HTML element.\n */\n function isElement(obj) {\n return obj instanceof HTMLElement;\n }\n const wrapper = (...args) => {\n if (args.length > 1 && (vegaImport.isString(args[0]) && !isURL(args[0]) || isElement(args[0]) || args.length === 3)) {\n return embed(args[0], args[1], args[2]);\n }\n return container(args[0], args[1]);\n };\n wrapper.vegaLite = vegaLite;\n wrapper.vl = vegaLite; // backwards compatibility\n wrapper.container = container;\n wrapper.embed = embed;\n wrapper.vega = vega;\n wrapper.default = embed;\n wrapper.version = version;\n\n return wrapper;\n\n}));\n//# sourceMappingURL=vega-embed.js.map\n","function accessor (fn, fields, name) {\n fn.fields = fields || [];\n fn.fname = name;\n return fn;\n}\nfunction accessorName(fn) {\n return fn == null ? null : fn.fname;\n}\nfunction accessorFields(fn) {\n return fn == null ? null : fn.fields;\n}\n\nfunction getter (path) {\n return path.length === 1 ? get1(path[0]) : getN(path);\n}\n\nconst get1 = field => function (obj) {\n return obj[field];\n};\n\nconst getN = path => {\n const len = path.length;\n return function (obj) {\n for (let i = 0; i < len; ++i) {\n obj = obj[path[i]];\n }\n\n return obj;\n };\n};\n\nfunction error (message) {\n throw Error(message);\n}\n\nfunction splitAccessPath (p) {\n const path = [],\n n = p.length;\n let q = null,\n b = 0,\n s = '',\n i,\n j,\n c;\n p = p + '';\n\n function push() {\n path.push(s + p.substring(i, j));\n s = '';\n i = j + 1;\n }\n\n for (i = j = 0; j < n; ++j) {\n c = p[j];\n\n if (c === '\\\\') {\n s += p.substring(i, j);\n s += p.substring(++j, ++j);\n i = j;\n } else if (c === q) {\n push();\n q = null;\n b = -1;\n } else if (q) {\n continue;\n } else if (i === b && c === '\"') {\n i = j + 1;\n q = c;\n } else if (i === b && c === \"'\") {\n i = j + 1;\n q = c;\n } else if (c === '.' && !b) {\n if (j > i) {\n push();\n } else {\n i = j + 1;\n }\n } else if (c === '[') {\n if (j > i) push();\n b = i = j + 1;\n } else if (c === ']') {\n if (!b) error('Access path missing open bracket: ' + p);\n if (b > 0) push();\n b = 0;\n i = j + 1;\n }\n }\n\n if (b) error('Access path missing closing bracket: ' + p);\n if (q) error('Access path missing closing quote: ' + p);\n\n if (j > i) {\n j++;\n push();\n }\n\n return path;\n}\n\nfunction field (field, name, opt) {\n const path = splitAccessPath(field);\n field = path.length === 1 ? path[0] : field;\n return accessor((opt && opt.get || getter)(path), [field], name || field);\n}\n\nconst id = field('id');\nconst identity = accessor(_ => _, [], 'identity');\nconst zero = accessor(() => 0, [], 'zero');\nconst one = accessor(() => 1, [], 'one');\nconst truthy = accessor(() => true, [], 'true');\nconst falsy = accessor(() => false, [], 'false');\n\nfunction log$1(method, level, input) {\n const args = [level].concat([].slice.call(input));\n console[method].apply(console, args); // eslint-disable-line no-console\n}\n\nconst None = 0;\nconst Error$1 = 1;\nconst Warn = 2;\nconst Info = 3;\nconst Debug = 4;\nfunction logger (_, method) {\n let level = _ || None;\n return {\n level(_) {\n if (arguments.length) {\n level = +_;\n return this;\n } else {\n return level;\n }\n },\n\n error() {\n if (level >= Error$1) log$1(method || 'error', 'ERROR', arguments);\n return this;\n },\n\n warn() {\n if (level >= Warn) log$1(method || 'warn', 'WARN', arguments);\n return this;\n },\n\n info() {\n if (level >= Info) log$1(method || 'log', 'INFO', arguments);\n return this;\n },\n\n debug() {\n if (level >= Debug) log$1(method || 'log', 'DEBUG', arguments);\n return this;\n }\n\n };\n}\n\nvar isArray = Array.isArray;\n\nfunction isObject (_) {\n return _ === Object(_);\n}\n\nconst isLegalKey = key => key !== '__proto__';\n\nfunction mergeConfig(...configs) {\n return configs.reduce((out, source) => {\n for (const key in source) {\n if (key === 'signals') {\n // for signals, we merge the signals arrays\n // source signals take precedence over\n // existing signals with the same name\n out.signals = mergeNamed(out.signals, source.signals);\n } else {\n // otherwise, merge objects subject to recursion constraints\n // for legend block, recurse for the layout entry only\n // for style block, recurse for all properties\n // otherwise, no recursion: objects overwrite, no merging\n const r = key === 'legend' ? {\n layout: 1\n } : key === 'style' ? true : null;\n writeConfig(out, key, source[key], r);\n }\n }\n\n return out;\n }, {});\n}\nfunction writeConfig(output, key, value, recurse) {\n if (!isLegalKey(key)) return;\n let k, o;\n\n if (isObject(value) && !isArray(value)) {\n o = isObject(output[key]) ? output[key] : output[key] = {};\n\n for (k in value) {\n if (recurse && (recurse === true || recurse[k])) {\n writeConfig(o, k, value[k]);\n } else if (isLegalKey(k)) {\n o[k] = value[k];\n }\n }\n } else {\n output[key] = value;\n }\n}\n\nfunction mergeNamed(a, b) {\n if (a == null) return b;\n const map = {},\n out = [];\n\n function add(_) {\n if (!map[_.name]) {\n map[_.name] = 1;\n out.push(_);\n }\n }\n\n b.forEach(add);\n a.forEach(add);\n return out;\n}\n\nfunction peek (array) {\n return array[array.length - 1];\n}\n\nfunction toNumber (_) {\n return _ == null || _ === '' ? null : +_;\n}\n\nconst exp = sign => x => sign * Math.exp(x);\n\nconst log = sign => x => Math.log(sign * x);\n\nconst symlog = c => x => Math.sign(x) * Math.log1p(Math.abs(x / c));\n\nconst symexp = c => x => Math.sign(x) * Math.expm1(Math.abs(x)) * c;\n\nconst pow = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n\nfunction pan(domain, delta, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n dd = (d1 - d0) * delta;\n return [ground(d0 - dd), ground(d1 - dd)];\n}\n\nfunction panLinear(domain, delta) {\n return pan(domain, delta, toNumber, identity);\n}\nfunction panLog(domain, delta) {\n var sign = Math.sign(domain[0]);\n return pan(domain, delta, log(sign), exp(sign));\n}\nfunction panPow(domain, delta, exponent) {\n return pan(domain, delta, pow(exponent), pow(1 / exponent));\n}\nfunction panSymlog(domain, delta, constant) {\n return pan(domain, delta, symlog(constant), symexp(constant));\n}\n\nfunction zoom(domain, anchor, scale, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n da = anchor != null ? lift(anchor) : (d0 + d1) / 2;\n return [ground(da + (d0 - da) * scale), ground(da + (d1 - da) * scale)];\n}\n\nfunction zoomLinear(domain, anchor, scale) {\n return zoom(domain, anchor, scale, toNumber, identity);\n}\nfunction zoomLog(domain, anchor, scale) {\n const sign = Math.sign(domain[0]);\n return zoom(domain, anchor, scale, log(sign), exp(sign));\n}\nfunction zoomPow(domain, anchor, scale, exponent) {\n return zoom(domain, anchor, scale, pow(exponent), pow(1 / exponent));\n}\nfunction zoomSymlog(domain, anchor, scale, constant) {\n return zoom(domain, anchor, scale, symlog(constant), symexp(constant));\n}\n\nfunction quarter(date) {\n return 1 + ~~(new Date(date).getMonth() / 3);\n}\nfunction utcquarter(date) {\n return 1 + ~~(new Date(date).getUTCMonth() / 3);\n}\n\nfunction array (_) {\n return _ != null ? isArray(_) ? _ : [_] : [];\n}\n\n/**\n * Span-preserving range clamp. If the span of the input range is less\n * than (max - min) and an endpoint exceeds either the min or max value,\n * the range is translated such that the span is preserved and one\n * endpoint touches the boundary of the min/max range.\n * If the span exceeds (max - min), the range [min, max] is returned.\n */\nfunction clampRange (range, min, max) {\n let lo = range[0],\n hi = range[1],\n span;\n\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n\n span = hi - lo;\n return span >= max - min ? [min, max] : [lo = Math.min(Math.max(lo, min), max - span), lo + span];\n}\n\nfunction isFunction (_) {\n return typeof _ === 'function';\n}\n\nconst DESCENDING = 'descending';\nfunction compare (fields, orders, opt) {\n opt = opt || {};\n orders = array(orders) || [];\n const ord = [],\n get = [],\n fmap = {},\n gen = opt.comparator || comparator;\n array(fields).forEach((f, i) => {\n if (f == null) return;\n ord.push(orders[i] === DESCENDING ? -1 : 1);\n get.push(f = isFunction(f) ? f : field(f, null, opt));\n (accessorFields(f) || []).forEach(_ => fmap[_] = 1);\n });\n return get.length === 0 ? null : accessor(gen(get, ord), Object.keys(fmap));\n}\nconst ascending = (u, v) => (u < v || u == null) && v != null ? -1 : (u > v || v == null) && u != null ? 1 : (v = v instanceof Date ? +v : v, u = u instanceof Date ? +u : u) !== u && v === v ? -1 : v !== v && u === u ? 1 : 0;\n\nconst comparator = (fields, orders) => fields.length === 1 ? compare1(fields[0], orders[0]) : compareN(fields, orders, fields.length);\n\nconst compare1 = (field, order) => function (a, b) {\n return ascending(field(a), field(b)) * order;\n};\n\nconst compareN = (fields, orders, n) => {\n orders.push(0); // pad zero for convenient lookup\n\n return function (a, b) {\n let f,\n c = 0,\n i = -1;\n\n while (c === 0 && ++i < n) {\n f = fields[i];\n c = ascending(f(a), f(b));\n }\n\n return c * orders[i];\n };\n};\n\nfunction constant (_) {\n return isFunction(_) ? _ : () => _;\n}\n\nfunction debounce (delay, handler) {\n let tid;\n return e => {\n if (tid) clearTimeout(tid);\n tid = setTimeout(() => (handler(e), tid = null), delay);\n };\n}\n\nfunction extend (_) {\n for (let x, k, i = 1, len = arguments.length; i < len; ++i) {\n x = arguments[i];\n\n for (k in x) {\n _[k] = x[k];\n }\n }\n\n return _;\n}\n\n/**\n * Return an array with minimum and maximum values, in the\n * form [min, max]. Ignores null, undefined, and NaN values.\n */\nfunction extent (array, f) {\n let i = 0,\n n,\n v,\n min,\n max;\n\n if (array && (n = array.length)) {\n if (f == null) {\n // find first valid value\n for (v = array[i]; i < n && (v == null || v !== v); v = array[++i]);\n\n min = max = v; // visit all other values\n\n for (; i < n; ++i) {\n v = array[i]; // skip null/undefined; NaN will fail all comparisons\n\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n } else {\n // find first valid value\n for (v = f(array[i]); i < n && (v == null || v !== v); v = f(array[++i]));\n\n min = max = v; // visit all other values\n\n for (; i < n; ++i) {\n v = f(array[i]); // skip null/undefined; NaN will fail all comparisons\n\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n }\n }\n\n return [min, max];\n}\n\nfunction extentIndex (array, f) {\n const n = array.length;\n let i = -1,\n a,\n b,\n c,\n u,\n v;\n\n if (f == null) {\n while (++i < n) {\n b = array[i];\n\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n\n if (i === n) return [-1, -1];\n u = v = i;\n\n while (++i < n) {\n b = array[i];\n\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n } else {\n while (++i < n) {\n b = f(array[i], i, array);\n\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n\n if (i === n) return [-1, -1];\n u = v = i;\n\n while (++i < n) {\n b = f(array[i], i, array);\n\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n }\n\n return [u, v];\n}\n\nconst hop = Object.prototype.hasOwnProperty;\nfunction has (object, property) {\n return hop.call(object, property);\n}\n\nconst NULL = {};\nfunction fastmap (input) {\n let obj = {},\n test;\n\n function has$1(key) {\n return has(obj, key) && obj[key] !== NULL;\n }\n\n const map = {\n size: 0,\n empty: 0,\n object: obj,\n has: has$1,\n\n get(key) {\n return has$1(key) ? obj[key] : undefined;\n },\n\n set(key, value) {\n if (!has$1(key)) {\n ++map.size;\n if (obj[key] === NULL) --map.empty;\n }\n\n obj[key] = value;\n return this;\n },\n\n delete(key) {\n if (has$1(key)) {\n --map.size;\n ++map.empty;\n obj[key] = NULL;\n }\n\n return this;\n },\n\n clear() {\n map.size = map.empty = 0;\n map.object = obj = {};\n },\n\n test(_) {\n if (arguments.length) {\n test = _;\n return map;\n } else {\n return test;\n }\n },\n\n clean() {\n const next = {};\n let size = 0;\n\n for (const key in obj) {\n const value = obj[key];\n\n if (value !== NULL && (!test || !test(value))) {\n next[key] = value;\n ++size;\n }\n }\n\n map.size = size;\n map.empty = 0;\n map.object = obj = next;\n }\n\n };\n if (input) Object.keys(input).forEach(key => {\n map.set(key, input[key]);\n });\n return map;\n}\n\nfunction flush (range, value, threshold, left, right, center) {\n if (!threshold && threshold !== 0) return center;\n const t = +threshold;\n let a = range[0],\n b = peek(range),\n l; // swap endpoints if range is reversed\n\n if (b < a) {\n l = a;\n a = b;\n b = l;\n } // compare value to endpoints\n\n\n l = Math.abs(value - a);\n const r = Math.abs(b - value); // adjust if value is within threshold distance of endpoint\n\n return l < r && l <= t ? left : r <= t ? right : center;\n}\n\nfunction inherits (child, parent, members) {\n const proto = child.prototype = Object.create(parent.prototype);\n Object.defineProperty(proto, 'constructor', {\n value: child,\n writable: true,\n enumerable: true,\n configurable: true\n });\n return extend(proto, members);\n}\n\n/**\n * Predicate that returns true if the value lies within the span\n * of the given range. The left and right flags control the use\n * of inclusive (true) or exclusive (false) comparisons.\n */\nfunction inrange (value, range, left, right) {\n let r0 = range[0],\n r1 = range[range.length - 1],\n t;\n\n if (r0 > r1) {\n t = r0;\n r0 = r1;\n r1 = t;\n }\n\n left = left === undefined || left;\n right = right === undefined || right;\n return (left ? r0 <= value : r0 < value) && (right ? value <= r1 : value < r1);\n}\n\nfunction isBoolean (_) {\n return typeof _ === 'boolean';\n}\n\nfunction isDate (_) {\n return Object.prototype.toString.call(_) === '[object Date]';\n}\n\nfunction isIterable (_) {\n return _ && isFunction(_[Symbol.iterator]);\n}\n\nfunction isNumber (_) {\n return typeof _ === 'number';\n}\n\nfunction isRegExp (_) {\n return Object.prototype.toString.call(_) === '[object RegExp]';\n}\n\nfunction isString (_) {\n return typeof _ === 'string';\n}\n\nfunction key (fields, flat, opt) {\n if (fields) {\n fields = flat ? array(fields).map(f => f.replace(/\\\\(.)/g, '$1')) : array(fields);\n }\n\n const len = fields && fields.length,\n gen = opt && opt.get || getter,\n map = f => gen(flat ? [f] : splitAccessPath(f));\n\n let fn;\n\n if (!len) {\n fn = function () {\n return '';\n };\n } else if (len === 1) {\n const get = map(fields[0]);\n\n fn = function (_) {\n return '' + get(_);\n };\n } else {\n const get = fields.map(map);\n\n fn = function (_) {\n let s = '' + get[0](_),\n i = 0;\n\n while (++i < len) s += '|' + get[i](_);\n\n return s;\n };\n }\n\n return accessor(fn, fields, 'key');\n}\n\nfunction lerp (array, frac) {\n const lo = array[0],\n hi = peek(array),\n f = +frac;\n return !f ? lo : f === 1 ? hi : lo + f * (hi - lo);\n}\n\nconst DEFAULT_MAX_SIZE = 10000; // adapted from https://github.com/dominictarr/hashlru/ (MIT License)\n\nfunction lruCache (maxsize) {\n maxsize = +maxsize || DEFAULT_MAX_SIZE;\n let curr, prev, size;\n\n const clear = () => {\n curr = {};\n prev = {};\n size = 0;\n };\n\n const update = (key, value) => {\n if (++size > maxsize) {\n prev = curr;\n curr = {};\n size = 1;\n }\n\n return curr[key] = value;\n };\n\n clear();\n return {\n clear,\n has: key => has(curr, key) || has(prev, key),\n get: key => has(curr, key) ? curr[key] : has(prev, key) ? update(key, prev[key]) : undefined,\n set: (key, value) => has(curr, key) ? curr[key] = value : update(key, value)\n };\n}\n\nfunction merge (compare, array0, array1, output) {\n const n0 = array0.length,\n n1 = array1.length;\n if (!n1) return array0;\n if (!n0) return array1;\n const merged = output || new array0.constructor(n0 + n1);\n let i0 = 0,\n i1 = 0,\n i = 0;\n\n for (; i0 < n0 && i1 < n1; ++i) {\n merged[i] = compare(array0[i0], array1[i1]) > 0 ? array1[i1++] : array0[i0++];\n }\n\n for (; i0 < n0; ++i0, ++i) {\n merged[i] = array0[i0];\n }\n\n for (; i1 < n1; ++i1, ++i) {\n merged[i] = array1[i1];\n }\n\n return merged;\n}\n\nfunction repeat (str, reps) {\n let s = '';\n\n while (--reps >= 0) s += str;\n\n return s;\n}\n\nfunction pad (str, length, padchar, align) {\n const c = padchar || ' ',\n s = str + '',\n n = length - s.length;\n return n <= 0 ? s : align === 'left' ? repeat(c, n) + s : align === 'center' ? repeat(c, ~~(n / 2)) + s + repeat(c, Math.ceil(n / 2)) : s + repeat(c, n);\n}\n\n/**\n * Return the numerical span of an array: the difference between\n * the last and first values.\n */\n\nfunction span (array) {\n return array && peek(array) - array[0] || 0;\n}\n\nfunction $(x) {\n return isArray(x) ? '[' + x.map($) + ']' : isObject(x) || isString(x) ? // Output valid JSON and JS source strings.\n // See http://timelessrepo.com/json-isnt-a-javascript-subset\n JSON.stringify(x).replace('\\u2028', '\\\\u2028').replace('\\u2029', '\\\\u2029') : x;\n}\n\nfunction toBoolean (_) {\n return _ == null || _ === '' ? null : !_ || _ === 'false' || _ === '0' ? false : !!_;\n}\n\nconst defaultParser = _ => isNumber(_) ? _ : isDate(_) ? _ : Date.parse(_);\n\nfunction toDate (_, parser) {\n parser = parser || defaultParser;\n return _ == null || _ === '' ? null : parser(_);\n}\n\nfunction toString (_) {\n return _ == null || _ === '' ? null : _ + '';\n}\n\nfunction toSet (_) {\n const s = {},\n n = _.length;\n\n for (let i = 0; i < n; ++i) s[_[i]] = true;\n\n return s;\n}\n\nfunction truncate (str, length, align, ellipsis) {\n const e = ellipsis != null ? ellipsis : '\\u2026',\n s = str + '',\n n = s.length,\n l = Math.max(0, length - e.length);\n return n <= length ? s : align === 'left' ? e + s.slice(n - l) : align === 'center' ? s.slice(0, Math.ceil(l / 2)) + e + s.slice(n - ~~(l / 2)) : s.slice(0, l) + e;\n}\n\nfunction visitArray (array, filter, visitor) {\n if (array) {\n if (filter) {\n const n = array.length;\n\n for (let i = 0; i < n; ++i) {\n const t = filter(array[i]);\n if (t) visitor(t, i, array);\n }\n } else {\n array.forEach(visitor);\n }\n }\n}\n\nexport { Debug, Error$1 as Error, Info, None, Warn, accessor, accessorFields, accessorName, array, ascending, clampRange, compare, constant, debounce, error, extend, extent, extentIndex, falsy, fastmap, field, flush, has as hasOwnProperty, id, identity, inherits, inrange, isArray, isBoolean, isDate, isFunction, isIterable, isNumber, isObject, isRegExp, isString, key, lerp, logger, lruCache, merge, mergeConfig, one, pad, panLinear, panLog, panPow, panSymlog, peek, quarter, repeat, span, splitAccessPath, $ as stringValue, toBoolean, toDate, toNumber, toSet, toString, truncate, truthy, utcquarter, visitArray, writeConfig, zero, zoomLinear, zoomLog, zoomPow, zoomSymlog };\n","Array.prototype.flat||Object.defineProperty(Array.prototype,\"flat\",{configurable:!0,value:function r(){var t=isNaN(arguments[0])?1:Number(arguments[0]);return t?Array.prototype.reduce.call(this,function(a,e){return Array.isArray(e)?a.push.apply(a,r.call(e,t-1)):a.push(e),a},[]):Array.prototype.slice.call(this)},writable:!0}),Array.prototype.flatMap||Object.defineProperty(Array.prototype,\"flatMap\",{configurable:!0,value:function(r){return Array.prototype.map.apply(this,arguments).flat()},writable:!0})\n","export function isLogicalOr(op) {\n return !!op.or;\n}\nexport function isLogicalAnd(op) {\n return !!op.and;\n}\nexport function isLogicalNot(op) {\n return !!op.not;\n}\nexport function forEachLeaf(op, fn) {\n if (isLogicalNot(op)) {\n forEachLeaf(op.not, fn);\n }\n else if (isLogicalAnd(op)) {\n for (const subop of op.and) {\n forEachLeaf(subop, fn);\n }\n }\n else if (isLogicalOr(op)) {\n for (const subop of op.or) {\n forEachLeaf(subop, fn);\n }\n }\n else {\n fn(op);\n }\n}\nexport function normalizeLogicalComposition(op, normalizer) {\n if (isLogicalNot(op)) {\n return { not: normalizeLogicalComposition(op.not, normalizer) };\n }\n else if (isLogicalAnd(op)) {\n return { and: op.and.map(o => normalizeLogicalComposition(o, normalizer)) };\n }\n else if (isLogicalOr(op)) {\n return { or: op.or.map(o => normalizeLogicalComposition(o, normalizer)) };\n }\n else {\n return normalizer(op);\n }\n}\n//# sourceMappingURL=logical.js.map","import 'array-flat-polyfill';\nimport { default as clone_ } from 'clone';\nimport deepEqual_ from 'fast-deep-equal';\nimport stableStringify from 'fast-json-stable-stringify';\nimport { hasOwnProperty, isNumber, isString, splitAccessPath, stringValue, writeConfig } from 'vega-util';\nimport { isLogicalAnd, isLogicalNot, isLogicalOr } from './logical';\nexport const deepEqual = deepEqual_;\nexport const duplicate = clone_;\n/**\n * Creates an object composed of the picked object properties.\n *\n * var object = {'a': 1, 'b': '2', 'c': 3};\n * pick(object, ['a', 'c']);\n * // → {'a': 1, 'c': 3}\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function pick(obj, props) {\n const copy = {};\n for (const prop of props) {\n if (hasOwnProperty(obj, prop)) {\n copy[prop] = obj[prop];\n }\n }\n return copy;\n}\n/**\n * The opposite of _.pick; this method creates an object composed of the own\n * and inherited enumerable string keyed properties of object that are not omitted.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function omit(obj, props) {\n const copy = Object.assign({}, obj);\n for (const prop of props) {\n delete copy[prop];\n }\n return copy;\n}\n/**\n * Monkey patch Set so that `stringify` produces a string representation of sets.\n */\nSet.prototype['toJSON'] = function () {\n return `Set(${[...this].map(x => stableStringify(x)).join(',')})`;\n};\n/**\n * Converts any object to a string representation that can be consumed by humans.\n */\nexport const stringify = stableStringify;\n/**\n * Converts any object to a string of limited size, or a number.\n */\nexport function hash(a) {\n if (isNumber(a)) {\n return a;\n }\n const str = isString(a) ? a : stableStringify(a);\n // short strings can be used as hash directly, longer strings are hashed to reduce memory usage\n if (str.length < 250) {\n return str;\n }\n // from http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/\n let h = 0;\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i);\n h = (h << 5) - h + char;\n h = h & h; // Convert to 32bit integer\n }\n return h;\n}\nexport function isNullOrFalse(x) {\n return x === false || x === null;\n}\nexport function contains(array, item) {\n return array.indexOf(item) > -1;\n}\n/**\n * Returns true if any item returns true.\n */\nexport function some(arr, f) {\n let i = 0;\n for (const [k, a] of arr.entries()) {\n if (f(a, k, i++)) {\n return true;\n }\n }\n return false;\n}\n/**\n * Returns true if all items return true.\n */\nexport function every(arr, f) {\n let i = 0;\n for (const [k, a] of arr.entries()) {\n if (!f(a, k, i++)) {\n return false;\n }\n }\n return true;\n}\n/**\n * recursively merges src into dest\n */\nexport function mergeDeep(dest, ...src) {\n for (const s of src) {\n deepMerge_(dest, s !== null && s !== void 0 ? s : {});\n }\n return dest;\n}\nfunction deepMerge_(dest, src) {\n for (const property of keys(src)) {\n writeConfig(dest, property, src[property], true);\n }\n}\nexport function unique(values, f) {\n const results = [];\n const u = {};\n let v;\n for (const val of values) {\n v = f(val);\n if (v in u) {\n continue;\n }\n u[v] = 1;\n results.push(val);\n }\n return results;\n}\n/**\n * Returns true if the two dictionaries disagree. Applies only to defined values.\n */\nexport function isEqual(dict, other) {\n const dictKeys = keys(dict);\n const otherKeys = keys(other);\n if (dictKeys.length !== otherKeys.length) {\n return false;\n }\n for (const key of dictKeys) {\n if (dict[key] !== other[key]) {\n return false;\n }\n }\n return true;\n}\nexport function setEqual(a, b) {\n if (a.size !== b.size) {\n return false;\n }\n for (const e of a) {\n if (!b.has(e)) {\n return false;\n }\n }\n return true;\n}\nexport function hasIntersection(a, b) {\n for (const key of a) {\n if (b.has(key)) {\n return true;\n }\n }\n return false;\n}\nexport function prefixGenerator(a) {\n const prefixes = new Set();\n for (const x of a) {\n const splitField = splitAccessPath(x);\n // Wrap every element other than the first in `[]`\n const wrappedWithAccessors = splitField.map((y, i) => (i === 0 ? y : `[${y}]`));\n const computedPrefixes = wrappedWithAccessors.map((_, i) => wrappedWithAccessors.slice(0, i + 1).join(''));\n for (const y of computedPrefixes) {\n prefixes.add(y);\n }\n }\n return prefixes;\n}\n/**\n * Returns true if a and b have an intersection. Also return true if a or b are undefined\n * since this means we don't know what fields a node produces or depends on.\n */\nexport function fieldIntersection(a, b) {\n if (a === undefined || b === undefined) {\n return true;\n }\n return hasIntersection(prefixGenerator(a), prefixGenerator(b));\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function isEmpty(obj) {\n return keys(obj).length === 0;\n}\n// This is a stricter version of Object.keys but with better types. See https://github.com/Microsoft/TypeScript/pull/12253#issuecomment-263132208\nexport const keys = Object.keys;\nexport const vals = Object.values;\nexport const entries = Object.entries;\nexport function isBoolean(b) {\n return b === true || b === false;\n}\n/**\n * Convert a string into a valid variable name\n */\nexport function varName(s) {\n // Replace non-alphanumeric characters (anything besides a-zA-Z0-9_) with _\n const alphanumericS = s.replace(/\\W/g, '_');\n // Add _ if the string has leading numbers.\n return (s.match(/^\\d+/) ? '_' : '') + alphanumericS;\n}\nexport function logicalExpr(op, cb) {\n if (isLogicalNot(op)) {\n return '!(' + logicalExpr(op.not, cb) + ')';\n }\n else if (isLogicalAnd(op)) {\n return '(' + op.and.map((and) => logicalExpr(and, cb)).join(') && (') + ')';\n }\n else if (isLogicalOr(op)) {\n return '(' + op.or.map((or) => logicalExpr(or, cb)).join(') || (') + ')';\n }\n else {\n return cb(op);\n }\n}\n/**\n * Delete nested property of an object, and delete the ancestors of the property if they become empty.\n */\nexport function deleteNestedProperty(obj, orderedProps) {\n if (orderedProps.length === 0) {\n return true;\n }\n const prop = orderedProps.shift(); // eslint-disable-line @typescript-eslint/no-non-null-assertion\n if (prop in obj && deleteNestedProperty(obj[prop], orderedProps)) {\n delete obj[prop];\n }\n return isEmpty(obj);\n}\nexport function titleCase(s) {\n return s.charAt(0).toUpperCase() + s.substr(1);\n}\n/**\n * Converts a path to an access path with datum.\n * @param path The field name.\n * @param datum The string to use for `datum`.\n */\nexport function accessPathWithDatum(path, datum = 'datum') {\n const pieces = splitAccessPath(path);\n const prefixes = [];\n for (let i = 1; i <= pieces.length; i++) {\n const prefix = `[${pieces.slice(0, i).map(stringValue).join('][')}]`;\n prefixes.push(`${datum}${prefix}`);\n }\n return prefixes.join(' && ');\n}\n/**\n * Return access with datum to the flattened field.\n *\n * @param path The field name.\n * @param datum The string to use for `datum`.\n */\nexport function flatAccessWithDatum(path, datum = 'datum') {\n return `${datum}[${stringValue(splitAccessPath(path).join('.'))}]`;\n}\nfunction escapePathAccess(string) {\n return string.replace(/(\\[|\\]|\\.|'|\")/g, '\\\\$1');\n}\n/**\n * Replaces path accesses with access to non-nested field.\n * For example, `foo[\"bar\"].baz` becomes `foo\\\\.bar\\\\.baz`.\n */\nexport function replacePathInField(path) {\n return `${splitAccessPath(path).map(escapePathAccess).join('\\\\.')}`;\n}\n/**\n * Replace all occurrences of a string with another string.\n *\n * @param string the string to replace in\n * @param find the string to replace\n * @param replacement the replacement\n */\nexport function replaceAll(string, find, replacement) {\n return string.replace(new RegExp(find.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'g'), replacement);\n}\n/**\n * Remove path accesses with access from field.\n * For example, `foo[\"bar\"].baz` becomes `foo.bar.baz`.\n */\nexport function removePathFromField(path) {\n return `${splitAccessPath(path).join('.')}`;\n}\n/**\n * Count the depth of the path. Returns 1 for fields that are not nested.\n */\nexport function accessPathDepth(path) {\n if (!path) {\n return 0;\n }\n return splitAccessPath(path).length;\n}\n/**\n * This is a replacement for chained || for numeric properties or properties that respect null so that 0 will be included.\n */\nexport function getFirstDefined(...args) {\n for (const arg of args) {\n if (arg !== undefined) {\n return arg;\n }\n }\n return undefined;\n}\n// variable used to generate id\nlet idCounter = 42;\n/**\n * Returns a new random id every time it gets called.\n *\n * Has side effect!\n */\nexport function uniqueId(prefix) {\n const id = ++idCounter;\n return prefix ? String(prefix) + id : id;\n}\n/**\n * Resets the id counter used in uniqueId. This can be useful for testing.\n */\nexport function resetIdCounter() {\n idCounter = 42;\n}\nexport function internalField(name) {\n return isInternalField(name) ? name : `__${name}`;\n}\nexport function isInternalField(name) {\n return name.indexOf('__') === 0;\n}\n/**\n * Normalize angle to be within [0,360).\n */\nexport function normalizeAngle(angle) {\n if (angle === undefined) {\n return undefined;\n }\n return ((angle % 360) + 360) % 360;\n}\n/**\n * Returns whether the passed in value is a valid number.\n */\nexport function isNumeric(value) {\n if (isNumber(value)) {\n return true;\n }\n return !isNaN(value) && !isNaN(parseFloat(value));\n}\n//# sourceMappingURL=util.js.map","import { keys } from './util';\nexport const CONDITIONAL_AXIS_PROP_INDEX = {\n labelAlign: {\n part: 'labels',\n vgProp: 'align'\n },\n labelBaseline: {\n part: 'labels',\n vgProp: 'baseline'\n },\n labelColor: {\n part: 'labels',\n vgProp: 'fill'\n },\n labelFont: {\n part: 'labels',\n vgProp: 'font'\n },\n labelFontSize: {\n part: 'labels',\n vgProp: 'fontSize'\n },\n labelFontStyle: {\n part: 'labels',\n vgProp: 'fontStyle'\n },\n labelFontWeight: {\n part: 'labels',\n vgProp: 'fontWeight'\n },\n labelOpacity: {\n part: 'labels',\n vgProp: 'opacity'\n },\n labelOffset: null,\n labelPadding: null,\n gridColor: {\n part: 'grid',\n vgProp: 'stroke'\n },\n gridDash: {\n part: 'grid',\n vgProp: 'strokeDash'\n },\n gridDashOffset: {\n part: 'grid',\n vgProp: 'strokeDashOffset'\n },\n gridOpacity: {\n part: 'grid',\n vgProp: 'opacity'\n },\n gridWidth: {\n part: 'grid',\n vgProp: 'strokeWidth'\n },\n tickColor: {\n part: 'ticks',\n vgProp: 'stroke'\n },\n tickDash: {\n part: 'ticks',\n vgProp: 'strokeDash'\n },\n tickDashOffset: {\n part: 'ticks',\n vgProp: 'strokeDashOffset'\n },\n tickOpacity: {\n part: 'ticks',\n vgProp: 'opacity'\n },\n tickSize: null,\n tickWidth: {\n part: 'ticks',\n vgProp: 'strokeWidth'\n }\n};\nexport function isConditionalAxisValue(v) {\n return v && v['condition'];\n}\nexport const AXIS_PARTS = ['domain', 'grid', 'labels', 'ticks', 'title'];\n/**\n * A dictionary listing whether a certain axis property is applicable for only main axes or only grid axes.\n */\nexport const AXIS_PROPERTY_TYPE = {\n grid: 'grid',\n gridCap: 'grid',\n gridColor: 'grid',\n gridDash: 'grid',\n gridDashOffset: 'grid',\n gridOpacity: 'grid',\n gridScale: 'grid',\n gridWidth: 'grid',\n orient: 'main',\n bandPosition: 'both',\n aria: 'main',\n description: 'main',\n domain: 'main',\n domainCap: 'main',\n domainColor: 'main',\n domainDash: 'main',\n domainDashOffset: 'main',\n domainOpacity: 'main',\n domainWidth: 'main',\n format: 'main',\n formatType: 'main',\n labelAlign: 'main',\n labelAngle: 'main',\n labelBaseline: 'main',\n labelBound: 'main',\n labelColor: 'main',\n labelFlush: 'main',\n labelFlushOffset: 'main',\n labelFont: 'main',\n labelFontSize: 'main',\n labelFontStyle: 'main',\n labelFontWeight: 'main',\n labelLimit: 'main',\n labelLineHeight: 'main',\n labelOffset: 'main',\n labelOpacity: 'main',\n labelOverlap: 'main',\n labelPadding: 'main',\n labels: 'main',\n labelSeparation: 'main',\n maxExtent: 'main',\n minExtent: 'main',\n offset: 'both',\n position: 'main',\n tickCap: 'main',\n tickColor: 'main',\n tickDash: 'main',\n tickDashOffset: 'main',\n tickMinStep: 'main',\n tickOffset: 'both',\n tickOpacity: 'main',\n tickRound: 'both',\n ticks: 'main',\n tickSize: 'main',\n tickWidth: 'both',\n title: 'main',\n titleAlign: 'main',\n titleAnchor: 'main',\n titleAngle: 'main',\n titleBaseline: 'main',\n titleColor: 'main',\n titleFont: 'main',\n titleFontSize: 'main',\n titleFontStyle: 'main',\n titleFontWeight: 'main',\n titleLimit: 'main',\n titleLineHeight: 'main',\n titleOpacity: 'main',\n titlePadding: 'main',\n titleX: 'main',\n titleY: 'main',\n encode: 'both',\n scale: 'both',\n tickBand: 'both',\n tickCount: 'both',\n tickExtra: 'both',\n translate: 'both',\n values: 'both',\n zindex: 'both' // this is actually set afterward, so it doesn't matter\n};\nexport const COMMON_AXIS_PROPERTIES_INDEX = {\n orient: 1,\n aria: 1,\n bandPosition: 1,\n description: 1,\n domain: 1,\n domainCap: 1,\n domainColor: 1,\n domainDash: 1,\n domainDashOffset: 1,\n domainOpacity: 1,\n domainWidth: 1,\n format: 1,\n formatType: 1,\n grid: 1,\n gridCap: 1,\n gridColor: 1,\n gridDash: 1,\n gridDashOffset: 1,\n gridOpacity: 1,\n gridWidth: 1,\n labelAlign: 1,\n labelAngle: 1,\n labelBaseline: 1,\n labelBound: 1,\n labelColor: 1,\n labelFlush: 1,\n labelFlushOffset: 1,\n labelFont: 1,\n labelFontSize: 1,\n labelFontStyle: 1,\n labelFontWeight: 1,\n labelLimit: 1,\n labelLineHeight: 1,\n labelOffset: 1,\n labelOpacity: 1,\n labelOverlap: 1,\n labelPadding: 1,\n labels: 1,\n labelSeparation: 1,\n maxExtent: 1,\n minExtent: 1,\n offset: 1,\n position: 1,\n tickBand: 1,\n tickCap: 1,\n tickColor: 1,\n tickCount: 1,\n tickDash: 1,\n tickDashOffset: 1,\n tickExtra: 1,\n tickMinStep: 1,\n tickOffset: 1,\n tickOpacity: 1,\n tickRound: 1,\n ticks: 1,\n tickSize: 1,\n tickWidth: 1,\n title: 1,\n titleAlign: 1,\n titleAnchor: 1,\n titleAngle: 1,\n titleBaseline: 1,\n titleColor: 1,\n titleFont: 1,\n titleFontSize: 1,\n titleFontStyle: 1,\n titleFontWeight: 1,\n titleLimit: 1,\n titleLineHeight: 1,\n titleOpacity: 1,\n titlePadding: 1,\n titleX: 1,\n titleY: 1,\n translate: 1,\n values: 1,\n zindex: 1\n};\nconst AXIS_PROPERTIES_INDEX = Object.assign(Object.assign({}, COMMON_AXIS_PROPERTIES_INDEX), { style: 1, labelExpr: 1, encoding: 1 });\nexport function isAxisProperty(prop) {\n return !!AXIS_PROPERTIES_INDEX[prop];\n}\n// Export for dependent projects\nexport const AXIS_PROPERTIES = keys(AXIS_PROPERTIES_INDEX);\nconst AXIS_CONFIGS_INDEX = {\n axis: 1,\n axisBand: 1,\n axisBottom: 1,\n axisDiscrete: 1,\n axisLeft: 1,\n axisPoint: 1,\n axisQuantitative: 1,\n axisRight: 1,\n axisTemporal: 1,\n axisTop: 1,\n axisX: 1,\n axisXBand: 1,\n axisXDiscrete: 1,\n axisXPoint: 1,\n axisXQuantitative: 1,\n axisXTemporal: 1,\n axisY: 1,\n axisYBand: 1,\n axisYDiscrete: 1,\n axisYPoint: 1,\n axisYQuantitative: 1,\n axisYTemporal: 1\n};\nexport const AXIS_CONFIGS = keys(AXIS_CONFIGS_INDEX);\n//# sourceMappingURL=axis.js.map","import { isString, toSet } from 'vega-util';\nimport { contains, keys } from './util';\nconst AGGREGATE_OP_INDEX = {\n argmax: 1,\n argmin: 1,\n average: 1,\n count: 1,\n distinct: 1,\n product: 1,\n max: 1,\n mean: 1,\n median: 1,\n min: 1,\n missing: 1,\n q1: 1,\n q3: 1,\n ci0: 1,\n ci1: 1,\n stderr: 1,\n stdev: 1,\n stdevp: 1,\n sum: 1,\n valid: 1,\n values: 1,\n variance: 1,\n variancep: 1\n};\nexport const MULTIDOMAIN_SORT_OP_INDEX = {\n count: 1,\n min: 1,\n max: 1\n};\nexport function isArgminDef(a) {\n return !!a && !!a['argmin'];\n}\nexport function isArgmaxDef(a) {\n return !!a && !!a['argmax'];\n}\nexport const AGGREGATE_OPS = keys(AGGREGATE_OP_INDEX);\nexport function isAggregateOp(a) {\n return isString(a) && !!AGGREGATE_OP_INDEX[a];\n}\nexport const COUNTING_OPS = ['count', 'valid', 'missing', 'distinct'];\nexport function isCountingAggregateOp(aggregate) {\n return isString(aggregate) && contains(COUNTING_OPS, aggregate);\n}\nexport function isMinMaxOp(aggregate) {\n return isString(aggregate) && contains(['min', 'max'], aggregate);\n}\n/** Additive-based aggregation operations. These can be applied to stack. */\nexport const SUM_OPS = ['count', 'sum', 'distinct', 'valid', 'missing'];\n/**\n * Aggregation operators that always produce values within the range [domainMin, domainMax].\n */\nexport const SHARED_DOMAIN_OPS = ['mean', 'average', 'median', 'q1', 'q3', 'min', 'max'];\nexport const SHARED_DOMAIN_OP_INDEX = toSet(SHARED_DOMAIN_OPS);\n//# sourceMappingURL=aggregate.js.map","/*\n * Constants and utilities for encoding channels (Visual variables)\n * such as 'x', 'y', 'color'.\n */\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { keys } from './util';\n// Facet\nexport const ROW = 'row';\nexport const COLUMN = 'column';\nexport const FACET = 'facet';\n// Position\nexport const X = 'x';\nexport const Y = 'y';\nexport const X2 = 'x2';\nexport const Y2 = 'y2';\n// Arc-Position\nexport const RADIUS = 'radius';\nexport const RADIUS2 = 'radius2';\nexport const THETA = 'theta';\nexport const THETA2 = 'theta2';\n// Geo Position\nexport const LATITUDE = 'latitude';\nexport const LONGITUDE = 'longitude';\nexport const LATITUDE2 = 'latitude2';\nexport const LONGITUDE2 = 'longitude2';\n// Mark property with scale\nexport const COLOR = 'color';\nexport const FILL = 'fill';\nexport const STROKE = 'stroke';\nexport const SHAPE = 'shape';\nexport const SIZE = 'size';\nexport const ANGLE = 'angle';\nexport const OPACITY = 'opacity';\nexport const FILLOPACITY = 'fillOpacity';\nexport const STROKEOPACITY = 'strokeOpacity';\nexport const STROKEWIDTH = 'strokeWidth';\nexport const STROKEDASH = 'strokeDash';\n// Non-scale channel\nexport const TEXT = 'text';\nexport const ORDER = 'order';\nexport const DETAIL = 'detail';\nexport const KEY = 'key';\nexport const TOOLTIP = 'tooltip';\nexport const HREF = 'href';\nexport const URL = 'url';\nexport const DESCRIPTION = 'description';\nconst POSITION_CHANNEL_INDEX = {\n x: 1,\n y: 1,\n x2: 1,\n y2: 1\n};\nconst POLAR_POSITION_CHANNEL_INDEX = {\n theta: 1,\n theta2: 1,\n radius: 1,\n radius2: 1\n};\nexport function isPolarPositionChannel(c) {\n return c in POLAR_POSITION_CHANNEL_INDEX;\n}\nconst GEO_POSIITON_CHANNEL_INDEX = {\n longitude: 1,\n longitude2: 1,\n latitude: 1,\n latitude2: 1\n};\nexport function getPositionChannelFromLatLong(channel) {\n switch (channel) {\n case LATITUDE:\n return 'y';\n case LATITUDE2:\n return 'y2';\n case LONGITUDE:\n return 'x';\n case LONGITUDE2:\n return 'x2';\n }\n}\nexport function isGeoPositionChannel(c) {\n return c in GEO_POSIITON_CHANNEL_INDEX;\n}\nexport const GEOPOSITION_CHANNELS = keys(GEO_POSIITON_CHANNEL_INDEX);\nconst UNIT_CHANNEL_INDEX = Object.assign(Object.assign(Object.assign(Object.assign({}, POSITION_CHANNEL_INDEX), POLAR_POSITION_CHANNEL_INDEX), GEO_POSIITON_CHANNEL_INDEX), { \n // color\n color: 1, fill: 1, stroke: 1, \n // other non-position with scale\n opacity: 1, fillOpacity: 1, strokeOpacity: 1, strokeWidth: 1, strokeDash: 1, size: 1, angle: 1, shape: 1, \n // channels without scales\n order: 1, text: 1, detail: 1, key: 1, tooltip: 1, href: 1, url: 1, description: 1 });\nexport function isColorChannel(channel) {\n return channel === COLOR || channel === FILL || channel === STROKE;\n}\nconst FACET_CHANNEL_INDEX = {\n row: 1,\n column: 1,\n facet: 1\n};\nexport const FACET_CHANNELS = keys(FACET_CHANNEL_INDEX);\nconst CHANNEL_INDEX = Object.assign(Object.assign({}, UNIT_CHANNEL_INDEX), FACET_CHANNEL_INDEX);\nexport const CHANNELS = keys(CHANNEL_INDEX);\nconst { order: _o, detail: _d, tooltip: _tt1 } = CHANNEL_INDEX, SINGLE_DEF_CHANNEL_INDEX = __rest(CHANNEL_INDEX, [\"order\", \"detail\", \"tooltip\"]);\nconst { row: _r, column: _c, facet: _f } = SINGLE_DEF_CHANNEL_INDEX, SINGLE_DEF_UNIT_CHANNEL_INDEX = __rest(SINGLE_DEF_CHANNEL_INDEX, [\"row\", \"column\", \"facet\"]);\n/**\n * Channels that cannot have an array of channelDef.\n * model.fieldDef, getFieldDef only work for these channels.\n *\n * (The only two channels that can have an array of channelDefs are \"detail\" and \"order\".\n * Since there can be multiple fieldDefs for detail and order, getFieldDef/model.fieldDef\n * are not applicable for them. Similarly, selection projection won't work with \"detail\" and \"order\".)\n */\nexport const SINGLE_DEF_CHANNELS = keys(SINGLE_DEF_CHANNEL_INDEX);\nexport const SINGLE_DEF_UNIT_CHANNELS = keys(SINGLE_DEF_UNIT_CHANNEL_INDEX);\nexport function isSingleDefUnitChannel(str) {\n return !!SINGLE_DEF_UNIT_CHANNEL_INDEX[str];\n}\nexport function isChannel(str) {\n return !!CHANNEL_INDEX[str];\n}\nexport const SECONDARY_RANGE_CHANNEL = [X2, Y2, LATITUDE2, LONGITUDE2, THETA2, RADIUS2];\nexport function isSecondaryRangeChannel(c) {\n const main = getMainRangeChannel(c);\n return main !== c;\n}\n/**\n * Get the main channel for a range channel. E.g. `x` for `x2`.\n */\nexport function getMainRangeChannel(channel) {\n switch (channel) {\n case X2:\n return X;\n case Y2:\n return Y;\n case LATITUDE2:\n return LATITUDE;\n case LONGITUDE2:\n return LONGITUDE;\n case THETA2:\n return THETA;\n case RADIUS2:\n return RADIUS;\n }\n return channel;\n}\nexport function getVgPositionChannel(channel) {\n if (isPolarPositionChannel(channel)) {\n switch (channel) {\n case THETA:\n return 'startAngle';\n case THETA2:\n return 'endAngle';\n case RADIUS:\n return 'outerRadius';\n case RADIUS2:\n return 'innerRadius';\n }\n }\n return channel;\n}\n/**\n * Get the main channel for a range channel. E.g. `x` for `x2`.\n */\nexport function getSecondaryRangeChannel(channel) {\n switch (channel) {\n case X:\n return X2;\n case Y:\n return Y2;\n case LATITUDE:\n return LATITUDE2;\n case LONGITUDE:\n return LONGITUDE2;\n case THETA:\n return THETA2;\n case RADIUS:\n return RADIUS2;\n }\n return undefined;\n}\nexport function getSizeChannel(channel) {\n switch (channel) {\n case X:\n case X2:\n return 'width';\n case Y:\n case Y2:\n return 'height';\n }\n return undefined;\n}\n/**\n * Get the main channel for a range channel. E.g. `x` for `x2`.\n */\nexport function getOffsetChannel(channel) {\n switch (channel) {\n case X:\n return 'xOffset';\n case Y:\n return 'yOffset';\n case X2:\n return 'x2Offset';\n case Y2:\n return 'y2Offset';\n case THETA:\n return 'thetaOffset';\n case RADIUS:\n return 'radiusOffset';\n case THETA2:\n return 'theta2Offset';\n case RADIUS2:\n return 'radius2Offset';\n }\n return undefined;\n}\n// CHANNELS without COLUMN, ROW\nexport const UNIT_CHANNELS = keys(UNIT_CHANNEL_INDEX);\n// NONPOSITION_CHANNELS = UNIT_CHANNELS without X, Y, X2, Y2;\nconst { x: _x, y: _y, \n// x2 and y2 share the same scale as x and y\nx2: _x2, y2: _y2, latitude: _latitude, longitude: _longitude, latitude2: _latitude2, longitude2: _longitude2, theta: _theta, theta2: _theta2, radius: _radius, radius2: _radius2 } = UNIT_CHANNEL_INDEX, \n// The rest of unit channels then have scale\nNONPOSITION_CHANNEL_INDEX = __rest(UNIT_CHANNEL_INDEX, [\"x\", \"y\", \"x2\", \"y2\", \"latitude\", \"longitude\", \"latitude2\", \"longitude2\", \"theta\", \"theta2\", \"radius\", \"radius2\"]);\nexport const NONPOSITION_CHANNELS = keys(NONPOSITION_CHANNEL_INDEX);\nexport const POSITION_SCALE_CHANNEL_INDEX = {\n x: 1,\n y: 1\n};\nexport const POSITION_SCALE_CHANNELS = keys(POSITION_SCALE_CHANNEL_INDEX);\nexport function isXorY(channel) {\n return channel in POSITION_SCALE_CHANNEL_INDEX;\n}\nexport const POLAR_POSITION_SCALE_CHANNEL_INDEX = {\n theta: 1,\n radius: 1\n};\nexport const POLAR_POSITION_SCALE_CHANNELS = keys(POLAR_POSITION_SCALE_CHANNEL_INDEX);\nexport function getPositionScaleChannel(sizeType) {\n return sizeType === 'width' ? X : Y;\n}\n// NON_POSITION_SCALE_CHANNEL = SCALE_CHANNELS without X, Y\nconst { \n// x2 and y2 share the same scale as x and y\n// text and tooltip have format instead of scale,\n// href has neither format, nor scale\ntext: _t, tooltip: _tt, href: _hr, url: _u, description: _al, \n// detail and order have no scale\ndetail: _dd, key: _k, order: _oo } = NONPOSITION_CHANNEL_INDEX, NONPOSITION_SCALE_CHANNEL_INDEX = __rest(NONPOSITION_CHANNEL_INDEX, [\"text\", \"tooltip\", \"href\", \"url\", \"description\", \"detail\", \"key\", \"order\"]);\nexport const NONPOSITION_SCALE_CHANNELS = keys(NONPOSITION_SCALE_CHANNEL_INDEX);\nexport function isNonPositionScaleChannel(channel) {\n return !!NONPOSITION_CHANNEL_INDEX[channel];\n}\n/**\n * @returns whether Vega supports legends for a particular channel\n */\nexport function supportLegend(channel) {\n switch (channel) {\n case COLOR:\n case FILL:\n case STROKE:\n case SIZE:\n case SHAPE:\n case OPACITY:\n case STROKEWIDTH:\n case STROKEDASH:\n return true;\n case FILLOPACITY:\n case STROKEOPACITY:\n case ANGLE:\n return false;\n }\n}\n// Declare SCALE_CHANNEL_INDEX\nconst SCALE_CHANNEL_INDEX = Object.assign(Object.assign(Object.assign({}, POSITION_SCALE_CHANNEL_INDEX), POLAR_POSITION_SCALE_CHANNEL_INDEX), NONPOSITION_SCALE_CHANNEL_INDEX);\n/** List of channels with scales */\nexport const SCALE_CHANNELS = keys(SCALE_CHANNEL_INDEX);\nexport function isScaleChannel(channel) {\n return !!SCALE_CHANNEL_INDEX[channel];\n}\n/**\n * Return whether a channel supports a particular mark type.\n * @param channel channel name\n * @param mark the mark type\n * @return whether the mark supports the channel\n */\nexport function supportMark(channel, mark) {\n return getSupportedMark(channel)[mark];\n}\nconst ALL_MARKS = {\n // all marks\n arc: 'always',\n area: 'always',\n bar: 'always',\n circle: 'always',\n geoshape: 'always',\n image: 'always',\n line: 'always',\n rule: 'always',\n point: 'always',\n rect: 'always',\n square: 'always',\n trail: 'always',\n text: 'always',\n tick: 'always'\n};\nconst { geoshape: _g } = ALL_MARKS, ALL_MARKS_EXCEPT_GEOSHAPE = __rest(ALL_MARKS, [\"geoshape\"]);\n/**\n * Return a dictionary showing whether a channel supports mark type.\n * @param channel\n * @return A dictionary mapping mark types to 'always', 'binned', or undefined\n */\nfunction getSupportedMark(channel) {\n switch (channel) {\n case COLOR:\n case FILL:\n case STROKE:\n // falls through\n case DESCRIPTION:\n case DETAIL:\n case KEY:\n case TOOLTIP:\n case HREF:\n case ORDER: // TODO: revise (order might not support rect, which is not stackable?)\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n case STROKEWIDTH:\n // falls through\n case FACET:\n case ROW: // falls through\n case COLUMN:\n return ALL_MARKS;\n case X:\n case Y:\n case LATITUDE:\n case LONGITUDE:\n // all marks except geoshape. geoshape does not use X, Y -- it uses a projection\n return ALL_MARKS_EXCEPT_GEOSHAPE;\n case X2:\n case Y2:\n case LATITUDE2:\n case LONGITUDE2:\n return {\n area: 'always',\n bar: 'always',\n image: 'always',\n rect: 'always',\n rule: 'always',\n circle: 'binned',\n point: 'binned',\n square: 'binned',\n tick: 'binned',\n line: 'binned',\n trail: 'binned'\n };\n case SIZE:\n return {\n point: 'always',\n tick: 'always',\n rule: 'always',\n circle: 'always',\n square: 'always',\n bar: 'always',\n text: 'always',\n line: 'always',\n trail: 'always'\n };\n case STROKEDASH:\n return {\n line: 'always',\n point: 'always',\n tick: 'always',\n rule: 'always',\n circle: 'always',\n square: 'always',\n bar: 'always',\n geoshape: 'always'\n };\n case SHAPE:\n return { point: 'always', geoshape: 'always' };\n case TEXT:\n return { text: 'always' };\n case ANGLE:\n return { point: 'always', square: 'always', text: 'always' };\n case URL:\n return { image: 'always' };\n case THETA:\n return { text: 'always', arc: 'always' };\n case RADIUS:\n return { text: 'always', arc: 'always' };\n case THETA2:\n case RADIUS2:\n return { arc: 'always' };\n }\n}\nexport function rangeType(channel) {\n switch (channel) {\n case X:\n case Y:\n case THETA:\n case RADIUS:\n case SIZE:\n case ANGLE:\n case STROKEWIDTH:\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n // X2 and Y2 use X and Y scales, so they similarly have continuous range. [falls through]\n case X2:\n case Y2:\n case THETA2:\n case RADIUS2:\n return undefined;\n case FACET:\n case ROW:\n case COLUMN:\n case SHAPE:\n case STROKEDASH:\n // TEXT, TOOLTIP, URL, and HREF have no scale but have discrete output [falls through]\n case TEXT:\n case TOOLTIP:\n case HREF:\n case URL:\n case DESCRIPTION:\n return 'discrete';\n // Color can be either continuous or discrete, depending on scale type.\n case COLOR:\n case FILL:\n case STROKE:\n return 'flexible';\n // No scale, no range type.\n case LATITUDE:\n case LONGITUDE:\n case LATITUDE2:\n case LONGITUDE2:\n case DETAIL:\n case KEY:\n case ORDER:\n return undefined;\n }\n}\n//# sourceMappingURL=channel.js.map","import { isBoolean, isObject } from 'vega-util';\nimport { COLOR, COLUMN, FILL, FILLOPACITY, OPACITY, ROW, SHAPE, SIZE, STROKE, STROKEDASH, STROKEOPACITY, STROKEWIDTH } from './channel';\nimport { normalizeBin } from './channeldef';\nimport { entries, keys, varName } from './util';\n/**\n * Create a key for the bin configuration. Not for prebinned bin.\n */\nexport function binToString(bin) {\n if (isBoolean(bin)) {\n bin = normalizeBin(bin, undefined);\n }\n return ('bin' +\n keys(bin)\n .map(p => (isSelectionExtent(bin[p]) ? varName(`_${p}_${entries(bin[p])}`) : varName(`_${p}_${bin[p]}`)))\n .join(''));\n}\n/**\n * Vega-Lite should bin the data.\n */\nexport function isBinning(bin) {\n return bin === true || (isBinParams(bin) && !bin.binned);\n}\n/**\n * The data is already binned and so Vega-Lite should not bin it again.\n */\nexport function isBinned(bin) {\n return bin === 'binned' || (isBinParams(bin) && bin.binned === true);\n}\nexport function isBinParams(bin) {\n return isObject(bin);\n}\nexport function isSelectionExtent(extent) {\n return extent === null || extent === void 0 ? void 0 : extent['selection'];\n}\nexport function autoMaxBins(channel) {\n switch (channel) {\n case ROW:\n case COLUMN:\n case SIZE:\n case COLOR:\n case FILL:\n case STROKE:\n case STROKEWIDTH:\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n // Facets and Size shouldn't have too many bins\n // We choose 6 like shape to simplify the rule [falls through]\n case SHAPE:\n return 6; // Vega's \"shape\" has 6 distinct values\n case STROKEDASH:\n return 4; // We only provide 5 different stroke dash values (but 4 is more effective)\n default:\n return 10;\n }\n}\n//# sourceMappingURL=bin.js.map","import { getSizeChannel } from '../channel';\nimport { stringify } from '../util';\nexport function invalidSpec(spec) {\n return `Invalid specification ${JSON.stringify(spec)}. Make sure the specification includes at least one of the following properties: \"mark\", \"layer\", \"facet\", \"hconcat\", \"vconcat\", \"concat\", or \"repeat\".`;\n}\n// FIT\nexport const FIT_NON_SINGLE = 'Autosize \"fit\" only works for single views and layered views.';\nexport function containerSizeNonSingle(name) {\n const uName = name == 'width' ? 'Width' : 'Height';\n return `${uName} \"container\" only works for single views and layered views.`;\n}\nexport function containerSizeNotCompatibleWithAutosize(name) {\n const uName = name == 'width' ? 'Width' : 'Height';\n const fitDirection = name == 'width' ? 'x' : 'y';\n return `${uName} \"container\" only works well with autosize \"fit\" or \"fit-${fitDirection}\".`;\n}\nexport function droppingFit(channel) {\n return channel\n ? `Dropping \"fit-${channel}\" because spec has discrete ${getSizeChannel(channel)}.`\n : `Dropping \"fit\" because spec has discrete size.`;\n}\n// VIEW SIZE\nexport function unknownField(channel) {\n return `Unknown field for ${channel}. Cannot calculate view size.`;\n}\n// SELECTION\nexport function cannotProjectOnChannelWithoutField(channel) {\n return `Cannot project a selection on encoding channel \"${channel}\", which has no field.`;\n}\nexport function cannotProjectAggregate(channel, aggregate) {\n return `Cannot project a selection on encoding channel \"${channel}\" as it uses an aggregate function (\"${aggregate}\").`;\n}\nexport function nearestNotSupportForContinuous(mark) {\n return `The \"nearest\" transform is not supported for ${mark} marks.`;\n}\nexport function selectionNotSupported(mark) {\n return `Selection not supported for ${mark} yet.`;\n}\nexport function selectionNotFound(name) {\n return `Cannot find a selection named \"${name}\".`;\n}\nexport const SCALE_BINDINGS_CONTINUOUS = 'Scale bindings are currently only supported for scales with unbinned, continuous domains.';\nexport const LEGEND_BINDINGS_MUST_HAVE_PROJECTION = 'Legend bindings are only supported for selections over an individual field or encoding channel.';\nexport function noSameUnitLookup(name) {\n return (`Cannot define and lookup the \"${name}\" selection in the same view. ` +\n `Try moving the lookup into a second, layered view?`);\n}\nexport const NEEDS_SAME_SELECTION = 'The same selection must be used to override scale domains in a layered view.';\nexport const INTERVAL_INITIALIZED_WITH_X_Y = 'Interval selections should be initialized using \"x\" and/or \"y\" keys.';\n// REPEAT\nexport function noSuchRepeatedValue(field) {\n return `Unknown repeated value \"${field}\".`;\n}\nexport function columnsNotSupportByRowCol(type) {\n return `The \"columns\" property cannot be used when \"${type}\" has nested row/column.`;\n}\n// CONCAT / REPEAT\nexport const CONCAT_CANNOT_SHARE_AXIS = 'Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).';\n// DATA\nexport function unrecognizedParse(p) {\n return `Unrecognized parse \"${p}\".`;\n}\nexport function differentParse(field, local, ancestor) {\n return `An ancestor parsed field \"${field}\" as ${ancestor} but a child wants to parse the field as ${local}.`;\n}\nexport const ADD_SAME_CHILD_TWICE = 'Attempt to add the same child twice.';\n// TRANSFORMS\nexport function invalidTransformIgnored(transform) {\n return `Ignoring an invalid transform: ${stringify(transform)}.`;\n}\nexport const NO_FIELDS_NEEDS_AS = 'If \"from.fields\" is not specified, \"as\" has to be a string that specifies the key to be used for the data from the secondary source.';\n// ENCODING & FACET\nexport function customFormatTypeNotAllowed(channel) {\n return `Config.customFormatTypes is not true, thus custom format type and format for channel ${channel} are dropped.`;\n}\nexport function projectionOverridden(opt) {\n const { parentProjection, projection } = opt;\n return `Layer's shared projection ${stringify(parentProjection)} is overridden by a child projection ${stringify(projection)}.`;\n}\nexport const REPLACE_ANGLE_WITH_THETA = 'Arc marks uses theta channel rather than angle, replacing angle with theta.';\nexport function primitiveChannelDef(channel, type, value) {\n return `Channel ${channel} is a ${type}. Converted to {value: ${stringify(value)}}.`;\n}\nexport function invalidFieldType(type) {\n return `Invalid field type \"${type}\".`;\n}\nexport function invalidFieldTypeForCountAggregate(type, aggregate) {\n return `Invalid field type \"${type}\" for aggregate: \"${aggregate}\", using \"quantitative\" instead.`;\n}\nexport function invalidAggregate(aggregate) {\n return `Invalid aggregation operator \"${aggregate}\".`;\n}\nexport function missingFieldType(channel, newType) {\n return `Missing type for channel \"${channel}\", using \"${newType}\" instead.`;\n}\nexport function droppingColor(type, opt) {\n const { fill, stroke } = opt;\n return `Dropping color ${type} as the plot also has ${fill && stroke ? 'fill and stroke' : fill ? 'fill' : 'stroke'}.`;\n}\nexport function emptyFieldDef(fieldDef, channel) {\n return `Dropping ${stringify(fieldDef)} from channel \"${channel}\" since it does not contain any data field, datum, value, or signal.`;\n}\nexport function latLongDeprecated(channel, type, newChannel) {\n return `${channel}-encoding with type ${type} is deprecated. Replacing with ${newChannel}-encoding.`;\n}\nexport const LINE_WITH_VARYING_SIZE = 'Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.';\nexport function incompatibleChannel(channel, markOrFacet, when) {\n return `${channel} dropped as it is incompatible with \"${markOrFacet}\"${when ? ` when ${when}` : ''}.`;\n}\nexport function invalidEncodingChannel(channel) {\n return `${channel}-encoding is dropped as ${channel} is not a valid encoding channel.`;\n}\nexport function facetChannelShouldBeDiscrete(channel) {\n return `${channel} encoding should be discrete (ordinal / nominal / binned).`;\n}\nexport function facetChannelDropped(channels) {\n return `Facet encoding dropped as ${channels.join(' and ')} ${channels.length > 1 ? 'are' : 'is'} also specified.`;\n}\nexport function discreteChannelCannotEncode(channel, type) {\n return `Using discrete channel \"${channel}\" to encode \"${type}\" field can be misleading as it does not encode ${type === 'ordinal' ? 'order' : 'magnitude'}.`;\n}\n// MARK\nexport function rangeMarkAlignmentCannotBeExpression(align) {\n return `The ${align} for range marks cannot be an expression`;\n}\nexport function lineWithRange(hasX2, hasY2) {\n const channels = hasX2 && hasY2 ? 'x2 and y2' : hasX2 ? 'x2' : 'y2';\n return `Line mark is for continuous lines and thus cannot be used with ${channels}. We will use the rule mark (line segments) instead.`;\n}\nexport function orientOverridden(original, actual) {\n return `Specified orient \"${original}\" overridden with \"${actual}\".`;\n}\n// SCALE\nexport const CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN = 'Custom domain scale cannot be unioned with default field-based domain.';\nexport const RANGE_STEP_DEPRECATED = `Scale's \"rangeStep\" is deprecated and will be removed in Vega-Lite 5.0. Please use \"width\"/\"height\": {\"step\": ...} instead. See https://vega.github.io/vega-lite/docs/size.html.`;\nexport function cannotUseScalePropertyWithNonColor(prop) {\n return `Cannot use the scale property \"${prop}\" with non-color channel.`;\n}\nexport function unaggregateDomainHasNoEffectForRawField(fieldDef) {\n return `Using unaggregated domain with raw field has no effect (${stringify(fieldDef)}).`;\n}\nexport function unaggregateDomainWithNonSharedDomainOp(aggregate) {\n return `Unaggregated domain not applicable for \"${aggregate}\" since it produces values outside the origin domain of the source data.`;\n}\nexport function unaggregatedDomainWithLogScale(fieldDef) {\n return `Unaggregated domain is currently unsupported for log scale (${stringify(fieldDef)}).`;\n}\nexport function cannotApplySizeToNonOrientedMark(mark) {\n return `Cannot apply size to non-oriented mark \"${mark}\".`;\n}\nexport function scaleTypeNotWorkWithChannel(channel, scaleType, defaultScaleType) {\n return `Channel \"${channel}\" does not work with \"${scaleType}\" scale. We are using \"${defaultScaleType}\" scale instead.`;\n}\nexport function scaleTypeNotWorkWithFieldDef(scaleType, defaultScaleType) {\n return `FieldDef does not work with \"${scaleType}\" scale. We are using \"${defaultScaleType}\" scale instead.`;\n}\nexport function scalePropertyNotWorkWithScaleType(scaleType, propName, channel) {\n return `${channel}-scale's \"${propName}\" is dropped as it does not work with ${scaleType} scale.`;\n}\nexport function scaleTypeNotWorkWithMark(mark, scaleType) {\n return `Scale type \"${scaleType}\" does not work with mark \"${mark}\".`;\n}\nexport function stepDropped(channel) {\n return `The step for \"${channel}\" is dropped because the ${channel === 'width' ? 'x' : 'y'} is continuous.`;\n}\nexport function mergeConflictingProperty(property, propertyOf, v1, v2) {\n return `Conflicting ${propertyOf.toString()} property \"${property.toString()}\" (${stringify(v1)} and ${stringify(v2)}). Using ${stringify(v1)}.`;\n}\nexport function mergeConflictingDomainProperty(property, propertyOf, v1, v2) {\n return `Conflicting ${propertyOf.toString()} property \"${property.toString()}\" (${stringify(v1)} and ${stringify(v2)}). Using the union of the two domains.`;\n}\nexport function independentScaleMeansIndependentGuide(channel) {\n return `Setting the scale to be independent for \"${channel}\" means we also have to set the guide (axis or legend) to be independent.`;\n}\nexport function domainSortDropped(sort) {\n return `Dropping sort property ${stringify(sort)} as unioned domains only support boolean or op \"count\", \"min\", and \"max\".`;\n}\nexport const MORE_THAN_ONE_SORT = 'Domains that should be unioned has conflicting sort properties. Sort will be set to true.';\nexport const FACETED_INDEPENDENT_DIFFERENT_SOURCES = 'Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.';\nexport const FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES = 'Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.';\nexport const FACETED_INDEPENDENT_SAME_SOURCE = 'Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.';\n// AXIS\nexport const INVALID_CHANNEL_FOR_AXIS = 'Invalid channel for axis.';\n// STACK\nexport function cannotStackRangedMark(channel) {\n return `Cannot stack \"${channel}\" if there is already \"${channel}2\".`;\n}\nexport function cannotStackNonLinearScale(scaleType) {\n return `Cannot stack non-linear scale (${scaleType}).`;\n}\nexport function stackNonSummativeAggregate(aggregate) {\n return `Stacking is applied even though the aggregate function is non-summative (\"${aggregate}\").`;\n}\n// TIMEUNIT\nexport function invalidTimeUnit(unitName, value) {\n return `Invalid ${unitName}: ${stringify(value)}.`;\n}\nexport function droppedDay(d) {\n return `Dropping day from datetime ${stringify(d)} as day cannot be combined with other units.`;\n}\nexport function errorBarCenterAndExtentAreNotNeeded(center, extent) {\n return `${extent ? 'extent ' : ''}${extent && center ? 'and ' : ''}${center ? 'center ' : ''}${extent && center ? 'are ' : 'is '}not needed when data are aggregated.`;\n}\nexport function errorBarCenterIsUsedWithWrongExtent(center, extent, mark) {\n return `${center} is not usually used with ${extent} for ${mark}.`;\n}\nexport function errorBarContinuousAxisHasCustomizedAggregate(aggregate, compositeMark) {\n return `Continuous axis should not have customized aggregation function ${aggregate}; ${compositeMark} already agregates the axis.`;\n}\nexport function errorBand1DNotSupport(property) {\n return `1D error band does not support ${property}.`;\n}\n// CHANNEL\nexport function channelRequiredForBinned(channel) {\n return `Channel ${channel} is required for \"binned\" bin.`;\n}\nexport function channelShouldNotBeUsedForBinned(channel) {\n return `Channel ${channel} should not be used with \"binned\" bin.`;\n}\nexport function domainRequiredForThresholdScale(channel) {\n return `Domain for ${channel} is required for threshold scale.`;\n}\n//# sourceMappingURL=message.js.map","/**\n * Vega-Lite's singleton logger utility.\n */\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n privateMap.set(receiver, value);\n return value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n return privateMap.get(receiver);\n};\nvar _level;\nimport { Debug, Error as ErrorLevel, Info, logger, Warn } from 'vega-util';\nimport * as message_1 from './message';\nexport { message_1 as message };\n/**\n * Main (default) Vega Logger instance for Vega-Lite.\n */\nconst main = logger(Warn);\nlet current = main;\n/**\n * Logger tool for checking if the code throws correct warning.\n */\nexport class LocalLogger {\n constructor() {\n this.warns = [];\n this.infos = [];\n this.debugs = [];\n _level.set(this, Warn);\n }\n level(_) {\n if (_) {\n __classPrivateFieldSet(this, _level, _);\n return this;\n }\n return __classPrivateFieldGet(this, _level);\n }\n warn(...args) {\n if (__classPrivateFieldGet(this, _level) >= Warn)\n this.warns.push(...args);\n return this;\n }\n info(...args) {\n if (__classPrivateFieldGet(this, _level) >= Info)\n this.infos.push(...args);\n return this;\n }\n debug(...args) {\n if (__classPrivateFieldGet(this, _level) >= Debug)\n this.debugs.push(...args);\n return this;\n }\n error(...args) {\n if (__classPrivateFieldGet(this, _level) >= ErrorLevel)\n throw Error(...args);\n return this;\n }\n}\n_level = new WeakMap();\nexport function wrap(f) {\n return () => {\n current = new LocalLogger();\n f(current);\n reset();\n };\n}\n/**\n * Set the singleton logger to be a custom logger.\n */\nexport function set(newLogger) {\n current = newLogger;\n return current;\n}\n/**\n * Reset the main logger to use the default Vega Logger.\n */\nexport function reset() {\n current = main;\n return current;\n}\nexport function error(...args) {\n current.error(...args);\n}\nexport function warn(...args) {\n current.warn(...args);\n}\nexport function info(...args) {\n current.info(...args);\n}\nexport function debug(...args) {\n current.debug(...args);\n}\n//# sourceMappingURL=index.js.map","// DateTime definition object\nimport { isNumber, isObject } from 'vega-util';\nimport * as log from './log';\nimport { TIMEUNIT_PARTS } from './timeunit';\nimport { duplicate, isNumeric, keys } from './util';\nexport function isDateTime(o) {\n if (o && isObject(o)) {\n for (const part of TIMEUNIT_PARTS) {\n if (part in o) {\n return true;\n }\n }\n }\n return false;\n}\nexport const MONTHS = [\n 'january',\n 'february',\n 'march',\n 'april',\n 'may',\n 'june',\n 'july',\n 'august',\n 'september',\n 'october',\n 'november',\n 'december'\n];\nexport const SHORT_MONTHS = MONTHS.map(m => m.substr(0, 3));\nexport const DAYS = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];\nexport const SHORT_DAYS = DAYS.map(d => d.substr(0, 3));\nfunction normalizeQuarter(q) {\n if (isNumeric(q)) {\n q = +q;\n }\n if (isNumber(q)) {\n if (q > 4) {\n log.warn(log.message.invalidTimeUnit('quarter', q));\n }\n // We accept 1-based quarter, so need to readjust to 0-based quarter\n return q - 1;\n }\n else {\n // Invalid quarter\n throw new Error(log.message.invalidTimeUnit('quarter', q));\n }\n}\nfunction normalizeMonth(m) {\n if (isNumeric(m)) {\n m = +m;\n }\n if (isNumber(m)) {\n // We accept 1-based month, so need to readjust to 0-based month\n return m - 1;\n }\n else {\n const lowerM = m.toLowerCase();\n const monthIndex = MONTHS.indexOf(lowerM);\n if (monthIndex !== -1) {\n return monthIndex; // 0 for january, ...\n }\n const shortM = lowerM.substr(0, 3);\n const shortMonthIndex = SHORT_MONTHS.indexOf(shortM);\n if (shortMonthIndex !== -1) {\n return shortMonthIndex;\n }\n // Invalid month\n throw new Error(log.message.invalidTimeUnit('month', m));\n }\n}\nfunction normalizeDay(d) {\n if (isNumeric(d)) {\n d = +d;\n }\n if (isNumber(d)) {\n // mod so that this can be both 0-based where 0 = sunday\n // and 1-based where 7=sunday\n return d % 7;\n }\n else {\n const lowerD = d.toLowerCase();\n const dayIndex = DAYS.indexOf(lowerD);\n if (dayIndex !== -1) {\n return dayIndex; // 0 for january, ...\n }\n const shortD = lowerD.substr(0, 3);\n const shortDayIndex = SHORT_DAYS.indexOf(shortD);\n if (shortDayIndex !== -1) {\n return shortDayIndex;\n }\n // Invalid day\n throw new Error(log.message.invalidTimeUnit('day', d));\n }\n}\n/**\n * @param d the date.\n * @param normalize whether to normalize quarter, month, day. This should probably be true if d is a DateTime.\n * @returns array of date time parts [year, month, day, hours, minutes, seconds, milliseconds]\n */\nfunction dateTimeParts(d, normalize) {\n const parts = [];\n if (normalize && d.day !== undefined) {\n if (keys(d).length > 1) {\n log.warn(log.message.droppedDay(d));\n d = duplicate(d);\n delete d.day;\n }\n }\n if (d.year !== undefined) {\n parts.push(d.year);\n }\n else {\n // Just like Vega's timeunit transform, set default year to 2012, so domain conversion will be compatible with Vega\n // Note: 2012 is a leap year (and so the date February 29 is respected) that begins on a Sunday (and so days of the week will order properly at the beginning of the year).\n parts.push(2012);\n }\n if (d.month !== undefined) {\n const month = normalize ? normalizeMonth(d.month) : d.month;\n parts.push(month);\n }\n else if (d.quarter !== undefined) {\n const quarter = normalize ? normalizeQuarter(d.quarter) : d.quarter;\n parts.push(isNumber(quarter) ? quarter * 3 : quarter + '*3');\n }\n else {\n parts.push(0); // months start at zero in JS\n }\n if (d.date !== undefined) {\n parts.push(d.date);\n }\n else if (d.day !== undefined) {\n // HACK: Day only works as a standalone unit\n // This is only correct because we always set year to 2006 for day\n const day = normalize ? normalizeDay(d.day) : d.day;\n parts.push(isNumber(day) ? day + 1 : day + '+1');\n }\n else {\n parts.push(1); // Date starts at 1 in JS\n }\n // Note: can't use TimeUnit enum here as importing it will create\n // circular dependency problem!\n for (const timeUnit of ['hours', 'minutes', 'seconds', 'milliseconds']) {\n const unit = d[timeUnit];\n parts.push(typeof unit === 'undefined' ? 0 : unit);\n }\n return parts;\n}\n/**\n * Return Vega expression for a date time.\n *\n * @param d the date time.\n * @returns the Vega expression.\n */\nexport function dateTimeToExpr(d) {\n const parts = dateTimeParts(d, true);\n const string = parts.join(', ');\n if (d.utc) {\n return `utc(${string})`;\n }\n else {\n return `datetime(${string})`;\n }\n}\n/**\n * Return Vega expression for a date time expression.\n *\n * @param d the internal date time object with expression.\n * @returns the Vega expression.\n */\nexport function dateTimeExprToExpr(d) {\n const parts = dateTimeParts(d, false);\n const string = parts.join(', ');\n if (d.utc) {\n return `utc(${string})`;\n }\n else {\n return `datetime(${string})`;\n }\n}\n/**\n * @param d the date time.\n * @returns the timestamp.\n */\nexport function dateTimeToTimestamp(d) {\n const parts = dateTimeParts(d, true);\n if (d.utc) {\n return +new Date(Date.UTC(...parts));\n }\n else {\n return +new Date(...parts);\n }\n}\n//# sourceMappingURL=datetime.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport stringify from 'fast-json-stable-stringify';\nimport { isObject, isString } from 'vega-util';\nimport { dateTimeExprToExpr } from './datetime';\nimport { accessPathWithDatum, keys, varName } from './util';\n/** Time Unit that only corresponds to only one part of Date objects. */\nexport const LOCAL_SINGLE_TIMEUNIT_INDEX = {\n year: 1,\n quarter: 1,\n month: 1,\n week: 1,\n day: 1,\n dayofyear: 1,\n date: 1,\n hours: 1,\n minutes: 1,\n seconds: 1,\n milliseconds: 1\n};\nexport const TIMEUNIT_PARTS = keys(LOCAL_SINGLE_TIMEUNIT_INDEX);\nexport function isLocalSingleTimeUnit(timeUnit) {\n return !!LOCAL_SINGLE_TIMEUNIT_INDEX[timeUnit];\n}\nexport const UTC_SINGLE_TIMEUNIT_INDEX = {\n utcyear: 1,\n utcquarter: 1,\n utcmonth: 1,\n utcweek: 1,\n utcday: 1,\n utcdayofyear: 1,\n utcdate: 1,\n utchours: 1,\n utcminutes: 1,\n utcseconds: 1,\n utcmilliseconds: 1\n};\nexport const LOCAL_MULTI_TIMEUNIT_INDEX = {\n yearquarter: 1,\n yearquartermonth: 1,\n yearmonth: 1,\n yearmonthdate: 1,\n yearmonthdatehours: 1,\n yearmonthdatehoursminutes: 1,\n yearmonthdatehoursminutesseconds: 1,\n yearweek: 1,\n yearweekday: 1,\n yearweekdayhours: 1,\n yearweekdayhoursminutes: 1,\n yearweekdayhoursminutesseconds: 1,\n yeardayofyear: 1,\n quartermonth: 1,\n monthdate: 1,\n monthdatehours: 1,\n monthdatehoursminutes: 1,\n monthdatehoursminutesseconds: 1,\n weekday: 1,\n weeksdayhours: 1,\n weekdayhoursminutes: 1,\n weekdayhoursminutesseconds: 1,\n dayhours: 1,\n dayhoursminutes: 1,\n dayhoursminutesseconds: 1,\n hoursminutes: 1,\n hoursminutesseconds: 1,\n minutesseconds: 1,\n secondsmilliseconds: 1\n};\nexport const UTC_MULTI_TIMEUNIT_INDEX = {\n utcyearquarter: 1,\n utcyearquartermonth: 1,\n utcyearmonth: 1,\n utcyearmonthdate: 1,\n utcyearmonthdatehours: 1,\n utcyearmonthdatehoursminutes: 1,\n utcyearmonthdatehoursminutesseconds: 1,\n utcyearweek: 1,\n utcyearweekday: 1,\n utcyearweekdayhours: 1,\n utcyearweekdayhoursminutes: 1,\n utcyearweekdayhoursminutesseconds: 1,\n utcyeardayofyear: 1,\n utcquartermonth: 1,\n utcmonthdate: 1,\n utcmonthdatehours: 1,\n utcmonthdatehoursminutes: 1,\n utcmonthdatehoursminutesseconds: 1,\n utcweekday: 1,\n utcweeksdayhours: 1,\n utcweekdayhoursminutes: 1,\n utcweekdayhoursminutesseconds: 1,\n utcdayhours: 1,\n utcdayhoursminutes: 1,\n utcdayhoursminutesseconds: 1,\n utchoursminutes: 1,\n utchoursminutesseconds: 1,\n utcminutesseconds: 1,\n utcsecondsmilliseconds: 1\n};\nexport function isUTCTimeUnit(t) {\n return t.startsWith('utc');\n}\nexport function getLocalTimeUnit(t) {\n return t.substr(3);\n}\n// In order of increasing specificity\nexport const VEGALITE_TIMEFORMAT = {\n 'year-month': '%b %Y ',\n 'year-month-date': '%b %d, %Y '\n};\nexport function getTimeUnitParts(timeUnit) {\n const parts = [];\n for (const part of TIMEUNIT_PARTS) {\n if (containsTimeUnit(timeUnit, part)) {\n parts.push(part);\n }\n }\n return parts;\n}\n/** Returns true if fullTimeUnit contains the timeUnit, false otherwise. */\nexport function containsTimeUnit(fullTimeUnit, timeUnit) {\n const index = fullTimeUnit.indexOf(timeUnit);\n if (index < 0) {\n return false;\n }\n // exclude milliseconds\n if (index > 0 && timeUnit === 'seconds' && fullTimeUnit.charAt(index - 1) === 'i') {\n return false;\n }\n // exclude dayofyear\n if (fullTimeUnit.length > index + 3 && timeUnit === 'day' && fullTimeUnit.charAt(index + 3) === 'o') {\n return false;\n }\n if (index > 0 && timeUnit === 'year' && fullTimeUnit.charAt(index - 1) === 'f') {\n return false;\n }\n return true;\n}\n/**\n * Returns Vega expression for a given timeUnit and fieldRef\n */\nexport function fieldExpr(fullTimeUnit, field, { end } = { end: false }) {\n const fieldRef = accessPathWithDatum(field);\n const utc = isUTCTimeUnit(fullTimeUnit) ? 'utc' : '';\n function func(timeUnit) {\n if (timeUnit === 'quarter') {\n // quarter starting at 0 (0,3,6,9).\n return `(${utc}quarter(${fieldRef})-1)`;\n }\n else {\n return `${utc}${timeUnit}(${fieldRef})`;\n }\n }\n let lastTimeUnit;\n const dateExpr = {};\n for (const part of TIMEUNIT_PARTS) {\n if (containsTimeUnit(fullTimeUnit, part)) {\n dateExpr[part] = func(part);\n lastTimeUnit = part;\n }\n }\n if (end) {\n dateExpr[lastTimeUnit] += '+1';\n }\n return dateTimeExprToExpr(dateExpr);\n}\nexport function timeUnitSpecifierExpression(timeUnit) {\n if (!timeUnit) {\n return undefined;\n }\n const timeUnitParts = getTimeUnitParts(timeUnit);\n return `timeUnitSpecifier(${stringify(timeUnitParts)}, ${stringify(VEGALITE_TIMEFORMAT)})`;\n}\n/**\n * Returns the signal expression used for axis labels for a time unit.\n */\nexport function formatExpression(timeUnit, field, isUTCScale) {\n if (!timeUnit) {\n return undefined;\n }\n const expr = timeUnitSpecifierExpression(timeUnit);\n // We only use utcFormat for utc scale\n // For utc time units, the data is already converted as a part of timeUnit transform.\n // Thus, utc time units should use timeFormat to avoid shifting the time twice.\n const utc = isUTCScale || isUTCTimeUnit(timeUnit);\n return `${utc ? 'utc' : 'time'}Format(${field}, ${expr})`;\n}\nexport function normalizeTimeUnit(timeUnit) {\n if (!timeUnit) {\n return undefined;\n }\n let params;\n if (isString(timeUnit)) {\n params = {\n unit: timeUnit\n };\n }\n else if (isObject(timeUnit)) {\n params = Object.assign(Object.assign({}, timeUnit), (timeUnit.unit ? { unit: timeUnit.unit } : {}));\n }\n if (isUTCTimeUnit(params.unit)) {\n params.utc = true;\n params.unit = getLocalTimeUnit(params.unit);\n }\n return params;\n}\nexport function timeUnitToString(tu) {\n const _a = normalizeTimeUnit(tu), { utc } = _a, rest = __rest(_a, [\"utc\"]);\n if (rest.unit) {\n return ((utc ? 'utc' : '') +\n keys(rest)\n .map(p => varName(`${p === 'unit' ? '' : `_${p}_`}${rest[p]}`))\n .join(''));\n }\n else {\n // when maxbins is specified instead of units\n return ((utc ? 'utc' : '') +\n 'timeunit' +\n keys(rest)\n .map(p => varName(`_${p}_${rest[p]}`))\n .join(''));\n }\n}\n//# sourceMappingURL=timeunit.js.map","import { isArray } from 'vega-util';\nimport { keys } from './util';\nexport function isSignalRef(o) {\n return o && !!o['signal'];\n}\nexport function isVgRangeStep(range) {\n return !!range['step'];\n}\nexport function isDataRefUnionedDomain(domain) {\n if (!isArray(domain)) {\n return 'fields' in domain && !('data' in domain);\n }\n return false;\n}\nexport function isFieldRefUnionDomain(domain) {\n if (!isArray(domain)) {\n return 'fields' in domain && 'data' in domain;\n }\n return false;\n}\nexport function isDataRefDomain(domain) {\n if (!isArray(domain)) {\n return 'field' in domain && 'data' in domain;\n }\n return false;\n}\nconst VG_MARK_CONFIG_INDEX = {\n aria: 1,\n description: 1,\n ariaRole: 1,\n ariaRoleDescription: 1,\n blend: 1,\n opacity: 1,\n fill: 1,\n fillOpacity: 1,\n stroke: 1,\n strokeCap: 1,\n strokeWidth: 1,\n strokeOpacity: 1,\n strokeDash: 1,\n strokeDashOffset: 1,\n strokeJoin: 1,\n strokeOffset: 1,\n strokeMiterLimit: 1,\n startAngle: 1,\n endAngle: 1,\n padAngle: 1,\n innerRadius: 1,\n outerRadius: 1,\n size: 1,\n shape: 1,\n interpolate: 1,\n tension: 1,\n orient: 1,\n align: 1,\n baseline: 1,\n text: 1,\n dir: 1,\n dx: 1,\n dy: 1,\n ellipsis: 1,\n limit: 1,\n radius: 1,\n theta: 1,\n angle: 1,\n font: 1,\n fontSize: 1,\n fontWeight: 1,\n fontStyle: 1,\n lineBreak: 1,\n lineHeight: 1,\n cursor: 1,\n href: 1,\n tooltip: 1,\n cornerRadius: 1,\n cornerRadiusTopLeft: 1,\n cornerRadiusTopRight: 1,\n cornerRadiusBottomLeft: 1,\n cornerRadiusBottomRight: 1,\n aspect: 1,\n width: 1,\n height: 1,\n url: 1,\n smooth: 1\n // commented below are vg channel that do not have mark config.\n // x: 1,\n // y: 1,\n // x2: 1,\n // y2: 1,\n // xc'|'yc'\n // clip: 1,\n // path: 1,\n // url: 1,\n};\nexport const VG_MARK_CONFIGS = keys(VG_MARK_CONFIG_INDEX);\nexport const VG_MARK_INDEX = {\n arc: 1,\n area: 1,\n group: 1,\n image: 1,\n line: 1,\n path: 1,\n rect: 1,\n rule: 1,\n shape: 1,\n symbol: 1,\n text: 1,\n trail: 1\n};\n// Vega's cornerRadius channels.\nexport const VG_CORNERRADIUS_CHANNELS = [\n 'cornerRadius',\n 'cornerRadiusTopLeft',\n 'cornerRadiusTopRight',\n 'cornerRadiusBottomLeft',\n 'cornerRadiusBottomRight'\n];\n//# sourceMappingURL=vega.schema.js.map","import { isArray } from 'vega-util';\nimport { valueExpr, vgField } from './channeldef';\nimport { fieldExpr as timeUnitFieldExpr, normalizeTimeUnit } from './timeunit';\nimport { isSignalRef } from './vega.schema';\nexport function isSelectionPredicate(predicate) {\n return predicate === null || predicate === void 0 ? void 0 : predicate['selection'];\n}\nexport function isFieldEqualPredicate(predicate) {\n return predicate && !!predicate.field && predicate.equal !== undefined;\n}\nexport function isFieldLTPredicate(predicate) {\n return predicate && !!predicate.field && predicate.lt !== undefined;\n}\nexport function isFieldLTEPredicate(predicate) {\n return predicate && !!predicate.field && predicate.lte !== undefined;\n}\nexport function isFieldGTPredicate(predicate) {\n return predicate && !!predicate.field && predicate.gt !== undefined;\n}\nexport function isFieldGTEPredicate(predicate) {\n return predicate && !!predicate.field && predicate.gte !== undefined;\n}\nexport function isFieldRangePredicate(predicate) {\n if (predicate && predicate.field) {\n if (isArray(predicate.range) && predicate.range.length === 2) {\n return true;\n }\n else if (isSignalRef(predicate.range)) {\n return true;\n }\n }\n return false;\n}\nexport function isFieldOneOfPredicate(predicate) {\n return (predicate && !!predicate.field && (isArray(predicate.oneOf) || isArray(predicate.in)) // backward compatibility\n );\n}\nexport function isFieldValidPredicate(predicate) {\n return predicate && !!predicate.field && predicate.valid !== undefined;\n}\nexport function isFieldPredicate(predicate) {\n return (isFieldOneOfPredicate(predicate) ||\n isFieldEqualPredicate(predicate) ||\n isFieldRangePredicate(predicate) ||\n isFieldLTPredicate(predicate) ||\n isFieldGTPredicate(predicate) ||\n isFieldLTEPredicate(predicate) ||\n isFieldGTEPredicate(predicate));\n}\nfunction predicateValueExpr(v, timeUnit) {\n return valueExpr(v, { timeUnit, wrapTime: true });\n}\nfunction predicateValuesExpr(vals, timeUnit) {\n return vals.map(v => predicateValueExpr(v, timeUnit));\n}\n// This method is used by Voyager. Do not change its behavior without changing Voyager.\nexport function fieldFilterExpression(predicate, useInRange = true) {\n var _a;\n const { field } = predicate;\n const timeUnit = (_a = normalizeTimeUnit(predicate.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit;\n const fieldExpr = timeUnit\n ? // For timeUnit, cast into integer with time() so we can use ===, inrange, indexOf to compare values directly.\n // TODO: We calculate timeUnit on the fly here. Consider if we would like to consolidate this with timeUnit pipeline\n // TODO: support utc\n 'time(' + timeUnitFieldExpr(timeUnit, field) + ')'\n : vgField(predicate, { expr: 'datum' });\n if (isFieldEqualPredicate(predicate)) {\n return fieldExpr + '===' + predicateValueExpr(predicate.equal, timeUnit);\n }\n else if (isFieldLTPredicate(predicate)) {\n const upper = predicate.lt;\n return `${fieldExpr}<${predicateValueExpr(upper, timeUnit)}`;\n }\n else if (isFieldGTPredicate(predicate)) {\n const lower = predicate.gt;\n return `${fieldExpr}>${predicateValueExpr(lower, timeUnit)}`;\n }\n else if (isFieldLTEPredicate(predicate)) {\n const upper = predicate.lte;\n return `${fieldExpr}<=${predicateValueExpr(upper, timeUnit)}`;\n }\n else if (isFieldGTEPredicate(predicate)) {\n const lower = predicate.gte;\n return `${fieldExpr}>=${predicateValueExpr(lower, timeUnit)}`;\n }\n else if (isFieldOneOfPredicate(predicate)) {\n return `indexof([${predicateValuesExpr(predicate.oneOf, timeUnit).join(',')}], ${fieldExpr}) !== -1`;\n }\n else if (isFieldValidPredicate(predicate)) {\n return fieldValidPredicate(fieldExpr, predicate.valid);\n }\n else if (isFieldRangePredicate(predicate)) {\n const { range } = predicate;\n const lower = isSignalRef(range) ? { signal: `${range.signal}[0]` } : range[0];\n const upper = isSignalRef(range) ? { signal: `${range.signal}[1]` } : range[1];\n if (lower !== null && upper !== null && useInRange) {\n return ('inrange(' +\n fieldExpr +\n ', [' +\n predicateValueExpr(lower, timeUnit) +\n ', ' +\n predicateValueExpr(upper, timeUnit) +\n '])');\n }\n const exprs = [];\n if (lower !== null) {\n exprs.push(`${fieldExpr} >= ${predicateValueExpr(lower, timeUnit)}`);\n }\n if (upper !== null) {\n exprs.push(`${fieldExpr} <= ${predicateValueExpr(upper, timeUnit)}`);\n }\n return exprs.length > 0 ? exprs.join(' && ') : 'true';\n }\n /* istanbul ignore next: it should never reach here */\n throw new Error(`Invalid field predicate: ${JSON.stringify(predicate)}`);\n}\nexport function fieldValidPredicate(fieldExpr, valid = true) {\n if (valid) {\n return `isValid(${fieldExpr}) && isFinite(+${fieldExpr})`;\n }\n else {\n return `!isValid(${fieldExpr}) || !isFinite(+${fieldExpr})`;\n }\n}\nexport function normalizePredicate(f) {\n var _a;\n if (isFieldPredicate(f) && f.timeUnit) {\n return Object.assign(Object.assign({}, f), { timeUnit: (_a = normalizeTimeUnit(f.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit });\n }\n return f;\n}\n//# sourceMappingURL=predicate.js.map","import { keys } from './util';\n/**\n * Data type based on level of measurement\n */\nexport const Type = {\n quantitative: 'quantitative',\n ordinal: 'ordinal',\n temporal: 'temporal',\n nominal: 'nominal',\n geojson: 'geojson'\n};\nexport function isType(t) {\n return t in Type;\n}\nexport const QUANTITATIVE = Type.quantitative;\nexport const ORDINAL = Type.ordinal;\nexport const TEMPORAL = Type.temporal;\nexport const NOMINAL = Type.nominal;\nexport const GEOJSON = Type.geojson;\nexport const TYPES = keys(Type);\n/**\n * Get full, lowercase type name for a given type.\n * @param type\n * @return Full type name.\n */\nexport function getFullName(type) {\n if (type) {\n type = type.toLowerCase();\n switch (type) {\n case 'q':\n case QUANTITATIVE:\n return 'quantitative';\n case 't':\n case TEMPORAL:\n return 'temporal';\n case 'o':\n case ORDINAL:\n return 'ordinal';\n case 'n':\n case NOMINAL:\n return 'nominal';\n case GEOJSON:\n return 'geojson';\n }\n }\n // If we get invalid input, return undefined type.\n return undefined;\n}\n//# sourceMappingURL=type.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isString, toSet } from 'vega-util';\nimport * as CHANNEL from './channel';\nimport { isColorChannel } from './channel';\nimport * as log from './log';\nimport { NOMINAL, ORDINAL, QUANTITATIVE, TEMPORAL } from './type';\nimport { contains, keys } from './util';\nexport const ScaleType = {\n // Continuous - Quantitative\n LINEAR: 'linear',\n LOG: 'log',\n POW: 'pow',\n SQRT: 'sqrt',\n SYMLOG: 'symlog',\n IDENTITY: 'identity',\n SEQUENTIAL: 'sequential',\n // Continuous - Time\n TIME: 'time',\n UTC: 'utc',\n // Discretizing scales\n QUANTILE: 'quantile',\n QUANTIZE: 'quantize',\n THRESHOLD: 'threshold',\n BIN_ORDINAL: 'bin-ordinal',\n // Discrete scales\n ORDINAL: 'ordinal',\n POINT: 'point',\n BAND: 'band'\n};\n/**\n * Index for scale categories -- only scale of the same categories can be merged together.\n * Current implementation is trying to be conservative and avoid merging scale type that might not work together\n */\nexport const SCALE_CATEGORY_INDEX = {\n linear: 'numeric',\n log: 'numeric',\n pow: 'numeric',\n sqrt: 'numeric',\n symlog: 'numeric',\n identity: 'numeric',\n sequential: 'numeric',\n time: 'time',\n utc: 'time',\n ordinal: 'ordinal',\n 'bin-ordinal': 'bin-ordinal',\n point: 'ordinal-position',\n band: 'ordinal-position',\n quantile: 'discretizing',\n quantize: 'discretizing',\n threshold: 'discretizing'\n};\nexport const SCALE_TYPES = keys(SCALE_CATEGORY_INDEX);\n/**\n * Whether the two given scale types can be merged together.\n */\nexport function scaleCompatible(scaleType1, scaleType2) {\n const scaleCategory1 = SCALE_CATEGORY_INDEX[scaleType1];\n const scaleCategory2 = SCALE_CATEGORY_INDEX[scaleType2];\n return (scaleCategory1 === scaleCategory2 ||\n (scaleCategory1 === 'ordinal-position' && scaleCategory2 === 'time') ||\n (scaleCategory2 === 'ordinal-position' && scaleCategory1 === 'time'));\n}\n/**\n * Index for scale precedence -- high score = higher priority for merging.\n */\nconst SCALE_PRECEDENCE_INDEX = {\n // numeric\n linear: 0,\n log: 1,\n pow: 1,\n sqrt: 1,\n symlog: 1,\n identity: 1,\n sequential: 1,\n // time\n time: 0,\n utc: 0,\n // ordinal-position -- these have higher precedence than continuous scales as they support more types of data\n point: 10,\n band: 11,\n // non grouped types\n ordinal: 0,\n 'bin-ordinal': 0,\n quantile: 0,\n quantize: 0,\n threshold: 0\n};\n/**\n * Return scale categories -- only scale of the same categories can be merged together.\n */\nexport function scaleTypePrecedence(scaleType) {\n return SCALE_PRECEDENCE_INDEX[scaleType];\n}\nexport const CONTINUOUS_TO_CONTINUOUS_SCALES = ['linear', 'log', 'pow', 'sqrt', 'symlog', 'time', 'utc'];\nconst CONTINUOUS_TO_CONTINUOUS_INDEX = toSet(CONTINUOUS_TO_CONTINUOUS_SCALES);\nexport const QUANTITATIVE_SCALES = ['linear', 'log', 'pow', 'sqrt', 'symlog'];\nconst QUANTITATIVE_SCALES_INDEX = toSet(QUANTITATIVE_SCALES);\nexport function isQuantitative(type) {\n return type in QUANTITATIVE_SCALES_INDEX;\n}\nexport const CONTINUOUS_TO_DISCRETE_SCALES = ['quantile', 'quantize', 'threshold'];\nconst CONTINUOUS_TO_DISCRETE_INDEX = toSet(CONTINUOUS_TO_DISCRETE_SCALES);\nexport const CONTINUOUS_DOMAIN_SCALES = CONTINUOUS_TO_CONTINUOUS_SCALES.concat([\n 'quantile',\n 'quantize',\n 'threshold',\n 'sequential',\n 'identity'\n]);\nconst CONTINUOUS_DOMAIN_INDEX = toSet(CONTINUOUS_DOMAIN_SCALES);\nexport const DISCRETE_DOMAIN_SCALES = ['ordinal', 'bin-ordinal', 'point', 'band'];\nconst DISCRETE_DOMAIN_INDEX = toSet(DISCRETE_DOMAIN_SCALES);\nexport const TIME_SCALE_TYPES = ['time', 'utc'];\nexport function hasDiscreteDomain(type) {\n return type in DISCRETE_DOMAIN_INDEX;\n}\nexport function hasContinuousDomain(type) {\n return type in CONTINUOUS_DOMAIN_INDEX;\n}\nexport function isContinuousToContinuous(type) {\n return type in CONTINUOUS_TO_CONTINUOUS_INDEX;\n}\nexport function isContinuousToDiscrete(type) {\n return type in CONTINUOUS_TO_DISCRETE_INDEX;\n}\nexport const defaultScaleConfig = {\n pointPadding: 0.5,\n barBandPaddingInner: 0.1,\n rectBandPaddingInner: 0,\n minBandSize: 2,\n minFontSize: 8,\n maxFontSize: 40,\n minOpacity: 0.3,\n maxOpacity: 0.8,\n // FIXME: revise if these *can* become ratios of width/height step\n minSize: 9,\n minStrokeWidth: 1,\n maxStrokeWidth: 4,\n quantileCount: 4,\n quantizeCount: 4\n};\nexport function isExtendedScheme(scheme) {\n return !isString(scheme) && !!scheme['name'];\n}\nexport function isSelectionDomain(domain) {\n return domain === null || domain === void 0 ? void 0 : domain['selection'];\n}\nexport function isDomainUnionWith(domain) {\n return domain && domain['unionWith'];\n}\nconst SCALE_PROPERTY_INDEX = {\n type: 1,\n domain: 1,\n domainMax: 1,\n domainMin: 1,\n domainMid: 1,\n align: 1,\n range: 1,\n rangeMax: 1,\n rangeMin: 1,\n scheme: 1,\n bins: 1,\n // Other properties\n reverse: 1,\n round: 1,\n // quantitative / time\n clamp: 1,\n nice: 1,\n // quantitative\n base: 1,\n exponent: 1,\n constant: 1,\n interpolate: 1,\n zero: 1,\n // band/point\n padding: 1,\n paddingInner: 1,\n paddingOuter: 1\n};\nexport const SCALE_PROPERTIES = keys(SCALE_PROPERTY_INDEX);\nconst { type, domain, range, rangeMax, rangeMin, scheme } = SCALE_PROPERTY_INDEX, NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTY_INDEX = __rest(SCALE_PROPERTY_INDEX, [\"type\", \"domain\", \"range\", \"rangeMax\", \"rangeMin\", \"scheme\"]);\nexport const NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES = keys(NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTY_INDEX);\nexport function scaleTypeSupportProperty(scaleType, propName) {\n switch (propName) {\n case 'type':\n case 'domain':\n case 'reverse':\n case 'range':\n return true;\n case 'scheme':\n case 'interpolate':\n return !contains(['point', 'band', 'identity'], scaleType);\n case 'bins':\n return !contains(['point', 'band', 'identity', 'ordinal'], scaleType);\n case 'round':\n return isContinuousToContinuous(scaleType) || scaleType === 'band' || scaleType === 'point';\n case 'padding':\n case 'rangeMin':\n case 'rangeMax':\n return isContinuousToContinuous(scaleType) || contains(['point', 'band'], scaleType);\n case 'paddingOuter':\n case 'align':\n return contains(['point', 'band'], scaleType);\n case 'paddingInner':\n return scaleType === 'band';\n case 'domainMax':\n case 'domainMid':\n case 'domainMin':\n case 'clamp':\n return isContinuousToContinuous(scaleType);\n case 'nice':\n return isContinuousToContinuous(scaleType) || scaleType === 'quantize' || scaleType === 'threshold';\n case 'exponent':\n return scaleType === 'pow';\n case 'base':\n return scaleType === 'log';\n case 'constant':\n return scaleType === 'symlog';\n case 'zero':\n return (hasContinuousDomain(scaleType) &&\n !contains([\n 'log',\n 'time',\n 'utc',\n 'threshold',\n 'quantile' // quantile depends on distribution so zero does not matter\n ], scaleType));\n }\n}\n/**\n * Returns undefined if the input channel supports the input scale property name\n */\nexport function channelScalePropertyIncompatability(channel, propName) {\n switch (propName) {\n case 'interpolate':\n case 'scheme':\n case 'domainMid':\n if (!isColorChannel(channel)) {\n return log.message.cannotUseScalePropertyWithNonColor(channel);\n }\n return undefined;\n case 'align':\n case 'type':\n case 'bins':\n case 'domain':\n case 'domainMax':\n case 'domainMin':\n case 'range':\n case 'base':\n case 'exponent':\n case 'constant':\n case 'nice':\n case 'padding':\n case 'paddingInner':\n case 'paddingOuter':\n case 'rangeMax':\n case 'rangeMin':\n case 'reverse':\n case 'round':\n case 'clamp':\n case 'zero':\n return undefined; // GOOD!\n }\n}\nexport function scaleTypeSupportDataType(specifiedType, fieldDefType) {\n if (contains([ORDINAL, NOMINAL], fieldDefType)) {\n return specifiedType === undefined || hasDiscreteDomain(specifiedType);\n }\n else if (fieldDefType === TEMPORAL) {\n return contains([ScaleType.TIME, ScaleType.UTC, undefined], specifiedType);\n }\n else if (fieldDefType === QUANTITATIVE) {\n return contains([\n ScaleType.LOG,\n ScaleType.POW,\n ScaleType.SQRT,\n ScaleType.SYMLOG,\n ScaleType.QUANTILE,\n ScaleType.QUANTIZE,\n ScaleType.THRESHOLD,\n ScaleType.LINEAR,\n undefined\n ], specifiedType);\n }\n return true;\n}\nexport function channelSupportScaleType(channel, scaleType) {\n if (!CHANNEL.isScaleChannel(channel)) {\n return false;\n }\n switch (channel) {\n case CHANNEL.X:\n case CHANNEL.Y:\n case CHANNEL.THETA:\n case CHANNEL.RADIUS:\n return isContinuousToContinuous(scaleType) || contains(['band', 'point'], scaleType);\n case CHANNEL.SIZE: // TODO: size and opacity can support ordinal with more modification\n case CHANNEL.STROKEWIDTH:\n case CHANNEL.OPACITY:\n case CHANNEL.FILLOPACITY:\n case CHANNEL.STROKEOPACITY:\n case CHANNEL.ANGLE:\n // Although it generally doesn't make sense to use band with size and opacity,\n // it can also work since we use band: 0.5 to get midpoint.\n return (isContinuousToContinuous(scaleType) ||\n isContinuousToDiscrete(scaleType) ||\n contains(['band', 'point', 'ordinal'], scaleType));\n case CHANNEL.COLOR:\n case CHANNEL.FILL:\n case CHANNEL.STROKE:\n return scaleType !== 'band'; // band does not make sense with color\n case CHANNEL.STROKEDASH:\n return scaleType === 'ordinal' || isContinuousToDiscrete(scaleType);\n case CHANNEL.SHAPE:\n return scaleType === 'ordinal'; // shape = lookup only\n }\n}\n//# sourceMappingURL=scale.js.map","import { signalRefOrValue } from './compile/common';\nimport { keys } from './util';\nimport { isSignalRef } from './vega.schema';\nexport function isExprRef(o) {\n return o && !!o['expr'];\n}\nexport function isExprOrSignalRef(o) {\n return isExprRef(o) || isSignalRef(o);\n}\nexport function replaceExprRefInIndex(index) {\n const props = keys(index || {});\n const newIndex = {};\n for (const prop of props) {\n newIndex[prop] = signalRefOrValue(index[prop]);\n }\n return newIndex;\n}\n//# sourceMappingURL=expr.js.map","import { toSet } from 'vega-util';\nimport { contains, keys } from './util';\n/**\n * All types of primitive marks.\n */\nexport const Mark = {\n arc: 'arc',\n area: 'area',\n bar: 'bar',\n image: 'image',\n line: 'line',\n point: 'point',\n rect: 'rect',\n rule: 'rule',\n text: 'text',\n tick: 'tick',\n trail: 'trail',\n circle: 'circle',\n square: 'square',\n geoshape: 'geoshape'\n};\nexport const ARC = Mark.arc;\nexport const AREA = Mark.area;\nexport const BAR = Mark.bar;\nexport const IMAGE = Mark.image;\nexport const LINE = Mark.line;\nexport const POINT = Mark.point;\nexport const RECT = Mark.rect;\nexport const RULE = Mark.rule;\nexport const TEXT = Mark.text;\nexport const TICK = Mark.tick;\nexport const TRAIL = Mark.trail;\nexport const CIRCLE = Mark.circle;\nexport const SQUARE = Mark.square;\nexport const GEOSHAPE = Mark.geoshape;\nexport function isMark(m) {\n return m in Mark;\n}\nexport function isPathMark(m) {\n return contains(['line', 'area', 'trail'], m);\n}\nexport function isRectBasedMark(m) {\n return contains(['rect', 'bar', 'image', 'arc' /* arc is rect/interval in polar coordinate */], m);\n}\nexport const PRIMITIVE_MARKS = keys(Mark);\nexport function isMarkDef(mark) {\n return mark['type'];\n}\nconst PRIMITIVE_MARK_INDEX = toSet(PRIMITIVE_MARKS);\nexport function isPrimitiveMark(mark) {\n const markType = isMarkDef(mark) ? mark.type : mark;\n return markType in PRIMITIVE_MARK_INDEX;\n}\nexport const STROKE_CONFIG = [\n 'stroke',\n 'strokeWidth',\n 'strokeDash',\n 'strokeDashOffset',\n 'strokeOpacity',\n 'strokeJoin',\n 'strokeMiterLimit'\n];\nexport const FILL_CONFIG = ['fill', 'fillOpacity'];\nexport const FILL_STROKE_CONFIG = [...STROKE_CONFIG, ...FILL_CONFIG];\nconst VL_ONLY_MARK_CONFIG_INDEX = {\n color: 1,\n filled: 1,\n invalid: 1,\n order: 1,\n radius2: 1,\n theta2: 1,\n timeUnitBand: 1,\n timeUnitBandPosition: 1\n};\nexport const VL_ONLY_MARK_CONFIG_PROPERTIES = keys(VL_ONLY_MARK_CONFIG_INDEX);\nexport const VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX = {\n area: ['line', 'point'],\n bar: ['binSpacing', 'continuousBandSize', 'discreteBandSize'],\n rect: ['binSpacing', 'continuousBandSize', 'discreteBandSize'],\n line: ['point'],\n tick: ['bandSize', 'thickness']\n};\nexport const defaultMarkConfig = {\n color: '#4c78a8',\n invalid: 'filter',\n timeUnitBand: 1\n};\nconst MARK_CONFIG_INDEX = {\n mark: 1,\n arc: 1,\n area: 1,\n bar: 1,\n circle: 1,\n image: 1,\n line: 1,\n point: 1,\n rect: 1,\n rule: 1,\n square: 1,\n text: 1,\n tick: 1,\n trail: 1,\n geoshape: 1\n};\nexport const MARK_CONFIGS = keys(MARK_CONFIG_INDEX);\nexport const BAR_CORNER_RADIUS_INDEX = {\n horizontal: ['cornerRadiusTopRight', 'cornerRadiusBottomRight'],\n vertical: ['cornerRadiusTopLeft', 'cornerRadiusTopRight']\n};\nconst DEFAULT_RECT_BAND_SIZE = 5;\nexport const defaultBarConfig = {\n binSpacing: 1,\n continuousBandSize: DEFAULT_RECT_BAND_SIZE,\n timeUnitBandPosition: 0.5\n};\nexport const defaultRectConfig = {\n binSpacing: 0,\n continuousBandSize: DEFAULT_RECT_BAND_SIZE,\n timeUnitBandPosition: 0.5\n};\nexport const defaultTickConfig = {\n thickness: 1\n};\nexport function getMarkType(m) {\n return isMarkDef(m) ? m.type : m;\n}\n//# sourceMappingURL=mark.js.map","import { isFunction, isString } from 'vega-util';\nimport { isCountingAggregateOp } from '../../../aggregate';\nimport { isBinned, isBinning } from '../../../bin';\nimport { getMainRangeChannel, X, X2, Y2 } from '../../../channel';\nimport { binRequiresRange, getBand, isDatumDef, isFieldDef, isFieldOrDatumDef, isTypedFieldDef, isValueDef, vgField } from '../../../channeldef';\nimport { dateTimeToExpr, isDateTime } from '../../../datetime';\nimport { isExprRef } from '../../../expr';\nimport * as log from '../../../log';\nimport { isPathMark } from '../../../mark';\nimport { fieldValidPredicate } from '../../../predicate';\nimport { hasDiscreteDomain, isContinuousToContinuous } from '../../../scale';\nimport { TEMPORAL } from '../../../type';\nimport { contains } from '../../../util';\nimport { isSignalRef } from '../../../vega.schema';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nexport function midPointRefWithPositionInvalidTest(params) {\n const { channel, channelDef, markDef, scale, config } = params;\n const ref = midPoint(params);\n // Wrap to check if the positional value is invalid, if so, plot the point on the min value\n if (\n // Only this for field def without counting aggregate (as count wouldn't be null)\n isFieldDef(channelDef) &&\n !isCountingAggregateOp(channelDef.aggregate) &&\n // and only for continuous scale without zero (otherwise, null / invalid will be interpreted as zero, which doesn't cause layout problem)\n scale &&\n isContinuousToContinuous(scale.get('type')) &&\n scale.get('zero') === false) {\n return wrapPositionInvalidTest({\n fieldDef: channelDef,\n channel,\n markDef,\n ref,\n config\n });\n }\n return ref;\n}\nexport function wrapPositionInvalidTest({ fieldDef, channel, markDef, ref, config }) {\n if (isPathMark(markDef.type)) {\n // path mark already use defined to skip points, no need to do it here.\n return ref;\n }\n const invalid = getMarkPropOrConfig('invalid', markDef, config);\n if (invalid === null) {\n // if there is no invalid filter, don't do the invalid test\n return ref;\n }\n return [fieldInvalidTestValueRef(fieldDef, channel), ref];\n}\nexport function fieldInvalidTestValueRef(fieldDef, channel) {\n const test = fieldInvalidPredicate(fieldDef, true);\n const mainChannel = getMainRangeChannel(channel); // we can cast here as the output can't be other things.\n const zeroValueRef = mainChannel === 'y'\n ? { field: { group: 'height' } }\n : // x / angle / radius can all use 0\n { value: 0 };\n return Object.assign({ test }, zeroValueRef);\n}\nexport function fieldInvalidPredicate(field, invalid = true) {\n return fieldValidPredicate(isString(field) ? field : vgField(field, { expr: 'datum' }), !invalid);\n}\nexport function datumDefToExpr(datumDef) {\n const { datum } = datumDef;\n if (isDateTime(datum)) {\n return dateTimeToExpr(datum);\n }\n return `${JSON.stringify(datum)}`;\n}\nexport function valueRefForFieldOrDatumDef(fieldDef, scaleName, opt, encode) {\n const ref = {};\n if (scaleName) {\n ref.scale = scaleName;\n }\n if (isDatumDef(fieldDef)) {\n const { datum } = fieldDef;\n if (isDateTime(datum)) {\n ref.signal = dateTimeToExpr(datum);\n }\n else if (isSignalRef(datum)) {\n ref.signal = datum.signal;\n }\n else if (isExprRef(datum)) {\n ref.signal = datum.expr;\n }\n else {\n ref.value = datum;\n }\n }\n else {\n ref.field = vgField(fieldDef, opt);\n }\n if (encode) {\n const { offset, band } = encode;\n if (offset) {\n ref.offset = offset;\n }\n if (band) {\n ref.band = band;\n }\n }\n return ref;\n}\n/**\n * Signal that returns the middle of a bin from start and end field. Should only be used with x and y.\n */\nexport function interpolatedSignalRef({ scaleName, fieldOrDatumDef, fieldOrDatumDef2, offset, startSuffix, band = 0.5 }) {\n const expr = 0 < band && band < 1 ? 'datum' : undefined;\n const start = vgField(fieldOrDatumDef, { expr, suffix: startSuffix });\n const end = fieldOrDatumDef2 !== undefined\n ? vgField(fieldOrDatumDef2, { expr })\n : vgField(fieldOrDatumDef, { suffix: 'end', expr });\n const ref = {};\n if (band === 0 || band === 1) {\n ref.scale = scaleName;\n const val = band === 0 ? start : end;\n ref.field = val;\n }\n else {\n const datum = `${band} * ${start} + ${1 - band} * ${end}`;\n ref.signal = `scale(\"${scaleName}\", ${datum})`;\n }\n if (offset) {\n ref.offset = offset;\n }\n return ref;\n}\n/**\n * @returns {VgValueRef} Value Ref for xc / yc or mid point for other channels.\n */\nexport function midPoint({ channel, channelDef, channel2Def, markDef, config, scaleName, scale, stack, offset, defaultRef, band }) {\n var _a;\n // TODO: datum support\n if (channelDef) {\n /* istanbul ignore else */\n if (isFieldOrDatumDef(channelDef)) {\n if (isTypedFieldDef(channelDef)) {\n band = band !== null && band !== void 0 ? band : getBand({\n channel,\n fieldDef: channelDef,\n fieldDef2: channel2Def,\n markDef,\n stack,\n config,\n isMidPoint: true\n });\n const { bin, timeUnit, type } = channelDef;\n if (isBinning(bin) || (band && timeUnit && type === TEMPORAL)) {\n // Use middle only for x an y to place marks in the center between start and end of the bin range.\n // We do not use the mid point for other channels (e.g. size) so that properties of legends and marks match.\n if (stack && stack.impute) {\n // For stack, we computed bin_mid so we can impute.\n return valueRefForFieldOrDatumDef(channelDef, scaleName, { binSuffix: 'mid' }, { offset });\n }\n if (band) {\n // if band = 0, no need to call interpolation\n // For non-stack, we can just calculate bin mid on the fly using signal.\n return interpolatedSignalRef({ scaleName, fieldOrDatumDef: channelDef, band, offset });\n }\n return valueRefForFieldOrDatumDef(channelDef, scaleName, binRequiresRange(channelDef, channel) ? { binSuffix: 'range' } : {}, {\n offset\n });\n }\n else if (isBinned(bin)) {\n if (isFieldDef(channel2Def)) {\n return interpolatedSignalRef({\n scaleName,\n fieldOrDatumDef: channelDef,\n fieldOrDatumDef2: channel2Def,\n band,\n offset\n });\n }\n else {\n const channel2 = channel === X ? X2 : Y2;\n log.warn(log.message.channelRequiredForBinned(channel2));\n }\n }\n }\n const scaleType = scale === null || scale === void 0 ? void 0 : scale.get('type');\n return valueRefForFieldOrDatumDef(channelDef, scaleName, hasDiscreteDomain(scaleType) ? { binSuffix: 'range' } : {}, // no need for bin suffix if there is no scale\n {\n offset,\n // For band, to get mid point, need to offset by half of the band\n band: scaleType === 'band' ? (_a = band !== null && band !== void 0 ? band : channelDef.band) !== null && _a !== void 0 ? _a : 0.5 : undefined\n });\n }\n else if (isValueDef(channelDef)) {\n const value = channelDef.value;\n const offsetMixins = offset ? { offset } : {};\n return Object.assign(Object.assign({}, widthHeightValueOrSignalRef(channel, value)), offsetMixins);\n }\n // If channelDef is neither field def or value def, it's a condition-only def.\n // In such case, we will use default ref.\n }\n if (isFunction(defaultRef)) {\n defaultRef = defaultRef();\n }\n if (defaultRef) {\n // for non-position, ref could be undefined.\n return Object.assign(Object.assign({}, defaultRef), (offset ? { offset } : {}));\n }\n return defaultRef;\n}\n/**\n * Convert special \"width\" and \"height\" values in Vega-Lite into Vega value ref.\n */\nexport function widthHeightValueOrSignalRef(channel, value) {\n if (contains(['x', 'x2'], channel) && value === 'width') {\n return { field: { group: 'width' } };\n }\n else if (contains(['y', 'y2'], channel) && value === 'height') {\n return { field: { group: 'height' } };\n }\n return signalOrValueRef(value);\n}\n//# sourceMappingURL=valueref.js.map","import { isString } from 'vega-util';\nimport { isBinning } from '../bin';\nimport { channelDefType, isFieldDef, isFieldOrDatumDefForTimeFormat, isScaleFieldDef, vgField } from '../channeldef';\nimport { fieldValidPredicate } from '../predicate';\nimport { ScaleType } from '../scale';\nimport { formatExpression, normalizeTimeUnit, timeUnitSpecifierExpression } from '../timeunit';\nimport { QUANTITATIVE } from '../type';\nimport { isSignalRef } from '../vega.schema';\nimport { datumDefToExpr } from './mark/encode/valueref';\nexport function isCustomFormatType(formatType) {\n return formatType && formatType !== 'number' && formatType !== 'time';\n}\nfunction customFormatExpr(formatType, field, format) {\n return `${formatType}(${field}${format ? `, ${JSON.stringify(format)}` : ''})`;\n}\nexport const BIN_RANGE_DELIMITER = ' \\u2013 ';\nexport function formatSignalRef({ fieldOrDatumDef, format, formatType, expr, normalizeStack, config }) {\n var _a, _b;\n if (isCustomFormatType(formatType)) {\n return formatCustomType({\n fieldOrDatumDef,\n format,\n formatType,\n expr,\n config\n });\n }\n const field = fieldToFormat(fieldOrDatumDef, expr, normalizeStack);\n if (isFieldOrDatumDefForTimeFormat(fieldOrDatumDef)) {\n const signal = timeFormatExpression(field, isFieldDef(fieldOrDatumDef) ? (_a = normalizeTimeUnit(fieldOrDatumDef.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit : undefined, format, config.timeFormat, isScaleFieldDef(fieldOrDatumDef) && ((_b = fieldOrDatumDef.scale) === null || _b === void 0 ? void 0 : _b.type) === ScaleType.UTC);\n return signal ? { signal } : undefined;\n }\n format = numberFormat(channelDefType(fieldOrDatumDef), format, config);\n if (isFieldDef(fieldOrDatumDef) && isBinning(fieldOrDatumDef.bin)) {\n const endField = vgField(fieldOrDatumDef, { expr, binSuffix: 'end' });\n return {\n signal: binFormatExpression(field, endField, format, formatType, config)\n };\n }\n else if (format || channelDefType(fieldOrDatumDef) === 'quantitative') {\n return {\n signal: `${formatExpr(field, format)}`\n };\n }\n else {\n return { signal: `isValid(${field}) ? ${field} : \"\"+${field}` };\n }\n}\nfunction fieldToFormat(fieldOrDatumDef, expr, normalizeStack) {\n if (isFieldDef(fieldOrDatumDef)) {\n if (normalizeStack) {\n return `${vgField(fieldOrDatumDef, { expr, suffix: 'end' })}-${vgField(fieldOrDatumDef, {\n expr,\n suffix: 'start'\n })}`;\n }\n else {\n return vgField(fieldOrDatumDef, { expr });\n }\n }\n else {\n return datumDefToExpr(fieldOrDatumDef);\n }\n}\nexport function formatCustomType({ fieldOrDatumDef, format, formatType, expr, normalizeStack, config, field }) {\n field = field !== null && field !== void 0 ? field : fieldToFormat(fieldOrDatumDef, expr, normalizeStack);\n if (isFieldDef(fieldOrDatumDef) && isBinning(fieldOrDatumDef.bin)) {\n const endField = vgField(fieldOrDatumDef, { expr, binSuffix: 'end' });\n return {\n signal: binFormatExpression(field, endField, format, formatType, config)\n };\n }\n return { signal: customFormatExpr(formatType, field, format) };\n}\nexport function guideFormat(fieldOrDatumDef, type, format, formatType, config, omitTimeFormatConfig // axis doesn't use config.timeFormat\n) {\n var _a;\n if (isCustomFormatType(formatType)) {\n return undefined; // handled in encode block\n }\n if (isFieldOrDatumDefForTimeFormat(fieldOrDatumDef)) {\n const timeUnit = isFieldDef(fieldOrDatumDef) ? (_a = normalizeTimeUnit(fieldOrDatumDef.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit : undefined;\n return timeFormat(format, timeUnit, config, omitTimeFormatConfig);\n }\n return numberFormat(type, format, config);\n}\nexport function guideFormatType(formatType, fieldOrDatumDef, scaleType) {\n if (formatType && (isSignalRef(formatType) || formatType === 'number' || formatType === 'time')) {\n return formatType;\n }\n if (isFieldOrDatumDefForTimeFormat(fieldOrDatumDef) && scaleType !== 'time' && scaleType !== 'utc') {\n return 'time';\n }\n return undefined;\n}\n/**\n * Returns number format for a fieldDef.\n */\nexport function numberFormat(type, specifiedFormat, config) {\n // Specified format in axis/legend has higher precedence than fieldDef.format\n if (isString(specifiedFormat)) {\n return specifiedFormat;\n }\n if (type === QUANTITATIVE) {\n // we only apply the default if the field is quantitative\n return config.numberFormat;\n }\n return undefined;\n}\n/**\n * Returns time format for a fieldDef for use in guides.\n */\nexport function timeFormat(specifiedFormat, timeUnit, config, omitTimeFormatConfig) {\n if (specifiedFormat) {\n return specifiedFormat;\n }\n if (timeUnit) {\n return {\n signal: timeUnitSpecifierExpression(timeUnit)\n };\n }\n return omitTimeFormatConfig ? undefined : config.timeFormat;\n}\nfunction formatExpr(field, format) {\n return `format(${field}, \"${format || ''}\")`;\n}\nfunction binNumberFormatExpr(field, format, formatType, config) {\n var _a;\n if (isCustomFormatType(formatType)) {\n return customFormatExpr(formatType, field, format);\n }\n return formatExpr(field, (_a = (isString(format) ? format : undefined)) !== null && _a !== void 0 ? _a : config.numberFormat);\n}\nexport function binFormatExpression(startField, endField, format, formatType, config) {\n const start = binNumberFormatExpr(startField, format, formatType, config);\n const end = binNumberFormatExpr(endField, format, formatType, config);\n return `${fieldValidPredicate(startField, false)} ? \"null\" : ${start} + \"${BIN_RANGE_DELIMITER}\" + ${end}`;\n}\n/**\n * Returns the time expression used for axis/legend labels or text mark for a temporal field\n */\nexport function timeFormatExpression(field, timeUnit, format, rawTimeFormat, // should be provided only for actual text and headers, not axis/legend labels\nisUTCScale) {\n if (!timeUnit || format) {\n // If there is no time unit, or if user explicitly specifies format for axis/legend/text.\n format = isString(format) ? format : rawTimeFormat; // only use provided timeFormat if there is no timeUnit.\n return `${isUTCScale ? 'utc' : 'time'}Format(${field}, '${format}')`;\n }\n else {\n return formatExpression(timeUnit, field, isUTCScale);\n }\n}\n//# sourceMappingURL=format.js.map","import { isArray } from 'vega-util';\nexport const DEFAULT_SORT_OP = 'min';\nconst SORT_BY_CHANNEL_INDEX = {\n x: 1,\n y: 1,\n color: 1,\n fill: 1,\n stroke: 1,\n strokeWidth: 1,\n size: 1,\n shape: 1,\n fillOpacity: 1,\n strokeOpacity: 1,\n opacity: 1,\n text: 1\n};\nexport function isSortByChannel(c) {\n return c in SORT_BY_CHANNEL_INDEX;\n}\nexport function isSortByEncoding(sort) {\n return !!sort && !!sort['encoding'];\n}\nexport function isSortField(sort) {\n return !!sort && (sort['op'] === 'count' || !!sort['field']);\n}\nexport function isSortArray(sort) {\n return !!sort && isArray(sort);\n}\n//# sourceMappingURL=sort.js.map","export function isFacetMapping(f) {\n return 'row' in f || 'column' in f;\n}\nexport function isFacetFieldDef(channelDef) {\n return !!channelDef && 'header' in channelDef;\n}\nexport function isFacetSpec(spec) {\n return 'facet' in spec;\n}\n//# sourceMappingURL=facet.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray, isBoolean, isNumber, isString } from 'vega-util';\nimport { isAggregateOp, isArgmaxDef, isArgminDef, isCountingAggregateOp } from './aggregate';\nimport { autoMaxBins, binToString, isBinned, isBinning } from './bin';\nimport { ANGLE, COLOR, COLUMN, DESCRIPTION, DETAIL, FACET, FILL, FILLOPACITY, HREF, isScaleChannel, isSecondaryRangeChannel, isXorY, KEY, LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2, OPACITY, ORDER, RADIUS, RADIUS2, ROW, SHAPE, SIZE, STROKE, STROKEDASH, STROKEOPACITY, STROKEWIDTH, TEXT, THETA, THETA2, TOOLTIP, URL, X, X2, Y, Y2 } from './channel';\nimport { getMarkConfig } from './compile/common';\nimport { isCustomFormatType } from './compile/format';\nimport { dateTimeToExpr, isDateTime } from './datetime';\nimport { isExprRef } from './expr';\nimport * as log from './log';\nimport { isRectBasedMark } from './mark';\nimport { SCALE_CATEGORY_INDEX } from './scale';\nimport { isSortByChannel } from './sort';\nimport { isFacetFieldDef } from './spec/facet';\nimport { getTimeUnitParts, isLocalSingleTimeUnit, normalizeTimeUnit, timeUnitToString } from './timeunit';\nimport { getFullName, QUANTITATIVE } from './type';\nimport { contains, flatAccessWithDatum, getFirstDefined, internalField, omit, removePathFromField, replacePathInField, titleCase } from './util';\nimport { isSignalRef } from './vega.schema';\nexport function isConditionalSelection(c) {\n return c['selection'];\n}\nexport function isRepeatRef(field) {\n return field && !isString(field) && 'repeat' in field;\n}\nexport function toFieldDefBase(fieldDef) {\n const { field, timeUnit, bin, aggregate } = fieldDef;\n return Object.assign(Object.assign(Object.assign(Object.assign({}, (timeUnit ? { timeUnit } : {})), (bin ? { bin } : {})), (aggregate ? { aggregate } : {})), { field });\n}\nexport function isSortableFieldDef(fieldDef) {\n return 'sort' in fieldDef;\n}\nexport function getBand({ channel, fieldDef, fieldDef2, markDef: mark, stack, config, isMidPoint }) {\n if (isFieldOrDatumDef(fieldDef) && fieldDef.band !== undefined) {\n return fieldDef.band;\n }\n if (isFieldDef(fieldDef)) {\n const { timeUnit, bin } = fieldDef;\n if (timeUnit && !fieldDef2) {\n if (isMidPoint) {\n return getMarkConfig('timeUnitBandPosition', mark, config);\n }\n else {\n return isRectBasedMark(mark.type) ? getMarkConfig('timeUnitBand', mark, config) : 0;\n }\n }\n else if (isBinning(bin)) {\n return isRectBasedMark(mark.type) && !isMidPoint ? 1 : 0.5;\n }\n }\n if ((stack === null || stack === void 0 ? void 0 : stack.fieldChannel) === channel && isMidPoint) {\n return 0.5;\n }\n return undefined;\n}\nexport function hasBand(channel, fieldDef, fieldDef2, stack, markDef, config) {\n if (isBinning(fieldDef.bin) || (fieldDef.timeUnit && isTypedFieldDef(fieldDef) && fieldDef.type === 'temporal')) {\n return !!getBand({ channel, fieldDef, fieldDef2, stack, markDef, config });\n }\n return false;\n}\nexport function isConditionalDef(channelDef) {\n return !!channelDef && 'condition' in channelDef;\n}\n/**\n * Return if a channelDef is a ConditionalValueDef with ConditionFieldDef\n */\nexport function hasConditionalFieldDef(channelDef) {\n const condition = channelDef && channelDef['condition'];\n return !!condition && !isArray(condition) && isFieldDef(condition);\n}\nexport function hasConditionalFieldOrDatumDef(channelDef) {\n const condition = channelDef && channelDef['condition'];\n return !!condition && !isArray(condition) && isFieldOrDatumDef(condition);\n}\nexport function hasConditionalValueDef(channelDef) {\n const condition = channelDef && channelDef['condition'];\n return !!condition && (isArray(condition) || isValueDef(condition));\n}\nexport function isFieldDef(channelDef) {\n // TODO: we can't use field in channelDef here as it's somehow failing runtime test\n return !!channelDef && (!!channelDef['field'] || channelDef['aggregate'] === 'count');\n}\nexport function channelDefType(channelDef) {\n return channelDef && channelDef['type'];\n}\nexport function isDatumDef(channelDef) {\n return !!channelDef && 'datum' in channelDef;\n}\nexport function isContinuousFieldOrDatumDef(cd) {\n // TODO: make datum support DateTime object\n return (isTypedFieldDef(cd) && isContinuous(cd)) || isNumericDataDef(cd);\n}\nexport function isQuantitativeFieldOrDatumDef(cd) {\n // TODO: make datum support DateTime object\n return channelDefType(cd) === 'quantitative' || isNumericDataDef(cd);\n}\nexport function isNumericDataDef(cd) {\n return isDatumDef(cd) && isNumber(cd.datum);\n}\nexport function isFieldOrDatumDef(channelDef) {\n return isFieldDef(channelDef) || isDatumDef(channelDef);\n}\nexport function isTypedFieldDef(channelDef) {\n return !!channelDef && ('field' in channelDef || channelDef['aggregate'] === 'count') && 'type' in channelDef;\n}\nexport function isValueDef(channelDef) {\n return channelDef && 'value' in channelDef && 'value' in channelDef;\n}\nexport function isScaleFieldDef(channelDef) {\n return !!channelDef && ('scale' in channelDef || 'sort' in channelDef);\n}\nexport function isPositionFieldOrDatumDef(channelDef) {\n return channelDef && ('axis' in channelDef || 'stack' in channelDef || 'impute' in channelDef);\n}\nexport function isMarkPropFieldOrDatumDef(channelDef) {\n return !!channelDef && 'legend' in channelDef;\n}\nexport function isStringFieldOrDatumDef(channelDef) {\n return !!channelDef && ('format' in channelDef || 'formatType' in channelDef);\n}\nexport function toStringFieldDef(fieldDef) {\n // omit properties that don't exist in string field defs\n return omit(fieldDef, ['legend', 'axis', 'header', 'scale']);\n}\nfunction isOpFieldDef(fieldDef) {\n return 'op' in fieldDef;\n}\n/**\n * Get a Vega field reference from a Vega-Lite field def.\n */\nexport function vgField(fieldDef, opt = {}) {\n var _a, _b, _c;\n let field = fieldDef.field;\n const prefix = opt.prefix;\n let suffix = opt.suffix;\n let argAccessor = ''; // for accessing argmin/argmax field at the end without getting escaped\n if (isCount(fieldDef)) {\n field = internalField('count');\n }\n else {\n let fn;\n if (!opt.nofn) {\n if (isOpFieldDef(fieldDef)) {\n fn = fieldDef.op;\n }\n else {\n const { bin, aggregate, timeUnit } = fieldDef;\n if (isBinning(bin)) {\n fn = binToString(bin);\n suffix = ((_a = opt.binSuffix) !== null && _a !== void 0 ? _a : '') + ((_b = opt.suffix) !== null && _b !== void 0 ? _b : '');\n }\n else if (aggregate) {\n if (isArgmaxDef(aggregate)) {\n argAccessor = `[\"${field}\"]`;\n field = `argmax_${aggregate.argmax}`;\n }\n else if (isArgminDef(aggregate)) {\n argAccessor = `[\"${field}\"]`;\n field = `argmin_${aggregate.argmin}`;\n }\n else {\n fn = String(aggregate);\n }\n }\n else if (timeUnit) {\n fn = timeUnitToString(timeUnit);\n suffix = ((!contains(['range', 'mid'], opt.binSuffix) && opt.binSuffix) || '') + ((_c = opt.suffix) !== null && _c !== void 0 ? _c : '');\n }\n }\n }\n if (fn) {\n field = field ? `${fn}_${field}` : fn;\n }\n }\n if (suffix) {\n field = `${field}_${suffix}`;\n }\n if (prefix) {\n field = `${prefix}_${field}`;\n }\n if (opt.forAs) {\n return removePathFromField(field);\n }\n else if (opt.expr) {\n // Expression to access flattened field. No need to escape dots.\n return flatAccessWithDatum(field, opt.expr) + argAccessor;\n }\n else {\n // We flattened all fields so paths should have become dot.\n return replacePathInField(field) + argAccessor;\n }\n}\nexport function isDiscrete(def) {\n switch (def.type) {\n case 'nominal':\n case 'ordinal':\n case 'geojson':\n return true;\n case 'quantitative':\n return isFieldDef(def) && !!def.bin;\n case 'temporal':\n return false;\n }\n throw new Error(log.message.invalidFieldType(def.type));\n}\nexport function isContinuous(fieldDef) {\n return !isDiscrete(fieldDef);\n}\nexport function isCount(fieldDef) {\n return fieldDef.aggregate === 'count';\n}\nexport function verbalTitleFormatter(fieldDef, config) {\n var _a;\n const { field, bin, timeUnit, aggregate } = fieldDef;\n if (aggregate === 'count') {\n return config.countTitle;\n }\n else if (isBinning(bin)) {\n return `${field} (binned)`;\n }\n else if (timeUnit) {\n const unit = (_a = normalizeTimeUnit(timeUnit)) === null || _a === void 0 ? void 0 : _a.unit;\n if (unit) {\n return `${field} (${getTimeUnitParts(unit).join('-')})`;\n }\n }\n else if (aggregate) {\n if (isArgmaxDef(aggregate)) {\n return `${field} for max ${aggregate.argmax}`;\n }\n else if (isArgminDef(aggregate)) {\n return `${field} for min ${aggregate.argmin}`;\n }\n else {\n return `${titleCase(aggregate)} of ${field}`;\n }\n }\n return field;\n}\nexport function functionalTitleFormatter(fieldDef) {\n const { aggregate, bin, timeUnit, field } = fieldDef;\n if (isArgmaxDef(aggregate)) {\n return `${field} for argmax(${aggregate.argmax})`;\n }\n else if (isArgminDef(aggregate)) {\n return `${field} for argmin(${aggregate.argmin})`;\n }\n const timeUnitParams = normalizeTimeUnit(timeUnit);\n const fn = aggregate || (timeUnitParams === null || timeUnitParams === void 0 ? void 0 : timeUnitParams.unit) || ((timeUnitParams === null || timeUnitParams === void 0 ? void 0 : timeUnitParams.maxbins) && 'timeunit') || (isBinning(bin) && 'bin');\n if (fn) {\n return fn.toUpperCase() + '(' + field + ')';\n }\n else {\n return field;\n }\n}\nexport const defaultTitleFormatter = (fieldDef, config) => {\n switch (config.fieldTitle) {\n case 'plain':\n return fieldDef.field;\n case 'functional':\n return functionalTitleFormatter(fieldDef);\n default:\n return verbalTitleFormatter(fieldDef, config);\n }\n};\nlet titleFormatter = defaultTitleFormatter;\nexport function setTitleFormatter(formatter) {\n titleFormatter = formatter;\n}\nexport function resetTitleFormatter() {\n setTitleFormatter(defaultTitleFormatter);\n}\nexport function title(fieldOrDatumDef, config, { allowDisabling, includeDefault = true }) {\n var _a, _b;\n const guideTitle = (_a = getGuide(fieldOrDatumDef)) === null || _a === void 0 ? void 0 : _a.title;\n if (!isFieldDef(fieldOrDatumDef)) {\n return guideTitle;\n }\n const fieldDef = fieldOrDatumDef;\n const def = includeDefault ? defaultTitle(fieldDef, config) : undefined;\n if (allowDisabling) {\n return getFirstDefined(guideTitle, fieldDef.title, def);\n }\n else {\n return (_b = guideTitle !== null && guideTitle !== void 0 ? guideTitle : fieldDef.title) !== null && _b !== void 0 ? _b : def;\n }\n}\nexport function getGuide(fieldDef) {\n if (isPositionFieldOrDatumDef(fieldDef) && fieldDef.axis) {\n return fieldDef.axis;\n }\n else if (isMarkPropFieldOrDatumDef(fieldDef) && fieldDef.legend) {\n return fieldDef.legend;\n }\n else if (isFacetFieldDef(fieldDef) && fieldDef.header) {\n return fieldDef.header;\n }\n return undefined;\n}\nexport function defaultTitle(fieldDef, config) {\n return titleFormatter(fieldDef, config);\n}\nexport function getFormatMixins(fieldDef) {\n var _a;\n if (isStringFieldOrDatumDef(fieldDef)) {\n const { format, formatType } = fieldDef;\n return { format, formatType };\n }\n else {\n const guide = (_a = getGuide(fieldDef)) !== null && _a !== void 0 ? _a : {};\n const { format, formatType } = guide;\n return { format, formatType };\n }\n}\nexport function defaultType(fieldDef, channel) {\n var _a;\n switch (channel) {\n case 'latitude':\n case 'longitude':\n return 'quantitative';\n case 'row':\n case 'column':\n case 'facet':\n case 'shape':\n case 'strokeDash':\n return 'nominal';\n case 'order':\n return 'ordinal';\n }\n if (isSortableFieldDef(fieldDef) && isArray(fieldDef.sort)) {\n return 'ordinal';\n }\n const { aggregate, bin, timeUnit } = fieldDef;\n if (timeUnit) {\n return 'temporal';\n }\n if (bin || (aggregate && !isArgmaxDef(aggregate) && !isArgminDef(aggregate))) {\n return 'quantitative';\n }\n if (isScaleFieldDef(fieldDef) && ((_a = fieldDef.scale) === null || _a === void 0 ? void 0 : _a.type)) {\n switch (SCALE_CATEGORY_INDEX[fieldDef.scale.type]) {\n case 'numeric':\n case 'discretizing':\n return 'quantitative';\n case 'time':\n return 'temporal';\n }\n }\n return 'nominal';\n}\n/**\n * Returns the fieldDef -- either from the outer channelDef or from the condition of channelDef.\n * @param channelDef\n */\nexport function getFieldDef(channelDef) {\n if (isFieldDef(channelDef)) {\n return channelDef;\n }\n else if (hasConditionalFieldDef(channelDef)) {\n return channelDef.condition;\n }\n return undefined;\n}\nexport function getFieldOrDatumDef(channelDef) {\n if (isFieldOrDatumDef(channelDef)) {\n return channelDef;\n }\n else if (hasConditionalFieldOrDatumDef(channelDef)) {\n return channelDef.condition;\n }\n return undefined;\n}\n/**\n * Convert type to full, lowercase type, or augment the fieldDef with a default type if missing.\n */\nexport function initChannelDef(channelDef, channel, config, opt = {}) {\n if (isString(channelDef) || isNumber(channelDef) || isBoolean(channelDef)) {\n const primitiveType = isString(channelDef) ? 'string' : isNumber(channelDef) ? 'number' : 'boolean';\n log.warn(log.message.primitiveChannelDef(channel, primitiveType, channelDef));\n return { value: channelDef };\n }\n // If a fieldDef contains a field, we need type.\n if (isFieldOrDatumDef(channelDef)) {\n return initFieldOrDatumDef(channelDef, channel, config, opt);\n }\n else if (hasConditionalFieldOrDatumDef(channelDef)) {\n return Object.assign(Object.assign({}, channelDef), { \n // Need to cast as normalizeFieldDef normally return FieldDef, but here we know that it is definitely Condition\n condition: initFieldOrDatumDef(channelDef.condition, channel, config, opt) });\n }\n return channelDef;\n}\nexport function initFieldOrDatumDef(fd, channel, config, opt) {\n if (isStringFieldOrDatumDef(fd)) {\n const { format, formatType } = fd, rest = __rest(fd, [\"format\", \"formatType\"]);\n if (isCustomFormatType(formatType) && !config.customFormatTypes) {\n log.warn(log.message.customFormatTypeNotAllowed(channel));\n return initFieldOrDatumDef(rest, channel, config, opt);\n }\n }\n else {\n const guideType = isPositionFieldOrDatumDef(fd)\n ? 'axis'\n : isMarkPropFieldOrDatumDef(fd)\n ? 'legend'\n : isFacetFieldDef(fd)\n ? 'header'\n : null;\n if (guideType && fd[guideType]) {\n const _a = fd[guideType], { format, formatType } = _a, newGuide = __rest(_a, [\"format\", \"formatType\"]);\n if (isCustomFormatType(formatType) && !config.customFormatTypes) {\n log.warn(log.message.customFormatTypeNotAllowed(channel));\n return initFieldOrDatumDef(Object.assign(Object.assign({}, fd), { [guideType]: newGuide }), channel, config, opt);\n }\n }\n }\n if (isFieldDef(fd)) {\n return initFieldDef(fd, channel, opt);\n }\n return initDatumDef(fd);\n}\nfunction initDatumDef(datumDef) {\n let type = datumDef['type'];\n if (type) {\n return datumDef;\n }\n const { datum } = datumDef;\n type = isNumber(datum) ? 'quantitative' : isString(datum) ? 'nominal' : isDateTime(datum) ? 'temporal' : undefined;\n return Object.assign(Object.assign({}, datumDef), { type });\n}\nexport function initFieldDef(fd, channel, { compositeMark = false } = {}) {\n const { aggregate, timeUnit, bin, field } = fd;\n const fieldDef = Object.assign({}, fd);\n // Drop invalid aggregate\n if (!compositeMark && aggregate && !isAggregateOp(aggregate) && !isArgmaxDef(aggregate) && !isArgminDef(aggregate)) {\n log.warn(log.message.invalidAggregate(aggregate));\n delete fieldDef.aggregate;\n }\n // Normalize Time Unit\n if (timeUnit) {\n fieldDef.timeUnit = normalizeTimeUnit(timeUnit);\n }\n if (field) {\n fieldDef.field = `${field}`;\n }\n // Normalize bin\n if (isBinning(bin)) {\n fieldDef.bin = normalizeBin(bin, channel);\n }\n if (isBinned(bin) && !isXorY(channel)) {\n log.warn(log.message.channelShouldNotBeUsedForBinned(channel));\n }\n // Normalize Type\n if (isTypedFieldDef(fieldDef)) {\n const { type } = fieldDef;\n const fullType = getFullName(type);\n if (type !== fullType) {\n // convert short type to full type\n fieldDef.type = fullType;\n }\n if (type !== 'quantitative') {\n if (isCountingAggregateOp(aggregate)) {\n log.warn(log.message.invalidFieldTypeForCountAggregate(type, aggregate));\n fieldDef.type = 'quantitative';\n }\n }\n }\n else if (!isSecondaryRangeChannel(channel)) {\n // If type is empty / invalid, then augment with default type\n const newType = defaultType(fieldDef, channel);\n fieldDef['type'] = newType;\n }\n if (isTypedFieldDef(fieldDef)) {\n const { compatible, warning } = channelCompatibility(fieldDef, channel) || {};\n if (compatible === false) {\n log.warn(warning);\n }\n }\n if (isSortableFieldDef(fieldDef) && isString(fieldDef.sort)) {\n const { sort } = fieldDef;\n if (isSortByChannel(sort)) {\n return Object.assign(Object.assign({}, fieldDef), { sort: { encoding: sort } });\n }\n const sub = sort.substr(1);\n if (sort.charAt(0) === '-' && isSortByChannel(sub)) {\n return Object.assign(Object.assign({}, fieldDef), { sort: { encoding: sub, order: 'descending' } });\n }\n }\n if (isFacetFieldDef(fieldDef)) {\n const { header } = fieldDef;\n const { orient } = header, rest = __rest(header, [\"orient\"]);\n if (orient) {\n return Object.assign(Object.assign({}, fieldDef), { header: Object.assign(Object.assign({}, rest), { labelOrient: header.labelOrient || orient, titleOrient: header.titleOrient || orient }) });\n }\n }\n return fieldDef;\n}\nexport function normalizeBin(bin, channel) {\n if (isBoolean(bin)) {\n return { maxbins: autoMaxBins(channel) };\n }\n else if (bin === 'binned') {\n return {\n binned: true\n };\n }\n else if (!bin.maxbins && !bin.step) {\n return Object.assign(Object.assign({}, bin), { maxbins: autoMaxBins(channel) });\n }\n else {\n return bin;\n }\n}\nconst COMPATIBLE = { compatible: true };\nexport function channelCompatibility(fieldDef, channel) {\n const type = fieldDef.type;\n if (type === 'geojson' && channel !== 'shape') {\n return {\n compatible: false,\n warning: `Channel ${channel} should not be used with a geojson data.`\n };\n }\n switch (channel) {\n case ROW:\n case COLUMN:\n case FACET:\n if (isContinuous(fieldDef)) {\n return {\n compatible: false,\n warning: log.message.facetChannelShouldBeDiscrete(channel)\n };\n }\n return COMPATIBLE;\n case X:\n case Y:\n case COLOR:\n case FILL:\n case STROKE:\n case TEXT:\n case DETAIL:\n case KEY:\n case TOOLTIP:\n case HREF:\n case URL:\n case ANGLE:\n case THETA:\n case RADIUS:\n case DESCRIPTION:\n return COMPATIBLE;\n case LONGITUDE:\n case LONGITUDE2:\n case LATITUDE:\n case LATITUDE2:\n if (type !== QUANTITATIVE) {\n return {\n compatible: false,\n warning: `Channel ${channel} should be used with a quantitative field only, not ${fieldDef.type} field.`\n };\n }\n return COMPATIBLE;\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n case STROKEWIDTH:\n case SIZE:\n case THETA2:\n case RADIUS2:\n case X2:\n case Y2:\n if (type === 'nominal' && !fieldDef['sort']) {\n return {\n compatible: false,\n warning: `Channel ${channel} should not be used with an unsorted discrete field.`\n };\n }\n return COMPATIBLE;\n case STROKEDASH:\n if (!contains(['ordinal', 'nominal'], fieldDef.type)) {\n return {\n compatible: false,\n warning: 'StrokeDash channel should be used with only discrete data.'\n };\n }\n return COMPATIBLE;\n case SHAPE:\n if (!contains(['ordinal', 'nominal', 'geojson'], fieldDef.type)) {\n return {\n compatible: false,\n warning: 'Shape channel should be used with only either discrete or geojson data.'\n };\n }\n return COMPATIBLE;\n case ORDER:\n if (fieldDef.type === 'nominal' && !('sort' in fieldDef)) {\n return {\n compatible: false,\n warning: `Channel order is inappropriate for nominal field, which has no inherent order.`\n };\n }\n return COMPATIBLE;\n }\n}\n/**\n * Check if the field def uses a time format or does not use any format but is temporal\n * (this does not cover field defs that are temporal but use a number format).\n */\nexport function isFieldOrDatumDefForTimeFormat(fieldOrDatumDef) {\n const { formatType } = getFormatMixins(fieldOrDatumDef);\n return formatType === 'time' || (!formatType && isTimeFieldDef(fieldOrDatumDef));\n}\n/**\n * Check if field def has type `temporal`. If you want to also cover field defs that use a time format, use `isTimeFormatFieldDef`.\n */\nexport function isTimeFieldDef(def) {\n return def && (def['type'] === 'temporal' || (isFieldDef(def) && !!def.timeUnit));\n}\n/**\n * Getting a value associated with a fielddef.\n * Convert the value to Vega expression if applicable (for datetime object, or string if the field def is temporal or has timeUnit)\n */\nexport function valueExpr(v, { timeUnit, type, wrapTime, undefinedIfExprNotRequired }) {\n var _a;\n const unit = timeUnit && ((_a = normalizeTimeUnit(timeUnit)) === null || _a === void 0 ? void 0 : _a.unit);\n let isTime = unit || type === 'temporal';\n let expr;\n if (isExprRef(v)) {\n expr = v.expr;\n }\n else if (isSignalRef(v)) {\n expr = v.signal;\n }\n else if (isDateTime(v)) {\n isTime = true;\n expr = dateTimeToExpr(v);\n }\n else if (isString(v) || isNumber(v)) {\n if (isTime) {\n expr = `datetime(${JSON.stringify(v)})`;\n if (isLocalSingleTimeUnit(unit)) {\n // for single timeUnit, we will use dateTimeToExpr to convert number/string to match the timeUnit\n if ((isNumber(v) && v < 10000) || (isString(v) && isNaN(Date.parse(v)))) {\n expr = dateTimeToExpr({ [unit]: v });\n }\n }\n }\n }\n if (expr) {\n return wrapTime && isTime ? `time(${expr})` : expr;\n }\n // number or boolean or normal string\n return undefinedIfExprNotRequired ? undefined : JSON.stringify(v);\n}\n/**\n * Standardize value array -- convert each value to Vega expression if applicable\n */\nexport function valueArray(fieldOrDatumDef, values) {\n const { type } = fieldOrDatumDef;\n return values.map(v => {\n const expr = valueExpr(v, {\n timeUnit: isFieldDef(fieldOrDatumDef) ? fieldOrDatumDef.timeUnit : undefined,\n type,\n undefinedIfExprNotRequired: true\n });\n // return signal for the expression if we need an expression\n if (expr !== undefined) {\n return { signal: expr };\n }\n // otherwise just return the original value\n return v;\n });\n}\n/**\n * Checks whether a fieldDef for a particular channel requires a computed bin range.\n */\nexport function binRequiresRange(fieldDef, channel) {\n if (!isBinning(fieldDef.bin)) {\n console.warn('Only call this method for binned field defs.');\n return false;\n }\n // We need the range only when the user explicitly forces a binned field to be use discrete scale. In this case, bin range is used in axis and legend labels.\n // We could check whether the axis or legend exists (not disabled) but that seems overkill.\n return isScaleChannel(channel) && contains(['ordinal', 'nominal'], fieldDef.type);\n}\n//# sourceMappingURL=channeldef.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray, isString } from 'vega-util';\nimport { pick } from './util';\nexport function extractTitleConfig(titleConfig) {\n const { \n // These are non-mark title config that need to be hardcoded\n anchor, frame, offset, orient, \n // color needs to be redirect to fill\n color, \n // subtitle properties\n subtitleColor, subtitleFont, subtitleFontSize, subtitleFontStyle, subtitleFontWeight, subtitleLineHeight, subtitlePadding } = titleConfig, \n // The rest are mark config.\n rest = __rest(titleConfig, [\"anchor\", \"frame\", \"offset\", \"orient\", \"color\", \"subtitleColor\", \"subtitleFont\", \"subtitleFontSize\", \"subtitleFontStyle\", \"subtitleFontWeight\", \"subtitleLineHeight\", \"subtitlePadding\"]);\n const titleMarkConfig = Object.assign(Object.assign({}, rest), (color ? { fill: color } : {}));\n // These are non-mark title config that need to be hardcoded\n const nonMark = Object.assign(Object.assign(Object.assign(Object.assign({}, (anchor ? { anchor } : {})), (frame ? { frame } : {})), (offset ? { offset } : {})), (orient ? { orient } : {}));\n // subtitle part can stay in config.title since header titles do not use subtitle\n const subtitle = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (subtitleColor ? { subtitleColor } : {})), (subtitleFont ? { subtitleFont } : {})), (subtitleFontSize ? { subtitleFontSize } : {})), (subtitleFontStyle ? { subtitleFontStyle } : {})), (subtitleFontWeight ? { subtitleFontWeight } : {})), (subtitleLineHeight ? { subtitleLineHeight } : {})), (subtitlePadding ? { subtitlePadding } : {}));\n const subtitleMarkConfig = pick(titleMarkConfig, ['align', 'baseline', 'dx', 'dy', 'limit']);\n return { titleMarkConfig, subtitleMarkConfig, nonMark, subtitle };\n}\nexport function isText(v) {\n return isString(v) || (isArray(v) && isString(v[0]));\n}\n//# sourceMappingURL=title.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array, isArray, stringValue } from 'vega-util';\nimport { vgField } from '../channeldef';\nimport { isExprRef } from '../expr';\nimport { isText } from '../title';\nimport { deepEqual, getFirstDefined } from '../util';\nimport { isSignalRef } from '../vega.schema';\nexport const BIN_RANGE_DELIMITER = ' \\u2013 ';\nexport function signalOrValueRefWithCondition(val) {\n const condition = isArray(val.condition)\n ? val.condition.map(conditionalSignalRefOrValue)\n : conditionalSignalRefOrValue(val.condition);\n return Object.assign(Object.assign({}, signalRefOrValue(val)), { condition });\n}\nexport function signalRefOrValue(value) {\n if (isExprRef(value)) {\n const { expr } = value, rest = __rest(value, [\"expr\"]);\n return Object.assign({ signal: expr }, rest);\n }\n return value;\n}\nexport function conditionalSignalRefOrValue(value) {\n if (isExprRef(value)) {\n const { expr } = value, rest = __rest(value, [\"expr\"]);\n return Object.assign({ signal: expr }, rest);\n }\n return value;\n}\nexport function signalOrValueRef(value) {\n if (isExprRef(value)) {\n const { expr } = value, rest = __rest(value, [\"expr\"]);\n return Object.assign({ signal: expr }, rest);\n }\n if (isSignalRef(value)) {\n return value;\n }\n return value !== undefined ? { value } : undefined;\n}\nexport function exprFromValueOrSignalRef(ref) {\n if (isSignalRef(ref)) {\n return ref.signal;\n }\n return stringValue(ref.value);\n}\nexport function signalOrStringValue(v) {\n if (isSignalRef(v)) {\n return v.signal;\n }\n return v == null ? null : stringValue(v);\n}\nexport function applyMarkConfig(e, model, propsList) {\n for (const property of propsList) {\n const value = getMarkConfig(property, model.markDef, model.config);\n if (value !== undefined) {\n e[property] = signalOrValueRef(value);\n }\n }\n return e;\n}\nexport function getStyles(mark) {\n var _a;\n return [].concat(mark.type, (_a = mark.style) !== null && _a !== void 0 ? _a : []);\n}\nexport function getMarkPropOrConfig(channel, mark, config, opt = {}) {\n const { vgChannel, ignoreVgConfig } = opt;\n if (vgChannel && mark[vgChannel] !== undefined) {\n return mark[vgChannel];\n }\n else if (mark[channel] !== undefined) {\n return mark[channel];\n }\n else if (ignoreVgConfig && (!vgChannel || vgChannel === channel)) {\n return undefined;\n }\n return getMarkConfig(channel, mark, config, opt);\n}\n/**\n * Return property value from style or mark specific config property if exists.\n * Otherwise, return general mark specific config.\n */\nexport function getMarkConfig(channel, mark, config, { vgChannel } = {}) {\n return getFirstDefined(\n // style config has highest precedence\n vgChannel ? getMarkStyleConfig(channel, mark, config.style) : undefined, getMarkStyleConfig(channel, mark, config.style), \n // then mark-specific config\n vgChannel ? config[mark.type][vgChannel] : undefined, config[mark.type][channel], // Need to cast because MarkDef doesn't perfectly match with AnyMarkConfig, but if the type isn't available, we'll get nothing here, which is fine\n // If there is vgChannel, skip vl channel.\n // For example, vl size for text is vg fontSize, but config.mark.size is only for point size.\n vgChannel ? config.mark[vgChannel] : config.mark[channel] // Need to cast for the same reason as above\n );\n}\nexport function getMarkStyleConfig(prop, mark, styleConfigIndex) {\n return getStyleConfig(prop, getStyles(mark), styleConfigIndex);\n}\nexport function getStyleConfig(p, styles, styleConfigIndex) {\n styles = array(styles);\n let value;\n for (const style of styles) {\n const styleConfig = styleConfigIndex[style];\n if (styleConfig && styleConfig[p] !== undefined) {\n value = styleConfig[p];\n }\n }\n return value;\n}\n/**\n * Return Vega sort parameters (tuple of field and order).\n */\nexport function sortParams(orderDef, fieldRefOption) {\n return array(orderDef).reduce((s, orderChannelDef) => {\n var _a;\n s.field.push(vgField(orderChannelDef, fieldRefOption));\n s.order.push((_a = orderChannelDef.sort) !== null && _a !== void 0 ? _a : 'ascending');\n return s;\n }, { field: [], order: [] });\n}\nexport function mergeTitleFieldDefs(f1, f2) {\n const merged = [...f1];\n f2.forEach(fdToMerge => {\n for (const fieldDef1 of merged) {\n // If already exists, no need to append to merged array\n if (deepEqual(fieldDef1, fdToMerge)) {\n return;\n }\n }\n merged.push(fdToMerge);\n });\n return merged;\n}\nexport function mergeTitle(title1, title2) {\n if (deepEqual(title1, title2) || !title2) {\n // if titles are the same or title2 is falsy\n return title1;\n }\n else if (!title1) {\n // if title1 is falsy\n return title2;\n }\n else {\n return [...array(title1), ...array(title2)].join(', ');\n }\n}\nexport function mergeTitleComponent(v1, v2) {\n const v1Val = v1.value;\n const v2Val = v2.value;\n if (v1Val == null || v2Val === null) {\n return {\n explicit: v1.explicit,\n value: null\n };\n }\n else if ((isText(v1Val) || isSignalRef(v1Val)) && (isText(v2Val) || isSignalRef(v2Val))) {\n return {\n explicit: v1.explicit,\n value: mergeTitle(v1Val, v2Val)\n };\n }\n else if (isText(v1Val) || isSignalRef(v1Val)) {\n return {\n explicit: v1.explicit,\n value: v1Val\n };\n }\n else if (isText(v2Val) || isSignalRef(v2Val)) {\n return {\n explicit: v1.explicit,\n value: v2Val\n };\n }\n else if (!isText(v1Val) && !isSignalRef(v1Val) && !isText(v2Val) && !isSignalRef(v2Val)) {\n return {\n explicit: v1.explicit,\n value: mergeTitleFieldDefs(v1Val, v2Val)\n };\n }\n /* istanbul ignore next: Condition should not happen -- only for warning in development. */\n throw new Error('It should never reach here');\n}\n//# sourceMappingURL=common.js.map","export function isUnitSpec(spec) {\n return 'mark' in spec;\n}\n//# sourceMappingURL=unit.js.map","import { getMarkType } from '../mark';\nimport { isUnitSpec } from '../spec/unit';\nexport class CompositeMarkNormalizer {\n constructor(name, run) {\n this.name = name;\n this.run = run;\n }\n hasMatchingType(spec) {\n if (isUnitSpec(spec)) {\n return getMarkType(spec.mark) === this.name;\n }\n return false;\n }\n}\n//# sourceMappingURL=base.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array, isArray } from 'vega-util';\nimport { isArgmaxDef, isArgminDef } from './aggregate';\nimport { isBinned, isBinning } from './bin';\nimport { ANGLE, CHANNELS, COLOR, DESCRIPTION, DETAIL, FILL, FILLOPACITY, HREF, isChannel, isNonPositionScaleChannel, isSecondaryRangeChannel, isXorY, KEY, LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2, OPACITY, ORDER, RADIUS, RADIUS2, SHAPE, SIZE, STROKE, STROKEDASH, STROKEOPACITY, STROKEWIDTH, supportMark, TEXT, THETA, THETA2, TOOLTIP, URL, X, X2, Y, Y2 } from './channel';\nimport { binRequiresRange, getFieldDef, getGuide, hasConditionalFieldDef, initChannelDef, initFieldDef, isConditionalDef, isDatumDef, isFieldDef, isTypedFieldDef, isValueDef, title, vgField } from './channeldef';\nimport * as log from './log';\nimport { QUANTITATIVE, TEMPORAL } from './type';\nimport { keys, some } from './util';\nimport { isSignalRef } from './vega.schema';\nexport function channelHasField(encoding, channel) {\n const channelDef = encoding && encoding[channel];\n if (channelDef) {\n if (isArray(channelDef)) {\n return some(channelDef, fieldDef => !!fieldDef.field);\n }\n else {\n return isFieldDef(channelDef) || hasConditionalFieldDef(channelDef);\n }\n }\n return false;\n}\nexport function isAggregate(encoding) {\n return some(CHANNELS, channel => {\n if (channelHasField(encoding, channel)) {\n const channelDef = encoding[channel];\n if (isArray(channelDef)) {\n return some(channelDef, fieldDef => !!fieldDef.aggregate);\n }\n else {\n const fieldDef = getFieldDef(channelDef);\n return fieldDef && !!fieldDef.aggregate;\n }\n }\n return false;\n });\n}\nexport function extractTransformsFromEncoding(oldEncoding, config) {\n const groupby = [];\n const bins = [];\n const timeUnits = [];\n const aggregate = [];\n const encoding = {};\n forEach(oldEncoding, (channelDef, channel) => {\n // Extract potential embedded transformations along with remaining properties\n if (isFieldDef(channelDef)) {\n const { field, aggregate: aggOp, bin, timeUnit } = channelDef, remaining = __rest(channelDef, [\"field\", \"aggregate\", \"bin\", \"timeUnit\"]);\n if (aggOp || timeUnit || bin) {\n const guide = getGuide(channelDef);\n const isTitleDefined = guide && guide.title;\n let newField = vgField(channelDef, { forAs: true });\n const newFieldDef = Object.assign(Object.assign(Object.assign({}, (isTitleDefined ? [] : { title: title(channelDef, config, { allowDisabling: true }) })), remaining), { \n // Always overwrite field\n field: newField });\n if (aggOp) {\n let op;\n if (isArgmaxDef(aggOp)) {\n op = 'argmax';\n newField = vgField({ op: 'argmax', field: aggOp.argmax }, { forAs: true });\n newFieldDef.field = `${newField}.${field}`;\n }\n else if (isArgminDef(aggOp)) {\n op = 'argmin';\n newField = vgField({ op: 'argmin', field: aggOp.argmin }, { forAs: true });\n newFieldDef.field = `${newField}.${field}`;\n }\n else if (aggOp !== 'boxplot' && aggOp !== 'errorbar' && aggOp !== 'errorband') {\n op = aggOp;\n }\n if (op) {\n const aggregateEntry = {\n op,\n as: newField\n };\n if (field) {\n aggregateEntry.field = field;\n }\n aggregate.push(aggregateEntry);\n }\n }\n else {\n groupby.push(newField);\n if (isTypedFieldDef(channelDef) && isBinning(bin)) {\n bins.push({ bin, field, as: newField });\n // Add additional groupbys for range and end of bins\n groupby.push(vgField(channelDef, { binSuffix: 'end' }));\n if (binRequiresRange(channelDef, channel)) {\n groupby.push(vgField(channelDef, { binSuffix: 'range' }));\n }\n // Create accompanying 'x2' or 'y2' field if channel is 'x' or 'y' respectively\n if (isXorY(channel)) {\n const secondaryChannel = {\n field: newField + '_end'\n };\n encoding[channel + '2'] = secondaryChannel;\n }\n newFieldDef.bin = 'binned';\n if (!isSecondaryRangeChannel(channel)) {\n newFieldDef['type'] = QUANTITATIVE;\n }\n }\n else if (timeUnit) {\n timeUnits.push({\n timeUnit,\n field,\n as: newField\n });\n // define the format type for later compilation\n const formatType = isTypedFieldDef(channelDef) && channelDef.type !== TEMPORAL && 'time';\n if (formatType) {\n if (channel === TEXT || channel === TOOLTIP) {\n newFieldDef['formatType'] = formatType;\n }\n else if (isNonPositionScaleChannel(channel)) {\n newFieldDef['legend'] = Object.assign({ formatType }, newFieldDef['legend']);\n }\n else if (isXorY(channel)) {\n newFieldDef['axis'] = Object.assign({ formatType }, newFieldDef['axis']);\n }\n }\n }\n }\n // now the field should refer to post-transformed field instead\n encoding[channel] = newFieldDef;\n }\n else {\n groupby.push(field);\n encoding[channel] = oldEncoding[channel];\n }\n }\n else {\n // For value def / signal ref / datum def, just copy\n encoding[channel] = oldEncoding[channel];\n }\n });\n return {\n bins,\n timeUnits,\n aggregate,\n groupby,\n encoding\n };\n}\nexport function markChannelCompatible(encoding, channel, mark) {\n const markSupported = supportMark(channel, mark);\n if (!markSupported) {\n return false;\n }\n else if (markSupported === 'binned') {\n const primaryFieldDef = encoding[channel === X2 ? X : Y];\n // circle, point, square and tick only support x2/y2 when their corresponding x/y fieldDef\n // has \"binned\" data and thus need x2/y2 to specify the bin-end field.\n if (isFieldDef(primaryFieldDef) && isFieldDef(encoding[channel]) && isBinned(primaryFieldDef.bin)) {\n return true;\n }\n else {\n return false;\n }\n }\n return true;\n}\nexport function initEncoding(encoding, mark, filled, config) {\n return keys(encoding).reduce((normalizedEncoding, channel) => {\n if (!isChannel(channel)) {\n // Drop invalid channel\n log.warn(log.message.invalidEncodingChannel(channel));\n return normalizedEncoding;\n }\n const channelDef = encoding[channel];\n if (channel === 'angle' && mark === 'arc' && !encoding.theta) {\n log.warn(log.message.REPLACE_ANGLE_WITH_THETA);\n channel = THETA;\n }\n if (!markChannelCompatible(encoding, channel, mark)) {\n // Drop unsupported channel\n log.warn(log.message.incompatibleChannel(channel, mark));\n return normalizedEncoding;\n }\n // Drop line's size if the field is aggregated.\n if (channel === SIZE && mark === 'line') {\n const fieldDef = getFieldDef(encoding[channel]);\n if (fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.aggregate) {\n log.warn(log.message.LINE_WITH_VARYING_SIZE);\n return normalizedEncoding;\n }\n }\n // Drop color if either fill or stroke is specified\n if (channel === COLOR && (filled ? 'fill' in encoding : 'stroke' in encoding)) {\n log.warn(log.message.droppingColor('encoding', { fill: 'fill' in encoding, stroke: 'stroke' in encoding }));\n return normalizedEncoding;\n }\n if (channel === DETAIL ||\n (channel === ORDER && !isArray(channelDef) && !isValueDef(channelDef)) ||\n (channel === TOOLTIP && isArray(channelDef))) {\n if (channelDef) {\n // Array of fieldDefs for detail channel (or production rule)\n normalizedEncoding[channel] = array(channelDef).reduce((defs, fieldDef) => {\n if (!isFieldDef(fieldDef)) {\n log.warn(log.message.emptyFieldDef(fieldDef, channel));\n }\n else {\n defs.push(initFieldDef(fieldDef, channel));\n }\n return defs;\n }, []);\n }\n }\n else {\n if (channel === TOOLTIP && channelDef === null) {\n // Preserve null so we can use it to disable tooltip\n normalizedEncoding[channel] = null;\n }\n else if (!isFieldDef(channelDef) &&\n !isDatumDef(channelDef) &&\n !isValueDef(channelDef) &&\n !isConditionalDef(channelDef) &&\n !isSignalRef(channelDef)) {\n log.warn(log.message.emptyFieldDef(channelDef, channel));\n return normalizedEncoding;\n }\n normalizedEncoding[channel] = initChannelDef(channelDef, channel, config);\n }\n return normalizedEncoding;\n }, {});\n}\n/**\n * For composite marks, we have to call initChannelDef during init so we can infer types earlier.\n */\nexport function normalizeEncoding(encoding, config) {\n const normalizedEncoding = {};\n for (const channel of keys(encoding)) {\n const newChannelDef = initChannelDef(encoding[channel], channel, config, { compositeMark: true });\n normalizedEncoding[channel] = newChannelDef;\n }\n return normalizedEncoding;\n}\nexport function fieldDefs(encoding) {\n const arr = [];\n for (const channel of keys(encoding)) {\n if (channelHasField(encoding, channel)) {\n const channelDef = encoding[channel];\n const channelDefArray = array(channelDef);\n for (const def of channelDefArray) {\n if (isFieldDef(def)) {\n arr.push(def);\n }\n else if (hasConditionalFieldDef(def)) {\n arr.push(def.condition);\n }\n }\n }\n }\n return arr;\n}\nexport function forEach(mapping, f, thisArg) {\n if (!mapping) {\n return;\n }\n for (const channel of keys(mapping)) {\n const el = mapping[channel];\n if (isArray(el)) {\n for (const channelDef of el) {\n f.call(thisArg, channelDef, channel);\n }\n }\n else {\n f.call(thisArg, el, channel);\n }\n }\n}\nexport function reduce(mapping, f, init, thisArg) {\n if (!mapping) {\n return init;\n }\n return keys(mapping).reduce((r, channel) => {\n const map = mapping[channel];\n if (isArray(map)) {\n return map.reduce((r1, channelDef) => {\n return f.call(thisArg, r1, channelDef, channel);\n }, r);\n }\n else {\n return f.call(thisArg, r, map, channel);\n }\n }, init);\n}\n/**\n * Returns list of path grouping fields for the given encoding\n */\nexport function pathGroupingFields(mark, encoding) {\n return keys(encoding).reduce((details, channel) => {\n switch (channel) {\n // x, y, x2, y2, lat, long, lat1, long2, order, tooltip, href, aria label, cursor should not cause lines to group\n case X:\n case Y:\n case HREF:\n case DESCRIPTION:\n case URL:\n case X2:\n case Y2:\n case THETA:\n case THETA2:\n case RADIUS:\n case RADIUS2:\n // falls through\n case LATITUDE:\n case LONGITUDE:\n case LATITUDE2:\n case LONGITUDE2:\n // TODO: case 'cursor':\n // text, shape, shouldn't be a part of line/trail/area [falls through]\n case TEXT:\n case SHAPE:\n case ANGLE:\n // falls through\n // tooltip fields should not be added to group by [falls through]\n case TOOLTIP:\n return details;\n case ORDER:\n // order should not group line / trail\n if (mark === 'line' || mark === 'trail') {\n return details;\n }\n // but order should group area for stacking (falls through)\n case DETAIL:\n case KEY: {\n const channelDef = encoding[channel];\n if (isArray(channelDef) || isFieldDef(channelDef)) {\n for (const fieldDef of array(channelDef)) {\n if (!fieldDef.aggregate) {\n details.push(vgField(fieldDef, {}));\n }\n }\n }\n return details;\n }\n case SIZE:\n if (mark === 'trail') {\n // For trail, size should not group trail lines.\n return details;\n }\n // For line, size should group lines.\n // falls through\n case COLOR:\n case FILL:\n case STROKE:\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n case STROKEDASH:\n case STROKEWIDTH: {\n // TODO strokeDashOffset:\n // falls through\n const fieldDef = getFieldDef(encoding[channel]);\n if (fieldDef && !fieldDef.aggregate) {\n details.push(vgField(fieldDef, {}));\n }\n return details;\n }\n }\n }, []);\n}\n//# sourceMappingURL=encoding.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray, isBoolean, isString } from 'vega-util';\nimport { isContinuousFieldOrDatumDef, isFieldDef, isFieldOrDatumDefForTimeFormat } from '../channeldef';\nimport { fieldDefs } from '../encoding';\nimport * as log from '../log';\nimport { isMarkDef } from '../mark';\nimport { getFirstDefined, hash, unique } from '../util';\nimport { isSignalRef } from '../vega.schema';\nimport { toStringFieldDef } from './../channeldef';\nexport function filterTooltipWithAggregatedField(oldEncoding) {\n const { tooltip } = oldEncoding, filteredEncoding = __rest(oldEncoding, [\"tooltip\"]);\n if (!tooltip) {\n return { filteredEncoding };\n }\n let customTooltipWithAggregatedField;\n let customTooltipWithoutAggregatedField;\n if (isArray(tooltip)) {\n for (const t of tooltip) {\n if (t.aggregate) {\n if (!customTooltipWithAggregatedField) {\n customTooltipWithAggregatedField = [];\n }\n customTooltipWithAggregatedField.push(t);\n }\n else {\n if (!customTooltipWithoutAggregatedField) {\n customTooltipWithoutAggregatedField = [];\n }\n customTooltipWithoutAggregatedField.push(t);\n }\n }\n if (customTooltipWithAggregatedField) {\n filteredEncoding.tooltip = customTooltipWithAggregatedField;\n }\n }\n else {\n if (tooltip['aggregate']) {\n filteredEncoding.tooltip = tooltip;\n }\n else {\n customTooltipWithoutAggregatedField = tooltip;\n }\n }\n if (isArray(customTooltipWithoutAggregatedField) && customTooltipWithoutAggregatedField.length === 1) {\n customTooltipWithoutAggregatedField = customTooltipWithoutAggregatedField[0];\n }\n return { customTooltipWithoutAggregatedField, filteredEncoding };\n}\nexport function getCompositeMarkTooltip(tooltipSummary, continuousAxisChannelDef, encodingWithoutContinuousAxis, withFieldName = true) {\n if ('tooltip' in encodingWithoutContinuousAxis) {\n return { tooltip: encodingWithoutContinuousAxis.tooltip };\n }\n const fiveSummaryTooltip = tooltipSummary.map(({ fieldPrefix, titlePrefix }) => {\n const mainTitle = withFieldName ? ` of ${getTitle(continuousAxisChannelDef)}` : '';\n return {\n field: fieldPrefix + continuousAxisChannelDef.field,\n type: continuousAxisChannelDef.type,\n title: isSignalRef(titlePrefix) ? { signal: titlePrefix + `\"${escape(mainTitle)}\"` } : titlePrefix + mainTitle\n };\n });\n const tooltipFieldDefs = fieldDefs(encodingWithoutContinuousAxis).map(toStringFieldDef);\n return {\n tooltip: [\n ...fiveSummaryTooltip,\n // need to cast because TextFieldDef supports fewer types of bin\n ...unique(tooltipFieldDefs, hash)\n ]\n };\n}\nexport function getTitle(continuousAxisChannelDef) {\n const { title, field } = continuousAxisChannelDef;\n return getFirstDefined(title, field);\n}\nexport function makeCompositeAggregatePartFactory(compositeMarkDef, continuousAxis, continuousAxisChannelDef, sharedEncoding, compositeMarkConfig) {\n const { scale, axis } = continuousAxisChannelDef;\n return ({ partName, mark, positionPrefix, endPositionPrefix = undefined, extraEncoding = {} }) => {\n const title = getTitle(continuousAxisChannelDef);\n return partLayerMixins(compositeMarkDef, partName, compositeMarkConfig, {\n mark,\n encoding: Object.assign(Object.assign(Object.assign({ [continuousAxis]: Object.assign(Object.assign(Object.assign({ field: positionPrefix + '_' + continuousAxisChannelDef.field, type: continuousAxisChannelDef.type }, (title !== undefined ? { title } : {})), (scale !== undefined ? { scale } : {})), (axis !== undefined ? { axis } : {})) }, (isString(endPositionPrefix)\n ? {\n [continuousAxis + '2']: {\n field: endPositionPrefix + '_' + continuousAxisChannelDef.field\n }\n }\n : {})), sharedEncoding), extraEncoding)\n });\n };\n}\nexport function partLayerMixins(markDef, part, compositeMarkConfig, partBaseSpec) {\n const { clip, color, opacity } = markDef;\n const mark = markDef.type;\n if (markDef[part] || (markDef[part] === undefined && compositeMarkConfig[part])) {\n return [\n Object.assign(Object.assign({}, partBaseSpec), { mark: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, compositeMarkConfig[part]), (clip ? { clip } : {})), (color ? { color } : {})), (opacity ? { opacity } : {})), (isMarkDef(partBaseSpec.mark) ? partBaseSpec.mark : { type: partBaseSpec.mark })), { style: `${mark}-${part}` }), (isBoolean(markDef[part]) ? {} : markDef[part])) })\n ];\n }\n return [];\n}\nexport function compositeMarkContinuousAxis(spec, orient, compositeMark) {\n const { encoding } = spec;\n const continuousAxis = orient === 'vertical' ? 'y' : 'x';\n const continuousAxisChannelDef = encoding[continuousAxis]; // Safe to cast because if x is not continuous fielddef, the orient would not be horizontal.\n const continuousAxisChannelDef2 = encoding[continuousAxis + '2'];\n const continuousAxisChannelDefError = encoding[continuousAxis + 'Error'];\n const continuousAxisChannelDefError2 = encoding[continuousAxis + 'Error2'];\n return {\n continuousAxisChannelDef: filterAggregateFromChannelDef(continuousAxisChannelDef, compositeMark),\n continuousAxisChannelDef2: filterAggregateFromChannelDef(continuousAxisChannelDef2, compositeMark),\n continuousAxisChannelDefError: filterAggregateFromChannelDef(continuousAxisChannelDefError, compositeMark),\n continuousAxisChannelDefError2: filterAggregateFromChannelDef(continuousAxisChannelDefError2, compositeMark),\n continuousAxis\n };\n}\nfunction filterAggregateFromChannelDef(continuousAxisChannelDef, compositeMark) {\n if (continuousAxisChannelDef && continuousAxisChannelDef.aggregate) {\n const { aggregate } = continuousAxisChannelDef, continuousAxisWithoutAggregate = __rest(continuousAxisChannelDef, [\"aggregate\"]);\n if (aggregate !== compositeMark) {\n log.warn(log.message.errorBarContinuousAxisHasCustomizedAggregate(aggregate, compositeMark));\n }\n return continuousAxisWithoutAggregate;\n }\n else {\n return continuousAxisChannelDef;\n }\n}\nexport function compositeMarkOrient(spec, compositeMark) {\n const { mark, encoding } = spec;\n const { x, y } = encoding;\n if (isMarkDef(mark) && mark.orient) {\n return mark.orient;\n }\n if (isContinuousFieldOrDatumDef(x)) {\n // x is continuous\n if (isContinuousFieldOrDatumDef(y)) {\n // both x and y are continuous\n const xAggregate = isFieldDef(x) && x.aggregate;\n const yAggregate = isFieldDef(y) && y.aggregate;\n if (!xAggregate && yAggregate === compositeMark) {\n return 'vertical';\n }\n else if (!yAggregate && xAggregate === compositeMark) {\n return 'horizontal';\n }\n else if (xAggregate === compositeMark && yAggregate === compositeMark) {\n throw new Error('Both x and y cannot have aggregate');\n }\n else {\n if (isFieldOrDatumDefForTimeFormat(y) && !isFieldOrDatumDefForTimeFormat(x)) {\n // y is temporal but x is not\n return 'horizontal';\n }\n // default orientation for two continuous\n return 'vertical';\n }\n }\n return 'horizontal';\n }\n else if (isContinuousFieldOrDatumDef(y)) {\n // y is continuous but x is not\n return 'vertical';\n }\n else {\n // Neither x nor y is continuous.\n throw new Error(`Need a valid continuous axis for ${compositeMark}s`);\n }\n}\n//# sourceMappingURL=common.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isNumber, isObject } from 'vega-util';\nimport { getMarkPropOrConfig } from '../compile/common';\nimport { extractTransformsFromEncoding, normalizeEncoding } from '../encoding';\nimport * as log from '../log';\nimport { isMarkDef } from '../mark';\nimport { isEmpty, omit } from '../util';\nimport { CompositeMarkNormalizer } from './base';\nimport { compositeMarkContinuousAxis, compositeMarkOrient, filterTooltipWithAggregatedField, getCompositeMarkTooltip, getTitle, makeCompositeAggregatePartFactory, partLayerMixins } from './common';\nexport const BOXPLOT = 'boxplot';\nexport const BOXPLOT_PARTS = ['box', 'median', 'outliers', 'rule', 'ticks'];\nexport const boxPlotNormalizer = new CompositeMarkNormalizer(BOXPLOT, normalizeBoxPlot);\nexport function getBoxPlotType(extent) {\n if (isNumber(extent)) {\n return 'tukey';\n }\n // Ham: If we ever want to, we could add another extent syntax `{kIQR: number}` for the original [Q1-k*IQR, Q3+k*IQR] whisker and call this boxPlotType = `kIQR`. However, I'm not exposing this for now.\n return extent;\n}\nexport function normalizeBoxPlot(spec, { config }) {\n var _a, _b;\n // Need to initEncoding first so we can infer type\n spec = Object.assign(Object.assign({}, spec), { encoding: normalizeEncoding(spec.encoding, config) });\n const { mark, encoding: _encoding, selection, projection: _p } = spec, outerSpec = __rest(spec, [\"mark\", \"encoding\", \"selection\", \"projection\"]);\n const markDef = isMarkDef(mark) ? mark : { type: mark };\n // TODO(https://github.com/vega/vega-lite/issues/3702): add selection support\n if (selection) {\n log.warn(log.message.selectionNotSupported('boxplot'));\n }\n const extent = (_a = markDef.extent) !== null && _a !== void 0 ? _a : config.boxplot.extent;\n const sizeValue = getMarkPropOrConfig('size', markDef, // TODO: https://github.com/vega/vega-lite/issues/6245\n config);\n const boxPlotType = getBoxPlotType(extent);\n const { bins, timeUnits, transform, continuousAxisChannelDef, continuousAxis, groupby, aggregate, encodingWithoutContinuousAxis, ticksOrient, boxOrient, customTooltipWithoutAggregatedField } = boxParams(spec, extent, config);\n const { color, size } = encodingWithoutContinuousAxis, encodingWithoutSizeColorAndContinuousAxis = __rest(encodingWithoutContinuousAxis, [\"color\", \"size\"]);\n const makeBoxPlotPart = (sharedEncoding) => {\n return makeCompositeAggregatePartFactory(markDef, continuousAxis, continuousAxisChannelDef, sharedEncoding, config.boxplot);\n };\n const makeBoxPlotExtent = makeBoxPlotPart(encodingWithoutSizeColorAndContinuousAxis);\n const makeBoxPlotBox = makeBoxPlotPart(encodingWithoutContinuousAxis);\n const makeBoxPlotMidTick = makeBoxPlotPart(Object.assign(Object.assign({}, encodingWithoutSizeColorAndContinuousAxis), (size ? { size } : {})));\n const fiveSummaryTooltipEncoding = getCompositeMarkTooltip([\n { fieldPrefix: boxPlotType === 'min-max' ? 'upper_whisker_' : 'max_', titlePrefix: 'Max' },\n { fieldPrefix: 'upper_box_', titlePrefix: 'Q3' },\n { fieldPrefix: 'mid_box_', titlePrefix: 'Median' },\n { fieldPrefix: 'lower_box_', titlePrefix: 'Q1' },\n { fieldPrefix: boxPlotType === 'min-max' ? 'lower_whisker_' : 'min_', titlePrefix: 'Min' }\n ], continuousAxisChannelDef, encodingWithoutContinuousAxis);\n // ## Whisker Layers\n const endTick = { type: 'tick', color: 'black', opacity: 1, orient: ticksOrient, invalid: null, aria: false };\n const whiskerTooltipEncoding = boxPlotType === 'min-max'\n ? fiveSummaryTooltipEncoding // for min-max, show five-summary tooltip for whisker\n : // for tukey / k-IQR, just show upper/lower-whisker\n getCompositeMarkTooltip([\n { fieldPrefix: 'upper_whisker_', titlePrefix: 'Upper Whisker' },\n { fieldPrefix: 'lower_whisker_', titlePrefix: 'Lower Whisker' }\n ], continuousAxisChannelDef, encodingWithoutContinuousAxis);\n const whiskerLayers = [\n ...makeBoxPlotExtent({\n partName: 'rule',\n mark: { type: 'rule', invalid: null, aria: false },\n positionPrefix: 'lower_whisker',\n endPositionPrefix: 'lower_box',\n extraEncoding: whiskerTooltipEncoding\n }),\n ...makeBoxPlotExtent({\n partName: 'rule',\n mark: { type: 'rule', invalid: null, aria: false },\n positionPrefix: 'upper_box',\n endPositionPrefix: 'upper_whisker',\n extraEncoding: whiskerTooltipEncoding\n }),\n ...makeBoxPlotExtent({\n partName: 'ticks',\n mark: endTick,\n positionPrefix: 'lower_whisker',\n extraEncoding: whiskerTooltipEncoding\n }),\n ...makeBoxPlotExtent({\n partName: 'ticks',\n mark: endTick,\n positionPrefix: 'upper_whisker',\n extraEncoding: whiskerTooltipEncoding\n })\n ];\n // ## Box Layers\n // TODO: support hiding certain mark parts\n const boxLayers = [\n ...(boxPlotType !== 'tukey' ? whiskerLayers : []),\n ...makeBoxPlotBox({\n partName: 'box',\n mark: Object.assign(Object.assign({ type: 'bar' }, (sizeValue ? { size: sizeValue } : {})), { orient: boxOrient, invalid: null, ariaRoleDescription: 'box' }),\n positionPrefix: 'lower_box',\n endPositionPrefix: 'upper_box',\n extraEncoding: fiveSummaryTooltipEncoding\n }),\n ...makeBoxPlotMidTick({\n partName: 'median',\n mark: Object.assign(Object.assign(Object.assign({ type: 'tick', invalid: null }, (isObject(config.boxplot.median) && config.boxplot.median.color ? { color: config.boxplot.median.color } : {})), (sizeValue ? { size: sizeValue } : {})), { orient: ticksOrient, aria: false }),\n positionPrefix: 'mid_box',\n extraEncoding: fiveSummaryTooltipEncoding\n })\n ];\n if (boxPlotType === 'min-max') {\n return Object.assign(Object.assign({}, outerSpec), { transform: ((_b = outerSpec.transform) !== null && _b !== void 0 ? _b : []).concat(transform), layer: boxLayers });\n }\n // Tukey Box Plot\n const lowerBoxExpr = `datum[\"lower_box_${continuousAxisChannelDef.field}\"]`;\n const upperBoxExpr = `datum[\"upper_box_${continuousAxisChannelDef.field}\"]`;\n const iqrExpr = `(${upperBoxExpr} - ${lowerBoxExpr})`;\n const lowerWhiskerExpr = `${lowerBoxExpr} - ${extent} * ${iqrExpr}`;\n const upperWhiskerExpr = `${upperBoxExpr} + ${extent} * ${iqrExpr}`;\n const fieldExpr = `datum[\"${continuousAxisChannelDef.field}\"]`;\n const joinaggregateTransform = {\n joinaggregate: boxParamsQuartiles(continuousAxisChannelDef.field),\n groupby\n };\n const filteredWhiskerSpec = {\n transform: [\n {\n filter: `(${lowerWhiskerExpr} <= ${fieldExpr}) && (${fieldExpr} <= ${upperWhiskerExpr})`\n },\n {\n aggregate: [\n {\n op: 'min',\n field: continuousAxisChannelDef.field,\n as: 'lower_whisker_' + continuousAxisChannelDef.field\n },\n {\n op: 'max',\n field: continuousAxisChannelDef.field,\n as: 'upper_whisker_' + continuousAxisChannelDef.field\n },\n // preserve lower_box / upper_box\n {\n op: 'min',\n field: 'lower_box_' + continuousAxisChannelDef.field,\n as: 'lower_box_' + continuousAxisChannelDef.field\n },\n {\n op: 'max',\n field: 'upper_box_' + continuousAxisChannelDef.field,\n as: 'upper_box_' + continuousAxisChannelDef.field\n },\n ...aggregate\n ],\n groupby\n }\n ],\n layer: whiskerLayers\n };\n const { tooltip } = encodingWithoutSizeColorAndContinuousAxis, encodingWithoutSizeColorContinuousAxisAndTooltip = __rest(encodingWithoutSizeColorAndContinuousAxis, [\"tooltip\"]);\n const { scale, axis } = continuousAxisChannelDef;\n const title = getTitle(continuousAxisChannelDef);\n const axisWithoutTitle = omit(axis, ['title']);\n const outlierLayersMixins = partLayerMixins(markDef, 'outliers', config.boxplot, {\n transform: [{ filter: `(${fieldExpr} < ${lowerWhiskerExpr}) || (${fieldExpr} > ${upperWhiskerExpr})` }],\n mark: 'point',\n encoding: Object.assign(Object.assign(Object.assign({ [continuousAxis]: Object.assign(Object.assign(Object.assign({ field: continuousAxisChannelDef.field, type: continuousAxisChannelDef.type }, (title !== undefined ? { title } : {})), (scale !== undefined ? { scale } : {})), (isEmpty(axisWithoutTitle) ? {} : { axis: axisWithoutTitle })) }, encodingWithoutSizeColorContinuousAxisAndTooltip), (color ? { color } : {})), (customTooltipWithoutAggregatedField ? { tooltip: customTooltipWithoutAggregatedField } : {}))\n })[0];\n let filteredLayersMixins;\n const filteredLayersMixinsTransforms = [...bins, ...timeUnits, joinaggregateTransform];\n if (outlierLayersMixins) {\n filteredLayersMixins = {\n transform: filteredLayersMixinsTransforms,\n layer: [outlierLayersMixins, filteredWhiskerSpec]\n };\n }\n else {\n filteredLayersMixins = filteredWhiskerSpec;\n filteredLayersMixins.transform.unshift(...filteredLayersMixinsTransforms);\n }\n return Object.assign(Object.assign({}, outerSpec), { layer: [\n filteredLayersMixins,\n {\n // boxplot\n transform,\n layer: boxLayers\n }\n ] });\n}\nfunction boxParamsQuartiles(continousAxisField) {\n return [\n {\n op: 'q1',\n field: continousAxisField,\n as: 'lower_box_' + continousAxisField\n },\n {\n op: 'q3',\n field: continousAxisField,\n as: 'upper_box_' + continousAxisField\n }\n ];\n}\nfunction boxParams(spec, extent, config) {\n const orient = compositeMarkOrient(spec, BOXPLOT);\n const { continuousAxisChannelDef, continuousAxis } = compositeMarkContinuousAxis(spec, orient, BOXPLOT);\n const continuousFieldName = continuousAxisChannelDef.field;\n const boxPlotType = getBoxPlotType(extent);\n const boxplotSpecificAggregate = [\n ...boxParamsQuartiles(continuousFieldName),\n {\n op: 'median',\n field: continuousFieldName,\n as: 'mid_box_' + continuousFieldName\n },\n {\n op: 'min',\n field: continuousFieldName,\n as: (boxPlotType === 'min-max' ? 'lower_whisker_' : 'min_') + continuousFieldName\n },\n {\n op: 'max',\n field: continuousFieldName,\n as: (boxPlotType === 'min-max' ? 'upper_whisker_' : 'max_') + continuousFieldName\n }\n ];\n const postAggregateCalculates = boxPlotType === 'min-max' || boxPlotType === 'tukey'\n ? []\n : [\n // This is for the original k-IQR, which we do not expose\n {\n calculate: `datum[\"upper_box_${continuousFieldName}\"] - datum[\"lower_box_${continuousFieldName}\"]`,\n as: 'iqr_' + continuousFieldName\n },\n {\n calculate: `min(datum[\"upper_box_${continuousFieldName}\"] + datum[\"iqr_${continuousFieldName}\"] * ${extent}, datum[\"max_${continuousFieldName}\"])`,\n as: 'upper_whisker_' + continuousFieldName\n },\n {\n calculate: `max(datum[\"lower_box_${continuousFieldName}\"] - datum[\"iqr_${continuousFieldName}\"] * ${extent}, datum[\"min_${continuousFieldName}\"])`,\n as: 'lower_whisker_' + continuousFieldName\n }\n ];\n const _a = spec.encoding, _b = continuousAxis, oldContinuousAxisChannelDef = _a[_b], oldEncodingWithoutContinuousAxis = __rest(_a, [typeof _b === \"symbol\" ? _b : _b + \"\"]);\n const { customTooltipWithoutAggregatedField, filteredEncoding } = filterTooltipWithAggregatedField(oldEncodingWithoutContinuousAxis);\n const { bins, timeUnits, aggregate, groupby, encoding: encodingWithoutContinuousAxis } = extractTransformsFromEncoding(filteredEncoding, config);\n const ticksOrient = orient === 'vertical' ? 'horizontal' : 'vertical';\n const boxOrient = orient;\n const transform = [\n ...bins,\n ...timeUnits,\n {\n aggregate: [...aggregate, ...boxplotSpecificAggregate],\n groupby\n },\n ...postAggregateCalculates\n ];\n return {\n bins,\n timeUnits,\n transform,\n groupby,\n aggregate,\n continuousAxisChannelDef,\n continuousAxis,\n encodingWithoutContinuousAxis,\n ticksOrient,\n boxOrient,\n customTooltipWithoutAggregatedField\n };\n}\n//# sourceMappingURL=boxplot.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isContinuousFieldOrDatumDef, isFieldOrDatumDef, title } from '../channeldef';\nimport { extractTransformsFromEncoding, normalizeEncoding } from '../encoding';\nimport * as log from '../log';\nimport { isMarkDef } from '../mark';\nimport { replaceAll, titleCase } from '../util';\nimport { CompositeMarkNormalizer } from './base';\nimport { compositeMarkContinuousAxis, compositeMarkOrient, getCompositeMarkTooltip, makeCompositeAggregatePartFactory } from './common';\nexport const ERRORBAR = 'errorbar';\nexport const ERRORBAR_PARTS = ['ticks', 'rule'];\nexport const errorBarNormalizer = new CompositeMarkNormalizer(ERRORBAR, normalizeErrorBar);\nexport function normalizeErrorBar(spec, { config }) {\n // Need to initEncoding first so we can infer type\n spec = Object.assign(Object.assign({}, spec), { encoding: normalizeEncoding(spec.encoding, config) });\n const { transform, continuousAxisChannelDef, continuousAxis, encodingWithoutContinuousAxis, ticksOrient, markDef, outerSpec, tooltipEncoding } = errorBarParams(spec, ERRORBAR, config);\n delete encodingWithoutContinuousAxis['size'];\n const makeErrorBarPart = makeCompositeAggregatePartFactory(markDef, continuousAxis, continuousAxisChannelDef, encodingWithoutContinuousAxis, config.errorbar);\n const thickness = markDef.thickness;\n const size = markDef.size;\n const tick = Object.assign(Object.assign({ type: 'tick', orient: ticksOrient, aria: false }, (thickness !== undefined ? { thickness } : {})), (size !== undefined ? { size } : {}));\n const layer = [\n ...makeErrorBarPart({\n partName: 'ticks',\n mark: tick,\n positionPrefix: 'lower',\n extraEncoding: tooltipEncoding\n }),\n ...makeErrorBarPart({\n partName: 'ticks',\n mark: tick,\n positionPrefix: 'upper',\n extraEncoding: tooltipEncoding\n }),\n ...makeErrorBarPart({\n partName: 'rule',\n mark: Object.assign({ type: 'rule', ariaRoleDescription: 'errorbar' }, (thickness !== undefined ? { size: thickness } : {})),\n positionPrefix: 'lower',\n endPositionPrefix: 'upper',\n extraEncoding: tooltipEncoding\n })\n ];\n return Object.assign(Object.assign(Object.assign({}, outerSpec), { transform }), (layer.length > 1 ? { layer } : Object.assign({}, layer[0])));\n}\nfunction errorBarOrientAndInputType(spec, compositeMark) {\n const { encoding } = spec;\n if (errorBarIsInputTypeRaw(encoding)) {\n return {\n orient: compositeMarkOrient(spec, compositeMark),\n inputType: 'raw'\n };\n }\n const isTypeAggregatedUpperLower = errorBarIsInputTypeAggregatedUpperLower(encoding);\n const isTypeAggregatedError = errorBarIsInputTypeAggregatedError(encoding);\n const x = encoding.x;\n const y = encoding.y;\n if (isTypeAggregatedUpperLower) {\n // type is aggregated-upper-lower\n if (isTypeAggregatedError) {\n throw new Error(`${compositeMark} cannot be both type aggregated-upper-lower and aggregated-error`);\n }\n const x2 = encoding.x2;\n const y2 = encoding.y2;\n if (isFieldOrDatumDef(x2) && isFieldOrDatumDef(y2)) {\n // having both x, x2 and y, y2\n throw new Error(`${compositeMark} cannot have both x2 and y2`);\n }\n else if (isFieldOrDatumDef(x2)) {\n if (isContinuousFieldOrDatumDef(x)) {\n // having x, x2 quantitative and field y, y2 are not specified\n return { orient: 'horizontal', inputType: 'aggregated-upper-lower' };\n }\n else {\n // having x, x2 that are not both quantitative\n throw new Error(`Both x and x2 have to be quantitative in ${compositeMark}`);\n }\n }\n else if (isFieldOrDatumDef(y2)) {\n // y2 is a FieldDef\n if (isContinuousFieldOrDatumDef(y)) {\n // having y, y2 quantitative and field x, x2 are not specified\n return { orient: 'vertical', inputType: 'aggregated-upper-lower' };\n }\n else {\n // having y, y2 that are not both quantitative\n throw new Error(`Both y and y2 have to be quantitative in ${compositeMark}`);\n }\n }\n throw new Error('No ranged axis');\n }\n else {\n // type is aggregated-error\n const xError = encoding.xError;\n const xError2 = encoding.xError2;\n const yError = encoding.yError;\n const yError2 = encoding.yError2;\n if (isFieldOrDatumDef(xError2) && !isFieldOrDatumDef(xError)) {\n // having xError2 without xError\n throw new Error(`${compositeMark} cannot have xError2 without xError`);\n }\n if (isFieldOrDatumDef(yError2) && !isFieldOrDatumDef(yError)) {\n // having yError2 without yError\n throw new Error(`${compositeMark} cannot have yError2 without yError`);\n }\n if (isFieldOrDatumDef(xError) && isFieldOrDatumDef(yError)) {\n // having both xError and yError\n throw new Error(`${compositeMark} cannot have both xError and yError with both are quantiative`);\n }\n else if (isFieldOrDatumDef(xError)) {\n if (isContinuousFieldOrDatumDef(x)) {\n // having x and xError that are all quantitative\n return { orient: 'horizontal', inputType: 'aggregated-error' };\n }\n else {\n // having x, xError, and xError2 that are not all quantitative\n throw new Error('All x, xError, and xError2 (if exist) have to be quantitative');\n }\n }\n else if (isFieldOrDatumDef(yError)) {\n if (isContinuousFieldOrDatumDef(y)) {\n // having y and yError that are all quantitative\n return { orient: 'vertical', inputType: 'aggregated-error' };\n }\n else {\n // having y, yError, and yError2 that are not all quantitative\n throw new Error('All y, yError, and yError2 (if exist) have to be quantitative');\n }\n }\n throw new Error('No ranged axis');\n }\n}\nfunction errorBarIsInputTypeRaw(encoding) {\n return ((isFieldOrDatumDef(encoding.x) || isFieldOrDatumDef(encoding.y)) &&\n !isFieldOrDatumDef(encoding.x2) &&\n !isFieldOrDatumDef(encoding.y2) &&\n !isFieldOrDatumDef(encoding.xError) &&\n !isFieldOrDatumDef(encoding.xError2) &&\n !isFieldOrDatumDef(encoding.yError) &&\n !isFieldOrDatumDef(encoding.yError2));\n}\nfunction errorBarIsInputTypeAggregatedUpperLower(encoding) {\n return isFieldOrDatumDef(encoding.x2) || isFieldOrDatumDef(encoding.y2);\n}\nfunction errorBarIsInputTypeAggregatedError(encoding) {\n return (isFieldOrDatumDef(encoding.xError) ||\n isFieldOrDatumDef(encoding.xError2) ||\n isFieldOrDatumDef(encoding.yError) ||\n isFieldOrDatumDef(encoding.yError2));\n}\nexport function errorBarParams(spec, compositeMark, config) {\n var _a;\n // TODO: use selection\n const { mark, encoding, selection, projection: _p } = spec, outerSpec = __rest(spec, [\"mark\", \"encoding\", \"selection\", \"projection\"]);\n const markDef = isMarkDef(mark) ? mark : { type: mark };\n // TODO(https://github.com/vega/vega-lite/issues/3702): add selection support\n if (selection) {\n log.warn(log.message.selectionNotSupported(compositeMark));\n }\n const { orient, inputType } = errorBarOrientAndInputType(spec, compositeMark);\n const { continuousAxisChannelDef, continuousAxisChannelDef2, continuousAxisChannelDefError, continuousAxisChannelDefError2, continuousAxis } = compositeMarkContinuousAxis(spec, orient, compositeMark);\n const { errorBarSpecificAggregate, postAggregateCalculates, tooltipSummary, tooltipTitleWithFieldName } = errorBarAggregationAndCalculation(markDef, continuousAxisChannelDef, continuousAxisChannelDef2, continuousAxisChannelDefError, continuousAxisChannelDefError2, inputType, compositeMark, config);\n const _b = encoding, _c = continuousAxis, oldContinuousAxisChannelDef = _b[_c], _d = continuousAxis === 'x' ? 'x2' : 'y2', oldContinuousAxisChannelDef2 = _b[_d], _e = continuousAxis === 'x' ? 'xError' : 'yError', oldContinuousAxisChannelDefError = _b[_e], _f = continuousAxis === 'x' ? 'xError2' : 'yError2', oldContinuousAxisChannelDefError2 = _b[_f], oldEncodingWithoutContinuousAxis = __rest(_b, [typeof _c === \"symbol\" ? _c : _c + \"\", typeof _d === \"symbol\" ? _d : _d + \"\", typeof _e === \"symbol\" ? _e : _e + \"\", typeof _f === \"symbol\" ? _f : _f + \"\"]);\n const { bins, timeUnits, aggregate: oldAggregate, groupby: oldGroupBy, encoding: encodingWithoutContinuousAxis } = extractTransformsFromEncoding(oldEncodingWithoutContinuousAxis, config);\n const aggregate = [...oldAggregate, ...errorBarSpecificAggregate];\n const groupby = inputType !== 'raw' ? [] : oldGroupBy;\n const tooltipEncoding = getCompositeMarkTooltip(tooltipSummary, continuousAxisChannelDef, encodingWithoutContinuousAxis, tooltipTitleWithFieldName);\n return {\n transform: [\n ...((_a = outerSpec.transform) !== null && _a !== void 0 ? _a : []),\n ...bins,\n ...timeUnits,\n ...(aggregate.length === 0 ? [] : [{ aggregate, groupby }]),\n ...postAggregateCalculates\n ],\n groupby,\n continuousAxisChannelDef,\n continuousAxis,\n encodingWithoutContinuousAxis,\n ticksOrient: orient === 'vertical' ? 'horizontal' : 'vertical',\n markDef,\n outerSpec,\n tooltipEncoding\n };\n}\nfunction errorBarAggregationAndCalculation(markDef, continuousAxisChannelDef, continuousAxisChannelDef2, continuousAxisChannelDefError, continuousAxisChannelDefError2, inputType, compositeMark, config) {\n let errorBarSpecificAggregate = [];\n let postAggregateCalculates = [];\n const continuousFieldName = continuousAxisChannelDef.field;\n let tooltipSummary;\n let tooltipTitleWithFieldName = false;\n if (inputType === 'raw') {\n const center = markDef.center\n ? markDef.center\n : markDef.extent\n ? markDef.extent === 'iqr'\n ? 'median'\n : 'mean'\n : config.errorbar.center;\n const extent = markDef.extent ? markDef.extent : center === 'mean' ? 'stderr' : 'iqr';\n if ((center === 'median') !== (extent === 'iqr')) {\n log.warn(log.message.errorBarCenterIsUsedWithWrongExtent(center, extent, compositeMark));\n }\n if (extent === 'stderr' || extent === 'stdev') {\n errorBarSpecificAggregate = [\n { op: extent, field: continuousFieldName, as: 'extent_' + continuousFieldName },\n { op: center, field: continuousFieldName, as: 'center_' + continuousFieldName }\n ];\n postAggregateCalculates = [\n {\n calculate: `datum[\"center_${continuousFieldName}\"] + datum[\"extent_${continuousFieldName}\"]`,\n as: 'upper_' + continuousFieldName\n },\n {\n calculate: `datum[\"center_${continuousFieldName}\"] - datum[\"extent_${continuousFieldName}\"]`,\n as: 'lower_' + continuousFieldName\n }\n ];\n tooltipSummary = [\n { fieldPrefix: 'center_', titlePrefix: titleCase(center) },\n { fieldPrefix: 'upper_', titlePrefix: getTitlePrefix(center, extent, '+') },\n { fieldPrefix: 'lower_', titlePrefix: getTitlePrefix(center, extent, '-') }\n ];\n tooltipTitleWithFieldName = true;\n }\n else {\n let centerOp;\n let lowerExtentOp;\n let upperExtentOp;\n if (extent === 'ci') {\n centerOp = 'mean';\n lowerExtentOp = 'ci0';\n upperExtentOp = 'ci1';\n }\n else {\n centerOp = 'median';\n lowerExtentOp = 'q1';\n upperExtentOp = 'q3';\n }\n errorBarSpecificAggregate = [\n { op: lowerExtentOp, field: continuousFieldName, as: 'lower_' + continuousFieldName },\n { op: upperExtentOp, field: continuousFieldName, as: 'upper_' + continuousFieldName },\n { op: centerOp, field: continuousFieldName, as: 'center_' + continuousFieldName }\n ];\n tooltipSummary = [\n {\n fieldPrefix: 'upper_',\n titlePrefix: title({ field: continuousFieldName, aggregate: upperExtentOp, type: 'quantitative' }, config, {\n allowDisabling: false\n })\n },\n {\n fieldPrefix: 'lower_',\n titlePrefix: title({ field: continuousFieldName, aggregate: lowerExtentOp, type: 'quantitative' }, config, {\n allowDisabling: false\n })\n },\n {\n fieldPrefix: 'center_',\n titlePrefix: title({ field: continuousFieldName, aggregate: centerOp, type: 'quantitative' }, config, {\n allowDisabling: false\n })\n }\n ];\n }\n }\n else {\n if (markDef.center || markDef.extent) {\n log.warn(log.message.errorBarCenterAndExtentAreNotNeeded(markDef.center, markDef.extent));\n }\n if (inputType === 'aggregated-upper-lower') {\n tooltipSummary = [];\n postAggregateCalculates = [\n { calculate: `datum[\"${continuousAxisChannelDef2.field}\"]`, as: 'upper_' + continuousFieldName },\n { calculate: `datum[\"${continuousFieldName}\"]`, as: 'lower_' + continuousFieldName }\n ];\n }\n else if (inputType === 'aggregated-error') {\n tooltipSummary = [{ fieldPrefix: '', titlePrefix: continuousFieldName }];\n postAggregateCalculates = [\n {\n calculate: `datum[\"${continuousFieldName}\"] + datum[\"${continuousAxisChannelDefError.field}\"]`,\n as: 'upper_' + continuousFieldName\n }\n ];\n if (continuousAxisChannelDefError2) {\n postAggregateCalculates.push({\n calculate: `datum[\"${continuousFieldName}\"] + datum[\"${continuousAxisChannelDefError2.field}\"]`,\n as: 'lower_' + continuousFieldName\n });\n }\n else {\n postAggregateCalculates.push({\n calculate: `datum[\"${continuousFieldName}\"] - datum[\"${continuousAxisChannelDefError.field}\"]`,\n as: 'lower_' + continuousFieldName\n });\n }\n }\n for (const postAggregateCalculate of postAggregateCalculates) {\n tooltipSummary.push({\n fieldPrefix: postAggregateCalculate.as.substring(0, 6),\n titlePrefix: replaceAll(replaceAll(postAggregateCalculate.calculate, 'datum[\"', ''), '\"]', '')\n });\n }\n }\n return { postAggregateCalculates, errorBarSpecificAggregate, tooltipSummary, tooltipTitleWithFieldName };\n}\nfunction getTitlePrefix(center, extent, operation) {\n return titleCase(center) + ' ' + operation + ' ' + extent;\n}\n//# sourceMappingURL=errorbar.js.map","import { normalizeEncoding } from '../encoding';\nimport * as log from '../log';\nimport { CompositeMarkNormalizer } from './base';\nimport { makeCompositeAggregatePartFactory } from './common';\nimport { errorBarParams } from './errorbar';\nexport const ERRORBAND = 'errorband';\nexport const ERRORBAND_PARTS = ['band', 'borders'];\nexport const errorBandNormalizer = new CompositeMarkNormalizer(ERRORBAND, normalizeErrorBand);\nexport function normalizeErrorBand(spec, { config }) {\n // Need to initEncoding first so we can infer type\n spec = Object.assign(Object.assign({}, spec), { encoding: normalizeEncoding(spec.encoding, config) });\n const { transform, continuousAxisChannelDef, continuousAxis, encodingWithoutContinuousAxis, markDef, outerSpec, tooltipEncoding } = errorBarParams(spec, ERRORBAND, config);\n const errorBandDef = markDef;\n const makeErrorBandPart = makeCompositeAggregatePartFactory(errorBandDef, continuousAxis, continuousAxisChannelDef, encodingWithoutContinuousAxis, config.errorband);\n const is2D = spec.encoding.x !== undefined && spec.encoding.y !== undefined;\n let bandMark = { type: is2D ? 'area' : 'rect' };\n let bordersMark = { type: is2D ? 'line' : 'rule' };\n const interpolate = Object.assign(Object.assign({}, (errorBandDef.interpolate ? { interpolate: errorBandDef.interpolate } : {})), (errorBandDef.tension && errorBandDef.interpolate ? { tension: errorBandDef.tension } : {}));\n if (is2D) {\n bandMark = Object.assign(Object.assign(Object.assign({}, bandMark), interpolate), { ariaRoleDescription: 'errorband' });\n bordersMark = Object.assign(Object.assign(Object.assign({}, bordersMark), interpolate), { aria: false });\n }\n else if (errorBandDef.interpolate) {\n log.warn(log.message.errorBand1DNotSupport('interpolate'));\n }\n else if (errorBandDef.tension) {\n log.warn(log.message.errorBand1DNotSupport('tension'));\n }\n return Object.assign(Object.assign({}, outerSpec), { transform, layer: [\n ...makeErrorBandPart({\n partName: 'band',\n mark: bandMark,\n positionPrefix: 'lower',\n endPositionPrefix: 'upper',\n extraEncoding: tooltipEncoding\n }),\n ...makeErrorBandPart({\n partName: 'borders',\n mark: bordersMark,\n positionPrefix: 'lower',\n extraEncoding: tooltipEncoding\n }),\n ...makeErrorBandPart({\n partName: 'borders',\n mark: bordersMark,\n positionPrefix: 'upper',\n extraEncoding: tooltipEncoding\n })\n ] });\n}\n//# sourceMappingURL=errorband.js.map","import { keys } from '../util';\nimport { CompositeMarkNormalizer } from './base';\nimport { BOXPLOT, BOXPLOT_PARTS, normalizeBoxPlot } from './boxplot';\nimport { ERRORBAND, ERRORBAND_PARTS, normalizeErrorBand } from './errorband';\nimport { ERRORBAR, ERRORBAR_PARTS, normalizeErrorBar } from './errorbar';\n/**\n * Registry index for all composite mark's normalizer\n */\nconst compositeMarkRegistry = {};\nexport function add(mark, run, parts) {\n const normalizer = new CompositeMarkNormalizer(mark, run);\n compositeMarkRegistry[mark] = { normalizer, parts };\n}\nexport function remove(mark) {\n delete compositeMarkRegistry[mark];\n}\nexport function getAllCompositeMarks() {\n return keys(compositeMarkRegistry);\n}\nadd(BOXPLOT, normalizeBoxPlot, BOXPLOT_PARTS);\nadd(ERRORBAR, normalizeErrorBar, ERRORBAR_PARTS);\nadd(ERRORBAND, normalizeErrorBand, ERRORBAND_PARTS);\n//# sourceMappingURL=index.js.map","export const VL_ONLY_LEGEND_CONFIG = [\n 'gradientHorizontalMaxLength',\n 'gradientHorizontalMinLength',\n 'gradientVerticalMaxLength',\n 'gradientVerticalMinLength',\n 'unselectedOpacity'\n];\n//# sourceMappingURL=guide.js.map","import { keys } from './util';\nexport const HEADER_TITLE_PROPERTIES_MAP = {\n titleAlign: 'align',\n titleAnchor: 'anchor',\n titleAngle: 'angle',\n titleBaseline: 'baseline',\n titleColor: 'color',\n titleFont: 'font',\n titleFontSize: 'fontSize',\n titleFontStyle: 'fontStyle',\n titleFontWeight: 'fontWeight',\n titleLimit: 'limit',\n titleLineHeight: 'lineHeight',\n titleOrient: 'orient',\n titlePadding: 'offset'\n};\nexport const HEADER_LABEL_PROPERTIES_MAP = {\n labelAlign: 'align',\n labelAnchor: 'anchor',\n labelAngle: 'angle',\n labelBaseline: 'baseline',\n labelColor: 'color',\n labelFont: 'font',\n labelFontSize: 'fontSize',\n labelFontStyle: 'fontStyle',\n labelFontWeight: 'fontWeight',\n labelLimit: 'limit',\n labelLineHeight: 'lineHeight',\n labelOrient: 'orient',\n labelPadding: 'offset'\n};\nexport const HEADER_TITLE_PROPERTIES = keys(HEADER_TITLE_PROPERTIES_MAP);\nexport const HEADER_LABEL_PROPERTIES = keys(HEADER_LABEL_PROPERTIES_MAP);\nconst HEADER_CONFIGS_INDEX = {\n header: 1,\n headerRow: 1,\n headerColumn: 1,\n headerFacet: 1\n};\nexport const HEADER_CONFIGS = keys(HEADER_CONFIGS_INDEX);\n//# sourceMappingURL=header.js.map","import { keys } from './util';\nexport const LEGEND_SCALE_CHANNELS = [\n 'size',\n 'shape',\n 'fill',\n 'stroke',\n 'strokeDash',\n 'strokeWidth',\n 'opacity'\n];\nexport const defaultLegendConfig = {\n gradientHorizontalMaxLength: 200,\n gradientHorizontalMinLength: 100,\n gradientVerticalMaxLength: 200,\n gradientVerticalMinLength: 64,\n unselectedOpacity: 0.35\n};\nexport const COMMON_LEGEND_PROPERTY_INDEX = {\n aria: 1,\n clipHeight: 1,\n columnPadding: 1,\n columns: 1,\n cornerRadius: 1,\n description: 1,\n direction: 1,\n fillColor: 1,\n format: 1,\n formatType: 1,\n gradientLength: 1,\n gradientOpacity: 1,\n gradientStrokeColor: 1,\n gradientStrokeWidth: 1,\n gradientThickness: 1,\n gridAlign: 1,\n labelAlign: 1,\n labelBaseline: 1,\n labelColor: 1,\n labelFont: 1,\n labelFontSize: 1,\n labelFontStyle: 1,\n labelFontWeight: 1,\n labelLimit: 1,\n labelOffset: 1,\n labelOpacity: 1,\n labelOverlap: 1,\n labelPadding: 1,\n labelSeparation: 1,\n legendX: 1,\n legendY: 1,\n offset: 1,\n orient: 1,\n padding: 1,\n rowPadding: 1,\n strokeColor: 1,\n symbolDash: 1,\n symbolDashOffset: 1,\n symbolFillColor: 1,\n symbolLimit: 1,\n symbolOffset: 1,\n symbolOpacity: 1,\n symbolSize: 1,\n symbolStrokeColor: 1,\n symbolStrokeWidth: 1,\n symbolType: 1,\n tickCount: 1,\n tickMinStep: 1,\n title: 1,\n titleAlign: 1,\n titleAnchor: 1,\n titleBaseline: 1,\n titleColor: 1,\n titleFont: 1,\n titleFontSize: 1,\n titleFontStyle: 1,\n titleFontWeight: 1,\n titleLimit: 1,\n titleLineHeight: 1,\n titleOpacity: 1,\n titleOrient: 1,\n titlePadding: 1,\n type: 1,\n values: 1,\n zindex: 1\n};\nexport const LEGEND_PROPERTIES = keys(COMMON_LEGEND_PROPERTY_INDEX);\n//# sourceMappingURL=legend.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nexport function assembleParameterSignals(params) {\n const signals = [];\n for (const param of params || []) {\n const { expr, bind } = param, rest = __rest(param, [\"expr\", \"bind\"]);\n if (bind && expr) {\n // Vega's InitSignal -- apply expr to \"init\"\n const signal = Object.assign(Object.assign({}, rest), { bind, init: expr });\n signals.push(signal);\n }\n else {\n const signal = Object.assign(Object.assign(Object.assign({}, rest), (expr ? { update: expr } : {})), (bind ? { bind } : {}));\n signals.push(signal);\n }\n }\n return signals;\n}\n//# sourceMappingURL=parameter.js.map","import { isObject } from 'vega-util';\nexport const SELECTION_ID = '_vgsid_';\nexport const defaultConfig = {\n single: {\n on: 'click',\n fields: [SELECTION_ID],\n resolve: 'global',\n empty: 'all',\n clear: 'dblclick'\n },\n multi: {\n on: 'click',\n fields: [SELECTION_ID],\n toggle: 'event.shiftKey',\n resolve: 'global',\n empty: 'all',\n clear: 'dblclick'\n },\n interval: {\n on: '[mousedown, window:mouseup] > window:mousemove!',\n encodings: ['x', 'y'],\n translate: '[mousedown, window:mouseup] > window:mousemove!',\n zoom: 'wheel!',\n mark: { fill: '#333', fillOpacity: 0.125, stroke: 'white' },\n resolve: 'global',\n clear: 'dblclick'\n }\n};\nexport function isLegendBinding(bind) {\n return !!bind && (bind === 'legend' || !!bind.legend);\n}\nexport function isLegendStreamBinding(bind) {\n return isLegendBinding(bind) && isObject(bind);\n}\n//# sourceMappingURL=selection.js.map","export function isAnyConcatSpec(spec) {\n return isVConcatSpec(spec) || isHConcatSpec(spec) || isConcatSpec(spec);\n}\nexport function isConcatSpec(spec) {\n return 'concat' in spec;\n}\nexport function isVConcatSpec(spec) {\n return 'vconcat' in spec;\n}\nexport function isHConcatSpec(spec) {\n return 'hconcat' in spec;\n}\n//# sourceMappingURL=concat.js.map","import { isNumber, isObject } from 'vega-util';\nimport { keys } from '../util';\nimport { isConcatSpec, isVConcatSpec } from './concat';\nimport { isFacetMapping, isFacetSpec } from './facet';\nexport function isStep(size) {\n return isObject(size) && size['step'] !== undefined;\n}\nexport function isFrameMixins(o) {\n return o['view'] || o['width'] || o['height'];\n}\nexport const DEFAULT_SPACING = 20;\nconst COMPOSITION_LAYOUT_INDEX = {\n align: 1,\n bounds: 1,\n center: 1,\n columns: 1,\n spacing: 1\n};\nconst COMPOSITION_LAYOUT_PROPERTIES = keys(COMPOSITION_LAYOUT_INDEX);\nexport function extractCompositionLayout(spec, specType, config) {\n var _a, _b;\n const compositionConfig = config[specType];\n const layout = {};\n // Apply config first\n const { spacing: spacingConfig, columns } = compositionConfig;\n if (spacingConfig !== undefined) {\n layout.spacing = spacingConfig;\n }\n if (columns !== undefined) {\n if ((isFacetSpec(spec) && !isFacetMapping(spec.facet)) || isConcatSpec(spec)) {\n layout.columns = columns;\n }\n }\n if (isVConcatSpec(spec)) {\n layout.columns = 1;\n }\n // Then copy properties from the spec\n for (const prop of COMPOSITION_LAYOUT_PROPERTIES) {\n if (spec[prop] !== undefined) {\n if (prop === 'spacing') {\n const spacing = spec[prop];\n layout[prop] = isNumber(spacing)\n ? spacing\n : {\n row: (_a = spacing.row) !== null && _a !== void 0 ? _a : spacingConfig,\n column: (_b = spacing.column) !== null && _b !== void 0 ? _b : spacingConfig\n };\n }\n else {\n layout[prop] = spec[prop];\n }\n }\n }\n return layout;\n}\n//# sourceMappingURL=base.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isObject, mergeConfig } from 'vega-util';\nimport { AXIS_CONFIGS, isConditionalAxisValue } from './axis';\nimport { signalOrValueRefWithCondition, signalRefOrValue } from './compile/common';\nimport { getAllCompositeMarks } from './compositemark';\nimport { replaceExprRefInIndex } from './expr';\nimport { VL_ONLY_LEGEND_CONFIG } from './guide';\nimport { HEADER_CONFIGS } from './header';\nimport { defaultLegendConfig } from './legend';\nimport * as mark from './mark';\nimport { MARK_CONFIGS, PRIMITIVE_MARKS, VL_ONLY_MARK_CONFIG_PROPERTIES, VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX } from './mark';\nimport { assembleParameterSignals } from './parameter';\nimport { defaultScaleConfig } from './scale';\nimport { defaultConfig as defaultSelectionConfig } from './selection';\nimport { DEFAULT_SPACING, isStep } from './spec/base';\nimport { extractTitleConfig } from './title';\nimport { duplicate, getFirstDefined, isEmpty, keys, omit } from './util';\nexport function getViewConfigContinuousSize(viewConfig, channel) {\n var _a;\n return (_a = viewConfig[channel]) !== null && _a !== void 0 ? _a : viewConfig[channel === 'width' ? 'continuousWidth' : 'continuousHeight']; // get width/height for backwards compatibility\n}\nexport function getViewConfigDiscreteStep(viewConfig, channel) {\n const size = getViewConfigDiscreteSize(viewConfig, channel);\n return isStep(size) ? size.step : DEFAULT_STEP;\n}\nexport function getViewConfigDiscreteSize(viewConfig, channel) {\n var _a;\n const size = (_a = viewConfig[channel]) !== null && _a !== void 0 ? _a : viewConfig[channel === 'width' ? 'discreteWidth' : 'discreteHeight']; // get width/height for backwards compatibility\n return getFirstDefined(size, { step: viewConfig.step });\n}\nexport const DEFAULT_STEP = 20;\nexport const defaultViewConfig = {\n continuousWidth: 200,\n continuousHeight: 200,\n step: DEFAULT_STEP\n};\nexport function isVgScheme(rangeScheme) {\n return rangeScheme && !!rangeScheme['scheme'];\n}\nexport const defaultConfig = {\n background: 'white',\n padding: 5,\n timeFormat: '%b %d, %Y',\n countTitle: 'Count of Records',\n view: defaultViewConfig,\n mark: mark.defaultMarkConfig,\n arc: {},\n area: {},\n bar: mark.defaultBarConfig,\n circle: {},\n geoshape: {},\n image: {},\n line: {},\n point: {},\n rect: mark.defaultRectConfig,\n rule: { color: 'black' },\n square: {},\n text: { color: 'black' },\n tick: mark.defaultTickConfig,\n trail: {},\n boxplot: {\n size: 14,\n extent: 1.5,\n box: {},\n median: { color: 'white' },\n outliers: {},\n rule: {},\n ticks: null\n },\n errorbar: {\n center: 'mean',\n rule: true,\n ticks: false\n },\n errorband: {\n band: {\n opacity: 0.3\n },\n borders: false\n },\n scale: defaultScaleConfig,\n projection: {},\n legend: defaultLegendConfig,\n header: { titlePadding: 10, labelPadding: 10 },\n headerColumn: {},\n headerRow: {},\n headerFacet: {},\n selection: defaultSelectionConfig,\n style: {},\n title: {},\n facet: { spacing: DEFAULT_SPACING },\n concat: { spacing: DEFAULT_SPACING }\n};\n// Tableau10 color palette, copied from `vegaScale.scheme('tableau10')`\nconst tab10 = [\n '#4c78a8',\n '#f58518',\n '#e45756',\n '#72b7b2',\n '#54a24b',\n '#eeca3b',\n '#b279a2',\n '#ff9da6',\n '#9d755d',\n '#bab0ac'\n];\nexport const DEFAULT_FONT_SIZE = {\n text: 11,\n guideLabel: 10,\n guideTitle: 11,\n groupTitle: 13,\n groupSubtitle: 12\n};\nexport const DEFAULT_COLOR = {\n blue: tab10[0],\n orange: tab10[1],\n red: tab10[2],\n teal: tab10[3],\n green: tab10[4],\n yellow: tab10[5],\n purple: tab10[6],\n pink: tab10[7],\n brown: tab10[8],\n gray0: '#000',\n gray1: '#111',\n gray2: '#222',\n gray3: '#333',\n gray4: '#444',\n gray5: '#555',\n gray6: '#666',\n gray7: '#777',\n gray8: '#888',\n gray9: '#999',\n gray10: '#aaa',\n gray11: '#bbb',\n gray12: '#ccc',\n gray13: '#ddd',\n gray14: '#eee',\n gray15: '#fff'\n};\nexport function colorSignalConfig(color = {}) {\n return {\n signals: [\n {\n name: 'color',\n value: isObject(color) ? Object.assign(Object.assign({}, DEFAULT_COLOR), color) : DEFAULT_COLOR\n }\n ],\n mark: { color: { signal: 'color.blue' } },\n rule: { color: { signal: 'color.gray0' } },\n text: {\n color: { signal: 'color.gray0' }\n },\n style: {\n 'guide-label': {\n fill: { signal: 'color.gray0' }\n },\n 'guide-title': {\n fill: { signal: 'color.gray0' }\n },\n 'group-title': {\n fill: { signal: 'color.gray0' }\n },\n 'group-subtitle': {\n fill: { signal: 'color.gray0' }\n },\n cell: {\n stroke: { signal: 'color.gray8' }\n }\n },\n axis: {\n domainColor: { signal: 'color.gray13' },\n gridColor: { signal: 'color.gray8' },\n tickColor: { signal: 'color.gray13' }\n },\n range: {\n category: [\n { signal: 'color.blue' },\n { signal: 'color.orange' },\n { signal: 'color.red' },\n { signal: 'color.teal' },\n { signal: 'color.green' },\n { signal: 'color.yellow' },\n { signal: 'color.purple' },\n { signal: 'color.pink' },\n { signal: 'color.brown' },\n { signal: 'color.grey8' }\n ]\n }\n };\n}\nexport function fontSizeSignalConfig(fontSize) {\n return {\n signals: [\n {\n name: 'fontSize',\n value: isObject(fontSize) ? Object.assign(Object.assign({}, DEFAULT_FONT_SIZE), fontSize) : DEFAULT_FONT_SIZE\n }\n ],\n text: {\n fontSize: { signal: 'fontSize.text' }\n },\n style: {\n 'guide-label': {\n fontSize: { signal: 'fontSize.guideLabel' }\n },\n 'guide-title': {\n fontSize: { signal: 'fontSize.guideTitle' }\n },\n 'group-title': {\n fontSize: { signal: 'fontSize.groupTitle' }\n },\n 'group-subtitle': {\n fontSize: { signal: 'fontSize.groupSubtitle' }\n }\n }\n };\n}\nexport function fontConfig(font) {\n return {\n text: { font },\n style: {\n 'guide-label': { font },\n 'guide-title': { font },\n 'group-title': { font },\n 'group-subtitle': { font }\n }\n };\n}\nfunction getAxisConfigInternal(axisConfig) {\n const props = keys(axisConfig || {});\n const axisConfigInternal = {};\n for (const prop of props) {\n const val = axisConfig[prop];\n axisConfigInternal[prop] = isConditionalAxisValue(val)\n ? signalOrValueRefWithCondition(val)\n : signalRefOrValue(val);\n }\n return axisConfigInternal;\n}\nfunction getStyleConfigInternal(styleConfig) {\n const props = keys(styleConfig);\n const styleConfigInternal = {};\n for (const prop of props) {\n // We need to cast to cheat a bit here since styleConfig can be either mark config or axis config\n styleConfigInternal[prop] = getAxisConfigInternal(styleConfig[prop]);\n }\n return styleConfigInternal;\n}\nconst configPropsWithExpr = [\n ...MARK_CONFIGS,\n ...AXIS_CONFIGS,\n ...HEADER_CONFIGS,\n 'background',\n 'padding',\n 'legend',\n 'lineBreak',\n 'scale',\n 'style',\n 'title',\n 'view'\n];\n/**\n * Merge specified config with default config and config for the `color` flag,\n * then replace all expressions with signals\n */\nexport function initConfig(specifiedConfig = {}) {\n const { color, font, fontSize } = specifiedConfig, restConfig = __rest(specifiedConfig, [\"color\", \"font\", \"fontSize\"]);\n const mergedConfig = mergeConfig({}, defaultConfig, font ? fontConfig(font) : {}, color ? colorSignalConfig(color) : {}, fontSize ? fontSizeSignalConfig(fontSize) : {}, restConfig || {});\n const outputConfig = omit(mergedConfig, configPropsWithExpr);\n for (const prop of ['background', 'lineBreak', 'padding']) {\n if (mergedConfig[prop]) {\n outputConfig[prop] = signalRefOrValue(mergedConfig[prop]);\n }\n }\n for (const markConfigType of mark.MARK_CONFIGS) {\n if (mergedConfig[markConfigType]) {\n outputConfig[markConfigType] = replaceExprRefInIndex(mergedConfig[markConfigType]);\n }\n }\n for (const axisConfigType of AXIS_CONFIGS) {\n if (mergedConfig[axisConfigType]) {\n outputConfig[axisConfigType] = getAxisConfigInternal(mergedConfig[axisConfigType]);\n }\n }\n for (const headerConfigType of HEADER_CONFIGS) {\n if (mergedConfig[headerConfigType]) {\n outputConfig[headerConfigType] = replaceExprRefInIndex(mergedConfig[headerConfigType]);\n }\n }\n if (mergedConfig.legend) {\n outputConfig.legend = replaceExprRefInIndex(mergedConfig.legend);\n }\n if (mergedConfig.scale) {\n outputConfig.scale = replaceExprRefInIndex(mergedConfig.scale);\n }\n if (mergedConfig.style) {\n outputConfig.style = getStyleConfigInternal(mergedConfig.style);\n }\n if (mergedConfig.title) {\n outputConfig.title = replaceExprRefInIndex(mergedConfig.title);\n }\n if (mergedConfig.view) {\n outputConfig.view = replaceExprRefInIndex(mergedConfig.view);\n }\n return outputConfig;\n}\nconst MARK_STYLES = ['view', ...PRIMITIVE_MARKS];\nconst VL_ONLY_CONFIG_PROPERTIES = [\n 'color',\n 'fontSize',\n 'background',\n 'padding',\n 'facet',\n 'concat',\n 'numberFormat',\n 'timeFormat',\n 'countTitle',\n 'header',\n 'axisQuantitative',\n 'axisTemporal',\n 'axisDiscrete',\n 'axisPoint',\n 'axisXBand',\n 'axisXPoint',\n 'axisXDiscrete',\n 'axisXQuantitative',\n 'axisXTemporal',\n 'axisYBand',\n 'axisYPoint',\n 'axisYDiscrete',\n 'axisYQuantitative',\n 'axisYTemporal',\n 'scale',\n 'selection',\n 'overlay' // FIXME: Redesign and unhide this\n];\nconst VL_ONLY_ALL_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX = Object.assign({ view: ['continuousWidth', 'continuousHeight', 'discreteWidth', 'discreteHeight', 'step'] }, VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX);\nexport function stripAndRedirectConfig(config) {\n config = duplicate(config);\n for (const prop of VL_ONLY_CONFIG_PROPERTIES) {\n delete config[prop];\n }\n if (config.axis) {\n // delete condition axis config\n for (const prop in config.axis) {\n if (isConditionalAxisValue(config.axis[prop])) {\n delete config.axis[prop];\n }\n }\n }\n if (config.legend) {\n for (const prop of VL_ONLY_LEGEND_CONFIG) {\n delete config.legend[prop];\n }\n }\n // Remove Vega-Lite only generic mark config\n if (config.mark) {\n for (const prop of VL_ONLY_MARK_CONFIG_PROPERTIES) {\n delete config.mark[prop];\n }\n if (config.mark.tooltip && isObject(config.mark.tooltip)) {\n delete config.mark.tooltip;\n }\n }\n if (config.params) {\n config.signals = (config.signals || []).concat(assembleParameterSignals(config.params));\n delete config.params;\n }\n for (const markType of MARK_STYLES) {\n // Remove Vega-Lite-only mark config\n for (const prop of VL_ONLY_MARK_CONFIG_PROPERTIES) {\n delete config[markType][prop];\n }\n // Remove Vega-Lite only mark-specific config\n const vlOnlyMarkSpecificConfigs = VL_ONLY_ALL_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX[markType];\n if (vlOnlyMarkSpecificConfigs) {\n for (const prop of vlOnlyMarkSpecificConfigs) {\n delete config[markType][prop];\n }\n }\n // Redirect mark config to config.style so that mark config only affect its own mark type\n // without affecting other marks that share the same underlying Vega marks.\n // For example, config.rect should not affect bar marks.\n redirectConfigToStyleConfig(config, markType);\n }\n for (const m of getAllCompositeMarks()) {\n // Clean up the composite mark config as we don't need them in the output specs anymore\n delete config[m];\n }\n redirectTitleConfig(config);\n // Remove empty config objects.\n for (const prop in config) {\n if (isObject(config[prop]) && isEmpty(config[prop])) {\n delete config[prop];\n }\n }\n return isEmpty(config) ? undefined : config;\n}\n/**\n *\n * Redirect config.title -- so that title config do not affect header labels,\n * which also uses `title` directive to implement.\n *\n * For subtitle configs in config.title, keep them in config.title as header titles never have subtitles.\n */\nfunction redirectTitleConfig(config) {\n const { titleMarkConfig, subtitleMarkConfig, subtitle } = extractTitleConfig(config.title);\n // set config.style if title/subtitleMarkConfig is not an empty object\n if (!isEmpty(titleMarkConfig)) {\n config.style['group-title'] = Object.assign(Object.assign({}, config.style['group-title']), titleMarkConfig // config.title has higher precedence than config.style.group-title in Vega\n );\n }\n if (!isEmpty(subtitleMarkConfig)) {\n config.style['group-subtitle'] = Object.assign(Object.assign({}, config.style['group-subtitle']), subtitleMarkConfig);\n }\n // subtitle part can stay in config.title since header titles do not use subtitle\n if (!isEmpty(subtitle)) {\n config.title = subtitle;\n }\n else {\n delete config.title;\n }\n}\nfunction redirectConfigToStyleConfig(config, prop, // string = composite mark\ntoProp, compositeMarkPart) {\n const propConfig = compositeMarkPart ? config[prop][compositeMarkPart] : config[prop];\n if (prop === 'view') {\n toProp = 'cell'; // View's default style is \"cell\"\n }\n const style = Object.assign(Object.assign({}, propConfig), config.style[toProp !== null && toProp !== void 0 ? toProp : prop]);\n // set config.style if it is not an empty object\n if (!isEmpty(style)) {\n config.style[toProp !== null && toProp !== void 0 ? toProp : prop] = style;\n }\n if (!compositeMarkPart) {\n // For composite mark, so don't delete the whole config yet as we have to do multiple redirections.\n delete config[prop];\n }\n}\n//# sourceMappingURL=config.js.map","export function isLayerSpec(spec) {\n return 'layer' in spec;\n}\n//# sourceMappingURL=layer.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as log from '../log';\nimport { isConcatSpec, isHConcatSpec, isVConcatSpec } from './concat';\nimport { isFacetSpec } from './facet';\nimport { isLayerSpec } from './layer';\nimport { isRepeatSpec } from './repeat';\nimport { isUnitSpec } from './unit';\nexport class SpecMapper {\n map(spec, params) {\n if (isFacetSpec(spec)) {\n return this.mapFacet(spec, params);\n }\n else if (isRepeatSpec(spec)) {\n return this.mapRepeat(spec, params);\n }\n else if (isHConcatSpec(spec)) {\n return this.mapHConcat(spec, params);\n }\n else if (isVConcatSpec(spec)) {\n return this.mapVConcat(spec, params);\n }\n else if (isConcatSpec(spec)) {\n return this.mapConcat(spec, params);\n }\n else {\n return this.mapLayerOrUnit(spec, params);\n }\n }\n mapLayerOrUnit(spec, params) {\n if (isLayerSpec(spec)) {\n return this.mapLayer(spec, params);\n }\n else if (isUnitSpec(spec)) {\n return this.mapUnit(spec, params);\n }\n throw new Error(log.message.invalidSpec(spec));\n }\n mapLayer(spec, params) {\n return Object.assign(Object.assign({}, spec), { layer: spec.layer.map(subspec => this.mapLayerOrUnit(subspec, params)) });\n }\n mapHConcat(spec, params) {\n return Object.assign(Object.assign({}, spec), { hconcat: spec.hconcat.map(subspec => this.map(subspec, params)) });\n }\n mapVConcat(spec, params) {\n return Object.assign(Object.assign({}, spec), { vconcat: spec.vconcat.map(subspec => this.map(subspec, params)) });\n }\n mapConcat(spec, params) {\n const { concat } = spec, rest = __rest(spec, [\"concat\"]);\n return Object.assign(Object.assign({}, rest), { concat: concat.map(subspec => this.map(subspec, params)) });\n }\n mapFacet(spec, params) {\n return Object.assign(Object.assign({}, spec), { \n // TODO: remove \"any\" once we support all facet listed in https://github.com/vega/vega-lite/issues/2760\n spec: this.map(spec.spec, params) });\n }\n mapRepeat(spec, params) {\n return Object.assign(Object.assign({}, spec), { \n // as any is required here since TS cannot infer that the output type satisfies the input type\n spec: this.map(spec.spec, params) });\n }\n}\n//# sourceMappingURL=map.js.map","import { isArray } from 'vega-util';\nexport function isRepeatSpec(spec) {\n return 'repeat' in spec;\n}\nexport function isLayerRepeatSpec(spec) {\n return !isArray(spec.repeat) && spec.repeat['layer'];\n}\n//# sourceMappingURL=repeat.js.map","import { array, isBoolean } from 'vega-util';\nimport { SUM_OPS } from './aggregate';\nimport { getSecondaryRangeChannel, NONPOSITION_CHANNELS } from './channel';\nimport { channelDefType, getFieldDef, isFieldDef, isFieldOrDatumDef, vgField } from './channeldef';\nimport { channelHasField, isAggregate } from './encoding';\nimport * as log from './log';\nimport { ARC, AREA, BAR, CIRCLE, isMarkDef, isPathMark, LINE, POINT, RULE, SQUARE, TEXT, TICK } from './mark';\nimport { ScaleType } from './scale';\nimport { contains } from './util';\nconst STACK_OFFSET_INDEX = {\n zero: 1,\n center: 1,\n normalize: 1\n};\nexport function isStackOffset(s) {\n return s in STACK_OFFSET_INDEX;\n}\nexport const STACKABLE_MARKS = new Set([ARC, BAR, AREA, RULE, POINT, CIRCLE, SQUARE, LINE, TEXT, TICK]);\nexport const STACK_BY_DEFAULT_MARKS = new Set([BAR, AREA, ARC]);\nfunction potentialStackedChannel(encoding, x) {\n var _a, _b;\n const y = x === 'x' ? 'y' : 'radius';\n const xDef = encoding[x];\n const yDef = encoding[y];\n if (isFieldDef(xDef) && isFieldDef(yDef)) {\n if (channelDefType(xDef) === 'quantitative' && channelDefType(yDef) === 'quantitative') {\n if (xDef.stack) {\n return x;\n }\n else if (yDef.stack) {\n return y;\n }\n const xAggregate = isFieldDef(xDef) && !!xDef.aggregate;\n const yAggregate = isFieldDef(yDef) && !!yDef.aggregate;\n // if there is no explicit stacking, only apply stack if there is only one aggregate for x or y\n if (xAggregate !== yAggregate) {\n return xAggregate ? x : y;\n }\n else {\n const xScale = (_a = xDef.scale) === null || _a === void 0 ? void 0 : _a.type;\n const yScale = (_b = yDef.scale) === null || _b === void 0 ? void 0 : _b.type;\n if (xScale && xScale !== 'linear') {\n return y;\n }\n else if (yScale && yScale !== 'linear') {\n return x;\n }\n }\n }\n else if (channelDefType(xDef) === 'quantitative') {\n return x;\n }\n else if (channelDefType(yDef) === 'quantitative') {\n return y;\n }\n }\n else if (channelDefType(xDef) === 'quantitative') {\n return x;\n }\n else if (channelDefType(yDef) === 'quantitative') {\n return y;\n }\n return undefined;\n}\nfunction getDimensionChannel(channel) {\n switch (channel) {\n case 'x':\n return 'y';\n case 'y':\n return 'x';\n case 'theta':\n return 'radius';\n case 'radius':\n return 'theta';\n }\n}\n// Note: CompassQL uses this method and only pass in required properties of each argument object.\n// If required properties change, make sure to update CompassQL.\nexport function stack(m, encoding, opt = {}) {\n const mark = isMarkDef(m) ? m.type : m;\n // Should have stackable mark\n if (!STACKABLE_MARKS.has(mark)) {\n return null;\n }\n // Run potential stacked twice, one for Cartesian and another for Polar,\n // so text marks can be stacked in any of the coordinates.\n // Note: The logic here is not perfectly correct. If we want to support stacked dot plots where each dot is a pie chart with label, we have to change the stack logic here to separate Cartesian stacking for polar stacking.\n // However, since we probably never want to do that, let's just note the limitation here.\n const fieldChannel = potentialStackedChannel(encoding, 'x') || potentialStackedChannel(encoding, 'theta');\n if (!fieldChannel) {\n return null;\n }\n const stackedFieldDef = encoding[fieldChannel];\n const stackedField = isFieldDef(stackedFieldDef) ? vgField(stackedFieldDef, {}) : undefined;\n let dimensionChannel = getDimensionChannel(fieldChannel);\n let dimensionDef = encoding[dimensionChannel];\n let dimensionField = isFieldDef(dimensionDef) ? vgField(dimensionDef, {}) : undefined;\n // avoid grouping by the stacked field\n if (dimensionField === stackedField) {\n dimensionField = undefined;\n dimensionDef = undefined;\n dimensionChannel = undefined;\n }\n // Should have grouping level of detail that is different from the dimension field\n const stackBy = NONPOSITION_CHANNELS.reduce((sc, channel) => {\n // Ignore tooltip in stackBy (https://github.com/vega/vega-lite/issues/4001)\n if (channel !== 'tooltip' && channelHasField(encoding, channel)) {\n const channelDef = encoding[channel];\n for (const cDef of array(channelDef)) {\n const fieldDef = getFieldDef(cDef);\n if (fieldDef.aggregate) {\n continue;\n }\n // Check whether the channel's field is identical to x/y's field or if the channel is a repeat\n const f = vgField(fieldDef, {});\n if (\n // if fielddef is a repeat, just include it in the stack by\n !f ||\n // otherwise, the field must be different from x and y fields.\n f !== dimensionField) {\n sc.push({ channel, fieldDef });\n }\n }\n }\n return sc;\n }, []);\n // Automatically determine offset\n let offset;\n if (stackedFieldDef.stack !== undefined) {\n if (isBoolean(stackedFieldDef.stack)) {\n offset = stackedFieldDef.stack ? 'zero' : null;\n }\n else {\n offset = stackedFieldDef.stack;\n }\n }\n else if (stackBy.length > 0 && STACK_BY_DEFAULT_MARKS.has(mark)) {\n // Bar and Area with sum ops are automatically stacked by default\n offset = 'zero';\n }\n if (!offset || !isStackOffset(offset)) {\n return null;\n }\n if (isAggregate(encoding) && stackBy.length === 0) {\n return null;\n }\n // warn when stacking non-linear\n if (stackedFieldDef.scale && stackedFieldDef.scale.type && stackedFieldDef.scale.type !== ScaleType.LINEAR) {\n if (opt.disallowNonLinearStack) {\n return null;\n }\n else {\n log.warn(log.message.cannotStackNonLinearScale(stackedFieldDef.scale.type));\n }\n }\n // Check if it is a ranged mark\n if (isFieldOrDatumDef(encoding[getSecondaryRangeChannel(fieldChannel)])) {\n if (stackedFieldDef.stack !== undefined) {\n log.warn(log.message.cannotStackRangedMark(fieldChannel));\n }\n return null;\n }\n // Warn if stacking non-summative aggregate\n if (isFieldDef(stackedFieldDef) && stackedFieldDef.aggregate && !contains(SUM_OPS, stackedFieldDef.aggregate)) {\n log.warn(log.message.stackNonSummativeAggregate(stackedFieldDef.aggregate));\n }\n return {\n groupbyChannel: dimensionDef ? dimensionChannel : undefined,\n groupbyField: dimensionField,\n fieldChannel,\n impute: stackedFieldDef.impute === null ? false : isPathMark(mark),\n stackBy,\n offset\n };\n}\n//# sourceMappingURL=stack.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isObject } from 'vega-util';\nimport { normalizeEncoding } from '../encoding';\nimport { isMarkDef } from '../mark';\nimport { isUnitSpec } from '../spec/unit';\nimport { stack } from '../stack';\nimport { keys, omit, pick } from '../util';\nfunction dropLineAndPoint(markDef) {\n const { point: _point, line: _line } = markDef, mark = __rest(markDef, [\"point\", \"line\"]);\n return keys(mark).length > 1 ? mark : mark.type;\n}\nfunction dropLineAndPointFromConfig(config) {\n for (const mark of ['line', 'area', 'rule', 'trail']) {\n if (config[mark]) {\n config = Object.assign(Object.assign({}, config), { \n // TODO: remove as any\n [mark]: omit(config[mark], ['point', 'line']) });\n }\n }\n return config;\n}\nfunction getPointOverlay(markDef, markConfig = {}, encoding) {\n if (markDef.point === 'transparent') {\n return { opacity: 0 };\n }\n else if (markDef.point) {\n // truthy : true or object\n return isObject(markDef.point) ? markDef.point : {};\n }\n else if (markDef.point !== undefined) {\n // false or null\n return null;\n }\n else {\n // undefined (not disabled)\n if (markConfig.point || encoding.shape) {\n // enable point overlay if config[mark].point is truthy or if encoding.shape is provided\n return isObject(markConfig.point) ? markConfig.point : {};\n }\n // markDef.point is defined as falsy\n return undefined;\n }\n}\nfunction getLineOverlay(markDef, markConfig = {}) {\n if (markDef.line) {\n // true or object\n return markDef.line === true ? {} : markDef.line;\n }\n else if (markDef.line !== undefined) {\n // false or null\n return null;\n }\n else {\n // undefined (not disabled)\n if (markConfig.line) {\n // enable line overlay if config[mark].line is truthy\n return markConfig.line === true ? {} : markConfig.line;\n }\n // markDef.point is defined as falsy\n return undefined;\n }\n}\nexport class PathOverlayNormalizer {\n constructor() {\n this.name = 'path-overlay';\n }\n hasMatchingType(spec, config) {\n if (isUnitSpec(spec)) {\n const { mark, encoding } = spec;\n const markDef = isMarkDef(mark) ? mark : { type: mark };\n switch (markDef.type) {\n case 'line':\n case 'rule':\n case 'trail':\n return !!getPointOverlay(markDef, config[markDef.type], encoding);\n case 'area':\n return (\n // false / null are also included as we want to remove the properties\n !!getPointOverlay(markDef, config[markDef.type], encoding) ||\n !!getLineOverlay(markDef, config[markDef.type]));\n }\n }\n return false;\n }\n run(spec, params, normalize) {\n const { config } = params;\n const { selection, projection, mark, encoding: e } = spec, outerSpec = __rest(spec, [\"selection\", \"projection\", \"mark\", \"encoding\"]);\n // Need to call normalizeEncoding because we need the inferred types to correctly determine stack\n const encoding = normalizeEncoding(e, config);\n const markDef = isMarkDef(mark) ? mark : { type: mark };\n const pointOverlay = getPointOverlay(markDef, config[markDef.type], encoding);\n const lineOverlay = markDef.type === 'area' && getLineOverlay(markDef, config[markDef.type]);\n const layer = [\n Object.assign(Object.assign({}, (selection ? { selection } : {})), { mark: dropLineAndPoint(Object.assign(Object.assign({}, (markDef.type === 'area' && markDef.opacity === undefined && markDef.fillOpacity === undefined\n ? { opacity: 0.7 }\n : {})), markDef)), \n // drop shape from encoding as this might be used to trigger point overlay\n encoding: omit(encoding, ['shape']) })\n ];\n // FIXME: determine rules for applying selections.\n // Need to copy stack config to overlayed layer\n const stackProps = stack(markDef, encoding);\n let overlayEncoding = encoding;\n if (stackProps) {\n const { fieldChannel: stackFieldChannel, offset } = stackProps;\n overlayEncoding = Object.assign(Object.assign({}, encoding), { [stackFieldChannel]: Object.assign(Object.assign({}, encoding[stackFieldChannel]), (offset ? { stack: offset } : {})) });\n }\n if (lineOverlay) {\n layer.push(Object.assign(Object.assign({}, (projection ? { projection } : {})), { mark: Object.assign(Object.assign({ type: 'line' }, pick(markDef, ['clip', 'interpolate', 'tension', 'tooltip'])), lineOverlay), encoding: overlayEncoding }));\n }\n if (pointOverlay) {\n layer.push(Object.assign(Object.assign({}, (projection ? { projection } : {})), { mark: Object.assign(Object.assign({ type: 'point', opacity: 1, filled: true }, pick(markDef, ['clip', 'tooltip'])), pointOverlay), encoding: overlayEncoding }));\n }\n return normalize(Object.assign(Object.assign({}, outerSpec), { layer }), Object.assign(Object.assign({}, params), { config: dropLineAndPointFromConfig(config) }));\n }\n}\n//# sourceMappingURL=pathoverlay.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { getSizeChannel, POSITION_SCALE_CHANNELS } from '../channel';\nimport { isFieldOrDatumDef } from '../channeldef';\nimport * as log from '../log';\nimport { isUnitSpec } from '../spec/unit';\nimport { isEmpty } from '../util';\nexport class RangeStepNormalizer {\n constructor() {\n this.name = 'RangeStep';\n }\n hasMatchingType(spec) {\n var _a;\n if (isUnitSpec(spec) && spec.encoding) {\n for (const channel of POSITION_SCALE_CHANNELS) {\n const def = spec.encoding[channel];\n if (def && isFieldOrDatumDef(def)) {\n if ((_a = def === null || def === void 0 ? void 0 : def.scale) === null || _a === void 0 ? void 0 : _a['rangeStep']) {\n return true;\n }\n }\n }\n }\n return false;\n }\n run(spec) {\n var _a;\n const sizeMixins = {};\n let encoding = Object.assign({}, spec.encoding);\n for (const channel of POSITION_SCALE_CHANNELS) {\n const sizeType = getSizeChannel(channel);\n const def = encoding[channel];\n if (def && isFieldOrDatumDef(def)) {\n if ((_a = def === null || def === void 0 ? void 0 : def.scale) === null || _a === void 0 ? void 0 : _a['rangeStep']) {\n const { scale } = def, defWithoutScale = __rest(def, [\"scale\"]);\n const _b = scale, { rangeStep } = _b, scaleWithoutRangeStep = __rest(_b, [\"rangeStep\"]);\n sizeMixins[sizeType] = { step: scale['rangeStep'] };\n log.warn(log.message.RANGE_STEP_DEPRECATED);\n encoding = Object.assign(Object.assign({}, encoding), { [channel]: Object.assign(Object.assign({}, defWithoutScale), (isEmpty(scaleWithoutRangeStep) ? {} : { scale: scaleWithoutRangeStep })) });\n }\n }\n }\n return Object.assign(Object.assign(Object.assign({}, sizeMixins), spec), { encoding });\n }\n}\n//# sourceMappingURL=rangestep.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { hasOwnProperty, isArray } from 'vega-util';\nimport { hasConditionalFieldOrDatumDef, isConditionalDef, isFieldDef, isFieldOrDatumDef, isRepeatRef, isSortableFieldDef } from '../channeldef';\nimport * as log from '../log';\nimport { isSortField } from '../sort';\nimport { isFacetMapping } from '../spec/facet';\nexport function replaceRepeaterInFacet(facet, repeater) {\n if (!repeater) {\n return facet;\n }\n if (isFacetMapping(facet)) {\n return replaceRepeaterInMapping(facet, repeater);\n }\n return replaceRepeaterInFieldDef(facet, repeater);\n}\nexport function replaceRepeaterInEncoding(encoding, repeater) {\n if (!repeater) {\n return encoding;\n }\n return replaceRepeaterInMapping(encoding, repeater);\n}\n/**\n * Replaces repeated value and returns if the repeated value is valid.\n */\nfunction replaceRepeatInProp(prop, o, repeater) {\n const val = o[prop];\n if (isRepeatRef(val)) {\n if (val.repeat in repeater) {\n return Object.assign(Object.assign({}, o), { [prop]: repeater[val.repeat] });\n }\n else {\n log.warn(log.message.noSuchRepeatedValue(val.repeat));\n return undefined;\n }\n }\n return o;\n}\n/**\n * Replace repeater values in a field def with the concrete field name.\n */\nfunction replaceRepeaterInFieldDef(fieldDef, repeater) {\n fieldDef = replaceRepeatInProp('field', fieldDef, repeater);\n if (fieldDef === undefined) {\n // the field def should be ignored\n return undefined;\n }\n else if (fieldDef === null) {\n return null;\n }\n if (isSortableFieldDef(fieldDef) && isSortField(fieldDef.sort)) {\n const sort = replaceRepeatInProp('field', fieldDef.sort, repeater);\n fieldDef = Object.assign(Object.assign({}, fieldDef), (sort ? { sort } : {}));\n }\n return fieldDef;\n}\nfunction replaceRepeaterInFieldOrDatumDef(def, repeater) {\n if (isFieldDef(def)) {\n return replaceRepeaterInFieldDef(def, repeater);\n }\n else {\n const datumDef = replaceRepeatInProp('datum', def, repeater);\n if (datumDef !== def && !datumDef.type) {\n datumDef.type = 'nominal';\n }\n return datumDef;\n }\n}\nfunction replaceRepeaterInChannelDef(channelDef, repeater) {\n if (isFieldOrDatumDef(channelDef)) {\n const fd = replaceRepeaterInFieldOrDatumDef(channelDef, repeater);\n if (fd) {\n return fd;\n }\n else if (isConditionalDef(channelDef)) {\n return { condition: channelDef.condition };\n }\n }\n else {\n if (hasConditionalFieldOrDatumDef(channelDef)) {\n const fd = replaceRepeaterInFieldOrDatumDef(channelDef.condition, repeater);\n if (fd) {\n return Object.assign(Object.assign({}, channelDef), { condition: fd });\n }\n else {\n const { condition } = channelDef, channelDefWithoutCondition = __rest(channelDef, [\"condition\"]);\n return channelDefWithoutCondition;\n }\n }\n return channelDef;\n }\n return undefined;\n}\nfunction replaceRepeaterInMapping(mapping, repeater) {\n const out = {};\n for (const channel in mapping) {\n if (hasOwnProperty(mapping, channel)) {\n const channelDef = mapping[channel];\n if (isArray(channelDef)) {\n // array cannot have condition\n out[channel] = channelDef // somehow we need to cast it here\n .map(cd => replaceRepeaterInChannelDef(cd, repeater))\n .filter(cd => cd);\n }\n else {\n const cd = replaceRepeaterInChannelDef(channelDef, repeater);\n if (cd !== undefined) {\n out[channel] = cd;\n }\n }\n }\n }\n return out;\n}\n//# sourceMappingURL=repeater.js.map","import { isBinned } from '../bin';\nimport { getMainRangeChannel, SECONDARY_RANGE_CHANNEL } from '../channel';\nimport { isDatumDef, isFieldDef } from '../channeldef';\nimport * as log from '../log';\nimport { isUnitSpec } from '../spec/unit';\nexport class RuleForRangedLineNormalizer {\n constructor() {\n this.name = 'RuleForRangedLine';\n }\n hasMatchingType(spec) {\n if (isUnitSpec(spec)) {\n const { encoding, mark } = spec;\n if (mark === 'line') {\n for (const channel of SECONDARY_RANGE_CHANNEL) {\n const mainChannel = getMainRangeChannel(channel);\n const mainChannelDef = encoding[mainChannel];\n if (encoding[channel]) {\n if ((isFieldDef(mainChannelDef) && !isBinned(mainChannelDef.bin)) || isDatumDef(mainChannelDef)) {\n return true;\n }\n }\n }\n }\n }\n return false;\n }\n run(spec, params, normalize) {\n const { encoding } = spec;\n log.warn(log.message.lineWithRange(!!encoding.x2, !!encoding.y2));\n return normalize(Object.assign(Object.assign({}, spec), { mark: 'rule' }), params);\n }\n}\n//# sourceMappingURL=ruleforrangedline.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray } from 'vega-util';\nimport { COLUMN, FACET, ROW } from '../channel';\nimport { hasConditionalFieldOrDatumDef, isFieldOrDatumDef, isValueDef } from '../channeldef';\nimport { boxPlotNormalizer } from '../compositemark/boxplot';\nimport { errorBandNormalizer } from '../compositemark/errorband';\nimport { errorBarNormalizer } from '../compositemark/errorbar';\nimport { channelHasField } from '../encoding';\nimport * as log from '../log';\nimport { isFacetMapping } from '../spec/facet';\nimport { SpecMapper } from '../spec/map';\nimport { isLayerRepeatSpec } from '../spec/repeat';\nimport { isUnitSpec } from '../spec/unit';\nimport { isEmpty, keys, omit, varName } from '../util';\nimport { isSignalRef } from '../vega.schema';\nimport { PathOverlayNormalizer } from './pathoverlay';\nimport { RangeStepNormalizer } from './rangestep';\nimport { replaceRepeaterInEncoding, replaceRepeaterInFacet } from './repeater';\nimport { RuleForRangedLineNormalizer } from './ruleforrangedline';\nexport class CoreNormalizer extends SpecMapper {\n constructor() {\n super(...arguments);\n this.nonFacetUnitNormalizers = [\n boxPlotNormalizer,\n errorBarNormalizer,\n errorBandNormalizer,\n new PathOverlayNormalizer(),\n new RuleForRangedLineNormalizer(),\n new RangeStepNormalizer()\n ];\n }\n map(spec, params) {\n // Special handling for a faceted unit spec as it can return a facet spec, not just a layer or unit spec like a normal unit spec.\n if (isUnitSpec(spec)) {\n const hasRow = channelHasField(spec.encoding, ROW);\n const hasColumn = channelHasField(spec.encoding, COLUMN);\n const hasFacet = channelHasField(spec.encoding, FACET);\n if (hasRow || hasColumn || hasFacet) {\n return this.mapFacetedUnit(spec, params);\n }\n }\n return super.map(spec, params);\n }\n // This is for normalizing non-facet unit\n mapUnit(spec, params) {\n const { parentEncoding, parentProjection } = params;\n const encoding = replaceRepeaterInEncoding(spec.encoding, params.repeater);\n const specWithReplacedEncoding = Object.assign(Object.assign({}, spec), (encoding ? { encoding } : {}));\n if (parentEncoding || parentProjection) {\n return this.mapUnitWithParentEncodingOrProjection(specWithReplacedEncoding, params);\n }\n const normalizeLayerOrUnit = this.mapLayerOrUnit.bind(this);\n for (const unitNormalizer of this.nonFacetUnitNormalizers) {\n if (unitNormalizer.hasMatchingType(specWithReplacedEncoding, params.config)) {\n return unitNormalizer.run(specWithReplacedEncoding, params, normalizeLayerOrUnit);\n }\n }\n return specWithReplacedEncoding;\n }\n mapRepeat(spec, params) {\n if (isLayerRepeatSpec(spec)) {\n return this.mapLayerRepeat(spec, params);\n }\n else {\n return this.mapNonLayerRepeat(spec, params);\n }\n }\n mapLayerRepeat(spec, params) {\n const { repeat, spec: childSpec } = spec, rest = __rest(spec, [\"repeat\", \"spec\"]);\n const { row, column, layer } = repeat;\n const { repeater = {}, repeaterPrefix = '' } = params;\n if (row || column) {\n return this.mapRepeat(Object.assign(Object.assign({}, spec), { repeat: Object.assign(Object.assign({}, (row ? { row } : {})), (column ? { column } : {})), spec: {\n repeat: { layer },\n spec: childSpec\n } }), params);\n }\n else {\n return Object.assign(Object.assign({}, rest), { layer: layer.map(layerValue => {\n const childRepeater = Object.assign(Object.assign({}, repeater), { layer: layerValue });\n const childName = (childSpec.name || '') + repeaterPrefix + `child__layer_${varName(layerValue)}`;\n const child = this.mapLayerOrUnit(childSpec, Object.assign(Object.assign({}, params), { repeater: childRepeater, repeaterPrefix: childName }));\n child.name = childName;\n return child;\n }) });\n }\n }\n mapNonLayerRepeat(spec, params) {\n var _a;\n const { repeat, spec: childSpec, data } = spec, remainingProperties = __rest(spec, [\"repeat\", \"spec\", \"data\"]);\n if (!isArray(repeat) && spec.columns) {\n // is repeat with row/column\n spec = omit(spec, ['columns']);\n log.warn(log.message.columnsNotSupportByRowCol('repeat'));\n }\n const concat = [];\n const { repeater = {}, repeaterPrefix = '' } = params;\n const row = (!isArray(repeat) && repeat.row) || [repeater ? repeater.row : null];\n const column = (!isArray(repeat) && repeat.column) || [repeater ? repeater.column : null];\n const repeatValues = (isArray(repeat) && repeat) || [repeater ? repeater.repeat : null];\n // cross product\n for (const repeatValue of repeatValues) {\n for (const rowValue of row) {\n for (const columnValue of column) {\n const childRepeater = {\n repeat: repeatValue,\n row: rowValue,\n column: columnValue,\n layer: repeater.layer\n };\n const childName = (childSpec.name || '') +\n repeaterPrefix +\n 'child__' +\n (isArray(repeat)\n ? `${varName(repeatValue)}`\n : (repeat.row ? `row_${varName(rowValue)}` : '') +\n (repeat.column ? `column_${varName(columnValue)}` : ''));\n const child = this.map(childSpec, Object.assign(Object.assign({}, params), { repeater: childRepeater, repeaterPrefix: childName }));\n child.name = childName;\n // we move data up\n concat.push(omit(child, ['data']));\n }\n }\n }\n const columns = isArray(repeat) ? spec.columns : repeat.column ? repeat.column.length : 1;\n return Object.assign(Object.assign({ data: (_a = childSpec.data) !== null && _a !== void 0 ? _a : data, align: 'all' }, remainingProperties), { columns,\n concat });\n }\n mapFacet(spec, params) {\n const { facet } = spec;\n if (isFacetMapping(facet) && spec.columns) {\n // is facet with row/column\n spec = omit(spec, ['columns']);\n log.warn(log.message.columnsNotSupportByRowCol('facet'));\n }\n return super.mapFacet(spec, params);\n }\n mapUnitWithParentEncodingOrProjection(spec, params) {\n const { encoding, projection } = spec;\n const { parentEncoding, parentProjection, config } = params;\n const mergedProjection = mergeProjection({ parentProjection, projection });\n const mergedEncoding = mergeEncoding({\n parentEncoding,\n encoding: replaceRepeaterInEncoding(encoding, params.repeater)\n });\n return this.mapUnit(Object.assign(Object.assign(Object.assign({}, spec), (mergedProjection ? { projection: mergedProjection } : {})), (mergedEncoding ? { encoding: mergedEncoding } : {})), { config });\n }\n mapFacetedUnit(spec, params) {\n // New encoding in the inside spec should not contain row / column\n // as row/column should be moved to facet\n const _a = spec.encoding, { row, column, facet } = _a, encoding = __rest(_a, [\"row\", \"column\", \"facet\"]);\n // Mark and encoding should be moved into the inner spec\n const { mark, width, projection, height, view, selection, encoding: _ } = spec, outerSpec = __rest(spec, [\"mark\", \"width\", \"projection\", \"height\", \"view\", \"selection\", \"encoding\"]);\n const { facetMapping, layout } = this.getFacetMappingAndLayout({ row, column, facet }, params);\n const newEncoding = replaceRepeaterInEncoding(encoding, params.repeater);\n return this.mapFacet(Object.assign(Object.assign(Object.assign({}, outerSpec), layout), { \n // row / column has higher precedence than facet\n facet: facetMapping, spec: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (width ? { width } : {})), (height ? { height } : {})), (view ? { view } : {})), (projection ? { projection } : {})), { mark, encoding: newEncoding }), (selection ? { selection } : {})) }), params);\n }\n getFacetMappingAndLayout(facets, params) {\n var _a;\n const { row, column, facet } = facets;\n if (row || column) {\n if (facet) {\n log.warn(log.message.facetChannelDropped([...(row ? [ROW] : []), ...(column ? [COLUMN] : [])]));\n }\n const facetMapping = {};\n const layout = {};\n for (const channel of [ROW, COLUMN]) {\n const def = facets[channel];\n if (def) {\n const { align, center, spacing, columns } = def, defWithoutLayout = __rest(def, [\"align\", \"center\", \"spacing\", \"columns\"]);\n facetMapping[channel] = defWithoutLayout;\n for (const prop of ['align', 'center', 'spacing']) {\n if (def[prop] !== undefined) {\n layout[prop] = (_a = layout[prop]) !== null && _a !== void 0 ? _a : {};\n layout[prop][channel] = def[prop];\n }\n }\n }\n }\n return { facetMapping, layout };\n }\n else {\n const { align, center, spacing, columns } = facet, facetMapping = __rest(facet, [\"align\", \"center\", \"spacing\", \"columns\"]);\n return {\n facetMapping: replaceRepeaterInFacet(facetMapping, params.repeater),\n layout: Object.assign(Object.assign(Object.assign(Object.assign({}, (align ? { align } : {})), (center ? { center } : {})), (spacing ? { spacing } : {})), (columns ? { columns } : {}))\n };\n }\n }\n mapLayer(spec, _a) {\n // Special handling for extended layer spec\n var { parentEncoding, parentProjection } = _a, otherParams = __rest(_a, [\"parentEncoding\", \"parentProjection\"]);\n const { encoding, projection } = spec, rest = __rest(spec, [\"encoding\", \"projection\"]);\n const params = Object.assign(Object.assign({}, otherParams), { parentEncoding: mergeEncoding({ parentEncoding, encoding, layer: true }), parentProjection: mergeProjection({ parentProjection, projection }) });\n return super.mapLayer(rest, params);\n }\n}\nfunction mergeEncoding({ parentEncoding, encoding = {}, layer }) {\n let merged = {};\n if (parentEncoding) {\n const channels = new Set([...keys(parentEncoding), ...keys(encoding)]);\n for (const channel of channels) {\n const channelDef = encoding[channel];\n const parentChannelDef = parentEncoding[channel];\n if (isFieldOrDatumDef(channelDef)) {\n // Field/Datum Def can inherit properties from its parent\n // Note that parentChannelDef doesn't have to be a field/datum def if the channelDef is already one.\n const mergedChannelDef = Object.assign(Object.assign({}, parentChannelDef), channelDef);\n merged[channel] = mergedChannelDef;\n }\n else if (hasConditionalFieldOrDatumDef(channelDef)) {\n merged[channel] = Object.assign(Object.assign({}, channelDef), { condition: Object.assign(Object.assign({}, parentChannelDef), channelDef.condition) });\n }\n else if (channelDef || channelDef === null) {\n merged[channel] = channelDef;\n }\n else if (layer ||\n isValueDef(parentChannelDef) ||\n isSignalRef(parentChannelDef) ||\n isFieldOrDatumDef(parentChannelDef) ||\n isArray(parentChannelDef)) {\n merged[channel] = parentChannelDef;\n }\n }\n }\n else {\n merged = encoding;\n }\n return !merged || isEmpty(merged) ? undefined : merged;\n}\nfunction mergeProjection(opt) {\n const { parentProjection, projection } = opt;\n if (parentProjection && projection) {\n log.warn(log.message.projectionOverridden({ parentProjection, projection }));\n }\n return projection !== null && projection !== void 0 ? projection : parentProjection;\n}\n//# sourceMappingURL=core.js.map","import { isString } from 'vega-util';\nimport { initConfig } from '../config';\nimport * as log from '../log';\nimport { isLayerSpec, isUnitSpec } from '../spec';\nimport { deepEqual } from '../util';\nimport { CoreNormalizer } from './core';\nexport function normalize(spec, config) {\n if (config === undefined) {\n config = initConfig(spec.config);\n }\n const normalizedSpec = normalizeGenericSpec(spec, config);\n const { width, height } = spec;\n const autosize = normalizeAutoSize(normalizedSpec, { width, height, autosize: spec.autosize }, config);\n return Object.assign(Object.assign({}, normalizedSpec), (autosize ? { autosize } : {}));\n}\nconst normalizer = new CoreNormalizer();\n/**\n * Decompose extended unit specs into composition of pure unit specs.\n */\nfunction normalizeGenericSpec(spec, config = {}) {\n return normalizer.map(spec, { config });\n}\nfunction _normalizeAutoSize(autosize) {\n return isString(autosize) ? { type: autosize } : autosize !== null && autosize !== void 0 ? autosize : {};\n}\n/**\n * Normalize autosize and deal with width or height == \"container\".\n */\nexport function normalizeAutoSize(spec, sizeInfo, config) {\n let { width, height } = sizeInfo;\n const isFitCompatible = isUnitSpec(spec) || isLayerSpec(spec);\n const autosizeDefault = {};\n if (!isFitCompatible) {\n // If spec is not compatible with autosize == \"fit\", discard width/height == container\n if (width == 'container') {\n log.warn(log.message.containerSizeNonSingle('width'));\n width = undefined;\n }\n if (height == 'container') {\n log.warn(log.message.containerSizeNonSingle('height'));\n height = undefined;\n }\n }\n else {\n // Default autosize parameters to fit when width/height is \"container\"\n if (width == 'container' && height == 'container') {\n autosizeDefault.type = 'fit';\n autosizeDefault.contains = 'padding';\n }\n else if (width == 'container') {\n autosizeDefault.type = 'fit-x';\n autosizeDefault.contains = 'padding';\n }\n else if (height == 'container') {\n autosizeDefault.type = 'fit-y';\n autosizeDefault.contains = 'padding';\n }\n }\n const autosize = Object.assign(Object.assign(Object.assign({ type: 'pad' }, autosizeDefault), (config ? _normalizeAutoSize(config.autosize) : {})), _normalizeAutoSize(spec.autosize));\n if (autosize.type === 'fit' && !isFitCompatible) {\n log.warn(log.message.FIT_NON_SINGLE);\n autosize.type = 'pad';\n }\n if (width == 'container' && !(autosize.type == 'fit' || autosize.type == 'fit-x')) {\n log.warn(log.message.containerSizeNotCompatibleWithAutosize('width'));\n }\n if (height == 'container' && !(autosize.type == 'fit' || autosize.type == 'fit-y')) {\n log.warn(log.message.containerSizeNotCompatibleWithAutosize('height'));\n }\n // Delete autosize property if it's Vega's default\n if (deepEqual(autosize, { type: 'pad' })) {\n return undefined;\n }\n return autosize;\n}\n//# sourceMappingURL=index.js.map","import { getPositionScaleChannel } from '../channel';\nimport { signalRefOrValue } from '../compile/common';\nexport function isFitType(autoSizeType) {\n return autoSizeType === 'fit' || autoSizeType === 'fit-x' || autoSizeType === 'fit-y';\n}\nexport function getFitType(sizeType) {\n return sizeType ? `fit-${getPositionScaleChannel(sizeType)}` : 'fit';\n}\nconst TOP_LEVEL_PROPERTIES = [\n 'background',\n 'padding'\n // We do not include \"autosize\" here as it is supported by only unit and layer specs and thus need to be normalized\n];\nexport function extractTopLevelProperties(t, includeParams) {\n const o = {};\n for (const p of TOP_LEVEL_PROPERTIES) {\n if (t && t[p] !== undefined) {\n o[p] = signalRefOrValue(t[p]);\n }\n }\n if (includeParams) {\n o.params = t.params;\n }\n return o;\n}\n//# sourceMappingURL=toplevel.js.map","import * as log from '../log';\nimport { deepEqual, duplicate, getFirstDefined, keys } from '../util';\n/**\n * Generic class for storing properties that are explicitly specified\n * and implicitly determined by the compiler.\n * This is important for scale/axis/legend merging as\n * we want to prioritize properties that users explicitly specified.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport class Split {\n constructor(explicit = {}, implicit = {}) {\n this.explicit = explicit;\n this.implicit = implicit;\n }\n clone() {\n return new Split(duplicate(this.explicit), duplicate(this.implicit));\n }\n combine() {\n // FIXME remove \"as any\".\n // Add \"as any\" to avoid an error \"Spread types may only be created from object types\".\n return Object.assign(Object.assign({}, this.explicit), this.implicit);\n }\n get(key) {\n // Explicit has higher precedence\n return getFirstDefined(this.explicit[key], this.implicit[key]);\n }\n getWithExplicit(key) {\n // Explicit has higher precedence\n if (this.explicit[key] !== undefined) {\n return { explicit: true, value: this.explicit[key] };\n }\n else if (this.implicit[key] !== undefined) {\n return { explicit: false, value: this.implicit[key] };\n }\n return { explicit: false, value: undefined };\n }\n setWithExplicit(key, value) {\n if (value.value !== undefined) {\n this.set(key, value.value, value.explicit);\n }\n }\n set(key, value, explicit) {\n delete this[explicit ? 'implicit' : 'explicit'][key];\n this[explicit ? 'explicit' : 'implicit'][key] = value;\n return this;\n }\n copyKeyFromSplit(key, s) {\n // Explicit has higher precedence\n if (s.explicit[key] !== undefined) {\n this.set(key, s.explicit[key], true);\n }\n else if (s.implicit[key] !== undefined) {\n this.set(key, s.implicit[key], false);\n }\n }\n copyKeyFromObject(key, s) {\n // Explicit has higher precedence\n if (s[key] !== undefined) {\n this.set(key, s[key], true);\n }\n }\n /**\n * Merge split object into this split object. Properties from the other split\n * overwrite properties from this split.\n */\n copyAll(other) {\n for (const key of keys(other.combine())) {\n const val = other.getWithExplicit(key);\n this.setWithExplicit(key, val);\n }\n }\n}\nexport function makeExplicit(value) {\n return {\n explicit: true,\n value\n };\n}\nexport function makeImplicit(value) {\n return {\n explicit: false,\n value\n };\n}\nexport function tieBreakByComparing(compare) {\n return (v1, v2, property, propertyOf) => {\n const diff = compare(v1.value, v2.value);\n if (diff > 0) {\n return v1;\n }\n else if (diff < 0) {\n return v2;\n }\n return defaultTieBreaker(v1, v2, property, propertyOf);\n };\n}\nexport function defaultTieBreaker(v1, v2, property, propertyOf) {\n if (v1.explicit && v2.explicit) {\n log.warn(log.message.mergeConflictingProperty(property, propertyOf, v1.value, v2.value));\n }\n // If equal score, prefer v1.\n return v1;\n}\nexport function mergeValuesWithExplicit(v1, v2, property, propertyOf, tieBreaker = defaultTieBreaker) {\n if (v1 === undefined || v1.value === undefined) {\n // For first run\n return v2;\n }\n if (v1.explicit && !v2.explicit) {\n return v1;\n }\n else if (v2.explicit && !v1.explicit) {\n return v2;\n }\n else if (deepEqual(v1.value, v2.value)) {\n return v1;\n }\n else {\n return tieBreaker(v1, v2, property, propertyOf);\n }\n}\n//# sourceMappingURL=split.js.map","import { Split } from '../split';\n/**\n * Class to track interesting properties (see https://15721.courses.cs.cmu.edu/spring2016/papers/graefe-ieee1995.pdf)\n * about how fields have been parsed or whether they have been derived in a transform. We use this to not parse the\n * same field again (or differently).\n */\nexport class AncestorParse extends Split {\n constructor(explicit = {}, implicit = {}, parseNothing = false) {\n super(explicit, implicit);\n this.explicit = explicit;\n this.implicit = implicit;\n this.parseNothing = parseNothing;\n }\n clone() {\n const clone = super.clone();\n clone.parseNothing = this.parseNothing;\n return clone;\n }\n}\n//# sourceMappingURL=index.js.map","export function isUrlData(data) {\n return 'url' in data;\n}\nexport function isInlineData(data) {\n return 'values' in data;\n}\nexport function isNamedData(data) {\n return 'name' in data && !isUrlData(data) && !isInlineData(data) && !isGenerator(data);\n}\nexport function isGenerator(data) {\n return data && (isSequenceGenerator(data) || isSphereGenerator(data) || isGraticuleGenerator(data));\n}\nexport function isSequenceGenerator(data) {\n return 'sequence' in data;\n}\nexport function isSphereGenerator(data) {\n return 'sphere' in data;\n}\nexport function isGraticuleGenerator(data) {\n return 'graticule' in data;\n}\nexport var DataSourceType;\n(function (DataSourceType) {\n DataSourceType[DataSourceType[\"Raw\"] = 0] = \"Raw\";\n DataSourceType[DataSourceType[\"Main\"] = 1] = \"Main\";\n DataSourceType[DataSourceType[\"Row\"] = 2] = \"Row\";\n DataSourceType[DataSourceType[\"Column\"] = 3] = \"Column\";\n DataSourceType[DataSourceType[\"Lookup\"] = 4] = \"Lookup\";\n})(DataSourceType || (DataSourceType = {}));\n//# sourceMappingURL=data.js.map","import { normalizeLogicalComposition } from './logical';\nimport { normalizePredicate } from './predicate';\nexport function isFilter(t) {\n return 'filter' in t;\n}\nexport function isImputeSequence(t) {\n return (t === null || t === void 0 ? void 0 : t['stop']) !== undefined;\n}\nexport function isLookup(t) {\n return 'lookup' in t;\n}\nexport function isLookupData(from) {\n return 'data' in from;\n}\nexport function isLookupSelection(from) {\n return 'selection' in from;\n}\nexport function isPivot(t) {\n return 'pivot' in t;\n}\nexport function isDensity(t) {\n return 'density' in t;\n}\nexport function isQuantile(t) {\n return 'quantile' in t;\n}\nexport function isRegression(t) {\n return 'regression' in t;\n}\nexport function isLoess(t) {\n return 'loess' in t;\n}\nexport function isSample(t) {\n return 'sample' in t;\n}\nexport function isWindow(t) {\n return 'window' in t;\n}\nexport function isJoinAggregate(t) {\n return 'joinaggregate' in t;\n}\nexport function isFlatten(t) {\n return 'flatten' in t;\n}\nexport function isCalculate(t) {\n return 'calculate' in t;\n}\nexport function isBin(t) {\n return 'bin' in t;\n}\nexport function isImpute(t) {\n return 'impute' in t;\n}\nexport function isTimeUnit(t) {\n return 'timeUnit' in t;\n}\nexport function isAggregate(t) {\n return 'aggregate' in t;\n}\nexport function isStack(t) {\n return 'stack' in t;\n}\nexport function isFold(t) {\n return 'fold' in t;\n}\nexport function normalizeTransform(transform) {\n return transform.map(t => {\n if (isFilter(t)) {\n return {\n filter: normalizeLogicalComposition(t.filter, normalizePredicate)\n };\n }\n return t;\n });\n}\n//# sourceMappingURL=transform.js.map","const VIEW = 'view',\n LBRACK = '[',\n RBRACK = ']',\n LBRACE = '{',\n RBRACE = '}',\n COLON = ':',\n COMMA = ',',\n NAME = '@',\n GT = '>',\n ILLEGAL = /[[\\]{}]/,\n DEFAULT_MARKS = {\n '*': 1,\n arc: 1,\n area: 1,\n group: 1,\n image: 1,\n line: 1,\n path: 1,\n rect: 1,\n rule: 1,\n shape: 1,\n symbol: 1,\n text: 1,\n trail: 1\n};\nlet DEFAULT_SOURCE, MARKS;\n/**\n * Parse an event selector string.\n * Returns an array of event stream definitions.\n */\n\nfunction eventSelector (selector, source, marks) {\n DEFAULT_SOURCE = source || VIEW;\n MARKS = marks || DEFAULT_MARKS;\n return parseMerge(selector.trim()).map(parseSelector);\n}\n\nfunction isMarkType(type) {\n return MARKS[type];\n}\n\nfunction find(s, i, endChar, pushChar, popChar) {\n const n = s.length;\n let count = 0,\n c;\n\n for (; i < n; ++i) {\n c = s[i];\n if (!count && c === endChar) return i;else if (popChar && popChar.indexOf(c) >= 0) --count;else if (pushChar && pushChar.indexOf(c) >= 0) ++count;\n }\n\n return i;\n}\n\nfunction parseMerge(s) {\n const output = [],\n n = s.length;\n let start = 0,\n i = 0;\n\n while (i < n) {\n i = find(s, i, COMMA, LBRACK + LBRACE, RBRACK + RBRACE);\n output.push(s.substring(start, i).trim());\n start = ++i;\n }\n\n if (output.length === 0) {\n throw 'Empty event selector: ' + s;\n }\n\n return output;\n}\n\nfunction parseSelector(s) {\n return s[0] === '[' ? parseBetween(s) : parseStream(s);\n}\n\nfunction parseBetween(s) {\n const n = s.length;\n let i = 1,\n b;\n i = find(s, i, RBRACK, LBRACK, RBRACK);\n\n if (i === n) {\n throw 'Empty between selector: ' + s;\n }\n\n b = parseMerge(s.substring(1, i));\n\n if (b.length !== 2) {\n throw 'Between selector must have two elements: ' + s;\n }\n\n s = s.slice(i + 1).trim();\n\n if (s[0] !== GT) {\n throw 'Expected \\'>\\' after between selector: ' + s;\n }\n\n b = b.map(parseSelector);\n const stream = parseSelector(s.slice(1).trim());\n\n if (stream.between) {\n return {\n between: b,\n stream: stream\n };\n } else {\n stream.between = b;\n }\n\n return stream;\n}\n\nfunction parseStream(s) {\n const stream = {\n source: DEFAULT_SOURCE\n },\n source = [];\n let throttle = [0, 0],\n markname = 0,\n start = 0,\n n = s.length,\n i = 0,\n j,\n filter; // extract throttle from end\n\n if (s[n - 1] === RBRACE) {\n i = s.lastIndexOf(LBRACE);\n\n if (i >= 0) {\n try {\n throttle = parseThrottle(s.substring(i + 1, n - 1));\n } catch (e) {\n throw 'Invalid throttle specification: ' + s;\n }\n\n s = s.slice(0, i).trim();\n n = s.length;\n } else throw 'Unmatched right brace: ' + s;\n\n i = 0;\n }\n\n if (!n) throw s; // set name flag based on first char\n\n if (s[0] === NAME) markname = ++i; // extract first part of multi-part stream selector\n\n j = find(s, i, COLON);\n\n if (j < n) {\n source.push(s.substring(start, j).trim());\n start = i = ++j;\n } // extract remaining part of stream selector\n\n\n i = find(s, i, LBRACK);\n\n if (i === n) {\n source.push(s.substring(start, n).trim());\n } else {\n source.push(s.substring(start, i).trim());\n filter = [];\n start = ++i;\n if (start === n) throw 'Unmatched left bracket: ' + s;\n } // extract filters\n\n\n while (i < n) {\n i = find(s, i, RBRACK);\n if (i === n) throw 'Unmatched left bracket: ' + s;\n filter.push(s.substring(start, i).trim());\n if (i < n - 1 && s[++i] !== LBRACK) throw 'Expected left bracket: ' + s;\n start = ++i;\n } // marshall event stream specification\n\n\n if (!(n = source.length) || ILLEGAL.test(source[n - 1])) {\n throw 'Invalid event selector: ' + s;\n }\n\n if (n > 1) {\n stream.type = source[1];\n\n if (markname) {\n stream.markname = source[0].slice(1);\n } else if (isMarkType(source[0])) {\n stream.marktype = source[0];\n } else {\n stream.source = source[0];\n }\n } else {\n stream.type = source[0];\n }\n\n if (stream.type.slice(-1) === '!') {\n stream.consume = true;\n stream.type = stream.type.slice(0, -1);\n }\n\n if (filter != null) stream.filter = filter;\n if (throttle[0]) stream.throttle = throttle[0];\n if (throttle[1]) stream.debounce = throttle[1];\n return stream;\n}\n\nfunction parseThrottle(s) {\n const a = s.split(COMMA);\n if (!s.length || a.length > 2) throw s;\n return a.map(_ => {\n const x = +_;\n if (x !== x) throw s;\n return x;\n });\n}\n\nexport { eventSelector as selector };\n","import { array } from 'vega-util';\nimport { isConditionalDef, isConditionalSelection } from '../../../channeldef';\nimport { expression } from '../../predicate';\nimport { parseSelectionPredicate } from '../../selection/parse';\n/**\n * Return a mixin that includes a Vega production rule for a Vega-Lite conditional channel definition\n * or a simple mixin if channel def has no condition.\n */\nexport function wrapCondition(model, channelDef, vgChannel, refFn) {\n const condition = isConditionalDef(channelDef) && channelDef.condition;\n const valueRef = refFn(channelDef);\n if (condition) {\n const conditions = array(condition);\n const vgConditions = conditions.map(c => {\n const conditionValueRef = refFn(c);\n const test = isConditionalSelection(c)\n ? parseSelectionPredicate(model, c.selection) // FIXME: remove casting once TS is no longer dumb about it\n : expression(model, c.test); // FIXME: remove casting once TS is no longer dumb about it\n return Object.assign({ test }, conditionValueRef);\n });\n return {\n [vgChannel]: [...vgConditions, ...(valueRef !== undefined ? [valueRef] : [])]\n };\n }\n else {\n return valueRef !== undefined ? { [vgChannel]: valueRef } : {};\n }\n}\n//# sourceMappingURL=conditional.js.map","import { getFormatMixins, isFieldOrDatumDef, isValueDef } from '../../../channeldef';\nimport { signalOrValueRef } from '../../common';\nimport { formatSignalRef } from '../../format';\nimport { wrapCondition } from './conditional';\nexport function text(model, channel = 'text') {\n const channelDef = model.encoding[channel];\n return wrapCondition(model, channelDef, channel, cDef => textRef(cDef, model.config));\n}\nexport function textRef(channelDef, config, expr = 'datum') {\n // text\n if (channelDef) {\n if (isValueDef(channelDef)) {\n return signalOrValueRef(channelDef.value);\n }\n if (isFieldOrDatumDef(channelDef)) {\n const { format, formatType } = getFormatMixins(channelDef);\n return formatSignalRef({ fieldOrDatumDef: channelDef, format, formatType, expr, config });\n }\n }\n return undefined;\n}\n//# sourceMappingURL=text.js.map","import { array, isArray, isObject, isString } from 'vega-util';\nimport { isBinned } from '../../../bin';\nimport { getMainRangeChannel, isXorY } from '../../../channel';\nimport { defaultTitle, getFieldDef, getFormatMixins, hasConditionalFieldDef, isFieldDef, isTypedFieldDef, vgField } from '../../../channeldef';\nimport { forEach } from '../../../encoding';\nimport { entries } from '../../../util';\nimport { isSignalRef } from '../../../vega.schema';\nimport { getMarkPropOrConfig } from '../../common';\nimport { binFormatExpression, formatSignalRef } from '../../format';\nimport { wrapCondition } from './conditional';\nimport { textRef } from './text';\nexport function tooltip(model, opt = {}) {\n const { encoding, markDef, config, stack } = model;\n const channelDef = encoding.tooltip;\n if (isArray(channelDef)) {\n return { tooltip: tooltipRefForEncoding({ tooltip: channelDef }, stack, config, opt) };\n }\n else {\n const datum = opt.reactiveGeom ? 'datum.datum' : 'datum';\n return wrapCondition(model, channelDef, 'tooltip', cDef => {\n // use valueRef based on channelDef first\n const tooltipRefFromChannelDef = textRef(cDef, config, datum);\n if (tooltipRefFromChannelDef) {\n return tooltipRefFromChannelDef;\n }\n if (cDef === null) {\n // Allow using encoding.tooltip = null to disable tooltip\n return undefined;\n }\n let markTooltip = getMarkPropOrConfig('tooltip', markDef, config);\n if (markTooltip === true) {\n markTooltip = { content: 'encoding' };\n }\n if (isString(markTooltip)) {\n return { value: markTooltip };\n }\n else if (isObject(markTooltip)) {\n // `tooltip` is `{fields: 'encodings' | 'fields'}`\n if (isSignalRef(markTooltip)) {\n return markTooltip;\n }\n else if (markTooltip.content === 'encoding') {\n return tooltipRefForEncoding(encoding, stack, config, opt);\n }\n else {\n return { signal: datum };\n }\n }\n return undefined;\n });\n }\n}\nexport function tooltipData(encoding, stack, config, { reactiveGeom } = {}) {\n const toSkip = {};\n const expr = reactiveGeom ? 'datum.datum' : 'datum';\n const tuples = [];\n function add(fDef, channel) {\n const mainChannel = getMainRangeChannel(channel);\n const fieldDef = isTypedFieldDef(fDef)\n ? fDef\n : Object.assign(Object.assign({}, fDef), { type: encoding[mainChannel].type // for secondary field def, copy type from main channel\n });\n const title = fieldDef.title || defaultTitle(fieldDef, config);\n const key = array(title).join(', ');\n let value;\n if (isXorY(channel)) {\n const channel2 = channel === 'x' ? 'x2' : 'y2';\n const fieldDef2 = getFieldDef(encoding[channel2]);\n if (isBinned(fieldDef.bin) && fieldDef2) {\n const startField = vgField(fieldDef, { expr });\n const endField = vgField(fieldDef2, { expr });\n const { format, formatType } = getFormatMixins(fieldDef);\n value = binFormatExpression(startField, endField, format, formatType, config);\n toSkip[channel2] = true;\n }\n else if (stack && stack.fieldChannel === channel && stack.offset === 'normalize') {\n const { format, formatType } = getFormatMixins(fieldDef);\n value = formatSignalRef({ fieldOrDatumDef: fieldDef, format, formatType, expr, config, normalizeStack: true })\n .signal;\n }\n }\n value = value !== null && value !== void 0 ? value : textRef(fieldDef, config, expr).signal;\n tuples.push({ channel, key, value });\n }\n forEach(encoding, (channelDef, channel) => {\n if (isFieldDef(channelDef)) {\n add(channelDef, channel);\n }\n else if (hasConditionalFieldDef(channelDef)) {\n add(channelDef.condition, channel);\n }\n });\n const out = {};\n for (const { channel, key, value } of tuples) {\n if (!toSkip[channel] && !out[key]) {\n out[key] = value;\n }\n }\n return out;\n}\nexport function tooltipRefForEncoding(encoding, stack, config, { reactiveGeom } = {}) {\n const data = tooltipData(encoding, stack, config, { reactiveGeom });\n const keyValues = entries(data).map(([key, value]) => `\"${key}\": ${value}`);\n return keyValues.length > 0 ? { signal: `{${keyValues.join(', ')}}` } : undefined;\n}\n//# sourceMappingURL=tooltip.js.map","import { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { wrapCondition } from './conditional';\nimport * as ref from './valueref';\n/**\n * Return encode for non-positional channels with scales. (Text doesn't have scale.)\n */\nexport function nonPosition(channel, model, opt = {}) {\n const { markDef, encoding, config } = model;\n const { vgChannel } = opt;\n let { defaultRef, defaultValue } = opt;\n if (defaultRef === undefined) {\n // prettier-ignore\n defaultValue = defaultValue !== null && defaultValue !== void 0 ? defaultValue : getMarkPropOrConfig(channel, markDef, config, { vgChannel, ignoreVgConfig: true });\n if (defaultValue !== undefined) {\n defaultRef = signalOrValueRef(defaultValue);\n }\n }\n const channelDef = encoding[channel];\n return wrapCondition(model, channelDef, vgChannel !== null && vgChannel !== void 0 ? vgChannel : channel, cDef => {\n return ref.midPoint({\n channel,\n channelDef: cDef,\n markDef,\n config,\n scaleName: model.scaleName(channel),\n scale: model.getScaleComponent(channel),\n stack: null,\n defaultRef\n });\n });\n}\n//# sourceMappingURL=nonposition.js.map","import * as log from '../../../log';\nimport { contains } from '../../../util';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { nonPosition } from './nonposition';\nexport function color(model, opt = { filled: undefined }) {\n var _a, _b, _c, _d;\n const { markDef, encoding, config } = model;\n const { type: markType } = markDef;\n // Allow filled to be overridden (for trail's \"filled\")\n const filled = (_a = opt.filled) !== null && _a !== void 0 ? _a : getMarkPropOrConfig('filled', markDef, config);\n const transparentIfNeeded = contains(['bar', 'point', 'circle', 'square', 'geoshape'], markType)\n ? 'transparent'\n : undefined;\n const defaultFill = (_c = (_b = getMarkPropOrConfig(filled === true ? 'color' : undefined, markDef, config, { vgChannel: 'fill' })) !== null && _b !== void 0 ? _b : \n // need to add this manually as getMarkConfig normally drops config.mark[channel] if vgChannel is specified\n config.mark[filled === true && 'color']) !== null && _c !== void 0 ? _c : \n // If there is no fill, always fill symbols, bar, geoshape\n // with transparent fills https://github.com/vega/vega-lite/issues/1316\n transparentIfNeeded;\n const defaultStroke = (_d = getMarkPropOrConfig(filled === false ? 'color' : undefined, markDef, config, { vgChannel: 'stroke' })) !== null && _d !== void 0 ? _d : \n // need to add this manually as getMarkConfig normally drops config.mark[channel] if vgChannel is specified\n config.mark[filled === false && 'color'];\n const colorVgChannel = filled ? 'fill' : 'stroke';\n const fillStrokeMarkDefAndConfig = Object.assign(Object.assign({}, (defaultFill ? { fill: signalOrValueRef(defaultFill) } : {})), (defaultStroke ? { stroke: signalOrValueRef(defaultStroke) } : {}));\n if (markDef.color && (filled ? markDef.fill : markDef.stroke)) {\n log.warn(log.message.droppingColor('property', { fill: 'fill' in markDef, stroke: 'stroke' in markDef }));\n }\n return Object.assign(Object.assign(Object.assign(Object.assign({}, fillStrokeMarkDefAndConfig), nonPosition('color', model, {\n vgChannel: colorVgChannel,\n defaultValue: filled ? defaultFill : defaultStroke\n })), nonPosition('fill', model, {\n // if there is encoding.fill, include default fill just in case we have conditional-only fill encoding\n defaultValue: encoding.fill ? defaultFill : undefined\n })), nonPosition('stroke', model, {\n // if there is encoding.stroke, include default fill just in case we have conditional-only stroke encoding\n defaultValue: encoding.stroke ? defaultStroke : undefined\n }));\n}\n//# sourceMappingURL=color.js.map","import { getOffsetChannel } from '../../../channel';\nexport function getOffset(channel, markDef) {\n const offsetChannel = getOffsetChannel(channel);\n // TODO: in the future read from encoding channel too\n const markDefOffsetValue = markDef[offsetChannel];\n if (markDefOffsetValue) {\n return markDefOffsetValue;\n }\n return undefined;\n}\n//# sourceMappingURL=offset.js.map","import { getMainRangeChannel, getSecondaryRangeChannel, getSizeChannel, getVgPositionChannel, isXorY } from '../../../channel';\nimport { getBand, isFieldDef, isFieldOrDatumDef } from '../../../channeldef';\nimport { ScaleType } from '../../../scale';\nimport { contains } from '../../../util';\nimport { getMarkPropOrConfig } from '../../common';\nimport { getOffset } from './offset';\nimport * as ref from './valueref';\n/**\n * Return encode for point (non-band) position channels.\n */\nexport function pointPosition(channel, model, { defaultPos, vgChannel, isMidPoint }) {\n const { encoding, markDef, config, stack } = model;\n const channelDef = encoding[channel];\n const channel2Def = encoding[getSecondaryRangeChannel(channel)];\n const scaleName = model.scaleName(channel);\n const scale = model.getScaleComponent(channel);\n const offset = getOffset(channel, markDef);\n // Get default position or position from mark def\n const defaultRef = pointPositionDefaultRef({\n model,\n defaultPos,\n channel,\n scaleName,\n scale\n });\n const valueRef = !channelDef && isXorY(channel) && (encoding.latitude || encoding.longitude)\n ? // use geopoint output if there are lat/long and there is no point position overriding lat/long.\n { field: model.getName(channel) }\n : positionRef({\n channel,\n channelDef,\n channel2Def,\n markDef,\n config,\n isMidPoint,\n scaleName,\n scale,\n stack,\n offset,\n defaultRef\n });\n return valueRef ? { [vgChannel || channel]: valueRef } : undefined;\n}\n// TODO: we need to find a way to refactor these so that scaleName is a part of scale\n// but that's complicated. For now, this is a huge step moving forward.\n/**\n * @return Vega ValueRef for normal x- or y-position without projection\n */\nexport function positionRef(params) {\n const { channel, channelDef, isMidPoint, scaleName, stack, offset, markDef, config } = params;\n // This isn't a part of midPoint because we use midPoint for non-position too\n if (isFieldOrDatumDef(channelDef) && stack && channel === stack.fieldChannel) {\n if (isFieldDef(channelDef)) {\n const band = getBand({\n channel,\n fieldDef: channelDef,\n isMidPoint,\n markDef,\n stack,\n config\n });\n if (band !== undefined) {\n return ref.interpolatedSignalRef({\n scaleName,\n fieldOrDatumDef: channelDef,\n startSuffix: 'start',\n band,\n offset\n });\n }\n }\n // x or y use stack_end so that stacked line's point mark use stack_end too.\n return ref.valueRefForFieldOrDatumDef(channelDef, scaleName, { suffix: 'end' }, { offset });\n }\n return ref.midPointRefWithPositionInvalidTest(params);\n}\nexport function pointPositionDefaultRef({ model, defaultPos, channel, scaleName, scale }) {\n const { markDef, config } = model;\n return () => {\n const mainChannel = getMainRangeChannel(channel);\n const vgChannel = getVgPositionChannel(channel);\n const definedValueOrConfig = getMarkPropOrConfig(channel, markDef, config, { vgChannel });\n if (definedValueOrConfig !== undefined) {\n return ref.widthHeightValueOrSignalRef(channel, definedValueOrConfig);\n }\n switch (defaultPos) {\n case 'zeroOrMin':\n case 'zeroOrMax':\n if (scaleName) {\n const scaleType = scale.get('type');\n if (contains([ScaleType.LOG, ScaleType.TIME, ScaleType.UTC], scaleType)) {\n // Log scales cannot have zero.\n // Zero in time scale is arbitrary, and does not affect ratio.\n // (Time is an interval level of measurement, not ratio).\n // See https://en.wikipedia.org/wiki/Level_of_measurement for more info.\n }\n else {\n if (scale.domainDefinitelyIncludesZero()) {\n return {\n scale: scaleName,\n value: 0\n };\n }\n }\n }\n if (defaultPos === 'zeroOrMin') {\n return mainChannel === 'y' ? { field: { group: 'height' } } : { value: 0 };\n }\n else {\n // zeroOrMax\n switch (mainChannel) {\n case 'radius':\n // max of radius is min(width, height) / 2\n return {\n signal: `min(${model.width.signal},${model.height.signal})/2`\n };\n case 'theta':\n return { signal: '2*PI' };\n case 'x':\n return { field: { group: 'width' } };\n case 'y':\n return { value: 0 };\n }\n }\n break;\n case 'mid': {\n const sizeRef = model[getSizeChannel(channel)];\n return Object.assign(Object.assign({}, sizeRef), { mult: 0.5 });\n }\n }\n // defaultPos === null\n return undefined;\n };\n}\n//# sourceMappingURL=position-point.js.map","import { getVgPositionChannel } from '../../../channel';\nimport * as log from '../../../log';\nimport { isSignalRef } from '../../../vega.schema';\nimport { getMarkPropOrConfig } from '../../common';\nconst ALIGNED_X_CHANNEL = {\n left: 'x',\n center: 'xc',\n right: 'x2'\n};\nconst BASELINED_Y_CHANNEL = {\n top: 'y',\n middle: 'yc',\n bottom: 'y2'\n};\nexport function vgAlignedPositionChannel(channel, markDef, config, defaultAlign = 'middle') {\n if (channel === 'radius' || channel === 'theta') {\n return getVgPositionChannel(channel);\n }\n const alignChannel = channel === 'x' ? 'align' : 'baseline';\n const align = getMarkPropOrConfig(alignChannel, markDef, config);\n let alignExcludingSignal;\n if (isSignalRef(align)) {\n log.warn(log.message.rangeMarkAlignmentCannotBeExpression(alignChannel));\n alignExcludingSignal = undefined;\n }\n else {\n alignExcludingSignal = align;\n }\n if (channel === 'x') {\n return ALIGNED_X_CHANNEL[alignExcludingSignal || (defaultAlign === 'top' ? 'left' : 'center')];\n }\n else {\n return BASELINED_Y_CHANNEL[alignExcludingSignal || defaultAlign];\n }\n}\n//# sourceMappingURL=position-align.js.map","import { getMainRangeChannel, getSecondaryRangeChannel, getSizeChannel, getVgPositionChannel } from '../../../channel';\nimport { isFieldOrDatumDef } from '../../../channeldef';\nimport { getMarkStyleConfig } from '../../common';\nimport { getOffset } from './offset';\nimport { vgAlignedPositionChannel } from './position-align';\nimport { pointPosition, pointPositionDefaultRef } from './position-point';\nimport * as ref from './valueref';\n/**\n * Utility for area/rule position, which can be either point or range. (One of the axes should be point and the other should be range.)\n */\nexport function pointOrRangePosition(channel, model, { defaultPos, defaultPos2, range }) {\n if (range) {\n return rangePosition(channel, model, { defaultPos, defaultPos2 });\n }\n return pointPosition(channel, model, { defaultPos });\n}\nexport function rangePosition(channel, model, { defaultPos, defaultPos2 }) {\n const { markDef, config } = model;\n const channel2 = getSecondaryRangeChannel(channel);\n const sizeChannel = getSizeChannel(channel);\n const pos2Mixins = pointPosition2OrSize(model, defaultPos2, channel2);\n const vgChannel = pos2Mixins[sizeChannel]\n ? // If there is width/height, we need to position the marks based on the alignment.\n vgAlignedPositionChannel(channel, markDef, config)\n : // Otherwise, make sure to apply to the right Vg Channel (for arc mark)\n getVgPositionChannel(channel);\n return Object.assign(Object.assign({}, pointPosition(channel, model, { defaultPos, vgChannel })), pos2Mixins);\n}\n/**\n * Return encode for x2, y2.\n * If channel is not specified, return one channel based on orientation.\n */\nfunction pointPosition2OrSize(model, defaultPos, channel) {\n const { encoding, mark, markDef, stack, config } = model;\n const baseChannel = getMainRangeChannel(channel);\n const sizeChannel = getSizeChannel(channel);\n const vgChannel = getVgPositionChannel(channel);\n const channelDef = encoding[baseChannel];\n const scaleName = model.scaleName(baseChannel);\n const scale = model.getScaleComponent(baseChannel);\n const offset = channel in encoding || channel in markDef\n ? getOffset(channel, model.markDef)\n : getOffset(baseChannel, model.markDef);\n if (!channelDef && (channel === 'x2' || channel === 'y2') && (encoding.latitude || encoding.longitude)) {\n // use geopoint output if there are lat2/long2 and there is no point position2 overriding lat2/long2.\n return { [vgChannel]: { field: model.getName(channel) } };\n }\n const valueRef = position2Ref({\n channel,\n channelDef,\n channel2Def: encoding[channel],\n markDef,\n config,\n scaleName,\n scale,\n stack,\n offset,\n defaultRef: undefined\n });\n if (valueRef !== undefined) {\n return { [vgChannel]: valueRef };\n }\n // TODO: check width/height encoding here once we add them\n // no x2/y2 encoding, then try to read x2/y2 or width/height based on precedence:\n // markDef > config.style > mark-specific config (config[mark]) > general mark config (config.mark)\n return (position2orSize(channel, markDef) ||\n position2orSize(channel, {\n [channel]: getMarkStyleConfig(channel, markDef, config.style),\n [sizeChannel]: getMarkStyleConfig(sizeChannel, markDef, config.style)\n }) ||\n position2orSize(channel, config[mark]) ||\n position2orSize(channel, config.mark) || {\n [vgChannel]: pointPositionDefaultRef({\n model,\n defaultPos,\n channel,\n scaleName,\n scale\n })()\n });\n}\nexport function position2Ref({ channel, channelDef, channel2Def, markDef, config, scaleName, scale, stack, offset, defaultRef }) {\n if (isFieldOrDatumDef(channelDef) &&\n stack &&\n // If fieldChannel is X and channel is X2 (or Y and Y2)\n channel.charAt(0) === stack.fieldChannel.charAt(0)) {\n return ref.valueRefForFieldOrDatumDef(channelDef, scaleName, { suffix: 'start' }, { offset });\n }\n return ref.midPointRefWithPositionInvalidTest({\n channel,\n channelDef: channel2Def,\n scaleName,\n scale,\n stack,\n markDef,\n config,\n offset,\n defaultRef\n });\n}\nfunction position2orSize(channel, markDef) {\n const sizeChannel = getSizeChannel(channel);\n const vgChannel = getVgPositionChannel(channel);\n if (markDef[vgChannel] !== undefined) {\n return { [vgChannel]: ref.widthHeightValueOrSignalRef(channel, markDef[vgChannel]) };\n }\n else if (markDef[channel] !== undefined) {\n return { [vgChannel]: ref.widthHeightValueOrSignalRef(channel, markDef[channel]) };\n }\n else if (markDef[sizeChannel]) {\n return { [sizeChannel]: ref.widthHeightValueOrSignalRef(channel, markDef[sizeChannel]) };\n }\n return undefined;\n}\n//# sourceMappingURL=position-range.js.map","import { isArray, isNumber } from 'vega-util';\nimport { isBinned, isBinning, isBinParams } from '../../../bin';\nimport { getSecondaryRangeChannel, getSizeChannel, getVgPositionChannel, isPolarPositionChannel, isXorY } from '../../../channel';\nimport { getBand, isFieldDef, isFieldOrDatumDef, vgField } from '../../../channeldef';\nimport { DEFAULT_STEP, getViewConfigDiscreteStep } from '../../../config';\nimport * as log from '../../../log';\nimport { hasDiscreteDomain, ScaleType } from '../../../scale';\nimport { getFirstDefined } from '../../../util';\nimport { isSignalRef, isVgRangeStep } from '../../../vega.schema';\nimport { getMarkPropOrConfig, signalOrStringValue } from '../../common';\nimport { nonPosition } from './nonposition';\nimport { getOffset } from './offset';\nimport { vgAlignedPositionChannel } from './position-align';\nimport { pointPositionDefaultRef } from './position-point';\nimport { rangePosition } from './position-range';\nimport * as ref from './valueref';\nexport function rectPosition(model, channel, mark) {\n var _a, _b, _c, _d;\n const { config, encoding, markDef, stack } = model;\n const channel2 = getSecondaryRangeChannel(channel);\n const sizeChannel = getSizeChannel(channel);\n const channelDef = encoding[channel];\n const channelDef2 = encoding[channel2];\n const scale = model.getScaleComponent(channel);\n const scaleType = scale ? scale.get('type') : undefined;\n const scaleName = model.scaleName(channel);\n const orient = markDef.orient;\n const hasSizeDef = (_b = (_a = encoding[sizeChannel]) !== null && _a !== void 0 ? _a : encoding.size) !== null && _b !== void 0 ? _b : getMarkPropOrConfig('size', markDef, config, { vgChannel: sizeChannel });\n const isBarBand = mark === 'bar' && (channel === 'x' ? orient === 'vertical' : orient === 'horizontal');\n // x, x2, and width -- we must specify two of these in all conditions\n if (isFieldDef(channelDef) &&\n (isBinning(channelDef.bin) || isBinned(channelDef.bin) || (channelDef.timeUnit && !channelDef2)) &&\n !hasSizeDef &&\n !hasDiscreteDomain(scaleType)) {\n const band = getBand({ channel, fieldDef: channelDef, stack, markDef, config });\n const axis = (_c = model.component.axes[channel]) === null || _c === void 0 ? void 0 : _c[0];\n const axisTranslate = (_d = axis === null || axis === void 0 ? void 0 : axis.get('translate')) !== null && _d !== void 0 ? _d : 0.5; // vega default is 0.5\n return rectBinPosition({\n fieldDef: channelDef,\n fieldDef2: channelDef2,\n channel,\n markDef,\n scaleName,\n band,\n axisTranslate,\n spacing: isXorY(channel) ? getMarkPropOrConfig('binSpacing', markDef, config) : undefined,\n reverse: scale.get('reverse'),\n config\n });\n }\n else if (((isFieldOrDatumDef(channelDef) && hasDiscreteDomain(scaleType)) || isBarBand) && !channelDef2) {\n return positionAndSize(mark, channelDef, channel, model);\n }\n else {\n return rangePosition(channel, model, { defaultPos: 'zeroOrMax', defaultPos2: 'zeroOrMin' });\n }\n}\nfunction defaultSizeRef(mark, sizeChannel, scaleName, scale, config, band) {\n if (scale) {\n const scaleType = scale.get('type');\n if (scaleType === 'point' || scaleType === 'band') {\n if (config[mark].discreteBandSize !== undefined) {\n return { value: config[mark].discreteBandSize };\n }\n if (scaleType === ScaleType.POINT) {\n const scaleRange = scale.get('range');\n if (isVgRangeStep(scaleRange) && isNumber(scaleRange.step)) {\n return { value: scaleRange.step - 2 };\n }\n return { value: DEFAULT_STEP - 2 };\n }\n else {\n // BAND\n return { scale: scaleName, band };\n }\n }\n else {\n // continuous scale\n return { value: config[mark].continuousBandSize };\n }\n }\n // No Scale\n const step = getViewConfigDiscreteStep(config.view, sizeChannel);\n const value = getFirstDefined(\n // No scale is like discrete bar (with one item)\n config[mark].discreteBandSize, step - 2);\n return value !== undefined ? { value } : undefined;\n}\n/**\n * Output position encoding and its size encoding for continuous, point, and band scales.\n */\nfunction positionAndSize(mark, fieldDef, channel, model) {\n var _a;\n const { markDef, encoding, config, stack } = model;\n const orient = markDef.orient;\n const scaleName = model.scaleName(channel);\n const scale = model.getScaleComponent(channel);\n const vgSizeChannel = getSizeChannel(channel);\n const channel2 = getSecondaryRangeChannel(channel);\n // use \"size\" channel for bars, if there is orient and the channel matches the right orientation\n const useVlSizeChannel = (orient === 'horizontal' && channel === 'y') || (orient === 'vertical' && channel === 'x');\n const sizeFromMarkOrConfig = getMarkPropOrConfig(useVlSizeChannel ? 'size' : vgSizeChannel, markDef, config, {\n vgChannel: vgSizeChannel\n });\n // Use size encoding / mark property / config if it exists\n let sizeMixins;\n if (encoding.size || sizeFromMarkOrConfig !== undefined) {\n if (useVlSizeChannel) {\n sizeMixins = nonPosition('size', model, { vgChannel: vgSizeChannel, defaultValue: sizeFromMarkOrConfig });\n }\n else {\n log.warn(log.message.cannotApplySizeToNonOrientedMark(markDef.type));\n }\n }\n // Otherwise, apply default value\n const band = (_a = (isFieldOrDatumDef(fieldDef) ? getBand({ channel, fieldDef, markDef, stack, config }) : undefined)) !== null && _a !== void 0 ? _a : 1;\n sizeMixins = sizeMixins || { [vgSizeChannel]: defaultSizeRef(mark, vgSizeChannel, scaleName, scale, config, band) };\n /*\n Band scales with size value and all point scales, use xc/yc + band=0.5\n \n Otherwise (band scales that has size based on a band ref), use x/y with position band = (1 - size_band) / 2.\n In this case, size_band is the band specified in the x/y-encoding.\n By default band is 1, so `(1 - band) / 2` = 0.\n If band is 0.6, the the x/y position in such case should be `(1 - band) / 2` = 0.2\n */\n const center = (scale === null || scale === void 0 ? void 0 : scale.get('type')) !== 'band' || !('band' in sizeMixins[vgSizeChannel]);\n const vgChannel = vgAlignedPositionChannel(channel, markDef, config, center ? 'middle' : 'top');\n const offset = getOffset(channel, markDef);\n const posRef = ref.midPointRefWithPositionInvalidTest({\n channel,\n channelDef: fieldDef,\n markDef,\n config,\n scaleName,\n scale,\n stack,\n offset,\n defaultRef: pointPositionDefaultRef({ model, defaultPos: 'mid', channel, scaleName, scale }),\n band: center ? 0.5 : (1 - band) / 2\n });\n if (vgSizeChannel) {\n return Object.assign({ [vgChannel]: posRef }, sizeMixins);\n }\n else {\n // otherwise, we must simulate size by setting position2 = position + size\n // (for theta/radius since Vega doesn't have thetaWidth/radiusWidth)\n const vgChannel2 = getVgPositionChannel(channel2);\n const sizeRef = sizeMixins[vgSizeChannel];\n const sizeOffset = offset ? Object.assign(Object.assign({}, sizeRef), { offset }) : sizeRef;\n return {\n [vgChannel]: posRef,\n // posRef might be an array that wraps position invalid test\n [vgChannel2]: isArray(posRef)\n ? [posRef[0], Object.assign(Object.assign({}, posRef[1]), { offset: sizeOffset })]\n : Object.assign(Object.assign({}, posRef), { offset: sizeOffset })\n };\n }\n}\nfunction getBinSpacing(channel, spacing, reverse, translate, offset) {\n if (isPolarPositionChannel(channel)) {\n return 0;\n }\n const spacingOffset = channel === 'x' || channel === 'y2' ? -spacing / 2 : spacing / 2;\n if (isSignalRef(reverse) || isSignalRef(offset) || isSignalRef(translate)) {\n const reverseExpr = signalOrStringValue(reverse);\n const offsetExpr = signalOrStringValue(offset);\n const translateExpr = signalOrStringValue(translate);\n const t = translateExpr ? `${translateExpr} + ` : '';\n const r = reverseExpr ? `(${reverseExpr} ? -1 : 1) * ` : '';\n const o = offsetExpr ? `(${offsetExpr} + ${spacingOffset})` : spacingOffset;\n return {\n signal: t + r + o\n };\n }\n else {\n offset = offset || 0;\n return translate + (reverse ? -offset - spacingOffset : +offset + spacingOffset);\n }\n}\nexport function rectBinPosition({ fieldDef, fieldDef2, channel, band, scaleName, markDef, spacing = 0, axisTranslate, reverse, config }) {\n const channel2 = getSecondaryRangeChannel(channel);\n const vgChannel = getVgPositionChannel(channel);\n const vgChannel2 = getVgPositionChannel(channel2);\n const offset = getOffset(channel, markDef);\n if (isBinning(fieldDef.bin) || fieldDef.timeUnit) {\n return {\n [vgChannel2]: rectBinRef({\n channel,\n fieldDef,\n scaleName,\n markDef,\n band: (1 - band) / 2,\n offset: getBinSpacing(channel2, spacing, reverse, axisTranslate, offset),\n config\n }),\n [vgChannel]: rectBinRef({\n channel,\n fieldDef,\n scaleName,\n markDef,\n band: 1 - (1 - band) / 2,\n offset: getBinSpacing(channel, spacing, reverse, axisTranslate, offset),\n config\n })\n };\n }\n else if (isBinned(fieldDef.bin)) {\n const startRef = ref.valueRefForFieldOrDatumDef(fieldDef, scaleName, {}, { offset: getBinSpacing(channel2, spacing, reverse, axisTranslate, offset) });\n if (isFieldDef(fieldDef2)) {\n return {\n [vgChannel2]: startRef,\n [vgChannel]: ref.valueRefForFieldOrDatumDef(fieldDef2, scaleName, {}, { offset: getBinSpacing(channel, spacing, reverse, axisTranslate, offset) })\n };\n }\n else if (isBinParams(fieldDef.bin) && fieldDef.bin.step) {\n return {\n [vgChannel2]: startRef,\n [vgChannel]: {\n signal: `scale(\"${scaleName}\", ${vgField(fieldDef, { expr: 'datum' })} + ${fieldDef.bin.step})`,\n offset: getBinSpacing(channel, spacing, reverse, axisTranslate, offset)\n }\n };\n }\n }\n log.warn(log.message.channelRequiredForBinned(channel2));\n return undefined;\n}\n/**\n * Value Ref for binned fields\n */\nexport function rectBinRef({ channel, fieldDef, scaleName, markDef, band, offset, config }) {\n const r = ref.interpolatedSignalRef({\n scaleName,\n fieldOrDatumDef: fieldDef,\n band,\n offset\n });\n return ref.wrapPositionInvalidTest({\n fieldDef,\n channel,\n markDef,\n ref: r,\n config\n });\n}\n//# sourceMappingURL=position-rect.js.map","import { array } from 'vega-util';\nimport { SCALE_CHANNELS } from '../../../channel';\nimport { isPathMark } from '../../../mark';\nimport { hasContinuousDomain } from '../../../scale';\nimport { keys } from '../../../util';\nimport { VG_MARK_CONFIGS } from '../../../vega.schema';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { aria } from './aria';\nimport { color } from './color';\nimport { nonPosition } from './nonposition';\nimport { text } from './text';\nimport { tooltip } from './tooltip';\nimport { fieldInvalidPredicate } from './valueref';\nimport { zindex } from './zindex';\nexport { color } from './color';\nexport { wrapCondition } from './conditional';\nexport { nonPosition } from './nonposition';\nexport { pointPosition } from './position-point';\nexport { pointOrRangePosition, rangePosition } from './position-range';\nexport { rectPosition } from './position-rect';\nexport { text } from './text';\nexport { tooltip } from './tooltip';\nconst ALWAYS_IGNORE = new Set(['aria']);\nexport function baseEncodeEntry(model, ignore) {\n const { fill = undefined, stroke = undefined } = ignore.color === 'include' ? color(model) : {};\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, markDefProperties(model.markDef, ignore)), wrapAllFieldsInvalid(model, 'fill', fill)), wrapAllFieldsInvalid(model, 'stroke', stroke)), nonPosition('opacity', model)), nonPosition('fillOpacity', model)), nonPosition('strokeOpacity', model)), nonPosition('strokeWidth', model)), nonPosition('strokeDash', model)), zindex(model)), tooltip(model)), text(model, 'href')), aria(model));\n}\n// TODO: mark VgValueRef[] as readonly after https://github.com/vega/vega/pull/1987\nfunction wrapAllFieldsInvalid(model, channel, valueRef) {\n const { config, mark, markDef } = model;\n const invalid = getMarkPropOrConfig('invalid', markDef, config);\n if (invalid === 'hide' && valueRef && !isPathMark(mark)) {\n // For non-path marks, we have to exclude invalid values (null and NaN) for scales with continuous domains.\n // For path marks, we will use \"defined\" property and skip these values instead.\n const test = allFieldsInvalidPredicate(model, { invalid: true, channels: SCALE_CHANNELS });\n if (test) {\n return {\n [channel]: [\n // prepend the invalid case\n // TODO: support custom value\n { test, value: null },\n ...array(valueRef)\n ]\n };\n }\n }\n return valueRef ? { [channel]: valueRef } : {};\n}\nfunction markDefProperties(mark, ignore) {\n return VG_MARK_CONFIGS.reduce((m, prop) => {\n if (!ALWAYS_IGNORE.has(prop) && mark[prop] !== undefined && ignore[prop] !== 'ignore') {\n m[prop] = signalOrValueRef(mark[prop]);\n }\n return m;\n }, {});\n}\nfunction allFieldsInvalidPredicate(model, { invalid = false, channels }) {\n const filterIndex = channels.reduce((aggregator, channel) => {\n const scaleComponent = model.getScaleComponent(channel);\n if (scaleComponent) {\n const scaleType = scaleComponent.get('type');\n const field = model.vgField(channel, { expr: 'datum' });\n // While discrete domain scales can handle invalid values, continuous scales can't.\n if (field && hasContinuousDomain(scaleType)) {\n aggregator[field] = true;\n }\n }\n return aggregator;\n }, {});\n const fields = keys(filterIndex);\n if (fields.length > 0) {\n const op = invalid ? '||' : '&&';\n return fields.map(field => fieldInvalidPredicate(field, invalid)).join(` ${op} `);\n }\n return undefined;\n}\n//# sourceMappingURL=base.js.map","import { isValueDef } from '../../../channeldef';\nimport { isPathMark } from '../../../mark';\nimport { signalOrValueRef } from '../../common';\nimport { wrapCondition } from './conditional';\nexport function zindex(model) {\n const { encoding, mark } = model;\n const order = encoding.order;\n if (!isPathMark(mark) && isValueDef(order)) {\n return wrapCondition(model, order, 'zindex', cd => signalOrValueRef(cd.value));\n }\n return {};\n}\n//# sourceMappingURL=zindex.js.map","import { entries, isEmpty } from '../../../util';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { VG_MARK_INDEX } from './../../../vega.schema';\nimport { wrapCondition } from './conditional';\nimport { textRef } from './text';\nimport { tooltipData } from './tooltip';\nexport function aria(model) {\n const { markDef, config } = model;\n const enableAria = getMarkPropOrConfig('aria', markDef, config);\n // We can ignore other aria properties if ariaHidden is true.\n if (enableAria === false) {\n // getMarkGroups sets aria to false already so we don't have to set it in the encode block\n return {};\n }\n return Object.assign(Object.assign(Object.assign({}, (enableAria ? { aria: enableAria } : {})), ariaRoleDescription(model)), description(model));\n}\nfunction ariaRoleDescription(model) {\n const { mark, markDef, config } = model;\n if (config.aria === false) {\n return {};\n }\n const ariaRoleDesc = getMarkPropOrConfig('ariaRoleDescription', markDef, config);\n if (ariaRoleDesc != null) {\n return { ariaRoleDescription: { value: ariaRoleDesc } };\n }\n return mark in VG_MARK_INDEX ? {} : { ariaRoleDescription: { value: mark } };\n}\nexport function description(model) {\n const { encoding, markDef, config, stack } = model;\n const channelDef = encoding.description;\n if (channelDef) {\n return wrapCondition(model, channelDef, 'description', cDef => textRef(cDef, model.config));\n }\n // Use default from mark def or config if defined.\n // Functions in encode usually just return undefined but since we are defining a default below, we need to check the default here.\n const descriptionValue = getMarkPropOrConfig('description', markDef, config);\n if (descriptionValue != null) {\n return {\n description: signalOrValueRef(descriptionValue)\n };\n }\n if (config.aria === false) {\n return {};\n }\n const data = tooltipData(encoding, stack, config);\n if (isEmpty(data)) {\n return undefined;\n }\n return {\n description: {\n signal: entries(data)\n .map(([key, value], index) => `\"${index > 0 ? '; ' : ''}${key}: \" + (${value})`)\n .join(' + ')\n }\n };\n}\n//# sourceMappingURL=aria.js.map","import { POSITION_SCALE_CHANNELS } from '../../../channel';\nimport { hasContinuousDomain } from '../../../scale';\nimport { keys } from '../../../util';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../../common';\nimport { fieldInvalidPredicate } from './valueref';\nexport function defined(model) {\n const { config, markDef } = model;\n const invalid = getMarkPropOrConfig('invalid', markDef, config);\n if (invalid) {\n const signal = allFieldsInvalidPredicate(model, { channels: POSITION_SCALE_CHANNELS });\n if (signal) {\n return { defined: { signal } };\n }\n }\n return {};\n}\nfunction allFieldsInvalidPredicate(model, { invalid = false, channels }) {\n const filterIndex = channels.reduce((aggregator, channel) => {\n const scaleComponent = model.getScaleComponent(channel);\n if (scaleComponent) {\n const scaleType = scaleComponent.get('type');\n const field = model.vgField(channel, { expr: 'datum' });\n // While discrete domain scales can handle invalid values, continuous scales can't.\n if (field && hasContinuousDomain(scaleType)) {\n aggregator[field] = true;\n }\n }\n return aggregator;\n }, {});\n const fields = keys(filterIndex);\n if (fields.length > 0) {\n const op = invalid ? '||' : '&&';\n return fields.map(field => fieldInvalidPredicate(field, invalid)).join(` ${op} `);\n }\n return undefined;\n}\nexport function valueIfDefined(prop, value) {\n if (value !== undefined) {\n return { [prop]: signalOrValueRef(value) };\n }\n return undefined;\n}\n//# sourceMappingURL=defined.js.map","import * as log from '../../../log';\nimport { isPathMark } from '../../../mark';\nimport { tooltip } from '../../mark/encode';\nconst VORONOI = 'voronoi';\nconst nearest = {\n has: selCmpt => {\n return selCmpt.type !== 'interval' && selCmpt.nearest;\n },\n parse: (model, selCmpt) => {\n // Scope selection events to the voronoi mark to prevent capturing\n // events that occur on the group mark (https://github.com/vega/vega/issues/2112).\n if (selCmpt.events) {\n for (const s of selCmpt.events) {\n s.markname = model.getName(VORONOI);\n }\n }\n },\n marks: (model, selCmpt, marks) => {\n const { x, y } = selCmpt.project.hasChannel;\n const markType = model.mark;\n if (isPathMark(markType)) {\n log.warn(log.message.nearestNotSupportForContinuous(markType));\n return marks;\n }\n const cellDef = {\n name: model.getName(VORONOI),\n type: 'path',\n interactive: true,\n from: { data: model.getName('marks') },\n encode: {\n update: Object.assign({ fill: { value: 'transparent' }, strokeWidth: { value: 0.35 }, stroke: { value: 'transparent' }, isVoronoi: { value: true } }, tooltip(model, { reactiveGeom: true }))\n },\n transform: [\n {\n type: 'voronoi',\n x: { expr: x || !y ? 'datum.datum.x || 0' : '0' },\n y: { expr: y || !x ? 'datum.datum.y || 0' : '0' },\n size: [model.getSizeSignalRef('width'), model.getSizeSignalRef('height')]\n }\n ]\n };\n let index = 0;\n let exists = false;\n marks.forEach((mark, i) => {\n var _a;\n const name = (_a = mark.name) !== null && _a !== void 0 ? _a : '';\n if (name === model.component.mark[0].name) {\n index = i;\n }\n else if (name.indexOf(VORONOI) >= 0) {\n exists = true;\n }\n });\n if (!exists) {\n marks.splice(index + 1, 0, cellDef);\n }\n return marks;\n }\n};\nexport default nearest;\n//# sourceMappingURL=nearest.js.map","import * as log from '../../log';\nimport { uniqueId } from '../../util';\n/**\n * A node in the dataflow tree.\n */\nexport class DataFlowNode {\n constructor(parent, debugName) {\n this.debugName = debugName;\n this._children = [];\n this._parent = null;\n if (parent) {\n this.parent = parent;\n }\n }\n /**\n * Clone this node with a deep copy but don't clone links to children or parents.\n */\n clone() {\n throw new Error('Cannot clone node');\n }\n get parent() {\n return this._parent;\n }\n /**\n * Set the parent of the node and also add this node to the parent's children.\n */\n set parent(parent) {\n this._parent = parent;\n if (parent) {\n parent.addChild(this);\n }\n }\n get children() {\n return this._children;\n }\n numChildren() {\n return this._children.length;\n }\n addChild(child, loc) {\n // do not add the same child twice\n if (this._children.indexOf(child) > -1) {\n log.warn(log.message.ADD_SAME_CHILD_TWICE);\n return;\n }\n if (loc !== undefined) {\n this._children.splice(loc, 0, child);\n }\n else {\n this._children.push(child);\n }\n }\n removeChild(oldChild) {\n const loc = this._children.indexOf(oldChild);\n this._children.splice(loc, 1);\n return loc;\n }\n /**\n * Remove node from the dataflow.\n */\n remove() {\n let loc = this._parent.removeChild(this);\n for (const child of this._children) {\n // do not use the set method because we want to insert at a particular location\n child._parent = this._parent;\n this._parent.addChild(child, loc++);\n }\n }\n /**\n * Insert another node as a parent of this node.\n */\n insertAsParentOf(other) {\n const parent = other.parent;\n parent.removeChild(this);\n this.parent = parent;\n other.parent = this;\n }\n swapWithParent() {\n const parent = this._parent;\n const newParent = parent.parent;\n // reconnect the children\n for (const child of this._children) {\n child.parent = parent;\n }\n // remove old links\n this._children = []; // equivalent to removing every child link one by one\n parent.removeChild(this);\n parent.parent.removeChild(parent);\n // swap two nodes\n this.parent = newParent;\n parent.parent = this;\n }\n}\nexport class OutputNode extends DataFlowNode {\n /**\n * @param source The name of the source. Will change in assemble.\n * @param type The type of the output node.\n * @param refCounts A global ref counter map.\n */\n constructor(parent, source, type, refCounts) {\n super(parent, source);\n this.type = type;\n this.refCounts = refCounts;\n this._source = this._name = source;\n if (this.refCounts && !(this._name in this.refCounts)) {\n this.refCounts[this._name] = 0;\n }\n }\n clone() {\n const cloneObj = new this.constructor();\n cloneObj.debugName = 'clone_' + this.debugName;\n cloneObj._source = this._source;\n cloneObj._name = 'clone_' + this._name;\n cloneObj.type = this.type;\n cloneObj.refCounts = this.refCounts;\n cloneObj.refCounts[cloneObj._name] = 0;\n return cloneObj;\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return new Set();\n }\n hash() {\n if (this._hash === undefined) {\n this._hash = `Output ${uniqueId()}`;\n }\n return this._hash;\n }\n /**\n * Request the datasource name and increase the ref counter.\n *\n * During the parsing phase, this will return the simple name such as 'main' or 'raw'.\n * It is crucial to request the name from an output node to mark it as a required node.\n * If nobody ever requests the name, this datasource will not be instantiated in the assemble phase.\n *\n * In the assemble phase, this will return the correct name.\n */\n getSource() {\n this.refCounts[this._name]++;\n return this._source;\n }\n isRequired() {\n return !!this.refCounts[this._name];\n }\n setSource(source) {\n this._source = source;\n }\n}\n//# sourceMappingURL=dataflow.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { getSecondaryRangeChannel } from '../../channel';\nimport { hasBand, vgField } from '../../channeldef';\nimport { getTimeUnitParts, normalizeTimeUnit } from '../../timeunit';\nimport { duplicate, hash, isEmpty, replacePathInField, vals, entries } from '../../util';\nimport { isUnitModel } from '../model';\nimport { DataFlowNode } from './dataflow';\nexport class TimeUnitNode extends DataFlowNode {\n constructor(parent, formula) {\n super(parent);\n this.formula = formula;\n }\n clone() {\n return new TimeUnitNode(null, duplicate(this.formula));\n }\n static makeFromEncoding(parent, model) {\n const formula = model.reduceFieldDef((timeUnitComponent, fieldDef, channel) => {\n const { field, timeUnit } = fieldDef;\n const channelDef2 = isUnitModel(model) ? model.encoding[getSecondaryRangeChannel(channel)] : undefined;\n const band = isUnitModel(model) && hasBand(channel, fieldDef, channelDef2, model.stack, model.markDef, model.config);\n if (timeUnit) {\n const as = vgField(fieldDef, { forAs: true });\n timeUnitComponent[hash({\n as,\n field,\n timeUnit\n })] = Object.assign({ as,\n field,\n timeUnit }, (band ? { band: true } : {}));\n }\n return timeUnitComponent;\n }, {});\n if (isEmpty(formula)) {\n return null;\n }\n return new TimeUnitNode(parent, formula);\n }\n static makeFromTransform(parent, t) {\n const _a = Object.assign({}, t), { timeUnit } = _a, other = __rest(_a, [\"timeUnit\"]);\n const normalizedTimeUnit = normalizeTimeUnit(timeUnit);\n const component = Object.assign(Object.assign({}, other), { timeUnit: normalizedTimeUnit });\n return new TimeUnitNode(parent, {\n [hash(component)]: component\n });\n }\n /**\n * Merge together TimeUnitNodes assigning the children of `other` to `this`\n * and removing `other`.\n */\n merge(other) {\n this.formula = Object.assign({}, this.formula);\n // if the same hash happen twice, merge \"band\"\n for (const key in other.formula) {\n if (!this.formula[key] || other.formula[key].band) {\n // copy if it's not a duplicate or if we need to copy band over\n this.formula[key] = other.formula[key];\n }\n }\n for (const child of other.children) {\n other.removeChild(child);\n child.parent = this;\n }\n other.remove();\n }\n /**\n * Remove time units coming from the other node.\n */\n removeFormulas(fields) {\n const newFormula = {};\n for (const [key, timeUnit] of entries(this.formula)) {\n if (!fields.has(timeUnit.as)) {\n newFormula[key] = timeUnit;\n }\n }\n this.formula = newFormula;\n }\n producedFields() {\n return new Set(vals(this.formula).map(f => f.as));\n }\n dependentFields() {\n return new Set(vals(this.formula).map(f => f.field));\n }\n hash() {\n return `TimeUnit ${hash(this.formula)}`;\n }\n assemble() {\n const transforms = [];\n for (const f of vals(this.formula)) {\n const { field, as, timeUnit } = f;\n const _a = normalizeTimeUnit(timeUnit), { unit, utc } = _a, params = __rest(_a, [\"unit\", \"utc\"]);\n transforms.push(Object.assign(Object.assign(Object.assign(Object.assign({ field: replacePathInField(field), type: 'timeunit' }, (unit ? { units: getTimeUnitParts(unit) } : {})), (utc ? { timezone: 'utc' } : {})), params), { as: [as, `${as}_end`] }));\n }\n return transforms;\n }\n}\n//# sourceMappingURL=timeunit.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array } from 'vega-util';\nimport { isSingleDefUnitChannel } from '../../../channel';\nimport * as log from '../../../log';\nimport { hasContinuousDomain } from '../../../scale';\nimport { hash, keys, replacePathInField, varName, isEmpty } from '../../../util';\nimport { TimeUnitNode } from '../../data/timeunit';\nexport const TUPLE_FIELDS = '_tuple_fields';\nexport class SelectionProjectionComponent {\n constructor(...items) {\n this.items = items;\n this.hasChannel = {};\n this.hasField = {};\n }\n}\nconst project = {\n has: () => {\n return true; // This transform handles its own defaults, so always run parse.\n },\n parse: (model, selCmpt, selDef) => {\n var _a, _b, _c;\n const name = selCmpt.name;\n const proj = (_a = selCmpt.project) !== null && _a !== void 0 ? _a : (selCmpt.project = new SelectionProjectionComponent());\n const parsed = {};\n const timeUnits = {};\n const signals = new Set();\n const signalName = (p, range) => {\n const suffix = range === 'visual' ? p.channel : p.field;\n let sg = varName(`${name}_${suffix}`);\n for (let counter = 1; signals.has(sg); counter++) {\n sg = varName(`${name}_${suffix}_${counter}`);\n }\n signals.add(sg);\n return { [range]: sg };\n };\n // If no explicit projection (either fields or encodings) is specified, set some defaults.\n // If an initial value is set, try to infer projections.\n // Otherwise, use the default configuration.\n if (!selDef.fields && !selDef.encodings) {\n const cfg = model.config.selection[selDef.type];\n if (selDef.init) {\n for (const init of array(selDef.init)) {\n for (const key of keys(init)) {\n if (isSingleDefUnitChannel(key)) {\n (selDef.encodings || (selDef.encodings = [])).push(key);\n }\n else {\n if (selDef.type === 'interval') {\n log.warn(log.message.INTERVAL_INITIALIZED_WITH_X_Y);\n selDef.encodings = cfg.encodings;\n }\n else {\n (selDef.fields || (selDef.fields = [])).push(key);\n }\n }\n }\n }\n }\n else {\n selDef.encodings = cfg.encodings;\n selDef.fields = cfg.fields;\n }\n }\n // TODO: find a possible channel mapping for these fields.\n for (const field of (_b = selDef.fields) !== null && _b !== void 0 ? _b : []) {\n const p = { type: 'E', field };\n p.signals = Object.assign({}, signalName(p, 'data'));\n proj.items.push(p);\n proj.hasField[field] = p;\n }\n for (const channel of (_c = selDef.encodings) !== null && _c !== void 0 ? _c : []) {\n const fieldDef = model.fieldDef(channel);\n if (fieldDef) {\n let field = fieldDef.field;\n if (fieldDef.aggregate) {\n log.warn(log.message.cannotProjectAggregate(channel, fieldDef.aggregate));\n continue;\n }\n else if (!field) {\n log.warn(log.message.cannotProjectOnChannelWithoutField(channel));\n continue;\n }\n if (fieldDef.timeUnit) {\n field = model.vgField(channel);\n // Construct TimeUnitComponents which will be combined into a\n // TimeUnitNode. This node may need to be inserted into the\n // dataflow if the selection is used across views that do not\n // have these time units defined.\n const component = {\n timeUnit: fieldDef.timeUnit,\n as: field,\n field: fieldDef.field\n };\n timeUnits[hash(component)] = component;\n }\n // Prevent duplicate projections on the same field.\n // TODO: what if the same field is bound to multiple channels (e.g., SPLOM diag).\n if (!parsed[field]) {\n // Determine whether the tuple will store enumerated or ranged values.\n // Interval selections store ranges for continuous scales, and enumerations otherwise.\n // Single/multi selections store ranges for binned fields, and enumerations otherwise.\n let type = 'E';\n if (selCmpt.type === 'interval') {\n const scaleType = model.getScaleComponent(channel).get('type');\n if (hasContinuousDomain(scaleType)) {\n type = 'R';\n }\n }\n else if (fieldDef.bin) {\n type = 'R-RE';\n }\n const p = { field, channel, type };\n p.signals = Object.assign(Object.assign({}, signalName(p, 'data')), signalName(p, 'visual'));\n proj.items.push((parsed[field] = p));\n proj.hasField[field] = proj.hasChannel[channel] = parsed[field];\n }\n }\n else {\n log.warn(log.message.cannotProjectOnChannelWithoutField(channel));\n }\n }\n if (selDef.init) {\n const parseInit = (i) => {\n return proj.items.map(p => (i[p.channel] !== undefined ? i[p.channel] : i[p.field]));\n };\n if (selDef.type === 'interval') {\n selCmpt.init = parseInit(selDef.init);\n }\n else {\n const init = array(selDef.init);\n selCmpt.init = init.map(parseInit);\n }\n }\n if (!isEmpty(timeUnits)) {\n proj.timeUnit = new TimeUnitNode(null, timeUnits);\n }\n },\n signals: (model, selCmpt, allSignals) => {\n const name = selCmpt.name + TUPLE_FIELDS;\n const hasSignal = allSignals.filter(s => s.name === name);\n return hasSignal.length > 0\n ? allSignals\n : allSignals.concat({\n name,\n value: selCmpt.project.items.map(proj => {\n const { signals, hasLegend } = proj, rest = __rest(proj, [\"signals\", \"hasLegend\"]);\n rest.field = replacePathInField(rest.field);\n return rest;\n })\n });\n }\n};\nexport default project;\n//# sourceMappingURL=project.js.map","import { stringValue } from 'vega-util';\nimport { TUPLE } from '..';\nimport { varName } from '../../../util';\nimport { assembleInit } from '../assemble';\nimport nearest from './nearest';\nimport { TUPLE_FIELDS } from './project';\nimport { isLegendBinding } from '../../../selection';\nconst inputBindings = {\n has: selCmpt => {\n return (selCmpt.type === 'single' &&\n selCmpt.resolve === 'global' &&\n selCmpt.bind &&\n selCmpt.bind !== 'scales' &&\n !isLegendBinding(selCmpt.bind));\n },\n parse: (model, selCmpt, selDef, origDef) => {\n // Binding a selection to input widgets disables default direct manipulation interaction.\n // A user can choose to re-enable it by explicitly specifying triggering input events.\n if (!origDef.on)\n delete selCmpt.events;\n if (!origDef.clear)\n delete selCmpt.clear;\n },\n topLevelSignals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const proj = selCmpt.project;\n const bind = selCmpt.bind;\n const init = selCmpt.init && selCmpt.init[0]; // Can only exist on single selections (one initial value).\n const datum = nearest.has(selCmpt) ? '(item().isVoronoi ? datum.datum : datum)' : 'datum';\n proj.items.forEach((p, i) => {\n var _a, _b;\n const sgname = varName(`${name}_${p.field}`);\n const hasSignal = signals.filter(s => s.name === sgname);\n if (!hasSignal.length) {\n signals.unshift(Object.assign(Object.assign({ name: sgname }, (init ? { init: assembleInit(init[i]) } : { value: null })), { on: selCmpt.events\n ? [\n {\n events: selCmpt.events,\n update: `datum && item().mark.marktype !== 'group' ? ${datum}[${stringValue(p.field)}] : null`\n }\n ]\n : [], bind: (_b = (_a = bind[p.field]) !== null && _a !== void 0 ? _a : bind[p.channel]) !== null && _b !== void 0 ? _b : bind }));\n }\n });\n return signals;\n },\n signals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const proj = selCmpt.project;\n const signal = signals.filter(s => s.name === name + TUPLE)[0];\n const fields = name + TUPLE_FIELDS;\n const values = proj.items.map(p => varName(`${name}_${p.field}`));\n const valid = values.map(v => `${v} !== null`).join(' && ');\n if (values.length) {\n signal.update = `${valid} ? {fields: ${fields}, values: [${values.join(', ')}]} : null`;\n }\n delete signal.value;\n delete signal.on;\n return signals;\n }\n};\nexport default inputBindings;\n//# sourceMappingURL=inputs.js.map","import { TUPLE, unitName } from '..';\nexport const TOGGLE = '_toggle';\nconst toggle = {\n has: selCmpt => {\n return selCmpt.type === 'multi' && !!selCmpt.toggle;\n },\n signals: (model, selCmpt, signals) => {\n return signals.concat({\n name: selCmpt.name + TOGGLE,\n value: false,\n on: [{ events: selCmpt.events, update: selCmpt.toggle }]\n });\n },\n modifyExpr: (model, selCmpt) => {\n const tpl = selCmpt.name + TUPLE;\n const signal = selCmpt.name + TOGGLE;\n return (`${signal} ? null : ${tpl}, ` +\n (selCmpt.resolve === 'global' ? `${signal} ? null : true, ` : `${signal} ? null : {unit: ${unitName(model)}}, `) +\n `${signal} ? ${tpl} : null`);\n }\n};\nexport default toggle;\n//# sourceMappingURL=toggle.js.map","import { selector as parseSelector } from 'vega-event-selector';\nimport { isString } from 'vega-util';\nimport { TUPLE } from '..';\nimport { varName } from '../../../util';\nimport inputBindings from './inputs';\nimport toggle, { TOGGLE } from './toggle';\nconst clear = {\n has: selCmpt => {\n return selCmpt.clear !== undefined && selCmpt.clear !== false;\n },\n parse: (model, selCmpt, selDef) => {\n if (selDef.clear) {\n selCmpt.clear = isString(selDef.clear) ? parseSelector(selDef.clear, 'scope') : selDef.clear;\n }\n },\n topLevelSignals: (model, selCmpt, signals) => {\n if (inputBindings.has(selCmpt)) {\n for (const proj of selCmpt.project.items) {\n const idx = signals.findIndex(n => n.name === varName(`${selCmpt.name}_${proj.field}`));\n if (idx !== -1) {\n signals[idx].on.push({ events: selCmpt.clear, update: 'null' });\n }\n }\n }\n return signals;\n },\n signals: (model, selCmpt, signals) => {\n function addClear(idx, update) {\n if (idx !== -1 && signals[idx].on) {\n signals[idx].on.push({ events: selCmpt.clear, update });\n }\n }\n // Be as minimalist as possible when adding clear triggers to minimize dataflow execution.\n if (selCmpt.type === 'interval') {\n for (const proj of selCmpt.project.items) {\n const vIdx = signals.findIndex(n => n.name === proj.signals.visual);\n addClear(vIdx, '[0, 0]');\n if (vIdx === -1) {\n const dIdx = signals.findIndex(n => n.name === proj.signals.data);\n addClear(dIdx, 'null');\n }\n }\n }\n else {\n let tIdx = signals.findIndex(n => n.name === selCmpt.name + TUPLE);\n addClear(tIdx, 'null');\n if (toggle.has(selCmpt)) {\n tIdx = signals.findIndex(n => n.name === selCmpt.name + TOGGLE);\n addClear(tIdx, 'false');\n }\n }\n return signals;\n }\n};\nexport default clear;\n//# sourceMappingURL=clear.js.map","import { stringValue } from 'vega-util';\nimport { VL_SELECTION_RESOLVE } from '..';\nimport { isScaleChannel } from '../../../channel';\nimport * as log from '../../../log';\nimport { hasContinuousDomain } from '../../../scale';\nimport { isLayerModel } from '../../model';\nconst scaleBindings = {\n has: selCmpt => {\n return selCmpt.type === 'interval' && selCmpt.resolve === 'global' && selCmpt.bind && selCmpt.bind === 'scales';\n },\n parse: (model, selCmpt) => {\n const bound = (selCmpt.scales = []);\n for (const proj of selCmpt.project.items) {\n const channel = proj.channel;\n if (!isScaleChannel(channel)) {\n continue;\n }\n const scale = model.getScaleComponent(channel);\n const scaleType = scale ? scale.get('type') : undefined;\n if (!scale || !hasContinuousDomain(scaleType)) {\n log.warn(log.message.SCALE_BINDINGS_CONTINUOUS);\n continue;\n }\n const extent = { selection: selCmpt.name, field: proj.field };\n scale.set('selectionExtent', extent, true);\n bound.push(proj);\n }\n },\n topLevelSignals: (model, selCmpt, signals) => {\n const bound = selCmpt.scales.filter(proj => signals.filter(s => s.name === proj.signals.data).length === 0);\n // Top-level signals are only needed for multiview displays and if this\n // view's top-level signals haven't already been generated.\n if (!model.parent || isTopLevelLayer(model) || bound.length === 0) {\n return signals;\n }\n // vlSelectionResolve does not account for the behavior of bound scales in\n // multiview displays. Each unit view adds a tuple to the store, but the\n // state of the selection is the unit selection most recently updated. This\n // state is captured by the top-level signals that we insert and \"push\n // outer\" to from within the units. We need to reassemble this state into\n // the top-level named signal, except no single selCmpt has a global view.\n const namedSg = signals.filter(s => s.name === selCmpt.name)[0];\n let update = namedSg.update;\n if (update.indexOf(VL_SELECTION_RESOLVE) >= 0) {\n namedSg.update = `{${bound.map(proj => `${stringValue(proj.field)}: ${proj.signals.data}`).join(', ')}}`;\n }\n else {\n for (const proj of bound) {\n const mapping = `${stringValue(proj.field)}: ${proj.signals.data}`;\n if (update.indexOf(mapping) < 0) {\n update = `${update.substring(0, update.length - 1)}, ${mapping}}`;\n }\n }\n namedSg.update = update;\n }\n return signals.concat(bound.map(proj => ({ name: proj.signals.data })));\n },\n signals: (model, selCmpt, signals) => {\n // Nested signals need only push to top-level signals with multiview displays.\n if (model.parent && !isTopLevelLayer(model)) {\n for (const proj of selCmpt.scales) {\n const signal = signals.filter(s => s.name === proj.signals.data)[0];\n signal.push = 'outer';\n delete signal.value;\n delete signal.update;\n }\n }\n return signals;\n }\n};\nexport default scaleBindings;\nexport function domain(model, channel) {\n const scale = stringValue(model.scaleName(channel));\n return `domain(${scale})`;\n}\nfunction isTopLevelLayer(model) {\n var _a;\n return model.parent && isLayerModel(model.parent) && ((_a = !model.parent.parent) !== null && _a !== void 0 ? _a : isTopLevelLayer(model.parent.parent));\n}\n//# sourceMappingURL=scales.js.map","import { selector as parseSelector } from 'vega-event-selector';\nimport { array, isString } from 'vega-util';\nimport { forEachSelection, TUPLE } from '..';\nimport * as log from '../../../log';\nimport { isLegendBinding, isLegendStreamBinding, SELECTION_ID } from '../../../selection';\nimport { duplicate, varName } from '../../../util';\nimport { TUPLE_FIELDS } from './project';\nimport { TOGGLE } from './toggle';\nconst legendBindings = {\n has: (selCmpt) => {\n const spec = selCmpt.resolve === 'global' && selCmpt.bind && isLegendBinding(selCmpt.bind);\n const projLen = selCmpt.project.items.length === 1 && selCmpt.project.items[0].field !== SELECTION_ID;\n if (spec && !projLen) {\n log.warn(log.message.LEGEND_BINDINGS_MUST_HAVE_PROJECTION);\n }\n return spec && projLen;\n },\n parse: (model, selCmpt, selDef, origDef) => {\n var _a;\n // Binding a selection to a legend disables default direct manipulation interaction.\n // A user can choose to re-enable it by explicitly specifying triggering input events.\n if (!origDef.on)\n delete selCmpt.events;\n if (!origDef.clear)\n delete selCmpt.clear;\n if (origDef.on || origDef.clear) {\n const legendFilter = 'event.item && indexof(event.item.mark.role, \"legend\") < 0';\n for (const evt of selCmpt.events) {\n evt.filter = array((_a = evt.filter) !== null && _a !== void 0 ? _a : []);\n if (evt.filter.indexOf(legendFilter) < 0) {\n evt.filter.push(legendFilter);\n }\n }\n }\n const evt = isLegendStreamBinding(selCmpt.bind) ? selCmpt.bind.legend : 'click';\n const stream = isString(evt) ? parseSelector(evt, 'view') : array(evt);\n selCmpt.bind = { legend: { merge: stream } };\n },\n topLevelSignals: (model, selCmpt, signals) => {\n const selName = selCmpt.name;\n const stream = isLegendStreamBinding(selCmpt.bind) && selCmpt.bind.legend;\n const markName = (name) => (s) => {\n const ds = duplicate(s);\n ds.markname = name;\n return ds;\n };\n for (const proj of selCmpt.project.items) {\n if (!proj.hasLegend)\n continue;\n const prefix = `${varName(proj.field)}_legend`;\n const sgName = `${selName}_${prefix}`;\n const hasSignal = signals.filter(s => s.name === sgName);\n if (hasSignal.length === 0) {\n const events = stream.merge\n .map(markName(`${prefix}_symbols`))\n .concat(stream.merge.map(markName(`${prefix}_labels`)))\n .concat(stream.merge.map(markName(`${prefix}_entries`)));\n signals.unshift(Object.assign(Object.assign({ name: sgName }, (!selCmpt.init ? { value: null } : {})), { on: [\n // Legend entries do not store values, so we need to walk the scenegraph to the symbol datum.\n { events, update: 'datum.value || item().items[0].items[0].datum.value', force: true },\n { events: stream.merge, update: `!event.item || !datum ? null : ${sgName}`, force: true }\n ] }));\n }\n }\n return signals;\n },\n signals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const proj = selCmpt.project;\n const tuple = signals.find(s => s.name === name + TUPLE);\n const fields = name + TUPLE_FIELDS;\n const values = proj.items.filter(p => p.hasLegend).map(p => varName(`${name}_${varName(p.field)}_legend`));\n const valid = values.map(v => `${v} !== null`).join(' && ');\n const update = `${valid} ? {fields: ${fields}, values: [${values.join(', ')}]} : null`;\n if (selCmpt.events && values.length > 0) {\n tuple.on.push({\n events: values.map(signal => ({ signal })),\n update\n });\n }\n else if (values.length > 0) {\n tuple.update = update;\n delete tuple.value;\n delete tuple.on;\n }\n const toggle = signals.find(s => s.name === name + TOGGLE);\n const events = isLegendStreamBinding(selCmpt.bind) && selCmpt.bind.legend;\n if (toggle) {\n if (!selCmpt.events)\n toggle.on[0].events = events;\n else\n toggle.on.push(Object.assign(Object.assign({}, toggle.on[0]), { events }));\n }\n return signals;\n }\n};\nexport default legendBindings;\nexport function parseInteractiveLegend(model, channel, legendCmpt) {\n var _a;\n const field = (_a = model.fieldDef(channel)) === null || _a === void 0 ? void 0 : _a.field;\n forEachSelection(model, selCmpt => {\n var _a, _b;\n const proj = (_a = selCmpt.project.hasField[field]) !== null && _a !== void 0 ? _a : selCmpt.project.hasChannel[channel];\n if (proj && legendBindings.has(selCmpt)) {\n const legendSelections = (_b = legendCmpt.get('selections')) !== null && _b !== void 0 ? _b : [];\n legendSelections.push(selCmpt.name);\n legendCmpt.set('selections', legendSelections, false);\n proj.hasLegend = true;\n }\n });\n}\n//# sourceMappingURL=legends.js.map","import { selector as parseSelector } from 'vega-event-selector';\nimport { X, Y } from '../../../channel';\nimport { BRUSH as INTERVAL_BRUSH } from '../interval';\nimport scalesCompiler, { domain } from './scales';\nconst ANCHOR = '_translate_anchor';\nconst DELTA = '_translate_delta';\nconst translate = {\n has: selCmpt => {\n return selCmpt.type === 'interval' && selCmpt.translate;\n },\n signals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const hasScales = scalesCompiler.has(selCmpt);\n const anchor = name + ANCHOR;\n const { x, y } = selCmpt.project.hasChannel;\n let events = parseSelector(selCmpt.translate, 'scope');\n if (!hasScales) {\n events = events.map(e => ((e.between[0].markname = name + INTERVAL_BRUSH), e));\n }\n signals.push({\n name: anchor,\n value: {},\n on: [\n {\n events: events.map(e => e.between[0]),\n update: '{x: x(unit), y: y(unit)' +\n (x !== undefined ? ', extent_x: ' + (hasScales ? domain(model, X) : `slice(${x.signals.visual})`) : '') +\n (y !== undefined ? ', extent_y: ' + (hasScales ? domain(model, Y) : `slice(${y.signals.visual})`) : '') +\n '}'\n }\n ]\n }, {\n name: name + DELTA,\n value: {},\n on: [\n {\n events: events,\n update: `{x: ${anchor}.x - x(unit), y: ${anchor}.y - y(unit)}`\n }\n ]\n });\n if (x !== undefined) {\n onDelta(model, selCmpt, x, 'width', signals);\n }\n if (y !== undefined) {\n onDelta(model, selCmpt, y, 'height', signals);\n }\n return signals;\n }\n};\nexport default translate;\nfunction onDelta(model, selCmpt, proj, size, signals) {\n var _a;\n const name = selCmpt.name;\n const anchor = name + ANCHOR;\n const delta = name + DELTA;\n const channel = proj.channel;\n const hasScales = scalesCompiler.has(selCmpt);\n const signal = signals.filter(s => s.name === proj.signals[hasScales ? 'data' : 'visual'])[0];\n const sizeSg = model.getSizeSignalRef(size).signal;\n const scaleCmpt = model.getScaleComponent(channel);\n const scaleType = scaleCmpt.get('type');\n const sign = hasScales && channel === X ? '-' : ''; // Invert delta when panning x-scales.\n const extent = `${anchor}.extent_${channel}`;\n const offset = `${sign}${delta}.${channel} / ` + (hasScales ? `${sizeSg}` : `span(${extent})`);\n const panFn = !hasScales\n ? 'panLinear'\n : scaleType === 'log'\n ? 'panLog'\n : scaleType === 'pow'\n ? 'panPow'\n : 'panLinear';\n const update = `${panFn}(${extent}, ${offset}` +\n (hasScales && scaleType === 'pow' ? `, ${(_a = scaleCmpt.get('exponent')) !== null && _a !== void 0 ? _a : 1}` : '') +\n ')';\n signal.on.push({\n events: { signal: delta },\n update: hasScales ? update : `clampRange(${update}, 0, ${sizeSg})`\n });\n}\n//# sourceMappingURL=translate.js.map","import { selector as parseSelector } from 'vega-event-selector';\nimport { stringValue } from 'vega-util';\nimport { X, Y } from '../../../channel';\nimport { BRUSH as INTERVAL_BRUSH } from '../interval';\nimport { default as scalesCompiler, domain } from './scales';\nconst ANCHOR = '_zoom_anchor';\nconst DELTA = '_zoom_delta';\nconst zoom = {\n has: selCmpt => {\n return selCmpt.type === 'interval' && selCmpt.zoom;\n },\n signals: (model, selCmpt, signals) => {\n const name = selCmpt.name;\n const hasScales = scalesCompiler.has(selCmpt);\n const delta = name + DELTA;\n const { x, y } = selCmpt.project.hasChannel;\n const sx = stringValue(model.scaleName(X));\n const sy = stringValue(model.scaleName(Y));\n let events = parseSelector(selCmpt.zoom, 'scope');\n if (!hasScales) {\n events = events.map(e => ((e.markname = name + INTERVAL_BRUSH), e));\n }\n signals.push({\n name: name + ANCHOR,\n on: [\n {\n events: events,\n update: !hasScales\n ? `{x: x(unit), y: y(unit)}`\n : '{' +\n [sx ? `x: invert(${sx}, x(unit))` : '', sy ? `y: invert(${sy}, y(unit))` : '']\n .filter(expr => !!expr)\n .join(', ') +\n '}'\n }\n ]\n }, {\n name: delta,\n on: [\n {\n events: events,\n force: true,\n update: 'pow(1.001, event.deltaY * pow(16, event.deltaMode))'\n }\n ]\n });\n if (x !== undefined) {\n onDelta(model, selCmpt, x, 'width', signals);\n }\n if (y !== undefined) {\n onDelta(model, selCmpt, y, 'height', signals);\n }\n return signals;\n }\n};\nexport default zoom;\nfunction onDelta(model, selCmpt, proj, size, signals) {\n var _a;\n const name = selCmpt.name;\n const channel = proj.channel;\n const hasScales = scalesCompiler.has(selCmpt);\n const signal = signals.filter(s => s.name === proj.signals[hasScales ? 'data' : 'visual'])[0];\n const sizeSg = model.getSizeSignalRef(size).signal;\n const scaleCmpt = model.getScaleComponent(channel);\n const scaleType = scaleCmpt.get('type');\n const base = hasScales ? domain(model, channel) : signal.name;\n const delta = name + DELTA;\n const anchor = `${name}${ANCHOR}.${channel}`;\n const zoomFn = !hasScales\n ? 'zoomLinear'\n : scaleType === 'log'\n ? 'zoomLog'\n : scaleType === 'pow'\n ? 'zoomPow'\n : 'zoomLinear';\n const update = `${zoomFn}(${base}, ${anchor}, ${delta}` +\n (hasScales && scaleType === 'pow' ? `, ${(_a = scaleCmpt.get('exponent')) !== null && _a !== void 0 ? _a : 1}` : '') +\n ')';\n signal.on.push({\n events: { signal: delta },\n update: hasScales ? update : `clampRange(${update}, 0, ${sizeSg})`\n });\n}\n//# sourceMappingURL=zoom.js.map","import clear from './clear';\nimport inputs from './inputs';\nimport nearest from './nearest';\nimport project from './project';\nimport scales from './scales';\nimport legends from './legends';\nimport toggle from './toggle';\nimport translate from './translate';\nimport zoom from './zoom';\nconst compilers = [project, toggle, scales, legends, translate, zoom, inputs, nearest, clear];\nexport function forEachTransform(selCmpt, cb) {\n for (const t of compilers) {\n if (t.has(selCmpt)) {\n cb(t);\n }\n }\n}\n//# sourceMappingURL=transforms.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { selector as parseSelector } from 'vega-event-selector';\nimport { identity, isArray, stringValue } from 'vega-util';\nimport { forEachSelection, MODIFY, STORE, unitName, VL_SELECTION_RESOLVE, TUPLE } from '.';\nimport { dateTimeToExpr, isDateTime, dateTimeToTimestamp } from '../../datetime';\nimport { keys, varName } from '../../util';\nimport { isUnitModel } from '../model';\nimport { forEachTransform } from './transforms/transforms';\nimport { parseSelectionBinExtent } from './parse';\nexport function assembleInit(init, isExpr = true, wrap = identity) {\n if (isArray(init)) {\n const assembled = init.map(v => assembleInit(v, isExpr, wrap));\n return isExpr ? `[${assembled.join(', ')}]` : assembled;\n }\n else if (isDateTime(init)) {\n if (isExpr) {\n return wrap(dateTimeToExpr(init));\n }\n else {\n return wrap(dateTimeToTimestamp(init));\n }\n }\n return isExpr ? wrap(JSON.stringify(init)) : init;\n}\nexport function assembleUnitSelectionSignals(model, signals) {\n forEachSelection(model, (selCmpt, selCompiler) => {\n const name = selCmpt.name;\n let modifyExpr = selCompiler.modifyExpr(model, selCmpt);\n signals.push(...selCompiler.signals(model, selCmpt));\n forEachTransform(selCmpt, txCompiler => {\n if (txCompiler.signals) {\n signals = txCompiler.signals(model, selCmpt, signals);\n }\n if (txCompiler.modifyExpr) {\n modifyExpr = txCompiler.modifyExpr(model, selCmpt, modifyExpr);\n }\n });\n signals.push({\n name: name + MODIFY,\n on: [\n {\n events: { signal: selCmpt.name + TUPLE },\n update: `modify(${stringValue(selCmpt.name + STORE)}, ${modifyExpr})`\n }\n ]\n });\n });\n return cleanupEmptyOnArray(signals);\n}\nexport function assembleFacetSignals(model, signals) {\n if (model.component.selection && keys(model.component.selection).length) {\n const name = stringValue(model.getName('cell'));\n signals.unshift({\n name: 'facet',\n value: {},\n on: [\n {\n events: parseSelector('mousemove', 'scope'),\n update: `isTuple(facet) ? facet : group(${name}).datum`\n }\n ]\n });\n }\n return cleanupEmptyOnArray(signals);\n}\nexport function assembleTopLevelSignals(model, signals) {\n let hasSelections = false;\n forEachSelection(model, (selCmpt, selCompiler) => {\n const name = selCmpt.name;\n const store = stringValue(name + STORE);\n const hasSg = signals.filter(s => s.name === name);\n if (hasSg.length === 0) {\n const resolve = selCmpt.resolve === 'global' ? 'union' : selCmpt.resolve;\n const isMulti = selCmpt.type === 'multi' ? ', true)' : ')';\n signals.push({\n name: selCmpt.name,\n update: `${VL_SELECTION_RESOLVE}(${store}, ${stringValue(resolve)}${isMulti}`\n });\n }\n hasSelections = true;\n if (selCompiler.topLevelSignals) {\n signals = selCompiler.topLevelSignals(model, selCmpt, signals);\n }\n forEachTransform(selCmpt, txCompiler => {\n if (txCompiler.topLevelSignals) {\n signals = txCompiler.topLevelSignals(model, selCmpt, signals);\n }\n });\n });\n if (hasSelections) {\n const hasUnit = signals.filter(s => s.name === 'unit');\n if (hasUnit.length === 0) {\n signals.unshift({\n name: 'unit',\n value: {},\n on: [{ events: 'mousemove', update: 'isTuple(group()) ? group() : unit' }]\n });\n }\n }\n return cleanupEmptyOnArray(signals);\n}\nexport function assembleUnitSelectionData(model, data) {\n const dataCopy = [...data];\n forEachSelection(model, selCmpt => {\n const init = { name: selCmpt.name + STORE };\n if (selCmpt.init) {\n const fields = selCmpt.project.items.map(proj => {\n const { signals } = proj, rest = __rest(proj, [\"signals\"]);\n return rest;\n });\n const insert = selCmpt.init.map(i => assembleInit(i, false));\n init.values =\n selCmpt.type === 'interval'\n ? [{ unit: unitName(model, { escape: false }), fields, values: insert }]\n : insert.map(i => ({ unit: unitName(model, { escape: false }), fields, values: i }));\n }\n const contains = dataCopy.filter(d => d.name === selCmpt.name + STORE);\n if (!contains.length) {\n dataCopy.push(init);\n }\n });\n return dataCopy;\n}\nexport function assembleUnitSelectionMarks(model, marks) {\n forEachSelection(model, (selCmpt, selCompiler) => {\n marks = selCompiler.marks ? selCompiler.marks(model, selCmpt, marks) : marks;\n forEachTransform(selCmpt, txCompiler => {\n if (txCompiler.marks) {\n marks = txCompiler.marks(model, selCmpt, marks);\n }\n });\n });\n return marks;\n}\nexport function assembleLayerSelectionMarks(model, marks) {\n for (const child of model.children) {\n if (isUnitModel(child)) {\n marks = assembleUnitSelectionMarks(child, marks);\n }\n }\n return marks;\n}\nexport function assembleSelectionScaleDomain(model, extent) {\n const name = extent.selection;\n const selCmpt = model.getSelectionComponent(name, varName(name));\n return { signal: parseSelectionBinExtent(selCmpt, extent) };\n}\nfunction cleanupEmptyOnArray(signals) {\n return signals.map(s => {\n if (s.on && !s.on.length)\n delete s.on;\n return s;\n });\n}\n//# sourceMappingURL=assemble.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array, stringValue } from 'vega-util';\nimport { STORE, TUPLE, unitName } from '.';\nimport { X, Y } from '../../channel';\nimport { warn } from '../../log';\nimport { hasContinuousDomain } from '../../scale';\nimport { keys } from '../../util';\nimport { assembleInit } from './assemble';\nimport { TUPLE_FIELDS } from './transforms/project';\nimport scales from './transforms/scales';\nexport const BRUSH = '_brush';\nexport const SCALE_TRIGGER = '_scale_trigger';\nconst interval = {\n signals: (model, selCmpt) => {\n const name = selCmpt.name;\n const fieldsSg = name + TUPLE_FIELDS;\n const hasScales = scales.has(selCmpt);\n const signals = [];\n const dataSignals = [];\n const scaleTriggers = [];\n if (selCmpt.translate && !hasScales) {\n const filterExpr = `!event.item || event.item.mark.name !== ${stringValue(name + BRUSH)}`;\n events(selCmpt, (on, evt) => {\n var _a;\n const filters = array((_a = evt.between[0].filter) !== null && _a !== void 0 ? _a : (evt.between[0].filter = []));\n if (filters.indexOf(filterExpr) < 0) {\n filters.push(filterExpr);\n }\n return on;\n });\n }\n selCmpt.project.items.forEach((proj, i) => {\n const channel = proj.channel;\n if (channel !== X && channel !== Y) {\n warn('Interval selections only support x and y encoding channels.');\n return;\n }\n const init = selCmpt.init ? selCmpt.init[i] : null;\n const cs = channelSignals(model, selCmpt, proj, init);\n const dname = proj.signals.data;\n const vname = proj.signals.visual;\n const scaleName = stringValue(model.scaleName(channel));\n const scaleType = model.getScaleComponent(channel).get('type');\n const toNum = hasContinuousDomain(scaleType) ? '+' : '';\n signals.push(...cs);\n dataSignals.push(dname);\n scaleTriggers.push({\n scaleName: model.scaleName(channel),\n expr: `(!isArray(${dname}) || ` +\n `(${toNum}invert(${scaleName}, ${vname})[0] === ${toNum}${dname}[0] && ` +\n `${toNum}invert(${scaleName}, ${vname})[1] === ${toNum}${dname}[1]))`\n });\n });\n // Proxy scale reactions to ensure that an infinite loop doesn't occur\n // when an interval selection filter touches the scale.\n if (!hasScales) {\n signals.push({\n name: name + SCALE_TRIGGER,\n value: {},\n on: [\n {\n events: scaleTriggers.map(t => ({ scale: t.scaleName })),\n update: scaleTriggers.map(t => t.expr).join(' && ') + ` ? ${name + SCALE_TRIGGER} : {}`\n }\n ]\n });\n }\n // Only add an interval to the store if it has valid data extents. Data extents\n // are set to null if pixel extents are equal to account for intervals over\n // ordinal/nominal domains which, when inverted, will still produce a valid datum.\n const init = selCmpt.init;\n const update = `unit: ${unitName(model)}, fields: ${fieldsSg}, values`;\n return signals.concat(Object.assign(Object.assign({ name: name + TUPLE }, (init ? { init: `{${update}: ${assembleInit(init)}}` } : {})), { on: [\n {\n events: [{ signal: dataSignals.join(' || ') }],\n update: dataSignals.join(' && ') + ` ? {${update}: [${dataSignals}]} : null`\n }\n ] }));\n },\n modifyExpr: (model, selCmpt) => {\n const tpl = selCmpt.name + TUPLE;\n return tpl + ', ' + (selCmpt.resolve === 'global' ? 'true' : `{unit: ${unitName(model)}}`);\n },\n marks: (model, selCmpt, marks) => {\n const name = selCmpt.name;\n const { x, y } = selCmpt.project.hasChannel;\n const xvname = x && x.signals.visual;\n const yvname = y && y.signals.visual;\n const store = `data(${stringValue(selCmpt.name + STORE)})`;\n // Do not add a brush if we're binding to scales.\n if (scales.has(selCmpt)) {\n return marks;\n }\n const update = {\n x: x !== undefined ? { signal: `${xvname}[0]` } : { value: 0 },\n y: y !== undefined ? { signal: `${yvname}[0]` } : { value: 0 },\n x2: x !== undefined ? { signal: `${xvname}[1]` } : { field: { group: 'width' } },\n y2: y !== undefined ? { signal: `${yvname}[1]` } : { field: { group: 'height' } }\n };\n // If the selection is resolved to global, only a single interval is in\n // the store. Wrap brush mark's encodings with a production rule to test\n // this based on the `unit` property. Hide the brush mark if it corresponds\n // to a unit different from the one in the store.\n if (selCmpt.resolve === 'global') {\n for (const key of keys(update)) {\n update[key] = [\n Object.assign({ test: `${store}.length && ${store}[0].unit === ${unitName(model)}` }, update[key]),\n { value: 0 }\n ];\n }\n }\n // Two brush marks ensure that fill colors and other aesthetic choices do\n // not interefere with the core marks, but that the brushed region can still\n // be interacted with (e.g., dragging it around).\n const _a = selCmpt.mark, { fill, fillOpacity, cursor } = _a, stroke = __rest(_a, [\"fill\", \"fillOpacity\", \"cursor\"]);\n const vgStroke = keys(stroke).reduce((def, k) => {\n def[k] = [\n {\n test: [x !== undefined && `${xvname}[0] !== ${xvname}[1]`, y !== undefined && `${yvname}[0] !== ${yvname}[1]`]\n .filter(t => t)\n .join(' && '),\n value: stroke[k]\n },\n { value: null }\n ];\n return def;\n }, {});\n return [\n {\n name: name + BRUSH + '_bg',\n type: 'rect',\n clip: true,\n encode: {\n enter: {\n fill: { value: fill },\n fillOpacity: { value: fillOpacity }\n },\n update: update\n }\n },\n ...marks,\n {\n name: name + BRUSH,\n type: 'rect',\n clip: true,\n encode: {\n enter: Object.assign(Object.assign({}, (cursor ? { cursor: { value: cursor } } : {})), { fill: { value: 'transparent' } }),\n update: Object.assign(Object.assign({}, update), vgStroke)\n }\n }\n ];\n }\n};\nexport default interval;\n/**\n * Returns the visual and data signals for an interval selection.\n */\nfunction channelSignals(model, selCmpt, proj, init) {\n const channel = proj.channel;\n const vname = proj.signals.visual;\n const dname = proj.signals.data;\n const hasScales = scales.has(selCmpt);\n const scaleName = stringValue(model.scaleName(channel));\n const scale = model.getScaleComponent(channel);\n const scaleType = scale ? scale.get('type') : undefined;\n const scaled = (str) => `scale(${scaleName}, ${str})`;\n const size = model.getSizeSignalRef(channel === X ? 'width' : 'height').signal;\n const coord = `${channel}(unit)`;\n const on = events(selCmpt, (def, evt) => {\n return [\n ...def,\n { events: evt.between[0], update: `[${coord}, ${coord}]` },\n { events: evt, update: `[${vname}[0], clamp(${coord}, 0, ${size})]` } // Brush End\n ];\n });\n // React to pan/zooms of continuous scales. Non-continuous scales\n // (band, point) cannot be pan/zoomed and any other changes\n // to their domains (e.g., filtering) should clear the brushes.\n on.push({\n events: { signal: selCmpt.name + SCALE_TRIGGER },\n update: hasContinuousDomain(scaleType) ? `[${scaled(`${dname}[0]`)}, ${scaled(`${dname}[1]`)}]` : `[0, 0]`\n });\n return hasScales\n ? [{ name: dname, on: [] }]\n : [\n Object.assign(Object.assign({ name: vname }, (init ? { init: assembleInit(init, true, scaled) } : { value: [] })), { on: on }),\n Object.assign(Object.assign({ name: dname }, (init ? { init: assembleInit(init) } : {})), { on: [\n {\n events: { signal: vname },\n update: `${vname}[0] === ${vname}[1] ? null : invert(${scaleName}, ${vname})`\n }\n ] })\n ];\n}\nfunction events(selCmpt, cb) {\n return selCmpt.events.reduce((on, evt) => {\n if (!evt.between) {\n warn(`${evt} is not an ordered event stream for interval selections.`);\n return on;\n }\n return cb(on, evt);\n }, []);\n}\n//# sourceMappingURL=interval.js.map","import { stringValue } from 'vega-util';\nimport { TUPLE, unitName } from '.';\nimport { TUPLE_FIELDS } from './transforms/project';\nexport function singleOrMultiSignals(model, selCmpt) {\n const name = selCmpt.name;\n const fieldsSg = name + TUPLE_FIELDS;\n const project = selCmpt.project;\n const datum = '(item().isVoronoi ? datum.datum : datum)';\n const values = project.items\n .map(p => {\n const fieldDef = model.fieldDef(p.channel);\n // Binned fields should capture extents, for a range test against the raw field.\n return fieldDef && fieldDef.bin\n ? `[${datum}[${stringValue(model.vgField(p.channel, {}))}], ` +\n `${datum}[${stringValue(model.vgField(p.channel, { binSuffix: 'end' }))}]]`\n : `${datum}[${stringValue(p.field)}]`;\n })\n .join(', ');\n // Only add a discrete selection to the store if a datum is present _and_\n // the interaction isn't occurring on a group mark. This guards against\n // polluting interactive state with invalid values in faceted displays\n // as the group marks are also data-driven. We force the update to account\n // for constant null states but varying toggles (e.g., shift-click in\n // whitespace followed by a click in whitespace; the store should only\n // be cleared on the second click).\n const update = `unit: ${unitName(model)}, fields: ${fieldsSg}, values`;\n const events = selCmpt.events;\n return [\n {\n name: name + TUPLE,\n on: events\n ? [\n {\n events,\n update: `datum && item().mark.marktype !== 'group' ? {${update}: [${values}]} : null`,\n force: true\n }\n ]\n : []\n }\n ];\n}\nconst multi = {\n signals: singleOrMultiSignals,\n modifyExpr: (model, selCmpt) => {\n const tpl = selCmpt.name + TUPLE;\n return tpl + ', ' + (selCmpt.resolve === 'global' ? 'null' : `{unit: ${unitName(model)}}`);\n }\n};\nexport default multi;\n//# sourceMappingURL=multi.js.map","import { TUPLE, unitName } from '.';\nimport { singleOrMultiSignals } from './multi';\nconst single = {\n signals: singleOrMultiSignals,\n modifyExpr: (model, selCmpt) => {\n const tpl = selCmpt.name + TUPLE;\n return tpl + ', ' + (selCmpt.resolve === 'global' ? 'true' : `{unit: ${unitName(model)}}`);\n }\n};\nexport default single;\n//# sourceMappingURL=single.js.map","import { stringValue } from 'vega-util';\nimport { FACET_CHANNELS } from '../../channel';\nimport { SELECTION_ID } from '../../selection';\nimport { vals } from '../../util';\nimport { isFacetModel } from '../model';\nimport interval from './interval';\nimport multi from './multi';\nimport single from './single';\nexport const STORE = '_store';\nexport const TUPLE = '_tuple';\nexport const MODIFY = '_modify';\nexport const SELECTION_DOMAIN = '_selection_domain_';\nexport const VL_SELECTION_RESOLVE = 'vlSelectionResolve';\nconst compilers = { single, multi, interval };\nexport function forEachSelection(model, cb) {\n const selections = model.component.selection;\n if (selections) {\n for (const sel of vals(selections)) {\n const success = cb(sel, compilers[sel.type]);\n if (success === true)\n break;\n }\n }\n}\nfunction getFacetModel(model) {\n let parent = model.parent;\n while (parent) {\n if (isFacetModel(parent)) {\n break;\n }\n parent = parent.parent;\n }\n return parent;\n}\nexport function unitName(model, { escape } = { escape: true }) {\n let name = escape ? stringValue(model.name) : model.name;\n const facetModel = getFacetModel(model);\n if (facetModel) {\n const { facet } = facetModel;\n for (const channel of FACET_CHANNELS) {\n if (facet[channel]) {\n name += ` + '__facet_${channel}_' + (facet[${stringValue(facetModel.vgField(channel))}])`;\n }\n }\n }\n return name;\n}\nexport function requiresSelectionId(model) {\n let identifier = false;\n forEachSelection(model, selCmpt => {\n identifier = identifier || selCmpt.project.items.some(proj => proj.field === SELECTION_ID);\n });\n return identifier;\n}\n//# sourceMappingURL=index.js.map","function accessor (fn, fields, name) {\n fn.fields = fields || [];\n fn.fname = name;\n return fn;\n}\nfunction accessorName(fn) {\n return fn == null ? null : fn.fname;\n}\nfunction accessorFields(fn) {\n return fn == null ? null : fn.fields;\n}\n\nfunction getter (path) {\n return path.length === 1 ? get1(path[0]) : getN(path);\n}\nconst get1 = field => function (obj) {\n return obj[field];\n};\nconst getN = path => {\n const len = path.length;\n return function (obj) {\n for (let i = 0; i < len; ++i) {\n obj = obj[path[i]];\n }\n return obj;\n };\n};\n\nfunction error (message) {\n throw Error(message);\n}\n\nfunction splitAccessPath (p) {\n const path = [],\n n = p.length;\n let q = null,\n b = 0,\n s = '',\n i,\n j,\n c;\n p = p + '';\n function push() {\n path.push(s + p.substring(i, j));\n s = '';\n i = j + 1;\n }\n for (i = j = 0; j < n; ++j) {\n c = p[j];\n if (c === '\\\\') {\n s += p.substring(i, j++);\n i = j;\n } else if (c === q) {\n push();\n q = null;\n b = -1;\n } else if (q) {\n continue;\n } else if (i === b && c === '\"') {\n i = j + 1;\n q = c;\n } else if (i === b && c === \"'\") {\n i = j + 1;\n q = c;\n } else if (c === '.' && !b) {\n if (j > i) {\n push();\n } else {\n i = j + 1;\n }\n } else if (c === '[') {\n if (j > i) push();\n b = i = j + 1;\n } else if (c === ']') {\n if (!b) error('Access path missing open bracket: ' + p);\n if (b > 0) push();\n b = 0;\n i = j + 1;\n }\n }\n if (b) error('Access path missing closing bracket: ' + p);\n if (q) error('Access path missing closing quote: ' + p);\n if (j > i) {\n j++;\n push();\n }\n return path;\n}\n\nfunction field (field, name, opt) {\n const path = splitAccessPath(field);\n field = path.length === 1 ? path[0] : field;\n return accessor((opt && opt.get || getter)(path), [field], name || field);\n}\n\nconst id = field('id');\nconst identity = accessor(_ => _, [], 'identity');\nconst zero = accessor(() => 0, [], 'zero');\nconst one = accessor(() => 1, [], 'one');\nconst truthy = accessor(() => true, [], 'true');\nconst falsy = accessor(() => false, [], 'false');\n\nfunction log$1(method, level, input) {\n const args = [level].concat([].slice.call(input));\n console[method].apply(console, args); // eslint-disable-line no-console\n}\n\nconst None = 0;\nconst Error$1 = 1;\nconst Warn = 2;\nconst Info = 3;\nconst Debug = 4;\nfunction logger (_, method) {\n let handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : log$1;\n let level = _ || None;\n return {\n level(_) {\n if (arguments.length) {\n level = +_;\n return this;\n } else {\n return level;\n }\n },\n error() {\n if (level >= Error$1) handler(method || 'error', 'ERROR', arguments);\n return this;\n },\n warn() {\n if (level >= Warn) handler(method || 'warn', 'WARN', arguments);\n return this;\n },\n info() {\n if (level >= Info) handler(method || 'log', 'INFO', arguments);\n return this;\n },\n debug() {\n if (level >= Debug) handler(method || 'log', 'DEBUG', arguments);\n return this;\n }\n };\n}\n\nvar isArray = Array.isArray;\n\nfunction isObject (_) {\n return _ === Object(_);\n}\n\nconst isLegalKey = key => key !== '__proto__';\nfunction mergeConfig() {\n for (var _len = arguments.length, configs = new Array(_len), _key = 0; _key < _len; _key++) {\n configs[_key] = arguments[_key];\n }\n return configs.reduce((out, source) => {\n for (const key in source) {\n if (key === 'signals') {\n // for signals, we merge the signals arrays\n // source signals take precedence over\n // existing signals with the same name\n out.signals = mergeNamed(out.signals, source.signals);\n } else {\n // otherwise, merge objects subject to recursion constraints\n // for legend block, recurse for the layout entry only\n // for style block, recurse for all properties\n // otherwise, no recursion: objects overwrite, no merging\n const r = key === 'legend' ? {\n layout: 1\n } : key === 'style' ? true : null;\n writeConfig(out, key, source[key], r);\n }\n }\n return out;\n }, {});\n}\nfunction writeConfig(output, key, value, recurse) {\n if (!isLegalKey(key)) return;\n let k, o;\n if (isObject(value) && !isArray(value)) {\n o = isObject(output[key]) ? output[key] : output[key] = {};\n for (k in value) {\n if (recurse && (recurse === true || recurse[k])) {\n writeConfig(o, k, value[k]);\n } else if (isLegalKey(k)) {\n o[k] = value[k];\n }\n }\n } else {\n output[key] = value;\n }\n}\nfunction mergeNamed(a, b) {\n if (a == null) return b;\n const map = {},\n out = [];\n function add(_) {\n if (!map[_.name]) {\n map[_.name] = 1;\n out.push(_);\n }\n }\n b.forEach(add);\n a.forEach(add);\n return out;\n}\n\nfunction peek (array) {\n return array[array.length - 1];\n}\n\nfunction toNumber (_) {\n return _ == null || _ === '' ? null : +_;\n}\n\nconst exp = sign => x => sign * Math.exp(x);\nconst log = sign => x => Math.log(sign * x);\nconst symlog = c => x => Math.sign(x) * Math.log1p(Math.abs(x / c));\nconst symexp = c => x => Math.sign(x) * Math.expm1(Math.abs(x)) * c;\nconst pow = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\nfunction pan(domain, delta, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n dd = (d1 - d0) * delta;\n return [ground(d0 - dd), ground(d1 - dd)];\n}\nfunction panLinear(domain, delta) {\n return pan(domain, delta, toNumber, identity);\n}\nfunction panLog(domain, delta) {\n var sign = Math.sign(domain[0]);\n return pan(domain, delta, log(sign), exp(sign));\n}\nfunction panPow(domain, delta, exponent) {\n return pan(domain, delta, pow(exponent), pow(1 / exponent));\n}\nfunction panSymlog(domain, delta, constant) {\n return pan(domain, delta, symlog(constant), symexp(constant));\n}\nfunction zoom(domain, anchor, scale, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n da = anchor != null ? lift(anchor) : (d0 + d1) / 2;\n return [ground(da + (d0 - da) * scale), ground(da + (d1 - da) * scale)];\n}\nfunction zoomLinear(domain, anchor, scale) {\n return zoom(domain, anchor, scale, toNumber, identity);\n}\nfunction zoomLog(domain, anchor, scale) {\n const sign = Math.sign(domain[0]);\n return zoom(domain, anchor, scale, log(sign), exp(sign));\n}\nfunction zoomPow(domain, anchor, scale, exponent) {\n return zoom(domain, anchor, scale, pow(exponent), pow(1 / exponent));\n}\nfunction zoomSymlog(domain, anchor, scale, constant) {\n return zoom(domain, anchor, scale, symlog(constant), symexp(constant));\n}\n\nfunction quarter(date) {\n return 1 + ~~(new Date(date).getMonth() / 3);\n}\nfunction utcquarter(date) {\n return 1 + ~~(new Date(date).getUTCMonth() / 3);\n}\n\nfunction array (_) {\n return _ != null ? isArray(_) ? _ : [_] : [];\n}\n\n/**\n * Span-preserving range clamp. If the span of the input range is less\n * than (max - min) and an endpoint exceeds either the min or max value,\n * the range is translated such that the span is preserved and one\n * endpoint touches the boundary of the min/max range.\n * If the span exceeds (max - min), the range [min, max] is returned.\n */\nfunction clampRange (range, min, max) {\n let lo = range[0],\n hi = range[1],\n span;\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n span = hi - lo;\n return span >= max - min ? [min, max] : [lo = Math.min(Math.max(lo, min), max - span), lo + span];\n}\n\nfunction isFunction (_) {\n return typeof _ === 'function';\n}\n\nconst DESCENDING = 'descending';\nfunction compare (fields, orders, opt) {\n opt = opt || {};\n orders = array(orders) || [];\n const ord = [],\n get = [],\n fmap = {},\n gen = opt.comparator || comparator;\n array(fields).forEach((f, i) => {\n if (f == null) return;\n ord.push(orders[i] === DESCENDING ? -1 : 1);\n get.push(f = isFunction(f) ? f : field(f, null, opt));\n (accessorFields(f) || []).forEach(_ => fmap[_] = 1);\n });\n return get.length === 0 ? null : accessor(gen(get, ord), Object.keys(fmap));\n}\nconst ascending = (u, v) => (u < v || u == null) && v != null ? -1 : (u > v || v == null) && u != null ? 1 : (v = v instanceof Date ? +v : v, u = u instanceof Date ? +u : u) !== u && v === v ? -1 : v !== v && u === u ? 1 : 0;\nconst comparator = (fields, orders) => fields.length === 1 ? compare1(fields[0], orders[0]) : compareN(fields, orders, fields.length);\nconst compare1 = (field, order) => function (a, b) {\n return ascending(field(a), field(b)) * order;\n};\nconst compareN = (fields, orders, n) => {\n orders.push(0); // pad zero for convenient lookup\n return function (a, b) {\n let f,\n c = 0,\n i = -1;\n while (c === 0 && ++i < n) {\n f = fields[i];\n c = ascending(f(a), f(b));\n }\n return c * orders[i];\n };\n};\n\nfunction constant (_) {\n return isFunction(_) ? _ : () => _;\n}\n\nfunction debounce (delay, handler) {\n let tid;\n return e => {\n if (tid) clearTimeout(tid);\n tid = setTimeout(() => (handler(e), tid = null), delay);\n };\n}\n\nfunction extend (_) {\n for (let x, k, i = 1, len = arguments.length; i < len; ++i) {\n x = arguments[i];\n for (k in x) {\n _[k] = x[k];\n }\n }\n return _;\n}\n\n/**\n * Return an array with minimum and maximum values, in the\n * form [min, max]. Ignores null, undefined, and NaN values.\n */\nfunction extent (array, f) {\n let i = 0,\n n,\n v,\n min,\n max;\n if (array && (n = array.length)) {\n if (f == null) {\n // find first valid value\n for (v = array[i]; i < n && (v == null || v !== v); v = array[++i]);\n min = max = v;\n\n // visit all other values\n for (; i < n; ++i) {\n v = array[i];\n // skip null/undefined; NaN will fail all comparisons\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n } else {\n // find first valid value\n for (v = f(array[i]); i < n && (v == null || v !== v); v = f(array[++i]));\n min = max = v;\n\n // visit all other values\n for (; i < n; ++i) {\n v = f(array[i]);\n // skip null/undefined; NaN will fail all comparisons\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n }\n }\n return [min, max];\n}\n\nfunction extentIndex (array, f) {\n const n = array.length;\n let i = -1,\n a,\n b,\n c,\n u,\n v;\n if (f == null) {\n while (++i < n) {\n b = array[i];\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n if (i === n) return [-1, -1];\n u = v = i;\n while (++i < n) {\n b = array[i];\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n } else {\n while (++i < n) {\n b = f(array[i], i, array);\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n if (i === n) return [-1, -1];\n u = v = i;\n while (++i < n) {\n b = f(array[i], i, array);\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n }\n return [u, v];\n}\n\nconst hop = Object.prototype.hasOwnProperty;\nfunction has (object, property) {\n return hop.call(object, property);\n}\n\nconst NULL = {};\nfunction fastmap (input) {\n let obj = {},\n test;\n function has$1(key) {\n return has(obj, key) && obj[key] !== NULL;\n }\n const map = {\n size: 0,\n empty: 0,\n object: obj,\n has: has$1,\n get(key) {\n return has$1(key) ? obj[key] : undefined;\n },\n set(key, value) {\n if (!has$1(key)) {\n ++map.size;\n if (obj[key] === NULL) --map.empty;\n }\n obj[key] = value;\n return this;\n },\n delete(key) {\n if (has$1(key)) {\n --map.size;\n ++map.empty;\n obj[key] = NULL;\n }\n return this;\n },\n clear() {\n map.size = map.empty = 0;\n map.object = obj = {};\n },\n test(_) {\n if (arguments.length) {\n test = _;\n return map;\n } else {\n return test;\n }\n },\n clean() {\n const next = {};\n let size = 0;\n for (const key in obj) {\n const value = obj[key];\n if (value !== NULL && (!test || !test(value))) {\n next[key] = value;\n ++size;\n }\n }\n map.size = size;\n map.empty = 0;\n map.object = obj = next;\n }\n };\n if (input) Object.keys(input).forEach(key => {\n map.set(key, input[key]);\n });\n return map;\n}\n\nfunction flush (range, value, threshold, left, right, center) {\n if (!threshold && threshold !== 0) return center;\n const t = +threshold;\n let a = range[0],\n b = peek(range),\n l;\n\n // swap endpoints if range is reversed\n if (b < a) {\n l = a;\n a = b;\n b = l;\n }\n\n // compare value to endpoints\n l = Math.abs(value - a);\n const r = Math.abs(b - value);\n\n // adjust if value is within threshold distance of endpoint\n return l < r && l <= t ? left : r <= t ? right : center;\n}\n\nfunction inherits (child, parent, members) {\n const proto = child.prototype = Object.create(parent.prototype);\n Object.defineProperty(proto, 'constructor', {\n value: child,\n writable: true,\n enumerable: true,\n configurable: true\n });\n return extend(proto, members);\n}\n\n/**\n * Predicate that returns true if the value lies within the span\n * of the given range. The left and right flags control the use\n * of inclusive (true) or exclusive (false) comparisons.\n */\nfunction inrange (value, range, left, right) {\n let r0 = range[0],\n r1 = range[range.length - 1],\n t;\n if (r0 > r1) {\n t = r0;\n r0 = r1;\n r1 = t;\n }\n left = left === undefined || left;\n right = right === undefined || right;\n return (left ? r0 <= value : r0 < value) && (right ? value <= r1 : value < r1);\n}\n\nfunction isBoolean (_) {\n return typeof _ === 'boolean';\n}\n\nfunction isDate (_) {\n return Object.prototype.toString.call(_) === '[object Date]';\n}\n\nfunction isIterable (_) {\n return _ && isFunction(_[Symbol.iterator]);\n}\n\nfunction isNumber (_) {\n return typeof _ === 'number';\n}\n\nfunction isRegExp (_) {\n return Object.prototype.toString.call(_) === '[object RegExp]';\n}\n\nfunction isString (_) {\n return typeof _ === 'string';\n}\n\nfunction key (fields, flat, opt) {\n if (fields) {\n fields = flat ? array(fields).map(f => f.replace(/\\\\(.)/g, '$1')) : array(fields);\n }\n const len = fields && fields.length,\n gen = opt && opt.get || getter,\n map = f => gen(flat ? [f] : splitAccessPath(f));\n let fn;\n if (!len) {\n fn = function () {\n return '';\n };\n } else if (len === 1) {\n const get = map(fields[0]);\n fn = function (_) {\n return '' + get(_);\n };\n } else {\n const get = fields.map(map);\n fn = function (_) {\n let s = '' + get[0](_),\n i = 0;\n while (++i < len) s += '|' + get[i](_);\n return s;\n };\n }\n return accessor(fn, fields, 'key');\n}\n\nfunction lerp (array, frac) {\n const lo = array[0],\n hi = peek(array),\n f = +frac;\n return !f ? lo : f === 1 ? hi : lo + f * (hi - lo);\n}\n\nconst DEFAULT_MAX_SIZE = 10000;\n\n// adapted from https://github.com/dominictarr/hashlru/ (MIT License)\nfunction lruCache (maxsize) {\n maxsize = +maxsize || DEFAULT_MAX_SIZE;\n let curr, prev, size;\n const clear = () => {\n curr = {};\n prev = {};\n size = 0;\n };\n const update = (key, value) => {\n if (++size > maxsize) {\n prev = curr;\n curr = {};\n size = 1;\n }\n return curr[key] = value;\n };\n clear();\n return {\n clear,\n has: key => has(curr, key) || has(prev, key),\n get: key => has(curr, key) ? curr[key] : has(prev, key) ? update(key, prev[key]) : undefined,\n set: (key, value) => has(curr, key) ? curr[key] = value : update(key, value)\n };\n}\n\nfunction merge (compare, array0, array1, output) {\n const n0 = array0.length,\n n1 = array1.length;\n if (!n1) return array0;\n if (!n0) return array1;\n const merged = output || new array0.constructor(n0 + n1);\n let i0 = 0,\n i1 = 0,\n i = 0;\n for (; i0 < n0 && i1 < n1; ++i) {\n merged[i] = compare(array0[i0], array1[i1]) > 0 ? array1[i1++] : array0[i0++];\n }\n for (; i0 < n0; ++i0, ++i) {\n merged[i] = array0[i0];\n }\n for (; i1 < n1; ++i1, ++i) {\n merged[i] = array1[i1];\n }\n return merged;\n}\n\nfunction repeat (str, reps) {\n let s = '';\n while (--reps >= 0) s += str;\n return s;\n}\n\nfunction pad (str, length, padchar, align) {\n const c = padchar || ' ',\n s = str + '',\n n = length - s.length;\n return n <= 0 ? s : align === 'left' ? repeat(c, n) + s : align === 'center' ? repeat(c, ~~(n / 2)) + s + repeat(c, Math.ceil(n / 2)) : s + repeat(c, n);\n}\n\n/**\n * Return the numerical span of an array: the difference between\n * the last and first values.\n */\nfunction span (array) {\n return array && peek(array) - array[0] || 0;\n}\n\nfunction $(x) {\n return isArray(x) ? '[' + x.map($) + ']' : isObject(x) || isString(x) ?\n // Output valid JSON and JS source strings.\n // See http://timelessrepo.com/json-isnt-a-javascript-subset\n JSON.stringify(x).replace('\\u2028', '\\\\u2028').replace('\\u2029', '\\\\u2029') : x;\n}\n\nfunction toBoolean (_) {\n return _ == null || _ === '' ? null : !_ || _ === 'false' || _ === '0' ? false : !!_;\n}\n\nconst defaultParser = _ => isNumber(_) ? _ : isDate(_) ? _ : Date.parse(_);\nfunction toDate (_, parser) {\n parser = parser || defaultParser;\n return _ == null || _ === '' ? null : parser(_);\n}\n\nfunction toString (_) {\n return _ == null || _ === '' ? null : _ + '';\n}\n\nfunction toSet (_) {\n const s = {},\n n = _.length;\n for (let i = 0; i < n; ++i) s[_[i]] = true;\n return s;\n}\n\nfunction truncate (str, length, align, ellipsis) {\n const e = ellipsis != null ? ellipsis : '\\u2026',\n s = str + '',\n n = s.length,\n l = Math.max(0, length - e.length);\n return n <= length ? s : align === 'left' ? e + s.slice(n - l) : align === 'center' ? s.slice(0, Math.ceil(l / 2)) + e + s.slice(n - ~~(l / 2)) : s.slice(0, l) + e;\n}\n\nfunction visitArray (array, filter, visitor) {\n if (array) {\n if (filter) {\n const n = array.length;\n for (let i = 0; i < n; ++i) {\n const t = filter(array[i]);\n if (t) visitor(t, i, array);\n }\n } else {\n array.forEach(visitor);\n }\n }\n}\n\nexport { Debug, Error$1 as Error, Info, None, Warn, accessor, accessorFields, accessorName, array, ascending, clampRange, compare, constant, debounce, error, extend, extent, extentIndex, falsy, fastmap, field, flush, has as hasOwnProperty, id, identity, inherits, inrange, isArray, isBoolean, isDate, isFunction, isIterable, isNumber, isObject, isRegExp, isString, key, lerp, logger, lruCache, merge, mergeConfig, one, pad, panLinear, panLog, panPow, panSymlog, peek, quarter, repeat, span, splitAccessPath, $ as stringValue, toBoolean, toDate, toNumber, toSet, toString, truncate, truthy, utcquarter, visitArray, writeConfig, zero, zoomLinear, zoomLog, zoomPow, zoomSymlog };\n","import { error, toSet, isFunction, isString, hasOwnProperty } from 'vega-util';\n\nconst RawCode = 'RawCode';\nconst Literal = 'Literal';\nconst Property = 'Property';\nconst Identifier = 'Identifier';\nconst ArrayExpression = 'ArrayExpression';\nconst BinaryExpression = 'BinaryExpression';\nconst CallExpression = 'CallExpression';\nconst ConditionalExpression = 'ConditionalExpression';\nconst LogicalExpression = 'LogicalExpression';\nconst MemberExpression = 'MemberExpression';\nconst ObjectExpression = 'ObjectExpression';\nconst UnaryExpression = 'UnaryExpression';\nfunction ASTNode(type) {\n this.type = type;\n}\n\nASTNode.prototype.visit = function (visitor) {\n let c, i, n;\n if (visitor(this)) return 1;\n\n for (c = children(this), i = 0, n = c.length; i < n; ++i) {\n if (c[i].visit(visitor)) return 1;\n }\n};\n\nfunction children(node) {\n switch (node.type) {\n case ArrayExpression:\n return node.elements;\n\n case BinaryExpression:\n case LogicalExpression:\n return [node.left, node.right];\n\n case CallExpression:\n return [node.callee].concat(node.arguments);\n\n case ConditionalExpression:\n return [node.test, node.consequent, node.alternate];\n\n case MemberExpression:\n return [node.object, node.property];\n\n case ObjectExpression:\n return node.properties;\n\n case Property:\n return [node.key, node.value];\n\n case UnaryExpression:\n return [node.argument];\n\n case Identifier:\n case Literal:\n case RawCode:\n default:\n return [];\n }\n}\n\n/*\n The following expression parser is based on Esprima (http://esprima.org/).\n Original header comment and license for Esprima is included here:\n\n Copyright (C) 2013 Ariya Hidayat \n Copyright (C) 2013 Thaddee Tyl \n Copyright (C) 2013 Mathias Bynens \n Copyright (C) 2012 Ariya Hidayat \n Copyright (C) 2012 Mathias Bynens \n Copyright (C) 2012 Joost-Wim Boekesteijn \n Copyright (C) 2012 Kris Kowal \n Copyright (C) 2012 Yusuke Suzuki \n Copyright (C) 2012 Arpad Borsos \n Copyright (C) 2011 Ariya Hidayat \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\nvar TokenName, source, index, length, lookahead;\nvar TokenBooleanLiteral = 1,\n TokenEOF = 2,\n TokenIdentifier = 3,\n TokenKeyword = 4,\n TokenNullLiteral = 5,\n TokenNumericLiteral = 6,\n TokenPunctuator = 7,\n TokenStringLiteral = 8,\n TokenRegularExpression = 9;\nTokenName = {};\nTokenName[TokenBooleanLiteral] = 'Boolean';\nTokenName[TokenEOF] = '';\nTokenName[TokenIdentifier] = 'Identifier';\nTokenName[TokenKeyword] = 'Keyword';\nTokenName[TokenNullLiteral] = 'Null';\nTokenName[TokenNumericLiteral] = 'Numeric';\nTokenName[TokenPunctuator] = 'Punctuator';\nTokenName[TokenStringLiteral] = 'String';\nTokenName[TokenRegularExpression] = 'RegularExpression';\nvar SyntaxArrayExpression = 'ArrayExpression',\n SyntaxBinaryExpression = 'BinaryExpression',\n SyntaxCallExpression = 'CallExpression',\n SyntaxConditionalExpression = 'ConditionalExpression',\n SyntaxIdentifier = 'Identifier',\n SyntaxLiteral = 'Literal',\n SyntaxLogicalExpression = 'LogicalExpression',\n SyntaxMemberExpression = 'MemberExpression',\n SyntaxObjectExpression = 'ObjectExpression',\n SyntaxProperty = 'Property',\n SyntaxUnaryExpression = 'UnaryExpression'; // Error messages should be identical to V8.\n\nvar MessageUnexpectedToken = 'Unexpected token %0',\n MessageUnexpectedNumber = 'Unexpected number',\n MessageUnexpectedString = 'Unexpected string',\n MessageUnexpectedIdentifier = 'Unexpected identifier',\n MessageUnexpectedReserved = 'Unexpected reserved word',\n MessageUnexpectedEOS = 'Unexpected end of input',\n MessageInvalidRegExp = 'Invalid regular expression',\n MessageUnterminatedRegExp = 'Invalid regular expression: missing /',\n MessageStrictOctalLiteral = 'Octal literals are not allowed in strict mode.',\n MessageStrictDuplicateProperty = 'Duplicate data property in object literal not allowed in strict mode';\nvar ILLEGAL = 'ILLEGAL',\n DISABLED = 'Disabled.'; // See also tools/generate-unicode-regex.py.\n\nvar RegexNonAsciiIdentifierStart = new RegExp('[\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0370-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0620-\\\\u064A\\\\u066E\\\\u066F\\\\u0671-\\\\u06D3\\\\u06D5\\\\u06E5\\\\u06E6\\\\u06EE\\\\u06EF\\\\u06FA-\\\\u06FC\\\\u06FF\\\\u0710\\\\u0712-\\\\u072F\\\\u074D-\\\\u07A5\\\\u07B1\\\\u07CA-\\\\u07EA\\\\u07F4\\\\u07F5\\\\u07FA\\\\u0800-\\\\u0815\\\\u081A\\\\u0824\\\\u0828\\\\u0840-\\\\u0858\\\\u08A0-\\\\u08B2\\\\u0904-\\\\u0939\\\\u093D\\\\u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\\u0CBD\\\\u0CDE\\\\u0CE0\\\\u0CE1\\\\u0CF1\\\\u0CF2\\\\u0D05-\\\\u0D0C\\\\u0D0E-\\\\u0D10\\\\u0D12-\\\\u0D3A\\\\u0D3D\\\\u0D4E\\\\u0D60\\\\u0D61\\\\u0D7A-\\\\u0D7F\\\\u0D85-\\\\u0D96\\\\u0D9A-\\\\u0DB1\\\\u0DB3-\\\\u0DBB\\\\u0DBD\\\\u0DC0-\\\\u0DC6\\\\u0E01-\\\\u0E30\\\\u0E32\\\\u0E33\\\\u0E40-\\\\u0E46\\\\u0E81\\\\u0E82\\\\u0E84\\\\u0E87\\\\u0E88\\\\u0E8A\\\\u0E8D\\\\u0E94-\\\\u0E97\\\\u0E99-\\\\u0E9F\\\\u0EA1-\\\\u0EA3\\\\u0EA5\\\\u0EA7\\\\u0EAA\\\\u0EAB\\\\u0EAD-\\\\u0EB0\\\\u0EB2\\\\u0EB3\\\\u0EBD\\\\u0EC0-\\\\u0EC4\\\\u0EC6\\\\u0EDC-\\\\u0EDF\\\\u0F00\\\\u0F40-\\\\u0F47\\\\u0F49-\\\\u0F6C\\\\u0F88-\\\\u0F8C\\\\u1000-\\\\u102A\\\\u103F\\\\u1050-\\\\u1055\\\\u105A-\\\\u105D\\\\u1061\\\\u1065\\\\u1066\\\\u106E-\\\\u1070\\\\u1075-\\\\u1081\\\\u108E\\\\u10A0-\\\\u10C5\\\\u10C7\\\\u10CD\\\\u10D0-\\\\u10FA\\\\u10FC-\\\\u1248\\\\u124A-\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1711\\\\u1720-\\\\u1731\\\\u1740-\\\\u1751\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1780-\\\\u17B3\\\\u17D7\\\\u17DC\\\\u1820-\\\\u1877\\\\u1880-\\\\u18A8\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1950-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19C1-\\\\u19C7\\\\u1A00-\\\\u1A16\\\\u1A20-\\\\u1A54\\\\u1AA7\\\\u1B05-\\\\u1B33\\\\u1B45-\\\\u1B4B\\\\u1B83-\\\\u1BA0\\\\u1BAE\\\\u1BAF\\\\u1BBA-\\\\u1BE5\\\\u1C00-\\\\u1C23\\\\u1C4D-\\\\u1C4F\\\\u1C5A-\\\\u1C7D\\\\u1CE9-\\\\u1CEC\\\\u1CEE-\\\\u1CF1\\\\u1CF5\\\\u1CF6\\\\u1D00-\\\\u1DBF\\\\u1E00-\\\\u1F15\\\\u1F18-\\\\u1F1D\\\\u1F20-\\\\u1F45\\\\u1F48-\\\\u1F4D\\\\u1F50-\\\\u1F57\\\\u1F59\\\\u1F5B\\\\u1F5D\\\\u1F5F-\\\\u1F7D\\\\u1F80-\\\\u1FB4\\\\u1FB6-\\\\u1FBC\\\\u1FBE\\\\u1FC2-\\\\u1FC4\\\\u1FC6-\\\\u1FCC\\\\u1FD0-\\\\u1FD3\\\\u1FD6-\\\\u1FDB\\\\u1FE0-\\\\u1FEC\\\\u1FF2-\\\\u1FF4\\\\u1FF6-\\\\u1FFC\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u2102\\\\u2107\\\\u210A-\\\\u2113\\\\u2115\\\\u2119-\\\\u211D\\\\u2124\\\\u2126\\\\u2128\\\\u212A-\\\\u212D\\\\u212F-\\\\u2139\\\\u213C-\\\\u213F\\\\u2145-\\\\u2149\\\\u214E\\\\u2160-\\\\u2188\\\\u2C00-\\\\u2C2E\\\\u2C30-\\\\u2C5E\\\\u2C60-\\\\u2CE4\\\\u2CEB-\\\\u2CEE\\\\u2CF2\\\\u2CF3\\\\u2D00-\\\\u2D25\\\\u2D27\\\\u2D2D\\\\u2D30-\\\\u2D67\\\\u2D6F\\\\u2D80-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2E2F\\\\u3005-\\\\u3007\\\\u3021-\\\\u3029\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FCC\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA61F\\\\uA62A\\\\uA62B\\\\uA640-\\\\uA66E\\\\uA67F-\\\\uA69D\\\\uA6A0-\\\\uA6EF\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B-\\\\uA78E\\\\uA790-\\\\uA7AD\\\\uA7B0\\\\uA7B1\\\\uA7F7-\\\\uA801\\\\uA803-\\\\uA805\\\\uA807-\\\\uA80A\\\\uA80C-\\\\uA822\\\\uA840-\\\\uA873\\\\uA882-\\\\uA8B3\\\\uA8F2-\\\\uA8F7\\\\uA8FB\\\\uA90A-\\\\uA925\\\\uA930-\\\\uA946\\\\uA960-\\\\uA97C\\\\uA984-\\\\uA9B2\\\\uA9CF\\\\uA9E0-\\\\uA9E4\\\\uA9E6-\\\\uA9EF\\\\uA9FA-\\\\uA9FE\\\\uAA00-\\\\uAA28\\\\uAA40-\\\\uAA42\\\\uAA44-\\\\uAA4B\\\\uAA60-\\\\uAA76\\\\uAA7A\\\\uAA7E-\\\\uAAAF\\\\uAAB1\\\\uAAB5\\\\uAAB6\\\\uAAB9-\\\\uAABD\\\\uAAC0\\\\uAAC2\\\\uAADB-\\\\uAADD\\\\uAAE0-\\\\uAAEA\\\\uAAF2-\\\\uAAF4\\\\uAB01-\\\\uAB06\\\\uAB09-\\\\uAB0E\\\\uAB11-\\\\uAB16\\\\uAB20-\\\\uAB26\\\\uAB28-\\\\uAB2E\\\\uAB30-\\\\uAB5A\\\\uAB5C-\\\\uAB5F\\\\uAB64\\\\uAB65\\\\uABC0-\\\\uABE2\\\\uAC00-\\\\uD7A3\\\\uD7B0-\\\\uD7C6\\\\uD7CB-\\\\uD7FB\\\\uF900-\\\\uFA6D\\\\uFA70-\\\\uFAD9\\\\uFB00-\\\\uFB06\\\\uFB13-\\\\uFB17\\\\uFB1D\\\\uFB1F-\\\\uFB28\\\\uFB2A-\\\\uFB36\\\\uFB38-\\\\uFB3C\\\\uFB3E\\\\uFB40\\\\uFB41\\\\uFB43\\\\uFB44\\\\uFB46-\\\\uFBB1\\\\uFBD3-\\\\uFD3D\\\\uFD50-\\\\uFD8F\\\\uFD92-\\\\uFDC7\\\\uFDF0-\\\\uFDFB\\\\uFE70-\\\\uFE74\\\\uFE76-\\\\uFEFC\\\\uFF21-\\\\uFF3A\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]'),\n // eslint-disable-next-line no-misleading-character-class\nRegexNonAsciiIdentifierPart = new RegExp('[\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0300-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u0483-\\\\u0487\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u0591-\\\\u05BD\\\\u05BF\\\\u05C1\\\\u05C2\\\\u05C4\\\\u05C5\\\\u05C7\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0610-\\\\u061A\\\\u0620-\\\\u0669\\\\u066E-\\\\u06D3\\\\u06D5-\\\\u06DC\\\\u06DF-\\\\u06E8\\\\u06EA-\\\\u06FC\\\\u06FF\\\\u0710-\\\\u074A\\\\u074D-\\\\u07B1\\\\u07C0-\\\\u07F5\\\\u07FA\\\\u0800-\\\\u082D\\\\u0840-\\\\u085B\\\\u08A0-\\\\u08B2\\\\u08E4-\\\\u0963\\\\u0966-\\\\u096F\\\\u0971-\\\\u0983\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BC-\\\\u09C4\\\\u09C7\\\\u09C8\\\\u09CB-\\\\u09CE\\\\u09D7\\\\u09DC\\\\u09DD\\\\u09DF-\\\\u09E3\\\\u09E6-\\\\u09F1\\\\u0A01-\\\\u0A03\\\\u0A05-\\\\u0A0A\\\\u0A0F\\\\u0A10\\\\u0A13-\\\\u0A28\\\\u0A2A-\\\\u0A30\\\\u0A32\\\\u0A33\\\\u0A35\\\\u0A36\\\\u0A38\\\\u0A39\\\\u0A3C\\\\u0A3E-\\\\u0A42\\\\u0A47\\\\u0A48\\\\u0A4B-\\\\u0A4D\\\\u0A51\\\\u0A59-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F71-\\\\u0F84\\\\u0F86-\\\\u0F97\\\\u0F99-\\\\u0FBC\\\\u0FC6\\\\u1000-\\\\u1049\\\\u1050-\\\\u109D\\\\u10A0-\\\\u10C5\\\\u10C7\\\\u10CD\\\\u10D0-\\\\u10FA\\\\u10FC-\\\\u1248\\\\u124A-\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u135D-\\\\u135F\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1714\\\\u1720-\\\\u1734\\\\u1740-\\\\u1753\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1772\\\\u1773\\\\u1780-\\\\u17D3\\\\u17D7\\\\u17DC\\\\u17DD\\\\u17E0-\\\\u17E9\\\\u180B-\\\\u180D\\\\u1810-\\\\u1819\\\\u1820-\\\\u1877\\\\u1880-\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1920-\\\\u192B\\\\u1930-\\\\u193B\\\\u1946-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19B0-\\\\u19C9\\\\u19D0-\\\\u19D9\\\\u1A00-\\\\u1A1B\\\\u1A20-\\\\u1A5E\\\\u1A60-\\\\u1A7C\\\\u1A7F-\\\\u1A89\\\\u1A90-\\\\u1A99\\\\u1AA7\\\\u1AB0-\\\\u1ABD\\\\u1B00-\\\\u1B4B\\\\u1B50-\\\\u1B59\\\\u1B6B-\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DDE\\\\u2DE0-\\\\u2DFF\\\\u2E2F\\\\u3005-\\\\u3007\\\\u3021-\\\\u302F\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u3099\\\\u309A\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FCC\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA62B\\\\uA640-\\\\uA66F\\\\uA674-\\\\uA67D\\\\uA67F-\\\\uA69D\\\\uA69F-\\\\uA6F1\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B-\\\\uA78E\\\\uA790-\\\\uA7AD\\\\uA7B0\\\\uA7B1\\\\uA7F7-\\\\uA827\\\\uA840-\\\\uA873\\\\uA880-\\\\uA8C4\\\\uA8D0-\\\\uA8D9\\\\uA8E0-\\\\uA8F7\\\\uA8FB\\\\uA900-\\\\uA92D\\\\uA930-\\\\uA953\\\\uA960-\\\\uA97C\\\\uA980-\\\\uA9C0\\\\uA9CF-\\\\uA9D9\\\\uA9E0-\\\\uA9FE\\\\uAA00-\\\\uAA36\\\\uAA40-\\\\uAA4D\\\\uAA50-\\\\uAA59\\\\uAA60-\\\\uAA76\\\\uAA7A-\\\\uAAC2\\\\uAADB-\\\\uAADD\\\\uAAE0-\\\\uAAEF\\\\uAAF2-\\\\uAAF6\\\\uAB01-\\\\uAB06\\\\uAB09-\\\\uAB0E\\\\uAB11-\\\\uAB16\\\\uAB20-\\\\uAB26\\\\uAB28-\\\\uAB2E\\\\uAB30-\\\\uAB5A\\\\uAB5C-\\\\uAB5F\\\\uAB64\\\\uAB65\\\\uABC0-\\\\uABEA\\\\uABEC\\\\uABED\\\\uABF0-\\\\uABF9\\\\uAC00-\\\\uD7A3\\\\uD7B0-\\\\uD7C6\\\\uD7CB-\\\\uD7FB\\\\uF900-\\\\uFA6D\\\\uFA70-\\\\uFAD9\\\\uFB00-\\\\uFB06\\\\uFB13-\\\\uFB17\\\\uFB1D-\\\\uFB28\\\\uFB2A-\\\\uFB36\\\\uFB38-\\\\uFB3C\\\\uFB3E\\\\uFB40\\\\uFB41\\\\uFB43\\\\uFB44\\\\uFB46-\\\\uFBB1\\\\uFBD3-\\\\uFD3D\\\\uFD50-\\\\uFD8F\\\\uFD92-\\\\uFDC7\\\\uFDF0-\\\\uFDFB\\\\uFE00-\\\\uFE0F\\\\uFE20-\\\\uFE2D\\\\uFE33\\\\uFE34\\\\uFE4D-\\\\uFE4F\\\\uFE70-\\\\uFE74\\\\uFE76-\\\\uFEFC\\\\uFF10-\\\\uFF19\\\\uFF21-\\\\uFF3A\\\\uFF3F\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]'); // Ensure the condition is true, otherwise throw an error.\n// This is only to have a better contract semantic, i.e. another safety net\n// to catch a logic error. The condition shall be fulfilled in normal case.\n// Do NOT use this to enforce a certain condition on any user input.\n\nfunction assert(condition, message) {\n /* istanbul ignore next */\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n}\n\nfunction isDecimalDigit(ch) {\n return ch >= 0x30 && ch <= 0x39; // 0..9\n}\n\nfunction isHexDigit(ch) {\n return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;\n}\n\nfunction isOctalDigit(ch) {\n return '01234567'.indexOf(ch) >= 0;\n} // 7.2 White Space\n\n\nfunction isWhiteSpace(ch) {\n return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0;\n} // 7.3 Line Terminators\n\n\nfunction isLineTerminator(ch) {\n return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;\n} // 7.6 Identifier Names and Identifiers\n\n\nfunction isIdentifierStart(ch) {\n return ch === 0x24 || ch === 0x5F || // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A || // A..Z\n ch >= 0x61 && ch <= 0x7A || // a..z\n ch === 0x5C || // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierStart.test(String.fromCharCode(ch));\n}\n\nfunction isIdentifierPart(ch) {\n return ch === 0x24 || ch === 0x5F || // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A || // A..Z\n ch >= 0x61 && ch <= 0x7A || // a..z\n ch >= 0x30 && ch <= 0x39 || // 0..9\n ch === 0x5C || // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierPart.test(String.fromCharCode(ch));\n} // 7.6.1.1 Keywords\n\n\nconst keywords = {\n 'if': 1,\n 'in': 1,\n 'do': 1,\n 'var': 1,\n 'for': 1,\n 'new': 1,\n 'try': 1,\n 'let': 1,\n 'this': 1,\n 'else': 1,\n 'case': 1,\n 'void': 1,\n 'with': 1,\n 'enum': 1,\n 'while': 1,\n 'break': 1,\n 'catch': 1,\n 'throw': 1,\n 'const': 1,\n 'yield': 1,\n 'class': 1,\n 'super': 1,\n 'return': 1,\n 'typeof': 1,\n 'delete': 1,\n 'switch': 1,\n 'export': 1,\n 'import': 1,\n 'public': 1,\n 'static': 1,\n 'default': 1,\n 'finally': 1,\n 'extends': 1,\n 'package': 1,\n 'private': 1,\n 'function': 1,\n 'continue': 1,\n 'debugger': 1,\n 'interface': 1,\n 'protected': 1,\n 'instanceof': 1,\n 'implements': 1\n};\n\nfunction skipComment() {\n while (index < length) {\n const ch = source.charCodeAt(index);\n\n if (isWhiteSpace(ch) || isLineTerminator(ch)) {\n ++index;\n } else {\n break;\n }\n }\n}\n\nfunction scanHexEscape(prefix) {\n var i,\n len,\n ch,\n code = 0;\n len = prefix === 'u' ? 4 : 2;\n\n for (i = 0; i < len; ++i) {\n if (index < length && isHexDigit(source[index])) {\n ch = source[index++];\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n } else {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n\n return String.fromCharCode(code);\n}\n\nfunction scanUnicodeCodePointEscape() {\n var ch, code, cu1, cu2;\n ch = source[index];\n code = 0; // At least, one hex digit is required.\n\n if (ch === '}') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n while (index < length) {\n ch = source[index++];\n\n if (!isHexDigit(ch)) {\n break;\n }\n\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n }\n\n if (code > 0x10FFFF || ch !== '}') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } // UTF-16 Encoding\n\n\n if (code <= 0xFFFF) {\n return String.fromCharCode(code);\n }\n\n cu1 = (code - 0x10000 >> 10) + 0xD800;\n cu2 = (code - 0x10000 & 1023) + 0xDC00;\n return String.fromCharCode(cu1, cu2);\n}\n\nfunction getEscapedIdentifier() {\n var ch, id;\n ch = source.charCodeAt(index++);\n id = String.fromCharCode(ch); // '\\u' (U+005C, U+0075) denotes an escaped character.\n\n if (ch === 0x5C) {\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n ++index;\n ch = scanHexEscape('u');\n\n if (!ch || ch === '\\\\' || !isIdentifierStart(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n id = ch;\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n\n if (!isIdentifierPart(ch)) {\n break;\n }\n\n ++index;\n id += String.fromCharCode(ch); // '\\u' (U+005C, U+0075) denotes an escaped character.\n\n if (ch === 0x5C) {\n id = id.substr(0, id.length - 1);\n\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n ++index;\n ch = scanHexEscape('u');\n\n if (!ch || ch === '\\\\' || !isIdentifierPart(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n id += ch;\n }\n }\n\n return id;\n}\n\nfunction getIdentifier() {\n var start, ch;\n start = index++;\n\n while (index < length) {\n ch = source.charCodeAt(index);\n\n if (ch === 0x5C) {\n // Blackslash (U+005C) marks Unicode escape sequence.\n index = start;\n return getEscapedIdentifier();\n }\n\n if (isIdentifierPart(ch)) {\n ++index;\n } else {\n break;\n }\n }\n\n return source.slice(start, index);\n}\n\nfunction scanIdentifier() {\n var start, id, type;\n start = index; // Backslash (U+005C) starts an escaped character.\n\n id = source.charCodeAt(index) === 0x5C ? getEscapedIdentifier() : getIdentifier(); // There is no keyword or literal with only one character.\n // Thus, it must be an identifier.\n\n if (id.length === 1) {\n type = TokenIdentifier;\n } else if (keywords.hasOwnProperty(id)) {\n // eslint-disable-line no-prototype-builtins\n type = TokenKeyword;\n } else if (id === 'null') {\n type = TokenNullLiteral;\n } else if (id === 'true' || id === 'false') {\n type = TokenBooleanLiteral;\n } else {\n type = TokenIdentifier;\n }\n\n return {\n type: type,\n value: id,\n start: start,\n end: index\n };\n} // 7.7 Punctuators\n\n\nfunction scanPunctuator() {\n var start = index,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2,\n ch3,\n ch4;\n\n switch (code) {\n // Check for most common single-character punctuators.\n case 0x2E: // . dot\n\n case 0x28: // ( open bracket\n\n case 0x29: // ) close bracket\n\n case 0x3B: // ; semicolon\n\n case 0x2C: // , comma\n\n case 0x7B: // { open curly brace\n\n case 0x7D: // } close curly brace\n\n case 0x5B: // [\n\n case 0x5D: // ]\n\n case 0x3A: // :\n\n case 0x3F: // ?\n\n case 0x7E:\n // ~\n ++index;\n return {\n type: TokenPunctuator,\n value: String.fromCharCode(code),\n start: start,\n end: index\n };\n\n default:\n code2 = source.charCodeAt(index + 1); // '=' (U+003D) marks an assignment or comparison operator.\n\n if (code2 === 0x3D) {\n switch (code) {\n case 0x2B: // +\n\n case 0x2D: // -\n\n case 0x2F: // /\n\n case 0x3C: // <\n\n case 0x3E: // >\n\n case 0x5E: // ^\n\n case 0x7C: // |\n\n case 0x25: // %\n\n case 0x26: // &\n\n case 0x2A:\n // *\n index += 2;\n return {\n type: TokenPunctuator,\n value: String.fromCharCode(code) + String.fromCharCode(code2),\n start: start,\n end: index\n };\n\n case 0x21: // !\n\n case 0x3D:\n // =\n index += 2; // !== and ===\n\n if (source.charCodeAt(index) === 0x3D) {\n ++index;\n }\n\n return {\n type: TokenPunctuator,\n value: source.slice(start, index),\n start: start,\n end: index\n };\n }\n }\n\n } // 4-character punctuator: >>>=\n\n\n ch4 = source.substr(index, 4);\n\n if (ch4 === '>>>=') {\n index += 4;\n return {\n type: TokenPunctuator,\n value: ch4,\n start: start,\n end: index\n };\n } // 3-character punctuators: === !== >>> <<= >>=\n\n\n ch3 = ch4.substr(0, 3);\n\n if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {\n index += 3;\n return {\n type: TokenPunctuator,\n value: ch3,\n start: start,\n end: index\n };\n } // Other 2-character punctuators: ++ -- << >> && ||\n\n\n ch2 = ch3.substr(0, 2);\n\n if (ch1 === ch2[1] && '+-<>&|'.indexOf(ch1) >= 0 || ch2 === '=>') {\n index += 2;\n return {\n type: TokenPunctuator,\n value: ch2,\n start: start,\n end: index\n };\n }\n\n if (ch2 === '//') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } // 1-character punctuators: < > = ! + - * % & | ^ /\n\n\n if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n ++index;\n return {\n type: TokenPunctuator,\n value: ch1,\n start: start,\n end: index\n };\n }\n\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n} // 7.8.3 Numeric Literals\n\n\nfunction scanHexLiteral(start) {\n let number = '';\n\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n\n number += source[index++];\n }\n\n if (number.length === 0) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenNumericLiteral,\n value: parseInt('0x' + number, 16),\n start: start,\n end: index\n };\n}\n\nfunction scanOctalLiteral(start) {\n let number = '0' + source[index++];\n\n while (index < length) {\n if (!isOctalDigit(source[index])) {\n break;\n }\n\n number += source[index++];\n }\n\n if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenNumericLiteral,\n value: parseInt(number, 8),\n octal: true,\n start: start,\n end: index\n };\n}\n\nfunction scanNumericLiteral() {\n var number, start, ch;\n ch = source[index];\n assert(isDecimalDigit(ch.charCodeAt(0)) || ch === '.', 'Numeric literal must start with a decimal digit or a decimal point');\n start = index;\n number = '';\n\n if (ch !== '.') {\n number = source[index++];\n ch = source[index]; // Hex number starts with '0x'.\n // Octal number starts with '0'.\n\n if (number === '0') {\n if (ch === 'x' || ch === 'X') {\n ++index;\n return scanHexLiteral(start);\n }\n\n if (isOctalDigit(ch)) {\n return scanOctalLiteral(start);\n } // decimal number starts with '0' such as '09' is illegal.\n\n\n if (ch && isDecimalDigit(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n\n ch = source[index];\n }\n\n if (ch === '.') {\n number += source[index++];\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n\n ch = source[index];\n }\n\n if (ch === 'e' || ch === 'E') {\n number += source[index++];\n ch = source[index];\n\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n\n if (isDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenNumericLiteral,\n value: parseFloat(number),\n start: start,\n end: index\n };\n} // 7.8.4 String Literals\n\n\nfunction scanStringLiteral() {\n var str = '',\n quote,\n start,\n ch,\n code,\n octal = false;\n quote = source[index];\n assert(quote === '\\'' || quote === '\"', 'String literal must starts with a quote');\n start = index;\n ++index;\n\n while (index < length) {\n ch = source[index++];\n\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n\n if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'u':\n case 'x':\n if (source[index] === '{') {\n ++index;\n str += scanUnicodeCodePointEscape();\n } else {\n str += scanHexEscape(ch);\n }\n\n break;\n\n case 'n':\n str += '\\n';\n break;\n\n case 'r':\n str += '\\r';\n break;\n\n case 't':\n str += '\\t';\n break;\n\n case 'b':\n str += '\\b';\n break;\n\n case 'f':\n str += '\\f';\n break;\n\n case 'v':\n str += '\\x0B';\n break;\n\n default:\n if (isOctalDigit(ch)) {\n code = '01234567'.indexOf(ch); // \\0 is not octal escape sequence\n\n if (code !== 0) {\n octal = true;\n }\n\n if (index < length && isOctalDigit(source[index])) {\n octal = true;\n code = code * 8 + '01234567'.indexOf(source[index++]); // 3 digits are only allowed when string starts\n // with 0, 1, 2, 3\n\n if ('0123'.indexOf(ch) >= 0 && index < length && isOctalDigit(source[index])) {\n code = code * 8 + '01234567'.indexOf(source[index++]);\n }\n }\n\n str += String.fromCharCode(code);\n } else {\n str += ch;\n }\n\n break;\n }\n } else {\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n\n if (quote !== '') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n return {\n type: TokenStringLiteral,\n value: str,\n octal: octal,\n start: start,\n end: index\n };\n}\n\nfunction testRegExp(pattern, flags) {\n let tmp = pattern;\n\n if (flags.indexOf('u') >= 0) {\n // Replace each astral symbol and every Unicode code point\n // escape sequence with a single ASCII symbol to avoid throwing on\n // regular expressions that are only valid in combination with the\n // `/u` flag.\n // Note: replacing with the ASCII symbol `x` might cause false\n // negatives in unlikely scenarios. For example, `[\\u{61}-b]` is a\n // perfectly valid pattern that is equivalent to `[a-b]`, but it\n // would be replaced by `[x-b]` which throws an error.\n tmp = tmp.replace(/\\\\u\\{([0-9a-fA-F]+)\\}/g, ($0, $1) => {\n if (parseInt($1, 16) <= 0x10FFFF) {\n return 'x';\n }\n\n throwError({}, MessageInvalidRegExp);\n }).replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g, 'x');\n } // First, detect invalid regular expressions.\n\n\n try {\n new RegExp(tmp);\n } catch (e) {\n throwError({}, MessageInvalidRegExp);\n } // Return a regular expression object for this pattern-flag pair, or\n // `null` in case the current environment doesn't support the flags it\n // uses.\n\n\n try {\n return new RegExp(pattern, flags);\n } catch (exception) {\n return null;\n }\n}\n\nfunction scanRegExpBody() {\n var ch, str, classMarker, terminated, body;\n ch = source[index];\n assert(ch === '/', 'Regular expression literal must start with a slash');\n str = source[index++];\n classMarker = false;\n terminated = false;\n\n while (index < length) {\n ch = source[index++];\n str += ch;\n\n if (ch === '\\\\') {\n ch = source[index++]; // ECMA-262 7.8.5\n\n if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, MessageUnterminatedRegExp);\n }\n\n str += ch;\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, MessageUnterminatedRegExp);\n } else if (classMarker) {\n if (ch === ']') {\n classMarker = false;\n }\n } else {\n if (ch === '/') {\n terminated = true;\n break;\n } else if (ch === '[') {\n classMarker = true;\n }\n }\n }\n\n if (!terminated) {\n throwError({}, MessageUnterminatedRegExp);\n } // Exclude leading and trailing slash.\n\n\n body = str.substr(1, str.length - 2);\n return {\n value: body,\n literal: str\n };\n}\n\nfunction scanRegExpFlags() {\n var ch, str, flags;\n str = '';\n flags = '';\n\n while (index < length) {\n ch = source[index];\n\n if (!isIdentifierPart(ch.charCodeAt(0))) {\n break;\n }\n\n ++index;\n\n if (ch === '\\\\' && index < length) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } else {\n flags += ch;\n str += ch;\n }\n }\n\n if (flags.search(/[^gimuy]/g) >= 0) {\n throwError({}, MessageInvalidRegExp, flags);\n }\n\n return {\n value: flags,\n literal: str\n };\n}\n\nfunction scanRegExp() {\n var start, body, flags, value;\n lookahead = null;\n skipComment();\n start = index;\n body = scanRegExpBody();\n flags = scanRegExpFlags();\n value = testRegExp(body.value, flags.value);\n return {\n literal: body.literal + flags.literal,\n value: value,\n regex: {\n pattern: body.value,\n flags: flags.value\n },\n start: start,\n end: index\n };\n}\n\nfunction isIdentifierName(token) {\n return token.type === TokenIdentifier || token.type === TokenKeyword || token.type === TokenBooleanLiteral || token.type === TokenNullLiteral;\n}\n\nfunction advance() {\n skipComment();\n\n if (index >= length) {\n return {\n type: TokenEOF,\n start: index,\n end: index\n };\n }\n\n const ch = source.charCodeAt(index);\n\n if (isIdentifierStart(ch)) {\n return scanIdentifier();\n } // Very common: ( and ) and ;\n\n\n if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {\n return scanPunctuator();\n } // String literal starts with single quote (U+0027) or double quote (U+0022).\n\n\n if (ch === 0x27 || ch === 0x22) {\n return scanStringLiteral();\n } // Dot (.) U+002E can also start a floating-point number, hence the need\n // to check the next character.\n\n\n if (ch === 0x2E) {\n if (isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNumericLiteral();\n }\n\n return scanPunctuator();\n }\n\n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n\n return scanPunctuator();\n}\n\nfunction lex() {\n const token = lookahead;\n index = token.end;\n lookahead = advance();\n index = token.end;\n return token;\n}\n\nfunction peek() {\n const pos = index;\n lookahead = advance();\n index = pos;\n}\n\nfunction finishArrayExpression(elements) {\n const node = new ASTNode(SyntaxArrayExpression);\n node.elements = elements;\n return node;\n}\n\nfunction finishBinaryExpression(operator, left, right) {\n const node = new ASTNode(operator === '||' || operator === '&&' ? SyntaxLogicalExpression : SyntaxBinaryExpression);\n node.operator = operator;\n node.left = left;\n node.right = right;\n return node;\n}\n\nfunction finishCallExpression(callee, args) {\n const node = new ASTNode(SyntaxCallExpression);\n node.callee = callee;\n node.arguments = args;\n return node;\n}\n\nfunction finishConditionalExpression(test, consequent, alternate) {\n const node = new ASTNode(SyntaxConditionalExpression);\n node.test = test;\n node.consequent = consequent;\n node.alternate = alternate;\n return node;\n}\n\nfunction finishIdentifier(name) {\n const node = new ASTNode(SyntaxIdentifier);\n node.name = name;\n return node;\n}\n\nfunction finishLiteral(token) {\n const node = new ASTNode(SyntaxLiteral);\n node.value = token.value;\n node.raw = source.slice(token.start, token.end);\n\n if (token.regex) {\n if (node.raw === '//') {\n node.raw = '/(?:)/';\n }\n\n node.regex = token.regex;\n }\n\n return node;\n}\n\nfunction finishMemberExpression(accessor, object, property) {\n const node = new ASTNode(SyntaxMemberExpression);\n node.computed = accessor === '[';\n node.object = object;\n node.property = property;\n if (!node.computed) property.member = true;\n return node;\n}\n\nfunction finishObjectExpression(properties) {\n const node = new ASTNode(SyntaxObjectExpression);\n node.properties = properties;\n return node;\n}\n\nfunction finishProperty(kind, key, value) {\n const node = new ASTNode(SyntaxProperty);\n node.key = key;\n node.value = value;\n node.kind = kind;\n return node;\n}\n\nfunction finishUnaryExpression(operator, argument) {\n const node = new ASTNode(SyntaxUnaryExpression);\n node.operator = operator;\n node.argument = argument;\n node.prefix = true;\n return node;\n} // Throw an exception\n\n\nfunction throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(/%(\\d)/g, (whole, index) => {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n });\n error = new Error(msg);\n error.index = index;\n error.description = msg;\n throw error;\n} // Throw an exception because of the token.\n\n\nfunction throwUnexpected(token) {\n if (token.type === TokenEOF) {\n throwError(token, MessageUnexpectedEOS);\n }\n\n if (token.type === TokenNumericLiteral) {\n throwError(token, MessageUnexpectedNumber);\n }\n\n if (token.type === TokenStringLiteral) {\n throwError(token, MessageUnexpectedString);\n }\n\n if (token.type === TokenIdentifier) {\n throwError(token, MessageUnexpectedIdentifier);\n }\n\n if (token.type === TokenKeyword) {\n throwError(token, MessageUnexpectedReserved);\n } // BooleanLiteral, NullLiteral, or Punctuator.\n\n\n throwError(token, MessageUnexpectedToken, token.value);\n} // Expect the next token to match the specified punctuator.\n// If not, an exception will be thrown.\n\n\nfunction expect(value) {\n const token = lex();\n\n if (token.type !== TokenPunctuator || token.value !== value) {\n throwUnexpected(token);\n }\n} // Return true if the next token matches the specified punctuator.\n\n\nfunction match(value) {\n return lookahead.type === TokenPunctuator && lookahead.value === value;\n} // Return true if the next token matches the specified keyword\n\n\nfunction matchKeyword(keyword) {\n return lookahead.type === TokenKeyword && lookahead.value === keyword;\n} // 11.1.4 Array Initialiser\n\n\nfunction parseArrayInitialiser() {\n const elements = [];\n index = lookahead.start;\n expect('[');\n\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elements.push(parseConditionalExpression());\n\n if (!match(']')) {\n expect(',');\n }\n }\n }\n\n lex();\n return finishArrayExpression(elements);\n} // 11.1.5 Object Initialiser\n\n\nfunction parseObjectPropertyKey() {\n index = lookahead.start;\n const token = lex(); // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n\n if (token.type === TokenStringLiteral || token.type === TokenNumericLiteral) {\n if (token.octal) {\n throwError(token, MessageStrictOctalLiteral);\n }\n\n return finishLiteral(token);\n }\n\n return finishIdentifier(token.value);\n}\n\nfunction parseObjectProperty() {\n var token, key, id, value;\n index = lookahead.start;\n token = lookahead;\n\n if (token.type === TokenIdentifier) {\n id = parseObjectPropertyKey();\n expect(':');\n value = parseConditionalExpression();\n return finishProperty('init', id, value);\n }\n\n if (token.type === TokenEOF || token.type === TokenPunctuator) {\n throwUnexpected(token);\n } else {\n key = parseObjectPropertyKey();\n expect(':');\n value = parseConditionalExpression();\n return finishProperty('init', key, value);\n }\n}\n\nfunction parseObjectInitialiser() {\n var properties = [],\n property,\n name,\n key,\n map = {},\n toString = String;\n index = lookahead.start;\n expect('{');\n\n while (!match('}')) {\n property = parseObjectProperty();\n\n if (property.key.type === SyntaxIdentifier) {\n name = property.key.name;\n } else {\n name = toString(property.key.value);\n }\n\n key = '$' + name;\n\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n throwError({}, MessageStrictDuplicateProperty);\n } else {\n map[key] = true;\n }\n\n properties.push(property);\n\n if (!match('}')) {\n expect(',');\n }\n }\n\n expect('}');\n return finishObjectExpression(properties);\n} // 11.1.6 The Grouping Operator\n\n\nfunction parseGroupExpression() {\n expect('(');\n const expr = parseExpression();\n expect(')');\n return expr;\n} // 11.1 Primary Expressions\n\n\nconst legalKeywords = {\n 'if': 1\n};\n\nfunction parsePrimaryExpression() {\n var type, token, expr;\n\n if (match('(')) {\n return parseGroupExpression();\n }\n\n if (match('[')) {\n return parseArrayInitialiser();\n }\n\n if (match('{')) {\n return parseObjectInitialiser();\n }\n\n type = lookahead.type;\n index = lookahead.start;\n\n if (type === TokenIdentifier || legalKeywords[lookahead.value]) {\n expr = finishIdentifier(lex().value);\n } else if (type === TokenStringLiteral || type === TokenNumericLiteral) {\n if (lookahead.octal) {\n throwError(lookahead, MessageStrictOctalLiteral);\n }\n\n expr = finishLiteral(lex());\n } else if (type === TokenKeyword) {\n throw new Error(DISABLED);\n } else if (type === TokenBooleanLiteral) {\n token = lex();\n token.value = token.value === 'true';\n expr = finishLiteral(token);\n } else if (type === TokenNullLiteral) {\n token = lex();\n token.value = null;\n expr = finishLiteral(token);\n } else if (match('/') || match('/=')) {\n expr = finishLiteral(scanRegExp());\n peek();\n } else {\n throwUnexpected(lex());\n }\n\n return expr;\n} // 11.2 Left-Hand-Side Expressions\n\n\nfunction parseArguments() {\n const args = [];\n expect('(');\n\n if (!match(')')) {\n while (index < length) {\n args.push(parseConditionalExpression());\n\n if (match(')')) {\n break;\n }\n\n expect(',');\n }\n }\n\n expect(')');\n return args;\n}\n\nfunction parseNonComputedProperty() {\n index = lookahead.start;\n const token = lex();\n\n if (!isIdentifierName(token)) {\n throwUnexpected(token);\n }\n\n return finishIdentifier(token.value);\n}\n\nfunction parseNonComputedMember() {\n expect('.');\n return parseNonComputedProperty();\n}\n\nfunction parseComputedMember() {\n expect('[');\n const expr = parseExpression();\n expect(']');\n return expr;\n}\n\nfunction parseLeftHandSideExpressionAllowCall() {\n var expr, args, property;\n expr = parsePrimaryExpression();\n\n for (;;) {\n if (match('.')) {\n property = parseNonComputedMember();\n expr = finishMemberExpression('.', expr, property);\n } else if (match('(')) {\n args = parseArguments();\n expr = finishCallExpression(expr, args);\n } else if (match('[')) {\n property = parseComputedMember();\n expr = finishMemberExpression('[', expr, property);\n } else {\n break;\n }\n }\n\n return expr;\n} // 11.3 Postfix Expressions\n\n\nfunction parsePostfixExpression() {\n const expr = parseLeftHandSideExpressionAllowCall();\n\n if (lookahead.type === TokenPunctuator) {\n if (match('++') || match('--')) {\n throw new Error(DISABLED);\n }\n }\n\n return expr;\n} // 11.4 Unary Operators\n\n\nfunction parseUnaryExpression() {\n var token, expr;\n\n if (lookahead.type !== TokenPunctuator && lookahead.type !== TokenKeyword) {\n expr = parsePostfixExpression();\n } else if (match('++') || match('--')) {\n throw new Error(DISABLED);\n } else if (match('+') || match('-') || match('~') || match('!')) {\n token = lex();\n expr = parseUnaryExpression();\n expr = finishUnaryExpression(token.value, expr);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n throw new Error(DISABLED);\n } else {\n expr = parsePostfixExpression();\n }\n\n return expr;\n}\n\nfunction binaryPrecedence(token) {\n let prec = 0;\n\n if (token.type !== TokenPunctuator && token.type !== TokenKeyword) {\n return 0;\n }\n\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n\n case '&&':\n prec = 2;\n break;\n\n case '|':\n prec = 3;\n break;\n\n case '^':\n prec = 4;\n break;\n\n case '&':\n prec = 5;\n break;\n\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n case 'in':\n prec = 7;\n break;\n\n case '<<':\n case '>>':\n case '>>>':\n prec = 8;\n break;\n\n case '+':\n case '-':\n prec = 9;\n break;\n\n case '*':\n case '/':\n case '%':\n prec = 11;\n break;\n }\n\n return prec;\n} // 11.5 Multiplicative Operators\n// 11.6 Additive Operators\n// 11.7 Bitwise Shift Operators\n// 11.8 Relational Operators\n// 11.9 Equality Operators\n// 11.10 Binary Bitwise Operators\n// 11.11 Binary Logical Operators\n\n\nfunction parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n marker = lookahead;\n left = parseUnaryExpression();\n token = lookahead;\n prec = binaryPrecedence(token);\n\n if (prec === 0) {\n return left;\n }\n\n token.prec = prec;\n lex();\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead)) > 0) {\n // Reduce: make a binary expression from the three topmost entries.\n while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = finishBinaryExpression(operator, left, right);\n stack.push(expr);\n } // Shift.\n\n\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n } // Final reduce to clean-up the stack.\n\n\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n\n while (i > 1) {\n markers.pop();\n expr = finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n} // 11.12 Conditional Operator\n\n\nfunction parseConditionalExpression() {\n var expr, consequent, alternate;\n expr = parseBinaryExpression();\n\n if (match('?')) {\n lex();\n consequent = parseConditionalExpression();\n expect(':');\n alternate = parseConditionalExpression();\n expr = finishConditionalExpression(expr, consequent, alternate);\n }\n\n return expr;\n} // 11.14 Comma Operator\n\n\nfunction parseExpression() {\n const expr = parseConditionalExpression();\n\n if (match(',')) {\n throw new Error(DISABLED); // no sequence expressions\n }\n\n return expr;\n}\n\nfunction parser (code) {\n source = code;\n index = 0;\n length = source.length;\n lookahead = null;\n peek();\n const expr = parseExpression();\n\n if (lookahead.type !== TokenEOF) {\n throw new Error('Unexpect token after expression.');\n }\n\n return expr;\n}\n\nvar Constants = {\n NaN: 'NaN',\n E: 'Math.E',\n LN2: 'Math.LN2',\n LN10: 'Math.LN10',\n LOG2E: 'Math.LOG2E',\n LOG10E: 'Math.LOG10E',\n PI: 'Math.PI',\n SQRT1_2: 'Math.SQRT1_2',\n SQRT2: 'Math.SQRT2',\n MIN_VALUE: 'Number.MIN_VALUE',\n MAX_VALUE: 'Number.MAX_VALUE'\n};\n\nfunction Functions (codegen) {\n function fncall(name, args, cast, type) {\n let obj = codegen(args[0]);\n\n if (cast) {\n obj = cast + '(' + obj + ')';\n if (cast.lastIndexOf('new ', 0) === 0) obj = '(' + obj + ')';\n }\n\n return obj + '.' + name + (type < 0 ? '' : type === 0 ? '()' : '(' + args.slice(1).map(codegen).join(',') + ')');\n }\n\n function fn(name, cast, type) {\n return args => fncall(name, args, cast, type);\n }\n\n const DATE = 'new Date',\n STRING = 'String',\n REGEXP = 'RegExp';\n return {\n // MATH functions\n isNaN: 'Number.isNaN',\n isFinite: 'Number.isFinite',\n abs: 'Math.abs',\n acos: 'Math.acos',\n asin: 'Math.asin',\n atan: 'Math.atan',\n atan2: 'Math.atan2',\n ceil: 'Math.ceil',\n cos: 'Math.cos',\n exp: 'Math.exp',\n floor: 'Math.floor',\n log: 'Math.log',\n max: 'Math.max',\n min: 'Math.min',\n pow: 'Math.pow',\n random: 'Math.random',\n round: 'Math.round',\n sin: 'Math.sin',\n sqrt: 'Math.sqrt',\n tan: 'Math.tan',\n clamp: function (args) {\n if (args.length < 3) error('Missing arguments to clamp function.');\n if (args.length > 3) error('Too many arguments to clamp function.');\n const a = args.map(codegen);\n return 'Math.max(' + a[1] + ', Math.min(' + a[2] + ',' + a[0] + '))';\n },\n // DATE functions\n now: 'Date.now',\n utc: 'Date.UTC',\n datetime: DATE,\n date: fn('getDate', DATE, 0),\n day: fn('getDay', DATE, 0),\n year: fn('getFullYear', DATE, 0),\n month: fn('getMonth', DATE, 0),\n hours: fn('getHours', DATE, 0),\n minutes: fn('getMinutes', DATE, 0),\n seconds: fn('getSeconds', DATE, 0),\n milliseconds: fn('getMilliseconds', DATE, 0),\n time: fn('getTime', DATE, 0),\n timezoneoffset: fn('getTimezoneOffset', DATE, 0),\n utcdate: fn('getUTCDate', DATE, 0),\n utcday: fn('getUTCDay', DATE, 0),\n utcyear: fn('getUTCFullYear', DATE, 0),\n utcmonth: fn('getUTCMonth', DATE, 0),\n utchours: fn('getUTCHours', DATE, 0),\n utcminutes: fn('getUTCMinutes', DATE, 0),\n utcseconds: fn('getUTCSeconds', DATE, 0),\n utcmilliseconds: fn('getUTCMilliseconds', DATE, 0),\n // sequence functions\n length: fn('length', null, -1),\n join: fn('join', null),\n indexof: fn('indexOf', null),\n lastindexof: fn('lastIndexOf', null),\n slice: fn('slice', null),\n reverse: function (args) {\n return '(' + codegen(args[0]) + ').slice().reverse()';\n },\n // STRING functions\n parseFloat: 'parseFloat',\n parseInt: 'parseInt',\n upper: fn('toUpperCase', STRING, 0),\n lower: fn('toLowerCase', STRING, 0),\n substring: fn('substring', STRING),\n split: fn('split', STRING),\n replace: fn('replace', STRING),\n trim: fn('trim', STRING, 0),\n // REGEXP functions\n regexp: REGEXP,\n test: fn('test', REGEXP),\n // Control Flow functions\n if: function (args) {\n if (args.length < 3) error('Missing arguments to if function.');\n if (args.length > 3) error('Too many arguments to if function.');\n const a = args.map(codegen);\n return '(' + a[0] + '?' + a[1] + ':' + a[2] + ')';\n }\n };\n}\n\nfunction stripQuotes(s) {\n const n = s && s.length - 1;\n return n && (s[0] === '\"' && s[n] === '\"' || s[0] === '\\'' && s[n] === '\\'') ? s.slice(1, -1) : s;\n}\n\nfunction codegen (opt) {\n opt = opt || {};\n const allowed = opt.allowed ? toSet(opt.allowed) : {},\n forbidden = opt.forbidden ? toSet(opt.forbidden) : {},\n constants = opt.constants || Constants,\n functions = (opt.functions || Functions)(visit),\n globalvar = opt.globalvar,\n fieldvar = opt.fieldvar,\n outputGlobal = isFunction(globalvar) ? globalvar : id => \"\".concat(globalvar, \"[\\\"\").concat(id, \"\\\"]\");\n let globals = {},\n fields = {},\n memberDepth = 0;\n\n function visit(ast) {\n if (isString(ast)) return ast;\n const generator = Generators[ast.type];\n if (generator == null) error('Unsupported type: ' + ast.type);\n return generator(ast);\n }\n\n const Generators = {\n Literal: n => n.raw,\n Identifier: n => {\n const id = n.name;\n\n if (memberDepth > 0) {\n return id;\n } else if (hasOwnProperty(forbidden, id)) {\n return error('Illegal identifier: ' + id);\n } else if (hasOwnProperty(constants, id)) {\n return constants[id];\n } else if (hasOwnProperty(allowed, id)) {\n return id;\n } else {\n globals[id] = 1;\n return outputGlobal(id);\n }\n },\n MemberExpression: n => {\n const d = !n.computed,\n o = visit(n.object);\n if (d) memberDepth += 1;\n const p = visit(n.property);\n\n if (o === fieldvar) {\n // strip quotes to sanitize field name (#1653)\n fields[stripQuotes(p)] = 1;\n }\n\n if (d) memberDepth -= 1;\n return o + (d ? '.' + p : '[' + p + ']');\n },\n CallExpression: n => {\n if (n.callee.type !== 'Identifier') {\n error('Illegal callee type: ' + n.callee.type);\n }\n\n const callee = n.callee.name,\n args = n.arguments,\n fn = hasOwnProperty(functions, callee) && functions[callee];\n if (!fn) error('Unrecognized function: ' + callee);\n return isFunction(fn) ? fn(args) : fn + '(' + args.map(visit).join(',') + ')';\n },\n ArrayExpression: n => '[' + n.elements.map(visit).join(',') + ']',\n BinaryExpression: n => '(' + visit(n.left) + ' ' + n.operator + ' ' + visit(n.right) + ')',\n UnaryExpression: n => '(' + n.operator + visit(n.argument) + ')',\n ConditionalExpression: n => '(' + visit(n.test) + '?' + visit(n.consequent) + ':' + visit(n.alternate) + ')',\n LogicalExpression: n => '(' + visit(n.left) + n.operator + visit(n.right) + ')',\n ObjectExpression: n => '{' + n.properties.map(visit).join(',') + '}',\n Property: n => {\n memberDepth += 1;\n const k = visit(n.key);\n memberDepth -= 1;\n return k + ':' + visit(n.value);\n }\n };\n\n function codegen(ast) {\n const result = {\n code: visit(ast),\n globals: Object.keys(globals),\n fields: Object.keys(fields)\n };\n globals = {};\n fields = {};\n return result;\n }\n\n codegen.functions = functions;\n codegen.constants = constants;\n return codegen;\n}\n\nexport { ASTNode, ArrayExpression, BinaryExpression, CallExpression, ConditionalExpression, Identifier, Literal, LogicalExpression, MemberExpression, ObjectExpression, Property, RawCode, UnaryExpression, codegen, Constants as constants, Functions as functions, parser as parse };\n","import { parse } from 'vega-expression';\nfunction getName(node) {\n const name = [];\n if (node.type === 'Identifier') {\n return [node.name];\n }\n if (node.type === 'Literal') {\n return [node.value];\n }\n if (node.type === 'MemberExpression') {\n name.push(...getName(node.object));\n name.push(...getName(node.property));\n }\n return name;\n}\nfunction startsWithDatum(node) {\n if (node.object.type === 'MemberExpression') {\n return startsWithDatum(node.object);\n }\n return node.object.name === 'datum';\n}\nexport function getDependentFields(expression) {\n const ast = parse(expression);\n const dependents = new Set();\n ast.visit((node) => {\n if (node.type === 'MemberExpression' && startsWithDatum(node)) {\n dependents.add(getName(node).slice(1).join('.'));\n }\n });\n return dependents;\n}\n//# sourceMappingURL=expressions.js.map","import { duplicate } from '../../util';\nimport { expression } from '../predicate';\nimport { DataFlowNode } from './dataflow';\nimport { getDependentFields } from './expressions';\nexport class FilterNode extends DataFlowNode {\n constructor(parent, model, filter) {\n super(parent);\n this.model = model;\n this.filter = filter;\n // TODO: refactor this to not take a node and\n // then add a static function makeFromOperand and make the constructor take only an expression\n this.expr = expression(this.model, this.filter, this);\n this._dependentFields = getDependentFields(this.expr);\n }\n clone() {\n return new FilterNode(null, this.model, duplicate(this.filter));\n }\n dependentFields() {\n return this._dependentFields;\n }\n producedFields() {\n return new Set(); // filter does not produce any new fields\n }\n assemble() {\n return {\n type: 'filter',\n expr: this.expr\n };\n }\n hash() {\n return `Filter ${this.expr}`;\n }\n}\n//# sourceMappingURL=filter.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { selector as parseSelector } from 'vega-event-selector';\nimport { isString, stringValue } from 'vega-util';\nimport { forEachSelection, STORE } from '.';\nimport { warn } from '../../log';\nimport { duplicate, keys, logicalExpr, varName } from '../../util';\nimport { OutputNode } from '../data/dataflow';\nimport { FilterNode } from '../data/filter';\nimport { forEachTransform } from './transforms/transforms';\nimport { DataSourceType } from '../../data';\nexport function parseUnitSelection(model, selDefs) {\n var _a;\n const selCmpts = {};\n const selectionConfig = model.config.selection;\n for (const name of keys(selDefs !== null && selDefs !== void 0 ? selDefs : {})) {\n const selDef = duplicate(selDefs[name]);\n const _b = selectionConfig[selDef.type], { fields, encodings } = _b, cfg = __rest(_b, [\"fields\", \"encodings\"]); // Project transform applies its defaults.\n // Set default values from config if a property hasn't been specified,\n // or if it is true. E.g., \"translate\": true should use the default\n // event handlers for translate. However, true may be a valid value for\n // a property (e.g., \"nearest\": true).\n for (const key in cfg) {\n // A selection should contain either `encodings` or `fields`, only use\n // default values for these two values if neither of them is specified.\n if ((key === 'encodings' && selDef.fields) || (key === 'fields' && selDef.encodings)) {\n continue;\n }\n if (key === 'mark') {\n selDef[key] = Object.assign(Object.assign({}, cfg[key]), selDef[key]);\n }\n if (selDef[key] === undefined || selDef[key] === true) {\n selDef[key] = (_a = cfg[key]) !== null && _a !== void 0 ? _a : selDef[key];\n }\n }\n const safeName = varName(name);\n const selCmpt = (selCmpts[safeName] = Object.assign(Object.assign({}, selDef), { name: safeName, events: isString(selDef.on) ? parseSelector(selDef.on, 'scope') : duplicate(selDef.on) }));\n forEachTransform(selCmpt, txCompiler => {\n if (txCompiler.has(selCmpt) && txCompiler.parse) {\n txCompiler.parse(model, selCmpt, selDef, selDefs[name]);\n }\n });\n }\n return selCmpts;\n}\nexport function parseSelectionPredicate(model, selections, dfnode, datum = 'datum') {\n const stores = [];\n function expr(name) {\n const vname = varName(name);\n const selCmpt = model.getSelectionComponent(vname, name);\n const store = stringValue(vname + STORE);\n if (selCmpt.project.timeUnit) {\n const child = dfnode !== null && dfnode !== void 0 ? dfnode : model.component.data.raw;\n const tunode = selCmpt.project.timeUnit.clone();\n if (child.parent) {\n tunode.insertAsParentOf(child);\n }\n else {\n child.parent = tunode;\n }\n }\n if (selCmpt.empty !== 'none') {\n stores.push(store);\n }\n return (`vlSelectionTest(${store}, ${datum}` + (selCmpt.resolve === 'global' ? ')' : `, ${stringValue(selCmpt.resolve)})`));\n }\n const predicateStr = logicalExpr(selections, expr);\n return ((stores.length ? '!(' + stores.map(s => `length(data(${s}))`).join(' || ') + ') || ' : '') + `(${predicateStr})`);\n}\nexport function parseSelectionBinExtent(selCmpt, extent) {\n const encoding = extent['encoding'];\n let field = extent['field'];\n if (!encoding && !field) {\n field = selCmpt.project.items[0].field;\n if (selCmpt.project.items.length > 1) {\n warn('A \"field\" or \"encoding\" must be specified when using a selection as a scale domain. ' +\n `Using \"field\": ${stringValue(field)}.`);\n }\n }\n else if (encoding && !field) {\n const encodings = selCmpt.project.items.filter(p => p.channel === encoding);\n if (!encodings.length || encodings.length > 1) {\n field = selCmpt.project.items[0].field;\n warn((!encodings.length ? 'No ' : 'Multiple ') +\n `matching ${stringValue(encoding)} encoding found for selection ${stringValue(extent.selection)}. ` +\n `Using \"field\": ${stringValue(field)}.`);\n }\n else {\n field = encodings[0].field;\n }\n }\n return `${selCmpt.name}[${stringValue(field)}]`;\n}\nexport function materializeSelections(model, main) {\n forEachSelection(model, selCmpt => {\n const selection = selCmpt.name;\n const lookupName = model.getName(`lookup_${selection}`);\n model.component.data.outputNodes[lookupName] = selCmpt.materialized = new OutputNode(new FilterNode(main, model, { selection }), lookupName, DataSourceType.Lookup, model.component.data.outputNodeRefCounts);\n });\n}\n//# sourceMappingURL=parse.js.map","import { isString } from 'vega-util';\nimport { fieldFilterExpression, isSelectionPredicate } from '../predicate';\nimport { logicalExpr } from '../util';\nimport { parseSelectionPredicate } from './selection/parse';\n/**\n * Converts a predicate into an expression.\n */\n// model is only used for selection filters.\nexport function expression(model, filterOp, node) {\n return logicalExpr(filterOp, (predicate) => {\n if (isString(predicate)) {\n return predicate;\n }\n else if (isSelectionPredicate(predicate)) {\n return parseSelectionPredicate(model, predicate.selection, node);\n }\n else {\n // Filter Object\n return fieldFilterExpression(predicate);\n }\n });\n}\n//# sourceMappingURL=predicate.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { array, isArray } from 'vega-util';\nimport { AXIS_PARTS, AXIS_PROPERTY_TYPE, CONDITIONAL_AXIS_PROP_INDEX, isConditionalAxisValue } from '../../axis';\nimport { POSITION_SCALE_CHANNELS } from '../../channel';\nimport { defaultTitle } from '../../channeldef';\nimport { isText } from '../../title';\nimport { getFirstDefined, isEmpty, replaceAll } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { exprFromValueOrSignalRef } from '../common';\nimport { expression } from '../predicate';\nfunction assembleTitle(title, config) {\n if (!title) {\n return undefined;\n }\n if (isArray(title) && !isText(title)) {\n return title.map(fieldDef => defaultTitle(fieldDef, config)).join(', ');\n }\n return title;\n}\nfunction setAxisEncode(axis, part, vgProp, vgRef) {\n var _a, _b, _c;\n axis.encode = (_a = axis.encode) !== null && _a !== void 0 ? _a : {};\n axis.encode[part] = (_b = axis.encode[part]) !== null && _b !== void 0 ? _b : {};\n axis.encode[part].update = (_c = axis.encode[part].update) !== null && _c !== void 0 ? _c : {};\n // TODO: remove as any after https://github.com/prisma/nexus-prisma/issues/291\n axis.encode[part].update[vgProp] = vgRef;\n}\nexport function assembleAxis(axisCmpt, kind, config, opt = { header: false }) {\n var _a, _b;\n const _c = axisCmpt.combine(), { disable, orient, scale, labelExpr, title, zindex } = _c, axis = __rest(_c, [\"disable\", \"orient\", \"scale\", \"labelExpr\", \"title\", \"zindex\"]);\n if (disable) {\n return undefined;\n }\n for (const prop in axis) {\n const propType = AXIS_PROPERTY_TYPE[prop];\n const propValue = axis[prop];\n if (propType && propType !== kind && propType !== 'both') {\n // Remove properties that are not valid for this kind of axis\n delete axis[prop];\n }\n else if (isConditionalAxisValue(propValue)) {\n // deal with conditional axis value\n const { condition } = propValue, valueOrSignalRef = __rest(propValue, [\"condition\"]);\n const conditions = array(condition);\n const propIndex = CONDITIONAL_AXIS_PROP_INDEX[prop];\n if (propIndex) {\n const { vgProp, part } = propIndex;\n // If there is a corresponding Vega property for the channel,\n // use Vega's custom axis encoding and delete the original axis property to avoid conflicts\n const vgRef = [\n ...conditions.map(c => {\n const { test } = c, valueOrSignalCRef = __rest(c, [\"test\"]);\n return Object.assign({ test: expression(null, test) }, valueOrSignalCRef);\n }),\n valueOrSignalRef\n ];\n setAxisEncode(axis, part, vgProp, vgRef);\n delete axis[prop];\n }\n else if (propIndex === null) {\n // If propIndex is null, this means we support conditional axis property by converting the condition to signal instead.\n const signalRef = {\n signal: conditions\n .map(c => {\n const { test } = c, valueOrSignalCRef = __rest(c, [\"test\"]);\n return `${expression(null, test)} ? ${exprFromValueOrSignalRef(valueOrSignalCRef)} : `;\n })\n .join('') + exprFromValueOrSignalRef(valueOrSignalRef)\n };\n axis[prop] = signalRef;\n }\n }\n else if (isSignalRef(propValue)) {\n const propIndex = CONDITIONAL_AXIS_PROP_INDEX[prop];\n if (propIndex) {\n const { vgProp, part } = propIndex;\n setAxisEncode(axis, part, vgProp, propValue);\n delete axis[prop];\n } // else do nothing since the property already supports signal\n }\n }\n if (kind === 'grid') {\n if (!axis.grid) {\n return undefined;\n }\n // Remove unnecessary encode block\n if (axis.encode) {\n // Only need to keep encode block for grid\n const { grid } = axis.encode;\n axis.encode = Object.assign({}, (grid ? { grid } : {}));\n if (isEmpty(axis.encode)) {\n delete axis.encode;\n }\n }\n return Object.assign(Object.assign({ scale,\n orient }, axis), { domain: false, labels: false, aria: false, \n // Always set min/maxExtent to 0 to ensure that `config.axis*.minExtent` and `config.axis*.maxExtent`\n // would not affect gridAxis\n maxExtent: 0, minExtent: 0, ticks: false, zindex: getFirstDefined(zindex, 0) // put grid behind marks by default\n });\n }\n else {\n // kind === 'main'\n if (!opt.header && axisCmpt.mainExtracted) {\n // if mainExtracted has been extracted to a separate facet\n return undefined;\n }\n if (labelExpr !== undefined) {\n let expr = labelExpr;\n if (((_b = (_a = axis.encode) === null || _a === void 0 ? void 0 : _a.labels) === null || _b === void 0 ? void 0 : _b.update) && isSignalRef(axis.encode.labels.update.text)) {\n expr = replaceAll(labelExpr, 'datum.label', axis.encode.labels.update.text.signal);\n }\n setAxisEncode(axis, 'labels', 'text', { signal: expr });\n }\n if (axis.labelAlign === null) {\n delete axis.labelAlign;\n }\n // Remove unnecessary encode block\n if (axis.encode) {\n for (const part of AXIS_PARTS) {\n if (!axisCmpt.hasAxisPart(part)) {\n delete axis.encode[part];\n }\n }\n if (isEmpty(axis.encode)) {\n delete axis.encode;\n }\n }\n const titleString = assembleTitle(title, config);\n return Object.assign(Object.assign(Object.assign(Object.assign({ scale,\n orient, grid: false }, (titleString ? { title: titleString } : {})), axis), (config.aria === false ? { aria: false } : {})), { zindex: getFirstDefined(zindex, 0) // put axis line above marks by default\n });\n }\n}\n/**\n * Add axis signals so grid line works correctly\n * (Fix https://github.com/vega/vega-lite/issues/4226)\n */\nexport function assembleAxisSignals(model) {\n const { axes } = model.component;\n const signals = [];\n for (const channel of POSITION_SCALE_CHANNELS) {\n if (axes[channel]) {\n for (const axis of axes[channel]) {\n if (!axis.get('disable') && !axis.get('gridScale')) {\n // If there is x-axis but no y-scale for gridScale, need to set height/width so x-axis can draw the grid with the right height. Same for y-axis and width.\n const sizeType = channel === 'x' ? 'height' : 'width';\n const update = model.getSizeSignalRef(sizeType).signal;\n if (sizeType !== update) {\n signals.push({\n name: sizeType,\n update: update\n });\n }\n }\n }\n }\n }\n return signals;\n}\nexport function assembleAxes(axisComponents, config) {\n const { x = [], y = [] } = axisComponents;\n return [\n ...x.map(a => assembleAxis(a, 'grid', config)),\n ...y.map(a => assembleAxis(a, 'grid', config)),\n ...x.map(a => assembleAxis(a, 'main', config)),\n ...y.map(a => assembleAxis(a, 'main', config))\n ].filter(a => a); // filter undefined\n}\n//# sourceMappingURL=assemble.js.map","import { array } from 'vega-util';\nimport { isQuantitative } from '../../scale';\nimport { keys, titleCase } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { getStyleConfig, signalOrStringValue } from '../common';\nfunction getAxisConfigFromConfigTypes(configTypes, config, channel, orient) {\n // TODO: add special casing to add conditional value based on orient signal\n return Object.assign.apply(null, [\n {},\n ...configTypes.map(configType => {\n if (configType === 'axisOrient') {\n const orient1 = channel === 'x' ? 'bottom' : 'left';\n const orientConfig1 = config[channel === 'x' ? 'axisBottom' : 'axisLeft'] || {};\n const orientConfig2 = config[channel === 'x' ? 'axisTop' : 'axisRight'] || {};\n const props = new Set([...keys(orientConfig1), ...keys(orientConfig2)]);\n const conditionalOrientAxisConfig = {};\n for (const prop of props.values()) {\n conditionalOrientAxisConfig[prop] = {\n // orient is surely signal in this case\n signal: `${orient['signal']} === \"${orient1}\" ? ${signalOrStringValue(orientConfig1[prop])} : ${signalOrStringValue(orientConfig2[prop])}`\n };\n }\n return conditionalOrientAxisConfig;\n }\n return config[configType];\n })\n ]);\n}\nexport function getAxisConfigs(channel, scaleType, orient, config) {\n const typeBasedConfigTypes = scaleType === 'band'\n ? ['axisDiscrete', 'axisBand']\n : scaleType === 'point'\n ? ['axisDiscrete', 'axisPoint']\n : isQuantitative(scaleType)\n ? ['axisQuantitative']\n : scaleType === 'time' || scaleType === 'utc'\n ? ['axisTemporal']\n : [];\n const axisChannel = channel === 'x' ? 'axisX' : 'axisY';\n const axisOrient = isSignalRef(orient) ? 'axisOrient' : 'axis' + titleCase(orient); // axisTop, axisBottom, ...\n const vlOnlyConfigTypes = [\n // technically Vega does have axisBand, but if we make another separation here,\n // it will further introduce complexity in the code\n ...typeBasedConfigTypes,\n ...typeBasedConfigTypes.map(c => axisChannel + c.substr(4))\n ];\n const vgConfigTypes = ['axis', axisOrient, axisChannel];\n return {\n vlOnlyAxisConfig: getAxisConfigFromConfigTypes(vlOnlyConfigTypes, config, channel, orient),\n vgAxisConfig: getAxisConfigFromConfigTypes(vgConfigTypes, config, channel, orient),\n axisConfigStyle: getAxisConfigStyle([...vgConfigTypes, ...vlOnlyConfigTypes], config)\n };\n}\nexport function getAxisConfigStyle(axisConfigTypes, config) {\n var _a;\n const toMerge = [{}];\n for (const configType of axisConfigTypes) {\n // TODO: add special casing to add conditional value based on orient signal\n let style = (_a = config[configType]) === null || _a === void 0 ? void 0 : _a.style;\n if (style) {\n style = array(style);\n for (const s of style) {\n toMerge.push(config.style[s]);\n }\n }\n }\n return Object.assign.apply(null, toMerge);\n}\nexport function getAxisConfig(property, styleConfigIndex, style, axisConfigs = {}) {\n var _a;\n const styleConfig = getStyleConfig(property, style, styleConfigIndex);\n if (styleConfig !== undefined) {\n return {\n configFrom: 'style',\n configValue: styleConfig\n };\n }\n for (const configFrom of ['vlOnlyAxisConfig', 'vgAxisConfig', 'axisConfigStyle']) {\n if (((_a = axisConfigs[configFrom]) === null || _a === void 0 ? void 0 : _a[property]) !== undefined) {\n return { configFrom, configValue: axisConfigs[configFrom][property] };\n }\n }\n return {};\n}\n//# sourceMappingURL=config.js.map","import { isArray, isObject } from 'vega-util';\nimport { isBinned, isBinning } from '../../bin';\nimport { X } from '../../channel';\nimport { isDiscrete, isFieldDef, toFieldDefBase, valueArray } from '../../channeldef';\nimport { hasDiscreteDomain } from '../../scale';\nimport { normalizeTimeUnit } from '../../timeunit';\nimport { NOMINAL, ORDINAL } from '../../type';\nimport { contains, normalizeAngle } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { mergeTitle, mergeTitleFieldDefs } from '../common';\nimport { guideFormat, guideFormatType } from '../format';\nimport { getAxisConfig } from './config';\nexport const axisRules = {\n scale: ({ model, channel }) => model.scaleName(channel),\n format: ({ fieldOrDatumDef, config, axis }) => {\n const { format, formatType } = axis;\n return guideFormat(fieldOrDatumDef, fieldOrDatumDef.type, format, formatType, config, true);\n },\n formatType: ({ axis, fieldOrDatumDef, scaleType }) => {\n const { formatType } = axis;\n return guideFormatType(formatType, fieldOrDatumDef, scaleType);\n },\n grid: ({ fieldOrDatumDef, axis, scaleType }) => {\n var _a;\n if (isFieldDef(fieldOrDatumDef) && isBinned(fieldOrDatumDef.bin)) {\n return false;\n }\n else {\n return (_a = axis.grid) !== null && _a !== void 0 ? _a : defaultGrid(scaleType, fieldOrDatumDef);\n }\n },\n gridScale: ({ model, channel }) => gridScale(model, channel),\n labelAlign: ({ axis, labelAngle, orient, channel }) => axis.labelAlign || defaultLabelAlign(labelAngle, orient, channel),\n labelAngle: ({ labelAngle }) => labelAngle,\n labelBaseline: ({ axis, labelAngle, orient, channel }) => axis.labelBaseline || defaultLabelBaseline(labelAngle, orient, channel),\n labelFlush: ({ axis, fieldOrDatumDef, channel }) => { var _a; return (_a = axis.labelFlush) !== null && _a !== void 0 ? _a : defaultLabelFlush(fieldOrDatumDef.type, channel); },\n labelOverlap: ({ axis, fieldOrDatumDef, scaleType }) => { var _a; return (_a = axis.labelOverlap) !== null && _a !== void 0 ? _a : defaultLabelOverlap(fieldOrDatumDef.type, scaleType, isFieldDef(fieldOrDatumDef) && !!fieldOrDatumDef.timeUnit, isFieldDef(fieldOrDatumDef) ? fieldOrDatumDef.sort : undefined); },\n // we already calculate orient in parse\n orient: ({ orient }) => orient,\n tickCount: ({ channel, model, axis, fieldOrDatumDef, scaleType }) => {\n var _a;\n const sizeType = channel === 'x' ? 'width' : channel === 'y' ? 'height' : undefined;\n const size = sizeType ? model.getSizeSignalRef(sizeType) : undefined;\n return (_a = axis.tickCount) !== null && _a !== void 0 ? _a : defaultTickCount({ fieldOrDatumDef, scaleType, size, values: axis.values });\n },\n title: ({ axis, model, channel }) => {\n if (axis.title !== undefined) {\n return axis.title;\n }\n const fieldDefTitle = getFieldDefTitle(model, channel);\n if (fieldDefTitle !== undefined) {\n return fieldDefTitle;\n }\n const fieldDef = model.typedFieldDef(channel);\n const channel2 = channel === 'x' ? 'x2' : 'y2';\n const fieldDef2 = model.fieldDef(channel2);\n // If title not specified, store base parts of fieldDef (and fieldDef2 if exists)\n return mergeTitleFieldDefs(fieldDef ? [toFieldDefBase(fieldDef)] : [], isFieldDef(fieldDef2) ? [toFieldDefBase(fieldDef2)] : []);\n },\n values: ({ axis, fieldOrDatumDef }) => values(axis, fieldOrDatumDef),\n zindex: ({ axis, fieldOrDatumDef, mark }) => { var _a; return (_a = axis.zindex) !== null && _a !== void 0 ? _a : defaultZindex(mark, fieldOrDatumDef); }\n};\n// TODO: we need to refactor this method after we take care of config refactoring\n/**\n * Default rules for whether to show a grid should be shown for a channel.\n * If `grid` is unspecified, the default value is `true` for ordinal scales that are not binned\n */\nexport function defaultGrid(scaleType, fieldDef) {\n return !hasDiscreteDomain(scaleType) && isFieldDef(fieldDef) && !isBinning(fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.bin);\n}\nexport function gridScale(model, channel) {\n const gridChannel = channel === 'x' ? 'y' : 'x';\n if (model.getScaleComponent(gridChannel)) {\n return model.scaleName(gridChannel);\n }\n return undefined;\n}\nexport function getLabelAngle(fieldOrDatumDef, axis, channel, styleConfig, axisConfigs) {\n const labelAngle = axis === null || axis === void 0 ? void 0 : axis.labelAngle;\n // try axis value\n if (labelAngle !== undefined) {\n return isSignalRef(labelAngle) ? labelAngle : normalizeAngle(labelAngle);\n }\n else {\n // try axis config value\n const { configValue: angle } = getAxisConfig('labelAngle', styleConfig, axis === null || axis === void 0 ? void 0 : axis.style, axisConfigs);\n if (angle !== undefined) {\n return normalizeAngle(angle);\n }\n else {\n // get default value\n if (channel === X &&\n contains([NOMINAL, ORDINAL], fieldOrDatumDef.type) &&\n !(isFieldDef(fieldOrDatumDef) && fieldOrDatumDef.timeUnit)) {\n return 270;\n }\n // no default\n return undefined;\n }\n }\n}\nexport function normalizeAngleExpr(angle) {\n return `(((${angle.signal} % 360) + 360) % 360)`;\n}\nexport function defaultLabelBaseline(angle, orient, channel, alwaysIncludeMiddle) {\n if (angle !== undefined) {\n if (channel === 'x') {\n if (isSignalRef(angle)) {\n const a = normalizeAngleExpr(angle);\n const orientIsTop = isSignalRef(orient) ? `(${orient.signal} === \"top\")` : orient === 'top';\n return {\n signal: `(45 < ${a} && ${a} < 135) || (225 < ${a} && ${a} < 315) ? \"middle\" :` +\n `(${a} <= 45 || 315 <= ${a}) === ${orientIsTop} ? \"bottom\" : \"top\"`\n };\n }\n if ((45 < angle && angle < 135) || (225 < angle && angle < 315)) {\n return 'middle';\n }\n if (isSignalRef(orient)) {\n const op = angle <= 45 || 315 <= angle ? '===' : '!==';\n return { signal: `${orient.signal} ${op} \"top\" ? \"bottom\" : \"top\"` };\n }\n return (angle <= 45 || 315 <= angle) === (orient === 'top') ? 'bottom' : 'top';\n }\n else {\n if (isSignalRef(angle)) {\n const a = normalizeAngleExpr(angle);\n const orientIsLeft = isSignalRef(orient) ? `(${orient.signal} === \"left\")` : orient === 'left';\n const middle = alwaysIncludeMiddle ? '\"middle\"' : 'null';\n return {\n signal: `${a} <= 45 || 315 <= ${a} || (135 <= ${a} && ${a} <= 225) ? ${middle} : (45 <= ${a} && ${a} <= 135) === ${orientIsLeft} ? \"top\" : \"bottom\"`\n };\n }\n if (angle <= 45 || 315 <= angle || (135 <= angle && angle <= 225)) {\n return alwaysIncludeMiddle ? 'middle' : null;\n }\n if (isSignalRef(orient)) {\n const op = 45 <= angle && angle <= 135 ? '===' : '!==';\n return { signal: `${orient.signal} ${op} \"left\" ? \"top\" : \"bottom\"` };\n }\n return (45 <= angle && angle <= 135) === (orient === 'left') ? 'top' : 'bottom';\n }\n }\n return undefined;\n}\nexport function defaultLabelAlign(angle, orient, channel) {\n if (angle === undefined) {\n return undefined;\n }\n const isX = channel === 'x';\n const startAngle = isX ? 0 : 90;\n const mainOrient = isX ? 'bottom' : 'left';\n if (isSignalRef(angle)) {\n const a = normalizeAngleExpr(angle);\n const orientIsMain = isSignalRef(orient) ? `(${orient.signal} === \"${mainOrient}\")` : orient === mainOrient;\n return {\n signal: `(${startAngle ? '(' + a + ' + 90)' : a} % 180 === 0) ? ${isX ? null : '\"center\"'} :` +\n `(${startAngle} < ${a} && ${a} < ${180 + startAngle}) === ${orientIsMain} ? \"left\" : \"right\"`\n };\n }\n if ((angle + startAngle) % 180 === 0) {\n // For bottom, use default label align so label flush still works\n return isX ? null : 'center';\n }\n if (isSignalRef(orient)) {\n const op = startAngle < angle && angle < 180 + startAngle ? '===' : '!==';\n const orientIsMain = `${orient.signal} ${op} \"${mainOrient}\"`;\n return {\n signal: `${orientIsMain} ? \"left\" : \"right\"`\n };\n }\n if ((startAngle < angle && angle < 180 + startAngle) === (orient === mainOrient)) {\n return 'left';\n }\n return 'right';\n}\nexport function defaultLabelFlush(type, channel) {\n if (channel === 'x' && contains(['quantitative', 'temporal'], type)) {\n return true;\n }\n return undefined;\n}\nexport function defaultLabelOverlap(type, scaleType, hasTimeUnit, sort) {\n // do not prevent overlap for nominal data because there is no way to infer what the missing labels are\n if ((hasTimeUnit && !isObject(sort)) || (type !== 'nominal' && type !== 'ordinal')) {\n if (scaleType === 'log' || scaleType === 'symlog') {\n return 'greedy';\n }\n return true;\n }\n return undefined;\n}\nexport function defaultOrient(channel) {\n return channel === 'x' ? 'bottom' : 'left';\n}\nexport function defaultTickCount({ fieldOrDatumDef, scaleType, size, values: vals }) {\n var _a;\n if (!vals && !hasDiscreteDomain(scaleType) && scaleType !== 'log') {\n if (isFieldDef(fieldOrDatumDef)) {\n if (isBinning(fieldOrDatumDef.bin)) {\n // for binned data, we don't want more ticks than maxbins\n return { signal: `ceil(${size.signal}/10)` };\n }\n if (fieldOrDatumDef.timeUnit &&\n contains(['month', 'hours', 'day', 'quarter'], (_a = normalizeTimeUnit(fieldOrDatumDef.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit)) {\n return undefined;\n }\n }\n return { signal: `ceil(${size.signal}/40)` };\n }\n return undefined;\n}\nexport function getFieldDefTitle(model, channel) {\n const channel2 = channel === 'x' ? 'x2' : 'y2';\n const fieldDef = model.fieldDef(channel);\n const fieldDef2 = model.fieldDef(channel2);\n const title1 = fieldDef ? fieldDef.title : undefined;\n const title2 = fieldDef2 ? fieldDef2.title : undefined;\n if (title1 && title2) {\n return mergeTitle(title1, title2);\n }\n else if (title1) {\n return title1;\n }\n else if (title2) {\n return title2;\n }\n else if (title1 !== undefined) {\n // falsy value to disable config\n return title1;\n }\n else if (title2 !== undefined) {\n // falsy value to disable config\n return title2;\n }\n return undefined;\n}\nexport function values(axis, fieldOrDatumDef) {\n const vals = axis.values;\n if (isArray(vals)) {\n return valueArray(fieldOrDatumDef, vals);\n }\n else if (isSignalRef(vals)) {\n return vals;\n }\n return undefined;\n}\nexport function defaultZindex(mark, fieldDef) {\n if (mark === 'rect' && isDiscrete(fieldDef)) {\n return 1;\n }\n return 0;\n}\n//# sourceMappingURL=properties.js.map","import { isScaleFieldDef, vgField } from '../../channeldef';\nimport { fieldFilterExpression } from '../../predicate';\nimport { isSortArray } from '../../sort';\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nimport { getDependentFields } from './expressions';\nexport class CalculateNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n this._dependentFields = getDependentFields(this.transform.calculate);\n }\n clone() {\n return new CalculateNode(null, duplicate(this.transform));\n }\n static parseAllForSortIndex(parent, model) {\n // get all the encoding with sort fields from model\n model.forEachFieldDef((fieldDef, channel) => {\n if (!isScaleFieldDef(fieldDef)) {\n return;\n }\n if (isSortArray(fieldDef.sort)) {\n const { field, timeUnit } = fieldDef;\n const sort = fieldDef.sort;\n // generate `datum[\"a\"] === val0 ? 0 : datum[\"a\"] === val1 ? 1 : ... : n` via FieldEqualPredicate\n const calculate = sort\n .map((sortValue, i) => {\n return `${fieldFilterExpression({ field, timeUnit, equal: sortValue })} ? ${i} : `;\n })\n .join('') + sort.length;\n parent = new CalculateNode(parent, {\n calculate,\n as: sortArrayIndexField(fieldDef, channel, { forAs: true })\n });\n }\n });\n return parent;\n }\n producedFields() {\n return new Set([this.transform.as]);\n }\n dependentFields() {\n return this._dependentFields;\n }\n assemble() {\n return {\n type: 'formula',\n expr: this.transform.calculate,\n as: this.transform.as\n };\n }\n hash() {\n return `Calculate ${hash(this.transform)}`;\n }\n}\nexport function sortArrayIndexField(fieldDef, channel, opt) {\n return vgField(fieldDef, Object.assign({ prefix: channel, suffix: 'sort_index' }, (opt !== null && opt !== void 0 ? opt : {})));\n}\n//# sourceMappingURL=calculate.js.map","import { contains, getFirstDefined } from '../../util';\n/**\n * Get header channel, which can be different from facet channel when orient is specified or when the facet channel is facet.\n */\nexport function getHeaderChannel(channel, orient) {\n if (contains(['top', 'bottom'], orient)) {\n return 'column';\n }\n else if (contains(['left', 'right'], orient)) {\n return 'row';\n }\n return channel === 'row' ? 'row' : 'column';\n}\nexport function getHeaderProperty(prop, header, config, channel) {\n const headerSpecificConfig = channel === 'row' ? config.headerRow : channel === 'column' ? config.headerColumn : config.headerFacet;\n return getFirstDefined((header || {})[prop], headerSpecificConfig[prop], config.header[prop]);\n}\nexport function getHeaderProperties(properties, header, config, channel) {\n const props = {};\n for (const prop of properties) {\n const value = getHeaderProperty(prop, header || {}, config, channel);\n if (value !== undefined) {\n props[prop] = value;\n }\n }\n return props;\n}\n//# sourceMappingURL=common.js.map","export const HEADER_CHANNELS = ['row', 'column'];\nexport const HEADER_TYPES = ['header', 'footer'];\n//# sourceMappingURL=component.js.map","/**\n * Utility for generating row / column headers\n */\nimport { isArray } from 'vega-util';\nimport { FACET_CHANNELS } from '../../channel';\nimport { vgField } from '../../channeldef';\nimport { HEADER_LABEL_PROPERTIES, HEADER_LABEL_PROPERTIES_MAP, HEADER_TITLE_PROPERTIES, HEADER_TITLE_PROPERTIES_MAP } from '../../header';\nimport { isSortField } from '../../sort';\nimport { isFacetMapping } from '../../spec/facet';\nimport { contains, isEmpty, normalizeAngle, replaceAll } from '../../util';\nimport { defaultLabelAlign, defaultLabelBaseline } from '../axis/properties';\nimport { sortArrayIndexField } from '../data/calculate';\nimport { formatSignalRef } from '../format';\nimport { isFacetModel } from '../model';\nimport { getHeaderChannel, getHeaderProperties, getHeaderProperty } from './common';\nimport { HEADER_TYPES } from './component';\n// TODO: rename to assembleHeaderTitleGroup\nexport function assembleTitleGroup(model, channel) {\n const title = model.component.layoutHeaders[channel].title;\n const config = model.config ? model.config : undefined;\n const facetFieldDef = model.component.layoutHeaders[channel].facetFieldDef\n ? model.component.layoutHeaders[channel].facetFieldDef\n : undefined;\n const { titleAnchor, titleAngle: ta, titleOrient } = getHeaderProperties(['titleAnchor', 'titleAngle', 'titleOrient'], facetFieldDef.header, config, channel);\n const headerChannel = getHeaderChannel(channel, titleOrient);\n const titleAngle = normalizeAngle(ta);\n return {\n name: `${channel}-title`,\n type: 'group',\n role: `${headerChannel}-title`,\n title: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ text: title }, (channel === 'row' ? { orient: 'left' } : {})), { style: 'guide-title' }), defaultHeaderGuideBaseline(titleAngle, headerChannel)), defaultHeaderGuideAlign(headerChannel, titleAngle, titleAnchor)), assembleHeaderProperties(config, facetFieldDef, channel, HEADER_TITLE_PROPERTIES, HEADER_TITLE_PROPERTIES_MAP))\n };\n}\nexport function defaultHeaderGuideAlign(headerChannel, angle, anchor = 'middle') {\n switch (anchor) {\n case 'start':\n return { align: 'left' };\n case 'end':\n return { align: 'right' };\n }\n const align = defaultLabelAlign(angle, headerChannel === 'row' ? 'left' : 'top', headerChannel === 'row' ? 'y' : 'x');\n return align ? { align } : {};\n}\nexport function defaultHeaderGuideBaseline(angle, channel) {\n const baseline = defaultLabelBaseline(angle, channel === 'row' ? 'left' : 'top', channel === 'row' ? 'y' : 'x', true);\n return baseline ? { baseline } : {};\n}\nexport function assembleHeaderGroups(model, channel) {\n const layoutHeader = model.component.layoutHeaders[channel];\n const groups = [];\n for (const headerType of HEADER_TYPES) {\n if (layoutHeader[headerType]) {\n for (const headerComponent of layoutHeader[headerType]) {\n const group = assembleHeaderGroup(model, channel, headerType, layoutHeader, headerComponent);\n if (group != null) {\n groups.push(group);\n }\n }\n }\n }\n return groups;\n}\nfunction getSort(facetFieldDef, channel) {\n var _a;\n const { sort } = facetFieldDef;\n if (isSortField(sort)) {\n return {\n field: vgField(sort, { expr: 'datum' }),\n order: (_a = sort.order) !== null && _a !== void 0 ? _a : 'ascending'\n };\n }\n else if (isArray(sort)) {\n return {\n field: sortArrayIndexField(facetFieldDef, channel, { expr: 'datum' }),\n order: 'ascending'\n };\n }\n else {\n return {\n field: vgField(facetFieldDef, { expr: 'datum' }),\n order: sort !== null && sort !== void 0 ? sort : 'ascending'\n };\n }\n}\nexport function assembleLabelTitle(facetFieldDef, channel, config) {\n const { format, formatType, labelAngle, labelAnchor, labelOrient, labelExpr } = getHeaderProperties(['format', 'formatType', 'labelAngle', 'labelAnchor', 'labelOrient', 'labelExpr'], facetFieldDef.header, config, channel);\n const titleTextExpr = formatSignalRef({ fieldOrDatumDef: facetFieldDef, format, formatType, expr: 'parent', config })\n .signal;\n const headerChannel = getHeaderChannel(channel, labelOrient);\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ text: {\n signal: labelExpr\n ? replaceAll(replaceAll(labelExpr, 'datum.label', titleTextExpr), 'datum.value', vgField(facetFieldDef, { expr: 'parent' }))\n : titleTextExpr\n } }, (channel === 'row' ? { orient: 'left' } : {})), { style: 'guide-label', frame: 'group' }), defaultHeaderGuideBaseline(labelAngle, headerChannel)), defaultHeaderGuideAlign(headerChannel, labelAngle, labelAnchor)), assembleHeaderProperties(config, facetFieldDef, channel, HEADER_LABEL_PROPERTIES, HEADER_LABEL_PROPERTIES_MAP));\n}\nexport function assembleHeaderGroup(model, channel, headerType, layoutHeader, headerComponent) {\n if (headerComponent) {\n let title = null;\n const { facetFieldDef } = layoutHeader;\n const config = model.config ? model.config : undefined;\n if (facetFieldDef && headerComponent.labels) {\n const { labelOrient } = getHeaderProperties(['labelOrient'], facetFieldDef.header, config, channel);\n // Include label title in the header if orient aligns with the channel\n if ((channel === 'row' && !contains(['top', 'bottom'], labelOrient)) ||\n (channel === 'column' && !contains(['left', 'right'], labelOrient))) {\n title = assembleLabelTitle(facetFieldDef, channel, config);\n }\n }\n const isFacetWithoutRowCol = isFacetModel(model) && !isFacetMapping(model.facet);\n const axes = headerComponent.axes;\n const hasAxes = (axes === null || axes === void 0 ? void 0 : axes.length) > 0;\n if (title || hasAxes) {\n const sizeChannel = channel === 'row' ? 'height' : 'width';\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ name: model.getName(`${channel}_${headerType}`), type: 'group', role: `${channel}-${headerType}` }, (layoutHeader.facetFieldDef\n ? {\n from: { data: model.getName(channel + '_domain') },\n sort: getSort(facetFieldDef, channel)\n }\n : {})), (hasAxes && isFacetWithoutRowCol\n ? {\n from: { data: model.getName(`facet_domain_${channel}`) }\n }\n : {})), (title ? { title } : {})), (headerComponent.sizeSignal\n ? {\n encode: {\n update: {\n [sizeChannel]: headerComponent.sizeSignal\n }\n }\n }\n : {})), (hasAxes ? { axes } : {}));\n }\n }\n return null;\n}\nconst LAYOUT_TITLE_BAND = {\n column: {\n start: 0,\n end: 1\n },\n row: {\n start: 1,\n end: 0\n }\n};\nexport function getLayoutTitleBand(titleAnchor, headerChannel) {\n return LAYOUT_TITLE_BAND[headerChannel][titleAnchor];\n}\nexport function assembleLayoutTitleBand(headerComponentIndex, config) {\n const titleBand = {};\n for (const channel of FACET_CHANNELS) {\n const headerComponent = headerComponentIndex[channel];\n if (headerComponent === null || headerComponent === void 0 ? void 0 : headerComponent.facetFieldDef) {\n const { titleAnchor, titleOrient } = getHeaderProperties(['titleAnchor', 'titleOrient'], headerComponent.facetFieldDef.header, config, channel);\n const headerChannel = getHeaderChannel(channel, titleOrient);\n const band = getLayoutTitleBand(titleAnchor, headerChannel);\n if (band !== undefined) {\n titleBand[headerChannel] = band;\n }\n }\n }\n return isEmpty(titleBand) ? undefined : titleBand;\n}\nexport function assembleHeaderProperties(config, facetFieldDef, channel, properties, propertiesMap) {\n const props = {};\n for (const prop of properties) {\n if (!propertiesMap[prop]) {\n continue;\n }\n const value = getHeaderProperty(prop, facetFieldDef === null || facetFieldDef === void 0 ? void 0 : facetFieldDef.header, config, channel);\n if (value !== undefined) {\n props[propertiesMap[prop]] = value;\n }\n }\n return props;\n}\n//# sourceMappingURL=assemble.js.map","import { getViewConfigContinuousSize } from '../../config';\nimport { hasDiscreteDomain } from '../../scale';\nimport { getFirstDefined } from '../../util';\nimport { isVgRangeStep } from '../../vega.schema';\nimport { signalOrStringValue } from '../common';\nimport { isFacetModel } from '../model';\nexport function assembleLayoutSignals(model) {\n return [\n ...sizeSignals(model, 'width'),\n ...sizeSignals(model, 'height'),\n ...sizeSignals(model, 'childWidth'),\n ...sizeSignals(model, 'childHeight')\n ];\n}\nexport function sizeSignals(model, sizeType) {\n const channel = sizeType === 'width' ? 'x' : 'y';\n const size = model.component.layoutSize.get(sizeType);\n if (!size || size === 'merged') {\n return [];\n }\n // Read size signal name from name map, just in case it is the top-level size signal that got renamed.\n const name = model.getSizeSignalRef(sizeType).signal;\n if (size === 'step') {\n const scaleComponent = model.getScaleComponent(channel);\n if (scaleComponent) {\n const type = scaleComponent.get('type');\n const range = scaleComponent.get('range');\n if (hasDiscreteDomain(type) && isVgRangeStep(range)) {\n const scaleName = model.scaleName(channel);\n if (isFacetModel(model.parent)) {\n // If parent is facet and this is an independent scale, return only signal signal\n // as the width/height will be calculated using the cardinality from\n // facet's aggregate rather than reading from scale domain\n const parentResolve = model.parent.component.resolve;\n if (parentResolve.scale[channel] === 'independent') {\n return [stepSignal(scaleName, range)];\n }\n }\n return [\n stepSignal(scaleName, range),\n {\n name,\n update: sizeExpr(scaleName, scaleComponent, `domain('${scaleName}').length`)\n }\n ];\n }\n }\n /* istanbul ignore next: Condition should not happen -- only for warning in development. */\n throw new Error('layout size is step although width/height is not step.');\n }\n else if (size == 'container') {\n const isWidth = name.endsWith('width');\n const expr = isWidth ? 'containerSize()[0]' : 'containerSize()[1]';\n const defaultValue = getViewConfigContinuousSize(model.config.view, isWidth ? 'width' : 'height');\n const safeExpr = `isFinite(${expr}) ? ${expr} : ${defaultValue}`;\n return [{ name, init: safeExpr, on: [{ update: safeExpr, events: 'window:resize' }] }];\n }\n else {\n return [\n {\n name,\n value: size\n }\n ];\n }\n}\nfunction stepSignal(scaleName, range) {\n return {\n name: scaleName + '_step',\n value: range.step\n };\n}\nexport function sizeExpr(scaleName, scaleComponent, cardinality) {\n const type = scaleComponent.get('type');\n const padding = scaleComponent.get('padding');\n const paddingOuter = getFirstDefined(scaleComponent.get('paddingOuter'), padding);\n let paddingInner = scaleComponent.get('paddingInner');\n paddingInner =\n type === 'band'\n ? // only band has real paddingInner\n paddingInner !== undefined\n ? paddingInner\n : padding\n : // For point, as calculated in https://github.com/vega/vega-scale/blob/master/src/band.js#L128,\n // it's equivalent to have paddingInner = 1 since there is only n-1 steps between n points.\n 1;\n return `bandspace(${cardinality}, ${signalOrStringValue(paddingInner)}, ${signalOrStringValue(paddingOuter)}) * ${scaleName}_step`;\n}\n//# sourceMappingURL=assemble.js.map","export function getSizeTypeFromLayoutSizeType(layoutSizeType) {\n return layoutSizeType === 'childWidth' ? 'width' : layoutSizeType === 'childHeight' ? 'height' : layoutSizeType;\n}\n//# sourceMappingURL=component.js.map","import { keys } from '../util';\nimport { signalOrValueRef } from './common';\nimport { wrapCondition } from './mark/encode';\nexport function guideEncodeEntry(encoding, model) {\n return keys(encoding).reduce((encode, channel) => {\n const valueDef = encoding[channel];\n return Object.assign(Object.assign({}, encode), wrapCondition(model, valueDef, channel, def => signalOrValueRef(def.value)));\n }, {});\n}\n//# sourceMappingURL=guide.js.map","import { isXorY } from '../channel';\nimport * as log from '../log';\nimport { isConcatModel, isFacetModel, isLayerModel } from './model';\nexport function defaultScaleResolve(channel, model) {\n if (isLayerModel(model) || isFacetModel(model)) {\n return 'shared';\n }\n else if (isConcatModel(model)) {\n return isXorY(channel) ? 'independent' : 'shared';\n }\n /* istanbul ignore next: should never reach here. */\n throw new Error('invalid model type for resolve');\n}\nexport function parseGuideResolve(resolve, channel) {\n const channelScaleResolve = resolve.scale[channel];\n const guide = isXorY(channel) ? 'axis' : 'legend';\n if (channelScaleResolve === 'independent') {\n if (resolve[guide][channel] === 'shared') {\n log.warn(log.message.independentScaleMeansIndependentGuide(channel));\n }\n return 'independent';\n }\n return resolve[guide][channel] || 'shared';\n}\n//# sourceMappingURL=resolve.js.map","import { COMMON_LEGEND_PROPERTY_INDEX } from '../../legend';\nimport { keys } from '../../util';\nimport { Split } from '../split';\nconst LEGEND_COMPONENT_PROPERTY_INDEX = Object.assign(Object.assign({}, COMMON_LEGEND_PROPERTY_INDEX), { disable: 1, labelExpr: 1, selections: 1, \n // channel scales\n opacity: 1, shape: 1, stroke: 1, fill: 1, size: 1, strokeWidth: 1, strokeDash: 1, \n // encode\n encode: 1 });\nexport const LEGEND_COMPONENT_PROPERTIES = keys(LEGEND_COMPONENT_PROPERTY_INDEX);\nexport class LegendComponent extends Split {\n}\n//# sourceMappingURL=component.js.map","import { array, isArray, stringValue } from 'vega-util';\nimport { COLOR, OPACITY } from '../../channel';\nimport { hasConditionalValueDef, isFieldDef, isValueDef } from '../../channeldef';\nimport { FILL_STROKE_CONFIG } from '../../mark';\nimport { getFirstDefined, isEmpty, varName } from '../../util';\nimport { applyMarkConfig, signalOrValueRef } from '../common';\nimport { formatCustomType, isCustomFormatType } from '../format';\nimport * as mixins from '../mark/encode';\nimport { STORE } from '../selection';\nexport const legendEncodeRules = {\n symbols,\n gradient,\n labels,\n entries\n};\nexport function symbols(symbolsSpec, { fieldOrDatumDef, model, channel, legendCmpt, legendType }) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n if (legendType !== 'symbol') {\n return undefined;\n }\n const { markDef, encoding, config, mark } = model;\n const filled = markDef.filled && mark !== 'trail';\n let out = Object.assign(Object.assign({}, applyMarkConfig({}, model, FILL_STROKE_CONFIG)), mixins.color(model, { filled })); // FIXME: remove this when VgEncodeEntry is compatible with SymbolEncodeEntry\n const symbolOpacity = (_a = legendCmpt.get('symbolOpacity')) !== null && _a !== void 0 ? _a : config.legend.symbolOpacity;\n const symbolFillColor = (_b = legendCmpt.get('symbolFillColor')) !== null && _b !== void 0 ? _b : config.legend.symbolFillColor;\n const symbolStrokeColor = (_c = legendCmpt.get('symbolStrokeColor')) !== null && _c !== void 0 ? _c : config.legend.symbolStrokeColor;\n const opacity = symbolOpacity === undefined ? (_d = getMaxValue(encoding.opacity)) !== null && _d !== void 0 ? _d : markDef.opacity : undefined;\n if (out.fill) {\n // for fill legend, we don't want any fill in symbol\n if (channel === 'fill' || (filled && channel === COLOR)) {\n delete out.fill;\n }\n else {\n if (out.fill['field']) {\n // For others, set fill to some opaque value (or nothing if a color is already set)\n if (symbolFillColor) {\n delete out.fill;\n }\n else {\n out.fill = signalOrValueRef((_e = config.legend.symbolBaseFillColor) !== null && _e !== void 0 ? _e : 'black');\n out.fillOpacity = signalOrValueRef(opacity !== null && opacity !== void 0 ? opacity : 1);\n }\n }\n else if (isArray(out.fill)) {\n const fill = (_h = (_g = getFirstConditionValue((_f = encoding.fill) !== null && _f !== void 0 ? _f : encoding.color)) !== null && _g !== void 0 ? _g : markDef.fill) !== null && _h !== void 0 ? _h : (filled && markDef.color);\n if (fill) {\n out.fill = signalOrValueRef(fill);\n }\n }\n }\n }\n if (out.stroke) {\n if (channel === 'stroke' || (!filled && channel === COLOR)) {\n delete out.stroke;\n }\n else {\n if (out.stroke['field'] || symbolStrokeColor) {\n // For others, remove stroke field\n delete out.stroke;\n }\n else if (isArray(out.stroke)) {\n const stroke = getFirstDefined(getFirstConditionValue(encoding.stroke || encoding.color), markDef.stroke, filled ? markDef.color : undefined);\n if (stroke) {\n out.stroke = { value: stroke };\n }\n }\n }\n }\n if (channel !== OPACITY) {\n const condition = isFieldDef(fieldOrDatumDef) && selectedCondition(model, legendCmpt, fieldOrDatumDef);\n if (condition) {\n out.opacity = [\n Object.assign({ test: condition }, signalOrValueRef(opacity !== null && opacity !== void 0 ? opacity : 1)),\n signalOrValueRef(config.legend.unselectedOpacity)\n ];\n }\n else if (opacity) {\n out.opacity = signalOrValueRef(opacity);\n }\n }\n out = Object.assign(Object.assign({}, out), symbolsSpec);\n return isEmpty(out) ? undefined : out;\n}\nexport function gradient(gradientSpec, { model, legendType, legendCmpt }) {\n var _a;\n if (legendType !== 'gradient') {\n return undefined;\n }\n const { config, markDef, encoding } = model;\n let out = {};\n const gradientOpacity = (_a = legendCmpt.get('gradientOpacity')) !== null && _a !== void 0 ? _a : config.legend.gradientOpacity;\n const opacity = gradientOpacity === undefined ? getMaxValue(encoding.opacity) || markDef.opacity : undefined;\n if (opacity) {\n // only apply opacity if it is neither zero or undefined\n out.opacity = signalOrValueRef(opacity);\n }\n out = Object.assign(Object.assign({}, out), gradientSpec);\n return isEmpty(out) ? undefined : out;\n}\nexport function labels(specifiedlabelsSpec, { fieldOrDatumDef, model, channel, legendCmpt }) {\n const legend = model.legend(channel) || {};\n const config = model.config;\n const condition = isFieldDef(fieldOrDatumDef) ? selectedCondition(model, legendCmpt, fieldOrDatumDef) : undefined;\n const opacity = condition ? [{ test: condition, value: 1 }, { value: config.legend.unselectedOpacity }] : undefined;\n const { format, formatType } = legend;\n const text = isCustomFormatType(formatType)\n ? formatCustomType({\n fieldOrDatumDef,\n field: 'datum.value',\n format,\n formatType,\n config\n })\n : undefined;\n const labelsSpec = Object.assign(Object.assign(Object.assign({}, (opacity ? { opacity } : {})), (text ? { text } : {})), specifiedlabelsSpec);\n return isEmpty(labelsSpec) ? undefined : labelsSpec;\n}\nexport function entries(entriesSpec, { legendCmpt }) {\n const selections = legendCmpt.get('selections');\n return (selections === null || selections === void 0 ? void 0 : selections.length) ? Object.assign(Object.assign({}, entriesSpec), { fill: { value: 'transparent' } }) : entriesSpec;\n}\nfunction getMaxValue(channelDef) {\n return getConditionValue(channelDef, (v, conditionalDef) => Math.max(v, conditionalDef.value));\n}\nexport function getFirstConditionValue(channelDef) {\n return getConditionValue(channelDef, (v, conditionalDef) => {\n return getFirstDefined(v, conditionalDef.value);\n });\n}\nfunction getConditionValue(channelDef, reducer) {\n if (hasConditionalValueDef(channelDef)) {\n return array(channelDef.condition).reduce(reducer, channelDef.value);\n }\n else if (isValueDef(channelDef)) {\n return channelDef.value;\n }\n return undefined;\n}\nfunction selectedCondition(model, legendCmpt, fieldDef) {\n const selections = legendCmpt.get('selections');\n if (!(selections === null || selections === void 0 ? void 0 : selections.length))\n return undefined;\n const field = stringValue(fieldDef.field);\n return selections\n .map(name => {\n const store = stringValue(varName(name) + STORE);\n return `(!length(data(${store})) || (${name}[${field}] && indexof(${name}[${field}], datum.value) >= 0))`;\n })\n .join(' || ');\n}\n//# sourceMappingURL=encode.js.map","import { isArray } from 'vega-util';\nimport { isColorChannel } from '../../channel';\nimport { title as fieldDefTitle, valueArray } from '../../channeldef';\nimport { isContinuousToContinuous } from '../../scale';\nimport { contains, getFirstDefined } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { guideFormat, guideFormatType } from '../format';\nimport { getFirstConditionValue } from './encode';\nexport const legendRules = {\n direction: ({ direction }) => direction,\n format: ({ fieldOrDatumDef, legend, config }) => {\n const { format, formatType } = legend;\n return guideFormat(fieldOrDatumDef, fieldOrDatumDef.type, format, formatType, config, false);\n },\n formatType: ({ legend, fieldOrDatumDef, scaleType }) => {\n const { formatType } = legend;\n return guideFormatType(formatType, fieldOrDatumDef, scaleType);\n },\n gradientLength: params => {\n var _a, _b;\n const { legend, legendConfig } = params;\n return (_b = (_a = legend.gradientLength) !== null && _a !== void 0 ? _a : legendConfig.gradientLength) !== null && _b !== void 0 ? _b : defaultGradientLength(params);\n },\n labelOverlap: ({ legend, legendConfig, scaleType }) => { var _a, _b; return (_b = (_a = legend.labelOverlap) !== null && _a !== void 0 ? _a : legendConfig.labelOverlap) !== null && _b !== void 0 ? _b : defaultLabelOverlap(scaleType); },\n symbolType: ({ legend, markDef, channel, encoding }) => { var _a; return (_a = legend.symbolType) !== null && _a !== void 0 ? _a : defaultSymbolType(markDef.type, channel, encoding.shape, markDef.shape); },\n title: ({ fieldOrDatumDef, config }) => fieldDefTitle(fieldOrDatumDef, config, { allowDisabling: true }),\n type: ({ legendType, scaleType, channel }) => {\n if (isColorChannel(channel) && isContinuousToContinuous(scaleType)) {\n if (legendType === 'gradient') {\n return undefined;\n }\n }\n else if (legendType === 'symbol') {\n return undefined;\n }\n return legendType;\n },\n values: ({ fieldOrDatumDef, legend }) => values(legend, fieldOrDatumDef)\n};\nexport function values(legend, fieldOrDatumDef) {\n const vals = legend.values;\n if (isArray(vals)) {\n return valueArray(fieldOrDatumDef, vals);\n }\n else if (isSignalRef(vals)) {\n return vals;\n }\n return undefined;\n}\nexport function defaultSymbolType(mark, channel, shapeChannelDef, markShape) {\n var _a;\n if (channel !== 'shape') {\n // use the value from the shape encoding or the mark config if they exist\n const shape = (_a = getFirstConditionValue(shapeChannelDef)) !== null && _a !== void 0 ? _a : markShape;\n if (shape) {\n return shape;\n }\n }\n switch (mark) {\n case 'bar':\n case 'rect':\n case 'image':\n case 'square':\n return 'square';\n case 'line':\n case 'trail':\n case 'rule':\n return 'stroke';\n case 'arc':\n case 'point':\n case 'circle':\n case 'tick':\n case 'geoshape':\n case 'area':\n case 'text':\n return 'circle';\n }\n}\nexport function clipHeight(legendType) {\n if (legendType === 'gradient') {\n return 20;\n }\n return undefined;\n}\nexport function getLegendType(params) {\n const { legend } = params;\n return getFirstDefined(legend.type, defaultType(params));\n}\nexport function defaultType({ channel, timeUnit, scaleType }) {\n // Following the logic in https://github.com/vega/vega-parser/blob/master/src/parsers/legend.js\n if (isColorChannel(channel)) {\n if (contains(['quarter', 'month', 'day'], timeUnit)) {\n return 'symbol';\n }\n if (isContinuousToContinuous(scaleType)) {\n return 'gradient';\n }\n }\n return 'symbol';\n}\nexport function getDirection({ legendConfig, legendType, orient, legend }) {\n var _a, _b;\n return ((_b = (_a = legend.direction) !== null && _a !== void 0 ? _a : legendConfig[legendType ? 'gradientDirection' : 'symbolDirection']) !== null && _b !== void 0 ? _b : defaultDirection(orient, legendType));\n}\nexport function defaultDirection(orient, legendType) {\n switch (orient) {\n case 'top':\n case 'bottom':\n return 'horizontal';\n case 'left':\n case 'right':\n case 'none':\n case undefined: // undefined = \"right\" in Vega\n return undefined; // vertical is Vega's default\n default:\n // top-left / ...\n // For inner legend, uses compact layout like Tableau\n return legendType === 'gradient' ? 'horizontal' : undefined;\n }\n}\nexport function defaultGradientLength({ legendConfig, model, direction, orient, scaleType }) {\n const { gradientHorizontalMaxLength, gradientHorizontalMinLength, gradientVerticalMaxLength, gradientVerticalMinLength } = legendConfig;\n if (isContinuousToContinuous(scaleType)) {\n if (direction === 'horizontal') {\n if (orient === 'top' || orient === 'bottom') {\n return gradientLengthSignal(model, 'width', gradientHorizontalMinLength, gradientHorizontalMaxLength);\n }\n else {\n return gradientHorizontalMinLength;\n }\n }\n else {\n // vertical / undefined (Vega uses vertical by default)\n return gradientLengthSignal(model, 'height', gradientVerticalMinLength, gradientVerticalMaxLength);\n }\n }\n return undefined;\n}\nfunction gradientLengthSignal(model, sizeType, min, max) {\n const sizeSignal = model.getSizeSignalRef(sizeType).signal;\n return { signal: `clamp(${sizeSignal}, ${min}, ${max})` };\n}\nexport function defaultLabelOverlap(scaleType) {\n if (contains(['quantile', 'threshold', 'log', 'symlog'], scaleType)) {\n return 'greedy';\n }\n return undefined;\n}\n//# sourceMappingURL=properties.js.map","import { COLOR, SHAPE } from '../../channel';\nimport { getFieldOrDatumDef, isFieldDef } from '../../channeldef';\nimport { LEGEND_SCALE_CHANNELS } from '../../legend';\nimport { normalizeTimeUnit } from '../../timeunit';\nimport { GEOJSON } from '../../type';\nimport { deleteNestedProperty, isEmpty, keys, varName } from '../../util';\nimport { mergeTitleComponent } from '../common';\nimport { guideEncodeEntry } from '../guide';\nimport { isUnitModel } from '../model';\nimport { parseGuideResolve } from '../resolve';\nimport { parseInteractiveLegend } from '../selection/transforms/legends';\nimport { defaultTieBreaker, makeImplicit, mergeValuesWithExplicit } from '../split';\nimport { LegendComponent, LEGEND_COMPONENT_PROPERTIES } from './component';\nimport { legendEncodeRules } from './encode';\nimport { getDirection, getLegendType, legendRules } from './properties';\nexport function parseLegend(model) {\n const legendComponent = isUnitModel(model) ? parseUnitLegend(model) : parseNonUnitLegend(model);\n model.component.legends = legendComponent;\n return legendComponent;\n}\nfunction parseUnitLegend(model) {\n const { encoding } = model;\n const legendComponent = {};\n for (const channel of [COLOR, ...LEGEND_SCALE_CHANNELS]) {\n const def = getFieldOrDatumDef(encoding[channel]);\n if (!def || !model.getScaleComponent(channel)) {\n continue;\n }\n if (channel === SHAPE && isFieldDef(def) && def.type === GEOJSON) {\n continue;\n }\n legendComponent[channel] = parseLegendForChannel(model, channel);\n }\n return legendComponent;\n}\nfunction getLegendDefWithScale(model, channel) {\n const scale = model.scaleName(channel);\n if (model.mark === 'trail') {\n if (channel === 'color') {\n // trail is a filled mark, but its default symbolType (\"stroke\") should use \"stroke\"\n return { stroke: scale };\n }\n else if (channel === 'size') {\n return { strokeWidth: scale };\n }\n }\n if (channel === 'color') {\n return model.markDef.filled ? { fill: scale } : { stroke: scale };\n }\n return { [channel]: scale };\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isExplicit(value, property, legend, fieldDef) {\n switch (property) {\n case 'disable':\n return legend !== undefined; // if axis is specified or null/false, then it's enable/disable state is explicit\n case 'values':\n // specified legend.values is already respected, but may get transformed.\n return !!(legend === null || legend === void 0 ? void 0 : legend.values);\n case 'title':\n // title can be explicit if fieldDef.title is set\n if (property === 'title' && value === (fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.title)) {\n return true;\n }\n }\n // Otherwise, things are explicit if the returned value matches the specified property\n return value === (legend || {})[property];\n}\nexport function parseLegendForChannel(model, channel) {\n var _a, _b, _c;\n let legend = model.legend(channel);\n const { markDef, encoding, config } = model;\n const legendConfig = config.legend;\n const legendCmpt = new LegendComponent({}, getLegendDefWithScale(model, channel));\n parseInteractiveLegend(model, channel, legendCmpt);\n const disable = legend !== undefined ? !legend : legendConfig.disable;\n legendCmpt.set('disable', disable, legend !== undefined);\n if (disable) {\n return legendCmpt;\n }\n legend = legend || {};\n const scaleType = model.getScaleComponent(channel).get('type');\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n const timeUnit = isFieldDef(fieldOrDatumDef) ? (_a = normalizeTimeUnit(fieldOrDatumDef.timeUnit)) === null || _a === void 0 ? void 0 : _a.unit : undefined;\n const orient = legend.orient || config.legend.orient || 'right';\n const legendType = getLegendType({ legend, channel, timeUnit, scaleType });\n const direction = getDirection({ legend, legendType, orient, legendConfig });\n const ruleParams = {\n legend,\n channel,\n model,\n markDef,\n encoding,\n fieldOrDatumDef,\n legendConfig,\n config,\n scaleType,\n orient,\n legendType,\n direction\n };\n for (const property of LEGEND_COMPONENT_PROPERTIES) {\n if ((legendType === 'gradient' && property.startsWith('symbol')) ||\n (legendType === 'symbol' && property.startsWith('gradient'))) {\n continue;\n }\n const value = property in legendRules ? legendRules[property](ruleParams) : legend[property];\n if (value !== undefined) {\n const explicit = isExplicit(value, property, legend, model.fieldDef(channel));\n if (explicit || config.legend[property] === undefined) {\n legendCmpt.set(property, value, explicit);\n }\n }\n }\n const legendEncoding = (_b = legend === null || legend === void 0 ? void 0 : legend.encoding) !== null && _b !== void 0 ? _b : {};\n const selections = legendCmpt.get('selections');\n const legendEncode = {};\n const legendEncodeParams = { fieldOrDatumDef, model, channel, legendCmpt, legendType };\n for (const part of ['labels', 'legend', 'title', 'symbols', 'gradient', 'entries']) {\n const legendEncodingPart = guideEncodeEntry((_c = legendEncoding[part]) !== null && _c !== void 0 ? _c : {}, model);\n const value = part in legendEncodeRules\n ? legendEncodeRules[part](legendEncodingPart, legendEncodeParams) // apply rule\n : legendEncodingPart; // no rule -- just default values\n if (value !== undefined && !isEmpty(value)) {\n legendEncode[part] = Object.assign(Object.assign(Object.assign({}, ((selections === null || selections === void 0 ? void 0 : selections.length) && isFieldDef(fieldOrDatumDef)\n ? { name: `${varName(fieldOrDatumDef.field)}_legend_${part}` }\n : {})), ((selections === null || selections === void 0 ? void 0 : selections.length) ? { interactive: !!selections } : {})), { update: value });\n }\n }\n if (!isEmpty(legendEncode)) {\n legendCmpt.set('encode', legendEncode, !!(legend === null || legend === void 0 ? void 0 : legend.encoding));\n }\n return legendCmpt;\n}\nfunction parseNonUnitLegend(model) {\n const { legends, resolve } = model.component;\n for (const child of model.children) {\n parseLegend(child);\n for (const channel of keys(child.component.legends)) {\n resolve.legend[channel] = parseGuideResolve(model.component.resolve, channel);\n if (resolve.legend[channel] === 'shared') {\n // If the resolve says shared (and has not been overridden)\n // We will try to merge and see if there is a conflict\n legends[channel] = mergeLegendComponent(legends[channel], child.component.legends[channel]);\n if (!legends[channel]) {\n // If merge returns nothing, there is a conflict so we cannot make the legend shared.\n // Thus, mark legend as independent and remove the legend component.\n resolve.legend[channel] = 'independent';\n delete legends[channel];\n }\n }\n }\n }\n for (const channel of keys(legends)) {\n for (const child of model.children) {\n if (!child.component.legends[channel]) {\n // skip if the child does not have a particular legend\n continue;\n }\n if (resolve.legend[channel] === 'shared') {\n // After merging shared legend, make sure to remove legend from child\n delete child.component.legends[channel];\n }\n }\n }\n return legends;\n}\nexport function mergeLegendComponent(mergedLegend, childLegend) {\n var _a, _b, _c, _d;\n if (!mergedLegend) {\n return childLegend.clone();\n }\n const mergedOrient = mergedLegend.getWithExplicit('orient');\n const childOrient = childLegend.getWithExplicit('orient');\n if (mergedOrient.explicit && childOrient.explicit && mergedOrient.value !== childOrient.value) {\n // TODO: throw warning if resolve is explicit (We don't have info about explicit/implicit resolve yet.)\n // Cannot merge due to inconsistent orient\n return undefined;\n }\n let typeMerged = false;\n // Otherwise, let's merge\n for (const prop of LEGEND_COMPONENT_PROPERTIES) {\n const mergedValueWithExplicit = mergeValuesWithExplicit(mergedLegend.getWithExplicit(prop), childLegend.getWithExplicit(prop), prop, 'legend', \n // Tie breaker function\n (v1, v2) => {\n switch (prop) {\n case 'symbolType':\n return mergeSymbolType(v1, v2);\n case 'title':\n return mergeTitleComponent(v1, v2);\n case 'type':\n // There are only two types. If we have different types, then prefer symbol over gradient.\n typeMerged = true;\n return makeImplicit('symbol');\n }\n return defaultTieBreaker(v1, v2, prop, 'legend');\n });\n mergedLegend.setWithExplicit(prop, mergedValueWithExplicit);\n }\n if (typeMerged) {\n if ((_b = (_a = mergedLegend.implicit) === null || _a === void 0 ? void 0 : _a.encode) === null || _b === void 0 ? void 0 : _b.gradient) {\n deleteNestedProperty(mergedLegend.implicit, ['encode', 'gradient']);\n }\n if ((_d = (_c = mergedLegend.explicit) === null || _c === void 0 ? void 0 : _c.encode) === null || _d === void 0 ? void 0 : _d.gradient) {\n deleteNestedProperty(mergedLegend.explicit, ['encode', 'gradient']);\n }\n }\n return mergedLegend;\n}\nfunction mergeSymbolType(st1, st2) {\n if (st2.value === 'circle') {\n // prefer \"circle\" over \"stroke\"\n return st2;\n }\n return st1;\n}\n//# sourceMappingURL=parse.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { LEGEND_SCALE_CHANNELS } from '../../legend';\nimport { keys, replaceAll, stringify, vals } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { mergeLegendComponent } from './parse';\nfunction setLegendEncode(legend, part, vgProp, vgRef) {\n var _a, _b, _c;\n legend.encode = (_a = legend.encode) !== null && _a !== void 0 ? _a : {};\n legend.encode[part] = (_b = legend.encode[part]) !== null && _b !== void 0 ? _b : {};\n legend.encode[part].update = (_c = legend.encode[part].update) !== null && _c !== void 0 ? _c : {};\n // TODO: remove as any after https://github.com/prisma/nexus-prisma/issues/291\n legend.encode[part].update[vgProp] = vgRef;\n}\nexport function assembleLegends(model) {\n const legendComponentIndex = model.component.legends;\n const legendByDomain = {};\n for (const channel of keys(legendComponentIndex)) {\n const scaleComponent = model.getScaleComponent(channel);\n const domainHash = stringify(scaleComponent.get('domains'));\n if (legendByDomain[domainHash]) {\n for (const mergedLegendComponent of legendByDomain[domainHash]) {\n const merged = mergeLegendComponent(mergedLegendComponent, legendComponentIndex[channel]);\n if (!merged) {\n // If cannot merge, need to add this legend separately\n legendByDomain[domainHash].push(legendComponentIndex[channel]);\n }\n }\n }\n else {\n legendByDomain[domainHash] = [legendComponentIndex[channel].clone()];\n }\n }\n const legends = vals(legendByDomain)\n .flat()\n .map(l => assembleLegend(l, model.config))\n .filter(l => l !== undefined);\n return legends;\n}\nexport function assembleLegend(legendCmpt, config) {\n var _a, _b, _c;\n const _d = legendCmpt.combine(), { disable, labelExpr, selections } = _d, legend = __rest(_d, [\"disable\", \"labelExpr\", \"selections\"]);\n if (disable) {\n return undefined;\n }\n if (config.aria === false && legend.aria == undefined) {\n legend.aria = false;\n }\n if ((_a = legend.encode) === null || _a === void 0 ? void 0 : _a.symbols) {\n const out = legend.encode.symbols.update;\n if (out.fill && out.fill['value'] !== 'transparent' && !out.stroke && !legend.stroke) {\n // For non color channel's legend, we need to override symbol stroke config from Vega config if stroke channel is not used.\n out.stroke = { value: 'transparent' };\n }\n // Remove properties that the legend is encoding.\n for (const property of LEGEND_SCALE_CHANNELS) {\n if (legend[property]) {\n delete out[property];\n }\n }\n }\n if (!legend.title) {\n // title schema doesn't include null, ''\n delete legend.title;\n }\n if (labelExpr !== undefined) {\n let expr = labelExpr;\n if (((_c = (_b = legend.encode) === null || _b === void 0 ? void 0 : _b.labels) === null || _c === void 0 ? void 0 : _c.update) && isSignalRef(legend.encode.labels.update.text)) {\n expr = replaceAll(labelExpr, 'datum.label', legend.encode.labels.update.text.signal);\n }\n setLegendEncode(legend, 'labels', 'text', { signal: expr });\n }\n return legend;\n}\n//# sourceMappingURL=assemble.js.map","import { contains } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { isConcatModel, isLayerModel } from '../model';\nexport function assembleProjections(model) {\n if (isLayerModel(model) || isConcatModel(model)) {\n return assembleProjectionsForModelAndChildren(model);\n }\n else {\n return assembleProjectionForModel(model);\n }\n}\nexport function assembleProjectionsForModelAndChildren(model) {\n return model.children.reduce((projections, child) => {\n return projections.concat(child.assembleProjections());\n }, assembleProjectionForModel(model));\n}\nexport function assembleProjectionForModel(model) {\n const component = model.component.projection;\n if (!component || component.merged) {\n return [];\n }\n const projection = component.combine();\n const { name } = projection; // we need to extract name so that it is always present in the output and pass TS type validation\n if (!component.data) {\n // generate custom projection, no automatic fitting\n return [\n Object.assign(Object.assign({ name }, { translate: { signal: '[width / 2, height / 2]' } }), projection)\n ];\n }\n else {\n // generate projection that uses extent fitting\n const size = {\n signal: `[${component.size.map(ref => ref.signal).join(', ')}]`\n };\n const fits = component.data.reduce((sources, data) => {\n const source = isSignalRef(data) ? data.signal : `data('${model.lookupDataSource(data)}')`;\n if (!contains(sources, source)) {\n // build a unique list of sources\n sources.push(source);\n }\n return sources;\n }, []);\n if (fits.length <= 0) {\n throw new Error(\"Projection's fit didn't find any data sources\");\n }\n return [\n Object.assign({ name,\n size, fit: {\n signal: fits.length > 1 ? `[${fits.join(', ')}]` : fits[0]\n } }, projection)\n ];\n }\n}\n//# sourceMappingURL=assemble.js.map","export const PROJECTION_PROPERTIES = [\n 'type',\n 'clipAngle',\n 'clipExtent',\n 'center',\n 'rotate',\n 'precision',\n 'reflectX',\n 'reflectY',\n 'coefficient',\n 'distance',\n 'fraction',\n 'lobes',\n 'parallel',\n 'radius',\n 'ratio',\n 'spacing',\n 'tilt'\n];\n//# sourceMappingURL=projection.js.map","import { Split } from '../split';\nexport class ProjectionComponent extends Split {\n constructor(name, specifiedProjection, size, data) {\n super(Object.assign({}, specifiedProjection), // all explicit properties of projection\n { name } // name as initial implicit property\n );\n this.specifiedProjection = specifiedProjection;\n this.size = size;\n this.data = data;\n this.merged = false;\n }\n /**\n * Whether the projection parameters should fit provided data.\n */\n get isFit() {\n return !!this.data;\n }\n}\n//# sourceMappingURL=component.js.map","import { hasOwnProperty } from 'vega-util';\nimport { LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2, SHAPE } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { DataSourceType } from '../../data';\nimport { PROJECTION_PROPERTIES } from '../../projection';\nimport { GEOJSON } from '../../type';\nimport { duplicate, every, stringify } from '../../util';\nimport { isUnitModel } from '../model';\nimport { ProjectionComponent } from './component';\nexport function parseProjection(model) {\n model.component.projection = isUnitModel(model) ? parseUnitProjection(model) : parseNonUnitProjections(model);\n}\nfunction parseUnitProjection(model) {\n var _a;\n if (model.hasProjection) {\n const proj = model.specifiedProjection;\n const fit = !(proj && (proj.scale != null || proj.translate != null));\n const size = fit ? [model.getSizeSignalRef('width'), model.getSizeSignalRef('height')] : undefined;\n const data = fit ? gatherFitData(model) : undefined;\n return new ProjectionComponent(model.projectionName(true), Object.assign(Object.assign({}, ((_a = model.config.projection) !== null && _a !== void 0 ? _a : {})), (proj !== null && proj !== void 0 ? proj : {})), size, data);\n }\n return undefined;\n}\nfunction gatherFitData(model) {\n const data = [];\n const { encoding } = model;\n for (const posssiblePair of [\n [LONGITUDE, LATITUDE],\n [LONGITUDE2, LATITUDE2]\n ]) {\n if (getFieldOrDatumDef(encoding[posssiblePair[0]]) || getFieldOrDatumDef(encoding[posssiblePair[1]])) {\n data.push({\n signal: model.getName(`geojson_${data.length}`)\n });\n }\n }\n if (model.channelHasField(SHAPE) && model.typedFieldDef(SHAPE).type === GEOJSON) {\n data.push({\n signal: model.getName(`geojson_${data.length}`)\n });\n }\n if (data.length === 0) {\n // main source is geojson, so we can just use that\n data.push(model.requestDataName(DataSourceType.Main));\n }\n return data;\n}\nfunction mergeIfNoConflict(first, second) {\n const allPropertiesShared = every(PROJECTION_PROPERTIES, prop => {\n // neither has the property\n if (!hasOwnProperty(first.explicit, prop) && !hasOwnProperty(second.explicit, prop)) {\n return true;\n }\n // both have property and an equal value for property\n if (hasOwnProperty(first.explicit, prop) &&\n hasOwnProperty(second.explicit, prop) &&\n // some properties might be signals or objects and require hashing for comparison\n stringify(first.get(prop)) === stringify(second.get(prop))) {\n return true;\n }\n return false;\n });\n const size = stringify(first.size) === stringify(second.size);\n if (size) {\n if (allPropertiesShared) {\n return first;\n }\n else if (stringify(first.explicit) === stringify({})) {\n return second;\n }\n else if (stringify(second.explicit) === stringify({})) {\n return first;\n }\n }\n // if all properties don't match, let each unit spec have its own projection\n return null;\n}\nfunction parseNonUnitProjections(model) {\n if (model.children.length === 0) {\n return undefined;\n }\n let nonUnitProjection;\n // parse all children first\n for (const child of model.children) {\n parseProjection(child);\n }\n // analyze parsed projections, attempt to merge\n const mergable = every(model.children, child => {\n const projection = child.component.projection;\n if (!projection) {\n // child layer does not use a projection\n return true;\n }\n else if (!nonUnitProjection) {\n // cached 'projection' is null, cache this one\n nonUnitProjection = projection;\n return true;\n }\n else {\n const merge = mergeIfNoConflict(nonUnitProjection, projection);\n if (merge) {\n nonUnitProjection = merge;\n }\n return !!merge;\n }\n });\n // if cached one and all other children share the same projection,\n if (nonUnitProjection && mergable) {\n // so we can elevate it to the layer level\n const name = model.projectionName(true);\n const modelProjection = new ProjectionComponent(name, nonUnitProjection.specifiedProjection, nonUnitProjection.size, duplicate(nonUnitProjection.data));\n // rename and assign all others as merged\n for (const child of model.children) {\n const projection = child.component.projection;\n if (projection) {\n if (projection.isFit) {\n modelProjection.data.push(...child.component.projection.data);\n }\n child.renameProjection(projection.get('name'), name);\n projection.merged = true;\n }\n }\n return modelProjection;\n }\n return undefined;\n}\n//# sourceMappingURL=parse.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isString } from 'vega-util';\nimport { binToString, isBinning, isSelectionExtent } from '../../bin';\nimport { binRequiresRange, isTypedFieldDef, normalizeBin, vgField } from '../../channeldef';\nimport { duplicate, hash, isEmpty, keys, replacePathInField, unique, vals, varName } from '../../util';\nimport { binFormatExpression } from '../format';\nimport { isUnitModel } from '../model';\nimport { parseSelectionBinExtent } from '../selection/parse';\nimport { DataFlowNode } from './dataflow';\nfunction rangeFormula(model, fieldDef, channel, config) {\n var _a, _b;\n if (binRequiresRange(fieldDef, channel)) {\n // read format from axis or legend, if there is no format then use config.numberFormat\n const guide = isUnitModel(model)\n ? (_b = (_a = model.axis(channel)) !== null && _a !== void 0 ? _a : model.legend(channel)) !== null && _b !== void 0 ? _b : {} : {};\n const startField = vgField(fieldDef, { expr: 'datum' });\n const endField = vgField(fieldDef, { expr: 'datum', binSuffix: 'end' });\n return {\n formulaAs: vgField(fieldDef, { binSuffix: 'range', forAs: true }),\n formula: binFormatExpression(startField, endField, guide.format, guide.formatType, config)\n };\n }\n return {};\n}\nfunction binKey(bin, field) {\n return `${binToString(bin)}_${field}`;\n}\nfunction getSignalsFromModel(model, key) {\n return {\n signal: model.getName(`${key}_bins`),\n extentSignal: model.getName(`${key}_extent`)\n };\n}\nexport function getBinSignalName(model, field, bin) {\n var _a;\n const normalizedBin = (_a = normalizeBin(bin, undefined)) !== null && _a !== void 0 ? _a : {};\n const key = binKey(normalizedBin, field);\n return model.getName(`${key}_bins`);\n}\nfunction isBinTransform(t) {\n return 'as' in t;\n}\nfunction createBinComponent(t, bin, model) {\n let as;\n let span;\n if (isBinTransform(t)) {\n as = isString(t.as) ? [t.as, `${t.as}_end`] : [t.as[0], t.as[1]];\n }\n else {\n as = [vgField(t, { forAs: true }), vgField(t, { binSuffix: 'end', forAs: true })];\n }\n const normalizedBin = Object.assign({}, normalizeBin(bin, undefined));\n const key = binKey(normalizedBin, t.field);\n const { signal, extentSignal } = getSignalsFromModel(model, key);\n if (isSelectionExtent(normalizedBin.extent)) {\n const ext = normalizedBin.extent;\n const selName = ext.selection;\n span = parseSelectionBinExtent(model.getSelectionComponent(varName(selName), selName), ext);\n delete normalizedBin.extent; // Vega-Lite selection extent map to Vega's span property.\n }\n const binComponent = Object.assign(Object.assign(Object.assign({ bin: normalizedBin, field: t.field, as: [as] }, (signal ? { signal } : {})), (extentSignal ? { extentSignal } : {})), (span ? { span } : {}));\n return { key, binComponent };\n}\nexport class BinNode extends DataFlowNode {\n constructor(parent, bins) {\n super(parent);\n this.bins = bins;\n }\n clone() {\n return new BinNode(null, duplicate(this.bins));\n }\n static makeFromEncoding(parent, model) {\n const bins = model.reduceFieldDef((binComponentIndex, fieldDef, channel) => {\n if (isTypedFieldDef(fieldDef) && isBinning(fieldDef.bin)) {\n const { key, binComponent } = createBinComponent(fieldDef, fieldDef.bin, model);\n binComponentIndex[key] = Object.assign(Object.assign(Object.assign({}, binComponent), binComponentIndex[key]), rangeFormula(model, fieldDef, channel, model.config));\n }\n return binComponentIndex;\n }, {});\n if (isEmpty(bins)) {\n return null;\n }\n return new BinNode(parent, bins);\n }\n /**\n * Creates a bin node from BinTransform.\n * The optional parameter should provide\n */\n static makeFromTransform(parent, t, model) {\n const { key, binComponent } = createBinComponent(t, t.bin, model);\n return new BinNode(parent, {\n [key]: binComponent\n });\n }\n /**\n * Merge bin nodes. This method either integrates the bin config from the other node\n * or if this node already has a bin config, renames the corresponding signal in the model.\n */\n merge(other, renameSignal) {\n for (const key of keys(other.bins)) {\n if (key in this.bins) {\n renameSignal(other.bins[key].signal, this.bins[key].signal);\n // Ensure that we don't have duplicate names for signal pairs\n this.bins[key].as = unique([...this.bins[key].as, ...other.bins[key].as], hash);\n }\n else {\n this.bins[key] = other.bins[key];\n }\n }\n for (const child of other.children) {\n other.removeChild(child);\n child.parent = this;\n }\n other.remove();\n }\n producedFields() {\n return new Set(vals(this.bins)\n .map(c => c.as)\n .flat(2));\n }\n dependentFields() {\n return new Set(vals(this.bins).map(c => c.field));\n }\n hash() {\n return `Bin ${hash(this.bins)}`;\n }\n assemble() {\n return vals(this.bins).flatMap(bin => {\n const transform = [];\n const [binAs, ...remainingAs] = bin.as;\n const _a = bin.bin, { extent } = _a, params = __rest(_a, [\"extent\"]);\n const binTrans = Object.assign(Object.assign(Object.assign({ type: 'bin', field: replacePathInField(bin.field), as: binAs, signal: bin.signal }, (!isSelectionExtent(extent) ? { extent } : { extent: null })), (bin.span ? { span: { signal: `span(${bin.span})` } } : {})), params);\n if (!extent && bin.extentSignal) {\n transform.push({\n type: 'extent',\n field: replacePathInField(bin.field),\n signal: bin.extentSignal\n });\n binTrans.extent = { signal: bin.extentSignal };\n }\n transform.push(binTrans);\n for (const as of remainingAs) {\n for (let i = 0; i < 2; i++) {\n transform.push({\n type: 'formula',\n expr: vgField({ field: binAs[i] }, { expr: 'datum' }),\n as: as[i]\n });\n }\n }\n if (bin.formula) {\n transform.push({\n type: 'formula',\n expr: bin.formula,\n as: bin.formulaAs\n });\n }\n return transform;\n });\n }\n}\n//# sourceMappingURL=bin.js.map","import { isArgmaxDef, isArgminDef } from '../../aggregate';\nimport { getPositionChannelFromLatLong, getSecondaryRangeChannel, isGeoPositionChannel, isScaleChannel } from '../../channel';\nimport { binRequiresRange, hasBand, isTypedFieldDef, vgField } from '../../channeldef';\nimport * as log from '../../log';\nimport { duplicate, hash, keys, replacePathInField, setEqual } from '../../util';\nimport { isUnitModel } from '../model';\nimport { DataFlowNode } from './dataflow';\nfunction addDimension(dims, channel, fieldDef, model) {\n const channelDef2 = isUnitModel(model) ? model.encoding[getSecondaryRangeChannel(channel)] : undefined;\n if (isTypedFieldDef(fieldDef) &&\n isUnitModel(model) &&\n hasBand(channel, fieldDef, channelDef2, model.stack, model.markDef, model.config)) {\n dims.add(vgField(fieldDef, {}));\n dims.add(vgField(fieldDef, { suffix: 'end' }));\n if (fieldDef.bin && binRequiresRange(fieldDef, channel)) {\n dims.add(vgField(fieldDef, { binSuffix: 'range' }));\n }\n }\n else if (isGeoPositionChannel(channel)) {\n const posChannel = getPositionChannelFromLatLong(channel);\n dims.add(model.getName(posChannel));\n }\n else {\n dims.add(vgField(fieldDef));\n }\n return dims;\n}\nfunction mergeMeasures(parentMeasures, childMeasures) {\n var _a;\n for (const field of keys(childMeasures)) {\n // when we merge a measure, we either have to add an aggregation operator or even a new field\n const ops = childMeasures[field];\n for (const op of keys(ops)) {\n if (field in parentMeasures) {\n // add operator to existing measure field\n parentMeasures[field][op] = new Set([...((_a = parentMeasures[field][op]) !== null && _a !== void 0 ? _a : []), ...ops[op]]);\n }\n else {\n parentMeasures[field] = { [op]: ops[op] };\n }\n }\n }\n}\nexport class AggregateNode extends DataFlowNode {\n /**\n * @param dimensions string set for dimensions\n * @param measures dictionary mapping field name => dict of aggregation functions and names to use\n */\n constructor(parent, dimensions, measures) {\n super(parent);\n this.dimensions = dimensions;\n this.measures = measures;\n }\n clone() {\n return new AggregateNode(null, new Set(this.dimensions), duplicate(this.measures));\n }\n get groupBy() {\n return this.dimensions;\n }\n static makeFromEncoding(parent, model) {\n let isAggregate = false;\n model.forEachFieldDef(fd => {\n if (fd.aggregate) {\n isAggregate = true;\n }\n });\n const meas = {};\n const dims = new Set();\n if (!isAggregate) {\n // no need to create this node if the model has no aggregation\n return null;\n }\n model.forEachFieldDef((fieldDef, channel) => {\n var _a, _b, _c, _d;\n const { aggregate, field } = fieldDef;\n if (aggregate) {\n if (aggregate === 'count') {\n meas['*'] = (_a = meas['*']) !== null && _a !== void 0 ? _a : {};\n meas['*']['count'] = new Set([vgField(fieldDef, { forAs: true })]);\n }\n else {\n if (isArgminDef(aggregate) || isArgmaxDef(aggregate)) {\n const op = isArgminDef(aggregate) ? 'argmin' : 'argmax';\n const argField = aggregate[op];\n meas[argField] = (_b = meas[argField]) !== null && _b !== void 0 ? _b : {};\n meas[argField][op] = new Set([vgField({ op, field: argField }, { forAs: true })]);\n }\n else {\n meas[field] = (_c = meas[field]) !== null && _c !== void 0 ? _c : {};\n meas[field][aggregate] = new Set([vgField(fieldDef, { forAs: true })]);\n }\n // For scale channel with domain === 'unaggregated', add min/max so we can use their union as unaggregated domain\n if (isScaleChannel(channel) && model.scaleDomain(channel) === 'unaggregated') {\n meas[field] = (_d = meas[field]) !== null && _d !== void 0 ? _d : {};\n meas[field]['min'] = new Set([vgField({ field, aggregate: 'min' }, { forAs: true })]);\n meas[field]['max'] = new Set([vgField({ field, aggregate: 'max' }, { forAs: true })]);\n }\n }\n }\n else {\n addDimension(dims, channel, fieldDef, model);\n }\n });\n if (dims.size + keys(meas).length === 0) {\n return null;\n }\n return new AggregateNode(parent, dims, meas);\n }\n static makeFromTransform(parent, t) {\n var _a, _b, _c;\n const dims = new Set();\n const meas = {};\n for (const s of t.aggregate) {\n const { op, field, as } = s;\n if (op) {\n if (op === 'count') {\n meas['*'] = (_a = meas['*']) !== null && _a !== void 0 ? _a : {};\n meas['*']['count'] = new Set([as ? as : vgField(s, { forAs: true })]);\n }\n else {\n meas[field] = (_b = meas[field]) !== null && _b !== void 0 ? _b : {};\n meas[field][op] = new Set([as ? as : vgField(s, { forAs: true })]);\n }\n }\n }\n for (const s of (_c = t.groupby) !== null && _c !== void 0 ? _c : []) {\n dims.add(s);\n }\n if (dims.size + keys(meas).length === 0) {\n return null;\n }\n return new AggregateNode(parent, dims, meas);\n }\n merge(other) {\n if (setEqual(this.dimensions, other.dimensions)) {\n mergeMeasures(this.measures, other.measures);\n return true;\n }\n else {\n log.debug('different dimensions, cannot merge');\n return false;\n }\n }\n addDimensions(fields) {\n fields.forEach(this.dimensions.add, this.dimensions);\n }\n dependentFields() {\n return new Set([...this.dimensions, ...keys(this.measures)]);\n }\n producedFields() {\n const out = new Set();\n for (const field of keys(this.measures)) {\n for (const op of keys(this.measures[field])) {\n const m = this.measures[field][op];\n if (m.size === 0) {\n out.add(`${op}_${field}`);\n }\n else {\n m.forEach(out.add, out);\n }\n }\n }\n return out;\n }\n hash() {\n return `Aggregate ${hash({ dimensions: this.dimensions, measures: this.measures })}`;\n }\n assemble() {\n const ops = [];\n const fields = [];\n const as = [];\n for (const field of keys(this.measures)) {\n for (const op of keys(this.measures[field])) {\n for (const alias of this.measures[field][op]) {\n as.push(alias);\n ops.push(op);\n fields.push(field === '*' ? null : replacePathInField(field));\n }\n }\n }\n const result = {\n type: 'aggregate',\n groupby: [...this.dimensions].map(replacePathInField),\n ops,\n fields,\n as\n };\n return result;\n }\n}\n//# sourceMappingURL=aggregate.js.map","import { isArray } from 'vega-util';\nimport { isBinning } from '../../bin';\nimport { COLUMN, FACET_CHANNELS, POSITION_SCALE_CHANNELS, ROW } from '../../channel';\nimport { vgField } from '../../channeldef';\nimport * as log from '../../log';\nimport { hasDiscreteDomain } from '../../scale';\nimport { DEFAULT_SORT_OP, isSortField } from '../../sort';\nimport { hash } from '../../util';\nimport { isVgRangeStep } from '../../vega.schema';\nimport { HEADER_CHANNELS, HEADER_TYPES } from '../header/component';\nimport { assembleDomain, getFieldFromDomain } from '../scale/domain';\nimport { sortArrayIndexField } from './calculate';\nimport { DataFlowNode } from './dataflow';\n/**\n * A node that helps us track what fields we are faceting by.\n */\nexport class FacetNode extends DataFlowNode {\n /**\n * @param model The facet model.\n * @param name The name that this facet source will have.\n * @param data The source data for this facet data.\n */\n constructor(parent, model, name, data) {\n super(parent);\n this.model = model;\n this.name = name;\n this.data = data;\n for (const channel of FACET_CHANNELS) {\n const fieldDef = model.facet[channel];\n if (fieldDef) {\n const { bin, sort } = fieldDef;\n this[channel] = Object.assign({ name: model.getName(`${channel}_domain`), fields: [vgField(fieldDef), ...(isBinning(bin) ? [vgField(fieldDef, { binSuffix: 'end' })] : [])] }, (isSortField(sort)\n ? { sortField: sort }\n : isArray(sort)\n ? { sortIndexField: sortArrayIndexField(fieldDef, channel) }\n : {}));\n }\n }\n this.childModel = model.child;\n }\n hash() {\n let out = `Facet`;\n for (const channel of FACET_CHANNELS) {\n if (this[channel]) {\n out += ` ${channel.charAt(0)}:${hash(this[channel])}`;\n }\n }\n return out;\n }\n get fields() {\n var _a;\n const f = [];\n for (const channel of FACET_CHANNELS) {\n if ((_a = this[channel]) === null || _a === void 0 ? void 0 : _a.fields) {\n f.push(...this[channel].fields);\n }\n }\n return f;\n }\n dependentFields() {\n const depFields = new Set(this.fields);\n for (const channel of FACET_CHANNELS) {\n if (this[channel]) {\n if (this[channel].sortField) {\n depFields.add(this[channel].sortField.field);\n }\n if (this[channel].sortIndexField) {\n depFields.add(this[channel].sortIndexField);\n }\n }\n }\n return depFields;\n }\n producedFields() {\n return new Set(); // facet does not produce any new fields\n }\n /**\n * The name to reference this source is its name.\n */\n getSource() {\n return this.name;\n }\n getChildIndependentFieldsWithStep() {\n const childIndependentFieldsWithStep = {};\n for (const channel of POSITION_SCALE_CHANNELS) {\n const childScaleComponent = this.childModel.component.scales[channel];\n if (childScaleComponent && !childScaleComponent.merged) {\n // independent scale\n const type = childScaleComponent.get('type');\n const range = childScaleComponent.get('range');\n if (hasDiscreteDomain(type) && isVgRangeStep(range)) {\n const domain = assembleDomain(this.childModel, channel);\n const field = getFieldFromDomain(domain);\n if (field) {\n childIndependentFieldsWithStep[channel] = field;\n }\n else {\n log.warn(log.message.unknownField(channel));\n }\n }\n }\n }\n return childIndependentFieldsWithStep;\n }\n assembleRowColumnHeaderData(channel, crossedDataName, childIndependentFieldsWithStep) {\n const childChannel = { row: 'y', column: 'x' }[channel];\n const fields = [];\n const ops = [];\n const as = [];\n if (childIndependentFieldsWithStep && childIndependentFieldsWithStep[childChannel]) {\n if (crossedDataName) {\n // If there is a crossed data, calculate max\n fields.push(`distinct_${childIndependentFieldsWithStep[childChannel]}`);\n ops.push('max');\n }\n else {\n // If there is no crossed data, just calculate distinct\n fields.push(childIndependentFieldsWithStep[childChannel]);\n ops.push('distinct');\n }\n // Although it is technically a max, just name it distinct so it's easier to refer to it\n as.push(`distinct_${childIndependentFieldsWithStep[childChannel]}`);\n }\n const { sortField, sortIndexField } = this[channel];\n if (sortField) {\n const { op = DEFAULT_SORT_OP, field } = sortField;\n fields.push(field);\n ops.push(op);\n as.push(vgField(sortField, { forAs: true }));\n }\n else if (sortIndexField) {\n fields.push(sortIndexField);\n ops.push('max');\n as.push(sortIndexField);\n }\n return {\n name: this[channel].name,\n // Use data from the crossed one if it exist\n source: crossedDataName !== null && crossedDataName !== void 0 ? crossedDataName : this.data,\n transform: [\n Object.assign({ type: 'aggregate', groupby: this[channel].fields }, (fields.length\n ? {\n fields,\n ops,\n as\n }\n : {}))\n ]\n };\n }\n assembleFacetHeaderData(childIndependentFieldsWithStep) {\n var _a, _b;\n const { columns } = this.model.layout;\n const { layoutHeaders } = this.model.component;\n const data = [];\n const hasSharedAxis = {};\n for (const headerChannel of HEADER_CHANNELS) {\n for (const headerType of HEADER_TYPES) {\n const headers = (_a = (layoutHeaders[headerChannel] && layoutHeaders[headerChannel][headerType])) !== null && _a !== void 0 ? _a : [];\n for (const header of headers) {\n if (((_b = header.axes) === null || _b === void 0 ? void 0 : _b.length) > 0) {\n hasSharedAxis[headerChannel] = true;\n break;\n }\n }\n }\n if (hasSharedAxis[headerChannel]) {\n const cardinality = `length(data(\"${this.facet.name}\"))`;\n const stop = headerChannel === 'row'\n ? columns\n ? { signal: `ceil(${cardinality} / ${columns})` }\n : 1\n : columns\n ? { signal: `min(${cardinality}, ${columns})` }\n : { signal: cardinality };\n data.push({\n name: `${this.facet.name}_${headerChannel}`,\n transform: [\n {\n type: 'sequence',\n start: 0,\n stop\n }\n ]\n });\n }\n }\n const { row, column } = hasSharedAxis;\n if (row || column) {\n data.unshift(this.assembleRowColumnHeaderData('facet', null, childIndependentFieldsWithStep));\n }\n return data;\n }\n assemble() {\n var _a, _b;\n const data = [];\n let crossedDataName = null;\n const childIndependentFieldsWithStep = this.getChildIndependentFieldsWithStep();\n const { column, row, facet } = this;\n if (column && row && (childIndependentFieldsWithStep.x || childIndependentFieldsWithStep.y)) {\n // Need to create a cross dataset to correctly calculate cardinality\n crossedDataName = `cross_${this.column.name}_${this.row.name}`;\n const fields = [].concat((_a = childIndependentFieldsWithStep.x) !== null && _a !== void 0 ? _a : [], (_b = childIndependentFieldsWithStep.y) !== null && _b !== void 0 ? _b : []);\n const ops = fields.map(() => 'distinct');\n data.push({\n name: crossedDataName,\n source: this.data,\n transform: [\n {\n type: 'aggregate',\n groupby: this.fields,\n fields,\n ops\n }\n ]\n });\n }\n for (const channel of [COLUMN, ROW]) {\n if (this[channel]) {\n data.push(this.assembleRowColumnHeaderData(channel, crossedDataName, childIndependentFieldsWithStep));\n }\n }\n if (facet) {\n const facetData = this.assembleFacetHeaderData(childIndependentFieldsWithStep);\n if (facetData) {\n data.push(...facetData);\n }\n }\n return data;\n }\n}\n//# sourceMappingURL=facet.js.map","import { isNumber, isString } from 'vega-util';\nimport { isMinMaxOp } from '../../aggregate';\nimport { getMainRangeChannel } from '../../channel';\nimport { isFieldDef, isFieldOrDatumDefForTimeFormat, isScaleFieldDef, isTypedFieldDef } from '../../channeldef';\nimport { isGenerator } from '../../data';\nimport { isDateTime } from '../../datetime';\nimport * as log from '../../log';\nimport { forEachLeaf } from '../../logical';\nimport { isPathMark } from '../../mark';\nimport { isFieldEqualPredicate, isFieldGTEPredicate, isFieldGTPredicate, isFieldLTEPredicate, isFieldLTPredicate, isFieldOneOfPredicate, isFieldPredicate, isFieldRangePredicate } from '../../predicate';\nimport { isSortField } from '../../sort';\nimport { accessPathDepth, accessPathWithDatum, duplicate, hash, keys, removePathFromField } from '../../util';\nimport { signalRefOrValue } from '../common';\nimport { isFacetModel, isUnitModel } from '../model';\nimport { Split } from '../split';\nimport { DataFlowNode } from './dataflow';\n/**\n * Remove quotes from a string.\n */\nfunction unquote(pattern) {\n if ((pattern[0] === \"'\" && pattern[pattern.length - 1] === \"'\") ||\n (pattern[0] === '\"' && pattern[pattern.length - 1] === '\"')) {\n return pattern.slice(1, -1);\n }\n return pattern;\n}\n/**\n * @param field The field.\n * @param parse What to parse the field as.\n */\nfunction parseExpression(field, parse) {\n const f = accessPathWithDatum(field);\n if (parse === 'number') {\n return `toNumber(${f})`;\n }\n else if (parse === 'boolean') {\n return `toBoolean(${f})`;\n }\n else if (parse === 'string') {\n return `toString(${f})`;\n }\n else if (parse === 'date') {\n return `toDate(${f})`;\n }\n else if (parse === 'flatten') {\n return f;\n }\n else if (parse.indexOf('date:') === 0) {\n const specifier = unquote(parse.slice(5, parse.length));\n return `timeParse(${f},'${specifier}')`;\n }\n else if (parse.indexOf('utc:') === 0) {\n const specifier = unquote(parse.slice(4, parse.length));\n return `utcParse(${f},'${specifier}')`;\n }\n else {\n log.warn(log.message.unrecognizedParse(parse));\n return null;\n }\n}\nexport function getImplicitFromFilterTransform(transform) {\n const implicit = {};\n forEachLeaf(transform.filter, filter => {\n var _a;\n if (isFieldPredicate(filter)) {\n // Automatically add a parse node for filters with filter objects\n let val = null;\n // For EqualFilter, just use the equal property.\n // For RangeFilter and OneOfFilter, all array members should have\n // the same type, so we only use the first one.\n if (isFieldEqualPredicate(filter)) {\n val = signalRefOrValue(filter.equal);\n }\n else if (isFieldLTEPredicate(filter)) {\n val = signalRefOrValue(filter.lte);\n }\n else if (isFieldLTPredicate(filter)) {\n val = signalRefOrValue(filter.lt);\n }\n else if (isFieldGTPredicate(filter)) {\n val = signalRefOrValue(filter.gt);\n }\n else if (isFieldGTEPredicate(filter)) {\n val = signalRefOrValue(filter.gte);\n }\n else if (isFieldRangePredicate(filter)) {\n val = filter.range[0];\n }\n else if (isFieldOneOfPredicate(filter)) {\n val = ((_a = filter.oneOf) !== null && _a !== void 0 ? _a : filter['in'])[0];\n } // else -- for filter expression, we can't infer anything\n if (val) {\n if (isDateTime(val)) {\n implicit[filter.field] = 'date';\n }\n else if (isNumber(val)) {\n implicit[filter.field] = 'number';\n }\n else if (isString(val)) {\n implicit[filter.field] = 'string';\n }\n }\n if (filter.timeUnit) {\n implicit[filter.field] = 'date';\n }\n }\n });\n return implicit;\n}\n/**\n * Creates a parse node for implicit parsing from a model and updates ancestorParse.\n */\nexport function getImplicitFromEncoding(model) {\n const implicit = {};\n function add(fieldDef) {\n if (isFieldOrDatumDefForTimeFormat(fieldDef)) {\n implicit[fieldDef.field] = 'date';\n }\n else if (fieldDef.type === 'quantitative' &&\n isMinMaxOp(fieldDef.aggregate) // we need to parse numbers to support correct min and max\n ) {\n implicit[fieldDef.field] = 'number';\n }\n else if (accessPathDepth(fieldDef.field) > 1) {\n // For non-date/non-number (strings and booleans), derive a flattened field for a referenced nested field.\n // (Parsing numbers / dates already flattens numeric and temporal fields.)\n if (!(fieldDef.field in implicit)) {\n implicit[fieldDef.field] = 'flatten';\n }\n }\n else if (isScaleFieldDef(fieldDef) && isSortField(fieldDef.sort) && accessPathDepth(fieldDef.sort.field) > 1) {\n // Flatten fields that we sort by but that are not otherwise flattened.\n if (!(fieldDef.sort.field in implicit)) {\n implicit[fieldDef.sort.field] = 'flatten';\n }\n }\n }\n if (isUnitModel(model) || isFacetModel(model)) {\n // Parse encoded fields\n model.forEachFieldDef((fieldDef, channel) => {\n if (isTypedFieldDef(fieldDef)) {\n add(fieldDef);\n }\n else {\n const mainChannel = getMainRangeChannel(channel);\n const mainFieldDef = model.fieldDef(mainChannel);\n add(Object.assign(Object.assign({}, fieldDef), { type: mainFieldDef.type }));\n }\n });\n }\n // Parse quantitative dimension fields of path marks as numbers so that we sort them correctly.\n if (isUnitModel(model)) {\n const { mark, markDef, encoding } = model;\n if (isPathMark(mark) &&\n // No need to sort by dimension if we have a connected scatterplot (order channel is present)\n !model.encoding.order) {\n const dimensionChannel = markDef.orient === 'horizontal' ? 'y' : 'x';\n const dimensionChannelDef = encoding[dimensionChannel];\n if (isFieldDef(dimensionChannelDef) &&\n dimensionChannelDef.type === 'quantitative' &&\n !(dimensionChannelDef.field in implicit)) {\n implicit[dimensionChannelDef.field] = 'number';\n }\n }\n }\n return implicit;\n}\n/**\n * Creates a parse node for implicit parsing from a model and updates ancestorParse.\n */\nexport function getImplicitFromSelection(model) {\n const implicit = {};\n if (isUnitModel(model) && model.component.selection) {\n for (const name of keys(model.component.selection)) {\n const selCmpt = model.component.selection[name];\n for (const proj of selCmpt.project.items) {\n if (!proj.channel && accessPathDepth(proj.field) > 1) {\n implicit[proj.field] = 'flatten';\n }\n }\n }\n }\n return implicit;\n}\nexport class ParseNode extends DataFlowNode {\n constructor(parent, parse) {\n super(parent);\n this._parse = parse;\n }\n clone() {\n return new ParseNode(null, duplicate(this._parse));\n }\n hash() {\n return `Parse ${hash(this._parse)}`;\n }\n /**\n * Creates a parse node from a data.format.parse and updates ancestorParse.\n */\n static makeExplicit(parent, model, ancestorParse) {\n // Custom parse\n let explicit = {};\n const data = model.data;\n if (!isGenerator(data) && data && data.format && data.format.parse) {\n explicit = data.format.parse;\n }\n return this.makeWithAncestors(parent, explicit, {}, ancestorParse);\n }\n /**\n * Creates a parse node from \"explicit\" parse and \"implicit\" parse and updates ancestorParse.\n */\n static makeWithAncestors(parent, explicit, implicit, ancestorParse) {\n // We should not parse what has already been parsed in a parent (explicitly or implicitly) or what has been derived (maked as \"derived\"). We also don't need to flatten a field that has already been parsed.\n for (const field of keys(implicit)) {\n const parsedAs = ancestorParse.getWithExplicit(field);\n if (parsedAs.value !== undefined) {\n // We always ignore derived fields even if they are implicitly defined because we expect users to create the right types.\n if (parsedAs.explicit ||\n parsedAs.value === implicit[field] ||\n parsedAs.value === 'derived' ||\n implicit[field] === 'flatten') {\n delete implicit[field];\n }\n else {\n log.warn(log.message.differentParse(field, implicit[field], parsedAs.value));\n }\n }\n }\n for (const field of keys(explicit)) {\n const parsedAs = ancestorParse.get(field);\n if (parsedAs !== undefined) {\n // Don't parse a field again if it has been parsed with the same type already.\n if (parsedAs === explicit[field]) {\n delete explicit[field];\n }\n else {\n log.warn(log.message.differentParse(field, explicit[field], parsedAs));\n }\n }\n }\n const parse = new Split(explicit, implicit);\n // add the format parse from this model so that children don't parse the same field again\n ancestorParse.copyAll(parse);\n // copy only non-null parses\n const p = {};\n for (const key of keys(parse.combine())) {\n const val = parse.get(key);\n if (val !== null) {\n p[key] = val;\n }\n }\n if (keys(p).length === 0 || ancestorParse.parseNothing) {\n return null;\n }\n return new ParseNode(parent, p);\n }\n get parse() {\n return this._parse;\n }\n merge(other) {\n this._parse = Object.assign(Object.assign({}, this._parse), other.parse);\n other.remove();\n }\n /**\n * Assemble an object for Vega's format.parse property.\n */\n assembleFormatParse() {\n const formatParse = {};\n for (const field of keys(this._parse)) {\n const p = this._parse[field];\n if (accessPathDepth(field) === 1) {\n formatParse[field] = p;\n }\n }\n return formatParse;\n }\n // format parse depends and produces all fields in its parse\n producedFields() {\n return new Set(keys(this._parse));\n }\n dependentFields() {\n return new Set(keys(this._parse));\n }\n assembleTransforms(onlyNested = false) {\n return keys(this._parse)\n .filter(field => (onlyNested ? accessPathDepth(field) > 1 : true))\n .map(field => {\n const expr = parseExpression(field, this._parse[field]);\n if (!expr) {\n return null;\n }\n const formula = {\n type: 'formula',\n expr,\n as: removePathFromField(field) // Vega output is always flattened\n };\n return formula;\n })\n .filter(t => t !== null);\n }\n}\n//# sourceMappingURL=formatparse.js.map","import { SELECTION_ID } from '../../selection';\nimport { DataFlowNode } from './dataflow';\nexport class IdentifierNode extends DataFlowNode {\n clone() {\n return new IdentifierNode(null);\n }\n constructor(parent) {\n super(parent);\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return new Set([SELECTION_ID]);\n }\n hash() {\n return 'Identifier';\n }\n assemble() {\n return { type: 'identifier', as: SELECTION_ID };\n }\n}\n//# sourceMappingURL=identifier.js.map","import { hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class GraticuleNode extends DataFlowNode {\n constructor(parent, params) {\n super(parent);\n this.params = params;\n }\n clone() {\n return new GraticuleNode(null, this.params);\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return undefined; // there should never be a node before graticule\n }\n hash() {\n return `Graticule ${hash(this.params)}`;\n }\n assemble() {\n return Object.assign({ type: 'graticule' }, (this.params === true ? {} : this.params));\n }\n}\n//# sourceMappingURL=graticule.js.map","import { hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class SequenceNode extends DataFlowNode {\n constructor(parent, params) {\n super(parent);\n this.params = params;\n }\n clone() {\n return new SequenceNode(null, this.params);\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n var _a;\n return new Set([(_a = this.params.as) !== null && _a !== void 0 ? _a : 'data']);\n }\n hash() {\n return `Hash ${hash(this.params)}`;\n }\n assemble() {\n return Object.assign({ type: 'sequence' }, this.params);\n }\n}\n//# sourceMappingURL=sequence.js.map","import { isGenerator, isInlineData, isNamedData, isSphereGenerator, isUrlData } from '../../data';\nimport { contains, isEmpty, omit } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class SourceNode extends DataFlowNode {\n constructor(data) {\n super(null); // source cannot have parent\n data = data !== null && data !== void 0 ? data : { name: 'source' };\n let format;\n if (!isGenerator(data)) {\n format = data.format ? Object.assign({}, omit(data.format, ['parse'])) : {};\n }\n if (isInlineData(data)) {\n this._data = { values: data.values };\n }\n else if (isUrlData(data)) {\n this._data = { url: data.url };\n if (!format.type) {\n // Extract extension from URL using snippet from\n // http://stackoverflow.com/questions/680929/how-to-extract-extension-from-filename-string-in-javascript\n let defaultExtension = /(?:\\.([^.]+))?$/.exec(data.url)[1];\n if (!contains(['json', 'csv', 'tsv', 'dsv', 'topojson'], defaultExtension)) {\n defaultExtension = 'json';\n }\n // defaultExtension has type string but we ensure that it is DataFormatType above\n format.type = defaultExtension;\n }\n }\n else if (isSphereGenerator(data)) {\n // hardwire GeoJSON sphere data into output specification\n this._data = { values: [{ type: 'Sphere' }] };\n }\n else if (isNamedData(data) || isGenerator(data)) {\n this._data = {};\n }\n // set flag to check if generator\n this._generator = isGenerator(data);\n // any dataset can be named\n if (data.name) {\n this._name = data.name;\n }\n if (format && !isEmpty(format)) {\n this._data.format = format;\n }\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return undefined; // we don't know what this source produces\n }\n get data() {\n return this._data;\n }\n hasName() {\n return !!this._name;\n }\n get isGenerator() {\n return this._generator;\n }\n get dataName() {\n return this._name;\n }\n set dataName(name) {\n this._name = name;\n }\n set parent(parent) {\n throw new Error('Source nodes have to be roots.');\n }\n remove() {\n throw new Error('Source nodes are roots and cannot be removed.');\n }\n hash() {\n throw new Error('Cannot hash sources');\n }\n assemble() {\n return Object.assign(Object.assign({ name: this._name }, this._data), { transform: [] });\n }\n}\n//# sourceMappingURL=source.js.map","var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n privateMap.set(receiver, value);\n return value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n return privateMap.get(receiver);\n};\nvar _modified;\nimport { GraticuleNode } from './graticule';\nimport { SequenceNode } from './sequence';\nimport { SourceNode } from './source';\n/**\n * Whether this dataflow node is the source of the dataflow that produces data i.e. a source or a generator.\n */\nexport function isDataSourceNode(node) {\n return node instanceof SourceNode || node instanceof GraticuleNode || node instanceof SequenceNode;\n}\n/**\n * Abstract base class for Dataflow optimizers.\n * Contains only mutation handling logic. Subclasses need to implement iteration logic.\n */\nexport class Optimizer {\n constructor() {\n _modified.set(this, void 0);\n __classPrivateFieldSet(this, _modified, false);\n }\n // Once true, #modified is never set to false\n setModified() {\n __classPrivateFieldSet(this, _modified, true);\n }\n get modifiedFlag() {\n return __classPrivateFieldGet(this, _modified);\n }\n}\n_modified = new WeakMap();\n/**\n * Starts from a node and runs the optimization function (the \"run\" method) upwards to the root,\n * depending on the continue and modified flag values returned by the optimization function.\n */\nexport class BottomUpOptimizer extends Optimizer {\n /**\n * Compute a map of node depths that we can use to determine a topological sort order.\n */\n getNodeDepths(node, depth, depths) {\n depths.set(node, depth);\n for (const child of node.children) {\n this.getNodeDepths(child, depth + 1, depths);\n }\n return depths;\n }\n /**\n * Run the optimizer on all nodes starting from the leaves.\n */\n optimize(node) {\n const depths = this.getNodeDepths(node, 0, new Map());\n const topologicalSort = [...depths.entries()].sort((a, b) => b[1] - a[1]);\n for (const tuple of topologicalSort) {\n this.run(tuple[0]);\n }\n return this.modifiedFlag;\n }\n}\n/**\n * The optimizer function (the \"run\" method), is invoked on the given node and then continues recursively.\n */\nexport class TopDownOptimizer extends Optimizer {\n /**\n * Run the optimizer depth first on all nodes starting from the roots.\n */\n optimize(node) {\n this.run(node);\n for (const child of node.children) {\n this.optimize(child);\n }\n return this.modifiedFlag;\n }\n}\n//# sourceMappingURL=optimizer.js.map","import { fieldIntersection, hash, hasIntersection, isEmpty, keys, some } from '../../util';\nimport { requiresSelectionId } from '../selection';\nimport { AggregateNode } from './aggregate';\nimport { BinNode } from './bin';\nimport { OutputNode } from './dataflow';\nimport { FacetNode } from './facet';\nimport { FilterNode } from './filter';\nimport { ParseNode } from './formatparse';\nimport { IdentifierNode } from './identifier';\nimport { BottomUpOptimizer, isDataSourceNode, Optimizer, TopDownOptimizer } from './optimizer';\nimport { SourceNode } from './source';\nimport { TimeUnitNode } from './timeunit';\n/**\n * Merge identical nodes at forks by comparing hashes.\n *\n * Does not need to iterate from leaves so we implement this with recursion as it's a bit simpler.\n */\nexport class MergeIdenticalNodes extends TopDownOptimizer {\n mergeNodes(parent, nodes) {\n const mergedNode = nodes.shift();\n for (const node of nodes) {\n parent.removeChild(node);\n node.parent = mergedNode;\n node.remove();\n }\n }\n run(node) {\n const hashes = node.children.map(x => x.hash());\n const buckets = {};\n for (let i = 0; i < hashes.length; i++) {\n if (buckets[hashes[i]] === undefined) {\n buckets[hashes[i]] = [node.children[i]];\n }\n else {\n buckets[hashes[i]].push(node.children[i]);\n }\n }\n for (const k of keys(buckets)) {\n if (buckets[k].length > 1) {\n this.setModified();\n this.mergeNodes(node, buckets[k]);\n }\n }\n }\n}\n/**\n * Optimizer that removes identifier nodes that are not needed for selections.\n */\nexport class RemoveUnnecessaryIdentifierNodes extends TopDownOptimizer {\n constructor(model) {\n super();\n this.requiresSelectionId = model && requiresSelectionId(model);\n }\n run(node) {\n if (node instanceof IdentifierNode) {\n // Only preserve IdentifierNodes if we have default discrete selections\n // in our model tree, and if the nodes come after tuple producing nodes.\n if (!(this.requiresSelectionId &&\n (isDataSourceNode(node.parent) || node.parent instanceof AggregateNode || node.parent instanceof ParseNode))) {\n this.setModified();\n node.remove();\n }\n }\n }\n}\n/**\n * Removes duplicate time unit nodes (as determined by the name of the output field) that may be generated due to\n * selections projected over time units. Only keeps the first time unit in any branch.\n *\n * This optimizer is a custom top down optimizer that keep track of produced fields in a branch.\n */\nexport class RemoveDuplicateTimeUnits extends Optimizer {\n optimize(node) {\n this.run(node, new Set());\n return this.modifiedFlag;\n }\n run(node, timeUnitFields) {\n let producedFields = new Set();\n if (node instanceof TimeUnitNode) {\n producedFields = node.producedFields();\n if (hasIntersection(producedFields, timeUnitFields)) {\n this.setModified();\n node.removeFormulas(timeUnitFields);\n if (node.producedFields.length === 0) {\n node.remove();\n }\n }\n }\n for (const child of node.children) {\n this.run(child, new Set([...timeUnitFields, ...producedFields]));\n }\n }\n}\n/**\n * Remove output nodes that are not required.\n */\nexport class RemoveUnnecessaryOutputNodes extends TopDownOptimizer {\n constructor() {\n super();\n }\n run(node) {\n if (node instanceof OutputNode && !node.isRequired()) {\n this.setModified();\n node.remove();\n }\n }\n}\n/**\n * Move parse nodes up to forks and merges them if possible.\n */\nexport class MoveParseUp extends BottomUpOptimizer {\n run(node) {\n if (isDataSourceNode(node)) {\n return;\n }\n if (node.numChildren() > 1) {\n // Don't move parse further up but continue with parent.\n return;\n }\n for (const child of node.children) {\n if (child instanceof ParseNode) {\n if (node instanceof ParseNode) {\n this.setModified();\n node.merge(child);\n }\n else {\n // Don't swap with nodes that produce something that the parse node depends on (e.g. lookup).\n if (fieldIntersection(node.producedFields(), child.dependentFields())) {\n continue;\n }\n this.setModified();\n child.swapWithParent();\n }\n }\n }\n return;\n }\n}\n/**\n * Inserts an intermediate ParseNode containing all non-conflicting parse fields and removes the empty ParseNodes.\n *\n * We assume that dependent paths that do not have a parse node can be just merged.\n */\nexport class MergeParse extends BottomUpOptimizer {\n run(node) {\n const originalChildren = [...node.children];\n const parseChildren = node.children.filter((child) => child instanceof ParseNode);\n if (node.numChildren() > 1 && parseChildren.length >= 1) {\n const commonParse = {};\n const conflictingParse = new Set();\n for (const parseNode of parseChildren) {\n const parse = parseNode.parse;\n for (const k of keys(parse)) {\n if (!(k in commonParse)) {\n commonParse[k] = parse[k];\n }\n else if (commonParse[k] !== parse[k]) {\n conflictingParse.add(k);\n }\n }\n }\n for (const field of conflictingParse) {\n delete commonParse[field];\n }\n if (!isEmpty(commonParse)) {\n this.setModified();\n const mergedParseNode = new ParseNode(node, commonParse);\n for (const childNode of originalChildren) {\n if (childNode instanceof ParseNode) {\n for (const key of keys(commonParse)) {\n delete childNode.parse[key];\n }\n }\n node.removeChild(childNode);\n childNode.parent = mergedParseNode;\n // remove empty parse nodes\n if (childNode instanceof ParseNode && keys(childNode.parse).length === 0) {\n childNode.remove();\n }\n }\n }\n }\n }\n}\n/**\n * Repeatedly remove leaf nodes that are not output or facet nodes.\n * The reason is that we don't need subtrees that don't have any output nodes.\n * Facet nodes are needed for the row or column domains.\n */\nexport class RemoveUnusedSubtrees extends BottomUpOptimizer {\n run(node) {\n if (node instanceof OutputNode || node.numChildren() > 0 || node instanceof FacetNode) {\n // no need to continue with parent because it is output node or will have children (there was a fork)\n }\n else if (node instanceof SourceNode) {\n // ignore empty unused sources as they will be removed in optimizationDataflowHelper\n }\n else {\n this.setModified();\n node.remove();\n }\n }\n}\n/**\n * Merge adjacent time unit nodes.\n */\nexport class MergeTimeUnits extends BottomUpOptimizer {\n run(node) {\n const timeUnitChildren = node.children.filter((x) => x instanceof TimeUnitNode);\n const combination = timeUnitChildren.pop();\n for (const timeUnit of timeUnitChildren) {\n this.setModified();\n combination.merge(timeUnit);\n }\n }\n}\nexport class MergeAggregates extends BottomUpOptimizer {\n run(node) {\n const aggChildren = node.children.filter((child) => child instanceof AggregateNode);\n // Object which we'll use to map the fields which an aggregate is grouped by to\n // the set of aggregates with that grouping. This is useful as only aggregates\n // with the same group by can be merged\n const groupedAggregates = {};\n // Build groupedAggregates\n for (const agg of aggChildren) {\n const groupBys = hash(agg.groupBy);\n if (!(groupBys in groupedAggregates)) {\n groupedAggregates[groupBys] = [];\n }\n groupedAggregates[groupBys].push(agg);\n }\n // Merge aggregateNodes with same key in groupedAggregates\n for (const group of keys(groupedAggregates)) {\n const mergeableAggs = groupedAggregates[group];\n if (mergeableAggs.length > 1) {\n const mergedAggs = mergeableAggs.pop();\n for (const agg of mergeableAggs) {\n if (mergedAggs.merge(agg)) {\n node.removeChild(agg);\n agg.parent = mergedAggs;\n agg.remove();\n this.setModified();\n }\n }\n }\n }\n }\n}\n/**\n * Merge bin nodes and move them up through forks. Stop at filters, parse, identifier as we want them to stay before the bin node.\n */\nexport class MergeBins extends BottomUpOptimizer {\n constructor(model) {\n super();\n this.model = model;\n }\n run(node) {\n const moveBinsUp = !(isDataSourceNode(node) ||\n node instanceof FilterNode ||\n node instanceof ParseNode ||\n node instanceof IdentifierNode);\n const promotableBins = [];\n const remainingBins = [];\n for (const child of node.children) {\n if (child instanceof BinNode) {\n if (moveBinsUp && !fieldIntersection(node.producedFields(), child.dependentFields())) {\n promotableBins.push(child);\n }\n else {\n remainingBins.push(child);\n }\n }\n }\n if (promotableBins.length > 0) {\n const promotedBin = promotableBins.pop();\n for (const bin of promotableBins) {\n promotedBin.merge(bin, this.model.renameSignal.bind(this.model));\n }\n this.setModified();\n if (node instanceof BinNode) {\n node.merge(promotedBin, this.model.renameSignal.bind(this.model));\n }\n else {\n promotedBin.swapWithParent();\n }\n }\n if (remainingBins.length > 1) {\n const remainingBin = remainingBins.pop();\n for (const bin of remainingBins) {\n remainingBin.merge(bin, this.model.renameSignal.bind(this.model));\n }\n this.setModified();\n }\n }\n}\n/**\n * This optimizer takes output nodes that are at a fork and moves them before the fork.\n *\n * The algorithm iterates over the children and tries to find the last output node in a chain of output nodes.\n * It then moves all output nodes before that main output node. All other children (and the children of the output nodes)\n * are inserted after the main output node.\n */\nexport class MergeOutputs extends BottomUpOptimizer {\n run(node) {\n const children = [...node.children];\n const hasOutputChild = some(children, child => child instanceof OutputNode);\n if (!hasOutputChild || node.numChildren() <= 1) {\n return;\n }\n const otherChildren = [];\n // The output node we will connect all other nodes to.\n // Output nodes will be added before the new node, other nodes after.\n let mainOutput;\n for (const child of children) {\n if (child instanceof OutputNode) {\n let lastOutput = child;\n while (lastOutput.numChildren() === 1) {\n const [theChild] = lastOutput.children;\n if (theChild instanceof OutputNode) {\n lastOutput = theChild;\n }\n else {\n break;\n }\n }\n otherChildren.push(...lastOutput.children);\n if (mainOutput) {\n // Move the output nodes before the mainOutput. We do this by setting\n // the parent of the first not to the parent of the main output and\n // the main output's parent to the last output.\n // note: the child is the first output\n node.removeChild(child);\n child.parent = mainOutput.parent;\n mainOutput.parent.removeChild(mainOutput);\n mainOutput.parent = lastOutput;\n this.setModified();\n }\n else {\n mainOutput = lastOutput;\n }\n }\n else {\n otherChildren.push(child);\n }\n }\n if (otherChildren.length) {\n this.setModified();\n for (const child of otherChildren) {\n child.parent.removeChild(child);\n child.parent = mainOutput;\n }\n }\n }\n}\n//# sourceMappingURL=optimizers.js.map","import { vgField } from '../../channeldef';\nimport { duplicate, hash } from '../../util';\nimport { unique } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for the join aggregate transform nodes.\n */\nexport class JoinAggregateTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new JoinAggregateTransformNode(null, duplicate(this.transform));\n }\n addDimensions(fields) {\n this.transform.groupby = unique(this.transform.groupby.concat(fields), d => d);\n }\n dependentFields() {\n const out = new Set();\n if (this.transform.groupby) {\n this.transform.groupby.forEach(out.add, out);\n }\n this.transform.joinaggregate\n .map(w => w.field)\n .filter(f => f !== undefined)\n .forEach(out.add, out);\n return out;\n }\n producedFields() {\n return new Set(this.transform.joinaggregate.map(this.getDefaultName));\n }\n getDefaultName(joinAggregateFieldDef) {\n var _a;\n return (_a = joinAggregateFieldDef.as) !== null && _a !== void 0 ? _a : vgField(joinAggregateFieldDef);\n }\n hash() {\n return `JoinAggregateTransform ${hash(this.transform)}`;\n }\n assemble() {\n const fields = [];\n const ops = [];\n const as = [];\n for (const joinaggregate of this.transform.joinaggregate) {\n ops.push(joinaggregate.op);\n as.push(this.getDefaultName(joinaggregate));\n fields.push(joinaggregate.field === undefined ? null : joinaggregate.field);\n }\n const groupby = this.transform.groupby;\n return Object.assign({ type: 'joinaggregate', as,\n ops,\n fields }, (groupby !== undefined ? { groupby } : {}));\n }\n}\n//# sourceMappingURL=joinaggregate.js.map","import { isArray, isString } from 'vega-util';\nimport { getFieldDef, isFieldDef, vgField } from '../../channeldef';\nimport { duplicate, getFirstDefined, hash } from '../../util';\nimport { sortParams } from '../common';\nimport { DataFlowNode } from './dataflow';\nfunction getStackByFields(model) {\n return model.stack.stackBy.reduce((fields, by) => {\n const fieldDef = by.fieldDef;\n const _field = vgField(fieldDef);\n if (_field) {\n fields.push(_field);\n }\n return fields;\n }, []);\n}\nfunction isValidAsArray(as) {\n return isArray(as) && as.every(s => isString(s)) && as.length > 1;\n}\nexport class StackNode extends DataFlowNode {\n constructor(parent, stack) {\n super(parent);\n this._stack = stack;\n }\n clone() {\n return new StackNode(null, duplicate(this._stack));\n }\n static makeFromTransform(parent, stackTransform) {\n const { stack, groupby, as, offset = 'zero' } = stackTransform;\n const sortFields = [];\n const sortOrder = [];\n if (stackTransform.sort !== undefined) {\n for (const sortField of stackTransform.sort) {\n sortFields.push(sortField.field);\n sortOrder.push(getFirstDefined(sortField.order, 'ascending'));\n }\n }\n const sort = {\n field: sortFields,\n order: sortOrder\n };\n let normalizedAs;\n if (isValidAsArray(as)) {\n normalizedAs = as;\n }\n else if (isString(as)) {\n normalizedAs = [as, as + '_end'];\n }\n else {\n normalizedAs = [stackTransform.stack + '_start', stackTransform.stack + '_end'];\n }\n return new StackNode(parent, {\n stackField: stack,\n groupby,\n offset,\n sort,\n facetby: [],\n as: normalizedAs\n });\n }\n static makeFromEncoding(parent, model) {\n const stackProperties = model.stack;\n const { encoding } = model;\n if (!stackProperties) {\n return null;\n }\n const { groupbyChannel, fieldChannel, offset, impute } = stackProperties;\n let dimensionFieldDef;\n if (groupbyChannel) {\n const cDef = encoding[groupbyChannel];\n dimensionFieldDef = getFieldDef(cDef); // Fair to cast as groupByChannel is always either x or y\n }\n const stackby = getStackByFields(model);\n const orderDef = model.encoding.order;\n let sort;\n if (isArray(orderDef) || isFieldDef(orderDef)) {\n sort = sortParams(orderDef);\n }\n else {\n // default = descending by stackFields\n // FIXME is the default here correct for binned fields?\n sort = stackby.reduce((s, field) => {\n s.field.push(field);\n s.order.push(fieldChannel === 'y' ? 'descending' : 'ascending');\n return s;\n }, { field: [], order: [] });\n }\n return new StackNode(parent, {\n dimensionFieldDef,\n stackField: model.vgField(fieldChannel),\n facetby: [],\n stackby,\n sort,\n offset,\n impute,\n as: [\n model.vgField(fieldChannel, { suffix: 'start', forAs: true }),\n model.vgField(fieldChannel, { suffix: 'end', forAs: true })\n ]\n });\n }\n get stack() {\n return this._stack;\n }\n addDimensions(fields) {\n this._stack.facetby.push(...fields);\n }\n dependentFields() {\n const out = new Set();\n out.add(this._stack.stackField);\n this.getGroupbyFields().forEach(out.add, out);\n this._stack.facetby.forEach(out.add, out);\n this._stack.sort.field.forEach(out.add, out);\n return out;\n }\n producedFields() {\n return new Set(this._stack.as);\n }\n hash() {\n return `Stack ${hash(this._stack)}`;\n }\n getGroupbyFields() {\n const { dimensionFieldDef, impute, groupby } = this._stack;\n if (dimensionFieldDef) {\n if (dimensionFieldDef.bin) {\n if (impute) {\n // For binned group by field with impute, we calculate bin_mid\n // as we cannot impute two fields simultaneously\n return [vgField(dimensionFieldDef, { binSuffix: 'mid' })];\n }\n return [\n // For binned group by field without impute, we need both bin (start) and bin_end\n vgField(dimensionFieldDef, {}),\n vgField(dimensionFieldDef, { binSuffix: 'end' })\n ];\n }\n return [vgField(dimensionFieldDef)];\n }\n return groupby !== null && groupby !== void 0 ? groupby : [];\n }\n assemble() {\n const transform = [];\n const { facetby, dimensionFieldDef, stackField: field, stackby, sort, offset, impute, as } = this._stack;\n // Impute\n if (impute && dimensionFieldDef) {\n const { band = 0.5, bin } = dimensionFieldDef;\n if (bin) {\n // As we can only impute one field at a time, we need to calculate\n // mid point for a binned field\n transform.push({\n type: 'formula',\n expr: `${band}*` +\n vgField(dimensionFieldDef, { expr: 'datum' }) +\n `+${1 - band}*` +\n vgField(dimensionFieldDef, { expr: 'datum', binSuffix: 'end' }),\n as: vgField(dimensionFieldDef, { binSuffix: 'mid', forAs: true })\n });\n }\n transform.push({\n type: 'impute',\n field,\n groupby: [...stackby, ...facetby],\n key: vgField(dimensionFieldDef, { binSuffix: 'mid' }),\n method: 'value',\n value: 0\n });\n }\n // Stack\n transform.push({\n type: 'stack',\n groupby: [...this.getGroupbyFields(), ...facetby],\n field,\n sort,\n as,\n offset\n });\n return transform;\n }\n}\n//# sourceMappingURL=stack.js.map","import { isAggregateOp } from '../../aggregate';\nimport { vgField } from '../../channeldef';\nimport { duplicate, hash } from '../../util';\nimport { unique } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for the window transform nodes\n */\nexport class WindowTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new WindowTransformNode(null, duplicate(this.transform));\n }\n addDimensions(fields) {\n this.transform.groupby = unique(this.transform.groupby.concat(fields), d => d);\n }\n dependentFields() {\n var _a, _b;\n const out = new Set();\n ((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : []).forEach(out.add, out);\n ((_b = this.transform.sort) !== null && _b !== void 0 ? _b : []).forEach(m => out.add(m.field));\n this.transform.window\n .map(w => w.field)\n .filter(f => f !== undefined)\n .forEach(out.add, out);\n return out;\n }\n producedFields() {\n return new Set(this.transform.window.map(this.getDefaultName));\n }\n getDefaultName(windowFieldDef) {\n var _a;\n return (_a = windowFieldDef.as) !== null && _a !== void 0 ? _a : vgField(windowFieldDef);\n }\n hash() {\n return `WindowTransform ${hash(this.transform)}`;\n }\n assemble() {\n var _a;\n const fields = [];\n const ops = [];\n const as = [];\n const params = [];\n for (const window of this.transform.window) {\n ops.push(window.op);\n as.push(this.getDefaultName(window));\n params.push(window.param === undefined ? null : window.param);\n fields.push(window.field === undefined ? null : window.field);\n }\n const frame = this.transform.frame;\n const groupby = this.transform.groupby;\n if (frame && frame[0] === null && frame[1] === null && ops.every(o => isAggregateOp(o))) {\n // when the window does not rely on any particular window ops or frame, switch to a simpler and more efficient joinaggregate\n return Object.assign({ type: 'joinaggregate', as, ops: ops, fields }, (groupby !== undefined ? { groupby } : {}));\n }\n const sortFields = [];\n const sortOrder = [];\n if (this.transform.sort !== undefined) {\n for (const sortField of this.transform.sort) {\n sortFields.push(sortField.field);\n sortOrder.push((_a = sortField.order) !== null && _a !== void 0 ? _a : 'ascending');\n }\n }\n const sort = {\n field: sortFields,\n order: sortOrder\n };\n const ignorePeers = this.transform.ignorePeers;\n return Object.assign(Object.assign(Object.assign({ type: 'window', params,\n as,\n ops,\n fields,\n sort }, (ignorePeers !== undefined ? { ignorePeers } : {})), (groupby !== undefined ? { groupby } : {})), (frame !== undefined ? { frame } : {}));\n }\n}\n//# sourceMappingURL=window.js.map","import { DataSourceType } from '../../data';\nimport { AggregateNode } from './aggregate';\nimport { OutputNode } from './dataflow';\nimport { FacetNode } from './facet';\nimport { JoinAggregateTransformNode } from './joinaggregate';\nimport { FACET_SCALE_PREFIX } from './optimize';\nimport { StackNode } from './stack';\nimport { WindowTransformNode } from './window';\n/**\n * Clones the subtree and ignores output nodes except for the leaves, which are renamed.\n */\nfunction cloneSubtree(facet) {\n function clone(node) {\n if (!(node instanceof FacetNode)) {\n const copy = node.clone();\n if (copy instanceof OutputNode) {\n const newName = FACET_SCALE_PREFIX + copy.getSource();\n copy.setSource(newName);\n facet.model.component.data.outputNodes[newName] = copy;\n }\n else if (copy instanceof AggregateNode ||\n copy instanceof StackNode ||\n copy instanceof WindowTransformNode ||\n copy instanceof JoinAggregateTransformNode) {\n copy.addDimensions(facet.fields);\n }\n for (const n of node.children.flatMap(clone)) {\n n.parent = copy;\n }\n return [copy];\n }\n return node.children.flatMap(clone);\n }\n return clone;\n}\n/**\n * Move facet nodes down to the next fork or output node. Also pull the main output with the facet node.\n * After moving down the facet node, make a copy of the subtree and make it a child of the main output.\n */\nexport function moveFacetDown(node) {\n if (node instanceof FacetNode) {\n if (node.numChildren() === 1 && !(node.children[0] instanceof OutputNode)) {\n // move down until we hit a fork or output node\n const child = node.children[0];\n if (child instanceof AggregateNode ||\n child instanceof StackNode ||\n child instanceof WindowTransformNode ||\n child instanceof JoinAggregateTransformNode) {\n child.addDimensions(node.fields);\n }\n child.swapWithParent();\n moveFacetDown(node);\n }\n else {\n // move main to facet\n const facetMain = node.model.component.data.main;\n moveMainDownToFacet(facetMain);\n // replicate the subtree and place it before the facet's main node\n const cloner = cloneSubtree(node);\n const copy = node.children.map(cloner).flat();\n for (const c of copy) {\n c.parent = facetMain;\n }\n }\n }\n else {\n node.children.map(moveFacetDown);\n }\n}\nfunction moveMainDownToFacet(node) {\n if (node instanceof OutputNode && node.type === DataSourceType.Main) {\n if (node.numChildren() === 1) {\n const child = node.children[0];\n if (!(child instanceof FacetNode)) {\n child.swapWithParent();\n moveMainDownToFacet(node);\n }\n }\n }\n}\n//# sourceMappingURL=subtree.js.map","import * as log from '../../log';\nimport * as optimizers from './optimizers';\nimport { moveFacetDown } from './subtree';\nexport const FACET_SCALE_PREFIX = 'scale_';\nexport const MAX_OPTIMIZATION_RUNS = 5;\n/**\n * Iterates over a dataflow graph and checks whether all links are consistent.\n */\nexport function checkLinks(nodes) {\n for (const node of nodes) {\n for (const child of node.children) {\n if (child.parent !== node) {\n // log.error('Dataflow graph is inconsistent.', node, child);\n return false;\n }\n }\n if (!checkLinks(node.children)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Run the specified optimizer on the provided nodes.\n *\n * @param optimizer The optimizer instance to run.\n * @param nodes A set of nodes to optimize.\n */\nfunction runOptimizer(optimizer, nodes) {\n let modified = false;\n for (const node of nodes) {\n modified = optimizer.optimize(node) || modified;\n }\n return modified;\n}\nfunction optimizationDataflowHelper(dataComponent, model, firstPass) {\n let roots = dataComponent.sources;\n let modified = false;\n modified = runOptimizer(new optimizers.RemoveUnnecessaryOutputNodes(), roots) || modified;\n modified = runOptimizer(new optimizers.RemoveUnnecessaryIdentifierNodes(model), roots) || modified;\n // remove source nodes that don't have any children because they also don't have output nodes\n roots = roots.filter(r => r.numChildren() > 0);\n modified = runOptimizer(new optimizers.RemoveUnusedSubtrees(), roots) || modified;\n roots = roots.filter(r => r.numChildren() > 0);\n if (!firstPass) {\n // Only run these optimizations after the optimizer has moved down the facet node.\n // With this change, we can be more aggressive in the optimizations.\n modified = runOptimizer(new optimizers.MoveParseUp(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeBins(model), roots) || modified;\n modified = runOptimizer(new optimizers.RemoveDuplicateTimeUnits(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeParse(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeAggregates(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeTimeUnits(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeIdenticalNodes(), roots) || modified;\n modified = runOptimizer(new optimizers.MergeOutputs(), roots) || modified;\n }\n dataComponent.sources = roots;\n return modified;\n}\n/**\n * Optimizes the dataflow of the passed in data component.\n */\nexport function optimizeDataflow(data, model) {\n // check before optimizations\n checkLinks(data.sources);\n let firstPassCounter = 0;\n let secondPassCounter = 0;\n for (let i = 0; i < MAX_OPTIMIZATION_RUNS; i++) {\n if (!optimizationDataflowHelper(data, model, true)) {\n break;\n }\n firstPassCounter++;\n }\n // move facets down and make a copy of the subtree so that we can have scales at the top level\n data.sources.map(moveFacetDown);\n for (let i = 0; i < MAX_OPTIMIZATION_RUNS; i++) {\n if (!optimizationDataflowHelper(data, model, false)) {\n break;\n }\n secondPassCounter++;\n }\n // check after optimizations\n checkLinks(data.sources);\n if (Math.max(firstPassCounter, secondPassCounter) === MAX_OPTIMIZATION_RUNS) {\n log.warn(`Maximum optimization runs(${MAX_OPTIMIZATION_RUNS}) reached.`);\n }\n}\n//# sourceMappingURL=optimize.js.map","/**\n * A class that behaves like a SignalRef but lazily generates the signal.\n * The provided generator function should use `Model.getSignalName` to use the correct signal name.\n */\nexport class SignalRefWrapper {\n constructor(exprGenerator) {\n Object.defineProperty(this, 'signal', {\n enumerable: true,\n get: exprGenerator\n });\n }\n static fromName(rename, signalName) {\n return new SignalRefWrapper(() => rename(signalName));\n }\n}\n//# sourceMappingURL=signal.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isObject, isString } from 'vega-util';\nimport { isAggregateOp, isArgmaxDef, isArgminDef, MULTIDOMAIN_SORT_OP_INDEX as UNIONDOMAIN_SORT_OP_INDEX, SHARED_DOMAIN_OP_INDEX } from '../../aggregate';\nimport { isBinning, isBinParams, isSelectionExtent } from '../../bin';\nimport { getSecondaryRangeChannel, isScaleChannel } from '../../channel';\nimport { binRequiresRange, getFieldOrDatumDef, hasBand, isDatumDef, isFieldDef, valueExpr, vgField } from '../../channeldef';\nimport { DataSourceType } from '../../data';\nimport * as log from '../../log';\nimport { hasDiscreteDomain, isDomainUnionWith, isSelectionDomain } from '../../scale';\nimport { DEFAULT_SORT_OP, isSortArray, isSortByEncoding, isSortField } from '../../sort';\nimport { normalizeTimeUnit } from '../../timeunit';\nimport * as util from '../../util';\nimport { isDataRefDomain, isDataRefUnionedDomain, isFieldRefUnionDomain, isSignalRef } from '../../vega.schema';\nimport { getBinSignalName } from '../data/bin';\nimport { sortArrayIndexField } from '../data/calculate';\nimport { FACET_SCALE_PREFIX } from '../data/optimize';\nimport { isFacetModel, isUnitModel } from '../model';\nimport { SignalRefWrapper } from '../signal';\nimport { makeExplicit, makeImplicit, mergeValuesWithExplicit } from '../split';\nexport function parseScaleDomain(model) {\n if (isUnitModel(model)) {\n parseUnitScaleDomain(model);\n }\n else {\n parseNonUnitScaleDomain(model);\n }\n}\nfunction parseUnitScaleDomain(model) {\n const localScaleComponents = model.component.scales;\n for (const channel of util.keys(localScaleComponents)) {\n const domains = parseDomainForChannel(model, channel);\n const localScaleCmpt = localScaleComponents[channel];\n localScaleCmpt.setWithExplicit('domains', domains);\n parseSelectionDomain(model, channel);\n if (model.component.data.isFaceted) {\n // get resolve from closest facet parent as this decides whether we need to refer to cloned subtree or not\n let facetParent = model;\n while (!isFacetModel(facetParent) && facetParent.parent) {\n facetParent = facetParent.parent;\n }\n const resolve = facetParent.component.resolve.scale[channel];\n if (resolve === 'shared') {\n for (const domain of domains.value) {\n // Replace the scale domain with data output from a cloned subtree after the facet.\n if (isDataRefDomain(domain)) {\n // use data from cloned subtree (which is the same as data but with a prefix added once)\n domain.data = FACET_SCALE_PREFIX + domain.data.replace(FACET_SCALE_PREFIX, '');\n }\n }\n }\n }\n }\n}\nfunction parseNonUnitScaleDomain(model) {\n for (const child of model.children) {\n parseScaleDomain(child);\n }\n const localScaleComponents = model.component.scales;\n for (const channel of util.keys(localScaleComponents)) {\n let domains;\n let selectionExtent = null;\n for (const child of model.children) {\n const childComponent = child.component.scales[channel];\n if (childComponent) {\n if (domains === undefined) {\n domains = childComponent.getWithExplicit('domains');\n }\n else {\n domains = mergeValuesWithExplicit(domains, childComponent.getWithExplicit('domains'), 'domains', 'scale', domainsTieBreaker);\n }\n const se = childComponent.get('selectionExtent');\n if (selectionExtent && se && selectionExtent.selection !== se.selection) {\n log.warn(log.message.NEEDS_SAME_SELECTION);\n }\n selectionExtent = se;\n }\n }\n localScaleComponents[channel].setWithExplicit('domains', domains);\n if (selectionExtent) {\n localScaleComponents[channel].set('selectionExtent', selectionExtent, true);\n }\n }\n}\n/**\n * Remove unaggregated domain if it is not applicable\n * Add unaggregated domain if domain is not specified and config.scale.useUnaggregatedDomain is true.\n */\nfunction normalizeUnaggregatedDomain(domain, fieldDef, scaleType, scaleConfig) {\n if (domain === 'unaggregated') {\n const { valid, reason } = canUseUnaggregatedDomain(fieldDef, scaleType);\n if (!valid) {\n log.warn(reason);\n return undefined;\n }\n }\n else if (domain === undefined && scaleConfig.useUnaggregatedDomain) {\n // Apply config if domain is not specified.\n const { valid } = canUseUnaggregatedDomain(fieldDef, scaleType);\n if (valid) {\n return 'unaggregated';\n }\n }\n return domain;\n}\nexport function parseDomainForChannel(model, channel) {\n const scaleType = model.getScaleComponent(channel).get('type');\n const { encoding } = model;\n const domain = normalizeUnaggregatedDomain(model.scaleDomain(channel), model.typedFieldDef(channel), scaleType, model.config.scale);\n if (domain !== model.scaleDomain(channel)) {\n model.specifiedScales[channel] = Object.assign(Object.assign({}, model.specifiedScales[channel]), { domain });\n }\n // If channel is either X or Y then union them with X2 & Y2 if they exist\n if (channel === 'x' && getFieldOrDatumDef(encoding.x2)) {\n if (getFieldOrDatumDef(encoding.x)) {\n return mergeValuesWithExplicit(parseSingleChannelDomain(scaleType, domain, model, 'x'), parseSingleChannelDomain(scaleType, domain, model, 'x2'), 'domain', 'scale', domainsTieBreaker);\n }\n else {\n return parseSingleChannelDomain(scaleType, domain, model, 'x2');\n }\n }\n else if (channel === 'y' && getFieldOrDatumDef(encoding.y2)) {\n if (getFieldOrDatumDef(encoding.y)) {\n return mergeValuesWithExplicit(parseSingleChannelDomain(scaleType, domain, model, 'y'), parseSingleChannelDomain(scaleType, domain, model, 'y2'), 'domain', 'scale', domainsTieBreaker);\n }\n else {\n return parseSingleChannelDomain(scaleType, domain, model, 'y2');\n }\n }\n return parseSingleChannelDomain(scaleType, domain, model, channel);\n}\nfunction mapDomainToDataSignal(domain, type, timeUnit) {\n return domain.map(v => {\n const data = valueExpr(v, { timeUnit, type });\n return { signal: `{data: ${data}}` };\n });\n}\nfunction convertDomainIfItIsDateTime(domain, type, timeUnit) {\n var _a;\n // explicit value\n const normalizedTimeUnit = (_a = normalizeTimeUnit(timeUnit)) === null || _a === void 0 ? void 0 : _a.unit;\n if (type === 'temporal' || normalizedTimeUnit) {\n return mapDomainToDataSignal(domain, type, normalizedTimeUnit);\n }\n return [domain]; // Date time won't make sense\n}\nfunction parseSingleChannelDomain(scaleType, domain, model, channel) {\n const { encoding } = model;\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n const { type } = fieldOrDatumDef;\n const timeUnit = fieldOrDatumDef['timeUnit'];\n if (isDomainUnionWith(domain)) {\n const defaultDomain = parseSingleChannelDomain(scaleType, undefined, model, channel);\n const unionWith = convertDomainIfItIsDateTime(domain.unionWith, type, timeUnit);\n return makeExplicit([...defaultDomain.value, ...unionWith]);\n }\n else if (isSignalRef(domain)) {\n return makeExplicit([domain]);\n }\n else if (domain && domain !== 'unaggregated' && !isSelectionDomain(domain)) {\n return makeExplicit(convertDomainIfItIsDateTime(domain, type, timeUnit));\n }\n const stack = model.stack;\n if (stack && channel === stack.fieldChannel) {\n if (stack.offset === 'normalize') {\n return makeImplicit([[0, 1]]);\n }\n const data = model.requestDataName(DataSourceType.Main);\n return makeImplicit([\n {\n data,\n field: model.vgField(channel, { suffix: 'start' })\n },\n {\n data,\n field: model.vgField(channel, { suffix: 'end' })\n }\n ]);\n }\n const sort = isScaleChannel(channel) && isFieldDef(fieldOrDatumDef) ? domainSort(model, channel, scaleType) : undefined;\n if (isDatumDef(fieldOrDatumDef)) {\n const d = convertDomainIfItIsDateTime([fieldOrDatumDef.datum], type, timeUnit);\n return makeImplicit(d);\n }\n const fieldDef = fieldOrDatumDef; // now we can be sure it's a fieldDef\n if (domain === 'unaggregated') {\n const data = model.requestDataName(DataSourceType.Main);\n const { field } = fieldOrDatumDef;\n return makeImplicit([\n {\n data,\n field: vgField({ field, aggregate: 'min' })\n },\n {\n data,\n field: vgField({ field, aggregate: 'max' })\n }\n ]);\n }\n else if (isBinning(fieldDef.bin)) {\n if (hasDiscreteDomain(scaleType)) {\n if (scaleType === 'bin-ordinal') {\n // we can omit the domain as it is inferred from the `bins` property\n return makeImplicit([]);\n }\n // ordinal bin scale takes domain from bin_range, ordered by bin start\n // This is useful for both axis-based scale (x/y) and legend-based scale (other channels).\n return makeImplicit([\n {\n // If sort by aggregation of a specified sort field, we need to use RAW table,\n // so we can aggregate values for the scale independently from the main aggregation.\n data: util.isBoolean(sort)\n ? model.requestDataName(DataSourceType.Main)\n : model.requestDataName(DataSourceType.Raw),\n // Use range if we added it and the scale does not support computing a range as a signal.\n field: model.vgField(channel, binRequiresRange(fieldDef, channel) ? { binSuffix: 'range' } : {}),\n // we have to use a sort object if sort = true to make the sort correct by bin start\n sort: sort === true || !isObject(sort)\n ? {\n field: model.vgField(channel, {}),\n op: 'min' // min or max doesn't matter since we sort by the start of the bin range\n }\n : sort\n }\n ]);\n }\n else {\n // continuous scales\n const { bin } = fieldDef;\n if (isBinning(bin)) {\n const binSignal = getBinSignalName(model, fieldDef.field, bin);\n return makeImplicit([\n new SignalRefWrapper(() => {\n const signal = model.getSignalName(binSignal);\n return `[${signal}.start, ${signal}.stop]`;\n })\n ]);\n }\n else {\n return makeImplicit([\n {\n data: model.requestDataName(DataSourceType.Main),\n field: model.vgField(channel, {})\n }\n ]);\n }\n }\n }\n else if (fieldDef.timeUnit &&\n util.contains(['time', 'utc'], scaleType) &&\n hasBand(channel, fieldDef, isUnitModel(model) ? model.encoding[getSecondaryRangeChannel(channel)] : undefined, model.stack, model.markDef, model.config)) {\n const data = model.requestDataName(DataSourceType.Main);\n return makeImplicit([\n {\n data,\n field: model.vgField(channel)\n },\n {\n data,\n field: model.vgField(channel, { suffix: 'end' })\n }\n ]);\n }\n else if (sort) {\n return makeImplicit([\n {\n // If sort by aggregation of a specified sort field, we need to use RAW table,\n // so we can aggregate values for the scale independently from the main aggregation.\n data: util.isBoolean(sort)\n ? model.requestDataName(DataSourceType.Main)\n : model.requestDataName(DataSourceType.Raw),\n field: model.vgField(channel),\n sort: sort\n }\n ]);\n }\n else {\n return makeImplicit([\n {\n data: model.requestDataName(DataSourceType.Main),\n field: model.vgField(channel)\n }\n ]);\n }\n}\nfunction normalizeSortField(sort, isStackedMeasure) {\n const { op, field, order } = sort;\n return Object.assign(Object.assign({ \n // Apply default op\n op: op !== null && op !== void 0 ? op : (isStackedMeasure ? 'sum' : DEFAULT_SORT_OP) }, (field ? { field: util.replacePathInField(field) } : {})), (order ? { order } : {}));\n}\nfunction parseSelectionDomain(model, channel) {\n var _a;\n const scale = model.component.scales[channel];\n const spec = model.specifiedScales[channel].domain;\n const bin = (_a = model.fieldDef(channel)) === null || _a === void 0 ? void 0 : _a.bin;\n const domain = isSelectionDomain(spec) && spec;\n const extent = isBinParams(bin) && isSelectionExtent(bin.extent) && bin.extent;\n if (domain || extent) {\n // As scale parsing occurs before selection parsing, we cannot set\n // domainRaw directly. So instead, we store the selectionExtent on\n // the scale component, and then add domainRaw during scale assembly.\n scale.set('selectionExtent', domain !== null && domain !== void 0 ? domain : extent, true);\n }\n}\nexport function domainSort(model, channel, scaleType) {\n if (!hasDiscreteDomain(scaleType)) {\n return undefined;\n }\n // save to cast as the only exception is the geojson type for shape, which would not generate a scale\n const fieldDef = model.fieldDef(channel);\n const sort = fieldDef.sort;\n // if the sort is specified with array, use the derived sort index field\n if (isSortArray(sort)) {\n return {\n op: 'min',\n field: sortArrayIndexField(fieldDef, channel),\n order: 'ascending'\n };\n }\n const { stack } = model;\n const stackDimensions = stack\n ? [...(stack.groupbyField ? [stack.groupbyField] : []), ...stack.stackBy.map(s => s.fieldDef.field)]\n : undefined;\n // Sorted based on an aggregate calculation over a specified sort field (only for ordinal scale)\n if (isSortField(sort)) {\n const isStackedMeasure = stack && !util.contains(stackDimensions, sort.field);\n return normalizeSortField(sort, isStackedMeasure);\n }\n else if (isSortByEncoding(sort)) {\n const { encoding, order } = sort;\n const fieldDefToSortBy = model.fieldDef(encoding);\n const { aggregate, field } = fieldDefToSortBy;\n const isStackedMeasure = stack && !util.contains(stackDimensions, field);\n if (isArgminDef(aggregate) || isArgmaxDef(aggregate)) {\n return normalizeSortField({\n field: vgField(fieldDefToSortBy),\n order\n }, isStackedMeasure);\n }\n else if (isAggregateOp(aggregate) || !aggregate) {\n return normalizeSortField({\n op: aggregate,\n field,\n order\n }, isStackedMeasure);\n }\n }\n else if (sort === 'descending') {\n return {\n op: 'min',\n field: model.vgField(channel),\n order: 'descending'\n };\n }\n else if (util.contains(['ascending', undefined /* default =ascending*/], sort)) {\n return true;\n }\n // sort == null\n return undefined;\n}\n/**\n * Determine if a scale can use unaggregated domain.\n * @return {Boolean} Returns true if all of the following conditions apply:\n * 1. `scale.domain` is `unaggregated`\n * 2. Aggregation function is not `count` or `sum`\n * 3. The scale is quantitative or time scale.\n */\nexport function canUseUnaggregatedDomain(fieldDef, scaleType) {\n const { aggregate, type } = fieldDef;\n if (!aggregate) {\n return {\n valid: false,\n reason: log.message.unaggregateDomainHasNoEffectForRawField(fieldDef)\n };\n }\n if (isString(aggregate) && !SHARED_DOMAIN_OP_INDEX[aggregate]) {\n return {\n valid: false,\n reason: log.message.unaggregateDomainWithNonSharedDomainOp(aggregate)\n };\n }\n if (type === 'quantitative') {\n if (scaleType === 'log') {\n return {\n valid: false,\n reason: log.message.unaggregatedDomainWithLogScale(fieldDef)\n };\n }\n }\n return { valid: true };\n}\n/**\n * Tie breaker for mergeValuesWithExplicit for domains. We concat the specified values.\n */\nfunction domainsTieBreaker(v1, v2, property, propertyOf) {\n if (v1.explicit && v2.explicit) {\n log.warn(log.message.mergeConflictingDomainProperty(property, propertyOf, v1.value, v2.value));\n }\n // If equal score, concat the domains so that we union them later.\n return { explicit: v1.explicit, value: [...v1.value, ...v2.value] };\n}\n/**\n * Converts an array of domains to a single Vega scale domain.\n */\nexport function mergeDomains(domains) {\n const uniqueDomains = util.unique(domains.map(domain => {\n // ignore sort property when computing the unique domains\n if (isDataRefDomain(domain)) {\n const { sort: _s } = domain, domainWithoutSort = __rest(domain, [\"sort\"]);\n return domainWithoutSort;\n }\n return domain;\n }), util.hash);\n const sorts = util.unique(domains\n .map(d => {\n if (isDataRefDomain(d)) {\n const s = d.sort;\n if (s !== undefined && !util.isBoolean(s)) {\n if ('op' in s && s.op === 'count') {\n // let's make sure that if op is count, we don't use a field\n delete s.field;\n }\n if (s.order === 'ascending') {\n // drop order: ascending as it is the default\n delete s.order;\n }\n }\n return s;\n }\n return undefined;\n })\n .filter(s => s !== undefined), util.hash);\n if (uniqueDomains.length === 0) {\n return undefined;\n }\n else if (uniqueDomains.length === 1) {\n const domain = domains[0];\n if (isDataRefDomain(domain) && sorts.length > 0) {\n let sort = sorts[0];\n if (sorts.length > 1) {\n log.warn(log.message.MORE_THAN_ONE_SORT);\n sort = true;\n }\n else {\n // Simplify domain sort by removing field and op when the field is the same as the domain field.\n if (isObject(sort) && 'field' in sort) {\n const sortField = sort.field;\n if (domain.field === sortField) {\n sort = sort.order ? { order: sort.order } : true;\n }\n }\n }\n return Object.assign(Object.assign({}, domain), { sort });\n }\n return domain;\n }\n // only keep sort properties that work with unioned domains\n const unionDomainSorts = util.unique(sorts.map(s => {\n if (util.isBoolean(s) || !('op' in s) || (isString(s.op) && s.op in UNIONDOMAIN_SORT_OP_INDEX)) {\n return s;\n }\n log.warn(log.message.domainSortDropped(s));\n return true;\n }), util.hash);\n let sort;\n if (unionDomainSorts.length === 1) {\n sort = unionDomainSorts[0];\n }\n else if (unionDomainSorts.length > 1) {\n log.warn(log.message.MORE_THAN_ONE_SORT);\n sort = true;\n }\n const allData = util.unique(domains.map(d => {\n if (isDataRefDomain(d)) {\n return d.data;\n }\n return null;\n }), x => x);\n if (allData.length === 1 && allData[0] !== null) {\n // create a union domain of different fields with a single data source\n const domain = Object.assign({ data: allData[0], fields: uniqueDomains.map(d => d.field) }, (sort ? { sort } : {}));\n return domain;\n }\n return Object.assign({ fields: uniqueDomains }, (sort ? { sort } : {}));\n}\n/**\n * Return a field if a scale uses a single field.\n * Return `undefined` otherwise.\n */\nexport function getFieldFromDomain(domain) {\n if (isDataRefDomain(domain) && isString(domain.field)) {\n return domain.field;\n }\n else if (isDataRefUnionedDomain(domain)) {\n let field;\n for (const nonUnionDomain of domain.fields) {\n if (isDataRefDomain(nonUnionDomain) && isString(nonUnionDomain.field)) {\n if (!field) {\n field = nonUnionDomain.field;\n }\n else if (field !== nonUnionDomain.field) {\n log.warn(log.message.FACETED_INDEPENDENT_DIFFERENT_SOURCES);\n return field;\n }\n }\n }\n log.warn(log.message.FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES);\n return field;\n }\n else if (isFieldRefUnionDomain(domain)) {\n log.warn(log.message.FACETED_INDEPENDENT_SAME_SOURCE);\n const field = domain.fields[0];\n return isString(field) ? field : undefined;\n }\n return undefined;\n}\nexport function assembleDomain(model, channel) {\n const scaleComponent = model.component.scales[channel];\n const domains = scaleComponent.get('domains').map((domain) => {\n // Correct references to data as the original domain's data was determined\n // in parseScale, which happens before parseData. Thus the original data\n // reference can be incorrect.\n if (isDataRefDomain(domain)) {\n domain.data = model.lookupDataSource(domain.data);\n }\n return domain;\n });\n // domains is an array that has to be merged into a single vega domain\n return mergeDomains(domains);\n}\n//# sourceMappingURL=domain.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isObject } from 'vega-util';\nimport { isXorY } from '../../channel';\nimport { keys } from '../../util';\nimport { isDataRefDomain, isVgRangeStep } from '../../vega.schema';\nimport { isConcatModel, isLayerModel } from '../model';\nimport { assembleSelectionScaleDomain } from '../selection/assemble';\nimport { assembleDomain } from './domain';\nexport function assembleScales(model) {\n if (isLayerModel(model) || isConcatModel(model)) {\n // For concat and layer, include scales of children too\n return model.children.reduce((scales, child) => {\n return scales.concat(assembleScales(child));\n }, assembleScalesForModel(model));\n }\n else {\n // For facet, child scales would not be included in the parent's scope.\n // For unit, there is no child.\n return assembleScalesForModel(model);\n }\n}\nexport function assembleScalesForModel(model) {\n return keys(model.component.scales).reduce((scales, channel) => {\n const scaleComponent = model.component.scales[channel];\n if (scaleComponent.merged) {\n // Skipped merged scales\n return scales;\n }\n const scale = scaleComponent.combine();\n const { name, type, selectionExtent, domains: _d, range: _r, reverse } = scale, otherScaleProps = __rest(scale, [\"name\", \"type\", \"selectionExtent\", \"domains\", \"range\", \"reverse\"]);\n const range = assembleScaleRange(scale.range, name, channel, model);\n let domainRaw;\n if (selectionExtent) {\n domainRaw = assembleSelectionScaleDomain(model, selectionExtent);\n }\n const domain = assembleDomain(model, channel);\n scales.push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ name,\n type }, (domain ? { domain } : {})), (domainRaw ? { domainRaw } : {})), { range }), (reverse !== undefined ? { reverse: reverse } : {})), otherScaleProps));\n return scales;\n }, []);\n}\nexport function assembleScaleRange(scaleRange, scaleName, channel, model) {\n // add signals to x/y range\n if (isXorY(channel)) {\n if (isVgRangeStep(scaleRange)) {\n // For width/height step, use a signal created in layout assemble instead of a constant step.\n return {\n step: { signal: scaleName + '_step' }\n };\n }\n }\n else if (isObject(scaleRange) && isDataRefDomain(scaleRange)) {\n return Object.assign(Object.assign({}, scaleRange), { data: model.lookupDataSource(scaleRange.data) });\n }\n return scaleRange;\n}\n//# sourceMappingURL=assemble.js.map","import { isArray } from 'vega-util';\nimport { some } from '../../util';\nimport { Split } from '../split';\nexport class ScaleComponent extends Split {\n constructor(name, typeWithExplicit) {\n super({}, // no initial explicit property\n { name } // name as initial implicit property\n );\n this.merged = false;\n this.setWithExplicit('type', typeWithExplicit);\n }\n /**\n * Whether the scale definitely includes zero in the domain\n */\n domainDefinitelyIncludesZero() {\n if (this.get('zero') !== false) {\n return true;\n }\n return some(this.get('domains'), d => isArray(d) && d.length === 2 && d[0] <= 0 && d[1] >= 0);\n }\n}\n//# sourceMappingURL=component.js.map","import { isArray, isNumber, isObject } from 'vega-util';\nimport { isBinning } from '../../bin';\nimport { ANGLE, COLOR, FILL, FILLOPACITY, isXorY, OPACITY, RADIUS, SCALE_CHANNELS, SHAPE, SIZE, STROKE, STROKEDASH, STROKEOPACITY, STROKEWIDTH, THETA, X, Y } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { getViewConfigDiscreteSize, getViewConfigDiscreteStep } from '../../config';\nimport { DataSourceType } from '../../data';\nimport * as log from '../../log';\nimport { channelScalePropertyIncompatability, hasContinuousDomain, hasDiscreteDomain, isContinuousToDiscrete, isExtendedScheme, scaleTypeSupportProperty } from '../../scale';\nimport { isStep } from '../../spec/base';\nimport * as util from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { signalOrStringValue } from '../common';\nimport { getBinSignalName } from '../data/bin';\nimport { SignalRefWrapper } from '../signal';\nimport { makeExplicit, makeImplicit } from '../split';\nexport const RANGE_PROPERTIES = ['range', 'scheme'];\nfunction getSizeChannel(channel) {\n return channel === 'x' ? 'width' : channel === 'y' ? 'height' : undefined;\n}\nexport function parseUnitScaleRange(model) {\n const localScaleComponents = model.component.scales;\n // use SCALE_CHANNELS instead of scales[channel] to ensure that x, y come first!\n for (const channel of SCALE_CHANNELS) {\n const localScaleCmpt = localScaleComponents[channel];\n if (!localScaleCmpt) {\n continue;\n }\n const rangeWithExplicit = parseRangeForChannel(channel, model);\n localScaleCmpt.setWithExplicit('range', rangeWithExplicit);\n }\n}\nfunction getBinStepSignal(model, channel) {\n const fieldDef = model.fieldDef(channel);\n if (fieldDef && fieldDef.bin && isBinning(fieldDef.bin)) {\n const binSignal = getBinSignalName(model, fieldDef.field, fieldDef.bin);\n // TODO: extract this to be range step signal\n const sizeType = getSizeChannel(channel);\n const sizeSignal = model.getName(sizeType);\n return new SignalRefWrapper(() => {\n const updatedName = model.getSignalName(binSignal);\n const binCount = `(${updatedName}.stop - ${updatedName}.start) / ${updatedName}.step`;\n return `${model.getSignalName(sizeSignal)} / (${binCount})`;\n });\n }\n return undefined;\n}\n/**\n * Return mixins that includes one of the Vega range types (explicit range, range.step, range.scheme).\n */\nexport function parseRangeForChannel(channel, model) {\n const specifiedScale = model.specifiedScales[channel];\n const { size } = model;\n const mergedScaleCmpt = model.getScaleComponent(channel);\n const scaleType = mergedScaleCmpt.get('type');\n // Check if any of the range properties is specified.\n // If so, check if it is compatible and make sure that we only output one of the properties\n for (const property of RANGE_PROPERTIES) {\n if (specifiedScale[property] !== undefined) {\n const supportedByScaleType = scaleTypeSupportProperty(scaleType, property);\n const channelIncompatability = channelScalePropertyIncompatability(channel, property);\n if (!supportedByScaleType) {\n log.warn(log.message.scalePropertyNotWorkWithScaleType(scaleType, property, channel));\n }\n else if (channelIncompatability) {\n // channel\n log.warn(channelIncompatability);\n }\n else {\n switch (property) {\n case 'range': {\n const range = specifiedScale.range;\n if (isArray(range)) {\n if (isXorY(channel)) {\n return makeExplicit(range.map(v => {\n if (v === 'width' || v === 'height') {\n // get signal for width/height\n // Just like default range logic below, we use SignalRefWrapper to account for potential merges and renames.\n const sizeSignal = model.getName(v);\n const getSignalName = model.getSignalName.bind(model);\n return SignalRefWrapper.fromName(getSignalName, sizeSignal);\n }\n return v;\n }));\n }\n }\n else if (isObject(range)) {\n return makeExplicit({\n data: model.requestDataName(DataSourceType.Main),\n field: range.field,\n sort: { op: 'min', field: model.vgField(channel) }\n });\n }\n return makeExplicit(range);\n }\n case 'scheme':\n return makeExplicit(parseScheme(specifiedScale[property]));\n }\n }\n }\n }\n if (channel === X || channel === Y) {\n const sizeChannel = channel === X ? 'width' : 'height';\n const sizeValue = size[sizeChannel];\n if (isStep(sizeValue)) {\n if (hasDiscreteDomain(scaleType)) {\n return makeExplicit({ step: sizeValue.step });\n }\n else {\n log.warn(log.message.stepDropped(sizeChannel));\n }\n }\n }\n const { rangeMin, rangeMax } = specifiedScale;\n const d = defaultRange(channel, model);\n if ((rangeMin !== undefined || rangeMax !== undefined) &&\n // it's ok to check just rangeMin's compatibility since rangeMin/rangeMax are the same\n scaleTypeSupportProperty(scaleType, 'rangeMin') &&\n isArray(d) &&\n d.length === 2) {\n return makeExplicit([rangeMin !== null && rangeMin !== void 0 ? rangeMin : d[0], rangeMax !== null && rangeMax !== void 0 ? rangeMax : d[1]]);\n }\n return makeImplicit(d);\n}\nfunction parseScheme(scheme) {\n if (isExtendedScheme(scheme)) {\n return Object.assign({ scheme: scheme.name }, util.omit(scheme, ['name']));\n }\n return { scheme: scheme };\n}\nfunction defaultRange(channel, model) {\n const { size, config, mark, encoding } = model;\n const getSignalName = model.getSignalName.bind(model);\n const { type } = getFieldOrDatumDef(encoding[channel]);\n const mergedScaleCmpt = model.getScaleComponent(channel);\n const scaleType = mergedScaleCmpt.get('type');\n const { domain, domainMid } = model.specifiedScales[channel];\n switch (channel) {\n case X:\n case Y: {\n // If there is no explicit width/height for discrete x/y scales\n if (util.contains(['point', 'band'], scaleType)) {\n if (channel === X && !size.width) {\n const w = getViewConfigDiscreteSize(config.view, 'width');\n if (isStep(w)) {\n return w;\n }\n }\n else if (channel === Y && !size.height) {\n const h = getViewConfigDiscreteSize(config.view, 'height');\n if (isStep(h)) {\n return h;\n }\n }\n }\n // If step is null, use zero to width or height.\n // Note that we use SignalRefWrapper to account for potential merges and renames.\n const sizeType = getSizeChannel(channel);\n const sizeSignal = model.getName(sizeType);\n if (channel === Y && hasContinuousDomain(scaleType)) {\n // For y continuous scale, we have to start from the height as the bottom part has the max value.\n return [SignalRefWrapper.fromName(getSignalName, sizeSignal), 0];\n }\n else {\n return [0, SignalRefWrapper.fromName(getSignalName, sizeSignal)];\n }\n }\n case SIZE: {\n // TODO: support custom rangeMin, rangeMax\n const zero = model.component.scales[channel].get('zero');\n const rangeMin = sizeRangeMin(mark, zero, config);\n const rangeMax = sizeRangeMax(mark, size, model, config);\n if (isContinuousToDiscrete(scaleType)) {\n return interpolateRange(rangeMin, rangeMax, defaultContinuousToDiscreteCount(scaleType, config, domain, channel));\n }\n else {\n return [rangeMin, rangeMax];\n }\n }\n case THETA:\n return [0, Math.PI * 2];\n case ANGLE:\n // TODO: add config.scale.min/maxAngleDegree (for point and text) and config.scale.min/maxAngleRadian (for arc) once we add arc marks.\n // (It's weird to add just config.scale.min/maxAngleDegree for now)\n return [0, 360];\n case RADIUS: {\n // max radius = half od min(width,height)\n return [\n 0,\n new SignalRefWrapper(() => {\n const w = model.getSignalName('width');\n const h = model.getSignalName('height');\n return `min(${w},${h})/2`;\n })\n ];\n }\n case STROKEWIDTH:\n // TODO: support custom rangeMin, rangeMax\n return [config.scale.minStrokeWidth, config.scale.maxStrokeWidth];\n case STROKEDASH:\n return [\n // TODO: add this to Vega's config.range?\n [1, 0],\n [4, 2],\n [2, 1],\n [1, 1],\n [1, 2, 4, 2]\n ];\n case SHAPE:\n return 'symbol';\n case COLOR:\n case FILL:\n case STROKE:\n if (scaleType === 'ordinal') {\n // Only nominal data uses ordinal scale by default\n return type === 'nominal' ? 'category' : 'ordinal';\n }\n else {\n if (domainMid !== undefined) {\n return 'diverging';\n }\n else {\n return mark === 'rect' || mark === 'geoshape' ? 'heatmap' : 'ramp';\n }\n }\n case OPACITY:\n case FILLOPACITY:\n case STROKEOPACITY:\n // TODO: support custom rangeMin, rangeMax\n return [config.scale.minOpacity, config.scale.maxOpacity];\n }\n /* istanbul ignore next: should never reach here */\n throw new Error(`Scale range undefined for channel ${channel}`);\n}\nexport function defaultContinuousToDiscreteCount(scaleType, config, domain, channel) {\n switch (scaleType) {\n case 'quantile':\n return config.scale.quantileCount;\n case 'quantize':\n return config.scale.quantizeCount;\n case 'threshold':\n if (domain !== undefined && isArray(domain)) {\n return domain.length + 1;\n }\n else {\n log.warn(log.message.domainRequiredForThresholdScale(channel));\n // default threshold boundaries for threshold scale since domain has cardinality of 2\n return 3;\n }\n }\n}\n/**\n * Returns the linear interpolation of the range according to the cardinality\n *\n * @param rangeMin start of the range\n * @param rangeMax end of the range\n * @param cardinality number of values in the output range\n */\nexport function interpolateRange(rangeMin, rangeMax, cardinality) {\n // always return a signal since it's better to compute the sequence in Vega later\n const f = () => {\n const rMax = signalOrStringValue(rangeMax);\n const rMin = signalOrStringValue(rangeMin);\n const step = `(${rMax} - ${rMin}) / (${cardinality} - 1)`;\n return `sequence(${rMin}, ${rMax} + ${step}, ${step})`;\n };\n if (isSignalRef(rangeMax)) {\n return new SignalRefWrapper(f);\n }\n else {\n return { signal: f() };\n }\n}\nfunction sizeRangeMin(mark, zero, config) {\n if (zero) {\n if (isSignalRef(zero)) {\n return { signal: `${zero.signal} ? 0 : ${sizeRangeMin(mark, false, config)}` };\n }\n else {\n return 0;\n }\n }\n switch (mark) {\n case 'bar':\n case 'tick':\n return config.scale.minBandSize;\n case 'line':\n case 'trail':\n case 'rule':\n return config.scale.minStrokeWidth;\n case 'text':\n return config.scale.minFontSize;\n case 'point':\n case 'square':\n case 'circle':\n return config.scale.minSize;\n }\n /* istanbul ignore next: should never reach here */\n // sizeRangeMin not implemented for the mark\n throw new Error(log.message.incompatibleChannel('size', mark));\n}\nexport const MAX_SIZE_RANGE_STEP_RATIO = 0.95;\nfunction sizeRangeMax(mark, size, model, config) {\n const xyStepSignals = {\n x: getBinStepSignal(model, 'x'),\n y: getBinStepSignal(model, 'y')\n };\n switch (mark) {\n case 'bar':\n case 'tick': {\n if (config.scale.maxBandSize !== undefined) {\n return config.scale.maxBandSize;\n }\n const min = minXYStep(size, xyStepSignals, config.view);\n if (isNumber(min)) {\n return min - 1;\n }\n else {\n return new SignalRefWrapper(() => `${min.signal} - 1`);\n }\n }\n case 'line':\n case 'trail':\n case 'rule':\n return config.scale.maxStrokeWidth;\n case 'text':\n return config.scale.maxFontSize;\n case 'point':\n case 'square':\n case 'circle': {\n if (config.scale.maxSize) {\n return config.scale.maxSize;\n }\n const pointStep = minXYStep(size, xyStepSignals, config.view);\n if (isNumber(pointStep)) {\n return Math.pow(MAX_SIZE_RANGE_STEP_RATIO * pointStep, 2);\n }\n else {\n return new SignalRefWrapper(() => `pow(${MAX_SIZE_RANGE_STEP_RATIO} * ${pointStep.signal}, 2)`);\n }\n }\n }\n /* istanbul ignore next: should never reach here */\n // sizeRangeMax not implemented for the mark\n throw new Error(log.message.incompatibleChannel('size', mark));\n}\n/**\n * @returns {number} Range step of x or y or minimum between the two if both are ordinal scale.\n */\nfunction minXYStep(size, xyStepSignals, viewConfig) {\n const widthStep = isStep(size.width) ? size.width.step : getViewConfigDiscreteStep(viewConfig, 'width');\n const heightStep = isStep(size.height) ? size.height.step : getViewConfigDiscreteStep(viewConfig, 'height');\n if (xyStepSignals.x || xyStepSignals.y) {\n return new SignalRefWrapper(() => {\n const exprs = [\n xyStepSignals.x ? xyStepSignals.x.signal : widthStep,\n xyStepSignals.y ? xyStepSignals.y.signal : heightStep\n ];\n return `min(${exprs.join(', ')})`;\n });\n }\n return Math.min(widthStep, heightStep);\n}\n//# sourceMappingURL=range.js.map","import { isArray } from 'vega-util';\nimport { isBinned, isBinning, isBinParams } from '../../bin';\nimport { COLOR, FILL, POLAR_POSITION_SCALE_CHANNELS, POSITION_SCALE_CHANNELS, POSITION_SCALE_CHANNEL_INDEX, STROKE } from '../../channel';\nimport { getFieldDef, getFieldOrDatumDef, isFieldDef, valueExpr } from '../../channeldef';\nimport { isDateTime } from '../../datetime';\nimport * as log from '../../log';\nimport { channelScalePropertyIncompatability, hasContinuousDomain, isContinuousToContinuous, isContinuousToDiscrete, ScaleType, scaleTypeSupportProperty } from '../../scale';\nimport * as util from '../../util';\nimport { contains, getFirstDefined, keys } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { getBinSignalName } from '../data/bin';\nimport { isUnitModel } from '../model';\nimport { SignalRefWrapper } from '../signal';\nimport { mergeValuesWithExplicit, tieBreakByComparing } from '../split';\nimport { parseUnitScaleRange } from './range';\nexport function parseScaleProperty(model, property) {\n if (isUnitModel(model)) {\n parseUnitScaleProperty(model, property);\n }\n else {\n parseNonUnitScaleProperty(model, property);\n }\n}\nfunction parseUnitScaleProperty(model, property) {\n const localScaleComponents = model.component.scales;\n const { config, encoding, markDef, specifiedScales } = model;\n for (const channel of keys(localScaleComponents)) {\n const specifiedScale = specifiedScales[channel];\n const localScaleCmpt = localScaleComponents[channel];\n const mergedScaleCmpt = model.getScaleComponent(channel);\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n const specifiedValue = specifiedScale[property];\n const scaleType = mergedScaleCmpt.get('type');\n const scalePadding = mergedScaleCmpt.get('padding');\n const scalePaddingInner = mergedScaleCmpt.get('paddingInner');\n const supportedByScaleType = scaleTypeSupportProperty(scaleType, property);\n const channelIncompatability = channelScalePropertyIncompatability(channel, property);\n if (specifiedValue !== undefined) {\n // If there is a specified value, check if it is compatible with scale type and channel\n if (!supportedByScaleType) {\n log.warn(log.message.scalePropertyNotWorkWithScaleType(scaleType, property, channel));\n }\n else if (channelIncompatability) {\n // channel\n log.warn(channelIncompatability);\n }\n }\n if (supportedByScaleType && channelIncompatability === undefined) {\n if (specifiedValue !== undefined) {\n const timeUnit = fieldOrDatumDef['timeUnit'];\n const type = fieldOrDatumDef.type;\n switch (property) {\n // domainMax/Min to signal if the value is a datetime object\n case 'domainMax':\n case 'domainMin':\n if (isDateTime(specifiedScale[property]) || type === 'temporal' || timeUnit) {\n localScaleCmpt.set(property, { signal: valueExpr(specifiedScale[property], { type, timeUnit }) }, true);\n }\n else {\n localScaleCmpt.set(property, specifiedScale[property], true);\n }\n break;\n default:\n localScaleCmpt.copyKeyFromObject(property, specifiedScale);\n }\n }\n else {\n const value = property in scaleRules\n ? scaleRules[property]({\n model,\n channel,\n fieldOrDatumDef,\n scaleType,\n scalePadding,\n scalePaddingInner,\n domain: specifiedScale.domain,\n markDef,\n config\n })\n : config.scale[property];\n if (value !== undefined) {\n localScaleCmpt.set(property, value, false);\n }\n }\n }\n }\n}\nexport const scaleRules = {\n bins: ({ model, fieldOrDatumDef }) => (isFieldDef(fieldOrDatumDef) ? bins(model, fieldOrDatumDef) : undefined),\n interpolate: ({ channel, fieldOrDatumDef }) => interpolate(channel, fieldOrDatumDef.type),\n nice: ({ scaleType, channel, fieldOrDatumDef }) => nice(scaleType, channel, fieldOrDatumDef),\n padding: ({ channel, scaleType, fieldOrDatumDef, markDef, config }) => padding(channel, scaleType, config.scale, fieldOrDatumDef, markDef, config.bar),\n paddingInner: ({ scalePadding, channel, markDef, config }) => paddingInner(scalePadding, channel, markDef.type, config.scale),\n paddingOuter: ({ scalePadding, channel, scaleType, markDef, scalePaddingInner, config }) => paddingOuter(scalePadding, channel, scaleType, markDef.type, scalePaddingInner, config.scale),\n reverse: ({ fieldOrDatumDef, scaleType, channel, config }) => {\n const sort = isFieldDef(fieldOrDatumDef) ? fieldOrDatumDef.sort : undefined;\n return reverse(scaleType, sort, channel, config.scale);\n },\n zero: ({ channel, fieldOrDatumDef, domain, markDef, scaleType }) => zero(channel, fieldOrDatumDef, domain, markDef, scaleType)\n};\n// This method is here rather than in range.ts to avoid circular dependency.\nexport function parseScaleRange(model) {\n if (isUnitModel(model)) {\n parseUnitScaleRange(model);\n }\n else {\n parseNonUnitScaleProperty(model, 'range');\n }\n}\nexport function parseNonUnitScaleProperty(model, property) {\n const localScaleComponents = model.component.scales;\n for (const child of model.children) {\n if (property === 'range') {\n parseScaleRange(child);\n }\n else {\n parseScaleProperty(child, property);\n }\n }\n for (const channel of keys(localScaleComponents)) {\n let valueWithExplicit;\n for (const child of model.children) {\n const childComponent = child.component.scales[channel];\n if (childComponent) {\n const childValueWithExplicit = childComponent.getWithExplicit(property);\n valueWithExplicit = mergeValuesWithExplicit(valueWithExplicit, childValueWithExplicit, property, 'scale', tieBreakByComparing((v1, v2) => {\n switch (property) {\n case 'range':\n // For step, prefer larger step\n if (v1.step && v2.step) {\n return v1.step - v2.step;\n }\n return 0;\n // TODO: precedence rule for other properties\n }\n return 0;\n }));\n }\n }\n localScaleComponents[channel].setWithExplicit(property, valueWithExplicit);\n }\n}\nexport function bins(model, fieldDef) {\n const bin = fieldDef.bin;\n if (isBinning(bin)) {\n const binSignal = getBinSignalName(model, fieldDef.field, bin);\n return new SignalRefWrapper(() => {\n return model.getSignalName(binSignal);\n });\n }\n else if (isBinned(bin) && isBinParams(bin) && bin.step !== undefined) {\n // start and stop will be determined from the scale domain\n return {\n step: bin.step\n };\n }\n return undefined;\n}\nexport function interpolate(channel, type) {\n if (contains([COLOR, FILL, STROKE], channel) && type !== 'nominal') {\n return 'hcl';\n }\n return undefined;\n}\nexport function nice(scaleType, channel, fieldOrDatumDef) {\n var _a;\n if (((_a = getFieldDef(fieldOrDatumDef)) === null || _a === void 0 ? void 0 : _a.bin) || util.contains([ScaleType.TIME, ScaleType.UTC], scaleType)) {\n return undefined;\n }\n return channel in POSITION_SCALE_CHANNEL_INDEX ? true : undefined;\n}\nexport function padding(channel, scaleType, scaleConfig, fieldOrDatumDef, markDef, barConfig) {\n if (channel in POSITION_SCALE_CHANNEL_INDEX) {\n if (isContinuousToContinuous(scaleType)) {\n if (scaleConfig.continuousPadding !== undefined) {\n return scaleConfig.continuousPadding;\n }\n const { type, orient } = markDef;\n if (type === 'bar' && !(isFieldDef(fieldOrDatumDef) && (fieldOrDatumDef.bin || fieldOrDatumDef.timeUnit))) {\n if ((orient === 'vertical' && channel === 'x') || (orient === 'horizontal' && channel === 'y')) {\n return barConfig.continuousBandSize;\n }\n }\n }\n if (scaleType === ScaleType.POINT) {\n return scaleConfig.pointPadding;\n }\n }\n return undefined;\n}\nexport function paddingInner(paddingValue, channel, mark, scaleConfig) {\n if (paddingValue !== undefined) {\n // If user has already manually specified \"padding\", no need to add default paddingInner.\n return undefined;\n }\n if (channel in POSITION_SCALE_CHANNEL_INDEX) {\n // Padding is only set for X and Y by default.\n // Basically it doesn't make sense to add padding for color and size.\n // paddingOuter would only be called if it's a band scale, just return the default for bandScale.\n const { bandPaddingInner, barBandPaddingInner, rectBandPaddingInner } = scaleConfig;\n return getFirstDefined(bandPaddingInner, mark === 'bar' ? barBandPaddingInner : rectBandPaddingInner);\n }\n return undefined;\n}\nexport function paddingOuter(paddingValue, channel, scaleType, mark, paddingInnerValue, scaleConfig) {\n if (paddingValue !== undefined) {\n // If user has already manually specified \"padding\", no need to add default paddingOuter.\n return undefined;\n }\n if (channel in POSITION_SCALE_CHANNEL_INDEX) {\n // Padding is only set for X and Y by default.\n // Basically it doesn't make sense to add padding for color and size.\n if (scaleType === ScaleType.BAND) {\n const { bandPaddingOuter } = scaleConfig;\n return getFirstDefined(bandPaddingOuter, \n /* By default, paddingOuter is paddingInner / 2. The reason is that\n size (width/height) = step * (cardinality - paddingInner + 2 * paddingOuter).\n and we want the width/height to be integer by default.\n Note that step (by default) and cardinality are integers.) */\n isSignalRef(paddingInnerValue) ? { signal: `${paddingInnerValue.signal}/2` } : paddingInnerValue / 2);\n }\n }\n return undefined;\n}\nexport function reverse(scaleType, sort, channel, scaleConfig) {\n if (channel === 'x' && scaleConfig.xReverse !== undefined) {\n if (hasContinuousDomain(scaleType) && sort === 'descending') {\n if (isSignalRef(scaleConfig.xReverse)) {\n return { signal: `!${scaleConfig.xReverse.signal}` };\n }\n else {\n return !scaleConfig.xReverse;\n }\n }\n return scaleConfig.xReverse;\n }\n if (hasContinuousDomain(scaleType) && sort === 'descending') {\n // For continuous domain scales, Vega does not support domain sort.\n // Thus, we reverse range instead if sort is descending\n return true;\n }\n return undefined;\n}\nexport function zero(channel, fieldDef, specifiedDomain, markDef, scaleType) {\n // If users explicitly provide a domain range, we should not augment zero as that will be unexpected.\n const hasCustomDomain = !!specifiedDomain && specifiedDomain !== 'unaggregated';\n if (hasCustomDomain) {\n if (hasContinuousDomain(scaleType)) {\n if (isArray(specifiedDomain)) {\n const first = specifiedDomain[0];\n const last = specifiedDomain[specifiedDomain.length - 1];\n if (first <= 0 && last >= 0) {\n // if the domain includes zero, make zero remains true\n return true;\n }\n }\n return false;\n }\n }\n // If there is no custom domain, return true only for the following cases:\n // 1) using quantitative field with size\n // While this can be either ratio or interval fields, our assumption is that\n // ratio are more common. However, if the scaleType is discretizing scale, we want to return\n // false so that range doesn't start at zero\n if (channel === 'size' && fieldDef.type === 'quantitative' && !isContinuousToDiscrete(scaleType)) {\n return true;\n }\n // 2) non-binned, quantitative x-scale or y-scale\n // (For binning, we should not include zero by default because binning are calculated without zero.)\n if (!(isFieldDef(fieldDef) && fieldDef.bin) &&\n util.contains([...POSITION_SCALE_CHANNELS, ...POLAR_POSITION_SCALE_CHANNELS], channel)) {\n const { orient, type } = markDef;\n if (contains(['bar', 'area', 'line', 'trail'], type)) {\n if ((orient === 'horizontal' && channel === 'y') || (orient === 'vertical' && channel === 'x')) {\n return false;\n }\n }\n return true;\n }\n return false;\n}\n//# sourceMappingURL=properties.js.map","import { SCALE_CHANNELS, SHAPE } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { GEOSHAPE } from '../../mark';\nimport { NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES, scaleCompatible, scaleTypePrecedence } from '../../scale';\nimport { GEOJSON } from '../../type';\nimport { keys } from '../../util';\nimport { isUnitModel } from '../model';\nimport { defaultScaleResolve } from '../resolve';\nimport { mergeValuesWithExplicit, tieBreakByComparing } from '../split';\nimport { ScaleComponent } from './component';\nimport { parseScaleDomain } from './domain';\nimport { parseScaleProperty, parseScaleRange } from './properties';\nimport { scaleType } from './type';\nexport function parseScales(model, { ignoreRange } = {}) {\n parseScaleCore(model);\n parseScaleDomain(model);\n for (const prop of NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES) {\n parseScaleProperty(model, prop);\n }\n if (!ignoreRange) {\n // range depends on zero\n parseScaleRange(model);\n }\n}\nexport function parseScaleCore(model) {\n if (isUnitModel(model)) {\n model.component.scales = parseUnitScaleCore(model);\n }\n else {\n model.component.scales = parseNonUnitScaleCore(model);\n }\n}\n/**\n * Parse scales for all channels of a model.\n */\nfunction parseUnitScaleCore(model) {\n const { encoding, mark } = model;\n return SCALE_CHANNELS.reduce((scaleComponents, channel) => {\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]); // must be typed def to have scale\n // Don't generate scale for shape of geoshape\n if (fieldOrDatumDef && mark === GEOSHAPE && channel === SHAPE && fieldOrDatumDef.type === GEOJSON) {\n return scaleComponents;\n }\n let specifiedScale = fieldOrDatumDef && fieldOrDatumDef['scale'];\n if (fieldOrDatumDef && specifiedScale !== null && specifiedScale !== false) {\n specifiedScale = specifiedScale !== null && specifiedScale !== void 0 ? specifiedScale : {};\n const sType = scaleType(specifiedScale, channel, fieldOrDatumDef, mark);\n scaleComponents[channel] = new ScaleComponent(model.scaleName(channel + '', true), {\n value: sType,\n explicit: specifiedScale.type === sType\n });\n }\n return scaleComponents;\n }, {});\n}\nconst scaleTypeTieBreaker = tieBreakByComparing((st1, st2) => scaleTypePrecedence(st1) - scaleTypePrecedence(st2));\nfunction parseNonUnitScaleCore(model) {\n var _a;\n const scaleComponents = (model.component.scales = {});\n const scaleTypeWithExplicitIndex = {};\n const resolve = model.component.resolve;\n // Parse each child scale and determine if a particular channel can be merged.\n for (const child of model.children) {\n parseScaleCore(child);\n // Instead of always merging right away -- check if it is compatible to merge first!\n for (const channel of keys(child.component.scales)) {\n // if resolve is undefined, set default first\n resolve.scale[channel] = (_a = resolve.scale[channel]) !== null && _a !== void 0 ? _a : defaultScaleResolve(channel, model);\n if (resolve.scale[channel] === 'shared') {\n const explicitScaleType = scaleTypeWithExplicitIndex[channel];\n const childScaleType = child.component.scales[channel].getWithExplicit('type');\n if (explicitScaleType) {\n if (scaleCompatible(explicitScaleType.value, childScaleType.value)) {\n // merge scale component if type are compatible\n scaleTypeWithExplicitIndex[channel] = mergeValuesWithExplicit(explicitScaleType, childScaleType, 'type', 'scale', scaleTypeTieBreaker);\n }\n else {\n // Otherwise, update conflicting channel to be independent\n resolve.scale[channel] = 'independent';\n // Remove from the index so they don't get merged\n delete scaleTypeWithExplicitIndex[channel];\n }\n }\n else {\n scaleTypeWithExplicitIndex[channel] = childScaleType;\n }\n }\n }\n }\n // Merge each channel listed in the index\n for (const channel of keys(scaleTypeWithExplicitIndex)) {\n // Create new merged scale component\n const name = model.scaleName(channel, true);\n const typeWithExplicit = scaleTypeWithExplicitIndex[channel];\n scaleComponents[channel] = new ScaleComponent(name, typeWithExplicit);\n // rename each child and mark them as merged\n for (const child of model.children) {\n const childScale = child.component.scales[channel];\n if (childScale) {\n child.renameScale(childScale.get('name'), name);\n childScale.merged = true;\n }\n }\n }\n return scaleComponents;\n}\n//# sourceMappingURL=parse.js.map","import { isBinning } from '../../bin';\nimport { isColorChannel, isScaleChannel, rangeType } from '../../channel';\nimport { isFieldDef, isPositionFieldOrDatumDef } from '../../channeldef';\nimport * as log from '../../log';\nimport { channelSupportScaleType, scaleTypeSupportDataType } from '../../scale';\nimport { normalizeTimeUnit } from '../../timeunit';\nimport * as util from '../../util';\nimport { POLAR_POSITION_SCALE_CHANNEL_INDEX, POSITION_SCALE_CHANNEL_INDEX } from './../../channel';\n/**\n * Determine if there is a specified scale type and if it is appropriate,\n * or determine default type if type is unspecified or inappropriate.\n */\n// NOTE: CompassQL uses this method.\nexport function scaleType(specifiedScale, channel, fieldDef, mark) {\n const defaultScaleType = defaultType(channel, fieldDef, mark);\n const { type } = specifiedScale;\n if (!isScaleChannel(channel)) {\n // There is no scale for these channels\n return null;\n }\n if (type !== undefined) {\n // Check if explicitly specified scale type is supported by the channel\n if (!channelSupportScaleType(channel, type)) {\n log.warn(log.message.scaleTypeNotWorkWithChannel(channel, type, defaultScaleType));\n return defaultScaleType;\n }\n // Check if explicitly specified scale type is supported by the data type\n if (isFieldDef(fieldDef) && !scaleTypeSupportDataType(type, fieldDef.type)) {\n log.warn(log.message.scaleTypeNotWorkWithFieldDef(type, defaultScaleType));\n return defaultScaleType;\n }\n return type;\n }\n return defaultScaleType;\n}\n/**\n * Determine appropriate default scale type.\n */\n// NOTE: Voyager uses this method.\nfunction defaultType(channel, fieldDef, mark) {\n var _a;\n switch (fieldDef.type) {\n case 'nominal':\n case 'ordinal':\n if (isColorChannel(channel) || rangeType(channel) === 'discrete') {\n if (channel === 'shape' && fieldDef.type === 'ordinal') {\n log.warn(log.message.discreteChannelCannotEncode(channel, 'ordinal'));\n }\n return 'ordinal';\n }\n if (channel in POSITION_SCALE_CHANNEL_INDEX) {\n if (util.contains(['rect', 'bar', 'image', 'rule'], mark)) {\n // The rect/bar mark should fit into a band.\n // For rule, using band scale to make rule align with axis ticks better https://github.com/vega/vega-lite/issues/3429\n return 'band';\n }\n }\n else if (mark === 'arc' && channel in POLAR_POSITION_SCALE_CHANNEL_INDEX) {\n return 'band';\n }\n if (fieldDef.band !== undefined || (isPositionFieldOrDatumDef(fieldDef) && ((_a = fieldDef.axis) === null || _a === void 0 ? void 0 : _a.tickBand))) {\n return 'band';\n }\n // Otherwise, use ordinal point scale so we can easily get center positions of the marks.\n return 'point';\n case 'temporal':\n if (isColorChannel(channel)) {\n return 'time';\n }\n else if (rangeType(channel) === 'discrete') {\n log.warn(log.message.discreteChannelCannotEncode(channel, 'temporal'));\n // TODO: consider using quantize (equivalent to binning) once we have it\n return 'ordinal';\n }\n else if (isFieldDef(fieldDef) && fieldDef.timeUnit && normalizeTimeUnit(fieldDef.timeUnit).utc) {\n return 'utc';\n }\n return 'time';\n case 'quantitative':\n if (isColorChannel(channel)) {\n if (isFieldDef(fieldDef) && isBinning(fieldDef.bin)) {\n return 'bin-ordinal';\n }\n return 'linear';\n }\n else if (rangeType(channel) === 'discrete') {\n log.warn(log.message.discreteChannelCannotEncode(channel, 'quantitative'));\n // TODO: consider using quantize (equivalent to binning) once we have it\n return 'ordinal';\n }\n return 'linear';\n case 'geojson':\n return undefined;\n }\n /* istanbul ignore next: should never reach this */\n throw new Error(log.message.invalidFieldType(fieldDef.type));\n}\n//# sourceMappingURL=type.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { FACET_CHANNELS, getPositionScaleChannel, isChannel, isScaleChannel } from '../channel';\nimport { getFieldDef, vgField } from '../channeldef';\nimport { DataSourceType } from '../data';\nimport { forEach, reduce } from '../encoding';\nimport { replaceExprRefInIndex } from '../expr';\nimport * as log from '../log';\nimport { hasDiscreteDomain } from '../scale';\nimport { isFacetSpec } from '../spec';\nimport { extractCompositionLayout } from '../spec/base';\nimport { extractTitleConfig, isText } from '../title';\nimport { normalizeTransform } from '../transform';\nimport { contains, duplicate, isEmpty, keys, varName } from '../util';\nimport { isVgRangeStep } from '../vega.schema';\nimport { assembleAxes } from './axis/assemble';\nimport { signalOrValueRef, signalRefOrValue } from './common';\nimport { assembleHeaderGroups, assembleLayoutTitleBand, assembleTitleGroup } from './header/assemble';\nimport { HEADER_CHANNELS } from './header/component';\nimport { sizeExpr } from './layoutsize/assemble';\nimport { getSizeTypeFromLayoutSizeType } from './layoutsize/component';\nimport { assembleLegends } from './legend/assemble';\nimport { parseLegend } from './legend/parse';\nimport { assembleProjections } from './projection/assemble';\nimport { parseProjection } from './projection/parse';\nimport { assembleScales } from './scale/assemble';\nimport { assembleDomain, getFieldFromDomain } from './scale/domain';\nimport { parseScales } from './scale/parse';\nimport { Split } from './split';\nexport class NameMap {\n constructor() {\n this.nameMap = {};\n }\n rename(oldName, newName) {\n this.nameMap[oldName] = newName;\n }\n has(name) {\n return this.nameMap[name] !== undefined;\n }\n get(name) {\n // If the name appears in the _nameMap, we need to read its new name.\n // We have to loop over the dict just in case the new name also gets renamed.\n while (this.nameMap[name] && name !== this.nameMap[name]) {\n name = this.nameMap[name];\n }\n return name;\n }\n}\n/*\n We use type guards instead of `instanceof` as `instanceof` makes\n different parts of the compiler depend on the actual implementation of\n the model classes, which in turn depend on different parts of the compiler.\n Thus, `instanceof` leads to circular dependency problems.\n\n On the other hand, type guards only make different parts of the compiler\n depend on the type of the model classes, but not the actual implementation.\n*/\nexport function isUnitModel(model) {\n return (model === null || model === void 0 ? void 0 : model.type) === 'unit';\n}\nexport function isFacetModel(model) {\n return (model === null || model === void 0 ? void 0 : model.type) === 'facet';\n}\nexport function isConcatModel(model) {\n return (model === null || model === void 0 ? void 0 : model.type) === 'concat';\n}\nexport function isLayerModel(model) {\n return (model === null || model === void 0 ? void 0 : model.type) === 'layer';\n}\nexport class Model {\n constructor(spec, type, parent, parentGivenName, config, resolve, view) {\n var _a, _b;\n this.type = type;\n this.parent = parent;\n this.config = config;\n this.children = [];\n /**\n * Corrects the data references in marks after assemble.\n */\n this.correctDataNames = (mark) => {\n // TODO: make this correct\n // for normal data references\n if (mark.from && mark.from.data) {\n mark.from.data = this.lookupDataSource(mark.from.data);\n }\n // for access to facet data\n if (mark.from && mark.from.facet && mark.from.facet.data) {\n mark.from.facet.data = this.lookupDataSource(mark.from.facet.data);\n }\n return mark;\n };\n this.parent = parent;\n this.config = config;\n this.view = replaceExprRefInIndex(view);\n // If name is not provided, always use parent's givenName to avoid name conflicts.\n this.name = (_a = spec.name) !== null && _a !== void 0 ? _a : parentGivenName;\n this.title = isText(spec.title) ? { text: spec.title } : spec.title ? this.initTitle(spec.title) : undefined;\n // Shared name maps\n this.scaleNameMap = parent ? parent.scaleNameMap : new NameMap();\n this.projectionNameMap = parent ? parent.projectionNameMap : new NameMap();\n this.signalNameMap = parent ? parent.signalNameMap : new NameMap();\n this.data = spec.data;\n this.description = spec.description;\n this.transforms = normalizeTransform((_b = spec.transform) !== null && _b !== void 0 ? _b : []);\n this.layout = type === 'layer' || type === 'unit' ? {} : extractCompositionLayout(spec, type, config);\n this.component = {\n data: {\n sources: parent ? parent.component.data.sources : [],\n outputNodes: parent ? parent.component.data.outputNodes : {},\n outputNodeRefCounts: parent ? parent.component.data.outputNodeRefCounts : {},\n // data is faceted if the spec is a facet spec or the parent has faceted data and data is undefined\n isFaceted: isFacetSpec(spec) || (parent && parent.component.data.isFaceted && spec.data === undefined)\n },\n layoutSize: new Split(),\n layoutHeaders: { row: {}, column: {}, facet: {} },\n mark: null,\n resolve: Object.assign({ scale: {}, axis: {}, legend: {} }, (resolve ? duplicate(resolve) : {})),\n selection: null,\n scales: null,\n projection: null,\n axes: {},\n legends: {}\n };\n }\n initTitle(title) {\n const props = keys(title);\n const titleInternal = {\n text: signalRefOrValue(title.text)\n };\n for (const prop of props) {\n titleInternal[prop] = signalRefOrValue(title[prop]);\n }\n return titleInternal;\n }\n get width() {\n return this.getSizeSignalRef('width');\n }\n get height() {\n return this.getSizeSignalRef('height');\n }\n parse() {\n this.parseScale();\n this.parseLayoutSize(); // depends on scale\n this.renameTopLevelLayoutSizeSignal();\n this.parseSelections();\n this.parseProjection();\n this.parseData(); // (pathorder) depends on markDef; selection filters depend on parsed selections; depends on projection because some transforms require the finalized projection name.\n this.parseAxesAndHeaders(); // depends on scale and layout size\n this.parseLegends(); // depends on scale, markDef\n this.parseMarkGroup(); // depends on data name, scale, layout size, axisGroup, and children's scale, axis, legend and mark.\n }\n parseScale() {\n parseScales(this);\n }\n parseProjection() {\n parseProjection(this);\n }\n /**\n * Rename top-level spec's size to be just width / height, ignoring model name.\n * This essentially merges the top-level spec's width/height signals with the width/height signals\n * to help us reduce redundant signals declaration.\n */\n renameTopLevelLayoutSizeSignal() {\n if (this.getName('width') !== 'width') {\n this.renameSignal(this.getName('width'), 'width');\n }\n if (this.getName('height') !== 'height') {\n this.renameSignal(this.getName('height'), 'height');\n }\n }\n parseLegends() {\n parseLegend(this);\n }\n assembleGroupStyle() {\n var _a, _b;\n if (this.type === 'unit' || this.type === 'layer') {\n return (_b = (_a = this.view) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : 'cell';\n }\n return undefined;\n }\n assembleEncodeFromView(view) {\n // Exclude \"style\"\n const { style: _ } = view, baseView = __rest(view, [\"style\"]);\n const e = {};\n for (const property of keys(baseView)) {\n const value = baseView[property];\n if (value !== undefined) {\n e[property] = signalOrValueRef(value);\n }\n }\n return e;\n }\n assembleGroupEncodeEntry(isTopLevel) {\n let encodeEntry = {};\n if (this.view) {\n encodeEntry = this.assembleEncodeFromView(this.view);\n }\n if (!isTopLevel) {\n // Descriptions are already added to the top-level description so we only need to add them to the inner views.\n if (this.description) {\n encodeEntry['description'] = signalOrValueRef(this.description);\n }\n // For top-level spec, we can set the global width and height signal to adjust the group size.\n // For other child specs, we have to manually set width and height in the encode entry.\n if (this.type === 'unit' || this.type === 'layer') {\n return Object.assign({ width: this.getSizeSignalRef('width'), height: this.getSizeSignalRef('height') }, (encodeEntry !== null && encodeEntry !== void 0 ? encodeEntry : {}));\n }\n }\n return isEmpty(encodeEntry) ? undefined : encodeEntry;\n }\n assembleLayout() {\n if (!this.layout) {\n return undefined;\n }\n const _a = this.layout, { spacing } = _a, layout = __rest(_a, [\"spacing\"]);\n const { component, config } = this;\n const titleBand = assembleLayoutTitleBand(component.layoutHeaders, config);\n return Object.assign(Object.assign(Object.assign({ padding: spacing }, this.assembleDefaultLayout()), layout), (titleBand ? { titleBand } : {}));\n }\n assembleDefaultLayout() {\n return {};\n }\n assembleHeaderMarks() {\n const { layoutHeaders } = this.component;\n let headerMarks = [];\n for (const channel of FACET_CHANNELS) {\n if (layoutHeaders[channel].title) {\n headerMarks.push(assembleTitleGroup(this, channel));\n }\n }\n for (const channel of HEADER_CHANNELS) {\n headerMarks = headerMarks.concat(assembleHeaderGroups(this, channel));\n }\n return headerMarks;\n }\n assembleAxes() {\n return assembleAxes(this.component.axes, this.config);\n }\n assembleLegends() {\n return assembleLegends(this);\n }\n assembleProjections() {\n return assembleProjections(this);\n }\n assembleTitle() {\n var _a, _b, _c;\n const _d = (_a = this.title) !== null && _a !== void 0 ? _a : {}, { encoding } = _d, titleNoEncoding = __rest(_d, [\"encoding\"]);\n const title = Object.assign(Object.assign(Object.assign({}, extractTitleConfig(this.config.title).nonMark), titleNoEncoding), (encoding ? { encode: { update: encoding } } : {}));\n if (title.text) {\n if (contains(['unit', 'layer'], this.type)) {\n // Unit/Layer\n if (contains(['middle', undefined], title.anchor)) {\n title.frame = (_b = title.frame) !== null && _b !== void 0 ? _b : 'group';\n }\n }\n else {\n // composition with Vega layout\n // Set title = \"start\" by default for composition as \"middle\" does not look nice\n // https://github.com/vega/vega/issues/960#issuecomment-471360328\n title.anchor = (_c = title.anchor) !== null && _c !== void 0 ? _c : 'start';\n }\n return isEmpty(title) ? undefined : title;\n }\n return undefined;\n }\n /**\n * Assemble the mark group for this model. We accept optional `signals` so that we can include concat top-level signals with the top-level model's local signals.\n */\n assembleGroup(signals = []) {\n const group = {};\n signals = signals.concat(this.assembleSignals());\n if (signals.length > 0) {\n group.signals = signals;\n }\n const layout = this.assembleLayout();\n if (layout) {\n group.layout = layout;\n }\n group.marks = [].concat(this.assembleHeaderMarks(), this.assembleMarks());\n // Only include scales if this spec is top-level or if parent is facet.\n // (Otherwise, it will be merged with upper-level's scope.)\n const scales = !this.parent || isFacetModel(this.parent) ? assembleScales(this) : [];\n if (scales.length > 0) {\n group.scales = scales;\n }\n const axes = this.assembleAxes();\n if (axes.length > 0) {\n group.axes = axes;\n }\n const legends = this.assembleLegends();\n if (legends.length > 0) {\n group.legends = legends;\n }\n return group;\n }\n getName(text) {\n return varName((this.name ? this.name + '_' : '') + text);\n }\n getDataName(type) {\n return this.getName(DataSourceType[type].toLowerCase());\n }\n /**\n * Request a data source name for the given data source type and mark that data source as required.\n * This method should be called in parse, so that all used data source can be correctly instantiated in assembleData().\n * You can lookup the correct dataset name in assemble with `lookupDataSource`.\n */\n requestDataName(name) {\n const fullName = this.getDataName(name);\n // Increase ref count. This is critical because otherwise we won't create a data source.\n // We also increase the ref counts on OutputNode.getSource() calls.\n const refCounts = this.component.data.outputNodeRefCounts;\n refCounts[fullName] = (refCounts[fullName] || 0) + 1;\n return fullName;\n }\n getSizeSignalRef(layoutSizeType) {\n if (isFacetModel(this.parent)) {\n const sizeType = getSizeTypeFromLayoutSizeType(layoutSizeType);\n const channel = getPositionScaleChannel(sizeType);\n const scaleComponent = this.component.scales[channel];\n if (scaleComponent && !scaleComponent.merged) {\n // independent scale\n const type = scaleComponent.get('type');\n const range = scaleComponent.get('range');\n if (hasDiscreteDomain(type) && isVgRangeStep(range)) {\n const scaleName = scaleComponent.get('name');\n const domain = assembleDomain(this, channel);\n const field = getFieldFromDomain(domain);\n if (field) {\n const fieldRef = vgField({ aggregate: 'distinct', field }, { expr: 'datum' });\n return {\n signal: sizeExpr(scaleName, scaleComponent, fieldRef)\n };\n }\n else {\n log.warn(log.message.unknownField(channel));\n return null;\n }\n }\n }\n }\n return {\n signal: this.signalNameMap.get(this.getName(layoutSizeType))\n };\n }\n /**\n * Lookup the name of the datasource for an output node. You probably want to call this in assemble.\n */\n lookupDataSource(name) {\n const node = this.component.data.outputNodes[name];\n if (!node) {\n // Name not found in map so let's just return what we got.\n // This can happen if we already have the correct name.\n return name;\n }\n return node.getSource();\n }\n getSignalName(oldSignalName) {\n return this.signalNameMap.get(oldSignalName);\n }\n renameSignal(oldName, newName) {\n this.signalNameMap.rename(oldName, newName);\n }\n renameScale(oldName, newName) {\n this.scaleNameMap.rename(oldName, newName);\n }\n renameProjection(oldName, newName) {\n this.projectionNameMap.rename(oldName, newName);\n }\n /**\n * @return scale name for a given channel after the scale has been parsed and named.\n */\n scaleName(originalScaleName, parse) {\n if (parse) {\n // During the parse phase always return a value\n // No need to refer to rename map because a scale can't be renamed\n // before it has the original name.\n return this.getName(originalScaleName);\n }\n // If there is a scale for the channel, it should either\n // be in the scale component or exist in the name map\n if (\n // If there is a scale for the channel, there should be a local scale component for it\n (isChannel(originalScaleName) && isScaleChannel(originalScaleName) && this.component.scales[originalScaleName]) ||\n // in the scale name map (the scale get merged by its parent)\n this.scaleNameMap.has(this.getName(originalScaleName))) {\n return this.scaleNameMap.get(this.getName(originalScaleName));\n }\n return undefined;\n }\n /**\n * @return projection name after the projection has been parsed and named.\n */\n projectionName(parse) {\n if (parse) {\n // During the parse phase always return a value\n // No need to refer to rename map because a projection can't be renamed\n // before it has the original name.\n return this.getName('projection');\n }\n if ((this.component.projection && !this.component.projection.merged) ||\n this.projectionNameMap.has(this.getName('projection'))) {\n return this.projectionNameMap.get(this.getName('projection'));\n }\n return undefined;\n }\n /**\n * Traverse a model's hierarchy to get the scale component for a particular channel.\n */\n getScaleComponent(channel) {\n /* istanbul ignore next: This is warning for debugging test */\n if (!this.component.scales) {\n throw new Error('getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().');\n }\n const localScaleComponent = this.component.scales[channel];\n if (localScaleComponent && !localScaleComponent.merged) {\n return localScaleComponent;\n }\n return this.parent ? this.parent.getScaleComponent(channel) : undefined;\n }\n /**\n * Traverse a model's hierarchy to get a particular selection component.\n */\n getSelectionComponent(variableName, origName) {\n let sel = this.component.selection[variableName];\n if (!sel && this.parent) {\n sel = this.parent.getSelectionComponent(variableName, origName);\n }\n if (!sel) {\n throw new Error(log.message.selectionNotFound(origName));\n }\n return sel;\n }\n /**\n * Returns true if the model has a signalRef for an axis orient.\n */\n hasAxisOrientSignalRef() {\n var _a, _b;\n return (((_a = this.component.axes.x) === null || _a === void 0 ? void 0 : _a.some(a => a.hasOrientSignalRef())) || ((_b = this.component.axes.y) === null || _b === void 0 ? void 0 : _b.some(a => a.hasOrientSignalRef())));\n }\n}\n/** Abstract class for UnitModel and FacetModel. Both of which can contain fieldDefs as a part of its own specification. */\nexport class ModelWithField extends Model {\n /** Get \"field\" reference for Vega */\n vgField(channel, opt = {}) {\n const fieldDef = this.fieldDef(channel);\n if (!fieldDef) {\n return undefined;\n }\n return vgField(fieldDef, opt);\n }\n reduceFieldDef(f, init) {\n return reduce(this.getMapping(), (acc, cd, c) => {\n const fieldDef = getFieldDef(cd);\n if (fieldDef) {\n return f(acc, fieldDef, c);\n }\n return acc;\n }, init);\n }\n forEachFieldDef(f, t) {\n forEach(this.getMapping(), (cd, c) => {\n const fieldDef = getFieldDef(cd);\n if (fieldDef) {\n f(fieldDef, c);\n }\n }, t);\n }\n}\n//# sourceMappingURL=model.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for density transform nodes\n */\nexport class DensityTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : 'value', (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : 'density'];\n }\n clone() {\n return new DensityTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.density, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `DensityTransform ${hash(this.transform)}`;\n }\n assemble() {\n const _a = this.transform, { density } = _a, rest = __rest(_a, [\"density\"]);\n const result = Object.assign({ type: 'kde', field: density }, rest);\n return result;\n }\n}\n//# sourceMappingURL=density.js.map","import { isScaleChannel } from '../../channel';\nimport { vgField as fieldRef } from '../../channeldef';\nimport { isPathMark } from '../../mark';\nimport { hasContinuousDomain } from '../../scale';\nimport { hash, keys } from '../../util';\nimport { getMarkPropOrConfig } from '../common';\nimport { DataFlowNode } from './dataflow';\nexport class FilterInvalidNode extends DataFlowNode {\n constructor(parent, filter) {\n super(parent);\n this.filter = filter;\n }\n clone() {\n return new FilterInvalidNode(null, Object.assign({}, this.filter));\n }\n static make(parent, model) {\n const { config, mark, markDef } = model;\n const invalid = getMarkPropOrConfig('invalid', markDef, config);\n if (invalid !== 'filter') {\n return null;\n }\n const filter = model.reduceFieldDef((aggregator, fieldDef, channel) => {\n const scaleComponent = isScaleChannel(channel) && model.getScaleComponent(channel);\n if (scaleComponent) {\n const scaleType = scaleComponent.get('type');\n // While discrete domain scales can handle invalid values, continuous scales can't.\n // Thus, for non-path marks, we have to filter null for scales with continuous domains.\n // (For path marks, we will use \"defined\" property and skip these values instead.)\n if (hasContinuousDomain(scaleType) && fieldDef.aggregate !== 'count' && !isPathMark(mark)) {\n aggregator[fieldDef.field] = fieldDef; // we know that the fieldDef is a typed field def\n }\n }\n return aggregator;\n }, {});\n if (!keys(filter).length) {\n return null;\n }\n return new FilterInvalidNode(parent, filter);\n }\n dependentFields() {\n return new Set(keys(this.filter));\n }\n producedFields() {\n return new Set(); // filter does not produce any new fields\n }\n hash() {\n return `FilterInvalid ${hash(this.filter)}`;\n }\n /**\n * Create the VgTransforms for each of the filtered fields.\n */\n assemble() {\n const filters = keys(this.filter).reduce((vegaFilters, field) => {\n const fieldDef = this.filter[field];\n const ref = fieldRef(fieldDef, { expr: 'datum' });\n if (fieldDef !== null) {\n if (fieldDef.type === 'temporal') {\n vegaFilters.push(`(isDate(${ref}) || (isValid(${ref}) && isFinite(+${ref})))`);\n }\n else if (fieldDef.type === 'quantitative') {\n vegaFilters.push(`isValid(${ref})`);\n vegaFilters.push(`isFinite(+${ref})`);\n }\n else {\n // should never get here\n }\n }\n return vegaFilters;\n }, []);\n return filters.length > 0\n ? {\n type: 'filter',\n expr: filters.join(' && ')\n }\n : null;\n }\n}\n//# sourceMappingURL=filterinvalid.js.map","import { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for flatten transform nodes\n */\nexport class FlattenTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const { flatten, as = [] } = this.transform;\n this.transform.as = flatten.map((f, i) => { var _a; return (_a = as[i]) !== null && _a !== void 0 ? _a : f; });\n }\n clone() {\n return new FlattenTransformNode(this.parent, duplicate(this.transform));\n }\n dependentFields() {\n return new Set(this.transform.flatten);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `FlattenTransform ${hash(this.transform)}`;\n }\n assemble() {\n const { flatten: fields, as } = this.transform;\n const result = {\n type: 'flatten',\n fields,\n as\n };\n return result;\n }\n}\n//# sourceMappingURL=flatten.js.map","import { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for flatten transform nodes\n */\nexport class FoldTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : 'key', (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : 'value'];\n }\n clone() {\n return new FoldTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n return new Set(this.transform.fold);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `FoldTransform ${hash(this.transform)}`;\n }\n assemble() {\n const { fold, as } = this.transform;\n const result = {\n type: 'fold',\n fields: fold,\n as\n };\n return result;\n }\n}\n//# sourceMappingURL=fold.js.map","import { isString } from 'vega-util';\nimport { LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2, SHAPE } from '../../channel';\nimport { getFieldOrDatumDef, isDatumDef, isFieldDef, isValueDef } from '../../channeldef';\nimport { GEOJSON } from '../../type';\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class GeoJSONNode extends DataFlowNode {\n constructor(parent, fields, geojson, signal) {\n super(parent);\n this.fields = fields;\n this.geojson = geojson;\n this.signal = signal;\n }\n clone() {\n return new GeoJSONNode(null, duplicate(this.fields), this.geojson, this.signal);\n }\n static parseAll(parent, model) {\n if (model.component.projection && !model.component.projection.isFit) {\n return parent;\n }\n let geoJsonCounter = 0;\n for (const coordinates of [\n [LONGITUDE, LATITUDE],\n [LONGITUDE2, LATITUDE2]\n ]) {\n const pair = coordinates.map(channel => {\n const def = getFieldOrDatumDef(model.encoding[channel]);\n return isFieldDef(def)\n ? def.field\n : isDatumDef(def)\n ? { expr: `${def.datum}` }\n : isValueDef(def)\n ? { expr: `${def['value']}` }\n : undefined;\n });\n if (pair[0] || pair[1]) {\n parent = new GeoJSONNode(parent, pair, null, model.getName(`geojson_${geoJsonCounter++}`));\n }\n }\n if (model.channelHasField(SHAPE)) {\n const fieldDef = model.typedFieldDef(SHAPE);\n if (fieldDef.type === GEOJSON) {\n parent = new GeoJSONNode(parent, null, fieldDef.field, model.getName(`geojson_${geoJsonCounter++}`));\n }\n }\n return parent;\n }\n dependentFields() {\n var _a;\n const fields = ((_a = this.fields) !== null && _a !== void 0 ? _a : []).filter(isString);\n return new Set([...(this.geojson ? [this.geojson] : []), ...fields]);\n }\n producedFields() {\n return new Set();\n }\n hash() {\n return `GeoJSON ${this.geojson} ${this.signal} ${hash(this.fields)}`;\n }\n assemble() {\n return Object.assign(Object.assign(Object.assign({ type: 'geojson' }, (this.fields ? { fields: this.fields } : {})), (this.geojson ? { geojson: this.geojson } : {})), { signal: this.signal });\n }\n}\n//# sourceMappingURL=geojson.js.map","import { isString } from 'vega-util';\nimport { LATITUDE, LATITUDE2, LONGITUDE, LONGITUDE2 } from '../../channel';\nimport { getFieldOrDatumDef, isDatumDef, isFieldDef, isValueDef } from '../../channeldef';\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class GeoPointNode extends DataFlowNode {\n constructor(parent, projection, fields, as) {\n super(parent);\n this.projection = projection;\n this.fields = fields;\n this.as = as;\n }\n clone() {\n return new GeoPointNode(null, this.projection, duplicate(this.fields), duplicate(this.as));\n }\n static parseAll(parent, model) {\n if (!model.projectionName()) {\n return parent;\n }\n for (const coordinates of [\n [LONGITUDE, LATITUDE],\n [LONGITUDE2, LATITUDE2]\n ]) {\n const pair = coordinates.map(channel => {\n const def = getFieldOrDatumDef(model.encoding[channel]);\n return isFieldDef(def)\n ? def.field\n : isDatumDef(def)\n ? { expr: `${def.datum}` }\n : isValueDef(def)\n ? { expr: `${def['value']}` }\n : undefined;\n });\n const suffix = coordinates[0] === LONGITUDE2 ? '2' : '';\n if (pair[0] || pair[1]) {\n parent = new GeoPointNode(parent, model.projectionName(), pair, [\n model.getName('x' + suffix),\n model.getName('y' + suffix)\n ]);\n }\n }\n return parent;\n }\n dependentFields() {\n return new Set(this.fields.filter(isString));\n }\n producedFields() {\n return new Set(this.as);\n }\n hash() {\n return `Geopoint ${this.projection} ${hash(this.fields)} ${hash(this.as)}`;\n }\n assemble() {\n return {\n type: 'geopoint',\n projection: this.projection,\n fields: this.fields,\n as: this.as\n };\n }\n}\n//# sourceMappingURL=geopoint.js.map","import { isFieldDef } from '../../channeldef';\nimport { pathGroupingFields } from '../../encoding';\nimport { isImputeSequence } from '../../transform';\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\nexport class ImputeNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new ImputeNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.impute, this.transform.key, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set([this.transform.impute]);\n }\n processSequence(keyvals) {\n const { start = 0, stop, step } = keyvals;\n const result = [start, stop, ...(step ? [step] : [])].join(',');\n return { signal: `sequence(${result})` };\n }\n static makeFromTransform(parent, imputeTransform) {\n return new ImputeNode(parent, imputeTransform);\n }\n static makeFromEncoding(parent, model) {\n const encoding = model.encoding;\n const xDef = encoding.x;\n const yDef = encoding.y;\n if (isFieldDef(xDef) && isFieldDef(yDef)) {\n const imputedChannel = xDef.impute ? xDef : yDef.impute ? yDef : undefined;\n if (imputedChannel === undefined) {\n return undefined;\n }\n const keyChannel = xDef.impute ? yDef : yDef.impute ? xDef : undefined;\n const { method, value, frame, keyvals } = imputedChannel.impute;\n const groupbyFields = pathGroupingFields(model.mark, encoding);\n return new ImputeNode(parent, Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ impute: imputedChannel.field, key: keyChannel.field }, (method ? { method } : {})), (value !== undefined ? { value } : {})), (frame ? { frame } : {})), (keyvals !== undefined ? { keyvals } : {})), (groupbyFields.length ? { groupby: groupbyFields } : {})));\n }\n return null;\n }\n hash() {\n return `Impute ${hash(this.transform)}`;\n }\n assemble() {\n const { impute, key, keyvals, method, groupby, value, frame = [null, null] } = this.transform;\n const imputeTransform = Object.assign(Object.assign(Object.assign(Object.assign({ type: 'impute', field: impute, key }, (keyvals ? { keyvals: isImputeSequence(keyvals) ? this.processSequence(keyvals) : keyvals } : {})), { method: 'value' }), (groupby ? { groupby } : {})), { value: !method || method === 'value' ? value : null });\n if (method && method !== 'value') {\n const deriveNewField = Object.assign({ type: 'window', as: [`imputed_${impute}_value`], ops: [method], fields: [impute], frame, ignorePeers: false }, (groupby ? { groupby } : {}));\n const replaceOriginal = {\n type: 'formula',\n expr: `datum.${impute} === null ? datum.imputed_${impute}_value : datum.${impute}`,\n as: impute\n };\n return [imputeTransform, deriveNewField, replaceOriginal];\n }\n else {\n return [imputeTransform];\n }\n }\n}\n//# sourceMappingURL=impute.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for loess transform nodes\n */\nexport class LoessTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : transform.on, (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : transform.loess];\n }\n clone() {\n return new LoessTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.loess, this.transform.on, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `LoessTransform ${hash(this.transform)}`;\n }\n assemble() {\n const _a = this.transform, { loess, on } = _a, rest = __rest(_a, [\"loess\", \"on\"]);\n const result = Object.assign({ type: 'loess', x: on, y: loess }, rest);\n return result;\n }\n}\n//# sourceMappingURL=loess.js.map","import { array, isString } from 'vega-util';\nimport * as log from '../../log';\nimport { isLookupData, isLookupSelection } from '../../transform';\nimport { duplicate, hash, varName } from '../../util';\nimport { DataFlowNode, OutputNode } from './dataflow';\nimport { findSource } from './parse';\nimport { SourceNode } from './source';\nimport { DataSourceType } from '../../data';\nexport class LookupNode extends DataFlowNode {\n constructor(parent, transform, secondary) {\n super(parent);\n this.transform = transform;\n this.secondary = secondary;\n }\n clone() {\n return new LookupNode(null, duplicate(this.transform), this.secondary);\n }\n static make(parent, model, transform, counter) {\n const sources = model.component.data.sources;\n const { from } = transform;\n let fromOutputNode = null;\n if (isLookupData(from)) {\n let fromSource = findSource(from.data, sources);\n if (!fromSource) {\n fromSource = new SourceNode(from.data);\n sources.push(fromSource);\n }\n const fromOutputName = model.getName(`lookup_${counter}`);\n fromOutputNode = new OutputNode(fromSource, fromOutputName, DataSourceType.Lookup, model.component.data.outputNodeRefCounts);\n model.component.data.outputNodes[fromOutputName] = fromOutputNode;\n }\n else if (isLookupSelection(from)) {\n const selName = from.selection;\n transform = Object.assign({ as: selName }, transform);\n fromOutputNode = model.getSelectionComponent(varName(selName), selName).materialized;\n if (!fromOutputNode) {\n throw new Error(log.message.noSameUnitLookup(selName));\n }\n }\n return new LookupNode(parent, transform, fromOutputNode.getSource());\n }\n dependentFields() {\n return new Set([this.transform.lookup]);\n }\n producedFields() {\n return new Set(this.transform.as ? array(this.transform.as) : this.transform.from.fields);\n }\n hash() {\n return `Lookup ${hash({ transform: this.transform, secondary: this.secondary })}`;\n }\n assemble() {\n let foreign;\n if (this.transform.from.fields) {\n // lookup a few fields and add create a flat output\n foreign = Object.assign({ values: this.transform.from.fields }, (this.transform.as ? { as: array(this.transform.as) } : {}));\n }\n else {\n // lookup full record and nest it\n let asName = this.transform.as;\n if (!isString(asName)) {\n log.warn(log.message.NO_FIELDS_NEEDS_AS);\n asName = '_lookup';\n }\n foreign = {\n as: [asName]\n };\n }\n return Object.assign(Object.assign({ type: 'lookup', from: this.secondary, key: this.transform.from.key, fields: [this.transform.lookup] }, foreign), (this.transform.default ? { default: this.transform.default } : {}));\n }\n}\n//# sourceMappingURL=lookup.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for quantile transform nodes\n */\nexport class QuantileTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : 'prob', (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : 'value'];\n }\n clone() {\n return new QuantileTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.quantile, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `QuantileTransform ${hash(this.transform)}`;\n }\n assemble() {\n const _a = this.transform, { quantile } = _a, rest = __rest(_a, [\"quantile\"]);\n const result = Object.assign({ type: 'quantile', field: quantile }, rest);\n return result;\n }\n}\n//# sourceMappingURL=quantile.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for regression transform nodes\n */\nexport class RegressionTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n var _a, _b, _c;\n super(parent);\n this.transform = transform;\n this.transform = duplicate(transform); // duplicate to prevent side effects\n const specifiedAs = (_a = this.transform.as) !== null && _a !== void 0 ? _a : [undefined, undefined];\n this.transform.as = [(_b = specifiedAs[0]) !== null && _b !== void 0 ? _b : transform.on, (_c = specifiedAs[1]) !== null && _c !== void 0 ? _c : transform.regression];\n }\n clone() {\n return new RegressionTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.regression, this.transform.on, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n producedFields() {\n return new Set(this.transform.as);\n }\n hash() {\n return `RegressionTransform ${hash(this.transform)}`;\n }\n assemble() {\n const _a = this.transform, { regression, on } = _a, rest = __rest(_a, [\"regression\", \"on\"]);\n const result = Object.assign({ type: 'regression', x: on, y: regression }, rest);\n return result;\n }\n}\n//# sourceMappingURL=regression.js.map","import { duplicate, hash, unique } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for pivot transform nodes.\n */\nexport class PivotTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new PivotTransformNode(null, duplicate(this.transform));\n }\n addDimensions(fields) {\n var _a;\n this.transform.groupby = unique(((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : []).concat(fields), d => d);\n }\n producedFields() {\n return undefined; // return undefined so that potentially everything can depend on the pivot\n }\n dependentFields() {\n var _a;\n return new Set([this.transform.pivot, this.transform.value, ...((_a = this.transform.groupby) !== null && _a !== void 0 ? _a : [])]);\n }\n hash() {\n return `PivotTransform ${hash(this.transform)}`;\n }\n assemble() {\n const { pivot, value, groupby, limit, op } = this.transform;\n return Object.assign(Object.assign(Object.assign({ type: 'pivot', field: pivot, value }, (limit !== undefined ? { limit } : {})), (op !== undefined ? { op } : {})), (groupby !== undefined ? { groupby } : {}));\n }\n}\n//# sourceMappingURL=pivot.js.map","import { duplicate, hash } from '../../util';\nimport { DataFlowNode } from './dataflow';\n/**\n * A class for the sample transform nodes\n */\nexport class SampleTransformNode extends DataFlowNode {\n constructor(parent, transform) {\n super(parent);\n this.transform = transform;\n }\n clone() {\n return new SampleTransformNode(null, duplicate(this.transform));\n }\n dependentFields() {\n return new Set();\n }\n producedFields() {\n return new Set();\n }\n hash() {\n return `SampleTransform ${hash(this.transform)}`;\n }\n assemble() {\n return {\n type: 'sample',\n size: this.transform.sample\n };\n }\n}\n//# sourceMappingURL=sample.js.map","import { isUrlData } from '../../data';\nimport { AggregateNode } from './aggregate';\nimport { BinNode } from './bin';\nimport { CalculateNode } from './calculate';\nimport { OutputNode } from './dataflow';\nimport { DensityTransformNode } from './density';\nimport { FacetNode } from './facet';\nimport { FilterNode } from './filter';\nimport { FilterInvalidNode } from './filterinvalid';\nimport { FlattenTransformNode } from './flatten';\nimport { FoldTransformNode } from './fold';\nimport { ParseNode } from './formatparse';\nimport { GeoJSONNode } from './geojson';\nimport { GeoPointNode } from './geopoint';\nimport { GraticuleNode } from './graticule';\nimport { IdentifierNode } from './identifier';\nimport { ImputeNode } from './impute';\nimport { JoinAggregateTransformNode } from './joinaggregate';\nimport { LoessTransformNode } from './loess';\nimport { LookupNode } from './lookup';\nimport { QuantileTransformNode } from './quantile';\nimport { RegressionTransformNode } from './regression';\nimport { PivotTransformNode } from './pivot';\nimport { SampleTransformNode } from './sample';\nimport { SequenceNode } from './sequence';\nimport { SourceNode } from './source';\nimport { StackNode } from './stack';\nimport { TimeUnitNode } from './timeunit';\nimport { WindowTransformNode } from './window';\nfunction makeWalkTree(data) {\n // to name datasources\n let datasetIndex = 0;\n /**\n * Recursively walk down the tree.\n */\n function walkTree(node, dataSource) {\n var _a;\n if (node instanceof SourceNode) {\n // If the source is a named data source or a data source with values, we need\n // to put it in a different data source. Otherwise, Vega may override the data.\n if (!node.isGenerator && !isUrlData(node.data)) {\n data.push(dataSource);\n const newData = {\n name: null,\n source: dataSource.name,\n transform: []\n };\n dataSource = newData;\n }\n }\n if (node instanceof ParseNode) {\n if (node.parent instanceof SourceNode && !dataSource.source) {\n // If node's parent is a root source and the data source does not refer to another data source, use normal format parse\n dataSource.format = Object.assign(Object.assign({}, ((_a = dataSource.format) !== null && _a !== void 0 ? _a : {})), { parse: node.assembleFormatParse() });\n // add calculates for all nested fields\n dataSource.transform.push(...node.assembleTransforms(true));\n }\n else {\n // Otherwise use Vega expression to parse\n dataSource.transform.push(...node.assembleTransforms());\n }\n }\n if (node instanceof FacetNode) {\n if (!dataSource.name) {\n dataSource.name = `data_${datasetIndex++}`;\n }\n if (!dataSource.source || dataSource.transform.length > 0) {\n data.push(dataSource);\n node.data = dataSource.name;\n }\n else {\n node.data = dataSource.source;\n }\n for (const d of node.assemble()) {\n data.push(d);\n }\n // break here because the rest of the tree has to be taken care of by the facet.\n return;\n }\n if (node instanceof GraticuleNode ||\n node instanceof SequenceNode ||\n node instanceof FilterInvalidNode ||\n node instanceof FilterNode ||\n node instanceof CalculateNode ||\n node instanceof GeoPointNode ||\n node instanceof GeoJSONNode ||\n node instanceof AggregateNode ||\n node instanceof LookupNode ||\n node instanceof WindowTransformNode ||\n node instanceof JoinAggregateTransformNode ||\n node instanceof FoldTransformNode ||\n node instanceof FlattenTransformNode ||\n node instanceof DensityTransformNode ||\n node instanceof LoessTransformNode ||\n node instanceof QuantileTransformNode ||\n node instanceof RegressionTransformNode ||\n node instanceof IdentifierNode ||\n node instanceof SampleTransformNode ||\n node instanceof PivotTransformNode) {\n dataSource.transform.push(node.assemble());\n }\n if (node instanceof BinNode ||\n node instanceof TimeUnitNode ||\n node instanceof ImputeNode ||\n node instanceof StackNode) {\n dataSource.transform.push(...node.assemble());\n }\n if (node instanceof OutputNode) {\n if (dataSource.source && dataSource.transform.length === 0) {\n node.setSource(dataSource.source);\n }\n else if (node.parent instanceof OutputNode) {\n // Note that an output node may be required but we still do not assemble a\n // separate data source for it.\n node.setSource(dataSource.name);\n }\n else {\n if (!dataSource.name) {\n dataSource.name = `data_${datasetIndex++}`;\n }\n // Here we set the name of the datasource we generated. From now on\n // other assemblers can use it.\n node.setSource(dataSource.name);\n // if this node has more than one child, we will add a datasource automatically\n if (node.numChildren() === 1) {\n data.push(dataSource);\n const newData = {\n name: null,\n source: dataSource.name,\n transform: []\n };\n dataSource = newData;\n }\n }\n }\n switch (node.numChildren()) {\n case 0:\n // done\n if (node instanceof OutputNode && (!dataSource.source || dataSource.transform.length > 0)) {\n // do not push empty datasources that are simply references\n data.push(dataSource);\n }\n break;\n case 1:\n walkTree(node.children[0], dataSource);\n break;\n default: {\n if (!dataSource.name) {\n dataSource.name = `data_${datasetIndex++}`;\n }\n let source = dataSource.name;\n if (!dataSource.source || dataSource.transform.length > 0) {\n data.push(dataSource);\n }\n else {\n source = dataSource.source;\n }\n for (const child of node.children) {\n const newData = {\n name: null,\n source: source,\n transform: []\n };\n walkTree(child, newData);\n }\n break;\n }\n }\n }\n return walkTree;\n}\n/**\n * Assemble data sources that are derived from faceted data.\n */\nexport function assembleFacetData(root) {\n const data = [];\n const walkTree = makeWalkTree(data);\n for (const child of root.children) {\n walkTree(child, {\n source: root.name,\n name: null,\n transform: []\n });\n }\n return data;\n}\n/**\n * Create Vega data array from a given compiled model and append all of them to the given array\n *\n * @param model\n * @param data array\n * @return modified data array\n */\nexport function assembleRootData(dataComponent, datasets) {\n var _a, _b;\n const data = [];\n // dataComponent.sources.forEach(debug);\n // draw(dataComponent.sources);\n const walkTree = makeWalkTree(data);\n let sourceIndex = 0;\n for (const root of dataComponent.sources) {\n // assign a name if the source does not have a name yet\n if (!root.hasName()) {\n root.dataName = `source_${sourceIndex++}`;\n }\n const newData = root.assemble();\n walkTree(root, newData);\n }\n // remove empty transform arrays for cleaner output\n for (const d of data) {\n if (d.transform.length === 0) {\n delete d.transform;\n }\n }\n // move sources without transforms (the ones that are potentially used in lookups) to the beginning\n let whereTo = 0;\n for (const [i, d] of data.entries()) {\n if (((_a = d.transform) !== null && _a !== void 0 ? _a : []).length === 0 && !d.source) {\n data.splice(whereTo++, 0, data.splice(i, 1)[0]);\n }\n }\n // now fix the from references in lookup transforms\n for (const d of data) {\n for (const t of (_b = d.transform) !== null && _b !== void 0 ? _b : []) {\n if (t.type === 'lookup') {\n t.from = dataComponent.outputNodes[t.from].getSource();\n }\n }\n }\n // inline values for datasets that are in the datastore\n for (const d of data) {\n if (d.name in datasets) {\n d.values = datasets[d.name];\n }\n }\n return data;\n}\n//# sourceMappingURL=assemble.js.map","import { isArray } from 'vega-util';\nimport { FACET_CHANNELS } from '../../channel';\nimport { title as fieldDefTitle } from '../../channeldef';\nimport { contains, getFirstDefined } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { assembleAxis } from '../axis/assemble';\nimport { parseGuideResolve } from '../resolve';\nimport { getHeaderProperty } from './common';\nexport function getHeaderType(orient) {\n if (orient === 'top' || orient === 'left' || isSignalRef(orient)) {\n // we always use header for orient signal since we can't dynamically make header becomes footer\n return 'header';\n }\n return 'footer';\n}\nexport function parseFacetHeaders(model) {\n for (const channel of FACET_CHANNELS) {\n parseFacetHeader(model, channel);\n }\n mergeChildAxis(model, 'x');\n mergeChildAxis(model, 'y');\n}\nfunction parseFacetHeader(model, channel) {\n var _a;\n const { facet, config, child, component } = model;\n if (model.channelHasField(channel)) {\n const fieldDef = facet[channel];\n const titleConfig = getHeaderProperty('title', null, config, channel);\n let title = fieldDefTitle(fieldDef, config, {\n allowDisabling: true,\n includeDefault: titleConfig === undefined || !!titleConfig\n });\n if (child.component.layoutHeaders[channel].title) {\n // TODO: better handle multiline titles\n title = isArray(title) ? title.join(', ') : title;\n // merge title with child to produce \"Title / Subtitle / Sub-subtitle\"\n title += ' / ' + child.component.layoutHeaders[channel].title;\n child.component.layoutHeaders[channel].title = null;\n }\n const labelOrient = getHeaderProperty('labelOrient', fieldDef, config, channel);\n const header = (_a = fieldDef.header) !== null && _a !== void 0 ? _a : {};\n const labels = getFirstDefined(header.labels, config.header.labels, true);\n const headerType = contains(['bottom', 'right'], labelOrient) ? 'footer' : 'header';\n component.layoutHeaders[channel] = {\n title,\n facetFieldDef: fieldDef,\n [headerType]: channel === 'facet' ? [] : [makeHeaderComponent(model, channel, labels)]\n };\n }\n}\nfunction makeHeaderComponent(model, channel, labels) {\n const sizeType = channel === 'row' ? 'height' : 'width';\n return {\n labels,\n sizeSignal: model.child.component.layoutSize.get(sizeType) ? model.child.getSizeSignalRef(sizeType) : undefined,\n axes: []\n };\n}\nfunction mergeChildAxis(model, channel) {\n var _a;\n const { child } = model;\n if (child.component.axes[channel]) {\n const { layoutHeaders, resolve } = model.component;\n resolve.axis[channel] = parseGuideResolve(resolve, channel);\n if (resolve.axis[channel] === 'shared') {\n // For shared axis, move the axes to facet's header or footer\n const headerChannel = channel === 'x' ? 'column' : 'row';\n const layoutHeader = layoutHeaders[headerChannel];\n for (const axisComponent of child.component.axes[channel]) {\n const headerType = getHeaderType(axisComponent.get('orient'));\n layoutHeader[headerType] = (_a = layoutHeader[headerType]) !== null && _a !== void 0 ? _a : [makeHeaderComponent(model, headerChannel, false)];\n // FIXME: assemble shouldn't be called here, but we do it this way so we only extract the main part of the axes\n const mainAxis = assembleAxis(axisComponent, 'main', model.config, { header: true });\n if (mainAxis) {\n // LayoutHeader no longer keep track of property precedence, thus let's combine.\n layoutHeader[headerType][0].axes.push(mainAxis);\n }\n axisComponent.mainExtracted = true;\n }\n }\n else {\n // Otherwise do nothing for independent axes\n }\n }\n}\n//# sourceMappingURL=parse.js.map","import { getPositionScaleChannel, getSizeChannel, POSITION_SCALE_CHANNELS } from '../../channel';\nimport { getViewConfigContinuousSize, getViewConfigDiscreteSize } from '../../config';\nimport { hasDiscreteDomain } from '../../scale';\nimport { isStep } from '../../spec/base';\nimport { isVgRangeStep } from '../../vega.schema';\nimport { mergeValuesWithExplicit } from '../split';\nimport { getSizeTypeFromLayoutSizeType } from './component';\nexport function parseLayerLayoutSize(model) {\n parseChildrenLayoutSize(model);\n parseNonUnitLayoutSizeForChannel(model, 'width');\n parseNonUnitLayoutSizeForChannel(model, 'height');\n}\nexport const parseRepeatLayoutSize = parseConcatLayoutSize;\nexport function parseConcatLayoutSize(model) {\n parseChildrenLayoutSize(model);\n // for columns === 1 (vconcat), we can completely merge width. Otherwise, we can treat merged width as childWidth.\n const widthType = model.layout.columns === 1 ? 'width' : 'childWidth';\n // for columns === undefined (hconcat), we can completely merge height. Otherwise, we can treat merged height as childHeight.\n const heightType = model.layout.columns === undefined ? 'height' : 'childHeight';\n parseNonUnitLayoutSizeForChannel(model, widthType);\n parseNonUnitLayoutSizeForChannel(model, heightType);\n}\nexport function parseChildrenLayoutSize(model) {\n for (const child of model.children) {\n child.parseLayoutSize();\n }\n}\n/**\n * Merge child layout size (width or height).\n */\nfunction parseNonUnitLayoutSizeForChannel(model, layoutSizeType) {\n /*\n * For concat, the parent width or height might not be the same as the children's shared height.\n * For example, hconcat's subviews may share width, but the shared width is not the hconcat view's width.\n *\n * layoutSizeType represents the output of the view (could be childWidth/childHeight/width/height)\n * while the sizeType represents the properties of the child.\n */\n const sizeType = getSizeTypeFromLayoutSizeType(layoutSizeType);\n const channel = getPositionScaleChannel(sizeType);\n const resolve = model.component.resolve;\n const layoutSizeCmpt = model.component.layoutSize;\n let mergedSize;\n // Try to merge layout size\n for (const child of model.children) {\n const childSize = child.component.layoutSize.getWithExplicit(sizeType);\n const scaleResolve = resolve.scale[channel];\n if (scaleResolve === 'independent' && childSize.value === 'step') {\n // Do not merge independent scales with range-step as their size depends\n // on the scale domains, which can be different between scales.\n mergedSize = undefined;\n break;\n }\n if (mergedSize) {\n if (scaleResolve === 'independent' && mergedSize.value !== childSize.value) {\n // For independent scale, only merge if all the sizes are the same.\n // If the values are different, abandon the merge!\n mergedSize = undefined;\n break;\n }\n mergedSize = mergeValuesWithExplicit(mergedSize, childSize, sizeType, '');\n }\n else {\n mergedSize = childSize;\n }\n }\n if (mergedSize) {\n // If merged, rename size and set size of all children.\n for (const child of model.children) {\n model.renameSignal(child.getName(sizeType), model.getName(layoutSizeType));\n child.component.layoutSize.set(sizeType, 'merged', false);\n }\n layoutSizeCmpt.setWithExplicit(layoutSizeType, mergedSize);\n }\n else {\n layoutSizeCmpt.setWithExplicit(layoutSizeType, {\n explicit: false,\n value: undefined\n });\n }\n}\nexport function parseUnitLayoutSize(model) {\n const { size, component } = model;\n for (const channel of POSITION_SCALE_CHANNELS) {\n const sizeType = getSizeChannel(channel);\n if (size[sizeType]) {\n const specifiedSize = size[sizeType];\n component.layoutSize.set(sizeType, isStep(specifiedSize) ? 'step' : specifiedSize, true);\n }\n else {\n const defaultSize = defaultUnitSize(model, sizeType);\n component.layoutSize.set(sizeType, defaultSize, false);\n }\n }\n}\nfunction defaultUnitSize(model, sizeType) {\n const channel = sizeType === 'width' ? 'x' : 'y';\n const config = model.config;\n const scaleComponent = model.getScaleComponent(channel);\n if (scaleComponent) {\n const scaleType = scaleComponent.get('type');\n const range = scaleComponent.get('range');\n if (hasDiscreteDomain(scaleType)) {\n const size = getViewConfigDiscreteSize(config.view, sizeType);\n if (isVgRangeStep(range) || isStep(size)) {\n // For discrete domain with range.step, use dynamic width/height\n return 'step';\n }\n else {\n return size;\n }\n }\n else {\n return getViewConfigContinuousSize(config.view, sizeType);\n }\n }\n else if (model.hasProjection || model.mark === 'arc') {\n // arc should use continuous size by default otherwise the pie is extremely small\n return getViewConfigContinuousSize(config.view, sizeType);\n }\n else {\n const size = getViewConfigDiscreteSize(config.view, sizeType);\n return isStep(size) ? size.step : size;\n }\n}\n//# sourceMappingURL=parse.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isArray } from 'vega-util';\nimport { isBinning } from '../bin';\nimport { COLUMN, FACET_CHANNELS, POSITION_SCALE_CHANNELS, ROW } from '../channel';\nimport { initFieldDef, vgField } from '../channeldef';\nimport { replaceExprRefInIndex } from '../expr';\nimport * as log from '../log';\nimport { hasDiscreteDomain } from '../scale';\nimport { DEFAULT_SORT_OP, isSortField } from '../sort';\nimport { isFacetMapping } from '../spec/facet';\nimport { contains, keys } from '../util';\nimport { isVgRangeStep } from '../vega.schema';\nimport { buildModel } from './buildmodel';\nimport { assembleFacetData } from './data/assemble';\nimport { sortArrayIndexField } from './data/calculate';\nimport { parseData } from './data/parse';\nimport { assembleLabelTitle } from './header/assemble';\nimport { getHeaderChannel, getHeaderProperty } from './header/common';\nimport { HEADER_CHANNELS, HEADER_TYPES } from './header/component';\nimport { parseFacetHeaders } from './header/parse';\nimport { parseChildrenLayoutSize } from './layoutsize/parse';\nimport { ModelWithField } from './model';\nimport { assembleDomain, getFieldFromDomain } from './scale/domain';\nimport { assembleFacetSignals } from './selection/assemble';\nexport function facetSortFieldName(fieldDef, sort, opt) {\n return vgField(sort, Object.assign({ suffix: `by_${vgField(fieldDef)}` }, (opt !== null && opt !== void 0 ? opt : {})));\n}\nexport class FacetModel extends ModelWithField {\n constructor(spec, parent, parentGivenName, config) {\n super(spec, 'facet', parent, parentGivenName, config, spec.resolve);\n this.child = buildModel(spec.spec, this, this.getName('child'), undefined, config);\n this.children = [this.child];\n this.facet = this.initFacet(spec.facet);\n }\n initFacet(facet) {\n // clone to prevent side effect to the original spec\n if (!isFacetMapping(facet)) {\n return { facet: this.initFacetFieldDef(facet, 'facet') };\n }\n const channels = keys(facet);\n const normalizedFacet = {};\n for (const channel of channels) {\n if (!contains([ROW, COLUMN], channel)) {\n // Drop unsupported channel\n log.warn(log.message.incompatibleChannel(channel, 'facet'));\n break;\n }\n const fieldDef = facet[channel];\n if (fieldDef.field === undefined) {\n log.warn(log.message.emptyFieldDef(fieldDef, channel));\n break;\n }\n normalizedFacet[channel] = this.initFacetFieldDef(fieldDef, channel);\n }\n return normalizedFacet;\n }\n initFacetFieldDef(fieldDef, channel) {\n const { header } = fieldDef, rest = __rest(fieldDef, [\"header\"]);\n // Cast because we call initFieldDef, which assumes general FieldDef.\n // However, FacetFieldDef is a bit more constrained than the general FieldDef\n const facetFieldDef = initFieldDef(rest, channel);\n if (header) {\n facetFieldDef.header = replaceExprRefInIndex(header);\n }\n return facetFieldDef;\n }\n channelHasField(channel) {\n return !!this.facet[channel];\n }\n fieldDef(channel) {\n return this.facet[channel];\n }\n parseData() {\n this.component.data = parseData(this);\n this.child.parseData();\n }\n parseLayoutSize() {\n parseChildrenLayoutSize(this);\n }\n parseSelections() {\n // As a facet has a single child, the selection components are the same.\n // The child maintains its selections to assemble signals, which remain\n // within its unit.\n this.child.parseSelections();\n this.component.selection = this.child.component.selection;\n }\n parseMarkGroup() {\n this.child.parseMarkGroup();\n }\n parseAxesAndHeaders() {\n this.child.parseAxesAndHeaders();\n parseFacetHeaders(this);\n }\n assembleSelectionTopLevelSignals(signals) {\n return this.child.assembleSelectionTopLevelSignals(signals);\n }\n assembleSignals() {\n this.child.assembleSignals();\n return [];\n }\n assembleSelectionData(data) {\n return this.child.assembleSelectionData(data);\n }\n getHeaderLayoutMixins() {\n var _a, _b, _c;\n const layoutMixins = {};\n for (const channel of FACET_CHANNELS) {\n for (const headerType of HEADER_TYPES) {\n const layoutHeaderComponent = this.component.layoutHeaders[channel];\n const headerComponent = layoutHeaderComponent[headerType];\n const { facetFieldDef } = layoutHeaderComponent;\n if (facetFieldDef) {\n const titleOrient = getHeaderProperty('titleOrient', facetFieldDef.header, this.config, channel);\n if (contains(['right', 'bottom'], titleOrient)) {\n const headerChannel = getHeaderChannel(channel, titleOrient);\n layoutMixins.titleAnchor = (_a = layoutMixins.titleAnchor) !== null && _a !== void 0 ? _a : {};\n layoutMixins.titleAnchor[headerChannel] = 'end';\n }\n }\n if (headerComponent === null || headerComponent === void 0 ? void 0 : headerComponent[0]) {\n // set header/footerBand\n const sizeType = channel === 'row' ? 'height' : 'width';\n const bandType = headerType === 'header' ? 'headerBand' : 'footerBand';\n if (channel !== 'facet' && !this.child.component.layoutSize.get(sizeType)) {\n // If facet child does not have size signal, then apply headerBand\n layoutMixins[bandType] = (_b = layoutMixins[bandType]) !== null && _b !== void 0 ? _b : {};\n layoutMixins[bandType][channel] = 0.5;\n }\n if (layoutHeaderComponent.title) {\n layoutMixins.offset = (_c = layoutMixins.offset) !== null && _c !== void 0 ? _c : {};\n layoutMixins.offset[channel === 'row' ? 'rowTitle' : 'columnTitle'] = 10;\n }\n }\n }\n }\n return layoutMixins;\n }\n assembleDefaultLayout() {\n const { column, row } = this.facet;\n const columns = column ? this.columnDistinctSignal() : row ? 1 : undefined;\n let align = 'all';\n // Do not align the cells if the scale corresponding to the direction is indepent.\n // We always align when we facet into both row and column.\n if (!row && this.component.resolve.scale.x === 'independent') {\n align = 'none';\n }\n else if (!column && this.component.resolve.scale.y === 'independent') {\n align = 'none';\n }\n return Object.assign(Object.assign(Object.assign({}, this.getHeaderLayoutMixins()), (columns ? { columns } : {})), { bounds: 'full', align });\n }\n assembleLayoutSignals() {\n // FIXME(https://github.com/vega/vega-lite/issues/1193): this can be incorrect if we have independent scales.\n return this.child.assembleLayoutSignals();\n }\n columnDistinctSignal() {\n if (this.parent && this.parent instanceof FacetModel) {\n // For nested facet, we will add columns to group mark instead\n // See discussion in https://github.com/vega/vega/issues/952\n // and https://github.com/vega/vega-view/releases/tag/v1.2.6\n return undefined;\n }\n else {\n // In facetNode.assemble(), the name is always this.getName('column') + '_layout'.\n const facetLayoutDataName = this.getName('column_domain');\n return { signal: `length(data('${facetLayoutDataName}'))` };\n }\n }\n assembleGroup(signals) {\n if (this.parent && this.parent instanceof FacetModel) {\n // Provide number of columns for layout.\n // See discussion in https://github.com/vega/vega/issues/952\n // and https://github.com/vega/vega-view/releases/tag/v1.2.6\n return Object.assign(Object.assign({}, (this.channelHasField('column')\n ? {\n encode: {\n update: {\n // TODO(https://github.com/vega/vega-lite/issues/2759):\n // Correct the signal for facet of concat of facet_column\n columns: { field: vgField(this.facet.column, { prefix: 'distinct' }) }\n }\n }\n }\n : {})), super.assembleGroup(signals));\n }\n return super.assembleGroup(signals);\n }\n /**\n * Aggregate cardinality for calculating size\n */\n getCardinalityAggregateForChild() {\n const fields = [];\n const ops = [];\n const as = [];\n if (this.child instanceof FacetModel) {\n if (this.child.channelHasField('column')) {\n const field = vgField(this.child.facet.column);\n fields.push(field);\n ops.push('distinct');\n as.push(`distinct_${field}`);\n }\n }\n else {\n for (const channel of POSITION_SCALE_CHANNELS) {\n const childScaleComponent = this.child.component.scales[channel];\n if (childScaleComponent && !childScaleComponent.merged) {\n const type = childScaleComponent.get('type');\n const range = childScaleComponent.get('range');\n if (hasDiscreteDomain(type) && isVgRangeStep(range)) {\n const domain = assembleDomain(this.child, channel);\n const field = getFieldFromDomain(domain);\n if (field) {\n fields.push(field);\n ops.push('distinct');\n as.push(`distinct_${field}`);\n }\n else {\n log.warn(log.message.unknownField(channel));\n }\n }\n }\n }\n }\n return { fields, ops, as };\n }\n assembleFacet() {\n const { name, data } = this.component.data.facetRoot;\n const { row, column } = this.facet;\n const { fields, ops, as } = this.getCardinalityAggregateForChild();\n const groupby = [];\n for (const channel of FACET_CHANNELS) {\n const fieldDef = this.facet[channel];\n if (fieldDef) {\n groupby.push(vgField(fieldDef));\n const { bin, sort } = fieldDef;\n if (isBinning(bin)) {\n groupby.push(vgField(fieldDef, { binSuffix: 'end' }));\n }\n if (isSortField(sort)) {\n const { field, op = DEFAULT_SORT_OP } = sort;\n const outputName = facetSortFieldName(fieldDef, sort);\n if (row && column) {\n // For crossed facet, use pre-calculate field as it requires a different groupby\n // For each calculated field, apply max and assign them to the same name as\n // all values of the same group should be the same anyway.\n fields.push(outputName);\n ops.push('max');\n as.push(outputName);\n }\n else {\n fields.push(field);\n ops.push(op);\n as.push(outputName);\n }\n }\n else if (isArray(sort)) {\n const outputName = sortArrayIndexField(fieldDef, channel);\n fields.push(outputName);\n ops.push('max');\n as.push(outputName);\n }\n }\n }\n const cross = !!row && !!column;\n return Object.assign({ name,\n data,\n groupby }, (cross || fields.length > 0\n ? {\n aggregate: Object.assign(Object.assign({}, (cross ? { cross } : {})), (fields.length ? { fields, ops, as } : {}))\n }\n : {}));\n }\n facetSortFields(channel) {\n const { facet } = this;\n const fieldDef = facet[channel];\n if (fieldDef) {\n if (isSortField(fieldDef.sort)) {\n return [facetSortFieldName(fieldDef, fieldDef.sort, { expr: 'datum' })];\n }\n else if (isArray(fieldDef.sort)) {\n return [sortArrayIndexField(fieldDef, channel, { expr: 'datum' })];\n }\n return [vgField(fieldDef, { expr: 'datum' })];\n }\n return [];\n }\n facetSortOrder(channel) {\n const { facet } = this;\n const fieldDef = facet[channel];\n if (fieldDef) {\n const { sort } = fieldDef;\n const order = (isSortField(sort) ? sort.order : !isArray(sort) && sort) || 'ascending';\n return [order];\n }\n return [];\n }\n assembleLabelTitle() {\n var _a;\n const { facet, config } = this;\n if (facet.facet) {\n // Facet always uses title to display labels\n return assembleLabelTitle(facet.facet, 'facet', config);\n }\n const ORTHOGONAL_ORIENT = {\n row: ['top', 'bottom'],\n column: ['left', 'right']\n };\n for (const channel of HEADER_CHANNELS) {\n if (facet[channel]) {\n const labelOrient = getHeaderProperty('labelOrient', (_a = facet[channel]) === null || _a === void 0 ? void 0 : _a.header, config, channel);\n if (contains(ORTHOGONAL_ORIENT[channel], labelOrient)) {\n // Row/Column with orthogonal labelOrient must use title to display labels\n return assembleLabelTitle(facet[channel], channel, config);\n }\n }\n }\n return undefined;\n }\n assembleMarks() {\n const { child } = this;\n // If we facet by two dimensions, we need to add a cross operator to the aggregation\n // so that we create all groups\n const facetRoot = this.component.data.facetRoot;\n const data = assembleFacetData(facetRoot);\n const encodeEntry = child.assembleGroupEncodeEntry(false);\n const title = this.assembleLabelTitle() || child.assembleTitle();\n const style = child.assembleGroupStyle();\n const markGroup = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ name: this.getName('cell'), type: 'group' }, (title ? { title } : {})), (style ? { style } : {})), { from: {\n facet: this.assembleFacet()\n }, \n // TODO: move this to after data\n sort: {\n field: FACET_CHANNELS.map(c => this.facetSortFields(c)).flat(),\n order: FACET_CHANNELS.map(c => this.facetSortOrder(c)).flat()\n } }), (data.length > 0 ? { data: data } : {})), (encodeEntry ? { encode: { update: encodeEntry } } : {})), child.assembleGroup(assembleFacetSignals(this, [])));\n return [markGroup];\n }\n getMapping() {\n return this.facet;\n }\n}\n//# sourceMappingURL=facet.js.map","import { AncestorParse } from '.';\nimport { isGenerator, isGraticuleGenerator, isInlineData, isNamedData, isSequenceGenerator, isUrlData, DataSourceType } from '../../data';\nimport * as log from '../../log';\nimport { isAggregate, isBin, isCalculate, isDensity, isFilter, isFlatten, isFold, isImpute, isJoinAggregate, isLoess, isLookup, isPivot, isQuantile, isRegression, isSample, isStack, isTimeUnit, isWindow } from '../../transform';\nimport { deepEqual, mergeDeep } from '../../util';\nimport { isFacetModel, isLayerModel, isUnitModel } from '../model';\nimport { requiresSelectionId } from '../selection';\nimport { materializeSelections } from '../selection/parse';\nimport { AggregateNode } from './aggregate';\nimport { BinNode } from './bin';\nimport { CalculateNode } from './calculate';\nimport { OutputNode } from './dataflow';\nimport { DensityTransformNode } from './density';\nimport { FacetNode } from './facet';\nimport { FilterNode } from './filter';\nimport { FilterInvalidNode } from './filterinvalid';\nimport { FlattenTransformNode } from './flatten';\nimport { FoldTransformNode } from './fold';\nimport { getImplicitFromEncoding, getImplicitFromFilterTransform, getImplicitFromSelection, ParseNode } from './formatparse';\nimport { GeoJSONNode } from './geojson';\nimport { GeoPointNode } from './geopoint';\nimport { GraticuleNode } from './graticule';\nimport { IdentifierNode } from './identifier';\nimport { ImputeNode } from './impute';\nimport { JoinAggregateTransformNode } from './joinaggregate';\nimport { makeJoinAggregateFromFacet } from './joinaggregatefacet';\nimport { LoessTransformNode } from './loess';\nimport { LookupNode } from './lookup';\nimport { PivotTransformNode } from './pivot';\nimport { QuantileTransformNode } from './quantile';\nimport { RegressionTransformNode } from './regression';\nimport { SampleTransformNode } from './sample';\nimport { SequenceNode } from './sequence';\nimport { SourceNode } from './source';\nimport { StackNode } from './stack';\nimport { TimeUnitNode } from './timeunit';\nimport { WindowTransformNode } from './window';\nexport function findSource(data, sources) {\n var _a, _b, _c, _d;\n for (const other of sources) {\n const otherData = other.data;\n // if both datasets have a name defined, we cannot merge\n if (data.name && other.hasName() && data.name !== other.dataName) {\n continue;\n }\n const formatMesh = (_a = data['format']) === null || _a === void 0 ? void 0 : _a.mesh;\n const otherFeature = (_b = otherData.format) === null || _b === void 0 ? void 0 : _b.feature;\n // feature and mesh are mutually exclusive\n if (formatMesh && otherFeature) {\n continue;\n }\n // we have to extract the same feature or mesh\n const formatFeature = (_c = data['format']) === null || _c === void 0 ? void 0 : _c.feature;\n if ((formatFeature || otherFeature) && formatFeature !== otherFeature) {\n continue;\n }\n const otherMesh = (_d = otherData.format) === null || _d === void 0 ? void 0 : _d.mesh;\n if ((formatMesh || otherMesh) && formatMesh !== otherMesh) {\n continue;\n }\n if (isInlineData(data) && isInlineData(otherData)) {\n if (deepEqual(data.values, otherData.values)) {\n return other;\n }\n }\n else if (isUrlData(data) && isUrlData(otherData)) {\n if (data.url === otherData.url) {\n return other;\n }\n }\n else if (isNamedData(data)) {\n if (data.name === other.dataName) {\n return other;\n }\n }\n }\n return null;\n}\nfunction parseRoot(model, sources) {\n if (model.data || !model.parent) {\n // if the model defines a data source or is the root, create a source node\n if (model.data === null) {\n // data: null means we should ignore the parent's data so we just create a new data source\n const source = new SourceNode({ values: [] });\n sources.push(source);\n return source;\n }\n const existingSource = findSource(model.data, sources);\n if (existingSource) {\n if (!isGenerator(model.data)) {\n existingSource.data.format = mergeDeep({}, model.data.format, existingSource.data.format);\n }\n // if the new source has a name but the existing one does not, we can set it\n if (!existingSource.hasName() && model.data.name) {\n existingSource.dataName = model.data.name;\n }\n return existingSource;\n }\n else {\n const source = new SourceNode(model.data);\n sources.push(source);\n return source;\n }\n }\n else {\n // If we don't have a source defined (overriding parent's data), use the parent's facet root or main.\n return model.parent.component.data.facetRoot\n ? model.parent.component.data.facetRoot\n : model.parent.component.data.main;\n }\n}\n/**\n * Parses a transform array into a chain of connected dataflow nodes.\n */\nexport function parseTransformArray(head, model, ancestorParse) {\n var _a, _b;\n let lookupCounter = 0;\n for (const t of model.transforms) {\n let derivedType = undefined;\n let transformNode;\n if (isCalculate(t)) {\n transformNode = head = new CalculateNode(head, t);\n derivedType = 'derived';\n }\n else if (isFilter(t)) {\n const implicit = getImplicitFromFilterTransform(t);\n transformNode = head = (_a = ParseNode.makeWithAncestors(head, {}, implicit, ancestorParse)) !== null && _a !== void 0 ? _a : head;\n head = new FilterNode(head, model, t.filter);\n }\n else if (isBin(t)) {\n transformNode = head = BinNode.makeFromTransform(head, t, model);\n derivedType = 'number';\n }\n else if (isTimeUnit(t)) {\n derivedType = 'date';\n const parsedAs = ancestorParse.getWithExplicit(t.field);\n // Create parse node because the input to time unit is always date.\n if (parsedAs.value === undefined) {\n head = new ParseNode(head, { [t.field]: derivedType });\n ancestorParse.set(t.field, derivedType, false);\n }\n transformNode = head = TimeUnitNode.makeFromTransform(head, t);\n }\n else if (isAggregate(t)) {\n transformNode = head = AggregateNode.makeFromTransform(head, t);\n derivedType = 'number';\n if (requiresSelectionId(model)) {\n head = new IdentifierNode(head);\n }\n }\n else if (isLookup(t)) {\n transformNode = head = LookupNode.make(head, model, t, lookupCounter++);\n derivedType = 'derived';\n }\n else if (isWindow(t)) {\n transformNode = head = new WindowTransformNode(head, t);\n derivedType = 'number';\n }\n else if (isJoinAggregate(t)) {\n transformNode = head = new JoinAggregateTransformNode(head, t);\n derivedType = 'number';\n }\n else if (isStack(t)) {\n transformNode = head = StackNode.makeFromTransform(head, t);\n derivedType = 'derived';\n }\n else if (isFold(t)) {\n transformNode = head = new FoldTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isFlatten(t)) {\n transformNode = head = new FlattenTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isPivot(t)) {\n transformNode = head = new PivotTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isSample(t)) {\n head = new SampleTransformNode(head, t);\n }\n else if (isImpute(t)) {\n transformNode = head = ImputeNode.makeFromTransform(head, t);\n derivedType = 'derived';\n }\n else if (isDensity(t)) {\n transformNode = head = new DensityTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isQuantile(t)) {\n transformNode = head = new QuantileTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isRegression(t)) {\n transformNode = head = new RegressionTransformNode(head, t);\n derivedType = 'derived';\n }\n else if (isLoess(t)) {\n transformNode = head = new LoessTransformNode(head, t);\n derivedType = 'derived';\n }\n else {\n log.warn(log.message.invalidTransformIgnored(t));\n continue;\n }\n if (transformNode && derivedType !== undefined) {\n for (const field of (_b = transformNode.producedFields()) !== null && _b !== void 0 ? _b : []) {\n ancestorParse.set(field, derivedType, false);\n }\n }\n }\n return head;\n}\n/*\nDescription of the dataflow (http://asciiflow.com/):\n +--------+\n | Source |\n +---+----+\n |\n v\n FormatParse\n (explicit)\n |\n v\n Transforms\n(Filter, Calculate, Binning, TimeUnit, Aggregate, Window, ...)\n |\n v\n FormatParse\n (implicit)\n |\n v\n Binning (in `encoding`)\n |\n v\n Timeunit (in `encoding`)\n |\n v\nFormula From Sort Array\n |\n v\n +--+--+\n | Raw |\n +-----+\n |\n v\n Aggregate (in `encoding`)\n |\n v\n Stack (in `encoding`)\n |\n v\n Invalid Filter\n |\n v\n +----------+\n | Main |\n +----------+\n |\n v\n +-------+\n | Facet |----> \"column\", \"column-layout\", and \"row\"\n +-------+\n |\n v\n ...Child data...\n*/\nexport function parseData(model) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n let head = parseRoot(model, model.component.data.sources);\n const { outputNodes, outputNodeRefCounts } = model.component.data;\n const ancestorParse = model.parent ? model.parent.component.data.ancestorParse.clone() : new AncestorParse();\n const data = model.data;\n if (isGenerator(data)) {\n // insert generator transform\n if (isSequenceGenerator(data)) {\n head = new SequenceNode(head, data.sequence);\n }\n else if (isGraticuleGenerator(data)) {\n head = new GraticuleNode(head, data.graticule);\n }\n // no parsing necessary for generator\n ancestorParse.parseNothing = true;\n }\n else if (((_a = data === null || data === void 0 ? void 0 : data.format) === null || _a === void 0 ? void 0 : _a.parse) === null) {\n // format.parse: null means disable parsing\n ancestorParse.parseNothing = true;\n }\n head = (_b = ParseNode.makeExplicit(head, model, ancestorParse)) !== null && _b !== void 0 ? _b : head;\n // Default discrete selections require an identifer transform to\n // uniquely identify data points. Add this transform at the head of\n // the pipeline such that the identifier field is available for all\n // subsequent datasets. During optimization, we will remove this\n // transform if it proves to be unnecessary. Additional identifier\n // transforms will be necessary when new tuples are constructed\n // (e.g., post-aggregation).\n head = new IdentifierNode(head);\n // HACK: This is equivalent for merging bin extent for union scale.\n // FIXME(https://github.com/vega/vega-lite/issues/2270): Correctly merge extent / bin node for shared bin scale\n const parentIsLayer = model.parent && isLayerModel(model.parent);\n if (isUnitModel(model) || isFacetModel(model)) {\n if (parentIsLayer) {\n head = (_c = BinNode.makeFromEncoding(head, model)) !== null && _c !== void 0 ? _c : head;\n }\n }\n if (model.transforms.length > 0) {\n head = parseTransformArray(head, model, ancestorParse);\n }\n // create parse nodes for fields that need to be parsed (or flattened) implicitly\n const implicitSelection = getImplicitFromSelection(model);\n const implicitEncoding = getImplicitFromEncoding(model);\n head = (_d = ParseNode.makeWithAncestors(head, {}, Object.assign(Object.assign({}, implicitSelection), implicitEncoding), ancestorParse)) !== null && _d !== void 0 ? _d : head;\n if (isUnitModel(model)) {\n head = GeoJSONNode.parseAll(head, model);\n head = GeoPointNode.parseAll(head, model);\n }\n if (isUnitModel(model) || isFacetModel(model)) {\n if (!parentIsLayer) {\n head = (_e = BinNode.makeFromEncoding(head, model)) !== null && _e !== void 0 ? _e : head;\n }\n head = (_f = TimeUnitNode.makeFromEncoding(head, model)) !== null && _f !== void 0 ? _f : head;\n head = CalculateNode.parseAllForSortIndex(head, model);\n }\n // add an output node pre aggregation\n const rawName = model.getDataName(DataSourceType.Raw);\n const raw = new OutputNode(head, rawName, DataSourceType.Raw, outputNodeRefCounts);\n outputNodes[rawName] = raw;\n head = raw;\n if (isUnitModel(model)) {\n const agg = AggregateNode.makeFromEncoding(head, model);\n if (agg) {\n head = agg;\n if (requiresSelectionId(model)) {\n head = new IdentifierNode(head);\n }\n }\n head = (_g = ImputeNode.makeFromEncoding(head, model)) !== null && _g !== void 0 ? _g : head;\n head = (_h = StackNode.makeFromEncoding(head, model)) !== null && _h !== void 0 ? _h : head;\n }\n if (isUnitModel(model)) {\n head = (_j = FilterInvalidNode.make(head, model)) !== null && _j !== void 0 ? _j : head;\n }\n // output node for marks\n const mainName = model.getDataName(DataSourceType.Main);\n const main = new OutputNode(head, mainName, DataSourceType.Main, outputNodeRefCounts);\n outputNodes[mainName] = main;\n head = main;\n if (isUnitModel(model)) {\n materializeSelections(model, main);\n }\n // add facet marker\n let facetRoot = null;\n if (isFacetModel(model)) {\n const facetName = model.getName('facet');\n // Derive new aggregate for facet's sort field\n // augment data source with new fields for crossed facet\n head = (_k = makeJoinAggregateFromFacet(head, model.facet)) !== null && _k !== void 0 ? _k : head;\n facetRoot = new FacetNode(head, model, facetName, main.getSource());\n outputNodes[facetName] = facetRoot;\n }\n return Object.assign(Object.assign({}, model.component.data), { outputNodes,\n outputNodeRefCounts,\n raw,\n main,\n facetRoot,\n ancestorParse });\n}\n//# sourceMappingURL=parse.js.map","import { vgField } from '../../channeldef';\nimport { DEFAULT_SORT_OP, isSortField } from '../../sort';\nimport { facetSortFieldName } from '../facet';\nimport { JoinAggregateTransformNode } from './joinaggregate';\nexport function makeJoinAggregateFromFacet(parent, facet) {\n const { row, column } = facet;\n if (row && column) {\n let newParent = null;\n // only need to make one for crossed facet\n for (const fieldDef of [row, column]) {\n if (isSortField(fieldDef.sort)) {\n const { field, op = DEFAULT_SORT_OP } = fieldDef.sort;\n parent = newParent = new JoinAggregateTransformNode(parent, {\n joinaggregate: [\n {\n op,\n field,\n as: facetSortFieldName(fieldDef, fieldDef.sort, { forAs: true })\n }\n ],\n groupby: [vgField(fieldDef)]\n });\n }\n }\n return newParent;\n }\n return null;\n}\n//# sourceMappingURL=joinaggregatefacet.js.map","import * as log from '../log';\nimport { isHConcatSpec, isVConcatSpec } from '../spec';\nimport { keys } from '../util';\nimport { buildModel } from './buildmodel';\nimport { parseData } from './data/parse';\nimport { assembleLayoutSignals } from './layoutsize/assemble';\nimport { parseConcatLayoutSize } from './layoutsize/parse';\nimport { Model } from './model';\nexport class ConcatModel extends Model {\n constructor(spec, parent, parentGivenName, config) {\n var _a, _b, _c, _d;\n super(spec, 'concat', parent, parentGivenName, config, spec.resolve);\n if (((_b = (_a = spec.resolve) === null || _a === void 0 ? void 0 : _a.axis) === null || _b === void 0 ? void 0 : _b.x) === 'shared' || ((_d = (_c = spec.resolve) === null || _c === void 0 ? void 0 : _c.axis) === null || _d === void 0 ? void 0 : _d.y) === 'shared') {\n log.warn(log.message.CONCAT_CANNOT_SHARE_AXIS);\n }\n this.children = this.getChildren(spec).map((child, i) => {\n return buildModel(child, this, this.getName('concat_' + i), undefined, config);\n });\n }\n parseData() {\n this.component.data = parseData(this);\n for (const child of this.children) {\n child.parseData();\n }\n }\n parseSelections() {\n // Merge selections up the hierarchy so that they may be referenced\n // across unit specs. Persist their definitions within each child\n // to assemble signals which remain within output Vega unit groups.\n this.component.selection = {};\n for (const child of this.children) {\n child.parseSelections();\n for (const key of keys(child.component.selection)) {\n this.component.selection[key] = child.component.selection[key];\n }\n }\n }\n parseMarkGroup() {\n for (const child of this.children) {\n child.parseMarkGroup();\n }\n }\n parseAxesAndHeaders() {\n for (const child of this.children) {\n child.parseAxesAndHeaders();\n }\n // TODO(#2415): support shared axes\n }\n getChildren(spec) {\n if (isVConcatSpec(spec)) {\n return spec.vconcat;\n }\n else if (isHConcatSpec(spec)) {\n return spec.hconcat;\n }\n return spec.concat;\n }\n parseLayoutSize() {\n parseConcatLayoutSize(this);\n }\n parseAxisGroup() {\n return null;\n }\n assembleSelectionTopLevelSignals(signals) {\n return this.children.reduce((sg, child) => child.assembleSelectionTopLevelSignals(sg), signals);\n }\n assembleSignals() {\n this.children.forEach(child => child.assembleSignals());\n return [];\n }\n assembleLayoutSignals() {\n const layoutSignals = assembleLayoutSignals(this);\n for (const child of this.children) {\n layoutSignals.push(...child.assembleLayoutSignals());\n }\n return layoutSignals;\n }\n assembleSelectionData(data) {\n return this.children.reduce((db, child) => child.assembleSelectionData(db), data);\n }\n assembleMarks() {\n // only children have marks\n return this.children.map(child => {\n const title = child.assembleTitle();\n const style = child.assembleGroupStyle();\n const encodeEntry = child.assembleGroupEncodeEntry(false);\n return Object.assign(Object.assign(Object.assign(Object.assign({ type: 'group', name: child.getName('group') }, (title ? { title } : {})), (style ? { style } : {})), (encodeEntry ? { encode: { update: encodeEntry } } : {})), child.assembleGroup());\n });\n }\n assembleDefaultLayout() {\n const columns = this.layout.columns;\n return Object.assign(Object.assign({}, (columns != null ? { columns: columns } : {})), { bounds: 'full', \n // Use align each so it can work with multiple plots with different size\n align: 'each' });\n }\n}\n//# sourceMappingURL=concat.js.map","import { COMMON_AXIS_PROPERTIES_INDEX } from '../../axis';\nimport { duplicate, keys } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { Split } from '../split';\nfunction isFalseOrNull(v) {\n return v === false || v === null;\n}\nconst AXIS_COMPONENT_PROPERTIES_INDEX = Object.assign(Object.assign({ disable: 1, gridScale: 1, scale: 1 }, COMMON_AXIS_PROPERTIES_INDEX), { labelExpr: 1, encode: 1 });\nexport const AXIS_COMPONENT_PROPERTIES = keys(AXIS_COMPONENT_PROPERTIES_INDEX);\nexport class AxisComponent extends Split {\n constructor(explicit = {}, implicit = {}, mainExtracted = false) {\n super();\n this.explicit = explicit;\n this.implicit = implicit;\n this.mainExtracted = mainExtracted;\n }\n clone() {\n return new AxisComponent(duplicate(this.explicit), duplicate(this.implicit), this.mainExtracted);\n }\n hasAxisPart(part) {\n // FIXME(https://github.com/vega/vega-lite/issues/2552) this method can be wrong if users use a Vega theme.\n if (part === 'axis') {\n // always has the axis container part\n return true;\n }\n if (part === 'grid' || part === 'title') {\n return !!this.get(part);\n }\n // Other parts are enabled by default, so they should not be false or null.\n return !isFalseOrNull(this.get(part));\n }\n hasOrientSignalRef() {\n return isSignalRef(this.explicit.orient);\n }\n}\n//# sourceMappingURL=component.js.map","import { AXIS_PARTS, isAxisProperty, isConditionalAxisValue } from '../../axis';\nimport { POSITION_SCALE_CHANNELS } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { getFirstDefined, isEmpty, keys, normalizeAngle } from '../../util';\nimport { isSignalRef } from '../../vega.schema';\nimport { mergeTitleComponent } from '../common';\nimport { guideEncodeEntry } from '../guide';\nimport { parseGuideResolve } from '../resolve';\nimport { defaultTieBreaker, mergeValuesWithExplicit } from '../split';\nimport { AxisComponent, AXIS_COMPONENT_PROPERTIES } from './component';\nimport { getAxisConfig, getAxisConfigs } from './config';\nimport * as encode from './encode';\nimport { axisRules, defaultOrient, getFieldDefTitle, getLabelAngle } from './properties';\nexport function parseUnitAxes(model) {\n return POSITION_SCALE_CHANNELS.reduce((axis, channel) => {\n if (model.component.scales[channel]) {\n axis[channel] = [parseAxis(channel, model)];\n }\n return axis;\n }, {});\n}\nconst OPPOSITE_ORIENT = {\n bottom: 'top',\n top: 'bottom',\n left: 'right',\n right: 'left'\n};\nexport function parseLayerAxes(model) {\n var _a;\n const { axes, resolve } = model.component;\n const axisCount = { top: 0, bottom: 0, right: 0, left: 0 };\n for (const child of model.children) {\n child.parseAxesAndHeaders();\n for (const channel of keys(child.component.axes)) {\n resolve.axis[channel] = parseGuideResolve(model.component.resolve, channel);\n if (resolve.axis[channel] === 'shared') {\n // If the resolve says shared (and has not been overridden)\n // We will try to merge and see if there is a conflict\n axes[channel] = mergeAxisComponents(axes[channel], child.component.axes[channel]);\n if (!axes[channel]) {\n // If merge returns nothing, there is a conflict so we cannot make the axis shared.\n // Thus, mark axis as independent and remove the axis component.\n resolve.axis[channel] = 'independent';\n delete axes[channel];\n }\n }\n }\n }\n // Move axes to layer's axis component and merge shared axes\n for (const channel of POSITION_SCALE_CHANNELS) {\n for (const child of model.children) {\n if (!child.component.axes[channel]) {\n // skip if the child does not have a particular axis\n continue;\n }\n if (resolve.axis[channel] === 'independent') {\n // If axes are independent, concat the axisComponent array.\n axes[channel] = ((_a = axes[channel]) !== null && _a !== void 0 ? _a : []).concat(child.component.axes[channel]);\n // Automatically adjust orient\n for (const axisComponent of child.component.axes[channel]) {\n const { value: orient, explicit } = axisComponent.getWithExplicit('orient');\n if (isSignalRef(orient)) {\n continue;\n }\n if (axisCount[orient] > 0 && !explicit) {\n // Change axis orient if the number do not match\n const oppositeOrient = OPPOSITE_ORIENT[orient];\n if (axisCount[orient] > axisCount[oppositeOrient]) {\n axisComponent.set('orient', oppositeOrient, false);\n }\n }\n axisCount[orient]++;\n // TODO(https://github.com/vega/vega-lite/issues/2634): automatically add extra offset?\n }\n }\n // After merging, make sure to remove axes from child\n delete child.component.axes[channel];\n }\n // Suppress grid lines for dual axis charts (https://github.com/vega/vega-lite/issues/4676)\n if (resolve.axis[channel] === 'independent' && axes[channel] && axes[channel].length > 1) {\n for (const axisCmpt of axes[channel]) {\n if (!!axisCmpt.get('grid') && !axisCmpt.explicit.grid) {\n axisCmpt.implicit.grid = false;\n }\n }\n }\n }\n}\nfunction mergeAxisComponents(mergedAxisCmpts, childAxisCmpts) {\n if (mergedAxisCmpts) {\n // FIXME: this is a bit wrong once we support multiple axes\n if (mergedAxisCmpts.length !== childAxisCmpts.length) {\n return undefined; // Cannot merge axis component with different number of axes.\n }\n const length = mergedAxisCmpts.length;\n for (let i = 0; i < length; i++) {\n const merged = mergedAxisCmpts[i];\n const child = childAxisCmpts[i];\n if (!!merged !== !!child) {\n return undefined;\n }\n else if (merged && child) {\n const mergedOrient = merged.getWithExplicit('orient');\n const childOrient = child.getWithExplicit('orient');\n if (mergedOrient.explicit && childOrient.explicit && mergedOrient.value !== childOrient.value) {\n // TODO: throw warning if resolve is explicit (We don't have info about explicit/implicit resolve yet.)\n // Cannot merge due to inconsistent orient\n return undefined;\n }\n else {\n mergedAxisCmpts[i] = mergeAxisComponent(merged, child);\n }\n }\n }\n }\n else {\n // For first one, return a copy of the child\n return childAxisCmpts.map(axisComponent => axisComponent.clone());\n }\n return mergedAxisCmpts;\n}\nfunction mergeAxisComponent(merged, child) {\n for (const prop of AXIS_COMPONENT_PROPERTIES) {\n const mergedValueWithExplicit = mergeValuesWithExplicit(merged.getWithExplicit(prop), child.getWithExplicit(prop), prop, 'axis', \n // Tie breaker function\n (v1, v2) => {\n switch (prop) {\n case 'title':\n return mergeTitleComponent(v1, v2);\n case 'gridScale':\n return {\n explicit: v1.explicit,\n value: getFirstDefined(v1.value, v2.value)\n };\n }\n return defaultTieBreaker(v1, v2, prop, 'axis');\n });\n merged.setWithExplicit(prop, mergedValueWithExplicit);\n }\n return merged;\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isExplicit(value, property, axis, model, channel) {\n if (property === 'disable') {\n return axis !== undefined; // if axis is specified or null/false, then it's enable/disable state is explicit\n }\n axis = axis || {};\n switch (property) {\n case 'titleAngle':\n case 'labelAngle':\n return value === (isSignalRef(axis.labelAngle) ? axis.labelAngle : normalizeAngle(axis.labelAngle));\n case 'values':\n return !!axis.values;\n // specified axis.values is already respected, but may get transformed.\n case 'encode':\n // both VL axis.encoding and axis.labelAngle affect VG axis.encode\n return !!axis.encoding || !!axis.labelAngle;\n case 'title':\n // title can be explicit if fieldDef.title is set\n if (value === getFieldDefTitle(model, channel)) {\n return true;\n }\n }\n // Otherwise, things are explicit if the returned value matches the specified property\n return value === axis[property];\n}\n/**\n * Properties to always include values from config\n */\nconst propsToAlwaysIncludeConfig = new Set([\n 'grid',\n 'translate',\n // the rest are not axis configs in Vega, but are in VL, so we need to set too.\n 'format',\n 'formatType',\n 'orient',\n 'labelExpr',\n 'tickCount',\n 'position',\n 'tickMinStep'\n]);\nfunction parseAxis(channel, model) {\n var _a, _b, _c;\n let axis = model.axis(channel);\n const axisComponent = new AxisComponent();\n const fieldOrDatumDef = getFieldOrDatumDef(model.encoding[channel]);\n const { mark, config } = model;\n const orient = (axis === null || axis === void 0 ? void 0 : axis.orient) || ((_a = config[channel === 'x' ? 'axisX' : 'axisY']) === null || _a === void 0 ? void 0 : _a.orient) || ((_b = config.axis) === null || _b === void 0 ? void 0 : _b.orient) ||\n defaultOrient(channel);\n const scaleType = model.getScaleComponent(channel).get('type');\n const axisConfigs = getAxisConfigs(channel, scaleType, orient, model.config);\n const disable = axis !== undefined ? !axis : getAxisConfig('disable', config.style, axis === null || axis === void 0 ? void 0 : axis.style, axisConfigs).configValue;\n axisComponent.set('disable', disable, axis !== undefined);\n if (disable) {\n return axisComponent;\n }\n axis = axis || {};\n const labelAngle = getLabelAngle(fieldOrDatumDef, axis, channel, config.style, axisConfigs);\n const ruleParams = {\n fieldOrDatumDef,\n axis,\n channel,\n model,\n scaleType,\n orient,\n labelAngle,\n mark,\n config\n };\n // 1.2. Add properties\n for (const property of AXIS_COMPONENT_PROPERTIES) {\n const value = property in axisRules ? axisRules[property](ruleParams) : isAxisProperty(property) ? axis[property] : undefined;\n const hasValue = value !== undefined;\n const explicit = isExplicit(value, property, axis, model, channel);\n if (hasValue && explicit) {\n axisComponent.set(property, value, explicit);\n }\n else {\n const { configValue = undefined, configFrom = undefined } = isAxisProperty(property) && property !== 'values'\n ? getAxisConfig(property, config.style, axis.style, axisConfigs)\n : {};\n const hasConfigValue = configValue !== undefined;\n if (hasValue && !hasConfigValue) {\n // only set property if it is explicitly set or has no config value (otherwise we will accidentally override config)\n axisComponent.set(property, value, explicit);\n }\n else if (\n // Cases need implicit values\n // 1. Axis config that aren't available in Vega\n !(configFrom === 'vgAxisConfig') ||\n // 2. Certain properties are always included (see `propsToAlwaysIncludeConfig`'s declaration for more details)\n (propsToAlwaysIncludeConfig.has(property) && hasConfigValue) ||\n // 3. Conditional axis values and signals\n isConditionalAxisValue(configValue) ||\n isSignalRef(configValue)) {\n // If a config is specified and is conditional, copy conditional value from axis config\n axisComponent.set(property, configValue, false);\n }\n }\n }\n // 2) Add guide encode definition groups\n const axisEncoding = (_c = axis.encoding) !== null && _c !== void 0 ? _c : {};\n const axisEncode = AXIS_PARTS.reduce((e, part) => {\n var _a;\n if (!axisComponent.hasAxisPart(part)) {\n // No need to create encode for a disabled part.\n return e;\n }\n const axisEncodingPart = guideEncodeEntry((_a = axisEncoding[part]) !== null && _a !== void 0 ? _a : {}, model);\n const value = part === 'labels' ? encode.labels(model, channel, axisEncodingPart) : axisEncodingPart;\n if (value !== undefined && !isEmpty(value)) {\n e[part] = { update: value };\n }\n return e;\n }, {});\n // FIXME: By having encode as one property, we won't have fine grained encode merging.\n if (!isEmpty(axisEncode)) {\n axisComponent.set('encode', axisEncode, !!axis.encoding || axis.labelAngle !== undefined);\n }\n return axisComponent;\n}\n//# sourceMappingURL=parse.js.map","import { getSecondaryRangeChannel } from '../../channel';\nimport { getFieldOrDatumDef } from '../../channeldef';\nimport { formatCustomType, isCustomFormatType } from '../format';\nexport function labels(model, channel, specifiedLabelsSpec) {\n var _a;\n const { encoding, config } = model;\n const fieldOrDatumDef = (_a = getFieldOrDatumDef(encoding[channel])) !== null && _a !== void 0 ? _a : getFieldOrDatumDef(encoding[getSecondaryRangeChannel(channel)]);\n const axis = model.axis(channel) || {};\n const { format, formatType } = axis;\n if (isCustomFormatType(formatType)) {\n return Object.assign({ text: formatCustomType({\n fieldOrDatumDef,\n field: 'datum.value',\n format,\n formatType,\n config\n }) }, specifiedLabelsSpec);\n }\n return specifiedLabelsSpec;\n}\n//# sourceMappingURL=encode.js.map","import * as encode from './encode';\nfunction encodeEntry(model, fixedShape) {\n const { config } = model;\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'include',\n orient: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.nonPosition('size', model)), encode.nonPosition('angle', model)), shapeMixins(model, config, fixedShape));\n}\nexport function shapeMixins(model, config, fixedShape) {\n if (fixedShape) {\n return { shape: { value: fixedShape } };\n }\n return encode.nonPosition('shape', model);\n}\nexport const point = {\n vgMark: 'symbol',\n encodeEntry: (model) => {\n return encodeEntry(model);\n }\n};\nexport const circle = {\n vgMark: 'symbol',\n encodeEntry: (model) => {\n return encodeEntry(model, 'circle');\n }\n};\nexport const square = {\n vgMark: 'symbol',\n encodeEntry: (model) => {\n return encodeEntry(model, 'square');\n }\n};\n//# sourceMappingURL=point.js.map","import { isNumber } from 'vega-util';\nimport { getViewConfigDiscreteStep } from '../../config';\nimport { isVgRangeStep } from '../../vega.schema';\nimport { getMarkPropOrConfig, signalOrValueRef } from '../common';\nimport * as encode from './encode';\nexport const tick = {\n vgMark: 'rect',\n encodeEntry: (model) => {\n const { config, markDef } = model;\n const orient = markDef.orient;\n const vgSizeChannel = orient === 'horizontal' ? 'width' : 'height';\n const vgThicknessChannel = orient === 'horizontal' ? 'height' : 'width';\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid', vgChannel: 'xc' })), encode.pointPosition('y', model, { defaultPos: 'mid', vgChannel: 'yc' })), encode.nonPosition('size', model, {\n defaultValue: defaultSize(model),\n vgChannel: vgSizeChannel\n })), { [vgThicknessChannel]: signalOrValueRef(getMarkPropOrConfig('thickness', markDef, config)) });\n }\n};\nfunction defaultSize(model) {\n var _a;\n const { config, markDef } = model;\n const { orient } = markDef;\n const vgSizeChannel = orient === 'horizontal' ? 'width' : 'height';\n const scale = model.getScaleComponent(orient === 'horizontal' ? 'x' : 'y');\n const markPropOrConfig = (_a = getMarkPropOrConfig('size', markDef, config, { vgChannel: vgSizeChannel })) !== null && _a !== void 0 ? _a : config.tick.bandSize;\n if (markPropOrConfig !== undefined) {\n return markPropOrConfig;\n }\n else {\n const scaleRange = scale ? scale.get('range') : undefined;\n if (scaleRange && isVgRangeStep(scaleRange) && isNumber(scaleRange.step)) {\n return (scaleRange.step * 3) / 4;\n }\n const defaultViewStep = getViewConfigDiscreteStep(config.view, vgSizeChannel);\n return (defaultViewStep * 3) / 4;\n }\n}\n//# sourceMappingURL=tick.js.map","import { isArray } from 'vega-util';\nimport { isFieldDef, isValueDef, vgField } from '../../channeldef';\nimport { DataSourceType } from '../../data';\nimport { isAggregate, pathGroupingFields } from '../../encoding';\nimport { AREA, BAR, isPathMark, LINE, TRAIL } from '../../mark';\nimport { isSortByEncoding, isSortField } from '../../sort';\nimport { contains, getFirstDefined, isNullOrFalse, keys, omit, pick } from '../../util';\nimport { VG_CORNERRADIUS_CHANNELS } from '../../vega.schema';\nimport { getMarkConfig, getMarkPropOrConfig, getStyles, signalOrValueRef, sortParams } from '../common';\nimport { arc } from './arc';\nimport { area } from './area';\nimport { bar } from './bar';\nimport { geoshape } from './geoshape';\nimport { image } from './image';\nimport { line, trail } from './line';\nimport { circle, point, square } from './point';\nimport { rect } from './rect';\nimport { rule } from './rule';\nimport { text } from './text';\nimport { tick } from './tick';\nconst markCompiler = {\n arc,\n area,\n bar,\n circle,\n geoshape,\n image,\n line,\n point,\n rect,\n rule,\n square,\n text,\n tick,\n trail\n};\nexport function parseMarkGroups(model) {\n if (contains([LINE, AREA, TRAIL], model.mark)) {\n const details = pathGroupingFields(model.mark, model.encoding);\n if (details.length > 0) {\n return getPathGroups(model, details);\n }\n // otherwise use standard mark groups\n }\n else if (contains([BAR], model.mark)) {\n const hasCornerRadius = VG_CORNERRADIUS_CHANNELS.some(prop => getMarkPropOrConfig(prop, model.markDef, model.config));\n if (model.stack && !model.fieldDef('size') && hasCornerRadius) {\n return getGroupsForStackedBarWithCornerRadius(model);\n }\n }\n return getMarkGroup(model);\n}\nconst FACETED_PATH_PREFIX = 'faceted_path_';\nfunction getPathGroups(model, details) {\n // TODO: for non-stacked plot, map order to zindex. (Maybe rename order for layer to zindex?)\n return [\n {\n name: model.getName('pathgroup'),\n type: 'group',\n from: {\n facet: {\n name: FACETED_PATH_PREFIX + model.requestDataName(DataSourceType.Main),\n data: model.requestDataName(DataSourceType.Main),\n groupby: details\n }\n },\n encode: {\n update: {\n width: { field: { group: 'width' } },\n height: { field: { group: 'height' } }\n }\n },\n // With subfacet for line/area group, need to use faceted data from above.\n marks: getMarkGroup(model, { fromPrefix: FACETED_PATH_PREFIX })\n }\n ];\n}\nconst STACK_GROUP_PREFIX = 'stack_group_';\n/**\n * We need to put stacked bars into groups in order to enable cornerRadius for stacks.\n * If stack is used and the model doesn't have size encoding, we put the mark into groups,\n * and apply cornerRadius properties at the group.\n */\nfunction getGroupsForStackedBarWithCornerRadius(model) {\n // Generate the mark\n const [mark] = getMarkGroup(model, { fromPrefix: STACK_GROUP_PREFIX });\n // Get the scale for the stacked field\n const fieldScale = model.scaleName(model.stack.fieldChannel);\n const stackField = (opt = {}) => model.vgField(model.stack.fieldChannel, opt);\n // Find the min/max of the pixel value on the stacked direction\n const stackFieldGroup = (func, expr) => {\n const vgFieldMinMax = [\n stackField({ prefix: 'min', suffix: 'start', expr }),\n stackField({ prefix: 'max', suffix: 'start', expr }),\n stackField({ prefix: 'min', suffix: 'end', expr }),\n stackField({ prefix: 'max', suffix: 'end', expr })\n ];\n return `${func}(${vgFieldMinMax.map(field => `scale('${fieldScale}',${field})`).join(',')})`;\n };\n let groupUpdate;\n let innerGroupUpdate;\n // Build the encoding for group and an inner group\n if (model.stack.fieldChannel === 'x') {\n // Move cornerRadius, y/yc/y2/height properties to group\n // Group x/x2 should be the min/max of the marks within\n groupUpdate = Object.assign(Object.assign({}, pick(mark.encode.update, ['y', 'yc', 'y2', 'height', ...VG_CORNERRADIUS_CHANNELS])), { x: { signal: stackFieldGroup('min', 'datum') }, x2: { signal: stackFieldGroup('max', 'datum') }, clip: { value: true } });\n // Inner group should revert the x translation, and pass height through\n innerGroupUpdate = {\n x: { field: { group: 'x' }, mult: -1 },\n height: { field: { group: 'height' } }\n };\n // The marks should use the same height as group, without y/yc/y2 properties (because it's already done by group)\n // This is why size encoding is not supported yet\n mark.encode.update = Object.assign(Object.assign({}, omit(mark.encode.update, ['y', 'yc', 'y2'])), { height: { field: { group: 'height' } } });\n }\n else {\n groupUpdate = Object.assign(Object.assign({}, pick(mark.encode.update, ['x', 'xc', 'x2', 'width'])), { y: { signal: stackFieldGroup('min', 'datum') }, y2: { signal: stackFieldGroup('max', 'datum') }, clip: { value: true } });\n innerGroupUpdate = {\n y: { field: { group: 'y' }, mult: -1 },\n width: { field: { group: 'width' } }\n };\n mark.encode.update = Object.assign(Object.assign({}, omit(mark.encode.update, ['x', 'xc', 'x2'])), { width: { field: { group: 'width' } } });\n }\n // Deal with cornerRadius properties\n for (const key of VG_CORNERRADIUS_CHANNELS) {\n const configValue = getMarkConfig(key, model.markDef, model.config);\n // Move from mark to group\n if (mark.encode.update[key]) {\n groupUpdate[key] = mark.encode.update[key];\n delete mark.encode.update[key];\n }\n else if (configValue) {\n groupUpdate[key] = signalOrValueRef(configValue);\n }\n // Overwrite any cornerRadius on mark set by config --- they are already moved to the group\n if (configValue) {\n mark.encode.update[key] = { value: 0 };\n }\n }\n // For bin and time unit, we have to add bin/timeunit -end channels.\n const groupByField = model.fieldDef(model.stack.groupbyChannel);\n const groupby = vgField(groupByField) ? [vgField(groupByField)] : [];\n if ((groupByField === null || groupByField === void 0 ? void 0 : groupByField.bin) || (groupByField === null || groupByField === void 0 ? void 0 : groupByField.timeUnit)) {\n groupby.push(vgField(groupByField, { binSuffix: 'end' }));\n }\n const strokeProperties = [\n 'stroke',\n 'strokeWidth',\n 'strokeJoin',\n 'strokeCap',\n 'strokeDash',\n 'strokeDashOffset',\n 'strokeMiterLimit',\n 'strokeOpacity'\n ];\n // Generate stroke properties for the group\n groupUpdate = strokeProperties.reduce((encode, prop) => {\n if (mark.encode.update[prop]) {\n return Object.assign(Object.assign({}, encode), { [prop]: mark.encode.update[prop] });\n }\n else {\n const configValue = getMarkConfig(prop, model.markDef, model.config);\n if (configValue !== undefined) {\n return Object.assign(Object.assign({}, encode), { [prop]: signalOrValueRef(configValue) });\n }\n else {\n return encode;\n }\n }\n }, groupUpdate);\n // Apply strokeForeground and strokeOffset if stroke is used\n if (groupUpdate.stroke) {\n groupUpdate.strokeForeground = { value: true };\n groupUpdate.strokeOffset = { value: 0 };\n }\n return [\n {\n type: 'group',\n from: {\n facet: {\n data: model.requestDataName(DataSourceType.Main),\n name: STACK_GROUP_PREFIX + model.requestDataName(DataSourceType.Main),\n groupby,\n aggregate: {\n fields: [\n stackField({ suffix: 'start' }),\n stackField({ suffix: 'start' }),\n stackField({ suffix: 'end' }),\n stackField({ suffix: 'end' })\n ],\n ops: ['min', 'max', 'min', 'max']\n }\n }\n },\n encode: {\n update: groupUpdate\n },\n marks: [\n {\n type: 'group',\n encode: { update: innerGroupUpdate },\n marks: [mark]\n }\n ]\n }\n ];\n}\nexport function getSort(model) {\n const { encoding, stack, mark, markDef, config } = model;\n const order = encoding.order;\n if ((!isArray(order) && isValueDef(order) && isNullOrFalse(order.value)) ||\n (!order && isNullOrFalse(getMarkPropOrConfig('order', markDef, config)))) {\n return undefined;\n }\n else if ((isArray(order) || isFieldDef(order)) && !stack) {\n // Sort by the order field if it is specified and the field is not stacked. (For stacked field, order specify stack order.)\n return sortParams(order, { expr: 'datum' });\n }\n else if (isPathMark(mark)) {\n // For both line and area, we sort values based on dimension by default\n const dimensionChannel = markDef.orient === 'horizontal' ? 'y' : 'x';\n const dimensionChannelDef = encoding[dimensionChannel];\n if (isFieldDef(dimensionChannelDef)) {\n const s = dimensionChannelDef.sort;\n if (isArray(s)) {\n return {\n field: vgField(dimensionChannelDef, { prefix: dimensionChannel, suffix: 'sort_index', expr: 'datum' })\n };\n }\n else if (isSortField(s)) {\n return {\n field: vgField({\n // FIXME: this op might not already exist?\n // FIXME: what if dimensionChannel (x or y) contains custom domain?\n aggregate: isAggregate(model.encoding) ? s.op : undefined,\n field: s.field\n }, { expr: 'datum' })\n };\n }\n else if (isSortByEncoding(s)) {\n const fieldDefToSort = model.fieldDef(s.encoding);\n return {\n field: vgField(fieldDefToSort, { expr: 'datum' }),\n order: s.order\n };\n }\n else if (s === null) {\n return undefined;\n }\n else {\n return {\n field: vgField(dimensionChannelDef, {\n // For stack with imputation, we only have bin_mid\n binSuffix: model.stack && model.stack.impute ? 'mid' : undefined,\n expr: 'datum'\n })\n };\n }\n }\n return undefined;\n }\n return undefined;\n}\nfunction getMarkGroup(model, opt = { fromPrefix: '' }) {\n const { mark, markDef, encoding, config } = model;\n const clip = getFirstDefined(markDef.clip, scaleClip(model), projectionClip(model));\n const style = getStyles(markDef);\n const key = encoding.key;\n const sort = getSort(model);\n const interactive = interactiveFlag(model);\n const aria = getMarkPropOrConfig('aria', markDef, config);\n const postEncodingTransform = markCompiler[mark].postEncodingTransform\n ? markCompiler[mark].postEncodingTransform(model)\n : null;\n return [\n Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ name: model.getName('marks'), type: markCompiler[mark].vgMark }, (clip ? { clip: true } : {})), (style ? { style } : {})), (key ? { key: key.field } : {})), (sort ? { sort } : {})), (interactive ? interactive : {})), (aria === false ? { aria } : {})), { from: { data: opt.fromPrefix + model.requestDataName(DataSourceType.Main) }, encode: {\n update: markCompiler[mark].encodeEntry(model)\n } }), (postEncodingTransform\n ? {\n transform: postEncodingTransform\n }\n : {}))\n ];\n}\n/**\n * If scales are bound to interval selections, we want to automatically clip\n * marks to account for panning/zooming interactions. We identify bound scales\n * by the selectionExtent property, which gets added during scale parsing.\n */\nfunction scaleClip(model) {\n const xScale = model.getScaleComponent('x');\n const yScale = model.getScaleComponent('y');\n return (xScale && xScale.get('selectionExtent')) || (yScale && yScale.get('selectionExtent')) ? true : undefined;\n}\n/**\n * If we use a custom projection with auto-fitting to the geodata extent,\n * we need to clip to ensure the chart size doesn't explode.\n */\nfunction projectionClip(model) {\n const projection = model.component.projection;\n return projection && !projection.isFit ? true : undefined;\n}\n/**\n * Only output interactive flags if we have selections defined somewhere in our model hierarchy.\n */\nfunction interactiveFlag(model) {\n if (!model.component.selection)\n return null;\n const unitCount = keys(model.component.selection).length;\n let parentCount = unitCount;\n let parent = model.parent;\n while (parent && parentCount === 0) {\n parentCount = keys(parent.component.selection).length;\n parent = parent.parent;\n }\n return parentCount\n ? {\n interactive: unitCount > 0 || !!model.encoding.tooltip\n }\n : null;\n}\n//# sourceMappingURL=mark.js.map","import * as encode from './encode';\nexport const arc = {\n vgMark: 'arc',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'ignore',\n orient: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.rectPosition(model, 'radius', 'arc')), encode.rectPosition(model, 'theta', 'arc'));\n }\n};\n//# sourceMappingURL=arc.js.map","import * as encode from './encode';\nexport const area = {\n vgMark: 'area',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'include',\n size: 'ignore',\n theta: 'ignore'\n })), encode.pointOrRangePosition('x', model, {\n defaultPos: 'zeroOrMin',\n defaultPos2: 'zeroOrMin',\n range: model.markDef.orient === 'horizontal'\n })), encode.pointOrRangePosition('y', model, {\n defaultPos: 'zeroOrMin',\n defaultPos2: 'zeroOrMin',\n range: model.markDef.orient === 'vertical'\n })), encode.defined(model));\n }\n};\n//# sourceMappingURL=area.js.map","import * as encode from './encode';\nexport const bar = {\n vgMark: 'rect',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.rectPosition(model, 'x', 'bar')), encode.rectPosition(model, 'y', 'bar'));\n }\n};\n//# sourceMappingURL=bar.js.map","import { isFieldDef, vgField } from '../../channeldef';\nimport { GEOJSON } from '../../type';\nimport * as encode from './encode';\nexport const geoshape = {\n vgMark: 'shape',\n encodeEntry: (model) => {\n return Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'ignore',\n orient: 'ignore',\n theta: 'ignore'\n }));\n },\n postEncodingTransform: (model) => {\n const { encoding } = model;\n const shapeDef = encoding.shape;\n const transform = Object.assign({ type: 'geoshape', projection: model.projectionName() }, (shapeDef && isFieldDef(shapeDef) && shapeDef.type === GEOJSON\n ? { field: vgField(shapeDef, { expr: 'datum' }) }\n : {}));\n return [transform];\n }\n};\n//# sourceMappingURL=geoshape.js.map","import * as encode from './encode';\nexport const image = {\n vgMark: 'image',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'ignore',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.rectPosition(model, 'x', 'image')), encode.rectPosition(model, 'y', 'image')), encode.text(model, 'url'));\n }\n};\n//# sourceMappingURL=image.js.map","import * as encode from './encode';\nexport const line = {\n vgMark: 'line',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'ignore',\n orient: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.nonPosition('size', model, {\n vgChannel: 'strokeWidth' // VL's line size is strokeWidth\n })), encode.defined(model));\n }\n};\nexport const trail = {\n vgMark: 'trail',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n size: 'include',\n orient: 'ignore',\n theta: 'ignore'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.nonPosition('size', model)), encode.defined(model));\n }\n};\n//# sourceMappingURL=line.js.map","import * as encode from './encode';\nexport const rect = {\n vgMark: 'rect',\n encodeEntry: (model) => {\n return Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.rectPosition(model, 'x', 'rect')), encode.rectPosition(model, 'y', 'rect'));\n }\n};\n//# sourceMappingURL=rect.js.map","import * as encode from './encode';\nexport const rule = {\n vgMark: 'rule',\n encodeEntry: (model) => {\n const { markDef } = model;\n const orient = markDef.orient;\n if (!model.encoding.x && !model.encoding.y && !model.encoding.latitude && !model.encoding.longitude) {\n // Show nothing if we have none of x, y, lat, and long.\n return {};\n }\n return Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'ignore',\n baseline: 'ignore',\n color: 'include',\n orient: 'ignore',\n size: 'ignore',\n theta: 'ignore'\n })), encode.pointOrRangePosition('x', model, {\n defaultPos: orient === 'horizontal' ? 'zeroOrMax' : 'mid',\n defaultPos2: 'zeroOrMin',\n range: orient !== 'vertical' // include x2 for horizontal or line segment rule\n })), encode.pointOrRangePosition('y', model, {\n defaultPos: orient === 'vertical' ? 'zeroOrMax' : 'mid',\n defaultPos2: 'zeroOrMin',\n range: orient !== 'horizontal' // include y2 for vertical or line segment rule\n })), encode.nonPosition('size', model, {\n vgChannel: 'strokeWidth' // VL's rule size is strokeWidth\n }));\n }\n};\n//# sourceMappingURL=rule.js.map","import { getMarkPropOrConfig } from '../common';\nimport * as encode from './encode';\nexport const text = {\n vgMark: 'text',\n encodeEntry: (model) => {\n const { config, encoding } = model;\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, encode.baseEncodeEntry(model, {\n align: 'include',\n baseline: 'include',\n color: 'include',\n size: 'ignore',\n orient: 'ignore',\n theta: 'include'\n })), encode.pointPosition('x', model, { defaultPos: 'mid' })), encode.pointPosition('y', model, { defaultPos: 'mid' })), encode.text(model)), encode.nonPosition('size', model, {\n vgChannel: 'fontSize' // VL's text size is fontSize\n })), encode.nonPosition('angle', model)), encode.valueIfDefined('align', align(model.markDef, encoding, config))), encode.valueIfDefined('baseline', baseline(model.markDef, encoding, config))), encode.pointPosition('radius', model, { defaultPos: null, isMidPoint: true })), encode.pointPosition('theta', model, { defaultPos: null, isMidPoint: true }));\n }\n};\nfunction align(markDef, encoding, config) {\n const a = getMarkPropOrConfig('align', markDef, config);\n if (a === undefined) {\n return 'center';\n }\n // If there is a config, Vega-parser will process this already.\n return undefined;\n}\nfunction baseline(markDef, encoding, config) {\n const b = getMarkPropOrConfig('baseline', markDef, config);\n if (b === undefined) {\n return 'middle';\n }\n // If there is a config, Vega-parser will process this already.\n return undefined;\n}\n//# sourceMappingURL=text.js.map","import { isArray } from 'vega-util';\nimport { isConditionalAxisValue } from '../axis';\nimport { GEOPOSITION_CHANNELS, NONPOSITION_SCALE_CHANNELS, POSITION_SCALE_CHANNELS, SCALE_CHANNELS, supportLegend, X, Y } from '../channel';\nimport { getFieldDef, getFieldOrDatumDef, isFieldOrDatumDef, isTypedFieldDef } from '../channeldef';\nimport { isGraticuleGenerator } from '../data';\nimport * as vlEncoding from '../encoding';\nimport { initEncoding } from '../encoding';\nimport { replaceExprRefInIndex } from '../expr';\nimport { GEOSHAPE, isMarkDef } from '../mark';\nimport { isFrameMixins } from '../spec/base';\nimport { stack } from '../stack';\nimport { keys } from '../util';\nimport { assembleAxisSignals } from './axis/assemble';\nimport { parseUnitAxes } from './axis/parse';\nimport { signalOrValueRefWithCondition, signalRefOrValue } from './common';\nimport { parseData } from './data/parse';\nimport { assembleLayoutSignals } from './layoutsize/assemble';\nimport { initLayoutSize } from './layoutsize/init';\nimport { parseUnitLayoutSize } from './layoutsize/parse';\nimport { defaultFilled, initMarkdef } from './mark/init';\nimport { parseMarkGroups } from './mark/mark';\nimport { isLayerModel, ModelWithField } from './model';\nimport { assembleTopLevelSignals, assembleUnitSelectionData, assembleUnitSelectionMarks, assembleUnitSelectionSignals } from './selection/assemble';\nimport { parseUnitSelection } from './selection/parse';\n/**\n * Internal model of Vega-Lite specification for the compiler.\n */\nexport class UnitModel extends ModelWithField {\n constructor(spec, parent, parentGivenName, parentGivenSize = {}, config) {\n super(spec, 'unit', parent, parentGivenName, config, undefined, isFrameMixins(spec) ? spec.view : undefined);\n this.specifiedScales = {};\n this.specifiedAxes = {};\n this.specifiedLegends = {};\n this.specifiedProjection = {};\n this.selection = {};\n this.children = [];\n const markDef = isMarkDef(spec.mark) ? Object.assign({}, spec.mark) : { type: spec.mark };\n const mark = markDef.type;\n // Need to init filled before other mark properties because encoding depends on filled but other mark properties depend on types inside encoding\n if (markDef.filled === undefined) {\n markDef.filled = defaultFilled(markDef, config, {\n graticule: spec.data && isGraticuleGenerator(spec.data)\n });\n }\n const encoding = (this.encoding = initEncoding(spec.encoding || {}, mark, markDef.filled, config));\n this.markDef = initMarkdef(markDef, encoding, config);\n this.size = initLayoutSize({\n encoding: encoding,\n size: isFrameMixins(spec)\n ? Object.assign(Object.assign(Object.assign({}, parentGivenSize), (spec.width ? { width: spec.width } : {})), (spec.height ? { height: spec.height } : {})) : parentGivenSize\n });\n // calculate stack properties\n this.stack = stack(mark, encoding);\n this.specifiedScales = this.initScales(mark, encoding);\n this.specifiedAxes = this.initAxes(encoding);\n this.specifiedLegends = this.initLegends(encoding);\n this.specifiedProjection = spec.projection;\n // Selections will be initialized upon parse.\n this.selection = spec.selection;\n }\n get hasProjection() {\n const { encoding } = this;\n const isGeoShapeMark = this.mark === GEOSHAPE;\n const hasGeoPosition = encoding && GEOPOSITION_CHANNELS.some(channel => isFieldOrDatumDef(encoding[channel]));\n return isGeoShapeMark || hasGeoPosition;\n }\n /**\n * Return specified Vega-Lite scale domain for a particular channel\n * @param channel\n */\n scaleDomain(channel) {\n const scale = this.specifiedScales[channel];\n return scale ? scale.domain : undefined;\n }\n axis(channel) {\n return this.specifiedAxes[channel];\n }\n legend(channel) {\n return this.specifiedLegends[channel];\n }\n initScales(mark, encoding) {\n return SCALE_CHANNELS.reduce((scales, channel) => {\n var _a;\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n if (fieldOrDatumDef) {\n scales[channel] = this.initScale((_a = fieldOrDatumDef.scale) !== null && _a !== void 0 ? _a : {});\n }\n return scales;\n }, {});\n }\n initScale(scale) {\n const { domain, range } = scale;\n const scaleInternal = replaceExprRefInIndex(scale);\n if (isArray(domain)) {\n scaleInternal.domain = domain.map(signalRefOrValue);\n }\n if (isArray(range)) {\n scaleInternal.range = range.map(signalRefOrValue);\n }\n return scaleInternal;\n }\n initAxes(encoding) {\n return POSITION_SCALE_CHANNELS.reduce((_axis, channel) => {\n // Position Axis\n // TODO: handle ConditionFieldDef\n const channelDef = encoding[channel];\n if (isFieldOrDatumDef(channelDef) ||\n (channel === X && isFieldOrDatumDef(encoding.x2)) ||\n (channel === Y && isFieldOrDatumDef(encoding.y2))) {\n const axisSpec = isFieldOrDatumDef(channelDef) ? channelDef.axis : undefined;\n _axis[channel] = axisSpec\n ? this.initAxis(Object.assign({}, axisSpec)) // convert truthy value to object\n : axisSpec;\n }\n return _axis;\n }, {});\n }\n initAxis(axis) {\n const props = keys(axis);\n const axisInternal = {};\n for (const prop of props) {\n const val = axis[prop];\n axisInternal[prop] = isConditionalAxisValue(val)\n ? signalOrValueRefWithCondition(val)\n : signalRefOrValue(val);\n }\n return axisInternal;\n }\n initLegends(encoding) {\n return NONPOSITION_SCALE_CHANNELS.reduce((_legend, channel) => {\n const fieldOrDatumDef = getFieldOrDatumDef(encoding[channel]);\n if (fieldOrDatumDef && supportLegend(channel)) {\n const legend = fieldOrDatumDef.legend;\n _legend[channel] = legend\n ? replaceExprRefInIndex(legend) // convert truthy value to object\n : legend;\n }\n return _legend;\n }, {});\n }\n parseData() {\n this.component.data = parseData(this);\n }\n parseLayoutSize() {\n parseUnitLayoutSize(this);\n }\n parseSelections() {\n this.component.selection = parseUnitSelection(this, this.selection);\n }\n parseMarkGroup() {\n this.component.mark = parseMarkGroups(this);\n }\n parseAxesAndHeaders() {\n this.component.axes = parseUnitAxes(this);\n }\n assembleSelectionTopLevelSignals(signals) {\n return assembleTopLevelSignals(this, signals);\n }\n assembleSignals() {\n return [...assembleAxisSignals(this), ...assembleUnitSelectionSignals(this, [])];\n }\n assembleSelectionData(data) {\n return assembleUnitSelectionData(this, data);\n }\n assembleLayout() {\n return null;\n }\n assembleLayoutSignals() {\n return assembleLayoutSignals(this);\n }\n assembleMarks() {\n var _a;\n let marks = (_a = this.component.mark) !== null && _a !== void 0 ? _a : [];\n // If this unit is part of a layer, selections should augment\n // all in concert rather than each unit individually. This\n // ensures correct interleaving of clipping and brushed marks.\n if (!this.parent || !isLayerModel(this.parent)) {\n marks = assembleUnitSelectionMarks(this, marks);\n }\n return marks.map(this.correctDataNames);\n }\n getMapping() {\n return this.encoding;\n }\n get mark() {\n return this.markDef.type;\n }\n channelHasField(channel) {\n return vlEncoding.channelHasField(this.encoding, channel);\n }\n fieldDef(channel) {\n const channelDef = this.encoding[channel];\n return getFieldDef(channelDef);\n }\n typedFieldDef(channel) {\n const fieldDef = this.fieldDef(channel);\n if (isTypedFieldDef(fieldDef)) {\n return fieldDef;\n }\n return null;\n }\n}\n//# sourceMappingURL=unit.js.map","import { isBinned, isBinning } from '../../bin';\nimport { isContinuousFieldOrDatumDef, isFieldDef, isNumericDataDef } from '../../channeldef';\nimport { isAggregate } from '../../encoding';\nimport { replaceExprRefInIndex } from '../../expr';\nimport * as log from '../../log';\nimport { AREA, BAR, BAR_CORNER_RADIUS_INDEX as BAR_CORNER_RADIUS_END_INDEX, CIRCLE, IMAGE, LINE, POINT, RECT, RULE, SQUARE, TEXT, TICK } from '../../mark';\nimport { QUANTITATIVE, TEMPORAL } from '../../type';\nimport { contains, getFirstDefined } from '../../util';\nimport { getMarkConfig, getMarkPropOrConfig } from '../common';\nexport function initMarkdef(originalMarkDef, encoding, config) {\n const markDef = replaceExprRefInIndex(originalMarkDef);\n // set orient, which can be overridden by rules as sometimes the specified orient is invalid.\n const specifiedOrient = getMarkPropOrConfig('orient', markDef, config);\n markDef.orient = orient(markDef.type, encoding, specifiedOrient);\n if (specifiedOrient !== undefined && specifiedOrient !== markDef.orient) {\n log.warn(log.message.orientOverridden(markDef.orient, specifiedOrient));\n }\n if (markDef.type === 'bar' && markDef.orient) {\n const cornerRadiusEnd = getMarkPropOrConfig('cornerRadiusEnd', markDef, config);\n if (cornerRadiusEnd !== undefined) {\n const newProps = (markDef.orient === 'horizontal' && encoding.x2) || (markDef.orient === 'vertical' && encoding.y2)\n ? ['cornerRadius']\n : BAR_CORNER_RADIUS_END_INDEX[markDef.orient];\n for (const newProp of newProps) {\n markDef[newProp] = cornerRadiusEnd;\n }\n if (markDef.cornerRadiusEnd !== undefined) {\n delete markDef.cornerRadiusEnd; // no need to keep the original cap cornerRadius\n }\n }\n }\n // set opacity and filled if not specified in mark config\n const specifiedOpacity = getMarkPropOrConfig('opacity', markDef, config);\n if (specifiedOpacity === undefined) {\n markDef.opacity = opacity(markDef.type, encoding);\n }\n // set cursor, which should be pointer if href channel is present unless otherwise specified\n const specifiedCursor = getMarkPropOrConfig('cursor', markDef, config);\n if (specifiedCursor === undefined) {\n markDef.cursor = cursor(markDef, encoding, config);\n }\n return markDef;\n}\nfunction cursor(markDef, encoding, config) {\n if (encoding.href || markDef.href || getMarkPropOrConfig('href', markDef, config)) {\n return 'pointer';\n }\n return markDef.cursor;\n}\nfunction opacity(mark, encoding) {\n if (contains([POINT, TICK, CIRCLE, SQUARE], mark)) {\n // point-based marks\n if (!isAggregate(encoding)) {\n return 0.7;\n }\n }\n return undefined;\n}\nexport function defaultFilled(markDef, config, { graticule }) {\n if (graticule) {\n return false;\n }\n const filledConfig = getMarkConfig('filled', markDef, config);\n const mark = markDef.type;\n return getFirstDefined(filledConfig, mark !== POINT && mark !== LINE && mark !== RULE);\n}\nfunction orient(mark, encoding, specifiedOrient) {\n switch (mark) {\n case POINT:\n case CIRCLE:\n case SQUARE:\n case TEXT:\n case RECT:\n case IMAGE:\n // orient is meaningless for these marks.\n return undefined;\n }\n const { x, y, x2, y2 } = encoding;\n switch (mark) {\n case BAR:\n if (isFieldDef(x) && (isBinned(x.bin) || (isFieldDef(y) && y.aggregate && !x.aggregate))) {\n return 'vertical';\n }\n if (isFieldDef(y) && (isBinned(y.bin) || (isFieldDef(x) && x.aggregate && !y.aggregate))) {\n return 'horizontal';\n }\n if (y2 || x2) {\n // Ranged bar does not always have clear orientation, so we allow overriding\n if (specifiedOrient) {\n return specifiedOrient;\n }\n // If y is range and x is non-range, non-bin Q, y is likely a prebinned field\n if (!x2) {\n if ((isFieldDef(x) && x.type === QUANTITATIVE && !isBinning(x.bin)) || isNumericDataDef(x)) {\n return 'horizontal';\n }\n }\n // If x is range and y is non-range, non-bin Q, x is likely a prebinned field\n if (!y2) {\n if ((isFieldDef(y) && y.type === QUANTITATIVE && !isBinning(y.bin)) || isNumericDataDef(y)) {\n return 'vertical';\n }\n }\n }\n // falls through\n case RULE:\n // return undefined for line segment rule and bar with both axis ranged\n // we have to ignore the case that the data are already binned\n if (x2 && !(isFieldDef(x) && isBinned(x.bin)) && y2 && !(isFieldDef(y) && isBinned(y.bin))) {\n return undefined;\n }\n // falls through\n case AREA:\n // If there are range for both x and y, y (vertical) has higher precedence.\n if (y2) {\n if (isFieldDef(y) && isBinned(y.bin)) {\n return 'horizontal';\n }\n else {\n return 'vertical';\n }\n }\n else if (x2) {\n if (isFieldDef(x) && isBinned(x.bin)) {\n return 'vertical';\n }\n else {\n return 'horizontal';\n }\n }\n else if (mark === RULE) {\n if (x && !y) {\n return 'vertical';\n }\n else if (y && !x) {\n return 'horizontal';\n }\n }\n // falls through\n case LINE:\n case TICK: {\n // Tick is opposite to bar, line, area and never have ranged mark.\n const xIsContinuous = isContinuousFieldOrDatumDef(x);\n const yIsContinuous = isContinuousFieldOrDatumDef(y);\n if (xIsContinuous && !yIsContinuous) {\n return mark !== 'tick' ? 'horizontal' : 'vertical';\n }\n else if (!xIsContinuous && yIsContinuous) {\n return mark !== 'tick' ? 'vertical' : 'horizontal';\n }\n else if (xIsContinuous && yIsContinuous) {\n const xDef = x; // we can cast here since they are surely fieldDef\n const yDef = y;\n const xIsTemporal = xDef.type === TEMPORAL;\n const yIsTemporal = yDef.type === TEMPORAL;\n // temporal without timeUnit is considered continuous, but better serves as dimension\n if (xIsTemporal && !yIsTemporal) {\n return mark !== 'tick' ? 'vertical' : 'horizontal';\n }\n else if (!xIsTemporal && yIsTemporal) {\n return mark !== 'tick' ? 'horizontal' : 'vertical';\n }\n if (!xDef.aggregate && yDef.aggregate) {\n return mark !== 'tick' ? 'vertical' : 'horizontal';\n }\n else if (xDef.aggregate && !yDef.aggregate) {\n return mark !== 'tick' ? 'horizontal' : 'vertical';\n }\n if (specifiedOrient) {\n // When ambiguous, use user specified one.\n return specifiedOrient;\n }\n return 'vertical';\n }\n else {\n // Discrete x Discrete case\n if (specifiedOrient) {\n // When ambiguous, use user specified one.\n return specifiedOrient;\n }\n return undefined;\n }\n }\n }\n return 'vertical';\n}\n//# sourceMappingURL=init.js.map","import { getSizeChannel, POSITION_SCALE_CHANNELS } from '../../channel';\nimport { isContinuousFieldOrDatumDef } from '../../channeldef';\nimport * as log from '../../log';\nimport { isStep } from '../../spec/base';\nexport function initLayoutSize({ encoding, size }) {\n for (const channel of POSITION_SCALE_CHANNELS) {\n const sizeType = getSizeChannel(channel);\n if (isStep(size[sizeType])) {\n if (isContinuousFieldOrDatumDef(encoding[channel])) {\n delete size[sizeType];\n log.warn(log.message.stepDropped(sizeType));\n }\n }\n }\n return size;\n}\n//# sourceMappingURL=init.js.map","import * as log from '../log';\nimport { isLayerSpec, isUnitSpec } from '../spec';\nimport { keys } from '../util';\nimport { assembleAxisSignals } from './axis/assemble';\nimport { parseLayerAxes } from './axis/parse';\nimport { parseData } from './data/parse';\nimport { assembleLayoutSignals } from './layoutsize/assemble';\nimport { parseLayerLayoutSize } from './layoutsize/parse';\nimport { assembleLegends } from './legend/assemble';\nimport { Model } from './model';\nimport { assembleLayerSelectionMarks } from './selection/assemble';\nimport { UnitModel } from './unit';\nexport class LayerModel extends Model {\n constructor(spec, parent, parentGivenName, parentGivenSize, config) {\n super(spec, 'layer', parent, parentGivenName, config, spec.resolve, spec.view);\n const layoutSize = Object.assign(Object.assign(Object.assign({}, parentGivenSize), (spec.width ? { width: spec.width } : {})), (spec.height ? { height: spec.height } : {}));\n this.children = spec.layer.map((layer, i) => {\n if (isLayerSpec(layer)) {\n return new LayerModel(layer, this, this.getName('layer_' + i), layoutSize, config);\n }\n else if (isUnitSpec(layer)) {\n return new UnitModel(layer, this, this.getName('layer_' + i), layoutSize, config);\n }\n throw new Error(log.message.invalidSpec(layer));\n });\n }\n parseData() {\n this.component.data = parseData(this);\n for (const child of this.children) {\n child.parseData();\n }\n }\n parseLayoutSize() {\n parseLayerLayoutSize(this);\n }\n parseSelections() {\n // Merge selections up the hierarchy so that they may be referenced\n // across unit specs. Persist their definitions within each child\n // to assemble signals which remain within output Vega unit groups.\n this.component.selection = {};\n for (const child of this.children) {\n child.parseSelections();\n for (const key of keys(child.component.selection)) {\n this.component.selection[key] = child.component.selection[key];\n }\n }\n }\n parseMarkGroup() {\n for (const child of this.children) {\n child.parseMarkGroup();\n }\n }\n parseAxesAndHeaders() {\n parseLayerAxes(this);\n }\n assembleSelectionTopLevelSignals(signals) {\n return this.children.reduce((sg, child) => child.assembleSelectionTopLevelSignals(sg), signals);\n }\n // TODO: Support same named selections across children.\n assembleSignals() {\n return this.children.reduce((signals, child) => {\n return signals.concat(child.assembleSignals());\n }, assembleAxisSignals(this));\n }\n assembleLayoutSignals() {\n return this.children.reduce((signals, child) => {\n return signals.concat(child.assembleLayoutSignals());\n }, assembleLayoutSignals(this));\n }\n assembleSelectionData(data) {\n return this.children.reduce((db, child) => child.assembleSelectionData(db), data);\n }\n assembleTitle() {\n let title = super.assembleTitle();\n if (title) {\n return title;\n }\n // If title does not provide layer, look into children\n for (const child of this.children) {\n title = child.assembleTitle();\n if (title) {\n return title;\n }\n }\n return undefined;\n }\n assembleLayout() {\n return null;\n }\n assembleMarks() {\n return assembleLayerSelectionMarks(this, this.children.flatMap(child => {\n return child.assembleMarks();\n }));\n }\n assembleLegends() {\n return this.children.reduce((legends, child) => {\n return legends.concat(child.assembleLegends());\n }, assembleLegends(this));\n }\n}\n//# sourceMappingURL=layer.js.map","import * as log from '../log';\nimport { isAnyConcatSpec, isFacetSpec, isLayerSpec, isUnitSpec } from '../spec';\nimport { ConcatModel } from './concat';\nimport { FacetModel } from './facet';\nimport { LayerModel } from './layer';\nimport { UnitModel } from './unit';\nexport function buildModel(spec, parent, parentGivenName, unitSize, config) {\n if (isFacetSpec(spec)) {\n return new FacetModel(spec, parent, parentGivenName, config);\n }\n else if (isLayerSpec(spec)) {\n return new LayerModel(spec, parent, parentGivenName, unitSize, config);\n }\n else if (isUnitSpec(spec)) {\n return new UnitModel(spec, parent, parentGivenName, unitSize, config);\n }\n else if (isAnyConcatSpec(spec)) {\n return new ConcatModel(spec, parent, parentGivenName, config);\n }\n throw new Error(log.message.invalidSpec(spec));\n}\n//# sourceMappingURL=buildmodel.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { isString, mergeConfig } from 'vega-util';\nimport { getPositionScaleChannel } from '../channel';\nimport * as vlFieldDef from '../channeldef';\nimport { initConfig, stripAndRedirectConfig } from '../config';\nimport * as log from '../log';\nimport { normalize } from '../normalize';\nimport { assembleParameterSignals } from '../parameter';\nimport { extractTopLevelProperties, getFitType, isFitType } from '../spec/toplevel';\nimport { keys } from '../util';\nimport { buildModel } from './buildmodel';\nimport { assembleRootData } from './data/assemble';\nimport { optimizeDataflow } from './data/optimize';\n/**\n * Vega-Lite's main function, for compiling Vega-Lite spec into Vega spec.\n *\n * At a high-level, we make the following transformations in different phases:\n *\n * Input spec\n * |\n * | (Normalization)\n * v\n * Normalized Spec (Row/Column channels in single-view specs becomes faceted specs, composite marks becomes layered specs.)\n * |\n * | (Build Model)\n * v\n * A model tree of the spec\n * |\n * | (Parse)\n * v\n * A model tree with parsed components (intermediate structure of visualization primitives in a format that can be easily merged)\n * |\n * | (Optimize)\n * v\n * A model tree with parsed components with the data component optimized\n * |\n * | (Assemble)\n * v\n * Vega spec\n *\n * @param inputSpec The Vega-Lite specification.\n * @param opt Optional arguments passed to the Vega-Lite compiler.\n * @returns An object containing the compiled Vega spec and normalized Vega-Lite spec.\n */\nexport function compile(inputSpec, opt = {}) {\n // 0. Augment opt with default opts\n if (opt.logger) {\n // set the singleton logger to the provided logger\n log.set(opt.logger);\n }\n if (opt.fieldTitle) {\n // set the singleton field title formatter\n vlFieldDef.setTitleFormatter(opt.fieldTitle);\n }\n try {\n // 1. Initialize config by deep merging default config with the config provided via option and the input spec.\n const config = initConfig(mergeConfig(opt.config, inputSpec.config));\n // 2. Normalize: Convert input spec -> normalized spec\n // - Decompose all extended unit specs into composition of unit spec. For example, a box plot get expanded into multiple layers of bars, ticks, and rules. The shorthand row/column channel is also expanded to a facet spec.\n // - Normalize autosize and width or height spec\n const spec = normalize(inputSpec, config);\n // 3. Build Model: normalized spec -> Model (a tree structure)\n // This phases instantiates the models with default config by doing a top-down traversal. This allows us to pass properties that child models derive from their parents via their constructors.\n // See the abstract `Model` class and its children (UnitModel, LayerModel, FacetModel, ConcatModel) for different types of models.\n const model = buildModel(spec, null, '', undefined, config);\n // 4 Parse: Model --> Model with components\n // Note that components = intermediate representations that are equivalent to Vega specs.\n // We need these intermediate representation because we need to merge many visualization \"components\" like projections, scales, axes, and legends.\n // We will later convert these components into actual Vega specs in the assemble phase.\n // In this phase, we do a bottom-up traversal over the whole tree to\n // parse for each type of components once (e.g., data, layout, mark, scale).\n // By doing bottom-up traversal, we start parsing components of unit specs and\n // then merge child components of parent composite specs.\n //\n // Please see inside model.parse() for order of different components parsed.\n model.parse();\n // drawDataflow(model.component.data.sources);\n // 5. Optimize the dataflow. This will modify the data component of the model.\n optimizeDataflow(model.component.data, model);\n // drawDataflow(model.component.data.sources);\n // 6. Assemble: convert model components --> Vega Spec.\n const vgSpec = assembleTopLevelModel(model, getTopLevelProperties(inputSpec, spec.autosize, config, model), inputSpec.datasets, inputSpec.usermeta);\n return {\n spec: vgSpec,\n normalized: spec\n };\n }\n finally {\n // Reset the singleton logger if a logger is provided\n if (opt.logger) {\n log.reset();\n }\n // Reset the singleton field title formatter if provided\n if (opt.fieldTitle) {\n vlFieldDef.resetTitleFormatter();\n }\n }\n}\nfunction getTopLevelProperties(inputSpec, autosize, config, model) {\n const width = model.component.layoutSize.get('width');\n const height = model.component.layoutSize.get('height');\n if (autosize === undefined) {\n autosize = { type: 'pad' };\n if (model.hasAxisOrientSignalRef()) {\n autosize.resize = true;\n }\n }\n else if (isString(autosize)) {\n autosize = { type: autosize };\n }\n if (width && height && isFitType(autosize.type)) {\n if (width === 'step' && height === 'step') {\n log.warn(log.message.droppingFit());\n autosize.type = 'pad';\n }\n else if (width === 'step' || height === 'step') {\n // effectively XOR, because else if\n // get step dimension\n const sizeType = width === 'step' ? 'width' : 'height';\n // log that we're dropping fit for respective channel\n log.warn(log.message.droppingFit(getPositionScaleChannel(sizeType)));\n // setting type to inverse fit (so if we dropped fit-x, type is now fit-y)\n const inverseSizeType = sizeType === 'width' ? 'height' : 'width';\n autosize.type = getFitType(inverseSizeType);\n }\n }\n return Object.assign(Object.assign(Object.assign({}, (keys(autosize).length === 1 && autosize.type\n ? autosize.type === 'pad'\n ? {}\n : { autosize: autosize.type }\n : { autosize })), extractTopLevelProperties(config, false)), extractTopLevelProperties(inputSpec, true));\n}\n/*\n * Assemble the top-level model to a Vega spec.\n *\n * Note: this couldn't be `model.assemble()` since the top-level model\n * needs some special treatment to generate top-level properties.\n */\nfunction assembleTopLevelModel(model, topLevelProperties, datasets = {}, usermeta) {\n // Config with Vega-Lite only config removed.\n const vgConfig = model.config ? stripAndRedirectConfig(model.config) : undefined;\n const data = [].concat(model.assembleSelectionData([]), \n // only assemble data in the root\n assembleRootData(model.component.data, datasets));\n const projections = model.assembleProjections();\n const title = model.assembleTitle();\n const style = model.assembleGroupStyle();\n const encodeEntry = model.assembleGroupEncodeEntry(true);\n let layoutSignals = model.assembleLayoutSignals();\n // move width and height signals with values to top level\n layoutSignals = layoutSignals.filter(signal => {\n if ((signal.name === 'width' || signal.name === 'height') && signal.value !== undefined) {\n topLevelProperties[signal.name] = +signal.value;\n return false;\n }\n return true;\n });\n const { params } = topLevelProperties, otherTopLevelProps = __rest(topLevelProperties, [\"params\"]);\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ $schema: 'https://vega.github.io/schema/vega/v5.json' }, (model.description ? { description: model.description } : {})), otherTopLevelProps), (title ? { title } : {})), (style ? { style } : {})), (encodeEntry ? { encode: { update: encodeEntry } } : {})), { data }), (projections.length > 0 ? { projections: projections } : {})), model.assembleGroup([\n ...layoutSignals,\n ...model.assembleSelectionTopLevelSignals([]),\n ...assembleParameterSignals(params)\n ])), (vgConfig ? { config: vgConfig } : {})), (usermeta ? { usermeta } : {}));\n}\n//# sourceMappingURL=compile.js.map","function accessor (fn, fields, name) {\n fn.fields = fields || [];\n fn.fname = name;\n return fn;\n}\nfunction accessorName(fn) {\n return fn == null ? null : fn.fname;\n}\nfunction accessorFields(fn) {\n return fn == null ? null : fn.fields;\n}\n\nfunction getter (path) {\n return path.length === 1 ? get1(path[0]) : getN(path);\n}\nconst get1 = field => function (obj) {\n return obj[field];\n};\nconst getN = path => {\n const len = path.length;\n return function (obj) {\n for (let i = 0; i < len; ++i) {\n obj = obj[path[i]];\n }\n return obj;\n };\n};\n\nfunction error (message) {\n throw Error(message);\n}\n\nfunction splitAccessPath (p) {\n const path = [],\n n = p.length;\n let q = null,\n b = 0,\n s = '',\n i,\n j,\n c;\n p = p + '';\n function push() {\n path.push(s + p.substring(i, j));\n s = '';\n i = j + 1;\n }\n for (i = j = 0; j < n; ++j) {\n c = p[j];\n if (c === '\\\\') {\n s += p.substring(i, j++);\n i = j;\n } else if (c === q) {\n push();\n q = null;\n b = -1;\n } else if (q) {\n continue;\n } else if (i === b && c === '\"') {\n i = j + 1;\n q = c;\n } else if (i === b && c === \"'\") {\n i = j + 1;\n q = c;\n } else if (c === '.' && !b) {\n if (j > i) {\n push();\n } else {\n i = j + 1;\n }\n } else if (c === '[') {\n if (j > i) push();\n b = i = j + 1;\n } else if (c === ']') {\n if (!b) error('Access path missing open bracket: ' + p);\n if (b > 0) push();\n b = 0;\n i = j + 1;\n }\n }\n if (b) error('Access path missing closing bracket: ' + p);\n if (q) error('Access path missing closing quote: ' + p);\n if (j > i) {\n j++;\n push();\n }\n return path;\n}\n\nfunction field (field, name, opt) {\n const path = splitAccessPath(field);\n field = path.length === 1 ? path[0] : field;\n return accessor((opt && opt.get || getter)(path), [field], name || field);\n}\n\nconst id = field('id');\nconst identity = accessor(_ => _, [], 'identity');\nconst zero = accessor(() => 0, [], 'zero');\nconst one = accessor(() => 1, [], 'one');\nconst truthy = accessor(() => true, [], 'true');\nconst falsy = accessor(() => false, [], 'false');\n\nfunction log$1(method, level, input) {\n const args = [level].concat([].slice.call(input));\n console[method].apply(console, args); // eslint-disable-line no-console\n}\n\nconst None = 0;\nconst Error$1 = 1;\nconst Warn = 2;\nconst Info = 3;\nconst Debug = 4;\nfunction logger (_, method) {\n let handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : log$1;\n let level = _ || None;\n return {\n level(_) {\n if (arguments.length) {\n level = +_;\n return this;\n } else {\n return level;\n }\n },\n error() {\n if (level >= Error$1) handler(method || 'error', 'ERROR', arguments);\n return this;\n },\n warn() {\n if (level >= Warn) handler(method || 'warn', 'WARN', arguments);\n return this;\n },\n info() {\n if (level >= Info) handler(method || 'log', 'INFO', arguments);\n return this;\n },\n debug() {\n if (level >= Debug) handler(method || 'log', 'DEBUG', arguments);\n return this;\n }\n };\n}\n\nvar isArray = Array.isArray;\n\nfunction isObject (_) {\n return _ === Object(_);\n}\n\nconst isLegalKey = key => key !== '__proto__';\nfunction mergeConfig() {\n for (var _len = arguments.length, configs = new Array(_len), _key = 0; _key < _len; _key++) {\n configs[_key] = arguments[_key];\n }\n return configs.reduce((out, source) => {\n for (const key in source) {\n if (key === 'signals') {\n // for signals, we merge the signals arrays\n // source signals take precedence over\n // existing signals with the same name\n out.signals = mergeNamed(out.signals, source.signals);\n } else {\n // otherwise, merge objects subject to recursion constraints\n // for legend block, recurse for the layout entry only\n // for style block, recurse for all properties\n // otherwise, no recursion: objects overwrite, no merging\n const r = key === 'legend' ? {\n layout: 1\n } : key === 'style' ? true : null;\n writeConfig(out, key, source[key], r);\n }\n }\n return out;\n }, {});\n}\nfunction writeConfig(output, key, value, recurse) {\n if (!isLegalKey(key)) return;\n let k, o;\n if (isObject(value) && !isArray(value)) {\n o = isObject(output[key]) ? output[key] : output[key] = {};\n for (k in value) {\n if (recurse && (recurse === true || recurse[k])) {\n writeConfig(o, k, value[k]);\n } else if (isLegalKey(k)) {\n o[k] = value[k];\n }\n }\n } else {\n output[key] = value;\n }\n}\nfunction mergeNamed(a, b) {\n if (a == null) return b;\n const map = {},\n out = [];\n function add(_) {\n if (!map[_.name]) {\n map[_.name] = 1;\n out.push(_);\n }\n }\n b.forEach(add);\n a.forEach(add);\n return out;\n}\n\nfunction peek (array) {\n return array[array.length - 1];\n}\n\nfunction toNumber (_) {\n return _ == null || _ === '' ? null : +_;\n}\n\nconst exp = sign => x => sign * Math.exp(x);\nconst log = sign => x => Math.log(sign * x);\nconst symlog = c => x => Math.sign(x) * Math.log1p(Math.abs(x / c));\nconst symexp = c => x => Math.sign(x) * Math.expm1(Math.abs(x)) * c;\nconst pow = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\nfunction pan(domain, delta, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n dd = (d1 - d0) * delta;\n return [ground(d0 - dd), ground(d1 - dd)];\n}\nfunction panLinear(domain, delta) {\n return pan(domain, delta, toNumber, identity);\n}\nfunction panLog(domain, delta) {\n var sign = Math.sign(domain[0]);\n return pan(domain, delta, log(sign), exp(sign));\n}\nfunction panPow(domain, delta, exponent) {\n return pan(domain, delta, pow(exponent), pow(1 / exponent));\n}\nfunction panSymlog(domain, delta, constant) {\n return pan(domain, delta, symlog(constant), symexp(constant));\n}\nfunction zoom(domain, anchor, scale, lift, ground) {\n const d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n da = anchor != null ? lift(anchor) : (d0 + d1) / 2;\n return [ground(da + (d0 - da) * scale), ground(da + (d1 - da) * scale)];\n}\nfunction zoomLinear(domain, anchor, scale) {\n return zoom(domain, anchor, scale, toNumber, identity);\n}\nfunction zoomLog(domain, anchor, scale) {\n const sign = Math.sign(domain[0]);\n return zoom(domain, anchor, scale, log(sign), exp(sign));\n}\nfunction zoomPow(domain, anchor, scale, exponent) {\n return zoom(domain, anchor, scale, pow(exponent), pow(1 / exponent));\n}\nfunction zoomSymlog(domain, anchor, scale, constant) {\n return zoom(domain, anchor, scale, symlog(constant), symexp(constant));\n}\n\nfunction quarter(date) {\n return 1 + ~~(new Date(date).getMonth() / 3);\n}\nfunction utcquarter(date) {\n return 1 + ~~(new Date(date).getUTCMonth() / 3);\n}\n\nfunction array (_) {\n return _ != null ? isArray(_) ? _ : [_] : [];\n}\n\n/**\n * Span-preserving range clamp. If the span of the input range is less\n * than (max - min) and an endpoint exceeds either the min or max value,\n * the range is translated such that the span is preserved and one\n * endpoint touches the boundary of the min/max range.\n * If the span exceeds (max - min), the range [min, max] is returned.\n */\nfunction clampRange (range, min, max) {\n let lo = range[0],\n hi = range[1],\n span;\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n span = hi - lo;\n return span >= max - min ? [min, max] : [lo = Math.min(Math.max(lo, min), max - span), lo + span];\n}\n\nfunction isFunction (_) {\n return typeof _ === 'function';\n}\n\nconst DESCENDING = 'descending';\nfunction compare (fields, orders, opt) {\n opt = opt || {};\n orders = array(orders) || [];\n const ord = [],\n get = [],\n fmap = {},\n gen = opt.comparator || comparator;\n array(fields).forEach((f, i) => {\n if (f == null) return;\n ord.push(orders[i] === DESCENDING ? -1 : 1);\n get.push(f = isFunction(f) ? f : field(f, null, opt));\n (accessorFields(f) || []).forEach(_ => fmap[_] = 1);\n });\n return get.length === 0 ? null : accessor(gen(get, ord), Object.keys(fmap));\n}\nconst ascending = (u, v) => (u < v || u == null) && v != null ? -1 : (u > v || v == null) && u != null ? 1 : (v = v instanceof Date ? +v : v, u = u instanceof Date ? +u : u) !== u && v === v ? -1 : v !== v && u === u ? 1 : 0;\nconst comparator = (fields, orders) => fields.length === 1 ? compare1(fields[0], orders[0]) : compareN(fields, orders, fields.length);\nconst compare1 = (field, order) => function (a, b) {\n return ascending(field(a), field(b)) * order;\n};\nconst compareN = (fields, orders, n) => {\n orders.push(0); // pad zero for convenient lookup\n return function (a, b) {\n let f,\n c = 0,\n i = -1;\n while (c === 0 && ++i < n) {\n f = fields[i];\n c = ascending(f(a), f(b));\n }\n return c * orders[i];\n };\n};\n\nfunction constant (_) {\n return isFunction(_) ? _ : () => _;\n}\n\nfunction debounce (delay, handler) {\n let tid;\n return e => {\n if (tid) clearTimeout(tid);\n tid = setTimeout(() => (handler(e), tid = null), delay);\n };\n}\n\nfunction extend (_) {\n for (let x, k, i = 1, len = arguments.length; i < len; ++i) {\n x = arguments[i];\n for (k in x) {\n _[k] = x[k];\n }\n }\n return _;\n}\n\n/**\n * Return an array with minimum and maximum values, in the\n * form [min, max]. Ignores null, undefined, and NaN values.\n */\nfunction extent (array, f) {\n let i = 0,\n n,\n v,\n min,\n max;\n if (array && (n = array.length)) {\n if (f == null) {\n // find first valid value\n for (v = array[i]; i < n && (v == null || v !== v); v = array[++i]);\n min = max = v;\n\n // visit all other values\n for (; i < n; ++i) {\n v = array[i];\n // skip null/undefined; NaN will fail all comparisons\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n } else {\n // find first valid value\n for (v = f(array[i]); i < n && (v == null || v !== v); v = f(array[++i]));\n min = max = v;\n\n // visit all other values\n for (; i < n; ++i) {\n v = f(array[i]);\n // skip null/undefined; NaN will fail all comparisons\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n }\n }\n return [min, max];\n}\n\nfunction extentIndex (array, f) {\n const n = array.length;\n let i = -1,\n a,\n b,\n c,\n u,\n v;\n if (f == null) {\n while (++i < n) {\n b = array[i];\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n if (i === n) return [-1, -1];\n u = v = i;\n while (++i < n) {\n b = array[i];\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n } else {\n while (++i < n) {\n b = f(array[i], i, array);\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n if (i === n) return [-1, -1];\n u = v = i;\n while (++i < n) {\n b = f(array[i], i, array);\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n }\n return [u, v];\n}\n\nconst hop = Object.prototype.hasOwnProperty;\nfunction has (object, property) {\n return hop.call(object, property);\n}\n\nconst NULL = {};\nfunction fastmap (input) {\n let obj = {},\n test;\n function has$1(key) {\n return has(obj, key) && obj[key] !== NULL;\n }\n const map = {\n size: 0,\n empty: 0,\n object: obj,\n has: has$1,\n get(key) {\n return has$1(key) ? obj[key] : undefined;\n },\n set(key, value) {\n if (!has$1(key)) {\n ++map.size;\n if (obj[key] === NULL) --map.empty;\n }\n obj[key] = value;\n return this;\n },\n delete(key) {\n if (has$1(key)) {\n --map.size;\n ++map.empty;\n obj[key] = NULL;\n }\n return this;\n },\n clear() {\n map.size = map.empty = 0;\n map.object = obj = {};\n },\n test(_) {\n if (arguments.length) {\n test = _;\n return map;\n } else {\n return test;\n }\n },\n clean() {\n const next = {};\n let size = 0;\n for (const key in obj) {\n const value = obj[key];\n if (value !== NULL && (!test || !test(value))) {\n next[key] = value;\n ++size;\n }\n }\n map.size = size;\n map.empty = 0;\n map.object = obj = next;\n }\n };\n if (input) Object.keys(input).forEach(key => {\n map.set(key, input[key]);\n });\n return map;\n}\n\nfunction flush (range, value, threshold, left, right, center) {\n if (!threshold && threshold !== 0) return center;\n const t = +threshold;\n let a = range[0],\n b = peek(range),\n l;\n\n // swap endpoints if range is reversed\n if (b < a) {\n l = a;\n a = b;\n b = l;\n }\n\n // compare value to endpoints\n l = Math.abs(value - a);\n const r = Math.abs(b - value);\n\n // adjust if value is within threshold distance of endpoint\n return l < r && l <= t ? left : r <= t ? right : center;\n}\n\nfunction inherits (child, parent, members) {\n const proto = child.prototype = Object.create(parent.prototype);\n Object.defineProperty(proto, 'constructor', {\n value: child,\n writable: true,\n enumerable: true,\n configurable: true\n });\n return extend(proto, members);\n}\n\n/**\n * Predicate that returns true if the value lies within the span\n * of the given range. The left and right flags control the use\n * of inclusive (true) or exclusive (false) comparisons.\n */\nfunction inrange (value, range, left, right) {\n let r0 = range[0],\n r1 = range[range.length - 1],\n t;\n if (r0 > r1) {\n t = r0;\n r0 = r1;\n r1 = t;\n }\n left = left === undefined || left;\n right = right === undefined || right;\n return (left ? r0 <= value : r0 < value) && (right ? value <= r1 : value < r1);\n}\n\nfunction isBoolean (_) {\n return typeof _ === 'boolean';\n}\n\nfunction isDate (_) {\n return Object.prototype.toString.call(_) === '[object Date]';\n}\n\nfunction isIterable (_) {\n return _ && isFunction(_[Symbol.iterator]);\n}\n\nfunction isNumber (_) {\n return typeof _ === 'number';\n}\n\nfunction isRegExp (_) {\n return Object.prototype.toString.call(_) === '[object RegExp]';\n}\n\nfunction isString (_) {\n return typeof _ === 'string';\n}\n\nfunction key (fields, flat, opt) {\n if (fields) {\n fields = flat ? array(fields).map(f => f.replace(/\\\\(.)/g, '$1')) : array(fields);\n }\n const len = fields && fields.length,\n gen = opt && opt.get || getter,\n map = f => gen(flat ? [f] : splitAccessPath(f));\n let fn;\n if (!len) {\n fn = function () {\n return '';\n };\n } else if (len === 1) {\n const get = map(fields[0]);\n fn = function (_) {\n return '' + get(_);\n };\n } else {\n const get = fields.map(map);\n fn = function (_) {\n let s = '' + get[0](_),\n i = 0;\n while (++i < len) s += '|' + get[i](_);\n return s;\n };\n }\n return accessor(fn, fields, 'key');\n}\n\nfunction lerp (array, frac) {\n const lo = array[0],\n hi = peek(array),\n f = +frac;\n return !f ? lo : f === 1 ? hi : lo + f * (hi - lo);\n}\n\nconst DEFAULT_MAX_SIZE = 10000;\n\n// adapted from https://github.com/dominictarr/hashlru/ (MIT License)\nfunction lruCache (maxsize) {\n maxsize = +maxsize || DEFAULT_MAX_SIZE;\n let curr, prev, size;\n const clear = () => {\n curr = {};\n prev = {};\n size = 0;\n };\n const update = (key, value) => {\n if (++size > maxsize) {\n prev = curr;\n curr = {};\n size = 1;\n }\n return curr[key] = value;\n };\n clear();\n return {\n clear,\n has: key => has(curr, key) || has(prev, key),\n get: key => has(curr, key) ? curr[key] : has(prev, key) ? update(key, prev[key]) : undefined,\n set: (key, value) => has(curr, key) ? curr[key] = value : update(key, value)\n };\n}\n\nfunction merge (compare, array0, array1, output) {\n const n0 = array0.length,\n n1 = array1.length;\n if (!n1) return array0;\n if (!n0) return array1;\n const merged = output || new array0.constructor(n0 + n1);\n let i0 = 0,\n i1 = 0,\n i = 0;\n for (; i0 < n0 && i1 < n1; ++i) {\n merged[i] = compare(array0[i0], array1[i1]) > 0 ? array1[i1++] : array0[i0++];\n }\n for (; i0 < n0; ++i0, ++i) {\n merged[i] = array0[i0];\n }\n for (; i1 < n1; ++i1, ++i) {\n merged[i] = array1[i1];\n }\n return merged;\n}\n\nfunction repeat (str, reps) {\n let s = '';\n while (--reps >= 0) s += str;\n return s;\n}\n\nfunction pad (str, length, padchar, align) {\n const c = padchar || ' ',\n s = str + '',\n n = length - s.length;\n return n <= 0 ? s : align === 'left' ? repeat(c, n) + s : align === 'center' ? repeat(c, ~~(n / 2)) + s + repeat(c, Math.ceil(n / 2)) : s + repeat(c, n);\n}\n\n/**\n * Return the numerical span of an array: the difference between\n * the last and first values.\n */\nfunction span (array) {\n return array && peek(array) - array[0] || 0;\n}\n\nfunction $(x) {\n return isArray(x) ? '[' + x.map($) + ']' : isObject(x) || isString(x) ?\n // Output valid JSON and JS source strings.\n // See http://timelessrepo.com/json-isnt-a-javascript-subset\n JSON.stringify(x).replace('\\u2028', '\\\\u2028').replace('\\u2029', '\\\\u2029') : x;\n}\n\nfunction toBoolean (_) {\n return _ == null || _ === '' ? null : !_ || _ === 'false' || _ === '0' ? false : !!_;\n}\n\nconst defaultParser = _ => isNumber(_) ? _ : isDate(_) ? _ : Date.parse(_);\nfunction toDate (_, parser) {\n parser = parser || defaultParser;\n return _ == null || _ === '' ? null : parser(_);\n}\n\nfunction toString (_) {\n return _ == null || _ === '' ? null : _ + '';\n}\n\nfunction toSet (_) {\n const s = {},\n n = _.length;\n for (let i = 0; i < n; ++i) s[_[i]] = true;\n return s;\n}\n\nfunction truncate (str, length, align, ellipsis) {\n const e = ellipsis != null ? ellipsis : '\\u2026',\n s = str + '',\n n = s.length,\n l = Math.max(0, length - e.length);\n return n <= length ? s : align === 'left' ? e + s.slice(n - l) : align === 'center' ? s.slice(0, Math.ceil(l / 2)) + e + s.slice(n - ~~(l / 2)) : s.slice(0, l) + e;\n}\n\nfunction visitArray (array, filter, visitor) {\n if (array) {\n if (filter) {\n const n = array.length;\n for (let i = 0; i < n; ++i) {\n const t = filter(array[i]);\n if (t) visitor(t, i, array);\n }\n } else {\n array.forEach(visitor);\n }\n }\n}\n\nexport { Debug, Error$1 as Error, Info, None, Warn, accessor, accessorFields, accessorName, array, ascending, clampRange, compare, constant, debounce, error, extend, extent, extentIndex, falsy, fastmap, field, flush, has as hasOwnProperty, id, identity, inherits, inrange, isArray, isBoolean, isDate, isFunction, isIterable, isNumber, isObject, isRegExp, isString, key, lerp, logger, lruCache, merge, mergeConfig, one, pad, panLinear, panLog, panPow, panSymlog, peek, quarter, repeat, span, splitAccessPath, $ as stringValue, toBoolean, toDate, toNumber, toSet, toString, truncate, truthy, utcquarter, visitArray, writeConfig, zero, zoomLinear, zoomLog, zoomPow, zoomSymlog };\n","var EOL = {},\n EOF = {},\n QUOTE = 34,\n NEWLINE = 10,\n RETURN = 13;\n\nfunction objectConverter(columns) {\n return new Function(\"d\", \"return {\" + columns.map(function(name, i) {\n return JSON.stringify(name) + \": d[\" + i + \"] || \\\"\\\"\";\n }).join(\",\") + \"}\");\n}\n\nfunction customConverter(columns, f) {\n var object = objectConverter(columns);\n return function(row, i) {\n return f(object(row), i, columns);\n };\n}\n\n// Compute unique columns in order of discovery.\nfunction inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}\n\nfunction pad(value, width) {\n var s = value + \"\", length = s.length;\n return length < width ? new Array(width - length + 1).join(0) + s : s;\n}\n\nfunction formatYear(year) {\n return year < 0 ? \"-\" + pad(-year, 6)\n : year > 9999 ? \"+\" + pad(year, 6)\n : pad(year, 4);\n}\n\nfunction formatDate(date) {\n var hours = date.getUTCHours(),\n minutes = date.getUTCMinutes(),\n seconds = date.getUTCSeconds(),\n milliseconds = date.getUTCMilliseconds();\n return isNaN(date) ? \"Invalid Date\"\n : formatYear(date.getUTCFullYear(), 4) + \"-\" + pad(date.getUTCMonth() + 1, 2) + \"-\" + pad(date.getUTCDate(), 2)\n + (milliseconds ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \":\" + pad(seconds, 2) + \".\" + pad(milliseconds, 3) + \"Z\"\n : seconds ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \":\" + pad(seconds, 2) + \"Z\"\n : minutes || hours ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \"Z\"\n : \"\");\n}\n\nexport default function(delimiter) {\n var reFormat = new RegExp(\"[\\\"\" + delimiter + \"\\n\\r]\"),\n DELIMITER = delimiter.charCodeAt(0);\n\n function parse(text, f) {\n var convert, columns, rows = parseRows(text, function(row, i) {\n if (convert) return convert(row, i - 1);\n columns = row, convert = f ? customConverter(row, f) : objectConverter(row);\n });\n rows.columns = columns || [];\n return rows;\n }\n\n function parseRows(text, f) {\n var rows = [], // output rows\n N = text.length,\n I = 0, // current character index\n n = 0, // current line number\n t, // current token\n eof = N <= 0, // current token followed by EOF?\n eol = false; // current token followed by EOL?\n\n // Strip the trailing newline.\n if (text.charCodeAt(N - 1) === NEWLINE) --N;\n if (text.charCodeAt(N - 1) === RETURN) --N;\n\n function token() {\n if (eof) return EOF;\n if (eol) return eol = false, EOL;\n\n // Unescape quotes.\n var i, j = I, c;\n if (text.charCodeAt(j) === QUOTE) {\n while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE);\n if ((i = I) >= N) eof = true;\n else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true;\n else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }\n return text.slice(j + 1, i - 1).replace(/\"\"/g, \"\\\"\");\n }\n\n // Find next delimiter or newline.\n while (I < N) {\n if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true;\n else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }\n else if (c !== DELIMITER) continue;\n return text.slice(j, i);\n }\n\n // Return last token before EOF.\n return eof = true, text.slice(j, N);\n }\n\n while ((t = token()) !== EOF) {\n var row = [];\n while (t !== EOL && t !== EOF) row.push(t), t = token();\n if (f && (row = f(row, n++)) == null) continue;\n rows.push(row);\n }\n\n return rows;\n }\n\n function preformatBody(rows, columns) {\n return rows.map(function(row) {\n return columns.map(function(column) {\n return formatValue(row[column]);\n }).join(delimiter);\n });\n }\n\n function format(rows, columns) {\n if (columns == null) columns = inferColumns(rows);\n return [columns.map(formatValue).join(delimiter)].concat(preformatBody(rows, columns)).join(\"\\n\");\n }\n\n function formatBody(rows, columns) {\n if (columns == null) columns = inferColumns(rows);\n return preformatBody(rows, columns).join(\"\\n\");\n }\n\n function formatRows(rows) {\n return rows.map(formatRow).join(\"\\n\");\n }\n\n function formatRow(row) {\n return row.map(formatValue).join(delimiter);\n }\n\n function formatValue(value) {\n return value == null ? \"\"\n : value instanceof Date ? formatDate(value)\n : reFormat.test(value += \"\") ? \"\\\"\" + value.replace(/\"/g, \"\\\"\\\"\") + \"\\\"\"\n : value;\n }\n\n return {\n parse: parse,\n parseRows: parseRows,\n format: format,\n formatBody: formatBody,\n formatRows: formatRows,\n formatRow: formatRow,\n formatValue: formatValue\n };\n}\n","export default function(x) {\n return x;\n}\n","import reverse from \"./reverse.js\";\nimport transform from \"./transform.js\";\n\nexport default function(topology, o) {\n if (typeof o === \"string\") o = topology.objects[o];\n return o.type === \"GeometryCollection\"\n ? {type: \"FeatureCollection\", features: o.geometries.map(function(o) { return feature(topology, o); })}\n : feature(topology, o);\n}\n\nfunction feature(topology, o) {\n var id = o.id,\n bbox = o.bbox,\n properties = o.properties == null ? {} : o.properties,\n geometry = object(topology, o);\n return id == null && bbox == null ? {type: \"Feature\", properties: properties, geometry: geometry}\n : bbox == null ? {type: \"Feature\", id: id, properties: properties, geometry: geometry}\n : {type: \"Feature\", id: id, bbox: bbox, properties: properties, geometry: geometry};\n}\n\nexport function object(topology, o) {\n var transformPoint = transform(topology.transform),\n arcs = topology.arcs;\n\n function arc(i, points) {\n if (points.length) points.pop();\n for (var a = arcs[i < 0 ? ~i : i], k = 0, n = a.length; k < n; ++k) {\n points.push(transformPoint(a[k], k));\n }\n if (i < 0) reverse(points, n);\n }\n\n function point(p) {\n return transformPoint(p);\n }\n\n function line(arcs) {\n var points = [];\n for (var i = 0, n = arcs.length; i < n; ++i) arc(arcs[i], points);\n if (points.length < 2) points.push(points[0]); // This should never happen per the specification.\n return points;\n }\n\n function ring(arcs) {\n var points = line(arcs);\n while (points.length < 4) points.push(points[0]); // This may happen if an arc has only two points.\n return points;\n }\n\n function polygon(arcs) {\n return arcs.map(ring);\n }\n\n function geometry(o) {\n var type = o.type, coordinates;\n switch (type) {\n case \"GeometryCollection\": return {type: type, geometries: o.geometries.map(geometry)};\n case \"Point\": coordinates = point(o.coordinates); break;\n case \"MultiPoint\": coordinates = o.coordinates.map(point); break;\n case \"LineString\": coordinates = line(o.arcs); break;\n case \"MultiLineString\": coordinates = o.arcs.map(line); break;\n case \"Polygon\": coordinates = polygon(o.arcs); break;\n case \"MultiPolygon\": coordinates = o.arcs.map(polygon); break;\n default: return null;\n }\n return {type: type, coordinates: coordinates};\n }\n\n return geometry(o);\n}\n","import identity from \"./identity.js\";\n\nexport default function(transform) {\n if (transform == null) return identity;\n var x0,\n y0,\n kx = transform.scale[0],\n ky = transform.scale[1],\n dx = transform.translate[0],\n dy = transform.translate[1];\n return function(input, i) {\n if (!i) x0 = y0 = 0;\n var j = 2, n = input.length, output = new Array(n);\n output[0] = (x0 += input[0]) * kx + dx;\n output[1] = (y0 += input[1]) * ky + dy;\n while (j < n) output[j] = input[j], ++j;\n return output;\n };\n}\n","export default function(array, n) {\n var t, j = array.length, i = j - n;\n while (i < --j) t = array[i], array[i++] = array[j], array[j] = t;\n}\n","export default function(topology, arcs) {\n var stitchedArcs = {},\n fragmentByStart = {},\n fragmentByEnd = {},\n fragments = [],\n emptyIndex = -1;\n\n // Stitch empty arcs first, since they may be subsumed by other arcs.\n arcs.forEach(function(i, j) {\n var arc = topology.arcs[i < 0 ? ~i : i], t;\n if (arc.length < 3 && !arc[1][0] && !arc[1][1]) {\n t = arcs[++emptyIndex], arcs[emptyIndex] = i, arcs[j] = t;\n }\n });\n\n arcs.forEach(function(i) {\n var e = ends(i),\n start = e[0],\n end = e[1],\n f, g;\n\n if (f = fragmentByEnd[start]) {\n delete fragmentByEnd[f.end];\n f.push(i);\n f.end = end;\n if (g = fragmentByStart[end]) {\n delete fragmentByStart[g.start];\n var fg = g === f ? f : f.concat(g);\n fragmentByStart[fg.start = f.start] = fragmentByEnd[fg.end = g.end] = fg;\n } else {\n fragmentByStart[f.start] = fragmentByEnd[f.end] = f;\n }\n } else if (f = fragmentByStart[end]) {\n delete fragmentByStart[f.start];\n f.unshift(i);\n f.start = start;\n if (g = fragmentByEnd[start]) {\n delete fragmentByEnd[g.end];\n var gf = g === f ? f : g.concat(f);\n fragmentByStart[gf.start = g.start] = fragmentByEnd[gf.end = f.end] = gf;\n } else {\n fragmentByStart[f.start] = fragmentByEnd[f.end] = f;\n }\n } else {\n f = [i];\n fragmentByStart[f.start = start] = fragmentByEnd[f.end = end] = f;\n }\n });\n\n function ends(i) {\n var arc = topology.arcs[i < 0 ? ~i : i], p0 = arc[0], p1;\n if (topology.transform) p1 = [0, 0], arc.forEach(function(dp) { p1[0] += dp[0], p1[1] += dp[1]; });\n else p1 = arc[arc.length - 1];\n return i < 0 ? [p1, p0] : [p0, p1];\n }\n\n function flush(fragmentByEnd, fragmentByStart) {\n for (var k in fragmentByEnd) {\n var f = fragmentByEnd[k];\n delete fragmentByStart[f.start];\n delete f.start;\n delete f.end;\n f.forEach(function(i) { stitchedArcs[i < 0 ? ~i : i] = 1; });\n fragments.push(f);\n }\n }\n\n flush(fragmentByEnd, fragmentByStart);\n flush(fragmentByStart, fragmentByEnd);\n arcs.forEach(function(i) { if (!stitchedArcs[i < 0 ? ~i : i]) fragments.push([i]); });\n\n return fragments;\n}\n","import {object} from \"./feature.js\";\nimport stitch from \"./stitch.js\";\n\nexport default function(topology) {\n return object(topology, meshArcs.apply(this, arguments));\n}\n\nexport function meshArcs(topology, object, filter) {\n var arcs, i, n;\n if (arguments.length > 1) arcs = extractArcs(topology, object, filter);\n else for (i = 0, arcs = new Array(n = topology.arcs.length); i < n; ++i) arcs[i] = i;\n return {type: \"MultiLineString\", arcs: stitch(topology, arcs)};\n}\n\nfunction extractArcs(topology, object, filter) {\n var arcs = [],\n geomsByArc = [],\n geom;\n\n function extract0(i) {\n var j = i < 0 ? ~i : i;\n (geomsByArc[j] || (geomsByArc[j] = [])).push({i: i, g: geom});\n }\n\n function extract1(arcs) {\n arcs.forEach(extract0);\n }\n\n function extract2(arcs) {\n arcs.forEach(extract1);\n }\n\n function extract3(arcs) {\n arcs.forEach(extract2);\n }\n\n function geometry(o) {\n switch (geom = o, o.type) {\n case \"GeometryCollection\": o.geometries.forEach(geometry); break;\n case \"LineString\": extract1(o.arcs); break;\n case \"MultiLineString\": case \"Polygon\": extract2(o.arcs); break;\n case \"MultiPolygon\": extract3(o.arcs); break;\n }\n }\n\n geometry(object);\n\n geomsByArc.forEach(filter == null\n ? function(geoms) { arcs.push(geoms[0].i); }\n : function(geoms) { if (filter(geoms[0].g, geoms[geoms.length - 1].g)) arcs.push(geoms[0].i); });\n\n return arcs;\n}\n","const e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n const step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log10(step)),\n error = step / Math.pow(10, power),\n factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n let i1, i2, inc;\n if (power < 0) {\n inc = Math.pow(10, -power) / factor;\n i1 = Math.round(start * inc);\n i2 = Math.round(stop * inc);\n if (i1 / inc < start) ++i1;\n if (i2 / inc > stop) --i2;\n inc = -inc;\n } else {\n inc = Math.pow(10, power) * factor;\n i1 = Math.round(start / inc);\n i2 = Math.round(stop / inc);\n if (i1 * inc < start) ++i1;\n if (i2 * inc > stop) --i2;\n }\n if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n if (!(count > 0)) return [];\n if (start === stop) return [start];\n const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n if (!(i2 >= i1)) return [];\n const n = i2 - i1 + 1, ticks = new Array(n);\n if (reverse) {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n } else {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n }\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n","// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n","export default function(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n","import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": (x, p) => (x * 100).toFixed(p),\n \"b\": (x) => Math.round(x).toString(2),\n \"c\": (x) => x + \"\",\n \"d\": formatDecimal,\n \"e\": (x, p) => x.toExponential(p),\n \"f\": (x, p) => x.toFixed(p),\n \"g\": (x, p) => x.toPrecision(p),\n \"o\": (x) => Math.round(x).toString(8),\n \"p\": (x, p) => formatRounded(x * 100, p),\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n \"x\": (x) => Math.round(x).toString(16)\n};\n","export default function(x) {\n return x;\n}\n","import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"−\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n","export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n","export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n","// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n","const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = (date) => {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = (date) => {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = (date) => {\n const d0 = interval(date), d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = (date, step) => {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = (start, stop, step) => {\n const range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n let previous;\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = (test) => {\n return timeInterval((date) => {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, (date, step) => {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = (start, end) => {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = (step) => {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? (d) => field(d) % step === 0\n : (d) => interval.count(0, d) % step === 0);\n };\n }\n\n return interval;\n}\n","export const durationSecond = 1000;\nexport const durationMinute = durationSecond * 60;\nexport const durationHour = durationMinute * 60;\nexport const durationDay = durationHour * 24;\nexport const durationWeek = durationDay * 7;\nexport const durationMonth = durationDay * 30;\nexport const durationYear = durationDay * 365;\n","import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n return timeInterval((date) => {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setDate(date.getDate() + step * 7);\n }, (start, end) => {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n return timeInterval((date) => {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, (start, end) => {\n return (end - start) / durationWeek;\n });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n return end.getFullYear() - start.getFullYear();\n}, (date) => {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport const utcYears = utcYear.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n return (end - start) / durationSecond;\n}, (date) => {\n return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const millisecond = timeInterval(() => {\n // noop\n}, (date, step) => {\n date.setTime(+date + step);\n}, (start, end) => {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = (k) => {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return timeInterval((date) => {\n date.setTime(Math.floor(date / k) * k);\n }, (date, step) => {\n date.setTime(+date + step * k);\n }, (start, end) => {\n return (end - start) / k;\n });\n};\n\nexport const milliseconds = millisecond.range;\n","export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n","import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can’t do this\n // for a comparator (except for specific, known comparators) because we can’t\n // tell if the comparator is symmetric, and an asymmetric comparator can’t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n","import { array, error, hasOwnProperty, extend, peek, toSet, constant, zero, one, span } from 'vega-util';\nimport { timeDay, timeWeek, utcDay, utcWeek, timeYear, timeMonth, timeHour, timeMinute, timeSecond, timeMillisecond, utcYear, utcMonth, utcHour, utcMinute, utcSecond, utcMillisecond } from 'd3-time';\nimport { bisector, tickStep } from 'd3-array';\n\nconst YEAR = 'year';\nconst QUARTER = 'quarter';\nconst MONTH = 'month';\nconst WEEK = 'week';\nconst DATE = 'date';\nconst DAY = 'day';\nconst DAYOFYEAR = 'dayofyear';\nconst HOURS = 'hours';\nconst MINUTES = 'minutes';\nconst SECONDS = 'seconds';\nconst MILLISECONDS = 'milliseconds';\nconst TIME_UNITS = [YEAR, QUARTER, MONTH, WEEK, DATE, DAY, DAYOFYEAR, HOURS, MINUTES, SECONDS, MILLISECONDS];\nconst UNITS = TIME_UNITS.reduce((o, u, i) => (o[u] = 1 + i, o), {});\nfunction timeUnits(units) {\n const u = array(units).slice(),\n m = {};\n\n // check validity\n if (!u.length) error('Missing time unit.');\n u.forEach(unit => {\n if (hasOwnProperty(UNITS, unit)) {\n m[unit] = 1;\n } else {\n error(`Invalid time unit: ${unit}.`);\n }\n });\n const numTypes = (m[WEEK] || m[DAY] ? 1 : 0) + (m[QUARTER] || m[MONTH] || m[DATE] ? 1 : 0) + (m[DAYOFYEAR] ? 1 : 0);\n if (numTypes > 1) {\n error(`Incompatible time units: ${units}`);\n }\n\n // ensure proper sort order\n u.sort((a, b) => UNITS[a] - UNITS[b]);\n return u;\n}\nconst defaultSpecifiers = {\n [YEAR]: '%Y ',\n [QUARTER]: 'Q%q ',\n [MONTH]: '%b ',\n [DATE]: '%d ',\n [WEEK]: 'W%U ',\n [DAY]: '%a ',\n [DAYOFYEAR]: '%j ',\n [HOURS]: '%H:00',\n [MINUTES]: '00:%M',\n [SECONDS]: ':%S',\n [MILLISECONDS]: '.%L',\n [`${YEAR}-${MONTH}`]: '%Y-%m ',\n [`${YEAR}-${MONTH}-${DATE}`]: '%Y-%m-%d ',\n [`${HOURS}-${MINUTES}`]: '%H:%M'\n};\nfunction timeUnitSpecifier(units, specifiers) {\n const s = extend({}, defaultSpecifiers, specifiers),\n u = timeUnits(units),\n n = u.length;\n let fmt = '',\n start = 0,\n end,\n key;\n for (start = 0; start < n;) {\n for (end = u.length; end > start; --end) {\n key = u.slice(start, end).join('-');\n if (s[key] != null) {\n fmt += s[key];\n start = end;\n break;\n }\n }\n }\n return fmt.trim();\n}\n\nconst t0 = new Date();\nfunction localYear(y) {\n t0.setFullYear(y);\n t0.setMonth(0);\n t0.setDate(1);\n t0.setHours(0, 0, 0, 0);\n return t0;\n}\nfunction dayofyear(d) {\n return localDayOfYear(new Date(d));\n}\nfunction week(d) {\n return localWeekNum(new Date(d));\n}\nfunction localDayOfYear(d) {\n return timeDay.count(localYear(d.getFullYear()) - 1, d);\n}\nfunction localWeekNum(d) {\n return timeWeek.count(localYear(d.getFullYear()) - 1, d);\n}\nfunction localFirst(y) {\n return localYear(y).getDay();\n}\nfunction localDate(y, m, d, H, M, S, L) {\n if (0 <= y && y < 100) {\n const date = new Date(-1, m, d, H, M, S, L);\n date.setFullYear(y);\n return date;\n }\n return new Date(y, m, d, H, M, S, L);\n}\nfunction utcdayofyear(d) {\n return utcDayOfYear(new Date(d));\n}\nfunction utcweek(d) {\n return utcWeekNum(new Date(d));\n}\nfunction utcDayOfYear(d) {\n const y = Date.UTC(d.getUTCFullYear(), 0, 1);\n return utcDay.count(y - 1, d);\n}\nfunction utcWeekNum(d) {\n const y = Date.UTC(d.getUTCFullYear(), 0, 1);\n return utcWeek.count(y - 1, d);\n}\nfunction utcFirst(y) {\n t0.setTime(Date.UTC(y, 0, 1));\n return t0.getUTCDay();\n}\nfunction utcDate(y, m, d, H, M, S, L) {\n if (0 <= y && y < 100) {\n const date = new Date(Date.UTC(-1, m, d, H, M, S, L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(y, m, d, H, M, S, L));\n}\n\nfunction floor(units, step, get, inv, newDate) {\n const s = step || 1,\n b = peek(units),\n _ = (unit, p, key) => {\n key = key || unit;\n return getUnit(get[key], inv[key], unit === b && s, p);\n };\n const t = new Date(),\n u = toSet(units),\n y = u[YEAR] ? _(YEAR) : constant(2012),\n m = u[MONTH] ? _(MONTH) : u[QUARTER] ? _(QUARTER) : zero,\n d = u[WEEK] && u[DAY] ? _(DAY, 1, WEEK + DAY) : u[WEEK] ? _(WEEK, 1) : u[DAY] ? _(DAY, 1) : u[DATE] ? _(DATE, 1) : u[DAYOFYEAR] ? _(DAYOFYEAR, 1) : one,\n H = u[HOURS] ? _(HOURS) : zero,\n M = u[MINUTES] ? _(MINUTES) : zero,\n S = u[SECONDS] ? _(SECONDS) : zero,\n L = u[MILLISECONDS] ? _(MILLISECONDS) : zero;\n return function (v) {\n t.setTime(+v);\n const year = y(t);\n return newDate(year, m(t), d(t, year), H(t), M(t), S(t), L(t));\n };\n}\nfunction getUnit(f, inv, step, phase) {\n const u = step <= 1 ? f : phase ? (d, y) => phase + step * Math.floor((f(d, y) - phase) / step) : (d, y) => step * Math.floor(f(d, y) / step);\n return inv ? (d, y) => inv(u(d, y), y) : u;\n}\n\n// returns the day of the year based on week number, day of week,\n// and the day of the week for the first day of the year\nfunction weekday(week, day, firstDay) {\n return day + week * 7 - (firstDay + 6) % 7;\n}\n\n// -- LOCAL TIME --\n\nconst localGet = {\n [YEAR]: d => d.getFullYear(),\n [QUARTER]: d => Math.floor(d.getMonth() / 3),\n [MONTH]: d => d.getMonth(),\n [DATE]: d => d.getDate(),\n [HOURS]: d => d.getHours(),\n [MINUTES]: d => d.getMinutes(),\n [SECONDS]: d => d.getSeconds(),\n [MILLISECONDS]: d => d.getMilliseconds(),\n [DAYOFYEAR]: d => localDayOfYear(d),\n [WEEK]: d => localWeekNum(d),\n [WEEK + DAY]: (d, y) => weekday(localWeekNum(d), d.getDay(), localFirst(y)),\n [DAY]: (d, y) => weekday(1, d.getDay(), localFirst(y))\n};\nconst localInv = {\n [QUARTER]: q => 3 * q,\n [WEEK]: (w, y) => weekday(w, 0, localFirst(y))\n};\nfunction timeFloor(units, step) {\n return floor(units, step || 1, localGet, localInv, localDate);\n}\n\n// -- UTC TIME --\n\nconst utcGet = {\n [YEAR]: d => d.getUTCFullYear(),\n [QUARTER]: d => Math.floor(d.getUTCMonth() / 3),\n [MONTH]: d => d.getUTCMonth(),\n [DATE]: d => d.getUTCDate(),\n [HOURS]: d => d.getUTCHours(),\n [MINUTES]: d => d.getUTCMinutes(),\n [SECONDS]: d => d.getUTCSeconds(),\n [MILLISECONDS]: d => d.getUTCMilliseconds(),\n [DAYOFYEAR]: d => utcDayOfYear(d),\n [WEEK]: d => utcWeekNum(d),\n [DAY]: (d, y) => weekday(1, d.getUTCDay(), utcFirst(y)),\n [WEEK + DAY]: (d, y) => weekday(utcWeekNum(d), d.getUTCDay(), utcFirst(y))\n};\nconst utcInv = {\n [QUARTER]: q => 3 * q,\n [WEEK]: (w, y) => weekday(w, 0, utcFirst(y))\n};\nfunction utcFloor(units, step) {\n return floor(units, step || 1, utcGet, utcInv, utcDate);\n}\n\nconst timeIntervals = {\n [YEAR]: timeYear,\n [QUARTER]: timeMonth.every(3),\n [MONTH]: timeMonth,\n [WEEK]: timeWeek,\n [DATE]: timeDay,\n [DAY]: timeDay,\n [DAYOFYEAR]: timeDay,\n [HOURS]: timeHour,\n [MINUTES]: timeMinute,\n [SECONDS]: timeSecond,\n [MILLISECONDS]: timeMillisecond\n};\nconst utcIntervals = {\n [YEAR]: utcYear,\n [QUARTER]: utcMonth.every(3),\n [MONTH]: utcMonth,\n [WEEK]: utcWeek,\n [DATE]: utcDay,\n [DAY]: utcDay,\n [DAYOFYEAR]: utcDay,\n [HOURS]: utcHour,\n [MINUTES]: utcMinute,\n [SECONDS]: utcSecond,\n [MILLISECONDS]: utcMillisecond\n};\nfunction timeInterval(unit) {\n return timeIntervals[unit];\n}\nfunction utcInterval(unit) {\n return utcIntervals[unit];\n}\nfunction offset(ival, date, step) {\n return ival ? ival.offset(date, step) : undefined;\n}\nfunction timeOffset(unit, date, step) {\n return offset(timeInterval(unit), date, step);\n}\nfunction utcOffset(unit, date, step) {\n return offset(utcInterval(unit), date, step);\n}\nfunction sequence(ival, start, stop, step) {\n return ival ? ival.range(start, stop, step) : undefined;\n}\nfunction timeSequence(unit, start, stop, step) {\n return sequence(timeInterval(unit), start, stop, step);\n}\nfunction utcSequence(unit, start, stop, step) {\n return sequence(utcInterval(unit), start, stop, step);\n}\n\nconst durationSecond = 1000,\n durationMinute = durationSecond * 60,\n durationHour = durationMinute * 60,\n durationDay = durationHour * 24,\n durationWeek = durationDay * 7,\n durationMonth = durationDay * 30,\n durationYear = durationDay * 365;\nconst Milli = [YEAR, MONTH, DATE, HOURS, MINUTES, SECONDS, MILLISECONDS],\n Seconds = Milli.slice(0, -1),\n Minutes = Seconds.slice(0, -1),\n Hours = Minutes.slice(0, -1),\n Day = Hours.slice(0, -1),\n Week = [YEAR, WEEK],\n Month = [YEAR, MONTH],\n Year = [YEAR];\nconst intervals = [[Seconds, 1, durationSecond], [Seconds, 5, 5 * durationSecond], [Seconds, 15, 15 * durationSecond], [Seconds, 30, 30 * durationSecond], [Minutes, 1, durationMinute], [Minutes, 5, 5 * durationMinute], [Minutes, 15, 15 * durationMinute], [Minutes, 30, 30 * durationMinute], [Hours, 1, durationHour], [Hours, 3, 3 * durationHour], [Hours, 6, 6 * durationHour], [Hours, 12, 12 * durationHour], [Day, 1, durationDay], [Week, 1, durationWeek], [Month, 1, durationMonth], [Month, 3, 3 * durationMonth], [Year, 1, durationYear]];\nfunction bin (opt) {\n const ext = opt.extent,\n max = opt.maxbins || 40,\n target = Math.abs(span(ext)) / max;\n let i = bisector(i => i[2]).right(intervals, target),\n units,\n step;\n if (i === intervals.length) {\n units = Year, step = tickStep(ext[0] / durationYear, ext[1] / durationYear, max);\n } else if (i) {\n i = intervals[target / intervals[i - 1][2] < intervals[i][2] / target ? i - 1 : i];\n units = i[0];\n step = i[1];\n } else {\n units = Milli;\n step = Math.max(tickStep(ext[0], ext[1], max), 1);\n }\n return {\n units,\n step\n };\n}\n\nexport { DATE, DAY, DAYOFYEAR, HOURS, MILLISECONDS, MINUTES, MONTH, QUARTER, SECONDS, TIME_UNITS, WEEK, YEAR, dayofyear, bin as timeBin, timeFloor, timeInterval, timeOffset, timeSequence, timeUnitSpecifier, timeUnits, utcFloor, utcInterval, utcOffset, utcSequence, utcdayofyear, utcweek, week };\n","import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n return new Map(names.map((name, i) => [name.toLowerCase(), i]));\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n","import { tickStep } from 'd3-array';\nimport { formatLocale, formatSpecifier, precisionFixed, precisionRound, precisionPrefix, format, formatPrefix } from 'd3-format';\nimport { SECONDS, MINUTES, HOURS, DATE, WEEK, MONTH, QUARTER, YEAR, MILLISECONDS, DAY, timeInterval, utcInterval } from 'vega-time';\nimport { isString, isObject, error, extend } from 'vega-util';\nimport { timeFormatLocale as timeFormatLocale$1, timeFormat, timeParse, utcFormat, utcParse } from 'd3-time-format';\n\nfunction memoize (method) {\n const cache = {};\n return spec => cache[spec] || (cache[spec] = method(spec));\n}\n\nfunction trimZeroes(numberFormat, decimalChar) {\n return x => {\n const str = numberFormat(x),\n dec = str.indexOf(decimalChar);\n if (dec < 0) return str;\n let idx = rightmostDigit(str, dec);\n const end = idx < str.length ? str.slice(idx) : '';\n while (--idx > dec) if (str[idx] !== '0') {\n ++idx;\n break;\n }\n return str.slice(0, idx) + end;\n };\n}\nfunction rightmostDigit(str, dec) {\n let i = str.lastIndexOf('e'),\n c;\n if (i > 0) return i;\n for (i = str.length; --i > dec;) {\n c = str.charCodeAt(i);\n if (c >= 48 && c <= 57) return i + 1; // is digit\n }\n}\nfunction numberLocale(locale) {\n const format = memoize(locale.format),\n formatPrefix = locale.formatPrefix;\n return {\n format,\n formatPrefix,\n formatFloat(spec) {\n const s = formatSpecifier(spec || ',');\n if (s.precision == null) {\n s.precision = 12;\n switch (s.type) {\n case '%':\n s.precision -= 2;\n break;\n case 'e':\n s.precision -= 1;\n break;\n }\n return trimZeroes(format(s),\n // number format\n format('.1f')(1)[1] // decimal point character\n );\n } else {\n return format(s);\n }\n },\n formatSpan(start, stop, count, specifier) {\n specifier = formatSpecifier(specifier == null ? ',f' : specifier);\n const step = tickStep(start, stop, count),\n value = Math.max(Math.abs(start), Math.abs(stop));\n let precision;\n if (specifier.precision == null) {\n switch (specifier.type) {\n case 's':\n {\n if (!isNaN(precision = precisionPrefix(step, value))) {\n specifier.precision = precision;\n }\n return formatPrefix(specifier, value);\n }\n case '':\n case 'e':\n case 'g':\n case 'p':\n case 'r':\n {\n if (!isNaN(precision = precisionRound(step, value))) {\n specifier.precision = precision - (specifier.type === 'e');\n }\n break;\n }\n case 'f':\n case '%':\n {\n if (!isNaN(precision = precisionFixed(step))) {\n specifier.precision = precision - (specifier.type === '%') * 2;\n }\n break;\n }\n }\n }\n return format(specifier);\n }\n };\n}\nlet defaultNumberLocale;\nresetNumberFormatDefaultLocale();\nfunction resetNumberFormatDefaultLocale() {\n return defaultNumberLocale = numberLocale({\n format: format,\n formatPrefix: formatPrefix\n });\n}\nfunction numberFormatLocale(definition) {\n return numberLocale(formatLocale(definition));\n}\nfunction numberFormatDefaultLocale(definition) {\n return arguments.length ? defaultNumberLocale = numberFormatLocale(definition) : defaultNumberLocale;\n}\n\nfunction timeMultiFormat(format, interval, spec) {\n spec = spec || {};\n if (!isObject(spec)) {\n error(`Invalid time multi-format specifier: ${spec}`);\n }\n const second = interval(SECONDS),\n minute = interval(MINUTES),\n hour = interval(HOURS),\n day = interval(DATE),\n week = interval(WEEK),\n month = interval(MONTH),\n quarter = interval(QUARTER),\n year = interval(YEAR),\n L = format(spec[MILLISECONDS] || '.%L'),\n S = format(spec[SECONDS] || ':%S'),\n M = format(spec[MINUTES] || '%I:%M'),\n H = format(spec[HOURS] || '%I %p'),\n d = format(spec[DATE] || spec[DAY] || '%a %d'),\n w = format(spec[WEEK] || '%b %d'),\n m = format(spec[MONTH] || '%B'),\n q = format(spec[QUARTER] || '%B'),\n y = format(spec[YEAR] || '%Y');\n return date => (second(date) < date ? L : minute(date) < date ? S : hour(date) < date ? M : day(date) < date ? H : month(date) < date ? week(date) < date ? d : w : year(date) < date ? quarter(date) < date ? m : q : y)(date);\n}\nfunction timeLocale(locale) {\n const timeFormat = memoize(locale.format),\n utcFormat = memoize(locale.utcFormat);\n return {\n timeFormat: spec => isString(spec) ? timeFormat(spec) : timeMultiFormat(timeFormat, timeInterval, spec),\n utcFormat: spec => isString(spec) ? utcFormat(spec) : timeMultiFormat(utcFormat, utcInterval, spec),\n timeParse: memoize(locale.parse),\n utcParse: memoize(locale.utcParse)\n };\n}\nlet defaultTimeLocale;\nresetTimeFormatDefaultLocale();\nfunction resetTimeFormatDefaultLocale() {\n return defaultTimeLocale = timeLocale({\n format: timeFormat,\n parse: timeParse,\n utcFormat: utcFormat,\n utcParse: utcParse\n });\n}\nfunction timeFormatLocale(definition) {\n return timeLocale(timeFormatLocale$1(definition));\n}\nfunction timeFormatDefaultLocale(definition) {\n return arguments.length ? defaultTimeLocale = timeFormatLocale(definition) : defaultTimeLocale;\n}\n\nconst createLocale = (number, time) => extend({}, number, time);\nfunction locale(numberSpec, timeSpec) {\n const number = numberSpec ? numberFormatLocale(numberSpec) : numberFormatDefaultLocale();\n const time = timeSpec ? timeFormatLocale(timeSpec) : timeFormatDefaultLocale();\n return createLocale(number, time);\n}\nfunction defaultLocale(numberSpec, timeSpec) {\n const args = arguments.length;\n if (args && args !== 2) {\n error('defaultLocale expects either zero or two arguments.');\n }\n return args ? createLocale(numberFormatDefaultLocale(numberSpec), timeFormatDefaultLocale(timeSpec)) : createLocale(numberFormatDefaultLocale(), timeFormatDefaultLocale());\n}\nfunction resetDefaultLocale() {\n resetNumberFormatDefaultLocale();\n resetTimeFormatDefaultLocale();\n return defaultLocale();\n}\n\nexport { defaultLocale, locale, numberFormatDefaultLocale, numberFormatLocale, resetDefaultLocale, resetNumberFormatDefaultLocale, resetTimeFormatDefaultLocale, timeFormatDefaultLocale, timeFormatLocale };\n","import { extend, error, stringValue, isFunction, toBoolean, toNumber, toDate, toString, identity, field, isObject, isArray, isIterable, hasOwnProperty } from 'vega-util';\nimport { dsvFormat } from 'd3-dsv';\nimport { feature, mesh } from 'topojson-client';\nimport { timeFormatDefaultLocale } from 'vega-format';\n\n// Matches absolute URLs with optional protocol\n// https://... file://... //...\nconst protocol_re = /^(data:|([A-Za-z]+:)?\\/\\/)/;\n\n// Matches allowed URIs. From https://github.com/cure53/DOMPurify/blob/master/src/regexp.js with added file://\nconst allowed_re = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i; // eslint-disable-line no-useless-escape\nconst whitespace_re = /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205f\\u3000]/g; // eslint-disable-line no-control-regex\n\n// Special treatment in node.js for the file: protocol\nconst fileProtocol = 'file://';\n\n/**\n * Factory for a loader constructor that provides methods for requesting\n * files from either the network or disk, and for sanitizing request URIs.\n * @param {function} fetch - The Fetch API for HTTP network requests.\n * If null or undefined, HTTP loading will be disabled.\n * @param {object} fs - The file system interface for file loading.\n * If null or undefined, local file loading will be disabled.\n * @return {function} A loader constructor with the following signature:\n * param {object} [options] - Optional default loading options to use.\n * return {object} - A new loader instance.\n */\nfunction loaderFactory (fetch, fs) {\n return options => ({\n options: options || {},\n sanitize: sanitize,\n load: load,\n fileAccess: !!fs,\n file: fileLoader(fs),\n http: httpLoader(fetch)\n });\n}\n\n/**\n * Load an external resource, typically either from the web or from the local\n * filesystem. This function uses {@link sanitize} to first sanitize the uri,\n * then calls either {@link http} (for web requests) or {@link file} (for\n * filesystem loading).\n * @param {string} uri - The resource indicator (e.g., URL or filename).\n * @param {object} [options] - Optional loading options. These options will\n * override any existing default options.\n * @return {Promise} - A promise that resolves to the loaded content.\n */\nasync function load(uri, options) {\n const opt = await this.sanitize(uri, options),\n url = opt.href;\n return opt.localFile ? this.file(url) : this.http(url, options);\n}\n\n/**\n * URI sanitizer function.\n * @param {string} uri - The uri (url or filename) to check.\n * @param {object} options - An options hash.\n * @return {Promise} - A promise that resolves to an object containing\n * sanitized uri data, or rejects it the input uri is deemed invalid.\n * The properties of the resolved object are assumed to be\n * valid attributes for an HTML 'a' tag. The sanitized uri *must* be\n * provided by the 'href' property of the returned object.\n */\nasync function sanitize(uri, options) {\n options = extend({}, this.options, options);\n const fileAccess = this.fileAccess,\n result = {\n href: null\n };\n let isFile, loadFile, base;\n const isAllowed = allowed_re.test(uri.replace(whitespace_re, ''));\n if (uri == null || typeof uri !== 'string' || !isAllowed) {\n error('Sanitize failure, invalid URI: ' + stringValue(uri));\n }\n const hasProtocol = protocol_re.test(uri);\n\n // if relative url (no protocol/host), prepend baseURL\n if ((base = options.baseURL) && !hasProtocol) {\n // Ensure that there is a slash between the baseURL (e.g. hostname) and url\n if (!uri.startsWith('/') && !base.endsWith('/')) {\n uri = '/' + uri;\n }\n uri = base + uri;\n }\n\n // should we load from file system?\n loadFile = (isFile = uri.startsWith(fileProtocol)) || options.mode === 'file' || options.mode !== 'http' && !hasProtocol && fileAccess;\n if (isFile) {\n // strip file protocol\n uri = uri.slice(fileProtocol.length);\n } else if (uri.startsWith('//')) {\n if (options.defaultProtocol === 'file') {\n // if is file, strip protocol and set loadFile flag\n uri = uri.slice(2);\n loadFile = true;\n } else {\n // if relative protocol (starts with '//'), prepend default protocol\n uri = (options.defaultProtocol || 'http') + ':' + uri;\n }\n }\n\n // set non-enumerable mode flag to indicate local file load\n Object.defineProperty(result, 'localFile', {\n value: !!loadFile\n });\n\n // set uri\n result.href = uri;\n\n // set default result target, if specified\n if (options.target) {\n result.target = options.target + '';\n }\n\n // set default result rel, if specified (#1542)\n if (options.rel) {\n result.rel = options.rel + '';\n }\n\n // provide control over cross-origin image handling (#2238)\n // https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image\n if (options.context === 'image' && options.crossOrigin) {\n result.crossOrigin = options.crossOrigin + '';\n }\n\n // return\n return result;\n}\n\n/**\n * File system loader factory.\n * @param {object} fs - The file system interface.\n * @return {function} - A file loader with the following signature:\n * param {string} filename - The file system path to load.\n * param {string} filename - The file system path to load.\n * return {Promise} A promise that resolves to the file contents.\n */\nfunction fileLoader(fs) {\n return fs ? filename => new Promise((accept, reject) => {\n fs.readFile(filename, (error, data) => {\n if (error) reject(error);else accept(data);\n });\n }) : fileReject;\n}\n\n/**\n * Default file system loader that simply rejects.\n */\nasync function fileReject() {\n error('No file system access.');\n}\n\n/**\n * HTTP request handler factory.\n * @param {function} fetch - The Fetch API method.\n * @return {function} - An http loader with the following signature:\n * param {string} url - The url to request.\n * param {object} options - An options hash.\n * return {Promise} - A promise that resolves to the file contents.\n */\nfunction httpLoader(fetch) {\n return fetch ? async function (url, options) {\n const opt = extend({}, this.options.http, options),\n type = options && options.response,\n response = await fetch(url, opt);\n return !response.ok ? error(response.status + '' + response.statusText) : isFunction(response[type]) ? response[type]() : response.text();\n } : httpReject;\n}\n\n/**\n * Default http request handler that simply rejects.\n */\nasync function httpReject() {\n error('No HTTP fetch method available.');\n}\n\nconst isValid = _ => _ != null && _ === _;\nconst isBoolean = _ => _ === 'true' || _ === 'false' || _ === true || _ === false;\nconst isDate = _ => !Number.isNaN(Date.parse(_));\nconst isNumber = _ => !Number.isNaN(+_) && !(_ instanceof Date);\nconst isInteger = _ => isNumber(_) && Number.isInteger(+_);\nconst typeParsers = {\n boolean: toBoolean,\n integer: toNumber,\n number: toNumber,\n date: toDate,\n string: toString,\n unknown: identity\n};\nconst typeTests = [isBoolean, isInteger, isNumber, isDate];\nconst typeList = ['boolean', 'integer', 'number', 'date'];\nfunction inferType(values, field) {\n if (!values || !values.length) return 'unknown';\n const n = values.length,\n m = typeTests.length,\n a = typeTests.map((_, i) => i + 1);\n for (let i = 0, t = 0, j, value; i < n; ++i) {\n value = field ? values[i][field] : values[i];\n for (j = 0; j < m; ++j) {\n if (a[j] && isValid(value) && !typeTests[j](value)) {\n a[j] = 0;\n ++t;\n if (t === typeTests.length) return 'string';\n }\n }\n }\n return typeList[a.reduce((u, v) => u === 0 ? v : u, 0) - 1];\n}\nfunction inferTypes(data, fields) {\n return fields.reduce((types, field) => {\n types[field] = inferType(data, field);\n return types;\n }, {});\n}\n\nfunction delimitedFormat(delimiter) {\n const parse = function (data, format) {\n const delim = {\n delimiter: delimiter\n };\n return dsv(data, format ? extend(format, delim) : delim);\n };\n parse.responseType = 'text';\n return parse;\n}\nfunction dsv(data, format) {\n if (format.header) {\n data = format.header.map(stringValue).join(format.delimiter) + '\\n' + data;\n }\n return dsvFormat(format.delimiter).parse(data + '');\n}\ndsv.responseType = 'text';\n\nfunction isBuffer(_) {\n return typeof Buffer === 'function' && isFunction(Buffer.isBuffer) ? Buffer.isBuffer(_) : false;\n}\nfunction json(data, format) {\n const prop = format && format.property ? field(format.property) : identity;\n return isObject(data) && !isBuffer(data) ? parseJSON(prop(data), format) : prop(JSON.parse(data));\n}\njson.responseType = 'json';\nfunction parseJSON(data, format) {\n if (!isArray(data) && isIterable(data)) {\n data = [...data];\n }\n return format && format.copy ? JSON.parse(JSON.stringify(data)) : data;\n}\n\nconst filters = {\n interior: (a, b) => a !== b,\n exterior: (a, b) => a === b\n};\nfunction topojson(data, format) {\n let method, object, property, filter;\n data = json(data, format);\n if (format && format.feature) {\n method = feature;\n property = format.feature;\n } else if (format && format.mesh) {\n method = mesh;\n property = format.mesh;\n filter = filters[format.filter];\n } else {\n error('Missing TopoJSON feature or mesh parameter.');\n }\n object = (object = data.objects[property]) ? method(data, object, filter) : error('Invalid TopoJSON object: ' + property);\n return object && object.features || [object];\n}\ntopojson.responseType = 'json';\n\nconst format = {\n dsv: dsv,\n csv: delimitedFormat(','),\n tsv: delimitedFormat('\\t'),\n json: json,\n topojson: topojson\n};\nfunction formats(name, reader) {\n if (arguments.length > 1) {\n format[name] = reader;\n return this;\n } else {\n return hasOwnProperty(format, name) ? format[name] : null;\n }\n}\nfunction responseType(type) {\n const f = formats(type);\n return f && f.responseType || 'text';\n}\n\nfunction read (data, schema, timeParser, utcParser) {\n schema = schema || {};\n const reader = formats(schema.type || 'json');\n if (!reader) error('Unknown data format type: ' + schema.type);\n data = reader(data, schema);\n if (schema.parse) parse(data, schema.parse, timeParser, utcParser);\n if (hasOwnProperty(data, 'columns')) delete data.columns;\n return data;\n}\nfunction parse(data, types, timeParser, utcParser) {\n if (!data.length) return; // early exit for empty data\n\n const locale = timeFormatDefaultLocale();\n timeParser = timeParser || locale.timeParse;\n utcParser = utcParser || locale.utcParse;\n let fields = data.columns || Object.keys(data[0]),\n datum,\n field,\n i,\n j,\n n,\n m;\n if (types === 'auto') types = inferTypes(data, fields);\n fields = Object.keys(types);\n const parsers = fields.map(field => {\n const type = types[field];\n let parts, pattern;\n if (type && (type.startsWith('date:') || type.startsWith('utc:'))) {\n parts = type.split(/:(.+)?/, 2); // split on first :\n pattern = parts[1];\n if (pattern[0] === '\\'' && pattern[pattern.length - 1] === '\\'' || pattern[0] === '\"' && pattern[pattern.length - 1] === '\"') {\n pattern = pattern.slice(1, -1);\n }\n const parse = parts[0] === 'utc' ? utcParser : timeParser;\n return parse(pattern);\n }\n if (!typeParsers[type]) {\n throw Error('Illegal format pattern: ' + field + ':' + type);\n }\n return typeParsers[type];\n });\n for (i = 0, n = data.length, m = fields.length; i < n; ++i) {\n datum = data[i];\n for (j = 0; j < m; ++j) {\n field = fields[j];\n datum[field] = parsers[j](datum[field]);\n }\n }\n}\n\nconst loader = loaderFactory(typeof fetch !== 'undefined' && fetch,\n// use built-in fetch API\nnull // no file system access\n);\n\nexport { format, formats, inferType, inferTypes, loader, read, responseType, typeParsers };\n","import { identity, array, isFunction, constant, isArray, id, error, truthy, debounce, extend, visitArray, inherits, logger, Error, hasOwnProperty } from 'vega-util';\nimport { read, responseType, loader } from 'vega-loader';\nimport { defaultLocale } from 'vega-format';\n\nfunction UniqueList(idFunc) {\n const $ = idFunc || identity,\n list = [],\n ids = {};\n list.add = _ => {\n const id = $(_);\n if (!ids[id]) {\n ids[id] = 1;\n list.push(_);\n }\n return list;\n };\n list.remove = _ => {\n const id = $(_);\n if (ids[id]) {\n ids[id] = 0;\n const idx = list.indexOf(_);\n if (idx >= 0) list.splice(idx, 1);\n }\n return list;\n };\n return list;\n}\n\n/**\n * Invoke and await a potentially async callback function. If\n * an error occurs, trap it and route to Dataflow.error.\n * @param {Dataflow} df - The dataflow instance\n * @param {function} callback - A callback function to invoke\n * and then await. The dataflow will be passed as the single\n * argument to the function.\n */\nasync function asyncCallback (df, callback) {\n try {\n await callback(df);\n } catch (err) {\n df.error(err);\n }\n}\n\nconst TUPLE_ID_KEY = Symbol('vega_id');\nlet TUPLE_ID = 1;\n\n/**\n * Checks if an input value is a registered tuple.\n * @param {*} t - The value to check.\n * @return {boolean} True if the input is a tuple, false otherwise.\n */\nfunction isTuple(t) {\n return !!(t && tupleid(t));\n}\n\n/**\n * Returns the id of a tuple.\n * @param {object} t - The input tuple.\n * @return {*} the tuple id.\n */\nfunction tupleid(t) {\n return t[TUPLE_ID_KEY];\n}\n\n/**\n * Sets the id of a tuple.\n * @param {object} t - The input tuple.\n * @param {*} id - The id value to set.\n * @return {object} the input tuple.\n */\nfunction setid(t, id) {\n t[TUPLE_ID_KEY] = id;\n return t;\n}\n\n/**\n * Ingest an object or value as a data tuple.\n * If the input value is an object, an id field will be added to it. For\n * efficiency, the input object is modified directly. A copy is not made.\n * If the input value is a literal, it will be wrapped in a new object\n * instance, with the value accessible as the 'data' property.\n * @param datum - The value to ingest.\n * @return {object} The ingested data tuple.\n */\nfunction ingest$1(datum) {\n const t = datum === Object(datum) ? datum : {\n data: datum\n };\n return tupleid(t) ? t : setid(t, TUPLE_ID++);\n}\n\n/**\n * Given a source tuple, return a derived copy.\n * @param {object} t - The source tuple.\n * @return {object} The derived tuple.\n */\nfunction derive(t) {\n return rederive(t, ingest$1({}));\n}\n\n/**\n * Rederive a derived tuple by copying values from the source tuple.\n * @param {object} t - The source tuple.\n * @param {object} d - The derived tuple.\n * @return {object} The derived tuple.\n */\nfunction rederive(t, d) {\n for (const k in t) d[k] = t[k];\n return d;\n}\n\n/**\n * Replace an existing tuple with a new tuple.\n * @param {object} t - The existing data tuple.\n * @param {object} d - The new tuple that replaces the old.\n * @return {object} The new tuple.\n */\nfunction replace(t, d) {\n return setid(d, tupleid(t));\n}\n\n/**\n * Generate an augmented comparator function that provides stable\n * sorting by tuple id when the given comparator produces ties.\n * @param {function} cmp - The comparator to augment.\n * @param {function} [f] - Optional tuple accessor function.\n * @return {function} An augmented comparator function.\n */\nfunction stableCompare(cmp, f) {\n return !cmp ? null : f ? (a, b) => cmp(a, b) || tupleid(f(a)) - tupleid(f(b)) : (a, b) => cmp(a, b) || tupleid(a) - tupleid(b);\n}\n\nfunction isChangeSet(v) {\n return v && v.constructor === changeset;\n}\nfunction changeset() {\n const add = [],\n // insert tuples\n rem = [],\n // remove tuples\n mod = [],\n // modify tuples\n remp = [],\n // remove by predicate\n modp = []; // modify by predicate\n let clean = null,\n reflow = false;\n return {\n constructor: changeset,\n insert(t) {\n const d = array(t),\n n = d.length;\n for (let i = 0; i < n; ++i) add.push(d[i]);\n return this;\n },\n remove(t) {\n const a = isFunction(t) ? remp : rem,\n d = array(t),\n n = d.length;\n for (let i = 0; i < n; ++i) a.push(d[i]);\n return this;\n },\n modify(t, field, value) {\n const m = {\n field: field,\n value: constant(value)\n };\n if (isFunction(t)) {\n m.filter = t;\n modp.push(m);\n } else {\n m.tuple = t;\n mod.push(m);\n }\n return this;\n },\n encode(t, set) {\n if (isFunction(t)) modp.push({\n filter: t,\n field: set\n });else mod.push({\n tuple: t,\n field: set\n });\n return this;\n },\n clean(value) {\n clean = value;\n return this;\n },\n reflow() {\n reflow = true;\n return this;\n },\n pulse(pulse, tuples) {\n const cur = {},\n out = {};\n let i, n, m, f, t, id;\n\n // build lookup table of current tuples\n for (i = 0, n = tuples.length; i < n; ++i) {\n cur[tupleid(tuples[i])] = 1;\n }\n\n // process individual tuples to remove\n for (i = 0, n = rem.length; i < n; ++i) {\n t = rem[i];\n cur[tupleid(t)] = -1;\n }\n\n // process predicate-based removals\n for (i = 0, n = remp.length; i < n; ++i) {\n f = remp[i];\n tuples.forEach(t => {\n if (f(t)) cur[tupleid(t)] = -1;\n });\n }\n\n // process all add tuples\n for (i = 0, n = add.length; i < n; ++i) {\n t = add[i];\n id = tupleid(t);\n if (cur[id]) {\n // tuple already resides in dataset\n // if flagged for both add and remove, cancel\n cur[id] = 1;\n } else {\n // tuple does not reside in dataset, add\n pulse.add.push(ingest$1(add[i]));\n }\n }\n\n // populate pulse rem list\n for (i = 0, n = tuples.length; i < n; ++i) {\n t = tuples[i];\n if (cur[tupleid(t)] < 0) pulse.rem.push(t);\n }\n\n // modify helper method\n function modify(t, f, v) {\n if (v) {\n t[f] = v(t);\n } else {\n pulse.encode = f;\n }\n if (!reflow) out[tupleid(t)] = t;\n }\n\n // process individual tuples to modify\n for (i = 0, n = mod.length; i < n; ++i) {\n m = mod[i];\n t = m.tuple;\n f = m.field;\n id = cur[tupleid(t)];\n if (id > 0) {\n modify(t, f, m.value);\n pulse.modifies(f);\n }\n }\n\n // process predicate-based modifications\n for (i = 0, n = modp.length; i < n; ++i) {\n m = modp[i];\n f = m.filter;\n tuples.forEach(t => {\n if (f(t) && cur[tupleid(t)] > 0) {\n modify(t, m.field, m.value);\n }\n });\n pulse.modifies(m.field);\n }\n\n // upon reflow request, populate mod with all non-removed tuples\n // otherwise, populate mod with modified tuples only\n if (reflow) {\n pulse.mod = rem.length || remp.length ? tuples.filter(t => cur[tupleid(t)] > 0) : tuples.slice();\n } else {\n for (id in out) pulse.mod.push(out[id]);\n }\n\n // set pulse garbage collection request\n if (clean || clean == null && (rem.length || remp.length)) {\n pulse.clean(true);\n }\n return pulse;\n }\n };\n}\n\nconst CACHE = '_:mod:_';\n\n/**\n * Hash that tracks modifications to assigned values.\n * Callers *must* use the set method to update values.\n */\nfunction Parameters() {\n Object.defineProperty(this, CACHE, {\n writable: true,\n value: {}\n });\n}\nParameters.prototype = {\n /**\n * Set a parameter value. If the parameter value changes, the parameter\n * will be recorded as modified.\n * @param {string} name - The parameter name.\n * @param {number} index - The index into an array-value parameter. Ignored if\n * the argument is undefined, null or less than zero.\n * @param {*} value - The parameter value to set.\n * @param {boolean} [force=false] - If true, records the parameter as modified\n * even if the value is unchanged.\n * @return {Parameters} - This parameter object.\n */\n set(name, index, value, force) {\n const o = this,\n v = o[name],\n mod = o[CACHE];\n if (index != null && index >= 0) {\n if (v[index] !== value || force) {\n v[index] = value;\n mod[index + ':' + name] = -1;\n mod[name] = -1;\n }\n } else if (v !== value || force) {\n o[name] = value;\n mod[name] = isArray(value) ? 1 + value.length : -1;\n }\n return o;\n },\n /**\n * Tests if one or more parameters has been modified. If invoked with no\n * arguments, returns true if any parameter value has changed. If the first\n * argument is array, returns trues if any parameter name in the array has\n * changed. Otherwise, tests if the given name and optional array index has\n * changed.\n * @param {string} name - The parameter name to test.\n * @param {number} [index=undefined] - The parameter array index to test.\n * @return {boolean} - Returns true if a queried parameter was modified.\n */\n modified(name, index) {\n const mod = this[CACHE];\n if (!arguments.length) {\n for (const k in mod) {\n if (mod[k]) return true;\n }\n return false;\n } else if (isArray(name)) {\n for (let k = 0; k < name.length; ++k) {\n if (mod[name[k]]) return true;\n }\n return false;\n }\n return index != null && index >= 0 ? index + 1 < mod[name] || !!mod[index + ':' + name] : !!mod[name];\n },\n /**\n * Clears the modification records. After calling this method,\n * all parameters are considered unmodified.\n */\n clear() {\n this[CACHE] = {};\n return this;\n }\n};\n\nlet OP_ID = 0;\nconst PULSE = 'pulse',\n NO_PARAMS = new Parameters();\n\n// Boolean Flags\nconst SKIP$1 = 1,\n MODIFIED = 2;\n\n/**\n * An Operator is a processing node in a dataflow graph.\n * Each operator stores a value and an optional value update function.\n * Operators can accept a hash of named parameters. Parameter values can\n * either be direct (JavaScript literals, arrays, objects) or indirect\n * (other operators whose values will be pulled dynamically). Operators\n * included as parameters will have this operator added as a dependency.\n * @constructor\n * @param {*} [init] - The initial value for this operator.\n * @param {function(object, Pulse)} [update] - An update function. Upon\n * evaluation of this operator, the update function will be invoked and the\n * return value will be used as the new value of this operator.\n * @param {object} [params] - The parameters for this operator.\n * @param {boolean} [react=true] - Flag indicating if this operator should\n * listen for changes to upstream operators included as parameters.\n * @see parameters\n */\nfunction Operator(init, update, params, react) {\n this.id = ++OP_ID;\n this.value = init;\n this.stamp = -1;\n this.rank = -1;\n this.qrank = -1;\n this.flags = 0;\n if (update) {\n this._update = update;\n }\n if (params) this.parameters(params, react);\n}\nfunction flag(bit) {\n return function (state) {\n const f = this.flags;\n if (arguments.length === 0) return !!(f & bit);\n this.flags = state ? f | bit : f & ~bit;\n return this;\n };\n}\nOperator.prototype = {\n /**\n * Returns a list of target operators dependent on this operator.\n * If this list does not exist, it is created and then returned.\n * @return {UniqueList}\n */\n targets() {\n return this._targets || (this._targets = UniqueList(id));\n },\n /**\n * Sets the value of this operator.\n * @param {*} value - the value to set.\n * @return {Number} Returns 1 if the operator value has changed\n * according to strict equality, returns 0 otherwise.\n */\n set(value) {\n if (this.value !== value) {\n this.value = value;\n return 1;\n } else {\n return 0;\n }\n },\n /**\n * Indicates that operator evaluation should be skipped on the next pulse.\n * This operator will still propagate incoming pulses, but its update function\n * will not be invoked. The skip flag is reset after every pulse, so calling\n * this method will affect processing of the next pulse only.\n */\n skip: flag(SKIP$1),\n /**\n * Indicates that this operator's value has been modified on its most recent\n * pulse. Normally modification is checked via strict equality; however, in\n * some cases it is more efficient to update the internal state of an object.\n * In those cases, the modified flag can be used to trigger propagation. Once\n * set, the modification flag persists across pulses until unset. The flag can\n * be used with the last timestamp to test if a modification is recent.\n */\n modified: flag(MODIFIED),\n /**\n * Sets the parameters for this operator. The parameter values are analyzed for\n * operator instances. If found, this operator will be added as a dependency\n * of the parameterizing operator. Operator values are dynamically marshalled\n * from each operator parameter prior to evaluation. If a parameter value is\n * an array, the array will also be searched for Operator instances. However,\n * the search does not recurse into sub-arrays or object properties.\n * @param {object} params - A hash of operator parameters.\n * @param {boolean} [react=true] - A flag indicating if this operator should\n * automatically update (react) when parameter values change. In other words,\n * this flag determines if the operator registers itself as a listener on\n * any upstream operators included in the parameters.\n * @param {boolean} [initonly=false] - A flag indicating if this operator\n * should calculate an update only upon its initial evaluation, then\n * deregister dependencies and suppress all future update invocations.\n * @return {Operator[]} - An array of upstream dependencies.\n */\n parameters(params, react, initonly) {\n react = react !== false;\n const argval = this._argval = this._argval || new Parameters(),\n argops = this._argops = this._argops || [],\n deps = [];\n let name, value, n, i;\n const add = (name, index, value) => {\n if (value instanceof Operator) {\n if (value !== this) {\n if (react) value.targets().add(this);\n deps.push(value);\n }\n argops.push({\n op: value,\n name: name,\n index: index\n });\n } else {\n argval.set(name, index, value);\n }\n };\n for (name in params) {\n value = params[name];\n if (name === PULSE) {\n array(value).forEach(op => {\n if (!(op instanceof Operator)) {\n error('Pulse parameters must be operator instances.');\n } else if (op !== this) {\n op.targets().add(this);\n deps.push(op);\n }\n });\n this.source = value;\n } else if (isArray(value)) {\n argval.set(name, -1, Array(n = value.length));\n for (i = 0; i < n; ++i) add(name, i, value[i]);\n } else {\n add(name, -1, value);\n }\n }\n this.marshall().clear(); // initialize values\n if (initonly) argops.initonly = true;\n return deps;\n },\n /**\n * Internal method for marshalling parameter values.\n * Visits each operator dependency to pull the latest value.\n * @return {Parameters} A Parameters object to pass to the update function.\n */\n marshall(stamp) {\n const argval = this._argval || NO_PARAMS,\n argops = this._argops;\n let item, i, op, mod;\n if (argops) {\n const n = argops.length;\n for (i = 0; i < n; ++i) {\n item = argops[i];\n op = item.op;\n mod = op.modified() && op.stamp === stamp;\n argval.set(item.name, item.index, op.value, mod);\n }\n if (argops.initonly) {\n for (i = 0; i < n; ++i) {\n item = argops[i];\n item.op.targets().remove(this);\n }\n this._argops = null;\n this._update = null;\n }\n }\n return argval;\n },\n /**\n * Detach this operator from the dataflow.\n * Unregisters listeners on upstream dependencies.\n */\n detach() {\n const argops = this._argops;\n let i, n, item, op;\n if (argops) {\n for (i = 0, n = argops.length; i < n; ++i) {\n item = argops[i];\n op = item.op;\n if (op._targets) {\n op._targets.remove(this);\n }\n }\n }\n\n // remove references to the source and pulse object,\n // if present, to prevent memory leaks of old data.\n this.pulse = null;\n this.source = null;\n },\n /**\n * Delegate method to perform operator processing.\n * Subclasses can override this method to perform custom processing.\n * By default, it marshalls parameters and calls the update function\n * if that function is defined. If the update function does not\n * change the operator value then StopPropagation is returned.\n * If no update function is defined, this method does nothing.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return The output pulse or StopPropagation. A falsy return value\n * (including undefined) will let the input pulse pass through.\n */\n evaluate(pulse) {\n const update = this._update;\n if (update) {\n const params = this.marshall(pulse.stamp),\n v = update.call(this, params, pulse);\n params.clear();\n if (v !== this.value) {\n this.value = v;\n } else if (!this.modified()) {\n return pulse.StopPropagation;\n }\n }\n },\n /**\n * Run this operator for the current pulse. If this operator has already\n * been run at (or after) the pulse timestamp, returns StopPropagation.\n * Internally, this method calls {@link evaluate} to perform processing.\n * If {@link evaluate} returns a falsy value, the input pulse is returned.\n * This method should NOT be overridden, instead overrride {@link evaluate}.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return the output pulse for this operator (or StopPropagation)\n */\n run(pulse) {\n if (pulse.stamp < this.stamp) return pulse.StopPropagation;\n let rv;\n if (this.skip()) {\n this.skip(false);\n rv = 0;\n } else {\n rv = this.evaluate(pulse);\n }\n return this.pulse = rv || pulse;\n }\n};\n\n/**\n * Add an operator to the dataflow graph. This function accepts a\n * variety of input argument types. The basic signature supports an\n * initial value, update function and parameters. If the first parameter\n * is an Operator instance, it will be added directly. If it is a\n * constructor for an Operator subclass, a new instance will be instantiated.\n * Otherwise, if the first parameter is a function instance, it will be used\n * as the update function and a null initial value is assumed.\n * @param {*} init - One of: the operator to add, the initial value of\n * the operator, an operator class to instantiate, or an update function.\n * @param {function} [update] - The operator update function.\n * @param {object} [params] - The operator parameters.\n * @param {boolean} [react=true] - Flag indicating if this operator should\n * listen for changes to upstream operators included as parameters.\n * @return {Operator} - The added operator.\n */\nfunction add (init, update, params, react) {\n let shift = 1,\n op;\n if (init instanceof Operator) {\n op = init;\n } else if (init && init.prototype instanceof Operator) {\n op = new init();\n } else if (isFunction(init)) {\n op = new Operator(null, init);\n } else {\n shift = 0;\n op = new Operator(init, update);\n }\n this.rank(op);\n if (shift) {\n react = params;\n params = update;\n }\n if (params) this.connect(op, op.parameters(params, react));\n this.touch(op);\n return op;\n}\n\n/**\n * Connect a target operator as a dependent of source operators.\n * If necessary, this method will rerank the target operator and its\n * dependents to ensure propagation proceeds in a topologically sorted order.\n * @param {Operator} target - The target operator.\n * @param {Array} - The source operators that should propagate\n * to the target operator.\n */\nfunction connect (target, sources) {\n const targetRank = target.rank,\n n = sources.length;\n for (let i = 0; i < n; ++i) {\n if (targetRank < sources[i].rank) {\n this.rerank(target);\n return;\n }\n }\n}\n\nlet STREAM_ID = 0;\n\n/**\n * Models an event stream.\n * @constructor\n * @param {function(Object, number): boolean} [filter] - Filter predicate.\n * Events pass through when truthy, events are suppressed when falsy.\n * @param {function(Object): *} [apply] - Applied to input events to produce\n * new event values.\n * @param {function(Object)} [receive] - Event callback function to invoke\n * upon receipt of a new event. Use to override standard event processing.\n */\nfunction EventStream(filter, apply, receive) {\n this.id = ++STREAM_ID;\n this.value = null;\n if (receive) this.receive = receive;\n if (filter) this._filter = filter;\n if (apply) this._apply = apply;\n}\n\n/**\n * Creates a new event stream instance with the provided\n * (optional) filter, apply and receive functions.\n * @param {function(Object, number): boolean} [filter] - Filter predicate.\n * Events pass through when truthy, events are suppressed when falsy.\n * @param {function(Object): *} [apply] - Applied to input events to produce\n * new event values.\n * @see EventStream\n */\nfunction stream(filter, apply, receive) {\n return new EventStream(filter, apply, receive);\n}\nEventStream.prototype = {\n _filter: truthy,\n _apply: identity,\n targets() {\n return this._targets || (this._targets = UniqueList(id));\n },\n consume(_) {\n if (!arguments.length) return !!this._consume;\n this._consume = !!_;\n return this;\n },\n receive(evt) {\n if (this._filter(evt)) {\n const val = this.value = this._apply(evt),\n trg = this._targets,\n n = trg ? trg.length : 0;\n for (let i = 0; i < n; ++i) trg[i].receive(val);\n if (this._consume) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n }\n },\n filter(filter) {\n const s = stream(filter);\n this.targets().add(s);\n return s;\n },\n apply(apply) {\n const s = stream(null, apply);\n this.targets().add(s);\n return s;\n },\n merge() {\n const s = stream();\n this.targets().add(s);\n for (let i = 0, n = arguments.length; i < n; ++i) {\n arguments[i].targets().add(s);\n }\n return s;\n },\n throttle(pause) {\n let t = -1;\n return this.filter(() => {\n const now = Date.now();\n if (now - t > pause) {\n t = now;\n return 1;\n } else {\n return 0;\n }\n });\n },\n debounce(delay) {\n const s = stream();\n this.targets().add(stream(null, null, debounce(delay, e => {\n const df = e.dataflow;\n s.receive(e);\n if (df && df.run) df.run();\n })));\n return s;\n },\n between(a, b) {\n let active = false;\n a.targets().add(stream(null, null, () => active = true));\n b.targets().add(stream(null, null, () => active = false));\n return this.filter(() => active);\n },\n detach() {\n // ensures compatibility with operators (#2753)\n // remove references to other streams and filter functions that may\n // be bound to subcontexts that need to be garbage collected.\n this._filter = truthy;\n this._targets = null;\n }\n};\n\n/**\n * Create a new event stream from an event source.\n * @param {object} source - The event source to monitor. The input must\n * support the addEventListener method.\n * @param {string} type - The event type.\n * @param {function(object): boolean} [filter] - Event filter function.\n * @param {function(object): *} [apply] - Event application function.\n * If provided, this function will be invoked and the result will be\n * used as the downstream event value.\n * @return {EventStream}\n */\nfunction events (source, type, filter, apply) {\n const df = this,\n s = stream(filter, apply),\n send = function (e) {\n e.dataflow = df;\n try {\n s.receive(e);\n } catch (error) {\n df.error(error);\n } finally {\n df.run();\n }\n };\n let sources;\n if (typeof source === 'string' && typeof document !== 'undefined') {\n sources = document.querySelectorAll(source);\n } else {\n sources = array(source);\n }\n const n = sources.length;\n for (let i = 0; i < n; ++i) {\n sources[i].addEventListener(type, send);\n }\n return s;\n}\n\nfunction parse(data, format) {\n const locale = this.locale();\n return read(data, format, locale.timeParse, locale.utcParse);\n}\n\n/**\n * Ingests new data into the dataflow. First parses the data using the\n * vega-loader read method, then pulses a changeset to the target operator.\n * @param {Operator} target - The Operator to target with ingested data,\n * typically a Collect transform instance.\n * @param {*} data - The input data, prior to parsing. For JSON this may\n * be a string or an object. For CSV, TSV, etc should be a string.\n * @param {object} format - The data format description for parsing\n * loaded data. This object is passed to the vega-loader read method.\n * @returns {Dataflow}\n */\nfunction ingest(target, data, format) {\n data = this.parse(data, format);\n return this.pulse(target, this.changeset().insert(data));\n}\n\n/**\n * Request data from an external source, parse it, and return a Promise.\n * @param {string} url - The URL from which to load the data. This string\n * is passed to the vega-loader load method.\n * @param {object} [format] - The data format description for parsing\n * loaded data. This object is passed to the vega-loader read method.\n * @return {Promise} A Promise that resolves upon completion of the request.\n * The resolved object contains the following properties:\n * - data: an array of parsed data (or null upon error)\n * - status: a code for success (0), load fail (-1), or parse fail (-2)\n */\nasync function request(url, format) {\n const df = this;\n let status = 0,\n data;\n try {\n data = await df.loader().load(url, {\n context: 'dataflow',\n response: responseType(format && format.type)\n });\n try {\n data = df.parse(data, format);\n } catch (err) {\n status = -2;\n df.warn('Data ingestion failed', url, err);\n }\n } catch (err) {\n status = -1;\n df.warn('Loading failed', url, err);\n }\n return {\n data,\n status\n };\n}\nasync function preload(target, url, format) {\n const df = this,\n pending = df._pending || loadPending(df);\n pending.requests += 1;\n const res = await df.request(url, format);\n df.pulse(target, df.changeset().remove(truthy).insert(res.data || []));\n pending.done();\n return res;\n}\nfunction loadPending(df) {\n let accept;\n const pending = new Promise(a => accept = a);\n pending.requests = 0;\n pending.done = () => {\n if (--pending.requests === 0) {\n df._pending = null;\n accept(df);\n }\n };\n return df._pending = pending;\n}\n\nconst SKIP = {\n skip: true\n};\n\n/**\n * Perform operator updates in response to events. Applies an\n * update function to compute a new operator value. If the update function\n * returns a {@link ChangeSet}, the operator will be pulsed with those tuple\n * changes. Otherwise, the operator value will be updated to the return value.\n * @param {EventStream|Operator} source - The event source to react to.\n * This argument can be either an EventStream or an Operator.\n * @param {Operator|function(object):Operator} target - The operator to update.\n * This argument can either be an Operator instance or (if the source\n * argument is an EventStream), a function that accepts an event object as\n * input and returns an Operator to target.\n * @param {function(Parameters,Event): *} [update] - Optional update function\n * to compute the new operator value, or a literal value to set. Update\n * functions expect to receive a parameter object and event as arguments.\n * This function can either return a new operator value or (if the source\n * argument is an EventStream) a {@link ChangeSet} instance to pulse\n * the target operator with tuple changes.\n * @param {object} [params] - The update function parameters.\n * @param {object} [options] - Additional options hash. If not overridden,\n * updated operators will be skipped by default.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @param {boolean} [options.force] - If true, the operator will\n * be re-evaluated even if its value has not changed.\n * @return {Dataflow}\n */\nfunction on (source, target, update, params, options) {\n const fn = source instanceof Operator ? onOperator : onStream;\n fn(this, source, target, update, params, options);\n return this;\n}\nfunction onStream(df, stream, target, update, params, options) {\n const opt = extend({}, options, SKIP);\n let func, op;\n if (!isFunction(target)) target = constant(target);\n if (update === undefined) {\n func = e => df.touch(target(e));\n } else if (isFunction(update)) {\n op = new Operator(null, update, params, false);\n func = e => {\n op.evaluate(e);\n const t = target(e),\n v = op.value;\n isChangeSet(v) ? df.pulse(t, v, options) : df.update(t, v, opt);\n };\n } else {\n func = e => df.update(target(e), update, opt);\n }\n stream.apply(func);\n}\nfunction onOperator(df, source, target, update, params, options) {\n if (update === undefined) {\n source.targets().add(target);\n } else {\n const opt = options || {},\n op = new Operator(null, updater(target, update), params, false);\n op.modified(opt.force);\n op.rank = source.rank; // immediately follow source\n source.targets().add(op); // add dependency\n\n if (target) {\n op.skip(true); // skip first invocation\n op.value = target.value; // initialize value\n op.targets().add(target); // chain dependencies\n df.connect(target, [op]); // rerank as needed, #1672\n }\n }\n}\nfunction updater(target, update) {\n update = isFunction(update) ? update : constant(update);\n return target ? function (_, pulse) {\n const value = update(_, pulse);\n if (!target.skip()) {\n target.skip(value !== this.value).value = value;\n }\n return value;\n } : update;\n}\n\n/**\n * Assigns a rank to an operator. Ranks are assigned in increasing order\n * by incrementing an internal rank counter.\n * @param {Operator} op - The operator to assign a rank.\n */\nfunction rank(op) {\n op.rank = ++this._rank;\n}\n\n/**\n * Re-ranks an operator and all downstream target dependencies. This\n * is necessary when upstream dependencies of higher rank are added to\n * a target operator.\n * @param {Operator} op - The operator to re-rank.\n */\nfunction rerank(op) {\n const queue = [op];\n let cur, list, i;\n while (queue.length) {\n this.rank(cur = queue.pop());\n if (list = cur._targets) {\n for (i = list.length; --i >= 0;) {\n queue.push(cur = list[i]);\n if (cur === op) error('Cycle detected in dataflow graph.');\n }\n }\n }\n}\n\n/**\n * Sentinel value indicating pulse propagation should stop.\n */\nconst StopPropagation = {};\n\n// Pulse visit type flags\nconst ADD = 1 << 0,\n REM = 1 << 1,\n MOD = 1 << 2,\n ADD_REM = ADD | REM,\n ADD_MOD = ADD | MOD,\n ALL = ADD | REM | MOD,\n REFLOW = 1 << 3,\n SOURCE = 1 << 4,\n NO_SOURCE = 1 << 5,\n NO_FIELDS = 1 << 6;\n\n/**\n * A Pulse enables inter-operator communication during a run of the\n * dataflow graph. In addition to the current timestamp, a pulse may also\n * contain a change-set of added, removed or modified data tuples, as well as\n * a pointer to a full backing data source. Tuple change sets may not\n * be fully materialized; for example, to prevent needless array creation\n * a change set may include larger arrays and corresponding filter functions.\n * The pulse provides a {@link visit} method to enable proper and efficient\n * iteration over requested data tuples.\n *\n * In addition, each pulse can track modification flags for data tuple fields.\n * Responsible transform operators should call the {@link modifies} method to\n * indicate changes to data fields. The {@link modified} method enables\n * querying of this modification state.\n *\n * @constructor\n * @param {Dataflow} dataflow - The backing dataflow instance.\n * @param {number} stamp - The current propagation timestamp.\n * @param {string} [encode] - An optional encoding set name, which is then\n * accessible as Pulse.encode. Operators can respond to (or ignore) this\n * setting as appropriate. This parameter can be used in conjunction with\n * the Encode transform in the vega-encode module.\n */\nfunction Pulse(dataflow, stamp, encode) {\n this.dataflow = dataflow;\n this.stamp = stamp == null ? -1 : stamp;\n this.add = [];\n this.rem = [];\n this.mod = [];\n this.fields = null;\n this.encode = encode || null;\n}\nfunction materialize(data, filter) {\n const out = [];\n visitArray(data, filter, _ => out.push(_));\n return out;\n}\nfunction filter(pulse, flags) {\n const map = {};\n pulse.visit(flags, t => {\n map[tupleid(t)] = 1;\n });\n return t => map[tupleid(t)] ? null : t;\n}\nfunction addFilter(a, b) {\n return a ? (t, i) => a(t, i) && b(t, i) : b;\n}\nPulse.prototype = {\n /**\n * Sentinel value indicating pulse propagation should stop.\n */\n StopPropagation,\n /**\n * Boolean flag indicating ADD (added) tuples.\n */\n ADD,\n /**\n * Boolean flag indicating REM (removed) tuples.\n */\n REM,\n /**\n * Boolean flag indicating MOD (modified) tuples.\n */\n MOD,\n /**\n * Boolean flag indicating ADD (added) and REM (removed) tuples.\n */\n ADD_REM,\n /**\n * Boolean flag indicating ADD (added) and MOD (modified) tuples.\n */\n ADD_MOD,\n /**\n * Boolean flag indicating ADD, REM and MOD tuples.\n */\n ALL,\n /**\n * Boolean flag indicating all tuples in a data source\n * except for the ADD, REM and MOD tuples.\n */\n REFLOW,\n /**\n * Boolean flag indicating a 'pass-through' to a\n * backing data source, ignoring ADD, REM and MOD tuples.\n */\n SOURCE,\n /**\n * Boolean flag indicating that source data should be\n * suppressed when creating a forked pulse.\n */\n NO_SOURCE,\n /**\n * Boolean flag indicating that field modifications should be\n * suppressed when creating a forked pulse.\n */\n NO_FIELDS,\n /**\n * Creates a new pulse based on the values of this pulse.\n * The dataflow, time stamp and field modification values are copied over.\n * By default, new empty ADD, REM and MOD arrays are created.\n * @param {number} flags - Integer of boolean flags indicating which (if any)\n * tuple arrays should be copied to the new pulse. The supported flag values\n * are ADD, REM and MOD. Array references are copied directly: new array\n * instances are not created.\n * @return {Pulse} - The forked pulse instance.\n * @see init\n */\n fork(flags) {\n return new Pulse(this.dataflow).init(this, flags);\n },\n /**\n * Creates a copy of this pulse with new materialized array\n * instances for the ADD, REM, MOD, and SOURCE arrays.\n * The dataflow, time stamp and field modification values are copied over.\n * @return {Pulse} - The cloned pulse instance.\n * @see init\n */\n clone() {\n const p = this.fork(ALL);\n p.add = p.add.slice();\n p.rem = p.rem.slice();\n p.mod = p.mod.slice();\n if (p.source) p.source = p.source.slice();\n return p.materialize(ALL | SOURCE);\n },\n /**\n * Returns a pulse that adds all tuples from a backing source. This is\n * useful for cases where operators are added to a dataflow after an\n * upstream data pipeline has already been processed, ensuring that\n * new operators can observe all tuples within a stream.\n * @return {Pulse} - A pulse instance with all source tuples included\n * in the add array. If the current pulse already has all source\n * tuples in its add array, it is returned directly. If the current\n * pulse does not have a backing source, it is returned directly.\n */\n addAll() {\n let p = this;\n const reuse = !p.source || p.add === p.rem // special case for indexed set (e.g., crossfilter)\n || !p.rem.length && p.source.length === p.add.length;\n if (reuse) {\n return p;\n } else {\n p = new Pulse(this.dataflow).init(this);\n p.add = p.source;\n p.rem = []; // new operators can ignore rem #2769\n return p;\n }\n },\n /**\n * Initialize this pulse based on the values of another pulse. This method\n * is used internally by {@link fork} to initialize a new forked tuple.\n * The dataflow, time stamp and field modification values are copied over.\n * By default, new empty ADD, REM and MOD arrays are created.\n * @param {Pulse} src - The source pulse to copy from.\n * @param {number} flags - Integer of boolean flags indicating which (if any)\n * tuple arrays should be copied to the new pulse. The supported flag values\n * are ADD, REM and MOD. Array references are copied directly: new array\n * instances are not created. By default, source data arrays are copied\n * to the new pulse. Use the NO_SOURCE flag to enforce a null source.\n * @return {Pulse} - Returns this Pulse instance.\n */\n init(src, flags) {\n const p = this;\n p.stamp = src.stamp;\n p.encode = src.encode;\n if (src.fields && !(flags & NO_FIELDS)) {\n p.fields = src.fields;\n }\n if (flags & ADD) {\n p.addF = src.addF;\n p.add = src.add;\n } else {\n p.addF = null;\n p.add = [];\n }\n if (flags & REM) {\n p.remF = src.remF;\n p.rem = src.rem;\n } else {\n p.remF = null;\n p.rem = [];\n }\n if (flags & MOD) {\n p.modF = src.modF;\n p.mod = src.mod;\n } else {\n p.modF = null;\n p.mod = [];\n }\n if (flags & NO_SOURCE) {\n p.srcF = null;\n p.source = null;\n } else {\n p.srcF = src.srcF;\n p.source = src.source;\n if (src.cleans) p.cleans = src.cleans;\n }\n return p;\n },\n /**\n * Schedules a function to run after pulse propagation completes.\n * @param {function} func - The function to run.\n */\n runAfter(func) {\n this.dataflow.runAfter(func);\n },\n /**\n * Indicates if tuples have been added, removed or modified.\n * @param {number} [flags] - The tuple types (ADD, REM or MOD) to query.\n * Defaults to ALL, returning true if any tuple type has changed.\n * @return {boolean} - Returns true if one or more queried tuple types have\n * changed, false otherwise.\n */\n changed(flags) {\n const f = flags || ALL;\n return f & ADD && this.add.length || f & REM && this.rem.length || f & MOD && this.mod.length;\n },\n /**\n * Forces a \"reflow\" of tuple values, such that all tuples in the backing\n * source are added to the MOD set, unless already present in the ADD set.\n * @param {boolean} [fork=false] - If true, returns a forked copy of this\n * pulse, and invokes reflow on that derived pulse.\n * @return {Pulse} - The reflowed pulse instance.\n */\n reflow(fork) {\n if (fork) return this.fork(ALL).reflow();\n const len = this.add.length,\n src = this.source && this.source.length;\n if (src && src !== len) {\n this.mod = this.source;\n if (len) this.filter(MOD, filter(this, ADD));\n }\n return this;\n },\n /**\n * Get/set metadata to pulse requesting garbage collection\n * to reclaim currently unused resources.\n */\n clean(value) {\n if (arguments.length) {\n this.cleans = !!value;\n return this;\n } else {\n return this.cleans;\n }\n },\n /**\n * Marks one or more data field names as modified to assist dependency\n * tracking and incremental processing by transform operators.\n * @param {string|Array} _ - The field(s) to mark as modified.\n * @return {Pulse} - This pulse instance.\n */\n modifies(_) {\n const hash = this.fields || (this.fields = {});\n if (isArray(_)) {\n _.forEach(f => hash[f] = true);\n } else {\n hash[_] = true;\n }\n return this;\n },\n /**\n * Checks if one or more data fields have been modified during this pulse\n * propagation timestamp.\n * @param {string|Array} _ - The field(s) to check for modified.\n * @param {boolean} nomod - If true, will check the modified flag even if\n * no mod tuples exist. If false (default), mod tuples must be present.\n * @return {boolean} - Returns true if any of the provided fields has been\n * marked as modified, false otherwise.\n */\n modified(_, nomod) {\n const fields = this.fields;\n return !((nomod || this.mod.length) && fields) ? false : !arguments.length ? !!fields : isArray(_) ? _.some(f => fields[f]) : fields[_];\n },\n /**\n * Adds a filter function to one more tuple sets. Filters are applied to\n * backing tuple arrays, to determine the actual set of tuples considered\n * added, removed or modified. They can be used to delay materialization of\n * a tuple set in order to avoid expensive array copies. In addition, the\n * filter functions can serve as value transformers: unlike standard predicate\n * function (which return boolean values), Pulse filters should return the\n * actual tuple value to process. If a tuple set is already filtered, the\n * new filter function will be appended into a conjuntive ('and') query.\n * @param {number} flags - Flags indicating the tuple set(s) to filter.\n * @param {function(*):object} filter - Filter function that will be applied\n * to the tuple set array, and should return a data tuple if the value\n * should be included in the tuple set, and falsy (or null) otherwise.\n * @return {Pulse} - Returns this pulse instance.\n */\n filter(flags, filter) {\n const p = this;\n if (flags & ADD) p.addF = addFilter(p.addF, filter);\n if (flags & REM) p.remF = addFilter(p.remF, filter);\n if (flags & MOD) p.modF = addFilter(p.modF, filter);\n if (flags & SOURCE) p.srcF = addFilter(p.srcF, filter);\n return p;\n },\n /**\n * Materialize one or more tuple sets in this pulse. If the tuple set(s) have\n * a registered filter function, it will be applied and the tuple set(s) will\n * be replaced with materialized tuple arrays.\n * @param {number} flags - Flags indicating the tuple set(s) to materialize.\n * @return {Pulse} - Returns this pulse instance.\n */\n materialize(flags) {\n flags = flags || ALL;\n const p = this;\n if (flags & ADD && p.addF) {\n p.add = materialize(p.add, p.addF);\n p.addF = null;\n }\n if (flags & REM && p.remF) {\n p.rem = materialize(p.rem, p.remF);\n p.remF = null;\n }\n if (flags & MOD && p.modF) {\n p.mod = materialize(p.mod, p.modF);\n p.modF = null;\n }\n if (flags & SOURCE && p.srcF) {\n p.source = p.source.filter(p.srcF);\n p.srcF = null;\n }\n return p;\n },\n /**\n * Visit one or more tuple sets in this pulse.\n * @param {number} flags - Flags indicating the tuple set(s) to visit.\n * Legal values are ADD, REM, MOD and SOURCE (if a backing data source\n * has been set).\n * @param {function(object):*} - Visitor function invoked per-tuple.\n * @return {Pulse} - Returns this pulse instance.\n */\n visit(flags, visitor) {\n const p = this,\n v = visitor;\n if (flags & SOURCE) {\n visitArray(p.source, p.srcF, v);\n return p;\n }\n if (flags & ADD) visitArray(p.add, p.addF, v);\n if (flags & REM) visitArray(p.rem, p.remF, v);\n if (flags & MOD) visitArray(p.mod, p.modF, v);\n const src = p.source;\n if (flags & REFLOW && src) {\n const sum = p.add.length + p.mod.length;\n if (sum === src.length) ; else if (sum) {\n visitArray(src, filter(p, ADD_MOD), v);\n } else {\n // if no add/rem/mod tuples, visit source\n visitArray(src, p.srcF, v);\n }\n }\n return p;\n }\n};\n\n/**\n * Represents a set of multiple pulses. Used as input for operators\n * that accept multiple pulses at a time. Contained pulses are\n * accessible via the public \"pulses\" array property. This pulse doe\n * not carry added, removed or modified tuples directly. However,\n * the visit method can be used to traverse all such tuples contained\n * in sub-pulses with a timestamp matching this parent multi-pulse.\n * @constructor\n * @param {Dataflow} dataflow - The backing dataflow instance.\n * @param {number} stamp - The timestamp.\n * @param {Array} pulses - The sub-pulses for this multi-pulse.\n */\nfunction MultiPulse(dataflow, stamp, pulses, encode) {\n const p = this;\n let c = 0;\n this.dataflow = dataflow;\n this.stamp = stamp;\n this.fields = null;\n this.encode = encode || null;\n this.pulses = pulses;\n for (const pulse of pulses) {\n if (pulse.stamp !== stamp) continue;\n if (pulse.fields) {\n const hash = p.fields || (p.fields = {});\n for (const f in pulse.fields) {\n hash[f] = 1;\n }\n }\n if (pulse.changed(p.ADD)) c |= p.ADD;\n if (pulse.changed(p.REM)) c |= p.REM;\n if (pulse.changed(p.MOD)) c |= p.MOD;\n }\n this.changes = c;\n}\ninherits(MultiPulse, Pulse, {\n /**\n * Creates a new pulse based on the values of this pulse.\n * The dataflow, time stamp and field modification values are copied over.\n * @return {Pulse}\n */\n fork(flags) {\n const p = new Pulse(this.dataflow).init(this, flags & this.NO_FIELDS);\n if (flags !== undefined) {\n if (flags & p.ADD) this.visit(p.ADD, t => p.add.push(t));\n if (flags & p.REM) this.visit(p.REM, t => p.rem.push(t));\n if (flags & p.MOD) this.visit(p.MOD, t => p.mod.push(t));\n }\n return p;\n },\n changed(flags) {\n return this.changes & flags;\n },\n modified(_) {\n const p = this,\n fields = p.fields;\n return !(fields && p.changes & p.MOD) ? 0 : isArray(_) ? _.some(f => fields[f]) : fields[_];\n },\n filter() {\n error('MultiPulse does not support filtering.');\n },\n materialize() {\n error('MultiPulse does not support materialization.');\n },\n visit(flags, visitor) {\n const p = this,\n pulses = p.pulses,\n n = pulses.length;\n let i = 0;\n if (flags & p.SOURCE) {\n for (; i < n; ++i) {\n pulses[i].visit(flags, visitor);\n }\n } else {\n for (; i < n; ++i) {\n if (pulses[i].stamp === p.stamp) {\n pulses[i].visit(flags, visitor);\n }\n }\n }\n return p;\n }\n});\n\n/* eslint-disable require-atomic-updates */\n\n/**\n * Evaluates the dataflow and returns a Promise that resolves when pulse\n * propagation completes. This method will increment the current timestamp\n * and process all updated, pulsed and touched operators. When invoked for\n * the first time, all registered operators will be processed. This method\n * should not be invoked by third-party clients, use {@link runAsync} or\n * {@link run} instead.\n * @param {string} [encode] - The name of an encoding set to invoke during\n * propagation. This value is added to generated Pulse instances;\n * operators can then respond to (or ignore) this setting as appropriate.\n * This parameter can be used in conjunction with the Encode transform in\n * the vega-encode package.\n * @param {function} [prerun] - An optional callback function to invoke\n * immediately before dataflow evaluation commences.\n * @param {function} [postrun] - An optional callback function to invoke\n * after dataflow evaluation completes. The callback will be invoked\n * after those registered via {@link runAfter}.\n * @return {Promise} - A promise that resolves to this dataflow after\n * evaluation completes.\n */\nasync function evaluate(encode, prerun, postrun) {\n const df = this,\n async = [];\n\n // if the pulse value is set, this is a re-entrant call\n if (df._pulse) return reentrant(df);\n\n // wait for pending datasets to load\n if (df._pending) await df._pending;\n\n // invoke prerun function, if provided\n if (prerun) await asyncCallback(df, prerun);\n\n // exit early if there are no updates\n if (!df._touched.length) {\n df.debug('Dataflow invoked, but nothing to do.');\n return df;\n }\n\n // increment timestamp clock\n const stamp = ++df._clock;\n\n // set the current pulse\n df._pulse = new Pulse(df, stamp, encode);\n\n // initialize priority queue, reset touched operators\n df._touched.forEach(op => df._enqueue(op, true));\n df._touched = UniqueList(id);\n let count = 0,\n op,\n next,\n error;\n try {\n while (df._heap.size() > 0) {\n // dequeue operator with highest priority\n op = df._heap.pop();\n\n // re-queue if rank changed\n if (op.rank !== op.qrank) {\n df._enqueue(op, true);\n continue;\n }\n\n // otherwise, evaluate the operator\n next = op.run(df._getPulse(op, encode));\n if (next.then) {\n // await if operator returns a promise directly\n next = await next;\n } else if (next.async) {\n // queue parallel asynchronous execution\n async.push(next.async);\n next = StopPropagation;\n }\n\n // propagate evaluation, enqueue dependent operators\n if (next !== StopPropagation) {\n if (op._targets) op._targets.forEach(op => df._enqueue(op));\n }\n\n // increment visit counter\n ++count;\n }\n } catch (err) {\n df._heap.clear();\n error = err;\n }\n\n // reset pulse map\n df._input = {};\n df._pulse = null;\n df.debug(`Pulse ${stamp}: ${count} operators`);\n if (error) {\n df._postrun = [];\n df.error(error);\n }\n\n // invoke callbacks queued via runAfter\n if (df._postrun.length) {\n const pr = df._postrun.sort((a, b) => b.priority - a.priority);\n df._postrun = [];\n for (let i = 0; i < pr.length; ++i) {\n await asyncCallback(df, pr[i].callback);\n }\n }\n\n // invoke postrun function, if provided\n if (postrun) await asyncCallback(df, postrun);\n\n // handle non-blocking asynchronous callbacks\n if (async.length) {\n Promise.all(async).then(cb => df.runAsync(null, () => {\n cb.forEach(f => {\n try {\n f(df);\n } catch (err) {\n df.error(err);\n }\n });\n }));\n }\n return df;\n}\n\n/**\n * Queues dataflow evaluation to run once any other queued evaluations have\n * completed and returns a Promise that resolves when the queued pulse\n * propagation completes. If provided, a callback function will be invoked\n * immediately before evaluation commences. This method will ensure a\n * separate evaluation is invoked for each time it is called.\n * @param {string} [encode] - The name of an encoding set to invoke during\n * propagation. This value is added to generated Pulse instances;\n * operators can then respond to (or ignore) this setting as appropriate.\n * This parameter can be used in conjunction with the Encode transform in\n * the vega-encode package.\n * @param {function} [prerun] - An optional callback function to invoke\n * immediately before dataflow evaluation commences.\n * @param {function} [postrun] - An optional callback function to invoke\n * after dataflow evaluation completes. The callback will be invoked\n * after those registered via {@link runAfter}.\n * @return {Promise} - A promise that resolves to this dataflow after\n * evaluation completes.\n */\nasync function runAsync(encode, prerun, postrun) {\n // await previously queued functions\n while (this._running) await this._running;\n\n // run dataflow, manage running promise\n const clear = () => this._running = null;\n (this._running = this.evaluate(encode, prerun, postrun)).then(clear, clear);\n return this._running;\n}\n\n/**\n * Requests dataflow evaluation and the immediately returns this dataflow\n * instance. If there are pending data loading or other asynchronous\n * operations, the dataflow will evaluate asynchronously after this method\n * has been invoked. To track when dataflow evaluation completes, use the\n * {@link runAsync} method instead. This method will raise an error if\n * invoked while the dataflow is already in the midst of evaluation.\n * @param {string} [encode] - The name of an encoding set to invoke during\n * propagation. This value is added to generated Pulse instances;\n * operators can then respond to (or ignore) this setting as appropriate.\n * This parameter can be used in conjunction with the Encode transform in\n * the vega-encode module.\n * @param {function} [prerun] - An optional callback function to invoke\n * immediately before dataflow evaluation commences.\n * @param {function} [postrun] - An optional callback function to invoke\n * after dataflow evaluation completes. The callback will be invoked\n * after those registered via {@link runAfter}.\n * @return {Dataflow} - This dataflow instance.\n */\nfunction run(encode, prerun, postrun) {\n return this._pulse ? reentrant(this) : (this.evaluate(encode, prerun, postrun), this);\n}\n\n/**\n * Schedules a callback function to be invoked after the current pulse\n * propagation completes. If no propagation is currently occurring,\n * the function is invoked immediately. Callbacks scheduled via runAfter\n * are invoked immediately upon completion of the current cycle, before\n * any request queued via runAsync. This method is primarily intended for\n * internal use. Third-party callers using runAfter to schedule a callback\n * that invokes {@link run} or {@link runAsync} should not use this method,\n * but instead use {@link runAsync} with prerun or postrun arguments.\n * @param {function(Dataflow)} callback - The callback function to run.\n * The callback will be invoked with this Dataflow instance as its\n * sole argument.\n * @param {boolean} enqueue - A boolean flag indicating that the\n * callback should be queued up to run after the next propagation\n * cycle, suppressing immediate invocation when propagation is not\n * currently occurring.\n * @param {number} [priority] - A priority value used to sort registered\n * callbacks to determine execution order. This argument is intended\n * for internal Vega use only.\n */\nfunction runAfter(callback, enqueue, priority) {\n if (this._pulse || enqueue) {\n // pulse propagation is currently running, queue to run after\n this._postrun.push({\n priority: priority || 0,\n callback: callback\n });\n } else {\n // pulse propagation already complete, invoke immediately\n try {\n callback(this);\n } catch (err) {\n this.error(err);\n }\n }\n}\n\n/**\n * Raise an error for re-entrant dataflow evaluation.\n */\nfunction reentrant(df) {\n df.error('Dataflow already running. Use runAsync() to chain invocations.');\n return df;\n}\n\n/**\n * Enqueue an operator into the priority queue for evaluation. The operator\n * will be enqueued if it has no registered pulse for the current cycle, or if\n * the force argument is true. Upon enqueue, this method also sets the\n * operator's qrank to the current rank value.\n * @param {Operator} op - The operator to enqueue.\n * @param {boolean} [force] - A flag indicating if the operator should be\n * forceably added to the queue, even if it has already been previously\n * enqueued during the current pulse propagation. This is useful when the\n * dataflow graph is dynamically modified and the operator rank changes.\n */\nfunction enqueue(op, force) {\n const q = op.stamp < this._clock;\n if (q) op.stamp = this._clock;\n if (q || force) {\n op.qrank = op.rank;\n this._heap.push(op);\n }\n}\n\n/**\n * Provide a correct pulse for evaluating an operator. If the operator has an\n * explicit source operator, we will try to pull the pulse(s) from it.\n * If there is an array of source operators, we build a multi-pulse.\n * Otherwise, we return a current pulse with correct source data.\n * If the pulse is the pulse map has an explicit target set, we use that.\n * Else if the pulse on the upstream source operator is current, we use that.\n * Else we use the pulse from the pulse map, but copy the source tuple array.\n * @param {Operator} op - The operator for which to get an input pulse.\n * @param {string} [encode] - An (optional) encoding set name with which to\n * annotate the returned pulse. See {@link run} for more information.\n */\nfunction getPulse(op, encode) {\n const s = op.source,\n stamp = this._clock;\n return s && isArray(s) ? new MultiPulse(this, stamp, s.map(_ => _.pulse), encode) : this._input[op.id] || singlePulse(this._pulse, s && s.pulse);\n}\nfunction singlePulse(p, s) {\n if (s && s.stamp === p.stamp) {\n return s;\n }\n p = p.fork();\n if (s && s !== StopPropagation) {\n p.source = s.source;\n }\n return p;\n}\n\nconst NO_OPT = {\n skip: false,\n force: false\n};\n\n/**\n * Touches an operator, scheduling it to be evaluated. If invoked outside of\n * a pulse propagation, the operator will be evaluated the next time this\n * dataflow is run. If invoked in the midst of pulse propagation, the operator\n * will be queued for evaluation if and only if the operator has not yet been\n * evaluated on the current propagation timestamp.\n * @param {Operator} op - The operator to touch.\n * @param {object} [options] - Additional options hash.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @return {Dataflow}\n */\nfunction touch(op, options) {\n const opt = options || NO_OPT;\n if (this._pulse) {\n // if in midst of propagation, add to priority queue\n this._enqueue(op);\n } else {\n // otherwise, queue for next propagation\n this._touched.add(op);\n }\n if (opt.skip) op.skip(true);\n return this;\n}\n\n/**\n * Updates the value of the given operator.\n * @param {Operator} op - The operator to update.\n * @param {*} value - The value to set.\n * @param {object} [options] - Additional options hash.\n * @param {boolean} [options.force] - If true, the operator will\n * be re-evaluated even if its value has not changed.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @return {Dataflow}\n */\nfunction update(op, value, options) {\n const opt = options || NO_OPT;\n if (op.set(value) || opt.force) {\n this.touch(op, opt);\n }\n return this;\n}\n\n/**\n * Pulses an operator with a changeset of tuples. If invoked outside of\n * a pulse propagation, the pulse will be applied the next time this\n * dataflow is run. If invoked in the midst of pulse propagation, the pulse\n * will be added to the set of active pulses and will be applied if and\n * only if the target operator has not yet been evaluated on the current\n * propagation timestamp.\n * @param {Operator} op - The operator to pulse.\n * @param {ChangeSet} value - The tuple changeset to apply.\n * @param {object} [options] - Additional options hash.\n * @param {boolean} [options.skip] - If true, the operator will\n * be skipped: it will not be evaluated, but its dependents will be.\n * @return {Dataflow}\n */\nfunction pulse(op, changeset, options) {\n this.touch(op, options || NO_OPT);\n const p = new Pulse(this, this._clock + (this._pulse ? 0 : 1)),\n t = op.pulse && op.pulse.source || [];\n p.target = op;\n this._input[op.id] = changeset.pulse(p, t);\n return this;\n}\n\nfunction Heap(cmp) {\n let nodes = [];\n return {\n clear: () => nodes = [],\n size: () => nodes.length,\n peek: () => nodes[0],\n push: x => {\n nodes.push(x);\n return siftdown(nodes, 0, nodes.length - 1, cmp);\n },\n pop: () => {\n const last = nodes.pop();\n let item;\n if (nodes.length) {\n item = nodes[0];\n nodes[0] = last;\n siftup(nodes, 0, cmp);\n } else {\n item = last;\n }\n return item;\n }\n };\n}\nfunction siftdown(array, start, idx, cmp) {\n let parent, pidx;\n const item = array[idx];\n while (idx > start) {\n pidx = idx - 1 >> 1;\n parent = array[pidx];\n if (cmp(item, parent) < 0) {\n array[idx] = parent;\n idx = pidx;\n continue;\n }\n break;\n }\n return array[idx] = item;\n}\nfunction siftup(array, idx, cmp) {\n const start = idx,\n end = array.length,\n item = array[idx];\n let cidx = (idx << 1) + 1,\n ridx;\n while (cidx < end) {\n ridx = cidx + 1;\n if (ridx < end && cmp(array[cidx], array[ridx]) >= 0) {\n cidx = ridx;\n }\n array[idx] = array[cidx];\n idx = cidx;\n cidx = (idx << 1) + 1;\n }\n array[idx] = item;\n return siftdown(array, start, idx, cmp);\n}\n\n/**\n * A dataflow graph for reactive processing of data streams.\n * @constructor\n */\nfunction Dataflow() {\n this.logger(logger());\n this.logLevel(Error);\n this._clock = 0;\n this._rank = 0;\n this._locale = defaultLocale();\n try {\n this._loader = loader();\n } catch (e) {\n // do nothing if loader module is unavailable\n }\n this._touched = UniqueList(id);\n this._input = {};\n this._pulse = null;\n this._heap = Heap((a, b) => a.qrank - b.qrank);\n this._postrun = [];\n}\nfunction logMethod(method) {\n return function () {\n return this._log[method].apply(this, arguments);\n };\n}\nDataflow.prototype = {\n /**\n * The current timestamp of this dataflow. This value reflects the\n * timestamp of the previous dataflow run. The dataflow is initialized\n * with a stamp value of 0. The initial run of the dataflow will have\n * a timestap of 1, and so on. This value will match the\n * {@link Pulse.stamp} property.\n * @return {number} - The current timestamp value.\n */\n stamp() {\n return this._clock;\n },\n /**\n * Gets or sets the loader instance to use for data file loading. A\n * loader object must provide a \"load\" method for loading files and a\n * \"sanitize\" method for checking URL/filename validity. Both methods\n * should accept a URI and options hash as arguments, and return a Promise\n * that resolves to the loaded file contents (load) or a hash containing\n * sanitized URI data with the sanitized url assigned to the \"href\" property\n * (sanitize).\n * @param {object} _ - The loader instance to use.\n * @return {object|Dataflow} - If no arguments are provided, returns\n * the current loader instance. Otherwise returns this Dataflow instance.\n */\n loader(_) {\n if (arguments.length) {\n this._loader = _;\n return this;\n } else {\n return this._loader;\n }\n },\n /**\n * Gets or sets the locale instance to use for formatting and parsing\n * string values. The locale object should be provided by the\n * vega-format library, and include methods such as format, timeFormat,\n * utcFormat, timeParse, and utcParse.\n * @param {object} _ - The locale instance to use.\n * @return {object|Dataflow} - If no arguments are provided, returns\n * the current locale instance. Otherwise returns this Dataflow instance.\n */\n locale(_) {\n if (arguments.length) {\n this._locale = _;\n return this;\n } else {\n return this._locale;\n }\n },\n /**\n * Get or set the logger instance used to log messages. If no arguments are\n * provided, returns the current logger instance. Otherwise, sets the logger\n * and return this Dataflow instance. Provided loggers must support the full\n * API of logger objects generated by the vega-util logger method. Note that\n * by default the log level of the new logger will be used; use the logLevel\n * method to adjust the log level as needed.\n */\n logger(logger) {\n if (arguments.length) {\n this._log = logger;\n return this;\n } else {\n return this._log;\n }\n },\n /**\n * Logs an error message. By default, logged messages are written to console\n * output. The message will only be logged if the current log level is high\n * enough to permit error messages.\n */\n error: logMethod('error'),\n /**\n * Logs a warning message. By default, logged messages are written to console\n * output. The message will only be logged if the current log level is high\n * enough to permit warning messages.\n */\n warn: logMethod('warn'),\n /**\n * Logs a information message. By default, logged messages are written to\n * console output. The message will only be logged if the current log level is\n * high enough to permit information messages.\n */\n info: logMethod('info'),\n /**\n * Logs a debug message. By default, logged messages are written to console\n * output. The message will only be logged if the current log level is high\n * enough to permit debug messages.\n */\n debug: logMethod('debug'),\n /**\n * Get or set the current log level. If an argument is provided, it\n * will be used as the new log level.\n * @param {number} [level] - Should be one of None, Warn, Info\n * @return {number} - The current log level.\n */\n logLevel: logMethod('level'),\n /**\n * Empty entry threshold for garbage cleaning. Map data structures will\n * perform cleaning once the number of empty entries exceeds this value.\n */\n cleanThreshold: 1e4,\n // OPERATOR REGISTRATION\n add,\n connect,\n rank,\n rerank,\n // OPERATOR UPDATES\n pulse,\n touch,\n update,\n changeset,\n // DATA LOADING\n ingest,\n parse,\n preload,\n request,\n // EVENT HANDLING\n events,\n on,\n // PULSE PROPAGATION\n evaluate,\n run,\n runAsync,\n runAfter,\n _enqueue: enqueue,\n _getPulse: getPulse\n};\n\n/**\n * Abstract class for operators that process data tuples.\n * Subclasses must provide a {@link transform} method for operator processing.\n * @constructor\n * @param {*} [init] - The initial value for this operator.\n * @param {object} [params] - The parameters for this operator.\n * @param {Operator} [source] - The operator from which to receive pulses.\n */\nfunction Transform(init, params) {\n Operator.call(this, init, null, params);\n}\ninherits(Transform, Operator, {\n /**\n * Overrides {@link Operator.evaluate} for transform operators.\n * Internally, this method calls {@link evaluate} to perform processing.\n * If {@link evaluate} returns a falsy value, the input pulse is returned.\n * This method should NOT be overridden, instead overrride {@link evaluate}.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return the output pulse for this operator (or StopPropagation)\n */\n run(pulse) {\n if (pulse.stamp < this.stamp) return pulse.StopPropagation;\n let rv;\n if (this.skip()) {\n this.skip(false);\n } else {\n rv = this.evaluate(pulse);\n }\n rv = rv || pulse;\n if (rv.then) {\n rv = rv.then(_ => this.pulse = _);\n } else if (rv !== pulse.StopPropagation) {\n this.pulse = rv;\n }\n return rv;\n },\n /**\n * Overrides {@link Operator.evaluate} for transform operators.\n * Marshalls parameter values and then invokes {@link transform}.\n * @param {Pulse} pulse - the current dataflow pulse.\n * @return {Pulse} The output pulse (or StopPropagation). A falsy return\n value (including undefined) will let the input pulse pass through.\n */\n evaluate(pulse) {\n const params = this.marshall(pulse.stamp),\n out = this.transform(params, pulse);\n params.clear();\n return out;\n },\n /**\n * Process incoming pulses.\n * Subclasses should override this method to implement transforms.\n * @param {Parameters} _ - The operator parameter values.\n * @param {Pulse} pulse - The current dataflow pulse.\n * @return {Pulse} The output pulse (or StopPropagation). A falsy return\n * value (including undefined) will let the input pulse pass through.\n */\n transform() {}\n});\n\nconst transforms = {};\nfunction definition(type) {\n const t = transform(type);\n return t && t.Definition || null;\n}\nfunction transform(type) {\n type = type && type.toLowerCase();\n return hasOwnProperty(transforms, type) ? transforms[type] : null;\n}\n\nexport { Dataflow, EventStream, MultiPulse, Operator, Parameters, Pulse, Transform, UniqueList, asyncCallback, changeset, definition, derive, ingest$1 as ingest, isChangeSet, isTuple, rederive, replace, stableCompare, transform, transforms, tupleid };\n","export default function max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n","export default function min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n","import ascending from \"./ascending.js\";\nimport permute from \"./permute.js\";\n\nexport default function sort(values, ...F) {\n if (typeof values[Symbol.iterator] !== \"function\") throw new TypeError(\"values is not iterable\");\n values = Array.from(values);\n let [f] = F;\n if ((f && f.length !== 2) || F.length > 1) {\n const index = Uint32Array.from(values, (d, i) => i);\n if (F.length > 1) {\n F = F.map(f => values.map(f));\n index.sort((i, j) => {\n for (const f of F) {\n const c = ascendingDefined(f[i], f[j]);\n if (c) return c;\n }\n });\n } else {\n f = values.map(f);\n index.sort((i, j) => ascendingDefined(f[i], f[j]));\n }\n return permute(values, index);\n }\n return values.sort(compareDefined(f));\n}\n\nexport function compareDefined(compare = ascending) {\n if (compare === ascending) return ascendingDefined;\n if (typeof compare !== \"function\") throw new TypeError(\"compare is not a function\");\n return (a, b) => {\n const x = compare(a, b);\n if (x || x === 0) return x;\n return (compare(b, b) === 0) - (compare(a, a) === 0);\n };\n}\n\nexport function ascendingDefined(a, b) {\n return (a == null || !(a >= a)) - (b == null || !(b >= b)) || (a < b ? -1 : a > b ? 1 : 0);\n}\n","import {ascendingDefined, compareDefined} from \"./sort.js\";\n\n// Based on https://github.com/mourner/quickselect\n// ISC license, Copyright 2018 Vladimir Agafonkin.\nexport default function quickselect(array, k, left = 0, right = Infinity, compare) {\n k = Math.floor(k);\n left = Math.floor(Math.max(0, left));\n right = Math.floor(Math.min(array.length - 1, right));\n\n if (!(left <= k && k <= right)) return array;\n\n compare = compare === undefined ? ascendingDefined : compareDefined(compare);\n\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n const t = array[k];\n let i = left;\n let j = right;\n\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);\n else ++j, swap(array, j, right);\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n\n return array;\n}\n\nfunction swap(array, i, j) {\n const t = array[i];\n array[i] = array[j];\n array[j] = t;\n}\n","export default function number(x) {\n return x === null ? NaN : +x;\n}\n\nexport function* numbers(values, valueof) {\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n","import max from \"./max.js\";\nimport maxIndex from \"./maxIndex.js\";\nimport min from \"./min.js\";\nimport minIndex from \"./minIndex.js\";\nimport quickselect from \"./quickselect.js\";\nimport number, {numbers} from \"./number.js\";\nimport {ascendingDefined} from \"./sort.js\";\nimport greatest from \"./greatest.js\";\n\nexport default function quantile(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return min(values);\n if (p >= 1) return max(values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = max(quickselect(values, i0).subarray(0, i0 + 1)),\n value1 = min(values.subarray(i0 + 1));\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileSorted(values, p, valueof = number) {\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileIndex(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return minIndex(values);\n if (p >= 1) return maxIndex(values);\n var n,\n i = Math.floor((n - 1) * p),\n order = (i, j) => ascendingDefined(values[i], values[j]),\n index = quickselect(Uint32Array.from(values, (_, i) => i), i, 0, n - 1, order);\n return greatest(index.subarray(0, i + 1), i => values[i]);\n}\n","import quantile, {quantileIndex} from \"./quantile.js\";\n\nexport default function median(values, valueof) {\n return quantile(values, 0.5, valueof);\n}\n\nexport function medianIndex(values, valueof) {\n return quantileIndex(values, 0.5, valueof);\n}\n","import { ascending, quantileSorted, deviation, quantile, median } from 'd3-array';\n\nfunction* numbers (values, valueof) {\n if (valueof == null) {\n for (let value of values) {\n if (value != null && value !== '' && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n value = valueof(value, ++index, values);\n if (value != null && value !== '' && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n\nfunction quantiles (array, p, f) {\n const values = Float64Array.from(numbers(array, f));\n\n // don't depend on return value from typed array sort call\n // protects against undefined sort results in Safari (vega/vega-lite#4964)\n values.sort(ascending);\n return p.map(_ => quantileSorted(values, _));\n}\n\nfunction quartiles (array, f) {\n return quantiles(array, [0.25, 0.50, 0.75], f);\n}\n\n// Scott, D. W. (1992) Multivariate Density Estimation:\n// Theory, Practice, and Visualization. Wiley.\nfunction estimateBandwidth (array, f) {\n const n = array.length,\n d = deviation(array, f),\n q = quartiles(array, f),\n h = (q[2] - q[0]) / 1.34,\n v = Math.min(d, h) || d || Math.abs(q[0]) || 1;\n return 1.06 * v * Math.pow(n, -0.2);\n}\n\nfunction bin (_) {\n // determine range\n const maxb = _.maxbins || 20,\n base = _.base || 10,\n logb = Math.log(base),\n div = _.divide || [5, 2];\n let min = _.extent[0],\n max = _.extent[1],\n step,\n level,\n minstep,\n v,\n i,\n n;\n const span = _.span || max - min || Math.abs(min) || 1;\n if (_.step) {\n // if step size is explicitly given, use that\n step = _.step;\n } else if (_.steps) {\n // if provided, limit choice to acceptable step sizes\n v = span / maxb;\n for (i = 0, n = _.steps.length; i < n && _.steps[i] < v; ++i);\n step = _.steps[Math.max(0, i - 1)];\n } else {\n // else use span to determine step size\n level = Math.ceil(Math.log(maxb) / logb);\n minstep = _.minstep || 0;\n step = Math.max(minstep, Math.pow(base, Math.round(Math.log(span) / logb) - level));\n\n // increase step size if too many bins\n while (Math.ceil(span / step) > maxb) {\n step *= base;\n }\n\n // decrease step size if allowed\n for (i = 0, n = div.length; i < n; ++i) {\n v = step / div[i];\n if (v >= minstep && span / v <= maxb) step = v;\n }\n }\n\n // update precision, min and max\n v = Math.log(step);\n const precision = v >= 0 ? 0 : ~~(-v / logb) + 1,\n eps = Math.pow(base, -precision - 1);\n if (_.nice || _.nice === undefined) {\n v = Math.floor(min / step + eps) * step;\n min = min < v ? v - step : v;\n max = Math.ceil(max / step) * step;\n }\n return {\n start: min,\n stop: max === min ? min + step : max,\n step: step\n };\n}\n\nvar random = Math.random;\nfunction setRandom(r) {\n random = r;\n}\n\nfunction bootstrapCI (array, samples, alpha, f) {\n if (!array.length) return [undefined, undefined];\n const values = Float64Array.from(numbers(array, f)),\n n = values.length,\n m = samples;\n let a, i, j, mu;\n for (j = 0, mu = Array(m); j < m; ++j) {\n for (a = 0, i = 0; i < n; ++i) {\n a += values[~~(random() * n)];\n }\n mu[j] = a / n;\n }\n mu.sort(ascending);\n return [quantile(mu, alpha / 2), quantile(mu, 1 - alpha / 2)];\n}\n\n// Dot density binning for dot plot construction.\n// Based on Leland Wilkinson, Dot Plots, The American Statistician, 1999.\n// https://www.cs.uic.edu/~wilkinson/Publications/dotplots.pdf\nfunction dotbin (array, step, smooth, f) {\n f = f || (_ => _);\n const n = array.length,\n v = new Float64Array(n);\n let i = 0,\n j = 1,\n a = f(array[0]),\n b = a,\n w = a + step,\n x;\n for (; j < n; ++j) {\n x = f(array[j]);\n if (x >= w) {\n b = (a + b) / 2;\n for (; i < j; ++i) v[i] = b;\n w = x + step;\n a = x;\n }\n b = x;\n }\n b = (a + b) / 2;\n for (; i < j; ++i) v[i] = b;\n return smooth ? smoothing(v, step + step / 4) : v;\n}\n\n// perform smoothing to reduce variance\n// swap points between \"adjacent\" stacks\n// Wilkinson defines adjacent as within step/4 units\nfunction smoothing(v, thresh) {\n const n = v.length;\n let a = 0,\n b = 1,\n c,\n d;\n\n // get left stack\n while (v[a] === v[b]) ++b;\n while (b < n) {\n // get right stack\n c = b + 1;\n while (v[b] === v[c]) ++c;\n\n // are stacks adjacent?\n // if so, compare sizes and swap as needed\n if (v[b] - v[b - 1] < thresh) {\n d = b + (a + c - b - b >> 1);\n while (d < b) v[d++] = v[b];\n while (d > b) v[d--] = v[a];\n }\n\n // update left stack indices\n a = b;\n b = c;\n }\n return v;\n}\n\nfunction lcg (seed) {\n // Random numbers using a Linear Congruential Generator with seed value\n // Uses glibc values from https://en.wikipedia.org/wiki/Linear_congruential_generator\n return function () {\n seed = (1103515245 * seed + 12345) % 2147483647;\n return seed / 2147483647;\n };\n}\n\nfunction integer (min, max) {\n if (max == null) {\n max = min;\n min = 0;\n }\n let a, b, d;\n const dist = {\n min(_) {\n if (arguments.length) {\n a = _ || 0;\n d = b - a;\n return dist;\n } else {\n return a;\n }\n },\n max(_) {\n if (arguments.length) {\n b = _ || 0;\n d = b - a;\n return dist;\n } else {\n return b;\n }\n },\n sample() {\n return a + Math.floor(d * random());\n },\n pdf(x) {\n return x === Math.floor(x) && x >= a && x < b ? 1 / d : 0;\n },\n cdf(x) {\n const v = Math.floor(x);\n return v < a ? 0 : v >= b ? 1 : (v - a + 1) / d;\n },\n icdf(p) {\n return p >= 0 && p <= 1 ? a - 1 + Math.floor(p * d) : NaN;\n }\n };\n return dist.min(min).max(max);\n}\n\nconst SQRT2PI = Math.sqrt(2 * Math.PI);\nconst SQRT2 = Math.SQRT2;\n\nlet nextSample = NaN;\nfunction sampleNormal(mean, stdev) {\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n let x = 0,\n y = 0,\n rds,\n c;\n if (nextSample === nextSample) {\n x = nextSample;\n nextSample = NaN;\n } else {\n do {\n x = random() * 2 - 1;\n y = random() * 2 - 1;\n rds = x * x + y * y;\n } while (rds === 0 || rds > 1);\n c = Math.sqrt(-2 * Math.log(rds) / rds); // Box-Muller transform\n x *= c;\n nextSample = y * c;\n }\n return mean + x * stdev;\n}\nfunction densityNormal(value, mean, stdev) {\n stdev = stdev == null ? 1 : stdev;\n const z = (value - (mean || 0)) / stdev;\n return Math.exp(-0.5 * z * z) / (stdev * SQRT2PI);\n}\n\n// Approximation from West (2009)\n// Better Approximations to Cumulative Normal Functions\nfunction cumulativeNormal(value, mean, stdev) {\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n const z = (value - mean) / stdev,\n Z = Math.abs(z);\n let cd;\n if (Z > 37) {\n cd = 0;\n } else {\n const exp = Math.exp(-Z * Z / 2);\n let sum;\n if (Z < 7.07106781186547) {\n sum = 3.52624965998911e-02 * Z + 0.700383064443688;\n sum = sum * Z + 6.37396220353165;\n sum = sum * Z + 33.912866078383;\n sum = sum * Z + 112.079291497871;\n sum = sum * Z + 221.213596169931;\n sum = sum * Z + 220.206867912376;\n cd = exp * sum;\n sum = 8.83883476483184e-02 * Z + 1.75566716318264;\n sum = sum * Z + 16.064177579207;\n sum = sum * Z + 86.7807322029461;\n sum = sum * Z + 296.564248779674;\n sum = sum * Z + 637.333633378831;\n sum = sum * Z + 793.826512519948;\n sum = sum * Z + 440.413735824752;\n cd = cd / sum;\n } else {\n sum = Z + 0.65;\n sum = Z + 4 / sum;\n sum = Z + 3 / sum;\n sum = Z + 2 / sum;\n sum = Z + 1 / sum;\n cd = exp / sum / 2.506628274631;\n }\n }\n return z > 0 ? 1 - cd : cd;\n}\n\n// Approximation of Probit function using inverse error function.\nfunction quantileNormal(p, mean, stdev) {\n if (p < 0 || p > 1) return NaN;\n return (mean || 0) + (stdev == null ? 1 : stdev) * SQRT2 * erfinv(2 * p - 1);\n}\n\n// Approximate inverse error function. Implementation from \"Approximating\n// the erfinv function\" by Mike Giles, GPU Computing Gems, volume 2, 2010.\n// Ported from Apache Commons Math, http://www.apache.org/licenses/LICENSE-2.0\nfunction erfinv(x) {\n // beware that the logarithm argument must be\n // commputed as (1.0 - x) * (1.0 + x),\n // it must NOT be simplified as 1.0 - x * x as this\n // would induce rounding errors near the boundaries +/-1\n let w = -Math.log((1 - x) * (1 + x)),\n p;\n if (w < 6.25) {\n w -= 3.125;\n p = -3.6444120640178196996e-21;\n p = -1.685059138182016589e-19 + p * w;\n p = 1.2858480715256400167e-18 + p * w;\n p = 1.115787767802518096e-17 + p * w;\n p = -1.333171662854620906e-16 + p * w;\n p = 2.0972767875968561637e-17 + p * w;\n p = 6.6376381343583238325e-15 + p * w;\n p = -4.0545662729752068639e-14 + p * w;\n p = -8.1519341976054721522e-14 + p * w;\n p = 2.6335093153082322977e-12 + p * w;\n p = -1.2975133253453532498e-11 + p * w;\n p = -5.4154120542946279317e-11 + p * w;\n p = 1.051212273321532285e-09 + p * w;\n p = -4.1126339803469836976e-09 + p * w;\n p = -2.9070369957882005086e-08 + p * w;\n p = 4.2347877827932403518e-07 + p * w;\n p = -1.3654692000834678645e-06 + p * w;\n p = -1.3882523362786468719e-05 + p * w;\n p = 0.0001867342080340571352 + p * w;\n p = -0.00074070253416626697512 + p * w;\n p = -0.0060336708714301490533 + p * w;\n p = 0.24015818242558961693 + p * w;\n p = 1.6536545626831027356 + p * w;\n } else if (w < 16.0) {\n w = Math.sqrt(w) - 3.25;\n p = 2.2137376921775787049e-09;\n p = 9.0756561938885390979e-08 + p * w;\n p = -2.7517406297064545428e-07 + p * w;\n p = 1.8239629214389227755e-08 + p * w;\n p = 1.5027403968909827627e-06 + p * w;\n p = -4.013867526981545969e-06 + p * w;\n p = 2.9234449089955446044e-06 + p * w;\n p = 1.2475304481671778723e-05 + p * w;\n p = -4.7318229009055733981e-05 + p * w;\n p = 6.8284851459573175448e-05 + p * w;\n p = 2.4031110387097893999e-05 + p * w;\n p = -0.0003550375203628474796 + p * w;\n p = 0.00095328937973738049703 + p * w;\n p = -0.0016882755560235047313 + p * w;\n p = 0.0024914420961078508066 + p * w;\n p = -0.0037512085075692412107 + p * w;\n p = 0.005370914553590063617 + p * w;\n p = 1.0052589676941592334 + p * w;\n p = 3.0838856104922207635 + p * w;\n } else if (Number.isFinite(w)) {\n w = Math.sqrt(w) - 5.0;\n p = -2.7109920616438573243e-11;\n p = -2.5556418169965252055e-10 + p * w;\n p = 1.5076572693500548083e-09 + p * w;\n p = -3.7894654401267369937e-09 + p * w;\n p = 7.6157012080783393804e-09 + p * w;\n p = -1.4960026627149240478e-08 + p * w;\n p = 2.9147953450901080826e-08 + p * w;\n p = -6.7711997758452339498e-08 + p * w;\n p = 2.2900482228026654717e-07 + p * w;\n p = -9.9298272942317002539e-07 + p * w;\n p = 4.5260625972231537039e-06 + p * w;\n p = -1.9681778105531670567e-05 + p * w;\n p = 7.5995277030017761139e-05 + p * w;\n p = -0.00021503011930044477347 + p * w;\n p = -0.00013871931833623122026 + p * w;\n p = 1.0103004648645343977 + p * w;\n p = 4.8499064014085844221 + p * w;\n } else {\n p = Infinity;\n }\n return p * x;\n}\nfunction gaussian (mean, stdev) {\n let mu, sigma;\n const dist = {\n mean(_) {\n if (arguments.length) {\n mu = _ || 0;\n return dist;\n } else {\n return mu;\n }\n },\n stdev(_) {\n if (arguments.length) {\n sigma = _ == null ? 1 : _;\n return dist;\n } else {\n return sigma;\n }\n },\n sample: () => sampleNormal(mu, sigma),\n pdf: value => densityNormal(value, mu, sigma),\n cdf: value => cumulativeNormal(value, mu, sigma),\n icdf: p => quantileNormal(p, mu, sigma)\n };\n return dist.mean(mean).stdev(stdev);\n}\n\nfunction kde (support, bandwidth) {\n const kernel = gaussian();\n let n = 0;\n const dist = {\n data(_) {\n if (arguments.length) {\n support = _;\n n = _ ? _.length : 0;\n return dist.bandwidth(bandwidth);\n } else {\n return support;\n }\n },\n bandwidth(_) {\n if (!arguments.length) return bandwidth;\n bandwidth = _;\n if (!bandwidth && support) bandwidth = estimateBandwidth(support);\n return dist;\n },\n sample() {\n return support[~~(random() * n)] + bandwidth * kernel.sample();\n },\n pdf(x) {\n let y = 0,\n i = 0;\n for (; i < n; ++i) {\n y += kernel.pdf((x - support[i]) / bandwidth);\n }\n return y / bandwidth / n;\n },\n cdf(x) {\n let y = 0,\n i = 0;\n for (; i < n; ++i) {\n y += kernel.cdf((x - support[i]) / bandwidth);\n }\n return y / n;\n },\n icdf() {\n throw Error('KDE icdf not supported.');\n }\n };\n return dist.data(support);\n}\n\nfunction sampleLogNormal(mean, stdev) {\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n return Math.exp(mean + sampleNormal() * stdev);\n}\nfunction densityLogNormal(value, mean, stdev) {\n if (value <= 0) return 0;\n mean = mean || 0;\n stdev = stdev == null ? 1 : stdev;\n const z = (Math.log(value) - mean) / stdev;\n return Math.exp(-0.5 * z * z) / (stdev * SQRT2PI * value);\n}\nfunction cumulativeLogNormal(value, mean, stdev) {\n return cumulativeNormal(Math.log(value), mean, stdev);\n}\nfunction quantileLogNormal(p, mean, stdev) {\n return Math.exp(quantileNormal(p, mean, stdev));\n}\nfunction lognormal (mean, stdev) {\n let mu, sigma;\n const dist = {\n mean(_) {\n if (arguments.length) {\n mu = _ || 0;\n return dist;\n } else {\n return mu;\n }\n },\n stdev(_) {\n if (arguments.length) {\n sigma = _ == null ? 1 : _;\n return dist;\n } else {\n return sigma;\n }\n },\n sample: () => sampleLogNormal(mu, sigma),\n pdf: value => densityLogNormal(value, mu, sigma),\n cdf: value => cumulativeLogNormal(value, mu, sigma),\n icdf: p => quantileLogNormal(p, mu, sigma)\n };\n return dist.mean(mean).stdev(stdev);\n}\n\nfunction mixture (dists, weights) {\n let m = 0,\n w;\n function normalize(x) {\n const w = [];\n let sum = 0,\n i;\n for (i = 0; i < m; ++i) {\n sum += w[i] = x[i] == null ? 1 : +x[i];\n }\n for (i = 0; i < m; ++i) {\n w[i] /= sum;\n }\n return w;\n }\n const dist = {\n weights(_) {\n if (arguments.length) {\n w = normalize(weights = _ || []);\n return dist;\n }\n return weights;\n },\n distributions(_) {\n if (arguments.length) {\n if (_) {\n m = _.length;\n dists = _;\n } else {\n m = 0;\n dists = [];\n }\n return dist.weights(weights);\n }\n return dists;\n },\n sample() {\n const r = random();\n let d = dists[m - 1],\n v = w[0],\n i = 0;\n\n // first select distribution\n for (; i < m - 1; v += w[++i]) {\n if (r < v) {\n d = dists[i];\n break;\n }\n }\n // then sample from it\n return d.sample();\n },\n pdf(x) {\n let p = 0,\n i = 0;\n for (; i < m; ++i) {\n p += w[i] * dists[i].pdf(x);\n }\n return p;\n },\n cdf(x) {\n let p = 0,\n i = 0;\n for (; i < m; ++i) {\n p += w[i] * dists[i].cdf(x);\n }\n return p;\n },\n icdf() {\n throw Error('Mixture icdf not supported.');\n }\n };\n return dist.distributions(dists).weights(weights);\n}\n\nfunction sampleUniform(min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return min + (max - min) * random();\n}\nfunction densityUniform(value, min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return value >= min && value <= max ? 1 / (max - min) : 0;\n}\nfunction cumulativeUniform(value, min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return value < min ? 0 : value > max ? 1 : (value - min) / (max - min);\n}\nfunction quantileUniform(p, min, max) {\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return p >= 0 && p <= 1 ? min + p * (max - min) : NaN;\n}\nfunction uniform (min, max) {\n let a, b;\n const dist = {\n min(_) {\n if (arguments.length) {\n a = _ || 0;\n return dist;\n } else {\n return a;\n }\n },\n max(_) {\n if (arguments.length) {\n b = _ == null ? 1 : _;\n return dist;\n } else {\n return b;\n }\n },\n sample: () => sampleUniform(a, b),\n pdf: value => densityUniform(value, a, b),\n cdf: value => cumulativeUniform(value, a, b),\n icdf: p => quantileUniform(p, a, b)\n };\n if (max == null) {\n max = min == null ? 1 : min;\n min = 0;\n }\n return dist.min(min).max(max);\n}\n\nfunction constant (data, x, y) {\n let mean = 0,\n n = 0;\n for (const d of data) {\n const val = y(d);\n if (x(d) == null || val == null || isNaN(val)) continue;\n mean += (val - mean) / ++n;\n }\n return {\n coef: [mean],\n predict: () => mean,\n rSquared: 0\n };\n}\n\n// Ordinary Least Squares\nfunction ols (uX, uY, uXY, uX2) {\n const delta = uX2 - uX * uX,\n slope = Math.abs(delta) < 1e-24 ? 0 : (uXY - uX * uY) / delta,\n intercept = uY - slope * uX;\n return [intercept, slope];\n}\n\nfunction points(data, x, y, sort) {\n data = data.filter(d => {\n let u = x(d),\n v = y(d);\n return u != null && (u = +u) >= u && v != null && (v = +v) >= v;\n });\n if (sort) {\n data.sort((a, b) => x(a) - x(b));\n }\n const n = data.length,\n X = new Float64Array(n),\n Y = new Float64Array(n);\n\n // extract values, calculate means\n let i = 0,\n ux = 0,\n uy = 0,\n xv,\n yv,\n d;\n for (d of data) {\n X[i] = xv = +x(d);\n Y[i] = yv = +y(d);\n ++i;\n ux += (xv - ux) / i;\n uy += (yv - uy) / i;\n }\n\n // mean center the data\n for (i = 0; i < n; ++i) {\n X[i] -= ux;\n Y[i] -= uy;\n }\n return [X, Y, ux, uy];\n}\nfunction visitPoints(data, x, y, callback) {\n let i = -1,\n u,\n v;\n for (const d of data) {\n u = x(d);\n v = y(d);\n if (u != null && (u = +u) >= u && v != null && (v = +v) >= v) {\n callback(u, v, ++i);\n }\n }\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\nfunction rSquared (data, x, y, uY, predict) {\n let SSE = 0,\n SST = 0;\n visitPoints(data, x, y, (dx, dy) => {\n const sse = dy - predict(dx),\n sst = dy - uY;\n SSE += sse * sse;\n SST += sst * sst;\n });\n return 1 - SSE / SST;\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\nfunction linear (data, x, y) {\n let X = 0,\n Y = 0,\n XY = 0,\n X2 = 0,\n n = 0;\n visitPoints(data, x, y, (dx, dy) => {\n ++n;\n X += (dx - X) / n;\n Y += (dy - Y) / n;\n XY += (dx * dy - XY) / n;\n X2 += (dx * dx - X2) / n;\n });\n const coef = ols(X, Y, XY, X2),\n predict = x => coef[0] + coef[1] * x;\n return {\n coef: coef,\n predict: predict,\n rSquared: rSquared(data, x, y, Y, predict)\n };\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\nfunction log (data, x, y) {\n let X = 0,\n Y = 0,\n XY = 0,\n X2 = 0,\n n = 0;\n visitPoints(data, x, y, (dx, dy) => {\n ++n;\n dx = Math.log(dx);\n X += (dx - X) / n;\n Y += (dy - Y) / n;\n XY += (dx * dy - XY) / n;\n X2 += (dx * dx - X2) / n;\n });\n const coef = ols(X, Y, XY, X2),\n predict = x => coef[0] + coef[1] * Math.log(x);\n return {\n coef: coef,\n predict: predict,\n rSquared: rSquared(data, x, y, Y, predict)\n };\n}\n\nfunction exp (data, x, y) {\n // eslint-disable-next-line no-unused-vars\n const [xv, yv, ux, uy] = points(data, x, y);\n let YL = 0,\n XY = 0,\n XYL = 0,\n X2Y = 0,\n n = 0,\n dx,\n ly,\n xy;\n visitPoints(data, x, y, (_, dy) => {\n dx = xv[n++];\n ly = Math.log(dy);\n xy = dx * dy;\n YL += (dy * ly - YL) / n;\n XY += (xy - XY) / n;\n XYL += (xy * ly - XYL) / n;\n X2Y += (dx * xy - X2Y) / n;\n });\n const [c0, c1] = ols(XY / uy, YL / uy, XYL / uy, X2Y / uy),\n predict = x => Math.exp(c0 + c1 * (x - ux));\n return {\n coef: [Math.exp(c0 - c1 * ux), c1],\n predict: predict,\n rSquared: rSquared(data, x, y, uy, predict)\n };\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\nfunction pow (data, x, y) {\n let X = 0,\n Y = 0,\n XY = 0,\n X2 = 0,\n YS = 0,\n n = 0;\n visitPoints(data, x, y, (dx, dy) => {\n const lx = Math.log(dx),\n ly = Math.log(dy);\n ++n;\n X += (lx - X) / n;\n Y += (ly - Y) / n;\n XY += (lx * ly - XY) / n;\n X2 += (lx * lx - X2) / n;\n YS += (dy - YS) / n;\n });\n const coef = ols(X, Y, XY, X2),\n predict = x => coef[0] * Math.pow(x, coef[1]);\n coef[0] = Math.exp(coef[0]);\n return {\n coef: coef,\n predict: predict,\n rSquared: rSquared(data, x, y, YS, predict)\n };\n}\n\nfunction quad (data, x, y) {\n const [xv, yv, ux, uy] = points(data, x, y),\n n = xv.length;\n let X2 = 0,\n X3 = 0,\n X4 = 0,\n XY = 0,\n X2Y = 0,\n i,\n dx,\n dy,\n x2;\n for (i = 0; i < n;) {\n dx = xv[i];\n dy = yv[i++];\n x2 = dx * dx;\n X2 += (x2 - X2) / i;\n X3 += (x2 * dx - X3) / i;\n X4 += (x2 * x2 - X4) / i;\n XY += (dx * dy - XY) / i;\n X2Y += (x2 * dy - X2Y) / i;\n }\n const X2X2 = X4 - X2 * X2,\n d = X2 * X2X2 - X3 * X3,\n a = (X2Y * X2 - XY * X3) / d,\n b = (XY * X2X2 - X2Y * X3) / d,\n c = -a * X2,\n predict = x => {\n x = x - ux;\n return a * x * x + b * x + c + uy;\n };\n\n // transform coefficients back from mean-centered space\n return {\n coef: [c - b * ux + a * ux * ux + uy, b - 2 * a * ux, a],\n predict: predict,\n rSquared: rSquared(data, x, y, uy, predict)\n };\n}\n\n// Adapted from d3-regression by Harry Stevens\n// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE\n// ... which was adapted from regression-js by Tom Alexander\n// Source: https://github.com/Tom-Alexander/regression-js/blob/master/src/regression.js#L246\n// License: https://github.com/Tom-Alexander/regression-js/blob/master/LICENSE\nfunction poly (data, x, y, order) {\n // use more efficient methods for lower orders\n if (order === 0) return constant(data, x, y);\n if (order === 1) return linear(data, x, y);\n if (order === 2) return quad(data, x, y);\n const [xv, yv, ux, uy] = points(data, x, y),\n n = xv.length,\n lhs = [],\n rhs = [],\n k = order + 1;\n let i, j, l, v, c;\n for (i = 0; i < k; ++i) {\n for (l = 0, v = 0; l < n; ++l) {\n v += Math.pow(xv[l], i) * yv[l];\n }\n lhs.push(v);\n c = new Float64Array(k);\n for (j = 0; j < k; ++j) {\n for (l = 0, v = 0; l < n; ++l) {\n v += Math.pow(xv[l], i + j);\n }\n c[j] = v;\n }\n rhs.push(c);\n }\n rhs.push(lhs);\n const coef = gaussianElimination(rhs),\n predict = x => {\n x -= ux;\n let y = uy + coef[0] + coef[1] * x + coef[2] * x * x;\n for (i = 3; i < k; ++i) y += coef[i] * Math.pow(x, i);\n return y;\n };\n return {\n coef: uncenter(k, coef, -ux, uy),\n predict: predict,\n rSquared: rSquared(data, x, y, uy, predict)\n };\n}\nfunction uncenter(k, a, x, y) {\n const z = Array(k);\n let i, j, v, c;\n\n // initialize to zero\n for (i = 0; i < k; ++i) z[i] = 0;\n\n // polynomial expansion\n for (i = k - 1; i >= 0; --i) {\n v = a[i];\n c = 1;\n z[i] += v;\n for (j = 1; j <= i; ++j) {\n c *= (i + 1 - j) / j; // binomial coefficent\n z[i - j] += v * Math.pow(x, j) * c;\n }\n }\n\n // bias term\n z[0] += y;\n return z;\n}\n\n// Given an array for a two-dimensional matrix and the polynomial order,\n// solve A * x = b using Gaussian elimination.\nfunction gaussianElimination(matrix) {\n const n = matrix.length - 1,\n coef = [];\n let i, j, k, r, t;\n for (i = 0; i < n; ++i) {\n r = i; // max row\n for (j = i + 1; j < n; ++j) {\n if (Math.abs(matrix[i][j]) > Math.abs(matrix[i][r])) {\n r = j;\n }\n }\n for (k = i; k < n + 1; ++k) {\n t = matrix[k][i];\n matrix[k][i] = matrix[k][r];\n matrix[k][r] = t;\n }\n for (j = i + 1; j < n; ++j) {\n for (k = n; k >= i; k--) {\n matrix[k][j] -= matrix[k][i] * matrix[i][j] / matrix[i][i];\n }\n }\n }\n for (j = n - 1; j >= 0; --j) {\n t = 0;\n for (k = j + 1; k < n; ++k) {\n t += matrix[k][j] * coef[k];\n }\n coef[j] = (matrix[n][j] - t) / matrix[j][j];\n }\n return coef;\n}\n\nconst maxiters = 2,\n epsilon = 1e-12;\n\n// Adapted from science.js by Jason Davies\n// Source: https://github.com/jasondavies/science.js/blob/master/src/stats/loess.js\n// License: https://github.com/jasondavies/science.js/blob/master/LICENSE\nfunction loess (data, x, y, bandwidth) {\n const [xv, yv, ux, uy] = points(data, x, y, true),\n n = xv.length,\n bw = Math.max(2, ~~(bandwidth * n)),\n // # nearest neighbors\n yhat = new Float64Array(n),\n residuals = new Float64Array(n),\n robustWeights = new Float64Array(n).fill(1);\n for (let iter = -1; ++iter <= maxiters;) {\n const interval = [0, bw - 1];\n for (let i = 0; i < n; ++i) {\n const dx = xv[i],\n i0 = interval[0],\n i1 = interval[1],\n edge = dx - xv[i0] > xv[i1] - dx ? i0 : i1;\n let W = 0,\n X = 0,\n Y = 0,\n XY = 0,\n X2 = 0;\n const denom = 1 / Math.abs(xv[edge] - dx || 1); // avoid singularity!\n\n for (let k = i0; k <= i1; ++k) {\n const xk = xv[k],\n yk = yv[k],\n w = tricube(Math.abs(dx - xk) * denom) * robustWeights[k],\n xkw = xk * w;\n W += w;\n X += xkw;\n Y += yk * w;\n XY += yk * xkw;\n X2 += xk * xkw;\n }\n\n // linear regression fit\n const [a, b] = ols(X / W, Y / W, XY / W, X2 / W);\n yhat[i] = a + b * dx;\n residuals[i] = Math.abs(yv[i] - yhat[i]);\n updateInterval(xv, i + 1, interval);\n }\n if (iter === maxiters) {\n break;\n }\n const medianResidual = median(residuals);\n if (Math.abs(medianResidual) < epsilon) break;\n for (let i = 0, arg, w; i < n; ++i) {\n arg = residuals[i] / (6 * medianResidual);\n // default to epsilon (rather than zero) for large deviations\n // keeping weights tiny but non-zero prevents singularites\n robustWeights[i] = arg >= 1 ? epsilon : (w = 1 - arg * arg) * w;\n }\n }\n return output(xv, yhat, ux, uy);\n}\n\n// weighting kernel for local regression\nfunction tricube(x) {\n return (x = 1 - x * x * x) * x * x;\n}\n\n// advance sliding window interval of nearest neighbors\nfunction updateInterval(xv, i, interval) {\n const val = xv[i];\n let left = interval[0],\n right = interval[1] + 1;\n if (right >= xv.length) return;\n\n // step right if distance to new right edge is <= distance to old left edge\n // step when distance is equal to ensure movement over duplicate x values\n while (i > left && xv[right] - val <= val - xv[left]) {\n interval[0] = ++left;\n interval[1] = right;\n ++right;\n }\n}\n\n// generate smoothed output points\n// average points with repeated x values\nfunction output(xv, yhat, ux, uy) {\n const n = xv.length,\n out = [];\n let i = 0,\n cnt = 0,\n prev = [],\n v;\n for (; i < n; ++i) {\n v = xv[i] + ux;\n if (prev[0] === v) {\n // average output values via online update\n prev[1] += (yhat[i] - prev[1]) / ++cnt;\n } else {\n // add new output point\n cnt = 0;\n prev[1] += uy;\n prev = [v, yhat[i]];\n out.push(prev);\n }\n }\n prev[1] += uy;\n return out;\n}\n\n// subdivide up to accuracy of 0.5 degrees\nconst MIN_RADIANS = 0.5 * Math.PI / 180;\n\n// Adaptively sample an interpolated function over a domain extent\nfunction sampleCurve (f, extent, minSteps, maxSteps) {\n minSteps = minSteps || 25;\n maxSteps = Math.max(minSteps, maxSteps || 200);\n const point = x => [x, f(x)],\n minX = extent[0],\n maxX = extent[1],\n span = maxX - minX,\n stop = span / maxSteps,\n prev = [point(minX)],\n next = [];\n if (minSteps === maxSteps) {\n // no adaptation, sample uniform grid directly and return\n for (let i = 1; i < maxSteps; ++i) {\n prev.push(point(minX + i / minSteps * span));\n }\n prev.push(point(maxX));\n return prev;\n } else {\n // sample minimum points on uniform grid\n // then move on to perform adaptive refinement\n next.push(point(maxX));\n for (let i = minSteps; --i > 0;) {\n next.push(point(minX + i / minSteps * span));\n }\n }\n let p0 = prev[0];\n let p1 = next[next.length - 1];\n const sx = 1 / span;\n const sy = scaleY(p0[1], next);\n while (p1) {\n // midpoint for potential curve subdivision\n const pm = point((p0[0] + p1[0]) / 2);\n const dx = pm[0] - p0[0] >= stop;\n if (dx && angleDelta(p0, pm, p1, sx, sy) > MIN_RADIANS) {\n // maximum resolution has not yet been met, and\n // subdivision midpoint is sufficiently different from endpoint\n // save subdivision, push midpoint onto the visitation stack\n next.push(pm);\n } else {\n // subdivision midpoint sufficiently similar to endpoint\n // skip subdivision, store endpoint, move to next point on the stack\n p0 = p1;\n prev.push(p1);\n next.pop();\n }\n p1 = next[next.length - 1];\n }\n return prev;\n}\nfunction scaleY(init, points) {\n let ymin = init;\n let ymax = init;\n const n = points.length;\n for (let i = 0; i < n; ++i) {\n const y = points[i][1];\n if (y < ymin) ymin = y;\n if (y > ymax) ymax = y;\n }\n return 1 / (ymax - ymin);\n}\nfunction angleDelta(p, q, r, sx, sy) {\n const a0 = Math.atan2(sy * (r[1] - p[1]), sx * (r[0] - p[0])),\n a1 = Math.atan2(sy * (q[1] - p[1]), sx * (q[0] - p[0]));\n return Math.abs(a0 - a1);\n}\n\nexport { estimateBandwidth as bandwidthNRD, bin, bootstrapCI, cumulativeLogNormal, cumulativeNormal, cumulativeUniform, densityLogNormal, densityNormal, densityUniform, dotbin, quantileLogNormal, quantileNormal, quantileUniform, quantiles, quartiles, random, integer as randomInteger, kde as randomKDE, lcg as randomLCG, lognormal as randomLogNormal, mixture as randomMixture, gaussian as randomNormal, uniform as randomUniform, constant as regressionConstant, exp as regressionExp, linear as regressionLinear, loess as regressionLoess, log as regressionLog, poly as regressionPoly, pow as regressionPow, quad as regressionQuad, sampleCurve, sampleLogNormal, sampleNormal, sampleUniform, setRandom };\n","import variance from \"./variance.js\";\n\nexport default function deviation(values, valueof) {\n const v = variance(values, valueof);\n return v ? Math.sqrt(v) : v;\n}\n","export default function variance(values, valueof) {\n let count = 0;\n let delta;\n let mean = 0;\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n delta = value - mean;\n mean += delta / ++count;\n sum += delta * (value - mean);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n delta = value - mean;\n mean += delta / ++count;\n sum += delta * (value - mean);\n }\n }\n }\n if (count > 1) return sum / (count - 1);\n}\n","export default function range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","import { extend, identity, field, hasOwnProperty, extentIndex, inherits, array, accessorName, error, accessorFields, accessor, toNumber, merge, compare, truthy, extent, span, fastmap, isArray, key, ascending, peek, zero, constant } from 'vega-util';\nimport { tupleid, Transform, replace, ingest, stableCompare, Operator, derive, rederive } from 'vega-dataflow';\nimport { quartiles, bootstrapCI, bin, randomKDE, randomMixture, randomNormal, randomLogNormal, randomUniform, sampleCurve, dotbin, quantiles, random } from 'vega-statistics';\nimport { median, mean, min, max, range, bisector } from 'd3-array';\nimport { TIME_UNITS, utcInterval, timeInterval, timeBin, timeUnits, utcFloor, timeFloor } from 'vega-time';\n\nfunction multikey(f) {\n return x => {\n const n = f.length;\n let i = 1,\n k = String(f[0](x));\n for (; i < n; ++i) {\n k += '|' + f[i](x);\n }\n return k;\n };\n}\nfunction groupkey(fields) {\n return !fields || !fields.length ? function () {\n return '';\n } : fields.length === 1 ? fields[0] : multikey(fields);\n}\n\nfunction measureName(op, field, as) {\n return as || op + (!field ? '' : '_' + field);\n}\nconst noop = () => {};\nconst base_op = {\n init: noop,\n add: noop,\n rem: noop,\n idx: 0\n};\nconst AggregateOps = {\n values: {\n init: m => m.cell.store = true,\n value: m => m.cell.data.values(),\n idx: -1\n },\n count: {\n value: m => m.cell.num\n },\n __count__: {\n value: m => m.missing + m.valid\n },\n missing: {\n value: m => m.missing\n },\n valid: {\n value: m => m.valid\n },\n sum: {\n init: m => m.sum = 0,\n value: m => m.valid ? m.sum : undefined,\n add: (m, v) => m.sum += +v,\n rem: (m, v) => m.sum -= v\n },\n product: {\n init: m => m.product = 1,\n value: m => m.valid ? m.product : undefined,\n add: (m, v) => m.product *= v,\n rem: (m, v) => m.product /= v\n },\n mean: {\n init: m => m.mean = 0,\n value: m => m.valid ? m.mean : undefined,\n add: (m, v) => (m.mean_d = v - m.mean, m.mean += m.mean_d / m.valid),\n rem: (m, v) => (m.mean_d = v - m.mean, m.mean -= m.valid ? m.mean_d / m.valid : m.mean)\n },\n average: {\n value: m => m.valid ? m.mean : undefined,\n req: ['mean'],\n idx: 1\n },\n variance: {\n init: m => m.dev = 0,\n value: m => m.valid > 1 ? m.dev / (m.valid - 1) : undefined,\n add: (m, v) => m.dev += m.mean_d * (v - m.mean),\n rem: (m, v) => m.dev -= m.mean_d * (v - m.mean),\n req: ['mean'],\n idx: 1\n },\n variancep: {\n value: m => m.valid > 1 ? m.dev / m.valid : undefined,\n req: ['variance'],\n idx: 2\n },\n stdev: {\n value: m => m.valid > 1 ? Math.sqrt(m.dev / (m.valid - 1)) : undefined,\n req: ['variance'],\n idx: 2\n },\n stdevp: {\n value: m => m.valid > 1 ? Math.sqrt(m.dev / m.valid) : undefined,\n req: ['variance'],\n idx: 2\n },\n stderr: {\n value: m => m.valid > 1 ? Math.sqrt(m.dev / (m.valid * (m.valid - 1))) : undefined,\n req: ['variance'],\n idx: 2\n },\n distinct: {\n value: m => m.cell.data.distinct(m.get),\n req: ['values'],\n idx: 3\n },\n ci0: {\n value: m => m.cell.data.ci0(m.get),\n req: ['values'],\n idx: 3\n },\n ci1: {\n value: m => m.cell.data.ci1(m.get),\n req: ['values'],\n idx: 3\n },\n median: {\n value: m => m.cell.data.q2(m.get),\n req: ['values'],\n idx: 3\n },\n q1: {\n value: m => m.cell.data.q1(m.get),\n req: ['values'],\n idx: 3\n },\n q3: {\n value: m => m.cell.data.q3(m.get),\n req: ['values'],\n idx: 3\n },\n min: {\n init: m => m.min = undefined,\n value: m => m.min = Number.isNaN(m.min) ? m.cell.data.min(m.get) : m.min,\n add: (m, v) => {\n if (v < m.min || m.min === undefined) m.min = v;\n },\n rem: (m, v) => {\n if (v <= m.min) m.min = NaN;\n },\n req: ['values'],\n idx: 4\n },\n max: {\n init: m => m.max = undefined,\n value: m => m.max = Number.isNaN(m.max) ? m.cell.data.max(m.get) : m.max,\n add: (m, v) => {\n if (v > m.max || m.max === undefined) m.max = v;\n },\n rem: (m, v) => {\n if (v >= m.max) m.max = NaN;\n },\n req: ['values'],\n idx: 4\n },\n argmin: {\n init: m => m.argmin = undefined,\n value: m => m.argmin || m.cell.data.argmin(m.get),\n add: (m, v, t) => {\n if (v < m.min) m.argmin = t;\n },\n rem: (m, v) => {\n if (v <= m.min) m.argmin = undefined;\n },\n req: ['min', 'values'],\n idx: 3\n },\n argmax: {\n init: m => m.argmax = undefined,\n value: m => m.argmax || m.cell.data.argmax(m.get),\n add: (m, v, t) => {\n if (v > m.max) m.argmax = t;\n },\n rem: (m, v) => {\n if (v >= m.max) m.argmax = undefined;\n },\n req: ['max', 'values'],\n idx: 3\n },\n exponential: {\n init: (m, r) => {\n m.exp = 0;\n m.exp_r = r;\n },\n value: m => m.valid ? m.exp * (1 - m.exp_r) / (1 - m.exp_r ** m.valid) : undefined,\n add: (m, v) => m.exp = m.exp_r * m.exp + v,\n rem: (m, v) => m.exp = (m.exp - v / m.exp_r ** (m.valid - 1)) / m.exp_r\n },\n exponentialb: {\n value: m => m.valid ? m.exp * (1 - m.exp_r) : undefined,\n req: ['exponential'],\n idx: 1\n }\n};\nconst ValidAggregateOps = Object.keys(AggregateOps).filter(d => d !== '__count__');\nfunction measure(key, value) {\n return (out, aggregate_param) => extend({\n name: key,\n aggregate_param: aggregate_param,\n out: out || key\n }, base_op, value);\n}\n[...ValidAggregateOps, '__count__'].forEach(key => {\n AggregateOps[key] = measure(key, AggregateOps[key]);\n});\nfunction createMeasure(op, param, name) {\n return AggregateOps[op](name, param);\n}\nfunction compareIndex(a, b) {\n return a.idx - b.idx;\n}\nfunction resolve(agg) {\n const map = {};\n agg.forEach(a => map[a.name] = a);\n const getreqs = a => {\n if (!a.req) return;\n a.req.forEach(key => {\n if (!map[key]) getreqs(map[key] = AggregateOps[key]());\n });\n };\n agg.forEach(getreqs);\n return Object.values(map).sort(compareIndex);\n}\nfunction init() {\n this.valid = 0;\n this.missing = 0;\n this._ops.forEach(op => op.aggregate_param == null ? op.init(this) : op.init(this, op.aggregate_param));\n}\nfunction add(v, t) {\n if (v == null || v === '') {\n ++this.missing;\n return;\n }\n if (v !== v) return;\n ++this.valid;\n this._ops.forEach(op => op.add(this, v, t));\n}\nfunction rem(v, t) {\n if (v == null || v === '') {\n --this.missing;\n return;\n }\n if (v !== v) return;\n --this.valid;\n this._ops.forEach(op => op.rem(this, v, t));\n}\nfunction set(t) {\n this._out.forEach(op => t[op.out] = op.value(this));\n return t;\n}\nfunction compileMeasures(agg, field) {\n const get = field || identity,\n ops = resolve(agg),\n out = agg.slice().sort(compareIndex);\n function ctr(cell) {\n this._ops = ops;\n this._out = out;\n this.cell = cell;\n this.init();\n }\n ctr.prototype.init = init;\n ctr.prototype.add = add;\n ctr.prototype.rem = rem;\n ctr.prototype.set = set;\n ctr.prototype.get = get;\n ctr.fields = agg.map(op => op.out);\n return ctr;\n}\n\nfunction TupleStore(key) {\n this._key = key ? field(key) : tupleid;\n this.reset();\n}\nconst prototype$1 = TupleStore.prototype;\nprototype$1.reset = function () {\n this._add = [];\n this._rem = [];\n this._ext = null;\n this._get = null;\n this._q = null;\n};\nprototype$1.add = function (v) {\n this._add.push(v);\n};\nprototype$1.rem = function (v) {\n this._rem.push(v);\n};\nprototype$1.values = function () {\n this._get = null;\n if (this._rem.length === 0) return this._add;\n const a = this._add,\n r = this._rem,\n k = this._key,\n n = a.length,\n m = r.length,\n x = Array(n - m),\n map = {};\n let i, j, v;\n\n // use unique key field to clear removed values\n for (i = 0; i < m; ++i) {\n map[k(r[i])] = 1;\n }\n for (i = 0, j = 0; i < n; ++i) {\n if (map[k(v = a[i])]) {\n map[k(v)] = 0;\n } else {\n x[j++] = v;\n }\n }\n this._rem = [];\n return this._add = x;\n};\n\n// memoizing statistics methods\n\nprototype$1.distinct = function (get) {\n const v = this.values(),\n map = {};\n let n = v.length,\n count = 0,\n s;\n while (--n >= 0) {\n s = get(v[n]) + '';\n if (!hasOwnProperty(map, s)) {\n map[s] = 1;\n ++count;\n }\n }\n return count;\n};\nprototype$1.extent = function (get) {\n if (this._get !== get || !this._ext) {\n const v = this.values(),\n i = extentIndex(v, get);\n this._ext = [v[i[0]], v[i[1]]];\n this._get = get;\n }\n return this._ext;\n};\nprototype$1.argmin = function (get) {\n return this.extent(get)[0] || {};\n};\nprototype$1.argmax = function (get) {\n return this.extent(get)[1] || {};\n};\nprototype$1.min = function (get) {\n const m = this.extent(get)[0];\n return m != null ? get(m) : undefined;\n};\nprototype$1.max = function (get) {\n const m = this.extent(get)[1];\n return m != null ? get(m) : undefined;\n};\nprototype$1.quartile = function (get) {\n if (this._get !== get || !this._q) {\n this._q = quartiles(this.values(), get);\n this._get = get;\n }\n return this._q;\n};\nprototype$1.q1 = function (get) {\n return this.quartile(get)[0];\n};\nprototype$1.q2 = function (get) {\n return this.quartile(get)[1];\n};\nprototype$1.q3 = function (get) {\n return this.quartile(get)[2];\n};\nprototype$1.ci = function (get) {\n if (this._get !== get || !this._ci) {\n this._ci = bootstrapCI(this.values(), 1000, 0.05, get);\n this._get = get;\n }\n return this._ci;\n};\nprototype$1.ci0 = function (get) {\n return this.ci(get)[0];\n};\nprototype$1.ci1 = function (get) {\n return this.ci(get)[1];\n};\n\n/**\n * Group-by aggregation operator.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {Array} [params.fields] - An array of accessors to aggregate.\n * @param {Array} [params.ops] - An array of strings indicating aggregation operations.\n * @param {Array} [params.aggregate_params] - An optional array of parameters for aggregation operations.\n * @param {Array} [params.as] - An array of output field names for aggregated values.\n * @param {boolean} [params.cross=false] - A flag indicating that the full\n * cross-product of groupby values should be generated, including empty cells.\n * If true, the drop parameter is ignored and empty cells are retained.\n * @param {boolean} [params.drop=true] - A flag indicating if empty cells should be removed.\n */\nfunction Aggregate(params) {\n Transform.call(this, null, params);\n this._adds = []; // array of added output tuples\n this._mods = []; // array of modified output tuples\n this._alen = 0; // number of active added tuples\n this._mlen = 0; // number of active modified tuples\n this._drop = true; // should empty aggregation cells be removed\n this._cross = false; // produce full cross-product of group-by values\n\n this._dims = []; // group-by dimension accessors\n this._dnames = []; // group-by dimension names\n\n this._measures = []; // collection of aggregation monoids\n this._countOnly = false; // flag indicating only count aggregation\n this._counts = null; // collection of count fields\n this._prev = null; // previous aggregation cells\n\n this._inputs = null; // array of dependent input tuple field names\n this._outputs = null; // array of output tuple field names\n}\nAggregate.Definition = {\n 'type': 'Aggregate',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'ops',\n 'type': 'enum',\n 'array': true,\n 'values': ValidAggregateOps\n }, {\n 'name': 'aggregate_params',\n 'type': 'number',\n 'null': true,\n 'array': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'null': true,\n 'array': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }, {\n 'name': 'drop',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'cross',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'key',\n 'type': 'field'\n }]\n};\ninherits(Aggregate, Transform, {\n transform(_, pulse) {\n const aggr = this,\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n mod = _.modified();\n aggr.stamp = out.stamp;\n if (aggr.value && (mod || pulse.modified(aggr._inputs, true))) {\n aggr._prev = aggr.value;\n aggr.value = mod ? aggr.init(_) : Object.create(null);\n pulse.visit(pulse.SOURCE, t => aggr.add(t));\n } else {\n aggr.value = aggr.value || aggr.init(_);\n pulse.visit(pulse.REM, t => aggr.rem(t));\n pulse.visit(pulse.ADD, t => aggr.add(t));\n }\n\n // Indicate output fields and return aggregate tuples.\n out.modifies(aggr._outputs);\n\n // Should empty cells be dropped?\n aggr._drop = _.drop !== false;\n\n // If domain cross-product requested, generate empty cells as needed\n // and ensure that empty cells are not dropped\n if (_.cross && aggr._dims.length > 1) {\n aggr._drop = false;\n aggr.cross();\n }\n if (pulse.clean() && aggr._drop) {\n out.clean(true).runAfter(() => this.clean());\n }\n return aggr.changes(out);\n },\n cross() {\n const aggr = this,\n curr = aggr.value,\n dims = aggr._dnames,\n vals = dims.map(() => ({})),\n n = dims.length;\n\n // collect all group-by domain values\n function collect(cells) {\n let key, i, t, v;\n for (key in cells) {\n t = cells[key].tuple;\n for (i = 0; i < n; ++i) {\n vals[i][v = t[dims[i]]] = v;\n }\n }\n }\n collect(aggr._prev);\n collect(curr);\n\n // iterate over key cross-product, create cells as needed\n function generate(base, tuple, index) {\n const name = dims[index],\n v = vals[index++];\n for (const k in v) {\n const key = base ? base + '|' + k : k;\n tuple[name] = v[k];\n if (index < n) generate(key, tuple, index);else if (!curr[key]) aggr.cell(key, tuple);\n }\n }\n generate('', {}, 0);\n },\n init(_) {\n // initialize input and output fields\n const inputs = this._inputs = [],\n outputs = this._outputs = [],\n inputMap = {};\n function inputVisit(get) {\n const fields = array(accessorFields(get)),\n n = fields.length;\n let i = 0,\n f;\n for (; i < n; ++i) {\n if (!inputMap[f = fields[i]]) {\n inputMap[f] = 1;\n inputs.push(f);\n }\n }\n }\n\n // initialize group-by dimensions\n this._dims = array(_.groupby);\n this._dnames = this._dims.map(d => {\n const dname = accessorName(d);\n inputVisit(d);\n outputs.push(dname);\n return dname;\n });\n this.cellkey = _.key ? _.key : groupkey(this._dims);\n\n // initialize aggregate measures\n this._countOnly = true;\n this._counts = [];\n this._measures = [];\n const fields = _.fields || [null],\n ops = _.ops || ['count'],\n aggregate_params = _.aggregate_params || [null],\n as = _.as || [],\n n = fields.length,\n map = {};\n let field, op, aggregate_param, m, mname, outname, i;\n if (n !== ops.length) {\n error('Unmatched number of fields and aggregate ops.');\n }\n for (i = 0; i < n; ++i) {\n field = fields[i];\n op = ops[i];\n aggregate_param = aggregate_params[i] || null;\n if (field == null && op !== 'count') {\n error('Null aggregate field specified.');\n }\n mname = accessorName(field);\n outname = measureName(op, mname, as[i]);\n outputs.push(outname);\n if (op === 'count') {\n this._counts.push(outname);\n continue;\n }\n m = map[mname];\n if (!m) {\n inputVisit(field);\n m = map[mname] = [];\n m.field = field;\n this._measures.push(m);\n }\n if (op !== 'count') this._countOnly = false;\n m.push(createMeasure(op, aggregate_param, outname));\n }\n this._measures = this._measures.map(m => compileMeasures(m, m.field));\n return Object.create(null); // aggregation cells (this.value)\n },\n // -- Cell Management -----\n\n cellkey: groupkey(),\n cell(key, t) {\n let cell = this.value[key];\n if (!cell) {\n cell = this.value[key] = this.newcell(key, t);\n this._adds[this._alen++] = cell;\n } else if (cell.num === 0 && this._drop && cell.stamp < this.stamp) {\n cell.stamp = this.stamp;\n this._adds[this._alen++] = cell;\n } else if (cell.stamp < this.stamp) {\n cell.stamp = this.stamp;\n this._mods[this._mlen++] = cell;\n }\n return cell;\n },\n newcell(key, t) {\n const cell = {\n key: key,\n num: 0,\n agg: null,\n tuple: this.newtuple(t, this._prev && this._prev[key]),\n stamp: this.stamp,\n store: false\n };\n if (!this._countOnly) {\n const measures = this._measures,\n n = measures.length;\n cell.agg = Array(n);\n for (let i = 0; i < n; ++i) {\n cell.agg[i] = new measures[i](cell);\n }\n }\n if (cell.store) {\n cell.data = new TupleStore();\n }\n return cell;\n },\n newtuple(t, p) {\n const names = this._dnames,\n dims = this._dims,\n n = dims.length,\n x = {};\n for (let i = 0; i < n; ++i) {\n x[names[i]] = dims[i](t);\n }\n return p ? replace(p.tuple, x) : ingest(x);\n },\n clean() {\n const cells = this.value;\n for (const key in cells) {\n if (cells[key].num === 0) {\n delete cells[key];\n }\n }\n },\n // -- Process Tuples -----\n\n add(t) {\n const key = this.cellkey(t),\n cell = this.cell(key, t);\n cell.num += 1;\n if (this._countOnly) return;\n if (cell.store) cell.data.add(t);\n const agg = cell.agg;\n for (let i = 0, n = agg.length; i < n; ++i) {\n agg[i].add(agg[i].get(t), t);\n }\n },\n rem(t) {\n const key = this.cellkey(t),\n cell = this.cell(key, t);\n cell.num -= 1;\n if (this._countOnly) return;\n if (cell.store) cell.data.rem(t);\n const agg = cell.agg;\n for (let i = 0, n = agg.length; i < n; ++i) {\n agg[i].rem(agg[i].get(t), t);\n }\n },\n celltuple(cell) {\n const tuple = cell.tuple,\n counts = this._counts;\n\n // consolidate stored values\n if (cell.store) {\n cell.data.values();\n }\n\n // update tuple properties\n for (let i = 0, n = counts.length; i < n; ++i) {\n tuple[counts[i]] = cell.num;\n }\n if (!this._countOnly) {\n const agg = cell.agg;\n for (let i = 0, n = agg.length; i < n; ++i) {\n agg[i].set(tuple);\n }\n }\n return tuple;\n },\n changes(out) {\n const adds = this._adds,\n mods = this._mods,\n prev = this._prev,\n drop = this._drop,\n add = out.add,\n rem = out.rem,\n mod = out.mod;\n let cell, key, i, n;\n if (prev) for (key in prev) {\n cell = prev[key];\n if (!drop || cell.num) rem.push(cell.tuple);\n }\n for (i = 0, n = this._alen; i < n; ++i) {\n add.push(this.celltuple(adds[i]));\n adds[i] = null; // for garbage collection\n }\n for (i = 0, n = this._mlen; i < n; ++i) {\n cell = mods[i];\n (cell.num === 0 && drop ? rem : mod).push(this.celltuple(cell));\n mods[i] = null; // for garbage collection\n }\n this._alen = this._mlen = 0; // reset list of active cells\n this._prev = null;\n return out;\n }\n});\n\n// epsilon bias to offset floating point error (#1737)\nconst EPSILON$1 = 1e-14;\n\n/**\n * Generates a binning function for discretizing data.\n * @constructor\n * @param {object} params - The parameters for this operator. The\n * provided values should be valid options for the {@link bin} function.\n * @param {function(object): *} params.field - The data field to bin.\n */\nfunction Bin(params) {\n Transform.call(this, null, params);\n}\nBin.Definition = {\n 'type': 'Bin',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'interval',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'anchor',\n 'type': 'number'\n }, {\n 'name': 'maxbins',\n 'type': 'number',\n 'default': 20\n }, {\n 'name': 'base',\n 'type': 'number',\n 'default': 10\n }, {\n 'name': 'divide',\n 'type': 'number',\n 'array': true,\n 'default': [5, 2]\n }, {\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'required': true\n }, {\n 'name': 'span',\n 'type': 'number'\n }, {\n 'name': 'step',\n 'type': 'number'\n }, {\n 'name': 'steps',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'minstep',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'nice',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'name',\n 'type': 'string'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['bin0', 'bin1']\n }]\n};\ninherits(Bin, Transform, {\n transform(_, pulse) {\n const band = _.interval !== false,\n bins = this._bins(_),\n start = bins.start,\n step = bins.step,\n as = _.as || ['bin0', 'bin1'],\n b0 = as[0],\n b1 = as[1];\n let flag;\n if (_.modified()) {\n pulse = pulse.reflow(true);\n flag = pulse.SOURCE;\n } else {\n flag = pulse.modified(accessorFields(_.field)) ? pulse.ADD_MOD : pulse.ADD;\n }\n pulse.visit(flag, band ? t => {\n const v = bins(t);\n // minimum bin value (inclusive)\n t[b0] = v;\n // maximum bin value (exclusive)\n // use convoluted math for better floating point agreement\n // see https://github.com/vega/vega/issues/830\n // infinite values propagate through this formula! #2227\n t[b1] = v == null ? null : start + step * (1 + (v - start) / step);\n } : t => t[b0] = bins(t));\n return pulse.modifies(band ? as : b0);\n },\n _bins(_) {\n if (this.value && !_.modified()) {\n return this.value;\n }\n const field = _.field,\n bins = bin(_),\n step = bins.step;\n let start = bins.start,\n stop = start + Math.ceil((bins.stop - start) / step) * step,\n a,\n d;\n if ((a = _.anchor) != null) {\n d = a - (start + step * Math.floor((a - start) / step));\n start += d;\n stop += d;\n }\n const f = function (t) {\n let v = toNumber(field(t));\n return v == null ? null : v < start ? -Infinity : v > stop ? +Infinity : (v = Math.max(start, Math.min(v, stop - step)), start + step * Math.floor(EPSILON$1 + (v - start) / step));\n };\n f.start = start;\n f.stop = bins.stop;\n f.step = step;\n return this.value = accessor(f, accessorFields(field), _.name || 'bin_' + accessorName(field));\n }\n});\n\nfunction SortedList (idFunc, source, input) {\n const $ = idFunc;\n let data = source || [],\n add = input || [],\n rem = {},\n cnt = 0;\n return {\n add: t => add.push(t),\n remove: t => rem[$(t)] = ++cnt,\n size: () => data.length,\n data: (compare, resort) => {\n if (cnt) {\n data = data.filter(t => !rem[$(t)]);\n rem = {};\n cnt = 0;\n }\n if (resort && compare) {\n data.sort(compare);\n }\n if (add.length) {\n data = compare ? merge(compare, data, add.sort(compare)) : data.concat(add);\n add = [];\n }\n return data;\n }\n };\n}\n\n/**\n * Collects all data tuples that pass through this operator.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - An optional\n * comparator function for additionally sorting the collected tuples.\n */\nfunction Collect(params) {\n Transform.call(this, [], params);\n}\nCollect.Definition = {\n 'type': 'Collect',\n 'metadata': {\n 'source': true\n },\n 'params': [{\n 'name': 'sort',\n 'type': 'compare'\n }]\n};\ninherits(Collect, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.ALL),\n list = SortedList(tupleid, this.value, out.materialize(out.ADD).add),\n sort = _.sort,\n mod = pulse.changed() || sort && (_.modified('sort') || pulse.modified(sort.fields));\n out.visit(out.REM, list.remove);\n this.modified(mod);\n this.value = out.source = list.data(stableCompare(sort), mod);\n\n // propagate tree root if defined\n if (pulse.source && pulse.source.root) {\n this.value.root = pulse.source.root;\n }\n return out;\n }\n});\n\n/**\n * Generates a comparator function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - The fields to compare.\n * @param {Array} [params.orders] - The sort orders.\n * Each entry should be one of \"ascending\" (default) or \"descending\".\n */\nfunction Compare(params) {\n Operator.call(this, null, update$5, params);\n}\ninherits(Compare, Operator);\nfunction update$5(_) {\n return this.value && !_.modified() ? this.value : compare(_.fields, _.orders);\n}\n\n/**\n * Count regexp-defined pattern occurrences in a text field.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - An accessor for the text field.\n * @param {string} [params.pattern] - RegExp string defining the text pattern.\n * @param {string} [params.case] - One of 'lower', 'upper' or null (mixed) case.\n * @param {string} [params.stopwords] - RegExp string of words to ignore.\n */\nfunction CountPattern(params) {\n Transform.call(this, null, params);\n}\nCountPattern.Definition = {\n 'type': 'CountPattern',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'case',\n 'type': 'enum',\n 'values': ['upper', 'lower', 'mixed'],\n 'default': 'mixed'\n }, {\n 'name': 'pattern',\n 'type': 'string',\n 'default': '[\\\\w\"]+'\n }, {\n 'name': 'stopwords',\n 'type': 'string',\n 'default': ''\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['text', 'count']\n }]\n};\nfunction tokenize(text, tcase, match) {\n switch (tcase) {\n case 'upper':\n text = text.toUpperCase();\n break;\n case 'lower':\n text = text.toLowerCase();\n break;\n }\n return text.match(match);\n}\ninherits(CountPattern, Transform, {\n transform(_, pulse) {\n const process = update => tuple => {\n var tokens = tokenize(get(tuple), _.case, match) || [],\n t;\n for (var i = 0, n = tokens.length; i < n; ++i) {\n if (!stop.test(t = tokens[i])) update(t);\n }\n };\n const init = this._parameterCheck(_, pulse),\n counts = this._counts,\n match = this._match,\n stop = this._stop,\n get = _.field,\n as = _.as || ['text', 'count'],\n add = process(t => counts[t] = 1 + (counts[t] || 0)),\n rem = process(t => counts[t] -= 1);\n if (init) {\n pulse.visit(pulse.SOURCE, add);\n } else {\n pulse.visit(pulse.ADD, add);\n pulse.visit(pulse.REM, rem);\n }\n return this._finish(pulse, as); // generate output tuples\n },\n _parameterCheck(_, pulse) {\n let init = false;\n if (_.modified('stopwords') || !this._stop) {\n this._stop = new RegExp('^' + (_.stopwords || '') + '$', 'i');\n init = true;\n }\n if (_.modified('pattern') || !this._match) {\n this._match = new RegExp(_.pattern || '[\\\\w\\']+', 'g');\n init = true;\n }\n if (_.modified('field') || pulse.modified(_.field.fields)) {\n init = true;\n }\n if (init) this._counts = {};\n return init;\n },\n _finish(pulse, as) {\n const counts = this._counts,\n tuples = this._tuples || (this._tuples = {}),\n text = as[0],\n count = as[1],\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n let w, t, c;\n for (w in counts) {\n t = tuples[w];\n c = counts[w] || 0;\n if (!t && c) {\n tuples[w] = t = ingest({});\n t[text] = w;\n t[count] = c;\n out.add.push(t);\n } else if (c === 0) {\n if (t) out.rem.push(t);\n counts[w] = null;\n tuples[w] = null;\n } else if (t[count] !== c) {\n t[count] = c;\n out.mod.push(t);\n }\n }\n return out.modifies(as);\n }\n});\n\n/**\n * Perform a cross-product of a tuple stream with itself.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object):boolean} [params.filter] - An optional filter\n * function for selectively including tuples in the cross product.\n * @param {Array} [params.as] - The names of the output fields.\n */\nfunction Cross(params) {\n Transform.call(this, null, params);\n}\nCross.Definition = {\n 'type': 'Cross',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'filter',\n 'type': 'expr'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['a', 'b']\n }]\n};\ninherits(Cross, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n as = _.as || ['a', 'b'],\n a = as[0],\n b = as[1],\n reset = !this.value || pulse.changed(pulse.ADD_REM) || _.modified('as') || _.modified('filter');\n let data = this.value;\n if (reset) {\n if (data) out.rem = data;\n data = pulse.materialize(pulse.SOURCE).source;\n out.add = this.value = cross(data, a, b, _.filter || truthy);\n } else {\n out.mod = data;\n }\n out.source = this.value;\n return out.modifies(as);\n }\n});\nfunction cross(input, a, b, filter) {\n var data = [],\n t = {},\n n = input.length,\n i = 0,\n j,\n left;\n for (; i < n; ++i) {\n t[a] = left = input[i];\n for (j = 0; j < n; ++j) {\n t[b] = input[j];\n if (filter(t)) {\n data.push(ingest(t));\n t = {};\n t[a] = left;\n }\n }\n }\n return data;\n}\n\nconst Distributions = {\n kde: randomKDE,\n mixture: randomMixture,\n normal: randomNormal,\n lognormal: randomLogNormal,\n uniform: randomUniform\n};\nconst DISTRIBUTIONS = 'distributions',\n FUNCTION = 'function',\n FIELD = 'field';\n\n/**\n * Parse a parameter object for a probability distribution.\n * @param {object} def - The distribution parameter object.\n * @param {function():Array} - A method for requesting\n * source data. Used for distributions (such as KDE) that\n * require sample data points. This method will only be\n * invoked if the 'from' parameter for a target data source\n * is not provided. Typically this method returns backing\n * source data for a Pulse object.\n * @return {object} - The output distribution object.\n */\nfunction parse(def, data) {\n const func = def[FUNCTION];\n if (!hasOwnProperty(Distributions, func)) {\n error('Unknown distribution function: ' + func);\n }\n const d = Distributions[func]();\n for (const name in def) {\n // if data field, extract values\n if (name === FIELD) {\n d.data((def.from || data()).map(def[name]));\n }\n\n // if distribution mixture, recurse to parse each definition\n else if (name === DISTRIBUTIONS) {\n d[name](def[name].map(_ => parse(_, data)));\n }\n\n // otherwise, simply set the parameter\n else if (typeof d[name] === FUNCTION) {\n d[name](def[name]);\n }\n }\n return d;\n}\n\n/**\n * Grid sample points for a probability density. Given a distribution and\n * a sampling extent, will generate points suitable for plotting either\n * PDF (probability density function) or CDF (cumulative distribution\n * function) curves.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.distribution - The probability distribution. This\n * is an object parameter dependent on the distribution type.\n * @param {string} [params.method='pdf'] - The distribution method to sample.\n * One of 'pdf' or 'cdf'.\n * @param {Array} [params.extent] - The [min, max] extent over which\n * to sample the distribution. This argument is required in most cases, but\n * can be omitted if the distribution (e.g., 'kde') supports a 'data' method\n * that returns numerical sample points from which the extent can be deduced.\n * @param {number} [params.minsteps=25] - The minimum number of curve samples\n * for plotting the density.\n * @param {number} [params.maxsteps=200] - The maximum number of curve samples\n * for plotting the density.\n * @param {number} [params.steps] - The exact number of curve samples for\n * plotting the density. If specified, overrides both minsteps and maxsteps\n * to set an exact number of uniform samples. Useful in conjunction with\n * a fixed extent to ensure consistent sample points for stacked densities.\n */\nfunction Density(params) {\n Transform.call(this, null, params);\n}\nconst distributions = [{\n 'key': {\n 'function': 'normal'\n },\n 'params': [{\n 'name': 'mean',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'stdev',\n 'type': 'number',\n 'default': 1\n }]\n}, {\n 'key': {\n 'function': 'lognormal'\n },\n 'params': [{\n 'name': 'mean',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'stdev',\n 'type': 'number',\n 'default': 1\n }]\n}, {\n 'key': {\n 'function': 'uniform'\n },\n 'params': [{\n 'name': 'min',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'max',\n 'type': 'number',\n 'default': 1\n }]\n}, {\n 'key': {\n 'function': 'kde'\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'from',\n 'type': 'data'\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'default': 0\n }]\n}];\nconst mixture = {\n 'key': {\n 'function': 'mixture'\n },\n 'params': [{\n 'name': 'distributions',\n 'type': 'param',\n 'array': true,\n 'params': distributions\n }, {\n 'name': 'weights',\n 'type': 'number',\n 'array': true\n }]\n};\nDensity.Definition = {\n 'type': 'Density',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'steps',\n 'type': 'number'\n }, {\n 'name': 'minsteps',\n 'type': 'number',\n 'default': 25\n }, {\n 'name': 'maxsteps',\n 'type': 'number',\n 'default': 200\n }, {\n 'name': 'method',\n 'type': 'string',\n 'default': 'pdf',\n 'values': ['pdf', 'cdf']\n }, {\n 'name': 'distribution',\n 'type': 'param',\n 'params': distributions.concat(mixture)\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'default': ['value', 'density']\n }]\n};\ninherits(Density, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n if (!this.value || pulse.changed() || _.modified()) {\n const dist = parse(_.distribution, source(pulse)),\n minsteps = _.steps || _.minsteps || 25,\n maxsteps = _.steps || _.maxsteps || 200;\n let method = _.method || 'pdf';\n if (method !== 'pdf' && method !== 'cdf') {\n error('Invalid density method: ' + method);\n }\n if (!_.extent && !dist.data) {\n error('Missing density extent parameter.');\n }\n method = dist[method];\n const as = _.as || ['value', 'density'],\n domain = _.extent || extent(dist.data()),\n values = sampleCurve(method, domain, minsteps, maxsteps).map(v => {\n const tuple = {};\n tuple[as[0]] = v[0];\n tuple[as[1]] = v[1];\n return ingest(tuple);\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n return out;\n }\n});\nfunction source(pulse) {\n return () => pulse.materialize(pulse.SOURCE).source;\n}\n\n// use either provided alias or accessor field name\nfunction fieldNames(fields, as) {\n if (!fields) return null;\n return fields.map((f, i) => as[i] || accessorName(f));\n}\nfunction partition$1(data, groupby, field) {\n const groups = [],\n get = f => f(t);\n let map, i, n, t, k, g;\n\n // partition data points into groups\n if (groupby == null) {\n groups.push(data.map(field));\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n if (!g) {\n map[k] = g = [];\n g.dims = k;\n groups.push(g);\n }\n g.push(field(t));\n }\n }\n return groups;\n}\n\nconst Output = 'bin';\n\n/**\n * Dot density binning for dot plot construction.\n * Based on Leland Wilkinson, Dot Plots, The American Statistician, 1999.\n * https://www.cs.uic.edu/~wilkinson/Publications/dotplots.pdf\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to bin.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {number} [params.step] - The step size (bin width) within which dots should be\n * stacked. Defaults to 1/30 of the extent of the data *field*.\n * @param {boolean} [params.smooth=false] - A boolean flag indicating if dot density\n * stacks should be smoothed to reduce variance.\n */\nfunction DotBin(params) {\n Transform.call(this, null, params);\n}\nDotBin.Definition = {\n 'type': 'DotBin',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'step',\n 'type': 'number'\n }, {\n 'name': 'smooth',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': Output\n }]\n};\nconst autostep = (data, field) => span(extent(data, field)) / 30;\ninherits(DotBin, Transform, {\n transform(_, pulse) {\n if (this.value && !(_.modified() || pulse.changed())) {\n return pulse; // early exit\n }\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition$1(pulse.source, _.groupby, identity),\n smooth = _.smooth || false,\n field = _.field,\n step = _.step || autostep(source, field),\n sort = stableCompare((a, b) => field(a) - field(b)),\n as = _.as || Output,\n n = groups.length;\n\n // compute dotplot bins per group\n let min = Infinity,\n max = -Infinity,\n i = 0,\n j;\n for (; i < n; ++i) {\n const g = groups[i].sort(sort);\n j = -1;\n for (const v of dotbin(g, step, smooth, field)) {\n if (v < min) min = v;\n if (v > max) max = v;\n g[++j][as] = v;\n }\n }\n this.value = {\n start: min,\n stop: max,\n step: step\n };\n return pulse.reflow(true).modifies(as);\n }\n});\n\n/**\n * Wraps an expression function with access to external parameters.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function} params.expr - The expression function. The\n * function should accept both a datum and a parameter object.\n * This operator's value will be a new function that wraps the\n * expression function with access to this operator's parameters.\n */\nfunction Expression(params) {\n Operator.call(this, null, update$4, params);\n this.modified(true);\n}\ninherits(Expression, Operator);\nfunction update$4(_) {\n const expr = _.expr;\n return this.value && !_.modified('expr') ? this.value : accessor(datum => expr(datum, _), accessorFields(expr), accessorName(expr));\n}\n\n/**\n * Computes extents (min/max) for a data field.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The field over which to compute extends.\n */\nfunction Extent(params) {\n Transform.call(this, [undefined, undefined], params);\n}\nExtent.Definition = {\n 'type': 'Extent',\n 'metadata': {},\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }]\n};\ninherits(Extent, Transform, {\n transform(_, pulse) {\n const extent = this.value,\n field = _.field,\n mod = pulse.changed() || pulse.modified(field.fields) || _.modified('field');\n let min = extent[0],\n max = extent[1];\n if (mod || min == null) {\n min = +Infinity;\n max = -Infinity;\n }\n pulse.visit(mod ? pulse.SOURCE : pulse.ADD, t => {\n const v = toNumber(field(t));\n if (v != null) {\n // NaNs will fail all comparisons!\n if (v < min) min = v;\n if (v > max) max = v;\n }\n });\n if (!Number.isFinite(min) || !Number.isFinite(max)) {\n let name = accessorName(field);\n if (name) name = ` for field \"${name}\"`;\n pulse.dataflow.warn(`Infinite extent${name}: [${min}, ${max}]`);\n min = max = undefined;\n }\n this.value = [min, max];\n }\n});\n\n/**\n * Provides a bridge between a parent transform and a target subflow that\n * consumes only a subset of the tuples that pass through the parent.\n * @constructor\n * @param {Pulse} pulse - A pulse to use as the value of this operator.\n * @param {Transform} parent - The parent transform (typically a Facet instance).\n */\nfunction Subflow(pulse, parent) {\n Operator.call(this, pulse);\n this.parent = parent;\n this.count = 0;\n}\ninherits(Subflow, Operator, {\n /**\n * Routes pulses from this subflow to a target transform.\n * @param {Transform} target - A transform that receives the subflow of tuples.\n */\n connect(target) {\n this.detachSubflow = target.detachSubflow;\n this.targets().add(target);\n return target.source = this;\n },\n /**\n * Add an 'add' tuple to the subflow pulse.\n * @param {Tuple} t - The tuple being added.\n */\n add(t) {\n this.count += 1;\n this.value.add.push(t);\n },\n /**\n * Add a 'rem' tuple to the subflow pulse.\n * @param {Tuple} t - The tuple being removed.\n */\n rem(t) {\n this.count -= 1;\n this.value.rem.push(t);\n },\n /**\n * Add a 'mod' tuple to the subflow pulse.\n * @param {Tuple} t - The tuple being modified.\n */\n mod(t) {\n this.value.mod.push(t);\n },\n /**\n * Re-initialize this operator's pulse value.\n * @param {Pulse} pulse - The pulse to copy from.\n * @see Pulse.init\n */\n init(pulse) {\n this.value.init(pulse, pulse.NO_SOURCE);\n },\n /**\n * Evaluate this operator. This method overrides the\n * default behavior to simply return the contained pulse value.\n * @return {Pulse}\n */\n evaluate() {\n // assert: this.value.stamp === pulse.stamp\n return this.value;\n }\n});\n\n/**\n * Facets a dataflow into a set of subflows based on a key.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(Dataflow, string): Operator} params.subflow - A function\n * that generates a subflow of operators and returns its root operator.\n * @param {function(object): *} params.key - The key field to facet by.\n */\nfunction Facet(params) {\n Transform.call(this, {}, params);\n this._keys = fastmap(); // cache previously calculated key values\n\n // keep track of active subflows, use as targets array for listeners\n // this allows us to limit propagation to only updated subflows\n const a = this._targets = [];\n a.active = 0;\n a.forEach = f => {\n for (let i = 0, n = a.active; i < n; ++i) {\n f(a[i], i, a);\n }\n };\n}\ninherits(Facet, Transform, {\n activate(flow) {\n this._targets[this._targets.active++] = flow;\n },\n // parent argument provided by PreFacet subclass\n subflow(key, flow, pulse, parent) {\n const flows = this.value;\n let sf = hasOwnProperty(flows, key) && flows[key],\n df,\n p;\n if (!sf) {\n p = parent || (p = this._group[key]) && p.tuple;\n df = pulse.dataflow;\n sf = new Subflow(pulse.fork(pulse.NO_SOURCE), this);\n df.add(sf).connect(flow(df, key, p));\n flows[key] = sf;\n this.activate(sf);\n } else if (sf.value.stamp < pulse.stamp) {\n sf.init(pulse);\n this.activate(sf);\n }\n return sf;\n },\n clean() {\n const flows = this.value;\n let detached = 0;\n for (const key in flows) {\n if (flows[key].count === 0) {\n const detach = flows[key].detachSubflow;\n if (detach) detach();\n delete flows[key];\n ++detached;\n }\n }\n\n // remove inactive targets from the active targets array\n if (detached) {\n const active = this._targets.filter(sf => sf && sf.count > 0);\n this.initTargets(active);\n }\n },\n initTargets(act) {\n const a = this._targets,\n n = a.length,\n m = act ? act.length : 0;\n let i = 0;\n for (; i < m; ++i) {\n a[i] = act[i];\n }\n for (; i < n && a[i] != null; ++i) {\n a[i] = null; // ensure old flows can be garbage collected\n }\n a.active = m;\n },\n transform(_, pulse) {\n const df = pulse.dataflow,\n key = _.key,\n flow = _.subflow,\n cache = this._keys,\n rekey = _.modified('key'),\n subflow = key => this.subflow(key, flow, pulse);\n this._group = _.group || {};\n this.initTargets(); // reset list of active subflows\n\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t),\n k = cache.get(id);\n if (k !== undefined) {\n cache.delete(id);\n subflow(k).rem(t);\n }\n });\n pulse.visit(pulse.ADD, t => {\n const k = key(t);\n cache.set(tupleid(t), k);\n subflow(k).add(t);\n });\n if (rekey || pulse.modified(key.fields)) {\n pulse.visit(pulse.MOD, t => {\n const id = tupleid(t),\n k0 = cache.get(id),\n k1 = key(t);\n if (k0 === k1) {\n subflow(k1).mod(t);\n } else {\n cache.set(id, k1);\n subflow(k0).rem(t);\n subflow(k1).add(t);\n }\n });\n } else if (pulse.changed(pulse.MOD)) {\n pulse.visit(pulse.MOD, t => {\n subflow(cache.get(tupleid(t))).mod(t);\n });\n }\n if (rekey) {\n pulse.visit(pulse.REFLOW, t => {\n const id = tupleid(t),\n k0 = cache.get(id),\n k1 = key(t);\n if (k0 !== k1) {\n cache.set(id, k1);\n subflow(k0).rem(t);\n subflow(k1).add(t);\n }\n });\n }\n if (pulse.clean()) {\n df.runAfter(() => {\n this.clean();\n cache.clean();\n });\n } else if (cache.empty > df.cleanThreshold) {\n df.runAfter(cache.clean);\n }\n return pulse;\n }\n});\n\n/**\n * Generates one or more field accessor functions.\n * If the 'name' parameter is an array, an array of field accessors\n * will be created and the 'as' parameter will be ignored.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {string} params.name - The field name(s) to access.\n * @param {string} params.as - The accessor function name.\n */\nfunction Field(params) {\n Operator.call(this, null, update$3, params);\n}\ninherits(Field, Operator);\nfunction update$3(_) {\n return this.value && !_.modified() ? this.value : isArray(_.name) ? array(_.name).map(f => field(f)) : field(_.name, _.as);\n}\n\n/**\n * Filters data tuples according to a predicate function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.expr - The predicate expression function\n * that determines a tuple's filter status. Truthy values pass the filter.\n */\nfunction Filter(params) {\n Transform.call(this, fastmap(), params);\n}\nFilter.Definition = {\n 'type': 'Filter',\n 'metadata': {\n 'changes': true\n },\n 'params': [{\n 'name': 'expr',\n 'type': 'expr',\n 'required': true\n }]\n};\ninherits(Filter, Transform, {\n transform(_, pulse) {\n const df = pulse.dataflow,\n cache = this.value,\n // cache ids of filtered tuples\n output = pulse.fork(),\n add = output.add,\n rem = output.rem,\n mod = output.mod,\n test = _.expr;\n let isMod = true;\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n if (!cache.has(id)) rem.push(t);else cache.delete(id);\n });\n pulse.visit(pulse.ADD, t => {\n if (test(t, _)) add.push(t);else cache.set(tupleid(t), 1);\n });\n function revisit(t) {\n const id = tupleid(t),\n b = test(t, _),\n s = cache.get(id);\n if (b && s) {\n cache.delete(id);\n add.push(t);\n } else if (!b && !s) {\n cache.set(id, 1);\n rem.push(t);\n } else if (isMod && b && !s) {\n mod.push(t);\n }\n }\n pulse.visit(pulse.MOD, revisit);\n if (_.modified()) {\n isMod = false;\n pulse.visit(pulse.REFLOW, revisit);\n }\n if (cache.empty > df.cleanThreshold) df.runAfter(cache.clean);\n return output;\n }\n});\n\n/**\n * Flattens array-typed field values into new data objects.\n * If multiple fields are specified, they are treated as parallel arrays,\n * with output values included for each matching index (or null if missing).\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - An array of field\n * accessors for the tuple fields that should be flattened.\n * @param {string} [params.index] - Optional output field name for index\n * value. If unspecified, no index field is included in the output.\n * @param {Array} [params.as] - Output field names for flattened\n * array fields. Any unspecified fields will use the field name provided\n * by the fields accessors.\n */\nfunction Flatten(params) {\n Transform.call(this, [], params);\n}\nFlatten.Definition = {\n 'type': 'Flatten',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'index',\n 'type': 'string'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }]\n};\ninherits(Flatten, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n fields = _.fields,\n as = fieldNames(fields, _.as || []),\n index = _.index || null,\n m = as.length;\n\n // remove any previous results\n out.rem = this.value;\n\n // generate flattened tuples\n pulse.visit(pulse.SOURCE, t => {\n const arrays = fields.map(f => f(t)),\n maxlen = arrays.reduce((l, a) => Math.max(l, a.length), 0);\n let i = 0,\n j,\n d,\n v;\n for (; i < maxlen; ++i) {\n d = derive(t);\n for (j = 0; j < m; ++j) {\n d[as[j]] = (v = arrays[j][i]) == null ? null : v;\n }\n if (index) {\n d[index] = i;\n }\n out.add.push(d);\n }\n });\n this.value = out.source = out.add;\n if (index) out.modifies(index);\n return out.modifies(as);\n }\n});\n\n/**\n * Folds one more tuple fields into multiple tuples in which the field\n * name and values are available under new 'key' and 'value' fields.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.fields - An array of field accessors\n * for the tuple fields that should be folded.\n * @param {Array} [params.as] - Output field names for folded key\n * and value fields, defaults to ['key', 'value'].\n */\nfunction Fold(params) {\n Transform.call(this, [], params);\n}\nFold.Definition = {\n 'type': 'Fold',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['key', 'value']\n }]\n};\ninherits(Fold, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n fields = _.fields,\n fnames = fields.map(accessorName),\n as = _.as || ['key', 'value'],\n k = as[0],\n v = as[1],\n n = fields.length;\n out.rem = this.value;\n pulse.visit(pulse.SOURCE, t => {\n for (let i = 0, d; i < n; ++i) {\n d = derive(t);\n d[k] = fnames[i];\n d[v] = fields[i](t);\n out.add.push(d);\n }\n });\n this.value = out.source = out.add;\n return out.modifies(as);\n }\n});\n\n/**\n * Invokes a function for each data tuple and saves the results as a new field.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.expr - The formula function to invoke for each tuple.\n * @param {string} params.as - The field name under which to save the result.\n * @param {boolean} [params.initonly=false] - If true, the formula is applied to\n * added tuples only, and does not update in response to modifications.\n */\nfunction Formula(params) {\n Transform.call(this, null, params);\n}\nFormula.Definition = {\n 'type': 'Formula',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'expr',\n 'type': 'expr',\n 'required': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'required': true\n }, {\n 'name': 'initonly',\n 'type': 'boolean'\n }]\n};\ninherits(Formula, Transform, {\n transform(_, pulse) {\n const func = _.expr,\n as = _.as,\n mod = _.modified(),\n flag = _.initonly ? pulse.ADD : mod ? pulse.SOURCE : pulse.modified(func.fields) || pulse.modified(as) ? pulse.ADD_MOD : pulse.ADD;\n if (mod) {\n // parameters updated, need to reflow\n pulse = pulse.materialize().reflow(true);\n }\n if (!_.initonly) {\n pulse.modifies(as);\n }\n return pulse.visit(flag, t => t[as] = func(t, _));\n }\n});\n\n/**\n * Generates data tuples using a provided generator function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(Parameters): object} params.generator - A tuple generator\n * function. This function is given the operator parameters as input.\n * Changes to any additional parameters will not trigger re-calculation\n * of previously generated tuples. Only future tuples are affected.\n * @param {number} params.size - The number of tuples to produce.\n */\nfunction Generate(params) {\n Transform.call(this, [], params);\n}\ninherits(Generate, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.ALL),\n gen = _.generator;\n let data = this.value,\n num = _.size - data.length,\n add,\n rem,\n t;\n if (num > 0) {\n // need more tuples, generate and add\n for (add = []; --num >= 0;) {\n add.push(t = ingest(gen(_)));\n data.push(t);\n }\n out.add = out.add.length ? out.materialize(out.ADD).add.concat(add) : add;\n } else {\n // need fewer tuples, remove\n rem = data.slice(0, -num);\n out.rem = out.rem.length ? out.materialize(out.REM).rem.concat(rem) : rem;\n data = data.slice(-num);\n }\n out.source = this.value = data;\n return out;\n }\n});\n\nconst Methods = {\n value: 'value',\n median: median,\n mean: mean,\n min: min,\n max: max\n};\nconst Empty = [];\n\n/**\n * Impute missing values.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to impute.\n * @param {Array} [params.groupby] - An array of\n * accessors to determine series within which to perform imputation.\n * @param {function(object): *} params.key - An accessor for a key value.\n * Each key value should be unique within a group. New tuples will be\n * imputed for any key values that are not found within a group.\n * @param {Array<*>} [params.keyvals] - Optional array of required key\n * values. New tuples will be imputed for any key values that are not\n * found within a group. In addition, these values will be automatically\n * augmented with the key values observed in the input data.\n * @param {string} [method='value'] - The imputation method to use. One of\n * 'value', 'mean', 'median', 'max', 'min'.\n * @param {*} [value=0] - The constant value to use for imputation\n * when using method 'value'.\n */\nfunction Impute(params) {\n Transform.call(this, [], params);\n}\nImpute.Definition = {\n 'type': 'Impute',\n 'metadata': {\n 'changes': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'key',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'keyvals',\n 'array': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'method',\n 'type': 'enum',\n 'default': 'value',\n 'values': ['value', 'mean', 'median', 'max', 'min']\n }, {\n 'name': 'value',\n 'default': 0\n }]\n};\nfunction getValue(_) {\n var m = _.method || Methods.value,\n v;\n if (Methods[m] == null) {\n error('Unrecognized imputation method: ' + m);\n } else if (m === Methods.value) {\n v = _.value !== undefined ? _.value : 0;\n return () => v;\n } else {\n return Methods[m];\n }\n}\nfunction getField(_) {\n const f = _.field;\n return t => t ? f(t) : NaN;\n}\ninherits(Impute, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ALL),\n impute = getValue(_),\n field = getField(_),\n fName = accessorName(_.field),\n kName = accessorName(_.key),\n gNames = (_.groupby || []).map(accessorName),\n groups = partition(pulse.source, _.groupby, _.key, _.keyvals),\n curr = [],\n prev = this.value,\n m = groups.domain.length,\n group,\n value,\n gVals,\n kVal,\n g,\n i,\n j,\n l,\n n,\n t;\n for (g = 0, l = groups.length; g < l; ++g) {\n group = groups[g];\n gVals = group.values;\n value = NaN;\n\n // add tuples for missing values\n for (j = 0; j < m; ++j) {\n if (group[j] != null) continue;\n kVal = groups.domain[j];\n t = {\n _impute: true\n };\n for (i = 0, n = gVals.length; i < n; ++i) t[gNames[i]] = gVals[i];\n t[kName] = kVal;\n t[fName] = Number.isNaN(value) ? value = impute(group, field) : value;\n curr.push(ingest(t));\n }\n }\n\n // update pulse with imputed tuples\n if (curr.length) out.add = out.materialize(out.ADD).add.concat(curr);\n if (prev.length) out.rem = out.materialize(out.REM).rem.concat(prev);\n this.value = curr;\n return out;\n }\n});\nfunction partition(data, groupby, key, keyvals) {\n var get = f => f(t),\n groups = [],\n domain = keyvals ? keyvals.slice() : [],\n kMap = {},\n gMap = {},\n gVals,\n gKey,\n group,\n i,\n j,\n k,\n n,\n t;\n domain.forEach((k, i) => kMap[k] = i + 1);\n for (i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = key(t);\n j = kMap[k] || (kMap[k] = domain.push(k));\n gKey = (gVals = groupby ? groupby.map(get) : Empty) + '';\n if (!(group = gMap[gKey])) {\n group = gMap[gKey] = [];\n groups.push(group);\n group.values = gVals;\n }\n group[j - 1] = t;\n }\n groups.domain = domain;\n return groups;\n}\n\n/**\n * Extend input tuples with aggregate values.\n * Calcuates aggregate values and joins them with the input stream.\n * @constructor\n */\nfunction JoinAggregate(params) {\n Aggregate.call(this, params);\n}\nJoinAggregate.Definition = {\n 'type': 'JoinAggregate',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'null': true,\n 'array': true\n }, {\n 'name': 'ops',\n 'type': 'enum',\n 'array': true,\n 'values': ValidAggregateOps\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }, {\n 'name': 'key',\n 'type': 'field'\n }]\n};\ninherits(JoinAggregate, Aggregate, {\n transform(_, pulse) {\n const aggr = this,\n mod = _.modified();\n let cells;\n\n // process all input tuples to calculate aggregates\n if (aggr.value && (mod || pulse.modified(aggr._inputs, true))) {\n cells = aggr.value = mod ? aggr.init(_) : {};\n pulse.visit(pulse.SOURCE, t => aggr.add(t));\n } else {\n cells = aggr.value = aggr.value || this.init(_);\n pulse.visit(pulse.REM, t => aggr.rem(t));\n pulse.visit(pulse.ADD, t => aggr.add(t));\n }\n\n // update aggregation cells\n aggr.changes();\n\n // write aggregate values to input tuples\n pulse.visit(pulse.SOURCE, t => {\n extend(t, cells[aggr.cellkey(t)].tuple);\n });\n return pulse.reflow(mod).modifies(this._outputs);\n },\n changes() {\n const adds = this._adds,\n mods = this._mods;\n let i, n;\n for (i = 0, n = this._alen; i < n; ++i) {\n this.celltuple(adds[i]);\n adds[i] = null; // for garbage collection\n }\n for (i = 0, n = this._mlen; i < n; ++i) {\n this.celltuple(mods[i]);\n mods[i] = null; // for garbage collection\n }\n this._alen = this._mlen = 0; // reset list of active cells\n }\n});\n\n/**\n * Compute kernel density estimates (KDE) for one or more data groups.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby.\n * @param {function(object): *} params.field - An accessor for the data field\n * to estimate.\n * @param {number} [params.bandwidth=0] - The KDE kernel bandwidth.\n * If zero or unspecified, the bandwidth is automatically determined.\n * @param {boolean} [params.counts=false] - A boolean flag indicating if the\n * output values should be probability estimates (false, default) or\n * smoothed counts (true).\n * @param {string} [params.cumulative=false] - A boolean flag indicating if a\n * density (false) or cumulative distribution (true) should be generated.\n * @param {Array} [params.extent] - The domain extent over which to\n * plot the density. If unspecified, the [min, max] data extent is used.\n * @param {string} [params.resolve='independent'] - Indicates how parameters for\n * multiple densities should be resolved. If \"independent\" (the default), each\n * density may have its own domain extent and dynamic number of curve sample\n * steps. If \"shared\", the KDE transform will ensure that all densities are\n * defined over a shared domain and curve steps, enabling stacking.\n * @param {number} [params.minsteps=25] - The minimum number of curve samples\n * for plotting the density.\n * @param {number} [params.maxsteps=200] - The maximum number of curve samples\n * for plotting the density.\n * @param {number} [params.steps] - The exact number of curve samples for\n * plotting the density. If specified, overrides both minsteps and maxsteps\n * to set an exact number of uniform samples. Useful in conjunction with\n * a fixed extent to ensure consistent sample points for stacked densities.\n */\nfunction KDE(params) {\n Transform.call(this, null, params);\n}\nKDE.Definition = {\n 'type': 'KDE',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'cumulative',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'counts',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'resolve',\n 'type': 'enum',\n 'values': ['shared', 'independent'],\n 'default': 'independent'\n }, {\n 'name': 'steps',\n 'type': 'number'\n }, {\n 'name': 'minsteps',\n 'type': 'number',\n 'default': 25\n }, {\n 'name': 'maxsteps',\n 'type': 'number',\n 'default': 200\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'default': ['value', 'density']\n }]\n};\ninherits(KDE, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n if (!this.value || pulse.changed() || _.modified()) {\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition$1(source, _.groupby, _.field),\n names = (_.groupby || []).map(accessorName),\n bandwidth = _.bandwidth,\n method = _.cumulative ? 'cdf' : 'pdf',\n as = _.as || ['value', 'density'],\n values = [];\n let domain = _.extent,\n minsteps = _.steps || _.minsteps || 25,\n maxsteps = _.steps || _.maxsteps || 200;\n if (method !== 'pdf' && method !== 'cdf') {\n error('Invalid density method: ' + method);\n }\n if (_.resolve === 'shared') {\n if (!domain) domain = extent(source, _.field);\n minsteps = maxsteps = _.steps || maxsteps;\n }\n groups.forEach(g => {\n const density = randomKDE(g, bandwidth)[method],\n scale = _.counts ? g.length : 1,\n local = domain || extent(g);\n sampleCurve(density, local, minsteps, maxsteps).forEach(v => {\n const t = {};\n for (let i = 0; i < names.length; ++i) {\n t[names[i]] = g.dims[i];\n }\n t[as[0]] = v[0];\n t[as[1]] = v[1] * scale;\n values.push(ingest(t));\n });\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n return out;\n }\n});\n\n/**\n * Generates a key function.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - The field name(s) for the key function.\n * @param {boolean} params.flat - A boolean flag indicating if the field names\n * should be treated as flat property names, side-stepping nested field\n * lookups normally indicated by dot or bracket notation.\n */\nfunction Key(params) {\n Operator.call(this, null, update$2, params);\n}\ninherits(Key, Operator);\nfunction update$2(_) {\n return this.value && !_.modified() ? this.value : key(_.fields, _.flat);\n}\n\n/**\n * Load and parse data from an external source. Marshalls parameter\n * values and then invokes the Dataflow request method.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {string} params.url - The URL to load from.\n * @param {object} params.format - The data format options.\n */\nfunction Load(params) {\n Transform.call(this, [], params);\n this._pending = null;\n}\ninherits(Load, Transform, {\n transform(_, pulse) {\n const df = pulse.dataflow;\n if (this._pending) {\n // update state and return pulse\n return output(this, pulse, this._pending);\n }\n if (stop(_)) return pulse.StopPropagation;\n if (_.values) {\n // parse and ingest values, return output pulse\n return output(this, pulse, df.parse(_.values, _.format));\n } else if (_.async) {\n // return promise for non-blocking async loading\n const p = df.request(_.url, _.format).then(res => {\n this._pending = array(res.data);\n return df => df.touch(this);\n });\n return {\n async: p\n };\n } else {\n // return promise for synchronous loading\n return df.request(_.url, _.format).then(res => output(this, pulse, array(res.data)));\n }\n }\n});\nfunction stop(_) {\n return _.modified('async') && !(_.modified('values') || _.modified('url') || _.modified('format'));\n}\nfunction output(op, pulse, data) {\n data.forEach(ingest);\n const out = pulse.fork(pulse.NO_FIELDS & pulse.NO_SOURCE);\n out.rem = op.value;\n op.value = out.source = out.add = data;\n op._pending = null;\n if (out.rem.length) out.clean(true);\n return out;\n}\n\n/**\n * Extend tuples by joining them with values from a lookup table.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Map} params.index - The lookup table map.\n * @param {Array} params.as - Output field names for each lookup value.\n * @param {*} [params.default] - A default value to use if lookup fails.\n */\nfunction Lookup(params) {\n Transform.call(this, {}, params);\n}\nLookup.Definition = {\n 'type': 'Lookup',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'index',\n 'type': 'index',\n 'params': [{\n 'name': 'from',\n 'type': 'data',\n 'required': true\n }, {\n 'name': 'key',\n 'type': 'field',\n 'required': true\n }]\n }, {\n 'name': 'values',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }, {\n 'name': 'default',\n 'default': null\n }]\n};\ninherits(Lookup, Transform, {\n transform(_, pulse) {\n const keys = _.fields,\n index = _.index,\n values = _.values,\n defaultValue = _.default == null ? null : _.default,\n reset = _.modified(),\n n = keys.length;\n let flag = reset ? pulse.SOURCE : pulse.ADD,\n out = pulse,\n as = _.as,\n set,\n m,\n mods;\n if (values) {\n m = values.length;\n if (n > 1 && !as) {\n error('Multi-field lookup requires explicit \"as\" parameter.');\n }\n if (as && as.length !== n * m) {\n error('The \"as\" parameter has too few output field names.');\n }\n as = as || values.map(accessorName);\n set = function (t) {\n for (var i = 0, k = 0, j, v; i < n; ++i) {\n v = index.get(keys[i](t));\n if (v == null) for (j = 0; j < m; ++j, ++k) t[as[k]] = defaultValue;else for (j = 0; j < m; ++j, ++k) t[as[k]] = values[j](v);\n }\n };\n } else {\n if (!as) {\n error('Missing output field names.');\n }\n set = function (t) {\n for (var i = 0, v; i < n; ++i) {\n v = index.get(keys[i](t));\n t[as[i]] = v == null ? defaultValue : v;\n }\n };\n }\n if (reset) {\n out = pulse.reflow(true);\n } else {\n mods = keys.some(k => pulse.modified(k.fields));\n flag |= mods ? pulse.MOD : 0;\n }\n pulse.visit(flag, set);\n return out.modifies(as);\n }\n});\n\n/**\n * Computes global min/max extents over a collection of extents.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array>} params.extents - The input extents.\n */\nfunction MultiExtent(params) {\n Operator.call(this, null, update$1, params);\n}\ninherits(MultiExtent, Operator);\nfunction update$1(_) {\n if (this.value && !_.modified()) {\n return this.value;\n }\n const ext = _.extents,\n n = ext.length;\n let min = +Infinity,\n max = -Infinity,\n i,\n e;\n for (i = 0; i < n; ++i) {\n e = ext[i];\n if (e[0] < min) min = e[0];\n if (e[1] > max) max = e[1];\n }\n return [min, max];\n}\n\n/**\n * Merge a collection of value arrays.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array>} params.values - The input value arrrays.\n */\nfunction MultiValues(params) {\n Operator.call(this, null, update, params);\n}\ninherits(MultiValues, Operator);\nfunction update(_) {\n return this.value && !_.modified() ? this.value : _.values.reduce((data, _) => data.concat(_), []);\n}\n\n/**\n * Operator whose value is simply its parameter hash. This operator is\n * useful for enabling reactive updates to values of nested objects.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction Params(params) {\n Transform.call(this, null, params);\n}\ninherits(Params, Transform, {\n transform(_, pulse) {\n this.modified(_.modified());\n this.value = _;\n return pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS); // do not pass tuples\n }\n});\n\n/**\n * Aggregate and pivot selected field values to become new fields.\n * This operator is useful to construction cross-tabulations.\n * @constructor\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby. These fields act just like groupby fields of an Aggregate transform.\n * @param {function(object): *} params.field - The field to pivot on. The unique\n * values of this field become new field names in the output stream.\n * @param {function(object): *} params.value - The field to populate pivoted fields.\n * The aggregate values of this field become the values of the new pivoted fields.\n * @param {string} [params.op] - The aggregation operation for the value field,\n * applied per cell in the output stream. The default is \"sum\".\n * @param {number} [params.limit] - An optional parameter indicating the maximum\n * number of pivoted fields to generate. The pivoted field names are sorted in\n * ascending order prior to enforcing the limit.\n */\nfunction Pivot(params) {\n Aggregate.call(this, params);\n}\nPivot.Definition = {\n 'type': 'Pivot',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'value',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'op',\n 'type': 'enum',\n 'values': ValidAggregateOps,\n 'default': 'sum'\n }, {\n 'name': 'limit',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'key',\n 'type': 'field'\n }]\n};\ninherits(Pivot, Aggregate, {\n _transform: Aggregate.prototype.transform,\n transform(_, pulse) {\n return this._transform(aggregateParams(_, pulse), pulse);\n }\n});\n\n// Shoehorn a pivot transform into an aggregate transform!\n// First collect all unique pivot field values.\n// Then generate aggregate fields for each output pivot field.\nfunction aggregateParams(_, pulse) {\n const key = _.field,\n value = _.value,\n op = (_.op === 'count' ? '__count__' : _.op) || 'sum',\n fields = accessorFields(key).concat(accessorFields(value)),\n keys = pivotKeys(key, _.limit || 0, pulse);\n\n // if data stream content changes, pivot fields may change\n // flag parameter modification to ensure re-initialization\n if (pulse.changed()) _.set('__pivot__', null, null, true);\n return {\n key: _.key,\n groupby: _.groupby,\n ops: keys.map(() => op),\n fields: keys.map(k => get(k, key, value, fields)),\n as: keys.map(k => k + ''),\n modified: _.modified.bind(_)\n };\n}\n\n// Generate aggregate field accessor.\n// Output NaN for non-existent values; aggregator will ignore!\nfunction get(k, key, value, fields) {\n return accessor(d => key(d) === k ? value(d) : NaN, fields, k + '');\n}\n\n// Collect (and optionally limit) all unique pivot values.\nfunction pivotKeys(key, limit, pulse) {\n const map = {},\n list = [];\n pulse.visit(pulse.SOURCE, t => {\n const k = key(t);\n if (!map[k]) {\n map[k] = 1;\n list.push(k);\n }\n });\n list.sort(ascending);\n return limit ? list.slice(0, limit) : list;\n}\n\n/**\n * Partitions pre-faceted data into tuple subflows.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(Dataflow, string): Operator} params.subflow - A function\n * that generates a subflow of operators and returns its root operator.\n * @param {function(object): Array} params.field - The field\n * accessor for an array of subflow tuple objects.\n */\nfunction PreFacet(params) {\n Facet.call(this, params);\n}\ninherits(PreFacet, Facet, {\n transform(_, pulse) {\n const flow = _.subflow,\n field = _.field,\n subflow = t => this.subflow(tupleid(t), flow, pulse, t);\n if (_.modified('field') || field && pulse.modified(accessorFields(field))) {\n error('PreFacet does not support field modification.');\n }\n this.initTargets(); // reset list of active subflows\n\n if (field) {\n pulse.visit(pulse.MOD, t => {\n const sf = subflow(t);\n field(t).forEach(_ => sf.mod(_));\n });\n pulse.visit(pulse.ADD, t => {\n const sf = subflow(t);\n field(t).forEach(_ => sf.add(ingest(_)));\n });\n pulse.visit(pulse.REM, t => {\n const sf = subflow(t);\n field(t).forEach(_ => sf.rem(_));\n });\n } else {\n pulse.visit(pulse.MOD, t => subflow(t).mod(t));\n pulse.visit(pulse.ADD, t => subflow(t).add(t));\n pulse.visit(pulse.REM, t => subflow(t).rem(t));\n }\n if (pulse.clean()) {\n pulse.runAfter(() => this.clean());\n }\n return pulse;\n }\n});\n\n/**\n * Performs a relational projection, copying selected fields from source\n * tuples to a new set of derived tuples.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.as] - Output field names for each projected\n * field. Any unspecified fields will use the field name provided by\n * the field accessor.\n */\nfunction Project(params) {\n Transform.call(this, null, params);\n}\nProject.Definition = {\n 'type': 'Project',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }]\n};\ninherits(Project, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n fields = _.fields,\n as = fieldNames(_.fields, _.as || []),\n derive = fields ? (s, t) => project(s, t, fields, as) : rederive;\n let lut;\n if (this.value) {\n lut = this.value;\n } else {\n pulse = pulse.addAll();\n lut = this.value = {};\n }\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n out.rem.push(lut[id]);\n lut[id] = null;\n });\n pulse.visit(pulse.ADD, t => {\n const dt = derive(t, ingest({}));\n lut[tupleid(t)] = dt;\n out.add.push(dt);\n });\n pulse.visit(pulse.MOD, t => {\n out.mod.push(derive(t, lut[tupleid(t)]));\n });\n return out;\n }\n});\nfunction project(s, t, fields, as) {\n for (let i = 0, n = fields.length; i < n; ++i) {\n t[as[i]] = fields[i](s);\n }\n return t;\n}\n\n/**\n * Proxy the value of another operator as a pure signal value.\n * Ensures no tuples are propagated.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {*} params.value - The value to proxy, becomes the value of this operator.\n */\nfunction Proxy(params) {\n Transform.call(this, null, params);\n}\ninherits(Proxy, Transform, {\n transform(_, pulse) {\n this.value = _.value;\n return _.modified('value') ? pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS) : pulse.StopPropagation;\n }\n});\n\n/**\n * Generates sample quantile values from an input data stream.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - An accessor for the data field\n * over which to calculate quantile values.\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby.\n * @param {Array} [params.probs] - An array of probabilities in\n * the range (0, 1) for which to compute quantile values. If not specified,\n * the *step* parameter will be used.\n * @param {Array} [params.step=0.01] - A probability step size for\n * sampling quantile values. All values from one-half the step size up to\n * 1 (exclusive) will be sampled. This parameter is only used if the\n * *quantiles* parameter is not provided.\n */\nfunction Quantile(params) {\n Transform.call(this, null, params);\n}\nQuantile.Definition = {\n 'type': 'Quantile',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'probs',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'step',\n 'type': 'number',\n 'default': 0.01\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'default': ['prob', 'value']\n }]\n};\nconst EPSILON = 1e-14;\ninherits(Quantile, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n as = _.as || ['prob', 'value'];\n if (this.value && !_.modified() && !pulse.changed()) {\n out.source = this.value;\n return out;\n }\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition$1(source, _.groupby, _.field),\n names = (_.groupby || []).map(accessorName),\n values = [],\n step = _.step || 0.01,\n p = _.probs || range(step / 2, 1 - EPSILON, step),\n n = p.length;\n groups.forEach(g => {\n const q = quantiles(g, p);\n for (let i = 0; i < n; ++i) {\n const t = {};\n for (let i = 0; i < names.length; ++i) {\n t[names[i]] = g.dims[i];\n }\n t[as[0]] = p[i];\n t[as[1]] = q[i];\n values.push(ingest(t));\n }\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n return out;\n }\n});\n\n/**\n * Relays a data stream between data processing pipelines.\n * If the derive parameter is set, this transform will create derived\n * copies of observed tuples. This provides derived data streams in which\n * modifications to the tuples do not pollute an upstream data source.\n * @param {object} params - The parameters for this operator.\n * @param {number} [params.derive=false] - Boolean flag indicating if\n * the transform should make derived copies of incoming tuples.\n * @constructor\n */\nfunction Relay(params) {\n Transform.call(this, null, params);\n}\ninherits(Relay, Transform, {\n transform(_, pulse) {\n let out, lut;\n if (this.value) {\n lut = this.value;\n } else {\n out = pulse = pulse.addAll();\n lut = this.value = {};\n }\n if (_.derive) {\n out = pulse.fork(pulse.NO_SOURCE);\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n out.rem.push(lut[id]);\n lut[id] = null;\n });\n pulse.visit(pulse.ADD, t => {\n const dt = derive(t);\n lut[tupleid(t)] = dt;\n out.add.push(dt);\n });\n pulse.visit(pulse.MOD, t => {\n const dt = lut[tupleid(t)];\n for (const k in t) {\n dt[k] = t[k];\n // down stream writes may overwrite re-derived tuples\n // conservatively mark all source fields as modified\n out.modifies(k);\n }\n out.mod.push(dt);\n });\n }\n return out;\n }\n});\n\n/**\n * Samples tuples passing through this operator.\n * Uses reservoir sampling to maintain a representative sample.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {number} [params.size=1000] - The maximum number of samples.\n */\nfunction Sample(params) {\n Transform.call(this, [], params);\n this.count = 0;\n}\nSample.Definition = {\n 'type': 'Sample',\n 'metadata': {},\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'default': 1000\n }]\n};\ninherits(Sample, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE),\n mod = _.modified('size'),\n num = _.size,\n map = this.value.reduce((m, t) => (m[tupleid(t)] = 1, m), {});\n let res = this.value,\n cnt = this.count,\n cap = 0;\n\n // sample reservoir update function\n function update(t) {\n let p, idx;\n if (res.length < num) {\n res.push(t);\n } else {\n idx = ~~((cnt + 1) * random());\n if (idx < res.length && idx >= cap) {\n p = res[idx];\n if (map[tupleid(p)]) out.rem.push(p); // eviction\n res[idx] = t;\n }\n }\n ++cnt;\n }\n if (pulse.rem.length) {\n // find all tuples that should be removed, add to output\n pulse.visit(pulse.REM, t => {\n const id = tupleid(t);\n if (map[id]) {\n map[id] = -1;\n out.rem.push(t);\n }\n --cnt;\n });\n\n // filter removed tuples out of the sample reservoir\n res = res.filter(t => map[tupleid(t)] !== -1);\n }\n if ((pulse.rem.length || mod) && res.length < num && pulse.source) {\n // replenish sample if backing data source is available\n cap = cnt = res.length;\n pulse.visit(pulse.SOURCE, t => {\n // update, but skip previously sampled tuples\n if (!map[tupleid(t)]) update(t);\n });\n cap = -1;\n }\n if (mod && res.length > num) {\n const n = res.length - num;\n for (let i = 0; i < n; ++i) {\n map[tupleid(res[i])] = -1;\n out.rem.push(res[i]);\n }\n res = res.slice(n);\n }\n if (pulse.mod.length) {\n // propagate modified tuples in the sample reservoir\n pulse.visit(pulse.MOD, t => {\n if (map[tupleid(t)]) out.mod.push(t);\n });\n }\n if (pulse.add.length) {\n // update sample reservoir\n pulse.visit(pulse.ADD, update);\n }\n if (pulse.add.length || cap < 0) {\n // output newly added tuples\n out.add = res.filter(t => !map[tupleid(t)]);\n }\n this.count = cnt;\n this.value = out.source = res;\n return out;\n }\n});\n\n/**\n * Generates data tuples for a specified sequence range of numbers.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {number} params.start - The first number in the sequence.\n * @param {number} params.stop - The last number (exclusive) in the sequence.\n * @param {number} [params.step=1] - The step size between numbers in the sequence.\n */\nfunction Sequence(params) {\n Transform.call(this, null, params);\n}\nSequence.Definition = {\n 'type': 'Sequence',\n 'metadata': {\n 'generates': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'start',\n 'type': 'number',\n 'required': true\n }, {\n 'name': 'stop',\n 'type': 'number',\n 'required': true\n }, {\n 'name': 'step',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'data'\n }]\n};\ninherits(Sequence, Transform, {\n transform(_, pulse) {\n if (this.value && !_.modified()) return;\n const out = pulse.materialize().fork(pulse.MOD),\n as = _.as || 'data';\n out.rem = this.value ? pulse.rem.concat(this.value) : pulse.rem;\n this.value = range(_.start, _.stop, _.step || 1).map(v => {\n const t = {};\n t[as] = v;\n return ingest(t);\n });\n out.add = pulse.add.concat(this.value);\n return out;\n }\n});\n\n/**\n * Propagates a new pulse without any tuples so long as the input\n * pulse contains some added, removed or modified tuples.\n * @param {object} params - The parameters for this operator.\n * @constructor\n */\nfunction Sieve(params) {\n Transform.call(this, null, params);\n this.modified(true); // always treat as modified\n}\ninherits(Sieve, Transform, {\n transform(_, pulse) {\n this.value = pulse.source;\n return pulse.changed() ? pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS) : pulse.StopPropagation;\n }\n});\n\n/**\n * Discretize dates to specific time units.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The data field containing date/time values.\n */\nfunction TimeUnit(params) {\n Transform.call(this, null, params);\n}\nconst OUTPUT = ['unit0', 'unit1'];\nTimeUnit.Definition = {\n 'type': 'TimeUnit',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'interval',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'units',\n 'type': 'enum',\n 'values': TIME_UNITS,\n 'array': true\n }, {\n 'name': 'step',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'maxbins',\n 'type': 'number',\n 'default': 40\n }, {\n 'name': 'extent',\n 'type': 'date',\n 'array': true\n }, {\n 'name': 'timezone',\n 'type': 'enum',\n 'default': 'local',\n 'values': ['local', 'utc']\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': OUTPUT\n }]\n};\ninherits(TimeUnit, Transform, {\n transform(_, pulse) {\n const field = _.field,\n band = _.interval !== false,\n utc = _.timezone === 'utc',\n floor = this._floor(_, pulse),\n offset = (utc ? utcInterval : timeInterval)(floor.unit).offset,\n as = _.as || OUTPUT,\n u0 = as[0],\n u1 = as[1],\n step = floor.step;\n let min = floor.start || Infinity,\n max = floor.stop || -Infinity,\n flag = pulse.ADD;\n if (_.modified() || pulse.changed(pulse.REM) || pulse.modified(accessorFields(field))) {\n pulse = pulse.reflow(true);\n flag = pulse.SOURCE;\n min = Infinity;\n max = -Infinity;\n }\n pulse.visit(flag, t => {\n const v = field(t);\n let a, b;\n if (v == null) {\n t[u0] = null;\n if (band) t[u1] = null;\n } else {\n t[u0] = a = b = floor(v);\n if (band) t[u1] = b = offset(a, step);\n if (a < min) min = a;\n if (b > max) max = b;\n }\n });\n floor.start = min;\n floor.stop = max;\n return pulse.modifies(band ? as : u0);\n },\n _floor(_, pulse) {\n const utc = _.timezone === 'utc';\n\n // get parameters\n const {\n units,\n step\n } = _.units ? {\n units: _.units,\n step: _.step || 1\n } : timeBin({\n extent: _.extent || extent(pulse.materialize(pulse.SOURCE).source, _.field),\n maxbins: _.maxbins\n });\n\n // check / standardize time units\n const tunits = timeUnits(units),\n prev = this.value || {},\n floor = (utc ? utcFloor : timeFloor)(tunits, step);\n floor.unit = peek(tunits);\n floor.units = tunits;\n floor.step = step;\n floor.start = prev.start;\n floor.stop = prev.stop;\n return this.value = floor;\n }\n});\n\n/**\n * An index that maps from unique, string-coerced, field values to tuples.\n * Assumes that the field serves as a unique key with no duplicate values.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The field accessor to index.\n */\nfunction TupleIndex(params) {\n Transform.call(this, fastmap(), params);\n}\ninherits(TupleIndex, Transform, {\n transform(_, pulse) {\n const df = pulse.dataflow,\n field = _.field,\n index = this.value,\n set = t => index.set(field(t), t);\n let mod = true;\n if (_.modified('field') || pulse.modified(field.fields)) {\n index.clear();\n pulse.visit(pulse.SOURCE, set);\n } else if (pulse.changed()) {\n pulse.visit(pulse.REM, t => index.delete(field(t)));\n pulse.visit(pulse.ADD, set);\n } else {\n mod = false;\n }\n this.modified(mod);\n if (index.empty > df.cleanThreshold) df.runAfter(index.clean);\n return pulse.fork();\n }\n});\n\n/**\n * Extracts an array of values. Assumes the source data has already been\n * reduced as needed (e.g., by an upstream Aggregate transform).\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The domain field to extract.\n * @param {function(*,*): number} [params.sort] - An optional\n * comparator function for sorting the values. The comparator will be\n * applied to backing tuples prior to value extraction.\n */\nfunction Values(params) {\n Transform.call(this, null, params);\n}\ninherits(Values, Transform, {\n transform(_, pulse) {\n const run = !this.value || _.modified('field') || _.modified('sort') || pulse.changed() || _.sort && pulse.modified(_.sort.fields);\n if (run) {\n this.value = (_.sort ? pulse.source.slice().sort(stableCompare(_.sort)) : pulse.source).map(_.field);\n }\n }\n});\n\nfunction WindowOp(op, field, param, as) {\n const fn = WindowOps[op](field, param);\n return {\n init: fn.init || zero,\n update: function (w, t) {\n t[as] = fn.next(w);\n }\n };\n}\nconst WindowOps = {\n row_number: function () {\n return {\n next: w => w.index + 1\n };\n },\n rank: function () {\n let rank;\n return {\n init: () => rank = 1,\n next: w => {\n const i = w.index,\n data = w.data;\n return i && w.compare(data[i - 1], data[i]) ? rank = i + 1 : rank;\n }\n };\n },\n dense_rank: function () {\n let drank;\n return {\n init: () => drank = 1,\n next: w => {\n const i = w.index,\n d = w.data;\n return i && w.compare(d[i - 1], d[i]) ? ++drank : drank;\n }\n };\n },\n percent_rank: function () {\n const rank = WindowOps.rank(),\n next = rank.next;\n return {\n init: rank.init,\n next: w => (next(w) - 1) / (w.data.length - 1)\n };\n },\n cume_dist: function () {\n let cume;\n return {\n init: () => cume = 0,\n next: w => {\n const d = w.data,\n c = w.compare;\n let i = w.index;\n if (cume < i) {\n while (i + 1 < d.length && !c(d[i], d[i + 1])) ++i;\n cume = i;\n }\n return (1 + cume) / d.length;\n }\n };\n },\n ntile: function (field, num) {\n num = +num;\n if (!(num > 0)) error('ntile num must be greater than zero.');\n const cume = WindowOps.cume_dist(),\n next = cume.next;\n return {\n init: cume.init,\n next: w => Math.ceil(num * next(w))\n };\n },\n lag: function (field, offset) {\n offset = +offset || 1;\n return {\n next: w => {\n const i = w.index - offset;\n return i >= 0 ? field(w.data[i]) : null;\n }\n };\n },\n lead: function (field, offset) {\n offset = +offset || 1;\n return {\n next: w => {\n const i = w.index + offset,\n d = w.data;\n return i < d.length ? field(d[i]) : null;\n }\n };\n },\n first_value: function (field) {\n return {\n next: w => field(w.data[w.i0])\n };\n },\n last_value: function (field) {\n return {\n next: w => field(w.data[w.i1 - 1])\n };\n },\n nth_value: function (field, nth) {\n nth = +nth;\n if (!(nth > 0)) error('nth_value nth must be greater than zero.');\n return {\n next: w => {\n const i = w.i0 + (nth - 1);\n return i < w.i1 ? field(w.data[i]) : null;\n }\n };\n },\n prev_value: function (field) {\n let prev;\n return {\n init: () => prev = null,\n next: w => {\n const v = field(w.data[w.index]);\n return v != null ? prev = v : prev;\n }\n };\n },\n next_value: function (field) {\n let v, i;\n return {\n init: () => (v = null, i = -1),\n next: w => {\n const d = w.data;\n return w.index <= i ? v : (i = find(field, d, w.index)) < 0 ? (i = d.length, v = null) : v = field(d[i]);\n }\n };\n }\n};\nfunction find(field, data, index) {\n for (let n = data.length; index < n; ++index) {\n const v = field(data[index]);\n if (v != null) return index;\n }\n return -1;\n}\nconst ValidWindowOps = Object.keys(WindowOps);\n\nfunction WindowState(_) {\n const ops = array(_.ops),\n fields = array(_.fields),\n params = array(_.params),\n aggregate_params = array(_.aggregate_params),\n as = array(_.as),\n outputs = this.outputs = [],\n windows = this.windows = [],\n inputs = {},\n map = {},\n counts = [],\n measures = [];\n let countOnly = true;\n function visitInputs(f) {\n array(accessorFields(f)).forEach(_ => inputs[_] = 1);\n }\n visitInputs(_.sort);\n ops.forEach((op, i) => {\n const field = fields[i],\n param = params[i],\n aggregate_param = aggregate_params[i] || null,\n mname = accessorName(field),\n name = measureName(op, mname, as[i]);\n visitInputs(field);\n outputs.push(name);\n\n // Window operation\n if (hasOwnProperty(WindowOps, op)) {\n windows.push(WindowOp(op, field, param, name));\n }\n\n // Aggregate operation\n else {\n if (field == null && op !== 'count') {\n error('Null aggregate field specified.');\n }\n if (op === 'count') {\n counts.push(name);\n return;\n }\n countOnly = false;\n let m = map[mname];\n if (!m) {\n m = map[mname] = [];\n m.field = field;\n measures.push(m);\n }\n m.push(createMeasure(op, aggregate_param, name));\n }\n });\n if (counts.length || measures.length) {\n this.cell = cell(measures, counts, countOnly);\n }\n this.inputs = Object.keys(inputs);\n}\nconst prototype = WindowState.prototype;\nprototype.init = function () {\n this.windows.forEach(_ => _.init());\n if (this.cell) this.cell.init();\n};\nprototype.update = function (w, t) {\n const cell = this.cell,\n wind = this.windows,\n data = w.data,\n m = wind && wind.length;\n let j;\n if (cell) {\n for (j = w.p0; j < w.i0; ++j) cell.rem(data[j]);\n for (j = w.p1; j < w.i1; ++j) cell.add(data[j]);\n cell.set(t);\n }\n for (j = 0; j < m; ++j) wind[j].update(w, t);\n};\nfunction cell(measures, counts, countOnly) {\n measures = measures.map(m => compileMeasures(m, m.field));\n const cell = {\n num: 0,\n agg: null,\n store: false,\n count: counts\n };\n if (!countOnly) {\n var n = measures.length,\n a = cell.agg = Array(n),\n i = 0;\n for (; i < n; ++i) a[i] = new measures[i](cell);\n }\n if (cell.store) {\n var store = cell.data = new TupleStore();\n }\n cell.add = function (t) {\n cell.num += 1;\n if (countOnly) return;\n if (store) store.add(t);\n for (let i = 0; i < n; ++i) {\n a[i].add(a[i].get(t), t);\n }\n };\n cell.rem = function (t) {\n cell.num -= 1;\n if (countOnly) return;\n if (store) store.rem(t);\n for (let i = 0; i < n; ++i) {\n a[i].rem(a[i].get(t), t);\n }\n };\n cell.set = function (t) {\n let i, n;\n\n // consolidate stored values\n if (store) store.values();\n\n // update tuple properties\n for (i = 0, n = counts.length; i < n; ++i) t[counts[i]] = cell.num;\n if (!countOnly) for (i = 0, n = a.length; i < n; ++i) a[i].set(t);\n };\n cell.init = function () {\n cell.num = 0;\n if (store) store.reset();\n for (let i = 0; i < n; ++i) a[i].init();\n };\n return cell;\n}\n\n/**\n * Perform window calculations and write results to the input stream.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - A comparator function for sorting tuples within a window.\n * @param {Array} [params.groupby] - An array of accessors by which to partition tuples into separate windows.\n * @param {Array} params.ops - An array of strings indicating window operations to perform.\n * @param {Array} [params.fields] - An array of accessors\n * for data fields to use as inputs to window operations.\n * @param {Array<*>} [params.params] - An array of parameter values for window operations.\n * @param {Array} [params.aggregate_params] - An optional array of parameter values for aggregation operations.\n * @param {Array} [params.as] - An array of output field names for window operations.\n * @param {Array} [params.frame] - Window frame definition as two-element array.\n * @param {boolean} [params.ignorePeers=false] - If true, base window frame boundaries on row\n * number alone, ignoring peers with identical sort values. If false (default),\n * the window boundaries will be adjusted to include peer values.\n */\nfunction Window(params) {\n Transform.call(this, {}, params);\n this._mlen = 0;\n this._mods = [];\n}\nWindow.Definition = {\n 'type': 'Window',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'ops',\n 'type': 'enum',\n 'array': true,\n 'values': ValidWindowOps.concat(ValidAggregateOps)\n }, {\n 'name': 'params',\n 'type': 'number',\n 'null': true,\n 'array': true\n }, {\n 'name': 'aggregate_params',\n 'type': 'number',\n 'null': true,\n 'array': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'null': true,\n 'array': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'array': true\n }, {\n 'name': 'frame',\n 'type': 'number',\n 'null': true,\n 'array': true,\n 'length': 2,\n 'default': [null, 0]\n }, {\n 'name': 'ignorePeers',\n 'type': 'boolean',\n 'default': false\n }]\n};\ninherits(Window, Transform, {\n transform(_, pulse) {\n this.stamp = pulse.stamp;\n const mod = _.modified(),\n cmp = stableCompare(_.sort),\n key = groupkey(_.groupby),\n group = t => this.group(key(t));\n\n // initialize window state\n let state = this.state;\n if (!state || mod) {\n state = this.state = new WindowState(_);\n }\n\n // partition input tuples\n if (mod || pulse.modified(state.inputs)) {\n this.value = {};\n pulse.visit(pulse.SOURCE, t => group(t).add(t));\n } else {\n pulse.visit(pulse.REM, t => group(t).remove(t));\n pulse.visit(pulse.ADD, t => group(t).add(t));\n }\n\n // perform window calculations for each modified partition\n for (let i = 0, n = this._mlen; i < n; ++i) {\n processPartition(this._mods[i], state, cmp, _);\n }\n this._mlen = 0;\n this._mods = [];\n\n // TODO don't reflow everything?\n return pulse.reflow(mod).modifies(state.outputs);\n },\n group(key) {\n let group = this.value[key];\n if (!group) {\n group = this.value[key] = SortedList(tupleid);\n group.stamp = -1;\n }\n if (group.stamp < this.stamp) {\n group.stamp = this.stamp;\n this._mods[this._mlen++] = group;\n }\n return group;\n }\n});\nfunction processPartition(list, state, cmp, _) {\n const sort = _.sort,\n range = sort && !_.ignorePeers,\n frame = _.frame || [null, 0],\n data = list.data(cmp),\n // use cmp for stable sort\n n = data.length,\n b = range ? bisector(sort) : null,\n w = {\n i0: 0,\n i1: 0,\n p0: 0,\n p1: 0,\n index: 0,\n data: data,\n compare: sort || constant(-1)\n };\n state.init();\n for (let i = 0; i < n; ++i) {\n setWindow(w, frame, i, n);\n if (range) adjustRange(w, b);\n state.update(w, data[i]);\n }\n}\nfunction setWindow(w, f, i, n) {\n w.p0 = w.i0;\n w.p1 = w.i1;\n w.i0 = f[0] == null ? 0 : Math.max(0, i - Math.abs(f[0]));\n w.i1 = f[1] == null ? n : Math.min(n, i + Math.abs(f[1]) + 1);\n w.index = i;\n}\n\n// if frame type is 'range', adjust window for peer values\nfunction adjustRange(w, bisect) {\n const r0 = w.i0,\n r1 = w.i1 - 1,\n c = w.compare,\n d = w.data,\n n = d.length - 1;\n if (r0 > 0 && !c(d[r0], d[r0 - 1])) w.i0 = bisect.left(d, d[r0]);\n if (r1 < n && !c(d[r1], d[r1 + 1])) w.i1 = bisect.right(d, d[r1]);\n}\n\nexport { Aggregate as aggregate, Bin as bin, Collect as collect, Compare as compare, CountPattern as countpattern, Cross as cross, Density as density, DotBin as dotbin, Expression as expression, Extent as extent, Facet as facet, Field as field, Filter as filter, Flatten as flatten, Fold as fold, Formula as formula, Generate as generate, Impute as impute, JoinAggregate as joinaggregate, KDE as kde, Key as key, Load as load, Lookup as lookup, MultiExtent as multiextent, MultiValues as multivalues, Params as params, Pivot as pivot, PreFacet as prefacet, Project as project, Proxy as proxy, Quantile as quantile, Relay as relay, Sample as sample, Sequence as sequence, Sieve as sieve, Subflow as subflow, TimeUnit as timeunit, TupleIndex as tupleindex, Values as values, Window as window };\n","export default function mean(values, valueof) {\n let count = 0;\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n ++count, sum += value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n ++count, sum += value;\n }\n }\n }\n if (count) return sum / count;\n}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // falls through\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n","export default function() {}\n","import noop from \"../noop.js\";\nimport {point} from \"./basis.js\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n","import {point} from \"./basis.js\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n","import {Basis} from \"./basis.js\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {point} from \"./cardinal.js\";\n\nexport function CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalOpen(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import noop from \"../noop.js\";\nimport {point} from \"./cardinal.js\";\n\nexport function CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import {epsilon} from \"../math.js\";\nimport {Cardinal} from \"./cardinal.js\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalClosed} from \"./cardinalClosed.js\";\nimport noop from \"../noop.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalOpen} from \"./cardinalOpen.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","import noop from \"../noop.js\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction append(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n let d = Math.floor(digits);\n if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);\n if (d > 15) return append;\n const k = 10 ** d;\n return function(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n}\n\nexport class Path {\n constructor(digits) {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n this._append = digits == null ? append : appendRound(digits);\n }\n moveTo(x, y) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._append`Z`;\n }\n }\n lineTo(x, y) {\n this._append`L${this._x1 = +x},${this._y1 = +y}`;\n }\n quadraticCurveTo(x1, y1, x, y) {\n this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;\n }\n bezierCurveTo(x1, y1, x2, y2, x, y) {\n this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;\n }\n arcTo(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._append`M${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._append`L${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Otherwise, draw an arc!\n else {\n let x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;\n }\n\n this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;\n }\n }\n arc(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._append`M${x0},${y0}`;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._append`L${x0},${y0}`;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._append`A${r},${r},0,1,${cw},${x - dx},${y - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x + r * Math.cos(a1)},${this._y1 = y + r * Math.sin(a1)}`;\n }\n }\n rect(x, y, w, h) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;\n }\n toString() {\n return this._;\n }\n}\n\nexport function path() {\n return new Path;\n}\n\n// Allow instanceof d3.path\npath.prototype = Path.prototype;\n\nexport function pathRound(digits = 3) {\n return new Path(+digits);\n}\n","import {Path} from \"d3-path\";\n\nexport function withPath(shape) {\n let digits = 3;\n\n shape.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) {\n digits = null;\n } else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n return shape;\n };\n\n return () => new Path(digits);\n}\n","import constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\nimport {withPath} from \"./path.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null,\n path = withPath(arc);\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle. If this\n // intersection fails, it’s probably because the arc is too small, so\n // disable the corner radius entirely.\n if (da < pi) {\n if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n } else {\n rc0 = rc1 = 0;\n }\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n","export var slice = Array.prototype.slice;\n\nexport default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x, y) {\n var defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(line);\n\n x = typeof x === \"function\" ? x : (x === undefined) ? pointX : constant(x);\n y = typeof y === \"function\" ? y : (y === undefined) ? pointY : constant(y);\n\n function line(data) {\n var i,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x0, y0, y1) {\n var x1 = null,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(area);\n\n x0 = typeof x0 === \"function\" ? x0 : (x0 === undefined) ? pointX : constant(+x0);\n y0 = typeof y0 === \"function\" ? y0 : (y0 === undefined) ? constant(0) : constant(+y0);\n y1 = typeof y1 === \"function\" ? y1 : (y1 === undefined) ? pointY : constant(+y1);\n\n function area(data) {\n var i,\n j,\n k,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n","import {min, sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const r = sqrt(size + min(size / 28, 0.75)) * 0.59436;\n const t = r / 2;\n const u = t * sqrt3;\n context.moveTo(0, r);\n context.lineTo(0, -r);\n context.moveTo(-u, -t);\n context.lineTo(u, t);\n context.moveTo(-u, t);\n context.lineTo(u, -t);\n }\n};\n","import {pi, sqrt, tau} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst tan30 = sqrt(1 / 3);\nconst tan30_2 = tan30 * 2;\n\nexport default {\n draw(context, size) {\n const y = sqrt(size / tan30_2);\n const x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n","import {sin, cos, sqrt, pi, tau} from \"../math.js\";\n\nconst ka = 0.89081309152928522810;\nconst kr = sin(pi / 10) / sin(7 * pi / 10);\nconst kx = sin(tau / 10) * kr;\nconst ky = -cos(tau / 10) * kr;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size * ka);\n const x = kx * r;\n const y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (let i = 1; i < 5; ++i) {\n const a = tau * i / 5;\n const c = cos(a);\n const s = sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n","function domCanvas(w, h) {\n if (typeof document !== 'undefined' && document.createElement) {\n const c = document.createElement('canvas');\n if (c && c.getContext) {\n c.width = w;\n c.height = h;\n return c;\n }\n }\n return null;\n}\nconst domImage = () => typeof Image !== 'undefined' ? Image : null;\n\nexport { domCanvas as canvas, domCanvas, domImage as image };\n","import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const y = -sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const s = sqrt(size) * 0.6824;\n const t = s / 2;\n const u = (s * sqrt3) / 2; // cos(Math.PI / 6)\n context.moveTo(0, -s);\n context.lineTo(u, t);\n context.lineTo(-u, t);\n context.closePath();\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst c = -0.5;\nconst s = sqrt(3) / 2;\nconst k = 1 / sqrt(12);\nconst a = (k / 2 + 1) * 3;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / a);\n const x0 = r / 2, y0 = r * k;\n const x1 = x0, y1 = r * k + r;\n const x2 = -x1, y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n","import ascending from \"./ascending.js\";\nimport bisector from \"./bisector.js\";\nimport number from \"./number.js\";\n\nconst ascendingBisect = bisector(ascending);\nexport const bisectRight = ascendingBisect.right;\nexport const bisectLeft = ascendingBisect.left;\nexport const bisectCenter = bisector(number).center;\nexport default bisectRight;\n","export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHex8: color_formatHex8,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb() {\n return this;\n },\n clamp() {\n return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n },\n displayable() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatHex8: rgb_formatHex8,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n value = clampi(value);\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n clamp() {\n return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n },\n displayable() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n }\n}));\n\nfunction clamph(value) {\n value = (value || 0) % 360;\n return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","import {basis} from \"./basis.js\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","export default x => () => x;\n","import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n","import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n","export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n","import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n","export default function number(x) {\n return +x;\n}\n","import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateNumber, interpolateRound} from \"d3-interpolate\";\nimport constant from \"./constant.js\";\nimport number from \"./number.js\";\n\nvar unit = [0, 1];\n\nexport function identity(x) {\n return x;\n}\n\nfunction normalize(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n var t;\n if (a > b) t = a, a = b, b = t;\n return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = normalize(domain[i], domain[i + 1]);\n r[i] = interpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport function transformer() {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n transform,\n untransform,\n unknown,\n clamp = identity,\n piecewise,\n output,\n input;\n\n function rescale() {\n var n = Math.min(domain.length, range.length);\n if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);\n piecewise = n > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n }\n\n scale.invert = function(y) {\n return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = Array.from(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t, u) {\n transform = t, untransform = u;\n return rescale();\n };\n}\n\nexport default function continuous() {\n return transformer()(identity, identity);\n}\n","export default function constants(x) {\n return function() {\n return x;\n };\n}\n","export function initRange(domain, range) {\n switch (arguments.length) {\n case 0: break;\n case 1: this.range(domain); break;\n default: this.range(range).domain(domain); break;\n }\n return this;\n}\n\nexport function initInterpolator(domain, interpolator) {\n switch (arguments.length) {\n case 0: break;\n case 1: {\n if (typeof domain === \"function\") this.interpolator(domain);\n else this.range(domain);\n break;\n }\n default: {\n this.domain(domain);\n if (typeof interpolator === \"function\") this.interpolator(interpolator);\n else this.range(interpolator);\n break;\n }\n }\n return this;\n}\n","import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function tickFormat(start, stop, count, specifier) {\n var step = tickStep(start, stop, count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n","import {ticks, tickIncrement} from \"d3-array\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport tickFormat from \"./tickFormat.js\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n var d = domain();\n return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain();\n var i0 = 0;\n var i1 = d.length - 1;\n var start = d[i0];\n var stop = d[i1];\n var prestep;\n var step;\n var maxIter = 10;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n \n while (maxIter-- > 0) {\n step = tickIncrement(start, stop, count);\n if (step === prestep) {\n d[i0] = start\n d[i1] = stop\n return domain(d);\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n } else {\n break;\n }\n prestep = step;\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous();\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n","export default function nice(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n","import {ticks} from \"d3-array\";\nimport {format, formatSpecifier} from \"d3-format\";\nimport nice from \"./nice.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformLog(x) {\n return Math.log(x);\n}\n\nfunction transformExp(x) {\n return Math.exp(x);\n}\n\nfunction transformLogn(x) {\n return -Math.log(-x);\n}\n\nfunction transformExpn(x) {\n return -Math.exp(-x);\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : x => Math.pow(base, x);\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), x => Math.log(x) / base);\n}\n\nfunction reflect(f) {\n return (x, k) => -f(-x, k);\n}\n\nexport function loggish(transform) {\n const scale = transform(transformLog, transformExp);\n const domain = scale.domain;\n let base = 10;\n let logs;\n let pows;\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) {\n logs = reflect(logs), pows = reflect(pows);\n transform(transformLogn, transformExpn);\n } else {\n transform(transformLog, transformExp);\n }\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = count => {\n const d = domain();\n let u = d[0];\n let v = d[d.length - 1];\n const r = v < u;\n\n if (r) ([u, v] = [v, u]);\n\n let i = logs(u);\n let j = logs(v);\n let k;\n let t;\n const n = count == null ? 10 : +count;\n let z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.floor(i), j = Math.ceil(j);\n if (u > 0) for (; i <= j; ++i) {\n for (k = 1; k < base; ++k) {\n t = i < 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i <= j; ++i) {\n for (k = base - 1; k >= 1; --k) {\n t = i > 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n if (z.length * 2 < n) z = ticks(u, v, n);\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = (count, specifier) => {\n if (count == null) count = 10;\n if (specifier == null) specifier = base === 10 ? \"s\" : \",\";\n if (typeof specifier !== \"function\") {\n if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;\n specifier = format(specifier);\n }\n if (count === Infinity) return specifier;\n const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return d => {\n let i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = () => {\n return domain(nice(domain(), {\n floor: x => pows(Math.floor(logs(x))),\n ceil: x => pows(Math.ceil(logs(x)))\n }));\n };\n\n return scale;\n}\n\nexport default function log() {\n const scale = loggish(transformer()).domain([1, 10]);\n scale.copy = () => copy(scale, log()).base(scale.base());\n initRange.apply(scale, arguments);\n return scale;\n}\n","import {linearish} from \"./linear.js\";\nimport {copy, identity, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformPow(exponent) {\n return function(x) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n };\n}\n\nfunction transformSqrt(x) {\n return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);\n}\n\nfunction transformSquare(x) {\n return x < 0 ? -x * x : x * x;\n}\n\nexport function powish(transform) {\n var scale = transform(identity, identity),\n exponent = 1;\n\n function rescale() {\n return exponent === 1 ? transform(identity, identity)\n : exponent === 0.5 ? transform(transformSqrt, transformSquare)\n : transform(transformPow(exponent), transformPow(1 / exponent));\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, rescale()) : exponent;\n };\n\n return linearish(scale);\n}\n\nexport default function pow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, pow()).exponent(scale.exponent());\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n\nexport function sqrt() {\n return pow.apply(null, arguments).exponent(0.5);\n}\n","import {linearish} from \"./linear.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformSymlog(c) {\n return function(x) {\n return Math.sign(x) * Math.log1p(Math.abs(x / c));\n };\n}\n\nfunction transformSymexp(c) {\n return function(x) {\n return Math.sign(x) * Math.expm1(Math.abs(x)) * c;\n };\n}\n\nexport function symlogish(transform) {\n var c = 1, scale = transform(transformSymlog(c), transformSymexp(c));\n\n scale.constant = function(_) {\n return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c;\n };\n\n return linearish(scale);\n}\n\nexport default function symlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, symlog()).constant(scale.constant());\n };\n\n return initRange.apply(scale, arguments);\n}\n","import {bisector, tickStep} from \"d3-array\";\nimport {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from \"./duration.js\";\nimport {millisecond} from \"./millisecond.js\";\nimport {second} from \"./second.js\";\nimport {timeMinute, utcMinute} from \"./minute.js\";\nimport {timeHour, utcHour} from \"./hour.js\";\nimport {timeDay, unixDay} from \"./day.js\";\nimport {timeSunday, utcSunday} from \"./week.js\";\nimport {timeMonth, utcMonth} from \"./month.js\";\nimport {timeYear, utcYear} from \"./year.js\";\n\nfunction ticker(year, month, week, day, hour, minute) {\n\n const tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function ticks(start, stop, count) {\n const reverse = stop < start;\n if (reverse) [start, stop] = [stop, start];\n const interval = count && typeof count.range === \"function\" ? count : tickInterval(start, stop, count);\n const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop\n return reverse ? ticks.reverse() : ticks;\n }\n\n function tickInterval(start, stop, count) {\n const target = Math.abs(stop - start) / count;\n const i = bisector(([,, step]) => step).right(tickIntervals, target);\n if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));\n if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));\n const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n return t.every(step);\n }\n\n return [ticks, tickInterval];\n}\n\nconst [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);\n\nexport {utcTicks, utcTickInterval, timeTicks, timeTickInterval};\n","import {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeTicks, timeTickInterval} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport nice from \"./nice.js\";\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {\n var scale = continuous(),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(Array.from(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval) {\n var d = domain();\n if (!interval || typeof interval.range !== \"function\") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);\n return interval ? domain(nice(d, interval)) : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));\n };\n\n return scale;\n}\n\nexport default function time() {\n return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);\n}\n","import {interpolate, interpolateRound} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 1,\n t0,\n t1,\n k10,\n transform,\n interpolator = identity,\n clamp = false,\n unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1;\n return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0);\n return scale;\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .interpolator(source.interpolator())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport default function sequential() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, sequential());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialLog() {\n var scale = loggish(transformer()).domain([1, 10]);\n\n scale.copy = function() {\n return copy(scale, sequentialLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSqrt() {\n return sequentialPow.apply(null, arguments).exponent(0.5);\n}\n","import {default as value} from \"./value.js\";\n\nexport default function piecewise(interpolate, values) {\n if (values === undefined) values = interpolate, interpolate = value;\n var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);\n while (i < n) I[i] = interpolate(v, v = values[++i]);\n return function(t) {\n var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));\n return I[i](t - i);\n };\n}\n","import {interpolate, interpolateRound, piecewise} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {copy} from \"./sequential.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 0.5,\n x2 = 1,\n s = 1,\n t0,\n t1,\n t2,\n k10,\n k21,\n interpolator = identity,\n transform,\n clamp = false,\n unknown;\n\n function scale(x) {\n return isNaN(x = +x) ? unknown : (x = 0.5 + ((x = +transform(x)) - t1) * (s * x < s * t1 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1, x2] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1, scale) : [x0, x1, x2];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1, r2;\n return arguments.length ? ([r0, r1, r2] = _, interpolator = piecewise(interpolate, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), t2 = t(x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1;\n return scale;\n };\n}\n\nexport default function diverging() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, diverging());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingLog() {\n var scale = loggish(transformer()).domain([0.1, 1, 10]);\n\n scale.copy = function() {\n return copy(scale, divergingLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSqrt() {\n return divergingPow.apply(null, arguments).exponent(0.5);\n}\n","export class InternMap extends Map {\n constructor(entries, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (entries != null) for (const [key, value] of entries) this.set(key, value);\n }\n get(key) {\n return super.get(intern_get(this, key));\n }\n has(key) {\n return super.has(intern_get(this, key));\n }\n set(key, value) {\n return super.set(intern_set(this, key), value);\n }\n delete(key) {\n return super.delete(intern_delete(this, key));\n }\n}\n\nexport class InternSet extends Set {\n constructor(values, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (values != null) for (const value of values) this.add(value);\n }\n has(value) {\n return super.has(intern_get(this, value));\n }\n add(value) {\n return super.add(intern_set(this, value));\n }\n delete(value) {\n return super.delete(intern_delete(this, value));\n }\n}\n\nfunction intern_get({_intern, _key}, value) {\n const key = _key(value);\n return _intern.has(key) ? _intern.get(key) : value;\n}\n\nfunction intern_set({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) return _intern.get(key);\n _intern.set(key, value);\n return value;\n}\n\nfunction intern_delete({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) {\n value = _intern.get(key);\n _intern.delete(key);\n }\n return value;\n}\n\nfunction keyof(value) {\n return value !== null && typeof value === \"object\" ? value.valueOf() : value;\n}\n","import {InternMap} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport const implicit = Symbol(\"implicit\");\n\nexport default function ordinal() {\n var index = new InternMap(),\n domain = [],\n range = [],\n unknown = implicit;\n\n function scale(d) {\n let i = index.get(d);\n if (i === undefined) {\n if (unknown !== implicit) return unknown;\n index.set(d, i = domain.push(d) - 1);\n }\n return range[i % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = new InternMap();\n for (const value of _) {\n if (index.has(value)) continue;\n index.set(value, domain.push(value) - 1);\n }\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal(domain, range).unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n","export default function(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n","import {hue} from \"./color.js\";\n\nexport default function(a, b) {\n var i = hue(+a, +b);\n return function(t) {\n var x = i(t);\n return x - 360 * Math.floor(x / 360);\n };\n}\n","var degrees = 180 / Math.PI;\n\nexport var identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n","import decompose, {identity} from \"./decompose.js\";\n\nvar svgNode;\n\n/* eslint-disable no-undef */\nexport function parseCss(value) {\n const m = new (typeof DOMMatrix === \"function\" ? DOMMatrix : WebKitCSSMatrix)(value + \"\");\n return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);\n}\n\nexport function parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n","import number from \"../number.js\";\nimport {parseCss, parseSvg} from \"./parse.js\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n","var epsilon2 = 1e-12;\n\nfunction cosh(x) {\n return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\nexport default (function zoomRho(rho, rho2, rho4) {\n\n // p0 = [ux0, uy0, w0]\n // p1 = [ux1, uy1, w1]\n function zoom(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 ≅ u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000 * rho / Math.SQRT2;\n\n return i;\n }\n\n zoom.rho = function(_) {\n var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;\n return zoomRho(_1, _2, _4);\n };\n\n return zoom;\n})(Math.SQRT2, 2, 4);\n","import {hsl as colorHsl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hsl(hue) {\n return function(start, end) {\n var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hsl(hue);\nexport var hslLong = hsl(color);\n","export const radians = Math.PI / 180;\nexport const degrees = 180 / Math.PI;\n","import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\n// https://observablehq.com/@mbostock/lab-and-rgb\nconst K = 18,\n Xn = 0.96422,\n Yn = 1,\n Zn = 0.82521,\n t0 = 4 / 29,\n t1 = 6 / 29,\n t2 = 3 * t1 * t1,\n t3 = t1 * t1 * t1;\n\nfunction labConvert(o) {\n if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);\n if (o instanceof Hcl) return hcl2lab(o);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = rgb2lrgb(o.r),\n g = rgb2lrgb(o.g),\n b = rgb2lrgb(o.b),\n y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;\n if (r === g && g === b) x = z = y; else {\n x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);\n z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);\n }\n return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);\n}\n\nexport function gray(l, opacity) {\n return new Lab(l, 0, 0, opacity == null ? 1 : opacity);\n}\n\nexport default function lab(l, a, b, opacity) {\n return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);\n}\n\nexport function Lab(l, a, b, opacity) {\n this.l = +l;\n this.a = +a;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Lab, lab, extend(Color, {\n brighter(k) {\n return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n darker(k) {\n return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n rgb() {\n var y = (this.l + 16) / 116,\n x = isNaN(this.a) ? y : y + this.a / 500,\n z = isNaN(this.b) ? y : y - this.b / 200;\n x = Xn * lab2xyz(x);\n y = Yn * lab2xyz(y);\n z = Zn * lab2xyz(z);\n return new Rgb(\n lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),\n lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),\n lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),\n this.opacity\n );\n }\n}));\n\nfunction xyz2lab(t) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction lrgb2rgb(x) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2lrgb(x) {\n return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\nfunction hclConvert(o) {\n if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);\n if (!(o instanceof Lab)) o = labConvert(o);\n if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);\n var h = Math.atan2(o.b, o.a) * degrees;\n return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);\n}\n\nexport function lch(l, c, h, opacity) {\n return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function hcl(h, c, l, opacity) {\n return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function Hcl(h, c, l, opacity) {\n this.h = +h;\n this.c = +c;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nfunction hcl2lab(o) {\n if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);\n var h = o.h * radians;\n return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);\n}\n\ndefine(Hcl, hcl, extend(Color, {\n brighter(k) {\n return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);\n },\n darker(k) {\n return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);\n },\n rgb() {\n return hcl2lab(this).rgb();\n }\n}));\n","import {lab as colorLab} from \"d3-color\";\nimport color from \"./color.js\";\n\nexport default function lab(start, end) {\n var l = color((start = colorLab(start)).l, (end = colorLab(end)).l),\n a = color(start.a, end.a),\n b = color(start.b, end.b),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.l = l(t);\n start.a = a(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n}\n","import {hcl as colorHcl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hcl(hue) {\n return function(start, end) {\n var h = hue((start = colorHcl(start)).h, (end = colorHcl(end)).h),\n c = color(start.c, end.c),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.c = c(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hcl(hue);\nexport var hclLong = hcl(color);\n","import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb, darker, brighter} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * degrees - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nexport default function cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nexport function Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * radians,\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new Rgb(\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n","import {cubehelix as colorCubehelix} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\nexport default cubehelix(hue);\nexport var cubehelixLong = cubehelix(color);\n","export default function(interpolator, n) {\n var samples = new Array(n);\n for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));\n return samples;\n}\n","export default function(specifier) {\n var n = specifier.length / 6 | 0, colors = new Array(n), i = 0;\n while (i < n) colors[i] = \"#\" + specifier.slice(i * 6, ++i * 6);\n return colors;\n}\n","import colors from \"../colors.js\";\n\nexport default colors(\"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f\");\n","import { toNumber, peek, toSet, array, constant, isArray, isNumber, span, isObject, isString, error } from 'vega-util';\nimport { bisectRight, range, bisect } from 'd3-array';\nimport * as $ from 'd3-scale';\nimport { scaleOrdinal, tickFormat as tickFormat$1 } from 'd3-scale';\nexport { scaleImplicit } from 'd3-scale';\nimport * as $$1 from 'd3-interpolate';\nimport { schemeAccent, schemeCategory10, schemeDark2, schemeObservable10, schemePaired, schemePastel1, schemePastel2, schemeSet1, schemeSet2, schemeSet3 } from 'd3-scale-chromatic';\nimport { timeInterval, utcInterval } from 'vega-time';\n\nfunction bandSpace (count, paddingInner, paddingOuter) {\n const space = count - paddingInner + paddingOuter * 2;\n return count ? space > 0 ? space : 1 : 0;\n}\n\nconst Identity = 'identity';\nconst Linear = 'linear';\nconst Log = 'log';\nconst Pow = 'pow';\nconst Sqrt = 'sqrt';\nconst Symlog = 'symlog';\nconst Time = 'time';\nconst UTC = 'utc';\nconst Sequential = 'sequential';\nconst Diverging = 'diverging';\nconst Quantile = 'quantile';\nconst Quantize = 'quantize';\nconst Threshold = 'threshold';\nconst Ordinal = 'ordinal';\nconst Point = 'point';\nconst Band = 'band';\nconst BinOrdinal = 'bin-ordinal';\n\n// categories\nconst Continuous = 'continuous';\nconst Discrete = 'discrete';\nconst Discretizing = 'discretizing';\nconst Interpolating = 'interpolating';\nconst Temporal = 'temporal';\n\nfunction invertRange (scale) {\n return function (_) {\n let lo = _[0],\n hi = _[1],\n t;\n if (hi < lo) {\n t = lo;\n lo = hi;\n hi = t;\n }\n return [scale.invert(lo), scale.invert(hi)];\n };\n}\n\nfunction invertRangeExtent (scale) {\n return function (_) {\n const range = scale.range();\n let lo = _[0],\n hi = _[1],\n min = -1,\n max,\n t,\n i,\n n;\n if (hi < lo) {\n t = lo;\n lo = hi;\n hi = t;\n }\n for (i = 0, n = range.length; i < n; ++i) {\n if (range[i] >= lo && range[i] <= hi) {\n if (min < 0) min = i;\n max = i;\n }\n }\n if (min < 0) return undefined;\n lo = scale.invertExtent(range[min]);\n hi = scale.invertExtent(range[max]);\n return [lo[0] === undefined ? lo[1] : lo[0], hi[1] === undefined ? hi[0] : hi[1]];\n };\n}\n\nfunction band() {\n const scale = scaleOrdinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range;\n let range$1 = [0, 1],\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n delete scale.unknown;\n function rescale() {\n const n = domain().length,\n reverse = range$1[1] < range$1[0],\n stop = range$1[1 - reverse],\n space = bandSpace(n, paddingInner, paddingOuter);\n let start = range$1[reverse - 0];\n step = (stop - start) / (space || 1);\n if (round) {\n step = Math.floor(step);\n }\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) {\n start = Math.round(start);\n bandwidth = Math.round(bandwidth);\n }\n const values = range(n).map(i => start + step * i);\n return ordinalRange(reverse ? values.reverse() : values);\n }\n scale.domain = function (_) {\n if (arguments.length) {\n domain(_);\n return rescale();\n } else {\n return domain();\n }\n };\n scale.range = function (_) {\n if (arguments.length) {\n range$1 = [+_[0], +_[1]];\n return rescale();\n } else {\n return range$1.slice();\n }\n };\n scale.rangeRound = function (_) {\n range$1 = [+_[0], +_[1]];\n round = true;\n return rescale();\n };\n scale.bandwidth = function () {\n return bandwidth;\n };\n scale.step = function () {\n return step;\n };\n scale.round = function (_) {\n if (arguments.length) {\n round = !!_;\n return rescale();\n } else {\n return round;\n }\n };\n scale.padding = function (_) {\n if (arguments.length) {\n paddingOuter = Math.max(0, Math.min(1, _));\n paddingInner = paddingOuter;\n return rescale();\n } else {\n return paddingInner;\n }\n };\n scale.paddingInner = function (_) {\n if (arguments.length) {\n paddingInner = Math.max(0, Math.min(1, _));\n return rescale();\n } else {\n return paddingInner;\n }\n };\n scale.paddingOuter = function (_) {\n if (arguments.length) {\n paddingOuter = Math.max(0, Math.min(1, _));\n return rescale();\n } else {\n return paddingOuter;\n }\n };\n scale.align = function (_) {\n if (arguments.length) {\n align = Math.max(0, Math.min(1, _));\n return rescale();\n } else {\n return align;\n }\n };\n scale.invertRange = function (_) {\n // bail if range has null or undefined values\n if (_[0] == null || _[1] == null) return;\n const reverse = range$1[1] < range$1[0],\n values = reverse ? ordinalRange().reverse() : ordinalRange(),\n n = values.length - 1;\n let lo = +_[0],\n hi = +_[1],\n a,\n b,\n t;\n\n // bail if either range endpoint is invalid\n if (lo !== lo || hi !== hi) return;\n\n // order range inputs, bail if outside of scale range\n if (hi < lo) {\n t = lo;\n lo = hi;\n hi = t;\n }\n if (hi < values[0] || lo > range$1[1 - reverse]) return;\n\n // binary search to index into scale range\n a = Math.max(0, bisectRight(values, lo) - 1);\n b = lo === hi ? a : bisectRight(values, hi) - 1;\n\n // increment index a if lo is within padding gap\n if (lo - values[a] > bandwidth + 1e-10) ++a;\n if (reverse) {\n // map + swap\n t = a;\n a = n - b;\n b = n - t;\n }\n return a > b ? undefined : domain().slice(a, b + 1);\n };\n scale.invert = function (_) {\n const value = scale.invertRange([_, _]);\n return value ? value[0] : value;\n };\n scale.copy = function () {\n return band().domain(domain()).range(range$1).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);\n };\n return rescale();\n}\nfunction pointish(scale) {\n const copy = scale.copy;\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n scale.copy = function () {\n return pointish(copy());\n };\n return scale;\n}\nfunction point() {\n return pointish(band().paddingInner(1));\n}\n\nvar map = Array.prototype.map;\nfunction numbers(_) {\n return map.call(_, toNumber);\n}\n\nconst slice = Array.prototype.slice;\n\nfunction scaleBinOrdinal() {\n let domain = [],\n range = [];\n function scale(x) {\n return x == null || x !== x ? undefined : range[(bisect(domain, x) - 1) % range.length];\n }\n scale.domain = function (_) {\n if (arguments.length) {\n domain = numbers(_);\n return scale;\n } else {\n return domain.slice();\n }\n };\n scale.range = function (_) {\n if (arguments.length) {\n range = slice.call(_);\n return scale;\n } else {\n return range.slice();\n }\n };\n scale.tickFormat = function (count, specifier) {\n return tickFormat$1(domain[0], peek(domain), count == null ? 10 : count, specifier);\n };\n scale.copy = function () {\n return scaleBinOrdinal().domain(scale.domain()).range(scale.range());\n };\n return scale;\n}\n\n/** Private scale registry: should not be exported */\nconst scales = new Map();\nconst VEGA_SCALE = Symbol('vega_scale');\nfunction registerScale(scale) {\n scale[VEGA_SCALE] = true;\n return scale;\n}\n\n/**\n * Return true if object was created by a constructor from the vega-scale `scale` function.\n */\nfunction isRegisteredScale(scale) {\n return scale && scale[VEGA_SCALE] === true;\n}\n\n/**\n * Augment scales with their type and needed inverse methods.\n */\nfunction create(type, constructor, metadata) {\n const ctr = function scale() {\n const s = constructor();\n if (!s.invertRange) {\n s.invertRange = s.invert ? invertRange(s) : s.invertExtent ? invertRangeExtent(s) : undefined;\n }\n s.type = type;\n return registerScale(s);\n };\n ctr.metadata = toSet(array(metadata));\n return ctr;\n}\n\n/**\n * Registry function for adding and accessing scale constructor functions.\n * The *type* argument is a String indicating the name of the scale type.\n *\n * If the *scale* argument is not specified, this method returns the matching scale constructor in the registry, or `null` if not found.\n * If the *scale* argument is provided, it must be a scale constructor function to add to the registry under the given *type* name.\n * The *metadata* argument provides additional information to guide appropriate use of scales within Vega.\n *\n * *metadata* can be either a string or string array. The valid string values are:\n * - `\"continuous\"` - the scale is defined over a continuous-valued domain.\n * - `\"discrete\"` - the scale is defined over a discrete domain and range.\n * - `\"discretizing\"` - the scale discretizes a continuous domain to a discrete range.\n * - `\"interpolating\"` - the scale range is defined using a color interpolator.\n * - `\"log\"` - the scale performs a logarithmic transform of the continuous domain.\n * - `\"temporal\"` - the scale domain is defined over date-time values.\n */\nfunction scale(type, scale, metadata) {\n if (arguments.length > 1) {\n scales.set(type, create(type, scale, metadata));\n return this;\n } else {\n return isValidScaleType(type) ? scales.get(type) : undefined;\n }\n}\n\n// identity scale\nscale(Identity, $.scaleIdentity);\n\n// continuous scales\nscale(Linear, $.scaleLinear, Continuous);\nscale(Log, $.scaleLog, [Continuous, Log]);\nscale(Pow, $.scalePow, Continuous);\nscale(Sqrt, $.scaleSqrt, Continuous);\nscale(Symlog, $.scaleSymlog, Continuous);\nscale(Time, $.scaleTime, [Continuous, Temporal]);\nscale(UTC, $.scaleUtc, [Continuous, Temporal]);\n\n// sequential scales\nscale(Sequential, $.scaleSequential, [Continuous, Interpolating]); // backwards compat\nscale(`${Sequential}-${Linear}`, $.scaleSequential, [Continuous, Interpolating]);\nscale(`${Sequential}-${Log}`, $.scaleSequentialLog, [Continuous, Interpolating, Log]);\nscale(`${Sequential}-${Pow}`, $.scaleSequentialPow, [Continuous, Interpolating]);\nscale(`${Sequential}-${Sqrt}`, $.scaleSequentialSqrt, [Continuous, Interpolating]);\nscale(`${Sequential}-${Symlog}`, $.scaleSequentialSymlog, [Continuous, Interpolating]);\n\n// diverging scales\nscale(`${Diverging}-${Linear}`, $.scaleDiverging, [Continuous, Interpolating]);\nscale(`${Diverging}-${Log}`, $.scaleDivergingLog, [Continuous, Interpolating, Log]);\nscale(`${Diverging}-${Pow}`, $.scaleDivergingPow, [Continuous, Interpolating]);\nscale(`${Diverging}-${Sqrt}`, $.scaleDivergingSqrt, [Continuous, Interpolating]);\nscale(`${Diverging}-${Symlog}`, $.scaleDivergingSymlog, [Continuous, Interpolating]);\n\n// discretizing scales\nscale(Quantile, $.scaleQuantile, [Discretizing, Quantile]);\nscale(Quantize, $.scaleQuantize, Discretizing);\nscale(Threshold, $.scaleThreshold, Discretizing);\n\n// discrete scales\nscale(BinOrdinal, scaleBinOrdinal, [Discrete, Discretizing]);\nscale(Ordinal, $.scaleOrdinal, Discrete);\nscale(Band, band, Discrete);\nscale(Point, point, Discrete);\nfunction isValidScaleType(type) {\n return scales.has(type);\n}\nfunction hasType(key, type) {\n const s = scales.get(key);\n return s && s.metadata[type];\n}\nfunction isContinuous(key) {\n return hasType(key, Continuous);\n}\nfunction isDiscrete(key) {\n return hasType(key, Discrete);\n}\nfunction isDiscretizing(key) {\n return hasType(key, Discretizing);\n}\nfunction isLogarithmic(key) {\n return hasType(key, Log);\n}\nfunction isTemporal(key) {\n return hasType(key, Temporal);\n}\nfunction isInterpolating(key) {\n return hasType(key, Interpolating);\n}\nfunction isQuantile(key) {\n return hasType(key, Quantile);\n}\n\nconst scaleProps = ['clamp', 'base', 'constant', 'exponent'];\nfunction interpolateRange(interpolator, range) {\n const start = range[0],\n span = peek(range) - start;\n return function (i) {\n return interpolator(start + i * span);\n };\n}\nfunction interpolateColors(colors, type, gamma) {\n return $$1.piecewise(interpolate(type || 'rgb', gamma), colors);\n}\nfunction quantizeInterpolator(interpolator, count) {\n const samples = new Array(count),\n n = count + 1;\n for (let i = 0; i < count;) samples[i] = interpolator(++i / n);\n return samples;\n}\nfunction scaleCopy(scale) {\n const t = scale.type,\n s = scale.copy();\n s.type = t;\n return s;\n}\nfunction scaleFraction(scale$1, min, max) {\n const delta = max - min;\n let i, t, s;\n if (!delta || !Number.isFinite(delta)) {\n return constant(0.5);\n } else {\n i = (t = scale$1.type).indexOf('-');\n t = i < 0 ? t : t.slice(i + 1);\n s = scale(t)().domain([min, max]).range([0, 1]);\n scaleProps.forEach(m => scale$1[m] ? s[m](scale$1[m]()) : 0);\n return s;\n }\n}\nfunction interpolate(type, gamma) {\n const interp = $$1[method(type)];\n return gamma != null && interp && interp.gamma ? interp.gamma(gamma) : interp;\n}\nfunction method(type) {\n return 'interpolate' + type.toLowerCase().split('-').map(s => s[0].toUpperCase() + s.slice(1)).join('');\n}\n\nconst continuous = {\n blues: 'cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90',\n greens: 'd3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429',\n greys: 'e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e',\n oranges: 'fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303',\n purples: 'e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c',\n reds: 'fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13',\n blueGreen: 'd5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429',\n bluePurple: 'ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71',\n greenBlue: 'd3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1',\n orangeRed: 'fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403',\n purpleBlue: 'dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281',\n purpleBlueGreen: 'dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353',\n purpleRed: 'dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a',\n redPurple: 'fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174',\n yellowGreen: 'e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034',\n yellowOrangeBrown: 'feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204',\n yellowOrangeRed: 'fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225',\n blueOrange: '134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07',\n brownBlueGreen: '704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147',\n purpleGreen: '5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29',\n purpleOrange: '4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07',\n redBlue: '8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85',\n redGrey: '8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434',\n yellowGreenBlue: 'eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185',\n redYellowBlue: 'a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695',\n redYellowGreen: 'a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837',\n pinkYellowGreen: '8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419',\n spectral: '9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2',\n viridis: '440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725',\n magma: '0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf',\n inferno: '0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4',\n plasma: '0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921',\n cividis: '00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647',\n rainbow: '6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa',\n sinebow: 'ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040',\n turbo: '23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00',\n browns: 'eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632',\n tealBlues: 'bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985',\n teals: 'bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667',\n warmGreys: 'dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e',\n goldGreen: 'f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36',\n goldOrange: 'f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26',\n goldRed: 'f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e',\n lightGreyRed: 'efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b',\n lightGreyTeal: 'e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc',\n lightMulti: 'e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c',\n lightOrange: 'f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b',\n lightTealBlue: 'e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988',\n darkBlue: '3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff',\n darkGold: '3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff',\n darkGreen: '3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa',\n darkMulti: '3737371f5287197d8c29a86995ce3fffe800ffffff',\n darkRed: '3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c'\n};\nconst discrete = {\n accent: schemeAccent,\n category10: schemeCategory10,\n category20: '1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5',\n category20b: '393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6',\n category20c: '3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9',\n dark2: schemeDark2,\n observable10: schemeObservable10,\n paired: schemePaired,\n pastel1: schemePastel1,\n pastel2: schemePastel2,\n set1: schemeSet1,\n set2: schemeSet2,\n set3: schemeSet3,\n tableau10: '4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac',\n tableau20: '4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5'\n};\n\nfunction colors(palette) {\n if (isArray(palette)) return palette;\n const n = palette.length / 6 | 0,\n c = new Array(n);\n for (let i = 0; i < n;) {\n c[i] = '#' + palette.slice(i * 6, ++i * 6);\n }\n return c;\n}\nfunction apply(_, f) {\n for (const k in _) scheme(k, f(_[k]));\n}\nconst schemes = {};\napply(discrete, colors);\napply(continuous, _ => interpolateColors(colors(_)));\nfunction scheme(name, scheme) {\n name = name && name.toLowerCase();\n if (arguments.length > 1) {\n schemes[name] = scheme;\n return this;\n } else {\n return schemes[name];\n }\n}\n\nconst SymbolLegend = 'symbol';\nconst DiscreteLegend = 'discrete';\nconst GradientLegend = 'gradient';\n\nconst defaultFormatter = value => isArray(value) ? value.map(v => String(v)) : String(value);\nconst ascending = (a, b) => a[1] - b[1];\nconst descending = (a, b) => b[1] - a[1];\n\n/**\n * Determine the tick count or interval function.\n * @param {Scale} scale - The scale for which to generate tick values.\n * @param {*} count - The desired tick count or interval specifier.\n * @param {number} minStep - The desired minimum step between tick values.\n * @return {*} - The tick count or interval function.\n */\nfunction tickCount(scale, count, minStep) {\n let step;\n if (isNumber(count)) {\n if (scale.bins) {\n count = Math.max(count, scale.bins.length);\n }\n if (minStep != null) {\n count = Math.min(count, Math.floor(span(scale.domain()) / minStep || 1) + 1);\n }\n }\n if (isObject(count)) {\n step = count.step;\n count = count.interval;\n }\n if (isString(count)) {\n count = scale.type === Time ? timeInterval(count) : scale.type == UTC ? utcInterval(count) : error('Only time and utc scales accept interval strings.');\n if (step) count = count.every(step);\n }\n return count;\n}\n\n/**\n * Filter a set of candidate tick values, ensuring that only tick values\n * that lie within the scale range are included.\n * @param {Scale} scale - The scale for which to generate tick values.\n * @param {Array<*>} ticks - The candidate tick values.\n * @param {*} count - The tick count or interval function.\n * @return {Array<*>} - The filtered tick values.\n */\nfunction validTicks(scale, ticks, count) {\n let range = scale.range(),\n lo = range[0],\n hi = peek(range),\n cmp = ascending;\n if (lo > hi) {\n range = hi;\n hi = lo;\n lo = range;\n cmp = descending;\n }\n lo = Math.floor(lo);\n hi = Math.ceil(hi);\n\n // filter ticks to valid values within the range\n // additionally sort ticks in range order (#2579)\n ticks = ticks.map(v => [v, scale(v)]).filter(_ => lo <= _[1] && _[1] <= hi).sort(cmp).map(_ => _[0]);\n if (count > 0 && ticks.length > 1) {\n const endpoints = [ticks[0], peek(ticks)];\n while (ticks.length > count && ticks.length >= 3) {\n ticks = ticks.filter((_, i) => !(i % 2));\n }\n if (ticks.length < 3) {\n ticks = endpoints;\n }\n }\n return ticks;\n}\n\n/**\n * Generate tick values for the given scale and approximate tick count or\n * interval value. If the scale has a 'ticks' method, it will be used to\n * generate the ticks, with the count argument passed as a parameter. If the\n * scale lacks a 'ticks' method, the full scale domain will be returned.\n * @param {Scale} scale - The scale for which to generate tick values.\n * @param {*} [count] - The approximate number of desired ticks.\n * @return {Array<*>} - The generated tick values.\n */\nfunction tickValues(scale, count) {\n return scale.bins ? validTicks(scale, scale.bins, count) : scale.ticks ? scale.ticks(count) : scale.domain();\n}\n\n/**\n * Generate a label format function for a scale. If the scale has a\n * 'tickFormat' method, it will be used to generate the formatter, with the\n * count and specifier arguments passed as parameters. If the scale lacks a\n * 'tickFormat' method, the returned formatter performs simple string coercion.\n * If the input scale is a logarithmic scale and the format specifier does not\n * indicate a desired decimal precision, a special variable precision formatter\n * that automatically trims trailing zeroes will be generated.\n * @param {Scale} scale - The scale for which to generate the label formatter.\n * @param {*} [count] - The approximate number of desired ticks.\n * @param {string} [specifier] - The format specifier. Must be a legal d3\n * specifier string (see https://github.com/d3/d3-format#formatSpecifier) or\n * time multi-format specifier object.\n * @return {function(*):string} - The generated label formatter.\n */\nfunction tickFormat(locale, scale, count, specifier, formatType, noSkip) {\n const type = scale.type;\n let format = defaultFormatter;\n if (type === Time || formatType === Time) {\n format = locale.timeFormat(specifier);\n } else if (type === UTC || formatType === UTC) {\n format = locale.utcFormat(specifier);\n } else if (isLogarithmic(type)) {\n const varfmt = locale.formatFloat(specifier);\n if (noSkip || scale.bins) {\n format = varfmt;\n } else {\n const test = tickLog(scale, count, false);\n format = _ => test(_) ? varfmt(_) : '';\n }\n } else if (scale.tickFormat) {\n // if d3 scale has tickFormat, it must be continuous\n const d = scale.domain();\n format = locale.formatSpan(d[0], d[d.length - 1], count, specifier);\n } else if (specifier) {\n format = locale.format(specifier);\n }\n return format;\n}\nfunction tickLog(scale, count, values) {\n const ticks = tickValues(scale, count),\n base = scale.base(),\n logb = Math.log(base),\n k = Math.max(1, base * count / ticks.length);\n\n // apply d3-scale's log format filter criteria\n const test = d => {\n let i = d / Math.pow(base, Math.round(Math.log(d) / logb));\n if (i * base < base - 0.5) i *= base;\n return i <= k;\n };\n return values ? ticks.filter(test) : test;\n}\n\nconst symbols = {\n [Quantile]: 'quantiles',\n [Quantize]: 'thresholds',\n [Threshold]: 'domain'\n};\nconst formats = {\n [Quantile]: 'quantiles',\n [Quantize]: 'domain'\n};\nfunction labelValues(scale, count) {\n return scale.bins ? binValues(scale.bins) : scale.type === Log ? tickLog(scale, count, true) : symbols[scale.type] ? thresholdValues(scale[symbols[scale.type]]()) : tickValues(scale, count);\n}\nfunction thresholdFormat(locale, scale, specifier) {\n const _ = scale[formats[scale.type]](),\n n = _.length;\n let d = n > 1 ? _[1] - _[0] : _[0],\n i;\n for (i = 1; i < n; ++i) {\n d = Math.min(d, _[i] - _[i - 1]);\n }\n\n // tickCount = 3 ticks times 10 for increased resolution\n return locale.formatSpan(0, d, 3 * 10, specifier);\n}\nfunction thresholdValues(thresholds) {\n const values = [-Infinity].concat(thresholds);\n values.max = +Infinity;\n return values;\n}\nfunction binValues(bins) {\n const values = bins.slice(0, -1);\n values.max = peek(bins);\n return values;\n}\nconst isDiscreteRange = scale => symbols[scale.type] || scale.bins;\nfunction labelFormat(locale, scale, count, type, specifier, formatType, noSkip) {\n const format = formats[scale.type] && formatType !== Time && formatType !== UTC ? thresholdFormat(locale, scale, specifier) : tickFormat(locale, scale, count, specifier, formatType, noSkip);\n return type === SymbolLegend && isDiscreteRange(scale) ? formatRange(format) : type === DiscreteLegend ? formatDiscrete(format) : formatPoint(format);\n}\nconst formatRange = format => (value, index, array) => {\n const limit = get(array[index + 1], get(array.max, +Infinity)),\n lo = formatValue(value, format),\n hi = formatValue(limit, format);\n return lo && hi ? lo + ' \\u2013 ' + hi : hi ? '< ' + hi : '\\u2265 ' + lo;\n};\nconst get = (value, dflt) => value != null ? value : dflt;\nconst formatDiscrete = format => (value, index) => index ? format(value) : null;\nconst formatPoint = format => value => format(value);\nconst formatValue = (value, format) => Number.isFinite(value) ? format(value) : null;\nfunction labelFraction(scale) {\n const domain = scale.domain(),\n count = domain.length - 1;\n let lo = +domain[0],\n hi = +peek(domain),\n span = hi - lo;\n if (scale.type === Threshold) {\n const adjust = count ? span / count : 0.1;\n lo -= adjust;\n hi += adjust;\n span = hi - lo;\n }\n return value => (value - lo) / span;\n}\n\nfunction format(locale, scale, specifier, formatType) {\n const type = formatType || scale.type;\n\n // replace abbreviated time specifiers to improve screen reader experience\n if (isString(specifier) && isTemporal(type)) {\n specifier = specifier.replace(/%a/g, '%A').replace(/%b/g, '%B');\n }\n return !specifier && type === Time ? locale.timeFormat('%A, %d %B %Y, %X') : !specifier && type === UTC ? locale.utcFormat('%A, %d %B %Y, %X UTC') : labelFormat(locale, scale, 5, null, specifier, formatType, true);\n}\nfunction domainCaption(locale, scale, opt) {\n opt = opt || {};\n const max = Math.max(3, opt.maxlen || 7),\n fmt = format(locale, scale, opt.format, opt.formatType);\n\n // if scale breaks domain into bins, describe boundaries\n if (isDiscretizing(scale.type)) {\n const v = labelValues(scale).slice(1).map(fmt),\n n = v.length;\n return `${n} boundar${n === 1 ? 'y' : 'ies'}: ${v.join(', ')}`;\n }\n\n // if scale domain is discrete, list values\n else if (isDiscrete(scale.type)) {\n const d = scale.domain(),\n n = d.length,\n v = n > max ? d.slice(0, max - 2).map(fmt).join(', ') + ', ending with ' + d.slice(-1).map(fmt) : d.map(fmt).join(', ');\n return `${n} value${n === 1 ? '' : 's'}: ${v}`;\n }\n\n // if scale domain is continuous, describe value range\n else {\n const d = scale.domain();\n return `values from ${fmt(d[0])} to ${fmt(peek(d))}`;\n }\n}\n\nexport { Band, BinOrdinal, DiscreteLegend, Diverging, GradientLegend, Identity, Linear, Log, Ordinal, Point, Pow, Quantile, Quantize, Sequential, Sqrt, SymbolLegend, Symlog, Threshold, Time, UTC, bandSpace, domainCaption, interpolate, interpolateColors, interpolateRange, isContinuous, isDiscrete, isDiscretizing, isInterpolating, isLogarithmic, isQuantile, isRegisteredScale, isTemporal, isValidScaleType, labelFormat, labelFraction, labelValues, quantizeInterpolator, registerScale, scale, scaleCopy, scaleFraction, scheme, tickCount, tickFormat, tickValues, validTicks };\n","import {linearish} from \"./linear.js\";\nimport number from \"./number.js\";\n\nexport default function identity(domain) {\n var unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = Array.from(_, number), scale) : domain.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return identity(domain).unknown(unknown);\n };\n\n domain = arguments.length ? Array.from(domain, number) : [0, 1];\n\n return linearish(scale);\n}\n","import {utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcTicks, utcTickInterval} from \"d3-time\";\nimport {utcFormat} from \"d3-time-format\";\nimport {calendar} from \"./time.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function utcTime() {\n return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);\n}\n","import {ascending, bisect, quantileSorted as threshold} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantile() {\n var domain = [],\n range = [],\n thresholds = [],\n unknown;\n\n function rescale() {\n var i = 0, n = Math.max(1, range.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = threshold(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : range[bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n","import {bisect} from \"d3-array\";\nimport {linearish} from \"./linear.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1],\n unknown;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : scale;\n };\n\n scale.thresholds = function() {\n return domain.slice();\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(linearish(scale), arguments);\n}\n","import {bisect} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function threshold() {\n var domain = [0.5],\n range = [0, 1],\n unknown,\n n = 1;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n","import { hasOwnProperty, isFunction, inherits, truthy, lruCache, isArray, error, toSet, array, peek, extend, isNumber, isObject } from 'vega-util';\nimport { curveBasis, curveBasisClosed, curveBasisOpen, curveBundle, curveCardinal, curveCardinalOpen, curveCardinalClosed, curveCatmullRom, curveCatmullRomClosed, curveCatmullRomOpen, curveLinear, curveLinearClosed, curveMonotoneY, curveMonotoneX, curveNatural, curveStep, curveStepAfter, curveStepBefore, arc as arc$2, area as area$2, line as line$2, symbol as symbol$2 } from 'd3-shape';\nimport { path as path$3 } from 'd3-path';\nexport { path } from 'd3-path';\nimport { image as image$1, canvas } from 'vega-canvas';\nimport { loader } from 'vega-loader';\nimport { isDiscrete, domainCaption } from 'vega-scale';\n\nlet gradient_id = 0;\nfunction resetSVGGradientId() {\n gradient_id = 0;\n}\nconst patternPrefix = 'p_';\nfunction isGradient(value) {\n return value && value.gradient;\n}\nfunction gradientRef(g, defs, base) {\n const type = g.gradient;\n let id = g.id,\n prefix = type === 'radial' ? patternPrefix : '';\n\n // check id, assign default values as needed\n if (!id) {\n id = g.id = 'gradient_' + gradient_id++;\n if (type === 'radial') {\n g.x1 = get(g.x1, 0.5);\n g.y1 = get(g.y1, 0.5);\n g.r1 = get(g.r1, 0);\n g.x2 = get(g.x2, 0.5);\n g.y2 = get(g.y2, 0.5);\n g.r2 = get(g.r2, 0.5);\n prefix = patternPrefix;\n } else {\n g.x1 = get(g.x1, 0);\n g.y1 = get(g.y1, 0);\n g.x2 = get(g.x2, 1);\n g.y2 = get(g.y2, 0);\n }\n }\n\n // register definition\n defs[id] = g;\n\n // return url reference\n return 'url(' + (base || '') + '#' + prefix + id + ')';\n}\nfunction get(val, def) {\n return val != null ? val : def;\n}\nfunction Gradient (p0, p1) {\n var stops = [],\n gradient;\n return gradient = {\n gradient: 'linear',\n x1: p0 ? p0[0] : 0,\n y1: p0 ? p0[1] : 0,\n x2: p1 ? p1[0] : 1,\n y2: p1 ? p1[1] : 0,\n stops: stops,\n stop: function (offset, color) {\n stops.push({\n offset: offset,\n color: color\n });\n return gradient;\n }\n };\n}\n\nconst lookup = {\n 'basis': {\n curve: curveBasis\n },\n 'basis-closed': {\n curve: curveBasisClosed\n },\n 'basis-open': {\n curve: curveBasisOpen\n },\n 'bundle': {\n curve: curveBundle,\n tension: 'beta',\n value: 0.85\n },\n 'cardinal': {\n curve: curveCardinal,\n tension: 'tension',\n value: 0\n },\n 'cardinal-open': {\n curve: curveCardinalOpen,\n tension: 'tension',\n value: 0\n },\n 'cardinal-closed': {\n curve: curveCardinalClosed,\n tension: 'tension',\n value: 0\n },\n 'catmull-rom': {\n curve: curveCatmullRom,\n tension: 'alpha',\n value: 0.5\n },\n 'catmull-rom-closed': {\n curve: curveCatmullRomClosed,\n tension: 'alpha',\n value: 0.5\n },\n 'catmull-rom-open': {\n curve: curveCatmullRomOpen,\n tension: 'alpha',\n value: 0.5\n },\n 'linear': {\n curve: curveLinear\n },\n 'linear-closed': {\n curve: curveLinearClosed\n },\n 'monotone': {\n horizontal: curveMonotoneY,\n vertical: curveMonotoneX\n },\n 'natural': {\n curve: curveNatural\n },\n 'step': {\n curve: curveStep\n },\n 'step-after': {\n curve: curveStepAfter\n },\n 'step-before': {\n curve: curveStepBefore\n }\n};\nfunction curves(type, orientation, tension) {\n var entry = hasOwnProperty(lookup, type) && lookup[type],\n curve = null;\n if (entry) {\n curve = entry.curve || entry[orientation || 'vertical'];\n if (entry.tension && tension != null) {\n curve = curve[entry.tension](tension);\n }\n }\n return curve;\n}\n\nconst paramCounts = {\n m: 2,\n l: 2,\n h: 1,\n v: 1,\n z: 0,\n c: 6,\n s: 4,\n q: 4,\n t: 2,\n a: 7\n};\nconst commandPattern = /[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi;\nconst numberPattern = /^[+-]?(([0-9]*\\.[0-9]+)|([0-9]+\\.)|([0-9]+))([eE][+-]?[0-9]+)?/;\nconst spacePattern = /^((\\s+,?\\s*)|(,\\s*))/;\nconst flagPattern = /^[01]/;\nfunction parse(path) {\n const commands = [];\n const matches = path.match(commandPattern) || [];\n matches.forEach(str => {\n let cmd = str[0];\n const type = cmd.toLowerCase();\n\n // parse parameters\n const paramCount = paramCounts[type];\n const params = parseParams(type, paramCount, str.slice(1).trim());\n const count = params.length;\n\n // error checking based on parameter count\n if (count < paramCount || count && count % paramCount !== 0) {\n throw Error('Invalid SVG path, incorrect parameter count');\n }\n\n // register the command\n commands.push([cmd, ...params.slice(0, paramCount)]);\n\n // exit now if we're done, also handles zero-param 'z'\n if (count === paramCount) {\n return;\n }\n\n // handle implicit line-to\n if (type === 'm') {\n cmd = cmd === 'M' ? 'L' : 'l';\n }\n\n // repeat command when given extended param list\n for (let i = paramCount; i < count; i += paramCount) {\n commands.push([cmd, ...params.slice(i, i + paramCount)]);\n }\n });\n return commands;\n}\nfunction parseParams(type, paramCount, segment) {\n const params = [];\n for (let index = 0; paramCount && index < segment.length;) {\n for (let i = 0; i < paramCount; ++i) {\n const pattern = type === 'a' && (i === 3 || i === 4) ? flagPattern : numberPattern;\n const match = segment.slice(index).match(pattern);\n if (match === null) {\n throw Error('Invalid SVG path, incorrect parameter type');\n }\n index += match[0].length;\n params.push(+match[0]);\n const ws = segment.slice(index).match(spacePattern);\n if (ws !== null) {\n index += ws[0].length;\n }\n }\n }\n return params;\n}\n\nconst DegToRad = Math.PI / 180;\nconst Epsilon = 1e-14;\nconst HalfPi = Math.PI / 2;\nconst Tau = Math.PI * 2;\nconst HalfSqrt3 = Math.sqrt(3) / 2;\n\nvar segmentCache = {};\nvar bezierCache = {};\nvar join = [].join;\n\n// Copied from Inkscape svgtopdf, thanks!\nfunction segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {\n const key = join.call(arguments);\n if (segmentCache[key]) {\n return segmentCache[key];\n }\n const th = rotateX * DegToRad;\n const sin_th = Math.sin(th);\n const cos_th = Math.cos(th);\n rx = Math.abs(rx);\n ry = Math.abs(ry);\n const px = cos_th * (ox - x) * 0.5 + sin_th * (oy - y) * 0.5;\n const py = cos_th * (oy - y) * 0.5 - sin_th * (ox - x) * 0.5;\n let pl = px * px / (rx * rx) + py * py / (ry * ry);\n if (pl > 1) {\n pl = Math.sqrt(pl);\n rx *= pl;\n ry *= pl;\n }\n const a00 = cos_th / rx;\n const a01 = sin_th / rx;\n const a10 = -sin_th / ry;\n const a11 = cos_th / ry;\n const x0 = a00 * ox + a01 * oy;\n const y0 = a10 * ox + a11 * oy;\n const x1 = a00 * x + a01 * y;\n const y1 = a10 * x + a11 * y;\n const d = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0);\n let sfactor_sq = 1 / d - 0.25;\n if (sfactor_sq < 0) sfactor_sq = 0;\n let sfactor = Math.sqrt(sfactor_sq);\n if (sweep == large) sfactor = -sfactor;\n const xc = 0.5 * (x0 + x1) - sfactor * (y1 - y0);\n const yc = 0.5 * (y0 + y1) + sfactor * (x1 - x0);\n const th0 = Math.atan2(y0 - yc, x0 - xc);\n const th1 = Math.atan2(y1 - yc, x1 - xc);\n let th_arc = th1 - th0;\n if (th_arc < 0 && sweep === 1) {\n th_arc += Tau;\n } else if (th_arc > 0 && sweep === 0) {\n th_arc -= Tau;\n }\n const segs = Math.ceil(Math.abs(th_arc / (HalfPi + 0.001)));\n const result = [];\n for (let i = 0; i < segs; ++i) {\n const th2 = th0 + i * th_arc / segs;\n const th3 = th0 + (i + 1) * th_arc / segs;\n result[i] = [xc, yc, th2, th3, rx, ry, sin_th, cos_th];\n }\n return segmentCache[key] = result;\n}\nfunction bezier(params) {\n const key = join.call(params);\n if (bezierCache[key]) {\n return bezierCache[key];\n }\n var cx = params[0],\n cy = params[1],\n th0 = params[2],\n th1 = params[3],\n rx = params[4],\n ry = params[5],\n sin_th = params[6],\n cos_th = params[7];\n const a00 = cos_th * rx;\n const a01 = -sin_th * ry;\n const a10 = sin_th * rx;\n const a11 = cos_th * ry;\n const cos_th0 = Math.cos(th0);\n const sin_th0 = Math.sin(th0);\n const cos_th1 = Math.cos(th1);\n const sin_th1 = Math.sin(th1);\n const th_half = 0.5 * (th1 - th0);\n const sin_th_h2 = Math.sin(th_half * 0.5);\n const t = 8 / 3 * sin_th_h2 * sin_th_h2 / Math.sin(th_half);\n const x1 = cx + cos_th0 - t * sin_th0;\n const y1 = cy + sin_th0 + t * cos_th0;\n const x3 = cx + cos_th1;\n const y3 = cy + sin_th1;\n const x2 = x3 + t * sin_th1;\n const y2 = y3 - t * cos_th1;\n return bezierCache[key] = [a00 * x1 + a01 * y1, a10 * x1 + a11 * y1, a00 * x2 + a01 * y2, a10 * x2 + a11 * y2, a00 * x3 + a01 * y3, a10 * x3 + a11 * y3];\n}\n\nconst temp = ['l', 0, 0, 0, 0, 0, 0, 0];\nfunction scale$1(current, sX, sY) {\n const c = temp[0] = current[0];\n if (c === 'a' || c === 'A') {\n temp[1] = sX * current[1];\n temp[2] = sY * current[2];\n temp[3] = current[3];\n temp[4] = current[4];\n temp[5] = current[5];\n temp[6] = sX * current[6];\n temp[7] = sY * current[7];\n } else if (c === 'h' || c === 'H') {\n temp[1] = sX * current[1];\n } else if (c === 'v' || c === 'V') {\n temp[1] = sY * current[1];\n } else {\n for (var i = 1, n = current.length; i < n; ++i) {\n temp[i] = (i % 2 == 1 ? sX : sY) * current[i];\n }\n }\n return temp;\n}\nfunction pathRender (context, path, l, t, sX, sY) {\n var current,\n // current instruction\n previous = null,\n x = 0,\n // current x\n y = 0,\n // current y\n controlX = 0,\n // current control point x\n controlY = 0,\n // current control point y\n tempX,\n tempY,\n tempControlX,\n tempControlY,\n anchorX = 0,\n anchorY = 0;\n if (l == null) l = 0;\n if (t == null) t = 0;\n if (sX == null) sX = 1;\n if (sY == null) sY = sX;\n if (context.beginPath) context.beginPath();\n for (var i = 0, len = path.length; i < len; ++i) {\n current = path[i];\n if (sX !== 1 || sY !== 1) {\n current = scale$1(current, sX, sY);\n }\n switch (current[0]) {\n // first letter\n\n case 'l':\n // lineto, relative\n x += current[1];\n y += current[2];\n context.lineTo(x + l, y + t);\n break;\n case 'L':\n // lineto, absolute\n x = current[1];\n y = current[2];\n context.lineTo(x + l, y + t);\n break;\n case 'h':\n // horizontal lineto, relative\n x += current[1];\n context.lineTo(x + l, y + t);\n break;\n case 'H':\n // horizontal lineto, absolute\n x = current[1];\n context.lineTo(x + l, y + t);\n break;\n case 'v':\n // vertical lineto, relative\n y += current[1];\n context.lineTo(x + l, y + t);\n break;\n case 'V':\n // verical lineto, absolute\n y = current[1];\n context.lineTo(x + l, y + t);\n break;\n case 'm':\n // moveTo, relative\n x += current[1];\n y += current[2];\n anchorX = x;\n anchorY = y;\n context.moveTo(x + l, y + t);\n break;\n case 'M':\n // moveTo, absolute\n x = current[1];\n y = current[2];\n anchorX = x;\n anchorY = y;\n context.moveTo(x + l, y + t);\n break;\n case 'c':\n // bezierCurveTo, relative\n tempX = x + current[5];\n tempY = y + current[6];\n controlX = x + current[3];\n controlY = y + current[4];\n context.bezierCurveTo(x + current[1] + l,\n // x1\n y + current[2] + t,\n // y1\n controlX + l,\n // x2\n controlY + t,\n // y2\n tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n case 'C':\n // bezierCurveTo, absolute\n x = current[5];\n y = current[6];\n controlX = current[3];\n controlY = current[4];\n context.bezierCurveTo(current[1] + l, current[2] + t, controlX + l, controlY + t, x + l, y + t);\n break;\n case 's':\n // shorthand cubic bezierCurveTo, relative\n // transform to absolute x,y\n tempX = x + current[3];\n tempY = y + current[4];\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n context.bezierCurveTo(controlX + l, controlY + t, x + current[1] + l, y + current[2] + t, tempX + l, tempY + t);\n\n // set control point to 2nd one of this command\n // the first control point is assumed to be the reflection of\n // the second control point on the previous command relative\n // to the current point.\n controlX = x + current[1];\n controlY = y + current[2];\n x = tempX;\n y = tempY;\n break;\n case 'S':\n // shorthand cubic bezierCurveTo, absolute\n tempX = current[3];\n tempY = current[4];\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n context.bezierCurveTo(controlX + l, controlY + t, current[1] + l, current[2] + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n // set control point to 2nd one of this command\n // the first control point is assumed to be the reflection of\n // the second control point on the previous command relative\n // to the current point.\n controlX = current[1];\n controlY = current[2];\n break;\n case 'q':\n // quadraticCurveTo, relative\n // transform to absolute x,y\n tempX = x + current[3];\n tempY = y + current[4];\n controlX = x + current[1];\n controlY = y + current[2];\n context.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n case 'Q':\n // quadraticCurveTo, absolute\n tempX = current[3];\n tempY = current[4];\n context.quadraticCurveTo(current[1] + l, current[2] + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n controlX = current[1];\n controlY = current[2];\n break;\n case 't':\n // shorthand quadraticCurveTo, relative\n\n // transform to absolute x,y\n tempX = x + current[1];\n tempY = y + current[2];\n if (previous[0].match(/[QqTt]/) === null) {\n // If there is no previous command or if the previous command was not a Q, q, T or t,\n // assume the control point is coincident with the current point\n controlX = x;\n controlY = y;\n } else if (previous[0] === 't') {\n // calculate reflection of previous control points for t\n controlX = 2 * x - tempControlX;\n controlY = 2 * y - tempControlY;\n } else if (previous[0] === 'q') {\n // calculate reflection of previous control points for q\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n }\n tempControlX = controlX;\n tempControlY = controlY;\n context.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n controlX = x + current[1];\n controlY = y + current[2];\n break;\n case 'T':\n tempX = current[1];\n tempY = current[2];\n\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n context.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n case 'a':\n drawArc(context, x + l, y + t, [current[1], current[2], current[3], current[4], current[5], current[6] + x + l, current[7] + y + t]);\n x += current[6];\n y += current[7];\n break;\n case 'A':\n drawArc(context, x + l, y + t, [current[1], current[2], current[3], current[4], current[5], current[6] + l, current[7] + t]);\n x = current[6];\n y = current[7];\n break;\n case 'z':\n case 'Z':\n x = anchorX;\n y = anchorY;\n context.closePath();\n break;\n }\n previous = current;\n }\n}\nfunction drawArc(context, x, y, coords) {\n const seg = segments(coords[5],\n // end x\n coords[6],\n // end y\n coords[0],\n // radius x\n coords[1],\n // radius y\n coords[3],\n // large flag\n coords[4],\n // sweep flag\n coords[2],\n // rotation\n x, y);\n for (let i = 0; i < seg.length; ++i) {\n const bez = bezier(seg[i]);\n context.bezierCurveTo(bez[0], bez[1], bez[2], bez[3], bez[4], bez[5]);\n }\n}\n\nconst Tan30 = 0.5773502691896257;\nconst builtins = {\n 'circle': {\n draw: function (context, size) {\n const r = Math.sqrt(size) / 2;\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, Tau);\n }\n },\n 'cross': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n s = r / 2.5;\n context.moveTo(-r, -s);\n context.lineTo(-r, s);\n context.lineTo(-s, s);\n context.lineTo(-s, r);\n context.lineTo(s, r);\n context.lineTo(s, s);\n context.lineTo(r, s);\n context.lineTo(r, -s);\n context.lineTo(s, -s);\n context.lineTo(s, -r);\n context.lineTo(-s, -r);\n context.lineTo(-s, -s);\n context.closePath();\n }\n },\n 'diamond': {\n draw: function (context, size) {\n const r = Math.sqrt(size) / 2;\n context.moveTo(-r, 0);\n context.lineTo(0, -r);\n context.lineTo(r, 0);\n context.lineTo(0, r);\n context.closePath();\n }\n },\n 'square': {\n draw: function (context, size) {\n var w = Math.sqrt(size),\n x = -w / 2;\n context.rect(x, x, w, w);\n }\n },\n 'arrow': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n s = r / 7,\n t = r / 2.5,\n v = r / 8;\n context.moveTo(-s, r);\n context.lineTo(s, r);\n context.lineTo(s, -v);\n context.lineTo(t, -v);\n context.lineTo(0, -r);\n context.lineTo(-t, -v);\n context.lineTo(-s, -v);\n context.closePath();\n }\n },\n 'wedge': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r,\n o = h - r * Tan30,\n b = r / 4;\n context.moveTo(0, -h - o);\n context.lineTo(-b, h - o);\n context.lineTo(b, h - o);\n context.closePath();\n }\n },\n 'triangle': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r,\n o = h - r * Tan30;\n context.moveTo(0, -h - o);\n context.lineTo(-r, h - o);\n context.lineTo(r, h - o);\n context.closePath();\n }\n },\n 'triangle-up': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(0, -h);\n context.lineTo(-r, h);\n context.lineTo(r, h);\n context.closePath();\n }\n },\n 'triangle-down': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(0, h);\n context.lineTo(-r, -h);\n context.lineTo(r, -h);\n context.closePath();\n }\n },\n 'triangle-right': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(h, 0);\n context.lineTo(-h, -r);\n context.lineTo(-h, r);\n context.closePath();\n }\n },\n 'triangle-left': {\n draw: function (context, size) {\n var r = Math.sqrt(size) / 2,\n h = HalfSqrt3 * r;\n context.moveTo(-h, 0);\n context.lineTo(h, -r);\n context.lineTo(h, r);\n context.closePath();\n }\n },\n 'stroke': {\n draw: function (context, size) {\n const r = Math.sqrt(size) / 2;\n context.moveTo(-r, 0);\n context.lineTo(r, 0);\n }\n }\n};\nfunction symbols(_) {\n return hasOwnProperty(builtins, _) ? builtins[_] : customSymbol(_);\n}\nvar custom = {};\nfunction customSymbol(path) {\n if (!hasOwnProperty(custom, path)) {\n const parsed = parse(path);\n custom[path] = {\n draw: function (context, size) {\n pathRender(context, parsed, 0, 0, Math.sqrt(size) / 2);\n }\n };\n }\n return custom[path];\n}\n\n// See http://spencermortensen.com/articles/bezier-circle/\nconst C = 0.448084975506; // C = 1 - c\n\nfunction rectangleX(d) {\n return d.x;\n}\nfunction rectangleY(d) {\n return d.y;\n}\nfunction rectangleWidth(d) {\n return d.width;\n}\nfunction rectangleHeight(d) {\n return d.height;\n}\nfunction number(_) {\n return typeof _ === 'function' ? _ : () => +_;\n}\nfunction clamp(value, min, max) {\n return Math.max(min, Math.min(value, max));\n}\nfunction vg_rect () {\n var x = rectangleX,\n y = rectangleY,\n width = rectangleWidth,\n height = rectangleHeight,\n crTL = number(0),\n crTR = crTL,\n crBL = crTL,\n crBR = crTL,\n context = null;\n function rectangle(_, x0, y0) {\n var buffer,\n x1 = x0 != null ? x0 : +x.call(this, _),\n y1 = y0 != null ? y0 : +y.call(this, _),\n w = +width.call(this, _),\n h = +height.call(this, _),\n s = Math.min(w, h) / 2,\n tl = clamp(+crTL.call(this, _), 0, s),\n tr = clamp(+crTR.call(this, _), 0, s),\n bl = clamp(+crBL.call(this, _), 0, s),\n br = clamp(+crBR.call(this, _), 0, s);\n if (!context) context = buffer = path$3();\n if (tl <= 0 && tr <= 0 && bl <= 0 && br <= 0) {\n context.rect(x1, y1, w, h);\n } else {\n var x2 = x1 + w,\n y2 = y1 + h;\n context.moveTo(x1 + tl, y1);\n context.lineTo(x2 - tr, y1);\n context.bezierCurveTo(x2 - C * tr, y1, x2, y1 + C * tr, x2, y1 + tr);\n context.lineTo(x2, y2 - br);\n context.bezierCurveTo(x2, y2 - C * br, x2 - C * br, y2, x2 - br, y2);\n context.lineTo(x1 + bl, y2);\n context.bezierCurveTo(x1 + C * bl, y2, x1, y2 - C * bl, x1, y2 - bl);\n context.lineTo(x1, y1 + tl);\n context.bezierCurveTo(x1, y1 + C * tl, x1 + C * tl, y1, x1 + tl, y1);\n context.closePath();\n }\n if (buffer) {\n context = null;\n return buffer + '' || null;\n }\n }\n rectangle.x = function (_) {\n if (arguments.length) {\n x = number(_);\n return rectangle;\n } else {\n return x;\n }\n };\n rectangle.y = function (_) {\n if (arguments.length) {\n y = number(_);\n return rectangle;\n } else {\n return y;\n }\n };\n rectangle.width = function (_) {\n if (arguments.length) {\n width = number(_);\n return rectangle;\n } else {\n return width;\n }\n };\n rectangle.height = function (_) {\n if (arguments.length) {\n height = number(_);\n return rectangle;\n } else {\n return height;\n }\n };\n rectangle.cornerRadius = function (tl, tr, br, bl) {\n if (arguments.length) {\n crTL = number(tl);\n crTR = tr != null ? number(tr) : crTL;\n crBR = br != null ? number(br) : crTL;\n crBL = bl != null ? number(bl) : crTR;\n return rectangle;\n } else {\n return crTL;\n }\n };\n rectangle.context = function (_) {\n if (arguments.length) {\n context = _ == null ? null : _;\n return rectangle;\n } else {\n return context;\n }\n };\n return rectangle;\n}\n\nfunction vg_trail () {\n var x,\n y,\n size,\n defined,\n context = null,\n ready,\n x1,\n y1,\n r1;\n function point(x2, y2, w2) {\n const r2 = w2 / 2;\n if (ready) {\n var ux = y1 - y2,\n uy = x2 - x1;\n if (ux || uy) {\n // get normal vector\n var ud = Math.hypot(ux, uy),\n rx = (ux /= ud) * r1,\n ry = (uy /= ud) * r1,\n t = Math.atan2(uy, ux);\n\n // draw segment\n context.moveTo(x1 - rx, y1 - ry);\n context.lineTo(x2 - ux * r2, y2 - uy * r2);\n context.arc(x2, y2, r2, t - Math.PI, t);\n context.lineTo(x1 + rx, y1 + ry);\n context.arc(x1, y1, r1, t, t + Math.PI);\n } else {\n context.arc(x2, y2, r2, 0, Tau);\n }\n context.closePath();\n } else {\n ready = 1;\n }\n x1 = x2;\n y1 = y2;\n r1 = r2;\n }\n function trail(data) {\n var i,\n n = data.length,\n d,\n defined0 = false,\n buffer;\n if (context == null) context = buffer = path$3();\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) ready = 0;\n }\n if (defined0) point(+x(d, i, data), +y(d, i, data), +size(d, i, data));\n }\n if (buffer) {\n context = null;\n return buffer + '' || null;\n }\n }\n trail.x = function (_) {\n if (arguments.length) {\n x = _;\n return trail;\n } else {\n return x;\n }\n };\n trail.y = function (_) {\n if (arguments.length) {\n y = _;\n return trail;\n } else {\n return y;\n }\n };\n trail.size = function (_) {\n if (arguments.length) {\n size = _;\n return trail;\n } else {\n return size;\n }\n };\n trail.defined = function (_) {\n if (arguments.length) {\n defined = _;\n return trail;\n } else {\n return defined;\n }\n };\n trail.context = function (_) {\n if (arguments.length) {\n if (_ == null) {\n context = null;\n } else {\n context = _;\n }\n return trail;\n } else {\n return context;\n }\n };\n return trail;\n}\n\nfunction value$1(a, b) {\n return a != null ? a : b;\n}\nconst x = item => item.x || 0,\n y = item => item.y || 0,\n w = item => item.width || 0,\n h = item => item.height || 0,\n xw = item => (item.x || 0) + (item.width || 0),\n yh = item => (item.y || 0) + (item.height || 0),\n sa = item => item.startAngle || 0,\n ea = item => item.endAngle || 0,\n pa = item => item.padAngle || 0,\n ir = item => item.innerRadius || 0,\n or = item => item.outerRadius || 0,\n cr = item => item.cornerRadius || 0,\n tl = item => value$1(item.cornerRadiusTopLeft, item.cornerRadius) || 0,\n tr = item => value$1(item.cornerRadiusTopRight, item.cornerRadius) || 0,\n br = item => value$1(item.cornerRadiusBottomRight, item.cornerRadius) || 0,\n bl = item => value$1(item.cornerRadiusBottomLeft, item.cornerRadius) || 0,\n sz = item => value$1(item.size, 64),\n ts = item => item.size || 1,\n def = item => !(item.defined === false),\n type = item => symbols(item.shape || 'circle');\nconst arcShape = arc$2().startAngle(sa).endAngle(ea).padAngle(pa).innerRadius(ir).outerRadius(or).cornerRadius(cr),\n areavShape = area$2().x(x).y1(y).y0(yh).defined(def),\n areahShape = area$2().y(y).x1(x).x0(xw).defined(def),\n lineShape = line$2().x(x).y(y).defined(def),\n rectShape = vg_rect().x(x).y(y).width(w).height(h).cornerRadius(tl, tr, br, bl),\n symbolShape = symbol$2().type(type).size(sz),\n trailShape = vg_trail().x(x).y(y).defined(def).size(ts);\nfunction hasCornerRadius(item) {\n return item.cornerRadius || item.cornerRadiusTopLeft || item.cornerRadiusTopRight || item.cornerRadiusBottomRight || item.cornerRadiusBottomLeft;\n}\nfunction arc$1(context, item) {\n return arcShape.context(context)(item);\n}\nfunction area$1(context, items) {\n const item = items[0],\n interp = item.interpolate || 'linear';\n return (item.orient === 'horizontal' ? areahShape : areavShape).curve(curves(interp, item.orient, item.tension)).context(context)(items);\n}\nfunction line$1(context, items) {\n const item = items[0],\n interp = item.interpolate || 'linear';\n return lineShape.curve(curves(interp, item.orient, item.tension)).context(context)(items);\n}\nfunction rectangle(context, item, x, y) {\n return rectShape.context(context)(item, x, y);\n}\nfunction shape$1(context, item) {\n return (item.mark.shape || item.shape).context(context)(item);\n}\nfunction symbol$1(context, item) {\n return symbolShape.context(context)(item);\n}\nfunction trail$1(context, items) {\n return trailShape.context(context)(items);\n}\n\nvar clip_id = 1;\nfunction resetSVGClipId() {\n clip_id = 1;\n}\nfunction clip$1 (renderer, item, size) {\n var clip = item.clip,\n defs = renderer._defs,\n id = item.clip_id || (item.clip_id = 'clip' + clip_id++),\n c = defs.clipping[id] || (defs.clipping[id] = {\n id: id\n });\n if (isFunction(clip)) {\n c.path = clip(null);\n } else if (hasCornerRadius(size)) {\n c.path = rectangle(null, size, 0, 0);\n } else {\n c.width = size.width || 0;\n c.height = size.height || 0;\n }\n return 'url(#' + id + ')';\n}\n\nfunction Bounds(b) {\n this.clear();\n if (b) this.union(b);\n}\nBounds.prototype = {\n clone() {\n return new Bounds(this);\n },\n clear() {\n this.x1 = +Number.MAX_VALUE;\n this.y1 = +Number.MAX_VALUE;\n this.x2 = -Number.MAX_VALUE;\n this.y2 = -Number.MAX_VALUE;\n return this;\n },\n empty() {\n return this.x1 === +Number.MAX_VALUE && this.y1 === +Number.MAX_VALUE && this.x2 === -Number.MAX_VALUE && this.y2 === -Number.MAX_VALUE;\n },\n equals(b) {\n return this.x1 === b.x1 && this.y1 === b.y1 && this.x2 === b.x2 && this.y2 === b.y2;\n },\n set(x1, y1, x2, y2) {\n if (x2 < x1) {\n this.x2 = x1;\n this.x1 = x2;\n } else {\n this.x1 = x1;\n this.x2 = x2;\n }\n if (y2 < y1) {\n this.y2 = y1;\n this.y1 = y2;\n } else {\n this.y1 = y1;\n this.y2 = y2;\n }\n return this;\n },\n add(x, y) {\n if (x < this.x1) this.x1 = x;\n if (y < this.y1) this.y1 = y;\n if (x > this.x2) this.x2 = x;\n if (y > this.y2) this.y2 = y;\n return this;\n },\n expand(d) {\n this.x1 -= d;\n this.y1 -= d;\n this.x2 += d;\n this.y2 += d;\n return this;\n },\n round() {\n this.x1 = Math.floor(this.x1);\n this.y1 = Math.floor(this.y1);\n this.x2 = Math.ceil(this.x2);\n this.y2 = Math.ceil(this.y2);\n return this;\n },\n scale(s) {\n this.x1 *= s;\n this.y1 *= s;\n this.x2 *= s;\n this.y2 *= s;\n return this;\n },\n translate(dx, dy) {\n this.x1 += dx;\n this.x2 += dx;\n this.y1 += dy;\n this.y2 += dy;\n return this;\n },\n rotate(angle, x, y) {\n const p = this.rotatedPoints(angle, x, y);\n return this.clear().add(p[0], p[1]).add(p[2], p[3]).add(p[4], p[5]).add(p[6], p[7]);\n },\n rotatedPoints(angle, x, y) {\n var {\n x1,\n y1,\n x2,\n y2\n } = this,\n cos = Math.cos(angle),\n sin = Math.sin(angle),\n cx = x - x * cos + y * sin,\n cy = y - x * sin - y * cos;\n return [cos * x1 - sin * y1 + cx, sin * x1 + cos * y1 + cy, cos * x1 - sin * y2 + cx, sin * x1 + cos * y2 + cy, cos * x2 - sin * y1 + cx, sin * x2 + cos * y1 + cy, cos * x2 - sin * y2 + cx, sin * x2 + cos * y2 + cy];\n },\n union(b) {\n if (b.x1 < this.x1) this.x1 = b.x1;\n if (b.y1 < this.y1) this.y1 = b.y1;\n if (b.x2 > this.x2) this.x2 = b.x2;\n if (b.y2 > this.y2) this.y2 = b.y2;\n return this;\n },\n intersect(b) {\n if (b.x1 > this.x1) this.x1 = b.x1;\n if (b.y1 > this.y1) this.y1 = b.y1;\n if (b.x2 < this.x2) this.x2 = b.x2;\n if (b.y2 < this.y2) this.y2 = b.y2;\n return this;\n },\n encloses(b) {\n return b && this.x1 <= b.x1 && this.x2 >= b.x2 && this.y1 <= b.y1 && this.y2 >= b.y2;\n },\n alignsWith(b) {\n return b && (this.x1 == b.x1 || this.x2 == b.x2 || this.y1 == b.y1 || this.y2 == b.y2);\n },\n intersects(b) {\n return b && !(this.x2 < b.x1 || this.x1 > b.x2 || this.y2 < b.y1 || this.y1 > b.y2);\n },\n contains(x, y) {\n return !(x < this.x1 || x > this.x2 || y < this.y1 || y > this.y2);\n },\n width() {\n return this.x2 - this.x1;\n },\n height() {\n return this.y2 - this.y1;\n }\n};\n\nfunction Item(mark) {\n this.mark = mark;\n this.bounds = this.bounds || new Bounds();\n}\n\nfunction GroupItem(mark) {\n Item.call(this, mark);\n this.items = this.items || [];\n}\ninherits(GroupItem, Item);\n\nclass ResourceLoader {\n constructor(customLoader) {\n this._pending = 0;\n this._loader = customLoader || loader();\n }\n pending() {\n return this._pending;\n }\n sanitizeURL(uri) {\n const loader = this;\n increment(loader);\n return loader._loader.sanitize(uri, {\n context: 'href'\n }).then(opt => {\n decrement(loader);\n return opt;\n }).catch(() => {\n decrement(loader);\n return null;\n });\n }\n loadImage(uri) {\n const loader = this,\n Image = image$1();\n increment(loader);\n return loader._loader.sanitize(uri, {\n context: 'image'\n }).then(opt => {\n const url = opt.href;\n if (!url || !Image) throw {\n url: url\n };\n const img = new Image();\n\n // set crossOrigin only if cors is defined; empty string sets anonymous mode\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/crossOrigin\n const cors = hasOwnProperty(opt, 'crossOrigin') ? opt.crossOrigin : 'anonymous';\n if (cors != null) img.crossOrigin = cors;\n\n // attempt to load image resource\n img.onload = () => decrement(loader);\n img.onerror = () => decrement(loader);\n img.src = url;\n return img;\n }).catch(e => {\n decrement(loader);\n return {\n complete: false,\n width: 0,\n height: 0,\n src: e && e.url || ''\n };\n });\n }\n ready() {\n const loader = this;\n return new Promise(accept => {\n function poll(value) {\n if (!loader.pending()) accept(value);else setTimeout(() => {\n poll(true);\n }, 10);\n }\n poll(false);\n });\n }\n}\nfunction increment(loader) {\n loader._pending += 1;\n}\nfunction decrement(loader) {\n loader._pending -= 1;\n}\n\nfunction boundStroke (bounds, item, miter) {\n if (item.stroke && item.opacity !== 0 && item.strokeOpacity !== 0) {\n const sw = item.strokeWidth != null ? +item.strokeWidth : 1;\n bounds.expand(sw + (miter ? miterAdjustment(item, sw) : 0));\n }\n return bounds;\n}\nfunction miterAdjustment(item, strokeWidth) {\n // TODO: more sophisticated adjustment? Or miter support in boundContext?\n return item.strokeJoin && item.strokeJoin !== 'miter' ? 0 : strokeWidth;\n}\n\nconst circleThreshold = Tau - 1e-8;\nlet bounds, lx, ly, rot, ma, mb, mc, md;\nconst add = (x, y) => bounds.add(x, y);\nconst addL = (x, y) => add(lx = x, ly = y);\nconst addX = x => add(x, bounds.y1);\nconst addY = y => add(bounds.x1, y);\nconst px = (x, y) => ma * x + mc * y;\nconst py = (x, y) => mb * x + md * y;\nconst addp = (x, y) => add(px(x, y), py(x, y));\nconst addpL = (x, y) => addL(px(x, y), py(x, y));\nfunction boundContext (_, deg) {\n bounds = _;\n if (deg) {\n rot = deg * DegToRad;\n ma = md = Math.cos(rot);\n mb = Math.sin(rot);\n mc = -mb;\n } else {\n ma = md = 1;\n rot = mb = mc = 0;\n }\n return context$1;\n}\nconst context$1 = {\n beginPath() {},\n closePath() {},\n moveTo: addpL,\n lineTo: addpL,\n rect(x, y, w, h) {\n if (rot) {\n addp(x + w, y);\n addp(x + w, y + h);\n addp(x, y + h);\n addpL(x, y);\n } else {\n add(x + w, y + h);\n addL(x, y);\n }\n },\n quadraticCurveTo(x1, y1, x2, y2) {\n const px1 = px(x1, y1),\n py1 = py(x1, y1),\n px2 = px(x2, y2),\n py2 = py(x2, y2);\n quadExtrema(lx, px1, px2, addX);\n quadExtrema(ly, py1, py2, addY);\n addL(px2, py2);\n },\n bezierCurveTo(x1, y1, x2, y2, x3, y3) {\n const px1 = px(x1, y1),\n py1 = py(x1, y1),\n px2 = px(x2, y2),\n py2 = py(x2, y2),\n px3 = px(x3, y3),\n py3 = py(x3, y3);\n cubicExtrema(lx, px1, px2, px3, addX);\n cubicExtrema(ly, py1, py2, py3, addY);\n addL(px3, py3);\n },\n arc(cx, cy, r, sa, ea, ccw) {\n sa += rot;\n ea += rot;\n\n // store last point on path\n lx = r * Math.cos(ea) + cx;\n ly = r * Math.sin(ea) + cy;\n if (Math.abs(ea - sa) > circleThreshold) {\n // treat as full circle\n add(cx - r, cy - r);\n add(cx + r, cy + r);\n } else {\n const update = a => add(r * Math.cos(a) + cx, r * Math.sin(a) + cy);\n let s, i;\n\n // sample end points\n update(sa);\n update(ea);\n\n // sample interior points aligned with 90 degrees\n if (ea !== sa) {\n sa = sa % Tau;\n if (sa < 0) sa += Tau;\n ea = ea % Tau;\n if (ea < 0) ea += Tau;\n if (ea < sa) {\n ccw = !ccw; // flip direction\n s = sa;\n sa = ea;\n ea = s; // swap end-points\n }\n if (ccw) {\n ea -= Tau;\n s = sa - sa % HalfPi;\n for (i = 0; i < 4 && s > ea; ++i, s -= HalfPi) update(s);\n } else {\n s = sa - sa % HalfPi + HalfPi;\n for (i = 0; i < 4 && s < ea; ++i, s = s + HalfPi) update(s);\n }\n }\n }\n }\n};\nfunction quadExtrema(x0, x1, x2, cb) {\n const t = (x0 - x1) / (x0 + x2 - 2 * x1);\n if (0 < t && t < 1) cb(x0 + (x1 - x0) * t);\n}\nfunction cubicExtrema(x0, x1, x2, x3, cb) {\n const a = x3 - x0 + 3 * x1 - 3 * x2,\n b = x0 + x2 - 2 * x1,\n c = x0 - x1;\n let t0 = 0,\n t1 = 0,\n r;\n\n // solve for parameter t\n if (Math.abs(a) > Epsilon) {\n // quadratic equation\n r = b * b + c * a;\n if (r >= 0) {\n r = Math.sqrt(r);\n t0 = (-b + r) / a;\n t1 = (-b - r) / a;\n }\n } else {\n // linear equation\n t0 = 0.5 * c / b;\n }\n\n // calculate position\n if (0 < t0 && t0 < 1) cb(cubic(t0, x0, x1, x2, x3));\n if (0 < t1 && t1 < 1) cb(cubic(t1, x0, x1, x2, x3));\n}\nfunction cubic(t, x0, x1, x2, x3) {\n const s = 1 - t,\n s2 = s * s,\n t2 = t * t;\n return s2 * s * x0 + 3 * s2 * t * x1 + 3 * s * t2 * x2 + t2 * t * x3;\n}\n\nvar context = (context = canvas(1, 1)) ? context.getContext('2d') : null;\n\nconst b = new Bounds();\nfunction intersectPath(draw) {\n return function (item, brush) {\n // rely on (inaccurate) bounds intersection if no context\n if (!context) return true;\n\n // add path to offscreen graphics context\n draw(context, item);\n\n // get bounds intersection region\n b.clear().union(item.bounds).intersect(brush).round();\n const {\n x1,\n y1,\n x2,\n y2\n } = b;\n\n // iterate over intersection region\n // perform fine grained inclusion test\n for (let y = y1; y <= y2; ++y) {\n for (let x = x1; x <= x2; ++x) {\n if (context.isPointInPath(x, y)) {\n return true;\n }\n }\n }\n\n // false if no hits in intersection region\n return false;\n };\n}\nfunction intersectPoint(item, box) {\n return box.contains(item.x || 0, item.y || 0);\n}\nfunction intersectRect(item, box) {\n const x = item.x || 0,\n y = item.y || 0,\n w = item.width || 0,\n h = item.height || 0;\n return box.intersects(b.set(x, y, x + w, y + h));\n}\nfunction intersectRule(item, box) {\n const x = item.x || 0,\n y = item.y || 0,\n x2 = item.x2 != null ? item.x2 : x,\n y2 = item.y2 != null ? item.y2 : y;\n return intersectBoxLine(box, x, y, x2, y2);\n}\nfunction intersectBoxLine(box, x, y, u, v) {\n const {\n x1,\n y1,\n x2,\n y2\n } = box,\n dx = u - x,\n dy = v - y;\n let t0 = 0,\n t1 = 1,\n p,\n q,\n r,\n e;\n for (e = 0; e < 4; ++e) {\n if (e === 0) {\n p = -dx;\n q = -(x1 - x);\n }\n if (e === 1) {\n p = dx;\n q = x2 - x;\n }\n if (e === 2) {\n p = -dy;\n q = -(y1 - y);\n }\n if (e === 3) {\n p = dy;\n q = y2 - y;\n }\n if (Math.abs(p) < 1e-10 && q < 0) return false;\n r = q / p;\n if (p < 0) {\n if (r > t1) return false;else if (r > t0) t0 = r;\n } else if (p > 0) {\n if (r < t0) return false;else if (r < t1) t1 = r;\n }\n }\n return true;\n}\n\nfunction blend (context, item) {\n context.globalCompositeOperation = item.blend || 'source-over';\n}\n\nfunction value (value, dflt) {\n return value == null ? dflt : value;\n}\n\nfunction addStops(gradient, stops) {\n const n = stops.length;\n for (let i = 0; i < n; ++i) {\n gradient.addColorStop(stops[i].offset, stops[i].color);\n }\n return gradient;\n}\nfunction gradient (context, spec, bounds) {\n const w = bounds.width(),\n h = bounds.height();\n let gradient;\n if (spec.gradient === 'radial') {\n gradient = context.createRadialGradient(bounds.x1 + value(spec.x1, 0.5) * w, bounds.y1 + value(spec.y1, 0.5) * h, Math.max(w, h) * value(spec.r1, 0), bounds.x1 + value(spec.x2, 0.5) * w, bounds.y1 + value(spec.y2, 0.5) * h, Math.max(w, h) * value(spec.r2, 0.5));\n } else {\n // linear gradient\n const x1 = value(spec.x1, 0),\n y1 = value(spec.y1, 0),\n x2 = value(spec.x2, 1),\n y2 = value(spec.y2, 0);\n if (x1 === x2 || y1 === y2 || w === h) {\n // axis aligned: use normal gradient\n gradient = context.createLinearGradient(bounds.x1 + x1 * w, bounds.y1 + y1 * h, bounds.x1 + x2 * w, bounds.y1 + y2 * h);\n } else {\n // not axis aligned: render gradient into a pattern (#2365)\n // this allows us to use normalized bounding box coordinates\n const image = canvas(Math.ceil(w), Math.ceil(h)),\n ictx = image.getContext('2d');\n ictx.scale(w, h);\n ictx.fillStyle = addStops(ictx.createLinearGradient(x1, y1, x2, y2), spec.stops);\n ictx.fillRect(0, 0, w, h);\n return context.createPattern(image, 'no-repeat');\n }\n }\n return addStops(gradient, spec.stops);\n}\n\nfunction color (context, item, value) {\n return isGradient(value) ? gradient(context, value, item.bounds) : value;\n}\n\nfunction fill (context, item, opacity) {\n opacity *= item.fillOpacity == null ? 1 : item.fillOpacity;\n if (opacity > 0) {\n context.globalAlpha = opacity;\n context.fillStyle = color(context, item, item.fill);\n return true;\n } else {\n return false;\n }\n}\n\nvar Empty = [];\nfunction stroke (context, item, opacity) {\n var lw = (lw = item.strokeWidth) != null ? lw : 1;\n if (lw <= 0) return false;\n opacity *= item.strokeOpacity == null ? 1 : item.strokeOpacity;\n if (opacity > 0) {\n context.globalAlpha = opacity;\n context.strokeStyle = color(context, item, item.stroke);\n context.lineWidth = lw;\n context.lineCap = item.strokeCap || 'butt';\n context.lineJoin = item.strokeJoin || 'miter';\n context.miterLimit = item.strokeMiterLimit || 10;\n if (context.setLineDash) {\n context.setLineDash(item.strokeDash || Empty);\n context.lineDashOffset = item.strokeDashOffset || 0;\n }\n return true;\n } else {\n return false;\n }\n}\n\nfunction compare(a, b) {\n return a.zindex - b.zindex || a.index - b.index;\n}\nfunction zorder(scene) {\n if (!scene.zdirty) return scene.zitems;\n var items = scene.items,\n output = [],\n item,\n i,\n n;\n for (i = 0, n = items.length; i < n; ++i) {\n item = items[i];\n item.index = i;\n if (item.zindex) output.push(item);\n }\n scene.zdirty = false;\n return scene.zitems = output.sort(compare);\n}\nfunction visit(scene, visitor) {\n var items = scene.items,\n i,\n n;\n if (!items || !items.length) return;\n const zitems = zorder(scene);\n if (zitems && zitems.length) {\n for (i = 0, n = items.length; i < n; ++i) {\n if (!items[i].zindex) visitor(items[i]);\n }\n items = zitems;\n }\n for (i = 0, n = items.length; i < n; ++i) {\n visitor(items[i]);\n }\n}\nfunction pickVisit(scene, visitor) {\n var items = scene.items,\n hit,\n i;\n if (!items || !items.length) return null;\n const zitems = zorder(scene);\n if (zitems && zitems.length) items = zitems;\n for (i = items.length; --i >= 0;) {\n if (hit = visitor(items[i])) return hit;\n }\n if (items === zitems) {\n for (items = scene.items, i = items.length; --i >= 0;) {\n if (!items[i].zindex) {\n if (hit = visitor(items[i])) return hit;\n }\n }\n }\n return null;\n}\n\nfunction drawAll(path) {\n return function (context, scene, bounds) {\n visit(scene, item => {\n if (!bounds || bounds.intersects(item.bounds)) {\n drawPath(path, context, item, item);\n }\n });\n };\n}\nfunction drawOne(path) {\n return function (context, scene, bounds) {\n if (scene.items.length && (!bounds || bounds.intersects(scene.bounds))) {\n drawPath(path, context, scene.items[0], scene.items);\n }\n };\n}\nfunction drawPath(path, context, item, items) {\n var opacity = item.opacity == null ? 1 : item.opacity;\n if (opacity === 0) return;\n if (path(context, items)) return;\n blend(context, item);\n if (item.fill && fill(context, item, opacity)) {\n context.fill();\n }\n if (item.stroke && stroke(context, item, opacity)) {\n context.stroke();\n }\n}\n\nfunction pick$1(test) {\n test = test || truthy;\n return function (context, scene, x, y, gx, gy) {\n x *= context.pixelRatio;\n y *= context.pixelRatio;\n return pickVisit(scene, item => {\n const b = item.bounds;\n // first hit test against bounding box\n if (b && !b.contains(gx, gy) || !b) return;\n // if in bounding box, perform more careful test\n if (test(context, item, x, y, gx, gy)) return item;\n });\n };\n}\nfunction hitPath(path, filled) {\n return function (context, o, x, y) {\n var item = Array.isArray(o) ? o[0] : o,\n fill = filled == null ? item.fill : filled,\n stroke = item.stroke && context.isPointInStroke,\n lw,\n lc;\n if (stroke) {\n lw = item.strokeWidth;\n lc = item.strokeCap;\n context.lineWidth = lw != null ? lw : 1;\n context.lineCap = lc != null ? lc : 'butt';\n }\n return path(context, o) ? false : fill && context.isPointInPath(x, y) || stroke && context.isPointInStroke(x, y);\n };\n}\nfunction pickPath(path) {\n return pick$1(hitPath(path));\n}\n\nfunction translate(x, y) {\n return 'translate(' + x + ',' + y + ')';\n}\nfunction rotate(a) {\n return 'rotate(' + a + ')';\n}\nfunction scale(scaleX, scaleY) {\n return 'scale(' + scaleX + ',' + scaleY + ')';\n}\nfunction translateItem(item) {\n return translate(item.x || 0, item.y || 0);\n}\nfunction rotateItem(item) {\n return translate(item.x || 0, item.y || 0) + (item.angle ? ' ' + rotate(item.angle) : '');\n}\nfunction transformItem(item) {\n return translate(item.x || 0, item.y || 0) + (item.angle ? ' ' + rotate(item.angle) : '') + (item.scaleX || item.scaleY ? ' ' + scale(item.scaleX || 1, item.scaleY || 1) : '');\n}\n\nfunction markItemPath (type, shape, isect) {\n function attr(emit, item) {\n emit('transform', rotateItem(item));\n emit('d', shape(null, item));\n }\n function bound(bounds, item) {\n shape(boundContext(bounds, item.angle), item);\n return boundStroke(bounds, item).translate(item.x || 0, item.y || 0);\n }\n function draw(context, item) {\n var x = item.x || 0,\n y = item.y || 0,\n a = item.angle || 0;\n context.translate(x, y);\n if (a) context.rotate(a *= DegToRad);\n context.beginPath();\n shape(context, item);\n if (a) context.rotate(-a);\n context.translate(-x, -y);\n }\n return {\n type: type,\n tag: 'path',\n nested: false,\n attr: attr,\n bound: bound,\n draw: drawAll(draw),\n pick: pickPath(draw),\n isect: isect || intersectPath(draw)\n };\n}\n\nvar arc = markItemPath('arc', arc$1);\n\nfunction pickArea(a, p) {\n var v = a[0].orient === 'horizontal' ? p[1] : p[0],\n z = a[0].orient === 'horizontal' ? 'y' : 'x',\n i = a.length,\n min = +Infinity,\n hit,\n d;\n while (--i >= 0) {\n if (a[i].defined === false) continue;\n d = Math.abs(a[i][z] - v);\n if (d < min) {\n min = d;\n hit = a[i];\n }\n }\n return hit;\n}\nfunction pickLine(a, p) {\n var t = Math.pow(a[0].strokeWidth || 1, 2),\n i = a.length,\n dx,\n dy,\n dd;\n while (--i >= 0) {\n if (a[i].defined === false) continue;\n dx = a[i].x - p[0];\n dy = a[i].y - p[1];\n dd = dx * dx + dy * dy;\n if (dd < t) return a[i];\n }\n return null;\n}\nfunction pickTrail(a, p) {\n var i = a.length,\n dx,\n dy,\n dd;\n while (--i >= 0) {\n if (a[i].defined === false) continue;\n dx = a[i].x - p[0];\n dy = a[i].y - p[1];\n dd = dx * dx + dy * dy;\n dx = a[i].size || 1;\n if (dd < dx * dx) return a[i];\n }\n return null;\n}\n\nfunction markMultiItemPath (type, shape, tip) {\n function attr(emit, item) {\n var items = item.mark.items;\n if (items.length) emit('d', shape(null, items));\n }\n function bound(bounds, mark) {\n var items = mark.items;\n if (items.length === 0) {\n return bounds;\n } else {\n shape(boundContext(bounds), items);\n return boundStroke(bounds, items[0]);\n }\n }\n function draw(context, items) {\n context.beginPath();\n shape(context, items);\n }\n const hit = hitPath(draw);\n function pick(context, scene, x, y, gx, gy) {\n var items = scene.items,\n b = scene.bounds;\n if (!items || !items.length || b && !b.contains(gx, gy)) {\n return null;\n }\n x *= context.pixelRatio;\n y *= context.pixelRatio;\n return hit(context, items, x, y) ? items[0] : null;\n }\n return {\n type: type,\n tag: 'path',\n nested: true,\n attr: attr,\n bound: bound,\n draw: drawOne(draw),\n pick: pick,\n isect: intersectPoint,\n tip: tip\n };\n}\n\nvar area = markMultiItemPath('area', area$1, pickArea);\n\nfunction clip (context, scene) {\n var clip = scene.clip;\n context.save();\n if (isFunction(clip)) {\n context.beginPath();\n clip(context);\n context.clip();\n } else {\n clipGroup(context, scene.group);\n }\n}\nfunction clipGroup(context, group) {\n context.beginPath();\n hasCornerRadius(group) ? rectangle(context, group, 0, 0) : context.rect(0, 0, group.width || 0, group.height || 0);\n context.clip();\n}\n\nfunction offset$1(item) {\n const sw = value(item.strokeWidth, 1);\n return item.strokeOffset != null ? item.strokeOffset : item.stroke && sw > 0.5 && sw < 1.5 ? 0.5 - Math.abs(sw - 1) : 0;\n}\nfunction attr$5(emit, item) {\n emit('transform', translateItem(item));\n}\nfunction emitRectangle(emit, item) {\n const off = offset$1(item);\n emit('d', rectangle(null, item, off, off));\n}\nfunction background(emit, item) {\n emit('class', 'background');\n emit('aria-hidden', true);\n emitRectangle(emit, item);\n}\nfunction foreground(emit, item) {\n emit('class', 'foreground');\n emit('aria-hidden', true);\n if (item.strokeForeground) {\n emitRectangle(emit, item);\n } else {\n emit('d', '');\n }\n}\nfunction content(emit, item, renderer) {\n const url = item.clip ? clip$1(renderer, item, item) : null;\n emit('clip-path', url);\n}\nfunction bound$5(bounds, group) {\n if (!group.clip && group.items) {\n const items = group.items,\n m = items.length;\n for (let j = 0; j < m; ++j) {\n bounds.union(items[j].bounds);\n }\n }\n if ((group.clip || group.width || group.height) && !group.noBound) {\n bounds.add(0, 0).add(group.width || 0, group.height || 0);\n }\n boundStroke(bounds, group);\n return bounds.translate(group.x || 0, group.y || 0);\n}\nfunction rectanglePath(context, group, x, y) {\n const off = offset$1(group);\n context.beginPath();\n rectangle(context, group, (x || 0) + off, (y || 0) + off);\n}\nconst hitBackground = hitPath(rectanglePath);\nconst hitForeground = hitPath(rectanglePath, false);\nconst hitCorner = hitPath(rectanglePath, true);\nfunction draw$4(context, scene, bounds, markTypes) {\n visit(scene, group => {\n const gx = group.x || 0,\n gy = group.y || 0,\n fore = group.strokeForeground,\n opacity = group.opacity == null ? 1 : group.opacity;\n\n // draw group background\n if ((group.stroke || group.fill) && opacity) {\n rectanglePath(context, group, gx, gy);\n blend(context, group);\n if (group.fill && fill(context, group, opacity)) {\n context.fill();\n }\n if (group.stroke && !fore && stroke(context, group, opacity)) {\n context.stroke();\n }\n }\n\n // setup graphics context, set clip and bounds\n context.save();\n context.translate(gx, gy);\n if (group.clip) clipGroup(context, group);\n if (bounds) bounds.translate(-gx, -gy);\n\n // draw group contents\n visit(group, item => {\n if (item.marktype === 'group' || markTypes == null || markTypes.includes(item.marktype)) {\n this.draw(context, item, bounds, markTypes);\n }\n });\n\n // restore graphics context\n if (bounds) bounds.translate(gx, gy);\n context.restore();\n\n // draw group foreground\n if (fore && group.stroke && opacity) {\n rectanglePath(context, group, gx, gy);\n blend(context, group);\n if (stroke(context, group, opacity)) {\n context.stroke();\n }\n }\n });\n}\nfunction pick(context, scene, x, y, gx, gy) {\n if (scene.bounds && !scene.bounds.contains(gx, gy) || !scene.items) {\n return null;\n }\n const cx = x * context.pixelRatio,\n cy = y * context.pixelRatio;\n return pickVisit(scene, group => {\n let hit, dx, dy;\n\n // first hit test bounding box\n const b = group.bounds;\n if (b && !b.contains(gx, gy)) return;\n\n // passed bounds check, test rectangular clip\n dx = group.x || 0;\n dy = group.y || 0;\n const dw = dx + (group.width || 0),\n dh = dy + (group.height || 0),\n c = group.clip;\n if (c && (gx < dx || gx > dw || gy < dy || gy > dh)) return;\n\n // adjust coordinate system\n context.save();\n context.translate(dx, dy);\n dx = gx - dx;\n dy = gy - dy;\n\n // test background for rounded corner clip\n if (c && hasCornerRadius(group) && !hitCorner(context, group, cx, cy)) {\n context.restore();\n return null;\n }\n const fore = group.strokeForeground,\n ix = scene.interactive !== false;\n\n // hit test against group foreground\n if (ix && fore && group.stroke && hitForeground(context, group, cx, cy)) {\n context.restore();\n return group;\n }\n\n // hit test against contained marks\n hit = pickVisit(group, mark => pickMark(mark, dx, dy) ? this.pick(mark, x, y, dx, dy) : null);\n\n // hit test against group background\n if (!hit && ix && (group.fill || !fore && group.stroke) && hitBackground(context, group, cx, cy)) {\n hit = group;\n }\n\n // restore state and return\n context.restore();\n return hit || null;\n });\n}\nfunction pickMark(mark, x, y) {\n return (mark.interactive !== false || mark.marktype === 'group') && mark.bounds && mark.bounds.contains(x, y);\n}\nvar group = {\n type: 'group',\n tag: 'g',\n nested: false,\n attr: attr$5,\n bound: bound$5,\n draw: draw$4,\n pick: pick,\n isect: intersectRect,\n content: content,\n background: background,\n foreground: foreground\n};\n\nvar metadata = {\n 'xmlns': 'http://www.w3.org/2000/svg',\n 'xmlns:xlink': 'http://www.w3.org/1999/xlink',\n 'version': '1.1'\n};\n\nfunction getImage(item, renderer) {\n var image = item.image;\n if (!image || item.url && item.url !== image.url) {\n image = {\n complete: false,\n width: 0,\n height: 0\n };\n renderer.loadImage(item.url).then(image => {\n item.image = image;\n item.image.url = item.url;\n });\n }\n return image;\n}\nfunction imageWidth(item, image) {\n return item.width != null ? item.width : !image || !image.width ? 0 : item.aspect !== false && item.height ? item.height * image.width / image.height : image.width;\n}\nfunction imageHeight(item, image) {\n return item.height != null ? item.height : !image || !image.height ? 0 : item.aspect !== false && item.width ? item.width * image.height / image.width : image.height;\n}\nfunction imageXOffset(align, w) {\n return align === 'center' ? w / 2 : align === 'right' ? w : 0;\n}\nfunction imageYOffset(baseline, h) {\n return baseline === 'middle' ? h / 2 : baseline === 'bottom' ? h : 0;\n}\nfunction attr$4(emit, item, renderer) {\n const img = getImage(item, renderer),\n w = imageWidth(item, img),\n h = imageHeight(item, img),\n x = (item.x || 0) - imageXOffset(item.align, w),\n y = (item.y || 0) - imageYOffset(item.baseline, h),\n i = !img.src && img.toDataURL ? img.toDataURL() : img.src || '';\n emit('href', i, metadata['xmlns:xlink'], 'xlink:href');\n emit('transform', translate(x, y));\n emit('width', w);\n emit('height', h);\n emit('preserveAspectRatio', item.aspect === false ? 'none' : 'xMidYMid');\n}\nfunction bound$4(bounds, item) {\n const img = item.image,\n w = imageWidth(item, img),\n h = imageHeight(item, img),\n x = (item.x || 0) - imageXOffset(item.align, w),\n y = (item.y || 0) - imageYOffset(item.baseline, h);\n return bounds.set(x, y, x + w, y + h);\n}\nfunction draw$3(context, scene, bounds) {\n visit(scene, item => {\n if (bounds && !bounds.intersects(item.bounds)) return; // bounds check\n\n const img = getImage(item, this);\n let w = imageWidth(item, img);\n let h = imageHeight(item, img);\n if (w === 0 || h === 0) return; // early exit\n\n let x = (item.x || 0) - imageXOffset(item.align, w),\n y = (item.y || 0) - imageYOffset(item.baseline, h),\n opacity,\n ar0,\n ar1,\n t;\n if (item.aspect !== false) {\n ar0 = img.width / img.height;\n ar1 = item.width / item.height;\n if (ar0 === ar0 && ar1 === ar1 && ar0 !== ar1) {\n if (ar1 < ar0) {\n t = w / ar0;\n y += (h - t) / 2;\n h = t;\n } else {\n t = h * ar0;\n x += (w - t) / 2;\n w = t;\n }\n }\n }\n if (img.complete || img.toDataURL) {\n blend(context, item);\n context.globalAlpha = (opacity = item.opacity) != null ? opacity : 1;\n context.imageSmoothingEnabled = item.smooth !== false;\n context.drawImage(img, x, y, w, h);\n }\n });\n}\nvar image = {\n type: 'image',\n tag: 'image',\n nested: false,\n attr: attr$4,\n bound: bound$4,\n draw: draw$3,\n pick: pick$1(),\n isect: truthy,\n // bounds check is sufficient\n get: getImage,\n xOffset: imageXOffset,\n yOffset: imageYOffset\n};\n\nvar line = markMultiItemPath('line', line$1, pickLine);\n\nfunction attr$3(emit, item) {\n var sx = item.scaleX || 1,\n sy = item.scaleY || 1;\n if (sx !== 1 || sy !== 1) {\n emit('vector-effect', 'non-scaling-stroke');\n }\n emit('transform', transformItem(item));\n emit('d', item.path);\n}\nfunction path$1(context, item) {\n var path = item.path;\n if (path == null) return true;\n var x = item.x || 0,\n y = item.y || 0,\n sx = item.scaleX || 1,\n sy = item.scaleY || 1,\n a = (item.angle || 0) * DegToRad,\n cache = item.pathCache;\n if (!cache || cache.path !== path) {\n (item.pathCache = cache = parse(path)).path = path;\n }\n if (a && context.rotate && context.translate) {\n context.translate(x, y);\n context.rotate(a);\n pathRender(context, cache, 0, 0, sx, sy);\n context.rotate(-a);\n context.translate(-x, -y);\n } else {\n pathRender(context, cache, x, y, sx, sy);\n }\n}\nfunction bound$3(bounds, item) {\n return path$1(boundContext(bounds, item.angle), item) ? bounds.set(0, 0, 0, 0) : boundStroke(bounds, item, true);\n}\nvar path$2 = {\n type: 'path',\n tag: 'path',\n nested: false,\n attr: attr$3,\n bound: bound$3,\n draw: drawAll(path$1),\n pick: pickPath(path$1),\n isect: intersectPath(path$1)\n};\n\nfunction attr$2(emit, item) {\n emit('d', rectangle(null, item));\n}\nfunction bound$2(bounds, item) {\n var x, y;\n return boundStroke(bounds.set(x = item.x || 0, y = item.y || 0, x + item.width || 0, y + item.height || 0), item);\n}\nfunction draw$2(context, item) {\n context.beginPath();\n rectangle(context, item);\n}\nvar rect = {\n type: 'rect',\n tag: 'path',\n nested: false,\n attr: attr$2,\n bound: bound$2,\n draw: drawAll(draw$2),\n pick: pickPath(draw$2),\n isect: intersectRect\n};\n\nfunction attr$1(emit, item) {\n emit('transform', translateItem(item));\n emit('x2', item.x2 != null ? item.x2 - (item.x || 0) : 0);\n emit('y2', item.y2 != null ? item.y2 - (item.y || 0) : 0);\n}\nfunction bound$1(bounds, item) {\n var x1, y1;\n return boundStroke(bounds.set(x1 = item.x || 0, y1 = item.y || 0, item.x2 != null ? item.x2 : x1, item.y2 != null ? item.y2 : y1), item);\n}\nfunction path(context, item, opacity) {\n var x1, y1, x2, y2;\n if (item.stroke && stroke(context, item, opacity)) {\n x1 = item.x || 0;\n y1 = item.y || 0;\n x2 = item.x2 != null ? item.x2 : x1;\n y2 = item.y2 != null ? item.y2 : y1;\n context.beginPath();\n context.moveTo(x1, y1);\n context.lineTo(x2, y2);\n return true;\n }\n return false;\n}\nfunction draw$1(context, scene, bounds) {\n visit(scene, item => {\n if (bounds && !bounds.intersects(item.bounds)) return; // bounds check\n var opacity = item.opacity == null ? 1 : item.opacity;\n if (opacity && path(context, item, opacity)) {\n blend(context, item);\n context.stroke();\n }\n });\n}\nfunction hit$1(context, item, x, y) {\n if (!context.isPointInStroke) return false;\n return path(context, item, 1) && context.isPointInStroke(x, y);\n}\nvar rule = {\n type: 'rule',\n tag: 'line',\n nested: false,\n attr: attr$1,\n bound: bound$1,\n draw: draw$1,\n pick: pick$1(hit$1),\n isect: intersectRule\n};\n\nvar shape = markItemPath('shape', shape$1);\n\nvar symbol = markItemPath('symbol', symbol$1, intersectPoint);\n\n// memoize text width measurement\nconst widthCache = lruCache();\nvar textMetrics = {\n height: fontSize,\n measureWidth: measureWidth,\n estimateWidth: estimateWidth,\n width: estimateWidth,\n canvas: useCanvas\n};\nuseCanvas(true);\nfunction useCanvas(use) {\n textMetrics.width = use && context ? measureWidth : estimateWidth;\n}\n\n// make simple estimate if no canvas is available\nfunction estimateWidth(item, text) {\n return _estimateWidth(textValue(item, text), fontSize(item));\n}\nfunction _estimateWidth(text, currentFontHeight) {\n return ~~(0.8 * text.length * currentFontHeight);\n}\n\n// measure text width if canvas is available\nfunction measureWidth(item, text) {\n return fontSize(item) <= 0 || !(text = textValue(item, text)) ? 0 : _measureWidth(text, font(item));\n}\nfunction _measureWidth(text, currentFont) {\n const key = `(${currentFont}) ${text}`;\n let width = widthCache.get(key);\n if (width === undefined) {\n context.font = currentFont;\n width = context.measureText(text).width;\n widthCache.set(key, width);\n }\n return width;\n}\nfunction fontSize(item) {\n return item.fontSize != null ? +item.fontSize || 0 : 11;\n}\nfunction lineHeight(item) {\n return item.lineHeight != null ? item.lineHeight : fontSize(item) + 2;\n}\nfunction lineArray(_) {\n return isArray(_) ? _.length > 1 ? _ : _[0] : _;\n}\nfunction textLines(item) {\n return lineArray(item.lineBreak && item.text && !isArray(item.text) ? item.text.split(item.lineBreak) : item.text);\n}\nfunction multiLineOffset(item) {\n const tl = textLines(item);\n return (isArray(tl) ? tl.length - 1 : 0) * lineHeight(item);\n}\nfunction textValue(item, line) {\n const text = line == null ? '' : (line + '').trim();\n return item.limit > 0 && text.length ? truncate(item, text) : text;\n}\nfunction widthGetter(item) {\n if (textMetrics.width === measureWidth) {\n // we are using canvas\n const currentFont = font(item);\n return text => _measureWidth(text, currentFont);\n } else if (textMetrics.width === estimateWidth) {\n // we are relying on estimates\n const currentFontHeight = fontSize(item);\n return text => _estimateWidth(text, currentFontHeight);\n } else {\n // User defined textMetrics.width function in use (e.g. vl-convert)\n return text => textMetrics.width(item, text);\n }\n}\nfunction truncate(item, text) {\n var limit = +item.limit,\n width = widthGetter(item);\n if (width(text) < limit) return text;\n var ellipsis = item.ellipsis || '\\u2026',\n rtl = item.dir === 'rtl',\n lo = 0,\n hi = text.length,\n mid;\n limit -= width(ellipsis);\n if (rtl) {\n while (lo < hi) {\n mid = lo + hi >>> 1;\n if (width(text.slice(mid)) > limit) lo = mid + 1;else hi = mid;\n }\n return ellipsis + text.slice(lo);\n } else {\n while (lo < hi) {\n mid = 1 + (lo + hi >>> 1);\n if (width(text.slice(0, mid)) < limit) lo = mid;else hi = mid - 1;\n }\n return text.slice(0, lo) + ellipsis;\n }\n}\nfunction fontFamily(item, quote) {\n var font = item.font;\n return (quote && font ? String(font).replace(/\"/g, '\\'') : font) || 'sans-serif';\n}\nfunction font(item, quote) {\n return '' + (item.fontStyle ? item.fontStyle + ' ' : '') + (item.fontVariant ? item.fontVariant + ' ' : '') + (item.fontWeight ? item.fontWeight + ' ' : '') + fontSize(item) + 'px ' + fontFamily(item, quote);\n}\nfunction offset(item) {\n // perform our own font baseline calculation\n // why? not all browsers support SVG 1.1 'alignment-baseline' :(\n // this also ensures consistent layout across renderers\n var baseline = item.baseline,\n h = fontSize(item);\n return Math.round(baseline === 'top' ? 0.79 * h : baseline === 'middle' ? 0.30 * h : baseline === 'bottom' ? -0.21 * h : baseline === 'line-top' ? 0.29 * h + 0.5 * lineHeight(item) : baseline === 'line-bottom' ? 0.29 * h - 0.5 * lineHeight(item) : 0);\n}\n\nconst textAlign = {\n 'left': 'start',\n 'center': 'middle',\n 'right': 'end'\n};\nconst tempBounds = new Bounds();\nfunction anchorPoint(item) {\n var x = item.x || 0,\n y = item.y || 0,\n r = item.radius || 0,\n t;\n if (r) {\n t = (item.theta || 0) - HalfPi;\n x += r * Math.cos(t);\n y += r * Math.sin(t);\n }\n tempBounds.x1 = x;\n tempBounds.y1 = y;\n return tempBounds;\n}\nfunction attr(emit, item) {\n var dx = item.dx || 0,\n dy = (item.dy || 0) + offset(item),\n p = anchorPoint(item),\n x = p.x1,\n y = p.y1,\n a = item.angle || 0,\n t;\n emit('text-anchor', textAlign[item.align] || 'start');\n if (a) {\n t = translate(x, y) + ' ' + rotate(a);\n if (dx || dy) t += ' ' + translate(dx, dy);\n } else {\n t = translate(x + dx, y + dy);\n }\n emit('transform', t);\n}\nfunction bound(bounds, item, mode) {\n var h = textMetrics.height(item),\n a = item.align,\n p = anchorPoint(item),\n x = p.x1,\n y = p.y1,\n dx = item.dx || 0,\n dy = (item.dy || 0) + offset(item) - Math.round(0.8 * h),\n // use 4/5 offset\n tl = textLines(item),\n w;\n\n // get dimensions\n if (isArray(tl)) {\n // multi-line text\n h += lineHeight(item) * (tl.length - 1);\n w = tl.reduce((w, t) => Math.max(w, textMetrics.width(item, t)), 0);\n } else {\n // single-line text\n w = textMetrics.width(item, tl);\n }\n\n // horizontal alignment\n if (a === 'center') {\n dx -= w / 2;\n } else if (a === 'right') {\n dx -= w;\n } else ;\n bounds.set(dx += x, dy += y, dx + w, dy + h);\n if (item.angle && !mode) {\n bounds.rotate(item.angle * DegToRad, x, y);\n } else if (mode === 2) {\n return bounds.rotatedPoints(item.angle * DegToRad, x, y);\n }\n return bounds;\n}\nfunction draw(context, scene, bounds) {\n visit(scene, item => {\n var opacity = item.opacity == null ? 1 : item.opacity,\n p,\n x,\n y,\n i,\n lh,\n tl,\n str;\n if (bounds && !bounds.intersects(item.bounds) ||\n // bounds check\n opacity === 0 || item.fontSize <= 0 || item.text == null || item.text.length === 0) return;\n context.font = font(item);\n context.textAlign = item.align || 'left';\n p = anchorPoint(item);\n x = p.x1, y = p.y1;\n if (item.angle) {\n context.save();\n context.translate(x, y);\n context.rotate(item.angle * DegToRad);\n x = y = 0; // reset x, y\n }\n x += item.dx || 0;\n y += (item.dy || 0) + offset(item);\n tl = textLines(item);\n blend(context, item);\n if (isArray(tl)) {\n lh = lineHeight(item);\n for (i = 0; i < tl.length; ++i) {\n str = textValue(item, tl[i]);\n if (item.fill && fill(context, item, opacity)) {\n context.fillText(str, x, y);\n }\n if (item.stroke && stroke(context, item, opacity)) {\n context.strokeText(str, x, y);\n }\n y += lh;\n }\n } else {\n str = textValue(item, tl);\n if (item.fill && fill(context, item, opacity)) {\n context.fillText(str, x, y);\n }\n if (item.stroke && stroke(context, item, opacity)) {\n context.strokeText(str, x, y);\n }\n }\n if (item.angle) context.restore();\n });\n}\nfunction hit(context, item, x, y, gx, gy) {\n if (item.fontSize <= 0) return false;\n if (!item.angle) return true; // bounds sufficient if no rotation\n\n // project point into space of unrotated bounds\n var p = anchorPoint(item),\n ax = p.x1,\n ay = p.y1,\n b = bound(tempBounds, item, 1),\n a = -item.angle * DegToRad,\n cos = Math.cos(a),\n sin = Math.sin(a),\n px = cos * gx - sin * gy + (ax - cos * ax + sin * ay),\n py = sin * gx + cos * gy + (ay - sin * ax - cos * ay);\n return b.contains(px, py);\n}\nfunction intersectText(item, box) {\n const p = bound(tempBounds, item, 2);\n return intersectBoxLine(box, p[0], p[1], p[2], p[3]) || intersectBoxLine(box, p[0], p[1], p[4], p[5]) || intersectBoxLine(box, p[4], p[5], p[6], p[7]) || intersectBoxLine(box, p[2], p[3], p[6], p[7]);\n}\nvar text = {\n type: 'text',\n tag: 'text',\n nested: false,\n attr: attr,\n bound: bound,\n draw: draw,\n pick: pick$1(hit),\n isect: intersectText\n};\n\nvar trail = markMultiItemPath('trail', trail$1, pickTrail);\n\nvar Marks = {\n arc: arc,\n area: area,\n group: group,\n image: image,\n line: line,\n path: path$2,\n rect: rect,\n rule: rule,\n shape: shape,\n symbol: symbol,\n text: text,\n trail: trail\n};\n\nfunction boundItem (item, func, opt) {\n var type = Marks[item.mark.marktype],\n bound = func || type.bound;\n if (type.nested) item = item.mark;\n return bound(item.bounds || (item.bounds = new Bounds()), item, opt);\n}\n\nvar DUMMY = {\n mark: null\n};\nfunction boundMark (mark, bounds, opt) {\n var type = Marks[mark.marktype],\n bound = type.bound,\n items = mark.items,\n hasItems = items && items.length,\n i,\n n,\n item,\n b;\n if (type.nested) {\n if (hasItems) {\n item = items[0];\n } else {\n // no items, fake it\n DUMMY.mark = mark;\n item = DUMMY;\n }\n b = boundItem(item, bound, opt);\n bounds = bounds && bounds.union(b) || b;\n return bounds;\n }\n bounds = bounds || mark.bounds && mark.bounds.clear() || new Bounds();\n if (hasItems) {\n for (i = 0, n = items.length; i < n; ++i) {\n bounds.union(boundItem(items[i], bound, opt));\n }\n }\n return mark.bounds = bounds;\n}\n\nconst keys = ['marktype', 'name', 'role', 'interactive', 'clip', 'items', 'zindex', 'x', 'y', 'width', 'height', 'align', 'baseline',\n// layout\n'fill', 'fillOpacity', 'opacity', 'blend',\n// fill\n'stroke', 'strokeOpacity', 'strokeWidth', 'strokeCap',\n// stroke\n'strokeDash', 'strokeDashOffset',\n// stroke dash\n'strokeForeground', 'strokeOffset',\n// group\n'startAngle', 'endAngle', 'innerRadius', 'outerRadius',\n// arc\n'cornerRadius', 'padAngle',\n// arc, rect\n'cornerRadiusTopLeft', 'cornerRadiusTopRight',\n// rect, group\n'cornerRadiusBottomLeft', 'cornerRadiusBottomRight', 'interpolate', 'tension', 'orient', 'defined',\n// area, line\n'url', 'aspect', 'smooth',\n// image\n'path', 'scaleX', 'scaleY',\n// path\n'x2', 'y2',\n// rule\n'size', 'shape',\n// symbol\n'text', 'angle', 'theta', 'radius', 'dir', 'dx', 'dy',\n// text\n'ellipsis', 'limit', 'lineBreak', 'lineHeight', 'font', 'fontSize', 'fontWeight', 'fontStyle', 'fontVariant',\n// font\n'description', 'aria', 'ariaRole', 'ariaRoleDescription' // aria\n];\nfunction sceneToJSON(scene, indent) {\n return JSON.stringify(scene, keys, indent);\n}\nfunction sceneFromJSON(json) {\n const scene = typeof json === 'string' ? JSON.parse(json) : json;\n return initialize(scene);\n}\nfunction initialize(scene) {\n var type = scene.marktype,\n items = scene.items,\n parent,\n i,\n n;\n if (items) {\n for (i = 0, n = items.length; i < n; ++i) {\n parent = type ? 'mark' : 'group';\n items[i][parent] = scene;\n if (items[i].zindex) items[i][parent].zdirty = true;\n if ('group' === (type || parent)) initialize(items[i]);\n }\n }\n if (type) boundMark(scene);\n return scene;\n}\n\nclass Scenegraph {\n constructor(scene) {\n if (arguments.length) {\n this.root = sceneFromJSON(scene);\n } else {\n this.root = createMark({\n marktype: 'group',\n name: 'root',\n role: 'frame'\n });\n this.root.items = [new GroupItem(this.root)];\n }\n }\n toJSON(indent) {\n return sceneToJSON(this.root, indent || 0);\n }\n mark(markdef, group, index) {\n group = group || this.root.items[0];\n const mark = createMark(markdef, group);\n group.items[index] = mark;\n if (mark.zindex) mark.group.zdirty = true;\n return mark;\n }\n}\nfunction createMark(def, group) {\n const mark = {\n bounds: new Bounds(),\n clip: !!def.clip,\n group: group,\n interactive: def.interactive === false ? false : true,\n items: [],\n marktype: def.marktype,\n name: def.name || undefined,\n role: def.role || undefined,\n zindex: def.zindex || 0\n };\n\n // add accessibility properties if defined\n if (def.aria != null) {\n mark.aria = def.aria;\n }\n if (def.description) {\n mark.description = def.description;\n }\n return mark;\n}\n\n// create a new DOM element\nfunction domCreate(doc, tag, ns) {\n if (!doc && typeof document !== 'undefined' && document.createElement) {\n doc = document;\n }\n return doc ? ns ? doc.createElementNS(ns, tag) : doc.createElement(tag) : null;\n}\n\n// find first child element with matching tag\nfunction domFind(el, tag) {\n tag = tag.toLowerCase();\n var nodes = el.childNodes,\n i = 0,\n n = nodes.length;\n for (; i < n; ++i) if (nodes[i].tagName.toLowerCase() === tag) {\n return nodes[i];\n }\n}\n\n// retrieve child element at given index\n// create & insert if doesn't exist or if tags do not match\nfunction domChild(el, index, tag, ns) {\n var a = el.childNodes[index],\n b;\n if (!a || a.tagName.toLowerCase() !== tag.toLowerCase()) {\n b = a || null;\n a = domCreate(el.ownerDocument, tag, ns);\n el.insertBefore(a, b);\n }\n return a;\n}\n\n// remove all child elements at or above the given index\nfunction domClear(el, index) {\n var nodes = el.childNodes,\n curr = nodes.length;\n while (curr > index) el.removeChild(nodes[--curr]);\n return el;\n}\n\n// generate css class name for mark\nfunction cssClass(mark) {\n return 'mark-' + mark.marktype + (mark.role ? ' role-' + mark.role : '') + (mark.name ? ' ' + mark.name : '');\n}\n\nfunction point (event, el) {\n const rect = el.getBoundingClientRect();\n return [event.clientX - rect.left - (el.clientLeft || 0), event.clientY - rect.top - (el.clientTop || 0)];\n}\n\nfunction resolveItem (item, event, el, origin) {\n var mark = item && item.mark,\n mdef,\n p;\n if (mark && (mdef = Marks[mark.marktype]).tip) {\n p = point(event, el);\n p[0] -= origin[0];\n p[1] -= origin[1];\n while (item = item.mark.group) {\n p[0] -= item.x || 0;\n p[1] -= item.y || 0;\n }\n item = mdef.tip(mark.items, p);\n }\n return item;\n}\n\nclass Handler {\n /**\n * Create a new Handler instance.\n * @param {object} [customLoader] - Optional loader instance for\n * href URL sanitization. If not specified, a standard loader\n * instance will be generated.\n * @param {function} [customTooltip] - Optional tooltip handler\n * function for custom tooltip display.\n * @constructor\n */\n constructor(customLoader, customTooltip) {\n this._active = null;\n this._handlers = {};\n this._loader = customLoader || loader();\n this._tooltip = customTooltip || defaultTooltip;\n }\n\n /**\n * Initialize a new Handler instance.\n * @param {DOMElement} el - The containing DOM element for the display.\n * @param {Array} origin - The origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {object} [obj] - Optional context object that should serve as\n * the \"this\" context for event callbacks.\n * @return {Handler} - This handler instance.\n */\n initialize(el, origin, obj) {\n this._el = el;\n this._obj = obj || null;\n return this.origin(origin);\n }\n\n /**\n * Returns the parent container element for a visualization.\n * @return {DOMElement} - The containing DOM element.\n */\n element() {\n return this._el;\n }\n\n /**\n * Returns the scene element (e.g., canvas or SVG) of the visualization\n * Subclasses must override if the first child is not the scene element.\n * @return {DOMElement} - The scene (e.g., canvas or SVG) element.\n */\n canvas() {\n return this._el && this._el.firstChild;\n }\n\n /**\n * Get / set the origin coordinates of the visualization.\n */\n origin(origin) {\n if (arguments.length) {\n this._origin = origin || [0, 0];\n return this;\n } else {\n return this._origin.slice();\n }\n }\n\n /**\n * Get / set the scenegraph root.\n */\n scene(scene) {\n if (!arguments.length) return this._scene;\n this._scene = scene;\n return this;\n }\n\n /**\n * Add an event handler. Subclasses should override this method.\n */\n on( /*type, handler*/) {}\n\n /**\n * Remove an event handler. Subclasses should override this method.\n */\n off( /*type, handler*/) {}\n\n /**\n * Utility method for finding the array index of an event handler.\n * @param {Array} h - An array of registered event handlers.\n * @param {string} type - The event type.\n * @param {function} handler - The event handler instance to find.\n * @return {number} - The handler's array index or -1 if not registered.\n */\n _handlerIndex(h, type, handler) {\n for (let i = h ? h.length : 0; --i >= 0;) {\n if (h[i].type === type && (!handler || h[i].handler === handler)) {\n return i;\n }\n }\n return -1;\n }\n\n /**\n * Returns an array with registered event handlers.\n * @param {string} [type] - The event type to query. Any annotations\n * are ignored; for example, for the argument \"click.foo\", \".foo\" will\n * be ignored and the method returns all \"click\" handlers. If type is\n * null or unspecified, this method returns handlers for all types.\n * @return {Array} - A new array containing all registered event handlers.\n */\n handlers(type) {\n const h = this._handlers,\n a = [];\n if (type) {\n a.push(...h[this.eventName(type)]);\n } else {\n for (const k in h) {\n a.push(...h[k]);\n }\n }\n return a;\n }\n\n /**\n * Parses an event name string to return the specific event type.\n * For example, given \"click.foo\" returns \"click\"\n * @param {string} name - The input event type string.\n * @return {string} - A string with the event type only.\n */\n eventName(name) {\n const i = name.indexOf('.');\n return i < 0 ? name : name.slice(0, i);\n }\n\n /**\n * Handle hyperlink navigation in response to an item.href value.\n * @param {Event} event - The event triggering hyperlink navigation.\n * @param {Item} item - The scenegraph item.\n * @param {string} href - The URL to navigate to.\n */\n handleHref(event, item, href) {\n this._loader.sanitize(href, {\n context: 'href'\n }).then(opt => {\n const e = new MouseEvent(event.type, event),\n a = domCreate(null, 'a');\n for (const name in opt) a.setAttribute(name, opt[name]);\n a.dispatchEvent(e);\n }).catch(() => {});\n }\n\n /**\n * Handle tooltip display in response to an item.tooltip value.\n * @param {Event} event - The event triggering tooltip display.\n * @param {Item} item - The scenegraph item.\n * @param {boolean} show - A boolean flag indicating whether\n * to show or hide a tooltip for the given item.\n */\n handleTooltip(event, item, show) {\n if (item && item.tooltip != null) {\n item = resolveItem(item, event, this.canvas(), this._origin);\n const value = show && item && item.tooltip || null;\n this._tooltip.call(this._obj, this, event, item, value);\n }\n }\n\n /**\n * Returns the size of a scenegraph item and its position relative\n * to the viewport.\n * @param {Item} item - The scenegraph item.\n * @return {object} - A bounding box object (compatible with the\n * DOMRect type) consisting of x, y, width, heigh, top, left,\n * right, and bottom properties.\n */\n getItemBoundingClientRect(item) {\n const el = this.canvas();\n if (!el) return;\n const rect = el.getBoundingClientRect(),\n origin = this._origin,\n bounds = item.bounds,\n width = bounds.width(),\n height = bounds.height();\n let x = bounds.x1 + origin[0] + rect.left,\n y = bounds.y1 + origin[1] + rect.top;\n\n // translate coordinate for each parent group\n while (item.mark && (item = item.mark.group)) {\n x += item.x || 0;\n y += item.y || 0;\n }\n\n // return DOMRect-compatible bounding box\n return {\n x,\n y,\n width,\n height,\n left: x,\n top: y,\n right: x + width,\n bottom: y + height\n };\n }\n}\n\n// The default tooltip display handler.\n// Sets the HTML title attribute on the visualization container.\nfunction defaultTooltip(handler, event, item, value) {\n handler.element().setAttribute('title', value || '');\n}\n\nclass Renderer {\n /**\n * Create a new Renderer instance.\n * @param {object} [loader] - Optional loader instance for\n * image and href URL sanitization. If not specified, a\n * standard loader instance will be generated.\n * @constructor\n */\n constructor(loader) {\n this._el = null;\n this._bgcolor = null;\n this._loader = new ResourceLoader(loader);\n }\n\n /**\n * Initialize a new Renderer instance.\n * @param {DOMElement} el - The containing DOM element for the display.\n * @param {number} width - The coordinate width of the display, in pixels.\n * @param {number} height - The coordinate height of the display, in pixels.\n * @param {Array} origin - The origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {Renderer} - This renderer instance.\n */\n initialize(el, width, height, origin, scaleFactor) {\n this._el = el;\n return this.resize(width, height, origin, scaleFactor);\n }\n\n /**\n * Returns the parent container element for a visualization.\n * @return {DOMElement} - The containing DOM element.\n */\n element() {\n return this._el;\n }\n\n /**\n * Returns the scene element (e.g., canvas or SVG) of the visualization\n * Subclasses must override if the first child is not the scene element.\n * @return {DOMElement} - The scene (e.g., canvas or SVG) element.\n */\n canvas() {\n return this._el && this._el.firstChild;\n }\n\n /**\n * Get / set the background color.\n */\n background(bgcolor) {\n if (arguments.length === 0) return this._bgcolor;\n this._bgcolor = bgcolor;\n return this;\n }\n\n /**\n * Resize the display.\n * @param {number} width - The new coordinate width of the display, in pixels.\n * @param {number} height - The new coordinate height of the display, in pixels.\n * @param {Array} origin - The new origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {Renderer} - This renderer instance;\n */\n resize(width, height, origin, scaleFactor) {\n this._width = width;\n this._height = height;\n this._origin = origin || [0, 0];\n this._scale = scaleFactor || 1;\n return this;\n }\n\n /**\n * Report a dirty item whose bounds should be redrawn.\n * This base class method does nothing. Subclasses that perform\n * incremental should implement this method.\n * @param {Item} item - The dirty item whose bounds should be redrawn.\n */\n dirty( /*item*/) {}\n\n /**\n * Render an input scenegraph, potentially with a set of dirty items.\n * This method will perform an immediate rendering with available resources.\n * The renderer may also need to perform image loading to perform a complete\n * render. This process can lead to asynchronous re-rendering of the scene\n * after this method returns. To receive notification when rendering is\n * complete, use the renderAsync method instead.\n * @param {object} scene - The root mark of a scenegraph to render.\n * @param {Array} markTypes - Array of the mark types to render.\n * If undefined, render all mark types\n * @return {Renderer} - This renderer instance.\n */\n render(scene, markTypes) {\n const r = this;\n\n // bind arguments into a render call, and cache it\n // this function may be subsequently called for async redraw\n r._call = function () {\n r._render(scene, markTypes);\n };\n\n // invoke the renderer\n r._call();\n\n // clear the cached call for garbage collection\n // async redraws will stash their own copy\n r._call = null;\n return r;\n }\n\n /**\n * Internal rendering method. Renderer subclasses should override this\n * method to actually perform rendering.\n * @param {object} scene - The root mark of a scenegraph to render.\n * @param {Array} markTypes - Array of the mark types to render.\n * If undefined, render all mark types\n */\n _render( /*scene, markTypes*/\n ) {\n // subclasses to override\n }\n\n /**\n * Asynchronous rendering method. Similar to render, but returns a Promise\n * that resolves when all rendering is completed. Sometimes a renderer must\n * perform image loading to get a complete rendering. The returned\n * Promise will not resolve until this process completes.\n * @param {object} scene - The root mark of a scenegraph to render.\n * @param {Array} markTypes - Array of the mark types to render.\n * If undefined, render all mark types\n * @return {Promise} - A Promise that resolves when rendering is complete.\n */\n renderAsync(scene, markTypes) {\n const r = this.render(scene, markTypes);\n return this._ready ? this._ready.then(() => r) : Promise.resolve(r);\n }\n\n /**\n * Internal method for asynchronous resource loading.\n * Proxies method calls to the ImageLoader, and tracks loading\n * progress to invoke a re-render once complete.\n * @param {string} method - The method name to invoke on the ImageLoader.\n * @param {string} uri - The URI for the requested resource.\n * @return {Promise} - A Promise that resolves to the requested resource.\n */\n _load(method, uri) {\n var r = this,\n p = r._loader[method](uri);\n if (!r._ready) {\n // re-render the scene when loading completes\n const call = r._call;\n r._ready = r._loader.ready().then(redraw => {\n if (redraw) call();\n r._ready = null;\n });\n }\n return p;\n }\n\n /**\n * Sanitize a URL to include as a hyperlink in the rendered scene.\n * This method proxies a call to ImageLoader.sanitizeURL, but also tracks\n * image loading progress and invokes a re-render once complete.\n * @param {string} uri - The URI string to sanitize.\n * @return {Promise} - A Promise that resolves to the sanitized URL.\n */\n sanitizeURL(uri) {\n return this._load('sanitizeURL', uri);\n }\n\n /**\n * Requests an image to include in the rendered scene.\n * This method proxies a call to ImageLoader.loadImage, but also tracks\n * image loading progress and invokes a re-render once complete.\n * @param {string} uri - The URI string of the image.\n * @return {Promise} - A Promise that resolves to the loaded Image.\n */\n loadImage(uri) {\n return this._load('loadImage', uri);\n }\n}\n\nconst KeyDownEvent = 'keydown';\nconst KeyPressEvent = 'keypress';\nconst KeyUpEvent = 'keyup';\nconst DragEnterEvent = 'dragenter';\nconst DragLeaveEvent = 'dragleave';\nconst DragOverEvent = 'dragover';\nconst PointerDownEvent = 'pointerdown';\nconst PointerUpEvent = 'pointerup';\nconst PointerMoveEvent = 'pointermove';\nconst PointerOutEvent = 'pointerout';\nconst PointerOverEvent = 'pointerover';\nconst MouseDownEvent = 'mousedown';\nconst MouseUpEvent = 'mouseup';\nconst MouseMoveEvent = 'mousemove';\nconst MouseOutEvent = 'mouseout';\nconst MouseOverEvent = 'mouseover';\nconst ClickEvent = 'click';\nconst DoubleClickEvent = 'dblclick';\nconst WheelEvent = 'wheel';\nconst MouseWheelEvent = 'mousewheel';\nconst TouchStartEvent = 'touchstart';\nconst TouchMoveEvent = 'touchmove';\nconst TouchEndEvent = 'touchend';\nconst Events = [KeyDownEvent, KeyPressEvent, KeyUpEvent, DragEnterEvent, DragLeaveEvent, DragOverEvent, PointerDownEvent, PointerUpEvent, PointerMoveEvent, PointerOutEvent, PointerOverEvent, MouseDownEvent, MouseUpEvent, MouseMoveEvent, MouseOutEvent, MouseOverEvent, ClickEvent, DoubleClickEvent, WheelEvent, MouseWheelEvent, TouchStartEvent, TouchMoveEvent, TouchEndEvent];\nconst TooltipShowEvent = PointerMoveEvent;\nconst TooltipHideEvent = MouseOutEvent;\nconst HrefEvent = ClickEvent;\n\nclass CanvasHandler extends Handler {\n constructor(loader, tooltip) {\n super(loader, tooltip);\n this._down = null;\n this._touch = null;\n this._first = true;\n this._events = {};\n\n // supported events\n this.events = Events;\n this.pointermove = move([PointerMoveEvent, MouseMoveEvent], [PointerOverEvent, MouseOverEvent], [PointerOutEvent, MouseOutEvent]);\n this.dragover = move([DragOverEvent], [DragEnterEvent], [DragLeaveEvent]), this.pointerout = inactive([PointerOutEvent, MouseOutEvent]);\n this.dragleave = inactive([DragLeaveEvent]);\n }\n initialize(el, origin, obj) {\n this._canvas = el && domFind(el, 'canvas');\n\n // add minimal events required for proper state management\n [ClickEvent, MouseDownEvent, PointerDownEvent, PointerMoveEvent, PointerOutEvent, DragLeaveEvent].forEach(type => eventListenerCheck(this, type));\n return super.initialize(el, origin, obj);\n }\n\n // return the backing canvas instance\n canvas() {\n return this._canvas;\n }\n\n // retrieve the current canvas context\n context() {\n return this._canvas.getContext('2d');\n }\n\n // to keep old versions of firefox happy\n DOMMouseScroll(evt) {\n this.fire(MouseWheelEvent, evt);\n }\n pointerdown(evt) {\n this._down = this._active;\n this.fire(PointerDownEvent, evt);\n }\n mousedown(evt) {\n this._down = this._active;\n this.fire(MouseDownEvent, evt);\n }\n click(evt) {\n if (this._down === this._active) {\n this.fire(ClickEvent, evt);\n this._down = null;\n }\n }\n touchstart(evt) {\n this._touch = this.pickEvent(evt.changedTouches[0]);\n if (this._first) {\n this._active = this._touch;\n this._first = false;\n }\n this.fire(TouchStartEvent, evt, true);\n }\n touchmove(evt) {\n this.fire(TouchMoveEvent, evt, true);\n }\n touchend(evt) {\n this.fire(TouchEndEvent, evt, true);\n this._touch = null;\n }\n\n // fire an event\n fire(type, evt, touch) {\n const a = touch ? this._touch : this._active,\n h = this._handlers[type];\n\n // set event type relative to scenegraph items\n evt.vegaType = type;\n\n // handle hyperlinks and tooltips first\n if (type === HrefEvent && a && a.href) {\n this.handleHref(evt, a, a.href);\n } else if (type === TooltipShowEvent || type === TooltipHideEvent) {\n this.handleTooltip(evt, a, type !== TooltipHideEvent);\n }\n\n // invoke all registered handlers\n if (h) {\n for (let i = 0, len = h.length; i < len; ++i) {\n h[i].handler.call(this._obj, evt, a);\n }\n }\n }\n\n // add an event handler\n on(type, handler) {\n const name = this.eventName(type),\n h = this._handlers,\n i = this._handlerIndex(h[name], type, handler);\n if (i < 0) {\n eventListenerCheck(this, type);\n (h[name] || (h[name] = [])).push({\n type: type,\n handler: handler\n });\n }\n return this;\n }\n\n // remove an event handler\n off(type, handler) {\n const name = this.eventName(type),\n h = this._handlers[name],\n i = this._handlerIndex(h, type, handler);\n if (i >= 0) {\n h.splice(i, 1);\n }\n return this;\n }\n pickEvent(evt) {\n const p = point(evt, this._canvas),\n o = this._origin;\n return this.pick(this._scene, p[0], p[1], p[0] - o[0], p[1] - o[1]);\n }\n\n // find the scenegraph item at the current pointer position\n // x, y -- the absolute x, y pointer coordinates on the canvas element\n // gx, gy -- the relative coordinates within the current group\n pick(scene, x, y, gx, gy) {\n const g = this.context(),\n mark = Marks[scene.marktype];\n return mark.pick.call(this, g, scene, x, y, gx, gy);\n }\n}\nconst eventBundle = type => type === TouchStartEvent || type === TouchMoveEvent || type === TouchEndEvent ? [TouchStartEvent, TouchMoveEvent, TouchEndEvent] : [type];\n\n// lazily add listeners to the canvas as needed\nfunction eventListenerCheck(handler, type) {\n eventBundle(type).forEach(_ => addEventListener(handler, _));\n}\nfunction addEventListener(handler, type) {\n const canvas = handler.canvas();\n if (canvas && !handler._events[type]) {\n handler._events[type] = 1;\n canvas.addEventListener(type, handler[type] ? evt => handler[type](evt) : evt => handler.fire(type, evt));\n }\n}\nfunction fireAll(handler, types, event) {\n types.forEach(type => handler.fire(type, event));\n}\nfunction move(moveEvents, overEvents, outEvents) {\n return function (evt) {\n const a = this._active,\n p = this.pickEvent(evt);\n if (p === a) {\n // active item and picked item are the same\n fireAll(this, moveEvents, evt); // fire move\n } else {\n // active item and picked item are different\n if (!a || !a.exit) {\n // fire out for prior active item\n // suppress if active item was removed from scene\n fireAll(this, outEvents, evt);\n }\n this._active = p; // set new active item\n fireAll(this, overEvents, evt); // fire over for new active item\n fireAll(this, moveEvents, evt); // fire move for new active item\n }\n };\n}\nfunction inactive(types) {\n return function (evt) {\n fireAll(this, types, evt);\n this._active = null;\n };\n}\n\nfunction devicePixelRatio() {\n return typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1;\n}\nfunction resize (canvas, width, height, origin, scaleFactor, opt) {\n const inDOM = typeof HTMLElement !== 'undefined' && canvas instanceof HTMLElement && canvas.parentNode != null,\n context = canvas.getContext('2d'),\n ratio = inDOM ? devicePixelRatio() : scaleFactor;\n canvas.width = width * ratio;\n canvas.height = height * ratio;\n for (const key in opt) {\n context[key] = opt[key];\n }\n if (inDOM && ratio !== 1) {\n canvas.style.width = width + 'px';\n canvas.style.height = height + 'px';\n }\n context.pixelRatio = ratio;\n context.setTransform(ratio, 0, 0, ratio, ratio * origin[0], ratio * origin[1]);\n return canvas;\n}\n\nclass CanvasRenderer extends Renderer {\n constructor(loader) {\n super(loader);\n this._options = {};\n this._redraw = false;\n this._dirty = new Bounds();\n this._tempb = new Bounds();\n }\n initialize(el, width, height, origin, scaleFactor, options) {\n this._options = options || {};\n this._canvas = this._options.externalContext ? null : canvas(1, 1, this._options.type); // instantiate a small canvas\n\n if (el && this._canvas) {\n domClear(el, 0).appendChild(this._canvas);\n this._canvas.setAttribute('class', 'marks');\n }\n\n // this method will invoke resize to size the canvas appropriately\n return super.initialize(el, width, height, origin, scaleFactor);\n }\n resize(width, height, origin, scaleFactor) {\n super.resize(width, height, origin, scaleFactor);\n if (this._canvas) {\n // configure canvas size and transform\n resize(this._canvas, this._width, this._height, this._origin, this._scale, this._options.context);\n } else {\n // external context needs to be scaled and positioned to origin\n const ctx = this._options.externalContext;\n if (!ctx) error('CanvasRenderer is missing a valid canvas or context');\n ctx.scale(this._scale, this._scale);\n ctx.translate(this._origin[0], this._origin[1]);\n }\n this._redraw = true;\n return this;\n }\n canvas() {\n return this._canvas;\n }\n context() {\n return this._options.externalContext || (this._canvas ? this._canvas.getContext('2d') : null);\n }\n dirty(item) {\n const b = this._tempb.clear().union(item.bounds);\n let g = item.mark.group;\n while (g) {\n b.translate(g.x || 0, g.y || 0);\n g = g.mark.group;\n }\n this._dirty.union(b);\n }\n _render(scene, markTypes) {\n const g = this.context(),\n o = this._origin,\n w = this._width,\n h = this._height,\n db = this._dirty,\n vb = viewBounds(o, w, h);\n\n // setup\n g.save();\n const b = this._redraw || db.empty() ? (this._redraw = false, vb.expand(1)) : clipToBounds(g, vb.intersect(db), o);\n this.clear(-o[0], -o[1], w, h);\n\n // render\n this.draw(g, scene, b, markTypes);\n\n // takedown\n g.restore();\n db.clear();\n return this;\n }\n draw(ctx, scene, bounds, markTypes) {\n if (scene.marktype !== 'group' && markTypes != null && !markTypes.includes(scene.marktype)) {\n return;\n }\n const mark = Marks[scene.marktype];\n if (scene.clip) clip(ctx, scene);\n mark.draw.call(this, ctx, scene, bounds, markTypes);\n if (scene.clip) ctx.restore();\n }\n clear(x, y, w, h) {\n const opt = this._options,\n g = this.context();\n if (opt.type !== 'pdf' && !opt.externalContext) {\n // calling clear rect voids vector output in pdf mode\n // and could remove external context content (#2615)\n g.clearRect(x, y, w, h);\n }\n if (this._bgcolor != null) {\n g.fillStyle = this._bgcolor;\n g.fillRect(x, y, w, h);\n }\n }\n}\nconst viewBounds = (origin, width, height) => new Bounds().set(0, 0, width, height).translate(-origin[0], -origin[1]);\nfunction clipToBounds(g, b, origin) {\n // expand bounds by 1 pixel, then round to pixel boundaries\n b.expand(1).round();\n\n // align to base pixel grid in case of non-integer scaling (#2425)\n if (g.pixelRatio % 1) {\n b.scale(g.pixelRatio).round().scale(1 / g.pixelRatio);\n }\n\n // to avoid artifacts translate if origin has fractional pixels\n b.translate(-(origin[0] % 1), -(origin[1] % 1));\n\n // set clip path\n g.beginPath();\n g.rect(b.x1, b.y1, b.width(), b.height());\n g.clip();\n return b;\n}\n\nclass SVGHandler extends Handler {\n constructor(loader, tooltip) {\n super(loader, tooltip);\n const h = this;\n h._hrefHandler = listener(h, (evt, item) => {\n if (item && item.href) h.handleHref(evt, item, item.href);\n });\n h._tooltipHandler = listener(h, (evt, item) => {\n h.handleTooltip(evt, item, evt.type !== TooltipHideEvent);\n });\n }\n initialize(el, origin, obj) {\n let svg = this._svg;\n if (svg) {\n svg.removeEventListener(HrefEvent, this._hrefHandler);\n svg.removeEventListener(TooltipShowEvent, this._tooltipHandler);\n svg.removeEventListener(TooltipHideEvent, this._tooltipHandler);\n }\n this._svg = svg = el && domFind(el, 'svg');\n if (svg) {\n svg.addEventListener(HrefEvent, this._hrefHandler);\n svg.addEventListener(TooltipShowEvent, this._tooltipHandler);\n svg.addEventListener(TooltipHideEvent, this._tooltipHandler);\n }\n return super.initialize(el, origin, obj);\n }\n canvas() {\n return this._svg;\n }\n\n // add an event handler\n on(type, handler) {\n const name = this.eventName(type),\n h = this._handlers,\n i = this._handlerIndex(h[name], type, handler);\n if (i < 0) {\n const x = {\n type,\n handler,\n listener: listener(this, handler)\n };\n (h[name] || (h[name] = [])).push(x);\n if (this._svg) {\n this._svg.addEventListener(name, x.listener);\n }\n }\n return this;\n }\n\n // remove an event handler\n off(type, handler) {\n const name = this.eventName(type),\n h = this._handlers[name],\n i = this._handlerIndex(h, type, handler);\n if (i >= 0) {\n if (this._svg) {\n this._svg.removeEventListener(name, h[i].listener);\n }\n h.splice(i, 1);\n }\n return this;\n }\n}\n\n// wrap an event listener for the SVG DOM\nconst listener = (context, handler) => evt => {\n let item = evt.target.__data__;\n item = Array.isArray(item) ? item[0] : item;\n evt.vegaType = evt.type;\n handler.call(context._obj, evt, item);\n};\n\nconst ARIA_HIDDEN = 'aria-hidden';\nconst ARIA_LABEL = 'aria-label';\nconst ARIA_ROLE = 'role';\nconst ARIA_ROLEDESCRIPTION = 'aria-roledescription';\nconst GRAPHICS_OBJECT = 'graphics-object';\nconst GRAPHICS_SYMBOL = 'graphics-symbol';\nconst bundle = (role, roledesc, label) => ({\n [ARIA_ROLE]: role,\n [ARIA_ROLEDESCRIPTION]: roledesc,\n [ARIA_LABEL]: label || undefined\n});\n\n// these roles are covered by related roles\n// we can ignore them, no need to generate attributes\nconst AriaIgnore = toSet(['axis-domain', 'axis-grid', 'axis-label', 'axis-tick', 'axis-title', 'legend-band', 'legend-entry', 'legend-gradient', 'legend-label', 'legend-title', 'legend-symbol', 'title']);\n\n// aria attribute generators for guide roles\nconst AriaGuides = {\n 'axis': {\n desc: 'axis',\n caption: axisCaption\n },\n 'legend': {\n desc: 'legend',\n caption: legendCaption\n },\n 'title-text': {\n desc: 'title',\n caption: item => `Title text '${titleCaption(item)}'`\n },\n 'title-subtitle': {\n desc: 'subtitle',\n caption: item => `Subtitle text '${titleCaption(item)}'`\n }\n};\n\n// aria properties generated for mark item encoding channels\nconst AriaEncode = {\n ariaRole: ARIA_ROLE,\n ariaRoleDescription: ARIA_ROLEDESCRIPTION,\n description: ARIA_LABEL\n};\nfunction ariaItemAttributes(emit, item) {\n const hide = item.aria === false;\n emit(ARIA_HIDDEN, hide || undefined);\n if (hide || item.description == null) {\n for (const prop in AriaEncode) {\n emit(AriaEncode[prop], undefined);\n }\n } else {\n const type = item.mark.marktype;\n emit(ARIA_LABEL, item.description);\n emit(ARIA_ROLE, item.ariaRole || (type === 'group' ? GRAPHICS_OBJECT : GRAPHICS_SYMBOL));\n emit(ARIA_ROLEDESCRIPTION, item.ariaRoleDescription || `${type} mark`);\n }\n}\nfunction ariaMarkAttributes(mark) {\n return mark.aria === false ? {\n [ARIA_HIDDEN]: true\n } : AriaIgnore[mark.role] ? null : AriaGuides[mark.role] ? ariaGuide(mark, AriaGuides[mark.role]) : ariaMark(mark);\n}\nfunction ariaMark(mark) {\n const type = mark.marktype;\n const recurse = type === 'group' || type === 'text' || mark.items.some(_ => _.description != null && _.aria !== false);\n return bundle(recurse ? GRAPHICS_OBJECT : GRAPHICS_SYMBOL, `${type} mark container`, mark.description);\n}\nfunction ariaGuide(mark, opt) {\n try {\n const item = mark.items[0],\n caption = opt.caption || (() => '');\n return bundle(opt.role || GRAPHICS_SYMBOL, opt.desc, item.description || caption(item));\n } catch (err) {\n return null;\n }\n}\nfunction titleCaption(item) {\n return array(item.text).join(' ');\n}\nfunction axisCaption(item) {\n const datum = item.datum,\n orient = item.orient,\n title = datum.title ? extractTitle(item) : null,\n ctx = item.context,\n scale = ctx.scales[datum.scale].value,\n locale = ctx.dataflow.locale(),\n type = scale.type,\n xy = orient === 'left' || orient === 'right' ? 'Y' : 'X';\n return `${xy}-axis` + (title ? ` titled '${title}'` : '') + ` for a ${isDiscrete(type) ? 'discrete' : type} scale` + ` with ${domainCaption(locale, scale, item)}`;\n}\nfunction legendCaption(item) {\n const datum = item.datum,\n title = datum.title ? extractTitle(item) : null,\n type = `${datum.type || ''} legend`.trim(),\n scales = datum.scales,\n props = Object.keys(scales),\n ctx = item.context,\n scale = ctx.scales[scales[props[0]]].value,\n locale = ctx.dataflow.locale();\n return capitalize(type) + (title ? ` titled '${title}'` : '') + ` for ${channelCaption(props)}` + ` with ${domainCaption(locale, scale, item)}`;\n}\nfunction extractTitle(item) {\n try {\n return array(peek(item.items).items[0].text).join(' ');\n } catch (err) {\n return null;\n }\n}\nfunction channelCaption(props) {\n props = props.map(p => p + (p === 'fill' || p === 'stroke' ? ' color' : ''));\n return props.length < 2 ? props[0] : props.slice(0, -1).join(', ') + ' and ' + peek(props);\n}\nfunction capitalize(s) {\n return s.length ? s[0].toUpperCase() + s.slice(1) : s;\n}\n\nconst innerText = val => (val + '').replace(/&/g, '&').replace(//g, '>');\nconst attrText = val => innerText(val).replace(/\"/g, '"').replace(/\\t/g, ' ').replace(/\\n/g, ' ').replace(/\\r/g, ' ');\nfunction markup() {\n let buf = '',\n outer = '',\n inner = '';\n const stack = [],\n clear = () => outer = inner = '',\n push = tag => {\n if (outer) {\n buf += `${outer}>${inner}`;\n clear();\n }\n stack.push(tag);\n },\n attr = (name, value) => {\n if (value != null) outer += ` ${name}=\"${attrText(value)}\"`;\n return m;\n },\n m = {\n open(tag) {\n push(tag);\n outer = '<' + tag;\n for (var _len = arguments.length, attrs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n attrs[_key - 1] = arguments[_key];\n }\n for (const set of attrs) {\n for (const key in set) attr(key, set[key]);\n }\n return m;\n },\n close() {\n const tag = stack.pop();\n if (outer) {\n buf += outer + (inner ? `>${inner}` : '/>');\n } else {\n buf += ``;\n }\n clear();\n return m;\n },\n attr,\n text: t => (inner += innerText(t), m),\n toString: () => buf\n };\n return m;\n}\nconst serializeXML = node => _serialize(markup(), node) + '';\nfunction _serialize(m, node) {\n m.open(node.tagName);\n if (node.hasAttributes()) {\n const attrs = node.attributes,\n n = attrs.length;\n for (let i = 0; i < n; ++i) {\n m.attr(attrs[i].name, attrs[i].value);\n }\n }\n if (node.hasChildNodes()) {\n const children = node.childNodes;\n for (const child of children) {\n child.nodeType === 3 // text node\n ? m.text(child.nodeValue) : _serialize(m, child);\n }\n }\n return m.close();\n}\n\nconst stylesAttr = {\n fill: 'fill',\n fillOpacity: 'fill-opacity',\n stroke: 'stroke',\n strokeOpacity: 'stroke-opacity',\n strokeWidth: 'stroke-width',\n strokeCap: 'stroke-linecap',\n strokeJoin: 'stroke-linejoin',\n strokeDash: 'stroke-dasharray',\n strokeDashOffset: 'stroke-dashoffset',\n strokeMiterLimit: 'stroke-miterlimit',\n opacity: 'opacity'\n};\nconst stylesCss = {\n blend: 'mix-blend-mode'\n};\n\n// ensure miter limit default is consistent with canvas (#2498)\nconst rootAttributes = {\n 'fill': 'none',\n 'stroke-miterlimit': 10\n};\n\nconst RootIndex = 0,\n xmlns = 'http://www.w3.org/2000/xmlns/',\n svgns = metadata.xmlns;\nclass SVGRenderer extends Renderer {\n constructor(loader) {\n super(loader);\n this._dirtyID = 0;\n this._dirty = [];\n this._svg = null;\n this._root = null;\n this._defs = null;\n }\n\n /**\n * Initialize a new SVGRenderer instance.\n * @param {DOMElement} el - The containing DOM element for the display.\n * @param {number} width - The coordinate width of the display, in pixels.\n * @param {number} height - The coordinate height of the display, in pixels.\n * @param {Array} origin - The origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {SVGRenderer} - This renderer instance.\n */\n initialize(el, width, height, origin, scaleFactor) {\n // create the svg definitions cache\n this._defs = {};\n this._clearDefs();\n if (el) {\n this._svg = domChild(el, 0, 'svg', svgns);\n this._svg.setAttributeNS(xmlns, 'xmlns', svgns);\n this._svg.setAttributeNS(xmlns, 'xmlns:xlink', metadata['xmlns:xlink']);\n this._svg.setAttribute('version', metadata['version']);\n this._svg.setAttribute('class', 'marks');\n domClear(el, 1);\n\n // set the svg root group\n this._root = domChild(this._svg, RootIndex, 'g', svgns);\n setAttributes(this._root, rootAttributes);\n\n // ensure no additional child elements\n domClear(this._svg, RootIndex + 1);\n }\n\n // set background color if defined\n this.background(this._bgcolor);\n return super.initialize(el, width, height, origin, scaleFactor);\n }\n\n /**\n * Get / set the background color.\n */\n background(bgcolor) {\n if (arguments.length && this._svg) {\n this._svg.style.setProperty('background-color', bgcolor);\n }\n return super.background(...arguments);\n }\n\n /**\n * Resize the display.\n * @param {number} width - The new coordinate width of the display, in pixels.\n * @param {number} height - The new coordinate height of the display, in pixels.\n * @param {Array} origin - The new origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {SVGRenderer} - This renderer instance;\n */\n resize(width, height, origin, scaleFactor) {\n super.resize(width, height, origin, scaleFactor);\n if (this._svg) {\n setAttributes(this._svg, {\n width: this._width * this._scale,\n height: this._height * this._scale,\n viewBox: `0 0 ${this._width} ${this._height}`\n });\n this._root.setAttribute('transform', `translate(${this._origin})`);\n }\n this._dirty = [];\n return this;\n }\n\n /**\n * Returns the SVG element of the visualization.\n * @return {DOMElement} - The SVG element.\n */\n canvas() {\n return this._svg;\n }\n\n /**\n * Returns an SVG text string for the rendered content,\n * or null if this renderer is currently headless.\n */\n svg() {\n const svg = this._svg,\n bg = this._bgcolor;\n if (!svg) return null;\n let node;\n if (bg) {\n svg.removeAttribute('style');\n node = domChild(svg, RootIndex, 'rect', svgns);\n setAttributes(node, {\n width: this._width,\n height: this._height,\n fill: bg\n });\n }\n const text = serializeXML(svg);\n if (bg) {\n svg.removeChild(node);\n this._svg.style.setProperty('background-color', bg);\n }\n return text;\n }\n\n /**\n * Internal rendering method.\n * @param {object} scene - The root mark of a scenegraph to render.\n * @param {Array} markTypes - Array of the mark types to render.\n * If undefined, render all mark types\n */\n _render(scene, markTypes) {\n // perform spot updates and re-render markup\n if (this._dirtyCheck()) {\n if (this._dirtyAll) this._clearDefs();\n this.mark(this._root, scene, undefined, markTypes);\n domClear(this._root, 1);\n }\n this.defs();\n this._dirty = [];\n ++this._dirtyID;\n return this;\n }\n\n // -- Manage rendering of items marked as dirty --\n\n /**\n * Flag a mark item as dirty.\n * @param {Item} item - The mark item.\n */\n dirty(item) {\n if (item.dirty !== this._dirtyID) {\n item.dirty = this._dirtyID;\n this._dirty.push(item);\n }\n }\n\n /**\n * Check if a mark item is considered dirty.\n * @param {Item} item - The mark item.\n */\n isDirty(item) {\n return this._dirtyAll || !item._svg || !item._svg.ownerSVGElement || item.dirty === this._dirtyID;\n }\n\n /**\n * Internal method to check dirty status and, if possible,\n * make targetted updates without a full rendering pass.\n */\n _dirtyCheck() {\n this._dirtyAll = true;\n const items = this._dirty;\n if (!items.length || !this._dirtyID) return true;\n const id = ++this._dirtyID;\n let item, mark, type, mdef, i, n, o;\n for (i = 0, n = items.length; i < n; ++i) {\n item = items[i];\n mark = item.mark;\n if (mark.marktype !== type) {\n // memoize mark instance lookup\n type = mark.marktype;\n mdef = Marks[type];\n }\n if (mark.zdirty && mark.dirty !== id) {\n this._dirtyAll = false;\n dirtyParents(item, id);\n mark.items.forEach(i => {\n i.dirty = id;\n });\n }\n if (mark.zdirty) continue; // handle in standard drawing pass\n\n if (item.exit) {\n // EXIT\n if (mdef.nested && mark.items.length) {\n // if nested mark with remaining points, update instead\n o = mark.items[0];\n if (o._svg) this._update(mdef, o._svg, o);\n } else if (item._svg) {\n // otherwise remove from DOM\n o = item._svg.parentNode;\n if (o) o.removeChild(item._svg);\n }\n item._svg = null;\n continue;\n }\n item = mdef.nested ? mark.items[0] : item;\n if (item._update === id) continue; // already visited\n\n if (!item._svg || !item._svg.ownerSVGElement) {\n // ENTER\n this._dirtyAll = false;\n dirtyParents(item, id);\n } else {\n // IN-PLACE UPDATE\n this._update(mdef, item._svg, item);\n }\n item._update = id;\n }\n return !this._dirtyAll;\n }\n\n // -- Construct & maintain scenegraph to SVG mapping ---\n\n /**\n * Render a set of mark items.\n * @param {SVGElement} el - The parent element in the SVG tree.\n * @param {object} scene - The mark parent to render.\n * @param {SVGElement} prev - The previous sibling in the SVG tree.\n * @param {Array} markTypes - Array of the mark types to render.\n * If undefined, render all mark types\n */\n mark(el, scene, prev, markTypes) {\n if (!this.isDirty(scene)) {\n return scene._svg;\n }\n const svg = this._svg,\n markType = scene.marktype,\n mdef = Marks[markType],\n events = scene.interactive === false ? 'none' : null,\n isGroup = mdef.tag === 'g';\n const parent = bind(scene, el, prev, 'g', svg);\n if (markType !== 'group' && markTypes != null && !markTypes.includes(markType)) {\n domClear(parent, 0);\n return scene._svg;\n }\n parent.setAttribute('class', cssClass(scene));\n\n // apply aria attributes to parent container element\n const aria = ariaMarkAttributes(scene);\n for (const key in aria) setAttribute(parent, key, aria[key]);\n if (!isGroup) {\n setAttribute(parent, 'pointer-events', events);\n }\n setAttribute(parent, 'clip-path', scene.clip ? clip$1(this, scene, scene.group) : null);\n let sibling = null,\n i = 0;\n const process = item => {\n const dirty = this.isDirty(item),\n node = bind(item, parent, sibling, mdef.tag, svg);\n if (dirty) {\n this._update(mdef, node, item);\n if (isGroup) recurse(this, node, item, markTypes);\n }\n sibling = node;\n ++i;\n };\n if (mdef.nested) {\n if (scene.items.length) process(scene.items[0]);\n } else {\n visit(scene, process);\n }\n domClear(parent, i);\n return parent;\n }\n\n /**\n * Update the attributes of an SVG element for a mark item.\n * @param {object} mdef - The mark definition object\n * @param {SVGElement} el - The SVG element.\n * @param {Item} item - The mark item.\n */\n _update(mdef, el, item) {\n // set dom element and values cache\n // provides access to emit method\n element = el;\n values = el.__values__;\n\n // apply aria-specific properties\n ariaItemAttributes(emit, item);\n\n // apply svg attributes\n mdef.attr(emit, item, this);\n\n // some marks need special treatment\n const extra = mark_extras[mdef.type];\n if (extra) extra.call(this, mdef, el, item);\n\n // apply svg style attributes\n // note: element state may have been modified by 'extra' method\n if (element) this.style(element, item);\n }\n\n /**\n * Update the presentation attributes of an SVG element for a mark item.\n * @param {SVGElement} el - The SVG element.\n * @param {Item} item - The mark item.\n */\n style(el, item) {\n if (item == null) return;\n for (const prop in stylesAttr) {\n let value = prop === 'font' ? fontFamily(item) : item[prop];\n if (value === values[prop]) continue;\n const name = stylesAttr[prop];\n if (value == null) {\n el.removeAttribute(name);\n } else {\n if (isGradient(value)) {\n value = gradientRef(value, this._defs.gradient, href());\n }\n el.setAttribute(name, value + '');\n }\n values[prop] = value;\n }\n for (const prop in stylesCss) {\n setStyle(el, stylesCss[prop], item[prop]);\n }\n }\n\n /**\n * Render SVG defs, as needed.\n * Must be called *after* marks have been processed to ensure the\n * collected state is current and accurate.\n */\n defs() {\n const svg = this._svg,\n defs = this._defs;\n let el = defs.el,\n index = 0;\n for (const id in defs.gradient) {\n if (!el) defs.el = el = domChild(svg, RootIndex + 1, 'defs', svgns);\n index = updateGradient(el, defs.gradient[id], index);\n }\n for (const id in defs.clipping) {\n if (!el) defs.el = el = domChild(svg, RootIndex + 1, 'defs', svgns);\n index = updateClipping(el, defs.clipping[id], index);\n }\n\n // clean-up\n if (el) {\n index === 0 ? (svg.removeChild(el), defs.el = null) : domClear(el, index);\n }\n }\n\n /**\n * Clear defs caches.\n */\n _clearDefs() {\n const def = this._defs;\n def.gradient = {};\n def.clipping = {};\n }\n}\n\n// mark ancestor chain with a dirty id\nfunction dirtyParents(item, id) {\n for (; item && item.dirty !== id; item = item.mark.group) {\n item.dirty = id;\n if (item.mark && item.mark.dirty !== id) {\n item.mark.dirty = id;\n } else return;\n }\n}\n\n// update gradient definitions\nfunction updateGradient(el, grad, index) {\n let i, n, stop;\n if (grad.gradient === 'radial') {\n // SVG radial gradients automatically transform to normalized bbox\n // coordinates, in a way that is cumbersome to replicate in canvas.\n // We wrap the radial gradient in a pattern element, allowing us to\n // maintain a circular gradient that matches what canvas provides.\n let pt = domChild(el, index++, 'pattern', svgns);\n setAttributes(pt, {\n id: patternPrefix + grad.id,\n viewBox: '0,0,1,1',\n width: '100%',\n height: '100%',\n preserveAspectRatio: 'xMidYMid slice'\n });\n pt = domChild(pt, 0, 'rect', svgns);\n setAttributes(pt, {\n width: 1,\n height: 1,\n fill: `url(${href()}#${grad.id})`\n });\n el = domChild(el, index++, 'radialGradient', svgns);\n setAttributes(el, {\n id: grad.id,\n fx: grad.x1,\n fy: grad.y1,\n fr: grad.r1,\n cx: grad.x2,\n cy: grad.y2,\n r: grad.r2\n });\n } else {\n el = domChild(el, index++, 'linearGradient', svgns);\n setAttributes(el, {\n id: grad.id,\n x1: grad.x1,\n x2: grad.x2,\n y1: grad.y1,\n y2: grad.y2\n });\n }\n for (i = 0, n = grad.stops.length; i < n; ++i) {\n stop = domChild(el, i, 'stop', svgns);\n stop.setAttribute('offset', grad.stops[i].offset);\n stop.setAttribute('stop-color', grad.stops[i].color);\n }\n domClear(el, i);\n return index;\n}\n\n// update clipping path definitions\nfunction updateClipping(el, clip, index) {\n let mask;\n el = domChild(el, index, 'clipPath', svgns);\n el.setAttribute('id', clip.id);\n if (clip.path) {\n mask = domChild(el, 0, 'path', svgns);\n mask.setAttribute('d', clip.path);\n } else {\n mask = domChild(el, 0, 'rect', svgns);\n setAttributes(mask, {\n x: 0,\n y: 0,\n width: clip.width,\n height: clip.height\n });\n }\n domClear(el, 1);\n return index + 1;\n}\n\n// Recursively process group contents.\nfunction recurse(renderer, el, group, markTypes) {\n // child 'g' element is second to last among children (path, g, path)\n // other children here are foreground and background path elements\n el = el.lastChild.previousSibling;\n let prev,\n idx = 0;\n visit(group, item => {\n prev = renderer.mark(el, item, prev, markTypes);\n ++idx;\n });\n\n // remove any extraneous DOM elements\n domClear(el, 1 + idx);\n}\n\n// Bind a scenegraph item to an SVG DOM element.\n// Create new SVG elements as needed.\nfunction bind(item, el, sibling, tag, svg) {\n let node = item._svg,\n doc;\n\n // create a new dom node if needed\n if (!node) {\n doc = el.ownerDocument;\n node = domCreate(doc, tag, svgns);\n item._svg = node;\n if (item.mark) {\n node.__data__ = item;\n node.__values__ = {\n fill: 'default'\n };\n\n // if group, create background, content, and foreground elements\n if (tag === 'g') {\n const bg = domCreate(doc, 'path', svgns);\n node.appendChild(bg);\n bg.__data__ = item;\n const cg = domCreate(doc, 'g', svgns);\n node.appendChild(cg);\n cg.__data__ = item;\n const fg = domCreate(doc, 'path', svgns);\n node.appendChild(fg);\n fg.__data__ = item;\n fg.__values__ = {\n fill: 'default'\n };\n }\n }\n }\n\n // (re-)insert if (a) not contained in SVG or (b) sibling order has changed\n if (node.ownerSVGElement !== svg || siblingCheck(node, sibling)) {\n el.insertBefore(node, sibling ? sibling.nextSibling : el.firstChild);\n }\n return node;\n}\n\n// check if two nodes are ordered siblings\nfunction siblingCheck(node, sibling) {\n return node.parentNode && node.parentNode.childNodes.length > 1 && node.previousSibling != sibling; // treat null/undefined the same\n}\n\n// -- Set attributes & styles on SVG elements ---\n\nlet element = null,\n // temp var for current SVG element\n values = null; // temp var for current values hash\n\n// Extra configuration for certain mark types\nconst mark_extras = {\n group(mdef, el, item) {\n const fg = element = el.childNodes[2];\n values = fg.__values__;\n mdef.foreground(emit, item, this);\n values = el.__values__; // use parent's values hash\n element = el.childNodes[1];\n mdef.content(emit, item, this);\n const bg = element = el.childNodes[0];\n mdef.background(emit, item, this);\n const value = item.mark.interactive === false ? 'none' : null;\n if (value !== values.events) {\n setAttribute(fg, 'pointer-events', value);\n setAttribute(bg, 'pointer-events', value);\n values.events = value;\n }\n if (item.strokeForeground && item.stroke) {\n const fill = item.fill;\n setAttribute(fg, 'display', null);\n\n // set style of background\n this.style(bg, item);\n setAttribute(bg, 'stroke', null);\n\n // set style of foreground\n if (fill) item.fill = null;\n values = fg.__values__;\n this.style(fg, item);\n if (fill) item.fill = fill;\n\n // leave element null to prevent downstream styling\n element = null;\n } else {\n // ensure foreground is ignored\n setAttribute(fg, 'display', 'none');\n }\n },\n image(mdef, el, item) {\n if (item.smooth === false) {\n setStyle(el, 'image-rendering', 'optimizeSpeed');\n setStyle(el, 'image-rendering', 'pixelated');\n } else {\n setStyle(el, 'image-rendering', null);\n }\n },\n text(mdef, el, item) {\n const tl = textLines(item);\n let key, value, doc, lh;\n if (isArray(tl)) {\n // multi-line text\n value = tl.map(_ => textValue(item, _));\n key = value.join('\\n'); // content cache key\n\n if (key !== values.text) {\n domClear(el, 0);\n doc = el.ownerDocument;\n lh = lineHeight(item);\n value.forEach((t, i) => {\n const ts = domCreate(doc, 'tspan', svgns);\n ts.__data__ = item; // data binding\n ts.textContent = t;\n if (i) {\n ts.setAttribute('x', 0);\n ts.setAttribute('dy', lh);\n }\n el.appendChild(ts);\n });\n values.text = key;\n }\n } else {\n // single-line text\n value = textValue(item, tl);\n if (value !== values.text) {\n el.textContent = value;\n values.text = value;\n }\n }\n setAttribute(el, 'font-family', fontFamily(item));\n setAttribute(el, 'font-size', fontSize(item) + 'px');\n setAttribute(el, 'font-style', item.fontStyle);\n setAttribute(el, 'font-variant', item.fontVariant);\n setAttribute(el, 'font-weight', item.fontWeight);\n }\n};\nfunction emit(name, value, ns) {\n // early exit if value is unchanged\n if (value === values[name]) return;\n\n // use appropriate method given namespace (ns)\n if (ns) {\n setAttributeNS(element, name, value, ns);\n } else {\n setAttribute(element, name, value);\n }\n\n // note current value for future comparison\n values[name] = value;\n}\nfunction setStyle(el, name, value) {\n if (value !== values[name]) {\n if (value == null) {\n el.style.removeProperty(name);\n } else {\n el.style.setProperty(name, value + '');\n }\n values[name] = value;\n }\n}\nfunction setAttributes(el, attrs) {\n for (const key in attrs) {\n setAttribute(el, key, attrs[key]);\n }\n}\nfunction setAttribute(el, name, value) {\n if (value != null) {\n // if value is provided, update DOM attribute\n el.setAttribute(name, value);\n } else {\n // else remove DOM attribute\n el.removeAttribute(name);\n }\n}\nfunction setAttributeNS(el, name, value, ns) {\n if (value != null) {\n // if value is provided, update DOM attribute\n el.setAttributeNS(ns, name, value);\n } else {\n // else remove DOM attribute\n el.removeAttributeNS(ns, name);\n }\n}\nfunction href() {\n let loc;\n return typeof window === 'undefined' ? '' : (loc = window.location).hash ? loc.href.slice(0, -loc.hash.length) : loc.href;\n}\n\nclass SVGStringRenderer extends Renderer {\n constructor(loader) {\n super(loader);\n this._text = null;\n this._defs = {\n gradient: {},\n clipping: {}\n };\n }\n\n /**\n * Returns the rendered SVG text string,\n * or null if rendering has not yet occurred.\n */\n svg() {\n return this._text;\n }\n\n /**\n * Internal rendering method.\n * @param {object} scene - The root mark of a scenegraph to render.\n */\n _render(scene) {\n const m = markup();\n\n // svg tag\n m.open('svg', extend({}, metadata, {\n class: 'marks',\n width: this._width * this._scale,\n height: this._height * this._scale,\n viewBox: `0 0 ${this._width} ${this._height}`\n }));\n\n // background, if defined\n const bg = this._bgcolor;\n if (bg && bg !== 'transparent' && bg !== 'none') {\n m.open('rect', {\n width: this._width,\n height: this._height,\n fill: bg\n }).close();\n }\n\n // root content group\n m.open('g', rootAttributes, {\n transform: 'translate(' + this._origin + ')'\n });\n this.mark(m, scene);\n m.close(); // \n\n // defs\n this.defs(m);\n\n // get SVG text string\n this._text = m.close() + '';\n return this;\n }\n\n /**\n * Render a set of mark items.\n * @param {object} m - The markup context.\n * @param {object} scene - The mark parent to render.\n */\n mark(m, scene) {\n const mdef = Marks[scene.marktype],\n tag = mdef.tag,\n attrList = [ariaItemAttributes, mdef.attr];\n\n // render opening group tag\n m.open('g', {\n 'class': cssClass(scene),\n 'clip-path': scene.clip ? clip$1(this, scene, scene.group) : null\n }, ariaMarkAttributes(scene), {\n 'pointer-events': tag !== 'g' && scene.interactive === false ? 'none' : null\n });\n\n // render contained elements\n const process = item => {\n const href = this.href(item);\n if (href) m.open('a', href);\n m.open(tag, this.attr(scene, item, attrList, tag !== 'g' ? tag : null));\n if (tag === 'text') {\n const tl = textLines(item);\n if (isArray(tl)) {\n // multi-line text\n const attrs = {\n x: 0,\n dy: lineHeight(item)\n };\n for (let i = 0; i < tl.length; ++i) {\n m.open('tspan', i ? attrs : null).text(textValue(item, tl[i])).close();\n }\n } else {\n // single-line text\n m.text(textValue(item, tl));\n }\n } else if (tag === 'g') {\n const fore = item.strokeForeground,\n fill = item.fill,\n stroke = item.stroke;\n if (fore && stroke) {\n item.stroke = null;\n }\n m.open('path', this.attr(scene, item, mdef.background, 'bgrect')).close();\n\n // recurse for group content\n m.open('g', this.attr(scene, item, mdef.content));\n visit(item, scene => this.mark(m, scene));\n m.close();\n if (fore && stroke) {\n if (fill) item.fill = null;\n item.stroke = stroke;\n m.open('path', this.attr(scene, item, mdef.foreground, 'bgrect')).close();\n if (fill) item.fill = fill;\n } else {\n m.open('path', this.attr(scene, item, mdef.foreground, 'bgfore')).close();\n }\n }\n m.close(); // \n if (href) m.close(); // \n };\n if (mdef.nested) {\n if (scene.items && scene.items.length) process(scene.items[0]);\n } else {\n visit(scene, process);\n }\n\n // render closing group tag\n return m.close(); // \n }\n\n /**\n * Get href attributes for a hyperlinked mark item.\n * @param {Item} item - The mark item.\n */\n href(item) {\n const href = item.href;\n let attr;\n if (href) {\n if (attr = this._hrefs && this._hrefs[href]) {\n return attr;\n } else {\n this.sanitizeURL(href).then(attr => {\n // rewrite to use xlink namespace\n attr['xlink:href'] = attr.href;\n attr.href = null;\n (this._hrefs || (this._hrefs = {}))[href] = attr;\n });\n }\n }\n return null;\n }\n\n /**\n * Get an object of SVG attributes for a mark item.\n * @param {object} scene - The mark parent.\n * @param {Item} item - The mark item.\n * @param {array|function} attrs - One or more attribute emitters.\n * @param {string} tag - The tag being rendered.\n */\n attr(scene, item, attrs, tag) {\n const object = {},\n emit = (name, value, ns, prefixed) => {\n object[prefixed || name] = value;\n };\n\n // apply mark specific attributes\n if (Array.isArray(attrs)) {\n attrs.forEach(fn => fn(emit, item, this));\n } else {\n attrs(emit, item, this);\n }\n\n // apply style attributes\n if (tag) {\n style(object, item, scene, tag, this._defs);\n }\n return object;\n }\n\n /**\n * Render SVG defs, as needed.\n * Must be called *after* marks have been processed to ensure the\n * collected state is current and accurate.\n * @param {object} m - The markup context.\n */\n defs(m) {\n const gradient = this._defs.gradient,\n clipping = this._defs.clipping,\n count = Object.keys(gradient).length + Object.keys(clipping).length;\n if (count === 0) return; // nothing to do\n\n m.open('defs');\n for (const id in gradient) {\n const def = gradient[id],\n stops = def.stops;\n if (def.gradient === 'radial') {\n // SVG radial gradients automatically transform to normalized bbox\n // coordinates, in a way that is cumbersome to replicate in canvas.\n // We wrap the radial gradient in a pattern element, allowing us to\n // maintain a circular gradient that matches what canvas provides.\n\n m.open('pattern', {\n id: patternPrefix + id,\n viewBox: '0,0,1,1',\n width: '100%',\n height: '100%',\n preserveAspectRatio: 'xMidYMid slice'\n });\n m.open('rect', {\n width: '1',\n height: '1',\n fill: 'url(#' + id + ')'\n }).close();\n m.close(); // \n\n m.open('radialGradient', {\n id: id,\n fx: def.x1,\n fy: def.y1,\n fr: def.r1,\n cx: def.x2,\n cy: def.y2,\n r: def.r2\n });\n } else {\n m.open('linearGradient', {\n id: id,\n x1: def.x1,\n x2: def.x2,\n y1: def.y1,\n y2: def.y2\n });\n }\n for (let i = 0; i < stops.length; ++i) {\n m.open('stop', {\n offset: stops[i].offset,\n 'stop-color': stops[i].color\n }).close();\n }\n m.close();\n }\n for (const id in clipping) {\n const def = clipping[id];\n m.open('clipPath', {\n id: id\n });\n if (def.path) {\n m.open('path', {\n d: def.path\n }).close();\n } else {\n m.open('rect', {\n x: 0,\n y: 0,\n width: def.width,\n height: def.height\n }).close();\n }\n m.close();\n }\n m.close();\n }\n}\n\n// Helper function for attr for style presentation attributes\nfunction style(s, item, scene, tag, defs) {\n let styleList;\n if (item == null) return s;\n if (tag === 'bgrect' && scene.interactive === false) {\n s['pointer-events'] = 'none';\n }\n if (tag === 'bgfore') {\n if (scene.interactive === false) {\n s['pointer-events'] = 'none';\n }\n s.display = 'none';\n if (item.fill !== null) return s;\n }\n if (tag === 'image' && item.smooth === false) {\n styleList = ['image-rendering: optimizeSpeed;', 'image-rendering: pixelated;'];\n }\n if (tag === 'text') {\n s['font-family'] = fontFamily(item);\n s['font-size'] = fontSize(item) + 'px';\n s['font-style'] = item.fontStyle;\n s['font-variant'] = item.fontVariant;\n s['font-weight'] = item.fontWeight;\n }\n for (const prop in stylesAttr) {\n let value = item[prop];\n const name = stylesAttr[prop];\n if (value === 'transparent' && (name === 'fill' || name === 'stroke')) ; else if (value != null) {\n if (isGradient(value)) {\n value = gradientRef(value, defs.gradient, '');\n }\n s[name] = value;\n }\n }\n for (const prop in stylesCss) {\n const value = item[prop];\n if (value != null) {\n styleList = styleList || [];\n styleList.push(`${stylesCss[prop]}: ${value};`);\n }\n }\n if (styleList) {\n s.style = styleList.join(' ');\n }\n return s;\n}\n\n/**\n * @typedef {Object} HybridRendererOptions\n *\n * @property {string[]} [svgMarkTypes=['text']] - An array of SVG mark types to render\n * in the SVG layer. All other mark types\n * will be rendered in the Canvas layer.\n * @property {boolean} [svgOnTop=true] - Flag to determine if SVG should be rendered on top.\n * @property {boolean} [debug=false] - Flag to enable or disable debugging mode. When true,\n * the top layer will be stacked below the bottom layer\n * rather than overlaid on top.\n */\n\n/** @type {HybridRendererOptions} */\nconst OPTS = {\n svgMarkTypes: ['text'],\n svgOnTop: true,\n debug: false\n};\n\n/**\n * Configure the HybridRenderer\n *\n * @param {HybridRendererOptions} options - HybridRenderer configuration options.\n */\nfunction setHybridRendererOptions(options) {\n OPTS['svgMarkTypes'] = options.svgMarkTypes ?? ['text'];\n OPTS['svgOnTop'] = options.svgOnTop ?? true;\n OPTS['debug'] = options.debug ?? false;\n}\nclass HybridRenderer extends Renderer {\n constructor(loader) {\n super(loader);\n this._svgRenderer = new SVGRenderer(loader);\n this._canvasRenderer = new CanvasRenderer(loader);\n }\n\n /**\n * Initialize a new HybridRenderer instance.\n * @param {DOMElement} el - The containing DOM element for the display.\n * @param {number} width - The coordinate width of the display, in pixels.\n * @param {number} height - The coordinate height of the display, in pixels.\n * @param {Array} origin - The origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {HybridRenderer} - This renderer instance.\n */\n initialize(el, width, height, origin, scaleFactor) {\n this._root_el = domChild(el, 0, 'div');\n const bottomEl = domChild(this._root_el, 0, 'div');\n const topEl = domChild(this._root_el, 1, 'div');\n this._root_el.style.position = 'relative';\n\n // Set position absolute to overlay svg on top of canvas\n if (!OPTS.debug) {\n bottomEl.style.height = '100%';\n topEl.style.position = 'absolute';\n topEl.style.top = '0';\n topEl.style.left = '0';\n topEl.style.height = '100%';\n topEl.style.width = '100%';\n }\n this._svgEl = OPTS.svgOnTop ? topEl : bottomEl;\n this._canvasEl = OPTS.svgOnTop ? bottomEl : topEl;\n\n // pointer-events to none on SVG layer so that canvas gets all events\n this._svgEl.style.pointerEvents = 'none';\n this._canvasRenderer.initialize(this._canvasEl, width, height, origin, scaleFactor);\n this._svgRenderer.initialize(this._svgEl, width, height, origin, scaleFactor);\n return super.initialize(el, width, height, origin, scaleFactor);\n }\n\n /**\n * Flag a mark item as dirty.\n * @param {Item} item - The mark item.\n */\n dirty(item) {\n if (OPTS.svgMarkTypes.includes(item.mark.marktype)) {\n this._svgRenderer.dirty(item);\n } else {\n this._canvasRenderer.dirty(item);\n }\n return this;\n }\n\n /**\n * Internal rendering method.\n * @param {object} scene - The root mark of a scenegraph to render.\n * @param {Array} markTypes - Array of the mark types to render.\n * If undefined, render all mark types\n */\n _render(scene, markTypes) {\n const allMarkTypes = markTypes ?? ['arc', 'area', 'image', 'line', 'path', 'rect', 'rule', 'shape', 'symbol', 'text', 'trail'];\n const canvasMarkTypes = allMarkTypes.filter(m => !OPTS.svgMarkTypes.includes(m));\n this._svgRenderer.render(scene, OPTS.svgMarkTypes);\n this._canvasRenderer.render(scene, canvasMarkTypes);\n }\n\n /**\n * Resize the display.\n * @param {number} width - The new coordinate width of the display, in pixels.\n * @param {number} height - The new coordinate height of the display, in pixels.\n * @param {Array} origin - The new origin of the display, in pixels.\n * The coordinate system will be translated to this point.\n * @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply\n * the width and height to determine the final pixel size.\n * @return {SVGRenderer} - This renderer instance;\n */\n resize(width, height, origin, scaleFactor) {\n super.resize(width, height, origin, scaleFactor);\n this._svgRenderer.resize(width, height, origin, scaleFactor);\n this._canvasRenderer.resize(width, height, origin, scaleFactor);\n return this;\n }\n background(bgcolor) {\n // Propagate background color to lower canvas renderer\n if (OPTS.svgOnTop) {\n this._canvasRenderer.background(bgcolor);\n } else {\n this._svgRenderer.background(bgcolor);\n }\n return this;\n }\n}\n\nclass HybridHandler extends CanvasHandler {\n constructor(loader, tooltip) {\n super(loader, tooltip);\n }\n initialize(el, origin, obj) {\n const canvas = domChild(domChild(el, 0, 'div'), OPTS.svgOnTop ? 0 : 1, 'div');\n return super.initialize(canvas, origin, obj);\n }\n}\n\nconst Canvas = 'canvas';\nconst Hybrid = 'hybrid';\nconst PNG = 'png';\nconst SVG = 'svg';\nconst None = 'none';\nconst RenderType = {\n Canvas: Canvas,\n PNG: PNG,\n SVG: SVG,\n Hybrid: Hybrid,\n None: None\n};\nconst modules = {};\nmodules[Canvas] = modules[PNG] = {\n renderer: CanvasRenderer,\n headless: CanvasRenderer,\n handler: CanvasHandler\n};\nmodules[SVG] = {\n renderer: SVGRenderer,\n headless: SVGStringRenderer,\n handler: SVGHandler\n};\nmodules[Hybrid] = {\n renderer: HybridRenderer,\n headless: HybridRenderer,\n handler: HybridHandler\n};\nmodules[None] = {};\nfunction renderModule(name, _) {\n name = String(name || '').toLowerCase();\n if (arguments.length > 1) {\n modules[name] = _;\n return this;\n } else {\n return modules[name];\n }\n}\n\nfunction intersect(scene, bounds, filter) {\n const hits = [],\n // intersection results\n box = new Bounds().union(bounds),\n // defensive copy\n type = scene.marktype;\n return type ? intersectMark(scene, box, filter, hits) : type === 'group' ? intersectGroup(scene, box, filter, hits) : error('Intersect scene must be mark node or group item.');\n}\nfunction intersectMark(mark, box, filter, hits) {\n if (visitMark(mark, box, filter)) {\n const items = mark.items,\n type = mark.marktype,\n n = items.length;\n let i = 0;\n if (type === 'group') {\n for (; i < n; ++i) {\n intersectGroup(items[i], box, filter, hits);\n }\n } else {\n for (const test = Marks[type].isect; i < n; ++i) {\n const item = items[i];\n if (intersectItem(item, box, test)) hits.push(item);\n }\n }\n }\n return hits;\n}\nfunction visitMark(mark, box, filter) {\n // process if bounds intersect and if\n // (1) mark is a group mark (so we must recurse), or\n // (2) mark is interactive and passes filter\n return mark.bounds && box.intersects(mark.bounds) && (mark.marktype === 'group' || mark.interactive !== false && (!filter || filter(mark)));\n}\nfunction intersectGroup(group, box, filter, hits) {\n // test intersect against group\n // skip groups by default unless filter says otherwise\n if (filter && filter(group.mark) && intersectItem(group, box, Marks.group.isect)) {\n hits.push(group);\n }\n\n // recursively test children marks\n // translate box to group coordinate space\n const marks = group.items,\n n = marks && marks.length;\n if (n) {\n const x = group.x || 0,\n y = group.y || 0;\n box.translate(-x, -y);\n for (let i = 0; i < n; ++i) {\n intersectMark(marks[i], box, filter, hits);\n }\n box.translate(x, y);\n }\n return hits;\n}\nfunction intersectItem(item, box, test) {\n // test bounds enclosure, bounds intersection, then detailed test\n const bounds = item.bounds;\n return box.encloses(bounds) || box.intersects(bounds) && test(item, box);\n}\n\nconst clipBounds = new Bounds();\nfunction boundClip (mark) {\n const clip = mark.clip;\n if (isFunction(clip)) {\n clip(boundContext(clipBounds.clear()));\n } else if (clip) {\n clipBounds.set(0, 0, mark.group.width, mark.group.height);\n } else return;\n mark.bounds.intersect(clipBounds);\n}\n\nconst TOLERANCE = 1e-9;\nfunction sceneEqual(a, b, key) {\n return a === b ? true : key === 'path' ? pathEqual(a, b) : a instanceof Date && b instanceof Date ? +a === +b : isNumber(a) && isNumber(b) ? Math.abs(a - b) <= TOLERANCE : !a || !b || !isObject(a) && !isObject(b) ? a == b : objectEqual(a, b);\n}\nfunction pathEqual(a, b) {\n return sceneEqual(parse(a), parse(b));\n}\nfunction objectEqual(a, b) {\n var ka = Object.keys(a),\n kb = Object.keys(b),\n key,\n i;\n if (ka.length !== kb.length) return false;\n ka.sort();\n kb.sort();\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i]) return false;\n }\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!sceneEqual(a[key], b[key], key)) return false;\n }\n return typeof a === typeof b;\n}\n\nfunction resetSVGDefIds() {\n resetSVGClipId();\n resetSVGGradientId();\n}\n\nexport { Bounds, CanvasHandler, CanvasRenderer, Gradient, GroupItem, Handler, HybridHandler, HybridRenderer, Item, Marks, RenderType, Renderer, ResourceLoader, SVGHandler, SVGRenderer, SVGStringRenderer, Scenegraph, boundClip, boundContext, boundItem, boundMark, boundStroke, domChild, domClear, domCreate, domFind, font, fontFamily, fontSize, intersect, intersectBoxLine, intersectPath, intersectPoint, intersectRule, lineHeight, markup, multiLineOffset, curves as pathCurves, pathEqual, parse as pathParse, vg_rect as pathRectangle, pathRender, symbols as pathSymbols, vg_trail as pathTrail, point, renderModule, resetSVGClipId, resetSVGDefIds, sceneEqual, sceneFromJSON, pickVisit as scenePickVisit, sceneToJSON, visit as sceneVisit, zorder as sceneZOrder, serializeXML, setHybridRendererOptions, textMetrics };\n","import constant from \"./constant.js\";\nimport {withPath} from \"./path.js\";\nimport asterisk from \"./symbol/asterisk.js\";\nimport circle from \"./symbol/circle.js\";\nimport cross from \"./symbol/cross.js\";\nimport diamond from \"./symbol/diamond.js\";\nimport diamond2 from \"./symbol/diamond2.js\";\nimport plus from \"./symbol/plus.js\";\nimport square from \"./symbol/square.js\";\nimport square2 from \"./symbol/square2.js\";\nimport star from \"./symbol/star.js\";\nimport triangle from \"./symbol/triangle.js\";\nimport triangle2 from \"./symbol/triangle2.js\";\nimport wye from \"./symbol/wye.js\";\nimport times from \"./symbol/times.js\";\n\n// These symbols are designed to be filled.\nexport const symbolsFill = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\n// These symbols are designed to be stroked (with a width of 1.5px and round caps).\nexport const symbolsStroke = [\n circle,\n plus,\n times,\n triangle2,\n asterisk,\n square2,\n diamond2\n];\n\nexport default function Symbol(type, size) {\n let context = null,\n path = withPath(symbol);\n\n type = typeof type === \"function\" ? type : constant(type || circle);\n size = typeof size === \"function\" ? size : constant(size === undefined ? 64 : +size);\n\n function symbol() {\n let buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n","import { Transform } from 'vega-dataflow';\nimport { Marks, boundClip, GroupItem, Item, Bounds, multiLineOffset, boundStroke } from 'vega-scenegraph';\nimport { inherits, peek, isObject } from 'vega-util';\n\nconst Top = 'top';\nconst Left = 'left';\nconst Right = 'right';\nconst Bottom = 'bottom';\nconst TopLeft = 'top-left';\nconst TopRight = 'top-right';\nconst BottomLeft = 'bottom-left';\nconst BottomRight = 'bottom-right';\nconst Start = 'start';\nconst Middle = 'middle';\nconst End = 'end';\nconst X = 'x';\nconst Y = 'y';\nconst Group = 'group';\nconst AxisRole = 'axis';\nconst TitleRole = 'title';\nconst FrameRole = 'frame';\nconst ScopeRole = 'scope';\nconst LegendRole = 'legend';\nconst RowHeader = 'row-header';\nconst RowFooter = 'row-footer';\nconst RowTitle = 'row-title';\nconst ColHeader = 'column-header';\nconst ColFooter = 'column-footer';\nconst ColTitle = 'column-title';\nconst Padding = 'padding';\nconst Symbols = 'symbol';\nconst Fit = 'fit';\nconst FitX = 'fit-x';\nconst FitY = 'fit-y';\nconst Pad = 'pad';\nconst None = 'none';\nconst All = 'all';\nconst Each = 'each';\nconst Flush = 'flush';\nconst Column = 'column';\nconst Row = 'row';\n\n/**\n * Calculate bounding boxes for scenegraph items.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.mark - The scenegraph mark instance to bound.\n */\nfunction Bound(params) {\n Transform.call(this, null, params);\n}\ninherits(Bound, Transform, {\n transform(_, pulse) {\n const view = pulse.dataflow,\n mark = _.mark,\n type = mark.marktype,\n entry = Marks[type],\n bound = entry.bound;\n let markBounds = mark.bounds,\n rebound;\n if (entry.nested) {\n // multi-item marks have a single bounds instance\n if (mark.items.length) view.dirty(mark.items[0]);\n markBounds = boundItem(mark, bound);\n mark.items.forEach(item => {\n item.bounds.clear().union(markBounds);\n });\n } else if (type === Group || _.modified()) {\n // operator parameters modified -> re-bound all items\n // updates group bounds in response to modified group content\n pulse.visit(pulse.MOD, item => view.dirty(item));\n markBounds.clear();\n mark.items.forEach(item => markBounds.union(boundItem(item, bound)));\n\n // force reflow for axes/legends/titles to propagate any layout changes\n switch (mark.role) {\n case AxisRole:\n case LegendRole:\n case TitleRole:\n pulse.reflow();\n }\n } else {\n // incrementally update bounds, re-bound mark as needed\n rebound = pulse.changed(pulse.REM);\n pulse.visit(pulse.ADD, item => {\n markBounds.union(boundItem(item, bound));\n });\n pulse.visit(pulse.MOD, item => {\n rebound = rebound || markBounds.alignsWith(item.bounds);\n view.dirty(item);\n markBounds.union(boundItem(item, bound));\n });\n if (rebound) {\n markBounds.clear();\n mark.items.forEach(item => markBounds.union(item.bounds));\n }\n }\n\n // ensure mark bounds do not exceed any clipping region\n boundClip(mark);\n return pulse.modifies('bounds');\n }\n});\nfunction boundItem(item, bound, opt) {\n return bound(item.bounds.clear(), item, opt);\n}\n\nconst COUNTER_NAME = ':vega_identifier:';\n\n/**\n * Adds a unique identifier to all added tuples.\n * This transform creates a new signal that serves as an id counter.\n * As a result, the id counter is shared across all instances of this\n * transform, generating unique ids across multiple data streams. In\n * addition, this signal value can be included in a snapshot of the\n * dataflow state, enabling correct resumption of id allocation.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {string} params.as - The field name for the generated identifier.\n */\nfunction Identifier(params) {\n Transform.call(this, 0, params);\n}\nIdentifier.Definition = {\n 'type': 'Identifier',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'as',\n 'type': 'string',\n 'required': true\n }]\n};\ninherits(Identifier, Transform, {\n transform(_, pulse) {\n const counter = getCounter(pulse.dataflow),\n as = _.as;\n let id = counter.value;\n pulse.visit(pulse.ADD, t => t[as] = t[as] || ++id);\n counter.set(this.value = id);\n return pulse;\n }\n});\nfunction getCounter(view) {\n return view._signals[COUNTER_NAME] || (view._signals[COUNTER_NAME] = view.add(0));\n}\n\n/**\n * Bind scenegraph items to a scenegraph mark instance.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.markdef - The mark definition for creating the mark.\n * This is an object of legal scenegraph mark properties which *must* include\n * the 'marktype' property.\n */\nfunction Mark(params) {\n Transform.call(this, null, params);\n}\ninherits(Mark, Transform, {\n transform(_, pulse) {\n let mark = this.value;\n\n // acquire mark on first invocation, bind context and group\n if (!mark) {\n mark = pulse.dataflow.scenegraph().mark(_.markdef, lookup$1(_), _.index);\n mark.group.context = _.context;\n if (!_.context.group) _.context.group = mark.group;\n mark.source = this.source; // point to upstream collector\n mark.clip = _.clip;\n mark.interactive = _.interactive;\n this.value = mark;\n }\n\n // initialize entering items\n const Init = mark.marktype === Group ? GroupItem : Item;\n pulse.visit(pulse.ADD, item => Init.call(item, mark));\n\n // update clipping and/or interactive status\n if (_.modified('clip') || _.modified('interactive')) {\n mark.clip = _.clip;\n mark.interactive = !!_.interactive;\n mark.zdirty = true; // force scenegraph re-eval\n pulse.reflow();\n }\n\n // bind items array to scenegraph mark\n mark.items = pulse.source;\n return pulse;\n }\n});\nfunction lookup$1(_) {\n const g = _.groups,\n p = _.parent;\n return g && g.size === 1 ? g.get(Object.keys(g.object)[0]) : g && p ? g.lookup(p) : null;\n}\n\n/**\n * Analyze items for overlap, changing opacity to hide items with\n * overlapping bounding boxes. This transform will preserve at least\n * two items (e.g., first and last) even if overlap persists.\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - A comparator\n * function for sorting items.\n * @param {object} [params.method] - The overlap removal method to apply.\n * One of 'parity' (default, hide every other item until there is no\n * more overlap) or 'greedy' (sequentially scan and hide and items that\n * overlap with the last visible item).\n * @param {object} [params.boundScale] - A scale whose range should be used\n * to bound the items. Items exceeding the bounds of the scale range\n * will be treated as overlapping. If null or undefined, no bounds check\n * will be applied.\n * @param {object} [params.boundOrient] - The orientation of the scale\n * (top, bottom, left, or right) used to bound items. This parameter is\n * ignored if boundScale is null or undefined.\n * @param {object} [params.boundTolerance] - The tolerance in pixels for\n * bound inclusion testing (default 1). This specifies by how many pixels\n * an item's bounds may exceed the scale range bounds and not be culled.\n * @constructor\n */\nfunction Overlap(params) {\n Transform.call(this, null, params);\n}\nconst methods = {\n parity: items => items.filter((item, i) => i % 2 ? item.opacity = 0 : 1),\n greedy: (items, sep) => {\n let a;\n return items.filter((b, i) => !i || !intersect(a.bounds, b.bounds, sep) ? (a = b, 1) : b.opacity = 0);\n }\n};\n\n// compute bounding box intersection\n// including padding pixels of separation\nconst intersect = (a, b, sep) => sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);\nconst hasOverlap = (items, pad) => {\n for (var i = 1, n = items.length, a = items[0].bounds, b; i < n; a = b, ++i) {\n if (intersect(a, b = items[i].bounds, pad)) return true;\n }\n};\nconst hasBounds = item => {\n const b = item.bounds;\n return b.width() > 1 && b.height() > 1;\n};\nconst boundTest = (scale, orient, tolerance) => {\n var range = scale.range(),\n b = new Bounds();\n if (orient === Top || orient === Bottom) {\n b.set(range[0], -Infinity, range[1], +Infinity);\n } else {\n b.set(-Infinity, range[0], +Infinity, range[1]);\n }\n b.expand(tolerance || 1);\n return item => b.encloses(item.bounds);\n};\n\n// reset all items to be fully opaque\nconst reset = source => {\n source.forEach(item => item.opacity = 1);\n return source;\n};\n\n// add all tuples to mod, fork pulse if parameters were modified\n// fork prevents cross-stream tuple pollution (e.g., pulse from scale)\nconst reflow = (pulse, _) => pulse.reflow(_.modified()).modifies('opacity');\ninherits(Overlap, Transform, {\n transform(_, pulse) {\n const reduce = methods[_.method] || methods.parity,\n sep = _.separation || 0;\n let source = pulse.materialize(pulse.SOURCE).source,\n items,\n test;\n if (!source || !source.length) return;\n if (!_.method) {\n // early exit if method is falsy\n if (_.modified('method')) {\n reset(source);\n pulse = reflow(pulse, _);\n }\n return pulse;\n }\n\n // skip labels with no content\n source = source.filter(hasBounds);\n\n // early exit, nothing to do\n if (!source.length) return;\n if (_.sort) {\n source = source.slice().sort(_.sort);\n }\n items = reset(source);\n pulse = reflow(pulse, _);\n if (items.length >= 3 && hasOverlap(items, sep)) {\n do {\n items = reduce(items, sep);\n } while (items.length >= 3 && hasOverlap(items, sep));\n if (items.length < 3 && !peek(source).opacity) {\n if (items.length > 1) peek(items).opacity = 0;\n peek(source).opacity = 1;\n }\n }\n if (_.boundScale && _.boundTolerance >= 0) {\n test = boundTest(_.boundScale, _.boundOrient, +_.boundTolerance);\n source.forEach(item => {\n if (!test(item)) item.opacity = 0;\n });\n }\n\n // re-calculate mark bounds\n const bounds = items[0].mark.bounds.clear();\n source.forEach(item => {\n if (item.opacity) bounds.union(item.bounds);\n });\n return pulse;\n }\n});\n\n/**\n * Queue modified scenegraph items for rendering.\n * @constructor\n */\nfunction Render(params) {\n Transform.call(this, null, params);\n}\ninherits(Render, Transform, {\n transform(_, pulse) {\n const view = pulse.dataflow;\n pulse.visit(pulse.ALL, item => view.dirty(item));\n\n // set z-index dirty flag as needed\n if (pulse.fields && pulse.fields['zindex']) {\n const item = pulse.source && pulse.source[0];\n if (item) item.mark.zdirty = true;\n }\n }\n});\n\nconst tempBounds = new Bounds();\nfunction set(item, property, value) {\n return item[property] === value ? 0 : (item[property] = value, 1);\n}\n\nfunction isYAxis(mark) {\n var orient = mark.items[0].orient;\n return orient === Left || orient === Right;\n}\nfunction axisIndices(datum) {\n let index = +datum.grid;\n return [datum.ticks ? index++ : -1,\n // ticks index\n datum.labels ? index++ : -1,\n // labels index\n index + +datum.domain // title index\n ];\n}\nfunction axisLayout(view, axis, width, height) {\n var item = axis.items[0],\n datum = item.datum,\n delta = item.translate != null ? item.translate : 0.5,\n orient = item.orient,\n indices = axisIndices(datum),\n range = item.range,\n offset = item.offset,\n position = item.position,\n minExtent = item.minExtent,\n maxExtent = item.maxExtent,\n title = datum.title && item.items[indices[2]].items[0],\n titlePadding = item.titlePadding,\n bounds = item.bounds,\n dl = title && multiLineOffset(title),\n x = 0,\n y = 0,\n i,\n s;\n tempBounds.clear().union(bounds);\n bounds.clear();\n if ((i = indices[0]) > -1) bounds.union(item.items[i].bounds);\n if ((i = indices[1]) > -1) bounds.union(item.items[i].bounds);\n\n // position axis group and title\n switch (orient) {\n case Top:\n x = position || 0;\n y = -offset;\n s = Math.max(minExtent, Math.min(maxExtent, -bounds.y1));\n bounds.add(0, -s).add(range, 0);\n if (title) axisTitleLayout(view, title, s, titlePadding, dl, 0, -1, bounds);\n break;\n case Left:\n x = -offset;\n y = position || 0;\n s = Math.max(minExtent, Math.min(maxExtent, -bounds.x1));\n bounds.add(-s, 0).add(0, range);\n if (title) axisTitleLayout(view, title, s, titlePadding, dl, 1, -1, bounds);\n break;\n case Right:\n x = width + offset;\n y = position || 0;\n s = Math.max(minExtent, Math.min(maxExtent, bounds.x2));\n bounds.add(0, 0).add(s, range);\n if (title) axisTitleLayout(view, title, s, titlePadding, dl, 1, 1, bounds);\n break;\n case Bottom:\n x = position || 0;\n y = height + offset;\n s = Math.max(minExtent, Math.min(maxExtent, bounds.y2));\n bounds.add(0, 0).add(range, s);\n if (title) axisTitleLayout(view, title, s, titlePadding, 0, 0, 1, bounds);\n break;\n default:\n x = item.x;\n y = item.y;\n }\n\n // update bounds\n boundStroke(bounds.translate(x, y), item);\n if (set(item, 'x', x + delta) | set(item, 'y', y + delta)) {\n item.bounds = tempBounds;\n view.dirty(item);\n item.bounds = bounds;\n view.dirty(item);\n }\n return item.mark.bounds.clear().union(bounds);\n}\nfunction axisTitleLayout(view, title, offset, pad, dl, isYAxis, sign, bounds) {\n const b = title.bounds;\n if (title.auto) {\n const v = sign * (offset + dl + pad);\n let dx = 0,\n dy = 0;\n view.dirty(title);\n isYAxis ? dx = (title.x || 0) - (title.x = v) : dy = (title.y || 0) - (title.y = v);\n title.mark.bounds.clear().union(b.translate(-dx, -dy));\n view.dirty(title);\n }\n bounds.union(b);\n}\n\n// aggregation functions for grid margin determination\nconst min = (a, b) => Math.floor(Math.min(a, b));\nconst max = (a, b) => Math.ceil(Math.max(a, b));\nfunction gridLayoutGroups(group) {\n var groups = group.items,\n n = groups.length,\n i = 0,\n mark,\n items;\n const views = {\n marks: [],\n rowheaders: [],\n rowfooters: [],\n colheaders: [],\n colfooters: [],\n rowtitle: null,\n coltitle: null\n };\n\n // layout axes, gather legends, collect bounds\n for (; i < n; ++i) {\n mark = groups[i];\n items = mark.items;\n if (mark.marktype === Group) {\n switch (mark.role) {\n case AxisRole:\n case LegendRole:\n case TitleRole:\n break;\n case RowHeader:\n views.rowheaders.push(...items);\n break;\n case RowFooter:\n views.rowfooters.push(...items);\n break;\n case ColHeader:\n views.colheaders.push(...items);\n break;\n case ColFooter:\n views.colfooters.push(...items);\n break;\n case RowTitle:\n views.rowtitle = items[0];\n break;\n case ColTitle:\n views.coltitle = items[0];\n break;\n default:\n views.marks.push(...items);\n }\n }\n }\n return views;\n}\nfunction bboxFlush(item) {\n return new Bounds().set(0, 0, item.width || 0, item.height || 0);\n}\nfunction bboxFull(item) {\n const b = item.bounds.clone();\n return b.empty() ? b.set(0, 0, 0, 0) : b.translate(-(item.x || 0), -(item.y || 0));\n}\nfunction get(opt, key, d) {\n const v = isObject(opt) ? opt[key] : opt;\n return v != null ? v : d !== undefined ? d : 0;\n}\nfunction offsetValue(v) {\n return v < 0 ? Math.ceil(-v) : 0;\n}\nfunction gridLayout(view, groups, opt) {\n var dirty = !opt.nodirty,\n bbox = opt.bounds === Flush ? bboxFlush : bboxFull,\n bounds = tempBounds.set(0, 0, 0, 0),\n alignCol = get(opt.align, Column),\n alignRow = get(opt.align, Row),\n padCol = get(opt.padding, Column),\n padRow = get(opt.padding, Row),\n ncols = opt.columns || groups.length,\n nrows = ncols <= 0 ? 1 : Math.ceil(groups.length / ncols),\n n = groups.length,\n xOffset = Array(n),\n xExtent = Array(ncols),\n xMax = 0,\n yOffset = Array(n),\n yExtent = Array(nrows),\n yMax = 0,\n dx = Array(n),\n dy = Array(n),\n boxes = Array(n),\n m,\n i,\n c,\n r,\n b,\n g,\n px,\n py,\n x,\n y,\n offset;\n for (i = 0; i < ncols; ++i) xExtent[i] = 0;\n for (i = 0; i < nrows; ++i) yExtent[i] = 0;\n\n // determine offsets for each group\n for (i = 0; i < n; ++i) {\n g = groups[i];\n b = boxes[i] = bbox(g);\n g.x = g.x || 0;\n dx[i] = 0;\n g.y = g.y || 0;\n dy[i] = 0;\n c = i % ncols;\n r = ~~(i / ncols);\n xMax = Math.max(xMax, px = Math.ceil(b.x2));\n yMax = Math.max(yMax, py = Math.ceil(b.y2));\n xExtent[c] = Math.max(xExtent[c], px);\n yExtent[r] = Math.max(yExtent[r], py);\n xOffset[i] = padCol + offsetValue(b.x1);\n yOffset[i] = padRow + offsetValue(b.y1);\n if (dirty) view.dirty(groups[i]);\n }\n\n // set initial alignment offsets\n for (i = 0; i < n; ++i) {\n if (i % ncols === 0) xOffset[i] = 0;\n if (i < ncols) yOffset[i] = 0;\n }\n\n // enforce column alignment constraints\n if (alignCol === Each) {\n for (c = 1; c < ncols; ++c) {\n for (offset = 0, i = c; i < n; i += ncols) {\n if (offset < xOffset[i]) offset = xOffset[i];\n }\n for (i = c; i < n; i += ncols) {\n xOffset[i] = offset + xExtent[c - 1];\n }\n }\n } else if (alignCol === All) {\n for (offset = 0, i = 0; i < n; ++i) {\n if (i % ncols && offset < xOffset[i]) offset = xOffset[i];\n }\n for (i = 0; i < n; ++i) {\n if (i % ncols) xOffset[i] = offset + xMax;\n }\n } else {\n for (alignCol = false, c = 1; c < ncols; ++c) {\n for (i = c; i < n; i += ncols) {\n xOffset[i] += xExtent[c - 1];\n }\n }\n }\n\n // enforce row alignment constraints\n if (alignRow === Each) {\n for (r = 1; r < nrows; ++r) {\n for (offset = 0, i = r * ncols, m = i + ncols; i < m; ++i) {\n if (offset < yOffset[i]) offset = yOffset[i];\n }\n for (i = r * ncols; i < m; ++i) {\n yOffset[i] = offset + yExtent[r - 1];\n }\n }\n } else if (alignRow === All) {\n for (offset = 0, i = ncols; i < n; ++i) {\n if (offset < yOffset[i]) offset = yOffset[i];\n }\n for (i = ncols; i < n; ++i) {\n yOffset[i] = offset + yMax;\n }\n } else {\n for (alignRow = false, r = 1; r < nrows; ++r) {\n for (i = r * ncols, m = i + ncols; i < m; ++i) {\n yOffset[i] += yExtent[r - 1];\n }\n }\n }\n\n // perform horizontal grid layout\n for (x = 0, i = 0; i < n; ++i) {\n x = xOffset[i] + (i % ncols ? x : 0);\n dx[i] += x - groups[i].x;\n }\n\n // perform vertical grid layout\n for (c = 0; c < ncols; ++c) {\n for (y = 0, i = c; i < n; i += ncols) {\n y += yOffset[i];\n dy[i] += y - groups[i].y;\n }\n }\n\n // perform horizontal centering\n if (alignCol && get(opt.center, Column) && nrows > 1) {\n for (i = 0; i < n; ++i) {\n b = alignCol === All ? xMax : xExtent[i % ncols];\n x = b - boxes[i].x2 - groups[i].x - dx[i];\n if (x > 0) dx[i] += x / 2;\n }\n }\n\n // perform vertical centering\n if (alignRow && get(opt.center, Row) && ncols !== 1) {\n for (i = 0; i < n; ++i) {\n b = alignRow === All ? yMax : yExtent[~~(i / ncols)];\n y = b - boxes[i].y2 - groups[i].y - dy[i];\n if (y > 0) dy[i] += y / 2;\n }\n }\n\n // position grid relative to anchor\n for (i = 0; i < n; ++i) {\n bounds.union(boxes[i].translate(dx[i], dy[i]));\n }\n x = get(opt.anchor, X);\n y = get(opt.anchor, Y);\n switch (get(opt.anchor, Column)) {\n case End:\n x -= bounds.width();\n break;\n case Middle:\n x -= bounds.width() / 2;\n }\n switch (get(opt.anchor, Row)) {\n case End:\n y -= bounds.height();\n break;\n case Middle:\n y -= bounds.height() / 2;\n }\n x = Math.round(x);\n y = Math.round(y);\n\n // update mark positions, bounds, dirty\n bounds.clear();\n for (i = 0; i < n; ++i) {\n groups[i].mark.bounds.clear();\n }\n for (i = 0; i < n; ++i) {\n g = groups[i];\n g.x += dx[i] += x;\n g.y += dy[i] += y;\n bounds.union(g.mark.bounds.union(g.bounds.translate(dx[i], dy[i])));\n if (dirty) view.dirty(g);\n }\n return bounds;\n}\nfunction trellisLayout(view, group, opt) {\n var views = gridLayoutGroups(group),\n groups = views.marks,\n bbox = opt.bounds === Flush ? boundFlush : boundFull,\n off = opt.offset,\n ncols = opt.columns || groups.length,\n nrows = ncols <= 0 ? 1 : Math.ceil(groups.length / ncols),\n cells = nrows * ncols,\n x,\n y,\n x2,\n y2,\n anchor,\n band,\n offset;\n\n // -- initial grid layout\n const bounds = gridLayout(view, groups, opt);\n if (bounds.empty()) bounds.set(0, 0, 0, 0); // empty grid\n\n // -- layout grid headers and footers --\n\n // perform row header layout\n if (views.rowheaders) {\n band = get(opt.headerBand, Row, null);\n x = layoutHeaders(view, views.rowheaders, groups, ncols, nrows, -get(off, 'rowHeader'), min, 0, bbox, 'x1', 0, ncols, 1, band);\n }\n\n // perform column header layout\n if (views.colheaders) {\n band = get(opt.headerBand, Column, null);\n y = layoutHeaders(view, views.colheaders, groups, ncols, ncols, -get(off, 'columnHeader'), min, 1, bbox, 'y1', 0, 1, ncols, band);\n }\n\n // perform row footer layout\n if (views.rowfooters) {\n band = get(opt.footerBand, Row, null);\n x2 = layoutHeaders(view, views.rowfooters, groups, ncols, nrows, get(off, 'rowFooter'), max, 0, bbox, 'x2', ncols - 1, ncols, 1, band);\n }\n\n // perform column footer layout\n if (views.colfooters) {\n band = get(opt.footerBand, Column, null);\n y2 = layoutHeaders(view, views.colfooters, groups, ncols, ncols, get(off, 'columnFooter'), max, 1, bbox, 'y2', cells - ncols, 1, ncols, band);\n }\n\n // perform row title layout\n if (views.rowtitle) {\n anchor = get(opt.titleAnchor, Row);\n offset = get(off, 'rowTitle');\n offset = anchor === End ? x2 + offset : x - offset;\n band = get(opt.titleBand, Row, 0.5);\n layoutTitle(view, views.rowtitle, offset, 0, bounds, band);\n }\n\n // perform column title layout\n if (views.coltitle) {\n anchor = get(opt.titleAnchor, Column);\n offset = get(off, 'columnTitle');\n offset = anchor === End ? y2 + offset : y - offset;\n band = get(opt.titleBand, Column, 0.5);\n layoutTitle(view, views.coltitle, offset, 1, bounds, band);\n }\n}\nfunction boundFlush(item, field) {\n return field === 'x1' ? item.x || 0 : field === 'y1' ? item.y || 0 : field === 'x2' ? (item.x || 0) + (item.width || 0) : field === 'y2' ? (item.y || 0) + (item.height || 0) : undefined;\n}\nfunction boundFull(item, field) {\n return item.bounds[field];\n}\nfunction layoutHeaders(view, headers, groups, ncols, limit, offset, agg, isX, bound, bf, start, stride, back, band) {\n var n = groups.length,\n init = 0,\n edge = 0,\n i,\n j,\n k,\n m,\n b,\n h,\n g,\n x,\n y;\n\n // if no groups, early exit and return 0\n if (!n) return init;\n\n // compute margin\n for (i = start; i < n; i += stride) {\n if (groups[i]) init = agg(init, bound(groups[i], bf));\n }\n\n // if no headers, return margin calculation\n if (!headers.length) return init;\n\n // check if number of headers exceeds number of rows or columns\n if (headers.length > limit) {\n view.warn('Grid headers exceed limit: ' + limit);\n headers = headers.slice(0, limit);\n }\n\n // apply offset\n init += offset;\n\n // clear mark bounds for all headers\n for (j = 0, m = headers.length; j < m; ++j) {\n view.dirty(headers[j]);\n headers[j].mark.bounds.clear();\n }\n\n // layout each header\n for (i = start, j = 0, m = headers.length; j < m; ++j, i += stride) {\n h = headers[j];\n b = h.mark.bounds;\n\n // search for nearest group to align to\n // necessary if table has empty cells\n for (k = i; k >= 0 && (g = groups[k]) == null; k -= back);\n\n // assign coordinates and update bounds\n if (isX) {\n x = band == null ? g.x : Math.round(g.bounds.x1 + band * g.bounds.width());\n y = init;\n } else {\n x = init;\n y = band == null ? g.y : Math.round(g.bounds.y1 + band * g.bounds.height());\n }\n b.union(h.bounds.translate(x - (h.x || 0), y - (h.y || 0)));\n h.x = x;\n h.y = y;\n view.dirty(h);\n\n // update current edge of layout bounds\n edge = agg(edge, b[bf]);\n }\n return edge;\n}\nfunction layoutTitle(view, g, offset, isX, bounds, band) {\n if (!g) return;\n view.dirty(g);\n\n // compute title coordinates\n var x = offset,\n y = offset;\n isX ? x = Math.round(bounds.x1 + band * bounds.width()) : y = Math.round(bounds.y1 + band * bounds.height());\n\n // assign coordinates and update bounds\n g.bounds.translate(x - (g.x || 0), y - (g.y || 0));\n g.mark.bounds.clear().union(g.bounds);\n g.x = x;\n g.y = y;\n\n // queue title for redraw\n view.dirty(g);\n}\n\n// utility for looking up legend layout configuration\nfunction lookup(config, orient) {\n const opt = config[orient] || {};\n return (key, d) => opt[key] != null ? opt[key] : config[key] != null ? config[key] : d;\n}\n\n// if legends specify offset directly, use the maximum specified value\nfunction offsets(legends, value) {\n let max = -Infinity;\n legends.forEach(item => {\n if (item.offset != null) max = Math.max(max, item.offset);\n });\n return max > -Infinity ? max : value;\n}\nfunction legendParams(g, orient, config, xb, yb, w, h) {\n const _ = lookup(config, orient),\n offset = offsets(g, _('offset', 0)),\n anchor = _('anchor', Start),\n mult = anchor === End ? 1 : anchor === Middle ? 0.5 : 0;\n const p = {\n align: Each,\n bounds: _('bounds', Flush),\n columns: _('direction') === 'vertical' ? 1 : g.length,\n padding: _('margin', 8),\n center: _('center'),\n nodirty: true\n };\n switch (orient) {\n case Left:\n p.anchor = {\n x: Math.floor(xb.x1) - offset,\n column: End,\n y: mult * (h || xb.height() + 2 * xb.y1),\n row: anchor\n };\n break;\n case Right:\n p.anchor = {\n x: Math.ceil(xb.x2) + offset,\n y: mult * (h || xb.height() + 2 * xb.y1),\n row: anchor\n };\n break;\n case Top:\n p.anchor = {\n y: Math.floor(yb.y1) - offset,\n row: End,\n x: mult * (w || yb.width() + 2 * yb.x1),\n column: anchor\n };\n break;\n case Bottom:\n p.anchor = {\n y: Math.ceil(yb.y2) + offset,\n x: mult * (w || yb.width() + 2 * yb.x1),\n column: anchor\n };\n break;\n case TopLeft:\n p.anchor = {\n x: offset,\n y: offset\n };\n break;\n case TopRight:\n p.anchor = {\n x: w - offset,\n y: offset,\n column: End\n };\n break;\n case BottomLeft:\n p.anchor = {\n x: offset,\n y: h - offset,\n row: End\n };\n break;\n case BottomRight:\n p.anchor = {\n x: w - offset,\n y: h - offset,\n column: End,\n row: End\n };\n break;\n }\n return p;\n}\nfunction legendLayout(view, legend) {\n var item = legend.items[0],\n datum = item.datum,\n orient = item.orient,\n bounds = item.bounds,\n x = item.x,\n y = item.y,\n w,\n h;\n\n // cache current bounds for later comparison\n item._bounds ? item._bounds.clear().union(bounds) : item._bounds = bounds.clone();\n bounds.clear();\n\n // adjust legend to accommodate padding and title\n legendGroupLayout(view, item, item.items[0].items[0]);\n\n // aggregate bounds to determine size, and include origin\n bounds = legendBounds(item, bounds);\n w = 2 * item.padding;\n h = 2 * item.padding;\n if (!bounds.empty()) {\n w = Math.ceil(bounds.width() + w);\n h = Math.ceil(bounds.height() + h);\n }\n if (datum.type === Symbols) {\n legendEntryLayout(item.items[0].items[0].items[0].items);\n }\n if (orient !== None) {\n item.x = x = 0;\n item.y = y = 0;\n }\n item.width = w;\n item.height = h;\n boundStroke(bounds.set(x, y, x + w, y + h), item);\n item.mark.bounds.clear().union(bounds);\n return item;\n}\nfunction legendBounds(item, b) {\n // aggregate item bounds\n item.items.forEach(_ => b.union(_.bounds));\n\n // anchor to legend origin\n b.x1 = item.padding;\n b.y1 = item.padding;\n return b;\n}\nfunction legendGroupLayout(view, item, entry) {\n var pad = item.padding,\n ex = pad - entry.x,\n ey = pad - entry.y;\n if (!item.datum.title) {\n if (ex || ey) translate(view, entry, ex, ey);\n } else {\n var title = item.items[1].items[0],\n anchor = title.anchor,\n tpad = item.titlePadding || 0,\n tx = pad - title.x,\n ty = pad - title.y;\n switch (title.orient) {\n case Left:\n ex += Math.ceil(title.bounds.width()) + tpad;\n break;\n case Right:\n case Bottom:\n break;\n default:\n ey += title.bounds.height() + tpad;\n }\n if (ex || ey) translate(view, entry, ex, ey);\n switch (title.orient) {\n case Left:\n ty += legendTitleOffset(item, entry, title, anchor, 1, 1);\n break;\n case Right:\n tx += legendTitleOffset(item, entry, title, End, 0, 0) + tpad;\n ty += legendTitleOffset(item, entry, title, anchor, 1, 1);\n break;\n case Bottom:\n tx += legendTitleOffset(item, entry, title, anchor, 0, 0);\n ty += legendTitleOffset(item, entry, title, End, -1, 0, 1) + tpad;\n break;\n default:\n tx += legendTitleOffset(item, entry, title, anchor, 0, 0);\n }\n if (tx || ty) translate(view, title, tx, ty);\n\n // translate legend if title pushes into negative coordinates\n if ((tx = Math.round(title.bounds.x1 - pad)) < 0) {\n translate(view, entry, -tx, 0);\n translate(view, title, -tx, 0);\n }\n }\n}\nfunction legendTitleOffset(item, entry, title, anchor, y, lr, noBar) {\n const grad = item.datum.type !== 'symbol',\n vgrad = title.datum.vgrad,\n e = grad && (lr || !vgrad) && !noBar ? entry.items[0] : entry,\n s = e.bounds[y ? 'y2' : 'x2'] - item.padding,\n u = vgrad && lr ? s : 0,\n v = vgrad && lr ? 0 : s,\n o = y <= 0 ? 0 : multiLineOffset(title);\n return Math.round(anchor === Start ? u : anchor === End ? v - o : 0.5 * (s - o));\n}\nfunction translate(view, item, dx, dy) {\n item.x += dx;\n item.y += dy;\n item.bounds.translate(dx, dy);\n item.mark.bounds.translate(dx, dy);\n view.dirty(item);\n}\nfunction legendEntryLayout(entries) {\n // get max widths for each column\n const widths = entries.reduce((w, g) => {\n w[g.column] = Math.max(g.bounds.x2 - g.x, w[g.column] || 0);\n return w;\n }, {});\n\n // set dimensions of legend entry groups\n entries.forEach(g => {\n g.width = widths[g.column];\n g.height = g.bounds.y2 - g.y;\n });\n}\n\nfunction titleLayout(view, mark, width, height, viewBounds) {\n var group = mark.items[0],\n frame = group.frame,\n orient = group.orient,\n anchor = group.anchor,\n offset = group.offset,\n padding = group.padding,\n title = group.items[0].items[0],\n subtitle = group.items[1] && group.items[1].items[0],\n end = orient === Left || orient === Right ? height : width,\n start = 0,\n x = 0,\n y = 0,\n sx = 0,\n sy = 0,\n pos;\n if (frame !== Group) {\n orient === Left ? (start = viewBounds.y2, end = viewBounds.y1) : orient === Right ? (start = viewBounds.y1, end = viewBounds.y2) : (start = viewBounds.x1, end = viewBounds.x2);\n } else if (orient === Left) {\n start = height, end = 0;\n }\n pos = anchor === Start ? start : anchor === End ? end : (start + end) / 2;\n if (subtitle && subtitle.text) {\n // position subtitle\n switch (orient) {\n case Top:\n case Bottom:\n sy = title.bounds.height() + padding;\n break;\n case Left:\n sx = title.bounds.width() + padding;\n break;\n case Right:\n sx = -title.bounds.width() - padding;\n break;\n }\n tempBounds.clear().union(subtitle.bounds);\n tempBounds.translate(sx - (subtitle.x || 0), sy - (subtitle.y || 0));\n if (set(subtitle, 'x', sx) | set(subtitle, 'y', sy)) {\n view.dirty(subtitle);\n subtitle.bounds.clear().union(tempBounds);\n subtitle.mark.bounds.clear().union(tempBounds);\n view.dirty(subtitle);\n }\n tempBounds.clear().union(subtitle.bounds);\n } else {\n tempBounds.clear();\n }\n tempBounds.union(title.bounds);\n\n // position title group\n switch (orient) {\n case Top:\n x = pos;\n y = viewBounds.y1 - tempBounds.height() - offset;\n break;\n case Left:\n x = viewBounds.x1 - tempBounds.width() - offset;\n y = pos;\n break;\n case Right:\n x = viewBounds.x2 + tempBounds.width() + offset;\n y = pos;\n break;\n case Bottom:\n x = pos;\n y = viewBounds.y2 + offset;\n break;\n default:\n x = group.x;\n y = group.y;\n }\n if (set(group, 'x', x) | set(group, 'y', y)) {\n tempBounds.translate(x, y);\n view.dirty(group);\n group.bounds.clear().union(tempBounds);\n mark.bounds.clear().union(tempBounds);\n view.dirty(group);\n }\n return group.bounds;\n}\n\n/**\n * Layout view elements such as axes and legends.\n * Also performs size adjustments.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.mark - Scenegraph mark of groups to layout.\n */\nfunction ViewLayout(params) {\n Transform.call(this, null, params);\n}\ninherits(ViewLayout, Transform, {\n transform(_, pulse) {\n const view = pulse.dataflow;\n _.mark.items.forEach(group => {\n if (_.layout) trellisLayout(view, group, _.layout);\n layoutGroup(view, group, _);\n });\n return shouldReflow(_.mark.group) ? pulse.reflow() : pulse;\n }\n});\nfunction shouldReflow(group) {\n // We typically should reflow if layout is invoked (#2568), as child items\n // may have resized and reflow ensures group bounds are re-calculated.\n // However, legend entries have a special exception to avoid instability.\n // For example, if a selected legend symbol gains a stroke on hover,\n // we don't want to re-position subsequent elements in the legend.\n return group && group.mark.role !== 'legend-entry';\n}\nfunction layoutGroup(view, group, _) {\n var items = group.items,\n width = Math.max(0, group.width || 0),\n height = Math.max(0, group.height || 0),\n viewBounds = new Bounds().set(0, 0, width, height),\n xBounds = viewBounds.clone(),\n yBounds = viewBounds.clone(),\n legends = [],\n title,\n mark,\n orient,\n b,\n i,\n n;\n\n // layout axes, gather legends, collect bounds\n for (i = 0, n = items.length; i < n; ++i) {\n mark = items[i];\n switch (mark.role) {\n case AxisRole:\n b = isYAxis(mark) ? xBounds : yBounds;\n b.union(axisLayout(view, mark, width, height));\n break;\n case TitleRole:\n title = mark;\n break;\n case LegendRole:\n legends.push(legendLayout(view, mark));\n break;\n case FrameRole:\n case ScopeRole:\n case RowHeader:\n case RowFooter:\n case RowTitle:\n case ColHeader:\n case ColFooter:\n case ColTitle:\n xBounds.union(mark.bounds);\n yBounds.union(mark.bounds);\n break;\n default:\n viewBounds.union(mark.bounds);\n }\n }\n\n // layout legends, adjust viewBounds\n if (legends.length) {\n // group legends by orient\n const l = {};\n legends.forEach(item => {\n orient = item.orient || Right;\n if (orient !== None) (l[orient] || (l[orient] = [])).push(item);\n });\n\n // perform grid layout for each orient group\n for (const orient in l) {\n const g = l[orient];\n gridLayout(view, g, legendParams(g, orient, _.legends, xBounds, yBounds, width, height));\n }\n\n // update view bounds\n legends.forEach(item => {\n const b = item.bounds;\n if (!b.equals(item._bounds)) {\n item.bounds = item._bounds;\n view.dirty(item); // dirty previous location\n item.bounds = b;\n view.dirty(item);\n }\n if (_.autosize && (_.autosize.type === Fit || _.autosize.type === FitX || _.autosize.type === FitY)) {\n // For autosize fit, incorporate the orthogonal dimension only.\n // Legends that overrun the chart area will then be clipped;\n // otherwise the chart area gets reduced to nothing!\n switch (item.orient) {\n case Left:\n case Right:\n viewBounds.add(b.x1, 0).add(b.x2, 0);\n break;\n case Top:\n case Bottom:\n viewBounds.add(0, b.y1).add(0, b.y2);\n }\n } else {\n viewBounds.union(b);\n }\n });\n }\n\n // combine bounding boxes\n viewBounds.union(xBounds).union(yBounds);\n\n // layout title, adjust bounds\n if (title) {\n viewBounds.union(titleLayout(view, title, width, height, viewBounds));\n }\n\n // override aggregated view bounds if content is clipped\n if (group.clip) {\n viewBounds.set(0, 0, group.width || 0, group.height || 0);\n }\n\n // perform size adjustment\n viewSizeLayout(view, group, viewBounds, _);\n}\nfunction viewSizeLayout(view, group, viewBounds, _) {\n const auto = _.autosize || {},\n type = auto.type;\n if (view._autosize < 1 || !type) return;\n let viewWidth = view._width,\n viewHeight = view._height,\n width = Math.max(0, group.width || 0),\n left = Math.max(0, Math.ceil(-viewBounds.x1)),\n height = Math.max(0, group.height || 0),\n top = Math.max(0, Math.ceil(-viewBounds.y1));\n const right = Math.max(0, Math.ceil(viewBounds.x2 - width)),\n bottom = Math.max(0, Math.ceil(viewBounds.y2 - height));\n if (auto.contains === Padding) {\n const padding = view.padding();\n viewWidth -= padding.left + padding.right;\n viewHeight -= padding.top + padding.bottom;\n }\n if (type === None) {\n left = 0;\n top = 0;\n width = viewWidth;\n height = viewHeight;\n } else if (type === Fit) {\n width = Math.max(0, viewWidth - left - right);\n height = Math.max(0, viewHeight - top - bottom);\n } else if (type === FitX) {\n width = Math.max(0, viewWidth - left - right);\n viewHeight = height + top + bottom;\n } else if (type === FitY) {\n viewWidth = width + left + right;\n height = Math.max(0, viewHeight - top - bottom);\n } else if (type === Pad) {\n viewWidth = width + left + right;\n viewHeight = height + top + bottom;\n }\n view._resizeView(viewWidth, viewHeight, width, height, [left, top], auto.resize);\n}\n\nexport { Bound as bound, Identifier as identifier, Mark as mark, Overlap as overlap, Render as render, ViewLayout as viewlayout };\n","export default function sum(values, valueof) {\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n sum += value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n sum += value;\n }\n }\n }\n return sum;\n}\n","import { Transform, ingest, tupleid, stableCompare } from 'vega-dataflow';\nimport { tickCount, tickFormat, validTicks, tickValues, SymbolLegend, labelFormat, labelValues, GradientLegend, scaleFraction, labelFraction, scale, Sequential, Linear, isContinuous, Time, UTC, Ordinal, scaleImplicit, Log, Sqrt, Pow, Symlog, isLogarithmic, BinOrdinal, isInterpolating, interpolateColors, interpolate, Band, Point, bandSpace, scheme, Threshold, Quantile, Quantize, quantizeInterpolator, interpolateRange, Diverging } from 'vega-scale';\nimport { inherits, isArray, error, fastmap, falsy, isFunction, constant, peek, one, toSet, isString, zoomLog, zoomPow, zoomSymlog, zoomLinear, stringValue } from 'vega-util';\nimport { sum, range } from 'd3-array';\nimport { interpolateRound, interpolate as interpolate$1 } from 'd3-interpolate';\n\n/**\n * Generates axis ticks for visualizing a spatial scale.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Scale} params.scale - The scale to generate ticks for.\n * @param {*} [params.count=10] - The approximate number of ticks, or\n * desired tick interval, to use.\n * @param {Array<*>} [params.values] - The exact tick values to use.\n * These must be legal domain values for the provided scale.\n * If provided, the count argument is ignored.\n * @param {function(*):string} [params.formatSpecifier] - A format specifier\n * to use in conjunction with scale.tickFormat. Legal values are\n * any valid d3 4.0 format specifier.\n * @param {function(*):string} [params.format] - The format function to use.\n * If provided, the formatSpecifier argument is ignored.\n */\nfunction AxisTicks(params) {\n Transform.call(this, null, params);\n}\ninherits(AxisTicks, Transform, {\n transform(_, pulse) {\n if (this.value && !_.modified()) {\n return pulse.StopPropagation;\n }\n var locale = pulse.dataflow.locale(),\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n ticks = this.value,\n scale = _.scale,\n tally = _.count == null ? _.values ? _.values.length : 10 : _.count,\n count = tickCount(scale, tally, _.minstep),\n format = _.format || tickFormat(locale, scale, count, _.formatSpecifier, _.formatType, !!_.values),\n values = _.values ? validTicks(scale, _.values, count) : tickValues(scale, count);\n if (ticks) out.rem = ticks;\n ticks = values.map((value, i) => ingest({\n index: i / (values.length - 1 || 1),\n value: value,\n label: format(value)\n }));\n if (_.extra && ticks.length) {\n // add an extra tick pegged to the initial domain value\n // this is used to generate axes with 'binned' domains\n ticks.push(ingest({\n index: -1,\n extra: {\n value: ticks[0].value\n },\n label: ''\n }));\n }\n out.source = ticks;\n out.add = ticks;\n this.value = ticks;\n return out;\n }\n});\n\n/**\n * Joins a set of data elements against a set of visual items.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): object} [params.item] - An item generator function.\n * @param {function(object): *} [params.key] - The key field associating data and visual items.\n */\nfunction DataJoin(params) {\n Transform.call(this, null, params);\n}\nfunction defaultItemCreate() {\n return ingest({});\n}\nfunction newMap(key) {\n const map = fastmap().test(t => t.exit);\n map.lookup = t => map.get(key(t));\n return map;\n}\ninherits(DataJoin, Transform, {\n transform(_, pulse) {\n var df = pulse.dataflow,\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n item = _.item || defaultItemCreate,\n key = _.key || tupleid,\n map = this.value;\n\n // prevent transient (e.g., hover) requests from\n // cascading across marks derived from marks\n if (isArray(out.encode)) {\n out.encode = null;\n }\n if (map && (_.modified('key') || pulse.modified(key))) {\n error('DataJoin does not support modified key function or fields.');\n }\n if (!map) {\n pulse = pulse.addAll();\n this.value = map = newMap(key);\n }\n pulse.visit(pulse.ADD, t => {\n const k = key(t);\n let x = map.get(k);\n if (x) {\n if (x.exit) {\n map.empty--;\n out.add.push(x);\n } else {\n out.mod.push(x);\n }\n } else {\n x = item(t);\n map.set(k, x);\n out.add.push(x);\n }\n x.datum = t;\n x.exit = false;\n });\n pulse.visit(pulse.MOD, t => {\n const k = key(t),\n x = map.get(k);\n if (x) {\n x.datum = t;\n out.mod.push(x);\n }\n });\n pulse.visit(pulse.REM, t => {\n const k = key(t),\n x = map.get(k);\n if (t === x.datum && !x.exit) {\n out.rem.push(x);\n x.exit = true;\n ++map.empty;\n }\n });\n if (pulse.changed(pulse.ADD_MOD)) out.modifies('datum');\n if (pulse.clean() || _.clean && map.empty > df.cleanThreshold) {\n df.runAfter(map.clean);\n }\n return out;\n }\n});\n\n/**\n * Invokes encoding functions for visual items.\n * @constructor\n * @param {object} params - The parameters to the encoding functions. This\n * parameter object will be passed through to all invoked encoding functions.\n * @param {object} [params.mod=false] - Flag indicating if tuples in the input\n * mod set that are unmodified by encoders should be included in the output.\n * @param {object} param.encoders - The encoding functions\n * @param {function(object, object): boolean} [param.encoders.update] - Update encoding set\n * @param {function(object, object): boolean} [param.encoders.enter] - Enter encoding set\n * @param {function(object, object): boolean} [param.encoders.exit] - Exit encoding set\n */\nfunction Encode(params) {\n Transform.call(this, null, params);\n}\ninherits(Encode, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ADD_REM),\n fmod = _.mod || false,\n encoders = _.encoders,\n encode = pulse.encode;\n\n // if an array, the encode directive includes additional sets\n // that must be defined in order for the primary set to be invoked\n // e.g., only run the update set if the hover set is defined\n if (isArray(encode)) {\n if (out.changed() || encode.every(e => encoders[e])) {\n encode = encode[0];\n out.encode = null; // consume targeted encode directive\n } else {\n return pulse.StopPropagation;\n }\n }\n\n // marshall encoder functions\n var reenter = encode === 'enter',\n update = encoders.update || falsy,\n enter = encoders.enter || falsy,\n exit = encoders.exit || falsy,\n set = (encode && !reenter ? encoders[encode] : update) || falsy;\n if (pulse.changed(pulse.ADD)) {\n pulse.visit(pulse.ADD, t => {\n enter(t, _);\n update(t, _);\n });\n out.modifies(enter.output);\n out.modifies(update.output);\n if (set !== falsy && set !== update) {\n pulse.visit(pulse.ADD, t => {\n set(t, _);\n });\n out.modifies(set.output);\n }\n }\n if (pulse.changed(pulse.REM) && exit !== falsy) {\n pulse.visit(pulse.REM, t => {\n exit(t, _);\n });\n out.modifies(exit.output);\n }\n if (reenter || set !== falsy) {\n const flag = pulse.MOD | (_.modified() ? pulse.REFLOW : 0);\n if (reenter) {\n pulse.visit(flag, t => {\n const mod = enter(t, _) || fmod;\n if (set(t, _) || mod) out.mod.push(t);\n });\n if (out.mod.length) out.modifies(enter.output);\n } else {\n pulse.visit(flag, t => {\n if (set(t, _) || fmod) out.mod.push(t);\n });\n }\n if (out.mod.length) out.modifies(set.output);\n }\n return out.changed() ? out : pulse.StopPropagation;\n }\n});\n\n/**\n * Generates legend entries for visualizing a scale.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Scale} params.scale - The scale to generate items for.\n * @param {*} [params.count=5] - The approximate number of items, or\n * desired tick interval, to use.\n * @param {*} [params.limit] - The maximum number of entries to\n * include in a symbol legend.\n * @param {Array<*>} [params.values] - The exact tick values to use.\n * These must be legal domain values for the provided scale.\n * If provided, the count argument is ignored.\n * @param {string} [params.formatSpecifier] - A format specifier\n * to use in conjunction with scale.tickFormat. Legal values are\n * any valid D3 format specifier string.\n * @param {function(*):string} [params.format] - The format function to use.\n * If provided, the formatSpecifier argument is ignored.\n */\nfunction LegendEntries(params) {\n Transform.call(this, [], params);\n}\ninherits(LegendEntries, Transform, {\n transform(_, pulse) {\n if (this.value != null && !_.modified()) {\n return pulse.StopPropagation;\n }\n var locale = pulse.dataflow.locale(),\n out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n items = this.value,\n type = _.type || SymbolLegend,\n scale = _.scale,\n limit = +_.limit,\n count = tickCount(scale, _.count == null ? 5 : _.count, _.minstep),\n lskip = !!_.values || type === SymbolLegend,\n format = _.format || labelFormat(locale, scale, count, type, _.formatSpecifier, _.formatType, lskip),\n values = _.values || labelValues(scale, count),\n domain,\n fraction,\n size,\n offset,\n ellipsis;\n if (items) out.rem = items;\n if (type === SymbolLegend) {\n if (limit && values.length > limit) {\n pulse.dataflow.warn('Symbol legend count exceeds limit, filtering items.');\n items = values.slice(0, limit - 1);\n ellipsis = true;\n } else {\n items = values;\n }\n if (isFunction(size = _.size)) {\n // if first value maps to size zero, remove from list (vega#717)\n if (!_.values && scale(items[0]) === 0) {\n items = items.slice(1);\n }\n // compute size offset for legend entries\n offset = items.reduce((max, value) => Math.max(max, size(value, _)), 0);\n } else {\n size = constant(offset = size || 8);\n }\n items = items.map((value, index) => ingest({\n index: index,\n label: format(value, index, items),\n value: value,\n offset: offset,\n size: size(value, _)\n }));\n if (ellipsis) {\n ellipsis = values[items.length];\n items.push(ingest({\n index: items.length,\n label: `\\u2026${values.length - items.length} entries`,\n value: ellipsis,\n offset: offset,\n size: size(ellipsis, _)\n }));\n }\n } else if (type === GradientLegend) {\n domain = scale.domain(), fraction = scaleFraction(scale, domain[0], peek(domain));\n\n // if automatic label generation produces 2 or fewer values,\n // use the domain end points instead (fixes vega/vega#1364)\n if (values.length < 3 && !_.values && domain[0] !== peek(domain)) {\n values = [domain[0], peek(domain)];\n }\n items = values.map((value, index) => ingest({\n index: index,\n label: format(value, index, values),\n value: value,\n perc: fraction(value)\n }));\n } else {\n size = values.length - 1;\n fraction = labelFraction(scale);\n items = values.map((value, index) => ingest({\n index: index,\n label: format(value, index, values),\n value: value,\n perc: index ? fraction(value) : 0,\n perc2: index === size ? 1 : fraction(values[index + 1])\n }));\n }\n out.source = items;\n out.add = items;\n this.value = items;\n return out;\n }\n});\n\nconst sourceX = t => t.source.x;\nconst sourceY = t => t.source.y;\nconst targetX = t => t.target.x;\nconst targetY = t => t.target.y;\n\n/**\n * Layout paths linking source and target elements.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction LinkPath(params) {\n Transform.call(this, {}, params);\n}\nLinkPath.Definition = {\n 'type': 'LinkPath',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'sourceX',\n 'type': 'field',\n 'default': 'source.x'\n }, {\n 'name': 'sourceY',\n 'type': 'field',\n 'default': 'source.y'\n }, {\n 'name': 'targetX',\n 'type': 'field',\n 'default': 'target.x'\n }, {\n 'name': 'targetY',\n 'type': 'field',\n 'default': 'target.y'\n }, {\n 'name': 'orient',\n 'type': 'enum',\n 'default': 'vertical',\n 'values': ['horizontal', 'vertical', 'radial']\n }, {\n 'name': 'shape',\n 'type': 'enum',\n 'default': 'line',\n 'values': ['line', 'arc', 'curve', 'diagonal', 'orthogonal']\n }, {\n 'name': 'require',\n 'type': 'signal'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'path'\n }]\n};\ninherits(LinkPath, Transform, {\n transform(_, pulse) {\n var sx = _.sourceX || sourceX,\n sy = _.sourceY || sourceY,\n tx = _.targetX || targetX,\n ty = _.targetY || targetY,\n as = _.as || 'path',\n orient = _.orient || 'vertical',\n shape = _.shape || 'line',\n path = Paths.get(shape + '-' + orient) || Paths.get(shape);\n if (!path) {\n error('LinkPath unsupported type: ' + _.shape + (_.orient ? '-' + _.orient : ''));\n }\n pulse.visit(pulse.SOURCE, t => {\n t[as] = path(sx(t), sy(t), tx(t), ty(t));\n });\n return pulse.reflow(_.modified()).modifies(as);\n }\n});\nconst line = (sx, sy, tx, ty) => 'M' + sx + ',' + sy + 'L' + tx + ',' + ty;\nconst lineR = (sa, sr, ta, tr) => line(sr * Math.cos(sa), sr * Math.sin(sa), tr * Math.cos(ta), tr * Math.sin(ta));\nconst arc = (sx, sy, tx, ty) => {\n var dx = tx - sx,\n dy = ty - sy,\n rr = Math.hypot(dx, dy) / 2,\n ra = 180 * Math.atan2(dy, dx) / Math.PI;\n return 'M' + sx + ',' + sy + 'A' + rr + ',' + rr + ' ' + ra + ' 0 1' + ' ' + tx + ',' + ty;\n};\nconst arcR = (sa, sr, ta, tr) => arc(sr * Math.cos(sa), sr * Math.sin(sa), tr * Math.cos(ta), tr * Math.sin(ta));\nconst curve = (sx, sy, tx, ty) => {\n const dx = tx - sx,\n dy = ty - sy,\n ix = 0.2 * (dx + dy),\n iy = 0.2 * (dy - dx);\n return 'M' + sx + ',' + sy + 'C' + (sx + ix) + ',' + (sy + iy) + ' ' + (tx + iy) + ',' + (ty - ix) + ' ' + tx + ',' + ty;\n};\nconst curveR = (sa, sr, ta, tr) => curve(sr * Math.cos(sa), sr * Math.sin(sa), tr * Math.cos(ta), tr * Math.sin(ta));\nconst orthoX = (sx, sy, tx, ty) => 'M' + sx + ',' + sy + 'V' + ty + 'H' + tx;\nconst orthoY = (sx, sy, tx, ty) => 'M' + sx + ',' + sy + 'H' + tx + 'V' + ty;\nconst orthoR = (sa, sr, ta, tr) => {\n const sc = Math.cos(sa),\n ss = Math.sin(sa),\n tc = Math.cos(ta),\n ts = Math.sin(ta),\n sf = Math.abs(ta - sa) > Math.PI ? ta <= sa : ta > sa;\n return 'M' + sr * sc + ',' + sr * ss + 'A' + sr + ',' + sr + ' 0 0,' + (sf ? 1 : 0) + ' ' + sr * tc + ',' + sr * ts + 'L' + tr * tc + ',' + tr * ts;\n};\nconst diagonalX = (sx, sy, tx, ty) => {\n const m = (sx + tx) / 2;\n return 'M' + sx + ',' + sy + 'C' + m + ',' + sy + ' ' + m + ',' + ty + ' ' + tx + ',' + ty;\n};\nconst diagonalY = (sx, sy, tx, ty) => {\n const m = (sy + ty) / 2;\n return 'M' + sx + ',' + sy + 'C' + sx + ',' + m + ' ' + tx + ',' + m + ' ' + tx + ',' + ty;\n};\nconst diagonalR = (sa, sr, ta, tr) => {\n const sc = Math.cos(sa),\n ss = Math.sin(sa),\n tc = Math.cos(ta),\n ts = Math.sin(ta),\n mr = (sr + tr) / 2;\n return 'M' + sr * sc + ',' + sr * ss + 'C' + mr * sc + ',' + mr * ss + ' ' + mr * tc + ',' + mr * ts + ' ' + tr * tc + ',' + tr * ts;\n};\nconst Paths = fastmap({\n 'line': line,\n 'line-radial': lineR,\n 'arc': arc,\n 'arc-radial': arcR,\n 'curve': curve,\n 'curve-radial': curveR,\n 'orthogonal-horizontal': orthoX,\n 'orthogonal-vertical': orthoY,\n 'orthogonal-radial': orthoR,\n 'diagonal-horizontal': diagonalX,\n 'diagonal-vertical': diagonalY,\n 'diagonal-radial': diagonalR\n});\n\n/**\n * Pie and donut chart layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size pie segments.\n * @param {number} [params.startAngle=0] - The start angle (in radians) of the layout.\n * @param {number} [params.endAngle=2π] - The end angle (in radians) of the layout.\n * @param {boolean} [params.sort] - Boolean flag for sorting sectors by value.\n */\nfunction Pie(params) {\n Transform.call(this, null, params);\n}\nPie.Definition = {\n 'type': 'Pie',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'startAngle',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'endAngle',\n 'type': 'number',\n 'default': 6.283185307179586\n }, {\n 'name': 'sort',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['startAngle', 'endAngle']\n }]\n};\ninherits(Pie, Transform, {\n transform(_, pulse) {\n var as = _.as || ['startAngle', 'endAngle'],\n startAngle = as[0],\n endAngle = as[1],\n field = _.field || one,\n start = _.startAngle || 0,\n stop = _.endAngle != null ? _.endAngle : 2 * Math.PI,\n data = pulse.source,\n values = data.map(field),\n n = values.length,\n a = start,\n k = (stop - start) / sum(values),\n index = range(n),\n i,\n t,\n v;\n if (_.sort) {\n index.sort((a, b) => values[a] - values[b]);\n }\n for (i = 0; i < n; ++i) {\n v = values[index[i]];\n t = data[index[i]];\n t[startAngle] = a;\n t[endAngle] = a += v * k;\n }\n this.value = values;\n return pulse.reflow(_.modified()).modifies(as);\n }\n});\n\nconst DEFAULT_COUNT = 5;\nfunction includeZero(scale) {\n const type = scale.type;\n return !scale.bins && (type === Linear || type === Pow || type === Sqrt);\n}\nfunction includePad(type) {\n return isContinuous(type) && type !== Sequential;\n}\nconst SKIP = toSet(['set', 'modified', 'clear', 'type', 'scheme', 'schemeExtent', 'schemeCount', 'domain', 'domainMin', 'domainMid', 'domainMax', 'domainRaw', 'domainImplicit', 'nice', 'zero', 'bins', 'range', 'rangeStep', 'round', 'reverse', 'interpolate', 'interpolateGamma']);\n\n/**\n * Maintains a scale function mapping data values to visual channels.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction Scale(params) {\n Transform.call(this, null, params);\n this.modified(true); // always treat as modified\n}\ninherits(Scale, Transform, {\n transform(_, pulse) {\n var df = pulse.dataflow,\n scale$1 = this.value,\n key = scaleKey(_);\n if (!scale$1 || key !== scale$1.type) {\n this.value = scale$1 = scale(key)();\n }\n for (key in _) if (!SKIP[key]) {\n // padding is a scale property for band/point but not others\n if (key === 'padding' && includePad(scale$1.type)) continue;\n // invoke scale property setter, raise warning if not found\n isFunction(scale$1[key]) ? scale$1[key](_[key]) : df.warn('Unsupported scale property: ' + key);\n }\n configureRange(scale$1, _, configureBins(scale$1, _, configureDomain(scale$1, _, df)));\n return pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n }\n});\nfunction scaleKey(_) {\n var t = _.type,\n d = '',\n n;\n\n // backwards compatibility pre Vega 5.\n if (t === Sequential) return Sequential + '-' + Linear;\n if (isContinuousColor(_)) {\n n = _.rawDomain ? _.rawDomain.length : _.domain ? _.domain.length + +(_.domainMid != null) : 0;\n d = n === 2 ? Sequential + '-' : n === 3 ? Diverging + '-' : '';\n }\n return (d + t || Linear).toLowerCase();\n}\nfunction isContinuousColor(_) {\n const t = _.type;\n return isContinuous(t) && t !== Time && t !== UTC && (_.scheme || _.range && _.range.length && _.range.every(isString));\n}\nfunction configureDomain(scale, _, df) {\n // check raw domain, if provided use that and exit early\n const raw = rawDomain(scale, _.domainRaw, df);\n if (raw > -1) return raw;\n var domain = _.domain,\n type = scale.type,\n zero = _.zero || _.zero === undefined && includeZero(scale),\n n,\n mid;\n if (!domain) return 0;\n\n // adjust domain based on zero, min, max settings\n if (zero || _.domainMin != null || _.domainMax != null || _.domainMid != null) {\n n = (domain = domain.slice()).length - 1 || 1;\n if (zero) {\n if (domain[0] > 0) domain[0] = 0;\n if (domain[n] < 0) domain[n] = 0;\n }\n if (_.domainMin != null) domain[0] = _.domainMin;\n if (_.domainMax != null) domain[n] = _.domainMax;\n if (_.domainMid != null) {\n mid = _.domainMid;\n const i = mid > domain[n] ? n + 1 : mid < domain[0] ? 0 : n;\n if (i !== n) df.warn('Scale domainMid exceeds domain min or max.', mid);\n domain.splice(i, 0, mid);\n }\n }\n\n // adjust continuous domain for minimum pixel padding\n if (includePad(type) && _.padding && domain[0] !== peek(domain)) {\n domain = padDomain(type, domain, _.range, _.padding, _.exponent, _.constant);\n }\n\n // set the scale domain\n scale.domain(domainCheck(type, domain, df));\n\n // if ordinal scale domain is defined, prevent implicit\n // domain construction as side-effect of scale lookup\n if (type === Ordinal) {\n scale.unknown(_.domainImplicit ? scaleImplicit : undefined);\n }\n\n // perform 'nice' adjustment as requested\n if (_.nice && scale.nice) {\n scale.nice(_.nice !== true && tickCount(scale, _.nice) || null);\n }\n\n // return the cardinality of the domain\n return domain.length;\n}\nfunction rawDomain(scale, raw, df) {\n if (raw) {\n scale.domain(domainCheck(scale.type, raw, df));\n return raw.length;\n } else {\n return -1;\n }\n}\nfunction padDomain(type, domain, range, pad, exponent, constant) {\n var span = Math.abs(peek(range) - range[0]),\n frac = span / (span - 2 * pad),\n d = type === Log ? zoomLog(domain, null, frac) : type === Sqrt ? zoomPow(domain, null, frac, 0.5) : type === Pow ? zoomPow(domain, null, frac, exponent || 1) : type === Symlog ? zoomSymlog(domain, null, frac, constant || 1) : zoomLinear(domain, null, frac);\n domain = domain.slice();\n domain[0] = d[0];\n domain[domain.length - 1] = d[1];\n return domain;\n}\nfunction domainCheck(type, domain, df) {\n if (isLogarithmic(type)) {\n // sum signs of domain values\n // if all pos or all neg, abs(sum) === domain.length\n var s = Math.abs(domain.reduce((s, v) => s + (v < 0 ? -1 : v > 0 ? 1 : 0), 0));\n if (s !== domain.length) {\n df.warn('Log scale domain includes zero: ' + stringValue(domain));\n }\n }\n return domain;\n}\nfunction configureBins(scale, _, count) {\n let bins = _.bins;\n if (bins && !isArray(bins)) {\n // generate bin boundary array\n const domain = scale.domain(),\n lo = domain[0],\n hi = peek(domain),\n step = bins.step;\n let start = bins.start == null ? lo : bins.start,\n stop = bins.stop == null ? hi : bins.stop;\n if (!step) error('Scale bins parameter missing step property.');\n if (start < lo) start = step * Math.ceil(lo / step);\n if (stop > hi) stop = step * Math.floor(hi / step);\n bins = range(start, stop + step / 2, step);\n }\n if (bins) {\n // assign bin boundaries to scale instance\n scale.bins = bins;\n } else if (scale.bins) {\n // no current bins, remove bins if previously set\n delete scale.bins;\n }\n\n // special handling for bin-ordinal scales\n if (scale.type === BinOrdinal) {\n if (!bins) {\n // the domain specifies the bins\n scale.bins = scale.domain();\n } else if (!_.domain && !_.domainRaw) {\n // the bins specify the domain\n scale.domain(bins);\n count = bins.length;\n }\n }\n\n // return domain cardinality\n return count;\n}\nfunction configureRange(scale, _, count) {\n var type = scale.type,\n round = _.round || false,\n range = _.range;\n\n // if range step specified, calculate full range extent\n if (_.rangeStep != null) {\n range = configureRangeStep(type, _, count);\n }\n\n // else if a range scheme is defined, use that\n else if (_.scheme) {\n range = configureScheme(type, _, count);\n if (isFunction(range)) {\n if (scale.interpolator) {\n return scale.interpolator(range);\n } else {\n error(`Scale type ${type} does not support interpolating color schemes.`);\n }\n }\n }\n\n // given a range array for an interpolating scale, convert to interpolator\n if (range && isInterpolating(type)) {\n return scale.interpolator(interpolateColors(flip(range, _.reverse), _.interpolate, _.interpolateGamma));\n }\n\n // configure rounding / interpolation\n if (range && _.interpolate && scale.interpolate) {\n scale.interpolate(interpolate(_.interpolate, _.interpolateGamma));\n } else if (isFunction(scale.round)) {\n scale.round(round);\n } else if (isFunction(scale.rangeRound)) {\n scale.interpolate(round ? interpolateRound : interpolate$1);\n }\n if (range) scale.range(flip(range, _.reverse));\n}\nfunction configureRangeStep(type, _, count) {\n if (type !== Band && type !== Point) {\n error('Only band and point scales support rangeStep.');\n }\n\n // calculate full range based on requested step size and padding\n var outer = (_.paddingOuter != null ? _.paddingOuter : _.padding) || 0,\n inner = type === Point ? 1 : (_.paddingInner != null ? _.paddingInner : _.padding) || 0;\n return [0, _.rangeStep * bandSpace(count, inner, outer)];\n}\nfunction configureScheme(type, _, count) {\n var extent = _.schemeExtent,\n name,\n scheme$1;\n if (isArray(_.scheme)) {\n scheme$1 = interpolateColors(_.scheme, _.interpolate, _.interpolateGamma);\n } else {\n name = _.scheme.toLowerCase();\n scheme$1 = scheme(name);\n if (!scheme$1) error(`Unrecognized scheme name: ${_.scheme}`);\n }\n\n // determine size for potential discrete range\n count = type === Threshold ? count + 1 : type === BinOrdinal ? count - 1 : type === Quantile || type === Quantize ? +_.schemeCount || DEFAULT_COUNT : count;\n\n // adjust and/or quantize scheme as appropriate\n return isInterpolating(type) ? adjustScheme(scheme$1, extent, _.reverse) : isFunction(scheme$1) ? quantizeInterpolator(adjustScheme(scheme$1, extent), count) : type === Ordinal ? scheme$1 : scheme$1.slice(0, count);\n}\nfunction adjustScheme(scheme, extent, reverse) {\n return isFunction(scheme) && (extent || reverse) ? interpolateRange(scheme, flip(extent || [0, 1], reverse)) : scheme;\n}\nfunction flip(array, reverse) {\n return reverse ? array.slice().reverse() : array;\n}\n\n/**\n * Sorts scenegraph items in the pulse source array.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(*,*): number} [params.sort] - A comparator\n * function for sorting tuples.\n */\nfunction SortItems(params) {\n Transform.call(this, null, params);\n}\ninherits(SortItems, Transform, {\n transform(_, pulse) {\n const mod = _.modified('sort') || pulse.changed(pulse.ADD) || pulse.modified(_.sort.fields) || pulse.modified('datum');\n if (mod) pulse.source.sort(stableCompare(_.sort));\n this.modified(mod);\n return pulse;\n }\n});\n\nconst Zero = 'zero',\n Center = 'center',\n Normalize = 'normalize',\n DefOutput = ['y0', 'y1'];\n\n/**\n * Stack layout for visualization elements.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to stack.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {function(object,object): number} [params.sort] - A comparator for stack sorting.\n * @param {string} [offset='zero'] - Stack baseline offset. One of 'zero', 'center', 'normalize'.\n */\nfunction Stack(params) {\n Transform.call(this, null, params);\n}\nStack.Definition = {\n 'type': 'Stack',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'offset',\n 'type': 'enum',\n 'default': Zero,\n 'values': [Zero, Center, Normalize]\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': DefOutput\n }]\n};\ninherits(Stack, Transform, {\n transform(_, pulse) {\n var as = _.as || DefOutput,\n y0 = as[0],\n y1 = as[1],\n sort = stableCompare(_.sort),\n field = _.field || one,\n stack = _.offset === Center ? stackCenter : _.offset === Normalize ? stackNormalize : stackZero,\n groups,\n i,\n n,\n max;\n\n // partition, sum, and sort the stack groups\n groups = partition(pulse.source, _.groupby, sort, field);\n\n // compute stack layouts per group\n for (i = 0, n = groups.length, max = groups.max; i < n; ++i) {\n stack(groups[i], max, field, y0, y1);\n }\n return pulse.reflow(_.modified()).modifies(as);\n }\n});\nfunction stackCenter(group, max, field, y0, y1) {\n var last = (max - group.sum) / 2,\n m = group.length,\n j = 0,\n t;\n for (; j < m; ++j) {\n t = group[j];\n t[y0] = last;\n t[y1] = last += Math.abs(field(t));\n }\n}\nfunction stackNormalize(group, max, field, y0, y1) {\n var scale = 1 / group.sum,\n last = 0,\n m = group.length,\n j = 0,\n v = 0,\n t;\n for (; j < m; ++j) {\n t = group[j];\n t[y0] = last;\n t[y1] = last = scale * (v += Math.abs(field(t)));\n }\n}\nfunction stackZero(group, max, field, y0, y1) {\n var lastPos = 0,\n lastNeg = 0,\n m = group.length,\n j = 0,\n v,\n t;\n for (; j < m; ++j) {\n t = group[j];\n v = +field(t);\n if (v < 0) {\n t[y0] = lastNeg;\n t[y1] = lastNeg += v;\n } else {\n t[y0] = lastPos;\n t[y1] = lastPos += v;\n }\n }\n}\nfunction partition(data, groupby, sort, field) {\n var groups = [],\n get = f => f(t),\n map,\n i,\n n,\n m,\n t,\n k,\n g,\n s,\n max;\n\n // partition data points into stack groups\n if (groupby == null) {\n groups.push(data.slice());\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n if (!g) {\n map[k] = g = [];\n groups.push(g);\n }\n g.push(t);\n }\n }\n\n // compute sums of groups, sort groups as needed\n for (k = 0, max = 0, m = groups.length; k < m; ++k) {\n g = groups[k];\n for (i = 0, s = 0, n = g.length; i < n; ++i) {\n s += Math.abs(field(g[i]));\n }\n g.sum = s;\n if (s > max) max = s;\n if (sort) g.sort(sort);\n }\n groups.max = max;\n return groups;\n}\n\nexport { AxisTicks as axisticks, DataJoin as datajoin, Encode as encode, LegendEntries as legendentries, LinkPath as linkpath, Pie as pie, Scale as scale, SortItems as sortitems, Stack as stack };\n","export default x => x;\n","function streamGeometry(geometry, stream) {\n if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {\n streamGeometryType[geometry.type](geometry, stream);\n }\n}\n\nvar streamObjectType = {\n Feature: function(object, stream) {\n streamGeometry(object.geometry, stream);\n },\n FeatureCollection: function(object, stream) {\n var features = object.features, i = -1, n = features.length;\n while (++i < n) streamGeometry(features[i].geometry, stream);\n }\n};\n\nvar streamGeometryType = {\n Sphere: function(object, stream) {\n stream.sphere();\n },\n Point: function(object, stream) {\n object = object.coordinates;\n stream.point(object[0], object[1], object[2]);\n },\n MultiPoint: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]);\n },\n LineString: function(object, stream) {\n streamLine(object.coordinates, stream, 0);\n },\n MultiLineString: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamLine(coordinates[i], stream, 0);\n },\n Polygon: function(object, stream) {\n streamPolygon(object.coordinates, stream);\n },\n MultiPolygon: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamPolygon(coordinates[i], stream);\n },\n GeometryCollection: function(object, stream) {\n var geometries = object.geometries, i = -1, n = geometries.length;\n while (++i < n) streamGeometry(geometries[i], stream);\n }\n};\n\nfunction streamLine(coordinates, stream, closed) {\n var i = -1, n = coordinates.length - closed, coordinate;\n stream.lineStart();\n while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);\n stream.lineEnd();\n}\n\nfunction streamPolygon(coordinates, stream) {\n var i = -1, n = coordinates.length;\n stream.polygonStart();\n while (++i < n) streamLine(coordinates[i], stream, 1);\n stream.polygonEnd();\n}\n\nexport default function(object, stream) {\n if (object && streamObjectType.hasOwnProperty(object.type)) {\n streamObjectType[object.type](object, stream);\n } else {\n streamGeometry(object, stream);\n }\n}\n","// https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423\nexport class Adder {\n constructor() {\n this._partials = new Float64Array(32);\n this._n = 0;\n }\n add(x) {\n const p = this._partials;\n let i = 0;\n for (let j = 0; j < this._n && j < 32; j++) {\n const y = p[j],\n hi = x + y,\n lo = Math.abs(x) < Math.abs(y) ? x - (hi - y) : y - (hi - x);\n if (lo) p[i++] = lo;\n x = hi;\n }\n p[i] = x;\n this._n = i + 1;\n return this;\n }\n valueOf() {\n const p = this._partials;\n let n = this._n, x, y, lo, hi = 0;\n if (n > 0) {\n hi = p[--n];\n while (n > 0) {\n x = hi;\n y = p[--n];\n hi = x + y;\n lo = y - (hi - x);\n if (lo) break;\n }\n if (n > 0 && ((lo < 0 && p[n - 1] < 0) || (lo > 0 && p[n - 1] > 0))) {\n y = lo * 2;\n x = hi + y;\n if (y == x - hi) hi = x;\n }\n }\n return hi;\n }\n}\n\nexport function fsum(values, valueof) {\n const adder = new Adder();\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n adder.add(value);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n adder.add(value);\n }\n }\n }\n return +adder;\n}\n\nexport function fcumsum(values, valueof) {\n const adder = new Adder();\n let index = -1;\n return Float64Array.from(values, valueof === undefined\n ? v => adder.add(+v || 0)\n : v => adder.add(+valueof(v, ++index, values) || 0)\n );\n}\n","export var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var tau = pi * 2;\n\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var ceil = Math.ceil;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var hypot = Math.hypot;\nexport var log = Math.log;\nexport var pow = Math.pow;\nexport var sin = Math.sin;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sqrt = Math.sqrt;\nexport var tan = Math.tan;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);\n}\n\nexport function haversin(x) {\n return (x = sin(x / 2)) * x;\n}\n","export default function noop() {}\n","import {Adder} from \"d3-array\";\nimport {abs} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar areaSum = new Adder(),\n areaRingSum = new Adder(),\n x00,\n y00,\n x0,\n y0;\n\nvar areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n areaStream.lineStart = areaStream.lineEnd = areaStream.point = noop;\n areaSum.add(abs(areaRingSum));\n areaRingSum = new Adder();\n },\n result: function() {\n var area = areaSum / 2;\n areaSum = new Adder();\n return area;\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaPointFirst(x, y) {\n areaStream.point = areaPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction areaPoint(x, y) {\n areaRingSum.add(y0 * x - x0 * y);\n x0 = x, y0 = y;\n}\n\nfunction areaRingEnd() {\n areaPoint(x00, y00);\n}\n\nexport default areaStream;\n","import noop from \"../noop.js\";\n\nvar x0 = Infinity,\n y0 = x0,\n x1 = -x0,\n y1 = x1;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop,\n result: function() {\n var bounds = [[x0, y0], [x1, y1]];\n x1 = y1 = -(y0 = x0 = Infinity);\n return bounds;\n }\n};\n\nfunction boundsPoint(x, y) {\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n}\n\nexport default boundsStream;\n","import {sqrt} from \"../math.js\";\n\n// TODO Enforce positive area for exterior, negative area for interior?\n\nvar X0 = 0,\n Y0 = 0,\n Z0 = 0,\n X1 = 0,\n Y1 = 0,\n Z1 = 0,\n X2 = 0,\n Y2 = 0,\n Z2 = 0,\n x00,\n y00,\n x0,\n y0;\n\nvar centroidStream = {\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.point = centroidPoint;\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n },\n result: function() {\n var centroid = Z2 ? [X2 / Z2, Y2 / Z2]\n : Z1 ? [X1 / Z1, Y1 / Z1]\n : Z0 ? [X0 / Z0, Y0 / Z0]\n : [NaN, NaN];\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 =\n X2 = Y2 = Z2 = 0;\n return centroid;\n }\n};\n\nfunction centroidPoint(x, y) {\n X0 += x;\n Y0 += y;\n ++Z0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidPointFirstLine;\n}\n\nfunction centroidPointFirstLine(x, y) {\n centroidStream.point = centroidPointLine;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidPointLine(x, y) {\n var dx = x - x0, dy = y - y0, z = sqrt(dx * dx + dy * dy);\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingStart() {\n centroidStream.point = centroidPointFirstRing;\n}\n\nfunction centroidRingEnd() {\n centroidPointRing(x00, y00);\n}\n\nfunction centroidPointFirstRing(x, y) {\n centroidStream.point = centroidPointRing;\n centroidPoint(x00 = x0 = x, y00 = y0 = y);\n}\n\nfunction centroidPointRing(x, y) {\n var dx = x - x0,\n dy = y - y0,\n z = sqrt(dx * dx + dy * dy);\n\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n\n z = y0 * x - x0 * y;\n X2 += z * (x0 + x);\n Y2 += z * (y0 + y);\n Z2 += z * 3;\n centroidPoint(x0 = x, y0 = y);\n}\n\nexport default centroidStream;\n","import {tau} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nexport default function PathContext(context) {\n this._context = context;\n}\n\nPathContext.prototype = {\n _radius: 4.5,\n pointRadius: function(_) {\n return this._radius = _, this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._context.closePath();\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._context.moveTo(x, y);\n this._point = 1;\n break;\n }\n case 1: {\n this._context.lineTo(x, y);\n break;\n }\n default: {\n this._context.moveTo(x + this._radius, y);\n this._context.arc(x, y, this._radius, 0, tau);\n break;\n }\n }\n },\n result: noop\n};\n","import {Adder} from \"d3-array\";\nimport {sqrt} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar lengthSum = new Adder(),\n lengthRing,\n x00,\n y00,\n x0,\n y0;\n\nvar lengthStream = {\n point: noop,\n lineStart: function() {\n lengthStream.point = lengthPointFirst;\n },\n lineEnd: function() {\n if (lengthRing) lengthPoint(x00, y00);\n lengthStream.point = noop;\n },\n polygonStart: function() {\n lengthRing = true;\n },\n polygonEnd: function() {\n lengthRing = null;\n },\n result: function() {\n var length = +lengthSum;\n lengthSum = new Adder();\n return length;\n }\n};\n\nfunction lengthPointFirst(x, y) {\n lengthStream.point = lengthPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction lengthPoint(x, y) {\n x0 -= x, y0 -= y;\n lengthSum.add(sqrt(x0 * x0 + y0 * y0));\n x0 = x, y0 = y;\n}\n\nexport default lengthStream;\n","// Simple caching for constant-radius points.\nlet cacheDigits, cacheAppend, cacheRadius, cacheCircle;\n\nexport default class PathString {\n constructor(digits) {\n this._append = digits == null ? append : appendRound(digits);\n this._radius = 4.5;\n this._ = \"\";\n }\n pointRadius(_) {\n this._radius = +_;\n return this;\n }\n polygonStart() {\n this._line = 0;\n }\n polygonEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line === 0) this._ += \"Z\";\n this._point = NaN;\n }\n point(x, y) {\n switch (this._point) {\n case 0: {\n this._append`M${x},${y}`;\n this._point = 1;\n break;\n }\n case 1: {\n this._append`L${x},${y}`;\n break;\n }\n default: {\n this._append`M${x},${y}`;\n if (this._radius !== cacheRadius || this._append !== cacheAppend) {\n const r = this._radius;\n const s = this._;\n this._ = \"\"; // stash the old string so we can cache the circle path fragment\n this._append`m0,${r}a${r},${r} 0 1,1 0,${-2 * r}a${r},${r} 0 1,1 0,${2 * r}z`;\n cacheRadius = r;\n cacheAppend = this._append;\n cacheCircle = this._;\n this._ = s;\n }\n this._ += cacheCircle;\n break;\n }\n }\n }\n result() {\n const result = this._;\n this._ = \"\";\n return result.length ? result : null;\n }\n}\n\nfunction append(strings) {\n let i = 1;\n this._ += strings[0];\n for (const j = strings.length; i < j; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n const d = Math.floor(digits);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${digits}`);\n if (d > 15) return append;\n if (d !== cacheDigits) {\n const k = 10 ** d;\n cacheDigits = d;\n cacheAppend = function append(strings) {\n let i = 1;\n this._ += strings[0];\n for (const j = strings.length; i < j; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n }\n return cacheAppend;\n}\n","import identity from \"../identity.js\";\nimport stream from \"../stream.js\";\nimport pathArea from \"./area.js\";\nimport pathBounds from \"./bounds.js\";\nimport pathCentroid from \"./centroid.js\";\nimport PathContext from \"./context.js\";\nimport pathMeasure from \"./measure.js\";\nimport PathString from \"./string.js\";\n\nexport default function(projection, context) {\n let digits = 3,\n pointRadius = 4.5,\n projectionStream,\n contextStream;\n\n function path(object) {\n if (object) {\n if (typeof pointRadius === \"function\") contextStream.pointRadius(+pointRadius.apply(this, arguments));\n stream(object, projectionStream(contextStream));\n }\n return contextStream.result();\n }\n\n path.area = function(object) {\n stream(object, projectionStream(pathArea));\n return pathArea.result();\n };\n\n path.measure = function(object) {\n stream(object, projectionStream(pathMeasure));\n return pathMeasure.result();\n };\n\n path.bounds = function(object) {\n stream(object, projectionStream(pathBounds));\n return pathBounds.result();\n };\n\n path.centroid = function(object) {\n stream(object, projectionStream(pathCentroid));\n return pathCentroid.result();\n };\n\n path.projection = function(_) {\n if (!arguments.length) return projection;\n projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream;\n return path;\n };\n\n path.context = function(_) {\n if (!arguments.length) return context;\n contextStream = _ == null ? (context = null, new PathString(digits)) : new PathContext(context = _);\n if (typeof pointRadius !== \"function\") contextStream.pointRadius(pointRadius);\n return path;\n };\n\n path.pointRadius = function(_) {\n if (!arguments.length) return pointRadius;\n pointRadius = typeof _ === \"function\" ? _ : (contextStream.pointRadius(+_), +_);\n return path;\n };\n\n path.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) digits = null;\n else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n if (context === null) contextStream = new PathString(digits);\n return path;\n };\n\n return path.projection(projection).digits(digits).context(context);\n}\n","import noop from \"../noop.js\";\n\nexport default function() {\n var lines = [],\n line;\n return {\n point: function(x, y, m) {\n line.push([x, y, m]);\n },\n lineStart: function() {\n lines.push(line = []);\n },\n lineEnd: noop,\n rejoin: function() {\n if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));\n },\n result: function() {\n var result = lines;\n lines = [];\n line = null;\n return result;\n }\n };\n}\n","import {abs, epsilon} from \"./math.js\";\n\nexport default function(a, b) {\n return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;\n}\n","import pointEqual from \"../pointEqual.js\";\nimport {epsilon} from \"../math.js\";\n\nfunction Intersection(point, points, other, entry) {\n this.x = point;\n this.z = points;\n this.o = other; // another intersection\n this.e = entry; // is an entry?\n this.v = false; // visited\n this.n = this.p = null; // next & previous\n}\n\n// A generalized polygon clipping algorithm: given a polygon that has been cut\n// into its visible line segments, and rejoins the segments by interpolating\n// along the clip edge.\nexport default function(segments, compareIntersection, startInside, interpolate, stream) {\n var subject = [],\n clip = [],\n i,\n n;\n\n segments.forEach(function(segment) {\n if ((n = segment.length - 1) <= 0) return;\n var n, p0 = segment[0], p1 = segment[n], x;\n\n if (pointEqual(p0, p1)) {\n if (!p0[2] && !p1[2]) {\n stream.lineStart();\n for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);\n stream.lineEnd();\n return;\n }\n // handle degenerate cases by moving the point\n p1[0] += 2 * epsilon;\n }\n\n subject.push(x = new Intersection(p0, segment, null, true));\n clip.push(x.o = new Intersection(p0, null, x, false));\n subject.push(x = new Intersection(p1, segment, null, false));\n clip.push(x.o = new Intersection(p1, null, x, true));\n });\n\n if (!subject.length) return;\n\n clip.sort(compareIntersection);\n link(subject);\n link(clip);\n\n for (i = 0, n = clip.length; i < n; ++i) {\n clip[i].e = startInside = !startInside;\n }\n\n var start = subject[0],\n points,\n point;\n\n while (1) {\n // Find first unvisited intersection.\n var current = start,\n isSubject = true;\n while (current.v) if ((current = current.n) === start) return;\n points = current.z;\n stream.lineStart();\n do {\n current.v = current.o.v = true;\n if (current.e) {\n if (isSubject) {\n for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.n.x, 1, stream);\n }\n current = current.n;\n } else {\n if (isSubject) {\n points = current.p.z;\n for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.p.x, -1, stream);\n }\n current = current.p;\n }\n current = current.o;\n points = current.z;\n isSubject = !isSubject;\n } while (!current.v);\n stream.lineEnd();\n }\n}\n\nfunction link(array) {\n if (!(n = array.length)) return;\n var n,\n i = 0,\n a = array[0],\n b;\n while (++i < n) {\n a.n = b = array[i];\n b.p = a;\n a = b;\n }\n a.n = b = array[0];\n b.p = a;\n}\n","import {asin, atan2, cos, sin, sqrt} from \"./math.js\";\n\nexport function spherical(cartesian) {\n return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])];\n}\n\nexport function cartesian(spherical) {\n var lambda = spherical[0], phi = spherical[1], cosPhi = cos(phi);\n return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];\n}\n\nexport function cartesianDot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n\nexport function cartesianCross(a, b) {\n return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];\n}\n\n// TODO return a\nexport function cartesianAddInPlace(a, b) {\n a[0] += b[0], a[1] += b[1], a[2] += b[2];\n}\n\nexport function cartesianScale(vector, k) {\n return [vector[0] * k, vector[1] * k, vector[2] * k];\n}\n\n// TODO return d\nexport function cartesianNormalizeInPlace(d) {\n var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);\n d[0] /= l, d[1] /= l, d[2] /= l;\n}\n","import {Adder} from \"d3-array\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace} from \"./cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, epsilon2, halfPi, pi, quarterPi, sign, sin, tau} from \"./math.js\";\n\nfunction longitude(point) {\n return abs(point[0]) <= pi ? point[0] : sign(point[0]) * ((abs(point[0]) + pi) % tau - pi);\n}\n\nexport default function(polygon, point) {\n var lambda = longitude(point),\n phi = point[1],\n sinPhi = sin(phi),\n normal = [sin(lambda), -cos(lambda), 0],\n angle = 0,\n winding = 0;\n\n var sum = new Adder();\n\n if (sinPhi === 1) phi = halfPi + epsilon;\n else if (sinPhi === -1) phi = -halfPi - epsilon;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n if (!(m = (ring = polygon[i]).length)) continue;\n var ring,\n m,\n point0 = ring[m - 1],\n lambda0 = longitude(point0),\n phi0 = point0[1] / 2 + quarterPi,\n sinPhi0 = sin(phi0),\n cosPhi0 = cos(phi0);\n\n for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {\n var point1 = ring[j],\n lambda1 = longitude(point1),\n phi1 = point1[1] / 2 + quarterPi,\n sinPhi1 = sin(phi1),\n cosPhi1 = cos(phi1),\n delta = lambda1 - lambda0,\n sign = delta >= 0 ? 1 : -1,\n absDelta = sign * delta,\n antimeridian = absDelta > pi,\n k = sinPhi0 * sinPhi1;\n\n sum.add(atan2(k * sign * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta)));\n angle += antimeridian ? delta + sign * tau : delta;\n\n // Are the longitudes either side of the point’s meridian (lambda),\n // and are the latitudes smaller than the parallel (phi)?\n if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {\n var arc = cartesianCross(cartesian(point0), cartesian(point1));\n cartesianNormalizeInPlace(arc);\n var intersection = cartesianCross(normal, arc);\n cartesianNormalizeInPlace(intersection);\n var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);\n if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {\n winding += antimeridian ^ delta >= 0 ? 1 : -1;\n }\n }\n }\n }\n\n // First, determine whether the South pole is inside or outside:\n //\n // It is inside if:\n // * the polygon winds around it in a clockwise direction.\n // * the polygon does not (cumulatively) wind around it, but has a negative\n // (counter-clockwise) area.\n //\n // Second, count the (signed) number of times a segment crosses a lambda\n // from the point to the South pole. If it is zero, then the point is the\n // same side as the South pole.\n\n return (angle < -epsilon || angle < epsilon && sum < -epsilon2) ^ (winding & 1);\n}\n","function* flatten(arrays) {\n for (const array of arrays) {\n yield* array;\n }\n}\n\nexport default function merge(arrays) {\n return Array.from(flatten(arrays));\n}\n","import clipBuffer from \"./buffer.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {epsilon, halfPi} from \"../math.js\";\nimport polygonContains from \"../polygonContains.js\";\nimport {merge} from \"d3-array\";\n\nexport default function(pointVisible, clipLine, interpolate, start) {\n return function(sink) {\n var line = clipLine(sink),\n ringBuffer = clipBuffer(),\n ringSink = clipLine(ringBuffer),\n polygonStarted = false,\n polygon,\n segments,\n ring;\n\n var clip = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() {\n clip.point = pointRing;\n clip.lineStart = ringStart;\n clip.lineEnd = ringEnd;\n segments = [];\n polygon = [];\n },\n polygonEnd: function() {\n clip.point = point;\n clip.lineStart = lineStart;\n clip.lineEnd = lineEnd;\n segments = merge(segments);\n var startInside = polygonContains(polygon, start);\n if (segments.length) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n clipRejoin(segments, compareIntersection, startInside, interpolate, sink);\n } else if (startInside) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n }\n if (polygonStarted) sink.polygonEnd(), polygonStarted = false;\n segments = polygon = null;\n },\n sphere: function() {\n sink.polygonStart();\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n sink.polygonEnd();\n }\n };\n\n function point(lambda, phi) {\n if (pointVisible(lambda, phi)) sink.point(lambda, phi);\n }\n\n function pointLine(lambda, phi) {\n line.point(lambda, phi);\n }\n\n function lineStart() {\n clip.point = pointLine;\n line.lineStart();\n }\n\n function lineEnd() {\n clip.point = point;\n line.lineEnd();\n }\n\n function pointRing(lambda, phi) {\n ring.push([lambda, phi]);\n ringSink.point(lambda, phi);\n }\n\n function ringStart() {\n ringSink.lineStart();\n ring = [];\n }\n\n function ringEnd() {\n pointRing(ring[0][0], ring[0][1]);\n ringSink.lineEnd();\n\n var clean = ringSink.clean(),\n ringSegments = ringBuffer.result(),\n i, n = ringSegments.length, m,\n segment,\n point;\n\n ring.pop();\n polygon.push(ring);\n ring = null;\n\n if (!n) return;\n\n // No intersections.\n if (clean & 1) {\n segment = ringSegments[0];\n if ((m = segment.length - 1) > 0) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n for (i = 0; i < m; ++i) sink.point((point = segment[i])[0], point[1]);\n sink.lineEnd();\n }\n return;\n }\n\n // Rejoin connected segments.\n // TODO reuse ringBuffer.rejoin()?\n if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));\n\n segments.push(ringSegments.filter(validSegment));\n }\n\n return clip;\n };\n}\n\nfunction validSegment(segment) {\n return segment.length > 1;\n}\n\n// Intersections are sorted along the clip edge. For both antimeridian cutting\n// and circle clipping, the same comparison is used.\nfunction compareIntersection(a, b) {\n return ((a = a.x)[0] < 0 ? a[1] - halfPi - epsilon : halfPi - a[1])\n - ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon : halfPi - b[1]);\n}\n","import clip from \"./index.js\";\nimport {abs, atan, cos, epsilon, halfPi, pi, sin} from \"../math.js\";\n\nexport default clip(\n function() { return true; },\n clipAntimeridianLine,\n clipAntimeridianInterpolate,\n [-pi, -halfPi]\n);\n\n// Takes a line and cuts into visible segments. Return values: 0 - there were\n// intersections or the line was empty; 1 - no intersections; 2 - there were\n// intersections, and the first and last segments should be rejoined.\nfunction clipAntimeridianLine(stream) {\n var lambda0 = NaN,\n phi0 = NaN,\n sign0 = NaN,\n clean; // no intersections\n\n return {\n lineStart: function() {\n stream.lineStart();\n clean = 1;\n },\n point: function(lambda1, phi1) {\n var sign1 = lambda1 > 0 ? pi : -pi,\n delta = abs(lambda1 - lambda0);\n if (abs(delta - pi) < epsilon) { // line crosses a pole\n stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n stream.point(lambda1, phi0);\n clean = 0;\n } else if (sign0 !== sign1 && delta >= pi) { // line crosses antimeridian\n if (abs(lambda0 - sign0) < epsilon) lambda0 -= sign0 * epsilon; // handle degeneracies\n if (abs(lambda1 - sign1) < epsilon) lambda1 -= sign1 * epsilon;\n phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n clean = 0;\n }\n stream.point(lambda0 = lambda1, phi0 = phi1);\n sign0 = sign1;\n },\n lineEnd: function() {\n stream.lineEnd();\n lambda0 = phi0 = NaN;\n },\n clean: function() {\n return 2 - clean; // if intersections, rejoin first and last segments\n }\n };\n}\n\nfunction clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) {\n var cosPhi0,\n cosPhi1,\n sinLambda0Lambda1 = sin(lambda0 - lambda1);\n return abs(sinLambda0Lambda1) > epsilon\n ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1)\n - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0))\n / (cosPhi0 * cosPhi1 * sinLambda0Lambda1))\n : (phi0 + phi1) / 2;\n}\n\nfunction clipAntimeridianInterpolate(from, to, direction, stream) {\n var phi;\n if (from == null) {\n phi = direction * halfPi;\n stream.point(-pi, phi);\n stream.point(0, phi);\n stream.point(pi, phi);\n stream.point(pi, 0);\n stream.point(pi, -phi);\n stream.point(0, -phi);\n stream.point(-pi, -phi);\n stream.point(-pi, 0);\n stream.point(-pi, phi);\n } else if (abs(from[0] - to[0]) > epsilon) {\n var lambda = from[0] < to[0] ? pi : -pi;\n phi = direction * lambda / 2;\n stream.point(-lambda, phi);\n stream.point(0, phi);\n stream.point(lambda, phi);\n } else {\n stream.point(to[0], to[1]);\n }\n}\n","import {cartesian, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport constant from \"./constant.js\";\nimport {acos, cos, degrees, epsilon, radians, sin, tau} from \"./math.js\";\nimport {rotateRadians} from \"./rotation.js\";\n\n// Generates a circle centered at [0°, 0°], with a given radius and precision.\nexport function circleStream(stream, radius, delta, direction, t0, t1) {\n if (!delta) return;\n var cosRadius = cos(radius),\n sinRadius = sin(radius),\n step = direction * delta;\n if (t0 == null) {\n t0 = radius + direction * tau;\n t1 = radius - step / 2;\n } else {\n t0 = circleRadius(cosRadius, t0);\n t1 = circleRadius(cosRadius, t1);\n if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau;\n }\n for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) {\n point = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * sin(t)]);\n stream.point(point[0], point[1]);\n }\n}\n\n// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0].\nfunction circleRadius(cosRadius, point) {\n point = cartesian(point), point[0] -= cosRadius;\n cartesianNormalizeInPlace(point);\n var radius = acos(-point[1]);\n return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;\n}\n\nexport default function() {\n var center = constant([0, 0]),\n radius = constant(90),\n precision = constant(6),\n ring,\n rotate,\n stream = {point: point};\n\n function point(x, y) {\n ring.push(x = rotate(x, y));\n x[0] *= degrees, x[1] *= degrees;\n }\n\n function circle() {\n var c = center.apply(this, arguments),\n r = radius.apply(this, arguments) * radians,\n p = precision.apply(this, arguments) * radians;\n ring = [];\n rotate = rotateRadians(-c[0] * radians, -c[1] * radians, 0).invert;\n circleStream(stream, r, p, 1);\n c = {type: \"Polygon\", coordinates: [ring]};\n ring = rotate = null;\n return c;\n }\n\n circle.center = function(_) {\n return arguments.length ? (center = typeof _ === \"function\" ? _ : constant([+_[0], +_[1]]), circle) : center;\n };\n\n circle.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), circle) : radius;\n };\n\n circle.precision = function(_) {\n return arguments.length ? (precision = typeof _ === \"function\" ? _ : constant(+_), circle) : precision;\n };\n\n return circle;\n}\n","import {abs, epsilon} from \"../math.js\";\nimport clipBuffer from \"./buffer.js\";\nimport clipLine from \"./line.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {merge} from \"d3-array\";\n\nvar clipMax = 1e9, clipMin = -clipMax;\n\n// TODO Use d3-polygon’s polygonContains here for the ring check?\n// TODO Eliminate duplicate buffering in clipBuffer and polygon.push?\n\nexport default function clipRectangle(x0, y0, x1, y1) {\n\n function visible(x, y) {\n return x0 <= x && x <= x1 && y0 <= y && y <= y1;\n }\n\n function interpolate(from, to, direction, stream) {\n var a = 0, a1 = 0;\n if (from == null\n || (a = corner(from, direction)) !== (a1 = corner(to, direction))\n || comparePoint(from, to) < 0 ^ direction > 0) {\n do stream.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);\n while ((a = (a + direction + 4) % 4) !== a1);\n } else {\n stream.point(to[0], to[1]);\n }\n }\n\n function corner(p, direction) {\n return abs(p[0] - x0) < epsilon ? direction > 0 ? 0 : 3\n : abs(p[0] - x1) < epsilon ? direction > 0 ? 2 : 1\n : abs(p[1] - y0) < epsilon ? direction > 0 ? 1 : 0\n : direction > 0 ? 3 : 2; // abs(p[1] - y1) < epsilon\n }\n\n function compareIntersection(a, b) {\n return comparePoint(a.x, b.x);\n }\n\n function comparePoint(a, b) {\n var ca = corner(a, 1),\n cb = corner(b, 1);\n return ca !== cb ? ca - cb\n : ca === 0 ? b[1] - a[1]\n : ca === 1 ? a[0] - b[0]\n : ca === 2 ? a[1] - b[1]\n : b[0] - a[0];\n }\n\n return function(stream) {\n var activeStream = stream,\n bufferStream = clipBuffer(),\n segments,\n polygon,\n ring,\n x__, y__, v__, // first point\n x_, y_, v_, // previous point\n first,\n clean;\n\n var clipStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: polygonStart,\n polygonEnd: polygonEnd\n };\n\n function point(x, y) {\n if (visible(x, y)) activeStream.point(x, y);\n }\n\n function polygonInside() {\n var winding = 0;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n for (var ring = polygon[i], j = 1, m = ring.length, point = ring[0], a0, a1, b0 = point[0], b1 = point[1]; j < m; ++j) {\n a0 = b0, a1 = b1, point = ring[j], b0 = point[0], b1 = point[1];\n if (a1 <= y1) { if (b1 > y1 && (b0 - a0) * (y1 - a1) > (b1 - a1) * (x0 - a0)) ++winding; }\n else { if (b1 <= y1 && (b0 - a0) * (y1 - a1) < (b1 - a1) * (x0 - a0)) --winding; }\n }\n }\n\n return winding;\n }\n\n // Buffer geometry within a polygon and then clip it en masse.\n function polygonStart() {\n activeStream = bufferStream, segments = [], polygon = [], clean = true;\n }\n\n function polygonEnd() {\n var startInside = polygonInside(),\n cleanInside = clean && startInside,\n visible = (segments = merge(segments)).length;\n if (cleanInside || visible) {\n stream.polygonStart();\n if (cleanInside) {\n stream.lineStart();\n interpolate(null, null, 1, stream);\n stream.lineEnd();\n }\n if (visible) {\n clipRejoin(segments, compareIntersection, startInside, interpolate, stream);\n }\n stream.polygonEnd();\n }\n activeStream = stream, segments = polygon = ring = null;\n }\n\n function lineStart() {\n clipStream.point = linePoint;\n if (polygon) polygon.push(ring = []);\n first = true;\n v_ = false;\n x_ = y_ = NaN;\n }\n\n // TODO rather than special-case polygons, simply handle them separately.\n // Ideally, coincident intersection points should be jittered to avoid\n // clipping issues.\n function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }\n\n function linePoint(x, y) {\n var v = visible(x, y);\n if (polygon) ring.push([x, y]);\n if (first) {\n x__ = x, y__ = y, v__ = v;\n first = false;\n if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n }\n } else {\n if (v && v_) activeStream.point(x, y);\n else {\n var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))],\n b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))];\n if (clipLine(a, b, x0, y0, x1, y1)) {\n if (!v_) {\n activeStream.lineStart();\n activeStream.point(a[0], a[1]);\n }\n activeStream.point(b[0], b[1]);\n if (!v) activeStream.lineEnd();\n clean = false;\n } else if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n clean = false;\n }\n }\n }\n x_ = x, y_ = y, v_ = v;\n }\n\n return clipStream;\n };\n}\n","export default function(a, b, x0, y0, x1, y1) {\n var ax = a[0],\n ay = a[1],\n bx = b[0],\n by = b[1],\n t0 = 0,\n t1 = 1,\n dx = bx - ax,\n dy = by - ay,\n r;\n\n r = x0 - ax;\n if (!dx && r > 0) return;\n r /= dx;\n if (dx < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dx > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = x1 - ax;\n if (!dx && r < 0) return;\n r /= dx;\n if (dx < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dx > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n r = y0 - ay;\n if (!dy && r > 0) return;\n r /= dy;\n if (dy < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dy > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = y1 - ay;\n if (!dy && r < 0) return;\n r /= dy;\n if (dy < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dy > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy;\n if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy;\n return true;\n}\n","export default function(a, b) {\n\n function compose(x, y) {\n return x = a(x, y), b(x[0], x[1]);\n }\n\n if (a.invert && b.invert) compose.invert = function(x, y) {\n return x = b.invert(x, y), x && a.invert(x[0], x[1]);\n };\n\n return compose;\n}\n","import compose from \"./compose.js\";\nimport {abs, asin, atan2, cos, degrees, pi, radians, sin, tau} from \"./math.js\";\n\nfunction rotationIdentity(lambda, phi) {\n if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;\n return [lambda, phi];\n}\n\nrotationIdentity.invert = rotationIdentity;\n\nexport function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {\n return (deltaLambda %= tau) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma))\n : rotationLambda(deltaLambda))\n : (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma)\n : rotationIdentity);\n}\n\nfunction forwardRotationLambda(deltaLambda) {\n return function(lambda, phi) {\n lambda += deltaLambda;\n if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;\n return [lambda, phi];\n };\n}\n\nfunction rotationLambda(deltaLambda) {\n var rotation = forwardRotationLambda(deltaLambda);\n rotation.invert = forwardRotationLambda(-deltaLambda);\n return rotation;\n}\n\nfunction rotationPhiGamma(deltaPhi, deltaGamma) {\n var cosDeltaPhi = cos(deltaPhi),\n sinDeltaPhi = sin(deltaPhi),\n cosDeltaGamma = cos(deltaGamma),\n sinDeltaGamma = sin(deltaGamma);\n\n function rotation(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaPhi + x * sinDeltaPhi;\n return [\n atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),\n asin(k * cosDeltaGamma + y * sinDeltaGamma)\n ];\n }\n\n rotation.invert = function(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaGamma - y * sinDeltaGamma;\n return [\n atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),\n asin(k * cosDeltaPhi - x * sinDeltaPhi)\n ];\n };\n\n return rotation;\n}\n\nexport default function(rotate) {\n rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);\n\n function forward(coordinates) {\n coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n }\n\n forward.invert = function(coordinates) {\n coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n };\n\n return forward;\n}\n","export default function(methods) {\n return {\n stream: transformer(methods)\n };\n}\n\nexport function transformer(methods) {\n return function(stream) {\n var s = new TransformStream;\n for (var key in methods) s[key] = methods[key];\n s.stream = stream;\n return s;\n };\n}\n\nfunction TransformStream() {}\n\nTransformStream.prototype = {\n constructor: TransformStream,\n point: function(x, y) { this.stream.point(x, y); },\n sphere: function() { this.stream.sphere(); },\n lineStart: function() { this.stream.lineStart(); },\n lineEnd: function() { this.stream.lineEnd(); },\n polygonStart: function() { this.stream.polygonStart(); },\n polygonEnd: function() { this.stream.polygonEnd(); }\n};\n","import {default as geoStream} from \"../stream.js\";\nimport boundsStream from \"../path/bounds.js\";\n\nfunction fit(projection, fitBounds, object) {\n var clip = projection.clipExtent && projection.clipExtent();\n projection.scale(150).translate([0, 0]);\n if (clip != null) projection.clipExtent(null);\n geoStream(object, projection.stream(boundsStream));\n fitBounds(boundsStream.result());\n if (clip != null) projection.clipExtent(clip);\n return projection;\n}\n\nexport function fitExtent(projection, extent, object) {\n return fit(projection, function(b) {\n var w = extent[1][0] - extent[0][0],\n h = extent[1][1] - extent[0][1],\n k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])),\n x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2,\n y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitSize(projection, size, object) {\n return fitExtent(projection, [[0, 0], size], object);\n}\n\nexport function fitWidth(projection, width, object) {\n return fit(projection, function(b) {\n var w = +width,\n k = w / (b[1][0] - b[0][0]),\n x = (w - k * (b[1][0] + b[0][0])) / 2,\n y = -k * b[0][1];\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitHeight(projection, height, object) {\n return fit(projection, function(b) {\n var h = +height,\n k = h / (b[1][1] - b[0][1]),\n x = -k * b[0][0],\n y = (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n","import {cartesian} from \"../cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, radians, sqrt} from \"../math.js\";\nimport {transformer} from \"../transform.js\";\n\nvar maxDepth = 16, // maximum depth of subdivision\n cosMinDistance = cos(30 * radians); // cos(minimum angular distance)\n\nexport default function(project, delta2) {\n return +delta2 ? resample(project, delta2) : resampleNone(project);\n}\n\nfunction resampleNone(project) {\n return transformer({\n point: function(x, y) {\n x = project(x, y);\n this.stream.point(x[0], x[1]);\n }\n });\n}\n\nfunction resample(project, delta2) {\n\n function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) {\n var dx = x1 - x0,\n dy = y1 - y0,\n d2 = dx * dx + dy * dy;\n if (d2 > 4 * delta2 && depth--) {\n var a = a0 + a1,\n b = b0 + b1,\n c = c0 + c1,\n m = sqrt(a * a + b * b + c * c),\n phi2 = asin(c /= m),\n lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a),\n p = project(lambda2, phi2),\n x2 = p[0],\n y2 = p[1],\n dx2 = x2 - x0,\n dy2 = y2 - y0,\n dz = dy * dx2 - dx * dy2;\n if (dz * dz / d2 > delta2 // perpendicular projected distance\n || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end\n || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream);\n stream.point(x2, y2);\n resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream);\n }\n }\n }\n return function(stream) {\n var lambda00, x00, y00, a00, b00, c00, // first point\n lambda0, x0, y0, a0, b0, c0; // previous point\n\n var resampleStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; },\n polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; }\n };\n\n function point(x, y) {\n x = project(x, y);\n stream.point(x[0], x[1]);\n }\n\n function lineStart() {\n x0 = NaN;\n resampleStream.point = linePoint;\n stream.lineStart();\n }\n\n function linePoint(lambda, phi) {\n var c = cartesian([lambda, phi]), p = project(lambda, phi);\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);\n stream.point(x0, y0);\n }\n\n function lineEnd() {\n resampleStream.point = point;\n stream.lineEnd();\n }\n\n function ringStart() {\n lineStart();\n resampleStream.point = ringPoint;\n resampleStream.lineEnd = ringEnd;\n }\n\n function ringPoint(lambda, phi) {\n linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;\n resampleStream.point = linePoint;\n }\n\n function ringEnd() {\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream);\n resampleStream.lineEnd = lineEnd;\n lineEnd();\n }\n\n return resampleStream;\n };\n}\n","import clipAntimeridian from \"../clip/antimeridian.js\";\nimport clipCircle from \"../clip/circle.js\";\nimport clipRectangle from \"../clip/rectangle.js\";\nimport compose from \"../compose.js\";\nimport identity from \"../identity.js\";\nimport {cos, degrees, radians, sin, sqrt} from \"../math.js\";\nimport {rotateRadians} from \"../rotation.js\";\nimport {transformer} from \"../transform.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\nimport resample from \"./resample.js\";\n\nvar transformRadians = transformer({\n point: function(x, y) {\n this.stream.point(x * radians, y * radians);\n }\n});\n\nfunction transformRotate(rotate) {\n return transformer({\n point: function(x, y) {\n var r = rotate(x, y);\n return this.stream.point(r[0], r[1]);\n }\n });\n}\n\nfunction scaleTranslate(k, dx, dy, sx, sy) {\n function transform(x, y) {\n x *= sx; y *= sy;\n return [dx + k * x, dy - k * y];\n }\n transform.invert = function(x, y) {\n return [(x - dx) / k * sx, (dy - y) / k * sy];\n };\n return transform;\n}\n\nfunction scaleTranslateRotate(k, dx, dy, sx, sy, alpha) {\n if (!alpha) return scaleTranslate(k, dx, dy, sx, sy);\n var cosAlpha = cos(alpha),\n sinAlpha = sin(alpha),\n a = cosAlpha * k,\n b = sinAlpha * k,\n ai = cosAlpha / k,\n bi = sinAlpha / k,\n ci = (sinAlpha * dy - cosAlpha * dx) / k,\n fi = (sinAlpha * dx + cosAlpha * dy) / k;\n function transform(x, y) {\n x *= sx; y *= sy;\n return [a * x - b * y + dx, dy - b * x - a * y];\n }\n transform.invert = function(x, y) {\n return [sx * (ai * x - bi * y + ci), sy * (fi - bi * x - ai * y)];\n };\n return transform;\n}\n\nexport default function projection(project) {\n return projectionMutator(function() { return project; })();\n}\n\nexport function projectionMutator(projectAt) {\n var project,\n k = 150, // scale\n x = 480, y = 250, // translate\n lambda = 0, phi = 0, // center\n deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, // pre-rotate\n alpha = 0, // post-rotate angle\n sx = 1, // reflectX\n sy = 1, // reflectX\n theta = null, preclip = clipAntimeridian, // pre-clip angle\n x0 = null, y0, x1, y1, postclip = identity, // post-clip extent\n delta2 = 0.5, // precision\n projectResample,\n projectTransform,\n projectRotateTransform,\n cache,\n cacheStream;\n\n function projection(point) {\n return projectRotateTransform(point[0] * radians, point[1] * radians);\n }\n\n function invert(point) {\n point = projectRotateTransform.invert(point[0], point[1]);\n return point && [point[0] * degrees, point[1] * degrees];\n }\n\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));\n };\n\n projection.preclip = function(_) {\n return arguments.length ? (preclip = _, theta = undefined, reset()) : preclip;\n };\n\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\n };\n\n projection.clipAngle = function(_) {\n return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees;\n };\n\n projection.clipExtent = function(_) {\n return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n projection.scale = function(_) {\n return arguments.length ? (k = +_, recenter()) : k;\n };\n\n projection.translate = function(_) {\n return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y];\n };\n\n projection.center = function(_) {\n return arguments.length ? (lambda = _[0] % 360 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];\n };\n\n projection.rotate = function(_) {\n return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];\n };\n\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, recenter()) : alpha * degrees;\n };\n\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, recenter()) : sx < 0;\n };\n\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0;\n };\n\n projection.precision = function(_) {\n return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2);\n };\n\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n function recenter() {\n var center = scaleTranslateRotate(k, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)),\n transform = scaleTranslateRotate(k, x - center[0], y - center[1], sx, sy, alpha);\n rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma);\n projectTransform = compose(project, transform);\n projectRotateTransform = compose(rotate, projectTransform);\n projectResample = resample(projectTransform, delta2);\n return reset();\n }\n\n function reset() {\n cache = cacheStream = null;\n return projection;\n }\n\n return function() {\n project = projectAt.apply(this, arguments);\n projection.invert = project.invert && invert;\n return recenter();\n };\n}\n","import {cartesian, cartesianAddInPlace, cartesianCross, cartesianDot, cartesianScale, spherical} from \"../cartesian.js\";\nimport {circleStream} from \"../circle.js\";\nimport {abs, cos, epsilon, pi, radians, sqrt} from \"../math.js\";\nimport pointEqual from \"../pointEqual.js\";\nimport clip from \"./index.js\";\n\nexport default function(radius) {\n var cr = cos(radius),\n delta = 6 * radians,\n smallRadius = cr > 0,\n notHemisphere = abs(cr) > epsilon; // TODO optimise for this common case\n\n function interpolate(from, to, direction, stream) {\n circleStream(stream, radius, delta, direction, from, to);\n }\n\n function visible(lambda, phi) {\n return cos(lambda) * cos(phi) > cr;\n }\n\n // Takes a line and cuts into visible segments. Return values used for polygon\n // clipping: 0 - there were intersections or the line was empty; 1 - no\n // intersections 2 - there were intersections, and the first and last segments\n // should be rejoined.\n function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }\n\n // Intersects the great circle between a and b with the clip circle.\n function intersect(a, b, two) {\n var pa = cartesian(a),\n pb = cartesian(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = cartesianCross(pa, pb),\n n2n2 = cartesianDot(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = cartesianCross(n1, n2),\n A = cartesianScale(n1, c1),\n B = cartesianScale(n2, c2);\n cartesianAddInPlace(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = cartesianDot(A, u),\n uu = cartesianDot(u, u),\n t2 = w * w - uu * (cartesianDot(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = sqrt(t2),\n q = cartesianScale(u, (-w - t) / uu);\n cartesianAddInPlace(q, A);\n q = spherical(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = abs(delta - pi) < epsilon,\n meridian = polar || delta < epsilon;\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = cartesianScale(u, (-w + t) / uu);\n cartesianAddInPlace(q1, A);\n return [q, spherical(q1)];\n }\n }\n\n // Generates a 4-bit vector representing the location of a point relative to\n // the small circle's bounding box.\n function code(lambda, phi) {\n var r = smallRadius ? radius : pi - radius,\n code = 0;\n if (lambda < -r) code |= 1; // left\n else if (lambda > r) code |= 2; // right\n if (phi < -r) code |= 4; // below\n else if (phi > r) code |= 8; // above\n return code;\n }\n\n return clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);\n}\n","import {degrees, pi, radians} from \"../math.js\";\nimport {projectionMutator} from \"./index.js\";\n\nexport function conicProjection(projectAt) {\n var phi0 = 0,\n phi1 = pi / 3,\n m = projectionMutator(projectAt),\n p = m(phi0, phi1);\n\n p.parallels = function(_) {\n return arguments.length ? m(phi0 = _[0] * radians, phi1 = _[1] * radians) : [phi0 * degrees, phi1 * degrees];\n };\n\n return p;\n}\n","import {abs, asin, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {cylindricalEqualAreaRaw} from \"./cylindricalEqualArea.js\";\n\nexport function conicEqualAreaRaw(y0, y1) {\n var sy0 = sin(y0), n = (sy0 + sin(y1)) / 2;\n\n // Are the parallels symmetrical around the Equator?\n if (abs(n) < epsilon) return cylindricalEqualAreaRaw(y0);\n\n var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c) / n;\n\n function project(x, y) {\n var r = sqrt(c - 2 * n * sin(y)) / n;\n return [r * sin(x *= n), r0 - r * cos(x)];\n }\n\n project.invert = function(x, y) {\n var r0y = r0 - y,\n l = atan2(x, abs(r0y)) * sign(r0y);\n if (r0y * n < 0)\n l -= pi * sign(x) * sign(r0y);\n return [l / n, asin((c - (x * x + r0y * r0y) * n * n) / (2 * n))];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEqualAreaRaw)\n .scale(155.424)\n .center([0, 33.6442]);\n}\n","import {asin, cos, sin} from \"../math.js\";\n\nexport function cylindricalEqualAreaRaw(phi0) {\n var cosPhi0 = cos(phi0);\n\n function forward(lambda, phi) {\n return [lambda * cosPhi0, sin(phi) / cosPhi0];\n }\n\n forward.invert = function(x, y) {\n return [x / cosPhi0, asin(y * cosPhi0)];\n };\n\n return forward;\n}\n","import conicEqualArea from \"./conicEqualArea.js\";\n\nexport default function() {\n return conicEqualArea()\n .parallels([29.5, 45.5])\n .scale(1070)\n .translate([480, 250])\n .rotate([96, 0])\n .center([-0.6, 38.7]);\n}\n","import {asin, atan2, cos, sin, sqrt} from \"../math.js\";\n\nexport function azimuthalRaw(scale) {\n return function(x, y) {\n var cx = cos(x),\n cy = cos(y),\n k = scale(cx * cy);\n if (k === Infinity) return [2, 0];\n return [\n k * cy * sin(x),\n k * sin(y)\n ];\n }\n}\n\nexport function azimuthalInvert(angle) {\n return function(x, y) {\n var z = sqrt(x * x + y * y),\n c = angle(z),\n sc = sin(c),\n cc = cos(c);\n return [\n atan2(x * sc, z * cc),\n asin(z && y * sc / z)\n ];\n }\n}\n","import {asin, sqrt} from \"../math.js\";\nimport {azimuthalRaw, azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport var azimuthalEqualAreaRaw = azimuthalRaw(function(cxcy) {\n return sqrt(2 / (1 + cxcy));\n});\n\nazimuthalEqualAreaRaw.invert = azimuthalInvert(function(z) {\n return 2 * asin(z / 2);\n});\n\nexport default function() {\n return projection(azimuthalEqualAreaRaw)\n .scale(124.75)\n .clipAngle(180 - 1e-3);\n}\n","import {acos, sin} from \"../math.js\";\nimport {azimuthalRaw, azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport var azimuthalEquidistantRaw = azimuthalRaw(function(c) {\n return (c = acos(c)) && c / sin(c);\n});\n\nazimuthalEquidistantRaw.invert = azimuthalInvert(function(z) {\n return z;\n});\n\nexport default function() {\n return projection(azimuthalEquidistantRaw)\n .scale(79.4188)\n .clipAngle(180 - 1e-3);\n}\n","import {atan, exp, halfPi, log, pi, tan, tau} from \"../math.js\";\nimport rotation from \"../rotation.js\";\nimport projection from \"./index.js\";\n\nexport function mercatorRaw(lambda, phi) {\n return [lambda, log(tan((halfPi + phi) / 2))];\n}\n\nmercatorRaw.invert = function(x, y) {\n return [x, 2 * atan(exp(y)) - halfPi];\n};\n\nexport default function() {\n return mercatorProjection(mercatorRaw)\n .scale(961 / tau);\n}\n\nexport function mercatorProjection(project) {\n var m = projection(project),\n center = m.center,\n scale = m.scale,\n translate = m.translate,\n clipExtent = m.clipExtent,\n x0 = null, y0, x1, y1; // clip extent\n\n m.scale = function(_) {\n return arguments.length ? (scale(_), reclip()) : scale();\n };\n\n m.translate = function(_) {\n return arguments.length ? (translate(_), reclip()) : translate();\n };\n\n m.center = function(_) {\n return arguments.length ? (center(_), reclip()) : center();\n };\n\n m.clipExtent = function(_) {\n return arguments.length ? ((_ == null ? x0 = y0 = x1 = y1 = null : (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1])), reclip()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n function reclip() {\n var k = pi * scale(),\n t = m(rotation(m.rotate()).invert([0, 0]));\n return clipExtent(x0 == null\n ? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw\n ? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]]\n : [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]);\n }\n\n return reclip();\n}\n","import {abs, atan, atan2, cos, epsilon, halfPi, log, pi, pow, sign, sin, sqrt, tan} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {mercatorRaw} from \"./mercator.js\";\n\nfunction tany(y) {\n return tan((halfPi + y) / 2);\n}\n\nexport function conicConformalRaw(y0, y1) {\n var cy0 = cos(y0),\n n = y0 === y1 ? sin(y0) : log(cy0 / cos(y1)) / log(tany(y1) / tany(y0)),\n f = cy0 * pow(tany(y0), n) / n;\n\n if (!n) return mercatorRaw;\n\n function project(x, y) {\n if (f > 0) { if (y < -halfPi + epsilon) y = -halfPi + epsilon; }\n else { if (y > halfPi - epsilon) y = halfPi - epsilon; }\n var r = f / pow(tany(y), n);\n return [r * sin(n * x), f - r * cos(n * x)];\n }\n\n project.invert = function(x, y) {\n var fy = f - y, r = sign(n) * sqrt(x * x + fy * fy),\n l = atan2(x, abs(fy)) * sign(fy);\n if (fy * n < 0)\n l -= pi * sign(x) * sign(fy);\n return [l / n, 2 * atan(pow(f / r, 1 / n)) - halfPi];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicConformalRaw)\n .scale(109.5)\n .parallels([30, 30]);\n}\n","import projection from \"./index.js\";\n\nexport function equirectangularRaw(lambda, phi) {\n return [lambda, phi];\n}\n\nequirectangularRaw.invert = equirectangularRaw;\n\nexport default function() {\n return projection(equirectangularRaw)\n .scale(152.63);\n}\n","import {abs, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {equirectangularRaw} from \"./equirectangular.js\";\n\nexport function conicEquidistantRaw(y0, y1) {\n var cy0 = cos(y0),\n n = y0 === y1 ? sin(y0) : (cy0 - cos(y1)) / (y1 - y0),\n g = cy0 / n + y0;\n\n if (abs(n) < epsilon) return equirectangularRaw;\n\n function project(x, y) {\n var gy = g - y, nx = n * x;\n return [gy * sin(nx), g - gy * cos(nx)];\n }\n\n project.invert = function(x, y) {\n var gy = g - y,\n l = atan2(x, abs(gy)) * sign(gy);\n if (gy * n < 0)\n l -= pi * sign(x) * sign(gy);\n return [l / n, g - sign(n) * sqrt(x * x + gy * gy)];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEquidistantRaw)\n .scale(131.154)\n .center([0, 13.9389]);\n}\n","import projection from \"./index.js\";\nimport {abs, asin, cos, epsilon2, sin, sqrt} from \"../math.js\";\n\nvar A1 = 1.340264,\n A2 = -0.081106,\n A3 = 0.000893,\n A4 = 0.003796,\n M = sqrt(3) / 2,\n iterations = 12;\n\nexport function equalEarthRaw(lambda, phi) {\n var l = asin(M * sin(phi)), l2 = l * l, l6 = l2 * l2 * l2;\n return [\n lambda * cos(l) / (M * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2))),\n l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2))\n ];\n}\n\nequalEarthRaw.invert = function(x, y) {\n var l = y, l2 = l * l, l6 = l2 * l2 * l2;\n for (var i = 0, delta, fy, fpy; i < iterations; ++i) {\n fy = l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - y;\n fpy = A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2);\n l -= delta = fy / fpy, l2 = l * l, l6 = l2 * l2 * l2;\n if (abs(delta) < epsilon2) break;\n }\n return [\n M * x * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / cos(l),\n asin(sin(l) / M)\n ];\n};\n\nexport default function() {\n return projection(equalEarthRaw)\n .scale(177.158);\n}\n","import {atan, cos, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function gnomonicRaw(x, y) {\n var cy = cos(y), k = cos(x) * cy;\n return [cy * sin(x) / k, sin(y) / k];\n}\n\ngnomonicRaw.invert = azimuthalInvert(atan);\n\nexport default function() {\n return projection(gnomonicRaw)\n .scale(144.049)\n .clipAngle(60);\n}\n","import projection from \"./index.js\";\nimport {abs, epsilon} from \"../math.js\";\n\nexport function naturalEarth1Raw(lambda, phi) {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n return [\n lambda * (0.8707 - 0.131979 * phi2 + phi4 * (-0.013791 + phi4 * (0.003971 * phi2 - 0.001529 * phi4))),\n phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4)))\n ];\n}\n\nnaturalEarth1Raw.invert = function(x, y) {\n var phi = y, i = 25, delta;\n do {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n phi -= delta = (phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) - y) /\n (1.007226 + phi2 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi2 - 0.005916 * 11 * phi4)));\n } while (abs(delta) > epsilon && --i > 0);\n return [\n x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))),\n phi\n ];\n};\n\nexport default function() {\n return projection(naturalEarth1Raw)\n .scale(175.295);\n}\n","import {asin, cos, epsilon, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function orthographicRaw(x, y) {\n return [cos(y) * sin(x), sin(y)];\n}\n\northographicRaw.invert = azimuthalInvert(asin);\n\nexport default function() {\n return projection(orthographicRaw)\n .scale(249.5)\n .clipAngle(90 + epsilon);\n}\n","import {atan, cos, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function stereographicRaw(x, y) {\n var cy = cos(y), k = 1 + cos(x) * cy;\n return [cy * sin(x) / k, sin(y) / k];\n}\n\nstereographicRaw.invert = azimuthalInvert(function(z) {\n return 2 * atan(z);\n});\n\nexport default function() {\n return projection(stereographicRaw)\n .scale(250)\n .clipAngle(142);\n}\n","import {atan, exp, halfPi, log, tan} from \"../math.js\";\nimport {mercatorProjection} from \"./mercator.js\";\n\nexport function transverseMercatorRaw(lambda, phi) {\n return [log(tan((halfPi + phi) / 2)), -lambda];\n}\n\ntransverseMercatorRaw.invert = function(x, y) {\n return [-y, 2 * atan(exp(x)) - halfPi];\n};\n\nexport default function() {\n var m = mercatorProjection(transverseMercatorRaw),\n center = m.center,\n rotate = m.rotate;\n\n m.center = function(_) {\n return arguments.length ? center([-_[1], _[0]]) : (_ = center(), [_[1], -_[0]]);\n };\n\n m.rotate = function(_) {\n return arguments.length ? rotate([_[0], _[1], _.length > 2 ? _[2] + 90 : 90]) : (_ = rotate(), [_[0], _[1], _[2] - 90]);\n };\n\n return rotate([0, 0, 90])\n .scale(159.155);\n}\n","export var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var ceil = Math.ceil;\nexport var cos = Math.cos;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var log = Math.log;\nexport var max = Math.max;\nexport var min = Math.min;\nexport var pow = Math.pow;\nexport var round = Math.round;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sin = Math.sin;\nexport var tan = Math.tan;\n\nexport var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var sqrt1_2 = Math.SQRT1_2;\nexport var sqrt2 = sqrt(2);\nexport var sqrtPi = sqrt(pi);\nexport var tau = pi * 2;\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport function sinci(x) {\n return x ? x / Math.sin(x) : 1;\n}\n\nexport function asin(x) {\n return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);\n}\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function sqrt(x) {\n return x > 0 ? Math.sqrt(x) : 0;\n}\n\nexport function tanh(x) {\n x = exp(2 * x);\n return (x - 1) / (x + 1);\n}\n\nexport function sinh(x) {\n return (exp(x) - exp(-x)) / 2;\n}\n\nexport function cosh(x) {\n return (exp(x) + exp(-x)) / 2;\n}\n\nexport function arsinh(x) {\n return log(x + sqrt(x * x + 1));\n}\n\nexport function arcosh(x) {\n return log(x + sqrt(x * x - 1));\n}\n","import {geoProjection as projection} from \"d3-geo\";\nimport {abs, asin, cos, epsilon, halfPi, pi, sin, sqrt2} from \"./math.js\";\n\nexport function mollweideBromleyTheta(cp, phi) {\n var cpsinPhi = cp * sin(phi), i = 30, delta;\n do phi -= delta = (phi + sin(phi) - cpsinPhi) / (1 + cos(phi));\n while (abs(delta) > epsilon && --i > 0);\n return phi / 2;\n}\n\nexport function mollweideBromleyRaw(cx, cy, cp) {\n\n function forward(lambda, phi) {\n return [cx * lambda * cos(phi = mollweideBromleyTheta(cp, phi)), cy * sin(phi)];\n }\n\n forward.invert = function(x, y) {\n return y = asin(y / cy), [x / (cx * cos(y)), asin((2 * y + sin(2 * y)) / cp)];\n };\n\n return forward;\n}\n\nexport var mollweideRaw = mollweideBromleyRaw(sqrt2 / halfPi, sqrt2, pi);\n\nexport default function() {\n return projection(mollweideRaw)\n .scale(169.529);\n}\n","import { geoPath, geoAlbers, geoAlbersUsa, geoAzimuthalEqualArea, geoAzimuthalEquidistant, geoConicConformal, geoConicEqualArea, geoConicEquidistant, geoEqualEarth, geoEquirectangular, geoGnomonic, geoIdentity, geoMercator, geoNaturalEarth1, geoOrthographic, geoStereographic, geoTransverseMercator } from 'd3-geo';\nimport { geoMollweide } from 'd3-geo-projection';\nimport { registerScale } from 'vega-scale';\n\nconst defaultPath = geoPath();\nconst projectionProperties = [\n// standard properties in d3-geo\n'clipAngle', 'clipExtent', 'scale', 'translate', 'center', 'rotate', 'parallels', 'precision', 'reflectX', 'reflectY',\n// extended properties in d3-geo-projections\n'coefficient', 'distance', 'fraction', 'lobes', 'parallel', 'radius', 'ratio', 'spacing', 'tilt'];\n\n/**\n * Augment projections with their type and a copy method.\n */\nfunction create(type, constructor) {\n return function projection() {\n const p = constructor();\n p.type = type;\n p.path = geoPath().projection(p);\n p.copy = p.copy || function () {\n const c = projection();\n projectionProperties.forEach(prop => {\n if (p[prop]) c[prop](p[prop]());\n });\n c.path.pointRadius(p.path.pointRadius());\n return c;\n };\n return registerScale(p);\n };\n}\nfunction projection(type, proj) {\n if (!type || typeof type !== 'string') {\n throw new Error('Projection type must be a name string.');\n }\n type = type.toLowerCase();\n if (arguments.length > 1) {\n projections[type] = create(type, proj);\n return this;\n } else {\n return projections[type] || null;\n }\n}\nfunction getProjectionPath(proj) {\n return proj && proj.path || defaultPath;\n}\nconst projections = {\n // base d3-geo projection types\n albers: geoAlbers,\n albersusa: geoAlbersUsa,\n azimuthalequalarea: geoAzimuthalEqualArea,\n azimuthalequidistant: geoAzimuthalEquidistant,\n conicconformal: geoConicConformal,\n conicequalarea: geoConicEqualArea,\n conicequidistant: geoConicEquidistant,\n equalEarth: geoEqualEarth,\n equirectangular: geoEquirectangular,\n gnomonic: geoGnomonic,\n identity: geoIdentity,\n mercator: geoMercator,\n mollweide: geoMollweide,\n naturalEarth1: geoNaturalEarth1,\n orthographic: geoOrthographic,\n stereographic: geoStereographic,\n transversemercator: geoTransverseMercator\n};\nfor (const key in projections) {\n projection(key, projections[key]);\n}\n\nexport { getProjectionPath, projection, projectionProperties };\n","import {epsilon} from \"../math.js\";\nimport albers from \"./albers.js\";\nimport conicEqualArea from \"./conicEqualArea.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\n\n// The projections must have mutually exclusive clip regions on the sphere,\n// as this will avoid emitting interleaving lines and polygons.\nfunction multiplex(streams) {\n var n = streams.length;\n return {\n point: function(x, y) { var i = -1; while (++i < n) streams[i].point(x, y); },\n sphere: function() { var i = -1; while (++i < n) streams[i].sphere(); },\n lineStart: function() { var i = -1; while (++i < n) streams[i].lineStart(); },\n lineEnd: function() { var i = -1; while (++i < n) streams[i].lineEnd(); },\n polygonStart: function() { var i = -1; while (++i < n) streams[i].polygonStart(); },\n polygonEnd: function() { var i = -1; while (++i < n) streams[i].polygonEnd(); }\n };\n}\n\n// A composite projection for the United States, configured by default for\n// 960×500. The projection also works quite well at 960×600 if you change the\n// scale to 1285 and adjust the translate accordingly. The set of standard\n// parallels for each region comes from USGS, which is published here:\n// http://egsc.usgs.gov/isb/pubs/MapProjections/projections.html#albers\nexport default function() {\n var cache,\n cacheStream,\n lower48 = albers(), lower48Point,\n alaska = conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338\n hawaii = conicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), hawaiiPoint, // ESRI:102007\n point, pointStream = {point: function(x, y) { point = [x, y]; }};\n\n function albersUsa(coordinates) {\n var x = coordinates[0], y = coordinates[1];\n return point = null,\n (lower48Point.point(x, y), point)\n || (alaskaPoint.point(x, y), point)\n || (hawaiiPoint.point(x, y), point);\n }\n\n albersUsa.invert = function(coordinates) {\n var k = lower48.scale(),\n t = lower48.translate(),\n x = (coordinates[0] - t[0]) / k,\n y = (coordinates[1] - t[1]) / k;\n return (y >= 0.120 && y < 0.234 && x >= -0.425 && x < -0.214 ? alaska\n : y >= 0.166 && y < 0.234 && x >= -0.214 && x < -0.115 ? hawaii\n : lower48).invert(coordinates);\n };\n\n albersUsa.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = multiplex([lower48.stream(cacheStream = stream), alaska.stream(stream), hawaii.stream(stream)]);\n };\n\n albersUsa.precision = function(_) {\n if (!arguments.length) return lower48.precision();\n lower48.precision(_), alaska.precision(_), hawaii.precision(_);\n return reset();\n };\n\n albersUsa.scale = function(_) {\n if (!arguments.length) return lower48.scale();\n lower48.scale(_), alaska.scale(_ * 0.35), hawaii.scale(_);\n return albersUsa.translate(lower48.translate());\n };\n\n albersUsa.translate = function(_) {\n if (!arguments.length) return lower48.translate();\n var k = lower48.scale(), x = +_[0], y = +_[1];\n\n lower48Point = lower48\n .translate(_)\n .clipExtent([[x - 0.455 * k, y - 0.238 * k], [x + 0.455 * k, y + 0.238 * k]])\n .stream(pointStream);\n\n alaskaPoint = alaska\n .translate([x - 0.307 * k, y + 0.201 * k])\n .clipExtent([[x - 0.425 * k + epsilon, y + 0.120 * k + epsilon], [x - 0.214 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n hawaiiPoint = hawaii\n .translate([x - 0.205 * k, y + 0.212 * k])\n .clipExtent([[x - 0.214 * k + epsilon, y + 0.166 * k + epsilon], [x - 0.115 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n return reset();\n };\n\n albersUsa.fitExtent = function(extent, object) {\n return fitExtent(albersUsa, extent, object);\n };\n\n albersUsa.fitSize = function(size, object) {\n return fitSize(albersUsa, size, object);\n };\n\n albersUsa.fitWidth = function(width, object) {\n return fitWidth(albersUsa, width, object);\n };\n\n albersUsa.fitHeight = function(height, object) {\n return fitHeight(albersUsa, height, object);\n };\n\n function reset() {\n cache = cacheStream = null;\n return albersUsa;\n }\n\n return albersUsa.scale(1070);\n}\n","import clipRectangle from \"../clip/rectangle.js\";\nimport identity from \"../identity.js\";\nimport {transformer} from \"../transform.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\nimport {cos, degrees, radians, sin} from \"../math.js\";\n\nexport default function() {\n var k = 1, tx = 0, ty = 0, sx = 1, sy = 1, // scale, translate and reflect\n alpha = 0, ca, sa, // angle\n x0 = null, y0, x1, y1, // clip extent\n kx = 1, ky = 1,\n transform = transformer({\n point: function(x, y) {\n var p = projection([x, y])\n this.stream.point(p[0], p[1]);\n }\n }),\n postclip = identity,\n cache,\n cacheStream;\n\n function reset() {\n kx = k * sx;\n ky = k * sy;\n cache = cacheStream = null;\n return projection;\n }\n\n function projection (p) {\n var x = p[0] * kx, y = p[1] * ky;\n if (alpha) {\n var t = y * ca - x * sa;\n x = x * ca + y * sa;\n y = t;\n } \n return [x + tx, y + ty];\n }\n projection.invert = function(p) {\n var x = p[0] - tx, y = p[1] - ty;\n if (alpha) {\n var t = y * ca + x * sa;\n x = x * ca - y * sa;\n y = t;\n }\n return [x / kx, y / ky];\n };\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transform(postclip(cacheStream = stream));\n };\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\n };\n projection.clipExtent = function(_) {\n return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n projection.scale = function(_) {\n return arguments.length ? (k = +_, reset()) : k;\n };\n projection.translate = function(_) {\n return arguments.length ? (tx = +_[0], ty = +_[1], reset()) : [tx, ty];\n }\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, sa = sin(alpha), ca = cos(alpha), reset()) : alpha * degrees;\n };\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, reset()) : sx < 0;\n };\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, reset()) : sy < 0;\n };\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n return projection;\n}\n","import {range} from \"d3-array\";\nimport {abs, ceil, epsilon} from \"./math.js\";\n\nfunction graticuleX(y0, y1, dy) {\n var y = range(y0, y1 - epsilon, dy).concat(y1);\n return function(x) { return y.map(function(y) { return [x, y]; }); };\n}\n\nfunction graticuleY(x0, x1, dx) {\n var x = range(x0, x1 - epsilon, dx).concat(x1);\n return function(y) { return x.map(function(x) { return [x, y]; }); };\n}\n\nexport default function graticule() {\n var x1, x0, X1, X0,\n y1, y0, Y1, Y0,\n dx = 10, dy = dx, DX = 90, DY = 360,\n x, y, X, Y,\n precision = 2.5;\n\n function graticule() {\n return {type: \"MultiLineString\", coordinates: lines()};\n }\n\n function lines() {\n return range(ceil(X0 / DX) * DX, X1, DX).map(X)\n .concat(range(ceil(Y0 / DY) * DY, Y1, DY).map(Y))\n .concat(range(ceil(x0 / dx) * dx, x1, dx).filter(function(x) { return abs(x % DX) > epsilon; }).map(x))\n .concat(range(ceil(y0 / dy) * dy, y1, dy).filter(function(y) { return abs(y % DY) > epsilon; }).map(y));\n }\n\n graticule.lines = function() {\n return lines().map(function(coordinates) { return {type: \"LineString\", coordinates: coordinates}; });\n };\n\n graticule.outline = function() {\n return {\n type: \"Polygon\",\n coordinates: [\n X(X0).concat(\n Y(Y1).slice(1),\n X(X1).reverse().slice(1),\n Y(Y0).reverse().slice(1))\n ]\n };\n };\n\n graticule.extent = function(_) {\n if (!arguments.length) return graticule.extentMinor();\n return graticule.extentMajor(_).extentMinor(_);\n };\n\n graticule.extentMajor = function(_) {\n if (!arguments.length) return [[X0, Y0], [X1, Y1]];\n X0 = +_[0][0], X1 = +_[1][0];\n Y0 = +_[0][1], Y1 = +_[1][1];\n if (X0 > X1) _ = X0, X0 = X1, X1 = _;\n if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.extentMinor = function(_) {\n if (!arguments.length) return [[x0, y0], [x1, y1]];\n x0 = +_[0][0], x1 = +_[1][0];\n y0 = +_[0][1], y1 = +_[1][1];\n if (x0 > x1) _ = x0, x0 = x1, x1 = _;\n if (y0 > y1) _ = y0, y0 = y1, y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.step = function(_) {\n if (!arguments.length) return graticule.stepMinor();\n return graticule.stepMajor(_).stepMinor(_);\n };\n\n graticule.stepMajor = function(_) {\n if (!arguments.length) return [DX, DY];\n DX = +_[0], DY = +_[1];\n return graticule;\n };\n\n graticule.stepMinor = function(_) {\n if (!arguments.length) return [dx, dy];\n dx = +_[0], dy = +_[1];\n return graticule;\n };\n\n graticule.precision = function(_) {\n if (!arguments.length) return precision;\n precision = +_;\n x = graticuleX(y0, y1, 90);\n y = graticuleY(x0, x1, precision);\n X = graticuleX(Y0, Y1, 90);\n Y = graticuleY(X0, X1, precision);\n return graticule;\n };\n\n return graticule\n .extentMajor([[-180, -90 + epsilon], [180, 90 - epsilon]])\n .extentMinor([[-180, -80 - epsilon], [180, 80 + epsilon]]);\n}\n\nexport function graticule10() {\n return graticule()();\n}\n","import { Transform, rederive, ingest, replace } from 'vega-dataflow';\nimport { error, extent, inherits, identity, isArray, isFunction, isNumber, array, constant, one, accessorName, accessorFields, field, extend, toSet, zero } from 'vega-util';\nimport { tickStep, range, max, sum } from 'd3-array';\nimport { bandwidthNRD } from 'vega-statistics';\nimport { getProjectionPath, projectionProperties, projection } from 'vega-projection';\nimport { geoGraticule } from 'd3-geo';\nimport { rgb } from 'd3-color';\nimport { canvas } from 'vega-canvas';\n\nfunction noop() {}\nconst cases = [[], [[[1.0, 1.5], [0.5, 1.0]]], [[[1.5, 1.0], [1.0, 1.5]]], [[[1.5, 1.0], [0.5, 1.0]]], [[[1.0, 0.5], [1.5, 1.0]]], [[[1.0, 1.5], [0.5, 1.0]], [[1.0, 0.5], [1.5, 1.0]]], [[[1.0, 0.5], [1.0, 1.5]]], [[[1.0, 0.5], [0.5, 1.0]]], [[[0.5, 1.0], [1.0, 0.5]]], [[[1.0, 1.5], [1.0, 0.5]]], [[[0.5, 1.0], [1.0, 0.5]], [[1.5, 1.0], [1.0, 1.5]]], [[[1.5, 1.0], [1.0, 0.5]]], [[[0.5, 1.0], [1.5, 1.0]]], [[[1.0, 1.5], [1.5, 1.0]]], [[[0.5, 1.0], [1.0, 1.5]]], []];\n\n// Implementation adapted from d3/d3-contour. Thanks!\nfunction contours () {\n var dx = 1,\n dy = 1,\n smooth = smoothLinear;\n function contours(values, tz) {\n return tz.map(value => contour(values, value));\n }\n\n // Accumulate, smooth contour rings, assign holes to exterior rings.\n // Based on https://github.com/mbostock/shapefile/blob/v0.6.2/shp/polygon.js\n function contour(values, value) {\n var polygons = [],\n holes = [];\n isorings(values, value, ring => {\n smooth(ring, values, value);\n if (area(ring) > 0) polygons.push([ring]);else holes.push(ring);\n });\n holes.forEach(hole => {\n for (var i = 0, n = polygons.length, polygon; i < n; ++i) {\n if (contains((polygon = polygons[i])[0], hole) !== -1) {\n polygon.push(hole);\n return;\n }\n }\n });\n return {\n type: 'MultiPolygon',\n value: value,\n coordinates: polygons\n };\n }\n\n // Marching squares with isolines stitched into rings.\n // Based on https://github.com/topojson/topojson-client/blob/v3.0.0/src/stitch.js\n function isorings(values, value, callback) {\n var fragmentByStart = [],\n fragmentByEnd = [],\n x,\n y,\n t0,\n t1,\n t2,\n t3;\n\n // Special case for the first row (y = -1, t2 = t3 = 0).\n x = y = -1;\n t1 = values[0] >= value;\n cases[t1 << 1].forEach(stitch);\n while (++x < dx - 1) {\n t0 = t1, t1 = values[x + 1] >= value;\n cases[t0 | t1 << 1].forEach(stitch);\n }\n cases[t1 << 0].forEach(stitch);\n\n // General case for the intermediate rows.\n while (++y < dy - 1) {\n x = -1;\n t1 = values[y * dx + dx] >= value;\n t2 = values[y * dx] >= value;\n cases[t1 << 1 | t2 << 2].forEach(stitch);\n while (++x < dx - 1) {\n t0 = t1, t1 = values[y * dx + dx + x + 1] >= value;\n t3 = t2, t2 = values[y * dx + x + 1] >= value;\n cases[t0 | t1 << 1 | t2 << 2 | t3 << 3].forEach(stitch);\n }\n cases[t1 | t2 << 3].forEach(stitch);\n }\n\n // Special case for the last row (y = dy - 1, t0 = t1 = 0).\n x = -1;\n t2 = values[y * dx] >= value;\n cases[t2 << 2].forEach(stitch);\n while (++x < dx - 1) {\n t3 = t2, t2 = values[y * dx + x + 1] >= value;\n cases[t2 << 2 | t3 << 3].forEach(stitch);\n }\n cases[t2 << 3].forEach(stitch);\n function stitch(line) {\n var start = [line[0][0] + x, line[0][1] + y],\n end = [line[1][0] + x, line[1][1] + y],\n startIndex = index(start),\n endIndex = index(end),\n f,\n g;\n if (f = fragmentByEnd[startIndex]) {\n if (g = fragmentByStart[endIndex]) {\n delete fragmentByEnd[f.end];\n delete fragmentByStart[g.start];\n if (f === g) {\n f.ring.push(end);\n callback(f.ring);\n } else {\n fragmentByStart[f.start] = fragmentByEnd[g.end] = {\n start: f.start,\n end: g.end,\n ring: f.ring.concat(g.ring)\n };\n }\n } else {\n delete fragmentByEnd[f.end];\n f.ring.push(end);\n fragmentByEnd[f.end = endIndex] = f;\n }\n } else if (f = fragmentByStart[endIndex]) {\n if (g = fragmentByEnd[startIndex]) {\n delete fragmentByStart[f.start];\n delete fragmentByEnd[g.end];\n if (f === g) {\n f.ring.push(end);\n callback(f.ring);\n } else {\n fragmentByStart[g.start] = fragmentByEnd[f.end] = {\n start: g.start,\n end: f.end,\n ring: g.ring.concat(f.ring)\n };\n }\n } else {\n delete fragmentByStart[f.start];\n f.ring.unshift(start);\n fragmentByStart[f.start = startIndex] = f;\n }\n } else {\n fragmentByStart[startIndex] = fragmentByEnd[endIndex] = {\n start: startIndex,\n end: endIndex,\n ring: [start, end]\n };\n }\n }\n }\n function index(point) {\n return point[0] * 2 + point[1] * (dx + 1) * 4;\n }\n function smoothLinear(ring, values, value) {\n ring.forEach(point => {\n var x = point[0],\n y = point[1],\n xt = x | 0,\n yt = y | 0,\n v0,\n v1 = values[yt * dx + xt];\n if (x > 0 && x < dx && xt === x) {\n v0 = values[yt * dx + xt - 1];\n point[0] = x + (value - v0) / (v1 - v0) - 0.5;\n }\n if (y > 0 && y < dy && yt === y) {\n v0 = values[(yt - 1) * dx + xt];\n point[1] = y + (value - v0) / (v1 - v0) - 0.5;\n }\n });\n }\n contours.contour = contour;\n contours.size = function (_) {\n if (!arguments.length) return [dx, dy];\n var _0 = Math.floor(_[0]),\n _1 = Math.floor(_[1]);\n if (!(_0 >= 0 && _1 >= 0)) error('invalid size');\n return dx = _0, dy = _1, contours;\n };\n contours.smooth = function (_) {\n return arguments.length ? (smooth = _ ? smoothLinear : noop, contours) : smooth === smoothLinear;\n };\n return contours;\n}\nfunction area(ring) {\n var i = 0,\n n = ring.length,\n area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1];\n while (++i < n) area += ring[i - 1][1] * ring[i][0] - ring[i - 1][0] * ring[i][1];\n return area;\n}\nfunction contains(ring, hole) {\n var i = -1,\n n = hole.length,\n c;\n while (++i < n) if (c = ringContains(ring, hole[i])) return c;\n return 0;\n}\nfunction ringContains(ring, point) {\n var x = point[0],\n y = point[1],\n contains = -1;\n for (var i = 0, n = ring.length, j = n - 1; i < n; j = i++) {\n var pi = ring[i],\n xi = pi[0],\n yi = pi[1],\n pj = ring[j],\n xj = pj[0],\n yj = pj[1];\n if (segmentContains(pi, pj, point)) return 0;\n if (yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi) contains = -contains;\n }\n return contains;\n}\nfunction segmentContains(a, b, c) {\n var i;\n return collinear(a, b, c) && within(a[i = +(a[0] === b[0])], c[i], b[i]);\n}\nfunction collinear(a, b, c) {\n return (b[0] - a[0]) * (c[1] - a[1]) === (c[0] - a[0]) * (b[1] - a[1]);\n}\nfunction within(p, q, r) {\n return p <= q && q <= r || r <= q && q <= p;\n}\n\nfunction quantize (k, nice, zero) {\n return function (values) {\n var ex = extent(values),\n start = zero ? Math.min(ex[0], 0) : ex[0],\n stop = ex[1],\n span = stop - start,\n step = nice ? tickStep(start, stop, k) : span / (k + 1);\n return range(start + step, stop, step);\n };\n}\n\n/**\n * Generate isocontours (level sets) based on input raster grid data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} [params.field] - The field with raster grid\n * data. If unspecified, the tuple itself is interpreted as a raster grid.\n * @param {Array} [params.thresholds] - Contour threshold array. If\n * specified, the levels, nice, resolve, and zero parameters are ignored.\n * @param {number} [params.levels] - The desired number of contour levels.\n * @param {boolean} [params.nice] - Boolean flag indicating if the contour\n * threshold values should be automatically aligned to \"nice\"\n * human-friendly values. Setting this flag may cause the number of\n * thresholds to deviate from the specified levels.\n * @param {string} [params.resolve] - The method for resolving thresholds\n * across multiple input grids. If 'independent' (the default), threshold\n * calculation will be performed separately for each grid. If 'shared', a\n * single set of threshold values will be used for all input grids.\n * @param {boolean} [params.zero] - Boolean flag indicating if the contour\n * threshold values should include zero.\n * @param {boolean} [params.smooth] - Boolean flag indicating if the contour\n * polygons should be smoothed using linear interpolation. The default is\n * true. The parameter is ignored when using density estimation.\n * @param {boolean} [params.scale] - Optional numerical value by which to\n * scale the output isocontour coordinates. This parameter can be useful\n * to scale the contours to match a desired output resolution.\n * @param {string} [params.as='contour'] - The output field in which to store\n * the generated isocontour data (default 'contour').\n */\nfunction Isocontour(params) {\n Transform.call(this, null, params);\n}\nIsocontour.Definition = {\n 'type': 'Isocontour',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'thresholds',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'levels',\n 'type': 'number'\n }, {\n 'name': 'nice',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'resolve',\n 'type': 'enum',\n 'values': ['shared', 'independent'],\n 'default': 'independent'\n }, {\n 'name': 'zero',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'smooth',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'scale',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'translate',\n 'type': 'number',\n 'array': true,\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'null': true,\n 'default': 'contour'\n }]\n};\ninherits(Isocontour, Transform, {\n transform(_, pulse) {\n if (this.value && !pulse.changed() && !_.modified()) {\n return pulse.StopPropagation;\n }\n var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n source = pulse.materialize(pulse.SOURCE).source,\n field = _.field || identity,\n contour = contours().smooth(_.smooth !== false),\n tz = _.thresholds || levels(source, field, _),\n as = _.as === null ? null : _.as || 'contour',\n values = [];\n source.forEach(t => {\n const grid = field(t);\n\n // generate contour paths in GeoJSON format\n const paths = contour.size([grid.width, grid.height])(grid.values, isArray(tz) ? tz : tz(grid.values));\n\n // adjust contour path coordinates as needed\n transformPaths(paths, grid, t, _);\n\n // ingest; copy source data properties to output\n paths.forEach(p => {\n values.push(rederive(t, ingest(as != null ? {\n [as]: p\n } : p)));\n });\n });\n if (this.value) out.rem = this.value;\n this.value = out.source = out.add = values;\n return out;\n }\n});\nfunction levels(values, f, _) {\n const q = quantize(_.levels || 10, _.nice, _.zero !== false);\n return _.resolve !== 'shared' ? q : q(values.map(t => max(f(t).values)));\n}\nfunction transformPaths(paths, grid, datum, _) {\n let s = _.scale || grid.scale,\n t = _.translate || grid.translate;\n if (isFunction(s)) s = s(datum, _);\n if (isFunction(t)) t = t(datum, _);\n if ((s === 1 || s == null) && !t) return;\n const sx = (isNumber(s) ? s : s[0]) || 1,\n sy = (isNumber(s) ? s : s[1]) || 1,\n tx = t && t[0] || 0,\n ty = t && t[1] || 0;\n paths.forEach(transform(grid, sx, sy, tx, ty));\n}\nfunction transform(grid, sx, sy, tx, ty) {\n const x1 = grid.x1 || 0,\n y1 = grid.y1 || 0,\n flip = sx * sy < 0;\n function transformPolygon(coordinates) {\n coordinates.forEach(transformRing);\n }\n function transformRing(coordinates) {\n if (flip) coordinates.reverse(); // maintain winding order\n coordinates.forEach(transformPoint);\n }\n function transformPoint(coordinates) {\n coordinates[0] = (coordinates[0] - x1) * sx + tx;\n coordinates[1] = (coordinates[1] - y1) * sy + ty;\n }\n return function (geometry) {\n geometry.coordinates.forEach(transformPolygon);\n return geometry;\n };\n}\n\nfunction radius(bw, data, f) {\n const v = bw >= 0 ? bw : bandwidthNRD(data, f);\n return Math.round((Math.sqrt(4 * v * v + 1) - 1) / 2);\n}\nfunction number(_) {\n return isFunction(_) ? _ : constant(+_);\n}\n\n// Implementation adapted from d3/d3-contour. Thanks!\nfunction density2D () {\n var x = d => d[0],\n y = d => d[1],\n weight = one,\n bandwidth = [-1, -1],\n dx = 960,\n dy = 500,\n k = 2; // log2(cellSize)\n\n function density(data, counts) {\n const rx = radius(bandwidth[0], data, x) >> k,\n // blur x-radius\n ry = radius(bandwidth[1], data, y) >> k,\n // blur y-radius\n ox = rx ? rx + 2 : 0,\n // x-offset padding for blur\n oy = ry ? ry + 2 : 0,\n // y-offset padding for blur\n n = 2 * ox + (dx >> k),\n // grid width\n m = 2 * oy + (dy >> k),\n // grid height\n values0 = new Float32Array(n * m),\n values1 = new Float32Array(n * m);\n let values = values0;\n data.forEach(d => {\n const xi = ox + (+x(d) >> k),\n yi = oy + (+y(d) >> k);\n if (xi >= 0 && xi < n && yi >= 0 && yi < m) {\n values0[xi + yi * n] += +weight(d);\n }\n });\n if (rx > 0 && ry > 0) {\n blurX(n, m, values0, values1, rx);\n blurY(n, m, values1, values0, ry);\n blurX(n, m, values0, values1, rx);\n blurY(n, m, values1, values0, ry);\n blurX(n, m, values0, values1, rx);\n blurY(n, m, values1, values0, ry);\n } else if (rx > 0) {\n blurX(n, m, values0, values1, rx);\n blurX(n, m, values1, values0, rx);\n blurX(n, m, values0, values1, rx);\n values = values1;\n } else if (ry > 0) {\n blurY(n, m, values0, values1, ry);\n blurY(n, m, values1, values0, ry);\n blurY(n, m, values0, values1, ry);\n values = values1;\n }\n\n // scale density estimates\n // density in points per square pixel or probability density\n const s = counts ? Math.pow(2, -2 * k) : 1 / sum(values);\n for (let i = 0, sz = n * m; i < sz; ++i) values[i] *= s;\n return {\n values: values,\n scale: 1 << k,\n width: n,\n height: m,\n x1: ox,\n y1: oy,\n x2: ox + (dx >> k),\n y2: oy + (dy >> k)\n };\n }\n density.x = function (_) {\n return arguments.length ? (x = number(_), density) : x;\n };\n density.y = function (_) {\n return arguments.length ? (y = number(_), density) : y;\n };\n density.weight = function (_) {\n return arguments.length ? (weight = number(_), density) : weight;\n };\n density.size = function (_) {\n if (!arguments.length) return [dx, dy];\n var _0 = +_[0],\n _1 = +_[1];\n if (!(_0 >= 0 && _1 >= 0)) error('invalid size');\n return dx = _0, dy = _1, density;\n };\n density.cellSize = function (_) {\n if (!arguments.length) return 1 << k;\n if (!((_ = +_) >= 1)) error('invalid cell size');\n k = Math.floor(Math.log(_) / Math.LN2);\n return density;\n };\n density.bandwidth = function (_) {\n if (!arguments.length) return bandwidth;\n _ = array(_);\n if (_.length === 1) _ = [+_[0], +_[0]];\n if (_.length !== 2) error('invalid bandwidth');\n return bandwidth = _, density;\n };\n return density;\n}\nfunction blurX(n, m, source, target, r) {\n const w = (r << 1) + 1;\n for (let j = 0; j < m; ++j) {\n for (let i = 0, sr = 0; i < n + r; ++i) {\n if (i < n) {\n sr += source[i + j * n];\n }\n if (i >= r) {\n if (i >= w) {\n sr -= source[i - w + j * n];\n }\n target[i - r + j * n] = sr / Math.min(i + 1, n - 1 + w - i, w);\n }\n }\n }\n}\nfunction blurY(n, m, source, target, r) {\n const w = (r << 1) + 1;\n for (let i = 0; i < n; ++i) {\n for (let j = 0, sr = 0; j < m + r; ++j) {\n if (j < m) {\n sr += source[i + j * n];\n }\n if (j >= r) {\n if (j >= w) {\n sr -= source[i + (j - w) * n];\n }\n target[i + (j - r) * n] = sr / Math.min(j + 1, m - 1 + w - j, w);\n }\n }\n }\n}\n\n/**\n * Perform 2D kernel-density estimation of point data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.size - The [width, height] extent (in\n * units of input pixels) over which to perform density estimation.\n * @param {function(object): number} params.x - The x-coordinate accessor.\n * @param {function(object): number} params.y - The y-coordinate accessor.\n * @param {function(object): number} [params.weight] - The weight accessor.\n * @param {Array} [params.groupby] - An array of accessors\n * to groupby.\n * @param {number} [params.cellSize] - Contour density calculation cell size.\n * This parameter determines the level of spatial approximation. For example,\n * the default value of 4 maps to 2x reductions in both x- and y- dimensions.\n * A value of 1 will result in an output raster grid whose dimensions exactly\n * matches the size parameter.\n * @param {Array} [params.bandwidth] - The KDE kernel bandwidths,\n * in pixels. The input can be a two-element array specifying separate\n * x and y bandwidths, or a single-element array specifying both. If the\n * bandwidth is unspecified or less than zero, the bandwidth will be\n * automatically determined.\n * @param {boolean} [params.counts=false] - A boolean flag indicating if the\n * output values should be probability estimates (false, default) or\n * smoothed counts (true).\n * @param {string} [params.as='grid'] - The output field in which to store\n * the generated raster grid (default 'grid').\n */\nfunction KDE2D(params) {\n Transform.call(this, null, params);\n}\nKDE2D.Definition = {\n 'type': 'KDE2D',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'required': true\n }, {\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'weight',\n 'type': 'field'\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'cellSize',\n 'type': 'number'\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'counts',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'grid'\n }]\n};\nconst PARAMS = ['x', 'y', 'weight', 'size', 'cellSize', 'bandwidth'];\nfunction params(obj, _) {\n PARAMS.forEach(param => _[param] != null ? obj[param](_[param]) : 0);\n return obj;\n}\ninherits(KDE2D, Transform, {\n transform(_, pulse) {\n if (this.value && !pulse.changed() && !_.modified()) return pulse.StopPropagation;\n var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n source = pulse.materialize(pulse.SOURCE).source,\n groups = partition(source, _.groupby),\n names = (_.groupby || []).map(accessorName),\n kde = params(density2D(), _),\n as = _.as || 'grid',\n values = [];\n function set(t, vals) {\n for (let i = 0; i < names.length; ++i) t[names[i]] = vals[i];\n return t;\n }\n\n // generate density raster grids\n values = groups.map(g => ingest(set({\n [as]: kde(g, _.counts)\n }, g.dims)));\n if (this.value) out.rem = this.value;\n this.value = out.source = out.add = values;\n return out;\n }\n});\nfunction partition(data, groupby) {\n var groups = [],\n get = f => f(t),\n map,\n i,\n n,\n t,\n k,\n g;\n\n // partition data points into groups\n if (groupby == null) {\n groups.push(data);\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n if (!g) {\n map[k] = g = [];\n g.dims = k;\n groups.push(g);\n }\n g.push(t);\n }\n }\n return groups;\n}\n\n/**\n * Generate contours based on kernel-density estimation of point data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.size - The dimensions [width, height] over which to compute contours.\n * If the values parameter is provided, this must be the dimensions of the input data.\n * If density estimation is performed, this is the output view dimensions in pixels.\n * @param {Array} [params.values] - An array of numeric values representing an\n * width x height grid of values over which to compute contours. If unspecified, this\n * transform will instead attempt to compute contours for the kernel density estimate\n * using values drawn from data tuples in the input pulse.\n * @param {function(object): number} [params.x] - The pixel x-coordinate accessor for density estimation.\n * @param {function(object): number} [params.y] - The pixel y-coordinate accessor for density estimation.\n * @param {function(object): number} [params.weight] - The data point weight accessor for density estimation.\n * @param {number} [params.cellSize] - Contour density calculation cell size.\n * @param {number} [params.bandwidth] - Kernel density estimation bandwidth.\n * @param {Array} [params.thresholds] - Contour threshold array. If\n * this parameter is set, the count and nice parameters will be ignored.\n * @param {number} [params.count] - The desired number of contours.\n * @param {boolean} [params.nice] - Boolean flag indicating if the contour\n * threshold values should be automatically aligned to \"nice\"\n * human-friendly values. Setting this flag may cause the number of\n * thresholds to deviate from the specified count.\n * @param {boolean} [params.smooth] - Boolean flag indicating if the contour\n * polygons should be smoothed using linear interpolation. The default is\n * true. The parameter is ignored when using density estimation.\n */\nfunction Contour(params) {\n Transform.call(this, null, params);\n}\nContour.Definition = {\n 'type': 'Contour',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'required': true\n }, {\n 'name': 'values',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'x',\n 'type': 'field'\n }, {\n 'name': 'y',\n 'type': 'field'\n }, {\n 'name': 'weight',\n 'type': 'field'\n }, {\n 'name': 'cellSize',\n 'type': 'number'\n }, {\n 'name': 'bandwidth',\n 'type': 'number'\n }, {\n 'name': 'count',\n 'type': 'number'\n }, {\n 'name': 'nice',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'thresholds',\n 'type': 'number',\n 'array': true\n }, {\n 'name': 'smooth',\n 'type': 'boolean',\n 'default': true\n }]\n};\ninherits(Contour, Transform, {\n transform(_, pulse) {\n if (this.value && !pulse.changed() && !_.modified()) {\n return pulse.StopPropagation;\n }\n var out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS),\n contour = contours().smooth(_.smooth !== false),\n values = _.values,\n thresh = _.thresholds || quantize(_.count || 10, _.nice, !!values),\n size = _.size,\n grid,\n post;\n if (!values) {\n values = pulse.materialize(pulse.SOURCE).source;\n grid = params(density2D(), _)(values, true);\n post = transform(grid, grid.scale || 1, grid.scale || 1, 0, 0);\n size = [grid.width, grid.height];\n values = grid.values;\n }\n thresh = isArray(thresh) ? thresh : thresh(values);\n values = contour.size(size)(values, thresh);\n if (post) values.forEach(post);\n if (this.value) out.rem = this.value;\n this.value = out.source = out.add = (values || []).map(ingest);\n return out;\n }\n});\n\nconst Feature = 'Feature';\nconst FeatureCollection = 'FeatureCollection';\nconst MultiPoint = 'MultiPoint';\n\n/**\n * Consolidate an array of [longitude, latitude] points or GeoJSON features\n * into a combined GeoJSON object. This transform is particularly useful for\n * combining geo data for a Projection's fit argument. The resulting GeoJSON\n * data is available as this transform's value. Input pulses are unchanged.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} [params.fields] - A two-element array\n * of field accessors for the longitude and latitude values.\n * @param {function(object): *} params.geojson - A field accessor for\n * retrieving GeoJSON feature data.\n */\nfunction GeoJSON(params) {\n Transform.call(this, null, params);\n}\nGeoJSON.Definition = {\n 'type': 'GeoJSON',\n 'metadata': {},\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'geojson',\n 'type': 'field'\n }]\n};\ninherits(GeoJSON, Transform, {\n transform(_, pulse) {\n var features = this._features,\n points = this._points,\n fields = _.fields,\n lon = fields && fields[0],\n lat = fields && fields[1],\n geojson = _.geojson || !fields && identity,\n flag = pulse.ADD,\n mod;\n mod = _.modified() || pulse.changed(pulse.REM) || pulse.modified(accessorFields(geojson)) || lon && pulse.modified(accessorFields(lon)) || lat && pulse.modified(accessorFields(lat));\n if (!this.value || mod) {\n flag = pulse.SOURCE;\n this._features = features = [];\n this._points = points = [];\n }\n if (geojson) {\n pulse.visit(flag, t => features.push(geojson(t)));\n }\n if (lon && lat) {\n pulse.visit(flag, t => {\n var x = lon(t),\n y = lat(t);\n if (x != null && y != null && (x = +x) === x && (y = +y) === y) {\n points.push([x, y]);\n }\n });\n features = features.concat({\n type: Feature,\n geometry: {\n type: MultiPoint,\n coordinates: points\n }\n });\n }\n this.value = {\n type: FeatureCollection,\n features: features\n };\n }\n});\n\n/**\n * Map GeoJSON data to an SVG path string.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(number, number): *} params.projection - The cartographic\n * projection to apply.\n * @param {function(object): *} [params.field] - The field with GeoJSON data,\n * or null if the tuple itself is a GeoJSON feature.\n * @param {string} [params.as='path'] - The output field in which to store\n * the generated path data (default 'path').\n */\nfunction GeoPath(params) {\n Transform.call(this, null, params);\n}\nGeoPath.Definition = {\n 'type': 'GeoPath',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'projection',\n 'type': 'projection'\n }, {\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'pointRadius',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'path'\n }]\n};\ninherits(GeoPath, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ALL),\n path = this.value,\n field = _.field || identity,\n as = _.as || 'path',\n flag = out.SOURCE;\n if (!path || _.modified()) {\n // parameters updated, reset and reflow\n this.value = path = getProjectionPath(_.projection);\n out.materialize().reflow();\n } else {\n flag = field === identity || pulse.modified(field.fields) ? out.ADD_MOD : out.ADD;\n }\n const prev = initPath(path, _.pointRadius);\n out.visit(flag, t => t[as] = path(field(t)));\n path.pointRadius(prev);\n return out.modifies(as);\n }\n});\nfunction initPath(path, pointRadius) {\n const prev = path.pointRadius();\n path.context(null);\n if (pointRadius != null) {\n path.pointRadius(pointRadius);\n }\n return prev;\n}\n\n/**\n * Geo-code a longitude/latitude point to an x/y coordinate.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(number, number): *} params.projection - The cartographic\n * projection to apply.\n * @param {Array} params.fields - A two-element array of\n * field accessors for the longitude and latitude values.\n * @param {Array} [params.as] - A two-element array of field names\n * under which to store the result. Defaults to ['x','y'].\n */\nfunction GeoPoint(params) {\n Transform.call(this, null, params);\n}\nGeoPoint.Definition = {\n 'type': 'GeoPoint',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'projection',\n 'type': 'projection',\n 'required': true\n }, {\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 2,\n 'default': ['x', 'y']\n }]\n};\ninherits(GeoPoint, Transform, {\n transform(_, pulse) {\n var proj = _.projection,\n lon = _.fields[0],\n lat = _.fields[1],\n as = _.as || ['x', 'y'],\n x = as[0],\n y = as[1],\n mod;\n function set(t) {\n const xy = proj([lon(t), lat(t)]);\n if (xy) {\n t[x] = xy[0];\n t[y] = xy[1];\n } else {\n t[x] = undefined;\n t[y] = undefined;\n }\n }\n if (_.modified()) {\n // parameters updated, reflow\n pulse = pulse.materialize().reflow(true).visit(pulse.SOURCE, set);\n } else {\n mod = pulse.modified(lon.fields) || pulse.modified(lat.fields);\n pulse.visit(mod ? pulse.ADD_MOD : pulse.ADD, set);\n }\n return pulse.modifies(as);\n }\n});\n\n/**\n * Annotate items with a geopath shape generator.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(number, number): *} params.projection - The cartographic\n * projection to apply.\n * @param {function(object): *} [params.field] - The field with GeoJSON data,\n * or null if the tuple itself is a GeoJSON feature.\n * @param {string} [params.as='shape'] - The output field in which to store\n * the generated path data (default 'shape').\n */\nfunction GeoShape(params) {\n Transform.call(this, null, params);\n}\nGeoShape.Definition = {\n 'type': 'GeoShape',\n 'metadata': {\n 'modifies': true,\n 'nomod': true\n },\n 'params': [{\n 'name': 'projection',\n 'type': 'projection'\n }, {\n 'name': 'field',\n 'type': 'field',\n 'default': 'datum'\n }, {\n 'name': 'pointRadius',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'shape'\n }]\n};\ninherits(GeoShape, Transform, {\n transform(_, pulse) {\n var out = pulse.fork(pulse.ALL),\n shape = this.value,\n as = _.as || 'shape',\n flag = out.ADD;\n if (!shape || _.modified()) {\n // parameters updated, reset and reflow\n this.value = shape = shapeGenerator(getProjectionPath(_.projection), _.field || field('datum'), _.pointRadius);\n out.materialize().reflow();\n flag = out.SOURCE;\n }\n out.visit(flag, t => t[as] = shape);\n return out.modifies(as);\n }\n});\nfunction shapeGenerator(path, field, pointRadius) {\n const shape = pointRadius == null ? _ => path(field(_)) : _ => {\n var prev = path.pointRadius(),\n value = path.pointRadius(pointRadius)(field(_));\n path.pointRadius(prev);\n return value;\n };\n shape.context = _ => {\n path.context(_);\n return shape;\n };\n return shape;\n}\n\n/**\n * GeoJSON feature generator for creating graticules.\n * @constructor\n */\nfunction Graticule(params) {\n Transform.call(this, [], params);\n this.generator = geoGraticule();\n}\nGraticule.Definition = {\n 'type': 'Graticule',\n 'metadata': {\n 'changes': true,\n 'generates': true\n },\n 'params': [{\n 'name': 'extent',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'extentMajor',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'extentMinor',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'step',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'stepMajor',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'default': [90, 360]\n }, {\n 'name': 'stepMinor',\n 'type': 'number',\n 'array': true,\n 'length': 2,\n 'default': [10, 10]\n }, {\n 'name': 'precision',\n 'type': 'number',\n 'default': 2.5\n }]\n};\ninherits(Graticule, Transform, {\n transform(_, pulse) {\n var src = this.value,\n gen = this.generator,\n t;\n if (!src.length || _.modified()) {\n for (const prop in _) {\n if (isFunction(gen[prop])) {\n gen[prop](_[prop]);\n }\n }\n }\n t = gen();\n if (src.length) {\n pulse.mod.push(replace(src[0], t));\n } else {\n pulse.add.push(ingest(t));\n }\n src[0] = t;\n return pulse;\n }\n});\n\n/**\n * Render a heatmap image for input raster grid data.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} [params.field] - The field with raster grid\n * data. If unspecified, the tuple itself is interpreted as a raster grid.\n * @param {string} [params.color] - A constant color value or function for\n * individual pixel color. If a function, it will be invoked with an input\n * object that includes $x, $y, $value, and $max fields for the grid.\n * @param {number} [params.opacity] - A constant opacity value or function for\n * individual pixel opacity. If a function, it will be invoked with an input\n * object that includes $x, $y, $value, and $max fields for the grid.\n * @param {string} [params.resolve] - The method for resolving maximum values\n * across multiple input grids. If 'independent' (the default), maximum\n * calculation will be performed separately for each grid. If 'shared',\n * a single global maximum will be used for all input grids.\n * @param {string} [params.as='image'] - The output field in which to store\n * the generated bitmap canvas images (default 'image').\n */\nfunction Heatmap(params) {\n Transform.call(this, null, params);\n}\nHeatmap.Definition = {\n 'type': 'heatmap',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'color',\n 'type': 'string',\n 'expr': true\n }, {\n 'name': 'opacity',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'resolve',\n 'type': 'enum',\n 'values': ['shared', 'independent'],\n 'default': 'independent'\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'image'\n }]\n};\ninherits(Heatmap, Transform, {\n transform(_, pulse) {\n if (!pulse.changed() && !_.modified()) {\n return pulse.StopPropagation;\n }\n var source = pulse.materialize(pulse.SOURCE).source,\n shared = _.resolve === 'shared',\n field = _.field || identity,\n opacity = opacity_(_.opacity, _),\n color = color_(_.color, _),\n as = _.as || 'image',\n obj = {\n $x: 0,\n $y: 0,\n $value: 0,\n $max: shared ? max(source.map(t => max(field(t).values))) : 0\n };\n source.forEach(t => {\n const v = field(t);\n\n // build proxy data object\n const o = extend({}, t, obj);\n // set maximum value if not globally shared\n if (!shared) o.$max = max(v.values || []);\n\n // generate canvas image\n // optimize color/opacity if not pixel-dependent\n t[as] = toCanvas(v, o, color.dep ? color : constant(color(o)), opacity.dep ? opacity : constant(opacity(o)));\n });\n return pulse.reflow(true).modifies(as);\n }\n});\n\n// get image color function\nfunction color_(color, _) {\n let f;\n if (isFunction(color)) {\n f = obj => rgb(color(obj, _));\n f.dep = dependency(color);\n } else {\n // default to mid-grey\n f = constant(rgb(color || '#888'));\n }\n return f;\n}\n\n// get image opacity function\nfunction opacity_(opacity, _) {\n let f;\n if (isFunction(opacity)) {\n f = obj => opacity(obj, _);\n f.dep = dependency(opacity);\n } else if (opacity) {\n f = constant(opacity);\n } else {\n // default to [0, max] opacity gradient\n f = obj => obj.$value / obj.$max || 0;\n f.dep = true;\n }\n return f;\n}\n\n// check if function depends on individual pixel data\nfunction dependency(f) {\n if (!isFunction(f)) return false;\n const set = toSet(accessorFields(f));\n return set.$x || set.$y || set.$value || set.$max;\n}\n\n// render raster grid to canvas\nfunction toCanvas(grid, obj, color, opacity) {\n const n = grid.width,\n m = grid.height,\n x1 = grid.x1 || 0,\n y1 = grid.y1 || 0,\n x2 = grid.x2 || n,\n y2 = grid.y2 || m,\n val = grid.values,\n value = val ? i => val[i] : zero,\n can = canvas(x2 - x1, y2 - y1),\n ctx = can.getContext('2d'),\n img = ctx.getImageData(0, 0, x2 - x1, y2 - y1),\n pix = img.data;\n for (let j = y1, k = 0; j < y2; ++j) {\n obj.$y = j - y1;\n for (let i = x1, r = j * n; i < x2; ++i, k += 4) {\n obj.$x = i - x1;\n obj.$value = value(i + r);\n const v = color(obj);\n pix[k + 0] = v.r;\n pix[k + 1] = v.g;\n pix[k + 2] = v.b;\n pix[k + 3] = ~~(255 * opacity(obj));\n }\n }\n ctx.putImageData(img, 0, 0);\n return can;\n}\n\n/**\n * Maintains a cartographic projection.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction Projection(params) {\n Transform.call(this, null, params);\n this.modified(true); // always treat as modified\n}\ninherits(Projection, Transform, {\n transform(_, pulse) {\n let proj = this.value;\n if (!proj || _.modified('type')) {\n this.value = proj = create(_.type);\n projectionProperties.forEach(prop => {\n if (_[prop] != null) set(proj, prop, _[prop]);\n });\n } else {\n projectionProperties.forEach(prop => {\n if (_.modified(prop)) set(proj, prop, _[prop]);\n });\n }\n if (_.pointRadius != null) proj.path.pointRadius(_.pointRadius);\n if (_.fit) fit(proj, _);\n return pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n }\n});\nfunction fit(proj, _) {\n const data = collectGeoJSON(_.fit);\n _.extent ? proj.fitExtent(_.extent, data) : _.size ? proj.fitSize(_.size, data) : 0;\n}\nfunction create(type) {\n const constructor = projection((type || 'mercator').toLowerCase());\n if (!constructor) error('Unrecognized projection type: ' + type);\n return constructor();\n}\nfunction set(proj, key, value) {\n if (isFunction(proj[key])) proj[key](value);\n}\nfunction collectGeoJSON(data) {\n data = array(data);\n return data.length === 1 ? data[0] : {\n type: FeatureCollection,\n features: data.reduce((a, f) => a.concat(featurize(f)), [])\n };\n}\nfunction featurize(f) {\n return f.type === FeatureCollection ? f.features : array(f).filter(d => d != null).map(d => d.type === Feature ? d : {\n type: Feature,\n geometry: d\n });\n}\n\nexport { Contour as contour, GeoJSON as geojson, GeoPath as geopath, GeoPoint as geopoint, GeoShape as geoshape, Graticule as graticule, Heatmap as heatmap, Isocontour as isocontour, KDE2D as kde2d, Projection as projection };\n","export default function(d) {\n const x = +this._x.call(null, d),\n y = +this._y.call(null, d);\n return add(this.cover(x, y), x, y, d);\n}\n\nfunction add(tree, x, y, d) {\n if (isNaN(x) || isNaN(y)) return tree; // ignore invalid points\n\n var parent,\n node = tree._root,\n leaf = {data: d},\n x0 = tree._x0,\n y0 = tree._y0,\n x1 = tree._x1,\n y1 = tree._y1,\n xm,\n ym,\n xp,\n yp,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return tree._root = leaf, tree;\n\n // Find the existing leaf for the new point, or add it.\n while (node.length) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree;\n }\n\n // Is the new point is exactly coincident with the existing point?\n xp = +tree._x.call(null, node.data);\n yp = +tree._y.call(null, node.data);\n if (x === xp && y === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;\n\n // Otherwise, split the leaf node until the old and new point are separated.\n do {\n parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4);\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n } while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | (xp >= xm)));\n return parent[j] = node, parent[i] = leaf, tree;\n}\n\nexport function addAll(data) {\n var d, i, n = data.length,\n x,\n y,\n xz = new Array(n),\n yz = new Array(n),\n x0 = Infinity,\n y0 = Infinity,\n x1 = -Infinity,\n y1 = -Infinity;\n\n // Compute the points and their extent.\n for (i = 0; i < n; ++i) {\n if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d))) continue;\n xz[i] = x;\n yz[i] = y;\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n }\n\n // If there were no (valid) points, abort.\n if (x0 > x1 || y0 > y1) return this;\n\n // Expand the tree to cover the new points.\n this.cover(x0, y0).cover(x1, y1);\n\n // Add the new points.\n for (i = 0; i < n; ++i) {\n add(this, xz[i], yz[i], data[i]);\n }\n\n return this;\n}\n","export default function(node, x0, y0, x1, y1) {\n this.node = node;\n this.x0 = x0;\n this.y0 = y0;\n this.x1 = x1;\n this.y1 = y1;\n}\n","export function defaultX(d) {\n return d[0];\n}\n\nexport default function(_) {\n return arguments.length ? (this._x = _, this) : this._x;\n}\n","export function defaultY(d) {\n return d[1];\n}\n\nexport default function(_) {\n return arguments.length ? (this._y = _, this) : this._y;\n}\n","import tree_add, {addAll as tree_addAll} from \"./add.js\";\nimport tree_cover from \"./cover.js\";\nimport tree_data from \"./data.js\";\nimport tree_extent from \"./extent.js\";\nimport tree_find from \"./find.js\";\nimport tree_remove, {removeAll as tree_removeAll} from \"./remove.js\";\nimport tree_root from \"./root.js\";\nimport tree_size from \"./size.js\";\nimport tree_visit from \"./visit.js\";\nimport tree_visitAfter from \"./visitAfter.js\";\nimport tree_x, {defaultX} from \"./x.js\";\nimport tree_y, {defaultY} from \"./y.js\";\n\nexport default function quadtree(nodes, x, y) {\n var tree = new Quadtree(x == null ? defaultX : x, y == null ? defaultY : y, NaN, NaN, NaN, NaN);\n return nodes == null ? tree : tree.addAll(nodes);\n}\n\nfunction Quadtree(x, y, x0, y0, x1, y1) {\n this._x = x;\n this._y = y;\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n this._root = undefined;\n}\n\nfunction leaf_copy(leaf) {\n var copy = {data: leaf.data}, next = copy;\n while (leaf = leaf.next) next = next.next = {data: leaf.data};\n return copy;\n}\n\nvar treeProto = quadtree.prototype = Quadtree.prototype;\n\ntreeProto.copy = function() {\n var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1),\n node = this._root,\n nodes,\n child;\n\n if (!node) return copy;\n\n if (!node.length) return copy._root = leaf_copy(node), copy;\n\n nodes = [{source: node, target: copy._root = new Array(4)}];\n while (node = nodes.pop()) {\n for (var i = 0; i < 4; ++i) {\n if (child = node.source[i]) {\n if (child.length) nodes.push({source: child, target: node.target[i] = new Array(4)});\n else node.target[i] = leaf_copy(child);\n }\n }\n }\n\n return copy;\n};\n\ntreeProto.add = tree_add;\ntreeProto.addAll = tree_addAll;\ntreeProto.cover = tree_cover;\ntreeProto.data = tree_data;\ntreeProto.extent = tree_extent;\ntreeProto.find = tree_find;\ntreeProto.remove = tree_remove;\ntreeProto.removeAll = tree_removeAll;\ntreeProto.root = tree_root;\ntreeProto.size = tree_size;\ntreeProto.visit = tree_visit;\ntreeProto.visitAfter = tree_visitAfter;\ntreeProto.x = tree_x;\ntreeProto.y = tree_y;\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export default function(random) {\n return (random() - 0.5) * 1e-6;\n}\n","import {quadtree} from \"d3-quadtree\";\nimport constant from \"./constant.js\";\nimport jiggle from \"./jiggle.js\";\n\nfunction x(d) {\n return d.x + d.vx;\n}\n\nfunction y(d) {\n return d.y + d.vy;\n}\n\nexport default function(radius) {\n var nodes,\n radii,\n random,\n strength = 1,\n iterations = 1;\n\n if (typeof radius !== \"function\") radius = constant(radius == null ? 1 : +radius);\n\n function force() {\n var i, n = nodes.length,\n tree,\n node,\n xi,\n yi,\n ri,\n ri2;\n\n for (var k = 0; k < iterations; ++k) {\n tree = quadtree(nodes, x, y).visitAfter(prepare);\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n ri = radii[node.index], ri2 = ri * ri;\n xi = node.x + node.vx;\n yi = node.y + node.vy;\n tree.visit(apply);\n }\n }\n\n function apply(quad, x0, y0, x1, y1) {\n var data = quad.data, rj = quad.r, r = ri + rj;\n if (data) {\n if (data.index > node.index) {\n var x = xi - data.x - data.vx,\n y = yi - data.y - data.vy,\n l = x * x + y * y;\n if (l < r * r) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n l = (r - (l = Math.sqrt(l))) / l * strength;\n node.vx += (x *= l) * (r = (rj *= rj) / (ri2 + rj));\n node.vy += (y *= l) * r;\n data.vx -= x * (r = 1 - r);\n data.vy -= y * r;\n }\n }\n return;\n }\n return x0 > xi + r || x1 < xi - r || y0 > yi + r || y1 < yi - r;\n }\n }\n\n function prepare(quad) {\n if (quad.data) return quad.r = radii[quad.data.index];\n for (var i = quad.r = 0; i < 4; ++i) {\n if (quad[i] && quad[i].r > quad.r) {\n quad.r = quad[i].r;\n }\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length, node;\n radii = new Array(n);\n for (i = 0; i < n; ++i) node = nodes[i], radii[node.index] = +radius(node, i, nodes);\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.iterations = function(_) {\n return arguments.length ? (iterations = +_, force) : iterations;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = +_, force) : strength;\n };\n\n force.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : radius;\n };\n\n return force;\n}\n","export default function(x, y) {\n if (isNaN(x = +x) || isNaN(y = +y)) return this; // ignore invalid points\n\n var x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1;\n\n // If the quadtree has no extent, initialize them.\n // Integer extent are necessary so that if we later double the extent,\n // the existing quadrant boundaries don’t change due to floating point error!\n if (isNaN(x0)) {\n x1 = (x0 = Math.floor(x)) + 1;\n y1 = (y0 = Math.floor(y)) + 1;\n }\n\n // Otherwise, double repeatedly to cover.\n else {\n var z = x1 - x0 || 1,\n node = this._root,\n parent,\n i;\n\n while (x0 > x || x >= x1 || y0 > y || y >= y1) {\n i = (y < y0) << 1 | (x < x0);\n parent = new Array(4), parent[i] = node, node = parent, z *= 2;\n switch (i) {\n case 0: x1 = x0 + z, y1 = y0 + z; break;\n case 1: x0 = x1 - z, y1 = y0 + z; break;\n case 2: x1 = x0 + z, y0 = y1 - z; break;\n case 3: x0 = x1 - z, y0 = y1 - z; break;\n }\n }\n\n if (this._root && this._root.length) this._root = node;\n }\n\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n return this;\n}\n","export default function() {\n var data = [];\n this.visit(function(node) {\n if (!node.length) do data.push(node.data); while (node = node.next)\n });\n return data;\n}\n","export default function(_) {\n return arguments.length\n ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1])\n : isNaN(this._x0) ? undefined : [[this._x0, this._y0], [this._x1, this._y1]];\n}\n","import Quad from \"./quad.js\";\n\nexport default function(x, y, radius) {\n var data,\n x0 = this._x0,\n y0 = this._y0,\n x1,\n y1,\n x2,\n y2,\n x3 = this._x1,\n y3 = this._y1,\n quads = [],\n node = this._root,\n q,\n i;\n\n if (node) quads.push(new Quad(node, x0, y0, x3, y3));\n if (radius == null) radius = Infinity;\n else {\n x0 = x - radius, y0 = y - radius;\n x3 = x + radius, y3 = y + radius;\n radius *= radius;\n }\n\n while (q = quads.pop()) {\n\n // Stop searching if this quadrant can’t contain a closer node.\n if (!(node = q.node)\n || (x1 = q.x0) > x3\n || (y1 = q.y0) > y3\n || (x2 = q.x1) < x0\n || (y2 = q.y1) < y0) continue;\n\n // Bisect the current quadrant.\n if (node.length) {\n var xm = (x1 + x2) / 2,\n ym = (y1 + y2) / 2;\n\n quads.push(\n new Quad(node[3], xm, ym, x2, y2),\n new Quad(node[2], x1, ym, xm, y2),\n new Quad(node[1], xm, y1, x2, ym),\n new Quad(node[0], x1, y1, xm, ym)\n );\n\n // Visit the closest quadrant first.\n if (i = (y >= ym) << 1 | (x >= xm)) {\n q = quads[quads.length - 1];\n quads[quads.length - 1] = quads[quads.length - 1 - i];\n quads[quads.length - 1 - i] = q;\n }\n }\n\n // Visit this point. (Visiting coincident points isn’t necessary!)\n else {\n var dx = x - +this._x.call(null, node.data),\n dy = y - +this._y.call(null, node.data),\n d2 = dx * dx + dy * dy;\n if (d2 < radius) {\n var d = Math.sqrt(radius = d2);\n x0 = x - d, y0 = y - d;\n x3 = x + d, y3 = y + d;\n data = node.data;\n }\n }\n }\n\n return data;\n}\n","export default function(d) {\n if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d))) return this; // ignore invalid points\n\n var parent,\n node = this._root,\n retainer,\n previous,\n next,\n x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1,\n x,\n y,\n xm,\n ym,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return this;\n\n // Find the leaf node for the point.\n // While descending, also retain the deepest parent with a non-removed sibling.\n if (node.length) while (true) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (!(parent = node, node = node[i = bottom << 1 | right])) return this;\n if (!node.length) break;\n if (parent[(i + 1) & 3] || parent[(i + 2) & 3] || parent[(i + 3) & 3]) retainer = parent, j = i;\n }\n\n // Find the point to remove.\n while (node.data !== d) if (!(previous = node, node = node.next)) return this;\n if (next = node.next) delete node.next;\n\n // If there are multiple coincident points, remove just the point.\n if (previous) return (next ? previous.next = next : delete previous.next), this;\n\n // If this is the root point, remove it.\n if (!parent) return this._root = next, this;\n\n // Remove this leaf.\n next ? parent[i] = next : delete parent[i];\n\n // If the parent now contains exactly one leaf, collapse superfluous parents.\n if ((node = parent[0] || parent[1] || parent[2] || parent[3])\n && node === (parent[3] || parent[2] || parent[1] || parent[0])\n && !node.length) {\n if (retainer) retainer[j] = node;\n else this._root = node;\n }\n\n return this;\n}\n\nexport function removeAll(data) {\n for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);\n return this;\n}\n","export default function() {\n return this._root;\n}\n","export default function() {\n var size = 0;\n this.visit(function(node) {\n if (!node.length) do ++size; while (node = node.next)\n });\n return size;\n}\n","import Quad from \"./quad.js\";\n\nexport default function(callback) {\n var quads = [], q, node = this._root, child, x0, y0, x1, y1;\n if (node) quads.push(new Quad(node, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) {\n var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));\n if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));\n if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));\n if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));\n }\n }\n return this;\n}\n","import Quad from \"./quad.js\";\n\nexport default function(callback) {\n var quads = [], next = [], q;\n if (this._root) quads.push(new Quad(this._root, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n var node = q.node;\n if (node.length) {\n var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));\n if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));\n if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));\n if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));\n }\n next.push(q);\n }\n while (q = next.pop()) {\n callback(q.node, q.x0, q.y0, q.x1, q.y1);\n }\n return this;\n}\n","var noop = {value: () => {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n","var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n","// https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use\nconst a = 1664525;\nconst c = 1013904223;\nconst m = 4294967296; // 2^32\n\nexport default function() {\n let s = 1;\n return () => (s = (a * s + c) % m) / m;\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {timer} from \"d3-timer\";\nimport lcg from \"./lcg.js\";\n\nexport function x(d) {\n return d.x;\n}\n\nexport function y(d) {\n return d.y;\n}\n\nvar initialRadius = 10,\n initialAngle = Math.PI * (3 - Math.sqrt(5));\n\nexport default function(nodes) {\n var simulation,\n alpha = 1,\n alphaMin = 0.001,\n alphaDecay = 1 - Math.pow(alphaMin, 1 / 300),\n alphaTarget = 0,\n velocityDecay = 0.6,\n forces = new Map(),\n stepper = timer(step),\n event = dispatch(\"tick\", \"end\"),\n random = lcg();\n\n if (nodes == null) nodes = [];\n\n function step() {\n tick();\n event.call(\"tick\", simulation);\n if (alpha < alphaMin) {\n stepper.stop();\n event.call(\"end\", simulation);\n }\n }\n\n function tick(iterations) {\n var i, n = nodes.length, node;\n\n if (iterations === undefined) iterations = 1;\n\n for (var k = 0; k < iterations; ++k) {\n alpha += (alphaTarget - alpha) * alphaDecay;\n\n forces.forEach(function(force) {\n force(alpha);\n });\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n if (node.fx == null) node.x += node.vx *= velocityDecay;\n else node.x = node.fx, node.vx = 0;\n if (node.fy == null) node.y += node.vy *= velocityDecay;\n else node.y = node.fy, node.vy = 0;\n }\n }\n\n return simulation;\n }\n\n function initializeNodes() {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.index = i;\n if (node.fx != null) node.x = node.fx;\n if (node.fy != null) node.y = node.fy;\n if (isNaN(node.x) || isNaN(node.y)) {\n var radius = initialRadius * Math.sqrt(0.5 + i), angle = i * initialAngle;\n node.x = radius * Math.cos(angle);\n node.y = radius * Math.sin(angle);\n }\n if (isNaN(node.vx) || isNaN(node.vy)) {\n node.vx = node.vy = 0;\n }\n }\n }\n\n function initializeForce(force) {\n if (force.initialize) force.initialize(nodes, random);\n return force;\n }\n\n initializeNodes();\n\n return simulation = {\n tick: tick,\n\n restart: function() {\n return stepper.restart(step), simulation;\n },\n\n stop: function() {\n return stepper.stop(), simulation;\n },\n\n nodes: function(_) {\n return arguments.length ? (nodes = _, initializeNodes(), forces.forEach(initializeForce), simulation) : nodes;\n },\n\n alpha: function(_) {\n return arguments.length ? (alpha = +_, simulation) : alpha;\n },\n\n alphaMin: function(_) {\n return arguments.length ? (alphaMin = +_, simulation) : alphaMin;\n },\n\n alphaDecay: function(_) {\n return arguments.length ? (alphaDecay = +_, simulation) : +alphaDecay;\n },\n\n alphaTarget: function(_) {\n return arguments.length ? (alphaTarget = +_, simulation) : alphaTarget;\n },\n\n velocityDecay: function(_) {\n return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay;\n },\n\n randomSource: function(_) {\n return arguments.length ? (random = _, forces.forEach(initializeForce), simulation) : random;\n },\n\n force: function(name, _) {\n return arguments.length > 1 ? ((_ == null ? forces.delete(name) : forces.set(name, initializeForce(_))), simulation) : forces.get(name);\n },\n\n find: function(x, y, radius) {\n var i = 0,\n n = nodes.length,\n dx,\n dy,\n d2,\n node,\n closest;\n\n if (radius == null) radius = Infinity;\n else radius *= radius;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n dx = x - node.x;\n dy = y - node.y;\n d2 = dx * dx + dy * dy;\n if (d2 < radius) closest = node, radius = d2;\n }\n\n return closest;\n },\n\n on: function(name, _) {\n return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name);\n }\n };\n}\n","import constant from \"./constant.js\";\nimport jiggle from \"./jiggle.js\";\n\nfunction index(d) {\n return d.index;\n}\n\nfunction find(nodeById, nodeId) {\n var node = nodeById.get(nodeId);\n if (!node) throw new Error(\"node not found: \" + nodeId);\n return node;\n}\n\nexport default function(links) {\n var id = index,\n strength = defaultStrength,\n strengths,\n distance = constant(30),\n distances,\n nodes,\n count,\n bias,\n random,\n iterations = 1;\n\n if (links == null) links = [];\n\n function defaultStrength(link) {\n return 1 / Math.min(count[link.source.index], count[link.target.index]);\n }\n\n function force(alpha) {\n for (var k = 0, n = links.length; k < iterations; ++k) {\n for (var i = 0, link, source, target, x, y, l, b; i < n; ++i) {\n link = links[i], source = link.source, target = link.target;\n x = target.x + target.vx - source.x - source.vx || jiggle(random);\n y = target.y + target.vy - source.y - source.vy || jiggle(random);\n l = Math.sqrt(x * x + y * y);\n l = (l - distances[i]) / l * alpha * strengths[i];\n x *= l, y *= l;\n target.vx -= x * (b = bias[i]);\n target.vy -= y * b;\n source.vx += x * (b = 1 - b);\n source.vy += y * b;\n }\n }\n }\n\n function initialize() {\n if (!nodes) return;\n\n var i,\n n = nodes.length,\n m = links.length,\n nodeById = new Map(nodes.map((d, i) => [id(d, i, nodes), d])),\n link;\n\n for (i = 0, count = new Array(n); i < m; ++i) {\n link = links[i], link.index = i;\n if (typeof link.source !== \"object\") link.source = find(nodeById, link.source);\n if (typeof link.target !== \"object\") link.target = find(nodeById, link.target);\n count[link.source.index] = (count[link.source.index] || 0) + 1;\n count[link.target.index] = (count[link.target.index] || 0) + 1;\n }\n\n for (i = 0, bias = new Array(m); i < m; ++i) {\n link = links[i], bias[i] = count[link.source.index] / (count[link.source.index] + count[link.target.index]);\n }\n\n strengths = new Array(m), initializeStrength();\n distances = new Array(m), initializeDistance();\n }\n\n function initializeStrength() {\n if (!nodes) return;\n\n for (var i = 0, n = links.length; i < n; ++i) {\n strengths[i] = +strength(links[i], i, links);\n }\n }\n\n function initializeDistance() {\n if (!nodes) return;\n\n for (var i = 0, n = links.length; i < n; ++i) {\n distances[i] = +distance(links[i], i, links);\n }\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.links = function(_) {\n return arguments.length ? (links = _, initialize(), force) : links;\n };\n\n force.id = function(_) {\n return arguments.length ? (id = _, force) : id;\n };\n\n force.iterations = function(_) {\n return arguments.length ? (iterations = +_, force) : iterations;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initializeStrength(), force) : strength;\n };\n\n force.distance = function(_) {\n return arguments.length ? (distance = typeof _ === \"function\" ? _ : constant(+_), initializeDistance(), force) : distance;\n };\n\n return force;\n}\n","import { Transform } from 'vega-dataflow';\nimport { inherits, array, isFunction, accessorFields, hasOwnProperty, error } from 'vega-util';\nimport { forceSimulation, forceCenter, forceCollide, forceManyBody, forceLink, forceX, forceY } from 'd3-force';\n\nconst ForceMap = {\n center: forceCenter,\n collide: forceCollide,\n nbody: forceManyBody,\n link: forceLink,\n x: forceX,\n y: forceY\n};\nconst Forces = 'forces',\n ForceParams = ['alpha', 'alphaMin', 'alphaTarget', 'velocityDecay', 'forces'],\n ForceConfig = ['static', 'iterations'],\n ForceOutput = ['x', 'y', 'vx', 'vy'];\n\n/**\n * Force simulation layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.forces - The forces to apply.\n */\nfunction Force(params) {\n Transform.call(this, null, params);\n}\nForce.Definition = {\n 'type': 'Force',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'static',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'restart',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'iterations',\n 'type': 'number',\n 'default': 300\n }, {\n 'name': 'alpha',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'alphaMin',\n 'type': 'number',\n 'default': 0.001\n }, {\n 'name': 'alphaTarget',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'velocityDecay',\n 'type': 'number',\n 'default': 0.4\n }, {\n 'name': 'forces',\n 'type': 'param',\n 'array': true,\n 'params': [{\n 'key': {\n 'force': 'center'\n },\n 'params': [{\n 'name': 'x',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'y',\n 'type': 'number',\n 'default': 0\n }]\n }, {\n 'key': {\n 'force': 'collide'\n },\n 'params': [{\n 'name': 'radius',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'strength',\n 'type': 'number',\n 'default': 0.7\n }, {\n 'name': 'iterations',\n 'type': 'number',\n 'default': 1\n }]\n }, {\n 'key': {\n 'force': 'nbody'\n },\n 'params': [{\n 'name': 'strength',\n 'type': 'number',\n 'default': -30,\n 'expr': true\n }, {\n 'name': 'theta',\n 'type': 'number',\n 'default': 0.9\n }, {\n 'name': 'distanceMin',\n 'type': 'number',\n 'default': 1\n }, {\n 'name': 'distanceMax',\n 'type': 'number'\n }]\n }, {\n 'key': {\n 'force': 'link'\n },\n 'params': [{\n 'name': 'links',\n 'type': 'data'\n }, {\n 'name': 'id',\n 'type': 'field'\n }, {\n 'name': 'distance',\n 'type': 'number',\n 'default': 30,\n 'expr': true\n }, {\n 'name': 'strength',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'iterations',\n 'type': 'number',\n 'default': 1\n }]\n }, {\n 'key': {\n 'force': 'x'\n },\n 'params': [{\n 'name': 'strength',\n 'type': 'number',\n 'default': 0.1\n }, {\n 'name': 'x',\n 'type': 'field'\n }]\n }, {\n 'key': {\n 'force': 'y'\n },\n 'params': [{\n 'name': 'strength',\n 'type': 'number',\n 'default': 0.1\n }, {\n 'name': 'y',\n 'type': 'field'\n }]\n }]\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'modify': false,\n 'default': ForceOutput\n }]\n};\ninherits(Force, Transform, {\n transform(_, pulse) {\n var sim = this.value,\n change = pulse.changed(pulse.ADD_REM),\n params = _.modified(ForceParams),\n iters = _.iterations || 300;\n\n // configure simulation\n if (!sim) {\n this.value = sim = simulation(pulse.source, _);\n sim.on('tick', rerun(pulse.dataflow, this));\n if (!_.static) {\n change = true;\n sim.tick(); // ensure we run on init\n }\n pulse.modifies('index');\n } else {\n if (change) {\n pulse.modifies('index');\n sim.nodes(pulse.source);\n }\n if (params || pulse.changed(pulse.MOD)) {\n setup(sim, _, 0, pulse);\n }\n }\n\n // run simulation\n if (params || change || _.modified(ForceConfig) || pulse.changed() && _.restart) {\n sim.alpha(Math.max(sim.alpha(), _.alpha || 1)).alphaDecay(1 - Math.pow(sim.alphaMin(), 1 / iters));\n if (_.static) {\n for (sim.stop(); --iters >= 0;) sim.tick();\n } else {\n if (sim.stopped()) sim.restart();\n if (!change) return pulse.StopPropagation; // defer to sim ticks\n }\n }\n return this.finish(_, pulse);\n },\n finish(_, pulse) {\n const dataflow = pulse.dataflow;\n\n // inspect dependencies, touch link source data\n for (let args = this._argops, j = 0, m = args.length, arg; j < m; ++j) {\n arg = args[j];\n if (arg.name !== Forces || arg.op._argval.force !== 'link') {\n continue;\n }\n for (var ops = arg.op._argops, i = 0, n = ops.length, op; i < n; ++i) {\n if (ops[i].name === 'links' && (op = ops[i].op.source)) {\n dataflow.pulse(op, dataflow.changeset().reflow());\n break;\n }\n }\n }\n\n // reflow all nodes\n return pulse.reflow(_.modified()).modifies(ForceOutput);\n }\n});\nfunction rerun(df, op) {\n return () => df.touch(op).run();\n}\nfunction simulation(nodes, _) {\n const sim = forceSimulation(nodes),\n stop = sim.stop,\n restart = sim.restart;\n let stopped = false;\n sim.stopped = () => stopped;\n sim.restart = () => (stopped = false, restart());\n sim.stop = () => (stopped = true, stop());\n return setup(sim, _, true).on('end', () => stopped = true);\n}\nfunction setup(sim, _, init, pulse) {\n var f = array(_.forces),\n i,\n n,\n p,\n name;\n for (i = 0, n = ForceParams.length; i < n; ++i) {\n p = ForceParams[i];\n if (p !== Forces && _.modified(p)) sim[p](_[p]);\n }\n for (i = 0, n = f.length; i < n; ++i) {\n name = Forces + i;\n p = init || _.modified(Forces, i) ? getForce(f[i]) : pulse && modified(f[i], pulse) ? sim.force(name) : null;\n if (p) sim.force(name, p);\n }\n for (n = sim.numForces || 0; i < n; ++i) {\n sim.force(Forces + i, null); // remove\n }\n sim.numForces = f.length;\n return sim;\n}\nfunction modified(f, pulse) {\n var k, v;\n for (k in f) {\n if (isFunction(v = f[k]) && pulse.modified(accessorFields(v))) return 1;\n }\n return 0;\n}\nfunction getForce(_) {\n var f, p;\n if (!hasOwnProperty(ForceMap, _.force)) {\n error('Unrecognized force: ' + _.force);\n }\n f = ForceMap[_.force]();\n for (p in _) {\n if (isFunction(f[p])) setForceParam(f[p], _[p], _);\n }\n return f;\n}\nfunction setForceParam(f, v, _) {\n f(isFunction(v) ? d => v(d, _) : v);\n}\n\nexport { Force as force };\n","export default function(x, y) {\n var nodes, strength = 1;\n\n if (x == null) x = 0;\n if (y == null) y = 0;\n\n function force() {\n var i,\n n = nodes.length,\n node,\n sx = 0,\n sy = 0;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i], sx += node.x, sy += node.y;\n }\n\n for (sx = (sx / n - x) * strength, sy = (sy / n - y) * strength, i = 0; i < n; ++i) {\n node = nodes[i], node.x -= sx, node.y -= sy;\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = +_, force) : x;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = +_, force) : y;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = +_, force) : strength;\n };\n\n return force;\n}\n","import {quadtree} from \"d3-quadtree\";\nimport constant from \"./constant.js\";\nimport jiggle from \"./jiggle.js\";\nimport {x, y} from \"./simulation.js\";\n\nexport default function() {\n var nodes,\n node,\n random,\n alpha,\n strength = constant(-30),\n strengths,\n distanceMin2 = 1,\n distanceMax2 = Infinity,\n theta2 = 0.81;\n\n function force(_) {\n var i, n = nodes.length, tree = quadtree(nodes, x, y).visitAfter(accumulate);\n for (alpha = _, i = 0; i < n; ++i) node = nodes[i], tree.visit(apply);\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length, node;\n strengths = new Array(n);\n for (i = 0; i < n; ++i) node = nodes[i], strengths[node.index] = +strength(node, i, nodes);\n }\n\n function accumulate(quad) {\n var strength = 0, q, c, weight = 0, x, y, i;\n\n // For internal nodes, accumulate forces from child quadrants.\n if (quad.length) {\n for (x = y = i = 0; i < 4; ++i) {\n if ((q = quad[i]) && (c = Math.abs(q.value))) {\n strength += q.value, weight += c, x += c * q.x, y += c * q.y;\n }\n }\n quad.x = x / weight;\n quad.y = y / weight;\n }\n\n // For leaf nodes, accumulate forces from coincident quadrants.\n else {\n q = quad;\n q.x = q.data.x;\n q.y = q.data.y;\n do strength += strengths[q.data.index];\n while (q = q.next);\n }\n\n quad.value = strength;\n }\n\n function apply(quad, x1, _, x2) {\n if (!quad.value) return true;\n\n var x = quad.x - node.x,\n y = quad.y - node.y,\n w = x2 - x1,\n l = x * x + y * y;\n\n // Apply the Barnes-Hut approximation if possible.\n // Limit forces for very close nodes; randomize direction if coincident.\n if (w * w / theta2 < l) {\n if (l < distanceMax2) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);\n node.vx += x * quad.value * alpha / l;\n node.vy += y * quad.value * alpha / l;\n }\n return true;\n }\n\n // Otherwise, process points directly.\n else if (quad.length || l >= distanceMax2) return;\n\n // Limit forces for very close nodes; randomize direction if coincident.\n if (quad.data !== node || quad.next) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);\n }\n\n do if (quad.data !== node) {\n w = strengths[quad.data.index] * alpha / l;\n node.vx += x * w;\n node.vy += y * w;\n } while (quad = quad.next);\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.distanceMin = function(_) {\n return arguments.length ? (distanceMin2 = _ * _, force) : Math.sqrt(distanceMin2);\n };\n\n force.distanceMax = function(_) {\n return arguments.length ? (distanceMax2 = _ * _, force) : Math.sqrt(distanceMax2);\n };\n\n force.theta = function(_) {\n return arguments.length ? (theta2 = _ * _, force) : Math.sqrt(theta2);\n };\n\n return force;\n}\n","import constant from \"./constant.js\";\n\nexport default function(x) {\n var strength = constant(0.1),\n nodes,\n strengths,\n xz;\n\n if (typeof x !== \"function\") x = constant(x == null ? 0 : +x);\n\n function force(alpha) {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.vx += (xz[i] - node.x) * strengths[i] * alpha;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n xz = new Array(n);\n for (i = 0; i < n; ++i) {\n strengths[i] = isNaN(xz[i] = +x(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : x;\n };\n\n return force;\n}\n","import constant from \"./constant.js\";\n\nexport default function(y) {\n var strength = constant(0.1),\n nodes,\n strengths,\n yz;\n\n if (typeof y !== \"function\") y = constant(y == null ? 0 : +y);\n\n function force(alpha) {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.vy += (yz[i] - node.y) * strengths[i] * alpha;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n yz = new Array(n);\n for (i = 0; i < n; ++i) {\n strengths[i] = isNaN(yz[i] = +y(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : y;\n };\n\n return force;\n}\n","function count(node) {\n var sum = 0,\n children = node.children,\n i = children && children.length;\n if (!i) sum = 1;\n else while (--i >= 0) sum += children[i].value;\n node.value = sum;\n}\n\nexport default function() {\n return this.eachAfter(count);\n}\n","import node_count from \"./count.js\";\nimport node_each from \"./each.js\";\nimport node_eachBefore from \"./eachBefore.js\";\nimport node_eachAfter from \"./eachAfter.js\";\nimport node_find from \"./find.js\";\nimport node_sum from \"./sum.js\";\nimport node_sort from \"./sort.js\";\nimport node_path from \"./path.js\";\nimport node_ancestors from \"./ancestors.js\";\nimport node_descendants from \"./descendants.js\";\nimport node_leaves from \"./leaves.js\";\nimport node_links from \"./links.js\";\nimport node_iterator from \"./iterator.js\";\n\nexport default function hierarchy(data, children) {\n if (data instanceof Map) {\n data = [undefined, data];\n if (children === undefined) children = mapChildren;\n } else if (children === undefined) {\n children = objectChildren;\n }\n\n var root = new Node(data),\n node,\n nodes = [root],\n child,\n childs,\n i,\n n;\n\n while (node = nodes.pop()) {\n if ((childs = children(node.data)) && (n = (childs = Array.from(childs)).length)) {\n node.children = childs;\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = childs[i] = new Node(childs[i]));\n child.parent = node;\n child.depth = node.depth + 1;\n }\n }\n }\n\n return root.eachBefore(computeHeight);\n}\n\nfunction node_copy() {\n return hierarchy(this).eachBefore(copyData);\n}\n\nfunction objectChildren(d) {\n return d.children;\n}\n\nfunction mapChildren(d) {\n return Array.isArray(d) ? d[1] : null;\n}\n\nfunction copyData(node) {\n if (node.data.value !== undefined) node.value = node.data.value;\n node.data = node.data.data;\n}\n\nexport function computeHeight(node) {\n var height = 0;\n do node.height = height;\n while ((node = node.parent) && (node.height < ++height));\n}\n\nexport function Node(data) {\n this.data = data;\n this.depth =\n this.height = 0;\n this.parent = null;\n}\n\nNode.prototype = hierarchy.prototype = {\n constructor: Node,\n count: node_count,\n each: node_each,\n eachAfter: node_eachAfter,\n eachBefore: node_eachBefore,\n find: node_find,\n sum: node_sum,\n sort: node_sort,\n path: node_path,\n ancestors: node_ancestors,\n descendants: node_descendants,\n leaves: node_leaves,\n links: node_links,\n copy: node_copy,\n [Symbol.iterator]: node_iterator\n};\n","export function optional(f) {\n return f == null ? null : required(f);\n}\n\nexport function required(f) {\n if (typeof f !== \"function\") throw new Error;\n return f;\n}\n","export function constantZero() {\n return 0;\n}\n\nexport default function(x) {\n return function() {\n return x;\n };\n}\n","export default function(callback, that) {\n let index = -1;\n for (const node of this) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n","export default function(callback, that) {\n var node = this, nodes = [node], next = [], children, i, n, index = -1;\n while (node = nodes.pop()) {\n next.push(node);\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n nodes.push(children[i]);\n }\n }\n }\n while (node = next.pop()) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n","export default function(callback, that) {\n var node = this, nodes = [node], children, i, index = -1;\n while (node = nodes.pop()) {\n callback.call(that, node, ++index, this);\n if (children = node.children) {\n for (i = children.length - 1; i >= 0; --i) {\n nodes.push(children[i]);\n }\n }\n }\n return this;\n}\n","export default function(callback, that) {\n let index = -1;\n for (const node of this) {\n if (callback.call(that, node, ++index, this)) {\n return node;\n }\n }\n}\n","export default function(value) {\n return this.eachAfter(function(node) {\n var sum = +value(node.data) || 0,\n children = node.children,\n i = children && children.length;\n while (--i >= 0) sum += children[i].value;\n node.value = sum;\n });\n}\n","export default function(compare) {\n return this.eachBefore(function(node) {\n if (node.children) {\n node.children.sort(compare);\n }\n });\n}\n","export default function(end) {\n var start = this,\n ancestor = leastCommonAncestor(start, end),\n nodes = [start];\n while (start !== ancestor) {\n start = start.parent;\n nodes.push(start);\n }\n var k = nodes.length;\n while (end !== ancestor) {\n nodes.splice(k, 0, end);\n end = end.parent;\n }\n return nodes;\n}\n\nfunction leastCommonAncestor(a, b) {\n if (a === b) return a;\n var aNodes = a.ancestors(),\n bNodes = b.ancestors(),\n c = null;\n a = aNodes.pop();\n b = bNodes.pop();\n while (a === b) {\n c = a;\n a = aNodes.pop();\n b = bNodes.pop();\n }\n return c;\n}\n","export default function() {\n var node = this, nodes = [node];\n while (node = node.parent) {\n nodes.push(node);\n }\n return nodes;\n}\n","export default function() {\n return Array.from(this);\n}\n","export default function() {\n var leaves = [];\n this.eachBefore(function(node) {\n if (!node.children) {\n leaves.push(node);\n }\n });\n return leaves;\n}\n","export default function() {\n var root = this, links = [];\n root.each(function(node) {\n if (node !== root) { // Don’t include the root’s parent, if any.\n links.push({source: node.parent, target: node});\n }\n });\n return links;\n}\n","export default function*() {\n var node = this, current, next = [node], children, i, n;\n do {\n current = next.reverse(), next = [];\n while (node = current.pop()) {\n yield node;\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n next.push(children[i]);\n }\n }\n }\n } while (next.length);\n}\n","// https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use\nconst a = 1664525;\nconst c = 1013904223;\nconst m = 4294967296; // 2^32\n\nexport default function() {\n let s = 1;\n return () => (s = (a * s + c) % m) / m;\n}\n","import {shuffle} from \"../array.js\";\nimport lcg from \"../lcg.js\";\n\nexport default function(circles) {\n return packEncloseRandom(circles, lcg());\n}\n\nexport function packEncloseRandom(circles, random) {\n var i = 0, n = (circles = shuffle(Array.from(circles), random)).length, B = [], p, e;\n\n while (i < n) {\n p = circles[i];\n if (e && enclosesWeak(e, p)) ++i;\n else e = encloseBasis(B = extendBasis(B, p)), i = 0;\n }\n\n return e;\n}\n\nfunction extendBasis(B, p) {\n var i, j;\n\n if (enclosesWeakAll(p, B)) return [p];\n\n // If we get here then B must have at least one element.\n for (i = 0; i < B.length; ++i) {\n if (enclosesNot(p, B[i])\n && enclosesWeakAll(encloseBasis2(B[i], p), B)) {\n return [B[i], p];\n }\n }\n\n // If we get here then B must have at least two elements.\n for (i = 0; i < B.length - 1; ++i) {\n for (j = i + 1; j < B.length; ++j) {\n if (enclosesNot(encloseBasis2(B[i], B[j]), p)\n && enclosesNot(encloseBasis2(B[i], p), B[j])\n && enclosesNot(encloseBasis2(B[j], p), B[i])\n && enclosesWeakAll(encloseBasis3(B[i], B[j], p), B)) {\n return [B[i], B[j], p];\n }\n }\n }\n\n // If we get here then something is very wrong.\n throw new Error;\n}\n\nfunction enclosesNot(a, b) {\n var dr = a.r - b.r, dx = b.x - a.x, dy = b.y - a.y;\n return dr < 0 || dr * dr < dx * dx + dy * dy;\n}\n\nfunction enclosesWeak(a, b) {\n var dr = a.r - b.r + Math.max(a.r, b.r, 1) * 1e-9, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction enclosesWeakAll(a, B) {\n for (var i = 0; i < B.length; ++i) {\n if (!enclosesWeak(a, B[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction encloseBasis(B) {\n switch (B.length) {\n case 1: return encloseBasis1(B[0]);\n case 2: return encloseBasis2(B[0], B[1]);\n case 3: return encloseBasis3(B[0], B[1], B[2]);\n }\n}\n\nfunction encloseBasis1(a) {\n return {\n x: a.x,\n y: a.y,\n r: a.r\n };\n}\n\nfunction encloseBasis2(a, b) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1,\n l = Math.sqrt(x21 * x21 + y21 * y21);\n return {\n x: (x1 + x2 + x21 / l * r21) / 2,\n y: (y1 + y2 + y21 / l * r21) / 2,\n r: (l + r1 + r2) / 2\n };\n}\n\nfunction encloseBasis3(a, b, c) {\n var x1 = a.x, y1 = a.y, r1 = a.r,\n x2 = b.x, y2 = b.y, r2 = b.r,\n x3 = c.x, y3 = c.y, r3 = c.r,\n a2 = x1 - x2,\n a3 = x1 - x3,\n b2 = y1 - y2,\n b3 = y1 - y3,\n c2 = r2 - r1,\n c3 = r3 - r1,\n d1 = x1 * x1 + y1 * y1 - r1 * r1,\n d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2,\n d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3,\n ab = a3 * b2 - a2 * b3,\n xa = (b2 * d3 - b3 * d2) / (ab * 2) - x1,\n xb = (b3 * c2 - b2 * c3) / ab,\n ya = (a3 * d2 - a2 * d3) / (ab * 2) - y1,\n yb = (a2 * c3 - a3 * c2) / ab,\n A = xb * xb + yb * yb - 1,\n B = 2 * (r1 + xa * xb + ya * yb),\n C = xa * xa + ya * ya - r1 * r1,\n r = -(Math.abs(A) > 1e-6 ? (B + Math.sqrt(B * B - 4 * A * C)) / (2 * A) : C / B);\n return {\n x: x1 + xa + xb * r,\n y: y1 + ya + yb * r,\n r: r\n };\n}\n","import array from \"../array.js\";\nimport lcg from \"../lcg.js\";\nimport {packEncloseRandom} from \"./enclose.js\";\n\nfunction place(b, a, c) {\n var dx = b.x - a.x, x, a2,\n dy = b.y - a.y, y, b2,\n d2 = dx * dx + dy * dy;\n if (d2) {\n a2 = a.r + c.r, a2 *= a2;\n b2 = b.r + c.r, b2 *= b2;\n if (a2 > b2) {\n x = (d2 + b2 - a2) / (2 * d2);\n y = Math.sqrt(Math.max(0, b2 / d2 - x * x));\n c.x = b.x - x * dx - y * dy;\n c.y = b.y - x * dy + y * dx;\n } else {\n x = (d2 + a2 - b2) / (2 * d2);\n y = Math.sqrt(Math.max(0, a2 / d2 - x * x));\n c.x = a.x + x * dx - y * dy;\n c.y = a.y + x * dy + y * dx;\n }\n } else {\n c.x = a.x + c.r;\n c.y = a.y;\n }\n}\n\nfunction intersects(a, b) {\n var dr = a.r + b.r - 1e-6, dx = b.x - a.x, dy = b.y - a.y;\n return dr > 0 && dr * dr > dx * dx + dy * dy;\n}\n\nfunction score(node) {\n var a = node._,\n b = node.next._,\n ab = a.r + b.r,\n dx = (a.x * b.r + b.x * a.r) / ab,\n dy = (a.y * b.r + b.y * a.r) / ab;\n return dx * dx + dy * dy;\n}\n\nfunction Node(circle) {\n this._ = circle;\n this.next = null;\n this.previous = null;\n}\n\nexport function packSiblingsRandom(circles, random) {\n if (!(n = (circles = array(circles)).length)) return 0;\n\n var a, b, c, n, aa, ca, i, j, k, sj, sk;\n\n // Place the first circle.\n a = circles[0], a.x = 0, a.y = 0;\n if (!(n > 1)) return a.r;\n\n // Place the second circle.\n b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0;\n if (!(n > 2)) return a.r + b.r;\n\n // Place the third circle.\n place(b, a, c = circles[2]);\n\n // Initialize the front-chain using the first three circles a, b and c.\n a = new Node(a), b = new Node(b), c = new Node(c);\n a.next = c.previous = b;\n b.next = a.previous = c;\n c.next = b.previous = a;\n\n // Attempt to place each remaining circle…\n pack: for (i = 3; i < n; ++i) {\n place(a._, b._, c = circles[i]), c = new Node(c);\n\n // Find the closest intersecting circle on the front-chain, if any.\n // “Closeness” is determined by linear distance along the front-chain.\n // “Ahead” or “behind” is likewise determined by linear distance.\n j = b.next, k = a.previous, sj = b._.r, sk = a._.r;\n do {\n if (sj <= sk) {\n if (intersects(j._, c._)) {\n b = j, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sj += j._.r, j = j.next;\n } else {\n if (intersects(k._, c._)) {\n a = k, a.next = b, b.previous = a, --i;\n continue pack;\n }\n sk += k._.r, k = k.previous;\n }\n } while (j !== k.next);\n\n // Success! Insert the new circle c between a and b.\n c.previous = a, c.next = b, a.next = b.previous = b = c;\n\n // Compute the new closest circle pair to the centroid.\n aa = score(a);\n while ((c = c.next) !== b) {\n if ((ca = score(c)) < aa) {\n a = c, aa = ca;\n }\n }\n b = a.next;\n }\n\n // Compute the enclosing circle of the front chain.\n a = [b._], c = b; while ((c = c.next) !== b) a.push(c._); c = packEncloseRandom(a, random);\n\n // Translate the circles to put the enclosing circle around the origin.\n for (i = 0; i < n; ++i) a = circles[i], a.x -= c.x, a.y -= c.y;\n\n return c.r;\n}\n\nexport default function(circles) {\n packSiblingsRandom(circles, lcg());\n return circles;\n}\n","export default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n\nexport function shuffle(array, random) {\n let m = array.length,\n t,\n i;\n\n while (m) {\n i = random() * m-- | 0;\n t = array[m];\n array[m] = array[i];\n array[i] = t;\n }\n\n return array;\n}\n","import {optional} from \"../accessors.js\";\nimport constant, {constantZero} from \"../constant.js\";\nimport lcg from \"../lcg.js\";\nimport {packSiblingsRandom} from \"./siblings.js\";\n\nfunction defaultRadius(d) {\n return Math.sqrt(d.value);\n}\n\nexport default function() {\n var radius = null,\n dx = 1,\n dy = 1,\n padding = constantZero;\n\n function pack(root) {\n const random = lcg();\n root.x = dx / 2, root.y = dy / 2;\n if (radius) {\n root.eachBefore(radiusLeaf(radius))\n .eachAfter(packChildrenRandom(padding, 0.5, random))\n .eachBefore(translateChild(1));\n } else {\n root.eachBefore(radiusLeaf(defaultRadius))\n .eachAfter(packChildrenRandom(constantZero, 1, random))\n .eachAfter(packChildrenRandom(padding, root.r / Math.min(dx, dy), random))\n .eachBefore(translateChild(Math.min(dx, dy) / (2 * root.r)));\n }\n return root;\n }\n\n pack.radius = function(x) {\n return arguments.length ? (radius = optional(x), pack) : radius;\n };\n\n pack.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], pack) : [dx, dy];\n };\n\n pack.padding = function(x) {\n return arguments.length ? (padding = typeof x === \"function\" ? x : constant(+x), pack) : padding;\n };\n\n return pack;\n}\n\nfunction radiusLeaf(radius) {\n return function(node) {\n if (!node.children) {\n node.r = Math.max(0, +radius(node) || 0);\n }\n };\n}\n\nfunction packChildrenRandom(padding, k, random) {\n return function(node) {\n if (children = node.children) {\n var children,\n i,\n n = children.length,\n r = padding(node) * k || 0,\n e;\n\n if (r) for (i = 0; i < n; ++i) children[i].r += r;\n e = packSiblingsRandom(children, random);\n if (r) for (i = 0; i < n; ++i) children[i].r -= r;\n node.r = e + r;\n }\n };\n}\n\nfunction translateChild(k) {\n return function(node) {\n var parent = node.parent;\n node.r *= k;\n if (parent) {\n node.x = parent.x + k * node.x;\n node.y = parent.y + k * node.y;\n }\n };\n}\n","export default function(node) {\n node.x0 = Math.round(node.x0);\n node.y0 = Math.round(node.y0);\n node.x1 = Math.round(node.x1);\n node.y1 = Math.round(node.y1);\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (x1 - x0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.y0 = y0, node.y1 = y1;\n node.x0 = x0, node.x1 = x0 += node.value * k;\n }\n}\n","import {optional} from \"./accessors.js\";\nimport {Node, computeHeight} from \"./hierarchy/index.js\";\n\nvar preroot = {depth: -1},\n ambiguous = {},\n imputed = {};\n\nfunction defaultId(d) {\n return d.id;\n}\n\nfunction defaultParentId(d) {\n return d.parentId;\n}\n\nexport default function() {\n var id = defaultId,\n parentId = defaultParentId,\n path;\n\n function stratify(data) {\n var nodes = Array.from(data),\n currentId = id,\n currentParentId = parentId,\n n,\n d,\n i,\n root,\n parent,\n node,\n nodeId,\n nodeKey,\n nodeByKey = new Map;\n\n if (path != null) {\n const I = nodes.map((d, i) => normalize(path(d, i, data)));\n const P = I.map(parentof);\n const S = new Set(I).add(\"\");\n for (const i of P) {\n if (!S.has(i)) {\n S.add(i);\n I.push(i);\n P.push(parentof(i));\n nodes.push(imputed);\n }\n }\n currentId = (_, i) => I[i];\n currentParentId = (_, i) => P[i];\n }\n\n for (i = 0, n = nodes.length; i < n; ++i) {\n d = nodes[i], node = nodes[i] = new Node(d);\n if ((nodeId = currentId(d, i, data)) != null && (nodeId += \"\")) {\n nodeKey = node.id = nodeId;\n nodeByKey.set(nodeKey, nodeByKey.has(nodeKey) ? ambiguous : node);\n }\n if ((nodeId = currentParentId(d, i, data)) != null && (nodeId += \"\")) {\n node.parent = nodeId;\n }\n }\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n if (nodeId = node.parent) {\n parent = nodeByKey.get(nodeId);\n if (!parent) throw new Error(\"missing: \" + nodeId);\n if (parent === ambiguous) throw new Error(\"ambiguous: \" + nodeId);\n if (parent.children) parent.children.push(node);\n else parent.children = [node];\n node.parent = parent;\n } else {\n if (root) throw new Error(\"multiple roots\");\n root = node;\n }\n }\n\n if (!root) throw new Error(\"no root\");\n\n // When imputing internal nodes, only introduce roots if needed.\n // Then replace the imputed marker data with null.\n if (path != null) {\n while (root.data === imputed && root.children.length === 1) {\n root = root.children[0], --n;\n }\n for (let i = nodes.length - 1; i >= 0; --i) {\n node = nodes[i];\n if (node.data !== imputed) break;\n node.data = null;\n }\n }\n\n root.parent = preroot;\n root.eachBefore(function(node) { node.depth = node.parent.depth + 1; --n; }).eachBefore(computeHeight);\n root.parent = null;\n if (n > 0) throw new Error(\"cycle\");\n\n return root;\n }\n\n stratify.id = function(x) {\n return arguments.length ? (id = optional(x), stratify) : id;\n };\n\n stratify.parentId = function(x) {\n return arguments.length ? (parentId = optional(x), stratify) : parentId;\n };\n\n stratify.path = function(x) {\n return arguments.length ? (path = optional(x), stratify) : path;\n };\n\n return stratify;\n}\n\n// To normalize a path, we coerce to a string, strip the trailing slash if any\n// (as long as the trailing slash is not immediately preceded by another slash),\n// and add leading slash if missing.\nfunction normalize(path) {\n path = `${path}`;\n let i = path.length;\n if (slash(path, i - 1) && !slash(path, i - 2)) path = path.slice(0, -1);\n return path[0] === \"/\" ? path : `/${path}`;\n}\n\n// Walk backwards to find the first slash that is not the leading slash, e.g.:\n// \"/foo/bar\" ⇥ \"/foo\", \"/foo\" ⇥ \"/\", \"/\" ↦ \"\". (The root is special-cased\n// because the id of the root must be a truthy value.)\nfunction parentof(path) {\n let i = path.length;\n if (i < 2) return \"\";\n while (--i > 1) if (slash(path, i)) break;\n return path.slice(0, i);\n}\n\n// Slashes can be escaped; to determine whether a slash is a path delimiter, we\n// count the number of preceding backslashes escaping the forward slash: an odd\n// number indicates an escaped forward slash.\nfunction slash(path, i) {\n if (path[i] === \"/\") {\n let k = 0;\n while (i > 0 && path[--i] === \"\\\\\") ++k;\n if ((k & 1) === 0) return true;\n }\n return false;\n}\n","import {Node} from \"./hierarchy/index.js\";\n\nfunction defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\n// function radialSeparation(a, b) {\n// return (a.parent === b.parent ? 1 : 2) / a.depth;\n// }\n\n// This function is used to traverse the left contour of a subtree (or\n// subforest). It returns the successor of v on this contour. This successor is\n// either given by the leftmost child of v or by the thread of v. The function\n// returns null if and only if v is on the highest level of its subtree.\nfunction nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n}\n\n// This function works analogously to nextLeft.\nfunction nextRight(v) {\n var children = v.children;\n return children ? children[children.length - 1] : v.t;\n}\n\n// Shifts the current subtree rooted at w+. This is done by increasing\n// prelim(w+) and mod(w+) by shift.\nfunction moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}\n\n// All other shifts, applied to the smaller subtrees between w- and w+, are\n// performed by this function. To prepare the shifts, we have to adjust\n// change(w+), shift(w+), and change(w-).\nfunction executeShifts(v) {\n var shift = 0,\n change = 0,\n children = v.children,\n i = children.length,\n w;\n while (--i >= 0) {\n w = children[i];\n w.z += shift;\n w.m += shift;\n shift += w.s + (change += w.c);\n }\n}\n\n// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise,\n// returns the specified (default) ancestor.\nfunction nextAncestor(vim, v, ancestor) {\n return vim.a.parent === v.parent ? vim.a : ancestor;\n}\n\nfunction TreeNode(node, i) {\n this._ = node;\n this.parent = null;\n this.children = null;\n this.A = null; // default ancestor\n this.a = this; // ancestor\n this.z = 0; // prelim\n this.m = 0; // mod\n this.c = 0; // change\n this.s = 0; // shift\n this.t = null; // thread\n this.i = i; // number\n}\n\nTreeNode.prototype = Object.create(Node.prototype);\n\nfunction treeRoot(root) {\n var tree = new TreeNode(root, 0),\n node,\n nodes = [tree],\n child,\n children,\n i,\n n;\n\n while (node = nodes.pop()) {\n if (children = node._.children) {\n node.children = new Array(n = children.length);\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = node.children[i] = new TreeNode(children[i], i));\n child.parent = node;\n }\n }\n }\n\n (tree.parent = new TreeNode(null, 0)).children = [tree];\n return tree;\n}\n\n// Node-link tree diagram using the Reingold-Tilford \"tidy\" algorithm\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}\n","function defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\nfunction meanX(children) {\n return children.reduce(meanXReduce, 0) / children.length;\n}\n\nfunction meanXReduce(x, c) {\n return x + c.x;\n}\n\nfunction maxY(children) {\n return 1 + children.reduce(maxYReduce, 0);\n}\n\nfunction maxYReduce(y, c) {\n return Math.max(y, c.y);\n}\n\nfunction leafLeft(node) {\n var children;\n while (children = node.children) node = children[0];\n return node;\n}\n\nfunction leafRight(node) {\n var children;\n while (children = node.children) node = children[children.length - 1];\n return node;\n}\n\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = false;\n\n function cluster(root) {\n var previousNode,\n x = 0;\n\n // First walk, computing the initial x & y values.\n root.eachAfter(function(node) {\n var children = node.children;\n if (children) {\n node.x = meanX(children);\n node.y = maxY(children);\n } else {\n node.x = previousNode ? x += separation(node, previousNode) : 0;\n node.y = 0;\n previousNode = node;\n }\n });\n\n var left = leafLeft(root),\n right = leafRight(root),\n x0 = left.x - separation(left, right) / 2,\n x1 = right.x + separation(right, left) / 2;\n\n // Second walk, normalizing x & y to the desired size.\n return root.eachAfter(nodeSize ? function(node) {\n node.x = (node.x - root.x) * dx;\n node.y = (root.y - node.y) * dy;\n } : function(node) {\n node.x = (node.x - x0) / (x1 - x0) * dx;\n node.y = (1 - (root.y ? node.y / root.y : 1)) * dy;\n });\n }\n\n cluster.separation = function(x) {\n return arguments.length ? (separation = x, cluster) : separation;\n };\n\n cluster.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? null : [dx, dy]);\n };\n\n cluster.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? [dx, dy] : null);\n };\n\n return cluster;\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n node,\n i = -1,\n n = nodes.length,\n k = parent.value && (y1 - y0) / parent.value;\n\n while (++i < n) {\n node = nodes[i], node.x0 = x0, node.x1 = x1;\n node.y0 = y0, node.y1 = y0 += node.value * k;\n }\n}\n","import treemapDice from \"./dice.js\";\nimport treemapSlice from \"./slice.js\";\n\nexport var phi = (1 + Math.sqrt(5)) / 2;\n\nexport function squarifyRatio(ratio, parent, x0, y0, x1, y1) {\n var rows = [],\n nodes = parent.children,\n row,\n nodeValue,\n i0 = 0,\n i1 = 0,\n n = nodes.length,\n dx, dy,\n value = parent.value,\n sumValue,\n minValue,\n maxValue,\n newRatio,\n minRatio,\n alpha,\n beta;\n\n while (i0 < n) {\n dx = x1 - x0, dy = y1 - y0;\n\n // Find the next non-empty node.\n do sumValue = nodes[i1++].value; while (!sumValue && i1 < n);\n minValue = maxValue = sumValue;\n alpha = Math.max(dy / dx, dx / dy) / (value * ratio);\n beta = sumValue * sumValue * alpha;\n minRatio = Math.max(maxValue / beta, beta / minValue);\n\n // Keep adding nodes while the aspect ratio maintains or improves.\n for (; i1 < n; ++i1) {\n sumValue += nodeValue = nodes[i1].value;\n if (nodeValue < minValue) minValue = nodeValue;\n if (nodeValue > maxValue) maxValue = nodeValue;\n beta = sumValue * sumValue * alpha;\n newRatio = Math.max(maxValue / beta, beta / minValue);\n if (newRatio > minRatio) { sumValue -= nodeValue; break; }\n minRatio = newRatio;\n }\n\n // Position and record the row orientation.\n rows.push(row = {value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1)});\n if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);\n else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);\n value -= sumValue, i0 = i1;\n }\n\n return rows;\n}\n\nexport default (function custom(ratio) {\n\n function squarify(parent, x0, y0, x1, y1) {\n squarifyRatio(ratio, parent, x0, y0, x1, y1);\n }\n\n squarify.ratio = function(x) {\n return custom((x = +x) > 1 ? x : 1);\n };\n\n return squarify;\n})(phi);\n","import treemapDice from \"./dice.js\";\nimport treemapSlice from \"./slice.js\";\nimport {phi, squarifyRatio} from \"./squarify.js\";\n\nexport default (function custom(ratio) {\n\n function resquarify(parent, x0, y0, x1, y1) {\n if ((rows = parent._squarify) && (rows.ratio === ratio)) {\n var rows,\n row,\n nodes,\n i,\n j = -1,\n n,\n m = rows.length,\n value = parent.value;\n\n while (++j < m) {\n row = rows[j], nodes = row.children;\n for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value;\n if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += (y1 - y0) * row.value / value : y1);\n else treemapSlice(row, x0, y0, value ? x0 += (x1 - x0) * row.value / value : x1, y1);\n value -= row.value;\n }\n } else {\n parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);\n rows.ratio = ratio;\n }\n }\n\n resquarify.ratio = function(x) {\n return custom((x = +x) > 1 ? x : 1);\n };\n\n return resquarify;\n})(phi);\n","import { Transform, isTuple, ingest, tupleid, stableCompare } from 'vega-dataflow';\nimport { inherits, error, array, one, truthy, hasOwnProperty } from 'vega-util';\nimport { hierarchy, pack, partition, stratify, tree, cluster, treemap, treemapBinary, treemapDice, treemapSlice, treemapSliceDice, treemapSquarify, treemapResquarify } from 'd3-hierarchy';\n\n// Build lookup table mapping tuple keys to tree node instances\nfunction lookup (tree, key, filter) {\n const map = {};\n tree.each(node => {\n const t = node.data;\n if (filter(t)) map[key(t)] = node;\n });\n tree.lookup = map;\n return tree;\n}\n\n/**\n * Nest tuples into a tree structure, grouped by key values.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.keys - The key fields to nest by, in order.\n * @param {boolean} [params.generate=false] - A boolean flag indicating if\n * non-leaf nodes generated by this transform should be included in the\n * output. The default (false) includes only the input data (leaf nodes)\n * in the data stream.\n */\nfunction Nest(params) {\n Transform.call(this, null, params);\n}\nNest.Definition = {\n 'type': 'Nest',\n 'metadata': {\n 'treesource': true,\n 'changes': true\n },\n 'params': [{\n 'name': 'keys',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'generate',\n 'type': 'boolean'\n }]\n};\nconst children = n => n.values;\ninherits(Nest, Transform, {\n transform(_, pulse) {\n if (!pulse.source) {\n error('Nest transform requires an upstream data source.');\n }\n var gen = _.generate,\n mod = _.modified(),\n out = pulse.clone(),\n tree = this.value;\n if (!tree || mod || pulse.changed()) {\n // collect nodes to remove\n if (tree) {\n tree.each(node => {\n if (node.children && isTuple(node.data)) {\n out.rem.push(node.data);\n }\n });\n }\n\n // generate new tree structure\n this.value = tree = hierarchy({\n values: array(_.keys).reduce((n, k) => {\n n.key(k);\n return n;\n }, nest()).entries(out.source)\n }, children);\n\n // collect nodes to add\n if (gen) {\n tree.each(node => {\n if (node.children) {\n node = ingest(node.data);\n out.add.push(node);\n out.source.push(node);\n }\n });\n }\n\n // build lookup table\n lookup(tree, tupleid, tupleid);\n }\n out.source.root = tree;\n return out;\n }\n});\nfunction nest() {\n const keys = [],\n nest = {\n entries: array => entries(apply(array, 0), 0),\n key: d => (keys.push(d), nest)\n };\n function apply(array, depth) {\n if (depth >= keys.length) {\n return array;\n }\n const n = array.length,\n key = keys[depth++],\n valuesByKey = {},\n result = {};\n let i = -1,\n keyValue,\n value,\n values;\n while (++i < n) {\n keyValue = key(value = array[i]) + '';\n if (values = valuesByKey[keyValue]) {\n values.push(value);\n } else {\n valuesByKey[keyValue] = [value];\n }\n }\n for (keyValue in valuesByKey) {\n result[keyValue] = apply(valuesByKey[keyValue], depth);\n }\n return result;\n }\n function entries(map, depth) {\n if (++depth > keys.length) return map;\n const array = [];\n for (const key in map) {\n array.push({\n key,\n values: entries(map[key], depth)\n });\n }\n return array;\n }\n return nest;\n}\n\n/**\n * Abstract class for tree layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction HierarchyLayout(params) {\n Transform.call(this, null, params);\n}\nconst defaultSeparation = (a, b) => a.parent === b.parent ? 1 : 2;\ninherits(HierarchyLayout, Transform, {\n transform(_, pulse) {\n if (!pulse.source || !pulse.source.root) {\n error(this.constructor.name + ' transform requires a backing tree data source.');\n }\n const layout = this.layout(_.method),\n fields = this.fields,\n root = pulse.source.root,\n as = _.as || fields;\n if (_.field) root.sum(_.field);else root.count();\n if (_.sort) root.sort(stableCompare(_.sort, d => d.data));\n setParams(layout, this.params, _);\n if (layout.separation) {\n layout.separation(_.separation !== false ? defaultSeparation : one);\n }\n try {\n this.value = layout(root);\n } catch (err) {\n error(err);\n }\n root.each(node => setFields(node, fields, as));\n return pulse.reflow(_.modified()).modifies(as).modifies('leaf');\n }\n});\nfunction setParams(layout, params, _) {\n for (let p, i = 0, n = params.length; i < n; ++i) {\n p = params[i];\n if (p in _) layout[p](_[p]);\n }\n}\nfunction setFields(node, fields, as) {\n const t = node.data,\n n = fields.length - 1;\n for (let i = 0; i < n; ++i) {\n t[as[i]] = node[fields[i]];\n }\n t[as[n]] = node.children ? node.children.length : 0;\n}\n\nconst Output$3 = ['x', 'y', 'r', 'depth', 'children'];\n\n/**\n * Packed circle tree layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size nodes.\n */\nfunction Pack(params) {\n HierarchyLayout.call(this, params);\n}\nPack.Definition = {\n 'type': 'Pack',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'radius',\n 'type': 'field',\n 'default': null\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output$3.length,\n 'default': Output$3\n }]\n};\ninherits(Pack, HierarchyLayout, {\n layout: pack,\n params: ['radius', 'size', 'padding'],\n fields: Output$3\n});\n\nconst Output$2 = ['x0', 'y0', 'x1', 'y1', 'depth', 'children'];\n\n/**\n * Partition tree layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size nodes.\n */\nfunction Partition(params) {\n HierarchyLayout.call(this, params);\n}\nPartition.Definition = {\n 'type': 'Partition',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'round',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output$2.length,\n 'default': Output$2\n }]\n};\ninherits(Partition, HierarchyLayout, {\n layout: partition,\n params: ['size', 'round', 'padding'],\n fields: Output$2\n});\n\n/**\n * Stratify a collection of tuples into a tree structure based on\n * id and parent id fields.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.key - Unique key field for each tuple.\n * @param {function(object): *} params.parentKey - Field with key for parent tuple.\n */\nfunction Stratify(params) {\n Transform.call(this, null, params);\n}\nStratify.Definition = {\n 'type': 'Stratify',\n 'metadata': {\n 'treesource': true\n },\n 'params': [{\n 'name': 'key',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'parentKey',\n 'type': 'field',\n 'required': true\n }]\n};\ninherits(Stratify, Transform, {\n transform(_, pulse) {\n if (!pulse.source) {\n error('Stratify transform requires an upstream data source.');\n }\n let tree = this.value;\n const mod = _.modified(),\n out = pulse.fork(pulse.ALL).materialize(pulse.SOURCE),\n run = !tree || mod || pulse.changed(pulse.ADD_REM) || pulse.modified(_.key.fields) || pulse.modified(_.parentKey.fields);\n\n // prevent upstream source pollution\n out.source = out.source.slice();\n if (run) {\n tree = out.source.length ? lookup(stratify().id(_.key).parentId(_.parentKey)(out.source), _.key, truthy) : lookup(stratify()([{}]), _.key, _.key);\n }\n out.source.root = this.value = tree;\n return out;\n }\n});\n\nconst Layouts = {\n tidy: tree,\n cluster: cluster\n};\nconst Output$1 = ['x', 'y', 'depth', 'children'];\n\n/**\n * Tree layout. Depending on the method parameter, performs either\n * Reingold-Tilford 'tidy' layout or dendrogram 'cluster' layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction Tree(params) {\n HierarchyLayout.call(this, params);\n}\nTree.Definition = {\n 'type': 'Tree',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'method',\n 'type': 'enum',\n 'default': 'tidy',\n 'values': ['tidy', 'cluster']\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'nodeSize',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'separation',\n 'type': 'boolean',\n 'default': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output$1.length,\n 'default': Output$1\n }]\n};\ninherits(Tree, HierarchyLayout, {\n /**\n * Tree layout generator. Supports both 'tidy' and 'cluster' layouts.\n */\n layout(method) {\n const m = method || 'tidy';\n if (hasOwnProperty(Layouts, m)) return Layouts[m]();else error('Unrecognized Tree layout method: ' + m);\n },\n params: ['size', 'nodeSize'],\n fields: Output$1\n});\n\n/**\n * Generate tuples representing links between tree nodes.\n * The resulting tuples will contain 'source' and 'target' fields,\n * which point to parent and child node tuples, respectively.\n * @constructor\n * @param {object} params - The parameters for this operator.\n */\nfunction TreeLinks(params) {\n Transform.call(this, [], params);\n}\nTreeLinks.Definition = {\n 'type': 'TreeLinks',\n 'metadata': {\n 'tree': true,\n 'generates': true,\n 'changes': true\n },\n 'params': []\n};\ninherits(TreeLinks, Transform, {\n transform(_, pulse) {\n const links = this.value,\n tree = pulse.source && pulse.source.root,\n out = pulse.fork(pulse.NO_SOURCE),\n lut = {};\n if (!tree) error('TreeLinks transform requires a tree data source.');\n if (pulse.changed(pulse.ADD_REM)) {\n // remove previous links\n out.rem = links;\n\n // build lookup table of valid tuples\n pulse.visit(pulse.SOURCE, t => lut[tupleid(t)] = 1);\n\n // generate links for all edges incident on valid tuples\n tree.each(node => {\n const t = node.data,\n p = node.parent && node.parent.data;\n if (p && lut[tupleid(t)] && lut[tupleid(p)]) {\n out.add.push(ingest({\n source: p,\n target: t\n }));\n }\n });\n this.value = out.add;\n } else if (pulse.changed(pulse.MOD)) {\n // build lookup table of modified tuples\n pulse.visit(pulse.MOD, t => lut[tupleid(t)] = 1);\n\n // gather links incident on modified tuples\n links.forEach(link => {\n if (lut[tupleid(link.source)] || lut[tupleid(link.target)]) {\n out.mod.push(link);\n }\n });\n }\n return out;\n }\n});\n\nconst Tiles = {\n binary: treemapBinary,\n dice: treemapDice,\n slice: treemapSlice,\n slicedice: treemapSliceDice,\n squarify: treemapSquarify,\n resquarify: treemapResquarify\n};\nconst Output = ['x0', 'y0', 'x1', 'y1', 'depth', 'children'];\n\n/**\n * Treemap layout.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.field - The value field to size nodes.\n */\nfunction Treemap(params) {\n HierarchyLayout.call(this, params);\n}\nTreemap.Definition = {\n 'type': 'Treemap',\n 'metadata': {\n 'tree': true,\n 'modifies': true\n },\n 'params': [{\n 'name': 'field',\n 'type': 'field'\n }, {\n 'name': 'sort',\n 'type': 'compare'\n }, {\n 'name': 'method',\n 'type': 'enum',\n 'default': 'squarify',\n 'values': ['squarify', 'resquarify', 'binary', 'dice', 'slice', 'slicedice']\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingInner',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingOuter',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingTop',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingRight',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingBottom',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'paddingLeft',\n 'type': 'number',\n 'default': 0\n }, {\n 'name': 'ratio',\n 'type': 'number',\n 'default': 1.618033988749895\n }, {\n 'name': 'round',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': Output.length,\n 'default': Output\n }]\n};\ninherits(Treemap, HierarchyLayout, {\n /**\n * Treemap layout generator. Adds 'method' and 'ratio' parameters\n * to configure the underlying tile method.\n */\n layout() {\n const x = treemap();\n x.ratio = _ => {\n const t = x.tile();\n if (t.ratio) x.tile(t.ratio(_));\n };\n x.method = _ => {\n if (hasOwnProperty(Tiles, _)) x.tile(Tiles[_]);else error('Unrecognized Treemap layout method: ' + _);\n };\n return x;\n },\n params: ['method', 'ratio', 'size', 'round', 'padding', 'paddingInner', 'paddingOuter', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n fields: Output\n});\n\nexport { Nest as nest, Pack as pack, Partition as partition, Stratify as stratify, Tree as tree, TreeLinks as treelinks, Treemap as treemap };\n","import roundNode from \"./treemap/round.js\";\nimport treemapDice from \"./treemap/dice.js\";\n\nexport default function() {\n var dx = 1,\n dy = 1,\n padding = 0,\n round = false;\n\n function partition(root) {\n var n = root.height + 1;\n root.x0 =\n root.y0 = padding;\n root.x1 = dx;\n root.y1 = dy / n;\n root.eachBefore(positionNode(dy, n));\n if (round) root.eachBefore(roundNode);\n return root;\n }\n\n function positionNode(dy, n) {\n return function(node) {\n if (node.children) {\n treemapDice(node, node.x0, dy * (node.depth + 1) / n, node.x1, dy * (node.depth + 2) / n);\n }\n var x0 = node.x0,\n y0 = node.y0,\n x1 = node.x1 - padding,\n y1 = node.y1 - padding;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n };\n }\n\n partition.round = function(x) {\n return arguments.length ? (round = !!x, partition) : round;\n };\n\n partition.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], partition) : [dx, dy];\n };\n\n partition.padding = function(x) {\n return arguments.length ? (padding = +x, partition) : padding;\n };\n\n return partition;\n}\n","export default function(parent, x0, y0, x1, y1) {\n var nodes = parent.children,\n i, n = nodes.length,\n sum, sums = new Array(n + 1);\n\n for (sums[0] = sum = i = 0; i < n; ++i) {\n sums[i + 1] = sum += nodes[i].value;\n }\n\n partition(0, n, parent.value, x0, y0, x1, y1);\n\n function partition(i, j, value, x0, y0, x1, y1) {\n if (i >= j - 1) {\n var node = nodes[i];\n node.x0 = x0, node.y0 = y0;\n node.x1 = x1, node.y1 = y1;\n return;\n }\n\n var valueOffset = sums[i],\n valueTarget = (value / 2) + valueOffset,\n k = i + 1,\n hi = j - 1;\n\n while (k < hi) {\n var mid = k + hi >>> 1;\n if (sums[mid] < valueTarget) k = mid + 1;\n else hi = mid;\n }\n\n if ((valueTarget - sums[k - 1]) < (sums[k] - valueTarget) && i + 1 < k) --k;\n\n var valueLeft = sums[k] - valueOffset,\n valueRight = value - valueLeft;\n\n if ((x1 - x0) > (y1 - y0)) {\n var xk = value ? (x0 * valueRight + x1 * valueLeft) / value : x1;\n partition(i, k, valueLeft, x0, y0, xk, y1);\n partition(k, j, valueRight, xk, y0, x1, y1);\n } else {\n var yk = value ? (y0 * valueRight + y1 * valueLeft) / value : y1;\n partition(i, k, valueLeft, x0, y0, x1, yk);\n partition(k, j, valueRight, x0, yk, x1, y1);\n }\n }\n}\n","import dice from \"./dice.js\";\nimport slice from \"./slice.js\";\n\nexport default function(parent, x0, y0, x1, y1) {\n (parent.depth & 1 ? slice : dice)(parent, x0, y0, x1, y1);\n}\n","import roundNode from \"./round.js\";\nimport squarify from \"./squarify.js\";\nimport {required} from \"../accessors.js\";\nimport constant, {constantZero} from \"../constant.js\";\n\nexport default function() {\n var tile = squarify,\n round = false,\n dx = 1,\n dy = 1,\n paddingStack = [0],\n paddingInner = constantZero,\n paddingTop = constantZero,\n paddingRight = constantZero,\n paddingBottom = constantZero,\n paddingLeft = constantZero;\n\n function treemap(root) {\n root.x0 =\n root.y0 = 0;\n root.x1 = dx;\n root.y1 = dy;\n root.eachBefore(positionNode);\n paddingStack = [0];\n if (round) root.eachBefore(roundNode);\n return root;\n }\n\n function positionNode(node) {\n var p = paddingStack[node.depth],\n x0 = node.x0 + p,\n y0 = node.y0 + p,\n x1 = node.x1 - p,\n y1 = node.y1 - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n node.x0 = x0;\n node.y0 = y0;\n node.x1 = x1;\n node.y1 = y1;\n if (node.children) {\n p = paddingStack[node.depth + 1] = paddingInner(node) / 2;\n x0 += paddingLeft(node) - p;\n y0 += paddingTop(node) - p;\n x1 -= paddingRight(node) - p;\n y1 -= paddingBottom(node) - p;\n if (x1 < x0) x0 = x1 = (x0 + x1) / 2;\n if (y1 < y0) y0 = y1 = (y0 + y1) / 2;\n tile(node, x0, y0, x1, y1);\n }\n }\n\n treemap.round = function(x) {\n return arguments.length ? (round = !!x, treemap) : round;\n };\n\n treemap.size = function(x) {\n return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];\n };\n\n treemap.tile = function(x) {\n return arguments.length ? (tile = required(x), treemap) : tile;\n };\n\n treemap.padding = function(x) {\n return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();\n };\n\n treemap.paddingInner = function(x) {\n return arguments.length ? (paddingInner = typeof x === \"function\" ? x : constant(+x), treemap) : paddingInner;\n };\n\n treemap.paddingOuter = function(x) {\n return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();\n };\n\n treemap.paddingTop = function(x) {\n return arguments.length ? (paddingTop = typeof x === \"function\" ? x : constant(+x), treemap) : paddingTop;\n };\n\n treemap.paddingRight = function(x) {\n return arguments.length ? (paddingRight = typeof x === \"function\" ? x : constant(+x), treemap) : paddingRight;\n };\n\n treemap.paddingBottom = function(x) {\n return arguments.length ? (paddingBottom = typeof x === \"function\" ? x : constant(+x), treemap) : paddingBottom;\n };\n\n treemap.paddingLeft = function(x) {\n return arguments.length ? (paddingLeft = typeof x === \"function\" ? x : constant(+x), treemap) : paddingLeft;\n };\n\n return treemap;\n}\n","import { Marks, textMetrics } from 'vega-scenegraph';\nimport { canvas } from 'vega-canvas';\nimport { rederive, Transform } from 'vega-dataflow';\nimport { inherits, error, array, isFunction } from 'vega-util';\n\n// bit mask for getting first 2 bytes of alpha value\nconst ALPHA_MASK = 0xff000000;\nfunction baseBitmaps($, data) {\n const bitmap = $.bitmap();\n // when there is no base mark but data points are to be avoided\n (data || []).forEach(d => bitmap.set($(d.boundary[0]), $(d.boundary[3])));\n return [bitmap, undefined];\n}\nfunction markBitmaps($, baseMark, avoidMarks, labelInside, isGroupArea) {\n // create canvas\n const width = $.width,\n height = $.height,\n border = labelInside || isGroupArea,\n context = canvas(width, height).getContext('2d'),\n baseMarkContext = canvas(width, height).getContext('2d'),\n strokeContext = border && canvas(width, height).getContext('2d');\n\n // render all marks to be avoided into canvas\n avoidMarks.forEach(items => draw(context, items, false));\n draw(baseMarkContext, baseMark, false);\n if (border) {\n draw(strokeContext, baseMark, true);\n }\n\n // get canvas buffer, create bitmaps\n const buffer = getBuffer(context, width, height),\n baseMarkBuffer = getBuffer(baseMarkContext, width, height),\n strokeBuffer = border && getBuffer(strokeContext, width, height),\n layer1 = $.bitmap(),\n layer2 = border && $.bitmap();\n\n // populate bitmap layers\n let x, y, u, v, index, alpha, strokeAlpha, baseMarkAlpha;\n for (y = 0; y < height; ++y) {\n for (x = 0; x < width; ++x) {\n index = y * width + x;\n alpha = buffer[index] & ALPHA_MASK;\n baseMarkAlpha = baseMarkBuffer[index] & ALPHA_MASK;\n strokeAlpha = border && strokeBuffer[index] & ALPHA_MASK;\n if (alpha || strokeAlpha || baseMarkAlpha) {\n u = $(x);\n v = $(y);\n if (!isGroupArea && (alpha || baseMarkAlpha)) layer1.set(u, v); // update interior bitmap\n if (border && (alpha || strokeAlpha)) layer2.set(u, v); // update border bitmap\n }\n }\n }\n return [layer1, layer2];\n}\nfunction getBuffer(context, width, height) {\n return new Uint32Array(context.getImageData(0, 0, width, height).data.buffer);\n}\nfunction draw(context, items, interior) {\n if (!items.length) return;\n const type = items[0].mark.marktype;\n if (type === 'group') {\n items.forEach(group => {\n group.items.forEach(mark => draw(context, mark.items, interior));\n });\n } else {\n Marks[type].draw(context, {\n items: interior ? items.map(prepare) : items\n });\n }\n}\n\n/**\n * Prepare item before drawing into canvas (setting stroke and opacity)\n * @param {object} source item to be prepared\n * @returns prepared item\n */\nfunction prepare(source) {\n const item = rederive(source, {});\n if (item.stroke && item.strokeOpacity !== 0 || item.fill && item.fillOpacity !== 0) {\n return {\n ...item,\n strokeOpacity: 1,\n stroke: '#000',\n fillOpacity: 0\n };\n }\n return item;\n}\n\nconst DIV = 5,\n // bit shift from x, y index to bit vector array index\n MOD = 31,\n // bit mask for index lookup within a bit vector\n SIZE = 32,\n // individual bit vector size\n RIGHT0 = new Uint32Array(SIZE + 1),\n // left-anchored bit vectors, full -> 0\n RIGHT1 = new Uint32Array(SIZE + 1); // right-anchored bit vectors, 0 -> full\n\nRIGHT1[0] = 0;\nRIGHT0[0] = ~RIGHT1[0];\nfor (let i = 1; i <= SIZE; ++i) {\n RIGHT1[i] = RIGHT1[i - 1] << 1 | 1;\n RIGHT0[i] = ~RIGHT1[i];\n}\nfunction Bitmap (w, h) {\n const array = new Uint32Array(~~((w * h + SIZE) / SIZE));\n function _set(index, mask) {\n array[index] |= mask;\n }\n function _clear(index, mask) {\n array[index] &= mask;\n }\n return {\n array: array,\n get: (x, y) => {\n const index = y * w + x;\n return array[index >>> DIV] & 1 << (index & MOD);\n },\n set: (x, y) => {\n const index = y * w + x;\n _set(index >>> DIV, 1 << (index & MOD));\n },\n clear: (x, y) => {\n const index = y * w + x;\n _clear(index >>> DIV, ~(1 << (index & MOD)));\n },\n getRange: (x, y, x2, y2) => {\n let r = y2,\n start,\n end,\n indexStart,\n indexEnd;\n for (; r >= y; --r) {\n start = r * w + x;\n end = r * w + x2;\n indexStart = start >>> DIV;\n indexEnd = end >>> DIV;\n if (indexStart === indexEnd) {\n if (array[indexStart] & RIGHT0[start & MOD] & RIGHT1[(end & MOD) + 1]) {\n return true;\n }\n } else {\n if (array[indexStart] & RIGHT0[start & MOD]) return true;\n if (array[indexEnd] & RIGHT1[(end & MOD) + 1]) return true;\n for (let i = indexStart + 1; i < indexEnd; ++i) {\n if (array[i]) return true;\n }\n }\n }\n return false;\n },\n setRange: (x, y, x2, y2) => {\n let start, end, indexStart, indexEnd, i;\n for (; y <= y2; ++y) {\n start = y * w + x;\n end = y * w + x2;\n indexStart = start >>> DIV;\n indexEnd = end >>> DIV;\n if (indexStart === indexEnd) {\n _set(indexStart, RIGHT0[start & MOD] & RIGHT1[(end & MOD) + 1]);\n } else {\n _set(indexStart, RIGHT0[start & MOD]);\n _set(indexEnd, RIGHT1[(end & MOD) + 1]);\n for (i = indexStart + 1; i < indexEnd; ++i) _set(i, 0xffffffff);\n }\n }\n },\n clearRange: (x, y, x2, y2) => {\n let start, end, indexStart, indexEnd, i;\n for (; y <= y2; ++y) {\n start = y * w + x;\n end = y * w + x2;\n indexStart = start >>> DIV;\n indexEnd = end >>> DIV;\n if (indexStart === indexEnd) {\n _clear(indexStart, RIGHT1[start & MOD] | RIGHT0[(end & MOD) + 1]);\n } else {\n _clear(indexStart, RIGHT1[start & MOD]);\n _clear(indexEnd, RIGHT0[(end & MOD) + 1]);\n for (i = indexStart + 1; i < indexEnd; ++i) _clear(i, 0);\n }\n }\n },\n outOfBounds: (x, y, x2, y2) => x < 0 || y < 0 || y2 >= h || x2 >= w\n };\n}\n\nfunction scaler (width, height, padding) {\n const ratio = Math.max(1, Math.sqrt(width * height / 1e6)),\n w = ~~((width + 2 * padding + ratio) / ratio),\n h = ~~((height + 2 * padding + ratio) / ratio),\n scale = _ => ~~((_ + padding) / ratio);\n scale.invert = _ => _ * ratio - padding;\n scale.bitmap = () => Bitmap(w, h);\n scale.ratio = ratio;\n scale.padding = padding;\n scale.width = width;\n scale.height = height;\n return scale;\n}\n\nfunction placeAreaLabelNaive ($, bitmaps, avoidBaseMark, markIndex) {\n const width = $.width,\n height = $.height;\n\n // try to place a label within an input area mark\n return function (d) {\n const items = d.datum.datum.items[markIndex].items,\n // area points\n n = items.length,\n // number of points\n textHeight = d.datum.fontSize,\n // label width\n textWidth = textMetrics.width(d.datum, d.datum.text); // label height\n\n let maxAreaWidth = 0,\n x1,\n x2,\n y1,\n y2,\n x,\n y,\n areaWidth;\n\n // for each area sample point\n for (let i = 0; i < n; ++i) {\n x1 = items[i].x;\n y1 = items[i].y;\n x2 = items[i].x2 === undefined ? x1 : items[i].x2;\n y2 = items[i].y2 === undefined ? y1 : items[i].y2;\n x = (x1 + x2) / 2;\n y = (y1 + y2) / 2;\n areaWidth = Math.abs(x2 - x1 + y2 - y1);\n if (areaWidth >= maxAreaWidth) {\n maxAreaWidth = areaWidth;\n d.x = x;\n d.y = y;\n }\n }\n x = textWidth / 2;\n y = textHeight / 2;\n x1 = d.x - x;\n x2 = d.x + x;\n y1 = d.y - y;\n y2 = d.y + y;\n d.align = 'center';\n if (x1 < 0 && x2 <= width) {\n d.align = 'left';\n } else if (0 <= x1 && width < x2) {\n d.align = 'right';\n }\n d.baseline = 'middle';\n if (y1 < 0 && y2 <= height) {\n d.baseline = 'top';\n } else if (0 <= y1 && height < y2) {\n d.baseline = 'bottom';\n }\n return true;\n };\n}\n\nfunction outOfBounds(x, y, textWidth, textHeight, width, height) {\n let r = textWidth / 2;\n return x - r < 0 || x + r > width || y - (r = textHeight / 2) < 0 || y + r > height;\n}\nfunction collision($, x, y, textHeight, textWidth, h, bm0, bm1) {\n const w = textWidth * h / (textHeight * 2),\n x1 = $(x - w),\n x2 = $(x + w),\n y1 = $(y - (h = h / 2)),\n y2 = $(y + h);\n return bm0.outOfBounds(x1, y1, x2, y2) || bm0.getRange(x1, y1, x2, y2) || bm1 && bm1.getRange(x1, y1, x2, y2);\n}\n\nfunction placeAreaLabelReducedSearch ($, bitmaps, avoidBaseMark, markIndex) {\n const width = $.width,\n height = $.height,\n bm0 = bitmaps[0],\n // where labels have been placed\n bm1 = bitmaps[1]; // area outlines\n\n function tryLabel(_x, _y, maxSize, textWidth, textHeight) {\n const x = $.invert(_x),\n y = $.invert(_y);\n let lo = maxSize,\n hi = height,\n mid;\n if (!outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, lo, bm0, bm1) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n // if the label fits at the current sample point,\n // perform binary search to find the largest font size that fits\n while (hi - lo >= 1) {\n mid = (lo + hi) / 2;\n if (collision($, x, y, textHeight, textWidth, mid, bm0, bm1)) {\n hi = mid;\n } else {\n lo = mid;\n }\n }\n // place label if current lower bound exceeds prior max font size\n if (lo > maxSize) {\n return [x, y, lo, true];\n }\n }\n }\n\n // try to place a label within an input area mark\n return function (d) {\n const items = d.datum.datum.items[markIndex].items,\n // area points\n n = items.length,\n // number of points\n textHeight = d.datum.fontSize,\n // label width\n textWidth = textMetrics.width(d.datum, d.datum.text); // label height\n\n let maxSize = avoidBaseMark ? textHeight : 0,\n labelPlaced = false,\n labelPlaced2 = false,\n maxAreaWidth = 0,\n x1,\n x2,\n y1,\n y2,\n x,\n y,\n _x,\n _y,\n _x1,\n _xMid,\n _x2,\n _y1,\n _yMid,\n _y2,\n areaWidth,\n result,\n swapTmp;\n\n // for each area sample point\n for (let i = 0; i < n; ++i) {\n x1 = items[i].x;\n y1 = items[i].y;\n x2 = items[i].x2 === undefined ? x1 : items[i].x2;\n y2 = items[i].y2 === undefined ? y1 : items[i].y2;\n if (x1 > x2) {\n swapTmp = x1;\n x1 = x2;\n x2 = swapTmp;\n }\n if (y1 > y2) {\n swapTmp = y1;\n y1 = y2;\n y2 = swapTmp;\n }\n _x1 = $(x1);\n _x2 = $(x2);\n _xMid = ~~((_x1 + _x2) / 2);\n _y1 = $(y1);\n _y2 = $(y2);\n _yMid = ~~((_y1 + _y2) / 2);\n\n // search along the line from mid point between the 2 border to lower border\n for (_x = _xMid; _x >= _x1; --_x) {\n for (_y = _yMid; _y >= _y1; --_y) {\n result = tryLabel(_x, _y, maxSize, textWidth, textHeight);\n if (result) {\n [d.x, d.y, maxSize, labelPlaced] = result;\n }\n }\n }\n\n // search along the line from mid point between the 2 border to upper border\n for (_x = _xMid; _x <= _x2; ++_x) {\n for (_y = _yMid; _y <= _y2; ++_y) {\n result = tryLabel(_x, _y, maxSize, textWidth, textHeight);\n if (result) {\n [d.x, d.y, maxSize, labelPlaced] = result;\n }\n }\n }\n\n // place label at slice center if not placed through other means\n // and if we're not avoiding overlap with other areas\n if (!labelPlaced && !avoidBaseMark) {\n // one span is zero, hence we can add\n areaWidth = Math.abs(x2 - x1 + y2 - y1);\n x = (x1 + x2) / 2;\n y = (y1 + y2) / 2;\n\n // place label if it fits and improves the max area width\n if (areaWidth >= maxAreaWidth && !outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n maxAreaWidth = areaWidth;\n d.x = x;\n d.y = y;\n labelPlaced2 = true;\n }\n }\n }\n\n // record current label placement information, update label bitmap\n if (labelPlaced || labelPlaced2) {\n x = textWidth / 2;\n y = textHeight / 2;\n bm0.setRange($(d.x - x), $(d.y - y), $(d.x + x), $(d.y + y));\n d.align = 'center';\n d.baseline = 'middle';\n return true;\n } else {\n return false;\n }\n };\n}\n\n// pixel direction offsets for flood fill search\nconst X_DIR = [-1, -1, 1, 1];\nconst Y_DIR = [-1, 1, -1, 1];\nfunction placeAreaLabelFloodFill ($, bitmaps, avoidBaseMark, markIndex) {\n const width = $.width,\n height = $.height,\n bm0 = bitmaps[0],\n // where labels have been placed\n bm1 = bitmaps[1],\n // area outlines\n bm2 = $.bitmap(); // flood-fill visitations\n\n // try to place a label within an input area mark\n return function (d) {\n const items = d.datum.datum.items[markIndex].items,\n // area points\n n = items.length,\n // number of points\n textHeight = d.datum.fontSize,\n // label width\n textWidth = textMetrics.width(d.datum, d.datum.text),\n // label height\n stack = []; // flood fill stack\n\n let maxSize = avoidBaseMark ? textHeight : 0,\n labelPlaced = false,\n labelPlaced2 = false,\n maxAreaWidth = 0,\n x1,\n x2,\n y1,\n y2,\n x,\n y,\n _x,\n _y,\n lo,\n hi,\n mid,\n areaWidth;\n\n // for each area sample point\n for (let i = 0; i < n; ++i) {\n x1 = items[i].x;\n y1 = items[i].y;\n x2 = items[i].x2 === undefined ? x1 : items[i].x2;\n y2 = items[i].y2 === undefined ? y1 : items[i].y2;\n\n // add scaled center point to stack\n stack.push([$((x1 + x2) / 2), $((y1 + y2) / 2)]);\n\n // perform flood fill, visit points\n while (stack.length) {\n [_x, _y] = stack.pop();\n\n // exit if point already marked\n if (bm0.get(_x, _y) || bm1.get(_x, _y) || bm2.get(_x, _y)) continue;\n\n // mark point in flood fill bitmap\n // add search points for all (in bound) directions\n bm2.set(_x, _y);\n for (let j = 0; j < 4; ++j) {\n x = _x + X_DIR[j];\n y = _y + Y_DIR[j];\n if (!bm2.outOfBounds(x, y, x, y)) stack.push([x, y]);\n }\n\n // unscale point back to x, y space\n x = $.invert(_x);\n y = $.invert(_y);\n lo = maxSize;\n hi = height; // TODO: make this bound smaller\n\n if (!outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, lo, bm0, bm1) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n // if the label fits at the current sample point,\n // perform binary search to find the largest font size that fits\n while (hi - lo >= 1) {\n mid = (lo + hi) / 2;\n if (collision($, x, y, textHeight, textWidth, mid, bm0, bm1)) {\n hi = mid;\n } else {\n lo = mid;\n }\n }\n // place label if current lower bound exceeds prior max font size\n if (lo > maxSize) {\n d.x = x;\n d.y = y;\n maxSize = lo;\n labelPlaced = true;\n }\n }\n }\n\n // place label at slice center if not placed through other means\n // and if we're not avoiding overlap with other areas\n if (!labelPlaced && !avoidBaseMark) {\n // one span is zero, hence we can add\n areaWidth = Math.abs(x2 - x1 + y2 - y1);\n x = (x1 + x2) / 2;\n y = (y1 + y2) / 2;\n\n // place label if it fits and improves the max area width\n if (areaWidth >= maxAreaWidth && !outOfBounds(x, y, textWidth, textHeight, width, height) && !collision($, x, y, textHeight, textWidth, textHeight, bm0, null)) {\n maxAreaWidth = areaWidth;\n d.x = x;\n d.y = y;\n labelPlaced2 = true;\n }\n }\n }\n\n // record current label placement information, update label bitmap\n if (labelPlaced || labelPlaced2) {\n x = textWidth / 2;\n y = textHeight / 2;\n bm0.setRange($(d.x - x), $(d.y - y), $(d.x + x), $(d.y + y));\n d.align = 'center';\n d.baseline = 'middle';\n return true;\n } else {\n return false;\n }\n };\n}\n\nconst Aligns = ['right', 'center', 'left'],\n Baselines = ['bottom', 'middle', 'top'];\nfunction placeMarkLabel ($, bitmaps, anchors, offsets) {\n const width = $.width,\n height = $.height,\n bm0 = bitmaps[0],\n bm1 = bitmaps[1],\n n = offsets.length;\n return function (d) {\n const boundary = d.boundary,\n textHeight = d.datum.fontSize;\n\n // can not be placed if the mark is not visible in the graph bound\n if (boundary[2] < 0 || boundary[5] < 0 || boundary[0] > width || boundary[3] > height) {\n return false;\n }\n let textWidth = d.textWidth ?? 0,\n dx,\n dy,\n isInside,\n sizeFactor,\n insideFactor,\n x1,\n x2,\n y1,\n y2,\n xc,\n yc,\n _x1,\n _x2,\n _y1,\n _y2;\n\n // for each anchor and offset\n for (let i = 0; i < n; ++i) {\n dx = (anchors[i] & 0x3) - 1;\n dy = (anchors[i] >>> 0x2 & 0x3) - 1;\n isInside = dx === 0 && dy === 0 || offsets[i] < 0;\n sizeFactor = dx && dy ? Math.SQRT1_2 : 1;\n insideFactor = offsets[i] < 0 ? -1 : 1;\n x1 = boundary[1 + dx] + offsets[i] * dx * sizeFactor;\n yc = boundary[4 + dy] + insideFactor * textHeight * dy / 2 + offsets[i] * dy * sizeFactor;\n y1 = yc - textHeight / 2;\n y2 = yc + textHeight / 2;\n _x1 = $(x1);\n _y1 = $(y1);\n _y2 = $(y2);\n if (!textWidth) {\n // to avoid finding width of text label,\n if (!test(_x1, _x1, _y1, _y2, bm0, bm1, x1, x1, y1, y2, boundary, isInside)) {\n // skip this anchor/offset option if we fail to place a label with 1px width\n continue;\n } else {\n // Otherwise, find the label width\n textWidth = textMetrics.width(d.datum, d.datum.text);\n }\n }\n xc = x1 + insideFactor * textWidth * dx / 2;\n x1 = xc - textWidth / 2;\n x2 = xc + textWidth / 2;\n _x1 = $(x1);\n _x2 = $(x2);\n if (test(_x1, _x2, _y1, _y2, bm0, bm1, x1, x2, y1, y2, boundary, isInside)) {\n // place label if the position is placeable\n d.x = !dx ? xc : dx * insideFactor < 0 ? x2 : x1;\n d.y = !dy ? yc : dy * insideFactor < 0 ? y2 : y1;\n d.align = Aligns[dx * insideFactor + 1];\n d.baseline = Baselines[dy * insideFactor + 1];\n bm0.setRange(_x1, _y1, _x2, _y2);\n return true;\n }\n }\n return false;\n };\n}\n\n// Test if a label with the given dimensions can be added without overlap\nfunction test(_x1, _x2, _y1, _y2, bm0, bm1, x1, x2, y1, y2, boundary, isInside) {\n return !(bm0.outOfBounds(_x1, _y1, _x2, _y2) || (isInside && bm1 || bm0).getRange(_x1, _y1, _x2, _y2));\n}\n\n// 8-bit representation of anchors\nconst TOP = 0x0,\n MIDDLE = 0x4,\n BOTTOM = 0x8,\n LEFT = 0x0,\n CENTER = 0x1,\n RIGHT = 0x2;\n\n// Mapping from text anchor to number representation\nconst anchorCode = {\n 'top-left': TOP + LEFT,\n 'top': TOP + CENTER,\n 'top-right': TOP + RIGHT,\n 'left': MIDDLE + LEFT,\n 'middle': MIDDLE + CENTER,\n 'right': MIDDLE + RIGHT,\n 'bottom-left': BOTTOM + LEFT,\n 'bottom': BOTTOM + CENTER,\n 'bottom-right': BOTTOM + RIGHT\n};\nconst placeAreaLabel = {\n 'naive': placeAreaLabelNaive,\n 'reduced-search': placeAreaLabelReducedSearch,\n 'floodfill': placeAreaLabelFloodFill\n};\nfunction labelLayout (texts, size, compare, offset, anchor, avoidMarks, avoidBaseMark, lineAnchor, markIndex, padding, method) {\n // early exit for empty data\n if (!texts.length) return texts;\n const positions = Math.max(offset.length, anchor.length),\n offsets = getOffsets(offset, positions),\n anchors = getAnchors(anchor, positions),\n marktype = markType(texts[0].datum),\n grouptype = marktype === 'group' && texts[0].datum.items[markIndex].marktype,\n isGroupArea = grouptype === 'area',\n boundary = markBoundary(marktype, grouptype, lineAnchor, markIndex),\n infPadding = padding === null || padding === Infinity,\n isNaiveGroupArea = isGroupArea && method === 'naive';\n let maxTextWidth = -1,\n maxTextHeight = -1;\n\n // prepare text mark data for placing\n const data = texts.map(d => {\n const textWidth = infPadding ? textMetrics.width(d, d.text) : undefined;\n maxTextWidth = Math.max(maxTextWidth, textWidth);\n maxTextHeight = Math.max(maxTextHeight, d.fontSize);\n return {\n datum: d,\n opacity: 0,\n x: undefined,\n y: undefined,\n align: undefined,\n baseline: undefined,\n boundary: boundary(d),\n textWidth\n };\n });\n padding = padding === null || padding === Infinity ? Math.max(maxTextWidth, maxTextHeight) + Math.max(...offset) : padding;\n const $ = scaler(size[0], size[1], padding);\n let bitmaps;\n if (!isNaiveGroupArea) {\n // sort labels in priority order, if comparator is provided\n if (compare) {\n data.sort((a, b) => compare(a.datum, b.datum));\n }\n\n // flag indicating if label can be placed inside its base mark\n let labelInside = false;\n for (let i = 0; i < anchors.length && !labelInside; ++i) {\n // label inside if anchor is at center\n // label inside if offset to be inside the mark bound\n labelInside = anchors[i] === 0x5 || offsets[i] < 0;\n }\n\n // extract data information from base mark when base mark is to be avoided\n // base mark is implicitly avoided if it is a group area\n const baseMark = (marktype && avoidBaseMark || isGroupArea) && texts.map(d => d.datum);\n\n // generate bitmaps for layout calculation\n bitmaps = avoidMarks.length || baseMark ? markBitmaps($, baseMark || [], avoidMarks, labelInside, isGroupArea) : baseBitmaps($, avoidBaseMark && data);\n }\n\n // generate label placement function\n const place = isGroupArea ? placeAreaLabel[method]($, bitmaps, avoidBaseMark, markIndex) : placeMarkLabel($, bitmaps, anchors, offsets);\n\n // place all labels\n data.forEach(d => d.opacity = +place(d));\n return data;\n}\nfunction getOffsets(_, count) {\n const offsets = new Float64Array(count),\n n = _.length;\n for (let i = 0; i < n; ++i) offsets[i] = _[i] || 0;\n for (let i = n; i < count; ++i) offsets[i] = offsets[n - 1];\n return offsets;\n}\nfunction getAnchors(_, count) {\n const anchors = new Int8Array(count),\n n = _.length;\n for (let i = 0; i < n; ++i) anchors[i] |= anchorCode[_[i]];\n for (let i = n; i < count; ++i) anchors[i] = anchors[n - 1];\n return anchors;\n}\nfunction markType(item) {\n return item && item.mark && item.mark.marktype;\n}\n\n/**\n * Factory function for function for getting base mark boundary, depending\n * on mark and group type. When mark type is undefined, line or area: boundary\n * is the coordinate of each data point. When base mark is grouped line,\n * boundary is either at the start or end of the line depending on the\n * value of lineAnchor. Otherwise, use bounds of base mark.\n */\nfunction markBoundary(marktype, grouptype, lineAnchor, markIndex) {\n const xy = d => [d.x, d.x, d.x, d.y, d.y, d.y];\n if (!marktype) {\n return xy; // no reactive geometry\n } else if (marktype === 'line' || marktype === 'area') {\n return d => xy(d.datum);\n } else if (grouptype === 'line') {\n return d => {\n const items = d.datum.items[markIndex].items;\n return xy(items.length ? items[lineAnchor === 'start' ? 0 : items.length - 1] : {\n x: NaN,\n y: NaN\n });\n };\n } else {\n return d => {\n const b = d.datum.bounds;\n return [b.x1, (b.x1 + b.x2) / 2, b.x2, b.y1, (b.y1 + b.y2) / 2, b.y2];\n };\n }\n}\n\nconst Output = ['x', 'y', 'opacity', 'align', 'baseline'];\nconst Anchors = ['top-left', 'left', 'bottom-left', 'top', 'bottom', 'top-right', 'right', 'bottom-right'];\n\n/**\n * Compute text label layout to annotate marks.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.size - The size of the layout, provided as a [width, height] array.\n * @param {function(*,*): number} [params.sort] - An optional\n * comparator function for sorting label data in priority order.\n * @param {Array} [params.anchor] - Label anchor points relative to the base mark bounding box.\n * The available options are 'top-left', 'left', 'bottom-left', 'top',\n * 'bottom', 'top-right', 'right', 'bottom-right', 'middle'.\n * @param {Array} [params.offset] - Label offsets (in pixels) from the base mark bounding box.\n * This parameter is parallel to the list of anchor points.\n * @param {number | null} [params.padding=0] - The amount (in pixels) that a label may exceed the layout size.\n * If this parameter is null, a label may exceed the layout size without any boundary.\n * @param {string} [params.lineAnchor='end'] - For group line mark labels only, indicates the anchor\n * position for labels. One of 'start' or 'end'.\n * @param {string} [params.markIndex=0] - For group mark labels only, an index indicating\n * which mark within the group should be labeled.\n * @param {Array} [params.avoidMarks] - A list of additional mark names for which the label\n * layout should avoid overlap.\n * @param {boolean} [params.avoidBaseMark=true] - Boolean flag indicating if labels should avoid\n * overlap with the underlying base mark being labeled.\n * @param {string} [params.method='naive'] - For area make labels only, a method for\n * place labels. One of 'naive', 'reduced-search', or 'floodfill'.\n * @param {Array} [params.as] - The output fields written by the transform.\n * The default is ['x', 'y', 'opacity', 'align', 'baseline'].\n */\nfunction Label(params) {\n Transform.call(this, null, params);\n}\nLabel.Definition = {\n type: 'Label',\n metadata: {\n modifies: true\n },\n params: [{\n name: 'size',\n type: 'number',\n array: true,\n length: 2,\n required: true\n }, {\n name: 'sort',\n type: 'compare'\n }, {\n name: 'anchor',\n type: 'string',\n array: true,\n default: Anchors\n }, {\n name: 'offset',\n type: 'number',\n array: true,\n default: [1]\n }, {\n name: 'padding',\n type: 'number',\n default: 0,\n null: true\n }, {\n name: 'lineAnchor',\n type: 'string',\n values: ['start', 'end'],\n default: 'end'\n }, {\n name: 'markIndex',\n type: 'number',\n default: 0\n }, {\n name: 'avoidBaseMark',\n type: 'boolean',\n default: true\n }, {\n name: 'avoidMarks',\n type: 'data',\n array: true\n }, {\n name: 'method',\n type: 'string',\n default: 'naive'\n }, {\n name: 'as',\n type: 'string',\n array: true,\n length: Output.length,\n default: Output\n }]\n};\ninherits(Label, Transform, {\n transform(_, pulse) {\n function modp(param) {\n const p = _[param];\n return isFunction(p) && pulse.modified(p.fields);\n }\n const mod = _.modified();\n if (!(mod || pulse.changed(pulse.ADD_REM) || modp('sort'))) return;\n if (!_.size || _.size.length !== 2) {\n error('Size parameter should be specified as a [width, height] array.');\n }\n const as = _.as || Output;\n\n // run label layout\n labelLayout(pulse.materialize(pulse.SOURCE).source || [], _.size, _.sort, array(_.offset == null ? 1 : _.offset), array(_.anchor || Anchors), _.avoidMarks || [], _.avoidBaseMark !== false, _.lineAnchor || 'end', _.markIndex || 0, _.padding === undefined ? 0 : _.padding, _.method || 'naive').forEach(l => {\n // write layout results to data stream\n const t = l.datum;\n t[as[0]] = l.x;\n t[as[1]] = l.y;\n t[as[2]] = l.opacity;\n t[as[3]] = l.align;\n t[as[4]] = l.baseline;\n });\n return pulse.reflow(mod).modifies(as);\n }\n});\n\nexport { Label as label };\n","import { regressionLoess, sampleCurve, regressionConstant, regressionLinear, regressionLog, regressionExp, regressionPow, regressionQuad, regressionPoly } from 'vega-statistics';\nimport { Transform, ingest } from 'vega-dataflow';\nimport { inherits, accessorName, hasOwnProperty, error, extent } from 'vega-util';\n\nfunction partition (data, groupby) {\n var groups = [],\n get = function (f) {\n return f(t);\n },\n map,\n i,\n n,\n t,\n k,\n g;\n\n // partition data points into stack groups\n if (groupby == null) {\n groups.push(data);\n } else {\n for (map = {}, i = 0, n = data.length; i < n; ++i) {\n t = data[i];\n k = groupby.map(get);\n g = map[k];\n if (!g) {\n map[k] = g = [];\n g.dims = k;\n groups.push(g);\n }\n g.push(t);\n }\n }\n return groups;\n}\n\n/**\n * Compute locally-weighted regression fits for one or more data groups.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.x - An accessor for the predictor data field.\n * @param {function(object): *} params.y - An accessor for the predicted data field.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {number} [params.bandwidth=0.3] - The loess bandwidth.\n */\nfunction Loess(params) {\n Transform.call(this, null, params);\n}\nLoess.Definition = {\n 'type': 'Loess',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'bandwidth',\n 'type': 'number',\n 'default': 0.3\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }]\n};\ninherits(Loess, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n if (!this.value || pulse.changed() || _.modified()) {\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition(source, _.groupby),\n names = (_.groupby || []).map(accessorName),\n m = names.length,\n as = _.as || [accessorName(_.x), accessorName(_.y)],\n values = [];\n groups.forEach(g => {\n regressionLoess(g, _.x, _.y, _.bandwidth || 0.3).forEach(p => {\n const t = {};\n for (let i = 0; i < m; ++i) {\n t[names[i]] = g.dims[i];\n }\n t[as[0]] = p[0];\n t[as[1]] = p[1];\n values.push(ingest(t));\n });\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n return out;\n }\n});\n\nconst Methods = {\n constant: regressionConstant,\n linear: regressionLinear,\n log: regressionLog,\n exp: regressionExp,\n pow: regressionPow,\n quad: regressionQuad,\n poly: regressionPoly\n};\nconst degreesOfFreedom = (method, order) => method === 'poly' ? order : method === 'quad' ? 2 : 1;\n\n/**\n * Compute regression fits for one or more data groups.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {function(object): *} params.x - An accessor for the predictor data field.\n * @param {function(object): *} params.y - An accessor for the predicted data field.\n * @param {string} [params.method='linear'] - The regression method to apply.\n * @param {Array} [params.groupby] - An array of accessors to groupby.\n * @param {Array} [params.extent] - The domain extent over which to plot the regression line.\n * @param {number} [params.order=3] - The polynomial order. Only applies to the 'poly' method.\n */\nfunction Regression(params) {\n Transform.call(this, null, params);\n}\nRegression.Definition = {\n 'type': 'Regression',\n 'metadata': {\n 'generates': true\n },\n 'params': [{\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'groupby',\n 'type': 'field',\n 'array': true\n }, {\n 'name': 'method',\n 'type': 'string',\n 'default': 'linear',\n 'values': Object.keys(Methods)\n }, {\n 'name': 'order',\n 'type': 'number',\n 'default': 3\n }, {\n 'name': 'extent',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'params',\n 'type': 'boolean',\n 'default': false\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true\n }]\n};\ninherits(Regression, Transform, {\n transform(_, pulse) {\n const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);\n if (!this.value || pulse.changed() || _.modified()) {\n const source = pulse.materialize(pulse.SOURCE).source,\n groups = partition(source, _.groupby),\n names = (_.groupby || []).map(accessorName),\n method = _.method || 'linear',\n order = _.order == null ? 3 : _.order,\n dof = degreesOfFreedom(method, order),\n as = _.as || [accessorName(_.x), accessorName(_.y)],\n fit = Methods[method],\n values = [];\n let domain = _.extent;\n if (!hasOwnProperty(Methods, method)) {\n error('Invalid regression method: ' + method);\n }\n if (domain != null) {\n if (method === 'log' && domain[0] <= 0) {\n pulse.dataflow.warn('Ignoring extent with values <= 0 for log regression.');\n domain = null;\n }\n }\n groups.forEach(g => {\n const n = g.length;\n if (n <= dof) {\n pulse.dataflow.warn('Skipping regression with more parameters than data points.');\n return;\n }\n const model = fit(g, _.x, _.y, order);\n if (_.params) {\n // if parameter vectors requested return those\n values.push(ingest({\n keys: g.dims,\n coef: model.coef,\n rSquared: model.rSquared\n }));\n return;\n }\n const dom = domain || extent(g, _.x),\n add = p => {\n const t = {};\n for (let i = 0; i < names.length; ++i) {\n t[names[i]] = g.dims[i];\n }\n t[as[0]] = p[0];\n t[as[1]] = p[1];\n values.push(ingest(t));\n };\n if (method === 'linear' || method === 'constant') {\n // for linear or constant regression we only need the end points\n dom.forEach(x => add([x, model.predict(x)]));\n } else {\n // otherwise return trend line sample points\n sampleCurve(model.predict, dom, 25, 200).forEach(add);\n }\n });\n if (this.value) out.rem = this.value;\n this.value = out.add = out.source = values;\n }\n return out;\n }\n});\n\nexport { Loess as loess, Regression as regression };\n","export const epsilon = 1.1102230246251565e-16;\nexport const splitter = 134217729;\nexport const resulterrbound = (3 + 8 * epsilon) * epsilon;\n\n// fast_expansion_sum_zeroelim routine from oritinal code\nexport function sum(elen, e, flen, f, h) {\n let Q, Qnew, hh, bvirt;\n let enow = e[0];\n let fnow = f[0];\n let eindex = 0;\n let findex = 0;\n if ((fnow > enow) === (fnow > -enow)) {\n Q = enow;\n enow = e[++eindex];\n } else {\n Q = fnow;\n fnow = f[++findex];\n }\n let hindex = 0;\n if (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = enow + Q;\n hh = Q - (Qnew - enow);\n enow = e[++eindex];\n } else {\n Qnew = fnow + Q;\n hh = Q - (Qnew - fnow);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n while (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n } else {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n }\n while (eindex < elen) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n while (findex < flen) {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nexport function sum_three(alen, a, blen, b, clen, c, tmp, out) {\n return sum(sum(alen, a, blen, b, tmp), tmp, clen, c, out);\n}\n\n// scale_expansion_zeroelim routine from oritinal code\nexport function scale(elen, e, b, h) {\n let Q, sum, hh, product1, product0;\n let bvirt, c, ahi, alo, bhi, blo;\n\n c = splitter * b;\n bhi = c - (c - b);\n blo = b - bhi;\n let enow = e[0];\n Q = enow * b;\n c = splitter * enow;\n ahi = c - (c - enow);\n alo = enow - ahi;\n hh = alo * blo - (Q - ahi * bhi - alo * bhi - ahi * blo);\n let hindex = 0;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n for (let i = 1; i < elen; i++) {\n enow = e[i];\n product1 = enow * b;\n c = splitter * enow;\n ahi = c - (c - enow);\n alo = enow - ahi;\n product0 = alo * blo - (product1 - ahi * bhi - alo * bhi - ahi * blo);\n sum = Q + product0;\n bvirt = sum - Q;\n hh = Q - (sum - bvirt) + (product0 - bvirt);\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n Q = product1 + sum;\n hh = sum - (Q - product1);\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nexport function negate(elen, e) {\n for (let i = 0; i < elen; i++) e[i] = -e[i];\n return elen;\n}\n\nexport function estimate(elen, e) {\n let Q = e[0];\n for (let i = 1; i < elen; i++) Q += e[i];\n return Q;\n}\n\nexport function vec(n) {\n return new Float64Array(n);\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum} from './util.js';\n\nconst ccwerrboundA = (3 + 16 * epsilon) * epsilon;\nconst ccwerrboundB = (2 + 12 * epsilon) * epsilon;\nconst ccwerrboundC = (9 + 64 * epsilon) * epsilon * epsilon;\n\nconst B = vec(4);\nconst C1 = vec(8);\nconst C2 = vec(12);\nconst D = vec(16);\nconst u = vec(4);\n\nfunction orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {\n let acxtail, acytail, bcxtail, bcytail;\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n const acx = ax - cx;\n const bcx = bx - cx;\n const acy = ay - cy;\n const bcy = by - cy;\n\n s1 = acx * bcy;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcx;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n B[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n B[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n B[2] = _j - (u3 - bvirt) + (_i - bvirt);\n B[3] = u3;\n\n let det = estimate(4, B);\n let errbound = ccwerrboundB * detsum;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - acx;\n acxtail = ax - (acx + bvirt) + (bvirt - cx);\n bvirt = bx - bcx;\n bcxtail = bx - (bcx + bvirt) + (bvirt - cx);\n bvirt = ay - acy;\n acytail = ay - (acy + bvirt) + (bvirt - cy);\n bvirt = by - bcy;\n bcytail = by - (bcy + bvirt) + (bvirt - cy);\n\n if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) {\n return det;\n }\n\n errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det);\n det += (acx * bcytail + bcy * acxtail) - (acy * bcxtail + bcx * acytail);\n if (det >= errbound || -det >= errbound) return det;\n\n s1 = acxtail * bcy;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcx;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const C1len = sum(4, B, 4, u, C1);\n\n s1 = acx * bcytail;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcxtail;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const C2len = sum(C1len, C1, 4, u, C2);\n\n s1 = acxtail * bcytail;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcxtail;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const Dlen = sum(C2len, C2, 4, u, D);\n\n return D[Dlen - 1];\n}\n\nexport function orient2d(ax, ay, bx, by, cx, cy) {\n const detleft = (ay - cy) * (bx - cx);\n const detright = (ax - cx) * (by - cy);\n const det = detleft - detright;\n\n if (detleft === 0 || detright === 0 || (detleft > 0) !== (detright > 0)) return det;\n\n const detsum = Math.abs(detleft + detright);\n if (Math.abs(det) >= ccwerrboundA * detsum) return det;\n\n return -orient2dadapt(ax, ay, bx, by, cx, cy, detsum);\n}\n\nexport function orient2dfast(ax, ay, bx, by, cx, cy) {\n return (ay - cy) * (bx - cx) - (ax - cx) * (by - cy);\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum, scale} from './util.js';\n\nconst o3derrboundA = (7 + 56 * epsilon) * epsilon;\nconst o3derrboundB = (3 + 28 * epsilon) * epsilon;\nconst o3derrboundC = (26 + 288 * epsilon) * epsilon * epsilon;\n\nconst bc = vec(4);\nconst ca = vec(4);\nconst ab = vec(4);\nconst at_b = vec(4);\nconst at_c = vec(4);\nconst bt_c = vec(4);\nconst bt_a = vec(4);\nconst ct_a = vec(4);\nconst ct_b = vec(4);\nconst bct = vec(8);\nconst cat = vec(8);\nconst abt = vec(8);\nconst u = vec(4);\n\nconst _8 = vec(8);\nconst _8b = vec(8);\nconst _16 = vec(8);\nconst _12 = vec(12);\n\nlet fin = vec(192);\nlet fin2 = vec(192);\n\nfunction finadd(finlen, alen, a) {\n finlen = sum(finlen, fin, alen, a, fin2);\n const tmp = fin; fin = fin2; fin2 = tmp;\n return finlen;\n}\n\nfunction tailinit(xtail, ytail, ax, ay, bx, by, a, b) {\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _k, _0, s1, s0, t1, t0, u3, negate;\n if (xtail === 0) {\n if (ytail === 0) {\n a[0] = 0;\n b[0] = 0;\n return 1;\n } else {\n negate = -ytail;\n s1 = negate * ax;\n c = splitter * negate;\n ahi = c - (c - negate);\n alo = negate - ahi;\n c = splitter * ax;\n bhi = c - (c - ax);\n blo = ax - bhi;\n a[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n a[1] = s1;\n s1 = ytail * bx;\n c = splitter * ytail;\n ahi = c - (c - ytail);\n alo = ytail - ahi;\n c = splitter * bx;\n bhi = c - (c - bx);\n blo = bx - bhi;\n b[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n b[1] = s1;\n return 2;\n }\n } else {\n if (ytail === 0) {\n s1 = xtail * ay;\n c = splitter * xtail;\n ahi = c - (c - xtail);\n alo = xtail - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n a[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n a[1] = s1;\n negate = -xtail;\n s1 = negate * by;\n c = splitter * negate;\n ahi = c - (c - negate);\n alo = negate - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n b[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n b[1] = s1;\n return 2;\n } else {\n s1 = xtail * ay;\n c = splitter * xtail;\n ahi = c - (c - xtail);\n alo = xtail - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ytail * ax;\n c = splitter * ytail;\n ahi = c - (c - ytail);\n alo = ytail - ahi;\n c = splitter * ax;\n bhi = c - (c - ax);\n blo = ax - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n a[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n a[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n a[2] = _j - (u3 - bvirt) + (_i - bvirt);\n a[3] = u3;\n s1 = ytail * bx;\n c = splitter * ytail;\n ahi = c - (c - ytail);\n alo = ytail - ahi;\n c = splitter * bx;\n bhi = c - (c - bx);\n blo = bx - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = xtail * by;\n c = splitter * xtail;\n ahi = c - (c - xtail);\n alo = xtail - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n b[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n b[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n b[2] = _j - (u3 - bvirt) + (_i - bvirt);\n b[3] = u3;\n return 4;\n }\n }\n}\n\nfunction tailadd(finlen, a, b, k, z) {\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _k, _0, s1, s0, u3;\n s1 = a * b;\n c = splitter * a;\n ahi = c - (c - a);\n alo = a - ahi;\n c = splitter * b;\n bhi = c - (c - b);\n blo = b - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n c = splitter * k;\n bhi = c - (c - k);\n blo = k - bhi;\n _i = s0 * k;\n c = splitter * s0;\n ahi = c - (c - s0);\n alo = s0 - ahi;\n u[0] = alo * blo - (_i - ahi * bhi - alo * bhi - ahi * blo);\n _j = s1 * k;\n c = splitter * s1;\n ahi = c - (c - s1);\n alo = s1 - ahi;\n _0 = alo * blo - (_j - ahi * bhi - alo * bhi - ahi * blo);\n _k = _i + _0;\n bvirt = _k - _i;\n u[1] = _i - (_k - bvirt) + (_0 - bvirt);\n u3 = _j + _k;\n u[2] = _k - (u3 - _j);\n u[3] = u3;\n finlen = finadd(finlen, 4, u);\n if (z !== 0) {\n c = splitter * z;\n bhi = c - (c - z);\n blo = z - bhi;\n _i = s0 * z;\n c = splitter * s0;\n ahi = c - (c - s0);\n alo = s0 - ahi;\n u[0] = alo * blo - (_i - ahi * bhi - alo * bhi - ahi * blo);\n _j = s1 * z;\n c = splitter * s1;\n ahi = c - (c - s1);\n alo = s1 - ahi;\n _0 = alo * blo - (_j - ahi * bhi - alo * bhi - ahi * blo);\n _k = _i + _0;\n bvirt = _k - _i;\n u[1] = _i - (_k - bvirt) + (_0 - bvirt);\n u3 = _j + _k;\n u[2] = _k - (u3 - _j);\n u[3] = u3;\n finlen = finadd(finlen, 4, u);\n }\n return finlen;\n}\n\nfunction orient3dadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, permanent) {\n let finlen;\n let adxtail, bdxtail, cdxtail;\n let adytail, bdytail, cdytail;\n let adztail, bdztail, cdztail;\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _k, _0, s1, s0, t1, t0, u3;\n\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n const adz = az - dz;\n const bdz = bz - dz;\n const cdz = cz - dz;\n\n s1 = bdx * cdy;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdx * bdy;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bc[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bc[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bc[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bc[3] = u3;\n s1 = cdx * ady;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adx * cdy;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ca[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ca[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ca[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ca[3] = u3;\n s1 = adx * bdy;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdx * ady;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ab[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ab[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ab[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ab[3] = u3;\n\n finlen = sum(\n sum(\n scale(4, bc, adz, _8), _8,\n scale(4, ca, bdz, _8b), _8b, _16), _16,\n scale(4, ab, cdz, _8), _8, fin);\n\n let det = estimate(finlen, fin);\n let errbound = o3derrboundB * permanent;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - adx;\n adxtail = ax - (adx + bvirt) + (bvirt - dx);\n bvirt = bx - bdx;\n bdxtail = bx - (bdx + bvirt) + (bvirt - dx);\n bvirt = cx - cdx;\n cdxtail = cx - (cdx + bvirt) + (bvirt - dx);\n bvirt = ay - ady;\n adytail = ay - (ady + bvirt) + (bvirt - dy);\n bvirt = by - bdy;\n bdytail = by - (bdy + bvirt) + (bvirt - dy);\n bvirt = cy - cdy;\n cdytail = cy - (cdy + bvirt) + (bvirt - dy);\n bvirt = az - adz;\n adztail = az - (adz + bvirt) + (bvirt - dz);\n bvirt = bz - bdz;\n bdztail = bz - (bdz + bvirt) + (bvirt - dz);\n bvirt = cz - cdz;\n cdztail = cz - (cdz + bvirt) + (bvirt - dz);\n\n if (adxtail === 0 && bdxtail === 0 && cdxtail === 0 &&\n adytail === 0 && bdytail === 0 && cdytail === 0 &&\n adztail === 0 && bdztail === 0 && cdztail === 0) {\n return det;\n }\n\n errbound = o3derrboundC * permanent + resulterrbound * Math.abs(det);\n det +=\n adz * (bdx * cdytail + cdy * bdxtail - (bdy * cdxtail + cdx * bdytail)) + adztail * (bdx * cdy - bdy * cdx) +\n bdz * (cdx * adytail + ady * cdxtail - (cdy * adxtail + adx * cdytail)) + bdztail * (cdx * ady - cdy * adx) +\n cdz * (adx * bdytail + bdy * adxtail - (ady * bdxtail + bdx * adytail)) + cdztail * (adx * bdy - ady * bdx);\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n const at_len = tailinit(adxtail, adytail, bdx, bdy, cdx, cdy, at_b, at_c);\n const bt_len = tailinit(bdxtail, bdytail, cdx, cdy, adx, ady, bt_c, bt_a);\n const ct_len = tailinit(cdxtail, cdytail, adx, ady, bdx, bdy, ct_a, ct_b);\n\n const bctlen = sum(bt_len, bt_c, ct_len, ct_b, bct);\n finlen = finadd(finlen, scale(bctlen, bct, adz, _16), _16);\n\n const catlen = sum(ct_len, ct_a, at_len, at_c, cat);\n finlen = finadd(finlen, scale(catlen, cat, bdz, _16), _16);\n\n const abtlen = sum(at_len, at_b, bt_len, bt_a, abt);\n finlen = finadd(finlen, scale(abtlen, abt, cdz, _16), _16);\n\n if (adztail !== 0) {\n finlen = finadd(finlen, scale(4, bc, adztail, _12), _12);\n finlen = finadd(finlen, scale(bctlen, bct, adztail, _16), _16);\n }\n if (bdztail !== 0) {\n finlen = finadd(finlen, scale(4, ca, bdztail, _12), _12);\n finlen = finadd(finlen, scale(catlen, cat, bdztail, _16), _16);\n }\n if (cdztail !== 0) {\n finlen = finadd(finlen, scale(4, ab, cdztail, _12), _12);\n finlen = finadd(finlen, scale(abtlen, abt, cdztail, _16), _16);\n }\n\n if (adxtail !== 0) {\n if (bdytail !== 0) {\n finlen = tailadd(finlen, adxtail, bdytail, cdz, cdztail);\n }\n if (cdytail !== 0) {\n finlen = tailadd(finlen, -adxtail, cdytail, bdz, bdztail);\n }\n }\n if (bdxtail !== 0) {\n if (cdytail !== 0) {\n finlen = tailadd(finlen, bdxtail, cdytail, adz, adztail);\n }\n if (adytail !== 0) {\n finlen = tailadd(finlen, -bdxtail, adytail, cdz, cdztail);\n }\n }\n if (cdxtail !== 0) {\n if (adytail !== 0) {\n finlen = tailadd(finlen, cdxtail, adytail, bdz, bdztail);\n }\n if (bdytail !== 0) {\n finlen = tailadd(finlen, -cdxtail, bdytail, adz, adztail);\n }\n }\n\n return fin[finlen - 1];\n}\n\nexport function orient3d(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz) {\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n const adz = az - dz;\n const bdz = bz - dz;\n const cdz = cz - dz;\n\n const bdxcdy = bdx * cdy;\n const cdxbdy = cdx * bdy;\n\n const cdxady = cdx * ady;\n const adxcdy = adx * cdy;\n\n const adxbdy = adx * bdy;\n const bdxady = bdx * ady;\n\n const det =\n adz * (bdxcdy - cdxbdy) +\n bdz * (cdxady - adxcdy) +\n cdz * (adxbdy - bdxady);\n\n const permanent =\n (Math.abs(bdxcdy) + Math.abs(cdxbdy)) * Math.abs(adz) +\n (Math.abs(cdxady) + Math.abs(adxcdy)) * Math.abs(bdz) +\n (Math.abs(adxbdy) + Math.abs(bdxady)) * Math.abs(cdz);\n\n const errbound = o3derrboundA * permanent;\n if (det > errbound || -det > errbound) {\n return det;\n }\n\n return orient3dadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, permanent);\n}\n\nexport function orient3dfast(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz) {\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n const adz = az - dz;\n const bdz = bz - dz;\n const cdz = cz - dz;\n\n return adx * (bdy * cdz - bdz * cdy) +\n bdx * (cdy * adz - cdz * ady) +\n cdx * (ady * bdz - adz * bdy);\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum, sum_three, scale} from './util.js';\n\nconst iccerrboundA = (10 + 96 * epsilon) * epsilon;\nconst iccerrboundB = (4 + 48 * epsilon) * epsilon;\nconst iccerrboundC = (44 + 576 * epsilon) * epsilon * epsilon;\n\nconst bc = vec(4);\nconst ca = vec(4);\nconst ab = vec(4);\nconst aa = vec(4);\nconst bb = vec(4);\nconst cc = vec(4);\nconst u = vec(4);\nconst v = vec(4);\nconst axtbc = vec(8);\nconst aytbc = vec(8);\nconst bxtca = vec(8);\nconst bytca = vec(8);\nconst cxtab = vec(8);\nconst cytab = vec(8);\nconst abt = vec(8);\nconst bct = vec(8);\nconst cat = vec(8);\nconst abtt = vec(4);\nconst bctt = vec(4);\nconst catt = vec(4);\n\nconst _8 = vec(8);\nconst _16 = vec(16);\nconst _16b = vec(16);\nconst _16c = vec(16);\nconst _32 = vec(32);\nconst _32b = vec(32);\nconst _48 = vec(48);\nconst _64 = vec(64);\n\nlet fin = vec(1152);\nlet fin2 = vec(1152);\n\nfunction finadd(finlen, a, alen) {\n finlen = sum(finlen, fin, a, alen, fin2);\n const tmp = fin; fin = fin2; fin2 = tmp;\n return finlen;\n}\n\nfunction incircleadapt(ax, ay, bx, by, cx, cy, dx, dy, permanent) {\n let finlen;\n let adxtail, bdxtail, cdxtail, adytail, bdytail, cdytail;\n let axtbclen, aytbclen, bxtcalen, bytcalen, cxtablen, cytablen;\n let abtlen, bctlen, catlen;\n let abttlen, bcttlen, cattlen;\n let n1, n0;\n\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n\n s1 = bdx * cdy;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdx * bdy;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bc[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bc[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bc[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bc[3] = u3;\n s1 = cdx * ady;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adx * cdy;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ca[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ca[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ca[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ca[3] = u3;\n s1 = adx * bdy;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdx * ady;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ab[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ab[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ab[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ab[3] = u3;\n\n finlen = sum(\n sum(\n sum(\n scale(scale(4, bc, adx, _8), _8, adx, _16), _16,\n scale(scale(4, bc, ady, _8), _8, ady, _16b), _16b, _32), _32,\n sum(\n scale(scale(4, ca, bdx, _8), _8, bdx, _16), _16,\n scale(scale(4, ca, bdy, _8), _8, bdy, _16b), _16b, _32b), _32b, _64), _64,\n sum(\n scale(scale(4, ab, cdx, _8), _8, cdx, _16), _16,\n scale(scale(4, ab, cdy, _8), _8, cdy, _16b), _16b, _32), _32, fin);\n\n let det = estimate(finlen, fin);\n let errbound = iccerrboundB * permanent;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - adx;\n adxtail = ax - (adx + bvirt) + (bvirt - dx);\n bvirt = ay - ady;\n adytail = ay - (ady + bvirt) + (bvirt - dy);\n bvirt = bx - bdx;\n bdxtail = bx - (bdx + bvirt) + (bvirt - dx);\n bvirt = by - bdy;\n bdytail = by - (bdy + bvirt) + (bvirt - dy);\n bvirt = cx - cdx;\n cdxtail = cx - (cdx + bvirt) + (bvirt - dx);\n bvirt = cy - cdy;\n cdytail = cy - (cdy + bvirt) + (bvirt - dy);\n if (adxtail === 0 && bdxtail === 0 && cdxtail === 0 && adytail === 0 && bdytail === 0 && cdytail === 0) {\n return det;\n }\n\n errbound = iccerrboundC * permanent + resulterrbound * Math.abs(det);\n det += ((adx * adx + ady * ady) * ((bdx * cdytail + cdy * bdxtail) - (bdy * cdxtail + cdx * bdytail)) +\n 2 * (adx * adxtail + ady * adytail) * (bdx * cdy - bdy * cdx)) +\n ((bdx * bdx + bdy * bdy) * ((cdx * adytail + ady * cdxtail) - (cdy * adxtail + adx * cdytail)) +\n 2 * (bdx * bdxtail + bdy * bdytail) * (cdx * ady - cdy * adx)) +\n ((cdx * cdx + cdy * cdy) * ((adx * bdytail + bdy * adxtail) - (ady * bdxtail + bdx * adytail)) +\n 2 * (cdx * cdxtail + cdy * cdytail) * (adx * bdy - ady * bdx));\n\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n if (bdxtail !== 0 || bdytail !== 0 || cdxtail !== 0 || cdytail !== 0) {\n s1 = adx * adx;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n s0 = alo * alo - (s1 - ahi * ahi - (ahi + ahi) * alo);\n t1 = ady * ady;\n c = splitter * ady;\n ahi = c - (c - ady);\n alo = ady - ahi;\n t0 = alo * alo - (t1 - ahi * ahi - (ahi + ahi) * alo);\n _i = s0 + t0;\n bvirt = _i - s0;\n aa[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n aa[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n aa[2] = _j - (u3 - bvirt) + (_i - bvirt);\n aa[3] = u3;\n }\n if (cdxtail !== 0 || cdytail !== 0 || adxtail !== 0 || adytail !== 0) {\n s1 = bdx * bdx;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n s0 = alo * alo - (s1 - ahi * ahi - (ahi + ahi) * alo);\n t1 = bdy * bdy;\n c = splitter * bdy;\n ahi = c - (c - bdy);\n alo = bdy - ahi;\n t0 = alo * alo - (t1 - ahi * ahi - (ahi + ahi) * alo);\n _i = s0 + t0;\n bvirt = _i - s0;\n bb[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n bb[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bb[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bb[3] = u3;\n }\n if (adxtail !== 0 || adytail !== 0 || bdxtail !== 0 || bdytail !== 0) {\n s1 = cdx * cdx;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n s0 = alo * alo - (s1 - ahi * ahi - (ahi + ahi) * alo);\n t1 = cdy * cdy;\n c = splitter * cdy;\n ahi = c - (c - cdy);\n alo = cdy - ahi;\n t0 = alo * alo - (t1 - ahi * ahi - (ahi + ahi) * alo);\n _i = s0 + t0;\n bvirt = _i - s0;\n cc[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n cc[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n cc[2] = _j - (u3 - bvirt) + (_i - bvirt);\n cc[3] = u3;\n }\n\n if (adxtail !== 0) {\n axtbclen = scale(4, bc, adxtail, axtbc);\n finlen = finadd(finlen, sum_three(\n scale(axtbclen, axtbc, 2 * adx, _16), _16,\n scale(scale(4, cc, adxtail, _8), _8, bdy, _16b), _16b,\n scale(scale(4, bb, adxtail, _8), _8, -cdy, _16c), _16c, _32, _48), _48);\n }\n if (adytail !== 0) {\n aytbclen = scale(4, bc, adytail, aytbc);\n finlen = finadd(finlen, sum_three(\n scale(aytbclen, aytbc, 2 * ady, _16), _16,\n scale(scale(4, bb, adytail, _8), _8, cdx, _16b), _16b,\n scale(scale(4, cc, adytail, _8), _8, -bdx, _16c), _16c, _32, _48), _48);\n }\n if (bdxtail !== 0) {\n bxtcalen = scale(4, ca, bdxtail, bxtca);\n finlen = finadd(finlen, sum_three(\n scale(bxtcalen, bxtca, 2 * bdx, _16), _16,\n scale(scale(4, aa, bdxtail, _8), _8, cdy, _16b), _16b,\n scale(scale(4, cc, bdxtail, _8), _8, -ady, _16c), _16c, _32, _48), _48);\n }\n if (bdytail !== 0) {\n bytcalen = scale(4, ca, bdytail, bytca);\n finlen = finadd(finlen, sum_three(\n scale(bytcalen, bytca, 2 * bdy, _16), _16,\n scale(scale(4, cc, bdytail, _8), _8, adx, _16b), _16b,\n scale(scale(4, aa, bdytail, _8), _8, -cdx, _16c), _16c, _32, _48), _48);\n }\n if (cdxtail !== 0) {\n cxtablen = scale(4, ab, cdxtail, cxtab);\n finlen = finadd(finlen, sum_three(\n scale(cxtablen, cxtab, 2 * cdx, _16), _16,\n scale(scale(4, bb, cdxtail, _8), _8, ady, _16b), _16b,\n scale(scale(4, aa, cdxtail, _8), _8, -bdy, _16c), _16c, _32, _48), _48);\n }\n if (cdytail !== 0) {\n cytablen = scale(4, ab, cdytail, cytab);\n finlen = finadd(finlen, sum_three(\n scale(cytablen, cytab, 2 * cdy, _16), _16,\n scale(scale(4, aa, cdytail, _8), _8, bdx, _16b), _16b,\n scale(scale(4, bb, cdytail, _8), _8, -adx, _16c), _16c, _32, _48), _48);\n }\n\n if (adxtail !== 0 || adytail !== 0) {\n if (bdxtail !== 0 || bdytail !== 0 || cdxtail !== 0 || cdytail !== 0) {\n s1 = bdxtail * cdy;\n c = splitter * bdxtail;\n ahi = c - (c - bdxtail);\n alo = bdxtail - ahi;\n c = splitter * cdy;\n bhi = c - (c - cdy);\n blo = cdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdx * cdytail;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * cdytail;\n bhi = c - (c - cdytail);\n blo = cdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n u[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n u[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n s1 = cdxtail * -bdy;\n c = splitter * cdxtail;\n ahi = c - (c - cdxtail);\n alo = cdxtail - ahi;\n c = splitter * -bdy;\n bhi = c - (c - -bdy);\n blo = -bdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdx * -bdytail;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * -bdytail;\n bhi = c - (c - -bdytail);\n blo = -bdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n v[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n v[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n v[2] = _j - (u3 - bvirt) + (_i - bvirt);\n v[3] = u3;\n bctlen = sum(4, u, 4, v, bct);\n s1 = bdxtail * cdytail;\n c = splitter * bdxtail;\n ahi = c - (c - bdxtail);\n alo = bdxtail - ahi;\n c = splitter * cdytail;\n bhi = c - (c - cdytail);\n blo = cdytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdxtail * bdytail;\n c = splitter * cdxtail;\n ahi = c - (c - cdxtail);\n alo = cdxtail - ahi;\n c = splitter * bdytail;\n bhi = c - (c - bdytail);\n blo = bdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bctt[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bctt[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bctt[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bctt[3] = u3;\n bcttlen = 4;\n } else {\n bct[0] = 0;\n bctlen = 1;\n bctt[0] = 0;\n bcttlen = 1;\n }\n if (adxtail !== 0) {\n const len = scale(bctlen, bct, adxtail, _16c);\n finlen = finadd(finlen, sum(\n scale(axtbclen, axtbc, adxtail, _16), _16,\n scale(len, _16c, 2 * adx, _32), _32, _48), _48);\n\n const len2 = scale(bcttlen, bctt, adxtail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * adx, _16), _16,\n scale(len2, _8, adxtail, _16b), _16b,\n scale(len, _16c, adxtail, _32), _32, _32b, _64), _64);\n\n if (bdytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, cc, adxtail, _8), _8, bdytail, _16), _16);\n }\n if (cdytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, bb, -adxtail, _8), _8, cdytail, _16), _16);\n }\n }\n if (adytail !== 0) {\n const len = scale(bctlen, bct, adytail, _16c);\n finlen = finadd(finlen, sum(\n scale(aytbclen, aytbc, adytail, _16), _16,\n scale(len, _16c, 2 * ady, _32), _32, _48), _48);\n\n const len2 = scale(bcttlen, bctt, adytail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * ady, _16), _16,\n scale(len2, _8, adytail, _16b), _16b,\n scale(len, _16c, adytail, _32), _32, _32b, _64), _64);\n }\n }\n if (bdxtail !== 0 || bdytail !== 0) {\n if (cdxtail !== 0 || cdytail !== 0 || adxtail !== 0 || adytail !== 0) {\n s1 = cdxtail * ady;\n c = splitter * cdxtail;\n ahi = c - (c - cdxtail);\n alo = cdxtail - ahi;\n c = splitter * ady;\n bhi = c - (c - ady);\n blo = ady - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cdx * adytail;\n c = splitter * cdx;\n ahi = c - (c - cdx);\n alo = cdx - ahi;\n c = splitter * adytail;\n bhi = c - (c - adytail);\n blo = adytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n u[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n u[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n n1 = -cdy;\n n0 = -cdytail;\n s1 = adxtail * n1;\n c = splitter * adxtail;\n ahi = c - (c - adxtail);\n alo = adxtail - ahi;\n c = splitter * n1;\n bhi = c - (c - n1);\n blo = n1 - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adx * n0;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * n0;\n bhi = c - (c - n0);\n blo = n0 - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n v[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n v[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n v[2] = _j - (u3 - bvirt) + (_i - bvirt);\n v[3] = u3;\n catlen = sum(4, u, 4, v, cat);\n s1 = cdxtail * adytail;\n c = splitter * cdxtail;\n ahi = c - (c - cdxtail);\n alo = cdxtail - ahi;\n c = splitter * adytail;\n bhi = c - (c - adytail);\n blo = adytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adxtail * cdytail;\n c = splitter * adxtail;\n ahi = c - (c - adxtail);\n alo = adxtail - ahi;\n c = splitter * cdytail;\n bhi = c - (c - cdytail);\n blo = cdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n catt[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n catt[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n catt[2] = _j - (u3 - bvirt) + (_i - bvirt);\n catt[3] = u3;\n cattlen = 4;\n } else {\n cat[0] = 0;\n catlen = 1;\n catt[0] = 0;\n cattlen = 1;\n }\n if (bdxtail !== 0) {\n const len = scale(catlen, cat, bdxtail, _16c);\n finlen = finadd(finlen, sum(\n scale(bxtcalen, bxtca, bdxtail, _16), _16,\n scale(len, _16c, 2 * bdx, _32), _32, _48), _48);\n\n const len2 = scale(cattlen, catt, bdxtail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * bdx, _16), _16,\n scale(len2, _8, bdxtail, _16b), _16b,\n scale(len, _16c, bdxtail, _32), _32, _32b, _64), _64);\n\n if (cdytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, aa, bdxtail, _8), _8, cdytail, _16), _16);\n }\n if (adytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, cc, -bdxtail, _8), _8, adytail, _16), _16);\n }\n }\n if (bdytail !== 0) {\n const len = scale(catlen, cat, bdytail, _16c);\n finlen = finadd(finlen, sum(\n scale(bytcalen, bytca, bdytail, _16), _16,\n scale(len, _16c, 2 * bdy, _32), _32, _48), _48);\n\n const len2 = scale(cattlen, catt, bdytail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * bdy, _16), _16,\n scale(len2, _8, bdytail, _16b), _16b,\n scale(len, _16c, bdytail, _32), _32, _32b, _64), _64);\n }\n }\n if (cdxtail !== 0 || cdytail !== 0) {\n if (adxtail !== 0 || adytail !== 0 || bdxtail !== 0 || bdytail !== 0) {\n s1 = adxtail * bdy;\n c = splitter * adxtail;\n ahi = c - (c - adxtail);\n alo = adxtail - ahi;\n c = splitter * bdy;\n bhi = c - (c - bdy);\n blo = bdy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = adx * bdytail;\n c = splitter * adx;\n ahi = c - (c - adx);\n alo = adx - ahi;\n c = splitter * bdytail;\n bhi = c - (c - bdytail);\n blo = bdytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n u[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n u[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n n1 = -ady;\n n0 = -adytail;\n s1 = bdxtail * n1;\n c = splitter * bdxtail;\n ahi = c - (c - bdxtail);\n alo = bdxtail - ahi;\n c = splitter * n1;\n bhi = c - (c - n1);\n blo = n1 - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdx * n0;\n c = splitter * bdx;\n ahi = c - (c - bdx);\n alo = bdx - ahi;\n c = splitter * n0;\n bhi = c - (c - n0);\n blo = n0 - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 + t0;\n bvirt = _i - s0;\n v[0] = s0 - (_i - bvirt) + (t0 - bvirt);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 + t1;\n bvirt = _i - _0;\n v[1] = _0 - (_i - bvirt) + (t1 - bvirt);\n u3 = _j + _i;\n bvirt = u3 - _j;\n v[2] = _j - (u3 - bvirt) + (_i - bvirt);\n v[3] = u3;\n abtlen = sum(4, u, 4, v, abt);\n s1 = adxtail * bdytail;\n c = splitter * adxtail;\n ahi = c - (c - adxtail);\n alo = adxtail - ahi;\n c = splitter * bdytail;\n bhi = c - (c - bdytail);\n blo = bdytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bdxtail * adytail;\n c = splitter * bdxtail;\n ahi = c - (c - bdxtail);\n alo = bdxtail - ahi;\n c = splitter * adytail;\n bhi = c - (c - adytail);\n blo = adytail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n abtt[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n abtt[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n abtt[2] = _j - (u3 - bvirt) + (_i - bvirt);\n abtt[3] = u3;\n abttlen = 4;\n } else {\n abt[0] = 0;\n abtlen = 1;\n abtt[0] = 0;\n abttlen = 1;\n }\n if (cdxtail !== 0) {\n const len = scale(abtlen, abt, cdxtail, _16c);\n finlen = finadd(finlen, sum(\n scale(cxtablen, cxtab, cdxtail, _16), _16,\n scale(len, _16c, 2 * cdx, _32), _32, _48), _48);\n\n const len2 = scale(abttlen, abtt, cdxtail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * cdx, _16), _16,\n scale(len2, _8, cdxtail, _16b), _16b,\n scale(len, _16c, cdxtail, _32), _32, _32b, _64), _64);\n\n if (adytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, bb, cdxtail, _8), _8, adytail, _16), _16);\n }\n if (bdytail !== 0) {\n finlen = finadd(finlen, scale(scale(4, aa, -cdxtail, _8), _8, bdytail, _16), _16);\n }\n }\n if (cdytail !== 0) {\n const len = scale(abtlen, abt, cdytail, _16c);\n finlen = finadd(finlen, sum(\n scale(cytablen, cytab, cdytail, _16), _16,\n scale(len, _16c, 2 * cdy, _32), _32, _48), _48);\n\n const len2 = scale(abttlen, abtt, cdytail, _8);\n finlen = finadd(finlen, sum_three(\n scale(len2, _8, 2 * cdy, _16), _16,\n scale(len2, _8, cdytail, _16b), _16b,\n scale(len, _16c, cdytail, _32), _32, _32b, _64), _64);\n }\n }\n\n return fin[finlen - 1];\n}\n\nexport function incircle(ax, ay, bx, by, cx, cy, dx, dy) {\n const adx = ax - dx;\n const bdx = bx - dx;\n const cdx = cx - dx;\n const ady = ay - dy;\n const bdy = by - dy;\n const cdy = cy - dy;\n\n const bdxcdy = bdx * cdy;\n const cdxbdy = cdx * bdy;\n const alift = adx * adx + ady * ady;\n\n const cdxady = cdx * ady;\n const adxcdy = adx * cdy;\n const blift = bdx * bdx + bdy * bdy;\n\n const adxbdy = adx * bdy;\n const bdxady = bdx * ady;\n const clift = cdx * cdx + cdy * cdy;\n\n const det =\n alift * (bdxcdy - cdxbdy) +\n blift * (cdxady - adxcdy) +\n clift * (adxbdy - bdxady);\n\n const permanent =\n (Math.abs(bdxcdy) + Math.abs(cdxbdy)) * alift +\n (Math.abs(cdxady) + Math.abs(adxcdy)) * blift +\n (Math.abs(adxbdy) + Math.abs(bdxady)) * clift;\n\n const errbound = iccerrboundA * permanent;\n\n if (det > errbound || -det > errbound) {\n return det;\n }\n return incircleadapt(ax, ay, bx, by, cx, cy, dx, dy, permanent);\n}\n\nexport function incirclefast(ax, ay, bx, by, cx, cy, dx, dy) {\n const adx = ax - dx;\n const ady = ay - dy;\n const bdx = bx - dx;\n const bdy = by - dy;\n const cdx = cx - dx;\n const cdy = cy - dy;\n\n const abdet = adx * bdy - bdx * ady;\n const bcdet = bdx * cdy - cdx * bdy;\n const cadet = cdx * ady - adx * cdy;\n const alift = adx * adx + ady * ady;\n const blift = bdx * bdx + bdy * bdy;\n const clift = cdx * cdx + cdy * cdy;\n\n return alift * bcdet + blift * cadet + clift * abdet;\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum, sum_three, scale, negate} from './util.js';\n\nconst isperrboundA = (16 + 224 * epsilon) * epsilon;\nconst isperrboundB = (5 + 72 * epsilon) * epsilon;\nconst isperrboundC = (71 + 1408 * epsilon) * epsilon * epsilon;\n\nconst ab = vec(4);\nconst bc = vec(4);\nconst cd = vec(4);\nconst de = vec(4);\nconst ea = vec(4);\nconst ac = vec(4);\nconst bd = vec(4);\nconst ce = vec(4);\nconst da = vec(4);\nconst eb = vec(4);\n\nconst abc = vec(24);\nconst bcd = vec(24);\nconst cde = vec(24);\nconst dea = vec(24);\nconst eab = vec(24);\nconst abd = vec(24);\nconst bce = vec(24);\nconst cda = vec(24);\nconst deb = vec(24);\nconst eac = vec(24);\n\nconst adet = vec(1152);\nconst bdet = vec(1152);\nconst cdet = vec(1152);\nconst ddet = vec(1152);\nconst edet = vec(1152);\nconst abdet = vec(2304);\nconst cddet = vec(2304);\nconst cdedet = vec(3456);\nconst deter = vec(5760);\n\nconst _8 = vec(8);\nconst _8b = vec(8);\nconst _8c = vec(8);\nconst _16 = vec(16);\nconst _24 = vec(24);\nconst _48 = vec(48);\nconst _48b = vec(48);\nconst _96 = vec(96);\nconst _192 = vec(192);\nconst _384x = vec(384);\nconst _384y = vec(384);\nconst _384z = vec(384);\nconst _768 = vec(768);\n\nfunction sum_three_scale(a, b, c, az, bz, cz, out) {\n return sum_three(\n scale(4, a, az, _8), _8,\n scale(4, b, bz, _8b), _8b,\n scale(4, c, cz, _8c), _8c, _16, out);\n}\n\nfunction liftexact(alen, a, blen, b, clen, c, dlen, d, x, y, z, out) {\n const len = sum(\n sum(alen, a, blen, b, _48), _48,\n negate(sum(clen, c, dlen, d, _48b), _48b), _48b, _96);\n\n return sum_three(\n scale(scale(len, _96, x, _192), _192, x, _384x), _384x,\n scale(scale(len, _96, y, _192), _192, y, _384y), _384y,\n scale(scale(len, _96, z, _192), _192, z, _384z), _384z, _768, out);\n}\n\nfunction insphereexact(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez) {\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n s1 = ax * by;\n c = splitter * ax;\n ahi = c - (c - ax);\n alo = ax - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bx * ay;\n c = splitter * bx;\n ahi = c - (c - bx);\n alo = bx - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ab[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ab[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ab[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ab[3] = u3;\n s1 = bx * cy;\n c = splitter * bx;\n ahi = c - (c - bx);\n alo = bx - ahi;\n c = splitter * cy;\n bhi = c - (c - cy);\n blo = cy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cx * by;\n c = splitter * cx;\n ahi = c - (c - cx);\n alo = cx - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bc[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bc[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bc[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bc[3] = u3;\n s1 = cx * dy;\n c = splitter * cx;\n ahi = c - (c - cx);\n alo = cx - ahi;\n c = splitter * dy;\n bhi = c - (c - dy);\n blo = dy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = dx * cy;\n c = splitter * dx;\n ahi = c - (c - dx);\n alo = dx - ahi;\n c = splitter * cy;\n bhi = c - (c - cy);\n blo = cy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n cd[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n cd[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n cd[2] = _j - (u3 - bvirt) + (_i - bvirt);\n cd[3] = u3;\n s1 = dx * ey;\n c = splitter * dx;\n ahi = c - (c - dx);\n alo = dx - ahi;\n c = splitter * ey;\n bhi = c - (c - ey);\n blo = ey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ex * dy;\n c = splitter * ex;\n ahi = c - (c - ex);\n alo = ex - ahi;\n c = splitter * dy;\n bhi = c - (c - dy);\n blo = dy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n de[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n de[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n de[2] = _j - (u3 - bvirt) + (_i - bvirt);\n de[3] = u3;\n s1 = ex * ay;\n c = splitter * ex;\n ahi = c - (c - ex);\n alo = ex - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ax * ey;\n c = splitter * ax;\n ahi = c - (c - ax);\n alo = ax - ahi;\n c = splitter * ey;\n bhi = c - (c - ey);\n blo = ey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ea[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ea[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ea[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ea[3] = u3;\n s1 = ax * cy;\n c = splitter * ax;\n ahi = c - (c - ax);\n alo = ax - ahi;\n c = splitter * cy;\n bhi = c - (c - cy);\n blo = cy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cx * ay;\n c = splitter * cx;\n ahi = c - (c - cx);\n alo = cx - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ac[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ac[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ac[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ac[3] = u3;\n s1 = bx * dy;\n c = splitter * bx;\n ahi = c - (c - bx);\n alo = bx - ahi;\n c = splitter * dy;\n bhi = c - (c - dy);\n blo = dy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = dx * by;\n c = splitter * dx;\n ahi = c - (c - dx);\n alo = dx - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bd[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bd[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n bd[2] = _j - (u3 - bvirt) + (_i - bvirt);\n bd[3] = u3;\n s1 = cx * ey;\n c = splitter * cx;\n ahi = c - (c - cx);\n alo = cx - ahi;\n c = splitter * ey;\n bhi = c - (c - ey);\n blo = ey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ex * cy;\n c = splitter * ex;\n ahi = c - (c - ex);\n alo = ex - ahi;\n c = splitter * cy;\n bhi = c - (c - cy);\n blo = cy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ce[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ce[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n ce[2] = _j - (u3 - bvirt) + (_i - bvirt);\n ce[3] = u3;\n s1 = dx * ay;\n c = splitter * dx;\n ahi = c - (c - dx);\n alo = dx - ahi;\n c = splitter * ay;\n bhi = c - (c - ay);\n blo = ay - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = ax * dy;\n c = splitter * ax;\n ahi = c - (c - ax);\n alo = ax - ahi;\n c = splitter * dy;\n bhi = c - (c - dy);\n blo = dy - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n da[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n da[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n da[2] = _j - (u3 - bvirt) + (_i - bvirt);\n da[3] = u3;\n s1 = ex * by;\n c = splitter * ex;\n ahi = c - (c - ex);\n alo = ex - ahi;\n c = splitter * by;\n bhi = c - (c - by);\n blo = by - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bx * ey;\n c = splitter * bx;\n ahi = c - (c - bx);\n alo = bx - ahi;\n c = splitter * ey;\n bhi = c - (c - ey);\n blo = ey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n eb[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n eb[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n eb[2] = _j - (u3 - bvirt) + (_i - bvirt);\n eb[3] = u3;\n\n const abclen = sum_three_scale(ab, bc, ac, cz, az, -bz, abc);\n const bcdlen = sum_three_scale(bc, cd, bd, dz, bz, -cz, bcd);\n const cdelen = sum_three_scale(cd, de, ce, ez, cz, -dz, cde);\n const dealen = sum_three_scale(de, ea, da, az, dz, -ez, dea);\n const eablen = sum_three_scale(ea, ab, eb, bz, ez, -az, eab);\n const abdlen = sum_three_scale(ab, bd, da, dz, az, bz, abd);\n const bcelen = sum_three_scale(bc, ce, eb, ez, bz, cz, bce);\n const cdalen = sum_three_scale(cd, da, ac, az, cz, dz, cda);\n const deblen = sum_three_scale(de, eb, bd, bz, dz, ez, deb);\n const eaclen = sum_three_scale(ea, ac, ce, cz, ez, az, eac);\n\n const deterlen = sum_three(\n liftexact(cdelen, cde, bcelen, bce, deblen, deb, bcdlen, bcd, ax, ay, az, adet), adet,\n liftexact(dealen, dea, cdalen, cda, eaclen, eac, cdelen, cde, bx, by, bz, bdet), bdet,\n sum_three(\n liftexact(eablen, eab, deblen, deb, abdlen, abd, dealen, dea, cx, cy, cz, cdet), cdet,\n liftexact(abclen, abc, eaclen, eac, bcelen, bce, eablen, eab, dx, dy, dz, ddet), ddet,\n liftexact(bcdlen, bcd, abdlen, abd, cdalen, cda, abclen, abc, ex, ey, ez, edet), edet, cddet, cdedet), cdedet, abdet, deter);\n\n return deter[deterlen - 1];\n}\n\nconst xdet = vec(96);\nconst ydet = vec(96);\nconst zdet = vec(96);\nconst fin = vec(1152);\n\nfunction liftadapt(a, b, c, az, bz, cz, x, y, z, out) {\n const len = sum_three_scale(a, b, c, az, bz, cz, _24);\n return sum_three(\n scale(scale(len, _24, x, _48), _48, x, xdet), xdet,\n scale(scale(len, _24, y, _48), _48, y, ydet), ydet,\n scale(scale(len, _24, z, _48), _48, z, zdet), zdet, _192, out);\n}\n\nfunction insphereadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez, permanent) {\n let ab3, bc3, cd3, da3, ac3, bd3;\n\n let aextail, bextail, cextail, dextail;\n let aeytail, beytail, ceytail, deytail;\n let aeztail, beztail, ceztail, deztail;\n\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0;\n\n const aex = ax - ex;\n const bex = bx - ex;\n const cex = cx - ex;\n const dex = dx - ex;\n const aey = ay - ey;\n const bey = by - ey;\n const cey = cy - ey;\n const dey = dy - ey;\n const aez = az - ez;\n const bez = bz - ez;\n const cez = cz - ez;\n const dez = dz - ez;\n\n s1 = aex * bey;\n c = splitter * aex;\n ahi = c - (c - aex);\n alo = aex - ahi;\n c = splitter * bey;\n bhi = c - (c - bey);\n blo = bey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = bex * aey;\n c = splitter * bex;\n ahi = c - (c - bex);\n alo = bex - ahi;\n c = splitter * aey;\n bhi = c - (c - aey);\n blo = aey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ab[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ab[1] = _0 - (_i + bvirt) + (bvirt - t1);\n ab3 = _j + _i;\n bvirt = ab3 - _j;\n ab[2] = _j - (ab3 - bvirt) + (_i - bvirt);\n ab[3] = ab3;\n s1 = bex * cey;\n c = splitter * bex;\n ahi = c - (c - bex);\n alo = bex - ahi;\n c = splitter * cey;\n bhi = c - (c - cey);\n blo = cey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cex * bey;\n c = splitter * cex;\n ahi = c - (c - cex);\n alo = cex - ahi;\n c = splitter * bey;\n bhi = c - (c - bey);\n blo = bey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bc[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bc[1] = _0 - (_i + bvirt) + (bvirt - t1);\n bc3 = _j + _i;\n bvirt = bc3 - _j;\n bc[2] = _j - (bc3 - bvirt) + (_i - bvirt);\n bc[3] = bc3;\n s1 = cex * dey;\n c = splitter * cex;\n ahi = c - (c - cex);\n alo = cex - ahi;\n c = splitter * dey;\n bhi = c - (c - dey);\n blo = dey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = dex * cey;\n c = splitter * dex;\n ahi = c - (c - dex);\n alo = dex - ahi;\n c = splitter * cey;\n bhi = c - (c - cey);\n blo = cey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n cd[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n cd[1] = _0 - (_i + bvirt) + (bvirt - t1);\n cd3 = _j + _i;\n bvirt = cd3 - _j;\n cd[2] = _j - (cd3 - bvirt) + (_i - bvirt);\n cd[3] = cd3;\n s1 = dex * aey;\n c = splitter * dex;\n ahi = c - (c - dex);\n alo = dex - ahi;\n c = splitter * aey;\n bhi = c - (c - aey);\n blo = aey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = aex * dey;\n c = splitter * aex;\n ahi = c - (c - aex);\n alo = aex - ahi;\n c = splitter * dey;\n bhi = c - (c - dey);\n blo = dey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n da[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n da[1] = _0 - (_i + bvirt) + (bvirt - t1);\n da3 = _j + _i;\n bvirt = da3 - _j;\n da[2] = _j - (da3 - bvirt) + (_i - bvirt);\n da[3] = da3;\n s1 = aex * cey;\n c = splitter * aex;\n ahi = c - (c - aex);\n alo = aex - ahi;\n c = splitter * cey;\n bhi = c - (c - cey);\n blo = cey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = cex * aey;\n c = splitter * cex;\n ahi = c - (c - cex);\n alo = cex - ahi;\n c = splitter * aey;\n bhi = c - (c - aey);\n blo = aey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n ac[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n ac[1] = _0 - (_i + bvirt) + (bvirt - t1);\n ac3 = _j + _i;\n bvirt = ac3 - _j;\n ac[2] = _j - (ac3 - bvirt) + (_i - bvirt);\n ac[3] = ac3;\n s1 = bex * dey;\n c = splitter * bex;\n ahi = c - (c - bex);\n alo = bex - ahi;\n c = splitter * dey;\n bhi = c - (c - dey);\n blo = dey - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = dex * bey;\n c = splitter * dex;\n ahi = c - (c - dex);\n alo = dex - ahi;\n c = splitter * bey;\n bhi = c - (c - bey);\n blo = bey - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n bd[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n bd[1] = _0 - (_i + bvirt) + (bvirt - t1);\n bd3 = _j + _i;\n bvirt = bd3 - _j;\n bd[2] = _j - (bd3 - bvirt) + (_i - bvirt);\n bd[3] = bd3;\n\n const finlen = sum(\n sum(\n negate(liftadapt(bc, cd, bd, dez, bez, -cez, aex, aey, aez, adet), adet), adet,\n liftadapt(cd, da, ac, aez, cez, dez, bex, bey, bez, bdet), bdet, abdet), abdet,\n sum(\n negate(liftadapt(da, ab, bd, bez, dez, aez, cex, cey, cez, cdet), cdet), cdet,\n liftadapt(ab, bc, ac, cez, aez, -bez, dex, dey, dez, ddet), ddet, cddet), cddet, fin);\n\n let det = estimate(finlen, fin);\n let errbound = isperrboundB * permanent;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - aex;\n aextail = ax - (aex + bvirt) + (bvirt - ex);\n bvirt = ay - aey;\n aeytail = ay - (aey + bvirt) + (bvirt - ey);\n bvirt = az - aez;\n aeztail = az - (aez + bvirt) + (bvirt - ez);\n bvirt = bx - bex;\n bextail = bx - (bex + bvirt) + (bvirt - ex);\n bvirt = by - bey;\n beytail = by - (bey + bvirt) + (bvirt - ey);\n bvirt = bz - bez;\n beztail = bz - (bez + bvirt) + (bvirt - ez);\n bvirt = cx - cex;\n cextail = cx - (cex + bvirt) + (bvirt - ex);\n bvirt = cy - cey;\n ceytail = cy - (cey + bvirt) + (bvirt - ey);\n bvirt = cz - cez;\n ceztail = cz - (cez + bvirt) + (bvirt - ez);\n bvirt = dx - dex;\n dextail = dx - (dex + bvirt) + (bvirt - ex);\n bvirt = dy - dey;\n deytail = dy - (dey + bvirt) + (bvirt - ey);\n bvirt = dz - dez;\n deztail = dz - (dez + bvirt) + (bvirt - ez);\n if (aextail === 0 && aeytail === 0 && aeztail === 0 &&\n bextail === 0 && beytail === 0 && beztail === 0 &&\n cextail === 0 && ceytail === 0 && ceztail === 0 &&\n dextail === 0 && deytail === 0 && deztail === 0) {\n return det;\n }\n\n errbound = isperrboundC * permanent + resulterrbound * Math.abs(det);\n\n const abeps = (aex * beytail + bey * aextail) - (aey * bextail + bex * aeytail);\n const bceps = (bex * ceytail + cey * bextail) - (bey * cextail + cex * beytail);\n const cdeps = (cex * deytail + dey * cextail) - (cey * dextail + dex * ceytail);\n const daeps = (dex * aeytail + aey * dextail) - (dey * aextail + aex * deytail);\n const aceps = (aex * ceytail + cey * aextail) - (aey * cextail + cex * aeytail);\n const bdeps = (bex * deytail + dey * bextail) - (bey * dextail + dex * beytail);\n det +=\n (((bex * bex + bey * bey + bez * bez) * ((cez * daeps + dez * aceps + aez * cdeps) +\n (ceztail * da3 + deztail * ac3 + aeztail * cd3)) + (dex * dex + dey * dey + dez * dez) *\n ((aez * bceps - bez * aceps + cez * abeps) + (aeztail * bc3 - beztail * ac3 + ceztail * ab3))) -\n ((aex * aex + aey * aey + aez * aez) * ((bez * cdeps - cez * bdeps + dez * bceps) +\n (beztail * cd3 - ceztail * bd3 + deztail * bc3)) + (cex * cex + cey * cey + cez * cez) *\n ((dez * abeps + aez * bdeps + bez * daeps) + (deztail * ab3 + aeztail * bd3 + beztail * da3)))) +\n 2 * (((bex * bextail + bey * beytail + bez * beztail) * (cez * da3 + dez * ac3 + aez * cd3) +\n (dex * dextail + dey * deytail + dez * deztail) * (aez * bc3 - bez * ac3 + cez * ab3)) -\n ((aex * aextail + aey * aeytail + aez * aeztail) * (bez * cd3 - cez * bd3 + dez * bc3) +\n (cex * cextail + cey * ceytail + cez * ceztail) * (dez * ab3 + aez * bd3 + bez * da3)));\n\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n return insphereexact(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez);\n}\n\nexport function insphere(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez) {\n const aex = ax - ex;\n const bex = bx - ex;\n const cex = cx - ex;\n const dex = dx - ex;\n const aey = ay - ey;\n const bey = by - ey;\n const cey = cy - ey;\n const dey = dy - ey;\n const aez = az - ez;\n const bez = bz - ez;\n const cez = cz - ez;\n const dez = dz - ez;\n\n const aexbey = aex * bey;\n const bexaey = bex * aey;\n const ab = aexbey - bexaey;\n const bexcey = bex * cey;\n const cexbey = cex * bey;\n const bc = bexcey - cexbey;\n const cexdey = cex * dey;\n const dexcey = dex * cey;\n const cd = cexdey - dexcey;\n const dexaey = dex * aey;\n const aexdey = aex * dey;\n const da = dexaey - aexdey;\n const aexcey = aex * cey;\n const cexaey = cex * aey;\n const ac = aexcey - cexaey;\n const bexdey = bex * dey;\n const dexbey = dex * bey;\n const bd = bexdey - dexbey;\n\n const abc = aez * bc - bez * ac + cez * ab;\n const bcd = bez * cd - cez * bd + dez * bc;\n const cda = cez * da + dez * ac + aez * cd;\n const dab = dez * ab + aez * bd + bez * da;\n\n const alift = aex * aex + aey * aey + aez * aez;\n const blift = bex * bex + bey * bey + bez * bez;\n const clift = cex * cex + cey * cey + cez * cez;\n const dlift = dex * dex + dey * dey + dez * dez;\n\n const det = (clift * dab - dlift * abc) + (alift * bcd - blift * cda);\n\n const aezplus = Math.abs(aez);\n const bezplus = Math.abs(bez);\n const cezplus = Math.abs(cez);\n const dezplus = Math.abs(dez);\n const aexbeyplus = Math.abs(aexbey);\n const bexaeyplus = Math.abs(bexaey);\n const bexceyplus = Math.abs(bexcey);\n const cexbeyplus = Math.abs(cexbey);\n const cexdeyplus = Math.abs(cexdey);\n const dexceyplus = Math.abs(dexcey);\n const dexaeyplus = Math.abs(dexaey);\n const aexdeyplus = Math.abs(aexdey);\n const aexceyplus = Math.abs(aexcey);\n const cexaeyplus = Math.abs(cexaey);\n const bexdeyplus = Math.abs(bexdey);\n const dexbeyplus = Math.abs(dexbey);\n const permanent =\n ((cexdeyplus + dexceyplus) * bezplus + (dexbeyplus + bexdeyplus) * cezplus + (bexceyplus + cexbeyplus) * dezplus) * alift +\n ((dexaeyplus + aexdeyplus) * cezplus + (aexceyplus + cexaeyplus) * dezplus + (cexdeyplus + dexceyplus) * aezplus) * blift +\n ((aexbeyplus + bexaeyplus) * dezplus + (bexdeyplus + dexbeyplus) * aezplus + (dexaeyplus + aexdeyplus) * bezplus) * clift +\n ((bexceyplus + cexbeyplus) * aezplus + (cexaeyplus + aexceyplus) * bezplus + (aexbeyplus + bexaeyplus) * cezplus) * dlift;\n\n const errbound = isperrboundA * permanent;\n if (det > errbound || -det > errbound) {\n return det;\n }\n return -insphereadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, ex, ey, ez, permanent);\n}\n\nexport function inspherefast(pax, pay, paz, pbx, pby, pbz, pcx, pcy, pcz, pdx, pdy, pdz, pex, pey, pez) {\n const aex = pax - pex;\n const bex = pbx - pex;\n const cex = pcx - pex;\n const dex = pdx - pex;\n const aey = pay - pey;\n const bey = pby - pey;\n const cey = pcy - pey;\n const dey = pdy - pey;\n const aez = paz - pez;\n const bez = pbz - pez;\n const cez = pcz - pez;\n const dez = pdz - pez;\n\n const ab = aex * bey - bex * aey;\n const bc = bex * cey - cex * bey;\n const cd = cex * dey - dex * cey;\n const da = dex * aey - aex * dey;\n const ac = aex * cey - cex * aey;\n const bd = bex * dey - dex * bey;\n\n const abc = aez * bc - bez * ac + cez * ab;\n const bcd = bez * cd - cez * bd + dez * bc;\n const cda = cez * da + dez * ac + aez * cd;\n const dab = dez * ab + aez * bd + bez * da;\n\n const alift = aex * aex + aey * aey + aez * aez;\n const blift = bex * bex + bey * bey + bez * bez;\n const clift = cex * cex + cey * cey + cez * cez;\n const dlift = dex * dex + dey * dey + dez * dez;\n\n return (clift * dab - dlift * abc) + (alift * bcd - blift * cda);\n}\n","\nconst EPSILON = Math.pow(2, -52);\nconst EDGE_STACK = new Uint32Array(512);\n\nimport {orient2d} from 'robust-predicates';\n\nexport default class Delaunator {\n\n static from(points, getX = defaultGetX, getY = defaultGetY) {\n const n = points.length;\n const coords = new Float64Array(n * 2);\n\n for (let i = 0; i < n; i++) {\n const p = points[i];\n coords[2 * i] = getX(p);\n coords[2 * i + 1] = getY(p);\n }\n\n return new Delaunator(coords);\n }\n\n constructor(coords) {\n const n = coords.length >> 1;\n if (n > 0 && typeof coords[0] !== 'number') throw new Error('Expected coords to contain numbers.');\n\n this.coords = coords;\n\n // arrays that will store the triangulation graph\n const maxTriangles = Math.max(2 * n - 5, 0);\n this._triangles = new Uint32Array(maxTriangles * 3);\n this._halfedges = new Int32Array(maxTriangles * 3);\n\n // temporary arrays for tracking the edges of the advancing convex hull\n this._hashSize = Math.ceil(Math.sqrt(n));\n this._hullPrev = new Uint32Array(n); // edge to prev edge\n this._hullNext = new Uint32Array(n); // edge to next edge\n this._hullTri = new Uint32Array(n); // edge to adjacent triangle\n this._hullHash = new Int32Array(this._hashSize).fill(-1); // angular edge hash\n\n // temporary arrays for sorting points\n this._ids = new Uint32Array(n);\n this._dists = new Float64Array(n);\n\n this.update();\n }\n\n update() {\n const {coords, _hullPrev: hullPrev, _hullNext: hullNext, _hullTri: hullTri, _hullHash: hullHash} = this;\n const n = coords.length >> 1;\n\n // populate an array of point indices; calculate input data bbox\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n\n for (let i = 0; i < n; i++) {\n const x = coords[2 * i];\n const y = coords[2 * i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n this._ids[i] = i;\n }\n const cx = (minX + maxX) / 2;\n const cy = (minY + maxY) / 2;\n\n let minDist = Infinity;\n let i0, i1, i2;\n\n // pick a seed point close to the center\n for (let i = 0; i < n; i++) {\n const d = dist(cx, cy, coords[2 * i], coords[2 * i + 1]);\n if (d < minDist) {\n i0 = i;\n minDist = d;\n }\n }\n const i0x = coords[2 * i0];\n const i0y = coords[2 * i0 + 1];\n\n minDist = Infinity;\n\n // find the point closest to the seed\n for (let i = 0; i < n; i++) {\n if (i === i0) continue;\n const d = dist(i0x, i0y, coords[2 * i], coords[2 * i + 1]);\n if (d < minDist && d > 0) {\n i1 = i;\n minDist = d;\n }\n }\n let i1x = coords[2 * i1];\n let i1y = coords[2 * i1 + 1];\n\n let minRadius = Infinity;\n\n // find the third point which forms the smallest circumcircle with the first two\n for (let i = 0; i < n; i++) {\n if (i === i0 || i === i1) continue;\n const r = circumradius(i0x, i0y, i1x, i1y, coords[2 * i], coords[2 * i + 1]);\n if (r < minRadius) {\n i2 = i;\n minRadius = r;\n }\n }\n let i2x = coords[2 * i2];\n let i2y = coords[2 * i2 + 1];\n\n if (minRadius === Infinity) {\n // order collinear points by dx (or dy if all x are identical)\n // and return the list as a hull\n for (let i = 0; i < n; i++) {\n this._dists[i] = (coords[2 * i] - coords[0]) || (coords[2 * i + 1] - coords[1]);\n }\n quicksort(this._ids, this._dists, 0, n - 1);\n const hull = new Uint32Array(n);\n let j = 0;\n for (let i = 0, d0 = -Infinity; i < n; i++) {\n const id = this._ids[i];\n if (this._dists[id] > d0) {\n hull[j++] = id;\n d0 = this._dists[id];\n }\n }\n this.hull = hull.subarray(0, j);\n this.triangles = new Uint32Array(0);\n this.halfedges = new Uint32Array(0);\n return;\n }\n\n // swap the order of the seed points for counter-clockwise orientation\n if (orient2d(i0x, i0y, i1x, i1y, i2x, i2y) < 0) {\n const i = i1;\n const x = i1x;\n const y = i1y;\n i1 = i2;\n i1x = i2x;\n i1y = i2y;\n i2 = i;\n i2x = x;\n i2y = y;\n }\n\n const center = circumcenter(i0x, i0y, i1x, i1y, i2x, i2y);\n this._cx = center.x;\n this._cy = center.y;\n\n for (let i = 0; i < n; i++) {\n this._dists[i] = dist(coords[2 * i], coords[2 * i + 1], center.x, center.y);\n }\n\n // sort the points by distance from the seed triangle circumcenter\n quicksort(this._ids, this._dists, 0, n - 1);\n\n // set up the seed triangle as the starting hull\n this._hullStart = i0;\n let hullSize = 3;\n\n hullNext[i0] = hullPrev[i2] = i1;\n hullNext[i1] = hullPrev[i0] = i2;\n hullNext[i2] = hullPrev[i1] = i0;\n\n hullTri[i0] = 0;\n hullTri[i1] = 1;\n hullTri[i2] = 2;\n\n hullHash.fill(-1);\n hullHash[this._hashKey(i0x, i0y)] = i0;\n hullHash[this._hashKey(i1x, i1y)] = i1;\n hullHash[this._hashKey(i2x, i2y)] = i2;\n\n this.trianglesLen = 0;\n this._addTriangle(i0, i1, i2, -1, -1, -1);\n\n for (let k = 0, xp, yp; k < this._ids.length; k++) {\n const i = this._ids[k];\n const x = coords[2 * i];\n const y = coords[2 * i + 1];\n\n // skip near-duplicate points\n if (k > 0 && Math.abs(x - xp) <= EPSILON && Math.abs(y - yp) <= EPSILON) continue;\n xp = x;\n yp = y;\n\n // skip seed triangle points\n if (i === i0 || i === i1 || i === i2) continue;\n\n // find a visible edge on the convex hull using edge hash\n let start = 0;\n for (let j = 0, key = this._hashKey(x, y); j < this._hashSize; j++) {\n start = hullHash[(key + j) % this._hashSize];\n if (start !== -1 && start !== hullNext[start]) break;\n }\n\n start = hullPrev[start];\n let e = start, q;\n while (q = hullNext[e], orient2d(x, y, coords[2 * e], coords[2 * e + 1], coords[2 * q], coords[2 * q + 1]) >= 0) {\n e = q;\n if (e === start) {\n e = -1;\n break;\n }\n }\n if (e === -1) continue; // likely a near-duplicate point; skip it\n\n // add the first triangle from the point\n let t = this._addTriangle(e, i, hullNext[e], -1, -1, hullTri[e]);\n\n // recursively flip triangles from the point until they satisfy the Delaunay condition\n hullTri[i] = this._legalize(t + 2);\n hullTri[e] = t; // keep track of boundary triangles on the hull\n hullSize++;\n\n // walk forward through the hull, adding more triangles and flipping recursively\n let n = hullNext[e];\n while (q = hullNext[n], orient2d(x, y, coords[2 * n], coords[2 * n + 1], coords[2 * q], coords[2 * q + 1]) < 0) {\n t = this._addTriangle(n, i, q, hullTri[i], -1, hullTri[n]);\n hullTri[i] = this._legalize(t + 2);\n hullNext[n] = n; // mark as removed\n hullSize--;\n n = q;\n }\n\n // walk backward from the other side, adding more triangles and flipping\n if (e === start) {\n while (q = hullPrev[e], orient2d(x, y, coords[2 * q], coords[2 * q + 1], coords[2 * e], coords[2 * e + 1]) < 0) {\n t = this._addTriangle(q, i, e, -1, hullTri[e], hullTri[q]);\n this._legalize(t + 2);\n hullTri[q] = t;\n hullNext[e] = e; // mark as removed\n hullSize--;\n e = q;\n }\n }\n\n // update the hull indices\n this._hullStart = hullPrev[i] = e;\n hullNext[e] = hullPrev[n] = i;\n hullNext[i] = n;\n\n // save the two new edges in the hash table\n hullHash[this._hashKey(x, y)] = i;\n hullHash[this._hashKey(coords[2 * e], coords[2 * e + 1])] = e;\n }\n\n this.hull = new Uint32Array(hullSize);\n for (let i = 0, e = this._hullStart; i < hullSize; i++) {\n this.hull[i] = e;\n e = hullNext[e];\n }\n\n // trim typed triangle mesh arrays\n this.triangles = this._triangles.subarray(0, this.trianglesLen);\n this.halfedges = this._halfedges.subarray(0, this.trianglesLen);\n }\n\n _hashKey(x, y) {\n return Math.floor(pseudoAngle(x - this._cx, y - this._cy) * this._hashSize) % this._hashSize;\n }\n\n _legalize(a) {\n const {_triangles: triangles, _halfedges: halfedges, coords} = this;\n\n let i = 0;\n let ar = 0;\n\n // recursion eliminated with a fixed-size stack\n while (true) {\n const b = halfedges[a];\n\n /* if the pair of triangles doesn't satisfy the Delaunay condition\n * (p1 is inside the circumcircle of [p0, pl, pr]), flip them,\n * then do the same check/flip recursively for the new pair of triangles\n *\n * pl pl\n * /||\\ / \\\n * al/ || \\bl al/ \\a\n * / || \\ / \\\n * / a||b \\ flip /___ar___\\\n * p0\\ || /p1 => p0\\---bl---/p1\n * \\ || / \\ /\n * ar\\ || /br b\\ /br\n * \\||/ \\ /\n * pr pr\n */\n const a0 = a - a % 3;\n ar = a0 + (a + 2) % 3;\n\n if (b === -1) { // convex hull edge\n if (i === 0) break;\n a = EDGE_STACK[--i];\n continue;\n }\n\n const b0 = b - b % 3;\n const al = a0 + (a + 1) % 3;\n const bl = b0 + (b + 2) % 3;\n\n const p0 = triangles[ar];\n const pr = triangles[a];\n const pl = triangles[al];\n const p1 = triangles[bl];\n\n const illegal = inCircle(\n coords[2 * p0], coords[2 * p0 + 1],\n coords[2 * pr], coords[2 * pr + 1],\n coords[2 * pl], coords[2 * pl + 1],\n coords[2 * p1], coords[2 * p1 + 1]);\n\n if (illegal) {\n triangles[a] = p1;\n triangles[b] = p0;\n\n const hbl = halfedges[bl];\n\n // edge swapped on the other side of the hull (rare); fix the halfedge reference\n if (hbl === -1) {\n let e = this._hullStart;\n do {\n if (this._hullTri[e] === bl) {\n this._hullTri[e] = a;\n break;\n }\n e = this._hullPrev[e];\n } while (e !== this._hullStart);\n }\n this._link(a, hbl);\n this._link(b, halfedges[ar]);\n this._link(ar, bl);\n\n const br = b0 + (b + 1) % 3;\n\n // don't worry about hitting the cap: it can only happen on extremely degenerate input\n if (i < EDGE_STACK.length) {\n EDGE_STACK[i++] = br;\n }\n } else {\n if (i === 0) break;\n a = EDGE_STACK[--i];\n }\n }\n\n return ar;\n }\n\n _link(a, b) {\n this._halfedges[a] = b;\n if (b !== -1) this._halfedges[b] = a;\n }\n\n // add a new triangle given vertex indices and adjacent half-edge ids\n _addTriangle(i0, i1, i2, a, b, c) {\n const t = this.trianglesLen;\n\n this._triangles[t] = i0;\n this._triangles[t + 1] = i1;\n this._triangles[t + 2] = i2;\n\n this._link(t, a);\n this._link(t + 1, b);\n this._link(t + 2, c);\n\n this.trianglesLen += 3;\n\n return t;\n }\n}\n\n// monotonically increases with real angle, but doesn't need expensive trigonometry\nfunction pseudoAngle(dx, dy) {\n const p = dx / (Math.abs(dx) + Math.abs(dy));\n return (dy > 0 ? 3 - p : 1 + p) / 4; // [0..1]\n}\n\nfunction dist(ax, ay, bx, by) {\n const dx = ax - bx;\n const dy = ay - by;\n return dx * dx + dy * dy;\n}\n\nfunction inCircle(ax, ay, bx, by, cx, cy, px, py) {\n const dx = ax - px;\n const dy = ay - py;\n const ex = bx - px;\n const ey = by - py;\n const fx = cx - px;\n const fy = cy - py;\n\n const ap = dx * dx + dy * dy;\n const bp = ex * ex + ey * ey;\n const cp = fx * fx + fy * fy;\n\n return dx * (ey * cp - bp * fy) -\n dy * (ex * cp - bp * fx) +\n ap * (ex * fy - ey * fx) < 0;\n}\n\nfunction circumradius(ax, ay, bx, by, cx, cy) {\n const dx = bx - ax;\n const dy = by - ay;\n const ex = cx - ax;\n const ey = cy - ay;\n\n const bl = dx * dx + dy * dy;\n const cl = ex * ex + ey * ey;\n const d = 0.5 / (dx * ey - dy * ex);\n\n const x = (ey * bl - dy * cl) * d;\n const y = (dx * cl - ex * bl) * d;\n\n return x * x + y * y;\n}\n\nfunction circumcenter(ax, ay, bx, by, cx, cy) {\n const dx = bx - ax;\n const dy = by - ay;\n const ex = cx - ax;\n const ey = cy - ay;\n\n const bl = dx * dx + dy * dy;\n const cl = ex * ex + ey * ey;\n const d = 0.5 / (dx * ey - dy * ex);\n\n const x = ax + (ey * bl - dy * cl) * d;\n const y = ay + (dx * cl - ex * bl) * d;\n\n return {x, y};\n}\n\nfunction quicksort(ids, dists, left, right) {\n if (right - left <= 20) {\n for (let i = left + 1; i <= right; i++) {\n const temp = ids[i];\n const tempDist = dists[temp];\n let j = i - 1;\n while (j >= left && dists[ids[j]] > tempDist) ids[j + 1] = ids[j--];\n ids[j + 1] = temp;\n }\n } else {\n const median = (left + right) >> 1;\n let i = left + 1;\n let j = right;\n swap(ids, median, i);\n if (dists[ids[left]] > dists[ids[right]]) swap(ids, left, right);\n if (dists[ids[i]] > dists[ids[right]]) swap(ids, i, right);\n if (dists[ids[left]] > dists[ids[i]]) swap(ids, left, i);\n\n const temp = ids[i];\n const tempDist = dists[temp];\n while (true) {\n do i++; while (dists[ids[i]] < tempDist);\n do j--; while (dists[ids[j]] > tempDist);\n if (j < i) break;\n swap(ids, i, j);\n }\n ids[left + 1] = ids[j];\n ids[j] = temp;\n\n if (right - i + 1 >= j - left) {\n quicksort(ids, dists, i, right);\n quicksort(ids, dists, left, j - 1);\n } else {\n quicksort(ids, dists, left, j - 1);\n quicksort(ids, dists, i, right);\n }\n }\n}\n\nfunction swap(arr, i, j) {\n const tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\nfunction defaultGetX(p) {\n return p[0];\n}\nfunction defaultGetY(p) {\n return p[1];\n}\n","const epsilon = 1e-6;\n\nexport default class Path {\n constructor() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n }\n moveTo(x, y) {\n this._ += `M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n }\n lineTo(x, y) {\n this._ += `L${this._x1 = +x},${this._y1 = +y}`;\n }\n arc(x, y, r) {\n x = +x, y = +y, r = +r;\n const x0 = x + r;\n const y0 = y;\n if (r < 0) throw new Error(\"negative radius\");\n if (this._x1 === null) this._ += `M${x0},${y0}`;\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) this._ += \"L\" + x0 + \",\" + y0;\n if (!r) return;\n this._ += `A${r},${r},0,1,1,${x - r},${y}A${r},${r},0,1,1,${this._x1 = x0},${this._y1 = y0}`;\n }\n rect(x, y, w, h) {\n this._ += `M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${+w}v${+h}h${-w}Z`;\n }\n value() {\n return this._ || null;\n }\n}\n","export default class Polygon {\n constructor() {\n this._ = [];\n }\n moveTo(x, y) {\n this._.push([x, y]);\n }\n closePath() {\n this._.push(this._[0].slice());\n }\n lineTo(x, y) {\n this._.push([x, y]);\n }\n value() {\n return this._.length ? this._ : null;\n }\n}\n","import Path from \"./path.js\";\nimport Polygon from \"./polygon.js\";\n\nexport default class Voronoi {\n constructor(delaunay, [xmin, ymin, xmax, ymax] = [0, 0, 960, 500]) {\n if (!((xmax = +xmax) >= (xmin = +xmin)) || !((ymax = +ymax) >= (ymin = +ymin))) throw new Error(\"invalid bounds\");\n this.delaunay = delaunay;\n this._circumcenters = new Float64Array(delaunay.points.length * 2);\n this.vectors = new Float64Array(delaunay.points.length * 2);\n this.xmax = xmax, this.xmin = xmin;\n this.ymax = ymax, this.ymin = ymin;\n this._init();\n }\n update() {\n this.delaunay.update();\n this._init();\n return this;\n }\n _init() {\n const {delaunay: {points, hull, triangles}, vectors} = this;\n let bx, by; // lazily computed barycenter of the hull\n\n // Compute circumcenters.\n const circumcenters = this.circumcenters = this._circumcenters.subarray(0, triangles.length / 3 * 2);\n for (let i = 0, j = 0, n = triangles.length, x, y; i < n; i += 3, j += 2) {\n const t1 = triangles[i] * 2;\n const t2 = triangles[i + 1] * 2;\n const t3 = triangles[i + 2] * 2;\n const x1 = points[t1];\n const y1 = points[t1 + 1];\n const x2 = points[t2];\n const y2 = points[t2 + 1];\n const x3 = points[t3];\n const y3 = points[t3 + 1];\n\n const dx = x2 - x1;\n const dy = y2 - y1;\n const ex = x3 - x1;\n const ey = y3 - y1;\n const ab = (dx * ey - dy * ex) * 2;\n\n if (Math.abs(ab) < 1e-9) {\n // For a degenerate triangle, the circumcenter is at the infinity, in a\n // direction orthogonal to the halfedge and away from the “center” of\n // the diagram , defined as the hull’s barycenter.\n if (bx === undefined) {\n bx = by = 0;\n for (const i of hull) bx += points[i * 2], by += points[i * 2 + 1];\n bx /= hull.length, by /= hull.length;\n }\n const a = 1e9 * Math.sign((bx - x1) * ey - (by - y1) * ex);\n x = (x1 + x3) / 2 - a * ey;\n y = (y1 + y3) / 2 + a * ex;\n } else {\n const d = 1 / ab;\n const bl = dx * dx + dy * dy;\n const cl = ex * ex + ey * ey;\n x = x1 + (ey * bl - dy * cl) * d;\n y = y1 + (dx * cl - ex * bl) * d;\n }\n circumcenters[j] = x;\n circumcenters[j + 1] = y;\n }\n\n // Compute exterior cell rays.\n let h = hull[hull.length - 1];\n let p0, p1 = h * 4;\n let x0, x1 = points[2 * h];\n let y0, y1 = points[2 * h + 1];\n vectors.fill(0);\n for (let i = 0; i < hull.length; ++i) {\n h = hull[i];\n p0 = p1, x0 = x1, y0 = y1;\n p1 = h * 4, x1 = points[2 * h], y1 = points[2 * h + 1];\n vectors[p0 + 2] = vectors[p1] = y0 - y1;\n vectors[p0 + 3] = vectors[p1 + 1] = x1 - x0;\n }\n }\n render(context) {\n const buffer = context == null ? context = new Path : undefined;\n const {delaunay: {halfedges, inedges, hull}, circumcenters, vectors} = this;\n if (hull.length <= 1) return null;\n for (let i = 0, n = halfedges.length; i < n; ++i) {\n const j = halfedges[i];\n if (j < i) continue;\n const ti = Math.floor(i / 3) * 2;\n const tj = Math.floor(j / 3) * 2;\n const xi = circumcenters[ti];\n const yi = circumcenters[ti + 1];\n const xj = circumcenters[tj];\n const yj = circumcenters[tj + 1];\n this._renderSegment(xi, yi, xj, yj, context);\n }\n let h0, h1 = hull[hull.length - 1];\n for (let i = 0; i < hull.length; ++i) {\n h0 = h1, h1 = hull[i];\n const t = Math.floor(inedges[h1] / 3) * 2;\n const x = circumcenters[t];\n const y = circumcenters[t + 1];\n const v = h0 * 4;\n const p = this._project(x, y, vectors[v + 2], vectors[v + 3]);\n if (p) this._renderSegment(x, y, p[0], p[1], context);\n }\n return buffer && buffer.value();\n }\n renderBounds(context) {\n const buffer = context == null ? context = new Path : undefined;\n context.rect(this.xmin, this.ymin, this.xmax - this.xmin, this.ymax - this.ymin);\n return buffer && buffer.value();\n }\n renderCell(i, context) {\n const buffer = context == null ? context = new Path : undefined;\n const points = this._clip(i);\n if (points === null || !points.length) return;\n context.moveTo(points[0], points[1]);\n let n = points.length;\n while (points[0] === points[n-2] && points[1] === points[n-1] && n > 1) n -= 2;\n for (let i = 2; i < n; i += 2) {\n if (points[i] !== points[i-2] || points[i+1] !== points[i-1])\n context.lineTo(points[i], points[i + 1]);\n }\n context.closePath();\n return buffer && buffer.value();\n }\n *cellPolygons() {\n const {delaunay: {points}} = this;\n for (let i = 0, n = points.length / 2; i < n; ++i) {\n const cell = this.cellPolygon(i);\n if (cell) cell.index = i, yield cell;\n }\n }\n cellPolygon(i) {\n const polygon = new Polygon;\n this.renderCell(i, polygon);\n return polygon.value();\n }\n _renderSegment(x0, y0, x1, y1, context) {\n let S;\n const c0 = this._regioncode(x0, y0);\n const c1 = this._regioncode(x1, y1);\n if (c0 === 0 && c1 === 0) {\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n } else if (S = this._clipSegment(x0, y0, x1, y1, c0, c1)) {\n context.moveTo(S[0], S[1]);\n context.lineTo(S[2], S[3]);\n }\n }\n contains(i, x, y) {\n if ((x = +x, x !== x) || (y = +y, y !== y)) return false;\n return this.delaunay._step(i, x, y) === i;\n }\n *neighbors(i) {\n const ci = this._clip(i);\n if (ci) for (const j of this.delaunay.neighbors(i)) {\n const cj = this._clip(j);\n // find the common edge\n if (cj) loop: for (let ai = 0, li = ci.length; ai < li; ai += 2) {\n for (let aj = 0, lj = cj.length; aj < lj; aj += 2) {\n if (ci[ai] === cj[aj]\n && ci[ai + 1] === cj[aj + 1]\n && ci[(ai + 2) % li] === cj[(aj + lj - 2) % lj]\n && ci[(ai + 3) % li] === cj[(aj + lj - 1) % lj]) {\n yield j;\n break loop;\n }\n }\n }\n }\n }\n _cell(i) {\n const {circumcenters, delaunay: {inedges, halfedges, triangles}} = this;\n const e0 = inedges[i];\n if (e0 === -1) return null; // coincident point\n const points = [];\n let e = e0;\n do {\n const t = Math.floor(e / 3);\n points.push(circumcenters[t * 2], circumcenters[t * 2 + 1]);\n e = e % 3 === 2 ? e - 2 : e + 1;\n if (triangles[e] !== i) break; // bad triangulation\n e = halfedges[e];\n } while (e !== e0 && e !== -1);\n return points;\n }\n _clip(i) {\n // degenerate case (1 valid point: return the box)\n if (i === 0 && this.delaunay.hull.length === 1) {\n return [this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax, this.xmin, this.ymin];\n }\n const points = this._cell(i);\n if (points === null) return null;\n const {vectors: V} = this;\n const v = i * 4;\n return this._simplify(V[v] || V[v + 1]\n ? this._clipInfinite(i, points, V[v], V[v + 1], V[v + 2], V[v + 3])\n : this._clipFinite(i, points));\n }\n _clipFinite(i, points) {\n const n = points.length;\n let P = null;\n let x0, y0, x1 = points[n - 2], y1 = points[n - 1];\n let c0, c1 = this._regioncode(x1, y1);\n let e0, e1 = 0;\n for (let j = 0; j < n; j += 2) {\n x0 = x1, y0 = y1, x1 = points[j], y1 = points[j + 1];\n c0 = c1, c1 = this._regioncode(x1, y1);\n if (c0 === 0 && c1 === 0) {\n e0 = e1, e1 = 0;\n if (P) P.push(x1, y1);\n else P = [x1, y1];\n } else {\n let S, sx0, sy0, sx1, sy1;\n if (c0 === 0) {\n if ((S = this._clipSegment(x0, y0, x1, y1, c0, c1)) === null) continue;\n [sx0, sy0, sx1, sy1] = S;\n } else {\n if ((S = this._clipSegment(x1, y1, x0, y0, c1, c0)) === null) continue;\n [sx1, sy1, sx0, sy0] = S;\n e0 = e1, e1 = this._edgecode(sx0, sy0);\n if (e0 && e1) this._edge(i, e0, e1, P, P.length);\n if (P) P.push(sx0, sy0);\n else P = [sx0, sy0];\n }\n e0 = e1, e1 = this._edgecode(sx1, sy1);\n if (e0 && e1) this._edge(i, e0, e1, P, P.length);\n if (P) P.push(sx1, sy1);\n else P = [sx1, sy1];\n }\n }\n if (P) {\n e0 = e1, e1 = this._edgecode(P[0], P[1]);\n if (e0 && e1) this._edge(i, e0, e1, P, P.length);\n } else if (this.contains(i, (this.xmin + this.xmax) / 2, (this.ymin + this.ymax) / 2)) {\n return [this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax, this.xmin, this.ymin];\n }\n return P;\n }\n _clipSegment(x0, y0, x1, y1, c0, c1) {\n // for more robustness, always consider the segment in the same order\n const flip = c0 < c1;\n if (flip) [x0, y0, x1, y1, c0, c1] = [x1, y1, x0, y0, c1, c0];\n while (true) {\n if (c0 === 0 && c1 === 0) return flip ? [x1, y1, x0, y0] : [x0, y0, x1, y1];\n if (c0 & c1) return null;\n let x, y, c = c0 || c1;\n if (c & 0b1000) x = x0 + (x1 - x0) * (this.ymax - y0) / (y1 - y0), y = this.ymax;\n else if (c & 0b0100) x = x0 + (x1 - x0) * (this.ymin - y0) / (y1 - y0), y = this.ymin;\n else if (c & 0b0010) y = y0 + (y1 - y0) * (this.xmax - x0) / (x1 - x0), x = this.xmax;\n else y = y0 + (y1 - y0) * (this.xmin - x0) / (x1 - x0), x = this.xmin;\n if (c0) x0 = x, y0 = y, c0 = this._regioncode(x0, y0);\n else x1 = x, y1 = y, c1 = this._regioncode(x1, y1);\n }\n }\n _clipInfinite(i, points, vx0, vy0, vxn, vyn) {\n let P = Array.from(points), p;\n if (p = this._project(P[0], P[1], vx0, vy0)) P.unshift(p[0], p[1]);\n if (p = this._project(P[P.length - 2], P[P.length - 1], vxn, vyn)) P.push(p[0], p[1]);\n if (P = this._clipFinite(i, P)) {\n for (let j = 0, n = P.length, c0, c1 = this._edgecode(P[n - 2], P[n - 1]); j < n; j += 2) {\n c0 = c1, c1 = this._edgecode(P[j], P[j + 1]);\n if (c0 && c1) j = this._edge(i, c0, c1, P, j), n = P.length;\n }\n } else if (this.contains(i, (this.xmin + this.xmax) / 2, (this.ymin + this.ymax) / 2)) {\n P = [this.xmin, this.ymin, this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax];\n }\n return P;\n }\n _edge(i, e0, e1, P, j) {\n while (e0 !== e1) {\n let x, y;\n switch (e0) {\n case 0b0101: e0 = 0b0100; continue; // top-left\n case 0b0100: e0 = 0b0110, x = this.xmax, y = this.ymin; break; // top\n case 0b0110: e0 = 0b0010; continue; // top-right\n case 0b0010: e0 = 0b1010, x = this.xmax, y = this.ymax; break; // right\n case 0b1010: e0 = 0b1000; continue; // bottom-right\n case 0b1000: e0 = 0b1001, x = this.xmin, y = this.ymax; break; // bottom\n case 0b1001: e0 = 0b0001; continue; // bottom-left\n case 0b0001: e0 = 0b0101, x = this.xmin, y = this.ymin; break; // left\n }\n // Note: this implicitly checks for out of bounds: if P[j] or P[j+1] are\n // undefined, the conditional statement will be executed.\n if ((P[j] !== x || P[j + 1] !== y) && this.contains(i, x, y)) {\n P.splice(j, 0, x, y), j += 2;\n }\n }\n return j;\n }\n _project(x0, y0, vx, vy) {\n let t = Infinity, c, x, y;\n if (vy < 0) { // top\n if (y0 <= this.ymin) return null;\n if ((c = (this.ymin - y0) / vy) < t) y = this.ymin, x = x0 + (t = c) * vx;\n } else if (vy > 0) { // bottom\n if (y0 >= this.ymax) return null;\n if ((c = (this.ymax - y0) / vy) < t) y = this.ymax, x = x0 + (t = c) * vx;\n }\n if (vx > 0) { // right\n if (x0 >= this.xmax) return null;\n if ((c = (this.xmax - x0) / vx) < t) x = this.xmax, y = y0 + (t = c) * vy;\n } else if (vx < 0) { // left\n if (x0 <= this.xmin) return null;\n if ((c = (this.xmin - x0) / vx) < t) x = this.xmin, y = y0 + (t = c) * vy;\n }\n return [x, y];\n }\n _edgecode(x, y) {\n return (x === this.xmin ? 0b0001\n : x === this.xmax ? 0b0010 : 0b0000)\n | (y === this.ymin ? 0b0100\n : y === this.ymax ? 0b1000 : 0b0000);\n }\n _regioncode(x, y) {\n return (x < this.xmin ? 0b0001\n : x > this.xmax ? 0b0010 : 0b0000)\n | (y < this.ymin ? 0b0100\n : y > this.ymax ? 0b1000 : 0b0000);\n }\n _simplify(P) {\n if (P && P.length > 4) {\n for (let i = 0; i < P.length; i+= 2) {\n const j = (i + 2) % P.length, k = (i + 4) % P.length;\n if (P[i] === P[j] && P[j] === P[k] || P[i + 1] === P[j + 1] && P[j + 1] === P[k + 1]) {\n P.splice(j, 2), i -= 2;\n }\n }\n if (!P.length) P = null;\n }\n return P;\n }\n}\n","import Delaunator from \"delaunator\";\nimport Path from \"./path.js\";\nimport Polygon from \"./polygon.js\";\nimport Voronoi from \"./voronoi.js\";\n\nconst tau = 2 * Math.PI, pow = Math.pow;\n\nfunction pointX(p) {\n return p[0];\n}\n\nfunction pointY(p) {\n return p[1];\n}\n\n// A triangulation is collinear if all its triangles have a non-null area\nfunction collinear(d) {\n const {triangles, coords} = d;\n for (let i = 0; i < triangles.length; i += 3) {\n const a = 2 * triangles[i],\n b = 2 * triangles[i + 1],\n c = 2 * triangles[i + 2],\n cross = (coords[c] - coords[a]) * (coords[b + 1] - coords[a + 1])\n - (coords[b] - coords[a]) * (coords[c + 1] - coords[a + 1]);\n if (cross > 1e-10) return false;\n }\n return true;\n}\n\nfunction jitter(x, y, r) {\n return [x + Math.sin(x + y) * r, y + Math.cos(x - y) * r];\n}\n\nexport default class Delaunay {\n static from(points, fx = pointX, fy = pointY, that) {\n return new Delaunay(\"length\" in points\n ? flatArray(points, fx, fy, that)\n : Float64Array.from(flatIterable(points, fx, fy, that)));\n }\n constructor(points) {\n this._delaunator = new Delaunator(points);\n this.inedges = new Int32Array(points.length / 2);\n this._hullIndex = new Int32Array(points.length / 2);\n this.points = this._delaunator.coords;\n this._init();\n }\n update() {\n this._delaunator.update();\n this._init();\n return this;\n }\n _init() {\n const d = this._delaunator, points = this.points;\n\n // check for collinear\n if (d.hull && d.hull.length > 2 && collinear(d)) {\n this.collinear = Int32Array.from({length: points.length/2}, (_,i) => i)\n .sort((i, j) => points[2 * i] - points[2 * j] || points[2 * i + 1] - points[2 * j + 1]); // for exact neighbors\n const e = this.collinear[0], f = this.collinear[this.collinear.length - 1],\n bounds = [ points[2 * e], points[2 * e + 1], points[2 * f], points[2 * f + 1] ],\n r = 1e-8 * Math.hypot(bounds[3] - bounds[1], bounds[2] - bounds[0]);\n for (let i = 0, n = points.length / 2; i < n; ++i) {\n const p = jitter(points[2 * i], points[2 * i + 1], r);\n points[2 * i] = p[0];\n points[2 * i + 1] = p[1];\n }\n this._delaunator = new Delaunator(points);\n } else {\n delete this.collinear;\n }\n\n const halfedges = this.halfedges = this._delaunator.halfedges;\n const hull = this.hull = this._delaunator.hull;\n const triangles = this.triangles = this._delaunator.triangles;\n const inedges = this.inedges.fill(-1);\n const hullIndex = this._hullIndex.fill(-1);\n\n // Compute an index from each point to an (arbitrary) incoming halfedge\n // Used to give the first neighbor of each point; for this reason,\n // on the hull we give priority to exterior halfedges\n for (let e = 0, n = halfedges.length; e < n; ++e) {\n const p = triangles[e % 3 === 2 ? e - 2 : e + 1];\n if (halfedges[e] === -1 || inedges[p] === -1) inedges[p] = e;\n }\n for (let i = 0, n = hull.length; i < n; ++i) {\n hullIndex[hull[i]] = i;\n }\n\n // degenerate case: 1 or 2 (distinct) points\n if (hull.length <= 2 && hull.length > 0) {\n this.triangles = new Int32Array(3).fill(-1);\n this.halfedges = new Int32Array(3).fill(-1);\n this.triangles[0] = hull[0];\n inedges[hull[0]] = 1;\n if (hull.length === 2) {\n inedges[hull[1]] = 0;\n this.triangles[1] = hull[1];\n this.triangles[2] = hull[1];\n }\n }\n }\n voronoi(bounds) {\n return new Voronoi(this, bounds);\n }\n *neighbors(i) {\n const {inedges, hull, _hullIndex, halfedges, triangles, collinear} = this;\n\n // degenerate case with several collinear points\n if (collinear) {\n const l = collinear.indexOf(i);\n if (l > 0) yield collinear[l - 1];\n if (l < collinear.length - 1) yield collinear[l + 1];\n return;\n }\n\n const e0 = inedges[i];\n if (e0 === -1) return; // coincident point\n let e = e0, p0 = -1;\n do {\n yield p0 = triangles[e];\n e = e % 3 === 2 ? e - 2 : e + 1;\n if (triangles[e] !== i) return; // bad triangulation\n e = halfedges[e];\n if (e === -1) {\n const p = hull[(_hullIndex[i] + 1) % hull.length];\n if (p !== p0) yield p;\n return;\n }\n } while (e !== e0);\n }\n find(x, y, i = 0) {\n if ((x = +x, x !== x) || (y = +y, y !== y)) return -1;\n const i0 = i;\n let c;\n while ((c = this._step(i, x, y)) >= 0 && c !== i && c !== i0) i = c;\n return c;\n }\n _step(i, x, y) {\n const {inedges, hull, _hullIndex, halfedges, triangles, points} = this;\n if (inedges[i] === -1 || !points.length) return (i + 1) % (points.length >> 1);\n let c = i;\n let dc = pow(x - points[i * 2], 2) + pow(y - points[i * 2 + 1], 2);\n const e0 = inedges[i];\n let e = e0;\n do {\n let t = triangles[e];\n const dt = pow(x - points[t * 2], 2) + pow(y - points[t * 2 + 1], 2);\n if (dt < dc) dc = dt, c = t;\n e = e % 3 === 2 ? e - 2 : e + 1;\n if (triangles[e] !== i) break; // bad triangulation\n e = halfedges[e];\n if (e === -1) {\n e = hull[(_hullIndex[i] + 1) % hull.length];\n if (e !== t) {\n if (pow(x - points[e * 2], 2) + pow(y - points[e * 2 + 1], 2) < dc) return e;\n }\n break;\n }\n } while (e !== e0);\n return c;\n }\n render(context) {\n const buffer = context == null ? context = new Path : undefined;\n const {points, halfedges, triangles} = this;\n for (let i = 0, n = halfedges.length; i < n; ++i) {\n const j = halfedges[i];\n if (j < i) continue;\n const ti = triangles[i] * 2;\n const tj = triangles[j] * 2;\n context.moveTo(points[ti], points[ti + 1]);\n context.lineTo(points[tj], points[tj + 1]);\n }\n this.renderHull(context);\n return buffer && buffer.value();\n }\n renderPoints(context, r) {\n if (r === undefined && (!context || typeof context.moveTo !== \"function\")) r = context, context = null;\n r = r == undefined ? 2 : +r;\n const buffer = context == null ? context = new Path : undefined;\n const {points} = this;\n for (let i = 0, n = points.length; i < n; i += 2) {\n const x = points[i], y = points[i + 1];\n context.moveTo(x + r, y);\n context.arc(x, y, r, 0, tau);\n }\n return buffer && buffer.value();\n }\n renderHull(context) {\n const buffer = context == null ? context = new Path : undefined;\n const {hull, points} = this;\n const h = hull[0] * 2, n = hull.length;\n context.moveTo(points[h], points[h + 1]);\n for (let i = 1; i < n; ++i) {\n const h = 2 * hull[i];\n context.lineTo(points[h], points[h + 1]);\n }\n context.closePath();\n return buffer && buffer.value();\n }\n hullPolygon() {\n const polygon = new Polygon;\n this.renderHull(polygon);\n return polygon.value();\n }\n renderTriangle(i, context) {\n const buffer = context == null ? context = new Path : undefined;\n const {points, triangles} = this;\n const t0 = triangles[i *= 3] * 2;\n const t1 = triangles[i + 1] * 2;\n const t2 = triangles[i + 2] * 2;\n context.moveTo(points[t0], points[t0 + 1]);\n context.lineTo(points[t1], points[t1 + 1]);\n context.lineTo(points[t2], points[t2 + 1]);\n context.closePath();\n return buffer && buffer.value();\n }\n *trianglePolygons() {\n const {triangles} = this;\n for (let i = 0, n = triangles.length / 3; i < n; ++i) {\n yield this.trianglePolygon(i);\n }\n }\n trianglePolygon(i) {\n const polygon = new Polygon;\n this.renderTriangle(i, polygon);\n return polygon.value();\n }\n}\n\nfunction flatArray(points, fx, fy, that) {\n const n = points.length;\n const array = new Float64Array(n * 2);\n for (let i = 0; i < n; ++i) {\n const p = points[i];\n array[i * 2] = fx.call(that, p, i, points);\n array[i * 2 + 1] = fy.call(that, p, i, points);\n }\n return array;\n}\n\nfunction* flatIterable(points, fx, fy, that) {\n let i = 0;\n for (const p of points) {\n yield fx.call(that, p, i, points);\n yield fy.call(that, p, i, points);\n ++i;\n }\n}\n","import { Transform } from 'vega-dataflow';\nimport { inherits } from 'vega-util';\nimport { Delaunay } from 'd3-delaunay';\n\nfunction Voronoi(params) {\n Transform.call(this, null, params);\n}\nVoronoi.Definition = {\n 'type': 'Voronoi',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'x',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'y',\n 'type': 'field',\n 'required': true\n }, {\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'extent',\n 'type': 'array',\n 'array': true,\n 'length': 2,\n 'default': [[-1e5, -1e5], [1e5, 1e5]],\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }, {\n 'name': 'as',\n 'type': 'string',\n 'default': 'path'\n }]\n};\nconst defaultExtent = [-1e5, -1e5, 1e5, 1e5];\ninherits(Voronoi, Transform, {\n transform(_, pulse) {\n const as = _.as || 'path',\n data = pulse.source;\n\n // nothing to do if no data\n if (!data || !data.length) return pulse;\n\n // configure and construct voronoi diagram\n let s = _.size;\n s = s ? [0, 0, s[0], s[1]] : (s = _.extent) ? [s[0][0], s[0][1], s[1][0], s[1][1]] : defaultExtent;\n const voronoi = this.value = Delaunay.from(data, _.x, _.y).voronoi(s);\n\n // map polygons to paths\n for (let i = 0, n = data.length; i < n; ++i) {\n const polygon = voronoi.cellPolygon(i);\n data[i][as] = polygon && !isPoint(polygon) ? toPathString(polygon) : null;\n }\n return pulse.reflow(_.modified()).modifies(as);\n }\n});\n\n// suppress duplicated end point vertices\nfunction toPathString(p) {\n const x = p[0][0],\n y = p[0][1];\n let n = p.length - 1;\n for (; p[n][0] === x && p[n][1] === y; --n);\n return 'M' + p.slice(0, n + 1).join('L') + 'Z';\n}\nfunction isPoint(p) {\n return p.length === 2 && p[0][0] === p[1][0] && p[0][1] === p[1][1];\n}\n\nexport { Voronoi as voronoi };\n","import { canvas } from 'vega-canvas';\nimport { Transform } from 'vega-dataflow';\nimport { inherits, error, isFunction, constant, extent } from 'vega-util';\nimport { scale } from 'vega-scale';\nimport { random } from 'vega-statistics';\n\n/*\nCopyright (c) 2013, Jason Davies.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n * The name Jason Davies may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL JASON DAVIES BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\nOR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\nADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n// Word cloud layout by Jason Davies, https://www.jasondavies.com/wordcloud/\n// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf\n\nvar cloudRadians = Math.PI / 180,\n cw = 1 << 11 >> 5,\n ch = 1 << 11;\nfunction cloud () {\n var size = [256, 256],\n text,\n font,\n fontSize,\n fontStyle,\n fontWeight,\n rotate,\n padding,\n spiral = archimedeanSpiral,\n words = [],\n random = Math.random,\n cloud = {};\n cloud.layout = function () {\n var contextAndRatio = getContext(canvas()),\n board = zeroArray((size[0] >> 5) * size[1]),\n bounds = null,\n n = words.length,\n i = -1,\n tags = [],\n data = words.map(d => ({\n text: text(d),\n font: font(d),\n style: fontStyle(d),\n weight: fontWeight(d),\n rotate: rotate(d),\n size: ~~(fontSize(d) + 1e-14),\n padding: padding(d),\n xoff: 0,\n yoff: 0,\n x1: 0,\n y1: 0,\n x0: 0,\n y0: 0,\n hasText: false,\n sprite: null,\n datum: d\n })).sort((a, b) => b.size - a.size);\n while (++i < n) {\n var d = data[i];\n d.x = size[0] * (random() + .5) >> 1;\n d.y = size[1] * (random() + .5) >> 1;\n cloudSprite(contextAndRatio, d, data, i);\n if (d.hasText && place(board, d, bounds)) {\n tags.push(d);\n if (bounds) cloudBounds(bounds, d);else bounds = [{\n x: d.x + d.x0,\n y: d.y + d.y0\n }, {\n x: d.x + d.x1,\n y: d.y + d.y1\n }];\n // Temporary hack\n d.x -= size[0] >> 1;\n d.y -= size[1] >> 1;\n }\n }\n return tags;\n };\n function getContext(canvas) {\n canvas.width = canvas.height = 1;\n var ratio = Math.sqrt(canvas.getContext('2d').getImageData(0, 0, 1, 1).data.length >> 2);\n canvas.width = (cw << 5) / ratio;\n canvas.height = ch / ratio;\n var context = canvas.getContext('2d');\n context.fillStyle = context.strokeStyle = 'red';\n context.textAlign = 'center';\n return {\n context: context,\n ratio: ratio\n };\n }\n function place(board, tag, bounds) {\n var startX = tag.x,\n startY = tag.y,\n maxDelta = Math.hypot(size[0], size[1]),\n s = spiral(size),\n dt = random() < .5 ? 1 : -1,\n t = -dt,\n dxdy,\n dx,\n dy;\n while (dxdy = s(t += dt)) {\n dx = ~~dxdy[0];\n dy = ~~dxdy[1];\n if (Math.min(Math.abs(dx), Math.abs(dy)) >= maxDelta) break;\n tag.x = startX + dx;\n tag.y = startY + dy;\n if (tag.x + tag.x0 < 0 || tag.y + tag.y0 < 0 || tag.x + tag.x1 > size[0] || tag.y + tag.y1 > size[1]) continue;\n // TODO only check for collisions within current bounds.\n if (!bounds || !cloudCollide(tag, board, size[0])) {\n if (!bounds || collideRects(tag, bounds)) {\n var sprite = tag.sprite,\n w = tag.width >> 5,\n sw = size[0] >> 5,\n lx = tag.x - (w << 4),\n sx = lx & 0x7f,\n msx = 32 - sx,\n h = tag.y1 - tag.y0,\n x = (tag.y + tag.y0) * sw + (lx >> 5),\n last;\n for (var j = 0; j < h; j++) {\n last = 0;\n for (var i = 0; i <= w; i++) {\n board[x + i] |= last << msx | (i < w ? (last = sprite[j * w + i]) >>> sx : 0);\n }\n x += sw;\n }\n tag.sprite = null;\n return true;\n }\n }\n }\n return false;\n }\n cloud.words = function (_) {\n if (arguments.length) {\n words = _;\n return cloud;\n } else {\n return words;\n }\n };\n cloud.size = function (_) {\n if (arguments.length) {\n size = [+_[0], +_[1]];\n return cloud;\n } else {\n return size;\n }\n };\n cloud.font = function (_) {\n if (arguments.length) {\n font = functor(_);\n return cloud;\n } else {\n return font;\n }\n };\n cloud.fontStyle = function (_) {\n if (arguments.length) {\n fontStyle = functor(_);\n return cloud;\n } else {\n return fontStyle;\n }\n };\n cloud.fontWeight = function (_) {\n if (arguments.length) {\n fontWeight = functor(_);\n return cloud;\n } else {\n return fontWeight;\n }\n };\n cloud.rotate = function (_) {\n if (arguments.length) {\n rotate = functor(_);\n return cloud;\n } else {\n return rotate;\n }\n };\n cloud.text = function (_) {\n if (arguments.length) {\n text = functor(_);\n return cloud;\n } else {\n return text;\n }\n };\n cloud.spiral = function (_) {\n if (arguments.length) {\n spiral = spirals[_] || _;\n return cloud;\n } else {\n return spiral;\n }\n };\n cloud.fontSize = function (_) {\n if (arguments.length) {\n fontSize = functor(_);\n return cloud;\n } else {\n return fontSize;\n }\n };\n cloud.padding = function (_) {\n if (arguments.length) {\n padding = functor(_);\n return cloud;\n } else {\n return padding;\n }\n };\n cloud.random = function (_) {\n if (arguments.length) {\n random = _;\n return cloud;\n } else {\n return random;\n }\n };\n return cloud;\n}\n\n// Fetches a monochrome sprite bitmap for the specified text.\n// Load in batches for speed.\nfunction cloudSprite(contextAndRatio, d, data, di) {\n if (d.sprite) return;\n var c = contextAndRatio.context,\n ratio = contextAndRatio.ratio;\n c.clearRect(0, 0, (cw << 5) / ratio, ch / ratio);\n var x = 0,\n y = 0,\n maxh = 0,\n n = data.length,\n w,\n w32,\n h,\n i,\n j;\n --di;\n while (++di < n) {\n d = data[di];\n c.save();\n c.font = d.style + ' ' + d.weight + ' ' + ~~((d.size + 1) / ratio) + 'px ' + d.font;\n w = c.measureText(d.text + 'm').width * ratio;\n h = d.size << 1;\n if (d.rotate) {\n var sr = Math.sin(d.rotate * cloudRadians),\n cr = Math.cos(d.rotate * cloudRadians),\n wcr = w * cr,\n wsr = w * sr,\n hcr = h * cr,\n hsr = h * sr;\n w = Math.max(Math.abs(wcr + hsr), Math.abs(wcr - hsr)) + 0x1f >> 5 << 5;\n h = ~~Math.max(Math.abs(wsr + hcr), Math.abs(wsr - hcr));\n } else {\n w = w + 0x1f >> 5 << 5;\n }\n if (h > maxh) maxh = h;\n if (x + w >= cw << 5) {\n x = 0;\n y += maxh;\n maxh = 0;\n }\n if (y + h >= ch) break;\n c.translate((x + (w >> 1)) / ratio, (y + (h >> 1)) / ratio);\n if (d.rotate) c.rotate(d.rotate * cloudRadians);\n c.fillText(d.text, 0, 0);\n if (d.padding) {\n c.lineWidth = 2 * d.padding;\n c.strokeText(d.text, 0, 0);\n }\n c.restore();\n d.width = w;\n d.height = h;\n d.xoff = x;\n d.yoff = y;\n d.x1 = w >> 1;\n d.y1 = h >> 1;\n d.x0 = -d.x1;\n d.y0 = -d.y1;\n d.hasText = true;\n x += w;\n }\n var pixels = c.getImageData(0, 0, (cw << 5) / ratio, ch / ratio).data,\n sprite = [];\n while (--di >= 0) {\n d = data[di];\n if (!d.hasText) continue;\n w = d.width;\n w32 = w >> 5;\n h = d.y1 - d.y0;\n // Zero the buffer\n for (i = 0; i < h * w32; i++) sprite[i] = 0;\n x = d.xoff;\n if (x == null) return;\n y = d.yoff;\n var seen = 0,\n seenRow = -1;\n for (j = 0; j < h; j++) {\n for (i = 0; i < w; i++) {\n var k = w32 * j + (i >> 5),\n m = pixels[(y + j) * (cw << 5) + (x + i) << 2] ? 1 << 31 - i % 32 : 0;\n sprite[k] |= m;\n seen |= m;\n }\n if (seen) seenRow = j;else {\n d.y0++;\n h--;\n j--;\n y++;\n }\n }\n d.y1 = d.y0 + seenRow;\n d.sprite = sprite.slice(0, (d.y1 - d.y0) * w32);\n }\n}\n\n// Use mask-based collision detection.\nfunction cloudCollide(tag, board, sw) {\n sw >>= 5;\n var sprite = tag.sprite,\n w = tag.width >> 5,\n lx = tag.x - (w << 4),\n sx = lx & 0x7f,\n msx = 32 - sx,\n h = tag.y1 - tag.y0,\n x = (tag.y + tag.y0) * sw + (lx >> 5),\n last;\n for (var j = 0; j < h; j++) {\n last = 0;\n for (var i = 0; i <= w; i++) {\n if ((last << msx | (i < w ? (last = sprite[j * w + i]) >>> sx : 0)) & board[x + i]) return true;\n }\n x += sw;\n }\n return false;\n}\nfunction cloudBounds(bounds, d) {\n var b0 = bounds[0],\n b1 = bounds[1];\n if (d.x + d.x0 < b0.x) b0.x = d.x + d.x0;\n if (d.y + d.y0 < b0.y) b0.y = d.y + d.y0;\n if (d.x + d.x1 > b1.x) b1.x = d.x + d.x1;\n if (d.y + d.y1 > b1.y) b1.y = d.y + d.y1;\n}\nfunction collideRects(a, b) {\n return a.x + a.x1 > b[0].x && a.x + a.x0 < b[1].x && a.y + a.y1 > b[0].y && a.y + a.y0 < b[1].y;\n}\nfunction archimedeanSpiral(size) {\n var e = size[0] / size[1];\n return function (t) {\n return [e * (t *= .1) * Math.cos(t), t * Math.sin(t)];\n };\n}\nfunction rectangularSpiral(size) {\n var dy = 4,\n dx = dy * size[0] / size[1],\n x = 0,\n y = 0;\n return function (t) {\n var sign = t < 0 ? -1 : 1;\n // See triangular numbers: T_n = n * (n + 1) / 2.\n switch (Math.sqrt(1 + 4 * sign * t) - sign & 3) {\n case 0:\n x += dx;\n break;\n case 1:\n y += dy;\n break;\n case 2:\n x -= dx;\n break;\n default:\n y -= dy;\n break;\n }\n return [x, y];\n };\n}\n\n// TODO reuse arrays?\nfunction zeroArray(n) {\n var a = [],\n i = -1;\n while (++i < n) a[i] = 0;\n return a;\n}\nfunction functor(d) {\n return typeof d === 'function' ? d : function () {\n return d;\n };\n}\nvar spirals = {\n archimedean: archimedeanSpiral,\n rectangular: rectangularSpiral\n};\n\nconst Output = ['x', 'y', 'font', 'fontSize', 'fontStyle', 'fontWeight', 'angle'];\nconst Params = ['text', 'font', 'rotate', 'fontSize', 'fontStyle', 'fontWeight'];\nfunction Wordcloud(params) {\n Transform.call(this, cloud(), params);\n}\nWordcloud.Definition = {\n 'type': 'Wordcloud',\n 'metadata': {\n 'modifies': true\n },\n 'params': [{\n 'name': 'size',\n 'type': 'number',\n 'array': true,\n 'length': 2\n }, {\n 'name': 'font',\n 'type': 'string',\n 'expr': true,\n 'default': 'sans-serif'\n }, {\n 'name': 'fontStyle',\n 'type': 'string',\n 'expr': true,\n 'default': 'normal'\n }, {\n 'name': 'fontWeight',\n 'type': 'string',\n 'expr': true,\n 'default': 'normal'\n }, {\n 'name': 'fontSize',\n 'type': 'number',\n 'expr': true,\n 'default': 14\n }, {\n 'name': 'fontSizeRange',\n 'type': 'number',\n 'array': 'nullable',\n 'default': [10, 50]\n }, {\n 'name': 'rotate',\n 'type': 'number',\n 'expr': true,\n 'default': 0\n }, {\n 'name': 'text',\n 'type': 'field'\n }, {\n 'name': 'spiral',\n 'type': 'string',\n 'values': ['archimedean', 'rectangular']\n }, {\n 'name': 'padding',\n 'type': 'number',\n 'expr': true\n }, {\n 'name': 'as',\n 'type': 'string',\n 'array': true,\n 'length': 7,\n 'default': Output\n }]\n};\ninherits(Wordcloud, Transform, {\n transform(_, pulse) {\n if (_.size && !(_.size[0] && _.size[1])) {\n error('Wordcloud size dimensions must be non-zero.');\n }\n function modp(param) {\n const p = _[param];\n return isFunction(p) && pulse.modified(p.fields);\n }\n const mod = _.modified();\n if (!(mod || pulse.changed(pulse.ADD_REM) || Params.some(modp))) return;\n const data = pulse.materialize(pulse.SOURCE).source,\n layout = this.value,\n as = _.as || Output;\n let fontSize = _.fontSize || 14,\n range;\n isFunction(fontSize) ? range = _.fontSizeRange : fontSize = constant(fontSize);\n\n // create font size scaling function as needed\n if (range) {\n const fsize = fontSize,\n sizeScale = scale('sqrt')().domain(extent(data, fsize)).range(range);\n fontSize = x => sizeScale(fsize(x));\n }\n data.forEach(t => {\n t[as[0]] = NaN;\n t[as[1]] = NaN;\n t[as[3]] = 0;\n });\n\n // configure layout\n const words = layout.words(data).text(_.text).size(_.size || [500, 500]).padding(_.padding || 1).spiral(_.spiral || 'archimedean').rotate(_.rotate || 0).font(_.font || 'sans-serif').fontStyle(_.fontStyle || 'normal').fontWeight(_.fontWeight || 'normal').fontSize(fontSize).random(random).layout();\n const size = layout.size(),\n dx = size[0] >> 1,\n dy = size[1] >> 1,\n n = words.length;\n for (let i = 0, w, t; i < n; ++i) {\n w = words[i];\n t = w.datum;\n t[as[0]] = w.x + dx;\n t[as[1]] = w.y + dy;\n t[as[2]] = w.font;\n t[as[3]] = w.size;\n t[as[4]] = w.style;\n t[as[5]] = w.weight;\n t[as[6]] = w.rotate;\n }\n return pulse.reflow(mod).modifies(as);\n }\n});\n\nexport { Wordcloud as wordcloud };\n","import { bisectLeft, bisectRight, permute } from 'd3-array';\nimport { Transform } from 'vega-dataflow';\nimport { inherits } from 'vega-util';\n\nconst array8 = n => new Uint8Array(n);\nconst array16 = n => new Uint16Array(n);\nconst array32 = n => new Uint32Array(n);\n\n/**\n * Maintains CrossFilter state.\n */\nfunction Bitmaps() {\n let width = 8,\n data = [],\n seen = array32(0),\n curr = array(0, width),\n prev = array(0, width);\n return {\n data: () => data,\n seen: () => seen = lengthen(seen, data.length),\n add(array) {\n for (let i = 0, j = data.length, n = array.length, t; i < n; ++i) {\n t = array[i];\n t._index = j++;\n data.push(t);\n }\n },\n remove(num, map) {\n // map: index -> boolean (true => remove)\n const n = data.length,\n copy = Array(n - num),\n reindex = data; // reuse old data array for index map\n let t, i, j;\n\n // seek forward to first removal\n for (i = 0; !map[i] && i < n; ++i) {\n copy[i] = data[i];\n reindex[i] = i;\n }\n\n // condense arrays\n for (j = i; i < n; ++i) {\n t = data[i];\n if (!map[i]) {\n reindex[i] = j;\n curr[j] = curr[i];\n prev[j] = prev[i];\n copy[j] = t;\n t._index = j++;\n } else {\n reindex[i] = -1;\n }\n curr[i] = 0; // clear unused bits\n }\n data = copy;\n return reindex;\n },\n size: () => data.length,\n curr: () => curr,\n prev: () => prev,\n reset: k => prev[k] = curr[k],\n all: () => width < 0x101 ? 0xff : width < 0x10001 ? 0xffff : 0xffffffff,\n set(k, one) {\n curr[k] |= one;\n },\n clear(k, one) {\n curr[k] &= ~one;\n },\n resize(n, m) {\n const k = curr.length;\n if (n > k || m > width) {\n width = Math.max(m, width);\n curr = array(n, width, curr);\n prev = array(n, width);\n }\n }\n };\n}\nfunction lengthen(array, length, copy) {\n if (array.length >= length) return array;\n copy = copy || new array.constructor(length);\n copy.set(array);\n return copy;\n}\nfunction array(n, m, array) {\n const copy = (m < 0x101 ? array8 : m < 0x10001 ? array16 : array32)(n);\n if (array) copy.set(array);\n return copy;\n}\n\nfunction Dimension (index, i, query) {\n const bit = 1 << i;\n return {\n one: bit,\n zero: ~bit,\n range: query.slice(),\n bisect: index.bisect,\n index: index.index,\n size: index.size,\n onAdd(added, curr) {\n const dim = this,\n range = dim.bisect(dim.range, added.value),\n idx = added.index,\n lo = range[0],\n hi = range[1],\n n1 = idx.length;\n let i;\n for (i = 0; i < lo; ++i) curr[idx[i]] |= bit;\n for (i = hi; i < n1; ++i) curr[idx[i]] |= bit;\n return dim;\n }\n };\n}\n\n/**\n * Maintains a list of values, sorted by key.\n */\nfunction SortedIndex() {\n let index = array32(0),\n value = [],\n size = 0;\n function insert(key, data, base) {\n if (!data.length) return [];\n const n0 = size,\n n1 = data.length,\n addi = array32(n1);\n let addv = Array(n1),\n oldv,\n oldi,\n i;\n for (i = 0; i < n1; ++i) {\n addv[i] = key(data[i]);\n addi[i] = i;\n }\n addv = sort(addv, addi);\n if (n0) {\n oldv = value;\n oldi = index;\n value = Array(n0 + n1);\n index = array32(n0 + n1);\n merge(base, oldv, oldi, n0, addv, addi, n1, value, index);\n } else {\n if (base > 0) for (i = 0; i < n1; ++i) {\n addi[i] += base;\n }\n value = addv;\n index = addi;\n }\n size = n0 + n1;\n return {\n index: addi,\n value: addv\n };\n }\n function remove(num, map) {\n // map: index -> remove\n const n = size;\n let idx, i, j;\n\n // seek forward to first removal\n for (i = 0; !map[index[i]] && i < n; ++i);\n\n // condense index and value arrays\n for (j = i; i < n; ++i) {\n if (!map[idx = index[i]]) {\n index[j] = idx;\n value[j] = value[i];\n ++j;\n }\n }\n size = n - num;\n }\n function reindex(map) {\n for (let i = 0, n = size; i < n; ++i) {\n index[i] = map[index[i]];\n }\n }\n function bisect(range, array) {\n let n;\n if (array) {\n n = array.length;\n } else {\n array = value;\n n = size;\n }\n return [bisectLeft(array, range[0], 0, n), bisectRight(array, range[1], 0, n)];\n }\n return {\n insert: insert,\n remove: remove,\n bisect: bisect,\n reindex: reindex,\n index: () => index,\n size: () => size\n };\n}\nfunction sort(values, index) {\n values.sort.call(index, (a, b) => {\n const x = values[a],\n y = values[b];\n return x < y ? -1 : x > y ? 1 : 0;\n });\n return permute(values, index);\n}\nfunction merge(base, value0, index0, n0, value1, index1, n1, value, index) {\n let i0 = 0,\n i1 = 0,\n i;\n for (i = 0; i0 < n0 && i1 < n1; ++i) {\n if (value0[i0] < value1[i1]) {\n value[i] = value0[i0];\n index[i] = index0[i0++];\n } else {\n value[i] = value1[i1];\n index[i] = index1[i1++] + base;\n }\n }\n for (; i0 < n0; ++i0, ++i) {\n value[i] = value0[i0];\n index[i] = index0[i0];\n }\n for (; i1 < n1; ++i1, ++i) {\n value[i] = value1[i1];\n index[i] = index1[i1] + base;\n }\n}\n\n/**\n * An indexed multi-dimensional filter.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {Array} params.fields - An array of dimension accessors to filter.\n * @param {Array} params.query - An array of per-dimension range queries.\n */\nfunction CrossFilter(params) {\n Transform.call(this, Bitmaps(), params);\n this._indices = null;\n this._dims = null;\n}\nCrossFilter.Definition = {\n 'type': 'CrossFilter',\n 'metadata': {},\n 'params': [{\n 'name': 'fields',\n 'type': 'field',\n 'array': true,\n 'required': true\n }, {\n 'name': 'query',\n 'type': 'array',\n 'array': true,\n 'required': true,\n 'content': {\n 'type': 'number',\n 'array': true,\n 'length': 2\n }\n }]\n};\ninherits(CrossFilter, Transform, {\n transform(_, pulse) {\n if (!this._dims) {\n return this.init(_, pulse);\n } else {\n var init = _.modified('fields') || _.fields.some(f => pulse.modified(f.fields));\n return init ? this.reinit(_, pulse) : this.eval(_, pulse);\n }\n },\n init(_, pulse) {\n const fields = _.fields,\n query = _.query,\n indices = this._indices = {},\n dims = this._dims = [],\n m = query.length;\n let i = 0,\n key,\n index;\n\n // instantiate indices and dimensions\n for (; i < m; ++i) {\n key = fields[i].fname;\n index = indices[key] || (indices[key] = SortedIndex());\n dims.push(Dimension(index, i, query[i]));\n }\n return this.eval(_, pulse);\n },\n reinit(_, pulse) {\n const output = pulse.materialize().fork(),\n fields = _.fields,\n query = _.query,\n indices = this._indices,\n dims = this._dims,\n bits = this.value,\n curr = bits.curr(),\n prev = bits.prev(),\n all = bits.all(),\n out = output.rem = output.add,\n mod = output.mod,\n m = query.length,\n adds = {};\n let add, index, key, mods, remMap, modMap, i, n, f;\n\n // set prev to current state\n prev.set(curr);\n\n // if pulse has remove tuples, process them first\n if (pulse.rem.length) {\n remMap = this.remove(_, pulse, output);\n }\n\n // if pulse has added tuples, add them to state\n if (pulse.add.length) {\n bits.add(pulse.add);\n }\n\n // if pulse has modified tuples, create an index map\n if (pulse.mod.length) {\n modMap = {};\n for (mods = pulse.mod, i = 0, n = mods.length; i < n; ++i) {\n modMap[mods[i]._index] = 1;\n }\n }\n\n // re-initialize indices as needed, update curr bitmap\n for (i = 0; i < m; ++i) {\n f = fields[i];\n if (!dims[i] || _.modified('fields', i) || pulse.modified(f.fields)) {\n key = f.fname;\n if (!(add = adds[key])) {\n indices[key] = index = SortedIndex();\n adds[key] = add = index.insert(f, pulse.source, 0);\n }\n dims[i] = Dimension(index, i, query[i]).onAdd(add, curr);\n }\n }\n\n // visit each tuple\n // if filter state changed, push index to add/rem\n // else if in mod and passes a filter, push index to mod\n for (i = 0, n = bits.data().length; i < n; ++i) {\n if (remMap[i]) {\n // skip if removed tuple\n continue;\n } else if (prev[i] !== curr[i]) {\n // add if state changed\n out.push(i);\n } else if (modMap[i] && curr[i] !== all) {\n // otherwise, pass mods through\n mod.push(i);\n }\n }\n bits.mask = (1 << m) - 1;\n return output;\n },\n eval(_, pulse) {\n const output = pulse.materialize().fork(),\n m = this._dims.length;\n let mask = 0;\n if (pulse.rem.length) {\n this.remove(_, pulse, output);\n mask |= (1 << m) - 1;\n }\n if (_.modified('query') && !_.modified('fields')) {\n mask |= this.update(_, pulse, output);\n }\n if (pulse.add.length) {\n this.insert(_, pulse, output);\n mask |= (1 << m) - 1;\n }\n if (pulse.mod.length) {\n this.modify(pulse, output);\n mask |= (1 << m) - 1;\n }\n this.value.mask = mask;\n return output;\n },\n insert(_, pulse, output) {\n const tuples = pulse.add,\n bits = this.value,\n dims = this._dims,\n indices = this._indices,\n fields = _.fields,\n adds = {},\n out = output.add,\n n = bits.size() + tuples.length,\n m = dims.length;\n let k = bits.size(),\n j,\n key,\n add;\n\n // resize bitmaps and add tuples as needed\n bits.resize(n, m);\n bits.add(tuples);\n const curr = bits.curr(),\n prev = bits.prev(),\n all = bits.all();\n\n // add to dimensional indices\n for (j = 0; j < m; ++j) {\n key = fields[j].fname;\n add = adds[key] || (adds[key] = indices[key].insert(fields[j], tuples, k));\n dims[j].onAdd(add, curr);\n }\n\n // set previous filters, output if passes at least one filter\n for (; k < n; ++k) {\n prev[k] = all;\n if (curr[k] !== all) out.push(k);\n }\n },\n modify(pulse, output) {\n const out = output.mod,\n bits = this.value,\n curr = bits.curr(),\n all = bits.all(),\n tuples = pulse.mod;\n let i, n, k;\n for (i = 0, n = tuples.length; i < n; ++i) {\n k = tuples[i]._index;\n if (curr[k] !== all) out.push(k);\n }\n },\n remove(_, pulse, output) {\n const indices = this._indices,\n bits = this.value,\n curr = bits.curr(),\n prev = bits.prev(),\n all = bits.all(),\n map = {},\n out = output.rem,\n tuples = pulse.rem;\n let i, n, k, f;\n\n // process tuples, output if passes at least one filter\n for (i = 0, n = tuples.length; i < n; ++i) {\n k = tuples[i]._index;\n map[k] = 1; // build index map\n prev[k] = f = curr[k];\n curr[k] = all;\n if (f !== all) out.push(k);\n }\n\n // remove from dimensional indices\n for (k in indices) {\n indices[k].remove(n, map);\n }\n this.reindex(pulse, n, map);\n return map;\n },\n // reindex filters and indices after propagation completes\n reindex(pulse, num, map) {\n const indices = this._indices,\n bits = this.value;\n pulse.runAfter(() => {\n const indexMap = bits.remove(num, map);\n for (const key in indices) indices[key].reindex(indexMap);\n });\n },\n update(_, pulse, output) {\n const dims = this._dims,\n query = _.query,\n stamp = pulse.stamp,\n m = dims.length;\n let mask = 0,\n i,\n q;\n\n // survey how many queries have changed\n output.filters = 0;\n for (q = 0; q < m; ++q) {\n if (_.modified('query', q)) {\n i = q;\n ++mask;\n }\n }\n if (mask === 1) {\n // only one query changed, use more efficient update\n mask = dims[i].one;\n this.incrementOne(dims[i], query[i], output.add, output.rem);\n } else {\n // multiple queries changed, perform full record keeping\n for (q = 0, mask = 0; q < m; ++q) {\n if (!_.modified('query', q)) continue;\n mask |= dims[q].one;\n this.incrementAll(dims[q], query[q], stamp, output.add);\n output.rem = output.add; // duplicate add/rem for downstream resolve\n }\n }\n return mask;\n },\n incrementAll(dim, query, stamp, out) {\n const bits = this.value,\n seen = bits.seen(),\n curr = bits.curr(),\n prev = bits.prev(),\n index = dim.index(),\n old = dim.bisect(dim.range),\n range = dim.bisect(query),\n lo1 = range[0],\n hi1 = range[1],\n lo0 = old[0],\n hi0 = old[1],\n one = dim.one;\n let i, j, k;\n\n // Fast incremental update based on previous lo index.\n if (lo1 < lo0) {\n for (i = lo1, j = Math.min(lo0, hi1); i < j; ++i) {\n k = index[i];\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n curr[k] ^= one;\n }\n } else if (lo1 > lo0) {\n for (i = lo0, j = Math.min(lo1, hi0); i < j; ++i) {\n k = index[i];\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n curr[k] ^= one;\n }\n }\n\n // Fast incremental update based on previous hi index.\n if (hi1 > hi0) {\n for (i = Math.max(lo1, hi0), j = hi1; i < j; ++i) {\n k = index[i];\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n curr[k] ^= one;\n }\n } else if (hi1 < hi0) {\n for (i = Math.max(lo0, hi1), j = hi0; i < j; ++i) {\n k = index[i];\n if (seen[k] !== stamp) {\n prev[k] = curr[k];\n seen[k] = stamp;\n out.push(k);\n }\n curr[k] ^= one;\n }\n }\n dim.range = query.slice();\n },\n incrementOne(dim, query, add, rem) {\n const bits = this.value,\n curr = bits.curr(),\n index = dim.index(),\n old = dim.bisect(dim.range),\n range = dim.bisect(query),\n lo1 = range[0],\n hi1 = range[1],\n lo0 = old[0],\n hi0 = old[1],\n one = dim.one;\n let i, j, k;\n\n // Fast incremental update based on previous lo index.\n if (lo1 < lo0) {\n for (i = lo1, j = Math.min(lo0, hi1); i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n add.push(k);\n }\n } else if (lo1 > lo0) {\n for (i = lo0, j = Math.min(lo1, hi0); i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n rem.push(k);\n }\n }\n\n // Fast incremental update based on previous hi index.\n if (hi1 > hi0) {\n for (i = Math.max(lo1, hi0), j = hi1; i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n add.push(k);\n }\n } else if (hi1 < hi0) {\n for (i = Math.max(lo0, hi1), j = hi0; i < j; ++i) {\n k = index[i];\n curr[k] ^= one;\n rem.push(k);\n }\n }\n dim.range = query.slice();\n }\n});\n\n/**\n * Selectively filters tuples by resolving against a filter bitmap.\n * Useful for processing the output of a cross-filter transform.\n * @constructor\n * @param {object} params - The parameters for this operator.\n * @param {object} params.ignore - A bit mask indicating which filters to ignore.\n * @param {object} params.filter - The per-tuple filter bitmaps. Typically this\n * parameter value is a reference to a {@link CrossFilter} transform.\n */\nfunction ResolveFilter(params) {\n Transform.call(this, null, params);\n}\nResolveFilter.Definition = {\n 'type': 'ResolveFilter',\n 'metadata': {},\n 'params': [{\n 'name': 'ignore',\n 'type': 'number',\n 'required': true,\n 'description': 'A bit mask indicating which filters to ignore.'\n }, {\n 'name': 'filter',\n 'type': 'object',\n 'required': true,\n 'description': 'Per-tuple filter bitmaps from a CrossFilter transform.'\n }]\n};\ninherits(ResolveFilter, Transform, {\n transform(_, pulse) {\n const ignore = ~(_.ignore || 0),\n // bit mask where zeros -> dims to ignore\n bitmap = _.filter,\n mask = bitmap.mask;\n\n // exit early if no relevant filter changes\n if ((mask & ignore) === 0) return pulse.StopPropagation;\n const output = pulse.fork(pulse.ALL),\n data = bitmap.data(),\n curr = bitmap.curr(),\n prev = bitmap.prev(),\n pass = k => !(curr[k] & ignore) ? data[k] : null;\n\n // propagate all mod tuples that pass the filter\n output.filter(output.MOD, pass);\n\n // determine add & rem tuples via filter functions\n // for efficiency, we do *not* populate new arrays,\n // instead we add filter functions applied downstream\n\n if (!(mask & mask - 1)) {\n // only one filter changed\n output.filter(output.ADD, pass);\n output.filter(output.REM, k => (curr[k] & ignore) === mask ? data[k] : null);\n } else {\n // multiple filters changed\n output.filter(output.ADD, k => {\n const c = curr[k] & ignore,\n f = !c && c ^ prev[k] & ignore;\n return f ? data[k] : null;\n });\n output.filter(output.REM, k => {\n const c = curr[k] & ignore,\n f = c && !(c ^ (c ^ prev[k] & ignore));\n return f ? data[k] : null;\n });\n }\n\n // add filter to source data in case of reflow...\n return output.filter(output.SOURCE, t => pass(t._index));\n }\n});\n\nexport { CrossFilter as crossfilter, ResolveFilter as resolvefilter };\n","export default function permute(source, keys) {\n return Array.from(keys, key => source[key]);\n}\n","import { error, toSet, isFunction, isString, hasOwnProperty } from 'vega-util';\n\nconst RawCode = 'RawCode';\nconst Literal = 'Literal';\nconst Property = 'Property';\nconst Identifier = 'Identifier';\nconst ArrayExpression = 'ArrayExpression';\nconst BinaryExpression = 'BinaryExpression';\nconst CallExpression = 'CallExpression';\nconst ConditionalExpression = 'ConditionalExpression';\nconst LogicalExpression = 'LogicalExpression';\nconst MemberExpression = 'MemberExpression';\nconst ObjectExpression = 'ObjectExpression';\nconst UnaryExpression = 'UnaryExpression';\nfunction ASTNode(type) {\n this.type = type;\n}\nASTNode.prototype.visit = function (visitor) {\n let c, i, n;\n if (visitor(this)) return 1;\n for (c = children(this), i = 0, n = c.length; i < n; ++i) {\n if (c[i].visit(visitor)) return 1;\n }\n};\nfunction children(node) {\n switch (node.type) {\n case ArrayExpression:\n return node.elements;\n case BinaryExpression:\n case LogicalExpression:\n return [node.left, node.right];\n case CallExpression:\n return [node.callee].concat(node.arguments);\n case ConditionalExpression:\n return [node.test, node.consequent, node.alternate];\n case MemberExpression:\n return [node.object, node.property];\n case ObjectExpression:\n return node.properties;\n case Property:\n return [node.key, node.value];\n case UnaryExpression:\n return [node.argument];\n case Identifier:\n case Literal:\n case RawCode:\n default:\n return [];\n }\n}\n\n/*\n The following expression parser is based on Esprima (http://esprima.org/).\n Original header comment and license for Esprima is included here:\n\n Copyright (C) 2013 Ariya Hidayat \n Copyright (C) 2013 Thaddee Tyl \n Copyright (C) 2013 Mathias Bynens \n Copyright (C) 2012 Ariya Hidayat \n Copyright (C) 2012 Mathias Bynens \n Copyright (C) 2012 Joost-Wim Boekesteijn \n Copyright (C) 2012 Kris Kowal \n Copyright (C) 2012 Yusuke Suzuki \n Copyright (C) 2012 Arpad Borsos \n Copyright (C) 2011 Ariya Hidayat \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\nvar TokenName, source, index, length, lookahead;\nvar TokenBooleanLiteral = 1,\n TokenEOF = 2,\n TokenIdentifier = 3,\n TokenKeyword = 4,\n TokenNullLiteral = 5,\n TokenNumericLiteral = 6,\n TokenPunctuator = 7,\n TokenStringLiteral = 8,\n TokenRegularExpression = 9;\nTokenName = {};\nTokenName[TokenBooleanLiteral] = 'Boolean';\nTokenName[TokenEOF] = '';\nTokenName[TokenIdentifier] = 'Identifier';\nTokenName[TokenKeyword] = 'Keyword';\nTokenName[TokenNullLiteral] = 'Null';\nTokenName[TokenNumericLiteral] = 'Numeric';\nTokenName[TokenPunctuator] = 'Punctuator';\nTokenName[TokenStringLiteral] = 'String';\nTokenName[TokenRegularExpression] = 'RegularExpression';\nvar SyntaxArrayExpression = 'ArrayExpression',\n SyntaxBinaryExpression = 'BinaryExpression',\n SyntaxCallExpression = 'CallExpression',\n SyntaxConditionalExpression = 'ConditionalExpression',\n SyntaxIdentifier = 'Identifier',\n SyntaxLiteral = 'Literal',\n SyntaxLogicalExpression = 'LogicalExpression',\n SyntaxMemberExpression = 'MemberExpression',\n SyntaxObjectExpression = 'ObjectExpression',\n SyntaxProperty = 'Property',\n SyntaxUnaryExpression = 'UnaryExpression';\n\n// Error messages should be identical to V8.\nvar MessageUnexpectedToken = 'Unexpected token %0',\n MessageUnexpectedNumber = 'Unexpected number',\n MessageUnexpectedString = 'Unexpected string',\n MessageUnexpectedIdentifier = 'Unexpected identifier',\n MessageUnexpectedReserved = 'Unexpected reserved word',\n MessageUnexpectedEOS = 'Unexpected end of input',\n MessageInvalidRegExp = 'Invalid regular expression',\n MessageUnterminatedRegExp = 'Invalid regular expression: missing /',\n MessageStrictOctalLiteral = 'Octal literals are not allowed in strict mode.',\n MessageStrictDuplicateProperty = 'Duplicate data property in object literal not allowed in strict mode';\nvar ILLEGAL = 'ILLEGAL',\n DISABLED = 'Disabled.';\n\n// See also tools/generate-unicode-regex.py.\nvar RegexNonAsciiIdentifierStart = new RegExp('[\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0370-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0620-\\\\u064A\\\\u066E\\\\u066F\\\\u0671-\\\\u06D3\\\\u06D5\\\\u06E5\\\\u06E6\\\\u06EE\\\\u06EF\\\\u06FA-\\\\u06FC\\\\u06FF\\\\u0710\\\\u0712-\\\\u072F\\\\u074D-\\\\u07A5\\\\u07B1\\\\u07CA-\\\\u07EA\\\\u07F4\\\\u07F5\\\\u07FA\\\\u0800-\\\\u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D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1711\\\\u1720-\\\\u1731\\\\u1740-\\\\u1751\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1780-\\\\u17B3\\\\u17D7\\\\u17DC\\\\u1820-\\\\u1877\\\\u1880-\\\\u18A8\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1950-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19C1-\\\\u19C7\\\\u1A00-\\\\u1A16\\\\u1A20-\\\\u1A54\\\\u1AA7\\\\u1B05-\\\\u1B33\\\\u1B45-\\\\u1B4B\\\\u1B83-\\\\u1BA0\\\\u1BAE\\\\u1BAF\\\\u1BBA-\\\\u1BE5\\\\u1C00-\\\\u1C23\\\\u1C4D-\\\\u1C4F\\\\u1C5A-\\\\u1C7D\\\\u1CE9-\\\\u1CEC\\\\u1CEE-\\\\u1CF1\\\\u1CF5\\\\u1CF6\\\\u1D00-\\\\u1DBF\\\\u1E00-\\\\u1F15\\\\u1F18-\\\\u1F1D\\\\u1F20-\\\\u1F45\\\\u1F48-\\\\u1F4D\\\\u1F50-\\\\u1F57\\\\u1F59\\\\u1F5B\\\\u1F5D\\\\u1F5F-\\\\u1F7D\\\\u1F80-\\\\u1FB4\\\\u1FB6-\\\\u1FBC\\\\u1FBE\\\\u1FC2-\\\\u1FC4\\\\u1FC6-\\\\u1FCC\\\\u1FD0-\\\\u1FD3\\\\u1FD6-\\\\u1FDB\\\\u1FE0-\\\\u1FEC\\\\u1FF2-\\\\u1FF4\\\\u1FF6-\\\\u1FFC\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u2102\\\\u2107\\\\u210A-\\\\u2113\\\\u2115\\\\u2119-\\\\u211D\\\\u2124\\\\u2126\\\\u2128\\\\u212A-\\\\u212D\\\\u212F-\\\\u2139\\\\u213C-\\\\u213F\\\\u2145-\\\\u2149\\\\u214E\\\\u2160-\\\\u2188\\\\u2C00-\\\\u2C2E\\\\u2C30-\\\\u2C5E\\\\u2C60-\\\\u2CE4\\\\u2CEB-\\\\u2CEE\\\\u2CF2\\\\u2CF3\\\\u2D00-\\\\u2D25\\\\u2D27\\\\u2D2D\\\\u2D30-\\\\u2D67\\\\u2D6F\\\\u2D80-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2E2F\\\\u3005-\\\\u3007\\\\u3021-\\\\u3029\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FCC\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA61F\\\\uA62A\\\\uA62B\\\\uA640-\\\\uA66E\\\\uA67F-\\\\uA69D\\\\uA6A0-\\\\uA6EF\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B-\\\\uA78E\\\\uA790-\\\\uA7AD\\\\uA7B0\\\\uA7B1\\\\uA7F7-\\\\uA801\\\\uA803-\\\\uA805\\\\uA807-\\\\uA80A\\\\uA80C-\\\\uA822\\\\uA840-\\\\uA873\\\\uA882-\\\\uA8B3\\\\uA8F2-\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leading-character-class\n RegexNonAsciiIdentifierPart = new RegExp('[\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0300-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u0483-\\\\u0487\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u0591-\\\\u05BD\\\\u05BF\\\\u05C1\\\\u05C2\\\\u05C4\\\\u05C5\\\\u05C7\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0610-\\\\u061A\\\\u0620-\\\\u0669\\\\u066E-\\\\u06D3\\\\u06D5-\\\\u06DC\\\\u06DF-\\\\u06E8\\\\u06EA-\\\\u06FC\\\\u06FF\\\\u0710-\\\\u074A\\\\u074D-\\\\u07B1\\\\u07C0-\\\\u07F5\\\\u07FA\\\\u0800-\\\\u082D\\\\u0840-\\\\u085B\\\\u08A0-\\\\u08B2\\\\u08E4-\\\\u0963\\\\u0966-\\\\u096F\\\\u0971-\\\\u0983\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BC-\\\\u09C4\\\\u09C7\\\\u09C8\\\\u09CB-\\\\u09CE\\\\u09D7\\\\u09DC\\\\u09DD\\\\u09DF-\\\\u09E3\\\\u09E6-\\\\u09F1\\\\u0A01-\\\\u0A03\\\\u0A05-\\\\u0A0A\\\\u0A0F\\\\u0A10\\\\u0A13-\\\\u0A28\\\\u0A2A-\\\\u0A30\\\\u0A32\\\\u0A33\\\\u0A35\\\\u0A36\\\\u0A38\\\\u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\\\u0F20-\\\\u0F29\\\\u0F35\\\\u0F37\\\\u0F39\\\\u0F3E-\\\\u0F47\\\\u0F49-\\\\u0F6C\\\\u0F71-\\\\u0F84\\\\u0F86-\\\\u0F97\\\\u0F99-\\\\u0FBC\\\\u0FC6\\\\u1000-\\\\u1049\\\\u1050-\\\\u109D\\\\u10A0-\\\\u10C5\\\\u10C7\\\\u10CD\\\\u10D0-\\\\u10FA\\\\u10FC-\\\\u1248\\\\u124A-\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u135D-\\\\u135F\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u170C\\\\u170E-\\\\u1714\\\\u1720-\\\\u1734\\\\u1740-\\\\u1753\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1772\\\\u1773\\\\u1780-\\\\u17D3\\\\u17D7\\\\u17DC\\\\u17DD\\\\u17E0-\\\\u17E9\\\\u180B-\\\\u180D\\\\u1810-\\\\u1819\\\\u1820-\\\\u1877\\\\u1880-\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1920-\\\\u192B\\\\u1930-\\\\u193B\\\\u1946-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19B0-\\\\u19C9\\\\u19D0-\\\\u19D9\\\\u1A00-\\\\u1A1B\\\\u1A20-\\\\u1A5E\\\\u1A60-\\\\u1A7C\\\\u1A7F-\\\\u1A89\\\\u1A90-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\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2DE0-\\\\u2DFF\\\\u2E2F\\\\u3005-\\\\u3007\\\\u3021-\\\\u302F\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u3099\\\\u309A\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FCC\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA62B\\\\uA640-\\\\uA66F\\\\uA674-\\\\uA67D\\\\uA67F-\\\\uA69D\\\\uA69F-\\\\uA6F1\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B-\\\\uA78E\\\\uA790-\\\\uA7AD\\\\uA7B0\\\\uA7B1\\\\uA7F7-\\\\uA827\\\\uA840-\\\\uA873\\\\uA880-\\\\uA8C4\\\\uA8D0-\\\\uA8D9\\\\uA8E0-\\\\uA8F7\\\\uA8FB\\\\uA900-\\\\uA92D\\\\uA930-\\\\uA953\\\\uA960-\\\\uA97C\\\\uA980-\\\\uA9C0\\\\uA9CF-\\\\uA9D9\\\\uA9E0-\\\\uA9FE\\\\uAA00-\\\\uAA36\\\\uAA40-\\\\uAA4D\\\\uAA50-\\\\uAA59\\\\uAA60-\\\\uAA76\\\\uAA7A-\\\\uAAC2\\\\uAADB-\\\\uAADD\\\\uAAE0-\\\\uAAEF\\\\uAAF2-\\\\uAAF6\\\\uAB01-\\\\uAB06\\\\uAB09-\\\\uAB0E\\\\uAB11-\\\\uAB16\\\\uAB20-\\\\uAB26\\\\uAB28-\\\\uAB2E\\\\uAB30-\\\\uAB5A\\\\uAB5C-\\\\uAB5F\\\\uAB64\\\\uAB65\\\\uABC0-\\\\uABEA\\\\uABEC\\\\uABED\\\\uABF0-\\\\uABF9\\\\uAC00-\\\\uD7A3\\\\uD7B0-\\\\uD7C6\\\\uD7CB-\\\\uD7FB\\\\uF900-\\\\uFA6D\\\\uFA70-\\\\uFAD9\\\\uFB00-\\\\uFB06\\\\uFB13-\\\\uFB17\\\\uFB1D-\\\\uFB28\\\\uFB2A-\\\\uFB36\\\\uFB38-\\\\uFB3C\\\\uFB3E\\\\uFB40\\\\uFB41\\\\uFB43\\\\uFB44\\\\uFB46-\\\\uFBB1\\\\uFBD3-\\\\uFD3D\\\\uFD50-\\\\uFD8F\\\\uFD92-\\\\uFDC7\\\\uFDF0-\\\\uFDFB\\\\uFE00-\\\\uFE0F\\\\uFE20-\\\\uFE2D\\\\uFE33\\\\uFE34\\\\uFE4D-\\\\uFE4F\\\\uFE70-\\\\uFE74\\\\uFE76-\\\\uFEFC\\\\uFF10-\\\\uFF19\\\\uFF21-\\\\uFF3A\\\\uFF3F\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]');\n\n// Ensure the condition is true, otherwise throw an error.\n// This is only to have a better contract semantic, i.e. another safety net\n// to catch a logic error. The condition shall be fulfilled in normal case.\n// Do NOT use this to enforce a certain condition on any user input.\n\nfunction assert(condition, message) {\n /* istanbul ignore next */\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n}\nfunction isDecimalDigit(ch) {\n return ch >= 0x30 && ch <= 0x39; // 0..9\n}\nfunction isHexDigit(ch) {\n return '0123456789abcdefABCDEF'.includes(ch);\n}\nfunction isOctalDigit(ch) {\n return '01234567'.includes(ch);\n}\n\n// 7.2 White Space\n\nfunction isWhiteSpace(ch) {\n return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].includes(ch);\n}\n\n// 7.3 Line Terminators\n\nfunction isLineTerminator(ch) {\n return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;\n}\n\n// 7.6 Identifier Names and Identifiers\n\nfunction isIdentifierStart(ch) {\n return ch === 0x24 || ch === 0x5F ||\n // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A ||\n // A..Z\n ch >= 0x61 && ch <= 0x7A ||\n // a..z\n ch === 0x5C ||\n // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierStart.test(String.fromCharCode(ch));\n}\nfunction isIdentifierPart(ch) {\n return ch === 0x24 || ch === 0x5F ||\n // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A ||\n // A..Z\n ch >= 0x61 && ch <= 0x7A ||\n // a..z\n ch >= 0x30 && ch <= 0x39 ||\n // 0..9\n ch === 0x5C ||\n // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierPart.test(String.fromCharCode(ch));\n}\n\n// 7.6.1.1 Keywords\n\nconst keywords = {\n 'if': 1,\n 'in': 1,\n 'do': 1,\n 'var': 1,\n 'for': 1,\n 'new': 1,\n 'try': 1,\n 'let': 1,\n 'this': 1,\n 'else': 1,\n 'case': 1,\n 'void': 1,\n 'with': 1,\n 'enum': 1,\n 'while': 1,\n 'break': 1,\n 'catch': 1,\n 'throw': 1,\n 'const': 1,\n 'yield': 1,\n 'class': 1,\n 'super': 1,\n 'return': 1,\n 'typeof': 1,\n 'delete': 1,\n 'switch': 1,\n 'export': 1,\n 'import': 1,\n 'public': 1,\n 'static': 1,\n 'default': 1,\n 'finally': 1,\n 'extends': 1,\n 'package': 1,\n 'private': 1,\n 'function': 1,\n 'continue': 1,\n 'debugger': 1,\n 'interface': 1,\n 'protected': 1,\n 'instanceof': 1,\n 'implements': 1\n};\nfunction skipComment() {\n while (index < length) {\n const ch = source.charCodeAt(index);\n if (isWhiteSpace(ch) || isLineTerminator(ch)) {\n ++index;\n } else {\n break;\n }\n }\n}\nfunction scanHexEscape(prefix) {\n var i,\n len,\n ch,\n code = 0;\n len = prefix === 'u' ? 4 : 2;\n for (i = 0; i < len; ++i) {\n if (index < length && isHexDigit(source[index])) {\n ch = source[index++];\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n } else {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n return String.fromCharCode(code);\n}\nfunction scanUnicodeCodePointEscape() {\n var ch, code, cu1, cu2;\n ch = source[index];\n code = 0;\n\n // At least, one hex digit is required.\n if (ch === '}') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n while (index < length) {\n ch = source[index++];\n if (!isHexDigit(ch)) {\n break;\n }\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n }\n if (code > 0x10FFFF || ch !== '}') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n // UTF-16 Encoding\n if (code <= 0xFFFF) {\n return String.fromCharCode(code);\n }\n cu1 = (code - 0x10000 >> 10) + 0xD800;\n cu2 = (code - 0x10000 & 1023) + 0xDC00;\n return String.fromCharCode(cu1, cu2);\n}\nfunction getEscapedIdentifier() {\n var ch, id;\n ch = source.charCodeAt(index++);\n id = String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierStart(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n id = ch;\n }\n while (index < length) {\n ch = source.charCodeAt(index);\n if (!isIdentifierPart(ch)) {\n break;\n }\n ++index;\n id += String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n id = id.substr(0, id.length - 1);\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierPart(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n id += ch;\n }\n }\n return id;\n}\nfunction getIdentifier() {\n var start, ch;\n start = index++;\n while (index < length) {\n ch = source.charCodeAt(index);\n if (ch === 0x5C) {\n // Blackslash (U+005C) marks Unicode escape sequence.\n index = start;\n return getEscapedIdentifier();\n }\n if (isIdentifierPart(ch)) {\n ++index;\n } else {\n break;\n }\n }\n return source.slice(start, index);\n}\nfunction scanIdentifier() {\n var start, id, type;\n start = index;\n\n // Backslash (U+005C) starts an escaped character.\n id = source.charCodeAt(index) === 0x5C ? getEscapedIdentifier() : getIdentifier();\n\n // There is no keyword or literal with only one character.\n // Thus, it must be an identifier.\n if (id.length === 1) {\n type = TokenIdentifier;\n } else if (keywords.hasOwnProperty(id)) {\n // eslint-disable-line no-prototype-builtins\n type = TokenKeyword;\n } else if (id === 'null') {\n type = TokenNullLiteral;\n } else if (id === 'true' || id === 'false') {\n type = TokenBooleanLiteral;\n } else {\n type = TokenIdentifier;\n }\n return {\n type: type,\n value: id,\n start: start,\n end: index\n };\n}\n\n// 7.7 Punctuators\n\nfunction scanPunctuator() {\n var start = index,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2,\n ch3,\n ch4;\n switch (code) {\n // Check for most common single-character punctuators.\n case 0x2E: // . dot\n case 0x28: // ( open bracket\n case 0x29: // ) close bracket\n case 0x3B: // ; semicolon\n case 0x2C: // , comma\n case 0x7B: // { open curly brace\n case 0x7D: // } close curly brace\n case 0x5B: // [\n case 0x5D: // ]\n case 0x3A: // :\n case 0x3F: // ?\n case 0x7E:\n // ~\n ++index;\n return {\n type: TokenPunctuator,\n value: String.fromCharCode(code),\n start: start,\n end: index\n };\n default:\n code2 = source.charCodeAt(index + 1);\n\n // '=' (U+003D) marks an assignment or comparison operator.\n if (code2 === 0x3D) {\n switch (code) {\n case 0x2B: // +\n case 0x2D: // -\n case 0x2F: // /\n case 0x3C: // <\n case 0x3E: // >\n case 0x5E: // ^\n case 0x7C: // |\n case 0x25: // %\n case 0x26: // &\n case 0x2A:\n // *\n index += 2;\n return {\n type: TokenPunctuator,\n value: String.fromCharCode(code) + String.fromCharCode(code2),\n start: start,\n end: index\n };\n case 0x21: // !\n case 0x3D:\n // =\n index += 2;\n\n // !== and ===\n if (source.charCodeAt(index) === 0x3D) {\n ++index;\n }\n return {\n type: TokenPunctuator,\n value: source.slice(start, index),\n start: start,\n end: index\n };\n }\n }\n }\n\n // 4-character punctuator: >>>=\n\n ch4 = source.substr(index, 4);\n if (ch4 === '>>>=') {\n index += 4;\n return {\n type: TokenPunctuator,\n value: ch4,\n start: start,\n end: index\n };\n }\n\n // 3-character punctuators: === !== >>> <<= >>=\n\n ch3 = ch4.substr(0, 3);\n if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {\n index += 3;\n return {\n type: TokenPunctuator,\n value: ch3,\n start: start,\n end: index\n };\n }\n\n // Other 2-character punctuators: ++ -- << >> && ||\n ch2 = ch3.substr(0, 2);\n if (ch1 === ch2[1] && '+-<>&|'.includes(ch1) || ch2 === '=>') {\n index += 2;\n return {\n type: TokenPunctuator,\n value: ch2,\n start: start,\n end: index\n };\n }\n if (ch2 === '//') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n\n // 1-character punctuators: < > = ! + - * % & | ^ /\n\n if ('<>=!+-*%&|^/'.includes(ch1)) {\n ++index;\n return {\n type: TokenPunctuator,\n value: ch1,\n start: start,\n end: index\n };\n }\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n}\n\n// 7.8.3 Numeric Literals\n\nfunction scanHexLiteral(start) {\n let number = '';\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n if (number.length === 0) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n return {\n type: TokenNumericLiteral,\n value: parseInt('0x' + number, 16),\n start: start,\n end: index\n };\n}\nfunction scanOctalLiteral(start) {\n let number = '0' + source[index++];\n while (index < length) {\n if (!isOctalDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n return {\n type: TokenNumericLiteral,\n value: parseInt(number, 8),\n octal: true,\n start: start,\n end: index\n };\n}\nfunction scanNumericLiteral() {\n var number, start, ch;\n ch = source[index];\n assert(isDecimalDigit(ch.charCodeAt(0)) || ch === '.', 'Numeric literal must start with a decimal digit or a decimal point');\n start = index;\n number = '';\n if (ch !== '.') {\n number = source[index++];\n ch = source[index];\n\n // Hex number starts with '0x'.\n // Octal number starts with '0'.\n if (number === '0') {\n if (ch === 'x' || ch === 'X') {\n ++index;\n return scanHexLiteral(start);\n }\n if (isOctalDigit(ch)) {\n return scanOctalLiteral(start);\n }\n\n // decimal number starts with '0' such as '09' is illegal.\n if (ch && isDecimalDigit(ch.charCodeAt(0))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n if (ch === '.') {\n number += source[index++];\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n if (ch === 'e' || ch === 'E') {\n number += source[index++];\n ch = source[index];\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n if (isDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n }\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n return {\n type: TokenNumericLiteral,\n value: parseFloat(number),\n start: start,\n end: index\n };\n}\n\n// 7.8.4 String Literals\n\nfunction scanStringLiteral() {\n var str = '',\n quote,\n start,\n ch,\n code,\n octal = false;\n quote = source[index];\n assert(quote === '\\'' || quote === '\"', 'String literal must starts with a quote');\n start = index;\n ++index;\n while (index < length) {\n ch = source[index++];\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'u':\n case 'x':\n if (source[index] === '{') {\n ++index;\n str += scanUnicodeCodePointEscape();\n } else {\n str += scanHexEscape(ch);\n }\n break;\n case 'n':\n str += '\\n';\n break;\n case 'r':\n str += '\\r';\n break;\n case 't':\n str += '\\t';\n break;\n case 'b':\n str += '\\b';\n break;\n case 'f':\n str += '\\f';\n break;\n case 'v':\n str += '\\x0B';\n break;\n default:\n if (isOctalDigit(ch)) {\n code = '01234567'.indexOf(ch);\n\n // \\0 is not octal escape sequence\n if (code !== 0) {\n octal = true;\n }\n if (index < length && isOctalDigit(source[index])) {\n octal = true;\n code = code * 8 + '01234567'.indexOf(source[index++]);\n\n // 3 digits are only allowed when string starts\n // with 0, 1, 2, 3\n if ('0123'.includes(ch) && index < length && isOctalDigit(source[index])) {\n code = code * 8 + '01234567'.indexOf(source[index++]);\n }\n }\n str += String.fromCharCode(code);\n } else {\n str += ch;\n }\n break;\n }\n } else {\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n if (quote !== '') {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n }\n return {\n type: TokenStringLiteral,\n value: str,\n octal: octal,\n start: start,\n end: index\n };\n}\nfunction testRegExp(pattern, flags) {\n let tmp = pattern;\n if (flags.includes('u')) {\n // Replace each astral symbol and every Unicode code point\n // escape sequence with a single ASCII symbol to avoid throwing on\n // regular expressions that are only valid in combination with the\n // `/u` flag.\n // Note: replacing with the ASCII symbol `x` might cause false\n // negatives in unlikely scenarios. For example, `[\\u{61}-b]` is a\n // perfectly valid pattern that is equivalent to `[a-b]`, but it\n // would be replaced by `[x-b]` which throws an error.\n tmp = tmp.replace(/\\\\u\\{([0-9a-fA-F]+)\\}/g, ($0, $1) => {\n if (parseInt($1, 16) <= 0x10FFFF) {\n return 'x';\n }\n throwError({}, MessageInvalidRegExp);\n }).replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g, 'x');\n }\n\n // First, detect invalid regular expressions.\n try {\n new RegExp(tmp);\n } catch (e) {\n throwError({}, MessageInvalidRegExp);\n }\n\n // Return a regular expression object for this pattern-flag pair, or\n // `null` in case the current environment doesn't support the flags it\n // uses.\n try {\n return new RegExp(pattern, flags);\n } catch (exception) {\n return null;\n }\n}\nfunction scanRegExpBody() {\n var ch, str, classMarker, terminated, body;\n ch = source[index];\n assert(ch === '/', 'Regular expression literal must start with a slash');\n str = source[index++];\n classMarker = false;\n terminated = false;\n while (index < length) {\n ch = source[index++];\n str += ch;\n if (ch === '\\\\') {\n ch = source[index++];\n // ECMA-262 7.8.5\n if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, MessageUnterminatedRegExp);\n }\n str += ch;\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, MessageUnterminatedRegExp);\n } else if (classMarker) {\n if (ch === ']') {\n classMarker = false;\n }\n } else {\n if (ch === '/') {\n terminated = true;\n break;\n } else if (ch === '[') {\n classMarker = true;\n }\n }\n }\n if (!terminated) {\n throwError({}, MessageUnterminatedRegExp);\n }\n\n // Exclude leading and trailing slash.\n body = str.substr(1, str.length - 2);\n return {\n value: body,\n literal: str\n };\n}\nfunction scanRegExpFlags() {\n var ch, str, flags;\n str = '';\n flags = '';\n while (index < length) {\n ch = source[index];\n if (!isIdentifierPart(ch.charCodeAt(0))) {\n break;\n }\n ++index;\n if (ch === '\\\\' && index < length) {\n throwError({}, MessageUnexpectedToken, ILLEGAL);\n } else {\n flags += ch;\n str += ch;\n }\n }\n if (flags.search(/[^gimuy]/g) >= 0) {\n throwError({}, MessageInvalidRegExp, flags);\n }\n return {\n value: flags,\n literal: str\n };\n}\nfunction scanRegExp() {\n var start, body, flags, value;\n lookahead = null;\n skipComment();\n start = index;\n body = scanRegExpBody();\n flags = scanRegExpFlags();\n value = testRegExp(body.value, flags.value);\n return {\n literal: body.literal + flags.literal,\n value: value,\n regex: {\n pattern: body.value,\n flags: flags.value\n },\n start: start,\n end: index\n };\n}\nfunction isIdentifierName(token) {\n return token.type === TokenIdentifier || token.type === TokenKeyword || token.type === TokenBooleanLiteral || token.type === TokenNullLiteral;\n}\nfunction advance() {\n skipComment();\n if (index >= length) {\n return {\n type: TokenEOF,\n start: index,\n end: index\n };\n }\n const ch = source.charCodeAt(index);\n if (isIdentifierStart(ch)) {\n return scanIdentifier();\n }\n\n // Very common: ( and ) and ;\n if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {\n return scanPunctuator();\n }\n\n // String literal starts with single quote (U+0027) or double quote (U+0022).\n if (ch === 0x27 || ch === 0x22) {\n return scanStringLiteral();\n }\n\n // Dot (.) U+002E can also start a floating-point number, hence the need\n // to check the next character.\n if (ch === 0x2E) {\n if (isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNumericLiteral();\n }\n return scanPunctuator();\n }\n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n return scanPunctuator();\n}\nfunction lex() {\n const token = lookahead;\n index = token.end;\n lookahead = advance();\n index = token.end;\n return token;\n}\nfunction peek() {\n const pos = index;\n lookahead = advance();\n index = pos;\n}\nfunction finishArrayExpression(elements) {\n const node = new ASTNode(SyntaxArrayExpression);\n node.elements = elements;\n return node;\n}\nfunction finishBinaryExpression(operator, left, right) {\n const node = new ASTNode(operator === '||' || operator === '&&' ? SyntaxLogicalExpression : SyntaxBinaryExpression);\n node.operator = operator;\n node.left = left;\n node.right = right;\n return node;\n}\nfunction finishCallExpression(callee, args) {\n const node = new ASTNode(SyntaxCallExpression);\n node.callee = callee;\n node.arguments = args;\n return node;\n}\nfunction finishConditionalExpression(test, consequent, alternate) {\n const node = new ASTNode(SyntaxConditionalExpression);\n node.test = test;\n node.consequent = consequent;\n node.alternate = alternate;\n return node;\n}\nfunction finishIdentifier(name) {\n const node = new ASTNode(SyntaxIdentifier);\n node.name = name;\n return node;\n}\nfunction finishLiteral(token) {\n const node = new ASTNode(SyntaxLiteral);\n node.value = token.value;\n node.raw = source.slice(token.start, token.end);\n if (token.regex) {\n if (node.raw === '//') {\n node.raw = '/(?:)/';\n }\n node.regex = token.regex;\n }\n return node;\n}\nfunction finishMemberExpression(accessor, object, property) {\n const node = new ASTNode(SyntaxMemberExpression);\n node.computed = accessor === '[';\n node.object = object;\n node.property = property;\n if (!node.computed) property.member = true;\n return node;\n}\nfunction finishObjectExpression(properties) {\n const node = new ASTNode(SyntaxObjectExpression);\n node.properties = properties;\n return node;\n}\nfunction finishProperty(kind, key, value) {\n const node = new ASTNode(SyntaxProperty);\n node.key = key;\n node.value = value;\n node.kind = kind;\n return node;\n}\nfunction finishUnaryExpression(operator, argument) {\n const node = new ASTNode(SyntaxUnaryExpression);\n node.operator = operator;\n node.argument = argument;\n node.prefix = true;\n return node;\n}\n\n// Throw an exception\n\nfunction throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(/%(\\d)/g, (whole, index) => {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n });\n error = new Error(msg);\n error.index = index;\n error.description = msg;\n throw error;\n}\n\n// Throw an exception because of the token.\n\nfunction throwUnexpected(token) {\n if (token.type === TokenEOF) {\n throwError(token, MessageUnexpectedEOS);\n }\n if (token.type === TokenNumericLiteral) {\n throwError(token, MessageUnexpectedNumber);\n }\n if (token.type === TokenStringLiteral) {\n throwError(token, MessageUnexpectedString);\n }\n if (token.type === TokenIdentifier) {\n throwError(token, MessageUnexpectedIdentifier);\n }\n if (token.type === TokenKeyword) {\n throwError(token, MessageUnexpectedReserved);\n }\n\n // BooleanLiteral, NullLiteral, or Punctuator.\n throwError(token, MessageUnexpectedToken, token.value);\n}\n\n// Expect the next token to match the specified punctuator.\n// If not, an exception will be thrown.\n\nfunction expect(value) {\n const token = lex();\n if (token.type !== TokenPunctuator || token.value !== value) {\n throwUnexpected(token);\n }\n}\n\n// Return true if the next token matches the specified punctuator.\n\nfunction match(value) {\n return lookahead.type === TokenPunctuator && lookahead.value === value;\n}\n\n// Return true if the next token matches the specified keyword\n\nfunction matchKeyword(keyword) {\n return lookahead.type === TokenKeyword && lookahead.value === keyword;\n}\n\n// 11.1.4 Array Initialiser\n\nfunction parseArrayInitialiser() {\n const elements = [];\n index = lookahead.start;\n expect('[');\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elements.push(parseConditionalExpression());\n if (!match(']')) {\n expect(',');\n }\n }\n }\n lex();\n return finishArrayExpression(elements);\n}\n\n// 11.1.5 Object Initialiser\n\nfunction parseObjectPropertyKey() {\n index = lookahead.start;\n const token = lex();\n\n // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n\n if (token.type === TokenStringLiteral || token.type === TokenNumericLiteral) {\n if (token.octal) {\n throwError(token, MessageStrictOctalLiteral);\n }\n return finishLiteral(token);\n }\n return finishIdentifier(token.value);\n}\nfunction parseObjectProperty() {\n var token, key, id, value;\n index = lookahead.start;\n token = lookahead;\n if (token.type === TokenIdentifier) {\n id = parseObjectPropertyKey();\n expect(':');\n value = parseConditionalExpression();\n return finishProperty('init', id, value);\n }\n if (token.type === TokenEOF || token.type === TokenPunctuator) {\n throwUnexpected(token);\n } else {\n key = parseObjectPropertyKey();\n expect(':');\n value = parseConditionalExpression();\n return finishProperty('init', key, value);\n }\n}\nfunction parseObjectInitialiser() {\n var properties = [],\n property,\n name,\n key,\n map = {},\n toString = String;\n index = lookahead.start;\n expect('{');\n while (!match('}')) {\n property = parseObjectProperty();\n if (property.key.type === SyntaxIdentifier) {\n name = property.key.name;\n } else {\n name = toString(property.key.value);\n }\n key = '$' + name;\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n throwError({}, MessageStrictDuplicateProperty);\n } else {\n map[key] = true;\n }\n properties.push(property);\n if (!match('}')) {\n expect(',');\n }\n }\n expect('}');\n return finishObjectExpression(properties);\n}\n\n// 11.1.6 The Grouping Operator\n\nfunction parseGroupExpression() {\n expect('(');\n const expr = parseExpression();\n expect(')');\n return expr;\n}\n\n// 11.1 Primary Expressions\n\nconst legalKeywords = {\n 'if': 1\n};\nfunction parsePrimaryExpression() {\n var type, token, expr;\n if (match('(')) {\n return parseGroupExpression();\n }\n if (match('[')) {\n return parseArrayInitialiser();\n }\n if (match('{')) {\n return parseObjectInitialiser();\n }\n type = lookahead.type;\n index = lookahead.start;\n if (type === TokenIdentifier || legalKeywords[lookahead.value]) {\n expr = finishIdentifier(lex().value);\n } else if (type === TokenStringLiteral || type === TokenNumericLiteral) {\n if (lookahead.octal) {\n throwError(lookahead, MessageStrictOctalLiteral);\n }\n expr = finishLiteral(lex());\n } else if (type === TokenKeyword) {\n throw new Error(DISABLED);\n } else if (type === TokenBooleanLiteral) {\n token = lex();\n token.value = token.value === 'true';\n expr = finishLiteral(token);\n } else if (type === TokenNullLiteral) {\n token = lex();\n token.value = null;\n expr = finishLiteral(token);\n } else if (match('/') || match('/=')) {\n expr = finishLiteral(scanRegExp());\n peek();\n } else {\n throwUnexpected(lex());\n }\n return expr;\n}\n\n// 11.2 Left-Hand-Side Expressions\n\nfunction parseArguments() {\n const args = [];\n expect('(');\n if (!match(')')) {\n while (index < length) {\n args.push(parseConditionalExpression());\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n expect(')');\n return args;\n}\nfunction parseNonComputedProperty() {\n index = lookahead.start;\n const token = lex();\n if (!isIdentifierName(token)) {\n throwUnexpected(token);\n }\n return finishIdentifier(token.value);\n}\nfunction parseNonComputedMember() {\n expect('.');\n return parseNonComputedProperty();\n}\nfunction parseComputedMember() {\n expect('[');\n const expr = parseExpression();\n expect(']');\n return expr;\n}\nfunction parseLeftHandSideExpressionAllowCall() {\n var expr, args, property;\n expr = parsePrimaryExpression();\n for (;;) {\n if (match('.')) {\n property = parseNonComputedMember();\n expr = finishMemberExpression('.', expr, property);\n } else if (match('(')) {\n args = parseArguments();\n expr = finishCallExpression(expr, args);\n } else if (match('[')) {\n property = parseComputedMember();\n expr = finishMemberExpression('[', expr, property);\n } else {\n break;\n }\n }\n return expr;\n}\n\n// 11.3 Postfix Expressions\n\nfunction parsePostfixExpression() {\n const expr = parseLeftHandSideExpressionAllowCall();\n if (lookahead.type === TokenPunctuator) {\n if (match('++') || match('--')) {\n throw new Error(DISABLED);\n }\n }\n return expr;\n}\n\n// 11.4 Unary Operators\n\nfunction parseUnaryExpression() {\n var token, expr;\n if (lookahead.type !== TokenPunctuator && lookahead.type !== TokenKeyword) {\n expr = parsePostfixExpression();\n } else if (match('++') || match('--')) {\n throw new Error(DISABLED);\n } else if (match('+') || match('-') || match('~') || match('!')) {\n token = lex();\n expr = parseUnaryExpression();\n expr = finishUnaryExpression(token.value, expr);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n throw new Error(DISABLED);\n } else {\n expr = parsePostfixExpression();\n }\n return expr;\n}\nfunction binaryPrecedence(token) {\n let prec = 0;\n if (token.type !== TokenPunctuator && token.type !== TokenKeyword) {\n return 0;\n }\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n case '&&':\n prec = 2;\n break;\n case '|':\n prec = 3;\n break;\n case '^':\n prec = 4;\n break;\n case '&':\n prec = 5;\n break;\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n case 'in':\n prec = 7;\n break;\n case '<<':\n case '>>':\n case '>>>':\n prec = 8;\n break;\n case '+':\n case '-':\n prec = 9;\n break;\n case '*':\n case '/':\n case '%':\n prec = 11;\n break;\n }\n return prec;\n}\n\n// 11.5 Multiplicative Operators\n// 11.6 Additive Operators\n// 11.7 Bitwise Shift Operators\n// 11.8 Relational Operators\n// 11.9 Equality Operators\n// 11.10 Binary Bitwise Operators\n// 11.11 Binary Logical Operators\n\nfunction parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n marker = lookahead;\n left = parseUnaryExpression();\n token = lookahead;\n prec = binaryPrecedence(token);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n stack = [left, token, right];\n while ((prec = binaryPrecedence(lookahead)) > 0) {\n // Reduce: make a binary expression from the three topmost entries.\n while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = finishBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n markers.pop();\n expr = finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n return expr;\n}\n\n// 11.12 Conditional Operator\n\nfunction parseConditionalExpression() {\n var expr, consequent, alternate;\n expr = parseBinaryExpression();\n if (match('?')) {\n lex();\n consequent = parseConditionalExpression();\n expect(':');\n alternate = parseConditionalExpression();\n expr = finishConditionalExpression(expr, consequent, alternate);\n }\n return expr;\n}\n\n// 11.14 Comma Operator\n\nfunction parseExpression() {\n const expr = parseConditionalExpression();\n if (match(',')) {\n throw new Error(DISABLED); // no sequence expressions\n }\n return expr;\n}\nfunction parser (code) {\n source = code;\n index = 0;\n length = source.length;\n lookahead = null;\n peek();\n const expr = parseExpression();\n if (lookahead.type !== TokenEOF) {\n throw new Error('Unexpect token after expression.');\n }\n return expr;\n}\n\nvar Constants = {\n NaN: 'NaN',\n E: 'Math.E',\n LN2: 'Math.LN2',\n LN10: 'Math.LN10',\n LOG2E: 'Math.LOG2E',\n LOG10E: 'Math.LOG10E',\n PI: 'Math.PI',\n SQRT1_2: 'Math.SQRT1_2',\n SQRT2: 'Math.SQRT2',\n MIN_VALUE: 'Number.MIN_VALUE',\n MAX_VALUE: 'Number.MAX_VALUE'\n};\n\nfunction Functions (codegen) {\n function fncall(name, args, cast, type) {\n let obj = codegen(args[0]);\n if (cast) {\n obj = cast + '(' + obj + ')';\n if (cast.lastIndexOf('new ', 0) === 0) obj = '(' + obj + ')';\n }\n return obj + '.' + name + (type < 0 ? '' : type === 0 ? '()' : '(' + args.slice(1).map(codegen).join(',') + ')');\n }\n function fn(name, cast, type) {\n return args => fncall(name, args, cast, type);\n }\n const DATE = 'new Date',\n STRING = 'String',\n REGEXP = 'RegExp';\n return {\n // MATH functions\n isNaN: 'Number.isNaN',\n isFinite: 'Number.isFinite',\n abs: 'Math.abs',\n acos: 'Math.acos',\n asin: 'Math.asin',\n atan: 'Math.atan',\n atan2: 'Math.atan2',\n ceil: 'Math.ceil',\n cos: 'Math.cos',\n exp: 'Math.exp',\n floor: 'Math.floor',\n hypot: 'Math.hypot',\n log: 'Math.log',\n max: 'Math.max',\n min: 'Math.min',\n pow: 'Math.pow',\n random: 'Math.random',\n round: 'Math.round',\n sin: 'Math.sin',\n sqrt: 'Math.sqrt',\n tan: 'Math.tan',\n clamp: function (args) {\n if (args.length < 3) error('Missing arguments to clamp function.');\n if (args.length > 3) error('Too many arguments to clamp function.');\n const a = args.map(codegen);\n return 'Math.max(' + a[1] + ', Math.min(' + a[2] + ',' + a[0] + '))';\n },\n // DATE functions\n now: 'Date.now',\n utc: 'Date.UTC',\n datetime: DATE,\n date: fn('getDate', DATE, 0),\n day: fn('getDay', DATE, 0),\n year: fn('getFullYear', DATE, 0),\n month: fn('getMonth', DATE, 0),\n hours: fn('getHours', DATE, 0),\n minutes: fn('getMinutes', DATE, 0),\n seconds: fn('getSeconds', DATE, 0),\n milliseconds: fn('getMilliseconds', DATE, 0),\n time: fn('getTime', DATE, 0),\n timezoneoffset: fn('getTimezoneOffset', DATE, 0),\n utcdate: fn('getUTCDate', DATE, 0),\n utcday: fn('getUTCDay', DATE, 0),\n utcyear: fn('getUTCFullYear', DATE, 0),\n utcmonth: fn('getUTCMonth', DATE, 0),\n utchours: fn('getUTCHours', DATE, 0),\n utcminutes: fn('getUTCMinutes', DATE, 0),\n utcseconds: fn('getUTCSeconds', DATE, 0),\n utcmilliseconds: fn('getUTCMilliseconds', DATE, 0),\n // sequence functions\n length: fn('length', null, -1),\n // STRING functions\n parseFloat: 'parseFloat',\n parseInt: 'parseInt',\n upper: fn('toUpperCase', STRING, 0),\n lower: fn('toLowerCase', STRING, 0),\n substring: fn('substring', STRING),\n split: fn('split', STRING),\n trim: fn('trim', STRING, 0),\n // REGEXP functions\n regexp: REGEXP,\n test: fn('test', REGEXP),\n // Control Flow functions\n if: function (args) {\n if (args.length < 3) error('Missing arguments to if function.');\n if (args.length > 3) error('Too many arguments to if function.');\n const a = args.map(codegen);\n return '(' + a[0] + '?' + a[1] + ':' + a[2] + ')';\n }\n };\n}\n\nfunction stripQuotes(s) {\n const n = s && s.length - 1;\n return n && (s[0] === '\"' && s[n] === '\"' || s[0] === '\\'' && s[n] === '\\'') ? s.slice(1, -1) : s;\n}\nfunction codegen (opt) {\n opt = opt || {};\n const allowed = opt.allowed ? toSet(opt.allowed) : {},\n forbidden = opt.forbidden ? toSet(opt.forbidden) : {},\n constants = opt.constants || Constants,\n functions = (opt.functions || Functions)(visit),\n globalvar = opt.globalvar,\n fieldvar = opt.fieldvar,\n outputGlobal = isFunction(globalvar) ? globalvar : id => `${globalvar}[\"${id}\"]`;\n let globals = {},\n fields = {},\n memberDepth = 0;\n function visit(ast) {\n if (isString(ast)) return ast;\n const generator = Generators[ast.type];\n if (generator == null) error('Unsupported type: ' + ast.type);\n return generator(ast);\n }\n const Generators = {\n Literal: n => n.raw,\n Identifier: n => {\n const id = n.name;\n if (memberDepth > 0) {\n return id;\n } else if (hasOwnProperty(forbidden, id)) {\n return error('Illegal identifier: ' + id);\n } else if (hasOwnProperty(constants, id)) {\n return constants[id];\n } else if (hasOwnProperty(allowed, id)) {\n return id;\n } else {\n globals[id] = 1;\n return outputGlobal(id);\n }\n },\n MemberExpression: n => {\n const d = !n.computed,\n o = visit(n.object);\n if (d) memberDepth += 1;\n const p = visit(n.property);\n if (o === fieldvar) {\n // strip quotes to sanitize field name (#1653)\n fields[stripQuotes(p)] = 1;\n }\n if (d) memberDepth -= 1;\n return o + (d ? '.' + p : '[' + p + ']');\n },\n CallExpression: n => {\n if (n.callee.type !== 'Identifier') {\n error('Illegal callee type: ' + n.callee.type);\n }\n const callee = n.callee.name,\n args = n.arguments,\n fn = hasOwnProperty(functions, callee) && functions[callee];\n if (!fn) error('Unrecognized function: ' + callee);\n return isFunction(fn) ? fn(args) : fn + '(' + args.map(visit).join(',') + ')';\n },\n ArrayExpression: n => '[' + n.elements.map(visit).join(',') + ']',\n BinaryExpression: n => '(' + visit(n.left) + ' ' + n.operator + ' ' + visit(n.right) + ')',\n UnaryExpression: n => '(' + n.operator + visit(n.argument) + ')',\n ConditionalExpression: n => '(' + visit(n.test) + '?' + visit(n.consequent) + ':' + visit(n.alternate) + ')',\n LogicalExpression: n => '(' + visit(n.left) + n.operator + visit(n.right) + ')',\n ObjectExpression: n => '{' + n.properties.map(visit).join(',') + '}',\n Property: n => {\n memberDepth += 1;\n const k = visit(n.key);\n memberDepth -= 1;\n return k + ':' + visit(n.value);\n }\n };\n function codegen(ast) {\n const result = {\n code: visit(ast),\n globals: Object.keys(globals),\n fields: Object.keys(fields)\n };\n globals = {};\n fields = {};\n return result;\n }\n codegen.functions = functions;\n codegen.constants = constants;\n return codegen;\n}\n\nexport { ASTNode, ArrayExpression, BinaryExpression, CallExpression, ConditionalExpression, Identifier, Literal, LogicalExpression, MemberExpression, ObjectExpression, Property, RawCode, UnaryExpression, codegen as codegenExpression, Constants as constants, Functions as functions, parser as parseExpression };\n","import {Adder} from \"d3-array\";\nimport {atan2, cos, quarterPi, radians, sin, tau} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nexport var areaRingSum = new Adder();\n\n// hello?\n\nvar areaSum = new Adder(),\n lambda00,\n phi00,\n lambda0,\n cosPhi0,\n sinPhi0;\n\nexport var areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaRingSum = new Adder();\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n var areaRing = +areaRingSum;\n areaSum.add(areaRing < 0 ? tau + areaRing : areaRing);\n this.lineStart = this.lineEnd = this.point = noop;\n },\n sphere: function() {\n areaSum.add(tau);\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaRingEnd() {\n areaPoint(lambda00, phi00);\n}\n\nfunction areaPointFirst(lambda, phi) {\n areaStream.point = areaPoint;\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi);\n}\n\nfunction areaPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n phi = phi / 2 + quarterPi; // half the angular distance from south pole\n\n // Spherical excess E for a spherical triangle with vertices: south pole,\n // previous point, current point. Uses a formula derived from Cagnoli’s\n // theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2).\n var dLambda = lambda - lambda0,\n sdLambda = dLambda >= 0 ? 1 : -1,\n adLambda = sdLambda * dLambda,\n cosPhi = cos(phi),\n sinPhi = sin(phi),\n k = sinPhi0 * sinPhi,\n u = cosPhi0 * cosPhi + k * cos(adLambda),\n v = k * sdLambda * sin(adLambda);\n areaRingSum.add(atan2(v, u));\n\n // Advance the previous points.\n lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;\n}\n\nexport default function(object) {\n areaSum = new Adder();\n stream(object, areaStream);\n return areaSum * 2;\n}\n","import {Adder} from \"d3-array\";\nimport {areaStream, areaRingSum} from \"./area.js\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport {abs, degrees, epsilon, radians} from \"./math.js\";\nimport stream from \"./stream.js\";\n\nvar lambda0, phi0, lambda1, phi1, // bounds\n lambda2, // previous lambda-coordinate\n lambda00, phi00, // first point\n p0, // previous 3D point\n deltaSum,\n ranges,\n range;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: boundsLineStart,\n lineEnd: boundsLineEnd,\n polygonStart: function() {\n boundsStream.point = boundsRingPoint;\n boundsStream.lineStart = boundsRingStart;\n boundsStream.lineEnd = boundsRingEnd;\n deltaSum = new Adder();\n areaStream.polygonStart();\n },\n polygonEnd: function() {\n areaStream.polygonEnd();\n boundsStream.point = boundsPoint;\n boundsStream.lineStart = boundsLineStart;\n boundsStream.lineEnd = boundsLineEnd;\n if (areaRingSum < 0) lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n else if (deltaSum > epsilon) phi1 = 90;\n else if (deltaSum < -epsilon) phi0 = -90;\n range[0] = lambda0, range[1] = lambda1;\n },\n sphere: function() {\n lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n }\n};\n\nfunction boundsPoint(lambda, phi) {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n}\n\nfunction linePoint(lambda, phi) {\n var p = cartesian([lambda * radians, phi * radians]);\n if (p0) {\n var normal = cartesianCross(p0, p),\n equatorial = [normal[1], -normal[0], 0],\n inflection = cartesianCross(equatorial, normal);\n cartesianNormalizeInPlace(inflection);\n inflection = spherical(inflection);\n var delta = lambda - lambda2,\n sign = delta > 0 ? 1 : -1,\n lambdai = inflection[0] * degrees * sign,\n phii,\n antimeridian = abs(delta) > 180;\n if (antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = inflection[1] * degrees;\n if (phii > phi1) phi1 = phii;\n } else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = -inflection[1] * degrees;\n if (phii < phi0) phi0 = phii;\n } else {\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n }\n if (antimeridian) {\n if (lambda < lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n } else {\n if (lambda1 >= lambda0) {\n if (lambda < lambda0) lambda0 = lambda;\n if (lambda > lambda1) lambda1 = lambda;\n } else {\n if (lambda > lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n }\n }\n } else {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n }\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n p0 = p, lambda2 = lambda;\n}\n\nfunction boundsLineStart() {\n boundsStream.point = linePoint;\n}\n\nfunction boundsLineEnd() {\n range[0] = lambda0, range[1] = lambda1;\n boundsStream.point = boundsPoint;\n p0 = null;\n}\n\nfunction boundsRingPoint(lambda, phi) {\n if (p0) {\n var delta = lambda - lambda2;\n deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);\n } else {\n lambda00 = lambda, phi00 = phi;\n }\n areaStream.point(lambda, phi);\n linePoint(lambda, phi);\n}\n\nfunction boundsRingStart() {\n areaStream.lineStart();\n}\n\nfunction boundsRingEnd() {\n boundsRingPoint(lambda00, phi00);\n areaStream.lineEnd();\n if (abs(deltaSum) > epsilon) lambda0 = -(lambda1 = 180);\n range[0] = lambda0, range[1] = lambda1;\n p0 = null;\n}\n\n// Finds the left-right distance between two longitudes.\n// This is almost the same as (lambda1 - lambda0 + 360°) % 360°, except that we want\n// the distance between ±180° to be 360°.\nfunction angle(lambda0, lambda1) {\n return (lambda1 -= lambda0) < 0 ? lambda1 + 360 : lambda1;\n}\n\nfunction rangeCompare(a, b) {\n return a[0] - b[0];\n}\n\nfunction rangeContains(range, x) {\n return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;\n}\n\nexport default function(feature) {\n var i, n, a, b, merged, deltaMax, delta;\n\n phi1 = lambda1 = -(lambda0 = phi0 = Infinity);\n ranges = [];\n stream(feature, boundsStream);\n\n // First, sort ranges by their minimum longitudes.\n if (n = ranges.length) {\n ranges.sort(rangeCompare);\n\n // Then, merge any ranges that overlap.\n for (i = 1, a = ranges[0], merged = [a]; i < n; ++i) {\n b = ranges[i];\n if (rangeContains(a, b[0]) || rangeContains(a, b[1])) {\n if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];\n if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];\n } else {\n merged.push(a = b);\n }\n }\n\n // Finally, find the largest gap between the merged ranges.\n // The final bounding box will be the inverse of this gap.\n for (deltaMax = -Infinity, n = merged.length - 1, i = 0, a = merged[n]; i <= n; a = b, ++i) {\n b = merged[i];\n if ((delta = angle(a[1], b[0])) > deltaMax) deltaMax = delta, lambda0 = b[0], lambda1 = a[1];\n }\n }\n\n ranges = range = null;\n\n return lambda0 === Infinity || phi0 === Infinity\n ? [[NaN, NaN], [NaN, NaN]]\n : [[lambda0, phi0], [lambda1, phi1]];\n}\n","import {Adder} from \"d3-array\";\nimport {asin, atan2, cos, degrees, epsilon, epsilon2, hypot, radians, sin, sqrt} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nvar W0, W1,\n X0, Y0, Z0,\n X1, Y1, Z1,\n X2, Y2, Z2,\n lambda00, phi00, // first point\n x0, y0, z0; // previous point\n\nvar centroidStream = {\n sphere: noop,\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n }\n};\n\n// Arithmetic mean of Cartesian vectors.\nfunction centroidPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n centroidPointCartesian(cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi));\n}\n\nfunction centroidPointCartesian(x, y, z) {\n ++W0;\n X0 += (x - X0) / W0;\n Y0 += (y - Y0) / W0;\n Z0 += (z - Z0) / W0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidLinePointFirst;\n}\n\nfunction centroidLinePointFirst(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidStream.point = centroidLinePoint;\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLinePoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n w = atan2(sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\n// See J. E. Brock, The Inertia Tensor for a Spherical Triangle,\n// J. Applied Mechanics 42, 239 (1975).\nfunction centroidRingStart() {\n centroidStream.point = centroidRingPointFirst;\n}\n\nfunction centroidRingEnd() {\n centroidRingPoint(lambda00, phi00);\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingPointFirst(lambda, phi) {\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n centroidStream.point = centroidRingPoint;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidRingPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n cx = y0 * z - z0 * y,\n cy = z0 * x - x0 * z,\n cz = x0 * y - y0 * x,\n m = hypot(cx, cy, cz),\n w = asin(m), // line weight = angle\n v = m && -w / m; // area weight multiplier\n X2.add(v * cx);\n Y2.add(v * cy);\n Z2.add(v * cz);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nexport default function(object) {\n W0 = W1 =\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 = 0;\n X2 = new Adder();\n Y2 = new Adder();\n Z2 = new Adder();\n stream(object, centroidStream);\n\n var x = +X2,\n y = +Y2,\n z = +Z2,\n m = hypot(x, y, z);\n\n // If the area-weighted ccentroid is undefined, fall back to length-weighted ccentroid.\n if (m < epsilon2) {\n x = X1, y = Y1, z = Z1;\n // If the feature has zero length, fall back to arithmetic mean of point vectors.\n if (W1 < epsilon) x = X0, y = Y0, z = Z0;\n m = hypot(x, y, z);\n // If the feature still has an undefined ccentroid, then return.\n if (m < epsilon2) return [NaN, NaN];\n }\n\n return [atan2(y, x) * degrees, asin(z / m) * degrees];\n}\n","export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n","import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can’t do this\n // for a comparator (except for specific, known comparators) because we can’t\n // tell if the comparator is symmetric, and an asymmetric comparator can’t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n","import {InternSet} from \"internmap\";\n\nexport default function intersection(values, ...others) {\n values = new InternSet(values);\n others = others.map(set);\n out: for (const value of values) {\n for (const other of others) {\n if (!other.has(value)) {\n values.delete(value);\n continue out;\n }\n }\n }\n return values;\n}\n\nfunction set(values) {\n return values instanceof InternSet ? values : new InternSet(values);\n}\n","import { bisector, union, intersection } from 'd3-array';\nimport { field, isDate, toNumber, isArray, inrange, extend, array, error, peek, hasOwnProperty } from 'vega-util';\nimport { Literal } from 'vega-expression';\n\n// Registers vega-util field accessors to protect against XSS attacks\nconst SELECTION_GETTER = Symbol('vega_selection_getter');\nfunction getter(f) {\n if (!f.getter || !f.getter[SELECTION_GETTER]) {\n f.getter = field(f.field);\n f.getter[SELECTION_GETTER] = true;\n }\n return f.getter;\n}\nconst Intersect = 'intersect';\nconst Union = 'union';\nconst VlMulti = 'vlMulti';\nconst VlPoint = 'vlPoint';\nconst Or = 'or';\nconst And = 'and';\nconst SelectionId = '_vgsid_';\nconst $selectionId = field(SelectionId);\n\nconst TYPE_ENUM = 'E',\n TYPE_RANGE_INC = 'R',\n TYPE_RANGE_EXC = 'R-E',\n TYPE_RANGE_LE = 'R-LE',\n TYPE_RANGE_RE = 'R-RE',\n UNIT_INDEX = 'index:unit';\n\n// TODO: revisit date coercion?\nfunction testPoint(datum, entry) {\n var fields = entry.fields,\n values = entry.values,\n n = fields.length,\n i = 0,\n dval,\n f;\n for (; i < n; ++i) {\n f = fields[i];\n dval = getter(f)(datum);\n if (isDate(dval)) dval = toNumber(dval);\n if (isDate(values[i])) values[i] = toNumber(values[i]);\n if (isArray(values[i]) && isDate(values[i][0])) values[i] = values[i].map(toNumber);\n if (f.type === TYPE_ENUM) {\n // Enumerated fields can either specify individual values (single/multi selections)\n // or an array of values (interval selections).\n if (isArray(values[i]) ? values[i].indexOf(dval) < 0 : dval !== values[i]) {\n return false;\n }\n } else {\n if (f.type === TYPE_RANGE_INC) {\n if (!inrange(dval, values[i])) return false;\n } else if (f.type === TYPE_RANGE_RE) {\n // Discrete selection of bins test within the range [bin_start, bin_end).\n if (!inrange(dval, values[i], true, false)) return false;\n } else if (f.type === TYPE_RANGE_EXC) {\n // 'R-E'/'R-LE' included for completeness.\n if (!inrange(dval, values[i], false, false)) return false;\n } else if (f.type === TYPE_RANGE_LE) {\n if (!inrange(dval, values[i], false, true)) return false;\n }\n }\n }\n return true;\n}\n\n/**\n * Tests if a tuple is contained within an interactive selection.\n * @param {string} name - The name of the data set representing the selection.\n * Tuples in the dataset are of the form\n * {unit: string, fields: array, values: array<*>}.\n * Fielddef is of the form\n * {field: string, channel: string, type: 'E' | 'R'} where\n * 'type' identifies whether tuples in the dataset enumerate\n * values for the field, or specify a continuous range.\n * @param {object} datum - The tuple to test for inclusion.\n * @param {string} op - The set operation for combining selections.\n * One of 'intersect' or 'union' (default).\n * @return {boolean} - True if the datum is in the selection, false otherwise.\n */\nfunction selectionTest(name, datum, op) {\n var data = this.context.data[name],\n entries = data ? data.values.value : [],\n unitIdx = data ? data[UNIT_INDEX] && data[UNIT_INDEX].value : undefined,\n intersect = op === Intersect,\n n = entries.length,\n i = 0,\n entry,\n miss,\n count,\n unit,\n b;\n for (; i < n; ++i) {\n entry = entries[i];\n if (unitIdx && intersect) {\n // multi selections union within the same unit and intersect across units.\n miss = miss || {};\n count = miss[unit = entry.unit] || 0;\n\n // if we've already matched this unit, skip.\n if (count === -1) continue;\n b = testPoint(datum, entry);\n miss[unit] = b ? -1 : ++count;\n\n // if we match and there are no other units return true\n // if we've missed against all tuples in this unit return false\n if (b && unitIdx.size === 1) return true;\n if (!b && count === unitIdx.get(unit).count) return false;\n } else {\n b = testPoint(datum, entry);\n\n // if we find a miss and we do require intersection return false\n // if we find a match and we don't require intersection return true\n if (intersect ^ b) return b;\n }\n }\n\n // if intersecting and we made it here, then we saw no misses\n // if not intersecting, then we saw no matches\n // if no active selections, return false\n return n && intersect;\n}\nconst bisect = bisector($selectionId),\n bisectLeft = bisect.left,\n bisectRight = bisect.right;\nfunction selectionIdTest(name, datum, op) {\n const data = this.context.data[name],\n entries = data ? data.values.value : [],\n unitIdx = data ? data[UNIT_INDEX] && data[UNIT_INDEX].value : undefined,\n intersect = op === Intersect,\n value = $selectionId(datum),\n index = bisectLeft(entries, value);\n if (index === entries.length) return false;\n if ($selectionId(entries[index]) !== value) return false;\n if (unitIdx && intersect) {\n if (unitIdx.size === 1) return true;\n if (bisectRight(entries, value) - index < unitIdx.size) return false;\n }\n return true;\n}\n\n/**\n * Maps an array of scene graph items to an array of selection tuples.\n * @param {string} name - The name of the dataset representing the selection.\n * @param {string} base - The base object that generated tuples extend.\n *\n * @returns {array} An array of selection entries for the given unit.\n */\nfunction selectionTuples(array, base) {\n return array.map(x => extend(base.fields ? {\n values: base.fields.map(f => getter(f)(x.datum))\n } : {\n [SelectionId]: $selectionId(x.datum)\n }, base));\n}\n\n/**\n * Resolves selection for use as a scale domain or reads via the API.\n * @param {string} name - The name of the dataset representing the selection\n * @param {string} [op='union'] - The set operation for combining selections.\n * One of 'intersect' or 'union' (default).\n * @param {boolean} isMulti - Identifies a \"multi\" selection to perform more\n * expensive resolution computation.\n * @param {boolean} vl5 - With Vega-Lite v5, \"multi\" selections are now called \"point\"\n * selections, and thus the resolved tuple should reflect this name.\n * This parameter allows us to reflect this change without triggering\n * a major version bump for Vega.\n * @returns {object} An object of selected fields and values.\n */\nfunction selectionResolve(name, op, isMulti, vl5) {\n var data = this.context.data[name],\n entries = data ? data.values.value : [],\n resolved = {},\n multiRes = {},\n types = {},\n entry,\n fields,\n values,\n unit,\n field,\n value,\n res,\n resUnit,\n type,\n union,\n n = entries.length,\n i = 0,\n j,\n m;\n\n // First union all entries within the same unit.\n for (; i < n; ++i) {\n entry = entries[i];\n unit = entry.unit;\n fields = entry.fields;\n values = entry.values;\n if (fields && values) {\n // Intentional selection stores\n for (j = 0, m = fields.length; j < m; ++j) {\n field = fields[j];\n res = resolved[field.field] || (resolved[field.field] = {});\n resUnit = res[unit] || (res[unit] = []);\n types[field.field] = type = field.type.charAt(0);\n union = ops[`${type}_union`];\n res[unit] = union(resUnit, array(values[j]));\n }\n\n // If the same multi-selection is repeated over views and projected over\n // an encoding, it may operate over different fields making it especially\n // tricky to reliably resolve it. At best, we can de-dupe identical entries\n // but doing so may be more computationally expensive than it is worth.\n // Instead, for now, we simply transform our store representation into\n // a more human-friendly one.\n if (isMulti) {\n resUnit = multiRes[unit] || (multiRes[unit] = []);\n resUnit.push(array(values).reduce((obj, curr, j) => (obj[fields[j].field] = curr, obj), {}));\n }\n } else {\n // Short circuit extensional selectionId stores which hold sorted IDs unique to each unit.\n field = SelectionId;\n value = $selectionId(entry);\n res = resolved[field] || (resolved[field] = {});\n resUnit = res[unit] || (res[unit] = []);\n resUnit.push(value);\n if (isMulti) {\n resUnit = multiRes[unit] || (multiRes[unit] = []);\n resUnit.push({\n [SelectionId]: value\n });\n }\n }\n }\n\n // Then resolve fields across units as per the op.\n op = op || Union;\n if (resolved[SelectionId]) {\n resolved[SelectionId] = ops[`${SelectionId}_${op}`](...Object.values(resolved[SelectionId]));\n } else {\n Object.keys(resolved).forEach(field => {\n resolved[field] = Object.keys(resolved[field]).map(unit => resolved[field][unit]).reduce((acc, curr) => acc === undefined ? curr : ops[`${types[field]}_${op}`](acc, curr));\n });\n }\n entries = Object.keys(multiRes);\n if (isMulti && entries.length) {\n const key = vl5 ? VlPoint : VlMulti;\n resolved[key] = op === Union ? {\n [Or]: entries.reduce((acc, k) => (acc.push(...multiRes[k]), acc), [])\n } : {\n [And]: entries.map(k => ({\n [Or]: multiRes[k]\n }))\n };\n }\n return resolved;\n}\nvar ops = {\n [`${SelectionId}_union`]: union,\n [`${SelectionId}_intersect`]: intersection,\n E_union: function (base, value) {\n if (!base.length) return value;\n var i = 0,\n n = value.length;\n for (; i < n; ++i) if (base.indexOf(value[i]) < 0) base.push(value[i]);\n return base;\n },\n E_intersect: function (base, value) {\n return !base.length ? value : base.filter(v => value.indexOf(v) >= 0);\n },\n R_union: function (base, value) {\n var lo = toNumber(value[0]),\n hi = toNumber(value[1]);\n if (lo > hi) {\n lo = value[1];\n hi = value[0];\n }\n if (!base.length) return [lo, hi];\n if (base[0] > lo) base[0] = lo;\n if (base[1] < hi) base[1] = hi;\n return base;\n },\n R_intersect: function (base, value) {\n var lo = toNumber(value[0]),\n hi = toNumber(value[1]);\n if (lo > hi) {\n lo = value[1];\n hi = value[0];\n }\n if (!base.length) return [lo, hi];\n if (hi < base[0] || base[1] < lo) {\n return [];\n } else {\n if (base[0] < lo) base[0] = lo;\n if (base[1] > hi) base[1] = hi;\n }\n return base;\n }\n};\n\nconst DataPrefix = ':',\n IndexPrefix = '@';\nfunction selectionVisitor(name, args, scope, params) {\n if (args[0].type !== Literal) error('First argument to selection functions must be a string literal.');\n const data = args[0].value,\n op = args.length >= 2 && peek(args).value,\n field = 'unit',\n indexName = IndexPrefix + field,\n dataName = DataPrefix + data;\n\n // eslint-disable-next-line no-prototype-builtins\n if (op === Intersect && !hasOwnProperty(params, indexName)) {\n params[indexName] = scope.getData(data).indataRef(scope, field);\n }\n\n // eslint-disable-next-line no-prototype-builtins\n if (!hasOwnProperty(params, dataName)) {\n params[dataName] = scope.getData(data).tuplesRef();\n }\n}\n\nexport { selectionIdTest, selectionResolve, selectionTest, selectionTuples, selectionVisitor };\n","import {InternSet} from \"internmap\";\n\nexport default function union(...others) {\n const set = new InternSet();\n for (const other of others) {\n for (const o of other) {\n set.add(o);\n }\n }\n return set;\n}\n","import { truthy, error, hasOwnProperty, isFunction, isString, stringValue, extend, isArray, isObject, field, peek, identity, array as array$1, isBoolean, isDate, isNumber, isRegExp, toBoolean, toDate, toNumber, toString, flush, lerp, pad, span, inrange, truncate, quarter, utcquarter, extent, clampRange, panLinear, panLog, panPow, panSymlog, zoomLinear, zoomLog, zoomPow, zoomSymlog } from 'vega-util';\nimport { Literal, codegenExpression, constants, functions, parseExpression, CallExpression } from 'vega-expression';\nimport { isRegisteredScale, bandSpace, scale as scale$1, scaleFraction } from 'vega-scale';\nimport { geoArea as geoArea$1, geoBounds as geoBounds$1, geoCentroid as geoCentroid$1 } from 'd3-geo';\nimport { rgb, lab, hcl, hsl } from 'd3-color';\nimport { isTuple } from 'vega-dataflow';\nimport { Gradient, pathRender, pathParse, Bounds, intersect as intersect$1 } from 'vega-scenegraph';\nimport { selectionVisitor, selectionTest, selectionIdTest, selectionResolve, selectionTuples } from 'vega-selections';\nimport { random, cumulativeNormal, cumulativeLogNormal, cumulativeUniform, densityNormal, densityLogNormal, densityUniform, quantileNormal, quantileLogNormal, quantileUniform, sampleNormal, sampleLogNormal, sampleUniform } from 'vega-statistics';\nimport { utcOffset, utcSequence, timeOffset, timeSequence, timeUnitSpecifier, week, utcweek, dayofyear, utcdayofyear } from 'vega-time';\nimport { range as range$1 } from 'd3-array';\n\nfunction data(name) {\n const data = this.context.data[name];\n return data ? data.values.value : [];\n}\nfunction indata(name, field, value) {\n const index = this.context.data[name]['index:' + field],\n entry = index ? index.value.get(value) : undefined;\n return entry ? entry.count : entry;\n}\nfunction setdata(name, tuples) {\n const df = this.context.dataflow,\n data = this.context.data[name],\n input = data.input;\n df.pulse(input, df.changeset().remove(truthy).insert(tuples));\n return 1;\n}\n\nfunction encode (item, name, retval) {\n if (item) {\n const df = this.context.dataflow,\n target = item.mark.source;\n df.pulse(target, df.changeset().encode(item, name));\n }\n return retval !== undefined ? retval : item;\n}\n\nconst wrap = method => function (value, spec) {\n const locale = this.context.dataflow.locale();\n return value === null ? 'null' : locale[method](spec)(value);\n};\nconst format = wrap('format');\nconst timeFormat = wrap('timeFormat');\nconst utcFormat = wrap('utcFormat');\nconst timeParse = wrap('timeParse');\nconst utcParse = wrap('utcParse');\nconst dateObj = new Date(2000, 0, 1);\nfunction time(month, day, specifier) {\n if (!Number.isInteger(month) || !Number.isInteger(day)) return '';\n dateObj.setYear(2000);\n dateObj.setMonth(month);\n dateObj.setDate(day);\n return timeFormat.call(this, dateObj, specifier);\n}\nfunction monthFormat(month) {\n return time.call(this, month, 1, '%B');\n}\nfunction monthAbbrevFormat(month) {\n return time.call(this, month, 1, '%b');\n}\nfunction dayFormat(day) {\n return time.call(this, 0, 2 + day, '%A');\n}\nfunction dayAbbrevFormat(day) {\n return time.call(this, 0, 2 + day, '%a');\n}\n\nconst DataPrefix = ':';\nconst IndexPrefix = '@';\nconst ScalePrefix = '%';\nconst SignalPrefix = '$';\n\nfunction dataVisitor(name, args, scope, params) {\n if (args[0].type !== Literal) {\n error('First argument to data functions must be a string literal.');\n }\n const data = args[0].value,\n dataName = DataPrefix + data;\n if (!hasOwnProperty(dataName, params)) {\n try {\n params[dataName] = scope.getData(data).tuplesRef();\n } catch (err) {\n // if data set does not exist, there's nothing to track\n }\n }\n}\nfunction indataVisitor(name, args, scope, params) {\n if (args[0].type !== Literal) error('First argument to indata must be a string literal.');\n if (args[1].type !== Literal) error('Second argument to indata must be a string literal.');\n const data = args[0].value,\n field = args[1].value,\n indexName = IndexPrefix + field;\n if (!hasOwnProperty(indexName, params)) {\n params[indexName] = scope.getData(data).indataRef(scope, field);\n }\n}\nfunction scaleVisitor(name, args, scope, params) {\n if (args[0].type === Literal) {\n // add scale dependency\n addScaleDependency(scope, params, args[0].value);\n } else {\n // indirect scale lookup; add all scales as parameters\n for (name in scope.scales) {\n addScaleDependency(scope, params, name);\n }\n }\n}\nfunction addScaleDependency(scope, params, name) {\n const scaleName = ScalePrefix + name;\n if (!hasOwnProperty(params, scaleName)) {\n try {\n params[scaleName] = scope.scaleRef(name);\n } catch (err) {\n // TODO: error handling? warning?\n }\n }\n}\n\nfunction getScale(nameOrFunction, ctx) {\n if (isFunction(nameOrFunction)) {\n return nameOrFunction;\n }\n if (isString(nameOrFunction)) {\n const maybeScale = ctx.scales[nameOrFunction];\n return maybeScale && isRegisteredScale(maybeScale.value) ? maybeScale.value : undefined;\n }\n return undefined;\n}\nfunction internalScaleFunctions(codegen, fnctx, visitors) {\n // add helper method to the 'this' expression function context\n fnctx.__bandwidth = s => s && s.bandwidth ? s.bandwidth() : 0;\n\n // register AST visitors for internal scale functions\n visitors._bandwidth = scaleVisitor;\n visitors._range = scaleVisitor;\n visitors._scale = scaleVisitor;\n\n // resolve scale reference directly to the signal hash argument\n const ref = arg => '_[' + (arg.type === Literal ? stringValue(ScalePrefix + arg.value) : stringValue(ScalePrefix) + '+' + codegen(arg)) + ']';\n\n // define and return internal scale function code generators\n // these internal functions are called by mark encoders\n return {\n _bandwidth: args => `this.__bandwidth(${ref(args[0])})`,\n _range: args => `${ref(args[0])}.range()`,\n _scale: args => `${ref(args[0])}(${codegen(args[1])})`\n };\n}\n\nfunction geoMethod(methodName, globalMethod) {\n return function (projection, geojson, group) {\n if (projection) {\n // projection defined, use it\n const p = getScale(projection, (group || this).context);\n return p && p.path[methodName](geojson);\n } else {\n // projection undefined, use global method\n return globalMethod(geojson);\n }\n };\n}\nconst geoArea = geoMethod('area', geoArea$1);\nconst geoBounds = geoMethod('bounds', geoBounds$1);\nconst geoCentroid = geoMethod('centroid', geoCentroid$1);\nfunction geoScale(projection, group) {\n const p = getScale(projection, (group || this).context);\n return p && p.scale();\n}\n\nfunction inScope (item) {\n const group = this.context.group;\n let value = false;\n if (group) while (item) {\n if (item === group) {\n value = true;\n break;\n }\n item = item.mark.group;\n }\n return value;\n}\n\nfunction log(df, method, args) {\n try {\n df[method].apply(df, ['EXPRESSION'].concat([].slice.call(args)));\n } catch (err) {\n df.warn(err);\n }\n return args[args.length - 1];\n}\nfunction warn() {\n return log(this.context.dataflow, 'warn', arguments);\n}\nfunction info() {\n return log(this.context.dataflow, 'info', arguments);\n}\nfunction debug() {\n return log(this.context.dataflow, 'debug', arguments);\n}\n\n// https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\nfunction channel_luminance_value(channelValue) {\n const val = channelValue / 255;\n if (val <= 0.03928) {\n return val / 12.92;\n }\n return Math.pow((val + 0.055) / 1.055, 2.4);\n}\nfunction luminance(color) {\n const c = rgb(color),\n r = channel_luminance_value(c.r),\n g = channel_luminance_value(c.g),\n b = channel_luminance_value(c.b);\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n}\n\n// https://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef\nfunction contrast(color1, color2) {\n const lum1 = luminance(color1),\n lum2 = luminance(color2),\n lumL = Math.max(lum1, lum2),\n lumD = Math.min(lum1, lum2);\n return (lumL + 0.05) / (lumD + 0.05);\n}\n\nfunction merge () {\n const args = [].slice.call(arguments);\n args.unshift({});\n return extend(...args);\n}\n\nfunction equal(a, b) {\n return a === b || a !== a && b !== b ? true : isArray(a) ? isArray(b) && a.length === b.length ? equalArray(a, b) : false : isObject(a) && isObject(b) ? equalObject(a, b) : false;\n}\nfunction equalArray(a, b) {\n for (let i = 0, n = a.length; i < n; ++i) {\n if (!equal(a[i], b[i])) return false;\n }\n return true;\n}\nfunction equalObject(a, b) {\n for (const key in a) {\n if (!equal(a[key], b[key])) return false;\n }\n return true;\n}\nfunction removePredicate(props) {\n return _ => equalObject(props, _);\n}\nfunction modify (name, insert, remove, toggle, modify, values) {\n const df = this.context.dataflow,\n data = this.context.data[name],\n input = data.input,\n stamp = df.stamp();\n let changes = data.changes,\n predicate,\n key;\n if (df._trigger === false || !(input.value.length || insert || toggle)) {\n // nothing to do!\n return 0;\n }\n if (!changes || changes.stamp < stamp) {\n data.changes = changes = df.changeset();\n changes.stamp = stamp;\n df.runAfter(() => {\n data.modified = true;\n df.pulse(input, changes).run();\n }, true, 1);\n }\n if (remove) {\n predicate = remove === true ? truthy : isArray(remove) || isTuple(remove) ? remove : removePredicate(remove);\n changes.remove(predicate);\n }\n if (insert) {\n changes.insert(insert);\n }\n if (toggle) {\n predicate = removePredicate(toggle);\n if (input.value.some(predicate)) {\n changes.remove(predicate);\n } else {\n changes.insert(toggle);\n }\n }\n if (modify) {\n for (key in values) {\n changes.modify(modify, key, values[key]);\n }\n }\n return 1;\n}\n\nfunction pinchDistance(event) {\n const t = event.touches,\n dx = t[0].clientX - t[1].clientX,\n dy = t[0].clientY - t[1].clientY;\n return Math.hypot(dx, dy);\n}\nfunction pinchAngle(event) {\n const t = event.touches;\n return Math.atan2(t[0].clientY - t[1].clientY, t[0].clientX - t[1].clientX);\n}\n\n// memoize accessor functions\nconst accessors = {};\nfunction pluck (data, name) {\n const accessor = accessors[name] || (accessors[name] = field(name));\n return isArray(data) ? data.map(accessor) : accessor(data);\n}\n\nfunction array(seq) {\n return isArray(seq) || ArrayBuffer.isView(seq) ? seq : null;\n}\nfunction sequence(seq) {\n return array(seq) || (isString(seq) ? seq : null);\n}\nfunction join(seq) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return array(seq).join(...args);\n}\nfunction indexof(seq) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n return sequence(seq).indexOf(...args);\n}\nfunction lastindexof(seq) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n return sequence(seq).lastIndexOf(...args);\n}\nfunction slice(seq) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n return sequence(seq).slice(...args);\n}\nfunction replace(str, pattern, repl) {\n if (isFunction(repl)) error('Function argument passed to replace.');\n return String(str).replace(pattern, repl);\n}\nfunction reverse(seq) {\n return array(seq).slice().reverse();\n}\n\nfunction bandspace(count, paddingInner, paddingOuter) {\n return bandSpace(count || 0, paddingInner || 0, paddingOuter || 0);\n}\nfunction bandwidth(name, group) {\n const s = getScale(name, (group || this).context);\n return s && s.bandwidth ? s.bandwidth() : 0;\n}\nfunction copy(name, group) {\n const s = getScale(name, (group || this).context);\n return s ? s.copy() : undefined;\n}\nfunction domain(name, group) {\n const s = getScale(name, (group || this).context);\n return s ? s.domain() : [];\n}\nfunction invert(name, range, group) {\n const s = getScale(name, (group || this).context);\n return !s ? undefined : isArray(range) ? (s.invertRange || s.invert)(range) : (s.invert || s.invertExtent)(range);\n}\nfunction range(name, group) {\n const s = getScale(name, (group || this).context);\n return s && s.range ? s.range() : [];\n}\nfunction scale(name, value, group) {\n const s = getScale(name, (group || this).context);\n return s ? s(value) : undefined;\n}\n\nfunction scaleGradient (scale, p0, p1, count, group) {\n scale = getScale(scale, (group || this).context);\n const gradient = Gradient(p0, p1);\n let stops = scale.domain(),\n min = stops[0],\n max = peek(stops),\n fraction = identity;\n if (!(max - min)) {\n // expand scale if domain has zero span, fix #1479\n scale = (scale.interpolator ? scale$1('sequential')().interpolator(scale.interpolator()) : scale$1('linear')().interpolate(scale.interpolate()).range(scale.range())).domain([min = 0, max = 1]);\n } else {\n fraction = scaleFraction(scale, min, max);\n }\n if (scale.ticks) {\n stops = scale.ticks(+count || 15);\n if (min !== stops[0]) stops.unshift(min);\n if (max !== peek(stops)) stops.push(max);\n }\n stops.forEach(_ => gradient.stop(fraction(_), scale(_)));\n return gradient;\n}\n\nfunction geoShape(projection, geojson, group) {\n const p = getScale(projection, (group || this).context);\n return function (context) {\n return p ? p.path.context(context)(geojson) : '';\n };\n}\nfunction pathShape(path) {\n let p = null;\n return function (context) {\n return context ? pathRender(context, p = p || pathParse(path)) : path;\n };\n}\n\nconst datum = d => d.data;\nfunction treeNodes(name, context) {\n const tree = data.call(context, name);\n return tree.root && tree.root.lookup || {};\n}\nfunction treePath(name, source, target) {\n const nodes = treeNodes(name, this),\n s = nodes[source],\n t = nodes[target];\n return s && t ? s.path(t).map(datum) : undefined;\n}\nfunction treeAncestors(name, node) {\n const n = treeNodes(name, this)[node];\n return n ? n.ancestors().map(datum) : undefined;\n}\n\nconst _window = () => typeof window !== 'undefined' && window || null;\nfunction screen() {\n const w = _window();\n return w ? w.screen : {};\n}\nfunction windowSize() {\n const w = _window();\n return w ? [w.innerWidth, w.innerHeight] : [undefined, undefined];\n}\nfunction containerSize() {\n const view = this.context.dataflow,\n el = view.container && view.container();\n return el ? [el.clientWidth, el.clientHeight] : [undefined, undefined];\n}\n\nfunction intersect (b, opt, group) {\n if (!b) return [];\n const [u, v] = b,\n box = new Bounds().set(u[0], u[1], v[0], v[1]),\n scene = group || this.context.dataflow.scenegraph().root;\n return intersect$1(scene, box, filter(opt));\n}\nfunction filter(opt) {\n let p = null;\n if (opt) {\n const types = array$1(opt.marktype),\n names = array$1(opt.markname);\n p = _ => (!types.length || types.some(t => _.marktype === t)) && (!names.length || names.some(s => _.name === s));\n }\n return p;\n}\n\n/**\n * Appends a new point to the lasso\n *\n * @param {*} lasso the lasso in pixel space\n * @param {*} x the x coordinate in pixel space\n * @param {*} y the y coordinate in pixel space\n * @param {*} minDist the minimum distance, in pixels, that thenew point needs to be apart from the last point\n * @returns a new array containing the lasso with the new point\n */\nfunction lassoAppend(lasso, x, y) {\n let minDist = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 5;\n lasso = array$1(lasso);\n const last = lasso[lasso.length - 1];\n\n // Add point to lasso if its the first point or distance to last point exceed minDist\n return last === undefined || Math.hypot(last[0] - x, last[1] - y) > minDist ? [...lasso, [x, y]] : lasso;\n}\n\n/**\n * Generates a svg path command which draws a lasso\n *\n * @param {*} lasso the lasso in pixel space in the form [[x,y], [x,y], ...]\n * @returns the svg path command that draws the lasso\n */\nfunction lassoPath(lasso) {\n return array$1(lasso).reduce((svg, _ref, i) => {\n let [x, y] = _ref;\n return svg += i == 0 ? `M ${x},${y} ` : i === lasso.length - 1 ? ' Z' : `L ${x},${y} `;\n }, '');\n}\n\n/**\n * Inverts the lasso from pixel space to an array of vega scenegraph tuples\n *\n * @param {*} data the dataset\n * @param {*} pixelLasso the lasso in pixel space, [[x,y], [x,y], ...]\n * @param {*} unit the unit where the lasso is defined\n *\n * @returns an array of vega scenegraph tuples\n */\nfunction intersectLasso(markname, pixelLasso, unit) {\n const {\n x,\n y,\n mark\n } = unit;\n const bb = new Bounds().set(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER);\n\n // Get bounding box around lasso\n for (const [px, py] of pixelLasso) {\n if (px < bb.x1) bb.x1 = px;\n if (px > bb.x2) bb.x2 = px;\n if (py < bb.y1) bb.y1 = py;\n if (py > bb.y2) bb.y2 = py;\n }\n\n // Translate bb against unit coordinates\n bb.translate(x, y);\n const intersection = intersect([[bb.x1, bb.y1], [bb.x2, bb.y2]], markname, mark);\n\n // Check every point against the lasso\n return intersection.filter(tuple => pointInPolygon(tuple.x, tuple.y, pixelLasso));\n}\n\n/**\n * Performs a test if a point is inside a polygon based on the idea from\n * https://wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html\n *\n * This method will not need the same start/end point since it wraps around the edges of the array\n *\n * @param {*} test a point to test against\n * @param {*} polygon a polygon in the form [[x,y], [x,y], ...]\n * @returns true if the point lies inside the polygon, false otherwise\n */\nfunction pointInPolygon(testx, testy, polygon) {\n let intersections = 0;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const [prevX, prevY] = polygon[j];\n const [x, y] = polygon[i];\n\n // count intersections\n if (y > testy != prevY > testy && testx < (prevX - x) * (testy - y) / (prevY - y) + x) {\n intersections++;\n }\n }\n\n // point is in polygon if intersection count is odd\n return intersections & 1;\n}\n\n// Expression function context object\nconst functionContext = {\n random() {\n return random();\n },\n // override default\n cumulativeNormal,\n cumulativeLogNormal,\n cumulativeUniform,\n densityNormal,\n densityLogNormal,\n densityUniform,\n quantileNormal,\n quantileLogNormal,\n quantileUniform,\n sampleNormal,\n sampleLogNormal,\n sampleUniform,\n isArray,\n isBoolean,\n isDate,\n isDefined(_) {\n return _ !== undefined;\n },\n isNumber,\n isObject,\n isRegExp,\n isString,\n isTuple,\n isValid(_) {\n return _ != null && _ === _;\n },\n toBoolean,\n toDate(_) {\n return toDate(_);\n },\n // suppress extra arguments\n toNumber,\n toString,\n indexof,\n join,\n lastindexof,\n replace,\n reverse,\n slice,\n flush,\n lerp,\n merge,\n pad,\n peek,\n pluck,\n span,\n inrange,\n truncate,\n rgb,\n lab,\n hcl,\n hsl,\n luminance,\n contrast,\n sequence: range$1,\n format,\n utcFormat,\n utcParse,\n utcOffset,\n utcSequence,\n timeFormat,\n timeParse,\n timeOffset,\n timeSequence,\n timeUnitSpecifier,\n monthFormat,\n monthAbbrevFormat,\n dayFormat,\n dayAbbrevFormat,\n quarter,\n utcquarter,\n week,\n utcweek,\n dayofyear,\n utcdayofyear,\n warn,\n info,\n debug,\n extent(_) {\n return extent(_);\n },\n // suppress extra arguments\n inScope,\n intersect,\n clampRange,\n pinchDistance,\n pinchAngle,\n screen,\n containerSize,\n windowSize,\n bandspace,\n setdata,\n pathShape,\n panLinear,\n panLog,\n panPow,\n panSymlog,\n zoomLinear,\n zoomLog,\n zoomPow,\n zoomSymlog,\n encode,\n modify,\n lassoAppend,\n lassoPath,\n intersectLasso\n};\nconst eventFunctions = ['view', 'item', 'group', 'xy', 'x', 'y'],\n // event functions\n eventPrefix = 'event.vega.',\n // event function prefix\n thisPrefix = 'this.',\n // function context prefix\n astVisitors = {}; // AST visitors for dependency analysis\n\n// export code generator parameters\nconst codegenParams = {\n forbidden: ['_'],\n allowed: ['datum', 'event', 'item'],\n fieldvar: 'datum',\n globalvar: id => `_[${stringValue(SignalPrefix + id)}]`,\n functions: buildFunctions,\n constants: constants,\n visitors: astVisitors\n};\n\n// export code generator\nconst codeGenerator = codegenExpression(codegenParams);\n\n// Build expression function registry\nfunction buildFunctions(codegen) {\n const fn = functions(codegen);\n eventFunctions.forEach(name => fn[name] = eventPrefix + name);\n for (const name in functionContext) {\n fn[name] = thisPrefix + name;\n }\n extend(fn, internalScaleFunctions(codegen, functionContext, astVisitors));\n return fn;\n}\n\n// Register an expression function\nfunction expressionFunction(name, fn, visitor) {\n if (arguments.length === 1) {\n return functionContext[name];\n }\n\n // register with the functionContext\n functionContext[name] = fn;\n\n // if there is an astVisitor register that, too\n if (visitor) astVisitors[name] = visitor;\n\n // if the code generator has already been initialized,\n // we need to also register the function with it\n if (codeGenerator) codeGenerator.functions[name] = thisPrefix + name;\n return this;\n}\n\n// register expression functions with ast visitors\nexpressionFunction('bandwidth', bandwidth, scaleVisitor);\nexpressionFunction('copy', copy, scaleVisitor);\nexpressionFunction('domain', domain, scaleVisitor);\nexpressionFunction('range', range, scaleVisitor);\nexpressionFunction('invert', invert, scaleVisitor);\nexpressionFunction('scale', scale, scaleVisitor);\nexpressionFunction('gradient', scaleGradient, scaleVisitor);\nexpressionFunction('geoArea', geoArea, scaleVisitor);\nexpressionFunction('geoBounds', geoBounds, scaleVisitor);\nexpressionFunction('geoCentroid', geoCentroid, scaleVisitor);\nexpressionFunction('geoShape', geoShape, scaleVisitor);\nexpressionFunction('geoScale', geoScale, scaleVisitor);\nexpressionFunction('indata', indata, indataVisitor);\nexpressionFunction('data', data, dataVisitor);\nexpressionFunction('treePath', treePath, dataVisitor);\nexpressionFunction('treeAncestors', treeAncestors, dataVisitor);\n\n// register Vega-Lite selection functions\nexpressionFunction('vlSelectionTest', selectionTest, selectionVisitor);\nexpressionFunction('vlSelectionIdTest', selectionIdTest, selectionVisitor);\nexpressionFunction('vlSelectionResolve', selectionResolve, selectionVisitor);\nexpressionFunction('vlSelectionTuples', selectionTuples);\n\nfunction parser (expr, scope) {\n const params = {};\n\n // parse the expression to an abstract syntax tree (ast)\n let ast;\n try {\n expr = isString(expr) ? expr : stringValue(expr) + '';\n ast = parseExpression(expr);\n } catch (err) {\n error('Expression parse error: ' + expr);\n }\n\n // analyze ast function calls for dependencies\n ast.visit(node => {\n if (node.type !== CallExpression) return;\n const name = node.callee.name,\n visit = codegenParams.visitors[name];\n if (visit) visit(name, node.arguments, scope, params);\n });\n\n // perform code generation\n const gen = codeGenerator(ast);\n\n // collect signal dependencies\n gen.globals.forEach(name => {\n const signalName = SignalPrefix + name;\n if (!hasOwnProperty(params, signalName) && scope.getSignal(name)) {\n params[signalName] = scope.signalRef(name);\n }\n });\n\n // return generated expression code and dependencies\n return {\n $expr: extend({\n code: gen.code\n }, scope.options.ast ? {\n ast\n } : null),\n $fields: gen.fields,\n $params: params\n };\n}\n\nexport { DataPrefix, IndexPrefix, ScalePrefix, SignalPrefix, bandspace, bandwidth, codeGenerator, codegenParams, containerSize, contrast, copy, data, dataVisitor, dayAbbrevFormat, dayFormat, debug, domain, encode, expressionFunction, format, functionContext, geoArea, geoBounds, geoCentroid, geoScale, geoShape, inScope, indata, indataVisitor, indexof, info, invert, join, lastindexof, luminance, merge, modify, monthAbbrevFormat, monthFormat, parser as parseExpression, pathShape, pinchAngle, pinchDistance, pluck, range, replace, reverse, scale, scaleGradient, scaleVisitor, screen, setdata, slice, timeFormat, timeParse, treeAncestors, treePath, utcFormat, utcParse, warn, windowSize };\n","import { toSet, stringValue, error, isArray, isObject, hasOwnProperty, accessor, key, field, array, compare, truthy } from 'vega-util';\nimport { tupleid } from 'vega-dataflow';\n\n/**\n * Parse a serialized dataflow specification.\n */\nfunction parse (spec) {\n const ctx = this,\n operators = spec.operators || [];\n\n // parse background\n if (spec.background) {\n ctx.background = spec.background;\n }\n\n // parse event configuration\n if (spec.eventConfig) {\n ctx.eventConfig = spec.eventConfig;\n }\n\n // parse locale configuration\n if (spec.locale) {\n ctx.locale = spec.locale;\n }\n\n // parse operators\n operators.forEach(entry => ctx.parseOperator(entry));\n\n // parse operator parameters\n operators.forEach(entry => ctx.parseOperatorParameters(entry));\n\n // parse streams\n (spec.streams || []).forEach(entry => ctx.parseStream(entry));\n\n // parse updates\n (spec.updates || []).forEach(entry => ctx.parseUpdate(entry));\n return ctx.resolve();\n}\n\nconst Skip = toSet(['rule']),\n Swap = toSet(['group', 'image', 'rect']);\nfunction adjustSpatial(encode, marktype) {\n let code = '';\n if (Skip[marktype]) return code;\n if (encode.x2) {\n if (encode.x) {\n if (Swap[marktype]) {\n code += 'if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;';\n }\n code += 'o.width=o.x2-o.x;';\n } else {\n code += 'o.x=o.x2-(o.width||0);';\n }\n }\n if (encode.xc) {\n code += 'o.x=o.xc-(o.width||0)/2;';\n }\n if (encode.y2) {\n if (encode.y) {\n if (Swap[marktype]) {\n code += 'if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;';\n }\n code += 'o.height=o.y2-o.y;';\n } else {\n code += 'o.y=o.y2-(o.height||0);';\n }\n }\n if (encode.yc) {\n code += 'o.y=o.yc-(o.height||0)/2;';\n }\n return code;\n}\nfunction canonicalType(type) {\n return (type + '').toLowerCase();\n}\nfunction isOperator(type) {\n return canonicalType(type) === 'operator';\n}\nfunction isCollect(type) {\n return canonicalType(type) === 'collect';\n}\n\nfunction expression(ctx, args, code) {\n // wrap code in return statement if expression does not terminate\n if (!code.endsWith(';')) {\n code = 'return(' + code + ');';\n }\n const fn = Function(...args.concat(code));\n return ctx && ctx.functions ? fn.bind(ctx.functions) : fn;\n}\n\n// generate code for comparing a single field\nfunction _compare(u, v, lt, gt) {\n return `((u = ${u}) < (v = ${v}) || u == null) && v != null ? ${lt}\n : (u > v || v == null) && u != null ? ${gt}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${lt}\n : v !== v && u === u ? ${gt} : `;\n}\nvar expressionCodegen = {\n /**\n * Parse an expression used to update an operator value.\n */\n operator: (ctx, expr) => expression(ctx, ['_'], expr.code),\n /**\n * Parse an expression provided as an operator parameter value.\n */\n parameter: (ctx, expr) => expression(ctx, ['datum', '_'], expr.code),\n /**\n * Parse an expression applied to an event stream.\n */\n event: (ctx, expr) => expression(ctx, ['event'], expr.code),\n /**\n * Parse an expression used to handle an event-driven operator update.\n */\n handler: (ctx, expr) => {\n const code = `var datum=event.item&&event.item.datum;return ${expr.code};`;\n return expression(ctx, ['_', 'event'], code);\n },\n /**\n * Parse an expression that performs visual encoding.\n */\n encode: (ctx, encode) => {\n const {\n marktype,\n channels\n } = encode;\n let code = 'var o=item,datum=o.datum,m=0,$;';\n for (const name in channels) {\n const o = 'o[' + stringValue(name) + ']';\n code += `$=${channels[name].code};if(${o}!==$)${o}=$,m=1;`;\n }\n code += adjustSpatial(channels, marktype);\n code += 'return m;';\n return expression(ctx, ['item', '_'], code);\n },\n /**\n * Optimized code generators for access and comparison.\n */\n codegen: {\n get(path) {\n const ref = `[${path.map(stringValue).join('][')}]`;\n const get = Function('_', `return _${ref};`);\n get.path = ref;\n return get;\n },\n comparator(fields, orders) {\n let t;\n const map = (f, i) => {\n const o = orders[i];\n let u, v;\n if (f.path) {\n u = `a${f.path}`;\n v = `b${f.path}`;\n } else {\n (t = t || {})['f' + i] = f;\n u = `this.f${i}(a)`;\n v = `this.f${i}(b)`;\n }\n return _compare(u, v, -o, o);\n };\n const fn = Function('a', 'b', 'var u, v; return ' + fields.map(map).join('') + '0;');\n return t ? fn.bind(t) : fn;\n }\n }\n};\n\n/**\n * Parse a dataflow operator.\n */\nfunction parseOperator(spec) {\n const ctx = this;\n if (isOperator(spec.type) || !spec.type) {\n ctx.operator(spec, spec.update ? ctx.operatorExpression(spec.update) : null);\n } else {\n ctx.transform(spec, spec.type);\n }\n}\n\n/**\n * Parse and assign operator parameters.\n */\nfunction parseOperatorParameters(spec) {\n const ctx = this;\n if (spec.params) {\n const op = ctx.get(spec.id);\n if (!op) error('Invalid operator id: ' + spec.id);\n ctx.dataflow.connect(op, op.parameters(ctx.parseParameters(spec.params), spec.react, spec.initonly));\n }\n}\n\n/**\n * Parse a set of operator parameters.\n */\nfunction parseParameters(spec, params) {\n params = params || {};\n const ctx = this;\n for (const key in spec) {\n const value = spec[key];\n params[key] = isArray(value) ? value.map(v => parseParameter(v, ctx, params)) : parseParameter(value, ctx, params);\n }\n return params;\n}\n\n/**\n * Parse a single parameter.\n */\nfunction parseParameter(spec, ctx, params) {\n if (!spec || !isObject(spec)) return spec;\n for (let i = 0, n = PARSERS.length, p; i < n; ++i) {\n p = PARSERS[i];\n if (hasOwnProperty(spec, p.key)) {\n return p.parse(spec, ctx, params);\n }\n }\n return spec;\n}\n\n/** Reference parsers. */\nvar PARSERS = [{\n key: '$ref',\n parse: getOperator\n}, {\n key: '$key',\n parse: getKey\n}, {\n key: '$expr',\n parse: getExpression\n}, {\n key: '$field',\n parse: getField\n}, {\n key: '$encode',\n parse: getEncode\n}, {\n key: '$compare',\n parse: getCompare\n}, {\n key: '$context',\n parse: getContext\n}, {\n key: '$subflow',\n parse: getSubflow\n}, {\n key: '$tupleid',\n parse: getTupleId\n}];\n\n/**\n * Resolve an operator reference.\n */\nfunction getOperator(_, ctx) {\n return ctx.get(_.$ref) || error('Operator not defined: ' + _.$ref);\n}\n\n/**\n * Resolve an expression reference.\n */\nfunction getExpression(_, ctx, params) {\n if (_.$params) {\n // parse expression parameters\n ctx.parseParameters(_.$params, params);\n }\n const k = 'e:' + _.$expr.code;\n return ctx.fn[k] || (ctx.fn[k] = accessor(ctx.parameterExpression(_.$expr), _.$fields));\n}\n\n/**\n * Resolve a key accessor reference.\n */\nfunction getKey(_, ctx) {\n const k = 'k:' + _.$key + '_' + !!_.$flat;\n return ctx.fn[k] || (ctx.fn[k] = key(_.$key, _.$flat, ctx.expr.codegen));\n}\n\n/**\n * Resolve a field accessor reference.\n */\nfunction getField(_, ctx) {\n if (!_.$field) return null;\n const k = 'f:' + _.$field + '_' + _.$name;\n return ctx.fn[k] || (ctx.fn[k] = field(_.$field, _.$name, ctx.expr.codegen));\n}\n\n/**\n * Resolve a comparator function reference.\n */\nfunction getCompare(_, ctx) {\n // As of Vega 5.5.3, $tupleid sort is no longer used.\n // Keep here for now for backwards compatibility.\n const k = 'c:' + _.$compare + '_' + _.$order,\n c = array(_.$compare).map(_ => _ && _.$tupleid ? tupleid : _);\n return ctx.fn[k] || (ctx.fn[k] = compare(c, _.$order, ctx.expr.codegen));\n}\n\n/**\n * Resolve an encode operator reference.\n */\nfunction getEncode(_, ctx) {\n const spec = _.$encode,\n encode = {};\n for (const name in spec) {\n const enc = spec[name];\n encode[name] = accessor(ctx.encodeExpression(enc.$expr), enc.$fields);\n encode[name].output = enc.$output;\n }\n return encode;\n}\n\n/**\n * Resolve a context reference.\n */\nfunction getContext(_, ctx) {\n return ctx;\n}\n\n/**\n * Resolve a recursive subflow specification.\n */\nfunction getSubflow(_, ctx) {\n const spec = _.$subflow;\n return function (dataflow, key, parent) {\n const subctx = ctx.fork().parse(spec),\n op = subctx.get(spec.operators[0].id),\n p = subctx.signals.parent;\n if (p) p.set(parent);\n op.detachSubflow = () => ctx.detach(subctx);\n return op;\n };\n}\n\n/**\n * Resolve a tuple id reference.\n */\nfunction getTupleId() {\n return tupleid;\n}\n\n/**\n * Parse an event stream specification.\n */\nfunction parseStream (spec) {\n var ctx = this,\n filter = spec.filter != null ? ctx.eventExpression(spec.filter) : undefined,\n stream = spec.stream != null ? ctx.get(spec.stream) : undefined,\n args;\n if (spec.source) {\n stream = ctx.events(spec.source, spec.type, filter);\n } else if (spec.merge) {\n args = spec.merge.map(_ => ctx.get(_));\n stream = args[0].merge.apply(args[0], args.slice(1));\n }\n if (spec.between) {\n args = spec.between.map(_ => ctx.get(_));\n stream = stream.between(args[0], args[1]);\n }\n if (spec.filter) {\n stream = stream.filter(filter);\n }\n if (spec.throttle != null) {\n stream = stream.throttle(+spec.throttle);\n }\n if (spec.debounce != null) {\n stream = stream.debounce(+spec.debounce);\n }\n if (stream == null) {\n error('Invalid stream definition: ' + JSON.stringify(spec));\n }\n if (spec.consume) stream.consume(true);\n ctx.stream(spec, stream);\n}\n\n/**\n * Parse an event-driven operator update.\n */\nfunction parseUpdate (spec) {\n var ctx = this,\n srcid = isObject(srcid = spec.source) ? srcid.$ref : srcid,\n source = ctx.get(srcid),\n target = null,\n update = spec.update,\n params = undefined;\n if (!source) error('Source not defined: ' + spec.source);\n target = spec.target && spec.target.$expr ? ctx.eventExpression(spec.target.$expr) : ctx.get(spec.target);\n if (update && update.$expr) {\n if (update.$params) {\n params = ctx.parseParameters(update.$params);\n }\n update = ctx.handlerExpression(update.$expr);\n }\n ctx.update(spec, source, target, update, params);\n}\n\nconst SKIP = {\n skip: true\n};\nfunction getState(options) {\n var ctx = this,\n state = {};\n if (options.signals) {\n var signals = state.signals = {};\n Object.keys(ctx.signals).forEach(key => {\n const op = ctx.signals[key];\n if (options.signals(key, op)) {\n signals[key] = op.value;\n }\n });\n }\n if (options.data) {\n var data = state.data = {};\n Object.keys(ctx.data).forEach(key => {\n const dataset = ctx.data[key];\n if (options.data(key, dataset)) {\n data[key] = dataset.input.value;\n }\n });\n }\n if (ctx.subcontext && options.recurse !== false) {\n state.subcontext = ctx.subcontext.map(ctx => ctx.getState(options));\n }\n return state;\n}\nfunction setState(state) {\n var ctx = this,\n df = ctx.dataflow,\n data = state.data,\n signals = state.signals;\n Object.keys(signals || {}).forEach(key => {\n df.update(ctx.signals[key], signals[key], SKIP);\n });\n Object.keys(data || {}).forEach(key => {\n df.pulse(ctx.data[key].input, df.changeset().remove(truthy).insert(data[key]));\n });\n (state.subcontext || []).forEach((substate, i) => {\n const subctx = ctx.subcontext[i];\n if (subctx) subctx.setState(substate);\n });\n}\n\n/**\n * Context objects store the current parse state.\n * Enables lookup of parsed operators, event streams, accessors, etc.\n * Provides a 'fork' method for creating child contexts for subflows.\n */\nfunction context (df, transforms, functions, expr) {\n return new Context(df, transforms, functions, expr);\n}\nfunction Context(df, transforms, functions, expr) {\n this.dataflow = df;\n this.transforms = transforms;\n this.events = df.events.bind(df);\n this.expr = expr || expressionCodegen, this.signals = {};\n this.scales = {};\n this.nodes = {};\n this.data = {};\n this.fn = {};\n if (functions) {\n this.functions = Object.create(functions);\n this.functions.context = this;\n }\n}\nfunction Subcontext(ctx) {\n this.dataflow = ctx.dataflow;\n this.transforms = ctx.transforms;\n this.events = ctx.events;\n this.expr = ctx.expr;\n this.signals = Object.create(ctx.signals);\n this.scales = Object.create(ctx.scales);\n this.nodes = Object.create(ctx.nodes);\n this.data = Object.create(ctx.data);\n this.fn = Object.create(ctx.fn);\n if (ctx.functions) {\n this.functions = Object.create(ctx.functions);\n this.functions.context = this;\n }\n}\nContext.prototype = Subcontext.prototype = {\n fork() {\n const ctx = new Subcontext(this);\n (this.subcontext || (this.subcontext = [])).push(ctx);\n return ctx;\n },\n detach(ctx) {\n this.subcontext = this.subcontext.filter(c => c !== ctx);\n\n // disconnect all nodes in the subcontext\n // wipe out targets first for better efficiency\n const keys = Object.keys(ctx.nodes);\n for (const key of keys) ctx.nodes[key]._targets = null;\n for (const key of keys) ctx.nodes[key].detach();\n ctx.nodes = null;\n },\n get(id) {\n return this.nodes[id];\n },\n set(id, node) {\n return this.nodes[id] = node;\n },\n add(spec, op) {\n const ctx = this,\n df = ctx.dataflow,\n data = spec.value;\n ctx.set(spec.id, op);\n if (isCollect(spec.type) && data) {\n if (data.$ingest) {\n df.ingest(op, data.$ingest, data.$format);\n } else if (data.$request) {\n df.preload(op, data.$request, data.$format);\n } else {\n df.pulse(op, df.changeset().insert(data));\n }\n }\n if (spec.root) {\n ctx.root = op;\n }\n if (spec.parent) {\n let p = ctx.get(spec.parent.$ref);\n if (p) {\n df.connect(p, [op]);\n op.targets().add(p);\n } else {\n (ctx.unresolved = ctx.unresolved || []).push(() => {\n p = ctx.get(spec.parent.$ref);\n df.connect(p, [op]);\n op.targets().add(p);\n });\n }\n }\n if (spec.signal) {\n ctx.signals[spec.signal] = op;\n }\n if (spec.scale) {\n ctx.scales[spec.scale] = op;\n }\n if (spec.data) {\n for (const name in spec.data) {\n const data = ctx.data[name] || (ctx.data[name] = {});\n spec.data[name].forEach(role => data[role] = op);\n }\n }\n },\n resolve() {\n (this.unresolved || []).forEach(fn => fn());\n delete this.unresolved;\n return this;\n },\n operator(spec, update) {\n this.add(spec, this.dataflow.add(spec.value, update));\n },\n transform(spec, type) {\n this.add(spec, this.dataflow.add(this.transforms[canonicalType(type)]));\n },\n stream(spec, stream) {\n this.set(spec.id, stream);\n },\n update(spec, stream, target, update, params) {\n this.dataflow.on(stream, target, update, params, spec.options);\n },\n // expression parsing\n operatorExpression(expr) {\n return this.expr.operator(this, expr);\n },\n parameterExpression(expr) {\n return this.expr.parameter(this, expr);\n },\n eventExpression(expr) {\n return this.expr.event(this, expr);\n },\n handlerExpression(expr) {\n return this.expr.handler(this, expr);\n },\n encodeExpression(encode) {\n return this.expr.encode(this, encode);\n },\n // parse methods\n parse,\n parseOperator,\n parseOperatorParameters,\n parseParameters,\n parseStream,\n parseUpdate,\n // state methods\n getState,\n setState\n};\n\nexport { context };\n","import { isString, hasOwnProperty, error, truthy, constant, extend, array, isObject, isArray, toSet, debounce, isDate, inherits, stringValue } from 'vega-util';\nimport { changeset, isChangeSet, EventStream, transforms, Dataflow, asyncCallback } from 'vega-dataflow';\nimport { point, renderModule, CanvasHandler, RenderType, Scenegraph } from 'vega-scenegraph';\nimport { tickStep } from 'd3-array';\nimport { functionContext } from 'vega-functions';\nimport { context } from 'vega-runtime';\nimport { interval } from 'd3-timer';\nimport { locale } from 'vega-format';\n\n// initialize aria role and label attributes\nfunction initializeAria(view) {\n const el = view.container();\n if (el) {\n el.setAttribute('role', 'graphics-document');\n el.setAttribute('aria-roleDescription', 'visualization');\n ariaLabel(el, view.description());\n }\n}\n\n// update aria-label if we have a DOM container element\nfunction ariaLabel(el, desc) {\n if (el) desc == null ? el.removeAttribute('aria-label') : el.setAttribute('aria-label', desc);\n}\n\nfunction background (view) {\n // respond to background signal\n view.add(null, _ => {\n view._background = _.bg;\n view._resize = 1;\n return _.bg;\n }, {\n bg: view._signals.background\n });\n}\n\nconst Default = 'default';\nfunction cursor (view) {\n // get cursor signal, add to dataflow if needed\n const cursor = view._signals.cursor || (view._signals.cursor = view.add({\n user: Default,\n item: null\n }));\n\n // evaluate cursor on each pointermove event\n view.on(view.events('view', 'pointermove'), cursor, (_, event) => {\n const value = cursor.value,\n user = value ? isString(value) ? value : value.user : Default,\n item = event.item && event.item.cursor || null;\n return value && user === value.user && item == value.item ? value : {\n user: user,\n item: item\n };\n });\n\n // when cursor signal updates, set visible cursor\n view.add(null, function (_) {\n let user = _.cursor,\n item = this.value;\n if (!isString(user)) {\n item = user.item;\n user = user.user;\n }\n setCursor(view, user && user !== Default ? user : item || user);\n return item;\n }, {\n cursor: cursor\n });\n}\nfunction setCursor(view, cursor) {\n const el = view.globalCursor() ? typeof document !== 'undefined' && document.body : view.container();\n if (el) {\n return cursor == null ? el.style.removeProperty('cursor') : el.style.cursor = cursor;\n }\n}\n\nfunction dataref(view, name) {\n var data = view._runtime.data;\n if (!hasOwnProperty(data, name)) {\n error('Unrecognized data set: ' + name);\n }\n return data[name];\n}\nfunction data(name, values) {\n return arguments.length < 2 ? dataref(this, name).values.value : change.call(this, name, changeset().remove(truthy).insert(values));\n}\nfunction change(name, changes) {\n if (!isChangeSet(changes)) {\n error('Second argument to changes must be a changeset.');\n }\n const dataset = dataref(this, name);\n dataset.modified = true;\n return this.pulse(dataset.input, changes);\n}\nfunction insert(name, _) {\n return change.call(this, name, changeset().insert(_));\n}\nfunction remove(name, _) {\n return change.call(this, name, changeset().remove(_));\n}\n\nfunction width(view) {\n var padding = view.padding();\n return Math.max(0, view._viewWidth + padding.left + padding.right);\n}\nfunction height(view) {\n var padding = view.padding();\n return Math.max(0, view._viewHeight + padding.top + padding.bottom);\n}\nfunction offset(view) {\n var padding = view.padding(),\n origin = view._origin;\n return [padding.left + origin[0], padding.top + origin[1]];\n}\nfunction resizeRenderer(view) {\n var origin = offset(view),\n w = width(view),\n h = height(view);\n view._renderer.background(view.background());\n view._renderer.resize(w, h, origin);\n view._handler.origin(origin);\n view._resizeListeners.forEach(handler => {\n try {\n handler(w, h);\n } catch (error) {\n view.error(error);\n }\n });\n}\n\n/**\n * Extend an event with additional view-specific methods.\n * Adds a new property ('vega') to an event that provides a number\n * of methods for querying information about the current interaction.\n * The vega object provides the following methods:\n * view - Returns the backing View instance.\n * item - Returns the currently active scenegraph item (if any).\n * group - Returns the currently active scenegraph group (if any).\n * This method accepts a single string-typed argument indicating the name\n * of the desired parent group. The scenegraph will be traversed from\n * the item up towards the root to search for a matching group. If no\n * argument is provided the enclosing group for the active item is\n * returned, unless the item it itself a group, in which case it is\n * returned directly.\n * xy - Returns a two-element array containing the x and y coordinates for\n * mouse or touch events. For touch events, this is based on the first\n * elements in the changedTouches array. This method accepts a single\n * argument: either an item instance or mark name that should serve as\n * the reference coordinate system. If no argument is provided the\n * top-level view coordinate system is assumed.\n * x - Returns the current x-coordinate, accepts the same arguments as xy.\n * y - Returns the current y-coordinate, accepts the same arguments as xy.\n * @param {Event} event - The input event to extend.\n * @param {Item} item - The currently active scenegraph item (if any).\n * @return {Event} - The extended input event.\n */\nfunction eventExtend (view, event, item) {\n var r = view._renderer,\n el = r && r.canvas(),\n p,\n e,\n translate;\n if (el) {\n translate = offset(view);\n e = event.changedTouches ? event.changedTouches[0] : event;\n p = point(e, el);\n p[0] -= translate[0];\n p[1] -= translate[1];\n }\n event.dataflow = view;\n event.item = item;\n event.vega = extension(view, item, p);\n return event;\n}\nfunction extension(view, item, point) {\n const itemGroup = item ? item.mark.marktype === 'group' ? item : item.mark.group : null;\n function group(name) {\n var g = itemGroup,\n i;\n if (name) for (i = item; i; i = i.mark.group) {\n if (i.mark.name === name) {\n g = i;\n break;\n }\n }\n return g && g.mark && g.mark.interactive ? g : {};\n }\n function xy(item) {\n if (!item) return point;\n if (isString(item)) item = group(item);\n const p = point.slice();\n while (item) {\n p[0] -= item.x || 0;\n p[1] -= item.y || 0;\n item = item.mark && item.mark.group;\n }\n return p;\n }\n return {\n view: constant(view),\n item: constant(item || {}),\n group: group,\n xy: xy,\n x: item => xy(item)[0],\n y: item => xy(item)[1]\n };\n}\n\nconst VIEW = 'view',\n TIMER = 'timer',\n WINDOW = 'window',\n NO_TRAP = {\n trap: false\n };\n\n/**\n * Initialize event handling configuration.\n * @param {object} config - The configuration settings.\n * @return {object}\n */\nfunction initializeEventConfig(config) {\n const events = extend({\n defaults: {}\n }, config);\n const unpack = (obj, keys) => {\n keys.forEach(k => {\n if (isArray(obj[k])) obj[k] = toSet(obj[k]);\n });\n };\n unpack(events.defaults, ['prevent', 'allow']);\n unpack(events, ['view', 'window', 'selector']);\n return events;\n}\nfunction trackEventListener(view, sources, type, handler) {\n view._eventListeners.push({\n type: type,\n sources: array(sources),\n handler: handler\n });\n}\nfunction prevent(view, type) {\n var def = view._eventConfig.defaults,\n prevent = def.prevent,\n allow = def.allow;\n return prevent === false || allow === true ? false : prevent === true || allow === false ? true : prevent ? prevent[type] : allow ? !allow[type] : view.preventDefault();\n}\nfunction permit(view, key, type) {\n const rule = view._eventConfig && view._eventConfig[key];\n if (rule === false || isObject(rule) && !rule[type]) {\n view.warn(`Blocked ${key} ${type} event listener.`);\n return false;\n }\n return true;\n}\n\n/**\n * Create a new event stream from an event source.\n * @param {object} source - The event source to monitor.\n * @param {string} type - The event type.\n * @param {function(object): boolean} [filter] - Event filter function.\n * @return {EventStream}\n */\nfunction events(source, type, filter) {\n var view = this,\n s = new EventStream(filter),\n send = function (e, item) {\n view.runAsync(null, () => {\n if (source === VIEW && prevent(view, type)) {\n e.preventDefault();\n }\n s.receive(eventExtend(view, e, item));\n });\n },\n sources;\n if (source === TIMER) {\n if (permit(view, 'timer', type)) {\n view.timer(send, type);\n }\n } else if (source === VIEW) {\n if (permit(view, 'view', type)) {\n // send traps errors, so use {trap: false} option\n view.addEventListener(type, send, NO_TRAP);\n }\n } else {\n if (source === WINDOW) {\n if (permit(view, 'window', type) && typeof window !== 'undefined') {\n sources = [window];\n }\n } else if (typeof document !== 'undefined') {\n if (permit(view, 'selector', type)) {\n sources = Array.from(document.querySelectorAll(source));\n }\n }\n if (!sources) {\n view.warn('Can not resolve event source: ' + source);\n } else {\n for (var i = 0, n = sources.length; i < n; ++i) {\n sources[i].addEventListener(type, send);\n }\n trackEventListener(view, sources, type, send);\n }\n }\n return s;\n}\n\nfunction itemFilter(event) {\n return event.item;\n}\nfunction markTarget(event) {\n // grab upstream collector feeding the mark operator\n return event.item.mark.source;\n}\nfunction invoke(name) {\n return function (_, event) {\n return event.vega.view().changeset().encode(event.item, name);\n };\n}\nfunction hover (hoverSet, leaveSet) {\n hoverSet = [hoverSet || 'hover'];\n leaveSet = [leaveSet || 'update', hoverSet[0]];\n\n // invoke hover set upon pointerover\n this.on(this.events('view', 'pointerover', itemFilter), markTarget, invoke(hoverSet));\n\n // invoke leave set upon pointerout\n this.on(this.events('view', 'pointerout', itemFilter), markTarget, invoke(leaveSet));\n return this;\n}\n\n/**\n * Finalize a View instance that is being removed.\n * Cancel any running timers.\n * Remove all external event listeners.\n * Remove any currently displayed tooltip.\n */\nfunction finalize () {\n var tooltip = this._tooltip,\n timers = this._timers,\n handlers = this._handler.handlers(),\n listeners = this._eventListeners,\n n,\n m,\n e,\n h,\n t;\n n = timers.length;\n while (--n >= 0) {\n timers[n].stop();\n }\n n = listeners.length;\n while (--n >= 0) {\n e = listeners[n];\n m = e.sources.length;\n while (--m >= 0) {\n e.sources[m].removeEventListener(e.type, e.handler);\n }\n }\n if (tooltip) {\n tooltip.call(this, this._handler, null, null, null);\n }\n\n // turn off all registered handlers\n n = handlers.length;\n while (--n >= 0) {\n t = handlers[n].type;\n h = handlers[n].handler;\n this._handler.off(t, h);\n }\n return this;\n}\n\nfunction element (tag, attr, text) {\n const el = document.createElement(tag);\n for (const key in attr) el.setAttribute(key, attr[key]);\n if (text != null) el.textContent = text;\n return el;\n}\n\nconst BindClass = 'vega-bind',\n NameClass = 'vega-bind-name',\n RadioClass = 'vega-bind-radio';\n\n/**\n * Bind a signal to an external HTML input element. The resulting two-way\n * binding will propagate input changes to signals, and propagate signal\n * changes to the input element state. If this view instance has no parent\n * element, we assume the view is headless and no bindings are created.\n * @param {Element|string} el - The parent DOM element to which the input\n * element should be appended as a child. If string-valued, this argument\n * will be treated as a CSS selector. If null or undefined, the parent\n * element of this view will be used as the element.\n * @param {object} param - The binding parameters which specify the signal\n * to bind to, the input element type, and type-specific configuration.\n * @return {View} - This view instance.\n */\nfunction bind (view, el, binding) {\n if (!el) return;\n const param = binding.param;\n let bind = binding.state;\n if (!bind) {\n bind = binding.state = {\n elements: null,\n active: false,\n set: null,\n update: value => {\n if (value != view.signal(param.signal)) {\n view.runAsync(null, () => {\n bind.source = true;\n view.signal(param.signal, value);\n });\n }\n }\n };\n if (param.debounce) {\n bind.update = debounce(param.debounce, bind.update);\n }\n }\n const create = param.input == null && param.element ? target : generate;\n create(bind, el, param, view);\n if (!bind.active) {\n view.on(view._signals[param.signal], null, () => {\n bind.source ? bind.source = false : bind.set(view.signal(param.signal));\n });\n bind.active = true;\n }\n return bind;\n}\n\n/**\n * Bind the signal to an external EventTarget.\n */\nfunction target(bind, node, param, view) {\n const type = param.event || 'input';\n const handler = () => bind.update(node.value);\n\n // initialize signal value to external input value\n view.signal(param.signal, node.value);\n\n // listen for changes on the element\n node.addEventListener(type, handler);\n\n // register with view, so we can remove it upon finalization\n trackEventListener(view, node, type, handler);\n\n // propagate change to element\n bind.set = value => {\n node.value = value;\n node.dispatchEvent(event(type));\n };\n}\nfunction event(type) {\n return typeof Event !== 'undefined' ? new Event(type) : {\n type\n };\n}\n\n/**\n * Generate an HTML input form element and bind it to a signal.\n */\nfunction generate(bind, el, param, view) {\n const value = view.signal(param.signal);\n const div = element('div', {\n 'class': BindClass\n });\n const wrapper = param.input === 'radio' ? div : div.appendChild(element('label'));\n wrapper.appendChild(element('span', {\n 'class': NameClass\n }, param.name || param.signal));\n el.appendChild(div);\n let input = form;\n switch (param.input) {\n case 'checkbox':\n input = checkbox;\n break;\n case 'select':\n input = select;\n break;\n case 'radio':\n input = radio;\n break;\n case 'range':\n input = range;\n break;\n }\n input(bind, wrapper, param, value);\n}\n\n/**\n * Generates an arbitrary input form element.\n * The input type is controlled via user-provided parameters.\n */\nfunction form(bind, el, param, value) {\n const node = element('input');\n for (const key in param) {\n if (key !== 'signal' && key !== 'element') {\n node.setAttribute(key === 'input' ? 'type' : key, param[key]);\n }\n }\n node.setAttribute('name', param.signal);\n node.value = value;\n el.appendChild(node);\n node.addEventListener('input', () => bind.update(node.value));\n bind.elements = [node];\n bind.set = value => node.value = value;\n}\n\n/**\n * Generates a checkbox input element.\n */\nfunction checkbox(bind, el, param, value) {\n const attr = {\n type: 'checkbox',\n name: param.signal\n };\n if (value) attr.checked = true;\n const node = element('input', attr);\n el.appendChild(node);\n node.addEventListener('change', () => bind.update(node.checked));\n bind.elements = [node];\n bind.set = value => node.checked = !!value || null;\n}\n\n/**\n * Generates a selection list input element.\n */\nfunction select(bind, el, param, value) {\n const node = element('select', {\n name: param.signal\n }),\n labels = param.labels || [];\n param.options.forEach((option, i) => {\n const attr = {\n value: option\n };\n if (valuesEqual(option, value)) attr.selected = true;\n node.appendChild(element('option', attr, (labels[i] || option) + ''));\n });\n el.appendChild(node);\n node.addEventListener('change', () => {\n bind.update(param.options[node.selectedIndex]);\n });\n bind.elements = [node];\n bind.set = value => {\n for (let i = 0, n = param.options.length; i < n; ++i) {\n if (valuesEqual(param.options[i], value)) {\n node.selectedIndex = i;\n return;\n }\n }\n };\n}\n\n/**\n * Generates a radio button group.\n */\nfunction radio(bind, el, param, value) {\n const group = element('span', {\n 'class': RadioClass\n }),\n labels = param.labels || [];\n el.appendChild(group);\n bind.elements = param.options.map((option, i) => {\n const attr = {\n type: 'radio',\n name: param.signal,\n value: option\n };\n if (valuesEqual(option, value)) attr.checked = true;\n const input = element('input', attr);\n input.addEventListener('change', () => bind.update(option));\n const label = element('label', {}, (labels[i] || option) + '');\n label.prepend(input);\n group.appendChild(label);\n return input;\n });\n bind.set = value => {\n const nodes = bind.elements,\n n = nodes.length;\n for (let i = 0; i < n; ++i) {\n if (valuesEqual(nodes[i].value, value)) nodes[i].checked = true;\n }\n };\n}\n\n/**\n * Generates a slider input element.\n */\nfunction range(bind, el, param, value) {\n value = value !== undefined ? value : (+param.max + +param.min) / 2;\n const max = param.max != null ? param.max : Math.max(100, +value) || 100,\n min = param.min || Math.min(0, max, +value) || 0,\n step = param.step || tickStep(min, max, 100);\n const node = element('input', {\n type: 'range',\n name: param.signal,\n min: min,\n max: max,\n step: step\n });\n node.value = value;\n const span = element('span', {}, +value);\n el.appendChild(node);\n el.appendChild(span);\n const update = () => {\n span.textContent = node.value;\n bind.update(+node.value);\n };\n\n // subscribe to both input and change\n node.addEventListener('input', update);\n node.addEventListener('change', update);\n bind.elements = [node];\n bind.set = value => {\n node.value = value;\n span.textContent = value;\n };\n}\nfunction valuesEqual(a, b) {\n return a === b || a + '' === b + '';\n}\n\nfunction initializeRenderer (view, r, el, constructor, scaleFactor, opt) {\n r = r || new constructor(view.loader());\n return r.initialize(el, width(view), height(view), offset(view), scaleFactor, opt).background(view.background());\n}\n\nfunction trap (view, fn) {\n return !fn ? null : function () {\n try {\n fn.apply(this, arguments);\n } catch (error) {\n view.error(error);\n }\n };\n}\n\nfunction initializeHandler (view, prevHandler, el, constructor) {\n // instantiate scenegraph handler\n const handler = new constructor(view.loader(), trap(view, view.tooltip())).scene(view.scenegraph().root).initialize(el, offset(view), view);\n\n // transfer event handlers\n if (prevHandler) {\n prevHandler.handlers().forEach(h => {\n handler.on(h.type, h.handler);\n });\n }\n return handler;\n}\n\nfunction initialize (el, elBind) {\n const view = this,\n type = view._renderType,\n config = view._eventConfig.bind,\n module = renderModule(type);\n\n // containing dom element\n el = view._el = el ? lookup(view, el, true) : null;\n\n // initialize aria attributes\n initializeAria(view);\n\n // select appropriate renderer & handler\n if (!module) view.error('Unrecognized renderer type: ' + type);\n const Handler = module.handler || CanvasHandler,\n Renderer = el ? module.renderer : module.headless;\n\n // initialize renderer and input handler\n view._renderer = !Renderer ? null : initializeRenderer(view, view._renderer, el, Renderer);\n view._handler = initializeHandler(view, view._handler, el, Handler);\n view._redraw = true;\n\n // initialize signal bindings\n if (el && config !== 'none') {\n elBind = elBind ? view._elBind = lookup(view, elBind, true) : el.appendChild(element('form', {\n 'class': 'vega-bindings'\n }));\n view._bind.forEach(_ => {\n if (_.param.element && config !== 'container') {\n _.element = lookup(view, _.param.element, !!_.param.input);\n }\n });\n view._bind.forEach(_ => {\n bind(view, _.element || elBind, _);\n });\n }\n return view;\n}\nfunction lookup(view, el, clear) {\n if (typeof el === 'string') {\n if (typeof document !== 'undefined') {\n el = document.querySelector(el);\n if (!el) {\n view.error('Signal bind element not found: ' + el);\n return null;\n }\n } else {\n view.error('DOM document instance not found.');\n return null;\n }\n }\n if (el && clear) {\n try {\n el.textContent = '';\n } catch (e) {\n el = null;\n view.error(e);\n }\n }\n return el;\n}\n\nconst number = _ => +_ || 0;\nconst paddingObject = _ => ({\n top: _,\n bottom: _,\n left: _,\n right: _\n});\nfunction padding (_) {\n return isObject(_) ? {\n top: number(_.top),\n bottom: number(_.bottom),\n left: number(_.left),\n right: number(_.right)\n } : paddingObject(number(_));\n}\n\n/**\n * Render the current scene in a headless fashion.\n * This method is asynchronous, returning a Promise instance.\n * @return {Promise} - A Promise that resolves to a renderer.\n */\nasync function renderHeadless (view, type, scaleFactor, opt) {\n const module = renderModule(type),\n ctr = module && module.headless;\n if (!ctr) error('Unrecognized renderer type: ' + type);\n await view.runAsync();\n return initializeRenderer(view, null, null, ctr, scaleFactor, opt).renderAsync(view._scenegraph.root);\n}\n\n/**\n * Produce an image URL for the visualization. Depending on the type\n * parameter, the generated URL contains data for either a PNG or SVG image.\n * The URL can be used (for example) to download images of the visualization.\n * This method is asynchronous, returning a Promise instance.\n * @param {string} type - The image type. One of 'svg', 'png' or 'canvas'.\n * The 'canvas' and 'png' types are synonyms for a PNG image.\n * @return {Promise} - A promise that resolves to an image URL.\n */\nasync function renderToImageURL (type, scaleFactor) {\n if (type !== RenderType.Canvas && type !== RenderType.SVG && type !== RenderType.PNG) {\n error('Unrecognized image type: ' + type);\n }\n const r = await renderHeadless(this, type, scaleFactor);\n return type === RenderType.SVG ? toBlobURL(r.svg(), 'image/svg+xml') : r.canvas().toDataURL('image/png');\n}\nfunction toBlobURL(data, mime) {\n const blob = new Blob([data], {\n type: mime\n });\n return window.URL.createObjectURL(blob);\n}\n\n/**\n * Produce a Canvas instance containing a rendered visualization.\n * This method is asynchronous, returning a Promise instance.\n * @return {Promise} - A promise that resolves to a Canvas instance.\n */\nasync function renderToCanvas (scaleFactor, opt) {\n const r = await renderHeadless(this, RenderType.Canvas, scaleFactor, opt);\n return r.canvas();\n}\n\n/**\n * Produce a rendered SVG string of the visualization.\n * This method is asynchronous, returning a Promise instance.\n * @return {Promise} - A promise that resolves to an SVG string.\n */\nasync function renderToSVG (scaleFactor) {\n const r = await renderHeadless(this, RenderType.SVG, scaleFactor);\n return r.svg();\n}\n\nfunction runtime (view, spec, expr) {\n return context(view, transforms, functionContext, expr).parse(spec);\n}\n\nfunction scale(name) {\n var scales = this._runtime.scales;\n if (!hasOwnProperty(scales, name)) {\n error('Unrecognized scale or projection: ' + name);\n }\n return scales[name].value;\n}\n\nvar Width = 'width',\n Height = 'height',\n Padding = 'padding',\n Skip = {\n skip: true\n };\nfunction viewWidth(view, width) {\n var a = view.autosize(),\n p = view.padding();\n return width - (a && a.contains === Padding ? p.left + p.right : 0);\n}\nfunction viewHeight(view, height) {\n var a = view.autosize(),\n p = view.padding();\n return height - (a && a.contains === Padding ? p.top + p.bottom : 0);\n}\nfunction initializeResize(view) {\n var s = view._signals,\n w = s[Width],\n h = s[Height],\n p = s[Padding];\n function resetSize() {\n view._autosize = view._resize = 1;\n }\n\n // respond to width signal\n view._resizeWidth = view.add(null, _ => {\n view._width = _.size;\n view._viewWidth = viewWidth(view, _.size);\n resetSize();\n }, {\n size: w\n });\n\n // respond to height signal\n view._resizeHeight = view.add(null, _ => {\n view._height = _.size;\n view._viewHeight = viewHeight(view, _.size);\n resetSize();\n }, {\n size: h\n });\n\n // respond to padding signal\n const resizePadding = view.add(null, resetSize, {\n pad: p\n });\n\n // set rank to run immediately after source signal\n view._resizeWidth.rank = w.rank + 1;\n view._resizeHeight.rank = h.rank + 1;\n resizePadding.rank = p.rank + 1;\n}\nfunction resizeView(viewWidth, viewHeight, width, height, origin, auto) {\n this.runAfter(view => {\n let rerun = 0;\n\n // reset autosize flag\n view._autosize = 0;\n\n // width value changed: update signal, skip resize op\n if (view.width() !== width) {\n rerun = 1;\n view.signal(Width, width, Skip); // set width, skip update calc\n view._resizeWidth.skip(true); // skip width resize handler\n }\n\n // height value changed: update signal, skip resize op\n if (view.height() !== height) {\n rerun = 1;\n view.signal(Height, height, Skip); // set height, skip update calc\n view._resizeHeight.skip(true); // skip height resize handler\n }\n\n // view width changed: update view property, set resize flag\n if (view._viewWidth !== viewWidth) {\n view._resize = 1;\n view._viewWidth = viewWidth;\n }\n\n // view height changed: update view property, set resize flag\n if (view._viewHeight !== viewHeight) {\n view._resize = 1;\n view._viewHeight = viewHeight;\n }\n\n // origin changed: update view property, set resize flag\n if (view._origin[0] !== origin[0] || view._origin[1] !== origin[1]) {\n view._resize = 1;\n view._origin = origin;\n }\n\n // run dataflow on width/height signal change\n if (rerun) view.run('enter');\n if (auto) view.runAfter(v => v.resize());\n }, false, 1);\n}\n\n/**\n * Get the current view state, consisting of signal values and/or data sets.\n * @param {object} [options] - Options flags indicating which state to export.\n * If unspecified, all signals and data sets will be exported.\n * @param {function(string, Operator):boolean} [options.signals] - Optional\n * predicate function for testing if a signal should be included in the\n * exported state. If unspecified, all signals will be included, except for\n * those named 'parent' or those which refer to a Transform value.\n * @param {function(string, object):boolean} [options.data] - Optional\n * predicate function for testing if a data set's input should be included\n * in the exported state. If unspecified, all data sets that have been\n * explicitly modified will be included.\n * @param {boolean} [options.recurse=true] - Flag indicating if the exported\n * state should recursively include state from group mark sub-contexts.\n * @return {object} - An object containing the exported state values.\n */\nfunction getState(options) {\n return this._runtime.getState(options || {\n data: dataTest,\n signals: signalTest,\n recurse: true\n });\n}\nfunction dataTest(name, data) {\n return data.modified && isArray(data.input.value) && !name.startsWith('_:vega:_');\n}\nfunction signalTest(name, op) {\n return !(name === 'parent' || op instanceof transforms.proxy);\n}\n\n/**\n * Sets the current view state and updates the view by invoking run.\n * @param {object} state - A state object containing signal and/or\n * data set values, following the format used by the getState method.\n * @return {View} - This view instance.\n */\nfunction setState(state) {\n this.runAsync(null, v => {\n v._trigger = false;\n v._runtime.setState(state);\n }, v => {\n v._trigger = true;\n });\n return this;\n}\n\nfunction timer (callback, delay) {\n function tick(elapsed) {\n callback({\n timestamp: Date.now(),\n elapsed: elapsed\n });\n }\n this._timers.push(interval(tick, delay));\n}\n\nfunction defaultTooltip (handler, event, item, value) {\n const el = handler.element();\n if (el) el.setAttribute('title', formatTooltip(value));\n}\nfunction formatTooltip(value) {\n return value == null ? '' : isArray(value) ? formatArray(value) : isObject(value) && !isDate(value) ? formatObject(value) : value + '';\n}\nfunction formatObject(obj) {\n return Object.keys(obj).map(key => {\n const v = obj[key];\n return key + ': ' + (isArray(v) ? formatArray(v) : formatValue(v));\n }).join('\\n');\n}\nfunction formatArray(value) {\n return '[' + value.map(formatValue).join(', ') + ']';\n}\nfunction formatValue(value) {\n return isArray(value) ? '[\\u2026]' : isObject(value) && !isDate(value) ? '{\\u2026}' : value;\n}\n\nfunction watchPixelRatio () {\n // based on https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio#monitoring_screen_resolution_or_zoom_level_changes\n if (this.renderer() === 'canvas' && this._renderer._canvas) {\n let remove = null;\n const updatePixelRatio = () => {\n if (remove != null) {\n remove();\n }\n const media = matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);\n media.addEventListener('change', updatePixelRatio);\n remove = () => {\n media.removeEventListener('change', updatePixelRatio);\n };\n this._renderer._canvas.getContext('2d').pixelRatio = window.devicePixelRatio || 1;\n this._redraw = true;\n this._resize = 1;\n this.resize().runAsync();\n };\n updatePixelRatio();\n }\n}\n\n/**\n * Create a new View instance from a Vega dataflow runtime specification.\n * The generated View will not immediately be ready for display. Callers\n * should also invoke the initialize method (e.g., to set the parent\n * DOM element in browser-based deployment) and then invoke the run\n * method to evaluate the dataflow graph. Rendering will automatically\n * be performed upon dataflow runs.\n * @constructor\n * @param {object} spec - The Vega dataflow runtime specification.\n */\nfunction View(spec, options) {\n const view = this;\n options = options || {};\n Dataflow.call(view);\n if (options.loader) view.loader(options.loader);\n if (options.logger) view.logger(options.logger);\n if (options.logLevel != null) view.logLevel(options.logLevel);\n if (options.locale || spec.locale) {\n const loc = extend({}, spec.locale, options.locale);\n view.locale(locale(loc.number, loc.time));\n }\n view._el = null;\n view._elBind = null;\n view._renderType = options.renderer || RenderType.Canvas;\n view._scenegraph = new Scenegraph();\n const root = view._scenegraph.root;\n\n // initialize renderer, handler and event management\n view._renderer = null;\n view._tooltip = options.tooltip || defaultTooltip, view._redraw = true;\n view._handler = new CanvasHandler().scene(root);\n view._globalCursor = false;\n view._preventDefault = false;\n view._timers = [];\n view._eventListeners = [];\n view._resizeListeners = [];\n\n // initialize event configuration\n view._eventConfig = initializeEventConfig(spec.eventConfig);\n view.globalCursor(view._eventConfig.globalCursor);\n\n // initialize dataflow graph\n const ctx = runtime(view, spec, options.expr);\n view._runtime = ctx;\n view._signals = ctx.signals;\n view._bind = (spec.bindings || []).map(_ => ({\n state: null,\n param: extend({}, _)\n }));\n\n // initialize scenegraph\n if (ctx.root) ctx.root.set(root);\n root.source = ctx.data.root.input;\n view.pulse(ctx.data.root.input, view.changeset().insert(root.items));\n\n // initialize view size\n view._width = view.width();\n view._height = view.height();\n view._viewWidth = viewWidth(view, view._width);\n view._viewHeight = viewHeight(view, view._height);\n view._origin = [0, 0];\n view._resize = 0;\n view._autosize = 1;\n initializeResize(view);\n\n // initialize background color\n background(view);\n\n // initialize cursor\n cursor(view);\n\n // initialize view description\n view.description(spec.description);\n\n // initialize hover proessing, if requested\n if (options.hover) view.hover();\n\n // initialize DOM container(s) and renderer\n if (options.container) view.initialize(options.container, options.bind);\n if (options.watchPixelRatio) view._watchPixelRatio();\n}\nfunction lookupSignal(view, name) {\n return hasOwnProperty(view._signals, name) ? view._signals[name] : error('Unrecognized signal name: ' + stringValue(name));\n}\nfunction findOperatorHandler(op, handler) {\n const h = (op._targets || []).filter(op => op._update && op._update.handler === handler);\n return h.length ? h[0] : null;\n}\nfunction addOperatorListener(view, name, op, handler) {\n let h = findOperatorHandler(op, handler);\n if (!h) {\n h = trap(view, () => handler(name, op.value));\n h.handler = handler;\n view.on(op, null, h);\n }\n return view;\n}\nfunction removeOperatorListener(view, op, handler) {\n const h = findOperatorHandler(op, handler);\n if (h) op._targets.remove(h);\n return view;\n}\ninherits(View, Dataflow, {\n // -- DATAFLOW / RENDERING ----\n\n async evaluate(encode, prerun, postrun) {\n // evaluate dataflow and prerun\n await Dataflow.prototype.evaluate.call(this, encode, prerun);\n\n // render as needed\n if (this._redraw || this._resize) {\n try {\n if (this._renderer) {\n if (this._resize) {\n this._resize = 0;\n resizeRenderer(this);\n }\n await this._renderer.renderAsync(this._scenegraph.root);\n }\n this._redraw = false;\n } catch (e) {\n this.error(e);\n }\n }\n\n // evaluate postrun\n if (postrun) asyncCallback(this, postrun);\n return this;\n },\n dirty(item) {\n this._redraw = true;\n this._renderer && this._renderer.dirty(item);\n },\n // -- GET / SET ----\n\n description(text) {\n if (arguments.length) {\n const desc = text != null ? text + '' : null;\n if (desc !== this._desc) ariaLabel(this._el, this._desc = desc);\n return this;\n }\n return this._desc;\n },\n container() {\n return this._el;\n },\n scenegraph() {\n return this._scenegraph;\n },\n origin() {\n return this._origin.slice();\n },\n signal(name, value, options) {\n const op = lookupSignal(this, name);\n return arguments.length === 1 ? op.value : this.update(op, value, options);\n },\n width(_) {\n return arguments.length ? this.signal('width', _) : this.signal('width');\n },\n height(_) {\n return arguments.length ? this.signal('height', _) : this.signal('height');\n },\n padding(_) {\n return arguments.length ? this.signal('padding', padding(_)) : padding(this.signal('padding'));\n },\n autosize(_) {\n return arguments.length ? this.signal('autosize', _) : this.signal('autosize');\n },\n background(_) {\n return arguments.length ? this.signal('background', _) : this.signal('background');\n },\n renderer(type) {\n if (!arguments.length) return this._renderType;\n if (!renderModule(type)) error('Unrecognized renderer type: ' + type);\n if (type !== this._renderType) {\n this._renderType = type;\n this._resetRenderer();\n }\n return this;\n },\n tooltip(handler) {\n if (!arguments.length) return this._tooltip;\n if (handler !== this._tooltip) {\n this._tooltip = handler;\n this._resetRenderer();\n }\n return this;\n },\n loader(loader) {\n if (!arguments.length) return this._loader;\n if (loader !== this._loader) {\n Dataflow.prototype.loader.call(this, loader);\n this._resetRenderer();\n }\n return this;\n },\n resize() {\n // set flag to perform autosize\n this._autosize = 1;\n // touch autosize signal to ensure top-level ViewLayout runs\n return this.touch(lookupSignal(this, 'autosize'));\n },\n _resetRenderer() {\n if (this._renderer) {\n this._renderer = null;\n this.initialize(this._el, this._elBind);\n }\n },\n // -- SIZING ----\n _resizeView: resizeView,\n // -- EVENT HANDLING ----\n\n addEventListener(type, handler, options) {\n let callback = handler;\n if (!(options && options.trap === false)) {\n // wrap callback in error handler\n callback = trap(this, handler);\n callback.raw = handler;\n }\n this._handler.on(type, callback);\n return this;\n },\n removeEventListener(type, handler) {\n var handlers = this._handler.handlers(type),\n i = handlers.length,\n h,\n t;\n\n // search registered handlers, remove if match found\n while (--i >= 0) {\n t = handlers[i].type;\n h = handlers[i].handler;\n if (type === t && (handler === h || handler === h.raw)) {\n this._handler.off(t, h);\n break;\n }\n }\n return this;\n },\n addResizeListener(handler) {\n const l = this._resizeListeners;\n if (!l.includes(handler)) {\n // add handler if it isn't already registered\n // note: error trapping handled elsewhere, so\n // no need to wrap handlers here\n l.push(handler);\n }\n return this;\n },\n removeResizeListener(handler) {\n var l = this._resizeListeners,\n i = l.indexOf(handler);\n if (i >= 0) {\n l.splice(i, 1);\n }\n return this;\n },\n addSignalListener(name, handler) {\n return addOperatorListener(this, name, lookupSignal(this, name), handler);\n },\n removeSignalListener(name, handler) {\n return removeOperatorListener(this, lookupSignal(this, name), handler);\n },\n addDataListener(name, handler) {\n return addOperatorListener(this, name, dataref(this, name).values, handler);\n },\n removeDataListener(name, handler) {\n return removeOperatorListener(this, dataref(this, name).values, handler);\n },\n globalCursor(_) {\n if (arguments.length) {\n if (this._globalCursor !== !!_) {\n const prev = setCursor(this, null); // clear previous cursor\n this._globalCursor = !!_;\n if (prev) setCursor(this, prev); // swap cursor\n }\n return this;\n } else {\n return this._globalCursor;\n }\n },\n preventDefault(_) {\n if (arguments.length) {\n this._preventDefault = _;\n return this;\n } else {\n return this._preventDefault;\n }\n },\n timer,\n events,\n finalize,\n hover,\n // -- DATA ----\n data,\n change,\n insert,\n remove,\n // -- SCALES --\n scale,\n // -- INITIALIZATION ----\n initialize,\n // -- HEADLESS RENDERING ----\n toImageURL: renderToImageURL,\n toCanvas: renderToCanvas,\n toSVG: renderToSVG,\n // -- SAVE / RESTORE STATE ----\n getState,\n setState,\n // RE-RENDER ON ZOOM\n _watchPixelRatio: watchPixelRatio\n});\n\nexport { View };\n","import {Timer, now} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n var t = new Timer, total = delay;\n if (delay == null) return t.restart(callback, delay, time), t;\n t._restart = t.restart;\n t.restart = function(callback, delay, time) {\n delay = +delay, time = time == null ? now() : +time;\n t._restart(function tick(elapsed) {\n elapsed += total;\n t._restart(tick, total += delay, time);\n callback(elapsed);\n }, delay, time);\n }\n t.restart(callback, delay, time);\n return t;\n}\n","const VIEW = 'view',\n LBRACK = '[',\n RBRACK = ']',\n LBRACE = '{',\n RBRACE = '}',\n COLON = ':',\n COMMA = ',',\n NAME = '@',\n GT = '>',\n ILLEGAL = /[[\\]{}]/,\n DEFAULT_MARKS = {\n '*': 1,\n arc: 1,\n area: 1,\n group: 1,\n image: 1,\n line: 1,\n path: 1,\n rect: 1,\n rule: 1,\n shape: 1,\n symbol: 1,\n text: 1,\n trail: 1\n };\nlet DEFAULT_SOURCE, MARKS;\n\n/**\n * Parse an event selector string.\n * Returns an array of event stream definitions.\n */\nfunction eventSelector (selector, source, marks) {\n DEFAULT_SOURCE = source || VIEW;\n MARKS = marks || DEFAULT_MARKS;\n return parseMerge(selector.trim()).map(parseSelector);\n}\nfunction isMarkType(type) {\n return MARKS[type];\n}\nfunction find(s, i, endChar, pushChar, popChar) {\n const n = s.length;\n let count = 0,\n c;\n for (; i < n; ++i) {\n c = s[i];\n if (!count && c === endChar) return i;else if (popChar && popChar.indexOf(c) >= 0) --count;else if (pushChar && pushChar.indexOf(c) >= 0) ++count;\n }\n return i;\n}\nfunction parseMerge(s) {\n const output = [],\n n = s.length;\n let start = 0,\n i = 0;\n while (i < n) {\n i = find(s, i, COMMA, LBRACK + LBRACE, RBRACK + RBRACE);\n output.push(s.substring(start, i).trim());\n start = ++i;\n }\n if (output.length === 0) {\n throw 'Empty event selector: ' + s;\n }\n return output;\n}\nfunction parseSelector(s) {\n return s[0] === '[' ? parseBetween(s) : parseStream(s);\n}\nfunction parseBetween(s) {\n const n = s.length;\n let i = 1,\n b;\n i = find(s, i, RBRACK, LBRACK, RBRACK);\n if (i === n) {\n throw 'Empty between selector: ' + s;\n }\n b = parseMerge(s.substring(1, i));\n if (b.length !== 2) {\n throw 'Between selector must have two elements: ' + s;\n }\n s = s.slice(i + 1).trim();\n if (s[0] !== GT) {\n throw 'Expected \\'>\\' after between selector: ' + s;\n }\n b = b.map(parseSelector);\n const stream = parseSelector(s.slice(1).trim());\n if (stream.between) {\n return {\n between: b,\n stream: stream\n };\n } else {\n stream.between = b;\n }\n return stream;\n}\nfunction parseStream(s) {\n const stream = {\n source: DEFAULT_SOURCE\n },\n source = [];\n let throttle = [0, 0],\n markname = 0,\n start = 0,\n n = s.length,\n i = 0,\n j,\n filter;\n\n // extract throttle from end\n if (s[n - 1] === RBRACE) {\n i = s.lastIndexOf(LBRACE);\n if (i >= 0) {\n try {\n throttle = parseThrottle(s.substring(i + 1, n - 1));\n } catch (e) {\n throw 'Invalid throttle specification: ' + s;\n }\n s = s.slice(0, i).trim();\n n = s.length;\n } else throw 'Unmatched right brace: ' + s;\n i = 0;\n }\n if (!n) throw s;\n\n // set name flag based on first char\n if (s[0] === NAME) markname = ++i;\n\n // extract first part of multi-part stream selector\n j = find(s, i, COLON);\n if (j < n) {\n source.push(s.substring(start, j).trim());\n start = i = ++j;\n }\n\n // extract remaining part of stream selector\n i = find(s, i, LBRACK);\n if (i === n) {\n source.push(s.substring(start, n).trim());\n } else {\n source.push(s.substring(start, i).trim());\n filter = [];\n start = ++i;\n if (start === n) throw 'Unmatched left bracket: ' + s;\n }\n\n // extract filters\n while (i < n) {\n i = find(s, i, RBRACK);\n if (i === n) throw 'Unmatched left bracket: ' + s;\n filter.push(s.substring(start, i).trim());\n if (i < n - 1 && s[++i] !== LBRACK) throw 'Expected left bracket: ' + s;\n start = ++i;\n }\n\n // marshall event stream specification\n if (!(n = source.length) || ILLEGAL.test(source[n - 1])) {\n throw 'Invalid event selector: ' + s;\n }\n if (n > 1) {\n stream.type = source[1];\n if (markname) {\n stream.markname = source[0].slice(1);\n } else if (isMarkType(source[0])) {\n stream.marktype = source[0];\n } else {\n stream.source = source[0];\n }\n } else {\n stream.type = source[0];\n }\n if (stream.type.slice(-1) === '!') {\n stream.consume = true;\n stream.type = stream.type.slice(0, -1);\n }\n if (filter != null) stream.filter = filter;\n if (throttle[0]) stream.throttle = throttle[0];\n if (throttle[1]) stream.debounce = throttle[1];\n return stream;\n}\nfunction parseThrottle(s) {\n const a = s.split(COMMA);\n if (!s.length || a.length > 2) throw s;\n return a.map(_ => {\n const x = +_;\n if (x !== x) throw s;\n return x;\n });\n}\n\nexport { eventSelector as parseSelector };\n","import { isObject, isArray, extend, hasOwnProperty, array, stringValue, peek, error, isString, splitAccessPath, mergeConfig } from 'vega-util';\nimport { parseExpression } from 'vega-functions';\nimport { parseSelector } from 'vega-event-selector';\nimport { isValidScaleType, isDiscrete, isQuantile, isContinuous, isDiscretizing } from 'vega-scale';\nimport { definition as definition$1 } from 'vega-dataflow';\n\nfunction parseAutosize (spec) {\n return isObject(spec) ? spec : {\n type: spec || 'pad'\n };\n}\n\nconst number = _ => +_ || 0;\nconst paddingObject = _ => ({\n top: _,\n bottom: _,\n left: _,\n right: _\n});\nfunction parsePadding (spec) {\n return !isObject(spec) ? paddingObject(number(spec)) : spec.signal ? spec : {\n top: number(spec.top),\n bottom: number(spec.bottom),\n left: number(spec.left),\n right: number(spec.right)\n };\n}\n\nconst encoder = _ => isObject(_) && !isArray(_) ? extend({}, _) : {\n value: _\n};\nfunction addEncode(object, name, value, set) {\n if (value != null) {\n const isEncoder = isObject(value) && !isArray(value) || isArray(value) && value.length && isObject(value[0]);\n\n // Always assign signal to update, even if the signal is from the enter block\n if (isEncoder) {\n object.update[name] = value;\n } else {\n object[set || 'enter'][name] = {\n value: value\n };\n }\n return 1;\n } else {\n return 0;\n }\n}\nfunction addEncoders(object, enter, update) {\n for (const name in enter) {\n addEncode(object, name, enter[name]);\n }\n for (const name in update) {\n addEncode(object, name, update[name], 'update');\n }\n}\nfunction extendEncode(encode, extra, skip) {\n for (const name in extra) {\n if (skip && hasOwnProperty(skip, name)) continue;\n encode[name] = extend(encode[name] || {}, extra[name]);\n }\n return encode;\n}\nfunction has(key, encode) {\n return encode && (encode.enter && encode.enter[key] || encode.update && encode.update[key]);\n}\n\nconst MarkRole = 'mark';\nconst FrameRole = 'frame';\nconst ScopeRole = 'scope';\nconst AxisRole = 'axis';\nconst AxisDomainRole = 'axis-domain';\nconst AxisGridRole = 'axis-grid';\nconst AxisLabelRole = 'axis-label';\nconst AxisTickRole = 'axis-tick';\nconst AxisTitleRole = 'axis-title';\nconst LegendRole = 'legend';\nconst LegendBandRole = 'legend-band';\nconst LegendEntryRole = 'legend-entry';\nconst LegendGradientRole = 'legend-gradient';\nconst LegendLabelRole = 'legend-label';\nconst LegendSymbolRole = 'legend-symbol';\nconst LegendTitleRole = 'legend-title';\nconst TitleRole = 'title';\nconst TitleTextRole = 'title-text';\nconst TitleSubtitleRole = 'title-subtitle';\n\nfunction applyDefaults (encode, type, role, style, config) {\n const defaults = {},\n enter = {};\n let update, key, skip, props;\n\n // if text mark, apply global lineBreak settings (#2370)\n key = 'lineBreak';\n if (type === 'text' && config[key] != null && !has(key, encode)) {\n applyDefault(defaults, key, config[key]);\n }\n\n // ignore legend and axis roles\n if (role == 'legend' || String(role).startsWith('axis')) {\n role = null;\n }\n\n // resolve mark config\n props = role === FrameRole ? config.group : role === MarkRole ? extend({}, config.mark, config[type]) : null;\n for (key in props) {\n // do not apply defaults if relevant fields are defined\n skip = has(key, encode) || (key === 'fill' || key === 'stroke') && (has('fill', encode) || has('stroke', encode));\n if (!skip) applyDefault(defaults, key, props[key]);\n }\n\n // resolve styles, apply with increasing precedence\n array(style).forEach(name => {\n const props = config.style && config.style[name];\n for (const key in props) {\n if (!has(key, encode)) {\n applyDefault(defaults, key, props[key]);\n }\n }\n });\n encode = extend({}, encode); // defensive copy\n for (key in defaults) {\n props = defaults[key];\n if (props.signal) {\n (update = update || {})[key] = props;\n } else {\n enter[key] = props;\n }\n }\n encode.enter = extend(enter, encode.enter);\n if (update) encode.update = extend(update, encode.update);\n return encode;\n}\nfunction applyDefault(defaults, key, value) {\n defaults[key] = value && value.signal ? {\n signal: value.signal\n } : {\n value: value\n };\n}\n\nconst scaleRef = scale => isString(scale) ? stringValue(scale) : scale.signal ? `(${scale.signal})` : field(scale);\nfunction entry$1(enc) {\n if (enc.gradient != null) {\n return gradient(enc);\n }\n let value = enc.signal ? `(${enc.signal})` : enc.color ? color(enc.color) : enc.field != null ? field(enc.field) : enc.value !== undefined ? stringValue(enc.value) : undefined;\n if (enc.scale != null) {\n value = scale(enc, value);\n }\n if (value === undefined) {\n value = null;\n }\n if (enc.exponent != null) {\n value = `pow(${value},${property(enc.exponent)})`;\n }\n if (enc.mult != null) {\n value += `*${property(enc.mult)}`;\n }\n if (enc.offset != null) {\n value += `+${property(enc.offset)}`;\n }\n if (enc.round) {\n value = `round(${value})`;\n }\n return value;\n}\nconst _color = (type, x, y, z) => `(${type}(${[x, y, z].map(entry$1).join(',')})+'')`;\nfunction color(enc) {\n return enc.c ? _color('hcl', enc.h, enc.c, enc.l) : enc.h || enc.s ? _color('hsl', enc.h, enc.s, enc.l) : enc.l || enc.a ? _color('lab', enc.l, enc.a, enc.b) : enc.r || enc.g || enc.b ? _color('rgb', enc.r, enc.g, enc.b) : null;\n}\nfunction gradient(enc) {\n // map undefined to null; expression lang does not allow undefined\n const args = [enc.start, enc.stop, enc.count].map(_ => _ == null ? null : stringValue(_));\n\n // trim null inputs from the end\n while (args.length && peek(args) == null) args.pop();\n args.unshift(scaleRef(enc.gradient));\n return `gradient(${args.join(',')})`;\n}\nfunction property(property) {\n return isObject(property) ? '(' + entry$1(property) + ')' : property;\n}\nfunction field(ref) {\n return resolveField(isObject(ref) ? ref : {\n datum: ref\n });\n}\nfunction resolveField(ref) {\n let object, level, field;\n if (ref.signal) {\n object = 'datum';\n field = ref.signal;\n } else if (ref.group || ref.parent) {\n level = Math.max(1, ref.level || 1);\n object = 'item';\n while (level-- > 0) {\n object += '.mark.group';\n }\n if (ref.parent) {\n field = ref.parent;\n object += '.datum';\n } else {\n field = ref.group;\n }\n } else if (ref.datum) {\n object = 'datum';\n field = ref.datum;\n } else {\n error('Invalid field reference: ' + stringValue(ref));\n }\n if (!ref.signal) {\n field = isString(field) ? splitAccessPath(field).map(stringValue).join('][') : resolveField(field);\n }\n return object + '[' + field + ']';\n}\nfunction scale(enc, value) {\n const scale = scaleRef(enc.scale);\n if (enc.range != null) {\n // pull value from scale range\n value = `lerp(_range(${scale}), ${+enc.range})`;\n } else {\n // run value through scale and/or pull scale bandwidth\n if (value !== undefined) value = `_scale(${scale}, ${value})`;\n if (enc.band) {\n value = (value ? value + '+' : '') + `_bandwidth(${scale})` + (+enc.band === 1 ? '' : '*' + property(enc.band));\n if (enc.extra) {\n // include logic to handle extraneous elements\n value = `(datum.extra ? _scale(${scale}, datum.extra.value) : ${value})`;\n }\n }\n if (value == null) value = '0';\n }\n return value;\n}\n\nfunction rule (enc) {\n let code = '';\n enc.forEach(rule => {\n const value = entry$1(rule);\n code += rule.test ? `(${rule.test})?${value}:` : value;\n });\n\n // if no else clause, terminate with null (#1366)\n if (peek(code) === ':') {\n code += 'null';\n }\n return code;\n}\n\nfunction parseEncode (encode, type, role, style, scope, params) {\n const enc = {};\n params = params || {};\n params.encoders = {\n $encode: enc\n };\n encode = applyDefaults(encode, type, role, style, scope.config);\n for (const key in encode) {\n enc[key] = parseBlock(encode[key], type, params, scope);\n }\n return params;\n}\nfunction parseBlock(block, marktype, params, scope) {\n const channels = {},\n fields = {};\n for (const name in block) {\n if (block[name] != null) {\n // skip any null entries\n channels[name] = parse$1(expr(block[name]), scope, params, fields);\n }\n }\n return {\n $expr: {\n marktype,\n channels\n },\n $fields: Object.keys(fields),\n $output: Object.keys(block)\n };\n}\nfunction expr(enc) {\n return isArray(enc) ? rule(enc) : entry$1(enc);\n}\nfunction parse$1(code, scope, params, fields) {\n const expr = parseExpression(code, scope);\n expr.$fields.forEach(name => fields[name] = 1);\n extend(params, expr.$params);\n return expr.$expr;\n}\n\nconst OUTER = 'outer',\n OUTER_INVALID = ['value', 'update', 'init', 'react', 'bind'];\nfunction outerError(prefix, name) {\n error(prefix + ' for \"outer\" push: ' + stringValue(name));\n}\nfunction parseSignal (signal, scope) {\n const name = signal.name;\n if (signal.push === OUTER) {\n // signal must already be defined, raise error if not\n if (!scope.signals[name]) outerError('No prior signal definition', name);\n // signal push must not use properties reserved for standard definition\n OUTER_INVALID.forEach(prop => {\n if (signal[prop] !== undefined) outerError('Invalid property ', prop);\n });\n } else {\n // define a new signal in the current scope\n const op = scope.addSignal(name, signal.value);\n if (signal.react === false) op.react = false;\n if (signal.bind) scope.addBinding(name, signal.bind);\n }\n}\n\nfunction Entry(type, value, params, parent) {\n this.id = -1;\n this.type = type;\n this.value = value;\n this.params = params;\n if (parent) this.parent = parent;\n}\nfunction entry(type, value, params, parent) {\n return new Entry(type, value, params, parent);\n}\nfunction operator(value, params) {\n return entry('operator', value, params);\n}\n\n// -----\n\nfunction ref(op) {\n const ref = {\n $ref: op.id\n };\n // if operator not yet registered, cache ref to resolve later\n if (op.id < 0) (op.refs = op.refs || []).push(ref);\n return ref;\n}\nfunction fieldRef$1(field, name) {\n return name ? {\n $field: field,\n $name: name\n } : {\n $field: field\n };\n}\nconst keyFieldRef = fieldRef$1('key');\nfunction compareRef(fields, orders) {\n return {\n $compare: fields,\n $order: orders\n };\n}\nfunction keyRef(fields, flat) {\n const ref = {\n $key: fields\n };\n if (flat) ref.$flat = true;\n return ref;\n}\n\n// -----\n\nconst Ascending = 'ascending';\nconst Descending = 'descending';\nfunction sortKey(sort) {\n return !isObject(sort) ? '' : (sort.order === Descending ? '-' : '+') + aggrField(sort.op, sort.field);\n}\nfunction aggrField(op, field) {\n return (op && op.signal ? '$' + op.signal : op || '') + (op && field ? '_' : '') + (field && field.signal ? '$' + field.signal : field || '');\n}\n\n// -----\n\nconst Scope$1 = 'scope';\nconst View = 'view';\nfunction isSignal(_) {\n return _ && _.signal;\n}\nfunction isExpr$1(_) {\n return _ && _.expr;\n}\nfunction hasSignal(_) {\n if (isSignal(_)) return true;\n if (isObject(_)) for (const key in _) {\n if (hasSignal(_[key])) return true;\n }\n return false;\n}\nfunction value(specValue, defaultValue) {\n return specValue != null ? specValue : defaultValue;\n}\nfunction deref(v) {\n return v && v.signal || v;\n}\n\nconst Timer = 'timer';\nfunction parseStream(stream, scope) {\n const method = stream.merge ? mergeStream : stream.stream ? nestedStream : stream.type ? eventStream : error('Invalid stream specification: ' + stringValue(stream));\n return method(stream, scope);\n}\nfunction eventSource(source) {\n return source === Scope$1 ? View : source || View;\n}\nfunction mergeStream(stream, scope) {\n const list = stream.merge.map(s => parseStream(s, scope)),\n entry = streamParameters({\n merge: list\n }, stream, scope);\n return scope.addStream(entry).id;\n}\nfunction nestedStream(stream, scope) {\n const id = parseStream(stream.stream, scope),\n entry = streamParameters({\n stream: id\n }, stream, scope);\n return scope.addStream(entry).id;\n}\nfunction eventStream(stream, scope) {\n let id;\n if (stream.type === Timer) {\n id = scope.event(Timer, stream.throttle);\n stream = {\n between: stream.between,\n filter: stream.filter\n };\n } else {\n id = scope.event(eventSource(stream.source), stream.type);\n }\n const entry = streamParameters({\n stream: id\n }, stream, scope);\n return Object.keys(entry).length === 1 ? id : scope.addStream(entry).id;\n}\nfunction streamParameters(entry, stream, scope) {\n let param = stream.between;\n if (param) {\n if (param.length !== 2) {\n error('Stream \"between\" parameter must have 2 entries: ' + stringValue(stream));\n }\n entry.between = [parseStream(param[0], scope), parseStream(param[1], scope)];\n }\n param = stream.filter ? [].concat(stream.filter) : [];\n if (stream.marktype || stream.markname || stream.markrole) {\n // add filter for mark type, name and/or role\n param.push(filterMark(stream.marktype, stream.markname, stream.markrole));\n }\n if (stream.source === Scope$1) {\n // add filter to limit events from sub-scope only\n param.push('inScope(event.item)');\n }\n if (param.length) {\n entry.filter = parseExpression('(' + param.join(')&&(') + ')', scope).$expr;\n }\n if ((param = stream.throttle) != null) {\n entry.throttle = +param;\n }\n if ((param = stream.debounce) != null) {\n entry.debounce = +param;\n }\n if (stream.consume) {\n entry.consume = true;\n }\n return entry;\n}\nfunction filterMark(type, name, role) {\n const item = 'event.item';\n return item + (type && type !== '*' ? '&&' + item + '.mark.marktype===\\'' + type + '\\'' : '') + (role ? '&&' + item + '.mark.role===\\'' + role + '\\'' : '') + (name ? '&&' + item + '.mark.name===\\'' + name + '\\'' : '');\n}\n\n// bypass expression parser for internal operator references\nconst OP_VALUE_EXPR = {\n code: '_.$value',\n ast: {\n type: 'Identifier',\n value: 'value'\n }\n};\nfunction parseUpdate (spec, scope, target) {\n const encode = spec.encode,\n entry = {\n target: target\n };\n let events = spec.events,\n update = spec.update,\n sources = [];\n if (!events) {\n error('Signal update missing events specification.');\n }\n\n // interpret as an event selector string\n if (isString(events)) {\n events = parseSelector(events, scope.isSubscope() ? Scope$1 : View);\n }\n\n // separate event streams from signal updates\n events = array(events).filter(s => s.signal || s.scale ? (sources.push(s), 0) : 1);\n\n // merge internal operator listeners\n if (sources.length > 1) {\n sources = [mergeSources(sources)];\n }\n\n // merge event streams, include as source\n if (events.length) {\n sources.push(events.length > 1 ? {\n merge: events\n } : events[0]);\n }\n if (encode != null) {\n if (update) error('Signal encode and update are mutually exclusive.');\n update = 'encode(item(),' + stringValue(encode) + ')';\n }\n\n // resolve update value\n entry.update = isString(update) ? parseExpression(update, scope) : update.expr != null ? parseExpression(update.expr, scope) : update.value != null ? update.value : update.signal != null ? {\n $expr: OP_VALUE_EXPR,\n $params: {\n $value: scope.signalRef(update.signal)\n }\n } : error('Invalid signal update specification.');\n if (spec.force) {\n entry.options = {\n force: true\n };\n }\n sources.forEach(source => scope.addUpdate(extend(streamSource(source, scope), entry)));\n}\nfunction streamSource(stream, scope) {\n return {\n source: stream.signal ? scope.signalRef(stream.signal) : stream.scale ? scope.scaleRef(stream.scale) : parseStream(stream, scope)\n };\n}\nfunction mergeSources(sources) {\n return {\n signal: '[' + sources.map(s => s.scale ? 'scale(\"' + s.scale + '\")' : s.signal) + ']'\n };\n}\n\nfunction parseSignalUpdates (signal, scope) {\n const op = scope.getSignal(signal.name);\n let expr = signal.update;\n if (signal.init) {\n if (expr) {\n error('Signals can not include both init and update expressions.');\n } else {\n expr = signal.init;\n op.initonly = true;\n }\n }\n if (expr) {\n expr = parseExpression(expr, scope);\n op.update = expr.$expr;\n op.params = expr.$params;\n }\n if (signal.on) {\n signal.on.forEach(_ => parseUpdate(_, scope, op.id));\n }\n}\n\nconst transform = name => (params, value, parent) => entry(name, value, params || undefined, parent);\nconst Aggregate = transform('aggregate');\nconst AxisTicks = transform('axisticks');\nconst Bound = transform('bound');\nconst Collect = transform('collect');\nconst Compare = transform('compare');\nconst DataJoin = transform('datajoin');\nconst Encode = transform('encode');\nconst Expression = transform('expression');\nconst Facet = transform('facet');\nconst Field = transform('field');\nconst Key = transform('key');\nconst LegendEntries = transform('legendentries');\nconst Load = transform('load');\nconst Mark = transform('mark');\nconst MultiExtent = transform('multiextent');\nconst MultiValues = transform('multivalues');\nconst Overlap = transform('overlap');\nconst Params = transform('params');\nconst PreFacet = transform('prefacet');\nconst Projection = transform('projection');\nconst Proxy = transform('proxy');\nconst Relay = transform('relay');\nconst Render = transform('render');\nconst Scale = transform('scale');\nconst Sieve = transform('sieve');\nconst SortItems = transform('sortitems');\nconst ViewLayout = transform('viewlayout');\nconst Values = transform('values');\n\nlet FIELD_REF_ID = 0;\nconst MULTIDOMAIN_SORT_OPS = {\n min: 'min',\n max: 'max',\n count: 'sum'\n};\nfunction initScale(spec, scope) {\n const type = spec.type || 'linear';\n if (!isValidScaleType(type)) {\n error('Unrecognized scale type: ' + stringValue(type));\n }\n scope.addScale(spec.name, {\n type,\n domain: undefined\n });\n}\nfunction parseScale(spec, scope) {\n const params = scope.getScale(spec.name).params;\n let key;\n params.domain = parseScaleDomain(spec.domain, spec, scope);\n if (spec.range != null) {\n params.range = parseScaleRange(spec, scope, params);\n }\n if (spec.interpolate != null) {\n parseScaleInterpolate(spec.interpolate, params);\n }\n if (spec.nice != null) {\n params.nice = parseScaleNice(spec.nice, scope);\n }\n if (spec.bins != null) {\n params.bins = parseScaleBins(spec.bins, scope);\n }\n for (key in spec) {\n if (hasOwnProperty(params, key) || key === 'name') continue;\n params[key] = parseLiteral(spec[key], scope);\n }\n}\nfunction parseLiteral(v, scope) {\n return !isObject(v) ? v : v.signal ? scope.signalRef(v.signal) : error('Unsupported object: ' + stringValue(v));\n}\nfunction parseArray(v, scope) {\n return v.signal ? scope.signalRef(v.signal) : v.map(v => parseLiteral(v, scope));\n}\nfunction dataLookupError(name) {\n error('Can not find data set: ' + stringValue(name));\n}\n\n// -- SCALE DOMAIN ----\n\nfunction parseScaleDomain(domain, spec, scope) {\n if (!domain) {\n if (spec.domainMin != null || spec.domainMax != null) {\n error('No scale domain defined for domainMin/domainMax to override.');\n }\n return; // default domain\n }\n return domain.signal ? scope.signalRef(domain.signal) : (isArray(domain) ? explicitDomain : domain.fields ? multipleDomain : singularDomain)(domain, spec, scope);\n}\nfunction explicitDomain(domain, spec, scope) {\n return domain.map(v => parseLiteral(v, scope));\n}\nfunction singularDomain(domain, spec, scope) {\n const data = scope.getData(domain.data);\n if (!data) dataLookupError(domain.data);\n return isDiscrete(spec.type) ? data.valuesRef(scope, domain.field, parseSort(domain.sort, false)) : isQuantile(spec.type) ? data.domainRef(scope, domain.field) : data.extentRef(scope, domain.field);\n}\nfunction multipleDomain(domain, spec, scope) {\n const data = domain.data,\n fields = domain.fields.reduce((dom, d) => {\n d = isString(d) ? {\n data: data,\n field: d\n } : isArray(d) || d.signal ? fieldRef(d, scope) : d;\n dom.push(d);\n return dom;\n }, []);\n return (isDiscrete(spec.type) ? ordinalMultipleDomain : isQuantile(spec.type) ? quantileMultipleDomain : numericMultipleDomain)(domain, scope, fields);\n}\nfunction fieldRef(data, scope) {\n const name = '_:vega:_' + FIELD_REF_ID++,\n coll = Collect({});\n if (isArray(data)) {\n coll.value = {\n $ingest: data\n };\n } else if (data.signal) {\n const code = 'setdata(' + stringValue(name) + ',' + data.signal + ')';\n coll.params.input = scope.signalRef(code);\n }\n scope.addDataPipeline(name, [coll, Sieve({})]);\n return {\n data: name,\n field: 'data'\n };\n}\nfunction ordinalMultipleDomain(domain, scope, fields) {\n const sort = parseSort(domain.sort, true);\n let a, v;\n\n // get value counts for each domain field\n const counts = fields.map(f => {\n const data = scope.getData(f.data);\n if (!data) dataLookupError(f.data);\n return data.countsRef(scope, f.field, sort);\n });\n\n // aggregate the results from each domain field\n const p = {\n groupby: keyFieldRef,\n pulse: counts\n };\n if (sort) {\n a = sort.op || 'count';\n v = sort.field ? aggrField(a, sort.field) : 'count';\n p.ops = [MULTIDOMAIN_SORT_OPS[a]];\n p.fields = [scope.fieldRef(v)];\n p.as = [v];\n }\n a = scope.add(Aggregate(p));\n\n // collect aggregate output\n const c = scope.add(Collect({\n pulse: ref(a)\n }));\n\n // extract values for combined domain\n v = scope.add(Values({\n field: keyFieldRef,\n sort: scope.sortRef(sort),\n pulse: ref(c)\n }));\n return ref(v);\n}\nfunction parseSort(sort, multidomain) {\n if (sort) {\n if (!sort.field && !sort.op) {\n if (isObject(sort)) sort.field = 'key';else sort = {\n field: 'key'\n };\n } else if (!sort.field && sort.op !== 'count') {\n error('No field provided for sort aggregate op: ' + sort.op);\n } else if (multidomain && sort.field) {\n if (sort.op && !MULTIDOMAIN_SORT_OPS[sort.op]) {\n error('Multiple domain scales can not be sorted using ' + sort.op);\n }\n }\n }\n return sort;\n}\nfunction quantileMultipleDomain(domain, scope, fields) {\n // get value arrays for each domain field\n const values = fields.map(f => {\n const data = scope.getData(f.data);\n if (!data) dataLookupError(f.data);\n return data.domainRef(scope, f.field);\n });\n\n // combine value arrays\n return ref(scope.add(MultiValues({\n values: values\n })));\n}\nfunction numericMultipleDomain(domain, scope, fields) {\n // get extents for each domain field\n const extents = fields.map(f => {\n const data = scope.getData(f.data);\n if (!data) dataLookupError(f.data);\n return data.extentRef(scope, f.field);\n });\n\n // combine extents\n return ref(scope.add(MultiExtent({\n extents: extents\n })));\n}\n\n// -- SCALE BINS -----\n\nfunction parseScaleBins(v, scope) {\n return v.signal || isArray(v) ? parseArray(v, scope) : scope.objectProperty(v);\n}\n\n// -- SCALE NICE -----\n\nfunction parseScaleNice(nice, scope) {\n return nice.signal ? scope.signalRef(nice.signal) : isObject(nice) ? {\n interval: parseLiteral(nice.interval),\n step: parseLiteral(nice.step)\n } : parseLiteral(nice);\n}\n\n// -- SCALE INTERPOLATION -----\n\nfunction parseScaleInterpolate(interpolate, params) {\n params.interpolate = parseLiteral(interpolate.type || interpolate);\n if (interpolate.gamma != null) {\n params.interpolateGamma = parseLiteral(interpolate.gamma);\n }\n}\n\n// -- SCALE RANGE -----\n\nfunction parseScaleRange(spec, scope, params) {\n const config = scope.config.range;\n let range = spec.range;\n if (range.signal) {\n return scope.signalRef(range.signal);\n } else if (isString(range)) {\n if (config && hasOwnProperty(config, range)) {\n spec = extend({}, spec, {\n range: config[range]\n });\n return parseScaleRange(spec, scope, params);\n } else if (range === 'width') {\n range = [0, {\n signal: 'width'\n }];\n } else if (range === 'height') {\n range = isDiscrete(spec.type) ? [0, {\n signal: 'height'\n }] : [{\n signal: 'height'\n }, 0];\n } else {\n error('Unrecognized scale range value: ' + stringValue(range));\n }\n } else if (range.scheme) {\n params.scheme = isArray(range.scheme) ? parseArray(range.scheme, scope) : parseLiteral(range.scheme, scope);\n if (range.extent) params.schemeExtent = parseArray(range.extent, scope);\n if (range.count) params.schemeCount = parseLiteral(range.count, scope);\n return;\n } else if (range.step) {\n params.rangeStep = parseLiteral(range.step, scope);\n return;\n } else if (isDiscrete(spec.type) && !isArray(range)) {\n return parseScaleDomain(range, spec, scope);\n } else if (!isArray(range)) {\n error('Unsupported range type: ' + stringValue(range));\n }\n return range.map(v => (isArray(v) ? parseArray : parseLiteral)(v, scope));\n}\n\nfunction parseProjection (proj, scope) {\n const config = scope.config.projection || {},\n params = {};\n for (const name in proj) {\n if (name === 'name') continue;\n params[name] = parseParameter$1(proj[name], name, scope);\n }\n\n // apply projection defaults from config\n for (const name in config) {\n if (params[name] == null) {\n params[name] = parseParameter$1(config[name], name, scope);\n }\n }\n scope.addProjection(proj.name, params);\n}\nfunction parseParameter$1(_, name, scope) {\n return isArray(_) ? _.map(_ => parseParameter$1(_, name, scope)) : !isObject(_) ? _ : _.signal ? scope.signalRef(_.signal) : name === 'fit' ? _ : error('Unsupported parameter object: ' + stringValue(_));\n}\n\nconst Top = 'top';\nconst Left = 'left';\nconst Right = 'right';\nconst Bottom = 'bottom';\nconst Center = 'center';\nconst Vertical = 'vertical';\nconst Start = 'start';\nconst Middle = 'middle';\nconst End = 'end';\nconst Index = 'index';\nconst Label = 'label';\nconst Offset = 'offset';\nconst Perc = 'perc';\nconst Perc2 = 'perc2';\nconst Value = 'value';\nconst GuideLabelStyle = 'guide-label';\nconst GuideTitleStyle = 'guide-title';\nconst GroupTitleStyle = 'group-title';\nconst GroupSubtitleStyle = 'group-subtitle';\nconst Symbols = 'symbol';\nconst Gradient = 'gradient';\nconst Discrete = 'discrete';\nconst Size = 'size';\nconst Shape = 'shape';\nconst Fill = 'fill';\nconst Stroke = 'stroke';\nconst StrokeWidth = 'strokeWidth';\nconst StrokeDash = 'strokeDash';\nconst Opacity = 'opacity';\n\n// Encoding channels supported by legends\n// In priority order of 'canonical' scale\nconst LegendScales = [Size, Shape, Fill, Stroke, StrokeWidth, StrokeDash, Opacity];\nconst Skip = {\n name: 1,\n style: 1,\n interactive: 1\n};\nconst zero = {\n value: 0\n};\nconst one = {\n value: 1\n};\n\nconst GroupMark = 'group';\nconst RectMark = 'rect';\nconst RuleMark = 'rule';\nconst SymbolMark = 'symbol';\nconst TextMark = 'text';\n\nfunction guideGroup (mark) {\n mark.type = GroupMark;\n mark.interactive = mark.interactive || false;\n return mark;\n}\n\nfunction lookup(spec, config) {\n const _ = (name, dflt) => value(spec[name], value(config[name], dflt));\n _.isVertical = s => Vertical === value(spec.direction, config.direction || (s ? config.symbolDirection : config.gradientDirection));\n _.gradientLength = () => value(spec.gradientLength, config.gradientLength || config.gradientWidth);\n _.gradientThickness = () => value(spec.gradientThickness, config.gradientThickness || config.gradientHeight);\n _.entryColumns = () => value(spec.columns, value(config.columns, +_.isVertical(true)));\n return _;\n}\nfunction getEncoding(name, encode) {\n const v = encode && (encode.update && encode.update[name] || encode.enter && encode.enter[name]);\n return v && v.signal ? v : v ? v.value : null;\n}\nfunction getStyle(name, scope, style) {\n const s = scope.config.style[style];\n return s && s[name];\n}\nfunction anchorExpr(s, e, m) {\n return `item.anchor === '${Start}' ? ${s} : item.anchor === '${End}' ? ${e} : ${m}`;\n}\nconst alignExpr$1 = anchorExpr(stringValue(Left), stringValue(Right), stringValue(Center));\nfunction tickBand(_) {\n const v = _('tickBand');\n let offset = _('tickOffset'),\n band,\n extra;\n if (!v) {\n // if no tick band entry, fall back on other properties\n band = _('bandPosition');\n extra = _('tickExtra');\n } else if (v.signal) {\n // if signal, augment code to interpret values\n band = {\n signal: `(${v.signal}) === 'extent' ? 1 : 0.5`\n };\n extra = {\n signal: `(${v.signal}) === 'extent'`\n };\n if (!isObject(offset)) {\n offset = {\n signal: `(${v.signal}) === 'extent' ? 0 : ${offset}`\n };\n }\n } else if (v === 'extent') {\n // if constant, simply set values\n band = 1;\n extra = true;\n offset = 0;\n } else {\n band = 0.5;\n extra = false;\n }\n return {\n extra,\n band,\n offset\n };\n}\nfunction extendOffset(value, offset) {\n return !offset ? value : !value ? offset : !isObject(value) ? {\n value,\n offset\n } : Object.assign({}, value, {\n offset: extendOffset(value.offset, offset)\n });\n}\n\nfunction guideMark (mark, extras) {\n if (extras) {\n mark.name = extras.name;\n mark.style = extras.style || mark.style;\n mark.interactive = !!extras.interactive;\n mark.encode = extendEncode(mark.encode, extras, Skip);\n } else {\n mark.interactive = false;\n }\n return mark;\n}\n\nfunction legendGradient (spec, scale, config, userEncode) {\n const _ = lookup(spec, config),\n vertical = _.isVertical(),\n thickness = _.gradientThickness(),\n length = _.gradientLength();\n let enter, start, stop, width, height;\n if (vertical) {\n start = [0, 1];\n stop = [0, 0];\n width = thickness;\n height = length;\n } else {\n start = [0, 0];\n stop = [1, 0];\n width = length;\n height = thickness;\n }\n const encode = {\n enter: enter = {\n opacity: zero,\n x: zero,\n y: zero,\n width: encoder(width),\n height: encoder(height)\n },\n update: extend({}, enter, {\n opacity: one,\n fill: {\n gradient: scale,\n start: start,\n stop: stop\n }\n }),\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('gradientStrokeColor'),\n strokeWidth: _('gradientStrokeWidth')\n }, {\n // update\n opacity: _('gradientOpacity')\n });\n return guideMark({\n type: RectMark,\n role: LegendGradientRole,\n encode\n }, userEncode);\n}\n\nfunction legendGradientDiscrete (spec, scale, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n vertical = _.isVertical(),\n thickness = _.gradientThickness(),\n length = _.gradientLength();\n let u,\n v,\n uu,\n vv,\n adjust = '';\n vertical ? (u = 'y', uu = 'y2', v = 'x', vv = 'width', adjust = '1-') : (u = 'x', uu = 'x2', v = 'y', vv = 'height');\n const enter = {\n opacity: zero,\n fill: {\n scale: scale,\n field: Value\n }\n };\n enter[u] = {\n signal: adjust + 'datum.' + Perc,\n mult: length\n };\n enter[v] = zero;\n enter[uu] = {\n signal: adjust + 'datum.' + Perc2,\n mult: length\n };\n enter[vv] = encoder(thickness);\n const encode = {\n enter: enter,\n update: extend({}, enter, {\n opacity: one\n }),\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('gradientStrokeColor'),\n strokeWidth: _('gradientStrokeWidth')\n }, {\n // update\n opacity: _('gradientOpacity')\n });\n return guideMark({\n type: RectMark,\n role: LegendBandRole,\n key: Value,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nconst alignExpr = `datum.${Perc}<=0?\"${Left}\":datum.${Perc}>=1?\"${Right}\":\"${Center}\"`,\n baselineExpr = `datum.${Perc}<=0?\"${Bottom}\":datum.${Perc}>=1?\"${Top}\":\"${Middle}\"`;\nfunction legendGradientLabels (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n vertical = _.isVertical(),\n thickness = encoder(_.gradientThickness()),\n length = _.gradientLength();\n let overlap = _('labelOverlap'),\n enter,\n update,\n u,\n v,\n adjust = '';\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one,\n text: {\n field: Label\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n fill: _('labelColor'),\n fillOpacity: _('labelOpacity'),\n font: _('labelFont'),\n fontSize: _('labelFontSize'),\n fontStyle: _('labelFontStyle'),\n fontWeight: _('labelFontWeight'),\n limit: value(spec.labelLimit, config.gradientLabelLimit)\n });\n if (vertical) {\n enter.align = {\n value: 'left'\n };\n enter.baseline = update.baseline = {\n signal: baselineExpr\n };\n u = 'y';\n v = 'x';\n adjust = '1-';\n } else {\n enter.align = update.align = {\n signal: alignExpr\n };\n enter.baseline = {\n value: 'top'\n };\n u = 'x';\n v = 'y';\n }\n enter[u] = update[u] = {\n signal: adjust + 'datum.' + Perc,\n mult: length\n };\n enter[v] = update[v] = thickness;\n thickness.offset = value(spec.labelOffset, config.gradientLabelOffset) || 0;\n overlap = overlap ? {\n separation: _('labelSeparation'),\n method: overlap,\n order: 'datum.' + Index\n } : undefined;\n\n // type, role, style, key, dataRef, encode, extras\n return guideMark({\n type: TextMark,\n role: LegendLabelRole,\n style: GuideLabelStyle,\n key: Value,\n from: dataRef,\n encode,\n overlap\n }, userEncode);\n}\n\n// userEncode is top-level, includes entries, symbols, labels\nfunction legendSymbolGroups (spec, config, userEncode, dataRef, columns) {\n const _ = lookup(spec, config),\n entries = userEncode.entries,\n interactive = !!(entries && entries.interactive),\n name = entries ? entries.name : undefined,\n height = _('clipHeight'),\n symbolOffset = _('symbolOffset'),\n valueRef = {\n data: 'value'\n },\n xSignal = `(${columns}) ? datum.${Offset} : datum.${Size}`,\n yEncode = height ? encoder(height) : {\n field: Size\n },\n index = `datum.${Index}`,\n ncols = `max(1, ${columns})`;\n let encode, enter, update, nrows, sort;\n yEncode.mult = 0.5;\n\n // -- LEGEND SYMBOLS --\n encode = {\n enter: enter = {\n opacity: zero,\n x: {\n signal: xSignal,\n mult: 0.5,\n offset: symbolOffset\n },\n y: yEncode\n },\n update: update = {\n opacity: one,\n x: enter.x,\n y: enter.y\n },\n exit: {\n opacity: zero\n }\n };\n let baseFill = null,\n baseStroke = null;\n if (!spec.fill) {\n baseFill = config.symbolBaseFillColor;\n baseStroke = config.symbolBaseStrokeColor;\n }\n addEncoders(encode, {\n fill: _('symbolFillColor', baseFill),\n shape: _('symbolType'),\n size: _('symbolSize'),\n stroke: _('symbolStrokeColor', baseStroke),\n strokeDash: _('symbolDash'),\n strokeDashOffset: _('symbolDashOffset'),\n strokeWidth: _('symbolStrokeWidth')\n }, {\n // update\n opacity: _('symbolOpacity')\n });\n LegendScales.forEach(scale => {\n if (spec[scale]) {\n update[scale] = enter[scale] = {\n scale: spec[scale],\n field: Value\n };\n }\n });\n const symbols = guideMark({\n type: SymbolMark,\n role: LegendSymbolRole,\n key: Value,\n from: valueRef,\n clip: height ? true : undefined,\n encode\n }, userEncode.symbols);\n\n // -- LEGEND LABELS --\n const labelOffset = encoder(symbolOffset);\n labelOffset.offset = _('labelOffset');\n encode = {\n enter: enter = {\n opacity: zero,\n x: {\n signal: xSignal,\n offset: labelOffset\n },\n y: yEncode\n },\n update: update = {\n opacity: one,\n text: {\n field: Label\n },\n x: enter.x,\n y: enter.y\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n align: _('labelAlign'),\n baseline: _('labelBaseline'),\n fill: _('labelColor'),\n fillOpacity: _('labelOpacity'),\n font: _('labelFont'),\n fontSize: _('labelFontSize'),\n fontStyle: _('labelFontStyle'),\n fontWeight: _('labelFontWeight'),\n limit: _('labelLimit')\n });\n const labels = guideMark({\n type: TextMark,\n role: LegendLabelRole,\n style: GuideLabelStyle,\n key: Value,\n from: valueRef,\n encode\n }, userEncode.labels);\n\n // -- LEGEND ENTRY GROUPS --\n encode = {\n enter: {\n noBound: {\n value: !height\n },\n // ignore width/height in bounds calc\n width: zero,\n height: height ? encoder(height) : zero,\n opacity: zero\n },\n exit: {\n opacity: zero\n },\n update: update = {\n opacity: one,\n row: {\n signal: null\n },\n column: {\n signal: null\n }\n }\n };\n\n // annotate and sort groups to ensure correct ordering\n if (_.isVertical(true)) {\n nrows = `ceil(item.mark.items.length / ${ncols})`;\n update.row.signal = `${index}%${nrows}`;\n update.column.signal = `floor(${index} / ${nrows})`;\n sort = {\n field: ['row', index]\n };\n } else {\n update.row.signal = `floor(${index} / ${ncols})`;\n update.column.signal = `${index} % ${ncols}`;\n sort = {\n field: index\n };\n }\n // handle zero column case (implies infinite columns)\n update.column.signal = `(${columns})?${update.column.signal}:${index}`;\n\n // facet legend entries into sub-groups\n dataRef = {\n facet: {\n data: dataRef,\n name: 'value',\n groupby: Index\n }\n };\n return guideGroup({\n role: ScopeRole,\n from: dataRef,\n encode: extendEncode(encode, entries, Skip),\n marks: [symbols, labels],\n name,\n interactive,\n sort\n });\n}\nfunction legendSymbolLayout(spec, config) {\n const _ = lookup(spec, config);\n\n // layout parameters for legend entries\n return {\n align: _('gridAlign'),\n columns: _.entryColumns(),\n center: {\n row: true,\n column: false\n },\n padding: {\n row: _('rowPadding'),\n column: _('columnPadding')\n }\n };\n}\n\n// expression logic for align, anchor, angle, and baseline calculation\nconst isL = 'item.orient === \"left\"',\n isR = 'item.orient === \"right\"',\n isLR = `(${isL} || ${isR})`,\n isVG = `datum.vgrad && ${isLR}`,\n baseline = anchorExpr('\"top\"', '\"bottom\"', '\"middle\"'),\n alignFlip = anchorExpr('\"right\"', '\"left\"', '\"center\"'),\n exprAlign = `datum.vgrad && ${isR} ? (${alignFlip}) : (${isLR} && !(datum.vgrad && ${isL})) ? \"left\" : ${alignExpr$1}`,\n exprAnchor = `item._anchor || (${isLR} ? \"middle\" : \"start\")`,\n exprAngle = `${isVG} ? (${isL} ? -90 : 90) : 0`,\n exprBaseline = `${isLR} ? (datum.vgrad ? (${isR} ? \"bottom\" : \"top\") : ${baseline}) : \"top\"`;\nfunction legendTitle (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config);\n const encode = {\n enter: {\n opacity: zero\n },\n update: {\n opacity: one,\n x: {\n field: {\n group: 'padding'\n }\n },\n y: {\n field: {\n group: 'padding'\n }\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n orient: _('titleOrient'),\n _anchor: _('titleAnchor'),\n anchor: {\n signal: exprAnchor\n },\n angle: {\n signal: exprAngle\n },\n align: {\n signal: exprAlign\n },\n baseline: {\n signal: exprBaseline\n },\n text: spec.title,\n fill: _('titleColor'),\n fillOpacity: _('titleOpacity'),\n font: _('titleFont'),\n fontSize: _('titleFontSize'),\n fontStyle: _('titleFontStyle'),\n fontWeight: _('titleFontWeight'),\n limit: _('titleLimit'),\n lineHeight: _('titleLineHeight')\n }, {\n // require update\n align: _('titleAlign'),\n baseline: _('titleBaseline')\n });\n return guideMark({\n type: TextMark,\n role: LegendTitleRole,\n style: GuideTitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction clip (clip, scope) {\n let expr;\n if (isObject(clip)) {\n if (clip.signal) {\n expr = clip.signal;\n } else if (clip.path) {\n expr = 'pathShape(' + param(clip.path) + ')';\n } else if (clip.sphere) {\n expr = 'geoShape(' + param(clip.sphere) + ', {type: \"Sphere\"})';\n }\n }\n return expr ? scope.signalRef(expr) : !!clip;\n}\nfunction param(value) {\n return isObject(value) && value.signal ? value.signal : stringValue(value);\n}\n\nfunction getRole (spec) {\n const role = spec.role || '';\n return role.startsWith('axis') || role.startsWith('legend') || role.startsWith('title') ? role : spec.type === GroupMark ? ScopeRole : role || MarkRole;\n}\n\nfunction definition (spec) {\n return {\n marktype: spec.type,\n name: spec.name || undefined,\n role: spec.role || getRole(spec),\n zindex: +spec.zindex || undefined,\n aria: spec.aria,\n description: spec.description\n };\n}\n\nfunction interactive (spec, scope) {\n return spec && spec.signal ? scope.signalRef(spec.signal) : spec === false ? false : true;\n}\n\n/**\n * Parse a data transform specification.\n */\nfunction parseTransform (spec, scope) {\n const def = definition$1(spec.type);\n if (!def) error('Unrecognized transform type: ' + stringValue(spec.type));\n const t = entry(def.type.toLowerCase(), null, parseParameters(def, spec, scope));\n if (spec.signal) scope.addSignal(spec.signal, scope.proxy(t));\n t.metadata = def.metadata || {};\n return t;\n}\n\n/**\n * Parse all parameters of a data transform.\n */\nfunction parseParameters(def, spec, scope) {\n const params = {},\n n = def.params.length;\n for (let i = 0; i < n; ++i) {\n const pdef = def.params[i];\n params[pdef.name] = parseParameter(pdef, spec, scope);\n }\n return params;\n}\n\n/**\n * Parse a data transform parameter.\n */\nfunction parseParameter(def, spec, scope) {\n const type = def.type,\n value = spec[def.name];\n if (type === 'index') {\n return parseIndexParameter(def, spec, scope);\n } else if (value === undefined) {\n if (def.required) {\n error('Missing required ' + stringValue(spec.type) + ' parameter: ' + stringValue(def.name));\n }\n return;\n } else if (type === 'param') {\n return parseSubParameters(def, spec, scope);\n } else if (type === 'projection') {\n return scope.projectionRef(spec[def.name]);\n }\n return def.array && !isSignal(value) ? value.map(v => parameterValue(def, v, scope)) : parameterValue(def, value, scope);\n}\n\n/**\n * Parse a single parameter value.\n */\nfunction parameterValue(def, value, scope) {\n const type = def.type;\n if (isSignal(value)) {\n return isExpr(type) ? error('Expression references can not be signals.') : isField(type) ? scope.fieldRef(value) : isCompare(type) ? scope.compareRef(value) : scope.signalRef(value.signal);\n } else {\n const expr = def.expr || isField(type);\n return expr && outerExpr(value) ? scope.exprRef(value.expr, value.as) : expr && outerField(value) ? fieldRef$1(value.field, value.as) : isExpr(type) ? parseExpression(value, scope) : isData(type) ? ref(scope.getData(value).values) : isField(type) ? fieldRef$1(value) : isCompare(type) ? scope.compareRef(value) : value;\n }\n}\n\n/**\n * Parse parameter for accessing an index of another data set.\n */\nfunction parseIndexParameter(def, spec, scope) {\n if (!isString(spec.from)) {\n error('Lookup \"from\" parameter must be a string literal.');\n }\n return scope.getData(spec.from).lookupRef(scope, spec.key);\n}\n\n/**\n * Parse a parameter that contains one or more sub-parameter objects.\n */\nfunction parseSubParameters(def, spec, scope) {\n const value = spec[def.name];\n if (def.array) {\n if (!isArray(value)) {\n // signals not allowed!\n error('Expected an array of sub-parameters. Instead: ' + stringValue(value));\n }\n return value.map(v => parseSubParameter(def, v, scope));\n } else {\n return parseSubParameter(def, value, scope);\n }\n}\n\n/**\n * Parse a sub-parameter object.\n */\nfunction parseSubParameter(def, value, scope) {\n const n = def.params.length;\n let pdef;\n\n // loop over defs to find matching key\n for (let i = 0; i < n; ++i) {\n pdef = def.params[i];\n for (const k in pdef.key) {\n if (pdef.key[k] !== value[k]) {\n pdef = null;\n break;\n }\n }\n if (pdef) break;\n }\n // raise error if matching key not found\n if (!pdef) error('Unsupported parameter: ' + stringValue(value));\n\n // parse params, create Params transform, return ref\n const params = extend(parseParameters(pdef, value, scope), pdef.key);\n return ref(scope.add(Params(params)));\n}\n\n// -- Utilities -----\n\nconst outerExpr = _ => _ && _.expr;\nconst outerField = _ => _ && _.field;\nconst isData = _ => _ === 'data';\nconst isExpr = _ => _ === 'expr';\nconst isField = _ => _ === 'field';\nconst isCompare = _ => _ === 'compare';\n\nfunction parseData$1 (from, group, scope) {\n let facet, key, op, dataRef, parent;\n\n // if no source data, generate singleton datum\n if (!from) {\n dataRef = ref(scope.add(Collect(null, [{}])));\n }\n\n // if faceted, process facet specification\n else if (facet = from.facet) {\n if (!group) error('Only group marks can be faceted.');\n\n // use pre-faceted source data, if available\n if (facet.field != null) {\n dataRef = parent = getDataRef(facet, scope);\n } else {\n // generate facet aggregates if no direct data specification\n if (!from.data) {\n op = parseTransform(extend({\n type: 'aggregate',\n groupby: array(facet.groupby)\n }, facet.aggregate), scope);\n op.params.key = scope.keyRef(facet.groupby);\n op.params.pulse = getDataRef(facet, scope);\n dataRef = parent = ref(scope.add(op));\n } else {\n parent = ref(scope.getData(from.data).aggregate);\n }\n key = scope.keyRef(facet.groupby, true);\n }\n }\n\n // if not yet defined, get source data reference\n if (!dataRef) {\n dataRef = getDataRef(from, scope);\n }\n return {\n key: key,\n pulse: dataRef,\n parent: parent\n };\n}\nfunction getDataRef(from, scope) {\n return from.$ref ? from : from.data && from.data.$ref ? from.data : ref(scope.getData(from.data).output);\n}\n\nfunction DataScope(scope, input, output, values, aggr) {\n this.scope = scope; // parent scope object\n this.input = input; // first operator in pipeline (tuple input)\n this.output = output; // last operator in pipeline (tuple output)\n this.values = values; // operator for accessing tuples (but not tuple flow)\n\n // last aggregate in transform pipeline\n this.aggregate = aggr;\n\n // lookup table of field indices\n this.index = {};\n}\nDataScope.fromEntries = function (scope, entries) {\n const n = entries.length,\n values = entries[n - 1],\n output = entries[n - 2];\n let input = entries[0],\n aggr = null,\n i = 1;\n if (input && input.type === 'load') {\n input = entries[1];\n }\n\n // add operator entries to this scope, wire up pulse chain\n scope.add(entries[0]);\n for (; i < n; ++i) {\n entries[i].params.pulse = ref(entries[i - 1]);\n scope.add(entries[i]);\n if (entries[i].type === 'aggregate') aggr = entries[i];\n }\n return new DataScope(scope, input, output, values, aggr);\n};\nfunction fieldKey(field) {\n return isString(field) ? field : null;\n}\nfunction addSortField(scope, p, sort) {\n const as = aggrField(sort.op, sort.field);\n let s;\n if (p.ops) {\n for (let i = 0, n = p.as.length; i < n; ++i) {\n if (p.as[i] === as) return;\n }\n } else {\n p.ops = ['count'];\n p.fields = [null];\n p.as = ['count'];\n }\n if (sort.op) {\n p.ops.push((s = sort.op.signal) ? scope.signalRef(s) : sort.op);\n p.fields.push(scope.fieldRef(sort.field));\n p.as.push(as);\n }\n}\nfunction cache(scope, ds, name, optype, field, counts, index) {\n const cache = ds[name] || (ds[name] = {}),\n sort = sortKey(counts);\n let k = fieldKey(field),\n v,\n op;\n if (k != null) {\n scope = ds.scope;\n k = k + (sort ? '|' + sort : '');\n v = cache[k];\n }\n if (!v) {\n const params = counts ? {\n field: keyFieldRef,\n pulse: ds.countsRef(scope, field, counts)\n } : {\n field: scope.fieldRef(field),\n pulse: ref(ds.output)\n };\n if (sort) params.sort = scope.sortRef(counts);\n op = scope.add(entry(optype, undefined, params));\n if (index) ds.index[field] = op;\n v = ref(op);\n if (k != null) cache[k] = v;\n }\n return v;\n}\nDataScope.prototype = {\n countsRef(scope, field, sort) {\n const ds = this,\n cache = ds.counts || (ds.counts = {}),\n k = fieldKey(field);\n let v, a, p;\n if (k != null) {\n scope = ds.scope;\n v = cache[k];\n }\n if (!v) {\n p = {\n groupby: scope.fieldRef(field, 'key'),\n pulse: ref(ds.output)\n };\n if (sort && sort.field) addSortField(scope, p, sort);\n a = scope.add(Aggregate(p));\n v = scope.add(Collect({\n pulse: ref(a)\n }));\n v = {\n agg: a,\n ref: ref(v)\n };\n if (k != null) cache[k] = v;\n } else if (sort && sort.field) {\n addSortField(scope, v.agg.params, sort);\n }\n return v.ref;\n },\n tuplesRef() {\n return ref(this.values);\n },\n extentRef(scope, field) {\n return cache(scope, this, 'extent', 'extent', field, false);\n },\n domainRef(scope, field) {\n return cache(scope, this, 'domain', 'values', field, false);\n },\n valuesRef(scope, field, sort) {\n return cache(scope, this, 'vals', 'values', field, sort || true);\n },\n lookupRef(scope, field) {\n return cache(scope, this, 'lookup', 'tupleindex', field, false);\n },\n indataRef(scope, field) {\n return cache(scope, this, 'indata', 'tupleindex', field, true, true);\n }\n};\n\nfunction parseFacet (spec, scope, group) {\n const facet = spec.from.facet,\n name = facet.name,\n data = getDataRef(facet, scope);\n let op;\n if (!facet.name) {\n error('Facet must have a name: ' + stringValue(facet));\n }\n if (!facet.data) {\n error('Facet must reference a data set: ' + stringValue(facet));\n }\n if (facet.field) {\n op = scope.add(PreFacet({\n field: scope.fieldRef(facet.field),\n pulse: data\n }));\n } else if (facet.groupby) {\n op = scope.add(Facet({\n key: scope.keyRef(facet.groupby),\n group: ref(scope.proxy(group.parent)),\n pulse: data\n }));\n } else {\n error('Facet must specify groupby or field: ' + stringValue(facet));\n }\n\n // initialize facet subscope\n const subscope = scope.fork(),\n source = subscope.add(Collect()),\n values = subscope.add(Sieve({\n pulse: ref(source)\n }));\n subscope.addData(name, new DataScope(subscope, source, source, values));\n subscope.addSignal('parent', null);\n\n // parse faceted subflow\n op.params.subflow = {\n $subflow: subscope.parse(spec).toRuntime()\n };\n}\n\nfunction parseSubflow (spec, scope, input) {\n const op = scope.add(PreFacet({\n pulse: input.pulse\n })),\n subscope = scope.fork();\n subscope.add(Sieve());\n subscope.addSignal('parent', null);\n\n // parse group mark subflow\n op.params.subflow = {\n $subflow: subscope.parse(spec).toRuntime()\n };\n}\n\nfunction parseTrigger (spec, scope, name) {\n const remove = spec.remove,\n insert = spec.insert,\n toggle = spec.toggle,\n modify = spec.modify,\n values = spec.values,\n op = scope.add(operator());\n const update = 'if(' + spec.trigger + ',modify(\"' + name + '\",' + [insert, remove, toggle, modify, values].map(_ => _ == null ? 'null' : _).join(',') + '),0)';\n const expr = parseExpression(update, scope);\n op.update = expr.$expr;\n op.params = expr.$params;\n}\n\nfunction parseMark (spec, scope) {\n const role = getRole(spec),\n group = spec.type === GroupMark,\n facet = spec.from && spec.from.facet,\n overlap = spec.overlap;\n let layout = spec.layout || role === ScopeRole || role === FrameRole,\n ops,\n op,\n store,\n enc,\n name,\n layoutRef,\n boundRef;\n const nested = role === MarkRole || layout || facet;\n\n // resolve input data\n const input = parseData$1(spec.from, group, scope);\n\n // data join to map tuples to visual items\n op = scope.add(DataJoin({\n key: input.key || (spec.key ? fieldRef$1(spec.key) : undefined),\n pulse: input.pulse,\n clean: !group\n }));\n const joinRef = ref(op);\n\n // collect visual items\n op = store = scope.add(Collect({\n pulse: joinRef\n }));\n\n // connect visual items to scenegraph\n op = scope.add(Mark({\n markdef: definition(spec),\n interactive: interactive(spec.interactive, scope),\n clip: clip(spec.clip, scope),\n context: {\n $context: true\n },\n groups: scope.lookup(),\n parent: scope.signals.parent ? scope.signalRef('parent') : null,\n index: scope.markpath(),\n pulse: ref(op)\n }));\n const markRef = ref(op);\n\n // add visual encoders\n op = enc = scope.add(Encode(parseEncode(spec.encode, spec.type, role, spec.style, scope, {\n mod: false,\n pulse: markRef\n })));\n\n // monitor parent marks to propagate changes\n op.params.parent = scope.encode();\n\n // add post-encoding transforms, if defined\n if (spec.transform) {\n spec.transform.forEach(_ => {\n const tx = parseTransform(_, scope),\n md = tx.metadata;\n if (md.generates || md.changes) {\n error('Mark transforms should not generate new data.');\n }\n if (!md.nomod) enc.params.mod = true; // update encode mod handling\n tx.params.pulse = ref(op);\n scope.add(op = tx);\n });\n }\n\n // if item sort specified, perform post-encoding\n if (spec.sort) {\n op = scope.add(SortItems({\n sort: scope.compareRef(spec.sort),\n pulse: ref(op)\n }));\n }\n const encodeRef = ref(op);\n\n // add view layout operator if needed\n if (facet || layout) {\n layout = scope.add(ViewLayout({\n layout: scope.objectProperty(spec.layout),\n legends: scope.legends,\n mark: markRef,\n pulse: encodeRef\n }));\n layoutRef = ref(layout);\n }\n\n // compute bounding boxes\n const bound = scope.add(Bound({\n mark: markRef,\n pulse: layoutRef || encodeRef\n }));\n boundRef = ref(bound);\n\n // if group mark, recurse to parse nested content\n if (group) {\n // juggle layout & bounds to ensure they run *after* any faceting transforms\n if (nested) {\n ops = scope.operators;\n ops.pop();\n if (layout) ops.pop();\n }\n scope.pushState(encodeRef, layoutRef || boundRef, joinRef);\n facet ? parseFacet(spec, scope, input) // explicit facet\n : nested ? parseSubflow(spec, scope, input) // standard mark group\n : scope.parse(spec); // guide group, we can avoid nested scopes\n scope.popState();\n if (nested) {\n if (layout) ops.push(layout);\n ops.push(bound);\n }\n }\n\n // if requested, add overlap removal transform\n if (overlap) {\n boundRef = parseOverlap(overlap, boundRef, scope);\n }\n\n // render / sieve items\n const render = scope.add(Render({\n pulse: boundRef\n })),\n sieve = scope.add(Sieve({\n pulse: ref(render)\n }, undefined, scope.parent()));\n\n // if mark is named, make accessible as reactive geometry\n // add trigger updates if defined\n if (spec.name != null) {\n name = spec.name;\n scope.addData(name, new DataScope(scope, store, render, sieve));\n if (spec.on) spec.on.forEach(on => {\n if (on.insert || on.remove || on.toggle) {\n error('Marks only support modify triggers.');\n }\n parseTrigger(on, scope, name);\n });\n }\n}\nfunction parseOverlap(overlap, source, scope) {\n const method = overlap.method,\n bound = overlap.bound,\n sep = overlap.separation;\n const params = {\n separation: isSignal(sep) ? scope.signalRef(sep.signal) : sep,\n method: isSignal(method) ? scope.signalRef(method.signal) : method,\n pulse: source\n };\n if (overlap.order) {\n params.sort = scope.compareRef({\n field: overlap.order\n });\n }\n if (bound) {\n const tol = bound.tolerance;\n params.boundTolerance = isSignal(tol) ? scope.signalRef(tol.signal) : +tol;\n params.boundScale = scope.scaleRef(bound.scale);\n params.boundOrient = bound.orient;\n }\n return ref(scope.add(Overlap(params)));\n}\n\nfunction parseLegend (spec, scope) {\n const config = scope.config.legend,\n encode = spec.encode || {},\n _ = lookup(spec, config),\n legendEncode = encode.legend || {},\n name = legendEncode.name || undefined,\n interactive = legendEncode.interactive,\n style = legendEncode.style,\n scales = {};\n let scale = 0,\n entryLayout,\n params,\n children;\n\n // resolve scales and 'canonical' scale name\n LegendScales.forEach(s => spec[s] ? (scales[s] = spec[s], scale = scale || spec[s]) : 0);\n if (!scale) error('Missing valid scale for legend.');\n\n // resolve legend type (symbol, gradient, or discrete gradient)\n const type = legendType(spec, scope.scaleType(scale));\n\n // single-element data source for legend group\n const datum = {\n title: spec.title != null,\n scales: scales,\n type: type,\n vgrad: type !== 'symbol' && _.isVertical()\n };\n const dataRef = ref(scope.add(Collect(null, [datum])));\n\n // encoding properties for legend entry sub-group\n const entryEncode = {\n enter: {\n x: {\n value: 0\n },\n y: {\n value: 0\n }\n }\n };\n\n // data source for legend values\n const entryRef = ref(scope.add(LegendEntries(params = {\n type: type,\n scale: scope.scaleRef(scale),\n count: scope.objectProperty(_('tickCount')),\n limit: scope.property(_('symbolLimit')),\n values: scope.objectProperty(spec.values),\n minstep: scope.property(spec.tickMinStep),\n formatType: scope.property(spec.formatType),\n formatSpecifier: scope.property(spec.format)\n })));\n\n // continuous gradient legend\n if (type === Gradient) {\n children = [legendGradient(spec, scale, config, encode.gradient), legendGradientLabels(spec, config, encode.labels, entryRef)];\n // adjust default tick count based on the gradient length\n params.count = params.count || scope.signalRef(`max(2,2*floor((${deref(_.gradientLength())})/100))`);\n }\n\n // discrete gradient legend\n else if (type === Discrete) {\n children = [legendGradientDiscrete(spec, scale, config, encode.gradient, entryRef), legendGradientLabels(spec, config, encode.labels, entryRef)];\n }\n\n // symbol legend\n else {\n // determine legend symbol group layout\n entryLayout = legendSymbolLayout(spec, config);\n children = [legendSymbolGroups(spec, config, encode, entryRef, deref(entryLayout.columns))];\n // pass symbol size information to legend entry generator\n params.size = sizeExpression(spec, scope, children[0].marks);\n }\n\n // generate legend marks\n children = [guideGroup({\n role: LegendEntryRole,\n from: dataRef,\n encode: entryEncode,\n marks: children,\n layout: entryLayout,\n interactive\n })];\n\n // include legend title if defined\n if (datum.title) {\n children.push(legendTitle(spec, config, encode.title, dataRef));\n }\n\n // parse legend specification\n return parseMark(guideGroup({\n role: LegendRole,\n from: dataRef,\n encode: extendEncode(buildLegendEncode(_, spec, config), legendEncode, Skip),\n marks: children,\n aria: _('aria'),\n description: _('description'),\n zindex: _('zindex'),\n name,\n interactive,\n style\n }), scope);\n}\nfunction legendType(spec, scaleType) {\n let type = spec.type || Symbols;\n if (!spec.type && scaleCount(spec) === 1 && (spec.fill || spec.stroke)) {\n type = isContinuous(scaleType) ? Gradient : isDiscretizing(scaleType) ? Discrete : Symbols;\n }\n return type !== Gradient ? type : isDiscretizing(scaleType) ? Discrete : Gradient;\n}\nfunction scaleCount(spec) {\n return LegendScales.reduce((count, type) => count + (spec[type] ? 1 : 0), 0);\n}\nfunction buildLegendEncode(_, spec, config) {\n const encode = {\n enter: {},\n update: {}\n };\n addEncoders(encode, {\n orient: _('orient'),\n offset: _('offset'),\n padding: _('padding'),\n titlePadding: _('titlePadding'),\n cornerRadius: _('cornerRadius'),\n fill: _('fillColor'),\n stroke: _('strokeColor'),\n strokeWidth: config.strokeWidth,\n strokeDash: config.strokeDash,\n x: _('legendX'),\n y: _('legendY'),\n // accessibility support\n format: spec.format,\n formatType: spec.formatType\n });\n return encode;\n}\nfunction sizeExpression(spec, scope, marks) {\n const size = deref(getChannel('size', spec, marks)),\n strokeWidth = deref(getChannel('strokeWidth', spec, marks)),\n fontSize = deref(getFontSize(marks[1].encode, scope, GuideLabelStyle));\n return parseExpression(`max(ceil(sqrt(${size})+${strokeWidth}),${fontSize})`, scope);\n}\nfunction getChannel(name, spec, marks) {\n return spec[name] ? `scale(\"${spec[name]}\",datum)` : getEncoding(name, marks[0].encode);\n}\nfunction getFontSize(encode, scope, style) {\n return getEncoding('fontSize', encode) || getStyle('fontSize', scope, style);\n}\n\nconst angleExpr = `item.orient===\"${Left}\"?-90:item.orient===\"${Right}\"?90:0`;\nfunction parseTitle (spec, scope) {\n spec = isString(spec) ? {\n text: spec\n } : spec;\n const _ = lookup(spec, scope.config.title),\n encode = spec.encode || {},\n userEncode = encode.group || {},\n name = userEncode.name || undefined,\n interactive = userEncode.interactive,\n style = userEncode.style,\n children = [];\n\n // single-element data source for group title\n const datum = {},\n dataRef = ref(scope.add(Collect(null, [datum])));\n\n // include title text\n children.push(buildTitle(spec, _, titleEncode(spec), dataRef));\n\n // include subtitle text\n if (spec.subtitle) {\n children.push(buildSubTitle(spec, _, encode.subtitle, dataRef));\n }\n\n // parse title specification\n return parseMark(guideGroup({\n role: TitleRole,\n from: dataRef,\n encode: groupEncode(_, userEncode),\n marks: children,\n aria: _('aria'),\n description: _('description'),\n zindex: _('zindex'),\n name,\n interactive,\n style\n }), scope);\n}\n\n// provide backwards-compatibility for title custom encode;\n// the top-level encode block has been *deprecated*.\nfunction titleEncode(spec) {\n const encode = spec.encode;\n return encode && encode.title || extend({\n name: spec.name,\n interactive: spec.interactive,\n style: spec.style\n }, encode);\n}\nfunction groupEncode(_, userEncode) {\n const encode = {\n enter: {},\n update: {}\n };\n addEncoders(encode, {\n orient: _('orient'),\n anchor: _('anchor'),\n align: {\n signal: alignExpr$1\n },\n angle: {\n signal: angleExpr\n },\n limit: _('limit'),\n frame: _('frame'),\n offset: _('offset') || 0,\n padding: _('subtitlePadding')\n });\n return extendEncode(encode, userEncode, Skip);\n}\nfunction buildTitle(spec, _, userEncode, dataRef) {\n const zero = {\n value: 0\n },\n text = spec.text,\n encode = {\n enter: {\n opacity: zero\n },\n update: {\n opacity: {\n value: 1\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n text: text,\n align: {\n signal: 'item.mark.group.align'\n },\n angle: {\n signal: 'item.mark.group.angle'\n },\n limit: {\n signal: 'item.mark.group.limit'\n },\n baseline: 'top',\n dx: _('dx'),\n dy: _('dy'),\n fill: _('color'),\n font: _('font'),\n fontSize: _('fontSize'),\n fontStyle: _('fontStyle'),\n fontWeight: _('fontWeight'),\n lineHeight: _('lineHeight')\n }, {\n // update\n align: _('align'),\n angle: _('angle'),\n baseline: _('baseline')\n });\n return guideMark({\n type: TextMark,\n role: TitleTextRole,\n style: GroupTitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\nfunction buildSubTitle(spec, _, userEncode, dataRef) {\n const zero = {\n value: 0\n },\n text = spec.subtitle,\n encode = {\n enter: {\n opacity: zero\n },\n update: {\n opacity: {\n value: 1\n }\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n text: text,\n align: {\n signal: 'item.mark.group.align'\n },\n angle: {\n signal: 'item.mark.group.angle'\n },\n limit: {\n signal: 'item.mark.group.limit'\n },\n baseline: 'top',\n dx: _('dx'),\n dy: _('dy'),\n fill: _('subtitleColor'),\n font: _('subtitleFont'),\n fontSize: _('subtitleFontSize'),\n fontStyle: _('subtitleFontStyle'),\n fontWeight: _('subtitleFontWeight'),\n lineHeight: _('subtitleLineHeight')\n }, {\n // update\n align: _('align'),\n angle: _('angle'),\n baseline: _('baseline')\n });\n return guideMark({\n type: TextMark,\n role: TitleSubtitleRole,\n style: GroupSubtitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction parseData(data, scope) {\n const transforms = [];\n if (data.transform) {\n data.transform.forEach(tx => {\n transforms.push(parseTransform(tx, scope));\n });\n }\n if (data.on) {\n data.on.forEach(on => {\n parseTrigger(on, scope, data.name);\n });\n }\n scope.addDataPipeline(data.name, analyze(data, scope, transforms));\n}\n\n/**\n * Analyze a data pipeline, add needed operators.\n */\nfunction analyze(data, scope, ops) {\n const output = [];\n let source = null,\n modify = false,\n generate = false,\n upstream,\n i,\n n,\n t,\n m;\n if (data.values) {\n // hard-wired input data set\n if (isSignal(data.values) || hasSignal(data.format)) {\n // if either values is signal or format has signal, use dynamic loader\n output.push(load(scope, data));\n output.push(source = collect());\n } else {\n // otherwise, ingest upon dataflow init\n output.push(source = collect({\n $ingest: data.values,\n $format: data.format\n }));\n }\n } else if (data.url) {\n // load data from external source\n if (hasSignal(data.url) || hasSignal(data.format)) {\n // if either url or format has signal, use dynamic loader\n output.push(load(scope, data));\n output.push(source = collect());\n } else {\n // otherwise, request load upon dataflow init\n output.push(source = collect({\n $request: data.url,\n $format: data.format\n }));\n }\n } else if (data.source) {\n // derives from one or more other data sets\n source = upstream = array(data.source).map(d => ref(scope.getData(d).output));\n output.push(null); // populate later\n }\n\n // scan data transforms, add collectors as needed\n for (i = 0, n = ops.length; i < n; ++i) {\n t = ops[i];\n m = t.metadata;\n if (!source && !m.source) {\n output.push(source = collect());\n }\n output.push(t);\n if (m.generates) generate = true;\n if (m.modifies && !generate) modify = true;\n if (m.source) source = t;else if (m.changes) source = null;\n }\n if (upstream) {\n n = upstream.length - 1;\n output[0] = Relay({\n derive: modify,\n pulse: n ? upstream : upstream[0]\n });\n if (modify || n) {\n // collect derived and multi-pulse tuples\n output.splice(1, 0, collect());\n }\n }\n if (!source) output.push(collect());\n output.push(Sieve({}));\n return output;\n}\nfunction collect(values) {\n const s = Collect({}, values);\n s.metadata = {\n source: true\n };\n return s;\n}\nfunction load(scope, data) {\n return Load({\n url: data.url ? scope.property(data.url) : undefined,\n async: data.async ? scope.property(data.async) : undefined,\n values: data.values ? scope.property(data.values) : undefined,\n format: scope.objectProperty(data.format)\n });\n}\n\nconst isX = orient => orient === Bottom || orient === Top;\n\n// get sign coefficient based on axis orient\nconst getSign = (orient, a, b) => isSignal(orient) ? ifLeftTopExpr(orient.signal, a, b) : orient === Left || orient === Top ? a : b;\n\n// condition on axis x-direction\nconst ifX = (orient, a, b) => isSignal(orient) ? ifXEnc(orient.signal, a, b) : isX(orient) ? a : b;\n\n// condition on axis y-direction\nconst ifY = (orient, a, b) => isSignal(orient) ? ifYEnc(orient.signal, a, b) : isX(orient) ? b : a;\nconst ifTop = (orient, a, b) => isSignal(orient) ? ifTopExpr(orient.signal, a, b) : orient === Top ? {\n value: a\n} : {\n value: b\n};\nconst ifRight = (orient, a, b) => isSignal(orient) ? ifRightExpr(orient.signal, a, b) : orient === Right ? {\n value: a\n} : {\n value: b\n};\nconst ifXEnc = ($orient, a, b) => ifEnc(`${$orient} === '${Top}' || ${$orient} === '${Bottom}'`, a, b);\nconst ifYEnc = ($orient, a, b) => ifEnc(`${$orient} !== '${Top}' && ${$orient} !== '${Bottom}'`, a, b);\nconst ifLeftTopExpr = ($orient, a, b) => ifExpr(`${$orient} === '${Left}' || ${$orient} === '${Top}'`, a, b);\nconst ifTopExpr = ($orient, a, b) => ifExpr(`${$orient} === '${Top}'`, a, b);\nconst ifRightExpr = ($orient, a, b) => ifExpr(`${$orient} === '${Right}'`, a, b);\nconst ifEnc = (test, a, b) => {\n // ensure inputs are encoder objects (or null)\n a = a != null ? encoder(a) : a;\n b = b != null ? encoder(b) : b;\n if (isSimple(a) && isSimple(b)) {\n // if possible generate simple signal expression\n a = a ? a.signal || stringValue(a.value) : null;\n b = b ? b.signal || stringValue(b.value) : null;\n return {\n signal: `${test} ? (${a}) : (${b})`\n };\n } else {\n // otherwise generate rule set\n return [extend({\n test\n }, a)].concat(b || []);\n }\n};\nconst isSimple = enc => enc == null || Object.keys(enc).length === 1;\nconst ifExpr = (test, a, b) => ({\n signal: `${test} ? (${toExpr(a)}) : (${toExpr(b)})`\n});\nconst ifOrient = ($orient, t, b, l, r) => ({\n signal: (l != null ? `${$orient} === '${Left}' ? (${toExpr(l)}) : ` : '') + (b != null ? `${$orient} === '${Bottom}' ? (${toExpr(b)}) : ` : '') + (r != null ? `${$orient} === '${Right}' ? (${toExpr(r)}) : ` : '') + (t != null ? `${$orient} === '${Top}' ? (${toExpr(t)}) : ` : '') + '(null)'\n});\nconst toExpr = v => isSignal(v) ? v.signal : v == null ? null : stringValue(v);\nconst mult = (sign, value) => value === 0 ? 0 : isSignal(sign) ? {\n signal: `(${sign.signal}) * ${value}`\n} : {\n value: sign * value\n};\nconst patch = (value, base) => {\n const s = value.signal;\n return s && s.endsWith('(null)') ? {\n signal: s.slice(0, -6) + base.signal\n } : value;\n};\n\nfunction fallback(prop, config, axisConfig, style) {\n let styleProp;\n if (config && hasOwnProperty(config, prop)) {\n return config[prop];\n } else if (hasOwnProperty(axisConfig, prop)) {\n return axisConfig[prop];\n } else if (prop.startsWith('title')) {\n switch (prop) {\n case 'titleColor':\n styleProp = 'fill';\n break;\n case 'titleFont':\n case 'titleFontSize':\n case 'titleFontWeight':\n styleProp = prop[5].toLowerCase() + prop.slice(6);\n }\n return style[GuideTitleStyle][styleProp];\n } else if (prop.startsWith('label')) {\n switch (prop) {\n case 'labelColor':\n styleProp = 'fill';\n break;\n case 'labelFont':\n case 'labelFontSize':\n styleProp = prop[5].toLowerCase() + prop.slice(6);\n }\n return style[GuideLabelStyle][styleProp];\n }\n return null;\n}\nfunction keys(objects) {\n const map = {};\n for (const obj of objects) {\n if (!obj) continue;\n for (const key in obj) map[key] = 1;\n }\n return Object.keys(map);\n}\nfunction axisConfig (spec, scope) {\n var config = scope.config,\n style = config.style,\n axis = config.axis,\n band = scope.scaleType(spec.scale) === 'band' && config.axisBand,\n orient = spec.orient,\n xy,\n or,\n key;\n if (isSignal(orient)) {\n const xyKeys = keys([config.axisX, config.axisY]),\n orientKeys = keys([config.axisTop, config.axisBottom, config.axisLeft, config.axisRight]);\n xy = {};\n for (key of xyKeys) {\n xy[key] = ifX(orient, fallback(key, config.axisX, axis, style), fallback(key, config.axisY, axis, style));\n }\n or = {};\n for (key of orientKeys) {\n or[key] = ifOrient(orient.signal, fallback(key, config.axisTop, axis, style), fallback(key, config.axisBottom, axis, style), fallback(key, config.axisLeft, axis, style), fallback(key, config.axisRight, axis, style));\n }\n } else {\n xy = orient === Top || orient === Bottom ? config.axisX : config.axisY;\n or = config['axis' + orient[0].toUpperCase() + orient.slice(1)];\n }\n const result = xy || or || band ? extend({}, axis, xy, or, band) : axis;\n return result;\n}\n\nfunction axisDomain (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n orient = spec.orient;\n let enter, update;\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one\n },\n exit: {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('domainColor'),\n strokeCap: _('domainCap'),\n strokeDash: _('domainDash'),\n strokeDashOffset: _('domainDashOffset'),\n strokeWidth: _('domainWidth'),\n strokeOpacity: _('domainOpacity')\n });\n const pos0 = position(spec, 0);\n const pos1 = position(spec, 1);\n enter.x = update.x = ifX(orient, pos0, zero);\n enter.x2 = update.x2 = ifX(orient, pos1);\n enter.y = update.y = ifY(orient, pos0, zero);\n enter.y2 = update.y2 = ifY(orient, pos1);\n return guideMark({\n type: RuleMark,\n role: AxisDomainRole,\n from: dataRef,\n encode\n }, userEncode);\n}\nfunction position(spec, pos) {\n return {\n scale: spec.scale,\n range: pos\n };\n}\n\nfunction axisGrid (spec, config, userEncode, dataRef, band) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n vscale = spec.gridScale,\n sign = getSign(orient, 1, -1),\n offset = offsetValue(spec.offset, sign);\n let enter, exit, update;\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one\n },\n exit: exit = {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('gridColor'),\n strokeCap: _('gridCap'),\n strokeDash: _('gridDash'),\n strokeDashOffset: _('gridDashOffset'),\n strokeOpacity: _('gridOpacity'),\n strokeWidth: _('gridWidth')\n });\n const tickPos = {\n scale: spec.scale,\n field: Value,\n band: band.band,\n extra: band.extra,\n offset: band.offset,\n round: _('tickRound')\n };\n const sz = ifX(orient, {\n signal: 'height'\n }, {\n signal: 'width'\n });\n const gridStart = vscale ? {\n scale: vscale,\n range: 0,\n mult: sign,\n offset: offset\n } : {\n value: 0,\n offset: offset\n };\n const gridEnd = vscale ? {\n scale: vscale,\n range: 1,\n mult: sign,\n offset: offset\n } : extend(sz, {\n mult: sign,\n offset: offset\n });\n enter.x = update.x = ifX(orient, tickPos, gridStart);\n enter.y = update.y = ifY(orient, tickPos, gridStart);\n enter.x2 = update.x2 = ifY(orient, gridEnd);\n enter.y2 = update.y2 = ifX(orient, gridEnd);\n exit.x = ifX(orient, tickPos);\n exit.y = ifY(orient, tickPos);\n return guideMark({\n type: RuleMark,\n role: AxisGridRole,\n key: Value,\n from: dataRef,\n encode\n }, userEncode);\n}\nfunction offsetValue(offset, sign) {\n if (sign === 1) ; else if (!isObject(offset)) {\n offset = isSignal(sign) ? {\n signal: `(${sign.signal}) * (${offset || 0})`\n } : sign * (offset || 0);\n } else {\n let entry = offset = extend({}, offset);\n while (entry.mult != null) {\n if (!isObject(entry.mult)) {\n entry.mult = isSignal(sign) // no offset if sign === 1\n ? {\n signal: `(${entry.mult}) * (${sign.signal})`\n } : entry.mult * sign;\n return offset;\n } else {\n entry = entry.mult = extend({}, entry.mult);\n }\n }\n entry.mult = sign;\n }\n return offset;\n}\n\nfunction axisTicks (spec, config, userEncode, dataRef, size, band) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n sign = getSign(orient, -1, 1);\n let enter, exit, update;\n const encode = {\n enter: enter = {\n opacity: zero\n },\n update: update = {\n opacity: one\n },\n exit: exit = {\n opacity: zero\n }\n };\n addEncoders(encode, {\n stroke: _('tickColor'),\n strokeCap: _('tickCap'),\n strokeDash: _('tickDash'),\n strokeDashOffset: _('tickDashOffset'),\n strokeOpacity: _('tickOpacity'),\n strokeWidth: _('tickWidth')\n });\n const tickSize = encoder(size);\n tickSize.mult = sign;\n const tickPos = {\n scale: spec.scale,\n field: Value,\n band: band.band,\n extra: band.extra,\n offset: band.offset,\n round: _('tickRound')\n };\n update.y = enter.y = ifX(orient, zero, tickPos);\n update.y2 = enter.y2 = ifX(orient, tickSize);\n exit.x = ifX(orient, tickPos);\n update.x = enter.x = ifY(orient, zero, tickPos);\n update.x2 = enter.x2 = ifY(orient, tickSize);\n exit.y = ifY(orient, tickPos);\n return guideMark({\n type: RuleMark,\n role: AxisTickRole,\n key: Value,\n from: dataRef,\n encode\n }, userEncode);\n}\n\nfunction flushExpr(scale, threshold, a, b, c) {\n return {\n signal: 'flush(range(\"' + scale + '\"), ' + 'scale(\"' + scale + '\", datum.value), ' + threshold + ',' + a + ',' + b + ',' + c + ')'\n };\n}\nfunction axisLabels (spec, config, userEncode, dataRef, size, band) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n scale = spec.scale,\n sign = getSign(orient, -1, 1),\n flush = deref(_('labelFlush')),\n flushOffset = deref(_('labelFlushOffset')),\n labelAlign = _('labelAlign'),\n labelBaseline = _('labelBaseline');\n let flushOn = flush === 0 || !!flush,\n update;\n const tickSize = encoder(size);\n tickSize.mult = sign;\n tickSize.offset = encoder(_('labelPadding') || 0);\n tickSize.offset.mult = sign;\n const tickPos = {\n scale: scale,\n field: Value,\n band: 0.5,\n offset: extendOffset(band.offset, _('labelOffset'))\n };\n const align = ifX(orient, flushOn ? flushExpr(scale, flush, '\"left\"', '\"right\"', '\"center\"') : {\n value: 'center'\n }, ifRight(orient, 'left', 'right'));\n const baseline = ifX(orient, ifTop(orient, 'bottom', 'top'), flushOn ? flushExpr(scale, flush, '\"top\"', '\"bottom\"', '\"middle\"') : {\n value: 'middle'\n });\n const offsetExpr = flushExpr(scale, flush, `-(${flushOffset})`, flushOffset, 0);\n flushOn = flushOn && flushOffset;\n const enter = {\n opacity: zero,\n x: ifX(orient, tickPos, tickSize),\n y: ifY(orient, tickPos, tickSize)\n };\n const encode = {\n enter: enter,\n update: update = {\n opacity: one,\n text: {\n field: Label\n },\n x: enter.x,\n y: enter.y,\n align,\n baseline\n },\n exit: {\n opacity: zero,\n x: enter.x,\n y: enter.y\n }\n };\n addEncoders(encode, {\n dx: !labelAlign && flushOn ? ifX(orient, offsetExpr) : null,\n dy: !labelBaseline && flushOn ? ifY(orient, offsetExpr) : null\n });\n addEncoders(encode, {\n angle: _('labelAngle'),\n fill: _('labelColor'),\n fillOpacity: _('labelOpacity'),\n font: _('labelFont'),\n fontSize: _('labelFontSize'),\n fontWeight: _('labelFontWeight'),\n fontStyle: _('labelFontStyle'),\n limit: _('labelLimit'),\n lineHeight: _('labelLineHeight')\n }, {\n align: labelAlign,\n baseline: labelBaseline\n });\n const bound = _('labelBound');\n let overlap = _('labelOverlap');\n\n // if overlap method or bound defined, request label overlap removal\n overlap = overlap || bound ? {\n separation: _('labelSeparation'),\n method: overlap,\n order: 'datum.index',\n bound: bound ? {\n scale,\n orient,\n tolerance: bound\n } : null\n } : undefined;\n if (update.align !== align) {\n update.align = patch(update.align, align);\n }\n if (update.baseline !== baseline) {\n update.baseline = patch(update.baseline, baseline);\n }\n return guideMark({\n type: TextMark,\n role: AxisLabelRole,\n style: GuideLabelStyle,\n key: Value,\n from: dataRef,\n encode,\n overlap\n }, userEncode);\n}\n\nfunction axisTitle (spec, config, userEncode, dataRef) {\n const _ = lookup(spec, config),\n orient = spec.orient,\n sign = getSign(orient, -1, 1);\n let enter, update;\n const encode = {\n enter: enter = {\n opacity: zero,\n anchor: encoder(_('titleAnchor', null)),\n align: {\n signal: alignExpr$1\n }\n },\n update: update = extend({}, enter, {\n opacity: one,\n text: encoder(spec.title)\n }),\n exit: {\n opacity: zero\n }\n };\n const titlePos = {\n signal: `lerp(range(\"${spec.scale}\"), ${anchorExpr(0, 1, 0.5)})`\n };\n update.x = ifX(orient, titlePos);\n update.y = ifY(orient, titlePos);\n enter.angle = ifX(orient, zero, mult(sign, 90));\n enter.baseline = ifX(orient, ifTop(orient, Bottom, Top), {\n value: Bottom\n });\n update.angle = enter.angle;\n update.baseline = enter.baseline;\n addEncoders(encode, {\n fill: _('titleColor'),\n fillOpacity: _('titleOpacity'),\n font: _('titleFont'),\n fontSize: _('titleFontSize'),\n fontStyle: _('titleFontStyle'),\n fontWeight: _('titleFontWeight'),\n limit: _('titleLimit'),\n lineHeight: _('titleLineHeight')\n }, {\n // require update\n align: _('titleAlign'),\n angle: _('titleAngle'),\n baseline: _('titleBaseline')\n });\n autoLayout(_, orient, encode, userEncode);\n encode.update.align = patch(encode.update.align, enter.align);\n encode.update.angle = patch(encode.update.angle, enter.angle);\n encode.update.baseline = patch(encode.update.baseline, enter.baseline);\n return guideMark({\n type: TextMark,\n role: AxisTitleRole,\n style: GuideTitleStyle,\n from: dataRef,\n encode\n }, userEncode);\n}\nfunction autoLayout(_, orient, encode, userEncode) {\n const auto = (value, dim) => value != null ? (encode.update[dim] = patch(encoder(value), encode.update[dim]), false) : !has(dim, userEncode) ? true : false;\n const autoY = auto(_('titleX'), 'x'),\n autoX = auto(_('titleY'), 'y');\n encode.enter.auto = autoX === autoY ? encoder(autoX) : ifX(orient, encoder(autoX), encoder(autoY));\n}\n\nfunction parseAxis (spec, scope) {\n const config = axisConfig(spec, scope),\n encode = spec.encode || {},\n axisEncode = encode.axis || {},\n name = axisEncode.name || undefined,\n interactive = axisEncode.interactive,\n style = axisEncode.style,\n _ = lookup(spec, config),\n band = tickBand(_);\n\n // single-element data source for axis group\n const datum = {\n scale: spec.scale,\n ticks: !!_('ticks'),\n labels: !!_('labels'),\n grid: !!_('grid'),\n domain: !!_('domain'),\n title: spec.title != null\n };\n const dataRef = ref(scope.add(Collect({}, [datum])));\n\n // data source for axis ticks\n const ticksRef = ref(scope.add(AxisTicks({\n scale: scope.scaleRef(spec.scale),\n extra: scope.property(band.extra),\n count: scope.objectProperty(spec.tickCount),\n values: scope.objectProperty(spec.values),\n minstep: scope.property(spec.tickMinStep),\n formatType: scope.property(spec.formatType),\n formatSpecifier: scope.property(spec.format)\n })));\n\n // generate axis marks\n const children = [];\n let size;\n\n // include axis gridlines if requested\n if (datum.grid) {\n children.push(axisGrid(spec, config, encode.grid, ticksRef, band));\n }\n\n // include axis ticks if requested\n if (datum.ticks) {\n size = _('tickSize');\n children.push(axisTicks(spec, config, encode.ticks, ticksRef, size, band));\n }\n\n // include axis labels if requested\n if (datum.labels) {\n size = datum.ticks ? size : 0;\n children.push(axisLabels(spec, config, encode.labels, ticksRef, size, band));\n }\n\n // include axis domain path if requested\n if (datum.domain) {\n children.push(axisDomain(spec, config, encode.domain, dataRef));\n }\n\n // include axis title if defined\n if (datum.title) {\n children.push(axisTitle(spec, config, encode.title, dataRef));\n }\n\n // parse axis specification\n return parseMark(guideGroup({\n role: AxisRole,\n from: dataRef,\n encode: extendEncode(buildAxisEncode(_, spec), axisEncode, Skip),\n marks: children,\n aria: _('aria'),\n description: _('description'),\n zindex: _('zindex'),\n name,\n interactive,\n style\n }), scope);\n}\nfunction buildAxisEncode(_, spec) {\n const encode = {\n enter: {},\n update: {}\n };\n addEncoders(encode, {\n orient: _('orient'),\n offset: _('offset') || 0,\n position: value(spec.position, 0),\n titlePadding: _('titlePadding'),\n minExtent: _('minExtent'),\n maxExtent: _('maxExtent'),\n range: {\n signal: `abs(span(range(\"${spec.scale}\")))`\n },\n translate: _('translate'),\n // accessibility support\n format: spec.format,\n formatType: spec.formatType\n });\n return encode;\n}\n\nfunction parseScope (spec, scope, preprocessed) {\n const signals = array(spec.signals),\n scales = array(spec.scales);\n\n // parse signal definitions, if not already preprocessed\n if (!preprocessed) signals.forEach(_ => parseSignal(_, scope));\n\n // parse cartographic projection definitions\n array(spec.projections).forEach(_ => parseProjection(_, scope));\n\n // initialize scale references\n scales.forEach(_ => initScale(_, scope));\n\n // parse data sources\n array(spec.data).forEach(_ => parseData(_, scope));\n\n // parse scale definitions\n scales.forEach(_ => parseScale(_, scope));\n\n // parse signal updates\n (preprocessed || signals).forEach(_ => parseSignalUpdates(_, scope));\n\n // parse axis definitions\n array(spec.axes).forEach(_ => parseAxis(_, scope));\n\n // parse mark definitions\n array(spec.marks).forEach(_ => parseMark(_, scope));\n\n // parse legend definitions\n array(spec.legends).forEach(_ => parseLegend(_, scope));\n\n // parse title, if defined\n if (spec.title) parseTitle(spec.title, scope);\n\n // parse collected lambda (anonymous) expressions\n scope.parseLambdas();\n return scope;\n}\n\nconst rootEncode = spec => extendEncode({\n enter: {\n x: {\n value: 0\n },\n y: {\n value: 0\n }\n },\n update: {\n width: {\n signal: 'width'\n },\n height: {\n signal: 'height'\n }\n }\n}, spec);\nfunction parseView(spec, scope) {\n const config = scope.config;\n\n // add scenegraph root\n const root = ref(scope.root = scope.add(operator()));\n\n // parse top-level signal definitions\n const signals = collectSignals(spec, config);\n signals.forEach(_ => parseSignal(_, scope));\n\n // assign description, event, legend, and locale configuration\n scope.description = spec.description || config.description;\n scope.eventConfig = config.events;\n scope.legends = scope.objectProperty(config.legend && config.legend.layout);\n scope.locale = config.locale;\n\n // store root group item\n const input = scope.add(Collect());\n\n // encode root group item\n const encode = scope.add(Encode(parseEncode(rootEncode(spec.encode), GroupMark, FrameRole, spec.style, scope, {\n pulse: ref(input)\n })));\n\n // perform view layout\n const parent = scope.add(ViewLayout({\n layout: scope.objectProperty(spec.layout),\n legends: scope.legends,\n autosize: scope.signalRef('autosize'),\n mark: root,\n pulse: ref(encode)\n }));\n scope.operators.pop();\n\n // parse remainder of specification\n scope.pushState(ref(encode), ref(parent), null);\n parseScope(spec, scope, signals);\n scope.operators.push(parent);\n\n // bound / render / sieve root item\n let op = scope.add(Bound({\n mark: root,\n pulse: ref(parent)\n }));\n op = scope.add(Render({\n pulse: ref(op)\n }));\n op = scope.add(Sieve({\n pulse: ref(op)\n }));\n\n // track metadata for root item\n scope.addData('root', new DataScope(scope, input, input, op));\n return scope;\n}\nfunction signalObject(name, value) {\n return value && value.signal ? {\n name,\n update: value.signal\n } : {\n name,\n value\n };\n}\n\n/**\n * Collect top-level signals, merging values as needed. Signals\n * defined in the config signals arrays are added only if that\n * signal is not explicitly defined in the specification.\n * Built-in signals (autosize, background, padding, width, height)\n * receive special treatment. They are initialized using the\n * top-level spec property, or, if undefined in the spec, using\n * the corresponding top-level config property. If this property\n * is a signal reference object, the signal expression maps to the\n * signal 'update' property. If the spec's top-level signal array\n * contains an entry that matches a built-in signal, that entry\n * will be merged with the built-in specification, potentially\n * overwriting existing 'value' or 'update' properties.\n */\nfunction collectSignals(spec, config) {\n const _ = name => value(spec[name], config[name]),\n signals = [signalObject('background', _('background')), signalObject('autosize', parseAutosize(_('autosize'))), signalObject('padding', parsePadding(_('padding'))), signalObject('width', _('width') || 0), signalObject('height', _('height') || 0)],\n pre = signals.reduce((p, s) => (p[s.name] = s, p), {}),\n map = {};\n\n // add spec signal array\n array(spec.signals).forEach(s => {\n if (hasOwnProperty(pre, s.name)) {\n // merge if built-in signal\n s = extend(pre[s.name], s);\n } else {\n // otherwise add to signal list\n signals.push(s);\n }\n map[s.name] = s;\n });\n\n // add config signal array\n array(config.signals).forEach(s => {\n if (!hasOwnProperty(map, s.name) && !hasOwnProperty(pre, s.name)) {\n // add to signal list if not already defined\n signals.push(s);\n }\n });\n return signals;\n}\n\nfunction Scope(config, options) {\n this.config = config || {};\n this.options = options || {};\n this.bindings = [];\n this.field = {};\n this.signals = {};\n this.lambdas = {};\n this.scales = {};\n this.events = {};\n this.data = {};\n this.streams = [];\n this.updates = [];\n this.operators = [];\n this.eventConfig = null;\n this.locale = null;\n this._id = 0;\n this._subid = 0;\n this._nextsub = [0];\n this._parent = [];\n this._encode = [];\n this._lookup = [];\n this._markpath = [];\n}\nfunction Subscope(scope) {\n this.config = scope.config;\n this.options = scope.options;\n this.legends = scope.legends;\n this.field = Object.create(scope.field);\n this.signals = Object.create(scope.signals);\n this.lambdas = Object.create(scope.lambdas);\n this.scales = Object.create(scope.scales);\n this.events = Object.create(scope.events);\n this.data = Object.create(scope.data);\n this.streams = [];\n this.updates = [];\n this.operators = [];\n this._id = 0;\n this._subid = ++scope._nextsub[0];\n this._nextsub = scope._nextsub;\n this._parent = scope._parent.slice();\n this._encode = scope._encode.slice();\n this._lookup = scope._lookup.slice();\n this._markpath = scope._markpath;\n}\nScope.prototype = Subscope.prototype = {\n parse(spec) {\n return parseScope(spec, this);\n },\n fork() {\n return new Subscope(this);\n },\n isSubscope() {\n return this._subid > 0;\n },\n toRuntime() {\n this.finish();\n return {\n description: this.description,\n operators: this.operators,\n streams: this.streams,\n updates: this.updates,\n bindings: this.bindings,\n eventConfig: this.eventConfig,\n locale: this.locale\n };\n },\n id() {\n return (this._subid ? this._subid + ':' : 0) + this._id++;\n },\n add(op) {\n this.operators.push(op);\n op.id = this.id();\n // if pre-registration references exist, resolve them now\n if (op.refs) {\n op.refs.forEach(ref => {\n ref.$ref = op.id;\n });\n op.refs = null;\n }\n return op;\n },\n proxy(op) {\n const vref = op instanceof Entry ? ref(op) : op;\n return this.add(Proxy({\n value: vref\n }));\n },\n addStream(stream) {\n this.streams.push(stream);\n stream.id = this.id();\n return stream;\n },\n addUpdate(update) {\n this.updates.push(update);\n return update;\n },\n // Apply metadata\n finish() {\n let name, ds;\n\n // annotate root\n if (this.root) this.root.root = true;\n\n // annotate signals\n for (name in this.signals) {\n this.signals[name].signal = name;\n }\n\n // annotate scales\n for (name in this.scales) {\n this.scales[name].scale = name;\n }\n\n // annotate data sets\n function annotate(op, name, type) {\n let data, list;\n if (op) {\n data = op.data || (op.data = {});\n list = data[name] || (data[name] = []);\n list.push(type);\n }\n }\n for (name in this.data) {\n ds = this.data[name];\n annotate(ds.input, name, 'input');\n annotate(ds.output, name, 'output');\n annotate(ds.values, name, 'values');\n for (const field in ds.index) {\n annotate(ds.index[field], name, 'index:' + field);\n }\n }\n return this;\n },\n // ----\n\n pushState(encode, parent, lookup) {\n this._encode.push(ref(this.add(Sieve({\n pulse: encode\n }))));\n this._parent.push(parent);\n this._lookup.push(lookup ? ref(this.proxy(lookup)) : null);\n this._markpath.push(-1);\n },\n popState() {\n this._encode.pop();\n this._parent.pop();\n this._lookup.pop();\n this._markpath.pop();\n },\n parent() {\n return peek(this._parent);\n },\n encode() {\n return peek(this._encode);\n },\n lookup() {\n return peek(this._lookup);\n },\n markpath() {\n const p = this._markpath;\n return ++p[p.length - 1];\n },\n // ----\n\n fieldRef(field, name) {\n if (isString(field)) return fieldRef$1(field, name);\n if (!field.signal) {\n error('Unsupported field reference: ' + stringValue(field));\n }\n const s = field.signal;\n let f = this.field[s];\n if (!f) {\n const params = {\n name: this.signalRef(s)\n };\n if (name) params.as = name;\n this.field[s] = f = ref(this.add(Field(params)));\n }\n return f;\n },\n compareRef(cmp) {\n let signal = false;\n const check = _ => isSignal(_) ? (signal = true, this.signalRef(_.signal)) : isExpr$1(_) ? (signal = true, this.exprRef(_.expr)) : _;\n const fields = array(cmp.field).map(check),\n orders = array(cmp.order).map(check);\n return signal ? ref(this.add(Compare({\n fields: fields,\n orders: orders\n }))) : compareRef(fields, orders);\n },\n keyRef(fields, flat) {\n let signal = false;\n const check = _ => isSignal(_) ? (signal = true, ref(sig[_.signal])) : _;\n const sig = this.signals;\n fields = array(fields).map(check);\n return signal ? ref(this.add(Key({\n fields: fields,\n flat: flat\n }))) : keyRef(fields, flat);\n },\n sortRef(sort) {\n if (!sort) return sort;\n\n // including id ensures stable sorting\n const a = aggrField(sort.op, sort.field),\n o = sort.order || Ascending;\n return o.signal ? ref(this.add(Compare({\n fields: a,\n orders: this.signalRef(o.signal)\n }))) : compareRef(a, o);\n },\n // ----\n\n event(source, type) {\n const key = source + ':' + type;\n if (!this.events[key]) {\n const id = this.id();\n this.streams.push({\n id: id,\n source: source,\n type: type\n });\n this.events[key] = id;\n }\n return this.events[key];\n },\n // ----\n\n hasOwnSignal(name) {\n return hasOwnProperty(this.signals, name);\n },\n addSignal(name, value) {\n if (this.hasOwnSignal(name)) {\n error('Duplicate signal name: ' + stringValue(name));\n }\n const op = value instanceof Entry ? value : this.add(operator(value));\n return this.signals[name] = op;\n },\n getSignal(name) {\n if (!this.signals[name]) {\n error('Unrecognized signal name: ' + stringValue(name));\n }\n return this.signals[name];\n },\n signalRef(s) {\n if (this.signals[s]) {\n return ref(this.signals[s]);\n } else if (!hasOwnProperty(this.lambdas, s)) {\n this.lambdas[s] = this.add(operator(null));\n }\n return ref(this.lambdas[s]);\n },\n parseLambdas() {\n const code = Object.keys(this.lambdas);\n for (let i = 0, n = code.length; i < n; ++i) {\n const s = code[i],\n e = parseExpression(s, this),\n op = this.lambdas[s];\n op.params = e.$params;\n op.update = e.$expr;\n }\n },\n property(spec) {\n return spec && spec.signal ? this.signalRef(spec.signal) : spec;\n },\n objectProperty(spec) {\n return !spec || !isObject(spec) ? spec : this.signalRef(spec.signal || propertyLambda(spec));\n },\n exprRef(code, name) {\n const params = {\n expr: parseExpression(code, this)\n };\n if (name) params.expr.$name = name;\n return ref(this.add(Expression(params)));\n },\n addBinding(name, bind) {\n if (!this.bindings) {\n error('Nested signals do not support binding: ' + stringValue(name));\n }\n this.bindings.push(extend({\n signal: name\n }, bind));\n },\n // ----\n\n addScaleProj(name, transform) {\n if (hasOwnProperty(this.scales, name)) {\n error('Duplicate scale or projection name: ' + stringValue(name));\n }\n this.scales[name] = this.add(transform);\n },\n addScale(name, params) {\n this.addScaleProj(name, Scale(params));\n },\n addProjection(name, params) {\n this.addScaleProj(name, Projection(params));\n },\n getScale(name) {\n if (!this.scales[name]) {\n error('Unrecognized scale name: ' + stringValue(name));\n }\n return this.scales[name];\n },\n scaleRef(name) {\n return ref(this.getScale(name));\n },\n scaleType(name) {\n return this.getScale(name).params.type;\n },\n projectionRef(name) {\n return this.scaleRef(name);\n },\n projectionType(name) {\n return this.scaleType(name);\n },\n // ----\n\n addData(name, dataScope) {\n if (hasOwnProperty(this.data, name)) {\n error('Duplicate data set name: ' + stringValue(name));\n }\n return this.data[name] = dataScope;\n },\n getData(name) {\n if (!this.data[name]) {\n error('Undefined data set name: ' + stringValue(name));\n }\n return this.data[name];\n },\n addDataPipeline(name, entries) {\n if (hasOwnProperty(this.data, name)) {\n error('Duplicate data set name: ' + stringValue(name));\n }\n return this.addData(name, DataScope.fromEntries(this, entries));\n }\n};\nfunction propertyLambda(spec) {\n return (isArray(spec) ? arrayLambda : objectLambda)(spec);\n}\nfunction arrayLambda(array) {\n const n = array.length;\n let code = '[';\n for (let i = 0; i < n; ++i) {\n const value = array[i];\n code += (i > 0 ? ',' : '') + (isObject(value) ? value.signal || propertyLambda(value) : stringValue(value));\n }\n return code + ']';\n}\nfunction objectLambda(obj) {\n let code = '{',\n i = 0,\n key,\n value;\n for (key in obj) {\n value = obj[key];\n code += (++i > 1 ? ',' : '') + stringValue(key) + ':' + (isObject(value) ? value.signal || propertyLambda(value) : stringValue(value));\n }\n return code + '}';\n}\n\n/**\n * Standard configuration defaults for Vega specification parsing.\n * Users can provide their own (sub-)set of these default values\n * by passing in a config object to the top-level parse method.\n */\nfunction defaults () {\n const defaultFont = 'sans-serif',\n defaultSymbolSize = 30,\n defaultStrokeWidth = 2,\n defaultColor = '#4c78a8',\n black = '#000',\n gray = '#888',\n lightGray = '#ddd';\n return {\n // default visualization description\n description: 'Vega visualization',\n // default padding around visualization\n padding: 0,\n // default for automatic sizing; options: 'none', 'pad', 'fit'\n // or provide an object (e.g., {'type': 'pad', 'resize': true})\n autosize: 'pad',\n // default view background color\n // covers the entire view component\n background: null,\n // default event handling configuration\n // preventDefault for view-sourced event types except 'wheel'\n events: {\n defaults: {\n allow: ['wheel']\n }\n },\n // defaults for top-level group marks\n // accepts mark properties (fill, stroke, etc)\n // covers the data rectangle within group width/height\n group: null,\n // defaults for basic mark types\n // each subset accepts mark properties (fill, stroke, etc)\n mark: null,\n arc: {\n fill: defaultColor\n },\n area: {\n fill: defaultColor\n },\n image: null,\n line: {\n stroke: defaultColor,\n strokeWidth: defaultStrokeWidth\n },\n path: {\n stroke: defaultColor\n },\n rect: {\n fill: defaultColor\n },\n rule: {\n stroke: black\n },\n shape: {\n stroke: defaultColor\n },\n symbol: {\n fill: defaultColor,\n size: 64\n },\n text: {\n fill: black,\n font: defaultFont,\n fontSize: 11\n },\n trail: {\n fill: defaultColor,\n size: defaultStrokeWidth\n },\n // style definitions\n style: {\n // axis & legend labels\n 'guide-label': {\n fill: black,\n font: defaultFont,\n fontSize: 10\n },\n // axis & legend titles\n 'guide-title': {\n fill: black,\n font: defaultFont,\n fontSize: 11,\n fontWeight: 'bold'\n },\n // headers, including chart title\n 'group-title': {\n fill: black,\n font: defaultFont,\n fontSize: 13,\n fontWeight: 'bold'\n },\n // chart subtitle\n 'group-subtitle': {\n fill: black,\n font: defaultFont,\n fontSize: 12\n },\n // defaults for styled point marks in Vega-Lite\n point: {\n size: defaultSymbolSize,\n strokeWidth: defaultStrokeWidth,\n shape: 'circle'\n },\n circle: {\n size: defaultSymbolSize,\n strokeWidth: defaultStrokeWidth\n },\n square: {\n size: defaultSymbolSize,\n strokeWidth: defaultStrokeWidth,\n shape: 'square'\n },\n // defaults for styled group marks in Vega-Lite\n cell: {\n fill: 'transparent',\n stroke: lightGray\n },\n view: {\n fill: 'transparent'\n }\n },\n // defaults for title\n title: {\n orient: 'top',\n anchor: 'middle',\n offset: 4,\n subtitlePadding: 3\n },\n // defaults for axes\n axis: {\n minExtent: 0,\n maxExtent: 200,\n bandPosition: 0.5,\n domain: true,\n domainWidth: 1,\n domainColor: gray,\n grid: false,\n gridWidth: 1,\n gridColor: lightGray,\n labels: true,\n labelAngle: 0,\n labelLimit: 180,\n labelOffset: 0,\n labelPadding: 2,\n ticks: true,\n tickColor: gray,\n tickOffset: 0,\n tickRound: true,\n tickSize: 5,\n tickWidth: 1,\n titlePadding: 4\n },\n // correction for centering bias\n axisBand: {\n tickOffset: -0.5\n },\n // defaults for cartographic projection\n projection: {\n type: 'mercator'\n },\n // defaults for legends\n legend: {\n orient: 'right',\n padding: 0,\n gridAlign: 'each',\n columnPadding: 10,\n rowPadding: 2,\n symbolDirection: 'vertical',\n gradientDirection: 'vertical',\n gradientLength: 200,\n gradientThickness: 16,\n gradientStrokeColor: lightGray,\n gradientStrokeWidth: 0,\n gradientLabelOffset: 2,\n labelAlign: 'left',\n labelBaseline: 'middle',\n labelLimit: 160,\n labelOffset: 4,\n labelOverlap: true,\n symbolLimit: 30,\n symbolType: 'circle',\n symbolSize: 100,\n symbolOffset: 0,\n symbolStrokeWidth: 1.5,\n symbolBaseFillColor: 'transparent',\n symbolBaseStrokeColor: gray,\n titleLimit: 180,\n titleOrient: 'top',\n titlePadding: 5,\n layout: {\n offset: 18,\n direction: 'horizontal',\n left: {\n direction: 'vertical'\n },\n right: {\n direction: 'vertical'\n }\n }\n },\n // defaults for scale ranges\n range: {\n category: {\n scheme: 'tableau10'\n },\n ordinal: {\n scheme: 'blues'\n },\n heatmap: {\n scheme: 'yellowgreenblue'\n },\n ramp: {\n scheme: 'blues'\n },\n diverging: {\n scheme: 'blueorange',\n extent: [1, 0]\n },\n symbol: ['circle', 'square', 'triangle-up', 'cross', 'diamond', 'triangle-right', 'triangle-down', 'triangle-left']\n }\n };\n}\n\nfunction parse (spec, config, options) {\n if (!isObject(spec)) {\n error('Input Vega specification must be an object.');\n }\n config = mergeConfig(defaults(), config, spec.config);\n return parseView(spec, new Scope(config, options)).toRuntime();\n}\n\nexport { AxisDomainRole, AxisGridRole, AxisLabelRole, AxisRole, AxisTickRole, AxisTitleRole, DataScope, FrameRole, LegendEntryRole, LegendLabelRole, LegendRole, LegendSymbolRole, LegendTitleRole, MarkRole, Scope, ScopeRole, defaults as config, parse, parseSignal as signal, parseSignalUpdates as signalUpdates, parseStream as stream };\n","import { extend } from 'vega-util';\nexport * from 'vega-util';\nimport { transforms } from 'vega-dataflow';\nexport { Dataflow, EventStream, MultiPulse, Operator, Parameters, Pulse, Transform, changeset, definition, ingest, isTuple, transform, transforms, tupleid } from 'vega-dataflow';\nimport * as tx from 'vega-transforms';\nimport * as vtx from 'vega-view-transforms';\nimport * as encode from 'vega-encode';\nimport * as geo from 'vega-geo';\nimport * as force from 'vega-force';\nimport * as tree from 'vega-hierarchy';\nimport * as label from 'vega-label';\nimport * as reg from 'vega-regression';\nimport * as voronoi from 'vega-voronoi';\nimport * as wordcloud from 'vega-wordcloud';\nimport * as xf from 'vega-crossfilter';\nexport * from 'vega-statistics';\nexport * from 'vega-time';\nexport * from 'vega-loader';\nexport * from 'vega-scenegraph';\nexport { interpolate, interpolateColors, interpolateRange, quantizeInterpolator, scale, scheme } from 'vega-scale';\nexport { projection } from 'vega-projection';\nexport { View } from 'vega-view';\nexport { defaultLocale, numberFormatDefaultLocale as formatLocale, locale, resetDefaultLocale, timeFormatDefaultLocale as timeFormatLocale } from 'vega-format';\nexport { expressionFunction } from 'vega-functions';\nexport { parse } from 'vega-parser';\nexport { context as runtimeContext } from 'vega-runtime';\nexport { codegenExpression, parseExpression } from 'vega-expression';\nexport { parseSelector } from 'vega-event-selector';\n\nvar version = \"5.30.0\";\n\n// -- Transforms -----\n\nextend(transforms, tx, vtx, encode, geo, force, label, tree, reg, voronoi, wordcloud, xf);\n\nexport { version };\n","module.exports = __WEBPACK_EXTERNAL_MODULE__55__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(728);\n"],"names":["clone","_instanceof","obj","type","nativeMap","nativeSet","nativePromise","Map","_","Set","Promise","parent","circular","depth","prototype","includeNonEnumerable","allParents","allChildren","useBuffer","Buffer","Infinity","_clone","child","proto","resolve","reject","then","value","err","__isArray","__isRegExp","RegExp","source","__getRegExpFlags","lastIndex","__isDate","Date","getTime","isBuffer","allocUnsafe","length","copy","Error","Object","create","getPrototypeOf","index","indexOf","push","i","forEach","key","keyChild","valueChild","set","entryChild","add","attrs","getOwnPropertyDescriptor","getOwnPropertySymbols","symbols","symbol","descriptor","enumerable","defineProperty","allPropertyNames","getOwnPropertyNames","propertyName","__objToStr","o","toString","call","re","flags","global","ignoreCase","multiline","clonePrototype","c","module","exports","createThunk","Procedure","this","argTypes","shimArgs","arrayArgs","arrayBlockIndices","scalarArgs","offsetArgs","offsetArgIndex","indexArgs","shapeArgs","funcName","pre","body","post","debug","user_args","proc","proc_args","args","slice","arg_type","blockIndices","count","lvalue","offset","array","printCode","blockSize","uniq","innerFill","order","j","dimension","nargs","has_index","code","vars","idx","pidx","join","processBlock","block","dtypes","carg","name","ptrStr","arrNum","offArgIndex","localStr","arrStr","replace","reStrArr","ptrStrArr","Math","abs","trim","typeSummary","summary","Array","allEqual","t","digits","match","charAt","typesig","orders","blockBegin","blockEnd","loopBegin","loopEnd","loopOrders","newOrder","arglist","zeros","off_arg","init_string","thisVars","concat","matched","countMatches","indexStr","outerFill","console","log","loopName","Function","f","compile","thunkName","string_typesig","max","shapeLengthConditions","shapeConditions","thunk","bind","undefined","esprima","PREFIX_COUNTER","CompiledArgument","rvalue","CompiledRoutine","localVars","func","src","ast","parse","range","prefix","argNames","params","expression","callee","names","getArgNames","compiledArgs","exploded","n","node","rewrite","nstr","lo","hi","visit","computed","object","property","argNo","usage","left","operator","LVALUE","getUsage","identifier","window","g","self","isGlobal","id","createLocal","keys","REQUIRED_FIELDS","OPTIONAL_FIELDS","warn","dupe_array","result","dupe_number","Token","TokenName","FnExprTokens","Syntax","PropertyKind","Messages","Regex","SyntaxTreeDelegate","strict","lineNumber","lineStart","delegate","lookahead","state","extra","assert","condition","message","isDecimalDigit","ch","isHexDigit","isOctalDigit","isWhiteSpace","isLineTerminator","isIdentifierStart","NonAsciiIdentifierStart","test","String","fromCharCode","isIdentifierPart","NonAsciiIdentifierPart","isStrictModeReservedWord","isRestrictedWord","isKeyword","addComment","start","end","loc","comment","lastCommentStart","comments","attachComment","leadingComments","trailingComments","skipSingleLineComment","line","column","charCodeAt","skipMultiLineComment","throwError","UnexpectedToken","skipComment","scanHexEscape","len","toLowerCase","getEscapedIdentifier","substr","getIdentifier","scanPunctuator","code2","ch2","ch3","ch4","ch1","tokenize","openParenToken","tokens","openCurlyToken","Punctuator","scanNumericLiteral","number","NumericLiteral","parseInt","scanHexLiteral","isImplicitOctalLiteral","octal","scanOctalLiteral","parseFloat","scanRegExp","str","classMarker","terminated","UnterminatedRegExp","literal","scanRegExpBody","restore","throwErrorTolerant","scanRegExpFlags","pattern","e","InvalidRegExp","testRegExp","RegularExpression","collectRegex","pos","regex","token","pop","advance","EOF","Identifier","Keyword","NullLiteral","BooleanLiteral","quote","unescaped","startLineNumber","startLineStart","StringLiteral","scanStringLiteral","prevToken","checkToken","advanceSlash","collectToken","lex","peek","Position","SourceLocation","startLine","startColumn","peekLineTerminator","found","messageFormat","error","arguments","msg","whole","description","apply","errors","throwUnexpected","UnexpectedEOS","UnexpectedNumber","UnexpectedString","UnexpectedIdentifier","isFutureReservedWord","UnexpectedReserved","StrictReservedWord","expect","expectKeyword","keyword","matchKeyword","consumeSemicolon","oldIndex","oldLineNumber","oldLineStart","oldLookahead","isLeftHandSide","expr","MemberExpression","parsePropertyFunction","param","first","previousStrict","startToken","parseFunctionSourceElements","StrictParamName","markEnd","createFunctionExpression","parseObjectPropertyKey","StrictOctalLiteral","createLiteral","createIdentifier","parseObjectProperty","parseAssignmentExpression","createProperty","parseVariableIdentifier","parsePrimaryExpression","parseExpression","parseGroupExpression","elements","createArrayExpression","parseArrayInitialiser","kind","properties","map","Data","Get","hasOwnProperty","StrictDuplicateProperty","AccessorDataProperty","AccessorGetSet","createObjectExpression","parseObjectInitialiser","stricted","firstRestricted","tmp","StrictFunctionName","parseParams","parseFunctionExpression","createThisExpression","parseArguments","parseNonComputedProperty","isIdentifierName","parseNonComputedMember","parseComputedMember","parseNewExpression","allowIn","createMemberExpression","parseLeftHandSideExpression","createNewExpression","parsePostfixExpression","previousAllowIn","createCallExpression","parseLeftHandSideExpressionAllowCall","StrictLHSPostfix","InvalidLHSInAssignment","createPostfixExpression","parseUnaryExpression","StrictLHSPrefix","createUnaryExpression","argument","StrictDelete","binaryPrecedence","prec","parseConditionalExpression","consequent","alternate","marker","markers","stack","right","createBinaryExpression","parseBinaryExpression","createConditionalExpression","op","StrictLHSAssignment","createAssignmentExpression","createSequenceExpression","expressions","parseBlock","statement","list","parseSourceElement","parseStatementList","createBlockStatement","parseVariableDeclaration","init","StrictVarName","createVariableDeclarator","parseVariableDeclarationList","parseForStatement","update","oldInIteration","declarations","createVariableDeclaration","InvalidLHSInForIn","inIteration","parseStatement","createForStatement","createForInStatement","parseSwitchCase","createSwitchCase","parseTryStatement","handlers","finalizer","StrictCatchVariable","createCatchClause","NoCatchOrFinally","createTryStatement","labeledBody","createEmptyStatement","createExpressionStatement","parseExpressionStatement","label","inSwitch","IllegalBreak","createBreakStatement","labelSet","UnknownLabel","parseBreakStatement","IllegalContinue","createContinueStatement","parseContinueStatement","createDebuggerStatement","createDoWhileStatement","parseFunctionDeclaration","createIfStatement","parseIfStatement","inFunctionBody","IllegalReturn","createReturnStatement","discriminant","cases","clause","oldInSwitch","defaultFound","createSwitchStatement","MultipleDefaultsInSwitch","parseSwitchStatement","NewlineAfterThrow","createThrowStatement","parseThrowStatement","createWhileStatement","parseWhileStatement","StrictModeWith","createWithStatement","parseWithStatement","Redeclaration","createLabeledStatement","sourceElement","oldLabelSet","oldInFunctionBody","sourceElements","Literal","paramSet","StrictParamDupe","createFunctionDeclaration","parseProgram","parseSourceElements","createProgram","filterTokenLocation","entry","AssignmentExpression","ArrayExpression","BlockStatement","BinaryExpression","BreakStatement","CallExpression","CatchClause","ConditionalExpression","ContinueStatement","DoWhileStatement","DebuggerStatement","EmptyStatement","ExpressionStatement","ForStatement","ForInStatement","FunctionDeclaration","FunctionExpression","IfStatement","LabeledStatement","LogicalExpression","NewExpression","ObjectExpression","Program","Property","ReturnStatement","SequenceExpression","SwitchStatement","SwitchCase","ThisExpression","ThrowStatement","TryStatement","UnaryExpression","UpdateExpression","VariableDeclaration","VariableDeclarator","WhileStatement","WithStatement","processComment","lastChild","bottomRightStack","postProcess","each","defaults","rest","generator","raw","accessor","guardedHandlers","version","options","tolerant","lexError","program","types","freeze","equal","a","b","constructor","isArray","valueOf","data","opts","cmp","cycles","aobj","bobj","seen","stringify","toJSON","isFinite","JSON","out","TypeError","seenIndex","sort","splice","readFloatLE","isSlowBuffer","_isBuffer","decompress","pako","lz4","zlib","input","inflate","Uint8Array","buffer","rowProxy","table_serialization","EchoTableWidgetView","EchoTableWidgetModel","TableWidgetModel","widgets_1","get","serializers_1","compression_1","tableToJSON","JSONToTable","ndarray","dtypeToArray","int8","Int8Array","int16","Int16Array","int32","Int32Array","uint8","uint16","Uint16Array","uint32","Uint32Array","float32","Float32Array","float64","Float64Array","RowIndex","Symbol","manager","size","decoder","TextDecoder","col","val","entries","compression","valBuffer","dtype","u8buf","strcol","decode","lstr","shape","min","columns","widget","table","fields","arraycolumn","stringcolumn","v","isNaN","r","deserialize","serialize","__awaiter","thisArg","_arguments","P","fulfilled","step","next","rejected","done","base_1","ndarray_unpack","DOMWidgetModel","assign","_model_name","_view_name","_model_module","_view_module","_model_module_version","_view_module_version","_table","_columns","serializers","echo","unpack_models","DOMWidgetView","render","that","model","res","touch","xxhash","util","hashSize","blockBuf","makeBuffer","hashTable","makeHashTable","magicNum","bsUncompressed","bsMap","buf","sliceArray","arraySlice","compressBound","decompressBound","sIndex","readU32","useBlockSum","useContentSize","bsIdx","maxBlockSize","readU64","maxSize","decompressBlock","dst","sLength","dIndex","mLength","mOffset","sEnd","literalCount","compressBlock","mIndex","mAnchor","searchMatchCount","seq","hash","hashU32","decompressFrame","useContentSum","compSize","compressFrame","writeU32","bsDefault","remaining","clearHashTable","z","compress","x","imul","al","bl","prime1","prime2","prime3","prime5","rotl32","rotmul32","h","m","shiftxor32","s","xxhapply","m0","m1","xxh1","xxh4","xxh16","seed","l","dup","do_unpack","cwise","arr","iota","hasTypedArrays","compare1st","stride","terms","compileConstructor","className","useGetters","procedure","CACHED_CONSTRUCTORS","indices","index_str","shapeArg","strideArg","a_vars","c_vars","tShape","tStride","ctor","d","sz","arrayDType","ctor_list","Deflate","deflate","deflateRaw","gzip","Inflate","inflateRaw","ungzip","constants","zlib_deflate","utils","strings","ZStream","Z_NO_FLUSH","Z_SYNC_FLUSH","Z_FULL_FLUSH","Z_FINISH","Z_OK","Z_STREAM_END","Z_DEFAULT_COMPRESSION","Z_DEFAULT_STRATEGY","Z_DEFLATED","level","method","chunkSize","windowBits","memLevel","strategy","opt","ended","chunks","strm","avail_out","status","deflateInit2","header","deflateSetHeader","dictionary","dict","string2buf","deflateSetDictionary","_dict_set","deflator","flush_mode","_flush_mode","next_in","avail_in","output","next_out","onData","subarray","deflateEnd","onEnd","chunk","flattenChunks","zlib_inflate","GZheader","Z_NEED_DICT","Z_STREAM_ERROR","Z_DATA_ERROR","Z_MEM_ERROR","to","inflateInit2","inflateGetHeader","inflateSetDictionary","inflator","last_avail_out","wrap","inflateReset","next_out_utf8","utf8border","tail","utf8str","buf2string","inflateEnd","_has","sources","shift","p","STR_APPLY_UIA_OK","__","_utf8len","q","TextEncoder","encode","c2","m_pos","str_len","buf_len","utf16buf","c_len","buf2binstring","adler","s1","s2","Z_PARTIAL_FLUSH","Z_BLOCK","Z_TREES","Z_ERRNO","Z_BUF_ERROR","Z_NO_COMPRESSION","Z_BEST_SPEED","Z_BEST_COMPRESSION","Z_FILTERED","Z_HUFFMAN_ONLY","Z_RLE","Z_FIXED","Z_BINARY","Z_TEXT","Z_UNKNOWN","crcTable","k","makeTable","crc","_tr_init","_tr_stored_block","_tr_flush_block","_tr_tally","_tr_align","adler32","crc32","MAX_MATCH","MIN_LOOKAHEAD","INIT_STATE","BUSY_STATE","FINISH_STATE","errorCode","rank","zero","slide_hash","wsize","w_size","hash_size","head","prev","HASH","hash_shift","hash_mask","flush_pending","pending","pending_buf","pending_out","total_out","flush_block_only","last","block_start","strstart","put_byte","putShortMSB","read_buf","total_in","longest_match","cur_match","chain_length","max_chain_length","scan","best_len","prev_length","nice_match","limit","_win","wmask","w_mask","strend","scan_end1","scan_end","good_match","match_start","fill_window","_w_size","more","window_size","insert","ins_h","deflate_stored","flush","have","min_block","pending_buf_size","used","bi_valid","matches","high_water","deflate_fast","hash_head","bflush","match_length","max_lazy_match","MIN_MATCH","sym_next","deflate_slow","max_insert","prev_match","match_available","Config","good_length","max_lazy","nice_length","max_chain","configuration_table","DeflateState","gzhead","gzindex","last_flush","w_bits","hash_bits","dyn_ltree","HEAP_SIZE","dyn_dtree","bl_tree","l_desc","d_desc","bl_desc","bl_count","MAX_BITS","heap","heap_len","heap_max","sym_buf","lit_bufsize","sym_end","opt_len","static_len","bi_buf","deflateStateCheck","deflateResetKeep","data_type","deflateReset","ret","deflateInit","old_flush","level_flags","text","hcrc","time","os","beg","gzhead_extra","bstate","deflate_huff","deflate_rle","dictLength","tmpDict","avail","deflateInfo","xflags","extra_len","BAD","_in","_out","dmax","whave","wnext","s_window","hold","bits","lcode","dcode","lmask","dmask","here","dist","from","from_source","lencode","distcode","lenbits","distbits","top","dolen","mode","sane","inflate_fast","inflate_table","HEAD","DICT","TYPE","TYPEDO","COPY_","LEN_","LEN","CHECK","MEM","zswap32","InflateState","havedict","check","total","wbits","ncode","nlen","ndist","lens","work","lendyn","distdyn","back","was","inflateStateCheck","inflateResetKeep","inflateReset2","lenfix","distfix","virgin","fixedtables","sym","updatewindow","inflateInit","put","here_bits","here_op","here_val","last_bits","last_op","last_val","hbuf","inf_leave","dictid","inflateInfo","lbase","lext","dbase","dext","lens_index","codes","table_index","incr","fill","low","mask","root","curr","drop","huff","base","MAXBITS","offs","extra_lbits","extra_dbits","extra_blbits","bl_order","static_ltree","static_dtree","D_CODES","_dist_code","_length_code","base_length","base_dist","StaticTreeDesc","static_tree","extra_bits","extra_base","elems","max_length","has_stree","static_l_desc","static_d_desc","static_bl_desc","TreeDesc","dyn_tree","stat_desc","max_code","d_code","put_short","w","send_bits","send_code","tree","bi_reverse","gen_codes","next_code","init_block","LITERALS","END_BLOCK","bi_windup","smaller","_n2","_m2","pqdownheap","compress_block","ltree","dtree","lc","sx","build_tree","desc","stree","xbits","overflow","gen_bitlen","scan_tree","curlen","prevlen","nextlen","max_count","min_count","REP_3_6","REPZ_3_10","REPZ_11_138","send_tree","static_init_done","stored_len","LENGTH_CODES","L_CODES","tr_static_init","opt_lenb","static_lenb","max_blindex","block_mask","detect_data_type","BL_CODES","build_bl_tree","lcodes","dcodes","blcodes","send_all_trees","STATIC_TREES","bi_flush","selector","spec","output_area","imgIndex","outputs","item","metadata","imageIndex","jsIndex","javascriptIndex","el","document","getElementById","substring","loader","http","credentials","view","toImageURL","imageData","split","output_type","catch","showError","default","innerHTML","VegaWidgetModel","VegaWidget","requires","IJupyterWidgetRegistry","activate","app","widgets","registerWidget","plugin","autoStart","pkg","MODULE_VERSION","MODULE_NAME","viewInstance","_spec_source","_opt_source","_df","_img_url","imgURL","mgr","viewElement","hasBeenUpdated","id_","crypto","randomUUID","canvas","querySelector","width","style","height","url","toDataURL","model_name","model_module","model_module_version","view_name","view_module","view_module_version","createElement","errorElement","appendChild","color","reembed","imgJson","imgElement","vegaEmbed","finalize","send","applyUpdate","resize","filter","remove","newValues","updateDataFrame","updateArray2D","changeSet","changeset","change","runAsync","applyUpdates","updates","on","ev","checkWidgetUpdate","textContent","proxy","rows","fancyCol","cols","row","compare","sorted","ptr","unique_pred","unique_eq","vegaImport","vegaLiteImport","_interopNamespaceDefault","extendStatics","vegaImport__namespace","vegaLiteImport__namespace","__extends","setPrototypeOf","__proto__","_hasOwnProperty","_objectKeys","keys_1","_deepClone","isInteger","charCode","escapePathComponent","path","unescapePathComponent","hasUndefined","i_1","objKeys","objKeysLength","patchErrorMessageFormatter","messageParts","PatchError","_super","operation","_newTarget","_this","JsonPatchError","deepClone","objOps","newDocument","removed","move","getValueByPointer","originalValue","applyOperation","valueToCopy","_areEquals","_get","arrOps","pointer","getOriginalDestination","validateOperation","mutateDocument","banPrototypeModifications","validator","returnValue","existingPathFragment","validateFunction","applyPatch","patch","results","length_1","pathLen","existingPathLen","validate","sequence","externalValidator","arrA","arrB","core","applyReducer","operationResult","beforeDict","WeakMap","Mirror","observers","ObserverInfo","callback","observer","generate","invertible","mirror","_generate","patches","temp","newKeys","oldKeys","deleted","oldVal","newVal","duplex","tree1","tree2","observe","getMirror","observerInfo","getObserverFromMirror","dirtyCheck","fastCheck","clearTimeout","setTimeout","addEventListener","unobserve","delete","removeObserverFromMirror","removeEventListener","getDefaultExportFromCjs","__esModule","stringOrChar","stringify$1","passedObj","indent","maxLength","replacer","_stringify","currentIndent","reserved","items","keyPart","nextIndent","prettified","string","stringLiteral","lrucache","firstKey","looseOption","loose","emptyOpts","parseOptions_1","re$1","MAX_LENGTH","MAX_SAFE_COMPONENT_LENGTH","MAX_SAFE_BUILD_LENGTH","MAX_LENGTH$1","MAX_SAFE_INTEGER","Number","RELEASE_TYPES","SEMVER_SPEC_VERSION","FLAG_INCLUDE_PRERELEASE","FLAG_LOOSE","debug_1","process","env","NODE_DEBUG","safeRe","R","LETTERDASHNUMBER","safeRegexReplacements","createToken","safe","makeSafeRegex","NUMERICIDENTIFIER","NUMERICIDENTIFIERLOOSE","NONNUMERICIDENTIFIER","PRERELEASEIDENTIFIER","PRERELEASEIDENTIFIERLOOSE","BUILDIDENTIFIER","MAINVERSION","PRERELEASE","BUILD","FULLPLAIN","MAINVERSIONLOOSE","PRERELEASELOOSE","LOOSEPLAIN","XRANGEIDENTIFIER","XRANGEIDENTIFIERLOOSE","GTLT","XRANGEPLAIN","XRANGEPLAINLOOSE","COERCEPLAIN","COERCE","COERCEFULL","LONETILDE","tildeTrimReplace","LONECARET","caretTrimReplace","comparatorTrimReplace","reExports","numeric","compareIdentifiers$1","anum","bnum","identifiers","compareIdentifiers","rcompareIdentifiers","parseOptions","semver","SemVer","includePrerelease","LOOSE","FULL","major","minor","prerelease","num","build","format","other","compareMain","comparePre","compareBuild","inc","release","identifierBase","compare$6","compare$5","compare$4","compare$3","compare$2","compare$1","comparator","hasRequiredComparator","hasRequiredRange","cmp_1","eq","neq","gt","gte","lt","lte","requireRange","Range","Comparator","parseRange","isNullSet","isAny","comps","memoKey","cached","cache","hr","HYPHENRANGELOOSE","HYPHENRANGE","hyphenReplace","COMPARATORTRIM","TILDETRIM","CARETTRIM","rangeList","comp","parseComparator","replaceGTE0","COMPARATORLOOSE","rangeMap","comparators","has","values","intersects","some","thisComparators","isSatisfiable","rangeComparators","every","thisComparator","rangeComparator","er","testSet","ANY","COMPARATOR","startsWith","includes","requireComparator","remainingComparators","testComparator","otherComparator","replaceCarets","replaceTildes","replaceXRanges","replaceStars","isX","replaceTilde","TILDELOOSE","TILDE","M","pr","replaceCaret","CARETLOOSE","CARET","replaceXRange","XRANGELOOSE","XRANGE","gtlt","xM","xm","xp","anyX","STAR","GTE0PRE","GTE0","incPr","$0","fM","fm","fp","fpr","fb","tM","tm","tp","tpr","allowed","satisfies$1","Constants","NaN","E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2","MIN_VALUE","MAX_VALUE","Ops","Unary","cast","Functions","acos","asin","atan","atan2","ceil","cos","exp","floor","pow","random","round","sin","sqrt","tan","clamp","now","utc","UTC","datetime","y","H","S","ms","date","getDate","day","getDay","year","getFullYear","month","getMonth","hours","getHours","minutes","getMinutes","seconds","getSeconds","milliseconds","getMilliseconds","timezoneoffset","getTimezoneOffset","utcdate","getUTCDate","utcday","getUTCDay","utcyear","getUTCFullYear","utcmonth","getUTCMonth","utchours","getUTCHours","utcminutes","getUTCMinutes","utcseconds","getUTCSeconds","utcmilliseconds","getUTCMilliseconds","indexof","lastindexof","reverse","upper","toUpperCase","lower","regexp","EventFunctions","DisallowedMethods","eval","setInterval","setImmediate","Visitors","$","memberDepth","datum","event","fn","reduce","interpret","vega","ctx","functions","parameter","handler","marktype","channels","swap","x2","xc","y2","yc","adjustSpatial","exec","library","lightColor","medColor","darkTheme","background","stroke","title","subtitleColor","axis","domainColor","gridColor","tickColor","markColor$7","excelTheme","arc","area","strokeWidth","rect","bandPosition","grid","gridOpacity","gridWidth","labelPadding","tickSize","tickWidth","axisBand","tickExtra","legend","labelBaseline","labelFontSize","symbolSize","symbolType","category","markColor$6","axisColor$2","backgroundColor$2","blackTitle","fiveThirtyEightTheme","labelColor","titleColor","titleFontSize","titlePadding","group","padding","diverging","heatmap","point","filled","bar","binSpacing","anchor","fontSize","fontWeight","markColor$5","ggplot2Theme","domain","titleFontWeight","labelFont$1","markColor$4","titleFont","colorSchemes$1","latimesTheme","font","labelFont","labelFontWeight","axisX","labelAngle","axisY","maxExtent","minExtent","titleAlign","titleAngle","titleX","titleY","ordinal","ramp","markColor$3","axisColor$1","quartzTheme","domainWidth","markColor$2","voxTheme","gridDash","markColor$1","axisColor","colorSchemes","urbanInstituteTheme","ticks","orient","trail","align","markColor","defaultFont$1","googlechartsTheme","circle","bottom","dy","ptToPx","fontSmallPx","legendFontPx","fontLargePx","fontStandard","fontTitle","firstLevelElementColor","secondLevelElementColor","backgroundColor","paletteColor1","divergentColorMin","divergentPalette","powerbiTheme","axisQuantitative","tickCount","labelFlush","strokeCap","strokeJoin","opacity","defaultFont","TOKENS","textPrimary","g90","g100","white","g10","textSecondary","layerAccent01","gridBg","darkCategories","lightCategories","genCarbonConfig","theme","viewbg","textColor","carbonwhite","carbong10","carbong90","carbong100","themes","dark","excel","fivethirtyeight","ggplot2","googlecharts","latimes","powerbi","quartz","urbaninstitute","vox","fname","get1","field","getN","splitAccessPath","isObject","maxDepth","EL_ID","DEFAULT_OPTIONS","offsetX","offsetY","styleId","disableDefaultStyle","sanitize","formatTooltip","valueToHtml","baseURL","content","image","URL","location","href","Handler","elementId","tooltipHandler","setAttribute","createDefaultStyle","childNodes","insertBefore","classList","fullscreenElement","tooltipBox","clientX","innerWidth","clientY","innerHeight","calculatePosition","getBoundingClientRect","embedStyle","mergeDeep","dest","deepMerge_","writeConfig","vegaLite","vl","DEFAULT_ACTIONS","export","svg","png","compiled","editor","I18N","CLICK_TO_VIEW_ACTIONS","COMPILED_ACTION","EDITOR_ACTION","PNG_ACTION","SOURCE_ACTION","SVG_ACTION","NAMES","VERSION","PREPROCESSOR","vgSpec","vlSpec","config","SVG_CIRCLES","CHART_WRAPPER_CLASS","viewSource","sourceHeader","sourceFooter","footer","win","open","write","isLoader","createLoader","async","embed","parsedSpec","isString","load","loadedEmbedOptions","usermeta","embedOptions","defaultStyle","embedOptionsFromUsermeta","usermetaLoader","usermetaOpts","loadOpts","parsedOpts","mergedOpts","mergeConfig","actions","isBoolean","i18n","renderer","logLevel","Warn","downloadFileName","element","ID","rootContainer","possibleRoot","getRootNode","ShadowRoot","getRoot","providedMode","$schema","parsed","guessMode","container","chartWrapper","formatLocale","timeFormatLocale","expressionFunctions","expressionFunction","runtime","viewClass","View","expressionInterpreter","addSignalListener","autosize","tooltip","loader_","documentClickHandler","hover","hoverSet","updateSet","initialize","wrapper","forceActionsMenu","details","append","contains","target","removeAttribute","ctrl","ext","i18nExportAction","exportLink","scaleFactor","download","preventDefault","viewSourceLink","compileLink","editorUrl","editorLink","origin","listen","evt","postMessage","_embed","div","HTMLElement","factory","getter","identity","log$1","isLegalKey","configs","signals","mergeNamed","layout","recurse","hop","isNumber","flat","configurable","writable","flatMap","isLogicalOr","or","isLogicalAnd","and","isLogicalNot","not","forEachLeaf","subop","normalizeLogicalComposition","normalizer","deepEqual","duplicate","pick","props","prop","omit","isNullOrFalse","unique","u","isEqual","dictKeys","otherKeys","setEqual","hasIntersection","prefixGenerator","prefixes","wrappedWithAccessors","computedPrefixes","fieldIntersection","isEmpty","vals","varName","alphanumericS","logicalExpr","cb","deleteNestedProperty","orderedProps","titleCase","accessPathWithDatum","pieces","flatAccessWithDatum","escapePathAccess","replacePathInField","replaceAll","find","replacement","removePathFromField","accessPathDepth","getFirstDefined","arg","idCounter","uniqueId","resetIdCounter","internalField","isInternalField","normalizeAngle","angle","isNumeric","CONDITIONAL_AXIS_PROP_INDEX","labelAlign","part","vgProp","labelFontStyle","labelOpacity","labelOffset","gridDashOffset","tickDash","tickDashOffset","tickOpacity","isConditionalAxisValue","AXIS_PARTS","AXIS_PROPERTY_TYPE","gridCap","gridScale","aria","domainCap","domainDash","domainDashOffset","domainOpacity","formatType","labelBound","labelFlushOffset","labelLimit","labelLineHeight","labelOverlap","labels","labelSeparation","position","tickCap","tickMinStep","tickOffset","tickRound","titleAnchor","titleBaseline","titleFontStyle","titleLimit","titleLineHeight","titleOpacity","scale","tickBand","translate","zindex","COMMON_AXIS_PROPERTIES_INDEX","AXIS_PROPERTIES_INDEX","labelExpr","encoding","isAxisProperty","AXIS_CONFIGS","axisBottom","axisDiscrete","axisLeft","axisPoint","axisRight","axisTemporal","axisTop","axisXBand","axisXDiscrete","axisXPoint","axisXQuantitative","axisXTemporal","axisYBand","axisYDiscrete","axisYPoint","axisYQuantitative","axisYTemporal","AGGREGATE_OP_INDEX","argmax","argmin","average","distinct","product","mean","median","missing","q1","q3","ci0","ci1","stderr","stdev","stdevp","sum","valid","variance","variancep","MULTIDOMAIN_SORT_OP_INDEX","isArgminDef","isArgmaxDef","isAggregateOp","COUNTING_OPS","isCountingAggregateOp","aggregate","SUM_OPS","SHARED_DOMAIN_OP_INDEX","__rest","propertyIsEnumerable","ROW","COLUMN","FACET","X","Y","X2","Y2","RADIUS","RADIUS2","THETA","THETA2","LATITUDE","LONGITUDE","LATITUDE2","LONGITUDE2","COLOR","FILL","STROKE","SHAPE","SIZE","ANGLE","OPACITY","FILLOPACITY","STROKEOPACITY","STROKEWIDTH","STROKEDASH","TEXT","ORDER","DETAIL","KEY","TOOLTIP","HREF","DESCRIPTION","POLAR_POSITION_CHANNEL_INDEX","theta","theta2","radius","radius2","isPolarPositionChannel","GEO_POSIITON_CHANNEL_INDEX","longitude","longitude2","latitude","latitude2","GEOPOSITION_CHANNELS","UNIT_CHANNEL_INDEX","fillOpacity","strokeOpacity","strokeDash","detail","isColorChannel","channel","FACET_CHANNEL_INDEX","facet","FACET_CHANNELS","CHANNEL_INDEX","CHANNELS","_o","_d","_tt1","SINGLE_DEF_CHANNEL_INDEX","_r","_c","_f","SINGLE_DEF_UNIT_CHANNEL_INDEX","isChannel","SECONDARY_RANGE_CHANNEL","isSecondaryRangeChannel","getMainRangeChannel","getVgPositionChannel","getSecondaryRangeChannel","getSizeChannel","_x","_y","_x2","_y2","_latitude","_longitude","_latitude2","_longitude2","_theta","_theta2","_radius","_radius2","NONPOSITION_CHANNEL_INDEX","NONPOSITION_CHANNELS","POSITION_SCALE_CHANNEL_INDEX","POSITION_SCALE_CHANNELS","isXorY","POLAR_POSITION_SCALE_CHANNEL_INDEX","POLAR_POSITION_SCALE_CHANNELS","getPositionScaleChannel","sizeType","_t","_tt","_hr","_u","_al","_dd","_k","_oo","NONPOSITION_SCALE_CHANNEL_INDEX","NONPOSITION_SCALE_CHANNELS","SCALE_CHANNEL_INDEX","SCALE_CHANNELS","isScaleChannel","ALL_MARKS","geoshape","rule","square","tick","_g","ALL_MARKS_EXCEPT_GEOSHAPE","rangeType","binToString","bin","normalizeBin","isSelectionExtent","isBinning","isBinParams","binned","isBinned","extent","autoMaxBins","invalidSpec","FIT_NON_SINGLE","containerSizeNonSingle","containerSizeNotCompatibleWithAutosize","droppingFit","unknownField","cannotProjectOnChannelWithoutField","cannotProjectAggregate","selectionNotSupported","mark","columnsNotSupportByRowCol","differentParse","local","ancestor","customFormatTypeNotAllowed","invalidFieldType","droppingColor","emptyFieldDef","fieldDef","incompatibleChannel","markOrFacet","when","facetChannelShouldBeDiscrete","discreteChannelCannotEncode","unaggregateDomainHasNoEffectForRawField","unaggregateDomainWithNonSharedDomainOp","unaggregatedDomainWithLogScale","scalePropertyNotWorkWithScaleType","scaleType","propName","stepDropped","MORE_THAN_ONE_SORT","invalidTimeUnit","unitName","errorBand1DNotSupport","channelRequiredForBinned","main","info","logger","current","isDateTime","TIMEUNIT_PARTS","MONTHS","SHORT_MONTHS","DAYS","SHORT_DAYS","dateTimeParts","normalize","parts","lowerM","monthIndex","shortM","shortMonthIndex","normalizeMonth","quarter","normalizeQuarter","lowerD","dayIndex","shortD","shortDayIndex","normalizeDay","timeUnit","unit","dateTimeToExpr","LOCAL_SINGLE_TIMEUNIT_INDEX","week","dayofyear","isUTCTimeUnit","VEGALITE_TIMEFORMAT","getTimeUnitParts","containsTimeUnit","fullTimeUnit","timeUnitSpecifierExpression","timeUnitParts","normalizeTimeUnit","isVgRangeStep","isDataRefDomain","VG_MARK_CONFIGS","ariaRole","ariaRoleDescription","blend","strokeDashOffset","strokeOffset","strokeMiterLimit","startAngle","endAngle","padAngle","innerRadius","outerRadius","interpolate","tension","baseline","dir","dx","ellipsis","fontStyle","lineBreak","lineHeight","cursor","cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","aspect","smooth","VG_MARK_INDEX","VG_CORNERRADIUS_CHANNELS","isFieldEqualPredicate","predicate","isFieldLTPredicate","isFieldLTEPredicate","isFieldGTPredicate","isFieldGTEPredicate","isFieldRangePredicate","isFieldOneOfPredicate","oneOf","in","isFieldPredicate","predicateValueExpr","valueExpr","wrapTime","fieldFilterExpression","useInRange","_a","fieldExpr","fieldRef","lastTimeUnit","dateExpr","dateTimeExprToExpr","vgField","predicateValuesExpr","isFieldValidPredicate","fieldValidPredicate","signal","exprs","normalizePredicate","Type","quantitative","temporal","nominal","geojson","QUANTITATIVE","ORDINAL","TEMPORAL","NOMINAL","GEOJSON","ScaleType","LINEAR","LOG","POW","SQRT","SYMLOG","IDENTITY","SEQUENTIAL","TIME","QUANTILE","QUANTIZE","THRESHOLD","BIN_ORDINAL","POINT","BAND","SCALE_CATEGORY_INDEX","linear","symlog","sequential","band","quantile","quantize","threshold","scaleCompatible","scaleType1","scaleType2","scaleCategory1","scaleCategory2","SCALE_PRECEDENCE_INDEX","scaleTypePrecedence","CONTINUOUS_TO_CONTINUOUS_SCALES","CONTINUOUS_TO_CONTINUOUS_INDEX","QUANTITATIVE_SCALES_INDEX","CONTINUOUS_TO_DISCRETE_INDEX","CONTINUOUS_DOMAIN_INDEX","DISCRETE_DOMAIN_INDEX","hasDiscreteDomain","hasContinuousDomain","isContinuousToContinuous","isContinuousToDiscrete","isSelectionDomain","SCALE_PROPERTY_INDEX","domainMax","domainMin","domainMid","rangeMax","rangeMin","scheme","bins","nice","exponent","constant","paddingInner","paddingOuter","NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTY_INDEX","NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES","scaleTypeSupportProperty","channelScalePropertyIncompatability","isExprRef","replaceExprRefInIndex","newIndex","signalRefOrValue","Mark","ARC","AREA","BAR","IMAGE","LINE","RECT","RULE","TICK","TRAIL","CIRCLE","SQUARE","GEOSHAPE","isPathMark","isRectBasedMark","PRIMITIVE_MARKS","isMarkDef","FILL_STROKE_CONFIG","VL_ONLY_MARK_CONFIG_PROPERTIES","invalid","timeUnitBand","timeUnitBandPosition","MARK_CONFIGS","BAR_CORNER_RADIUS_INDEX","horizontal","vertical","midPointRefWithPositionInvalidTest","channelDef","markDef","ref","midPoint","isFieldDef","wrapPositionInvalidTest","getMarkPropOrConfig","fieldInvalidTestValueRef","fieldInvalidPredicate","zeroValueRef","valueRefForFieldOrDatumDef","scaleName","isDatumDef","interpolatedSignalRef","fieldOrDatumDef","fieldOrDatumDef2","startSuffix","suffix","channel2Def","defaultRef","isFieldOrDatumDef","isTypedFieldDef","getBand","fieldDef2","isMidPoint","impute","binSuffix","binRequiresRange","isValueDef","offsetMixins","widthHeightValueOrSignalRef","signalOrValueRef","isCustomFormatType","customFormatExpr","BIN_RANGE_DELIMITER","formatSignalRef","normalizeStack","_b","formatCustomType","fieldToFormat","isFieldOrDatumDefForTimeFormat","rawTimeFormat","isUTCScale","formatExpression","timeFormatExpression","timeFormat","isScaleFieldDef","numberFormat","channelDefType","binFormatExpression","formatExpr","datumDef","datumDefToExpr","guideFormat","omitTimeFormatConfig","specifiedFormat","guideFormatType","binNumberFormatExpr","startField","endField","DEFAULT_SORT_OP","SORT_BY_CHANNEL_INDEX","isSortByChannel","isSortByEncoding","isSortField","isSortArray","isFacetMapping","isFacetFieldDef","isFacetSpec","toFieldDefBase","isSortableFieldDef","getMarkConfig","fieldChannel","hasBand","isConditionalDef","hasConditionalFieldDef","hasConditionalFieldOrDatumDef","isContinuousFieldOrDatumDef","cd","isContinuous","isNumericDataDef","isPositionFieldOrDatumDef","isMarkPropFieldOrDatumDef","isStringFieldOrDatumDef","toStringFieldDef","argAccessor","isCount","nofn","isOpFieldDef","tu","timeUnitToString","forAs","isDiscrete","def","defaultTitleFormatter","fieldTitle","timeUnitParams","maxbins","functionalTitleFormatter","countTitle","verbalTitleFormatter","titleFormatter","setTitleFormatter","formatter","allowDisabling","includeDefault","guideTitle","getGuide","defaultTitle","getFormatMixins","guide","getFieldDef","getFieldOrDatumDef","initChannelDef","initFieldOrDatumDef","fd","customFormatTypes","guideType","newGuide","initFieldDef","initDatumDef","compositeMark","fullType","getFullName","newType","defaultType","compatible","warning","COMPATIBLE","channelCompatibility","sub","labelOrient","titleOrient","undefinedIfExprNotRequired","isTime","isLocalSingleTimeUnit","valueArray","extractTitleConfig","titleConfig","frame","subtitleFont","subtitleFontSize","subtitleFontStyle","subtitleFontWeight","subtitleLineHeight","subtitlePadding","titleMarkConfig","nonMark","subtitle","subtitleMarkConfig","isText","signalOrValueRefWithCondition","conditionalSignalRefOrValue","exprFromValueOrSignalRef","signalOrStringValue","getStyles","vgChannel","ignoreVgConfig","getMarkStyleConfig","styleConfigIndex","getStyleConfig","styles","styleConfig","sortParams","orderDef","fieldRefOption","orderChannelDef","mergeTitleFieldDefs","f1","f2","merged","fdToMerge","fieldDef1","mergeTitle","title1","title2","mergeTitleComponent","v1","v2","v1Val","v2Val","explicit","isUnitSpec","CompositeMarkNormalizer","run","hasMatchingType","channelHasField","isAggregate","extractTransformsFromEncoding","oldEncoding","groupby","timeUnits","aggOp","isTitleDefined","newField","newFieldDef","aggregateEntry","as","secondaryChannel","isNonPositionScaleChannel","initEncoding","normalizedEncoding","markSupported","getSupportedMark","supportMark","primaryFieldDef","markChannelCompatible","defs","normalizeEncoding","newChannelDef","mapping","pathGroupingFields","getCompositeMarkTooltip","tooltipSummary","continuousAxisChannelDef","encodingWithoutContinuousAxis","withFieldName","fieldPrefix","titlePrefix","mainTitle","getTitle","escape","channelDefArray","fieldDefs","makeCompositeAggregatePartFactory","compositeMarkDef","continuousAxis","sharedEncoding","compositeMarkConfig","partName","positionPrefix","endPositionPrefix","extraEncoding","partLayerMixins","partBaseSpec","clip","compositeMarkContinuousAxis","continuousAxisChannelDef2","continuousAxisChannelDefError","continuousAxisChannelDefError2","filterAggregateFromChannelDef","continuousAxisWithoutAggregate","compositeMarkOrient","xAggregate","yAggregate","BOXPLOT","boxPlotNormalizer","normalizeBoxPlot","getBoxPlotType","_encoding","selection","projection","_p","outerSpec","boxplot","sizeValue","boxPlotType","transform","ticksOrient","boxOrient","customTooltipWithoutAggregatedField","continuousFieldName","boxplotSpecificAggregate","boxParamsQuartiles","postAggregateCalculates","calculate","oldEncodingWithoutContinuousAxis","filteredEncoding","customTooltipWithAggregatedField","filterTooltipWithAggregatedField","boxParams","encodingWithoutSizeColorAndContinuousAxis","makeBoxPlotPart","makeBoxPlotExtent","makeBoxPlotBox","makeBoxPlotMidTick","fiveSummaryTooltipEncoding","endTick","whiskerTooltipEncoding","whiskerLayers","boxLayers","layer","lowerBoxExpr","upperBoxExpr","iqrExpr","lowerWhiskerExpr","upperWhiskerExpr","joinaggregateTransform","joinaggregate","filteredWhiskerSpec","encodingWithoutSizeColorContinuousAxisAndTooltip","axisWithoutTitle","outlierLayersMixins","filteredLayersMixins","filteredLayersMixinsTransforms","unshift","continousAxisField","ERRORBAR","errorBarNormalizer","normalizeErrorBar","tooltipEncoding","errorBarParams","makeErrorBarPart","errorbar","thickness","inputType","xError","xError2","yError","yError2","errorBarIsInputTypeRaw","isTypeAggregatedUpperLower","errorBarIsInputTypeAggregatedUpperLower","isTypeAggregatedError","errorBarIsInputTypeAggregatedError","errorBarOrientAndInputType","errorBarSpecificAggregate","tooltipTitleWithFieldName","center","getTitlePrefix","centerOp","lowerExtentOp","upperExtentOp","postAggregateCalculate","errorBarAggregationAndCalculation","_e","oldAggregate","oldGroupBy","ERRORBAND","errorBandNormalizer","normalizeErrorBand","errorBandDef","makeErrorBandPart","errorband","is2D","bandMark","bordersMark","compositeMarkRegistry","VL_ONLY_LEGEND_CONFIG","HEADER_TITLE_PROPERTIES_MAP","HEADER_LABEL_PROPERTIES_MAP","labelAnchor","HEADER_TITLE_PROPERTIES","HEADER_LABEL_PROPERTIES","HEADER_CONFIGS","headerRow","headerColumn","headerFacet","LEGEND_SCALE_CHANNELS","COMMON_LEGEND_PROPERTY_INDEX","clipHeight","columnPadding","direction","fillColor","gradientLength","gradientOpacity","gradientStrokeColor","gradientStrokeWidth","gradientThickness","gridAlign","legendX","legendY","rowPadding","strokeColor","symbolDash","symbolDashOffset","symbolFillColor","symbolLimit","symbolOffset","symbolOpacity","symbolStrokeColor","symbolStrokeWidth","assembleParameterSignals","SELECTION_ID","defaultConfig","single","empty","clear","multi","toggle","interval","encodings","zoom","isLegendBinding","isLegendStreamBinding","isConcatSpec","isVConcatSpec","isHConcatSpec","isStep","isFrameMixins","COMPOSITION_LAYOUT_PROPERTIES","bounds","spacing","getViewConfigContinuousSize","viewConfig","getViewConfigDiscreteStep","getViewConfigDiscreteSize","DEFAULT_STEP","continuousWidth","continuousHeight","continuousBandSize","box","outliers","borders","pointPadding","barBandPaddingInner","rectBandPaddingInner","minBandSize","minFontSize","maxFontSize","minOpacity","maxOpacity","minSize","minStrokeWidth","maxStrokeWidth","quantileCount","quantizeCount","gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity","tab10","DEFAULT_FONT_SIZE","guideLabel","groupTitle","groupSubtitle","DEFAULT_COLOR","blue","orange","red","teal","green","yellow","purple","pink","brown","gray0","gray1","gray2","gray3","gray4","gray5","gray6","gray7","gray8","gray9","gray10","gray11","gray12","gray13","gray14","gray15","getAxisConfigInternal","axisConfig","axisConfigInternal","configPropsWithExpr","initConfig","specifiedConfig","restConfig","mergedConfig","fontConfig","cell","colorSignalConfig","fontSizeSignalConfig","outputConfig","markConfigType","axisConfigType","headerConfigType","styleConfigInternal","getStyleConfigInternal","MARK_STYLES","VL_ONLY_CONFIG_PROPERTIES","VL_ONLY_ALL_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX","redirectConfigToStyleConfig","toProp","compositeMarkPart","propConfig","isLayerSpec","SpecMapper","mapFacet","isRepeatSpec","mapRepeat","mapHConcat","mapVConcat","mapConcat","mapLayerOrUnit","mapLayer","mapUnit","subspec","hconcat","vconcat","STACK_OFFSET_INDEX","STACKABLE_MARKS","STACK_BY_DEFAULT_MARKS","potentialStackedChannel","xDef","yDef","xScale","yScale","stackedFieldDef","stackedField","dimensionChannel","getDimensionChannel","dimensionDef","dimensionField","stackBy","sc","cDef","disallowNonLinearStack","groupbyChannel","groupbyField","dropLineAndPoint","_point","_line","dropLineAndPointFromConfig","getPointOverlay","markConfig","getLineOverlay","PathOverlayNormalizer","pointOverlay","lineOverlay","stackProps","overlayEncoding","stackFieldChannel","RangeStepNormalizer","sizeMixins","defWithoutScale","rangeStep","scaleWithoutRangeStep","replaceRepeaterInFacet","repeater","replaceRepeaterInMapping","replaceRepeaterInFieldDef","replaceRepeaterInEncoding","replaceRepeatInProp","isRepeatRef","repeat","replaceRepeaterInFieldOrDatumDef","replaceRepeaterInChannelDef","RuleForRangedLineNormalizer","mainChannelDef","hasX2","hasY2","mergeEncoding","parentEncoding","parentChannelDef","mergedChannelDef","mergeProjection","parentProjection","normalizedSpec","normalizeGenericSpec","sizeInfo","isFitCompatible","autosizeDefault","_normalizeAutoSize","normalizeAutoSize","super","nonFacetUnitNormalizers","hasRow","hasColumn","hasFacet","mapFacetedUnit","specWithReplacedEncoding","mapUnitWithParentEncodingOrProjection","normalizeLayerOrUnit","unitNormalizer","isLayerRepeatSpec","mapLayerRepeat","mapNonLayerRepeat","childSpec","repeaterPrefix","layerValue","childRepeater","childName","remainingProperties","repeatValues","repeatValue","rowValue","columnValue","mergedProjection","mergedEncoding","facetMapping","getFacetMappingAndLayout","newEncoding","facets","defWithoutLayout","otherParams","TOP_LEVEL_PROPERTIES","extractTopLevelProperties","includeParams","Split","implicit","combine","getWithExplicit","setWithExplicit","copyKeyFromSplit","copyKeyFromObject","copyAll","makeExplicit","makeImplicit","tieBreakByComparing","propertyOf","diff","defaultTieBreaker","mergeValuesWithExplicit","tieBreaker","AncestorParse","parseNothing","isUrlData","isInlineData","isNamedData","isGenerator","isSequenceGenerator","isSphereGenerator","isGraticuleGenerator","DataSourceType","isFilter","isLookup","isPivot","isDensity","isQuantile","isRegression","isLoess","isSample","isWindow","isJoinAggregate","isFlatten","isCalculate","isBin","isImpute","isTimeUnit","isStack","isFold","LBRACK","RBRACK","LBRACE","RBRACE","COLON","COMMA","NAME","GT","ILLEGAL","DEFAULT_MARKS","DEFAULT_SOURCE","MARKS","eventSelector","marks","parseMerge","parseSelector","endChar","pushChar","popChar","stream","between","parseBetween","throttle","markname","lastIndexOf","parseThrottle","isMarkType","consume","debounce","parseStream","wrapCondition","refFn","valueRef","vgConditions","conditionValueRef","isConditionalSelection","parseSelectionPredicate","textRef","tooltipRefForEncoding","reactiveGeom","tooltipRefFromChannelDef","markTooltip","tooltipData","toSkip","tuples","fDef","mainChannel","channel2","keyValues","nonPosition","defaultValue","getScaleComponent","markType","transparentIfNeeded","defaultFill","defaultStroke","colorVgChannel","fillStrokeMarkDefAndConfig","getOffset","offsetChannel","getOffsetChannel","markDefOffsetValue","pointPosition","defaultPos","pointPositionDefaultRef","getName","positionRef","definedValueOrConfig","domainDefinitelyIncludesZero","sizeRef","mult","ALIGNED_X_CHANNEL","BASELINED_Y_CHANNEL","middle","vgAlignedPositionChannel","defaultAlign","alignChannel","alignExcludingSignal","pointOrRangePosition","defaultPos2","rangePosition","sizeChannel","pos2Mixins","baseChannel","position2Ref","position2orSize","pointPosition2OrSize","rectPosition","channelDef2","hasSizeDef","isBarBand","component","axes","axisTranslate","vgChannel2","rectBinRef","getBinSpacing","startRef","rectBinPosition","vgSizeChannel","useVlSizeChannel","sizeFromMarkOrConfig","defaultSizeRef","posRef","sizeOffset","positionAndSize","discreteBandSize","scaleRange","spacingOffset","reverseExpr","offsetExpr","translateExpr","ALWAYS_IGNORE","baseEncodeEntry","ignore","markDefProperties","wrapAllFieldsInvalid","enableAria","ariaRoleDesc","descriptionValue","filterIndex","aggregator","scaleComponent","allFieldsInvalidPredicate","defined","valueIfDefined","VORONOI","nearest","selCmpt","events","project","hasChannel","cellDef","interactive","isVoronoi","getSizeSignalRef","exists","DataFlowNode","debugName","_children","_parent","addChild","children","numChildren","removeChild","oldChild","insertAsParentOf","swapWithParent","newParent","OutputNode","refCounts","_source","_name","cloneObj","dependentFields","producedFields","_hash","getSource","isRequired","setSource","TimeUnitNode","formula","makeFromEncoding","reduceFieldDef","timeUnitComponent","isUnitModel","makeFromTransform","normalizedTimeUnit","merge","removeFormulas","newFormula","assemble","transforms","units","timezone","TUPLE_FIELDS","SelectionProjectionComponent","hasField","selDef","proj","signalName","sg","counter","cfg","parseInit","allSignals","hasLegend","origDef","topLevelSignals","sgname","assembleInit","TUPLE","TOGGLE","modifyExpr","tpl","findIndex","addClear","vIdx","visual","tIdx","scaleBindings","bound","scales","isTopLevelLayer","namedSg","VL_SELECTION_RESOLVE","isLayerModel","legendBindings","projLen","legendFilter","selName","markName","ds","sgName","force","tuple","ANCHOR","DELTA","hasScales","onDelta","delta","sizeSg","scaleCmpt","sy","compilers","inputs","forEachTransform","isExpr","assembled","dateTimeToTimestamp","assembleUnitSelectionMarks","forEachSelection","selCompiler","txCompiler","cleanupEmptyOnArray","BRUSH","SCALE_TRIGGER","fieldsSg","dataSignals","scaleTriggers","filterExpr","filters","cs","vname","dname","scaled","coord","channelSignals","toNum","xvname","yvname","store","STORE","vgStroke","enter","singleOrMultiSignals","selections","sel","facetModel","isFacetModel","getFacetModel","requiresSelectionId","ASTNode","visitor","TokenBooleanLiteral","TokenEOF","TokenIdentifier","TokenKeyword","TokenNullLiteral","TokenNumericLiteral","TokenPunctuator","TokenStringLiteral","SyntaxArrayExpression","SyntaxBinaryExpression","SyntaxCallExpression","SyntaxConditionalExpression","SyntaxIdentifier","SyntaxLiteral","SyntaxLogicalExpression","SyntaxMemberExpression","SyntaxObjectExpression","SyntaxProperty","SyntaxUnaryExpression","MessageUnexpectedToken","MessageUnexpectedNumber","MessageUnexpectedString","MessageUnexpectedIdentifier","MessageUnexpectedReserved","MessageUnexpectedEOS","MessageInvalidRegExp","MessageUnterminatedRegExp","MessageStrictOctalLiteral","MessageStrictDuplicateProperty","DISABLED","RegexNonAsciiIdentifierStart","RegexNonAsciiIdentifierPart","keywords","scanUnicodeCodePointEscape","cu1","cu2","finishBinaryExpression","finishCallExpression","finishIdentifier","finishLiteral","finishMemberExpression","member","finishProperty","legalKeywords","finishArrayExpression","finishObjectExpression","search","$1","exception","finishUnaryExpression","finishConditionalExpression","startsWithDatum","getDependentFields","dependents","FilterNode","_dependentFields","dfnode","stores","predicateStr","getSelectionComponent","tunode","parseSelectionBinExtent","filterOp","isSelectionPredicate","setAxisEncode","vgRef","assembleAxis","axisCmpt","disable","propType","propValue","valueOrSignalRef","conditions","propIndex","valueOrSignalCRef","signalRef","mainExtracted","hasAxisPart","titleString","assembleTitle","assembleAxisSignals","getAxisConfigFromConfigTypes","configTypes","configType","orient1","orientConfig1","orientConfig2","conditionalOrientAxisConfig","getAxisConfigStyle","axisConfigTypes","toMerge","getAxisConfig","axisConfigs","configFrom","configValue","axisRules","defaultGrid","gridChannel","defaultLabelAlign","defaultLabelBaseline","defaultLabelFlush","hasTimeUnit","defaultLabelOverlap","defaultTickCount","fieldDefTitle","getFieldDefTitle","typedFieldDef","defaultZindex","normalizeAngleExpr","alwaysIncludeMiddle","mainOrient","CalculateNode","parseAllForSortIndex","forEachFieldDef","sortValue","sortArrayIndexField","getHeaderChannel","getHeaderProperty","headerSpecificConfig","getHeaderProperties","HEADER_CHANNELS","HEADER_TYPES","assembleTitleGroup","layoutHeaders","facetFieldDef","ta","headerChannel","role","defaultHeaderGuideBaseline","defaultHeaderGuideAlign","assembleHeaderProperties","assembleHeaderGroups","layoutHeader","groups","headerType","headerComponent","assembleHeaderGroup","getSort","assembleLabelTitle","titleTextExpr","isFacetWithoutRowCol","hasAxes","sizeSignal","LAYOUT_TITLE_BAND","getLayoutTitleBand","propertiesMap","assembleLayoutSignals","sizeSignals","layoutSize","stepSignal","sizeExpr","isWidth","endsWith","safeExpr","cardinality","getSizeTypeFromLayoutSizeType","layoutSizeType","guideEncodeEntry","valueDef","defaultScaleResolve","isConcatModel","parseGuideResolve","channelScaleResolve","LEGEND_COMPONENT_PROPERTY_INDEX","LEGEND_COMPONENT_PROPERTIES","LegendComponent","legendEncodeRules","symbolsSpec","legendCmpt","legendType","_h","propsList","applyMarkConfig","getMaxValue","symbolBaseFillColor","getFirstConditionValue","selectedCondition","gradient","gradientSpec","specifiedlabelsSpec","labelsSpec","entriesSpec","getConditionValue","conditionalDef","reducer","hasConditionalValueDef","legendRules","legendConfig","gradientLengthSignal","defaultGradientLength","shapeChannelDef","markShape","defaultSymbolType","getDirection","defaultDirection","parseLegend","legendComponent","parseLegendForChannel","parseUnitLegend","legends","mergeLegendComponent","parseNonUnitLegend","isExplicit","getLegendDefWithScale","legendSelections","parseInteractiveLegend","getLegendType","ruleParams","legendEncoding","legendEncode","legendEncodeParams","legendEncodingPart","mergedLegend","childLegend","mergedOrient","childOrient","typeMerged","mergedValueWithExplicit","st1","st2","assembleLegends","legendComponentIndex","legendByDomain","domainHash","mergedLegendComponent","setLegendEncode","assembleLegend","assembleProjectionForModel","fits","lookupDataSource","fit","PROJECTION_PROPERTIES","ProjectionComponent","specifiedProjection","isFit","parseProjection","hasProjection","posssiblePair","requestDataName","Main","gatherFitData","projectionName","parseUnitProjection","nonUnitProjection","mergable","second","allPropertiesShared","mergeIfNoConflict","modelProjection","renameProjection","parseNonUnitProjections","binKey","getBinSignalName","createBinComponent","span","isBinTransform","normalizedBin","extentSignal","getSignalsFromModel","binComponent","BinNode","binComponentIndex","formulaAs","rangeFormula","renameSignal","binAs","remainingAs","binTrans","AggregateNode","dimensions","measures","groupBy","meas","dims","argField","scaleDomain","posChannel","getPositionChannelFromLatLong","addDimension","parentMeasures","childMeasures","ops","mergeMeasures","addDimensions","alias","FacetNode","sortField","sortIndexField","childModel","depFields","getChildIndependentFieldsWithStep","childIndependentFieldsWithStep","childScaleComponent","getFieldFromDomain","assembleDomain","assembleRowColumnHeaderData","crossedDataName","childChannel","assembleFacetHeaderData","hasSharedAxis","headers","stop","facetData","unquote","getImplicitFromFilterTransform","ParseNode","_parse","ancestorParse","makeWithAncestors","parsedAs","assembleFormatParse","formatParse","assembleTransforms","onlyNested","IdentifierNode","GraticuleNode","SequenceNode","SourceNode","_data","defaultExtension","_generator","hasName","dataName","_modified","receiver","privateMap","isDataSourceNode","Optimizer","setModified","modifiedFlag","BottomUpOptimizer","getNodeDepths","depths","optimize","topologicalSort","TopDownOptimizer","MergeIdenticalNodes","mergeNodes","nodes","mergedNode","hashes","buckets","RemoveUnnecessaryIdentifierNodes","RemoveDuplicateTimeUnits","timeUnitFields","RemoveUnnecessaryOutputNodes","MoveParseUp","MergeParse","originalChildren","parseChildren","commonParse","conflictingParse","parseNode","mergedParseNode","childNode","RemoveUnusedSubtrees","MergeTimeUnits","timeUnitChildren","combination","MergeAggregates","aggChildren","groupedAggregates","agg","groupBys","mergeableAggs","mergedAggs","MergeBins","moveBinsUp","promotableBins","remainingBins","promotedBin","remainingBin","MergeOutputs","otherChildren","mainOutput","lastOutput","theChild","JoinAggregateTransformNode","getDefaultName","joinAggregateFieldDef","StackNode","_stack","stackTransform","sortFields","sortOrder","normalizedAs","isValidAsArray","stackField","facetby","stackProperties","dimensionFieldDef","stackby","by","_field","getStackByFields","getGroupbyFields","WindowTransformNode","windowFieldDef","ignorePeers","moveFacetDown","facetMain","moveMainDownToFacet","cloner","newName","FACET_SCALE_PREFIX","outputNodes","MAX_OPTIMIZATION_RUNS","checkLinks","runOptimizer","optimizer","modified","optimizationDataflowHelper","dataComponent","firstPass","roots","SignalRefWrapper","exprGenerator","fromName","rename","parseScaleDomain","localScaleComponents","domains","parseDomainForChannel","parseSelectionDomain","isFaceted","facetParent","parseUnitScaleDomain","selectionExtent","childComponent","domainsTieBreaker","se","parseNonUnitScaleDomain","scaleConfig","reason","canUseUnaggregatedDomain","useUnaggregatedDomain","normalizeUnaggregatedDomain","specifiedScales","parseSingleChannelDomain","convertDomainIfItIsDateTime","mapDomainToDataSignal","isDomainUnionWith","defaultDomain","unionWith","stackDimensions","normalizeSortField","fieldDefToSortBy","isStackedMeasure","domainSort","Raw","binSignal","getSignalName","isDataRefUnionedDomain","nonUnionDomain","isFieldRefUnionDomain","uniqueDomains","_s","sorts","unionDomainSorts","allData","mergeDomains","assembleScales","assembleScalesForModel","otherScaleProps","assembleScaleRange","domainRaw","assembleSelectionScaleDomain","ScaleComponent","typeWithExplicit","RANGE_PROPERTIES","getBinStepSignal","updatedName","binCount","parseRangeForChannel","specifiedScale","supportedByScaleType","channelIncompatability","parseScheme","sizeRangeMin","xyStepSignals","maxBandSize","minXYStep","pointStep","MAX_SIZE_RANGE_STEP_RATIO","sizeRangeMax","rMax","rMin","interpolateRange","defaultContinuousToDiscreteCount","defaultRange","isExtendedScheme","widthStep","heightStep","parseScaleProperty","localScaleCmpt","mergedScaleCmpt","specifiedValue","scalePadding","scalePaddingInner","scaleRules","parseUnitScaleProperty","parseNonUnitScaleProperty","barConfig","continuousPadding","paddingValue","bandPaddingInner","paddingInnerValue","bandPaddingOuter","xReverse","specifiedDomain","parseScaleRange","rangeWithExplicit","parseUnitScaleRange","valueWithExplicit","parseScaleCore","scaleComponents","sType","defaultScaleType","channelSupportScaleType","specifiedType","fieldDefType","parseUnitScaleCore","scaleTypeWithExplicitIndex","explicitScaleType","childScaleType","scaleTypeTieBreaker","childScale","renameScale","parseNonUnitScaleCore","NameMap","nameMap","oldName","Model","parentGivenName","correctDataNames","initTitle","scaleNameMap","projectionNameMap","signalNameMap","specType","compositionConfig","spacingConfig","extractCompositionLayout","outputNodeRefCounts","titleInternal","parseScale","parseLayoutSize","renameTopLevelLayoutSizeSignal","parseSelections","parseData","parseAxesAndHeaders","parseLegends","parseMarkGroup","ignoreRange","parseScales","assembleGroupStyle","assembleEncodeFromView","baseView","assembleGroupEncodeEntry","isTopLevel","encodeEntry","assembleLayout","titleBand","headerComponentIndex","assembleLayoutTitleBand","assembleDefaultLayout","assembleHeaderMarks","headerMarks","assembleAxes","axisComponents","assembleProjections","projections","assembleProjectionsForModelAndChildren","titleNoEncoding","assembleGroup","assembleSignals","assembleMarks","getDataName","fullName","oldSignalName","originalScaleName","localScaleComponent","variableName","origName","hasAxisOrientSignalRef","hasOrientSignalRef","ModelWithField","r1","getMapping","acc","DensityTransformNode","specifiedAs","density","FilterInvalidNode","make","vegaFilters","FlattenTransformNode","flatten","FoldTransformNode","fold","GeoJSONNode","parseAll","geoJsonCounter","coordinates","pair","GeoPointNode","ImputeNode","processSequence","keyvals","imputeTransform","imputedChannel","keyChannel","groupbyFields","LoessTransformNode","loess","LookupNode","secondary","fromOutputNode","isLookupData","fromSource","findSource","fromOutputName","Lookup","isLookupSelection","materialized","lookup","foreign","asName","QuantileTransformNode","RegressionTransformNode","regression","PivotTransformNode","pivot","SampleTransformNode","sample","makeWalkTree","datasetIndex","walkTree","dataSource","parseFacetHeader","makeHeaderComponent","mergeChildAxis","axisComponent","mainAxis","parseChildrenLayoutSize","parseNonUnitLayoutSizeForChannel","layoutSizeCmpt","mergedSize","childSize","scaleResolve","defaultUnitSize","facetSortFieldName","FacetModel","buildModel","initFacet","initFacetFieldDef","normalizedFacet","parseFacetHeaders","assembleSelectionTopLevelSignals","assembleSelectionData","getHeaderLayoutMixins","layoutMixins","layoutHeaderComponent","bandType","columnDistinctSignal","getCardinalityAggregateForChild","assembleFacet","facetRoot","outputName","cross","facetSortFields","facetSortOrder","ORTHOGONAL_ORIENT","assembleFacetData","assembleFacetSignals","otherData","formatMesh","mesh","otherFeature","feature","formatFeature","otherMesh","_j","existingSource","parseRoot","graticule","parentIsLayer","lookupCounter","derivedType","transformNode","parseTransformArray","implicitSelection","getImplicitFromSelection","implicitEncoding","mainFieldDef","dimensionChannelDef","getImplicitFromEncoding","rawName","mainName","lookupName","materializeSelections","facetName","makeJoinAggregateFromFacet","ConcatModel","getChildren","widthType","heightType","parseConcatLayoutSize","parseAxisGroup","layoutSignals","db","AXIS_COMPONENT_PROPERTIES_INDEX","AXIS_COMPONENT_PROPERTIES","AxisComponent","OPPOSITE_ORIENT","mergeAxisComponents","mergedAxisCmpts","childAxisCmpts","mergeAxisComponent","propsToAlwaysIncludeConfig","parseAxis","defaultOrient","typeBasedConfigTypes","isQuantitative","axisChannel","axisOrient","vlOnlyConfigTypes","vgConfigTypes","vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle","getAxisConfigs","getLabelAngle","hasValue","hasConfigValue","axisEncoding","axisEncode","axisEncodingPart","specifiedLabelsSpec","fixedShape","shapeMixins","defaultSize","markPropOrConfig","bandSize","markCompiler","vgMark","postEncodingTransform","shapeDef","vgThicknessChannel","FACETED_PATH_PREFIX","STACK_GROUP_PREFIX","getMarkGroup","fromPrefix","scaleClip","projectionClip","unitCount","parentCount","interactiveFlag","UnitModel","parentGivenSize","specifiedAxes","specifiedLegends","filledConfig","defaultFilled","originalMarkDef","specifiedOrient","xIsContinuous","yIsContinuous","xIsTemporal","yIsTemporal","cornerRadiusEnd","newProps","newProp","initMarkdef","initLayoutSize","initScales","initAxes","initLegends","isGeoShapeMark","hasGeoPosition","initScale","scaleInternal","_axis","axisSpec","initAxis","axisInternal","_legend","supportLegend","specifiedSize","parseUnitLayoutSize","selDefs","selCmpts","selectionConfig","safeName","parseUnitSelection","getPathGroups","hasCornerRadius","fieldScale","stackFieldGroup","groupUpdate","innerGroupUpdate","groupByField","strokeForeground","getGroupsForStackedBarWithCornerRadius","parseMarkGroups","hasSelections","isMulti","assembleTopLevelSignals","dataCopy","assembleUnitSelectionData","LayerModel","axisCount","oppositeOrient","parseLayerAxes","assembleLayerSelectionMarks","unitSize","isAnyConcatSpec","inputSpec","newLogger","firstPassCounter","secondPassCounter","optimizeDataflow","topLevelProperties","datasets","vgConfig","vlOnlyMarkSpecificConfigs","redirectTitleConfig","stripAndRedirectConfig","sourceIndex","newData","whereTo","assembleRootData","otherTopLevelProps","assembleTopLevelModel","autoSizeType","inverseSizeType","getFitType","getTopLevelProperties","normalized","accessorName","accessorFields","one","truthy","falsy","None","Error$1","Info","Debug","_len","_key","toNumber","sign","log1p","symexp","expm1","pan","lift","ground","d0","d1","dd","panLinear","panLog","panPow","panSymlog","da","zoomLinear","zoomLog","zoomPow","zoomSymlog","utcquarter","clampRange","isFunction","DESCENDING","ord","fmap","gen","ascending","compare1","compareN","delay","tid","extend","extentIndex","NULL","fastmap","has$1","clean","inherits","members","inrange","r0","isDate","isIterable","iterator","isRegExp","lerp","frac","DEFAULT_MAX_SIZE","lruCache","maxsize","array0","array1","n0","n1","i0","i1","reps","pad","padchar","toBoolean","defaultParser","toDate","parser","toSet","truncate","visitArray","EOL","QUOTE","NEWLINE","RETURN","objectConverter","inferColumns","columnSet","delimiter","reFormat","DELIMITER","parseRows","N","I","eof","eol","preformatBody","formatValue","formatRow","formatDate","convert","customConverter","formatBody","formatRows","topology","objects","features","geometries","bbox","geometry","transformPoint","x0","y0","kx","ky","arcs","points","ring","polygon","stitchedArcs","fragmentByStart","fragmentByEnd","fragments","emptyIndex","p1","p0","dp","ends","fg","gf","meshArcs","geom","geomsByArc","extract0","extract1","extract2","extract3","geoms","extractArcs","stitch","e10","e5","e2","tickSpec","power","log10","factor","i2","tickIncrement","tickStep","prefixExponent","formatSpecifier","specifier","FormatSpecifier","comma","precision","formatDecimalParts","toExponential","coefficient","toFixed","toLocaleString","toPrecision","formatRounded","formatPrefix","locale","grouping","thousands","currencyPrefix","currency","currencySuffix","decimal","numerals","formatNumerals","percent","minus","nan","newFormat","formatTypes","maybeSuffix","valuePrefix","valueSuffix","valueNegative","formatTrim","t0","t1","timeInterval","floori","offseti","previous","setTime","durationSecond","durationMinute","durationHour","durationDay","durationWeek","durationYear","timeDay","setHours","setDate","utcDay","setUTCHours","setUTCDate","unixDay","timeWeekday","timeSunday","timeMonday","timeTuesday","timeWednesday","timeThursday","timeFriday","timeSaturday","utcWeekday","utcSunday","utcMonday","utcTuesday","utcWednesday","utcThursday","utcFriday","utcSaturday","timeYear","setMonth","setFullYear","utcYear","setUTCMonth","setUTCFullYear","timeMonth","utcMonth","timeHour","utcHour","setUTCMinutes","timeMinute","utcMinute","setUTCSeconds","millisecond","descending","bisector","compare2","mid","YEAR","QUARTER","MONTH","WEEK","DATE","DAY","DAYOFYEAR","HOURS","MINUTES","SECONDS","MILLISECONDS","TIME_UNITS","UNITS","defaultSpecifiers","timeUnitSpecifier","specifiers","fmt","localYear","localDayOfYear","localWeekNum","localFirst","localDate","L","utcdayofyear","utcDayOfYear","utcweek","utcWeekNum","utcFirst","utcDate","inv","newDate","phase","getUnit","weekday","firstDay","localGet","localInv","timeFloor","utcGet","utcInv","utcFloor","timeIntervals","utcIntervals","utcInterval","ival","timeOffset","utcOffset","timeSequence","utcSequence","Milli","Seconds","Minutes","Hours","Day","Month","Year","intervals","locale_dateTime","dateTime","locale_date","locale_time","locale_periods","periods","locale_weekdays","days","locale_shortWeekdays","shortDays","locale_months","months","locale_shortMonths","shortMonths","periodRe","formatRe","periodLookup","formatLookup","weekdayRe","weekdayLookup","shortWeekdayRe","shortWeekdayLookup","monthRe","monthLookup","shortMonthRe","shortMonthLookup","formats","formatDayOfMonth","formatMicroseconds","formatYearISO","formatFullYearISO","formatHour24","formatHour12","formatDayOfYear","formatMilliseconds","formatMonthNumber","formatMinutes","formatUnixTimestamp","formatUnixTimestampSeconds","formatSeconds","formatWeekdayNumberMonday","formatWeekNumberSunday","formatWeekNumberISO","formatWeekdayNumberSunday","formatWeekNumberMonday","formatFullYear","formatZone","formatLiteralPercent","utcFormats","formatUTCDayOfMonth","formatUTCMicroseconds","formatUTCYearISO","formatUTCFullYearISO","formatUTCHour24","formatUTCHour12","formatUTCDayOfYear","formatUTCMilliseconds","formatUTCMonthNumber","formatUTCMinutes","formatUTCSeconds","formatUTCWeekdayNumberMonday","formatUTCWeekNumberSunday","formatUTCWeekNumberISO","formatUTCWeekdayNumberSunday","formatUTCWeekNumberMonday","formatUTCYear","formatUTCFullYear","formatUTCZone","parses","parseSpecifier","parseDayOfMonth","parseMicroseconds","parseYear","parseFullYear","parseHour24","parseDayOfYear","parseMilliseconds","parseMonthNumber","parseMinutes","parseQuarter","parseUnixTimestamp","parseUnixTimestampSeconds","parseSeconds","parseWeekdayNumberMonday","parseWeekNumberSunday","parseWeekNumberISO","parseWeekdayNumberSunday","parseWeekNumberMonday","parseZone","parseLiteralPercent","pads","newParse","Z","Q","V","W","U","utcFormat","utcParse","timeParse","numberRe","percentRe","requoteRe","requote","dISO","dow","UTCdISO","memoize","numberLocale","formatFloat","decimalChar","dec","rightmostDigit","formatSpan","precisionPrefix","precisionRound","precisionFixed","defaultNumberLocale","defaultTimeLocale","resetNumberFormatDefaultLocale","numberFormatLocale","definition","numberFormatDefaultLocale","timeMultiFormat","minute","hour","timeLocale","resetTimeFormatDefaultLocale","timeFormatDefaultLocale","createLocale","numberSpec","timeSpec","resetDefaultLocale","protocol_re","allowed_re","whitespace_re","fileProtocol","uri","localFile","file","fileAccess","isFile","loadFile","isAllowed","hasProtocol","defaultProtocol","rel","context","crossOrigin","fileLoader","fs","filename","accept","readFile","fileReject","httpLoader","fetch","response","ok","statusText","httpReject","isValid","typeParsers","boolean","integer","unknown","typeTests","typeList","inferType","inferTypes","delimitedFormat","delim","responseType","dsv","json","parseJSON","interior","exterior","topojson","csv","tsv","reader","read","schema","timeParser","utcParser","parsers","loaderFactory","UniqueList","idFunc","ids","asyncCallback","df","TUPLE_ID_KEY","TUPLE_ID","isTuple","tupleid","setid","ingest$1","derive","rederive","stableCompare","isChangeSet","rem","mod","remp","modp","reflow","modify","pulse","cur","modifies","CACHE","Parameters","OP_ID","NO_PARAMS","Operator","react","stamp","qrank","_update","parameters","flag","bit","targets","_targets","skip","initonly","argval","_argval","argops","_argops","deps","marshall","detach","evaluate","StopPropagation","rv","STREAM_ID","EventStream","receive","_filter","_apply","_consume","trg","stopPropagation","pause","dataflow","active","SKIP","onStream","onOperator","updater","connect","Pulse","materialize","addFilter","MultiPulse","pulses","changed","ADD","REM","MOD","changes","reentrant","ADD_REM","ADD_MOD","ALL","REFLOW","SOURCE","NO_SOURCE","NO_FIELDS","fork","addAll","addF","remF","modF","srcF","cleans","runAfter","nomod","NO_OPT","siftdown","Dataflow","_clock","_rank","_locale","_loader","_touched","_input","_pulse","_heap","ridx","cidx","siftup","Heap","_postrun","logMethod","_log","Transform","cleanThreshold","targetRank","rerank","queue","_enqueue","ingest","preload","_pending","requests","loadPending","request","querySelectorAll","prerun","postrun","_getPulse","priority","all","_running","enqueue","singlePulse","Definition","valueof","compareDefined","sd","value0","quantileSorted","quantiles","quartiles","estimateBandwidth","deviation","maxb","logb","divide","minstep","steps","eps","setRandom","bootstrapCI","samples","alpha","mu","dotbin","thresh","smoothing","pdf","cdf","icdf","SQRT2PI","nextSample","sampleNormal","rds","densityNormal","cumulativeNormal","quantileNormal","erfinv","gaussian","sigma","kde","support","bandwidth","kernel","sampleLogNormal","densityLogNormal","cumulativeLogNormal","quantileLogNormal","lognormal","mixture","dists","weights","distributions","sampleUniform","densityUniform","cumulativeUniform","quantileUniform","uniform","coef","predict","rSquared","ols","uX","uY","uXY","uX2","slope","xv","yv","ux","uy","visitPoints","SSE","SST","sse","sst","XY","ly","xy","YL","XYL","X2Y","c0","c1","YS","lx","quad","X3","X4","X2X2","poly","lhs","rhs","matrix","gaussianElimination","uncenter","maxiters","epsilon","bw","yhat","residuals","robustWeights","iter","edge","denom","xk","yk","tricube","xkw","updateInterval","medianResidual","cnt","MIN_RADIANS","sampleCurve","minSteps","maxSteps","minX","maxX","ymin","ymax","scaleY","pm","angleDelta","a0","a1","groupkey","measureName","noop","base_op","AggregateOps","__count__","mean_d","req","dev","q2","exponential","exp_r","exponentialb","ValidAggregateOps","createMeasure","compareIndex","_ops","aggregate_param","compileMeasures","getreqs","ctr","TupleStore","reset","measure","prototype$1","Aggregate","_adds","_mods","_alen","_mlen","_drop","_cross","_dims","_dnames","_measures","_countOnly","_counts","_prev","_inputs","_outputs","Bin","SortedList","resort","Collect","Compare","update$5","CountPattern","Cross","_add","_rem","_ext","_q","quartile","ci","_ci","aggr","collect","cells","inputMap","inputVisit","cellkey","aggregate_params","mname","outname","newcell","newtuple","celltuple","counts","adds","mods","_bins","b0","b1","tcase","case","_parameterCheck","_match","_stop","_finish","stopwords","_tuples","Distributions","normal","FUNCTION","Density","fieldNames","partition$1","DotBin","Expression","update$4","Extent","Subflow","Facet","_keys","Field","update$3","Filter","Flatten","Fold","Formula","Generate","distribution","minsteps","maxsteps","autostep","detachSubflow","flow","subflow","flows","sf","_group","detached","initTargets","act","rekey","k0","k1","isMod","revisit","arrays","maxlen","fnames","Methods","Empty","Impute","JoinAggregate","KDE","Key","update$2","Load","MultiExtent","update$1","extents","MultiValues","Params","Pivot","PreFacet","Project","Proxy","Quantile","Relay","Sample","Sequence","Sieve","TimeUnit","gVals","kVal","getValue","getField","fName","kName","gNames","gKey","kMap","gMap","partition","_impute","cumulative","_transform","pivotKeys","aggregateParams","lut","dt","probs","cap","OUTPUT","TupleIndex","Values","_floor","u0","u1","tunits","WindowOps","row_number","dense_rank","drank","percent_rank","cume_dist","cume","ntile","lag","lead","first_value","last_value","nth_value","nth","prev_value","next_value","ValidWindowOps","WindowState","windows","countOnly","visitInputs","WindowOp","Window","processPartition","setWindow","adjustRange","bisect","_context","bezierCurveTo","_x0","_x1","_y0","_y1","Basis","BasisClosed","BasisOpen","Bundle","beta","_basis","_beta","wind","areaStart","areaEnd","lineEnd","lineTo","closePath","moveTo","_x3","_x4","_y3","_y4","custom","bundle","Cardinal","cardinal","CardinalOpen","CardinalClosed","_x5","_y5","pi","halfPi","tau","x1","y1","_l01_a","_l01_2a","_l12_a","_l12_2a","_l23_a","_l23_2a","CatmullRom","_alpha","x23","y23","catmullRom","CatmullRomClosed","CatmullRomOpen","Linear","LinearClosed","slope3","h0","h1","s0","slope2","MonotoneX","MonotoneY","ReflectContext","Natural","controlPoints","Step","_t0","px","py","tauEpsilon","Path","_append","appendRound","quadraticCurveTo","arcTo","x21","y21","x01","y01","l01_2","x20","y20","l21_2","l20_2","l21","l01","t01","t21","ccw","cw","withPath","RangeError","arcInnerRadius","arcOuterRadius","arcStartAngle","arcEndAngle","arcPadAngle","cornerTangents","rc","ox","oy","x11","y11","x10","y10","x00","y00","d2","D","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","cx","cy","curve","defined0","x0z","y0z","arealine","lineX0","lineY0","lineY1","lineX1","draw","domCanvas","getContext","domImage","Image","ascendingBisect","bisectRight","bisectLeft","Color","darker","brighter","reI","reN","reP","reHex","reRgbInteger","reRgbPercent","reRgbaInteger","reRgbaPercent","reHslPercent","reHslaPercent","named","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blueviolet","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","plum","powderblue","rebeccapurple","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen","color_formatHex","rgb","formatHex","color_formatRgb","formatRgb","rgbn","Rgb","rgba","hsla","rgbConvert","rgb_formatHex","hex","rgb_formatRgb","clampa","clampi","Hsl","hslConvert","hsl","clamph","clampt","hsl2rgb","m2","v0","v3","t2","t3","displayable","formatHex8","formatHsl","hue","nogamma","rgbGamma","gamma","rgbSpline","spline","colors","rgbBasis","rgbBasisClosed","isNumberArray","ArrayBuffer","isView","DataView","numberArray","genericArray","nb","na","reA","reB","am","bm","bs","bi","bimap","polymap","transformer","untransform","piecewise","rescale","clamper","invert","rangeRound","continuous","initRange","initInterpolator","interpolator","tickFormat","linearish","prestep","maxIter","transformLog","transformExp","transformLogn","transformExpn","pow10","reflect","loggish","logs","pows","log2","logp","powp","transformPow","transformSqrt","transformSquare","powish","transformSymlog","transformSymexp","symlogish","ticker","tickIntervals","tickInterval","utcTicks","utcTickInterval","timeTicks","timeTickInterval","calendar","formatMillisecond","formatSecond","formatMinute","formatHour","formatDay","formatWeek","formatMonth","formatYear","k10","sequentialPow","k21","r2","divergingPow","InternMap","keyof","defineProperties","_intern","intern_get","intern_set","intern_delete","InternSet","svgNode","translateX","translateY","rotate","skewX","scaleX","interpolateTransform","pxComma","pxParen","degParen","xa","ya","xb","yb","interpolateTransformCss","DOMMatrix","WebKitCSSMatrix","isIdentity","decompose","interpolateTransformSvg","createElementNS","baseVal","consolidate","cosh","zoomRho","rho","rho2","rho4","ux0","uy0","w0","ux1","uy1","w1","coshr0","tanh","sinh","duration","_1","_2","hslLong","Xn","Yn","Zn","labConvert","Lab","Hcl","hcl2lab","rgb2lrgb","xyz2lab","lab","lab2xyz","lrgb2rgb","hcl","hclConvert","hclLong","A","B","C","ED","EB","BC_DA","Cubehelix","cubehelixConvert","cubehelix","cubehelixGamma","cubehelixLong","bandSpace","space","Log","Pow","Sqrt","Symlog","Time","Sequential","Diverging","Quantize","Threshold","Ordinal","Point","Band","BinOrdinal","Continuous","Discrete","Discretizing","Interpolating","Temporal","ordinalRange","range$1","invertRange","pointish","VEGA_SCALE","registerScale","invertExtent","invertRangeExtent","isValidScaleType","hasType","isDiscretizing","isLogarithmic","isInterpolating","sequentialLog","sequentialSymlog","divergingLog","divergingSymlog","thresholds","scaleBinOrdinal","scaleProps","interpolateColors","quantizeInterpolator","scaleFraction","scale$1","interp","palette","schemes","accent","category10","category20","category20b","category20c","dark2","observable10","paired","pastel1","pastel2","set1","set2","set3","tableau10","tableau20","blues","greens","greys","oranges","purples","reds","blueGreen","bluePurple","greenBlue","orangeRed","purpleBlue","purpleBlueGreen","purpleRed","redPurple","yellowGreen","yellowOrangeBrown","yellowOrangeRed","blueOrange","brownBlueGreen","purpleGreen","purpleOrange","redBlue","redGrey","yellowGreenBlue","redYellowBlue","redYellowGreen","pinkYellowGreen","spectral","viridis","magma","inferno","plasma","cividis","rainbow","sinebow","turbo","browns","tealBlues","teals","warmGreys","goldGreen","goldOrange","goldRed","lightGreyRed","lightGreyTeal","lightMulti","lightOrange","lightTealBlue","darkBlue","darkGold","darkGreen","darkMulti","darkRed","SymbolLegend","DiscreteLegend","defaultFormatter","minStep","validTicks","endpoints","tickValues","noSkip","varfmt","tickLog","labelValues","binValues","thresholdValues","isDiscreteRange","labelFormat","thresholdFormat","formatRange","formatDiscrete","formatPoint","dflt","domainCaption","isTemporal","gradient_id","patternPrefix","isGradient","gradientRef","Gradient","stops","curves","orientation","paramCounts","commandPattern","numberPattern","spacePattern","flagPattern","commands","cmd","paramCount","segment","ws","DegToRad","HalfPi","Tau","HalfSqrt3","segmentCache","bezierCache","bezier","th0","th1","rx","ry","sin_th","cos_th","a00","a01","a10","a11","cos_th0","sin_th0","cos_th1","sin_th1","th_half","sin_th_h2","x3","y3","sX","sY","pathRender","tempX","tempY","tempControlX","tempControlY","controlX","controlY","anchorX","anchorY","beginPath","drawArc","coords","seg","large","sweep","rotateX","th","pl","sfactor_sq","sfactor","th_arc","segs","th2","th3","segments","bez","Tan30","builtins","customSymbol","rectangleX","rectangleY","rectangleWidth","rectangleHeight","vg_rect","crTL","crTR","crBL","crBR","rectangle","tl","tr","br","vg_trail","ready","w2","ud","hypot","value$1","arcShape","padRadius","da0","da1","ap","rp","rc0","rc1","oc","x32","y32","intersect","ax","ay","bx","kc","centroid","areavShape","areahShape","lineShape","rectShape","symbolShape","trailShape","clip_id","resetSVGClipId","clip$1","_defs","clipping","Bounds","union","Item","GroupItem","equals","expand","rotatedPoints","encloses","alignsWith","ResourceLoader","customLoader","sanitizeURL","increment","decrement","loadImage","img","cors","onload","onerror","complete","poll","boundStroke","miter","sw","miterAdjustment","circleThreshold","rot","ma","mb","mc","md","addL","addX","addY","addp","addpL","boundContext","deg","context$1","px1","py1","px2","py2","quadExtrema","px3","py3","cubicExtrema","sa","ea","cubic","intersectPath","brush","isPointInPath","intersectPoint","intersectRect","intersectRule","intersectBoxLine","globalCompositeOperation","addStops","addColorStop","createRadialGradient","ictx","fillStyle","createLinearGradient","fillRect","createPattern","globalAlpha","lw","strokeStyle","lineWidth","lineCap","lineJoin","miterLimit","setLineDash","lineDashOffset","zorder","scene","zdirty","zitems","pickVisit","hit","drawAll","drawPath","drawOne","pick$1","gx","gy","pixelRatio","hitPath","isPointInStroke","pickPath","translateItem","markItemPath","isect","tag","nested","attr","emit","rotateItem","markMultiItemPath","tip","clipGroup","offset$1","emitRectangle","off","rectanglePath","hitBackground","hitForeground","hitCorner","noBound","markTypes","fore","save","dw","dh","ix","pickMark","foreground","getImage","imageWidth","imageHeight","imageXOffset","imageYOffset","ar0","ar1","imageSmoothingEnabled","drawImage","xOffset","yOffset","path$1","pathCache","path$2","transformItem","draw$2","widthCache","textMetrics","measureWidth","estimateWidth","useCanvas","use","_estimateWidth","textValue","currentFontHeight","_measureWidth","currentFont","measureText","textLines","multiLineOffset","widthGetter","rtl","fontFamily","fontVariant","textAlign","tempBounds","anchorPoint","lh","fillText","strokeText","Marks","boundItem","DUMMY","boundMark","hasItems","sceneToJSON","sceneFromJSON","Scenegraph","createMark","markdef","domCreate","doc","ns","domFind","tagName","domChild","ownerDocument","domClear","cssClass","clientLeft","clientTop","customTooltip","_active","_handlers","_tooltip","defaultTooltip","_el","_obj","firstChild","_origin","_scene","_handlerIndex","eventName","handleHref","MouseEvent","dispatchEvent","handleTooltip","show","mdef","resolveItem","getItemBoundingClientRect","Renderer","_bgcolor","bgcolor","_width","_height","_scale","dirty","_call","_render","renderAsync","_ready","_load","redraw","DragEnterEvent","DragLeaveEvent","DragOverEvent","PointerDownEvent","PointerMoveEvent","PointerOutEvent","PointerOverEvent","MouseDownEvent","MouseMoveEvent","MouseOutEvent","MouseOverEvent","ClickEvent","MouseWheelEvent","TouchStartEvent","TouchMoveEvent","TouchEndEvent","Events","TooltipShowEvent","TooltipHideEvent","HrefEvent","CanvasHandler","_down","_touch","_first","_events","pointermove","dragover","pointerout","inactive","dragleave","_canvas","eventListenerCheck","DOMMouseScroll","fire","pointerdown","mousedown","click","touchstart","pickEvent","changedTouches","touchmove","touchend","vegaType","eventBundle","fireAll","moveEvents","overEvents","outEvents","exit","CanvasRenderer","_options","_redraw","_dirty","_tempb","externalContext","inDOM","parentNode","ratio","devicePixelRatio","setTransform","vb","viewBounds","clipToBounds","clearRect","SVGHandler","_hrefHandler","listener","_tooltipHandler","_svg","__data__","ARIA_HIDDEN","ARIA_LABEL","ARIA_ROLE","ARIA_ROLEDESCRIPTION","GRAPHICS_OBJECT","GRAPHICS_SYMBOL","roledesc","AriaIgnore","AriaGuides","caption","extractTitle","channelCaption","titleCaption","AriaEncode","ariaItemAttributes","hide","ariaMarkAttributes","ariaGuide","ariaMark","innerText","attrText","markup","outer","inner","close","serializeXML","_serialize","hasAttributes","attributes","hasChildNodes","nodeType","nodeValue","stylesAttr","stylesCss","rootAttributes","xmlns","svgns","SVGRenderer","_dirtyID","_root","_clearDefs","setAttributeNS","setAttributes","RootIndex","setProperty","viewBox","bg","_dirtyCheck","_dirtyAll","isDirty","ownerSVGElement","dirtyParents","isGroup","sibling","previousSibling","__values__","mark_extras","setStyle","updateGradient","updateClipping","grad","pt","preserveAspectRatio","fx","fy","fr","cg","siblingCheck","nextSibling","ts","removeAttributeNS","removeProperty","SVGStringRenderer","_text","class","attrList","_hrefs","prefixed","styleList","display","OPTS","svgMarkTypes","svgOnTop","setHybridRendererOptions","HybridRenderer","_svgRenderer","_canvasRenderer","_root_el","bottomEl","topEl","_svgEl","_canvasEl","pointerEvents","canvasMarkTypes","HybridHandler","Canvas","Hybrid","RenderType","PNG","SVG","modules","renderModule","hits","intersectMark","intersectGroup","visitMark","intersectItem","headless","clipBounds","boundClip","TOLERANCE","sceneEqual","pathEqual","ka","kb","objectEqual","resetSVGDefIds","Top","Left","Right","Bottom","Start","Middle","End","Group","AxisRole","TitleRole","LegendRole","RowHeader","RowFooter","RowTitle","ColHeader","ColFooter","ColTitle","FitX","FitY","All","Each","Flush","Column","Row","Bound","rebound","markBounds","COUNTER_NAME","Overlap","_signals","scenegraph","lookup$1","Init","methods","parity","greedy","sep","hasOverlap","hasBounds","Render","separation","boundScale","boundTolerance","tolerance","boundTest","boundOrient","isYAxis","axisLayout","axisIndices","dl","axisTitleLayout","auto","bboxFlush","bboxFull","offsetValue","gridLayout","nodirty","alignCol","alignRow","padCol","padRow","ncols","nrows","xExtent","xMax","yExtent","yMax","boxes","boundFlush","boundFull","bf","layoutTitle","legendParams","offsets","legendLayout","_bounds","ex","ey","tpad","tx","ty","legendTitleOffset","legendGroupLayout","legendBounds","widths","legendEntryLayout","lr","noBar","vgrad","ViewLayout","AxisTicks","DataJoin","defaultItemCreate","Encode","LegendEntries","views","rowheaders","rowfooters","colheaders","colfooters","rowtitle","coltitle","gridLayoutGroups","headerBand","footerBand","trellisLayout","xBounds","yBounds","titleLayout","_autosize","viewWidth","viewHeight","_resizeView","viewSizeLayout","layoutGroup","shouldReflow","newMap","fmod","encoders","reenter","fraction","lskip","perc","adjust","labelFraction","perc2","sourceX","sourceY","targetX","targetY","LinkPath","Paths","rr","iy","sr","ss","tc","mr","Pie","includePad","Scale","domainCheck","adjustScheme","flip","SortItems","isContinuousColor","rawDomain","scaleKey","configureRangeStep","scheme$1","schemeExtent","interpolateGamma","schemeCount","configureScheme","configureRange","configureBins","includeZero","padDomain","domainImplicit","configureDomain","Zero","Center","Normalize","DefOutput","Stack","stackCenter","stackNormalize","stackZero","lastPos","lastNeg","streamGeometry","streamGeometryType","streamObjectType","Feature","FeatureCollection","Sphere","sphere","MultiPoint","LineString","streamLine","MultiLineString","Polygon","streamPolygon","MultiPolygon","GeometryCollection","closed","coordinate","polygonStart","polygonEnd","Adder","_partials","_n","quarterPi","areaSum","areaRingSum","areaStream","areaRingStart","areaRingEnd","areaPointFirst","areaPoint","boundsStream","X0","Y0","Z0","X1","Y1","Z1","Z2","centroidStream","centroidPoint","centroidLineStart","centroidLineEnd","centroidRingStart","centroidRingEnd","centroidPointFirstLine","centroidPointLine","centroidPointFirstRing","centroidPointRing","PathContext","pointRadius","lengthRing","lengthSum","lengthStream","lengthPointFirst","lengthPoint","cacheDigits","cacheAppend","cacheRadius","cacheCircle","PathString","projectionStream","contextStream","lines","rejoin","Intersection","compareIntersection","startInside","subject","pointEqual","isSubject","spherical","cartesian","lambda","phi","cosPhi","cartesianDot","cartesianCross","cartesianAddInPlace","cartesianScale","vector","cartesianNormalizeInPlace","pointVisible","clipLine","sink","ringBuffer","ringSink","polygonStarted","pointRing","ringStart","ringEnd","sinPhi","winding","point0","lambda0","phi0","sinPhi0","cosPhi0","lambda1","sinPhi1","cosPhi1","point1","phi1","absDelta","antimeridian","intersection","phiArc","polygonContains","pointLine","ringSegments","validSegment","sign0","sign1","sinLambda0Lambda1","clipAntimeridianIntersect","circleRadius","cosRadius","clipMax","clipMin","clipRectangle","visible","corner","comparePoint","ca","x__","y__","v__","x_","y_","v_","activeStream","bufferStream","clipStream","linePoint","polygonInside","cleanInside","compose","rotationIdentity","deltaLambda","deltaPhi","deltaGamma","rotationLambda","rotationPhiGamma","forwardRotationLambda","rotation","cosDeltaPhi","sinDeltaPhi","cosDeltaGamma","sinDeltaGamma","TransformStream","fitBounds","clipExtent","fitExtent","fitSize","fitWidth","fitHeight","cosMinDistance","delta2","resampleLineTo","phi2","lambda2","dx2","dy2","dz","lambda00","b00","c00","resampleStream","ringPoint","resampleNone","transformRadians","scaleTranslateRotate","scaleTranslate","cosAlpha","sinAlpha","ai","fi","projectionMutator","projectAt","projectResample","projectTransform","projectRotateTransform","cacheStream","preclip","postclip","recenter","resample","transformRotate","clipAngle","cr","smallRadius","notHemisphere","two","n2","n2n2","n1n2","determinant","n1xn2","uu","polar","v00","point2","sinRadius","circleStream","reflectX","reflectY","conicProjection","parallels","conicEqualAreaRaw","sy0","forward","cylindricalEqualAreaRaw","r0y","conicEqualArea","azimuthalRaw","azimuthalInvert","cc","azimuthalEqualAreaRaw","cxcy","azimuthalEquidistantRaw","mercatorRaw","mercatorProjection","reclip","tany","conicConformalRaw","equirectangularRaw","conicEquidistantRaw","nx","A1","A2","A3","A4","equalEarthRaw","l2","l6","gnomonicRaw","naturalEarth1Raw","phi4","orthographicRaw","stereographicRaw","transverseMercatorRaw","sqrt2","mollweideBromleyTheta","cp","cpsinPhi","mollweideRaw","mollweideBromleyRaw","defaultPath","projectionProperties","getProjectionPath","albers","albersusa","lower48Point","alaskaPoint","hawaiiPoint","lower48","alaska","hawaii","pointStream","albersUsa","streams","azimuthalequalarea","azimuthalequidistant","conicconformal","conicequalarea","conicequidistant","equalEarth","equirectangular","gnomonic","mercator","mollweide","naturalEarth1","orthographic","stereographic","transversemercator","graticuleX","graticuleY","contours","smoothLinear","tz","contour","polygons","holes","startIndex","endIndex","isorings","hole","xt","yt","_0","ringContains","xi","yi","pj","xj","yj","segmentContains","collinear","Isocontour","transformPolygon","transformRing","density2D","weight","values0","values1","blurX","blurY","cellSize","KDE2D","levels","paths","transformPaths","PARAMS","Contour","GeoJSON","GeoPath","GeoPoint","GeoShape","Graticule","DX","DY","outline","extentMajor","extentMinor","stepMajor","stepMinor","Heatmap","dependency","$x","$y","$value","$max","Projection","ym","yp","leaf","defaultX","defaultY","quadtree","Quadtree","leaf_copy","_features","_points","lon","lat","initPath","shapeGenerator","shared","dep","opacity_","color_","can","getImageData","pix","putImageData","toCanvas","featurize","collectGeoJSON","treeProto","vx","vy","cover","xz","yz","quads","retainer","removeAll","visitAfter","dispatch","Dispatch","typename","T","taskHead","taskTail","timeout","pokeDelay","clockLast","clockNow","clockSkew","clock","performance","setFrame","requestAnimationFrame","clearNow","Timer","_time","_next","timer","restart","wake","timerFlush","sleep","nap","poke","clearInterval","initialAngle","nodeById","nodeId","ForceMap","strength","collide","radii","iterations","ri","ri2","prepare","rj","jiggle","_nodes","_random","nbody","strengths","distanceMin2","distanceMax2","accumulate","distanceMin","distanceMax","link","links","distances","bias","distance","initializeStrength","initializeDistance","Forces","ForceParams","ForceConfig","ForceOutput","Force","setup","sim","forces","getForce","numForces","setForceParam","hierarchy","mapChildren","objectChildren","childs","Node","eachBefore","computeHeight","copyData","optional","required","constantZero","iters","simulation","alphaMin","alphaDecay","alphaTarget","velocityDecay","stepper","initializeNodes","initializeForce","randomSource","closest","stopped","static","finish","eachAfter","aNodes","ancestors","bNodes","leastCommonAncestor","descendants","leaves","extendBasis","enclosesWeakAll","enclosesNot","encloseBasis2","encloseBasis3","dr","enclosesWeak","encloseBasis","r21","r3","a2","a3","b2","b3","c3","d3","ab","place","score","packSiblingsRandom","circles","aa","sj","sk","pack","shuffle","packEncloseRandom","defaultRadius","radiusLeaf","packChildrenRandom","translateChild","preroot","ambiguous","imputed","defaultId","defaultParentId","parentId","stratify","nodeKey","currentId","currentParentId","nodeByKey","slash","parentof","defaultSeparation","nextLeft","nextRight","moveSubtree","wm","wp","nextAncestor","vim","TreeNode","meanXReduce","maxYReduce","squarifyRatio","sumValue","minValue","maxValue","newRatio","minRatio","dice","squarify","resquarify","_squarify","Nest","nest","valuesByKey","keyValue","HierarchyLayout","setParams","setFields","Output$3","Pack","Output$2","Partition","Stratify","positionNode","parentKey","Layouts","tidy","nodeSize","treeRoot","firstWalk","secondWalk","sizeNode","siblings","executeShifts","midpoint","vip","vop","vom","sip","sop","som","apportion","cluster","previousNode","meanX","maxY","leafLeft","leafRight","Output$1","Tree","TreeLinks","Tiles","binary","sums","valueOffset","valueTarget","valueLeft","valueRight","slicedice","Treemap","tile","paddingStack","paddingTop","paddingRight","paddingBottom","paddingLeft","treemap","ALPHA_MASK","getBuffer","DIV","RIGHT0","RIGHT1","outOfBounds","textWidth","textHeight","collision","bm0","bm1","getRange","X_DIR","Y_DIR","Aligns","Baselines","boundary","isInside","anchorCode","TOP","MIDDLE","BOTTOM","placeAreaLabel","bitmaps","avoidBaseMark","markIndex","areaWidth","maxAreaWidth","tryLabel","_xMid","_yMid","swapTmp","labelPlaced","labelPlaced2","setRange","bm2","bitmap","labelLayout","texts","avoidMarks","lineAnchor","positions","getOffsets","anchors","getAnchors","grouptype","isGroupArea","markBoundary","infPadding","isNaiveGroupArea","maxTextWidth","maxTextHeight","_set","_clear","indexStart","indexEnd","clearRange","Bitmap","scaler","labelInside","baseMark","border","baseMarkContext","strokeContext","baseMarkBuffer","strokeBuffer","layer1","layer2","strokeAlpha","baseMarkAlpha","markBitmaps","baseBitmaps","sizeFactor","insideFactor","placeMarkLabel","Anchors","Label","Loess","null","Regression","dof","degreesOfFreedom","dom","elen","flen","Qnew","hh","bvirt","enow","fnow","eindex","findex","hindex","vec","C1","C2","orient2d","detleft","detright","det","detsum","acxtail","acytail","bcxtail","bcytail","ahi","alo","bhi","blo","_i","u3","acx","bcx","acy","bcy","errbound","C1len","C2len","Dlen","orient2dadapt","EDGE_STACK","Delaunator","getX","defaultGetX","getY","defaultGetY","maxTriangles","_triangles","_halfedges","_hashSize","_hullPrev","_hullNext","_hullTri","_hullHash","_ids","_dists","hullPrev","hullNext","hullTri","hullHash","minY","minDist","i0x","i0y","i1x","i1y","minRadius","circumradius","i2x","i2y","quicksort","hull","triangles","halfedges","cl","circumcenter","_cx","_cy","_hullStart","hullSize","_hashKey","trianglesLen","_addTriangle","_legalize","pseudoAngle","ar","inCircle","hbl","_link","bp","tempDist","Voronoi","delaunay","xmin","xmax","_circumcenters","vectors","_init","circumcenters","inedges","ti","tj","_renderSegment","_project","renderBounds","renderCell","_clip","cellPolygons","cellPolygon","_regioncode","_clipSegment","_step","neighbors","cj","loop","li","aj","lj","_cell","e0","_simplify","_clipInfinite","_clipFinite","e1","sx0","sx1","sy1","_edgecode","_edge","vx0","vy0","vxn","vyn","pointX","pointY","jitter","Delaunay","flatArray","flatIterable","_delaunator","_hullIndex","hullIndex","voronoi","dc","renderHull","renderPoints","hullPolygon","renderTriangle","trianglePolygons","trianglePolygon","defaultExtent","toPathString","cloudRadians","cloudSprite","contextAndRatio","di","sprite","w32","maxh","wcr","wsr","hcr","hsr","xoff","yoff","hasText","pixels","seenRow","cloudCollide","board","msx","cloudBounds","collideRects","archimedeanSpiral","functor","spirals","archimedean","rectangular","Wordcloud","spiral","words","cloud","dxdy","startX","startY","maxDelta","zeroArray","tags","fontSizeRange","fsize","sizeScale","array8","array16","array32","Dimension","query","onAdd","added","dim","SortedIndex","addi","oldv","oldi","addv","index0","value1","index1","reindex","CrossFilter","lengthen","_index","Bitmaps","_indices","ResolveFilter","reinit","remMap","modMap","indexMap","incrementOne","incrementAll","old","lo1","hi1","lo0","hi0","pass","scanIdentifier","codegen","fncall","STRING","REGEXP","if","forbidden","globalvar","fieldvar","outputGlobal","globals","Generators","stripQuotes","phi00","deltaSum","ranges","areaRing","dLambda","sdLambda","adLambda","W0","W1","z0","boundsLineStart","boundsLineEnd","boundsRingPoint","boundsRingStart","boundsRingEnd","inflection","phii","lambdai","rangeCompare","rangeContains","centroidPointCartesian","centroidLinePointFirst","centroidLinePoint","centroidRingPointFirst","centroidRingPoint","cz","SELECTION_GETTER","Intersect","Union","Or","And","SelectionId","$selectionId","UNIT_INDEX","testPoint","dval","others","E_union","E_intersect","R_union","R_intersect","selectionVisitor","scope","indexName","getData","indataRef","tuplesRef","dateObj","setYear","ScalePrefix","SignalPrefix","dataVisitor","scaleVisitor","addScaleDependency","scaleRef","getScale","nameOrFunction","maybeScale","geoMethod","methodName","globalMethod","geoArea","geoBounds","deltaMax","geoCentroid","channel_luminance_value","channelValue","luminance","equalArray","equalObject","removePredicate","accessors","treeNodes","_window","functionContext","isDefined","_len2","_key2","_len3","_key3","repl","_len4","_key4","pluck","contrast","color1","color2","lum1","lum2","monthFormat","monthAbbrevFormat","dayFormat","dayAbbrevFormat","inScope","pinchDistance","touches","pinchAngle","screen","containerSize","clientWidth","clientHeight","windowSize","bandspace","setdata","pathShape","retval","_trigger","lassoAppend","lasso","lassoPath","_ref","intersectLasso","pixelLasso","bb","MIN_SAFE_INTEGER","testx","testy","intersections","prevX","prevY","pointInPolygon","eventFunctions","thisPrefix","astVisitors","codegenParams","fnctx","visitors","__bandwidth","_bandwidth","_range","internalScaleFunctions","codeGenerator","getSignal","$expr","$fields","$params","miss","unitIdx","vl5","resUnit","resolved","multiRes","Skip","Swap","canonicalType","expressionCodegen","_compare","parseParameter","PARSERS","$ref","$key","$flat","parseParameters","parameterExpression","$field","$name","$encode","enc","encodeExpression","$output","$compare","$order","$tupleid","$subflow","subctx","operators","Context","Subcontext","ariaLabel","subcontext","$ingest","$format","$request","unresolved","operatorExpression","eventExpression","handlerExpression","eventConfig","parseOperator","parseOperatorParameters","parseUpdate","srcid","getState","dataset","setState","substate","Default","setCursor","globalCursor","dataref","_runtime","_viewWidth","_viewHeight","VIEW","NO_TRAP","trap","trackEventListener","_eventListeners","permit","_eventConfig","itemFilter","markTarget","invoke","RadioClass","Event","checked","option","valuesEqual","selected","selectedIndex","prepend","initializeRenderer","paddingObject","renderHeadless","_scenegraph","Width","Height","dataTest","signalTest","formatArray","_elBind","_renderType","_renderer","_handler","_globalCursor","_preventDefault","_timers","_resizeListeners","unpack","initializeEventConfig","_bind","bindings","_resize","resetSize","_resizeWidth","_resizeHeight","resizePadding","initializeResize","_background","user","watchPixelRatio","_watchPixelRatio","lookupSignal","findOperatorHandler","addOperatorListener","removeOperatorListener","_desc","_resetRenderer","rerun","addResizeListener","removeResizeListener","removeSignalListener","addDataListener","removeDataListener","_restart","elapsed","timestamp","prevent","allow","itemGroup","extension","eventExtend","timers","listeners","leaveSet","elBind","initializeAria","prevHandler","initializeHandler","binding","blob","Blob","createObjectURL","toBlobURL","toSVG","updatePixelRatio","media","matchMedia","parseAutosize","parsePadding","encoder","addEncode","addEncoders","extendEncode","MarkRole","AxisDomainRole","AxisGridRole","AxisLabelRole","AxisTickRole","AxisTitleRole","LegendBandRole","LegendEntryRole","LegendGradientRole","LegendLabelRole","LegendSymbolRole","LegendTitleRole","TitleTextRole","TitleSubtitleRole","applyDefault","entry$1","_color","resolveField","parseEncode","applyDefaults","parse$1","OUTER","OUTER_INVALID","outerError","parseSignal","addSignal","addBinding","Entry","refs","fieldRef$1","keyFieldRef","compareRef","aggrField","Scope$1","isSignal","hasSignal","specValue","deref","mergeStream","nestedStream","eventStream","streamParameters","addStream","markrole","filterMark","OP_VALUE_EXPR","mergeSources","FIELD_REF_ID","MULTIDOMAIN_SORT_OPS","parseLiteral","parseScaleInterpolate","parseScaleNice","parseArray","objectProperty","parseScaleBins","dataLookupError","explicitDomain","multipleDomain","singularDomain","valuesRef","parseSort","domainRef","extentRef","coll","addDataPipeline","ordinalMultipleDomain","quantileMultipleDomain","numericMultipleDomain","countsRef","sortRef","multidomain","parseParameter$1","Vertical","Index","Offset","Perc","Perc2","Value","GuideLabelStyle","GuideTitleStyle","GroupTitleStyle","GroupSubtitleStyle","Size","LegendScales","GroupMark","RectMark","RuleMark","SymbolMark","TextMark","guideGroup","isVertical","symbolDirection","gradientDirection","gradientWidth","gradientHeight","entryColumns","getEncoding","anchorExpr","alignExpr$1","extendOffset","guideMark","extras","legendGradient","userEncode","legendGradientDiscrete","dataRef","vv","alignExpr","baselineExpr","legendGradientLabels","overlap","gradientLabelLimit","gradientLabelOffset","legendSymbolGroups","xSignal","yEncode","baseFill","baseStroke","symbolBaseStrokeColor","isL","isR","isLR","isVG","exprAlign","exprAnchor","exprAngle","exprBaseline","getRole","parseTransform","pdef","lookupRef","parseIndexParameter","parseSubParameter","parseSubParameters","projectionRef","parameterValue","isField","isCompare","outerExpr","exprRef","outerField","isData","getDataRef","DataScope","fieldKey","addSortField","optype","sortKey","parseTrigger","trigger","parseMark","layoutRef","boundRef","keyRef","parseData$1","joinRef","$context","markpath","markRef","generates","encodeRef","pushState","subscope","addData","toRuntime","parseFacet","parseSubflow","popState","tol","parseOverlap","sieve","buildLegendEncode","getChannel","fromEntries","angleExpr","groupEncode","getSign","ifLeftTopExpr","ifX","ifXEnc","ifY","ifYEnc","ifTop","ifTopExpr","ifRight","ifRightExpr","$orient","ifEnc","ifExpr","isSimple","toExpr","ifOrient","fallback","styleProp","flushExpr","xyKeys","orientKeys","ticksRef","vscale","tickPos","gridStart","gridEnd","axisGrid","axisTicks","flushOffset","flushOn","axisLabels","pos0","pos1","axisDomain","titlePos","autoY","autoX","autoLayout","axisTitle","buildAxisEncode","parseScope","preprocessed","addProjection","addScale","upstream","analyze","isSubscope","addUpdate","streamSource","parseSignalUpdates","entryLayout","scaleCount","entryRef","legendSymbolLayout","getStyle","getFontSize","sizeExpression","_anchor","legendTitle","buildTitle","titleEncode","buildSubTitle","parseTitle","parseLambdas","rootEncode","signalObject","Scope","lambdas","_id","_subid","_nextsub","_encode","_lookup","_markpath","Subscope","propertyLambda","arrayLambda","objectLambda","collectSignals","parseView","defaultColor","lightGray","vref","annotate","isExpr$1","sig","hasOwnSignal","addScaleProj","projectionType","dataScope","__WEBPACK_EXTERNAL_MODULE__55__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","globalThis","toStringTag"],"sourceRoot":""} \ No newline at end of file